From: Andrea Bianco Date: Thu, 30 Jan 2020 13:35:00 +0000 (+0100) Subject: Built motion from commit (unavailable).|2.4.5 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22%7B%7Blicense.chat?a=commitdiff_plain;h=7356fd3abc8afdd3686955e81650c6d67243c108;p=motion2.git Built motion from commit (unavailable).|2.4.5 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 26bf6bd..be9640d 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1 +1 @@ -define({ "name": "xCALLY Motion API", "version": "2.4.5", "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-01-30T11:34:31.641Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); +define({ "name": "xCALLY Motion API", "version": "2.4.5", "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-01-30T13:28:37.106Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); diff --git a/apidoc/api_project.json b/apidoc/api_project.json index bfb39df..bb86dde 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1 +1 @@ -{ "name": "xCALLY Motion API", "version": "2.4.5", "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-01-30T11:34:31.641Z", "url": "http://apidocjs.com", "version": "0.17.7" } } +{ "name": "xCALLY Motion API", "version": "2.4.5", "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-01-30T13:28:37.106Z", "url": "http://apidocjs.com", "version": "0.17.7" } } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index e6827e4..b26e545 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 _0x34e8=['STRING','contactManager','integration','motionbar','jscripty','urlForward','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','action'];(function(_0x1d98bf,_0x51e9bf){var _0x50255d=function(_0x4f9a2e){while(--_0x4f9a2e){_0x1d98bf['push'](_0x1d98bf['shift']());}};_0x50255d(++_0x51e9bf);}(_0x34e8,0x12c));var _0x834e=function(_0x40f1f5,_0x238101){_0x40f1f5=_0x40f1f5-0x0;var _0x31ee99=_0x34e8[_0x40f1f5];return _0x31ee99;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')],'get':function(_0x35e6fb){return this['getDataValue'](_0x834e('0x3'));}},'action':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),'browser',_0x834e('0xa'),'script']],'msg':_0x834e('0xb')}},'comment':_0x834e('0xb')},'data1':{'type':Sequelize[_0x834e('0x4')](0x1000),'comment':_0x834e('0xc')},'data2':{'type':Sequelize[_0x834e('0x4')](0x1000),'comment':_0x834e('0xd')},'data3':{'type':Sequelize[_0x834e('0x4')](0x1000),'comment':_0x834e('0xe')},'data4':{'type':Sequelize[_0x834e('0x4')](0x1000)},'data5':{'type':Sequelize[_0x834e('0x4')](0x1000)},'data6':{'type':Sequelize[_0x834e('0x4')]},'data7':{'type':Sequelize[_0x834e('0xf')]}}; \ No newline at end of file +var _0x9c44=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','VIRTUAL','getDataValue','action','STRING','contactManager','jscripty','browser','bot'];(function(_0x570309,_0x2241ca){var _0x1d0f3d=function(_0x8f316f){while(--_0x8f316f){_0x570309['push'](_0x570309['shift']());}};_0x1d0f3d(++_0x2241ca);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x49c4('0x0')],'get':function(_0x18bf2d){return this[_0x49c4('0x1')](_0x49c4('0x2'));}},'action':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x49c4('0x4'),'integration','motionbar',_0x49c4('0x5'),'urlForward',_0x49c4('0x6'),_0x49c4('0x7'),_0x49c4('0x8')]],'msg':_0x49c4('0x9')}},'comment':_0x49c4('0x9')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x49c4('0xa')},'data2':{'type':Sequelize[_0x49c4('0x3')](0x1000),'comment':_0x49c4('0xb')},'data3':{'type':Sequelize[_0x49c4('0x3')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize[_0x49c4('0x3')](0x1000)},'data6':{'type':Sequelize[_0x49c4('0x3')]},'data7':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 6c59263..083c50d 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 _0x7e43=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','set','Content-Range','save','update','then','destroy','sendStatus','error','stack','name','send','body','Action','find','params','catch','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x3e89de,_0x2fd7f5){var _0x2b50ea=function(_0x50f47d){while(--_0x50f47d){_0x3e89de['push'](_0x3e89de['shift']());}};_0x2b50ea(++_0x2fd7f5);}(_0x7e43,0x15b));var _0x37e4=function(_0x3c173e,_0xff3612){_0x3c173e=_0x3c173e-0x0;var _0x484d60=_0x7e43[_0x3c173e];return _0x484d60;};'use strict';var pdf=require(_0x37e4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x37e4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x37e4('0x2'));var rp=require(_0x37e4('0x3'));var moment=require(_0x37e4('0x4'));var BPromise=require(_0x37e4('0x5'));var Mustache=require(_0x37e4('0x6'));var util=require(_0x37e4('0x7'));var path=require(_0x37e4('0x8'));var sox=require(_0x37e4('0x9'));var csv=require(_0x37e4('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x37e4('0xb'));var squel=require(_0x37e4('0xc'));var crypto=require(_0x37e4('0xd'));var jsforce=require(_0x37e4('0xe'));var deskjs=require(_0x37e4('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x37e4('0x10'));var Redis=require(_0x37e4('0x11'));var authService=require(_0x37e4('0x12'));var qs=require(_0x37e4('0x13'));var hardwareService=require(_0x37e4('0x14'));var logger=require(_0x37e4('0x15'))(_0x37e4('0x16'));var utils=require(_0x37e4('0x17'));var config=require(_0x37e4('0x18'));var db=require(_0x37e4('0x19'))['db'];function respondWithStatusCode(_0x5be47a,_0x103d15){_0x103d15=_0x103d15||0xcc;return function(_0x1b9caa){if(_0x1b9caa){return _0x5be47a['sendStatus'](_0x103d15);}return _0x5be47a[_0x37e4('0x1a')](_0x103d15)[_0x37e4('0x1b')]();};}function respondWithResult(_0x34d92e,_0xed17dc){_0xed17dc=_0xed17dc||0xc8;return function(_0x2c93ef){if(_0x2c93ef){return _0x34d92e[_0x37e4('0x1a')](_0xed17dc)[_0x37e4('0x1c')](_0x2c93ef);}};}function respondWithFilteredResult(_0x1cfed1,_0x296773){return function(_0x3bcd2a){if(_0x3bcd2a){var _0x4f6d52=_0x3bcd2a['count'],_0x5b514d=_0x296773['offset'],_0x596402=_0x296773['offset']+_0x296773[_0x37e4('0x1d')],_0x18f514;if(_0x596402>=_0x4f6d52){_0x596402=_0x4f6d52;_0x18f514=0xc8;}else{_0x18f514=0xce;}_0x1cfed1['status'](_0x18f514);return _0x1cfed1[_0x37e4('0x1e')](_0x37e4('0x1f'),_0x5b514d+'-'+_0x596402+'/'+_0x4f6d52)[_0x37e4('0x1c')](_0x3bcd2a);}return null;};}function patchUpdates(_0x156710){return function(_0x127ef0){try{jsonpatch['apply'](_0x127ef0,_0x156710,!![]);}catch(_0xafbdd5){return BPromise['reject'](_0xafbdd5);}return _0x127ef0[_0x37e4('0x20')]();};}function saveUpdates(_0x533e64,_0x372449){return function(_0x425943){if(_0x425943){return _0x425943[_0x37e4('0x21')](_0x533e64)[_0x37e4('0x22')](function(_0x2d3580){return _0x2d3580;});}return null;};}function removeEntity(_0x1e1c8a,_0x14b444){return function(_0x37871f){if(_0x37871f){return _0x37871f[_0x37e4('0x23')]()[_0x37e4('0x22')](function(){_0x1e1c8a[_0x37e4('0x1a')](0xcc)[_0x37e4('0x1b')]();});}};}function handleEntityNotFound(_0x41cdba,_0xc2b0e1){return function(_0x1f2fd2){if(!_0x1f2fd2){_0x41cdba[_0x37e4('0x24')](0x194);}return _0x1f2fd2;};}function handleError(_0x326108,_0x4f08ab){_0x4f08ab=_0x4f08ab||0x1f4;return function(_0x55cd8f){logger[_0x37e4('0x25')](_0x55cd8f[_0x37e4('0x26')]);if(_0x55cd8f[_0x37e4('0x27')]){delete _0x55cd8f[_0x37e4('0x27')];}_0x326108[_0x37e4('0x1a')](_0x4f08ab)[_0x37e4('0x28')](_0x55cd8f);};}exports[_0x37e4('0x21')]=function(_0x152a23,_0x170b7f){if(_0x152a23['body']['id']){delete _0x152a23[_0x37e4('0x29')]['id'];}return db[_0x37e4('0x2a')][_0x37e4('0x2b')]({'where':{'id':_0x152a23[_0x37e4('0x2c')]['id']}})[_0x37e4('0x22')](handleEntityNotFound(_0x170b7f,null))[_0x37e4('0x22')](saveUpdates(_0x152a23['body'],null))['then'](respondWithResult(_0x170b7f,null))[_0x37e4('0x2d')](handleError(_0x170b7f,null));};exports[_0x37e4('0x23')]=function(_0x5333f1,_0x1d38cd){return db[_0x37e4('0x2a')][_0x37e4('0x2b')]({'where':{'id':_0x5333f1[_0x37e4('0x2c')]['id']}})[_0x37e4('0x22')](handleEntityNotFound(_0x1d38cd,null))[_0x37e4('0x22')](removeEntity(_0x1d38cd,null))[_0x37e4('0x2d')](handleError(_0x1d38cd,null));}; \ No newline at end of file +var _0xa79d=['limit','set','Content-Range','reject','save','update','destroy','then','sendStatus','error','stack','name','send','body','Action','catch','find','params','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xa79d,0xc6));var _0xda79=function(_0x21e764,_0x232bf1){_0x21e764=_0x21e764-0x0;var _0x5ec253=_0xa79d[_0x21e764];return _0x5ec253;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xda79('0x0'));var rimraf=require(_0xda79('0x1'));var zipdir=require(_0xda79('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xda79('0x3'));var BPromise=require(_0xda79('0x4'));var Mustache=require('mustache');var util=require(_0xda79('0x5'));var path=require(_0xda79('0x6'));var sox=require(_0xda79('0x7'));var csv=require(_0xda79('0x8'));var ejs=require(_0xda79('0x9'));var fs=require('fs');var _=require(_0xda79('0xa'));var squel=require(_0xda79('0xb'));var crypto=require(_0xda79('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xda79('0xd'));var toCsv=require(_0xda79('0x8'));var querystring=require(_0xda79('0xe'));var Papa=require(_0xda79('0xf'));var Redis=require(_0xda79('0x10'));var authService=require(_0xda79('0x11'));var qs=require(_0xda79('0x12'));var hardwareService=require(_0xda79('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xda79('0x14'));var config=require(_0xda79('0x15'));var db=require(_0xda79('0x16'))['db'];function respondWithStatusCode(_0x5dbd0c,_0x445ede){_0x445ede=_0x445ede||0xcc;return function(_0x2933d9){if(_0x2933d9){return _0x5dbd0c['sendStatus'](_0x445ede);}return _0x5dbd0c[_0xda79('0x17')](_0x445ede)[_0xda79('0x18')]();};}function respondWithResult(_0x5ade54,_0x4d9261){_0x4d9261=_0x4d9261||0xc8;return function(_0x556bc3){if(_0x556bc3){return _0x5ade54[_0xda79('0x17')](_0x4d9261)[_0xda79('0x19')](_0x556bc3);}};}function respondWithFilteredResult(_0x4cf939,_0x1c4aa2){return function(_0x2208b5){if(_0x2208b5){var _0x371568=_0x2208b5['count'],_0x2cbd19=_0x1c4aa2[_0xda79('0x1a')],_0x4a87f0=_0x1c4aa2[_0xda79('0x1a')]+_0x1c4aa2[_0xda79('0x1b')],_0x3e3bdc;if(_0x4a87f0>=_0x371568){_0x4a87f0=_0x371568;_0x3e3bdc=0xc8;}else{_0x3e3bdc=0xce;}_0x4cf939['status'](_0x3e3bdc);return _0x4cf939[_0xda79('0x1c')](_0xda79('0x1d'),_0x2cbd19+'-'+_0x4a87f0+'/'+_0x371568)[_0xda79('0x19')](_0x2208b5);}return null;};}function patchUpdates(_0xe9a1fb){return function(_0x31f6e7){try{jsonpatch['apply'](_0x31f6e7,_0xe9a1fb,!![]);}catch(_0x34d3fc){return BPromise[_0xda79('0x1e')](_0x34d3fc);}return _0x31f6e7[_0xda79('0x1f')]();};}function saveUpdates(_0x173a59,_0x18e524){return function(_0x3bbbde){if(_0x3bbbde){return _0x3bbbde[_0xda79('0x20')](_0x173a59)['then'](function(_0x4adebe){return _0x4adebe;});}return null;};}function removeEntity(_0x5cbfc4,_0x3f9bc6){return function(_0x30842e){if(_0x30842e){return _0x30842e[_0xda79('0x21')]()[_0xda79('0x22')](function(){_0x5cbfc4[_0xda79('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x429d35,_0x467da7){return function(_0xb566ac){if(!_0xb566ac){_0x429d35[_0xda79('0x23')](0x194);}return _0xb566ac;};}function handleError(_0x21c45a,_0x130814){_0x130814=_0x130814||0x1f4;return function(_0x1da51c){logger[_0xda79('0x24')](_0x1da51c[_0xda79('0x25')]);if(_0x1da51c[_0xda79('0x26')]){delete _0x1da51c[_0xda79('0x26')];}_0x21c45a[_0xda79('0x17')](_0x130814)[_0xda79('0x27')](_0x1da51c);};}exports[_0xda79('0x20')]=function(_0x470275,_0xe4e639){if(_0x470275['body']['id']){delete _0x470275[_0xda79('0x28')]['id'];}return db[_0xda79('0x29')]['find']({'where':{'id':_0x470275['params']['id']}})[_0xda79('0x22')](handleEntityNotFound(_0xe4e639,null))[_0xda79('0x22')](saveUpdates(_0x470275[_0xda79('0x28')],null))[_0xda79('0x22')](respondWithResult(_0xe4e639,null))[_0xda79('0x2a')](handleError(_0xe4e639,null));};exports['destroy']=function(_0x470939,_0x3a9553){return db[_0xda79('0x29')][_0xda79('0x2b')]({'where':{'id':_0x470939[_0xda79('0x2c')]['id']}})[_0xda79('0x22')](handleEntityNotFound(_0x3a9553,null))[_0xda79('0x22')](removeEntity(_0x3a9553,null))[_0xda79('0x2a')](handleError(_0x3a9553,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index cb6203b..fce152a 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 _0xe8e8=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','../../config/logger','api'];(function(_0x53863e,_0x59c4ee){var _0x438b55=function(_0xce72e0){while(--_0xce72e0){_0x53863e['push'](_0x53863e['shift']());}};_0x438b55(++_0x59c4ee);}(_0xe8e8,0x1ed));var _0x8e8e=function(_0x461c8f,_0x1539bc){_0x461c8f=_0x461c8f-0x0;var _0x5429aa=_0xe8e8[_0x461c8f];return _0x5429aa;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8e8e('0x0'))(_0x8e8e('0x1'));var moment=require('moment');var BPromise=require(_0x8e8e('0x2'));var rp=require(_0x8e8e('0x3'));var fs=require('fs');var path=require(_0x8e8e('0x4'));var rimraf=require(_0x8e8e('0x5'));var config=require(_0x8e8e('0x6'));var attributes=require('./action.attributes');module[_0x8e8e('0x7')]=function(_0x443c06,_0x1e2ab1){return _0x443c06[_0x8e8e('0x8')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd37=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./action.attributes','define','tools_actions','lodash','util'];(function(_0x3f76c4,_0x113ffa){var _0x419a17=function(_0x4b09e2){while(--_0x4b09e2){_0x3f76c4['push'](_0x3f76c4['shift']());}};_0x419a17(++_0x113ffa);}(_0xbd37,0x1ea));var _0x7bd3=function(_0x545b28,_0x3cc402){_0x545b28=_0x545b28-0x0;var _0x108ec9=_0xbd37[_0x545b28];return _0x108ec9;};'use strict';var _=require(_0x7bd3('0x0'));var util=require(_0x7bd3('0x1'));var logger=require(_0x7bd3('0x2'))(_0x7bd3('0x3'));var moment=require(_0x7bd3('0x4'));var BPromise=require(_0x7bd3('0x5'));var rp=require(_0x7bd3('0x6'));var fs=require('fs');var path=require(_0x7bd3('0x7'));var rimraf=require(_0x7bd3('0x8'));var config=require('../../config/environment');var attributes=require(_0x7bd3('0x9'));module['exports']=function(_0x542a61,_0x34dda9){return _0x542a61[_0x7bd3('0xa')]('Action',attributes,{'tableName':_0x7bd3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 42f4e2a..23e6d75 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 _0x13c0=['request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x96b9f1,_0x100578){var _0x1943fe=function(_0x463026){while(--_0x463026){_0x96b9f1['push'](_0x96b9f1['shift']());}};_0x1943fe(++_0x100578);}(_0x13c0,0x79));var _0x013c=function(_0x3d61c6,_0x4571e6){_0x3d61c6=_0x3d61c6-0x0;var _0x47e0df=_0x13c0[_0x3d61c6];return _0x47e0df;};'use strict';var _=require(_0x013c('0x0'));var util=require(_0x013c('0x1'));var moment=require(_0x013c('0x2'));var BPromise=require(_0x013c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x013c('0x4'));var logger=require(_0x013c('0x5'))(_0x013c('0x6'));var config=require(_0x013c('0x7'));var jayson=require(_0x013c('0x8'));var client=jayson[_0x013c('0x9')][_0x013c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3decb5,_0x50caf2,_0x4cf99d){return new BPromise(function(_0x593053,_0x27c830){return client[_0x013c('0xb')](_0x3decb5,_0x4cf99d)['then'](function(_0x28c3a0){logger[_0x013c('0xc')](_0x013c('0xd'),_0x50caf2,_0x013c('0xe'));logger[_0x013c('0xf')](_0x013c('0x10'),_0x50caf2,_0x013c('0xe'),JSON[_0x013c('0x11')](_0x28c3a0));if(_0x28c3a0[_0x013c('0x12')]){if(_0x28c3a0[_0x013c('0x12')]['code']===0x1f4){logger['error'](_0x013c('0xd'),_0x50caf2,_0x28c3a0[_0x013c('0x12')][_0x013c('0x13')]);return _0x27c830(_0x28c3a0[_0x013c('0x12')]['message']);}logger[_0x013c('0x12')](_0x013c('0xd'),_0x50caf2,_0x28c3a0[_0x013c('0x12')][_0x013c('0x13')]);return _0x593053(_0x28c3a0[_0x013c('0x12')]['message']);}else{logger[_0x013c('0xc')](_0x013c('0xd'),_0x50caf2,_0x013c('0xe'));_0x593053(_0x28c3a0[_0x013c('0x14')][_0x013c('0x13')]);}})[_0x013c('0x15')](function(_0x6b8b5){logger[_0x013c('0x12')](_0x013c('0xd'),_0x50caf2,_0x6b8b5);_0x27c830(_0x6b8b5);});});} \ No newline at end of file +var _0xe644=['../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x49f096,_0xfc45e){var _0x515854=function(_0x3ad888){while(--_0x3ad888){_0x49f096['push'](_0x49f096['shift']());}};_0x515854(++_0xfc45e);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e64('0x0'));var util=require(_0x4e64('0x1'));var moment=require(_0x4e64('0x2'));var BPromise=require(_0x4e64('0x3'));var rs=require(_0x4e64('0x4'));var fs=require('fs');var Redis=require(_0x4e64('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e64('0x6'));var logger=require(_0x4e64('0x7'))(_0x4e64('0x8'));var config=require(_0x4e64('0x9'));var jayson=require(_0x4e64('0xa'));var client=jayson[_0x4e64('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x66faf,_0x12c40d,_0x5cce6e){return new BPromise(function(_0x4d5aa6,_0x8573c1){return client['request'](_0x66faf,_0x5cce6e)['then'](function(_0x2ebcfe){logger[_0x4e64('0xc')](_0x4e64('0xd'),_0x12c40d,_0x4e64('0xe'));logger[_0x4e64('0xf')](_0x4e64('0x10'),_0x12c40d,'request\x20sent',JSON[_0x4e64('0x11')](_0x2ebcfe));if(_0x2ebcfe[_0x4e64('0x12')]){if(_0x2ebcfe['error'][_0x4e64('0x13')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x12c40d,_0x2ebcfe[_0x4e64('0x12')]['message']);return _0x8573c1(_0x2ebcfe[_0x4e64('0x12')][_0x4e64('0x14')]);}logger[_0x4e64('0x12')](_0x4e64('0xd'),_0x12c40d,_0x2ebcfe[_0x4e64('0x12')][_0x4e64('0x14')]);return _0x4d5aa6(_0x2ebcfe[_0x4e64('0x12')]['message']);}else{logger[_0x4e64('0xc')](_0x4e64('0xd'),_0x12c40d,_0x4e64('0xe'));_0x4d5aa6(_0x2ebcfe['result'][_0x4e64('0x14')]);}})[_0x4e64('0x15')](function(_0x452f34){logger[_0x4e64('0x12')](_0x4e64('0xd'),_0x12c40d,_0x452f34);_0x8573c1(_0x452f34);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 867a02c..f55c234 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 _0x17d1=['/:id','isAuthenticated','exports','multer','util','express','Router','../../config/environment','./action.controller','put','update'];(function(_0x72895a,_0x433607){var _0x5226d5=function(_0x5b7d21){while(--_0x5b7d21){_0x72895a['push'](_0x72895a['shift']());}};_0x5226d5(++_0x433607);}(_0x17d1,0xc9));var _0x117d=function(_0x1e7ff5,_0x20bc77){_0x1e7ff5=_0x1e7ff5-0x0;var _0x5b6cbc=_0x17d1[_0x1e7ff5];return _0x5b6cbc;};'use strict';var multer=require(_0x117d('0x0'));var util=require(_0x117d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x117d('0x2'));var router=express[_0x117d('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x117d('0x4'));var controller=require(_0x117d('0x5'));router[_0x117d('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x117d('0x7')]);router['delete'](_0x117d('0x8'),auth[_0x117d('0x9')](),controller['destroy']);module[_0x117d('0xa')]=router; \ No newline at end of file +var _0x69e6=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x69e6,0x1e0));var _0x669e=function(_0x1088bf,_0x164ada){_0x1088bf=_0x1088bf-0x0;var _0xf42819=_0x69e6[_0x1088bf];return _0xf42819;};'use strict';var multer=require('multer');var util=require(_0x669e('0x0'));var path=require(_0x669e('0x1'));var timeout=require(_0x669e('0x2'));var express=require(_0x669e('0x3'));var router=express[_0x669e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x669e('0x5'));var config=require(_0x669e('0x6'));var controller=require(_0x669e('0x7'));router[_0x669e('0x8')](_0x669e('0x9'),auth[_0x669e('0xa')](),controller[_0x669e('0xb')]);router[_0x669e('0xc')](_0x669e('0x9'),auth[_0x669e('0xa')](),controller[_0x669e('0xd')]);module[_0x669e('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index ebf7881..e8d2570 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 _0xb27f=['STRING','TEXT','sequelize','exports'];(function(_0x1c823a,_0x77515f){var _0x4630cf=function(_0x2775b1){while(--_0x2775b1){_0x1c823a['push'](_0x1c823a['shift']());}};_0x4630cf(++_0x77515f);}(_0xb27f,0x1ba));var _0xfb27=function(_0x40b29e,_0x2f8e76){_0x40b29e=_0x40b29e-0x0;var _0x575df4=_0xb27f[_0x40b29e];return _0x575df4;};'use strict';var Sequelize=require(_0xfb27('0x0'));module[_0xfb27('0x1')]={'name':{'type':Sequelize[_0xfb27('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xfb27('0x2')]},'parent':{'type':Sequelize[_0xfb27('0x2')]},'table':{'type':Sequelize[_0xfb27('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xfb27('0x3')]}}; \ No newline at end of file +var _0x98d2=['STRING','TEXT','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x98d2,0xc8));var _0x298d=function(_0x5806c3,_0x5105d8){_0x5806c3=_0x5806c3-0x0;var _0x48ac77=_0x98d2[_0x5806c3];return _0x48ac77;};'use strict';var Sequelize=require('sequelize');module[_0x298d('0x0')]={'name':{'type':Sequelize[_0x298d('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x298d('0x1')]},'parent':{'type':Sequelize[_0x298d('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x298d('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 58b01c0..8913285 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 _0x9003=['orderBy','DESC','alias','joins','parse','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','COUNT(DISTINCT\x20%s)','AVG(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','condition','value','metric','parentKey','SELECT','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','savename','COUNT(*)','run','runReport','cross_join','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','json','apply','save','update','then','destroy','get','end','error','name','send','AnalyticCustomReport','rawAttributes','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','where','map','type','field','filter','options','includeAll','include','findAll','rows','params','length','merge','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','UserProfileResource','CustomReports','catch','find','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','replace','function','groupBy'];(function(_0x296144,_0x26bbbf){var _0x5329b1=function(_0x5d321b){while(--_0x5d321b){_0x296144['push'](_0x296144['shift']());}};_0x5329b1(++_0x26bbbf);}(_0x9003,0xcd));var _0x3900=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x9003[_0x126558];return _0x1f6d14;};'use strict';var pdf=require(_0x3900('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3900('0x1'));var zipdir=require(_0x3900('0x2'));var jsonpatch=require(_0x3900('0x3'));var rp=require(_0x3900('0x4'));var moment=require(_0x3900('0x5'));var BPromise=require(_0x3900('0x6'));var Mustache=require(_0x3900('0x7'));var util=require(_0x3900('0x8'));var path=require(_0x3900('0x9'));var sox=require('sox');var csv=require(_0x3900('0xa'));var ejs=require(_0x3900('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3900('0xc'));var crypto=require(_0x3900('0xd'));var jsforce=require(_0x3900('0xe'));var deskjs=require(_0x3900('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3900('0x10'));var authService=require(_0x3900('0x11'));var qs=require(_0x3900('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3900('0x13'))(_0x3900('0x14'));var utils=require(_0x3900('0x15'));var config=require(_0x3900('0x16'));var db=require(_0x3900('0x17'))['db'];function respondWithStatusCode(_0x376fd9,_0x56bc5b){_0x56bc5b=_0x56bc5b||0xcc;return function(_0x34cb43){if(_0x34cb43){return _0x376fd9['sendStatus'](_0x56bc5b);}return _0x376fd9[_0x3900('0x18')](_0x56bc5b)['end']();};}function respondWithResult(_0x527267,_0x23a4d0){_0x23a4d0=_0x23a4d0||0xc8;return function(_0x1f2296){if(_0x1f2296){return _0x527267[_0x3900('0x18')](_0x23a4d0)['json'](_0x1f2296);}};}function respondWithFilteredResult(_0x590d70,_0xec5751){return function(_0x2157f4){if(_0x2157f4){var _0x3a630c=_0x2157f4[_0x3900('0x19')],_0x1585d1=_0xec5751[_0x3900('0x1a')],_0x349fb8=_0xec5751[_0x3900('0x1a')]+_0xec5751['limit'],_0x3ea54d;if(_0x349fb8>=_0x3a630c){_0x349fb8=_0x3a630c;_0x3ea54d=0xc8;}else{_0x3ea54d=0xce;}_0x590d70[_0x3900('0x18')](_0x3ea54d);return _0x590d70['set']('Content-Range',_0x1585d1+'-'+_0x349fb8+'/'+_0x3a630c)[_0x3900('0x1b')](_0x2157f4);}return null;};}function patchUpdates(_0x43150c){return function(_0x3f3341){try{jsonpatch[_0x3900('0x1c')](_0x3f3341,_0x43150c,!![]);}catch(_0x3b96a8){return BPromise['reject'](_0x3b96a8);}return _0x3f3341[_0x3900('0x1d')]();};}function saveUpdates(_0x41f55b,_0x2c3587){return function(_0x4f343f){if(_0x4f343f){return _0x4f343f[_0x3900('0x1e')](_0x41f55b)[_0x3900('0x1f')](function(_0xc8de07){return _0xc8de07;});}return null;};}function removeEntity(_0x24301c,_0x2e8b6b){return function(_0x174532){if(_0x174532){return _0x174532[_0x3900('0x20')]()['then'](function(){var _0x49c5b1=_0x174532[_0x3900('0x21')]({'plain':!![]});var _0x4842da='CustomReports';return db['UserProfileResource'][_0x3900('0x20')]({'where':{'type':_0x4842da,'resourceId':_0x49c5b1['id']}})[_0x3900('0x1f')](function(){return _0x174532;});})[_0x3900('0x1f')](function(){_0x24301c['status'](0xcc)[_0x3900('0x22')]();});}};}function handleEntityNotFound(_0x328b3b,_0x4e7d74){return function(_0x1037ba){if(!_0x1037ba){_0x328b3b['sendStatus'](0x194);}return _0x1037ba;};}function handleError(_0x241a3f,_0x1a18a8){_0x1a18a8=_0x1a18a8||0x1f4;return function(_0x349af1){logger[_0x3900('0x23')](_0x349af1['stack']);if(_0x349af1[_0x3900('0x24')]){delete _0x349af1[_0x3900('0x24')];}_0x241a3f[_0x3900('0x18')](_0x1a18a8)[_0x3900('0x25')](_0x349af1);};}exports['index']=function(_0x30b02a,_0x1f70b8){var _0xdaf2f7={},_0x1c0faf={},_0x204097={'count':0x0,'rows':[]};var _0x10924a=db[_0x3900('0x26')][_0x3900('0x27')];_0x1c0faf['model']=_[_0x3900('0x28')](_0x10924a);_0x1c0faf[_0x3900('0x29')]=_[_0x3900('0x28')](_0x30b02a[_0x3900('0x29')]);_0x1c0faf[_0x3900('0x2a')]=_[_0x3900('0x2b')](_0x1c0faf[_0x3900('0x2c')],_0x1c0faf['query']);_0xdaf2f7[_0x3900('0x2d')]=_['intersection'](_0x1c0faf[_0x3900('0x2c')],qs[_0x3900('0x2e')](_0x30b02a[_0x3900('0x29')]['fields']));_0xdaf2f7['attributes']=_0xdaf2f7[_0x3900('0x2d')]['length']?_0xdaf2f7[_0x3900('0x2d')]:_0x1c0faf[_0x3900('0x2c')];if(!_0x30b02a[_0x3900('0x29')][_0x3900('0x2f')](_0x3900('0x30'))){_0xdaf2f7[_0x3900('0x31')]=qs[_0x3900('0x31')](_0x30b02a[_0x3900('0x29')][_0x3900('0x31')]);_0xdaf2f7[_0x3900('0x1a')]=qs[_0x3900('0x1a')](_0x30b02a['query']['offset']);}_0xdaf2f7[_0x3900('0x32')]=qs['sort'](_0x30b02a[_0x3900('0x29')][_0x3900('0x33')]);_0xdaf2f7['where']=qs[_0x3900('0x2a')](_[_0x3900('0x34')](_0x30b02a[_0x3900('0x29')],_0x1c0faf['filters']));if(_0x30b02a['query']['filter']){_0xdaf2f7['where']=_['merge'](_0xdaf2f7[_0x3900('0x35')],{'$or':_[_0x3900('0x36')](_0x10924a,function(_0x24ff9a){if(_0x24ff9a[_0x3900('0x37')]['key']!=='VIRTUAL'){var _0x2f4929={};_0x2f4929[_0x24ff9a[_0x3900('0x38')]]={'$like':'%'+_0x30b02a[_0x3900('0x29')][_0x3900('0x39')]+'%'};return _0x2f4929;}})});}_0xdaf2f7=_['merge']({},_0xdaf2f7,_0x30b02a[_0x3900('0x3a')]);var _0x1afb9e={'where':_0xdaf2f7[_0x3900('0x35')]};return db['AnalyticCustomReport'][_0x3900('0x19')](_0x1afb9e)[_0x3900('0x1f')](function(_0x1c952d){_0x204097['count']=_0x1c952d;if(_0x30b02a[_0x3900('0x29')][_0x3900('0x3b')]){_0xdaf2f7[_0x3900('0x3c')]=[{'all':!![]}];}return db[_0x3900('0x26')][_0x3900('0x3d')](_0xdaf2f7);})[_0x3900('0x1f')](function(_0x4c86d7){_0x204097[_0x3900('0x3e')]=_0x4c86d7;return _0x204097;})[_0x3900('0x1f')](respondWithFilteredResult(_0x1f70b8,_0xdaf2f7))['catch'](handleError(_0x1f70b8,null));};exports['show']=function(_0x4be3a0,_0x2220fc){var _0x2949f8={'raw':![],'where':{'id':_0x4be3a0[_0x3900('0x3f')]['id']}},_0x2cc150={};_0x2cc150[_0x3900('0x2c')]=_[_0x3900('0x28')](db[_0x3900('0x26')]['rawAttributes']);_0x2cc150[_0x3900('0x29')]=_['keys'](_0x4be3a0[_0x3900('0x29')]);_0x2cc150[_0x3900('0x2a')]=_[_0x3900('0x2b')](_0x2cc150[_0x3900('0x2c')],_0x2cc150[_0x3900('0x29')]);_0x2949f8[_0x3900('0x2d')]=_[_0x3900('0x2b')](_0x2cc150[_0x3900('0x2c')],qs[_0x3900('0x2e')](_0x4be3a0[_0x3900('0x29')][_0x3900('0x2e')]));_0x2949f8[_0x3900('0x2d')]=_0x2949f8[_0x3900('0x2d')][_0x3900('0x40')]?_0x2949f8[_0x3900('0x2d')]:_0x2cc150[_0x3900('0x2c')];if(_0x4be3a0['query']['includeAll']){_0x2949f8[_0x3900('0x3c')]=[{'all':!![]}];}_0x2949f8=_[_0x3900('0x41')]({},_0x2949f8,_0x4be3a0['options']);return db[_0x3900('0x26')]['find'](_0x2949f8)['then'](handleEntityNotFound(_0x2220fc,null))[_0x3900('0x1f')](respondWithResult(_0x2220fc,null))['catch'](handleError(_0x2220fc,null));};exports['create']=function(_0x5e3578,_0x2b93ea){return db[_0x3900('0x26')][_0x3900('0x42')](_0x5e3578[_0x3900('0x43')],{})[_0x3900('0x1f')](function(_0x51ff78){var _0x106054=_0x5e3578['user'][_0x3900('0x21')]({'plain':!![]});if(!_0x106054)throw new Error(_0x3900('0x44'));if(_0x106054[_0x3900('0x45')]===_0x3900('0x46')){var _0xd4b6b6=_0x51ff78[_0x3900('0x21')]({'plain':!![]});var _0x565ecc=_0x3900('0x47');return db[_0x3900('0x48')]['find']({'where':{'name':_0x565ecc,'userProfileId':_0x106054[_0x3900('0x49')]},'raw':!![]})[_0x3900('0x1f')](function(_0x5dd5d1){if(_0x5dd5d1&&_0x5dd5d1['autoAssociation']===0x0){return db[_0x3900('0x4a')][_0x3900('0x42')]({'name':_0xd4b6b6[_0x3900('0x24')],'resourceId':_0xd4b6b6['id'],'type':_0x3900('0x4b'),'sectionId':_0x5dd5d1['id']},{})[_0x3900('0x1f')](function(){return _0x51ff78;});}else{return _0x51ff78;}})['catch'](function(_0x34113e){logger[_0x3900('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x34113e);throw _0x34113e;});}return _0x51ff78;})['then'](respondWithResult(_0x2b93ea,0xc9))[_0x3900('0x4c')](handleError(_0x2b93ea,null));};exports[_0x3900('0x1e')]=function(_0x520cf3,_0x4017e8){if(_0x520cf3[_0x3900('0x43')]['id']){delete _0x520cf3[_0x3900('0x43')]['id'];}return db[_0x3900('0x26')][_0x3900('0x4d')]({'where':{'id':_0x520cf3['params']['id']}})[_0x3900('0x1f')](handleEntityNotFound(_0x4017e8,null))['then'](saveUpdates(_0x520cf3['body'],null))[_0x3900('0x1f')](respondWithResult(_0x4017e8,null))[_0x3900('0x4c')](handleError(_0x4017e8,null));};exports['destroy']=function(_0x4696ea,_0x5635ab){return db[_0x3900('0x26')][_0x3900('0x4d')]({'where':{'id':_0x4696ea['params']['id']}})[_0x3900('0x1f')](handleEntityNotFound(_0x5635ab,null))[_0x3900('0x1f')](removeEntity(_0x5635ab,null))[_0x3900('0x4c')](handleError(_0x5635ab,null));};exports[_0x3900('0x4e')]=function(_0x5d4e78,_0x2dad6a){var _0x15d264=0xa;var _0x24666f=[_0x3900('0x4f'),_0x3900('0x50'),_0x3900('0x51'),'cross_join'];var _0x425a13={'SUM':_0x3900('0x52'),'COUNT':_0x3900('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3900('0x54'),'MIN':_0x3900('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x3900('0x56'),'GROUP_CONCAT ASC':_0x3900('0x57'),'GROUP_CONCAT DESC':_0x3900('0x58')};var _0x353d81={'SEC_TO_TIME':_0x3900('0x59'),'DATE':_0x3900('0x5a'),'HOUR':_0x3900('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1e1aa3=function(_0x53cdcb){return!_[_0x3900('0x5c')]([_0x3900('0x5d'),_0x3900('0x5e'),_0x3900('0x5f'),'IS\x20NOT\x20EMPTY'],_0x53cdcb);};var _0xaa7bd6=function(_0x2b68b3){if(!_0x2b68b3||!_0x2b68b3['rules'][_0x3900('0x40')]){return'';}for(var _0x15e42a='(',_0x1cd8e1=0x0;_0x1cd8e1<_0x2b68b3[_0x3900('0x60')][_0x3900('0x40')];_0x1cd8e1+=0x1){_0x1cd8e1>0x0&&(_0x15e42a+='\x20'+_0x2b68b3[_0x3900('0x61')]+'\x20');_0x15e42a+=_0x2b68b3[_0x3900('0x60')][_0x1cd8e1]['group']?_0xaa7bd6(_0x2b68b3['rules'][_0x1cd8e1][_0x3900('0x62')]):_0x2b68b3[_0x3900('0x60')][_0x1cd8e1][_0x3900('0x38')]+'\x20'+_0x2b68b3[_0x3900('0x60')][_0x1cd8e1]['condition']+(_0x1e1aa3(_0x2b68b3[_0x3900('0x60')][_0x1cd8e1]['condition'])?'\x20'+_0x2b68b3[_0x3900('0x60')][_0x1cd8e1]['value']:'');}return _0x15e42a+')';};var _0x4c22f9={'where':{'id':_0x5d4e78[_0x3900('0x3f')]['id']}},_0xe32cd3,_0xa6ed8e,_0xa94075,_0x43546c,_0x372519;_0x4c22f9=_[_0x3900('0x41')]({},_0x4c22f9,_0x5d4e78[_0x3900('0x3a')]);return db[_0x3900('0x26')][_0x3900('0x4d')](_0x4c22f9)['then'](function(_0x4ab21f){if(_0x4ab21f){_0xe32cd3=_0x4ab21f;return _0x4ab21f[_0x3900('0x63')]();}return null;})['then'](function(_0x35f2dc){if(_0x35f2dc){if(!_0x35f2dc[_0x3900('0x40')]){throw new db[(_0x3900('0x64'))][(_0x3900('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xa6ed8e=_0x35f2dc;return db[_0x3900('0x66')][_0x3900('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x2b7835){if(_0x2b7835){_0xa94075=_[_0x3900('0x67')](_0x2b7835,'id');var _0x441150;var _0x4f2fd3=squel[_0x3900('0x68')]();_0x4f2fd3[_0x3900('0x69')](_0xe32cd3[_0x3900('0x6a')]);for(var _0x2baa77=0x0;_0x2baa77<_0xa6ed8e[_0x3900('0x40')];_0x2baa77+=0x1){_0x441150=_0xa6ed8e[_0x2baa77][_0x3900('0x6b')]?_0xa94075[_0xa6ed8e[_0x2baa77][_0x3900('0x6b')]]['metric']:_0xa6ed8e[_0x2baa77][_0x3900('0x38')];_0x441150=_0xa6ed8e[_0x2baa77]['function']?_[_0x3900('0x6c')](_0x425a13[_0xa6ed8e[_0x2baa77][_0x3900('0x6d')]],'%s',_0x441150):_0x441150;_0x441150=_0xa6ed8e[_0x2baa77]['format']?_['replace'](_0x353d81[_0xa6ed8e[_0x2baa77]['format']],'%s',_0x441150):_0x441150;if(_0xa6ed8e[_0x2baa77][_0x3900('0x6e')]){_0x4f2fd3[_0x3900('0x62')](_0x441150);}_0xa6ed8e[_0x2baa77][_0x3900('0x6f')]&&_0x4f2fd3[_0x3900('0x32')](_0x441150,_0xa6ed8e[_0x2baa77][_0x3900('0x6f')]===_0x3900('0x70')?![]:!![]);_0x4f2fd3['field'](_0x441150,_0xa6ed8e[_0x2baa77][_0x3900('0x71')]||_0x441150);}if(_0xe32cd3[_0x3900('0x72')]){_0xe32cd3[_0x3900('0x72')]=JSON[_0x3900('0x73')](_0xe32cd3[_0x3900('0x72')]);for(var _0x3d724b=0x0;_0x3d724b<_0xe32cd3['joins'][_0x3900('0x40')];_0x3d724b+=0x1){if(_0xe32cd3[_0x3900('0x72')][_0x3d724b][_0x3900('0x37')]&&_['includes'](_0x24666f,_0xe32cd3[_0x3900('0x72')][_0x3d724b][_0x3900('0x37')])&&_0xe32cd3[_0x3900('0x72')][_0x3d724b]['parentKey']&&_0xe32cd3[_0x3900('0x72')][_0x3d724b][_0x3900('0x74')]&&_0xe32cd3['joins'][_0x3d724b][_0x3900('0x75')]){_0x4f2fd3[_0xe32cd3[_0x3900('0x72')][_0x3d724b][_0x3900('0x37')]](_0xe32cd3[_0x3900('0x72')][_0x3d724b][_0x3900('0x74')],null,util[_0x3900('0x76')](_0x3900('0x77'),_0xe32cd3[_0x3900('0x6a')],_0xe32cd3[_0x3900('0x72')][_0x3d724b]['parentKey'],_0xe32cd3[_0x3900('0x72')][_0x3d724b][_0x3900('0x74')],_0xe32cd3['joins'][_0x3d724b][_0x3900('0x75')]));}}}if(_0xe32cd3[_0x3900('0x78')]){_0xe32cd3[_0x3900('0x78')]=JSON['parse'](_0xe32cd3[_0x3900('0x78')]);_0x4f2fd3[_0x3900('0x35')](_0xaa7bd6(_0xe32cd3['conditions'][_0x3900('0x62')]));}_0x372519=_0x4f2fd3[_0x3900('0x79')]();_0x4f2fd3['limit'](_0x15d264);_0x4f2fd3['offset'](0x0);logger[_0x3900('0x7a')](_0x3900('0x7b'),_0x4f2fd3['toString']());return db[_0x3900('0x7c')][_0x3900('0x29')](_0x4f2fd3[_0x3900('0x7d')](),{'type':db['sequelize'][_0x3900('0x7e')]['SELECT']});}})[_0x3900('0x1f')](respondWithResult(_0x2dad6a,null))[_0x3900('0x4c')](handleError(_0x2dad6a,null));};function runReport(_0x5226f1,_0x44de87,_0x532320){var _0x4c8c8f=_0x44de87[_0x3900('0x24')];var _0x405b08=0xa;var _0x5b008b=[_0x3900('0x4f'),_0x3900('0x50'),_0x3900('0x51'),'cross_join'];var _0x5c401a={'SUM':_0x3900('0x52'),'COUNT':_0x3900('0x53'),'COUNT DISTINCT':_0x3900('0x7f'),'MAX':_0x3900('0x54'),'MIN':_0x3900('0x55'),'AVG':_0x3900('0x80'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x3900('0x57'),'GROUP_CONCAT DESC':_0x3900('0x58')};var _0x58653c={'SEC_TO_TIME':_0x3900('0x59'),'DATE':_0x3900('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x3900('0x81'),'UNIX_TIMESTAMP':_0x3900('0x82')};var _0x4c2d96=function(_0x386960){return!_[_0x3900('0x5c')]([_0x3900('0x5d'),'IS\x20NOT\x20NULL',_0x3900('0x5f'),_0x3900('0x83')],_0x386960);};var _0x74125a=function(_0xbf09ba){if(!_0xbf09ba||!_0xbf09ba['rules'][_0x3900('0x40')]){return'';}for(var _0x37f6b4='(',_0x52fec2=0x0;_0x52fec2<_0xbf09ba[_0x3900('0x60')][_0x3900('0x40')];_0x52fec2+=0x1){_0x52fec2>0x0&&(_0x37f6b4+='\x20'+_0xbf09ba[_0x3900('0x61')]+'\x20');_0x37f6b4+=_0xbf09ba[_0x3900('0x60')][_0x52fec2][_0x3900('0x62')]?_0x74125a(_0xbf09ba[_0x3900('0x60')][_0x52fec2][_0x3900('0x62')]):_0xbf09ba['rules'][_0x52fec2]['field']+'\x20'+_0xbf09ba['rules'][_0x52fec2][_0x3900('0x84')]+(_0x4c2d96(_0xbf09ba[_0x3900('0x60')][_0x52fec2][_0x3900('0x84')])?'\x20'+_0xbf09ba[_0x3900('0x60')][_0x52fec2][_0x3900('0x85')]:'');}return _0x37f6b4+')';};var _0x331ab2={'where':{'id':_0x5226f1['id']}},_0x318a56,_0x1264bc,_0x35c82b,_0x2491c9,_0x168a7f;_0x331ab2=_['merge']({},_0x331ab2,_0x532320);return db['AnalyticCustomReport'][_0x3900('0x4d')](_0x331ab2)[_0x3900('0x1f')](function(_0x1655be){if(_0x1655be){_0x318a56=_0x1655be;return _0x1655be[_0x3900('0x63')]();}return null;})[_0x3900('0x1f')](function(_0x372cfc){if(_0x372cfc){if(!_0x372cfc[_0x3900('0x40')]){throw new db[(_0x3900('0x64'))][(_0x3900('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1264bc=_0x372cfc;return db[_0x3900('0x66')][_0x3900('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x3ad8c2){if(_0x3ad8c2){_0x35c82b=_[_0x3900('0x67')](_0x3ad8c2,'id');var _0x2b819e;var _0xb25d7e=squel[_0x3900('0x68')]();_0xb25d7e[_0x3900('0x69')](_0x318a56[_0x3900('0x6a')]);for(var _0x2ff398=0x0;_0x2ff398<_0x1264bc[_0x3900('0x40')];_0x2ff398+=0x1){_0x2b819e=_0x1264bc[_0x2ff398][_0x3900('0x6b')]?_0x35c82b[_0x1264bc[_0x2ff398][_0x3900('0x6b')]][_0x3900('0x86')]:_0x1264bc[_0x2ff398][_0x3900('0x38')];_0x2b819e=_0x1264bc[_0x2ff398][_0x3900('0x6d')]?_[_0x3900('0x6c')](_0x5c401a[_0x1264bc[_0x2ff398][_0x3900('0x6d')]],'%s',_0x2b819e):_0x2b819e;_0x2b819e=_0x1264bc[_0x2ff398][_0x3900('0x76')]?_[_0x3900('0x6c')](_0x58653c[_0x1264bc[_0x2ff398][_0x3900('0x76')]],'%s',_0x2b819e):_0x2b819e;if(_0x1264bc[_0x2ff398][_0x3900('0x6e')]){_0xb25d7e[_0x3900('0x62')](_0x2b819e);}_0x1264bc[_0x2ff398]['orderBy']&&_0xb25d7e[_0x3900('0x32')](_0x2b819e,_0x1264bc[_0x2ff398][_0x3900('0x6f')]===_0x3900('0x70')?![]:!![]);_0xb25d7e[_0x3900('0x38')](_0x2b819e,_0x1264bc[_0x2ff398]['alias']||_0x2b819e);}if(_0x318a56[_0x3900('0x72')]){_0x318a56['joins']=JSON['parse'](_0x318a56[_0x3900('0x72')]);for(var _0x303b83=0x0;_0x303b83<_0x318a56[_0x3900('0x72')][_0x3900('0x40')];_0x303b83+=0x1){if(_0x318a56[_0x3900('0x72')][_0x303b83][_0x3900('0x37')]&&_[_0x3900('0x5c')](_0x5b008b,_0x318a56[_0x3900('0x72')][_0x303b83][_0x3900('0x37')])&&_0x318a56[_0x3900('0x72')][_0x303b83][_0x3900('0x87')]&&_0x318a56['joins'][_0x303b83]['foreignTable']&&_0x318a56[_0x3900('0x72')][_0x303b83][_0x3900('0x75')]){_0xb25d7e[_0x318a56[_0x3900('0x72')][_0x303b83]['type']](_0x318a56['joins'][_0x303b83][_0x3900('0x74')],null,util[_0x3900('0x76')]('%s.%s\x20=\x20%s.%s',_0x318a56[_0x3900('0x6a')],_0x318a56[_0x3900('0x72')][_0x303b83][_0x3900('0x87')],_0x318a56[_0x3900('0x72')][_0x303b83]['foreignTable'],_0x318a56[_0x3900('0x72')][_0x303b83]['foreignKey']));}}}if(_0x318a56['conditions']){_0x318a56[_0x3900('0x78')]=JSON['parse'](_0x318a56[_0x3900('0x78')]);_0xb25d7e[_0x3900('0x35')](_0x74125a(_0x318a56[_0x3900('0x78')][_0x3900('0x62')]));}_0x168a7f=_0xb25d7e[_0x3900('0x79')]();_0xb25d7e[_0x3900('0x31')](_0x405b08);_0xb25d7e[_0x3900('0x1a')](0x0);logger[_0x3900('0x7a')](_0x3900('0x7b'),_0xb25d7e[_0x3900('0x7d')]());return db[_0x3900('0x7c')][_0x3900('0x29')](_0xb25d7e[_0x3900('0x7d')](),{'type':db[_0x3900('0x7c')]['QueryTypes'][_0x3900('0x88')]});}})[_0x3900('0x1f')](function(_0x215ac6){if(!_0x215ac6['length']){throw new db[(_0x3900('0x64'))][(_0x3900('0x65'))](_0x3900('0x89'),0xcc);}if(_0x44de87[_0x3900('0x8a')]===_0x3900('0x8b')){return null;}var _0x4f7ee8=_[_0x3900('0x41')](_0x44de87,{'name':_0x44de87[_0x3900('0x8c')]||_0x44de87[_0x3900('0x24')]||_0x318a56[_0x3900('0x24')],'basename':_0x4c8c8f,'savename':util[_0x3900('0x76')](_0x3900('0x8d'),_0x44de87[_0x3900('0x24')]||_0x318a56[_0x3900('0x24')],require(_0x3900('0x8e'))['generate'](0x4),_0x44de87[_0x3900('0x8a')]||_0x3900('0x8f')),'reportId':_0x318a56['id'],'reportType':_0x3900('0x90')});return db[_0x3900('0x91')][_0x3900('0x42')](_0x4f7ee8,{'raw':!![]});})[_0x3900('0x1f')](function(_0x92d50f){if(_0x318a56[_0x3900('0x6a')]===_0x3900('0x92')){_0x168a7f[_0x3900('0x35')](_0x318a56[_0x3900('0x6a')]+_0x3900('0x93'),_0x44de87[_0x3900('0x94')],_0x44de87[_0x3900('0x95')]);}else{_0x168a7f['where'](_0x318a56[_0x3900('0x6a')]+_0x3900('0x96'),_0x44de87['startDate'],_0x44de87[_0x3900('0x95')]);}if(_0x92d50f){logger[_0x3900('0x97')](_0x3900('0x98'),_0x168a7f[_0x3900('0x7d')]());require('child_process')['fork'](path[_0x3900('0x4f')](__dirname,'../../components/export/',_0x92d50f[_0x3900('0x8a')]),[_0x92d50f['id'],_0x168a7f['toString'](),path[_0x3900('0x4f')](__dirname,'../../files/reports',_0x92d50f[_0x3900('0x99')]),_0x4c8c8f]);return _0x92d50f;}else{var _0x39a2f0=squel[_0x3900('0x68')]();_0x39a2f0[_0x3900('0x69')]('('+_0x168a7f['toString']()+')','countTable');_0x39a2f0[_0x3900('0x38')](_0x3900('0x9a'),'count');_0x168a7f[_0x3900('0x31')](_0x44de87['limit']||_0x405b08);_0x168a7f[_0x3900('0x1a')](_0x44de87['offset']||0x0);return db[_0x3900('0x7c')][_0x3900('0x29')](_0x39a2f0['toString'](),{'type':db[_0x3900('0x7c')][_0x3900('0x7e')][_0x3900('0x88')]})['then'](function(_0x35b257){if(!_0x35b257[_0x3900('0x40')]){_0x2491c9=0x0;}else{_0x2491c9=_0x35b257[0x0]['count']||0x0;}return db[_0x3900('0x7c')][_0x3900('0x29')](_0x168a7f['toString'](),{'type':db[_0x3900('0x7c')]['QueryTypes']['SELECT']});})[_0x3900('0x1f')](function(_0x37cb4e){return{'rows':_0x37cb4e||[],'count':_0x2491c9};});}});}exports[_0x3900('0x9b')]=function(_0x400619,_0x55d203){return runReport(_0x400619[_0x3900('0x3f')],_0x400619[_0x3900('0x29')],_0x400619[_0x3900('0x3a')])[_0x3900('0x1f')](respondWithResult(_0x55d203,null))[_0x3900('0x4c')](handleError(_0x55d203,null));};exports[_0x3900('0x9c')]=runReport;exports['query']=function(_0x1e5bda,_0x3f9423){var _0x579479=0xa;var _0x33fc2c=[_0x3900('0x4f'),'left_join','right_join',_0x3900('0x9d')];var _0xe209ed={'SUM':'SUM(%s)','COUNT':_0x3900('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3900('0x54'),'MIN':_0x3900('0x55'),'AVG':_0x3900('0x80'),'GROUP_CONCAT':_0x3900('0x56'),'GROUP_CONCAT ASC':_0x3900('0x57'),'GROUP_CONCAT DESC':_0x3900('0x58')};var _0x328605={'SEC_TO_TIME':_0x3900('0x59'),'DATE':_0x3900('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1d7549=function(_0x2118dd){return!_[_0x3900('0x5c')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x3900('0x83')],_0x2118dd);};var _0x334f28=function(_0xf83d5d){if(!_0xf83d5d||!_0xf83d5d[_0x3900('0x60')][_0x3900('0x40')]){return'';}for(var _0x4130ad='(',_0x4a6c3f=0x0;_0x4a6c3f<_0xf83d5d[_0x3900('0x60')][_0x3900('0x40')];_0x4a6c3f+=0x1){_0x4a6c3f>0x0&&(_0x4130ad+='\x20'+_0xf83d5d['operator']+'\x20');_0x4130ad+=_0xf83d5d['rules'][_0x4a6c3f]['group']?_0x334f28(_0xf83d5d['rules'][_0x4a6c3f]['group']):_0xf83d5d[_0x3900('0x60')][_0x4a6c3f][_0x3900('0x38')]+'\x20'+_0xf83d5d[_0x3900('0x60')][_0x4a6c3f][_0x3900('0x84')]+(_0x1d7549(_0xf83d5d[_0x3900('0x60')][_0x4a6c3f][_0x3900('0x84')])?'\x20'+_0xf83d5d[_0x3900('0x60')][_0x4a6c3f][_0x3900('0x85')]:'');}return _0x4130ad+')';};var _0x12a2b1={'where':{'id':_0x1e5bda[_0x3900('0x3f')]['id']}},_0x4c0a86,_0x223f59,_0x235fb5,_0xd6d921,_0x4f86cd;_0x12a2b1=_[_0x3900('0x41')]({},_0x12a2b1,_0x1e5bda[_0x3900('0x3a')]);return db['AnalyticCustomReport']['find'](_0x12a2b1)[_0x3900('0x1f')](function(_0x5c5454){if(_0x5c5454){_0x4c0a86=_0x5c5454;return _0x5c5454[_0x3900('0x63')]();}return null;})[_0x3900('0x1f')](function(_0xad91f1){if(_0xad91f1){if(!_0xad91f1[_0x3900('0x40')]){throw new db[(_0x3900('0x64'))][(_0x3900('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x223f59=_0xad91f1;return db['AnalyticMetric'][_0x3900('0x3d')]({'raw':!![]});}return null;})[_0x3900('0x1f')](function(_0x4ac70c){if(_0x4ac70c){_0x235fb5=_[_0x3900('0x67')](_0x4ac70c,'id');var _0x500c16;var _0x5a402a=squel[_0x3900('0x68')]();_0x5a402a[_0x3900('0x69')](_0x4c0a86['table']);for(var _0xbf2ac=0x0;_0xbf2ac<_0x223f59[_0x3900('0x40')];_0xbf2ac+=0x1){_0x500c16=_0x223f59[_0xbf2ac]['MetricId']?_0x235fb5[_0x223f59[_0xbf2ac][_0x3900('0x6b')]]['metric']:_0x223f59[_0xbf2ac][_0x3900('0x38')];_0x500c16=_0x223f59[_0xbf2ac][_0x3900('0x6d')]?_['replace'](_0xe209ed[_0x223f59[_0xbf2ac][_0x3900('0x6d')]],'%s',_0x500c16):_0x500c16;_0x500c16=_0x223f59[_0xbf2ac][_0x3900('0x76')]?_['replace'](_0x328605[_0x223f59[_0xbf2ac][_0x3900('0x76')]],'%s',_0x500c16):_0x500c16;if(_0x223f59[_0xbf2ac][_0x3900('0x6e')]){_0x5a402a[_0x3900('0x62')](_0x500c16);}_0x223f59[_0xbf2ac][_0x3900('0x6f')]&&_0x5a402a[_0x3900('0x32')](_0x500c16,_0x223f59[_0xbf2ac][_0x3900('0x6f')]===_0x3900('0x70')?![]:!![]);_0x5a402a[_0x3900('0x38')](_0x500c16,_0x223f59[_0xbf2ac][_0x3900('0x71')]||_0x500c16);}if(_0x4c0a86[_0x3900('0x72')]){_0x4c0a86['joins']=JSON['parse'](_0x4c0a86[_0x3900('0x72')]);for(var _0x3ff955=0x0;_0x3ff955<_0x4c0a86[_0x3900('0x72')][_0x3900('0x40')];_0x3ff955+=0x1){if(_0x4c0a86['joins'][_0x3ff955][_0x3900('0x37')]&&_[_0x3900('0x5c')](_0x33fc2c,_0x4c0a86['joins'][_0x3ff955][_0x3900('0x37')])&&_0x4c0a86[_0x3900('0x72')][_0x3ff955][_0x3900('0x87')]&&_0x4c0a86[_0x3900('0x72')][_0x3ff955][_0x3900('0x74')]&&_0x4c0a86[_0x3900('0x72')][_0x3ff955]['foreignKey']){_0x5a402a[_0x4c0a86['joins'][_0x3ff955]['type']](_0x4c0a86[_0x3900('0x72')][_0x3ff955]['foreignTable'],null,util[_0x3900('0x76')](_0x3900('0x77'),_0x4c0a86[_0x3900('0x6a')],_0x4c0a86[_0x3900('0x72')][_0x3ff955][_0x3900('0x87')],_0x4c0a86[_0x3900('0x72')][_0x3ff955][_0x3900('0x74')],_0x4c0a86['joins'][_0x3ff955][_0x3900('0x75')]));}}}if(_0x4c0a86[_0x3900('0x78')]){_0x4c0a86['conditions']=JSON[_0x3900('0x73')](_0x4c0a86[_0x3900('0x78')]);_0x5a402a['where'](_0x334f28(_0x4c0a86[_0x3900('0x78')][_0x3900('0x62')]));}_0x4f86cd=_0x5a402a[_0x3900('0x79')]();_0x5a402a[_0x3900('0x31')](_0x579479);_0x5a402a[_0x3900('0x1a')](0x0);logger['debug'](_0x3900('0x7b'),_0x5a402a[_0x3900('0x7d')]());return db['sequelize']['query'](_0x5a402a['toString'](),{'type':db[_0x3900('0x7c')][_0x3900('0x7e')][_0x3900('0x88')]});}})[_0x3900('0x1f')](function(){return{'sql':_0x4f86cd['toString']()};})[_0x3900('0x1f')](respondWithResult(_0x3f9423,null))[_0x3900('0x4c')](handleError(_0x3f9423,null));}; \ No newline at end of file +var _0x4014=['endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','COUNT(*)','run','left_join','right_join','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','apply','reject','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','AnalyticCustomReport','rawAttributes','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','map','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','order','orderBy','DESC','joins','includes','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','debug','toString','sequelize','QueryTypes','SELECT','AVG(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','AnalyticMetric','alias','type','parentKey','clone','Limited\x20Query:','Sequelize','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate'];(function(_0xffcd3c,_0x528848){var _0x3eaa23=function(_0x5f5a41){while(--_0x5f5a41){_0xffcd3c['push'](_0xffcd3c['shift']());}};_0x3eaa23(++_0x528848);}(_0x4014,0x15a));var _0x4401=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x4014[_0x263a74];return _0x2aa86c;};'use strict';var pdf=require(_0x4401('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4401('0x1'));var zipdir=require(_0x4401('0x2'));var jsonpatch=require(_0x4401('0x3'));var rp=require(_0x4401('0x4'));var moment=require(_0x4401('0x5'));var BPromise=require(_0x4401('0x6'));var Mustache=require(_0x4401('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4401('0x8'));var fs=require('fs');var _=require(_0x4401('0x9'));var squel=require(_0x4401('0xa'));var crypto=require(_0x4401('0xb'));var jsforce=require(_0x4401('0xc'));var deskjs=require(_0x4401('0xd'));var toCsv=require(_0x4401('0xe'));var querystring=require(_0x4401('0xf'));var Papa=require('papaparse');var Redis=require(_0x4401('0x10'));var authService=require(_0x4401('0x11'));var qs=require(_0x4401('0x12'));var hardwareService=require(_0x4401('0x13'));var logger=require(_0x4401('0x14'))(_0x4401('0x15'));var utils=require(_0x4401('0x16'));var config=require(_0x4401('0x17'));var db=require(_0x4401('0x18'))['db'];function respondWithStatusCode(_0xb07ae8,_0x366cf8){_0x366cf8=_0x366cf8||0xcc;return function(_0xe458b3){if(_0xe458b3){return _0xb07ae8[_0x4401('0x19')](_0x366cf8);}return _0xb07ae8[_0x4401('0x1a')](_0x366cf8)[_0x4401('0x1b')]();};}function respondWithResult(_0x527b29,_0x21ec2f){_0x21ec2f=_0x21ec2f||0xc8;return function(_0x492c0e){if(_0x492c0e){return _0x527b29['status'](_0x21ec2f)['json'](_0x492c0e);}};}function respondWithFilteredResult(_0x4d51d6,_0x287a04){return function(_0x53299f){if(_0x53299f){var _0xbc2bf9=_0x53299f['count'],_0x5309ba=_0x287a04[_0x4401('0x1c')],_0x362cab=_0x287a04[_0x4401('0x1c')]+_0x287a04['limit'],_0x5bc526;if(_0x362cab>=_0xbc2bf9){_0x362cab=_0xbc2bf9;_0x5bc526=0xc8;}else{_0x5bc526=0xce;}_0x4d51d6[_0x4401('0x1a')](_0x5bc526);return _0x4d51d6[_0x4401('0x1d')](_0x4401('0x1e'),_0x5309ba+'-'+_0x362cab+'/'+_0xbc2bf9)['json'](_0x53299f);}return null;};}function patchUpdates(_0x277102){return function(_0x51729a){try{jsonpatch[_0x4401('0x1f')](_0x51729a,_0x277102,!![]);}catch(_0x22c3b9){return BPromise[_0x4401('0x20')](_0x22c3b9);}return _0x51729a['save']();};}function saveUpdates(_0x417151,_0x3676f5){return function(_0x198a91){if(_0x198a91){return _0x198a91['update'](_0x417151)[_0x4401('0x21')](function(_0x536d57){return _0x536d57;});}return null;};}function removeEntity(_0x492077,_0x470ccd){return function(_0x3ee195){if(_0x3ee195){return _0x3ee195[_0x4401('0x22')]()[_0x4401('0x21')](function(){var _0x3f5c5e=_0x3ee195[_0x4401('0x23')]({'plain':!![]});var _0x3dc8c6=_0x4401('0x24');return db[_0x4401('0x25')][_0x4401('0x22')]({'where':{'type':_0x3dc8c6,'resourceId':_0x3f5c5e['id']}})['then'](function(){return _0x3ee195;});})[_0x4401('0x21')](function(){_0x492077[_0x4401('0x1a')](0xcc)[_0x4401('0x1b')]();});}};}function handleEntityNotFound(_0x3e9e72,_0x4aec1f){return function(_0xa053b8){if(!_0xa053b8){_0x3e9e72[_0x4401('0x19')](0x194);}return _0xa053b8;};}function handleError(_0x2983f0,_0x376be6){_0x376be6=_0x376be6||0x1f4;return function(_0x5321ec){logger[_0x4401('0x26')](_0x5321ec[_0x4401('0x27')]);if(_0x5321ec[_0x4401('0x28')]){delete _0x5321ec['name'];}_0x2983f0[_0x4401('0x1a')](_0x376be6)[_0x4401('0x29')](_0x5321ec);};}exports[_0x4401('0x2a')]=function(_0x67d604,_0x59f189){var _0x1af2a6={},_0xb8229b={},_0x463d26={'count':0x0,'rows':[]};var _0x25e1b3=db[_0x4401('0x2b')][_0x4401('0x2c')];_0xb8229b['model']=_['keys'](_0x25e1b3);_0xb8229b[_0x4401('0x2d')]=_[_0x4401('0x2e')](_0x67d604[_0x4401('0x2d')]);_0xb8229b[_0x4401('0x2f')]=_['intersection'](_0xb8229b[_0x4401('0x30')],_0xb8229b[_0x4401('0x2d')]);_0x1af2a6[_0x4401('0x31')]=_[_0x4401('0x32')](_0xb8229b[_0x4401('0x30')],qs[_0x4401('0x33')](_0x67d604[_0x4401('0x2d')][_0x4401('0x33')]));_0x1af2a6[_0x4401('0x31')]=_0x1af2a6['attributes'][_0x4401('0x34')]?_0x1af2a6[_0x4401('0x31')]:_0xb8229b['model'];if(!_0x67d604['query'][_0x4401('0x35')](_0x4401('0x36'))){_0x1af2a6[_0x4401('0x37')]=qs[_0x4401('0x37')](_0x67d604[_0x4401('0x2d')]['limit']);_0x1af2a6['offset']=qs['offset'](_0x67d604[_0x4401('0x2d')][_0x4401('0x1c')]);}_0x1af2a6['order']=qs['sort'](_0x67d604[_0x4401('0x2d')][_0x4401('0x38')]);_0x1af2a6['where']=qs[_0x4401('0x2f')](_[_0x4401('0x39')](_0x67d604[_0x4401('0x2d')],_0xb8229b[_0x4401('0x2f')]));if(_0x67d604[_0x4401('0x2d')][_0x4401('0x3a')]){_0x1af2a6[_0x4401('0x3b')]=_[_0x4401('0x3c')](_0x1af2a6[_0x4401('0x3b')],{'$or':_[_0x4401('0x3d')](_0x25e1b3,function(_0x60d2fb){if(_0x60d2fb['type'][_0x4401('0x3e')]!==_0x4401('0x3f')){var _0x8ea395={};_0x8ea395[_0x60d2fb[_0x4401('0x40')]]={'$like':'%'+_0x67d604[_0x4401('0x2d')][_0x4401('0x3a')]+'%'};return _0x8ea395;}})});}_0x1af2a6=_[_0x4401('0x3c')]({},_0x1af2a6,_0x67d604[_0x4401('0x41')]);var _0x4ddbf7={'where':_0x1af2a6[_0x4401('0x3b')]};return db[_0x4401('0x2b')][_0x4401('0x42')](_0x4ddbf7)['then'](function(_0x26706f){_0x463d26[_0x4401('0x42')]=_0x26706f;if(_0x67d604[_0x4401('0x2d')][_0x4401('0x43')]){_0x1af2a6[_0x4401('0x44')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x4401('0x45')](_0x1af2a6);})[_0x4401('0x21')](function(_0x3ccb14){_0x463d26[_0x4401('0x46')]=_0x3ccb14;return _0x463d26;})[_0x4401('0x21')](respondWithFilteredResult(_0x59f189,_0x1af2a6))['catch'](handleError(_0x59f189,null));};exports['show']=function(_0x109920,_0x501459){var _0x5aa2eb={'raw':![],'where':{'id':_0x109920['params']['id']}},_0x4a2a62={};_0x4a2a62[_0x4401('0x30')]=_[_0x4401('0x2e')](db[_0x4401('0x2b')][_0x4401('0x2c')]);_0x4a2a62['query']=_[_0x4401('0x2e')](_0x109920['query']);_0x4a2a62[_0x4401('0x2f')]=_[_0x4401('0x32')](_0x4a2a62['model'],_0x4a2a62['query']);_0x5aa2eb[_0x4401('0x31')]=_[_0x4401('0x32')](_0x4a2a62[_0x4401('0x30')],qs[_0x4401('0x33')](_0x109920['query'][_0x4401('0x33')]));_0x5aa2eb[_0x4401('0x31')]=_0x5aa2eb[_0x4401('0x31')][_0x4401('0x34')]?_0x5aa2eb['attributes']:_0x4a2a62[_0x4401('0x30')];if(_0x109920[_0x4401('0x2d')][_0x4401('0x43')]){_0x5aa2eb[_0x4401('0x44')]=[{'all':!![]}];}_0x5aa2eb=_[_0x4401('0x3c')]({},_0x5aa2eb,_0x109920[_0x4401('0x41')]);return db[_0x4401('0x2b')][_0x4401('0x47')](_0x5aa2eb)[_0x4401('0x21')](handleEntityNotFound(_0x501459,null))['then'](respondWithResult(_0x501459,null))[_0x4401('0x48')](handleError(_0x501459,null));};exports['create']=function(_0x16a324,_0x196645){return db[_0x4401('0x2b')][_0x4401('0x49')](_0x16a324['body'],{})[_0x4401('0x21')](function(_0x32a4a9){var _0x255fc9=_0x16a324[_0x4401('0x4a')]['get']({'plain':!![]});if(!_0x255fc9)throw new Error(_0x4401('0x4b'));if(_0x255fc9['role']===_0x4401('0x4a')){var _0x2be4d8=_0x32a4a9[_0x4401('0x23')]({'plain':!![]});var _0x4265b9=_0x4401('0x4c');return db['UserProfileSection']['find']({'where':{'name':_0x4265b9,'userProfileId':_0x255fc9[_0x4401('0x4d')]},'raw':!![]})[_0x4401('0x21')](function(_0x3ce0e1){if(_0x3ce0e1&&_0x3ce0e1[_0x4401('0x4e')]===0x0){return db[_0x4401('0x25')][_0x4401('0x49')]({'name':_0x2be4d8[_0x4401('0x28')],'resourceId':_0x2be4d8['id'],'type':_0x4401('0x24'),'sectionId':_0x3ce0e1['id']},{})['then'](function(){return _0x32a4a9;});}else{return _0x32a4a9;}})[_0x4401('0x48')](function(_0x2a4855){logger[_0x4401('0x26')](_0x4401('0x4f'),_0x2a4855);throw _0x2a4855;});}return _0x32a4a9;})[_0x4401('0x21')](respondWithResult(_0x196645,0xc9))[_0x4401('0x48')](handleError(_0x196645,null));};exports[_0x4401('0x50')]=function(_0x227ebe,_0x3cb1d4){if(_0x227ebe[_0x4401('0x51')]['id']){delete _0x227ebe[_0x4401('0x51')]['id'];}return db[_0x4401('0x2b')][_0x4401('0x47')]({'where':{'id':_0x227ebe['params']['id']}})[_0x4401('0x21')](handleEntityNotFound(_0x3cb1d4,null))[_0x4401('0x21')](saveUpdates(_0x227ebe[_0x4401('0x51')],null))[_0x4401('0x21')](respondWithResult(_0x3cb1d4,null))[_0x4401('0x48')](handleError(_0x3cb1d4,null));};exports[_0x4401('0x22')]=function(_0x590750,_0x2b0a49){return db[_0x4401('0x2b')][_0x4401('0x47')]({'where':{'id':_0x590750[_0x4401('0x52')]['id']}})[_0x4401('0x21')](handleEntityNotFound(_0x2b0a49,null))['then'](removeEntity(_0x2b0a49,null))[_0x4401('0x48')](handleError(_0x2b0a49,null));};exports[_0x4401('0x53')]=function(_0x11dfef,_0x524ebc){var _0x47593c=0xa;var _0x4e1377=[_0x4401('0x54'),'left_join','right_join',_0x4401('0x55')];var _0x4e3823={'SUM':_0x4401('0x56'),'COUNT':_0x4401('0x57'),'COUNT DISTINCT':_0x4401('0x58'),'MAX':_0x4401('0x59'),'MIN':_0x4401('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4401('0x5b'),'GROUP_CONCAT ASC':_0x4401('0x5c'),'GROUP_CONCAT DESC':_0x4401('0x5d')};var _0x327aa7={'SEC_TO_TIME':_0x4401('0x5e'),'DATE':_0x4401('0x5f'),'HOUR':_0x4401('0x60'),'ROUND':_0x4401('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x32cb72=function(_0x7e229b){return!_['includes']([_0x4401('0x62'),'IS\x20NOT\x20NULL',_0x4401('0x63'),'IS\x20NOT\x20EMPTY'],_0x7e229b);};var _0x580738=function(_0x4955b4){if(!_0x4955b4||!_0x4955b4[_0x4401('0x64')]['length']){return'';}for(var _0x38df1e='(',_0x3b5453=0x0;_0x3b5453<_0x4955b4[_0x4401('0x64')][_0x4401('0x34')];_0x3b5453+=0x1){_0x3b5453>0x0&&(_0x38df1e+='\x20'+_0x4955b4[_0x4401('0x65')]+'\x20');_0x38df1e+=_0x4955b4['rules'][_0x3b5453]['group']?_0x580738(_0x4955b4[_0x4401('0x64')][_0x3b5453][_0x4401('0x66')]):_0x4955b4[_0x4401('0x64')][_0x3b5453][_0x4401('0x40')]+'\x20'+_0x4955b4[_0x4401('0x64')][_0x3b5453][_0x4401('0x67')]+(_0x32cb72(_0x4955b4[_0x4401('0x64')][_0x3b5453][_0x4401('0x67')])?'\x20'+_0x4955b4['rules'][_0x3b5453][_0x4401('0x68')]:'');}return _0x38df1e+')';};var _0x5d2cd9={'where':{'id':_0x11dfef[_0x4401('0x52')]['id']}},_0x522c30,_0x4cc570,_0x22d96d,_0x3d0db0,_0x3d3146;_0x5d2cd9=_[_0x4401('0x3c')]({},_0x5d2cd9,_0x11dfef[_0x4401('0x41')]);return db['AnalyticCustomReport'][_0x4401('0x47')](_0x5d2cd9)[_0x4401('0x21')](function(_0x3bafb2){if(_0x3bafb2){_0x522c30=_0x3bafb2;return _0x3bafb2[_0x4401('0x69')]();}return null;})[_0x4401('0x21')](function(_0x4761cf){if(_0x4761cf){if(!_0x4761cf['length']){throw new db['Sequelize'][(_0x4401('0x6a'))](_0x4401('0x6b'),0x193);}_0x4cc570=_0x4761cf;return db['AnalyticMetric'][_0x4401('0x45')]({'raw':!![]});}return null;})[_0x4401('0x21')](function(_0x3868a4){if(_0x3868a4){_0x22d96d=_[_0x4401('0x6c')](_0x3868a4,'id');var _0x2ceb60;var _0x41d204=squel[_0x4401('0x6d')]();_0x41d204[_0x4401('0x6e')](_0x522c30[_0x4401('0x6f')]);for(var _0x4ff4dd=0x0;_0x4ff4dd<_0x4cc570['length'];_0x4ff4dd+=0x1){_0x2ceb60=_0x4cc570[_0x4ff4dd]['MetricId']?_0x22d96d[_0x4cc570[_0x4ff4dd][_0x4401('0x70')]][_0x4401('0x71')]:_0x4cc570[_0x4ff4dd][_0x4401('0x40')];_0x2ceb60=_0x4cc570[_0x4ff4dd][_0x4401('0x72')]?_[_0x4401('0x73')](_0x4e3823[_0x4cc570[_0x4ff4dd]['function']],'%s',_0x2ceb60):_0x2ceb60;_0x2ceb60=_0x4cc570[_0x4ff4dd][_0x4401('0x74')]?_['replace'](_0x327aa7[_0x4cc570[_0x4ff4dd][_0x4401('0x74')]],'%s',_0x2ceb60):_0x2ceb60;if(_0x4cc570[_0x4ff4dd][_0x4401('0x75')]){_0x41d204[_0x4401('0x66')](_0x2ceb60);}_0x4cc570[_0x4ff4dd]['orderBy']&&_0x41d204[_0x4401('0x76')](_0x2ceb60,_0x4cc570[_0x4ff4dd][_0x4401('0x77')]===_0x4401('0x78')?![]:!![]);_0x41d204[_0x4401('0x40')](_0x2ceb60,_0x4cc570[_0x4ff4dd]['alias']||_0x2ceb60);}if(_0x522c30[_0x4401('0x79')]){_0x522c30[_0x4401('0x79')]=JSON['parse'](_0x522c30[_0x4401('0x79')]);for(var _0x37fa1e=0x0;_0x37fa1e<_0x522c30[_0x4401('0x79')][_0x4401('0x34')];_0x37fa1e+=0x1){if(_0x522c30[_0x4401('0x79')][_0x37fa1e]['type']&&_[_0x4401('0x7a')](_0x4e1377,_0x522c30['joins'][_0x37fa1e]['type'])&&_0x522c30[_0x4401('0x79')][_0x37fa1e]['parentKey']&&_0x522c30['joins'][_0x37fa1e]['foreignTable']&&_0x522c30[_0x4401('0x79')][_0x37fa1e][_0x4401('0x7b')]){_0x41d204[_0x522c30[_0x4401('0x79')][_0x37fa1e]['type']](_0x522c30[_0x4401('0x79')][_0x37fa1e][_0x4401('0x7c')],null,util[_0x4401('0x74')](_0x4401('0x7d'),_0x522c30[_0x4401('0x6f')],_0x522c30[_0x4401('0x79')][_0x37fa1e]['parentKey'],_0x522c30['joins'][_0x37fa1e][_0x4401('0x7c')],_0x522c30[_0x4401('0x79')][_0x37fa1e][_0x4401('0x7b')]));}}}if(_0x522c30[_0x4401('0x7e')]){_0x522c30['conditions']=JSON[_0x4401('0x7f')](_0x522c30['conditions']);_0x41d204[_0x4401('0x3b')](_0x580738(_0x522c30['conditions'][_0x4401('0x66')]));}_0x3d3146=_0x41d204['clone']();_0x41d204['limit'](_0x47593c);_0x41d204[_0x4401('0x1c')](0x0);logger[_0x4401('0x80')]('Limited\x20Query:',_0x41d204[_0x4401('0x81')]());return db[_0x4401('0x82')][_0x4401('0x2d')](_0x41d204['toString'](),{'type':db[_0x4401('0x82')][_0x4401('0x83')][_0x4401('0x84')]});}})[_0x4401('0x21')](respondWithResult(_0x524ebc,null))[_0x4401('0x48')](handleError(_0x524ebc,null));};function runReport(_0x12488d,_0xf50d4e,_0x320c91){var _0x19f908=_0xf50d4e[_0x4401('0x28')];var _0x181729=0xa;var _0x12916f=['join','left_join','right_join',_0x4401('0x55')];var _0x23fa22={'SUM':_0x4401('0x56'),'COUNT':_0x4401('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4401('0x85'),'GROUP_CONCAT':_0x4401('0x5b'),'GROUP_CONCAT ASC':_0x4401('0x5c'),'GROUP_CONCAT DESC':_0x4401('0x5d')};var _0x3a9deb={'SEC_TO_TIME':_0x4401('0x5e'),'DATE':_0x4401('0x5f'),'HOUR':_0x4401('0x60'),'ROUND':_0x4401('0x61'),'UNIX_TIMESTAMP':_0x4401('0x86')};var _0x48f3f6=function(_0x5c6bc4){return!_['includes']([_0x4401('0x62'),_0x4401('0x87'),_0x4401('0x63'),_0x4401('0x88')],_0x5c6bc4);};var _0x5616c7=function(_0x2c1646){if(!_0x2c1646||!_0x2c1646[_0x4401('0x64')]['length']){return'';}for(var _0x2d8c46='(',_0x3cc69b=0x0;_0x3cc69b<_0x2c1646[_0x4401('0x64')][_0x4401('0x34')];_0x3cc69b+=0x1){_0x3cc69b>0x0&&(_0x2d8c46+='\x20'+_0x2c1646[_0x4401('0x65')]+'\x20');_0x2d8c46+=_0x2c1646[_0x4401('0x64')][_0x3cc69b][_0x4401('0x66')]?_0x5616c7(_0x2c1646['rules'][_0x3cc69b][_0x4401('0x66')]):_0x2c1646[_0x4401('0x64')][_0x3cc69b]['field']+'\x20'+_0x2c1646[_0x4401('0x64')][_0x3cc69b]['condition']+(_0x48f3f6(_0x2c1646['rules'][_0x3cc69b]['condition'])?'\x20'+_0x2c1646[_0x4401('0x64')][_0x3cc69b][_0x4401('0x68')]:'');}return _0x2d8c46+')';};var _0x51dd4c={'where':{'id':_0x12488d['id']}},_0x720cf0,_0x48a23f,_0x4c4d98,_0x44cb6b,_0x15db74;_0x51dd4c=_[_0x4401('0x3c')]({},_0x51dd4c,_0x320c91);return db[_0x4401('0x2b')][_0x4401('0x47')](_0x51dd4c)[_0x4401('0x21')](function(_0x4bfc73){if(_0x4bfc73){_0x720cf0=_0x4bfc73;return _0x4bfc73[_0x4401('0x69')]();}return null;})['then'](function(_0x47b4bf){if(_0x47b4bf){if(!_0x47b4bf['length']){throw new db['Sequelize'][(_0x4401('0x6a'))](_0x4401('0x6b'),0x193);}_0x48a23f=_0x47b4bf;return db[_0x4401('0x89')][_0x4401('0x45')]({'raw':!![]});}return null;})[_0x4401('0x21')](function(_0x118af8){if(_0x118af8){_0x4c4d98=_['keyBy'](_0x118af8,'id');var _0x35d53f;var _0x35566e=squel[_0x4401('0x6d')]();_0x35566e['from'](_0x720cf0[_0x4401('0x6f')]);for(var _0x400811=0x0;_0x400811<_0x48a23f[_0x4401('0x34')];_0x400811+=0x1){_0x35d53f=_0x48a23f[_0x400811][_0x4401('0x70')]?_0x4c4d98[_0x48a23f[_0x400811]['MetricId']][_0x4401('0x71')]:_0x48a23f[_0x400811][_0x4401('0x40')];_0x35d53f=_0x48a23f[_0x400811][_0x4401('0x72')]?_[_0x4401('0x73')](_0x23fa22[_0x48a23f[_0x400811][_0x4401('0x72')]],'%s',_0x35d53f):_0x35d53f;_0x35d53f=_0x48a23f[_0x400811][_0x4401('0x74')]?_[_0x4401('0x73')](_0x3a9deb[_0x48a23f[_0x400811][_0x4401('0x74')]],'%s',_0x35d53f):_0x35d53f;if(_0x48a23f[_0x400811][_0x4401('0x75')]){_0x35566e[_0x4401('0x66')](_0x35d53f);}_0x48a23f[_0x400811][_0x4401('0x77')]&&_0x35566e[_0x4401('0x76')](_0x35d53f,_0x48a23f[_0x400811][_0x4401('0x77')]===_0x4401('0x78')?![]:!![]);_0x35566e[_0x4401('0x40')](_0x35d53f,_0x48a23f[_0x400811][_0x4401('0x8a')]||_0x35d53f);}if(_0x720cf0['joins']){_0x720cf0[_0x4401('0x79')]=JSON[_0x4401('0x7f')](_0x720cf0[_0x4401('0x79')]);for(var _0x3e8539=0x0;_0x3e8539<_0x720cf0[_0x4401('0x79')]['length'];_0x3e8539+=0x1){if(_0x720cf0[_0x4401('0x79')][_0x3e8539]['type']&&_[_0x4401('0x7a')](_0x12916f,_0x720cf0[_0x4401('0x79')][_0x3e8539][_0x4401('0x8b')])&&_0x720cf0[_0x4401('0x79')][_0x3e8539][_0x4401('0x8c')]&&_0x720cf0[_0x4401('0x79')][_0x3e8539][_0x4401('0x7c')]&&_0x720cf0['joins'][_0x3e8539]['foreignKey']){_0x35566e[_0x720cf0[_0x4401('0x79')][_0x3e8539][_0x4401('0x8b')]](_0x720cf0['joins'][_0x3e8539]['foreignTable'],null,util['format'](_0x4401('0x7d'),_0x720cf0['table'],_0x720cf0[_0x4401('0x79')][_0x3e8539][_0x4401('0x8c')],_0x720cf0[_0x4401('0x79')][_0x3e8539][_0x4401('0x7c')],_0x720cf0[_0x4401('0x79')][_0x3e8539]['foreignKey']));}}}if(_0x720cf0['conditions']){_0x720cf0[_0x4401('0x7e')]=JSON[_0x4401('0x7f')](_0x720cf0['conditions']);_0x35566e[_0x4401('0x3b')](_0x5616c7(_0x720cf0[_0x4401('0x7e')][_0x4401('0x66')]));}_0x15db74=_0x35566e[_0x4401('0x8d')]();_0x35566e[_0x4401('0x37')](_0x181729);_0x35566e['offset'](0x0);logger[_0x4401('0x80')](_0x4401('0x8e'),_0x35566e[_0x4401('0x81')]());return db['sequelize'][_0x4401('0x2d')](_0x35566e[_0x4401('0x81')](),{'type':db[_0x4401('0x82')][_0x4401('0x83')][_0x4401('0x84')]});}})[_0x4401('0x21')](function(_0x278066){if(!_0x278066['length']){throw new db[(_0x4401('0x8f'))][(_0x4401('0x6a'))](_0x4401('0x90'),0xcc);}if(_0xf50d4e[_0x4401('0x91')]===_0x4401('0x92')){return null;}var _0x43299f=_[_0x4401('0x3c')](_0xf50d4e,{'name':_0xf50d4e[_0x4401('0x93')]||_0xf50d4e[_0x4401('0x28')]||_0x720cf0[_0x4401('0x28')],'basename':_0x19f908,'savename':util[_0x4401('0x74')](_0x4401('0x94'),_0xf50d4e[_0x4401('0x28')]||_0x720cf0[_0x4401('0x28')],require(_0x4401('0x95'))[_0x4401('0x96')](0x4),_0xf50d4e[_0x4401('0x91')]||_0x4401('0x97')),'reportId':_0x720cf0['id'],'reportType':_0x4401('0x98')});return db['AnalyticExtractedReport'][_0x4401('0x49')](_0x43299f,{'raw':!![]});})[_0x4401('0x21')](function(_0x2350c0){if(_0x720cf0[_0x4401('0x6f')]==='cdr'){_0x15db74[_0x4401('0x3b')](_0x720cf0['table']+_0x4401('0x99'),_0xf50d4e[_0x4401('0x9a')],_0xf50d4e[_0x4401('0x9b')]);}else{_0x15db74['where'](_0x720cf0['table']+_0x4401('0x9c'),_0xf50d4e[_0x4401('0x9a')],_0xf50d4e[_0x4401('0x9b')]);}if(_0x2350c0){logger[_0x4401('0x9d')](_0x4401('0x9e'),_0x15db74[_0x4401('0x81')]());require(_0x4401('0x9f'))[_0x4401('0xa0')](path[_0x4401('0x54')](__dirname,_0x4401('0xa1'),_0x2350c0[_0x4401('0x91')]),[_0x2350c0['id'],_0x15db74[_0x4401('0x81')](),path[_0x4401('0x54')](__dirname,_0x4401('0xa2'),_0x2350c0['savename']),_0x19f908]);return _0x2350c0;}else{var _0x33a43b=squel[_0x4401('0x6d')]();_0x33a43b[_0x4401('0x6e')]('('+_0x15db74['toString']()+')','countTable');_0x33a43b['field'](_0x4401('0xa3'),_0x4401('0x42'));_0x15db74[_0x4401('0x37')](_0xf50d4e[_0x4401('0x37')]||_0x181729);_0x15db74[_0x4401('0x1c')](_0xf50d4e[_0x4401('0x1c')]||0x0);return db['sequelize'][_0x4401('0x2d')](_0x33a43b['toString'](),{'type':db[_0x4401('0x82')][_0x4401('0x83')][_0x4401('0x84')]})[_0x4401('0x21')](function(_0x3bc6a9){if(!_0x3bc6a9['length']){_0x44cb6b=0x0;}else{_0x44cb6b=_0x3bc6a9[0x0][_0x4401('0x42')]||0x0;}return db[_0x4401('0x82')]['query'](_0x15db74[_0x4401('0x81')](),{'type':db['sequelize'][_0x4401('0x83')][_0x4401('0x84')]});})[_0x4401('0x21')](function(_0x5229bb){return{'rows':_0x5229bb||[],'count':_0x44cb6b};});}});}exports[_0x4401('0xa4')]=function(_0x322620,_0x443e10){return runReport(_0x322620[_0x4401('0x52')],_0x322620[_0x4401('0x2d')],_0x322620[_0x4401('0x41')])[_0x4401('0x21')](respondWithResult(_0x443e10,null))['catch'](handleError(_0x443e10,null));};exports['runReport']=runReport;exports[_0x4401('0x2d')]=function(_0x48d93d,_0x45bba8){var _0x44032d=0xa;var _0x11d1b7=[_0x4401('0x54'),_0x4401('0xa5'),_0x4401('0xa6'),_0x4401('0x55')];var _0x15078f={'SUM':_0x4401('0x56'),'COUNT':_0x4401('0x57'),'COUNT DISTINCT':_0x4401('0x58'),'MAX':_0x4401('0x59'),'MIN':_0x4401('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4401('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4401('0x5d')};var _0x2f992e={'SEC_TO_TIME':_0x4401('0x5e'),'DATE':_0x4401('0x5f'),'HOUR':_0x4401('0x60'),'ROUND':_0x4401('0x61'),'UNIX_TIMESTAMP':_0x4401('0x86')};var _0x1eb64d=function(_0x181293){return!_[_0x4401('0x7a')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x4401('0x88')],_0x181293);};var _0x1065d0=function(_0x5a55ad){if(!_0x5a55ad||!_0x5a55ad[_0x4401('0x64')][_0x4401('0x34')]){return'';}for(var _0x37d20f='(',_0x5ba1b9=0x0;_0x5ba1b9<_0x5a55ad[_0x4401('0x64')]['length'];_0x5ba1b9+=0x1){_0x5ba1b9>0x0&&(_0x37d20f+='\x20'+_0x5a55ad[_0x4401('0x65')]+'\x20');_0x37d20f+=_0x5a55ad[_0x4401('0x64')][_0x5ba1b9][_0x4401('0x66')]?_0x1065d0(_0x5a55ad[_0x4401('0x64')][_0x5ba1b9][_0x4401('0x66')]):_0x5a55ad[_0x4401('0x64')][_0x5ba1b9]['field']+'\x20'+_0x5a55ad['rules'][_0x5ba1b9]['condition']+(_0x1eb64d(_0x5a55ad[_0x4401('0x64')][_0x5ba1b9][_0x4401('0x67')])?'\x20'+_0x5a55ad[_0x4401('0x64')][_0x5ba1b9][_0x4401('0x68')]:'');}return _0x37d20f+')';};var _0x17073={'where':{'id':_0x48d93d['params']['id']}},_0x56220b,_0x1cf4fa,_0x543da3,_0x498f8a,_0x12c1c2;_0x17073=_[_0x4401('0x3c')]({},_0x17073,_0x48d93d[_0x4401('0x41')]);return db[_0x4401('0x2b')][_0x4401('0x47')](_0x17073)['then'](function(_0x54e3ca){if(_0x54e3ca){_0x56220b=_0x54e3ca;return _0x54e3ca[_0x4401('0x69')]();}return null;})['then'](function(_0xd3b73d){if(_0xd3b73d){if(!_0xd3b73d[_0x4401('0x34')]){throw new db[(_0x4401('0x8f'))][(_0x4401('0x6a'))](_0x4401('0x6b'),0x193);}_0x1cf4fa=_0xd3b73d;return db[_0x4401('0x89')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x5ee682){if(_0x5ee682){_0x543da3=_[_0x4401('0x6c')](_0x5ee682,'id');var _0x5452a5;var _0x380690=squel[_0x4401('0x6d')]();_0x380690[_0x4401('0x6e')](_0x56220b[_0x4401('0x6f')]);for(var _0x38deb4=0x0;_0x38deb4<_0x1cf4fa[_0x4401('0x34')];_0x38deb4+=0x1){_0x5452a5=_0x1cf4fa[_0x38deb4][_0x4401('0x70')]?_0x543da3[_0x1cf4fa[_0x38deb4][_0x4401('0x70')]][_0x4401('0x71')]:_0x1cf4fa[_0x38deb4][_0x4401('0x40')];_0x5452a5=_0x1cf4fa[_0x38deb4][_0x4401('0x72')]?_[_0x4401('0x73')](_0x15078f[_0x1cf4fa[_0x38deb4]['function']],'%s',_0x5452a5):_0x5452a5;_0x5452a5=_0x1cf4fa[_0x38deb4][_0x4401('0x74')]?_['replace'](_0x2f992e[_0x1cf4fa[_0x38deb4][_0x4401('0x74')]],'%s',_0x5452a5):_0x5452a5;if(_0x1cf4fa[_0x38deb4][_0x4401('0x75')]){_0x380690[_0x4401('0x66')](_0x5452a5);}_0x1cf4fa[_0x38deb4][_0x4401('0x77')]&&_0x380690[_0x4401('0x76')](_0x5452a5,_0x1cf4fa[_0x38deb4][_0x4401('0x77')]==='DESC'?![]:!![]);_0x380690[_0x4401('0x40')](_0x5452a5,_0x1cf4fa[_0x38deb4][_0x4401('0x8a')]||_0x5452a5);}if(_0x56220b[_0x4401('0x79')]){_0x56220b['joins']=JSON[_0x4401('0x7f')](_0x56220b[_0x4401('0x79')]);for(var _0x822162=0x0;_0x822162<_0x56220b[_0x4401('0x79')][_0x4401('0x34')];_0x822162+=0x1){if(_0x56220b[_0x4401('0x79')][_0x822162][_0x4401('0x8b')]&&_[_0x4401('0x7a')](_0x11d1b7,_0x56220b[_0x4401('0x79')][_0x822162][_0x4401('0x8b')])&&_0x56220b['joins'][_0x822162][_0x4401('0x8c')]&&_0x56220b['joins'][_0x822162][_0x4401('0x7c')]&&_0x56220b[_0x4401('0x79')][_0x822162][_0x4401('0x7b')]){_0x380690[_0x56220b[_0x4401('0x79')][_0x822162][_0x4401('0x8b')]](_0x56220b[_0x4401('0x79')][_0x822162][_0x4401('0x7c')],null,util[_0x4401('0x74')](_0x4401('0x7d'),_0x56220b[_0x4401('0x6f')],_0x56220b[_0x4401('0x79')][_0x822162]['parentKey'],_0x56220b[_0x4401('0x79')][_0x822162][_0x4401('0x7c')],_0x56220b[_0x4401('0x79')][_0x822162][_0x4401('0x7b')]));}}}if(_0x56220b[_0x4401('0x7e')]){_0x56220b[_0x4401('0x7e')]=JSON[_0x4401('0x7f')](_0x56220b[_0x4401('0x7e')]);_0x380690['where'](_0x1065d0(_0x56220b[_0x4401('0x7e')][_0x4401('0x66')]));}_0x12c1c2=_0x380690[_0x4401('0x8d')]();_0x380690['limit'](_0x44032d);_0x380690[_0x4401('0x1c')](0x0);logger['debug']('Limited\x20Query:',_0x380690[_0x4401('0x81')]());return db[_0x4401('0x82')][_0x4401('0x2d')](_0x380690[_0x4401('0x81')](),{'type':db[_0x4401('0x82')][_0x4401('0x83')][_0x4401('0x84')]});}})[_0x4401('0x21')](function(){return{'sql':_0x12c1c2[_0x4401('0x81')]()};})[_0x4401('0x21')](respondWithResult(_0x45bba8,null))[_0x4401('0x48')](handleError(_0x45bba8,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 0f1a993..cef1751 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 _0x4308=['../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5629c8,_0x12858d){var _0x1c5f97=function(_0x29402a){while(--_0x29402a){_0x5629c8['push'](_0x5629c8['shift']());}};_0x1c5f97(++_0x12858d);}(_0x4308,0x18c));var _0x8430=function(_0x4487d1,_0x5e55e2){_0x4487d1=_0x4487d1-0x0;var _0x1bb89a=_0x4308[_0x4487d1];return _0x1bb89a;};'use strict';var _=require(_0x8430('0x0'));var util=require(_0x8430('0x1'));var logger=require(_0x8430('0x2'))(_0x8430('0x3'));var moment=require(_0x8430('0x4'));var BPromise=require(_0x8430('0x5'));var rp=require(_0x8430('0x6'));var fs=require('fs');var path=require(_0x8430('0x7'));var rimraf=require(_0x8430('0x8'));var config=require(_0x8430('0x9'));var attributes=require(_0x8430('0xa'));module[_0x8430('0xb')]=function(_0x35915b,_0x52706b){return _0x35915b[_0x8430('0xc')](_0x8430('0xd'),attributes,{'tableName':_0x8430('0xe'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8c8d=['path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x8c8d,0x7c));var _0xd8c8=function(_0x3b4638,_0x2d8442){_0x3b4638=_0x3b4638-0x0;var _0x445338=_0x8c8d[_0x3b4638];return _0x445338;};'use strict';var _=require('lodash');var util=require(_0xd8c8('0x0'));var logger=require(_0xd8c8('0x1'))(_0xd8c8('0x2'));var moment=require(_0xd8c8('0x3'));var BPromise=require(_0xd8c8('0x4'));var rp=require(_0xd8c8('0x5'));var fs=require('fs');var path=require(_0xd8c8('0x6'));var rimraf=require(_0xd8c8('0x7'));var config=require('../../config/environment');var attributes=require(_0xd8c8('0x8'));module[_0xd8c8('0x9')]=function(_0x4441c4,_0xaec740){return _0x4441c4[_0xd8c8('0xa')](_0xd8c8('0xb'),attributes,{'tableName':_0xd8c8('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 0bc705a..cc839c7 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 _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1c4790,_0x3003f7){var _0xbf6897=function(_0x346ff3){while(--_0x346ff3){_0x1c4790['push'](_0x1c4790['shift']());}};_0xbf6897(++_0x3003f7);}(_0xb10b,0x12a));var _0xbb10=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0xb10b[_0x209ec9];return _0x129b1b;};'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 +var _0xa9e0=['http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1c8969,_0x522538){var _0x34e1cd=function(_0x59204e){while(--_0x59204e){_0x1c8969['push'](_0x1c8969['shift']());}};_0x34e1cd(++_0x522538);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 53e3139..df9e2ab 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 _0xe511=['get','isAuthenticated','/:id','/:id/preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./analyticCustomReport.controller'];(function(_0x417bef,_0x46b8bb){var _0x321d81=function(_0x41ef6d){while(--_0x41ef6d){_0x417bef['push'](_0x417bef['shift']());}};_0x321d81(++_0x46b8bb);}(_0xe511,0x16f));var _0x1e51=function(_0x54da5b,_0x12fd71){_0x54da5b=_0x54da5b-0x0;var _0x285d3b=_0xe511[_0x54da5b];return _0x285d3b;};'use strict';var multer=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var path=require('path');var timeout=require(_0x1e51('0x2'));var express=require('express');var router=express[_0x1e51('0x3')]();var auth=require(_0x1e51('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1e51('0x5'));var controller=require(_0x1e51('0x6'));router[_0x1e51('0x7')]('/',auth[_0x1e51('0x8')](),controller['index']);router[_0x1e51('0x7')](_0x1e51('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x1e51('0x7')](_0x1e51('0xa'),auth['isAuthenticated'](),controller['preview']);router[_0x1e51('0x7')](_0x1e51('0xb'),auth[_0x1e51('0x8')](),controller[_0x1e51('0xc')]);router[_0x1e51('0x7')](_0x1e51('0xd'),auth['isAuthenticated'](),controller[_0x1e51('0xe')]);router[_0x1e51('0xf')]('/',auth[_0x1e51('0x8')](),controller[_0x1e51('0x10')]);router[_0x1e51('0x11')](_0x1e51('0x9'),auth['isAuthenticated'](),controller[_0x1e51('0x12')]);router[_0x1e51('0x13')](_0x1e51('0x9'),auth[_0x1e51('0x8')](),controller[_0x1e51('0x14')]);module[_0x1e51('0x15')]=router; \ No newline at end of file +var _0xd7d1=['/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x3ccf96,_0x5e0892){var _0x10dec4=function(_0x25629d){while(--_0x25629d){_0x3ccf96['push'](_0x3ccf96['shift']());}};_0x10dec4(++_0x5e0892);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x1a43a3,_0x2007ea){_0x1a43a3=_0x1a43a3-0x0;var _0x471f2c=_0xd7d1[_0x1a43a3];return _0x471f2c;};'use strict';var multer=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var timeout=require(_0x1d7d('0x3'));var express=require(_0x1d7d('0x4'));var router=express[_0x1d7d('0x5')]();var auth=require(_0x1d7d('0x6'));var interaction=require(_0x1d7d('0x7'));var config=require(_0x1d7d('0x8'));var controller=require(_0x1d7d('0x9'));router[_0x1d7d('0xa')]('/',auth[_0x1d7d('0xb')](),controller[_0x1d7d('0xc')]);router['get'](_0x1d7d('0xd'),auth[_0x1d7d('0xb')](),controller[_0x1d7d('0xe')]);router[_0x1d7d('0xa')](_0x1d7d('0xf'),auth[_0x1d7d('0xb')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0xa')](_0x1d7d('0x11'),auth[_0x1d7d('0xb')](),controller[_0x1d7d('0x12')]);router['get'](_0x1d7d('0x13'),auth['isAuthenticated'](),controller[_0x1d7d('0x14')]);router[_0x1d7d('0x15')]('/',auth[_0x1d7d('0xb')](),controller[_0x1d7d('0x16')]);router['put'](_0x1d7d('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x1d7d('0x17')](_0x1d7d('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x1d7d('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 0102bf8..7d613c0 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 _0x9a85=['exports','STRING','TEXT','sequelize'];(function(_0x3522a5,_0x532cbe){var _0x10ca3b=function(_0x534702){while(--_0x534702){_0x3522a5['push'](_0x3522a5['shift']());}};_0x10ca3b(++_0x532cbe);}(_0x9a85,0x6f));var _0x59a8=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0x9a85[_0x5678b5];return _0x4c09a5;};'use strict';var Sequelize=require(_0x59a8('0x0'));module[_0x59a8('0x1')]={'name':{'type':Sequelize[_0x59a8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x59a8('0x2')]},'parent':{'type':Sequelize[_0x59a8('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x59a8('0x3')]},'joins':{'type':Sequelize[_0x59a8('0x3')]}}; \ No newline at end of file +var _0x0580=['STRING','TEXT'];(function(_0xf23914,_0x1c7180){var _0x21de49=function(_0x422529){while(--_0x422529){_0xf23914['push'](_0xf23914['shift']());}};_0x21de49(++_0x1c7180);}(_0x0580,0x1be));var _0x0058=function(_0x993d99,_0x33eff1){_0x993d99=_0x993d99-0x0;var _0x3e03f0=_0x0580[_0x993d99];return _0x3e03f0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0058('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x0058('0x0')]},'parent':{'type':Sequelize[_0x0058('0x0')]},'table':{'type':Sequelize[_0x0058('0x0')]},'conditions':{'type':Sequelize[_0x0058('0x1')]},'joins':{'type':Sequelize[_0x0058('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index b1b7c5a..2123dcb 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 _0xa369=['key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','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)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','MetricId','function','replace','format','groupBy','orderBy','order','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','AVG(%s)','IS\x20NOT\x20EMPTY','ValidationErrorItem','from','table','metric','No\x20available\x20data','output','web','%s-%s.%s','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','COUNT(*)','count','run','runReport','HOUR(%s)','IS\x20NOT\x20NULL','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','offset','limit','status','Content-Range','json','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','AnalyticDefaultReport','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','type'];(function(_0x1ccb4b,_0x1c5bdc){var _0x2fd92c=function(_0x1a0286){while(--_0x1a0286){_0x1ccb4b['push'](_0x1ccb4b['shift']());}};_0x2fd92c(++_0x1c5bdc);}(_0xa369,0x1ab));var _0x9a36=function(_0x392174,_0x26445a){_0x392174=_0x392174-0x0;var _0x9d0d2a=_0xa369[_0x392174];return _0x9d0d2a;};'use strict';var pdf=require(_0x9a36('0x0'));var emlformat=require(_0x9a36('0x1'));var rimraf=require(_0x9a36('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a36('0x3'));var rp=require('request-promise');var moment=require(_0x9a36('0x4'));var BPromise=require(_0x9a36('0x5'));var Mustache=require(_0x9a36('0x6'));var util=require('util');var path=require(_0x9a36('0x7'));var sox=require('sox');var csv=require(_0x9a36('0x8'));var ejs=require(_0x9a36('0x9'));var fs=require('fs');var _=require(_0x9a36('0xa'));var squel=require(_0x9a36('0xb'));var crypto=require('crypto');var jsforce=require(_0x9a36('0xc'));var deskjs=require(_0x9a36('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9a36('0xe'));var authService=require(_0x9a36('0xf'));var qs=require(_0x9a36('0x10'));var hardwareService=require(_0x9a36('0x11'));var logger=require(_0x9a36('0x12'))(_0x9a36('0x13'));var utils=require(_0x9a36('0x14'));var config=require('../../config/environment');var db=require(_0x9a36('0x15'))['db'];function respondWithStatusCode(_0x5c0269,_0x381af8){_0x381af8=_0x381af8||0xcc;return function(_0x43c9d3){if(_0x43c9d3){return _0x5c0269[_0x9a36('0x16')](_0x381af8);}return _0x5c0269['status'](_0x381af8)[_0x9a36('0x17')]();};}function respondWithResult(_0x27e40d,_0x3dd68d){_0x3dd68d=_0x3dd68d||0xc8;return function(_0x1f8add){if(_0x1f8add){return _0x27e40d['status'](_0x3dd68d)['json'](_0x1f8add);}};}function respondWithFilteredResult(_0x19e34f,_0x39905a){return function(_0x5e49ac){if(_0x5e49ac){var _0x4140c5=_0x5e49ac['count'],_0x385e99=_0x39905a[_0x9a36('0x18')],_0x22c140=_0x39905a[_0x9a36('0x18')]+_0x39905a[_0x9a36('0x19')],_0x4036b1;if(_0x22c140>=_0x4140c5){_0x22c140=_0x4140c5;_0x4036b1=0xc8;}else{_0x4036b1=0xce;}_0x19e34f[_0x9a36('0x1a')](_0x4036b1);return _0x19e34f['set'](_0x9a36('0x1b'),_0x385e99+'-'+_0x22c140+'/'+_0x4140c5)[_0x9a36('0x1c')](_0x5e49ac);}return null;};}function patchUpdates(_0x241d96){return function(_0x49fc7e){try{jsonpatch[_0x9a36('0x1d')](_0x49fc7e,_0x241d96,!![]);}catch(_0x3ae42c){return BPromise[_0x9a36('0x1e')](_0x3ae42c);}return _0x49fc7e['save']();};}function saveUpdates(_0x8d7d24,_0x5e66e2){return function(_0x1396dd){if(_0x1396dd){return _0x1396dd[_0x9a36('0x1f')](_0x8d7d24)[_0x9a36('0x20')](function(_0xbcfa27){return _0xbcfa27;});}return null;};}function removeEntity(_0x4ce6cc,_0x59ac20){return function(_0x581b9f){if(_0x581b9f){return _0x581b9f[_0x9a36('0x21')]()[_0x9a36('0x20')](function(){var _0x3cd153=_0x581b9f[_0x9a36('0x22')]({'plain':!![]});var _0x52e5a0=_0x9a36('0x23');return db[_0x9a36('0x24')][_0x9a36('0x21')]({'where':{'type':_0x52e5a0,'resourceId':_0x3cd153['id']}})[_0x9a36('0x20')](function(){return _0x581b9f;});})[_0x9a36('0x20')](function(){_0x4ce6cc[_0x9a36('0x1a')](0xcc)[_0x9a36('0x17')]();});}};}function handleEntityNotFound(_0x3dbc55,_0x5d4388){return function(_0x458a7f){if(!_0x458a7f){_0x3dbc55['sendStatus'](0x194);}return _0x458a7f;};}function handleError(_0x414ca,_0x551657){_0x551657=_0x551657||0x1f4;return function(_0x383dab){logger[_0x9a36('0x25')](_0x383dab[_0x9a36('0x26')]);if(_0x383dab[_0x9a36('0x27')]){delete _0x383dab[_0x9a36('0x27')];}_0x414ca[_0x9a36('0x1a')](_0x551657)[_0x9a36('0x28')](_0x383dab);};}exports['index']=function(_0x5ec2e9,_0x1361e4){var _0xfffe81={},_0x46c833={},_0x48a617={'count':0x0,'rows':[]};var _0x547a30=db[_0x9a36('0x29')]['rawAttributes'];_0x46c833['model']=_['keys'](_0x547a30);_0x46c833['query']=_[_0x9a36('0x2a')](_0x5ec2e9[_0x9a36('0x2b')]);_0x46c833[_0x9a36('0x2c')]=_[_0x9a36('0x2d')](_0x46c833[_0x9a36('0x2e')],_0x46c833[_0x9a36('0x2b')]);_0xfffe81[_0x9a36('0x2f')]=_[_0x9a36('0x2d')](_0x46c833[_0x9a36('0x2e')],qs[_0x9a36('0x30')](_0x5ec2e9['query'][_0x9a36('0x30')]));_0xfffe81[_0x9a36('0x2f')]=_0xfffe81[_0x9a36('0x2f')][_0x9a36('0x31')]?_0xfffe81[_0x9a36('0x2f')]:_0x46c833[_0x9a36('0x2e')];if(!_0x5ec2e9[_0x9a36('0x2b')][_0x9a36('0x32')]('nolimit')){_0xfffe81['limit']=qs[_0x9a36('0x19')](_0x5ec2e9['query'][_0x9a36('0x19')]);_0xfffe81[_0x9a36('0x18')]=qs[_0x9a36('0x18')](_0x5ec2e9[_0x9a36('0x2b')][_0x9a36('0x18')]);}_0xfffe81['order']=qs[_0x9a36('0x33')](_0x5ec2e9['query'][_0x9a36('0x33')]);_0xfffe81[_0x9a36('0x34')]=qs[_0x9a36('0x2c')](_[_0x9a36('0x35')](_0x5ec2e9['query'],_0x46c833[_0x9a36('0x2c')]));if(_0x5ec2e9[_0x9a36('0x2b')]['filter']){_0xfffe81[_0x9a36('0x34')]=_[_0x9a36('0x36')](_0xfffe81[_0x9a36('0x34')],{'$or':_['map'](_0x547a30,function(_0x2f5118){if(_0x2f5118[_0x9a36('0x37')][_0x9a36('0x38')]!==_0x9a36('0x39')){var _0x4ee1e2={};_0x4ee1e2[_0x2f5118[_0x9a36('0x3a')]]={'$like':'%'+_0x5ec2e9[_0x9a36('0x2b')][_0x9a36('0x3b')]+'%'};return _0x4ee1e2;}})});}_0xfffe81=_[_0x9a36('0x36')]({},_0xfffe81,_0x5ec2e9[_0x9a36('0x3c')]);var _0x213efa={'where':_0xfffe81[_0x9a36('0x34')]};return db[_0x9a36('0x29')]['count'](_0x213efa)[_0x9a36('0x20')](function(_0x3f9a86){_0x48a617['count']=_0x3f9a86;if(_0x5ec2e9[_0x9a36('0x2b')][_0x9a36('0x3d')]){_0xfffe81[_0x9a36('0x3e')]=[{'all':!![]}];}return db[_0x9a36('0x29')][_0x9a36('0x3f')](_0xfffe81);})['then'](function(_0x4cea98){_0x48a617[_0x9a36('0x40')]=_0x4cea98;return _0x48a617;})[_0x9a36('0x20')](respondWithFilteredResult(_0x1361e4,_0xfffe81))[_0x9a36('0x41')](handleError(_0x1361e4,null));};exports[_0x9a36('0x42')]=function(_0x24b4ef,_0x55f4d7){var _0x56356b={'raw':!![],'where':{'id':_0x24b4ef[_0x9a36('0x43')]['id']}},_0x146b49={};_0x146b49[_0x9a36('0x2e')]=_[_0x9a36('0x2a')](db[_0x9a36('0x29')][_0x9a36('0x44')]);_0x146b49[_0x9a36('0x2b')]=_[_0x9a36('0x2a')](_0x24b4ef[_0x9a36('0x2b')]);_0x146b49[_0x9a36('0x2c')]=_[_0x9a36('0x2d')](_0x146b49['model'],_0x146b49[_0x9a36('0x2b')]);_0x56356b['attributes']=_['intersection'](_0x146b49[_0x9a36('0x2e')],qs[_0x9a36('0x30')](_0x24b4ef[_0x9a36('0x2b')][_0x9a36('0x30')]));_0x56356b[_0x9a36('0x2f')]=_0x56356b[_0x9a36('0x2f')]['length']?_0x56356b[_0x9a36('0x2f')]:_0x146b49[_0x9a36('0x2e')];if(_0x24b4ef['query'][_0x9a36('0x3d')]){_0x56356b[_0x9a36('0x3e')]=[{'all':!![]}];}_0x56356b=_[_0x9a36('0x36')]({},_0x56356b,_0x24b4ef[_0x9a36('0x3c')]);return db['AnalyticDefaultReport'][_0x9a36('0x45')](_0x56356b)[_0x9a36('0x20')](handleEntityNotFound(_0x55f4d7,null))[_0x9a36('0x20')](respondWithResult(_0x55f4d7,null))[_0x9a36('0x41')](handleError(_0x55f4d7,null));};exports[_0x9a36('0x46')]=function(_0x19f10b,_0x4270f3){return db['AnalyticDefaultReport'][_0x9a36('0x46')](_0x19f10b[_0x9a36('0x47')],{})[_0x9a36('0x20')](function(_0x228c09){var _0x5f2206=_0x19f10b['user']['get']({'plain':!![]});if(!_0x5f2206)throw new Error(_0x9a36('0x48'));if(_0x5f2206[_0x9a36('0x49')]===_0x9a36('0x4a')){var _0x4e0c2b=_0x228c09['get']({'plain':!![]});var _0x19877d=_0x9a36('0x4b');return db[_0x9a36('0x4c')][_0x9a36('0x45')]({'where':{'name':_0x19877d,'userProfileId':_0x5f2206[_0x9a36('0x4d')]},'raw':!![]})[_0x9a36('0x20')](function(_0x3879bf){if(_0x3879bf&&_0x3879bf['autoAssociation']===0x0){return db[_0x9a36('0x24')][_0x9a36('0x46')]({'name':_0x4e0c2b[_0x9a36('0x27')],'resourceId':_0x4e0c2b['id'],'type':'DefaultReports','sectionId':_0x3879bf['id']},{})['then'](function(){return _0x228c09;});}else{return _0x228c09;}})[_0x9a36('0x41')](function(_0x335ef4){logger[_0x9a36('0x25')](_0x9a36('0x4e'),_0x335ef4);throw _0x335ef4;});}return _0x228c09;})['then'](respondWithResult(_0x4270f3,0xc9))[_0x9a36('0x41')](handleError(_0x4270f3,null));};exports[_0x9a36('0x1f')]=function(_0x783f10,_0x48d5b6){if(_0x783f10[_0x9a36('0x47')]['id']){delete _0x783f10[_0x9a36('0x47')]['id'];}return db[_0x9a36('0x29')][_0x9a36('0x45')]({'where':{'id':_0x783f10[_0x9a36('0x43')]['id']}})['then'](handleEntityNotFound(_0x48d5b6,null))[_0x9a36('0x20')](saveUpdates(_0x783f10[_0x9a36('0x47')],null))['then'](respondWithResult(_0x48d5b6,null))[_0x9a36('0x41')](handleError(_0x48d5b6,null));};exports[_0x9a36('0x21')]=function(_0x151339,_0x3f014b){return db['AnalyticDefaultReport'][_0x9a36('0x45')]({'where':{'id':_0x151339[_0x9a36('0x43')]['id']}})['then'](handleEntityNotFound(_0x3f014b,null))[_0x9a36('0x20')](removeEntity(_0x3f014b,null))[_0x9a36('0x41')](handleError(_0x3f014b,null));};exports['preview']=function(_0x232435,_0x444ce5){var _0x54dc06=0xa;var _0x17cbd5=[_0x9a36('0x4f'),_0x9a36('0x50'),_0x9a36('0x51'),'cross_join'];var _0xa2d315={'SUM':_0x9a36('0x52'),'COUNT':_0x9a36('0x53'),'COUNT DISTINCT':_0x9a36('0x54'),'MAX':_0x9a36('0x55'),'MIN':_0x9a36('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9a36('0x57'),'GROUP_CONCAT ASC':_0x9a36('0x58'),'GROUP_CONCAT DESC':_0x9a36('0x59')};var _0x32c719={'SEC_TO_TIME':_0x9a36('0x5a'),'DATE':_0x9a36('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x9a36('0x5c'),'UNIX_TIMESTAMP':_0x9a36('0x5d')};var _0x3a32d3=function(_0x4d5fe8){return!_[_0x9a36('0x5e')]([_0x9a36('0x5f'),'IS\x20NOT\x20NULL',_0x9a36('0x60'),'IS\x20NOT\x20EMPTY'],_0x4d5fe8);};var _0x285ab3=function(_0x3b108b){if(!_0x3b108b||!_0x3b108b[_0x9a36('0x61')]['length']){return'';}for(var _0x25efeb='(',_0x12cdac=0x0;_0x12cdac<_0x3b108b['rules'][_0x9a36('0x31')];_0x12cdac+=0x1){_0x12cdac>0x0&&(_0x25efeb+='\x20'+_0x3b108b[_0x9a36('0x62')]+'\x20');_0x25efeb+=_0x3b108b[_0x9a36('0x61')][_0x12cdac][_0x9a36('0x63')]?_0x285ab3(_0x3b108b[_0x9a36('0x61')][_0x12cdac][_0x9a36('0x63')]):_0x3b108b[_0x9a36('0x61')][_0x12cdac][_0x9a36('0x3a')]+'\x20'+_0x3b108b['rules'][_0x12cdac][_0x9a36('0x64')]+(_0x3a32d3(_0x3b108b[_0x9a36('0x61')][_0x12cdac][_0x9a36('0x64')])?'\x20'+_0x3b108b[_0x9a36('0x61')][_0x12cdac][_0x9a36('0x65')]:'');}return _0x25efeb+')';};var _0x369c4c={'where':{'id':_0x232435[_0x9a36('0x43')]['id']}},_0x22cb04,_0x1f8f97,_0x4e3bc1,_0x7073a8,_0x4ecae5;_0x369c4c=_[_0x9a36('0x36')]({},_0x369c4c,_0x232435[_0x9a36('0x3c')]);return db['AnalyticDefaultReport'][_0x9a36('0x45')](_0x369c4c)[_0x9a36('0x20')](function(_0x140511){if(_0x140511){_0x22cb04=_0x140511;return _0x140511[_0x9a36('0x66')]();}return null;})['then'](function(_0x4e851a){if(_0x4e851a){if(!_0x4e851a[_0x9a36('0x31')]){throw new db[(_0x9a36('0x67'))]['ValidationErrorItem'](_0x9a36('0x68'),0x193);}_0x1f8f97=_0x4e851a;return db[_0x9a36('0x69')][_0x9a36('0x3f')]({'raw':!![]});}return null;})[_0x9a36('0x20')](function(_0x1cd813){if(_0x1cd813){_0x4e3bc1=_['keyBy'](_0x1cd813,'id');var _0x369581;var _0x3ff623=squel[_0x9a36('0x6a')]();_0x3ff623['from'](_0x22cb04['table']);for(var _0x23c335=0x0;_0x23c335<_0x1f8f97[_0x9a36('0x31')];_0x23c335+=0x1){_0x369581=_0x1f8f97[_0x23c335][_0x9a36('0x6b')]?_0x4e3bc1[_0x1f8f97[_0x23c335][_0x9a36('0x6b')]]['metric']:_0x1f8f97[_0x23c335]['field'];_0x369581=_0x1f8f97[_0x23c335][_0x9a36('0x6c')]?_[_0x9a36('0x6d')](_0xa2d315[_0x1f8f97[_0x23c335]['function']],'%s',_0x369581):_0x369581;_0x369581=_0x1f8f97[_0x23c335][_0x9a36('0x6e')]?_[_0x9a36('0x6d')](_0x32c719[_0x1f8f97[_0x23c335][_0x9a36('0x6e')]],'%s',_0x369581):_0x369581;if(_0x1f8f97[_0x23c335][_0x9a36('0x6f')]){_0x3ff623[_0x9a36('0x63')](_0x369581);}_0x1f8f97[_0x23c335][_0x9a36('0x70')]&&_0x3ff623[_0x9a36('0x71')](_0x369581,_0x1f8f97[_0x23c335][_0x9a36('0x70')]===_0x9a36('0x72')?![]:!![]);_0x3ff623[_0x9a36('0x3a')](_0x369581,_0x1f8f97[_0x23c335][_0x9a36('0x73')]||_0x369581);}if(_0x22cb04[_0x9a36('0x74')]){_0x22cb04['joins']=JSON['parse'](_0x22cb04[_0x9a36('0x74')]);for(var _0x3a95bb=0x0;_0x3a95bb<_0x22cb04[_0x9a36('0x74')][_0x9a36('0x31')];_0x3a95bb+=0x1){if(_0x22cb04[_0x9a36('0x74')][_0x3a95bb][_0x9a36('0x37')]&&_[_0x9a36('0x5e')](_0x17cbd5,_0x22cb04[_0x9a36('0x74')][_0x3a95bb]['type'])&&_0x22cb04[_0x9a36('0x74')][_0x3a95bb][_0x9a36('0x75')]&&_0x22cb04[_0x9a36('0x74')][_0x3a95bb][_0x9a36('0x76')]&&_0x22cb04['joins'][_0x3a95bb][_0x9a36('0x77')]){_0x3ff623[_0x22cb04[_0x9a36('0x74')][_0x3a95bb][_0x9a36('0x37')]](_0x22cb04['joins'][_0x3a95bb][_0x9a36('0x76')],null,util[_0x9a36('0x6e')](_0x9a36('0x78'),_0x22cb04['table'],_0x22cb04[_0x9a36('0x74')][_0x3a95bb][_0x9a36('0x75')],_0x22cb04[_0x9a36('0x74')][_0x3a95bb][_0x9a36('0x76')],_0x22cb04['joins'][_0x3a95bb][_0x9a36('0x77')]));}}}if(_0x22cb04[_0x9a36('0x79')]){_0x22cb04['conditions']=JSON[_0x9a36('0x7a')](_0x22cb04[_0x9a36('0x79')]);_0x3ff623[_0x9a36('0x34')](_0x285ab3(_0x22cb04['conditions'][_0x9a36('0x63')]));}_0x4ecae5=_0x3ff623[_0x9a36('0x7b')]();_0x3ff623[_0x9a36('0x19')](_0x54dc06);_0x3ff623['offset'](0x0);logger[_0x9a36('0x7c')](_0x9a36('0x7d'),_0x3ff623[_0x9a36('0x7e')]());return db[_0x9a36('0x7f')][_0x9a36('0x2b')](_0x3ff623[_0x9a36('0x7e')](),{'type':db[_0x9a36('0x7f')][_0x9a36('0x80')][_0x9a36('0x81')]});}})[_0x9a36('0x20')](respondWithResult(_0x444ce5,null))[_0x9a36('0x41')](handleError(_0x444ce5,null));};function runReport(_0x392292,_0x34e58c,_0xb27139){var _0xad0daf=_0x34e58c['name'];var _0x26303a=0xa;var _0x4a48cf=[_0x9a36('0x4f'),_0x9a36('0x50'),_0x9a36('0x51'),_0x9a36('0x82')];var _0x5efa57={'SUM':_0x9a36('0x52'),'COUNT':_0x9a36('0x53'),'COUNT DISTINCT':_0x9a36('0x54'),'MAX':_0x9a36('0x55'),'MIN':_0x9a36('0x56'),'AVG':_0x9a36('0x83'),'GROUP_CONCAT':_0x9a36('0x57'),'GROUP_CONCAT ASC':_0x9a36('0x58'),'GROUP_CONCAT DESC':_0x9a36('0x59')};var _0x5cbe13={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9a36('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x9a36('0x5c'),'UNIX_TIMESTAMP':_0x9a36('0x5d')};var _0x52a7b7=function(_0x270497){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x9a36('0x84')],_0x270497);};var _0x752e5d=function(_0x9f2698){if(!_0x9f2698||!_0x9f2698[_0x9a36('0x61')][_0x9a36('0x31')]){return'';}for(var _0x9f03ab='(',_0xaec17b=0x0;_0xaec17b<_0x9f2698[_0x9a36('0x61')][_0x9a36('0x31')];_0xaec17b+=0x1){_0xaec17b>0x0&&(_0x9f03ab+='\x20'+_0x9f2698[_0x9a36('0x62')]+'\x20');_0x9f03ab+=_0x9f2698[_0x9a36('0x61')][_0xaec17b][_0x9a36('0x63')]?_0x752e5d(_0x9f2698[_0x9a36('0x61')][_0xaec17b][_0x9a36('0x63')]):_0x9f2698[_0x9a36('0x61')][_0xaec17b][_0x9a36('0x3a')]+'\x20'+_0x9f2698['rules'][_0xaec17b][_0x9a36('0x64')]+(_0x52a7b7(_0x9f2698[_0x9a36('0x61')][_0xaec17b][_0x9a36('0x64')])?'\x20'+_0x9f2698[_0x9a36('0x61')][_0xaec17b]['value']:'');}return _0x9f03ab+')';};var _0x210970={'where':{'id':_0x392292['id']}},_0x2a3ab5,_0x5604d6,_0x1cbeef,_0x5b7ef0,_0x4850b2;_0x210970=_['merge']({},_0x210970,_0xb27139);return db[_0x9a36('0x29')]['find'](_0x210970)[_0x9a36('0x20')](function(_0x57029a){if(_0x57029a){_0x2a3ab5=_0x57029a;return _0x57029a[_0x9a36('0x66')]();}return null;})[_0x9a36('0x20')](function(_0x5b404a){if(_0x5b404a){if(!_0x5b404a[_0x9a36('0x31')]){throw new db[(_0x9a36('0x67'))][(_0x9a36('0x85'))](_0x9a36('0x68'),0x193);}_0x5604d6=_0x5b404a;return db[_0x9a36('0x69')][_0x9a36('0x3f')]({'raw':!![]});}return null;})[_0x9a36('0x20')](function(_0x5d1572){if(_0x5d1572){_0x1cbeef=_['keyBy'](_0x5d1572,'id');var _0x222f39;var _0x2b94c3=squel[_0x9a36('0x6a')]();_0x2b94c3[_0x9a36('0x86')](_0x2a3ab5[_0x9a36('0x87')]);for(var _0x79ba24=0x0;_0x79ba24<_0x5604d6['length'];_0x79ba24+=0x1){_0x222f39=_0x5604d6[_0x79ba24][_0x9a36('0x6b')]?_0x1cbeef[_0x5604d6[_0x79ba24][_0x9a36('0x6b')]][_0x9a36('0x88')]:_0x5604d6[_0x79ba24]['field'];_0x222f39=_0x5604d6[_0x79ba24]['function']?_[_0x9a36('0x6d')](_0x5efa57[_0x5604d6[_0x79ba24][_0x9a36('0x6c')]],'%s',_0x222f39):_0x222f39;_0x222f39=_0x5604d6[_0x79ba24][_0x9a36('0x6e')]?_[_0x9a36('0x6d')](_0x5cbe13[_0x5604d6[_0x79ba24][_0x9a36('0x6e')]],'%s',_0x222f39):_0x222f39;if(_0x5604d6[_0x79ba24][_0x9a36('0x6f')]){_0x2b94c3[_0x9a36('0x63')](_0x222f39);}_0x5604d6[_0x79ba24][_0x9a36('0x70')]&&_0x2b94c3[_0x9a36('0x71')](_0x222f39,_0x5604d6[_0x79ba24]['orderBy']===_0x9a36('0x72')?![]:!![]);_0x2b94c3['field'](_0x222f39,_0x5604d6[_0x79ba24]['alias']||_0x222f39);}if(_0x2a3ab5[_0x9a36('0x74')]){_0x2a3ab5['joins']=JSON[_0x9a36('0x7a')](_0x2a3ab5['joins']);for(var _0x482122=0x0;_0x482122<_0x2a3ab5[_0x9a36('0x74')][_0x9a36('0x31')];_0x482122+=0x1){if(_0x2a3ab5[_0x9a36('0x74')][_0x482122][_0x9a36('0x37')]&&_['includes'](_0x4a48cf,_0x2a3ab5['joins'][_0x482122][_0x9a36('0x37')])&&_0x2a3ab5[_0x9a36('0x74')][_0x482122][_0x9a36('0x75')]&&_0x2a3ab5[_0x9a36('0x74')][_0x482122]['foreignTable']&&_0x2a3ab5[_0x9a36('0x74')][_0x482122]['foreignKey']){_0x2b94c3[_0x2a3ab5[_0x9a36('0x74')][_0x482122]['type']](_0x2a3ab5['joins'][_0x482122][_0x9a36('0x76')],null,util[_0x9a36('0x6e')](_0x9a36('0x78'),_0x2a3ab5[_0x9a36('0x87')],_0x2a3ab5[_0x9a36('0x74')][_0x482122][_0x9a36('0x75')],_0x2a3ab5[_0x9a36('0x74')][_0x482122][_0x9a36('0x76')],_0x2a3ab5[_0x9a36('0x74')][_0x482122][_0x9a36('0x77')]));}}}if(_0x2a3ab5['conditions']){_0x2a3ab5[_0x9a36('0x79')]=JSON[_0x9a36('0x7a')](_0x2a3ab5[_0x9a36('0x79')]);_0x2b94c3['where'](_0x752e5d(_0x2a3ab5[_0x9a36('0x79')][_0x9a36('0x63')]));}_0x4850b2=_0x2b94c3['clone']();_0x2b94c3['limit'](_0x26303a);_0x2b94c3['offset'](0x0);logger[_0x9a36('0x7c')](_0x9a36('0x7d'),_0x2b94c3[_0x9a36('0x7e')]());return db['sequelize'][_0x9a36('0x2b')](_0x2b94c3['toString'](),{'type':db['sequelize']['QueryTypes'][_0x9a36('0x81')]});}})[_0x9a36('0x20')](function(_0x57720e){if(!_0x57720e[_0x9a36('0x31')]){throw new db[(_0x9a36('0x67'))][(_0x9a36('0x85'))](_0x9a36('0x89'),0xcc);}if(_0x34e58c[_0x9a36('0x8a')]===_0x9a36('0x8b')){return null;}var _0xb3030f=_[_0x9a36('0x36')](_0x34e58c,{'name':_0x34e58c['fullPath']||_0x34e58c['name']||_0x2a3ab5[_0x9a36('0x27')],'basename':_0xad0daf,'savename':util[_0x9a36('0x6e')](_0x9a36('0x8c'),_0x34e58c[_0x9a36('0x27')]||_0x2a3ab5[_0x9a36('0x27')],require('randomstring')['generate'](0x4),_0x34e58c['output']||_0x9a36('0x8d')),'reportId':_0x2a3ab5['id'],'reportType':_0x9a36('0x8e')});return db[_0x9a36('0x8f')][_0x9a36('0x46')](_0xb3030f,{'raw':!![]});})[_0x9a36('0x20')](function(_0x37e90d){if(_0x2a3ab5[_0x9a36('0x87')]===_0x9a36('0x90')){_0x4850b2[_0x9a36('0x34')](_0x2a3ab5[_0x9a36('0x87')]+_0x9a36('0x91'),_0x34e58c['startDate'],_0x34e58c[_0x9a36('0x92')]);}else{_0x4850b2[_0x9a36('0x34')](_0x2a3ab5['table']+_0x9a36('0x93'),_0x34e58c[_0x9a36('0x94')],_0x34e58c['endDate']);}if(_0x37e90d){logger[_0x9a36('0x95')](_0x9a36('0x96'),_0x4850b2[_0x9a36('0x7e')]());require(_0x9a36('0x97'))['fork'](path[_0x9a36('0x4f')](__dirname,_0x9a36('0x98'),_0x37e90d[_0x9a36('0x8a')]),[_0x37e90d['id'],_0x4850b2[_0x9a36('0x7e')](),path['join'](__dirname,_0x9a36('0x99'),_0x37e90d[_0x9a36('0x9a')]),_0xad0daf]);return _0x37e90d;}else{var _0x686d08=squel['select']();_0x686d08[_0x9a36('0x86')]('('+_0x4850b2[_0x9a36('0x7e')]()+')','countTable');_0x686d08['field'](_0x9a36('0x9b'),_0x9a36('0x9c'));_0x4850b2[_0x9a36('0x19')](_0x34e58c['limit']||_0x26303a);_0x4850b2['offset'](_0x34e58c[_0x9a36('0x18')]||0x0);return db[_0x9a36('0x7f')][_0x9a36('0x2b')](_0x686d08[_0x9a36('0x7e')](),{'type':db[_0x9a36('0x7f')][_0x9a36('0x80')][_0x9a36('0x81')]})[_0x9a36('0x20')](function(_0x1beb33){if(!_0x1beb33[_0x9a36('0x31')]){_0x5b7ef0=0x0;}else{_0x5b7ef0=_0x1beb33[0x0]['count']||0x0;}return db[_0x9a36('0x7f')][_0x9a36('0x2b')](_0x4850b2[_0x9a36('0x7e')](),{'type':db[_0x9a36('0x7f')]['QueryTypes'][_0x9a36('0x81')]});})['then'](function(_0x396d83){return{'rows':_0x396d83||[],'count':_0x5b7ef0};});}});}exports[_0x9a36('0x9d')]=function(_0x54b99f,_0x132295){return runReport(_0x54b99f[_0x9a36('0x43')],_0x54b99f[_0x9a36('0x2b')],_0x54b99f[_0x9a36('0x3c')])[_0x9a36('0x20')](respondWithResult(_0x132295,null))[_0x9a36('0x41')](handleError(_0x132295,null));};exports[_0x9a36('0x9e')]=runReport;exports[_0x9a36('0x2b')]=function(_0x988528,_0xa7271e){var _0x4854af=0xa;var _0x324dae=[_0x9a36('0x4f'),_0x9a36('0x50'),_0x9a36('0x51'),_0x9a36('0x82')];var _0x78f16b={'SUM':'SUM(%s)','COUNT':_0x9a36('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9a36('0x55'),'MIN':_0x9a36('0x56'),'AVG':_0x9a36('0x83'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x9a36('0x58'),'GROUP_CONCAT DESC':_0x9a36('0x59')};var _0x2fa62e={'SEC_TO_TIME':_0x9a36('0x5a'),'DATE':_0x9a36('0x5b'),'HOUR':_0x9a36('0x9f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9a36('0x5d')};var _0x233fef=function(_0x49ce65){return!_[_0x9a36('0x5e')]([_0x9a36('0x5f'),_0x9a36('0xa0'),_0x9a36('0x60'),_0x9a36('0x84')],_0x49ce65);};var _0x4e26e3=function(_0x2019b9){if(!_0x2019b9||!_0x2019b9[_0x9a36('0x61')][_0x9a36('0x31')]){return'';}for(var _0x1e3a92='(',_0x55af2f=0x0;_0x55af2f<_0x2019b9[_0x9a36('0x61')][_0x9a36('0x31')];_0x55af2f+=0x1){_0x55af2f>0x0&&(_0x1e3a92+='\x20'+_0x2019b9[_0x9a36('0x62')]+'\x20');_0x1e3a92+=_0x2019b9[_0x9a36('0x61')][_0x55af2f][_0x9a36('0x63')]?_0x4e26e3(_0x2019b9[_0x9a36('0x61')][_0x55af2f]['group']):_0x2019b9['rules'][_0x55af2f][_0x9a36('0x3a')]+'\x20'+_0x2019b9[_0x9a36('0x61')][_0x55af2f]['condition']+(_0x233fef(_0x2019b9['rules'][_0x55af2f]['condition'])?'\x20'+_0x2019b9['rules'][_0x55af2f]['value']:'');}return _0x1e3a92+')';};var _0x3d4a7f={'where':{'id':_0x988528['params']['id']}},_0x22de99,_0x40bf62,_0x4f8d99,_0x596658,_0x50a6d0;_0x3d4a7f=_[_0x9a36('0x36')]({},_0x3d4a7f,_0x988528['options']);return db['AnalyticDefaultReport'][_0x9a36('0x45')](_0x3d4a7f)[_0x9a36('0x20')](function(_0x211d74){if(_0x211d74){_0x22de99=_0x211d74;return _0x211d74[_0x9a36('0x66')]();}return null;})['then'](function(_0x2527eb){if(_0x2527eb){if(!_0x2527eb['length']){throw new db[(_0x9a36('0x67'))]['ValidationErrorItem'](_0x9a36('0x68'),0x193);}_0x40bf62=_0x2527eb;return db[_0x9a36('0x69')][_0x9a36('0x3f')]({'raw':!![]});}return null;})[_0x9a36('0x20')](function(_0x534415){if(_0x534415){_0x4f8d99=_['keyBy'](_0x534415,'id');var _0x1f1f08;var _0x1f1aa2=squel['select']();_0x1f1aa2[_0x9a36('0x86')](_0x22de99['table']);for(var _0x35bcdd=0x0;_0x35bcdd<_0x40bf62[_0x9a36('0x31')];_0x35bcdd+=0x1){_0x1f1f08=_0x40bf62[_0x35bcdd][_0x9a36('0x6b')]?_0x4f8d99[_0x40bf62[_0x35bcdd]['MetricId']][_0x9a36('0x88')]:_0x40bf62[_0x35bcdd]['field'];_0x1f1f08=_0x40bf62[_0x35bcdd][_0x9a36('0x6c')]?_[_0x9a36('0x6d')](_0x78f16b[_0x40bf62[_0x35bcdd][_0x9a36('0x6c')]],'%s',_0x1f1f08):_0x1f1f08;_0x1f1f08=_0x40bf62[_0x35bcdd][_0x9a36('0x6e')]?_['replace'](_0x2fa62e[_0x40bf62[_0x35bcdd][_0x9a36('0x6e')]],'%s',_0x1f1f08):_0x1f1f08;if(_0x40bf62[_0x35bcdd][_0x9a36('0x6f')]){_0x1f1aa2[_0x9a36('0x63')](_0x1f1f08);}_0x40bf62[_0x35bcdd][_0x9a36('0x70')]&&_0x1f1aa2[_0x9a36('0x71')](_0x1f1f08,_0x40bf62[_0x35bcdd][_0x9a36('0x70')]===_0x9a36('0x72')?![]:!![]);_0x1f1aa2[_0x9a36('0x3a')](_0x1f1f08,_0x40bf62[_0x35bcdd][_0x9a36('0x73')]||_0x1f1f08);}if(_0x22de99[_0x9a36('0x74')]){_0x22de99[_0x9a36('0x74')]=JSON['parse'](_0x22de99[_0x9a36('0x74')]);for(var _0x509aed=0x0;_0x509aed<_0x22de99[_0x9a36('0x74')][_0x9a36('0x31')];_0x509aed+=0x1){if(_0x22de99['joins'][_0x509aed]['type']&&_[_0x9a36('0x5e')](_0x324dae,_0x22de99[_0x9a36('0x74')][_0x509aed]['type'])&&_0x22de99[_0x9a36('0x74')][_0x509aed][_0x9a36('0x75')]&&_0x22de99[_0x9a36('0x74')][_0x509aed][_0x9a36('0x76')]&&_0x22de99['joins'][_0x509aed][_0x9a36('0x77')]){_0x1f1aa2[_0x22de99['joins'][_0x509aed]['type']](_0x22de99[_0x9a36('0x74')][_0x509aed][_0x9a36('0x76')],null,util[_0x9a36('0x6e')](_0x9a36('0x78'),_0x22de99[_0x9a36('0x87')],_0x22de99[_0x9a36('0x74')][_0x509aed][_0x9a36('0x75')],_0x22de99[_0x9a36('0x74')][_0x509aed][_0x9a36('0x76')],_0x22de99[_0x9a36('0x74')][_0x509aed][_0x9a36('0x77')]));}}}if(_0x22de99[_0x9a36('0x79')]){_0x22de99[_0x9a36('0x79')]=JSON[_0x9a36('0x7a')](_0x22de99[_0x9a36('0x79')]);_0x1f1aa2[_0x9a36('0x34')](_0x4e26e3(_0x22de99[_0x9a36('0x79')][_0x9a36('0x63')]));}_0x50a6d0=_0x1f1aa2[_0x9a36('0x7b')]();_0x1f1aa2[_0x9a36('0x19')](_0x4854af);_0x1f1aa2[_0x9a36('0x18')](0x0);logger[_0x9a36('0x7c')](_0x9a36('0x7d'),_0x1f1aa2[_0x9a36('0x7e')]());return db[_0x9a36('0x7f')]['query'](_0x1f1aa2['toString'](),{'type':db[_0x9a36('0x7f')][_0x9a36('0x80')]['SELECT']});}})[_0x9a36('0x20')](function(){return{'sql':_0x50a6d0['toString']()};})[_0x9a36('0x20')](respondWithResult(_0xa7271e,null))[_0x9a36('0x41')](handleError(_0xa7271e,null));}; \ No newline at end of file +var _0x8639=['rules','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','debug','sequelize','toString','QueryTypes','SELECT','AVG(%s)','IS\x20NULL','IS\x20EMPTY','clone','Limited\x20Query:','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','operator','keyBy','%s.%s\x20=\x20%s.%s','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','merge','where','map','type','key','VIRTUAL','field','filter','options','AnalyticDefaultReport','includeAll','findAll','rows','catch','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','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)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY'];(function(_0x2f3b0d,_0x59ad72){var _0x16da8e=function(_0x521062){while(--_0x521062){_0x2f3b0d['push'](_0x2f3b0d['shift']());}};_0x16da8e(++_0x59ad72);}(_0x8639,0x18b));var _0x9863=function(_0x50ddef,_0x18fb38){_0x50ddef=_0x50ddef-0x0;var _0x8c2f67=_0x8639[_0x50ddef];return _0x8c2f67;};'use strict';var pdf=require(_0x9863('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9863('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9863('0x2'));var rp=require(_0x9863('0x3'));var moment=require(_0x9863('0x4'));var BPromise=require(_0x9863('0x5'));var Mustache=require('mustache');var util=require(_0x9863('0x6'));var path=require(_0x9863('0x7'));var sox=require('sox');var csv=require(_0x9863('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9863('0x9'));var squel=require(_0x9863('0xa'));var crypto=require(_0x9863('0xb'));var jsforce=require(_0x9863('0xc'));var deskjs=require(_0x9863('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9863('0xe'));var Redis=require(_0x9863('0xf'));var authService=require(_0x9863('0x10'));var qs=require(_0x9863('0x11'));var hardwareService=require(_0x9863('0x12'));var logger=require(_0x9863('0x13'))(_0x9863('0x14'));var utils=require('../../config/utils');var config=require(_0x9863('0x15'));var db=require(_0x9863('0x16'))['db'];function respondWithStatusCode(_0x537f7c,_0x427ad9){_0x427ad9=_0x427ad9||0xcc;return function(_0x58b562){if(_0x58b562){return _0x537f7c[_0x9863('0x17')](_0x427ad9);}return _0x537f7c[_0x9863('0x18')](_0x427ad9)[_0x9863('0x19')]();};}function respondWithResult(_0x50c530,_0x40db97){_0x40db97=_0x40db97||0xc8;return function(_0xf8d249){if(_0xf8d249){return _0x50c530[_0x9863('0x18')](_0x40db97)[_0x9863('0x1a')](_0xf8d249);}};}function respondWithFilteredResult(_0x4474e3,_0x29defe){return function(_0x43c076){if(_0x43c076){var _0x1d0dda=_0x43c076[_0x9863('0x1b')],_0x3fd079=_0x29defe[_0x9863('0x1c')],_0x2fdad0=_0x29defe['offset']+_0x29defe[_0x9863('0x1d')],_0x1bebff;if(_0x2fdad0>=_0x1d0dda){_0x2fdad0=_0x1d0dda;_0x1bebff=0xc8;}else{_0x1bebff=0xce;}_0x4474e3['status'](_0x1bebff);return _0x4474e3['set'](_0x9863('0x1e'),_0x3fd079+'-'+_0x2fdad0+'/'+_0x1d0dda)[_0x9863('0x1a')](_0x43c076);}return null;};}function patchUpdates(_0x49b96d){return function(_0x11d65a){try{jsonpatch[_0x9863('0x1f')](_0x11d65a,_0x49b96d,!![]);}catch(_0x4ee17f){return BPromise['reject'](_0x4ee17f);}return _0x11d65a['save']();};}function saveUpdates(_0x546ce9,_0x4a46f2){return function(_0x421b83){if(_0x421b83){return _0x421b83[_0x9863('0x20')](_0x546ce9)['then'](function(_0x1fb154){return _0x1fb154;});}return null;};}function removeEntity(_0x521896,_0x479aee){return function(_0x46d66a){if(_0x46d66a){return _0x46d66a['destroy']()[_0x9863('0x21')](function(){var _0x435f10=_0x46d66a[_0x9863('0x22')]({'plain':!![]});var _0x4a6296=_0x9863('0x23');return db[_0x9863('0x24')][_0x9863('0x25')]({'where':{'type':_0x4a6296,'resourceId':_0x435f10['id']}})['then'](function(){return _0x46d66a;});})['then'](function(){_0x521896[_0x9863('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44d549,_0x33d16e){return function(_0x20904f){if(!_0x20904f){_0x44d549[_0x9863('0x17')](0x194);}return _0x20904f;};}function handleError(_0x33bf3f,_0x2c2864){_0x2c2864=_0x2c2864||0x1f4;return function(_0x52fbe4){logger[_0x9863('0x26')](_0x52fbe4[_0x9863('0x27')]);if(_0x52fbe4['name']){delete _0x52fbe4[_0x9863('0x28')];}_0x33bf3f['status'](_0x2c2864)['send'](_0x52fbe4);};}exports[_0x9863('0x29')]=function(_0x504e81,_0xcd4cf5){var _0x2637e9={},_0x46f8bb={},_0x42c81e={'count':0x0,'rows':[]};var _0x56a805=db['AnalyticDefaultReport'][_0x9863('0x2a')];_0x46f8bb[_0x9863('0x2b')]=_[_0x9863('0x2c')](_0x56a805);_0x46f8bb[_0x9863('0x2d')]=_[_0x9863('0x2c')](_0x504e81[_0x9863('0x2d')]);_0x46f8bb[_0x9863('0x2e')]=_[_0x9863('0x2f')](_0x46f8bb['model'],_0x46f8bb[_0x9863('0x2d')]);_0x2637e9['attributes']=_[_0x9863('0x2f')](_0x46f8bb['model'],qs[_0x9863('0x30')](_0x504e81[_0x9863('0x2d')][_0x9863('0x30')]));_0x2637e9['attributes']=_0x2637e9[_0x9863('0x31')][_0x9863('0x32')]?_0x2637e9['attributes']:_0x46f8bb['model'];if(!_0x504e81['query'][_0x9863('0x33')](_0x9863('0x34'))){_0x2637e9[_0x9863('0x1d')]=qs[_0x9863('0x1d')](_0x504e81[_0x9863('0x2d')]['limit']);_0x2637e9[_0x9863('0x1c')]=qs['offset'](_0x504e81[_0x9863('0x2d')]['offset']);}_0x2637e9[_0x9863('0x35')]=qs[_0x9863('0x36')](_0x504e81[_0x9863('0x2d')][_0x9863('0x36')]);_0x2637e9['where']=qs['filters'](_['pick'](_0x504e81[_0x9863('0x2d')],_0x46f8bb[_0x9863('0x2e')]));if(_0x504e81[_0x9863('0x2d')]['filter']){_0x2637e9['where']=_[_0x9863('0x37')](_0x2637e9[_0x9863('0x38')],{'$or':_[_0x9863('0x39')](_0x56a805,function(_0x22c84c){if(_0x22c84c[_0x9863('0x3a')][_0x9863('0x3b')]!==_0x9863('0x3c')){var _0x344482={};_0x344482[_0x22c84c[_0x9863('0x3d')]]={'$like':'%'+_0x504e81[_0x9863('0x2d')][_0x9863('0x3e')]+'%'};return _0x344482;}})});}_0x2637e9=_[_0x9863('0x37')]({},_0x2637e9,_0x504e81[_0x9863('0x3f')]);var _0x377f1d={'where':_0x2637e9[_0x9863('0x38')]};return db[_0x9863('0x40')][_0x9863('0x1b')](_0x377f1d)[_0x9863('0x21')](function(_0x3aa071){_0x42c81e['count']=_0x3aa071;if(_0x504e81['query'][_0x9863('0x41')]){_0x2637e9['include']=[{'all':!![]}];}return db[_0x9863('0x40')][_0x9863('0x42')](_0x2637e9);})[_0x9863('0x21')](function(_0x8d44b){_0x42c81e[_0x9863('0x43')]=_0x8d44b;return _0x42c81e;})[_0x9863('0x21')](respondWithFilteredResult(_0xcd4cf5,_0x2637e9))[_0x9863('0x44')](handleError(_0xcd4cf5,null));};exports[_0x9863('0x45')]=function(_0x32eca6,_0x37b0b8){var _0x2bf940={'raw':!![],'where':{'id':_0x32eca6[_0x9863('0x46')]['id']}},_0x35a6e2={};_0x35a6e2[_0x9863('0x2b')]=_[_0x9863('0x2c')](db[_0x9863('0x40')][_0x9863('0x2a')]);_0x35a6e2[_0x9863('0x2d')]=_['keys'](_0x32eca6[_0x9863('0x2d')]);_0x35a6e2['filters']=_['intersection'](_0x35a6e2['model'],_0x35a6e2[_0x9863('0x2d')]);_0x2bf940['attributes']=_[_0x9863('0x2f')](_0x35a6e2[_0x9863('0x2b')],qs[_0x9863('0x30')](_0x32eca6[_0x9863('0x2d')][_0x9863('0x30')]));_0x2bf940[_0x9863('0x31')]=_0x2bf940['attributes'][_0x9863('0x32')]?_0x2bf940['attributes']:_0x35a6e2[_0x9863('0x2b')];if(_0x32eca6[_0x9863('0x2d')][_0x9863('0x41')]){_0x2bf940[_0x9863('0x47')]=[{'all':!![]}];}_0x2bf940=_[_0x9863('0x37')]({},_0x2bf940,_0x32eca6[_0x9863('0x3f')]);return db['AnalyticDefaultReport'][_0x9863('0x48')](_0x2bf940)['then'](handleEntityNotFound(_0x37b0b8,null))[_0x9863('0x21')](respondWithResult(_0x37b0b8,null))[_0x9863('0x44')](handleError(_0x37b0b8,null));};exports[_0x9863('0x49')]=function(_0x528c43,_0x156898){return db[_0x9863('0x40')][_0x9863('0x49')](_0x528c43['body'],{})[_0x9863('0x21')](function(_0x425fa4){var _0x47f2fe=_0x528c43[_0x9863('0x4a')]['get']({'plain':!![]});if(!_0x47f2fe)throw new Error(_0x9863('0x4b'));if(_0x47f2fe[_0x9863('0x4c')]===_0x9863('0x4a')){var _0x39de45=_0x425fa4[_0x9863('0x22')]({'plain':!![]});var _0xb42f1f=_0x9863('0x4d');return db[_0x9863('0x4e')]['find']({'where':{'name':_0xb42f1f,'userProfileId':_0x47f2fe[_0x9863('0x4f')]},'raw':!![]})[_0x9863('0x21')](function(_0x2ff9f4){if(_0x2ff9f4&&_0x2ff9f4[_0x9863('0x50')]===0x0){return db[_0x9863('0x24')][_0x9863('0x49')]({'name':_0x39de45[_0x9863('0x28')],'resourceId':_0x39de45['id'],'type':'DefaultReports','sectionId':_0x2ff9f4['id']},{})[_0x9863('0x21')](function(){return _0x425fa4;});}else{return _0x425fa4;}})[_0x9863('0x44')](function(_0x281457){logger[_0x9863('0x26')](_0x9863('0x51'),_0x281457);throw _0x281457;});}return _0x425fa4;})[_0x9863('0x21')](respondWithResult(_0x156898,0xc9))['catch'](handleError(_0x156898,null));};exports[_0x9863('0x20')]=function(_0x40e45f,_0x54cfe9){if(_0x40e45f[_0x9863('0x52')]['id']){delete _0x40e45f['body']['id'];}return db[_0x9863('0x40')][_0x9863('0x48')]({'where':{'id':_0x40e45f['params']['id']}})['then'](handleEntityNotFound(_0x54cfe9,null))['then'](saveUpdates(_0x40e45f[_0x9863('0x52')],null))[_0x9863('0x21')](respondWithResult(_0x54cfe9,null))['catch'](handleError(_0x54cfe9,null));};exports[_0x9863('0x25')]=function(_0x23a4cd,_0x305095){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x23a4cd[_0x9863('0x46')]['id']}})[_0x9863('0x21')](handleEntityNotFound(_0x305095,null))['then'](removeEntity(_0x305095,null))['catch'](handleError(_0x305095,null));};exports[_0x9863('0x53')]=function(_0x2d5d97,_0x3ccece){var _0x3db8c0=0xa;var _0x1e767a=[_0x9863('0x54'),_0x9863('0x55'),_0x9863('0x56'),_0x9863('0x57')];var _0x14624e={'SUM':_0x9863('0x58'),'COUNT':_0x9863('0x59'),'COUNT DISTINCT':_0x9863('0x5a'),'MAX':_0x9863('0x5b'),'MIN':_0x9863('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9863('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9863('0x5e')};var _0x27f767={'SEC_TO_TIME':_0x9863('0x5f'),'DATE':_0x9863('0x60'),'HOUR':_0x9863('0x61'),'ROUND':_0x9863('0x62'),'UNIX_TIMESTAMP':_0x9863('0x63')};var _0xa0f3e4=function(_0x5bf1c1){return!_[_0x9863('0x64')](['IS\x20NULL',_0x9863('0x65'),'IS\x20EMPTY',_0x9863('0x66')],_0x5bf1c1);};var _0x5f3fd5=function(_0x5c8da7){if(!_0x5c8da7||!_0x5c8da7[_0x9863('0x67')][_0x9863('0x32')]){return'';}for(var _0x2a305e='(',_0x9018e=0x0;_0x9018e<_0x5c8da7[_0x9863('0x67')]['length'];_0x9018e+=0x1){_0x9018e>0x0&&(_0x2a305e+='\x20'+_0x5c8da7['operator']+'\x20');_0x2a305e+=_0x5c8da7[_0x9863('0x67')][_0x9018e][_0x9863('0x68')]?_0x5f3fd5(_0x5c8da7[_0x9863('0x67')][_0x9018e]['group']):_0x5c8da7[_0x9863('0x67')][_0x9018e][_0x9863('0x3d')]+'\x20'+_0x5c8da7[_0x9863('0x67')][_0x9018e][_0x9863('0x69')]+(_0xa0f3e4(_0x5c8da7[_0x9863('0x67')][_0x9018e][_0x9863('0x69')])?'\x20'+_0x5c8da7[_0x9863('0x67')][_0x9018e][_0x9863('0x6a')]:'');}return _0x2a305e+')';};var _0x5855d8={'where':{'id':_0x2d5d97[_0x9863('0x46')]['id']}},_0x3ed9df,_0x4dc8d5,_0x1413a8,_0x2ecf3d,_0x4b8c0a;_0x5855d8=_[_0x9863('0x37')]({},_0x5855d8,_0x2d5d97[_0x9863('0x3f')]);return db[_0x9863('0x40')][_0x9863('0x48')](_0x5855d8)[_0x9863('0x21')](function(_0x4d20af){if(_0x4d20af){_0x3ed9df=_0x4d20af;return _0x4d20af[_0x9863('0x6b')]();}return null;})[_0x9863('0x21')](function(_0x35fbc9){if(_0x35fbc9){if(!_0x35fbc9[_0x9863('0x32')]){throw new db[(_0x9863('0x6c'))][(_0x9863('0x6d'))](_0x9863('0x6e'),0x193);}_0x4dc8d5=_0x35fbc9;return db[_0x9863('0x6f')]['findAll']({'raw':!![]});}return null;})[_0x9863('0x21')](function(_0x50f62e){if(_0x50f62e){_0x1413a8=_['keyBy'](_0x50f62e,'id');var _0x56b6ab;var _0x3e48e7=squel[_0x9863('0x70')]();_0x3e48e7[_0x9863('0x71')](_0x3ed9df[_0x9863('0x72')]);for(var _0x267e19=0x0;_0x267e19<_0x4dc8d5['length'];_0x267e19+=0x1){_0x56b6ab=_0x4dc8d5[_0x267e19][_0x9863('0x73')]?_0x1413a8[_0x4dc8d5[_0x267e19][_0x9863('0x73')]][_0x9863('0x74')]:_0x4dc8d5[_0x267e19][_0x9863('0x3d')];_0x56b6ab=_0x4dc8d5[_0x267e19][_0x9863('0x75')]?_[_0x9863('0x76')](_0x14624e[_0x4dc8d5[_0x267e19][_0x9863('0x75')]],'%s',_0x56b6ab):_0x56b6ab;_0x56b6ab=_0x4dc8d5[_0x267e19][_0x9863('0x77')]?_[_0x9863('0x76')](_0x27f767[_0x4dc8d5[_0x267e19][_0x9863('0x77')]],'%s',_0x56b6ab):_0x56b6ab;if(_0x4dc8d5[_0x267e19][_0x9863('0x78')]){_0x3e48e7['group'](_0x56b6ab);}_0x4dc8d5[_0x267e19][_0x9863('0x79')]&&_0x3e48e7[_0x9863('0x35')](_0x56b6ab,_0x4dc8d5[_0x267e19][_0x9863('0x79')]===_0x9863('0x7a')?![]:!![]);_0x3e48e7['field'](_0x56b6ab,_0x4dc8d5[_0x267e19][_0x9863('0x7b')]||_0x56b6ab);}if(_0x3ed9df[_0x9863('0x7c')]){_0x3ed9df[_0x9863('0x7c')]=JSON[_0x9863('0x7d')](_0x3ed9df[_0x9863('0x7c')]);for(var _0x266748=0x0;_0x266748<_0x3ed9df[_0x9863('0x7c')][_0x9863('0x32')];_0x266748+=0x1){if(_0x3ed9df[_0x9863('0x7c')][_0x266748][_0x9863('0x3a')]&&_[_0x9863('0x64')](_0x1e767a,_0x3ed9df[_0x9863('0x7c')][_0x266748][_0x9863('0x3a')])&&_0x3ed9df[_0x9863('0x7c')][_0x266748][_0x9863('0x7e')]&&_0x3ed9df[_0x9863('0x7c')][_0x266748][_0x9863('0x7f')]&&_0x3ed9df[_0x9863('0x7c')][_0x266748]['foreignKey']){_0x3e48e7[_0x3ed9df[_0x9863('0x7c')][_0x266748][_0x9863('0x3a')]](_0x3ed9df[_0x9863('0x7c')][_0x266748]['foreignTable'],null,util[_0x9863('0x77')]('%s.%s\x20=\x20%s.%s',_0x3ed9df[_0x9863('0x72')],_0x3ed9df[_0x9863('0x7c')][_0x266748][_0x9863('0x7e')],_0x3ed9df['joins'][_0x266748][_0x9863('0x7f')],_0x3ed9df[_0x9863('0x7c')][_0x266748][_0x9863('0x80')]));}}}if(_0x3ed9df['conditions']){_0x3ed9df[_0x9863('0x81')]=JSON[_0x9863('0x7d')](_0x3ed9df[_0x9863('0x81')]);_0x3e48e7['where'](_0x5f3fd5(_0x3ed9df[_0x9863('0x81')]['group']));}_0x4b8c0a=_0x3e48e7['clone']();_0x3e48e7[_0x9863('0x1d')](_0x3db8c0);_0x3e48e7[_0x9863('0x1c')](0x0);logger[_0x9863('0x82')]('Limited\x20Query:',_0x3e48e7['toString']());return db[_0x9863('0x83')]['query'](_0x3e48e7[_0x9863('0x84')](),{'type':db[_0x9863('0x83')][_0x9863('0x85')][_0x9863('0x86')]});}})['then'](respondWithResult(_0x3ccece,null))['catch'](handleError(_0x3ccece,null));};function runReport(_0x4df1a9,_0x2e3b79,_0x120b6f){var _0x1d0f12=_0x2e3b79[_0x9863('0x28')];var _0x5a8f33=0xa;var _0x3d3921=[_0x9863('0x54'),'left_join',_0x9863('0x56'),_0x9863('0x57')];var _0xdd039={'SUM':_0x9863('0x58'),'COUNT':_0x9863('0x59'),'COUNT DISTINCT':_0x9863('0x5a'),'MAX':'MAX(%s)','MIN':_0x9863('0x5c'),'AVG':_0x9863('0x87'),'GROUP_CONCAT':_0x9863('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9863('0x5e')};var _0x178079={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9863('0x60'),'HOUR':_0x9863('0x61'),'ROUND':_0x9863('0x62'),'UNIX_TIMESTAMP':_0x9863('0x63')};var _0x1fe87a=function(_0x420a8e){return!_[_0x9863('0x64')]([_0x9863('0x88'),_0x9863('0x65'),_0x9863('0x89'),_0x9863('0x66')],_0x420a8e);};var _0x321437=function(_0x52b64a){if(!_0x52b64a||!_0x52b64a[_0x9863('0x67')][_0x9863('0x32')]){return'';}for(var _0x1d7c44='(',_0x38dede=0x0;_0x38dede<_0x52b64a[_0x9863('0x67')][_0x9863('0x32')];_0x38dede+=0x1){_0x38dede>0x0&&(_0x1d7c44+='\x20'+_0x52b64a['operator']+'\x20');_0x1d7c44+=_0x52b64a[_0x9863('0x67')][_0x38dede][_0x9863('0x68')]?_0x321437(_0x52b64a['rules'][_0x38dede][_0x9863('0x68')]):_0x52b64a[_0x9863('0x67')][_0x38dede][_0x9863('0x3d')]+'\x20'+_0x52b64a['rules'][_0x38dede][_0x9863('0x69')]+(_0x1fe87a(_0x52b64a[_0x9863('0x67')][_0x38dede][_0x9863('0x69')])?'\x20'+_0x52b64a[_0x9863('0x67')][_0x38dede][_0x9863('0x6a')]:'');}return _0x1d7c44+')';};var _0x4d9149={'where':{'id':_0x4df1a9['id']}},_0x37bce4,_0x194658,_0x55133a,_0x539e2f,_0x39bdbb;_0x4d9149=_['merge']({},_0x4d9149,_0x120b6f);return db[_0x9863('0x40')][_0x9863('0x48')](_0x4d9149)[_0x9863('0x21')](function(_0x54d9b0){if(_0x54d9b0){_0x37bce4=_0x54d9b0;return _0x54d9b0[_0x9863('0x6b')]();}return null;})[_0x9863('0x21')](function(_0x2775b4){if(_0x2775b4){if(!_0x2775b4['length']){throw new db['Sequelize'][(_0x9863('0x6d'))](_0x9863('0x6e'),0x193);}_0x194658=_0x2775b4;return db[_0x9863('0x6f')]['findAll']({'raw':!![]});}return null;})[_0x9863('0x21')](function(_0xcfc550){if(_0xcfc550){_0x55133a=_['keyBy'](_0xcfc550,'id');var _0x390ddb;var _0x227721=squel[_0x9863('0x70')]();_0x227721['from'](_0x37bce4[_0x9863('0x72')]);for(var _0x25ec99=0x0;_0x25ec99<_0x194658['length'];_0x25ec99+=0x1){_0x390ddb=_0x194658[_0x25ec99][_0x9863('0x73')]?_0x55133a[_0x194658[_0x25ec99][_0x9863('0x73')]]['metric']:_0x194658[_0x25ec99]['field'];_0x390ddb=_0x194658[_0x25ec99][_0x9863('0x75')]?_[_0x9863('0x76')](_0xdd039[_0x194658[_0x25ec99][_0x9863('0x75')]],'%s',_0x390ddb):_0x390ddb;_0x390ddb=_0x194658[_0x25ec99][_0x9863('0x77')]?_['replace'](_0x178079[_0x194658[_0x25ec99][_0x9863('0x77')]],'%s',_0x390ddb):_0x390ddb;if(_0x194658[_0x25ec99][_0x9863('0x78')]){_0x227721[_0x9863('0x68')](_0x390ddb);}_0x194658[_0x25ec99]['orderBy']&&_0x227721[_0x9863('0x35')](_0x390ddb,_0x194658[_0x25ec99][_0x9863('0x79')]===_0x9863('0x7a')?![]:!![]);_0x227721[_0x9863('0x3d')](_0x390ddb,_0x194658[_0x25ec99][_0x9863('0x7b')]||_0x390ddb);}if(_0x37bce4['joins']){_0x37bce4[_0x9863('0x7c')]=JSON[_0x9863('0x7d')](_0x37bce4['joins']);for(var _0x2a1a03=0x0;_0x2a1a03<_0x37bce4[_0x9863('0x7c')][_0x9863('0x32')];_0x2a1a03+=0x1){if(_0x37bce4[_0x9863('0x7c')][_0x2a1a03][_0x9863('0x3a')]&&_['includes'](_0x3d3921,_0x37bce4[_0x9863('0x7c')][_0x2a1a03][_0x9863('0x3a')])&&_0x37bce4[_0x9863('0x7c')][_0x2a1a03][_0x9863('0x7e')]&&_0x37bce4[_0x9863('0x7c')][_0x2a1a03][_0x9863('0x7f')]&&_0x37bce4['joins'][_0x2a1a03][_0x9863('0x80')]){_0x227721[_0x37bce4[_0x9863('0x7c')][_0x2a1a03][_0x9863('0x3a')]](_0x37bce4[_0x9863('0x7c')][_0x2a1a03][_0x9863('0x7f')],null,util[_0x9863('0x77')]('%s.%s\x20=\x20%s.%s',_0x37bce4['table'],_0x37bce4[_0x9863('0x7c')][_0x2a1a03]['parentKey'],_0x37bce4['joins'][_0x2a1a03][_0x9863('0x7f')],_0x37bce4[_0x9863('0x7c')][_0x2a1a03][_0x9863('0x80')]));}}}if(_0x37bce4[_0x9863('0x81')]){_0x37bce4['conditions']=JSON[_0x9863('0x7d')](_0x37bce4[_0x9863('0x81')]);_0x227721[_0x9863('0x38')](_0x321437(_0x37bce4[_0x9863('0x81')][_0x9863('0x68')]));}_0x39bdbb=_0x227721[_0x9863('0x8a')]();_0x227721[_0x9863('0x1d')](_0x5a8f33);_0x227721[_0x9863('0x1c')](0x0);logger[_0x9863('0x82')](_0x9863('0x8b'),_0x227721[_0x9863('0x84')]());return db[_0x9863('0x83')][_0x9863('0x2d')](_0x227721['toString'](),{'type':db[_0x9863('0x83')][_0x9863('0x85')][_0x9863('0x86')]});}})[_0x9863('0x21')](function(_0x374f97){if(!_0x374f97['length']){throw new db[(_0x9863('0x6c'))][(_0x9863('0x6d'))]('No\x20available\x20data',0xcc);}if(_0x2e3b79[_0x9863('0x8c')]===_0x9863('0x8d')){return null;}var _0x4a0819=_[_0x9863('0x37')](_0x2e3b79,{'name':_0x2e3b79[_0x9863('0x8e')]||_0x2e3b79['name']||_0x37bce4[_0x9863('0x28')],'basename':_0x1d0f12,'savename':util[_0x9863('0x77')](_0x9863('0x8f'),_0x2e3b79[_0x9863('0x28')]||_0x37bce4[_0x9863('0x28')],require(_0x9863('0x90'))[_0x9863('0x91')](0x4),_0x2e3b79[_0x9863('0x8c')]||_0x9863('0x92')),'reportId':_0x37bce4['id'],'reportType':_0x9863('0x93')});return db[_0x9863('0x94')][_0x9863('0x49')](_0x4a0819,{'raw':!![]});})[_0x9863('0x21')](function(_0x29d3c5){if(_0x37bce4['table']===_0x9863('0x95')){_0x39bdbb[_0x9863('0x38')](_0x37bce4['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x2e3b79[_0x9863('0x96')],_0x2e3b79[_0x9863('0x97')]);}else{_0x39bdbb[_0x9863('0x38')](_0x37bce4['table']+_0x9863('0x98'),_0x2e3b79['startDate'],_0x2e3b79[_0x9863('0x97')]);}if(_0x29d3c5){logger[_0x9863('0x99')](_0x9863('0x9a'),_0x39bdbb[_0x9863('0x84')]());require(_0x9863('0x9b'))[_0x9863('0x9c')](path[_0x9863('0x54')](__dirname,'../../components/export/',_0x29d3c5['output']),[_0x29d3c5['id'],_0x39bdbb[_0x9863('0x84')](),path['join'](__dirname,_0x9863('0x9d'),_0x29d3c5[_0x9863('0x9e')]),_0x1d0f12]);return _0x29d3c5;}else{var _0x165683=squel[_0x9863('0x70')]();_0x165683[_0x9863('0x71')]('('+_0x39bdbb['toString']()+')',_0x9863('0x9f'));_0x165683[_0x9863('0x3d')]('COUNT(*)',_0x9863('0x1b'));_0x39bdbb[_0x9863('0x1d')](_0x2e3b79[_0x9863('0x1d')]||_0x5a8f33);_0x39bdbb[_0x9863('0x1c')](_0x2e3b79[_0x9863('0x1c')]||0x0);return db[_0x9863('0x83')][_0x9863('0x2d')](_0x165683[_0x9863('0x84')](),{'type':db['sequelize'][_0x9863('0x85')][_0x9863('0x86')]})[_0x9863('0x21')](function(_0x31b065){if(!_0x31b065[_0x9863('0x32')]){_0x539e2f=0x0;}else{_0x539e2f=_0x31b065[0x0][_0x9863('0x1b')]||0x0;}return db[_0x9863('0x83')][_0x9863('0x2d')](_0x39bdbb[_0x9863('0x84')](),{'type':db[_0x9863('0x83')][_0x9863('0x85')][_0x9863('0x86')]});})[_0x9863('0x21')](function(_0x50ddaf){return{'rows':_0x50ddaf||[],'count':_0x539e2f};});}});}exports[_0x9863('0xa0')]=function(_0x318120,_0x2feee9){return runReport(_0x318120[_0x9863('0x46')],_0x318120[_0x9863('0x2d')],_0x318120[_0x9863('0x3f')])['then'](respondWithResult(_0x2feee9,null))['catch'](handleError(_0x2feee9,null));};exports[_0x9863('0xa1')]=runReport;exports['query']=function(_0x2c06ef,_0x129978){var _0x30e28a=0xa;var _0x25f9be=[_0x9863('0x54'),_0x9863('0x55'),_0x9863('0x56'),'cross_join'];var _0x4c840c={'SUM':_0x9863('0x58'),'COUNT':_0x9863('0x59'),'COUNT DISTINCT':_0x9863('0x5a'),'MAX':_0x9863('0x5b'),'MIN':_0x9863('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9863('0x5d'),'GROUP_CONCAT ASC':_0x9863('0xa2'),'GROUP_CONCAT DESC':_0x9863('0x5e')};var _0x214b56={'SEC_TO_TIME':_0x9863('0x5f'),'DATE':_0x9863('0x60'),'HOUR':_0x9863('0x61'),'ROUND':_0x9863('0x62'),'UNIX_TIMESTAMP':_0x9863('0x63')};var _0x44bb2e=function(_0x45b230){return!_[_0x9863('0x64')]([_0x9863('0x88'),_0x9863('0x65'),_0x9863('0x89'),_0x9863('0x66')],_0x45b230);};var _0x5e1d38=function(_0x2bb0d5){if(!_0x2bb0d5||!_0x2bb0d5['rules']['length']){return'';}for(var _0x55b570='(',_0x2b96be=0x0;_0x2b96be<_0x2bb0d5[_0x9863('0x67')]['length'];_0x2b96be+=0x1){_0x2b96be>0x0&&(_0x55b570+='\x20'+_0x2bb0d5[_0x9863('0xa3')]+'\x20');_0x55b570+=_0x2bb0d5[_0x9863('0x67')][_0x2b96be][_0x9863('0x68')]?_0x5e1d38(_0x2bb0d5[_0x9863('0x67')][_0x2b96be][_0x9863('0x68')]):_0x2bb0d5[_0x9863('0x67')][_0x2b96be][_0x9863('0x3d')]+'\x20'+_0x2bb0d5[_0x9863('0x67')][_0x2b96be][_0x9863('0x69')]+(_0x44bb2e(_0x2bb0d5[_0x9863('0x67')][_0x2b96be][_0x9863('0x69')])?'\x20'+_0x2bb0d5[_0x9863('0x67')][_0x2b96be][_0x9863('0x6a')]:'');}return _0x55b570+')';};var _0x2fa0b6={'where':{'id':_0x2c06ef[_0x9863('0x46')]['id']}},_0x5000e5,_0x572da8,_0x513dca,_0x3df038,_0x14b270;_0x2fa0b6=_['merge']({},_0x2fa0b6,_0x2c06ef['options']);return db[_0x9863('0x40')][_0x9863('0x48')](_0x2fa0b6)['then'](function(_0x2e209e){if(_0x2e209e){_0x5000e5=_0x2e209e;return _0x2e209e[_0x9863('0x6b')]();}return null;})[_0x9863('0x21')](function(_0x2802b9){if(_0x2802b9){if(!_0x2802b9[_0x9863('0x32')]){throw new db[(_0x9863('0x6c'))][(_0x9863('0x6d'))](_0x9863('0x6e'),0x193);}_0x572da8=_0x2802b9;return db['AnalyticMetric'][_0x9863('0x42')]({'raw':!![]});}return null;})['then'](function(_0x4c8b08){if(_0x4c8b08){_0x513dca=_[_0x9863('0xa4')](_0x4c8b08,'id');var _0x22a1d1;var _0x5547e6=squel[_0x9863('0x70')]();_0x5547e6['from'](_0x5000e5[_0x9863('0x72')]);for(var _0x14d3ad=0x0;_0x14d3ad<_0x572da8[_0x9863('0x32')];_0x14d3ad+=0x1){_0x22a1d1=_0x572da8[_0x14d3ad]['MetricId']?_0x513dca[_0x572da8[_0x14d3ad][_0x9863('0x73')]][_0x9863('0x74')]:_0x572da8[_0x14d3ad][_0x9863('0x3d')];_0x22a1d1=_0x572da8[_0x14d3ad][_0x9863('0x75')]?_['replace'](_0x4c840c[_0x572da8[_0x14d3ad][_0x9863('0x75')]],'%s',_0x22a1d1):_0x22a1d1;_0x22a1d1=_0x572da8[_0x14d3ad]['format']?_[_0x9863('0x76')](_0x214b56[_0x572da8[_0x14d3ad]['format']],'%s',_0x22a1d1):_0x22a1d1;if(_0x572da8[_0x14d3ad][_0x9863('0x78')]){_0x5547e6[_0x9863('0x68')](_0x22a1d1);}_0x572da8[_0x14d3ad][_0x9863('0x79')]&&_0x5547e6[_0x9863('0x35')](_0x22a1d1,_0x572da8[_0x14d3ad][_0x9863('0x79')]==='DESC'?![]:!![]);_0x5547e6[_0x9863('0x3d')](_0x22a1d1,_0x572da8[_0x14d3ad][_0x9863('0x7b')]||_0x22a1d1);}if(_0x5000e5[_0x9863('0x7c')]){_0x5000e5[_0x9863('0x7c')]=JSON[_0x9863('0x7d')](_0x5000e5[_0x9863('0x7c')]);for(var _0x399636=0x0;_0x399636<_0x5000e5[_0x9863('0x7c')][_0x9863('0x32')];_0x399636+=0x1){if(_0x5000e5[_0x9863('0x7c')][_0x399636]['type']&&_[_0x9863('0x64')](_0x25f9be,_0x5000e5[_0x9863('0x7c')][_0x399636][_0x9863('0x3a')])&&_0x5000e5[_0x9863('0x7c')][_0x399636][_0x9863('0x7e')]&&_0x5000e5[_0x9863('0x7c')][_0x399636][_0x9863('0x7f')]&&_0x5000e5[_0x9863('0x7c')][_0x399636][_0x9863('0x80')]){_0x5547e6[_0x5000e5['joins'][_0x399636][_0x9863('0x3a')]](_0x5000e5[_0x9863('0x7c')][_0x399636][_0x9863('0x7f')],null,util[_0x9863('0x77')](_0x9863('0xa5'),_0x5000e5[_0x9863('0x72')],_0x5000e5[_0x9863('0x7c')][_0x399636][_0x9863('0x7e')],_0x5000e5[_0x9863('0x7c')][_0x399636][_0x9863('0x7f')],_0x5000e5['joins'][_0x399636][_0x9863('0x80')]));}}}if(_0x5000e5[_0x9863('0x81')]){_0x5000e5[_0x9863('0x81')]=JSON[_0x9863('0x7d')](_0x5000e5[_0x9863('0x81')]);_0x5547e6['where'](_0x5e1d38(_0x5000e5[_0x9863('0x81')][_0x9863('0x68')]));}_0x14b270=_0x5547e6[_0x9863('0x8a')]();_0x5547e6[_0x9863('0x1d')](_0x30e28a);_0x5547e6[_0x9863('0x1c')](0x0);logger['debug']('Limited\x20Query:',_0x5547e6[_0x9863('0x84')]());return db[_0x9863('0x83')][_0x9863('0x2d')](_0x5547e6['toString'](),{'type':db['sequelize'][_0x9863('0x85')][_0x9863('0x86')]});}})[_0x9863('0x21')](function(){return{'sql':_0x14b270['toString']()};})[_0x9863('0x21')](respondWithResult(_0x129978,null))[_0x9863('0x44')](handleError(_0x129978,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 8c2dc75..6ac90dc 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 _0x1c7d=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x4a9ba7,_0x4613e4){var _0x54135b=function(_0x449812){while(--_0x449812){_0x4a9ba7['push'](_0x4a9ba7['shift']());}};_0x54135b(++_0x4613e4);}(_0x1c7d,0xb4));var _0xd1c7=function(_0x4a9633,_0x2b79d1){_0x4a9633=_0x4a9633-0x0;var _0x5d093b=_0x1c7d[_0x4a9633];return _0x5d093b;};'use strict';var _=require(_0xd1c7('0x0'));var util=require(_0xd1c7('0x1'));var logger=require('../../config/logger')(_0xd1c7('0x2'));var moment=require(_0xd1c7('0x3'));var BPromise=require(_0xd1c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd1c7('0x5'));var rimraf=require(_0xd1c7('0x6'));var config=require(_0xd1c7('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0xd1c7('0x8')]=function(_0x48b8f9,_0x20d12c){return _0x48b8f9[_0xd1c7('0x9')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf986=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xf986,0x150));var _0x6f98=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xf986[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x6f98('0x0'));var util=require(_0x6f98('0x1'));var logger=require(_0x6f98('0x2'))(_0x6f98('0x3'));var moment=require(_0x6f98('0x4'));var BPromise=require(_0x6f98('0x5'));var rp=require(_0x6f98('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6f98('0x7'));var attributes=require(_0x6f98('0x8'));module[_0x6f98('0x9')]=function(_0x1643f4,_0x39981f){return _0x1643f4[_0x6f98('0xa')](_0x6f98('0xb'),attributes,{'tableName':_0x6f98('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 74d3d9e..035048a 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 _0xf3cd=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result'];(function(_0x13fd59,_0x2e05b1){var _0x2e6ce7=function(_0x519a4b){while(--_0x519a4b){_0x13fd59['push'](_0x13fd59['shift']());}};_0x2e6ce7(++_0x2e05b1);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x332998,_0x2d99c7){_0x332998=_0x332998-0x0;var _0x460be7=_0xf3cd[_0x332998];return _0x460be7;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f0601,_0x106021,_0x28edae){return new BPromise(function(_0x52c073,_0x15705d){return client['request'](_0x1f0601,_0x28edae)['then'](function(_0x22d8ae){logger[_0xdf3c('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x106021,_0xdf3c('0xd'));logger[_0xdf3c('0xe')](_0xdf3c('0xf'),_0x106021,_0xdf3c('0xd'),JSON[_0xdf3c('0x10')](_0x22d8ae));if(_0x22d8ae[_0xdf3c('0x11')]){if(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x12')]===0x1f4){logger['error'](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);return _0x15705d(_0x22d8ae[_0xdf3c('0x11')]['message']);}logger[_0xdf3c('0x11')](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')]['message']);return _0x52c073(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);}else{logger[_0xdf3c('0xc')](_0xdf3c('0x13'),_0x106021,_0xdf3c('0xd'));_0x52c073(_0x22d8ae[_0xdf3c('0x15')][_0xdf3c('0x14')]);}})[_0xdf3c('0x16')](function(_0x2986d0){logger[_0xdf3c('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x106021,_0x2986d0);_0x15705d(_0x2986d0);});});} \ No newline at end of file +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(_0x29f544,_0x2ad4f1){var _0x2fdf4e=function(_0x364bd3){while(--_0x364bd3){_0x29f544['push'](_0x29f544['shift']());}};_0x2fdf4e(++_0x2ad4f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 72b7f9e..8cb7669 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 _0xdb1d=['query','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','/:id/run','run','/:id/query'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdb1d,0x1be));var _0xddb1=function(_0x3fe261,_0x5e3552){_0x3fe261=_0x3fe261-0x0;var _0x40a865=_0xdb1d[_0x3fe261];return _0x40a865;};'use strict';var multer=require(_0xddb1('0x0'));var util=require(_0xddb1('0x1'));var path=require(_0xddb1('0x2'));var timeout=require(_0xddb1('0x3'));var express=require(_0xddb1('0x4'));var router=express['Router']();var auth=require(_0xddb1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xddb1('0x6'));var controller=require(_0xddb1('0x7'));router[_0xddb1('0x8')]('/',auth[_0xddb1('0x9')](),controller[_0xddb1('0xa')]);router[_0xddb1('0x8')](_0xddb1('0xb'),auth[_0xddb1('0x9')](),controller['show']);router[_0xddb1('0x8')](_0xddb1('0xc'),auth['isAuthenticated'](),controller['preview']);router[_0xddb1('0x8')](_0xddb1('0xd'),auth['isAuthenticated'](),controller[_0xddb1('0xe')]);router[_0xddb1('0x8')](_0xddb1('0xf'),auth['isAuthenticated'](),controller[_0xddb1('0x10')]);router[_0xddb1('0x11')]('/',auth[_0xddb1('0x9')](),controller[_0xddb1('0x12')]);router[_0xddb1('0x13')](_0xddb1('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xddb1('0x14')](_0xddb1('0xb'),auth[_0xddb1('0x9')](),controller[_0xddb1('0x15')]);module['exports']=router; \ No newline at end of file +var _0x5df5=['run','post','create','put','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','/:id','show','get','/:id/preview','preview','/:id/run'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x5df5,0xcd));var _0x55df=function(_0x4cb375,_0x2741ab){_0x4cb375=_0x4cb375-0x0;var _0x463510=_0x5df5[_0x4cb375];return _0x463510;};'use strict';var multer=require(_0x55df('0x0'));var util=require('util');var path=require(_0x55df('0x1'));var timeout=require(_0x55df('0x2'));var express=require('express');var router=express[_0x55df('0x3')]();var auth=require(_0x55df('0x4'));var interaction=require(_0x55df('0x5'));var config=require(_0x55df('0x6'));var controller=require(_0x55df('0x7'));router['get']('/',auth[_0x55df('0x8')](),controller['index']);router['get'](_0x55df('0x9'),auth[_0x55df('0x8')](),controller[_0x55df('0xa')]);router[_0x55df('0xb')](_0x55df('0xc'),auth[_0x55df('0x8')](),controller[_0x55df('0xd')]);router['get'](_0x55df('0xe'),auth['isAuthenticated'](),controller[_0x55df('0xf')]);router['get']('/:id/query',auth[_0x55df('0x8')](),controller['query']);router[_0x55df('0x10')]('/',auth[_0x55df('0x8')](),controller[_0x55df('0x11')]);router[_0x55df('0x12')]('/:id',auth[_0x55df('0x8')](),controller['update']);router[_0x55df('0x13')](_0x55df('0x9'),auth['isAuthenticated'](),controller[_0x55df('0x14')]);module[_0x55df('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 7fff99a..e64cea0 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 _0x7652=['ENUM','csv','pdf','xlsx','DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING'];(function(_0x53929c,_0xdd6cfa){var _0x233ea1=function(_0x9cf7cb){while(--_0x9cf7cb){_0x53929c['push'](_0x53929c['shift']());}};_0x233ea1(++_0xdd6cfa);}(_0x7652,0x1ea));var _0x2765=function(_0x4633ee,_0xc061fe){_0x4633ee=_0x4633ee-0x0;var _0x5c5ac0=_0x7652[_0x4633ee];return _0x5c5ac0;};'use strict';var Sequelize=require(_0x2765('0x0'));var moment=require(_0x2765('0x1'));module[_0x2765('0x2')]={'name':{'type':Sequelize[_0x2765('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x2765('0x4')](_0x2765('0x5'),_0x2765('0x6'),_0x2765('0x7')),'allowNull':![],'defaultValue':_0x2765('0x5')},'savename':{'type':Sequelize[_0x2765('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x2765('0x8')]},'endDate':{'type':Sequelize[_0x2765('0x8')]},'status':{'type':Sequelize[_0x2765('0x3')],'defaultValue':_0x2765('0x9')},'type':{'type':Sequelize[_0x2765('0x4')](_0x2765('0xa'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x2765('0xb')](0xb)[_0x2765('0xc')]},'reportType':{'type':Sequelize[_0x2765('0x3')]}}; \ No newline at end of file +var _0xe171=['UNSIGNED','sequelize','STRING','ENUM','csv','pdf','DATE','Loading','manual','scheduled','INTEGER'];(function(_0x139ff6,_0xddca5){var _0x71b083=function(_0x4cf27a){while(--_0x4cf27a){_0x139ff6['push'](_0x139ff6['shift']());}};_0x71b083(++_0xddca5);}(_0xe171,0x1b9));var _0x1e17=function(_0x199564,_0x2b7ef2){_0x199564=_0x199564-0x0;var _0x47ac21=_0xe171[_0x199564];return _0x47ac21;};'use strict';var Sequelize=require(_0x1e17('0x0'));var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0x1e17('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x1e17('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x1e17('0x2')](_0x1e17('0x3'),_0x1e17('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0x1e17('0x3')},'savename':{'type':Sequelize[_0x1e17('0x1')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x1e17('0x5')]},'status':{'type':Sequelize[_0x1e17('0x1')],'defaultValue':_0x1e17('0x6')},'type':{'type':Sequelize[_0x1e17('0x2')](_0x1e17('0x7'),_0x1e17('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x1e17('0x9')](0xb)[_0x1e17('0xa')]},'reportType':{'type':Sequelize[_0x1e17('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 8095c02..f69c3b9 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 _0x58d6=['bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','ExtractedReports','error','stack','name','send','index','AnalyticExtractedReport','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','count','include','findAll','rows','show','rawAttributes','includeAll','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','fast-json-patch'];(function(_0x13ec9a,_0x4dab1){var _0x307756=function(_0x23ba49){while(--_0x23ba49){_0x13ec9a['push'](_0x13ec9a['shift']());}};_0x307756(++_0x4dab1);}(_0x58d6,0x1d3));var _0x658d=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x58d6[_0x565c49];return _0x20ca34;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x658d('0x0'));var rimraf=require(_0x658d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x658d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x658d('0x3'));var Mustache=require(_0x658d('0x4'));var util=require(_0x658d('0x5'));var path=require(_0x658d('0x6'));var sox=require('sox');var csv=require(_0x658d('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x658d('0x8'));var squel=require(_0x658d('0x9'));var crypto=require(_0x658d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x658d('0xb'));var toCsv=require(_0x658d('0x7'));var querystring=require(_0x658d('0xc'));var Papa=require('papaparse');var Redis=require(_0x658d('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x658d('0xe'));var hardwareService=require(_0x658d('0xf'));var logger=require(_0x658d('0x10'))('api');var utils=require(_0x658d('0x11'));var config=require(_0x658d('0x12'));var db=require(_0x658d('0x13'))['db'];function respondWithStatusCode(_0x2a001c,_0xbfd392){_0xbfd392=_0xbfd392||0xcc;return function(_0x2a266b){if(_0x2a266b){return _0x2a001c[_0x658d('0x14')](_0xbfd392);}return _0x2a001c['status'](_0xbfd392)[_0x658d('0x15')]();};}function respondWithResult(_0x393077,_0x3c7c6d){_0x3c7c6d=_0x3c7c6d||0xc8;return function(_0x47360e){if(_0x47360e){return _0x393077[_0x658d('0x16')](_0x3c7c6d)[_0x658d('0x17')](_0x47360e);}};}function respondWithFilteredResult(_0x4aebaa,_0x1dbdf9){return function(_0x303606){if(_0x303606){var _0x17b20f=_0x303606['count'],_0x284431=_0x1dbdf9[_0x658d('0x18')],_0x42aae9=_0x1dbdf9[_0x658d('0x18')]+_0x1dbdf9[_0x658d('0x19')],_0x2d8968;if(_0x42aae9>=_0x17b20f){_0x42aae9=_0x17b20f;_0x2d8968=0xc8;}else{_0x2d8968=0xce;}_0x4aebaa[_0x658d('0x16')](_0x2d8968);return _0x4aebaa[_0x658d('0x1a')](_0x658d('0x1b'),_0x284431+'-'+_0x42aae9+'/'+_0x17b20f)[_0x658d('0x17')](_0x303606);}return null;};}function patchUpdates(_0x3cdc74){return function(_0x331750){try{jsonpatch['apply'](_0x331750,_0x3cdc74,!![]);}catch(_0x544b7c){return BPromise[_0x658d('0x1c')](_0x544b7c);}return _0x331750[_0x658d('0x1d')]();};}function saveUpdates(_0x19d201,_0x13442f){return function(_0x2f1335){if(_0x2f1335){return _0x2f1335[_0x658d('0x1e')](_0x19d201)[_0x658d('0x1f')](function(_0x641d4){return _0x641d4;});}return null;};}function removeEntity(_0x3b4a1f,_0x558869){return function(_0x559e74){if(_0x559e74){return _0x559e74[_0x658d('0x20')]()[_0x658d('0x1f')](function(){var _0x5bb5cc=_0x559e74[_0x658d('0x21')]({'plain':!![]});var _0x13cbc3=_0x658d('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x13cbc3,'resourceId':_0x5bb5cc['id']}})[_0x658d('0x1f')](function(){return _0x559e74;});})[_0x658d('0x1f')](function(){_0x3b4a1f['status'](0xcc)[_0x658d('0x15')]();});}};}function handleEntityNotFound(_0x41f238,_0x5445b8){return function(_0x2088bd){if(!_0x2088bd){_0x41f238[_0x658d('0x14')](0x194);}return _0x2088bd;};}function handleError(_0x1e29b8,_0x4a6a9c){_0x4a6a9c=_0x4a6a9c||0x1f4;return function(_0x3e2759){logger[_0x658d('0x23')](_0x3e2759[_0x658d('0x24')]);if(_0x3e2759[_0x658d('0x25')]){delete _0x3e2759[_0x658d('0x25')];}_0x1e29b8[_0x658d('0x16')](_0x4a6a9c)[_0x658d('0x26')](_0x3e2759);};}exports[_0x658d('0x27')]=function(_0x918588,_0x27cccb){var _0x38cd62={},_0x323042={},_0x4c5176={'count':0x0,'rows':[]};var _0x2c5afb=db[_0x658d('0x28')]['rawAttributes'];_0x323042[_0x658d('0x29')]=_[_0x658d('0x2a')](_0x2c5afb);_0x323042[_0x658d('0x2b')]=_[_0x658d('0x2a')](_0x918588[_0x658d('0x2b')]);_0x323042[_0x658d('0x2c')]=_[_0x658d('0x2d')](_0x323042[_0x658d('0x29')],_0x323042[_0x658d('0x2b')]);_0x38cd62['attributes']=_[_0x658d('0x2d')](_0x323042['model'],qs[_0x658d('0x2e')](_0x918588[_0x658d('0x2b')][_0x658d('0x2e')]));_0x38cd62[_0x658d('0x2f')]=_0x38cd62[_0x658d('0x2f')][_0x658d('0x30')]?_0x38cd62[_0x658d('0x2f')]:_0x323042[_0x658d('0x29')];if(!_0x918588[_0x658d('0x2b')][_0x658d('0x31')](_0x658d('0x32'))){_0x38cd62[_0x658d('0x19')]=qs[_0x658d('0x19')](_0x918588[_0x658d('0x2b')][_0x658d('0x19')]);_0x38cd62[_0x658d('0x18')]=qs['offset'](_0x918588['query'][_0x658d('0x18')]);}_0x38cd62['order']=qs[_0x658d('0x33')](_0x918588[_0x658d('0x2b')][_0x658d('0x33')]);_0x38cd62[_0x658d('0x34')]=qs[_0x658d('0x2c')](_[_0x658d('0x35')](_0x918588[_0x658d('0x2b')],_0x323042[_0x658d('0x2c')]));if(_0x918588[_0x658d('0x2b')]['filter']){_0x38cd62['where']=_[_0x658d('0x36')](_0x38cd62[_0x658d('0x34')],{'$or':_[_0x658d('0x37')](_0x2c5afb,function(_0x31fb6f){if(_0x31fb6f[_0x658d('0x38')][_0x658d('0x39')]!==_0x658d('0x3a')){var _0x39ae42={};_0x39ae42[_0x31fb6f[_0x658d('0x3b')]]={'$like':'%'+_0x918588[_0x658d('0x2b')][_0x658d('0x3c')]+'%'};return _0x39ae42;}})});}_0x38cd62=_['merge']({},_0x38cd62,_0x918588[_0x658d('0x3d')]);var _0x2ac68c={'where':_0x38cd62[_0x658d('0x34')]};return db[_0x658d('0x28')][_0x658d('0x3e')](_0x2ac68c)[_0x658d('0x1f')](function(_0x3d6de7){_0x4c5176[_0x658d('0x3e')]=_0x3d6de7;if(_0x918588[_0x658d('0x2b')]['includeAll']){_0x38cd62[_0x658d('0x3f')]=[{'all':!![]}];}return db[_0x658d('0x28')][_0x658d('0x40')](_0x38cd62);})[_0x658d('0x1f')](function(_0x3e8698){_0x4c5176[_0x658d('0x41')]=_0x3e8698;return _0x4c5176;})[_0x658d('0x1f')](respondWithFilteredResult(_0x27cccb,_0x38cd62))['catch'](handleError(_0x27cccb,null));};exports[_0x658d('0x42')]=function(_0xdd974f,_0x285283){var _0x37849a={'raw':!![],'where':{'id':_0xdd974f['params']['id']}},_0x33f874={};_0x33f874[_0x658d('0x29')]=_['keys'](db['AnalyticExtractedReport'][_0x658d('0x43')]);_0x33f874[_0x658d('0x2b')]=_[_0x658d('0x2a')](_0xdd974f['query']);_0x33f874[_0x658d('0x2c')]=_['intersection'](_0x33f874[_0x658d('0x29')],_0x33f874[_0x658d('0x2b')]);_0x37849a[_0x658d('0x2f')]=_['intersection'](_0x33f874[_0x658d('0x29')],qs['fields'](_0xdd974f[_0x658d('0x2b')][_0x658d('0x2e')]));_0x37849a[_0x658d('0x2f')]=_0x37849a[_0x658d('0x2f')]['length']?_0x37849a[_0x658d('0x2f')]:_0x33f874['model'];if(_0xdd974f[_0x658d('0x2b')][_0x658d('0x44')]){_0x37849a['include']=[{'all':!![]}];}_0x37849a=_['merge']({},_0x37849a,_0xdd974f[_0x658d('0x3d')]);return db[_0x658d('0x28')]['find'](_0x37849a)[_0x658d('0x1f')](handleEntityNotFound(_0x285283,null))[_0x658d('0x1f')](respondWithResult(_0x285283,null))[_0x658d('0x45')](handleError(_0x285283,null));};exports[_0x658d('0x46')]=function(_0x5d3375,_0x56c466){return db[_0x658d('0x28')][_0x658d('0x46')](_0x5d3375[_0x658d('0x47')],{})[_0x658d('0x1f')](function(_0x39ae6a){var _0xf0067=_0x5d3375['user']['get']({'plain':!![]});if(!_0xf0067)throw new Error(_0x658d('0x48'));if(_0xf0067[_0x658d('0x49')]==='user'){var _0xd1f6e9=_0x39ae6a[_0x658d('0x21')]({'plain':!![]});var _0x341107=_0x658d('0x22');return db['UserProfileSection']['find']({'where':{'name':_0x341107,'userProfileId':_0xf0067[_0x658d('0x4a')]},'raw':!![]})[_0x658d('0x1f')](function(_0x46f75f){if(_0x46f75f&&_0x46f75f[_0x658d('0x4b')]===0x0){return db[_0x658d('0x4c')][_0x658d('0x46')]({'name':_0xd1f6e9[_0x658d('0x25')],'resourceId':_0xd1f6e9['id'],'type':_0x46f75f[_0x658d('0x25')],'sectionId':_0x46f75f['id']},{})['then'](function(){return _0x39ae6a;});}else{return _0x39ae6a;}})[_0x658d('0x45')](function(_0x510c44){logger[_0x658d('0x23')](_0x658d('0x4d'),_0x510c44);throw _0x510c44;});}return _0x39ae6a;})[_0x658d('0x1f')](respondWithResult(_0x56c466,0xc9))[_0x658d('0x45')](handleError(_0x56c466,null));};exports[_0x658d('0x1e')]=function(_0x18afa8,_0x55f81d){if(_0x18afa8[_0x658d('0x47')]['id']){delete _0x18afa8[_0x658d('0x47')]['id'];}return db[_0x658d('0x28')][_0x658d('0x4e')]({'where':{'id':_0x18afa8['params']['id']}})['then'](handleEntityNotFound(_0x55f81d,null))[_0x658d('0x1f')](saveUpdates(_0x18afa8[_0x658d('0x47')],null))['then'](respondWithResult(_0x55f81d,null))[_0x658d('0x45')](handleError(_0x55f81d,null));};exports['destroy']=function(_0x49106b,_0x2ad993){return db[_0x658d('0x28')][_0x658d('0x4e')]({'where':{'id':_0x49106b[_0x658d('0x4f')]['id']}})[_0x658d('0x1f')](handleEntityNotFound(_0x2ad993,null))[_0x658d('0x1f')](removeEntity(_0x2ad993,null))[_0x658d('0x45')](handleError(_0x2ad993,null));};exports[_0x658d('0x50')]=function(_0x295984,_0x3fa17b,_0x2fabaa){return db[_0x658d('0x28')][_0x658d('0x4e')]({'where':{'id':_0x295984[_0x658d('0x4f')]['id']},'attributes':[_0x658d('0x25'),_0x658d('0x51'),_0x658d('0x52'),_0x658d('0x53')],'raw':!![]})[_0x658d('0x1f')](handleEntityNotFound(_0x3fa17b,null))[_0x658d('0x1f')](function(_0x1c1a14){if(_0x1c1a14){if(!fs[_0x658d('0x54')](path[_0x658d('0x55')](config[_0x658d('0x56')],_0x658d('0x57'),_0x1c1a14['savename']))){throw new db['Sequelize'][(_0x658d('0x58'))](_0x658d('0x59'));}if(_0x295984['query'][_0x658d('0x5a')]){return _0x3fa17b['sendStatus'](0xc8);}return _0x3fa17b[_0x658d('0x50')](path[_0x658d('0x55')](config['root'],'server/files/reports',_0x1c1a14[_0x658d('0x52')]),util[_0x658d('0x5b')](_0x658d('0x5c'),_0x1c1a14['basename']||_0x1c1a14[_0x658d('0x25')],_0x1c1a14[_0x658d('0x53')][_0x658d('0x5d')]()));}})['catch'](handleError(_0x3fa17b,null));}; \ No newline at end of file +var _0xea28=['merge','VIRTUAL','field','options','includeAll','rows','catch','show','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','savename','output','existsSync','join','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','download','root','server/files/reports','format','%s.%s','toLowerCase','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','get','ExtractedReports','UserProfileResource','end','stack','name','AnalyticExtractedReport','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter'];(function(_0x56b05c,_0x118802){var _0x38ef55=function(_0x353b2d){while(--_0x353b2d){_0x56b05c['push'](_0x56b05c['shift']());}};_0x38ef55(++_0x118802);}(_0xea28,0x13a));var _0x8ea2=function(_0x439154,_0x54dc06){_0x439154=_0x439154-0x0;var _0x18e6d8=_0xea28[_0x439154];return _0x18e6d8;};'use strict';var pdf=require(_0x8ea2('0x0'));var emlformat=require(_0x8ea2('0x1'));var rimraf=require(_0x8ea2('0x2'));var zipdir=require(_0x8ea2('0x3'));var jsonpatch=require(_0x8ea2('0x4'));var rp=require(_0x8ea2('0x5'));var moment=require(_0x8ea2('0x6'));var BPromise=require(_0x8ea2('0x7'));var Mustache=require('mustache');var util=require(_0x8ea2('0x8'));var path=require(_0x8ea2('0x9'));var sox=require(_0x8ea2('0xa'));var csv=require('to-csv');var ejs=require(_0x8ea2('0xb'));var fs=require('fs');var _=require(_0x8ea2('0xc'));var squel=require(_0x8ea2('0xd'));var crypto=require(_0x8ea2('0xe'));var jsforce=require(_0x8ea2('0xf'));var deskjs=require(_0x8ea2('0x10'));var toCsv=require(_0x8ea2('0x11'));var querystring=require(_0x8ea2('0x12'));var Papa=require(_0x8ea2('0x13'));var Redis=require(_0x8ea2('0x14'));var authService=require(_0x8ea2('0x15'));var qs=require(_0x8ea2('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8ea2('0x17'));var utils=require(_0x8ea2('0x18'));var config=require(_0x8ea2('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32b97d,_0x101a15){_0x101a15=_0x101a15||0xcc;return function(_0x1dfb6e){if(_0x1dfb6e){return _0x32b97d[_0x8ea2('0x1a')](_0x101a15);}return _0x32b97d[_0x8ea2('0x1b')](_0x101a15)['end']();};}function respondWithResult(_0x2879d6,_0x553154){_0x553154=_0x553154||0xc8;return function(_0x4b2192){if(_0x4b2192){return _0x2879d6[_0x8ea2('0x1b')](_0x553154)[_0x8ea2('0x1c')](_0x4b2192);}};}function respondWithFilteredResult(_0x416bae,_0x78669a){return function(_0x393faf){if(_0x393faf){var _0xbb9bd1=_0x393faf[_0x8ea2('0x1d')],_0x3cff96=_0x78669a[_0x8ea2('0x1e')],_0x11f5e8=_0x78669a[_0x8ea2('0x1e')]+_0x78669a[_0x8ea2('0x1f')],_0x474873;if(_0x11f5e8>=_0xbb9bd1){_0x11f5e8=_0xbb9bd1;_0x474873=0xc8;}else{_0x474873=0xce;}_0x416bae[_0x8ea2('0x1b')](_0x474873);return _0x416bae[_0x8ea2('0x20')](_0x8ea2('0x21'),_0x3cff96+'-'+_0x11f5e8+'/'+_0xbb9bd1)[_0x8ea2('0x1c')](_0x393faf);}return null;};}function patchUpdates(_0x2a0329){return function(_0x1068b6){try{jsonpatch[_0x8ea2('0x22')](_0x1068b6,_0x2a0329,!![]);}catch(_0x134cbe){return BPromise[_0x8ea2('0x23')](_0x134cbe);}return _0x1068b6['save']();};}function saveUpdates(_0x4be7c9,_0x3790e9){return function(_0x248c18){if(_0x248c18){return _0x248c18[_0x8ea2('0x24')](_0x4be7c9)['then'](function(_0x46f4fe){return _0x46f4fe;});}return null;};}function removeEntity(_0x218bd0,_0x5c057a){return function(_0x3d593b){if(_0x3d593b){return _0x3d593b[_0x8ea2('0x25')]()[_0x8ea2('0x26')](function(){var _0x9f9548=_0x3d593b[_0x8ea2('0x27')]({'plain':!![]});var _0xe5c943=_0x8ea2('0x28');return db[_0x8ea2('0x29')][_0x8ea2('0x25')]({'where':{'type':_0xe5c943,'resourceId':_0x9f9548['id']}})['then'](function(){return _0x3d593b;});})[_0x8ea2('0x26')](function(){_0x218bd0['status'](0xcc)[_0x8ea2('0x2a')]();});}};}function handleEntityNotFound(_0x42bec8,_0x29b38f){return function(_0x4e2106){if(!_0x4e2106){_0x42bec8['sendStatus'](0x194);}return _0x4e2106;};}function handleError(_0x2e4da3,_0x4dc7bf){_0x4dc7bf=_0x4dc7bf||0x1f4;return function(_0x200a49){logger['error'](_0x200a49[_0x8ea2('0x2b')]);if(_0x200a49[_0x8ea2('0x2c')]){delete _0x200a49[_0x8ea2('0x2c')];}_0x2e4da3[_0x8ea2('0x1b')](_0x4dc7bf)['send'](_0x200a49);};}exports['index']=function(_0xacaa6c,_0x4da5b3){var _0x4a9875={},_0x287078={},_0x24f187={'count':0x0,'rows':[]};var _0x41f482=db[_0x8ea2('0x2d')][_0x8ea2('0x2e')];_0x287078[_0x8ea2('0x2f')]=_[_0x8ea2('0x30')](_0x41f482);_0x287078[_0x8ea2('0x31')]=_[_0x8ea2('0x30')](_0xacaa6c['query']);_0x287078['filters']=_[_0x8ea2('0x32')](_0x287078[_0x8ea2('0x2f')],_0x287078['query']);_0x4a9875['attributes']=_[_0x8ea2('0x32')](_0x287078['model'],qs[_0x8ea2('0x33')](_0xacaa6c[_0x8ea2('0x31')]['fields']));_0x4a9875[_0x8ea2('0x34')]=_0x4a9875[_0x8ea2('0x34')][_0x8ea2('0x35')]?_0x4a9875['attributes']:_0x287078['model'];if(!_0xacaa6c['query'][_0x8ea2('0x36')](_0x8ea2('0x37'))){_0x4a9875[_0x8ea2('0x1f')]=qs['limit'](_0xacaa6c[_0x8ea2('0x31')][_0x8ea2('0x1f')]);_0x4a9875[_0x8ea2('0x1e')]=qs[_0x8ea2('0x1e')](_0xacaa6c[_0x8ea2('0x31')][_0x8ea2('0x1e')]);}_0x4a9875[_0x8ea2('0x38')]=qs[_0x8ea2('0x39')](_0xacaa6c['query'][_0x8ea2('0x39')]);_0x4a9875[_0x8ea2('0x3a')]=qs[_0x8ea2('0x3b')](_[_0x8ea2('0x3c')](_0xacaa6c['query'],_0x287078[_0x8ea2('0x3b')]));if(_0xacaa6c['query'][_0x8ea2('0x3d')]){_0x4a9875[_0x8ea2('0x3a')]=_[_0x8ea2('0x3e')](_0x4a9875[_0x8ea2('0x3a')],{'$or':_['map'](_0x41f482,function(_0x2bed24){if(_0x2bed24['type']['key']!==_0x8ea2('0x3f')){var _0x5f23a3={};_0x5f23a3[_0x2bed24[_0x8ea2('0x40')]]={'$like':'%'+_0xacaa6c[_0x8ea2('0x31')][_0x8ea2('0x3d')]+'%'};return _0x5f23a3;}})});}_0x4a9875=_[_0x8ea2('0x3e')]({},_0x4a9875,_0xacaa6c[_0x8ea2('0x41')]);var _0x4ae536={'where':_0x4a9875[_0x8ea2('0x3a')]};return db['AnalyticExtractedReport'][_0x8ea2('0x1d')](_0x4ae536)[_0x8ea2('0x26')](function(_0x6d0e0c){_0x24f187[_0x8ea2('0x1d')]=_0x6d0e0c;if(_0xacaa6c['query'][_0x8ea2('0x42')]){_0x4a9875['include']=[{'all':!![]}];}return db[_0x8ea2('0x2d')]['findAll'](_0x4a9875);})[_0x8ea2('0x26')](function(_0x450e8f){_0x24f187[_0x8ea2('0x43')]=_0x450e8f;return _0x24f187;})[_0x8ea2('0x26')](respondWithFilteredResult(_0x4da5b3,_0x4a9875))[_0x8ea2('0x44')](handleError(_0x4da5b3,null));};exports[_0x8ea2('0x45')]=function(_0x2f4fa8,_0x478d5c){var _0x52a34e={'raw':!![],'where':{'id':_0x2f4fa8['params']['id']}},_0x1d7496={};_0x1d7496['model']=_['keys'](db[_0x8ea2('0x2d')]['rawAttributes']);_0x1d7496[_0x8ea2('0x31')]=_[_0x8ea2('0x30')](_0x2f4fa8[_0x8ea2('0x31')]);_0x1d7496[_0x8ea2('0x3b')]=_[_0x8ea2('0x32')](_0x1d7496[_0x8ea2('0x2f')],_0x1d7496[_0x8ea2('0x31')]);_0x52a34e[_0x8ea2('0x34')]=_['intersection'](_0x1d7496[_0x8ea2('0x2f')],qs[_0x8ea2('0x33')](_0x2f4fa8[_0x8ea2('0x31')]['fields']));_0x52a34e[_0x8ea2('0x34')]=_0x52a34e[_0x8ea2('0x34')][_0x8ea2('0x35')]?_0x52a34e[_0x8ea2('0x34')]:_0x1d7496[_0x8ea2('0x2f')];if(_0x2f4fa8['query'][_0x8ea2('0x42')]){_0x52a34e[_0x8ea2('0x46')]=[{'all':!![]}];}_0x52a34e=_[_0x8ea2('0x3e')]({},_0x52a34e,_0x2f4fa8['options']);return db[_0x8ea2('0x2d')][_0x8ea2('0x47')](_0x52a34e)[_0x8ea2('0x26')](handleEntityNotFound(_0x478d5c,null))[_0x8ea2('0x26')](respondWithResult(_0x478d5c,null))[_0x8ea2('0x44')](handleError(_0x478d5c,null));};exports[_0x8ea2('0x48')]=function(_0x3f51ae,_0x26e2d5){return db[_0x8ea2('0x2d')][_0x8ea2('0x48')](_0x3f51ae[_0x8ea2('0x49')],{})[_0x8ea2('0x26')](function(_0x220970){var _0x12e81f=_0x3f51ae['user'][_0x8ea2('0x27')]({'plain':!![]});if(!_0x12e81f)throw new Error(_0x8ea2('0x4a'));if(_0x12e81f[_0x8ea2('0x4b')]===_0x8ea2('0x4c')){var _0x182a46=_0x220970[_0x8ea2('0x27')]({'plain':!![]});var _0x11b3ef=_0x8ea2('0x28');return db['UserProfileSection'][_0x8ea2('0x47')]({'where':{'name':_0x11b3ef,'userProfileId':_0x12e81f[_0x8ea2('0x4d')]},'raw':!![]})[_0x8ea2('0x26')](function(_0x5380fa){if(_0x5380fa&&_0x5380fa['autoAssociation']===0x0){return db[_0x8ea2('0x29')][_0x8ea2('0x48')]({'name':_0x182a46[_0x8ea2('0x2c')],'resourceId':_0x182a46['id'],'type':_0x5380fa['name'],'sectionId':_0x5380fa['id']},{})[_0x8ea2('0x26')](function(){return _0x220970;});}else{return _0x220970;}})[_0x8ea2('0x44')](function(_0x3f2ae6){logger[_0x8ea2('0x4e')](_0x8ea2('0x4f'),_0x3f2ae6);throw _0x3f2ae6;});}return _0x220970;})['then'](respondWithResult(_0x26e2d5,0xc9))['catch'](handleError(_0x26e2d5,null));};exports[_0x8ea2('0x24')]=function(_0x4148c1,_0x1b8c4b){if(_0x4148c1['body']['id']){delete _0x4148c1[_0x8ea2('0x49')]['id'];}return db[_0x8ea2('0x2d')][_0x8ea2('0x47')]({'where':{'id':_0x4148c1['params']['id']}})['then'](handleEntityNotFound(_0x1b8c4b,null))['then'](saveUpdates(_0x4148c1['body'],null))['then'](respondWithResult(_0x1b8c4b,null))[_0x8ea2('0x44')](handleError(_0x1b8c4b,null));};exports[_0x8ea2('0x25')]=function(_0x5f56f8,_0x49cf11){return db[_0x8ea2('0x2d')][_0x8ea2('0x47')]({'where':{'id':_0x5f56f8[_0x8ea2('0x50')]['id']}})['then'](handleEntityNotFound(_0x49cf11,null))[_0x8ea2('0x26')](removeEntity(_0x49cf11,null))[_0x8ea2('0x44')](handleError(_0x49cf11,null));};exports['download']=function(_0x8f0598,_0x28e56a,_0x293dd8){return db[_0x8ea2('0x2d')][_0x8ea2('0x47')]({'where':{'id':_0x8f0598['params']['id']},'attributes':['name','basename',_0x8ea2('0x51'),_0x8ea2('0x52')],'raw':!![]})[_0x8ea2('0x26')](handleEntityNotFound(_0x28e56a,null))[_0x8ea2('0x26')](function(_0x1d6a60){if(_0x1d6a60){if(!fs[_0x8ea2('0x53')](path[_0x8ea2('0x54')](config['root'],'server/files/reports',_0x1d6a60['savename']))){throw new db[(_0x8ea2('0x55'))][(_0x8ea2('0x56'))](_0x8ea2('0x57'));}if(_0x8f0598[_0x8ea2('0x31')]['exists']){return _0x28e56a[_0x8ea2('0x1a')](0xc8);}return _0x28e56a[_0x8ea2('0x58')](path['join'](config[_0x8ea2('0x59')],_0x8ea2('0x5a'),_0x1d6a60[_0x8ea2('0x51')]),util[_0x8ea2('0x5b')](_0x8ea2('0x5c'),_0x1d6a60['basename']||_0x1d6a60['name'],_0x1d6a60['output'][_0x8ea2('0x5d')]()));}})[_0x8ea2('0x44')](handleError(_0x28e56a,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 9c8d2ef..104e2e7 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 _0x25fa=['path','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x2b47f4,_0x2a5bb8){var _0x15f4e6=function(_0x577f28){while(--_0x577f28){_0x2b47f4['push'](_0x2b47f4['shift']());}};_0x15f4e6(++_0x2a5bb8);}(_0x25fa,0x109));var _0xa25f=function(_0x4f04a3,_0x4d3f82){_0x4f04a3=_0x4f04a3-0x0;var _0x2955ae=_0x25fa[_0x4f04a3];return _0x2955ae;};'use strict';var _=require(_0xa25f('0x0'));var util=require('util');var logger=require(_0xa25f('0x1'))(_0xa25f('0x2'));var moment=require('moment');var BPromise=require(_0xa25f('0x3'));var rp=require(_0xa25f('0x4'));var fs=require('fs');var path=require(_0xa25f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa25f('0x6'));module['exports']=function(_0x2ea9ea,_0x3ab530){return _0x2ea9ea[_0xa25f('0x7')](_0xa25f('0x8'),attributes,{'tableName':_0xa25f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda19=['exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x2195d6,_0x325145){var _0x10b76b=function(_0x3aae32){while(--_0x3aae32){_0x2195d6['push'](_0x2195d6['shift']());}};_0x10b76b(++_0x325145);}(_0xda19,0xd5));var _0x9da1=function(_0x59bb97,_0x6466e8){_0x59bb97=_0x59bb97-0x0;var _0x5686ab=_0xda19[_0x59bb97];return _0x5686ab;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));module[_0x9da1('0x7')]=function(_0x156faf,_0x2dcbc6){return _0x156faf[_0x9da1('0x8')](_0x9da1('0x9'),attributes,{'tableName':_0x9da1('0xa'),'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 1e17074..32bfddc 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 _0x7fc5=['stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1b6f6e,_0x1d4e36){var _0x3b27f2=function(_0x216d06){while(--_0x216d06){_0x1b6f6e['push'](_0x1b6f6e['shift']());}};_0x3b27f2(++_0x1d4e36);}(_0x7fc5,0x10c));var _0x57fc=function(_0xa35ca0,_0x4aecc4){_0xa35ca0=_0xa35ca0-0x0;var _0x1094b8=_0x7fc5[_0xa35ca0];return _0x1094b8;};'use strict';var _=require(_0x57fc('0x0'));var util=require(_0x57fc('0x1'));var moment=require(_0x57fc('0x2'));var BPromise=require(_0x57fc('0x3'));var rs=require(_0x57fc('0x4'));var fs=require('fs');var Redis=require(_0x57fc('0x5'));var db=require(_0x57fc('0x6'))['db'];var utils=require(_0x57fc('0x7'));var logger=require(_0x57fc('0x8'))('rpc');var config=require(_0x57fc('0x9'));var jayson=require(_0x57fc('0xa'));var client=jayson[_0x57fc('0xb')][_0x57fc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1937a7,_0x84103b,_0x3e6ce3){return new BPromise(function(_0x427f73,_0x3c898d){return client[_0x57fc('0xd')](_0x1937a7,_0x3e6ce3)[_0x57fc('0xe')](function(_0x1b748c){logger[_0x57fc('0xf')](_0x57fc('0x10'),_0x84103b,'request\x20sent');logger[_0x57fc('0x11')](_0x57fc('0x12'),_0x84103b,_0x57fc('0x13'),JSON[_0x57fc('0x14')](_0x1b748c));if(_0x1b748c[_0x57fc('0x15')]){if(_0x1b748c['error'][_0x57fc('0x16')]===0x1f4){logger[_0x57fc('0x15')](_0x57fc('0x10'),_0x84103b,_0x1b748c[_0x57fc('0x15')]['message']);return _0x3c898d(_0x1b748c[_0x57fc('0x15')]['message']);}logger[_0x57fc('0x15')](_0x57fc('0x10'),_0x84103b,_0x1b748c['error'][_0x57fc('0x17')]);return _0x427f73(_0x1b748c[_0x57fc('0x15')][_0x57fc('0x17')]);}else{logger[_0x57fc('0xf')](_0x57fc('0x10'),_0x84103b,_0x57fc('0x13'));_0x427f73(_0x1b748c['result'][_0x57fc('0x17')]);}})['catch'](function(_0x28fcac){logger[_0x57fc('0x15')](_0x57fc('0x10'),_0x84103b,_0x28fcac);_0x3c898d(_0x28fcac);});});} \ No newline at end of file +var _0x35c7=['../../config/logger','rpc','../../config/environment','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','randomstring','ioredis','../../config/utils'];(function(_0xe0443,_0x5925be){var _0x40883e=function(_0x1d0949){while(--_0x1d0949){_0xe0443['push'](_0xe0443['shift']());}};_0x40883e(++_0x5925be);}(_0x35c7,0x176));var _0x735c=function(_0x599bef,_0x2486b4){_0x599bef=_0x599bef-0x0;var _0x5678b4=_0x35c7[_0x599bef];return _0x5678b4;};'use strict';var _=require(_0x735c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x735c('0x1'));var fs=require('fs');var Redis=require(_0x735c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x735c('0x3'));var logger=require(_0x735c('0x4'))(_0x735c('0x5'));var config=require(_0x735c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x735c('0x7')][_0x735c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3daf36,_0x1ca61,_0x1f8140){return new BPromise(function(_0x146762,_0x1a4639){return client[_0x735c('0x9')](_0x3daf36,_0x1f8140)[_0x735c('0xa')](function(_0x29d534){logger['info'](_0x735c('0xb'),_0x1ca61,_0x735c('0xc'));logger['debug'](_0x735c('0xd'),_0x1ca61,'request\x20sent',JSON[_0x735c('0xe')](_0x29d534));if(_0x29d534[_0x735c('0xf')]){if(_0x29d534[_0x735c('0xf')][_0x735c('0x10')]===0x1f4){logger[_0x735c('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1ca61,_0x29d534[_0x735c('0xf')][_0x735c('0x11')]);return _0x1a4639(_0x29d534[_0x735c('0xf')][_0x735c('0x11')]);}logger[_0x735c('0xf')](_0x735c('0xb'),_0x1ca61,_0x29d534[_0x735c('0xf')]['message']);return _0x146762(_0x29d534['error'][_0x735c('0x11')]);}else{logger[_0x735c('0x12')](_0x735c('0xb'),_0x1ca61,'request\x20sent');_0x146762(_0x29d534[_0x735c('0x13')]['message']);}})[_0x735c('0x14')](function(_0x49dec4){logger[_0x735c('0xf')](_0x735c('0xb'),_0x1ca61,_0x49dec4);_0x1a4639(_0x49dec4);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index c72db63..85bcc36 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 _0x8dc2=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','post','create','put','update','delete','destroy','exports'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x8dc2,0x1cc));var _0x28dc=function(_0x6ff3a9,_0x13b9c2){_0x6ff3a9=_0x6ff3a9-0x0;var _0x249066=_0x8dc2[_0x6ff3a9];return _0x249066;};'use strict';var multer=require(_0x28dc('0x0'));var util=require(_0x28dc('0x1'));var path=require(_0x28dc('0x2'));var timeout=require(_0x28dc('0x3'));var express=require(_0x28dc('0x4'));var router=express[_0x28dc('0x5')]();var auth=require(_0x28dc('0x6'));var interaction=require(_0x28dc('0x7'));var config=require(_0x28dc('0x8'));var controller=require(_0x28dc('0x9'));router[_0x28dc('0xa')]('/',auth[_0x28dc('0xb')](),controller[_0x28dc('0xc')]);router['get'](_0x28dc('0xd'),auth[_0x28dc('0xb')](),controller[_0x28dc('0xe')]);router['get'](_0x28dc('0xf'),auth[_0x28dc('0xb')](),controller['download']);router[_0x28dc('0x10')]('/',auth[_0x28dc('0xb')](),controller[_0x28dc('0x11')]);router[_0x28dc('0x12')](_0x28dc('0xd'),auth[_0x28dc('0xb')](),controller[_0x28dc('0x13')]);router[_0x28dc('0x14')](_0x28dc('0xd'),auth[_0x28dc('0xb')](),controller[_0x28dc('0x15')]);module[_0x28dc('0x16')]=router; \ No newline at end of file +var _0x197d=['/:id','show','/:id/download','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated'];(function(_0x27d020,_0x3e50af){var _0x14a24b=function(_0x2cf88b){while(--_0x2cf88b){_0x27d020['push'](_0x27d020['shift']());}};_0x14a24b(++_0x3e50af);}(_0x197d,0x170));var _0xd197=function(_0x83b83d,_0x31af2e){_0x83b83d=_0x83b83d-0x0;var _0x449dff=_0x197d[_0x83b83d];return _0x449dff;};'use strict';var multer=require(_0xd197('0x0'));var util=require(_0xd197('0x1'));var path=require(_0xd197('0x2'));var timeout=require('connect-timeout');var express=require(_0xd197('0x3'));var router=express[_0xd197('0x4')]();var auth=require(_0xd197('0x5'));var interaction=require(_0xd197('0x6'));var config=require('../../config/environment');var controller=require(_0xd197('0x7'));router[_0xd197('0x8')]('/',auth[_0xd197('0x9')](),controller['index']);router[_0xd197('0x8')](_0xd197('0xa'),auth[_0xd197('0x9')](),controller[_0xd197('0xb')]);router[_0xd197('0x8')](_0xd197('0xc'),auth[_0xd197('0x9')](),controller['download']);router['post']('/',auth[_0xd197('0x9')](),controller['create']);router[_0xd197('0xd')](_0xd197('0xa'),auth[_0xd197('0x9')](),controller[_0xd197('0xe')]);router[_0xd197('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xd197('0x10')]);module[_0xd197('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 1ca3261..f1fc984 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 _0x1be4=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x3e0526,_0x1ec53a){var _0x10234c=function(_0x292860){while(--_0x292860){_0x3e0526['push'](_0x3e0526['shift']());}};_0x10234c(++_0x1ec53a);}(_0x1be4,0x129));var _0x41be=function(_0x491faa,_0x4f2907){_0x491faa=_0x491faa-0x0;var _0x414440=_0x1be4[_0x491faa];return _0x414440;};'use strict';var Sequelize=require(_0x41be('0x0'));module[_0x41be('0x1')]={'field':{'type':Sequelize[_0x41be('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x41be('0x3')]},'groupBy':{'type':Sequelize[_0x41be('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x41be('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xc8bc=['exports','STRING','BOOLEAN'];(function(_0x377f50,_0x5589ba){var _0x14a9d2=function(_0x4ab38b){while(--_0x4ab38b){_0x377f50['push'](_0x377f50['shift']());}};_0x14a9d2(++_0x5589ba);}(_0xc8bc,0xf3));var _0xcc8b=function(_0x2b9cf5,_0x2a7804){_0x2b9cf5=_0x2b9cf5-0x0;var _0xd0cf15=_0xc8bc[_0x2b9cf5];return _0xd0cf15;};'use strict';var Sequelize=require('sequelize');module[_0xcc8b('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xcc8b('0x1')]},'function':{'type':Sequelize[_0xcc8b('0x1')]},'format':{'type':Sequelize[_0xcc8b('0x1')]},'groupBy':{'type':Sequelize[_0xcc8b('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xcc8b('0x1')]},'custom':{'type':Sequelize[_0xcc8b('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index e6847dd..b8693e4 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 _0xa5c4=['findOne','sequelize','CustomReportId','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','save','update','destroy','error','stack','name','index','AnalyticFieldReport','rawAttributes','query','keys','attributes','fields','length','model','nolimit','order','sort','where','filters','pick','filter','map','type','key','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','intersection','merge','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xa5c4,0x18e));var _0x4a5c=function(_0x3e961c,_0x5747e7){_0x3e961c=_0x3e961c-0x0;var _0x474f9c=_0xa5c4[_0x3e961c];return _0x474f9c;};'use strict';var pdf=require(_0x4a5c('0x0'));var emlformat=require(_0x4a5c('0x1'));var rimraf=require(_0x4a5c('0x2'));var zipdir=require(_0x4a5c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4a5c('0x4'));var moment=require(_0x4a5c('0x5'));var BPromise=require(_0x4a5c('0x6'));var Mustache=require(_0x4a5c('0x7'));var util=require(_0x4a5c('0x8'));var path=require(_0x4a5c('0x9'));var sox=require('sox');var csv=require(_0x4a5c('0xa'));var ejs=require(_0x4a5c('0xb'));var fs=require('fs');var _=require(_0x4a5c('0xc'));var squel=require(_0x4a5c('0xd'));var crypto=require('crypto');var jsforce=require(_0x4a5c('0xe'));var deskjs=require(_0x4a5c('0xf'));var toCsv=require(_0x4a5c('0xa'));var querystring=require(_0x4a5c('0x10'));var Papa=require(_0x4a5c('0x11'));var Redis=require('ioredis');var authService=require(_0x4a5c('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4a5c('0x13'))(_0x4a5c('0x14'));var utils=require(_0x4a5c('0x15'));var config=require('../../config/environment');var db=require(_0x4a5c('0x16'))['db'];function respondWithStatusCode(_0xf7e5ef,_0x398c36){_0x398c36=_0x398c36||0xcc;return function(_0x21b859){if(_0x21b859){return _0xf7e5ef['sendStatus'](_0x398c36);}return _0xf7e5ef[_0x4a5c('0x17')](_0x398c36)[_0x4a5c('0x18')]();};}function respondWithResult(_0x38e37e,_0x483e7a){_0x483e7a=_0x483e7a||0xc8;return function(_0x75cc8){if(_0x75cc8){return _0x38e37e[_0x4a5c('0x17')](_0x483e7a)[_0x4a5c('0x19')](_0x75cc8);}};}function respondWithFilteredResult(_0x59664c,_0x3f5e51){return function(_0x224d96){if(_0x224d96){var _0x5567db=_0x224d96[_0x4a5c('0x1a')],_0x449727=_0x3f5e51[_0x4a5c('0x1b')],_0x3096d8=_0x3f5e51[_0x4a5c('0x1b')]+_0x3f5e51[_0x4a5c('0x1c')],_0x258cce;if(_0x3096d8>=_0x5567db){_0x3096d8=_0x5567db;_0x258cce=0xc8;}else{_0x258cce=0xce;}_0x59664c['status'](_0x258cce);return _0x59664c['set'](_0x4a5c('0x1d'),_0x449727+'-'+_0x3096d8+'/'+_0x5567db)['json'](_0x224d96);}return null;};}function patchUpdates(_0x49ff7d){return function(_0x256c21){try{jsonpatch[_0x4a5c('0x1e')](_0x256c21,_0x49ff7d,!![]);}catch(_0x18b147){return BPromise['reject'](_0x18b147);}return _0x256c21[_0x4a5c('0x1f')]();};}function saveUpdates(_0x55d638,_0x216678){return function(_0x3a80f4){if(_0x3a80f4){return _0x3a80f4[_0x4a5c('0x20')](_0x55d638)['then'](function(_0x5c9be8){return _0x5c9be8;});}return null;};}function removeEntity(_0x20a86c,_0x4add00){return function(_0x3b80e4){if(_0x3b80e4){return _0x3b80e4[_0x4a5c('0x21')]()['then'](function(){_0x20a86c[_0x4a5c('0x17')](0xcc)[_0x4a5c('0x18')]();});}};}function handleEntityNotFound(_0x144cf9,_0x17c6e7){return function(_0x271c48){if(!_0x271c48){_0x144cf9['sendStatus'](0x194);}return _0x271c48;};}function handleError(_0x3025ac,_0x4b6b8f){_0x4b6b8f=_0x4b6b8f||0x1f4;return function(_0x5dec75){logger[_0x4a5c('0x22')](_0x5dec75[_0x4a5c('0x23')]);if(_0x5dec75['name']){delete _0x5dec75[_0x4a5c('0x24')];}_0x3025ac[_0x4a5c('0x17')](_0x4b6b8f)['send'](_0x5dec75);};}exports[_0x4a5c('0x25')]=function(_0x1c48e7,_0x449b43){var _0x559a71={},_0x57cc83={},_0x1b8395={'count':0x0,'rows':[]};var _0x5ef0bb=db[_0x4a5c('0x26')][_0x4a5c('0x27')];_0x57cc83['model']=_['keys'](_0x5ef0bb);_0x57cc83[_0x4a5c('0x28')]=_[_0x4a5c('0x29')](_0x1c48e7[_0x4a5c('0x28')]);_0x57cc83['filters']=_['intersection'](_0x57cc83['model'],_0x57cc83[_0x4a5c('0x28')]);_0x559a71[_0x4a5c('0x2a')]=_['intersection'](_0x57cc83['model'],qs['fields'](_0x1c48e7['query'][_0x4a5c('0x2b')]));_0x559a71['attributes']=_0x559a71[_0x4a5c('0x2a')][_0x4a5c('0x2c')]?_0x559a71[_0x4a5c('0x2a')]:_0x57cc83[_0x4a5c('0x2d')];if(!_0x1c48e7[_0x4a5c('0x28')]['hasOwnProperty'](_0x4a5c('0x2e'))){_0x559a71[_0x4a5c('0x1c')]=qs['limit'](_0x1c48e7['query'][_0x4a5c('0x1c')]);_0x559a71[_0x4a5c('0x1b')]=qs[_0x4a5c('0x1b')](_0x1c48e7[_0x4a5c('0x28')][_0x4a5c('0x1b')]);}_0x559a71[_0x4a5c('0x2f')]=qs[_0x4a5c('0x30')](_0x1c48e7[_0x4a5c('0x28')][_0x4a5c('0x30')]);_0x559a71[_0x4a5c('0x31')]=qs[_0x4a5c('0x32')](_[_0x4a5c('0x33')](_0x1c48e7[_0x4a5c('0x28')],_0x57cc83['filters']));if(_0x1c48e7[_0x4a5c('0x28')][_0x4a5c('0x34')]){_0x559a71[_0x4a5c('0x31')]=_['merge'](_0x559a71[_0x4a5c('0x31')],{'$or':_[_0x4a5c('0x35')](_0x5ef0bb,function(_0x291072){if(_0x291072[_0x4a5c('0x36')][_0x4a5c('0x37')]!==_0x4a5c('0x38')){var _0x409ea7={};_0x409ea7[_0x291072['field']]={'$like':'%'+_0x1c48e7['query']['filter']+'%'};return _0x409ea7;}})});}_0x559a71=_['merge']({},_0x559a71,_0x1c48e7[_0x4a5c('0x39')]);var _0x45ba98={'where':_0x559a71[_0x4a5c('0x31')]};return db[_0x4a5c('0x26')][_0x4a5c('0x1a')](_0x45ba98)[_0x4a5c('0x3a')](function(_0x3907d8){_0x1b8395['count']=_0x3907d8;if(_0x1c48e7[_0x4a5c('0x28')][_0x4a5c('0x3b')]){_0x559a71[_0x4a5c('0x3c')]=[{'all':!![]}];}return db[_0x4a5c('0x26')][_0x4a5c('0x3d')](_0x559a71);})[_0x4a5c('0x3a')](function(_0x21687c){_0x1b8395[_0x4a5c('0x3e')]=_0x21687c;return _0x1b8395;})[_0x4a5c('0x3a')](respondWithFilteredResult(_0x449b43,_0x559a71))[_0x4a5c('0x3f')](handleError(_0x449b43,null));};exports[_0x4a5c('0x40')]=function(_0x165cd0,_0x551c90){var _0x1bbc33={'raw':![],'where':{'id':_0x165cd0[_0x4a5c('0x41')]['id']}},_0x5df8c5={};_0x5df8c5['model']=_[_0x4a5c('0x29')](db[_0x4a5c('0x26')][_0x4a5c('0x27')]);_0x5df8c5[_0x4a5c('0x28')]=_[_0x4a5c('0x29')](_0x165cd0['query']);_0x5df8c5[_0x4a5c('0x32')]=_['intersection'](_0x5df8c5[_0x4a5c('0x2d')],_0x5df8c5[_0x4a5c('0x28')]);_0x1bbc33['attributes']=_[_0x4a5c('0x42')](_0x5df8c5['model'],qs[_0x4a5c('0x2b')](_0x165cd0[_0x4a5c('0x28')][_0x4a5c('0x2b')]));_0x1bbc33[_0x4a5c('0x2a')]=_0x1bbc33[_0x4a5c('0x2a')][_0x4a5c('0x2c')]?_0x1bbc33['attributes']:_0x5df8c5[_0x4a5c('0x2d')];if(_0x165cd0['query'][_0x4a5c('0x3b')]){_0x1bbc33[_0x4a5c('0x3c')]=[{'all':!![]}];}_0x1bbc33=_[_0x4a5c('0x43')]({},_0x1bbc33,_0x165cd0['options']);return db['AnalyticFieldReport'][_0x4a5c('0x44')](_0x1bbc33)['then'](handleEntityNotFound(_0x551c90,null))[_0x4a5c('0x3a')](respondWithResult(_0x551c90,null))[_0x4a5c('0x3f')](handleError(_0x551c90,null));};exports[_0x4a5c('0x45')]=function(_0x8ed76a,_0x310691){return db[_0x4a5c('0x26')][_0x4a5c('0x45')](_0x8ed76a[_0x4a5c('0x46')],{})['then'](respondWithResult(_0x310691,0xc9))[_0x4a5c('0x3f')](handleError(_0x310691,null));};exports[_0x4a5c('0x47')]=function(_0x304719,_0x39800b){return db[_0x4a5c('0x26')][_0x4a5c('0x47')](_0x304719[_0x4a5c('0x46')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x39800b,0xc9))[_0x4a5c('0x3f')](handleError(_0x39800b,null));};exports[_0x4a5c('0x20')]=function(_0x57d883,_0x4164dc){if(_0x57d883[_0x4a5c('0x46')]['id']){delete _0x57d883['body']['id'];}return db['AnalyticFieldReport'][_0x4a5c('0x44')]({'where':{'id':_0x57d883[_0x4a5c('0x41')]['id']}})[_0x4a5c('0x3a')](handleEntityNotFound(_0x4164dc,null))[_0x4a5c('0x3a')](saveUpdates(_0x57d883[_0x4a5c('0x46')],null))['then'](respondWithResult(_0x4164dc,null))[_0x4a5c('0x3f')](handleError(_0x4164dc,null));};exports[_0x4a5c('0x21')]=function(_0x453502,_0x15d26c){return db['AnalyticFieldReport'][_0x4a5c('0x44')]({'where':{'id':_0x453502[_0x4a5c('0x41')]['id']}})[_0x4a5c('0x3a')](handleEntityNotFound(_0x15d26c,null))['then'](removeEntity(_0x15d26c,null))['catch'](handleError(_0x15d26c,null));};exports[_0x4a5c('0x48')]=function(_0x4e2951,_0x546c32){return db[_0x4a5c('0x26')][_0x4a5c('0x21')]({'where':{'id':_0x4e2951[_0x4a5c('0x28')][_0x4a5c('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0x4a5c('0x3a')](respondWithResult(_0x546c32,0xcc))['catch'](handleError(_0x546c32,null));};exports[_0x4a5c('0x4a')]=function(_0x364572,_0x1d26f0,_0x31c077){return db[_0x4a5c('0x4b')][_0x4a5c('0x4c')]({'where':{'id':_0x364572[_0x4a5c('0x41')]['id']}})[_0x4a5c('0x3a')](handleEntityNotFound(_0x1d26f0,null))[_0x4a5c('0x3a')](function(_0x3b88ef){if(_0x3b88ef){return db[_0x4a5c('0x4d')]['transaction'](function(_0x2441b2){return db['AnalyticFieldReport'][_0x4a5c('0x21')]({'where':{'CustomReportId':_0x364572[_0x4a5c('0x41')]['id']},'transaction':_0x2441b2})[_0x4a5c('0x3a')](function(_0x515519){var _0x25d737=_[_0x4a5c('0x35')](_0x364572[_0x4a5c('0x46')],function(_0x15f0da){delete _0x15f0da['id'];_0x15f0da[_0x4a5c('0x4e')]=_0x364572[_0x4a5c('0x41')]['id'];return _0x15f0da;});return db[_0x4a5c('0x26')][_0x4a5c('0x47')](_0x25d737,{'transaction':_0x2441b2});});})['then'](function(){return db[_0x4a5c('0x26')][_0x4a5c('0x3d')]({'where':{'CustomReportId':_0x364572[_0x4a5c('0x41')]['id']}});});}})['then'](respondWithResult(_0x1d26f0,null))[_0x4a5c('0x3f')](handleError(_0x1d26f0,null));}; \ No newline at end of file +var _0xaa3c=['pick','filter','merge','map','key','VIRTUAL','options','count','includeAll','include','rows','params','length','find','catch','create','body','bulkCreate','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','then','destroy','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x58ea94,_0x2a61ce){var _0x445b60=function(_0x3847c4){while(--_0x3847c4){_0x58ea94['push'](_0x58ea94['shift']());}};_0x445b60(++_0x2a61ce);}(_0xaa3c,0xb3));var _0xcaa3=function(_0x4634ed,_0x2f8810){_0x4634ed=_0x4634ed-0x0;var _0x8b9861=_0xaa3c[_0x4634ed];return _0x8b9861;};'use strict';var pdf=require(_0xcaa3('0x0'));var emlformat=require(_0xcaa3('0x1'));var rimraf=require(_0xcaa3('0x2'));var zipdir=require(_0xcaa3('0x3'));var jsonpatch=require(_0xcaa3('0x4'));var rp=require(_0xcaa3('0x5'));var moment=require(_0xcaa3('0x6'));var BPromise=require(_0xcaa3('0x7'));var Mustache=require(_0xcaa3('0x8'));var util=require(_0xcaa3('0x9'));var path=require(_0xcaa3('0xa'));var sox=require('sox');var csv=require(_0xcaa3('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xcaa3('0xc'));var squel=require(_0xcaa3('0xd'));var crypto=require(_0xcaa3('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xcaa3('0xf'));var toCsv=require(_0xcaa3('0xb'));var querystring=require(_0xcaa3('0x10'));var Papa=require(_0xcaa3('0x11'));var Redis=require(_0xcaa3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xcaa3('0x13'));var hardwareService=require(_0xcaa3('0x14'));var logger=require('../../config/logger')(_0xcaa3('0x15'));var utils=require(_0xcaa3('0x16'));var config=require(_0xcaa3('0x17'));var db=require(_0xcaa3('0x18'))['db'];function respondWithStatusCode(_0x4119bb,_0x384795){_0x384795=_0x384795||0xcc;return function(_0x16d0a7){if(_0x16d0a7){return _0x4119bb[_0xcaa3('0x19')](_0x384795);}return _0x4119bb[_0xcaa3('0x1a')](_0x384795)[_0xcaa3('0x1b')]();};}function respondWithResult(_0x137140,_0xcab587){_0xcab587=_0xcab587||0xc8;return function(_0x4812c6){if(_0x4812c6){return _0x137140[_0xcaa3('0x1a')](_0xcab587)[_0xcaa3('0x1c')](_0x4812c6);}};}function respondWithFilteredResult(_0x3bfd12,_0x30404a){return function(_0x579103){if(_0x579103){var _0x2e56a9=_0x579103['count'],_0x41f930=_0x30404a[_0xcaa3('0x1d')],_0x39c489=_0x30404a['offset']+_0x30404a[_0xcaa3('0x1e')],_0x1eec1d;if(_0x39c489>=_0x2e56a9){_0x39c489=_0x2e56a9;_0x1eec1d=0xc8;}else{_0x1eec1d=0xce;}_0x3bfd12[_0xcaa3('0x1a')](_0x1eec1d);return _0x3bfd12[_0xcaa3('0x1f')](_0xcaa3('0x20'),_0x41f930+'-'+_0x39c489+'/'+_0x2e56a9)[_0xcaa3('0x1c')](_0x579103);}return null;};}function patchUpdates(_0x41e37d){return function(_0x17492c){try{jsonpatch['apply'](_0x17492c,_0x41e37d,!![]);}catch(_0x5aade8){return BPromise[_0xcaa3('0x21')](_0x5aade8);}return _0x17492c['save']();};}function saveUpdates(_0x4ff51c,_0x5ad36d){return function(_0x34acca){if(_0x34acca){return _0x34acca['update'](_0x4ff51c)[_0xcaa3('0x22')](function(_0x2b6fa2){return _0x2b6fa2;});}return null;};}function removeEntity(_0x4c035d,_0x14ae7a){return function(_0x26cca1){if(_0x26cca1){return _0x26cca1[_0xcaa3('0x23')]()[_0xcaa3('0x22')](function(){_0x4c035d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c355b,_0x498195){return function(_0x2c02ce){if(!_0x2c02ce){_0x3c355b[_0xcaa3('0x19')](0x194);}return _0x2c02ce;};}function handleError(_0x5bb6e1,_0x56e89e){_0x56e89e=_0x56e89e||0x1f4;return function(_0x925494){logger[_0xcaa3('0x24')](_0x925494[_0xcaa3('0x25')]);if(_0x925494[_0xcaa3('0x26')]){delete _0x925494[_0xcaa3('0x26')];}_0x5bb6e1[_0xcaa3('0x1a')](_0x56e89e)[_0xcaa3('0x27')](_0x925494);};}exports[_0xcaa3('0x28')]=function(_0x4068fe,_0x5245b8){var _0x35057e={},_0x143e2a={},_0xa29a25={'count':0x0,'rows':[]};var _0x1fa1d6=db[_0xcaa3('0x29')][_0xcaa3('0x2a')];_0x143e2a[_0xcaa3('0x2b')]=_[_0xcaa3('0x2c')](_0x1fa1d6);_0x143e2a['query']=_[_0xcaa3('0x2c')](_0x4068fe[_0xcaa3('0x2d')]);_0x143e2a['filters']=_['intersection'](_0x143e2a['model'],_0x143e2a[_0xcaa3('0x2d')]);_0x35057e['attributes']=_[_0xcaa3('0x2e')](_0x143e2a[_0xcaa3('0x2b')],qs[_0xcaa3('0x2f')](_0x4068fe[_0xcaa3('0x2d')][_0xcaa3('0x2f')]));_0x35057e[_0xcaa3('0x30')]=_0x35057e['attributes']['length']?_0x35057e[_0xcaa3('0x30')]:_0x143e2a[_0xcaa3('0x2b')];if(!_0x4068fe[_0xcaa3('0x2d')][_0xcaa3('0x31')](_0xcaa3('0x32'))){_0x35057e[_0xcaa3('0x1e')]=qs[_0xcaa3('0x1e')](_0x4068fe[_0xcaa3('0x2d')][_0xcaa3('0x1e')]);_0x35057e['offset']=qs[_0xcaa3('0x1d')](_0x4068fe[_0xcaa3('0x2d')][_0xcaa3('0x1d')]);}_0x35057e[_0xcaa3('0x33')]=qs[_0xcaa3('0x34')](_0x4068fe[_0xcaa3('0x2d')][_0xcaa3('0x34')]);_0x35057e[_0xcaa3('0x35')]=qs[_0xcaa3('0x36')](_[_0xcaa3('0x37')](_0x4068fe[_0xcaa3('0x2d')],_0x143e2a['filters']));if(_0x4068fe[_0xcaa3('0x2d')][_0xcaa3('0x38')]){_0x35057e[_0xcaa3('0x35')]=_[_0xcaa3('0x39')](_0x35057e[_0xcaa3('0x35')],{'$or':_[_0xcaa3('0x3a')](_0x1fa1d6,function(_0x1e0c89){if(_0x1e0c89['type'][_0xcaa3('0x3b')]!==_0xcaa3('0x3c')){var _0x46a440={};_0x46a440[_0x1e0c89['field']]={'$like':'%'+_0x4068fe[_0xcaa3('0x2d')][_0xcaa3('0x38')]+'%'};return _0x46a440;}})});}_0x35057e=_[_0xcaa3('0x39')]({},_0x35057e,_0x4068fe[_0xcaa3('0x3d')]);var _0xa560bd={'where':_0x35057e[_0xcaa3('0x35')]};return db[_0xcaa3('0x29')][_0xcaa3('0x3e')](_0xa560bd)[_0xcaa3('0x22')](function(_0x2bb91c){_0xa29a25[_0xcaa3('0x3e')]=_0x2bb91c;if(_0x4068fe[_0xcaa3('0x2d')][_0xcaa3('0x3f')]){_0x35057e[_0xcaa3('0x40')]=[{'all':!![]}];}return db[_0xcaa3('0x29')]['findAll'](_0x35057e);})[_0xcaa3('0x22')](function(_0x57c24d){_0xa29a25[_0xcaa3('0x41')]=_0x57c24d;return _0xa29a25;})['then'](respondWithFilteredResult(_0x5245b8,_0x35057e))['catch'](handleError(_0x5245b8,null));};exports['show']=function(_0xeef07c,_0x31c4fd){var _0x4f76ce={'raw':![],'where':{'id':_0xeef07c[_0xcaa3('0x42')]['id']}},_0x86b571={};_0x86b571['model']=_[_0xcaa3('0x2c')](db[_0xcaa3('0x29')]['rawAttributes']);_0x86b571[_0xcaa3('0x2d')]=_['keys'](_0xeef07c[_0xcaa3('0x2d')]);_0x86b571[_0xcaa3('0x36')]=_['intersection'](_0x86b571[_0xcaa3('0x2b')],_0x86b571['query']);_0x4f76ce[_0xcaa3('0x30')]=_['intersection'](_0x86b571[_0xcaa3('0x2b')],qs[_0xcaa3('0x2f')](_0xeef07c[_0xcaa3('0x2d')]['fields']));_0x4f76ce[_0xcaa3('0x30')]=_0x4f76ce[_0xcaa3('0x30')][_0xcaa3('0x43')]?_0x4f76ce[_0xcaa3('0x30')]:_0x86b571[_0xcaa3('0x2b')];if(_0xeef07c['query'][_0xcaa3('0x3f')]){_0x4f76ce[_0xcaa3('0x40')]=[{'all':!![]}];}_0x4f76ce=_['merge']({},_0x4f76ce,_0xeef07c['options']);return db[_0xcaa3('0x29')][_0xcaa3('0x44')](_0x4f76ce)[_0xcaa3('0x22')](handleEntityNotFound(_0x31c4fd,null))['then'](respondWithResult(_0x31c4fd,null))[_0xcaa3('0x45')](handleError(_0x31c4fd,null));};exports[_0xcaa3('0x46')]=function(_0xeb0df3,_0x5c7ba8){return db[_0xcaa3('0x29')][_0xcaa3('0x46')](_0xeb0df3[_0xcaa3('0x47')],{})['then'](respondWithResult(_0x5c7ba8,0xc9))[_0xcaa3('0x45')](handleError(_0x5c7ba8,null));};exports[_0xcaa3('0x48')]=function(_0x5124a4,_0x5b7ea0){return db[_0xcaa3('0x29')]['bulkCreate'](_0x5124a4[_0xcaa3('0x47')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5b7ea0,0xc9))[_0xcaa3('0x45')](handleError(_0x5b7ea0,null));};exports['update']=function(_0x19a45c,_0xb317bc){if(_0x19a45c['body']['id']){delete _0x19a45c[_0xcaa3('0x47')]['id'];}return db[_0xcaa3('0x29')][_0xcaa3('0x44')]({'where':{'id':_0x19a45c[_0xcaa3('0x42')]['id']}})[_0xcaa3('0x22')](handleEntityNotFound(_0xb317bc,null))['then'](saveUpdates(_0x19a45c[_0xcaa3('0x47')],null))[_0xcaa3('0x22')](respondWithResult(_0xb317bc,null))['catch'](handleError(_0xb317bc,null));};exports[_0xcaa3('0x23')]=function(_0x3086e6,_0x3e7822){return db[_0xcaa3('0x29')]['find']({'where':{'id':_0x3086e6['params']['id']}})[_0xcaa3('0x22')](handleEntityNotFound(_0x3e7822,null))['then'](removeEntity(_0x3e7822,null))[_0xcaa3('0x45')](handleError(_0x3e7822,null));};exports['bulkDestroy']=function(_0x5d241a,_0x2c75ff){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x5d241a[_0xcaa3('0x2d')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xcaa3('0x22')](respondWithResult(_0x2c75ff,0xcc))[_0xcaa3('0x45')](handleError(_0x2c75ff,null));};exports[_0xcaa3('0x49')]=function(_0x31955d,_0x238fb4,_0x4b7157){return db[_0xcaa3('0x4a')]['findOne']({'where':{'id':_0x31955d[_0xcaa3('0x42')]['id']}})[_0xcaa3('0x22')](handleEntityNotFound(_0x238fb4,null))[_0xcaa3('0x22')](function(_0x8d60d2){if(_0x8d60d2){return db[_0xcaa3('0x4b')][_0xcaa3('0x4c')](function(_0x1dc198){return db[_0xcaa3('0x29')]['destroy']({'where':{'CustomReportId':_0x31955d['params']['id']},'transaction':_0x1dc198})[_0xcaa3('0x22')](function(_0x56ce30){var _0x512e12=_[_0xcaa3('0x3a')](_0x31955d[_0xcaa3('0x47')],function(_0x1795ce){delete _0x1795ce['id'];_0x1795ce[_0xcaa3('0x4d')]=_0x31955d[_0xcaa3('0x42')]['id'];return _0x1795ce;});return db[_0xcaa3('0x29')][_0xcaa3('0x48')](_0x512e12,{'transaction':_0x1dc198});});})[_0xcaa3('0x22')](function(){return db[_0xcaa3('0x29')]['findAll']({'where':{'CustomReportId':_0x31955d[_0xcaa3('0x42')]['id']}});});}})[_0xcaa3('0x22')](respondWithResult(_0x238fb4,null))['catch'](handleError(_0x238fb4,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 4023a4d..3041c89 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 _0xd5ec=['request-promise','path','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','util','../../config/logger','api','moment','bluebird'];(function(_0x55d3f5,_0x8b6c53){var _0x4c4173=function(_0x28210f){while(--_0x28210f){_0x55d3f5['push'](_0x55d3f5['shift']());}};_0x4c4173(++_0x8b6c53);}(_0xd5ec,0x150));var _0xcd5e=function(_0x3a07c1,_0x34d57f){_0x3a07c1=_0x3a07c1-0x0;var _0x2bbe15=_0xd5ec[_0x3a07c1];return _0x2bbe15;};'use strict';var _=require('lodash');var util=require(_0xcd5e('0x0'));var logger=require(_0xcd5e('0x1'))(_0xcd5e('0x2'));var moment=require(_0xcd5e('0x3'));var BPromise=require(_0xcd5e('0x4'));var rp=require(_0xcd5e('0x5'));var fs=require('fs');var path=require(_0xcd5e('0x6'));var rimraf=require('rimraf');var config=require(_0xcd5e('0x7'));var attributes=require(_0xcd5e('0x8'));module['exports']=function(_0x4e7e5b,_0x47fcda){return _0x4e7e5b[_0xcd5e('0x9')](_0xcd5e('0xa'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7945=['analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x7945,0x112));var _0x5794=function(_0x440c74,_0x3adb4){_0x440c74=_0x440c74-0x0;var _0x30e607=_0x7945[_0x440c74];return _0x30e607;};'use strict';var _=require(_0x5794('0x0'));var util=require(_0x5794('0x1'));var logger=require(_0x5794('0x2'))(_0x5794('0x3'));var moment=require(_0x5794('0x4'));var BPromise=require(_0x5794('0x5'));var rp=require(_0x5794('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5794('0x7'));var config=require(_0x5794('0x8'));var attributes=require(_0x5794('0x9'));module['exports']=function(_0x27d495,_0x44a1b3){return _0x27d495[_0x5794('0xa')](_0x5794('0xb'),attributes,{'tableName':_0x5794('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index a5ac66e..6a857f6 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 _0xe49a=['AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','debug'];(function(_0x28b4fb,_0x59d50c){var _0x55273a=function(_0x1510e5){while(--_0x1510e5){_0x28b4fb['push'](_0x28b4fb['shift']());}};_0x55273a(++_0x59d50c);}(_0xe49a,0xd7));var _0xae49=function(_0x5d4204,_0x104ae9){_0x5d4204=_0x5d4204-0x0;var _0x13b2c5=_0xe49a[_0x5d4204];return _0x13b2c5;};'use strict';var _=require('lodash');var util=require(_0xae49('0x0'));var moment=require(_0xae49('0x1'));var BPromise=require(_0xae49('0x2'));var rs=require(_0xae49('0x3'));var fs=require('fs');var Redis=require(_0xae49('0x4'));var db=require(_0xae49('0x5'))['db'];var utils=require(_0xae49('0x6'));var logger=require('../../config/logger')(_0xae49('0x7'));var config=require(_0xae49('0x8'));var jayson=require(_0xae49('0x9'));var client=jayson['client'][_0xae49('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49eecf,_0x63a8be,_0x1e33f6){return new BPromise(function(_0x4480bf,_0x476f2a){return client[_0xae49('0xb')](_0x49eecf,_0x1e33f6)[_0xae49('0xc')](function(_0x408685){logger['info'](_0xae49('0xd'),_0x63a8be,'request\x20sent');logger[_0xae49('0xe')](_0xae49('0xf'),_0x63a8be,_0xae49('0x10'),JSON['stringify'](_0x408685));if(_0x408685[_0xae49('0x11')]){if(_0x408685[_0xae49('0x11')][_0xae49('0x12')]===0x1f4){logger[_0xae49('0x11')](_0xae49('0xd'),_0x63a8be,_0x408685[_0xae49('0x11')]['message']);return _0x476f2a(_0x408685['error'][_0xae49('0x13')]);}logger[_0xae49('0x11')](_0xae49('0xd'),_0x63a8be,_0x408685[_0xae49('0x11')][_0xae49('0x13')]);return _0x4480bf(_0x408685[_0xae49('0x11')][_0xae49('0x13')]);}else{logger[_0xae49('0x14')](_0xae49('0xd'),_0x63a8be,_0xae49('0x10'));_0x4480bf(_0x408685[_0xae49('0x15')]['message']);}})[_0xae49('0x16')](function(_0x2d5dcb){logger[_0xae49('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x63a8be,_0x2d5dcb);_0x476f2a(_0x2d5dcb);});});} \ No newline at end of file +var _0x565f=['error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x291fc4,_0x48a87e){var _0x547c5f=function(_0x2738bb){while(--_0x2738bb){_0x291fc4['push'](_0x291fc4['shift']());}};_0x547c5f(++_0x48a87e);}(_0x565f,0x68));var _0xf565=function(_0x39a6fb,_0x352c04){_0x39a6fb=_0x39a6fb-0x0;var _0x52538d=_0x565f[_0x39a6fb];return _0x52538d;};'use strict';var _=require('lodash');var util=require(_0xf565('0x0'));var moment=require(_0xf565('0x1'));var BPromise=require(_0xf565('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf565('0x3'));var db=require(_0xf565('0x4'))['db'];var utils=require(_0xf565('0x5'));var logger=require(_0xf565('0x6'))(_0xf565('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf565('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4cc0ea,_0x2d3b27,_0x45db1b){return new BPromise(function(_0x43b686,_0x55685c){return client[_0xf565('0x9')](_0x4cc0ea,_0x45db1b)['then'](function(_0x35377e){logger['info'](_0xf565('0xa'),_0x2d3b27,_0xf565('0xb'));logger[_0xf565('0xc')](_0xf565('0xd'),_0x2d3b27,_0xf565('0xb'),JSON[_0xf565('0xe')](_0x35377e));if(_0x35377e['error']){if(_0x35377e['error'][_0xf565('0xf')]===0x1f4){logger[_0xf565('0x10')](_0xf565('0xa'),_0x2d3b27,_0x35377e[_0xf565('0x10')][_0xf565('0x11')]);return _0x55685c(_0x35377e[_0xf565('0x10')][_0xf565('0x11')]);}logger[_0xf565('0x10')](_0xf565('0xa'),_0x2d3b27,_0x35377e[_0xf565('0x10')]['message']);return _0x43b686(_0x35377e[_0xf565('0x10')][_0xf565('0x11')]);}else{logger['info'](_0xf565('0xa'),_0x2d3b27,_0xf565('0xb'));_0x43b686(_0x35377e[_0xf565('0x12')][_0xf565('0x11')]);}})[_0xf565('0x13')](function(_0x509ff4){logger[_0xf565('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2d3b27,_0x509ff4);_0x55685c(_0x509ff4);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index bb16631..adee24a 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 _0x9354=['../../components/auth/service','../../components/interaction/service','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','show','post','create','/create_many','bulkCreate','/:id/create_many','delete','/destroy_many','bulkDestroy','destroy','exports','util','path','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9354,0x96));var _0x4935=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x9354[_0x138adb];return _0x1b27f2;};'use strict';var multer=require('multer');var util=require(_0x4935('0x0'));var path=require(_0x4935('0x1'));var timeout=require('connect-timeout');var express=require(_0x4935('0x2'));var router=express[_0x4935('0x3')]();var auth=require(_0x4935('0x4'));var interaction=require(_0x4935('0x5'));var config=require('../../config/environment');var controller=require(_0x4935('0x6'));router[_0x4935('0x7')]('/',auth[_0x4935('0x8')](),controller[_0x4935('0x9')]);router[_0x4935('0x7')](_0x4935('0xa'),auth[_0x4935('0x8')](),controller[_0x4935('0xb')]);router[_0x4935('0xc')]('/',auth['isAuthenticated'](),controller[_0x4935('0xd')]);router['post'](_0x4935('0xe'),auth[_0x4935('0x8')](),controller[_0x4935('0xf')]);router[_0x4935('0xc')](_0x4935('0x10'),auth[_0x4935('0x8')](),controller['addFields']);router['put'](_0x4935('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x4935('0x11')](_0x4935('0x12'),auth[_0x4935('0x8')](),controller[_0x4935('0x13')]);router[_0x4935('0x11')](_0x4935('0xa'),auth[_0x4935('0x8')](),controller[_0x4935('0x14')]);module[_0x4935('0x15')]=router; \ No newline at end of file +var _0xca66=['exports','multer','connect-timeout','express','Router','../../components/interaction/service','./analyticFieldReport.controller','isAuthenticated','index','get','/:id','show','post','create','/create_many','bulkCreate','/:id/create_many','addFields','put','update','delete','bulkDestroy','destroy'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xca66,0x8b));var _0x6ca6=function(_0x1f6aca,_0x4a06bc){_0x1f6aca=_0x1f6aca-0x0;var _0x1908ed=_0xca66[_0x1f6aca];return _0x1908ed;};'use strict';var multer=require(_0x6ca6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ca6('0x1'));var express=require(_0x6ca6('0x2'));var router=express[_0x6ca6('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x6ca6('0x4'));var config=require('../../config/environment');var controller=require(_0x6ca6('0x5'));router['get']('/',auth[_0x6ca6('0x6')](),controller[_0x6ca6('0x7')]);router[_0x6ca6('0x8')](_0x6ca6('0x9'),auth[_0x6ca6('0x6')](),controller[_0x6ca6('0xa')]);router[_0x6ca6('0xb')]('/',auth['isAuthenticated'](),controller[_0x6ca6('0xc')]);router[_0x6ca6('0xb')](_0x6ca6('0xd'),auth[_0x6ca6('0x6')](),controller[_0x6ca6('0xe')]);router[_0x6ca6('0xb')](_0x6ca6('0xf'),auth['isAuthenticated'](),controller[_0x6ca6('0x10')]);router[_0x6ca6('0x11')](_0x6ca6('0x9'),auth[_0x6ca6('0x6')](),controller[_0x6ca6('0x12')]);router[_0x6ca6('0x13')]('/destroy_many',auth[_0x6ca6('0x6')](),controller[_0x6ca6('0x14')]);router['delete'](_0x6ca6('0x9'),auth[_0x6ca6('0x6')](),controller[_0x6ca6('0x15')]);module[_0x6ca6('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 4825f39..20a298b 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 _0x9423=['STRING','name','TEXT','sequelize','exports'];(function(_0x30e6ca,_0x3eda61){var _0x3cb1bf=function(_0x2ebd48){while(--_0x2ebd48){_0x30e6ca['push'](_0x30e6ca['shift']());}};_0x3cb1bf(++_0x3eda61);}(_0x9423,0x1cf));var _0x3942=function(_0x2aac8e,_0x329c3e){_0x2aac8e=_0x2aac8e-0x0;var _0xa93531=_0x9423[_0x2aac8e];return _0xa93531;};'use strict';var Sequelize=require(_0x3942('0x0'));module[_0x3942('0x1')]={'name':{'type':Sequelize[_0x3942('0x2')],'allowNull':![],'unique':_0x3942('0x3')},'table':{'type':Sequelize[_0x3942('0x2')]},'metric':{'type':Sequelize[_0x3942('0x4')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4363=['TEXT','sequelize','STRING','name'];(function(_0x26482d,_0x218f4d){var _0x460877=function(_0x593c54){while(--_0x593c54){_0x26482d['push'](_0x26482d['shift']());}};_0x460877(++_0x218f4d);}(_0x4363,0xdd));var _0x3436=function(_0x41cf04,_0x41e49b){_0x41cf04=_0x41cf04-0x0;var _0x270ada=_0x4363[_0x41cf04];return _0x270ada;};'use strict';var Sequelize=require(_0x3436('0x0'));module['exports']={'name':{'type':Sequelize[_0x3436('0x1')],'allowNull':![],'unique':_0x3436('0x2')},'table':{'type':Sequelize[_0x3436('0x1')]},'metric':{'type':Sequelize[_0x3436('0x3')]},'description':{'type':Sequelize[_0x3436('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 1d8a2ec..35cafbc 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 _0x1b7a=['order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','catch','show','params','AnalyticMetric','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','count','offset','Content-Range','json','apply','reject','save','update','destroy','then','get','Metrics','UserProfileResource','sendStatus','error','stack','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x1b7a,0x69));var _0xa1b7=function(_0x2fb9fb,_0x497919){_0x2fb9fb=_0x2fb9fb-0x0;var _0x26494d=_0x1b7a[_0x2fb9fb];return _0x26494d;};'use strict';var pdf=require(_0xa1b7('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa1b7('0x1'));var jsonpatch=require(_0xa1b7('0x2'));var rp=require(_0xa1b7('0x3'));var moment=require(_0xa1b7('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa1b7('0x5'));var path=require('path');var sox=require(_0xa1b7('0x6'));var csv=require(_0xa1b7('0x7'));var ejs=require(_0xa1b7('0x8'));var fs=require('fs');var _=require(_0xa1b7('0x9'));var squel=require(_0xa1b7('0xa'));var crypto=require(_0xa1b7('0xb'));var jsforce=require(_0xa1b7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa1b7('0x7'));var querystring=require(_0xa1b7('0xd'));var Papa=require(_0xa1b7('0xe'));var Redis=require(_0xa1b7('0xf'));var authService=require(_0xa1b7('0x10'));var qs=require(_0xa1b7('0x11'));var hardwareService=require(_0xa1b7('0x12'));var logger=require(_0xa1b7('0x13'))(_0xa1b7('0x14'));var utils=require(_0xa1b7('0x15'));var config=require('../../config/environment');var db=require(_0xa1b7('0x16'))['db'];function respondWithStatusCode(_0xa4910c,_0x39af03){_0x39af03=_0x39af03||0xcc;return function(_0x1c408e){if(_0x1c408e){return _0xa4910c['sendStatus'](_0x39af03);}return _0xa4910c[_0xa1b7('0x17')](_0x39af03)['end']();};}function respondWithResult(_0x4d7eba,_0x318895){_0x318895=_0x318895||0xc8;return function(_0x54bf7e){if(_0x54bf7e){return _0x4d7eba[_0xa1b7('0x17')](_0x318895)['json'](_0x54bf7e);}};}function respondWithFilteredResult(_0xa301ea,_0x3bbd3b){return function(_0x2247e2){if(_0x2247e2){var _0x108aea=_0x2247e2[_0xa1b7('0x18')],_0x1213c0=_0x3bbd3b[_0xa1b7('0x19')],_0x56b387=_0x3bbd3b[_0xa1b7('0x19')]+_0x3bbd3b['limit'],_0x2e4bd9;if(_0x56b387>=_0x108aea){_0x56b387=_0x108aea;_0x2e4bd9=0xc8;}else{_0x2e4bd9=0xce;}_0xa301ea[_0xa1b7('0x17')](_0x2e4bd9);return _0xa301ea['set'](_0xa1b7('0x1a'),_0x1213c0+'-'+_0x56b387+'/'+_0x108aea)[_0xa1b7('0x1b')](_0x2247e2);}return null;};}function patchUpdates(_0x13b9af){return function(_0x2f7eb0){try{jsonpatch[_0xa1b7('0x1c')](_0x2f7eb0,_0x13b9af,!![]);}catch(_0xe9f5df){return BPromise[_0xa1b7('0x1d')](_0xe9f5df);}return _0x2f7eb0[_0xa1b7('0x1e')]();};}function saveUpdates(_0x29ed6a,_0x18fe47){return function(_0x40ce1d){if(_0x40ce1d){return _0x40ce1d[_0xa1b7('0x1f')](_0x29ed6a)['then'](function(_0x35e0bc){return _0x35e0bc;});}return null;};}function removeEntity(_0x38066d,_0x2761fc){return function(_0x15d1bc){if(_0x15d1bc){return _0x15d1bc[_0xa1b7('0x20')]()[_0xa1b7('0x21')](function(){var _0x47d8db=_0x15d1bc[_0xa1b7('0x22')]({'plain':!![]});var _0x279ed9=_0xa1b7('0x23');return db[_0xa1b7('0x24')][_0xa1b7('0x20')]({'where':{'type':_0x279ed9,'resourceId':_0x47d8db['id']}})[_0xa1b7('0x21')](function(){return _0x15d1bc;});})[_0xa1b7('0x21')](function(){_0x38066d[_0xa1b7('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22e694,_0x4870c1){return function(_0x3376fa){if(!_0x3376fa){_0x22e694[_0xa1b7('0x25')](0x194);}return _0x3376fa;};}function handleError(_0x4de6dc,_0x58ddaa){_0x58ddaa=_0x58ddaa||0x1f4;return function(_0x46318f){logger[_0xa1b7('0x26')](_0x46318f[_0xa1b7('0x27')]);if(_0x46318f[_0xa1b7('0x28')]){delete _0x46318f[_0xa1b7('0x28')];}_0x4de6dc[_0xa1b7('0x17')](_0x58ddaa)['send'](_0x46318f);};}exports[_0xa1b7('0x29')]=function(_0xa57e8e,_0x5f2eb7){var _0x4102c9={},_0xd1b95={},_0x21ae76={'count':0x0,'rows':[]};var _0x3eb1fd=db['AnalyticMetric'][_0xa1b7('0x2a')];_0xd1b95[_0xa1b7('0x2b')]=_[_0xa1b7('0x2c')](_0x3eb1fd);_0xd1b95[_0xa1b7('0x2d')]=_[_0xa1b7('0x2c')](_0xa57e8e[_0xa1b7('0x2d')]);_0xd1b95[_0xa1b7('0x2e')]=_[_0xa1b7('0x2f')](_0xd1b95['model'],_0xd1b95[_0xa1b7('0x2d')]);_0x4102c9[_0xa1b7('0x30')]=_[_0xa1b7('0x2f')](_0xd1b95[_0xa1b7('0x2b')],qs[_0xa1b7('0x31')](_0xa57e8e[_0xa1b7('0x2d')][_0xa1b7('0x31')]));_0x4102c9[_0xa1b7('0x30')]=_0x4102c9['attributes'][_0xa1b7('0x32')]?_0x4102c9[_0xa1b7('0x30')]:_0xd1b95[_0xa1b7('0x2b')];if(!_0xa57e8e[_0xa1b7('0x2d')]['hasOwnProperty'](_0xa1b7('0x33'))){_0x4102c9[_0xa1b7('0x34')]=qs[_0xa1b7('0x34')](_0xa57e8e['query'][_0xa1b7('0x34')]);_0x4102c9[_0xa1b7('0x19')]=qs['offset'](_0xa57e8e[_0xa1b7('0x2d')][_0xa1b7('0x19')]);}_0x4102c9[_0xa1b7('0x35')]=qs[_0xa1b7('0x36')](_0xa57e8e[_0xa1b7('0x2d')][_0xa1b7('0x36')]);_0x4102c9[_0xa1b7('0x37')]=qs['filters'](_['pick'](_0xa57e8e[_0xa1b7('0x2d')],_0xd1b95['filters']));if(_0xa57e8e[_0xa1b7('0x2d')][_0xa1b7('0x38')]){_0x4102c9[_0xa1b7('0x37')]=_[_0xa1b7('0x39')](_0x4102c9[_0xa1b7('0x37')],{'$or':_[_0xa1b7('0x3a')](_0x3eb1fd,function(_0x1e0d06){if(_0x1e0d06[_0xa1b7('0x3b')][_0xa1b7('0x3c')]!==_0xa1b7('0x3d')){var _0x4dd10b={};_0x4dd10b[_0x1e0d06[_0xa1b7('0x3e')]]={'$like':'%'+_0xa57e8e[_0xa1b7('0x2d')][_0xa1b7('0x38')]+'%'};return _0x4dd10b;}})});}_0x4102c9=_['merge']({},_0x4102c9,_0xa57e8e[_0xa1b7('0x3f')]);var _0x3f6bd1={'where':_0x4102c9[_0xa1b7('0x37')]};return db['AnalyticMetric'][_0xa1b7('0x18')](_0x3f6bd1)[_0xa1b7('0x21')](function(_0x4c9a65){_0x21ae76[_0xa1b7('0x18')]=_0x4c9a65;if(_0xa57e8e[_0xa1b7('0x2d')]['includeAll']){_0x4102c9[_0xa1b7('0x40')]=[{'all':!![]}];}return db['AnalyticMetric'][_0xa1b7('0x41')](_0x4102c9);})['then'](function(_0x465854){_0x21ae76['rows']=_0x465854;return _0x21ae76;})[_0xa1b7('0x21')](respondWithFilteredResult(_0x5f2eb7,_0x4102c9))[_0xa1b7('0x42')](handleError(_0x5f2eb7,null));};exports[_0xa1b7('0x43')]=function(_0x1afb33,_0x547c08){var _0x4ab476={'raw':!![],'where':{'id':_0x1afb33[_0xa1b7('0x44')]['id']}},_0x30e014={};_0x30e014[_0xa1b7('0x2b')]=_['keys'](db[_0xa1b7('0x45')][_0xa1b7('0x2a')]);_0x30e014[_0xa1b7('0x2d')]=_['keys'](_0x1afb33[_0xa1b7('0x2d')]);_0x30e014['filters']=_[_0xa1b7('0x2f')](_0x30e014[_0xa1b7('0x2b')],_0x30e014[_0xa1b7('0x2d')]);_0x4ab476[_0xa1b7('0x30')]=_[_0xa1b7('0x2f')](_0x30e014[_0xa1b7('0x2b')],qs[_0xa1b7('0x31')](_0x1afb33[_0xa1b7('0x2d')][_0xa1b7('0x31')]));_0x4ab476[_0xa1b7('0x30')]=_0x4ab476[_0xa1b7('0x30')][_0xa1b7('0x32')]?_0x4ab476['attributes']:_0x30e014[_0xa1b7('0x2b')];if(_0x1afb33[_0xa1b7('0x2d')][_0xa1b7('0x46')]){_0x4ab476[_0xa1b7('0x40')]=[{'all':!![]}];}_0x4ab476=_[_0xa1b7('0x39')]({},_0x4ab476,_0x1afb33[_0xa1b7('0x3f')]);return db[_0xa1b7('0x45')]['find'](_0x4ab476)['then'](handleEntityNotFound(_0x547c08,null))['then'](respondWithResult(_0x547c08,null))[_0xa1b7('0x42')](handleError(_0x547c08,null));};exports['create']=function(_0x34c11a,_0x1e3039){return db[_0xa1b7('0x45')][_0xa1b7('0x47')](_0x34c11a['body'],{})[_0xa1b7('0x21')](function(_0x122045){var _0xc37fb7=_0x34c11a[_0xa1b7('0x48')][_0xa1b7('0x22')]({'plain':!![]});if(!_0xc37fb7)throw new Error(_0xa1b7('0x49'));if(_0xc37fb7['role']===_0xa1b7('0x48')){var _0x4ec6ab=_0x122045['get']({'plain':!![]});var _0x4867f8=_0xa1b7('0x23');return db[_0xa1b7('0x4a')]['find']({'where':{'name':_0x4867f8,'userProfileId':_0xc37fb7[_0xa1b7('0x4b')]},'raw':!![]})[_0xa1b7('0x21')](function(_0x335e38){if(_0x335e38&&_0x335e38[_0xa1b7('0x4c')]===0x0){return db['UserProfileResource'][_0xa1b7('0x47')]({'name':_0x4ec6ab[_0xa1b7('0x28')],'resourceId':_0x4ec6ab['id'],'type':_0x335e38[_0xa1b7('0x28')],'sectionId':_0x335e38['id']},{})[_0xa1b7('0x21')](function(){return _0x122045;});}else{return _0x122045;}})['catch'](function(_0x27bed0){logger[_0xa1b7('0x26')](_0xa1b7('0x4d'),_0x27bed0);throw _0x27bed0;});}return _0x122045;})[_0xa1b7('0x21')](respondWithResult(_0x1e3039,0xc9))[_0xa1b7('0x42')](handleError(_0x1e3039,null));};exports[_0xa1b7('0x1f')]=function(_0xc163cd,_0x2451e0){if(_0xc163cd[_0xa1b7('0x4e')]['id']){delete _0xc163cd[_0xa1b7('0x4e')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xc163cd[_0xa1b7('0x44')]['id']}})[_0xa1b7('0x21')](handleEntityNotFound(_0x2451e0,null))[_0xa1b7('0x21')](saveUpdates(_0xc163cd['body'],null))[_0xa1b7('0x21')](respondWithResult(_0x2451e0,null))[_0xa1b7('0x42')](handleError(_0x2451e0,null));};exports[_0xa1b7('0x20')]=function(_0x21251d,_0x5ca8f7){return db[_0xa1b7('0x45')]['find']({'where':{'id':_0x21251d[_0xa1b7('0x44')]['id']}})['then'](handleEntityNotFound(_0x5ca8f7,null))[_0xa1b7('0x21')](removeEntity(_0x5ca8f7,null))[_0xa1b7('0x42')](handleError(_0x5ca8f7,null));}; \ No newline at end of file +var _0x8e26=['../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Metrics','UserProfileResource','stack','name','send','index','AnalyticMetric','rawAttributes','query','keys','filters','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x8e26,0x147));var _0x68e2=function(_0x3c4528,_0x50692f){_0x3c4528=_0x3c4528-0x0;var _0x12e612=_0x8e26[_0x3c4528];return _0x12e612;};'use strict';var pdf=require(_0x68e2('0x0'));var emlformat=require(_0x68e2('0x1'));var rimraf=require(_0x68e2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x68e2('0x3'));var moment=require(_0x68e2('0x4'));var BPromise=require(_0x68e2('0x5'));var Mustache=require(_0x68e2('0x6'));var util=require(_0x68e2('0x7'));var path=require(_0x68e2('0x8'));var sox=require(_0x68e2('0x9'));var csv=require(_0x68e2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x68e2('0xb'));var squel=require(_0x68e2('0xc'));var crypto=require(_0x68e2('0xd'));var jsforce=require(_0x68e2('0xe'));var deskjs=require(_0x68e2('0xf'));var toCsv=require(_0x68e2('0xa'));var querystring=require(_0x68e2('0x10'));var Papa=require(_0x68e2('0x11'));var Redis=require(_0x68e2('0x12'));var authService=require(_0x68e2('0x13'));var qs=require(_0x68e2('0x14'));var hardwareService=require(_0x68e2('0x15'));var logger=require(_0x68e2('0x16'))(_0x68e2('0x17'));var utils=require(_0x68e2('0x18'));var config=require(_0x68e2('0x19'));var db=require(_0x68e2('0x1a'))['db'];function respondWithStatusCode(_0xd9256b,_0x4e2500){_0x4e2500=_0x4e2500||0xcc;return function(_0x3ef0ff){if(_0x3ef0ff){return _0xd9256b[_0x68e2('0x1b')](_0x4e2500);}return _0xd9256b['status'](_0x4e2500)['end']();};}function respondWithResult(_0xc5cb44,_0x438422){_0x438422=_0x438422||0xc8;return function(_0xd3538b){if(_0xd3538b){return _0xc5cb44[_0x68e2('0x1c')](_0x438422)[_0x68e2('0x1d')](_0xd3538b);}};}function respondWithFilteredResult(_0x2dce9d,_0x252642){return function(_0x3c8b12){if(_0x3c8b12){var _0x3dc9a8=_0x3c8b12[_0x68e2('0x1e')],_0x52d35b=_0x252642[_0x68e2('0x1f')],_0x138d4d=_0x252642[_0x68e2('0x1f')]+_0x252642[_0x68e2('0x20')],_0x458960;if(_0x138d4d>=_0x3dc9a8){_0x138d4d=_0x3dc9a8;_0x458960=0xc8;}else{_0x458960=0xce;}_0x2dce9d[_0x68e2('0x1c')](_0x458960);return _0x2dce9d[_0x68e2('0x21')](_0x68e2('0x22'),_0x52d35b+'-'+_0x138d4d+'/'+_0x3dc9a8)['json'](_0x3c8b12);}return null;};}function patchUpdates(_0x48dd24){return function(_0x752de5){try{jsonpatch[_0x68e2('0x23')](_0x752de5,_0x48dd24,!![]);}catch(_0x503e7f){return BPromise[_0x68e2('0x24')](_0x503e7f);}return _0x752de5[_0x68e2('0x25')]();};}function saveUpdates(_0x213c64,_0x3a2cef){return function(_0x11a860){if(_0x11a860){return _0x11a860[_0x68e2('0x26')](_0x213c64)[_0x68e2('0x27')](function(_0x3a66d9){return _0x3a66d9;});}return null;};}function removeEntity(_0x98372b,_0x2488c0){return function(_0x4e2983){if(_0x4e2983){return _0x4e2983[_0x68e2('0x28')]()[_0x68e2('0x27')](function(){var _0x583ae3=_0x4e2983['get']({'plain':!![]});var _0x3d22a4=_0x68e2('0x29');return db[_0x68e2('0x2a')][_0x68e2('0x28')]({'where':{'type':_0x3d22a4,'resourceId':_0x583ae3['id']}})['then'](function(){return _0x4e2983;});})[_0x68e2('0x27')](function(){_0x98372b[_0x68e2('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4681d0,_0x26390c){return function(_0x33438b){if(!_0x33438b){_0x4681d0[_0x68e2('0x1b')](0x194);}return _0x33438b;};}function handleError(_0x4271b5,_0x27dbf3){_0x27dbf3=_0x27dbf3||0x1f4;return function(_0x1c729c){logger['error'](_0x1c729c[_0x68e2('0x2b')]);if(_0x1c729c[_0x68e2('0x2c')]){delete _0x1c729c[_0x68e2('0x2c')];}_0x4271b5[_0x68e2('0x1c')](_0x27dbf3)[_0x68e2('0x2d')](_0x1c729c);};}exports[_0x68e2('0x2e')]=function(_0x54ffeb,_0x2285b5){var _0x4b52c8={},_0x28fe97={},_0x2c487a={'count':0x0,'rows':[]};var _0x3a3d1c=db[_0x68e2('0x2f')][_0x68e2('0x30')];_0x28fe97['model']=_['keys'](_0x3a3d1c);_0x28fe97[_0x68e2('0x31')]=_[_0x68e2('0x32')](_0x54ffeb[_0x68e2('0x31')]);_0x28fe97[_0x68e2('0x33')]=_['intersection'](_0x28fe97[_0x68e2('0x34')],_0x28fe97[_0x68e2('0x31')]);_0x4b52c8[_0x68e2('0x35')]=_['intersection'](_0x28fe97[_0x68e2('0x34')],qs['fields'](_0x54ffeb[_0x68e2('0x31')][_0x68e2('0x36')]));_0x4b52c8[_0x68e2('0x35')]=_0x4b52c8[_0x68e2('0x35')][_0x68e2('0x37')]?_0x4b52c8[_0x68e2('0x35')]:_0x28fe97[_0x68e2('0x34')];if(!_0x54ffeb[_0x68e2('0x31')][_0x68e2('0x38')]('nolimit')){_0x4b52c8['limit']=qs[_0x68e2('0x20')](_0x54ffeb['query']['limit']);_0x4b52c8[_0x68e2('0x1f')]=qs[_0x68e2('0x1f')](_0x54ffeb[_0x68e2('0x31')][_0x68e2('0x1f')]);}_0x4b52c8[_0x68e2('0x39')]=qs['sort'](_0x54ffeb[_0x68e2('0x31')][_0x68e2('0x3a')]);_0x4b52c8['where']=qs[_0x68e2('0x33')](_[_0x68e2('0x3b')](_0x54ffeb[_0x68e2('0x31')],_0x28fe97['filters']));if(_0x54ffeb[_0x68e2('0x31')][_0x68e2('0x3c')]){_0x4b52c8[_0x68e2('0x3d')]=_[_0x68e2('0x3e')](_0x4b52c8[_0x68e2('0x3d')],{'$or':_[_0x68e2('0x3f')](_0x3a3d1c,function(_0x1df715){if(_0x1df715[_0x68e2('0x40')][_0x68e2('0x41')]!==_0x68e2('0x42')){var _0x4302e1={};_0x4302e1[_0x1df715[_0x68e2('0x43')]]={'$like':'%'+_0x54ffeb['query'][_0x68e2('0x3c')]+'%'};return _0x4302e1;}})});}_0x4b52c8=_[_0x68e2('0x3e')]({},_0x4b52c8,_0x54ffeb[_0x68e2('0x44')]);var _0x77de82={'where':_0x4b52c8['where']};return db[_0x68e2('0x2f')][_0x68e2('0x1e')](_0x77de82)[_0x68e2('0x27')](function(_0x56c4a3){_0x2c487a['count']=_0x56c4a3;if(_0x54ffeb[_0x68e2('0x31')][_0x68e2('0x45')]){_0x4b52c8[_0x68e2('0x46')]=[{'all':!![]}];}return db[_0x68e2('0x2f')][_0x68e2('0x47')](_0x4b52c8);})[_0x68e2('0x27')](function(_0x54640f){_0x2c487a[_0x68e2('0x48')]=_0x54640f;return _0x2c487a;})[_0x68e2('0x27')](respondWithFilteredResult(_0x2285b5,_0x4b52c8))[_0x68e2('0x49')](handleError(_0x2285b5,null));};exports[_0x68e2('0x4a')]=function(_0x30849f,_0x54669a){var _0x1cbe15={'raw':!![],'where':{'id':_0x30849f[_0x68e2('0x4b')]['id']}},_0x173089={};_0x173089[_0x68e2('0x34')]=_[_0x68e2('0x32')](db['AnalyticMetric'][_0x68e2('0x30')]);_0x173089[_0x68e2('0x31')]=_[_0x68e2('0x32')](_0x30849f[_0x68e2('0x31')]);_0x173089[_0x68e2('0x33')]=_[_0x68e2('0x4c')](_0x173089[_0x68e2('0x34')],_0x173089[_0x68e2('0x31')]);_0x1cbe15[_0x68e2('0x35')]=_[_0x68e2('0x4c')](_0x173089['model'],qs[_0x68e2('0x36')](_0x30849f[_0x68e2('0x31')][_0x68e2('0x36')]));_0x1cbe15[_0x68e2('0x35')]=_0x1cbe15['attributes']['length']?_0x1cbe15[_0x68e2('0x35')]:_0x173089[_0x68e2('0x34')];if(_0x30849f[_0x68e2('0x31')][_0x68e2('0x45')]){_0x1cbe15[_0x68e2('0x46')]=[{'all':!![]}];}_0x1cbe15=_['merge']({},_0x1cbe15,_0x30849f[_0x68e2('0x44')]);return db[_0x68e2('0x2f')][_0x68e2('0x4d')](_0x1cbe15)[_0x68e2('0x27')](handleEntityNotFound(_0x54669a,null))[_0x68e2('0x27')](respondWithResult(_0x54669a,null))[_0x68e2('0x49')](handleError(_0x54669a,null));};exports[_0x68e2('0x4e')]=function(_0x489ac1,_0x2868e7){return db[_0x68e2('0x2f')][_0x68e2('0x4e')](_0x489ac1['body'],{})['then'](function(_0x63d8a8){var _0x2eb5f0=_0x489ac1['user']['get']({'plain':!![]});if(!_0x2eb5f0)throw new Error(_0x68e2('0x4f'));if(_0x2eb5f0[_0x68e2('0x50')]===_0x68e2('0x51')){var _0xfc3abf=_0x63d8a8[_0x68e2('0x52')]({'plain':!![]});var _0x327dfe='Metrics';return db['UserProfileSection'][_0x68e2('0x4d')]({'where':{'name':_0x327dfe,'userProfileId':_0x2eb5f0[_0x68e2('0x53')]},'raw':!![]})[_0x68e2('0x27')](function(_0x746de4){if(_0x746de4&&_0x746de4[_0x68e2('0x54')]===0x0){return db[_0x68e2('0x2a')][_0x68e2('0x4e')]({'name':_0xfc3abf[_0x68e2('0x2c')],'resourceId':_0xfc3abf['id'],'type':_0x746de4[_0x68e2('0x2c')],'sectionId':_0x746de4['id']},{})['then'](function(){return _0x63d8a8;});}else{return _0x63d8a8;}})['catch'](function(_0x400dbb){logger[_0x68e2('0x55')](_0x68e2('0x56'),_0x400dbb);throw _0x400dbb;});}return _0x63d8a8;})[_0x68e2('0x27')](respondWithResult(_0x2868e7,0xc9))[_0x68e2('0x49')](handleError(_0x2868e7,null));};exports['update']=function(_0xbac5ef,_0x251703){if(_0xbac5ef['body']['id']){delete _0xbac5ef['body']['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xbac5ef['params']['id']}})['then'](handleEntityNotFound(_0x251703,null))[_0x68e2('0x27')](saveUpdates(_0xbac5ef[_0x68e2('0x57')],null))[_0x68e2('0x27')](respondWithResult(_0x251703,null))['catch'](handleError(_0x251703,null));};exports[_0x68e2('0x28')]=function(_0x29f447,_0x12cf40){return db['AnalyticMetric'][_0x68e2('0x4d')]({'where':{'id':_0x29f447['params']['id']}})[_0x68e2('0x27')](handleEntityNotFound(_0x12cf40,null))[_0x68e2('0x27')](removeEntity(_0x12cf40,null))[_0x68e2('0x49')](handleError(_0x12cf40,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index cdfcb67..fe370c8 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 _0xe112=['path','rimraf','../../config/environment','exports','AnalyticMetric','analytics_metrics','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x55d142,_0x7a438e){var _0x102b55=function(_0x32bc21){while(--_0x32bc21){_0x55d142['push'](_0x55d142['shift']());}};_0x102b55(++_0x7a438e);}(_0xe112,0xf6));var _0x2e11=function(_0x36e18d,_0x34c047){_0x36e18d=_0x36e18d-0x0;var _0x5a1072=_0xe112[_0x36e18d];return _0x5a1072;};'use strict';var _=require('lodash');var util=require(_0x2e11('0x0'));var logger=require(_0x2e11('0x1'))(_0x2e11('0x2'));var moment=require(_0x2e11('0x3'));var BPromise=require(_0x2e11('0x4'));var rp=require(_0x2e11('0x5'));var fs=require('fs');var path=require(_0x2e11('0x6'));var rimraf=require(_0x2e11('0x7'));var config=require(_0x2e11('0x8'));var attributes=require('./analyticMetric.attributes');module[_0x2e11('0x9')]=function(_0xca2fef,_0x153fcd){return _0xca2fef['define'](_0x2e11('0xa'),attributes,{'tableName':_0x2e11('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbcbc=['define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticMetric.attributes','exports'];(function(_0x579ddd,_0x5b6e78){var _0xd3abda=function(_0x44d730){while(--_0x44d730){_0x579ddd['push'](_0x579ddd['shift']());}};_0xd3abda(++_0x5b6e78);}(_0xbcbc,0x199));var _0xcbcb=function(_0x3189b3,_0x1052c6){_0x3189b3=_0x3189b3-0x0;var _0x3be953=_0xbcbc[_0x3189b3];return _0x3be953;};'use strict';var _=require(_0xcbcb('0x0'));var util=require(_0xcbcb('0x1'));var logger=require(_0xcbcb('0x2'))(_0xcbcb('0x3'));var moment=require(_0xcbcb('0x4'));var BPromise=require(_0xcbcb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcbcb('0x6'));var rimraf=require(_0xcbcb('0x7'));var config=require(_0xcbcb('0x8'));var attributes=require(_0xcbcb('0x9'));module[_0xcbcb('0xa')]=function(_0x28f454,_0x481129){return _0x28f454[_0xcbcb('0xb')](_0xcbcb('0xc'),attributes,{'tableName':_0xcbcb('0xd'),'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 9e70de8..ff5b481 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 _0x90ae=['info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x90ae,0x195));var _0xe90a=function(_0x1ca417,_0x2409c3){_0x1ca417=_0x1ca417-0x0;var _0x32cda4=_0x90ae[_0x1ca417];return _0x32cda4;};'use strict';var _=require(_0xe90a('0x0'));var util=require(_0xe90a('0x1'));var moment=require(_0xe90a('0x2'));var BPromise=require('bluebird');var rs=require(_0xe90a('0x3'));var fs=require('fs');var Redis=require(_0xe90a('0x4'));var db=require(_0xe90a('0x5'))['db'];var utils=require(_0xe90a('0x6'));var logger=require(_0xe90a('0x7'))(_0xe90a('0x8'));var config=require(_0xe90a('0x9'));var jayson=require(_0xe90a('0xa'));var client=jayson[_0xe90a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x203575,_0x280721,_0x24b470){return new BPromise(function(_0x42fb64,_0x11cd54){return client[_0xe90a('0xc')](_0x203575,_0x24b470)['then'](function(_0x24c73f){logger[_0xe90a('0xd')](_0xe90a('0xe'),_0x280721,_0xe90a('0xf'));logger[_0xe90a('0x10')](_0xe90a('0x11'),_0x280721,_0xe90a('0xf'),JSON['stringify'](_0x24c73f));if(_0x24c73f[_0xe90a('0x12')]){if(_0x24c73f[_0xe90a('0x12')]['code']===0x1f4){logger['error'](_0xe90a('0xe'),_0x280721,_0x24c73f[_0xe90a('0x12')]['message']);return _0x11cd54(_0x24c73f[_0xe90a('0x12')][_0xe90a('0x13')]);}logger[_0xe90a('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x280721,_0x24c73f[_0xe90a('0x12')][_0xe90a('0x13')]);return _0x42fb64(_0x24c73f['error'][_0xe90a('0x13')]);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x280721,'request\x20sent');_0x42fb64(_0x24c73f[_0xe90a('0x14')][_0xe90a('0x13')]);}})[_0xe90a('0x15')](function(_0x22602f){logger[_0xe90a('0x12')](_0xe90a('0xe'),_0x280721,_0x22602f);_0x11cd54(_0x22602f);});});} \ No newline at end of file +var _0x3fc6=['request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s'];(function(_0x49d2d8,_0x59c297){var _0x363318=function(_0x3169e2){while(--_0x3169e2){_0x49d2d8['push'](_0x49d2d8['shift']());}};_0x363318(++_0x59c297);}(_0x3fc6,0x159));var _0x63fc=function(_0x10b6cf,_0xa17f00){_0x10b6cf=_0x10b6cf-0x0;var _0x2487fd=_0x3fc6[_0x10b6cf];return _0x2487fd;};'use strict';var _=require(_0x63fc('0x0'));var util=require(_0x63fc('0x1'));var moment=require(_0x63fc('0x2'));var BPromise=require('bluebird');var rs=require(_0x63fc('0x3'));var fs=require('fs');var Redis=require(_0x63fc('0x4'));var db=require(_0x63fc('0x5'))['db'];var utils=require(_0x63fc('0x6'));var logger=require(_0x63fc('0x7'))(_0x63fc('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x63fc('0x9')][_0x63fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa0d23e,_0x48cc45,_0x7d7e64){return new BPromise(function(_0x3e182f,_0x5da412){return client[_0x63fc('0xb')](_0xa0d23e,_0x7d7e64)[_0x63fc('0xc')](function(_0x231e48){logger[_0x63fc('0xd')](_0x63fc('0xe'),_0x48cc45,_0x63fc('0xf'));logger[_0x63fc('0x10')](_0x63fc('0x11'),_0x48cc45,_0x63fc('0xf'),JSON[_0x63fc('0x12')](_0x231e48));if(_0x231e48['error']){if(_0x231e48[_0x63fc('0x13')][_0x63fc('0x14')]===0x1f4){logger[_0x63fc('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x48cc45,_0x231e48['error'][_0x63fc('0x15')]);return _0x5da412(_0x231e48[_0x63fc('0x13')][_0x63fc('0x15')]);}logger[_0x63fc('0x13')](_0x63fc('0xe'),_0x48cc45,_0x231e48[_0x63fc('0x13')]['message']);return _0x3e182f(_0x231e48[_0x63fc('0x13')][_0x63fc('0x15')]);}else{logger[_0x63fc('0xd')](_0x63fc('0xe'),_0x48cc45,'request\x20sent');_0x3e182f(_0x231e48[_0x63fc('0x16')]['message']);}})[_0x63fc('0x17')](function(_0x35631f){logger[_0x63fc('0x13')](_0x63fc('0xe'),_0x48cc45,_0x35631f);_0x5da412(_0x35631f);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 29bdefd..dd25851 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 _0xb78e=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb78e,0x1c9));var _0xeb78=function(_0x1e97cd,_0x1884d8){_0x1e97cd=_0x1e97cd-0x0;var _0x42fb68=_0xb78e[_0x1e97cd];return _0x42fb68;};'use strict';var multer=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var path=require('path');var timeout=require(_0xeb78('0x2'));var express=require(_0xeb78('0x3'));var router=express[_0xeb78('0x4')]();var auth=require(_0xeb78('0x5'));var interaction=require(_0xeb78('0x6'));var config=require(_0xeb78('0x7'));var controller=require(_0xeb78('0x8'));router[_0xeb78('0x9')]('/',auth['isAuthenticated'](),controller[_0xeb78('0xa')]);router[_0xeb78('0x9')](_0xeb78('0xb'),auth[_0xeb78('0xc')](),controller[_0xeb78('0xd')]);router[_0xeb78('0xe')]('/',auth[_0xeb78('0xc')](),controller['create']);router[_0xeb78('0xf')](_0xeb78('0xb'),auth[_0xeb78('0xc')](),controller[_0xeb78('0x10')]);router[_0xeb78('0x11')](_0xeb78('0xb'),auth[_0xeb78('0xc')](),controller[_0xeb78('0x12')]);module[_0xeb78('0x13')]=router; \ No newline at end of file +var _0xdec3=['exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','show','post','create','put'];(function(_0x31dd53,_0x121c09){var _0x475369=function(_0x3b3dda){while(--_0x3b3dda){_0x31dd53['push'](_0x31dd53['shift']());}};_0x475369(++_0x121c09);}(_0xdec3,0x89));var _0x3dec=function(_0xfd244e,_0x59dccb){_0xfd244e=_0xfd244e-0x0;var _0x2b242e=_0xdec3[_0xfd244e];return _0x2b242e;};'use strict';var multer=require(_0x3dec('0x0'));var util=require('util');var path=require(_0x3dec('0x1'));var timeout=require(_0x3dec('0x2'));var express=require(_0x3dec('0x3'));var router=express['Router']();var auth=require(_0x3dec('0x4'));var interaction=require(_0x3dec('0x5'));var config=require(_0x3dec('0x6'));var controller=require(_0x3dec('0x7'));router['get']('/',auth[_0x3dec('0x8')](),controller[_0x3dec('0x9')]);router[_0x3dec('0xa')](_0x3dec('0xb'),auth[_0x3dec('0x8')](),controller[_0x3dec('0xc')]);router[_0x3dec('0xd')]('/',auth['isAuthenticated'](),controller[_0x3dec('0xe')]);router[_0x3dec('0xf')]('/:id',auth[_0x3dec('0x8')](),controller['update']);router['delete'](_0x3dec('0xb'),auth[_0x3dec('0x8')](),controller['destroy']);module[_0x3dec('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 7dff855..f0bc9d0 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 _0xd563=['sequelize','exports','TEXT'];(function(_0x5954a2,_0x254e70){var _0x272c87=function(_0x5885ee){while(--_0x5885ee){_0x5954a2['push'](_0x5954a2['shift']());}};_0x272c87(++_0x254e70);}(_0xd563,0x1e6));var _0x3d56=function(_0x5102cd,_0x466781){_0x5102cd=_0x5102cd-0x0;var _0x224afa=_0xd563[_0x5102cd];return _0x224afa;};'use strict';var Sequelize=require(_0x3d56('0x0'));module[_0x3d56('0x1')]={'tree':{'type':Sequelize[_0x3d56('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x6ad0=['sequelize','TEXT'];(function(_0x1f1a97,_0xadfc15){var _0x29fc6a=function(_0x38c180){while(--_0x38c180){_0x1f1a97['push'](_0x1f1a97['shift']());}};_0x29fc6a(++_0xadfc15);}(_0x6ad0,0x146));var _0x06ad=function(_0x580e6e,_0x5f838b){_0x580e6e=_0x580e6e-0x0;var _0x395ed2=_0x6ad0[_0x580e6e];return _0x395ed2;};'use strict';var Sequelize=require(_0x06ad('0x0'));module['exports']={'tree':{'type':Sequelize[_0x06ad('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 0df7d50..ec90e5c 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 _0xbc31=['path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','send','index','AnalyticTreeReport','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','map','VIRTUAL','field','filter','merge','options','where','includeAll','include','rows','catch','show','keys','find','create','body','params','destroy','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xbc31,0x120));var _0x1bc3=function(_0x52c257,_0x396268){_0x52c257=_0x52c257-0x0;var _0x2694c8=_0xbc31[_0x52c257];return _0x2694c8;};'use strict';var pdf=require(_0x1bc3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1bc3('0x1'));var zipdir=require(_0x1bc3('0x2'));var jsonpatch=require(_0x1bc3('0x3'));var rp=require(_0x1bc3('0x4'));var moment=require(_0x1bc3('0x5'));var BPromise=require(_0x1bc3('0x6'));var Mustache=require(_0x1bc3('0x7'));var util=require('util');var path=require(_0x1bc3('0x8'));var sox=require(_0x1bc3('0x9'));var csv=require(_0x1bc3('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1bc3('0xb'));var squel=require(_0x1bc3('0xc'));var crypto=require(_0x1bc3('0xd'));var jsforce=require(_0x1bc3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1bc3('0xa'));var querystring=require(_0x1bc3('0xf'));var Papa=require(_0x1bc3('0x10'));var Redis=require(_0x1bc3('0x11'));var authService=require(_0x1bc3('0x12'));var qs=require(_0x1bc3('0x13'));var hardwareService=require(_0x1bc3('0x14'));var logger=require(_0x1bc3('0x15'))('api');var utils=require(_0x1bc3('0x16'));var config=require('../../config/environment');var db=require(_0x1bc3('0x17'))['db'];function respondWithStatusCode(_0x3b3f56,_0xc0b65f){_0xc0b65f=_0xc0b65f||0xcc;return function(_0x136ba3){if(_0x136ba3){return _0x3b3f56[_0x1bc3('0x18')](_0xc0b65f);}return _0x3b3f56[_0x1bc3('0x19')](_0xc0b65f)[_0x1bc3('0x1a')]();};}function respondWithResult(_0x30ce63,_0x11363d){_0x11363d=_0x11363d||0xc8;return function(_0x4bb8a8){if(_0x4bb8a8){return _0x30ce63['status'](_0x11363d)[_0x1bc3('0x1b')](_0x4bb8a8);}};}function respondWithFilteredResult(_0x2e892e,_0x1c322d){return function(_0x11befc){if(_0x11befc){var _0x16fe40=_0x11befc[_0x1bc3('0x1c')],_0x38f410=_0x1c322d[_0x1bc3('0x1d')],_0x2cf953=_0x1c322d[_0x1bc3('0x1d')]+_0x1c322d['limit'],_0x47cc62;if(_0x2cf953>=_0x16fe40){_0x2cf953=_0x16fe40;_0x47cc62=0xc8;}else{_0x47cc62=0xce;}_0x2e892e[_0x1bc3('0x19')](_0x47cc62);return _0x2e892e[_0x1bc3('0x1e')](_0x1bc3('0x1f'),_0x38f410+'-'+_0x2cf953+'/'+_0x16fe40)[_0x1bc3('0x1b')](_0x11befc);}return null;};}function patchUpdates(_0x168840){return function(_0x31bd68){try{jsonpatch[_0x1bc3('0x20')](_0x31bd68,_0x168840,!![]);}catch(_0x11267d){return BPromise[_0x1bc3('0x21')](_0x11267d);}return _0x31bd68[_0x1bc3('0x22')]();};}function saveUpdates(_0x3b1052,_0x41c95c){return function(_0x4746ca){if(_0x4746ca){return _0x4746ca[_0x1bc3('0x23')](_0x3b1052)[_0x1bc3('0x24')](function(_0x32a202){return _0x32a202;});}return null;};}function removeEntity(_0x356011,_0x3aaee7){return function(_0x4d54cf){if(_0x4d54cf){return _0x4d54cf['destroy']()['then'](function(){_0x356011[_0x1bc3('0x19')](0xcc)[_0x1bc3('0x1a')]();});}};}function handleEntityNotFound(_0x30b5cd,_0xb2d3d3){return function(_0x4781df){if(!_0x4781df){_0x30b5cd['sendStatus'](0x194);}return _0x4781df;};}function handleError(_0x2d4b15,_0x40ff23){_0x40ff23=_0x40ff23||0x1f4;return function(_0x30f8a0){logger[_0x1bc3('0x25')](_0x30f8a0['stack']);if(_0x30f8a0['name']){delete _0x30f8a0[_0x1bc3('0x26')];}_0x2d4b15['status'](_0x40ff23)[_0x1bc3('0x27')](_0x30f8a0);};}exports[_0x1bc3('0x28')]=function(_0x48837a,_0x196f85){var _0x541006={},_0x19d607={},_0x528af2={'count':0x0,'rows':[]};var _0x308bb3=db[_0x1bc3('0x29')][_0x1bc3('0x2a')];_0x19d607[_0x1bc3('0x2b')]=_['keys'](_0x308bb3);_0x19d607[_0x1bc3('0x2c')]=_['keys'](_0x48837a[_0x1bc3('0x2c')]);_0x19d607[_0x1bc3('0x2d')]=_[_0x1bc3('0x2e')](_0x19d607['model'],_0x19d607[_0x1bc3('0x2c')]);_0x541006[_0x1bc3('0x2f')]=_[_0x1bc3('0x2e')](_0x19d607[_0x1bc3('0x2b')],qs[_0x1bc3('0x30')](_0x48837a[_0x1bc3('0x2c')][_0x1bc3('0x30')]));_0x541006[_0x1bc3('0x2f')]=_0x541006[_0x1bc3('0x2f')][_0x1bc3('0x31')]?_0x541006[_0x1bc3('0x2f')]:_0x19d607[_0x1bc3('0x2b')];if(!_0x48837a['query'][_0x1bc3('0x32')](_0x1bc3('0x33'))){_0x541006[_0x1bc3('0x34')]=qs[_0x1bc3('0x34')](_0x48837a[_0x1bc3('0x2c')][_0x1bc3('0x34')]);_0x541006[_0x1bc3('0x1d')]=qs[_0x1bc3('0x1d')](_0x48837a[_0x1bc3('0x2c')]['offset']);}_0x541006[_0x1bc3('0x35')]=qs[_0x1bc3('0x36')](_0x48837a['query'][_0x1bc3('0x36')]);_0x541006['where']=qs['filters'](_[_0x1bc3('0x37')](_0x48837a[_0x1bc3('0x2c')],_0x19d607[_0x1bc3('0x2d')]));if(_0x48837a[_0x1bc3('0x2c')]['filter']){_0x541006['where']=_['merge'](_0x541006['where'],{'$or':_[_0x1bc3('0x38')](_0x308bb3,function(_0x2707cc){if(_0x2707cc['type']['key']!==_0x1bc3('0x39')){var _0x3b3d6a={};_0x3b3d6a[_0x2707cc[_0x1bc3('0x3a')]]={'$like':'%'+_0x48837a['query'][_0x1bc3('0x3b')]+'%'};return _0x3b3d6a;}})});}_0x541006=_[_0x1bc3('0x3c')]({},_0x541006,_0x48837a[_0x1bc3('0x3d')]);var _0xbffae0={'where':_0x541006[_0x1bc3('0x3e')]};return db[_0x1bc3('0x29')][_0x1bc3('0x1c')](_0xbffae0)['then'](function(_0x874eb7){_0x528af2['count']=_0x874eb7;if(_0x48837a['query'][_0x1bc3('0x3f')]){_0x541006[_0x1bc3('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x541006);})[_0x1bc3('0x24')](function(_0x3b39bc){_0x528af2[_0x1bc3('0x41')]=_0x3b39bc;return _0x528af2;})['then'](respondWithFilteredResult(_0x196f85,_0x541006))[_0x1bc3('0x42')](handleError(_0x196f85,null));};exports[_0x1bc3('0x43')]=function(_0x5f3222,_0x228a23){var _0x1c449c={'raw':!![],'where':{'id':_0x5f3222['params']['id']}},_0x409e66={};_0x409e66[_0x1bc3('0x2b')]=_[_0x1bc3('0x44')](db['AnalyticTreeReport'][_0x1bc3('0x2a')]);_0x409e66[_0x1bc3('0x2c')]=_[_0x1bc3('0x44')](_0x5f3222['query']);_0x409e66[_0x1bc3('0x2d')]=_['intersection'](_0x409e66[_0x1bc3('0x2b')],_0x409e66['query']);_0x1c449c[_0x1bc3('0x2f')]=_[_0x1bc3('0x2e')](_0x409e66[_0x1bc3('0x2b')],qs[_0x1bc3('0x30')](_0x5f3222['query']['fields']));_0x1c449c[_0x1bc3('0x2f')]=_0x1c449c[_0x1bc3('0x2f')][_0x1bc3('0x31')]?_0x1c449c[_0x1bc3('0x2f')]:_0x409e66['model'];if(_0x5f3222[_0x1bc3('0x2c')][_0x1bc3('0x3f')]){_0x1c449c[_0x1bc3('0x40')]=[{'all':!![]}];}_0x1c449c=_[_0x1bc3('0x3c')]({},_0x1c449c,_0x5f3222['options']);return db[_0x1bc3('0x29')][_0x1bc3('0x45')](_0x1c449c)['then'](handleEntityNotFound(_0x228a23,null))[_0x1bc3('0x24')](respondWithResult(_0x228a23,null))['catch'](handleError(_0x228a23,null));};exports[_0x1bc3('0x46')]=function(_0x1d669b,_0x4ddb8f){return db[_0x1bc3('0x29')][_0x1bc3('0x46')](_0x1d669b[_0x1bc3('0x47')],{})[_0x1bc3('0x24')](respondWithResult(_0x4ddb8f,0xc9))[_0x1bc3('0x42')](handleError(_0x4ddb8f,null));};exports[_0x1bc3('0x23')]=function(_0x374029,_0xdf7316){if(_0x374029[_0x1bc3('0x47')]['id']){delete _0x374029[_0x1bc3('0x47')]['id'];}return db[_0x1bc3('0x29')]['find']({'where':{'id':_0x374029[_0x1bc3('0x48')]['id']}})[_0x1bc3('0x24')](handleEntityNotFound(_0xdf7316,null))[_0x1bc3('0x24')](saveUpdates(_0x374029[_0x1bc3('0x47')],null))[_0x1bc3('0x24')](respondWithResult(_0xdf7316,null))[_0x1bc3('0x42')](handleError(_0xdf7316,null));};exports[_0x1bc3('0x49')]=function(_0x23dd97,_0x4698f3){return db[_0x1bc3('0x29')][_0x1bc3('0x45')]({'where':{'id':_0x23dd97['params']['id']}})[_0x1bc3('0x24')](handleEntityNotFound(_0x4698f3,null))[_0x1bc3('0x24')](removeEntity(_0x4698f3,null))['catch'](handleError(_0x4698f3,null));}; \ No newline at end of file +var _0xe28b=['end','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','where','pick','filter','merge','map','type','VIRTUAL','field','include','findAll','rows','catch','params','keys','length','options','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','count','offset','limit','set','Content-Range','apply','save','update','then','destroy'];(function(_0x5ac44f,_0x22118e){var _0xe72f7b=function(_0x257f90){while(--_0x257f90){_0x5ac44f['push'](_0x5ac44f['shift']());}};_0xe72f7b(++_0x22118e);}(_0xe28b,0x1bb));var _0xbe28=function(_0x5b20b6,_0x45424b){_0x5b20b6=_0x5b20b6-0x0;var _0x49a833=_0xe28b[_0x5b20b6];return _0x49a833;};'use strict';var pdf=require(_0xbe28('0x0'));var emlformat=require(_0xbe28('0x1'));var rimraf=require(_0xbe28('0x2'));var zipdir=require(_0xbe28('0x3'));var jsonpatch=require(_0xbe28('0x4'));var rp=require('request-promise');var moment=require(_0xbe28('0x5'));var BPromise=require(_0xbe28('0x6'));var Mustache=require(_0xbe28('0x7'));var util=require('util');var path=require(_0xbe28('0x8'));var sox=require(_0xbe28('0x9'));var csv=require(_0xbe28('0xa'));var ejs=require(_0xbe28('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbe28('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe28('0xd'));var Papa=require(_0xbe28('0xe'));var Redis=require('ioredis');var authService=require(_0xbe28('0xf'));var qs=require(_0xbe28('0x10'));var hardwareService=require(_0xbe28('0x11'));var logger=require(_0xbe28('0x12'))(_0xbe28('0x13'));var utils=require('../../config/utils');var config=require(_0xbe28('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x385839,_0x497b11){_0x497b11=_0x497b11||0xcc;return function(_0x11329a){if(_0x11329a){return _0x385839[_0xbe28('0x15')](_0x497b11);}return _0x385839[_0xbe28('0x16')](_0x497b11)['end']();};}function respondWithResult(_0x8d52c8,_0x550fad){_0x550fad=_0x550fad||0xc8;return function(_0x2d202f){if(_0x2d202f){return _0x8d52c8[_0xbe28('0x16')](_0x550fad)['json'](_0x2d202f);}};}function respondWithFilteredResult(_0x2a415b,_0x839475){return function(_0x340153){if(_0x340153){var _0xf903dc=_0x340153[_0xbe28('0x17')],_0xc0d7f6=_0x839475[_0xbe28('0x18')],_0x2ef41e=_0x839475[_0xbe28('0x18')]+_0x839475[_0xbe28('0x19')],_0x27ba29;if(_0x2ef41e>=_0xf903dc){_0x2ef41e=_0xf903dc;_0x27ba29=0xc8;}else{_0x27ba29=0xce;}_0x2a415b[_0xbe28('0x16')](_0x27ba29);return _0x2a415b[_0xbe28('0x1a')](_0xbe28('0x1b'),_0xc0d7f6+'-'+_0x2ef41e+'/'+_0xf903dc)['json'](_0x340153);}return null;};}function patchUpdates(_0x23f305){return function(_0xb198d8){try{jsonpatch[_0xbe28('0x1c')](_0xb198d8,_0x23f305,!![]);}catch(_0x55f269){return BPromise['reject'](_0x55f269);}return _0xb198d8[_0xbe28('0x1d')]();};}function saveUpdates(_0x362f58,_0x32b03b){return function(_0x34cbcc){if(_0x34cbcc){return _0x34cbcc[_0xbe28('0x1e')](_0x362f58)[_0xbe28('0x1f')](function(_0x6655e3){return _0x6655e3;});}return null;};}function removeEntity(_0x5d6f18,_0x34399d){return function(_0x4625f3){if(_0x4625f3){return _0x4625f3[_0xbe28('0x20')]()['then'](function(){_0x5d6f18[_0xbe28('0x16')](0xcc)[_0xbe28('0x21')]();});}};}function handleEntityNotFound(_0x28fcbf,_0x2a2d2a){return function(_0x251724){if(!_0x251724){_0x28fcbf['sendStatus'](0x194);}return _0x251724;};}function handleError(_0x116d4a,_0x5442b0){_0x5442b0=_0x5442b0||0x1f4;return function(_0xb24c7f){logger[_0xbe28('0x22')](_0xb24c7f[_0xbe28('0x23')]);if(_0xb24c7f['name']){delete _0xb24c7f[_0xbe28('0x24')];}_0x116d4a['status'](_0x5442b0)[_0xbe28('0x25')](_0xb24c7f);};}exports[_0xbe28('0x26')]=function(_0x4c73e9,_0x71fb74){var _0xf985b6={},_0x4547fc={},_0x2b5850={'count':0x0,'rows':[]};var _0x2b3033=db[_0xbe28('0x27')][_0xbe28('0x28')];_0x4547fc['model']=_['keys'](_0x2b3033);_0x4547fc[_0xbe28('0x29')]=_['keys'](_0x4c73e9[_0xbe28('0x29')]);_0x4547fc[_0xbe28('0x2a')]=_[_0xbe28('0x2b')](_0x4547fc['model'],_0x4547fc[_0xbe28('0x29')]);_0xf985b6[_0xbe28('0x2c')]=_[_0xbe28('0x2b')](_0x4547fc[_0xbe28('0x2d')],qs[_0xbe28('0x2e')](_0x4c73e9[_0xbe28('0x29')][_0xbe28('0x2e')]));_0xf985b6[_0xbe28('0x2c')]=_0xf985b6[_0xbe28('0x2c')]['length']?_0xf985b6['attributes']:_0x4547fc[_0xbe28('0x2d')];if(!_0x4c73e9['query'][_0xbe28('0x2f')](_0xbe28('0x30'))){_0xf985b6[_0xbe28('0x19')]=qs[_0xbe28('0x19')](_0x4c73e9[_0xbe28('0x29')][_0xbe28('0x19')]);_0xf985b6[_0xbe28('0x18')]=qs[_0xbe28('0x18')](_0x4c73e9[_0xbe28('0x29')][_0xbe28('0x18')]);}_0xf985b6['order']=qs['sort'](_0x4c73e9[_0xbe28('0x29')]['sort']);_0xf985b6[_0xbe28('0x31')]=qs[_0xbe28('0x2a')](_[_0xbe28('0x32')](_0x4c73e9['query'],_0x4547fc[_0xbe28('0x2a')]));if(_0x4c73e9['query'][_0xbe28('0x33')]){_0xf985b6['where']=_[_0xbe28('0x34')](_0xf985b6[_0xbe28('0x31')],{'$or':_[_0xbe28('0x35')](_0x2b3033,function(_0x2b8563){if(_0x2b8563[_0xbe28('0x36')]['key']!==_0xbe28('0x37')){var _0x178ff4={};_0x178ff4[_0x2b8563[_0xbe28('0x38')]]={'$like':'%'+_0x4c73e9[_0xbe28('0x29')]['filter']+'%'};return _0x178ff4;}})});}_0xf985b6=_[_0xbe28('0x34')]({},_0xf985b6,_0x4c73e9['options']);var _0x251b5f={'where':_0xf985b6[_0xbe28('0x31')]};return db['AnalyticTreeReport'][_0xbe28('0x17')](_0x251b5f)[_0xbe28('0x1f')](function(_0x14c79f){_0x2b5850['count']=_0x14c79f;if(_0x4c73e9[_0xbe28('0x29')]['includeAll']){_0xf985b6[_0xbe28('0x39')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xbe28('0x3a')](_0xf985b6);})[_0xbe28('0x1f')](function(_0x2869b8){_0x2b5850[_0xbe28('0x3b')]=_0x2869b8;return _0x2b5850;})[_0xbe28('0x1f')](respondWithFilteredResult(_0x71fb74,_0xf985b6))[_0xbe28('0x3c')](handleError(_0x71fb74,null));};exports['show']=function(_0x5d9f4a,_0x166fe5){var _0x4be1b4={'raw':!![],'where':{'id':_0x5d9f4a[_0xbe28('0x3d')]['id']}},_0x5e8317={};_0x5e8317['model']=_['keys'](db['AnalyticTreeReport'][_0xbe28('0x28')]);_0x5e8317[_0xbe28('0x29')]=_[_0xbe28('0x3e')](_0x5d9f4a['query']);_0x5e8317[_0xbe28('0x2a')]=_['intersection'](_0x5e8317[_0xbe28('0x2d')],_0x5e8317['query']);_0x4be1b4[_0xbe28('0x2c')]=_[_0xbe28('0x2b')](_0x5e8317['model'],qs[_0xbe28('0x2e')](_0x5d9f4a[_0xbe28('0x29')][_0xbe28('0x2e')]));_0x4be1b4[_0xbe28('0x2c')]=_0x4be1b4[_0xbe28('0x2c')][_0xbe28('0x3f')]?_0x4be1b4[_0xbe28('0x2c')]:_0x5e8317[_0xbe28('0x2d')];if(_0x5d9f4a['query']['includeAll']){_0x4be1b4[_0xbe28('0x39')]=[{'all':!![]}];}_0x4be1b4=_[_0xbe28('0x34')]({},_0x4be1b4,_0x5d9f4a[_0xbe28('0x40')]);return db['AnalyticTreeReport']['find'](_0x4be1b4)[_0xbe28('0x1f')](handleEntityNotFound(_0x166fe5,null))[_0xbe28('0x1f')](respondWithResult(_0x166fe5,null))['catch'](handleError(_0x166fe5,null));};exports[_0xbe28('0x41')]=function(_0x3d15af,_0x24abed){return db[_0xbe28('0x27')][_0xbe28('0x41')](_0x3d15af[_0xbe28('0x42')],{})[_0xbe28('0x1f')](respondWithResult(_0x24abed,0xc9))['catch'](handleError(_0x24abed,null));};exports[_0xbe28('0x1e')]=function(_0x348c9a,_0x4db0cd){if(_0x348c9a[_0xbe28('0x42')]['id']){delete _0x348c9a[_0xbe28('0x42')]['id'];}return db[_0xbe28('0x27')][_0xbe28('0x43')]({'where':{'id':_0x348c9a[_0xbe28('0x3d')]['id']}})[_0xbe28('0x1f')](handleEntityNotFound(_0x4db0cd,null))[_0xbe28('0x1f')](saveUpdates(_0x348c9a[_0xbe28('0x42')],null))[_0xbe28('0x1f')](respondWithResult(_0x4db0cd,null))[_0xbe28('0x3c')](handleError(_0x4db0cd,null));};exports['destroy']=function(_0x1023d5,_0x577d45){return db[_0xbe28('0x27')]['find']({'where':{'id':_0x1023d5['params']['id']}})[_0xbe28('0x1f')](handleEntityNotFound(_0x577d45,null))['then'](removeEntity(_0x577d45,null))[_0xbe28('0x3c')](handleError(_0x577d45,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 5328156..bbccf9f 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 _0x446d=['./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','../../config/logger','moment','bluebird','path','../../config/environment'];(function(_0x2833c4,_0x2da6cd){var _0x3ee024=function(_0x228005){while(--_0x228005){_0x2833c4['push'](_0x2833c4['shift']());}};_0x3ee024(++_0x2da6cd);}(_0x446d,0x126));var _0xd446=function(_0x17c216,_0x1eed2a){_0x17c216=_0x17c216-0x0;var _0x2b2b39=_0x446d[_0x17c216];return _0x2b2b39;};'use strict';var _=require(_0xd446('0x0'));var util=require('util');var logger=require(_0xd446('0x1'))('api');var moment=require(_0xd446('0x2'));var BPromise=require(_0xd446('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd446('0x4'));var rimraf=require('rimraf');var config=require(_0xd446('0x5'));var attributes=require(_0xd446('0x6'));module[_0xd446('0x7')]=function(_0x3c855f,_0x4312fb){return _0x3c855f[_0xd446('0x8')](_0xd446('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6078=['analytics_report_trees','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','define'];(function(_0x516c97,_0xc222d6){var _0xf33880=function(_0x5cbf44){while(--_0x5cbf44){_0x516c97['push'](_0x516c97['shift']());}};_0xf33880(++_0xc222d6);}(_0x6078,0x161));var _0x8607=function(_0x447a53,_0x182cd8){_0x447a53=_0x447a53-0x0;var _0x356564=_0x6078[_0x447a53];return _0x356564;};'use strict';var _=require('lodash');var util=require(_0x8607('0x0'));var logger=require(_0x8607('0x1'))(_0x8607('0x2'));var moment=require(_0x8607('0x3'));var BPromise=require(_0x8607('0x4'));var rp=require(_0x8607('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8607('0x6'));var config=require(_0x8607('0x7'));var attributes=require(_0x8607('0x8'));module['exports']=function(_0x4b3033,_0x1c8b5e){return _0x4b3033[_0x8607('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0x8607('0xa'),'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 3550401..bdebb64 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 _0x0c08=['debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1fdb5f,_0x97f230){var _0x505252=function(_0x532e44){while(--_0x532e44){_0x1fdb5f['push'](_0x1fdb5f['shift']());}};_0x505252(++_0x97f230);}(_0x0c08,0x180));var _0x80c0=function(_0x21fc68,_0x459828){_0x21fc68=_0x21fc68-0x0;var _0x3561e1=_0x0c08[_0x21fc68];return _0x3561e1;};'use strict';var _=require(_0x80c0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x80c0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x80c0('0x2'));var db=require(_0x80c0('0x3'))['db'];var utils=require(_0x80c0('0x4'));var logger=require(_0x80c0('0x5'))(_0x80c0('0x6'));var config=require(_0x80c0('0x7'));var jayson=require(_0x80c0('0x8'));var client=jayson[_0x80c0('0x9')][_0x80c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f55aa,_0x27747f,_0x49e870){return new BPromise(function(_0x5c7f6c,_0x1718a1){return client['request'](_0x2f55aa,_0x49e870)[_0x80c0('0xb')](function(_0xd5a8dc){logger[_0x80c0('0xc')](_0x80c0('0xd'),_0x27747f,_0x80c0('0xe'));logger[_0x80c0('0xf')](_0x80c0('0x10'),_0x27747f,_0x80c0('0xe'),JSON[_0x80c0('0x11')](_0xd5a8dc));if(_0xd5a8dc[_0x80c0('0x12')]){if(_0xd5a8dc['error']['code']===0x1f4){logger[_0x80c0('0x12')]('AnalyticTreeReport,\x20%s,\x20%s',_0x27747f,_0xd5a8dc[_0x80c0('0x12')][_0x80c0('0x13')]);return _0x1718a1(_0xd5a8dc[_0x80c0('0x12')]['message']);}logger[_0x80c0('0x12')](_0x80c0('0xd'),_0x27747f,_0xd5a8dc[_0x80c0('0x12')][_0x80c0('0x13')]);return _0x5c7f6c(_0xd5a8dc[_0x80c0('0x12')]['message']);}else{logger['info'](_0x80c0('0xd'),_0x27747f,_0x80c0('0xe'));_0x5c7f6c(_0xd5a8dc[_0x80c0('0x14')]['message']);}})['catch'](function(_0x303230){logger['error'](_0x80c0('0xd'),_0x27747f,_0x303230);_0x1718a1(_0x303230);});});} \ No newline at end of file +var _0x7616=['catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3b0dfc,_0x1d28b7){var _0x22aa34=function(_0x1c46b1){while(--_0x1c46b1){_0x3b0dfc['push'](_0x3b0dfc['shift']());}};_0x22aa34(++_0x1d28b7);}(_0x7616,0x135));var _0x6761=function(_0xafef3c,_0x3144a8){_0xafef3c=_0xafef3c-0x0;var _0x3c72c1=_0x7616[_0xafef3c];return _0x3c72c1;};'use strict';var _=require(_0x6761('0x0'));var util=require(_0x6761('0x1'));var moment=require(_0x6761('0x2'));var BPromise=require(_0x6761('0x3'));var rs=require(_0x6761('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6761('0x5'));var logger=require(_0x6761('0x6'))(_0x6761('0x7'));var config=require(_0x6761('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6761('0x9')][_0x6761('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d9d72,_0xa23bf8,_0x3c87be){return new BPromise(function(_0x1f1f00,_0x8a7307){return client[_0x6761('0xb')](_0x4d9d72,_0x3c87be)[_0x6761('0xc')](function(_0x583922){logger[_0x6761('0xd')](_0x6761('0xe'),_0xa23bf8,_0x6761('0xf'));logger['debug'](_0x6761('0x10'),_0xa23bf8,_0x6761('0xf'),JSON[_0x6761('0x11')](_0x583922));if(_0x583922[_0x6761('0x12')]){if(_0x583922[_0x6761('0x12')][_0x6761('0x13')]===0x1f4){logger['error'](_0x6761('0xe'),_0xa23bf8,_0x583922[_0x6761('0x12')][_0x6761('0x14')]);return _0x8a7307(_0x583922[_0x6761('0x12')][_0x6761('0x14')]);}logger[_0x6761('0x12')](_0x6761('0xe'),_0xa23bf8,_0x583922['error'][_0x6761('0x14')]);return _0x1f1f00(_0x583922['error'][_0x6761('0x14')]);}else{logger['info']('AnalyticTreeReport,\x20%s,\x20%s',_0xa23bf8,_0x6761('0xf'));_0x1f1f00(_0x583922['result'][_0x6761('0x14')]);}})[_0x6761('0x15')](function(_0x2258ea){logger[_0x6761('0x12')]('AnalyticTreeReport,\x20%s,\x20%s',_0xa23bf8,_0x2258ea);_0x8a7307(_0x2258ea);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index de8f63c..17b3fd1 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 _0x32e1=['/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index'];(function(_0x50939b,_0x32d172){var _0x1ca1d0=function(_0x276899){while(--_0x276899){_0x50939b['push'](_0x50939b['shift']());}};_0x1ca1d0(++_0x32d172);}(_0x32e1,0x86));var _0x132e=function(_0x292cbf,_0x4c57cc){_0x292cbf=_0x292cbf-0x0;var _0x59541f=_0x32e1[_0x292cbf];return _0x59541f;};'use strict';var multer=require(_0x132e('0x0'));var util=require(_0x132e('0x1'));var path=require(_0x132e('0x2'));var timeout=require(_0x132e('0x3'));var express=require(_0x132e('0x4'));var router=express[_0x132e('0x5')]();var auth=require(_0x132e('0x6'));var interaction=require(_0x132e('0x7'));var config=require(_0x132e('0x8'));var controller=require(_0x132e('0x9'));router[_0x132e('0xa')]('/',auth[_0x132e('0xb')](),controller[_0x132e('0xc')]);router[_0x132e('0xa')](_0x132e('0xd'),auth[_0x132e('0xb')](),controller[_0x132e('0xe')]);router[_0x132e('0xf')]('/',auth[_0x132e('0xb')](),controller[_0x132e('0x10')]);router['put']('/:id',auth[_0x132e('0xb')](),controller[_0x132e('0x11')]);router[_0x132e('0x12')]('/:id',auth[_0x132e('0xb')](),controller[_0x132e('0x13')]);module[_0x132e('0x14')]=router; \ No newline at end of file +var _0xb292=['/:id','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','put'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb292,0x1d6));var _0x2b29=function(_0xeb7786,_0x53a053){_0xeb7786=_0xeb7786-0x0;var _0x120bbc=_0xb292[_0xeb7786];return _0x120bbc;};'use strict';var multer=require('multer');var util=require(_0x2b29('0x0'));var path=require(_0x2b29('0x1'));var timeout=require(_0x2b29('0x2'));var express=require('express');var router=express[_0x2b29('0x3')]();var auth=require(_0x2b29('0x4'));var interaction=require(_0x2b29('0x5'));var config=require('../../config/environment');var controller=require(_0x2b29('0x6'));router[_0x2b29('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2b29('0x7')]('/:id',auth[_0x2b29('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2b29('0x9')](_0x2b29('0xa'),auth['isAuthenticated'](),controller[_0x2b29('0xb')]);router[_0x2b29('0xc')](_0x2b29('0xa'),auth['isAuthenticated'](),controller[_0x2b29('0xd')]);module[_0x2b29('0xe')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index ca0b529..8d1be5d 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 _0xf5a5=['exports','STRING','sequelize'];(function(_0x594d7e,_0x27815a){var _0x124023=function(_0x95dec5){while(--_0x95dec5){_0x594d7e['push'](_0x594d7e['shift']());}};_0x124023(++_0x27815a);}(_0xf5a5,0x1b5));var _0x5f5a=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xf5a5[_0x2b5eae];return _0x5f3ac9;};'use strict';var Sequelize=require(_0x5f5a('0x0'));module[_0x5f5a('0x1')]={'name':{'type':Sequelize[_0x5f5a('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5f5a('0x2')]}}; \ No newline at end of file +var _0x46ab=['sequelize','STRING'];(function(_0x25e7de,_0x24b676){var _0x5cd6b8=function(_0x38526c){while(--_0x38526c){_0x25e7de['push'](_0x25e7de['shift']());}};_0x5cd6b8(++_0x24b676);}(_0x46ab,0x1b2));var _0xb46a=function(_0x545d59,_0x21c5b4){_0x545d59=_0x545d59-0x0;var _0x26fb15=_0x46ab[_0x545d59];return _0x26fb15;};'use strict';var Sequelize=require(_0xb46a('0x0'));module['exports']={'name':{'type':Sequelize[_0xb46a('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb46a('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 50c13eb..b3e0726 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 _0x50f5=['squel','desk.js','querystring','ioredis','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','destroy','error','stack','name','send','index','Attachment','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','key','VIRTUAL','field','options','then','includeAll','include','findAll','rows','catch','show','find','update','body','params','file','originalname','basename','filename','mimetype','create','download','join','root','server/files/attachments/','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash'];(function(_0x5525f9,_0x39597c){var _0x458bf3=function(_0x89d5d){while(--_0x89d5d){_0x5525f9['push'](_0x5525f9['shift']());}};_0x458bf3(++_0x39597c);}(_0x50f5,0xe6));var _0x550f=function(_0x15b9f0,_0x3b9a34){_0x15b9f0=_0x15b9f0-0x0;var _0x319af7=_0x50f5[_0x15b9f0];return _0x319af7;};'use strict';var pdf=require(_0x550f('0x0'));var emlformat=require(_0x550f('0x1'));var rimraf=require(_0x550f('0x2'));var zipdir=require(_0x550f('0x3'));var jsonpatch=require(_0x550f('0x4'));var rp=require('request-promise');var moment=require(_0x550f('0x5'));var BPromise=require(_0x550f('0x6'));var Mustache=require(_0x550f('0x7'));var util=require(_0x550f('0x8'));var path=require(_0x550f('0x9'));var sox=require(_0x550f('0xa'));var csv=require(_0x550f('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x550f('0xc'));var squel=require(_0x550f('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x550f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x550f('0xf'));var Papa=require('papaparse');var Redis=require(_0x550f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x550f('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x550f('0x12'));var config=require('../../config/environment');var db=require(_0x550f('0x13'))['db'];function respondWithStatusCode(_0x1e3ec4,_0x161de0){_0x161de0=_0x161de0||0xcc;return function(_0x1d4092){if(_0x1d4092){return _0x1e3ec4[_0x550f('0x14')](_0x161de0);}return _0x1e3ec4[_0x550f('0x15')](_0x161de0)[_0x550f('0x16')]();};}function respondWithResult(_0x4381ab,_0xa8e8fa){_0xa8e8fa=_0xa8e8fa||0xc8;return function(_0x22c38e){if(_0x22c38e){return _0x4381ab[_0x550f('0x15')](_0xa8e8fa)[_0x550f('0x17')](_0x22c38e);}};}function respondWithFilteredResult(_0x5488e1,_0x457959){return function(_0x589702){if(_0x589702){var _0x1998cf=_0x589702[_0x550f('0x18')],_0x4572c2=_0x457959[_0x550f('0x19')],_0x405ad4=_0x457959['offset']+_0x457959['limit'],_0x5053dc;if(_0x405ad4>=_0x1998cf){_0x405ad4=_0x1998cf;_0x5053dc=0xc8;}else{_0x5053dc=0xce;}_0x5488e1[_0x550f('0x15')](_0x5053dc);return _0x5488e1[_0x550f('0x1a')](_0x550f('0x1b'),_0x4572c2+'-'+_0x405ad4+'/'+_0x1998cf)[_0x550f('0x17')](_0x589702);}return null;};}function patchUpdates(_0x4e8f84){return function(_0xd77e0c){try{jsonpatch[_0x550f('0x1c')](_0xd77e0c,_0x4e8f84,!![]);}catch(_0x2bd2c3){return BPromise[_0x550f('0x1d')](_0x2bd2c3);}return _0xd77e0c[_0x550f('0x1e')]();};}function saveUpdates(_0x5a4c2c,_0x1ce820){return function(_0x5d982c){if(_0x5d982c){return _0x5d982c['update'](_0x5a4c2c)['then'](function(_0x37385f){return _0x37385f;});}return null;};}function removeEntity(_0x5c9570,_0x1f1d48){return function(_0x3ac997){if(_0x3ac997){return _0x3ac997[_0x550f('0x1f')]()['then'](function(){_0x5c9570[_0x550f('0x15')](0xcc)[_0x550f('0x16')]();});}};}function handleEntityNotFound(_0x44ede6,_0x5c1564){return function(_0x273bad){if(!_0x273bad){_0x44ede6[_0x550f('0x14')](0x194);}return _0x273bad;};}function handleError(_0x1c85b6,_0x12be22){_0x12be22=_0x12be22||0x1f4;return function(_0x2e14f7){logger[_0x550f('0x20')](_0x2e14f7[_0x550f('0x21')]);if(_0x2e14f7[_0x550f('0x22')]){delete _0x2e14f7[_0x550f('0x22')];}_0x1c85b6[_0x550f('0x15')](_0x12be22)[_0x550f('0x23')](_0x2e14f7);};}exports[_0x550f('0x24')]=function(_0x3204ad,_0xa1092d){var _0x2d5bcd={},_0x241900={},_0x5d1324={'count':0x0,'rows':[]};var _0x4b6072=db[_0x550f('0x25')][_0x550f('0x26')];_0x241900[_0x550f('0x27')]=_[_0x550f('0x28')](_0x4b6072);_0x241900[_0x550f('0x29')]=_['keys'](_0x3204ad[_0x550f('0x29')]);_0x241900[_0x550f('0x2a')]=_[_0x550f('0x2b')](_0x241900[_0x550f('0x27')],_0x241900[_0x550f('0x29')]);_0x2d5bcd[_0x550f('0x2c')]=_[_0x550f('0x2b')](_0x241900['model'],qs[_0x550f('0x2d')](_0x3204ad[_0x550f('0x29')][_0x550f('0x2d')]));_0x2d5bcd['attributes']=_0x2d5bcd['attributes'][_0x550f('0x2e')]?_0x2d5bcd[_0x550f('0x2c')]:_0x241900['model'];if(!_0x3204ad['query'][_0x550f('0x2f')](_0x550f('0x30'))){_0x2d5bcd[_0x550f('0x31')]=qs['limit'](_0x3204ad['query'][_0x550f('0x31')]);_0x2d5bcd[_0x550f('0x19')]=qs[_0x550f('0x19')](_0x3204ad[_0x550f('0x29')][_0x550f('0x19')]);}_0x2d5bcd[_0x550f('0x32')]=qs[_0x550f('0x33')](_0x3204ad[_0x550f('0x29')][_0x550f('0x33')]);_0x2d5bcd[_0x550f('0x34')]=qs[_0x550f('0x2a')](_['pick'](_0x3204ad[_0x550f('0x29')],_0x241900[_0x550f('0x2a')]));if(_0x3204ad[_0x550f('0x29')][_0x550f('0x35')]){_0x2d5bcd[_0x550f('0x34')]=_[_0x550f('0x36')](_0x2d5bcd[_0x550f('0x34')],{'$or':_[_0x550f('0x37')](_0x4b6072,function(_0x537694){if(_0x537694['type'][_0x550f('0x38')]!==_0x550f('0x39')){var _0x497cb2={};_0x497cb2[_0x537694[_0x550f('0x3a')]]={'$like':'%'+_0x3204ad['query'][_0x550f('0x35')]+'%'};return _0x497cb2;}})});}_0x2d5bcd=_['merge']({},_0x2d5bcd,_0x3204ad[_0x550f('0x3b')]);var _0x50221b={'where':_0x2d5bcd[_0x550f('0x34')]};return db[_0x550f('0x25')][_0x550f('0x18')](_0x50221b)[_0x550f('0x3c')](function(_0x2be6de){_0x5d1324[_0x550f('0x18')]=_0x2be6de;if(_0x3204ad[_0x550f('0x29')][_0x550f('0x3d')]){_0x2d5bcd[_0x550f('0x3e')]=[{'all':!![]}];}return db[_0x550f('0x25')][_0x550f('0x3f')](_0x2d5bcd);})[_0x550f('0x3c')](function(_0xa01165){_0x5d1324[_0x550f('0x40')]=_0xa01165;return _0x5d1324;})[_0x550f('0x3c')](respondWithFilteredResult(_0xa1092d,_0x2d5bcd))[_0x550f('0x41')](handleError(_0xa1092d,null));};exports[_0x550f('0x42')]=function(_0x186525,_0x4316e8){var _0x521ee8={'raw':!![],'where':{'id':_0x186525['params']['id']}},_0x53c890={};_0x53c890[_0x550f('0x27')]=_['keys'](db[_0x550f('0x25')][_0x550f('0x26')]);_0x53c890[_0x550f('0x29')]=_[_0x550f('0x28')](_0x186525['query']);_0x53c890[_0x550f('0x2a')]=_['intersection'](_0x53c890[_0x550f('0x27')],_0x53c890[_0x550f('0x29')]);_0x521ee8[_0x550f('0x2c')]=_[_0x550f('0x2b')](_0x53c890[_0x550f('0x27')],qs[_0x550f('0x2d')](_0x186525[_0x550f('0x29')][_0x550f('0x2d')]));_0x521ee8['attributes']=_0x521ee8['attributes'][_0x550f('0x2e')]?_0x521ee8[_0x550f('0x2c')]:_0x53c890[_0x550f('0x27')];if(_0x186525[_0x550f('0x29')][_0x550f('0x3d')]){_0x521ee8[_0x550f('0x3e')]=[{'all':!![]}];}_0x521ee8=_['merge']({},_0x521ee8,_0x186525[_0x550f('0x3b')]);return db['Attachment'][_0x550f('0x43')](_0x521ee8)[_0x550f('0x3c')](handleEntityNotFound(_0x4316e8,null))[_0x550f('0x3c')](respondWithResult(_0x4316e8,null))[_0x550f('0x41')](handleError(_0x4316e8,null));};exports[_0x550f('0x44')]=function(_0x38bda5,_0x41df3b){if(_0x38bda5[_0x550f('0x45')]['id']){delete _0x38bda5[_0x550f('0x45')]['id'];}return db[_0x550f('0x25')][_0x550f('0x43')]({'where':{'id':_0x38bda5['params']['id']}})[_0x550f('0x3c')](handleEntityNotFound(_0x41df3b,null))[_0x550f('0x3c')](saveUpdates(_0x38bda5[_0x550f('0x45')],null))[_0x550f('0x3c')](respondWithResult(_0x41df3b,null))[_0x550f('0x41')](handleError(_0x41df3b,null));};exports[_0x550f('0x1f')]=function(_0x5c5941,_0x2fc22c){return db['Attachment'][_0x550f('0x43')]({'where':{'id':_0x5c5941[_0x550f('0x46')]['id']}})['then'](handleEntityNotFound(_0x2fc22c,null))[_0x550f('0x3c')](removeEntity(_0x2fc22c,null))[_0x550f('0x41')](handleError(_0x2fc22c,null));};exports['create']=function(_0x844f47,_0x57330,_0x61154e){_0x844f47[_0x550f('0x45')]['name']=_0x844f47[_0x550f('0x47')][_0x550f('0x48')];_0x844f47[_0x550f('0x45')][_0x550f('0x49')]=_0x844f47[_0x550f('0x47')][_0x550f('0x4a')];_0x844f47[_0x550f('0x45')]['type']=_0x844f47[_0x550f('0x47')][_0x550f('0x4b')];return db[_0x550f('0x25')][_0x550f('0x4c')](_0x844f47['body'])[_0x550f('0x3c')](respondWithResult(_0x57330,0xc9))[_0x550f('0x41')](handleError(_0x57330,null));};exports[_0x550f('0x4d')]=function(_0x187cc2,_0x335567,_0x3c797f){return db['Attachment']['findOne']({'where':{'id':_0x187cc2[_0x550f('0x46')]['id']},'raw':!![]})[_0x550f('0x3c')](handleEntityNotFound(_0x335567,null))[_0x550f('0x3c')](function(_0x3eb905){if(_0x3eb905){return _0x335567[_0x550f('0x4d')](path[_0x550f('0x4e')](config[_0x550f('0x4f')],_0x550f('0x50'),_0x3eb905['basename']));}})['catch'](handleError(_0x335567,null));}; \ No newline at end of file +var _0x8c13=['attributes','length','model','order','sort','where','pick','filter','map','key','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','find','update','body','create','file','originalname','type','root','server/files/attachments/','basename','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','error','name','send','index','Attachment','rawAttributes','keys','query','filters','intersection','fields'];(function(_0x37bcf9,_0x4d1a77){var _0x5049d3=function(_0x1a14c7){while(--_0x1a14c7){_0x37bcf9['push'](_0x37bcf9['shift']());}};_0x5049d3(++_0x4d1a77);}(_0x8c13,0x194));var _0x38c1=function(_0x196483,_0x26de0b){_0x196483=_0x196483-0x0;var _0x48e8d5=_0x8c13[_0x196483];return _0x48e8d5;};'use strict';var pdf=require(_0x38c1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x38c1('0x1'));var zipdir=require(_0x38c1('0x2'));var jsonpatch=require(_0x38c1('0x3'));var rp=require(_0x38c1('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x38c1('0x5'));var util=require(_0x38c1('0x6'));var path=require(_0x38c1('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x38c1('0x8'));var fs=require('fs');var _=require(_0x38c1('0x9'));var squel=require('squel');var crypto=require(_0x38c1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x38c1('0xb'));var toCsv=require(_0x38c1('0xc'));var querystring=require('querystring');var Papa=require(_0x38c1('0xd'));var Redis=require('ioredis');var authService=require(_0x38c1('0xe'));var qs=require(_0x38c1('0xf'));var hardwareService=require(_0x38c1('0x10'));var logger=require(_0x38c1('0x11'))('api');var utils=require(_0x38c1('0x12'));var config=require(_0x38c1('0x13'));var db=require(_0x38c1('0x14'))['db'];function respondWithStatusCode(_0x1176c8,_0x2f7d17){_0x2f7d17=_0x2f7d17||0xcc;return function(_0x2b5d65){if(_0x2b5d65){return _0x1176c8[_0x38c1('0x15')](_0x2f7d17);}return _0x1176c8['status'](_0x2f7d17)[_0x38c1('0x16')]();};}function respondWithResult(_0x19b5a4,_0x9e5422){_0x9e5422=_0x9e5422||0xc8;return function(_0x4a97a7){if(_0x4a97a7){return _0x19b5a4[_0x38c1('0x17')](_0x9e5422)[_0x38c1('0x18')](_0x4a97a7);}};}function respondWithFilteredResult(_0x90c9f9,_0x556b4b){return function(_0xd85533){if(_0xd85533){var _0x2b0084=_0xd85533[_0x38c1('0x19')],_0x2e175b=_0x556b4b[_0x38c1('0x1a')],_0x36af54=_0x556b4b['offset']+_0x556b4b[_0x38c1('0x1b')],_0xf062c3;if(_0x36af54>=_0x2b0084){_0x36af54=_0x2b0084;_0xf062c3=0xc8;}else{_0xf062c3=0xce;}_0x90c9f9[_0x38c1('0x17')](_0xf062c3);return _0x90c9f9[_0x38c1('0x1c')](_0x38c1('0x1d'),_0x2e175b+'-'+_0x36af54+'/'+_0x2b0084)[_0x38c1('0x18')](_0xd85533);}return null;};}function patchUpdates(_0x32a233){return function(_0x112815){try{jsonpatch[_0x38c1('0x1e')](_0x112815,_0x32a233,!![]);}catch(_0xfa9094){return BPromise[_0x38c1('0x1f')](_0xfa9094);}return _0x112815[_0x38c1('0x20')]();};}function saveUpdates(_0x41dff8,_0x3113ec){return function(_0x2d44fb){if(_0x2d44fb){return _0x2d44fb['update'](_0x41dff8)['then'](function(_0x3c1157){return _0x3c1157;});}return null;};}function removeEntity(_0x202605,_0x172630){return function(_0x26b2bd){if(_0x26b2bd){return _0x26b2bd[_0x38c1('0x21')]()[_0x38c1('0x22')](function(){_0x202605['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x197f0c,_0x3473a2){return function(_0x3bd9c0){if(!_0x3bd9c0){_0x197f0c[_0x38c1('0x15')](0x194);}return _0x3bd9c0;};}function handleError(_0x5ee497,_0x1f4957){_0x1f4957=_0x1f4957||0x1f4;return function(_0x461540){logger[_0x38c1('0x23')](_0x461540['stack']);if(_0x461540[_0x38c1('0x24')]){delete _0x461540[_0x38c1('0x24')];}_0x5ee497[_0x38c1('0x17')](_0x1f4957)[_0x38c1('0x25')](_0x461540);};}exports[_0x38c1('0x26')]=function(_0x298bff,_0x17b1a7){var _0x620faf={},_0x44b36a={},_0x51e4ff={'count':0x0,'rows':[]};var _0x4e8aaf=db[_0x38c1('0x27')][_0x38c1('0x28')];_0x44b36a['model']=_[_0x38c1('0x29')](_0x4e8aaf);_0x44b36a[_0x38c1('0x2a')]=_[_0x38c1('0x29')](_0x298bff[_0x38c1('0x2a')]);_0x44b36a[_0x38c1('0x2b')]=_[_0x38c1('0x2c')](_0x44b36a['model'],_0x44b36a[_0x38c1('0x2a')]);_0x620faf['attributes']=_[_0x38c1('0x2c')](_0x44b36a['model'],qs['fields'](_0x298bff[_0x38c1('0x2a')][_0x38c1('0x2d')]));_0x620faf[_0x38c1('0x2e')]=_0x620faf[_0x38c1('0x2e')][_0x38c1('0x2f')]?_0x620faf[_0x38c1('0x2e')]:_0x44b36a[_0x38c1('0x30')];if(!_0x298bff[_0x38c1('0x2a')]['hasOwnProperty']('nolimit')){_0x620faf[_0x38c1('0x1b')]=qs[_0x38c1('0x1b')](_0x298bff[_0x38c1('0x2a')]['limit']);_0x620faf[_0x38c1('0x1a')]=qs[_0x38c1('0x1a')](_0x298bff[_0x38c1('0x2a')]['offset']);}_0x620faf[_0x38c1('0x31')]=qs[_0x38c1('0x32')](_0x298bff['query']['sort']);_0x620faf[_0x38c1('0x33')]=qs['filters'](_[_0x38c1('0x34')](_0x298bff['query'],_0x44b36a[_0x38c1('0x2b')]));if(_0x298bff[_0x38c1('0x2a')][_0x38c1('0x35')]){_0x620faf[_0x38c1('0x33')]=_['merge'](_0x620faf[_0x38c1('0x33')],{'$or':_[_0x38c1('0x36')](_0x4e8aaf,function(_0xc72f1f){if(_0xc72f1f['type'][_0x38c1('0x37')]!==_0x38c1('0x38')){var _0x576026={};_0x576026[_0xc72f1f['field']]={'$like':'%'+_0x298bff[_0x38c1('0x2a')][_0x38c1('0x35')]+'%'};return _0x576026;}})});}_0x620faf=_[_0x38c1('0x39')]({},_0x620faf,_0x298bff[_0x38c1('0x3a')]);var _0x481491={'where':_0x620faf[_0x38c1('0x33')]};return db['Attachment'][_0x38c1('0x19')](_0x481491)[_0x38c1('0x22')](function(_0x204219){_0x51e4ff['count']=_0x204219;if(_0x298bff[_0x38c1('0x2a')]['includeAll']){_0x620faf[_0x38c1('0x3b')]=[{'all':!![]}];}return db['Attachment'][_0x38c1('0x3c')](_0x620faf);})['then'](function(_0x142549){_0x51e4ff[_0x38c1('0x3d')]=_0x142549;return _0x51e4ff;})[_0x38c1('0x22')](respondWithFilteredResult(_0x17b1a7,_0x620faf))[_0x38c1('0x3e')](handleError(_0x17b1a7,null));};exports[_0x38c1('0x3f')]=function(_0x255daa,_0x1f7c4b){var _0x1d7ea3={'raw':!![],'where':{'id':_0x255daa[_0x38c1('0x40')]['id']}},_0x2a465e={};_0x2a465e[_0x38c1('0x30')]=_[_0x38c1('0x29')](db['Attachment'][_0x38c1('0x28')]);_0x2a465e['query']=_[_0x38c1('0x29')](_0x255daa[_0x38c1('0x2a')]);_0x2a465e[_0x38c1('0x2b')]=_[_0x38c1('0x2c')](_0x2a465e[_0x38c1('0x30')],_0x2a465e['query']);_0x1d7ea3[_0x38c1('0x2e')]=_[_0x38c1('0x2c')](_0x2a465e[_0x38c1('0x30')],qs[_0x38c1('0x2d')](_0x255daa[_0x38c1('0x2a')][_0x38c1('0x2d')]));_0x1d7ea3['attributes']=_0x1d7ea3[_0x38c1('0x2e')][_0x38c1('0x2f')]?_0x1d7ea3[_0x38c1('0x2e')]:_0x2a465e[_0x38c1('0x30')];if(_0x255daa['query']['includeAll']){_0x1d7ea3[_0x38c1('0x3b')]=[{'all':!![]}];}_0x1d7ea3=_[_0x38c1('0x39')]({},_0x1d7ea3,_0x255daa[_0x38c1('0x3a')]);return db[_0x38c1('0x27')][_0x38c1('0x41')](_0x1d7ea3)[_0x38c1('0x22')](handleEntityNotFound(_0x1f7c4b,null))[_0x38c1('0x22')](respondWithResult(_0x1f7c4b,null))[_0x38c1('0x3e')](handleError(_0x1f7c4b,null));};exports[_0x38c1('0x42')]=function(_0x349edc,_0x22672d){if(_0x349edc[_0x38c1('0x43')]['id']){delete _0x349edc[_0x38c1('0x43')]['id'];}return db[_0x38c1('0x27')][_0x38c1('0x41')]({'where':{'id':_0x349edc[_0x38c1('0x40')]['id']}})[_0x38c1('0x22')](handleEntityNotFound(_0x22672d,null))[_0x38c1('0x22')](saveUpdates(_0x349edc[_0x38c1('0x43')],null))[_0x38c1('0x22')](respondWithResult(_0x22672d,null))[_0x38c1('0x3e')](handleError(_0x22672d,null));};exports[_0x38c1('0x21')]=function(_0x477806,_0x379ff9){return db[_0x38c1('0x27')]['find']({'where':{'id':_0x477806[_0x38c1('0x40')]['id']}})[_0x38c1('0x22')](handleEntityNotFound(_0x379ff9,null))[_0x38c1('0x22')](removeEntity(_0x379ff9,null))['catch'](handleError(_0x379ff9,null));};exports[_0x38c1('0x44')]=function(_0x4b1602,_0x520180,_0x4dcc62){_0x4b1602[_0x38c1('0x43')][_0x38c1('0x24')]=_0x4b1602[_0x38c1('0x45')][_0x38c1('0x46')];_0x4b1602['body']['basename']=_0x4b1602[_0x38c1('0x45')]['filename'];_0x4b1602[_0x38c1('0x43')][_0x38c1('0x47')]=_0x4b1602[_0x38c1('0x45')]['mimetype'];return db[_0x38c1('0x27')][_0x38c1('0x44')](_0x4b1602[_0x38c1('0x43')])[_0x38c1('0x22')](respondWithResult(_0x520180,0xc9))[_0x38c1('0x3e')](handleError(_0x520180,null));};exports['download']=function(_0x59bb00,_0x420b2f,_0x9b2c29){return db[_0x38c1('0x27')]['findOne']({'where':{'id':_0x59bb00[_0x38c1('0x40')]['id']},'raw':!![]})[_0x38c1('0x22')](handleEntityNotFound(_0x420b2f,null))[_0x38c1('0x22')](function(_0x40749d){if(_0x40749d){return _0x420b2f['download'](path['join'](config[_0x38c1('0x48')],_0x38c1('0x49'),_0x40749d[_0x38c1('0x4a')]));}})[_0x38c1('0x3e')](handleError(_0x420b2f,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index d348da7..dd4f403 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 _0xab5b=['Attachment','attachments','lodash','util','api','moment','path','../../config/environment','./attachment.attributes','exports'];(function(_0x3eb8c8,_0x17ea65){var _0x50efe9=function(_0x1f1d3c){while(--_0x1f1d3c){_0x3eb8c8['push'](_0x3eb8c8['shift']());}};_0x50efe9(++_0x17ea65);}(_0xab5b,0x11a));var _0xbab5=function(_0x3be623,_0x3b4381){_0x3be623=_0x3be623-0x0;var _0x2ae423=_0xab5b[_0x3be623];return _0x2ae423;};'use strict';var _=require(_0xbab5('0x0'));var util=require(_0xbab5('0x1'));var logger=require('../../config/logger')(_0xbab5('0x2'));var moment=require(_0xbab5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbab5('0x4'));var rimraf=require('rimraf');var config=require(_0xbab5('0x5'));var attributes=require(_0xbab5('0x6'));module[_0xbab5('0x7')]=function(_0x214f8c,_0xae91d9){return _0x214f8c['define'](_0xbab5('0x8'),attributes,{'tableName':_0xbab5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x32c0=['../../config/environment','exports','define','attachments','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x1dcbf5,_0x45c68c){var _0xe2a674=function(_0x4b4a2c){while(--_0x4b4a2c){_0x1dcbf5['push'](_0x1dcbf5['shift']());}};_0xe2a674(++_0x45c68c);}(_0x32c0,0x1f3));var _0x032c=function(_0x33f0f6,_0x11d025){_0x33f0f6=_0x33f0f6-0x0;var _0x1b0f40=_0x32c0[_0x33f0f6];return _0x1b0f40;};'use strict';var _=require(_0x032c('0x0'));var util=require(_0x032c('0x1'));var logger=require('../../config/logger')(_0x032c('0x2'));var moment=require(_0x032c('0x3'));var BPromise=require('bluebird');var rp=require(_0x032c('0x4'));var fs=require('fs');var path=require(_0x032c('0x5'));var rimraf=require(_0x032c('0x6'));var config=require(_0x032c('0x7'));var attributes=require('./attachment.attributes');module[_0x032c('0x8')]=function(_0x282c50,_0x2d5376){return _0x282c50[_0x032c('0x9')]('Attachment',attributes,{'tableName':_0x032c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 4f6b235..e696691 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 _0x1d66=['request\x20sent','stringify','error','message','Attachment,\x20%s,\x20%s','catch','Attachment','body','options','CreateAttachment','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info'];(function(_0x4961d7,_0x1577f1){var _0x31850e=function(_0x40cc4d){while(--_0x40cc4d){_0x4961d7['push'](_0x4961d7['shift']());}};_0x31850e(++_0x1577f1);}(_0x1d66,0xfc));var _0x61d6=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x1d66[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x61d6('0x0'));var util=require(_0x61d6('0x1'));var moment=require('moment');var BPromise=require(_0x61d6('0x2'));var rs=require(_0x61d6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x61d6('0x4'))['db'];var utils=require(_0x61d6('0x5'));var logger=require(_0x61d6('0x6'))('rpc');var config=require(_0x61d6('0x7'));var jayson=require(_0x61d6('0x8'));var client=jayson['client'][_0x61d6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4160f1,_0x50b7a1,_0x2c50c4){return new BPromise(function(_0x2a88b3,_0x53b965){return client['request'](_0x4160f1,_0x2c50c4)[_0x61d6('0xa')](function(_0x1a30d7){logger[_0x61d6('0xb')]('Attachment,\x20%s,\x20%s',_0x50b7a1,'request\x20sent');logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x50b7a1,_0x61d6('0xc'),JSON[_0x61d6('0xd')](_0x1a30d7));if(_0x1a30d7['error']){if(_0x1a30d7[_0x61d6('0xe')]['code']===0x1f4){logger[_0x61d6('0xe')]('Attachment,\x20%s,\x20%s',_0x50b7a1,_0x1a30d7[_0x61d6('0xe')][_0x61d6('0xf')]);return _0x53b965(_0x1a30d7[_0x61d6('0xe')]['message']);}logger['error'](_0x61d6('0x10'),_0x50b7a1,_0x1a30d7[_0x61d6('0xe')]['message']);return _0x2a88b3(_0x1a30d7[_0x61d6('0xe')]['message']);}else{logger[_0x61d6('0xb')](_0x61d6('0x10'),_0x50b7a1,'request\x20sent');_0x2a88b3(_0x1a30d7['result'][_0x61d6('0xf')]);}})[_0x61d6('0x11')](function(_0x5a30be){logger[_0x61d6('0xe')](_0x61d6('0x10'),_0x50b7a1,_0x5a30be);_0x53b965(_0x5a30be);});});}exports['CreateAttachment']=function(_0x22701d){var _0x5a453b=this;return new Promise(function(_0xe6910,_0x31652a){return db[_0x61d6('0x12')]['create'](_0x22701d[_0x61d6('0x13')],{'raw':_0x22701d['options']?_0x22701d[_0x61d6('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x61d6('0xa')](function(_0xd092e8){logger[_0x61d6('0xb')](_0x61d6('0x15'),_0x22701d);logger['debug'](_0x61d6('0x15'),_0x22701d,JSON[_0x61d6('0xd')](_0xd092e8));_0xe6910(_0xd092e8);})[_0x61d6('0x11')](function(_0x200781){logger['error'](_0x61d6('0x15'),_0x200781['message'],_0x22701d);_0x31652a(_0x5a453b[_0x61d6('0xe')](0x1f4,_0x200781['message']));});});}; \ No newline at end of file +var _0x2b80=['request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Attachment,\x20%s,\x20%s','info','result','catch','CreateAttachment','create','body','options','raw','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2b80,0x1a6));var _0x02b8=function(_0x6aad74,_0x32ecf4){_0x6aad74=_0x6aad74-0x0;var _0x5b1c38=_0x2b80[_0x6aad74];return _0x5b1c38;};'use strict';var _=require(_0x02b8('0x0'));var util=require('util');var moment=require(_0x02b8('0x1'));var BPromise=require(_0x02b8('0x2'));var rs=require(_0x02b8('0x3'));var fs=require('fs');var Redis=require(_0x02b8('0x4'));var db=require(_0x02b8('0x5'))['db'];var utils=require(_0x02b8('0x6'));var logger=require(_0x02b8('0x7'))(_0x02b8('0x8'));var config=require('../../config/environment');var jayson=require(_0x02b8('0x9'));var client=jayson[_0x02b8('0xa')][_0x02b8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a41fb,_0x3b76e7,_0x5dbece){return new BPromise(function(_0x3dcb6c,_0x614e70){return client['request'](_0x3a41fb,_0x5dbece)[_0x02b8('0xc')](function(_0xc53096){logger['info']('Attachment,\x20%s,\x20%s',_0x3b76e7,_0x02b8('0xd'));logger['debug'](_0x02b8('0xe'),_0x3b76e7,'request\x20sent',JSON[_0x02b8('0xf')](_0xc53096));if(_0xc53096[_0x02b8('0x10')]){if(_0xc53096[_0x02b8('0x10')][_0x02b8('0x11')]===0x1f4){logger[_0x02b8('0x10')]('Attachment,\x20%s,\x20%s',_0x3b76e7,_0xc53096[_0x02b8('0x10')][_0x02b8('0x12')]);return _0x614e70(_0xc53096[_0x02b8('0x10')][_0x02b8('0x12')]);}logger[_0x02b8('0x10')](_0x02b8('0x13'),_0x3b76e7,_0xc53096['error'][_0x02b8('0x12')]);return _0x3dcb6c(_0xc53096['error'][_0x02b8('0x12')]);}else{logger[_0x02b8('0x14')]('Attachment,\x20%s,\x20%s',_0x3b76e7,'request\x20sent');_0x3dcb6c(_0xc53096[_0x02b8('0x15')][_0x02b8('0x12')]);}})[_0x02b8('0x16')](function(_0x3e723d){logger['error']('Attachment,\x20%s,\x20%s',_0x3b76e7,_0x3e723d);_0x614e70(_0x3e723d);});});}exports[_0x02b8('0x17')]=function(_0x255db5){var _0x63ea86=this;return new Promise(function(_0x55897a,_0x113971){return db['Attachment'][_0x02b8('0x18')](_0x255db5[_0x02b8('0x19')],{'raw':_0x255db5[_0x02b8('0x1a')]?_0x255db5[_0x02b8('0x1a')][_0x02b8('0x1b')]===undefined?!![]:![]:!![]})[_0x02b8('0xc')](function(_0x1b71bc){logger[_0x02b8('0x14')](_0x02b8('0x17'),_0x255db5);logger[_0x02b8('0x1c')](_0x02b8('0x17'),_0x255db5,JSON['stringify'](_0x1b71bc));_0x55897a(_0x1b71bc);})[_0x02b8('0x16')](function(_0x290a25){logger[_0x02b8('0x10')](_0x02b8('0x17'),_0x290a25[_0x02b8('0x12')],_0x255db5);_0x113971(_0x63ea86[_0x02b8('0x10')](0x1f4,_0x290a25[_0x02b8('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index c4547e6..fb437a1 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 _0x4b07=['download','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','post','single','create','delete','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./attachment.controller','get','/:id','isAuthenticated'];(function(_0x3c59c7,_0x33e97d){var _0x2eb295=function(_0x40cec4){while(--_0x40cec4){_0x3c59c7['push'](_0x3c59c7['shift']());}};_0x2eb295(++_0x33e97d);}(_0x4b07,0x1d6));var _0x74b0=function(_0x570a5d,_0x5aefc3){_0x570a5d=_0x570a5d-0x0;var _0x1bedf8=_0x4b07[_0x570a5d];return _0x1bedf8;};'use strict';var multer=require('multer');var util=require(_0x74b0('0x0'));var path=require(_0x74b0('0x1'));var timeout=require('connect-timeout');var express=require(_0x74b0('0x2'));var router=express[_0x74b0('0x3')]();var auth=require(_0x74b0('0x4'));var interaction=require(_0x74b0('0x5'));var config=require('../../config/environment');var controller=require(_0x74b0('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x74b0('0x7')](_0x74b0('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x74b0('0x7')]('/:id/download',auth[_0x74b0('0x9')](),controller[_0x74b0('0xa')]);var upload=multer({'storage':multer[_0x74b0('0xb')]({'destination':function(_0x419fab,_0x3a516c,_0x462a84){_0x462a84(null,path[_0x74b0('0xc')](config[_0x74b0('0xd')],_0x74b0('0xe')));},'filename':function(_0x12a169,_0x2907a8,_0x7b1274){_0x7b1274(null,util[_0x74b0('0xf')](_0x74b0('0x10'),Date[_0x74b0('0x11')](),_0x2907a8[_0x74b0('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x74b0('0x13')]('/',upload[_0x74b0('0x14')]('file'),controller[_0x74b0('0x15')]);router['put'](_0x74b0('0x8'),auth[_0x74b0('0x9')](),controller['update']);router[_0x74b0('0x16')]('/:id',auth[_0x74b0('0x9')](),controller['destroy']);module[_0x74b0('0x17')]=router; \ No newline at end of file +var _0x9c44=['format','%s-%s','originalname','replace','single','file','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','server/files/attachments/'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x9c44,0x178));var _0x49c4=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x9c44[_0x543084];return _0x306a57;};'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('./attachment.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')]);var upload=multer({'storage':multer[_0x49c4('0xd')]({'destination':function(_0x4c7d3a,_0x5ab4a3,_0x451ea6){_0x451ea6(null,path[_0x49c4('0xe')](config['root'],_0x49c4('0xf')));},'filename':function(_0x459d09,_0x4adb3c,_0x536d42){_0x536d42(null,util[_0x49c4('0x10')](_0x49c4('0x11'),Date['now'](),_0x4adb3c[_0x49c4('0x12')][_0x49c4('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/',upload[_0x49c4('0x14')](_0x49c4('0x15')),controller[_0x49c4('0x16')]);router[_0x49c4('0x17')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x18')]);router[_0x49c4('0x19')]('/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0x1a')]);module[_0x49c4('0x1b')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index df9ce8e..07ecc17 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 _0x9c48=['User','find','map','emails','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then'];(function(_0x22338b,_0x15fd61){var _0x4ba4b5=function(_0x257956){while(--_0x257956){_0x22338b['push'](_0x22338b['shift']());}};_0x4ba4b5(++_0x15fd61);}(_0x9c48,0xa1));var _0x89c4=function(_0x57b8f1,_0x596c03){_0x57b8f1=_0x57b8f1-0x0;var _0x326cfc=_0x9c48[_0x57b8f1];return _0x326cfc;};'use strict';var _=require(_0x89c4('0x0'));var passport=require(_0x89c4('0x1'));var GoogleStrategy=require(_0x89c4('0x2'))['Strategy'];var moment=require(_0x89c4('0x3'));var db=require(_0x89c4('0x4'))['db'];var config=require(_0x89c4('0x5'));var signToken=require('../../components/auth/service')['signToken'];var utils=require(_0x89c4('0x6'));exports[_0x89c4('0x7')]=passport['authenticate'](_0x89c4('0x8'),{'failureRedirect':_0x89c4('0x9'),'scope':[_0x89c4('0xa'),_0x89c4('0xb')],'session':![]});exports[_0x89c4('0xc')]=passport[_0x89c4('0xd')](_0x89c4('0x8'),{'failureRedirect':_0x89c4('0x9'),'session':![]});passport[_0x89c4('0xe')](new GoogleStrategy({'clientID':config[_0x89c4('0x8')]?config[_0x89c4('0x8')][_0x89c4('0xf')]:'id','clientSecret':config[_0x89c4('0x8')]?config[_0x89c4('0x8')][_0x89c4('0x10')]:_0x89c4('0x11'),'callbackURL':config[_0x89c4('0x8')]?config[_0x89c4('0x8')][_0x89c4('0x12')]:''},function(_0x1db88c,_0x5b98e4,_0x59516a,_0x58f872){var _0x1d2e9d,_0x172291;return db[_0x89c4('0x13')][_0x89c4('0x14')]({'where':{'id':0x1},'attributes':[_0x89c4('0x15'),_0x89c4('0x16')],'raw':!![]})[_0x89c4('0x17')](function(_0x5aca22){_0x1d2e9d=_0x5aca22;return db[_0x89c4('0x18')][_0x89c4('0x19')]({'where':{'email':_[_0x89c4('0x1a')](_0x59516a[_0x89c4('0x1b')],'value'),'role':{'$or':[_0x89c4('0x1c'),_0x89c4('0x1d'),_0x89c4('0x1e')]}}});})['then'](function(_0x41cb06){_0x172291=_0x41cb06;if(_0x172291){if(_0x172291['disabled']){return _0x58f872(_0x89c4('0x1f'));}else if(_0x1d2e9d[_0x89c4('0x16')]>0x0){if(_0x172291['blocked']){if(moment(_0x172291[_0x89c4('0x20')])['add'](_0x1d2e9d['blockDuration'],_0x89c4('0x21'))>moment()){return _0x58f872(_0x89c4('0x1f'));}else{return utils[_0x89c4('0x22')](_0x172291,0x0,![],null)['then'](function(){return utils[_0x89c4('0x23')](_0x172291);})['then'](function(){return _0x58f872(null,_0x172291);});}}else{return utils[_0x89c4('0x23')](_0x172291)[_0x89c4('0x17')](function(){return _0x58f872(null,_0x172291);});}}else{return utils['getLicense'](_0x172291)[_0x89c4('0x17')](function(){return _0x58f872(null,_0x172291);});}}return _0x58f872(_0x89c4('0x1f'));})[_0x89c4('0x24')](function(_0xc528ee){_0x58f872(_0xc528ee);});})); \ No newline at end of file +var _0xcbd3=['Setting','then','find','map','emails','value','admin','user','disabled','blocked','add','blockDuration','clearBlockUser','getLicense','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','authenticate','google','profile','callback','/login','use','clientSecret','secret','callbackURL'];(function(_0x137a38,_0x2bc49c){var _0x24e40c=function(_0x5eb13c){while(--_0x5eb13c){_0x137a38['push'](_0x137a38['shift']());}};_0x24e40c(++_0x2bc49c);}(_0xcbd3,0x1eb));var _0x3cbd=function(_0x5ca11b,_0x20f54b){_0x5ca11b=_0x5ca11b-0x0;var _0x40407b=_0xcbd3[_0x5ca11b];return _0x40407b;};'use strict';var _=require(_0x3cbd('0x0'));var passport=require(_0x3cbd('0x1'));var GoogleStrategy=require(_0x3cbd('0x2'))[_0x3cbd('0x3')];var moment=require(_0x3cbd('0x4'));var db=require(_0x3cbd('0x5'))['db'];var config=require(_0x3cbd('0x6'));var signToken=require(_0x3cbd('0x7'))[_0x3cbd('0x8')];var utils=require(_0x3cbd('0x9'));exports['login']=passport[_0x3cbd('0xa')](_0x3cbd('0xb'),{'failureRedirect':'/login','scope':[_0x3cbd('0xc'),'email'],'session':![]});exports[_0x3cbd('0xd')]=passport['authenticate'](_0x3cbd('0xb'),{'failureRedirect':_0x3cbd('0xe'),'session':![]});passport[_0x3cbd('0xf')](new GoogleStrategy({'clientID':config[_0x3cbd('0xb')]?config[_0x3cbd('0xb')]['clientID']:'id','clientSecret':config[_0x3cbd('0xb')]?config['google'][_0x3cbd('0x10')]:_0x3cbd('0x11'),'callbackURL':config[_0x3cbd('0xb')]?config['google'][_0x3cbd('0x12')]:''},function(_0x26bb22,_0x210614,_0x1addbc,_0x5e74a3){var _0x5f4395,_0xc90a9a;return db[_0x3cbd('0x13')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x3cbd('0x14')](function(_0x50c8c1){_0x5f4395=_0x50c8c1;return db['User'][_0x3cbd('0x15')]({'where':{'email':_[_0x3cbd('0x16')](_0x1addbc[_0x3cbd('0x17')],_0x3cbd('0x18')),'role':{'$or':[_0x3cbd('0x19'),_0x3cbd('0x1a'),'agent']}}});})[_0x3cbd('0x14')](function(_0xc54a96){_0xc90a9a=_0xc54a96;if(_0xc90a9a){if(_0xc90a9a[_0x3cbd('0x1b')]){return _0x5e74a3('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x5f4395['blockDuration']>0x0){if(_0xc90a9a[_0x3cbd('0x1c')]){if(moment(_0xc90a9a['blockedAt'])[_0x3cbd('0x1d')](_0x5f4395[_0x3cbd('0x1e')],'minutes')>moment()){return _0x5e74a3('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x3cbd('0x1f')](_0xc90a9a,0x0,![],null)[_0x3cbd('0x14')](function(){return utils[_0x3cbd('0x20')](_0xc90a9a);})[_0x3cbd('0x14')](function(){return _0x5e74a3(null,_0xc90a9a);});}}else{return utils[_0x3cbd('0x20')](_0xc90a9a)[_0x3cbd('0x14')](function(){return _0x5e74a3(null,_0xc90a9a);});}}else{return utils[_0x3cbd('0x20')](_0xc90a9a)[_0x3cbd('0x14')](function(){return _0x5e74a3(null,_0xc90a9a);});}}return _0x5e74a3(_0x3cbd('0x21'));})['catch'](function(_0x543b51){_0x5e74a3(_0x543b51);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index fcb9e1f..dcf7565 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 _0xc090=['passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','callback','isMiddleware','exports','express'];(function(_0x199ff2,_0x5d2eb4){var _0x5af66d=function(_0x7292ab){while(--_0x7292ab){_0x199ff2['push'](_0x199ff2['shift']());}};_0x5af66d(++_0x5d2eb4);}(_0xc090,0x112));var _0x0c09=function(_0x55350f,_0x374adc){_0x55350f=_0x55350f-0x0;var _0x455d99=_0xc090[_0x55350f];return _0x455d99;};'use strict';var express=require(_0x0c09('0x0'));var passport=require(_0x0c09('0x1'));var router=express[_0x0c09('0x2')]();var controller=require(_0x0c09('0x3'));var userController=require(_0x0c09('0x4'));var authService=require(_0x0c09('0x5'));router[_0x0c09('0x6')]('/',controller[_0x0c09('0x7')]);router[_0x0c09('0x6')]('/callback',controller[_0x0c09('0x8')],authService[_0x0c09('0x9')],userController['login'],authService['setTokenCookie']);module[_0x0c09('0xa')]=router; \ No newline at end of file +var _0x480c=['callback','isMiddleware','setTokenCookie','exports','Router','../../components/auth/service','get','/callback'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x480c,0xcc));var _0xc480=function(_0x1d3a27,_0x5c2781){_0x1d3a27=_0x1d3a27-0x0;var _0xcd800b=_0x480c[_0x1d3a27];return _0xcd800b;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0xc480('0x0')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0xc480('0x1'));router[_0xc480('0x2')]('/',controller['login']);router[_0xc480('0x2')](_0xc480('0x3'),controller[_0xc480('0x4')],authService[_0xc480('0x5')],userController['login'],authService[_0xc480('0x6')]);module[_0xc480('0x7')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index ce061e7..289e19e 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 _0xad8c=['User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','reset','params','token','now','Setting','securePassword','Password\x20reset!','use','util','passport','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','add','minutes','clearBlockUser','getLicense','blocked','catch','MailAccount','email','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','format','stringify','error','send','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','findOne'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xad8c,0x68));var _0xcad8=function(_0x338f73,_0x1945c8){_0x338f73=_0x338f73-0x0;var _0x163fdf=_0xad8c[_0x338f73];return _0x163fdf;};'use strict';var util=require(_0xcad8('0x0'));var passport=require(_0xcad8('0x1'));var LocalStrategy=require('passport-local')[_0xcad8('0x2')];var jayson=require(_0xcad8('0x3'));var _=require(_0xcad8('0x4'));var rs=require('randomstring');var moment=require(_0xcad8('0x5'));var db=require(_0xcad8('0x6'))['db'];var signToken=require(_0xcad8('0x7'))['signToken'];var utils=require(_0xcad8('0x8'));var client=jayson[_0xcad8('0x9')][_0xcad8('0xa')]({'port':0x232b});function localAuthenticate(_0x4433e2,_0xb161d2,_0x11041e,_0x350500){var _0x41e7d9,_0x4bb76c;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xcad8('0xb'),_0xcad8('0xc')],'raw':!![]})[_0xcad8('0xd')](function(_0x45cd24){_0x41e7d9=_0x45cd24;return _0x4433e2['findOne']({'attributes':['id',_0xcad8('0xe'),_0xcad8('0xf'),_0xcad8('0x10'),_0xcad8('0x11'),_0xcad8('0x12'),'blocked',_0xcad8('0x13'),'loginAttempts'],'where':{'name':_0xb161d2,'role':{'$or':[_0xcad8('0x14'),_0xcad8('0x15'),_0xcad8('0x16')]}}});})['then'](function(_0x1c284f){if(!_0x1c284f||_0x1c284f&&_0x1c284f[_0xcad8('0xe')]!==_0xb161d2){throw new Error(_0xcad8('0x17'));}else{_0x4bb76c=_0x1c284f;return _0x4bb76c;}})['then'](function(){_0x4bb76c['authenticate'](_0x11041e,function(_0x4d1c44,_0x117366){var _0x437d09=_0x4bb76c[_0xcad8('0x18')]+0x1;if(_0x4d1c44){return _0x350500(_0x4d1c44);}else if(!_0x117366){if(_0x4bb76c[_0xcad8('0x12')]){return _0x350500(null,![],{'message':_0xcad8('0x17')});}else if(_0x41e7d9[_0xcad8('0xb')]>0x0){if(_0x4bb76c['blocked']){if(_0x41e7d9[_0xcad8('0xc')]>0x0){if(moment(_0x4bb76c['blockedAt'])[_0xcad8('0x19')](_0x41e7d9['blockDuration'],_0xcad8('0x1a'))>moment()){return _0x350500(null,![],{'message':_0xcad8('0x17')});}else{return utils[_0xcad8('0x1b')](_0x4bb76c,_0x437d09,![],null)[_0xcad8('0xd')](function(){return _0x350500(null,![],{'message':_0xcad8('0x17')});});}}else{return _0x350500(null,![],{'message':_0xcad8('0x17')});}}else{if(_0x437d09>=_0x41e7d9[_0xcad8('0xb')]){return utils['clearBlockUser'](_0x4bb76c,0x0,!![],moment())[_0xcad8('0xd')](function(){return _0x350500(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x4bb76c,_0x437d09,![],null)['then'](function(){return _0x350500(null,![],{'message':_0xcad8('0x17')});});}}}else{return _0x350500(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x4bb76c['disabled']){return _0x350500(null,![],{'message':_0xcad8('0x17')});}else if(_0x41e7d9[_0xcad8('0xb')]>0x0){if(_0x4bb76c['blocked']){if(_0x41e7d9[_0xcad8('0xc')]>0x0){if(moment(_0x4bb76c[_0xcad8('0x13')])[_0xcad8('0x19')](_0x41e7d9['blockDuration'],_0xcad8('0x1a'))>moment()){return _0x350500(null,![],{'message':_0xcad8('0x17')});}else{return utils['clearBlockUser'](_0x4bb76c,0x0,![],null)[_0xcad8('0xd')](function(){return utils[_0xcad8('0x1c')](_0x4bb76c);})[_0xcad8('0xd')](function(){return _0x350500(null,_0x4bb76c);});}}else{return _0x350500(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x4bb76c,0x0,![],null)['then'](function(){return utils[_0xcad8('0x1c')](_0x4bb76c);})['then'](function(){return _0x350500(null,_0x4bb76c);})['catch'](function(_0x4d7d48){return _0x350500(null,![],_0x4d7d48);});}}else{if(_0x4bb76c[_0xcad8('0x1d')]){return _0x350500(null,![],{'message':_0xcad8('0x17')});}else{return utils[_0xcad8('0x1c')](_0x4bb76c)[_0xcad8('0xd')](function(){return _0x350500(null,_0x4bb76c);});}}}});})[_0xcad8('0x1e')](function(_0x302468){return _0x350500(null,![],_0x302468);});}function sendServiceMail(_0x2b55b6){return db[_0xcad8('0x1f')]['find']({'where':{'service':!![]},'attributes':['id',_0xcad8('0xe'),_0xcad8('0x20')],'include':[{'model':db[_0xcad8('0x21')],'as':_0xcad8('0x22')}]})['then'](function(_0x506b52){if(!_0x506b52){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x31628f={'tls':{'rejectUnauthorized':![]}};if(_0x506b52[_0xcad8('0x22')][_0xcad8('0x23')]){_0x31628f[_0xcad8('0x23')]=_0x506b52[_0xcad8('0x22')]['service'];}else{_0x31628f['host']=_0x506b52['Smtp'][_0xcad8('0x24')];_0x31628f[_0xcad8('0x25')]=_0x506b52['Smtp'][_0xcad8('0x25')];_0x31628f[_0xcad8('0x26')]=_0x506b52[_0xcad8('0x22')]['secure'];}if(_0x506b52[_0xcad8('0x22')][_0xcad8('0x27')]){_0x31628f[_0xcad8('0x28')]={'user':_0x506b52[_0xcad8('0x22')][_0xcad8('0x15')],'pass':_0x506b52[_0xcad8('0x22')][_0xcad8('0x29')]};}var _0x323e65={'account':_0x31628f,'message':_['merge']({'from':util['format']('\x22%s\x22\x20<%s>',_0x506b52[_0xcad8('0xe')],_0x506b52['email']||_0x506b52[_0xcad8('0x22')][_0xcad8('0x15')])},_0x2b55b6)};return client['request'](_0xcad8('0x2a'),_0x323e65);})[_0xcad8('0xd')](function(_0x1be339){if(_0x1be339['error']){throw new Error(util[_0xcad8('0x2b')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x1be339['error']['message']||JSON[_0xcad8('0x2c')](_0x1be339[_0xcad8('0x2d')])));}return!![];});}function handleError(_0xbffba5,_0x3b2699,_0x45f68a){return _0xbffba5['status'](_0x3b2699||0x1f4)[_0xcad8('0x2e')]({'message':_0x45f68a?_0x45f68a['message']||_0x45f68a:''});}function checkPasswordPattern(_0x37649c,_0x222c46,_0x717fd3){if(_0x717fd3){var _0xd68e64=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xd68e64['test'](_0x222c46)){return _0x37649c;}else{throw new Error(_0xcad8('0x2f'));}}else{return _0x37649c;}}exports[_0xcad8('0x30')]=function(_0x584d1d,_0x4d11ae,_0x23ee9b){passport['authenticate'](_0xcad8('0x31'),function(_0x4e2a8b,_0x390f79,_0xe8df39){var _0xc4f548=_0x4e2a8b||_0xe8df39;if(_0xc4f548){return handleError(_0x4d11ae,0x191,_0xc4f548);}if(!_0x390f79){return handleError(_0x4d11ae,0x194,{'message':_0xcad8('0x32')});}else{var _0x4b877c=signToken(_0x390f79['id'],_0x390f79[_0xcad8('0x11')]);_0x4d11ae[_0xcad8('0x33')]({'id':_0x390f79['id'],'token':_0x4b877c,'statusCall':'','isAlreadyLogged':_0x390f79[_0xcad8('0x34')]});}})(_0x584d1d,_0x4d11ae,_0x23ee9b);};exports[_0xcad8('0x35')]=function(_0x296184,_0x3ce240,_0x1d534f){if(!_0x296184[_0xcad8('0x36')]['email']){return handleError(_0x3ce240,0x1f4,{'message':_0xcad8('0x37')});}var _0x39a650=rs[_0xcad8('0x38')]();_0x296184[_0xcad8('0x36')][_0xcad8('0x20')]=_0x296184[_0xcad8('0x36')]['email'][_0xcad8('0x39')]()[_0xcad8('0x3a')]();var _0x15d0a4;return db['Setting'][_0xcad8('0x3b')]({'where':{'id':0x1},'attributes':[_0xcad8('0xb'),'blockDuration'],'raw':!![]})[_0xcad8('0xd')](function(_0x5ea89d){_0x15d0a4=_0x5ea89d;return db[_0xcad8('0x3c')][_0xcad8('0x3d')]({'where':{'email':_0x296184[_0xcad8('0x36')]['email']}});})['then'](function(_0x23f00d){if(!_0x23f00d){throw new Error(_0xcad8('0x3e'));}if(_0x23f00d['disabled']){throw new Error(_0xcad8('0x3f'));}if(_0x23f00d[_0xcad8('0x1d')]){if(moment(_0x23f00d['blockedAt'])[_0xcad8('0x19')](_0x15d0a4[_0xcad8('0xc')],_0xcad8('0x1a'))>moment()){throw new Error(_0xcad8('0x40'));}else{_0x23f00d[_0xcad8('0x1d')]=![];_0x23f00d[_0xcad8('0x13')]=null;}}_0x23f00d['resetPasswordToken']=_0x39a650;_0x23f00d[_0xcad8('0x41')]=Date['now']()+0x36ee80;return _0x23f00d[_0xcad8('0x42')]();})[_0xcad8('0xd')](function(){return sendServiceMail({'to':_0x296184[_0xcad8('0x36')][_0xcad8('0x20')],'subject':_0xcad8('0x43'),'text':_0xcad8('0x44')+_0xcad8('0x45')+_0xcad8('0x46')+_0x296184['headers'][_0xcad8('0x24')]+_0xcad8('0x47')+_0x39a650+'\x0a\x0a'+_0xcad8('0x48')});})[_0xcad8('0xd')](function(){_0x3ce240[_0xcad8('0x49')](0xc8)[_0xcad8('0x2e')]({'message':'Reset\x20Email\x20sent!'});})[_0xcad8('0x1e')](function(_0x113a1e){return handleError(_0x3ce240,0x1f4,_0x113a1e);});};exports[_0xcad8('0x4a')]=function(_0x2eecda,_0xb90f3e,_0x303d92){var _0x4f7eeb;return db[_0xcad8('0x3c')][_0xcad8('0x3d')]({'where':{'resetPasswordToken':_0x2eecda[_0xcad8('0x4b')][_0xcad8('0x4c')],'resetPasswordExpires':{'$gt':Date[_0xcad8('0x4d')]()}}})[_0xcad8('0xd')](function(_0x5c6bc4){_0x4f7eeb=_0x5c6bc4;if(!_0x4f7eeb){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xcad8('0x4e')]['findOne']({'attributes':['id','securePassword']});})[_0xcad8('0xd')](function(_0x4020a6){return checkPasswordPattern(_0x4020a6,_0x2eecda[_0xcad8('0x36')][_0xcad8('0xf')],_0x4020a6[_0xcad8('0x4f')]);})[_0xcad8('0xd')](function(){_0x4f7eeb[_0xcad8('0xf')]=_0x2eecda[_0xcad8('0x36')][_0xcad8('0xf')];_0x4f7eeb['resetPasswordToken']=null;_0x4f7eeb[_0xcad8('0x41')]=null;return _0x4f7eeb[_0xcad8('0x42')]();})[_0xcad8('0xd')](function(){_0xb90f3e[_0xcad8('0x49')](0xc8)[_0xcad8('0x2e')]({'message':_0xcad8('0x50')});})[_0xcad8('0x1e')](function(_0x1736b5){return handleError(_0xb90f3e,0x1f4,_0x1736b5);});};passport[_0xcad8('0x51')](new LocalStrategy({'usernameField':_0xcad8('0xe'),'passwordField':'password'},function(_0x3a21d0,_0xaf650e,_0x4a1741){return localAuthenticate(db[_0xcad8('0x3c')],_0x3a21d0,_0xaf650e,_0x4a1741);})); \ No newline at end of file +var _0x18a9=['user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense','catch','MailAccount','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','Smtp','host','port','auth','merge','email','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','test','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','password','Password\x20reset!','passport-local','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','signToken','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','salt','disabled','blocked','blockedAt','loginAttempts','admin'];(function(_0x25fb88,_0x5922a3){var _0x16f6f8=function(_0x1f8377){while(--_0x1f8377){_0x25fb88['push'](_0x25fb88['shift']());}};_0x16f6f8(++_0x5922a3);}(_0x18a9,0x18a));var _0x918a=function(_0x5d5827,_0x512422){_0x5d5827=_0x5d5827-0x0;var _0x463c75=_0x18a9[_0x5d5827];return _0x463c75;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0x918a('0x0'))[_0x918a('0x1')];var jayson=require('jayson/promise');var _=require(_0x918a('0x2'));var rs=require(_0x918a('0x3'));var moment=require(_0x918a('0x4'));var db=require(_0x918a('0x5'))['db'];var signToken=require(_0x918a('0x6'))[_0x918a('0x7')];var utils=require('../../config/utils');var client=jayson[_0x918a('0x8')][_0x918a('0x9')]({'port':0x232b});function localAuthenticate(_0x472c8b,_0x3cbfe2,_0x258078,_0x2ec08a){var _0x270a06,_0x1d7aa0;return db[_0x918a('0xa')][_0x918a('0xb')]({'where':{'id':0x1},'attributes':[_0x918a('0xc'),_0x918a('0xd')],'raw':!![]})[_0x918a('0xe')](function(_0x2fa452){_0x270a06=_0x2fa452;return _0x472c8b[_0x918a('0xb')]({'attributes':['id','name','password',_0x918a('0xf'),'role',_0x918a('0x10'),_0x918a('0x11'),_0x918a('0x12'),_0x918a('0x13')],'where':{'name':_0x3cbfe2,'role':{'$or':[_0x918a('0x14'),_0x918a('0x15'),_0x918a('0x16')]}}});})[_0x918a('0xe')](function(_0xb8ce9){if(!_0xb8ce9||_0xb8ce9&&_0xb8ce9[_0x918a('0x17')]!==_0x3cbfe2){throw new Error(_0x918a('0x18'));}else{_0x1d7aa0=_0xb8ce9;return _0x1d7aa0;}})[_0x918a('0xe')](function(){_0x1d7aa0[_0x918a('0x19')](_0x258078,function(_0x1829ec,_0x544174){var _0x1ab761=_0x1d7aa0[_0x918a('0x13')]+0x1;if(_0x1829ec){return _0x2ec08a(_0x1829ec);}else if(!_0x544174){if(_0x1d7aa0['disabled']){return _0x2ec08a(null,![],{'message':_0x918a('0x18')});}else if(_0x270a06[_0x918a('0xc')]>0x0){if(_0x1d7aa0[_0x918a('0x11')]){if(_0x270a06[_0x918a('0xd')]>0x0){if(moment(_0x1d7aa0[_0x918a('0x12')])[_0x918a('0x1a')](_0x270a06[_0x918a('0xd')],_0x918a('0x1b'))>moment()){return _0x2ec08a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x918a('0x1c')](_0x1d7aa0,_0x1ab761,![],null)['then'](function(){return _0x2ec08a(null,![],{'message':_0x918a('0x18')});});}}else{return _0x2ec08a(null,![],{'message':_0x918a('0x18')});}}else{if(_0x1ab761>=_0x270a06[_0x918a('0xc')]){return utils[_0x918a('0x1c')](_0x1d7aa0,0x0,!![],moment())['then'](function(){return _0x2ec08a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x918a('0x1c')](_0x1d7aa0,_0x1ab761,![],null)[_0x918a('0xe')](function(){return _0x2ec08a(null,![],{'message':_0x918a('0x18')});});}}}else{return _0x2ec08a(null,![],{'message':_0x918a('0x18')});}}else{if(_0x1d7aa0[_0x918a('0x10')]){return _0x2ec08a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x270a06[_0x918a('0xc')]>0x0){if(_0x1d7aa0[_0x918a('0x11')]){if(_0x270a06[_0x918a('0xd')]>0x0){if(moment(_0x1d7aa0[_0x918a('0x12')])[_0x918a('0x1a')](_0x270a06[_0x918a('0xd')],_0x918a('0x1b'))>moment()){return _0x2ec08a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x918a('0x1c')](_0x1d7aa0,0x0,![],null)[_0x918a('0xe')](function(){return utils[_0x918a('0x1d')](_0x1d7aa0);})[_0x918a('0xe')](function(){return _0x2ec08a(null,_0x1d7aa0);});}}else{return _0x2ec08a(null,![],{'message':_0x918a('0x18')});}}else{return utils[_0x918a('0x1c')](_0x1d7aa0,0x0,![],null)['then'](function(){return utils[_0x918a('0x1d')](_0x1d7aa0);})[_0x918a('0xe')](function(){return _0x2ec08a(null,_0x1d7aa0);})['catch'](function(_0x4c5a7a){return _0x2ec08a(null,![],_0x4c5a7a);});}}else{if(_0x1d7aa0['blocked']){return _0x2ec08a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x1d7aa0)[_0x918a('0xe')](function(){return _0x2ec08a(null,_0x1d7aa0);});}}}});})[_0x918a('0x1e')](function(_0x676bd9){return _0x2ec08a(null,![],_0x676bd9);});}function sendServiceMail(_0x1c07a2){return db[_0x918a('0x1f')]['find']({'where':{'service':!![]},'attributes':['id',_0x918a('0x17'),'email'],'include':[{'model':db[_0x918a('0x20')],'as':'Smtp'}]})[_0x918a('0xe')](function(_0x3ac622){if(!_0x3ac622){throw new Error(_0x918a('0x21'));}var _0x116cdd={'tls':{'rejectUnauthorized':![]}};if(_0x3ac622['Smtp'][_0x918a('0x22')]){_0x116cdd[_0x918a('0x22')]=_0x3ac622[_0x918a('0x23')]['service'];}else{_0x116cdd[_0x918a('0x24')]=_0x3ac622['Smtp'][_0x918a('0x24')];_0x116cdd['port']=_0x3ac622[_0x918a('0x23')][_0x918a('0x25')];_0x116cdd['secure']=_0x3ac622[_0x918a('0x23')]['secure'];}if(_0x3ac622[_0x918a('0x23')]['authentication']){_0x116cdd[_0x918a('0x26')]={'user':_0x3ac622['Smtp'][_0x918a('0x15')],'pass':_0x3ac622['Smtp']['pass']};}var _0x2b75fb={'account':_0x116cdd,'message':_[_0x918a('0x27')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x3ac622[_0x918a('0x17')],_0x3ac622[_0x918a('0x28')]||_0x3ac622[_0x918a('0x23')][_0x918a('0x15')])},_0x1c07a2)};return client['request'](_0x918a('0x29'),_0x2b75fb);})[_0x918a('0xe')](function(_0xd5674d){if(_0xd5674d[_0x918a('0x2a')]){throw new Error(util[_0x918a('0x2b')](_0x918a('0x2c'),_0xd5674d[_0x918a('0x2a')][_0x918a('0x2d')]||JSON[_0x918a('0x2e')](_0xd5674d[_0x918a('0x2a')])));}return!![];});}function handleError(_0x149647,_0x2b6160,_0x57fd62){return _0x149647[_0x918a('0x2f')](_0x2b6160||0x1f4)[_0x918a('0x30')]({'message':_0x57fd62?_0x57fd62[_0x918a('0x2d')]||_0x57fd62:''});}function checkPasswordPattern(_0x47f467,_0x25b457,_0x308bca){if(_0x308bca){var _0x25038b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25038b[_0x918a('0x31')](_0x25b457)){return _0x47f467;}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 _0x47f467;}}exports[_0x918a('0x32')]=function(_0x2bb9ba,_0x4ee28d,_0x108fcd){passport[_0x918a('0x19')](_0x918a('0x33'),function(_0x2aba91,_0x2d9941,_0x3a345d){var _0x3e2678=_0x2aba91||_0x3a345d;if(_0x3e2678){return handleError(_0x4ee28d,0x191,_0x3e2678);}if(!_0x2d9941){return handleError(_0x4ee28d,0x194,{'message':_0x918a('0x34')});}else{var _0x5b7cc5=signToken(_0x2d9941['id'],_0x2d9941[_0x918a('0x35')]);_0x4ee28d[_0x918a('0x36')]({'id':_0x2d9941['id'],'token':_0x5b7cc5,'statusCall':'','isAlreadyLogged':_0x2d9941[_0x918a('0x37')]});}})(_0x2bb9ba,_0x4ee28d,_0x108fcd);};exports[_0x918a('0x38')]=function(_0x435654,_0x2db1f1,_0x571f15){if(!_0x435654['body'][_0x918a('0x28')]){return handleError(_0x2db1f1,0x1f4,{'message':_0x918a('0x39')});}var _0x34537e=rs[_0x918a('0x3a')]();_0x435654['body'][_0x918a('0x28')]=_0x435654[_0x918a('0x3b')]['email'][_0x918a('0x3c')]()[_0x918a('0x3d')]();var _0x5cd599;return db[_0x918a('0xa')][_0x918a('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x918a('0xd')],'raw':!![]})[_0x918a('0xe')](function(_0x68bf75){_0x5cd599=_0x68bf75;return db[_0x918a('0x3e')][_0x918a('0x3f')]({'where':{'email':_0x435654[_0x918a('0x3b')][_0x918a('0x28')]}});})['then'](function(_0xfd3bb0){if(!_0xfd3bb0){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0xfd3bb0['disabled']){throw new Error(_0x918a('0x40'));}if(_0xfd3bb0[_0x918a('0x11')]){if(moment(_0xfd3bb0['blockedAt'])['add'](_0x5cd599['blockDuration'],_0x918a('0x1b'))>moment()){throw new Error(_0x918a('0x41'));}else{_0xfd3bb0[_0x918a('0x11')]=![];_0xfd3bb0['blockedAt']=null;}}_0xfd3bb0[_0x918a('0x42')]=_0x34537e;_0xfd3bb0[_0x918a('0x43')]=Date['now']()+0x36ee80;return _0xfd3bb0[_0x918a('0x44')]();})[_0x918a('0xe')](function(){return sendServiceMail({'to':_0x435654[_0x918a('0x3b')]['email'],'subject':_0x918a('0x45'),'text':_0x918a('0x46')+_0x918a('0x47')+_0x918a('0x48')+_0x435654[_0x918a('0x49')][_0x918a('0x24')]+'/reset/'+_0x34537e+'\x0a\x0a'+_0x918a('0x4a')});})[_0x918a('0xe')](function(){_0x2db1f1[_0x918a('0x2f')](0xc8)[_0x918a('0x30')]({'message':_0x918a('0x4b')});})['catch'](function(_0x3b1bb8){return handleError(_0x2db1f1,0x1f4,_0x3b1bb8);});};exports[_0x918a('0x4c')]=function(_0x562729,_0x181bfc,_0xd0c5f6){var _0x4e5e03;return db[_0x918a('0x3e')]['find']({'where':{'resetPasswordToken':_0x562729[_0x918a('0x4d')][_0x918a('0x4e')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x918a('0xe')](function(_0x1a4260){_0x4e5e03=_0x1a4260;if(!_0x4e5e03){throw new Error(_0x918a('0x4f'));}return db['Setting'][_0x918a('0xb')]({'attributes':['id',_0x918a('0x50')]});})[_0x918a('0xe')](function(_0x50910d){return checkPasswordPattern(_0x50910d,_0x562729[_0x918a('0x3b')]['password'],_0x50910d['securePassword']);})['then'](function(){_0x4e5e03[_0x918a('0x51')]=_0x562729[_0x918a('0x3b')]['password'];_0x4e5e03[_0x918a('0x42')]=null;_0x4e5e03[_0x918a('0x43')]=null;return _0x4e5e03['save']();})['then'](function(){_0x181bfc['status'](0xc8)[_0x918a('0x30')]({'message':_0x918a('0x52')});})[_0x918a('0x1e')](function(_0x552591){return handleError(_0x181bfc,0x1f4,_0x552591);});};passport['use'](new LocalStrategy({'usernameField':'name','passwordField':_0x918a('0x51')},function(_0x3c60d8,_0x231e50,_0x3e5646){return localAuthenticate(db[_0x918a('0x3e')],_0x3c60d8,_0x231e50,_0x3e5646);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 736bb6b..18a31d5 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 _0xc863=['Router','./authLocal.controller','post','/forgot','/reset/:token','reset'];(function(_0x17d542,_0x293276){var _0x4c34fc=function(_0x3539fc){while(--_0x3539fc){_0x17d542['push'](_0x17d542['shift']());}};_0x4c34fc(++_0x293276);}(_0xc863,0x1bc));var _0x3c86=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0xc863[_0xf0bc07];return _0x1c50c2;};'use strict';var express=require('express');var router=express[_0x3c86('0x0')]();var controller=require(_0x3c86('0x1'));router['post']('/',controller['login']);router[_0x3c86('0x2')](_0x3c86('0x3'),controller['forgot']);router['post'](_0x3c86('0x4'),controller[_0x3c86('0x5')]);module['exports']=router; \ No newline at end of file +var _0x299d=['forgot','reset','exports','express','Router','./authLocal.controller','post','login','/forgot'];(function(_0x90f34f,_0x404021){var _0x4b18cf=function(_0x25112d){while(--_0x25112d){_0x90f34f['push'](_0x90f34f['shift']());}};_0x4b18cf(++_0x404021);}(_0x299d,0x174));var _0xd299=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x299d[_0x55e08b];return _0xd1a7ff;};'use strict';var express=require(_0xd299('0x0'));var router=express[_0xd299('0x1')]();var controller=require(_0xd299('0x2'));router[_0xd299('0x3')]('/',controller[_0xd299('0x4')]);router[_0xd299('0x3')](_0xd299('0x5'),controller[_0xd299('0x6')]);router[_0xd299('0x3')]('/reset/:token',controller[_0xd299('0x7')]);module[_0xd299('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index c495e5c..ede3688 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 _0x6146=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x538c98,_0xd04e41){var _0x1b5898=function(_0x5c9c40){while(--_0x5c9c40){_0x538c98['push'](_0x538c98['shift']());}};_0x1b5898(++_0xd04e41);}(_0x6146,0xba));var _0x6614=function(_0x54d698,_0x5201d1){_0x54d698=_0x54d698-0x0;var _0x4017ef=_0x6146[_0x54d698];return _0x4017ef;};'use strict';var Sequelize=require(_0x6614('0x0'));module['exports']={'name':{'type':Sequelize[_0x6614('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x6614('0x1')]},'description':{'type':Sequelize[_0x6614('0x1')]},'status':{'type':Sequelize[_0x6614('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x6614('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x32d4=['BOOLEAN','INTEGER','exports','STRING'];(function(_0xb6f28c,_0x57529c){var _0x2f03ab=function(_0x33e83e){while(--_0x33e83e){_0xb6f28c['push'](_0xb6f28c['shift']());}};_0x2f03ab(++_0x57529c);}(_0x32d4,0x82));var _0x432d=function(_0xf859e2,_0x159c70){_0xf859e2=_0xf859e2-0x0;var _0x4c8b76=_0x32d4[_0xf859e2];return _0x4c8b76;};'use strict';var Sequelize=require('sequelize');module[_0x432d('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x432d('0x1')]},'description':{'type':Sequelize[_0x432d('0x1')]},'status':{'type':Sequelize[_0x432d('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x432d('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index d94b19a..f0305d4 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 _0x53f5=['update','then','error','name','Automation','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','type','key','VIRTUAL','findAll','catch','show','params','includeAll','find','create','body','destroy','addConditions','Condition','ids','omit','sort','getConditions','Action','addActions','getActions','options','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject'];(function(_0x549bfc,_0x4d6999){var _0x39e285=function(_0x4001a2){while(--_0x4001a2){_0x549bfc['push'](_0x549bfc['shift']());}};_0x39e285(++_0x4d6999);}(_0x53f5,0x1e8));var _0x553f=function(_0x2e9083,_0xb01ba3){_0x2e9083=_0x2e9083-0x0;var _0x2f900f=_0x53f5[_0x2e9083];return _0x2f900f;};'use strict';var pdf=require(_0x553f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x553f('0x1'));var zipdir=require(_0x553f('0x2'));var jsonpatch=require(_0x553f('0x3'));var rp=require('request-promise');var moment=require(_0x553f('0x4'));var BPromise=require(_0x553f('0x5'));var Mustache=require('mustache');var util=require(_0x553f('0x6'));var path=require(_0x553f('0x7'));var sox=require(_0x553f('0x8'));var csv=require(_0x553f('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x553f('0xa'));var deskjs=require(_0x553f('0xb'));var toCsv=require(_0x553f('0x9'));var querystring=require('querystring');var Papa=require(_0x553f('0xc'));var Redis=require(_0x553f('0xd'));var authService=require(_0x553f('0xe'));var qs=require(_0x553f('0xf'));var hardwareService=require(_0x553f('0x10'));var logger=require('../../config/logger')(_0x553f('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x553f('0x12'))['db'];function respondWithStatusCode(_0x50874b,_0x145e8e){_0x145e8e=_0x145e8e||0xcc;return function(_0x380e9d){if(_0x380e9d){return _0x50874b[_0x553f('0x13')](_0x145e8e);}return _0x50874b['status'](_0x145e8e)[_0x553f('0x14')]();};}function respondWithResult(_0x2933be,_0x30b803){_0x30b803=_0x30b803||0xc8;return function(_0x4f9285){if(_0x4f9285){return _0x2933be['status'](_0x30b803)[_0x553f('0x15')](_0x4f9285);}};}function respondWithFilteredResult(_0x194741,_0x24b9f3){return function(_0x269c9a){if(_0x269c9a){var _0x5a468c=_0x269c9a[_0x553f('0x16')],_0x4303bd=_0x24b9f3[_0x553f('0x17')],_0x5c9528=_0x24b9f3['offset']+_0x24b9f3[_0x553f('0x18')],_0x20f2a8;if(_0x5c9528>=_0x5a468c){_0x5c9528=_0x5a468c;_0x20f2a8=0xc8;}else{_0x20f2a8=0xce;}_0x194741[_0x553f('0x19')](_0x20f2a8);return _0x194741[_0x553f('0x1a')](_0x553f('0x1b'),_0x4303bd+'-'+_0x5c9528+'/'+_0x5a468c)['json'](_0x269c9a);}return null;};}function patchUpdates(_0x2be7c0){return function(_0x5de2be){try{jsonpatch[_0x553f('0x1c')](_0x5de2be,_0x2be7c0,!![]);}catch(_0x41f73e){return BPromise[_0x553f('0x1d')](_0x41f73e);}return _0x5de2be['save']();};}function saveUpdates(_0x1fbbd3,_0x12c54a){return function(_0x38687a){if(_0x38687a){return _0x38687a[_0x553f('0x1e')](_0x1fbbd3)[_0x553f('0x1f')](function(_0x5da827){return _0x5da827;});}return null;};}function removeEntity(_0x14c8ad,_0x55a80b){return function(_0x587450){if(_0x587450){return _0x587450['destroy']()[_0x553f('0x1f')](function(){_0x14c8ad['status'](0xcc)[_0x553f('0x14')]();});}};}function handleEntityNotFound(_0x5ed12d,_0x173d71){return function(_0x22975f){if(!_0x22975f){_0x5ed12d[_0x553f('0x13')](0x194);}return _0x22975f;};}function handleError(_0x2a79d2,_0x5ee511){_0x5ee511=_0x5ee511||0x1f4;return function(_0x55961d){logger[_0x553f('0x20')](_0x55961d['stack']);if(_0x55961d[_0x553f('0x21')]){delete _0x55961d[_0x553f('0x21')];}_0x2a79d2['status'](_0x5ee511)['send'](_0x55961d);};}exports['index']=function(_0x55951b,_0x4a7188){var _0x3c9196={},_0x2f5b0f={},_0x4ad899={'count':0x0,'rows':[]};var _0x3f6cd5=db[_0x553f('0x22')][_0x553f('0x23')];_0x2f5b0f[_0x553f('0x24')]=_[_0x553f('0x25')](_0x3f6cd5);_0x2f5b0f[_0x553f('0x26')]=_[_0x553f('0x25')](_0x55951b[_0x553f('0x26')]);_0x2f5b0f[_0x553f('0x27')]=_['intersection'](_0x2f5b0f['model'],_0x2f5b0f[_0x553f('0x26')]);_0x3c9196['attributes']=_[_0x553f('0x28')](_0x2f5b0f[_0x553f('0x24')],qs[_0x553f('0x29')](_0x55951b[_0x553f('0x26')]['fields']));_0x3c9196[_0x553f('0x2a')]=_0x3c9196[_0x553f('0x2a')][_0x553f('0x2b')]?_0x3c9196[_0x553f('0x2a')]:_0x2f5b0f[_0x553f('0x24')];if(!_0x55951b[_0x553f('0x26')][_0x553f('0x2c')](_0x553f('0x2d'))){_0x3c9196[_0x553f('0x18')]=qs[_0x553f('0x18')](_0x55951b[_0x553f('0x26')][_0x553f('0x18')]);_0x3c9196['offset']=qs[_0x553f('0x17')](_0x55951b[_0x553f('0x26')][_0x553f('0x17')]);}_0x3c9196[_0x553f('0x2e')]=qs['sort'](_0x55951b[_0x553f('0x26')]['sort']);_0x3c9196[_0x553f('0x2f')]=qs[_0x553f('0x27')](_[_0x553f('0x30')](_0x55951b['query'],_0x2f5b0f[_0x553f('0x27')]));if(_0x55951b[_0x553f('0x26')][_0x553f('0x31')]){_0x3c9196[_0x553f('0x2f')]=_[_0x553f('0x32')](_0x3c9196[_0x553f('0x2f')],{'$or':_[_0x553f('0x33')](_0x3f6cd5,function(_0x4e2640){if(_0x4e2640[_0x553f('0x34')][_0x553f('0x35')]!==_0x553f('0x36')){var _0x47f622={};_0x47f622[_0x4e2640['field']]={'$like':'%'+_0x55951b[_0x553f('0x26')]['filter']+'%'};return _0x47f622;}})});}_0x3c9196=_['merge']({},_0x3c9196,_0x55951b['options']);var _0x1f368e={'where':_0x3c9196[_0x553f('0x2f')]};return db[_0x553f('0x22')][_0x553f('0x16')](_0x1f368e)[_0x553f('0x1f')](function(_0xedf026){_0x4ad899[_0x553f('0x16')]=_0xedf026;if(_0x55951b[_0x553f('0x26')]['includeAll']){_0x3c9196['include']=[{'all':!![]}];}return db[_0x553f('0x22')][_0x553f('0x37')](_0x3c9196);})[_0x553f('0x1f')](function(_0x284ad6){_0x4ad899['rows']=_0x284ad6;return _0x4ad899;})[_0x553f('0x1f')](respondWithFilteredResult(_0x4a7188,_0x3c9196))[_0x553f('0x38')](handleError(_0x4a7188,null));};exports[_0x553f('0x39')]=function(_0x5f2916,_0x415954){var _0x59be79={'raw':![],'where':{'id':_0x5f2916[_0x553f('0x3a')]['id']}},_0x22d9ea={};_0x22d9ea['model']=_[_0x553f('0x25')](db[_0x553f('0x22')]['rawAttributes']);_0x22d9ea['query']=_[_0x553f('0x25')](_0x5f2916[_0x553f('0x26')]);_0x22d9ea[_0x553f('0x27')]=_[_0x553f('0x28')](_0x22d9ea[_0x553f('0x24')],_0x22d9ea[_0x553f('0x26')]);_0x59be79[_0x553f('0x2a')]=_[_0x553f('0x28')](_0x22d9ea[_0x553f('0x24')],qs[_0x553f('0x29')](_0x5f2916[_0x553f('0x26')]['fields']));_0x59be79[_0x553f('0x2a')]=_0x59be79['attributes'][_0x553f('0x2b')]?_0x59be79['attributes']:_0x22d9ea[_0x553f('0x24')];if(_0x5f2916[_0x553f('0x26')][_0x553f('0x3b')]){_0x59be79['include']=[{'all':!![]}];}_0x59be79=_[_0x553f('0x32')]({},_0x59be79,_0x5f2916['options']);return db[_0x553f('0x22')][_0x553f('0x3c')](_0x59be79)[_0x553f('0x1f')](handleEntityNotFound(_0x415954,null))['then'](respondWithResult(_0x415954,null))['catch'](handleError(_0x415954,null));};exports[_0x553f('0x3d')]=function(_0x93fd1f,_0x1ef3a3){return db[_0x553f('0x22')][_0x553f('0x3d')](_0x93fd1f[_0x553f('0x3e')],{})[_0x553f('0x1f')](respondWithResult(_0x1ef3a3,0xc9))[_0x553f('0x38')](handleError(_0x1ef3a3,null));};exports[_0x553f('0x1e')]=function(_0x1b27ab,_0x38bc1c){if(_0x1b27ab[_0x553f('0x3e')]['id']){delete _0x1b27ab[_0x553f('0x3e')]['id'];}return db[_0x553f('0x22')]['find']({'where':{'id':_0x1b27ab['params']['id']}})[_0x553f('0x1f')](handleEntityNotFound(_0x38bc1c,null))['then'](saveUpdates(_0x1b27ab[_0x553f('0x3e')],null))[_0x553f('0x1f')](respondWithResult(_0x38bc1c,null))[_0x553f('0x38')](handleError(_0x38bc1c,null));};exports[_0x553f('0x3f')]=function(_0x387920,_0x1481e4){return db[_0x553f('0x22')][_0x553f('0x3c')]({'where':{'id':_0x387920[_0x553f('0x3a')]['id']}})[_0x553f('0x1f')](handleEntityNotFound(_0x1481e4,null))[_0x553f('0x1f')](removeEntity(_0x1481e4,null))[_0x553f('0x38')](handleError(_0x1481e4,null));};exports[_0x553f('0x40')]=function(_0x3922bf,_0x391139,_0x4e3c41){return db[_0x553f('0x41')]['find']({'where':{'id':_0x3922bf[_0x553f('0x3a')]['id']}})[_0x553f('0x1f')](handleEntityNotFound(_0x391139,null))[_0x553f('0x1f')](function(_0x2f90d5){if(_0x2f90d5){return _0x2f90d5['addConditions'](_0x3922bf['body'][_0x553f('0x42')],_[_0x553f('0x43')](_0x3922bf[_0x553f('0x3e')],['ids','id'])||{});}})[_0x553f('0x1f')](respondWithResult(_0x391139,null))['catch'](handleError(_0x391139,null));};exports['getConditions']=function(_0x3dced0,_0x3be935,_0x5763dc){var _0x32b2e5={};var _0x71b4b8={};var _0x28395b;var _0x33bb0f;return db[_0x553f('0x22')]['findOne']({'where':{'id':_0x3dced0[_0x553f('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3be935,null))[_0x553f('0x1f')](function(_0x280166){if(_0x280166){_0x28395b=_0x280166;_0x71b4b8[_0x553f('0x24')]=_[_0x553f('0x25')](db[_0x553f('0x41')][_0x553f('0x23')]);_0x71b4b8['query']=_[_0x553f('0x25')](_0x3dced0['query']);_0x71b4b8[_0x553f('0x27')]=_['intersection'](_0x71b4b8['model'],_0x71b4b8[_0x553f('0x26')]);_0x32b2e5[_0x553f('0x2a')]=_[_0x553f('0x28')](_0x71b4b8['model'],qs['fields'](_0x3dced0['query'][_0x553f('0x29')]));_0x32b2e5[_0x553f('0x2a')]=_0x32b2e5[_0x553f('0x2a')]['length']?_0x32b2e5[_0x553f('0x2a')]:_0x71b4b8['model'];_0x32b2e5[_0x553f('0x2e')]=qs[_0x553f('0x44')](_0x3dced0[_0x553f('0x26')][_0x553f('0x44')]);_0x32b2e5[_0x553f('0x2f')]=qs['filters'](_[_0x553f('0x30')](_0x3dced0[_0x553f('0x26')],_0x71b4b8[_0x553f('0x27')]));if(_0x3dced0[_0x553f('0x26')][_0x553f('0x31')]){_0x32b2e5[_0x553f('0x2f')]=_['merge'](_0x32b2e5[_0x553f('0x2f')],{'$or':_[_0x553f('0x33')](_0x32b2e5['attributes'],function(_0x3ac51c){var _0x37db60={};_0x37db60[_0x3ac51c]={'$like':'%'+_0x3dced0['query']['filter']+'%'};return _0x37db60;})});}_0x32b2e5=_[_0x553f('0x32')]({},_0x32b2e5,_0x3dced0['options']);return _0x28395b[_0x553f('0x45')](_0x32b2e5);}})['then'](function(_0xa36473){if(_0xa36473){_0x33bb0f=_0xa36473['length'];if(!_0x3dced0[_0x553f('0x26')]['hasOwnProperty'](_0x553f('0x2d'))){_0x32b2e5[_0x553f('0x18')]=qs[_0x553f('0x18')](_0x3dced0[_0x553f('0x26')]['limit']);_0x32b2e5[_0x553f('0x17')]=qs[_0x553f('0x17')](_0x3dced0['query'][_0x553f('0x17')]);}return _0x28395b[_0x553f('0x45')](_0x32b2e5);}})[_0x553f('0x1f')](function(_0x33178e){if(_0x33178e){return _0x33178e?{'count':_0x33bb0f,'rows':_0x33178e}:null;}})[_0x553f('0x1f')](respondWithResult(_0x3be935,null))[_0x553f('0x38')](handleError(_0x3be935,null));};exports['addActions']=function(_0x3c966b,_0x5090a8,_0x41caeb){return db[_0x553f('0x46')]['find']({'where':{'id':_0x3c966b[_0x553f('0x3a')]['id']}})[_0x553f('0x1f')](handleEntityNotFound(_0x5090a8,null))[_0x553f('0x1f')](function(_0x242fa7){if(_0x242fa7){return _0x242fa7[_0x553f('0x47')](_0x3c966b[_0x553f('0x3e')][_0x553f('0x42')],_[_0x553f('0x43')](_0x3c966b[_0x553f('0x3e')],[_0x553f('0x42'),'id'])||{});}})[_0x553f('0x1f')](respondWithResult(_0x5090a8,null))[_0x553f('0x38')](handleError(_0x5090a8,null));};exports[_0x553f('0x48')]=function(_0x8f0928,_0x1ffc00,_0x1cfea7){var _0x322510={};var _0x15fd55={};var _0x284270;var _0x18fca3;return db[_0x553f('0x22')]['findOne']({'where':{'id':_0x8f0928[_0x553f('0x3a')]['id']}})['then'](handleEntityNotFound(_0x1ffc00,null))[_0x553f('0x1f')](function(_0x1a4aa6){if(_0x1a4aa6){_0x284270=_0x1a4aa6;_0x15fd55[_0x553f('0x24')]=_[_0x553f('0x25')](db['Action'][_0x553f('0x23')]);_0x15fd55['query']=_['keys'](_0x8f0928['query']);_0x15fd55[_0x553f('0x27')]=_['intersection'](_0x15fd55['model'],_0x15fd55[_0x553f('0x26')]);_0x322510[_0x553f('0x2a')]=_[_0x553f('0x28')](_0x15fd55[_0x553f('0x24')],qs[_0x553f('0x29')](_0x8f0928[_0x553f('0x26')][_0x553f('0x29')]));_0x322510[_0x553f('0x2a')]=_0x322510[_0x553f('0x2a')][_0x553f('0x2b')]?_0x322510[_0x553f('0x2a')]:_0x15fd55[_0x553f('0x24')];_0x322510[_0x553f('0x2e')]=qs[_0x553f('0x44')](_0x8f0928[_0x553f('0x26')][_0x553f('0x44')]);_0x322510[_0x553f('0x2f')]=qs[_0x553f('0x27')](_[_0x553f('0x30')](_0x8f0928[_0x553f('0x26')],_0x15fd55[_0x553f('0x27')]));if(_0x8f0928[_0x553f('0x26')]['filter']){_0x322510['where']=_[_0x553f('0x32')](_0x322510[_0x553f('0x2f')],{'$or':_['map'](_0x322510['attributes'],function(_0x1a8a43){var _0x16cbc8={};_0x16cbc8[_0x1a8a43]={'$like':'%'+_0x8f0928[_0x553f('0x26')][_0x553f('0x31')]+'%'};return _0x16cbc8;})});}_0x322510=_[_0x553f('0x32')]({},_0x322510,_0x8f0928[_0x553f('0x49')]);return _0x284270['getActions'](_0x322510);}})[_0x553f('0x1f')](function(_0x2b13bb){if(_0x2b13bb){_0x18fca3=_0x2b13bb[_0x553f('0x2b')];if(!_0x8f0928[_0x553f('0x26')]['hasOwnProperty'](_0x553f('0x2d'))){_0x322510['limit']=qs[_0x553f('0x18')](_0x8f0928[_0x553f('0x26')][_0x553f('0x18')]);_0x322510[_0x553f('0x17')]=qs[_0x553f('0x17')](_0x8f0928['query'][_0x553f('0x17')]);}return _0x284270[_0x553f('0x48')](_0x322510);}})[_0x553f('0x1f')](function(_0x3193fa){if(_0x3193fa){return _0x3193fa?{'count':_0x18fca3,'rows':_0x3193fa}:null;}})[_0x553f('0x1f')](respondWithResult(_0x1ffc00,null))[_0x553f('0x38')](handleError(_0x1ffc00,null));}; \ No newline at end of file +var _0x793a=['order','sort','where','pick','filter','merge','map','type','key','field','include','findAll','show','params','options','find','catch','create','body','Condition','addConditions','omit','ids','getConditions','nolimit','addActions','Action','getActions','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','json','apply','save','update','destroy','then','end','error','stack','name','index','Automation','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x4f0c71,_0xe1e8a){var _0x54a6e7=function(_0x146c9f){while(--_0x146c9f){_0x4f0c71['push'](_0x4f0c71['shift']());}};_0x54a6e7(++_0xe1e8a);}(_0x793a,0xc0));var _0xa793=function(_0x3250d,_0x1f2339){_0x3250d=_0x3250d-0x0;var _0x4dcaf3=_0x793a[_0x3250d];return _0x4dcaf3;};'use strict';var pdf=require(_0xa793('0x0'));var emlformat=require(_0xa793('0x1'));var rimraf=require(_0xa793('0x2'));var zipdir=require(_0xa793('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa793('0x4'));var moment=require(_0xa793('0x5'));var BPromise=require(_0xa793('0x6'));var Mustache=require(_0xa793('0x7'));var util=require(_0xa793('0x8'));var path=require('path');var sox=require(_0xa793('0x9'));var csv=require(_0xa793('0xa'));var ejs=require(_0xa793('0xb'));var fs=require('fs');var _=require(_0xa793('0xc'));var squel=require(_0xa793('0xd'));var crypto=require(_0xa793('0xe'));var jsforce=require(_0xa793('0xf'));var deskjs=require(_0xa793('0x10'));var toCsv=require(_0xa793('0xa'));var querystring=require(_0xa793('0x11'));var Papa=require(_0xa793('0x12'));var Redis=require(_0xa793('0x13'));var authService=require(_0xa793('0x14'));var qs=require(_0xa793('0x15'));var hardwareService=require(_0xa793('0x16'));var logger=require('../../config/logger')(_0xa793('0x17'));var utils=require(_0xa793('0x18'));var config=require(_0xa793('0x19'));var db=require(_0xa793('0x1a'))['db'];function respondWithStatusCode(_0x4ed62a,_0x13be6b){_0x13be6b=_0x13be6b||0xcc;return function(_0xe3c59){if(_0xe3c59){return _0x4ed62a[_0xa793('0x1b')](_0x13be6b);}return _0x4ed62a[_0xa793('0x1c')](_0x13be6b)['end']();};}function respondWithResult(_0xc5016c,_0x2bd600){_0x2bd600=_0x2bd600||0xc8;return function(_0x5f2cc0){if(_0x5f2cc0){return _0xc5016c[_0xa793('0x1c')](_0x2bd600)['json'](_0x5f2cc0);}};}function respondWithFilteredResult(_0x4df1d5,_0x27f77b){return function(_0x2b9877){if(_0x2b9877){var _0x28c330=_0x2b9877[_0xa793('0x1d')],_0x50c6ed=_0x27f77b[_0xa793('0x1e')],_0x58608a=_0x27f77b[_0xa793('0x1e')]+_0x27f77b[_0xa793('0x1f')],_0x5c2fd5;if(_0x58608a>=_0x28c330){_0x58608a=_0x28c330;_0x5c2fd5=0xc8;}else{_0x5c2fd5=0xce;}_0x4df1d5[_0xa793('0x1c')](_0x5c2fd5);return _0x4df1d5['set']('Content-Range',_0x50c6ed+'-'+_0x58608a+'/'+_0x28c330)[_0xa793('0x20')](_0x2b9877);}return null;};}function patchUpdates(_0x47757f){return function(_0x59ab56){try{jsonpatch[_0xa793('0x21')](_0x59ab56,_0x47757f,!![]);}catch(_0x356401){return BPromise['reject'](_0x356401);}return _0x59ab56[_0xa793('0x22')]();};}function saveUpdates(_0xbedf36,_0x58977c){return function(_0x407815){if(_0x407815){return _0x407815[_0xa793('0x23')](_0xbedf36)['then'](function(_0x5b09e6){return _0x5b09e6;});}return null;};}function removeEntity(_0x14ff48,_0x19f49e){return function(_0x2cfad5){if(_0x2cfad5){return _0x2cfad5[_0xa793('0x24')]()[_0xa793('0x25')](function(){_0x14ff48[_0xa793('0x1c')](0xcc)[_0xa793('0x26')]();});}};}function handleEntityNotFound(_0x267b9f,_0x28efb6){return function(_0x2c96a9){if(!_0x2c96a9){_0x267b9f[_0xa793('0x1b')](0x194);}return _0x2c96a9;};}function handleError(_0x341300,_0x5b086c){_0x5b086c=_0x5b086c||0x1f4;return function(_0x585779){logger[_0xa793('0x27')](_0x585779[_0xa793('0x28')]);if(_0x585779[_0xa793('0x29')]){delete _0x585779[_0xa793('0x29')];}_0x341300[_0xa793('0x1c')](_0x5b086c)['send'](_0x585779);};}exports[_0xa793('0x2a')]=function(_0xc478f2,_0x9d801d){var _0x1fcd62={},_0x548bd0={},_0x380134={'count':0x0,'rows':[]};var _0x24c880=db[_0xa793('0x2b')][_0xa793('0x2c')];_0x548bd0[_0xa793('0x2d')]=_[_0xa793('0x2e')](_0x24c880);_0x548bd0['query']=_[_0xa793('0x2e')](_0xc478f2[_0xa793('0x2f')]);_0x548bd0[_0xa793('0x30')]=_[_0xa793('0x31')](_0x548bd0[_0xa793('0x2d')],_0x548bd0[_0xa793('0x2f')]);_0x1fcd62[_0xa793('0x32')]=_[_0xa793('0x31')](_0x548bd0['model'],qs[_0xa793('0x33')](_0xc478f2['query'][_0xa793('0x33')]));_0x1fcd62['attributes']=_0x1fcd62[_0xa793('0x32')][_0xa793('0x34')]?_0x1fcd62[_0xa793('0x32')]:_0x548bd0['model'];if(!_0xc478f2[_0xa793('0x2f')][_0xa793('0x35')]('nolimit')){_0x1fcd62[_0xa793('0x1f')]=qs['limit'](_0xc478f2[_0xa793('0x2f')][_0xa793('0x1f')]);_0x1fcd62[_0xa793('0x1e')]=qs[_0xa793('0x1e')](_0xc478f2['query'][_0xa793('0x1e')]);}_0x1fcd62[_0xa793('0x36')]=qs[_0xa793('0x37')](_0xc478f2[_0xa793('0x2f')]['sort']);_0x1fcd62[_0xa793('0x38')]=qs[_0xa793('0x30')](_[_0xa793('0x39')](_0xc478f2[_0xa793('0x2f')],_0x548bd0[_0xa793('0x30')]));if(_0xc478f2['query'][_0xa793('0x3a')]){_0x1fcd62['where']=_[_0xa793('0x3b')](_0x1fcd62['where'],{'$or':_[_0xa793('0x3c')](_0x24c880,function(_0x3ae32d){if(_0x3ae32d[_0xa793('0x3d')][_0xa793('0x3e')]!=='VIRTUAL'){var _0x2a22d0={};_0x2a22d0[_0x3ae32d[_0xa793('0x3f')]]={'$like':'%'+_0xc478f2['query'][_0xa793('0x3a')]+'%'};return _0x2a22d0;}})});}_0x1fcd62=_[_0xa793('0x3b')]({},_0x1fcd62,_0xc478f2['options']);var _0x228bd9={'where':_0x1fcd62[_0xa793('0x38')]};return db['Automation'][_0xa793('0x1d')](_0x228bd9)[_0xa793('0x25')](function(_0xc152ad){_0x380134[_0xa793('0x1d')]=_0xc152ad;if(_0xc478f2[_0xa793('0x2f')]['includeAll']){_0x1fcd62[_0xa793('0x40')]=[{'all':!![]}];}return db['Automation'][_0xa793('0x41')](_0x1fcd62);})['then'](function(_0x1dbb40){_0x380134['rows']=_0x1dbb40;return _0x380134;})[_0xa793('0x25')](respondWithFilteredResult(_0x9d801d,_0x1fcd62))['catch'](handleError(_0x9d801d,null));};exports[_0xa793('0x42')]=function(_0x40dadc,_0x1f082a){var _0xae760d={'raw':![],'where':{'id':_0x40dadc[_0xa793('0x43')]['id']}},_0xe3e27f={};_0xe3e27f['model']=_['keys'](db[_0xa793('0x2b')][_0xa793('0x2c')]);_0xe3e27f[_0xa793('0x2f')]=_[_0xa793('0x2e')](_0x40dadc[_0xa793('0x2f')]);_0xe3e27f[_0xa793('0x30')]=_[_0xa793('0x31')](_0xe3e27f[_0xa793('0x2d')],_0xe3e27f[_0xa793('0x2f')]);_0xae760d[_0xa793('0x32')]=_[_0xa793('0x31')](_0xe3e27f['model'],qs['fields'](_0x40dadc[_0xa793('0x2f')][_0xa793('0x33')]));_0xae760d[_0xa793('0x32')]=_0xae760d[_0xa793('0x32')][_0xa793('0x34')]?_0xae760d[_0xa793('0x32')]:_0xe3e27f[_0xa793('0x2d')];if(_0x40dadc['query']['includeAll']){_0xae760d[_0xa793('0x40')]=[{'all':!![]}];}_0xae760d=_[_0xa793('0x3b')]({},_0xae760d,_0x40dadc[_0xa793('0x44')]);return db['Automation'][_0xa793('0x45')](_0xae760d)[_0xa793('0x25')](handleEntityNotFound(_0x1f082a,null))[_0xa793('0x25')](respondWithResult(_0x1f082a,null))[_0xa793('0x46')](handleError(_0x1f082a,null));};exports[_0xa793('0x47')]=function(_0x4e2d63,_0x205cc9){return db[_0xa793('0x2b')][_0xa793('0x47')](_0x4e2d63[_0xa793('0x48')],{})['then'](respondWithResult(_0x205cc9,0xc9))['catch'](handleError(_0x205cc9,null));};exports[_0xa793('0x23')]=function(_0x1c727d,_0x5f51a0){if(_0x1c727d[_0xa793('0x48')]['id']){delete _0x1c727d[_0xa793('0x48')]['id'];}return db[_0xa793('0x2b')]['find']({'where':{'id':_0x1c727d[_0xa793('0x43')]['id']}})['then'](handleEntityNotFound(_0x5f51a0,null))[_0xa793('0x25')](saveUpdates(_0x1c727d[_0xa793('0x48')],null))[_0xa793('0x25')](respondWithResult(_0x5f51a0,null))[_0xa793('0x46')](handleError(_0x5f51a0,null));};exports[_0xa793('0x24')]=function(_0x270909,_0x4cdee9){return db[_0xa793('0x2b')][_0xa793('0x45')]({'where':{'id':_0x270909[_0xa793('0x43')]['id']}})[_0xa793('0x25')](handleEntityNotFound(_0x4cdee9,null))[_0xa793('0x25')](removeEntity(_0x4cdee9,null))[_0xa793('0x46')](handleError(_0x4cdee9,null));};exports['addConditions']=function(_0x108776,_0x2555a8,_0x5c79ad){return db[_0xa793('0x49')][_0xa793('0x45')]({'where':{'id':_0x108776[_0xa793('0x43')]['id']}})['then'](handleEntityNotFound(_0x2555a8,null))[_0xa793('0x25')](function(_0x2c1853){if(_0x2c1853){return _0x2c1853[_0xa793('0x4a')](_0x108776[_0xa793('0x48')]['ids'],_[_0xa793('0x4b')](_0x108776['body'],[_0xa793('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x2555a8,null))[_0xa793('0x46')](handleError(_0x2555a8,null));};exports['getConditions']=function(_0xf6689a,_0x56e009,_0x2da204){var _0x509519={};var _0x3260bc={};var _0xdcadd;var _0x5c3419;return db[_0xa793('0x2b')]['findOne']({'where':{'id':_0xf6689a[_0xa793('0x43')]['id']}})[_0xa793('0x25')](handleEntityNotFound(_0x56e009,null))[_0xa793('0x25')](function(_0x3b3688){if(_0x3b3688){_0xdcadd=_0x3b3688;_0x3260bc[_0xa793('0x2d')]=_['keys'](db['Condition'][_0xa793('0x2c')]);_0x3260bc['query']=_[_0xa793('0x2e')](_0xf6689a[_0xa793('0x2f')]);_0x3260bc['filters']=_[_0xa793('0x31')](_0x3260bc[_0xa793('0x2d')],_0x3260bc['query']);_0x509519[_0xa793('0x32')]=_[_0xa793('0x31')](_0x3260bc['model'],qs['fields'](_0xf6689a[_0xa793('0x2f')][_0xa793('0x33')]));_0x509519['attributes']=_0x509519[_0xa793('0x32')][_0xa793('0x34')]?_0x509519[_0xa793('0x32')]:_0x3260bc[_0xa793('0x2d')];_0x509519[_0xa793('0x36')]=qs['sort'](_0xf6689a['query'][_0xa793('0x37')]);_0x509519[_0xa793('0x38')]=qs[_0xa793('0x30')](_[_0xa793('0x39')](_0xf6689a['query'],_0x3260bc['filters']));if(_0xf6689a['query'][_0xa793('0x3a')]){_0x509519[_0xa793('0x38')]=_[_0xa793('0x3b')](_0x509519[_0xa793('0x38')],{'$or':_[_0xa793('0x3c')](_0x509519[_0xa793('0x32')],function(_0x3348d7){var _0x334546={};_0x334546[_0x3348d7]={'$like':'%'+_0xf6689a[_0xa793('0x2f')][_0xa793('0x3a')]+'%'};return _0x334546;})});}_0x509519=_[_0xa793('0x3b')]({},_0x509519,_0xf6689a[_0xa793('0x44')]);return _0xdcadd[_0xa793('0x4d')](_0x509519);}})[_0xa793('0x25')](function(_0x1fac94){if(_0x1fac94){_0x5c3419=_0x1fac94['length'];if(!_0xf6689a[_0xa793('0x2f')][_0xa793('0x35')](_0xa793('0x4e'))){_0x509519[_0xa793('0x1f')]=qs[_0xa793('0x1f')](_0xf6689a[_0xa793('0x2f')]['limit']);_0x509519[_0xa793('0x1e')]=qs['offset'](_0xf6689a[_0xa793('0x2f')][_0xa793('0x1e')]);}return _0xdcadd[_0xa793('0x4d')](_0x509519);}})['then'](function(_0x34b98f){if(_0x34b98f){return _0x34b98f?{'count':_0x5c3419,'rows':_0x34b98f}:null;}})['then'](respondWithResult(_0x56e009,null))[_0xa793('0x46')](handleError(_0x56e009,null));};exports[_0xa793('0x4f')]=function(_0x5a3e13,_0x297f32,_0x234a9b){return db[_0xa793('0x50')][_0xa793('0x45')]({'where':{'id':_0x5a3e13[_0xa793('0x43')]['id']}})['then'](handleEntityNotFound(_0x297f32,null))[_0xa793('0x25')](function(_0x1efa7c){if(_0x1efa7c){return _0x1efa7c[_0xa793('0x4f')](_0x5a3e13['body'][_0xa793('0x4c')],_[_0xa793('0x4b')](_0x5a3e13['body'],[_0xa793('0x4c'),'id'])||{});}})[_0xa793('0x25')](respondWithResult(_0x297f32,null))[_0xa793('0x46')](handleError(_0x297f32,null));};exports['getActions']=function(_0x5de14e,_0x4a5c34,_0xadfa2){var _0x4e1eaa={};var _0x255788={};var _0x168cfe;var _0x4b43a0;return db[_0xa793('0x2b')]['findOne']({'where':{'id':_0x5de14e[_0xa793('0x43')]['id']}})['then'](handleEntityNotFound(_0x4a5c34,null))[_0xa793('0x25')](function(_0x189f71){if(_0x189f71){_0x168cfe=_0x189f71;_0x255788[_0xa793('0x2d')]=_[_0xa793('0x2e')](db['Action']['rawAttributes']);_0x255788[_0xa793('0x2f')]=_[_0xa793('0x2e')](_0x5de14e[_0xa793('0x2f')]);_0x255788[_0xa793('0x30')]=_[_0xa793('0x31')](_0x255788[_0xa793('0x2d')],_0x255788[_0xa793('0x2f')]);_0x4e1eaa['attributes']=_[_0xa793('0x31')](_0x255788[_0xa793('0x2d')],qs['fields'](_0x5de14e[_0xa793('0x2f')][_0xa793('0x33')]));_0x4e1eaa[_0xa793('0x32')]=_0x4e1eaa[_0xa793('0x32')][_0xa793('0x34')]?_0x4e1eaa['attributes']:_0x255788[_0xa793('0x2d')];_0x4e1eaa[_0xa793('0x36')]=qs['sort'](_0x5de14e[_0xa793('0x2f')]['sort']);_0x4e1eaa[_0xa793('0x38')]=qs['filters'](_[_0xa793('0x39')](_0x5de14e[_0xa793('0x2f')],_0x255788[_0xa793('0x30')]));if(_0x5de14e['query'][_0xa793('0x3a')]){_0x4e1eaa['where']=_[_0xa793('0x3b')](_0x4e1eaa[_0xa793('0x38')],{'$or':_[_0xa793('0x3c')](_0x4e1eaa[_0xa793('0x32')],function(_0x4566b3){var _0x185389={};_0x185389[_0x4566b3]={'$like':'%'+_0x5de14e[_0xa793('0x2f')]['filter']+'%'};return _0x185389;})});}_0x4e1eaa=_['merge']({},_0x4e1eaa,_0x5de14e[_0xa793('0x44')]);return _0x168cfe['getActions'](_0x4e1eaa);}})[_0xa793('0x25')](function(_0x45cbc9){if(_0x45cbc9){_0x4b43a0=_0x45cbc9[_0xa793('0x34')];if(!_0x5de14e[_0xa793('0x2f')][_0xa793('0x35')]('nolimit')){_0x4e1eaa['limit']=qs[_0xa793('0x1f')](_0x5de14e[_0xa793('0x2f')][_0xa793('0x1f')]);_0x4e1eaa[_0xa793('0x1e')]=qs[_0xa793('0x1e')](_0x5de14e[_0xa793('0x2f')]['offset']);}return _0x168cfe[_0xa793('0x51')](_0x4e1eaa);}})['then'](function(_0x108fd8){if(_0x108fd8){return _0x108fd8?{'count':_0x4b43a0,'rows':_0x108fd8}:null;}})[_0xa793('0x25')](respondWithResult(_0x4a5c34,null))[_0xa793('0x46')](handleError(_0x4a5c34,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index f0d1a7c..448e1f2 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 _0x5167=['exports','Automation','tools_automations','lodash','util','../../config/logger','moment','bluebird','./automation.attributes'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x5167,0x11a));var _0x7516=function(_0x46f084,_0x2cc3d0){_0x46f084=_0x46f084-0x0;var _0x1f7864=_0x5167[_0x46f084];return _0x1f7864;};'use strict';var _=require(_0x7516('0x0'));var util=require(_0x7516('0x1'));var logger=require(_0x7516('0x2'))('api');var moment=require(_0x7516('0x3'));var BPromise=require(_0x7516('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7516('0x5'));module[_0x7516('0x6')]=function(_0x54874b,_0x188fb9){return _0x54874b['define'](_0x7516('0x7'),attributes,{'tableName':_0x7516('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf03=['./automation.attributes','define','tools_automations','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x22a534,_0x2b3951){var _0x5c3b5f=function(_0x5033d4){while(--_0x5033d4){_0x22a534['push'](_0x22a534['shift']());}};_0x5c3b5f(++_0x2b3951);}(_0xaf03,0x1c6));var _0x3af0=function(_0x4f4ea8,_0xbac681){_0x4f4ea8=_0x4f4ea8-0x0;var _0x52531c=_0xaf03[_0x4f4ea8];return _0x52531c;};'use strict';var _=require(_0x3af0('0x0'));var util=require(_0x3af0('0x1'));var logger=require(_0x3af0('0x2'))('api');var moment=require(_0x3af0('0x3'));var BPromise=require('bluebird');var rp=require(_0x3af0('0x4'));var fs=require('fs');var path=require(_0x3af0('0x5'));var rimraf=require(_0x3af0('0x6'));var config=require(_0x3af0('0x7'));var attributes=require(_0x3af0('0x8'));module['exports']=function(_0x3e8e68,_0x15b363){return _0x3e8e68[_0x3af0('0x9')]('Automation',attributes,{'tableName':_0x3af0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index bb72d6b..358b8ba 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 _0xbb6b=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x17e070,_0x23fad8){var _0x176c1b=function(_0x53306a){while(--_0x53306a){_0x17e070['push'](_0x17e070['shift']());}};_0x176c1b(++_0x23fad8);}(_0xbb6b,0xa9));var _0xbbb6=function(_0x3c2180,_0xd1e22e){_0x3c2180=_0x3c2180-0x0;var _0x192a8f=_0xbb6b[_0x3c2180];return _0x192a8f;};'use strict';var _=require(_0xbbb6('0x0'));var util=require(_0xbbb6('0x1'));var moment=require(_0xbbb6('0x2'));var BPromise=require(_0xbbb6('0x3'));var rs=require(_0xbbb6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbbb6('0x5'))['db'];var utils=require(_0xbbb6('0x6'));var logger=require('../../config/logger')(_0xbbb6('0x7'));var config=require(_0xbbb6('0x8'));var jayson=require(_0xbbb6('0x9'));var client=jayson[_0xbbb6('0xa')][_0xbbb6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47458d,_0x5233de,_0x4d981c){return new BPromise(function(_0x2a254a,_0x206138){return client[_0xbbb6('0xc')](_0x47458d,_0x4d981c)[_0xbbb6('0xd')](function(_0x439bfd){logger['info'](_0xbbb6('0xe'),_0x5233de,_0xbbb6('0xf'));logger[_0xbbb6('0x10')](_0xbbb6('0x11'),_0x5233de,_0xbbb6('0xf'),JSON[_0xbbb6('0x12')](_0x439bfd));if(_0x439bfd[_0xbbb6('0x13')]){if(_0x439bfd[_0xbbb6('0x13')]['code']===0x1f4){logger[_0xbbb6('0x13')](_0xbbb6('0xe'),_0x5233de,_0x439bfd[_0xbbb6('0x13')][_0xbbb6('0x14')]);return _0x206138(_0x439bfd[_0xbbb6('0x13')]['message']);}logger[_0xbbb6('0x13')](_0xbbb6('0xe'),_0x5233de,_0x439bfd[_0xbbb6('0x13')][_0xbbb6('0x14')]);return _0x2a254a(_0x439bfd[_0xbbb6('0x13')][_0xbbb6('0x14')]);}else{logger[_0xbbb6('0x15')]('Automation,\x20%s,\x20%s',_0x5233de,_0xbbb6('0xf'));_0x2a254a(_0x439bfd[_0xbbb6('0x16')][_0xbbb6('0x14')]);}})[_0xbbb6('0x17')](function(_0x19f338){logger['error']('Automation,\x20%s,\x20%s',_0x5233de,_0x19f338);_0x206138(_0x19f338);});});} \ No newline at end of file +var _0xa2c8=['jayson/promise','client','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3eca90,_0x172c2a){var _0x2d9b7c=function(_0x449cab){while(--_0x449cab){_0x3eca90['push'](_0x3eca90['shift']());}};_0x2d9b7c(++_0x172c2a);}(_0xa2c8,0x81));var _0x8a2c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa2c8[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8a2c('0x0'));var util=require(_0x8a2c('0x1'));var moment=require(_0x8a2c('0x2'));var BPromise=require(_0x8a2c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a2c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a2c('0x5'));var logger=require(_0x8a2c('0x6'))(_0x8a2c('0x7'));var config=require(_0x8a2c('0x8'));var jayson=require(_0x8a2c('0x9'));var client=jayson[_0x8a2c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3481c4,_0x1d554b,_0x4688af){return new BPromise(function(_0x589f71,_0x39d895){return client[_0x8a2c('0xb')](_0x3481c4,_0x4688af)[_0x8a2c('0xc')](function(_0x4a4a8a){logger[_0x8a2c('0xd')](_0x8a2c('0xe'),_0x1d554b,_0x8a2c('0xf'));logger[_0x8a2c('0x10')](_0x8a2c('0x11'),_0x1d554b,_0x8a2c('0xf'),JSON[_0x8a2c('0x12')](_0x4a4a8a));if(_0x4a4a8a['error']){if(_0x4a4a8a['error'][_0x8a2c('0x13')]===0x1f4){logger[_0x8a2c('0x14')](_0x8a2c('0xe'),_0x1d554b,_0x4a4a8a[_0x8a2c('0x14')][_0x8a2c('0x15')]);return _0x39d895(_0x4a4a8a[_0x8a2c('0x14')][_0x8a2c('0x15')]);}logger['error'](_0x8a2c('0xe'),_0x1d554b,_0x4a4a8a[_0x8a2c('0x14')]['message']);return _0x589f71(_0x4a4a8a['error'][_0x8a2c('0x15')]);}else{logger[_0x8a2c('0xd')](_0x8a2c('0xe'),_0x1d554b,_0x8a2c('0xf'));_0x589f71(_0x4a4a8a[_0x8a2c('0x16')]['message']);}})['catch'](function(_0x4fbe8b){logger[_0x8a2c('0x14')]('Automation,\x20%s,\x20%s',_0x1d554b,_0x4fbe8b);_0x39d895(_0x4fbe8b);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 32c4a55..7e50d3b 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 _0xf9d1=['destroy','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','/:id/actions','getActions','create','post','addActions','put','update','delete','/:id'];(function(_0x44793c,_0x5aee24){var _0x50a5d8=function(_0x131933){while(--_0x131933){_0x44793c['push'](_0x44793c['shift']());}};_0x50a5d8(++_0x5aee24);}(_0xf9d1,0x8c));var _0x1f9d=function(_0x28057d,_0x57ab43){_0x28057d=_0x28057d-0x0;var _0x2b4ecd=_0xf9d1[_0x28057d];return _0x2b4ecd;};'use strict';var multer=require(_0x1f9d('0x0'));var util=require('util');var path=require(_0x1f9d('0x1'));var timeout=require('connect-timeout');var express=require(_0x1f9d('0x2'));var router=express[_0x1f9d('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1f9d('0x4'));var config=require(_0x1f9d('0x5'));var controller=require(_0x1f9d('0x6'));router[_0x1f9d('0x7')]('/',auth[_0x1f9d('0x8')](),controller[_0x1f9d('0x9')]);router[_0x1f9d('0x7')]('/:id',auth[_0x1f9d('0x8')](),controller[_0x1f9d('0xa')]);router[_0x1f9d('0x7')](_0x1f9d('0xb'),auth[_0x1f9d('0x8')](),controller['getConditions']);router['get'](_0x1f9d('0xc'),auth[_0x1f9d('0x8')](),controller[_0x1f9d('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1f9d('0xe')]);router[_0x1f9d('0xf')](_0x1f9d('0xb'),auth[_0x1f9d('0x8')](),controller['addConditions']);router[_0x1f9d('0xf')](_0x1f9d('0xc'),auth['isAuthenticated'](),controller[_0x1f9d('0x10')]);router[_0x1f9d('0x11')]('/:id',auth[_0x1f9d('0x8')](),controller[_0x1f9d('0x12')]);router[_0x1f9d('0x13')](_0x1f9d('0x14'),auth['isAuthenticated'](),controller[_0x1f9d('0x15')]);module[_0x1f9d('0x16')]=router; \ No newline at end of file +var _0x0791=['util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','show','/:id/conditions','getConditions','getActions','post','/:id/actions','addActions','put','delete','destroy','exports','multer'];(function(_0x1ad621,_0x5a8d97){var _0xd1d0e7=function(_0x15f4a5){while(--_0x15f4a5){_0x1ad621['push'](_0x1ad621['shift']());}};_0xd1d0e7(++_0x5a8d97);}(_0x0791,0x18b));var _0x1079=function(_0x33154d,_0x854047){_0x33154d=_0x33154d-0x0;var _0x3b2f03=_0x0791[_0x33154d];return _0x3b2f03;};'use strict';var multer=require(_0x1079('0x0'));var util=require(_0x1079('0x1'));var path=require(_0x1079('0x2'));var timeout=require(_0x1079('0x3'));var express=require('express');var router=express[_0x1079('0x4')]();var auth=require(_0x1079('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1079('0x6'));var controller=require(_0x1079('0x7'));router[_0x1079('0x8')]('/',auth[_0x1079('0x9')](),controller['index']);router[_0x1079('0x8')](_0x1079('0xa'),auth[_0x1079('0x9')](),controller[_0x1079('0xb')]);router[_0x1079('0x8')](_0x1079('0xc'),auth['isAuthenticated'](),controller[_0x1079('0xd')]);router[_0x1079('0x8')]('/:id/actions',auth[_0x1079('0x9')](),controller[_0x1079('0xe')]);router[_0x1079('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1079('0xf')]('/:id/conditions',auth[_0x1079('0x9')](),controller['addConditions']);router['post'](_0x1079('0x10'),auth[_0x1079('0x9')](),controller[_0x1079('0x11')]);router[_0x1079('0x12')](_0x1079('0xa'),auth[_0x1079('0x9')](),controller['update']);router[_0x1079('0x13')](_0x1079('0xa'),auth[_0x1079('0x9')](),controller[_0x1079('0x14')]);module[_0x1079('0x15')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 34dc220..a820072 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 _0x8824=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x22e5b5,_0x570d62){var _0x2774a0=function(_0x44ce53){while(--_0x44ce53){_0x22e5b5['push'](_0x22e5b5['shift']());}};_0x2774a0(++_0x570d62);}(_0x8824,0x1b3));var _0x4882=function(_0x2ccf25,_0x1a9535){_0x2ccf25=_0x2ccf25-0x0;var _0x3e658c=_0x8824[_0x2ccf25];return _0x3e658c;};'use strict';var Sequelize=require('sequelize');module[_0x4882('0x0')]={'name':{'type':Sequelize[_0x4882('0x1')],'unique':_0x4882('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x4882('0x3')](_0x4882('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x4882('0x5')],'defaultValue':0x0,'comment':_0x4882('0x6')},'limitCalls':{'type':Sequelize[_0x4882('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x4882('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4882('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4882('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x4882('0x7')](0x3)[_0x4882('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4882('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4882('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4882('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4882('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x4882('0x7')](0x5)[_0x4882('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4882('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x4882('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4882('0x7')](0x5)[_0x4882('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4882('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x4882('0x7')](0x3)[_0x4882('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x4882('0xf')},'dialTimezone':{'type':Sequelize[_0x4882('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x4882('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x4882('0x3')](_0x4882('0x11'),_0x4882('0x12'),_0x4882('0x13')),'defaultValue':_0x4882('0x11')},'dialAMDActive':{'type':Sequelize[_0x4882('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x4882('0x7')](0x9)[_0x4882('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x4882('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x4882('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x4882('0x7')](0x9)[_0x4882('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4882('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x4882('0x7')](0x9)[_0x4882('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4882('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x4882('0x7')](0x9)[_0x4882('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4882('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4882('0x7')](0x9)[_0x4882('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4882('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4882('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4882('0x7')](0x5)[_0x4882('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4882('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4882('0x7')](0x9)[_0x4882('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4882('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x4882('0x3')]('DESC','ASC'),'defaultValue':_0x4882('0x1b')},'dialPrefix':{'type':Sequelize[_0x4882('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x4882('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4882('0x1c')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4882('0x1d')}}; \ No newline at end of file +var _0xc01f=['INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0xc01f,0xa6));var _0xfc01=function(_0x2d6610,_0x57895a){_0x2d6610=_0x2d6610-0x0;var _0x3da477=_0xc01f[_0x2d6610];return _0x3da477;};'use strict';var Sequelize=require(_0xfc01('0x0'));module['exports']={'name':{'type':Sequelize[_0xfc01('0x1')],'unique':_0xfc01('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xfc01('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xfc01('0x1')]},'active':{'type':Sequelize[_0xfc01('0x4')],'defaultValue':0x0,'comment':_0xfc01('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xfc01('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xfc01('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xfc01('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xfc01('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xfc01('0x8')](0x3)[_0xfc01('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfc01('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfc01('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xfc01('0x8')](0x5)[_0xfc01('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfc01('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xfc01('0x8')](0x3)[_0xfc01('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xfc01('0x8')](0x5)[_0xfc01('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfc01('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xfc01('0x8')](0x3)[_0xfc01('0x6')],'defaultValue':0x3,'comment':_0xfc01('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfc01('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfc01('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xfc01('0x8')](0x3)[_0xfc01('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xfc01('0xf')},'dialTimezone':{'type':Sequelize[_0xfc01('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xfc01('0x1')],'defaultValue':_0xfc01('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xfc01('0x11')]('always','never',_0xfc01('0x12')),'defaultValue':_0xfc01('0x13')},'dialAMDActive':{'type':Sequelize[_0xfc01('0x4')],'defaultValue':0x0,'comment':_0xfc01('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xfc01('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xfc01('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xfc01('0x8')](0x9)[_0xfc01('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xfc01('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xfc01('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xfc01('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xfc01('0x8')](0x9)[_0xfc01('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xfc01('0x8')](0x9)[_0xfc01('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xfc01('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xfc01('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xfc01('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xfc01('0x8')](0x9)[_0xfc01('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xfc01('0x8')](0x5)[_0xfc01('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xfc01('0x8')](0x9)[_0xfc01('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0xfc01('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xfc01('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xfc01('0x8')](0x3)[_0xfc01('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfc01('0x1b')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfc01('0x1c')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 43f60c7..d646d19 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 _0x759d=['../../config/environment','../../mysqldb','sendStatus','status','count','limit','set','Content-Range','json','apply','save','then','destroy','IvrCampaigns','UserProfileResource','end','error','stack','name','index','Campaign','rawAttributes','model','attributes','intersection','fields','query','length','hasOwnProperty','nolimit','offset','sort','filters','pick','where','merge','map','key','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','keys','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','omit','createdAt','updatedAt','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','findOne','CmHopper','order','CampaignId','filter','findAll','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','CmListId','toString','NOW()','from','cm_contacts','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','ListId','phone\x20IS\x20NOT\x20NULL','deletedAt\x20IS\x20NULL','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x1350e7,_0x33b75c){var _0x3e6293=function(_0x41cba1){while(--_0x41cba1){_0x1350e7['push'](_0x1350e7['shift']());}};_0x3e6293(++_0x33b75c);}(_0x759d,0x6d));var _0xd759=function(_0x55b8e8,_0x16556b){_0x55b8e8=_0x55b8e8-0x0;var _0x2902b9=_0x759d[_0x55b8e8];return _0x2902b9;};'use strict';var pdf=require(_0xd759('0x0'));var emlformat=require(_0xd759('0x1'));var rimraf=require(_0xd759('0x2'));var zipdir=require(_0xd759('0x3'));var jsonpatch=require(_0xd759('0x4'));var rp=require(_0xd759('0x5'));var moment=require('moment');var BPromise=require(_0xd759('0x6'));var Mustache=require(_0xd759('0x7'));var util=require(_0xd759('0x8'));var path=require(_0xd759('0x9'));var sox=require(_0xd759('0xa'));var csv=require(_0xd759('0xb'));var ejs=require(_0xd759('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd759('0xd'));var jsforce=require(_0xd759('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd759('0xb'));var querystring=require(_0xd759('0xf'));var Papa=require(_0xd759('0x10'));var Redis=require(_0xd759('0x11'));var authService=require(_0xd759('0x12'));var qs=require(_0xd759('0x13'));var hardwareService=require(_0xd759('0x14'));var logger=require(_0xd759('0x15'))(_0xd759('0x16'));var utils=require(_0xd759('0x17'));var config=require(_0xd759('0x18'));var db=require(_0xd759('0x19'))['db'];function respondWithStatusCode(_0x21cb88,_0x164690){_0x164690=_0x164690||0xcc;return function(_0x17dd1f){if(_0x17dd1f){return _0x21cb88[_0xd759('0x1a')](_0x164690);}return _0x21cb88[_0xd759('0x1b')](_0x164690)['end']();};}function respondWithResult(_0x3853b5,_0x392b45){_0x392b45=_0x392b45||0xc8;return function(_0x2ea5a9){if(_0x2ea5a9){return _0x3853b5[_0xd759('0x1b')](_0x392b45)['json'](_0x2ea5a9);}};}function respondWithFilteredResult(_0x19605,_0x1fdbf5){return function(_0x1e77c6){if(_0x1e77c6){var _0x146964=_0x1e77c6[_0xd759('0x1c')],_0x917fd8=_0x1fdbf5['offset'],_0x1f4419=_0x1fdbf5['offset']+_0x1fdbf5[_0xd759('0x1d')],_0x4bb010;if(_0x1f4419>=_0x146964){_0x1f4419=_0x146964;_0x4bb010=0xc8;}else{_0x4bb010=0xce;}_0x19605['status'](_0x4bb010);return _0x19605[_0xd759('0x1e')](_0xd759('0x1f'),_0x917fd8+'-'+_0x1f4419+'/'+_0x146964)[_0xd759('0x20')](_0x1e77c6);}return null;};}function patchUpdates(_0x582c46){return function(_0xc548b){try{jsonpatch[_0xd759('0x21')](_0xc548b,_0x582c46,!![]);}catch(_0x5a9256){return BPromise['reject'](_0x5a9256);}return _0xc548b[_0xd759('0x22')]();};}function saveUpdates(_0x469f14,_0x12686d){return function(_0x253f79){if(_0x253f79){return _0x253f79['update'](_0x469f14)[_0xd759('0x23')](function(_0x484912){return _0x484912;});}return null;};}function removeEntity(_0x1bc989,_0x2a2e1d){return function(_0x4ab6d7){if(_0x4ab6d7){return _0x4ab6d7[_0xd759('0x24')]()[_0xd759('0x23')](function(){var _0x280588=_0x4ab6d7['get']({'plain':!![]});var _0x1408ff=_0xd759('0x25');return db[_0xd759('0x26')][_0xd759('0x24')]({'where':{'type':_0x1408ff,'resourceId':_0x280588['id']}})['then'](function(){return _0x4ab6d7;});})[_0xd759('0x23')](function(){_0x1bc989[_0xd759('0x1b')](0xcc)[_0xd759('0x27')]();});}};}function handleEntityNotFound(_0x5c6d84,_0x27d9a6){return function(_0x37ca84){if(!_0x37ca84){_0x5c6d84[_0xd759('0x1a')](0x194);}return _0x37ca84;};}function handleError(_0x156c35,_0x45d18f){_0x45d18f=_0x45d18f||0x1f4;return function(_0x2c36c5){logger[_0xd759('0x28')](_0x2c36c5[_0xd759('0x29')]);if(_0x2c36c5[_0xd759('0x2a')]){delete _0x2c36c5['name'];}_0x156c35[_0xd759('0x1b')](_0x45d18f)['send'](_0x2c36c5);};}exports[_0xd759('0x2b')]=function(_0x513678,_0xe19002){var _0x95f374={},_0x150769={},_0x32dfa3={'count':0x0,'rows':[]};var _0xcf3262=db[_0xd759('0x2c')][_0xd759('0x2d')];_0x150769[_0xd759('0x2e')]=_['keys'](_0xcf3262);_0x150769['query']=_['keys'](_0x513678['query']);_0x150769['filters']=_['intersection'](_0x150769[_0xd759('0x2e')],_0x150769['query']);_0x95f374[_0xd759('0x2f')]=_[_0xd759('0x30')](_0x150769[_0xd759('0x2e')],qs[_0xd759('0x31')](_0x513678[_0xd759('0x32')][_0xd759('0x31')]));_0x95f374[_0xd759('0x2f')]=_0x95f374[_0xd759('0x2f')][_0xd759('0x33')]?_0x95f374[_0xd759('0x2f')]:_0x150769[_0xd759('0x2e')];if(!_0x513678[_0xd759('0x32')][_0xd759('0x34')](_0xd759('0x35'))){_0x95f374[_0xd759('0x1d')]=qs[_0xd759('0x1d')](_0x513678[_0xd759('0x32')][_0xd759('0x1d')]);_0x95f374['offset']=qs[_0xd759('0x36')](_0x513678[_0xd759('0x32')][_0xd759('0x36')]);}_0x95f374['order']=qs['sort'](_0x513678['query'][_0xd759('0x37')]);_0x95f374['where']=qs[_0xd759('0x38')](_[_0xd759('0x39')](_0x513678[_0xd759('0x32')],_0x150769['filters']));if(_0x513678[_0xd759('0x32')]['filter']){_0x95f374[_0xd759('0x3a')]=_[_0xd759('0x3b')](_0x95f374[_0xd759('0x3a')],{'$or':_[_0xd759('0x3c')](_0xcf3262,function(_0x1a8741){if(_0x1a8741['type'][_0xd759('0x3d')]!==_0xd759('0x3e')){var _0x407d26={};_0x407d26[_0x1a8741[_0xd759('0x3f')]]={'$like':'%'+_0x513678[_0xd759('0x32')]['filter']+'%'};return _0x407d26;}})});}_0x95f374=_[_0xd759('0x3b')]({},_0x95f374,_0x513678[_0xd759('0x40')]);var _0x3d1131={'where':_0x95f374[_0xd759('0x3a')]};return db[_0xd759('0x2c')][_0xd759('0x1c')](_0x3d1131)[_0xd759('0x23')](function(_0x578ab3){_0x32dfa3[_0xd759('0x1c')]=_0x578ab3;if(_0x513678[_0xd759('0x32')][_0xd759('0x41')]){_0x95f374[_0xd759('0x42')]=[{'all':!![]}];}return db[_0xd759('0x2c')]['findAll'](_0x95f374);})[_0xd759('0x23')](function(_0xc8f7f7){_0x32dfa3[_0xd759('0x43')]=_0xc8f7f7;return _0x32dfa3;})['then'](respondWithFilteredResult(_0xe19002,_0x95f374))[_0xd759('0x44')](handleError(_0xe19002,null));};exports[_0xd759('0x45')]=function(_0xc18053,_0x45d2e1){var _0x7cc01c={'raw':![],'where':{'id':_0xc18053[_0xd759('0x46')]['id']}},_0x16e87a={};_0x16e87a[_0xd759('0x2e')]=_[_0xd759('0x47')](db[_0xd759('0x2c')][_0xd759('0x2d')]);_0x16e87a['query']=_[_0xd759('0x47')](_0xc18053['query']);_0x16e87a[_0xd759('0x38')]=_[_0xd759('0x30')](_0x16e87a[_0xd759('0x2e')],_0x16e87a[_0xd759('0x32')]);_0x7cc01c[_0xd759('0x2f')]=_[_0xd759('0x30')](_0x16e87a[_0xd759('0x2e')],qs[_0xd759('0x31')](_0xc18053['query'][_0xd759('0x31')]));_0x7cc01c['attributes']=_0x7cc01c[_0xd759('0x2f')][_0xd759('0x33')]?_0x7cc01c[_0xd759('0x2f')]:_0x16e87a[_0xd759('0x2e')];if(_0xc18053[_0xd759('0x32')][_0xd759('0x41')]){_0x7cc01c[_0xd759('0x42')]=[{'all':!![]}];}_0x7cc01c=_[_0xd759('0x3b')]({},_0x7cc01c,_0xc18053[_0xd759('0x40')]);return db[_0xd759('0x2c')][_0xd759('0x48')](_0x7cc01c)[_0xd759('0x23')](handleEntityNotFound(_0x45d2e1,null))['then'](respondWithResult(_0x45d2e1,null))['catch'](handleError(_0x45d2e1,null));};exports[_0xd759('0x49')]=function(_0x3ab1de,_0x1aad79){return db[_0xd759('0x2c')]['create'](_0x3ab1de[_0xd759('0x4a')],{})['then'](function(_0x1a204d){var _0x460619=_0x3ab1de['user'][_0xd759('0x4b')]({'plain':!![]});if(!_0x460619)throw new Error(_0xd759('0x4c'));if(_0x460619[_0xd759('0x4d')]===_0xd759('0x4e')){var _0x3f3e72=_0x1a204d[_0xd759('0x4b')]({'plain':!![]});var _0x210003='IvrCampaigns';return db[_0xd759('0x4f')][_0xd759('0x48')]({'where':{'name':_0x210003,'userProfileId':_0x460619[_0xd759('0x50')]},'raw':!![]})['then'](function(_0x5a5f92){if(_0x5a5f92&&_0x5a5f92['autoAssociation']===0x0){return db[_0xd759('0x26')][_0xd759('0x49')]({'name':_0x3f3e72['name'],'resourceId':_0x3f3e72['id'],'type':_0x5a5f92[_0xd759('0x2a')],'sectionId':_0x5a5f92['id']},{})[_0xd759('0x23')](function(){return _0x1a204d;});}else{return _0x1a204d;}})[_0xd759('0x44')](function(_0x3b4263){logger[_0xd759('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b4263);throw _0x3b4263;});}return _0x1a204d;})['then'](respondWithResult(_0x1aad79,0xc9))[_0xd759('0x44')](handleError(_0x1aad79,null));};exports['clone']=function(_0x4a263f,_0xdf7e73){var _0xc6dd3={'raw':![],'where':{'id':_0x4a263f[_0xd759('0x46')]['id']}},_0x34674b={};_0x34674b['model']=_[_0xd759('0x47')](db['Campaign'][_0xd759('0x2d')]);_0xc6dd3[_0xd759('0x2f')]=_[_0xd759('0x30')](_0x34674b[_0xd759('0x2e')],qs[_0xd759('0x31')](_0x4a263f[_0xd759('0x32')][_0xd759('0x31')]));_0xc6dd3['attributes']=_0xc6dd3[_0xd759('0x2f')][_0xd759('0x33')]?_0xc6dd3[_0xd759('0x2f')]:_0x34674b[_0xd759('0x2e')];if(_0x4a263f[_0xd759('0x32')][_0xd759('0x41')]){_0xc6dd3[_0xd759('0x42')]=[{'all':!![]}];}_0xc6dd3=_[_0xd759('0x3b')]({},_0xc6dd3,_0x4a263f[_0xd759('0x40')]);return db[_0xd759('0x2c')][_0xd759('0x48')](_0xc6dd3)[_0xd759('0x23')](handleEntityNotFound(_0xdf7e73,null))[_0xd759('0x23')](function(_0x38e074){if(_0x38e074){var _0x39e44a=_0x38e074['get']({'plain':!![]});_0x39e44a=qs[_0xd759('0x51')](_0x39e44a,['id',_0xd759('0x52'),_0xd759('0x53')]);_0x4a263f[_0xd759('0x4a')]=_[_0xd759('0x51')](_0x4a263f['body'],['id',_0xd759('0x52'),_0xd759('0x53')]);return db[_0xd759('0x2c')][_0xd759('0x49')](_[_0xd759('0x3b')](_0x39e44a,_0x4a263f[_0xd759('0x4a')]),{'include':_0x4a263f['query'][_0xd759('0x41')]?[{'all':!![]}]:undefined})[_0xd759('0x23')](function(_0x1b247e){var _0x1753fa=_0x4a263f[_0xd759('0x4e')][_0xd759('0x4b')]({'plain':!![]});if(!_0x1753fa)throw new Error(_0xd759('0x4c'));if(_0x1753fa[_0xd759('0x4d')]===_0xd759('0x4e')){var _0x548f36=_0x1b247e[_0xd759('0x4b')]({'plain':!![]});var _0x5c4147='IvrCampaigns';return db[_0xd759('0x4f')][_0xd759('0x48')]({'where':{'name':_0x5c4147,'userProfileId':_0x1753fa['userProfileId']},'raw':!![]})['then'](function(_0x10f18a){if(_0x10f18a&&_0x10f18a[_0xd759('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x548f36[_0xd759('0x2a')],'resourceId':_0x548f36['id'],'type':_0x10f18a[_0xd759('0x2a')],'sectionId':_0x10f18a['id']},{})['then'](function(){return _0x1b247e;});}else{return _0x1b247e;}})[_0xd759('0x44')](function(_0x2a3280){logger[_0xd759('0x28')](_0xd759('0x55'),_0x2a3280);throw _0x2a3280;});}return _0x1b247e;});}})[_0xd759('0x23')](respondWithResult(_0xdf7e73,0xc9))['catch'](handleError(_0xdf7e73,null));};exports[_0xd759('0x56')]=function(_0xdc547b,_0x3798ae){if(_0xdc547b[_0xd759('0x4a')]['id']){delete _0xdc547b['body']['id'];}return db[_0xd759('0x2c')][_0xd759('0x48')]({'where':{'id':_0xdc547b[_0xd759('0x46')]['id']}})['then'](handleEntityNotFound(_0x3798ae,null))[_0xd759('0x23')](saveUpdates(_0xdc547b[_0xd759('0x4a')],null))[_0xd759('0x23')](respondWithResult(_0x3798ae,null))['catch'](handleError(_0x3798ae,null));};exports['destroy']=function(_0x5595a3,_0x6540ea){return db[_0xd759('0x2c')][_0xd759('0x48')]({'where':{'id':_0x5595a3[_0xd759('0x46')]['id']}})[_0xd759('0x23')](handleEntityNotFound(_0x6540ea,null))[_0xd759('0x23')](removeEntity(_0x6540ea,null))[_0xd759('0x44')](handleError(_0x6540ea,null));};exports[_0xd759('0x57')]=function(_0x59cdf3,_0x1e0f4e,_0x570e32){var _0x17b77c={'raw':!![],'where':{}};var _0x43213d={};var _0x22f2dd={'count':0x0,'rows':[]};return db[_0xd759('0x2c')][_0xd759('0x58')]({'where':{'id':_0x59cdf3[_0xd759('0x46')]['id']}})[_0xd759('0x23')](handleEntityNotFound(_0x1e0f4e,null))['then'](function(_0xae5d92){if(_0xae5d92){_0x43213d[_0xd759('0x2e')]=_['keys'](db[_0xd759('0x59')][_0xd759('0x2d')]);_0x43213d[_0xd759('0x32')]=_['keys'](_0x59cdf3[_0xd759('0x32')]);_0x43213d['filters']=_['intersection'](_0x43213d['model'],_0x43213d['query']);_0x17b77c[_0xd759('0x2f')]=_[_0xd759('0x30')](_0x43213d[_0xd759('0x2e')],qs['fields'](_0x59cdf3[_0xd759('0x32')]['fields']));_0x17b77c['attributes']=_0x17b77c[_0xd759('0x2f')][_0xd759('0x33')]?_0x17b77c['attributes']:_0x43213d['model'];if(!_0x59cdf3[_0xd759('0x32')][_0xd759('0x34')](_0xd759('0x35'))){_0x17b77c[_0xd759('0x1d')]=qs[_0xd759('0x1d')](_0x59cdf3[_0xd759('0x32')][_0xd759('0x1d')]);_0x17b77c['offset']=qs['offset'](_0x59cdf3[_0xd759('0x32')][_0xd759('0x36')]);}_0x17b77c[_0xd759('0x5a')]=qs[_0xd759('0x37')](_0x59cdf3[_0xd759('0x32')][_0xd759('0x37')]);_0x17b77c[_0xd759('0x3a')]=qs[_0xd759('0x38')](_[_0xd759('0x39')](_0x59cdf3['query'],_0x43213d['filters']));_0x17b77c[_0xd759('0x3a')][_0xd759('0x5b')]=_0xae5d92['id'];if(_0x59cdf3[_0xd759('0x32')][_0xd759('0x5c')]){_0x17b77c[_0xd759('0x3a')]=_[_0xd759('0x3b')](_0x17b77c[_0xd759('0x3a')],{'$or':_['map'](_0x17b77c[_0xd759('0x2f')],function(_0x46d0c7){var _0x1063ae={};_0x1063ae[_0x46d0c7]={'$like':'%'+_0x59cdf3[_0xd759('0x32')]['filter']+'%'};return _0x1063ae;})});}_0x17b77c=_['merge']({},_0x17b77c,_0x59cdf3[_0xd759('0x40')]);return db['CmHopper']['count']({'where':_0x17b77c[_0xd759('0x3a')]})[_0xd759('0x23')](function(_0x45f6e0){_0x22f2dd[_0xd759('0x1c')]=_0x45f6e0;if(_0x59cdf3[_0xd759('0x32')][_0xd759('0x41')]){_0x17b77c[_0xd759('0x42')]=[{'all':!![]}];}return db[_0xd759('0x59')][_0xd759('0x5d')](_0x17b77c);})[_0xd759('0x23')](function(_0x45294b){_0x22f2dd[_0xd759('0x43')]=_0x45294b;return _0x22f2dd;});}})[_0xd759('0x23')](respondWithFilteredResult(_0x1e0f4e,_0x17b77c))[_0xd759('0x44')](handleError(_0x1e0f4e,null));};exports['getHopperHistories']=function(_0x2efa99,_0x30b0ba,_0x3129c8){var _0x13dd3e={'raw':!![],'where':{}};var _0x5991de={};var _0x57195a={'count':0x0,'rows':[]};return db[_0xd759('0x2c')]['findOne']({'where':{'id':_0x2efa99[_0xd759('0x46')]['id']}})[_0xd759('0x23')](handleEntityNotFound(_0x30b0ba,null))[_0xd759('0x23')](function(_0x2ec4c8){if(_0x2ec4c8){_0x5991de['model']=_[_0xd759('0x47')](db[_0xd759('0x5e')][_0xd759('0x2d')]);_0x5991de[_0xd759('0x32')]=_['keys'](_0x2efa99[_0xd759('0x32')]);_0x5991de['filters']=_[_0xd759('0x30')](_0x5991de[_0xd759('0x2e')],_0x5991de[_0xd759('0x32')]);_0x13dd3e[_0xd759('0x2f')]=_['intersection'](_0x5991de['model'],qs[_0xd759('0x31')](_0x2efa99[_0xd759('0x32')][_0xd759('0x31')]));_0x13dd3e['attributes']=_0x13dd3e[_0xd759('0x2f')][_0xd759('0x33')]?_0x13dd3e[_0xd759('0x2f')]:_0x5991de[_0xd759('0x2e')];if(!_0x2efa99[_0xd759('0x32')][_0xd759('0x34')](_0xd759('0x35'))){_0x13dd3e[_0xd759('0x1d')]=qs[_0xd759('0x1d')](_0x2efa99[_0xd759('0x32')][_0xd759('0x1d')]);_0x13dd3e[_0xd759('0x36')]=qs[_0xd759('0x36')](_0x2efa99[_0xd759('0x32')][_0xd759('0x36')]);}_0x13dd3e['order']=qs[_0xd759('0x37')](_0x2efa99[_0xd759('0x32')][_0xd759('0x37')]);_0x13dd3e[_0xd759('0x3a')]=qs[_0xd759('0x38')](_[_0xd759('0x39')](_0x2efa99[_0xd759('0x32')],_0x5991de[_0xd759('0x38')]));_0x13dd3e['where']['CampaignId']=_0x2ec4c8['id'];if(_0x2efa99[_0xd759('0x32')][_0xd759('0x5c')]){_0x13dd3e[_0xd759('0x3a')]=_[_0xd759('0x3b')](_0x13dd3e[_0xd759('0x3a')],{'$or':_[_0xd759('0x3c')](_0x13dd3e[_0xd759('0x2f')],function(_0x2adecf){var _0xa28dd3={};_0xa28dd3[_0x2adecf]={'$like':'%'+_0x2efa99[_0xd759('0x32')][_0xd759('0x5c')]+'%'};return _0xa28dd3;})});}_0x13dd3e=_[_0xd759('0x3b')]({},_0x13dd3e,_0x2efa99[_0xd759('0x40')]);return db[_0xd759('0x5e')][_0xd759('0x1c')]({'where':_0x13dd3e[_0xd759('0x3a')]})[_0xd759('0x23')](function(_0x2bd152){_0x57195a[_0xd759('0x1c')]=_0x2bd152;if(_0x2efa99[_0xd759('0x32')][_0xd759('0x41')]){_0x13dd3e[_0xd759('0x42')]=[{'all':!![]}];}return db[_0xd759('0x5e')]['findAll'](_0x13dd3e);})['then'](function(_0x551a24){_0x57195a[_0xd759('0x43')]=_0x551a24;return _0x57195a;});}})[_0xd759('0x23')](respondWithFilteredResult(_0x30b0ba,_0x13dd3e))[_0xd759('0x44')](handleError(_0x30b0ba,null));};exports['getHopperFinals']=function(_0x3200dd,_0x21381e,_0x5d2889){var _0x5b459f={'raw':!![],'where':{}};var _0x341fd1={};var _0x395d34={'count':0x0,'rows':[]};return db[_0xd759('0x2c')][_0xd759('0x58')]({'where':{'id':_0x3200dd['params']['id']}})[_0xd759('0x23')](handleEntityNotFound(_0x21381e,null))[_0xd759('0x23')](function(_0x62a9){if(_0x62a9){_0x341fd1[_0xd759('0x2e')]=_[_0xd759('0x47')](db[_0xd759('0x5f')][_0xd759('0x2d')]);_0x341fd1[_0xd759('0x32')]=_['keys'](_0x3200dd[_0xd759('0x32')]);_0x341fd1[_0xd759('0x38')]=_[_0xd759('0x30')](_0x341fd1[_0xd759('0x2e')],_0x341fd1[_0xd759('0x32')]);_0x5b459f['attributes']=_['intersection'](_0x341fd1['model'],qs[_0xd759('0x31')](_0x3200dd[_0xd759('0x32')][_0xd759('0x31')]));_0x5b459f[_0xd759('0x2f')]=_0x5b459f['attributes'][_0xd759('0x33')]?_0x5b459f[_0xd759('0x2f')]:_0x341fd1[_0xd759('0x2e')];if(!_0x3200dd['query'][_0xd759('0x34')]('nolimit')){_0x5b459f[_0xd759('0x1d')]=qs[_0xd759('0x1d')](_0x3200dd['query']['limit']);_0x5b459f[_0xd759('0x36')]=qs['offset'](_0x3200dd[_0xd759('0x32')]['offset']);}_0x5b459f[_0xd759('0x5a')]=qs[_0xd759('0x37')](_0x3200dd[_0xd759('0x32')]['sort']);_0x5b459f[_0xd759('0x3a')]=qs[_0xd759('0x38')](_['pick'](_0x3200dd[_0xd759('0x32')],_0x341fd1['filters']));_0x5b459f[_0xd759('0x3a')]['CampaignId']=_0x62a9['id'];if(_0x3200dd[_0xd759('0x32')][_0xd759('0x5c')]){_0x5b459f['where']=_[_0xd759('0x3b')](_0x5b459f[_0xd759('0x3a')],{'$or':_[_0xd759('0x3c')](_0x5b459f[_0xd759('0x2f')],function(_0x425eb6){var _0x42f11c={};_0x42f11c[_0x425eb6]={'$like':'%'+_0x3200dd[_0xd759('0x32')][_0xd759('0x5c')]+'%'};return _0x42f11c;})});}_0x5b459f=_['merge']({},_0x5b459f,_0x3200dd['options']);return db[_0xd759('0x5f')][_0xd759('0x1c')]({'where':_0x5b459f[_0xd759('0x3a')]})[_0xd759('0x23')](function(_0x18ff61){_0x395d34[_0xd759('0x1c')]=_0x18ff61;if(_0x3200dd['query'][_0xd759('0x41')]){_0x5b459f['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x5b459f);})[_0xd759('0x23')](function(_0xbd041e){_0x395d34['rows']=_0xbd041e;return _0x395d34;});}})['then'](respondWithFilteredResult(_0x21381e,_0x5b459f))[_0xd759('0x44')](handleError(_0x21381e,null));};exports[_0xd759('0x60')]=function(_0x388aa1,_0x1a399c,_0x501bb2){var _0x565fd9={'raw':!![],'where':{}};var _0x376723={};var _0x1e82bc={'count':0x0,'rows':[]};return db[_0xd759('0x2c')][_0xd759('0x58')]({'where':{'id':_0x388aa1[_0xd759('0x46')]['id']}})[_0xd759('0x23')](handleEntityNotFound(_0x1a399c,null))['then'](function(_0x78c0a8){if(_0x78c0a8){_0x376723[_0xd759('0x2e')]=_[_0xd759('0x47')](db[_0xd759('0x61')][_0xd759('0x2d')]);_0x376723[_0xd759('0x32')]=_['keys'](_0x388aa1[_0xd759('0x32')]);_0x376723[_0xd759('0x38')]=_[_0xd759('0x30')](_0x376723['model'],_0x376723[_0xd759('0x32')]);_0x565fd9[_0xd759('0x2f')]=_[_0xd759('0x30')](_0x376723[_0xd759('0x2e')],qs[_0xd759('0x31')](_0x388aa1['query']['fields']));_0x565fd9['attributes']=_0x565fd9[_0xd759('0x2f')][_0xd759('0x33')]?_0x565fd9[_0xd759('0x2f')]:_0x376723[_0xd759('0x2e')];if(!_0x388aa1[_0xd759('0x32')][_0xd759('0x34')](_0xd759('0x35'))){_0x565fd9['limit']=qs[_0xd759('0x1d')](_0x388aa1[_0xd759('0x32')][_0xd759('0x1d')]);_0x565fd9[_0xd759('0x36')]=qs[_0xd759('0x36')](_0x388aa1['query'][_0xd759('0x36')]);}_0x565fd9[_0xd759('0x5a')]=qs[_0xd759('0x37')](_0x388aa1['query'][_0xd759('0x37')]);_0x565fd9[_0xd759('0x3a')]=qs[_0xd759('0x38')](_[_0xd759('0x39')](_0x388aa1[_0xd759('0x32')],_0x376723['filters']));_0x565fd9[_0xd759('0x3a')][_0xd759('0x5b')]=_0x78c0a8['id'];if(_0x388aa1[_0xd759('0x32')]['filter']){_0x565fd9[_0xd759('0x3a')]=_['merge'](_0x565fd9[_0xd759('0x3a')],{'$or':_['map'](_0x565fd9[_0xd759('0x2f')],function(_0x5d1b08){var _0x469c7d={};_0x469c7d[_0x5d1b08]={'$like':'%'+_0x388aa1[_0xd759('0x32')][_0xd759('0x5c')]+'%'};return _0x469c7d;})});}_0x565fd9=_[_0xd759('0x3b')]({},_0x565fd9,_0x388aa1[_0xd759('0x40')]);return db[_0xd759('0x61')]['count']({'where':_0x565fd9[_0xd759('0x3a')]})[_0xd759('0x23')](function(_0x15e465){_0x1e82bc['count']=_0x15e465;if(_0x388aa1['query'][_0xd759('0x41')]){_0x565fd9['include']=[{'all':!![]}];}return db[_0xd759('0x61')]['findAll'](_0x565fd9);})[_0xd759('0x23')](function(_0x1d0c34){_0x1e82bc[_0xd759('0x43')]=_0x1d0c34;return _0x1e82bc;});}})[_0xd759('0x23')](respondWithFilteredResult(_0x1a399c,_0x565fd9))[_0xd759('0x44')](handleError(_0x1a399c,null));};exports[_0xd759('0x62')]=function(_0x27091b,_0x31ea70,_0xf577c4){var _0x2d1027={};var _0xba047c={};var _0x3cd777;var _0x5e7e7d;return db[_0xd759('0x2c')]['findOne']({'where':{'id':_0x27091b[_0xd759('0x46')]['id']}})[_0xd759('0x23')](handleEntityNotFound(_0x31ea70,null))[_0xd759('0x23')](function(_0x258ee8){if(_0x258ee8){_0x3cd777=_0x258ee8;_0xba047c[_0xd759('0x2e')]=_[_0xd759('0x47')](db[_0xd759('0x63')][_0xd759('0x2d')]);_0xba047c[_0xd759('0x32')]=_[_0xd759('0x47')](_0x27091b[_0xd759('0x32')]);_0xba047c[_0xd759('0x38')]=_[_0xd759('0x30')](_0xba047c[_0xd759('0x2e')],_0xba047c[_0xd759('0x32')]);_0x2d1027[_0xd759('0x2f')]=_[_0xd759('0x30')](_0xba047c[_0xd759('0x2e')],qs[_0xd759('0x31')](_0x27091b['query'][_0xd759('0x31')]));_0x2d1027[_0xd759('0x2f')]=_0x2d1027[_0xd759('0x2f')]['length']?_0x2d1027[_0xd759('0x2f')]:_0xba047c[_0xd759('0x2e')];_0x2d1027['order']=qs[_0xd759('0x37')](_0x27091b[_0xd759('0x32')][_0xd759('0x37')]);_0x2d1027[_0xd759('0x3a')]=qs['filters'](_[_0xd759('0x39')](_0x27091b[_0xd759('0x32')],_0xba047c['filters']));if(_0x27091b[_0xd759('0x32')]['filter']){_0x2d1027[_0xd759('0x3a')]=_[_0xd759('0x3b')](_0x2d1027['where'],{'$or':_['map'](_0x2d1027['attributes'],function(_0x4ddba4){var _0x38ba0e={};_0x38ba0e[_0x4ddba4]={'$like':'%'+_0x27091b[_0xd759('0x32')][_0xd759('0x5c')]+'%'};return _0x38ba0e;})});}_0x2d1027=_[_0xd759('0x3b')]({},_0x2d1027,_0x27091b[_0xd759('0x40')]);return _0x3cd777[_0xd759('0x62')](_0x2d1027);}})[_0xd759('0x23')](function(_0x384efb){if(_0x384efb){_0x5e7e7d=_0x384efb[_0xd759('0x33')];if(!_0x27091b[_0xd759('0x32')][_0xd759('0x34')](_0xd759('0x35'))){_0x2d1027[_0xd759('0x1d')]=qs['limit'](_0x27091b[_0xd759('0x32')][_0xd759('0x1d')]);_0x2d1027['offset']=qs[_0xd759('0x36')](_0x27091b[_0xd759('0x32')]['offset']);}return _0x3cd777[_0xd759('0x62')](_0x2d1027);}})[_0xd759('0x23')](function(_0x395831){if(_0x395831){return _0x395831?{'count':_0x5e7e7d,'rows':_0x395831}:null;}})[_0xd759('0x23')](respondWithResult(_0x31ea70,null))['catch'](handleError(_0x31ea70,null));};exports['addLists']=function(_0x236a08,_0x4ea739,_0x4ef16c){var _0xac786f,_0x12d16a;return db[_0xd759('0x2c')][_0xd759('0x48')]({'where':{'id':_0x236a08[_0xd759('0x46')]['id']}})[_0xd759('0x23')](handleEntityNotFound(_0x4ea739,null))[_0xd759('0x23')](function(_0x59a078){if(_0x59a078){_0x12d16a=_0x59a078;return _0x59a078[_0xd759('0x64')](_0x236a08['body'][_0xd759('0x65')],_[_0xd759('0x51')](_0x236a08[_0xd759('0x4a')],[_0xd759('0x65'),'id'])||{});}return null;})['spread'](function(_0x5eff1e){var _0x5aff82;_0xac786f=_0x5eff1e||[];var _0x3f803c=[];if(_0x5eff1e){for(var _0x56f1ef=0x0;_0x56f1ef<_0x5eff1e[_0xd759('0x33')];_0x56f1ef+=0x1){var _0x5130c9=_0x5eff1e[_0x56f1ef][_0xd759('0x4b')]({'plain':!![]});_0x12d16a['dialCheckDuplicateType']=_0x236a08[_0xd759('0x4a')][_0xd759('0x66')]?_0x236a08[_0xd759('0x4a')][_0xd759('0x66')]:_0x12d16a['dialCheckDuplicateType'];switch(_0x12d16a[_0xd759('0x66')]){case _0xd759('0x67'):_0x5aff82=squel['insert']()[_0xd759('0x68')](_0xd759('0x69'))[_0xd759('0x6a')]([_0xd759('0x6b'),_0xd759('0x6c'),_0xd759('0x6d'),'ListId',_0xd759('0x5b'),_0xd759('0x52'),_0xd759('0x53')],squel[_0xd759('0x6e')]()[_0xd759('0x3f')](_0xd759('0x6b'),_0xd759('0x6b'))[_0xd759('0x3f')]('NOW()',_0xd759('0x6c'))[_0xd759('0x3f')]('id',_0xd759('0x6d'))[_0xd759('0x3f')](_0x5130c9[_0xd759('0x6f')]['toString'](),'ListId')['field'](_0x236a08[_0xd759('0x46')]['id'][_0xd759('0x70')](),_0xd759('0x5b'))[_0xd759('0x3f')](_0xd759('0x71'),_0xd759('0x52'))['field'](_0xd759('0x71'),_0xd759('0x53'))[_0xd759('0x72')](_0xd759('0x73'))[_0xd759('0x3a')]('deletedAt\x20IS\x20NULL')[_0xd759('0x3a')](_0xd759('0x74'),_0x5130c9[_0xd759('0x6f')]['toString']())[_0xd759('0x3a')]('phone\x20IS\x20NOT\x20NULL')[_0xd759('0x3a')](_0xd759('0x75'),squel[_0xd759('0x6e')]()[_0xd759('0x3f')]('COALESCE(calleridnum,\x27\x27)')[_0xd759('0x72')]('cm_hopper_final')[_0xd759('0x3a')]('CampaignId\x20=\x20?',_0x236a08[_0xd759('0x46')]['id'][_0xd759('0x70')]()))[_0xd759('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xd759('0x3f')](_0xd759('0x76'))[_0xd759('0x72')]('cm_hopper')[_0xd759('0x3a')](_0xd759('0x77'),_0x236a08[_0xd759('0x46')]['id'][_0xd759('0x70')]())))[_0xd759('0x70')]();break;case _0xd759('0x78'):_0x5aff82=squel['insert']()[_0xd759('0x68')](_0xd759('0x69'))[_0xd759('0x6a')]([_0xd759('0x6b'),_0xd759('0x6c'),_0xd759('0x6d'),'ListId','CampaignId',_0xd759('0x52'),_0xd759('0x53')],squel[_0xd759('0x6e')]()[_0xd759('0x3f')](_0xd759('0x6b'),_0xd759('0x6b'))['field'](_0xd759('0x71'),_0xd759('0x6c'))[_0xd759('0x3f')]('id','ContactId')[_0xd759('0x3f')](_0x5130c9[_0xd759('0x6f')][_0xd759('0x70')](),_0xd759('0x79'))[_0xd759('0x3f')](_0x236a08[_0xd759('0x46')]['id'][_0xd759('0x70')](),_0xd759('0x5b'))[_0xd759('0x3f')](_0xd759('0x71'),_0xd759('0x52'))[_0xd759('0x3f')](_0xd759('0x71'),_0xd759('0x53'))[_0xd759('0x72')](_0xd759('0x73'))[_0xd759('0x3a')]('deletedAt\x20IS\x20NULL')[_0xd759('0x3a')](_0xd759('0x74'),_0x5130c9[_0xd759('0x6f')][_0xd759('0x70')]())[_0xd759('0x3a')](_0xd759('0x7a'))[_0xd759('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0xd759('0x6e')]()[_0xd759('0x3f')](_0xd759('0x76'))[_0xd759('0x72')](_0xd759('0x69'))[_0xd759('0x3a')](_0xd759('0x77'),_0x236a08[_0xd759('0x46')]['id'][_0xd759('0x70')]())))[_0xd759('0x70')]();break;default:_0x5aff82=squel['insert']()[_0xd759('0x68')](_0xd759('0x69'))[_0xd759('0x6a')](['phone',_0xd759('0x6c'),_0xd759('0x6d'),'ListId',_0xd759('0x5b'),'createdAt','updatedAt'],squel['select']()[_0xd759('0x3f')](_0xd759('0x6b'),_0xd759('0x6b'))[_0xd759('0x3f')](_0xd759('0x71'),_0xd759('0x6c'))[_0xd759('0x3f')]('id',_0xd759('0x6d'))['field'](_0x5130c9[_0xd759('0x6f')][_0xd759('0x70')](),'ListId')['field'](_0x236a08[_0xd759('0x46')]['id'][_0xd759('0x70')](),_0xd759('0x5b'))['field']('NOW()',_0xd759('0x52'))['field'](_0xd759('0x71'),'updatedAt')[_0xd759('0x72')]('cm_contacts')['where'](_0xd759('0x7b'))[_0xd759('0x3a')](_0xd759('0x74'),_0x5130c9['CmListId'][_0xd759('0x70')]())[_0xd759('0x3a')](_0xd759('0x7a')))[_0xd759('0x70')]();}_0x3f803c[_0xd759('0x7c')](db[_0xd759('0x7d')][_0xd759('0x32')](_0x5aff82));}return BPromise[_0xd759('0x7e')](_0x3f803c);}})[_0xd759('0x23')](function(){return _0xac786f;})[_0xd759('0x23')](respondWithResult(_0x4ea739,null))['catch'](handleError(_0x4ea739,null));};exports['removeLists']=function(_0x252185,_0x212a4b,_0x4db8e1){return db[_0xd759('0x2c')][_0xd759('0x48')]({'where':{'id':_0x252185[_0xd759('0x46')]['id']}})[_0xd759('0x23')](handleEntityNotFound(_0x212a4b,null))[_0xd759('0x23')](function(_0x4b37d8){if(_0x4b37d8){return _0x4b37d8[_0xd759('0x7f')](_0x252185['query'][_0xd759('0x65')]);}})[_0xd759('0x23')](function(_0x5d033a){if(_0x5d033a){return db[_0xd759('0x59')][_0xd759('0x24')]({'where':{'ListId':_0x252185['query'][_0xd759('0x65')],'CampaignId':_0x252185[_0xd759('0x46')]['id']}})['then'](function(){return _0x5d033a;});}})[_0xd759('0x23')](respondWithStatusCode(_0x212a4b,null))[_0xd759('0x44')](handleError(_0x212a4b,null));};exports[_0xd759('0x80')]=function(_0x31f665,_0x1eb4a4,_0x1edb4e){var _0x4c2b3b={'raw':!![],'where':{}};var _0x3d8989={};var _0x112fac={'count':0x0,'rows':[]};return db[_0xd759('0x2c')][_0xd759('0x58')]({'where':{'id':_0x31f665['params']['id']}})[_0xd759('0x23')](handleEntityNotFound(_0x1eb4a4,null))[_0xd759('0x23')](function(_0xb3dad6){if(_0xb3dad6){_0x3d8989[_0xd759('0x2e')]=_[_0xd759('0x47')](db[_0xd759('0x63')][_0xd759('0x2d')]);_0x3d8989[_0xd759('0x32')]=_[_0xd759('0x47')](_0x31f665[_0xd759('0x32')]);_0x3d8989[_0xd759('0x38')]=_['intersection'](_0x3d8989[_0xd759('0x2e')],_0x3d8989['query']);_0x4c2b3b[_0xd759('0x2f')]=_[_0xd759('0x30')](_0x3d8989[_0xd759('0x2e')],qs[_0xd759('0x31')](_0x31f665[_0xd759('0x32')]['fields']));_0x4c2b3b[_0xd759('0x2f')]=_0x4c2b3b[_0xd759('0x2f')]['length']?_0x4c2b3b[_0xd759('0x2f')]:_0x3d8989['model'];if(!_0x31f665[_0xd759('0x32')][_0xd759('0x34')]('nolimit')){_0x4c2b3b[_0xd759('0x1d')]=qs[_0xd759('0x1d')](_0x31f665[_0xd759('0x32')][_0xd759('0x1d')]);_0x4c2b3b['offset']=qs[_0xd759('0x36')](_0x31f665[_0xd759('0x32')][_0xd759('0x36')]);}_0x4c2b3b['order']=qs['sort'](_0x31f665[_0xd759('0x32')][_0xd759('0x37')]);_0x4c2b3b[_0xd759('0x3a')]=qs['filters'](_[_0xd759('0x39')](_0x31f665[_0xd759('0x32')],_0x3d8989[_0xd759('0x38')]));_0x4c2b3b[_0xd759('0x3a')][_0xd759('0x5b')]=_0xb3dad6['id'];if(_0x31f665['query'][_0xd759('0x5c')]){_0x4c2b3b['where']=_[_0xd759('0x3b')](_0x4c2b3b[_0xd759('0x3a')],{'$or':_[_0xd759('0x3c')](_0x4c2b3b[_0xd759('0x2f')],function(_0x5615c2){var _0x4406c8={};_0x4406c8[_0x5615c2]={'$like':'%'+_0x31f665[_0xd759('0x32')][_0xd759('0x5c')]+'%'};return _0x4406c8;})});}_0x4c2b3b=_[_0xd759('0x3b')]({},_0x4c2b3b,_0x31f665[_0xd759('0x40')]);return db[_0xd759('0x63')][_0xd759('0x1c')]({'where':_0x4c2b3b[_0xd759('0x3a')]})['then'](function(_0x4e2221){_0x112fac['count']=_0x4e2221;if(_0x31f665['query'][_0xd759('0x41')]){_0x4c2b3b['include']=[{'all':!![]}];}return db[_0xd759('0x63')]['findAll'](_0x4c2b3b);})[_0xd759('0x23')](function(_0x5a5e31){_0x112fac[_0xd759('0x43')]=_0x5a5e31;return _0x112fac;});}})['then'](respondWithFilteredResult(_0x1eb4a4,_0x4c2b3b))[_0xd759('0x44')](handleError(_0x1eb4a4,null));};exports[_0xd759('0x81')]=function(_0x1992d9,_0x28a8ab,_0x1a99f9){var _0x4caf0c,_0xce1004;return db['Campaign']['find']({'where':{'id':_0x1992d9['params']['id']}})[_0xd759('0x23')](handleEntityNotFound(_0x28a8ab,null))[_0xd759('0x23')](function(_0x49c4e9){if(_0x49c4e9){_0xce1004=_0x49c4e9;return _0x49c4e9[_0xd759('0x81')](_0x1992d9[_0xd759('0x4a')][_0xd759('0x65')],_[_0xd759('0x51')](_0x1992d9['body'],['ids','id'])||{});}return null;})[_0xd759('0x82')](function(_0x4c455a){var _0x2aa19f;_0x4caf0c=_0x4c455a||[];var _0x1d0164=[];if(_0x4c455a){for(var _0x3de432=0x0;_0x3de432<_0x4c455a[_0xd759('0x33')];_0x3de432+=0x1){var _0x46a7e3=_0x4c455a[_0x3de432][_0xd759('0x4b')]({'plain':!![]});_0x2aa19f=squel['insert']()['into'](_0xd759('0x83'))['fromQuery']([_0xd759('0x6b'),_0xd759('0x6d'),_0xd759('0x79'),'CampaignId',_0xd759('0x52'),_0xd759('0x53')],squel[_0xd759('0x6e')]()[_0xd759('0x3f')](_0xd759('0x6b'),_0xd759('0x6b'))['field']('id','ContactId')[_0xd759('0x3f')](_0x46a7e3[_0xd759('0x6f')]['toString'](),_0xd759('0x79'))[_0xd759('0x3f')](_0x1992d9[_0xd759('0x46')]['id'][_0xd759('0x70')](),'CampaignId')[_0xd759('0x3f')](_0xd759('0x71'),_0xd759('0x52'))[_0xd759('0x3f')](_0xd759('0x71'),_0xd759('0x53'))[_0xd759('0x72')](_0xd759('0x73'))[_0xd759('0x3a')](_0xd759('0x7b'))[_0xd759('0x3a')](_0xd759('0x74'),_0x46a7e3['CmListId'][_0xd759('0x70')]())[_0xd759('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0xd759('0x70')]();_0x1d0164['push'](db[_0xd759('0x7d')][_0xd759('0x32')](_0x2aa19f));}return BPromise[_0xd759('0x7e')](_0x1d0164);}})[_0xd759('0x23')](function(){return _0x4caf0c;})[_0xd759('0x23')](respondWithResult(_0x28a8ab,null))[_0xd759('0x44')](handleError(_0x28a8ab,null));};exports[_0xd759('0x84')]=function(_0x2df141,_0x31dd80,_0x40d982){return db[_0xd759('0x2c')][_0xd759('0x48')]({'where':{'id':_0x2df141[_0xd759('0x46')]['id']}})[_0xd759('0x23')](handleEntityNotFound(_0x31dd80,null))[_0xd759('0x23')](function(_0x20d587){if(_0x20d587){return _0x20d587[_0xd759('0x84')](_0x2df141['query'][_0xd759('0x65')]);}})[_0xd759('0x23')](function(_0x81836){if(_0x81836){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x2df141[_0xd759('0x32')][_0xd759('0x65')],'CampaignId':_0x2df141['params']['id']}})[_0xd759('0x23')](function(){return _0x81836;});}})[_0xd759('0x23')](respondWithStatusCode(_0x31dd80,null))[_0xd759('0x44')](handleError(_0x31dd80,null));}; \ No newline at end of file +var _0x267a=['fields','attributes','length','hasOwnProperty','limit','offset','order','sort','where','filter','map','type','key','VIRTUAL','merge','options','count','includeAll','findAll','catch','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','findOne','CmHopper','pick','CampaignId','rows','getHopperHistories','nolimit','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','into','push','sequelize','all','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','status','end','Content-Range','apply','reject','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name','index','Campaign','rawAttributes','keys','filters','intersection','model','query'];(function(_0x5ce5aa,_0x45f88a){var _0x177bc5=function(_0x3dd499){while(--_0x3dd499){_0x5ce5aa['push'](_0x5ce5aa['shift']());}};_0x177bc5(++_0x45f88a);}(_0x267a,0x1dd));var _0xa267=function(_0x3cafb8,_0x32860e){_0x3cafb8=_0x3cafb8-0x0;var _0x4b7f85=_0x267a[_0x3cafb8];return _0x4b7f85;};'use strict';var pdf=require(_0xa267('0x0'));var emlformat=require(_0xa267('0x1'));var rimraf=require(_0xa267('0x2'));var zipdir=require(_0xa267('0x3'));var jsonpatch=require(_0xa267('0x4'));var rp=require(_0xa267('0x5'));var moment=require(_0xa267('0x6'));var BPromise=require(_0xa267('0x7'));var Mustache=require(_0xa267('0x8'));var util=require(_0xa267('0x9'));var path=require(_0xa267('0xa'));var sox=require(_0xa267('0xb'));var csv=require('to-csv');var ejs=require(_0xa267('0xc'));var fs=require('fs');var _=require(_0xa267('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa267('0xe'));var deskjs=require(_0xa267('0xf'));var toCsv=require(_0xa267('0x10'));var querystring=require(_0xa267('0x11'));var Papa=require(_0xa267('0x12'));var Redis=require('ioredis');var authService=require(_0xa267('0x13'));var qs=require(_0xa267('0x14'));var hardwareService=require(_0xa267('0x15'));var logger=require('../../config/logger')(_0xa267('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xa267('0x17'))['db'];function respondWithStatusCode(_0x41bb79,_0xe9c4a2){_0xe9c4a2=_0xe9c4a2||0xcc;return function(_0x513ed6){if(_0x513ed6){return _0x41bb79['sendStatus'](_0xe9c4a2);}return _0x41bb79[_0xa267('0x18')](_0xe9c4a2)[_0xa267('0x19')]();};}function respondWithResult(_0x32d526,_0x39de73){_0x39de73=_0x39de73||0xc8;return function(_0x17087){if(_0x17087){return _0x32d526[_0xa267('0x18')](_0x39de73)['json'](_0x17087);}};}function respondWithFilteredResult(_0x5602e7,_0xf3c5e7){return function(_0x1ff750){if(_0x1ff750){var _0x1266aa=_0x1ff750['count'],_0xb6d2c8=_0xf3c5e7['offset'],_0x2fee44=_0xf3c5e7['offset']+_0xf3c5e7['limit'],_0x252f0c;if(_0x2fee44>=_0x1266aa){_0x2fee44=_0x1266aa;_0x252f0c=0xc8;}else{_0x252f0c=0xce;}_0x5602e7[_0xa267('0x18')](_0x252f0c);return _0x5602e7['set'](_0xa267('0x1a'),_0xb6d2c8+'-'+_0x2fee44+'/'+_0x1266aa)['json'](_0x1ff750);}return null;};}function patchUpdates(_0x1e58d7){return function(_0x11f088){try{jsonpatch[_0xa267('0x1b')](_0x11f088,_0x1e58d7,!![]);}catch(_0x35536e){return BPromise[_0xa267('0x1c')](_0x35536e);}return _0x11f088[_0xa267('0x1d')]();};}function saveUpdates(_0x3ae712,_0xb514e2){return function(_0x344d74){if(_0x344d74){return _0x344d74[_0xa267('0x1e')](_0x3ae712)[_0xa267('0x1f')](function(_0x69ac1b){return _0x69ac1b;});}return null;};}function removeEntity(_0x315390,_0x4bba0f){return function(_0x20730d){if(_0x20730d){return _0x20730d['destroy']()[_0xa267('0x1f')](function(){var _0x2d94f9=_0x20730d[_0xa267('0x20')]({'plain':!![]});var _0x201b23=_0xa267('0x21');return db[_0xa267('0x22')][_0xa267('0x23')]({'where':{'type':_0x201b23,'resourceId':_0x2d94f9['id']}})[_0xa267('0x1f')](function(){return _0x20730d;});})['then'](function(){_0x315390[_0xa267('0x18')](0xcc)[_0xa267('0x19')]();});}};}function handleEntityNotFound(_0x78f946,_0x11a504){return function(_0x3fd9b6){if(!_0x3fd9b6){_0x78f946['sendStatus'](0x194);}return _0x3fd9b6;};}function handleError(_0x2d16c3,_0x5f29f5){_0x5f29f5=_0x5f29f5||0x1f4;return function(_0xeeafd5){logger[_0xa267('0x24')](_0xeeafd5[_0xa267('0x25')]);if(_0xeeafd5[_0xa267('0x26')]){delete _0xeeafd5['name'];}_0x2d16c3[_0xa267('0x18')](_0x5f29f5)['send'](_0xeeafd5);};}exports[_0xa267('0x27')]=function(_0xa0feae,_0x534a0e){var _0x27107d={},_0x4dd717={},_0x39beee={'count':0x0,'rows':[]};var _0x548567=db[_0xa267('0x28')][_0xa267('0x29')];_0x4dd717['model']=_[_0xa267('0x2a')](_0x548567);_0x4dd717['query']=_[_0xa267('0x2a')](_0xa0feae['query']);_0x4dd717[_0xa267('0x2b')]=_[_0xa267('0x2c')](_0x4dd717[_0xa267('0x2d')],_0x4dd717[_0xa267('0x2e')]);_0x27107d['attributes']=_[_0xa267('0x2c')](_0x4dd717[_0xa267('0x2d')],qs[_0xa267('0x2f')](_0xa0feae[_0xa267('0x2e')][_0xa267('0x2f')]));_0x27107d[_0xa267('0x30')]=_0x27107d[_0xa267('0x30')][_0xa267('0x31')]?_0x27107d[_0xa267('0x30')]:_0x4dd717[_0xa267('0x2d')];if(!_0xa0feae[_0xa267('0x2e')][_0xa267('0x32')]('nolimit')){_0x27107d[_0xa267('0x33')]=qs[_0xa267('0x33')](_0xa0feae[_0xa267('0x2e')][_0xa267('0x33')]);_0x27107d[_0xa267('0x34')]=qs[_0xa267('0x34')](_0xa0feae['query'][_0xa267('0x34')]);}_0x27107d[_0xa267('0x35')]=qs[_0xa267('0x36')](_0xa0feae[_0xa267('0x2e')]['sort']);_0x27107d[_0xa267('0x37')]=qs[_0xa267('0x2b')](_['pick'](_0xa0feae[_0xa267('0x2e')],_0x4dd717[_0xa267('0x2b')]));if(_0xa0feae[_0xa267('0x2e')][_0xa267('0x38')]){_0x27107d[_0xa267('0x37')]=_['merge'](_0x27107d[_0xa267('0x37')],{'$or':_[_0xa267('0x39')](_0x548567,function(_0x3b347b){if(_0x3b347b[_0xa267('0x3a')][_0xa267('0x3b')]!==_0xa267('0x3c')){var _0x55155f={};_0x55155f[_0x3b347b['field']]={'$like':'%'+_0xa0feae[_0xa267('0x2e')][_0xa267('0x38')]+'%'};return _0x55155f;}})});}_0x27107d=_[_0xa267('0x3d')]({},_0x27107d,_0xa0feae[_0xa267('0x3e')]);var _0x18c9ea={'where':_0x27107d[_0xa267('0x37')]};return db[_0xa267('0x28')][_0xa267('0x3f')](_0x18c9ea)[_0xa267('0x1f')](function(_0x236bc4){_0x39beee[_0xa267('0x3f')]=_0x236bc4;if(_0xa0feae[_0xa267('0x2e')][_0xa267('0x40')]){_0x27107d['include']=[{'all':!![]}];}return db[_0xa267('0x28')][_0xa267('0x41')](_0x27107d);})['then'](function(_0x19a0f7){_0x39beee['rows']=_0x19a0f7;return _0x39beee;})[_0xa267('0x1f')](respondWithFilteredResult(_0x534a0e,_0x27107d))[_0xa267('0x42')](handleError(_0x534a0e,null));};exports['show']=function(_0x2ceef0,_0x4e8733){var _0x22ae0f={'raw':![],'where':{'id':_0x2ceef0[_0xa267('0x43')]['id']}},_0x196146={};_0x196146['model']=_[_0xa267('0x2a')](db['Campaign']['rawAttributes']);_0x196146[_0xa267('0x2e')]=_[_0xa267('0x2a')](_0x2ceef0[_0xa267('0x2e')]);_0x196146['filters']=_[_0xa267('0x2c')](_0x196146[_0xa267('0x2d')],_0x196146[_0xa267('0x2e')]);_0x22ae0f[_0xa267('0x30')]=_['intersection'](_0x196146[_0xa267('0x2d')],qs['fields'](_0x2ceef0['query'][_0xa267('0x2f')]));_0x22ae0f[_0xa267('0x30')]=_0x22ae0f[_0xa267('0x30')][_0xa267('0x31')]?_0x22ae0f[_0xa267('0x30')]:_0x196146[_0xa267('0x2d')];if(_0x2ceef0[_0xa267('0x2e')][_0xa267('0x40')]){_0x22ae0f[_0xa267('0x44')]=[{'all':!![]}];}_0x22ae0f=_[_0xa267('0x3d')]({},_0x22ae0f,_0x2ceef0['options']);return db[_0xa267('0x28')][_0xa267('0x45')](_0x22ae0f)[_0xa267('0x1f')](handleEntityNotFound(_0x4e8733,null))[_0xa267('0x1f')](respondWithResult(_0x4e8733,null))['catch'](handleError(_0x4e8733,null));};exports[_0xa267('0x46')]=function(_0x3a2e35,_0x3b2720){return db['Campaign'][_0xa267('0x46')](_0x3a2e35[_0xa267('0x47')],{})[_0xa267('0x1f')](function(_0x38b9f0){var _0x14f22d=_0x3a2e35[_0xa267('0x48')][_0xa267('0x20')]({'plain':!![]});if(!_0x14f22d)throw new Error(_0xa267('0x49'));if(_0x14f22d[_0xa267('0x4a')]===_0xa267('0x48')){var _0x2cc402=_0x38b9f0[_0xa267('0x20')]({'plain':!![]});var _0x5cfaf5=_0xa267('0x21');return db[_0xa267('0x4b')][_0xa267('0x45')]({'where':{'name':_0x5cfaf5,'userProfileId':_0x14f22d[_0xa267('0x4c')]},'raw':!![]})['then'](function(_0x33edff){if(_0x33edff&&_0x33edff[_0xa267('0x4d')]===0x0){return db[_0xa267('0x22')][_0xa267('0x46')]({'name':_0x2cc402[_0xa267('0x26')],'resourceId':_0x2cc402['id'],'type':_0x33edff[_0xa267('0x26')],'sectionId':_0x33edff['id']},{})[_0xa267('0x1f')](function(){return _0x38b9f0;});}else{return _0x38b9f0;}})[_0xa267('0x42')](function(_0x3e09a4){logger['error'](_0xa267('0x4e'),_0x3e09a4);throw _0x3e09a4;});}return _0x38b9f0;})['then'](respondWithResult(_0x3b2720,0xc9))[_0xa267('0x42')](handleError(_0x3b2720,null));};exports[_0xa267('0x4f')]=function(_0x2da9d5,_0x2a0c16){var _0x1d18f0={'raw':![],'where':{'id':_0x2da9d5[_0xa267('0x43')]['id']}},_0x24fea4={};_0x24fea4[_0xa267('0x2d')]=_['keys'](db[_0xa267('0x28')]['rawAttributes']);_0x1d18f0[_0xa267('0x30')]=_[_0xa267('0x2c')](_0x24fea4['model'],qs['fields'](_0x2da9d5[_0xa267('0x2e')][_0xa267('0x2f')]));_0x1d18f0['attributes']=_0x1d18f0[_0xa267('0x30')][_0xa267('0x31')]?_0x1d18f0[_0xa267('0x30')]:_0x24fea4[_0xa267('0x2d')];if(_0x2da9d5[_0xa267('0x2e')][_0xa267('0x40')]){_0x1d18f0[_0xa267('0x44')]=[{'all':!![]}];}_0x1d18f0=_[_0xa267('0x3d')]({},_0x1d18f0,_0x2da9d5[_0xa267('0x3e')]);return db[_0xa267('0x28')][_0xa267('0x45')](_0x1d18f0)[_0xa267('0x1f')](handleEntityNotFound(_0x2a0c16,null))[_0xa267('0x1f')](function(_0x1d9665){if(_0x1d9665){var _0x5500a6=_0x1d9665[_0xa267('0x20')]({'plain':!![]});_0x5500a6=qs[_0xa267('0x50')](_0x5500a6,['id',_0xa267('0x51'),_0xa267('0x52')]);_0x2da9d5[_0xa267('0x47')]=_[_0xa267('0x50')](_0x2da9d5[_0xa267('0x47')],['id',_0xa267('0x51'),'updatedAt']);return db['Campaign'][_0xa267('0x46')](_[_0xa267('0x3d')](_0x5500a6,_0x2da9d5[_0xa267('0x47')]),{'include':_0x2da9d5[_0xa267('0x2e')][_0xa267('0x40')]?[{'all':!![]}]:undefined})[_0xa267('0x1f')](function(_0x30f262){var _0x47db2f=_0x2da9d5[_0xa267('0x48')][_0xa267('0x20')]({'plain':!![]});if(!_0x47db2f)throw new Error(_0xa267('0x49'));if(_0x47db2f[_0xa267('0x4a')]===_0xa267('0x48')){var _0x477cc2=_0x30f262[_0xa267('0x20')]({'plain':!![]});var _0x2a9a8b=_0xa267('0x21');return db['UserProfileSection'][_0xa267('0x45')]({'where':{'name':_0x2a9a8b,'userProfileId':_0x47db2f['userProfileId']},'raw':!![]})['then'](function(_0x45d5a6){if(_0x45d5a6&&_0x45d5a6[_0xa267('0x4d')]===0x0){return db[_0xa267('0x22')][_0xa267('0x46')]({'name':_0x477cc2[_0xa267('0x26')],'resourceId':_0x477cc2['id'],'type':_0x45d5a6[_0xa267('0x26')],'sectionId':_0x45d5a6['id']},{})[_0xa267('0x1f')](function(){return _0x30f262;});}else{return _0x30f262;}})[_0xa267('0x42')](function(_0x2a64bb){logger[_0xa267('0x24')](_0xa267('0x4e'),_0x2a64bb);throw _0x2a64bb;});}return _0x30f262;});}})[_0xa267('0x1f')](respondWithResult(_0x2a0c16,0xc9))[_0xa267('0x42')](handleError(_0x2a0c16,null));};exports[_0xa267('0x1e')]=function(_0x217a76,_0x39f088){if(_0x217a76['body']['id']){delete _0x217a76['body']['id'];}return db[_0xa267('0x28')][_0xa267('0x45')]({'where':{'id':_0x217a76['params']['id']}})['then'](handleEntityNotFound(_0x39f088,null))['then'](saveUpdates(_0x217a76[_0xa267('0x47')],null))[_0xa267('0x1f')](respondWithResult(_0x39f088,null))[_0xa267('0x42')](handleError(_0x39f088,null));};exports[_0xa267('0x23')]=function(_0x7459fb,_0x485c93){return db['Campaign'][_0xa267('0x45')]({'where':{'id':_0x7459fb['params']['id']}})[_0xa267('0x1f')](handleEntityNotFound(_0x485c93,null))[_0xa267('0x1f')](removeEntity(_0x485c93,null))[_0xa267('0x42')](handleError(_0x485c93,null));};exports['getHoppers']=function(_0x32a207,_0x341bd1,_0x3b06d3){var _0x4abaed={'raw':!![],'where':{}};var _0x4a7077={};var _0x5bc2e1={'count':0x0,'rows':[]};return db[_0xa267('0x28')][_0xa267('0x53')]({'where':{'id':_0x32a207[_0xa267('0x43')]['id']}})['then'](handleEntityNotFound(_0x341bd1,null))[_0xa267('0x1f')](function(_0x361d18){if(_0x361d18){_0x4a7077['model']=_[_0xa267('0x2a')](db[_0xa267('0x54')][_0xa267('0x29')]);_0x4a7077['query']=_[_0xa267('0x2a')](_0x32a207['query']);_0x4a7077['filters']=_['intersection'](_0x4a7077[_0xa267('0x2d')],_0x4a7077[_0xa267('0x2e')]);_0x4abaed[_0xa267('0x30')]=_['intersection'](_0x4a7077[_0xa267('0x2d')],qs[_0xa267('0x2f')](_0x32a207[_0xa267('0x2e')][_0xa267('0x2f')]));_0x4abaed[_0xa267('0x30')]=_0x4abaed[_0xa267('0x30')][_0xa267('0x31')]?_0x4abaed[_0xa267('0x30')]:_0x4a7077[_0xa267('0x2d')];if(!_0x32a207[_0xa267('0x2e')][_0xa267('0x32')]('nolimit')){_0x4abaed[_0xa267('0x33')]=qs[_0xa267('0x33')](_0x32a207[_0xa267('0x2e')]['limit']);_0x4abaed[_0xa267('0x34')]=qs[_0xa267('0x34')](_0x32a207[_0xa267('0x2e')][_0xa267('0x34')]);}_0x4abaed[_0xa267('0x35')]=qs['sort'](_0x32a207[_0xa267('0x2e')]['sort']);_0x4abaed[_0xa267('0x37')]=qs[_0xa267('0x2b')](_[_0xa267('0x55')](_0x32a207['query'],_0x4a7077[_0xa267('0x2b')]));_0x4abaed[_0xa267('0x37')][_0xa267('0x56')]=_0x361d18['id'];if(_0x32a207[_0xa267('0x2e')][_0xa267('0x38')]){_0x4abaed[_0xa267('0x37')]=_[_0xa267('0x3d')](_0x4abaed[_0xa267('0x37')],{'$or':_[_0xa267('0x39')](_0x4abaed[_0xa267('0x30')],function(_0x29f1ee){var _0x47f34b={};_0x47f34b[_0x29f1ee]={'$like':'%'+_0x32a207[_0xa267('0x2e')]['filter']+'%'};return _0x47f34b;})});}_0x4abaed=_[_0xa267('0x3d')]({},_0x4abaed,_0x32a207[_0xa267('0x3e')]);return db[_0xa267('0x54')]['count']({'where':_0x4abaed[_0xa267('0x37')]})[_0xa267('0x1f')](function(_0x266fd6){_0x5bc2e1[_0xa267('0x3f')]=_0x266fd6;if(_0x32a207[_0xa267('0x2e')][_0xa267('0x40')]){_0x4abaed[_0xa267('0x44')]=[{'all':!![]}];}return db['CmHopper'][_0xa267('0x41')](_0x4abaed);})[_0xa267('0x1f')](function(_0xe6b8aa){_0x5bc2e1[_0xa267('0x57')]=_0xe6b8aa;return _0x5bc2e1;});}})[_0xa267('0x1f')](respondWithFilteredResult(_0x341bd1,_0x4abaed))[_0xa267('0x42')](handleError(_0x341bd1,null));};exports[_0xa267('0x58')]=function(_0x317583,_0x4a41de,_0x53675a){var _0x272154={'raw':!![],'where':{}};var _0x2ea917={};var _0x188267={'count':0x0,'rows':[]};return db[_0xa267('0x28')][_0xa267('0x53')]({'where':{'id':_0x317583[_0xa267('0x43')]['id']}})[_0xa267('0x1f')](handleEntityNotFound(_0x4a41de,null))[_0xa267('0x1f')](function(_0x1be837){if(_0x1be837){_0x2ea917[_0xa267('0x2d')]=_[_0xa267('0x2a')](db['CmHopperHistory'][_0xa267('0x29')]);_0x2ea917['query']=_[_0xa267('0x2a')](_0x317583[_0xa267('0x2e')]);_0x2ea917[_0xa267('0x2b')]=_[_0xa267('0x2c')](_0x2ea917[_0xa267('0x2d')],_0x2ea917[_0xa267('0x2e')]);_0x272154['attributes']=_[_0xa267('0x2c')](_0x2ea917[_0xa267('0x2d')],qs['fields'](_0x317583[_0xa267('0x2e')][_0xa267('0x2f')]));_0x272154['attributes']=_0x272154[_0xa267('0x30')]['length']?_0x272154[_0xa267('0x30')]:_0x2ea917[_0xa267('0x2d')];if(!_0x317583['query'][_0xa267('0x32')](_0xa267('0x59'))){_0x272154['limit']=qs[_0xa267('0x33')](_0x317583['query'][_0xa267('0x33')]);_0x272154[_0xa267('0x34')]=qs[_0xa267('0x34')](_0x317583[_0xa267('0x2e')][_0xa267('0x34')]);}_0x272154[_0xa267('0x35')]=qs['sort'](_0x317583[_0xa267('0x2e')][_0xa267('0x36')]);_0x272154['where']=qs[_0xa267('0x2b')](_['pick'](_0x317583[_0xa267('0x2e')],_0x2ea917[_0xa267('0x2b')]));_0x272154[_0xa267('0x37')][_0xa267('0x56')]=_0x1be837['id'];if(_0x317583[_0xa267('0x2e')][_0xa267('0x38')]){_0x272154[_0xa267('0x37')]=_[_0xa267('0x3d')](_0x272154[_0xa267('0x37')],{'$or':_[_0xa267('0x39')](_0x272154[_0xa267('0x30')],function(_0x186477){var _0x4e5652={};_0x4e5652[_0x186477]={'$like':'%'+_0x317583['query'][_0xa267('0x38')]+'%'};return _0x4e5652;})});}_0x272154=_[_0xa267('0x3d')]({},_0x272154,_0x317583['options']);return db[_0xa267('0x5a')]['count']({'where':_0x272154[_0xa267('0x37')]})[_0xa267('0x1f')](function(_0x35bbe6){_0x188267[_0xa267('0x3f')]=_0x35bbe6;if(_0x317583['query'][_0xa267('0x40')]){_0x272154[_0xa267('0x44')]=[{'all':!![]}];}return db[_0xa267('0x5a')]['findAll'](_0x272154);})['then'](function(_0x223765){_0x188267[_0xa267('0x57')]=_0x223765;return _0x188267;});}})[_0xa267('0x1f')](respondWithFilteredResult(_0x4a41de,_0x272154))[_0xa267('0x42')](handleError(_0x4a41de,null));};exports[_0xa267('0x5b')]=function(_0x32019a,_0x3ecae3,_0x4f465d){var _0x5319fa={'raw':!![],'where':{}};var _0x16bb04={};var _0x40833d={'count':0x0,'rows':[]};return db[_0xa267('0x28')][_0xa267('0x53')]({'where':{'id':_0x32019a[_0xa267('0x43')]['id']}})[_0xa267('0x1f')](handleEntityNotFound(_0x3ecae3,null))[_0xa267('0x1f')](function(_0x4d494c){if(_0x4d494c){_0x16bb04[_0xa267('0x2d')]=_[_0xa267('0x2a')](db[_0xa267('0x5c')][_0xa267('0x29')]);_0x16bb04[_0xa267('0x2e')]=_['keys'](_0x32019a[_0xa267('0x2e')]);_0x16bb04[_0xa267('0x2b')]=_[_0xa267('0x2c')](_0x16bb04['model'],_0x16bb04[_0xa267('0x2e')]);_0x5319fa[_0xa267('0x30')]=_['intersection'](_0x16bb04[_0xa267('0x2d')],qs['fields'](_0x32019a[_0xa267('0x2e')][_0xa267('0x2f')]));_0x5319fa[_0xa267('0x30')]=_0x5319fa[_0xa267('0x30')][_0xa267('0x31')]?_0x5319fa[_0xa267('0x30')]:_0x16bb04[_0xa267('0x2d')];if(!_0x32019a[_0xa267('0x2e')][_0xa267('0x32')](_0xa267('0x59'))){_0x5319fa[_0xa267('0x33')]=qs[_0xa267('0x33')](_0x32019a[_0xa267('0x2e')][_0xa267('0x33')]);_0x5319fa[_0xa267('0x34')]=qs[_0xa267('0x34')](_0x32019a[_0xa267('0x2e')]['offset']);}_0x5319fa['order']=qs[_0xa267('0x36')](_0x32019a[_0xa267('0x2e')][_0xa267('0x36')]);_0x5319fa[_0xa267('0x37')]=qs[_0xa267('0x2b')](_[_0xa267('0x55')](_0x32019a[_0xa267('0x2e')],_0x16bb04['filters']));_0x5319fa[_0xa267('0x37')]['CampaignId']=_0x4d494c['id'];if(_0x32019a[_0xa267('0x2e')][_0xa267('0x38')]){_0x5319fa[_0xa267('0x37')]=_[_0xa267('0x3d')](_0x5319fa[_0xa267('0x37')],{'$or':_[_0xa267('0x39')](_0x5319fa[_0xa267('0x30')],function(_0x528d37){var _0x47c438={};_0x47c438[_0x528d37]={'$like':'%'+_0x32019a[_0xa267('0x2e')][_0xa267('0x38')]+'%'};return _0x47c438;})});}_0x5319fa=_[_0xa267('0x3d')]({},_0x5319fa,_0x32019a[_0xa267('0x3e')]);return db['CmHopperFinal']['count']({'where':_0x5319fa[_0xa267('0x37')]})[_0xa267('0x1f')](function(_0x5351be){_0x40833d['count']=_0x5351be;if(_0x32019a[_0xa267('0x2e')]['includeAll']){_0x5319fa[_0xa267('0x44')]=[{'all':!![]}];}return db[_0xa267('0x5c')][_0xa267('0x41')](_0x5319fa);})[_0xa267('0x1f')](function(_0x58daa8){_0x40833d['rows']=_0x58daa8;return _0x40833d;});}})[_0xa267('0x1f')](respondWithFilteredResult(_0x3ecae3,_0x5319fa))[_0xa267('0x42')](handleError(_0x3ecae3,null));};exports[_0xa267('0x5d')]=function(_0x2d0435,_0x41a997,_0x2f84e5){var _0x405511={'raw':!![],'where':{}};var _0x285f9b={};var _0x5f53ce={'count':0x0,'rows':[]};return db[_0xa267('0x28')][_0xa267('0x53')]({'where':{'id':_0x2d0435[_0xa267('0x43')]['id']}})['then'](handleEntityNotFound(_0x41a997,null))['then'](function(_0x2f7d16){if(_0x2f7d16){_0x285f9b['model']=_[_0xa267('0x2a')](db[_0xa267('0x5e')][_0xa267('0x29')]);_0x285f9b[_0xa267('0x2e')]=_[_0xa267('0x2a')](_0x2d0435[_0xa267('0x2e')]);_0x285f9b['filters']=_[_0xa267('0x2c')](_0x285f9b[_0xa267('0x2d')],_0x285f9b['query']);_0x405511['attributes']=_[_0xa267('0x2c')](_0x285f9b[_0xa267('0x2d')],qs[_0xa267('0x2f')](_0x2d0435['query']['fields']));_0x405511[_0xa267('0x30')]=_0x405511[_0xa267('0x30')]['length']?_0x405511[_0xa267('0x30')]:_0x285f9b['model'];if(!_0x2d0435[_0xa267('0x2e')][_0xa267('0x32')]('nolimit')){_0x405511[_0xa267('0x33')]=qs[_0xa267('0x33')](_0x2d0435[_0xa267('0x2e')][_0xa267('0x33')]);_0x405511[_0xa267('0x34')]=qs[_0xa267('0x34')](_0x2d0435[_0xa267('0x2e')][_0xa267('0x34')]);}_0x405511[_0xa267('0x35')]=qs[_0xa267('0x36')](_0x2d0435[_0xa267('0x2e')][_0xa267('0x36')]);_0x405511[_0xa267('0x37')]=qs[_0xa267('0x2b')](_[_0xa267('0x55')](_0x2d0435[_0xa267('0x2e')],_0x285f9b[_0xa267('0x2b')]));_0x405511[_0xa267('0x37')]['CampaignId']=_0x2f7d16['id'];if(_0x2d0435[_0xa267('0x2e')][_0xa267('0x38')]){_0x405511[_0xa267('0x37')]=_[_0xa267('0x3d')](_0x405511[_0xa267('0x37')],{'$or':_[_0xa267('0x39')](_0x405511[_0xa267('0x30')],function(_0xa6744e){var _0x2dab0b={};_0x2dab0b[_0xa6744e]={'$like':'%'+_0x2d0435[_0xa267('0x2e')]['filter']+'%'};return _0x2dab0b;})});}_0x405511=_[_0xa267('0x3d')]({},_0x405511,_0x2d0435[_0xa267('0x3e')]);return db[_0xa267('0x5e')][_0xa267('0x3f')]({'where':_0x405511['where']})[_0xa267('0x1f')](function(_0x3b39e3){_0x5f53ce['count']=_0x3b39e3;if(_0x2d0435[_0xa267('0x2e')]['includeAll']){_0x405511['include']=[{'all':!![]}];}return db[_0xa267('0x5e')][_0xa267('0x41')](_0x405511);})['then'](function(_0x5584c8){_0x5f53ce[_0xa267('0x57')]=_0x5584c8;return _0x5f53ce;});}})[_0xa267('0x1f')](respondWithFilteredResult(_0x41a997,_0x405511))[_0xa267('0x42')](handleError(_0x41a997,null));};exports[_0xa267('0x5f')]=function(_0x950a1b,_0x17b7c2,_0x156be0){var _0xc08f0={};var _0x32508e={};var _0x1bd3ea;var _0x210b71;return db['Campaign'][_0xa267('0x53')]({'where':{'id':_0x950a1b['params']['id']}})[_0xa267('0x1f')](handleEntityNotFound(_0x17b7c2,null))['then'](function(_0x2ea027){if(_0x2ea027){_0x1bd3ea=_0x2ea027;_0x32508e['model']=_[_0xa267('0x2a')](db[_0xa267('0x60')][_0xa267('0x29')]);_0x32508e[_0xa267('0x2e')]=_['keys'](_0x950a1b[_0xa267('0x2e')]);_0x32508e[_0xa267('0x2b')]=_[_0xa267('0x2c')](_0x32508e['model'],_0x32508e[_0xa267('0x2e')]);_0xc08f0[_0xa267('0x30')]=_[_0xa267('0x2c')](_0x32508e[_0xa267('0x2d')],qs[_0xa267('0x2f')](_0x950a1b[_0xa267('0x2e')][_0xa267('0x2f')]));_0xc08f0['attributes']=_0xc08f0[_0xa267('0x30')][_0xa267('0x31')]?_0xc08f0[_0xa267('0x30')]:_0x32508e[_0xa267('0x2d')];_0xc08f0[_0xa267('0x35')]=qs[_0xa267('0x36')](_0x950a1b[_0xa267('0x2e')]['sort']);_0xc08f0[_0xa267('0x37')]=qs[_0xa267('0x2b')](_['pick'](_0x950a1b['query'],_0x32508e['filters']));if(_0x950a1b[_0xa267('0x2e')]['filter']){_0xc08f0[_0xa267('0x37')]=_['merge'](_0xc08f0['where'],{'$or':_[_0xa267('0x39')](_0xc08f0[_0xa267('0x30')],function(_0x120892){var _0x47ea={};_0x47ea[_0x120892]={'$like':'%'+_0x950a1b[_0xa267('0x2e')][_0xa267('0x38')]+'%'};return _0x47ea;})});}_0xc08f0=_[_0xa267('0x3d')]({},_0xc08f0,_0x950a1b[_0xa267('0x3e')]);return _0x1bd3ea[_0xa267('0x5f')](_0xc08f0);}})[_0xa267('0x1f')](function(_0x3a0f37){if(_0x3a0f37){_0x210b71=_0x3a0f37[_0xa267('0x31')];if(!_0x950a1b[_0xa267('0x2e')][_0xa267('0x32')](_0xa267('0x59'))){_0xc08f0[_0xa267('0x33')]=qs[_0xa267('0x33')](_0x950a1b[_0xa267('0x2e')][_0xa267('0x33')]);_0xc08f0[_0xa267('0x34')]=qs[_0xa267('0x34')](_0x950a1b['query'][_0xa267('0x34')]);}return _0x1bd3ea[_0xa267('0x5f')](_0xc08f0);}})[_0xa267('0x1f')](function(_0x4def50){if(_0x4def50){return _0x4def50?{'count':_0x210b71,'rows':_0x4def50}:null;}})[_0xa267('0x1f')](respondWithResult(_0x17b7c2,null))['catch'](handleError(_0x17b7c2,null));};exports['addLists']=function(_0x11c989,_0x3314ff,_0xc39610){var _0x5e9430,_0x54b14f;return db['Campaign'][_0xa267('0x45')]({'where':{'id':_0x11c989['params']['id']}})[_0xa267('0x1f')](handleEntityNotFound(_0x3314ff,null))[_0xa267('0x1f')](function(_0x1c2674){if(_0x1c2674){_0x54b14f=_0x1c2674;return _0x1c2674[_0xa267('0x61')](_0x11c989[_0xa267('0x47')][_0xa267('0x62')],_['omit'](_0x11c989[_0xa267('0x47')],[_0xa267('0x62'),'id'])||{});}return null;})[_0xa267('0x63')](function(_0x15d448){var _0x2e7fcf;_0x5e9430=_0x15d448||[];var _0x508cdf=[];if(_0x15d448){for(var _0x798b65=0x0;_0x798b65<_0x15d448[_0xa267('0x31')];_0x798b65+=0x1){var _0x625ed3=_0x15d448[_0x798b65]['get']({'plain':!![]});_0x54b14f[_0xa267('0x64')]=_0x11c989[_0xa267('0x47')][_0xa267('0x64')]?_0x11c989[_0xa267('0x47')]['dialCheckDuplicateType']:_0x54b14f[_0xa267('0x64')];switch(_0x54b14f[_0xa267('0x64')]){case _0xa267('0x65'):_0x2e7fcf=squel[_0xa267('0x66')]()['into'](_0xa267('0x67'))[_0xa267('0x68')]([_0xa267('0x69'),_0xa267('0x6a'),_0xa267('0x6b'),_0xa267('0x6c'),_0xa267('0x56'),_0xa267('0x51'),_0xa267('0x52')],squel[_0xa267('0x6d')]()[_0xa267('0x6e')](_0xa267('0x69'),_0xa267('0x69'))[_0xa267('0x6e')](_0xa267('0x6f'),_0xa267('0x6a'))[_0xa267('0x6e')]('id',_0xa267('0x6b'))[_0xa267('0x6e')](_0x625ed3['CmListId'][_0xa267('0x70')](),_0xa267('0x6c'))[_0xa267('0x6e')](_0x11c989[_0xa267('0x43')]['id'][_0xa267('0x70')](),_0xa267('0x56'))[_0xa267('0x6e')](_0xa267('0x6f'),_0xa267('0x51'))[_0xa267('0x6e')](_0xa267('0x6f'),_0xa267('0x52'))[_0xa267('0x71')](_0xa267('0x72'))[_0xa267('0x37')](_0xa267('0x73'))[_0xa267('0x37')](_0xa267('0x74'),_0x625ed3[_0xa267('0x75')]['toString']())['where'](_0xa267('0x76'))['where'](_0xa267('0x77'),squel[_0xa267('0x6d')]()[_0xa267('0x6e')](_0xa267('0x78'))[_0xa267('0x71')](_0xa267('0x79'))['where'](_0xa267('0x7a'),_0x11c989['params']['id'][_0xa267('0x70')]()))[_0xa267('0x37')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa267('0x6d')]()[_0xa267('0x6e')](_0xa267('0x7b'))[_0xa267('0x71')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0x11c989[_0xa267('0x43')]['id']['toString']())))['toString']();break;case'onlyIfOpen':_0x2e7fcf=squel[_0xa267('0x66')]()[_0xa267('0x7c')](_0xa267('0x67'))[_0xa267('0x68')]([_0xa267('0x69'),_0xa267('0x6a'),_0xa267('0x6b'),'ListId',_0xa267('0x56'),_0xa267('0x51'),_0xa267('0x52')],squel[_0xa267('0x6d')]()[_0xa267('0x6e')](_0xa267('0x69'),_0xa267('0x69'))[_0xa267('0x6e')](_0xa267('0x6f'),'scheduledAt')['field']('id','ContactId')['field'](_0x625ed3[_0xa267('0x75')][_0xa267('0x70')](),'ListId')[_0xa267('0x6e')](_0x11c989[_0xa267('0x43')]['id'][_0xa267('0x70')](),'CampaignId')['field'](_0xa267('0x6f'),_0xa267('0x51'))[_0xa267('0x6e')]('NOW()',_0xa267('0x52'))[_0xa267('0x71')]('cm_contacts')[_0xa267('0x37')](_0xa267('0x73'))[_0xa267('0x37')](_0xa267('0x74'),_0x625ed3[_0xa267('0x75')][_0xa267('0x70')]())[_0xa267('0x37')](_0xa267('0x76'))[_0xa267('0x37')](_0xa267('0x77'),squel['select']()['field'](_0xa267('0x7b'))['from']('cm_hopper')[_0xa267('0x37')](_0xa267('0x7a'),_0x11c989['params']['id'][_0xa267('0x70')]())))[_0xa267('0x70')]();break;default:_0x2e7fcf=squel[_0xa267('0x66')]()['into'](_0xa267('0x67'))['fromQuery']([_0xa267('0x69'),_0xa267('0x6a'),_0xa267('0x6b'),_0xa267('0x6c'),'CampaignId',_0xa267('0x51'),_0xa267('0x52')],squel[_0xa267('0x6d')]()[_0xa267('0x6e')](_0xa267('0x69'),_0xa267('0x69'))[_0xa267('0x6e')]('NOW()','scheduledAt')[_0xa267('0x6e')]('id','ContactId')[_0xa267('0x6e')](_0x625ed3[_0xa267('0x75')][_0xa267('0x70')](),_0xa267('0x6c'))[_0xa267('0x6e')](_0x11c989[_0xa267('0x43')]['id'][_0xa267('0x70')](),_0xa267('0x56'))[_0xa267('0x6e')](_0xa267('0x6f'),_0xa267('0x51'))[_0xa267('0x6e')](_0xa267('0x6f'),_0xa267('0x52'))[_0xa267('0x71')](_0xa267('0x72'))[_0xa267('0x37')](_0xa267('0x73'))['where'](_0xa267('0x74'),_0x625ed3[_0xa267('0x75')][_0xa267('0x70')]())[_0xa267('0x37')](_0xa267('0x76')))[_0xa267('0x70')]();}_0x508cdf[_0xa267('0x7d')](db[_0xa267('0x7e')][_0xa267('0x2e')](_0x2e7fcf));}return BPromise[_0xa267('0x7f')](_0x508cdf);}})[_0xa267('0x1f')](function(){return _0x5e9430;})[_0xa267('0x1f')](respondWithResult(_0x3314ff,null))[_0xa267('0x42')](handleError(_0x3314ff,null));};exports['removeLists']=function(_0x55e568,_0x54cf0b,_0x50c3bd){return db[_0xa267('0x28')]['find']({'where':{'id':_0x55e568[_0xa267('0x43')]['id']}})['then'](handleEntityNotFound(_0x54cf0b,null))[_0xa267('0x1f')](function(_0x5564bc){if(_0x5564bc){return _0x5564bc['removeLists'](_0x55e568[_0xa267('0x2e')][_0xa267('0x62')]);}})[_0xa267('0x1f')](function(_0x439b54){if(_0x439b54){return db[_0xa267('0x54')]['destroy']({'where':{'ListId':_0x55e568[_0xa267('0x2e')][_0xa267('0x62')],'CampaignId':_0x55e568['params']['id']}})['then'](function(){return _0x439b54;});}})[_0xa267('0x1f')](respondWithStatusCode(_0x54cf0b,null))[_0xa267('0x42')](handleError(_0x54cf0b,null));};exports['getBlackLists']=function(_0x5a2010,_0x203464,_0xa9b26a){var _0x1653dc={'raw':!![],'where':{}};var _0x57ab7e={};var _0x5e9b72={'count':0x0,'rows':[]};return db[_0xa267('0x28')][_0xa267('0x53')]({'where':{'id':_0x5a2010[_0xa267('0x43')]['id']}})[_0xa267('0x1f')](handleEntityNotFound(_0x203464,null))[_0xa267('0x1f')](function(_0xbbf100){if(_0xbbf100){_0x57ab7e[_0xa267('0x2d')]=_['keys'](db[_0xa267('0x60')][_0xa267('0x29')]);_0x57ab7e[_0xa267('0x2e')]=_[_0xa267('0x2a')](_0x5a2010['query']);_0x57ab7e['filters']=_[_0xa267('0x2c')](_0x57ab7e['model'],_0x57ab7e[_0xa267('0x2e')]);_0x1653dc[_0xa267('0x30')]=_[_0xa267('0x2c')](_0x57ab7e[_0xa267('0x2d')],qs[_0xa267('0x2f')](_0x5a2010['query'][_0xa267('0x2f')]));_0x1653dc[_0xa267('0x30')]=_0x1653dc[_0xa267('0x30')][_0xa267('0x31')]?_0x1653dc[_0xa267('0x30')]:_0x57ab7e[_0xa267('0x2d')];if(!_0x5a2010[_0xa267('0x2e')][_0xa267('0x32')](_0xa267('0x59'))){_0x1653dc[_0xa267('0x33')]=qs[_0xa267('0x33')](_0x5a2010[_0xa267('0x2e')][_0xa267('0x33')]);_0x1653dc[_0xa267('0x34')]=qs['offset'](_0x5a2010[_0xa267('0x2e')][_0xa267('0x34')]);}_0x1653dc[_0xa267('0x35')]=qs[_0xa267('0x36')](_0x5a2010[_0xa267('0x2e')][_0xa267('0x36')]);_0x1653dc[_0xa267('0x37')]=qs[_0xa267('0x2b')](_[_0xa267('0x55')](_0x5a2010['query'],_0x57ab7e[_0xa267('0x2b')]));_0x1653dc['where'][_0xa267('0x56')]=_0xbbf100['id'];if(_0x5a2010['query']['filter']){_0x1653dc[_0xa267('0x37')]=_[_0xa267('0x3d')](_0x1653dc[_0xa267('0x37')],{'$or':_[_0xa267('0x39')](_0x1653dc[_0xa267('0x30')],function(_0x3ca47){var _0x567249={};_0x567249[_0x3ca47]={'$like':'%'+_0x5a2010[_0xa267('0x2e')]['filter']+'%'};return _0x567249;})});}_0x1653dc=_[_0xa267('0x3d')]({},_0x1653dc,_0x5a2010[_0xa267('0x3e')]);return db[_0xa267('0x60')]['count']({'where':_0x1653dc[_0xa267('0x37')]})[_0xa267('0x1f')](function(_0x38920c){_0x5e9b72['count']=_0x38920c;if(_0x5a2010['query'][_0xa267('0x40')]){_0x1653dc['include']=[{'all':!![]}];}return db['CmList']['findAll'](_0x1653dc);})[_0xa267('0x1f')](function(_0xf18362){_0x5e9b72[_0xa267('0x57')]=_0xf18362;return _0x5e9b72;});}})[_0xa267('0x1f')](respondWithFilteredResult(_0x203464,_0x1653dc))[_0xa267('0x42')](handleError(_0x203464,null));};exports['addBlackLists']=function(_0x45fa64,_0x1a915d,_0x2d96b7){var _0x5ac09a,_0x1492b1;return db[_0xa267('0x28')][_0xa267('0x45')]({'where':{'id':_0x45fa64[_0xa267('0x43')]['id']}})['then'](handleEntityNotFound(_0x1a915d,null))[_0xa267('0x1f')](function(_0x4555d5){if(_0x4555d5){_0x1492b1=_0x4555d5;return _0x4555d5[_0xa267('0x80')](_0x45fa64['body'][_0xa267('0x62')],_[_0xa267('0x50')](_0x45fa64[_0xa267('0x47')],['ids','id'])||{});}return null;})[_0xa267('0x63')](function(_0x14c548){var _0x2fc435;_0x5ac09a=_0x14c548||[];var _0x4fbe14=[];if(_0x14c548){for(var _0x55eb44=0x0;_0x55eb44<_0x14c548[_0xa267('0x31')];_0x55eb44+=0x1){var _0x227f92=_0x14c548[_0x55eb44][_0xa267('0x20')]({'plain':!![]});_0x2fc435=squel[_0xa267('0x66')]()[_0xa267('0x7c')](_0xa267('0x81'))[_0xa267('0x68')]([_0xa267('0x69'),_0xa267('0x6b'),_0xa267('0x6c'),_0xa267('0x56'),_0xa267('0x51'),_0xa267('0x52')],squel[_0xa267('0x6d')]()[_0xa267('0x6e')](_0xa267('0x69'),_0xa267('0x69'))[_0xa267('0x6e')]('id',_0xa267('0x6b'))[_0xa267('0x6e')](_0x227f92[_0xa267('0x75')][_0xa267('0x70')](),_0xa267('0x6c'))[_0xa267('0x6e')](_0x45fa64[_0xa267('0x43')]['id']['toString'](),_0xa267('0x56'))[_0xa267('0x6e')](_0xa267('0x6f'),_0xa267('0x51'))['field'](_0xa267('0x6f'),'updatedAt')[_0xa267('0x71')](_0xa267('0x72'))[_0xa267('0x37')](_0xa267('0x73'))[_0xa267('0x37')](_0xa267('0x74'),_0x227f92[_0xa267('0x75')][_0xa267('0x70')]())[_0xa267('0x37')](_0xa267('0x76')))[_0xa267('0x70')]();_0x4fbe14[_0xa267('0x7d')](db[_0xa267('0x7e')][_0xa267('0x2e')](_0x2fc435));}return BPromise[_0xa267('0x7f')](_0x4fbe14);}})['then'](function(){return _0x5ac09a;})[_0xa267('0x1f')](respondWithResult(_0x1a915d,null))['catch'](handleError(_0x1a915d,null));};exports[_0xa267('0x82')]=function(_0x77ba36,_0x4eec08,_0x2e3876){return db['Campaign'][_0xa267('0x45')]({'where':{'id':_0x77ba36['params']['id']}})[_0xa267('0x1f')](handleEntityNotFound(_0x4eec08,null))[_0xa267('0x1f')](function(_0x17f761){if(_0x17f761){return _0x17f761[_0xa267('0x82')](_0x77ba36[_0xa267('0x2e')][_0xa267('0x62')]);}})[_0xa267('0x1f')](function(_0x167ed8){if(_0x167ed8){return db[_0xa267('0x5e')]['destroy']({'where':{'ListId':_0x77ba36[_0xa267('0x2e')][_0xa267('0x62')],'CampaignId':_0x77ba36[_0xa267('0x43')]['id']}})[_0xa267('0x1f')](function(){return _0x167ed8;});}})[_0xa267('0x1f')](respondWithStatusCode(_0x4eec08,null))['catch'](handleError(_0x4eec08,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 57e00ab..f9d6af8 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 _0x04e9=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns'];(function(_0x2cad1b,_0x59a71e){var _0x212fe2=function(_0x5a4200){while(--_0x5a4200){_0x2cad1b['push'](_0x2cad1b['shift']());}};_0x212fe2(++_0x59a71e);}(_0x04e9,0x1e0));var _0x904e=function(_0x21622e,_0x5d9e07){_0x21622e=_0x21622e-0x0;var _0xa03dd6=_0x04e9[_0x21622e];return _0xa03dd6;};'use strict';var _=require(_0x904e('0x0'));var util=require(_0x904e('0x1'));var logger=require(_0x904e('0x2'))(_0x904e('0x3'));var moment=require(_0x904e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x904e('0x5'));var rimraf=require(_0x904e('0x6'));var config=require(_0x904e('0x7'));var attributes=require(_0x904e('0x8'));module[_0x904e('0x9')]=function(_0x430632,_0x593588){return _0x430632['define'](_0x904e('0xa'),attributes,{'tableName':_0x904e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b97=['./campaign.attributes','exports','define','Campaign','campaigns','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1a6525,_0x161fb4){var _0x34cf52=function(_0xd1d1ed){while(--_0xd1d1ed){_0x1a6525['push'](_0x1a6525['shift']());}};_0x34cf52(++_0x161fb4);}(_0x8b97,0x1a5));var _0x78b9=function(_0x3cbe8a,_0x5d4d1e){_0x3cbe8a=_0x3cbe8a-0x0;var _0x1ab178=_0x8b97[_0x3cbe8a];return _0x1ab178;};'use strict';var _=require(_0x78b9('0x0'));var util=require(_0x78b9('0x1'));var logger=require('../../config/logger')(_0x78b9('0x2'));var moment=require(_0x78b9('0x3'));var BPromise=require(_0x78b9('0x4'));var rp=require(_0x78b9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x78b9('0x6'));var config=require(_0x78b9('0x7'));var attributes=require(_0x78b9('0x8'));module[_0x78b9('0x9')]=function(_0x611b56,_0x5ea261){return _0x611b56[_0x78b9('0xa')](_0x78b9('0xb'),attributes,{'tableName':_0x78b9('0xc'),'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 3e3b68c..3225cdb 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 _0x391a=['model','attributes','debug','catch','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCampaign','Campaign','findAll','options','raw','where','include','map'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x391a,0x80));var _0xa391=function(_0x48a5ec,_0x18476f){_0x48a5ec=_0x48a5ec-0x0;var _0x2664af=_0x391a[_0x48a5ec];return _0x2664af;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa391('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa391('0x1'))['db'];var utils=require(_0xa391('0x2'));var logger=require(_0xa391('0x3'))(_0xa391('0x4'));var config=require(_0xa391('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xa391('0x6')][_0xa391('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1f990d,_0x4f122a,_0x36d3ab){return new BPromise(function(_0x4c882d,_0x5e0740){return client[_0xa391('0x8')](_0x1f990d,_0x36d3ab)[_0xa391('0x9')](function(_0xe61cce){logger[_0xa391('0xa')](_0xa391('0xb'),_0x4f122a,_0xa391('0xc'));logger['debug'](_0xa391('0xd'),_0x4f122a,'request\x20sent',JSON[_0xa391('0xe')](_0xe61cce));if(_0xe61cce['error']){if(_0xe61cce[_0xa391('0xf')][_0xa391('0x10')]===0x1f4){logger[_0xa391('0xf')]('Campaign,\x20%s,\x20%s',_0x4f122a,_0xe61cce['error'][_0xa391('0x11')]);return _0x5e0740(_0xe61cce[_0xa391('0xf')][_0xa391('0x11')]);}logger[_0xa391('0xf')](_0xa391('0xb'),_0x4f122a,_0xe61cce[_0xa391('0xf')][_0xa391('0x11')]);return _0x4c882d(_0xe61cce[_0xa391('0xf')][_0xa391('0x11')]);}else{logger[_0xa391('0xa')](_0xa391('0xb'),_0x4f122a,'request\x20sent');_0x4c882d(_0xe61cce[_0xa391('0x12')][_0xa391('0x11')]);}})['catch'](function(_0x2eacae){logger[_0xa391('0xf')](_0xa391('0xb'),_0x4f122a,_0x2eacae);_0x5e0740(_0x2eacae);});});}exports[_0xa391('0x13')]=function(_0x52c7c0){var _0x1f0124=this;return new Promise(function(_0x2bf286,_0x48a987){return db[_0xa391('0x14')][_0xa391('0x15')]({'raw':_0x52c7c0['options']?_0x52c7c0[_0xa391('0x16')][_0xa391('0x17')]===undefined?!![]:![]:!![],'where':_0x52c7c0[_0xa391('0x16')]?_0x52c7c0['options'][_0xa391('0x18')]||null:null,'attributes':_0x52c7c0[_0xa391('0x16')]?_0x52c7c0[_0xa391('0x16')]['attributes']||null:null,'limit':_0x52c7c0[_0xa391('0x16')]?_0x52c7c0['options']['limit']||null:null,'include':_0x52c7c0['options']?_0x52c7c0[_0xa391('0x16')][_0xa391('0x19')]?_[_0xa391('0x1a')](_0x52c7c0[_0xa391('0x16')][_0xa391('0x19')],function(_0x3d1fb6){return{'model':db[_0x3d1fb6[_0xa391('0x1b')]],'as':_0x3d1fb6['as'],'attributes':_0x3d1fb6[_0xa391('0x1c')],'include':_0x3d1fb6['include']?_[_0xa391('0x1a')](_0x3d1fb6['include'],function(_0x3535dc){return{'model':db[_0x3535dc[_0xa391('0x1b')]],'as':_0x3535dc['as'],'attributes':_0x3535dc['attributes'],'include':_0x3535dc[_0xa391('0x19')]?_[_0xa391('0x1a')](_0x3535dc['include'],function(_0xc95b0f){return{'model':db[_0xc95b0f['model']],'as':_0xc95b0f['as'],'attributes':_0xc95b0f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x9ebe77){logger[_0xa391('0xa')](_0xa391('0x13'),_0x52c7c0);logger[_0xa391('0x1d')](_0xa391('0x13'),_0x52c7c0,JSON[_0xa391('0xe')](_0x9ebe77));_0x2bf286(_0x9ebe77);})[_0xa391('0x1e')](function(_0x53163f){logger['error']('GetCampaign',_0x53163f[_0xa391('0x11')],_0x52c7c0);_0x48a987(_0x1f0124['error'](0x1f4,_0x53163f[_0xa391('0x11')]));});});}; \ No newline at end of file +var _0xd9a1=['attributes','include','map','model','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCampaign','Campaign','findAll','options','raw','where'];(function(_0x366a83,_0x8dc4cb){var _0x334b99=function(_0x51dfeb){while(--_0x51dfeb){_0x366a83['push'](_0x366a83['shift']());}};_0x334b99(++_0x8dc4cb);}(_0xd9a1,0x11c));var _0x1d9a=function(_0x3dbd6d,_0x3ee9d7){_0x3dbd6d=_0x3dbd6d-0x0;var _0x1216f1=_0xd9a1[_0x3dbd6d];return _0x1216f1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1d9a('0x0'));var BPromise=require(_0x1d9a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d9a('0x2'))['db'];var utils=require(_0x1d9a('0x3'));var logger=require(_0x1d9a('0x4'))('rpc');var config=require(_0x1d9a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x1d9a('0x6')][_0x1d9a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1824d9,_0x2fe4e7,_0x2faa58){return new BPromise(function(_0x162812,_0x26a964){return client['request'](_0x1824d9,_0x2faa58)['then'](function(_0x2ce79e){logger[_0x1d9a('0x8')](_0x1d9a('0x9'),_0x2fe4e7,_0x1d9a('0xa'));logger[_0x1d9a('0xb')](_0x1d9a('0xc'),_0x2fe4e7,_0x1d9a('0xa'),JSON[_0x1d9a('0xd')](_0x2ce79e));if(_0x2ce79e['error']){if(_0x2ce79e[_0x1d9a('0xe')][_0x1d9a('0xf')]===0x1f4){logger[_0x1d9a('0xe')]('Campaign,\x20%s,\x20%s',_0x2fe4e7,_0x2ce79e[_0x1d9a('0xe')][_0x1d9a('0x10')]);return _0x26a964(_0x2ce79e[_0x1d9a('0xe')][_0x1d9a('0x10')]);}logger[_0x1d9a('0xe')](_0x1d9a('0x9'),_0x2fe4e7,_0x2ce79e[_0x1d9a('0xe')][_0x1d9a('0x10')]);return _0x162812(_0x2ce79e[_0x1d9a('0xe')][_0x1d9a('0x10')]);}else{logger['info'](_0x1d9a('0x9'),_0x2fe4e7,_0x1d9a('0xa'));_0x162812(_0x2ce79e['result']['message']);}})[_0x1d9a('0x11')](function(_0x12680b){logger[_0x1d9a('0xe')]('Campaign,\x20%s,\x20%s',_0x2fe4e7,_0x12680b);_0x26a964(_0x12680b);});});}exports[_0x1d9a('0x12')]=function(_0x451de5){var _0x18d1a2=this;return new Promise(function(_0xa51a53,_0x2aaede){return db[_0x1d9a('0x13')][_0x1d9a('0x14')]({'raw':_0x451de5[_0x1d9a('0x15')]?_0x451de5[_0x1d9a('0x15')][_0x1d9a('0x16')]===undefined?!![]:![]:!![],'where':_0x451de5['options']?_0x451de5[_0x1d9a('0x15')][_0x1d9a('0x17')]||null:null,'attributes':_0x451de5[_0x1d9a('0x15')]?_0x451de5[_0x1d9a('0x15')][_0x1d9a('0x18')]||null:null,'limit':_0x451de5['options']?_0x451de5[_0x1d9a('0x15')]['limit']||null:null,'include':_0x451de5[_0x1d9a('0x15')]?_0x451de5[_0x1d9a('0x15')][_0x1d9a('0x19')]?_[_0x1d9a('0x1a')](_0x451de5['options'][_0x1d9a('0x19')],function(_0x274d08){return{'model':db[_0x274d08[_0x1d9a('0x1b')]],'as':_0x274d08['as'],'attributes':_0x274d08['attributes'],'include':_0x274d08[_0x1d9a('0x19')]?_[_0x1d9a('0x1a')](_0x274d08['include'],function(_0x22bee5){return{'model':db[_0x22bee5['model']],'as':_0x22bee5['as'],'attributes':_0x22bee5[_0x1d9a('0x18')],'include':_0x22bee5['include']?_[_0x1d9a('0x1a')](_0x22bee5[_0x1d9a('0x19')],function(_0x5945d9){return{'model':db[_0x5945d9[_0x1d9a('0x1b')]],'as':_0x5945d9['as'],'attributes':_0x5945d9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2af9e4){logger[_0x1d9a('0x8')](_0x1d9a('0x12'),_0x451de5);logger[_0x1d9a('0xb')](_0x1d9a('0x12'),_0x451de5,JSON[_0x1d9a('0xd')](_0x2af9e4));_0xa51a53(_0x2af9e4);})[_0x1d9a('0x11')](function(_0xa74ebb){logger[_0x1d9a('0xe')](_0x1d9a('0x12'),_0xa74ebb[_0x1d9a('0x10')],_0x451de5);_0x2aaede(_0x18d1a2[_0x1d9a('0xe')](0x1f4,_0xa74ebb['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 0563b14..c586a34 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 _0xea04=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','/:id/lists','addBlackLists','put','/:id','update','delete','destroy','removeLists','removeBlackLists','util','express'];(function(_0x1413c0,_0x38cdd4){var _0x3359b0=function(_0x13984e){while(--_0x13984e){_0x1413c0['push'](_0x1413c0['shift']());}};_0x3359b0(++_0x38cdd4);}(_0xea04,0x196));var _0x4ea0=function(_0x3b6648,_0x2d723a){_0x3b6648=_0x3b6648-0x0;var _0x5a0a0d=_0xea04[_0x3b6648];return _0x5a0a0d;};'use strict';var multer=require('multer');var util=require(_0x4ea0('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4ea0('0x1'));var router=express[_0x4ea0('0x2')]();var auth=require(_0x4ea0('0x3'));var interaction=require(_0x4ea0('0x4'));var config=require(_0x4ea0('0x5'));var controller=require(_0x4ea0('0x6'));router['get']('/',auth[_0x4ea0('0x7')](),controller[_0x4ea0('0x8')]);router[_0x4ea0('0x9')]('/:id',auth[_0x4ea0('0x7')](),controller[_0x4ea0('0xa')]);router[_0x4ea0('0x9')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x4ea0('0xb')]);router['get'](_0x4ea0('0xc'),auth[_0x4ea0('0x7')](),controller[_0x4ea0('0xd')]);router[_0x4ea0('0x9')](_0x4ea0('0xe'),auth[_0x4ea0('0x7')](),controller[_0x4ea0('0xf')]);router[_0x4ea0('0x9')](_0x4ea0('0x10'),auth[_0x4ea0('0x7')](),controller[_0x4ea0('0x11')]);router['get']('/:id/lists',auth[_0x4ea0('0x7')](),controller[_0x4ea0('0x12')]);router[_0x4ea0('0x9')](_0x4ea0('0x13'),auth[_0x4ea0('0x7')](),controller[_0x4ea0('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4ea0('0x15')]);router[_0x4ea0('0x16')](_0x4ea0('0x17'),auth['isAuthenticated'](),controller[_0x4ea0('0x18')]);router[_0x4ea0('0x16')](_0x4ea0('0x19'),auth[_0x4ea0('0x7')](),controller['addLists']);router['post'](_0x4ea0('0x13'),auth[_0x4ea0('0x7')](),controller[_0x4ea0('0x1a')]);router[_0x4ea0('0x1b')](_0x4ea0('0x1c'),auth[_0x4ea0('0x7')](),controller[_0x4ea0('0x1d')]);router[_0x4ea0('0x1e')](_0x4ea0('0x1c'),auth['isAuthenticated'](),controller[_0x4ea0('0x1f')]);router[_0x4ea0('0x1e')](_0x4ea0('0x19'),auth['isAuthenticated'](),controller[_0x4ea0('0x20')]);router[_0x4ea0('0x1e')](_0x4ea0('0x13'),auth[_0x4ea0('0x7')](),controller[_0x4ea0('0x21')]);module['exports']=router; \ No newline at end of file +var _0x069c=['getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','destroy','delete','removeLists','removeBlackLists','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x069c,0x154));var _0xc069=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0x069c[_0x270adf];return _0x29eda9;};'use strict';var multer=require(_0xc069('0x0'));var util=require('util');var path=require(_0xc069('0x1'));var timeout=require('connect-timeout');var express=require(_0xc069('0x2'));var router=express[_0xc069('0x3')]();var auth=require(_0xc069('0x4'));var interaction=require(_0xc069('0x5'));var config=require(_0xc069('0x6'));var controller=require(_0xc069('0x7'));router[_0xc069('0x8')]('/',auth[_0xc069('0x9')](),controller[_0xc069('0xa')]);router[_0xc069('0x8')](_0xc069('0xb'),auth[_0xc069('0x9')](),controller['show']);router[_0xc069('0x8')](_0xc069('0xc'),auth[_0xc069('0x9')](),controller[_0xc069('0xd')]);router[_0xc069('0x8')](_0xc069('0xe'),auth[_0xc069('0x9')](),controller[_0xc069('0xf')]);router[_0xc069('0x8')](_0xc069('0x10'),auth[_0xc069('0x9')](),controller[_0xc069('0x11')]);router[_0xc069('0x8')]('/:id/hopper_black',auth[_0xc069('0x9')](),controller[_0xc069('0x12')]);router['get'](_0xc069('0x13'),auth[_0xc069('0x9')](),controller[_0xc069('0x14')]);router['get'](_0xc069('0x15'),auth['isAuthenticated'](),controller[_0xc069('0x16')]);router[_0xc069('0x17')]('/',auth[_0xc069('0x9')](),controller[_0xc069('0x18')]);router[_0xc069('0x17')](_0xc069('0x19'),auth[_0xc069('0x9')](),controller[_0xc069('0x1a')]);router[_0xc069('0x17')]('/:id/lists',auth[_0xc069('0x9')](),controller[_0xc069('0x1b')]);router[_0xc069('0x17')](_0xc069('0x15'),auth[_0xc069('0x9')](),controller[_0xc069('0x1c')]);router[_0xc069('0x1d')](_0xc069('0xb'),auth['isAuthenticated'](),controller[_0xc069('0x1e')]);router['delete']('/:id',auth[_0xc069('0x9')](),controller[_0xc069('0x1f')]);router[_0xc069('0x20')]('/:id/lists',auth[_0xc069('0x9')](),controller[_0xc069('0x21')]);router['delete']('/:id/blacklists',auth[_0xc069('0x9')](),controller[_0xc069('0x22')]);module[_0xc069('0x23')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 9205f8e..377884e 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 _0x5554=['TEXT','key','sequelize','exports','STRING'];(function(_0x48bb5e,_0xbfdbc9){var _0x3adc8c=function(_0x59ff31){while(--_0x59ff31){_0x48bb5e['push'](_0x48bb5e['shift']());}};_0x3adc8c(++_0xbfdbc9);}(_0x5554,0xfc));var _0x4555=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x5554[_0x424a9a];return _0xa7831c;};'use strict';var Sequelize=require(_0x4555('0x0'));module[_0x4555('0x1')]={'key':{'type':Sequelize[_0x4555('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x4555('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x4555('0x4'));}}}; \ No newline at end of file +var _0x25de=['key','sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x20abd8,_0x1542dc){var _0x4fdad4=function(_0x42838b){while(--_0x42838b){_0x20abd8['push'](_0x20abd8['shift']());}};_0x4fdad4(++_0x1542dc);}(_0x25de,0x14a));var _0xe25d=function(_0x4bc428,_0xf56dd9){_0x4bc428=_0x4bc428-0x0;var _0x3ca37f=_0x25de[_0x4bc428];return _0x3ca37f;};'use strict';var Sequelize=require(_0xe25d('0x0'));module[_0xe25d('0x1')]={'key':{'type':Sequelize[_0xe25d('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xe25d('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xe25d('0x2')]},'name':{'type':Sequelize[_0xe25d('0x4')],'get':function(){return this[_0xe25d('0x5')](_0xe25d('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index c0642f0..34b8c57 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 _0x0df7=['nolimit','order','sort','where','filter','type','key','VIRTUAL','field','merge','options','CannedAnswer','count','includeAll','include','findAll','rows','show','params','length','find','catch','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','sendStatus','status','end','offset','limit','set','json','apply','reject','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty'];(function(_0x10ad93,_0x1e2712){var _0x3f5cb3=function(_0x16952f){while(--_0x16952f){_0x10ad93['push'](_0x10ad93['shift']());}};_0x3f5cb3(++_0x1e2712);}(_0x0df7,0x71));var _0x70df=function(_0x53ae7d,_0x1af482){_0x53ae7d=_0x53ae7d-0x0;var _0x2d6f5c=_0x0df7[_0x53ae7d];return _0x2d6f5c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x70df('0x0'));var rimraf=require(_0x70df('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x70df('0x2'));var moment=require(_0x70df('0x3'));var BPromise=require(_0x70df('0x4'));var Mustache=require(_0x70df('0x5'));var util=require('util');var path=require(_0x70df('0x6'));var sox=require(_0x70df('0x7'));var csv=require(_0x70df('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x70df('0x9'));var squel=require(_0x70df('0xa'));var crypto=require(_0x70df('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x70df('0xc'));var toCsv=require(_0x70df('0x8'));var querystring=require(_0x70df('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x70df('0xe'));var qs=require(_0x70df('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x70df('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5757fc,_0xeea459){_0xeea459=_0xeea459||0xcc;return function(_0x527048){if(_0x527048){return _0x5757fc[_0x70df('0x11')](_0xeea459);}return _0x5757fc[_0x70df('0x12')](_0xeea459)[_0x70df('0x13')]();};}function respondWithResult(_0x16e3bf,_0x31895e){_0x31895e=_0x31895e||0xc8;return function(_0x24f21a){if(_0x24f21a){return _0x16e3bf[_0x70df('0x12')](_0x31895e)['json'](_0x24f21a);}};}function respondWithFilteredResult(_0x4f5b37,_0x573143){return function(_0xff397c){if(_0xff397c){var _0xd6eba0=_0xff397c['count'],_0x4e607c=_0x573143[_0x70df('0x14')],_0x33fd90=_0x573143[_0x70df('0x14')]+_0x573143[_0x70df('0x15')],_0x2ba15a;if(_0x33fd90>=_0xd6eba0){_0x33fd90=_0xd6eba0;_0x2ba15a=0xc8;}else{_0x2ba15a=0xce;}_0x4f5b37['status'](_0x2ba15a);return _0x4f5b37[_0x70df('0x16')]('Content-Range',_0x4e607c+'-'+_0x33fd90+'/'+_0xd6eba0)[_0x70df('0x17')](_0xff397c);}return null;};}function patchUpdates(_0x51a609){return function(_0x4a80ad){try{jsonpatch[_0x70df('0x18')](_0x4a80ad,_0x51a609,!![]);}catch(_0x30f706){return BPromise[_0x70df('0x19')](_0x30f706);}return _0x4a80ad['save']();};}function saveUpdates(_0xc905fe,_0x3dbc95){return function(_0x1b1d1f){if(_0x1b1d1f){return _0x1b1d1f['update'](_0xc905fe)[_0x70df('0x1a')](function(_0x482b21){return _0x482b21;});}return null;};}function removeEntity(_0x15625d,_0x1653d8){return function(_0x11b248){if(_0x11b248){return _0x11b248[_0x70df('0x1b')]()['then'](function(){var _0xd6764b=_0x11b248[_0x70df('0x1c')]({'plain':!![]});var _0x200e16=_0x70df('0x1d');return db[_0x70df('0x1e')]['destroy']({'where':{'type':_0x200e16,'resourceId':_0xd6764b['id']}})[_0x70df('0x1a')](function(){return _0x11b248;});})[_0x70df('0x1a')](function(){_0x15625d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c43ec,_0x2ad90a){return function(_0x38f0a5){if(!_0x38f0a5){_0x5c43ec[_0x70df('0x11')](0x194);}return _0x38f0a5;};}function handleError(_0x1157bc,_0x1ea444){_0x1ea444=_0x1ea444||0x1f4;return function(_0x149711){logger[_0x70df('0x1f')](_0x149711[_0x70df('0x20')]);if(_0x149711[_0x70df('0x21')]){delete _0x149711[_0x70df('0x21')];}_0x1157bc[_0x70df('0x12')](_0x1ea444)[_0x70df('0x22')](_0x149711);};}exports[_0x70df('0x23')]=function(_0x247259,_0x50ed04){var _0x180ee7={},_0x4eff9a={},_0x40d213={'count':0x0,'rows':[]};var _0x9a3239=db['CannedAnswer'][_0x70df('0x24')];_0x4eff9a[_0x70df('0x25')]=_[_0x70df('0x26')](_0x9a3239);_0x4eff9a['query']=_[_0x70df('0x26')](_0x247259[_0x70df('0x27')]);_0x4eff9a[_0x70df('0x28')]=_[_0x70df('0x29')](_0x4eff9a[_0x70df('0x25')],_0x4eff9a['query']);_0x180ee7['attributes']=_[_0x70df('0x29')](_0x4eff9a[_0x70df('0x25')],qs[_0x70df('0x2a')](_0x247259['query'][_0x70df('0x2a')]));_0x180ee7[_0x70df('0x2b')]=_0x180ee7[_0x70df('0x2b')]['length']?_0x180ee7['attributes']:_0x4eff9a[_0x70df('0x25')];if(!_0x247259['query'][_0x70df('0x2c')](_0x70df('0x2d'))){_0x180ee7[_0x70df('0x15')]=qs[_0x70df('0x15')](_0x247259[_0x70df('0x27')]['limit']);_0x180ee7[_0x70df('0x14')]=qs[_0x70df('0x14')](_0x247259[_0x70df('0x27')][_0x70df('0x14')]);}_0x180ee7[_0x70df('0x2e')]=qs[_0x70df('0x2f')](_0x247259[_0x70df('0x27')][_0x70df('0x2f')]);_0x180ee7[_0x70df('0x30')]=qs[_0x70df('0x28')](_['pick'](_0x247259[_0x70df('0x27')],_0x4eff9a[_0x70df('0x28')]));if(_0x247259['query'][_0x70df('0x31')]){_0x180ee7['where']=_['merge'](_0x180ee7['where'],{'$or':_['map'](_0x9a3239,function(_0x5ccef5){if(_0x5ccef5[_0x70df('0x32')][_0x70df('0x33')]!==_0x70df('0x34')){var _0x3dc7fb={};_0x3dc7fb[_0x5ccef5[_0x70df('0x35')]]={'$like':'%'+_0x247259[_0x70df('0x27')][_0x70df('0x31')]+'%'};return _0x3dc7fb;}})});}_0x180ee7=_[_0x70df('0x36')]({},_0x180ee7,_0x247259[_0x70df('0x37')]);var _0x1ccbd3={'where':_0x180ee7['where']};return db[_0x70df('0x38')][_0x70df('0x39')](_0x1ccbd3)['then'](function(_0x1882a2){_0x40d213[_0x70df('0x39')]=_0x1882a2;if(_0x247259[_0x70df('0x27')][_0x70df('0x3a')]){_0x180ee7[_0x70df('0x3b')]=[{'all':!![]}];}return db['CannedAnswer'][_0x70df('0x3c')](_0x180ee7);})[_0x70df('0x1a')](function(_0x5ba87e){_0x40d213[_0x70df('0x3d')]=_0x5ba87e;return _0x40d213;})[_0x70df('0x1a')](respondWithFilteredResult(_0x50ed04,_0x180ee7))['catch'](handleError(_0x50ed04,null));};exports[_0x70df('0x3e')]=function(_0xdeb3e7,_0xf3a6d2){var _0x2f721d={'raw':!![],'where':{'id':_0xdeb3e7[_0x70df('0x3f')]['id']}},_0xa5801a={};_0xa5801a[_0x70df('0x25')]=_['keys'](db['CannedAnswer'][_0x70df('0x24')]);_0xa5801a[_0x70df('0x27')]=_[_0x70df('0x26')](_0xdeb3e7['query']);_0xa5801a[_0x70df('0x28')]=_['intersection'](_0xa5801a[_0x70df('0x25')],_0xa5801a['query']);_0x2f721d[_0x70df('0x2b')]=_[_0x70df('0x29')](_0xa5801a[_0x70df('0x25')],qs[_0x70df('0x2a')](_0xdeb3e7[_0x70df('0x27')]['fields']));_0x2f721d[_0x70df('0x2b')]=_0x2f721d[_0x70df('0x2b')][_0x70df('0x40')]?_0x2f721d[_0x70df('0x2b')]:_0xa5801a[_0x70df('0x25')];if(_0xdeb3e7['query'][_0x70df('0x3a')]){_0x2f721d[_0x70df('0x3b')]=[{'all':!![]}];}_0x2f721d=_[_0x70df('0x36')]({},_0x2f721d,_0xdeb3e7[_0x70df('0x37')]);return db['CannedAnswer'][_0x70df('0x41')](_0x2f721d)[_0x70df('0x1a')](handleEntityNotFound(_0xf3a6d2,null))[_0x70df('0x1a')](respondWithResult(_0xf3a6d2,null))[_0x70df('0x42')](handleError(_0xf3a6d2,null));};exports['update']=function(_0x3b0ef5,_0x4e46fd){if(_0x3b0ef5[_0x70df('0x43')]['id']){delete _0x3b0ef5[_0x70df('0x43')]['id'];}return db[_0x70df('0x38')][_0x70df('0x41')]({'where':{'id':_0x3b0ef5[_0x70df('0x3f')]['id']}})[_0x70df('0x1a')](handleEntityNotFound(_0x4e46fd,null))['then'](saveUpdates(_0x3b0ef5['body'],null))[_0x70df('0x1a')](respondWithResult(_0x4e46fd,null))[_0x70df('0x42')](handleError(_0x4e46fd,null));};exports[_0x70df('0x1b')]=function(_0x242e73,_0xbaf127){return db[_0x70df('0x38')]['find']({'where':{'id':_0x242e73['params']['id']}})[_0x70df('0x1a')](handleEntityNotFound(_0xbaf127,null))['then'](removeEntity(_0xbaf127,null))[_0x70df('0x42')](handleError(_0xbaf127,null));};exports[_0x70df('0x44')]=function(_0x19a40a,_0x3fb1b7){var _0x204950={'key':_0x19a40a[_0x70df('0x43')]['key']};if(_0x19a40a['body'][_0x70df('0x45')]){_0x204950[_0x70df('0x45')]=_0x19a40a['body']['MailAccountId'];}else if(_0x19a40a['body'][_0x70df('0x46')]){_0x204950['SmsAccountId']=_0x19a40a['body'][_0x70df('0x46')];}else if(_0x19a40a[_0x70df('0x43')][_0x70df('0x47')]){_0x204950[_0x70df('0x47')]=_0x19a40a[_0x70df('0x43')]['OpenchannelAccountId'];}else if(_0x19a40a[_0x70df('0x43')][_0x70df('0x48')]){_0x204950[_0x70df('0x48')]=_0x19a40a[_0x70df('0x43')][_0x70df('0x48')];}return db[_0x70df('0x38')][_0x70df('0x41')]({'where':_0x204950})[_0x70df('0x1a')](function(_0x66ded8){if(_0x66ded8){throw new db[(_0x70df('0x49'))][(_0x70df('0x4a'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x70df('0x38')]['create'](_0x19a40a['body']);})[_0x70df('0x1a')](function(_0x46a709){var _0x57f92a=_0x19a40a[_0x70df('0x4b')][_0x70df('0x1c')]({'plain':!![]});if(!_0x57f92a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57f92a[_0x70df('0x4c')]===_0x70df('0x4b')){var _0x154264=_0x46a709[_0x70df('0x1c')]({'plain':!![]});return db['UserProfileSection'][_0x70df('0x41')]({'where':{'name':_0x70df('0x1d'),'userProfileId':_0x57f92a[_0x70df('0x4d')]},'raw':!![]})[_0x70df('0x1a')](function(_0x479296){if(_0x479296&&_0x479296['autoAssociation']===0x0){return db[_0x70df('0x1e')][_0x70df('0x44')]({'name':_0x154264['name'],'resourceId':_0x154264['id'],'type':_0x479296[_0x70df('0x21')],'sectionId':_0x479296['id']},{})[_0x70df('0x1a')](function(){return _0x46a709;});}else{return _0x46a709;}})[_0x70df('0x42')](function(_0x16dd1e){logger[_0x70df('0x1f')](_0x70df('0x4e'),_0x16dd1e);throw _0x16dd1e;});}return _0x46a709;})[_0x70df('0x1a')](respondWithResult(_0x3fb1b7,0xc9))['catch'](handleError(_0x3fb1b7,null));}; \ No newline at end of file +var _0x7559=['filter','options','count','includeAll','include','rows','catch','show','params','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','offset','limit','set','Content-Range','apply','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','send','index','CannedAnswer','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','map','type','field'];(function(_0x49a5f6,_0x2eea42){var _0x22fe92=function(_0x4ed337){while(--_0x4ed337){_0x49a5f6['push'](_0x49a5f6['shift']());}};_0x22fe92(++_0x2eea42);}(_0x7559,0x75));var _0x9755=function(_0x533a52,_0x2538f0){_0x533a52=_0x533a52-0x0;var _0x18e5ab=_0x7559[_0x533a52];return _0x18e5ab;};'use strict';var pdf=require(_0x9755('0x0'));var emlformat=require(_0x9755('0x1'));var rimraf=require(_0x9755('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9755('0x3'));var rp=require('request-promise');var moment=require(_0x9755('0x4'));var BPromise=require(_0x9755('0x5'));var Mustache=require(_0x9755('0x6'));var util=require(_0x9755('0x7'));var path=require(_0x9755('0x8'));var sox=require('sox');var csv=require(_0x9755('0x9'));var ejs=require(_0x9755('0xa'));var fs=require('fs');var _=require(_0x9755('0xb'));var squel=require(_0x9755('0xc'));var crypto=require(_0x9755('0xd'));var jsforce=require(_0x9755('0xe'));var deskjs=require(_0x9755('0xf'));var toCsv=require(_0x9755('0x9'));var querystring=require('querystring');var Papa=require(_0x9755('0x10'));var Redis=require(_0x9755('0x11'));var authService=require(_0x9755('0x12'));var qs=require(_0x9755('0x13'));var hardwareService=require(_0x9755('0x14'));var logger=require(_0x9755('0x15'))(_0x9755('0x16'));var utils=require('../../config/utils');var config=require(_0x9755('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52ecf2,_0x524208){_0x524208=_0x524208||0xcc;return function(_0x1f7a10){if(_0x1f7a10){return _0x52ecf2['sendStatus'](_0x524208);}return _0x52ecf2[_0x9755('0x18')](_0x524208)[_0x9755('0x19')]();};}function respondWithResult(_0x16297d,_0x121a2a){_0x121a2a=_0x121a2a||0xc8;return function(_0x167d83){if(_0x167d83){return _0x16297d[_0x9755('0x18')](_0x121a2a)[_0x9755('0x1a')](_0x167d83);}};}function respondWithFilteredResult(_0x5be013,_0x3fb7c0){return function(_0x505a7e){if(_0x505a7e){var _0x3e8460=_0x505a7e['count'],_0x2c7679=_0x3fb7c0[_0x9755('0x1b')],_0x5bca3d=_0x3fb7c0[_0x9755('0x1b')]+_0x3fb7c0[_0x9755('0x1c')],_0x2dc920;if(_0x5bca3d>=_0x3e8460){_0x5bca3d=_0x3e8460;_0x2dc920=0xc8;}else{_0x2dc920=0xce;}_0x5be013['status'](_0x2dc920);return _0x5be013[_0x9755('0x1d')](_0x9755('0x1e'),_0x2c7679+'-'+_0x5bca3d+'/'+_0x3e8460)[_0x9755('0x1a')](_0x505a7e);}return null;};}function patchUpdates(_0x38e7b6){return function(_0xef0bbc){try{jsonpatch[_0x9755('0x1f')](_0xef0bbc,_0x38e7b6,!![]);}catch(_0x1ee8a9){return BPromise['reject'](_0x1ee8a9);}return _0xef0bbc['save']();};}function saveUpdates(_0x3f425b,_0x29cd4f){return function(_0x10e55e){if(_0x10e55e){return _0x10e55e[_0x9755('0x20')](_0x3f425b)[_0x9755('0x21')](function(_0x3b3407){return _0x3b3407;});}return null;};}function removeEntity(_0x428cc8,_0xe1d23a){return function(_0xc93b33){if(_0xc93b33){return _0xc93b33[_0x9755('0x22')]()[_0x9755('0x21')](function(){var _0x451fd1=_0xc93b33[_0x9755('0x23')]({'plain':!![]});var _0x5a8991=_0x9755('0x24');return db[_0x9755('0x25')][_0x9755('0x22')]({'where':{'type':_0x5a8991,'resourceId':_0x451fd1['id']}})['then'](function(){return _0xc93b33;});})[_0x9755('0x21')](function(){_0x428cc8['status'](0xcc)[_0x9755('0x19')]();});}};}function handleEntityNotFound(_0x529fe8,_0x45e91f){return function(_0x4f65ce){if(!_0x4f65ce){_0x529fe8[_0x9755('0x26')](0x194);}return _0x4f65ce;};}function handleError(_0x4dbffb,_0x3ae397){_0x3ae397=_0x3ae397||0x1f4;return function(_0x4e7e04){logger[_0x9755('0x27')](_0x4e7e04[_0x9755('0x28')]);if(_0x4e7e04['name']){delete _0x4e7e04['name'];}_0x4dbffb[_0x9755('0x18')](_0x3ae397)[_0x9755('0x29')](_0x4e7e04);};}exports[_0x9755('0x2a')]=function(_0x16231f,_0x3364cc){var _0xb45b61={},_0x58894d={},_0x5f2207={'count':0x0,'rows':[]};var _0x36cf3f=db[_0x9755('0x2b')][_0x9755('0x2c')];_0x58894d[_0x9755('0x2d')]=_[_0x9755('0x2e')](_0x36cf3f);_0x58894d[_0x9755('0x2f')]=_[_0x9755('0x2e')](_0x16231f[_0x9755('0x2f')]);_0x58894d[_0x9755('0x30')]=_[_0x9755('0x31')](_0x58894d[_0x9755('0x2d')],_0x58894d[_0x9755('0x2f')]);_0xb45b61[_0x9755('0x32')]=_[_0x9755('0x31')](_0x58894d['model'],qs[_0x9755('0x33')](_0x16231f['query']['fields']));_0xb45b61[_0x9755('0x32')]=_0xb45b61[_0x9755('0x32')][_0x9755('0x34')]?_0xb45b61['attributes']:_0x58894d['model'];if(!_0x16231f[_0x9755('0x2f')]['hasOwnProperty'](_0x9755('0x35'))){_0xb45b61[_0x9755('0x1c')]=qs[_0x9755('0x1c')](_0x16231f[_0x9755('0x2f')]['limit']);_0xb45b61[_0x9755('0x1b')]=qs['offset'](_0x16231f[_0x9755('0x2f')][_0x9755('0x1b')]);}_0xb45b61[_0x9755('0x36')]=qs[_0x9755('0x37')](_0x16231f[_0x9755('0x2f')][_0x9755('0x37')]);_0xb45b61['where']=qs[_0x9755('0x30')](_['pick'](_0x16231f[_0x9755('0x2f')],_0x58894d[_0x9755('0x30')]));if(_0x16231f[_0x9755('0x2f')]['filter']){_0xb45b61[_0x9755('0x38')]=_[_0x9755('0x39')](_0xb45b61[_0x9755('0x38')],{'$or':_[_0x9755('0x3a')](_0x36cf3f,function(_0x573aee){if(_0x573aee[_0x9755('0x3b')]['key']!=='VIRTUAL'){var _0x9442ca={};_0x9442ca[_0x573aee[_0x9755('0x3c')]]={'$like':'%'+_0x16231f[_0x9755('0x2f')][_0x9755('0x3d')]+'%'};return _0x9442ca;}})});}_0xb45b61=_[_0x9755('0x39')]({},_0xb45b61,_0x16231f[_0x9755('0x3e')]);var _0x18fcae={'where':_0xb45b61[_0x9755('0x38')]};return db[_0x9755('0x2b')][_0x9755('0x3f')](_0x18fcae)[_0x9755('0x21')](function(_0x8b9c46){_0x5f2207['count']=_0x8b9c46;if(_0x16231f['query'][_0x9755('0x40')]){_0xb45b61[_0x9755('0x41')]=[{'all':!![]}];}return db[_0x9755('0x2b')]['findAll'](_0xb45b61);})[_0x9755('0x21')](function(_0x11dc23){_0x5f2207[_0x9755('0x42')]=_0x11dc23;return _0x5f2207;})[_0x9755('0x21')](respondWithFilteredResult(_0x3364cc,_0xb45b61))[_0x9755('0x43')](handleError(_0x3364cc,null));};exports[_0x9755('0x44')]=function(_0x361213,_0x447633){var _0x289d49={'raw':!![],'where':{'id':_0x361213[_0x9755('0x45')]['id']}},_0x35da56={};_0x35da56[_0x9755('0x2d')]=_[_0x9755('0x2e')](db[_0x9755('0x2b')][_0x9755('0x2c')]);_0x35da56[_0x9755('0x2f')]=_[_0x9755('0x2e')](_0x361213[_0x9755('0x2f')]);_0x35da56[_0x9755('0x30')]=_[_0x9755('0x31')](_0x35da56[_0x9755('0x2d')],_0x35da56[_0x9755('0x2f')]);_0x289d49[_0x9755('0x32')]=_[_0x9755('0x31')](_0x35da56[_0x9755('0x2d')],qs[_0x9755('0x33')](_0x361213['query'][_0x9755('0x33')]));_0x289d49[_0x9755('0x32')]=_0x289d49['attributes'][_0x9755('0x34')]?_0x289d49[_0x9755('0x32')]:_0x35da56[_0x9755('0x2d')];if(_0x361213[_0x9755('0x2f')][_0x9755('0x40')]){_0x289d49[_0x9755('0x41')]=[{'all':!![]}];}_0x289d49=_[_0x9755('0x39')]({},_0x289d49,_0x361213[_0x9755('0x3e')]);return db[_0x9755('0x2b')][_0x9755('0x46')](_0x289d49)[_0x9755('0x21')](handleEntityNotFound(_0x447633,null))['then'](respondWithResult(_0x447633,null))[_0x9755('0x43')](handleError(_0x447633,null));};exports[_0x9755('0x20')]=function(_0x2e1aa3,_0x4c0cf8){if(_0x2e1aa3[_0x9755('0x47')]['id']){delete _0x2e1aa3[_0x9755('0x47')]['id'];}return db[_0x9755('0x2b')][_0x9755('0x46')]({'where':{'id':_0x2e1aa3['params']['id']}})['then'](handleEntityNotFound(_0x4c0cf8,null))[_0x9755('0x21')](saveUpdates(_0x2e1aa3[_0x9755('0x47')],null))[_0x9755('0x21')](respondWithResult(_0x4c0cf8,null))[_0x9755('0x43')](handleError(_0x4c0cf8,null));};exports[_0x9755('0x22')]=function(_0x3ec1df,_0x2ce85c){return db[_0x9755('0x2b')][_0x9755('0x46')]({'where':{'id':_0x3ec1df[_0x9755('0x45')]['id']}})['then'](handleEntityNotFound(_0x2ce85c,null))[_0x9755('0x21')](removeEntity(_0x2ce85c,null))[_0x9755('0x43')](handleError(_0x2ce85c,null));};exports[_0x9755('0x48')]=function(_0x1a0da4,_0x9b6204){var _0x1908b1={'key':_0x1a0da4['body'][_0x9755('0x49')]};if(_0x1a0da4[_0x9755('0x47')]['MailAccountId']){_0x1908b1[_0x9755('0x4a')]=_0x1a0da4['body'][_0x9755('0x4a')];}else if(_0x1a0da4['body'][_0x9755('0x4b')]){_0x1908b1[_0x9755('0x4b')]=_0x1a0da4[_0x9755('0x47')][_0x9755('0x4b')];}else if(_0x1a0da4[_0x9755('0x47')]['OpenchannelAccountId']){_0x1908b1[_0x9755('0x4c')]=_0x1a0da4[_0x9755('0x47')]['OpenchannelAccountId'];}else if(_0x1a0da4[_0x9755('0x47')][_0x9755('0x4d')]){_0x1908b1[_0x9755('0x4d')]=_0x1a0da4[_0x9755('0x47')][_0x9755('0x4d')];}return db[_0x9755('0x2b')][_0x9755('0x46')]({'where':_0x1908b1})[_0x9755('0x21')](function(_0x1ea8c9){if(_0x1ea8c9){throw new db[(_0x9755('0x4e'))][(_0x9755('0x4f'))](_0x9755('0x50'));}return db[_0x9755('0x2b')][_0x9755('0x48')](_0x1a0da4[_0x9755('0x47')]);})[_0x9755('0x21')](function(_0x555426){var _0x828054=_0x1a0da4[_0x9755('0x51')][_0x9755('0x23')]({'plain':!![]});if(!_0x828054)throw new Error(_0x9755('0x52'));if(_0x828054[_0x9755('0x53')]==='user'){var _0x49bf38=_0x555426[_0x9755('0x23')]({'plain':!![]});return db[_0x9755('0x54')][_0x9755('0x46')]({'where':{'name':_0x9755('0x24'),'userProfileId':_0x828054[_0x9755('0x55')]},'raw':!![]})['then'](function(_0x463b76){if(_0x463b76&&_0x463b76[_0x9755('0x56')]===0x0){return db[_0x9755('0x25')]['create']({'name':_0x49bf38[_0x9755('0x57')],'resourceId':_0x49bf38['id'],'type':_0x463b76[_0x9755('0x57')],'sectionId':_0x463b76['id']},{})[_0x9755('0x21')](function(){return _0x555426;});}else{return _0x555426;}})[_0x9755('0x43')](function(_0x36a7be){logger[_0x9755('0x27')](_0x9755('0x58'),_0x36a7be);throw _0x36a7be;});}return _0x555426;})[_0x9755('0x21')](respondWithResult(_0x9b6204,0xc9))[_0x9755('0x43')](handleError(_0x9b6204,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index f5f02dd..ccce6e7 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 _0x22d2=['CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','define'];(function(_0xe8a12,_0x59690c){var _0x3567d4=function(_0x14fd7f){while(--_0x14fd7f){_0xe8a12['push'](_0xe8a12['shift']());}};_0x3567d4(++_0x59690c);}(_0x22d2,0x17c));var _0x222d=function(_0x36e92e,_0x54c652){_0x36e92e=_0x36e92e-0x0;var _0x3ec5ab=_0x22d2[_0x36e92e];return _0x3ec5ab;};'use strict';var _=require(_0x222d('0x0'));var util=require(_0x222d('0x1'));var logger=require('../../config/logger')(_0x222d('0x2'));var moment=require('moment');var BPromise=require(_0x222d('0x3'));var rp=require(_0x222d('0x4'));var fs=require('fs');var path=require(_0x222d('0x5'));var rimraf=require(_0x222d('0x6'));var config=require(_0x222d('0x7'));var attributes=require(_0x222d('0x8'));module['exports']=function(_0x489a6c,_0xcc6994){return _0x489a6c[_0x222d('0x9')](_0x222d('0xa'),attributes,{'tableName':_0x222d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x222d('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xdc02=['path','./cannedAnswer.attributes','define','tools_canned_answers','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4e6bd7,_0x46fd0d){var _0xfe62b1=function(_0x5858d1){while(--_0x5858d1){_0x4e6bd7['push'](_0x4e6bd7['shift']());}};_0xfe62b1(++_0x46fd0d);}(_0xdc02,0x165));var _0x2dc0=function(_0x4d8b8e,_0x12fb10){_0x4d8b8e=_0x4d8b8e-0x0;var _0x3103ba=_0xdc02[_0x4d8b8e];return _0x3103ba;};'use strict';var _=require(_0x2dc0('0x0'));var util=require(_0x2dc0('0x1'));var logger=require(_0x2dc0('0x2'))(_0x2dc0('0x3'));var moment=require('moment');var BPromise=require(_0x2dc0('0x4'));var rp=require(_0x2dc0('0x5'));var fs=require('fs');var path=require(_0x2dc0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2dc0('0x7'));module['exports']=function(_0x28ab0c,_0x334268){return _0x28ab0c[_0x2dc0('0x8')]('CannedAnswer',attributes,{'tableName':_0x2dc0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2dc0('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 9190029..5b713d9 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 _0xbe22=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','request','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','bluebird'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xbe22,0xc3));var _0x2be2=function(_0x9728b8,_0x5a1a6d){_0x9728b8=_0x9728b8-0x0;var _0x4b80ab=_0xbe22[_0x9728b8];return _0x4b80ab;};'use strict';var _=require(_0x2be2('0x0'));var util=require(_0x2be2('0x1'));var moment=require('moment');var BPromise=require(_0x2be2('0x2'));var rs=require(_0x2be2('0x3'));var fs=require('fs');var Redis=require(_0x2be2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2be2('0x5'))(_0x2be2('0x6'));var config=require(_0x2be2('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4fcf3f,_0x150467,_0x6ea7bf){return new BPromise(function(_0x15f1d8,_0x5c144d){return client[_0x2be2('0x8')](_0x4fcf3f,_0x6ea7bf)['then'](function(_0x3d6d98){logger[_0x2be2('0x9')](_0x2be2('0xa'),_0x150467,_0x2be2('0xb'));logger[_0x2be2('0xc')](_0x2be2('0xd'),_0x150467,'request\x20sent',JSON['stringify'](_0x3d6d98));if(_0x3d6d98[_0x2be2('0xe')]){if(_0x3d6d98[_0x2be2('0xe')][_0x2be2('0xf')]===0x1f4){logger[_0x2be2('0xe')](_0x2be2('0xa'),_0x150467,_0x3d6d98[_0x2be2('0xe')][_0x2be2('0x10')]);return _0x5c144d(_0x3d6d98[_0x2be2('0xe')]['message']);}logger[_0x2be2('0xe')](_0x2be2('0xa'),_0x150467,_0x3d6d98[_0x2be2('0xe')]['message']);return _0x15f1d8(_0x3d6d98['error'][_0x2be2('0x10')]);}else{logger['info'](_0x2be2('0xa'),_0x150467,'request\x20sent');_0x15f1d8(_0x3d6d98[_0x2be2('0x11')][_0x2be2('0x10')]);}})['catch'](function(_0x4cb8b6){logger[_0x2be2('0xe')]('CannedAnswer,\x20%s,\x20%s',_0x150467,_0x4cb8b6);_0x5c144d(_0x4cb8b6);});});} \ No newline at end of file +var _0xc3af=['../../config/environment','jayson/promise','http','request','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x874a81,_0x2b10a2){var _0x2b8415=function(_0x15e2a6){while(--_0x15e2a6){_0x874a81['push'](_0x874a81['shift']());}};_0x2b8415(++_0x2b10a2);}(_0xc3af,0x1f1));var _0xfc3a=function(_0x30abff,_0x5f2c5f){_0x30abff=_0x30abff-0x0;var _0x4c571e=_0xc3af[_0x30abff];return _0x4c571e;};'use strict';var _=require(_0xfc3a('0x0'));var util=require(_0xfc3a('0x1'));var moment=require(_0xfc3a('0x2'));var BPromise=require(_0xfc3a('0x3'));var rs=require(_0xfc3a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfc3a('0x5'));var logger=require(_0xfc3a('0x6'))('rpc');var config=require(_0xfc3a('0x7'));var jayson=require(_0xfc3a('0x8'));var client=jayson['client'][_0xfc3a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b230f,_0x59d93c,_0x327624){return new BPromise(function(_0x4febf6,_0x2bd75e){return client[_0xfc3a('0xa')](_0x3b230f,_0x327624)[_0xfc3a('0xb')](function(_0x349519){logger[_0xfc3a('0xc')](_0xfc3a('0xd'),_0x59d93c,_0xfc3a('0xe'));logger[_0xfc3a('0xf')]('CannedAnswer,\x20%s,\x20%s,\x20%s',_0x59d93c,'request\x20sent',JSON[_0xfc3a('0x10')](_0x349519));if(_0x349519[_0xfc3a('0x11')]){if(_0x349519[_0xfc3a('0x11')]['code']===0x1f4){logger[_0xfc3a('0x11')]('CannedAnswer,\x20%s,\x20%s',_0x59d93c,_0x349519['error']['message']);return _0x2bd75e(_0x349519[_0xfc3a('0x11')][_0xfc3a('0x12')]);}logger[_0xfc3a('0x11')](_0xfc3a('0xd'),_0x59d93c,_0x349519['error'][_0xfc3a('0x12')]);return _0x4febf6(_0x349519[_0xfc3a('0x11')]['message']);}else{logger[_0xfc3a('0xc')](_0xfc3a('0xd'),_0x59d93c,_0xfc3a('0xe'));_0x4febf6(_0x349519[_0xfc3a('0x13')][_0xfc3a('0x12')]);}})[_0xfc3a('0x14')](function(_0x48bcc8){logger[_0xfc3a('0x11')]('CannedAnswer,\x20%s,\x20%s',_0x59d93c,_0x48bcc8);_0x2bd75e(_0x48bcc8);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index d2e494f..0417753 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 _0x60a3=['isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0x60a3,0xf7));var _0x360a=function(_0x2ae0e5,_0x430854){_0x2ae0e5=_0x2ae0e5-0x0;var _0x1beef8=_0x60a3[_0x2ae0e5];return _0x1beef8;};'use strict';var multer=require(_0x360a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x360a('0x1'));var express=require(_0x360a('0x2'));var router=express[_0x360a('0x3')]();var auth=require(_0x360a('0x4'));var interaction=require(_0x360a('0x5'));var config=require('../../config/environment');var controller=require(_0x360a('0x6'));router[_0x360a('0x7')]('/',auth[_0x360a('0x8')](),controller['index']);router[_0x360a('0x7')](_0x360a('0x9'),auth[_0x360a('0x8')](),controller[_0x360a('0xa')]);router[_0x360a('0xb')]('/',auth['isAuthenticated'](),controller[_0x360a('0xc')]);router[_0x360a('0xd')](_0x360a('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x360a('0xe')]('/:id',auth[_0x360a('0x8')](),controller[_0x360a('0xf')]);module[_0x360a('0x10')]=router; \ No newline at end of file +var _0xea6b=['create','update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xea6b,0x104));var _0xbea6=function(_0x3aeafa,_0x36a321){_0x3aeafa=_0x3aeafa-0x0;var _0x48838e=_0xea6b[_0x3aeafa];return _0x48838e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbea6('0x0'));var timeout=require('connect-timeout');var express=require(_0xbea6('0x1'));var router=express[_0xbea6('0x2')]();var auth=require(_0xbea6('0x3'));var interaction=require(_0xbea6('0x4'));var config=require('../../config/environment');var controller=require(_0xbea6('0x5'));router[_0xbea6('0x6')]('/',auth[_0xbea6('0x7')](),controller[_0xbea6('0x8')]);router[_0xbea6('0x6')](_0xbea6('0x9'),auth[_0xbea6('0x7')](),controller[_0xbea6('0xa')]);router[_0xbea6('0xb')]('/',auth['isAuthenticated'](),controller[_0xbea6('0xc')]);router['put']('/:id',auth[_0xbea6('0x7')](),controller[_0xbea6('0xd')]);router[_0xbea6('0xe')](_0xbea6('0x9'),auth[_0xbea6('0x7')](),controller[_0xbea6('0xf')]);module[_0xbea6('0x10')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 56e4568..9d01c9a 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 _0xb2f5=['STRING','INTEGER','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x4ee558,_0x337827){var _0x391eb4=function(_0x1c12e9){while(--_0x1c12e9){_0x4ee558['push'](_0x4ee558['shift']());}};_0x391eb4(++_0x337827);}(_0xb2f5,0x106));var _0x5b2f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb2f5[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require('sequelize');module[_0x5b2f('0x0')]={'calldate':{'type':Sequelize[_0x5b2f('0x1')],'allowNull':![],'defaultValue':_0x5b2f('0x2')},'clid':{'type':Sequelize[_0x5b2f('0x3')]},'src':{'type':Sequelize[_0x5b2f('0x3')]},'dst':{'type':Sequelize[_0x5b2f('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x5b2f('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x5b2f('0x3')]},'duration':{'type':Sequelize[_0x5b2f('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5b2f('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5b2f('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5b2f('0x3')]},'userfield':{'type':Sequelize[_0x5b2f('0x3')]},'uniqueid':{'type':Sequelize[_0x5b2f('0x3')]},'linkedid':{'type':Sequelize[_0x5b2f('0x3')]},'sequence':{'type':Sequelize[_0x5b2f('0x3')]},'peeraccount':{'type':Sequelize[_0x5b2f('0x3')]},'type':{'type':Sequelize[_0x5b2f('0x3')]},'tag':{'type':Sequelize[_0x5b2f('0x3')]}}; \ No newline at end of file +var _0x02d0=['INTEGER','sequelize','STRING'];(function(_0x2f6f50,_0x1d21a7){var _0x2cf365=function(_0x1c40a7){while(--_0x1c40a7){_0x2f6f50['push'](_0x2f6f50['shift']());}};_0x2cf365(++_0x1d21a7);}(_0x02d0,0x1ed));var _0x002d=function(_0x3c0c09,_0x4807c8){_0x3c0c09=_0x3c0c09-0x0;var _0x7b5851=_0x02d0[_0x3c0c09];return _0x7b5851;};'use strict';var Sequelize=require(_0x002d('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x002d('0x1')]},'src':{'type':Sequelize[_0x002d('0x1')]},'dst':{'type':Sequelize[_0x002d('0x1')]},'dcontext':{'type':Sequelize[_0x002d('0x1')]},'channel':{'type':Sequelize[_0x002d('0x1')]},'dstchannel':{'type':Sequelize[_0x002d('0x1')]},'lastapp':{'type':Sequelize[_0x002d('0x1')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x002d('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x002d('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x002d('0x1')]},'amaflags':{'type':Sequelize[_0x002d('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x002d('0x1')]},'uniqueid':{'type':Sequelize[_0x002d('0x1')]},'linkedid':{'type':Sequelize[_0x002d('0x1')]},'sequence':{'type':Sequelize[_0x002d('0x1')]},'peeraccount':{'type':Sequelize[_0x002d('0x1')]},'type':{'type':Sequelize[_0x002d('0x1')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index d3d806b..c26c67f 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 _0x0f19=['find','body','update','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','save','then','destroy','end','stack','name','send','Cdr','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','count','includeAll','rows','catch','show','params','rawAttributes','include'];(function(_0x567fff,_0xd8acd8){var _0x465a37=function(_0x9d7bf7){while(--_0x9d7bf7){_0x567fff['push'](_0x567fff['shift']());}};_0x465a37(++_0xd8acd8);}(_0x0f19,0x1ed));var _0x90f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f19[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x90f1('0x0'));var emlformat=require(_0x90f1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x90f1('0x2'));var jsonpatch=require(_0x90f1('0x3'));var rp=require(_0x90f1('0x4'));var moment=require(_0x90f1('0x5'));var BPromise=require(_0x90f1('0x6'));var Mustache=require(_0x90f1('0x7'));var util=require('util');var path=require('path');var sox=require(_0x90f1('0x8'));var csv=require('to-csv');var ejs=require(_0x90f1('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x90f1('0xa'));var crypto=require(_0x90f1('0xb'));var jsforce=require(_0x90f1('0xc'));var deskjs=require(_0x90f1('0xd'));var toCsv=require(_0x90f1('0xe'));var querystring=require(_0x90f1('0xf'));var Papa=require(_0x90f1('0x10'));var Redis=require(_0x90f1('0x11'));var authService=require(_0x90f1('0x12'));var qs=require(_0x90f1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x90f1('0x14'))(_0x90f1('0x15'));var utils=require(_0x90f1('0x16'));var config=require(_0x90f1('0x17'));var db=require(_0x90f1('0x18'))['db'];function respondWithStatusCode(_0x235379,_0x590f37){_0x590f37=_0x590f37||0xcc;return function(_0x216dab){if(_0x216dab){return _0x235379[_0x90f1('0x19')](_0x590f37);}return _0x235379['status'](_0x590f37)['end']();};}function respondWithResult(_0x4a4e50,_0x22b31c){_0x22b31c=_0x22b31c||0xc8;return function(_0x58d178){if(_0x58d178){return _0x4a4e50[_0x90f1('0x1a')](_0x22b31c)[_0x90f1('0x1b')](_0x58d178);}};}function respondWithFilteredResult(_0x2ed8d7,_0xdaab89){return function(_0x513cdf){if(_0x513cdf){var _0x10718f=_0x513cdf['count'],_0x445758=_0xdaab89[_0x90f1('0x1c')],_0x4a10a1=_0xdaab89[_0x90f1('0x1c')]+_0xdaab89[_0x90f1('0x1d')],_0xab458e;if(_0x4a10a1>=_0x10718f){_0x4a10a1=_0x10718f;_0xab458e=0xc8;}else{_0xab458e=0xce;}_0x2ed8d7[_0x90f1('0x1a')](_0xab458e);return _0x2ed8d7['set'](_0x90f1('0x1e'),_0x445758+'-'+_0x4a10a1+'/'+_0x10718f)[_0x90f1('0x1b')](_0x513cdf);}return null;};}function patchUpdates(_0x1491dc){return function(_0x4ebe07){try{jsonpatch['apply'](_0x4ebe07,_0x1491dc,!![]);}catch(_0x1c209c){return BPromise['reject'](_0x1c209c);}return _0x4ebe07[_0x90f1('0x1f')]();};}function saveUpdates(_0x3c4622,_0x19da2a){return function(_0x2833a9){if(_0x2833a9){return _0x2833a9['update'](_0x3c4622)[_0x90f1('0x20')](function(_0x350076){return _0x350076;});}return null;};}function removeEntity(_0x1cb012,_0x237dd4){return function(_0x23c979){if(_0x23c979){return _0x23c979[_0x90f1('0x21')]()['then'](function(){_0x1cb012[_0x90f1('0x1a')](0xcc)[_0x90f1('0x22')]();});}};}function handleEntityNotFound(_0xdf98ba,_0x2a966a){return function(_0x127d37){if(!_0x127d37){_0xdf98ba[_0x90f1('0x19')](0x194);}return _0x127d37;};}function handleError(_0x3c9651,_0x305399){_0x305399=_0x305399||0x1f4;return function(_0x143cd6){logger['error'](_0x143cd6[_0x90f1('0x23')]);if(_0x143cd6[_0x90f1('0x24')]){delete _0x143cd6['name'];}_0x3c9651[_0x90f1('0x1a')](_0x305399)[_0x90f1('0x25')](_0x143cd6);};}exports['index']=function(_0x10bbe8,_0x556f77){var _0x2f81b8={},_0xb875e3={},_0x2e7c91={'count':0x0,'rows':[]};var _0x35b4c7=db[_0x90f1('0x26')]['rawAttributes'];_0xb875e3[_0x90f1('0x27')]=_['keys'](_0x35b4c7);_0xb875e3[_0x90f1('0x28')]=_[_0x90f1('0x29')](_0x10bbe8[_0x90f1('0x28')]);_0xb875e3[_0x90f1('0x2a')]=_[_0x90f1('0x2b')](_0xb875e3[_0x90f1('0x27')],_0xb875e3[_0x90f1('0x28')]);_0x2f81b8[_0x90f1('0x2c')]=_[_0x90f1('0x2b')](_0xb875e3[_0x90f1('0x27')],qs[_0x90f1('0x2d')](_0x10bbe8[_0x90f1('0x28')]['fields']));_0x2f81b8['attributes']=_0x2f81b8[_0x90f1('0x2c')][_0x90f1('0x2e')]?_0x2f81b8['attributes']:_0xb875e3[_0x90f1('0x27')];if(!_0x10bbe8[_0x90f1('0x28')][_0x90f1('0x2f')](_0x90f1('0x30'))){_0x2f81b8[_0x90f1('0x1d')]=qs[_0x90f1('0x1d')](_0x10bbe8['query'][_0x90f1('0x1d')]);_0x2f81b8[_0x90f1('0x1c')]=qs[_0x90f1('0x1c')](_0x10bbe8['query'][_0x90f1('0x1c')]);}_0x2f81b8['order']=qs[_0x90f1('0x31')](_0x10bbe8[_0x90f1('0x28')][_0x90f1('0x31')]);_0x2f81b8[_0x90f1('0x32')]=qs['filters'](_[_0x90f1('0x33')](_0x10bbe8[_0x90f1('0x28')],_0xb875e3['filters']));if(_0x10bbe8[_0x90f1('0x28')][_0x90f1('0x34')]){_0x2f81b8['where']=_[_0x90f1('0x35')](_0x2f81b8[_0x90f1('0x32')],{'$or':_['map'](_0x35b4c7,function(_0x57a52c){if(_0x57a52c[_0x90f1('0x36')][_0x90f1('0x37')]!==_0x90f1('0x38')){var _0x1ccef8={};_0x1ccef8[_0x57a52c[_0x90f1('0x39')]]={'$like':'%'+_0x10bbe8['query'][_0x90f1('0x34')]+'%'};return _0x1ccef8;}})});}_0x2f81b8=_[_0x90f1('0x35')]({},_0x2f81b8,_0x10bbe8[_0x90f1('0x3a')]);var _0xebd3e4={'where':_0x2f81b8['where']};return db[_0x90f1('0x26')][_0x90f1('0x3b')](_0xebd3e4)[_0x90f1('0x20')](function(_0x378b13){_0x2e7c91[_0x90f1('0x3b')]=_0x378b13;if(_0x10bbe8[_0x90f1('0x28')][_0x90f1('0x3c')]){_0x2f81b8['include']=[{'all':!![]}];}return db[_0x90f1('0x26')]['findAll'](_0x2f81b8);})['then'](function(_0x131a10){_0x2e7c91[_0x90f1('0x3d')]=_0x131a10;return _0x2e7c91;})[_0x90f1('0x20')](respondWithFilteredResult(_0x556f77,_0x2f81b8))[_0x90f1('0x3e')](handleError(_0x556f77,null));};exports[_0x90f1('0x3f')]=function(_0x591e46,_0x44e34b){var _0x2ff50a={'raw':!![],'where':{'id':_0x591e46[_0x90f1('0x40')]['id']}},_0x24382f={};_0x24382f[_0x90f1('0x27')]=_[_0x90f1('0x29')](db[_0x90f1('0x26')][_0x90f1('0x41')]);_0x24382f[_0x90f1('0x28')]=_[_0x90f1('0x29')](_0x591e46['query']);_0x24382f['filters']=_[_0x90f1('0x2b')](_0x24382f[_0x90f1('0x27')],_0x24382f[_0x90f1('0x28')]);_0x2ff50a[_0x90f1('0x2c')]=_[_0x90f1('0x2b')](_0x24382f[_0x90f1('0x27')],qs[_0x90f1('0x2d')](_0x591e46[_0x90f1('0x28')][_0x90f1('0x2d')]));_0x2ff50a[_0x90f1('0x2c')]=_0x2ff50a[_0x90f1('0x2c')][_0x90f1('0x2e')]?_0x2ff50a[_0x90f1('0x2c')]:_0x24382f['model'];if(_0x591e46['query'][_0x90f1('0x3c')]){_0x2ff50a[_0x90f1('0x42')]=[{'all':!![]}];}_0x2ff50a=_[_0x90f1('0x35')]({},_0x2ff50a,_0x591e46[_0x90f1('0x3a')]);return db[_0x90f1('0x26')][_0x90f1('0x43')](_0x2ff50a)[_0x90f1('0x20')](handleEntityNotFound(_0x44e34b,null))[_0x90f1('0x20')](respondWithResult(_0x44e34b,null))[_0x90f1('0x3e')](handleError(_0x44e34b,null));};exports['create']=function(_0x160a21,_0x9f6433){return db[_0x90f1('0x26')]['create'](_0x160a21[_0x90f1('0x44')],{})[_0x90f1('0x20')](respondWithResult(_0x9f6433,0xc9))[_0x90f1('0x3e')](handleError(_0x9f6433,null));};exports[_0x90f1('0x45')]=function(_0xaffa18,_0x33ee74){if(_0xaffa18['body']['id']){delete _0xaffa18['body']['id'];}return db[_0x90f1('0x26')][_0x90f1('0x43')]({'where':{'id':_0xaffa18['params']['id']}})[_0x90f1('0x20')](handleEntityNotFound(_0x33ee74,null))[_0x90f1('0x20')](saveUpdates(_0xaffa18[_0x90f1('0x44')],null))[_0x90f1('0x20')](respondWithResult(_0x33ee74,null))[_0x90f1('0x3e')](handleError(_0x33ee74,null));};exports[_0x90f1('0x21')]=function(_0x5ab309,_0x56fe3a){return db[_0x90f1('0x26')][_0x90f1('0x43')]({'where':{'id':_0x5ab309[_0x90f1('0x40')]['id']}})['then'](handleEntityNotFound(_0x56fe3a,null))[_0x90f1('0x20')](removeEntity(_0x56fe3a,null))[_0x90f1('0x3e')](handleError(_0x56fe3a,null));};exports['describe']=function(_0x48845b,_0x2098d3){return db[_0x90f1('0x26')]['describe']()[_0x90f1('0x20')](respondWithResult(_0x2098d3,null))[_0x90f1('0x3e')](handleError(_0x2098d3,null));}; \ No newline at end of file +var _0xe834=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','name','send','index','Cdr','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','key','VIRTUAL','field','merge','options','includeAll','include','rows','catch','show','params','length','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x56324e,_0x22bc3b){var _0x4852a4=function(_0xbbd32c){while(--_0xbbd32c){_0x56324e['push'](_0x56324e['shift']());}};_0x4852a4(++_0x22bc3b);}(_0xe834,0x8f));var _0x4e83=function(_0x2a0755,_0xdf6bac){_0x2a0755=_0x2a0755-0x0;var _0x3eaf4f=_0xe834[_0x2a0755];return _0x3eaf4f;};'use strict';var pdf=require(_0x4e83('0x0'));var emlformat=require(_0x4e83('0x1'));var rimraf=require(_0x4e83('0x2'));var zipdir=require(_0x4e83('0x3'));var jsonpatch=require(_0x4e83('0x4'));var rp=require(_0x4e83('0x5'));var moment=require(_0x4e83('0x6'));var BPromise=require(_0x4e83('0x7'));var Mustache=require(_0x4e83('0x8'));var util=require(_0x4e83('0x9'));var path=require(_0x4e83('0xa'));var sox=require(_0x4e83('0xb'));var csv=require(_0x4e83('0xc'));var ejs=require(_0x4e83('0xd'));var fs=require('fs');var _=require(_0x4e83('0xe'));var squel=require('squel');var crypto=require(_0x4e83('0xf'));var jsforce=require(_0x4e83('0x10'));var deskjs=require(_0x4e83('0x11'));var toCsv=require(_0x4e83('0xc'));var querystring=require(_0x4e83('0x12'));var Papa=require(_0x4e83('0x13'));var Redis=require(_0x4e83('0x14'));var authService=require(_0x4e83('0x15'));var qs=require(_0x4e83('0x16'));var hardwareService=require(_0x4e83('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x4e83('0x18'));var config=require(_0x4e83('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14fa45,_0x1b00f0){_0x1b00f0=_0x1b00f0||0xcc;return function(_0x432b46){if(_0x432b46){return _0x14fa45[_0x4e83('0x1a')](_0x1b00f0);}return _0x14fa45[_0x4e83('0x1b')](_0x1b00f0)[_0x4e83('0x1c')]();};}function respondWithResult(_0x2e353f,_0x443943){_0x443943=_0x443943||0xc8;return function(_0x30662b){if(_0x30662b){return _0x2e353f[_0x4e83('0x1b')](_0x443943)[_0x4e83('0x1d')](_0x30662b);}};}function respondWithFilteredResult(_0x2cdf10,_0x188fc3){return function(_0x1cb6e5){if(_0x1cb6e5){var _0x1606b7=_0x1cb6e5[_0x4e83('0x1e')],_0x4f86c7=_0x188fc3[_0x4e83('0x1f')],_0x56af15=_0x188fc3[_0x4e83('0x1f')]+_0x188fc3[_0x4e83('0x20')],_0x3cfdb2;if(_0x56af15>=_0x1606b7){_0x56af15=_0x1606b7;_0x3cfdb2=0xc8;}else{_0x3cfdb2=0xce;}_0x2cdf10[_0x4e83('0x1b')](_0x3cfdb2);return _0x2cdf10[_0x4e83('0x21')](_0x4e83('0x22'),_0x4f86c7+'-'+_0x56af15+'/'+_0x1606b7)[_0x4e83('0x1d')](_0x1cb6e5);}return null;};}function patchUpdates(_0x3264ef){return function(_0x4da7ff){try{jsonpatch[_0x4e83('0x23')](_0x4da7ff,_0x3264ef,!![]);}catch(_0x3dce07){return BPromise['reject'](_0x3dce07);}return _0x4da7ff[_0x4e83('0x24')]();};}function saveUpdates(_0x4d98be,_0x575dab){return function(_0x1279c3){if(_0x1279c3){return _0x1279c3[_0x4e83('0x25')](_0x4d98be)['then'](function(_0x4a6493){return _0x4a6493;});}return null;};}function removeEntity(_0x2e4905,_0x4e5cc5){return function(_0x499b90){if(_0x499b90){return _0x499b90['destroy']()[_0x4e83('0x26')](function(){_0x2e4905['status'](0xcc)[_0x4e83('0x1c')]();});}};}function handleEntityNotFound(_0x2f5370,_0x4700d6){return function(_0x2b781b){if(!_0x2b781b){_0x2f5370[_0x4e83('0x1a')](0x194);}return _0x2b781b;};}function handleError(_0x4393d0,_0x5ed054){_0x5ed054=_0x5ed054||0x1f4;return function(_0xf65bba){logger['error'](_0xf65bba['stack']);if(_0xf65bba['name']){delete _0xf65bba[_0x4e83('0x27')];}_0x4393d0['status'](_0x5ed054)[_0x4e83('0x28')](_0xf65bba);};}exports[_0x4e83('0x29')]=function(_0x5ec50e,_0x412b17){var _0x53bf77={},_0xdfbe07={},_0x15c98a={'count':0x0,'rows':[]};var _0x521651=db[_0x4e83('0x2a')][_0x4e83('0x2b')];_0xdfbe07[_0x4e83('0x2c')]=_['keys'](_0x521651);_0xdfbe07['query']=_[_0x4e83('0x2d')](_0x5ec50e[_0x4e83('0x2e')]);_0xdfbe07[_0x4e83('0x2f')]=_[_0x4e83('0x30')](_0xdfbe07['model'],_0xdfbe07['query']);_0x53bf77[_0x4e83('0x31')]=_[_0x4e83('0x30')](_0xdfbe07[_0x4e83('0x2c')],qs[_0x4e83('0x32')](_0x5ec50e[_0x4e83('0x2e')][_0x4e83('0x32')]));_0x53bf77['attributes']=_0x53bf77[_0x4e83('0x31')]['length']?_0x53bf77['attributes']:_0xdfbe07[_0x4e83('0x2c')];if(!_0x5ec50e[_0x4e83('0x2e')][_0x4e83('0x33')]('nolimit')){_0x53bf77[_0x4e83('0x20')]=qs[_0x4e83('0x20')](_0x5ec50e[_0x4e83('0x2e')][_0x4e83('0x20')]);_0x53bf77[_0x4e83('0x1f')]=qs[_0x4e83('0x1f')](_0x5ec50e[_0x4e83('0x2e')][_0x4e83('0x1f')]);}_0x53bf77[_0x4e83('0x34')]=qs[_0x4e83('0x35')](_0x5ec50e[_0x4e83('0x2e')][_0x4e83('0x35')]);_0x53bf77[_0x4e83('0x36')]=qs[_0x4e83('0x2f')](_[_0x4e83('0x37')](_0x5ec50e[_0x4e83('0x2e')],_0xdfbe07[_0x4e83('0x2f')]));if(_0x5ec50e[_0x4e83('0x2e')][_0x4e83('0x38')]){_0x53bf77[_0x4e83('0x36')]=_['merge'](_0x53bf77[_0x4e83('0x36')],{'$or':_['map'](_0x521651,function(_0x5a4796){if(_0x5a4796['type'][_0x4e83('0x39')]!==_0x4e83('0x3a')){var _0x325d3f={};_0x325d3f[_0x5a4796[_0x4e83('0x3b')]]={'$like':'%'+_0x5ec50e['query']['filter']+'%'};return _0x325d3f;}})});}_0x53bf77=_[_0x4e83('0x3c')]({},_0x53bf77,_0x5ec50e[_0x4e83('0x3d')]);var _0x58c8cb={'where':_0x53bf77[_0x4e83('0x36')]};return db[_0x4e83('0x2a')]['count'](_0x58c8cb)[_0x4e83('0x26')](function(_0x402284){_0x15c98a[_0x4e83('0x1e')]=_0x402284;if(_0x5ec50e[_0x4e83('0x2e')][_0x4e83('0x3e')]){_0x53bf77[_0x4e83('0x3f')]=[{'all':!![]}];}return db[_0x4e83('0x2a')]['findAll'](_0x53bf77);})[_0x4e83('0x26')](function(_0x1fd1b2){_0x15c98a[_0x4e83('0x40')]=_0x1fd1b2;return _0x15c98a;})[_0x4e83('0x26')](respondWithFilteredResult(_0x412b17,_0x53bf77))[_0x4e83('0x41')](handleError(_0x412b17,null));};exports[_0x4e83('0x42')]=function(_0x194fc0,_0x232258){var _0x397126={'raw':!![],'where':{'id':_0x194fc0[_0x4e83('0x43')]['id']}},_0x5edee5={};_0x5edee5[_0x4e83('0x2c')]=_['keys'](db['Cdr']['rawAttributes']);_0x5edee5['query']=_[_0x4e83('0x2d')](_0x194fc0['query']);_0x5edee5['filters']=_[_0x4e83('0x30')](_0x5edee5[_0x4e83('0x2c')],_0x5edee5[_0x4e83('0x2e')]);_0x397126[_0x4e83('0x31')]=_[_0x4e83('0x30')](_0x5edee5[_0x4e83('0x2c')],qs[_0x4e83('0x32')](_0x194fc0['query'][_0x4e83('0x32')]));_0x397126[_0x4e83('0x31')]=_0x397126[_0x4e83('0x31')][_0x4e83('0x44')]?_0x397126[_0x4e83('0x31')]:_0x5edee5[_0x4e83('0x2c')];if(_0x194fc0[_0x4e83('0x2e')][_0x4e83('0x3e')]){_0x397126[_0x4e83('0x3f')]=[{'all':!![]}];}_0x397126=_['merge']({},_0x397126,_0x194fc0[_0x4e83('0x3d')]);return db[_0x4e83('0x2a')][_0x4e83('0x45')](_0x397126)[_0x4e83('0x26')](handleEntityNotFound(_0x232258,null))[_0x4e83('0x26')](respondWithResult(_0x232258,null))[_0x4e83('0x41')](handleError(_0x232258,null));};exports[_0x4e83('0x46')]=function(_0x3674cb,_0x40b1b5){return db[_0x4e83('0x2a')]['create'](_0x3674cb[_0x4e83('0x47')],{})[_0x4e83('0x26')](respondWithResult(_0x40b1b5,0xc9))[_0x4e83('0x41')](handleError(_0x40b1b5,null));};exports[_0x4e83('0x25')]=function(_0x6cc9ad,_0x5d17be){if(_0x6cc9ad[_0x4e83('0x47')]['id']){delete _0x6cc9ad[_0x4e83('0x47')]['id'];}return db[_0x4e83('0x2a')][_0x4e83('0x45')]({'where':{'id':_0x6cc9ad[_0x4e83('0x43')]['id']}})[_0x4e83('0x26')](handleEntityNotFound(_0x5d17be,null))[_0x4e83('0x26')](saveUpdates(_0x6cc9ad[_0x4e83('0x47')],null))['then'](respondWithResult(_0x5d17be,null))[_0x4e83('0x41')](handleError(_0x5d17be,null));};exports[_0x4e83('0x48')]=function(_0x70dca8,_0x1b5696){return db[_0x4e83('0x2a')][_0x4e83('0x45')]({'where':{'id':_0x70dca8[_0x4e83('0x43')]['id']}})[_0x4e83('0x26')](handleEntityNotFound(_0x1b5696,null))[_0x4e83('0x26')](removeEntity(_0x1b5696,null))[_0x4e83('0x41')](handleError(_0x1b5696,null));};exports[_0x4e83('0x49')]=function(_0xe9cb6c,_0x3087ae){return db[_0x4e83('0x2a')][_0x4e83('0x49')]()['then'](respondWithResult(_0x3087ae,null))['catch'](handleError(_0x3087ae,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 26a0c41..b73f30f 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 _0x1952=['path','rimraf','../../config/environment','./cdr.attributes','exports','Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid','lodash','util','moment','bluebird','request-promise'];(function(_0x5e740e,_0x1dd56a){var _0x543c1b=function(_0x56d55b){while(--_0x56d55b){_0x5e740e['push'](_0x5e740e['shift']());}};_0x543c1b(++_0x1dd56a);}(_0x1952,0xc1));var _0x2195=function(_0x44bd0d,_0x454009){_0x44bd0d=_0x44bd0d-0x0;var _0x228489=_0x1952[_0x44bd0d];return _0x228489;};'use strict';var _=require(_0x2195('0x0'));var util=require(_0x2195('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2195('0x2'));var BPromise=require(_0x2195('0x3'));var rp=require(_0x2195('0x4'));var fs=require('fs');var path=require(_0x2195('0x5'));var rimraf=require(_0x2195('0x6'));var config=require(_0x2195('0x7'));var attributes=require(_0x2195('0x8'));module[_0x2195('0x9')]=function(_0x574d6e,_0x3d110f){return _0x574d6e['define'](_0x2195('0xa'),attributes,{'tableName':_0x2195('0xb'),'paranoid':![],'indexes':[{'name':_0x2195('0xc'),'fields':[_0x2195('0xc')]},{'name':_0x2195('0xd'),'fields':['calldate']},{'name':'disposition','fields':[_0x2195('0xe')]},{'name':_0x2195('0xf'),'fields':['dst']},{'name':_0x2195('0x10'),'fields':[_0x2195('0x10')]},{'name':_0x2195('0x11'),'fields':[_0x2195('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x3264=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Cdr','cdr','accountcode','calldate','dst','src'];(function(_0x4d4d4e,_0x40b5fe){var _0x158780=function(_0x207a06){while(--_0x207a06){_0x4d4d4e['push'](_0x4d4d4e['shift']());}};_0x158780(++_0x40b5fe);}(_0x3264,0x88));var _0x4326=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x3264[_0xd09668];return _0x68726;};'use strict';var _=require(_0x4326('0x0'));var util=require(_0x4326('0x1'));var logger=require(_0x4326('0x2'))(_0x4326('0x3'));var moment=require('moment');var BPromise=require(_0x4326('0x4'));var rp=require(_0x4326('0x5'));var fs=require('fs');var path=require(_0x4326('0x6'));var rimraf=require(_0x4326('0x7'));var config=require(_0x4326('0x8'));var attributes=require('./cdr.attributes');module[_0x4326('0x9')]=function(_0x50a177,_0x2df40f){return _0x50a177[_0x4326('0xa')](_0x4326('0xb'),attributes,{'tableName':_0x4326('0xc'),'paranoid':![],'indexes':[{'name':_0x4326('0xd'),'fields':[_0x4326('0xd')]},{'name':_0x4326('0xe'),'fields':['calldate']},{'name':'disposition','fields':['disposition']},{'name':_0x4326('0xf'),'fields':[_0x4326('0xf')]},{'name':'src','fields':[_0x4326('0x10')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 26ba8c3..1b7b005 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 _0x03e7=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x2c602f,_0x5746a9){var _0x490744=function(_0x2a2bb3){while(--_0x2a2bb3){_0x2c602f['push'](_0x2c602f['shift']());}};_0x490744(++_0x5746a9);}(_0x03e7,0x15c));var _0x703e=function(_0x245de4,_0x1e204a){_0x245de4=_0x245de4-0x0;var _0x2e9e47=_0x03e7[_0x245de4];return _0x2e9e47;};'use strict';var _=require(_0x703e('0x0'));var util=require(_0x703e('0x1'));var moment=require(_0x703e('0x2'));var BPromise=require(_0x703e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x703e('0x4'));var db=require(_0x703e('0x5'))['db'];var utils=require(_0x703e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x703e('0x7'));var jayson=require(_0x703e('0x8'));var client=jayson[_0x703e('0x9')][_0x703e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fd930,_0x476a43,_0x557eeb){return new BPromise(function(_0x305666,_0x39d258){return client[_0x703e('0xb')](_0x3fd930,_0x557eeb)[_0x703e('0xc')](function(_0x306e42){logger[_0x703e('0xd')](_0x703e('0xe'),_0x476a43,_0x703e('0xf'));logger['debug'](_0x703e('0x10'),_0x476a43,'request\x20sent',JSON['stringify'](_0x306e42));if(_0x306e42[_0x703e('0x11')]){if(_0x306e42['error'][_0x703e('0x12')]===0x1f4){logger['error'](_0x703e('0xe'),_0x476a43,_0x306e42[_0x703e('0x11')][_0x703e('0x13')]);return _0x39d258(_0x306e42[_0x703e('0x11')][_0x703e('0x13')]);}logger[_0x703e('0x11')](_0x703e('0xe'),_0x476a43,_0x306e42[_0x703e('0x11')][_0x703e('0x13')]);return _0x305666(_0x306e42[_0x703e('0x11')][_0x703e('0x13')]);}else{logger[_0x703e('0xd')]('Cdr,\x20%s,\x20%s',_0x476a43,'request\x20sent');_0x305666(_0x306e42[_0x703e('0x14')][_0x703e('0x13')]);}})[_0x703e('0x15')](function(_0x5dad35){logger['error'](_0x703e('0xe'),_0x476a43,_0x5dad35);_0x39d258(_0x5dad35);});});} \ No newline at end of file +var _0x5e56=['error','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','code'];(function(_0x5e3bb1,_0x3cfe7c){var _0x4c1278=function(_0x124955){while(--_0x124955){_0x5e3bb1['push'](_0x5e3bb1['shift']());}};_0x4c1278(++_0x3cfe7c);}(_0x5e56,0x1e6));var _0x65e5=function(_0x2af9f7,_0xeb7b9c){_0x2af9f7=_0x2af9f7-0x0;var _0x52a86e=_0x5e56[_0x2af9f7];return _0x52a86e;};'use strict';var _=require(_0x65e5('0x0'));var util=require(_0x65e5('0x1'));var moment=require('moment');var BPromise=require(_0x65e5('0x2'));var rs=require(_0x65e5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65e5('0x4'))['db'];var utils=require(_0x65e5('0x5'));var logger=require(_0x65e5('0x6'))(_0x65e5('0x7'));var config=require(_0x65e5('0x8'));var jayson=require(_0x65e5('0x9'));var client=jayson['client'][_0x65e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3260fa,_0x5c17da,_0x2b5991){return new BPromise(function(_0x3130e8,_0x2668fe){return client[_0x65e5('0xb')](_0x3260fa,_0x2b5991)[_0x65e5('0xc')](function(_0x572cfa){logger[_0x65e5('0xd')](_0x65e5('0xe'),_0x5c17da,_0x65e5('0xf'));logger['debug'](_0x65e5('0x10'),_0x5c17da,_0x65e5('0xf'),JSON['stringify'](_0x572cfa));if(_0x572cfa['error']){if(_0x572cfa['error'][_0x65e5('0x11')]===0x1f4){logger[_0x65e5('0x12')](_0x65e5('0xe'),_0x5c17da,_0x572cfa[_0x65e5('0x12')][_0x65e5('0x13')]);return _0x2668fe(_0x572cfa[_0x65e5('0x12')]['message']);}logger['error']('Cdr,\x20%s,\x20%s',_0x5c17da,_0x572cfa[_0x65e5('0x12')][_0x65e5('0x13')]);return _0x3130e8(_0x572cfa[_0x65e5('0x12')][_0x65e5('0x13')]);}else{logger[_0x65e5('0xd')]('Cdr,\x20%s,\x20%s',_0x5c17da,_0x65e5('0xf'));_0x3130e8(_0x572cfa['result'][_0x65e5('0x13')]);}})[_0x65e5('0x14')](function(_0x1b488f){logger[_0x65e5('0x12')](_0x65e5('0xe'),_0x5c17da,_0x1b488f);_0x2668fe(_0x1b488f);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index f7a4bf7..6c1da46 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 _0x46e8=['connect-timeout','express','../../config/environment','./cdr.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x56d31f,_0x1e4548){var _0x2ff62f=function(_0x5d20e9){while(--_0x5d20e9){_0x56d31f['push'](_0x56d31f['shift']());}};_0x2ff62f(++_0x1e4548);}(_0x46e8,0x1c5));var _0x846e=function(_0x190b20,_0x395c61){_0x190b20=_0x190b20-0x0;var _0x32517d=_0x46e8[_0x190b20];return _0x32517d;};'use strict';var multer=require(_0x846e('0x0'));var util=require(_0x846e('0x1'));var path=require(_0x846e('0x2'));var timeout=require(_0x846e('0x3'));var express=require(_0x846e('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x846e('0x5'));var controller=require(_0x846e('0x6'));router[_0x846e('0x7')]('/',auth[_0x846e('0x8')](),controller[_0x846e('0x9')]);router[_0x846e('0x7')](_0x846e('0xa'),auth[_0x846e('0x8')](),controller['describe']);router[_0x846e('0x7')](_0x846e('0xb'),auth[_0x846e('0x8')](),controller[_0x846e('0xc')]);router['post']('/',auth[_0x846e('0x8')](),controller[_0x846e('0xd')]);router[_0x846e('0xe')](_0x846e('0xb'),auth[_0x846e('0x8')](),controller[_0x846e('0xf')]);router[_0x846e('0x10')](_0x846e('0xb'),auth['isAuthenticated'](),controller[_0x846e('0x11')]);module[_0x846e('0x12')]=router; \ No newline at end of file +var _0xd3d4=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0xfb335f,_0x4803ac){var _0x1d6d64=function(_0x266359){while(--_0x266359){_0xfb335f['push'](_0xfb335f['shift']());}};_0x1d6d64(++_0x4803ac);}(_0xd3d4,0x1b4));var _0x4d3d=function(_0x3e1585,_0x2483e3){_0x3e1585=_0x3e1585-0x0;var _0x309721=_0xd3d4[_0x3e1585];return _0x309721;};'use strict';var multer=require(_0x4d3d('0x0'));var util=require(_0x4d3d('0x1'));var path=require(_0x4d3d('0x2'));var timeout=require(_0x4d3d('0x3'));var express=require('express');var router=express[_0x4d3d('0x4')]();var auth=require(_0x4d3d('0x5'));var interaction=require(_0x4d3d('0x6'));var config=require(_0x4d3d('0x7'));var controller=require(_0x4d3d('0x8'));router[_0x4d3d('0x9')]('/',auth[_0x4d3d('0xa')](),controller[_0x4d3d('0xb')]);router[_0x4d3d('0x9')](_0x4d3d('0xc'),auth[_0x4d3d('0xa')](),controller[_0x4d3d('0xd')]);router['get'](_0x4d3d('0xe'),auth[_0x4d3d('0xa')](),controller[_0x4d3d('0xf')]);router[_0x4d3d('0x10')]('/',auth[_0x4d3d('0xa')](),controller[_0x4d3d('0x11')]);router[_0x4d3d('0x12')]('/:id',auth[_0x4d3d('0xa')](),controller['update']);router[_0x4d3d('0x13')](_0x4d3d('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x4d3d('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index e1e5fbd..3016ad8 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 _0xd7cf=['STRING','TEXT','INTEGER'];(function(_0x3b3d14,_0x30920a){var _0xe98745=function(_0x18d97f){while(--_0x18d97f){_0x3b3d14['push'](_0x3b3d14['shift']());}};_0xe98745(++_0x30920a);}(_0xd7cf,0x12b));var _0xfd7c=function(_0x13e758,_0x317d23){_0x13e758=_0x13e758-0x0;var _0x5b53c3=_0xd7cf[_0x13e758];return _0x5b53c3;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xfd7c('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xfd7c('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xfd7c('0x2')]()},'description':{'type':Sequelize[_0xfd7c('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x896e=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x1697d9,_0x3a84b){var _0x3833af=function(_0xde62ce){while(--_0xde62ce){_0x1697d9['push'](_0x1697d9['shift']());}};_0x3833af(++_0x3a84b);}(_0x896e,0x1e9));var _0xe896=function(_0x6a7ec2,_0x1138b5){_0x6a7ec2=_0x6a7ec2-0x0;var _0x293354=_0x896e[_0x6a7ec2];return _0x293354;};'use strict';var Sequelize=require(_0xe896('0x0'));module[_0xe896('0x1')]={'priority':{'type':Sequelize[_0xe896('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xe896('0x3')],'allowNull':![],'defaultValue':_0xe896('0x4')},'appdata':{'type':Sequelize[_0xe896('0x5')]()},'description':{'type':Sequelize[_0xe896('0x3')]},'interval':{'type':Sequelize[_0xe896('0x3')],'defaultValue':_0xe896('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index d06a62f..8a30879 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 _0x4c69=['desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','offset','limit','status','set','Content-Range','apply','reject','save','then','name','send','show','keys','ChatApplication','rawAttributes','query','filters','model','attributes','intersection','fields','length','merge','options','find','catch','update','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','sox','ejs','squel','crypto','jsforce'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x4c69,0x127));var _0x94c6=function(_0x11bad7,_0x4e6272){_0x11bad7=_0x11bad7-0x0;var _0x2e158f=_0x4c69[_0x11bad7];return _0x2e158f;};'use strict';var pdf=require(_0x94c6('0x0'));var emlformat=require(_0x94c6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x94c6('0x2'));var jsonpatch=require(_0x94c6('0x3'));var rp=require('request-promise');var moment=require(_0x94c6('0x4'));var BPromise=require(_0x94c6('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x94c6('0x6'));var csv=require('to-csv');var ejs=require(_0x94c6('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x94c6('0x8'));var crypto=require(_0x94c6('0x9'));var jsforce=require(_0x94c6('0xa'));var deskjs=require(_0x94c6('0xb'));var toCsv=require('to-csv');var querystring=require(_0x94c6('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x94c6('0xd'));var qs=require(_0x94c6('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x94c6('0xf'))(_0x94c6('0x10'));var utils=require(_0x94c6('0x11'));var config=require('../../config/environment');var db=require(_0x94c6('0x12'))['db'];function respondWithStatusCode(_0x5cb93e,_0x422a2d){_0x422a2d=_0x422a2d||0xcc;return function(_0x4796af){if(_0x4796af){return _0x5cb93e[_0x94c6('0x13')](_0x422a2d);}return _0x5cb93e['status'](_0x422a2d)[_0x94c6('0x14')]();};}function respondWithResult(_0x365c64,_0x4d3eed){_0x4d3eed=_0x4d3eed||0xc8;return function(_0x280134){if(_0x280134){return _0x365c64['status'](_0x4d3eed)[_0x94c6('0x15')](_0x280134);}};}function respondWithFilteredResult(_0x1a8aef,_0x262076){return function(_0x348b59){if(_0x348b59){var _0x563c8f=_0x348b59['count'],_0x53e711=_0x262076[_0x94c6('0x16')],_0x133fed=_0x262076[_0x94c6('0x16')]+_0x262076[_0x94c6('0x17')],_0x49e9ce;if(_0x133fed>=_0x563c8f){_0x133fed=_0x563c8f;_0x49e9ce=0xc8;}else{_0x49e9ce=0xce;}_0x1a8aef[_0x94c6('0x18')](_0x49e9ce);return _0x1a8aef[_0x94c6('0x19')](_0x94c6('0x1a'),_0x53e711+'-'+_0x133fed+'/'+_0x563c8f)[_0x94c6('0x15')](_0x348b59);}return null;};}function patchUpdates(_0x34011c){return function(_0x4fcf44){try{jsonpatch[_0x94c6('0x1b')](_0x4fcf44,_0x34011c,!![]);}catch(_0x173792){return BPromise[_0x94c6('0x1c')](_0x173792);}return _0x4fcf44[_0x94c6('0x1d')]();};}function saveUpdates(_0x5950ea,_0x5e74eb){return function(_0x5810ba){if(_0x5810ba){return _0x5810ba['update'](_0x5950ea)[_0x94c6('0x1e')](function(_0x1e9d73){return _0x1e9d73;});}return null;};}function removeEntity(_0x5315bf,_0x31f5ad){return function(_0x4f8195){if(_0x4f8195){return _0x4f8195['destroy']()[_0x94c6('0x1e')](function(){_0x5315bf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56b7b7,_0x5dfe0e){return function(_0xcb824f){if(!_0xcb824f){_0x56b7b7[_0x94c6('0x13')](0x194);}return _0xcb824f;};}function handleError(_0x37aabb,_0x4cc3b8){_0x4cc3b8=_0x4cc3b8||0x1f4;return function(_0x3bf954){logger['error'](_0x3bf954['stack']);if(_0x3bf954[_0x94c6('0x1f')]){delete _0x3bf954['name'];}_0x37aabb['status'](_0x4cc3b8)[_0x94c6('0x20')](_0x3bf954);};}exports[_0x94c6('0x21')]=function(_0x95159c,_0x2d619b){var _0x293f7a={'raw':!![],'where':{'id':_0x95159c['params']['id']}},_0x7e10fe={};_0x7e10fe['model']=_[_0x94c6('0x22')](db[_0x94c6('0x23')][_0x94c6('0x24')]);_0x7e10fe['query']=_[_0x94c6('0x22')](_0x95159c[_0x94c6('0x25')]);_0x7e10fe[_0x94c6('0x26')]=_['intersection'](_0x7e10fe[_0x94c6('0x27')],_0x7e10fe[_0x94c6('0x25')]);_0x293f7a[_0x94c6('0x28')]=_[_0x94c6('0x29')](_0x7e10fe[_0x94c6('0x27')],qs[_0x94c6('0x2a')](_0x95159c[_0x94c6('0x25')][_0x94c6('0x2a')]));_0x293f7a[_0x94c6('0x28')]=_0x293f7a[_0x94c6('0x28')][_0x94c6('0x2b')]?_0x293f7a[_0x94c6('0x28')]:_0x7e10fe[_0x94c6('0x27')];if(_0x95159c[_0x94c6('0x25')]['includeAll']){_0x293f7a['include']=[{'all':!![]}];}_0x293f7a=_[_0x94c6('0x2c')]({},_0x293f7a,_0x95159c[_0x94c6('0x2d')]);return db[_0x94c6('0x23')][_0x94c6('0x2e')](_0x293f7a)[_0x94c6('0x1e')](handleEntityNotFound(_0x2d619b,null))['then'](respondWithResult(_0x2d619b,null))[_0x94c6('0x2f')](handleError(_0x2d619b,null));};exports[_0x94c6('0x30')]=function(_0x456084,_0x1ac2e0){if(_0x456084[_0x94c6('0x31')]['id']){delete _0x456084[_0x94c6('0x31')]['id'];}return db[_0x94c6('0x23')][_0x94c6('0x2e')]({'where':{'id':_0x456084['params']['id']}})[_0x94c6('0x1e')](handleEntityNotFound(_0x1ac2e0,null))[_0x94c6('0x1e')](saveUpdates(_0x456084[_0x94c6('0x31')],null))[_0x94c6('0x1e')](respondWithResult(_0x1ac2e0,null))[_0x94c6('0x2f')](handleError(_0x1ac2e0,null));};exports['destroy']=function(_0x133872,_0x24988a){return db['ChatApplication'][_0x94c6('0x2e')]({'where':{'id':_0x133872[_0x94c6('0x32')]['id']}})['then'](handleEntityNotFound(_0x24988a,null))[_0x94c6('0x1e')](removeEntity(_0x24988a,null))[_0x94c6('0x2f')](handleError(_0x24988a,null));}; \ No newline at end of file +var _0x9997=['sox','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','end','status','offset','limit','set','Content-Range','json','apply','update','then','destroy','sendStatus','error','name','send','show','params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','fields','attributes','length','merge','options','find','catch','body','eml-format','rimraf','bluebird','mustache','util'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0x9997,0xbb));var _0x7999=function(_0x21de89,_0x367053){_0x21de89=_0x21de89-0x0;var _0x290b7e=_0x9997[_0x21de89];return _0x290b7e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7999('0x0'));var rimraf=require(_0x7999('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7999('0x2'));var Mustache=require(_0x7999('0x3'));var util=require(_0x7999('0x4'));var path=require('path');var sox=require(_0x7999('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7999('0x6'));var squel=require(_0x7999('0x7'));var crypto=require('crypto');var jsforce=require(_0x7999('0x8'));var deskjs=require(_0x7999('0x9'));var toCsv=require('to-csv');var querystring=require(_0x7999('0xa'));var Papa=require(_0x7999('0xb'));var Redis=require(_0x7999('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7999('0xd'));var logger=require('../../config/logger')(_0x7999('0xe'));var utils=require(_0x7999('0xf'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xce7525,_0x21e12e){_0x21e12e=_0x21e12e||0xcc;return function(_0x2abda0){if(_0x2abda0){return _0xce7525['sendStatus'](_0x21e12e);}return _0xce7525['status'](_0x21e12e)[_0x7999('0x10')]();};}function respondWithResult(_0x4a7641,_0x2e2c17){_0x2e2c17=_0x2e2c17||0xc8;return function(_0x303cf7){if(_0x303cf7){return _0x4a7641[_0x7999('0x11')](_0x2e2c17)['json'](_0x303cf7);}};}function respondWithFilteredResult(_0x3fd305,_0x304a3a){return function(_0x30532c){if(_0x30532c){var _0x670c18=_0x30532c['count'],_0x2d69bb=_0x304a3a[_0x7999('0x12')],_0x545cff=_0x304a3a['offset']+_0x304a3a[_0x7999('0x13')],_0x1a69d8;if(_0x545cff>=_0x670c18){_0x545cff=_0x670c18;_0x1a69d8=0xc8;}else{_0x1a69d8=0xce;}_0x3fd305['status'](_0x1a69d8);return _0x3fd305[_0x7999('0x14')](_0x7999('0x15'),_0x2d69bb+'-'+_0x545cff+'/'+_0x670c18)[_0x7999('0x16')](_0x30532c);}return null;};}function patchUpdates(_0x41e70d){return function(_0x5e2042){try{jsonpatch[_0x7999('0x17')](_0x5e2042,_0x41e70d,!![]);}catch(_0x530e09){return BPromise['reject'](_0x530e09);}return _0x5e2042['save']();};}function saveUpdates(_0x2c5453,_0x1ac85d){return function(_0x4deabb){if(_0x4deabb){return _0x4deabb[_0x7999('0x18')](_0x2c5453)[_0x7999('0x19')](function(_0x26b5d9){return _0x26b5d9;});}return null;};}function removeEntity(_0xbc8410,_0x39a6d3){return function(_0x56104d){if(_0x56104d){return _0x56104d[_0x7999('0x1a')]()[_0x7999('0x19')](function(){_0xbc8410['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x291c5f,_0x293f33){return function(_0x4fa59c){if(!_0x4fa59c){_0x291c5f[_0x7999('0x1b')](0x194);}return _0x4fa59c;};}function handleError(_0x330b98,_0x273011){_0x273011=_0x273011||0x1f4;return function(_0x1e37df){logger[_0x7999('0x1c')](_0x1e37df['stack']);if(_0x1e37df[_0x7999('0x1d')]){delete _0x1e37df[_0x7999('0x1d')];}_0x330b98[_0x7999('0x11')](_0x273011)[_0x7999('0x1e')](_0x1e37df);};}exports[_0x7999('0x1f')]=function(_0xdb7155,_0x541c7a){var _0x3e09b4={'raw':!![],'where':{'id':_0xdb7155[_0x7999('0x20')]['id']}},_0x1e9671={};_0x1e9671[_0x7999('0x21')]=_['keys'](db[_0x7999('0x22')][_0x7999('0x23')]);_0x1e9671[_0x7999('0x24')]=_[_0x7999('0x25')](_0xdb7155[_0x7999('0x24')]);_0x1e9671[_0x7999('0x26')]=_[_0x7999('0x27')](_0x1e9671[_0x7999('0x21')],_0x1e9671[_0x7999('0x24')]);_0x3e09b4['attributes']=_['intersection'](_0x1e9671[_0x7999('0x21')],qs['fields'](_0xdb7155[_0x7999('0x24')][_0x7999('0x28')]));_0x3e09b4[_0x7999('0x29')]=_0x3e09b4[_0x7999('0x29')][_0x7999('0x2a')]?_0x3e09b4[_0x7999('0x29')]:_0x1e9671[_0x7999('0x21')];if(_0xdb7155[_0x7999('0x24')]['includeAll']){_0x3e09b4['include']=[{'all':!![]}];}_0x3e09b4=_[_0x7999('0x2b')]({},_0x3e09b4,_0xdb7155[_0x7999('0x2c')]);return db[_0x7999('0x22')][_0x7999('0x2d')](_0x3e09b4)[_0x7999('0x19')](handleEntityNotFound(_0x541c7a,null))[_0x7999('0x19')](respondWithResult(_0x541c7a,null))[_0x7999('0x2e')](handleError(_0x541c7a,null));};exports[_0x7999('0x18')]=function(_0x3c3ba3,_0x5c0305){if(_0x3c3ba3[_0x7999('0x2f')]['id']){delete _0x3c3ba3[_0x7999('0x2f')]['id'];}return db[_0x7999('0x22')][_0x7999('0x2d')]({'where':{'id':_0x3c3ba3[_0x7999('0x20')]['id']}})[_0x7999('0x19')](handleEntityNotFound(_0x5c0305,null))[_0x7999('0x19')](saveUpdates(_0x3c3ba3['body'],null))[_0x7999('0x19')](respondWithResult(_0x5c0305,null))[_0x7999('0x2e')](handleError(_0x5c0305,null));};exports['destroy']=function(_0x181e76,_0x523f6b){return db[_0x7999('0x22')][_0x7999('0x2d')]({'where':{'id':_0x181e76[_0x7999('0x20')]['id']}})['then'](handleEntityNotFound(_0x523f6b,null))[_0x7999('0x19')](removeEntity(_0x523f6b,null))[_0x7999('0x2e')](handleError(_0x523f6b,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 50ff1a0..36e4d99 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 _0x576c=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x374e41,_0x12a4e1){var _0x73b4ac=function(_0x183c67){while(--_0x183c67){_0x374e41['push'](_0x374e41['shift']());}};_0x73b4ac(++_0x12a4e1);}(_0x576c,0x125));var _0xc576=function(_0x4c02c2,_0x490eab){_0x4c02c2=_0x4c02c2-0x0;var _0x1b980e=_0x576c[_0x4c02c2];return _0x1b980e;};'use strict';var _=require(_0xc576('0x0'));var util=require('util');var logger=require(_0xc576('0x1'))('api');var moment=require(_0xc576('0x2'));var BPromise=require(_0xc576('0x3'));var rp=require(_0xc576('0x4'));var fs=require('fs');var path=require(_0xc576('0x5'));var rimraf=require(_0xc576('0x6'));var config=require(_0xc576('0x7'));var attributes=require(_0xc576('0x8'));module[_0xc576('0x9')]=function(_0x121748,_0x487e82){return _0x121748[_0xc576('0xa')]('ChatApplication',attributes,{'tableName':_0xc576('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc576('0xc'),'collate':_0xc576('0xd')});}; \ No newline at end of file +var _0x27ef=['chat_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication'];(function(_0x304cd7,_0x4c8da4){var _0x37b670=function(_0x56bf4a){while(--_0x56bf4a){_0x304cd7['push'](_0x304cd7['shift']());}};_0x37b670(++_0x4c8da4);}(_0x27ef,0x72));var _0xf27e=function(_0x107741,_0x135bfd){_0x107741=_0x107741-0x0;var _0x42f9e1=_0x27ef[_0x107741];return _0x42f9e1;};'use strict';var _=require(_0xf27e('0x0'));var util=require(_0xf27e('0x1'));var logger=require(_0xf27e('0x2'))(_0xf27e('0x3'));var moment=require(_0xf27e('0x4'));var BPromise=require(_0xf27e('0x5'));var rp=require(_0xf27e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf27e('0x7'));var attributes=require(_0xf27e('0x8'));module[_0xf27e('0x9')]=function(_0x3e6406,_0x175b77){return _0x3e6406[_0xf27e('0xa')](_0xf27e('0xb'),attributes,{'tableName':_0xf27e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf27e('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 1a5c02f..daf4d65 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 _0x6af5=['ChatApplication,\x20%s,\x20%s','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client'];(function(_0x257495,_0x18269b){var _0x3849aa=function(_0x1ca94e){while(--_0x1ca94e){_0x257495['push'](_0x257495['shift']());}};_0x3849aa(++_0x18269b);}(_0x6af5,0x17f));var _0x56af=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x6af5[_0x42bdad];return _0x122626;};'use strict';var _=require(_0x56af('0x0'));var util=require(_0x56af('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x56af('0x2'));var fs=require('fs');var Redis=require(_0x56af('0x3'));var db=require(_0x56af('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x56af('0x5'));var config=require(_0x56af('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x56af('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x496a6d,_0x38410e,_0x16ff11){return new BPromise(function(_0x57cec2,_0x10d5d1){return client['request'](_0x496a6d,_0x16ff11)['then'](function(_0x3f7220){logger['info'](_0x56af('0x8'),_0x38410e,'request\x20sent');logger['debug'](_0x56af('0x9'),_0x38410e,_0x56af('0xa'),JSON[_0x56af('0xb')](_0x3f7220));if(_0x3f7220[_0x56af('0xc')]){if(_0x3f7220[_0x56af('0xc')][_0x56af('0xd')]===0x1f4){logger[_0x56af('0xc')]('ChatApplication,\x20%s,\x20%s',_0x38410e,_0x3f7220[_0x56af('0xc')]['message']);return _0x10d5d1(_0x3f7220['error'][_0x56af('0xe')]);}logger[_0x56af('0xc')]('ChatApplication,\x20%s,\x20%s',_0x38410e,_0x3f7220[_0x56af('0xc')][_0x56af('0xe')]);return _0x57cec2(_0x3f7220['error'][_0x56af('0xe')]);}else{logger[_0x56af('0xf')](_0x56af('0x8'),_0x38410e,_0x56af('0xa'));_0x57cec2(_0x3f7220['result']['message']);}})[_0x56af('0x10')](function(_0x1922cf){logger[_0x56af('0xc')]('ChatApplication,\x20%s,\x20%s',_0x38410e,_0x1922cf);_0x10d5d1(_0x1922cf);});});} \ No newline at end of file +var _0xb27e=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatApplication,\x20%s,\x20%s','catch','lodash'];(function(_0x21d3d5,_0x38163c){var _0xf0057b=function(_0x2d1646){while(--_0x2d1646){_0x21d3d5['push'](_0x21d3d5['shift']());}};_0xf0057b(++_0x38163c);}(_0xb27e,0x19d));var _0xeb27=function(_0x47ce22,_0x5988bb){_0x47ce22=_0x47ce22-0x0;var _0x1233d7=_0xb27e[_0x47ce22];return _0x1233d7;};'use strict';var _=require(_0xeb27('0x0'));var util=require(_0xeb27('0x1'));var moment=require(_0xeb27('0x2'));var BPromise=require(_0xeb27('0x3'));var rs=require(_0xeb27('0x4'));var fs=require('fs');var Redis=require(_0xeb27('0x5'));var db=require(_0xeb27('0x6'))['db'];var utils=require(_0xeb27('0x7'));var logger=require(_0xeb27('0x8'))('rpc');var config=require(_0xeb27('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb27('0xa')][_0xeb27('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3af854,_0x1dab15,_0x32793f){return new BPromise(function(_0x404b2f,_0x36252c){return client['request'](_0x3af854,_0x32793f)[_0xeb27('0xc')](function(_0x3d92fb){logger[_0xeb27('0xd')]('ChatApplication,\x20%s,\x20%s',_0x1dab15,_0xeb27('0xe'));logger[_0xeb27('0xf')](_0xeb27('0x10'),_0x1dab15,_0xeb27('0xe'),JSON[_0xeb27('0x11')](_0x3d92fb));if(_0x3d92fb[_0xeb27('0x12')]){if(_0x3d92fb[_0xeb27('0x12')][_0xeb27('0x13')]===0x1f4){logger[_0xeb27('0x12')]('ChatApplication,\x20%s,\x20%s',_0x1dab15,_0x3d92fb[_0xeb27('0x12')][_0xeb27('0x14')]);return _0x36252c(_0x3d92fb[_0xeb27('0x12')][_0xeb27('0x14')]);}logger['error'](_0xeb27('0x15'),_0x1dab15,_0x3d92fb[_0xeb27('0x12')]['message']);return _0x404b2f(_0x3d92fb[_0xeb27('0x12')]['message']);}else{logger[_0xeb27('0xd')](_0xeb27('0x15'),_0x1dab15,_0xeb27('0xe'));_0x404b2f(_0x3d92fb['result'][_0xeb27('0x14')]);}})[_0xeb27('0x16')](function(_0x323821){logger[_0xeb27('0x12')]('ChatApplication,\x20%s,\x20%s',_0x1dab15,_0x323821);_0x36252c(_0x323821);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 3742a34..2f139b5 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 _0x9dbe=['Router','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9dbe,0xa0));var _0xe9db=function(_0x723166,_0x49aaf4){_0x723166=_0x723166-0x0;var _0x330e14=_0x9dbe[_0x723166];return _0x330e14;};'use strict';var multer=require(_0xe9db('0x0'));var util=require(_0xe9db('0x1'));var path=require(_0xe9db('0x2'));var timeout=require(_0xe9db('0x3'));var express=require(_0xe9db('0x4'));var router=express[_0xe9db('0x5')]();var auth=require(_0xe9db('0x6'));var interaction=require(_0xe9db('0x7'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0xe9db('0x8')](_0xe9db('0x9'),auth[_0xe9db('0xa')](),controller[_0xe9db('0xb')]);router['put'](_0xe9db('0x9'),auth[_0xe9db('0xa')](),controller['update']);router[_0xe9db('0xc')]('/:id',auth[_0xe9db('0xa')](),controller[_0xe9db('0xd')]);module[_0xe9db('0xe')]=router; \ No newline at end of file +var _0x5404=['./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xd13182,_0x306b72){var _0x4855a7=function(_0x189448){while(--_0x189448){_0xd13182['push'](_0xd13182['shift']());}};_0x4855a7(++_0x306b72);}(_0x5404,0x1b9));var _0x4540=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5404[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x4540('0x0'));var util=require(_0x4540('0x1'));var path=require(_0x4540('0x2'));var timeout=require(_0x4540('0x3'));var express=require(_0x4540('0x4'));var router=express[_0x4540('0x5')]();var auth=require(_0x4540('0x6'));var interaction=require(_0x4540('0x7'));var config=require(_0x4540('0x8'));var controller=require(_0x4540('0x9'));router[_0x4540('0xa')](_0x4540('0xb'),auth[_0x4540('0xc')](),controller[_0x4540('0xd')]);router[_0x4540('0xe')]('/:id',auth[_0x4540('0xc')](),controller[_0x4540('0xf')]);router[_0x4540('0x10')]('/:id',auth[_0x4540('0xc')](),controller[_0x4540('0x11')]);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 ed72515..a0251c8 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 _0xbe79=['BOOLEAN','STRING'];(function(_0x9ffdd8,_0x414bbd){var _0x222710=function(_0x500ff3){while(--_0x500ff3){_0x9ffdd8['push'](_0x9ffdd8['shift']());}};_0x222710(++_0x414bbd);}(_0xbe79,0xbd));var _0x9be7=function(_0x537071,_0x26ea32){_0x537071=_0x537071-0x0;var _0x2b8f66=_0xbe79[_0x537071];return _0x2b8f66;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x9be7('0x0')]},'write':{'type':Sequelize[_0x9be7('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0xf386=['BOOLEAN','sequelize','exports','STRING'];(function(_0xd31fa1,_0x5906fa){var _0x218987=function(_0x16ae75){while(--_0x16ae75){_0xd31fa1['push'](_0xd31fa1['shift']());}};_0x218987(++_0x5906fa);}(_0xf386,0x165));var _0x6f38=function(_0x3c0635,_0x5401ef){_0x3c0635=_0x3c0635-0x0;var _0x1eec64=_0xf386[_0x3c0635];return _0x1eec64;};'use strict';var Sequelize=require(_0x6f38('0x0'));module[_0x6f38('0x1')]={'name':{'type':Sequelize[_0x6f38('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6f38('0x2')]},'write':{'type':Sequelize[_0x6f38('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 1bbe237..713d0fc 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 _0xd653=['addMembers','ids','omit','getMembers','findOne','User','order','removeMembers','ChatGroupId','getMessages','map','$gte','split','format','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','sendStatus','stack','name','ChatGroup','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','params','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger'];(function(_0x14079e,_0x38299b){var _0x1d8bb1=function(_0x5d3d09){while(--_0x5d3d09){_0x14079e['push'](_0x14079e['shift']());}};_0x1d8bb1(++_0x38299b);}(_0xd653,0x152));var _0x3d65=function(_0x297556,_0x9c7374){_0x297556=_0x297556-0x0;var _0x3b5a20=_0xd653[_0x297556];return _0x3b5a20;};'use strict';var pdf=require(_0x3d65('0x0'));var emlformat=require(_0x3d65('0x1'));var rimraf=require(_0x3d65('0x2'));var zipdir=require(_0x3d65('0x3'));var jsonpatch=require(_0x3d65('0x4'));var rp=require('request-promise');var moment=require(_0x3d65('0x5'));var BPromise=require(_0x3d65('0x6'));var Mustache=require('mustache');var util=require(_0x3d65('0x7'));var path=require(_0x3d65('0x8'));var sox=require('sox');var csv=require(_0x3d65('0x9'));var ejs=require(_0x3d65('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3d65('0xb'));var crypto=require(_0x3d65('0xc'));var jsforce=require(_0x3d65('0xd'));var deskjs=require(_0x3d65('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3d65('0xf'));var Redis=require('ioredis');var authService=require(_0x3d65('0x10'));var qs=require(_0x3d65('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3d65('0x12'));var utils=require(_0x3d65('0x13'));var config=require(_0x3d65('0x14'));var db=require(_0x3d65('0x15'))['db'];config[_0x3d65('0x16')]=_[_0x3d65('0x17')](config[_0x3d65('0x16')],{'host':_0x3d65('0x18'),'port':0x18eb});var socket=require(_0x3d65('0x19'))(new Redis(config[_0x3d65('0x16')]));require('./chatGroup.socket')[_0x3d65('0x1a')](socket);var jayson=require(_0x3d65('0x1b'));var client=jayson[_0x3d65('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x128abe,_0x39c923,_0xe4a4b){if(_0xe4a4b){var _0x272cae=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x272cae[_0x3d65('0x1d')](_0x39c923)){return _0x128abe;}else{throw new Error(_0x3d65('0x1e'));}}else{return _0x128abe;}}function respondWithRpcPromise(_0x584fc1,_0x2c3513,_0x3c96b4,_0x387f30){return new BPromise(function(_0x635926,_0x3c2323){var _0x26ee8b=_0x387f30||client;return _0x26ee8b[_0x3d65('0x1f')](_0x584fc1,_0x3c96b4)[_0x3d65('0x20')](function(_0x539360){logger[_0x3d65('0x21')](_0x3d65('0x22'),_0x2c3513,_0x3d65('0x23'));logger[_0x3d65('0x24')](_0x3d65('0x25'),_0x2c3513,_0x3d65('0x23'),JSON[_0x3d65('0x26')](_0x539360));if(_0x539360['error']){if(_0x539360[_0x3d65('0x27')][_0x3d65('0x28')]===0x1f4){logger[_0x3d65('0x27')](_0x3d65('0x22'),_0x2c3513,_0x539360[_0x3d65('0x27')]['message']);return _0x3c2323(_0x539360[_0x3d65('0x27')][_0x3d65('0x29')]);}logger['error'](_0x3d65('0x22'),_0x2c3513,_0x539360[_0x3d65('0x27')]['message']);return _0x635926(_0x539360[_0x3d65('0x27')][_0x3d65('0x29')]);}else{logger[_0x3d65('0x21')](_0x3d65('0x22'),_0x2c3513,_0x3d65('0x23'));_0x635926(_0x539360[_0x3d65('0x2a')]['message']);}})[_0x3d65('0x2b')](function(_0x14fe02){logger[_0x3d65('0x27')](_0x3d65('0x22'),_0x2c3513,_0x14fe02);_0x3c2323(_0x14fe02);});});}function respondWithStatusCode(_0x2d72bb,_0x4c5f4a){_0x4c5f4a=_0x4c5f4a||0xcc;return function(_0x3b5c55){if(_0x3b5c55){return _0x2d72bb['sendStatus'](_0x4c5f4a);}return _0x2d72bb[_0x3d65('0x2c')](_0x4c5f4a)[_0x3d65('0x2d')]();};}function respondWithResult(_0x4bc558,_0x9e1ca8){_0x9e1ca8=_0x9e1ca8||0xc8;return function(_0x13a762){if(_0x13a762){return _0x4bc558[_0x3d65('0x2c')](_0x9e1ca8)[_0x3d65('0x2e')](_0x13a762);}};}function respondWithFilteredResult(_0x5bb96e,_0x527c50){return function(_0x4a0ced){if(_0x4a0ced){var _0x42bcf8=_0x4a0ced[_0x3d65('0x2f')],_0x377aa7=_0x527c50[_0x3d65('0x30')],_0x595ae0=_0x527c50[_0x3d65('0x30')]+_0x527c50[_0x3d65('0x31')],_0x137738;if(_0x595ae0>=_0x42bcf8){_0x595ae0=_0x42bcf8;_0x137738=0xc8;}else{_0x137738=0xce;}_0x5bb96e[_0x3d65('0x2c')](_0x137738);return _0x5bb96e[_0x3d65('0x32')](_0x3d65('0x33'),_0x377aa7+'-'+_0x595ae0+'/'+_0x42bcf8)[_0x3d65('0x2e')](_0x4a0ced);}return null;};}function patchUpdates(_0x48547d){return function(_0x49bf80){try{jsonpatch[_0x3d65('0x34')](_0x49bf80,_0x48547d,!![]);}catch(_0x4ccb20){return BPromise['reject'](_0x4ccb20);}return _0x49bf80[_0x3d65('0x35')]();};}function saveUpdates(_0x5bce44,_0x5aa848){return function(_0x3a076c){if(_0x3a076c){return _0x3a076c[_0x3d65('0x36')](_0x5bce44)[_0x3d65('0x20')](function(_0x2d6fea){return _0x2d6fea;});}return null;};}function removeEntity(_0x54f6df,_0x5cecc5){return function(_0x3b2a8f){if(_0x3b2a8f){return _0x3b2a8f[_0x3d65('0x37')]()['then'](function(){_0x54f6df['status'](0xcc)[_0x3d65('0x2d')]();});}};}function handleEntityNotFound(_0x548211,_0x1f52c6){return function(_0x30b587){if(!_0x30b587){_0x548211[_0x3d65('0x38')](0x194);}return _0x30b587;};}function handleError(_0xe0923b,_0x1c7ea6){_0x1c7ea6=_0x1c7ea6||0x1f4;return function(_0x1b16a3){logger[_0x3d65('0x27')](_0x1b16a3[_0x3d65('0x39')]);if(_0x1b16a3[_0x3d65('0x3a')]){delete _0x1b16a3['name'];}_0xe0923b['status'](_0x1c7ea6)['send'](_0x1b16a3);};}exports['index']=function(_0x13df5e,_0x3de113){var _0x84b4ab={},_0x54641a={},_0x18bf57={'count':0x0,'rows':[]};var _0xd3db81=db[_0x3d65('0x3b')][_0x3d65('0x3c')];_0x54641a[_0x3d65('0x3d')]=_[_0x3d65('0x3e')](_0xd3db81);_0x54641a[_0x3d65('0x3f')]=_['keys'](_0x13df5e[_0x3d65('0x3f')]);_0x54641a[_0x3d65('0x40')]=_[_0x3d65('0x41')](_0x54641a['model'],_0x54641a[_0x3d65('0x3f')]);_0x84b4ab[_0x3d65('0x42')]=_['intersection'](_0x54641a[_0x3d65('0x3d')],qs[_0x3d65('0x43')](_0x13df5e['query'][_0x3d65('0x43')]));_0x84b4ab[_0x3d65('0x42')]=_0x84b4ab[_0x3d65('0x42')][_0x3d65('0x44')]?_0x84b4ab[_0x3d65('0x42')]:_0x54641a[_0x3d65('0x3d')];if(!_0x13df5e[_0x3d65('0x3f')][_0x3d65('0x45')](_0x3d65('0x46'))){_0x84b4ab[_0x3d65('0x31')]=qs[_0x3d65('0x31')](_0x13df5e['query'][_0x3d65('0x31')]);_0x84b4ab[_0x3d65('0x30')]=qs[_0x3d65('0x30')](_0x13df5e['query'][_0x3d65('0x30')]);}_0x84b4ab['order']=qs[_0x3d65('0x47')](_0x13df5e[_0x3d65('0x3f')][_0x3d65('0x47')]);_0x84b4ab[_0x3d65('0x48')]=qs[_0x3d65('0x40')](_[_0x3d65('0x49')](_0x13df5e[_0x3d65('0x3f')],_0x54641a[_0x3d65('0x40')]));if(_0x13df5e[_0x3d65('0x3f')][_0x3d65('0x4a')]){_0x84b4ab[_0x3d65('0x48')]=_[_0x3d65('0x4b')](_0x84b4ab[_0x3d65('0x48')],{'$or':_['map'](_0xd3db81,function(_0x296668){if(_0x296668[_0x3d65('0x4c')][_0x3d65('0x4d')]!==_0x3d65('0x4e')){var _0x122608={};_0x122608[_0x296668[_0x3d65('0x4f')]]={'$like':'%'+_0x13df5e[_0x3d65('0x3f')][_0x3d65('0x4a')]+'%'};return _0x122608;}})});}_0x84b4ab=_['merge']({},_0x84b4ab,_0x13df5e[_0x3d65('0x50')]);var _0x4424f8={'where':_0x84b4ab[_0x3d65('0x48')]};return db[_0x3d65('0x3b')][_0x3d65('0x2f')](_0x4424f8)[_0x3d65('0x20')](function(_0x48fa9b){_0x18bf57[_0x3d65('0x2f')]=_0x48fa9b;if(_0x13df5e[_0x3d65('0x3f')][_0x3d65('0x51')]){_0x84b4ab[_0x3d65('0x52')]=[{'all':!![]}];}return db[_0x3d65('0x3b')][_0x3d65('0x53')](_0x84b4ab);})['then'](function(_0x62e79f){_0x18bf57[_0x3d65('0x54')]=_0x62e79f;return _0x18bf57;})['then'](respondWithFilteredResult(_0x3de113,_0x84b4ab))[_0x3d65('0x2b')](handleError(_0x3de113,null));};exports['show']=function(_0x586334,_0x31325e){var _0x20b8c4={'raw':!![],'where':{'id':_0x586334[_0x3d65('0x55')]['id']}},_0x2e8abe={};_0x2e8abe[_0x3d65('0x3d')]=_['keys'](db[_0x3d65('0x3b')][_0x3d65('0x3c')]);_0x2e8abe[_0x3d65('0x3f')]=_[_0x3d65('0x3e')](_0x586334[_0x3d65('0x3f')]);_0x2e8abe[_0x3d65('0x40')]=_[_0x3d65('0x41')](_0x2e8abe['model'],_0x2e8abe['query']);_0x20b8c4[_0x3d65('0x42')]=_['intersection'](_0x2e8abe[_0x3d65('0x3d')],qs[_0x3d65('0x43')](_0x586334[_0x3d65('0x3f')][_0x3d65('0x43')]));_0x20b8c4[_0x3d65('0x42')]=_0x20b8c4[_0x3d65('0x42')][_0x3d65('0x44')]?_0x20b8c4[_0x3d65('0x42')]:_0x2e8abe[_0x3d65('0x3d')];if(_0x586334[_0x3d65('0x3f')][_0x3d65('0x51')]){_0x20b8c4[_0x3d65('0x52')]=[{'all':!![]}];}_0x20b8c4=_[_0x3d65('0x4b')]({},_0x20b8c4,_0x586334['options']);return db[_0x3d65('0x3b')][_0x3d65('0x56')](_0x20b8c4)[_0x3d65('0x20')](handleEntityNotFound(_0x31325e,null))['then'](respondWithResult(_0x31325e,null))[_0x3d65('0x2b')](handleError(_0x31325e,null));};exports['create']=function(_0x1f5188,_0x3febf1){return db[_0x3d65('0x3b')][_0x3d65('0x57')](_0x1f5188['body'],{})[_0x3d65('0x20')](respondWithResult(_0x3febf1,0xc9))['catch'](handleError(_0x3febf1,null));};exports[_0x3d65('0x36')]=function(_0x223f9b,_0x310d86){if(_0x223f9b[_0x3d65('0x58')]['id']){delete _0x223f9b[_0x3d65('0x58')]['id'];}return db[_0x3d65('0x3b')]['find']({'where':{'id':_0x223f9b[_0x3d65('0x55')]['id']}})[_0x3d65('0x20')](handleEntityNotFound(_0x310d86,null))[_0x3d65('0x20')](saveUpdates(_0x223f9b[_0x3d65('0x58')],null))['then'](respondWithResult(_0x310d86,null))['catch'](handleError(_0x310d86,null));};exports[_0x3d65('0x37')]=function(_0x14c390,_0x1172c3){return db[_0x3d65('0x3b')][_0x3d65('0x56')]({'where':{'id':_0x14c390[_0x3d65('0x55')]['id']}})[_0x3d65('0x20')](handleEntityNotFound(_0x1172c3,null))[_0x3d65('0x20')](removeEntity(_0x1172c3,null))[_0x3d65('0x2b')](handleError(_0x1172c3,null));};exports[_0x3d65('0x59')]=function(_0x1ca022,_0x3be877){return db[_0x3d65('0x3b')][_0x3d65('0x59')]()['then'](respondWithResult(_0x3be877,null))['catch'](handleError(_0x3be877,null));};exports[_0x3d65('0x5a')]=function(_0x3db9ab,_0x590b89,_0x23e3c5){return db[_0x3d65('0x5b')][_0x3d65('0x2f')]({'where':{'ChatGroupId':_0x3db9ab[_0x3d65('0x55')]['id'],'ToId':_0x3db9ab[_0x3d65('0x5c')]['id'],'read':![]}})['then'](function(_0x273541){return{'id':_[_0x3d65('0x5d')](_0x3db9ab[_0x3d65('0x55')]['id']),'count':_0x273541};})[_0x3d65('0x20')](respondWithResult(_0x590b89,null))[_0x3d65('0x2b')](handleError(_0x590b89,null));};exports['addMembers']=function(_0x15561b,_0x24082c,_0x3f5456){return db[_0x3d65('0x3b')][_0x3d65('0x56')]({'where':{'id':_0x15561b['params']['id']}})['then'](handleEntityNotFound(_0x24082c,null))[_0x3d65('0x20')](function(_0x1c4e08){if(_0x1c4e08){return _0x1c4e08[_0x3d65('0x5e')](_0x15561b['body'][_0x3d65('0x5f')],_[_0x3d65('0x60')](_0x15561b[_0x3d65('0x58')],[_0x3d65('0x5f'),'id'])||{});}})['then'](respondWithResult(_0x24082c,null))[_0x3d65('0x2b')](handleError(_0x24082c,null));};exports[_0x3d65('0x61')]=function(_0x3cffa0,_0x46df22,_0x36b7c6){var _0x426f90={};var _0x1ab5eb={};var _0x17b039;var _0x4e7f61;return db[_0x3d65('0x3b')][_0x3d65('0x62')]({'where':{'id':_0x3cffa0[_0x3d65('0x55')]['id']}})[_0x3d65('0x20')](handleEntityNotFound(_0x46df22,null))[_0x3d65('0x20')](function(_0x3fd0ba){if(_0x3fd0ba){_0x17b039=_0x3fd0ba;_0x1ab5eb[_0x3d65('0x3d')]=_[_0x3d65('0x3e')](db[_0x3d65('0x63')]['rawAttributes']);_0x1ab5eb[_0x3d65('0x3f')]=_[_0x3d65('0x3e')](_0x3cffa0[_0x3d65('0x3f')]);_0x1ab5eb[_0x3d65('0x40')]=_[_0x3d65('0x41')](_0x1ab5eb[_0x3d65('0x3d')],_0x1ab5eb[_0x3d65('0x3f')]);_0x426f90[_0x3d65('0x42')]=_[_0x3d65('0x41')](_0x1ab5eb[_0x3d65('0x3d')],qs['fields'](_0x3cffa0[_0x3d65('0x3f')][_0x3d65('0x43')]));_0x426f90[_0x3d65('0x42')]=_0x426f90[_0x3d65('0x42')][_0x3d65('0x44')]?_0x426f90[_0x3d65('0x42')]:_0x1ab5eb['model'];_0x426f90[_0x3d65('0x64')]=qs[_0x3d65('0x47')](_0x3cffa0[_0x3d65('0x3f')][_0x3d65('0x47')]);_0x426f90[_0x3d65('0x48')]=qs[_0x3d65('0x40')](_[_0x3d65('0x49')](_0x3cffa0[_0x3d65('0x3f')],_0x1ab5eb['filters']));if(_0x3cffa0[_0x3d65('0x3f')][_0x3d65('0x4a')]){_0x426f90['where']=_[_0x3d65('0x4b')](_0x426f90[_0x3d65('0x48')],{'$or':_['map'](_0x426f90[_0x3d65('0x42')],function(_0x4b7394){var _0xfcf329={};_0xfcf329[_0x4b7394]={'$like':'%'+_0x3cffa0[_0x3d65('0x3f')]['filter']+'%'};return _0xfcf329;})});}_0x426f90=_[_0x3d65('0x4b')]({},_0x426f90,_0x3cffa0[_0x3d65('0x50')]);return _0x17b039[_0x3d65('0x61')](_0x426f90);}})[_0x3d65('0x20')](function(_0x1531fb){if(_0x1531fb){_0x4e7f61=_0x1531fb[_0x3d65('0x44')];if(!_0x3cffa0[_0x3d65('0x3f')][_0x3d65('0x45')]('nolimit')){_0x426f90[_0x3d65('0x31')]=qs[_0x3d65('0x31')](_0x3cffa0[_0x3d65('0x3f')][_0x3d65('0x31')]);_0x426f90[_0x3d65('0x30')]=qs[_0x3d65('0x30')](_0x3cffa0[_0x3d65('0x3f')]['offset']);}return _0x17b039['getMembers'](_0x426f90);}})['then'](function(_0x399ab5){if(_0x399ab5){return _0x399ab5?{'count':_0x4e7f61,'rows':_0x399ab5}:null;}})[_0x3d65('0x20')](respondWithResult(_0x46df22,null))[_0x3d65('0x2b')](handleError(_0x46df22,null));};exports[_0x3d65('0x65')]=function(_0x97619e,_0x3f9f5a,_0x372912){return db[_0x3d65('0x3b')]['find']({'where':{'id':_0x97619e['params']['id']}})[_0x3d65('0x20')](handleEntityNotFound(_0x3f9f5a,null))[_0x3d65('0x20')](function(_0x4c2213){if(_0x4c2213){return _0x4c2213['removeMembers'](_0x97619e[_0x3d65('0x3f')][_0x3d65('0x5f')]);}})[_0x3d65('0x20')](respondWithStatusCode(_0x3f9f5a,null))[_0x3d65('0x2b')](handleError(_0x3f9f5a,null));};exports['addMessage']=function(_0x7ae177,_0x48123e,_0x661246){if(_0x7ae177[_0x3d65('0x58')]['id']){delete _0x7ae177[_0x3d65('0x58')]['id'];}return db[_0x3d65('0x3b')][_0x3d65('0x56')]({'where':{'id':_0x7ae177['params']['id']}})['then'](handleEntityNotFound(_0x48123e,null))[_0x3d65('0x20')](function(_0x439d02){if(_0x439d02){_0x7ae177[_0x3d65('0x58')][_0x3d65('0x66')]=_0x439d02['id'];return db[_0x3d65('0x5b')][_0x3d65('0x57')](_0x7ae177[_0x3d65('0x58')]);}})[_0x3d65('0x20')](respondWithResult(_0x48123e,null))[_0x3d65('0x2b')](handleError(_0x48123e,null));};exports[_0x3d65('0x67')]=function(_0x213e2b,_0x58f024,_0x30d86c){var _0x1f10ba={};var _0x225d31={};var _0x3fa063;var _0x238732;return db[_0x3d65('0x3b')][_0x3d65('0x62')]({'where':{'id':_0x213e2b[_0x3d65('0x55')]['id']}})[_0x3d65('0x20')](handleEntityNotFound(_0x58f024,null))[_0x3d65('0x20')](function(_0x4c7aa3){if(_0x4c7aa3){_0x3fa063=_0x4c7aa3;_0x225d31[_0x3d65('0x3d')]=_[_0x3d65('0x3e')](db[_0x3d65('0x5b')]['rawAttributes']);_0x225d31[_0x3d65('0x3f')]=_[_0x3d65('0x3e')](_0x213e2b[_0x3d65('0x3f')]);_0x225d31[_0x3d65('0x40')]=_[_0x3d65('0x41')](_0x225d31[_0x3d65('0x3d')],_0x225d31[_0x3d65('0x3f')]);_0x1f10ba[_0x3d65('0x42')]=_[_0x3d65('0x41')](_0x225d31[_0x3d65('0x3d')],qs[_0x3d65('0x43')](_0x213e2b[_0x3d65('0x3f')]['fields']));_0x1f10ba[_0x3d65('0x42')]=_0x1f10ba[_0x3d65('0x42')][_0x3d65('0x44')]?_0x1f10ba['attributes']:_0x225d31[_0x3d65('0x3d')];_0x1f10ba[_0x3d65('0x64')]=qs[_0x3d65('0x47')](_0x213e2b[_0x3d65('0x3f')][_0x3d65('0x47')]);_0x1f10ba[_0x3d65('0x48')]=qs[_0x3d65('0x40')](_[_0x3d65('0x49')](_0x213e2b[_0x3d65('0x3f')],_0x225d31['filters']));if(_0x213e2b['query']['filter']){_0x1f10ba[_0x3d65('0x48')]=_[_0x3d65('0x4b')](_0x1f10ba['where'],{'$or':_[_0x3d65('0x68')](_0x1f10ba[_0x3d65('0x42')],function(_0x2559fb){var _0xf99485={};_0xf99485[_0x2559fb]={'$like':'%'+_0x213e2b[_0x3d65('0x3f')][_0x3d65('0x4a')]+'%'};return _0xf99485;})});}if(_0x213e2b[_0x3d65('0x3f')][_0x3d65('0x69')]){var _0x38e0ac=_0x213e2b['query'][_0x3d65('0x69')][_0x3d65('0x6a')](',');var _0x28fc89={};_0x28fc89[_0x38e0ac[0x0]]={'$gte':moment(_0x38e0ac[0x1])[_0x3d65('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1f10ba[_0x3d65('0x48')]=_['merge'](_0x1f10ba[_0x3d65('0x48')],_0x28fc89);}_0x1f10ba=_['merge']({},_0x1f10ba,_0x213e2b[_0x3d65('0x50')]);return _0x3fa063[_0x3d65('0x67')](_0x1f10ba);}})[_0x3d65('0x20')](function(_0x4d31a4){if(_0x4d31a4){_0x238732=_0x4d31a4['length'];if(!_0x213e2b[_0x3d65('0x3f')]['hasOwnProperty'](_0x3d65('0x46'))){_0x1f10ba[_0x3d65('0x31')]=qs['limit'](_0x213e2b[_0x3d65('0x3f')][_0x3d65('0x31')]);_0x1f10ba['offset']=qs[_0x3d65('0x30')](_0x213e2b[_0x3d65('0x3f')]['offset']);}return _0x3fa063[_0x3d65('0x67')](_0x1f10ba);}})['then'](function(_0x4532b3){if(_0x4532b3){return _0x4532b3?{'count':_0x238732,'rows':_0x4532b3}:null;}})[_0x3d65('0x20')](respondWithResult(_0x58f024,null))[_0x3d65('0x2b')](handleError(_0x58f024,null));}; \ No newline at end of file +var _0x2b2a=['../../config/license/hardware','../../config/logger','../../config/environment','redis','localhost','./chatGroup.socket','register','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','ChatGroup,\x20%s,\x20%s','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','name','send','index','ChatGroup','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','field','options','count','includeAll','include','findAll','rows','params','find','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','create','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x32d1ae,_0x575e52){var _0x49cf0b=function(_0x7dc05c){while(--_0x7dc05c){_0x32d1ae['push'](_0x32d1ae['shift']());}};_0x49cf0b(++_0x575e52);}(_0x2b2a,0xbb));var _0xa2b2=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x2b2a[_0x92c450];return _0x2a9599;};'use strict';var pdf=require(_0xa2b2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa2b2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa2b2('0x2'));var rp=require('request-promise');var moment=require(_0xa2b2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa2b2('0x4'));var util=require(_0xa2b2('0x5'));var path=require(_0xa2b2('0x6'));var sox=require(_0xa2b2('0x7'));var csv=require(_0xa2b2('0x8'));var ejs=require(_0xa2b2('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa2b2('0xa'));var crypto=require(_0xa2b2('0xb'));var jsforce=require(_0xa2b2('0xc'));var deskjs=require(_0xa2b2('0xd'));var toCsv=require(_0xa2b2('0x8'));var querystring=require(_0xa2b2('0xe'));var Papa=require(_0xa2b2('0xf'));var Redis=require(_0xa2b2('0x10'));var authService=require(_0xa2b2('0x11'));var qs=require(_0xa2b2('0x12'));var hardwareService=require(_0xa2b2('0x13'));var logger=require(_0xa2b2('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xa2b2('0x15'));var db=require('../../mysqldb')['db'];config[_0xa2b2('0x16')]=_['defaults'](config[_0xa2b2('0x16')],{'host':_0xa2b2('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa2b2('0x16')]));require(_0xa2b2('0x18'))[_0xa2b2('0x19')](socket);var jayson=require(_0xa2b2('0x1a'));var client=jayson['client'][_0xa2b2('0x1b')]({'port':0x232a});function checkPasswordPattern(_0xb1584c,_0x136e81,_0x4d51af){if(_0x4d51af){var _0x1b0b5f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1b0b5f['test'](_0x136e81)){return _0xb1584c;}else{throw new Error(_0xa2b2('0x1c'));}}else{return _0xb1584c;}}function respondWithRpcPromise(_0x22c52e,_0x1cc5e7,_0x3e1d9d,_0xacdb14){return new BPromise(function(_0x395b8c,_0x5a05ad){var _0x34042f=_0xacdb14||client;return _0x34042f['request'](_0x22c52e,_0x3e1d9d)[_0xa2b2('0x1d')](function(_0x2c2378){logger['info'](_0xa2b2('0x1e'),_0x1cc5e7,'request\x20sent');logger['debug'](_0xa2b2('0x1f'),_0x1cc5e7,_0xa2b2('0x20'),JSON[_0xa2b2('0x21')](_0x2c2378));if(_0x2c2378[_0xa2b2('0x22')]){if(_0x2c2378[_0xa2b2('0x22')][_0xa2b2('0x23')]===0x1f4){logger[_0xa2b2('0x22')](_0xa2b2('0x1e'),_0x1cc5e7,_0x2c2378['error']['message']);return _0x5a05ad(_0x2c2378[_0xa2b2('0x22')][_0xa2b2('0x24')]);}logger['error'](_0xa2b2('0x1e'),_0x1cc5e7,_0x2c2378[_0xa2b2('0x22')]['message']);return _0x395b8c(_0x2c2378[_0xa2b2('0x22')][_0xa2b2('0x24')]);}else{logger[_0xa2b2('0x25')]('ChatGroup,\x20%s,\x20%s',_0x1cc5e7,'request\x20sent');_0x395b8c(_0x2c2378['result']['message']);}})[_0xa2b2('0x26')](function(_0x22bd31){logger[_0xa2b2('0x22')](_0xa2b2('0x1e'),_0x1cc5e7,_0x22bd31);_0x5a05ad(_0x22bd31);});});}function respondWithStatusCode(_0x83c73,_0x159a7c){_0x159a7c=_0x159a7c||0xcc;return function(_0x1017b9){if(_0x1017b9){return _0x83c73[_0xa2b2('0x27')](_0x159a7c);}return _0x83c73[_0xa2b2('0x28')](_0x159a7c)['end']();};}function respondWithResult(_0x576fc6,_0x53da6e){_0x53da6e=_0x53da6e||0xc8;return function(_0x442b38){if(_0x442b38){return _0x576fc6[_0xa2b2('0x28')](_0x53da6e)[_0xa2b2('0x29')](_0x442b38);}};}function respondWithFilteredResult(_0x318e7e,_0x369c3c){return function(_0x500cf2){if(_0x500cf2){var _0x45071f=_0x500cf2['count'],_0x2b500f=_0x369c3c[_0xa2b2('0x2a')],_0x4abee8=_0x369c3c['offset']+_0x369c3c[_0xa2b2('0x2b')],_0x57f14b;if(_0x4abee8>=_0x45071f){_0x4abee8=_0x45071f;_0x57f14b=0xc8;}else{_0x57f14b=0xce;}_0x318e7e[_0xa2b2('0x28')](_0x57f14b);return _0x318e7e[_0xa2b2('0x2c')](_0xa2b2('0x2d'),_0x2b500f+'-'+_0x4abee8+'/'+_0x45071f)[_0xa2b2('0x29')](_0x500cf2);}return null;};}function patchUpdates(_0x5dc1a7){return function(_0x219229){try{jsonpatch[_0xa2b2('0x2e')](_0x219229,_0x5dc1a7,!![]);}catch(_0x4e2972){return BPromise[_0xa2b2('0x2f')](_0x4e2972);}return _0x219229[_0xa2b2('0x30')]();};}function saveUpdates(_0x566950,_0x18b96e){return function(_0x3be7bc){if(_0x3be7bc){return _0x3be7bc[_0xa2b2('0x31')](_0x566950)[_0xa2b2('0x1d')](function(_0x14a9da){return _0x14a9da;});}return null;};}function removeEntity(_0x18b9eb,_0x481126){return function(_0x595759){if(_0x595759){return _0x595759[_0xa2b2('0x32')]()['then'](function(){_0x18b9eb[_0xa2b2('0x28')](0xcc)[_0xa2b2('0x33')]();});}};}function handleEntityNotFound(_0x59ce26,_0x3dc7ec){return function(_0x50b39b){if(!_0x50b39b){_0x59ce26[_0xa2b2('0x27')](0x194);}return _0x50b39b;};}function handleError(_0x528117,_0x5b4a07){_0x5b4a07=_0x5b4a07||0x1f4;return function(_0x42374c){logger['error'](_0x42374c['stack']);if(_0x42374c[_0xa2b2('0x34')]){delete _0x42374c[_0xa2b2('0x34')];}_0x528117['status'](_0x5b4a07)[_0xa2b2('0x35')](_0x42374c);};}exports[_0xa2b2('0x36')]=function(_0x4a3292,_0x2e0b0c){var _0x45d44e={},_0x112893={},_0x25ce8d={'count':0x0,'rows':[]};var _0x2e9799=db[_0xa2b2('0x37')][_0xa2b2('0x38')];_0x112893['model']=_[_0xa2b2('0x39')](_0x2e9799);_0x112893[_0xa2b2('0x3a')]=_[_0xa2b2('0x39')](_0x4a3292[_0xa2b2('0x3a')]);_0x112893[_0xa2b2('0x3b')]=_[_0xa2b2('0x3c')](_0x112893[_0xa2b2('0x3d')],_0x112893[_0xa2b2('0x3a')]);_0x45d44e[_0xa2b2('0x3e')]=_['intersection'](_0x112893[_0xa2b2('0x3d')],qs[_0xa2b2('0x3f')](_0x4a3292[_0xa2b2('0x3a')][_0xa2b2('0x3f')]));_0x45d44e[_0xa2b2('0x3e')]=_0x45d44e[_0xa2b2('0x3e')][_0xa2b2('0x40')]?_0x45d44e[_0xa2b2('0x3e')]:_0x112893[_0xa2b2('0x3d')];if(!_0x4a3292[_0xa2b2('0x3a')][_0xa2b2('0x41')](_0xa2b2('0x42'))){_0x45d44e[_0xa2b2('0x2b')]=qs[_0xa2b2('0x2b')](_0x4a3292[_0xa2b2('0x3a')][_0xa2b2('0x2b')]);_0x45d44e[_0xa2b2('0x2a')]=qs[_0xa2b2('0x2a')](_0x4a3292['query'][_0xa2b2('0x2a')]);}_0x45d44e[_0xa2b2('0x43')]=qs['sort'](_0x4a3292[_0xa2b2('0x3a')][_0xa2b2('0x44')]);_0x45d44e['where']=qs[_0xa2b2('0x3b')](_[_0xa2b2('0x45')](_0x4a3292[_0xa2b2('0x3a')],_0x112893[_0xa2b2('0x3b')]));if(_0x4a3292[_0xa2b2('0x3a')][_0xa2b2('0x46')]){_0x45d44e[_0xa2b2('0x47')]=_[_0xa2b2('0x48')](_0x45d44e['where'],{'$or':_[_0xa2b2('0x49')](_0x2e9799,function(_0x2fd5c5){if(_0x2fd5c5['type']['key']!==_0xa2b2('0x4a')){var _0x4ea4ce={};_0x4ea4ce[_0x2fd5c5[_0xa2b2('0x4b')]]={'$like':'%'+_0x4a3292[_0xa2b2('0x3a')][_0xa2b2('0x46')]+'%'};return _0x4ea4ce;}})});}_0x45d44e=_[_0xa2b2('0x48')]({},_0x45d44e,_0x4a3292[_0xa2b2('0x4c')]);var _0x23de36={'where':_0x45d44e[_0xa2b2('0x47')]};return db[_0xa2b2('0x37')][_0xa2b2('0x4d')](_0x23de36)[_0xa2b2('0x1d')](function(_0x540de3){_0x25ce8d[_0xa2b2('0x4d')]=_0x540de3;if(_0x4a3292[_0xa2b2('0x3a')][_0xa2b2('0x4e')]){_0x45d44e[_0xa2b2('0x4f')]=[{'all':!![]}];}return db[_0xa2b2('0x37')][_0xa2b2('0x50')](_0x45d44e);})[_0xa2b2('0x1d')](function(_0x2a8d04){_0x25ce8d[_0xa2b2('0x51')]=_0x2a8d04;return _0x25ce8d;})['then'](respondWithFilteredResult(_0x2e0b0c,_0x45d44e))['catch'](handleError(_0x2e0b0c,null));};exports['show']=function(_0x18926a,_0x261fba){var _0x294e1b={'raw':!![],'where':{'id':_0x18926a[_0xa2b2('0x52')]['id']}},_0x222d07={};_0x222d07[_0xa2b2('0x3d')]=_[_0xa2b2('0x39')](db[_0xa2b2('0x37')][_0xa2b2('0x38')]);_0x222d07['query']=_[_0xa2b2('0x39')](_0x18926a[_0xa2b2('0x3a')]);_0x222d07[_0xa2b2('0x3b')]=_[_0xa2b2('0x3c')](_0x222d07[_0xa2b2('0x3d')],_0x222d07['query']);_0x294e1b[_0xa2b2('0x3e')]=_['intersection'](_0x222d07[_0xa2b2('0x3d')],qs[_0xa2b2('0x3f')](_0x18926a['query'][_0xa2b2('0x3f')]));_0x294e1b[_0xa2b2('0x3e')]=_0x294e1b['attributes']['length']?_0x294e1b['attributes']:_0x222d07[_0xa2b2('0x3d')];if(_0x18926a[_0xa2b2('0x3a')][_0xa2b2('0x4e')]){_0x294e1b[_0xa2b2('0x4f')]=[{'all':!![]}];}_0x294e1b=_['merge']({},_0x294e1b,_0x18926a[_0xa2b2('0x4c')]);return db['ChatGroup'][_0xa2b2('0x53')](_0x294e1b)[_0xa2b2('0x1d')](handleEntityNotFound(_0x261fba,null))[_0xa2b2('0x1d')](respondWithResult(_0x261fba,null))[_0xa2b2('0x26')](handleError(_0x261fba,null));};exports['create']=function(_0x51e225,_0x4356c5){return db[_0xa2b2('0x37')]['create'](_0x51e225[_0xa2b2('0x54')],{})['then'](respondWithResult(_0x4356c5,0xc9))[_0xa2b2('0x26')](handleError(_0x4356c5,null));};exports[_0xa2b2('0x31')]=function(_0x57f731,_0x34dd45){if(_0x57f731[_0xa2b2('0x54')]['id']){delete _0x57f731[_0xa2b2('0x54')]['id'];}return db[_0xa2b2('0x37')][_0xa2b2('0x53')]({'where':{'id':_0x57f731['params']['id']}})[_0xa2b2('0x1d')](handleEntityNotFound(_0x34dd45,null))['then'](saveUpdates(_0x57f731[_0xa2b2('0x54')],null))['then'](respondWithResult(_0x34dd45,null))[_0xa2b2('0x26')](handleError(_0x34dd45,null));};exports[_0xa2b2('0x32')]=function(_0x188135,_0x4e42bf){return db[_0xa2b2('0x37')][_0xa2b2('0x53')]({'where':{'id':_0x188135[_0xa2b2('0x52')]['id']}})[_0xa2b2('0x1d')](handleEntityNotFound(_0x4e42bf,null))[_0xa2b2('0x1d')](removeEntity(_0x4e42bf,null))[_0xa2b2('0x26')](handleError(_0x4e42bf,null));};exports[_0xa2b2('0x55')]=function(_0x19f701,_0x7629cf){return db['ChatGroup'][_0xa2b2('0x55')]()['then'](respondWithResult(_0x7629cf,null))[_0xa2b2('0x26')](handleError(_0x7629cf,null));};exports[_0xa2b2('0x56')]=function(_0x1a18a8,_0x44c28e,_0x182e1d){return db[_0xa2b2('0x57')]['count']({'where':{'ChatGroupId':_0x1a18a8[_0xa2b2('0x52')]['id'],'ToId':_0x1a18a8[_0xa2b2('0x58')]['id'],'read':![]}})[_0xa2b2('0x1d')](function(_0x17742f){return{'id':_['toInteger'](_0x1a18a8[_0xa2b2('0x52')]['id']),'count':_0x17742f};})[_0xa2b2('0x1d')](respondWithResult(_0x44c28e,null))[_0xa2b2('0x26')](handleError(_0x44c28e,null));};exports[_0xa2b2('0x59')]=function(_0x3e3006,_0x396ae7,_0x119d8f){return db[_0xa2b2('0x37')][_0xa2b2('0x53')]({'where':{'id':_0x3e3006[_0xa2b2('0x52')]['id']}})[_0xa2b2('0x1d')](handleEntityNotFound(_0x396ae7,null))[_0xa2b2('0x1d')](function(_0x4e7d87){if(_0x4e7d87){return _0x4e7d87[_0xa2b2('0x59')](_0x3e3006[_0xa2b2('0x54')][_0xa2b2('0x5a')],_['omit'](_0x3e3006['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x396ae7,null))['catch'](handleError(_0x396ae7,null));};exports[_0xa2b2('0x5b')]=function(_0x530c85,_0x5c2e58,_0x2f23d1){var _0xec6f4={};var _0x33ae8f={};var _0x11d6c9;var _0x41a6ea;return db[_0xa2b2('0x37')][_0xa2b2('0x5c')]({'where':{'id':_0x530c85[_0xa2b2('0x52')]['id']}})[_0xa2b2('0x1d')](handleEntityNotFound(_0x5c2e58,null))['then'](function(_0x3c3141){if(_0x3c3141){_0x11d6c9=_0x3c3141;_0x33ae8f['model']=_[_0xa2b2('0x39')](db[_0xa2b2('0x5d')][_0xa2b2('0x38')]);_0x33ae8f[_0xa2b2('0x3a')]=_['keys'](_0x530c85['query']);_0x33ae8f[_0xa2b2('0x3b')]=_[_0xa2b2('0x3c')](_0x33ae8f['model'],_0x33ae8f[_0xa2b2('0x3a')]);_0xec6f4[_0xa2b2('0x3e')]=_[_0xa2b2('0x3c')](_0x33ae8f[_0xa2b2('0x3d')],qs[_0xa2b2('0x3f')](_0x530c85[_0xa2b2('0x3a')][_0xa2b2('0x3f')]));_0xec6f4[_0xa2b2('0x3e')]=_0xec6f4[_0xa2b2('0x3e')]['length']?_0xec6f4[_0xa2b2('0x3e')]:_0x33ae8f[_0xa2b2('0x3d')];_0xec6f4['order']=qs['sort'](_0x530c85[_0xa2b2('0x3a')][_0xa2b2('0x44')]);_0xec6f4['where']=qs[_0xa2b2('0x3b')](_[_0xa2b2('0x45')](_0x530c85[_0xa2b2('0x3a')],_0x33ae8f[_0xa2b2('0x3b')]));if(_0x530c85[_0xa2b2('0x3a')][_0xa2b2('0x46')]){_0xec6f4[_0xa2b2('0x47')]=_[_0xa2b2('0x48')](_0xec6f4[_0xa2b2('0x47')],{'$or':_['map'](_0xec6f4[_0xa2b2('0x3e')],function(_0x4b837a){var _0x5b4983={};_0x5b4983[_0x4b837a]={'$like':'%'+_0x530c85['query'][_0xa2b2('0x46')]+'%'};return _0x5b4983;})});}_0xec6f4=_['merge']({},_0xec6f4,_0x530c85[_0xa2b2('0x4c')]);return _0x11d6c9[_0xa2b2('0x5b')](_0xec6f4);}})[_0xa2b2('0x1d')](function(_0x3ed047){if(_0x3ed047){_0x41a6ea=_0x3ed047[_0xa2b2('0x40')];if(!_0x530c85[_0xa2b2('0x3a')][_0xa2b2('0x41')](_0xa2b2('0x42'))){_0xec6f4[_0xa2b2('0x2b')]=qs[_0xa2b2('0x2b')](_0x530c85[_0xa2b2('0x3a')][_0xa2b2('0x2b')]);_0xec6f4[_0xa2b2('0x2a')]=qs[_0xa2b2('0x2a')](_0x530c85[_0xa2b2('0x3a')][_0xa2b2('0x2a')]);}return _0x11d6c9[_0xa2b2('0x5b')](_0xec6f4);}})['then'](function(_0x51648f){if(_0x51648f){return _0x51648f?{'count':_0x41a6ea,'rows':_0x51648f}:null;}})[_0xa2b2('0x1d')](respondWithResult(_0x5c2e58,null))['catch'](handleError(_0x5c2e58,null));};exports[_0xa2b2('0x5e')]=function(_0x2f20b6,_0x397d67,_0x1a499d){return db[_0xa2b2('0x37')][_0xa2b2('0x53')]({'where':{'id':_0x2f20b6[_0xa2b2('0x52')]['id']}})[_0xa2b2('0x1d')](handleEntityNotFound(_0x397d67,null))[_0xa2b2('0x1d')](function(_0x17198e){if(_0x17198e){return _0x17198e[_0xa2b2('0x5e')](_0x2f20b6[_0xa2b2('0x3a')]['ids']);}})[_0xa2b2('0x1d')](respondWithStatusCode(_0x397d67,null))[_0xa2b2('0x26')](handleError(_0x397d67,null));};exports[_0xa2b2('0x5f')]=function(_0x36339d,_0xf7e0a2,_0x25072e){if(_0x36339d['body']['id']){delete _0x36339d[_0xa2b2('0x54')]['id'];}return db[_0xa2b2('0x37')][_0xa2b2('0x53')]({'where':{'id':_0x36339d[_0xa2b2('0x52')]['id']}})[_0xa2b2('0x1d')](handleEntityNotFound(_0xf7e0a2,null))[_0xa2b2('0x1d')](function(_0x1a8348){if(_0x1a8348){_0x36339d[_0xa2b2('0x54')][_0xa2b2('0x60')]=_0x1a8348['id'];return db[_0xa2b2('0x57')][_0xa2b2('0x61')](_0x36339d['body']);}})[_0xa2b2('0x1d')](respondWithResult(_0xf7e0a2,null))[_0xa2b2('0x26')](handleError(_0xf7e0a2,null));};exports[_0xa2b2('0x62')]=function(_0xce56f,_0x4e0f14,_0x1e127f){var _0x3501de={};var _0x200c9d={};var _0x2c417e;var _0x4d9d9f;return db[_0xa2b2('0x37')]['findOne']({'where':{'id':_0xce56f['params']['id']}})[_0xa2b2('0x1d')](handleEntityNotFound(_0x4e0f14,null))[_0xa2b2('0x1d')](function(_0x26c808){if(_0x26c808){_0x2c417e=_0x26c808;_0x200c9d[_0xa2b2('0x3d')]=_[_0xa2b2('0x39')](db[_0xa2b2('0x57')][_0xa2b2('0x38')]);_0x200c9d['query']=_[_0xa2b2('0x39')](_0xce56f['query']);_0x200c9d[_0xa2b2('0x3b')]=_[_0xa2b2('0x3c')](_0x200c9d[_0xa2b2('0x3d')],_0x200c9d[_0xa2b2('0x3a')]);_0x3501de[_0xa2b2('0x3e')]=_[_0xa2b2('0x3c')](_0x200c9d[_0xa2b2('0x3d')],qs['fields'](_0xce56f['query'][_0xa2b2('0x3f')]));_0x3501de[_0xa2b2('0x3e')]=_0x3501de[_0xa2b2('0x3e')][_0xa2b2('0x40')]?_0x3501de[_0xa2b2('0x3e')]:_0x200c9d[_0xa2b2('0x3d')];_0x3501de[_0xa2b2('0x43')]=qs[_0xa2b2('0x44')](_0xce56f[_0xa2b2('0x3a')]['sort']);_0x3501de['where']=qs[_0xa2b2('0x3b')](_[_0xa2b2('0x45')](_0xce56f['query'],_0x200c9d[_0xa2b2('0x3b')]));if(_0xce56f[_0xa2b2('0x3a')][_0xa2b2('0x46')]){_0x3501de[_0xa2b2('0x47')]=_[_0xa2b2('0x48')](_0x3501de['where'],{'$or':_['map'](_0x3501de[_0xa2b2('0x3e')],function(_0x148aec){var _0x2d7cf2={};_0x2d7cf2[_0x148aec]={'$like':'%'+_0xce56f[_0xa2b2('0x3a')][_0xa2b2('0x46')]+'%'};return _0x2d7cf2;})});}if(_0xce56f[_0xa2b2('0x3a')][_0xa2b2('0x63')]){var _0x1c4eff=_0xce56f['query'][_0xa2b2('0x63')][_0xa2b2('0x64')](',');var _0x5e485e={};_0x5e485e[_0x1c4eff[0x0]]={'$gte':moment(_0x1c4eff[0x1])[_0xa2b2('0x65')](_0xa2b2('0x66'))};_0x3501de[_0xa2b2('0x47')]=_['merge'](_0x3501de[_0xa2b2('0x47')],_0x5e485e);}_0x3501de=_[_0xa2b2('0x48')]({},_0x3501de,_0xce56f[_0xa2b2('0x4c')]);return _0x2c417e[_0xa2b2('0x62')](_0x3501de);}})[_0xa2b2('0x1d')](function(_0x4f636c){if(_0x4f636c){_0x4d9d9f=_0x4f636c['length'];if(!_0xce56f['query'][_0xa2b2('0x41')](_0xa2b2('0x42'))){_0x3501de['limit']=qs[_0xa2b2('0x2b')](_0xce56f[_0xa2b2('0x3a')][_0xa2b2('0x2b')]);_0x3501de['offset']=qs[_0xa2b2('0x2a')](_0xce56f[_0xa2b2('0x3a')][_0xa2b2('0x2a')]);}return _0x2c417e[_0xa2b2('0x62')](_0x3501de);}})['then'](function(_0x524e88){if(_0x524e88){return _0x524e88?{'count':_0x4d9d9f,'rows':_0x524e88}:null;}})[_0xa2b2('0x1d')](respondWithResult(_0x4e0f14,null))[_0xa2b2('0x26')](handleError(_0x4e0f14,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index bf09a8f..f4ba521 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 _0x0888=['emit','exports','events','../../mysqldb','ChatGroup','setMaxListeners','update'];(function(_0x2bac11,_0x95b447){var _0x288c18=function(_0x415467){while(--_0x415467){_0x2bac11['push'](_0x2bac11['shift']());}};_0x288c18(++_0x95b447);}(_0x0888,0xf0));var _0x8088=function(_0x2122c7,_0x4286f8){_0x2122c7=_0x2122c7-0x0;var _0x46542c=_0x0888[_0x2122c7];return _0x46542c;};'use strict';var EventEmitter=require(_0x8088('0x0'));var ChatGroup=require(_0x8088('0x1'))['db'][_0x8088('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8088('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8088('0x4'),'afterDestroy':'remove'};function emitEvent(_0x349379){return function(_0x2780c7,_0x1e2271,_0xf14127){ChatGroupEvents[_0x8088('0x5')](_0x349379+':'+_0x2780c7['id'],_0x2780c7);ChatGroupEvents[_0x8088('0x5')](_0x349379,_0x2780c7);_0xf14127(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x8088('0x6')]=ChatGroupEvents; \ No newline at end of file +var _0x34a7=['update','remove','emit','hasOwnProperty','hook','exports','events','ChatGroup','setMaxListeners','save'];(function(_0x1a1131,_0x404e25){var _0x2a73ee=function(_0x18690f){while(--_0x18690f){_0x1a1131['push'](_0x1a1131['shift']());}};_0x2a73ee(++_0x404e25);}(_0x34a7,0xba));var _0x734a=function(_0x2c88b4,_0x358291){_0x2c88b4=_0x2c88b4-0x0;var _0x16946b=_0x34a7[_0x2c88b4];return _0x16946b;};'use strict';var EventEmitter=require(_0x734a('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x734a('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x734a('0x2')](0x0);var events={'afterCreate':_0x734a('0x3'),'afterUpdate':_0x734a('0x4'),'afterDestroy':_0x734a('0x5')};function emitEvent(_0x3a99f3){return function(_0x1a7446,_0x287e0e,_0x571f8e){ChatGroupEvents[_0x734a('0x6')](_0x3a99f3+':'+_0x1a7446['id'],_0x1a7446);ChatGroupEvents[_0x734a('0x6')](_0x3a99f3,_0x1a7446);_0x571f8e(null);};}for(var e in events){if(events[_0x734a('0x7')](e)){var event=events[e];ChatGroup[_0x734a('0x8')](e,emitEvent(event));}}module[_0x734a('0x9')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index ae59dd2..c5594a4 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 _0x6fca=['path','rimraf','./chatGroup.attributes','define','ChatGroup','chat_groups','util','api'];(function(_0x3d4f38,_0x37efb3){var _0x9535e8=function(_0x14e660){while(--_0x14e660){_0x3d4f38['push'](_0x3d4f38['shift']());}};_0x9535e8(++_0x37efb3);}(_0x6fca,0x15e));var _0xa6fc=function(_0x47f1a6,_0xaec74a){_0x47f1a6=_0x47f1a6-0x0;var _0x37d579=_0x6fca[_0x47f1a6];return _0x37d579;};'use strict';var _=require('lodash');var util=require(_0xa6fc('0x0'));var logger=require('../../config/logger')(_0xa6fc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6fc('0x2'));var rimraf=require(_0xa6fc('0x3'));var config=require('../../config/environment');var attributes=require(_0xa6fc('0x4'));module['exports']=function(_0x11cc95,_0x3f0158){return _0x11cc95[_0xa6fc('0x5')](_0xa6fc('0x6'),attributes,{'tableName':_0xa6fc('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15cd=['api','moment','bluebird','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','lodash','util'];(function(_0x46a4bd,_0x5bf665){var _0x36da2e=function(_0x5733a1){while(--_0x5733a1){_0x46a4bd['push'](_0x46a4bd['shift']());}};_0x36da2e(++_0x5bf665);}(_0x15cd,0x82));var _0xd15c=function(_0x44799d,_0x26c23a){_0x44799d=_0x44799d-0x0;var _0x4f4a20=_0x15cd[_0x44799d];return _0x4f4a20;};'use strict';var _=require(_0xd15c('0x0'));var util=require(_0xd15c('0x1'));var logger=require('../../config/logger')(_0xd15c('0x2'));var moment=require(_0xd15c('0x3'));var BPromise=require(_0xd15c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd15c('0x5'));var rimraf=require(_0xd15c('0x6'));var config=require('../../config/environment');var attributes=require(_0xd15c('0x7'));module[_0xd15c('0x8')]=function(_0x4200fd,_0x29f469){return _0x4200fd[_0xd15c('0x9')](_0xd15c('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index d3e5ce1..08b0c9c 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 _0x55ca=['then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','code','error','message','catch','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatGroup.socket','request'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x55ca,0x126));var _0xa55c=function(_0x105c51,_0x412d34){_0x105c51=_0x105c51-0x0;var _0x1f727d=_0x55ca[_0x105c51];return _0x1f727d;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});config[_0xa55c('0xa')]=_['defaults'](config[_0xa55c('0xa')],{'host':_0xa55c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa55c('0xa')]));require(_0xa55c('0xc'))['register'](socket);function respondWithRpcPromise(_0x5849ad,_0x473d0e,_0x20c76a){return new BPromise(function(_0x381d07,_0x5d8e5a){return client[_0xa55c('0xd')](_0x5849ad,_0x20c76a)[_0xa55c('0xe')](function(_0x508342){logger[_0xa55c('0xf')](_0xa55c('0x10'),_0x473d0e,_0xa55c('0x11'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x473d0e,_0xa55c('0x11'),JSON['stringify'](_0x508342));if(_0x508342['error']){if(_0x508342['error'][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x13')](_0xa55c('0x10'),_0x473d0e,_0x508342[_0xa55c('0x13')][_0xa55c('0x14')]);return _0x5d8e5a(_0x508342[_0xa55c('0x13')]['message']);}logger[_0xa55c('0x13')](_0xa55c('0x10'),_0x473d0e,_0x508342[_0xa55c('0x13')][_0xa55c('0x14')]);return _0x381d07(_0x508342[_0xa55c('0x13')][_0xa55c('0x14')]);}else{logger[_0xa55c('0xf')](_0xa55c('0x10'),_0x473d0e,_0xa55c('0x11'));_0x381d07(_0x508342['result'][_0xa55c('0x14')]);}})[_0xa55c('0x15')](function(_0x461284){logger[_0xa55c('0x13')](_0xa55c('0x10'),_0x473d0e,_0x461284);_0x5d8e5a(_0x461284);});});} \ No newline at end of file +var _0x9f62=['code','ChatGroup,\x20%s,\x20%s','message','result','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','request','info','request\x20sent','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f62,0x154));var _0x29f6=function(_0x547e28,_0xe5e255){_0x547e28=_0x547e28-0x0;var _0x1ac326=_0x9f62[_0x547e28];return _0x1ac326;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var moment=require('moment');var BPromise=require(_0x29f6('0x1'));var rs=require(_0x29f6('0x2'));var fs=require('fs');var Redis=require(_0x29f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29f6('0x4'))(_0x29f6('0x5'));var config=require(_0x29f6('0x6'));var jayson=require(_0x29f6('0x7'));var client=jayson['client'][_0x29f6('0x8')]({'port':0x232a});config[_0x29f6('0x9')]=_[_0x29f6('0xa')](config[_0x29f6('0x9')],{'host':_0x29f6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0xe25841,_0x44db16,_0x4fb455){return new BPromise(function(_0x5a0724,_0x29b3f5){return client[_0x29f6('0xc')](_0xe25841,_0x4fb455)['then'](function(_0x17b69c){logger[_0x29f6('0xd')]('ChatGroup,\x20%s,\x20%s',_0x44db16,'request\x20sent');logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'),JSON[_0x29f6('0xf')](_0x17b69c));if(_0x17b69c[_0x29f6('0x10')]){if(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x11')]===0x1f4){logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x29b3f5(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x5a0724(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'));_0x5a0724(_0x17b69c[_0x29f6('0x14')][_0x29f6('0x13')]);}})['catch'](function(_0xcb90){logger[_0x29f6('0x10')]('ChatGroup,\x20%s,\x20%s',_0x44db16,_0xcb90);_0x29b3f5(_0xcb90);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index f9c5e11..defce2e 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 _0xd84c=['register','length','./chatGroup.events','save','remove','update','emit','removeListener'];(function(_0x44392c,_0x1bbe72){var _0x9c0b23=function(_0x4c5850){while(--_0x4c5850){_0x44392c['push'](_0x44392c['shift']());}};_0x9c0b23(++_0x1bbe72);}(_0xd84c,0x102));var _0xcd84=function(_0xc0e030,_0x1f4406){_0xc0e030=_0xc0e030-0x0;var _0x43b84a=_0xd84c[_0xc0e030];return _0x43b84a;};'use strict';var ChatGroupEvents=require(_0xcd84('0x0'));var events=[_0xcd84('0x1'),_0xcd84('0x2'),_0xcd84('0x3')];function createListener(_0x2f3d51,_0x3213d7){return function(_0xbdfd34){_0x3213d7[_0xcd84('0x4')](_0x2f3d51,_0xbdfd34);};}function removeListener(_0x288020,_0x5a8c2e){return function(){ChatGroupEvents[_0xcd84('0x5')](_0x288020,_0x5a8c2e);};}exports[_0xcd84('0x6')]=function(_0x159209){for(var _0x3df569=0x0,_0x520d49=events[_0xcd84('0x7')];_0x3df569<_0x520d49;_0x3df569++){var _0x22c811=events[_0x3df569];var _0x3f3617=createListener('chatGroup:'+_0x22c811,_0x159209);ChatGroupEvents['on'](_0x22c811,_0x3f3617);}}; \ No newline at end of file +var _0x0cee=['save','remove','update','removeListener','register','length','chatGroup:','./chatGroup.events'];(function(_0x2cbb74,_0xe94407){var _0x1939ed=function(_0xa09cf7){while(--_0xa09cf7){_0x2cbb74['push'](_0x2cbb74['shift']());}};_0x1939ed(++_0xe94407);}(_0x0cee,0x12f));var _0xe0ce=function(_0x1aba40,_0x41bed2){_0x1aba40=_0x1aba40-0x0;var _0x17463f=_0x0cee[_0x1aba40];return _0x17463f;};'use strict';var ChatGroupEvents=require(_0xe0ce('0x0'));var events=[_0xe0ce('0x1'),_0xe0ce('0x2'),_0xe0ce('0x3')];function createListener(_0x315ac1,_0x25ec67){return function(_0x54f977){_0x25ec67['emit'](_0x315ac1,_0x54f977);};}function removeListener(_0xe181aa,_0x3e377b){return function(){ChatGroupEvents[_0xe0ce('0x4')](_0xe181aa,_0x3e377b);};}exports[_0xe0ce('0x5')]=function(_0x1cfee1){for(var _0x1ce646=0x0,_0x64f82c=events[_0xe0ce('0x6')];_0x1ce646<_0x64f82c;_0x1ce646++){var _0x494eca=events[_0x1ce646];var _0x27eea3=createListener(_0xe0ce('0x7')+_0x494eca,_0x1cfee1);ChatGroupEvents['on'](_0x494eca,_0x27eea3);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 14abd6d..9ab8251 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 _0x3df3=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getUnread','getMembers','/:id/messages','getMessages','create','post','/:id/members','addMembers','addMessage','put','update','destroy','delete','removeMembers','exports'];(function(_0x5a969e,_0x1d16c0){var _0x10686d=function(_0x36a89e){while(--_0x36a89e){_0x5a969e['push'](_0x5a969e['shift']());}};_0x10686d(++_0x1d16c0);}(_0x3df3,0x78));var _0x33df=function(_0x580b15,_0x28afa4){_0x580b15=_0x580b15-0x0;var _0x1adb1b=_0x3df3[_0x580b15];return _0x1adb1b;};'use strict';var multer=require(_0x33df('0x0'));var util=require(_0x33df('0x1'));var path=require(_0x33df('0x2'));var timeout=require(_0x33df('0x3'));var express=require(_0x33df('0x4'));var router=express[_0x33df('0x5')]();var auth=require(_0x33df('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x33df('0x7'));router[_0x33df('0x8')]('/',auth[_0x33df('0x9')](),controller[_0x33df('0xa')]);router[_0x33df('0x8')](_0x33df('0xb'),auth[_0x33df('0x9')](),controller[_0x33df('0xc')]);router['get'](_0x33df('0xd'),auth['isAuthenticated'](),controller[_0x33df('0xe')]);router[_0x33df('0x8')]('/:id/unread',auth['isAuthenticated'](),controller[_0x33df('0xf')]);router[_0x33df('0x8')]('/:id/members',auth[_0x33df('0x9')](),controller[_0x33df('0x10')]);router[_0x33df('0x8')](_0x33df('0x11'),auth['isAuthenticated'](),controller[_0x33df('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x33df('0x13')]);router[_0x33df('0x14')](_0x33df('0x15'),auth['isAuthenticated'](),controller[_0x33df('0x16')]);router['post'](_0x33df('0x11'),auth[_0x33df('0x9')](),controller[_0x33df('0x17')]);router[_0x33df('0x18')](_0x33df('0xd'),auth[_0x33df('0x9')](),controller[_0x33df('0x19')]);router['delete'](_0x33df('0xd'),auth[_0x33df('0x9')](),controller[_0x33df('0x1a')]);router[_0x33df('0x1b')](_0x33df('0x15'),auth[_0x33df('0x9')](),controller[_0x33df('0x1c')]);module[_0x33df('0x1d')]=router; \ No newline at end of file +var _0x3395=['update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','put'];(function(_0x599d7f,_0xc586e8){var _0x3346d3=function(_0x56b820){while(--_0x56b820){_0x599d7f['push'](_0x599d7f['shift']());}};_0x3346d3(++_0xc586e8);}(_0x3395,0x155));var _0x5339=function(_0x3f8d57,_0x15156d){_0x3f8d57=_0x3f8d57-0x0;var _0x5372ad=_0x3395[_0x3f8d57];return _0x5372ad;};'use strict';var multer=require(_0x5339('0x0'));var util=require(_0x5339('0x1'));var path=require(_0x5339('0x2'));var timeout=require(_0x5339('0x3'));var express=require(_0x5339('0x4'));var router=express['Router']();var auth=require(_0x5339('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5339('0x6'));var controller=require(_0x5339('0x7'));router[_0x5339('0x8')]('/',auth[_0x5339('0x9')](),controller[_0x5339('0xa')]);router[_0x5339('0x8')]('/describe',auth[_0x5339('0x9')](),controller[_0x5339('0xb')]);router[_0x5339('0x8')](_0x5339('0xc'),auth['isAuthenticated'](),controller[_0x5339('0xd')]);router[_0x5339('0x8')](_0x5339('0xe'),auth[_0x5339('0x9')](),controller[_0x5339('0xf')]);router[_0x5339('0x8')](_0x5339('0x10'),auth[_0x5339('0x9')](),controller[_0x5339('0x11')]);router[_0x5339('0x8')](_0x5339('0x12'),auth[_0x5339('0x9')](),controller[_0x5339('0x13')]);router[_0x5339('0x14')]('/',auth[_0x5339('0x9')](),controller['create']);router[_0x5339('0x14')](_0x5339('0x10'),auth[_0x5339('0x9')](),controller[_0x5339('0x15')]);router[_0x5339('0x14')]('/:id/messages',auth[_0x5339('0x9')](),controller['addMessage']);router[_0x5339('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x5339('0x17')]);router[_0x5339('0x18')]('/:id',auth[_0x5339('0x9')](),controller[_0x5339('0x19')]);router[_0x5339('0x18')](_0x5339('0x10'),auth[_0x5339('0x9')](),controller[_0x5339('0x1a')]);module[_0x5339('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index ead1897..dc9138f 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 _0x878f=['long','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x878f,0x173));var _0xf878=function(_0xbc2566,_0xa8ea85){_0xbc2566=_0xbc2566-0x0;var _0x57c07b=_0x878f[_0xbc2566];return _0x57c07b;};'use strict';var Sequelize=require('sequelize');module[_0xf878('0x0')]={'closed':{'type':Sequelize[_0xf878('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xf878('0x2')]},'ratingType':{'type':Sequelize[_0xf878('0x3')](_0xf878('0x4'),_0xf878('0x5')),'defaultValue':_0xf878('0x4')},'ratingMessage':{'type':Sequelize[_0xf878('0x6')]},'pathTranscript':{'type':Sequelize[_0xf878('0x6')]},'mailTranscript':{'type':Sequelize[_0xf878('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf878('0x8')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xf878('0x7')]},'browserVersion':{'type':Sequelize[_0xf878('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xf878('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['STRING']},'customerIp':{'type':Sequelize[_0xf878('0x7')]},'formData':{'type':Sequelize[_0xf878('0x6')](_0xf878('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xf878('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xf878('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf878('0x7')]}}; \ No newline at end of file +var _0x5eb8=['thumb','TEXT','STRING','DATE','long','BOOLEAN','INTEGER','ENUM','star'];(function(_0x1ae2f1,_0x15db1c){var _0x276e2a=function(_0x1a78f2){while(--_0x1a78f2){_0x1ae2f1['push'](_0x1ae2f1['shift']());}};_0x276e2a(++_0x15db1c);}(_0x5eb8,0xb0));var _0x85eb=function(_0x356127,_0x4873ac){_0x356127=_0x356127-0x0;var _0x5d4c75=_0x5eb8[_0x356127];return _0x5d4c75;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x85eb('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x85eb('0x1')]},'ratingType':{'type':Sequelize[_0x85eb('0x2')](_0x85eb('0x3'),_0x85eb('0x4')),'defaultValue':_0x85eb('0x3')},'ratingMessage':{'type':Sequelize[_0x85eb('0x5')]},'pathTranscript':{'type':Sequelize[_0x85eb('0x5')]},'mailTranscript':{'type':Sequelize[_0x85eb('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x85eb('0x7')]},'disposition':{'type':Sequelize[_0x85eb('0x6')]},'note':{'type':Sequelize[_0x85eb('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x85eb('0x6')]},'osName':{'type':Sequelize[_0x85eb('0x6')]},'osVersion':{'type':Sequelize[_0x85eb('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x85eb('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x85eb('0x6')]},'customerIp':{'type':Sequelize[_0x85eb('0x6')]},'formData':{'type':Sequelize[_0x85eb('0x5')](_0x85eb('0x8'))},'read1stAt':{'type':Sequelize[_0x85eb('0x7')]},'lastMsgAt':{'type':Sequelize[_0x85eb('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x85eb('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x85eb('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 6bfff30..332c349 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 _0x7a54=['register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','destroy','stack','name','send','Users','map','TagIds','split','push','index','ChatInteraction','keys','filters','intersection','model','attributes','query','length','hasOwnProperty','nolimit','sort','select','field','color','from','tools_tags','COUNT(*)','chat_messages','where','me.ChatInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.ChatInteractionId','user_has_chat_interactions','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','advancedFilter','startOf','day','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','forEach','TagId','unreadMessages','isArray','value','tableAlias','\x20=\x20?','LIKE','ContactId','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','\x20IN\x20?','c.firstName','filter','isNil','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','\x20IS\x20NULL','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','toString','join','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','group','Sequelize','SELECT','clone','read','`unreadMessages`\x20=\x200','having','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','sequelize','keyBy','merge','COUNT(me.id)','a.key','Account.key','i.*','Contact.firstName','Contact.email','Contact.phone','Contact.mobile','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','chat_interaction_has_tags','groupBy','ChatInteractionId','all','rows','show','params','rawAttributes','fields','include','find','create','body','describe','customUpdate','abandon','entity\x20not\x20found','UserId','ValidationError','Interaction\x20already\x20assigned','disposition','originalname','basename','file','filename','type','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','attachId','download','root','server/files/attachments/','mailTranscript','server/files/chat/upload/','transcript-%s.txt','pathTranscript','ChatMessage','User','ChatWebsite','%s%d','agentAlias','customer','Visitor','website_alias','System','agent_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','user','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','omit','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','getMyMessages','pick','includeAgent','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','transcript-%d-%s.zip','Messages','direction','CmContact','Contact','firstName','lastName','Account','Owner','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x20\x20\x20\x20\x20\x20','30px','%s\x20#%d','Chat','YYYY-MM-DD','mkdirSync','N.A.','closed','osName','customerIp','tail','existsSync','pipe','createWriteStream','out','renderFile','views','toFile','log','err','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x7a54,0x106));var _0x47a5=function(_0x54d151,_0x1baa03){_0x54d151=_0x54d151-0x0;var _0x2dc1fe=_0x7a54[_0x54d151];return _0x2dc1fe;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x47a5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x47a5('0x11'));var config=require(_0x47a5('0x12'));var db=require(_0x47a5('0x13'))['db'];config[_0x47a5('0x14')]=_[_0x47a5('0x15')](config[_0x47a5('0x14')],{'host':_0x47a5('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0x14')]));require(_0x47a5('0x17'))[_0x47a5('0x18')](socket);var jayson=require(_0x47a5('0x19'));var client=jayson[_0x47a5('0x1a')][_0x47a5('0x1b')]({'port':0x232b});var client9004=jayson[_0x47a5('0x1a')][_0x47a5('0x1b')]({'port':0x232c});function checkPasswordPattern(_0x4e99a8,_0x362359,_0x11faf5){if(_0x11faf5){var _0x3b001e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3b001e[_0x47a5('0x1c')](_0x362359)){return _0x4e99a8;}else{throw new Error(_0x47a5('0x1d'));}}else{return _0x4e99a8;}}function respondWithRpcPromise(_0x574af6,_0x549de3,_0x138bc0,_0x4b966e){return new BPromise(function(_0x5247fd,_0x423a81){var _0xaf70a6=_0x4b966e||client;return _0xaf70a6[_0x47a5('0x1e')](_0x574af6,_0x138bc0)[_0x47a5('0x1f')](function(_0x477b1d){logger[_0x47a5('0x20')](_0x47a5('0x21'),_0x549de3,_0x47a5('0x22'));logger[_0x47a5('0x23')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x549de3,_0x47a5('0x22'),JSON[_0x47a5('0x24')](_0x477b1d));if(_0x477b1d['error']){if(_0x477b1d[_0x47a5('0x25')][_0x47a5('0x26')]===0x1f4){logger[_0x47a5('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x549de3,_0x477b1d[_0x47a5('0x25')][_0x47a5('0x27')]);return _0x423a81(_0x477b1d[_0x47a5('0x25')][_0x47a5('0x27')]);}logger['error'](_0x47a5('0x21'),_0x549de3,_0x477b1d[_0x47a5('0x25')]['message']);return _0x5247fd(_0x477b1d[_0x47a5('0x25')][_0x47a5('0x27')]);}else{logger[_0x47a5('0x20')](_0x47a5('0x21'),_0x549de3,_0x47a5('0x22'));_0x5247fd(_0x477b1d['result']['message']);}})[_0x47a5('0x28')](function(_0x5686db){logger[_0x47a5('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x549de3,_0x5686db);_0x423a81(_0x5686db);});});}function respondWithStatusCode(_0x23cb77,_0x378208){_0x378208=_0x378208||0xcc;return function(_0x36ad34){if(_0x36ad34){return _0x23cb77[_0x47a5('0x29')](_0x378208);}return _0x23cb77[_0x47a5('0x2a')](_0x378208)[_0x47a5('0x2b')]();};}function respondWithResult(_0x24b162,_0x136b14){_0x136b14=_0x136b14||0xc8;return function(_0x16631f){if(_0x16631f){return _0x24b162[_0x47a5('0x2a')](_0x136b14)[_0x47a5('0x2c')](_0x16631f);}};}function respondWithFilteredResult(_0x11a4fa,_0x3ad507){return function(_0x528582){if(_0x528582){var _0x243210=_0x528582[_0x47a5('0x2d')],_0x51833b=_0x3ad507['offset'],_0x2ef875=_0x3ad507[_0x47a5('0x2e')]+_0x3ad507[_0x47a5('0x2f')],_0x9ac908;if(_0x2ef875>=_0x243210){_0x2ef875=_0x243210;_0x9ac908=0xc8;}else{_0x9ac908=0xce;}_0x11a4fa[_0x47a5('0x2a')](_0x9ac908);return _0x11a4fa[_0x47a5('0x30')]('Content-Range',_0x51833b+'-'+_0x2ef875+'/'+_0x243210)['json'](_0x528582);}return null;};}function patchUpdates(_0x6f9a12){return function(_0xfb5ddb){try{jsonpatch['apply'](_0xfb5ddb,_0x6f9a12,!![]);}catch(_0x4e1006){return BPromise[_0x47a5('0x31')](_0x4e1006);}return _0xfb5ddb[_0x47a5('0x32')]();};}function saveUpdates(_0x57bff6,_0x42f70c){return function(_0x53119b){if(_0x53119b){return _0x53119b[_0x47a5('0x33')](_0x57bff6)[_0x47a5('0x1f')](function(_0x5c5162){return _0x5c5162;});}return null;};}function removeEntity(_0x4843c0,_0x274e34){return function(_0x5910bb){if(_0x5910bb){return _0x5910bb[_0x47a5('0x34')]()[_0x47a5('0x1f')](function(){_0x4843c0[_0x47a5('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18f7e9,_0x50c086){return function(_0x53c754){if(!_0x53c754){_0x18f7e9[_0x47a5('0x29')](0x194);}return _0x53c754;};}function handleError(_0x5a8a7c,_0x25cce0){_0x25cce0=_0x25cce0||0x1f4;return function(_0x5ef577){logger[_0x47a5('0x25')](_0x5ef577[_0x47a5('0x35')]);if(_0x5ef577[_0x47a5('0x36')]){delete _0x5ef577[_0x47a5('0x36')];}_0x5a8a7c[_0x47a5('0x2a')](_0x25cce0)[_0x47a5('0x37')](_0x5ef577);};}function getInteractionUsers(_0xee582c,_0x452be5){return new BPromise(function(_0x1a0d23,_0x4caed5){try{if(_0x452be5[_0xee582c['id']]){_0xee582c[_0x47a5('0x38')]=_[_0x47a5('0x39')](_0x452be5[_0xee582c['id']],function(_0x511c06){return{'id':_0x511c06['id']};});}}catch(_0x2c50d6){_0x4caed5(_0x2c50d6);}_0x1a0d23(_0xee582c);});}function getInteractionTags(_0x2bf53d,_0x1d4348){return new BPromise(function(_0x49c4b5,_0x101f70){try{if(_0x2bf53d[_0x47a5('0x3a')]){_0x2bf53d['Tags']=[];_0x2bf53d[_0x47a5('0x3a')][_0x47a5('0x3b')](',')['forEach'](function(_0x55c5eb){_0x2bf53d['Tags'][_0x47a5('0x3c')](_0x1d4348[_0x55c5eb]);});}delete _0x2bf53d['TagIds'];}catch(_0x9b5eaf){_0x101f70(_0x9b5eaf);}_0x49c4b5(_0x2bf53d);});}function updateChatInteraction(_0x1f9631,_0x301a85,_0x111f0d){return new BPromise(function(_0x1b2c80,_0xcb5243){return getInteractionUsers(_0x1f9631,_0x111f0d)[_0x47a5('0x1f')](function(_0x1f3d01){return getInteractionTags(_0x1f3d01,_0x301a85);})[_0x47a5('0x1f')](function(_0x36a24e){_0x1b2c80(_0x36a24e);})[_0x47a5('0x28')](function(_0x1658e8){_0xcb5243(_0x1658e8);});});}exports[_0x47a5('0x3d')]=function(_0x56dbbd,_0x1fbece){var _0x1c36fa={},_0x331474={},_0x23bd8d={'count':0x0,'rows':[]};var _0x586f4f=db[_0x47a5('0x3e')]['rawAttributes'];_0x331474['model']=_['keys'](_0x586f4f);_0x331474['query']=_[_0x47a5('0x3f')](_0x56dbbd['query']);_0x331474[_0x47a5('0x40')]=_[_0x47a5('0x41')](_0x331474[_0x47a5('0x42')],_0x331474['query']);_0x1c36fa[_0x47a5('0x43')]=_[_0x47a5('0x41')](_0x331474['model'],qs['fields'](_0x56dbbd[_0x47a5('0x44')]['fields']));_0x1c36fa[_0x47a5('0x43')]=_0x1c36fa[_0x47a5('0x43')][_0x47a5('0x45')]?_0x1c36fa[_0x47a5('0x43')]:_0x331474[_0x47a5('0x42')];if(!_0x56dbbd[_0x47a5('0x44')][_0x47a5('0x46')](_0x47a5('0x47'))){_0x1c36fa[_0x47a5('0x2f')]=qs[_0x47a5('0x2f')](_0x56dbbd[_0x47a5('0x44')][_0x47a5('0x2f')]);_0x1c36fa[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x56dbbd[_0x47a5('0x44')][_0x47a5('0x2e')]);}_0x1c36fa['order']=qs[_0x47a5('0x48')](_0x56dbbd[_0x47a5('0x44')]['sort']);_0x1c36fa['where']=qs[_0x47a5('0x40')](_['pick'](_0x56dbbd[_0x47a5('0x44')],_0x331474[_0x47a5('0x40')]));var _0x54c35f=[];var _0x4f62d3=squel[_0x47a5('0x49')]()['field']('id')[_0x47a5('0x4a')](_0x47a5('0x36'))[_0x47a5('0x4a')](_0x47a5('0x4b'))[_0x47a5('0x4c')](_0x47a5('0x4d'));var _0x238ebb=squel['select']()['field'](_0x47a5('0x4e'))[_0x47a5('0x4c')](_0x47a5('0x4f'),'me')[_0x47a5('0x50')](_0x47a5('0x51'))[_0x47a5('0x50')](_0x47a5('0x52'))['where'](_0x47a5('0x53'));var _0x1c9a62=squel[_0x47a5('0x49')]()['field'](_0x47a5('0x54'))['field'](_0x47a5('0x55'))[_0x47a5('0x4c')](_0x47a5('0x56'),'ui')[_0x47a5('0x57')]('users','u',_0x47a5('0x58'));var _0x1e6de3=squel[_0x47a5('0x49')]()[_0x47a5('0x4c')](_0x47a5('0x59'),'i')[_0x47a5('0x57')](_0x47a5('0x5a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x47a5('0x57')](_0x47a5('0x5b'),'o',_0x47a5('0x5c'))[_0x47a5('0x57')](_0x47a5('0x5d'),'a',_0x47a5('0x5e'))['left_join'](_0x47a5('0x4f'),'me',_0x47a5('0x5f'));var _0x1aa581=squel['expr']();if(_0x56dbbd[_0x47a5('0x44')][_0x47a5('0x60')]){var _0x5018e9=JSON['parse'](_0x56dbbd['query'][_0x47a5('0x60')]);_[_0x47a5('0x3f')](_0x5018e9)['forEach'](function(_0x4cf792){var _0x6d6b2b=_0x5018e9[_0x4cf792];if(_0x4cf792==='createdAt'){var _0x16bb8a=moment(_0x6d6b2b['value']['dateStart'])[_0x47a5('0x61')](_0x47a5('0x62'))['utc']()[_0x47a5('0x63')]();var _0x72fe=moment(_0x72fe)['utc']()['endOf'](_0x47a5('0x62'))[_0x47a5('0x63')]();_0x1aa581[_0x47a5('0x64')](_0x47a5('0x65'),_0x16bb8a,_0x72fe);}else{if(_['isArray'](_0x6d6b2b[_0x47a5('0x66')])){_0x6d6b2b[_0x47a5('0x66')][_0x47a5('0x67')](function(_0x5a33b8){switch(_0x6d6b2b[_0x47a5('0x66')]['value']){case'IS':if(_0x4cf792!==_0x47a5('0x68')&&_0x4cf792!==_0x47a5('0x69')){if(_[_0x47a5('0x6a')](_0x6d6b2b[_0x47a5('0x6b')])&&_0x6d6b2b[_0x47a5('0x6b')]['length']>0x1){_0x1aa581[_0x47a5('0x64')](_0x6d6b2b['tableAlias']+'.'+_0x4cf792+'\x20IN\x20?',_0x6d6b2b['value']);}else{_0x1aa581['and'](_0x6d6b2b[_0x47a5('0x6c')]+'.'+_0x4cf792+_0x47a5('0x6d'),_0x6d6b2b[_0x47a5('0x6b')][0x0]);}}break;case'=':_0x1aa581['and'](_0x6d6b2b['tableAlias']+'.'+_0x4cf792+_0x47a5('0x6d'),_0x6d6b2b[_0x47a5('0x6b')]);break;case _0x47a5('0x6e'):if(_0x4cf792===_0x47a5('0x6f')){_0x1aa581[_0x47a5('0x64')]('c.firstName'+_0x47a5('0x70'),'%'+_0x6d6b2b['value']+'%');_0x1aa581['or'](_0x47a5('0x71')+_0x47a5('0x70'),'%'+_0x6d6b2b['value']+'%');_0x1aa581['or'](_0x47a5('0x72')+_0x47a5('0x70'),'%'+_0x6d6b2b[_0x47a5('0x6b')]+'%');}else{_0x1aa581[_0x47a5('0x64')](_0x6d6b2b[_0x47a5('0x6c')]+'.'+_0x4cf792+_0x47a5('0x70'),'%'+_0x6d6b2b[_0x47a5('0x6b')]+'%');}break;case'>':_0x1aa581[_0x47a5('0x64')](_0x6d6b2b['tableAlias']+'.'+_0x4cf792+_0x47a5('0x73'),_0x6d6b2b[_0x47a5('0x6b')]);break;case'<':_0x1aa581[_0x47a5('0x64')](_0x6d6b2b[_0x47a5('0x6c')]+'.'+_0x4cf792+_0x47a5('0x74'),_0x6d6b2b['value']);break;}});}else{switch(_0x6d6b2b[_0x47a5('0x66')][_0x47a5('0x6b')]){case'IS':if(_0x4cf792!==_0x47a5('0x68')&&_0x4cf792!==_0x47a5('0x69')){if(_[_0x47a5('0x6a')](_0x6d6b2b[_0x47a5('0x6b')])&&_0x6d6b2b[_0x47a5('0x6b')][_0x47a5('0x45')]>0x1){_0x1aa581[_0x47a5('0x64')](_0x6d6b2b[_0x47a5('0x6c')]+'.'+_0x4cf792+_0x47a5('0x75'),_0x6d6b2b[_0x47a5('0x6b')]);}else{_0x1aa581[_0x47a5('0x64')](_0x6d6b2b[_0x47a5('0x6c')]+'.'+_0x4cf792+_0x47a5('0x6d'),_0x6d6b2b['value'][0x0]);}}break;case'=':_0x1aa581[_0x47a5('0x64')](_0x6d6b2b[_0x47a5('0x6c')]+'.'+_0x4cf792+_0x47a5('0x6d'),_0x6d6b2b['value']);break;case _0x47a5('0x6e'):if(_0x4cf792===_0x47a5('0x6f')){_0x1aa581[_0x47a5('0x64')](_0x47a5('0x76')+'\x20LIKE\x20?','%'+_0x6d6b2b[_0x47a5('0x6b')]+'%');_0x1aa581['or']('c.lastName'+_0x47a5('0x70'),'%'+_0x6d6b2b['value']+'%');_0x1aa581['or'](_0x47a5('0x72')+'\x20LIKE\x20?','%'+_0x6d6b2b[_0x47a5('0x6b')]+'%');}else{_0x1aa581[_0x47a5('0x64')](_0x6d6b2b[_0x47a5('0x6c')]+'.'+_0x4cf792+'\x20LIKE\x20?','%'+_0x6d6b2b['value']+'%');}break;case'>':_0x1aa581['and'](_0x6d6b2b[_0x47a5('0x6c')]+'.'+_0x4cf792+_0x47a5('0x73'),_0x6d6b2b[_0x47a5('0x6b')]);break;case'<':_0x1aa581[_0x47a5('0x64')](_0x6d6b2b['tableAlias']+'.'+_0x4cf792+_0x47a5('0x74'),_0x6d6b2b[_0x47a5('0x6b')]);break;}}}});}else{var _0x390bc0=_(Object[_0x47a5('0x3f')](_0x56dbbd[_0x47a5('0x44')]))[_0x47a5('0x39')](function(_0x1155f6){return _0x586f4f[_0x47a5('0x46')](_0x1155f6)?_0x1155f6:undefined;})[_0x47a5('0x77')](function(_0xc69a68){return!_[_0x47a5('0x78')](_0xc69a68);})[_0x47a5('0x6b')]();if(!_['isEmpty'](_0x390bc0)){_0x390bc0[_0x47a5('0x67')](function(_0x4833be){if(_0x4833be===_0x47a5('0x79')){_0x1e6de3[_0x47a5('0x50')](_0x47a5('0x7a'),[][_0x47a5('0x7b')](_0x56dbbd[_0x47a5('0x44')][_0x4833be]));}else if(_0x4833be===_0x47a5('0x7c')){var _0x12025a=JSON[_0x47a5('0x7d')](_0x56dbbd[_0x47a5('0x44')][_0x4833be])[_0x47a5('0x7e')];var _0x1cfb37=JSON[_0x47a5('0x7d')](_0x56dbbd[_0x47a5('0x44')][_0x4833be])[_0x47a5('0x7f')];_0x1e6de3[_0x47a5('0x50')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x12025a,_0x1cfb37);}else{if(_0x56dbbd['query'][_0x4833be]==='null'){_0x1e6de3['where']('i.'+_0x4833be+_0x47a5('0x80'));}else{_0x1e6de3[_0x47a5('0x50')]('i.'+_0x4833be+'\x20=\x20?',_0x56dbbd[_0x47a5('0x44')][_0x4833be]);}}});}if(_0x56dbbd[_0x47a5('0x44')][_0x47a5('0x77')]){var _0x396102=_0x56dbbd[_0x47a5('0x44')][_0x47a5('0x77')][_0x47a5('0x81')]('\x5c','\x5c\x5c')[_0x47a5('0x81')]('\x27\x27',_0x47a5('0x82'));if(qs[_0x47a5('0x83')](_0x396102)){_0x1aa581['or'](_0x47a5('0x84'),_0x396102+'%');}else{var _0x5e5f16=[];_0x396102[_0x47a5('0x3b')]('\x20')[_0x47a5('0x67')](function(_0x420671){_0x5e5f16['push']('+'+_0x420671[_0x47a5('0x85')]());});var _0x32f393=_0x5e5f16[_0x47a5('0x86')]('\x20');_0x1aa581['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x32f393)['or'](_0x47a5('0x87'),_0x396102+'%');}}}_0x1e6de3['where'](_0x1aa581);if(_0x1c36fa['order']){_0x1c36fa[_0x47a5('0x88')][_0x47a5('0x67')](function(_0x277486){_0x1e6de3[_0x47a5('0x88')]('i.'+_0x277486[0x0],_0x277486[0x1]===_0x47a5('0x89')?![]:!![]);});}_0x1e6de3[_0x47a5('0x8a')]('i.id');var _0x592322={'type':db[_0x47a5('0x8b')]['QueryTypes'][_0x47a5('0x8c')],'raw':!![]};var _0x3fffd1=_0x1e6de3[_0x47a5('0x8d')]()[_0x47a5('0x4a')]('COUNT(*)')[_0x47a5('0x4a')]('COUNT(me.id)','unreadMessages');if(!_0x56dbbd[_0x47a5('0x44')][_0x47a5('0x60')]){if(_0x56dbbd['query'][_0x47a5('0x8e')]){if(_0x56dbbd[_0x47a5('0x44')][_0x47a5('0x8e')]==0x1){_0x3fffd1['having'](_0x47a5('0x8f'));_0x1e6de3['having'](_0x47a5('0x8f'));}else{_0x3fffd1[_0x47a5('0x90')](_0x47a5('0x91'));_0x1e6de3['having'](_0x47a5('0x91'));}}if(_0x56dbbd[_0x47a5('0x44')][_0x47a5('0x92')]){var _0x4b3fef=_[_0x47a5('0x6a')](_0x56dbbd['query'][_0x47a5('0x92')])?_0x56dbbd['query'][_0x47a5('0x92')]:new Array(_0x56dbbd[_0x47a5('0x44')][_0x47a5('0x92')]);var _0x211fbf=squel['expr']();_0x4b3fef[_0x47a5('0x67')](function(_0x2ae130){_0x211fbf['or'](_0x47a5('0x93'),'%,'+_0x2ae130+',%');});_0x1e6de3[_0x47a5('0x90')](_0x211fbf);_0x3fffd1[_0x47a5('0x57')]('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id');_0x3fffd1[_0x47a5('0x57')]('tools_tags','t',_0x47a5('0x94'));_0x3fffd1[_0x47a5('0x50')](_0x47a5('0x95'),_0x4b3fef);}}else{var _0x5018e9=JSON[_0x47a5('0x7d')](_0x56dbbd[_0x47a5('0x44')]['advancedFilter']);_[_0x47a5('0x3f')](_0x5018e9)[_0x47a5('0x67')](function(_0x19acfa){var _0x113beb=_0x5018e9[_0x19acfa];if(_0x19acfa==='TagId'){var _0x4b5353=_0x113beb[_0x47a5('0x6b')];var _0x263046=squel['expr']();_0x4b5353[_0x47a5('0x67')](function(_0x23f055){_0x263046['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x23f055+',%');});_0x1e6de3[_0x47a5('0x90')](_0x263046);_0x3fffd1[_0x47a5('0x57')](_0x47a5('0x96'),'it','it.MailInteractionId\x20=\x20i.id');_0x3fffd1[_0x47a5('0x57')]('tools_tags','t',_0x47a5('0x94'));_0x3fffd1['where'](_0x47a5('0x95'),_0x4b5353);}else if(_0x19acfa===_0x47a5('0x69')){if(_0x113beb['value'][_0x47a5('0x45')]===0x1){if(_0x113beb['value'][0x0]===0x1){_0x3fffd1[_0x47a5('0x90')](_0x47a5('0x8f'));_0x1e6de3[_0x47a5('0x90')](_0x47a5('0x8f'));}else{_0x3fffd1['having'](_0x47a5('0x91'));_0x1e6de3['having']('`unreadMessages`\x20>\x200');}}}});}db[_0x47a5('0x97')][_0x47a5('0x44')](_0x3fffd1[_0x47a5('0x85')](),_0x592322)[_0x47a5('0x1f')](function(_0x380c8b){_0x23bd8d['count']=_0x380c8b[_0x47a5('0x45')];if(_0x23bd8d[_0x47a5('0x2d')]===0x0)return[];return db[_0x47a5('0x97')][_0x47a5('0x44')](_0x4f62d3['toString'](),_0x592322)[_0x47a5('0x1f')](function(_0x4af162){_0x54c35f=_[_0x47a5('0x98')](_0x4af162,'id');_0x592322=_[_0x47a5('0x99')](_0x592322,{'model':db[_0x47a5('0x3e')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x1e6de3[_0x47a5('0x4a')](_0x47a5('0x9a'),_0x47a5('0x69'));_0x1e6de3[_0x47a5('0x4a')](_0x47a5('0x9b'),_0x47a5('0x9c'));_0x1e6de3['field'](_0x47a5('0x9d'));_0x1e6de3[_0x47a5('0x4a')]('c.firstName',_0x47a5('0x9e'));_0x1e6de3[_0x47a5('0x4a')](_0x47a5('0x71'),'Contact.lastName');_0x1e6de3['field'](_0x47a5('0x72'),_0x47a5('0x9f'));_0x1e6de3['field']('c.phone',_0x47a5('0xa0'));_0x1e6de3[_0x47a5('0x4a')]('c.mobile',_0x47a5('0xa1'));_0x1e6de3[_0x47a5('0x4a')]('c.fax',_0x47a5('0xa2'));_0x1e6de3[_0x47a5('0x4a')](_0x47a5('0xa3'),_0x47a5('0x3a'));_0x1e6de3[_0x47a5('0x57')](_0x47a5('0xa4'),'it','it.ChatInteractionId\x20=\x20i.id');_0x1e6de3['left_join']('tools_tags','t',_0x47a5('0x94'));_0x1e6de3[_0x47a5('0x2f')](_0x1c36fa['limit']);_0x1e6de3[_0x47a5('0x2e')](_0x1c36fa[_0x47a5('0x2e')]);return db[_0x47a5('0x97')][_0x47a5('0x44')](_0x1e6de3[_0x47a5('0x85')](),_0x592322);})['then'](function(_0x3e7750){_0x1c9a62['where']('ui.ChatInteractionId\x20IN\x20?',_['map'](_0x3e7750,'id'));return db[_0x47a5('0x97')]['query'](_0x1c9a62[_0x47a5('0x85')](),_0x592322)[_0x47a5('0x1f')](function(_0x5a316e){var _0x49f791=_[_0x47a5('0xa5')](_0x5a316e,_0x47a5('0xa6'));var _0x35bf37=[];_0x3e7750[_0x47a5('0x67')](function(_0x392ad7){_0x35bf37['push'](updateChatInteraction(_0x392ad7,_0x54c35f,_0x49f791));});return BPromise[_0x47a5('0xa7')](_0x35bf37);});});})[_0x47a5('0x1f')](function(_0x519f0a){_0x23bd8d[_0x47a5('0xa8')]=_0x519f0a;return _0x23bd8d;})[_0x47a5('0x1f')](respondWithFilteredResult(_0x1fbece,_0x1c36fa))[_0x47a5('0x28')](handleError(_0x1fbece,null));};exports[_0x47a5('0xa9')]=function(_0x3c117a,_0x186aad){var _0x5112d7={'raw':![],'where':{'id':_0x3c117a[_0x47a5('0xaa')]['id']}},_0x6a8174={};_0x6a8174['model']=_[_0x47a5('0x3f')](db[_0x47a5('0x3e')][_0x47a5('0xab')]);_0x6a8174[_0x47a5('0x44')]=_['keys'](_0x3c117a['query']);_0x6a8174['filters']=_['intersection'](_0x6a8174[_0x47a5('0x42')],_0x6a8174[_0x47a5('0x44')]);_0x5112d7[_0x47a5('0x43')]=_[_0x47a5('0x41')](_0x6a8174[_0x47a5('0x42')],qs[_0x47a5('0xac')](_0x3c117a[_0x47a5('0x44')][_0x47a5('0xac')]));_0x5112d7['attributes']=_0x5112d7[_0x47a5('0x43')][_0x47a5('0x45')]?_0x5112d7[_0x47a5('0x43')]:_0x6a8174[_0x47a5('0x42')];if(_0x3c117a['query']['includeAll']){_0x5112d7[_0x47a5('0xad')]=[{'all':!![]}];}_0x5112d7=_['merge']({},_0x5112d7,_0x3c117a['options']);return db[_0x47a5('0x3e')][_0x47a5('0xae')](_0x5112d7)['then'](handleEntityNotFound(_0x186aad,null))[_0x47a5('0x1f')](respondWithResult(_0x186aad,null))[_0x47a5('0x28')](handleError(_0x186aad,null));};exports[_0x47a5('0xaf')]=function(_0x48835f,_0x740bdf){return db[_0x47a5('0x3e')]['create'](_0x48835f[_0x47a5('0xb0')],{})[_0x47a5('0x1f')](respondWithResult(_0x740bdf,0xc9))[_0x47a5('0x28')](handleError(_0x740bdf,null));};exports[_0x47a5('0x33')]=function(_0x12a56a,_0x475114){if(_0x12a56a['body']['id']){delete _0x12a56a[_0x47a5('0xb0')]['id'];}return db['ChatInteraction'][_0x47a5('0xae')]({'where':{'id':_0x12a56a[_0x47a5('0xaa')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x475114,null))[_0x47a5('0x1f')](saveUpdates(_0x12a56a['body'],null))[_0x47a5('0x1f')](respondWithResult(_0x475114,null))[_0x47a5('0x28')](handleError(_0x475114,null));};exports[_0x47a5('0x34')]=function(_0x27baad,_0x34b7c9){return db[_0x47a5('0x3e')][_0x47a5('0xae')]({'where':{'id':_0x27baad[_0x47a5('0xaa')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x34b7c9,null))[_0x47a5('0x1f')](removeEntity(_0x34b7c9,null))[_0x47a5('0x28')](handleError(_0x34b7c9,null));};exports[_0x47a5('0xb1')]=function(_0x52a2be,_0x4218fd){return db[_0x47a5('0x3e')]['describe']()[_0x47a5('0x1f')](respondWithResult(_0x4218fd,null))[_0x47a5('0x28')](handleError(_0x4218fd,null));};exports[_0x47a5('0xb2')]=function(_0x2ccf21,_0x2ff467){if(_0x2ccf21['body']['id']){delete _0x2ccf21[_0x47a5('0xb0')]['id'];}return db[_0x47a5('0x3e')][_0x47a5('0xae')]({'where':{'id':_0x2ccf21[_0x47a5('0xaa')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x2ff467,null))[_0x47a5('0x1f')](saveUpdates(_0x2ccf21[_0x47a5('0xb0')],null))['then'](respondWithResult(_0x2ff467,null))['catch'](handleError(_0x2ff467,null));};exports[_0x47a5('0xb3')]=function(_0x580ce8,_0xf105b8,_0x5544a2){if(_0x580ce8[_0x47a5('0xb0')]['id']){delete _0x580ce8[_0x47a5('0xb0')]['id'];}return db[_0x47a5('0x3e')][_0x47a5('0xae')]({'where':{'id':_0x580ce8['params']['id']}})[_0x47a5('0x1f')](function(_0x11f07b){if(!_0x11f07b){logger[_0x47a5('0x25')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,_0x47a5('0xb4'));_0xf105b8[_0x47a5('0x29')](0x194);}else{if(_0x11f07b[_0x47a5('0xb5')]){throw new db[(_0x47a5('0x8b'))][(_0x47a5('0xb6'))](_0x47a5('0xb7'));}}return _0x11f07b;})[_0x47a5('0x1f')](function(_0xe662d7){if(_0xe662d7){return _0xe662d7['update']({'closed':_0x580ce8[_0x47a5('0xb0')]['closed'],'disposition':_0x580ce8[_0x47a5('0xb0')][_0x47a5('0xb8')]})['then'](function(_0x48d4cf){return _0x48d4cf;});}})[_0x47a5('0x1f')](function(_0x41d2da){return respondWithRpcPromise('AbandonInteraction',_0x47a5('0xb3'),_0x580ce8[_0x47a5('0xb0')],client9004);})[_0x47a5('0x1f')](respondWithResult(_0xf105b8,null))[_0x47a5('0x28')](handleError(_0xf105b8,null));};exports['attachmentUpload']=function(_0x142012,_0x490947,_0x56d81e){_0x142012['body'][_0x47a5('0x36')]=_0x142012['file'][_0x47a5('0xb9')];_0x142012[_0x47a5('0xb0')][_0x47a5('0xba')]=_0x142012[_0x47a5('0xbb')][_0x47a5('0xbc')];_0x142012[_0x47a5('0xb0')][_0x47a5('0xbd')]=_0x142012[_0x47a5('0xbb')][_0x47a5('0xbe')];return db[_0x47a5('0xbf')][_0x47a5('0xaf')](_0x142012[_0x47a5('0xb0')])[_0x47a5('0x1f')](respondWithResult(_0x490947,0xc9))[_0x47a5('0x28')](handleError(_0x490947,null));};exports[_0x47a5('0xc0')]=function(_0x5e17cb,_0xdd95c8,_0x40aee5){return db[_0x47a5('0x3e')][_0x47a5('0xc1')]({'where':{'id':_0x5e17cb['params']['id']},'raw':!![]})[_0x47a5('0x1f')](handleEntityNotFound(_0xdd95c8,null))['then'](function(_0x4476b5){if(_0x4476b5){if(_0x4476b5['closed']){return _0xdd95c8[_0x47a5('0x2a')](0x193)[_0x47a5('0x2c')]({'status':0x193,'message':_0x47a5('0xc2')});}return db['Attachment'][_0x47a5('0xc1')]({'where':{'id':_0x5e17cb[_0x47a5('0x44')][_0x47a5('0xc3')]},'raw':!![]})['then'](handleEntityNotFound(_0xdd95c8,null));}})['then'](function(_0x20f320){if(_0x20f320){return _0xdd95c8[_0x47a5('0xc4')](path[_0x47a5('0x86')](config[_0x47a5('0xc5')],_0x47a5('0xc6'),_0x20f320['basename']));}})[_0x47a5('0x28')](handleError(_0xdd95c8,null));};exports['close']=function(_0xbcd492,_0xdeaf4e){var _0x46647f=null;var _0x2d6ae7=null;var _0x5b18a2=null;var _0x4dc67c=null;if(_0xbcd492[_0x47a5('0xb0')]['id']){delete _0xbcd492[_0x47a5('0xb0')]['id'];}if(_0xbcd492[_0x47a5('0xb0')][_0x47a5('0xc7')]){_0x4dc67c=path[_0x47a5('0x86')](config[_0x47a5('0xc5')],_0x47a5('0xc8'),util[_0x47a5('0x63')](_0x47a5('0xc9'),Date['now']()));_0xbcd492['body'][_0x47a5('0xca')]=_0x4dc67c;}return db['ChatInteraction'][_0x47a5('0xae')]({'where':{'id':_0xbcd492[_0x47a5('0xaa')]['id']},'include':[{'model':db[_0x47a5('0xcb')],'as':'Messages','include':[{'model':db[_0x47a5('0xcc')],'as':_0x47a5('0xcc')}]}]})['then'](handleEntityNotFound(_0xdeaf4e,null))[_0x47a5('0x1f')](saveUpdates(_0xbcd492['body'],null))[_0x47a5('0x1f')](function(_0x3900d8){if(_0x3900d8){_0x46647f=_0x3900d8;return db[_0x47a5('0xcd')]['find']({'where':{'id':_0x46647f['ChatWebsiteId']}});}})['then'](function(_0x4de478){if(_0x4de478){_0x5b18a2=_0x4de478;return db['CmContact'][_0x47a5('0xae')]({'where':{'id':_0x46647f['ContactId']}});}})[_0x47a5('0x1f')](function(_0x2287b0){if(_0x2287b0){_0x2d6ae7=_0x2287b0;if(_0x4dc67c){var _0x530e98=null;for(var _0x49da2a=0x1;_0x49da2a<_0x46647f['Messages'][_0x47a5('0x45')];++_0x49da2a){_0x530e98=_0x46647f['Messages'][_0x49da2a];var _0x4ec4a8=_0x530e98['UserId']?util[_0x47a5('0x63')](_0x47a5('0xce'),_0x5b18a2[_0x47a5('0xcf')],_0x530e98[_0x47a5('0xb5')]):'System';var _0xdda046=_0xbcd492['body'][_0x47a5('0xd0')]||util['format'](_0x47a5('0xce'),_0x47a5('0xd1'),_0x530e98[_0x47a5('0x6f')]);switch(_0x5b18a2['agentIdentifier']){case _0x47a5('0xd2'):_0x4ec4a8=_0x530e98[_0x47a5('0xb5')]?util[_0x47a5('0x63')](_0x47a5('0xce'),_0x5b18a2['agentAlias'],_0x530e98[_0x47a5('0xb5')]):_0x47a5('0xd3');break;case _0x47a5('0xd4'):_0x4ec4a8=_0x530e98[_0x47a5('0xb5')]?_0x530e98[_0x47a5('0xcc')][_0x47a5('0xd5')]||_0x530e98['User'][_0x47a5('0xd6')]:_0x47a5('0xd3');break;case _0x47a5('0xd7'):_0x4ec4a8=_0x530e98[_0x47a5('0xb5')]?_0x530e98[_0x47a5('0xcc')][_0x47a5('0xd6')]:_0x47a5('0xd3');break;default:_0x4ec4a8=_0x530e98[_0x47a5('0xb5')]?util[_0x47a5('0x63')](_0x47a5('0xce'),_0x5b18a2[_0x47a5('0xcf')],_0x530e98[_0x47a5('0xb5')]):_0x47a5('0xd3');}var _0x106b70=util[_0x47a5('0x63')](_0x47a5('0xd8'),moment(_0x530e98[_0x47a5('0x7c')])['format'](_0x47a5('0xd9')),_0x530e98['direction']==='in'?_0xdda046:_0x4ec4a8,_0x530e98['body']);if(!_0x530e98[_0x47a5('0xda')]){fs[_0x47a5('0xdb')](_0x4dc67c,_0x106b70);}}return db[_0x47a5('0xdc')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x47a5('0xdd')],'as':_0x47a5('0xde'),'raw':!![]}]});}}})[_0x47a5('0x1f')](function(_0x3e8fce){if(_0x3e8fce&&_0x3e8fce[_0x47a5('0xde')]&&_0xbcd492[_0x47a5('0xb0')]){var _0x1b1f86={'tls':{'rejectUnauthorized':![]}};if(_0x3e8fce[_0x47a5('0xde')][_0x47a5('0xdf')]){_0x1b1f86[_0x47a5('0xdf')]=_0x3e8fce[_0x47a5('0xde')][_0x47a5('0xdf')];}else{_0x1b1f86[_0x47a5('0xe0')]=_0x3e8fce['Smtp']['host'];_0x1b1f86[_0x47a5('0xe1')]=_0x3e8fce['Smtp'][_0x47a5('0xe1')];_0x1b1f86[_0x47a5('0xe2')]=_0x3e8fce[_0x47a5('0xde')][_0x47a5('0xe2')];}if(_0x3e8fce[_0x47a5('0xde')][_0x47a5('0xe3')]){_0x1b1f86['auth']={'user':_0x3e8fce[_0x47a5('0xde')][_0x47a5('0xe4')],'pass':_0x3e8fce[_0x47a5('0xde')]['pass']};}return respondWithRpcPromise(_0x47a5('0xe5'),_0x47a5('0xe6'),{'account':_0x1b1f86,'message':{'from':util[_0x47a5('0x63')](_0x47a5('0xe7'),_0x3e8fce[_0x47a5('0x36')],_0x3e8fce[_0x47a5('0xe8')]||_0x3e8fce[_0x47a5('0xde')][_0x47a5('0xe4')]),'to':_0xbcd492[_0x47a5('0xb0')][_0x47a5('0xc7')],'subject':_0x47a5('0xe9'),'text':util[_0x47a5('0x63')](_0x47a5('0xea'),_0xbcd492[_0x47a5('0xb0')][_0x47a5('0xc7')]),'attachments':[{'path':_0x4dc67c}]}})[_0x47a5('0x1f')](function(){return _0x46647f;})[_0x47a5('0x28')](function(_0x150cff){console[_0x47a5('0x25')](_0x150cff);});}else{return _0x46647f;}})[_0x47a5('0x1f')](respondWithStatusCode(_0xdeaf4e,0xc8))[_0x47a5('0x28')](handleError(_0xdeaf4e,null));};exports[_0x47a5('0xeb')]=function(_0x49692d,_0x185104,_0x55972a){return db[_0x47a5('0xcb')][_0x47a5('0xae')]({'where':{'id':_0x49692d[_0x47a5('0xaa')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x185104,null))[_0x47a5('0x1f')](function(_0x9c376a){if(_0x9c376a){return _0x9c376a[_0x47a5('0xeb')](_0x49692d[_0x47a5('0xb0')]['ids'],_[_0x47a5('0xec')](_0x49692d[_0x47a5('0xb0')],[_0x47a5('0xed'),'id'])||{});}})['then'](respondWithResult(_0x185104,null))[_0x47a5('0x28')](handleError(_0x185104,null));};exports[_0x47a5('0xee')]=function(_0x3d4e23,_0x2687f9,_0x5c6e18){var _0x3c8204={'raw':![],'where':{}};var _0x4469d1={};var _0x1ea792={'count':0x0,'rows':[]};return db[_0x47a5('0x3e')]['findOne']({'where':{'id':_0x3d4e23[_0x47a5('0xaa')]['id']}})['then'](handleEntityNotFound(_0x2687f9,null))['then'](function(_0x37f07c){if(_0x37f07c){_0x4469d1[_0x47a5('0x42')]=_[_0x47a5('0x3f')](db[_0x47a5('0xcb')]['rawAttributes']);_0x4469d1[_0x47a5('0x44')]=_[_0x47a5('0x3f')](_0x3d4e23[_0x47a5('0x44')]);_0x4469d1[_0x47a5('0x40')]=_[_0x47a5('0x41')](_0x4469d1[_0x47a5('0x42')],_0x4469d1['query']);_0x3c8204[_0x47a5('0x43')]=_[_0x47a5('0x41')](_0x4469d1[_0x47a5('0x42')],qs[_0x47a5('0xac')](_0x3d4e23[_0x47a5('0x44')]['fields']));_0x3c8204[_0x47a5('0x43')]=_0x3c8204['attributes'][_0x47a5('0x45')]?_0x3c8204['attributes']:_0x4469d1[_0x47a5('0x42')];if(!_0x3d4e23['query']['hasOwnProperty'](_0x47a5('0x47'))){_0x3c8204[_0x47a5('0x2f')]=qs['limit'](_0x3d4e23[_0x47a5('0x44')][_0x47a5('0x2f')]);_0x3c8204['offset']=qs[_0x47a5('0x2e')](_0x3d4e23[_0x47a5('0x44')][_0x47a5('0x2e')]);}_0x3c8204['order']=qs[_0x47a5('0x48')](_0x3d4e23[_0x47a5('0x44')][_0x47a5('0x48')]);_0x3c8204[_0x47a5('0x50')]=qs[_0x47a5('0x40')](_['pick'](_0x3d4e23['query'],_0x4469d1[_0x47a5('0x40')]));_0x3c8204['where'][_0x47a5('0xa6')]=_0x37f07c['id'];if(_0x3d4e23[_0x47a5('0x44')]['filter']){_0x3c8204['where']=_[_0x47a5('0x99')](_0x3c8204['where'],{'$or':_[_0x47a5('0x39')](_0x3c8204[_0x47a5('0x43')],function(_0x2b34c6){var _0x87f207={};_0x87f207[_0x2b34c6]={'$like':'%'+_0x3d4e23[_0x47a5('0x44')][_0x47a5('0x77')]+'%'};return _0x87f207;})});}if(_0x3d4e23[_0x47a5('0x44')]['$gte']){var _0x467db6=_0x3d4e23['query'][_0x47a5('0x7e')][_0x47a5('0x3b')](',');var _0x1840c5={};_0x1840c5[_0x467db6[0x0]]={'$gte':moment(_0x467db6[0x1])[_0x47a5('0x63')](_0x47a5('0xef'))};_0x3c8204[_0x47a5('0x50')]=_[_0x47a5('0x99')](_0x3c8204[_0x47a5('0x50')],_0x1840c5);}_0x3c8204=_[_0x47a5('0x99')]({},_0x3c8204,_0x3d4e23[_0x47a5('0xf0')]);return db[_0x47a5('0xcb')][_0x47a5('0x2d')]({'where':_0x3c8204['where']})[_0x47a5('0x1f')](function(_0x2a34d8){_0x1ea792[_0x47a5('0x2d')]=_0x2a34d8;if(_0x3d4e23['query'][_0x47a5('0xf1')]){_0x3c8204[_0x47a5('0xad')]=[{'all':!![]}];}return db[_0x47a5('0xcb')][_0x47a5('0xf2')](_0x3c8204);})[_0x47a5('0x1f')](function(_0x3a8e77){_0x1ea792['rows']=_0x3a8e77;return _0x1ea792;});}})[_0x47a5('0x1f')](respondWithFilteredResult(_0x2687f9,_0x3c8204))[_0x47a5('0x28')](handleError(_0x2687f9,null));};exports[_0x47a5('0xf3')]=function(_0x3f7286,_0x30dcbf,_0x3c80d7){var _0x42a384={'where':{}},_0x188bdf={},_0x355c4b={'count':0x0,'rows':[]};return db[_0x47a5('0x3e')]['findOne']({'where':{'id':_0x3f7286['params']['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x30dcbf,null))[_0x47a5('0x1f')](function(_0x3f1d5a){if(_0x3f1d5a){_0x188bdf['model']=_[_0x47a5('0x3f')](db['ChatMessage']['rawAttributes']);_0x188bdf[_0x47a5('0x44')]=_[_0x47a5('0x3f')](_0x3f7286[_0x47a5('0x44')]);_0x188bdf[_0x47a5('0x40')]=_['intersection'](_0x188bdf[_0x47a5('0x42')],_0x188bdf[_0x47a5('0x44')]);_0x42a384['attributes']=_['intersection'](_0x188bdf['model'],qs[_0x47a5('0xac')](_0x3f7286[_0x47a5('0x44')][_0x47a5('0xac')]));_0x42a384[_0x47a5('0x43')]=_0x42a384[_0x47a5('0x43')]['length']?_0x42a384['attributes']:_0x188bdf[_0x47a5('0x42')];if(!_0x3f7286[_0x47a5('0x44')][_0x47a5('0x46')](_0x47a5('0x47'))){_0x42a384['limit']=qs[_0x47a5('0x2f')](_0x3f7286[_0x47a5('0x44')][_0x47a5('0x2f')]);_0x42a384[_0x47a5('0x2e')]=qs['offset'](_0x3f7286['query']['offset']);}_0x42a384[_0x47a5('0x88')]=qs[_0x47a5('0x48')](_0x3f7286[_0x47a5('0x44')][_0x47a5('0x48')]);_0x42a384[_0x47a5('0x50')]=qs[_0x47a5('0x40')](_[_0x47a5('0xf4')](_0x3f7286[_0x47a5('0x44')],_0x188bdf[_0x47a5('0x40')]));_0x42a384['where'][_0x47a5('0xa6')]=_0x3f1d5a['id'];if(_0x3f7286[_0x47a5('0x44')]['filter']){_0x42a384[_0x47a5('0x50')]=_[_0x47a5('0x99')](_0x42a384[_0x47a5('0x50')],{'$or':_[_0x47a5('0x39')](_0x42a384['attributes'],function(_0xbf131c){var _0xd3a9ae={};_0xd3a9ae[_0xbf131c]={'$like':'%'+_0x3f7286[_0x47a5('0x44')]['filter']+'%'};return _0xd3a9ae;})});}_0x42a384['where'][_0x47a5('0xda')]=![];if(_0x3f7286['query']['id']){_0x42a384[_0x47a5('0x50')]['id']={'$gt':_0x3f7286['query']['id']};}_0x42a384=_[_0x47a5('0x99')]({},_0x42a384,_0x3f7286[_0x47a5('0xf0')]);return db[_0x47a5('0xcb')][_0x47a5('0x2d')]({'where':_0x42a384[_0x47a5('0x50')]})['then'](function(_0x4c7102){_0x355c4b[_0x47a5('0x2d')]=_0x4c7102;_0x42a384[_0x47a5('0xad')]=[];if(_0x3f7286[_0x47a5('0x44')][_0x47a5('0xf5')]){_0x42a384['include']['push']({'model':db[_0x47a5('0xcc')],'as':'User','attributes':['id',_0x47a5('0xd6'),'alias']});}if(_0x3f7286[_0x47a5('0x44')]['includeAll']){_0x42a384[_0x47a5('0xad')]=[{'all':!![]}];}return db[_0x47a5('0xcb')][_0x47a5('0xf2')](_0x42a384);})[_0x47a5('0x1f')](function(_0x45c38b){_0x355c4b[_0x47a5('0xa8')]=_0x45c38b;return _0x355c4b;});}})[_0x47a5('0x1f')](respondWithFilteredResult(_0x30dcbf,_0x42a384))[_0x47a5('0x28')](handleError(_0x30dcbf,null));};exports['addTags']=function(_0x3b16f5,_0x4394f0,_0x54c565){return db[_0x47a5('0x3e')][_0x47a5('0xae')]({'where':{'id':_0x3b16f5['params']['id']}})['then'](handleEntityNotFound(_0x4394f0,null))[_0x47a5('0x1f')](function(_0x55c4ae){if(_0x55c4ae){return _0x55c4ae[_0x47a5('0xf6')](_0x3b16f5[_0x47a5('0xb0')][_0x47a5('0xed')],_['omit'](_0x3b16f5[_0x47a5('0xb0')],[_0x47a5('0xed'),'id'])||{})[_0x47a5('0xf7')](function(){return db[_0x47a5('0xf8')][_0x47a5('0xf2')]({'attributes':['id',_0x47a5('0x36'),_0x47a5('0x4b')],'where':{'id':_0x3b16f5['body'][_0x47a5('0xed')]}});})[_0x47a5('0x1f')](function(_0x29320b){socket[_0x47a5('0xf9')](_0x47a5('0xfa'),{'id':Number(_0x3b16f5[_0x47a5('0xaa')]['id']),'tags':_0x29320b||[]});return{'id':Number(_0x3b16f5[_0x47a5('0xaa')]['id']),'tags':_0x29320b||[]};});}})['then'](respondWithResult(_0x4394f0,null))['catch'](handleError(_0x4394f0,null));};exports[_0x47a5('0xfb')]=function(_0x3dbcc7,_0x2d0c51,_0x4bbc94){return db['ChatInteraction'][_0x47a5('0xae')]({'where':{'id':_0x3dbcc7[_0x47a5('0xaa')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x2d0c51,null))[_0x47a5('0x1f')](function(_0x452008){if(_0x452008){return _0x452008[_0x47a5('0xfb')](_0x3dbcc7[_0x47a5('0x44')]['ids']);}})[_0x47a5('0x1f')](respondWithStatusCode(_0x2d0c51,null))[_0x47a5('0x28')](handleError(_0x2d0c51,null));};exports[_0x47a5('0xc4')]=function(_0x540d7f,_0xc5f4a6){var _0x611b40=moment()[_0x47a5('0xfc')]()[_0x47a5('0x85')]();var _0x38aab1=path[_0x47a5('0x86')](config[_0x47a5('0xc5')],_0x47a5('0xfd'),_0x47a5('0xfe'),_0x47a5('0xff'));var _0xd4f6ce=path[_0x47a5('0x86')](config[_0x47a5('0xc5')],'server',_0x47a5('0xfe'),'attachments');var _0x2e6477=path['join'](_0x38aab1,_0x611b40);var _0x1c5cf0=util[_0x47a5('0x63')](_0x47a5('0x100'),_0x540d7f['params']['id'],_0x611b40);var _0xd72a22=path['join'](_0x38aab1,_0x1c5cf0);var _0x23667e=![];return db[_0x47a5('0x3e')][_0x47a5('0xae')]({'where':{'id':_0x540d7f[_0x47a5('0xaa')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x47a5('0x101'),'attributes':['id','body','createdAt',_0x47a5('0x102'),_0x47a5('0xda')],'include':[{'model':db[_0x47a5('0xcc')],'as':_0x47a5('0xcc'),'attributes':['id',_0x47a5('0xd6')],'raw':!![]},{'model':db[_0x47a5('0x103')],'as':_0x47a5('0x104'),'attributes':['id',_0x47a5('0x105'),_0x47a5('0x106')],'raw':!![]},{'model':db['Attachment'],'as':'Attachment','raw':!![]}]},{'model':db[_0x47a5('0xcd')],'as':_0x47a5('0x107'),'attributes':['id',_0x47a5('0x36')]},{'model':db[_0x47a5('0xcc')],'as':_0x47a5('0x108'),'attributes':['id','fullname']}]})[_0x47a5('0x1f')](handleEntityNotFound(_0xc5f4a6,null))[_0x47a5('0x1f')](function(_0x16bcec){if(_0x16bcec){var _0x50ff41=_0x16bcec['get']({'plain':!![]});_0x23667e=!![];var _0x3bb31f={'format':'A4','border':_0x47a5('0x109'),'header':{'height':'40px','contents':{'first':_0x47a5('0x10a')}},'footer':{'height':_0x47a5('0x10b'),'contents':{'default':util[_0x47a5('0x63')]('\x0a\x20\x20\x20\x20\x20\x20\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\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\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\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\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\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\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\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\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\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',util[_0x47a5('0x63')](_0x47a5('0x10c'),_0x47a5('0x10d'),_0x50ff41['id']),moment()[_0x47a5('0x63')](_0x47a5('0x10e'))['toString']())}}};fs[_0x47a5('0x10f')](_0x2e6477);var _0x38accb={'channel':_0x47a5('0x10d'),'account':_0x50ff41[_0x47a5('0x107')]['name'],'agent':_0x50ff41['Owner']?_0x50ff41[_0x47a5('0x108')]['fullname']:_0x47a5('0x110'),'createdAt':moment(_0x50ff41[_0x47a5('0x7c')])[_0x47a5('0x63')](_0x47a5('0xef'))[_0x47a5('0x85')](),'closedAt':_0x50ff41[_0x47a5('0x111')]?moment(_0x50ff41['closedAt'])[_0x47a5('0x63')](_0x47a5('0xef'))[_0x47a5('0x85')]():'','disposition':_0x50ff41['disposition'],'chatInfo':{'browser':_0x50ff41['browserName'],'os':_0x50ff41[_0x47a5('0x112')],'referer':_0x50ff41['referer'],'customerIp':_0x50ff41[_0x47a5('0x113')]},'messages':_(_0x50ff41[_0x47a5('0x101')])[_0x47a5('0x114')]()[_0x47a5('0x77')]({'secret':![]})[_0x47a5('0x39')](function(_0x5ae128){if(_0x5ae128['Attachment']){var _0xdc60f8=path[_0x47a5('0x86')](_0xd4f6ce,_0x5ae128[_0x47a5('0xbf')][_0x47a5('0xba')]);if(fs[_0x47a5('0x115')](_0xdc60f8)){fs['createReadStream'](_0xdc60f8)[_0x47a5('0x116')](fs[_0x47a5('0x117')](path[_0x47a5('0x86')](_0x2e6477,_0x5ae128[_0x47a5('0xbf')][_0x47a5('0xba')])));}}return{'date':moment(_0x5ae128['createdAt'])[_0x47a5('0x63')](_0x47a5('0xef'))[_0x47a5('0x85')](),'sender':_0x5ae128[_0x47a5('0x102')]===_0x47a5('0x118')?_0x5ae128[_0x47a5('0xcc')]?_0x5ae128[_0x47a5('0xcc')][_0x47a5('0xd6')]:_0x47a5('0xd3'):_0x5ae128[_0x47a5('0x104')][_0x47a5('0x105')]+(_0x5ae128['Contact'][_0x47a5('0x106')]?'\x20'+_0x5ae128[_0x47a5('0x104')][_0x47a5('0x106')]:''),'body':_0x5ae128[_0x47a5('0xbf')]?_0x5ae128['Attachment']['basename']:_0x5ae128['body'],'direction':_0x5ae128[_0x47a5('0x102')]==='out'?'A':'C','secret':_0x5ae128[_0x47a5('0xda')],'attachment':_0x5ae128[_0x47a5('0xbf')]};})['value']()};return ejs[_0x47a5('0x119')](path[_0x47a5('0x86')](config[_0x47a5('0xc5')],'server',_0x47a5('0x11a'),'downloadInteraction.html'),{'interaction':_0x38accb})[_0x47a5('0x1f')](function(_0x18c0b6){return new BPromise(function(_0x460d52,_0x3c4c48){pdf[_0x47a5('0xaf')](_0x18c0b6,_0x3bb31f)[_0x47a5('0x11b')](path['join'](_0x2e6477,'transcript-'+_0x50ff41['id']+'-'+_0x611b40+'.pdf'),function(_0x2647c3,_0x2da818){if(_0x2647c3)return _0x3c4c48(_0x2647c3);_0x460d52(_0x2da818);});});});}})[_0x47a5('0x1f')](function(){if(_0x23667e){return new BPromise(function(_0x9d1a3b,_0x28bf10){zipdir(_0x2e6477,{'saveTo':_0xd72a22},function(_0x28b865,_0x338c9d){if(_0x28b865)return _0x28bf10(_0x28b865);return _0x9d1a3b(_0x338c9d);});})[_0x47a5('0x1f')](function(){return new BPromise(function(_0x232c36,_0x25954e){rimraf(_0x2e6477,function(_0x277061){if(_0x277061)_0x25954e(_0x277061);return _0x232c36();});});})[_0x47a5('0x1f')](function(){return _0xc5f4a6[_0x47a5('0xc4')](_0xd72a22,_0x1c5cf0,function(_0x22469b){if(_0x22469b){console[_0x47a5('0x11c')](_0x47a5('0x11d'),_0x22469b);}else{fs['unlinkSync'](_0xd72a22);}});});}else{return _0xc5f4a6[_0x47a5('0x29')](0xc8);}})[_0x47a5('0x28')](handleError(_0xc5f4a6,null));}; \ No newline at end of file +var _0xb10b=['firstName','renderFile','views','downloadInteraction.html','transcript-','log','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/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','test','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','destroy','stack','name','send','TagIds','Tags','split','forEach','index','ChatInteraction','rawAttributes','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','tools_tags','COUNT(*)','chat_messages','where','me.ChatInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.ChatInteractionId','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','advancedFilter','parse','keys','createdAt','value','dateStart','startOf','day','utc','endOf','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','unreadMessages','and','tableAlias','\x20=\x20?','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','\x20<\x20?','\x20IN\x20?','LIKE','filter','isNil','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','$gte','$lte','null','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','push','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','Sequelize','QueryTypes','clone','COUNT(me.id)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','sequelize','toString','count','keyBy','merge','Account.key','i.*','Contact.firstName','Contact.lastName','c.email','c.phone','c.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','map','groupBy','ChatInteractionId','all','rows','show','intersection','include','options','find','create','body','params','describe','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','disposition','attachmentUpload','file','originalname','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','attachId','root','server/files/attachments/','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','ChatMessage','User','ChatWebsite','Messages','%s%d','agentAlias','System','Visitor','website_alias','agent_alias','alias','fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','user','Mail\x20Transcript','addMessage','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','includeAll','getMyMessages','findAll','setTags','omit','Tag','emit','chatInteractionTags:save','removeTags','download','unix','server','tmp','attachments','Contact','lastName','Account','Owner','get','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\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\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\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\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\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\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\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\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\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\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\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','%s\x20#%d','Chat','YYYY-MM-DD','N.A.','closed','closedAt','browserName','referer','customerIp','basename','existsSync','createReadStream','pipe','createWriteStream','out'];(function(_0x38ff1e,_0x3b9385){var _0x3755d4=function(_0x6e6692){while(--_0x6e6692){_0x38ff1e['push'](_0x38ff1e['shift']());}};_0x3755d4(++_0x3b9385);}(_0xb10b,0x12a));var _0xbb10=function(_0x462042,_0x524279){_0x462042=_0x462042-0x0;var _0x585608=_0xb10b[_0x462042];return _0x585608;};'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 hardwareService=require('../../config/license/hardware');var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require(_0xbb10('0x16'));var config=require('../../config/environment');var db=require(_0xbb10('0x17'))['db'];config['redis']=_[_0xbb10('0x18')](config[_0xbb10('0x19')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config[_0xbb10('0x19')]));require(_0xbb10('0x1c'))['register'](socket);var jayson=require(_0xbb10('0x1d'));var client=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232b});var client9004=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232c});function checkPasswordPattern(_0x2f2ebf,_0x24a57b,_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3e26f4[_0xbb10('0x20')](_0x24a57b)){return _0x2f2ebf;}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 _0x2f2ebf;}}function respondWithRpcPromise(_0x2eca0f,_0x1145f1,_0x133ac2,_0x42db98){return new BPromise(function(_0x378da8,_0x1682a4){var _0x575cca=_0x42db98||client;return _0x575cca[_0xbb10('0x21')](_0x2eca0f,_0x133ac2)[_0xbb10('0x22')](function(_0xe1c665){logger['info'](_0xbb10('0x23'),_0x1145f1,_0xbb10('0x24'));logger[_0xbb10('0x25')](_0xbb10('0x26'),_0x1145f1,_0xbb10('0x24'),JSON[_0xbb10('0x27')](_0xe1c665));if(_0xe1c665['error']){if(_0xe1c665[_0xbb10('0x28')][_0xbb10('0x29')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x1145f1,_0xe1c665[_0xbb10('0x28')][_0xbb10('0x2a')]);return _0x1682a4(_0xe1c665[_0xbb10('0x28')][_0xbb10('0x2a')]);}logger[_0xbb10('0x28')](_0xbb10('0x23'),_0x1145f1,_0xe1c665[_0xbb10('0x28')][_0xbb10('0x2a')]);return _0x378da8(_0xe1c665[_0xbb10('0x28')][_0xbb10('0x2a')]);}else{logger[_0xbb10('0x2b')](_0xbb10('0x23'),_0x1145f1,'request\x20sent');_0x378da8(_0xe1c665['result']['message']);}})[_0xbb10('0x2c')](function(_0x3c5ae7){logger[_0xbb10('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x1145f1,_0x3c5ae7);_0x1682a4(_0x3c5ae7);});});}function respondWithStatusCode(_0x2fdde9,_0x24d586){_0x24d586=_0x24d586||0xcc;return function(_0x6ed43b){if(_0x6ed43b){return _0x2fdde9[_0xbb10('0x2d')](_0x24d586);}return _0x2fdde9[_0xbb10('0x2e')](_0x24d586)[_0xbb10('0x2f')]();};}function respondWithResult(_0x2a0e8b,_0x4aabb9){_0x4aabb9=_0x4aabb9||0xc8;return function(_0x3796c7){if(_0x3796c7){return _0x2a0e8b[_0xbb10('0x2e')](_0x4aabb9)[_0xbb10('0x30')](_0x3796c7);}};}function respondWithFilteredResult(_0x2e0249,_0x1d30aa){return function(_0x2ff4c1){if(_0x2ff4c1){var _0x5d5c80=_0x2ff4c1['count'],_0x221624=_0x1d30aa[_0xbb10('0x31')],_0x4ee02e=_0x1d30aa[_0xbb10('0x31')]+_0x1d30aa[_0xbb10('0x32')],_0x448d5c;if(_0x4ee02e>=_0x5d5c80){_0x4ee02e=_0x5d5c80;_0x448d5c=0xc8;}else{_0x448d5c=0xce;}_0x2e0249['status'](_0x448d5c);return _0x2e0249['set'](_0xbb10('0x33'),_0x221624+'-'+_0x4ee02e+'/'+_0x5d5c80)[_0xbb10('0x30')](_0x2ff4c1);}return null;};}function patchUpdates(_0x4f590d){return function(_0x359ad4){try{jsonpatch[_0xbb10('0x34')](_0x359ad4,_0x4f590d,!![]);}catch(_0x2f653f){return BPromise[_0xbb10('0x35')](_0x2f653f);}return _0x359ad4[_0xbb10('0x36')]();};}function saveUpdates(_0x138bc6,_0xf85197){return function(_0x4975f5){if(_0x4975f5){return _0x4975f5[_0xbb10('0x37')](_0x138bc6)[_0xbb10('0x22')](function(_0x441d15){return _0x441d15;});}return null;};}function removeEntity(_0x8c1ce6,_0xfb2c5e){return function(_0x9de708){if(_0x9de708){return _0x9de708[_0xbb10('0x38')]()[_0xbb10('0x22')](function(){_0x8c1ce6[_0xbb10('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b5352,_0x150107){return function(_0x1ddd9e){if(!_0x1ddd9e){_0x2b5352[_0xbb10('0x2d')](0x194);}return _0x1ddd9e;};}function handleError(_0x570f5a,_0x111762){_0x111762=_0x111762||0x1f4;return function(_0x5de37b){logger['error'](_0x5de37b[_0xbb10('0x39')]);if(_0x5de37b[_0xbb10('0x3a')]){delete _0x5de37b[_0xbb10('0x3a')];}_0x570f5a[_0xbb10('0x2e')](_0x111762)[_0xbb10('0x3b')](_0x5de37b);};}function getInteractionUsers(_0x29d11a,_0x547062){return new BPromise(function(_0x1e5bbd,_0x25d72f){try{if(_0x547062[_0x29d11a['id']]){_0x29d11a['Users']=_['map'](_0x547062[_0x29d11a['id']],function(_0x5cd55f){return{'id':_0x5cd55f['id']};});}}catch(_0x31bee3){_0x25d72f(_0x31bee3);}_0x1e5bbd(_0x29d11a);});}function getInteractionTags(_0x2b0b45,_0x2b658a){return new BPromise(function(_0x4d5a9b,_0x3c0cd7){try{if(_0x2b0b45[_0xbb10('0x3c')]){_0x2b0b45[_0xbb10('0x3d')]=[];_0x2b0b45['TagIds'][_0xbb10('0x3e')](',')[_0xbb10('0x3f')](function(_0x1dcd38){_0x2b0b45[_0xbb10('0x3d')]['push'](_0x2b658a[_0x1dcd38]);});}delete _0x2b0b45[_0xbb10('0x3c')];}catch(_0x110eb5){_0x3c0cd7(_0x110eb5);}_0x4d5a9b(_0x2b0b45);});}function updateChatInteraction(_0x5835fd,_0xe2040f,_0x2e3214){return new BPromise(function(_0x44d6ae,_0x3a9934){return getInteractionUsers(_0x5835fd,_0x2e3214)[_0xbb10('0x22')](function(_0x185a52){return getInteractionTags(_0x185a52,_0xe2040f);})['then'](function(_0x1e8f79){_0x44d6ae(_0x1e8f79);})[_0xbb10('0x2c')](function(_0x3e7b4c){_0x3a9934(_0x3e7b4c);});});}exports[_0xbb10('0x40')]=function(_0x4943d9,_0x3fff6c){var _0x331751={},_0x23dc18={},_0x403beb={'count':0x0,'rows':[]};var _0x5e2cfa=db[_0xbb10('0x41')][_0xbb10('0x42')];_0x23dc18['model']=_['keys'](_0x5e2cfa);_0x23dc18[_0xbb10('0x43')]=_['keys'](_0x4943d9[_0xbb10('0x43')]);_0x23dc18[_0xbb10('0x44')]=_['intersection'](_0x23dc18[_0xbb10('0x45')],_0x23dc18[_0xbb10('0x43')]);_0x331751[_0xbb10('0x46')]=_['intersection'](_0x23dc18[_0xbb10('0x45')],qs[_0xbb10('0x47')](_0x4943d9[_0xbb10('0x43')][_0xbb10('0x47')]));_0x331751[_0xbb10('0x46')]=_0x331751[_0xbb10('0x46')][_0xbb10('0x48')]?_0x331751[_0xbb10('0x46')]:_0x23dc18[_0xbb10('0x45')];if(!_0x4943d9[_0xbb10('0x43')][_0xbb10('0x49')](_0xbb10('0x4a'))){_0x331751['limit']=qs[_0xbb10('0x32')](_0x4943d9[_0xbb10('0x43')]['limit']);_0x331751[_0xbb10('0x31')]=qs[_0xbb10('0x31')](_0x4943d9[_0xbb10('0x43')][_0xbb10('0x31')]);}_0x331751[_0xbb10('0x4b')]=qs[_0xbb10('0x4c')](_0x4943d9[_0xbb10('0x43')]['sort']);_0x331751['where']=qs[_0xbb10('0x44')](_[_0xbb10('0x4d')](_0x4943d9[_0xbb10('0x43')],_0x23dc18['filters']));var _0x5f0c12=[];var _0x3cd6f3=squel[_0xbb10('0x4e')]()[_0xbb10('0x4f')]('id')[_0xbb10('0x4f')](_0xbb10('0x3a'))[_0xbb10('0x4f')](_0xbb10('0x50'))[_0xbb10('0x51')](_0xbb10('0x52'));var _0x3d7e7e=squel['select']()['field'](_0xbb10('0x53'))[_0xbb10('0x51')](_0xbb10('0x54'),'me')[_0xbb10('0x55')](_0xbb10('0x56'))[_0xbb10('0x55')](_0xbb10('0x57'))[_0xbb10('0x55')](_0xbb10('0x58'));var _0x1214f7=squel[_0xbb10('0x4e')]()[_0xbb10('0x4f')](_0xbb10('0x59'))[_0xbb10('0x4f')](_0xbb10('0x5a'))['from'](_0xbb10('0x5b'),'ui')['left_join'](_0xbb10('0x5c'),'u',_0xbb10('0x5d'));var _0x1ffe20=squel[_0xbb10('0x4e')]()[_0xbb10('0x51')](_0xbb10('0x5e'),'i')[_0xbb10('0x5f')](_0xbb10('0x60'),'c',_0xbb10('0x61'))[_0xbb10('0x5f')](_0xbb10('0x5c'),'o',_0xbb10('0x62'))[_0xbb10('0x5f')](_0xbb10('0x63'),'a',_0xbb10('0x64'))['left_join'](_0xbb10('0x54'),'me',_0xbb10('0x65'));var _0x1b83a9=squel[_0xbb10('0x66')]();if(_0x4943d9[_0xbb10('0x43')][_0xbb10('0x67')]){var _0xb25e71=JSON[_0xbb10('0x68')](_0x4943d9[_0xbb10('0x43')][_0xbb10('0x67')]);_[_0xbb10('0x69')](_0xb25e71)[_0xbb10('0x3f')](function(_0x22de7f){var _0x175872=_0xb25e71[_0x22de7f];if(_0x22de7f===_0xbb10('0x6a')){var _0x205e01=moment(_0x175872[_0xbb10('0x6b')][_0xbb10('0x6c')])[_0xbb10('0x6d')](_0xbb10('0x6e'))['utc']()['format']();var _0x16272d=moment(_0x16272d)[_0xbb10('0x6f')]()[_0xbb10('0x70')](_0xbb10('0x6e'))['format']();_0x1b83a9['and'](_0xbb10('0x71'),_0x205e01,_0x16272d);}else{if(_[_0xbb10('0x72')](_0x175872[_0xbb10('0x73')])){_0x175872[_0xbb10('0x73')][_0xbb10('0x3f')](function(_0x3e9753){switch(_0x175872[_0xbb10('0x73')]['value']){case'IS':if(_0x22de7f!==_0xbb10('0x74')&&_0x22de7f!==_0xbb10('0x75')){if(_['isArray'](_0x175872['value'])&&_0x175872['value'][_0xbb10('0x48')]>0x1){_0x1b83a9[_0xbb10('0x76')](_0x175872[_0xbb10('0x77')]+'.'+_0x22de7f+'\x20IN\x20?',_0x175872['value']);}else{_0x1b83a9['and'](_0x175872[_0xbb10('0x77')]+'.'+_0x22de7f+_0xbb10('0x78'),_0x175872[_0xbb10('0x6b')][0x0]);}}break;case'=':_0x1b83a9['and'](_0x175872[_0xbb10('0x77')]+'.'+_0x22de7f+_0xbb10('0x78'),_0x175872['value']);break;case'LIKE':if(_0x22de7f===_0xbb10('0x79')){_0x1b83a9[_0xbb10('0x76')](_0xbb10('0x7a')+_0xbb10('0x7b'),'%'+_0x175872['value']+'%');_0x1b83a9['or'](_0xbb10('0x7c')+_0xbb10('0x7b'),'%'+_0x175872[_0xbb10('0x6b')]+'%');_0x1b83a9['or']('c.email'+_0xbb10('0x7b'),'%'+_0x175872[_0xbb10('0x6b')]+'%');}else{_0x1b83a9[_0xbb10('0x76')](_0x175872['tableAlias']+'.'+_0x22de7f+_0xbb10('0x7b'),'%'+_0x175872[_0xbb10('0x6b')]+'%');}break;case'>':_0x1b83a9[_0xbb10('0x76')](_0x175872[_0xbb10('0x77')]+'.'+_0x22de7f+'\x20>\x20?',_0x175872[_0xbb10('0x6b')]);break;case'<':_0x1b83a9[_0xbb10('0x76')](_0x175872[_0xbb10('0x77')]+'.'+_0x22de7f+_0xbb10('0x7d'),_0x175872['value']);break;}});}else{switch(_0x175872[_0xbb10('0x73')][_0xbb10('0x6b')]){case'IS':if(_0x22de7f!==_0xbb10('0x74')&&_0x22de7f!==_0xbb10('0x75')){if(_[_0xbb10('0x72')](_0x175872[_0xbb10('0x6b')])&&_0x175872[_0xbb10('0x6b')]['length']>0x1){_0x1b83a9['and'](_0x175872['tableAlias']+'.'+_0x22de7f+_0xbb10('0x7e'),_0x175872[_0xbb10('0x6b')]);}else{_0x1b83a9[_0xbb10('0x76')](_0x175872['tableAlias']+'.'+_0x22de7f+'\x20=\x20?',_0x175872[_0xbb10('0x6b')][0x0]);}}break;case'=':_0x1b83a9[_0xbb10('0x76')](_0x175872[_0xbb10('0x77')]+'.'+_0x22de7f+_0xbb10('0x78'),_0x175872[_0xbb10('0x6b')]);break;case _0xbb10('0x7f'):if(_0x22de7f==='ContactId'){_0x1b83a9[_0xbb10('0x76')](_0xbb10('0x7a')+_0xbb10('0x7b'),'%'+_0x175872[_0xbb10('0x6b')]+'%');_0x1b83a9['or'](_0xbb10('0x7c')+'\x20LIKE\x20?','%'+_0x175872['value']+'%');_0x1b83a9['or']('c.email'+_0xbb10('0x7b'),'%'+_0x175872[_0xbb10('0x6b')]+'%');}else{_0x1b83a9[_0xbb10('0x76')](_0x175872[_0xbb10('0x77')]+'.'+_0x22de7f+_0xbb10('0x7b'),'%'+_0x175872[_0xbb10('0x6b')]+'%');}break;case'>':_0x1b83a9['and'](_0x175872[_0xbb10('0x77')]+'.'+_0x22de7f+'\x20>\x20?',_0x175872['value']);break;case'<':_0x1b83a9['and'](_0x175872[_0xbb10('0x77')]+'.'+_0x22de7f+_0xbb10('0x7d'),_0x175872[_0xbb10('0x6b')]);break;}}}});}else{var _0x108f99=_(Object['keys'](_0x4943d9[_0xbb10('0x43')]))['map'](function(_0x576179){return _0x5e2cfa[_0xbb10('0x49')](_0x576179)?_0x576179:undefined;})[_0xbb10('0x80')](function(_0x29529c){return!_[_0xbb10('0x81')](_0x29529c);})[_0xbb10('0x6b')]();if(!_['isEmpty'](_0x108f99)){_0x108f99[_0xbb10('0x3f')](function(_0x19fcec){if(_0x19fcec===_0xbb10('0x82')){_0x1ffe20[_0xbb10('0x55')](_0xbb10('0x83'),[][_0xbb10('0x84')](_0x4943d9[_0xbb10('0x43')][_0x19fcec]));}else if(_0x19fcec==='createdAt'){var _0x387b10=JSON[_0xbb10('0x68')](_0x4943d9[_0xbb10('0x43')][_0x19fcec])[_0xbb10('0x85')];var _0x37b20e=JSON[_0xbb10('0x68')](_0x4943d9[_0xbb10('0x43')][_0x19fcec])[_0xbb10('0x86')];_0x1ffe20['where'](_0xbb10('0x71'),_0x387b10,_0x37b20e);}else{if(_0x4943d9[_0xbb10('0x43')][_0x19fcec]===_0xbb10('0x87')){_0x1ffe20['where']('i.'+_0x19fcec+'\x20IS\x20NULL');}else{_0x1ffe20['where']('i.'+_0x19fcec+_0xbb10('0x78'),_0x4943d9['query'][_0x19fcec]);}}});}if(_0x4943d9['query'][_0xbb10('0x80')]){var _0x3ee56b=_0x4943d9[_0xbb10('0x43')][_0xbb10('0x80')][_0xbb10('0x88')]('\x5c','\x5c\x5c')[_0xbb10('0x88')]('\x27\x27',_0xbb10('0x89'));if(qs[_0xbb10('0x8a')](_0x3ee56b)){_0x1b83a9['or'](_0xbb10('0x8b'),_0x3ee56b+'%');}else{var _0x5206e1=[];_0x3ee56b[_0xbb10('0x3e')]('\x20')[_0xbb10('0x3f')](function(_0x46b6d2){_0x5206e1[_0xbb10('0x8c')]('+'+_0x46b6d2['toString']());});var _0x4c0795=_0x5206e1[_0xbb10('0x8d')]('\x20');_0x1b83a9['or'](_0xbb10('0x8e'),_0x4c0795)['or'](_0xbb10('0x8f'),_0x3ee56b+'%');}}}_0x1ffe20[_0xbb10('0x55')](_0x1b83a9);if(_0x331751['order']){_0x331751[_0xbb10('0x4b')][_0xbb10('0x3f')](function(_0x3f0d74){_0x1ffe20[_0xbb10('0x4b')]('i.'+_0x3f0d74[0x0],_0x3f0d74[0x1]===_0xbb10('0x90')?![]:!![]);});}_0x1ffe20['group']('i.id');var _0x372636={'type':db[_0xbb10('0x91')][_0xbb10('0x92')]['SELECT'],'raw':!![]};var _0x256b35=_0x1ffe20[_0xbb10('0x93')]()['field']('COUNT(*)')[_0xbb10('0x4f')](_0xbb10('0x94'),_0xbb10('0x75'));if(!_0x4943d9['query'][_0xbb10('0x67')]){if(_0x4943d9[_0xbb10('0x43')][_0xbb10('0x95')]){if(_0x4943d9[_0xbb10('0x43')][_0xbb10('0x95')]==0x1){_0x256b35[_0xbb10('0x96')](_0xbb10('0x97'));_0x1ffe20[_0xbb10('0x96')](_0xbb10('0x97'));}else{_0x256b35['having'](_0xbb10('0x98'));_0x1ffe20[_0xbb10('0x96')](_0xbb10('0x98'));}}if(_0x4943d9[_0xbb10('0x43')][_0xbb10('0x99')]){var _0x39f64b=_[_0xbb10('0x72')](_0x4943d9[_0xbb10('0x43')][_0xbb10('0x99')])?_0x4943d9[_0xbb10('0x43')][_0xbb10('0x99')]:new Array(_0x4943d9[_0xbb10('0x43')]['tag']);var _0x51f106=squel[_0xbb10('0x66')]();_0x39f64b[_0xbb10('0x3f')](function(_0x458615){_0x51f106['or'](_0xbb10('0x9a'),'%,'+_0x458615+',%');});_0x1ffe20[_0xbb10('0x96')](_0x51f106);_0x256b35['left_join'](_0xbb10('0x9b'),'it',_0xbb10('0x9c'));_0x256b35[_0xbb10('0x5f')](_0xbb10('0x52'),'t',_0xbb10('0x9d'));_0x256b35[_0xbb10('0x55')]('t.id\x20IN\x20?',_0x39f64b);}}else{var _0xb25e71=JSON[_0xbb10('0x68')](_0x4943d9['query'][_0xbb10('0x67')]);_['keys'](_0xb25e71)[_0xbb10('0x3f')](function(_0x28bd76){var _0x2b473c=_0xb25e71[_0x28bd76];if(_0x28bd76===_0xbb10('0x74')){var _0x3a4a6e=_0x2b473c['value'];var _0x10d91d=squel['expr']();_0x3a4a6e[_0xbb10('0x3f')](function(_0x37ec93){_0x10d91d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x37ec93+',%');});_0x1ffe20['having'](_0x10d91d);_0x256b35[_0xbb10('0x5f')](_0xbb10('0x9e'),'it',_0xbb10('0x9f'));_0x256b35[_0xbb10('0x5f')](_0xbb10('0x52'),'t',_0xbb10('0x9d'));_0x256b35[_0xbb10('0x55')](_0xbb10('0xa0'),_0x3a4a6e);}else if(_0x28bd76===_0xbb10('0x75')){if(_0x2b473c[_0xbb10('0x6b')][_0xbb10('0x48')]===0x1){if(_0x2b473c['value'][0x0]===0x1){_0x256b35[_0xbb10('0x96')](_0xbb10('0x97'));_0x1ffe20[_0xbb10('0x96')](_0xbb10('0x97'));}else{_0x256b35[_0xbb10('0x96')](_0xbb10('0x98'));_0x1ffe20[_0xbb10('0x96')](_0xbb10('0x98'));}}}});}db[_0xbb10('0xa1')][_0xbb10('0x43')](_0x256b35[_0xbb10('0xa2')](),_0x372636)[_0xbb10('0x22')](function(_0x499b9d){_0x403beb[_0xbb10('0xa3')]=_0x499b9d['length'];if(_0x403beb[_0xbb10('0xa3')]===0x0)return[];return db[_0xbb10('0xa1')][_0xbb10('0x43')](_0x3cd6f3[_0xbb10('0xa2')](),_0x372636)[_0xbb10('0x22')](function(_0x5371d4){_0x5f0c12=_[_0xbb10('0xa4')](_0x5371d4,'id');_0x372636=_[_0xbb10('0xa5')](_0x372636,{'model':db[_0xbb10('0x41')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x1ffe20[_0xbb10('0x4f')](_0xbb10('0x94'),_0xbb10('0x75'));_0x1ffe20['field']('a.key',_0xbb10('0xa6'));_0x1ffe20[_0xbb10('0x4f')](_0xbb10('0xa7'));_0x1ffe20['field'](_0xbb10('0x7a'),_0xbb10('0xa8'));_0x1ffe20['field'](_0xbb10('0x7c'),_0xbb10('0xa9'));_0x1ffe20['field'](_0xbb10('0xaa'),'Contact.email');_0x1ffe20[_0xbb10('0x4f')](_0xbb10('0xab'),'Contact.phone');_0x1ffe20[_0xbb10('0x4f')](_0xbb10('0xac'),'Contact.mobile');_0x1ffe20['field'](_0xbb10('0xad'),_0xbb10('0xae'));_0x1ffe20[_0xbb10('0x4f')](_0xbb10('0xaf'),_0xbb10('0x3c'));_0x1ffe20['left_join'](_0xbb10('0x9b'),'it',_0xbb10('0x9c'));_0x1ffe20[_0xbb10('0x5f')]('tools_tags','t',_0xbb10('0x9d'));_0x1ffe20[_0xbb10('0x32')](_0x331751[_0xbb10('0x32')]);_0x1ffe20[_0xbb10('0x31')](_0x331751[_0xbb10('0x31')]);return db[_0xbb10('0xa1')][_0xbb10('0x43')](_0x1ffe20[_0xbb10('0xa2')](),_0x372636);})[_0xbb10('0x22')](function(_0x5f1fcd){_0x1214f7['where'](_0xbb10('0xb0'),_[_0xbb10('0xb1')](_0x5f1fcd,'id'));return db[_0xbb10('0xa1')][_0xbb10('0x43')](_0x1214f7[_0xbb10('0xa2')](),_0x372636)[_0xbb10('0x22')](function(_0x1cccec){var _0x1674f7=_[_0xbb10('0xb2')](_0x1cccec,_0xbb10('0xb3'));var _0xcbaf69=[];_0x5f1fcd[_0xbb10('0x3f')](function(_0x2c6d2c){_0xcbaf69['push'](updateChatInteraction(_0x2c6d2c,_0x5f0c12,_0x1674f7));});return BPromise[_0xbb10('0xb4')](_0xcbaf69);});});})[_0xbb10('0x22')](function(_0x24076a){_0x403beb[_0xbb10('0xb5')]=_0x24076a;return _0x403beb;})[_0xbb10('0x22')](respondWithFilteredResult(_0x3fff6c,_0x331751))[_0xbb10('0x2c')](handleError(_0x3fff6c,null));};exports[_0xbb10('0xb6')]=function(_0x1421e2,_0x3c6c45){var _0x3c92f4={'raw':![],'where':{'id':_0x1421e2['params']['id']}},_0x2a1c53={};_0x2a1c53[_0xbb10('0x45')]=_['keys'](db[_0xbb10('0x41')][_0xbb10('0x42')]);_0x2a1c53[_0xbb10('0x43')]=_[_0xbb10('0x69')](_0x1421e2[_0xbb10('0x43')]);_0x2a1c53[_0xbb10('0x44')]=_['intersection'](_0x2a1c53[_0xbb10('0x45')],_0x2a1c53['query']);_0x3c92f4[_0xbb10('0x46')]=_[_0xbb10('0xb7')](_0x2a1c53[_0xbb10('0x45')],qs[_0xbb10('0x47')](_0x1421e2[_0xbb10('0x43')][_0xbb10('0x47')]));_0x3c92f4[_0xbb10('0x46')]=_0x3c92f4[_0xbb10('0x46')][_0xbb10('0x48')]?_0x3c92f4[_0xbb10('0x46')]:_0x2a1c53[_0xbb10('0x45')];if(_0x1421e2[_0xbb10('0x43')]['includeAll']){_0x3c92f4[_0xbb10('0xb8')]=[{'all':!![]}];}_0x3c92f4=_['merge']({},_0x3c92f4,_0x1421e2[_0xbb10('0xb9')]);return db[_0xbb10('0x41')][_0xbb10('0xba')](_0x3c92f4)[_0xbb10('0x22')](handleEntityNotFound(_0x3c6c45,null))[_0xbb10('0x22')](respondWithResult(_0x3c6c45,null))[_0xbb10('0x2c')](handleError(_0x3c6c45,null));};exports[_0xbb10('0xbb')]=function(_0x5e9888,_0x350657){return db['ChatInteraction']['create'](_0x5e9888[_0xbb10('0xbc')],{})[_0xbb10('0x22')](respondWithResult(_0x350657,0xc9))[_0xbb10('0x2c')](handleError(_0x350657,null));};exports[_0xbb10('0x37')]=function(_0x1fc4ec,_0x16b8c1){if(_0x1fc4ec['body']['id']){delete _0x1fc4ec[_0xbb10('0xbc')]['id'];}return db[_0xbb10('0x41')][_0xbb10('0xba')]({'where':{'id':_0x1fc4ec[_0xbb10('0xbd')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x16b8c1,null))[_0xbb10('0x22')](saveUpdates(_0x1fc4ec['body'],null))[_0xbb10('0x22')](respondWithResult(_0x16b8c1,null))[_0xbb10('0x2c')](handleError(_0x16b8c1,null));};exports[_0xbb10('0x38')]=function(_0xa8b7c3,_0x31718f){return db[_0xbb10('0x41')][_0xbb10('0xba')]({'where':{'id':_0xa8b7c3['params']['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x31718f,null))['then'](removeEntity(_0x31718f,null))[_0xbb10('0x2c')](handleError(_0x31718f,null));};exports['describe']=function(_0x4c8b68,_0x32183f){return db[_0xbb10('0x41')][_0xbb10('0xbe')]()[_0xbb10('0x22')](respondWithResult(_0x32183f,null))[_0xbb10('0x2c')](handleError(_0x32183f,null));};exports['customUpdate']=function(_0xa42b80,_0x565ddf){if(_0xa42b80['body']['id']){delete _0xa42b80['body']['id'];}return db[_0xbb10('0x41')][_0xbb10('0xba')]({'where':{'id':_0xa42b80[_0xbb10('0xbd')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x565ddf,null))[_0xbb10('0x22')](saveUpdates(_0xa42b80['body'],null))[_0xbb10('0x22')](respondWithResult(_0x565ddf,null))[_0xbb10('0x2c')](handleError(_0x565ddf,null));};exports[_0xbb10('0xbf')]=function(_0x1bd1c1,_0x4b3b21,_0x37ff15){if(_0x1bd1c1[_0xbb10('0xbc')]['id']){delete _0x1bd1c1['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x1bd1c1[_0xbb10('0xbd')]['id']}})[_0xbb10('0x22')](function(_0x2ae3c6){if(!_0x2ae3c6){logger[_0xbb10('0x28')](_0xbb10('0xc0'),_0xbb10('0xbf'),0x194,_0xbb10('0xc1'));_0x4b3b21[_0xbb10('0x2d')](0x194);}else{if(_0x2ae3c6[_0xbb10('0xc2')]){throw new db[(_0xbb10('0x91'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x2ae3c6;})['then'](function(_0x3d4b89){if(_0x3d4b89){return _0x3d4b89[_0xbb10('0x37')]({'closed':_0x1bd1c1[_0xbb10('0xbc')]['closed'],'disposition':_0x1bd1c1[_0xbb10('0xbc')][_0xbb10('0xc3')]})[_0xbb10('0x22')](function(_0x290280){return _0x290280;});}})[_0xbb10('0x22')](function(_0x11279d){return respondWithRpcPromise('AbandonInteraction','abandon',_0x1bd1c1[_0xbb10('0xbc')],client9004);})['then'](respondWithResult(_0x4b3b21,null))[_0xbb10('0x2c')](handleError(_0x4b3b21,null));};exports[_0xbb10('0xc4')]=function(_0x152ca9,_0x15dcde,_0x25ab18){_0x152ca9[_0xbb10('0xbc')][_0xbb10('0x3a')]=_0x152ca9[_0xbb10('0xc5')][_0xbb10('0xc6')];_0x152ca9[_0xbb10('0xbc')]['basename']=_0x152ca9[_0xbb10('0xc5')]['filename'];_0x152ca9[_0xbb10('0xbc')]['type']=_0x152ca9[_0xbb10('0xc5')][_0xbb10('0xc7')];return db[_0xbb10('0xc8')][_0xbb10('0xbb')](_0x152ca9['body'])[_0xbb10('0x22')](respondWithResult(_0x15dcde,0xc9))['catch'](handleError(_0x15dcde,null));};exports[_0xbb10('0xc9')]=function(_0x1b6b9f,_0xcdaf04,_0x5388dc){return db[_0xbb10('0x41')][_0xbb10('0xca')]({'where':{'id':_0x1b6b9f[_0xbb10('0xbd')]['id']},'raw':!![]})[_0xbb10('0x22')](handleEntityNotFound(_0xcdaf04,null))[_0xbb10('0x22')](function(_0x309ec1){if(_0x309ec1){if(_0x309ec1['closed']){return _0xcdaf04['status'](0x193)['json']({'status':0x193,'message':_0xbb10('0xcb')});}return db['Attachment'][_0xbb10('0xca')]({'where':{'id':_0x1b6b9f['query'][_0xbb10('0xcc')]},'raw':!![]})[_0xbb10('0x22')](handleEntityNotFound(_0xcdaf04,null));}})[_0xbb10('0x22')](function(_0x5d5288){if(_0x5d5288){return _0xcdaf04['download'](path[_0xbb10('0x8d')](config[_0xbb10('0xcd')],_0xbb10('0xce'),_0x5d5288['basename']));}})[_0xbb10('0x2c')](handleError(_0xcdaf04,null));};exports[_0xbb10('0xcf')]=function(_0x45cfe9,_0x4848b9){var _0x47d144=null;var _0x5a685d=null;var _0x2980b7=null;var _0x55aa03=null;if(_0x45cfe9[_0xbb10('0xbc')]['id']){delete _0x45cfe9[_0xbb10('0xbc')]['id'];}if(_0x45cfe9[_0xbb10('0xbc')][_0xbb10('0xd0')]){_0x55aa03=path[_0xbb10('0x8d')](config[_0xbb10('0xcd')],_0xbb10('0xd1'),util[_0xbb10('0xd2')](_0xbb10('0xd3'),Date[_0xbb10('0xd4')]()));_0x45cfe9[_0xbb10('0xbc')]['pathTranscript']=_0x55aa03;}return db[_0xbb10('0x41')][_0xbb10('0xba')]({'where':{'id':_0x45cfe9['params']['id']},'include':[{'model':db[_0xbb10('0xd5')],'as':'Messages','include':[{'model':db['User'],'as':_0xbb10('0xd6')}]}]})[_0xbb10('0x22')](handleEntityNotFound(_0x4848b9,null))[_0xbb10('0x22')](saveUpdates(_0x45cfe9[_0xbb10('0xbc')],null))[_0xbb10('0x22')](function(_0x4ca4ce){if(_0x4ca4ce){_0x47d144=_0x4ca4ce;return db[_0xbb10('0xd7')][_0xbb10('0xba')]({'where':{'id':_0x47d144['ChatWebsiteId']}});}})[_0xbb10('0x22')](function(_0x2850d3){if(_0x2850d3){_0x2980b7=_0x2850d3;return db['CmContact'][_0xbb10('0xba')]({'where':{'id':_0x47d144['ContactId']}});}})[_0xbb10('0x22')](function(_0x8e8049){if(_0x8e8049){_0x5a685d=_0x8e8049;if(_0x55aa03){var _0x175dc4=null;for(var _0xcda15c=0x1;_0xcda15c<_0x47d144[_0xbb10('0xd8')][_0xbb10('0x48')];++_0xcda15c){_0x175dc4=_0x47d144[_0xbb10('0xd8')][_0xcda15c];var _0x56f902=_0x175dc4[_0xbb10('0xc2')]?util[_0xbb10('0xd2')](_0xbb10('0xd9'),_0x2980b7[_0xbb10('0xda')],_0x175dc4[_0xbb10('0xc2')]):_0xbb10('0xdb');var _0x518990=_0x45cfe9['body']['customer']||util[_0xbb10('0xd2')](_0xbb10('0xd9'),_0xbb10('0xdc'),_0x175dc4[_0xbb10('0x79')]);switch(_0x2980b7['agentIdentifier']){case _0xbb10('0xdd'):_0x56f902=_0x175dc4[_0xbb10('0xc2')]?util[_0xbb10('0xd2')]('%s%d',_0x2980b7['agentAlias'],_0x175dc4[_0xbb10('0xc2')]):'System';break;case _0xbb10('0xde'):_0x56f902=_0x175dc4[_0xbb10('0xc2')]?_0x175dc4[_0xbb10('0xd6')][_0xbb10('0xdf')]||_0x175dc4[_0xbb10('0xd6')][_0xbb10('0xe0')]:_0xbb10('0xdb');break;case'agent_fullname':_0x56f902=_0x175dc4[_0xbb10('0xc2')]?_0x175dc4[_0xbb10('0xd6')]['fullname']:_0xbb10('0xdb');break;default:_0x56f902=_0x175dc4[_0xbb10('0xc2')]?util[_0xbb10('0xd2')]('%s%d',_0x2980b7['agentAlias'],_0x175dc4['UserId']):_0xbb10('0xdb');}var _0x123bab=util['format'](_0xbb10('0xe1'),moment(_0x175dc4[_0xbb10('0x6a')])[_0xbb10('0xd2')](_0xbb10('0xe2')),_0x175dc4[_0xbb10('0xe3')]==='in'?_0x518990:_0x56f902,_0x175dc4[_0xbb10('0xbc')]);if(!_0x175dc4[_0xbb10('0xe4')]){fs['appendFileSync'](_0x55aa03,_0x123bab);}}return db[_0xbb10('0xe5')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}}})[_0xbb10('0x22')](function(_0x572d73){if(_0x572d73&&_0x572d73['Smtp']&&_0x45cfe9[_0xbb10('0xbc')]){var _0x49f324={'tls':{'rejectUnauthorized':![]}};if(_0x572d73[_0xbb10('0xe6')][_0xbb10('0xe7')]){_0x49f324[_0xbb10('0xe7')]=_0x572d73['Smtp']['service'];}else{_0x49f324[_0xbb10('0xe8')]=_0x572d73['Smtp'][_0xbb10('0xe8')];_0x49f324[_0xbb10('0xe9')]=_0x572d73['Smtp']['port'];_0x49f324[_0xbb10('0xea')]=_0x572d73[_0xbb10('0xe6')][_0xbb10('0xea')];}if(_0x572d73['Smtp'][_0xbb10('0xeb')]){_0x49f324[_0xbb10('0xec')]={'user':_0x572d73[_0xbb10('0xe6')]['user'],'pass':_0x572d73[_0xbb10('0xe6')][_0xbb10('0xed')]};}return respondWithRpcPromise(_0xbb10('0xee'),_0xbb10('0xef'),{'account':_0x49f324,'message':{'from':util[_0xbb10('0xd2')](_0xbb10('0xf0'),_0x572d73[_0xbb10('0x3a')],_0x572d73[_0xbb10('0xf1')]||_0x572d73[_0xbb10('0xe6')][_0xbb10('0xf2')]),'to':_0x45cfe9[_0xbb10('0xbc')][_0xbb10('0xd0')],'subject':_0xbb10('0xf3'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x45cfe9[_0xbb10('0xbc')]['mailTranscript']),'attachments':[{'path':_0x55aa03}]}})[_0xbb10('0x22')](function(){return _0x47d144;})[_0xbb10('0x2c')](function(_0x37b7ae){console['error'](_0x37b7ae);});}else{return _0x47d144;}})[_0xbb10('0x22')](respondWithStatusCode(_0x4848b9,0xc8))[_0xbb10('0x2c')](handleError(_0x4848b9,null));};exports[_0xbb10('0xf4')]=function(_0xe5f8e2,_0x3e3c24,_0x49283d){return db[_0xbb10('0xd5')][_0xbb10('0xba')]({'where':{'id':_0xe5f8e2[_0xbb10('0xbd')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x3e3c24,null))[_0xbb10('0x22')](function(_0x3bd02a){if(_0x3bd02a){return _0x3bd02a['addMessage'](_0xe5f8e2[_0xbb10('0xbc')][_0xbb10('0xf5')],_['omit'](_0xe5f8e2[_0xbb10('0xbc')],[_0xbb10('0xf5'),'id'])||{});}})[_0xbb10('0x22')](respondWithResult(_0x3e3c24,null))[_0xbb10('0x2c')](handleError(_0x3e3c24,null));};exports[_0xbb10('0xf6')]=function(_0x43df3c,_0x45593c,_0xb5c62c){var _0x1d45c5={'raw':![],'where':{}};var _0x33d1b7={};var _0x13514b={'count':0x0,'rows':[]};return db[_0xbb10('0x41')][_0xbb10('0xca')]({'where':{'id':_0x43df3c[_0xbb10('0xbd')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x45593c,null))['then'](function(_0x12e6cb){if(_0x12e6cb){_0x33d1b7[_0xbb10('0x45')]=_['keys'](db['ChatMessage'][_0xbb10('0x42')]);_0x33d1b7[_0xbb10('0x43')]=_[_0xbb10('0x69')](_0x43df3c[_0xbb10('0x43')]);_0x33d1b7[_0xbb10('0x44')]=_[_0xbb10('0xb7')](_0x33d1b7[_0xbb10('0x45')],_0x33d1b7[_0xbb10('0x43')]);_0x1d45c5[_0xbb10('0x46')]=_['intersection'](_0x33d1b7['model'],qs['fields'](_0x43df3c['query']['fields']));_0x1d45c5['attributes']=_0x1d45c5[_0xbb10('0x46')][_0xbb10('0x48')]?_0x1d45c5[_0xbb10('0x46')]:_0x33d1b7[_0xbb10('0x45')];if(!_0x43df3c['query'][_0xbb10('0x49')](_0xbb10('0x4a'))){_0x1d45c5[_0xbb10('0x32')]=qs[_0xbb10('0x32')](_0x43df3c['query']['limit']);_0x1d45c5[_0xbb10('0x31')]=qs[_0xbb10('0x31')](_0x43df3c['query']['offset']);}_0x1d45c5[_0xbb10('0x4b')]=qs[_0xbb10('0x4c')](_0x43df3c[_0xbb10('0x43')][_0xbb10('0x4c')]);_0x1d45c5[_0xbb10('0x55')]=qs['filters'](_[_0xbb10('0x4d')](_0x43df3c['query'],_0x33d1b7['filters']));_0x1d45c5[_0xbb10('0x55')][_0xbb10('0xb3')]=_0x12e6cb['id'];if(_0x43df3c[_0xbb10('0x43')][_0xbb10('0x80')]){_0x1d45c5[_0xbb10('0x55')]=_[_0xbb10('0xa5')](_0x1d45c5['where'],{'$or':_[_0xbb10('0xb1')](_0x1d45c5[_0xbb10('0x46')],function(_0x132fce){var _0x175196={};_0x175196[_0x132fce]={'$like':'%'+_0x43df3c[_0xbb10('0x43')][_0xbb10('0x80')]+'%'};return _0x175196;})});}if(_0x43df3c[_0xbb10('0x43')][_0xbb10('0x85')]){var _0x233d5e=_0x43df3c[_0xbb10('0x43')][_0xbb10('0x85')][_0xbb10('0x3e')](',');var _0x1dbf7b={};_0x1dbf7b[_0x233d5e[0x0]]={'$gte':moment(_0x233d5e[0x1])[_0xbb10('0xd2')](_0xbb10('0xf7'))};_0x1d45c5[_0xbb10('0x55')]=_[_0xbb10('0xa5')](_0x1d45c5[_0xbb10('0x55')],_0x1dbf7b);}_0x1d45c5=_[_0xbb10('0xa5')]({},_0x1d45c5,_0x43df3c[_0xbb10('0xb9')]);return db[_0xbb10('0xd5')][_0xbb10('0xa3')]({'where':_0x1d45c5['where']})[_0xbb10('0x22')](function(_0x47883f){_0x13514b[_0xbb10('0xa3')]=_0x47883f;if(_0x43df3c[_0xbb10('0x43')][_0xbb10('0xf8')]){_0x1d45c5[_0xbb10('0xb8')]=[{'all':!![]}];}return db[_0xbb10('0xd5')]['findAll'](_0x1d45c5);})['then'](function(_0x572b4d){_0x13514b[_0xbb10('0xb5')]=_0x572b4d;return _0x13514b;});}})[_0xbb10('0x22')](respondWithFilteredResult(_0x45593c,_0x1d45c5))['catch'](handleError(_0x45593c,null));};exports[_0xbb10('0xf9')]=function(_0x1d655b,_0x1f090d,_0x4c7c62){var _0xae8e0a={'where':{}},_0x6463ed={},_0x289788={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xbb10('0xca')]({'where':{'id':_0x1d655b['params']['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x1f090d,null))['then'](function(_0x55b881){if(_0x55b881){_0x6463ed['model']=_['keys'](db['ChatMessage']['rawAttributes']);_0x6463ed[_0xbb10('0x43')]=_[_0xbb10('0x69')](_0x1d655b[_0xbb10('0x43')]);_0x6463ed[_0xbb10('0x44')]=_['intersection'](_0x6463ed[_0xbb10('0x45')],_0x6463ed[_0xbb10('0x43')]);_0xae8e0a[_0xbb10('0x46')]=_[_0xbb10('0xb7')](_0x6463ed[_0xbb10('0x45')],qs[_0xbb10('0x47')](_0x1d655b[_0xbb10('0x43')][_0xbb10('0x47')]));_0xae8e0a[_0xbb10('0x46')]=_0xae8e0a[_0xbb10('0x46')]['length']?_0xae8e0a[_0xbb10('0x46')]:_0x6463ed[_0xbb10('0x45')];if(!_0x1d655b[_0xbb10('0x43')]['hasOwnProperty'](_0xbb10('0x4a'))){_0xae8e0a[_0xbb10('0x32')]=qs[_0xbb10('0x32')](_0x1d655b[_0xbb10('0x43')]['limit']);_0xae8e0a[_0xbb10('0x31')]=qs[_0xbb10('0x31')](_0x1d655b[_0xbb10('0x43')][_0xbb10('0x31')]);}_0xae8e0a[_0xbb10('0x4b')]=qs[_0xbb10('0x4c')](_0x1d655b[_0xbb10('0x43')][_0xbb10('0x4c')]);_0xae8e0a[_0xbb10('0x55')]=qs[_0xbb10('0x44')](_[_0xbb10('0x4d')](_0x1d655b['query'],_0x6463ed[_0xbb10('0x44')]));_0xae8e0a[_0xbb10('0x55')]['ChatInteractionId']=_0x55b881['id'];if(_0x1d655b['query'][_0xbb10('0x80')]){_0xae8e0a[_0xbb10('0x55')]=_['merge'](_0xae8e0a[_0xbb10('0x55')],{'$or':_[_0xbb10('0xb1')](_0xae8e0a['attributes'],function(_0x306f73){var _0x42441e={};_0x42441e[_0x306f73]={'$like':'%'+_0x1d655b[_0xbb10('0x43')][_0xbb10('0x80')]+'%'};return _0x42441e;})});}_0xae8e0a[_0xbb10('0x55')]['secret']=![];if(_0x1d655b['query']['id']){_0xae8e0a['where']['id']={'$gt':_0x1d655b[_0xbb10('0x43')]['id']};}_0xae8e0a=_['merge']({},_0xae8e0a,_0x1d655b[_0xbb10('0xb9')]);return db['ChatMessage']['count']({'where':_0xae8e0a[_0xbb10('0x55')]})[_0xbb10('0x22')](function(_0x2cb52d){_0x289788[_0xbb10('0xa3')]=_0x2cb52d;_0xae8e0a[_0xbb10('0xb8')]=[];if(_0x1d655b[_0xbb10('0x43')]['includeAgent']){_0xae8e0a['include']['push']({'model':db[_0xbb10('0xd6')],'as':_0xbb10('0xd6'),'attributes':['id',_0xbb10('0xe0'),_0xbb10('0xdf')]});}if(_0x1d655b[_0xbb10('0x43')][_0xbb10('0xf8')]){_0xae8e0a[_0xbb10('0xb8')]=[{'all':!![]}];}return db['ChatMessage'][_0xbb10('0xfa')](_0xae8e0a);})[_0xbb10('0x22')](function(_0x35586a){_0x289788[_0xbb10('0xb5')]=_0x35586a;return _0x289788;});}})['then'](respondWithFilteredResult(_0x1f090d,_0xae8e0a))[_0xbb10('0x2c')](handleError(_0x1f090d,null));};exports['addTags']=function(_0x4fc743,_0x25b5a7,_0x7dbd23){return db[_0xbb10('0x41')][_0xbb10('0xba')]({'where':{'id':_0x4fc743[_0xbb10('0xbd')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x25b5a7,null))['then'](function(_0x39fdd3){if(_0x39fdd3){return _0x39fdd3[_0xbb10('0xfb')](_0x4fc743[_0xbb10('0xbc')][_0xbb10('0xf5')],_[_0xbb10('0xfc')](_0x4fc743[_0xbb10('0xbc')],[_0xbb10('0xf5'),'id'])||{})['spread'](function(){return db[_0xbb10('0xfd')][_0xbb10('0xfa')]({'attributes':['id',_0xbb10('0x3a'),'color'],'where':{'id':_0x4fc743['body'][_0xbb10('0xf5')]}});})[_0xbb10('0x22')](function(_0x3b007e){socket[_0xbb10('0xfe')](_0xbb10('0xff'),{'id':Number(_0x4fc743[_0xbb10('0xbd')]['id']),'tags':_0x3b007e||[]});return{'id':Number(_0x4fc743[_0xbb10('0xbd')]['id']),'tags':_0x3b007e||[]};});}})['then'](respondWithResult(_0x25b5a7,null))[_0xbb10('0x2c')](handleError(_0x25b5a7,null));};exports[_0xbb10('0x100')]=function(_0x15bd9e,_0x55ba78,_0x5e195a){return db['ChatInteraction']['find']({'where':{'id':_0x15bd9e[_0xbb10('0xbd')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x55ba78,null))[_0xbb10('0x22')](function(_0x1b9a6b){if(_0x1b9a6b){return _0x1b9a6b['removeTags'](_0x15bd9e[_0xbb10('0x43')]['ids']);}})[_0xbb10('0x22')](respondWithStatusCode(_0x55ba78,null))[_0xbb10('0x2c')](handleError(_0x55ba78,null));};exports[_0xbb10('0x101')]=function(_0xc3c1e5,_0xa16287){var _0x163fdd=moment()[_0xbb10('0x102')]()[_0xbb10('0xa2')]();var _0x243dc2=path[_0xbb10('0x8d')](config[_0xbb10('0xcd')],_0xbb10('0x103'),'files',_0xbb10('0x104'));var _0x1c000b=path[_0xbb10('0x8d')](config['root'],_0xbb10('0x103'),'files',_0xbb10('0x105'));var _0x446bcf=path[_0xbb10('0x8d')](_0x243dc2,_0x163fdd);var _0x252833=util[_0xbb10('0xd2')]('transcript-%d-%s.zip',_0xc3c1e5['params']['id'],_0x163fdd);var _0x842d94=path['join'](_0x243dc2,_0x252833);var _0x553bb8=![];return db[_0xbb10('0x41')]['find']({'where':{'id':_0xc3c1e5[_0xbb10('0xbd')]['id']},'include':[{'model':db[_0xbb10('0xd5')],'as':_0xbb10('0xd8'),'attributes':['id',_0xbb10('0xbc'),_0xbb10('0x6a'),_0xbb10('0xe3'),_0xbb10('0xe4')],'include':[{'model':db[_0xbb10('0xd6')],'as':'User','attributes':['id',_0xbb10('0xe0')],'raw':!![]},{'model':db['CmContact'],'as':_0xbb10('0x106'),'attributes':['id','firstName',_0xbb10('0x107')],'raw':!![]},{'model':db[_0xbb10('0xc8')],'as':'Attachment','raw':!![]}]},{'model':db[_0xbb10('0xd7')],'as':_0xbb10('0x108'),'attributes':['id',_0xbb10('0x3a')]},{'model':db['User'],'as':_0xbb10('0x109'),'attributes':['id',_0xbb10('0xe0')]}]})[_0xbb10('0x22')](handleEntityNotFound(_0xa16287,null))['then'](function(_0x100e82){if(_0x100e82){var _0x1129f5=_0x100e82[_0xbb10('0x10a')]({'plain':!![]});_0x553bb8=!![];var _0x4b781e={'format':'A4','border':_0xbb10('0x10b'),'header':{'height':'40px','contents':{'first':_0xbb10('0x10c')}},'footer':{'height':_0xbb10('0x10d'),'contents':{'default':util[_0xbb10('0xd2')](_0xbb10('0x10e'),util[_0xbb10('0xd2')](_0xbb10('0x10f'),_0xbb10('0x110'),_0x1129f5['id']),moment()[_0xbb10('0xd2')](_0xbb10('0x111'))[_0xbb10('0xa2')]())}}};fs['mkdirSync'](_0x446bcf);var _0x4b10ed={'channel':_0xbb10('0x110'),'account':_0x1129f5[_0xbb10('0x108')][_0xbb10('0x3a')],'agent':_0x1129f5['Owner']?_0x1129f5[_0xbb10('0x109')][_0xbb10('0xe0')]:_0xbb10('0x112'),'createdAt':moment(_0x1129f5[_0xbb10('0x6a')])[_0xbb10('0xd2')](_0xbb10('0xf7'))[_0xbb10('0xa2')](),'closedAt':_0x1129f5[_0xbb10('0x113')]?moment(_0x1129f5[_0xbb10('0x114')])['format'](_0xbb10('0xf7'))[_0xbb10('0xa2')]():'','disposition':_0x1129f5[_0xbb10('0xc3')],'chatInfo':{'browser':_0x1129f5[_0xbb10('0x115')],'os':_0x1129f5['osName'],'referer':_0x1129f5[_0xbb10('0x116')],'customerIp':_0x1129f5[_0xbb10('0x117')]},'messages':_(_0x1129f5[_0xbb10('0xd8')])['tail']()['filter']({'secret':![]})[_0xbb10('0xb1')](function(_0x4f4157){if(_0x4f4157[_0xbb10('0xc8')]){var _0x4874be=path[_0xbb10('0x8d')](_0x1c000b,_0x4f4157[_0xbb10('0xc8')][_0xbb10('0x118')]);if(fs[_0xbb10('0x119')](_0x4874be)){fs[_0xbb10('0x11a')](_0x4874be)[_0xbb10('0x11b')](fs[_0xbb10('0x11c')](path['join'](_0x446bcf,_0x4f4157[_0xbb10('0xc8')][_0xbb10('0x118')])));}}return{'date':moment(_0x4f4157[_0xbb10('0x6a')])[_0xbb10('0xd2')](_0xbb10('0xf7'))[_0xbb10('0xa2')](),'sender':_0x4f4157['direction']===_0xbb10('0x11d')?_0x4f4157[_0xbb10('0xd6')]?_0x4f4157[_0xbb10('0xd6')][_0xbb10('0xe0')]:_0xbb10('0xdb'):_0x4f4157[_0xbb10('0x106')][_0xbb10('0x11e')]+(_0x4f4157['Contact'][_0xbb10('0x107')]?'\x20'+_0x4f4157[_0xbb10('0x106')][_0xbb10('0x107')]:''),'body':_0x4f4157['Attachment']?_0x4f4157[_0xbb10('0xc8')]['basename']:_0x4f4157[_0xbb10('0xbc')],'direction':_0x4f4157[_0xbb10('0xe3')]===_0xbb10('0x11d')?'A':'C','secret':_0x4f4157['secret'],'attachment':_0x4f4157['Attachment']};})[_0xbb10('0x6b')]()};return ejs[_0xbb10('0x11f')](path[_0xbb10('0x8d')](config[_0xbb10('0xcd')],_0xbb10('0x103'),_0xbb10('0x120'),_0xbb10('0x121')),{'interaction':_0x4b10ed})[_0xbb10('0x22')](function(_0x2ba569){return new BPromise(function(_0x8700e6,_0x1e6509){pdf['create'](_0x2ba569,_0x4b781e)['toFile'](path[_0xbb10('0x8d')](_0x446bcf,_0xbb10('0x122')+_0x1129f5['id']+'-'+_0x163fdd+'.pdf'),function(_0x576df0,_0x2ae12a){if(_0x576df0)return _0x1e6509(_0x576df0);_0x8700e6(_0x2ae12a);});});});}})[_0xbb10('0x22')](function(){if(_0x553bb8){return new BPromise(function(_0x30bc43,_0x5ea832){zipdir(_0x446bcf,{'saveTo':_0x842d94},function(_0x565874,_0x35c8a7){if(_0x565874)return _0x5ea832(_0x565874);return _0x30bc43(_0x35c8a7);});})['then'](function(){return new BPromise(function(_0x4375ac,_0x97224a){rimraf(_0x446bcf,function(_0x544c9c){if(_0x544c9c)_0x97224a(_0x544c9c);return _0x4375ac();});});})['then'](function(){return _0xa16287[_0xbb10('0x101')](_0x842d94,_0x252833,function(_0x26ec8e){if(_0x26ec8e){console[_0xbb10('0x123')]('err',_0x26ec8e);}else{fs['unlinkSync'](_0x842d94);}});});}else{return _0xa16287[_0xbb10('0x2d')](0xc8);}})[_0xbb10('0x2c')](handleError(_0xa16287,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 644f9a2..d97a8cf 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 _0x9402=['then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','remove','getUsers','setDataValue','Users','map','findAll'];(function(_0x38e36f,_0x16fa3a){var _0x4394d4=function(_0x1e75b1){while(--_0x1e75b1){_0x38e36f['push'](_0x38e36f['shift']());}};_0x4394d4(++_0x16fa3a);}(_0x9402,0xbc));var _0x2940=function(_0x323f14,_0x3e76fe){_0x323f14=_0x323f14-0x0;var _0x6c7429=_0x9402[_0x323f14];return _0x6c7429;};'use strict';var EventEmitter=require(_0x2940('0x0'));var ChatInteraction=require(_0x2940('0x1'))['db'][_0x2940('0x2')];var ChatMessage=require(_0x2940('0x1'))['db'][_0x2940('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2940('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2940('0x5'),'afterDestroy':_0x2940('0x6')};function emitEvent(_0x42e7d2){return function(_0x2e7596,_0x4d97cd,_0x9ae961){_0x2e7596[_0x2940('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x563094){_0x2e7596[_0x2940('0x8')](_0x2940('0x9'),_0x563094[_0x2940('0xa')](function(_0x406a76){return{'id':_0x406a76['id']};}));return ChatMessage[_0x2940('0xb')]({'where':{'ChatInteractionId':_0x2e7596['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2940('0xc')](function(_0x2d511d){_0x2e7596[_0x2940('0x8')](_0x2940('0xd'),_0x2d511d[_0x2940('0xe')]);ChatInteractionEvents['emit'](_0x42e7d2+':'+_0x2e7596['id'],_0x2e7596);ChatInteractionEvents[_0x2940('0xf')](_0x42e7d2,_0x2e7596);_0x9ae961(null);})[_0x2940('0x10')](_0x9ae961(null));};}for(var e in events){if(events[_0x2940('0x11')](e)){var event=events[e];ChatInteraction[_0x2940('0x12')](e,emitEvent(event));}}module[_0x2940('0x13')]=ChatInteractionEvents; \ No newline at end of file +var _0xe218=['hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','ChatMessage','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch'];(function(_0x4dd5e3,_0x4e5aec){var _0x3a8ce3=function(_0x5af77e){while(--_0x5af77e){_0x4dd5e3['push'](_0x4dd5e3['shift']());}};_0x3a8ce3(++_0x4e5aec);}(_0xe218,0xf0));var _0x8e21=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xe218[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0x8e21('0x0'));var ChatInteraction=require(_0x8e21('0x1'))['db'][_0x8e21('0x2')];var ChatMessage=require(_0x8e21('0x1'))['db'][_0x8e21('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8e21('0x4'),'afterDestroy':_0x8e21('0x5')};function emitEvent(_0x52084d){return function(_0x1ac795,_0x5663a2,_0x514d86){_0x1ac795[_0x8e21('0x6')]({'attributes':['id'],'raw':!![]})[_0x8e21('0x7')](function(_0x5c8a05){_0x1ac795[_0x8e21('0x8')](_0x8e21('0x9'),_0x5c8a05[_0x8e21('0xa')](function(_0x1eee4c){return{'id':_0x1eee4c['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x1ac795['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x43cf53){_0x1ac795[_0x8e21('0x8')](_0x8e21('0xb'),_0x43cf53[_0x8e21('0xc')]);ChatInteractionEvents[_0x8e21('0xd')](_0x52084d+':'+_0x1ac795['id'],_0x1ac795);ChatInteractionEvents[_0x8e21('0xd')](_0x52084d,_0x1ac795);_0x514d86(null);})[_0x8e21('0xe')](_0x514d86(null));};}for(var e in events){if(events[_0x8e21('0xf')](e)){var event=events[e];ChatInteraction[_0x8e21('0x10')](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 7e5d87d..d2afeeb 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 _0xb7e7=['closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','changed','closed'];(function(_0x5a1826,_0x1b75b9){var _0x39d8a5=function(_0x87212e){while(--_0x87212e){_0x5a1826['push'](_0x5a1826['shift']());}};_0x39d8a5(++_0x1b75b9);}(_0xb7e7,0x121));var _0x7b7e=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0xb7e7[_0x42f009];return _0x22a1e0;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42b871,_0x223587,_0x2917f9){if(_0x42b871[_0x7b7e('0x9')](_0x7b7e('0xa'))){_0x42b871[_0x7b7e('0xb')]=moment()[_0x7b7e('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2917f9(null,_0x42b871);}},'charset':_0x7b7e('0xd'),'collate':_0x7b7e('0xe')});}; \ No newline at end of file +var _0xb7e7=['closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','changed','closed'];(function(_0x245177,_0x5bec34){var _0x53c2d4=function(_0x3915b9){while(--_0x3915b9){_0x245177['push'](_0x245177['shift']());}};_0x53c2d4(++_0x5bec34);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xb7e7[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42b871,_0x223587,_0x2917f9){if(_0x42b871[_0x7b7e('0x9')](_0x7b7e('0xa'))){_0x42b871[_0x7b7e('0xb')]=moment()[_0x7b7e('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2917f9(null,_0x42b871);}},'charset':_0x7b7e('0xd'),'collate':_0x7b7e('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 2ec0ee8..eb97ac9 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 _0xb71b=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateChatInteraction','update','body','options','raw','attributes','limit','ChatInteraction','find','ids','spread','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xb71b,0x14f));var _0xbb71=function(_0x123586,_0x4fa7bd){_0x123586=_0x123586-0x0;var _0x310b1e=_0xb71b[_0x123586];return _0x310b1e;};'use strict';var _=require('lodash');var util=require(_0xbb71('0x0'));var moment=require('moment');var BPromise=require(_0xbb71('0x1'));var rs=require(_0xbb71('0x2'));var fs=require('fs');var Redis=require(_0xbb71('0x3'));var db=require(_0xbb71('0x4'))['db'];var utils=require(_0xbb71('0x5'));var logger=require(_0xbb71('0x6'))(_0xbb71('0x7'));var config=require(_0xbb71('0x8'));var jayson=require(_0xbb71('0x9'));var client=jayson[_0xbb71('0xa')][_0xbb71('0xb')]({'port':0x232a});config[_0xbb71('0xc')]=_[_0xbb71('0xd')](config['redis'],{'host':_0xbb71('0xe'),'port':0x18eb});var socket=require(_0xbb71('0xf'))(new Redis(config[_0xbb71('0xc')]));require(_0xbb71('0x10'))[_0xbb71('0x11')](socket);function respondWithRpcPromise(_0x9bf9e2,_0x259c00,_0x20e6be){return new BPromise(function(_0x4d65b3,_0x28994a){return client[_0xbb71('0x12')](_0x9bf9e2,_0x20e6be)[_0xbb71('0x13')](function(_0x3b85b9){logger[_0xbb71('0x14')](_0xbb71('0x15'),_0x259c00,'request\x20sent');logger[_0xbb71('0x16')](_0xbb71('0x17'),_0x259c00,_0xbb71('0x18'),JSON[_0xbb71('0x19')](_0x3b85b9));if(_0x3b85b9[_0xbb71('0x1a')]){if(_0x3b85b9['error'][_0xbb71('0x1b')]===0x1f4){logger[_0xbb71('0x1a')](_0xbb71('0x15'),_0x259c00,_0x3b85b9[_0xbb71('0x1a')][_0xbb71('0x1c')]);return _0x28994a(_0x3b85b9[_0xbb71('0x1a')][_0xbb71('0x1c')]);}logger[_0xbb71('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x259c00,_0x3b85b9[_0xbb71('0x1a')][_0xbb71('0x1c')]);return _0x4d65b3(_0x3b85b9[_0xbb71('0x1a')][_0xbb71('0x1c')]);}else{logger[_0xbb71('0x14')](_0xbb71('0x15'),_0x259c00,_0xbb71('0x18'));_0x4d65b3(_0x3b85b9[_0xbb71('0x1d')]['message']);}})[_0xbb71('0x1e')](function(_0x309c4f){logger[_0xbb71('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x259c00,_0x309c4f);_0x28994a(_0x309c4f);});});}exports[_0xbb71('0x1f')]=function(_0x3b4642){var _0x46442f=this;return new Promise(function(_0x483d2b,_0x336525){return db['ChatInteraction'][_0xbb71('0x20')](_0x3b4642[_0xbb71('0x21')],{'raw':_0x3b4642['options']?_0x3b4642[_0xbb71('0x22')][_0xbb71('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b4642[_0xbb71('0x22')]?_0x3b4642['options']['where']||null:null,'attributes':_0x3b4642[_0xbb71('0x22')]?_0x3b4642[_0xbb71('0x22')][_0xbb71('0x24')]||null:null,'limit':_0x3b4642['options']?_0x3b4642['options'][_0xbb71('0x25')]||null:null})['then'](function(_0x541732){logger[_0xbb71('0x14')](_0xbb71('0x1f'),_0x3b4642);logger[_0xbb71('0x16')]('UpdateChatInteraction',_0x3b4642,JSON[_0xbb71('0x19')](_0x541732));_0x483d2b(_0x541732);})[_0xbb71('0x1e')](function(_0x320be0){logger[_0xbb71('0x1a')](_0xbb71('0x1f'),_0x320be0[_0xbb71('0x1c')],_0x3b4642);_0x336525(_0x46442f['error'](0x1f4,_0x320be0[_0xbb71('0x1c')]));});});};exports['AddTagsToChatInteraction']=function(_0x235260){return new Promise(function(_0x30da5b,_0xd3c222){return db[_0xbb71('0x26')][_0xbb71('0x27')]({'where':_0x235260[_0xbb71('0x22')]?_0x235260[_0xbb71('0x22')]['where']||null:null})[_0xbb71('0x13')](function(_0x4aeb5c){if(_0x4aeb5c){return _0x4aeb5c['addTags'](_0x235260[_0xbb71('0x21')][_0xbb71('0x28')],_['omit'](_0x235260[_0xbb71('0x21')],['ids','id'])||{});}})[_0xbb71('0x29')](function(_0x42179d){logger[_0xbb71('0x14')](_0xbb71('0x2a'),_0x235260);logger[_0xbb71('0x16')](_0xbb71('0x2a'),_0x235260,JSON[_0xbb71('0x19')](_0x42179d));_0x30da5b(_0x42179d);})['catch'](function(_0x3fa74c){logger[_0xbb71('0x1a')](_0xbb71('0x2a'),_0x3fa74c['message'],_0x235260);_0xd3c222(_this[_0xbb71('0x1a')](0x1f4,_0x3fa74c[_0xbb71('0x1c')]));});});}; \ No newline at end of file +var _0x5e7d=['redis','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','where','limit','stringify','ids','omit','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x5e7d,0x69));var _0xd5e7=function(_0x500896,_0x39a5ed){_0x500896=_0x500896-0x0;var _0x2a3c21=_0x5e7d[_0x500896];return _0x2a3c21;};'use strict';var _=require(_0xd5e7('0x0'));var util=require(_0xd5e7('0x1'));var moment=require('moment');var BPromise=require(_0xd5e7('0x2'));var rs=require(_0xd5e7('0x3'));var fs=require('fs');var Redis=require(_0xd5e7('0x4'));var db=require(_0xd5e7('0x5'))['db'];var utils=require(_0xd5e7('0x6'));var logger=require(_0xd5e7('0x7'))(_0xd5e7('0x8'));var config=require('../../config/environment');var jayson=require(_0xd5e7('0x9'));var client=jayson[_0xd5e7('0xa')][_0xd5e7('0xb')]({'port':0x232a});config[_0xd5e7('0xc')]=_['defaults'](config['redis'],{'host':_0xd5e7('0xd'),'port':0x18eb});var socket=require(_0xd5e7('0xe'))(new Redis(config['redis']));require(_0xd5e7('0xf'))[_0xd5e7('0x10')](socket);function respondWithRpcPromise(_0x56897f,_0xdf17da,_0x59ca4d){return new BPromise(function(_0x24919a,_0x591ee1){return client['request'](_0x56897f,_0x59ca4d)[_0xd5e7('0x11')](function(_0x1ab5d0){logger[_0xd5e7('0x12')](_0xd5e7('0x13'),_0xdf17da,_0xd5e7('0x14'));logger[_0xd5e7('0x15')](_0xd5e7('0x16'),_0xdf17da,_0xd5e7('0x14'),JSON['stringify'](_0x1ab5d0));if(_0x1ab5d0['error']){if(_0x1ab5d0['error'][_0xd5e7('0x17')]===0x1f4){logger[_0xd5e7('0x18')]('ChatInteraction,\x20%s,\x20%s',_0xdf17da,_0x1ab5d0[_0xd5e7('0x18')]['message']);return _0x591ee1(_0x1ab5d0[_0xd5e7('0x18')][_0xd5e7('0x19')]);}logger[_0xd5e7('0x18')]('ChatInteraction,\x20%s,\x20%s',_0xdf17da,_0x1ab5d0[_0xd5e7('0x18')][_0xd5e7('0x19')]);return _0x24919a(_0x1ab5d0['error'][_0xd5e7('0x19')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0xdf17da,_0xd5e7('0x14'));_0x24919a(_0x1ab5d0[_0xd5e7('0x1a')][_0xd5e7('0x19')]);}})[_0xd5e7('0x1b')](function(_0x4b4bb8){logger['error'](_0xd5e7('0x13'),_0xdf17da,_0x4b4bb8);_0x591ee1(_0x4b4bb8);});});}exports[_0xd5e7('0x1c')]=function(_0x1d4895){var _0x143623=this;return new Promise(function(_0x9edf26,_0x333852){return db[_0xd5e7('0x1d')][_0xd5e7('0x1e')](_0x1d4895[_0xd5e7('0x1f')],{'raw':_0x1d4895[_0xd5e7('0x20')]?_0x1d4895['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d4895[_0xd5e7('0x20')]?_0x1d4895[_0xd5e7('0x20')][_0xd5e7('0x21')]||null:null,'attributes':_0x1d4895['options']?_0x1d4895[_0xd5e7('0x20')]['attributes']||null:null,'limit':_0x1d4895[_0xd5e7('0x20')]?_0x1d4895['options'][_0xd5e7('0x22')]||null:null})['then'](function(_0x13bdaf){logger['info'](_0xd5e7('0x1c'),_0x1d4895);logger['debug'](_0xd5e7('0x1c'),_0x1d4895,JSON[_0xd5e7('0x23')](_0x13bdaf));_0x9edf26(_0x13bdaf);})[_0xd5e7('0x1b')](function(_0x3d466c){logger[_0xd5e7('0x18')](_0xd5e7('0x1c'),_0x3d466c[_0xd5e7('0x19')],_0x1d4895);_0x333852(_0x143623[_0xd5e7('0x18')](0x1f4,_0x3d466c[_0xd5e7('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x245719){return new Promise(function(_0x250c8c,_0x30e091){return db['ChatInteraction']['find']({'where':_0x245719['options']?_0x245719[_0xd5e7('0x20')][_0xd5e7('0x21')]||null:null})[_0xd5e7('0x11')](function(_0x1085c6){if(_0x1085c6){return _0x1085c6['addTags'](_0x245719[_0xd5e7('0x1f')][_0xd5e7('0x24')],_[_0xd5e7('0x25')](_0x245719[_0xd5e7('0x1f')],[_0xd5e7('0x24'),'id'])||{});}})['spread'](function(_0x577d2b){logger[_0xd5e7('0x12')](_0xd5e7('0x26'),_0x245719);logger[_0xd5e7('0x15')](_0xd5e7('0x26'),_0x245719,JSON[_0xd5e7('0x23')](_0x577d2b));_0x250c8c(_0x577d2b);})[_0xd5e7('0x1b')](function(_0xca533d){logger[_0xd5e7('0x18')](_0xd5e7('0x26'),_0xca533d[_0xd5e7('0x19')],_0x245719);_0x30e091(_this[_0xd5e7('0x18')](0x1f4,_0xca533d[_0xd5e7('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 7dacde9..62aa576 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 _0x37b8=['register','length','chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener'];(function(_0x2692ff,_0x5f24ee){var _0x175f14=function(_0x24ea05){while(--_0x24ea05){_0x2692ff['push'](_0x2692ff['shift']());}};_0x175f14(++_0x5f24ee);}(_0x37b8,0x186));var _0x837b=function(_0x2a7f29,_0x2c89dc){_0x2a7f29=_0x2a7f29-0x0;var _0x38924b=_0x37b8[_0x2a7f29];return _0x38924b;};'use strict';var ChatInteractionEvents=require(_0x837b('0x0'));var events=[_0x837b('0x1'),_0x837b('0x2'),_0x837b('0x3')];function createListener(_0x5d94e7,_0x26b933){return function(_0x3f6351){_0x26b933[_0x837b('0x4')](_0x5d94e7,_0x3f6351);};}function removeListener(_0x1838fe,_0x537182){return function(){ChatInteractionEvents[_0x837b('0x5')](_0x1838fe,_0x537182);};}exports[_0x837b('0x6')]=function(_0x20ee7a){for(var _0x46d6a3=0x0,_0x50ed41=events[_0x837b('0x7')];_0x46d6a3<_0x50ed41;_0x46d6a3++){var _0x11aa0f=events[_0x46d6a3];var _0x54f880=createListener(_0x837b('0x8')+_0x11aa0f,_0x20ee7a);ChatInteractionEvents['on'](_0x11aa0f,_0x54f880);}}; \ No newline at end of file +var _0x2ab3=['emit','removeListener','length','chatInteraction:','./chatInteraction.events','save','update'];(function(_0x5eb40b,_0x3fcd44){var _0x53f4e9=function(_0x2fd136){while(--_0x2fd136){_0x5eb40b['push'](_0x5eb40b['shift']());}};_0x53f4e9(++_0x3fcd44);}(_0x2ab3,0x162));var _0x32ab=function(_0x4394b6,_0x12357f){_0x4394b6=_0x4394b6-0x0;var _0x360244=_0x2ab3[_0x4394b6];return _0x360244;};'use strict';var ChatInteractionEvents=require(_0x32ab('0x0'));var events=[_0x32ab('0x1'),'remove',_0x32ab('0x2')];function createListener(_0x311d7f,_0x5a1b9a){return function(_0x55c51d){_0x5a1b9a[_0x32ab('0x3')](_0x311d7f,_0x55c51d);};}function removeListener(_0x38b4e0,_0x40ef15){return function(){ChatInteractionEvents[_0x32ab('0x4')](_0x38b4e0,_0x40ef15);};}exports['register']=function(_0xce9968){for(var _0x166335=0x0,_0x120976=events[_0x32ab('0x5')];_0x166335<_0x120976;_0x166335++){var _0x195824=events[_0x166335];var _0x23bd19=createListener(_0x32ab('0x6')+_0x195824,_0xce9968);ChatInteractionEvents['on'](_0x195824,_0x23bd19);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index ad2c7e2..0c24e34 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 _0x3423=['update','/:id/custom_update','customUpdate','/:id/abandon','delete','destroy','removeTags','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','getMessages','/:id/download','download','post','create','diskStorage','join','root','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','chat','chatinteraction:addtags','put','tracked','chatinteraction:update'];(function(_0x3da707,_0x30c36d){var _0x342ee7=function(_0x175135){while(--_0x175135){_0x3da707['push'](_0x3da707['shift']());}};_0x342ee7(++_0x30c36d);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3342('0x0'));var timeout=require(_0x3342('0x1'));var express=require(_0x3342('0x2'));var router=express[_0x3342('0x3')]();var auth=require(_0x3342('0x4'));var interaction=require(_0x3342('0x5'));var config=require(_0x3342('0x6'));var controller=require(_0x3342('0x7'));router[_0x3342('0x8')]('/',auth[_0x3342('0x9')](),controller[_0x3342('0xa')]);router[_0x3342('0x8')](_0x3342('0xb'),auth[_0x3342('0x9')](),controller[_0x3342('0xc')]);router[_0x3342('0x8')](_0x3342('0xd'),auth[_0x3342('0xe')](),controller[_0x3342('0xf')]);router['get']('/:id/attachment_download',auth[_0x3342('0xe')](),controller['attachmentDownload']);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x3342('0x10')]);router[_0x3342('0x8')]('/:id/my_messages',auth[_0x3342('0xe')](),controller['getMyMessages']);router[_0x3342('0x8')](_0x3342('0x11'),auth['isAuthenticated'](),controller[_0x3342('0x12')]);router[_0x3342('0x13')]('/',auth[_0x3342('0x9')](),controller[_0x3342('0x14')]);var upload=multer({'storage':multer[_0x3342('0x15')]({'destination':function(_0x104077,_0x34a306,_0x59be1d){_0x59be1d(null,path[_0x3342('0x16')](config[_0x3342('0x17')],'server/files/attachments/'));},'filename':function(_0x40d609,_0x2c9df0,_0x51ef91){_0x51ef91(null,util['format'](_0x3342('0x18'),Date[_0x3342('0x19')](),_0x2c9df0[_0x3342('0x1a')][_0x3342('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3342('0x13')](_0x3342('0x1c'),upload[_0x3342('0x1d')](_0x3342('0x1e')),controller[_0x3342('0x1f')]);router['post'](_0x3342('0x20'),auth[_0x3342('0xe')](),controller[_0x3342('0x21')]);router['post'](_0x3342('0x22'),auth[_0x3342('0x9')](),interaction['tracked'](_0x3342('0x23'),_0x3342('0x24')),controller['addTags']);router[_0x3342('0x25')]('/:id',auth[_0x3342('0x9')](),interaction[_0x3342('0x26')](_0x3342('0x23'),_0x3342('0x27')),controller[_0x3342('0x28')]);router[_0x3342('0x25')](_0x3342('0x29'),controller[_0x3342('0x2a')]);router['put'](_0x3342('0x2b'),auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0x3342('0x25')]('/:id/close',controller['close']);router[_0x3342('0x2c')]('/:id',auth[_0x3342('0x9')](),interaction['tracked']('chat','chatinteraction:destroy'),controller[_0x3342('0x2d')]);router[_0x3342('0x2c')](_0x3342('0x22'),auth['isAuthenticated'](),controller[_0x3342('0x2e')]);module[_0x3342('0x2f')]=router; \ No newline at end of file +var _0x58a4=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','diskStorage','join','root','format','%s-%s','originalname','replace','post','/:id/attachment_upload','single','addMessage','/:id/tags','tracked','chat','addTags','put','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x4e6b6f,_0x121069){var _0x27d5d9=function(_0x58493d){while(--_0x58493d){_0x4e6b6f['push'](_0x4e6b6f['shift']());}};_0x27d5d9(++_0x121069);}(_0x58a4,0xbf));var _0x458a=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0x58a4[_0x1fa759];return _0x2da9f4;};'use strict';var multer=require(_0x458a('0x0'));var util=require(_0x458a('0x1'));var path=require(_0x458a('0x2'));var timeout=require(_0x458a('0x3'));var express=require(_0x458a('0x4'));var router=express[_0x458a('0x5')]();var auth=require(_0x458a('0x6'));var interaction=require(_0x458a('0x7'));var config=require(_0x458a('0x8'));var controller=require(_0x458a('0x9'));router[_0x458a('0xa')]('/',auth[_0x458a('0xb')](),controller[_0x458a('0xc')]);router['get']('/describe',auth[_0x458a('0xb')](),controller[_0x458a('0xd')]);router[_0x458a('0xa')](_0x458a('0xe'),auth[_0x458a('0xf')](),controller['show']);router['get'](_0x458a('0x10'),auth[_0x458a('0xf')](),controller[_0x458a('0x11')]);router[_0x458a('0xa')](_0x458a('0x12'),auth['isAuthenticated'](),controller[_0x458a('0x13')]);router[_0x458a('0xa')]('/:id/my_messages',auth[_0x458a('0xf')](),controller[_0x458a('0x14')]);router[_0x458a('0xa')](_0x458a('0x15'),auth[_0x458a('0xb')](),controller['download']);router['post']('/',auth[_0x458a('0xb')](),controller['create']);var upload=multer({'storage':multer[_0x458a('0x16')]({'destination':function(_0x44f683,_0x10133b,_0x3b74f9){_0x3b74f9(null,path[_0x458a('0x17')](config[_0x458a('0x18')],'server/files/attachments/'));},'filename':function(_0x4b26be,_0x5c7993,_0x2faf6a){_0x2faf6a(null,util[_0x458a('0x19')](_0x458a('0x1a'),Date['now'](),_0x5c7993[_0x458a('0x1b')][_0x458a('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x458a('0x1d')](_0x458a('0x1e'),upload[_0x458a('0x1f')]('file'),controller['attachmentUpload']);router[_0x458a('0x1d')]('/:id/messages',auth[_0x458a('0xf')](),controller[_0x458a('0x20')]);router['post'](_0x458a('0x21'),auth['isAuthenticated'](),interaction[_0x458a('0x22')](_0x458a('0x23'),'chatinteraction:addtags'),controller[_0x458a('0x24')]);router[_0x458a('0x25')]('/:id',auth[_0x458a('0xb')](),interaction['tracked'](_0x458a('0x23'),'chatinteraction:update'),controller[_0x458a('0x26')]);router['put'](_0x458a('0x27'),controller[_0x458a('0x28')]);router[_0x458a('0x25')](_0x458a('0x29'),auth[_0x458a('0xf')](),controller[_0x458a('0x2a')]);router[_0x458a('0x25')](_0x458a('0x2b'),controller[_0x458a('0x2c')]);router[_0x458a('0x2d')](_0x458a('0xe'),auth[_0x458a('0xb')](),interaction[_0x458a('0x22')]('chat',_0x458a('0x2e')),controller[_0x458a('0x2f')]);router['delete']('/:id/tags',auth[_0x458a('0xb')](),controller['removeTags']);module[_0x458a('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 9bfd52f..452cab2 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 _0x3a6d=['medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x2d0dbf,_0x55b18b){var _0x5f559d=function(_0x41d9ff){while(--_0x41d9ff){_0x2d0dbf['push'](_0x2d0dbf['shift']());}};_0x5f559d(++_0x55b18b);}(_0x3a6d,0x143));var _0xd3a6=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x3a6d[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0xd3a6('0x0'));module[_0xd3a6('0x1')]={'body':{'type':Sequelize['TEXT'](_0xd3a6('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd3a6('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xd3a6('0x4')]}}; \ No newline at end of file +var _0x6d38=['exports','TEXT','medium'];(function(_0x69f06b,_0x34935c){var _0x388e0a=function(_0x1364b6){while(--_0x1364b6){_0x69f06b['push'](_0x69f06b['shift']());}};_0x388e0a(++_0x34935c);}(_0x6d38,0x1ef));var _0x86d3=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x6d38[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require('sequelize');module[_0x86d3('0x0')]={'body':{'type':Sequelize[_0x86d3('0x1')](_0x86d3('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index a899b56..fb7e4d6 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 _0xa4a5=['messages','createdAt','lastMessage','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','userpic','internal','showWebBar','VoiceQueue','VoiceQueues','type','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','autoAssociation','isEmpty','resourceId','push','FromId','ToId','read','all','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','json','count','set','Content-Range','apply','update','then','stack','name','index','ChatInternalMessage','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','where','filter','field','merge','options','includeAll','include','findAll','rows','show','length','catch','create','body','find','params','destroy','describe','get'];(function(_0x4fa0c8,_0x24b0e8){var _0x39ee40=function(_0x1dcfbb){while(--_0x1dcfbb){_0x4fa0c8['push'](_0x4fa0c8['shift']());}};_0x39ee40(++_0x24b0e8);}(_0xa4a5,0xef));var _0x5a4a=function(_0x5c121c,_0x54aa2b){_0x5c121c=_0x5c121c-0x0;var _0x4af968=_0xa4a5[_0x5c121c];return _0x4af968;};'use strict';var pdf=require(_0x5a4a('0x0'));var emlformat=require(_0x5a4a('0x1'));var rimraf=require(_0x5a4a('0x2'));var zipdir=require(_0x5a4a('0x3'));var jsonpatch=require(_0x5a4a('0x4'));var rp=require(_0x5a4a('0x5'));var moment=require(_0x5a4a('0x6'));var BPromise=require(_0x5a4a('0x7'));var Mustache=require(_0x5a4a('0x8'));var util=require(_0x5a4a('0x9'));var path=require(_0x5a4a('0xa'));var sox=require(_0x5a4a('0xb'));var csv=require(_0x5a4a('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5a4a('0xd'));var squel=require(_0x5a4a('0xe'));var crypto=require('crypto');var jsforce=require(_0x5a4a('0xf'));var deskjs=require(_0x5a4a('0x10'));var toCsv=require(_0x5a4a('0xc'));var querystring=require(_0x5a4a('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5a4a('0x12'));var qs=require(_0x5a4a('0x13'));var hardwareService=require(_0x5a4a('0x14'));var logger=require(_0x5a4a('0x15'))('api');var utils=require(_0x5a4a('0x16'));var config=require(_0x5a4a('0x17'));var db=require(_0x5a4a('0x18'))['db'];config[_0x5a4a('0x19')]=_[_0x5a4a('0x1a')](config[_0x5a4a('0x19')],{'host':_0x5a4a('0x1b'),'port':0x18eb});var socket=require(_0x5a4a('0x1c'))(new Redis(config['redis']));require(_0x5a4a('0x1d'))['register'](socket);function respondWithStatusCode(_0x29f428,_0x2963e4){_0x2963e4=_0x2963e4||0xcc;return function(_0x56b8f9){if(_0x56b8f9){return _0x29f428[_0x5a4a('0x1e')](_0x2963e4);}return _0x29f428[_0x5a4a('0x1f')](_0x2963e4)[_0x5a4a('0x20')]();};}function respondWithResult(_0x2a37b2,_0x4cac51){_0x4cac51=_0x4cac51||0xc8;return function(_0x10e899){if(_0x10e899){return _0x2a37b2['status'](_0x4cac51)[_0x5a4a('0x21')](_0x10e899);}};}function respondWithFilteredResult(_0x180cfc,_0x5ab748){return function(_0x366bff){if(_0x366bff){var _0x5264a4=_0x366bff[_0x5a4a('0x22')],_0x3a0d5e=_0x5ab748['offset'],_0x27e039=_0x5ab748['offset']+_0x5ab748['limit'],_0x49d0e2;if(_0x27e039>=_0x5264a4){_0x27e039=_0x5264a4;_0x49d0e2=0xc8;}else{_0x49d0e2=0xce;}_0x180cfc['status'](_0x49d0e2);return _0x180cfc[_0x5a4a('0x23')](_0x5a4a('0x24'),_0x3a0d5e+'-'+_0x27e039+'/'+_0x5264a4)[_0x5a4a('0x21')](_0x366bff);}return null;};}function patchUpdates(_0x1fbb3f){return function(_0x3dcc84){try{jsonpatch[_0x5a4a('0x25')](_0x3dcc84,_0x1fbb3f,!![]);}catch(_0x235c30){return BPromise['reject'](_0x235c30);}return _0x3dcc84['save']();};}function saveUpdates(_0x2ade61,_0xe2492d){return function(_0x40530c){if(_0x40530c){return _0x40530c[_0x5a4a('0x26')](_0x2ade61)[_0x5a4a('0x27')](function(_0x55a266){return _0x55a266;});}return null;};}function removeEntity(_0xe81f28,_0x597149){return function(_0x12c287){if(_0x12c287){return _0x12c287['destroy']()[_0x5a4a('0x27')](function(){_0xe81f28[_0x5a4a('0x1f')](0xcc)[_0x5a4a('0x20')]();});}};}function handleEntityNotFound(_0x48083b,_0x35dec5){return function(_0x3e7aa3){if(!_0x3e7aa3){_0x48083b[_0x5a4a('0x1e')](0x194);}return _0x3e7aa3;};}function handleError(_0x121faf,_0x177935){_0x177935=_0x177935||0x1f4;return function(_0x138537){logger['error'](_0x138537[_0x5a4a('0x28')]);if(_0x138537['name']){delete _0x138537[_0x5a4a('0x29')];}_0x121faf[_0x5a4a('0x1f')](_0x177935)['send'](_0x138537);};}exports[_0x5a4a('0x2a')]=function(_0x14de7b,_0x43e973){var _0xa67df4={},_0x46954e={},_0x1dc177={'count':0x0,'rows':[]};var _0x1a2a29=db[_0x5a4a('0x2b')][_0x5a4a('0x2c')];_0x46954e[_0x5a4a('0x2d')]=_['keys'](_0x1a2a29);_0x46954e[_0x5a4a('0x2e')]=_[_0x5a4a('0x2f')](_0x14de7b[_0x5a4a('0x2e')]);_0x46954e[_0x5a4a('0x30')]=_[_0x5a4a('0x31')](_0x46954e['model'],_0x46954e[_0x5a4a('0x2e')]);_0xa67df4[_0x5a4a('0x32')]=_[_0x5a4a('0x31')](_0x46954e['model'],qs[_0x5a4a('0x33')](_0x14de7b[_0x5a4a('0x2e')][_0x5a4a('0x33')]));_0xa67df4[_0x5a4a('0x32')]=_0xa67df4[_0x5a4a('0x32')]['length']?_0xa67df4[_0x5a4a('0x32')]:_0x46954e['model'];if(!_0x14de7b[_0x5a4a('0x2e')][_0x5a4a('0x34')]('nolimit')){_0xa67df4[_0x5a4a('0x35')]=qs[_0x5a4a('0x35')](_0x14de7b['query'][_0x5a4a('0x35')]);_0xa67df4[_0x5a4a('0x36')]=qs['offset'](_0x14de7b[_0x5a4a('0x2e')][_0x5a4a('0x36')]);}_0xa67df4[_0x5a4a('0x37')]=qs[_0x5a4a('0x38')](_0x14de7b['query']['sort']);_0xa67df4[_0x5a4a('0x39')]=qs[_0x5a4a('0x30')](_['pick'](_0x14de7b['query'],_0x46954e[_0x5a4a('0x30')]));if(_0x14de7b[_0x5a4a('0x2e')][_0x5a4a('0x3a')]){_0xa67df4[_0x5a4a('0x39')]=_['merge'](_0xa67df4['where'],{'$or':_['map'](_0x1a2a29,function(_0x1363ea){if(_0x1363ea['type']['key']!=='VIRTUAL'){var _0x205170={};_0x205170[_0x1363ea[_0x5a4a('0x3b')]]={'$like':'%'+_0x14de7b[_0x5a4a('0x2e')]['filter']+'%'};return _0x205170;}})});}_0xa67df4=_[_0x5a4a('0x3c')]({},_0xa67df4,_0x14de7b[_0x5a4a('0x3d')]);var _0x3c8d7f={'where':_0xa67df4[_0x5a4a('0x39')]};return db[_0x5a4a('0x2b')]['count'](_0x3c8d7f)['then'](function(_0x6ae257){_0x1dc177['count']=_0x6ae257;if(_0x14de7b[_0x5a4a('0x2e')][_0x5a4a('0x3e')]){_0xa67df4[_0x5a4a('0x3f')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x5a4a('0x40')](_0xa67df4);})['then'](function(_0x192b87){_0x1dc177[_0x5a4a('0x41')]=_0x192b87;return _0x1dc177;})['then'](respondWithFilteredResult(_0x43e973,_0xa67df4))['catch'](handleError(_0x43e973,null));};exports[_0x5a4a('0x42')]=function(_0x278cd7,_0x12a6da){var _0x2b2334={'raw':!![],'where':{'id':_0x278cd7['params']['id']}},_0x4c725a={};_0x4c725a[_0x5a4a('0x2d')]=_['keys'](db[_0x5a4a('0x2b')][_0x5a4a('0x2c')]);_0x4c725a[_0x5a4a('0x2e')]=_['keys'](_0x278cd7[_0x5a4a('0x2e')]);_0x4c725a[_0x5a4a('0x30')]=_[_0x5a4a('0x31')](_0x4c725a[_0x5a4a('0x2d')],_0x4c725a[_0x5a4a('0x2e')]);_0x2b2334['attributes']=_['intersection'](_0x4c725a[_0x5a4a('0x2d')],qs[_0x5a4a('0x33')](_0x278cd7[_0x5a4a('0x2e')][_0x5a4a('0x33')]));_0x2b2334[_0x5a4a('0x32')]=_0x2b2334[_0x5a4a('0x32')][_0x5a4a('0x43')]?_0x2b2334['attributes']:_0x4c725a[_0x5a4a('0x2d')];if(_0x278cd7[_0x5a4a('0x2e')][_0x5a4a('0x3e')]){_0x2b2334[_0x5a4a('0x3f')]=[{'all':!![]}];}_0x2b2334=_[_0x5a4a('0x3c')]({},_0x2b2334,_0x278cd7[_0x5a4a('0x3d')]);return db[_0x5a4a('0x2b')]['find'](_0x2b2334)[_0x5a4a('0x27')](handleEntityNotFound(_0x12a6da,null))[_0x5a4a('0x27')](respondWithResult(_0x12a6da,null))[_0x5a4a('0x44')](handleError(_0x12a6da,null));};exports[_0x5a4a('0x45')]=function(_0xb45673,_0x332395){return db['ChatInternalMessage'][_0x5a4a('0x45')](_0xb45673['body'],{})[_0x5a4a('0x27')](respondWithResult(_0x332395,0xc9))[_0x5a4a('0x44')](handleError(_0x332395,null));};exports['update']=function(_0x3c327e,_0x154250){if(_0x3c327e[_0x5a4a('0x46')]['id']){delete _0x3c327e[_0x5a4a('0x46')]['id'];}return db[_0x5a4a('0x2b')][_0x5a4a('0x47')]({'where':{'id':_0x3c327e[_0x5a4a('0x48')]['id']}})[_0x5a4a('0x27')](handleEntityNotFound(_0x154250,null))[_0x5a4a('0x27')](saveUpdates(_0x3c327e['body'],null))[_0x5a4a('0x27')](respondWithResult(_0x154250,null))[_0x5a4a('0x44')](handleError(_0x154250,null));};exports[_0x5a4a('0x49')]=function(_0xa989e0,_0x4aece4){return db[_0x5a4a('0x2b')][_0x5a4a('0x47')]({'where':{'id':_0xa989e0['params']['id']}})[_0x5a4a('0x27')](handleEntityNotFound(_0x4aece4,null))[_0x5a4a('0x27')](removeEntity(_0x4aece4,null))[_0x5a4a('0x44')](handleError(_0x4aece4,null));};exports[_0x5a4a('0x4a')]=function(_0x4e944f,_0x25bc60){return db['ChatInternalMessage'][_0x5a4a('0x4a')]()[_0x5a4a('0x27')](respondWithResult(_0x25bc60,null))[_0x5a4a('0x44')](handleError(_0x25bc60,null));};function wrapUser(_0x3aab73){return function(_0xb0f994){var _0x407ceb=_0x3aab73[_0x5a4a('0x4b')]({'plain':!![]});_0x407ceb[_0x5a4a('0x4c')]=[];if(_0xb0f994){_0x407ceb['lastMessageAt']=_0xb0f994[_0x5a4a('0x4d')];_0x407ceb[_0x5a4a('0x4e')]=_0xb0f994;}else{_0x407ceb[_0x5a4a('0x4f')]=moment(0x0)['format'](_0x5a4a('0x50'));_0x407ceb[_0x5a4a('0x4e')]={};}return _0x407ceb;};}exports[_0x5a4a('0x51')]=function(_0x56f7d3,_0x55056b,_0x12605b){var _0x1321ab=[];return db[_0x5a4a('0x52')]['findAll']({'where':{'role':[_0x5a4a('0x53'),_0x5a4a('0x54'),_0x5a4a('0x55')]},'attributes':['id',_0x5a4a('0x56'),_0x5a4a('0x29'),'role',_0x5a4a('0x57'),_0x5a4a('0x58'),'online','lastLoginAt','allowmessenger',_0x5a4a('0x59')],'order':qs[_0x5a4a('0x38')]('-online'),'include':[{'model':db[_0x5a4a('0x5a')],'as':_0x5a4a('0x5b'),'attributes':['id','name',_0x5a4a('0x5c')],'through':{'attributes':[]}}]})[_0x5a4a('0x27')](function(_0xa02106){if(_0xa02106){var _0x10a32a=_0x56f7d3[_0x5a4a('0x55')]['get']({'plain':!![]});if(!_0x10a32a)throw new Error(_0x5a4a('0x5d'));if(_0x10a32a[_0x5a4a('0x5e')]===_0x5a4a('0x55')){return db[_0x5a4a('0x5f')][_0x5a4a('0x47')]({'where':{'name':_0x5a4a('0x60'),'userProfileId':_0x10a32a['userProfileId']},'raw':!![]})[_0x5a4a('0x27')](function(_0x1f6611){if(_0x1f6611){if(_0x1f6611[_0x5a4a('0x61')]===0x0){return db['UserProfileResource'][_0x5a4a('0x40')]({'where':{'sectionId':_0x1f6611['id']},'raw':!![]})['then'](function(_0x1d064a){var _0xb5066b=[];if(_[_0x5a4a('0x62')](_0x1d064a)){_0xb5066b=_[_0x5a4a('0x3a')](_0xa02106,function(_0x12621c){if(_0x12621c['role']!=='agent'){return _0x12621c;}});return _0xb5066b;}else{for(var _0x4dcc55=0x0;_0x4dcc55<_0xa02106[_0x5a4a('0x43')];_0x4dcc55++){var _0x206136=_0xa02106[_0x4dcc55];if(_0x206136['role']===_0x5a4a('0x53')){var _0x2789b8=_[_0x5a4a('0x47')](_0x1d064a,function(_0x296e72){return _0x296e72[_0x5a4a('0x63')]===_0x206136['id'];});if(_0x2789b8)_0xb5066b[_0x5a4a('0x64')](_0x206136);}else{_0xb5066b[_0x5a4a('0x64')](_0x206136);}}return _0xb5066b;}});}else{return _0xa02106;}}else{var _0x452d41=_[_0x5a4a('0x3a')](_0xa02106,function(_0x2af8af){if(_0x2af8af[_0x5a4a('0x5e')]!=='agent'){return _0x2af8af;}});return _0x452d41;}});}else{return _0xa02106;}}})['then'](function(_0x1d2f45){var _0x5372c6=[];if(_0x1d2f45){_0x1321ab=_0x1d2f45;for(var _0x3c9b1f=0x0;_0x3c9b1f<_0x1d2f45[_0x5a4a('0x43')];_0x3c9b1f+=0x1){_0x1321ab[_0x3c9b1f]['messages']=[];_0x5372c6[_0x5a4a('0x64')](db['ChatInternalMessage'][_0x5a4a('0x47')]({'where':{'FromId':[_0x56f7d3[_0x5a4a('0x55')]['id'],_0x1d2f45[_0x3c9b1f]['id']],'ToId':[_0x56f7d3[_0x5a4a('0x55')]['id'],_0x1d2f45[_0x3c9b1f]['id']],'ChatGroupId':null},'attributes':['id',_0x5a4a('0x4d'),_0x5a4a('0x65'),_0x5a4a('0x66'),_0x5a4a('0x67'),_0x5a4a('0x46')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5a4a('0x27')](wrapUser(_0x1d2f45[_0x3c9b1f])));}return BPromise[_0x5a4a('0x68')](_0x5372c6);}return[];})[_0x5a4a('0x27')](function(_0x46a5c4){return{'rows':_0x46a5c4,'count':_0x46a5c4[_0x5a4a('0x43')]};})[_0x5a4a('0x27')](respondWithResult(_0x55056b,null))[_0x5a4a('0x44')](handleError(_0x55056b,null));}; \ No newline at end of file +var _0x02d6=['push','read','-createdAt','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./chatInternalMessage.socket','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','sendStatus','stack','name','send','index','ChatInternalMessage','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','create','body','update','find','catch','destroy','describe','get','messages','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','fullname','role','online','showWebBar','-online','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty'];(function(_0x4fa25e,_0x177e4f){var _0xf0065d=function(_0x28da3e){while(--_0x28da3e){_0x4fa25e['push'](_0x4fa25e['shift']());}};_0xf0065d(++_0x177e4f);}(_0x02d6,0x1b3));var _0x602d=function(_0x58bca6,_0x27b2f6){_0x58bca6=_0x58bca6-0x0;var _0x4d1609=_0x02d6[_0x58bca6];return _0x4d1609;};'use strict';var pdf=require(_0x602d('0x0'));var emlformat=require(_0x602d('0x1'));var rimraf=require(_0x602d('0x2'));var zipdir=require(_0x602d('0x3'));var jsonpatch=require(_0x602d('0x4'));var rp=require('request-promise');var moment=require(_0x602d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x602d('0x6'));var util=require(_0x602d('0x7'));var path=require(_0x602d('0x8'));var sox=require(_0x602d('0x9'));var csv=require(_0x602d('0xa'));var ejs=require(_0x602d('0xb'));var fs=require('fs');var _=require(_0x602d('0xc'));var squel=require(_0x602d('0xd'));var crypto=require(_0x602d('0xe'));var jsforce=require(_0x602d('0xf'));var deskjs=require(_0x602d('0x10'));var toCsv=require(_0x602d('0xa'));var querystring=require(_0x602d('0x11'));var Papa=require(_0x602d('0x12'));var Redis=require(_0x602d('0x13'));var authService=require(_0x602d('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x602d('0x15'));var logger=require(_0x602d('0x16'))('api');var utils=require(_0x602d('0x17'));var config=require(_0x602d('0x18'));var db=require(_0x602d('0x19'))['db'];config[_0x602d('0x1a')]=_[_0x602d('0x1b')](config[_0x602d('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x602d('0x1a')]));require(_0x602d('0x1c'))[_0x602d('0x1d')](socket);function respondWithStatusCode(_0x56ec91,_0x1971a0){_0x1971a0=_0x1971a0||0xcc;return function(_0xf8aaad){if(_0xf8aaad){return _0x56ec91['sendStatus'](_0x1971a0);}return _0x56ec91[_0x602d('0x1e')](_0x1971a0)[_0x602d('0x1f')]();};}function respondWithResult(_0x23e8c9,_0x5ca7f1){_0x5ca7f1=_0x5ca7f1||0xc8;return function(_0xafdef6){if(_0xafdef6){return _0x23e8c9[_0x602d('0x1e')](_0x5ca7f1)[_0x602d('0x20')](_0xafdef6);}};}function respondWithFilteredResult(_0x2c7580,_0xa24a9c){return function(_0x3d7360){if(_0x3d7360){var _0xd9e834=_0x3d7360[_0x602d('0x21')],_0x48c4c2=_0xa24a9c[_0x602d('0x22')],_0xd5f62a=_0xa24a9c['offset']+_0xa24a9c[_0x602d('0x23')],_0x2ea203;if(_0xd5f62a>=_0xd9e834){_0xd5f62a=_0xd9e834;_0x2ea203=0xc8;}else{_0x2ea203=0xce;}_0x2c7580[_0x602d('0x1e')](_0x2ea203);return _0x2c7580[_0x602d('0x24')](_0x602d('0x25'),_0x48c4c2+'-'+_0xd5f62a+'/'+_0xd9e834)[_0x602d('0x20')](_0x3d7360);}return null;};}function patchUpdates(_0x3002c9){return function(_0x1ddc6b){try{jsonpatch[_0x602d('0x26')](_0x1ddc6b,_0x3002c9,!![]);}catch(_0x20c69b){return BPromise[_0x602d('0x27')](_0x20c69b);}return _0x1ddc6b['save']();};}function saveUpdates(_0x512e28,_0x1f9819){return function(_0x2258da){if(_0x2258da){return _0x2258da['update'](_0x512e28)[_0x602d('0x28')](function(_0x20abff){return _0x20abff;});}return null;};}function removeEntity(_0x3052be,_0x22f8fb){return function(_0x29f5b3){if(_0x29f5b3){return _0x29f5b3['destroy']()[_0x602d('0x28')](function(){_0x3052be[_0x602d('0x1e')](0xcc)[_0x602d('0x1f')]();});}};}function handleEntityNotFound(_0x573cd8,_0x45feab){return function(_0x1e25b2){if(!_0x1e25b2){_0x573cd8[_0x602d('0x29')](0x194);}return _0x1e25b2;};}function handleError(_0x522613,_0x1f77c1){_0x1f77c1=_0x1f77c1||0x1f4;return function(_0x5435c2){logger['error'](_0x5435c2[_0x602d('0x2a')]);if(_0x5435c2[_0x602d('0x2b')]){delete _0x5435c2[_0x602d('0x2b')];}_0x522613[_0x602d('0x1e')](_0x1f77c1)[_0x602d('0x2c')](_0x5435c2);};}exports[_0x602d('0x2d')]=function(_0x2ed20b,_0x2a4f5c){var _0x31412f={},_0x292b1c={},_0x1a9b99={'count':0x0,'rows':[]};var _0x2f1370=db[_0x602d('0x2e')]['rawAttributes'];_0x292b1c[_0x602d('0x2f')]=_[_0x602d('0x30')](_0x2f1370);_0x292b1c[_0x602d('0x31')]=_['keys'](_0x2ed20b['query']);_0x292b1c[_0x602d('0x32')]=_[_0x602d('0x33')](_0x292b1c[_0x602d('0x2f')],_0x292b1c['query']);_0x31412f['attributes']=_[_0x602d('0x33')](_0x292b1c[_0x602d('0x2f')],qs['fields'](_0x2ed20b[_0x602d('0x31')][_0x602d('0x34')]));_0x31412f[_0x602d('0x35')]=_0x31412f[_0x602d('0x35')]['length']?_0x31412f[_0x602d('0x35')]:_0x292b1c[_0x602d('0x2f')];if(!_0x2ed20b[_0x602d('0x31')][_0x602d('0x36')](_0x602d('0x37'))){_0x31412f['limit']=qs[_0x602d('0x23')](_0x2ed20b[_0x602d('0x31')][_0x602d('0x23')]);_0x31412f[_0x602d('0x22')]=qs[_0x602d('0x22')](_0x2ed20b[_0x602d('0x31')][_0x602d('0x22')]);}_0x31412f[_0x602d('0x38')]=qs[_0x602d('0x39')](_0x2ed20b['query'][_0x602d('0x39')]);_0x31412f[_0x602d('0x3a')]=qs[_0x602d('0x32')](_[_0x602d('0x3b')](_0x2ed20b[_0x602d('0x31')],_0x292b1c[_0x602d('0x32')]));if(_0x2ed20b[_0x602d('0x31')][_0x602d('0x3c')]){_0x31412f[_0x602d('0x3a')]=_[_0x602d('0x3d')](_0x31412f[_0x602d('0x3a')],{'$or':_[_0x602d('0x3e')](_0x2f1370,function(_0x3cf1df){if(_0x3cf1df[_0x602d('0x3f')][_0x602d('0x40')]!==_0x602d('0x41')){var _0x42be28={};_0x42be28[_0x3cf1df['field']]={'$like':'%'+_0x2ed20b[_0x602d('0x31')][_0x602d('0x3c')]+'%'};return _0x42be28;}})});}_0x31412f=_['merge']({},_0x31412f,_0x2ed20b[_0x602d('0x42')]);var _0x4075e4={'where':_0x31412f[_0x602d('0x3a')]};return db[_0x602d('0x2e')][_0x602d('0x21')](_0x4075e4)[_0x602d('0x28')](function(_0xf67989){_0x1a9b99[_0x602d('0x21')]=_0xf67989;if(_0x2ed20b[_0x602d('0x31')][_0x602d('0x43')]){_0x31412f[_0x602d('0x44')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x602d('0x45')](_0x31412f);})[_0x602d('0x28')](function(_0x247296){_0x1a9b99[_0x602d('0x46')]=_0x247296;return _0x1a9b99;})[_0x602d('0x28')](respondWithFilteredResult(_0x2a4f5c,_0x31412f))['catch'](handleError(_0x2a4f5c,null));};exports[_0x602d('0x47')]=function(_0x4d38d6,_0x363d3f){var _0x1d1578={'raw':!![],'where':{'id':_0x4d38d6[_0x602d('0x48')]['id']}},_0x230a49={};_0x230a49['model']=_[_0x602d('0x30')](db['ChatInternalMessage']['rawAttributes']);_0x230a49['query']=_[_0x602d('0x30')](_0x4d38d6['query']);_0x230a49[_0x602d('0x32')]=_[_0x602d('0x33')](_0x230a49[_0x602d('0x2f')],_0x230a49[_0x602d('0x31')]);_0x1d1578[_0x602d('0x35')]=_[_0x602d('0x33')](_0x230a49['model'],qs[_0x602d('0x34')](_0x4d38d6['query'][_0x602d('0x34')]));_0x1d1578[_0x602d('0x35')]=_0x1d1578[_0x602d('0x35')][_0x602d('0x49')]?_0x1d1578[_0x602d('0x35')]:_0x230a49[_0x602d('0x2f')];if(_0x4d38d6[_0x602d('0x31')][_0x602d('0x43')]){_0x1d1578[_0x602d('0x44')]=[{'all':!![]}];}_0x1d1578=_[_0x602d('0x3d')]({},_0x1d1578,_0x4d38d6[_0x602d('0x42')]);return db[_0x602d('0x2e')]['find'](_0x1d1578)[_0x602d('0x28')](handleEntityNotFound(_0x363d3f,null))[_0x602d('0x28')](respondWithResult(_0x363d3f,null))['catch'](handleError(_0x363d3f,null));};exports[_0x602d('0x4a')]=function(_0x56c858,_0x253f2f){return db[_0x602d('0x2e')][_0x602d('0x4a')](_0x56c858[_0x602d('0x4b')],{})['then'](respondWithResult(_0x253f2f,0xc9))['catch'](handleError(_0x253f2f,null));};exports[_0x602d('0x4c')]=function(_0x49d120,_0x5d6c2a){if(_0x49d120[_0x602d('0x4b')]['id']){delete _0x49d120[_0x602d('0x4b')]['id'];}return db[_0x602d('0x2e')][_0x602d('0x4d')]({'where':{'id':_0x49d120[_0x602d('0x48')]['id']}})[_0x602d('0x28')](handleEntityNotFound(_0x5d6c2a,null))[_0x602d('0x28')](saveUpdates(_0x49d120[_0x602d('0x4b')],null))[_0x602d('0x28')](respondWithResult(_0x5d6c2a,null))[_0x602d('0x4e')](handleError(_0x5d6c2a,null));};exports[_0x602d('0x4f')]=function(_0x508fa3,_0x2b50c5){return db[_0x602d('0x2e')][_0x602d('0x4d')]({'where':{'id':_0x508fa3['params']['id']}})['then'](handleEntityNotFound(_0x2b50c5,null))['then'](removeEntity(_0x2b50c5,null))[_0x602d('0x4e')](handleError(_0x2b50c5,null));};exports[_0x602d('0x50')]=function(_0x38a9e1,_0x1e2584){return db['ChatInternalMessage'][_0x602d('0x50')]()['then'](respondWithResult(_0x1e2584,null))[_0x602d('0x4e')](handleError(_0x1e2584,null));};function wrapUser(_0xd9ed04){return function(_0x3efa16){var _0x42b55f=_0xd9ed04[_0x602d('0x51')]({'plain':!![]});_0x42b55f[_0x602d('0x52')]=[];if(_0x3efa16){_0x42b55f['lastMessageAt']=_0x3efa16[_0x602d('0x53')];_0x42b55f['lastMessage']=_0x3efa16;}else{_0x42b55f['lastMessageAt']=moment(0x0)[_0x602d('0x54')](_0x602d('0x55'));_0x42b55f[_0x602d('0x56')]={};}return _0x42b55f;};}exports[_0x602d('0x57')]=function(_0x59da92,_0x43d1fd,_0x41ef14){var _0x416655=[];return db[_0x602d('0x58')][_0x602d('0x45')]({'where':{'role':[_0x602d('0x59'),_0x602d('0x5a'),'user']},'attributes':['id',_0x602d('0x5b'),_0x602d('0x2b'),_0x602d('0x5c'),'userpic','internal',_0x602d('0x5d'),'lastLoginAt','allowmessenger',_0x602d('0x5e')],'order':qs['sort'](_0x602d('0x5f')),'include':[{'model':db['VoiceQueue'],'as':_0x602d('0x60'),'attributes':['id',_0x602d('0x2b'),_0x602d('0x3f')],'through':{'attributes':[]}}]})['then'](function(_0x237b68){if(_0x237b68){var _0x29c191=_0x59da92[_0x602d('0x61')][_0x602d('0x51')]({'plain':!![]});if(!_0x29c191)throw new Error(_0x602d('0x62'));if(_0x29c191['role']==='user'){return db[_0x602d('0x63')][_0x602d('0x4d')]({'where':{'name':_0x602d('0x64'),'userProfileId':_0x29c191[_0x602d('0x65')]},'raw':!![]})[_0x602d('0x28')](function(_0x482541){if(_0x482541){if(_0x482541[_0x602d('0x66')]===0x0){return db[_0x602d('0x67')]['findAll']({'where':{'sectionId':_0x482541['id']},'raw':!![]})[_0x602d('0x28')](function(_0x10a96a){var _0x2afea4=[];if(_[_0x602d('0x68')](_0x10a96a)){_0x2afea4=_[_0x602d('0x3c')](_0x237b68,function(_0x4c5dd2){if(_0x4c5dd2[_0x602d('0x5c')]!=='agent'){return _0x4c5dd2;}});return _0x2afea4;}else{for(var _0x4af5d0=0x0;_0x4af5d0<_0x237b68[_0x602d('0x49')];_0x4af5d0++){var _0x4c64a6=_0x237b68[_0x4af5d0];if(_0x4c64a6[_0x602d('0x5c')]==='agent'){var _0x1d8294=_[_0x602d('0x4d')](_0x10a96a,function(_0x5a2e3b){return _0x5a2e3b['resourceId']===_0x4c64a6['id'];});if(_0x1d8294)_0x2afea4[_0x602d('0x69')](_0x4c64a6);}else{_0x2afea4[_0x602d('0x69')](_0x4c64a6);}}return _0x2afea4;}});}else{return _0x237b68;}}else{var _0xc8a990=_['filter'](_0x237b68,function(_0xab7526){if(_0xab7526[_0x602d('0x5c')]!==_0x602d('0x59')){return _0xab7526;}});return _0xc8a990;}});}else{return _0x237b68;}}})[_0x602d('0x28')](function(_0x39e6a5){var _0x25372f=[];if(_0x39e6a5){_0x416655=_0x39e6a5;for(var _0x550621=0x0;_0x550621<_0x39e6a5[_0x602d('0x49')];_0x550621+=0x1){_0x416655[_0x550621][_0x602d('0x52')]=[];_0x25372f[_0x602d('0x69')](db[_0x602d('0x2e')][_0x602d('0x4d')]({'where':{'FromId':[_0x59da92['user']['id'],_0x39e6a5[_0x550621]['id']],'ToId':[_0x59da92[_0x602d('0x61')]['id'],_0x39e6a5[_0x550621]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId','ToId',_0x602d('0x6a'),_0x602d('0x4b')],'order':qs[_0x602d('0x39')](_0x602d('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x39e6a5[_0x550621])));}return BPromise['all'](_0x25372f);}return[];})[_0x602d('0x28')](function(_0x4878ef){return{'rows':_0x4878ef,'count':_0x4878ef[_0x602d('0x49')]};})[_0x602d('0x28')](respondWithResult(_0x43d1fd,null))['catch'](handleError(_0x43d1fd,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index d5d3d4b..83cfd95 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 _0xcb91=['save','update','emit','hasOwnProperty','hook','ChatInternalMessage','setMaxListeners'];(function(_0x2199f6,_0x26c372){var _0x3977e8=function(_0x347d6c){while(--_0x347d6c){_0x2199f6['push'](_0x2199f6['shift']());}};_0x3977e8(++_0x26c372);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0xcb91[_0x4b73a2];return _0x383c66;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x1cb9('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1cb9('0x1')](0x0);var events={'afterCreate':_0x1cb9('0x2'),'afterUpdate':_0x1cb9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x8c392f){return function(_0x2c17b8,_0x545a34,_0x13d5fd){ChatInternalMessageEvents[_0x1cb9('0x4')](_0x8c392f+':'+_0x2c17b8['id'],_0x2c17b8);ChatInternalMessageEvents['emit'](_0x8c392f,_0x2c17b8);_0x13d5fd(null);};}for(var e in events){if(events[_0x1cb9('0x5')](e)){var event=events[e];ChatInternalMessage[_0x1cb9('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x55f1=['remove','emit','hasOwnProperty','hook','exports','events','ChatInternalMessage','setMaxListeners','save','update'];(function(_0x2e42d3,_0x21c93e){var _0x3a23ac=function(_0x923aed){while(--_0x923aed){_0x2e42d3['push'](_0x2e42d3['shift']());}};_0x3a23ac(++_0x21c93e);}(_0x55f1,0x9b));var _0x155f=function(_0x14a826,_0x2ad275){_0x14a826=_0x14a826-0x0;var _0x16cf6d=_0x55f1[_0x14a826];return _0x16cf6d;};'use strict';var EventEmitter=require(_0x155f('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x155f('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x155f('0x2')](0x0);var events={'afterCreate':_0x155f('0x3'),'afterUpdate':_0x155f('0x4'),'afterDestroy':_0x155f('0x5')};function emitEvent(_0x13e2af){return function(_0x2089cc,_0x5c3d6c,_0x5cd807){ChatInternalMessageEvents[_0x155f('0x6')](_0x13e2af+':'+_0x2089cc['id'],_0x2089cc);ChatInternalMessageEvents['emit'](_0x13e2af,_0x2089cc);_0x5cd807(null);};}for(var e in events){if(events[_0x155f('0x7')](e)){var event=events[e];ChatInternalMessage[_0x155f('0x8')](e,emitEvent(event));}}module[_0x155f('0x9')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index fc43383..d49b5b7 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 _0x82c6=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x82c6,0x1ad));var _0x682c=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x82c6[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x682c('0x0'));var util=require(_0x682c('0x1'));var logger=require(_0x682c('0x2'))(_0x682c('0x3'));var moment=require(_0x682c('0x4'));var BPromise=require(_0x682c('0x5'));var rp=require(_0x682c('0x6'));var fs=require('fs');var path=require(_0x682c('0x7'));var rimraf=require(_0x682c('0x8'));var config=require(_0x682c('0x9'));var attributes=require(_0x682c('0xa'));module[_0x682c('0xb')]=function(_0x1e7e5e,_0x3e7722){return _0x1e7e5e['define'](_0x682c('0xc'),attributes,{'tableName':_0x682c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x682c('0xe'),'collate':_0x682c('0xf')});}; \ No newline at end of file +var _0xa14c=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x3d9935,_0x555c3e){var _0x4fa895=function(_0x21da73){while(--_0x21da73){_0x3d9935['push'](_0x3d9935['shift']());}};_0x4fa895(++_0x555c3e);}(_0xa14c,0x1c1));var _0xca14=function(_0x1d5805,_0x3dc1fd){_0x1d5805=_0x1d5805-0x0;var _0x1c9bee=_0xa14c[_0x1d5805];return _0x1c9bee;};'use strict';var _=require(_0xca14('0x0'));var util=require(_0xca14('0x1'));var logger=require(_0xca14('0x2'))(_0xca14('0x3'));var moment=require(_0xca14('0x4'));var BPromise=require(_0xca14('0x5'));var rp=require(_0xca14('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xca14('0x7'));var config=require(_0xca14('0x8'));var attributes=require('./chatInternalMessage.attributes');module[_0xca14('0x9')]=function(_0x51f707,_0x440226){return _0x51f707[_0xca14('0xa')](_0xca14('0xb'),attributes,{'tableName':_0xca14('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xca14('0xd'),'collate':_0xca14('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index acbc8ab..0eef450 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 _0xb459=['catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4ca595,_0xf92bae){var _0x2ea19c=function(_0x299367){while(--_0x299367){_0x4ca595['push'](_0x4ca595['shift']());}};_0x2ea19c(++_0xf92bae);}(_0xb459,0x178));var _0x9b45=function(_0x4b3e49,_0x9e566c){_0x4b3e49=_0x4b3e49-0x0;var _0x57e339=_0xb459[_0x4b3e49];return _0x57e339;};'use strict';var _=require(_0x9b45('0x0'));var util=require(_0x9b45('0x1'));var moment=require(_0x9b45('0x2'));var BPromise=require(_0x9b45('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b45('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9b45('0x5'));var logger=require(_0x9b45('0x6'))(_0x9b45('0x7'));var config=require('../../config/environment');var jayson=require(_0x9b45('0x8'));var client=jayson['client'][_0x9b45('0x9')]({'port':0x232a});config[_0x9b45('0xa')]=_[_0x9b45('0xb')](config['redis'],{'host':_0x9b45('0xc'),'port':0x18eb});var socket=require(_0x9b45('0xd'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x146a99,_0x51ebf9,_0x34ffeb){return new BPromise(function(_0x57695f,_0x19654b){return client['request'](_0x146a99,_0x34ffeb)[_0x9b45('0xe')](function(_0x4b8725){logger[_0x9b45('0xf')](_0x9b45('0x10'),_0x51ebf9,_0x9b45('0x11'));logger[_0x9b45('0x12')](_0x9b45('0x13'),_0x51ebf9,_0x9b45('0x11'),JSON[_0x9b45('0x14')](_0x4b8725));if(_0x4b8725[_0x9b45('0x15')]){if(_0x4b8725['error'][_0x9b45('0x16')]===0x1f4){logger[_0x9b45('0x15')](_0x9b45('0x10'),_0x51ebf9,_0x4b8725[_0x9b45('0x15')][_0x9b45('0x17')]);return _0x19654b(_0x4b8725[_0x9b45('0x15')][_0x9b45('0x17')]);}logger[_0x9b45('0x15')](_0x9b45('0x10'),_0x51ebf9,_0x4b8725[_0x9b45('0x15')]['message']);return _0x57695f(_0x4b8725['error'][_0x9b45('0x17')]);}else{logger[_0x9b45('0xf')](_0x9b45('0x10'),_0x51ebf9,'request\x20sent');_0x57695f(_0x4b8725['result'][_0x9b45('0x17')]);}})[_0x9b45('0x18')](function(_0x21a7a4){logger[_0x9b45('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x51ebf9,_0x21a7a4);_0x19654b(_0x21a7a4);});});} \ No newline at end of file +var _0x5643=['../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','./chatInternalMessage.socket','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ioredis','../../mysqldb','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5643,0x162));var _0x3564=function(_0x328273,_0x298db5){_0x328273=_0x328273-0x0;var _0x19e2db=_0x5643[_0x328273];return _0x19e2db;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3564('0x0'));var db=require(_0x3564('0x1'))['db'];var utils=require(_0x3564('0x2'));var logger=require(_0x3564('0x3'))('rpc');var config=require(_0x3564('0x4'));var jayson=require(_0x3564('0x5'));var client=jayson['client'][_0x3564('0x6')]({'port':0x232a});config['redis']=_['defaults'](config[_0x3564('0x7')],{'host':_0x3564('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3564('0x9'))['register'](socket);function respondWithRpcPromise(_0x14c7ba,_0x19871c,_0x67d340){return new BPromise(function(_0x33f936,_0x4553b8){return client[_0x3564('0xa')](_0x14c7ba,_0x67d340)['then'](function(_0x4f839e){logger[_0x3564('0xb')](_0x3564('0xc'),_0x19871c,_0x3564('0xd'));logger[_0x3564('0xe')](_0x3564('0xf'),_0x19871c,_0x3564('0xd'),JSON[_0x3564('0x10')](_0x4f839e));if(_0x4f839e[_0x3564('0x11')]){if(_0x4f839e['error'][_0x3564('0x12')]===0x1f4){logger[_0x3564('0x11')](_0x3564('0xc'),_0x19871c,_0x4f839e[_0x3564('0x11')]['message']);return _0x4553b8(_0x4f839e[_0x3564('0x11')]['message']);}logger[_0x3564('0x11')](_0x3564('0xc'),_0x19871c,_0x4f839e[_0x3564('0x11')][_0x3564('0x13')]);return _0x33f936(_0x4f839e['error'][_0x3564('0x13')]);}else{logger[_0x3564('0xb')]('ChatInternalMessage,\x20%s,\x20%s',_0x19871c,_0x3564('0xd'));_0x33f936(_0x4f839e[_0x3564('0x14')][_0x3564('0x13')]);}})['catch'](function(_0x1d449d){logger[_0x3564('0x11')](_0x3564('0xc'),_0x19871c,_0x1d449d);_0x4553b8(_0x1d449d);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 4983a97..241e45c 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 _0x01cd=['register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener'];(function(_0x2fad8a,_0x26de69){var _0x494d7d=function(_0x52fe59){while(--_0x52fe59){_0x2fad8a['push'](_0x2fad8a['shift']());}};_0x494d7d(++_0x26de69);}(_0x01cd,0xc9));var _0xd01c=function(_0x4153a4,_0x401825){_0x4153a4=_0x4153a4-0x0;var _0x1b62a5=_0x01cd[_0x4153a4];return _0x1b62a5;};'use strict';var ChatInternalMessageEvents=require(_0xd01c('0x0'));var events=[_0xd01c('0x1'),_0xd01c('0x2'),_0xd01c('0x3')];function createListener(_0x1cd207,_0x5f3c66){return function(_0x4cc9bf){_0x5f3c66[_0xd01c('0x4')](_0x1cd207,_0x4cc9bf);};}function removeListener(_0x2e8fbe,_0x3a51f0){return function(){ChatInternalMessageEvents[_0xd01c('0x5')](_0x2e8fbe,_0x3a51f0);};}exports[_0xd01c('0x6')]=function(_0x4af7b5){for(var _0x1340cf=0x0,_0x46a10d=events[_0xd01c('0x7')];_0x1340cf<_0x46a10d;_0x1340cf++){var _0x1aebdb=events[_0x1340cf];var _0x4c2ed5=createListener(_0xd01c('0x8')+_0x1aebdb,_0x4af7b5);ChatInternalMessageEvents['on'](_0x1aebdb,_0x4c2ed5);}}; \ No newline at end of file +var _0x0724=['remove','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x11262c,_0x20d80b){var _0x23977b=function(_0x273f88){while(--_0x273f88){_0x11262c['push'](_0x11262c['shift']());}};_0x23977b(++_0x20d80b);}(_0x0724,0x166));var _0x4072=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0724[_0x122ef9];return _0x42fba0;};'use strict';var ChatInternalMessageEvents=require(_0x4072('0x0'));var events=[_0x4072('0x1'),_0x4072('0x2'),'update'];function createListener(_0x203a15,_0x30b683){return function(_0x26fb97){_0x30b683[_0x4072('0x3')](_0x203a15,_0x26fb97);};}function removeListener(_0xb042eb,_0xfc5440){return function(){ChatInternalMessageEvents[_0x4072('0x4')](_0xb042eb,_0xfc5440);};}exports[_0x4072('0x5')]=function(_0x343440){for(var _0x22492d=0x0,_0x244451=events[_0x4072('0x6')];_0x22492d<_0x244451;_0x22492d++){var _0x1c8993=events[_0x22492d];var _0x33ac7d=createListener(_0x4072('0x7')+_0x1c8993,_0x343440);ChatInternalMessageEvents['on'](_0x1c8993,_0x33ac7d);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index b41a147..41d392a 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 _0x565e=['exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','put','update','delete'];(function(_0x1dde51,_0x1ccb52){var _0x277e4a=function(_0x4ec28c){while(--_0x4ec28c){_0x1dde51['push'](_0x1dde51['shift']());}};_0x277e4a(++_0x1ccb52);}(_0x565e,0x7f));var _0xe565=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x565e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe565('0x0'));var util=require('util');var path=require(_0xe565('0x1'));var timeout=require(_0xe565('0x2'));var express=require(_0xe565('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe565('0x4'));var config=require(_0xe565('0x5'));var controller=require(_0xe565('0x6'));router[_0xe565('0x7')]('/',auth[_0xe565('0x8')](),controller[_0xe565('0x9')]);router[_0xe565('0x7')](_0xe565('0xa'),auth[_0xe565('0x8')](),controller[_0xe565('0xb')]);router[_0xe565('0x7')](_0xe565('0xc'),auth[_0xe565('0x8')](),controller[_0xe565('0xd')]);router[_0xe565('0x7')](_0xe565('0xe'),auth['isAuthenticated'](),controller[_0xe565('0xf')]);router[_0xe565('0x10')]('/',auth[_0xe565('0x8')](),controller['create']);router[_0xe565('0x11')](_0xe565('0xe'),controller[_0xe565('0x12')]);router[_0xe565('0x13')]('/:id',auth[_0xe565('0x8')](),controller['destroy']);module[_0xe565('0x14')]=router; \ No newline at end of file +var _0x71ab=['util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','create','put','update','exports'];(function(_0x1c510a,_0x1413a9){var _0x23cedd=function(_0x3f3e43){while(--_0x3f3e43){_0x1c510a['push'](_0x1c510a['shift']());}};_0x23cedd(++_0x1413a9);}(_0x71ab,0x64));var _0xb71a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x71ab[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var auth=require(_0xb71a('0x3'));var interaction=require(_0xb71a('0x4'));var config=require(_0xb71a('0x5'));var controller=require(_0xb71a('0x6'));router[_0xb71a('0x7')]('/',auth[_0xb71a('0x8')](),controller[_0xb71a('0x9')]);router[_0xb71a('0x7')](_0xb71a('0xa'),auth[_0xb71a('0x8')](),controller[_0xb71a('0xb')]);router[_0xb71a('0x7')](_0xb71a('0xc'),auth[_0xb71a('0x8')](),controller[_0xb71a('0xd')]);router[_0xb71a('0x7')](_0xb71a('0xe'),auth['isAuthenticated'](),controller[_0xb71a('0xf')]);router['post']('/',auth[_0xb71a('0x8')](),controller[_0xb71a('0x10')]);router[_0xb71a('0x11')]('/:id',controller[_0xb71a('0x12')]);router['delete'](_0xb71a('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xb71a('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 434b35c..f6728fd 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 _0xaf17=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x3c91da,_0x1fa073){var _0x3f384c=function(_0x4ca9c9){while(--_0x4ca9c9){_0x3c91da['push'](_0x3c91da['shift']());}};_0x3f384c(++_0x1fa073);}(_0xaf17,0xd6));var _0x7af1=function(_0x2aa87a,_0x4a251d){_0x2aa87a=_0x2aa87a-0x0;var _0x5b869b=_0xaf17[_0x2aa87a];return _0x5b869b;};'use strict';var Sequelize=require(_0x7af1('0x0'));module[_0x7af1('0x1')]={'body':{'type':Sequelize[_0x7af1('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x7af1('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7af1('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7af1('0x4')]('in',_0x7af1('0x5')),'defaultValue':_0x7af1('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7af1('0x6')]}}; \ No newline at end of file +var _0x197b=['sequelize','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0xc0e113,_0x48b4be){var _0x1177ef=function(_0x1e6748){while(--_0x1e6748){_0xc0e113['push'](_0xc0e113['shift']());}};_0x1177ef(++_0x48b4be);}(_0x197b,0x1a4));var _0xb197=function(_0x1aebba,_0x5bed69){_0x1aebba=_0x1aebba-0x0;var _0x244933=_0x197b[_0x1aebba];return _0x244933;};'use strict';var Sequelize=require(_0xb197('0x0'));module['exports']={'body':{'type':Sequelize[_0xb197('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb197('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xb197('0x3')]('in',_0xb197('0x4')),'defaultValue':_0xb197('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xb197('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index ee34d87..95e3f16 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 _0x232c=['VIRTUAL','field','options','count','includeAll','include','findAll','show','params','intersection','length','find','create','body','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','get','ChatInteraction','isNil','read1stAt','format','interaction','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','zip-dir','fast-json-patch','request-promise','bluebird','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/environment','../../mysqldb','defaults','redis','socket.io-emitter','register','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','ChatMessage','rawAttributes','model','keys','query','fields','attributes','order','sort','where','filters','filter','merge','map','type','key'];(function(_0x27caf8,_0x108357){var _0x5b6406=function(_0x131143){while(--_0x131143){_0x27caf8['push'](_0x27caf8['shift']());}};_0x5b6406(++_0x108357);}(_0x232c,0x193));var _0xc232=function(_0x27a1f4,_0x1784e6){_0x27a1f4=_0x27a1f4-0x0;var _0x4cf0d0=_0x232c[_0x27a1f4];return _0x4cf0d0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc232('0x0'));var jsonpatch=require(_0xc232('0x1'));var rp=require(_0xc232('0x2'));var moment=require('moment');var BPromise=require(_0xc232('0x3'));var Mustache=require('mustache');var util=require(_0xc232('0x4'));var path=require(_0xc232('0x5'));var sox=require(_0xc232('0x6'));var csv=require(_0xc232('0x7'));var ejs=require(_0xc232('0x8'));var fs=require('fs');var _=require(_0xc232('0x9'));var squel=require(_0xc232('0xa'));var crypto=require(_0xc232('0xb'));var jsforce=require(_0xc232('0xc'));var deskjs=require(_0xc232('0xd'));var toCsv=require(_0xc232('0x7'));var querystring=require(_0xc232('0xe'));var Papa=require(_0xc232('0xf'));var Redis=require('ioredis');var authService=require(_0xc232('0x10'));var qs=require(_0xc232('0x11'));var hardwareService=require(_0xc232('0x12'));var logger=require(_0xc232('0x13'))(_0xc232('0x14'));var utils=require('../../config/utils');var config=require(_0xc232('0x15'));var db=require(_0xc232('0x16'))['db'];config['redis']=_[_0xc232('0x17')](config[_0xc232('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xc232('0x19'))(new Redis(config[_0xc232('0x18')]));require('./chatMessage.socket')[_0xc232('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc232('0x1b')][_0xc232('0x1c')]({'port':0x232c});var client9002=jayson[_0xc232('0x1b')][_0xc232('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x4a70ef,_0x4ab655,_0xcd2fec){if(_0xcd2fec){var _0x517ef7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x517ef7['test'](_0x4ab655)){return _0x4a70ef;}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 _0x4a70ef;}}function respondWithRpcPromise(_0x45c7b0,_0x28c1a2,_0x2e780d,_0x1eacf8){return new BPromise(function(_0x329730,_0x572049){var _0x44eb1a=_0x1eacf8||client;return _0x44eb1a[_0xc232('0x1d')](_0x45c7b0,_0x2e780d)[_0xc232('0x1e')](function(_0xa1c7b0){logger['info'](_0xc232('0x1f'),_0x28c1a2,_0xc232('0x20'));logger[_0xc232('0x21')](_0xc232('0x22'),_0x28c1a2,_0xc232('0x20'),JSON['stringify'](_0xa1c7b0));if(_0xa1c7b0[_0xc232('0x23')]){if(_0xa1c7b0[_0xc232('0x23')]['code']===0x1f4){logger[_0xc232('0x23')](_0xc232('0x1f'),_0x28c1a2,_0xa1c7b0[_0xc232('0x23')][_0xc232('0x24')]);return _0x572049(_0xa1c7b0['error'][_0xc232('0x24')]);}logger['error'](_0xc232('0x1f'),_0x28c1a2,_0xa1c7b0['error'][_0xc232('0x24')]);return _0x329730(_0xa1c7b0[_0xc232('0x23')][_0xc232('0x24')]);}else{logger['info'](_0xc232('0x1f'),_0x28c1a2,'request\x20sent');_0x329730(_0xa1c7b0['result'][_0xc232('0x24')]);}})[_0xc232('0x25')](function(_0x43db11){logger[_0xc232('0x23')](_0xc232('0x1f'),_0x28c1a2,_0x43db11);_0x572049(_0x43db11);});});}function respondWithStatusCode(_0x8b9364,_0x369eaa){_0x369eaa=_0x369eaa||0xcc;return function(_0x1ccfa9){if(_0x1ccfa9){return _0x8b9364[_0xc232('0x26')](_0x369eaa);}return _0x8b9364['status'](_0x369eaa)[_0xc232('0x27')]();};}function respondWithResult(_0xbcbc00,_0x43ad23){_0x43ad23=_0x43ad23||0xc8;return function(_0x14c211){if(_0x14c211){return _0xbcbc00[_0xc232('0x28')](_0x43ad23)[_0xc232('0x29')](_0x14c211);}};}function respondWithFilteredResult(_0x5f162a,_0xb60436){return function(_0x3912e4){if(_0x3912e4){var _0x581878=_0x3912e4['count'],_0x144d6d=_0xb60436['offset'],_0x316298=_0xb60436[_0xc232('0x2a')]+_0xb60436[_0xc232('0x2b')],_0xce5e56;if(_0x316298>=_0x581878){_0x316298=_0x581878;_0xce5e56=0xc8;}else{_0xce5e56=0xce;}_0x5f162a['status'](_0xce5e56);return _0x5f162a[_0xc232('0x2c')](_0xc232('0x2d'),_0x144d6d+'-'+_0x316298+'/'+_0x581878)[_0xc232('0x29')](_0x3912e4);}return null;};}function patchUpdates(_0x446d8f){return function(_0x23fd7e){try{jsonpatch[_0xc232('0x2e')](_0x23fd7e,_0x446d8f,!![]);}catch(_0x52565b){return BPromise[_0xc232('0x2f')](_0x52565b);}return _0x23fd7e[_0xc232('0x30')]();};}function saveUpdates(_0x4e97e5,_0x599b9d){return function(_0x4e3f77){if(_0x4e3f77){return _0x4e3f77[_0xc232('0x31')](_0x4e97e5)[_0xc232('0x1e')](function(_0x507e86){return _0x507e86;});}return null;};}function removeEntity(_0x20235e,_0x5578d5){return function(_0x3c8be8){if(_0x3c8be8){return _0x3c8be8[_0xc232('0x32')]()[_0xc232('0x1e')](function(){_0x20235e[_0xc232('0x28')](0xcc)[_0xc232('0x27')]();});}};}function handleEntityNotFound(_0x3c81db,_0x5886e5){return function(_0x1e44bc){if(!_0x1e44bc){_0x3c81db['sendStatus'](0x194);}return _0x1e44bc;};}function handleError(_0x56aab7,_0x295f32){_0x295f32=_0x295f32||0x1f4;return function(_0x40df63){logger[_0xc232('0x23')](_0x40df63['stack']);if(_0x40df63['name']){delete _0x40df63[_0xc232('0x33')];}_0x56aab7[_0xc232('0x28')](_0x295f32)[_0xc232('0x34')](_0x40df63);};}exports['index']=function(_0x2b99a0,_0x25fac5){var _0x131809={},_0x398aab={},_0xcaac8b={'count':0x0,'rows':[]};var _0x506063=db[_0xc232('0x35')][_0xc232('0x36')];_0x398aab[_0xc232('0x37')]=_[_0xc232('0x38')](_0x506063);_0x398aab[_0xc232('0x39')]=_['keys'](_0x2b99a0[_0xc232('0x39')]);_0x398aab['filters']=_['intersection'](_0x398aab[_0xc232('0x37')],_0x398aab['query']);_0x131809['attributes']=_['intersection'](_0x398aab[_0xc232('0x37')],qs['fields'](_0x2b99a0[_0xc232('0x39')][_0xc232('0x3a')]));_0x131809[_0xc232('0x3b')]=_0x131809[_0xc232('0x3b')]['length']?_0x131809[_0xc232('0x3b')]:_0x398aab[_0xc232('0x37')];if(!_0x2b99a0[_0xc232('0x39')]['hasOwnProperty']('nolimit')){_0x131809[_0xc232('0x2b')]=qs[_0xc232('0x2b')](_0x2b99a0[_0xc232('0x39')]['limit']);_0x131809[_0xc232('0x2a')]=qs['offset'](_0x2b99a0[_0xc232('0x39')][_0xc232('0x2a')]);}_0x131809[_0xc232('0x3c')]=qs['sort'](_0x2b99a0[_0xc232('0x39')][_0xc232('0x3d')]);_0x131809[_0xc232('0x3e')]=qs[_0xc232('0x3f')](_['pick'](_0x2b99a0['query'],_0x398aab[_0xc232('0x3f')]));if(_0x2b99a0[_0xc232('0x39')][_0xc232('0x40')]){_0x131809[_0xc232('0x3e')]=_[_0xc232('0x41')](_0x131809['where'],{'$or':_[_0xc232('0x42')](_0x506063,function(_0x2cbf69){if(_0x2cbf69[_0xc232('0x43')][_0xc232('0x44')]!==_0xc232('0x45')){var _0x178993={};_0x178993[_0x2cbf69[_0xc232('0x46')]]={'$like':'%'+_0x2b99a0[_0xc232('0x39')]['filter']+'%'};return _0x178993;}})});}_0x131809=_[_0xc232('0x41')]({},_0x131809,_0x2b99a0[_0xc232('0x47')]);var _0x455103={'where':_0x131809[_0xc232('0x3e')]};return db[_0xc232('0x35')][_0xc232('0x48')](_0x455103)[_0xc232('0x1e')](function(_0xd14951){_0xcaac8b[_0xc232('0x48')]=_0xd14951;if(_0x2b99a0[_0xc232('0x39')][_0xc232('0x49')]){_0x131809[_0xc232('0x4a')]=[{'all':!![]}];}return db[_0xc232('0x35')][_0xc232('0x4b')](_0x131809);})[_0xc232('0x1e')](function(_0x19fc52){_0xcaac8b['rows']=_0x19fc52;return _0xcaac8b;})['then'](respondWithFilteredResult(_0x25fac5,_0x131809))[_0xc232('0x25')](handleError(_0x25fac5,null));};exports[_0xc232('0x4c')]=function(_0x32b730,_0x145329){var _0x301617={'raw':!![],'where':{'id':_0x32b730[_0xc232('0x4d')]['id']}},_0x2fb780={};_0x2fb780['model']=_[_0xc232('0x38')](db['ChatMessage'][_0xc232('0x36')]);_0x2fb780[_0xc232('0x39')]=_[_0xc232('0x38')](_0x32b730[_0xc232('0x39')]);_0x2fb780[_0xc232('0x3f')]=_[_0xc232('0x4e')](_0x2fb780[_0xc232('0x37')],_0x2fb780['query']);_0x301617[_0xc232('0x3b')]=_[_0xc232('0x4e')](_0x2fb780['model'],qs['fields'](_0x32b730['query']['fields']));_0x301617[_0xc232('0x3b')]=_0x301617[_0xc232('0x3b')][_0xc232('0x4f')]?_0x301617[_0xc232('0x3b')]:_0x2fb780[_0xc232('0x37')];if(_0x32b730[_0xc232('0x39')][_0xc232('0x49')]){_0x301617[_0xc232('0x4a')]=[{'all':!![]}];}_0x301617=_[_0xc232('0x41')]({},_0x301617,_0x32b730[_0xc232('0x47')]);return db[_0xc232('0x35')][_0xc232('0x50')](_0x301617)[_0xc232('0x1e')](handleEntityNotFound(_0x145329,null))['then'](respondWithResult(_0x145329,null))[_0xc232('0x25')](handleError(_0x145329,null));};exports[_0xc232('0x51')]=function(_0x1306f8,_0x23b4a9){return db[_0xc232('0x35')][_0xc232('0x51')](_0x1306f8[_0xc232('0x52')],{})[_0xc232('0x1e')](respondWithResult(_0x23b4a9,0xc9))[_0xc232('0x25')](handleError(_0x23b4a9,null));};exports[_0xc232('0x31')]=function(_0x4a4458,_0x184eee){if(_0x4a4458[_0xc232('0x52')]['id']){delete _0x4a4458[_0xc232('0x52')]['id'];}return db[_0xc232('0x35')]['find']({'where':{'id':_0x4a4458['params']['id']}})[_0xc232('0x1e')](handleEntityNotFound(_0x184eee,null))[_0xc232('0x1e')](saveUpdates(_0x4a4458[_0xc232('0x52')],null))[_0xc232('0x1e')](respondWithResult(_0x184eee,null))[_0xc232('0x25')](handleError(_0x184eee,null));};exports['destroy']=function(_0x52dc8c,_0x44f5e6){return db[_0xc232('0x35')][_0xc232('0x50')]({'where':{'id':_0x52dc8c[_0xc232('0x4d')]['id']}})[_0xc232('0x1e')](handleEntityNotFound(_0x44f5e6,null))['then'](removeEntity(_0x44f5e6,null))['catch'](handleError(_0x44f5e6,null));};exports['describe']=function(_0x417bb4,_0x3a865d){return db['ChatMessage']['describe']()[_0xc232('0x1e')](respondWithResult(_0x3a865d,null))[_0xc232('0x25')](handleError(_0x3a865d,null));};var interaction_log=require(_0xc232('0x13'))(_0xc232('0x53'));exports[_0xc232('0x54')]=function(_0x28fe21,_0x3239e5,_0x35f735){var _0x11f9d6={'channel':_0xc232('0x55')};if(_0x28fe21[_0xc232('0x52')]['id']){delete _0x28fe21['body']['id'];}_0x28fe21[_0xc232('0x52')][_0xc232('0x56')]=!![];_0x28fe21[_0xc232('0x52')][_0xc232('0x57')]=moment()['format'](_0xc232('0x58'));_0x28fe21[_0xc232('0x52')][_0xc232('0x59')]=_0x28fe21['body']['UserId']||_0x28fe21['user']['id'];return db[_0xc232('0x35')][_0xc232('0x50')]({'where':{'id':_0x28fe21[_0xc232('0x4d')]['id'],'UserId':null},'include':[{'model':db[_0xc232('0x5a')],'as':'Contact'}]})[_0xc232('0x1e')](handleEntityNotFound(_0x3239e5,null))[_0xc232('0x1e')](saveUpdates(_0x28fe21[_0xc232('0x52')],null))[_0xc232('0x1e')](function(_0x528acd){if(_0x528acd){_0x11f9d6[_0xc232('0x24')]=_0x528acd[_0xc232('0x5b')]({'plain':!![]});return db[_0xc232('0x5c')][_0xc232('0x50')]({'where':{'id':_0x528acd['ChatInteractionId']}});}return null;})[_0xc232('0x1e')](handleEntityNotFound(_0x3239e5,null))[_0xc232('0x1e')](function(_0x16710c){if(_0x16710c){return _0x16710c['update']({'UserId':_0x28fe21[_0xc232('0x52')][_0xc232('0x59')],'read1stAt':_[_0xc232('0x5d')](_0x16710c[_0xc232('0x5e')])?moment()[_0xc232('0x5f')](_0xc232('0x58')):undefined});}return null;})[_0xc232('0x1e')](function(_0x77093a){if(_0x77093a){_0x11f9d6[_0xc232('0x60')]=_0x77093a[_0xc232('0x5b')]({'plain':!![]});interaction_log[_0xc232('0x61')](_0xc232('0x62'),_0x28fe21[_0xc232('0x63')]['id'],_0x28fe21['user'][_0xc232('0x33')],_0x28fe21[_0xc232('0x63')][_0xc232('0x64')],_0x11f9d6['interaction']['id'],_0x28fe21[_0xc232('0x52')]?JSON[_0xc232('0x65')](_0x28fe21[_0xc232('0x52')]):_0xc232('0x66'));return respondWithRpcPromise(_0xc232('0x67'),_0xc232('0x68'),_0x11f9d6);}return null;})[_0xc232('0x1e')](function(_0x412017){if(_0x412017){if(_0x28fe21[_0xc232('0x52')][_0xc232('0x69')]){_0x11f9d6['message'][_0xc232('0x6a')]=util[_0xc232('0x5f')](_0xc232('0x6b'),_0x28fe21[_0xc232('0x63')]['name']);_0x11f9d6['message'][_0xc232('0x6c')]=_0x11f9d6['channel'];_0x11f9d6['message'][_0xc232('0x6d')]=_0xc232('0x54');return respondWithRpcPromise('EventManager',_0xc232('0x6e'),{'event':_0xc232('0x6f'),'message':_['merge'](_0x11f9d6[_0xc232('0x24')],JSON['parse'](_0x11f9d6['interaction'][_0xc232('0x70')]))},client9002)[_0xc232('0x1e')](function(){return _0x11f9d6;});}return _0x11f9d6;}return null;})['then'](respondWithResult(_0x3239e5,null))[_0xc232('0x25')](handleError(_0x3239e5,null));};var interaction_log=require(_0xc232('0x13'))(_0xc232('0x53'));exports[_0xc232('0x2f')]=function(_0x28ea43,_0x146402,_0x4a9ebc){var _0x1b14f4={'agent':{},'channel':'chat'};if(_0x28ea43[_0xc232('0x52')]['id']){delete _0x28ea43[_0xc232('0x52')]['id'];}_0x28ea43[_0xc232('0x52')][_0xc232('0x59')]=_0x28ea43[_0xc232('0x52')][_0xc232('0x59')]||_0x28ea43['user']['id'];_0x1b14f4['agent']['id']=_0x28ea43[_0xc232('0x52')][_0xc232('0x59')];return db[_0xc232('0x35')]['find']({'where':{'id':_0x28ea43[_0xc232('0x4d')]['id'],'UserId':null}})[_0xc232('0x1e')](handleEntityNotFound(_0x146402,null))[_0xc232('0x1e')](function(_0x34fa68){if(_0x34fa68){_0x1b14f4[_0xc232('0x24')]=_0x34fa68[_0xc232('0x5b')]({'plain':!![]});return db['ChatInteraction'][_0xc232('0x50')]({'where':{'id':_0x34fa68[_0xc232('0x71')]}});}return null;})[_0xc232('0x1e')](handleEntityNotFound(_0x146402,null))[_0xc232('0x1e')](function(_0x1bce74){if(_0x1bce74){_0x1b14f4[_0xc232('0x60')]=_0x1bce74['get']({'plain':!![]});interaction_log[_0xc232('0x61')](_0xc232('0x72'),_0x28ea43[_0xc232('0x63')]['id'],_0x28ea43['user'][_0xc232('0x33')],_0x28ea43[_0xc232('0x63')][_0xc232('0x64')],_0x1b14f4[_0xc232('0x60')]['id'],_0x28ea43[_0xc232('0x52')]?JSON['stringify'](_0x28ea43[_0xc232('0x52')]):_0xc232('0x66'));return respondWithRpcPromise(_0xc232('0x73'),_0xc232('0x74'),_0x1b14f4);}return null;})[_0xc232('0x1e')](function(_0x1e3164){if(_0x1e3164){_0x1e3164[_0xc232('0x24')]['interface']=util['format'](_0xc232('0x6b'),_0x28ea43['user']['name']);_0x1e3164['message']['channel']=_0x1b14f4[_0xc232('0x6c')];_0x1e3164['message'][_0xc232('0x6d')]=_0xc232('0x2f');respondWithRpcPromise('EventManager',_0xc232('0x6e'),{'event':_0xc232('0x75'),'message':_0x1e3164[_0xc232('0x24')]},client9002);return _0x1b14f4;}return null;})[_0xc232('0x1e')](respondWithResult(_0x146402,null))[_0xc232('0x25')](handleError(_0x146402,null));}; \ No newline at end of file +var _0x2b2b=['include','options','create','body','find','describe','accept','chat','format','UserId','get','ChatInteraction','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','user','role','null','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','formData','agent','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','jayson/promise','http','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','ChatMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','type','VIRTUAL','field','filter','includeAll','findAll','rows','params'];(function(_0x10252f,_0x39df52){var _0x5962df=function(_0x22d492){while(--_0x22d492){_0x10252f['push'](_0x10252f['shift']());}};_0x5962df(++_0x39df52);}(_0x2b2b,0x96));var _0xb2b2=function(_0x4b9237,_0x371743){_0x4b9237=_0x4b9237-0x0;var _0x335e7e=_0x2b2b[_0x4b9237];return _0x335e7e;};'use strict';var pdf=require(_0xb2b2('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb2b2('0x1'));var jsonpatch=require(_0xb2b2('0x2'));var rp=require('request-promise');var moment=require(_0xb2b2('0x3'));var BPromise=require(_0xb2b2('0x4'));var Mustache=require(_0xb2b2('0x5'));var util=require(_0xb2b2('0x6'));var path=require('path');var sox=require(_0xb2b2('0x7'));var csv=require(_0xb2b2('0x8'));var ejs=require(_0xb2b2('0x9'));var fs=require('fs');var _=require(_0xb2b2('0xa'));var squel=require('squel');var crypto=require(_0xb2b2('0xb'));var jsforce=require(_0xb2b2('0xc'));var deskjs=require(_0xb2b2('0xd'));var toCsv=require(_0xb2b2('0x8'));var querystring=require(_0xb2b2('0xe'));var Papa=require(_0xb2b2('0xf'));var Redis=require(_0xb2b2('0x10'));var authService=require(_0xb2b2('0x11'));var qs=require(_0xb2b2('0x12'));var hardwareService=require(_0xb2b2('0x13'));var logger=require(_0xb2b2('0x14'))(_0xb2b2('0x15'));var utils=require(_0xb2b2('0x16'));var config=require(_0xb2b2('0x17'));var db=require(_0xb2b2('0x18'))['db'];config[_0xb2b2('0x19')]=_['defaults'](config['redis'],{'host':_0xb2b2('0x1a'),'port':0x18eb});var socket=require(_0xb2b2('0x1b'))(new Redis(config[_0xb2b2('0x19')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0xb2b2('0x1c'));var client=jayson['client'][_0xb2b2('0x1d')]({'port':0x232c});var client9002=jayson[_0xb2b2('0x1e')][_0xb2b2('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x501584,_0x808d7d,_0x1917ac){if(_0x1917ac){var _0x32b7c2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x32b7c2[_0xb2b2('0x1f')](_0x808d7d)){return _0x501584;}else{throw new Error(_0xb2b2('0x20'));}}else{return _0x501584;}}function respondWithRpcPromise(_0x3dcada,_0x4f9e46,_0x22ea1c,_0x71457a){return new BPromise(function(_0x4290f8,_0x1b2b79){var _0x3ef5a6=_0x71457a||client;return _0x3ef5a6[_0xb2b2('0x21')](_0x3dcada,_0x22ea1c)['then'](function(_0x33efbd){logger[_0xb2b2('0x22')]('ChatMessage,\x20%s,\x20%s',_0x4f9e46,_0xb2b2('0x23'));logger[_0xb2b2('0x24')](_0xb2b2('0x25'),_0x4f9e46,_0xb2b2('0x23'),JSON[_0xb2b2('0x26')](_0x33efbd));if(_0x33efbd[_0xb2b2('0x27')]){if(_0x33efbd[_0xb2b2('0x27')]['code']===0x1f4){logger['error'](_0xb2b2('0x28'),_0x4f9e46,_0x33efbd[_0xb2b2('0x27')][_0xb2b2('0x29')]);return _0x1b2b79(_0x33efbd[_0xb2b2('0x27')]['message']);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x4f9e46,_0x33efbd[_0xb2b2('0x27')][_0xb2b2('0x29')]);return _0x4290f8(_0x33efbd[_0xb2b2('0x27')]['message']);}else{logger[_0xb2b2('0x22')](_0xb2b2('0x28'),_0x4f9e46,_0xb2b2('0x23'));_0x4290f8(_0x33efbd[_0xb2b2('0x2a')]['message']);}})[_0xb2b2('0x2b')](function(_0x1c74a1){logger['error'](_0xb2b2('0x28'),_0x4f9e46,_0x1c74a1);_0x1b2b79(_0x1c74a1);});});}function respondWithStatusCode(_0x3a330f,_0x4407ed){_0x4407ed=_0x4407ed||0xcc;return function(_0x4b6172){if(_0x4b6172){return _0x3a330f[_0xb2b2('0x2c')](_0x4407ed);}return _0x3a330f['status'](_0x4407ed)[_0xb2b2('0x2d')]();};}function respondWithResult(_0x458a8a,_0x2c4e63){_0x2c4e63=_0x2c4e63||0xc8;return function(_0x19c651){if(_0x19c651){return _0x458a8a[_0xb2b2('0x2e')](_0x2c4e63)[_0xb2b2('0x2f')](_0x19c651);}};}function respondWithFilteredResult(_0x3c6ded,_0x339c6b){return function(_0x1b1407){if(_0x1b1407){var _0x309c99=_0x1b1407[_0xb2b2('0x30')],_0x553289=_0x339c6b[_0xb2b2('0x31')],_0x16b851=_0x339c6b[_0xb2b2('0x31')]+_0x339c6b[_0xb2b2('0x32')],_0x457b01;if(_0x16b851>=_0x309c99){_0x16b851=_0x309c99;_0x457b01=0xc8;}else{_0x457b01=0xce;}_0x3c6ded['status'](_0x457b01);return _0x3c6ded['set'](_0xb2b2('0x33'),_0x553289+'-'+_0x16b851+'/'+_0x309c99)[_0xb2b2('0x2f')](_0x1b1407);}return null;};}function patchUpdates(_0x1015c1){return function(_0x3dd6d6){try{jsonpatch[_0xb2b2('0x34')](_0x3dd6d6,_0x1015c1,!![]);}catch(_0x21a654){return BPromise[_0xb2b2('0x35')](_0x21a654);}return _0x3dd6d6[_0xb2b2('0x36')]();};}function saveUpdates(_0x5cd074,_0x26518){return function(_0x3dc8fb){if(_0x3dc8fb){return _0x3dc8fb[_0xb2b2('0x37')](_0x5cd074)[_0xb2b2('0x38')](function(_0x258914){return _0x258914;});}return null;};}function removeEntity(_0x1714e4,_0x1d81e6){return function(_0x3a7ede){if(_0x3a7ede){return _0x3a7ede[_0xb2b2('0x39')]()[_0xb2b2('0x38')](function(){_0x1714e4['status'](0xcc)[_0xb2b2('0x2d')]();});}};}function handleEntityNotFound(_0x50aeb6,_0x68b832){return function(_0xcaf864){if(!_0xcaf864){_0x50aeb6[_0xb2b2('0x2c')](0x194);}return _0xcaf864;};}function handleError(_0x4a5e92,_0x3322f4){_0x3322f4=_0x3322f4||0x1f4;return function(_0xc9fe00){logger[_0xb2b2('0x27')](_0xc9fe00[_0xb2b2('0x3a')]);if(_0xc9fe00[_0xb2b2('0x3b')]){delete _0xc9fe00[_0xb2b2('0x3b')];}_0x4a5e92['status'](_0x3322f4)[_0xb2b2('0x3c')](_0xc9fe00);};}exports['index']=function(_0x2f16eb,_0x1b10fb){var _0x406d3e={},_0x2eaf90={},_0x22beb2={'count':0x0,'rows':[]};var _0x166d1e=db[_0xb2b2('0x3d')][_0xb2b2('0x3e')];_0x2eaf90[_0xb2b2('0x3f')]=_[_0xb2b2('0x40')](_0x166d1e);_0x2eaf90[_0xb2b2('0x41')]=_['keys'](_0x2f16eb[_0xb2b2('0x41')]);_0x2eaf90[_0xb2b2('0x42')]=_[_0xb2b2('0x43')](_0x2eaf90[_0xb2b2('0x3f')],_0x2eaf90['query']);_0x406d3e[_0xb2b2('0x44')]=_[_0xb2b2('0x43')](_0x2eaf90[_0xb2b2('0x3f')],qs[_0xb2b2('0x45')](_0x2f16eb[_0xb2b2('0x41')][_0xb2b2('0x45')]));_0x406d3e['attributes']=_0x406d3e[_0xb2b2('0x44')][_0xb2b2('0x46')]?_0x406d3e['attributes']:_0x2eaf90[_0xb2b2('0x3f')];if(!_0x2f16eb[_0xb2b2('0x41')][_0xb2b2('0x47')]('nolimit')){_0x406d3e[_0xb2b2('0x32')]=qs[_0xb2b2('0x32')](_0x2f16eb['query'][_0xb2b2('0x32')]);_0x406d3e[_0xb2b2('0x31')]=qs['offset'](_0x2f16eb[_0xb2b2('0x41')][_0xb2b2('0x31')]);}_0x406d3e[_0xb2b2('0x48')]=qs[_0xb2b2('0x49')](_0x2f16eb['query']['sort']);_0x406d3e[_0xb2b2('0x4a')]=qs['filters'](_[_0xb2b2('0x4b')](_0x2f16eb['query'],_0x2eaf90['filters']));if(_0x2f16eb['query']['filter']){_0x406d3e[_0xb2b2('0x4a')]=_[_0xb2b2('0x4c')](_0x406d3e[_0xb2b2('0x4a')],{'$or':_[_0xb2b2('0x4d')](_0x166d1e,function(_0xfd9ae7){if(_0xfd9ae7[_0xb2b2('0x4e')]['key']!==_0xb2b2('0x4f')){var _0x3a11b4={};_0x3a11b4[_0xfd9ae7[_0xb2b2('0x50')]]={'$like':'%'+_0x2f16eb[_0xb2b2('0x41')][_0xb2b2('0x51')]+'%'};return _0x3a11b4;}})});}_0x406d3e=_[_0xb2b2('0x4c')]({},_0x406d3e,_0x2f16eb['options']);var _0x3eac2e={'where':_0x406d3e['where']};return db[_0xb2b2('0x3d')][_0xb2b2('0x30')](_0x3eac2e)[_0xb2b2('0x38')](function(_0x66f52f){_0x22beb2[_0xb2b2('0x30')]=_0x66f52f;if(_0x2f16eb[_0xb2b2('0x41')][_0xb2b2('0x52')]){_0x406d3e['include']=[{'all':!![]}];}return db[_0xb2b2('0x3d')][_0xb2b2('0x53')](_0x406d3e);})[_0xb2b2('0x38')](function(_0x14cc89){_0x22beb2[_0xb2b2('0x54')]=_0x14cc89;return _0x22beb2;})[_0xb2b2('0x38')](respondWithFilteredResult(_0x1b10fb,_0x406d3e))[_0xb2b2('0x2b')](handleError(_0x1b10fb,null));};exports['show']=function(_0x575cb6,_0x875775){var _0x592bf7={'raw':!![],'where':{'id':_0x575cb6[_0xb2b2('0x55')]['id']}},_0x25bd8a={};_0x25bd8a[_0xb2b2('0x3f')]=_[_0xb2b2('0x40')](db[_0xb2b2('0x3d')][_0xb2b2('0x3e')]);_0x25bd8a[_0xb2b2('0x41')]=_[_0xb2b2('0x40')](_0x575cb6[_0xb2b2('0x41')]);_0x25bd8a[_0xb2b2('0x42')]=_['intersection'](_0x25bd8a['model'],_0x25bd8a[_0xb2b2('0x41')]);_0x592bf7[_0xb2b2('0x44')]=_['intersection'](_0x25bd8a[_0xb2b2('0x3f')],qs[_0xb2b2('0x45')](_0x575cb6['query']['fields']));_0x592bf7[_0xb2b2('0x44')]=_0x592bf7[_0xb2b2('0x44')]['length']?_0x592bf7[_0xb2b2('0x44')]:_0x25bd8a['model'];if(_0x575cb6[_0xb2b2('0x41')][_0xb2b2('0x52')]){_0x592bf7[_0xb2b2('0x56')]=[{'all':!![]}];}_0x592bf7=_[_0xb2b2('0x4c')]({},_0x592bf7,_0x575cb6[_0xb2b2('0x57')]);return db['ChatMessage']['find'](_0x592bf7)[_0xb2b2('0x38')](handleEntityNotFound(_0x875775,null))[_0xb2b2('0x38')](respondWithResult(_0x875775,null))[_0xb2b2('0x2b')](handleError(_0x875775,null));};exports['create']=function(_0x2a0965,_0xeb359b){return db['ChatMessage'][_0xb2b2('0x58')](_0x2a0965[_0xb2b2('0x59')],{})[_0xb2b2('0x38')](respondWithResult(_0xeb359b,0xc9))[_0xb2b2('0x2b')](handleError(_0xeb359b,null));};exports['update']=function(_0x2c68f7,_0x203dfe){if(_0x2c68f7['body']['id']){delete _0x2c68f7['body']['id'];}return db[_0xb2b2('0x3d')][_0xb2b2('0x5a')]({'where':{'id':_0x2c68f7['params']['id']}})['then'](handleEntityNotFound(_0x203dfe,null))[_0xb2b2('0x38')](saveUpdates(_0x2c68f7[_0xb2b2('0x59')],null))[_0xb2b2('0x38')](respondWithResult(_0x203dfe,null))[_0xb2b2('0x2b')](handleError(_0x203dfe,null));};exports['destroy']=function(_0x36b66a,_0xe21046){return db[_0xb2b2('0x3d')][_0xb2b2('0x5a')]({'where':{'id':_0x36b66a[_0xb2b2('0x55')]['id']}})[_0xb2b2('0x38')](handleEntityNotFound(_0xe21046,null))[_0xb2b2('0x38')](removeEntity(_0xe21046,null))[_0xb2b2('0x2b')](handleError(_0xe21046,null));};exports[_0xb2b2('0x5b')]=function(_0x3941b4,_0x273e0e){return db[_0xb2b2('0x3d')][_0xb2b2('0x5b')]()[_0xb2b2('0x38')](respondWithResult(_0x273e0e,null))[_0xb2b2('0x2b')](handleError(_0x273e0e,null));};var interaction_log=require(_0xb2b2('0x14'))('chat-interactions');exports[_0xb2b2('0x5c')]=function(_0x3a48e6,_0x4c3935,_0x1d6cf0){var _0x11e719={'channel':_0xb2b2('0x5d')};if(_0x3a48e6['body']['id']){delete _0x3a48e6[_0xb2b2('0x59')]['id'];}_0x3a48e6[_0xb2b2('0x59')]['read']=!![];_0x3a48e6[_0xb2b2('0x59')]['readAt']=moment()[_0xb2b2('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x3a48e6['body']['UserId']=_0x3a48e6[_0xb2b2('0x59')][_0xb2b2('0x5f')]||_0x3a48e6['user']['id'];return db[_0xb2b2('0x3d')]['find']({'where':{'id':_0x3a48e6[_0xb2b2('0x55')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xb2b2('0x38')](handleEntityNotFound(_0x4c3935,null))['then'](saveUpdates(_0x3a48e6[_0xb2b2('0x59')],null))[_0xb2b2('0x38')](function(_0x207a93){if(_0x207a93){_0x11e719[_0xb2b2('0x29')]=_0x207a93[_0xb2b2('0x60')]({'plain':!![]});return db[_0xb2b2('0x61')][_0xb2b2('0x5a')]({'where':{'id':_0x207a93['ChatInteractionId']}});}return null;})[_0xb2b2('0x38')](handleEntityNotFound(_0x4c3935,null))[_0xb2b2('0x38')](function(_0x2d083c){if(_0x2d083c){return _0x2d083c['update']({'UserId':_0x3a48e6[_0xb2b2('0x59')][_0xb2b2('0x5f')],'read1stAt':_[_0xb2b2('0x62')](_0x2d083c['read1stAt'])?moment()[_0xb2b2('0x5e')](_0xb2b2('0x63')):undefined});}return null;})['then'](function(_0x4c7231){if(_0x4c7231){_0x11e719[_0xb2b2('0x64')]=_0x4c7231[_0xb2b2('0x60')]({'plain':!![]});interaction_log[_0xb2b2('0x22')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3a48e6[_0xb2b2('0x65')]['id'],_0x3a48e6[_0xb2b2('0x65')]['name'],_0x3a48e6[_0xb2b2('0x65')][_0xb2b2('0x66')],_0x11e719[_0xb2b2('0x64')]['id'],_0x3a48e6[_0xb2b2('0x59')]?JSON[_0xb2b2('0x26')](_0x3a48e6[_0xb2b2('0x59')]):_0xb2b2('0x67'));return respondWithRpcPromise('AcceptMessage',_0xb2b2('0x68'),_0x11e719);}return null;})['then'](function(_0x5c59c0){if(_0x5c59c0){if(_0x3a48e6['body'][_0xb2b2('0x69')]){_0x11e719[_0xb2b2('0x29')][_0xb2b2('0x6a')]=util[_0xb2b2('0x5e')](_0xb2b2('0x6b'),_0x3a48e6['user'][_0xb2b2('0x3b')]);_0x11e719[_0xb2b2('0x29')]['channel']=_0x11e719[_0xb2b2('0x6c')];_0x11e719[_0xb2b2('0x29')][_0xb2b2('0x6d')]=_0xb2b2('0x5c');return respondWithRpcPromise(_0xb2b2('0x6e'),_0xb2b2('0x6e'),{'event':_0xb2b2('0x6f'),'message':_[_0xb2b2('0x4c')](_0x11e719['message'],JSON['parse'](_0x11e719[_0xb2b2('0x64')][_0xb2b2('0x70')]))},client9002)[_0xb2b2('0x38')](function(){return _0x11e719;});}return _0x11e719;}return null;})['then'](respondWithResult(_0x4c3935,null))[_0xb2b2('0x2b')](handleError(_0x4c3935,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0xb2b2('0x35')]=function(_0x389176,_0x24f8fe,_0x48201b){var _0x223b43={'agent':{},'channel':_0xb2b2('0x5d')};if(_0x389176[_0xb2b2('0x59')]['id']){delete _0x389176[_0xb2b2('0x59')]['id'];}_0x389176[_0xb2b2('0x59')][_0xb2b2('0x5f')]=_0x389176['body'][_0xb2b2('0x5f')]||_0x389176[_0xb2b2('0x65')]['id'];_0x223b43[_0xb2b2('0x71')]['id']=_0x389176[_0xb2b2('0x59')][_0xb2b2('0x5f')];return db[_0xb2b2('0x3d')][_0xb2b2('0x5a')]({'where':{'id':_0x389176[_0xb2b2('0x55')]['id'],'UserId':null}})[_0xb2b2('0x38')](handleEntityNotFound(_0x24f8fe,null))[_0xb2b2('0x38')](function(_0x2d6ee5){if(_0x2d6ee5){_0x223b43[_0xb2b2('0x29')]=_0x2d6ee5[_0xb2b2('0x60')]({'plain':!![]});return db[_0xb2b2('0x61')][_0xb2b2('0x5a')]({'where':{'id':_0x2d6ee5[_0xb2b2('0x72')]}});}return null;})[_0xb2b2('0x38')](handleEntityNotFound(_0x24f8fe,null))[_0xb2b2('0x38')](function(_0x356cac){if(_0x356cac){_0x223b43[_0xb2b2('0x64')]=_0x356cac['get']({'plain':!![]});interaction_log['info'](_0xb2b2('0x73'),_0x389176['user']['id'],_0x389176[_0xb2b2('0x65')][_0xb2b2('0x3b')],_0x389176[_0xb2b2('0x65')][_0xb2b2('0x66')],_0x223b43[_0xb2b2('0x64')]['id'],_0x389176['body']?JSON[_0xb2b2('0x26')](_0x389176[_0xb2b2('0x59')]):_0xb2b2('0x67'));return respondWithRpcPromise(_0xb2b2('0x74'),'rejectMessage',_0x223b43);}return null;})[_0xb2b2('0x38')](function(_0x1f916d){if(_0x1f916d){_0x1f916d['message'][_0xb2b2('0x6a')]=util[_0xb2b2('0x5e')](_0xb2b2('0x6b'),_0x389176[_0xb2b2('0x65')][_0xb2b2('0x3b')]);_0x1f916d[_0xb2b2('0x29')][_0xb2b2('0x6c')]=_0x223b43[_0xb2b2('0x6c')];_0x1f916d[_0xb2b2('0x29')][_0xb2b2('0x6d')]=_0xb2b2('0x35');respondWithRpcPromise('EventManager',_0xb2b2('0x6e'),{'event':_0xb2b2('0x75'),'message':_0x1f916d[_0xb2b2('0x29')]},client9002);return _0x223b43;}return null;})[_0xb2b2('0x38')](respondWithResult(_0x24f8fe,null))[_0xb2b2('0x2b')](handleError(_0x24f8fe,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 74a7504..ed8ec0b 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 _0x4123=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit'];(function(_0x5528c3,_0x35a416){var _0x47ec1b=function(_0x54a18e){while(--_0x54a18e){_0x5528c3['push'](_0x5528c3['shift']());}};_0x47ec1b(++_0x35a416);}(_0x4123,0x87));var _0x3412=function(_0x3f6c27,_0x47ef96){_0x3f6c27=_0x3f6c27-0x0;var _0xfc6c2c=_0x4123[_0x3f6c27];return _0xfc6c2c;};'use strict';var EventEmitter=require(_0x3412('0x0'));var ChatMessage=require(_0x3412('0x1'))['db'][_0x3412('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3412('0x3')](0x0);var events={'afterCreate':_0x3412('0x4'),'afterUpdate':_0x3412('0x5'),'afterDestroy':_0x3412('0x6')};function emitEvent(_0x1821bd){return function(_0x5d17b8,_0x4787e0,_0x1f41d9){ChatMessageEvents[_0x3412('0x7')](_0x1821bd+':'+_0x5d17b8['id'],_0x5d17b8);ChatMessageEvents['emit'](_0x1821bd,_0x5d17b8);_0x1f41d9(null);};}for(var e in events){if(events[_0x3412('0x8')](e)){var event=events[e];ChatMessage[_0x3412('0x9')](e,emitEvent(event));}}module[_0x3412('0xa')]=ChatMessageEvents; \ No newline at end of file +var _0x86dc=['save','update','remove','emit','hasOwnProperty','hook','events','setMaxListeners'];(function(_0x448e12,_0x3dd593){var _0x3a178d=function(_0x16cfbf){while(--_0x16cfbf){_0x448e12['push'](_0x448e12['shift']());}};_0x3a178d(++_0x3dd593);}(_0x86dc,0x13e));var _0xc86d=function(_0x353b02,_0x429fe6){_0x353b02=_0x353b02-0x0;var _0x4220a6=_0x86dc[_0x353b02];return _0x4220a6;};'use strict';var EventEmitter=require(_0xc86d('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xc86d('0x1')](0x0);var events={'afterCreate':_0xc86d('0x2'),'afterUpdate':_0xc86d('0x3'),'afterDestroy':_0xc86d('0x4')};function emitEvent(_0x4ee770){return function(_0x3a4383,_0x496d00,_0x271eb1){ChatMessageEvents['emit'](_0x4ee770+':'+_0x3a4383['id'],_0x3a4383);ChatMessageEvents[_0xc86d('0x5')](_0x4ee770,_0x3a4383);_0x271eb1(null);};}for(var e in events){if(events[_0xc86d('0x6')](e)){var event=events[e];ChatMessage[_0xc86d('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 64d8f0a..9af82bd 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 _0x0f39=['fti_chat_messages','FULLTEXT','get','direction','toLowerCase','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage'];(function(_0x51e875,_0x2ce359){var _0x4478bb=function(_0x2d1b8b){while(--_0x2d1b8b){_0x51e875['push'](_0x51e875['shift']());}};_0x4478bb(++_0x2ce359);}(_0x0f39,0x143));var _0x90f3=function(_0x2e00e4,_0x5eb164){_0x2e00e4=_0x2e00e4-0x0;var _0x10cf0e=_0x0f39[_0x2e00e4];return _0x10cf0e;};'use strict';var _=require(_0x90f3('0x0'));var util=require(_0x90f3('0x1'));var logger=require(_0x90f3('0x2'))(_0x90f3('0x3'));var moment=require(_0x90f3('0x4'));var BPromise=require('bluebird');var rp=require(_0x90f3('0x5'));var fs=require('fs');var path=require(_0x90f3('0x6'));var rimraf=require(_0x90f3('0x7'));var config=require(_0x90f3('0x8'));var attributes=require(_0x90f3('0x9'));module[_0x90f3('0xa')]=function(_0x31b7a0,_0x3fb185){return _0x31b7a0[_0x90f3('0xb')](_0x90f3('0xc'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x90f3('0xd'),'fields':['body'],'type':_0x90f3('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x39d5c0,_0x58d392,_0x40013f){var _0x131b09=_0x31b7a0['models'];var _0x493f3b=_0x39d5c0[_0x90f3('0xf')]({'plain':!![]});if(_0x493f3b['direction']['toLowerCase']()==='in'||_0x493f3b[_0x90f3('0x10')][_0x90f3('0x11')]()==='out'&&!_0x493f3b['secret']&&!_[_0x90f3('0x12')](_0x493f3b[_0x90f3('0x13')])){_0x131b09[_0x90f3('0x14')][_0x90f3('0x15')]({'where':{'id':_0x493f3b[_0x90f3('0x16')]}})[_0x90f3('0x17')](function(_0x14557a){if(_0x14557a){_0x14557a['update']({'lastMsgAt':_0x493f3b['createdAt'],'lastMsgDirection':_0x493f3b[_0x90f3('0x10')][_0x90f3('0x11')]()});}})[_0x90f3('0x18')](function(_0x251dc1){console[_0x90f3('0x19')](_0x251dc1);});}_0x40013f();}},'charset':_0x90f3('0x1a'),'collate':_0x90f3('0x1b')});}; \ No newline at end of file +var _0x2502=['ChatInteraction','findOne','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','../../config/environment','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','UserId'];(function(_0x802234,_0x1ce298){var _0xaf1854=function(_0x36fb62){while(--_0x36fb62){_0x802234['push'](_0x802234['shift']());}};_0xaf1854(++_0x1ce298);}(_0x2502,0x7f));var _0x2250=function(_0x54516a,_0x1ebf07){_0x54516a=_0x54516a-0x0;var _0x302520=_0x2502[_0x54516a];return _0x302520;};'use strict';var _=require(_0x2250('0x0'));var util=require(_0x2250('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2250('0x2'));var BPromise=require(_0x2250('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2250('0x4'));var attributes=require(_0x2250('0x5'));module[_0x2250('0x6')]=function(_0x2ba810,_0x2a29f2){return _0x2ba810['define'](_0x2250('0x7'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x2250('0x8'),'fields':[_0x2250('0x9')],'type':_0x2250('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1fa47b,_0x5e8431,_0x4cdf2e){var _0x50d734=_0x2ba810[_0x2250('0xb')];var _0x4567d3=_0x1fa47b[_0x2250('0xc')]({'plain':!![]});if(_0x4567d3['direction']['toLowerCase']()==='in'||_0x4567d3[_0x2250('0xd')][_0x2250('0xe')]()===_0x2250('0xf')&&!_0x4567d3['secret']&&!_['isNil'](_0x4567d3[_0x2250('0x10')])){_0x50d734[_0x2250('0x11')][_0x2250('0x12')]({'where':{'id':_0x4567d3['ChatInteractionId']}})['then'](function(_0x1738e5){if(_0x1738e5){_0x1738e5[_0x2250('0x13')]({'lastMsgAt':_0x4567d3[_0x2250('0x14')],'lastMsgDirection':_0x4567d3[_0x2250('0xd')][_0x2250('0xe')]()});}})['catch'](function(_0x587408){console[_0x2250('0x15')](_0x587408);});}_0x4cdf2e();}},'charset':_0x2250('0x16'),'collate':_0x2250('0x17')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 25170e3..9810688 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 _0x35ab=['error','code','message','catch','ChatMessage','create','body','options','raw','CreateChatMessage','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x674bb2,_0xf21d79){var _0x3d7c38=function(_0xd1fbf2){while(--_0xd1fbf2){_0x674bb2['push'](_0x674bb2['shift']());}};_0x3d7c38(++_0xf21d79);}(_0x35ab,0x1f4));var _0xb35a=function(_0x417ea3,_0x156e87){_0x417ea3=_0x417ea3-0x0;var _0x18c29d=_0x35ab[_0x417ea3];return _0x18c29d;};'use strict';var _=require(_0xb35a('0x0'));var util=require(_0xb35a('0x1'));var moment=require(_0xb35a('0x2'));var BPromise=require(_0xb35a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb35a('0x4'));var db=require(_0xb35a('0x5'))['db'];var utils=require(_0xb35a('0x6'));var logger=require(_0xb35a('0x7'))(_0xb35a('0x8'));var config=require('../../config/environment');var jayson=require(_0xb35a('0x9'));var client=jayson[_0xb35a('0xa')][_0xb35a('0xb')]({'port':0x232a});config[_0xb35a('0xc')]=_[_0xb35a('0xd')](config[_0xb35a('0xc')],{'host':_0xb35a('0xe'),'port':0x18eb});var socket=require(_0xb35a('0xf'))(new Redis(config['redis']));require('./chatMessage.socket')[_0xb35a('0x10')](socket);function respondWithRpcPromise(_0x290e38,_0x544922,_0x1fc8ee){return new BPromise(function(_0x1c2849,_0x3cd108){return client[_0xb35a('0x11')](_0x290e38,_0x1fc8ee)[_0xb35a('0x12')](function(_0xa52668){logger[_0xb35a('0x13')](_0xb35a('0x14'),_0x544922,_0xb35a('0x15'));logger[_0xb35a('0x16')](_0xb35a('0x17'),_0x544922,_0xb35a('0x15'),JSON[_0xb35a('0x18')](_0xa52668));if(_0xa52668['error']){if(_0xa52668[_0xb35a('0x19')][_0xb35a('0x1a')]===0x1f4){logger[_0xb35a('0x19')](_0xb35a('0x14'),_0x544922,_0xa52668['error'][_0xb35a('0x1b')]);return _0x3cd108(_0xa52668['error'][_0xb35a('0x1b')]);}logger[_0xb35a('0x19')](_0xb35a('0x14'),_0x544922,_0xa52668[_0xb35a('0x19')][_0xb35a('0x1b')]);return _0x1c2849(_0xa52668[_0xb35a('0x19')][_0xb35a('0x1b')]);}else{logger[_0xb35a('0x13')](_0xb35a('0x14'),_0x544922,_0xb35a('0x15'));_0x1c2849(_0xa52668['result']['message']);}})[_0xb35a('0x1c')](function(_0x2560d0){logger['error'](_0xb35a('0x14'),_0x544922,_0x2560d0);_0x3cd108(_0x2560d0);});});}exports['CreateChatMessage']=function(_0x48fc4f){var _0x484ba7=this;return new Promise(function(_0x2d204a,_0x4224f6){return db[_0xb35a('0x1d')][_0xb35a('0x1e')](_0x48fc4f[_0xb35a('0x1f')],{'raw':_0x48fc4f['options']?_0x48fc4f[_0xb35a('0x20')][_0xb35a('0x21')]===undefined?!![]:![]:!![]})[_0xb35a('0x12')](function(_0x52449b){logger[_0xb35a('0x13')](_0xb35a('0x22'),_0x48fc4f);logger[_0xb35a('0x16')](_0xb35a('0x22'),_0x48fc4f,JSON[_0xb35a('0x18')](_0x52449b));_0x2d204a(_0x52449b);})[_0xb35a('0x1c')](function(_0x51c5a1){logger[_0xb35a('0x19')](_0xb35a('0x22'),_0x51c5a1[_0xb35a('0x1b')],_0x48fc4f);_0x4224f6(_0x484ba7[_0xb35a('0x19')](0x1f4,_0x51c5a1[_0xb35a('0x1b')]));});});}; \ No newline at end of file +var _0x5da0=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','catch','CreateChatMessage','create','body','options','lodash','moment'];(function(_0x1d9d02,_0x5e2b92){var _0x3adfac=function(_0xe60988){while(--_0xe60988){_0x1d9d02['push'](_0x1d9d02['shift']());}};_0x3adfac(++_0x5e2b92);}(_0x5da0,0xca));var _0x05da=function(_0x5233f3,_0x594992){_0x5233f3=_0x5233f3-0x0;var _0x5afb4c=_0x5da0[_0x5233f3];return _0x5afb4c;};'use strict';var _=require(_0x05da('0x0'));var util=require('util');var moment=require(_0x05da('0x1'));var BPromise=require(_0x05da('0x2'));var rs=require(_0x05da('0x3'));var fs=require('fs');var Redis=require(_0x05da('0x4'));var db=require(_0x05da('0x5'))['db'];var utils=require(_0x05da('0x6'));var logger=require(_0x05da('0x7'))(_0x05da('0x8'));var config=require(_0x05da('0x9'));var jayson=require(_0x05da('0xa'));var client=jayson[_0x05da('0xb')][_0x05da('0xc')]({'port':0x232a});config[_0x05da('0xd')]=_[_0x05da('0xe')](config[_0x05da('0xd')],{'host':_0x05da('0xf'),'port':0x18eb});var socket=require(_0x05da('0x10'))(new Redis(config['redis']));require(_0x05da('0x11'))[_0x05da('0x12')](socket);function respondWithRpcPromise(_0x48c085,_0x568d0b,_0x57b75f){return new BPromise(function(_0x306c0b,_0x408b60){return client[_0x05da('0x13')](_0x48c085,_0x57b75f)[_0x05da('0x14')](function(_0x5ce5da){logger['info'](_0x05da('0x15'),_0x568d0b,'request\x20sent');logger[_0x05da('0x16')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x568d0b,_0x05da('0x17'),JSON['stringify'](_0x5ce5da));if(_0x5ce5da[_0x05da('0x18')]){if(_0x5ce5da[_0x05da('0x18')][_0x05da('0x19')]===0x1f4){logger[_0x05da('0x18')]('ChatMessage,\x20%s,\x20%s',_0x568d0b,_0x5ce5da['error']['message']);return _0x408b60(_0x5ce5da[_0x05da('0x18')][_0x05da('0x1a')]);}logger[_0x05da('0x18')](_0x05da('0x15'),_0x568d0b,_0x5ce5da['error'][_0x05da('0x1a')]);return _0x306c0b(_0x5ce5da[_0x05da('0x18')]['message']);}else{logger[_0x05da('0x1b')](_0x05da('0x15'),_0x568d0b,_0x05da('0x17'));_0x306c0b(_0x5ce5da[_0x05da('0x1c')][_0x05da('0x1a')]);}})[_0x05da('0x1d')](function(_0x5f2560){logger[_0x05da('0x18')](_0x05da('0x15'),_0x568d0b,_0x5f2560);_0x408b60(_0x5f2560);});});}exports[_0x05da('0x1e')]=function(_0x4fa14a){var _0x4deecb=this;return new Promise(function(_0x762e3a,_0x29f63c){return db['ChatMessage'][_0x05da('0x1f')](_0x4fa14a[_0x05da('0x20')],{'raw':_0x4fa14a['options']?_0x4fa14a[_0x05da('0x21')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x32f4d5){logger[_0x05da('0x1b')](_0x05da('0x1e'),_0x4fa14a);logger[_0x05da('0x16')](_0x05da('0x1e'),_0x4fa14a,JSON['stringify'](_0x32f4d5));_0x762e3a(_0x32f4d5);})['catch'](function(_0x513e8b){logger['error'](_0x05da('0x1e'),_0x513e8b['message'],_0x4fa14a);_0x29f63c(_0x4deecb['error'](0x1f4,_0x513e8b[_0x05da('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 758ecda..f5c4051 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 _0xedd9=['removeListener','register','length','chatMessage:','save','remove','update','emit'];(function(_0x5c6311,_0x3b5207){var _0x23886c=function(_0x12ee91){while(--_0x12ee91){_0x5c6311['push'](_0x5c6311['shift']());}};_0x23886c(++_0x3b5207);}(_0xedd9,0xfc));var _0x9edd=function(_0x11914d,_0x5230b2){_0x11914d=_0x11914d-0x0;var _0x1b213b=_0xedd9[_0x11914d];return _0x1b213b;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x9edd('0x0'),_0x9edd('0x1'),_0x9edd('0x2')];function createListener(_0x2c16b8,_0x3b51bc){return function(_0x127cbe){_0x3b51bc[_0x9edd('0x3')](_0x2c16b8,_0x127cbe);};}function removeListener(_0x36b53f,_0x5943b3){return function(){ChatMessageEvents[_0x9edd('0x4')](_0x36b53f,_0x5943b3);};}exports[_0x9edd('0x5')]=function(_0x268f9e){for(var _0x34c1a7=0x0,_0x5319f7=events[_0x9edd('0x6')];_0x34c1a7<_0x5319f7;_0x34c1a7++){var _0x571af9=events[_0x34c1a7];var _0x172522=createListener(_0x9edd('0x7')+_0x571af9,_0x268f9e);ChatMessageEvents['on'](_0x571af9,_0x172522);}}; \ No newline at end of file +var _0x3e74=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','remove','update'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x3e74,0x175));var _0x43e7=function(_0x2cbf9a,_0x51a086){_0x2cbf9a=_0x2cbf9a-0x0;var _0x3e1b78=_0x3e74[_0x2cbf9a];return _0x3e1b78;};'use strict';var ChatMessageEvents=require(_0x43e7('0x0'));var events=['save',_0x43e7('0x1'),_0x43e7('0x2')];function createListener(_0x151ad2,_0x494e45){return function(_0x490ced){_0x494e45[_0x43e7('0x3')](_0x151ad2,_0x490ced);};}function removeListener(_0x4f9bbe,_0x128b0f){return function(){ChatMessageEvents[_0x43e7('0x4')](_0x4f9bbe,_0x128b0f);};}exports[_0x43e7('0x5')]=function(_0x1c503b){for(var _0xc98b9c=0x0,_0x503698=events[_0x43e7('0x6')];_0xc98b9c<_0x503698;_0xc98b9c++){var _0x3491d6=events[_0xc98b9c];var _0x2ede2d=createListener(_0x43e7('0x7')+_0x3491d6,_0x1c503b);ChatMessageEvents['on'](_0x3491d6,_0x2ede2d);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 2a4f34b..7be5204 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 _0xd147=['tracked','chat','chatmessage:create','create','/:id','update','put','accept','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0xd147,0xec));var _0x7d14=function(_0x2ceb9c,_0x107a89){_0x2ceb9c=_0x2ceb9c-0x0;var _0x696c6b=_0xd147[_0x2ceb9c];return _0x696c6b;};'use strict';var multer=require(_0x7d14('0x0'));var util=require(_0x7d14('0x1'));var path=require(_0x7d14('0x2'));var timeout=require(_0x7d14('0x3'));var express=require(_0x7d14('0x4'));var router=express['Router']();var auth=require(_0x7d14('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7d14('0x6'));var controller=require('./chatMessage.controller');router[_0x7d14('0x7')]('/',auth[_0x7d14('0x8')](),controller[_0x7d14('0x9')]);router[_0x7d14('0x7')](_0x7d14('0xa'),auth[_0x7d14('0x8')](),controller[_0x7d14('0xb')]);router[_0x7d14('0x7')]('/:id',auth[_0x7d14('0x8')](),controller[_0x7d14('0xc')]);router[_0x7d14('0xd')]('/',auth[_0x7d14('0x8')](),interaction[_0x7d14('0xe')](_0x7d14('0xf'),_0x7d14('0x10')),controller[_0x7d14('0x11')]);router['put'](_0x7d14('0x12'),controller[_0x7d14('0x13')]);router[_0x7d14('0x14')]('/:id/accept',auth[_0x7d14('0x8')](),controller[_0x7d14('0x15')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller['reject']);router[_0x7d14('0x16')](_0x7d14('0x12'),auth['isAuthenticated'](),controller[_0x7d14('0x17')]);module[_0x7d14('0x18')]=router; \ No newline at end of file +var _0x8742=['chatmessage:create','update','accept','put','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','post','tracked'];(function(_0x576fae,_0x35c83c){var _0x2d7a7b=function(_0x24895e){while(--_0x24895e){_0x576fae['push'](_0x576fae['shift']());}};_0x2d7a7b(++_0x35c83c);}(_0x8742,0x106));var _0x2874=function(_0xe0c3c6,_0x4e19f6){_0xe0c3c6=_0xe0c3c6-0x0;var _0x25cc4a=_0x8742[_0xe0c3c6];return _0x25cc4a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2874('0x0'));var timeout=require(_0x2874('0x1'));var express=require('express');var router=express[_0x2874('0x2')]();var auth=require(_0x2874('0x3'));var interaction=require(_0x2874('0x4'));var config=require('../../config/environment');var controller=require('./chatMessage.controller');router['get']('/',auth[_0x2874('0x5')](),controller[_0x2874('0x6')]);router[_0x2874('0x7')](_0x2874('0x8'),auth[_0x2874('0x5')](),controller[_0x2874('0x9')]);router['get'](_0x2874('0xa'),auth[_0x2874('0x5')](),controller[_0x2874('0xb')]);router[_0x2874('0xc')]('/',auth[_0x2874('0x5')](),interaction[_0x2874('0xd')]('chat',_0x2874('0xe')),controller['create']);router['put']('/:id',controller[_0x2874('0xf')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0x2874('0x10')]);router[_0x2874('0x11')](_0x2874('0x12'),auth['isAuthenticated'](),controller[_0x2874('0x13')]);router[_0x2874('0x14')](_0x2874('0xa'),auth[_0x2874('0x5')](),controller[_0x2874('0x15')]);module[_0x2874('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 09c6eb3..e8b15e6 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 _0xe801=['medium','sequelize','exports','TEXT'];(function(_0x595324,_0x5c25fc){var _0x506510=function(_0x52bc6f){while(--_0x52bc6f){_0x595324['push'](_0x595324['shift']());}};_0x506510(++_0x5c25fc);}(_0xe801,0x195));var _0x1e80=function(_0xa5e1b8,_0x1f3c88){_0xa5e1b8=_0xa5e1b8-0x0;var _0x55ea8a=_0xe801[_0xa5e1b8];return _0x55ea8a;};'use strict';var Sequelize=require(_0x1e80('0x0'));module[_0x1e80('0x1')]={'body':{'type':Sequelize[_0x1e80('0x2')](_0x1e80('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0xc690=['TEXT','medium','sequelize','exports'];(function(_0x31f430,_0x1cb7e9){var _0x24ecad=function(_0x53146b){while(--_0x53146b){_0x31f430['push'](_0x31f430['shift']());}};_0x24ecad(++_0x1cb7e9);}(_0xc690,0xea));var _0x0c69=function(_0x371b12,_0x10a65a){_0x371b12=_0x371b12-0x0;var _0x4a189e=_0xc690[_0x371b12];return _0x4a189e;};'use strict';var Sequelize=require(_0x0c69('0x0'));module[_0x0c69('0x1')]={'body':{'type':Sequelize[_0x0c69('0x2')](_0x0c69('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 401a74f..cf5a393 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 _0x2504=['type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','merge','create','body','find','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','ChatOfflineMessage','rawAttributes','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where'];(function(_0x3e0b14,_0x36880b){var _0x2f234e=function(_0x3eb089){while(--_0x3eb089){_0x3e0b14['push'](_0x3e0b14['shift']());}};_0x2f234e(++_0x36880b);}(_0x2504,0xee));var _0x4250=function(_0x165b94,_0x186afb){_0x165b94=_0x165b94-0x0;var _0x2f8960=_0x2504[_0x165b94];return _0x2f8960;};'use strict';var pdf=require(_0x4250('0x0'));var emlformat=require(_0x4250('0x1'));var rimraf=require(_0x4250('0x2'));var zipdir=require(_0x4250('0x3'));var jsonpatch=require(_0x4250('0x4'));var rp=require(_0x4250('0x5'));var moment=require(_0x4250('0x6'));var BPromise=require(_0x4250('0x7'));var Mustache=require(_0x4250('0x8'));var util=require(_0x4250('0x9'));var path=require(_0x4250('0xa'));var sox=require(_0x4250('0xb'));var csv=require('to-csv');var ejs=require(_0x4250('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4250('0xd'));var jsforce=require(_0x4250('0xe'));var deskjs=require(_0x4250('0xf'));var toCsv=require(_0x4250('0x10'));var querystring=require(_0x4250('0x11'));var Papa=require('papaparse');var Redis=require(_0x4250('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4250('0x13'));var hardwareService=require(_0x4250('0x14'));var logger=require('../../config/logger')(_0x4250('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4250('0x16'))['db'];function respondWithStatusCode(_0x2cbaa6,_0x208e8c){_0x208e8c=_0x208e8c||0xcc;return function(_0x3c1e7e){if(_0x3c1e7e){return _0x2cbaa6[_0x4250('0x17')](_0x208e8c);}return _0x2cbaa6['status'](_0x208e8c)[_0x4250('0x18')]();};}function respondWithResult(_0x19fd3e,_0x25b79b){_0x25b79b=_0x25b79b||0xc8;return function(_0x2c8a75){if(_0x2c8a75){return _0x19fd3e[_0x4250('0x19')](_0x25b79b)[_0x4250('0x1a')](_0x2c8a75);}};}function respondWithFilteredResult(_0x513687,_0x9aa450){return function(_0x46ba15){if(_0x46ba15){var _0x1b0c66=_0x46ba15[_0x4250('0x1b')],_0x3cff02=_0x9aa450['offset'],_0x2979cd=_0x9aa450[_0x4250('0x1c')]+_0x9aa450[_0x4250('0x1d')],_0x9907b4;if(_0x2979cd>=_0x1b0c66){_0x2979cd=_0x1b0c66;_0x9907b4=0xc8;}else{_0x9907b4=0xce;}_0x513687[_0x4250('0x19')](_0x9907b4);return _0x513687[_0x4250('0x1e')](_0x4250('0x1f'),_0x3cff02+'-'+_0x2979cd+'/'+_0x1b0c66)[_0x4250('0x1a')](_0x46ba15);}return null;};}function patchUpdates(_0x14d590){return function(_0x508bc3){try{jsonpatch[_0x4250('0x20')](_0x508bc3,_0x14d590,!![]);}catch(_0x4f0154){return BPromise['reject'](_0x4f0154);}return _0x508bc3[_0x4250('0x21')]();};}function saveUpdates(_0x3c8325,_0x5b7e7f){return function(_0x42c331){if(_0x42c331){return _0x42c331[_0x4250('0x22')](_0x3c8325)[_0x4250('0x23')](function(_0x1ba772){return _0x1ba772;});}return null;};}function removeEntity(_0x2985f8,_0x309745){return function(_0x3818c0){if(_0x3818c0){return _0x3818c0[_0x4250('0x24')]()[_0x4250('0x23')](function(){_0x2985f8['status'](0xcc)[_0x4250('0x18')]();});}};}function handleEntityNotFound(_0x171df4,_0x1feb98){return function(_0x523053){if(!_0x523053){_0x171df4['sendStatus'](0x194);}return _0x523053;};}function handleError(_0x42b18f,_0x91c0d6){_0x91c0d6=_0x91c0d6||0x1f4;return function(_0x1c1294){logger[_0x4250('0x25')](_0x1c1294[_0x4250('0x26')]);if(_0x1c1294['name']){delete _0x1c1294[_0x4250('0x27')];}_0x42b18f[_0x4250('0x19')](_0x91c0d6)[_0x4250('0x28')](_0x1c1294);};}exports['index']=function(_0x5b155e,_0x2dcd72){var _0x5d0fa2={},_0x3e8b4d={},_0x1c4fa5={'count':0x0,'rows':[]};var _0x105206=db[_0x4250('0x29')][_0x4250('0x2a')];_0x3e8b4d['model']=_[_0x4250('0x2b')](_0x105206);_0x3e8b4d[_0x4250('0x2c')]=_['keys'](_0x5b155e[_0x4250('0x2c')]);_0x3e8b4d['filters']=_[_0x4250('0x2d')](_0x3e8b4d['model'],_0x3e8b4d['query']);_0x5d0fa2[_0x4250('0x2e')]=_['intersection'](_0x3e8b4d[_0x4250('0x2f')],qs[_0x4250('0x30')](_0x5b155e['query'][_0x4250('0x30')]));_0x5d0fa2[_0x4250('0x2e')]=_0x5d0fa2['attributes'][_0x4250('0x31')]?_0x5d0fa2[_0x4250('0x2e')]:_0x3e8b4d['model'];if(!_0x5b155e[_0x4250('0x2c')][_0x4250('0x32')](_0x4250('0x33'))){_0x5d0fa2[_0x4250('0x1d')]=qs[_0x4250('0x1d')](_0x5b155e[_0x4250('0x2c')][_0x4250('0x1d')]);_0x5d0fa2[_0x4250('0x1c')]=qs[_0x4250('0x1c')](_0x5b155e[_0x4250('0x2c')][_0x4250('0x1c')]);}_0x5d0fa2[_0x4250('0x34')]=qs[_0x4250('0x35')](_0x5b155e['query'][_0x4250('0x35')]);_0x5d0fa2['where']=qs[_0x4250('0x36')](_[_0x4250('0x37')](_0x5b155e['query'],_0x3e8b4d[_0x4250('0x36')]));if(_0x5b155e[_0x4250('0x2c')][_0x4250('0x38')]){_0x5d0fa2[_0x4250('0x39')]=_['merge'](_0x5d0fa2['where'],{'$or':_['map'](_0x105206,function(_0x3bbee2){if(_0x3bbee2[_0x4250('0x3a')]['key']!==_0x4250('0x3b')){var _0x1f40bd={};_0x1f40bd[_0x3bbee2[_0x4250('0x3c')]]={'$like':'%'+_0x5b155e[_0x4250('0x2c')][_0x4250('0x38')]+'%'};return _0x1f40bd;}})});}_0x5d0fa2=_['merge']({},_0x5d0fa2,_0x5b155e[_0x4250('0x3d')]);var _0x4798bf={'where':_0x5d0fa2['where']};return db[_0x4250('0x29')]['count'](_0x4798bf)[_0x4250('0x23')](function(_0x285e7c){_0x1c4fa5[_0x4250('0x1b')]=_0x285e7c;if(_0x5b155e['query'][_0x4250('0x3e')]){_0x5d0fa2[_0x4250('0x3f')]=[{'all':!![]}];}return db[_0x4250('0x29')][_0x4250('0x40')](_0x5d0fa2);})[_0x4250('0x23')](function(_0x4c98f0){_0x1c4fa5[_0x4250('0x41')]=_0x4c98f0;return _0x1c4fa5;})[_0x4250('0x23')](respondWithFilteredResult(_0x2dcd72,_0x5d0fa2))[_0x4250('0x42')](handleError(_0x2dcd72,null));};exports[_0x4250('0x43')]=function(_0x37df2a,_0x111d60){var _0x5ef192={'raw':!![],'where':{'id':_0x37df2a['params']['id']}},_0x3a340a={};_0x3a340a[_0x4250('0x2f')]=_[_0x4250('0x2b')](db[_0x4250('0x29')][_0x4250('0x2a')]);_0x3a340a[_0x4250('0x2c')]=_[_0x4250('0x2b')](_0x37df2a['query']);_0x3a340a['filters']=_['intersection'](_0x3a340a[_0x4250('0x2f')],_0x3a340a[_0x4250('0x2c')]);_0x5ef192[_0x4250('0x2e')]=_['intersection'](_0x3a340a[_0x4250('0x2f')],qs[_0x4250('0x30')](_0x37df2a[_0x4250('0x2c')]['fields']));_0x5ef192[_0x4250('0x2e')]=_0x5ef192[_0x4250('0x2e')][_0x4250('0x31')]?_0x5ef192[_0x4250('0x2e')]:_0x3a340a['model'];if(_0x37df2a['query'][_0x4250('0x3e')]){_0x5ef192[_0x4250('0x3f')]=[{'all':!![]}];}_0x5ef192=_[_0x4250('0x44')]({},_0x5ef192,_0x37df2a[_0x4250('0x3d')]);return db[_0x4250('0x29')]['find'](_0x5ef192)[_0x4250('0x23')](handleEntityNotFound(_0x111d60,null))['then'](respondWithResult(_0x111d60,null))[_0x4250('0x42')](handleError(_0x111d60,null));};exports[_0x4250('0x45')]=function(_0x5fffa5,_0x527381){return db[_0x4250('0x29')][_0x4250('0x45')](_0x5fffa5[_0x4250('0x46')],{})['then'](respondWithResult(_0x527381,0xc9))['catch'](handleError(_0x527381,null));};exports['update']=function(_0x222070,_0x2edff0){if(_0x222070[_0x4250('0x46')]['id']){delete _0x222070[_0x4250('0x46')]['id'];}return db[_0x4250('0x29')][_0x4250('0x47')]({'where':{'id':_0x222070['params']['id']}})[_0x4250('0x23')](handleEntityNotFound(_0x2edff0,null))[_0x4250('0x23')](saveUpdates(_0x222070[_0x4250('0x46')],null))['then'](respondWithResult(_0x2edff0,null))[_0x4250('0x42')](handleError(_0x2edff0,null));};exports['destroy']=function(_0x5895ea,_0x2e0d9d){return db[_0x4250('0x29')][_0x4250('0x47')]({'where':{'id':_0x5895ea[_0x4250('0x48')]['id']}})[_0x4250('0x23')](handleEntityNotFound(_0x2e0d9d,null))[_0x4250('0x23')](removeEntity(_0x2e0d9d,null))['catch'](handleError(_0x2e0d9d,null));};exports[_0x4250('0x49')]=function(_0x566664,_0x364385){return db[_0x4250('0x29')][_0x4250('0x49')]()['then'](respondWithResult(_0x364385,null))[_0x4250('0x42')](handleError(_0x364385,null));}; \ No newline at end of file +var _0x9c2c=['status','end','json','count','offset','set','Content-Range','apply','reject','save','then','error','name','send','ChatOfflineMessage','model','keys','query','filters','intersection','fields','attributes','nolimit','limit','sort','where','pick','map','type','key','field','merge','includeAll','include','findAll','catch','show','rawAttributes','options','find','create','body','update','params','destroy','describe','html-pdf','eml-format','request-promise','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus'];(function(_0x4ee8f2,_0x341ceb){var _0x59d6c8=function(_0x519f9c){while(--_0x519f9c){_0x4ee8f2['push'](_0x4ee8f2['shift']());}};_0x59d6c8(++_0x341ceb);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xc9c2('0x0'));var emlformat=require(_0xc9c2('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc9c2('0x2'));var moment=require('moment');var BPromise=require(_0xc9c2('0x3'));var Mustache=require(_0xc9c2('0x4'));var util=require('util');var path=require('path');var sox=require(_0xc9c2('0x5'));var csv=require('to-csv');var ejs=require(_0xc9c2('0x6'));var fs=require('fs');var _=require(_0xc9c2('0x7'));var squel=require(_0xc9c2('0x8'));var crypto=require(_0xc9c2('0x9'));var jsforce=require(_0xc9c2('0xa'));var deskjs=require(_0xc9c2('0xb'));var toCsv=require(_0xc9c2('0xc'));var querystring=require(_0xc9c2('0xd'));var Papa=require(_0xc9c2('0xe'));var Redis=require('ioredis');var authService=require(_0xc9c2('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xc9c2('0x10'));var logger=require(_0xc9c2('0x11'))(_0xc9c2('0x12'));var utils=require(_0xc9c2('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10c97d,_0x25aee6){_0x25aee6=_0x25aee6||0xcc;return function(_0x568f69){if(_0x568f69){return _0x10c97d[_0xc9c2('0x14')](_0x25aee6);}return _0x10c97d[_0xc9c2('0x15')](_0x25aee6)[_0xc9c2('0x16')]();};}function respondWithResult(_0x43d9bc,_0x81352e){_0x81352e=_0x81352e||0xc8;return function(_0x3b0058){if(_0x3b0058){return _0x43d9bc[_0xc9c2('0x15')](_0x81352e)[_0xc9c2('0x17')](_0x3b0058);}};}function respondWithFilteredResult(_0x264d1f,_0x406c2e){return function(_0xf94209){if(_0xf94209){var _0x383667=_0xf94209[_0xc9c2('0x18')],_0x480d7c=_0x406c2e[_0xc9c2('0x19')],_0x27840d=_0x406c2e[_0xc9c2('0x19')]+_0x406c2e['limit'],_0xc554be;if(_0x27840d>=_0x383667){_0x27840d=_0x383667;_0xc554be=0xc8;}else{_0xc554be=0xce;}_0x264d1f[_0xc9c2('0x15')](_0xc554be);return _0x264d1f[_0xc9c2('0x1a')](_0xc9c2('0x1b'),_0x480d7c+'-'+_0x27840d+'/'+_0x383667)['json'](_0xf94209);}return null;};}function patchUpdates(_0x1c3b09){return function(_0x7de09c){try{jsonpatch[_0xc9c2('0x1c')](_0x7de09c,_0x1c3b09,!![]);}catch(_0x484ca3){return BPromise[_0xc9c2('0x1d')](_0x484ca3);}return _0x7de09c[_0xc9c2('0x1e')]();};}function saveUpdates(_0x54bb8f,_0x5a4ba2){return function(_0x37e3){if(_0x37e3){return _0x37e3['update'](_0x54bb8f)[_0xc9c2('0x1f')](function(_0x140c8a){return _0x140c8a;});}return null;};}function removeEntity(_0x408d4b,_0x295d1c){return function(_0x3e1774){if(_0x3e1774){return _0x3e1774['destroy']()[_0xc9c2('0x1f')](function(){_0x408d4b[_0xc9c2('0x15')](0xcc)[_0xc9c2('0x16')]();});}};}function handleEntityNotFound(_0x11cc07,_0x32c372){return function(_0x385030){if(!_0x385030){_0x11cc07['sendStatus'](0x194);}return _0x385030;};}function handleError(_0x38c957,_0x20ca3b){_0x20ca3b=_0x20ca3b||0x1f4;return function(_0x5e47c2){logger[_0xc9c2('0x20')](_0x5e47c2['stack']);if(_0x5e47c2[_0xc9c2('0x21')]){delete _0x5e47c2[_0xc9c2('0x21')];}_0x38c957[_0xc9c2('0x15')](_0x20ca3b)[_0xc9c2('0x22')](_0x5e47c2);};}exports['index']=function(_0x2073ef,_0x5bd3e8){var _0x2fcaa3={},_0x3bd8e8={},_0x41f3e8={'count':0x0,'rows':[]};var _0x305531=db[_0xc9c2('0x23')]['rawAttributes'];_0x3bd8e8[_0xc9c2('0x24')]=_[_0xc9c2('0x25')](_0x305531);_0x3bd8e8[_0xc9c2('0x26')]=_[_0xc9c2('0x25')](_0x2073ef[_0xc9c2('0x26')]);_0x3bd8e8[_0xc9c2('0x27')]=_[_0xc9c2('0x28')](_0x3bd8e8['model'],_0x3bd8e8[_0xc9c2('0x26')]);_0x2fcaa3['attributes']=_[_0xc9c2('0x28')](_0x3bd8e8[_0xc9c2('0x24')],qs['fields'](_0x2073ef[_0xc9c2('0x26')][_0xc9c2('0x29')]));_0x2fcaa3[_0xc9c2('0x2a')]=_0x2fcaa3[_0xc9c2('0x2a')]['length']?_0x2fcaa3[_0xc9c2('0x2a')]:_0x3bd8e8[_0xc9c2('0x24')];if(!_0x2073ef['query']['hasOwnProperty'](_0xc9c2('0x2b'))){_0x2fcaa3[_0xc9c2('0x2c')]=qs[_0xc9c2('0x2c')](_0x2073ef['query']['limit']);_0x2fcaa3[_0xc9c2('0x19')]=qs[_0xc9c2('0x19')](_0x2073ef['query'][_0xc9c2('0x19')]);}_0x2fcaa3['order']=qs[_0xc9c2('0x2d')](_0x2073ef[_0xc9c2('0x26')][_0xc9c2('0x2d')]);_0x2fcaa3[_0xc9c2('0x2e')]=qs[_0xc9c2('0x27')](_[_0xc9c2('0x2f')](_0x2073ef[_0xc9c2('0x26')],_0x3bd8e8[_0xc9c2('0x27')]));if(_0x2073ef[_0xc9c2('0x26')]['filter']){_0x2fcaa3[_0xc9c2('0x2e')]=_['merge'](_0x2fcaa3[_0xc9c2('0x2e')],{'$or':_[_0xc9c2('0x30')](_0x305531,function(_0x4b1b9d){if(_0x4b1b9d[_0xc9c2('0x31')][_0xc9c2('0x32')]!=='VIRTUAL'){var _0x449658={};_0x449658[_0x4b1b9d[_0xc9c2('0x33')]]={'$like':'%'+_0x2073ef[_0xc9c2('0x26')]['filter']+'%'};return _0x449658;}})});}_0x2fcaa3=_[_0xc9c2('0x34')]({},_0x2fcaa3,_0x2073ef['options']);var _0x407034={'where':_0x2fcaa3[_0xc9c2('0x2e')]};return db['ChatOfflineMessage'][_0xc9c2('0x18')](_0x407034)[_0xc9c2('0x1f')](function(_0xedf65e){_0x41f3e8[_0xc9c2('0x18')]=_0xedf65e;if(_0x2073ef[_0xc9c2('0x26')][_0xc9c2('0x35')]){_0x2fcaa3[_0xc9c2('0x36')]=[{'all':!![]}];}return db[_0xc9c2('0x23')][_0xc9c2('0x37')](_0x2fcaa3);})[_0xc9c2('0x1f')](function(_0x8d6710){_0x41f3e8['rows']=_0x8d6710;return _0x41f3e8;})['then'](respondWithFilteredResult(_0x5bd3e8,_0x2fcaa3))[_0xc9c2('0x38')](handleError(_0x5bd3e8,null));};exports[_0xc9c2('0x39')]=function(_0x4507c9,_0xb8c031){var _0x20c8be={'raw':!![],'where':{'id':_0x4507c9['params']['id']}},_0x394050={};_0x394050[_0xc9c2('0x24')]=_[_0xc9c2('0x25')](db[_0xc9c2('0x23')][_0xc9c2('0x3a')]);_0x394050[_0xc9c2('0x26')]=_['keys'](_0x4507c9[_0xc9c2('0x26')]);_0x394050[_0xc9c2('0x27')]=_[_0xc9c2('0x28')](_0x394050['model'],_0x394050[_0xc9c2('0x26')]);_0x20c8be[_0xc9c2('0x2a')]=_[_0xc9c2('0x28')](_0x394050[_0xc9c2('0x24')],qs[_0xc9c2('0x29')](_0x4507c9['query']['fields']));_0x20c8be[_0xc9c2('0x2a')]=_0x20c8be[_0xc9c2('0x2a')]['length']?_0x20c8be[_0xc9c2('0x2a')]:_0x394050[_0xc9c2('0x24')];if(_0x4507c9[_0xc9c2('0x26')][_0xc9c2('0x35')]){_0x20c8be[_0xc9c2('0x36')]=[{'all':!![]}];}_0x20c8be=_[_0xc9c2('0x34')]({},_0x20c8be,_0x4507c9[_0xc9c2('0x3b')]);return db['ChatOfflineMessage'][_0xc9c2('0x3c')](_0x20c8be)['then'](handleEntityNotFound(_0xb8c031,null))[_0xc9c2('0x1f')](respondWithResult(_0xb8c031,null))['catch'](handleError(_0xb8c031,null));};exports[_0xc9c2('0x3d')]=function(_0x506a00,_0x3cffef){return db['ChatOfflineMessage'][_0xc9c2('0x3d')](_0x506a00[_0xc9c2('0x3e')],{})[_0xc9c2('0x1f')](respondWithResult(_0x3cffef,0xc9))[_0xc9c2('0x38')](handleError(_0x3cffef,null));};exports[_0xc9c2('0x3f')]=function(_0xfb5bc5,_0x997c59){if(_0xfb5bc5['body']['id']){delete _0xfb5bc5[_0xc9c2('0x3e')]['id'];}return db[_0xc9c2('0x23')][_0xc9c2('0x3c')]({'where':{'id':_0xfb5bc5[_0xc9c2('0x40')]['id']}})[_0xc9c2('0x1f')](handleEntityNotFound(_0x997c59,null))[_0xc9c2('0x1f')](saveUpdates(_0xfb5bc5['body'],null))[_0xc9c2('0x1f')](respondWithResult(_0x997c59,null))[_0xc9c2('0x38')](handleError(_0x997c59,null));};exports[_0xc9c2('0x41')]=function(_0x88fa84,_0x2e9925){return db[_0xc9c2('0x23')][_0xc9c2('0x3c')]({'where':{'id':_0x88fa84[_0xc9c2('0x40')]['id']}})['then'](handleEntityNotFound(_0x2e9925,null))[_0xc9c2('0x1f')](removeEntity(_0x2e9925,null))[_0xc9c2('0x38')](handleError(_0x2e9925,null));};exports[_0xc9c2('0x42')]=function(_0x3ac7fd,_0x4128fa){return db['ChatOfflineMessage'][_0xc9c2('0x42')]()[_0xc9c2('0x1f')](respondWithResult(_0x4128fa,null))[_0xc9c2('0x38')](handleError(_0x4128fa,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 4bc61c4..0b6c4dd 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 _0x65fe=['rimraf','../../config/environment','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x87239,_0x38c793){var _0x53af1e=function(_0x11eb5f){while(--_0x11eb5f){_0x87239['push'](_0x87239['shift']());}};_0x53af1e(++_0x38c793);}(_0x65fe,0x68));var _0xe65f=function(_0x129e7a,_0x3420ea){_0x129e7a=_0x129e7a-0x0;var _0xc8e49a=_0x65fe[_0x129e7a];return _0xc8e49a;};'use strict';var _=require(_0xe65f('0x0'));var util=require(_0xe65f('0x1'));var logger=require(_0xe65f('0x2'))(_0xe65f('0x3'));var moment=require(_0xe65f('0x4'));var BPromise=require(_0xe65f('0x5'));var rp=require(_0xe65f('0x6'));var fs=require('fs');var path=require(_0xe65f('0x7'));var rimraf=require(_0xe65f('0x8'));var config=require(_0xe65f('0x9'));var attributes=require(_0xe65f('0xa'));module['exports']=function(_0x3de5b1,_0x5883ab){return _0x3de5b1[_0xe65f('0xb')](_0xe65f('0xc'),attributes,{'tableName':_0xe65f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe65f('0xe'),'collate':_0xe65f('0xf')});}; \ No newline at end of file +var _0x289b=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatOfflineMessage.attributes','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci'];(function(_0x59a1d2,_0x1cbc16){var _0x576fb0=function(_0x425541){while(--_0x425541){_0x59a1d2['push'](_0x59a1d2['shift']());}};_0x576fb0(++_0x1cbc16);}(_0x289b,0x16c));var _0xb289=function(_0x331b08,_0x2c5937){_0x331b08=_0x331b08-0x0;var _0x5034d9=_0x289b[_0x331b08];return _0x5034d9;};'use strict';var _=require(_0xb289('0x0'));var util=require(_0xb289('0x1'));var logger=require(_0xb289('0x2'))(_0xb289('0x3'));var moment=require(_0xb289('0x4'));var BPromise=require(_0xb289('0x5'));var rp=require(_0xb289('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb289('0x7'));var config=require(_0xb289('0x8'));var attributes=require(_0xb289('0x9'));module['exports']=function(_0x3f6078,_0x35a4c0){return _0x3f6078[_0xb289('0xa')](_0xb289('0xb'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb289('0xc'),'collate':_0xb289('0xd')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index ce84d8b..acd90c4 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 _0xab52=['then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0xab52,0x199));var _0x2ab5=function(_0x4c02d8,_0x31ad39){_0x4c02d8=_0x4c02d8-0x0;var _0xe6906b=_0xab52[_0x4c02d8];return _0xe6906b;};'use strict';var _=require(_0x2ab5('0x0'));var util=require('util');var moment=require(_0x2ab5('0x1'));var BPromise=require(_0x2ab5('0x2'));var rs=require(_0x2ab5('0x3'));var fs=require('fs');var Redis=require(_0x2ab5('0x4'));var db=require(_0x2ab5('0x5'))['db'];var utils=require(_0x2ab5('0x6'));var logger=require(_0x2ab5('0x7'))(_0x2ab5('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2ab5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ecb8d,_0x41b4c8,_0x3f509f){return new BPromise(function(_0xd9ed0b,_0x1cccb1){return client[_0x2ab5('0xa')](_0x2ecb8d,_0x3f509f)[_0x2ab5('0xb')](function(_0x1bdaaf){logger[_0x2ab5('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x41b4c8,_0x2ab5('0xd'));logger[_0x2ab5('0xe')](_0x2ab5('0xf'),_0x41b4c8,'request\x20sent',JSON[_0x2ab5('0x10')](_0x1bdaaf));if(_0x1bdaaf[_0x2ab5('0x11')]){if(_0x1bdaaf[_0x2ab5('0x11')]['code']===0x1f4){logger['error'](_0x2ab5('0x12'),_0x41b4c8,_0x1bdaaf[_0x2ab5('0x11')]['message']);return _0x1cccb1(_0x1bdaaf[_0x2ab5('0x11')][_0x2ab5('0x13')]);}logger[_0x2ab5('0x11')](_0x2ab5('0x12'),_0x41b4c8,_0x1bdaaf[_0x2ab5('0x11')][_0x2ab5('0x13')]);return _0xd9ed0b(_0x1bdaaf[_0x2ab5('0x11')]['message']);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x41b4c8,_0x2ab5('0xd'));_0xd9ed0b(_0x1bdaaf[_0x2ab5('0x14')]['message']);}})['catch'](function(_0x41dbf8){logger['error'](_0x2ab5('0x12'),_0x41b4c8,_0x41dbf8);_0x1cccb1(_0x41dbf8);});});} \ No newline at end of file +var _0x782b=['message','info','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x318494,_0x2778b6){var _0x51e62c=function(_0x19993f){while(--_0x19993f){_0x318494['push'](_0x318494['shift']());}};_0x51e62c(++_0x2778b6);}(_0x782b,0x153));var _0xb782=function(_0x3d2c06,_0x3cc8f3){_0x3d2c06=_0x3d2c06-0x0;var _0x36c85f=_0x782b[_0x3d2c06];return _0x36c85f;};'use strict';var _=require('lodash');var util=require(_0xb782('0x0'));var moment=require('moment');var BPromise=require(_0xb782('0x1'));var rs=require(_0xb782('0x2'));var fs=require('fs');var Redis=require(_0xb782('0x3'));var db=require(_0xb782('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb782('0x5'))(_0xb782('0x6'));var config=require(_0xb782('0x7'));var jayson=require(_0xb782('0x8'));var client=jayson[_0xb782('0x9')][_0xb782('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe81666,_0x238272,_0x4c4f39){return new BPromise(function(_0x57dfef,_0x5b2db1){return client[_0xb782('0xb')](_0xe81666,_0x4c4f39)['then'](function(_0x21f3a5){logger['info'](_0xb782('0xc'),_0x238272,_0xb782('0xd'));logger[_0xb782('0xe')](_0xb782('0xf'),_0x238272,_0xb782('0xd'),JSON['stringify'](_0x21f3a5));if(_0x21f3a5[_0xb782('0x10')]){if(_0x21f3a5[_0xb782('0x10')][_0xb782('0x11')]===0x1f4){logger['error'](_0xb782('0xc'),_0x238272,_0x21f3a5[_0xb782('0x10')][_0xb782('0x12')]);return _0x5b2db1(_0x21f3a5[_0xb782('0x10')]['message']);}logger['error'](_0xb782('0xc'),_0x238272,_0x21f3a5[_0xb782('0x10')]['message']);return _0x57dfef(_0x21f3a5['error']['message']);}else{logger[_0xb782('0x13')](_0xb782('0xc'),_0x238272,_0xb782('0xd'));_0x57dfef(_0x21f3a5[_0xb782('0x14')][_0xb782('0x12')]);}})['catch'](function(_0x90133f){logger['error'](_0xb782('0xc'),_0x238272,_0x90133f);_0x5b2db1(_0x90133f);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 8e621a7..968101f 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 _0xfa2b=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','show','post','create','put','/:id','update','destroy','exports','multer'];(function(_0x29fbaa,_0x31cc98){var _0x1042c6=function(_0x2c450f){while(--_0x2c450f){_0x29fbaa['push'](_0x29fbaa['shift']());}};_0x1042c6(++_0x31cc98);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x182d7e,_0x346e9c){_0x182d7e=_0x182d7e-0x0;var _0x293546=_0xfa2b[_0x182d7e];return _0x293546;};'use strict';var multer=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var path=require(_0xbfa2('0x2'));var timeout=require(_0xbfa2('0x3'));var express=require(_0xbfa2('0x4'));var router=express[_0xbfa2('0x5')]();var auth=require(_0xbfa2('0x6'));var interaction=require(_0xbfa2('0x7'));var config=require(_0xbfa2('0x8'));var controller=require(_0xbfa2('0x9'));router[_0xbfa2('0xa')]('/',auth[_0xbfa2('0xb')](),controller[_0xbfa2('0xc')]);router[_0xbfa2('0xa')](_0xbfa2('0xd'),auth[_0xbfa2('0xb')](),controller['describe']);router[_0xbfa2('0xa')]('/:id',auth[_0xbfa2('0xb')](),controller[_0xbfa2('0xe')]);router[_0xbfa2('0xf')]('/',auth[_0xbfa2('0xb')](),controller[_0xbfa2('0x10')]);router[_0xbfa2('0x11')](_0xbfa2('0x12'),auth[_0xbfa2('0xb')](),controller[_0xbfa2('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xbfa2('0x14')]);module[_0xbfa2('0x15')]=router; \ No newline at end of file +var _0x8fcf=['util','path','express','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','show','post','create','/:id','delete','destroy','exports','multer'];(function(_0x179039,_0x1fb713){var _0xeb427=function(_0x307847){while(--_0x307847){_0x179039['push'](_0x179039['shift']());}};_0xeb427(++_0x1fb713);}(_0x8fcf,0x1db));var _0xf8fc=function(_0x486a92,_0x35c9b2){_0x486a92=_0x486a92-0x0;var _0x273850=_0x8fcf[_0x486a92];return _0x273850;};'use strict';var multer=require(_0xf8fc('0x0'));var util=require(_0xf8fc('0x1'));var path=require(_0xf8fc('0x2'));var timeout=require('connect-timeout');var express=require(_0xf8fc('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf8fc('0x4'));var controller=require(_0xf8fc('0x5'));router[_0xf8fc('0x6')]('/',auth[_0xf8fc('0x7')](),controller[_0xf8fc('0x8')]);router[_0xf8fc('0x6')](_0xf8fc('0x9'),auth[_0xf8fc('0x7')](),controller['describe']);router[_0xf8fc('0x6')]('/:id',auth[_0xf8fc('0x7')](),controller[_0xf8fc('0xa')]);router[_0xf8fc('0xb')]('/',auth[_0xf8fc('0x7')](),controller[_0xf8fc('0xc')]);router['put'](_0xf8fc('0xd'),auth[_0xf8fc('0x7')](),controller['update']);router[_0xf8fc('0xe')](_0xf8fc('0xd'),auth[_0xf8fc('0x7')](),controller[_0xf8fc('0xf')]);module[_0xf8fc('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index c2eb359..5c9b112 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 _0x14a0=['mouseOver','timeout','exports','STRING','ENUM'];(function(_0x76bd10,_0x224308){var _0x5290eb=function(_0x1f352c){while(--_0x1f352c){_0x76bd10['push'](_0x76bd10['shift']());}};_0x5290eb(++_0x224308);}(_0x14a0,0x8e));var _0x014a=function(_0x40d378,_0x4d870d){_0x40d378=_0x40d378-0x0;var _0x464fb4=_0x14a0[_0x40d378];return _0x464fb4;};'use strict';var Sequelize=require('sequelize');module[_0x014a('0x0')]={'name':{'type':Sequelize[_0x014a('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x014a('0x2')](_0x014a('0x3'),_0x014a('0x4')),'defaultValue':_0x014a('0x3')},'selector':{'type':Sequelize[_0x014a('0x1')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x1c5e=['INTEGER','sequelize','exports','STRING','mouseOver'];(function(_0x1558ab,_0x39d1de){var _0x53b64a=function(_0x4771ed){while(--_0x4771ed){_0x1558ab['push'](_0x1558ab['shift']());}};_0x53b64a(++_0x39d1de);}(_0x1c5e,0x141));var _0xe1c5=function(_0x43444b,_0x8cf95b){_0x43444b=_0x43444b-0x0;var _0x392fe5=_0x1c5e[_0x43444b];return _0x392fe5;};'use strict';var Sequelize=require(_0xe1c5('0x0'));module[_0xe1c5('0x1')]={'name':{'type':Sequelize[_0xe1c5('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe1c5('0x3'),'timeout'),'defaultValue':_0xe1c5('0x3')},'selector':{'type':Sequelize[_0xe1c5('0x2')]},'timeout':{'type':Sequelize[_0xe1c5('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 5018643..1714eac 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 _0x83fe=['rawAttributes','query','filters','intersection','model','attributes','fields','include','merge','ChatProactiveAction','find','create','body','catch','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','limit','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','show','params','keys'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x83fe,0x1ce));var _0xe83f=function(_0x43a5c8,_0x16aa4a){_0x43a5c8=_0x43a5c8-0x0;var _0x50e2f8=_0x83fe[_0x43a5c8];return _0x50e2f8;};'use strict';var pdf=require(_0xe83f('0x0'));var emlformat=require(_0xe83f('0x1'));var rimraf=require(_0xe83f('0x2'));var zipdir=require(_0xe83f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe83f('0x4'));var moment=require(_0xe83f('0x5'));var BPromise=require(_0xe83f('0x6'));var Mustache=require(_0xe83f('0x7'));var util=require('util');var path=require(_0xe83f('0x8'));var sox=require(_0xe83f('0x9'));var csv=require(_0xe83f('0xa'));var ejs=require(_0xe83f('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe83f('0xc'));var crypto=require(_0xe83f('0xd'));var jsforce=require(_0xe83f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe83f('0xa'));var querystring=require(_0xe83f('0xf'));var Papa=require(_0xe83f('0x10'));var Redis=require(_0xe83f('0x11'));var authService=require(_0xe83f('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe83f('0x13'));var logger=require(_0xe83f('0x14'))(_0xe83f('0x15'));var utils=require(_0xe83f('0x16'));var config=require('../../config/environment');var db=require(_0xe83f('0x17'))['db'];function respondWithStatusCode(_0x4073be,_0x621bd9){_0x621bd9=_0x621bd9||0xcc;return function(_0x5b3afc){if(_0x5b3afc){return _0x4073be[_0xe83f('0x18')](_0x621bd9);}return _0x4073be[_0xe83f('0x19')](_0x621bd9)['end']();};}function respondWithResult(_0xe667fd,_0x26550a){_0x26550a=_0x26550a||0xc8;return function(_0x22a503){if(_0x22a503){return _0xe667fd[_0xe83f('0x19')](_0x26550a)['json'](_0x22a503);}};}function respondWithFilteredResult(_0x51e96d,_0x3c73cc){return function(_0xaf801b){if(_0xaf801b){var _0x37b880=_0xaf801b['count'],_0x47d9c1=_0x3c73cc[_0xe83f('0x1a')],_0xf8f688=_0x3c73cc[_0xe83f('0x1a')]+_0x3c73cc[_0xe83f('0x1b')],_0x17cc7f;if(_0xf8f688>=_0x37b880){_0xf8f688=_0x37b880;_0x17cc7f=0xc8;}else{_0x17cc7f=0xce;}_0x51e96d['status'](_0x17cc7f);return _0x51e96d['set'](_0xe83f('0x1c'),_0x47d9c1+'-'+_0xf8f688+'/'+_0x37b880)[_0xe83f('0x1d')](_0xaf801b);}return null;};}function patchUpdates(_0x47dc68){return function(_0x5983c1){try{jsonpatch[_0xe83f('0x1e')](_0x5983c1,_0x47dc68,!![]);}catch(_0x27cc6b){return BPromise['reject'](_0x27cc6b);}return _0x5983c1[_0xe83f('0x1f')]();};}function saveUpdates(_0x1c3550,_0x5c1461){return function(_0x21ea44){if(_0x21ea44){return _0x21ea44[_0xe83f('0x20')](_0x1c3550)[_0xe83f('0x21')](function(_0x1a1ca1){return _0x1a1ca1;});}return null;};}function removeEntity(_0x24f0a5,_0x352ff4){return function(_0x234e4f){if(_0x234e4f){return _0x234e4f[_0xe83f('0x22')]()['then'](function(){_0x24f0a5[_0xe83f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c304e,_0x2cdd49){return function(_0x10affc){if(!_0x10affc){_0x5c304e[_0xe83f('0x18')](0x194);}return _0x10affc;};}function handleError(_0x4462f7,_0x134d76){_0x134d76=_0x134d76||0x1f4;return function(_0x5e702d){logger[_0xe83f('0x23')](_0x5e702d[_0xe83f('0x24')]);if(_0x5e702d[_0xe83f('0x25')]){delete _0x5e702d[_0xe83f('0x25')];}_0x4462f7[_0xe83f('0x19')](_0x134d76)[_0xe83f('0x26')](_0x5e702d);};}exports[_0xe83f('0x27')]=function(_0x5d47a7,_0x211a50){var _0x172a0f={'raw':!![],'where':{'id':_0x5d47a7[_0xe83f('0x28')]['id']}},_0x292b88={};_0x292b88['model']=_[_0xe83f('0x29')](db['ChatProactiveAction'][_0xe83f('0x2a')]);_0x292b88[_0xe83f('0x2b')]=_['keys'](_0x5d47a7[_0xe83f('0x2b')]);_0x292b88[_0xe83f('0x2c')]=_[_0xe83f('0x2d')](_0x292b88[_0xe83f('0x2e')],_0x292b88['query']);_0x172a0f[_0xe83f('0x2f')]=_['intersection'](_0x292b88[_0xe83f('0x2e')],qs['fields'](_0x5d47a7[_0xe83f('0x2b')][_0xe83f('0x30')]));_0x172a0f[_0xe83f('0x2f')]=_0x172a0f[_0xe83f('0x2f')]['length']?_0x172a0f[_0xe83f('0x2f')]:_0x292b88[_0xe83f('0x2e')];if(_0x5d47a7['query']['includeAll']){_0x172a0f[_0xe83f('0x31')]=[{'all':!![]}];}_0x172a0f=_[_0xe83f('0x32')]({},_0x172a0f,_0x5d47a7['options']);return db[_0xe83f('0x33')][_0xe83f('0x34')](_0x172a0f)[_0xe83f('0x21')](handleEntityNotFound(_0x211a50,null))[_0xe83f('0x21')](respondWithResult(_0x211a50,null))['catch'](handleError(_0x211a50,null));};exports[_0xe83f('0x35')]=function(_0x2a398a,_0x509990){return db[_0xe83f('0x33')][_0xe83f('0x35')](_0x2a398a[_0xe83f('0x36')],{})[_0xe83f('0x21')](respondWithResult(_0x509990,0xc9))[_0xe83f('0x37')](handleError(_0x509990,null));};exports[_0xe83f('0x20')]=function(_0x566a58,_0x3189fc){if(_0x566a58[_0xe83f('0x36')]['id']){delete _0x566a58[_0xe83f('0x36')]['id'];}return db[_0xe83f('0x33')][_0xe83f('0x34')]({'where':{'id':_0x566a58[_0xe83f('0x28')]['id']}})[_0xe83f('0x21')](handleEntityNotFound(_0x3189fc,null))['then'](saveUpdates(_0x566a58[_0xe83f('0x36')],null))['then'](respondWithResult(_0x3189fc,null))[_0xe83f('0x37')](handleError(_0x3189fc,null));};exports[_0xe83f('0x22')]=function(_0xd86f51,_0x520a29){return db[_0xe83f('0x33')][_0xe83f('0x34')]({'where':{'id':_0xd86f51[_0xe83f('0x28')]['id']}})[_0xe83f('0x21')](handleEntityNotFound(_0x520a29,null))[_0xe83f('0x21')](removeEntity(_0x520a29,null))[_0xe83f('0x37')](handleError(_0x520a29,null));}; \ No newline at end of file +var _0xfee4=['update','stack','name','send','params','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','model','fields','length','includeAll','include','merge','options','find','then','catch','create','body','destroy','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','limit','set','apply','reject','save'];(function(_0x33b842,_0x3e9876){var _0x4b1977=function(_0x4af117){while(--_0x4af117){_0x33b842['push'](_0x33b842['shift']());}};_0x4b1977(++_0x3e9876);}(_0xfee4,0x11d));var _0x4fee=function(_0x1407ed,_0x14c0fc){_0x1407ed=_0x1407ed-0x0;var _0x401eb9=_0xfee4[_0x1407ed];return _0x401eb9;};'use strict';var pdf=require(_0x4fee('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4fee('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4fee('0x2'));var rp=require(_0x4fee('0x3'));var moment=require(_0x4fee('0x4'));var BPromise=require(_0x4fee('0x5'));var Mustache=require(_0x4fee('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4fee('0x7'));var csv=require(_0x4fee('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4fee('0x9'));var squel=require(_0x4fee('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4fee('0xb'));var toCsv=require(_0x4fee('0x8'));var querystring=require('querystring');var Papa=require(_0x4fee('0xc'));var Redis=require(_0x4fee('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4fee('0xe'));var logger=require(_0x4fee('0xf'))(_0x4fee('0x10'));var utils=require(_0x4fee('0x11'));var config=require(_0x4fee('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fd48d,_0x2e8e72){_0x2e8e72=_0x2e8e72||0xcc;return function(_0x562e3c){if(_0x562e3c){return _0x3fd48d['sendStatus'](_0x2e8e72);}return _0x3fd48d[_0x4fee('0x13')](_0x2e8e72)[_0x4fee('0x14')]();};}function respondWithResult(_0x452f42,_0x461849){_0x461849=_0x461849||0xc8;return function(_0x6a0094){if(_0x6a0094){return _0x452f42[_0x4fee('0x13')](_0x461849)[_0x4fee('0x15')](_0x6a0094);}};}function respondWithFilteredResult(_0x130c69,_0x21679c){return function(_0x9ce8c2){if(_0x9ce8c2){var _0x31080c=_0x9ce8c2['count'],_0x52b7e1=_0x21679c['offset'],_0x6b5450=_0x21679c['offset']+_0x21679c[_0x4fee('0x16')],_0x10e603;if(_0x6b5450>=_0x31080c){_0x6b5450=_0x31080c;_0x10e603=0xc8;}else{_0x10e603=0xce;}_0x130c69['status'](_0x10e603);return _0x130c69[_0x4fee('0x17')]('Content-Range',_0x52b7e1+'-'+_0x6b5450+'/'+_0x31080c)[_0x4fee('0x15')](_0x9ce8c2);}return null;};}function patchUpdates(_0xea2fca){return function(_0x6360ab){try{jsonpatch[_0x4fee('0x18')](_0x6360ab,_0xea2fca,!![]);}catch(_0x44d666){return BPromise[_0x4fee('0x19')](_0x44d666);}return _0x6360ab[_0x4fee('0x1a')]();};}function saveUpdates(_0xbaf1c0,_0x4ebaa5){return function(_0x5f2d4e){if(_0x5f2d4e){return _0x5f2d4e[_0x4fee('0x1b')](_0xbaf1c0)['then'](function(_0x25b140){return _0x25b140;});}return null;};}function removeEntity(_0x294c84,_0xdaada9){return function(_0x52036b){if(_0x52036b){return _0x52036b['destroy']()['then'](function(){_0x294c84['status'](0xcc)[_0x4fee('0x14')]();});}};}function handleEntityNotFound(_0x4e5551,_0x389f4e){return function(_0x21246f){if(!_0x21246f){_0x4e5551['sendStatus'](0x194);}return _0x21246f;};}function handleError(_0x373cb6,_0x1cb337){_0x1cb337=_0x1cb337||0x1f4;return function(_0x45489c){logger['error'](_0x45489c[_0x4fee('0x1c')]);if(_0x45489c[_0x4fee('0x1d')]){delete _0x45489c['name'];}_0x373cb6['status'](_0x1cb337)[_0x4fee('0x1e')](_0x45489c);};}exports['show']=function(_0x393988,_0x2b590b){var _0x4d633b={'raw':!![],'where':{'id':_0x393988[_0x4fee('0x1f')]['id']}},_0xb1613a={};_0xb1613a['model']=_[_0x4fee('0x20')](db[_0x4fee('0x21')][_0x4fee('0x22')]);_0xb1613a[_0x4fee('0x23')]=_[_0x4fee('0x20')](_0x393988[_0x4fee('0x23')]);_0xb1613a[_0x4fee('0x24')]=_[_0x4fee('0x25')](_0xb1613a['model'],_0xb1613a[_0x4fee('0x23')]);_0x4d633b[_0x4fee('0x26')]=_['intersection'](_0xb1613a[_0x4fee('0x27')],qs[_0x4fee('0x28')](_0x393988[_0x4fee('0x23')][_0x4fee('0x28')]));_0x4d633b[_0x4fee('0x26')]=_0x4d633b[_0x4fee('0x26')][_0x4fee('0x29')]?_0x4d633b[_0x4fee('0x26')]:_0xb1613a[_0x4fee('0x27')];if(_0x393988[_0x4fee('0x23')][_0x4fee('0x2a')]){_0x4d633b[_0x4fee('0x2b')]=[{'all':!![]}];}_0x4d633b=_[_0x4fee('0x2c')]({},_0x4d633b,_0x393988[_0x4fee('0x2d')]);return db[_0x4fee('0x21')][_0x4fee('0x2e')](_0x4d633b)['then'](handleEntityNotFound(_0x2b590b,null))[_0x4fee('0x2f')](respondWithResult(_0x2b590b,null))[_0x4fee('0x30')](handleError(_0x2b590b,null));};exports[_0x4fee('0x31')]=function(_0x26259b,_0x2a59a4){return db[_0x4fee('0x21')][_0x4fee('0x31')](_0x26259b[_0x4fee('0x32')],{})[_0x4fee('0x2f')](respondWithResult(_0x2a59a4,0xc9))[_0x4fee('0x30')](handleError(_0x2a59a4,null));};exports[_0x4fee('0x1b')]=function(_0x44d965,_0x7b3c28){if(_0x44d965['body']['id']){delete _0x44d965[_0x4fee('0x32')]['id'];}return db[_0x4fee('0x21')][_0x4fee('0x2e')]({'where':{'id':_0x44d965['params']['id']}})['then'](handleEntityNotFound(_0x7b3c28,null))[_0x4fee('0x2f')](saveUpdates(_0x44d965[_0x4fee('0x32')],null))[_0x4fee('0x2f')](respondWithResult(_0x7b3c28,null))[_0x4fee('0x30')](handleError(_0x7b3c28,null));};exports[_0x4fee('0x33')]=function(_0x136d3e,_0x350eeb){return db[_0x4fee('0x21')][_0x4fee('0x2e')]({'where':{'id':_0x136d3e[_0x4fee('0x1f')]['id']}})[_0x4fee('0x2f')](handleEntityNotFound(_0x350eeb,null))[_0x4fee('0x2f')](removeEntity(_0x350eeb,null))['catch'](handleError(_0x350eeb,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 6189ca9..5817739 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 _0x42fc=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','exports','ChatProactiveAction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x42fc,0x144));var _0xc42f=function(_0xefd1e6,_0x35dac0){_0xefd1e6=_0xefd1e6-0x0;var _0x150719=_0x42fc[_0xefd1e6];return _0x150719;};'use strict';var _=require(_0xc42f('0x0'));var util=require(_0xc42f('0x1'));var logger=require(_0xc42f('0x2'))(_0xc42f('0x3'));var moment=require(_0xc42f('0x4'));var BPromise=require(_0xc42f('0x5'));var rp=require(_0xc42f('0x6'));var fs=require('fs');var path=require(_0xc42f('0x7'));var rimraf=require(_0xc42f('0x8'));var config=require('../../config/environment');var attributes=require(_0xc42f('0x9'));module[_0xc42f('0xa')]=function(_0x534ef2,_0x29a7b2){return _0x534ef2['define'](_0xc42f('0xb'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe10f=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatProactiveAction','chat_proactive_actions','lodash','util'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0xe10f,0x12a));var _0xfe10=function(_0x2c19cf,_0x29e87e){_0x2c19cf=_0x2c19cf-0x0;var _0x53dc88=_0xe10f[_0x2c19cf];return _0x53dc88;};'use strict';var _=require(_0xfe10('0x0'));var util=require(_0xfe10('0x1'));var logger=require(_0xfe10('0x2'))('api');var moment=require(_0xfe10('0x3'));var BPromise=require(_0xfe10('0x4'));var rp=require(_0xfe10('0x5'));var fs=require('fs');var path=require(_0xfe10('0x6'));var rimraf=require(_0xfe10('0x7'));var config=require(_0xfe10('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0xfe10('0x9')]=function(_0x2b296e,_0x4c9900){return _0x2b296e['define'](_0xfe10('0xa'),attributes,{'tableName':_0xfe10('0xb'),'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 a3d1264..67feaf4 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.rpc.js +++ b/server/api/chatProactiveAction/chatProactiveAction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3bc3e8,_0x38cc91){var _0x4ecd62=function(_0x390e55){while(--_0x390e55){_0x3bc3e8['push'](_0x3bc3e8['shift']());}};_0x4ecd62(++_0x38cc91);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x546695,_0xa9c9b2){var _0x2d6cc6=function(_0x499c8f){while(--_0x499c8f){_0x546695['push'](_0x546695['shift']());}};_0x2d6cc6(++_0xa9c9b2);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index b3825e7..e24e948 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 _0xb7e2=['/:id','isAuthenticated','show','create','put','update','delete','multer','path','express','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0x45627b,_0x1a7675){var _0x3c5630=function(_0x38e503){while(--_0x38e503){_0x45627b['push'](_0x45627b['shift']());}};_0x3c5630(++_0x1a7675);}(_0xb7e2,0x103));var _0x2b7e=function(_0x21d373,_0x30e418){_0x21d373=_0x21d373-0x0;var _0x1811e9=_0xb7e2[_0x21d373];return _0x1811e9;};'use strict';var multer=require(_0x2b7e('0x0'));var util=require('util');var path=require(_0x2b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x2b7e('0x2'));var router=express['Router']();var auth=require(_0x2b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2b7e('0x4'));var controller=require(_0x2b7e('0x5'));router[_0x2b7e('0x6')](_0x2b7e('0x7'),auth[_0x2b7e('0x8')](),controller[_0x2b7e('0x9')]);router['post']('/',auth[_0x2b7e('0x8')](),controller[_0x2b7e('0xa')]);router[_0x2b7e('0xb')]('/:id',auth[_0x2b7e('0x8')](),controller[_0x2b7e('0xc')]);router[_0x2b7e('0xd')](_0x2b7e('0x7'),auth[_0x2b7e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5f2f=['put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','post'];(function(_0x463b25,_0x3a72a4){var _0x548ebb=function(_0x172c89){while(--_0x172c89){_0x463b25['push'](_0x463b25['shift']());}};_0x548ebb(++_0x3a72a4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1aa46d,_0x5eeb76){_0x1aa46d=_0x1aa46d-0x0;var _0x50bc78=_0x5f2f[_0x1aa46d];return _0x50bc78;};'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('./chatProactiveAction.controller');router[_0xf5f2('0x8')](_0xf5f2('0x9'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0xc')]('/',auth[_0xf5f2('0xa')](),controller['create']);router[_0xf5f2('0xd')](_0xf5f2('0x9'),auth[_0xf5f2('0xa')](),controller['update']);router[_0xf5f2('0xe')](_0xf5f2('0x9'),auth[_0xf5f2('0xa')](),controller['destroy']);module[_0xf5f2('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 261c85c..7be14eb 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 _0xe810=['ENUM','rrmemory','roundrobin','sequelize','STRING'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xe810,0x189));var _0x0e81=function(_0x25331c,_0x3ad831){_0x25331c=_0x25331c-0x0;var _0x57203a=_0xe810[_0x25331c];return _0x57203a;};'use strict';var Sequelize=require(_0x0e81('0x0'));module['exports']={'name':{'type':Sequelize[_0x0e81('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0e81('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0e81('0x2')](_0x0e81('0x3'),'beepall',_0x0e81('0x4'))}}; \ No newline at end of file +var _0x0c67=['name','INTEGER','roundrobin','sequelize','exports','STRING'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x0c67,0x69));var _0x70c6=function(_0x551bb6,_0x17a745){_0x551bb6=_0x551bb6-0x0;var _0x3a2b35=_0x0c67[_0x551bb6];return _0x3a2b35;};'use strict';var Sequelize=require(_0x70c6('0x0'));module[_0x70c6('0x1')]={'name':{'type':Sequelize[_0x70c6('0x2')],'unique':_0x70c6('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x70c6('0x2')]},'timeout':{'type':Sequelize[_0x70c6('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0x70c6('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index fd61c05..7794f01 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 _0x8531=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserChatQueue','nolimit','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','teams','online','voicePause','flatMap','Agents','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','ids','field','tq.TeamId','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','compact','removeAgents','forEach','userChatQueue:remove','addAgents','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','count','limit','set','Content-Range','apply','update','destroy','get','ChatQueues','UserProfileResource','sendStatus','name','send','index','ChatQueue','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','filters','pick','where','merge','map','type','key','VIRTUAL','filter','findAll','rows','show','includeAll','include','options','find','create','body','role','user'];(function(_0x555778,_0x2fcb70){var _0x10fe1e=function(_0x18c835){while(--_0x18c835){_0x555778['push'](_0x555778['shift']());}};_0x10fe1e(++_0x2fcb70);}(_0x8531,0x15f));var _0x1853=function(_0xc40b9f,_0x17ec1f){_0xc40b9f=_0xc40b9f-0x0;var _0x535b9c=_0x8531[_0xc40b9f];return _0x535b9c;};'use strict';var pdf=require(_0x1853('0x0'));var emlformat=require(_0x1853('0x1'));var rimraf=require(_0x1853('0x2'));var zipdir=require(_0x1853('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1853('0x4'));var moment=require(_0x1853('0x5'));var BPromise=require(_0x1853('0x6'));var Mustache=require('mustache');var util=require(_0x1853('0x7'));var path=require('path');var sox=require(_0x1853('0x8'));var csv=require(_0x1853('0x9'));var ejs=require(_0x1853('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1853('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1853('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1853('0xc'));var authService=require(_0x1853('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1853('0xe'));var utils=require(_0x1853('0xf'));var config=require(_0x1853('0x10'));var db=require(_0x1853('0x11'))['db'];config[_0x1853('0x12')]=_[_0x1853('0x13')](config[_0x1853('0x12')],{'host':_0x1853('0x14'),'port':0x18eb});var socket=require(_0x1853('0x15'))(new Redis(config[_0x1853('0x12')]));require(_0x1853('0x16'))['register'](socket);var jayson=require(_0x1853('0x17'));var client=jayson[_0x1853('0x18')][_0x1853('0x19')]({'port':0x232a});function checkPasswordPattern(_0x1113c4,_0x411189,_0x2a0ad3){if(_0x2a0ad3){var _0x5a697c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5a697c[_0x1853('0x1a')](_0x411189)){return _0x1113c4;}else{throw new Error(_0x1853('0x1b'));}}else{return _0x1113c4;}}function respondWithRpcPromise(_0x1f6106,_0x1338b9,_0x10bb08,_0x256dba){return new BPromise(function(_0x50e2fd,_0x5d8dbf){var _0x42d753=_0x256dba||client;return _0x42d753[_0x1853('0x1c')](_0x1f6106,_0x10bb08)[_0x1853('0x1d')](function(_0x6fd488){logger[_0x1853('0x1e')](_0x1853('0x1f'),_0x1338b9,_0x1853('0x20'));logger[_0x1853('0x21')](_0x1853('0x22'),_0x1338b9,'request\x20sent',JSON[_0x1853('0x23')](_0x6fd488));if(_0x6fd488[_0x1853('0x24')]){if(_0x6fd488[_0x1853('0x24')][_0x1853('0x25')]===0x1f4){logger[_0x1853('0x24')](_0x1853('0x1f'),_0x1338b9,_0x6fd488['error'][_0x1853('0x26')]);return _0x5d8dbf(_0x6fd488[_0x1853('0x24')]['message']);}logger[_0x1853('0x24')](_0x1853('0x1f'),_0x1338b9,_0x6fd488[_0x1853('0x24')][_0x1853('0x26')]);return _0x50e2fd(_0x6fd488[_0x1853('0x24')]['message']);}else{logger[_0x1853('0x1e')](_0x1853('0x1f'),_0x1338b9,'request\x20sent');_0x50e2fd(_0x6fd488['result'][_0x1853('0x26')]);}})[_0x1853('0x27')](function(_0x3bff7e){logger[_0x1853('0x24')]('ChatQueue,\x20%s,\x20%s',_0x1338b9,_0x3bff7e);_0x5d8dbf(_0x3bff7e);});});}function respondWithStatusCode(_0x4a68c2,_0x424ac0){_0x424ac0=_0x424ac0||0xcc;return function(_0x11fec4){if(_0x11fec4){return _0x4a68c2['sendStatus'](_0x424ac0);}return _0x4a68c2[_0x1853('0x28')](_0x424ac0)[_0x1853('0x29')]();};}function respondWithResult(_0x14af8d,_0x40743a){_0x40743a=_0x40743a||0xc8;return function(_0x477ca6){if(_0x477ca6){return _0x14af8d[_0x1853('0x28')](_0x40743a)[_0x1853('0x2a')](_0x477ca6);}};}function respondWithFilteredResult(_0x12d5ef,_0x3a76bc){return function(_0x42f85f){if(_0x42f85f){var _0x36d866=_0x42f85f[_0x1853('0x2b')],_0xdd916=_0x3a76bc['offset'],_0x5580ba=_0x3a76bc['offset']+_0x3a76bc[_0x1853('0x2c')],_0x315e37;if(_0x5580ba>=_0x36d866){_0x5580ba=_0x36d866;_0x315e37=0xc8;}else{_0x315e37=0xce;}_0x12d5ef[_0x1853('0x28')](_0x315e37);return _0x12d5ef[_0x1853('0x2d')](_0x1853('0x2e'),_0xdd916+'-'+_0x5580ba+'/'+_0x36d866)[_0x1853('0x2a')](_0x42f85f);}return null;};}function patchUpdates(_0x56db0f){return function(_0x255e6f){try{jsonpatch[_0x1853('0x2f')](_0x255e6f,_0x56db0f,!![]);}catch(_0x451cb8){return BPromise['reject'](_0x451cb8);}return _0x255e6f['save']();};}function saveUpdates(_0x58c356,_0x40ce94){return function(_0x526104){if(_0x526104){return _0x526104[_0x1853('0x30')](_0x58c356)[_0x1853('0x1d')](function(_0x413cf1){return _0x413cf1;});}return null;};}function removeEntity(_0x4c3c52,_0x1fb399){return function(_0x126dff){if(_0x126dff){return _0x126dff[_0x1853('0x31')]()['then'](function(){var _0x33b591=_0x126dff[_0x1853('0x32')]({'plain':!![]});var _0x1a48e8=_0x1853('0x33');return db[_0x1853('0x34')][_0x1853('0x31')]({'where':{'type':_0x1a48e8,'resourceId':_0x33b591['id']}})[_0x1853('0x1d')](function(){return _0x126dff;});})[_0x1853('0x1d')](function(){_0x4c3c52[_0x1853('0x28')](0xcc)[_0x1853('0x29')]();});}};}function handleEntityNotFound(_0x1c2e21,_0x239748){return function(_0x528036){if(!_0x528036){_0x1c2e21[_0x1853('0x35')](0x194);}return _0x528036;};}function handleError(_0x446601,_0x5466a3){_0x5466a3=_0x5466a3||0x1f4;return function(_0x4cab29){logger['error'](_0x4cab29['stack']);if(_0x4cab29[_0x1853('0x36')]){delete _0x4cab29[_0x1853('0x36')];}_0x446601['status'](_0x5466a3)[_0x1853('0x37')](_0x4cab29);};}exports[_0x1853('0x38')]=function(_0x40ec74,_0x15d7f6){var _0x4b6ba8={},_0x361c0c={},_0x58ff2a={'count':0x0,'rows':[]};var _0x20a88f=db[_0x1853('0x39')][_0x1853('0x3a')];_0x361c0c[_0x1853('0x3b')]=_[_0x1853('0x3c')](_0x20a88f);_0x361c0c[_0x1853('0x3d')]=_[_0x1853('0x3c')](_0x40ec74[_0x1853('0x3d')]);_0x361c0c['filters']=_[_0x1853('0x3e')](_0x361c0c[_0x1853('0x3b')],_0x361c0c[_0x1853('0x3d')]);_0x4b6ba8[_0x1853('0x3f')]=_[_0x1853('0x3e')](_0x361c0c[_0x1853('0x3b')],qs['fields'](_0x40ec74[_0x1853('0x3d')][_0x1853('0x40')]));_0x4b6ba8[_0x1853('0x3f')]=_0x4b6ba8['attributes'][_0x1853('0x41')]?_0x4b6ba8['attributes']:_0x361c0c[_0x1853('0x3b')];if(!_0x40ec74[_0x1853('0x3d')][_0x1853('0x42')]('nolimit')){_0x4b6ba8['limit']=qs['limit'](_0x40ec74[_0x1853('0x3d')]['limit']);_0x4b6ba8[_0x1853('0x43')]=qs[_0x1853('0x43')](_0x40ec74['query'][_0x1853('0x43')]);}_0x4b6ba8[_0x1853('0x44')]=qs['sort'](_0x40ec74[_0x1853('0x3d')][_0x1853('0x45')]);_0x4b6ba8['where']=qs[_0x1853('0x46')](_[_0x1853('0x47')](_0x40ec74[_0x1853('0x3d')],_0x361c0c[_0x1853('0x46')]));if(_0x40ec74['query']['filter']){_0x4b6ba8[_0x1853('0x48')]=_[_0x1853('0x49')](_0x4b6ba8[_0x1853('0x48')],{'$or':_[_0x1853('0x4a')](_0x20a88f,function(_0x499fb7){if(_0x499fb7[_0x1853('0x4b')][_0x1853('0x4c')]!==_0x1853('0x4d')){var _0x52befc={};_0x52befc[_0x499fb7['field']]={'$like':'%'+_0x40ec74['query'][_0x1853('0x4e')]+'%'};return _0x52befc;}})});}_0x4b6ba8=_[_0x1853('0x49')]({},_0x4b6ba8,_0x40ec74['options']);var _0x1065df={'where':_0x4b6ba8[_0x1853('0x48')]};return db[_0x1853('0x39')]['count'](_0x1065df)[_0x1853('0x1d')](function(_0x35ec5f){_0x58ff2a['count']=_0x35ec5f;if(_0x40ec74[_0x1853('0x3d')]['includeAll']){_0x4b6ba8['include']=[{'all':!![]}];}return db['ChatQueue'][_0x1853('0x4f')](_0x4b6ba8);})['then'](function(_0x37800e){_0x58ff2a[_0x1853('0x50')]=_0x37800e;return _0x58ff2a;})[_0x1853('0x1d')](respondWithFilteredResult(_0x15d7f6,_0x4b6ba8))['catch'](handleError(_0x15d7f6,null));};exports[_0x1853('0x51')]=function(_0xa2a102,_0x359c9a){var _0x25331c={'raw':!![],'where':{'id':_0xa2a102['params']['id']}},_0x382028={};_0x382028[_0x1853('0x3b')]=_[_0x1853('0x3c')](db[_0x1853('0x39')][_0x1853('0x3a')]);_0x382028[_0x1853('0x3d')]=_[_0x1853('0x3c')](_0xa2a102[_0x1853('0x3d')]);_0x382028['filters']=_[_0x1853('0x3e')](_0x382028[_0x1853('0x3b')],_0x382028[_0x1853('0x3d')]);_0x25331c[_0x1853('0x3f')]=_[_0x1853('0x3e')](_0x382028[_0x1853('0x3b')],qs[_0x1853('0x40')](_0xa2a102[_0x1853('0x3d')][_0x1853('0x40')]));_0x25331c[_0x1853('0x3f')]=_0x25331c[_0x1853('0x3f')][_0x1853('0x41')]?_0x25331c[_0x1853('0x3f')]:_0x382028[_0x1853('0x3b')];if(_0xa2a102['query'][_0x1853('0x52')]){_0x25331c[_0x1853('0x53')]=[{'all':!![]}];}_0x25331c=_[_0x1853('0x49')]({},_0x25331c,_0xa2a102[_0x1853('0x54')]);return db[_0x1853('0x39')][_0x1853('0x55')](_0x25331c)[_0x1853('0x1d')](handleEntityNotFound(_0x359c9a,null))[_0x1853('0x1d')](respondWithResult(_0x359c9a,null))[_0x1853('0x27')](handleError(_0x359c9a,null));};exports[_0x1853('0x56')]=function(_0x14a67c,_0x14cf68){return db[_0x1853('0x39')][_0x1853('0x56')](_0x14a67c[_0x1853('0x57')],{})[_0x1853('0x1d')](function(_0x239e1f){var _0x108f96=_0x14a67c['user']['get']({'plain':!![]});if(!_0x108f96)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x108f96[_0x1853('0x58')]===_0x1853('0x59')){var _0x195a10=_0x239e1f[_0x1853('0x32')]({'plain':!![]});var _0x5e014b=_0x1853('0x33');return db[_0x1853('0x5a')][_0x1853('0x55')]({'where':{'name':_0x5e014b,'userProfileId':_0x108f96[_0x1853('0x5b')]},'raw':!![]})[_0x1853('0x1d')](function(_0x182fba){if(_0x182fba&&_0x182fba[_0x1853('0x5c')]===0x0){return db['UserProfileResource'][_0x1853('0x56')]({'name':_0x195a10[_0x1853('0x36')],'resourceId':_0x195a10['id'],'type':_0x182fba[_0x1853('0x36')],'sectionId':_0x182fba['id']},{})[_0x1853('0x1d')](function(){return _0x239e1f;});}else{return _0x239e1f;}})[_0x1853('0x27')](function(_0x4c2cf6){logger['error'](_0x1853('0x5d'),_0x4c2cf6);throw _0x4c2cf6;});}return _0x239e1f;})[_0x1853('0x1d')](respondWithResult(_0x14cf68,0xc9))['catch'](handleError(_0x14cf68,null));};exports[_0x1853('0x30')]=function(_0x289265,_0x4b0ec8){if(_0x289265[_0x1853('0x57')]['id']){delete _0x289265[_0x1853('0x57')]['id'];}return db[_0x1853('0x39')][_0x1853('0x55')]({'where':{'id':_0x289265[_0x1853('0x5e')]['id']}})[_0x1853('0x1d')](handleEntityNotFound(_0x4b0ec8,null))[_0x1853('0x1d')](saveUpdates(_0x289265['body'],null))[_0x1853('0x1d')](respondWithResult(_0x4b0ec8,null))[_0x1853('0x27')](handleError(_0x4b0ec8,null));};exports[_0x1853('0x31')]=function(_0x520334,_0x2e5052){return db['ChatQueue'][_0x1853('0x55')]({'where':{'id':_0x520334[_0x1853('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2e5052,null))[_0x1853('0x1d')](removeEntity(_0x2e5052,null))[_0x1853('0x27')](handleError(_0x2e5052,null));};exports[_0x1853('0x5f')]=function(_0x1285b4,_0x4d94d7){return db[_0x1853('0x39')][_0x1853('0x5f')]()[_0x1853('0x1d')](respondWithResult(_0x4d94d7,null))[_0x1853('0x27')](handleError(_0x4d94d7,null));};exports[_0x1853('0x60')]=function(_0x550101,_0x30ed60,_0xe25923){var _0xb3cb64={'raw':!![],'where':{}},_0x5c37cc={},_0x2ad549;return db['ChatQueue'][_0x1853('0x61')]({'where':{'id':_0x550101[_0x1853('0x5e')]['id']}})['then'](handleEntityNotFound(_0x30ed60,null))[_0x1853('0x1d')](function(_0x434718){if(_0x434718){_0x2ad549=_0x434718[_0x1853('0x32')]({'plain':!![]});_0x5c37cc[_0x1853('0x3b')]=_[_0x1853('0x3c')](db[_0x1853('0x62')]['rawAttributes']);_0x5c37cc[_0x1853('0x3d')]=_[_0x1853('0x3c')](_0x550101[_0x1853('0x3d')]);_0x5c37cc[_0x1853('0x46')]=_[_0x1853('0x3e')](_0x5c37cc[_0x1853('0x3b')],_0x5c37cc['query']);_0xb3cb64[_0x1853('0x3f')]=_[_0x1853('0x3e')](_0x5c37cc[_0x1853('0x3b')],qs['fields'](_0x550101[_0x1853('0x3d')][_0x1853('0x40')]));_0xb3cb64[_0x1853('0x3f')]=_0xb3cb64[_0x1853('0x3f')]['length']?_0xb3cb64[_0x1853('0x3f')]:_0x5c37cc[_0x1853('0x3b')];if(!_0x550101[_0x1853('0x3d')][_0x1853('0x42')](_0x1853('0x63'))){_0xb3cb64['limit']=qs[_0x1853('0x2c')](_0x550101[_0x1853('0x3d')][_0x1853('0x2c')]);_0xb3cb64[_0x1853('0x43')]=qs[_0x1853('0x43')](_0x550101['query'][_0x1853('0x43')]);}_0xb3cb64[_0x1853('0x44')]=qs[_0x1853('0x45')](_0x550101[_0x1853('0x3d')][_0x1853('0x45')]);_0xb3cb64[_0x1853('0x48')]=qs[_0x1853('0x46')](_['pick'](_0x550101[_0x1853('0x3d')],_0x5c37cc[_0x1853('0x46')]));_0xb3cb64[_0x1853('0x48')][_0x1853('0x64')]=_0x434718['id'];if(_0x550101[_0x1853('0x3d')]['filter']){_0xb3cb64[_0x1853('0x48')]=_[_0x1853('0x49')](_0xb3cb64['where'],{'$or':_[_0x1853('0x4a')](_0xb3cb64['attributes'],function(_0x1ae4bd){var _0x396446={};_0x396446[_0x1ae4bd]={'$like':'%'+_0x550101[_0x1853('0x3d')][_0x1853('0x4e')]+'%'};return _0x396446;})});}_0xb3cb64=_[_0x1853('0x49')]({},_0xb3cb64,_0x550101[_0x1853('0x54')]);return db[_0x1853('0x62')]['findAll'](_0xb3cb64);}})[_0x1853('0x1d')](function(_0x3fc167){if(_0x3fc167){return db[_0x1853('0x65')][_0x1853('0x66')]({'where':{'id':_[_0x1853('0x4a')](_0x3fc167,_0x1853('0x67')),'role':_0x1853('0x68')},'attributes':['id',_0x1853('0x36'),_0x1853('0x69'),'updatedAt','createdAt']});}})[_0x1853('0x1d')](function(_0x28373a){if(_0x28373a){return{'count':_0x28373a[_0x1853('0x2b')],'rows':_[_0x1853('0x4a')](_0x28373a[_0x1853('0x50')],function(_0x5b7eea){return{'membername':_0x5b7eea['name'],'UserId':_0x5b7eea['id'],'queue_name':_0x2ad549['name'],'ChatQueueId':_0x2ad549['id'],'interface':util[_0x1853('0x6a')](_0x1853('0x6b'),_0x1853('0x6c'),_0x5b7eea['name']),'penalty':0x0,'paused':_0x5b7eea[_0x1853('0x69')],'createdAt':_0x5b7eea[_0x1853('0x6d')],'updatedAt':_0x5b7eea['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x30ed60,_0xb3cb64))['catch'](handleError(_0x30ed60,null));};exports[_0x1853('0x6e')]=function(_0xc84455,_0x5eab1e,_0x5e42b4){var _0x4d8047={};var _0x4bb2b8={};var _0x24af37;var _0x20329e;return db['ChatQueue']['findOne']({'where':{'id':_0xc84455[_0x1853('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5eab1e,null))['then'](function(_0x43d265){if(_0x43d265){_0x24af37=_0x43d265;_0x4bb2b8[_0x1853('0x3b')]=_['keys'](db[_0x1853('0x6f')][_0x1853('0x3a')]);_0x4bb2b8[_0x1853('0x3d')]=_[_0x1853('0x3c')](_0xc84455[_0x1853('0x3d')]);_0x4bb2b8[_0x1853('0x46')]=_[_0x1853('0x3e')](_0x4bb2b8[_0x1853('0x3b')],_0x4bb2b8[_0x1853('0x3d')]);_0x4d8047[_0x1853('0x3f')]=_[_0x1853('0x3e')](_0x4bb2b8[_0x1853('0x3b')],qs[_0x1853('0x40')](_0xc84455[_0x1853('0x3d')][_0x1853('0x40')]));_0x4d8047[_0x1853('0x3f')]=_0x4d8047[_0x1853('0x3f')]['length']?_0x4d8047[_0x1853('0x3f')]:_0x4bb2b8[_0x1853('0x3b')];_0x4d8047[_0x1853('0x44')]=qs[_0x1853('0x45')](_0xc84455[_0x1853('0x3d')][_0x1853('0x45')]);_0x4d8047[_0x1853('0x48')]=qs[_0x1853('0x46')](_[_0x1853('0x47')](_0xc84455[_0x1853('0x3d')],_0x4bb2b8[_0x1853('0x46')]));if(_0xc84455[_0x1853('0x3d')][_0x1853('0x4e')]){_0x4d8047['where']=_[_0x1853('0x49')](_0x4d8047[_0x1853('0x48')],{'$or':_['map'](_0x4d8047['attributes'],function(_0x43dcb0){var _0x2c3b6b={};_0x2c3b6b[_0x43dcb0]={'$like':'%'+_0xc84455[_0x1853('0x3d')][_0x1853('0x4e')]+'%'};return _0x2c3b6b;})});}_0x4d8047=_['merge']({},_0x4d8047,_0xc84455[_0x1853('0x54')]);return _0x24af37['getTeams'](_0x4d8047);}})['then'](function(_0x4df487){if(_0x4df487){_0x20329e=_0x4df487[_0x1853('0x41')];if(!_0xc84455[_0x1853('0x3d')][_0x1853('0x42')](_0x1853('0x63'))){_0x4d8047[_0x1853('0x2c')]=qs['limit'](_0xc84455[_0x1853('0x3d')][_0x1853('0x2c')]);_0x4d8047['offset']=qs[_0x1853('0x43')](_0xc84455[_0x1853('0x3d')][_0x1853('0x43')]);}return _0x24af37['getTeams'](_0x4d8047);}})[_0x1853('0x1d')](function(_0x1f3aa0){if(_0x1f3aa0){return _0x1f3aa0?{'count':_0x20329e,'rows':_0x1f3aa0}:null;}})[_0x1853('0x1d')](respondWithResult(_0x5eab1e,null))[_0x1853('0x27')](handleError(_0x5eab1e,null));};exports[_0x1853('0x70')]=function(_0x56f012,_0x27a442,_0x5ea873){var _0x28b2e1=_0x56f012['body'][_0x1853('0x71')];return db[_0x1853('0x6f')]['findAll']({'where':{'id':_[_0x1853('0x4a')](_0x28b2e1,'id')},'attributes':['id'],'include':[{'model':db[_0x1853('0x65')],'as':'Agents','attributes':['id',_0x1853('0x36'),_0x1853('0x72'),_0x1853('0x73'),'interface'],'raw':!![]}]})[_0x1853('0x1d')](function(_0x2825ad){if(_0x2825ad){var _0x3cd6c9=_[_0x1853('0x74')](_0x2825ad,function(_0x1e9abe){var _0x1ab073=_0x1e9abe['get']({'plain':!![]});return _0x1ab073[_0x1853('0x75')];});return db[_0x1853('0x39')][_0x1853('0x55')]({'where':{'id':_0x56f012['params']['id']}})['then'](function(_0x27ebad){return db[_0x1853('0x76')][_0x1853('0x77')](function(_0x4495e7){return _0x27ebad[_0x1853('0x70')](_[_0x1853('0x4a')](_0x28b2e1,'id'),{'transaction':_0x4495e7})[_0x1853('0x1d')](function(){return BPromise[_0x1853('0x78')](_0x3cd6c9,function(_0x276c47){return db['UserChatQueue'][_0x1853('0x79')]({'where':{'UserId':_0x276c47['id'],'ChatQueueId':_0x56f012[_0x1853('0x5e')]['id']},'transaction':_0x4495e7});});})[_0x1853('0x1d')](function(){_0x3cd6c9['forEach'](function(_0xbab7f9){socket[_0x1853('0x7a')](_0x1853('0x7b'),{'UserId':_0xbab7f9['id'],'ChatQueueId':_0x27ebad['id']});});});});});}})[_0x1853('0x1d')](respondWithStatusCode(_0x27a442,null))[_0x1853('0x27')](handleError(_0x27a442,null));};exports[_0x1853('0x7c')]=function(_0x2238da,_0x51aed8,_0x914b6e){return db[_0x1853('0x6f')][_0x1853('0x4f')]({'where':{'id':_0x2238da[_0x1853('0x3d')][_0x1853('0x7d')]},'attributes':['id'],'include':[{'model':db[_0x1853('0x65')],'as':_0x1853('0x75'),'attributes':['id'],'raw':!![]}]})[_0x1853('0x1d')](handleEntityNotFound(_0x51aed8,null))[_0x1853('0x1d')](function(_0x37e4ef){var _0x29a238=_[_0x1853('0x4a')](_0x37e4ef,'id');var _0x2c9571=[];var _0x44224f=[];var _0xe49a85=squel['select']();_0xe49a85[_0x1853('0x7e')](_0x1853('0x7f'))['from']('team_has_chat_queues','tq')[_0x1853('0x80')]('user_has_teams','ut',_0x1853('0x81'))['where'](_0x1853('0x82'),_0x2238da['params']['id']);for(var _0x3bc8d3=0x0;_0x3bc8d3<_0x37e4ef[_0x1853('0x41')];_0x3bc8d3+=0x1){let _0x51a422=_0x37e4ef[_0x3bc8d3];for(var _0x4c4a27=0x0;_0x4c4a27<_0x51a422['Agents'][_0x1853('0x41')];_0x4c4a27+=0x1){let _0x5f4200=_0x51a422[_0x1853('0x75')][_0x4c4a27];var _0x58f11b=_0xe49a85[_0x1853('0x83')]();_0x58f11b[_0x1853('0x48')](_0x1853('0x84'),_0x5f4200['id']);_0x44224f[_0x1853('0x85')](db[_0x1853('0x76')]['query'](_0x58f11b[_0x1853('0x86')](),{'type':db[_0x1853('0x76')][_0x1853('0x87')][_0x1853('0x88')]})[_0x1853('0x1d')](function(_0x5d6225){if(_0x5d6225[_0x1853('0x41')]===0x1){return _0x5f4200['id'];}else{var _0x2520a5=_[_0x1853('0x89')](_[_0x1853('0x4a')](_0x5d6225,'TeamId'),function(_0x2c82c4){return _[_0x1853('0x8a')](_0x29a238,_0x2c82c4);});if(_0x2520a5){return _0x5f4200['id'];}}}));}}return BPromise[_0x1853('0x8b')](_0x44224f)[_0x1853('0x1d')](function(_0x19dbde){_0x2c9571=_(_0x2c9571)['union'](_0x19dbde)[_0x1853('0x8c')]()['value']();return db['ChatQueue']['find']({'where':{'id':_0x2238da[_0x1853('0x5e')]['id']}})['then'](function(_0x422f53){return db[_0x1853('0x76')][_0x1853('0x77')](function(_0x217ee8){return _0x422f53['removeTeams'](_0x2238da[_0x1853('0x3d')][_0x1853('0x7d')],{'transaction':_0x217ee8})[_0x1853('0x1d')](function(){if(!_['isEmpty'](_0x2c9571)){return _0x422f53[_0x1853('0x8d')](_0x2c9571,{'transaction':_0x217ee8});}})[_0x1853('0x1d')](function(){_0x2c9571[_0x1853('0x8e')](function(_0x584942){socket[_0x1853('0x7a')](_0x1853('0x8f'),{'UserId':_0x584942,'ChatQueueId':_0x422f53['id']});});});});});});})[_0x1853('0x1d')](respondWithStatusCode(_0x51aed8,null))['catch'](handleError(_0x51aed8,null));};exports[_0x1853('0x90')]=function(_0x3ce46,_0x447668,_0xd73cc9){return db[_0x1853('0x39')]['find']({'where':{'id':_0x3ce46[_0x1853('0x5e')]['id']}})['then'](handleEntityNotFound(_0x447668,null))[_0x1853('0x1d')](function(_0x13d2c6){if(_0x13d2c6){return _0x13d2c6[_0x1853('0x90')](_0x3ce46[_0x1853('0x57')][_0x1853('0x7d')],_['omit'](_0x3ce46['body'],[_0x1853('0x7d'),'id'])||{})['spread'](function(_0xae0e3b){for(var _0x1764b9=0x0;_0x1764b9<_0x3ce46['body'][_0x1853('0x7d')][_0x1853('0x41')];_0x1764b9+=0x1){socket[_0x1853('0x7a')]('userChatQueue:save',{'UserId':_0x3ce46[_0x1853('0x57')]['ids'][_0x1764b9],'ChatQueueId':_0x3ce46[_0x1853('0x5e')]['id']});}return _0xae0e3b;});}})[_0x1853('0x1d')](respondWithResult(_0x447668,null))[_0x1853('0x27')](handleError(_0x447668,null));};exports[_0x1853('0x8d')]=function(_0x427077,_0x27b7d1,_0x211df7){return db[_0x1853('0x39')]['find']({'where':{'id':_0x427077[_0x1853('0x5e')]['id']}})[_0x1853('0x1d')](handleEntityNotFound(_0x27b7d1,null))[_0x1853('0x1d')](function(_0x4be7a3){if(_0x4be7a3){return _0x4be7a3[_0x1853('0x8d')](_0x427077[_0x1853('0x3d')][_0x1853('0x7d')])[_0x1853('0x1d')](function(){if(_[_0x1853('0x91')](_0x427077[_0x1853('0x3d')]['ids'])){for(var _0x1b6044=0x0;_0x1b6044<_0x427077[_0x1853('0x3d')][_0x1853('0x7d')][_0x1853('0x41')];_0x1b6044+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x427077[_0x1853('0x3d')]['ids'][_0x1b6044]),'ChatQueueId':Number(_0x427077[_0x1853('0x5e')]['id'])});}}else{socket[_0x1853('0x7a')](_0x1853('0x8f'),{'UserId':Number(_0x427077[_0x1853('0x3d')][_0x1853('0x7d')]),'ChatQueueId':Number(_0x427077[_0x1853('0x5e')]['id'])});}});}})['then'](respondWithStatusCode(_0x27b7d1,null))[_0x1853('0x27')](handleError(_0x27b7d1,null));};exports[_0x1853('0x92')]=function(_0x1e1ad7,_0x121b5d,_0x1cd44b){var _0x13fb07={};var _0x2140be={};var _0x22573f;var _0x1b2a5c;return db[_0x1853('0x39')]['findOne']({'where':{'id':_0x1e1ad7[_0x1853('0x5e')]['id']}})[_0x1853('0x1d')](handleEntityNotFound(_0x121b5d,null))[_0x1853('0x1d')](function(_0x6107af){if(_0x6107af){_0x22573f=_0x6107af;_0x2140be[_0x1853('0x3b')]=_[_0x1853('0x3c')](db[_0x1853('0x65')][_0x1853('0x3a')]);_0x2140be['query']=_[_0x1853('0x3c')](_0x1e1ad7[_0x1853('0x3d')]);_0x2140be[_0x1853('0x46')]=_['intersection'](_0x2140be[_0x1853('0x3b')],_0x2140be[_0x1853('0x3d')]);_0x13fb07['attributes']=_[_0x1853('0x3e')](_0x2140be[_0x1853('0x3b')],qs[_0x1853('0x40')](_0x1e1ad7[_0x1853('0x3d')][_0x1853('0x40')]));_0x13fb07['attributes']=_0x13fb07['attributes'][_0x1853('0x41')]?_0x13fb07[_0x1853('0x3f')]:_0x2140be[_0x1853('0x3b')];_0x13fb07[_0x1853('0x44')]=qs['sort'](_0x1e1ad7['query']['sort']);_0x13fb07['where']=qs[_0x1853('0x46')](_[_0x1853('0x47')](_0x1e1ad7[_0x1853('0x3d')],_0x2140be[_0x1853('0x46')]));if(_0x1e1ad7[_0x1853('0x3d')][_0x1853('0x4e')]){_0x13fb07['where']=_[_0x1853('0x49')](_0x13fb07[_0x1853('0x48')],{'$or':_[_0x1853('0x4a')](_0x13fb07['attributes'],function(_0x2b6b6e){var _0x3140d4={};_0x3140d4[_0x2b6b6e]={'$like':'%'+_0x1e1ad7[_0x1853('0x3d')][_0x1853('0x4e')]+'%'};return _0x3140d4;})});}_0x13fb07=_[_0x1853('0x49')]({},_0x13fb07,_0x1e1ad7[_0x1853('0x54')]);return _0x22573f[_0x1853('0x92')](_0x13fb07);}})['then'](function(_0x590e22){if(_0x590e22){_0x1b2a5c=_0x590e22[_0x1853('0x41')];if(!_0x1e1ad7[_0x1853('0x3d')]['hasOwnProperty'](_0x1853('0x63'))){_0x13fb07[_0x1853('0x2c')]=qs[_0x1853('0x2c')](_0x1e1ad7[_0x1853('0x3d')][_0x1853('0x2c')]);_0x13fb07['offset']=qs[_0x1853('0x43')](_0x1e1ad7[_0x1853('0x3d')][_0x1853('0x43')]);}return _0x22573f[_0x1853('0x92')](_0x13fb07);}})[_0x1853('0x1d')](function(_0x2ac1d3){if(_0x2ac1d3){return _0x2ac1d3?{'count':_0x1b2a5c,'rows':_0x2ac1d3}:null;}})['then'](respondWithResult(_0x121b5d,null))['catch'](handleError(_0x121b5d,null));}; \ No newline at end of file +var _0x826e=['from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','value','removeTeams','ids','isEmpty','addAgents','omit','spread','removeAgents','isArray','userChatQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','ChatQueues','UserProfileResource','sendStatus','stack','send','index','ChatQueue','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','userProfileId','autoAssociation','name','body','describe','getMembers','findOne','UserChatQueue','nolimit','map','User','findAndCountAll','agent','rows','format','%s/%s','SIP','chatPause','createdAt','updatedAt','getTeams','Team','addTeams','Agents','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userChatQueue:save','tq.TeamId'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x826e,0x152));var _0xe826=function(_0x5247d9,_0x1a29d2){_0x5247d9=_0x5247d9-0x0;var _0xc7d542=_0x826e[_0x5247d9];return _0xc7d542;};'use strict';var pdf=require(_0xe826('0x0'));var emlformat=require(_0xe826('0x1'));var rimraf=require(_0xe826('0x2'));var zipdir=require(_0xe826('0x3'));var jsonpatch=require(_0xe826('0x4'));var rp=require(_0xe826('0x5'));var moment=require(_0xe826('0x6'));var BPromise=require(_0xe826('0x7'));var Mustache=require(_0xe826('0x8'));var util=require(_0xe826('0x9'));var path=require(_0xe826('0xa'));var sox=require(_0xe826('0xb'));var csv=require(_0xe826('0xc'));var ejs=require(_0xe826('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe826('0xe'));var crypto=require(_0xe826('0xf'));var jsforce=require(_0xe826('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe826('0xc'));var querystring=require(_0xe826('0x11'));var Papa=require(_0xe826('0x12'));var Redis=require('ioredis');var authService=require(_0xe826('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe826('0x14'));var logger=require(_0xe826('0x15'))(_0xe826('0x16'));var utils=require(_0xe826('0x17'));var config=require('../../config/environment');var db=require(_0xe826('0x18'))['db'];config[_0xe826('0x19')]=_[_0xe826('0x1a')](config[_0xe826('0x19')],{'host':_0xe826('0x1b'),'port':0x18eb});var socket=require(_0xe826('0x1c'))(new Redis(config[_0xe826('0x19')]));require('./chatQueue.socket')[_0xe826('0x1d')](socket);var jayson=require(_0xe826('0x1e'));var client=jayson[_0xe826('0x1f')][_0xe826('0x20')]({'port':0x232a});function checkPasswordPattern(_0x147701,_0x2614f1,_0x49d790){if(_0x49d790){var _0x475de0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x475de0[_0xe826('0x21')](_0x2614f1)){return _0x147701;}else{throw new Error(_0xe826('0x22'));}}else{return _0x147701;}}function respondWithRpcPromise(_0x46d53b,_0x25275f,_0x2c4ed7,_0xfe5f34){return new BPromise(function(_0x50920a,_0x3c788c){var _0x3861a4=_0xfe5f34||client;return _0x3861a4['request'](_0x46d53b,_0x2c4ed7)[_0xe826('0x23')](function(_0x56dcbf){logger['info'](_0xe826('0x24'),_0x25275f,_0xe826('0x25'));logger[_0xe826('0x26')](_0xe826('0x27'),_0x25275f,'request\x20sent',JSON[_0xe826('0x28')](_0x56dcbf));if(_0x56dcbf[_0xe826('0x29')]){if(_0x56dcbf[_0xe826('0x29')][_0xe826('0x2a')]===0x1f4){logger[_0xe826('0x29')](_0xe826('0x24'),_0x25275f,_0x56dcbf['error']['message']);return _0x3c788c(_0x56dcbf[_0xe826('0x29')][_0xe826('0x2b')]);}logger[_0xe826('0x29')](_0xe826('0x24'),_0x25275f,_0x56dcbf['error'][_0xe826('0x2b')]);return _0x50920a(_0x56dcbf[_0xe826('0x29')][_0xe826('0x2b')]);}else{logger[_0xe826('0x2c')](_0xe826('0x24'),_0x25275f,_0xe826('0x25'));_0x50920a(_0x56dcbf[_0xe826('0x2d')][_0xe826('0x2b')]);}})[_0xe826('0x2e')](function(_0x3e79f5){logger['error']('ChatQueue,\x20%s,\x20%s',_0x25275f,_0x3e79f5);_0x3c788c(_0x3e79f5);});});}function respondWithStatusCode(_0x4aafae,_0x500457){_0x500457=_0x500457||0xcc;return function(_0x443b6c){if(_0x443b6c){return _0x4aafae['sendStatus'](_0x500457);}return _0x4aafae['status'](_0x500457)['end']();};}function respondWithResult(_0x52af95,_0x5cb018){_0x5cb018=_0x5cb018||0xc8;return function(_0x470430){if(_0x470430){return _0x52af95[_0xe826('0x2f')](_0x5cb018)[_0xe826('0x30')](_0x470430);}};}function respondWithFilteredResult(_0x1ddc1b,_0x50ffa7){return function(_0x5a742e){if(_0x5a742e){var _0x11c2cc=_0x5a742e[_0xe826('0x31')],_0x129097=_0x50ffa7[_0xe826('0x32')],_0x43b800=_0x50ffa7[_0xe826('0x32')]+_0x50ffa7[_0xe826('0x33')],_0x216537;if(_0x43b800>=_0x11c2cc){_0x43b800=_0x11c2cc;_0x216537=0xc8;}else{_0x216537=0xce;}_0x1ddc1b['status'](_0x216537);return _0x1ddc1b[_0xe826('0x34')](_0xe826('0x35'),_0x129097+'-'+_0x43b800+'/'+_0x11c2cc)[_0xe826('0x30')](_0x5a742e);}return null;};}function patchUpdates(_0x2b38f3){return function(_0x234dfc){try{jsonpatch[_0xe826('0x36')](_0x234dfc,_0x2b38f3,!![]);}catch(_0x2ebebb){return BPromise[_0xe826('0x37')](_0x2ebebb);}return _0x234dfc[_0xe826('0x38')]();};}function saveUpdates(_0x5f468a,_0x55246f){return function(_0xd9943c){if(_0xd9943c){return _0xd9943c[_0xe826('0x39')](_0x5f468a)[_0xe826('0x23')](function(_0x56f6d7){return _0x56f6d7;});}return null;};}function removeEntity(_0x3fae6d,_0x1bb735){return function(_0x1706ce){if(_0x1706ce){return _0x1706ce[_0xe826('0x3a')]()[_0xe826('0x23')](function(){var _0x2cf985=_0x1706ce['get']({'plain':!![]});var _0x38e54d=_0xe826('0x3b');return db[_0xe826('0x3c')][_0xe826('0x3a')]({'where':{'type':_0x38e54d,'resourceId':_0x2cf985['id']}})[_0xe826('0x23')](function(){return _0x1706ce;});})[_0xe826('0x23')](function(){_0x3fae6d[_0xe826('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cba16,_0x3e5ce1){return function(_0x145ef8){if(!_0x145ef8){_0x4cba16[_0xe826('0x3d')](0x194);}return _0x145ef8;};}function handleError(_0x5d65df,_0x14a71c){_0x14a71c=_0x14a71c||0x1f4;return function(_0x5a3ca4){logger[_0xe826('0x29')](_0x5a3ca4[_0xe826('0x3e')]);if(_0x5a3ca4['name']){delete _0x5a3ca4['name'];}_0x5d65df['status'](_0x14a71c)[_0xe826('0x3f')](_0x5a3ca4);};}exports[_0xe826('0x40')]=function(_0x2daf30,_0x229f4d){var _0x595608={},_0xccbb18={},_0x140be3={'count':0x0,'rows':[]};var _0x20a67f=db[_0xe826('0x41')][_0xe826('0x42')];_0xccbb18[_0xe826('0x43')]=_[_0xe826('0x44')](_0x20a67f);_0xccbb18[_0xe826('0x45')]=_[_0xe826('0x44')](_0x2daf30[_0xe826('0x45')]);_0xccbb18[_0xe826('0x46')]=_[_0xe826('0x47')](_0xccbb18[_0xe826('0x43')],_0xccbb18['query']);_0x595608[_0xe826('0x48')]=_['intersection'](_0xccbb18[_0xe826('0x43')],qs[_0xe826('0x49')](_0x2daf30[_0xe826('0x45')][_0xe826('0x49')]));_0x595608[_0xe826('0x48')]=_0x595608[_0xe826('0x48')][_0xe826('0x4a')]?_0x595608['attributes']:_0xccbb18[_0xe826('0x43')];if(!_0x2daf30['query'][_0xe826('0x4b')]('nolimit')){_0x595608['limit']=qs[_0xe826('0x33')](_0x2daf30['query'][_0xe826('0x33')]);_0x595608['offset']=qs[_0xe826('0x32')](_0x2daf30[_0xe826('0x45')][_0xe826('0x32')]);}_0x595608[_0xe826('0x4c')]=qs[_0xe826('0x4d')](_0x2daf30['query']['sort']);_0x595608[_0xe826('0x4e')]=qs[_0xe826('0x46')](_[_0xe826('0x4f')](_0x2daf30[_0xe826('0x45')],_0xccbb18['filters']));if(_0x2daf30[_0xe826('0x45')][_0xe826('0x50')]){_0x595608[_0xe826('0x4e')]=_[_0xe826('0x51')](_0x595608[_0xe826('0x4e')],{'$or':_['map'](_0x20a67f,function(_0x28c1d0){if(_0x28c1d0[_0xe826('0x52')][_0xe826('0x53')]!==_0xe826('0x54')){var _0x459961={};_0x459961[_0x28c1d0[_0xe826('0x55')]]={'$like':'%'+_0x2daf30[_0xe826('0x45')][_0xe826('0x50')]+'%'};return _0x459961;}})});}_0x595608=_[_0xe826('0x51')]({},_0x595608,_0x2daf30[_0xe826('0x56')]);var _0x1d2fbf={'where':_0x595608[_0xe826('0x4e')]};return db[_0xe826('0x41')][_0xe826('0x31')](_0x1d2fbf)[_0xe826('0x23')](function(_0x4dcf95){_0x140be3[_0xe826('0x31')]=_0x4dcf95;if(_0x2daf30[_0xe826('0x45')][_0xe826('0x57')]){_0x595608[_0xe826('0x58')]=[{'all':!![]}];}return db['ChatQueue'][_0xe826('0x59')](_0x595608);})[_0xe826('0x23')](function(_0x801e35){_0x140be3['rows']=_0x801e35;return _0x140be3;})[_0xe826('0x23')](respondWithFilteredResult(_0x229f4d,_0x595608))[_0xe826('0x2e')](handleError(_0x229f4d,null));};exports[_0xe826('0x5a')]=function(_0x206762,_0x40c6bf){var _0x35f6e8={'raw':!![],'where':{'id':_0x206762[_0xe826('0x5b')]['id']}},_0x4ae334={};_0x4ae334['model']=_[_0xe826('0x44')](db[_0xe826('0x41')][_0xe826('0x42')]);_0x4ae334[_0xe826('0x45')]=_[_0xe826('0x44')](_0x206762[_0xe826('0x45')]);_0x4ae334[_0xe826('0x46')]=_[_0xe826('0x47')](_0x4ae334[_0xe826('0x43')],_0x4ae334[_0xe826('0x45')]);_0x35f6e8[_0xe826('0x48')]=_[_0xe826('0x47')](_0x4ae334[_0xe826('0x43')],qs['fields'](_0x206762['query'][_0xe826('0x49')]));_0x35f6e8[_0xe826('0x48')]=_0x35f6e8[_0xe826('0x48')][_0xe826('0x4a')]?_0x35f6e8[_0xe826('0x48')]:_0x4ae334[_0xe826('0x43')];if(_0x206762[_0xe826('0x45')][_0xe826('0x57')]){_0x35f6e8[_0xe826('0x58')]=[{'all':!![]}];}_0x35f6e8=_[_0xe826('0x51')]({},_0x35f6e8,_0x206762[_0xe826('0x56')]);return db[_0xe826('0x41')][_0xe826('0x5c')](_0x35f6e8)[_0xe826('0x23')](handleEntityNotFound(_0x40c6bf,null))[_0xe826('0x23')](respondWithResult(_0x40c6bf,null))[_0xe826('0x2e')](handleError(_0x40c6bf,null));};exports[_0xe826('0x5d')]=function(_0x7aec8b,_0x5b06ec){return db[_0xe826('0x41')][_0xe826('0x5d')](_0x7aec8b['body'],{})[_0xe826('0x23')](function(_0x43b088){var _0x2f0228=_0x7aec8b[_0xe826('0x5e')]['get']({'plain':!![]});if(!_0x2f0228)throw new Error(_0xe826('0x5f'));if(_0x2f0228['role']==='user'){var _0xd6a3df=_0x43b088[_0xe826('0x60')]({'plain':!![]});var _0x943aac=_0xe826('0x3b');return db['UserProfileSection']['find']({'where':{'name':_0x943aac,'userProfileId':_0x2f0228[_0xe826('0x61')]},'raw':!![]})[_0xe826('0x23')](function(_0x5c1645){if(_0x5c1645&&_0x5c1645[_0xe826('0x62')]===0x0){return db['UserProfileResource'][_0xe826('0x5d')]({'name':_0xd6a3df[_0xe826('0x63')],'resourceId':_0xd6a3df['id'],'type':_0x5c1645[_0xe826('0x63')],'sectionId':_0x5c1645['id']},{})[_0xe826('0x23')](function(){return _0x43b088;});}else{return _0x43b088;}})[_0xe826('0x2e')](function(_0xc71d13){logger[_0xe826('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc71d13);throw _0xc71d13;});}return _0x43b088;})['then'](respondWithResult(_0x5b06ec,0xc9))['catch'](handleError(_0x5b06ec,null));};exports[_0xe826('0x39')]=function(_0x3398b2,_0x1ae5e9){if(_0x3398b2[_0xe826('0x64')]['id']){delete _0x3398b2[_0xe826('0x64')]['id'];}return db['ChatQueue'][_0xe826('0x5c')]({'where':{'id':_0x3398b2[_0xe826('0x5b')]['id']}})[_0xe826('0x23')](handleEntityNotFound(_0x1ae5e9,null))[_0xe826('0x23')](saveUpdates(_0x3398b2[_0xe826('0x64')],null))[_0xe826('0x23')](respondWithResult(_0x1ae5e9,null))['catch'](handleError(_0x1ae5e9,null));};exports[_0xe826('0x3a')]=function(_0x1172cd,_0x24504e){return db[_0xe826('0x41')][_0xe826('0x5c')]({'where':{'id':_0x1172cd[_0xe826('0x5b')]['id']}})[_0xe826('0x23')](handleEntityNotFound(_0x24504e,null))[_0xe826('0x23')](removeEntity(_0x24504e,null))[_0xe826('0x2e')](handleError(_0x24504e,null));};exports[_0xe826('0x65')]=function(_0x9846cc,_0x51f508){return db[_0xe826('0x41')]['describe']()[_0xe826('0x23')](respondWithResult(_0x51f508,null))[_0xe826('0x2e')](handleError(_0x51f508,null));};exports[_0xe826('0x66')]=function(_0x23cd62,_0x14d2a7,_0x3b6b27){var _0x3dc785={'raw':!![],'where':{}},_0x238043={},_0x34124f;return db['ChatQueue'][_0xe826('0x67')]({'where':{'id':_0x23cd62['params']['id']}})[_0xe826('0x23')](handleEntityNotFound(_0x14d2a7,null))[_0xe826('0x23')](function(_0x17c151){if(_0x17c151){_0x34124f=_0x17c151[_0xe826('0x60')]({'plain':!![]});_0x238043[_0xe826('0x43')]=_[_0xe826('0x44')](db[_0xe826('0x68')][_0xe826('0x42')]);_0x238043[_0xe826('0x45')]=_[_0xe826('0x44')](_0x23cd62[_0xe826('0x45')]);_0x238043[_0xe826('0x46')]=_[_0xe826('0x47')](_0x238043[_0xe826('0x43')],_0x238043[_0xe826('0x45')]);_0x3dc785[_0xe826('0x48')]=_[_0xe826('0x47')](_0x238043['model'],qs[_0xe826('0x49')](_0x23cd62[_0xe826('0x45')][_0xe826('0x49')]));_0x3dc785['attributes']=_0x3dc785[_0xe826('0x48')][_0xe826('0x4a')]?_0x3dc785[_0xe826('0x48')]:_0x238043['model'];if(!_0x23cd62['query']['hasOwnProperty'](_0xe826('0x69'))){_0x3dc785[_0xe826('0x33')]=qs[_0xe826('0x33')](_0x23cd62[_0xe826('0x45')][_0xe826('0x33')]);_0x3dc785['offset']=qs[_0xe826('0x32')](_0x23cd62[_0xe826('0x45')]['offset']);}_0x3dc785['order']=qs[_0xe826('0x4d')](_0x23cd62[_0xe826('0x45')][_0xe826('0x4d')]);_0x3dc785[_0xe826('0x4e')]=qs[_0xe826('0x46')](_['pick'](_0x23cd62[_0xe826('0x45')],_0x238043['filters']));_0x3dc785[_0xe826('0x4e')]['ChatQueueId']=_0x17c151['id'];if(_0x23cd62['query'][_0xe826('0x50')]){_0x3dc785[_0xe826('0x4e')]=_['merge'](_0x3dc785[_0xe826('0x4e')],{'$or':_[_0xe826('0x6a')](_0x3dc785['attributes'],function(_0x4f2840){var _0xf9a7f={};_0xf9a7f[_0x4f2840]={'$like':'%'+_0x23cd62[_0xe826('0x45')][_0xe826('0x50')]+'%'};return _0xf9a7f;})});}_0x3dc785=_[_0xe826('0x51')]({},_0x3dc785,_0x23cd62['options']);return db[_0xe826('0x68')][_0xe826('0x59')](_0x3dc785);}})[_0xe826('0x23')](function(_0xb40a9e){if(_0xb40a9e){return db[_0xe826('0x6b')][_0xe826('0x6c')]({'where':{'id':_[_0xe826('0x6a')](_0xb40a9e,'UserId'),'role':_0xe826('0x6d')},'attributes':['id',_0xe826('0x63'),'chatPause','updatedAt','createdAt']});}})[_0xe826('0x23')](function(_0x1642e1){if(_0x1642e1){return{'count':_0x1642e1[_0xe826('0x31')],'rows':_[_0xe826('0x6a')](_0x1642e1[_0xe826('0x6e')],function(_0x11780d){return{'membername':_0x11780d[_0xe826('0x63')],'UserId':_0x11780d['id'],'queue_name':_0x34124f[_0xe826('0x63')],'ChatQueueId':_0x34124f['id'],'interface':util[_0xe826('0x6f')](_0xe826('0x70'),_0xe826('0x71'),_0x11780d['name']),'penalty':0x0,'paused':_0x11780d[_0xe826('0x72')],'createdAt':_0x11780d[_0xe826('0x73')],'updatedAt':_0x11780d[_0xe826('0x74')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe826('0x23')](respondWithFilteredResult(_0x14d2a7,_0x3dc785))[_0xe826('0x2e')](handleError(_0x14d2a7,null));};exports[_0xe826('0x75')]=function(_0x36cf2f,_0x43eeb8,_0x3f67a7){var _0x2fbf3d={};var _0x497513={};var _0x47b326;var _0x5d6b15;return db[_0xe826('0x41')]['findOne']({'where':{'id':_0x36cf2f[_0xe826('0x5b')]['id']}})['then'](handleEntityNotFound(_0x43eeb8,null))[_0xe826('0x23')](function(_0x43847d){if(_0x43847d){_0x47b326=_0x43847d;_0x497513[_0xe826('0x43')]=_[_0xe826('0x44')](db[_0xe826('0x76')]['rawAttributes']);_0x497513['query']=_['keys'](_0x36cf2f[_0xe826('0x45')]);_0x497513[_0xe826('0x46')]=_[_0xe826('0x47')](_0x497513[_0xe826('0x43')],_0x497513['query']);_0x2fbf3d[_0xe826('0x48')]=_[_0xe826('0x47')](_0x497513[_0xe826('0x43')],qs[_0xe826('0x49')](_0x36cf2f[_0xe826('0x45')][_0xe826('0x49')]));_0x2fbf3d[_0xe826('0x48')]=_0x2fbf3d[_0xe826('0x48')][_0xe826('0x4a')]?_0x2fbf3d[_0xe826('0x48')]:_0x497513[_0xe826('0x43')];_0x2fbf3d['order']=qs[_0xe826('0x4d')](_0x36cf2f['query'][_0xe826('0x4d')]);_0x2fbf3d[_0xe826('0x4e')]=qs[_0xe826('0x46')](_['pick'](_0x36cf2f[_0xe826('0x45')],_0x497513[_0xe826('0x46')]));if(_0x36cf2f[_0xe826('0x45')][_0xe826('0x50')]){_0x2fbf3d[_0xe826('0x4e')]=_[_0xe826('0x51')](_0x2fbf3d[_0xe826('0x4e')],{'$or':_[_0xe826('0x6a')](_0x2fbf3d['attributes'],function(_0x58ecfd){var _0xc285={};_0xc285[_0x58ecfd]={'$like':'%'+_0x36cf2f[_0xe826('0x45')][_0xe826('0x50')]+'%'};return _0xc285;})});}_0x2fbf3d=_[_0xe826('0x51')]({},_0x2fbf3d,_0x36cf2f[_0xe826('0x56')]);return _0x47b326['getTeams'](_0x2fbf3d);}})['then'](function(_0x20ee2e){if(_0x20ee2e){_0x5d6b15=_0x20ee2e[_0xe826('0x4a')];if(!_0x36cf2f[_0xe826('0x45')][_0xe826('0x4b')]('nolimit')){_0x2fbf3d[_0xe826('0x33')]=qs[_0xe826('0x33')](_0x36cf2f[_0xe826('0x45')][_0xe826('0x33')]);_0x2fbf3d['offset']=qs[_0xe826('0x32')](_0x36cf2f[_0xe826('0x45')][_0xe826('0x32')]);}return _0x47b326[_0xe826('0x75')](_0x2fbf3d);}})[_0xe826('0x23')](function(_0x5ba331){if(_0x5ba331){return _0x5ba331?{'count':_0x5d6b15,'rows':_0x5ba331}:null;}})[_0xe826('0x23')](respondWithResult(_0x43eeb8,null))[_0xe826('0x2e')](handleError(_0x43eeb8,null));};exports[_0xe826('0x77')]=function(_0x3b7302,_0x921a87,_0x57e84e){var _0x16159d=_0x3b7302[_0xe826('0x64')]['teams'];return db['Team'][_0xe826('0x59')]({'where':{'id':_[_0xe826('0x6a')](_0x16159d,'id')},'attributes':['id'],'include':[{'model':db[_0xe826('0x6b')],'as':_0xe826('0x78'),'attributes':['id',_0xe826('0x63'),'online','voicePause',_0xe826('0x79')],'raw':!![]}]})[_0xe826('0x23')](function(_0x39aed2){if(_0x39aed2){var _0x4c164b=_[_0xe826('0x7a')](_0x39aed2,function(_0x3a3c7b){var _0x2054f5=_0x3a3c7b[_0xe826('0x60')]({'plain':!![]});return _0x2054f5[_0xe826('0x78')];});return db[_0xe826('0x41')][_0xe826('0x5c')]({'where':{'id':_0x3b7302[_0xe826('0x5b')]['id']}})[_0xe826('0x23')](function(_0x529f4e){return db[_0xe826('0x7b')][_0xe826('0x7c')](function(_0x1ede64){return _0x529f4e[_0xe826('0x77')](_[_0xe826('0x6a')](_0x16159d,'id'),{'transaction':_0x1ede64})[_0xe826('0x23')](function(){return BPromise['each'](_0x4c164b,function(_0x2a9ae5){return db[_0xe826('0x68')][_0xe826('0x7d')]({'where':{'UserId':_0x2a9ae5['id'],'ChatQueueId':_0x3b7302['params']['id']},'transaction':_0x1ede64});});})[_0xe826('0x23')](function(){_0x4c164b[_0xe826('0x7e')](function(_0x2b71a4){socket[_0xe826('0x7f')](_0xe826('0x80'),{'UserId':_0x2b71a4['id'],'ChatQueueId':_0x529f4e['id']});});});});});}})[_0xe826('0x23')](respondWithStatusCode(_0x921a87,null))[_0xe826('0x2e')](handleError(_0x921a87,null));};exports['removeTeams']=function(_0x4b7751,_0x4710a7,_0x2a0fde){return db[_0xe826('0x76')][_0xe826('0x59')]({'where':{'id':_0x4b7751[_0xe826('0x45')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe826('0x6b')],'as':_0xe826('0x78'),'attributes':['id'],'raw':!![]}]})[_0xe826('0x23')](handleEntityNotFound(_0x4710a7,null))['then'](function(_0x45cdcf){var _0x54de87=_[_0xe826('0x6a')](_0x45cdcf,'id');var _0x13a526=[];var _0x3b43c9=[];var _0x1bd8d=squel['select']();_0x1bd8d[_0xe826('0x55')](_0xe826('0x81'))[_0xe826('0x82')](_0xe826('0x83'),'tq')[_0xe826('0x84')](_0xe826('0x85'),'ut',_0xe826('0x86'))['where'](_0xe826('0x87'),_0x4b7751[_0xe826('0x5b')]['id']);for(var _0x1e070c=0x0;_0x1e070c<_0x45cdcf[_0xe826('0x4a')];_0x1e070c+=0x1){let _0x323a83=_0x45cdcf[_0x1e070c];for(var _0x3ebe51=0x0;_0x3ebe51<_0x323a83[_0xe826('0x78')]['length'];_0x3ebe51+=0x1){let _0x3c1d67=_0x323a83[_0xe826('0x78')][_0x3ebe51];var _0x336150=_0x1bd8d[_0xe826('0x88')]();_0x336150[_0xe826('0x4e')](_0xe826('0x89'),_0x3c1d67['id']);_0x3b43c9[_0xe826('0x8a')](db['sequelize']['query'](_0x336150[_0xe826('0x8b')](),{'type':db[_0xe826('0x7b')]['QueryTypes'][_0xe826('0x8c')]})[_0xe826('0x23')](function(_0x33be07){if(_0x33be07[_0xe826('0x4a')]===0x1){return _0x3c1d67['id'];}else{var _0x4202c4=_[_0xe826('0x8d')](_['map'](_0x33be07,_0xe826('0x8e')),function(_0x5e32f8){return _[_0xe826('0x8f')](_0x54de87,_0x5e32f8);});if(_0x4202c4){return _0x3c1d67['id'];}}}));}}return BPromise[_0xe826('0x90')](_0x3b43c9)[_0xe826('0x23')](function(_0x2b4a19){_0x13a526=_(_0x13a526)['union'](_0x2b4a19)['compact']()[_0xe826('0x91')]();return db[_0xe826('0x41')][_0xe826('0x5c')]({'where':{'id':_0x4b7751['params']['id']}})[_0xe826('0x23')](function(_0x557a37){return db[_0xe826('0x7b')][_0xe826('0x7c')](function(_0x1dd874){return _0x557a37[_0xe826('0x92')](_0x4b7751[_0xe826('0x45')][_0xe826('0x93')],{'transaction':_0x1dd874})[_0xe826('0x23')](function(){if(!_[_0xe826('0x94')](_0x13a526)){return _0x557a37['removeAgents'](_0x13a526,{'transaction':_0x1dd874});}})[_0xe826('0x23')](function(){_0x13a526[_0xe826('0x7e')](function(_0x141013){socket[_0xe826('0x7f')]('userChatQueue:remove',{'UserId':_0x141013,'ChatQueueId':_0x557a37['id']});});});});});});})[_0xe826('0x23')](respondWithStatusCode(_0x4710a7,null))[_0xe826('0x2e')](handleError(_0x4710a7,null));};exports[_0xe826('0x95')]=function(_0x41592a,_0x307aca,_0x7f4f9){return db[_0xe826('0x41')][_0xe826('0x5c')]({'where':{'id':_0x41592a['params']['id']}})[_0xe826('0x23')](handleEntityNotFound(_0x307aca,null))[_0xe826('0x23')](function(_0x23a3ca){if(_0x23a3ca){return _0x23a3ca['addAgents'](_0x41592a[_0xe826('0x64')][_0xe826('0x93')],_[_0xe826('0x96')](_0x41592a['body'],['ids','id'])||{})[_0xe826('0x97')](function(_0x2a248f){for(var _0x386e15=0x0;_0x386e15<_0x41592a['body'][_0xe826('0x93')]['length'];_0x386e15+=0x1){socket[_0xe826('0x7f')](_0xe826('0x80'),{'UserId':_0x41592a[_0xe826('0x64')][_0xe826('0x93')][_0x386e15],'ChatQueueId':_0x41592a[_0xe826('0x5b')]['id']});}return _0x2a248f;});}})[_0xe826('0x23')](respondWithResult(_0x307aca,null))['catch'](handleError(_0x307aca,null));};exports[_0xe826('0x98')]=function(_0x4ec080,_0x2a29e5,_0x386580){return db[_0xe826('0x41')][_0xe826('0x5c')]({'where':{'id':_0x4ec080[_0xe826('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2a29e5,null))[_0xe826('0x23')](function(_0x506e23){if(_0x506e23){return _0x506e23[_0xe826('0x98')](_0x4ec080[_0xe826('0x45')][_0xe826('0x93')])[_0xe826('0x23')](function(){if(_[_0xe826('0x99')](_0x4ec080[_0xe826('0x45')][_0xe826('0x93')])){for(var _0x4095b8=0x0;_0x4095b8<_0x4ec080[_0xe826('0x45')][_0xe826('0x93')]['length'];_0x4095b8+=0x1){socket[_0xe826('0x7f')](_0xe826('0x9a'),{'UserId':Number(_0x4ec080['query'][_0xe826('0x93')][_0x4095b8]),'ChatQueueId':Number(_0x4ec080['params']['id'])});}}else{socket['emit'](_0xe826('0x9a'),{'UserId':Number(_0x4ec080[_0xe826('0x45')][_0xe826('0x93')]),'ChatQueueId':Number(_0x4ec080['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2a29e5,null))[_0xe826('0x2e')](handleError(_0x2a29e5,null));};exports[_0xe826('0x9b')]=function(_0x46bc3c,_0x1e8d22,_0x5f1b0a){var _0x4222d2={};var _0x4e5389={};var _0xc13296;var _0x92517b;return db[_0xe826('0x41')][_0xe826('0x67')]({'where':{'id':_0x46bc3c[_0xe826('0x5b')]['id']}})[_0xe826('0x23')](handleEntityNotFound(_0x1e8d22,null))['then'](function(_0x2fc0cf){if(_0x2fc0cf){_0xc13296=_0x2fc0cf;_0x4e5389[_0xe826('0x43')]=_[_0xe826('0x44')](db[_0xe826('0x6b')][_0xe826('0x42')]);_0x4e5389[_0xe826('0x45')]=_[_0xe826('0x44')](_0x46bc3c[_0xe826('0x45')]);_0x4e5389[_0xe826('0x46')]=_[_0xe826('0x47')](_0x4e5389[_0xe826('0x43')],_0x4e5389['query']);_0x4222d2[_0xe826('0x48')]=_[_0xe826('0x47')](_0x4e5389['model'],qs[_0xe826('0x49')](_0x46bc3c[_0xe826('0x45')][_0xe826('0x49')]));_0x4222d2[_0xe826('0x48')]=_0x4222d2[_0xe826('0x48')][_0xe826('0x4a')]?_0x4222d2[_0xe826('0x48')]:_0x4e5389[_0xe826('0x43')];_0x4222d2[_0xe826('0x4c')]=qs[_0xe826('0x4d')](_0x46bc3c[_0xe826('0x45')]['sort']);_0x4222d2[_0xe826('0x4e')]=qs[_0xe826('0x46')](_[_0xe826('0x4f')](_0x46bc3c[_0xe826('0x45')],_0x4e5389[_0xe826('0x46')]));if(_0x46bc3c[_0xe826('0x45')][_0xe826('0x50')]){_0x4222d2[_0xe826('0x4e')]=_['merge'](_0x4222d2[_0xe826('0x4e')],{'$or':_['map'](_0x4222d2[_0xe826('0x48')],function(_0x5a4192){var _0x248d58={};_0x248d58[_0x5a4192]={'$like':'%'+_0x46bc3c['query'][_0xe826('0x50')]+'%'};return _0x248d58;})});}_0x4222d2=_['merge']({},_0x4222d2,_0x46bc3c[_0xe826('0x56')]);return _0xc13296['getAgents'](_0x4222d2);}})[_0xe826('0x23')](function(_0x413c49){if(_0x413c49){_0x92517b=_0x413c49[_0xe826('0x4a')];if(!_0x46bc3c[_0xe826('0x45')][_0xe826('0x4b')]('nolimit')){_0x4222d2[_0xe826('0x33')]=qs[_0xe826('0x33')](_0x46bc3c[_0xe826('0x45')][_0xe826('0x33')]);_0x4222d2[_0xe826('0x32')]=qs[_0xe826('0x32')](_0x46bc3c[_0xe826('0x45')]['offset']);}return _0xc13296[_0xe826('0x9b')](_0x4222d2);}})[_0xe826('0x23')](function(_0x5598d4){if(_0x5598d4){return _0x5598d4?{'count':_0x92517b,'rows':_0x5598d4}:null;}})[_0xe826('0x23')](respondWithResult(_0x1e8d22,null))['catch'](handleError(_0x1e8d22,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 6e4b910..4260238 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 _0x6f7a=['events','../../mysqldb','ChatQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x20a964,_0x1a1da9){_0x20a964=_0x20a964-0x0;var _0x331887=_0x6f7a[_0x20a964];return _0x331887;};'use strict';var EventEmitter=require(_0xa6f7('0x0'));var ChatQueue=require(_0xa6f7('0x1'))['db'][_0xa6f7('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xa6f7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa6f7('0x4'),'afterDestroy':_0xa6f7('0x5')};function emitEvent(_0x12ecb8){return function(_0x1da6dc,_0x22e529,_0x1f5922){ChatQueueEvents[_0xa6f7('0x6')](_0x12ecb8+':'+_0x1da6dc['id'],_0x1da6dc);ChatQueueEvents[_0xa6f7('0x6')](_0x12ecb8,_0x1da6dc);_0x1f5922(null);};}for(var e in events){if(events[_0xa6f7('0x7')](e)){var event=events[e];ChatQueue[_0xa6f7('0x8')](e,emitEvent(event));}}module[_0xa6f7('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0xd914=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x57fa33,_0x2b8222){var _0x12e724=function(_0x481a33){while(--_0x481a33){_0x57fa33['push'](_0x57fa33['shift']());}};_0x12e724(++_0x2b8222);}(_0xd914,0x17f));var _0x4d91=function(_0x3acee8,_0x5f3924){_0x3acee8=_0x3acee8-0x0;var _0x5046cc=_0xd914[_0x3acee8];return _0x5046cc;};'use strict';var EventEmitter=require(_0x4d91('0x0'));var ChatQueue=require(_0x4d91('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4d91('0x2')](0x0);var events={'afterCreate':_0x4d91('0x3'),'afterUpdate':_0x4d91('0x4'),'afterDestroy':_0x4d91('0x5')};function emitEvent(_0xb829cf){return function(_0x2db8c5,_0x4875a2,_0x1b256e){ChatQueueEvents['emit'](_0xb829cf+':'+_0x2db8c5['id'],_0x2db8c5);ChatQueueEvents[_0x4d91('0x6')](_0xb829cf,_0x2db8c5);_0x1b256e(null);};}for(var e in events){if(events[_0x4d91('0x7')](e)){var event=events[e];ChatQueue[_0x4d91('0x8')](e,emitEvent(event));}}module[_0x4d91('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index d7aa43c..742c493 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 _0x12c9=['define','ChatQueue','chat_queues','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x24edfc,_0xc0d024){var _0x42f13f=function(_0x25dfc4){while(--_0x25dfc4){_0x24edfc['push'](_0x24edfc['shift']());}};_0x42f13f(++_0xc0d024);}(_0x12c9,0x9f));var _0x912c=function(_0x44c979,_0x515536){_0x44c979=_0x44c979-0x0;var _0x5242bf=_0x12c9[_0x44c979];return _0x5242bf;};'use strict';var _=require(_0x912c('0x0'));var util=require('util');var logger=require(_0x912c('0x1'))('api');var moment=require(_0x912c('0x2'));var BPromise=require('bluebird');var rp=require(_0x912c('0x3'));var fs=require('fs');var path=require(_0x912c('0x4'));var rimraf=require(_0x912c('0x5'));var config=require(_0x912c('0x6'));var attributes=require(_0x912c('0x7'));module[_0x912c('0x8')]=function(_0x572179,_0x5daa7d){return _0x572179[_0x912c('0x9')](_0x912c('0xa'),attributes,{'tableName':_0x912c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc9d=['./chatQueue.attributes','exports','define','chat_queues','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0xef89d,_0x287047){var _0x23d599=function(_0x20ebad){while(--_0x20ebad){_0xef89d['push'](_0xef89d['shift']());}};_0x23d599(++_0x287047);}(_0xbc9d,0xb4));var _0xdbc9=function(_0xc8a614,_0x511234){_0xc8a614=_0xc8a614-0x0;var _0x2121ae=_0xbc9d[_0xc8a614];return _0x2121ae;};'use strict';var _=require(_0xdbc9('0x0'));var util=require(_0xdbc9('0x1'));var logger=require(_0xdbc9('0x2'))(_0xdbc9('0x3'));var moment=require(_0xdbc9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdbc9('0x5'));var config=require(_0xdbc9('0x6'));var attributes=require(_0xdbc9('0x7'));module[_0xdbc9('0x8')]=function(_0x6ab397,_0x7c4c55){return _0x6ab397[_0xdbc9('0x9')]('ChatQueue',attributes,{'tableName':_0xdbc9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index fd2af8c..da659a3 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 _0x9036=['raw','where','attributes','limit','include','model','then','ShowChatQueue','find','map','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetChatQueue','ChatQueue','findAll','options'];(function(_0x3854f0,_0x4e7fa4){var _0x5cb2a0=function(_0x11331e){while(--_0x11331e){_0x3854f0['push'](_0x3854f0['shift']());}};_0x5cb2a0(++_0x4e7fa4);}(_0x9036,0xf4));var _0x6903=function(_0x29c9f6,_0x29b430){_0x29c9f6=_0x29c9f6-0x0;var _0xfbc70e=_0x9036[_0x29c9f6];return _0xfbc70e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x6903('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6903('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x6903('0x2'));var logger=require(_0x6903('0x3'))(_0x6903('0x4'));var config=require(_0x6903('0x5'));var jayson=require(_0x6903('0x6'));var client=jayson[_0x6903('0x7')][_0x6903('0x8')]({'port':0x232a});config[_0x6903('0x9')]=_['defaults'](config['redis'],{'host':_0x6903('0xa'),'port':0x18eb});var socket=require(_0x6903('0xb'))(new Redis(config[_0x6903('0x9')]));require(_0x6903('0xc'))[_0x6903('0xd')](socket);function respondWithRpcPromise(_0x546c0f,_0x306ad5,_0x513965){return new BPromise(function(_0x33763f,_0x257a11){return client[_0x6903('0xe')](_0x546c0f,_0x513965)['then'](function(_0x3d2511){logger[_0x6903('0xf')](_0x6903('0x10'),_0x306ad5,_0x6903('0x11'));logger[_0x6903('0x12')](_0x6903('0x13'),_0x306ad5,_0x6903('0x11'),JSON[_0x6903('0x14')](_0x3d2511));if(_0x3d2511['error']){if(_0x3d2511[_0x6903('0x15')][_0x6903('0x16')]===0x1f4){logger[_0x6903('0x15')](_0x6903('0x10'),_0x306ad5,_0x3d2511[_0x6903('0x15')][_0x6903('0x17')]);return _0x257a11(_0x3d2511[_0x6903('0x15')][_0x6903('0x17')]);}logger[_0x6903('0x15')](_0x6903('0x10'),_0x306ad5,_0x3d2511[_0x6903('0x15')][_0x6903('0x17')]);return _0x33763f(_0x3d2511[_0x6903('0x15')][_0x6903('0x17')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x306ad5,_0x6903('0x11'));_0x33763f(_0x3d2511['result'][_0x6903('0x17')]);}})[_0x6903('0x18')](function(_0x108f8a){logger[_0x6903('0x15')](_0x6903('0x10'),_0x306ad5,_0x108f8a);_0x257a11(_0x108f8a);});});}exports[_0x6903('0x19')]=function(_0x4b52aa){var _0x4a42a8=this;return new Promise(function(_0x42dff0,_0x4e28cf){return db[_0x6903('0x1a')][_0x6903('0x1b')]({'raw':_0x4b52aa[_0x6903('0x1c')]?_0x4b52aa['options'][_0x6903('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b52aa[_0x6903('0x1c')]?_0x4b52aa['options'][_0x6903('0x1e')]||null:null,'attributes':_0x4b52aa['options']?_0x4b52aa[_0x6903('0x1c')][_0x6903('0x1f')]||null:null,'limit':_0x4b52aa[_0x6903('0x1c')]?_0x4b52aa[_0x6903('0x1c')][_0x6903('0x20')]||null:null,'include':_0x4b52aa[_0x6903('0x1c')]?_0x4b52aa[_0x6903('0x1c')][_0x6903('0x21')]?_['map'](_0x4b52aa['options'][_0x6903('0x21')],function(_0x5ecd61){return{'model':db[_0x5ecd61['model']],'as':_0x5ecd61['as'],'attributes':_0x5ecd61[_0x6903('0x1f')],'include':_0x5ecd61[_0x6903('0x21')]?_['map'](_0x5ecd61[_0x6903('0x21')],function(_0x68f094){return{'model':db[_0x68f094['model']],'as':_0x68f094['as'],'attributes':_0x68f094[_0x6903('0x1f')],'include':_0x68f094[_0x6903('0x21')]?_['map'](_0x68f094[_0x6903('0x21')],function(_0x24740c){return{'model':db[_0x24740c[_0x6903('0x22')]],'as':_0x24740c['as'],'attributes':_0x24740c[_0x6903('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6903('0x23')](function(_0x41c6e4){logger[_0x6903('0xf')]('GetChatQueue',_0x4b52aa);logger['debug'](_0x6903('0x19'),_0x4b52aa,JSON[_0x6903('0x14')](_0x41c6e4));_0x42dff0(_0x41c6e4);})[_0x6903('0x18')](function(_0x455d99){logger['error'](_0x6903('0x19'),_0x455d99[_0x6903('0x17')],_0x4b52aa);_0x4e28cf(_0x4a42a8[_0x6903('0x15')](0x1f4,_0x455d99[_0x6903('0x17')]));});});};exports[_0x6903('0x24')]=function(_0x189504){var _0x2acaf7=this;return new Promise(function(_0x4af093,_0x1b68eb){return db[_0x6903('0x1a')][_0x6903('0x25')]({'raw':_0x189504[_0x6903('0x1c')]?_0x189504['options'][_0x6903('0x1d')]===undefined?!![]:![]:!![],'where':_0x189504[_0x6903('0x1c')]?_0x189504[_0x6903('0x1c')]['where']||null:null,'attributes':_0x189504['options']?_0x189504[_0x6903('0x1c')][_0x6903('0x1f')]||null:null,'include':_0x189504['options']?_0x189504[_0x6903('0x1c')][_0x6903('0x21')]?_[_0x6903('0x26')](_0x189504['options'][_0x6903('0x21')],function(_0x2cf163){return{'model':db[_0x2cf163[_0x6903('0x22')]],'as':_0x2cf163['as'],'attributes':_0x2cf163[_0x6903('0x1f')],'include':_0x2cf163[_0x6903('0x21')]?_[_0x6903('0x26')](_0x2cf163[_0x6903('0x21')],function(_0x3183e7){return{'model':db[_0x3183e7[_0x6903('0x22')]],'as':_0x3183e7['as'],'attributes':_0x3183e7['attributes'],'include':_0x3183e7[_0x6903('0x21')]?_[_0x6903('0x26')](_0x3183e7[_0x6903('0x21')],function(_0x118293){return{'model':db[_0x118293[_0x6903('0x22')]],'as':_0x118293['as'],'attributes':_0x118293[_0x6903('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6903('0x23')](function(_0x695690){logger[_0x6903('0xf')](_0x6903('0x24'),_0x189504);logger['debug']('ShowChatQueue',_0x189504,JSON[_0x6903('0x14')](_0x695690));_0x4af093(_0x695690);})[_0x6903('0x18')](function(_0x3051df){logger[_0x6903('0x15')](_0x6903('0x24'),_0x3051df[_0x6903('0x17')],_0x189504);_0x1b68eb(_0x2acaf7['error'](0x1f4,_0x3051df[_0x6903('0x17')]));});});}; \ No newline at end of file +var _0x4928=['localhost','./chatQueue.socket','register','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','map','include','model','attributes','debug','ShowChatQueue','find','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x1cbf5f,_0x5989c8){var _0x893cc2=function(_0x3f2e63){while(--_0x3f2e63){_0x1cbf5f['push'](_0x1cbf5f['shift']());}};_0x893cc2(++_0x5989c8);}(_0x4928,0x1a1));var _0x8492=function(_0x41b94a,_0x1c704a){_0x41b94a=_0x41b94a-0x0;var _0x3a2168=_0x4928[_0x41b94a];return _0x3a2168;};'use strict';var _=require(_0x8492('0x0'));var util=require(_0x8492('0x1'));var moment=require('moment');var BPromise=require(_0x8492('0x2'));var rs=require(_0x8492('0x3'));var fs=require('fs');var Redis=require(_0x8492('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8492('0x5'))(_0x8492('0x6'));var config=require(_0x8492('0x7'));var jayson=require(_0x8492('0x8'));var client=jayson[_0x8492('0x9')]['http']({'port':0x232a});config[_0x8492('0xa')]=_[_0x8492('0xb')](config[_0x8492('0xa')],{'host':_0x8492('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8492('0xa')]));require(_0x8492('0xd'))[_0x8492('0xe')](socket);function respondWithRpcPromise(_0x30879e,_0x3b0fe2,_0x559565){return new BPromise(function(_0x2fe6fc,_0x8079de){return client['request'](_0x30879e,_0x559565)[_0x8492('0xf')](function(_0x1f6c1e){logger['info'](_0x8492('0x10'),_0x3b0fe2,_0x8492('0x11'));logger['debug'](_0x8492('0x12'),_0x3b0fe2,_0x8492('0x11'),JSON[_0x8492('0x13')](_0x1f6c1e));if(_0x1f6c1e[_0x8492('0x14')]){if(_0x1f6c1e[_0x8492('0x14')][_0x8492('0x15')]===0x1f4){logger[_0x8492('0x14')](_0x8492('0x10'),_0x3b0fe2,_0x1f6c1e[_0x8492('0x14')]['message']);return _0x8079de(_0x1f6c1e[_0x8492('0x14')][_0x8492('0x16')]);}logger[_0x8492('0x14')](_0x8492('0x10'),_0x3b0fe2,_0x1f6c1e[_0x8492('0x14')][_0x8492('0x16')]);return _0x2fe6fc(_0x1f6c1e[_0x8492('0x14')][_0x8492('0x16')]);}else{logger[_0x8492('0x17')](_0x8492('0x10'),_0x3b0fe2,_0x8492('0x11'));_0x2fe6fc(_0x1f6c1e['result'][_0x8492('0x16')]);}})[_0x8492('0x18')](function(_0x34333c){logger['error']('ChatQueue,\x20%s,\x20%s',_0x3b0fe2,_0x34333c);_0x8079de(_0x34333c);});});}exports[_0x8492('0x19')]=function(_0x524a58){var _0x5229a8=this;return new Promise(function(_0x1748df,_0x20c463){return db[_0x8492('0x1a')][_0x8492('0x1b')]({'raw':_0x524a58[_0x8492('0x1c')]?_0x524a58[_0x8492('0x1c')][_0x8492('0x1d')]===undefined?!![]:![]:!![],'where':_0x524a58['options']?_0x524a58[_0x8492('0x1c')][_0x8492('0x1e')]||null:null,'attributes':_0x524a58[_0x8492('0x1c')]?_0x524a58[_0x8492('0x1c')]['attributes']||null:null,'limit':_0x524a58[_0x8492('0x1c')]?_0x524a58['options'][_0x8492('0x1f')]||null:null,'include':_0x524a58['options']?_0x524a58[_0x8492('0x1c')]['include']?_[_0x8492('0x20')](_0x524a58[_0x8492('0x1c')][_0x8492('0x21')],function(_0x211ca2){return{'model':db[_0x211ca2[_0x8492('0x22')]],'as':_0x211ca2['as'],'attributes':_0x211ca2[_0x8492('0x23')],'include':_0x211ca2[_0x8492('0x21')]?_[_0x8492('0x20')](_0x211ca2[_0x8492('0x21')],function(_0x2c7383){return{'model':db[_0x2c7383['model']],'as':_0x2c7383['as'],'attributes':_0x2c7383[_0x8492('0x23')],'include':_0x2c7383[_0x8492('0x21')]?_[_0x8492('0x20')](_0x2c7383[_0x8492('0x21')],function(_0x3e34cb){return{'model':db[_0x3e34cb[_0x8492('0x22')]],'as':_0x3e34cb['as'],'attributes':_0x3e34cb['attributes']};}):[]};}):[]};}):[]:[]})[_0x8492('0xf')](function(_0x9019df){logger['info'](_0x8492('0x19'),_0x524a58);logger[_0x8492('0x24')](_0x8492('0x19'),_0x524a58,JSON[_0x8492('0x13')](_0x9019df));_0x1748df(_0x9019df);})[_0x8492('0x18')](function(_0x240a53){logger[_0x8492('0x14')](_0x8492('0x19'),_0x240a53['message'],_0x524a58);_0x20c463(_0x5229a8[_0x8492('0x14')](0x1f4,_0x240a53[_0x8492('0x16')]));});});};exports[_0x8492('0x25')]=function(_0xf7a73b){var _0x3e2e6b=this;return new Promise(function(_0x5e5cd4,_0x434b0b){return db[_0x8492('0x1a')][_0x8492('0x26')]({'raw':_0xf7a73b[_0x8492('0x1c')]?_0xf7a73b[_0x8492('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xf7a73b[_0x8492('0x1c')]?_0xf7a73b[_0x8492('0x1c')][_0x8492('0x1e')]||null:null,'attributes':_0xf7a73b[_0x8492('0x1c')]?_0xf7a73b[_0x8492('0x1c')]['attributes']||null:null,'include':_0xf7a73b[_0x8492('0x1c')]?_0xf7a73b[_0x8492('0x1c')][_0x8492('0x21')]?_['map'](_0xf7a73b[_0x8492('0x1c')]['include'],function(_0x1200bc){return{'model':db[_0x1200bc[_0x8492('0x22')]],'as':_0x1200bc['as'],'attributes':_0x1200bc[_0x8492('0x23')],'include':_0x1200bc[_0x8492('0x21')]?_['map'](_0x1200bc['include'],function(_0x1701fd){return{'model':db[_0x1701fd[_0x8492('0x22')]],'as':_0x1701fd['as'],'attributes':_0x1701fd[_0x8492('0x23')],'include':_0x1701fd['include']?_['map'](_0x1701fd[_0x8492('0x21')],function(_0x488078){return{'model':db[_0x488078['model']],'as':_0x488078['as'],'attributes':_0x488078[_0x8492('0x23')]};}):[]};}):[]};}):[]:[]})[_0x8492('0xf')](function(_0x3fc248){logger[_0x8492('0x17')](_0x8492('0x25'),_0xf7a73b);logger[_0x8492('0x24')](_0x8492('0x25'),_0xf7a73b,JSON[_0x8492('0x13')](_0x3fc248));_0x5e5cd4(_0x3fc248);})[_0x8492('0x18')](function(_0x53f2b8){logger['error'](_0x8492('0x25'),_0x53f2b8[_0x8492('0x16')],_0xf7a73b);_0x434b0b(_0x3e2e6b[_0x8492('0x14')](0x1f4,_0x53f2b8['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 1b49d17..4712162 100644 --- a/server/api/chatQueue/chatQueue.socket.js +++ b/server/api/chatQueue/chatQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','chatQueue:','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var ChatQueueEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){ChatQueueEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','chatQueue:','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var ChatQueueEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){ChatQueueEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index b4cfe8b..554c8ca 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 _0xefbe=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addAgents','/:id','delete','destroy','removeAgents','multer','path','connect-timeout'];(function(_0x456032,_0x1a799d){var _0x1a53cd=function(_0x162cc8){while(--_0x162cc8){_0x456032['push'](_0x456032['shift']());}};_0x1a53cd(++_0x1a799d);}(_0xefbe,0xb3));var _0xeefb=function(_0x5b2701,_0x4241d1){_0x5b2701=_0x5b2701-0x0;var _0x19a2b8=_0xefbe[_0x5b2701];return _0x19a2b8;};'use strict';var multer=require(_0xeefb('0x0'));var util=require('util');var path=require(_0xeefb('0x1'));var timeout=require(_0xeefb('0x2'));var express=require(_0xeefb('0x3'));var router=express[_0xeefb('0x4')]();var auth=require(_0xeefb('0x5'));var interaction=require(_0xeefb('0x6'));var config=require(_0xeefb('0x7'));var controller=require('./chatQueue.controller');router[_0xeefb('0x8')]('/',auth[_0xeefb('0x9')](),controller[_0xeefb('0xa')]);router[_0xeefb('0x8')](_0xeefb('0xb'),auth[_0xeefb('0x9')](),controller[_0xeefb('0xc')]);router[_0xeefb('0x8')]('/:id',auth[_0xeefb('0x9')](),controller[_0xeefb('0xd')]);router[_0xeefb('0x8')]('/:id/members',auth['isAuthenticated'](),controller[_0xeefb('0xe')]);router['get']('/:id/teams',auth[_0xeefb('0x9')](),controller[_0xeefb('0xf')]);router['get'](_0xeefb('0x10'),auth['isAuthenticated'](),controller[_0xeefb('0x11')]);router[_0xeefb('0x12')]('/',auth['isAuthenticated'](),controller[_0xeefb('0x13')]);router['post'](_0xeefb('0x14'),auth['isAuthenticated'](),controller['addTeams']);router[_0xeefb('0x12')](_0xeefb('0x10'),auth[_0xeefb('0x9')](),controller[_0xeefb('0x15')]);router['put'](_0xeefb('0x16'),auth[_0xeefb('0x9')](),controller['update']);router[_0xeefb('0x17')](_0xeefb('0x16'),auth[_0xeefb('0x9')](),controller[_0xeefb('0x18')]);router[_0xeefb('0x17')](_0xeefb('0x14'),auth[_0xeefb('0x9')](),controller['removeTeams']);router[_0xeefb('0x17')](_0xeefb('0x10'),auth[_0xeefb('0x9')](),controller[_0xeefb('0x19')]);module['exports']=router; \ No newline at end of file +var _0x0e3b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeAgents','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x5973cf,_0x2d2002){var _0x2a1d23=function(_0x37f24d){while(--_0x37f24d){_0x5973cf['push'](_0x5973cf['shift']());}};_0x2a1d23(++_0x2d2002);}(_0x0e3b,0xa6));var _0xb0e3=function(_0x59b1d7,_0x72689){_0x59b1d7=_0x59b1d7-0x0;var _0x270e97=_0x0e3b[_0x59b1d7];return _0x270e97;};'use strict';var multer=require('multer');var util=require(_0xb0e3('0x0'));var path=require(_0xb0e3('0x1'));var timeout=require(_0xb0e3('0x2'));var express=require(_0xb0e3('0x3'));var router=express['Router']();var auth=require(_0xb0e3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb0e3('0x5'));var controller=require(_0xb0e3('0x6'));router[_0xb0e3('0x7')]('/',auth[_0xb0e3('0x8')](),controller[_0xb0e3('0x9')]);router[_0xb0e3('0x7')](_0xb0e3('0xa'),auth[_0xb0e3('0x8')](),controller[_0xb0e3('0xb')]);router['get'](_0xb0e3('0xc'),auth[_0xb0e3('0x8')](),controller[_0xb0e3('0xd')]);router[_0xb0e3('0x7')](_0xb0e3('0xe'),auth[_0xb0e3('0x8')](),controller[_0xb0e3('0xf')]);router[_0xb0e3('0x7')](_0xb0e3('0x10'),auth['isAuthenticated'](),controller[_0xb0e3('0x11')]);router[_0xb0e3('0x7')](_0xb0e3('0x12'),auth[_0xb0e3('0x8')](),controller[_0xb0e3('0x13')]);router[_0xb0e3('0x14')]('/',auth[_0xb0e3('0x8')](),controller[_0xb0e3('0x15')]);router[_0xb0e3('0x14')](_0xb0e3('0x10'),auth[_0xb0e3('0x8')](),controller[_0xb0e3('0x16')]);router['post'](_0xb0e3('0x12'),auth[_0xb0e3('0x8')](),controller[_0xb0e3('0x17')]);router[_0xb0e3('0x18')](_0xb0e3('0xc'),auth['isAuthenticated'](),controller[_0xb0e3('0x19')]);router[_0xb0e3('0x1a')](_0xb0e3('0xc'),auth[_0xb0e3('0x8')](),controller[_0xb0e3('0x1b')]);router[_0xb0e3('0x1a')](_0xb0e3('0x10'),auth[_0xb0e3('0x8')](),controller['removeTeams']);router[_0xb0e3('0x1a')](_0xb0e3('0x12'),auth[_0xb0e3('0x8')](),controller[_0xb0e3('0x1c')]);module[_0xb0e3('0x1d')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 66362df..0af7698 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 _0x42aa=['exports','STRING','DATE','moment','sequelize'];(function(_0x3ba938,_0x27414d){var _0x2aabff=function(_0x10709c){while(--_0x10709c){_0x3ba938['push'](_0x3ba938['shift']());}};_0x2aabff(++_0x27414d);}(_0x42aa,0x80));var _0xa42a=function(_0x4584b7,_0x396a41){_0x4584b7=_0x4584b7-0x0;var _0x2bbf5c=_0x42aa[_0x4584b7];return _0x2bbf5c;};'use strict';var moment=require(_0xa42a('0x0'));var Sequelize=require(_0xa42a('0x1'));module[_0xa42a('0x2')]={'uniqueid':{'type':Sequelize[_0xa42a('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xa42a('0x4')]},'leaveAt':{'type':Sequelize[_0xa42a('0x4')]},'acceptAt':{'type':Sequelize[_0xa42a('0x4')]},'exitAt':{'type':Sequelize[_0xa42a('0x4')]},'reason':{'type':Sequelize[_0xa42a('0x3')]}}; \ No newline at end of file +var _0x413b=['sequelize','STRING','DATE','moment'];(function(_0x20203c,_0x40c580){var _0x418860=function(_0x428f00){while(--_0x428f00){_0x20203c['push'](_0x20203c['shift']());}};_0x418860(++_0x40c580);}(_0x413b,0x1f3));var _0xb413=function(_0x5a18fc,_0xb1a4aa){_0x5a18fc=_0x5a18fc-0x0;var _0x57b441=_0x413b[_0x5a18fc];return _0x57b441;};'use strict';var moment=require(_0xb413('0x0'));var Sequelize=require(_0xb413('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xb413('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xb413('0x2')]},'joinAt':{'type':Sequelize[_0xb413('0x3')]},'leaveAt':{'type':Sequelize[_0xb413('0x3')]},'acceptAt':{'type':Sequelize[_0xb413('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xb413('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 1eab45f..01ecff8 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 _0xa768=['create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','ChatQueueReport','findAll','rows','catch','show','params','include','find'];(function(_0x54f5ca,_0x3e2689){var _0x4b115d=function(_0x44d2c6){while(--_0x44d2c6){_0x54f5ca['push'](_0x54f5ca['shift']());}};_0x4b115d(++_0x3e2689);}(_0xa768,0x93));var _0x8a76=function(_0x522fa8,_0x15eba3){_0x522fa8=_0x522fa8-0x0;var _0x2d1f6c=_0xa768[_0x522fa8];return _0x2d1f6c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8a76('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8a76('0x1'));var rp=require(_0x8a76('0x2'));var moment=require(_0x8a76('0x3'));var BPromise=require(_0x8a76('0x4'));var Mustache=require(_0x8a76('0x5'));var util=require('util');var path=require('path');var sox=require(_0x8a76('0x6'));var csv=require(_0x8a76('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8a76('0x8'));var squel=require(_0x8a76('0x9'));var crypto=require(_0x8a76('0xa'));var jsforce=require(_0x8a76('0xb'));var deskjs=require(_0x8a76('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8a76('0xd'));var Papa=require(_0x8a76('0xe'));var Redis=require(_0x8a76('0xf'));var authService=require(_0x8a76('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a76('0x11'))(_0x8a76('0x12'));var utils=require(_0x8a76('0x13'));var config=require(_0x8a76('0x14'));var db=require(_0x8a76('0x15'))['db'];function respondWithStatusCode(_0x27b618,_0x567afb){_0x567afb=_0x567afb||0xcc;return function(_0x4fa455){if(_0x4fa455){return _0x27b618[_0x8a76('0x16')](_0x567afb);}return _0x27b618[_0x8a76('0x17')](_0x567afb)[_0x8a76('0x18')]();};}function respondWithResult(_0x30baed,_0x5da1d2){_0x5da1d2=_0x5da1d2||0xc8;return function(_0x16a0c0){if(_0x16a0c0){return _0x30baed[_0x8a76('0x17')](_0x5da1d2)[_0x8a76('0x19')](_0x16a0c0);}};}function respondWithFilteredResult(_0x101980,_0xc19389){return function(_0x3233ff){if(_0x3233ff){var _0x29364e=_0x3233ff[_0x8a76('0x1a')],_0x51502d=_0xc19389[_0x8a76('0x1b')],_0x2893db=_0xc19389[_0x8a76('0x1b')]+_0xc19389[_0x8a76('0x1c')],_0x2b4ff1;if(_0x2893db>=_0x29364e){_0x2893db=_0x29364e;_0x2b4ff1=0xc8;}else{_0x2b4ff1=0xce;}_0x101980[_0x8a76('0x17')](_0x2b4ff1);return _0x101980[_0x8a76('0x1d')](_0x8a76('0x1e'),_0x51502d+'-'+_0x2893db+'/'+_0x29364e)[_0x8a76('0x19')](_0x3233ff);}return null;};}function patchUpdates(_0x57f910){return function(_0x2b0f55){try{jsonpatch[_0x8a76('0x1f')](_0x2b0f55,_0x57f910,!![]);}catch(_0x5cecc9){return BPromise[_0x8a76('0x20')](_0x5cecc9);}return _0x2b0f55['save']();};}function saveUpdates(_0x4bd564,_0x295f22){return function(_0x27760f){if(_0x27760f){return _0x27760f[_0x8a76('0x21')](_0x4bd564)[_0x8a76('0x22')](function(_0x1c9637){return _0x1c9637;});}return null;};}function removeEntity(_0x3d6bb6,_0x1a8b0a){return function(_0x351ffc){if(_0x351ffc){return _0x351ffc[_0x8a76('0x23')]()[_0x8a76('0x22')](function(){_0x3d6bb6[_0x8a76('0x17')](0xcc)[_0x8a76('0x18')]();});}};}function handleEntityNotFound(_0x47245f,_0x57dbdd){return function(_0x4e5d23){if(!_0x4e5d23){_0x47245f[_0x8a76('0x16')](0x194);}return _0x4e5d23;};}function handleError(_0x523f3e,_0x4af3b2){_0x4af3b2=_0x4af3b2||0x1f4;return function(_0x4c3a56){logger[_0x8a76('0x24')](_0x4c3a56[_0x8a76('0x25')]);if(_0x4c3a56['name']){delete _0x4c3a56[_0x8a76('0x26')];}_0x523f3e[_0x8a76('0x17')](_0x4af3b2)[_0x8a76('0x27')](_0x4c3a56);};}exports['index']=function(_0x346577,_0x32c520){var _0x1b98e4={},_0x534ddb={},_0x479e7c={'count':0x0,'rows':[]};var _0x4d6eb7=db['ChatQueueReport'][_0x8a76('0x28')];_0x534ddb['model']=_[_0x8a76('0x29')](_0x4d6eb7);_0x534ddb[_0x8a76('0x2a')]=_[_0x8a76('0x29')](_0x346577[_0x8a76('0x2a')]);_0x534ddb[_0x8a76('0x2b')]=_[_0x8a76('0x2c')](_0x534ddb[_0x8a76('0x2d')],_0x534ddb['query']);_0x1b98e4['attributes']=_[_0x8a76('0x2c')](_0x534ddb[_0x8a76('0x2d')],qs[_0x8a76('0x2e')](_0x346577[_0x8a76('0x2a')][_0x8a76('0x2e')]));_0x1b98e4[_0x8a76('0x2f')]=_0x1b98e4[_0x8a76('0x2f')][_0x8a76('0x30')]?_0x1b98e4[_0x8a76('0x2f')]:_0x534ddb[_0x8a76('0x2d')];if(!_0x346577[_0x8a76('0x2a')][_0x8a76('0x31')]('nolimit')){_0x1b98e4['limit']=qs[_0x8a76('0x1c')](_0x346577['query'][_0x8a76('0x1c')]);_0x1b98e4[_0x8a76('0x1b')]=qs[_0x8a76('0x1b')](_0x346577[_0x8a76('0x2a')][_0x8a76('0x1b')]);}_0x1b98e4[_0x8a76('0x32')]=qs['sort'](_0x346577['query'][_0x8a76('0x33')]);_0x1b98e4[_0x8a76('0x34')]=qs[_0x8a76('0x2b')](_[_0x8a76('0x35')](_0x346577['query'],_0x534ddb[_0x8a76('0x2b')]));if(_0x346577[_0x8a76('0x2a')][_0x8a76('0x36')]){_0x1b98e4[_0x8a76('0x34')]=_[_0x8a76('0x37')](_0x1b98e4[_0x8a76('0x34')],{'$or':_[_0x8a76('0x38')](_0x4d6eb7,function(_0x598f36){if(_0x598f36[_0x8a76('0x39')][_0x8a76('0x3a')]!==_0x8a76('0x3b')){var _0xd16f1d={};_0xd16f1d[_0x598f36['field']]={'$like':'%'+_0x346577[_0x8a76('0x2a')][_0x8a76('0x36')]+'%'};return _0xd16f1d;}})});}_0x1b98e4=_['merge']({},_0x1b98e4,_0x346577[_0x8a76('0x3c')]);var _0x4bb048={'where':_0x1b98e4['where']};return db[_0x8a76('0x3d')][_0x8a76('0x1a')](_0x4bb048)['then'](function(_0x10a087){_0x479e7c[_0x8a76('0x1a')]=_0x10a087;if(_0x346577[_0x8a76('0x2a')]['includeAll']){_0x1b98e4['include']=[{'all':!![]}];}return db[_0x8a76('0x3d')][_0x8a76('0x3e')](_0x1b98e4);})[_0x8a76('0x22')](function(_0x2a853e){_0x479e7c[_0x8a76('0x3f')]=_0x2a853e;return _0x479e7c;})[_0x8a76('0x22')](respondWithFilteredResult(_0x32c520,_0x1b98e4))[_0x8a76('0x40')](handleError(_0x32c520,null));};exports[_0x8a76('0x41')]=function(_0x767fe3,_0x340505){var _0x709ed7={'raw':!![],'where':{'id':_0x767fe3[_0x8a76('0x42')]['id']}},_0x468993={};_0x468993['model']=_['keys'](db['ChatQueueReport']['rawAttributes']);_0x468993['query']=_[_0x8a76('0x29')](_0x767fe3[_0x8a76('0x2a')]);_0x468993[_0x8a76('0x2b')]=_[_0x8a76('0x2c')](_0x468993[_0x8a76('0x2d')],_0x468993[_0x8a76('0x2a')]);_0x709ed7[_0x8a76('0x2f')]=_[_0x8a76('0x2c')](_0x468993[_0x8a76('0x2d')],qs[_0x8a76('0x2e')](_0x767fe3[_0x8a76('0x2a')]['fields']));_0x709ed7[_0x8a76('0x2f')]=_0x709ed7[_0x8a76('0x2f')][_0x8a76('0x30')]?_0x709ed7[_0x8a76('0x2f')]:_0x468993[_0x8a76('0x2d')];if(_0x767fe3['query']['includeAll']){_0x709ed7[_0x8a76('0x43')]=[{'all':!![]}];}_0x709ed7=_[_0x8a76('0x37')]({},_0x709ed7,_0x767fe3[_0x8a76('0x3c')]);return db[_0x8a76('0x3d')][_0x8a76('0x44')](_0x709ed7)[_0x8a76('0x22')](handleEntityNotFound(_0x340505,null))['then'](respondWithResult(_0x340505,null))[_0x8a76('0x40')](handleError(_0x340505,null));};exports['create']=function(_0x763e7a,_0x4b5ed1){return db['ChatQueueReport'][_0x8a76('0x45')](_0x763e7a[_0x8a76('0x46')],{})['then'](respondWithResult(_0x4b5ed1,0xc9))[_0x8a76('0x40')](handleError(_0x4b5ed1,null));};exports[_0x8a76('0x21')]=function(_0x337da8,_0xbba01f){if(_0x337da8[_0x8a76('0x46')]['id']){delete _0x337da8[_0x8a76('0x46')]['id'];}return db[_0x8a76('0x3d')]['find']({'where':{'id':_0x337da8[_0x8a76('0x42')]['id']}})[_0x8a76('0x22')](handleEntityNotFound(_0xbba01f,null))[_0x8a76('0x22')](saveUpdates(_0x337da8['body'],null))['then'](respondWithResult(_0xbba01f,null))[_0x8a76('0x40')](handleError(_0xbba01f,null));};exports[_0x8a76('0x23')]=function(_0x3def36,_0x4ce2ff){return db[_0x8a76('0x3d')][_0x8a76('0x44')]({'where':{'id':_0x3def36[_0x8a76('0x42')]['id']}})[_0x8a76('0x22')](handleEntityNotFound(_0x4ce2ff,null))[_0x8a76('0x22')](removeEntity(_0x4ce2ff,null))[_0x8a76('0x40')](handleError(_0x4ce2ff,null));};exports[_0x8a76('0x47')]=function(_0x558f06,_0x55e33e){return db[_0x8a76('0x3d')][_0x8a76('0x47')]()[_0x8a76('0x22')](respondWithResult(_0x55e33e,null))[_0x8a76('0x40')](handleError(_0x55e33e,null));}; \ No newline at end of file +var _0xfa3d=['type','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','length','create','body','update','find','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../mysqldb','status','json','count','offset','limit','Content-Range','apply','save','then','destroy','end','sendStatus','stack','name','send','index','ChatQueueReport','model','keys','query','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x475741,_0x30bf38){var _0x4e34ec=function(_0x2e91c9){while(--_0x2e91c9){_0x475741['push'](_0x475741['shift']());}};_0x4e34ec(++_0x30bf38);}(_0xfa3d,0x9d));var _0xdfa3=function(_0x368fbb,_0x27bf9f){_0x368fbb=_0x368fbb-0x0;var _0x3d74d1=_0xfa3d[_0x368fbb];return _0x3d74d1;};'use strict';var pdf=require(_0xdfa3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdfa3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdfa3('0x2'));var rp=require(_0xdfa3('0x3'));var moment=require(_0xdfa3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdfa3('0x5'));var util=require('util');var path=require(_0xdfa3('0x6'));var sox=require(_0xdfa3('0x7'));var csv=require(_0xdfa3('0x8'));var ejs=require(_0xdfa3('0x9'));var fs=require('fs');var _=require(_0xdfa3('0xa'));var squel=require(_0xdfa3('0xb'));var crypto=require(_0xdfa3('0xc'));var jsforce=require(_0xdfa3('0xd'));var deskjs=require(_0xdfa3('0xe'));var toCsv=require(_0xdfa3('0x8'));var querystring=require(_0xdfa3('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdfa3('0x10'));var qs=require(_0xdfa3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xdfa3('0x12'));var db=require(_0xdfa3('0x13'))['db'];function respondWithStatusCode(_0x84cb36,_0x2768d7){_0x2768d7=_0x2768d7||0xcc;return function(_0x40446b){if(_0x40446b){return _0x84cb36['sendStatus'](_0x2768d7);}return _0x84cb36[_0xdfa3('0x14')](_0x2768d7)['end']();};}function respondWithResult(_0x5982d9,_0x35ca66){_0x35ca66=_0x35ca66||0xc8;return function(_0x5c7fa1){if(_0x5c7fa1){return _0x5982d9[_0xdfa3('0x14')](_0x35ca66)[_0xdfa3('0x15')](_0x5c7fa1);}};}function respondWithFilteredResult(_0x4cbe2b,_0x442882){return function(_0x25de5f){if(_0x25de5f){var _0x15232f=_0x25de5f[_0xdfa3('0x16')],_0x39ef56=_0x442882[_0xdfa3('0x17')],_0x332055=_0x442882[_0xdfa3('0x17')]+_0x442882[_0xdfa3('0x18')],_0x113c9a;if(_0x332055>=_0x15232f){_0x332055=_0x15232f;_0x113c9a=0xc8;}else{_0x113c9a=0xce;}_0x4cbe2b[_0xdfa3('0x14')](_0x113c9a);return _0x4cbe2b['set'](_0xdfa3('0x19'),_0x39ef56+'-'+_0x332055+'/'+_0x15232f)[_0xdfa3('0x15')](_0x25de5f);}return null;};}function patchUpdates(_0x2d91f6){return function(_0x51ee97){try{jsonpatch[_0xdfa3('0x1a')](_0x51ee97,_0x2d91f6,!![]);}catch(_0x424c38){return BPromise['reject'](_0x424c38);}return _0x51ee97[_0xdfa3('0x1b')]();};}function saveUpdates(_0x18fdad,_0x2813b4){return function(_0x79cf1a){if(_0x79cf1a){return _0x79cf1a['update'](_0x18fdad)[_0xdfa3('0x1c')](function(_0x4d0468){return _0x4d0468;});}return null;};}function removeEntity(_0x1fe84c,_0x54e1d5){return function(_0x4557f6){if(_0x4557f6){return _0x4557f6[_0xdfa3('0x1d')]()[_0xdfa3('0x1c')](function(){_0x1fe84c['status'](0xcc)[_0xdfa3('0x1e')]();});}};}function handleEntityNotFound(_0x39f1fe,_0x1bdc3c){return function(_0x4ee0d6){if(!_0x4ee0d6){_0x39f1fe[_0xdfa3('0x1f')](0x194);}return _0x4ee0d6;};}function handleError(_0x1aee78,_0x432a8e){_0x432a8e=_0x432a8e||0x1f4;return function(_0x12ebe0){logger['error'](_0x12ebe0[_0xdfa3('0x20')]);if(_0x12ebe0[_0xdfa3('0x21')]){delete _0x12ebe0['name'];}_0x1aee78[_0xdfa3('0x14')](_0x432a8e)[_0xdfa3('0x22')](_0x12ebe0);};}exports[_0xdfa3('0x23')]=function(_0x4c2480,_0x21d6fd){var _0x560bee={},_0x5b5fb2={},_0x5b0a2d={'count':0x0,'rows':[]};var _0x296286=db[_0xdfa3('0x24')]['rawAttributes'];_0x5b5fb2[_0xdfa3('0x25')]=_[_0xdfa3('0x26')](_0x296286);_0x5b5fb2[_0xdfa3('0x27')]=_[_0xdfa3('0x26')](_0x4c2480[_0xdfa3('0x27')]);_0x5b5fb2[_0xdfa3('0x28')]=_[_0xdfa3('0x29')](_0x5b5fb2[_0xdfa3('0x25')],_0x5b5fb2[_0xdfa3('0x27')]);_0x560bee[_0xdfa3('0x2a')]=_['intersection'](_0x5b5fb2[_0xdfa3('0x25')],qs['fields'](_0x4c2480['query']['fields']));_0x560bee['attributes']=_0x560bee[_0xdfa3('0x2a')]['length']?_0x560bee[_0xdfa3('0x2a')]:_0x5b5fb2[_0xdfa3('0x25')];if(!_0x4c2480[_0xdfa3('0x27')][_0xdfa3('0x2b')]('nolimit')){_0x560bee[_0xdfa3('0x18')]=qs['limit'](_0x4c2480['query'][_0xdfa3('0x18')]);_0x560bee[_0xdfa3('0x17')]=qs[_0xdfa3('0x17')](_0x4c2480[_0xdfa3('0x27')][_0xdfa3('0x17')]);}_0x560bee[_0xdfa3('0x2c')]=qs['sort'](_0x4c2480[_0xdfa3('0x27')][_0xdfa3('0x2d')]);_0x560bee[_0xdfa3('0x2e')]=qs[_0xdfa3('0x28')](_[_0xdfa3('0x2f')](_0x4c2480[_0xdfa3('0x27')],_0x5b5fb2[_0xdfa3('0x28')]));if(_0x4c2480['query'][_0xdfa3('0x30')]){_0x560bee['where']=_[_0xdfa3('0x31')](_0x560bee[_0xdfa3('0x2e')],{'$or':_['map'](_0x296286,function(_0xfe1e6e){if(_0xfe1e6e[_0xdfa3('0x32')][_0xdfa3('0x33')]!==_0xdfa3('0x34')){var _0x3fc480={};_0x3fc480[_0xfe1e6e['field']]={'$like':'%'+_0x4c2480[_0xdfa3('0x27')][_0xdfa3('0x30')]+'%'};return _0x3fc480;}})});}_0x560bee=_[_0xdfa3('0x31')]({},_0x560bee,_0x4c2480[_0xdfa3('0x35')]);var _0x4b844a={'where':_0x560bee[_0xdfa3('0x2e')]};return db[_0xdfa3('0x24')][_0xdfa3('0x16')](_0x4b844a)[_0xdfa3('0x1c')](function(_0x4546f8){_0x5b0a2d[_0xdfa3('0x16')]=_0x4546f8;if(_0x4c2480['query'][_0xdfa3('0x36')]){_0x560bee[_0xdfa3('0x37')]=[{'all':!![]}];}return db[_0xdfa3('0x24')][_0xdfa3('0x38')](_0x560bee);})[_0xdfa3('0x1c')](function(_0x1f448e){_0x5b0a2d[_0xdfa3('0x39')]=_0x1f448e;return _0x5b0a2d;})['then'](respondWithFilteredResult(_0x21d6fd,_0x560bee))[_0xdfa3('0x3a')](handleError(_0x21d6fd,null));};exports[_0xdfa3('0x3b')]=function(_0x9052a4,_0x5de122){var _0x46b4f6={'raw':!![],'where':{'id':_0x9052a4[_0xdfa3('0x3c')]['id']}},_0x5de154={};_0x5de154['model']=_['keys'](db[_0xdfa3('0x24')][_0xdfa3('0x3d')]);_0x5de154[_0xdfa3('0x27')]=_['keys'](_0x9052a4[_0xdfa3('0x27')]);_0x5de154[_0xdfa3('0x28')]=_[_0xdfa3('0x29')](_0x5de154[_0xdfa3('0x25')],_0x5de154[_0xdfa3('0x27')]);_0x46b4f6['attributes']=_['intersection'](_0x5de154[_0xdfa3('0x25')],qs[_0xdfa3('0x3e')](_0x9052a4[_0xdfa3('0x27')][_0xdfa3('0x3e')]));_0x46b4f6[_0xdfa3('0x2a')]=_0x46b4f6[_0xdfa3('0x2a')][_0xdfa3('0x3f')]?_0x46b4f6[_0xdfa3('0x2a')]:_0x5de154[_0xdfa3('0x25')];if(_0x9052a4['query'][_0xdfa3('0x36')]){_0x46b4f6[_0xdfa3('0x37')]=[{'all':!![]}];}_0x46b4f6=_[_0xdfa3('0x31')]({},_0x46b4f6,_0x9052a4[_0xdfa3('0x35')]);return db[_0xdfa3('0x24')]['find'](_0x46b4f6)['then'](handleEntityNotFound(_0x5de122,null))[_0xdfa3('0x1c')](respondWithResult(_0x5de122,null))['catch'](handleError(_0x5de122,null));};exports['create']=function(_0x11afab,_0x2eecc4){return db[_0xdfa3('0x24')][_0xdfa3('0x40')](_0x11afab[_0xdfa3('0x41')],{})[_0xdfa3('0x1c')](respondWithResult(_0x2eecc4,0xc9))[_0xdfa3('0x3a')](handleError(_0x2eecc4,null));};exports[_0xdfa3('0x42')]=function(_0x555da1,_0x251e71){if(_0x555da1['body']['id']){delete _0x555da1[_0xdfa3('0x41')]['id'];}return db['ChatQueueReport'][_0xdfa3('0x43')]({'where':{'id':_0x555da1[_0xdfa3('0x3c')]['id']}})[_0xdfa3('0x1c')](handleEntityNotFound(_0x251e71,null))[_0xdfa3('0x1c')](saveUpdates(_0x555da1[_0xdfa3('0x41')],null))[_0xdfa3('0x1c')](respondWithResult(_0x251e71,null))[_0xdfa3('0x3a')](handleError(_0x251e71,null));};exports['destroy']=function(_0x349806,_0x314235){return db[_0xdfa3('0x24')]['find']({'where':{'id':_0x349806['params']['id']}})['then'](handleEntityNotFound(_0x314235,null))[_0xdfa3('0x1c')](removeEntity(_0x314235,null))[_0xdfa3('0x3a')](handleError(_0x314235,null));};exports[_0xdfa3('0x44')]=function(_0x5d2f51,_0x274189){return db[_0xdfa3('0x24')][_0xdfa3('0x44')]()[_0xdfa3('0x1c')](respondWithResult(_0x274189,null))[_0xdfa3('0x3a')](handleError(_0x274189,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 3dbb2a9..e59093d 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 _0x3d59=['../../config/environment','./chatQueueReport.attributes','exports','define','uniqueid','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3d59,0xec));var _0x93d5=function(_0x242559,_0x4b347d){_0x242559=_0x242559-0x0;var _0x4c6b23=_0x3d59[_0x242559];return _0x4c6b23;};'use strict';var _=require('lodash');var util=require(_0x93d5('0x0'));var logger=require(_0x93d5('0x1'))('api');var moment=require(_0x93d5('0x2'));var BPromise=require(_0x93d5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x93d5('0x4'));var rimraf=require(_0x93d5('0x5'));var config=require(_0x93d5('0x6'));var attributes=require(_0x93d5('0x7'));module[_0x93d5('0x8')]=function(_0xab601c,_0x1fcdf2){return _0xab601c[_0x93d5('0x9')]('ChatQueueReport',attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x93d5('0xa'),'fields':[_0x93d5('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xac46=['moment','bluebird','request-promise','path','../../config/environment','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util','../../config/logger','api'];(function(_0x474be4,_0x2bc4fe){var _0x212aad=function(_0x4e9e22){while(--_0x4e9e22){_0x474be4['push'](_0x474be4['shift']());}};_0x212aad(++_0x2bc4fe);}(_0xac46,0x1dd));var _0x6ac4=function(_0x507ee4,_0x46d5ff){_0x507ee4=_0x507ee4-0x0;var _0x3f0ebf=_0xac46[_0x507ee4];return _0x3f0ebf;};'use strict';var _=require(_0x6ac4('0x0'));var util=require(_0x6ac4('0x1'));var logger=require(_0x6ac4('0x2'))(_0x6ac4('0x3'));var moment=require(_0x6ac4('0x4'));var BPromise=require(_0x6ac4('0x5'));var rp=require(_0x6ac4('0x6'));var fs=require('fs');var path=require(_0x6ac4('0x7'));var rimraf=require('rimraf');var config=require(_0x6ac4('0x8'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0xd99f4c,_0x4942eb){return _0xd99f4c[_0x6ac4('0x9')](_0x6ac4('0xa'),attributes,{'tableName':_0x6ac4('0xb'),'paranoid':![],'indexes':[{'name':_0x6ac4('0xc'),'fields':[_0x6ac4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 0eef5aa..fe67246 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 _0xd2c4=['message','info','result','catch','CreateChatQueueReport','create','body','options','raw','update','where','limit','UpdateChatQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3a8cc0,_0x20049c){var _0xc7a314=function(_0x1e8100){while(--_0x1e8100){_0x3a8cc0['push'](_0x3a8cc0['shift']());}};_0xc7a314(++_0x20049c);}(_0xd2c4,0x89));var _0x4d2c=function(_0x26018c,_0x3c0903){_0x26018c=_0x26018c-0x0;var _0x1efc45=_0xd2c4[_0x26018c];return _0x1efc45;};'use strict';var _=require(_0x4d2c('0x0'));var util=require('util');var moment=require(_0x4d2c('0x1'));var BPromise=require(_0x4d2c('0x2'));var rs=require(_0x4d2c('0x3'));var fs=require('fs');var Redis=require(_0x4d2c('0x4'));var db=require(_0x4d2c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4d2c('0x6'))(_0x4d2c('0x7'));var config=require(_0x4d2c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4d2c('0x9')][_0x4d2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa6a35f,_0x390125,_0xea6eaf){return new BPromise(function(_0x3cea55,_0x54a563){return client['request'](_0xa6a35f,_0xea6eaf)[_0x4d2c('0xb')](function(_0x372294){logger['info'](_0x4d2c('0xc'),_0x390125,_0x4d2c('0xd'));logger[_0x4d2c('0xe')](_0x4d2c('0xf'),_0x390125,_0x4d2c('0xd'),JSON[_0x4d2c('0x10')](_0x372294));if(_0x372294[_0x4d2c('0x11')]){if(_0x372294[_0x4d2c('0x11')]['code']===0x1f4){logger[_0x4d2c('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x390125,_0x372294[_0x4d2c('0x11')][_0x4d2c('0x12')]);return _0x54a563(_0x372294[_0x4d2c('0x11')][_0x4d2c('0x12')]);}logger['error'](_0x4d2c('0xc'),_0x390125,_0x372294[_0x4d2c('0x11')][_0x4d2c('0x12')]);return _0x3cea55(_0x372294['error'][_0x4d2c('0x12')]);}else{logger[_0x4d2c('0x13')](_0x4d2c('0xc'),_0x390125,_0x4d2c('0xd'));_0x3cea55(_0x372294[_0x4d2c('0x14')][_0x4d2c('0x12')]);}})[_0x4d2c('0x15')](function(_0x3feb82){logger['error'](_0x4d2c('0xc'),_0x390125,_0x3feb82);_0x54a563(_0x3feb82);});});}exports[_0x4d2c('0x16')]=function(_0x516034){var _0x4388ac=this;return new Promise(function(_0x4582d2,_0x318137){return db['ChatQueueReport'][_0x4d2c('0x17')](_0x516034[_0x4d2c('0x18')],{'raw':_0x516034[_0x4d2c('0x19')]?_0x516034[_0x4d2c('0x19')][_0x4d2c('0x1a')]===undefined?!![]:![]:!![]})[_0x4d2c('0xb')](function(_0x2d20ec){logger[_0x4d2c('0x13')](_0x4d2c('0x16'),_0x516034);logger[_0x4d2c('0xe')](_0x4d2c('0x16'),_0x516034,JSON[_0x4d2c('0x10')](_0x2d20ec));_0x4582d2(_0x2d20ec);})[_0x4d2c('0x15')](function(_0xcc521){logger[_0x4d2c('0x11')](_0x4d2c('0x16'),_0xcc521['message'],_0x516034);_0x318137(_0x4388ac['error'](0x1f4,_0xcc521[_0x4d2c('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x4f302d){var _0x57f359=this;return new Promise(function(_0x5199a7,_0x4bba13){return db['ChatQueueReport'][_0x4d2c('0x1b')](_0x4f302d['body'],{'raw':_0x4f302d[_0x4d2c('0x19')]?_0x4f302d[_0x4d2c('0x19')][_0x4d2c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f302d['options']?_0x4f302d[_0x4d2c('0x19')][_0x4d2c('0x1c')]||null:null,'attributes':_0x4f302d[_0x4d2c('0x19')]?_0x4f302d['options']['attributes']||null:null,'limit':_0x4f302d[_0x4d2c('0x19')]?_0x4f302d[_0x4d2c('0x19')][_0x4d2c('0x1d')]||null:null})[_0x4d2c('0xb')](function(_0x14e265){logger[_0x4d2c('0x13')]('UpdateChatQueueReport',_0x4f302d);logger[_0x4d2c('0xe')](_0x4d2c('0x1e'),_0x4f302d,JSON[_0x4d2c('0x10')](_0x14e265));_0x5199a7(_0x14e265);})[_0x4d2c('0x15')](function(_0x37caa0){logger[_0x4d2c('0x11')]('UpdateChatQueueReport',_0x37caa0[_0x4d2c('0x12')],_0x4f302d);_0x4bba13(_0x57f359[_0x4d2c('0x11')](0x1f4,_0x37caa0[_0x4d2c('0x12')]));});});}; \ No newline at end of file +var _0xfed5=['attributes','limit','catch','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','stringify','UpdateChatQueueReport','update'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xfed5,0x1a7));var _0x5fed=function(_0x502916,_0x121585){_0x502916=_0x502916-0x0;var _0x48b3fe=_0xfed5[_0x502916];return _0x48b3fe;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5fed('0x0'));var rs=require(_0x5fed('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5fed('0x2'));var logger=require('../../config/logger')(_0x5fed('0x3'));var config=require(_0x5fed('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x5fed('0x5')][_0x5fed('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x182e20,_0x471f77,_0x3c79ac){return new BPromise(function(_0x5a5ade,_0x301f16){return client[_0x5fed('0x7')](_0x182e20,_0x3c79ac)[_0x5fed('0x8')](function(_0x409a2a){logger[_0x5fed('0x9')](_0x5fed('0xa'),_0x471f77,_0x5fed('0xb'));logger[_0x5fed('0xc')](_0x5fed('0xd'),_0x471f77,_0x5fed('0xb'),JSON['stringify'](_0x409a2a));if(_0x409a2a[_0x5fed('0xe')]){if(_0x409a2a[_0x5fed('0xe')][_0x5fed('0xf')]===0x1f4){logger[_0x5fed('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x471f77,_0x409a2a[_0x5fed('0xe')]['message']);return _0x301f16(_0x409a2a[_0x5fed('0xe')][_0x5fed('0x10')]);}logger[_0x5fed('0xe')](_0x5fed('0xa'),_0x471f77,_0x409a2a[_0x5fed('0xe')]['message']);return _0x5a5ade(_0x409a2a['error'][_0x5fed('0x10')]);}else{logger[_0x5fed('0x9')](_0x5fed('0xa'),_0x471f77,_0x5fed('0xb'));_0x5a5ade(_0x409a2a[_0x5fed('0x11')]['message']);}})['catch'](function(_0x2e1938){logger[_0x5fed('0xe')](_0x5fed('0xa'),_0x471f77,_0x2e1938);_0x301f16(_0x2e1938);});});}exports[_0x5fed('0x12')]=function(_0x7da639){var _0x109561=this;return new Promise(function(_0x2cad7f,_0x525c0b){return db[_0x5fed('0x13')][_0x5fed('0x14')](_0x7da639[_0x5fed('0x15')],{'raw':_0x7da639[_0x5fed('0x16')]?_0x7da639[_0x5fed('0x16')][_0x5fed('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x511d5b){logger[_0x5fed('0x9')]('CreateChatQueueReport',_0x7da639);logger['debug'](_0x5fed('0x12'),_0x7da639,JSON[_0x5fed('0x18')](_0x511d5b));_0x2cad7f(_0x511d5b);})['catch'](function(_0x4a8c82){logger['error'](_0x5fed('0x12'),_0x4a8c82[_0x5fed('0x10')],_0x7da639);_0x525c0b(_0x109561['error'](0x1f4,_0x4a8c82[_0x5fed('0x10')]));});});};exports[_0x5fed('0x19')]=function(_0x35c9c8){var _0x577820=this;return new Promise(function(_0x30931d,_0x8b5741){return db['ChatQueueReport'][_0x5fed('0x1a')](_0x35c9c8[_0x5fed('0x15')],{'raw':_0x35c9c8[_0x5fed('0x16')]?_0x35c9c8[_0x5fed('0x16')][_0x5fed('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35c9c8[_0x5fed('0x16')]?_0x35c9c8[_0x5fed('0x16')]['where']||null:null,'attributes':_0x35c9c8[_0x5fed('0x16')]?_0x35c9c8[_0x5fed('0x16')][_0x5fed('0x1b')]||null:null,'limit':_0x35c9c8[_0x5fed('0x16')]?_0x35c9c8[_0x5fed('0x16')][_0x5fed('0x1c')]||null:null})[_0x5fed('0x8')](function(_0x1aea0d){logger[_0x5fed('0x9')]('UpdateChatQueueReport',_0x35c9c8);logger[_0x5fed('0xc')]('UpdateChatQueueReport',_0x35c9c8,JSON[_0x5fed('0x18')](_0x1aea0d));_0x30931d(_0x1aea0d);})[_0x5fed('0x1d')](function(_0x5b7b1f){logger[_0x5fed('0xe')]('UpdateChatQueueReport',_0x5b7b1f['message'],_0x35c9c8);_0x8b5741(_0x577820[_0x5fed('0xe')](0x1f4,_0x5b7b1f[_0x5fed('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 1794d82..04dd897 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 _0xde07=['post','put','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x534af9,_0x1fa0a8){var _0x1a79dd=function(_0x257495){while(--_0x257495){_0x534af9['push'](_0x534af9['shift']());}};_0x1a79dd(++_0x1fa0a8);}(_0xde07,0x135));var _0x7de0=function(_0x43f7b1,_0x587bb5){_0x43f7b1=_0x43f7b1-0x0;var _0x54e1e7=_0xde07[_0x43f7b1];return _0x54e1e7;};'use strict';var multer=require(_0x7de0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7de0('0x1'));var express=require(_0x7de0('0x2'));var router=express[_0x7de0('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x7de0('0x4'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0x7de0('0x5')](),controller[_0x7de0('0x6')]);router['get'](_0x7de0('0x7'),auth[_0x7de0('0x5')](),controller[_0x7de0('0x8')]);router['get'](_0x7de0('0x9'),auth[_0x7de0('0x5')](),controller[_0x7de0('0xa')]);router[_0x7de0('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7de0('0xc')](_0x7de0('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x7de0('0xd')](_0x7de0('0x9'),auth['isAuthenticated'](),controller[_0x7de0('0xe')]);module[_0x7de0('0xf')]=router; \ No newline at end of file +var _0x8763=['../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','util','path','connect-timeout','Router'];(function(_0xe51920,_0x4a1092){var _0x4e4c70=function(_0x71151){while(--_0x71151){_0xe51920['push'](_0xe51920['shift']());}};_0x4e4c70(++_0x4a1092);}(_0x8763,0x12c));var _0x3876=function(_0x5658a0,_0x13202f){_0x5658a0=_0x5658a0-0x0;var _0x25b242=_0x8763[_0x5658a0];return _0x25b242;};'use strict';var multer=require('multer');var util=require(_0x3876('0x0'));var path=require(_0x3876('0x1'));var timeout=require(_0x3876('0x2'));var express=require('express');var router=express[_0x3876('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x3876('0x4'));var config=require(_0x3876('0x5'));var controller=require(_0x3876('0x6'));router[_0x3876('0x7')]('/',auth[_0x3876('0x8')](),controller[_0x3876('0x9')]);router[_0x3876('0x7')](_0x3876('0xa'),auth[_0x3876('0x8')](),controller[_0x3876('0xb')]);router[_0x3876('0x7')](_0x3876('0xc'),auth[_0x3876('0x8')](),controller[_0x3876('0xd')]);router['post']('/',auth[_0x3876('0x8')](),controller[_0x3876('0xe')]);router[_0x3876('0xf')](_0x3876('0xc'),auth['isAuthenticated'](),controller[_0x3876('0x10')]);router[_0x3876('0x11')]('/:id',auth[_0x3876('0x8')](),controller[_0x3876('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 7766d9e..f0cb5b8 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 _0x3f26=['sequelize','exports','STRING','ENUM','agent','queue','DATE','NOW','moment'];(function(_0x324a06,_0x1d9a75){var _0x3638bd=function(_0x36f30b){while(--_0x36f30b){_0x324a06['push'](_0x324a06['shift']());}};_0x3638bd(++_0x1d9a75);}(_0x3f26,0xc5));var _0x63f2=function(_0x3aa3cb,_0x794fc2){_0x3aa3cb=_0x3aa3cb-0x0;var _0x5df9dc=_0x3f26[_0x3aa3cb];return _0x5df9dc;};'use strict';var moment=require(_0x63f2('0x0'));var Sequelize=require(_0x63f2('0x1'));module[_0x63f2('0x2')]={'uniqueid':{'type':Sequelize[_0x63f2('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x63f2('0x4')]('account',_0x63f2('0x5'),'queue'),'allowNull':![],'defaultValue':_0x63f2('0x6')},'transferredAt':{'type':Sequelize[_0x63f2('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x63f2('0x8')]}}; \ No newline at end of file +var _0x9877=['sequelize','exports','STRING','ENUM','account','queue','DATE','moment'];(function(_0x54f855,_0x2b1e7b){var _0xad3b69=function(_0x2975c5){while(--_0x2975c5){_0x54f855['push'](_0x54f855['shift']());}};_0xad3b69(++_0x2b1e7b);}(_0x9877,0x107));var _0x7987=function(_0x2ed381,_0x358732){_0x2ed381=_0x2ed381-0x0;var _0xa0bec6=_0x9877[_0x2ed381];return _0xa0bec6;};'use strict';var moment=require(_0x7987('0x0'));var Sequelize=require(_0x7987('0x1'));module[_0x7987('0x2')]={'uniqueid':{'type':Sequelize[_0x7987('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x7987('0x4')](_0x7987('0x5'),'agent',_0x7987('0x6')),'allowNull':![],'defaultValue':_0x7987('0x6')},'transferredAt':{'type':Sequelize[_0x7987('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index ae5cdb0..cb82f88 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 _0xa4bd=['describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','stack','name','rawAttributes','model','keys','query','filters','intersection','fields','attributes','nolimit','sort','where','filter','map','type','key','options','ChatTransferReport','includeAll','include','findAll','catch','show','params','length','merge','find','create','body'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa4bd,0x1e4));var _0xda4b=function(_0x47ab2d,_0x29800e){_0x47ab2d=_0x47ab2d-0x0;var _0x427600=_0xa4bd[_0x47ab2d];return _0x427600;};'use strict';var pdf=require(_0xda4b('0x0'));var emlformat=require(_0xda4b('0x1'));var rimraf=require(_0xda4b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xda4b('0x3'));var rp=require(_0xda4b('0x4'));var moment=require(_0xda4b('0x5'));var BPromise=require(_0xda4b('0x6'));var Mustache=require(_0xda4b('0x7'));var util=require(_0xda4b('0x8'));var path=require(_0xda4b('0x9'));var sox=require(_0xda4b('0xa'));var csv=require(_0xda4b('0xb'));var ejs=require(_0xda4b('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xda4b('0xd'));var crypto=require(_0xda4b('0xe'));var jsforce=require(_0xda4b('0xf'));var deskjs=require(_0xda4b('0x10'));var toCsv=require('to-csv');var querystring=require(_0xda4b('0x11'));var Papa=require(_0xda4b('0x12'));var Redis=require(_0xda4b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xda4b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xda4b('0x15'))(_0xda4b('0x16'));var utils=require(_0xda4b('0x17'));var config=require(_0xda4b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10e0f6,_0x3f8deb){_0x3f8deb=_0x3f8deb||0xcc;return function(_0x2781d3){if(_0x2781d3){return _0x10e0f6[_0xda4b('0x19')](_0x3f8deb);}return _0x10e0f6[_0xda4b('0x1a')](_0x3f8deb)[_0xda4b('0x1b')]();};}function respondWithResult(_0x2952f1,_0xbad9d8){_0xbad9d8=_0xbad9d8||0xc8;return function(_0xb5881c){if(_0xb5881c){return _0x2952f1[_0xda4b('0x1a')](_0xbad9d8)['json'](_0xb5881c);}};}function respondWithFilteredResult(_0x395703,_0x16465f){return function(_0xb7ec2c){if(_0xb7ec2c){var _0x2fb875=_0xb7ec2c[_0xda4b('0x1c')],_0x1a3115=_0x16465f[_0xda4b('0x1d')],_0x12e7fc=_0x16465f[_0xda4b('0x1d')]+_0x16465f[_0xda4b('0x1e')],_0x77efad;if(_0x12e7fc>=_0x2fb875){_0x12e7fc=_0x2fb875;_0x77efad=0xc8;}else{_0x77efad=0xce;}_0x395703[_0xda4b('0x1a')](_0x77efad);return _0x395703['set'](_0xda4b('0x1f'),_0x1a3115+'-'+_0x12e7fc+'/'+_0x2fb875)['json'](_0xb7ec2c);}return null;};}function patchUpdates(_0x5f2744){return function(_0x26b415){try{jsonpatch[_0xda4b('0x20')](_0x26b415,_0x5f2744,!![]);}catch(_0x42834c){return BPromise[_0xda4b('0x21')](_0x42834c);}return _0x26b415[_0xda4b('0x22')]();};}function saveUpdates(_0x5c94de,_0x5869bb){return function(_0x2397de){if(_0x2397de){return _0x2397de[_0xda4b('0x23')](_0x5c94de)['then'](function(_0x2a8425){return _0x2a8425;});}return null;};}function removeEntity(_0x2b3ef4,_0x13f544){return function(_0x56566a){if(_0x56566a){return _0x56566a[_0xda4b('0x24')]()[_0xda4b('0x25')](function(){_0x2b3ef4[_0xda4b('0x1a')](0xcc)[_0xda4b('0x1b')]();});}};}function handleEntityNotFound(_0x1c57ce,_0x318d48){return function(_0x606e86){if(!_0x606e86){_0x1c57ce[_0xda4b('0x19')](0x194);}return _0x606e86;};}function handleError(_0x43e7a0,_0x37f05c){_0x37f05c=_0x37f05c||0x1f4;return function(_0x206431){logger['error'](_0x206431[_0xda4b('0x26')]);if(_0x206431['name']){delete _0x206431[_0xda4b('0x27')];}_0x43e7a0[_0xda4b('0x1a')](_0x37f05c)['send'](_0x206431);};}exports['index']=function(_0x1b03f1,_0x50344f){var _0x2485a7={},_0x26f68d={},_0xde5989={'count':0x0,'rows':[]};var _0x126a6f=db['ChatTransferReport'][_0xda4b('0x28')];_0x26f68d[_0xda4b('0x29')]=_[_0xda4b('0x2a')](_0x126a6f);_0x26f68d['query']=_['keys'](_0x1b03f1[_0xda4b('0x2b')]);_0x26f68d[_0xda4b('0x2c')]=_['intersection'](_0x26f68d[_0xda4b('0x29')],_0x26f68d[_0xda4b('0x2b')]);_0x2485a7['attributes']=_[_0xda4b('0x2d')](_0x26f68d[_0xda4b('0x29')],qs['fields'](_0x1b03f1[_0xda4b('0x2b')][_0xda4b('0x2e')]));_0x2485a7[_0xda4b('0x2f')]=_0x2485a7['attributes']['length']?_0x2485a7[_0xda4b('0x2f')]:_0x26f68d[_0xda4b('0x29')];if(!_0x1b03f1[_0xda4b('0x2b')]['hasOwnProperty'](_0xda4b('0x30'))){_0x2485a7['limit']=qs[_0xda4b('0x1e')](_0x1b03f1[_0xda4b('0x2b')]['limit']);_0x2485a7[_0xda4b('0x1d')]=qs[_0xda4b('0x1d')](_0x1b03f1[_0xda4b('0x2b')][_0xda4b('0x1d')]);}_0x2485a7['order']=qs['sort'](_0x1b03f1['query'][_0xda4b('0x31')]);_0x2485a7[_0xda4b('0x32')]=qs['filters'](_['pick'](_0x1b03f1[_0xda4b('0x2b')],_0x26f68d[_0xda4b('0x2c')]));if(_0x1b03f1['query'][_0xda4b('0x33')]){_0x2485a7[_0xda4b('0x32')]=_['merge'](_0x2485a7[_0xda4b('0x32')],{'$or':_[_0xda4b('0x34')](_0x126a6f,function(_0x568d30){if(_0x568d30[_0xda4b('0x35')][_0xda4b('0x36')]!=='VIRTUAL'){var _0x1ad9b7={};_0x1ad9b7[_0x568d30['field']]={'$like':'%'+_0x1b03f1[_0xda4b('0x2b')][_0xda4b('0x33')]+'%'};return _0x1ad9b7;}})});}_0x2485a7=_['merge']({},_0x2485a7,_0x1b03f1[_0xda4b('0x37')]);var _0x49d0f6={'where':_0x2485a7[_0xda4b('0x32')]};return db[_0xda4b('0x38')][_0xda4b('0x1c')](_0x49d0f6)[_0xda4b('0x25')](function(_0x3ddc8a){_0xde5989[_0xda4b('0x1c')]=_0x3ddc8a;if(_0x1b03f1['query'][_0xda4b('0x39')]){_0x2485a7[_0xda4b('0x3a')]=[{'all':!![]}];}return db[_0xda4b('0x38')][_0xda4b('0x3b')](_0x2485a7);})[_0xda4b('0x25')](function(_0x710929){_0xde5989['rows']=_0x710929;return _0xde5989;})['then'](respondWithFilteredResult(_0x50344f,_0x2485a7))[_0xda4b('0x3c')](handleError(_0x50344f,null));};exports[_0xda4b('0x3d')]=function(_0x18b7bb,_0xc5dc5d){var _0xa61b7b={'raw':!![],'where':{'id':_0x18b7bb[_0xda4b('0x3e')]['id']}},_0xb9124f={};_0xb9124f[_0xda4b('0x29')]=_['keys'](db['ChatTransferReport']['rawAttributes']);_0xb9124f[_0xda4b('0x2b')]=_[_0xda4b('0x2a')](_0x18b7bb[_0xda4b('0x2b')]);_0xb9124f[_0xda4b('0x2c')]=_[_0xda4b('0x2d')](_0xb9124f[_0xda4b('0x29')],_0xb9124f['query']);_0xa61b7b[_0xda4b('0x2f')]=_[_0xda4b('0x2d')](_0xb9124f[_0xda4b('0x29')],qs[_0xda4b('0x2e')](_0x18b7bb[_0xda4b('0x2b')][_0xda4b('0x2e')]));_0xa61b7b[_0xda4b('0x2f')]=_0xa61b7b[_0xda4b('0x2f')][_0xda4b('0x3f')]?_0xa61b7b[_0xda4b('0x2f')]:_0xb9124f[_0xda4b('0x29')];if(_0x18b7bb[_0xda4b('0x2b')][_0xda4b('0x39')]){_0xa61b7b[_0xda4b('0x3a')]=[{'all':!![]}];}_0xa61b7b=_[_0xda4b('0x40')]({},_0xa61b7b,_0x18b7bb[_0xda4b('0x37')]);return db[_0xda4b('0x38')][_0xda4b('0x41')](_0xa61b7b)[_0xda4b('0x25')](handleEntityNotFound(_0xc5dc5d,null))[_0xda4b('0x25')](respondWithResult(_0xc5dc5d,null))[_0xda4b('0x3c')](handleError(_0xc5dc5d,null));};exports['create']=function(_0x193ba5,_0x362efd){return db[_0xda4b('0x38')][_0xda4b('0x42')](_0x193ba5['body'],{})[_0xda4b('0x25')](respondWithResult(_0x362efd,0xc9))[_0xda4b('0x3c')](handleError(_0x362efd,null));};exports[_0xda4b('0x23')]=function(_0x4573d3,_0x32e2f6){if(_0x4573d3[_0xda4b('0x43')]['id']){delete _0x4573d3[_0xda4b('0x43')]['id'];}return db[_0xda4b('0x38')][_0xda4b('0x41')]({'where':{'id':_0x4573d3['params']['id']}})[_0xda4b('0x25')](handleEntityNotFound(_0x32e2f6,null))[_0xda4b('0x25')](saveUpdates(_0x4573d3[_0xda4b('0x43')],null))[_0xda4b('0x25')](respondWithResult(_0x32e2f6,null))[_0xda4b('0x3c')](handleError(_0x32e2f6,null));};exports[_0xda4b('0x24')]=function(_0x5c8aef,_0x2311be){return db[_0xda4b('0x38')][_0xda4b('0x41')]({'where':{'id':_0x5c8aef['params']['id']}})['then'](handleEntityNotFound(_0x2311be,null))[_0xda4b('0x25')](removeEntity(_0x2311be,null))['catch'](handleError(_0x2311be,null));};exports[_0xda4b('0x44')]=function(_0x4f0ded,_0x356937){return db[_0xda4b('0x38')][_0xda4b('0x44')]()['then'](respondWithResult(_0x356937,null))['catch'](handleError(_0x356937,null));}; \ No newline at end of file +var _0x77e5=['sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','then','destroy','error','stack','name','index','ChatTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','key','field','merge','options','includeAll','include','findAll','rows','catch','create','body','update','find','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x144616,_0x1188de){var _0x100e2f=function(_0x35d543){while(--_0x35d543){_0x144616['push'](_0x144616['shift']());}};_0x100e2f(++_0x1188de);}(_0x77e5,0xc8));var _0x577e=function(_0x328a37,_0x59c2d2){_0x328a37=_0x328a37-0x0;var _0x317738=_0x77e5[_0x328a37];return _0x317738;};'use strict';var pdf=require(_0x577e('0x0'));var emlformat=require(_0x577e('0x1'));var rimraf=require(_0x577e('0x2'));var zipdir=require(_0x577e('0x3'));var jsonpatch=require(_0x577e('0x4'));var rp=require('request-promise');var moment=require(_0x577e('0x5'));var BPromise=require(_0x577e('0x6'));var Mustache=require(_0x577e('0x7'));var util=require(_0x577e('0x8'));var path=require(_0x577e('0x9'));var sox=require(_0x577e('0xa'));var csv=require(_0x577e('0xb'));var ejs=require(_0x577e('0xc'));var fs=require('fs');var _=require(_0x577e('0xd'));var squel=require(_0x577e('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x577e('0xf'));var Papa=require(_0x577e('0x10'));var Redis=require(_0x577e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x577e('0x12'));var hardwareService=require(_0x577e('0x13'));var logger=require(_0x577e('0x14'))(_0x577e('0x15'));var utils=require(_0x577e('0x16'));var config=require(_0x577e('0x17'));var db=require(_0x577e('0x18'))['db'];function respondWithStatusCode(_0x5719e6,_0x2e45e6){_0x2e45e6=_0x2e45e6||0xcc;return function(_0x21c560){if(_0x21c560){return _0x5719e6[_0x577e('0x19')](_0x2e45e6);}return _0x5719e6[_0x577e('0x1a')](_0x2e45e6)[_0x577e('0x1b')]();};}function respondWithResult(_0x4953bc,_0x1829ce){_0x1829ce=_0x1829ce||0xc8;return function(_0x54ebc6){if(_0x54ebc6){return _0x4953bc['status'](_0x1829ce)['json'](_0x54ebc6);}};}function respondWithFilteredResult(_0x4af53f,_0x31e902){return function(_0x5518bb){if(_0x5518bb){var _0x17d706=_0x5518bb[_0x577e('0x1c')],_0xdaad6d=_0x31e902[_0x577e('0x1d')],_0x57634d=_0x31e902[_0x577e('0x1d')]+_0x31e902[_0x577e('0x1e')],_0x20f4e8;if(_0x57634d>=_0x17d706){_0x57634d=_0x17d706;_0x20f4e8=0xc8;}else{_0x20f4e8=0xce;}_0x4af53f[_0x577e('0x1a')](_0x20f4e8);return _0x4af53f[_0x577e('0x1f')](_0x577e('0x20'),_0xdaad6d+'-'+_0x57634d+'/'+_0x17d706)[_0x577e('0x21')](_0x5518bb);}return null;};}function patchUpdates(_0xcc0d2d){return function(_0xf6c08c){try{jsonpatch['apply'](_0xf6c08c,_0xcc0d2d,!![]);}catch(_0x5c58d2){return BPromise[_0x577e('0x22')](_0x5c58d2);}return _0xf6c08c[_0x577e('0x23')]();};}function saveUpdates(_0x179c03,_0x39965a){return function(_0x3361f3){if(_0x3361f3){return _0x3361f3['update'](_0x179c03)[_0x577e('0x24')](function(_0x329669){return _0x329669;});}return null;};}function removeEntity(_0x1ad71e,_0x4ddb09){return function(_0xd92f22){if(_0xd92f22){return _0xd92f22[_0x577e('0x25')]()[_0x577e('0x24')](function(){_0x1ad71e[_0x577e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55e361,_0x3a0472){return function(_0x28c969){if(!_0x28c969){_0x55e361['sendStatus'](0x194);}return _0x28c969;};}function handleError(_0x2efa25,_0x44261a){_0x44261a=_0x44261a||0x1f4;return function(_0x30348a){logger[_0x577e('0x26')](_0x30348a[_0x577e('0x27')]);if(_0x30348a[_0x577e('0x28')]){delete _0x30348a['name'];}_0x2efa25[_0x577e('0x1a')](_0x44261a)['send'](_0x30348a);};}exports[_0x577e('0x29')]=function(_0x2ebb4f,_0x5ced9b){var _0x490e28={},_0x2f77c6={},_0x21c663={'count':0x0,'rows':[]};var _0x55e5f8=db[_0x577e('0x2a')][_0x577e('0x2b')];_0x2f77c6[_0x577e('0x2c')]=_[_0x577e('0x2d')](_0x55e5f8);_0x2f77c6[_0x577e('0x2e')]=_[_0x577e('0x2d')](_0x2ebb4f['query']);_0x2f77c6[_0x577e('0x2f')]=_[_0x577e('0x30')](_0x2f77c6['model'],_0x2f77c6['query']);_0x490e28[_0x577e('0x31')]=_[_0x577e('0x30')](_0x2f77c6[_0x577e('0x2c')],qs['fields'](_0x2ebb4f['query'][_0x577e('0x32')]));_0x490e28[_0x577e('0x31')]=_0x490e28[_0x577e('0x31')][_0x577e('0x33')]?_0x490e28[_0x577e('0x31')]:_0x2f77c6[_0x577e('0x2c')];if(!_0x2ebb4f[_0x577e('0x2e')][_0x577e('0x34')](_0x577e('0x35'))){_0x490e28[_0x577e('0x1e')]=qs[_0x577e('0x1e')](_0x2ebb4f[_0x577e('0x2e')][_0x577e('0x1e')]);_0x490e28[_0x577e('0x1d')]=qs['offset'](_0x2ebb4f[_0x577e('0x2e')][_0x577e('0x1d')]);}_0x490e28[_0x577e('0x36')]=qs[_0x577e('0x37')](_0x2ebb4f[_0x577e('0x2e')]['sort']);_0x490e28['where']=qs[_0x577e('0x2f')](_[_0x577e('0x38')](_0x2ebb4f[_0x577e('0x2e')],_0x2f77c6['filters']));if(_0x2ebb4f['query'][_0x577e('0x39')]){_0x490e28[_0x577e('0x3a')]=_['merge'](_0x490e28[_0x577e('0x3a')],{'$or':_[_0x577e('0x3b')](_0x55e5f8,function(_0x13709d){if(_0x13709d['type'][_0x577e('0x3c')]!=='VIRTUAL'){var _0x3431bc={};_0x3431bc[_0x13709d[_0x577e('0x3d')]]={'$like':'%'+_0x2ebb4f[_0x577e('0x2e')][_0x577e('0x39')]+'%'};return _0x3431bc;}})});}_0x490e28=_[_0x577e('0x3e')]({},_0x490e28,_0x2ebb4f[_0x577e('0x3f')]);var _0x43acc={'where':_0x490e28[_0x577e('0x3a')]};return db[_0x577e('0x2a')][_0x577e('0x1c')](_0x43acc)[_0x577e('0x24')](function(_0x412c56){_0x21c663[_0x577e('0x1c')]=_0x412c56;if(_0x2ebb4f[_0x577e('0x2e')][_0x577e('0x40')]){_0x490e28[_0x577e('0x41')]=[{'all':!![]}];}return db[_0x577e('0x2a')][_0x577e('0x42')](_0x490e28);})[_0x577e('0x24')](function(_0x36387b){_0x21c663[_0x577e('0x43')]=_0x36387b;return _0x21c663;})[_0x577e('0x24')](respondWithFilteredResult(_0x5ced9b,_0x490e28))[_0x577e('0x44')](handleError(_0x5ced9b,null));};exports['show']=function(_0x47246a,_0x33d67c){var _0x28c292={'raw':!![],'where':{'id':_0x47246a['params']['id']}},_0x29896b={};_0x29896b['model']=_[_0x577e('0x2d')](db['ChatTransferReport'][_0x577e('0x2b')]);_0x29896b[_0x577e('0x2e')]=_[_0x577e('0x2d')](_0x47246a['query']);_0x29896b[_0x577e('0x2f')]=_['intersection'](_0x29896b[_0x577e('0x2c')],_0x29896b['query']);_0x28c292[_0x577e('0x31')]=_['intersection'](_0x29896b[_0x577e('0x2c')],qs[_0x577e('0x32')](_0x47246a[_0x577e('0x2e')][_0x577e('0x32')]));_0x28c292['attributes']=_0x28c292[_0x577e('0x31')]['length']?_0x28c292['attributes']:_0x29896b[_0x577e('0x2c')];if(_0x47246a[_0x577e('0x2e')][_0x577e('0x40')]){_0x28c292[_0x577e('0x41')]=[{'all':!![]}];}_0x28c292=_[_0x577e('0x3e')]({},_0x28c292,_0x47246a[_0x577e('0x3f')]);return db[_0x577e('0x2a')]['find'](_0x28c292)['then'](handleEntityNotFound(_0x33d67c,null))[_0x577e('0x24')](respondWithResult(_0x33d67c,null))['catch'](handleError(_0x33d67c,null));};exports['create']=function(_0x2a9f14,_0x52c15c){return db[_0x577e('0x2a')][_0x577e('0x45')](_0x2a9f14[_0x577e('0x46')],{})[_0x577e('0x24')](respondWithResult(_0x52c15c,0xc9))[_0x577e('0x44')](handleError(_0x52c15c,null));};exports[_0x577e('0x47')]=function(_0x28741a,_0x5d90ee){if(_0x28741a[_0x577e('0x46')]['id']){delete _0x28741a[_0x577e('0x46')]['id'];}return db[_0x577e('0x2a')][_0x577e('0x48')]({'where':{'id':_0x28741a[_0x577e('0x49')]['id']}})['then'](handleEntityNotFound(_0x5d90ee,null))[_0x577e('0x24')](saveUpdates(_0x28741a[_0x577e('0x46')],null))[_0x577e('0x24')](respondWithResult(_0x5d90ee,null))[_0x577e('0x44')](handleError(_0x5d90ee,null));};exports[_0x577e('0x25')]=function(_0x52164b,_0x2e9a56){return db[_0x577e('0x2a')][_0x577e('0x48')]({'where':{'id':_0x52164b['params']['id']}})['then'](handleEntityNotFound(_0x2e9a56,null))[_0x577e('0x24')](removeEntity(_0x2e9a56,null))[_0x577e('0x44')](handleError(_0x2e9a56,null));};exports[_0x577e('0x4a')]=function(_0x449d21,_0x9c0b58){return db[_0x577e('0x2a')]['describe']()[_0x577e('0x24')](respondWithResult(_0x9c0b58,null))[_0x577e('0x44')](handleError(_0x9c0b58,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 34958c2..3e3e555 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 _0x475d=['define','uniqueid','lodash','util','bluebird','path','rimraf','./chatTransferReport.attributes','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x475d,0x110));var _0xd475=function(_0x38cf70,_0x1c4cc4){_0x38cf70=_0x38cf70-0x0;var _0x3bb2e5=_0x475d[_0x38cf70];return _0x3bb2e5;};'use strict';var _=require(_0xd475('0x0'));var util=require(_0xd475('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd475('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd475('0x3'));var rimraf=require(_0xd475('0x4'));var config=require('../../config/environment');var attributes=require(_0xd475('0x5'));module[_0xd475('0x6')]=function(_0x43ea29,_0xdbe58e){return _0x43ea29[_0xd475('0x7')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xd475('0x8'),'fields':[_0xd475('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd53c=['path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','moment','bluebird'];(function(_0x37c981,_0x22a780){var _0x4deca9=function(_0x38cf21){while(--_0x38cf21){_0x37c981['push'](_0x37c981['shift']());}};_0x4deca9(++_0x22a780);}(_0xd53c,0xe6));var _0xcd53=function(_0x56e87c,_0xd2a775){_0x56e87c=_0x56e87c-0x0;var _0x3a6663=_0xd53c[_0x56e87c];return _0x3a6663;};'use strict';var _=require(_0xcd53('0x0'));var util=require(_0xcd53('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcd53('0x2'));var BPromise=require(_0xcd53('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd53('0x4'));var rimraf=require(_0xcd53('0x5'));var config=require(_0xcd53('0x6'));var attributes=require(_0xcd53('0x7'));module[_0xcd53('0x8')]=function(_0x142434,_0x442b44){return _0x142434[_0xcd53('0x9')](_0xcd53('0xa'),attributes,{'tableName':_0xcd53('0xb'),'paranoid':![],'indexes':[{'name':_0xcd53('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index cc4e5ac..012d9cc 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 _0x1596=['then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x38854e,_0x23cbc9){var _0x3f8415=function(_0x4e493e){while(--_0x4e493e){_0x38854e['push'](_0x38854e['shift']());}};_0x3f8415(++_0x23cbc9);}(_0x1596,0x16f));var _0x6159=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1596[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x6159('0x0'));var util=require(_0x6159('0x1'));var moment=require(_0x6159('0x2'));var BPromise=require(_0x6159('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6159('0x4'));var db=require(_0x6159('0x5'))['db'];var utils=require(_0x6159('0x6'));var logger=require('../../config/logger')(_0x6159('0x7'));var config=require(_0x6159('0x8'));var jayson=require(_0x6159('0x9'));var client=jayson['client'][_0x6159('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28f030,_0xa325fe,_0x2d530e){return new BPromise(function(_0x1784b6,_0x2bf835){return client['request'](_0x28f030,_0x2d530e)[_0x6159('0xb')](function(_0x4e6cf6){logger[_0x6159('0xc')](_0x6159('0xd'),_0xa325fe,'request\x20sent');logger[_0x6159('0xe')](_0x6159('0xf'),_0xa325fe,_0x6159('0x10'),JSON['stringify'](_0x4e6cf6));if(_0x4e6cf6['error']){if(_0x4e6cf6[_0x6159('0x11')][_0x6159('0x12')]===0x1f4){logger[_0x6159('0x11')](_0x6159('0xd'),_0xa325fe,_0x4e6cf6[_0x6159('0x11')][_0x6159('0x13')]);return _0x2bf835(_0x4e6cf6[_0x6159('0x11')][_0x6159('0x13')]);}logger[_0x6159('0x11')](_0x6159('0xd'),_0xa325fe,_0x4e6cf6[_0x6159('0x11')][_0x6159('0x13')]);return _0x1784b6(_0x4e6cf6[_0x6159('0x11')][_0x6159('0x13')]);}else{logger[_0x6159('0xc')](_0x6159('0xd'),_0xa325fe,_0x6159('0x10'));_0x1784b6(_0x4e6cf6[_0x6159('0x14')]['message']);}})['catch'](function(_0x316630){logger[_0x6159('0x11')](_0x6159('0xd'),_0xa325fe,_0x316630);_0x2bf835(_0x316630);});});} \ No newline at end of file +var _0xa902=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0xa902,0x8d));var _0x2a90=function(_0x5328cc,_0x460c59){_0x5328cc=_0x5328cc-0x0;var _0x4b875c=_0xa902[_0x5328cc];return _0x4b875c;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var moment=require(_0x2a90('0x2'));var BPromise=require(_0x2a90('0x3'));var rs=require(_0x2a90('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a90('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a90('0x6'));var config=require(_0x2a90('0x7'));var jayson=require(_0x2a90('0x8'));var client=jayson[_0x2a90('0x9')][_0x2a90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25bcfc,_0x58369a,_0x4109e6){return new BPromise(function(_0x570659,_0x5ec2b9){return client[_0x2a90('0xb')](_0x25bcfc,_0x4109e6)[_0x2a90('0xc')](function(_0xe500bc){logger[_0x2a90('0xd')](_0x2a90('0xe'),_0x58369a,'request\x20sent');logger[_0x2a90('0xf')](_0x2a90('0x10'),_0x58369a,_0x2a90('0x11'),JSON[_0x2a90('0x12')](_0xe500bc));if(_0xe500bc['error']){if(_0xe500bc[_0x2a90('0x13')]['code']===0x1f4){logger[_0x2a90('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x58369a,_0xe500bc[_0x2a90('0x13')]['message']);return _0x5ec2b9(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}logger[_0x2a90('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x58369a,_0xe500bc['error']['message']);return _0x570659(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}else{logger['info'](_0x2a90('0xe'),_0x58369a,_0x2a90('0x11'));_0x570659(_0xe500bc[_0x2a90('0x15')][_0x2a90('0x14')]);}})[_0x2a90('0x16')](function(_0x37858e){logger[_0x2a90('0x13')](_0x2a90('0xe'),_0x58369a,_0x37858e);_0x5ec2b9(_0x37858e);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 131a86e..38f656e 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 _0x0dfe=['./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x26fbea,_0x31c324){var _0xa8f8b4=function(_0x2f31f8){while(--_0x2f31f8){_0x26fbea['push'](_0x26fbea['shift']());}};_0xa8f8b4(++_0x31c324);}(_0x0dfe,0x1a9));var _0xe0df=function(_0x6a9bce,_0x5df304){_0x6a9bce=_0x6a9bce-0x0;var _0x5e8e72=_0x0dfe[_0x6a9bce];return _0x5e8e72;};'use strict';var multer=require('multer');var util=require(_0xe0df('0x0'));var path=require(_0xe0df('0x1'));var timeout=require(_0xe0df('0x2'));var express=require(_0xe0df('0x3'));var router=express[_0xe0df('0x4')]();var auth=require(_0xe0df('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe0df('0x6'));var controller=require(_0xe0df('0x7'));router[_0xe0df('0x8')]('/',auth[_0xe0df('0x9')](),controller[_0xe0df('0xa')]);router[_0xe0df('0x8')](_0xe0df('0xb'),auth[_0xe0df('0x9')](),controller['describe']);router[_0xe0df('0x8')](_0xe0df('0xc'),auth[_0xe0df('0x9')](),controller[_0xe0df('0xd')]);router['post']('/',auth[_0xe0df('0x9')](),controller[_0xe0df('0xe')]);router[_0xe0df('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xe0df('0xc'),auth[_0xe0df('0x9')](),controller[_0xe0df('0x10')]);module[_0xe0df('0x11')]=router; \ No newline at end of file +var _0x8dc1=['put','update','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post'];(function(_0x1fd10f,_0x5d1a7b){var _0xe2f4d6=function(_0x4271d3){while(--_0x4271d3){_0x1fd10f['push'](_0x1fd10f['shift']());}};_0xe2f4d6(++_0x5d1a7b);}(_0x8dc1,0x1c4));var _0x18dc=function(_0xba724,_0x3da84c){_0xba724=_0xba724-0x0;var _0x5b782c=_0x8dc1[_0xba724];return _0x5b782c;};'use strict';var multer=require(_0x18dc('0x0'));var util=require('util');var path=require(_0x18dc('0x1'));var timeout=require(_0x18dc('0x2'));var express=require(_0x18dc('0x3'));var router=express['Router']();var auth=require(_0x18dc('0x4'));var interaction=require(_0x18dc('0x5'));var config=require(_0x18dc('0x6'));var controller=require('./chatTransferReport.controller');router[_0x18dc('0x7')]('/',auth['isAuthenticated'](),controller[_0x18dc('0x8')]);router[_0x18dc('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x18dc('0x9')](),controller[_0x18dc('0xa')]);router[_0x18dc('0xb')]('/',auth[_0x18dc('0x9')](),controller['create']);router[_0x18dc('0xc')]('/:id',auth[_0x18dc('0x9')](),controller[_0x18dc('0xd')]);router['delete']('/:id',auth[_0x18dc('0x9')](),controller[_0x18dc('0xe')]);module[_0x18dc('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index e7da53e..6b76660 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 _0xaa5b=['System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','randomstring','exports','address','STRING','email','Agent','#9f946a','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','stringify','name','text','input','getDataValue','onlineForm','parse','setDataValue','textarea','offlineForm','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'];(function(_0x471e48,_0x3056e4){var _0x48f835=function(_0x3fa2bf){while(--_0x3fa2bf){_0x471e48['push'](_0x471e48['shift']());}};_0x48f835(++_0x3056e4);}(_0xaa5b,0x15b));var _0xbaa5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa5b[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xbaa5('0x0'));var rs=require(_0xbaa5('0x1'));module[_0xbaa5('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbaa5('0x3')},'description':{'type':Sequelize[_0xbaa5('0x4')]},'mapKey':{'type':Sequelize[_0xbaa5('0x4')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xbaa5('0x4')],'defaultValue':_0xbaa5('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xbaa5('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xbaa5('0x4')],'allowNull':![],'defaultValue':_0xbaa5('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xbaa5('0x4')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xbaa5('0x4')],'allowNull':![],'defaultValue':_0xbaa5('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbaa5('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xbaa5('0x4')]},'animation':{'type':Sequelize[_0xbaa5('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbaa5('0xb')](_0xbaa5('0xc'),'squared'),'defaultValue':_0xbaa5('0xc')},'header_online':{'type':Sequelize[_0xbaa5('0x4')],'defaultValue':_0xbaa5('0xd')},'start_chat_button':{'type':Sequelize[_0xbaa5('0x4')],'defaultValue':_0xbaa5('0xe')},'offline_chat_button':{'type':Sequelize[_0xbaa5('0x4')],'defaultValue':_0xbaa5('0xf')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xbaa5('0x10')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbaa5('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xbaa5('0x4')],'defaultValue':_0xbaa5('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0xbaa5('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xbaa5('0x12')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xbaa5('0x13')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbaa5('0x14')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbaa5('0x15')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xbaa5('0x4')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xbaa5('0x4')],'defaultValue':_0xbaa5('0x16')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xbaa5('0x17')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbaa5('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xbaa5('0xa')],'defaultValue':![]},'ratingType':{'type':Sequelize[_0xbaa5('0xb')](_0xbaa5('0x18'),_0xbaa5('0x19')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xbaa5('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xbaa5('0x12')],'defaultValue':function(){return JSON[_0xbaa5('0x1a')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xbaa5('0x1b'),'type':_0xbaa5('0x1c'),'required':!![]},'props':{'title':_0xbaa5('0x1b'),'helpText':''}},{'type':_0xbaa5('0x1d'),'props':{'title':_0xbaa5('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xbaa5('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xbaa5('0x1e')](_0xbaa5('0x1f'))?JSON[_0xbaa5('0x20')](this[_0xbaa5('0x1e')](_0xbaa5('0x1f'))):{};},'set':function(_0x476086){return this[_0xbaa5('0x21')](_0xbaa5('0x1f'),JSON[_0xbaa5('0x1a')](_0x476086));}},'offlineForm':{'type':Sequelize[_0xbaa5('0x12')],'defaultValue':function(){return JSON[_0xbaa5('0x1a')]({'items':[{'type':_0xbaa5('0x1d'),'props':{'title':_0xbaa5('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xbaa5('0x5'),'type':'email'},'variable':null},{'type':_0xbaa5('0x22'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xbaa5('0x1e')](_0xbaa5('0x23'))?JSON['parse'](this[_0xbaa5('0x1e')]('offlineForm')):{};},'set':function(_0x1a3376){return this[_0xbaa5('0x21')](_0xbaa5('0x23'),JSON[_0xbaa5('0x1a')](_0x1a3376));}},'token':{'type':Sequelize[_0xbaa5('0x4')],'defaultValue':function(){return rs[_0xbaa5('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xbaa5('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbaa5('0x4')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbaa5('0x4')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xbaa5('0x25')},'offlineMessageBody':{'type':Sequelize[_0xbaa5('0x4')],'defaultValue':_0xbaa5('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xbaa5('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbaa5('0x27')},'skipUnmanaged':{'type':Sequelize[_0xbaa5('0x4')],'defaultValue':_0xbaa5('0x17')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xbaa5('0xf')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbaa5('0x12')]},'showAgentAvatar':{'type':Sequelize[_0xbaa5('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbaa5('0x4')]},'notificationTemplate':{'type':Sequelize[_0xbaa5('0x12')],'defaultValue':function(){return _0xbaa5('0x28');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xbaa5('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xbaa5('0x4')],'defaultValue':_0xbaa5('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xbaa5('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbaa5('0x4')],'defaultValue':_0xbaa5('0x2a')},'verticalAlignment':{'type':Sequelize[_0xbaa5('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xbaa5('0x2b')},'defaultTitle':{'type':Sequelize[_0xbaa5('0x4')]},'customerAvatar':{'type':Sequelize[_0xbaa5('0x12')]},'showCustomerAvatar':{'type':Sequelize[_0xbaa5('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xbaa5('0x4')],'allowNull':![],'defaultValue':_0xbaa5('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbaa5('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbaa5('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbaa5('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbaa5('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xbaa5('0x2d')},'systemAvatar':{'type':Sequelize[_0xbaa5('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbaa5('0x9')],'comment':_0xbaa5('0x2e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xbaa5('0x2f'),'set':function(_0x1d5a30){if(!_0x1d5a30)this[_0xbaa5('0x21')](_0xbaa5('0x30'),null);this[_0xbaa5('0x21')]('mandatoryDisposition',_0x1d5a30);}}}; \ No newline at end of file +var _0xa29c=['Skip','star','thumb','input','name','text','onlineForm','parse','getDataValue','setDataValue','stringify','Comments','Leave\x20your\x20comments','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:','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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','address','email','Agent','#9f946a','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!'];(function(_0x5e58b2,_0x1b7ed4){var _0x4facd0=function(_0x58d136){while(--_0x58d136){_0x5e58b2['push'](_0x5e58b2['shift']());}};_0x4facd0(++_0x1b7ed4);}(_0xa29c,0xe4));var _0xca29=function(_0x58032a,_0x7c74d6){_0x58032a=_0x58032a-0x0;var _0x2f1f1c=_0xa29c[_0x58032a];return _0x2f1f1c;};'use strict';var Sequelize=require(_0xca29('0x0'));var rs=require(_0xca29('0x1'));module[_0xca29('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xca29('0x3')],'allowNull':![],'unique':_0xca29('0x4')},'description':{'type':Sequelize[_0xca29('0x3')]},'mapKey':{'type':Sequelize[_0xca29('0x3')],'defaultValue':_0xca29('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xca29('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xca29('0x3')],'defaultValue':_0xca29('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xca29('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xca29('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xca29('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xca29('0x3')]},'animation':{'type':Sequelize[_0xca29('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xca29('0xa')]('rounded','squared'),'defaultValue':_0xca29('0xb')},'header_online':{'type':Sequelize[_0xca29('0x3')],'defaultValue':_0xca29('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xca29('0xd')},'offline_chat_button':{'type':Sequelize[_0xca29('0x3')],'defaultValue':_0xca29('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xca29('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xca29('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xca29('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xca29('0x10')]},'closingQuestion':{'type':Sequelize[_0xca29('0x3')],'defaultValue':_0xca29('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xca29('0x3')],'defaultValue':_0xca29('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xca29('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xca29('0x3')],'defaultValue':_0xca29('0x13')},'placeholderMessage':{'type':Sequelize[_0xca29('0x3')],'defaultValue':_0xca29('0x14')},'closingMessage':{'type':Sequelize[_0xca29('0x3')],'defaultValue':_0xca29('0x15')},'closingMessageButton':{'type':Sequelize[_0xca29('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xca29('0x3')],'defaultValue':_0xca29('0x16')},'conditionAgreement':{'type':Sequelize[_0xca29('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xca29('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xca29('0x9')],'defaultValue':![]},'ratingType':{'type':Sequelize[_0xca29('0xa')](_0xca29('0x17'),_0xca29('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xca29('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xca29('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xca29('0x19'),'variable':null,'config':{'placeholder':_0xca29('0x1a'),'type':_0xca29('0x1b'),'required':!![]},'props':{'title':_0xca29('0x1a'),'helpText':''}},{'type':'input','props':{'title':_0xca29('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xca29('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xca29('0x1c'))?JSON[_0xca29('0x1d')](this[_0xca29('0x1e')](_0xca29('0x1c'))):{};},'set':function(_0x32a37d){return this[_0xca29('0x1f')](_0xca29('0x1c'),JSON[_0xca29('0x20')](_0x32a37d));}},'offlineForm':{'type':Sequelize[_0xca29('0x10')],'defaultValue':function(){return JSON[_0xca29('0x20')]({'items':[{'type':_0xca29('0x19'),'props':{'title':_0xca29('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xca29('0x5'),'type':_0xca29('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0xca29('0x21')},'props':{'title':_0xca29('0x21'),'helpText':_0xca29('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xca29('0x1e')](_0xca29('0x23'))?JSON[_0xca29('0x1d')](this[_0xca29('0x1e')](_0xca29('0x23'))):{};},'set':function(_0x261883){return this[_0xca29('0x1f')]('offlineForm',JSON['stringify'](_0x261883));}},'token':{'type':Sequelize[_0xca29('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xca29('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xca29('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xca29('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xca29('0x3')]},'forwardOffline':{'type':Sequelize[_0xca29('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xca29('0x3')]},'waitingTitle':{'type':Sequelize[_0xca29('0x3')],'defaultValue':_0xca29('0x24')},'waitingMessage':{'type':Sequelize[_0xca29('0x3')],'defaultValue':_0xca29('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xca29('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xca29('0x27')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xca29('0x28')},'skipUnmanaged':{'type':Sequelize[_0xca29('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xca29('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xca29('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xca29('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xca29('0x29');}},'notificationSound':{'type':Sequelize[_0xca29('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xca29('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xca29('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xca29('0x3')],'defaultValue':_0xca29('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0xca29('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xca29('0x2b')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xca29('0x3')],'defaultValue':_0xca29('0x2c')},'defaultTitle':{'type':Sequelize[_0xca29('0x3')]},'customerAvatar':{'type':Sequelize[_0xca29('0x10')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xca29('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xca29('0x3')],'allowNull':![],'defaultValue':_0xca29('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xca29('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xca29('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xca29('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xca29('0x3')],'defaultValue':_0xca29('0x2e')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xca29('0x8')],'comment':_0xca29('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0xca29('0x9')],'defaultValue':![],'comment':_0xca29('0x30'),'set':function(_0x23d100){if(!_0x23d100)this[_0xca29('0x1f')](_0xca29('0x31'),null);this['setDataValue']('mandatoryDisposition',_0x23d100);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index bcb0014..f90802f 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 _0x556d=['server/files/images/logos/default_logo.png','../../config/license/util','getLicense','custom','isNil','existsSync','root','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','customerAvatar','showCustomerAvatar','getSystemAvatar','notify','user-agent-parser','setUA','headers','user-agent','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','Sequelize','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','ChatApplication','Applications','List','applications','orderBy','priority','account','lastName','customerIp','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','contact','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','forcedOwnership','Start','startRouting','EventManager','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','pass','email','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tags','tag','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','virtual','License','chatLicenseExceeded','all','some','readFileSync','server/files/chat/iframe.js','x-forwarded-for','x-real-ip','connection','replace','alignment','verticalAlignment','addApplications','transaction','findAndCountAll','getApplications','chatProactiveAction','addProactiveActions','getProactiveActions','ChatProactiveAction','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','jayson/promise','client','http','test','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','json','offset','limit','set','Content-Range','apply','save','update','destroy','get','end','name','mandatoryDispositionPause','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','map','type','key','VIRTUAL','field','ChatWebsite','count','includeAll','include','rows','show','options','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','Pause','describe','addDisposition','ChatWebsiteId','findOne','filter','Disposition','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addSystemAvatar','systemAvatar','join'];(function(_0x114b7c,_0xc4b93b){var _0x47185f=function(_0x5b4cfa){while(--_0x5b4cfa){_0x114b7c['push'](_0x114b7c['shift']());}};_0x47185f(++_0xc4b93b);}(_0x556d,0x99));var _0xd556=function(_0x41a18a,_0x506cbd){_0x41a18a=_0x41a18a-0x0;var _0x52503c=_0x556d[_0x41a18a];return _0x52503c;};'use strict';var pdf=require(_0xd556('0x0'));var emlformat=require(_0xd556('0x1'));var rimraf=require(_0xd556('0x2'));var zipdir=require(_0xd556('0x3'));var jsonpatch=require(_0xd556('0x4'));var rp=require(_0xd556('0x5'));var moment=require('moment');var BPromise=require(_0xd556('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xd556('0x7'));var csv=require('to-csv');var ejs=require(_0xd556('0x8'));var fs=require('fs');var _=require(_0xd556('0x9'));var squel=require(_0xd556('0xa'));var crypto=require(_0xd556('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd556('0xc'));var Papa=require(_0xd556('0xd'));var Redis=require(_0xd556('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd556('0xf'));var hardwareService=require(_0xd556('0x10'));var logger=require(_0xd556('0x11'))(_0xd556('0x12'));var utils=require(_0xd556('0x13'));var config=require(_0xd556('0x14'));var db=require(_0xd556('0x15'))['db'];config[_0xd556('0x16')]=_[_0xd556('0x17')](config[_0xd556('0x16')],{'host':_0xd556('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd556('0x16')]));require(_0xd556('0x19'))['register'](socket);var jayson=require(_0xd556('0x1a'));var client=jayson[_0xd556('0x1b')][_0xd556('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0xd556('0x1c')]({'port':0x232a});var client9003=jayson[_0xd556('0x1b')][_0xd556('0x1c')]({'port':0x232b});function checkPasswordPattern(_0x529333,_0x100b35,_0x223e67){if(_0x223e67){var _0xfe3dcc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xfe3dcc[_0xd556('0x1d')](_0x100b35)){return _0x529333;}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 _0x529333;}}function respondWithRpcPromise(_0xa5316,_0x2cf379,_0x1fc3c6,_0x1fb962){return new BPromise(function(_0x4d99e5,_0x3a72e9){var _0x21fe7e=_0x1fb962||client;return _0x21fe7e['request'](_0xa5316,_0x1fc3c6)[_0xd556('0x1e')](function(_0x3acac3){logger[_0xd556('0x1f')](_0xd556('0x20'),_0x2cf379,_0xd556('0x21'));logger[_0xd556('0x22')](_0xd556('0x23'),_0x2cf379,_0xd556('0x21'),JSON[_0xd556('0x24')](_0x3acac3));if(_0x3acac3['error']){if(_0x3acac3['error']['code']===0x1f4){logger[_0xd556('0x25')](_0xd556('0x20'),_0x2cf379,_0x3acac3[_0xd556('0x25')][_0xd556('0x26')]);return _0x3a72e9(_0x3acac3[_0xd556('0x25')]['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x2cf379,_0x3acac3['error']['message']);return _0x4d99e5(_0x3acac3[_0xd556('0x25')][_0xd556('0x26')]);}else{logger[_0xd556('0x1f')](_0xd556('0x20'),_0x2cf379,'request\x20sent');_0x4d99e5(_0x3acac3[_0xd556('0x27')]['message']);}})['catch'](function(_0x10502f){logger[_0xd556('0x25')](_0xd556('0x20'),_0x2cf379,_0x10502f);_0x3a72e9(_0x10502f);});});}function respondWithStatusCode(_0x14b837,_0x4f27d5){_0x4f27d5=_0x4f27d5||0xcc;return function(_0x38c594){if(_0x38c594){return _0x14b837[_0xd556('0x28')](_0x4f27d5);}return _0x14b837[_0xd556('0x29')](_0x4f27d5)['end']();};}function respondWithResult(_0xea0a05,_0x4d3459){_0x4d3459=_0x4d3459||0xc8;return function(_0x2e49fc){if(_0x2e49fc){return _0xea0a05['status'](_0x4d3459)[_0xd556('0x2a')](_0x2e49fc);}};}function respondWithFilteredResult(_0x2d4eec,_0x303de5){return function(_0x7d3f76){if(_0x7d3f76){var _0x54ee1a=_0x7d3f76['count'],_0x50e8de=_0x303de5[_0xd556('0x2b')],_0x5455be=_0x303de5[_0xd556('0x2b')]+_0x303de5[_0xd556('0x2c')],_0x451de9;if(_0x5455be>=_0x54ee1a){_0x5455be=_0x54ee1a;_0x451de9=0xc8;}else{_0x451de9=0xce;}_0x2d4eec[_0xd556('0x29')](_0x451de9);return _0x2d4eec[_0xd556('0x2d')](_0xd556('0x2e'),_0x50e8de+'-'+_0x5455be+'/'+_0x54ee1a)['json'](_0x7d3f76);}return null;};}function patchUpdates(_0x3bd4e7){return function(_0x321d68){try{jsonpatch[_0xd556('0x2f')](_0x321d68,_0x3bd4e7,!![]);}catch(_0x530cee){return BPromise['reject'](_0x530cee);}return _0x321d68[_0xd556('0x30')]();};}function saveUpdates(_0x1038b2,_0xae84ca){return function(_0x3a8410){if(_0x3a8410){return _0x3a8410[_0xd556('0x31')](_0x1038b2)[_0xd556('0x1e')](function(_0x357464){return _0x357464;});}return null;};}function removeEntity(_0x4c29e4,_0x411ab2){return function(_0xe5152e){if(_0xe5152e){return _0xe5152e[_0xd556('0x32')]()[_0xd556('0x1e')](function(){var _0x48aae4=_0xe5152e[_0xd556('0x33')]({'plain':!![]});var _0x2b6661='ChatWebsites';return db['UserProfileResource'][_0xd556('0x32')]({'where':{'type':_0x2b6661,'resourceId':_0x48aae4['id']}})[_0xd556('0x1e')](function(){return _0xe5152e;});})['then'](function(){_0x4c29e4['status'](0xcc)[_0xd556('0x34')]();});}};}function handleEntityNotFound(_0xe10bb3,_0x2c7ddb){return function(_0x4a167f){if(!_0x4a167f){_0xe10bb3[_0xd556('0x28')](0x194);}return _0x4a167f;};}function handleError(_0x132cf8,_0x1357d8){_0x1357d8=_0x1357d8||0x1f4;return function(_0x25be31){logger[_0xd556('0x25')](_0x25be31['stack']);if(_0x25be31[_0xd556('0x35')]){delete _0x25be31[_0xd556('0x35')];}_0x132cf8[_0xd556('0x29')](_0x1357d8)['send'](_0x25be31);};}exports['index']=function(_0x300e79,_0x1fbcfe){var _0x107a09={'include':[{'model':db['Pause'],'as':_0xd556('0x36')}]},_0x3daa43={},_0x5180ea={'count':0x0,'rows':[]};var _0x56c642=db['ChatWebsite'][_0xd556('0x37')];_0x3daa43[_0xd556('0x38')]=_[_0xd556('0x39')](_0x56c642);_0x3daa43[_0xd556('0x3a')]=_[_0xd556('0x39')](_0x300e79[_0xd556('0x3a')]);_0x3daa43['filters']=_[_0xd556('0x3b')](_0x3daa43[_0xd556('0x38')],_0x3daa43[_0xd556('0x3a')]);_0x107a09['attributes']=_[_0xd556('0x3b')](_0x3daa43[_0xd556('0x38')],qs['fields'](_0x300e79['query'][_0xd556('0x3c')]));_0x107a09[_0xd556('0x3d')]=_0x107a09[_0xd556('0x3d')][_0xd556('0x3e')]?_0x107a09[_0xd556('0x3d')]:_0x3daa43[_0xd556('0x38')];if(!_0x300e79[_0xd556('0x3a')][_0xd556('0x3f')](_0xd556('0x40'))){_0x107a09['limit']=qs[_0xd556('0x2c')](_0x300e79[_0xd556('0x3a')][_0xd556('0x2c')]);_0x107a09['offset']=qs[_0xd556('0x2b')](_0x300e79[_0xd556('0x3a')]['offset']);}_0x107a09[_0xd556('0x41')]=qs[_0xd556('0x42')](_0x300e79['query'][_0xd556('0x42')]);_0x107a09['where']=qs[_0xd556('0x43')](_[_0xd556('0x44')](_0x300e79[_0xd556('0x3a')],_0x3daa43[_0xd556('0x43')]));if(_0x300e79['query']['filter']){_0x107a09[_0xd556('0x45')]=_[_0xd556('0x46')](_0x107a09[_0xd556('0x45')],{'$or':_[_0xd556('0x47')](_0x56c642,function(_0x4ae670){if(_0x4ae670[_0xd556('0x48')][_0xd556('0x49')]!==_0xd556('0x4a')){var _0x534c32={};_0x534c32[_0x4ae670[_0xd556('0x4b')]]={'$like':'%'+_0x300e79['query']['filter']+'%'};return _0x534c32;}})});}_0x107a09=_['merge']({},_0x107a09,_0x300e79['options']);var _0x202a64={'where':_0x107a09[_0xd556('0x45')]};return db[_0xd556('0x4c')][_0xd556('0x4d')](_0x202a64)[_0xd556('0x1e')](function(_0x5a083e){_0x5180ea[_0xd556('0x4d')]=_0x5a083e;if(_0x300e79[_0xd556('0x3a')][_0xd556('0x4e')]){_0x107a09[_0xd556('0x4f')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x107a09);})[_0xd556('0x1e')](function(_0x162c03){_0x5180ea[_0xd556('0x50')]=_0x162c03;return _0x5180ea;})['then'](respondWithFilteredResult(_0x1fbcfe,_0x107a09))['catch'](handleError(_0x1fbcfe,null));};exports[_0xd556('0x51')]=function(_0x43df49,_0x4546b5){var _0x4a1559={'raw':![],'where':{'id':_0x43df49['params']['id']},'include':[{'model':db['Pause'],'as':_0xd556('0x36')}]},_0x166c87={};_0x166c87[_0xd556('0x38')]=_['keys'](db[_0xd556('0x4c')]['rawAttributes']);_0x166c87[_0xd556('0x3a')]=_[_0xd556('0x39')](_0x43df49[_0xd556('0x3a')]);_0x166c87[_0xd556('0x43')]=_['intersection'](_0x166c87[_0xd556('0x38')],_0x166c87['query']);_0x4a1559[_0xd556('0x3d')]=_[_0xd556('0x3b')](_0x166c87['model'],qs[_0xd556('0x3c')](_0x43df49[_0xd556('0x3a')][_0xd556('0x3c')]));_0x4a1559[_0xd556('0x3d')]=_0x4a1559['attributes'][_0xd556('0x3e')]?_0x4a1559[_0xd556('0x3d')]:_0x166c87[_0xd556('0x38')];if(_0x43df49[_0xd556('0x3a')][_0xd556('0x4e')]){_0x4a1559[_0xd556('0x4f')]=[{'all':!![]}];}_0x4a1559=_[_0xd556('0x46')]({},_0x4a1559,_0x43df49[_0xd556('0x52')]);return db[_0xd556('0x4c')]['find'](_0x4a1559)[_0xd556('0x1e')](handleEntityNotFound(_0x4546b5,null))[_0xd556('0x1e')](respondWithResult(_0x4546b5,null))[_0xd556('0x53')](handleError(_0x4546b5,null));};exports['create']=function(_0x13cc5e,_0x5af056){return db[_0xd556('0x4c')][_0xd556('0x54')](_0x13cc5e[_0xd556('0x55')],{})[_0xd556('0x1e')](function(_0x31615d){var _0x29912c=_0x13cc5e['user']['get']({'plain':!![]});if(!_0x29912c)throw new Error(_0xd556('0x56'));if(_0x29912c[_0xd556('0x57')]===_0xd556('0x58')){var _0x38e8d5=_0x31615d['get']({'plain':!![]});var _0x216d81='ChatWebsites';return db['UserProfileSection'][_0xd556('0x59')]({'where':{'name':_0x216d81,'userProfileId':_0x29912c[_0xd556('0x5a')]},'raw':!![]})[_0xd556('0x1e')](function(_0x399db1){if(_0x399db1&&_0x399db1[_0xd556('0x5b')]===0x0){return db['UserProfileResource'][_0xd556('0x54')]({'name':_0x38e8d5['name'],'resourceId':_0x38e8d5['id'],'type':_0x399db1[_0xd556('0x35')],'sectionId':_0x399db1['id']},{})['then'](function(){return _0x31615d;});}else{return _0x31615d;}})[_0xd556('0x53')](function(_0x2064d8){logger['error'](_0xd556('0x5c'),_0x2064d8);throw _0x2064d8;});}return _0x31615d;})[_0xd556('0x1e')](respondWithResult(_0x5af056,0xc9))[_0xd556('0x53')](handleError(_0x5af056,null));};exports[_0xd556('0x31')]=function(_0xb9400,_0x2b9370){if(_0xb9400[_0xd556('0x55')]['id']){delete _0xb9400[_0xd556('0x55')]['id'];}return db[_0xd556('0x4c')][_0xd556('0x59')]({'where':{'id':_0xb9400[_0xd556('0x5d')]['id']},'include':[{'model':db[_0xd556('0x5e')],'as':'mandatoryDispositionPause'}]})[_0xd556('0x1e')](handleEntityNotFound(_0x2b9370,null))[_0xd556('0x1e')](saveUpdates(_0xb9400[_0xd556('0x55')],null))['then'](respondWithResult(_0x2b9370,null))[_0xd556('0x53')](handleError(_0x2b9370,null));};exports[_0xd556('0x32')]=function(_0xa30eed,_0x291967){return db[_0xd556('0x4c')]['find']({'where':{'id':_0xa30eed[_0xd556('0x5d')]['id']}})['then'](handleEntityNotFound(_0x291967,null))['then'](removeEntity(_0x291967,null))[_0xd556('0x53')](handleError(_0x291967,null));};exports[_0xd556('0x5f')]=function(_0x47f9ab,_0x41071f){return db[_0xd556('0x4c')][_0xd556('0x5f')]()[_0xd556('0x1e')](respondWithResult(_0x41071f,null))[_0xd556('0x53')](handleError(_0x41071f,null));};exports[_0xd556('0x60')]=function(_0x14a287,_0x2511e7,_0x4c39f5){if(_0x14a287[_0xd556('0x55')]['id']){delete _0x14a287[_0xd556('0x55')]['id'];}return db[_0xd556('0x4c')][_0xd556('0x59')]({'where':{'id':_0x14a287[_0xd556('0x5d')]['id']}})[_0xd556('0x1e')](handleEntityNotFound(_0x2511e7,null))[_0xd556('0x1e')](function(_0x1757e0){if(_0x1757e0){_0x14a287[_0xd556('0x55')][_0xd556('0x61')]=_0x1757e0['id'];return db['Disposition'][_0xd556('0x54')](_0x14a287[_0xd556('0x55')]);}})['then'](respondWithResult(_0x2511e7,null))[_0xd556('0x53')](handleError(_0x2511e7,null));};exports['getDispositions']=function(_0x51c201,_0x1cfc03,_0x5a28a9){var _0x413810={'raw':![],'where':{}};var _0x4c92b0={};var _0x347fb6={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xd556('0x62')]({'where':{'id':_0x51c201[_0xd556('0x5d')]['id']}})[_0xd556('0x1e')](handleEntityNotFound(_0x1cfc03,null))['then'](function(_0x1d6699){if(_0x1d6699){_0x4c92b0[_0xd556('0x38')]=_[_0xd556('0x39')](db['Disposition'][_0xd556('0x37')]);_0x4c92b0[_0xd556('0x3a')]=_['keys'](_0x51c201[_0xd556('0x3a')]);_0x4c92b0[_0xd556('0x43')]=_[_0xd556('0x3b')](_0x4c92b0['model'],_0x4c92b0[_0xd556('0x3a')]);_0x413810[_0xd556('0x3d')]=_[_0xd556('0x3b')](_0x4c92b0[_0xd556('0x38')],qs[_0xd556('0x3c')](_0x51c201[_0xd556('0x3a')][_0xd556('0x3c')]));_0x413810[_0xd556('0x3d')]=_0x413810[_0xd556('0x3d')][_0xd556('0x3e')]?_0x413810['attributes']:_0x4c92b0['model'];if(!_0x51c201[_0xd556('0x3a')][_0xd556('0x3f')](_0xd556('0x40'))){_0x413810['limit']=qs['limit'](_0x51c201[_0xd556('0x3a')][_0xd556('0x2c')]);_0x413810[_0xd556('0x2b')]=qs['offset'](_0x51c201['query']['offset']);}_0x413810[_0xd556('0x41')]=qs['sort'](_0x51c201[_0xd556('0x3a')][_0xd556('0x42')]);_0x413810[_0xd556('0x45')]=qs[_0xd556('0x43')](_[_0xd556('0x44')](_0x51c201[_0xd556('0x3a')],_0x4c92b0[_0xd556('0x43')]));_0x413810[_0xd556('0x45')][_0xd556('0x61')]=_0x1d6699['id'];if(_0x51c201[_0xd556('0x3a')][_0xd556('0x63')]){_0x413810['where']=_[_0xd556('0x46')](_0x413810[_0xd556('0x45')],{'$or':_[_0xd556('0x47')](_0x413810[_0xd556('0x3d')],function(_0x152d2f){var _0x380f7b={};_0x380f7b[_0x152d2f]={'$like':'%'+_0x51c201[_0xd556('0x3a')][_0xd556('0x63')]+'%'};return _0x380f7b;})});}_0x413810=_['merge']({},_0x413810,_0x51c201['options']);return db[_0xd556('0x64')]['count']({'where':_0x413810[_0xd556('0x45')]})[_0xd556('0x1e')](function(_0x438889){_0x347fb6[_0xd556('0x4d')]=_0x438889;if(_0x51c201[_0xd556('0x3a')][_0xd556('0x4e')]){_0x413810[_0xd556('0x4f')]=[{'all':!![]}];}return db[_0xd556('0x64')][_0xd556('0x65')](_0x413810);})[_0xd556('0x1e')](function(_0x4133c9){_0x347fb6[_0xd556('0x50')]=_0x4133c9;return _0x347fb6;});}})[_0xd556('0x1e')](respondWithFilteredResult(_0x1cfc03,_0x413810))['catch'](handleError(_0x1cfc03,null));};exports[_0xd556('0x66')]=function(_0x295769,_0x520e9a,_0x379e80){return db[_0xd556('0x4c')]['find']({'where':{'id':_0x295769[_0xd556('0x5d')]['id']}})[_0xd556('0x1e')](handleEntityNotFound(_0x520e9a,null))[_0xd556('0x1e')](function(_0x22b13e){if(_0x22b13e){return _0x22b13e[_0xd556('0x66')](_0x295769['query'][_0xd556('0x67')]);}})[_0xd556('0x1e')](respondWithStatusCode(_0x520e9a,null))[_0xd556('0x53')](handleError(_0x520e9a,null));};exports[_0xd556('0x68')]=function(_0x5af0c1,_0x231475,_0xb8f1ea){if(_0x5af0c1[_0xd556('0x55')]['id']){delete _0x5af0c1['body']['id'];}return db[_0xd556('0x4c')]['find']({'where':{'id':_0x5af0c1[_0xd556('0x5d')]['id']}})['then'](handleEntityNotFound(_0x231475,null))[_0xd556('0x1e')](function(_0x252e28){if(_0x252e28){_0x5af0c1[_0xd556('0x55')][_0xd556('0x61')]=_0x252e28['id'];return db[_0xd556('0x69')][_0xd556('0x54')](_0x5af0c1[_0xd556('0x55')]);}})[_0xd556('0x1e')](respondWithResult(_0x231475,null))['catch'](handleError(_0x231475,null));};exports[_0xd556('0x6a')]=function(_0x3b2ecf,_0x2e0438,_0x45934b){var _0x2df3d8={'raw':![],'where':{}};var _0x1c41c7={};var _0x969c2f={'count':0x0,'rows':[]};return db[_0xd556('0x4c')][_0xd556('0x62')]({'where':{'id':_0x3b2ecf[_0xd556('0x5d')]['id']}})[_0xd556('0x1e')](handleEntityNotFound(_0x2e0438,null))[_0xd556('0x1e')](function(_0x9b4044){if(_0x9b4044){_0x1c41c7[_0xd556('0x38')]=_['keys'](db[_0xd556('0x69')]['rawAttributes']);_0x1c41c7[_0xd556('0x3a')]=_[_0xd556('0x39')](_0x3b2ecf[_0xd556('0x3a')]);_0x1c41c7['filters']=_[_0xd556('0x3b')](_0x1c41c7[_0xd556('0x38')],_0x1c41c7[_0xd556('0x3a')]);_0x2df3d8[_0xd556('0x3d')]=_[_0xd556('0x3b')](_0x1c41c7['model'],qs[_0xd556('0x3c')](_0x3b2ecf['query']['fields']));_0x2df3d8[_0xd556('0x3d')]=_0x2df3d8[_0xd556('0x3d')][_0xd556('0x3e')]?_0x2df3d8['attributes']:_0x1c41c7[_0xd556('0x38')];if(!_0x3b2ecf['query'][_0xd556('0x3f')](_0xd556('0x40'))){_0x2df3d8[_0xd556('0x2c')]=qs['limit'](_0x3b2ecf['query'][_0xd556('0x2c')]);_0x2df3d8['offset']=qs[_0xd556('0x2b')](_0x3b2ecf['query'][_0xd556('0x2b')]);}_0x2df3d8[_0xd556('0x41')]=qs[_0xd556('0x42')](_0x3b2ecf[_0xd556('0x3a')][_0xd556('0x42')]);_0x2df3d8[_0xd556('0x45')]=qs[_0xd556('0x43')](_[_0xd556('0x44')](_0x3b2ecf['query'],_0x1c41c7[_0xd556('0x43')]));_0x2df3d8[_0xd556('0x45')]['ChatWebsiteId']=_0x9b4044['id'];if(_0x3b2ecf[_0xd556('0x3a')][_0xd556('0x63')]){_0x2df3d8[_0xd556('0x45')]=_[_0xd556('0x46')](_0x2df3d8[_0xd556('0x45')],{'$or':_[_0xd556('0x47')](_0x2df3d8[_0xd556('0x3d')],function(_0x536148){var _0x30cf38={};_0x30cf38[_0x536148]={'$like':'%'+_0x3b2ecf[_0xd556('0x3a')][_0xd556('0x63')]+'%'};return _0x30cf38;})});}_0x2df3d8=_[_0xd556('0x46')]({},_0x2df3d8,_0x3b2ecf[_0xd556('0x52')]);return db[_0xd556('0x69')]['count']({'where':_0x2df3d8['where']})['then'](function(_0x487b44){_0x969c2f[_0xd556('0x4d')]=_0x487b44;if(_0x3b2ecf[_0xd556('0x3a')][_0xd556('0x4e')]){_0x2df3d8[_0xd556('0x4f')]=[{'all':!![]}];}return db[_0xd556('0x69')][_0xd556('0x65')](_0x2df3d8);})['then'](function(_0x276ef9){_0x969c2f[_0xd556('0x50')]=_0x276ef9;return _0x969c2f;});}})[_0xd556('0x1e')](respondWithFilteredResult(_0x2e0438,_0x2df3d8))[_0xd556('0x53')](handleError(_0x2e0438,null));};exports[_0xd556('0x6b')]=function(_0x3f7e45,_0x55715e,_0x1295a2){return db['ChatWebsite'][_0xd556('0x59')]({'where':{'id':_0x3f7e45['params']['id']}})[_0xd556('0x1e')](handleEntityNotFound(_0x55715e,null))['then'](function(_0x397f09){if(_0x397f09){return _0x397f09[_0xd556('0x6b')](_0x3f7e45['query'][_0xd556('0x67')]);}})['then'](respondWithStatusCode(_0x55715e,null))[_0xd556('0x53')](handleError(_0x55715e,null));};exports[_0xd556('0x6c')]=function(_0x15c053,_0x385c4b,_0x562528){_0x15c053[_0xd556('0x55')][_0xd556('0x6d')]=_0x15c053[_0xd556('0x6e')][_0xd556('0x6f')];return db[_0xd556('0x4c')][_0xd556('0x59')]({'where':{'id':_0x15c053[_0xd556('0x5d')]['id']}})[_0xd556('0x1e')](handleEntityNotFound(_0x385c4b,null))[_0xd556('0x1e')](saveUpdates(_0x15c053[_0xd556('0x55')],null))['then'](respondWithResult(_0x385c4b,null))['catch'](handleError(_0x385c4b,null));};exports[_0xd556('0x70')]=function(_0x4b5338,_0x5167e1,_0x177df1){_0x4b5338['body'][_0xd556('0x71')]=_0x4b5338[_0xd556('0x6e')][_0xd556('0x6f')];return db[_0xd556('0x4c')][_0xd556('0x59')]({'where':{'id':_0x4b5338[_0xd556('0x5d')]['id']}})['then'](handleEntityNotFound(_0x5167e1,null))[_0xd556('0x1e')](saveUpdates(_0x4b5338['body'],null))[_0xd556('0x1e')](respondWithResult(_0x5167e1,null))[_0xd556('0x53')](handleError(_0x5167e1,null));};exports['addCustomerAvatar']=function(_0xa6ef51,_0xb29df1,_0x2e685b){_0xa6ef51[_0xd556('0x55')]['customerAvatar']=_0xa6ef51[_0xd556('0x6e')][_0xd556('0x6f')];return db['ChatWebsite']['find']({'where':{'id':_0xa6ef51[_0xd556('0x5d')]['id']}})[_0xd556('0x1e')](handleEntityNotFound(_0xb29df1,null))[_0xd556('0x1e')](saveUpdates(_0xa6ef51['body'],null))[_0xd556('0x1e')](respondWithResult(_0xb29df1,null))[_0xd556('0x53')](handleError(_0xb29df1,null));};exports[_0xd556('0x72')]=function(_0x448106,_0x2b787e,_0x2991c7){_0x448106['body'][_0xd556('0x73')]=_0x448106[_0xd556('0x6e')][_0xd556('0x6f')];return db[_0xd556('0x4c')][_0xd556('0x59')]({'where':{'id':_0x448106[_0xd556('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2b787e,null))['then'](saveUpdates(_0x448106[_0xd556('0x55')],null))[_0xd556('0x1e')](respondWithResult(_0x2b787e,null))[_0xd556('0x53')](handleError(_0x2b787e,null));};exports['getLogo']=function(_0x307175,_0x1a2b9e,_0x2ead5a){var _0x1d77a1=path[_0xd556('0x74')](config['root'],_0xd556('0x75'));var _0x345554={'where':{'id':_0x307175['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x53be6f=![];return require(_0xd556('0x76'))[_0xd556('0x77')]()['then'](function(_0xe11efa){if(_0xe11efa){_0x53be6f=_0xe11efa[_0xd556('0x78')];}})['then'](function(){return db[_0xd556('0x4c')][_0xd556('0x59')](_0x345554);})[_0xd556('0x1e')](handleEntityNotFound(_0x1a2b9e,null))['then'](function(_0x375215){if(_0x375215){if(!_[_0xd556('0x79')](_0x375215['sitepic'])){if(fs[_0xd556('0x7a')](path['join'](config['root'],'server/files/images/logos/',_0x375215['sitepic']))&&_0x53be6f){_0x1d77a1=path[_0xd556('0x74')](config[_0xd556('0x7b')],'server/files/images/logos/',_0x375215[_0xd556('0x6d')]);}}return _0x1a2b9e[_0xd556('0x7c')](_0x1d77a1);}})[_0xd556('0x53')](handleError(_0x1a2b9e,null));};exports[_0xd556('0x7d')]=function(_0x34eb18,_0x2efca4,_0x48e5b2){var _0x274b9f=path['join'](config[_0xd556('0x7b')],_0xd556('0x7e'));var _0x3f0116={'where':{'id':_0x34eb18['params']['id']},'attributes':['id',_0xd556('0x71')],'raw':!![]};return db['ChatWebsite'][_0xd556('0x59')](_0x3f0116)[_0xd556('0x1e')](handleEntityNotFound(_0x2efca4,null))[_0xd556('0x1e')](function(_0x20b745){if(_0x20b745){if(!_['isNil'](_0x20b745['agentAvatar'])){if(fs[_0xd556('0x7a')](path[_0xd556('0x74')](config[_0xd556('0x7b')],_0xd556('0x7f'),_0x20b745[_0xd556('0x71')]))){_0x274b9f=path['join'](config[_0xd556('0x7b')],_0xd556('0x7f'),_0x20b745[_0xd556('0x71')]);}}return _0x2efca4[_0xd556('0x7c')](_0x274b9f);}})[_0xd556('0x53')](handleError(_0x2efca4,null));};exports[_0xd556('0x80')]=function(_0xfb48c,_0x49795b,_0x2468ff){var _0xe0ffee=path[_0xd556('0x74')](config[_0xd556('0x7b')],'server/files/images/avatars/customer_avatar.png');var _0x1475fd={'where':{'id':_0xfb48c['params']['id']},'attributes':['id',_0xd556('0x81'),_0xd556('0x82')],'raw':!![]};return db[_0xd556('0x4c')]['find'](_0x1475fd)['then'](handleEntityNotFound(_0x49795b,null))[_0xd556('0x1e')](function(_0x3312bd){if(_0x3312bd){if(!_['isNil'](_0x3312bd[_0xd556('0x81')])){if(fs['existsSync'](path[_0xd556('0x74')](config[_0xd556('0x7b')],'server/files/images/avatars/',_0x3312bd[_0xd556('0x81')]))&&_0x3312bd[_0xd556('0x82')]){_0xe0ffee=path[_0xd556('0x74')](config['root'],_0xd556('0x7f'),_0x3312bd[_0xd556('0x81')]);}}return _0x49795b[_0xd556('0x7c')](_0xe0ffee);}})['catch'](handleError(_0x49795b,null));};exports[_0xd556('0x83')]=function(_0x1ed18d,_0x4921d2,_0x5c2a19){var _0x19f6cc=path[_0xd556('0x74')](config[_0xd556('0x7b')],'server/files/images/avatars/system_avatar.png');var _0x5f0902={'where':{'id':_0x1ed18d[_0xd556('0x5d')]['id']},'attributes':['id',_0xd556('0x73')],'raw':!![]};return db[_0xd556('0x4c')][_0xd556('0x59')](_0x5f0902)[_0xd556('0x1e')](handleEntityNotFound(_0x4921d2,null))[_0xd556('0x1e')](function(_0x5ccf94){if(_0x5ccf94){if(!_[_0xd556('0x79')](_0x5ccf94[_0xd556('0x73')])){if(fs[_0xd556('0x7a')](path[_0xd556('0x74')](config['root'],'server/files/images/avatars/',_0x5ccf94[_0xd556('0x73')]))){_0x19f6cc=path[_0xd556('0x74')](config['root'],'server/files/images/avatars/',_0x5ccf94['systemAvatar']);}}return _0x4921d2[_0xd556('0x7c')](_0x19f6cc);}})['catch'](handleError(_0x4921d2,null));};exports[_0xd556('0x84')]=function(_0x43f00b,_0x7bc07,_0x191c78){var _0x566bff=require(_0xd556('0x85'));var _0x12480b=new _0x566bff();var _0x117846=_0x12480b[_0xd556('0x86')](_0x43f00b[_0xd556('0x87')][_0xd556('0x88')])['getResult']();var _0x2c134a={'body':_0x43f00b[_0xd556('0x55')],'channel':'chat'};var _0x38d869=[];var _0x2003e4=[];var _0x34bd9d={};var _0x34b2c6=![];return db[_0xd556('0x89')][_0xd556('0x5f')]()[_0xd556('0x1e')](function(_0x3c6d93){if(!_0x3c6d93){throw new db['Sequelize']['ValidationError'](_0xd556('0x8a'));}_0x38d869=_[_0xd556('0x8b')](_[_0xd556('0x39')](_0x3c6d93),[_0xd556('0x8c'),_0xd556('0x8d')]);_0x2003e4=_[_0xd556('0x8b')](_[_0xd556('0x39')](_0x3c6d93),[_0xd556('0x8c'),_0xd556('0x8d'),_0xd556('0x8e'),_0xd556('0x8f')]);if(_0x43f00b[_0xd556('0x55')]['id']){delete _0x43f00b['body']['id'];}if(_['isNil'](_0x43f00b[_0xd556('0x55')][_0xd556('0x90')])){throw new db['Sequelize'][(_0xd556('0x91'))](_0xd556('0x92'));}if(_['isNil'](_0x43f00b[_0xd556('0x55')][_0xd556('0x55')])||_0x43f00b[_0xd556('0x55')][_0xd556('0x55')]===''){throw new db[(_0xd556('0x93'))][(_0xd556('0x91'))](_0xd556('0x94'));}if(_[_0xd556('0x79')](_0x43f00b[_0xd556('0x55')][_0xd556('0x95')])){throw new db[(_0xd556('0x93'))]['ValidationError'](_0xd556('0x96')+_0x2003e4);}if(!_[_0xd556('0x97')](_0x2003e4,_0x43f00b[_0xd556('0x55')]['mapKey'])){throw new db[(_0xd556('0x93'))][(_0xd556('0x91'))](_0xd556('0x98')+_0x2003e4);}_0x34bd9d[_0x43f00b[_0xd556('0x55')]['mapKey']]=_0x43f00b[_0xd556('0x55')][_0xd556('0x90')];})[_0xd556('0x1e')](function(){return db[_0xd556('0x4c')]['find']({'where':{'id':_0x43f00b[_0xd556('0x5d')]['id']},'include':[{'model':db[_0xd556('0x99')],'as':'List','include':[{'model':db['CmContact'],'as':_0xd556('0x9a'),'where':_0x34bd9d,'limit':0x1,'order':[[_0xd556('0x8d'),_0xd556('0x9b')]]}]},{'model':db[_0xd556('0x9c')],'as':_0xd556('0x9d')}]});})[_0xd556('0x1e')](handleEntityNotFound(_0x7bc07,null))[_0xd556('0x1e')](function(_0x5b44b8){if(_0x5b44b8&&_0x5b44b8[_0xd556('0x9e')]){_0x2c134a['account']=_0x5b44b8;_0x2c134a[_0xd556('0x9f')]=_0x5b44b8['Applications'];_0x2c134a['list']=_0x5b44b8['List'];_0x2c134a['applications']=_[_0xd556('0xa0')](_0x2c134a[_0xd556('0x9f')],[_0xd556('0xa1')],['asc']);if(_0x2c134a[_0xd556('0xa2')][_0xd556('0x9d')]){delete _0x2c134a[_0xd556('0xa2')]['Applications'];}if(_0x2c134a['account'][_0xd556('0x9e')]&&_0x2c134a[_0xd556('0xa2')][_0xd556('0x9e')][_0xd556('0x9a')][_0xd556('0x3e')]){return _0x2c134a[_0xd556('0xa2')][_0xd556('0x9e')]['Contacts'][0x0];}var _0x596f54=_['defaults'](_0x43f00b['body'],{'firstName':_0x43f00b[_0xd556('0x55')]['from'],'ListId':_0x5b44b8[_0xd556('0x8f')]});_0x596f54[_0x43f00b[_0xd556('0x55')]['mapKey']]=_0x43f00b[_0xd556('0x55')][_0xd556('0x90')];return db[_0xd556('0x89')][_0xd556('0x54')](_0x596f54,{'fields':_0x38d869,'raw':!![]});}})[_0xd556('0x1e')](handleEntityNotFound(_0x7bc07,null))[_0xd556('0x1e')](function(_0x27b4a5){_0x2c134a['contact']=_0x27b4a5;if(_0x27b4a5){var _0x35fa61={'ContactId':_0x27b4a5['id'],'ChatWebsiteId':_0x43f00b[_0xd556('0x5d')]['id'],'from':(_0x27b4a5['firstName']||'')+'\x20'+(_0x27b4a5[_0xd556('0xa3')]||''),'customerIp':_0x43f00b[_0xd556('0x55')][_0xd556('0xa4')],'referer':_0x43f00b[_0xd556('0x55')][_0xd556('0xa5')],'browserName':_0x117846['browser'][_0xd556('0x35')]&&_0x117846[_0xd556('0xa6')][_0xd556('0xa7')]?util[_0xd556('0xa8')](_0xd556('0xa9'),_0x117846[_0xd556('0xa6')][_0xd556('0x35')],_0x117846['browser'][_0xd556('0xa7')]):_0xd556('0xaa'),'browserVersion':_0x117846[_0xd556('0xa6')][_0xd556('0xa7')]||'unknown','osName':util[_0xd556('0xa8')]('%s\x20%s',_0x117846['os']['name'],_0x117846['os'][_0xd556('0xa7')]),'osVersion':_0x117846['os']['version'],'deviceModel':_0x117846[_0xd556('0xab')][_0xd556('0x38')]&&_0x117846[_0xd556('0xab')][_0xd556('0xac')]?util[_0xd556('0xa8')](_0xd556('0xad'),_0x117846[_0xd556('0xab')][_0xd556('0x38')],_0x117846[_0xd556('0xab')][_0xd556('0xac')],_0x117846[_0xd556('0xab')][_0xd556('0x48')]):null,'deviceVendor':_0x117846['device'][_0xd556('0xac')],'deviceType':_0x117846[_0xd556('0xab')][_0xd556('0x48')],'formData':JSON[_0xd556('0x24')](_0x43f00b[_0xd556('0x55')])};var _0x501cc0={'ChatWebsiteId':_0x43f00b[_0xd556('0x5d')]['id'],'closed':![]};if(_0x43f00b[_0xd556('0x55')][_0xd556('0xae')]){_0x501cc0['threadId']=_0x43f00b[_0xd556('0x55')][_0xd556('0xae')];return db[_0xd556('0xaf')][_0xd556('0x59')]({'where':_0x501cc0})[_0xd556('0x1e')](function(_0x161ddc){if(_0x161ddc){return[_0x161ddc,![]];}_0x35fa61[_0xd556('0xae')]=_0x43f00b['body'][_0xd556('0xae')];_0x35fa61[_0xd556('0xb0')]=_0x43f00b['body'][_0xd556('0xb0')];return db[_0xd556('0xaf')][_0xd556('0x54')](_0x35fa61)[_0xd556('0x1e')](function(_0x5ef2b5){return[_0x5ef2b5,!![]];});});}_0x501cc0['ContactId']=_0x27b4a5['id'];if(_0x43f00b[_0xd556('0x55')]['interaction']&&_0x43f00b[_0xd556('0x55')][_0xd556('0xb1')]['id']){_0x501cc0['id']=_0x43f00b[_0xd556('0x55')]['interaction']['id'];return db[_0xd556('0xaf')][_0xd556('0x59')]({'where':_0x501cc0})[_0xd556('0x1e')](function(_0x500b66){if(_0x500b66){return[_0x500b66,![]];}return db[_0xd556('0xaf')][_0xd556('0x54')](_0x35fa61)[_0xd556('0x1e')](function(_0x4ba99b){return[_0x4ba99b,!![]];});});}return db[_0xd556('0xaf')][_0xd556('0x54')](_0x35fa61)[_0xd556('0x1e')](function(_0x1acd94){return[_0x1acd94,!![]];});}})[_0xd556('0xb2')](function(_0xda6780,_0x5bc5e5){if(_0xda6780){_0x34b2c6=_0x5bc5e5;if(!_0x5bc5e5){var _0x4582ee={'from':(_0x2c134a[_0xd556('0xb3')]['firstName']||'')+'\x20'+(_0x2c134a[_0xd556('0xb3')]['lastName']||'')};if(_0x43f00b[_0xd556('0x55')][_0xd556('0xae')]&&_0x43f00b['body'][_0xd556('0xb4')]&&_0x43f00b[_0xd556('0x55')][_0xd556('0xae')]!=_0x43f00b[_0xd556('0x55')]['messageId']){_0x4582ee['threadId']=_0x43f00b[_0xd556('0x55')]['messageId'];}return _0xda6780[_0xd556('0x31')](_0x4582ee);}else{return _0xda6780;}}})[_0xd556('0x1e')](function(_0x1bb8f6){_0x2c134a[_0xd556('0xb1')]=_0x1bb8f6[_0xd556('0x33')]({'plain':!![]});_0x2c134a[_0xd556('0xb1')][_0xd556('0xb5')]=_0x34b2c6;if(_0x2c134a[_0xd556('0xb1')][_0xd556('0xb5')]){if(_0x2c134a['account']['autoclose']){_0x2c134a[_0xd556('0x9f')][_0xd556('0xb6')]({'id':0x0,'priority':_0x2c134a[_0xd556('0x9f')][_0xd556('0x3e')]+0x1,'app':_0xd556('0xb7'),'appdata':_0xd556('0xb8'),'interval':_0xd556('0xb9')});}}return db[_0xd556('0xba')][_0xd556('0x54')]({'body':_0x43f00b[_0xd556('0x55')][_0xd556('0x55')],'ChatWebsiteId':_0x43f00b[_0xd556('0x5d')]['id'],'ChatInteractionId':_0x1bb8f6['id'],'direction':'in','ContactId':_0x2c134a[_0xd556('0xb3')]['id'],'AttachmentId':_0x43f00b[_0xd556('0x55')]['AttachmentId']});})[_0xd556('0x1e')](function(_0x2ee3e5){_0x2c134a[_0xd556('0x26')]=_0x2ee3e5;if(_0x2c134a[_0xd556('0xb1')][_0xd556('0xbb')]){return db[_0xd556('0xbc')][_0xd556('0x59')]({'attributes':['id',_0xd556('0x35')],'where':{'id':_0x2c134a[_0xd556('0xb1')][_0xd556('0xbb')]}})[_0xd556('0x1e')](function(_0x30bcce){if(_0x30bcce){_0x2c134a[_0xd556('0x9f')][_0xd556('0xbd')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x30bcce[_0xd556('0x35')]+','+(_0x2c134a['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x2c134a[_0xd556('0xbe')]=!![];}return respondWithRpcPromise(_0xd556('0xbf'),_0xd556('0xc0'),_0x2c134a);});}return respondWithRpcPromise(_0xd556('0xbf'),_0xd556('0xc0'),_0x2c134a);})[_0xd556('0x1e')](function(_0x15df68){respondWithRpcPromise(_0xd556('0xc1'),_0xd556('0xc1'),{'event':_0xd556('0x84'),'message':_0x15df68},client9002);return _0x15df68;})['then'](respondWithResult(_0x7bc07,null))[_0xd556('0x53')](handleError(_0x7bc07,null));};exports['offline']=function(_0x4819c8,_0x3b5728,_0x4181b6){var _0x2f620d,_0x94daf2,_0xb22505;var _0x39738e=[];var _0x413a57=[];var _0x1524c0={};return db['CmContact'][_0xd556('0x5f')]()[_0xd556('0x1e')](function(_0x50cdc2){if(!_0x50cdc2){throw new db[(_0xd556('0x93'))][(_0xd556('0x91'))]('no\x20available\x20attributes');}_0x413a57=_[_0xd556('0x8b')](_[_0xd556('0x39')](_0x50cdc2),['createdAt',_0xd556('0x8d')]);_0x39738e=_['difference'](_[_0xd556('0x39')](_0x50cdc2),['createdAt','updatedAt',_0xd556('0x8e'),'ListId']);if(_0x4819c8[_0xd556('0x55')]['id']){delete _0x4819c8[_0xd556('0x55')]['id'];}if(_[_0xd556('0x79')](_0x4819c8['body']['from'])){throw _0x3b5728[_0xd556('0x29')](0x1f4)['send'](new db[(_0xd556('0x93'))][(_0xd556('0x91'))](_0xd556('0x92')));}if(_[_0xd556('0x79')](_0x4819c8['body'][_0xd556('0x55')])||_0x4819c8[_0xd556('0x55')][_0xd556('0x55')]===''){throw _0x3b5728[_0xd556('0x29')](0x1f4)[_0xd556('0xc2')](new db[(_0xd556('0x93'))]['ValidationError'](_0xd556('0x94')));}if(_[_0xd556('0x79')](_0x4819c8['body'][_0xd556('0xc3')])){throw _0x3b5728[_0xd556('0x29')](0x1f4)['send'](new db[(_0xd556('0x93'))]['ValidationError'](_0xd556('0xc4')+_0x39738e));}if(!_[_0xd556('0x97')](_0x39738e,_0x4819c8[_0xd556('0x55')]['mapKeyOffline'])){throw _0x3b5728[_0xd556('0x29')](0x1f4)['send'](new db[(_0xd556('0x93'))][(_0xd556('0x91'))](_0xd556('0xc5')+_0x39738e));}_0x1524c0[_0x4819c8['body'][_0xd556('0xc3')]]=_0x4819c8[_0xd556('0x55')][_0xd556('0x90')];})[_0xd556('0x1e')](function(){return db[_0xd556('0x4c')][_0xd556('0x59')]({'where':{'id':_0x4819c8[_0xd556('0x5d')]['id']},'include':[{'model':db[_0xd556('0x99')],'as':_0xd556('0x9e')}]});})[_0xd556('0x1e')](handleEntityNotFound(_0x3b5728,null))['then'](function(_0x155651){if(_0x155651&&_0x155651[_0xd556('0x9e')]){_0x94daf2=_0x155651;var _0x39a588=_[_0xd556('0x17')](_0x4819c8['body'],{'firstName':_0x4819c8[_0xd556('0x55')][_0xd556('0x90')],'phone':_0x4819c8[_0xd556('0x55')]['from'],'ListId':_0x155651[_0xd556('0x8f')]});_0x39a588[_0x4819c8['body'][_0xd556('0xc3')]]=_0x4819c8[_0xd556('0x55')][_0xd556('0x90')];return db[_0xd556('0x89')][_0xd556('0xc6')]({'where':_0x1524c0,'defaults':_0x39a588});}})[_0xd556('0xb2')](function(_0x16f04b){if(_0x16f04b){_0xb22505=_0x16f04b;var _0x242a93=fs['readFileSync'](path[_0xd556('0x74')](config['root'],_0xd556('0xc7')),_0xd556('0xc8'));var _0x168ab0=ejs[_0xd556('0xc9')](_0x242a93,{'body':_[_0xd556('0xca')](_0x4819c8['body'][_0xd556('0x55')]),'bodyTitle':_0x94daf2[_0xd556('0xcb')]});return db[_0xd556('0xcc')]['create']({'body':_0x168ab0,'ContactId':_0x16f04b['id'],'ChatWebsiteId':_0x94daf2['id']});}})[_0xd556('0x1e')](function(_0x23d684){if(_0x23d684){_0x2f620d=_0x23d684;return db[_0xd556('0xcd')][_0xd556('0x62')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})[_0xd556('0x1e')](function(_0x50c5fe){if(_0x50c5fe&&_0x50c5fe[_0xd556('0xce')]&&_0x94daf2[_0xd556('0xcf')]){var _0x5d0874={'tls':{'rejectUnauthorized':![]}};if(_0x50c5fe[_0xd556('0xce')][_0xd556('0xd0')]){_0x5d0874[_0xd556('0xd0')]=_0x50c5fe[_0xd556('0xce')][_0xd556('0xd0')];}else{_0x5d0874[_0xd556('0xd1')]=_0x50c5fe[_0xd556('0xce')][_0xd556('0xd1')];_0x5d0874['port']=_0x50c5fe[_0xd556('0xce')][_0xd556('0xd2')];_0x5d0874[_0xd556('0xd3')]=_0x50c5fe[_0xd556('0xce')][_0xd556('0xd3')];}if(_0x50c5fe[_0xd556('0xce')][_0xd556('0xd4')]){_0x5d0874['auth']={'user':_0x50c5fe[_0xd556('0xce')][_0xd556('0x58')],'pass':_0x50c5fe[_0xd556('0xce')][_0xd556('0xd5')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x5d0874,'message':{'from':util[_0xd556('0xa8')]('\x22%s\x22\x20<%s>',_0x50c5fe['name'],_0x50c5fe[_0xd556('0xd6')]||_0x50c5fe[_0xd556('0xce')][_0xd556('0x58')]),'to':_0x94daf2['forwardOfflineAddress'],'subject':_0x94daf2[_0xd556('0xd7')],'text':_0x2f620d[_0xd556('0x55')]}},client9003)[_0xd556('0x1e')](function(){return _0x2f620d;})[_0xd556('0x53')](function(_0x90fa10){console[_0xd556('0x25')](_0x90fa10);});}})[_0xd556('0x1e')](function(){if(_0x2f620d){return _0x2f620d;}})[_0xd556('0x1e')](respondWithResult(_0x3b5728,null))[_0xd556('0x53')](handleError(_0x3b5728,null));};exports[_0xd556('0xd8')]=function(_0x59c008,_0x3e199d,_0x34b825){return db[_0xd556('0xaf')][_0xd556('0x59')]({'where':{'id':_0x59c008[_0xd556('0x5d')]['id']}})[_0xd556('0x1e')](handleEntityNotFound(_0x3e199d,null))[_0xd556('0x1e')](function(_0x2518ed){if(_0x2518ed){return _0x2518ed[_0xd556('0xd8')](_0x59c008[_0xd556('0x55')][_0xd556('0x67')],_[_0xd556('0xd9')](_0x59c008[_0xd556('0x55')],['ids','id'])||{});}})[_0xd556('0x1e')](respondWithResult(_0x3e199d,null))[_0xd556('0x53')](handleError(_0x3e199d,null));};exports[_0xd556('0xda')]=function(_0x4a9d71,_0x5900f7,_0x2ab01a){var _0x348cf2={'raw':![],'where':{}};var _0x3dd305={};var _0x53126f={'count':0x0,'rows':[]};return db[_0xd556('0x4c')]['findOne']({'where':{'id':_0x4a9d71['params']['id']}})[_0xd556('0x1e')](handleEntityNotFound(_0x5900f7,null))[_0xd556('0x1e')](function(_0x1b231c){if(_0x1b231c){_0x3dd305[_0xd556('0x38')]=_[_0xd556('0x39')](db['ChatInteraction'][_0xd556('0x37')]);_0x3dd305[_0xd556('0x3a')]=_[_0xd556('0x39')](_0x4a9d71[_0xd556('0x3a')]);_0x3dd305[_0xd556('0x43')]=_[_0xd556('0x3b')](_0x3dd305['model'],_0x3dd305[_0xd556('0x3a')]);_0x348cf2[_0xd556('0x3d')]=_[_0xd556('0x3b')](_0x3dd305[_0xd556('0x38')],qs[_0xd556('0x3c')](_0x4a9d71[_0xd556('0x3a')][_0xd556('0x3c')]));_0x348cf2[_0xd556('0x3d')]=_0x348cf2[_0xd556('0x3d')]['length']?_0x348cf2[_0xd556('0x3d')]:_0x3dd305[_0xd556('0x38')];if(!_0x4a9d71['query'][_0xd556('0x3f')]('nolimit')){_0x348cf2[_0xd556('0x2c')]=qs['limit'](_0x4a9d71[_0xd556('0x3a')][_0xd556('0x2c')]);_0x348cf2['offset']=qs['offset'](_0x4a9d71[_0xd556('0x3a')][_0xd556('0x2b')]);}_0x348cf2[_0xd556('0x41')]=qs[_0xd556('0x42')](_0x4a9d71[_0xd556('0x3a')][_0xd556('0x42')]);_0x348cf2[_0xd556('0x45')]=qs[_0xd556('0x43')](_[_0xd556('0x44')](_0x4a9d71[_0xd556('0x3a')],_0x3dd305[_0xd556('0x43')]));_0x348cf2[_0xd556('0x45')][_0xd556('0x61')]=_0x1b231c['id'];if(_0x4a9d71[_0xd556('0x3a')]['filter']){_0x348cf2['where']=_[_0xd556('0x46')](_0x348cf2[_0xd556('0x45')],{'$or':_['map'](_0x348cf2['attributes'],function(_0x539c12){var _0x43342b={};_0x43342b[_0x539c12]={'$like':'%'+_0x4a9d71[_0xd556('0x3a')][_0xd556('0x63')]+'%'};return _0x43342b;})});}_0x348cf2=_[_0xd556('0x46')]({},_0x348cf2,_0x4a9d71[_0xd556('0x52')]);return db[_0xd556('0xaf')]['count']({'where':_0x348cf2['where']})[_0xd556('0x1e')](function(_0x5c5502){_0x53126f[_0xd556('0x4d')]=_0x5c5502;if(_0x4a9d71[_0xd556('0x3a')][_0xd556('0x4e')]){_0x348cf2['include']=[{'model':db[_0xd556('0x89')],'as':_0xd556('0xdb'),'required':![]},{'model':db['User'],'as':_0xd556('0xdc'),'attributes':['name',_0xd556('0xdd'),'internal'],'required':![]},{'model':db['Tag'],'as':_0xd556('0xde'),'attributes':['id',_0xd556('0x35'),'color'],'where':_0x4a9d71[_0xd556('0x3a')][_0xd556('0xdf')]?{'id':_0x4a9d71['query'][_0xd556('0xdf')]}:undefined,'required':_0x4a9d71[_0xd556('0x3a')][_0xd556('0xdf')]?!![]:![]}];}return db[_0xd556('0xaf')][_0xd556('0x65')](_0x348cf2);})[_0xd556('0x1e')](function(_0x43d776){_0x53126f['rows']=_0x43d776;return _0x53126f;});}})[_0xd556('0x1e')](respondWithFilteredResult(_0x5900f7,_0x348cf2))[_0xd556('0x53')](handleError(_0x5900f7,null));};function iftimePromise(_0x48e8c9,_0xff0c3d){return respondWithRpcPromise('Command',_0xd556('0xe0'),{'command':_0xff0c3d[_0xd556('0xe1')]?util[_0xd556('0xa8')](_0xd556('0xe2'),_0x48e8c9['interval'],_0xff0c3d[_0xd556('0xe1')]):util[_0xd556('0xa8')](_0xd556('0xe3'),_0x48e8c9[_0xd556('0xe4')])},client9002)['then'](function(_0x47ee7c){var _0x467260=_0x47ee7c&&_0x47ee7c[_0xd556('0xe5')]('true')>=0x0?!![]:![];logger['info'](_0xd556('0xe6'),_0xff0c3d['id'],_0x48e8c9['id'],_0x48e8c9[_0xd556('0xe4')],_0x467260?_0xd556('0xe7'):_0xd556('0xe8'),_0xff0c3d[_0xd556('0xe1')]?_0xff0c3d[_0xd556('0xe1')]:_0xd556('0xe9'));return _0x467260;})[_0xd556('0x53')](function(_0x2fd1a9){logger[_0xd556('0x25')](_0xd556('0xe6'),_0xff0c3d['id'],_0x48e8c9['id'],_0x48e8c9[_0xd556('0xe4')],util['inspect'](_0x2fd1a9,{'showHidden':![],'depth':null}),_0xff0c3d[_0xd556('0xe1')]?_0xff0c3d[_0xd556('0xe1')]:_0xd556('0xe9'));return![];});}exports[_0xd556('0xe0')]=function(_0x544f04,_0x1e958b,_0x8d1542){var _0x2a39a7=0x0;var _0x3c1f46=0x0;var _0x55678a=![];var _0x425c6f;var _0x275ff2;return db[_0xd556('0x4c')][_0xd556('0x59')]({'where':{'id':_0x544f04[_0xd556('0x5d')]['id']},'include':[{'model':db[_0xd556('0xea')],'as':'Interval','include':[{'model':db[_0xd556('0xea')],'as':_0xd556('0xeb'),'attributes':['id',_0xd556('0xe4')],'raw':!![]}]}]})[_0xd556('0x1e')](handleEntityNotFound(_0x1e958b,null))['then'](function(_0x4652f2){if(_0x4652f2){_0x425c6f=_0x4652f2;return _0x4652f2['getProactiveActions']({'raw':!![]});}})[_0xd556('0x1e')](function(_0xfb1513){if(_0x425c6f){if(_0xfb1513){_0x275ff2=_0xfb1513;}}return require(_0xd556('0x76'))[_0xd556('0x77')]();})[_0xd556('0x1e')](function(_0x3f0654){if(_0x3f0654){_0x3c1f46=_0x3f0654[_0xd556('0xec')];_0x55678a=_0x3f0654['custom'];}})[_0xd556('0x1e')](function(){return db[_0xd556('0xaf')][_0xd556('0x4d')]({'where':{'closed':![]}});})[_0xd556('0x1e')](function(_0x3ebba7){_0x2a39a7=_0x3ebba7;if(_0x3c1f46&&_0x3ebba7>_0x3c1f46){return db[_0xd556('0xed')]['findOne']({'where':{'id':0x1}})[_0xd556('0x1e')](function(_0x52567b){if(_0x52567b){_0x52567b['increment'](_0xd556('0xee'));}});}})[_0xd556('0x1e')](function(){if(_0x425c6f[_0xd556('0xea')]&&_0x425c6f['Interval'][_0xd556('0xeb')]){var _0x36182d=[];for(var _0x5d9384=0x0;_0x5d9384<_0x425c6f['Interval'][_0xd556('0xeb')][_0xd556('0x3e')];_0x5d9384++){var _0xdb6232=_0x425c6f[_0xd556('0xea')]['Intervals'][_0x5d9384][_0xd556('0x33')]({'plain':!![]});_0x36182d[_0xd556('0xb6')](iftimePromise(_0xdb6232,_0x425c6f));}return BPromise[_0xd556('0xef')](_0x36182d)[_0xd556('0x1e')](function(_0x75b016){return _[_0xd556('0xf0')](_0x75b016);});}else{return!![];}})[_0xd556('0x1e')](function(_0x170cdd){var _0x33a435=fs[_0xd556('0xf1')](path['join'](config[_0xd556('0x7b')],_0xd556('0xf2')),_0xd556('0xc8'));var _0x1a9873={'remote':_0x425c6f['remote'],'query':querystring['stringify'](_[_0xd556('0x46')](_0x425c6f[_0xd556('0x33')]({'plain':!![]}),{'customerIp':_0x544f04[_0xd556('0x87')][_0xd556('0xf3')]||_0x544f04[_0xd556('0x87')][_0xd556('0xf4')]||_0x544f04[_0xd556('0xf5')]['remoteAddress']||_0x544f04['ip'],'referer':_0x544f04['headers'][_0xd556('0xa5')],'openedInteractions':_0x2a39a7,'maxInteractions':_0x3c1f46,'virtual':_0x55678a[_0xd556('0xec')],'online':_0x170cdd,'custom':_0x55678a}))[_0xd556('0xf6')](/'/g,'\x5c\x27')};_0x1e958b[_0xd556('0xc2')](ejs[_0xd556('0xc9')](Mustache['render'](_0x33a435,_0x1a9873),{'proactiveActions':_0x275ff2,'alignment':_0x425c6f[_0xd556('0xf7')],'verticalAlignment':_0x425c6f[_0xd556('0xf8')]}));})[_0xd556('0x53')](handleError(_0x1e958b,null));};exports[_0xd556('0xf9')]=function(_0x43819e,_0x295431,_0x343bce){return db[_0xd556('0x4c')][_0xd556('0x62')]({'where':{'id':_0x43819e[_0xd556('0x5d')]['id']}})['then'](handleEntityNotFound(_0x295431,null))[_0xd556('0x1e')](function(_0x1c8c46){if(_0x1c8c46){return db['sequelize'][_0xd556('0xfa')](function(_0x27ff74){return db['ChatApplication'][_0xd556('0x32')]({'where':{'ChatWebsiteId':_0x43819e[_0xd556('0x5d')]['id']},'transaction':_0x27ff74})[_0xd556('0x1e')](function(_0x121a7c){var _0x36fd9e=_['map'](_0x43819e[_0xd556('0x55')],function(_0x38d112){_0x38d112[_0xd556('0x61')]=_0x43819e['params']['id'];return _0x38d112;});return db[_0xd556('0x9c')]['bulkCreate'](_0x36fd9e,{'transaction':_0x27ff74});});})[_0xd556('0x1e')](function(){return db[_0xd556('0x9c')][_0xd556('0xfb')]({'where':{'ChatWebsiteId':_0x43819e[_0xd556('0x5d')]['id']},'order':_0xd556('0xa1')});});}})[_0xd556('0x1e')](respondWithResult(_0x295431,null))['catch'](handleError(_0x295431,null));};exports[_0xd556('0xfc')]=function(_0x4f4be5,_0x3a1e16,_0x564270){var _0x557851={};var _0x3165d4={};var _0x283faa;var _0x477f4f;return db['ChatWebsite'][_0xd556('0x62')]({'where':{'id':_0x4f4be5[_0xd556('0x5d')]['id']}})[_0xd556('0x1e')](handleEntityNotFound(_0x3a1e16,null))[_0xd556('0x1e')](function(_0x23c294){if(_0x23c294){_0x283faa=_0x23c294;_0x3165d4[_0xd556('0x38')]=_[_0xd556('0x39')](db[_0xd556('0x9c')][_0xd556('0x37')]);_0x3165d4[_0xd556('0x3a')]=_['keys'](_0x4f4be5['query']);_0x3165d4[_0xd556('0x43')]=_[_0xd556('0x3b')](_0x3165d4[_0xd556('0x38')],_0x3165d4[_0xd556('0x3a')]);_0x557851[_0xd556('0x3d')]=_[_0xd556('0x3b')](_0x3165d4['model'],qs[_0xd556('0x3c')](_0x4f4be5[_0xd556('0x3a')][_0xd556('0x3c')]));_0x557851['attributes']=_0x557851[_0xd556('0x3d')][_0xd556('0x3e')]?_0x557851['attributes']:_0x3165d4[_0xd556('0x38')];_0x557851[_0xd556('0x41')]=qs['sort'](_0x4f4be5[_0xd556('0x3a')]['sort']);_0x557851[_0xd556('0x45')]=qs[_0xd556('0x43')](_[_0xd556('0x44')](_0x4f4be5[_0xd556('0x3a')],_0x3165d4[_0xd556('0x43')]));if(_0x4f4be5['query']['filter']){_0x557851[_0xd556('0x45')]=_['merge'](_0x557851[_0xd556('0x45')],{'$or':_[_0xd556('0x47')](_0x557851[_0xd556('0x3d')],function(_0x16dfaf){var _0x204ea6={};_0x204ea6[_0x16dfaf]={'$like':'%'+_0x4f4be5[_0xd556('0x3a')]['filter']+'%'};return _0x204ea6;})});}_0x557851=_[_0xd556('0x46')]({},_0x557851,_0x4f4be5[_0xd556('0x52')]);return _0x283faa[_0xd556('0xfc')](_0x557851);}})[_0xd556('0x1e')](function(_0x14a571){if(_0x14a571){_0x477f4f=_0x14a571[_0xd556('0x3e')];if(!_0x4f4be5['query'][_0xd556('0x3f')](_0xd556('0x40'))){_0x557851['limit']=qs['limit'](_0x4f4be5['query'][_0xd556('0x2c')]);_0x557851['offset']=qs['offset'](_0x4f4be5[_0xd556('0x3a')][_0xd556('0x2b')]);}return _0x283faa['getApplications'](_0x557851);}})[_0xd556('0x1e')](function(_0x18e8e5){if(_0x18e8e5){return _0x18e8e5?{'count':_0x477f4f,'rows':_0x18e8e5}:null;}})[_0xd556('0x1e')](respondWithResult(_0x3a1e16,null))[_0xd556('0x53')](handleError(_0x3a1e16,null));};exports['addProactiveActions']=function(_0x25ad53,_0x516743,_0x413721){return db[_0xd556('0xfd')][_0xd556('0x59')]({'where':{'id':_0x25ad53[_0xd556('0x5d')]['id']}})[_0xd556('0x1e')](handleEntityNotFound(_0x516743,null))['then'](function(_0x1b3805){if(_0x1b3805){return _0x1b3805[_0xd556('0xfe')](_0x25ad53[_0xd556('0x55')][_0xd556('0x67')],_[_0xd556('0xd9')](_0x25ad53[_0xd556('0x55')],['ids','id'])||{});}})[_0xd556('0x1e')](respondWithResult(_0x516743,null))[_0xd556('0x53')](handleError(_0x516743,null));};exports[_0xd556('0xff')]=function(_0x537156,_0x36dac5,_0x3e235a){var _0x32861f={};var _0x26166c={};var _0x6f398b;var _0x19a01e;return db['ChatWebsite'][_0xd556('0x62')]({'where':{'id':_0x537156[_0xd556('0x5d')]['id']}})[_0xd556('0x1e')](handleEntityNotFound(_0x36dac5,null))[_0xd556('0x1e')](function(_0x3ef2e7){if(_0x3ef2e7){_0x6f398b=_0x3ef2e7;_0x26166c[_0xd556('0x38')]=_['keys'](db[_0xd556('0x100')][_0xd556('0x37')]);_0x26166c['query']=_[_0xd556('0x39')](_0x537156[_0xd556('0x3a')]);_0x26166c[_0xd556('0x43')]=_[_0xd556('0x3b')](_0x26166c[_0xd556('0x38')],_0x26166c['query']);_0x32861f[_0xd556('0x3d')]=_['intersection'](_0x26166c[_0xd556('0x38')],qs[_0xd556('0x3c')](_0x537156['query'][_0xd556('0x3c')]));_0x32861f[_0xd556('0x3d')]=_0x32861f[_0xd556('0x3d')][_0xd556('0x3e')]?_0x32861f[_0xd556('0x3d')]:_0x26166c[_0xd556('0x38')];_0x32861f['order']=qs[_0xd556('0x42')](_0x537156[_0xd556('0x3a')][_0xd556('0x42')]);_0x32861f[_0xd556('0x45')]=qs[_0xd556('0x43')](_[_0xd556('0x44')](_0x537156[_0xd556('0x3a')],_0x26166c[_0xd556('0x43')]));if(_0x537156[_0xd556('0x3a')][_0xd556('0x63')]){_0x32861f[_0xd556('0x45')]=_[_0xd556('0x46')](_0x32861f['where'],{'$or':_['map'](_0x32861f[_0xd556('0x3d')],function(_0x310de4){var _0x373e9c={};_0x373e9c[_0x310de4]={'$like':'%'+_0x537156[_0xd556('0x3a')]['filter']+'%'};return _0x373e9c;})});}_0x32861f=_['merge']({},_0x32861f,_0x537156[_0xd556('0x52')]);return _0x6f398b[_0xd556('0xff')](_0x32861f);}})['then'](function(_0x30d5fe){if(_0x30d5fe){_0x19a01e=_0x30d5fe[_0xd556('0x3e')];if(!_0x537156[_0xd556('0x3a')][_0xd556('0x3f')](_0xd556('0x40'))){_0x32861f[_0xd556('0x2c')]=qs[_0xd556('0x2c')](_0x537156[_0xd556('0x3a')][_0xd556('0x2c')]);_0x32861f[_0xd556('0x2b')]=qs[_0xd556('0x2b')](_0x537156[_0xd556('0x3a')][_0xd556('0x2b')]);}return _0x6f398b[_0xd556('0xff')](_0x32861f);}})[_0xd556('0x1e')](function(_0x286c70){if(_0x286c70){return _0x286c70?{'count':_0x19a01e,'rows':_0x286c70}:null;}})[_0xd556('0x1e')](respondWithResult(_0x36dac5,null))[_0xd556('0x53')](handleError(_0x36dac5,null));};exports['getFields']=function(_0x18ac76,_0x328219,_0x30cddd){var _0x14dd60=_0x18ac76[_0xd556('0x3a')]['online']===_0xd556('0x101')?_0xd556('0x102'):_0xd556('0x103');return db[_0xd556('0x4c')][_0xd556('0x59')]({'attributes':['id',_0x14dd60],'where':{'id':_0x18ac76[_0xd556('0x5d')]['id']}})[_0xd556('0x1e')](handleEntityNotFound(_0x328219,null))[_0xd556('0x1e')](function(_0xee4377){if(_0xee4377){var _0x41b63a=_0xee4377[_0x14dd60];var _0x2b8ed5=_0x41b63a&&_0x41b63a[_0xd556('0x104')]?_0x41b63a[_0xd556('0x104')]:[];_0x328219[_0xd556('0xc2')]({'fromKey':_['isNil'](_0x41b63a[_0xd556('0x105')])?undefined:_0x41b63a[_0xd556('0x105')],'count':_0x2b8ed5[_0xd556('0x3e')],'rows':_0x2b8ed5});}})[_0xd556('0x53')](handleError(_0x328219,null));};exports[_0xd556('0x106')]=function(_0x350d5e,_0x274d36,_0x5bd3be){var _0x16f163={'raw':!![],'where':{}};var _0x4e18db={};var _0x1749af={'count':0x0,'rows':[]};return db[_0xd556('0x4c')][_0xd556('0x62')]({'where':{'id':_0x350d5e[_0xd556('0x5d')]['id']}})[_0xd556('0x1e')](handleEntityNotFound(_0x274d36,null))[_0xd556('0x1e')](function(_0x17c47b){if(_0x17c47b){_0x4e18db[_0xd556('0x38')]=_[_0xd556('0x39')](db['ChatOfflineMessage']['rawAttributes']);_0x4e18db[_0xd556('0x3a')]=_[_0xd556('0x39')](_0x350d5e[_0xd556('0x3a')]);_0x4e18db[_0xd556('0x43')]=_['intersection'](_0x4e18db['model'],_0x4e18db['query']);_0x16f163[_0xd556('0x3d')]=_[_0xd556('0x3b')](_0x4e18db[_0xd556('0x38')],qs['fields'](_0x350d5e[_0xd556('0x3a')][_0xd556('0x3c')]));_0x16f163[_0xd556('0x3d')]=_0x16f163[_0xd556('0x3d')][_0xd556('0x3e')]?_0x16f163[_0xd556('0x3d')]:_0x4e18db[_0xd556('0x38')];if(!_0x350d5e[_0xd556('0x3a')][_0xd556('0x3f')](_0xd556('0x40'))){_0x16f163[_0xd556('0x2c')]=qs['limit'](_0x350d5e[_0xd556('0x3a')][_0xd556('0x2c')]);_0x16f163['offset']=qs['offset'](_0x350d5e[_0xd556('0x3a')]['offset']);}_0x16f163[_0xd556('0x41')]=qs[_0xd556('0x42')](_0x350d5e[_0xd556('0x3a')][_0xd556('0x42')]);_0x16f163[_0xd556('0x45')]=qs[_0xd556('0x43')](_[_0xd556('0x44')](_0x350d5e[_0xd556('0x3a')],_0x4e18db['filters']));_0x16f163[_0xd556('0x45')][_0xd556('0x61')]=_0x17c47b['id'];if(_0x350d5e[_0xd556('0x3a')]['filter']){_0x16f163[_0xd556('0x45')]=_[_0xd556('0x46')](_0x16f163['where'],{'$or':_[_0xd556('0x47')](_0x16f163['attributes'],function(_0x41750a){var _0x16e861={};_0x16e861[_0x41750a]={'$like':'%'+_0x350d5e[_0xd556('0x3a')][_0xd556('0x63')]+'%'};return _0x16e861;})});}_0x16f163=_[_0xd556('0x46')]({},_0x16f163,_0x350d5e[_0xd556('0x52')]);return db[_0xd556('0xcc')]['count']({'where':_0x16f163[_0xd556('0x45')]})[_0xd556('0x1e')](function(_0x54d1d8){_0x1749af[_0xd556('0x4d')]=_0x54d1d8;if(_0x350d5e[_0xd556('0x3a')]['includeAll']){_0x16f163[_0xd556('0x4f')]=[{'all':!![]}];}return db[_0xd556('0xcc')][_0xd556('0x65')](_0x16f163);})[_0xd556('0x1e')](function(_0x3ba137){_0x1749af[_0xd556('0x50')]=_0x3ba137;return _0x1749af;});}})[_0xd556('0x1e')](respondWithFilteredResult(_0x274d36,_0x16f163))[_0xd556('0x53')](handleError(_0x274d36,null));};exports[_0xd556('0x107')]=function(_0x5153ea,_0x45277b,_0x1f560f){return db[_0xd556('0x4c')][_0xd556('0x59')]({'where':{'id':_0x5153ea[_0xd556('0x5d')]['id']}})['then'](handleEntityNotFound(_0x45277b,null))['then'](function(_0x431f24){if(_0x431f24){return _0x431f24[_0xd556('0x107')](_0x5153ea[_0xd556('0x55')][_0xd556('0x67')],_['omit'](_0x5153ea[_0xd556('0x55')],[_0xd556('0x67'),'id'])||{})[_0xd556('0xb2')](function(_0x13696b){for(var _0x34afa8=0x0;_0x34afa8<_0x5153ea[_0xd556('0x55')][_0xd556('0x67')]['length'];_0x34afa8+=0x1){socket[_0xd556('0x108')](_0xd556('0x109'),{'UserId':_0x5153ea[_0xd556('0x55')]['ids'][_0x34afa8],'ChatWebsiteId':_0x5153ea[_0xd556('0x5d')]['id']});}return _0x13696b;});}})[_0xd556('0x1e')](respondWithResult(_0x45277b,null))[_0xd556('0x53')](handleError(_0x45277b,null));};exports['removeAgents']=function(_0x2d575f,_0x1538aa,_0x590297){return db['ChatWebsite'][_0xd556('0x59')]({'where':{'id':_0x2d575f[_0xd556('0x5d')]['id']}})[_0xd556('0x1e')](handleEntityNotFound(_0x1538aa,null))[_0xd556('0x1e')](function(_0x566ac9){if(_0x566ac9){return _0x566ac9[_0xd556('0x10a')](_0x2d575f[_0xd556('0x3a')][_0xd556('0x67')])[_0xd556('0x1e')](function(){if(_[_0xd556('0x10b')](_0x2d575f[_0xd556('0x3a')][_0xd556('0x67')])){for(var _0x3d5ed7=0x0;_0x3d5ed7<_0x2d575f[_0xd556('0x3a')][_0xd556('0x67')]['length'];_0x3d5ed7+=0x1){socket['emit'](_0xd556('0x10c'),{'UserId':Number(_0x2d575f['query'][_0xd556('0x67')][_0x3d5ed7]),'ChatWebsiteId':Number(_0x2d575f['params']['id'])});}}else{socket[_0xd556('0x108')](_0xd556('0x10c'),{'UserId':Number(_0x2d575f[_0xd556('0x3a')]['ids']),'ChatWebsiteId':Number(_0x2d575f[_0xd556('0x5d')]['id'])});}});}})[_0xd556('0x1e')](respondWithStatusCode(_0x1538aa,null))[_0xd556('0x53')](handleError(_0x1538aa,null));};exports['getAgents']=function(_0xdb8408,_0x42b8be,_0x1c6603){var _0x2b8be1={};var _0x2f2479={};var _0x4274cd;var _0x5a30ae;return db[_0xd556('0x4c')][_0xd556('0x62')]({'where':{'id':_0xdb8408[_0xd556('0x5d')]['id']}})[_0xd556('0x1e')](handleEntityNotFound(_0x42b8be,null))[_0xd556('0x1e')](function(_0x5f3cc1){if(_0x5f3cc1){_0x4274cd=_0x5f3cc1;_0x2f2479[_0xd556('0x38')]=_[_0xd556('0x39')](db[_0xd556('0xbc')][_0xd556('0x37')]);_0x2f2479[_0xd556('0x3a')]=_[_0xd556('0x39')](_0xdb8408[_0xd556('0x3a')]);_0x2f2479[_0xd556('0x43')]=_[_0xd556('0x3b')](_0x2f2479['model'],_0x2f2479[_0xd556('0x3a')]);_0x2b8be1[_0xd556('0x3d')]=_[_0xd556('0x3b')](_0x2f2479['model'],qs[_0xd556('0x3c')](_0xdb8408[_0xd556('0x3a')][_0xd556('0x3c')]));_0x2b8be1[_0xd556('0x3d')]=_0x2b8be1['attributes'][_0xd556('0x3e')]?_0x2b8be1[_0xd556('0x3d')]:_0x2f2479['model'];_0x2b8be1['order']=qs[_0xd556('0x42')](_0xdb8408[_0xd556('0x3a')][_0xd556('0x42')]);_0x2b8be1[_0xd556('0x45')]=qs[_0xd556('0x43')](_[_0xd556('0x44')](_0xdb8408[_0xd556('0x3a')],_0x2f2479[_0xd556('0x43')]));if(_0xdb8408[_0xd556('0x3a')][_0xd556('0x63')]){_0x2b8be1[_0xd556('0x45')]=_[_0xd556('0x46')](_0x2b8be1['where'],{'$or':_[_0xd556('0x47')](_0x2b8be1[_0xd556('0x3d')],function(_0x390025){var _0x7d769c={};_0x7d769c[_0x390025]={'$like':'%'+_0xdb8408[_0xd556('0x3a')]['filter']+'%'};return _0x7d769c;})});}_0x2b8be1=_[_0xd556('0x46')]({},_0x2b8be1,_0xdb8408[_0xd556('0x52')]);return _0x4274cd[_0xd556('0x10d')](_0x2b8be1);}})[_0xd556('0x1e')](function(_0x3bfcb3){if(_0x3bfcb3){_0x5a30ae=_0x3bfcb3[_0xd556('0x3e')];if(!_0xdb8408[_0xd556('0x3a')][_0xd556('0x3f')](_0xd556('0x40'))){_0x2b8be1[_0xd556('0x2c')]=qs[_0xd556('0x2c')](_0xdb8408[_0xd556('0x3a')][_0xd556('0x2c')]);_0x2b8be1[_0xd556('0x2b')]=qs[_0xd556('0x2b')](_0xdb8408['query'][_0xd556('0x2b')]);}return _0x4274cd[_0xd556('0x10d')](_0x2b8be1);}})[_0xd556('0x1e')](function(_0x1e1711){if(_0x1e1711){return _0x1e1711?{'count':_0x5a30ae,'rows':_0x1e1711}:null;}})[_0xd556('0x1e')](respondWithResult(_0x42b8be,null))[_0xd556('0x53')](handleError(_0x42b8be,null));}; \ No newline at end of file +var _0x0bc1=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','./chatWebsite.socket','register','jayson/promise','client','http','test','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','status','json','offset','Content-Range','save','update','get','ChatWebsites','UserProfileResource','destroy','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','model','query','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','filter','merge','map','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','findOne','hasOwnProperty','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.png','../../config/license/util','getLicense','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','getResult','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','asc','contact','firstName','customerIp','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','type','stringify','threadId','ChatInteraction','externalUrl','interaction','messageId','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','startRouting','Start','EventManager','notify','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','addInteraction','omit','getInteractions','Contact','fullname','internal','Tag','tag','Command','getSnippet','timezone','interval','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','virtual','increment','Intervals','readFileSync','server/files/chat/iframe.js','remote','x-forwarded-for','connection','remoteAddress','replace','render','alignment','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','chatProactiveAction','addProactiveActions','getFields','online','false','offlineForm','onlineForm','items','fromKey','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs'];(function(_0x2cc569,_0x4e9568){var _0x1bfc2e=function(_0x5b8fcb){while(--_0x5b8fcb){_0x2cc569['push'](_0x2cc569['shift']());}};_0x1bfc2e(++_0x4e9568);}(_0x0bc1,0x108));var _0x10bc=function(_0x4b4fbe,_0x3aa1d0){_0x4b4fbe=_0x4b4fbe-0x0;var _0x1e5216=_0x0bc1[_0x4b4fbe];return _0x1e5216;};'use strict';var pdf=require(_0x10bc('0x0'));var emlformat=require(_0x10bc('0x1'));var rimraf=require(_0x10bc('0x2'));var zipdir=require(_0x10bc('0x3'));var jsonpatch=require(_0x10bc('0x4'));var rp=require(_0x10bc('0x5'));var moment=require(_0x10bc('0x6'));var BPromise=require(_0x10bc('0x7'));var Mustache=require(_0x10bc('0x8'));var util=require(_0x10bc('0x9'));var path=require(_0x10bc('0xa'));var sox=require(_0x10bc('0xb'));var csv=require(_0x10bc('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x10bc('0xd'));var squel=require('squel');var crypto=require(_0x10bc('0xe'));var jsforce=require(_0x10bc('0xf'));var deskjs=require(_0x10bc('0x10'));var toCsv=require(_0x10bc('0xc'));var querystring=require('querystring');var Papa=require(_0x10bc('0x11'));var Redis=require(_0x10bc('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x10bc('0x13'));var hardwareService=require(_0x10bc('0x14'));var logger=require(_0x10bc('0x15'))('api');var utils=require(_0x10bc('0x16'));var config=require(_0x10bc('0x17'));var db=require(_0x10bc('0x18'))['db'];config['redis']=_[_0x10bc('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x10bc('0x1a'))(new Redis(config[_0x10bc('0x1b')]));require(_0x10bc('0x1c'))[_0x10bc('0x1d')](socket);var jayson=require(_0x10bc('0x1e'));var client=jayson[_0x10bc('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x10bc('0x1f')][_0x10bc('0x20')]({'port':0x232a});var client9003=jayson[_0x10bc('0x1f')][_0x10bc('0x20')]({'port':0x232b});function checkPasswordPattern(_0x595bdf,_0x542d09,_0x23e15b){if(_0x23e15b){var _0x54be0c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x54be0c[_0x10bc('0x21')](_0x542d09)){return _0x595bdf;}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 _0x595bdf;}}function respondWithRpcPromise(_0x4809a4,_0x415360,_0x535afc,_0x50afb0){return new BPromise(function(_0x339610,_0x39ead7){var _0x27ab3e=_0x50afb0||client;return _0x27ab3e[_0x10bc('0x22')](_0x4809a4,_0x535afc)[_0x10bc('0x23')](function(_0x212a88){logger[_0x10bc('0x24')](_0x10bc('0x25'),_0x415360,_0x10bc('0x26'));logger[_0x10bc('0x27')](_0x10bc('0x28'),_0x415360,_0x10bc('0x26'),JSON['stringify'](_0x212a88));if(_0x212a88[_0x10bc('0x29')]){if(_0x212a88[_0x10bc('0x29')][_0x10bc('0x2a')]===0x1f4){logger[_0x10bc('0x29')]('ChatWebsite,\x20%s,\x20%s',_0x415360,_0x212a88[_0x10bc('0x29')][_0x10bc('0x2b')]);return _0x39ead7(_0x212a88[_0x10bc('0x29')][_0x10bc('0x2b')]);}logger[_0x10bc('0x29')](_0x10bc('0x25'),_0x415360,_0x212a88[_0x10bc('0x29')]['message']);return _0x339610(_0x212a88[_0x10bc('0x29')]['message']);}else{logger[_0x10bc('0x24')](_0x10bc('0x25'),_0x415360,_0x10bc('0x26'));_0x339610(_0x212a88[_0x10bc('0x2c')][_0x10bc('0x2b')]);}})[_0x10bc('0x2d')](function(_0x4bcfea){logger[_0x10bc('0x29')]('ChatWebsite,\x20%s,\x20%s',_0x415360,_0x4bcfea);_0x39ead7(_0x4bcfea);});});}function respondWithStatusCode(_0x23beae,_0x34ead9){_0x34ead9=_0x34ead9||0xcc;return function(_0x393e47){if(_0x393e47){return _0x23beae[_0x10bc('0x2e')](_0x34ead9);}return _0x23beae['status'](_0x34ead9)[_0x10bc('0x2f')]();};}function respondWithResult(_0x1761cf,_0x57e6a0){_0x57e6a0=_0x57e6a0||0xc8;return function(_0x461784){if(_0x461784){return _0x1761cf[_0x10bc('0x30')](_0x57e6a0)[_0x10bc('0x31')](_0x461784);}};}function respondWithFilteredResult(_0x3a2d57,_0x543ad2){return function(_0x67de57){if(_0x67de57){var _0x430233=_0x67de57['count'],_0x47228d=_0x543ad2[_0x10bc('0x32')],_0x5ffc20=_0x543ad2[_0x10bc('0x32')]+_0x543ad2['limit'],_0xdc0bc6;if(_0x5ffc20>=_0x430233){_0x5ffc20=_0x430233;_0xdc0bc6=0xc8;}else{_0xdc0bc6=0xce;}_0x3a2d57[_0x10bc('0x30')](_0xdc0bc6);return _0x3a2d57['set'](_0x10bc('0x33'),_0x47228d+'-'+_0x5ffc20+'/'+_0x430233)[_0x10bc('0x31')](_0x67de57);}return null;};}function patchUpdates(_0x4bea40){return function(_0x26da38){try{jsonpatch['apply'](_0x26da38,_0x4bea40,!![]);}catch(_0x549555){return BPromise['reject'](_0x549555);}return _0x26da38[_0x10bc('0x34')]();};}function saveUpdates(_0x1edef8,_0x1cc4b4){return function(_0xe2f34d){if(_0xe2f34d){return _0xe2f34d[_0x10bc('0x35')](_0x1edef8)[_0x10bc('0x23')](function(_0x2085b7){return _0x2085b7;});}return null;};}function removeEntity(_0x12ea14,_0x5ef611){return function(_0x5b844f){if(_0x5b844f){return _0x5b844f['destroy']()[_0x10bc('0x23')](function(){var _0x357717=_0x5b844f[_0x10bc('0x36')]({'plain':!![]});var _0x2960b9=_0x10bc('0x37');return db[_0x10bc('0x38')][_0x10bc('0x39')]({'where':{'type':_0x2960b9,'resourceId':_0x357717['id']}})[_0x10bc('0x23')](function(){return _0x5b844f;});})[_0x10bc('0x23')](function(){_0x12ea14[_0x10bc('0x30')](0xcc)[_0x10bc('0x2f')]();});}};}function handleEntityNotFound(_0x344164,_0x48f690){return function(_0x121103){if(!_0x121103){_0x344164[_0x10bc('0x2e')](0x194);}return _0x121103;};}function handleError(_0xddb970,_0x336a19){_0x336a19=_0x336a19||0x1f4;return function(_0x2e73bc){logger['error'](_0x2e73bc['stack']);if(_0x2e73bc[_0x10bc('0x3a')]){delete _0x2e73bc[_0x10bc('0x3a')];}_0xddb970[_0x10bc('0x30')](_0x336a19)[_0x10bc('0x3b')](_0x2e73bc);};}exports[_0x10bc('0x3c')]=function(_0x4ee62b,_0x384956){var _0x41b630={'include':[{'model':db[_0x10bc('0x3d')],'as':_0x10bc('0x3e')}]},_0x4c66af={},_0x93e8b3={'count':0x0,'rows':[]};var _0x1bf4e9=db[_0x10bc('0x3f')][_0x10bc('0x40')];_0x4c66af[_0x10bc('0x41')]=_['keys'](_0x1bf4e9);_0x4c66af[_0x10bc('0x42')]=_['keys'](_0x4ee62b['query']);_0x4c66af[_0x10bc('0x43')]=_[_0x10bc('0x44')](_0x4c66af['model'],_0x4c66af[_0x10bc('0x42')]);_0x41b630[_0x10bc('0x45')]=_[_0x10bc('0x44')](_0x4c66af[_0x10bc('0x41')],qs[_0x10bc('0x46')](_0x4ee62b[_0x10bc('0x42')][_0x10bc('0x46')]));_0x41b630['attributes']=_0x41b630[_0x10bc('0x45')][_0x10bc('0x47')]?_0x41b630[_0x10bc('0x45')]:_0x4c66af[_0x10bc('0x41')];if(!_0x4ee62b['query']['hasOwnProperty'](_0x10bc('0x48'))){_0x41b630[_0x10bc('0x49')]=qs[_0x10bc('0x49')](_0x4ee62b[_0x10bc('0x42')]['limit']);_0x41b630[_0x10bc('0x32')]=qs[_0x10bc('0x32')](_0x4ee62b['query'][_0x10bc('0x32')]);}_0x41b630['order']=qs['sort'](_0x4ee62b[_0x10bc('0x42')][_0x10bc('0x4a')]);_0x41b630[_0x10bc('0x4b')]=qs[_0x10bc('0x43')](_['pick'](_0x4ee62b[_0x10bc('0x42')],_0x4c66af['filters']));if(_0x4ee62b['query'][_0x10bc('0x4c')]){_0x41b630[_0x10bc('0x4b')]=_[_0x10bc('0x4d')](_0x41b630[_0x10bc('0x4b')],{'$or':_[_0x10bc('0x4e')](_0x1bf4e9,function(_0x30724a){if(_0x30724a['type']['key']!==_0x10bc('0x4f')){var _0x1a064b={};_0x1a064b[_0x30724a['field']]={'$like':'%'+_0x4ee62b['query'][_0x10bc('0x4c')]+'%'};return _0x1a064b;}})});}_0x41b630=_['merge']({},_0x41b630,_0x4ee62b[_0x10bc('0x50')]);var _0x517908={'where':_0x41b630[_0x10bc('0x4b')]};return db['ChatWebsite']['count'](_0x517908)[_0x10bc('0x23')](function(_0x91121){_0x93e8b3[_0x10bc('0x51')]=_0x91121;if(_0x4ee62b['query'][_0x10bc('0x52')]){_0x41b630[_0x10bc('0x53')]=[{'all':!![]}];}return db[_0x10bc('0x3f')][_0x10bc('0x54')](_0x41b630);})[_0x10bc('0x23')](function(_0x45a3dc){_0x93e8b3[_0x10bc('0x55')]=_0x45a3dc;return _0x93e8b3;})[_0x10bc('0x23')](respondWithFilteredResult(_0x384956,_0x41b630))[_0x10bc('0x2d')](handleError(_0x384956,null));};exports[_0x10bc('0x56')]=function(_0x4e49d6,_0x3a19f8){var _0x125f77={'raw':![],'where':{'id':_0x4e49d6[_0x10bc('0x57')]['id']},'include':[{'model':db[_0x10bc('0x3d')],'as':_0x10bc('0x3e')}]},_0x38c656={};_0x38c656['model']=_[_0x10bc('0x58')](db[_0x10bc('0x3f')][_0x10bc('0x40')]);_0x38c656['query']=_[_0x10bc('0x58')](_0x4e49d6[_0x10bc('0x42')]);_0x38c656['filters']=_['intersection'](_0x38c656[_0x10bc('0x41')],_0x38c656['query']);_0x125f77[_0x10bc('0x45')]=_['intersection'](_0x38c656[_0x10bc('0x41')],qs[_0x10bc('0x46')](_0x4e49d6['query'][_0x10bc('0x46')]));_0x125f77[_0x10bc('0x45')]=_0x125f77[_0x10bc('0x45')][_0x10bc('0x47')]?_0x125f77[_0x10bc('0x45')]:_0x38c656[_0x10bc('0x41')];if(_0x4e49d6[_0x10bc('0x42')][_0x10bc('0x52')]){_0x125f77[_0x10bc('0x53')]=[{'all':!![]}];}_0x125f77=_[_0x10bc('0x4d')]({},_0x125f77,_0x4e49d6[_0x10bc('0x50')]);return db[_0x10bc('0x3f')]['find'](_0x125f77)[_0x10bc('0x23')](handleEntityNotFound(_0x3a19f8,null))[_0x10bc('0x23')](respondWithResult(_0x3a19f8,null))[_0x10bc('0x2d')](handleError(_0x3a19f8,null));};exports[_0x10bc('0x59')]=function(_0x196888,_0xa0f1ac){return db[_0x10bc('0x3f')][_0x10bc('0x59')](_0x196888[_0x10bc('0x5a')],{})[_0x10bc('0x23')](function(_0x3afdb2){var _0x5b21d5=_0x196888[_0x10bc('0x5b')]['get']({'plain':!![]});if(!_0x5b21d5)throw new Error(_0x10bc('0x5c'));if(_0x5b21d5['role']===_0x10bc('0x5b')){var _0x4c0803=_0x3afdb2[_0x10bc('0x36')]({'plain':!![]});var _0x1eed52='ChatWebsites';return db[_0x10bc('0x5d')][_0x10bc('0x5e')]({'where':{'name':_0x1eed52,'userProfileId':_0x5b21d5[_0x10bc('0x5f')]},'raw':!![]})[_0x10bc('0x23')](function(_0x580dbb){if(_0x580dbb&&_0x580dbb['autoAssociation']===0x0){return db['UserProfileResource'][_0x10bc('0x59')]({'name':_0x4c0803['name'],'resourceId':_0x4c0803['id'],'type':_0x580dbb[_0x10bc('0x3a')],'sectionId':_0x580dbb['id']},{})[_0x10bc('0x23')](function(){return _0x3afdb2;});}else{return _0x3afdb2;}})[_0x10bc('0x2d')](function(_0x5a7109){logger[_0x10bc('0x29')](_0x10bc('0x60'),_0x5a7109);throw _0x5a7109;});}return _0x3afdb2;})['then'](respondWithResult(_0xa0f1ac,0xc9))[_0x10bc('0x2d')](handleError(_0xa0f1ac,null));};exports[_0x10bc('0x35')]=function(_0x45a9ed,_0x3e8744){if(_0x45a9ed[_0x10bc('0x5a')]['id']){delete _0x45a9ed[_0x10bc('0x5a')]['id'];}return db[_0x10bc('0x3f')][_0x10bc('0x5e')]({'where':{'id':_0x45a9ed[_0x10bc('0x57')]['id']},'include':[{'model':db[_0x10bc('0x3d')],'as':_0x10bc('0x3e')}]})['then'](handleEntityNotFound(_0x3e8744,null))[_0x10bc('0x23')](saveUpdates(_0x45a9ed[_0x10bc('0x5a')],null))[_0x10bc('0x23')](respondWithResult(_0x3e8744,null))[_0x10bc('0x2d')](handleError(_0x3e8744,null));};exports[_0x10bc('0x39')]=function(_0x4d323c,_0x44e7a5){return db[_0x10bc('0x3f')][_0x10bc('0x5e')]({'where':{'id':_0x4d323c[_0x10bc('0x57')]['id']}})[_0x10bc('0x23')](handleEntityNotFound(_0x44e7a5,null))[_0x10bc('0x23')](removeEntity(_0x44e7a5,null))[_0x10bc('0x2d')](handleError(_0x44e7a5,null));};exports[_0x10bc('0x61')]=function(_0x54e9c1,_0x156ced){return db[_0x10bc('0x3f')][_0x10bc('0x61')]()[_0x10bc('0x23')](respondWithResult(_0x156ced,null))[_0x10bc('0x2d')](handleError(_0x156ced,null));};exports[_0x10bc('0x62')]=function(_0x373879,_0x2af923,_0x34353f){if(_0x373879[_0x10bc('0x5a')]['id']){delete _0x373879[_0x10bc('0x5a')]['id'];}return db['ChatWebsite'][_0x10bc('0x5e')]({'where':{'id':_0x373879['params']['id']}})[_0x10bc('0x23')](handleEntityNotFound(_0x2af923,null))[_0x10bc('0x23')](function(_0x54d7bd){if(_0x54d7bd){_0x373879['body'][_0x10bc('0x63')]=_0x54d7bd['id'];return db[_0x10bc('0x64')][_0x10bc('0x59')](_0x373879['body']);}})[_0x10bc('0x23')](respondWithResult(_0x2af923,null))[_0x10bc('0x2d')](handleError(_0x2af923,null));};exports['getDispositions']=function(_0x1cf606,_0x43f4f9,_0x1ea1d8){var _0x1fa74a={'raw':![],'where':{}};var _0x5b5d4c={};var _0x132827={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x10bc('0x65')]({'where':{'id':_0x1cf606[_0x10bc('0x57')]['id']}})[_0x10bc('0x23')](handleEntityNotFound(_0x43f4f9,null))[_0x10bc('0x23')](function(_0x3997ea){if(_0x3997ea){_0x5b5d4c['model']=_['keys'](db[_0x10bc('0x64')][_0x10bc('0x40')]);_0x5b5d4c[_0x10bc('0x42')]=_[_0x10bc('0x58')](_0x1cf606[_0x10bc('0x42')]);_0x5b5d4c[_0x10bc('0x43')]=_[_0x10bc('0x44')](_0x5b5d4c['model'],_0x5b5d4c['query']);_0x1fa74a[_0x10bc('0x45')]=_[_0x10bc('0x44')](_0x5b5d4c['model'],qs['fields'](_0x1cf606['query'][_0x10bc('0x46')]));_0x1fa74a['attributes']=_0x1fa74a[_0x10bc('0x45')]['length']?_0x1fa74a['attributes']:_0x5b5d4c[_0x10bc('0x41')];if(!_0x1cf606[_0x10bc('0x42')][_0x10bc('0x66')](_0x10bc('0x48'))){_0x1fa74a[_0x10bc('0x49')]=qs[_0x10bc('0x49')](_0x1cf606['query'][_0x10bc('0x49')]);_0x1fa74a[_0x10bc('0x32')]=qs[_0x10bc('0x32')](_0x1cf606[_0x10bc('0x42')][_0x10bc('0x32')]);}_0x1fa74a['order']=qs['sort'](_0x1cf606[_0x10bc('0x42')][_0x10bc('0x4a')]);_0x1fa74a['where']=qs['filters'](_[_0x10bc('0x67')](_0x1cf606[_0x10bc('0x42')],_0x5b5d4c[_0x10bc('0x43')]));_0x1fa74a['where'][_0x10bc('0x63')]=_0x3997ea['id'];if(_0x1cf606[_0x10bc('0x42')][_0x10bc('0x4c')]){_0x1fa74a['where']=_[_0x10bc('0x4d')](_0x1fa74a[_0x10bc('0x4b')],{'$or':_[_0x10bc('0x4e')](_0x1fa74a[_0x10bc('0x45')],function(_0x11e1eb){var _0x1e14d7={};_0x1e14d7[_0x11e1eb]={'$like':'%'+_0x1cf606['query'][_0x10bc('0x4c')]+'%'};return _0x1e14d7;})});}_0x1fa74a=_[_0x10bc('0x4d')]({},_0x1fa74a,_0x1cf606['options']);return db[_0x10bc('0x64')][_0x10bc('0x51')]({'where':_0x1fa74a[_0x10bc('0x4b')]})['then'](function(_0x2b90b0){_0x132827['count']=_0x2b90b0;if(_0x1cf606[_0x10bc('0x42')][_0x10bc('0x52')]){_0x1fa74a[_0x10bc('0x53')]=[{'all':!![]}];}return db[_0x10bc('0x64')]['findAll'](_0x1fa74a);})[_0x10bc('0x23')](function(_0xd984a7){_0x132827[_0x10bc('0x55')]=_0xd984a7;return _0x132827;});}})[_0x10bc('0x23')](respondWithFilteredResult(_0x43f4f9,_0x1fa74a))[_0x10bc('0x2d')](handleError(_0x43f4f9,null));};exports[_0x10bc('0x68')]=function(_0x326f8c,_0x31738e,_0x5bbf0e){return db['ChatWebsite'][_0x10bc('0x5e')]({'where':{'id':_0x326f8c[_0x10bc('0x57')]['id']}})[_0x10bc('0x23')](handleEntityNotFound(_0x31738e,null))['then'](function(_0x43ce4f){if(_0x43ce4f){return _0x43ce4f[_0x10bc('0x68')](_0x326f8c['query'][_0x10bc('0x69')]);}})[_0x10bc('0x23')](respondWithStatusCode(_0x31738e,null))[_0x10bc('0x2d')](handleError(_0x31738e,null));};exports[_0x10bc('0x6a')]=function(_0x1b92e7,_0x46aabb,_0x19a46b){if(_0x1b92e7[_0x10bc('0x5a')]['id']){delete _0x1b92e7['body']['id'];}return db[_0x10bc('0x3f')][_0x10bc('0x5e')]({'where':{'id':_0x1b92e7[_0x10bc('0x57')]['id']}})[_0x10bc('0x23')](handleEntityNotFound(_0x46aabb,null))['then'](function(_0x38a7ed){if(_0x38a7ed){_0x1b92e7[_0x10bc('0x5a')][_0x10bc('0x63')]=_0x38a7ed['id'];return db[_0x10bc('0x6b')][_0x10bc('0x59')](_0x1b92e7['body']);}})[_0x10bc('0x23')](respondWithResult(_0x46aabb,null))[_0x10bc('0x2d')](handleError(_0x46aabb,null));};exports[_0x10bc('0x6c')]=function(_0x2ef770,_0x4a5f10,_0x33bd38){var _0x89233a={'raw':![],'where':{}};var _0x519a07={};var _0x50b406={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x10bc('0x65')]({'where':{'id':_0x2ef770['params']['id']}})[_0x10bc('0x23')](handleEntityNotFound(_0x4a5f10,null))['then'](function(_0x18bd8e){if(_0x18bd8e){_0x519a07[_0x10bc('0x41')]=_[_0x10bc('0x58')](db[_0x10bc('0x6b')]['rawAttributes']);_0x519a07[_0x10bc('0x42')]=_['keys'](_0x2ef770[_0x10bc('0x42')]);_0x519a07['filters']=_[_0x10bc('0x44')](_0x519a07[_0x10bc('0x41')],_0x519a07[_0x10bc('0x42')]);_0x89233a[_0x10bc('0x45')]=_[_0x10bc('0x44')](_0x519a07[_0x10bc('0x41')],qs[_0x10bc('0x46')](_0x2ef770[_0x10bc('0x42')]['fields']));_0x89233a['attributes']=_0x89233a['attributes']['length']?_0x89233a[_0x10bc('0x45')]:_0x519a07[_0x10bc('0x41')];if(!_0x2ef770[_0x10bc('0x42')][_0x10bc('0x66')](_0x10bc('0x48'))){_0x89233a[_0x10bc('0x49')]=qs['limit'](_0x2ef770[_0x10bc('0x42')][_0x10bc('0x49')]);_0x89233a[_0x10bc('0x32')]=qs['offset'](_0x2ef770[_0x10bc('0x42')][_0x10bc('0x32')]);}_0x89233a[_0x10bc('0x6d')]=qs[_0x10bc('0x4a')](_0x2ef770['query'][_0x10bc('0x4a')]);_0x89233a['where']=qs['filters'](_[_0x10bc('0x67')](_0x2ef770[_0x10bc('0x42')],_0x519a07[_0x10bc('0x43')]));_0x89233a[_0x10bc('0x4b')][_0x10bc('0x63')]=_0x18bd8e['id'];if(_0x2ef770['query'][_0x10bc('0x4c')]){_0x89233a[_0x10bc('0x4b')]=_[_0x10bc('0x4d')](_0x89233a[_0x10bc('0x4b')],{'$or':_[_0x10bc('0x4e')](_0x89233a[_0x10bc('0x45')],function(_0x2f58cf){var _0x2d4149={};_0x2d4149[_0x2f58cf]={'$like':'%'+_0x2ef770[_0x10bc('0x42')][_0x10bc('0x4c')]+'%'};return _0x2d4149;})});}_0x89233a=_[_0x10bc('0x4d')]({},_0x89233a,_0x2ef770[_0x10bc('0x50')]);return db[_0x10bc('0x6b')][_0x10bc('0x51')]({'where':_0x89233a[_0x10bc('0x4b')]})[_0x10bc('0x23')](function(_0x14a0ea){_0x50b406[_0x10bc('0x51')]=_0x14a0ea;if(_0x2ef770[_0x10bc('0x42')][_0x10bc('0x52')]){_0x89233a[_0x10bc('0x53')]=[{'all':!![]}];}return db[_0x10bc('0x6b')]['findAll'](_0x89233a);})[_0x10bc('0x23')](function(_0x39c1e2){_0x50b406[_0x10bc('0x55')]=_0x39c1e2;return _0x50b406;});}})[_0x10bc('0x23')](respondWithFilteredResult(_0x4a5f10,_0x89233a))[_0x10bc('0x2d')](handleError(_0x4a5f10,null));};exports[_0x10bc('0x6e')]=function(_0x20a5ee,_0x23fbe3,_0xc0a5ed){return db[_0x10bc('0x3f')][_0x10bc('0x5e')]({'where':{'id':_0x20a5ee[_0x10bc('0x57')]['id']}})['then'](handleEntityNotFound(_0x23fbe3,null))[_0x10bc('0x23')](function(_0x3e3831){if(_0x3e3831){return _0x3e3831[_0x10bc('0x6e')](_0x20a5ee['query']['ids']);}})['then'](respondWithStatusCode(_0x23fbe3,null))[_0x10bc('0x2d')](handleError(_0x23fbe3,null));};exports[_0x10bc('0x6f')]=function(_0x2862a2,_0x59f3d9,_0x25b4ce){_0x2862a2[_0x10bc('0x5a')][_0x10bc('0x70')]=_0x2862a2[_0x10bc('0x71')][_0x10bc('0x72')];return db[_0x10bc('0x3f')]['find']({'where':{'id':_0x2862a2['params']['id']}})[_0x10bc('0x23')](handleEntityNotFound(_0x59f3d9,null))['then'](saveUpdates(_0x2862a2[_0x10bc('0x5a')],null))[_0x10bc('0x23')](respondWithResult(_0x59f3d9,null))[_0x10bc('0x2d')](handleError(_0x59f3d9,null));};exports[_0x10bc('0x73')]=function(_0xdd0e26,_0x20329d,_0x4031dc){_0xdd0e26['body']['agentAvatar']=_0xdd0e26[_0x10bc('0x71')]['filename'];return db[_0x10bc('0x3f')]['find']({'where':{'id':_0xdd0e26[_0x10bc('0x57')]['id']}})[_0x10bc('0x23')](handleEntityNotFound(_0x20329d,null))[_0x10bc('0x23')](saveUpdates(_0xdd0e26['body'],null))[_0x10bc('0x23')](respondWithResult(_0x20329d,null))[_0x10bc('0x2d')](handleError(_0x20329d,null));};exports[_0x10bc('0x74')]=function(_0x3f87d0,_0x386413,_0xc64c70){_0x3f87d0[_0x10bc('0x5a')][_0x10bc('0x75')]=_0x3f87d0[_0x10bc('0x71')][_0x10bc('0x72')];return db[_0x10bc('0x3f')][_0x10bc('0x5e')]({'where':{'id':_0x3f87d0[_0x10bc('0x57')]['id']}})['then'](handleEntityNotFound(_0x386413,null))[_0x10bc('0x23')](saveUpdates(_0x3f87d0[_0x10bc('0x5a')],null))[_0x10bc('0x23')](respondWithResult(_0x386413,null))[_0x10bc('0x2d')](handleError(_0x386413,null));};exports[_0x10bc('0x76')]=function(_0xe84b1e,_0x57baff,_0x3fb5ed){_0xe84b1e[_0x10bc('0x5a')][_0x10bc('0x77')]=_0xe84b1e[_0x10bc('0x71')][_0x10bc('0x72')];return db['ChatWebsite'][_0x10bc('0x5e')]({'where':{'id':_0xe84b1e[_0x10bc('0x57')]['id']}})[_0x10bc('0x23')](handleEntityNotFound(_0x57baff,null))[_0x10bc('0x23')](saveUpdates(_0xe84b1e[_0x10bc('0x5a')],null))['then'](respondWithResult(_0x57baff,null))[_0x10bc('0x2d')](handleError(_0x57baff,null));};exports[_0x10bc('0x78')]=function(_0x33de7d,_0xc702df,_0x289bad){var _0x524905=path[_0x10bc('0x79')](config['root'],_0x10bc('0x7a'));var _0x32bc09={'where':{'id':_0x33de7d['params']['id']},'attributes':['id',_0x10bc('0x70')],'raw':!![]};var _0x4e3f43=![];return require(_0x10bc('0x7b'))[_0x10bc('0x7c')]()[_0x10bc('0x23')](function(_0x78e767){if(_0x78e767){_0x4e3f43=_0x78e767['custom'];}})[_0x10bc('0x23')](function(){return db[_0x10bc('0x3f')]['find'](_0x32bc09);})[_0x10bc('0x23')](handleEntityNotFound(_0xc702df,null))['then'](function(_0x1d8293){if(_0x1d8293){if(!_[_0x10bc('0x7d')](_0x1d8293[_0x10bc('0x70')])){if(fs[_0x10bc('0x7e')](path['join'](config[_0x10bc('0x7f')],_0x10bc('0x80'),_0x1d8293[_0x10bc('0x70')]))&&_0x4e3f43){_0x524905=path[_0x10bc('0x79')](config[_0x10bc('0x7f')],_0x10bc('0x80'),_0x1d8293[_0x10bc('0x70')]);}}return _0xc702df[_0x10bc('0x81')](_0x524905);}})[_0x10bc('0x2d')](handleError(_0xc702df,null));};exports[_0x10bc('0x82')]=function(_0x2b88f1,_0x1ca9e5,_0x4f71da){var _0xe14ace=path['join'](config['root'],_0x10bc('0x83'));var _0x312c6e={'where':{'id':_0x2b88f1[_0x10bc('0x57')]['id']},'attributes':['id',_0x10bc('0x84')],'raw':!![]};return db['ChatWebsite'][_0x10bc('0x5e')](_0x312c6e)[_0x10bc('0x23')](handleEntityNotFound(_0x1ca9e5,null))['then'](function(_0x38aca2){if(_0x38aca2){if(!_[_0x10bc('0x7d')](_0x38aca2[_0x10bc('0x84')])){if(fs['existsSync'](path['join'](config['root'],_0x10bc('0x85'),_0x38aca2[_0x10bc('0x84')]))){_0xe14ace=path[_0x10bc('0x79')](config['root'],'server/files/images/avatars/',_0x38aca2[_0x10bc('0x84')]);}}return _0x1ca9e5[_0x10bc('0x81')](_0xe14ace);}})[_0x10bc('0x2d')](handleError(_0x1ca9e5,null));};exports[_0x10bc('0x86')]=function(_0x342946,_0x145934,_0x6c677e){var _0x168659=path[_0x10bc('0x79')](config[_0x10bc('0x7f')],'server/files/images/avatars/customer_avatar.png');var _0x32755c={'where':{'id':_0x342946[_0x10bc('0x57')]['id']},'attributes':['id',_0x10bc('0x75'),_0x10bc('0x87')],'raw':!![]};return db[_0x10bc('0x3f')][_0x10bc('0x5e')](_0x32755c)[_0x10bc('0x23')](handleEntityNotFound(_0x145934,null))[_0x10bc('0x23')](function(_0x284135){if(_0x284135){if(!_[_0x10bc('0x7d')](_0x284135[_0x10bc('0x75')])){if(fs[_0x10bc('0x7e')](path['join'](config[_0x10bc('0x7f')],_0x10bc('0x85'),_0x284135['customerAvatar']))&&_0x284135[_0x10bc('0x87')]){_0x168659=path[_0x10bc('0x79')](config[_0x10bc('0x7f')],'server/files/images/avatars/',_0x284135['customerAvatar']);}}return _0x145934[_0x10bc('0x81')](_0x168659);}})['catch'](handleError(_0x145934,null));};exports['getSystemAvatar']=function(_0x297df6,_0x52c4ee,_0x52c23f){var _0x735f44=path[_0x10bc('0x79')](config[_0x10bc('0x7f')],_0x10bc('0x88'));var _0x307991={'where':{'id':_0x297df6['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x307991)[_0x10bc('0x23')](handleEntityNotFound(_0x52c4ee,null))['then'](function(_0x54ca00){if(_0x54ca00){if(!_[_0x10bc('0x7d')](_0x54ca00['systemAvatar'])){if(fs['existsSync'](path[_0x10bc('0x79')](config[_0x10bc('0x7f')],_0x10bc('0x85'),_0x54ca00[_0x10bc('0x77')]))){_0x735f44=path[_0x10bc('0x79')](config[_0x10bc('0x7f')],'server/files/images/avatars/',_0x54ca00[_0x10bc('0x77')]);}}return _0x52c4ee[_0x10bc('0x81')](_0x735f44);}})[_0x10bc('0x2d')](handleError(_0x52c4ee,null));};exports['notify']=function(_0x289922,_0x5568ab,_0x25a160){var _0x490d57=require(_0x10bc('0x89'));var _0x538840=new _0x490d57();var _0x4a6054=_0x538840[_0x10bc('0x8a')](_0x289922[_0x10bc('0x8b')][_0x10bc('0x8c')])[_0x10bc('0x8d')]();var _0xdbca5a={'body':_0x289922[_0x10bc('0x5a')],'channel':'chat'};var _0x2f71fe=[];var _0xd57dff=[];var _0x4271b5={};var _0x4ed60c=![];return db[_0x10bc('0x8e')][_0x10bc('0x61')]()['then'](function(_0xb84c00){if(!_0xb84c00){throw new db['Sequelize'][(_0x10bc('0x8f'))](_0x10bc('0x90'));}_0x2f71fe=_[_0x10bc('0x91')](_['keys'](_0xb84c00),[_0x10bc('0x92'),_0x10bc('0x93')]);_0xd57dff=_[_0x10bc('0x91')](_[_0x10bc('0x58')](_0xb84c00),[_0x10bc('0x92'),'updatedAt',_0x10bc('0x94'),_0x10bc('0x95')]);if(_0x289922[_0x10bc('0x5a')]['id']){delete _0x289922[_0x10bc('0x5a')]['id'];}if(_['isNil'](_0x289922[_0x10bc('0x5a')]['from'])){throw new db[(_0x10bc('0x96'))]['ValidationError'](_0x10bc('0x97'));}if(_[_0x10bc('0x7d')](_0x289922['body'][_0x10bc('0x5a')])||_0x289922['body'][_0x10bc('0x5a')]===''){throw new db[(_0x10bc('0x96'))][(_0x10bc('0x8f'))](_0x10bc('0x98'));}if(_[_0x10bc('0x7d')](_0x289922['body']['mapKey'])){throw new db[(_0x10bc('0x96'))][(_0x10bc('0x8f'))](_0x10bc('0x99')+_0xd57dff);}if(!_[_0x10bc('0x9a')](_0xd57dff,_0x289922[_0x10bc('0x5a')][_0x10bc('0x9b')])){throw new db[(_0x10bc('0x96'))]['ValidationError'](_0x10bc('0x9c')+_0xd57dff);}_0x4271b5[_0x289922[_0x10bc('0x5a')][_0x10bc('0x9b')]]=_0x289922[_0x10bc('0x5a')][_0x10bc('0x9d')];})[_0x10bc('0x23')](function(){return db[_0x10bc('0x3f')]['find']({'where':{'id':_0x289922[_0x10bc('0x57')]['id']},'include':[{'model':db[_0x10bc('0x9e')],'as':_0x10bc('0x9f'),'include':[{'model':db[_0x10bc('0x8e')],'as':_0x10bc('0xa0'),'where':_0x4271b5,'limit':0x1,'order':[[_0x10bc('0x93'),_0x10bc('0xa1')]]}]},{'model':db[_0x10bc('0xa2')],'as':_0x10bc('0xa3')}]});})['then'](handleEntityNotFound(_0x5568ab,null))['then'](function(_0x377962){if(_0x377962&&_0x377962[_0x10bc('0x9f')]){_0xdbca5a[_0x10bc('0xa4')]=_0x377962;_0xdbca5a[_0x10bc('0xa5')]=_0x377962[_0x10bc('0xa3')];_0xdbca5a[_0x10bc('0xa6')]=_0x377962['List'];_0xdbca5a[_0x10bc('0xa5')]=_[_0x10bc('0xa7')](_0xdbca5a['applications'],['priority'],[_0x10bc('0xa8')]);if(_0xdbca5a[_0x10bc('0xa4')][_0x10bc('0xa3')]){delete _0xdbca5a[_0x10bc('0xa4')][_0x10bc('0xa3')];}if(_0xdbca5a['account'][_0x10bc('0x9f')]&&_0xdbca5a['account'][_0x10bc('0x9f')][_0x10bc('0xa0')]['length']){return _0xdbca5a[_0x10bc('0xa4')][_0x10bc('0x9f')][_0x10bc('0xa0')][0x0];}var _0x193457=_[_0x10bc('0x19')](_0x289922[_0x10bc('0x5a')],{'firstName':_0x289922[_0x10bc('0x5a')][_0x10bc('0x9d')],'ListId':_0x377962[_0x10bc('0x95')]});_0x193457[_0x289922[_0x10bc('0x5a')][_0x10bc('0x9b')]]=_0x289922['body'][_0x10bc('0x9d')];return db['CmContact'][_0x10bc('0x59')](_0x193457,{'fields':_0x2f71fe,'raw':!![]});}})[_0x10bc('0x23')](handleEntityNotFound(_0x5568ab,null))['then'](function(_0x4eb44a){_0xdbca5a[_0x10bc('0xa9')]=_0x4eb44a;if(_0x4eb44a){var _0x4abe4a={'ContactId':_0x4eb44a['id'],'ChatWebsiteId':_0x289922[_0x10bc('0x57')]['id'],'from':(_0x4eb44a[_0x10bc('0xaa')]||'')+'\x20'+(_0x4eb44a['lastName']||''),'customerIp':_0x289922[_0x10bc('0x5a')][_0x10bc('0xab')],'referer':_0x289922[_0x10bc('0x5a')][_0x10bc('0xac')],'browserName':_0x4a6054[_0x10bc('0xad')]['name']&&_0x4a6054['browser'][_0x10bc('0xae')]?util[_0x10bc('0xaf')](_0x10bc('0xb0'),_0x4a6054[_0x10bc('0xad')][_0x10bc('0x3a')],_0x4a6054['browser'][_0x10bc('0xae')]):_0x10bc('0xb1'),'browserVersion':_0x4a6054['browser'][_0x10bc('0xae')]||_0x10bc('0xb1'),'osName':util[_0x10bc('0xaf')](_0x10bc('0xb0'),_0x4a6054['os']['name'],_0x4a6054['os']['version']),'osVersion':_0x4a6054['os'][_0x10bc('0xae')],'deviceModel':_0x4a6054[_0x10bc('0xb2')][_0x10bc('0x41')]&&_0x4a6054[_0x10bc('0xb2')]['vendor']?util[_0x10bc('0xaf')](_0x10bc('0xb3'),_0x4a6054['device'][_0x10bc('0x41')],_0x4a6054['device'][_0x10bc('0xb4')],_0x4a6054[_0x10bc('0xb2')][_0x10bc('0xb5')]):null,'deviceVendor':_0x4a6054[_0x10bc('0xb2')][_0x10bc('0xb4')],'deviceType':_0x4a6054[_0x10bc('0xb2')][_0x10bc('0xb5')],'formData':JSON[_0x10bc('0xb6')](_0x289922[_0x10bc('0x5a')])};var _0x3c7773={'ChatWebsiteId':_0x289922['params']['id'],'closed':![]};if(_0x289922[_0x10bc('0x5a')]['threadId']){_0x3c7773['threadId']=_0x289922[_0x10bc('0x5a')][_0x10bc('0xb7')];return db[_0x10bc('0xb8')][_0x10bc('0x5e')]({'where':_0x3c7773})[_0x10bc('0x23')](function(_0x28a363){if(_0x28a363){return[_0x28a363,![]];}_0x4abe4a['threadId']=_0x289922['body'][_0x10bc('0xb7')];_0x4abe4a[_0x10bc('0xb9')]=_0x289922['body']['externalUrl'];return db[_0x10bc('0xb8')][_0x10bc('0x59')](_0x4abe4a)[_0x10bc('0x23')](function(_0x48132d){return[_0x48132d,!![]];});});}_0x3c7773['ContactId']=_0x4eb44a['id'];if(_0x289922[_0x10bc('0x5a')][_0x10bc('0xba')]&&_0x289922[_0x10bc('0x5a')][_0x10bc('0xba')]['id']){_0x3c7773['id']=_0x289922[_0x10bc('0x5a')][_0x10bc('0xba')]['id'];return db['ChatInteraction']['find']({'where':_0x3c7773})['then'](function(_0x71c5c){if(_0x71c5c){return[_0x71c5c,![]];}return db[_0x10bc('0xb8')][_0x10bc('0x59')](_0x4abe4a)[_0x10bc('0x23')](function(_0x2f1fa8){return[_0x2f1fa8,!![]];});});}return db[_0x10bc('0xb8')]['create'](_0x4abe4a)[_0x10bc('0x23')](function(_0x190699){return[_0x190699,!![]];});}})['spread'](function(_0x4ca51a,_0x47fa00){if(_0x4ca51a){_0x4ed60c=_0x47fa00;if(!_0x47fa00){var _0x445416={'from':(_0xdbca5a[_0x10bc('0xa9')][_0x10bc('0xaa')]||'')+'\x20'+(_0xdbca5a['contact']['lastName']||'')};if(_0x289922[_0x10bc('0x5a')][_0x10bc('0xb7')]&&_0x289922['body'][_0x10bc('0xbb')]&&_0x289922[_0x10bc('0x5a')][_0x10bc('0xb7')]!=_0x289922[_0x10bc('0x5a')]['messageId']){_0x445416[_0x10bc('0xb7')]=_0x289922[_0x10bc('0x5a')][_0x10bc('0xbb')];}return _0x4ca51a[_0x10bc('0x35')](_0x445416);}else{return _0x4ca51a;}}})[_0x10bc('0x23')](function(_0x3a2ef7){_0xdbca5a[_0x10bc('0xba')]=_0x3a2ef7['get']({'plain':!![]});_0xdbca5a['interaction']['created']=_0x4ed60c;if(_0xdbca5a['interaction'][_0x10bc('0xbc')]){if(_0xdbca5a[_0x10bc('0xa4')][_0x10bc('0xbd')]){_0xdbca5a[_0x10bc('0xa5')][_0x10bc('0xbe')]({'id':0x0,'priority':_0xdbca5a[_0x10bc('0xa5')][_0x10bc('0x47')]+0x1,'app':_0x10bc('0xbf'),'appdata':_0x10bc('0xc0'),'interval':'*,*,*,*'});}}return db[_0x10bc('0xc1')][_0x10bc('0x59')]({'body':_0x289922['body'][_0x10bc('0x5a')],'ChatWebsiteId':_0x289922['params']['id'],'ChatInteractionId':_0x3a2ef7['id'],'direction':'in','ContactId':_0xdbca5a[_0x10bc('0xa9')]['id'],'AttachmentId':_0x289922['body'][_0x10bc('0xc2')]});})[_0x10bc('0x23')](function(_0x12e9f7){_0xdbca5a[_0x10bc('0x2b')]=_0x12e9f7;if(_0xdbca5a[_0x10bc('0xba')][_0x10bc('0xc3')]){return db[_0x10bc('0xc4')][_0x10bc('0x5e')]({'attributes':['id',_0x10bc('0x3a')],'where':{'id':_0xdbca5a['interaction']['UserId']}})[_0x10bc('0x23')](function(_0x2416ea){if(_0x2416ea){_0xdbca5a[_0x10bc('0xa5')][_0x10bc('0xc5')]({'id':0x0,'priority':0x0,'app':_0x10bc('0xc6'),'appdata':_0x2416ea[_0x10bc('0x3a')]+','+(_0xdbca5a['account'][_0x10bc('0xc7')]||0xa),'interval':_0x10bc('0xc8')});_0xdbca5a[_0x10bc('0xc9')]=!![];}return respondWithRpcPromise('Start',_0x10bc('0xca'),_0xdbca5a);});}return respondWithRpcPromise(_0x10bc('0xcb'),_0x10bc('0xca'),_0xdbca5a);})[_0x10bc('0x23')](function(_0x2f5fc9){respondWithRpcPromise(_0x10bc('0xcc'),'EventManager',{'event':_0x10bc('0xcd'),'message':_0x2f5fc9},client9002);return _0x2f5fc9;})[_0x10bc('0x23')](respondWithResult(_0x5568ab,null))[_0x10bc('0x2d')](handleError(_0x5568ab,null));};exports[_0x10bc('0xce')]=function(_0x451d6b,_0x5832ae,_0x5bb7d6){var _0x24e8b1,_0x16a478,_0x44261a;var _0x143f51=[];var _0x10c528=[];var _0x2656e8={};return db[_0x10bc('0x8e')][_0x10bc('0x61')]()[_0x10bc('0x23')](function(_0x28cbf1){if(!_0x28cbf1){throw new db[(_0x10bc('0x96'))][(_0x10bc('0x8f'))](_0x10bc('0x90'));}_0x10c528=_[_0x10bc('0x91')](_[_0x10bc('0x58')](_0x28cbf1),['createdAt',_0x10bc('0x93')]);_0x143f51=_[_0x10bc('0x91')](_[_0x10bc('0x58')](_0x28cbf1),[_0x10bc('0x92'),_0x10bc('0x93'),_0x10bc('0x94'),_0x10bc('0x95')]);if(_0x451d6b['body']['id']){delete _0x451d6b[_0x10bc('0x5a')]['id'];}if(_[_0x10bc('0x7d')](_0x451d6b[_0x10bc('0x5a')]['from'])){throw _0x5832ae[_0x10bc('0x30')](0x1f4)[_0x10bc('0x3b')](new db[(_0x10bc('0x96'))][(_0x10bc('0x8f'))](_0x10bc('0x97')));}if(_[_0x10bc('0x7d')](_0x451d6b[_0x10bc('0x5a')][_0x10bc('0x5a')])||_0x451d6b[_0x10bc('0x5a')][_0x10bc('0x5a')]===''){throw _0x5832ae[_0x10bc('0x30')](0x1f4)[_0x10bc('0x3b')](new db[(_0x10bc('0x96'))][(_0x10bc('0x8f'))](_0x10bc('0x98')));}if(_[_0x10bc('0x7d')](_0x451d6b['body'][_0x10bc('0xcf')])){throw _0x5832ae[_0x10bc('0x30')](0x1f4)[_0x10bc('0x3b')](new db[(_0x10bc('0x96'))]['ValidationError'](_0x10bc('0xd0')+_0x143f51));}if(!_[_0x10bc('0x9a')](_0x143f51,_0x451d6b[_0x10bc('0x5a')][_0x10bc('0xcf')])){throw _0x5832ae[_0x10bc('0x30')](0x1f4)['send'](new db['Sequelize'][(_0x10bc('0x8f'))](_0x10bc('0xd1')+_0x143f51));}_0x2656e8[_0x451d6b[_0x10bc('0x5a')][_0x10bc('0xcf')]]=_0x451d6b[_0x10bc('0x5a')][_0x10bc('0x9d')];})['then'](function(){return db[_0x10bc('0x3f')][_0x10bc('0x5e')]({'where':{'id':_0x451d6b[_0x10bc('0x57')]['id']},'include':[{'model':db[_0x10bc('0x9e')],'as':_0x10bc('0x9f')}]});})[_0x10bc('0x23')](handleEntityNotFound(_0x5832ae,null))[_0x10bc('0x23')](function(_0x2fd272){if(_0x2fd272&&_0x2fd272['List']){_0x16a478=_0x2fd272;var _0x5aba1e=_[_0x10bc('0x19')](_0x451d6b[_0x10bc('0x5a')],{'firstName':_0x451d6b['body']['from'],'phone':_0x451d6b['body'][_0x10bc('0x9d')],'ListId':_0x2fd272[_0x10bc('0x95')]});_0x5aba1e[_0x451d6b[_0x10bc('0x5a')][_0x10bc('0xcf')]]=_0x451d6b[_0x10bc('0x5a')][_0x10bc('0x9d')];return db[_0x10bc('0x8e')][_0x10bc('0xd2')]({'where':_0x2656e8,'defaults':_0x5aba1e});}})[_0x10bc('0xd3')](function(_0x16a224){if(_0x16a224){_0x44261a=_0x16a224;var _0x486aca=fs['readFileSync'](path['join'](config[_0x10bc('0x7f')],_0x10bc('0xd4')),_0x10bc('0xd5'));var _0x32c8f8=ejs['render'](_0x486aca,{'body':_[_0x10bc('0xd6')](_0x451d6b['body'][_0x10bc('0x5a')]),'bodyTitle':_0x16a478[_0x10bc('0xd7')]});return db[_0x10bc('0xd8')][_0x10bc('0x59')]({'body':_0x32c8f8,'ContactId':_0x16a224['id'],'ChatWebsiteId':_0x16a478['id']});}})[_0x10bc('0x23')](function(_0x2ee655){if(_0x2ee655){_0x24e8b1=_0x2ee655;return db[_0x10bc('0xd9')][_0x10bc('0x65')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x10bc('0xda'),'raw':!![]}]});}})[_0x10bc('0x23')](function(_0x1041d6){if(_0x1041d6&&_0x1041d6[_0x10bc('0xda')]&&_0x16a478[_0x10bc('0xdb')]){var _0x4b5ecd={'tls':{'rejectUnauthorized':![]}};if(_0x1041d6[_0x10bc('0xda')][_0x10bc('0xdc')]){_0x4b5ecd[_0x10bc('0xdc')]=_0x1041d6[_0x10bc('0xda')][_0x10bc('0xdc')];}else{_0x4b5ecd[_0x10bc('0xdd')]=_0x1041d6[_0x10bc('0xda')][_0x10bc('0xdd')];_0x4b5ecd['port']=_0x1041d6[_0x10bc('0xda')][_0x10bc('0xde')];_0x4b5ecd[_0x10bc('0xdf')]=_0x1041d6[_0x10bc('0xda')][_0x10bc('0xdf')];}if(_0x1041d6[_0x10bc('0xda')][_0x10bc('0xe0')]){_0x4b5ecd[_0x10bc('0xe1')]={'user':_0x1041d6[_0x10bc('0xda')][_0x10bc('0x5b')],'pass':_0x1041d6['Smtp'][_0x10bc('0xe2')]};}return respondWithRpcPromise('SendMail',_0x10bc('0xe3'),{'account':_0x4b5ecd,'message':{'from':util[_0x10bc('0xaf')](_0x10bc('0xe4'),_0x1041d6[_0x10bc('0x3a')],_0x1041d6[_0x10bc('0xe5')]||_0x1041d6[_0x10bc('0xda')][_0x10bc('0x5b')]),'to':_0x16a478[_0x10bc('0xdb')],'subject':_0x16a478['offlineMessageSubject'],'text':_0x24e8b1[_0x10bc('0x5a')]}},client9003)['then'](function(){return _0x24e8b1;})[_0x10bc('0x2d')](function(_0x4288ad){console[_0x10bc('0x29')](_0x4288ad);});}})['then'](function(){if(_0x24e8b1){return _0x24e8b1;}})[_0x10bc('0x23')](respondWithResult(_0x5832ae,null))[_0x10bc('0x2d')](handleError(_0x5832ae,null));};exports[_0x10bc('0xe6')]=function(_0x285747,_0x434756,_0x6463b9){return db[_0x10bc('0xb8')][_0x10bc('0x5e')]({'where':{'id':_0x285747[_0x10bc('0x57')]['id']}})[_0x10bc('0x23')](handleEntityNotFound(_0x434756,null))[_0x10bc('0x23')](function(_0x4d6340){if(_0x4d6340){return _0x4d6340['addInteraction'](_0x285747[_0x10bc('0x5a')][_0x10bc('0x69')],_[_0x10bc('0xe7')](_0x285747['body'],['ids','id'])||{});}})[_0x10bc('0x23')](respondWithResult(_0x434756,null))['catch'](handleError(_0x434756,null));};exports[_0x10bc('0xe8')]=function(_0x72a973,_0x7a3a8b,_0x181446){var _0x566200={'raw':![],'where':{}};var _0x1398e9={};var _0x13fa0a={'count':0x0,'rows':[]};return db[_0x10bc('0x3f')]['findOne']({'where':{'id':_0x72a973[_0x10bc('0x57')]['id']}})['then'](handleEntityNotFound(_0x7a3a8b,null))['then'](function(_0x481f25){if(_0x481f25){_0x1398e9[_0x10bc('0x41')]=_[_0x10bc('0x58')](db[_0x10bc('0xb8')][_0x10bc('0x40')]);_0x1398e9['query']=_[_0x10bc('0x58')](_0x72a973[_0x10bc('0x42')]);_0x1398e9['filters']=_[_0x10bc('0x44')](_0x1398e9['model'],_0x1398e9[_0x10bc('0x42')]);_0x566200['attributes']=_[_0x10bc('0x44')](_0x1398e9[_0x10bc('0x41')],qs['fields'](_0x72a973['query'][_0x10bc('0x46')]));_0x566200[_0x10bc('0x45')]=_0x566200[_0x10bc('0x45')][_0x10bc('0x47')]?_0x566200[_0x10bc('0x45')]:_0x1398e9['model'];if(!_0x72a973[_0x10bc('0x42')][_0x10bc('0x66')](_0x10bc('0x48'))){_0x566200[_0x10bc('0x49')]=qs[_0x10bc('0x49')](_0x72a973['query'][_0x10bc('0x49')]);_0x566200[_0x10bc('0x32')]=qs[_0x10bc('0x32')](_0x72a973['query'][_0x10bc('0x32')]);}_0x566200[_0x10bc('0x6d')]=qs[_0x10bc('0x4a')](_0x72a973[_0x10bc('0x42')]['sort']);_0x566200[_0x10bc('0x4b')]=qs[_0x10bc('0x43')](_[_0x10bc('0x67')](_0x72a973[_0x10bc('0x42')],_0x1398e9[_0x10bc('0x43')]));_0x566200['where'][_0x10bc('0x63')]=_0x481f25['id'];if(_0x72a973[_0x10bc('0x42')][_0x10bc('0x4c')]){_0x566200[_0x10bc('0x4b')]=_['merge'](_0x566200[_0x10bc('0x4b')],{'$or':_[_0x10bc('0x4e')](_0x566200['attributes'],function(_0x159996){var _0x155e62={};_0x155e62[_0x159996]={'$like':'%'+_0x72a973[_0x10bc('0x42')][_0x10bc('0x4c')]+'%'};return _0x155e62;})});}_0x566200=_[_0x10bc('0x4d')]({},_0x566200,_0x72a973[_0x10bc('0x50')]);return db[_0x10bc('0xb8')][_0x10bc('0x51')]({'where':_0x566200[_0x10bc('0x4b')]})[_0x10bc('0x23')](function(_0x2fe632){_0x13fa0a[_0x10bc('0x51')]=_0x2fe632;if(_0x72a973[_0x10bc('0x42')][_0x10bc('0x52')]){_0x566200[_0x10bc('0x53')]=[{'model':db[_0x10bc('0x8e')],'as':_0x10bc('0xe9'),'required':![]},{'model':db[_0x10bc('0xc4')],'as':'Owner','attributes':[_0x10bc('0x3a'),_0x10bc('0xea'),_0x10bc('0xeb')],'required':![]},{'model':db[_0x10bc('0xec')],'as':'Tags','attributes':['id',_0x10bc('0x3a'),'color'],'where':_0x72a973[_0x10bc('0x42')][_0x10bc('0xed')]?{'id':_0x72a973[_0x10bc('0x42')]['tag']}:undefined,'required':_0x72a973[_0x10bc('0x42')][_0x10bc('0xed')]?!![]:![]}];}return db[_0x10bc('0xb8')][_0x10bc('0x54')](_0x566200);})['then'](function(_0x85ec1){_0x13fa0a['rows']=_0x85ec1;return _0x13fa0a;});}})[_0x10bc('0x23')](respondWithFilteredResult(_0x7a3a8b,_0x566200))[_0x10bc('0x2d')](handleError(_0x7a3a8b,null));};function iftimePromise(_0x2e2897,_0x16361f){return respondWithRpcPromise(_0x10bc('0xee'),_0x10bc('0xef'),{'command':_0x16361f[_0x10bc('0xf0')]?util[_0x10bc('0xaf')]('iftime\x20%s,%s',_0x2e2897[_0x10bc('0xf1')],_0x16361f[_0x10bc('0xf0')]):util[_0x10bc('0xaf')](_0x10bc('0xf2'),_0x2e2897['interval'])},client9002)[_0x10bc('0x23')](function(_0x3d8067){var _0x10644f=_0x3d8067&&_0x3d8067['indexOf']('true')>=0x0?!![]:![];logger[_0x10bc('0x24')](_0x10bc('0xf3'),_0x16361f['id'],_0x2e2897['id'],_0x2e2897['interval'],_0x10644f?_0x10bc('0xf4'):_0x10bc('0xf5'),_0x16361f['timezone']?_0x16361f[_0x10bc('0xf0')]:_0x10bc('0xf6'));return _0x10644f;})[_0x10bc('0x2d')](function(_0x6aaea9){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x16361f['id'],_0x2e2897['id'],_0x2e2897[_0x10bc('0xf1')],util[_0x10bc('0xf7')](_0x6aaea9,{'showHidden':![],'depth':null}),_0x16361f[_0x10bc('0xf0')]?_0x16361f[_0x10bc('0xf0')]:'No\x20timezone');return![];});}exports['getSnippet']=function(_0x3fb5f9,_0x5114f1,_0x586b31){var _0x59cc8d=0x0;var _0x5aa1b7=0x0;var _0x3f1ea2=![];var _0x294e1d;var _0x2b581b;return db['ChatWebsite']['find']({'where':{'id':_0x3fb5f9[_0x10bc('0x57')]['id']},'include':[{'model':db['Interval'],'as':_0x10bc('0xf8'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x10bc('0xf1')],'raw':!![]}]}]})[_0x10bc('0x23')](handleEntityNotFound(_0x5114f1,null))[_0x10bc('0x23')](function(_0x1888cc){if(_0x1888cc){_0x294e1d=_0x1888cc;return _0x1888cc[_0x10bc('0xf9')]({'raw':!![]});}})[_0x10bc('0x23')](function(_0x3470a9){if(_0x294e1d){if(_0x3470a9){_0x2b581b=_0x3470a9;}}return require(_0x10bc('0x7b'))[_0x10bc('0x7c')]();})[_0x10bc('0x23')](function(_0x18bc2a){if(_0x18bc2a){_0x5aa1b7=_0x18bc2a[_0x10bc('0xfa')];_0x3f1ea2=_0x18bc2a['custom'];}})[_0x10bc('0x23')](function(){return db[_0x10bc('0xb8')][_0x10bc('0x51')]({'where':{'closed':![]}});})[_0x10bc('0x23')](function(_0x12469c){_0x59cc8d=_0x12469c;if(_0x5aa1b7&&_0x12469c>_0x5aa1b7){return db['License']['findOne']({'where':{'id':0x1}})['then'](function(_0x23bf99){if(_0x23bf99){_0x23bf99[_0x10bc('0xfb')]('chatLicenseExceeded');}});}})[_0x10bc('0x23')](function(){if(_0x294e1d[_0x10bc('0xf8')]&&_0x294e1d['Interval'][_0x10bc('0xfc')]){var _0x3597c0=[];for(var _0x31c0ae=0x0;_0x31c0ae<_0x294e1d[_0x10bc('0xf8')][_0x10bc('0xfc')][_0x10bc('0x47')];_0x31c0ae++){var _0x59b52b=_0x294e1d[_0x10bc('0xf8')][_0x10bc('0xfc')][_0x31c0ae]['get']({'plain':!![]});_0x3597c0[_0x10bc('0xbe')](iftimePromise(_0x59b52b,_0x294e1d));}return BPromise['all'](_0x3597c0)[_0x10bc('0x23')](function(_0xac9e27){return _['some'](_0xac9e27);});}else{return!![];}})['then'](function(_0x346a9a){var _0x21b498=fs[_0x10bc('0xfd')](path[_0x10bc('0x79')](config[_0x10bc('0x7f')],_0x10bc('0xfe')),_0x10bc('0xd5'));var _0x9f70e4={'remote':_0x294e1d[_0x10bc('0xff')],'query':querystring['stringify'](_[_0x10bc('0x4d')](_0x294e1d['get']({'plain':!![]}),{'customerIp':_0x3fb5f9[_0x10bc('0x8b')][_0x10bc('0x100')]||_0x3fb5f9[_0x10bc('0x8b')]['x-real-ip']||_0x3fb5f9[_0x10bc('0x101')][_0x10bc('0x102')]||_0x3fb5f9['ip'],'referer':_0x3fb5f9[_0x10bc('0x8b')][_0x10bc('0xac')],'openedInteractions':_0x59cc8d,'maxInteractions':_0x5aa1b7,'virtual':_0x3f1ea2['virtual'],'online':_0x346a9a,'custom':_0x3f1ea2}))[_0x10bc('0x103')](/'/g,'\x5c\x27')};_0x5114f1[_0x10bc('0x3b')](ejs[_0x10bc('0x104')](Mustache['render'](_0x21b498,_0x9f70e4),{'proactiveActions':_0x2b581b,'alignment':_0x294e1d[_0x10bc('0x105')],'verticalAlignment':_0x294e1d['verticalAlignment']}));})['catch'](handleError(_0x5114f1,null));};exports[_0x10bc('0x106')]=function(_0x51e19b,_0x435133,_0xa8f583){return db[_0x10bc('0x3f')][_0x10bc('0x65')]({'where':{'id':_0x51e19b[_0x10bc('0x57')]['id']}})[_0x10bc('0x23')](handleEntityNotFound(_0x435133,null))[_0x10bc('0x23')](function(_0x34e0d2){if(_0x34e0d2){return db[_0x10bc('0x107')][_0x10bc('0x108')](function(_0x459c88){return db[_0x10bc('0xa2')][_0x10bc('0x39')]({'where':{'ChatWebsiteId':_0x51e19b[_0x10bc('0x57')]['id']},'transaction':_0x459c88})[_0x10bc('0x23')](function(_0x2cf77e){var _0xb1031=_[_0x10bc('0x4e')](_0x51e19b[_0x10bc('0x5a')],function(_0x48981d){_0x48981d[_0x10bc('0x63')]=_0x51e19b[_0x10bc('0x57')]['id'];return _0x48981d;});return db['ChatApplication'][_0x10bc('0x109')](_0xb1031,{'transaction':_0x459c88});});})[_0x10bc('0x23')](function(){return db[_0x10bc('0xa2')][_0x10bc('0x10a')]({'where':{'ChatWebsiteId':_0x51e19b[_0x10bc('0x57')]['id']},'order':'priority'});});}})[_0x10bc('0x23')](respondWithResult(_0x435133,null))[_0x10bc('0x2d')](handleError(_0x435133,null));};exports[_0x10bc('0x10b')]=function(_0x16fc8a,_0x251f6,_0x5b45a7){var _0x112508={};var _0x215524={};var _0x3dcc93;var _0x589bca;return db['ChatWebsite'][_0x10bc('0x65')]({'where':{'id':_0x16fc8a[_0x10bc('0x57')]['id']}})[_0x10bc('0x23')](handleEntityNotFound(_0x251f6,null))[_0x10bc('0x23')](function(_0x1ee3e7){if(_0x1ee3e7){_0x3dcc93=_0x1ee3e7;_0x215524[_0x10bc('0x41')]=_[_0x10bc('0x58')](db[_0x10bc('0xa2')][_0x10bc('0x40')]);_0x215524[_0x10bc('0x42')]=_[_0x10bc('0x58')](_0x16fc8a[_0x10bc('0x42')]);_0x215524[_0x10bc('0x43')]=_[_0x10bc('0x44')](_0x215524[_0x10bc('0x41')],_0x215524[_0x10bc('0x42')]);_0x112508['attributes']=_['intersection'](_0x215524[_0x10bc('0x41')],qs[_0x10bc('0x46')](_0x16fc8a[_0x10bc('0x42')][_0x10bc('0x46')]));_0x112508[_0x10bc('0x45')]=_0x112508[_0x10bc('0x45')][_0x10bc('0x47')]?_0x112508[_0x10bc('0x45')]:_0x215524[_0x10bc('0x41')];_0x112508[_0x10bc('0x6d')]=qs[_0x10bc('0x4a')](_0x16fc8a[_0x10bc('0x42')]['sort']);_0x112508['where']=qs[_0x10bc('0x43')](_[_0x10bc('0x67')](_0x16fc8a[_0x10bc('0x42')],_0x215524[_0x10bc('0x43')]));if(_0x16fc8a[_0x10bc('0x42')][_0x10bc('0x4c')]){_0x112508['where']=_[_0x10bc('0x4d')](_0x112508[_0x10bc('0x4b')],{'$or':_[_0x10bc('0x4e')](_0x112508[_0x10bc('0x45')],function(_0x315212){var _0x18c396={};_0x18c396[_0x315212]={'$like':'%'+_0x16fc8a[_0x10bc('0x42')]['filter']+'%'};return _0x18c396;})});}_0x112508=_[_0x10bc('0x4d')]({},_0x112508,_0x16fc8a[_0x10bc('0x50')]);return _0x3dcc93['getApplications'](_0x112508);}})[_0x10bc('0x23')](function(_0x2f6666){if(_0x2f6666){_0x589bca=_0x2f6666[_0x10bc('0x47')];if(!_0x16fc8a[_0x10bc('0x42')]['hasOwnProperty']('nolimit')){_0x112508[_0x10bc('0x49')]=qs['limit'](_0x16fc8a[_0x10bc('0x42')][_0x10bc('0x49')]);_0x112508['offset']=qs[_0x10bc('0x32')](_0x16fc8a['query']['offset']);}return _0x3dcc93[_0x10bc('0x10b')](_0x112508);}})[_0x10bc('0x23')](function(_0x180f23){if(_0x180f23){return _0x180f23?{'count':_0x589bca,'rows':_0x180f23}:null;}})[_0x10bc('0x23')](respondWithResult(_0x251f6,null))['catch'](handleError(_0x251f6,null));};exports['addProactiveActions']=function(_0x51be43,_0x5d6b54,_0x378b6c){return db[_0x10bc('0x10c')]['find']({'where':{'id':_0x51be43['params']['id']}})[_0x10bc('0x23')](handleEntityNotFound(_0x5d6b54,null))['then'](function(_0x77a6c5){if(_0x77a6c5){return _0x77a6c5[_0x10bc('0x10d')](_0x51be43[_0x10bc('0x5a')]['ids'],_[_0x10bc('0xe7')](_0x51be43[_0x10bc('0x5a')],[_0x10bc('0x69'),'id'])||{});}})[_0x10bc('0x23')](respondWithResult(_0x5d6b54,null))['catch'](handleError(_0x5d6b54,null));};exports['getProactiveActions']=function(_0x3d082d,_0x3e94c2,_0xca0761){var _0x3b5a9f={};var _0x42e6c2={};var _0x2002ac;var _0x39c72a;return db['ChatWebsite'][_0x10bc('0x65')]({'where':{'id':_0x3d082d[_0x10bc('0x57')]['id']}})[_0x10bc('0x23')](handleEntityNotFound(_0x3e94c2,null))[_0x10bc('0x23')](function(_0x295366){if(_0x295366){_0x2002ac=_0x295366;_0x42e6c2[_0x10bc('0x41')]=_['keys'](db['ChatProactiveAction'][_0x10bc('0x40')]);_0x42e6c2[_0x10bc('0x42')]=_['keys'](_0x3d082d[_0x10bc('0x42')]);_0x42e6c2[_0x10bc('0x43')]=_['intersection'](_0x42e6c2['model'],_0x42e6c2[_0x10bc('0x42')]);_0x3b5a9f['attributes']=_['intersection'](_0x42e6c2[_0x10bc('0x41')],qs[_0x10bc('0x46')](_0x3d082d[_0x10bc('0x42')][_0x10bc('0x46')]));_0x3b5a9f[_0x10bc('0x45')]=_0x3b5a9f['attributes']['length']?_0x3b5a9f['attributes']:_0x42e6c2['model'];_0x3b5a9f['order']=qs[_0x10bc('0x4a')](_0x3d082d['query'][_0x10bc('0x4a')]);_0x3b5a9f[_0x10bc('0x4b')]=qs[_0x10bc('0x43')](_[_0x10bc('0x67')](_0x3d082d[_0x10bc('0x42')],_0x42e6c2[_0x10bc('0x43')]));if(_0x3d082d['query'][_0x10bc('0x4c')]){_0x3b5a9f[_0x10bc('0x4b')]=_[_0x10bc('0x4d')](_0x3b5a9f[_0x10bc('0x4b')],{'$or':_[_0x10bc('0x4e')](_0x3b5a9f[_0x10bc('0x45')],function(_0x7830fb){var _0x1be5cc={};_0x1be5cc[_0x7830fb]={'$like':'%'+_0x3d082d[_0x10bc('0x42')]['filter']+'%'};return _0x1be5cc;})});}_0x3b5a9f=_['merge']({},_0x3b5a9f,_0x3d082d['options']);return _0x2002ac[_0x10bc('0xf9')](_0x3b5a9f);}})[_0x10bc('0x23')](function(_0x98d7e2){if(_0x98d7e2){_0x39c72a=_0x98d7e2[_0x10bc('0x47')];if(!_0x3d082d[_0x10bc('0x42')][_0x10bc('0x66')](_0x10bc('0x48'))){_0x3b5a9f[_0x10bc('0x49')]=qs['limit'](_0x3d082d[_0x10bc('0x42')][_0x10bc('0x49')]);_0x3b5a9f[_0x10bc('0x32')]=qs[_0x10bc('0x32')](_0x3d082d['query'][_0x10bc('0x32')]);}return _0x2002ac[_0x10bc('0xf9')](_0x3b5a9f);}})['then'](function(_0x19df9b){if(_0x19df9b){return _0x19df9b?{'count':_0x39c72a,'rows':_0x19df9b}:null;}})[_0x10bc('0x23')](respondWithResult(_0x3e94c2,null))[_0x10bc('0x2d')](handleError(_0x3e94c2,null));};exports[_0x10bc('0x10e')]=function(_0x2258de,_0x3203c5,_0x52defb){var _0x4119d4=_0x2258de[_0x10bc('0x42')][_0x10bc('0x10f')]===_0x10bc('0x110')?_0x10bc('0x111'):_0x10bc('0x112');return db[_0x10bc('0x3f')][_0x10bc('0x5e')]({'attributes':['id',_0x4119d4],'where':{'id':_0x2258de[_0x10bc('0x57')]['id']}})[_0x10bc('0x23')](handleEntityNotFound(_0x3203c5,null))['then'](function(_0x20ce54){if(_0x20ce54){var _0x532f59=_0x20ce54[_0x4119d4];var _0x5f3167=_0x532f59&&_0x532f59[_0x10bc('0x113')]?_0x532f59['items']:[];_0x3203c5[_0x10bc('0x3b')]({'fromKey':_[_0x10bc('0x7d')](_0x532f59[_0x10bc('0x114')])?undefined:_0x532f59[_0x10bc('0x114')],'count':_0x5f3167[_0x10bc('0x47')],'rows':_0x5f3167});}})[_0x10bc('0x2d')](handleError(_0x3203c5,null));};exports['getOfflineMessages']=function(_0x2b185b,_0x5d1e86,_0x111a32){var _0x3f64dd={'raw':!![],'where':{}};var _0xd7ffab={};var _0x5e5c16={'count':0x0,'rows':[]};return db[_0x10bc('0x3f')]['findOne']({'where':{'id':_0x2b185b[_0x10bc('0x57')]['id']}})[_0x10bc('0x23')](handleEntityNotFound(_0x5d1e86,null))[_0x10bc('0x23')](function(_0x357645){if(_0x357645){_0xd7ffab[_0x10bc('0x41')]=_[_0x10bc('0x58')](db[_0x10bc('0xd8')][_0x10bc('0x40')]);_0xd7ffab[_0x10bc('0x42')]=_[_0x10bc('0x58')](_0x2b185b[_0x10bc('0x42')]);_0xd7ffab[_0x10bc('0x43')]=_['intersection'](_0xd7ffab[_0x10bc('0x41')],_0xd7ffab[_0x10bc('0x42')]);_0x3f64dd[_0x10bc('0x45')]=_[_0x10bc('0x44')](_0xd7ffab['model'],qs[_0x10bc('0x46')](_0x2b185b[_0x10bc('0x42')][_0x10bc('0x46')]));_0x3f64dd[_0x10bc('0x45')]=_0x3f64dd['attributes'][_0x10bc('0x47')]?_0x3f64dd[_0x10bc('0x45')]:_0xd7ffab[_0x10bc('0x41')];if(!_0x2b185b[_0x10bc('0x42')]['hasOwnProperty']('nolimit')){_0x3f64dd['limit']=qs[_0x10bc('0x49')](_0x2b185b[_0x10bc('0x42')][_0x10bc('0x49')]);_0x3f64dd[_0x10bc('0x32')]=qs[_0x10bc('0x32')](_0x2b185b[_0x10bc('0x42')]['offset']);}_0x3f64dd[_0x10bc('0x6d')]=qs[_0x10bc('0x4a')](_0x2b185b[_0x10bc('0x42')]['sort']);_0x3f64dd[_0x10bc('0x4b')]=qs[_0x10bc('0x43')](_[_0x10bc('0x67')](_0x2b185b[_0x10bc('0x42')],_0xd7ffab[_0x10bc('0x43')]));_0x3f64dd[_0x10bc('0x4b')][_0x10bc('0x63')]=_0x357645['id'];if(_0x2b185b['query']['filter']){_0x3f64dd[_0x10bc('0x4b')]=_[_0x10bc('0x4d')](_0x3f64dd[_0x10bc('0x4b')],{'$or':_[_0x10bc('0x4e')](_0x3f64dd[_0x10bc('0x45')],function(_0x55377c){var _0x1e939e={};_0x1e939e[_0x55377c]={'$like':'%'+_0x2b185b['query'][_0x10bc('0x4c')]+'%'};return _0x1e939e;})});}_0x3f64dd=_[_0x10bc('0x4d')]({},_0x3f64dd,_0x2b185b[_0x10bc('0x50')]);return db[_0x10bc('0xd8')]['count']({'where':_0x3f64dd[_0x10bc('0x4b')]})[_0x10bc('0x23')](function(_0x165a50){_0x5e5c16[_0x10bc('0x51')]=_0x165a50;if(_0x2b185b[_0x10bc('0x42')]['includeAll']){_0x3f64dd['include']=[{'all':!![]}];}return db[_0x10bc('0xd8')]['findAll'](_0x3f64dd);})[_0x10bc('0x23')](function(_0x1f1479){_0x5e5c16['rows']=_0x1f1479;return _0x5e5c16;});}})[_0x10bc('0x23')](respondWithFilteredResult(_0x5d1e86,_0x3f64dd))['catch'](handleError(_0x5d1e86,null));};exports[_0x10bc('0x115')]=function(_0x5ee3ae,_0x3852e6,_0x48d7b2){return db[_0x10bc('0x3f')][_0x10bc('0x5e')]({'where':{'id':_0x5ee3ae[_0x10bc('0x57')]['id']}})['then'](handleEntityNotFound(_0x3852e6,null))[_0x10bc('0x23')](function(_0xf512b0){if(_0xf512b0){return _0xf512b0[_0x10bc('0x115')](_0x5ee3ae['body'][_0x10bc('0x69')],_['omit'](_0x5ee3ae[_0x10bc('0x5a')],[_0x10bc('0x69'),'id'])||{})['spread'](function(_0x42c178){for(var _0x51892c=0x0;_0x51892c<_0x5ee3ae['body'][_0x10bc('0x69')]['length'];_0x51892c+=0x1){socket[_0x10bc('0x116')](_0x10bc('0x117'),{'UserId':_0x5ee3ae['body']['ids'][_0x51892c],'ChatWebsiteId':_0x5ee3ae[_0x10bc('0x57')]['id']});}return _0x42c178;});}})[_0x10bc('0x23')](respondWithResult(_0x3852e6,null))[_0x10bc('0x2d')](handleError(_0x3852e6,null));};exports[_0x10bc('0x118')]=function(_0x3c72dc,_0x48b591,_0x239de6){return db[_0x10bc('0x3f')][_0x10bc('0x5e')]({'where':{'id':_0x3c72dc[_0x10bc('0x57')]['id']}})[_0x10bc('0x23')](handleEntityNotFound(_0x48b591,null))[_0x10bc('0x23')](function(_0x33271b){if(_0x33271b){return _0x33271b[_0x10bc('0x118')](_0x3c72dc['query'][_0x10bc('0x69')])[_0x10bc('0x23')](function(){if(_[_0x10bc('0x119')](_0x3c72dc['query']['ids'])){for(var _0x28e31e=0x0;_0x28e31e<_0x3c72dc[_0x10bc('0x42')][_0x10bc('0x69')]['length'];_0x28e31e+=0x1){socket['emit'](_0x10bc('0x11a'),{'UserId':Number(_0x3c72dc[_0x10bc('0x42')]['ids'][_0x28e31e]),'ChatWebsiteId':Number(_0x3c72dc[_0x10bc('0x57')]['id'])});}}else{socket[_0x10bc('0x116')](_0x10bc('0x11a'),{'UserId':Number(_0x3c72dc[_0x10bc('0x42')][_0x10bc('0x69')]),'ChatWebsiteId':Number(_0x3c72dc[_0x10bc('0x57')]['id'])});}});}})[_0x10bc('0x23')](respondWithStatusCode(_0x48b591,null))[_0x10bc('0x2d')](handleError(_0x48b591,null));};exports['getAgents']=function(_0x33fd8c,_0x1c65c0,_0x21cedd){var _0x59bd87={};var _0x300f4c={};var _0x49f1cc;var _0x1b89f1;return db['ChatWebsite'][_0x10bc('0x65')]({'where':{'id':_0x33fd8c[_0x10bc('0x57')]['id']}})[_0x10bc('0x23')](handleEntityNotFound(_0x1c65c0,null))[_0x10bc('0x23')](function(_0x289360){if(_0x289360){_0x49f1cc=_0x289360;_0x300f4c['model']=_[_0x10bc('0x58')](db['User'][_0x10bc('0x40')]);_0x300f4c[_0x10bc('0x42')]=_[_0x10bc('0x58')](_0x33fd8c['query']);_0x300f4c[_0x10bc('0x43')]=_[_0x10bc('0x44')](_0x300f4c[_0x10bc('0x41')],_0x300f4c[_0x10bc('0x42')]);_0x59bd87['attributes']=_['intersection'](_0x300f4c[_0x10bc('0x41')],qs[_0x10bc('0x46')](_0x33fd8c['query'][_0x10bc('0x46')]));_0x59bd87[_0x10bc('0x45')]=_0x59bd87[_0x10bc('0x45')][_0x10bc('0x47')]?_0x59bd87[_0x10bc('0x45')]:_0x300f4c[_0x10bc('0x41')];_0x59bd87[_0x10bc('0x6d')]=qs[_0x10bc('0x4a')](_0x33fd8c['query']['sort']);_0x59bd87['where']=qs['filters'](_[_0x10bc('0x67')](_0x33fd8c[_0x10bc('0x42')],_0x300f4c[_0x10bc('0x43')]));if(_0x33fd8c[_0x10bc('0x42')][_0x10bc('0x4c')]){_0x59bd87[_0x10bc('0x4b')]=_[_0x10bc('0x4d')](_0x59bd87[_0x10bc('0x4b')],{'$or':_['map'](_0x59bd87[_0x10bc('0x45')],function(_0x3f6067){var _0x1f728c={};_0x1f728c[_0x3f6067]={'$like':'%'+_0x33fd8c[_0x10bc('0x42')][_0x10bc('0x4c')]+'%'};return _0x1f728c;})});}_0x59bd87=_['merge']({},_0x59bd87,_0x33fd8c[_0x10bc('0x50')]);return _0x49f1cc[_0x10bc('0x11b')](_0x59bd87);}})[_0x10bc('0x23')](function(_0x11ddec){if(_0x11ddec){_0x1b89f1=_0x11ddec[_0x10bc('0x47')];if(!_0x33fd8c[_0x10bc('0x42')]['hasOwnProperty'](_0x10bc('0x48'))){_0x59bd87[_0x10bc('0x49')]=qs[_0x10bc('0x49')](_0x33fd8c['query']['limit']);_0x59bd87[_0x10bc('0x32')]=qs['offset'](_0x33fd8c['query']['offset']);}return _0x49f1cc[_0x10bc('0x11b')](_0x59bd87);}})[_0x10bc('0x23')](function(_0x5a93dc){if(_0x5a93dc){return _0x5a93dc?{'count':_0x1b89f1,'rows':_0x5a93dc}:null;}})[_0x10bc('0x23')](respondWithResult(_0x1c65c0,null))[_0x10bc('0x2d')](handleError(_0x1c65c0,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 1909c48..b7df3a0 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 _0x0a25=['hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','remove','emit'];(function(_0x57cb4f,_0x541f57){var _0x29bb45=function(_0x462bee){while(--_0x462bee){_0x57cb4f['push'](_0x57cb4f['shift']());}};_0x29bb45(++_0x541f57);}(_0x0a25,0x1df));var _0x50a2=function(_0xd654be,_0x55ef7c){_0xd654be=_0xd654be-0x0;var _0x22cfb8=_0x0a25[_0xd654be];return _0x22cfb8;};'use strict';var EventEmitter=require(_0x50a2('0x0'));var ChatWebsite=require(_0x50a2('0x1'))['db'][_0x50a2('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x50a2('0x3')](0x0);var events={'afterCreate':_0x50a2('0x4'),'afterUpdate':'update','afterDestroy':_0x50a2('0x5')};function emitEvent(_0x5da5c1){return function(_0x272134,_0x24c1cd,_0x1b7add){ChatWebsiteEvents[_0x50a2('0x6')](_0x5da5c1+':'+_0x272134['id'],_0x272134);ChatWebsiteEvents[_0x50a2('0x6')](_0x5da5c1,_0x272134);_0x1b7add(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x50a2('0x7')](e,emitEvent(event));}}module[_0x50a2('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x1719=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatWebsite'];(function(_0x13c536,_0x2b5a99){var _0x4ed2df=function(_0x275cfa){while(--_0x275cfa){_0x13c536['push'](_0x13c536['shift']());}};_0x4ed2df(++_0x2b5a99);}(_0x1719,0x177));var _0x9171=function(_0x4c345,_0x1c0fbb){_0x4c345=_0x4c345-0x0;var _0x172fc7=_0x1719[_0x4c345];return _0x172fc7;};'use strict';var EventEmitter=require(_0x9171('0x0'));var ChatWebsite=require(_0x9171('0x1'))['db'][_0x9171('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9171('0x3'),'afterUpdate':_0x9171('0x4'),'afterDestroy':_0x9171('0x5')};function emitEvent(_0x507a17){return function(_0x26c17e,_0x1c5d10,_0x13f260){ChatWebsiteEvents[_0x9171('0x6')](_0x507a17+':'+_0x26c17e['id'],_0x26c17e);ChatWebsiteEvents[_0x9171('0x6')](_0x507a17,_0x26c17e);_0x13f260(null);};}for(var e in events){if(events[_0x9171('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x9171('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index ba8febd..ace6fbd 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 _0xa0b1=['ChatWebsite','chat_websites','lodash','api','moment','bluebird','request-promise','rimraf','exports','define'];(function(_0x290dce,_0x1297e1){var _0x15cdb9=function(_0x3010ce){while(--_0x3010ce){_0x290dce['push'](_0x290dce['shift']());}};_0x15cdb9(++_0x1297e1);}(_0xa0b1,0x156));var _0x1a0b=function(_0x3e0863,_0x5e7b9a){_0x3e0863=_0x3e0863-0x0;var _0x5cf89=_0xa0b1[_0x3e0863];return _0x5cf89;};'use strict';var _=require(_0x1a0b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1a0b('0x1'));var moment=require(_0x1a0b('0x2'));var BPromise=require(_0x1a0b('0x3'));var rp=require(_0x1a0b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1a0b('0x5'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0x1a0b('0x6')]=function(_0x199939,_0x155299){return _0x199939[_0x1a0b('0x7')](_0x1a0b('0x8'),attributes,{'tableName':_0x1a0b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6df=['./chatWebsite.attributes','exports','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x1857c6,_0x48840c){var _0x51011c=function(_0x3a4736){while(--_0x3a4736){_0x1857c6['push'](_0x1857c6['shift']());}};_0x51011c(++_0x48840c);}(_0xc6df,0x65));var _0xfc6d=function(_0x3538d4,_0x5842c8){_0x3538d4=_0x3538d4-0x0;var _0x1c821b=_0xc6df[_0x3538d4];return _0x1c821b;};'use strict';var _=require('lodash');var util=require(_0xfc6d('0x0'));var logger=require(_0xfc6d('0x1'))(_0xfc6d('0x2'));var moment=require(_0xfc6d('0x3'));var BPromise=require(_0xfc6d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfc6d('0x5'));var config=require(_0xfc6d('0x6'));var attributes=require(_0xfc6d('0x7'));module[_0xfc6d('0x8')]=function(_0x275013,_0x15e600){return _0x275013['define']('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 cba6c86..8bd149a 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 _0x64a3=['randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x147559,_0x1d2783){var _0x4d0d65=function(_0x5288cc){while(--_0x5288cc){_0x147559['push'](_0x147559['shift']());}};_0x4d0d65(++_0x1d2783);}(_0x64a3,0xe7));var _0x364a=function(_0x452833,_0x39b311){_0x452833=_0x452833-0x0;var _0x3f1d3c=_0x64a3[_0x452833];return _0x3f1d3c;};'use strict';var _=require(_0x364a('0x0'));var util=require(_0x364a('0x1'));var moment=require(_0x364a('0x2'));var BPromise=require('bluebird');var rs=require(_0x364a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x364a('0x4'))['db'];var utils=require(_0x364a('0x5'));var logger=require('../../config/logger')(_0x364a('0x6'));var config=require('../../config/environment');var jayson=require(_0x364a('0x7'));var client=jayson[_0x364a('0x8')][_0x364a('0x9')]({'port':0x232a});config['redis']=_[_0x364a('0xa')](config[_0x364a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x364a('0xc'))(new Redis(config[_0x364a('0xb')]));require(_0x364a('0xd'))[_0x364a('0xe')](socket);function respondWithRpcPromise(_0x2c86d5,_0x231e8b,_0x503ea3){return new BPromise(function(_0x2ae9a0,_0x3ae38d){return client['request'](_0x2c86d5,_0x503ea3)[_0x364a('0xf')](function(_0x598908){logger[_0x364a('0x10')](_0x364a('0x11'),_0x231e8b,_0x364a('0x12'));logger[_0x364a('0x13')](_0x364a('0x14'),_0x231e8b,_0x364a('0x12'),JSON['stringify'](_0x598908));if(_0x598908['error']){if(_0x598908[_0x364a('0x15')][_0x364a('0x16')]===0x1f4){logger[_0x364a('0x15')](_0x364a('0x11'),_0x231e8b,_0x598908[_0x364a('0x15')][_0x364a('0x17')]);return _0x3ae38d(_0x598908[_0x364a('0x15')][_0x364a('0x17')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x231e8b,_0x598908[_0x364a('0x15')][_0x364a('0x17')]);return _0x2ae9a0(_0x598908['error'][_0x364a('0x17')]);}else{logger[_0x364a('0x10')](_0x364a('0x11'),_0x231e8b,_0x364a('0x12'));_0x2ae9a0(_0x598908[_0x364a('0x18')][_0x364a('0x17')]);}})[_0x364a('0x19')](function(_0x4d83b8){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x231e8b,_0x4d83b8);_0x3ae38d(_0x4d83b8);});});} \ No newline at end of file +var _0x730a=['redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','ChatWebsite,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x730a,0x80));var _0xa730=function(_0x47f8d2,_0x259040){_0x47f8d2=_0x47f8d2-0x0;var _0x5b31bb=_0x730a[_0x47f8d2];return _0x5b31bb;};'use strict';var _=require(_0xa730('0x0'));var util=require(_0xa730('0x1'));var moment=require(_0xa730('0x2'));var BPromise=require('bluebird');var rs=require(_0xa730('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa730('0x4'))['db'];var utils=require(_0xa730('0x5'));var logger=require(_0xa730('0x6'))(_0xa730('0x7'));var config=require(_0xa730('0x8'));var jayson=require(_0xa730('0x9'));var client=jayson[_0xa730('0xa')][_0xa730('0xb')]({'port':0x232a});config[_0xa730('0xc')]=_['defaults'](config[_0xa730('0xc')],{'host':_0xa730('0xd'),'port':0x18eb});var socket=require(_0xa730('0xe'))(new Redis(config[_0xa730('0xc')]));require(_0xa730('0xf'))[_0xa730('0x10')](socket);function respondWithRpcPromise(_0x52eeb2,_0x2adcfd,_0x552619){return new BPromise(function(_0x56328b,_0x36b2e3){return client[_0xa730('0x11')](_0x52eeb2,_0x552619)['then'](function(_0x432434){logger[_0xa730('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x2adcfd,_0xa730('0x13'));logger[_0xa730('0x14')](_0xa730('0x15'),_0x2adcfd,'request\x20sent',JSON['stringify'](_0x432434));if(_0x432434[_0xa730('0x16')]){if(_0x432434[_0xa730('0x16')][_0xa730('0x17')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x2adcfd,_0x432434[_0xa730('0x16')][_0xa730('0x18')]);return _0x36b2e3(_0x432434[_0xa730('0x16')][_0xa730('0x18')]);}logger[_0xa730('0x16')](_0xa730('0x19'),_0x2adcfd,_0x432434[_0xa730('0x16')]['message']);return _0x56328b(_0x432434['error'][_0xa730('0x18')]);}else{logger[_0xa730('0x12')](_0xa730('0x19'),_0x2adcfd,_0xa730('0x13'));_0x56328b(_0x432434[_0xa730('0x1a')]['message']);}})[_0xa730('0x1b')](function(_0x35ceea){logger[_0xa730('0x16')](_0xa730('0x19'),_0x2adcfd,_0x35ceea);_0x36b2e3(_0x35ceea);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index a7b7307..57f831e 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 _0x9a05=['update','emit','removeListener','chatWebsite:','./chatWebsite.events','save'];(function(_0x10e6a8,_0x285353){var _0x39bda9=function(_0x3ca4ba){while(--_0x3ca4ba){_0x10e6a8['push'](_0x10e6a8['shift']());}};_0x39bda9(++_0x285353);}(_0x9a05,0x14e));var _0x59a0=function(_0x598156,_0x5c290e){_0x598156=_0x598156-0x0;var _0x355e83=_0x9a05[_0x598156];return _0x355e83;};'use strict';var ChatWebsiteEvents=require(_0x59a0('0x0'));var events=[_0x59a0('0x1'),'remove',_0x59a0('0x2')];function createListener(_0x1e8ec1,_0x2fac1b){return function(_0x3ffbed){_0x2fac1b[_0x59a0('0x3')](_0x1e8ec1,_0x3ffbed);};}function removeListener(_0x22eb24,_0x59583c){return function(){ChatWebsiteEvents[_0x59a0('0x4')](_0x22eb24,_0x59583c);};}exports['register']=function(_0x4c69a7){for(var _0x5bb80d=0x0,_0x565949=events['length'];_0x5bb80d<_0x565949;_0x5bb80d++){var _0x5d4179=events[_0x5bb80d];var _0x345bc7=createListener(_0x59a0('0x5')+_0x5d4179,_0x4c69a7);ChatWebsiteEvents['on'](_0x5d4179,_0x345bc7);}}; \ No newline at end of file +var _0x276d=['register','length','chatWebsite:','./chatWebsite.events','save','update','emit','removeListener'];(function(_0x33efe7,_0x5a67cb){var _0x1939b0=function(_0x3ce475){while(--_0x3ce475){_0x33efe7['push'](_0x33efe7['shift']());}};_0x1939b0(++_0x5a67cb);}(_0x276d,0xe3));var _0xd276=function(_0x17237a,_0x2164e8){_0x17237a=_0x17237a-0x0;var _0x5d1e40=_0x276d[_0x17237a];return _0x5d1e40;};'use strict';var ChatWebsiteEvents=require(_0xd276('0x0'));var events=[_0xd276('0x1'),'remove',_0xd276('0x2')];function createListener(_0x1f5bb4,_0x12141f){return function(_0x3bee9b){_0x12141f[_0xd276('0x3')](_0x1f5bb4,_0x3bee9b);};}function removeListener(_0x2819c3,_0x509403){return function(){ChatWebsiteEvents[_0xd276('0x4')](_0x2819c3,_0x509403);};}exports[_0xd276('0x5')]=function(_0x12f4f0){for(var _0x60e587=0x0,_0x442420=events[_0xd276('0x6')];_0x60e587<_0x442420;_0x60e587++){var _0x1b2009=events[_0x60e587];var _0x20763f=createListener(_0xd276('0x7')+_0x1b2009,_0x12f4f0);ChatWebsiteEvents['on'](_0x1b2009,_0x20763f);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 6dcca82..dc2e7fa 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 _0x833b=['addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','/:id/offline','offline','addInteraction','addProactiveActions','addAgents','update','delete','destroy','removeAnswers','removeAgents','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','show','/:id/canned_answers','getAnswers','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','post','create','/:id/dispositions','diskStorage','join','root','format','now','originalname','single','file','addLogo','server/files/images/avatars/','%s-%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x833b,0x131));var _0xb833=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x833b[_0x4dc7b9];return _0x3ab114;};'use strict';var multer=require('multer');var util=require(_0xb833('0x0'));var path=require('path');var timeout=require(_0xb833('0x1'));var express=require('express');var router=express[_0xb833('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xb833('0x3'));var config=require(_0xb833('0x4'));var controller=require(_0xb833('0x5'));router[_0xb833('0x6')]('/',auth[_0xb833('0x7')](),controller[_0xb833('0x8')]);router[_0xb833('0x6')]('/describe',auth[_0xb833('0x7')](),controller[_0xb833('0x9')]);router[_0xb833('0x6')](_0xb833('0xa'),auth[_0xb833('0x7')](),controller[_0xb833('0xb')]);router[_0xb833('0x6')]('/:id/dispositions',auth[_0xb833('0x7')](),controller['getDispositions']);router[_0xb833('0x6')](_0xb833('0xc'),auth[_0xb833('0x7')](),controller[_0xb833('0xd')]);router['get']('/:id/logo',controller[_0xb833('0xe')]);router[_0xb833('0x6')]('/:id/avatar',controller[_0xb833('0xf')]);router['get'](_0xb833('0x10'),controller[_0xb833('0x11')]);router[_0xb833('0x6')](_0xb833('0x12'),controller[_0xb833('0x13')]);router[_0xb833('0x6')](_0xb833('0x14'),auth[_0xb833('0x7')](),controller['getInteractions']);router[_0xb833('0x6')](_0xb833('0x15'),controller['getSnippet']);router['get'](_0xb833('0x16'),auth['isAuthenticated'](),controller[_0xb833('0x17')]);router[_0xb833('0x6')]('/:id/proactive_actions',auth[_0xb833('0x7')](),controller[_0xb833('0x18')]);router['get'](_0xb833('0x19'),controller[_0xb833('0x1a')]);router[_0xb833('0x6')]('/:id/offline_messages',auth[_0xb833('0x7')](),controller[_0xb833('0x1b')]);router[_0xb833('0x6')](_0xb833('0x1c'),auth['isAuthenticated'](),controller['getAgents']);router[_0xb833('0x1d')]('/',auth[_0xb833('0x7')](),controller[_0xb833('0x1e')]);router[_0xb833('0x1d')](_0xb833('0x1f'),auth[_0xb833('0x7')](),controller['addDisposition']);router[_0xb833('0x1d')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer[_0xb833('0x20')]({'destination':function(_0x9e7cdb,_0x2e11d0,_0x532661){_0x532661(null,path[_0xb833('0x21')](config[_0xb833('0x22')],'server/files/images/logos/'));},'filename':function(_0x38beb0,_0x43161a,_0x4c95d8){_0x4c95d8(null,util[_0xb833('0x23')]('%s-%s',Date[_0xb833('0x24')](),_0x43161a[_0xb833('0x25')]));}})});router[_0xb833('0x1d')]('/:id/logo',upload[_0xb833('0x26')](_0xb833('0x27')),controller[_0xb833('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x148ef3,_0xbfaf92,_0xc35f67){_0xc35f67(null,path['join'](config['root'],_0xb833('0x29')));},'filename':function(_0x48838b,_0x3830f3,_0x3854e7){_0x3854e7(null,util[_0xb833('0x23')](_0xb833('0x2a'),Date[_0xb833('0x24')](),_0x3830f3[_0xb833('0x25')]));}})});router['post']('/:id/avatar',upload[_0xb833('0x26')](_0xb833('0x27')),controller[_0xb833('0x2b')]);var upload=multer({'storage':multer[_0xb833('0x20')]({'destination':function(_0x18668c,_0xf6dc69,_0x593e63){_0x593e63(null,path['join'](config['root'],_0xb833('0x29')));},'filename':function(_0x37cf49,_0x432d0a,_0x110763){_0x110763(null,util[_0xb833('0x23')](_0xb833('0x2a'),Date[_0xb833('0x24')](),_0x432d0a[_0xb833('0x25')]));}})});router[_0xb833('0x1d')](_0xb833('0x10'),upload[_0xb833('0x26')](_0xb833('0x27')),controller[_0xb833('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1148a5,_0x58e839,_0x3972ac){_0x3972ac(null,path['join'](config[_0xb833('0x22')],'server/files/images/avatars/'));},'filename':function(_0x1bd850,_0x2c0d1e,_0x133875){_0x133875(null,util[_0xb833('0x23')]('%s-%s',Date[_0xb833('0x24')](),_0x2c0d1e[_0xb833('0x25')]));}})});router[_0xb833('0x1d')]('/:id/system_avatar',upload[_0xb833('0x26')](_0xb833('0x27')),controller[_0xb833('0x2d')]);router[_0xb833('0x1d')](_0xb833('0x2e'),controller[_0xb833('0x2f')]);router[_0xb833('0x1d')](_0xb833('0x30'),controller[_0xb833('0x31')]);router[_0xb833('0x1d')]('/:id/interactions',auth[_0xb833('0x7')](),controller[_0xb833('0x32')]);router['post']('/:id/applications',auth[_0xb833('0x7')](),controller['addApplications']);router[_0xb833('0x1d')]('/:id/proactive_actions',auth[_0xb833('0x7')](),controller[_0xb833('0x33')]);router[_0xb833('0x1d')](_0xb833('0x1c'),auth[_0xb833('0x7')](),controller[_0xb833('0x34')]);router['put'](_0xb833('0xa'),auth['isAuthenticated'](),controller[_0xb833('0x35')]);router[_0xb833('0x36')](_0xb833('0xa'),auth['isAuthenticated'](),controller[_0xb833('0x37')]);router[_0xb833('0x36')](_0xb833('0x1f'),auth[_0xb833('0x7')](),controller['removeDispositions']);router['delete'](_0xb833('0xc'),auth[_0xb833('0x7')](),controller[_0xb833('0x38')]);router[_0xb833('0x36')](_0xb833('0x1c'),auth[_0xb833('0x7')](),controller[_0xb833('0x39')]);module['exports']=router; \ No newline at end of file +var _0x4746=['offline','addInteraction','addApplications','addProactiveActions','/:id/users','addAgents','update','destroy','removeDispositions','delete','removeAnswers','removeAgents','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','/describe','describe','get','/:id','getDispositions','getLogo','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getAgents','post','create','/:id/dispositions','addDisposition','/:id/canned_answers','join','root','format','originalname','/:id/logo','single','%s-%s','now','/:id/avatar','file','addAvatar','addCustomerAvatar','diskStorage','server/files/images/avatars/','addSystemAvatar','/:id/notify'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4746,0xc6));var _0x6474=function(_0x40473e,_0x171381){_0x40473e=_0x40473e-0x0;var _0x463f9a=_0x4746[_0x40473e];return _0x463f9a;};'use strict';var multer=require(_0x6474('0x0'));var util=require(_0x6474('0x1'));var path=require('path');var timeout=require(_0x6474('0x2'));var express=require('express');var router=express[_0x6474('0x3')]();var auth=require(_0x6474('0x4'));var interaction=require(_0x6474('0x5'));var config=require(_0x6474('0x6'));var controller=require(_0x6474('0x7'));router['get']('/',auth[_0x6474('0x8')](),controller[_0x6474('0x9')]);router['get'](_0x6474('0xa'),auth[_0x6474('0x8')](),controller[_0x6474('0xb')]);router[_0x6474('0xc')](_0x6474('0xd'),auth[_0x6474('0x8')](),controller['show']);router[_0x6474('0xc')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x6474('0xe')]);router[_0x6474('0xc')]('/:id/canned_answers',auth[_0x6474('0x8')](),controller['getAnswers']);router[_0x6474('0xc')]('/:id/logo',controller[_0x6474('0xf')]);router[_0x6474('0xc')]('/:id/avatar',controller['getAvatar']);router['get'](_0x6474('0x10'),controller[_0x6474('0x11')]);router[_0x6474('0xc')](_0x6474('0x12'),controller[_0x6474('0x13')]);router[_0x6474('0xc')](_0x6474('0x14'),auth[_0x6474('0x8')](),controller[_0x6474('0x15')]);router['get']('/:id/snippet',controller['getSnippet']);router[_0x6474('0xc')](_0x6474('0x16'),auth[_0x6474('0x8')](),controller[_0x6474('0x17')]);router[_0x6474('0xc')]('/:id/proactive_actions',auth[_0x6474('0x8')](),controller[_0x6474('0x18')]);router[_0x6474('0xc')](_0x6474('0x19'),controller[_0x6474('0x1a')]);router[_0x6474('0xc')](_0x6474('0x1b'),auth[_0x6474('0x8')](),controller['getOfflineMessages']);router[_0x6474('0xc')]('/:id/users',auth[_0x6474('0x8')](),controller[_0x6474('0x1c')]);router[_0x6474('0x1d')]('/',auth[_0x6474('0x8')](),controller[_0x6474('0x1e')]);router[_0x6474('0x1d')](_0x6474('0x1f'),auth['isAuthenticated'](),controller[_0x6474('0x20')]);router['post'](_0x6474('0x21'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xb67896,_0x340fb6,_0x444365){_0x444365(null,path[_0x6474('0x22')](config[_0x6474('0x23')],'server/files/images/logos/'));},'filename':function(_0x7020fb,_0x388d2d,_0x46bf4f){_0x46bf4f(null,util[_0x6474('0x24')]('%s-%s',Date['now'](),_0x388d2d[_0x6474('0x25')]));}})});router[_0x6474('0x1d')](_0x6474('0x26'),upload[_0x6474('0x27')]('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4b81f3,_0x3333a8,_0x28d445){_0x28d445(null,path[_0x6474('0x22')](config[_0x6474('0x23')],'server/files/images/avatars/'));},'filename':function(_0x13af68,_0x3c49f8,_0xe24477){_0xe24477(null,util[_0x6474('0x24')](_0x6474('0x28'),Date[_0x6474('0x29')](),_0x3c49f8[_0x6474('0x25')]));}})});router['post'](_0x6474('0x2a'),upload[_0x6474('0x27')](_0x6474('0x2b')),controller[_0x6474('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4b3647,_0x4d5abe,_0x6f3d6f){_0x6f3d6f(null,path[_0x6474('0x22')](config[_0x6474('0x23')],'server/files/images/avatars/'));},'filename':function(_0x333c60,_0x11c0ca,_0x16f6ec){_0x16f6ec(null,util['format'](_0x6474('0x28'),Date[_0x6474('0x29')](),_0x11c0ca[_0x6474('0x25')]));}})});router['post'](_0x6474('0x10'),upload[_0x6474('0x27')]('file'),controller[_0x6474('0x2d')]);var upload=multer({'storage':multer[_0x6474('0x2e')]({'destination':function(_0x9289c8,_0x295d3f,_0x3a5521){_0x3a5521(null,path['join'](config[_0x6474('0x23')],_0x6474('0x2f')));},'filename':function(_0x54fcf7,_0x53281c,_0x44e54b){_0x44e54b(null,util['format'](_0x6474('0x28'),Date[_0x6474('0x29')](),_0x53281c[_0x6474('0x25')]));}})});router[_0x6474('0x1d')](_0x6474('0x12'),upload['single']('file'),controller[_0x6474('0x30')]);router[_0x6474('0x1d')](_0x6474('0x31'),controller['notify']);router[_0x6474('0x1d')]('/:id/offline',controller[_0x6474('0x32')]);router['post']('/:id/interactions',auth['isAuthenticated'](),controller[_0x6474('0x33')]);router[_0x6474('0x1d')](_0x6474('0x16'),auth[_0x6474('0x8')](),controller[_0x6474('0x34')]);router[_0x6474('0x1d')]('/:id/proactive_actions',auth[_0x6474('0x8')](),controller[_0x6474('0x35')]);router['post'](_0x6474('0x36'),auth[_0x6474('0x8')](),controller[_0x6474('0x37')]);router['put'](_0x6474('0xd'),auth[_0x6474('0x8')](),controller[_0x6474('0x38')]);router['delete']('/:id',auth[_0x6474('0x8')](),controller[_0x6474('0x39')]);router['delete'](_0x6474('0x1f'),auth[_0x6474('0x8')](),controller[_0x6474('0x3a')]);router[_0x6474('0x3b')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x6474('0x3c')]);router['delete'](_0x6474('0x36'),auth[_0x6474('0x8')](),controller[_0x6474('0x3d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index ca672dc..5e25b6b 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 _0xad44=['sequelize','exports','STRING'];(function(_0x14329c,_0x5b435d){var _0x5d7f49=function(_0x2fab46){while(--_0x2fab46){_0x14329c['push'](_0x14329c['shift']());}};_0x5d7f49(++_0x5b435d);}(_0xad44,0xfc));var _0x4ad4=function(_0x13b442,_0x448c33){_0x13b442=_0x13b442-0x0;var _0x49d09c=_0xad44[_0x13b442];return _0x49d09c;};'use strict';var Sequelize=require(_0x4ad4('0x0'));module[_0x4ad4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x4ad4('0x2')]},'companyId':{'type':Sequelize[_0x4ad4('0x2')]},'website':{'type':Sequelize[_0x4ad4('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x4ad4('0x2')]},'type':{'type':Sequelize[_0x4ad4('0x2')]},'street':{'type':Sequelize[_0x4ad4('0x2')]},'postalCode':{'type':Sequelize[_0x4ad4('0x2')]},'city':{'type':Sequelize[_0x4ad4('0x2')]},'country':{'type':Sequelize[_0x4ad4('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x4ad4('0x2')]},'sPostalCode':{'type':Sequelize[_0x4ad4('0x2')]},'sCity':{'type':Sequelize[_0x4ad4('0x2')]},'sCountry':{'type':Sequelize[_0x4ad4('0x2')]},'description':{'type':Sequelize[_0x4ad4('0x2')]}}; \ No newline at end of file +var _0x224d=['exports','STRING','sequelize'];(function(_0x1795df,_0xcb261e){var _0x3f13c0=function(_0x52c5cf){while(--_0x52c5cf){_0x1795df['push'](_0x1795df['shift']());}};_0x3f13c0(++_0xcb261e);}(_0x224d,0x14f));var _0xd224=function(_0x21b75e,_0x80026a){_0x21b75e=_0x21b75e-0x0;var _0x4bf785=_0x224d[_0x21b75e];return _0x4bf785;};'use strict';var Sequelize=require(_0xd224('0x0'));module[_0xd224('0x1')]={'name':{'type':Sequelize[_0xd224('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd224('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xd224('0x2')]},'phone':{'type':Sequelize[_0xd224('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd224('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xd224('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xd224('0x2')]},'email':{'type':Sequelize[_0xd224('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xd224('0x2')]},'sStreet':{'type':Sequelize[_0xd224('0x2')]},'sPostalCode':{'type':Sequelize[_0xd224('0x2')]},'sCity':{'type':Sequelize[_0xd224('0x2')]},'sCountry':{'type':Sequelize[_0xd224('0x2')]},'description':{'type':Sequelize[_0xd224('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index b97f96d..86be0d6 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 _0x5d53=['util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','destroy','then','get','Companies','UserProfileResource','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filter','merge','map','key','VIRTUAL','field','options','CmCompany','count','includeAll','include','findAll','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addContacts','omit','getContacts','findOne','length','pick','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x4f97fb,_0x431724){var _0x310ab8=function(_0x512489){while(--_0x512489){_0x4f97fb['push'](_0x4f97fb['shift']());}};_0x310ab8(++_0x431724);}(_0x5d53,0x15c));var _0x35d5=function(_0x38e177,_0x59ec9f){_0x38e177=_0x38e177-0x0;var _0x1faf15=_0x5d53[_0x38e177];return _0x1faf15;};'use strict';var pdf=require(_0x35d5('0x0'));var emlformat=require(_0x35d5('0x1'));var rimraf=require(_0x35d5('0x2'));var zipdir=require(_0x35d5('0x3'));var jsonpatch=require(_0x35d5('0x4'));var rp=require(_0x35d5('0x5'));var moment=require(_0x35d5('0x6'));var BPromise=require(_0x35d5('0x7'));var Mustache=require('mustache');var util=require(_0x35d5('0x8'));var path=require(_0x35d5('0x9'));var sox=require(_0x35d5('0xa'));var csv=require(_0x35d5('0xb'));var ejs=require(_0x35d5('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x35d5('0xd'));var crypto=require(_0x35d5('0xe'));var jsforce=require(_0x35d5('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x35d5('0xb'));var querystring=require(_0x35d5('0x10'));var Papa=require('papaparse');var Redis=require(_0x35d5('0x11'));var authService=require(_0x35d5('0x12'));var qs=require(_0x35d5('0x13'));var hardwareService=require(_0x35d5('0x14'));var logger=require(_0x35d5('0x15'))('api');var utils=require(_0x35d5('0x16'));var config=require(_0x35d5('0x17'));var db=require(_0x35d5('0x18'))['db'];function respondWithStatusCode(_0x307ef5,_0x451d17){_0x451d17=_0x451d17||0xcc;return function(_0x348458){if(_0x348458){return _0x307ef5[_0x35d5('0x19')](_0x451d17);}return _0x307ef5[_0x35d5('0x1a')](_0x451d17)[_0x35d5('0x1b')]();};}function respondWithResult(_0x21468d,_0x3301ac){_0x3301ac=_0x3301ac||0xc8;return function(_0x18e1a3){if(_0x18e1a3){return _0x21468d[_0x35d5('0x1a')](_0x3301ac)[_0x35d5('0x1c')](_0x18e1a3);}};}function respondWithFilteredResult(_0x505dd7,_0x22abc0){return function(_0xf41633){if(_0xf41633){var _0x4b2103=_0xf41633['count'],_0x4a2f50=_0x22abc0[_0x35d5('0x1d')],_0x376814=_0x22abc0[_0x35d5('0x1d')]+_0x22abc0['limit'],_0x41d3bc;if(_0x376814>=_0x4b2103){_0x376814=_0x4b2103;_0x41d3bc=0xc8;}else{_0x41d3bc=0xce;}_0x505dd7[_0x35d5('0x1a')](_0x41d3bc);return _0x505dd7[_0x35d5('0x1e')](_0x35d5('0x1f'),_0x4a2f50+'-'+_0x376814+'/'+_0x4b2103)['json'](_0xf41633);}return null;};}function patchUpdates(_0x48376c){return function(_0x2a727b){try{jsonpatch[_0x35d5('0x20')](_0x2a727b,_0x48376c,!![]);}catch(_0x4ff1d5){return BPromise[_0x35d5('0x21')](_0x4ff1d5);}return _0x2a727b[_0x35d5('0x22')]();};}function saveUpdates(_0xf9ba27,_0xf48bee){return function(_0x1ed715){if(_0x1ed715){return _0x1ed715['update'](_0xf9ba27)['then'](function(_0x4f98f3){return _0x4f98f3;});}return null;};}function removeEntity(_0x4952c9,_0x10da85){return function(_0x568ef8){if(_0x568ef8){return _0x568ef8[_0x35d5('0x23')]()[_0x35d5('0x24')](function(){var _0x5ba069=_0x568ef8[_0x35d5('0x25')]({'plain':!![]});var _0x281711=_0x35d5('0x26');return db[_0x35d5('0x27')]['destroy']({'where':{'type':_0x281711,'resourceId':_0x5ba069['id']}})['then'](function(){return _0x568ef8;});})[_0x35d5('0x24')](function(){_0x4952c9['status'](0xcc)[_0x35d5('0x1b')]();});}};}function handleEntityNotFound(_0x58b3c0,_0x2d431f){return function(_0x38b5d7){if(!_0x38b5d7){_0x58b3c0[_0x35d5('0x19')](0x194);}return _0x38b5d7;};}function handleError(_0x3427e3,_0x152698){_0x152698=_0x152698||0x1f4;return function(_0x2bd6b7){logger['error'](_0x2bd6b7[_0x35d5('0x28')]);if(_0x2bd6b7[_0x35d5('0x29')]){delete _0x2bd6b7[_0x35d5('0x29')];}_0x3427e3[_0x35d5('0x1a')](_0x152698)[_0x35d5('0x2a')](_0x2bd6b7);};}exports[_0x35d5('0x2b')]=function(_0x2c1375,_0x2dfff5){var _0x3c5e78={},_0x10d993={},_0x194c4f={'count':0x0,'rows':[]};var _0x5df6b8=db['CmCompany'][_0x35d5('0x2c')];_0x10d993[_0x35d5('0x2d')]=_[_0x35d5('0x2e')](_0x5df6b8);_0x10d993[_0x35d5('0x2f')]=_[_0x35d5('0x2e')](_0x2c1375[_0x35d5('0x2f')]);_0x10d993[_0x35d5('0x30')]=_[_0x35d5('0x31')](_0x10d993['model'],_0x10d993[_0x35d5('0x2f')]);_0x3c5e78[_0x35d5('0x32')]=_[_0x35d5('0x31')](_0x10d993[_0x35d5('0x2d')],qs[_0x35d5('0x33')](_0x2c1375[_0x35d5('0x2f')][_0x35d5('0x33')]));_0x3c5e78[_0x35d5('0x32')]=_0x3c5e78[_0x35d5('0x32')]['length']?_0x3c5e78[_0x35d5('0x32')]:_0x10d993[_0x35d5('0x2d')];if(!_0x2c1375['query'][_0x35d5('0x34')]('nolimit')){_0x3c5e78[_0x35d5('0x35')]=qs[_0x35d5('0x35')](_0x2c1375['query']['limit']);_0x3c5e78[_0x35d5('0x1d')]=qs[_0x35d5('0x1d')](_0x2c1375[_0x35d5('0x2f')][_0x35d5('0x1d')]);}_0x3c5e78[_0x35d5('0x36')]=qs[_0x35d5('0x37')](_0x2c1375[_0x35d5('0x2f')][_0x35d5('0x37')]);_0x3c5e78[_0x35d5('0x38')]=qs['filters'](_['pick'](_0x2c1375[_0x35d5('0x2f')],_0x10d993[_0x35d5('0x30')]));if(_0x2c1375[_0x35d5('0x2f')][_0x35d5('0x39')]){_0x3c5e78[_0x35d5('0x38')]=_[_0x35d5('0x3a')](_0x3c5e78[_0x35d5('0x38')],{'$or':_[_0x35d5('0x3b')](_0x5df6b8,function(_0x2219f5){if(_0x2219f5['type'][_0x35d5('0x3c')]!==_0x35d5('0x3d')){var _0x33a2c6={};_0x33a2c6[_0x2219f5[_0x35d5('0x3e')]]={'$like':'%'+_0x2c1375[_0x35d5('0x2f')][_0x35d5('0x39')]+'%'};return _0x33a2c6;}})});}_0x3c5e78=_['merge']({},_0x3c5e78,_0x2c1375[_0x35d5('0x3f')]);var _0x1f0b09={'where':_0x3c5e78[_0x35d5('0x38')]};return db[_0x35d5('0x40')][_0x35d5('0x41')](_0x1f0b09)[_0x35d5('0x24')](function(_0x4c099d){_0x194c4f[_0x35d5('0x41')]=_0x4c099d;if(_0x2c1375[_0x35d5('0x2f')][_0x35d5('0x42')]){_0x3c5e78[_0x35d5('0x43')]=[{'all':!![]}];}return db[_0x35d5('0x40')][_0x35d5('0x44')](_0x3c5e78);})[_0x35d5('0x24')](function(_0x47ab7f){_0x194c4f[_0x35d5('0x45')]=_0x47ab7f;return _0x194c4f;})['then'](respondWithFilteredResult(_0x2dfff5,_0x3c5e78))[_0x35d5('0x46')](handleError(_0x2dfff5,null));};exports['show']=function(_0xf18816,_0x3020a7){var _0x17b225={'raw':![],'where':{'id':_0xf18816['params']['id']}},_0x119433={};_0x119433[_0x35d5('0x2d')]=_[_0x35d5('0x2e')](db[_0x35d5('0x40')][_0x35d5('0x2c')]);_0x119433[_0x35d5('0x2f')]=_[_0x35d5('0x2e')](_0xf18816[_0x35d5('0x2f')]);_0x119433[_0x35d5('0x30')]=_[_0x35d5('0x31')](_0x119433[_0x35d5('0x2d')],_0x119433[_0x35d5('0x2f')]);_0x17b225['attributes']=_['intersection'](_0x119433[_0x35d5('0x2d')],qs[_0x35d5('0x33')](_0xf18816['query'][_0x35d5('0x33')]));_0x17b225[_0x35d5('0x32')]=_0x17b225[_0x35d5('0x32')]['length']?_0x17b225[_0x35d5('0x32')]:_0x119433[_0x35d5('0x2d')];if(_0xf18816[_0x35d5('0x2f')]['includeAll']){_0x17b225['include']=[{'all':!![]}];}_0x17b225=_[_0x35d5('0x3a')]({},_0x17b225,_0xf18816['options']);return db[_0x35d5('0x40')][_0x35d5('0x47')](_0x17b225)[_0x35d5('0x24')](handleEntityNotFound(_0x3020a7,null))['then'](respondWithResult(_0x3020a7,null))[_0x35d5('0x46')](handleError(_0x3020a7,null));};exports[_0x35d5('0x48')]=function(_0x1c7dfd,_0x3fcf19){return db[_0x35d5('0x40')][_0x35d5('0x48')](_0x1c7dfd[_0x35d5('0x49')],{})[_0x35d5('0x24')](function(_0x5a725f){var _0x5e2901=_0x1c7dfd[_0x35d5('0x4a')][_0x35d5('0x25')]({'plain':!![]});if(!_0x5e2901)throw new Error(_0x35d5('0x4b'));if(_0x5e2901['role']===_0x35d5('0x4a')){var _0x4abe71=_0x5a725f[_0x35d5('0x25')]({'plain':!![]});var _0xbe94cd='Companies';return db[_0x35d5('0x4c')][_0x35d5('0x47')]({'where':{'name':_0xbe94cd,'userProfileId':_0x5e2901[_0x35d5('0x4d')]},'raw':!![]})[_0x35d5('0x24')](function(_0x50d4f7){if(_0x50d4f7&&_0x50d4f7[_0x35d5('0x4e')]===0x0){return db[_0x35d5('0x27')][_0x35d5('0x48')]({'name':_0x4abe71[_0x35d5('0x29')],'resourceId':_0x4abe71['id'],'type':_0x50d4f7[_0x35d5('0x29')],'sectionId':_0x50d4f7['id']},{})[_0x35d5('0x24')](function(){return _0x5a725f;});}else{return _0x5a725f;}})[_0x35d5('0x46')](function(_0x392a1d){logger['error'](_0x35d5('0x4f'),_0x392a1d);throw _0x392a1d;});}return _0x5a725f;})[_0x35d5('0x24')](respondWithResult(_0x3fcf19,0xc9))['catch'](handleError(_0x3fcf19,null));};exports[_0x35d5('0x50')]=function(_0x132fc5,_0x40ef2b){if(_0x132fc5[_0x35d5('0x49')]['id']){delete _0x132fc5[_0x35d5('0x49')]['id'];}return db['CmCompany'][_0x35d5('0x47')]({'where':{'id':_0x132fc5[_0x35d5('0x51')]['id']}})[_0x35d5('0x24')](handleEntityNotFound(_0x40ef2b,null))['then'](saveUpdates(_0x132fc5[_0x35d5('0x49')],null))['then'](respondWithResult(_0x40ef2b,null))['catch'](handleError(_0x40ef2b,null));};exports[_0x35d5('0x23')]=function(_0x42f5f2,_0x10a8ab){return db[_0x35d5('0x40')][_0x35d5('0x47')]({'where':{'id':_0x42f5f2[_0x35d5('0x51')]['id']}})['then'](handleEntityNotFound(_0x10a8ab,null))['then'](removeEntity(_0x10a8ab,null))['catch'](handleError(_0x10a8ab,null));};exports[_0x35d5('0x52')]=function(_0x29350e,_0x3d2421,_0x4dc340){return db['CmContact'][_0x35d5('0x47')]({'where':{'id':_0x29350e[_0x35d5('0x51')]['id']}})[_0x35d5('0x24')](handleEntityNotFound(_0x3d2421,null))['then'](function(_0x1ea48a){if(_0x1ea48a){return _0x1ea48a[_0x35d5('0x52')](_0x29350e[_0x35d5('0x49')]['ids'],_[_0x35d5('0x53')](_0x29350e['body'],['ids','id'])||{});}})[_0x35d5('0x24')](respondWithResult(_0x3d2421,null))[_0x35d5('0x46')](handleError(_0x3d2421,null));};exports[_0x35d5('0x54')]=function(_0x1b31b2,_0x2dae6e,_0x19105c){var _0x13847b={};var _0x5e87f8={};var _0x3be0dd;var _0x581333;return db['CmCompany'][_0x35d5('0x55')]({'where':{'id':_0x1b31b2['params']['id']}})[_0x35d5('0x24')](handleEntityNotFound(_0x2dae6e,null))[_0x35d5('0x24')](function(_0x39e52f){if(_0x39e52f){_0x3be0dd=_0x39e52f;_0x5e87f8[_0x35d5('0x2d')]=_['keys'](db['CmContact'][_0x35d5('0x2c')]);_0x5e87f8[_0x35d5('0x2f')]=_[_0x35d5('0x2e')](_0x1b31b2[_0x35d5('0x2f')]);_0x5e87f8['filters']=_[_0x35d5('0x31')](_0x5e87f8[_0x35d5('0x2d')],_0x5e87f8[_0x35d5('0x2f')]);_0x13847b[_0x35d5('0x32')]=_[_0x35d5('0x31')](_0x5e87f8[_0x35d5('0x2d')],qs[_0x35d5('0x33')](_0x1b31b2[_0x35d5('0x2f')]['fields']));_0x13847b[_0x35d5('0x32')]=_0x13847b[_0x35d5('0x32')][_0x35d5('0x56')]?_0x13847b['attributes']:_0x5e87f8[_0x35d5('0x2d')];_0x13847b[_0x35d5('0x36')]=qs[_0x35d5('0x37')](_0x1b31b2['query'][_0x35d5('0x37')]);_0x13847b[_0x35d5('0x38')]=qs[_0x35d5('0x30')](_[_0x35d5('0x57')](_0x1b31b2['query'],_0x5e87f8[_0x35d5('0x30')]));if(_0x1b31b2['query']['filter']){_0x13847b['where']=_[_0x35d5('0x3a')](_0x13847b['where'],{'$or':_['map'](_0x13847b[_0x35d5('0x32')],function(_0x42dcac){var _0x494f8b={};_0x494f8b[_0x42dcac]={'$like':'%'+_0x1b31b2[_0x35d5('0x2f')][_0x35d5('0x39')]+'%'};return _0x494f8b;})});}_0x13847b=_[_0x35d5('0x3a')]({},_0x13847b,_0x1b31b2[_0x35d5('0x3f')]);return _0x3be0dd['getContacts'](_0x13847b);}})[_0x35d5('0x24')](function(_0xfedf6){if(_0xfedf6){_0x581333=_0xfedf6[_0x35d5('0x56')];if(!_0x1b31b2[_0x35d5('0x2f')][_0x35d5('0x34')](_0x35d5('0x58'))){_0x13847b['limit']=qs['limit'](_0x1b31b2[_0x35d5('0x2f')]['limit']);_0x13847b[_0x35d5('0x1d')]=qs[_0x35d5('0x1d')](_0x1b31b2[_0x35d5('0x2f')][_0x35d5('0x1d')]);}return _0x3be0dd[_0x35d5('0x54')](_0x13847b);}})[_0x35d5('0x24')](function(_0x428084){if(_0x428084){return _0x428084?{'count':_0x581333,'rows':_0x428084}:null;}})[_0x35d5('0x24')](respondWithResult(_0x2dae6e,null))[_0x35d5('0x46')](handleError(_0x2dae6e,null));}; \ No newline at end of file +var _0x7500=['sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','Companies','UserProfileResource','sendStatus','error','stack','name','send','rawAttributes','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','type','field','filter','options','CmCompany','include','findAll','rows','catch','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','params','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x9c70f9,_0x52fbbf){var _0x55afdc=function(_0x127843){while(--_0x127843){_0x9c70f9['push'](_0x9c70f9['shift']());}};_0x55afdc(++_0x52fbbf);}(_0x7500,0x1b4));var _0x0750=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x7500[_0x413feb];return _0x40ee88;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0750('0x0'));var rimraf=require(_0x0750('0x1'));var zipdir=require(_0x0750('0x2'));var jsonpatch=require(_0x0750('0x3'));var rp=require(_0x0750('0x4'));var moment=require(_0x0750('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0750('0x6'));var util=require(_0x0750('0x7'));var path=require(_0x0750('0x8'));var sox=require(_0x0750('0x9'));var csv=require(_0x0750('0xa'));var ejs=require(_0x0750('0xb'));var fs=require('fs');var _=require(_0x0750('0xc'));var squel=require(_0x0750('0xd'));var crypto=require(_0x0750('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0750('0xf'));var toCsv=require(_0x0750('0xa'));var querystring=require(_0x0750('0x10'));var Papa=require(_0x0750('0x11'));var Redis=require(_0x0750('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x0750('0x13'));var logger=require(_0x0750('0x14'))('api');var utils=require(_0x0750('0x15'));var config=require(_0x0750('0x16'));var db=require(_0x0750('0x17'))['db'];function respondWithStatusCode(_0x5648a6,_0x10c76e){_0x10c76e=_0x10c76e||0xcc;return function(_0x92203f){if(_0x92203f){return _0x5648a6['sendStatus'](_0x10c76e);}return _0x5648a6[_0x0750('0x18')](_0x10c76e)[_0x0750('0x19')]();};}function respondWithResult(_0x4d028f,_0x1b5a1c){_0x1b5a1c=_0x1b5a1c||0xc8;return function(_0x47de3a){if(_0x47de3a){return _0x4d028f['status'](_0x1b5a1c)[_0x0750('0x1a')](_0x47de3a);}};}function respondWithFilteredResult(_0x28762c,_0x70e2da){return function(_0x35a274){if(_0x35a274){var _0x2e8f8d=_0x35a274[_0x0750('0x1b')],_0xfbb1b1=_0x70e2da['offset'],_0x13bc83=_0x70e2da[_0x0750('0x1c')]+_0x70e2da[_0x0750('0x1d')],_0xf6cfe9;if(_0x13bc83>=_0x2e8f8d){_0x13bc83=_0x2e8f8d;_0xf6cfe9=0xc8;}else{_0xf6cfe9=0xce;}_0x28762c[_0x0750('0x18')](_0xf6cfe9);return _0x28762c[_0x0750('0x1e')](_0x0750('0x1f'),_0xfbb1b1+'-'+_0x13bc83+'/'+_0x2e8f8d)[_0x0750('0x1a')](_0x35a274);}return null;};}function patchUpdates(_0x2ea7f4){return function(_0x12a442){try{jsonpatch[_0x0750('0x20')](_0x12a442,_0x2ea7f4,!![]);}catch(_0x3a9443){return BPromise[_0x0750('0x21')](_0x3a9443);}return _0x12a442[_0x0750('0x22')]();};}function saveUpdates(_0xad412f,_0x4b473e){return function(_0x162636){if(_0x162636){return _0x162636[_0x0750('0x23')](_0xad412f)['then'](function(_0xa455d6){return _0xa455d6;});}return null;};}function removeEntity(_0x5f2e7b,_0x4e9647){return function(_0x5a4346){if(_0x5a4346){return _0x5a4346[_0x0750('0x24')]()[_0x0750('0x25')](function(){var _0x12af88=_0x5a4346[_0x0750('0x26')]({'plain':!![]});var _0x551a89=_0x0750('0x27');return db[_0x0750('0x28')][_0x0750('0x24')]({'where':{'type':_0x551a89,'resourceId':_0x12af88['id']}})['then'](function(){return _0x5a4346;});})[_0x0750('0x25')](function(){_0x5f2e7b['status'](0xcc)[_0x0750('0x19')]();});}};}function handleEntityNotFound(_0x28eb38,_0x28fe59){return function(_0x2f56d6){if(!_0x2f56d6){_0x28eb38[_0x0750('0x29')](0x194);}return _0x2f56d6;};}function handleError(_0xa011b4,_0x2b3dd1){_0x2b3dd1=_0x2b3dd1||0x1f4;return function(_0x1e6ffc){logger[_0x0750('0x2a')](_0x1e6ffc[_0x0750('0x2b')]);if(_0x1e6ffc['name']){delete _0x1e6ffc[_0x0750('0x2c')];}_0xa011b4[_0x0750('0x18')](_0x2b3dd1)[_0x0750('0x2d')](_0x1e6ffc);};}exports['index']=function(_0x5f2ef6,_0x3a868e){var _0x2d9dae={},_0x28cf0d={},_0x5f54e2={'count':0x0,'rows':[]};var _0x1d508a=db['CmCompany'][_0x0750('0x2e')];_0x28cf0d['model']=_[_0x0750('0x2f')](_0x1d508a);_0x28cf0d[_0x0750('0x30')]=_[_0x0750('0x2f')](_0x5f2ef6[_0x0750('0x30')]);_0x28cf0d['filters']=_[_0x0750('0x31')](_0x28cf0d[_0x0750('0x32')],_0x28cf0d[_0x0750('0x30')]);_0x2d9dae[_0x0750('0x33')]=_[_0x0750('0x31')](_0x28cf0d[_0x0750('0x32')],qs[_0x0750('0x34')](_0x5f2ef6[_0x0750('0x30')]['fields']));_0x2d9dae[_0x0750('0x33')]=_0x2d9dae[_0x0750('0x33')][_0x0750('0x35')]?_0x2d9dae['attributes']:_0x28cf0d[_0x0750('0x32')];if(!_0x5f2ef6[_0x0750('0x30')][_0x0750('0x36')](_0x0750('0x37'))){_0x2d9dae[_0x0750('0x1d')]=qs['limit'](_0x5f2ef6[_0x0750('0x30')][_0x0750('0x1d')]);_0x2d9dae[_0x0750('0x1c')]=qs[_0x0750('0x1c')](_0x5f2ef6['query']['offset']);}_0x2d9dae[_0x0750('0x38')]=qs[_0x0750('0x39')](_0x5f2ef6[_0x0750('0x30')]['sort']);_0x2d9dae[_0x0750('0x3a')]=qs[_0x0750('0x3b')](_[_0x0750('0x3c')](_0x5f2ef6['query'],_0x28cf0d[_0x0750('0x3b')]));if(_0x5f2ef6[_0x0750('0x30')]['filter']){_0x2d9dae[_0x0750('0x3a')]=_[_0x0750('0x3d')](_0x2d9dae[_0x0750('0x3a')],{'$or':_[_0x0750('0x3e')](_0x1d508a,function(_0x4b3acc){if(_0x4b3acc[_0x0750('0x3f')]['key']!=='VIRTUAL'){var _0x47540a={};_0x47540a[_0x4b3acc[_0x0750('0x40')]]={'$like':'%'+_0x5f2ef6['query'][_0x0750('0x41')]+'%'};return _0x47540a;}})});}_0x2d9dae=_[_0x0750('0x3d')]({},_0x2d9dae,_0x5f2ef6[_0x0750('0x42')]);var _0x545430={'where':_0x2d9dae[_0x0750('0x3a')]};return db[_0x0750('0x43')][_0x0750('0x1b')](_0x545430)['then'](function(_0x433b9e){_0x5f54e2[_0x0750('0x1b')]=_0x433b9e;if(_0x5f2ef6['query']['includeAll']){_0x2d9dae[_0x0750('0x44')]=[{'all':!![]}];}return db[_0x0750('0x43')][_0x0750('0x45')](_0x2d9dae);})[_0x0750('0x25')](function(_0x16d94b){_0x5f54e2[_0x0750('0x46')]=_0x16d94b;return _0x5f54e2;})[_0x0750('0x25')](respondWithFilteredResult(_0x3a868e,_0x2d9dae))[_0x0750('0x47')](handleError(_0x3a868e,null));};exports[_0x0750('0x48')]=function(_0x171205,_0x3114ad){var _0x3293f6={'raw':![],'where':{'id':_0x171205['params']['id']}},_0xd01187={};_0xd01187[_0x0750('0x32')]=_[_0x0750('0x2f')](db[_0x0750('0x43')][_0x0750('0x2e')]);_0xd01187[_0x0750('0x30')]=_['keys'](_0x171205[_0x0750('0x30')]);_0xd01187[_0x0750('0x3b')]=_[_0x0750('0x31')](_0xd01187[_0x0750('0x32')],_0xd01187[_0x0750('0x30')]);_0x3293f6[_0x0750('0x33')]=_[_0x0750('0x31')](_0xd01187[_0x0750('0x32')],qs[_0x0750('0x34')](_0x171205[_0x0750('0x30')][_0x0750('0x34')]));_0x3293f6[_0x0750('0x33')]=_0x3293f6[_0x0750('0x33')][_0x0750('0x35')]?_0x3293f6[_0x0750('0x33')]:_0xd01187[_0x0750('0x32')];if(_0x171205[_0x0750('0x30')][_0x0750('0x49')]){_0x3293f6[_0x0750('0x44')]=[{'all':!![]}];}_0x3293f6=_[_0x0750('0x3d')]({},_0x3293f6,_0x171205[_0x0750('0x42')]);return db['CmCompany'][_0x0750('0x4a')](_0x3293f6)['then'](handleEntityNotFound(_0x3114ad,null))[_0x0750('0x25')](respondWithResult(_0x3114ad,null))[_0x0750('0x47')](handleError(_0x3114ad,null));};exports['create']=function(_0x181a55,_0x75635){return db['CmCompany'][_0x0750('0x4b')](_0x181a55[_0x0750('0x4c')],{})['then'](function(_0x3206d4){var _0x20bbb3=_0x181a55[_0x0750('0x4d')][_0x0750('0x26')]({'plain':!![]});if(!_0x20bbb3)throw new Error(_0x0750('0x4e'));if(_0x20bbb3['role']==='user'){var _0x28e14b=_0x3206d4[_0x0750('0x26')]({'plain':!![]});var _0x46a6d3=_0x0750('0x27');return db[_0x0750('0x4f')][_0x0750('0x4a')]({'where':{'name':_0x46a6d3,'userProfileId':_0x20bbb3[_0x0750('0x50')]},'raw':!![]})[_0x0750('0x25')](function(_0xca74f5){if(_0xca74f5&&_0xca74f5[_0x0750('0x51')]===0x0){return db[_0x0750('0x28')][_0x0750('0x4b')]({'name':_0x28e14b['name'],'resourceId':_0x28e14b['id'],'type':_0xca74f5['name'],'sectionId':_0xca74f5['id']},{})[_0x0750('0x25')](function(){return _0x3206d4;});}else{return _0x3206d4;}})[_0x0750('0x47')](function(_0x4fdfa0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fdfa0);throw _0x4fdfa0;});}return _0x3206d4;})[_0x0750('0x25')](respondWithResult(_0x75635,0xc9))[_0x0750('0x47')](handleError(_0x75635,null));};exports[_0x0750('0x23')]=function(_0x22bdf,_0x2b0243){if(_0x22bdf[_0x0750('0x4c')]['id']){delete _0x22bdf[_0x0750('0x4c')]['id'];}return db[_0x0750('0x43')][_0x0750('0x4a')]({'where':{'id':_0x22bdf['params']['id']}})[_0x0750('0x25')](handleEntityNotFound(_0x2b0243,null))['then'](saveUpdates(_0x22bdf['body'],null))[_0x0750('0x25')](respondWithResult(_0x2b0243,null))[_0x0750('0x47')](handleError(_0x2b0243,null));};exports[_0x0750('0x24')]=function(_0x400054,_0x12cc4b){return db[_0x0750('0x43')][_0x0750('0x4a')]({'where':{'id':_0x400054[_0x0750('0x52')]['id']}})['then'](handleEntityNotFound(_0x12cc4b,null))[_0x0750('0x25')](removeEntity(_0x12cc4b,null))[_0x0750('0x47')](handleError(_0x12cc4b,null));};exports[_0x0750('0x53')]=function(_0x53cc16,_0x4a35b8,_0x47e645){return db[_0x0750('0x54')][_0x0750('0x4a')]({'where':{'id':_0x53cc16[_0x0750('0x52')]['id']}})[_0x0750('0x25')](handleEntityNotFound(_0x4a35b8,null))[_0x0750('0x25')](function(_0x4d8ee6){if(_0x4d8ee6){return _0x4d8ee6[_0x0750('0x53')](_0x53cc16['body'][_0x0750('0x55')],_[_0x0750('0x56')](_0x53cc16[_0x0750('0x4c')],['ids','id'])||{});}})[_0x0750('0x25')](respondWithResult(_0x4a35b8,null))[_0x0750('0x47')](handleError(_0x4a35b8,null));};exports[_0x0750('0x57')]=function(_0x3c7e37,_0xdc6170,_0xb74dfb){var _0x1198f9={};var _0x4b4c37={};var _0x5d5825;var _0x49698c;return db[_0x0750('0x43')][_0x0750('0x58')]({'where':{'id':_0x3c7e37[_0x0750('0x52')]['id']}})[_0x0750('0x25')](handleEntityNotFound(_0xdc6170,null))[_0x0750('0x25')](function(_0x29059c){if(_0x29059c){_0x5d5825=_0x29059c;_0x4b4c37[_0x0750('0x32')]=_[_0x0750('0x2f')](db[_0x0750('0x54')][_0x0750('0x2e')]);_0x4b4c37[_0x0750('0x30')]=_[_0x0750('0x2f')](_0x3c7e37['query']);_0x4b4c37['filters']=_[_0x0750('0x31')](_0x4b4c37[_0x0750('0x32')],_0x4b4c37[_0x0750('0x30')]);_0x1198f9[_0x0750('0x33')]=_[_0x0750('0x31')](_0x4b4c37[_0x0750('0x32')],qs[_0x0750('0x34')](_0x3c7e37['query'][_0x0750('0x34')]));_0x1198f9[_0x0750('0x33')]=_0x1198f9[_0x0750('0x33')]['length']?_0x1198f9[_0x0750('0x33')]:_0x4b4c37['model'];_0x1198f9['order']=qs[_0x0750('0x39')](_0x3c7e37['query'][_0x0750('0x39')]);_0x1198f9[_0x0750('0x3a')]=qs[_0x0750('0x3b')](_[_0x0750('0x3c')](_0x3c7e37['query'],_0x4b4c37[_0x0750('0x3b')]));if(_0x3c7e37['query']['filter']){_0x1198f9[_0x0750('0x3a')]=_[_0x0750('0x3d')](_0x1198f9['where'],{'$or':_['map'](_0x1198f9[_0x0750('0x33')],function(_0x24dd4b){var _0x26ebf1={};_0x26ebf1[_0x24dd4b]={'$like':'%'+_0x3c7e37[_0x0750('0x30')][_0x0750('0x41')]+'%'};return _0x26ebf1;})});}_0x1198f9=_[_0x0750('0x3d')]({},_0x1198f9,_0x3c7e37['options']);return _0x5d5825[_0x0750('0x57')](_0x1198f9);}})[_0x0750('0x25')](function(_0x17324b){if(_0x17324b){_0x49698c=_0x17324b[_0x0750('0x35')];if(!_0x3c7e37[_0x0750('0x30')][_0x0750('0x36')](_0x0750('0x37'))){_0x1198f9[_0x0750('0x1d')]=qs[_0x0750('0x1d')](_0x3c7e37['query']['limit']);_0x1198f9[_0x0750('0x1c')]=qs[_0x0750('0x1c')](_0x3c7e37['query'][_0x0750('0x1c')]);}return _0x5d5825[_0x0750('0x57')](_0x1198f9);}})['then'](function(_0x1e613c){if(_0x1e613c){return _0x1e613c?{'count':_0x49698c,'rows':_0x1e613c}:null;}})[_0x0750('0x25')](respondWithResult(_0xdc6170,null))[_0x0750('0x47')](handleError(_0xdc6170,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index ce7323a..03f7bf6 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 _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','cm_companies','lodash','../../config/logger'];(function(_0x2ade6c,_0x2d42f2){var _0x2cb372=function(_0x477d8a){while(--_0x477d8a){_0x2ade6c['push'](_0x2ade6c['shift']());}};_0x2cb372(++_0x2d42f2);}(_0xb10b,0x12a));var _0xbb10=function(_0x137556,_0x253216){_0x137556=_0x137556-0x0;var _0x41dc31=_0xb10b[_0x137556];return _0x41dc31;};'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')]('CmCompany',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x32b6=['moment','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','api'];(function(_0x146aaf,_0x18f80f){var _0x2c458f=function(_0x167cf6){while(--_0x167cf6){_0x146aaf['push'](_0x146aaf['shift']());}};_0x2c458f(++_0x18f80f);}(_0x32b6,0x1d1));var _0x632b=function(_0x2db12d,_0x42685c){_0x2db12d=_0x2db12d-0x0;var _0x1d994b=_0x32b6[_0x2db12d];return _0x1d994b;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var logger=require('../../config/logger')(_0x632b('0x2'));var moment=require(_0x632b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x632b('0x4'));var rimraf=require(_0x632b('0x5'));var config=require(_0x632b('0x6'));var attributes=require(_0x632b('0x7'));module[_0x632b('0x8')]=function(_0x122768,_0x24ceab){return _0x122768[_0x632b('0x9')](_0x632b('0xa'),attributes,{'tableName':_0x632b('0xb'),'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 85e9606..427cf52 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 _0xb1fa=['info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x38030e,_0x2f1fc9){var _0x4190a6=function(_0x381701){while(--_0x381701){_0x38030e['push'](_0x38030e['shift']());}};_0x4190a6(++_0x2f1fc9);}(_0xb1fa,0x106));var _0xab1f=function(_0x5bcaba,_0x1d7e55){_0x5bcaba=_0x5bcaba-0x0;var _0x14ddf7=_0xb1fa[_0x5bcaba];return _0x14ddf7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab1f('0x0'));var BPromise=require(_0xab1f('0x1'));var rs=require(_0xab1f('0x2'));var fs=require('fs');var Redis=require(_0xab1f('0x3'));var db=require(_0xab1f('0x4'))['db'];var utils=require(_0xab1f('0x5'));var logger=require(_0xab1f('0x6'))(_0xab1f('0x7'));var config=require(_0xab1f('0x8'));var jayson=require(_0xab1f('0x9'));var client=jayson[_0xab1f('0xa')][_0xab1f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x102235,_0x263765,_0x1bbda4){return new BPromise(function(_0x29aaaa,_0x10657a){return client[_0xab1f('0xc')](_0x102235,_0x1bbda4)[_0xab1f('0xd')](function(_0x34a34c){logger[_0xab1f('0xe')](_0xab1f('0xf'),_0x263765,_0xab1f('0x10'));logger[_0xab1f('0x11')](_0xab1f('0x12'),_0x263765,_0xab1f('0x10'),JSON['stringify'](_0x34a34c));if(_0x34a34c[_0xab1f('0x13')]){if(_0x34a34c['error'][_0xab1f('0x14')]===0x1f4){logger[_0xab1f('0x13')](_0xab1f('0xf'),_0x263765,_0x34a34c[_0xab1f('0x13')][_0xab1f('0x15')]);return _0x10657a(_0x34a34c[_0xab1f('0x13')][_0xab1f('0x15')]);}logger['error'](_0xab1f('0xf'),_0x263765,_0x34a34c['error']['message']);return _0x29aaaa(_0x34a34c[_0xab1f('0x13')][_0xab1f('0x15')]);}else{logger['info'](_0xab1f('0xf'),_0x263765,_0xab1f('0x10'));_0x29aaaa(_0x34a34c[_0xab1f('0x16')][_0xab1f('0x15')]);}})['catch'](function(_0xd16ee3){logger[_0xab1f('0x13')](_0xab1f('0xf'),_0x263765,_0xd16ee3);_0x10657a(_0xd16ee3);});});} \ No newline at end of file +var _0x3404=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x2c0be1,_0x1e88f2){var _0x3d4bd2=function(_0x2b5497){while(--_0x2b5497){_0x2c0be1['push'](_0x2c0be1['shift']());}};_0x3d4bd2(++_0x1e88f2);}(_0x3404,0xc9));var _0x4340=function(_0x486fd2,_0x6a25fd){_0x486fd2=_0x486fd2-0x0;var _0x485226=_0x3404[_0x486fd2];return _0x485226;};'use strict';var _=require(_0x4340('0x0'));var util=require(_0x4340('0x1'));var moment=require(_0x4340('0x2'));var BPromise=require('bluebird');var rs=require(_0x4340('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4340('0x4'))['db'];var utils=require(_0x4340('0x5'));var logger=require(_0x4340('0x6'))(_0x4340('0x7'));var config=require(_0x4340('0x8'));var jayson=require(_0x4340('0x9'));var client=jayson[_0x4340('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b8276,_0x5ef1f4,_0x177c44){return new BPromise(function(_0x5f3592,_0x5e543a){return client[_0x4340('0xb')](_0x1b8276,_0x177c44)[_0x4340('0xc')](function(_0x5c65ae){logger[_0x4340('0xd')](_0x4340('0xe'),_0x5ef1f4,_0x4340('0xf'));logger['debug'](_0x4340('0x10'),_0x5ef1f4,_0x4340('0xf'),JSON[_0x4340('0x11')](_0x5c65ae));if(_0x5c65ae[_0x4340('0x12')]){if(_0x5c65ae[_0x4340('0x12')][_0x4340('0x13')]===0x1f4){logger[_0x4340('0x12')](_0x4340('0xe'),_0x5ef1f4,_0x5c65ae['error']['message']);return _0x5e543a(_0x5c65ae[_0x4340('0x12')][_0x4340('0x14')]);}logger[_0x4340('0x12')](_0x4340('0xe'),_0x5ef1f4,_0x5c65ae[_0x4340('0x12')][_0x4340('0x14')]);return _0x5f3592(_0x5c65ae[_0x4340('0x12')][_0x4340('0x14')]);}else{logger['info'](_0x4340('0xe'),_0x5ef1f4,_0x4340('0xf'));_0x5f3592(_0x5c65ae[_0x4340('0x15')][_0x4340('0x14')]);}})[_0x4340('0x16')](function(_0x434fb5){logger['error'](_0x4340('0xe'),_0x5ef1f4,_0x434fb5);_0x5e543a(_0x434fb5);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index c3fb0bc..93e7701 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 _0xb05a=['put','/:id','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/contacts','getContacts','post','create','addContacts'];(function(_0x46b722,_0x5a2b07){var _0x268ea6=function(_0x214495){while(--_0x214495){_0x46b722['push'](_0x46b722['shift']());}};_0x268ea6(++_0x5a2b07);}(_0xb05a,0x17e));var _0xab05=function(_0x5c0dfb,_0x29fe5e){_0x5c0dfb=_0x5c0dfb-0x0;var _0x49be35=_0xb05a[_0x5c0dfb];return _0x49be35;};'use strict';var multer=require(_0xab05('0x0'));var util=require(_0xab05('0x1'));var path=require(_0xab05('0x2'));var timeout=require(_0xab05('0x3'));var express=require(_0xab05('0x4'));var router=express[_0xab05('0x5')]();var auth=require(_0xab05('0x6'));var interaction=require(_0xab05('0x7'));var config=require(_0xab05('0x8'));var controller=require('./cmCompany.controller');router[_0xab05('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xab05('0x9')]('/:id',auth[_0xab05('0xa')](),controller[_0xab05('0xb')]);router[_0xab05('0x9')](_0xab05('0xc'),auth[_0xab05('0xa')](),controller[_0xab05('0xd')]);router[_0xab05('0xe')]('/',auth[_0xab05('0xa')](),controller[_0xab05('0xf')]);router[_0xab05('0xe')](_0xab05('0xc'),auth[_0xab05('0xa')](),controller[_0xab05('0x10')]);router[_0xab05('0x11')](_0xab05('0x12'),auth[_0xab05('0xa')](),controller[_0xab05('0x13')]);router[_0xab05('0x14')]('/:id',auth[_0xab05('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xff25=['create','post','addContacts','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/:id','show','/:id/contacts','getContacts'];(function(_0x46d42a,_0x19150b){var _0x8ca9d4=function(_0x4cf60d){while(--_0x4cf60d){_0x46d42a['push'](_0x46d42a['shift']());}};_0x8ca9d4(++_0x19150b);}(_0xff25,0x1a0));var _0x5ff2=function(_0x44bbe1,_0x106c1f){_0x44bbe1=_0x44bbe1-0x0;var _0x23a60b=_0xff25[_0x44bbe1];return _0x23a60b;};'use strict';var multer=require(_0x5ff2('0x0'));var util=require(_0x5ff2('0x1'));var path=require('path');var timeout=require(_0x5ff2('0x2'));var express=require(_0x5ff2('0x3'));var router=express[_0x5ff2('0x4')]();var auth=require(_0x5ff2('0x5'));var interaction=require(_0x5ff2('0x6'));var config=require(_0x5ff2('0x7'));var controller=require(_0x5ff2('0x8'));router['get']('/',auth[_0x5ff2('0x9')](),controller[_0x5ff2('0xa')]);router[_0x5ff2('0xb')](_0x5ff2('0xc'),auth[_0x5ff2('0x9')](),controller[_0x5ff2('0xd')]);router[_0x5ff2('0xb')](_0x5ff2('0xe'),auth[_0x5ff2('0x9')](),controller[_0x5ff2('0xf')]);router['post']('/',auth[_0x5ff2('0x9')](),controller[_0x5ff2('0x10')]);router[_0x5ff2('0x11')](_0x5ff2('0xe'),auth['isAuthenticated'](),controller[_0x5ff2('0x12')]);router[_0x5ff2('0x13')](_0x5ff2('0xc'),auth[_0x5ff2('0x9')](),controller[_0x5ff2('0x14')]);router[_0x5ff2('0x15')](_0x5ff2('0xc'),auth['isAuthenticated'](),controller[_0x5ff2('0x16')]);module[_0x5ff2('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 0de2ec6..ca3d6b5 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 _0xe86c=['STRING','INTEGER','DATE','NOW','sequelize','exports'];(function(_0x5deb0a,_0xc192bb){var _0x33d0ce=function(_0x3f1aa8){while(--_0x3f1aa8){_0x5deb0a['push'](_0x5deb0a['shift']());}};_0x33d0ce(++_0xc192bb);}(_0xe86c,0x160));var _0xce86=function(_0x2c68c1,_0x40e654){_0x2c68c1=_0x2c68c1-0x0;var _0x103d16=_0xe86c[_0x2c68c1];return _0x103d16;};'use strict';var _=require('lodash');var Sequelize=require(_0xce86('0x0'));module[_0xce86('0x1')]={'firstName':{'type':Sequelize[_0xce86('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xce86('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xce86('0x2')]},'city':{'type':Sequelize[_0xce86('0x2')]},'country':{'type':Sequelize[_0xce86('0x2')]},'dateOfBirth':{'type':Sequelize[_0xce86('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xce86('0x2')]},'mobile':{'type':Sequelize[_0xce86('0x2')]},'fax':{'type':Sequelize[_0xce86('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xce86('0x2')]},'facebook':{'type':Sequelize[_0xce86('0x2')]},'fb_data':{'type':Sequelize[_0xce86('0x2')]},'twitter':{'type':Sequelize[_0xce86('0x2')]},'skype':{'type':Sequelize[_0xce86('0x2')]},'teams':{'type':Sequelize[_0xce86('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xce86('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xce86('0x2')]},'UserId':{'type':Sequelize[_0xce86('0x3')]},'priority':{'type':Sequelize[_0xce86('0x3')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xce86('0x4')],'defaultValue':Sequelize[_0xce86('0x5')]}}; \ No newline at end of file +var _0x040f=['lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x9d1e6b,_0x3bdc22){var _0x2b3070=function(_0x4c4ced){while(--_0x4c4ced){_0x9d1e6b['push'](_0x9d1e6b['shift']());}};_0x2b3070(++_0x3bdc22);}(_0x040f,0x1b8));var _0xf040=function(_0x124080,_0x57314e){_0x124080=_0x124080-0x0;var _0x43c903=_0x040f[_0x124080];return _0x43c903;};'use strict';var _=require(_0xf040('0x0'));var Sequelize=require(_0xf040('0x1'));module[_0xf040('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xf040('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf040('0x3')]},'country':{'type':Sequelize[_0xf040('0x3')]},'dateOfBirth':{'type':Sequelize[_0xf040('0x3')]},'description':{'type':Sequelize[_0xf040('0x4')]},'phone':{'type':Sequelize[_0xf040('0x3')]},'mobile':{'type':Sequelize[_0xf040('0x3')]},'fax':{'type':Sequelize[_0xf040('0x3')]},'email':{'type':Sequelize[_0xf040('0x3')]},'url':{'type':Sequelize[_0xf040('0x3')]},'facebook':{'type':Sequelize[_0xf040('0x3')]},'fb_data':{'type':Sequelize[_0xf040('0x3')]},'twitter':{'type':Sequelize[_0xf040('0x3')]},'skype':{'type':Sequelize[_0xf040('0x3')]},'teams':{'type':Sequelize[_0xf040('0x3')]},'viber':{'type':Sequelize[_0xf040('0x3')]},'line':{'type':Sequelize[_0xf040('0x3')]},'wechat':{'type':Sequelize[_0xf040('0x3')]},'telegram':{'type':Sequelize[_0xf040('0x3')]},'UserId':{'type':Sequelize[_0xf040('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xf040('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf040('0x7')],'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 45c168d..96ca7cb 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 _0x5b8a=['getHopperFinals','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','server/files/tmp','file','chmodSync','child_process','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','pid','send','upload','createReadStream','meta','User','agent','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','offset','limit','set','Content-Range','apply','save','update','then','stack','name','index','describe','keys','intersection','query','attributes','model','fields','length','hasOwnProperty','order','sort','where','filters','select','field','tools_tags','from','c.deletedAt\x20IS\x20NULL','expr','advancedFilter','condition','isArray','value','and','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','\x20LIKE\x20?','\x20<\x20?','map','filter','isNil','isEmpty','forEach','c.ListId\x20IN\x20?','concat','replace','\x27\x27\x27\x27','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','COUNT(*)','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','having','left_join','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','t.id\x20IN\x20?','toString','keyBy','sequelize','count','CmContact','TagIds','Tags','split','push','rows','find','params','catch','startsWith','cf_','columnName','findAll','displayName','alias','custom','type','values','body','get','mergeWith','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','destroy','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','each','duplicates','ListId','findOrCreate','error','show','Tag','$and','CmCustomField','omit','format','cf_%d','table','cm_contacts','setFields','id\x20=\x20?','text','phone','CmHopper','getTags','findOne','rawAttributes','pick','merge','options','nolimit','setTags','getHoppers','ContactId','includeAll','include'];(function(_0x1e7345,_0x18bcce){var _0x33017c=function(_0x2b274f){while(--_0x2b274f){_0x1e7345['push'](_0x1e7345['shift']());}};_0x33017c(++_0x18bcce);}(_0x5b8a,0xfe));var _0xa5b8=function(_0x5cb4a6,_0x3e5d56){_0x5cb4a6=_0x5cb4a6-0x0;var _0x4576b8=_0x5b8a[_0x5cb4a6];return _0x4576b8;};'use strict';var pdf=require(_0xa5b8('0x0'));var emlformat=require(_0xa5b8('0x1'));var rimraf=require(_0xa5b8('0x2'));var zipdir=require(_0xa5b8('0x3'));var jsonpatch=require(_0xa5b8('0x4'));var rp=require(_0xa5b8('0x5'));var moment=require(_0xa5b8('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xa5b8('0x7'));var util=require('util');var path=require(_0xa5b8('0x8'));var sox=require(_0xa5b8('0x9'));var csv=require(_0xa5b8('0xa'));var ejs=require(_0xa5b8('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa5b8('0xc'));var crypto=require('crypto');var jsforce=require(_0xa5b8('0xd'));var deskjs=require(_0xa5b8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa5b8('0xf'));var Papa=require(_0xa5b8('0x10'));var Redis=require(_0xa5b8('0x11'));var authService=require(_0xa5b8('0x12'));var qs=require(_0xa5b8('0x13'));var hardwareService=require(_0xa5b8('0x14'));var logger=require('../../config/logger')(_0xa5b8('0x15'));var utils=require(_0xa5b8('0x16'));var config=require(_0xa5b8('0x17'));var db=require(_0xa5b8('0x18'))['db'];config[_0xa5b8('0x19')]=_[_0xa5b8('0x1a')](config[_0xa5b8('0x19')],{'host':_0xa5b8('0x1b'),'port':0x18eb});var socket=require(_0xa5b8('0x1c'))(new Redis(config['redis']));require('./cmContact.socket')['register'](socket);function respondWithStatusCode(_0x27620a,_0x41e595){_0x41e595=_0x41e595||0xcc;return function(_0x1042d6){if(_0x1042d6){return _0x27620a[_0xa5b8('0x1d')](_0x41e595);}return _0x27620a[_0xa5b8('0x1e')](_0x41e595)['end']();};}function respondWithResult(_0x12cf9e,_0x24057c){_0x24057c=_0x24057c||0xc8;return function(_0x569a5c){if(_0x569a5c){return _0x12cf9e[_0xa5b8('0x1e')](_0x24057c)[_0xa5b8('0x1f')](_0x569a5c);}};}function respondWithFilteredResult(_0x4c139d,_0x4d345b){return function(_0xb267bc){if(_0xb267bc){var _0x376886=_0xb267bc['count'],_0x2a2135=_0x4d345b['offset'],_0xa71c3c=_0x4d345b[_0xa5b8('0x20')]+_0x4d345b[_0xa5b8('0x21')],_0x2ef885;if(_0xa71c3c>=_0x376886){_0xa71c3c=_0x376886;_0x2ef885=0xc8;}else{_0x2ef885=0xce;}_0x4c139d[_0xa5b8('0x1e')](_0x2ef885);return _0x4c139d[_0xa5b8('0x22')](_0xa5b8('0x23'),_0x2a2135+'-'+_0xa71c3c+'/'+_0x376886)[_0xa5b8('0x1f')](_0xb267bc);}return null;};}function patchUpdates(_0x185636){return function(_0x4dfaaf){try{jsonpatch[_0xa5b8('0x24')](_0x4dfaaf,_0x185636,!![]);}catch(_0x3b9918){return BPromise['reject'](_0x3b9918);}return _0x4dfaaf[_0xa5b8('0x25')]();};}function saveUpdates(_0x590084,_0x5490d7){return function(_0x111354){if(_0x111354){return _0x111354[_0xa5b8('0x26')](_0x590084)[_0xa5b8('0x27')](function(_0x3eb22c){return _0x3eb22c;});}return null;};}function removeEntity(_0x590e01,_0x32dc31){return function(_0x3893ac){if(_0x3893ac){return _0x3893ac['destroy']()['then'](function(){_0x590e01[_0xa5b8('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x487250,_0x5c9263){return function(_0xec2326){if(!_0xec2326){_0x487250[_0xa5b8('0x1d')](0x194);}return _0xec2326;};}function handleError(_0x583383,_0x4f6b82){_0x4f6b82=_0x4f6b82||0x1f4;return function(_0x4b8389){logger['error'](_0x4b8389[_0xa5b8('0x28')]);if(_0x4b8389[_0xa5b8('0x29')]){delete _0x4b8389[_0xa5b8('0x29')];}_0x583383[_0xa5b8('0x1e')](_0x4f6b82)['send'](_0x4b8389);};}exports[_0xa5b8('0x2a')]=function(_0x4aa9d6,_0x4a5298){var _0x5829b9={},_0x20007f={},_0x348cb6={'count':0x0,'rows':[]};return db['CmContact'][_0xa5b8('0x2b')]()[_0xa5b8('0x27')](function(_0x1bd38e){_0x20007f['model']=_[_0xa5b8('0x2c')](_0x1bd38e);_0x20007f['query']=_[_0xa5b8('0x2c')](_0x4aa9d6['query']);_0x20007f['filters']=_[_0xa5b8('0x2d')](_0x20007f['model'],_0x20007f[_0xa5b8('0x2e')]);_0x5829b9[_0xa5b8('0x2f')]=_['intersection'](_0x20007f[_0xa5b8('0x30')],qs[_0xa5b8('0x31')](_0x4aa9d6[_0xa5b8('0x2e')]['fields']));_0x5829b9['attributes']=_0x5829b9[_0xa5b8('0x2f')][_0xa5b8('0x32')]?_0x5829b9['attributes']:_0x20007f[_0xa5b8('0x30')];if(!_0x4aa9d6[_0xa5b8('0x2e')][_0xa5b8('0x33')]('nolimit')){_0x5829b9[_0xa5b8('0x21')]=qs[_0xa5b8('0x21')](_0x4aa9d6['query'][_0xa5b8('0x21')]);_0x5829b9['offset']=qs[_0xa5b8('0x20')](_0x4aa9d6[_0xa5b8('0x2e')][_0xa5b8('0x20')]);}_0x5829b9[_0xa5b8('0x34')]=qs[_0xa5b8('0x35')](_0x4aa9d6[_0xa5b8('0x2e')]['sort']);_0x5829b9[_0xa5b8('0x36')]=qs[_0xa5b8('0x37')](_['pick'](_0x4aa9d6['query'],_0x20007f[_0xa5b8('0x37')]));var _0x1c1a6a=[];var _0x386039=squel[_0xa5b8('0x38')]()['field']('id')[_0xa5b8('0x39')](_0xa5b8('0x29'))[_0xa5b8('0x39')]('color')['from'](_0xa5b8('0x3a'));var _0x5f33bc=squel[_0xa5b8('0x38')]()[_0xa5b8('0x3b')]('cm_contacts','c')['where'](_0xa5b8('0x3c'));var _0x6fa41d=squel[_0xa5b8('0x3d')]();if(_0x4aa9d6[_0xa5b8('0x2e')][_0xa5b8('0x3e')]){var _0xd84cb8=JSON['parse'](_0x4aa9d6['query'][_0xa5b8('0x3e')]);_[_0xa5b8('0x2c')](_0xd84cb8)['forEach'](function(_0x10643e){var _0xa0164c=_0xd84cb8[_0x10643e];switch(_0xa0164c[_0xa5b8('0x3f')]){case'IS':if(_[_0xa5b8('0x40')](_0xa0164c[_0xa5b8('0x41')])&&_0xa0164c['value'][_0xa5b8('0x32')]>0x1){_0x6fa41d[_0xa5b8('0x42')](_0xa0164c[_0xa5b8('0x43')]+'.'+_0x10643e+_0xa5b8('0x44'),_0xa0164c[_0xa5b8('0x41')]);}else{_0x6fa41d['and'](_0xa0164c[_0xa5b8('0x43')]+'.'+_0x10643e+_0xa5b8('0x45'),_0xa0164c[_0xa5b8('0x41')][0x0]);}break;case'=':_0x6fa41d['and'](_0xa0164c[_0xa5b8('0x43')]+'.'+_0x10643e+_0xa5b8('0x45'),_0xa0164c[_0xa5b8('0x41')]);break;case _0xa5b8('0x46'):_0x6fa41d['and'](_0xa0164c[_0xa5b8('0x43')]+'.'+_0x10643e+_0xa5b8('0x47'),'%'+_0xa0164c[_0xa5b8('0x41')]+'%');break;case'>':_0x6fa41d[_0xa5b8('0x42')](_0xa0164c[_0xa5b8('0x43')]+'.'+_0x10643e+'\x20>\x20?',_0xa0164c[_0xa5b8('0x41')]);break;case'<':_0x6fa41d['and'](_0xa0164c[_0xa5b8('0x43')]+'.'+_0x10643e+_0xa5b8('0x48'),_0xa0164c[_0xa5b8('0x41')]);break;}});}else{var _0x16de9f=_(Object['keys'](_0x4aa9d6[_0xa5b8('0x2e')]))[_0xa5b8('0x49')](function(_0x26a9c6){return _0x1bd38e['hasOwnProperty'](_0x26a9c6)?_0x26a9c6:undefined;})[_0xa5b8('0x4a')](function(_0x216bdc){return!_[_0xa5b8('0x4b')](_0x216bdc);})[_0xa5b8('0x41')]();if(!_[_0xa5b8('0x4c')](_0x16de9f)){_0x16de9f[_0xa5b8('0x4d')](function(_0x4b2a04){if(_0x4b2a04==='ListId'){_0x5f33bc[_0xa5b8('0x36')](_0xa5b8('0x4e'),[][_0xa5b8('0x4f')](_0x4aa9d6[_0xa5b8('0x2e')][_0x4b2a04]));}else{_0x5f33bc[_0xa5b8('0x36')]('c.'+_0x4b2a04+_0xa5b8('0x45'),_0x4aa9d6[_0xa5b8('0x2e')][_0x4b2a04]);}});}if(_0x4aa9d6[_0xa5b8('0x2e')]['filter']){var _0x587298=_0x4aa9d6['query'][_0xa5b8('0x4a')][_0xa5b8('0x50')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xa5b8('0x51'));if(qs[_0xa5b8('0x52')](_0x587298)){_0x6fa41d['or'](_0xa5b8('0x53'),_0x587298+'%');_0x6fa41d['or'](_0xa5b8('0x54'),_0x587298+'%');_0x6fa41d['or'](_0xa5b8('0x55'),_0x587298+'%');_0x6fa41d['or']('c.fax\x20LIKE\x20?',_0x587298+'%');}else if(qs[_0xa5b8('0x56')](_0x587298)){_0x6fa41d['or'](_0xa5b8('0x57'),_0x587298+'%');}else{_0x6fa41d['or'](_0xa5b8('0x57'),_0x587298+'%');_0x6fa41d['or'](_0xa5b8('0x58'),_0x587298+'%');_0x6fa41d['or'](_0xa5b8('0x59'),_0x587298+'%');}}}_0x5f33bc[_0xa5b8('0x36')](_0x6fa41d);if(_0x5829b9['order']){_0x5829b9[_0xa5b8('0x34')]['forEach'](function(_0x18dc15){_0x5f33bc[_0xa5b8('0x34')]('c.'+_0x18dc15[0x0],_0x18dc15[0x1]==='DESC'?![]:!![]);});}_0x5f33bc[_0xa5b8('0x5a')](_0xa5b8('0x5b'));var _0x4b4e5b={'type':db[_0xa5b8('0x5c')][_0xa5b8('0x5d')][_0xa5b8('0x5e')],'raw':!![]};var _0x1a5f06=_0x5f33bc['clone']()['field'](_0xa5b8('0x5f'));if(!_0x4aa9d6[_0xa5b8('0x2e')][_0xa5b8('0x3e')]){if(_0x4aa9d6[_0xa5b8('0x2e')][_0xa5b8('0x60')]){var _0x479aea=_[_0xa5b8('0x40')](_0x4aa9d6[_0xa5b8('0x2e')][_0xa5b8('0x60')])?_0x4aa9d6[_0xa5b8('0x2e')][_0xa5b8('0x60')]:new Array(_0x4aa9d6['query']['tag']);var _0x41e49b=squel[_0xa5b8('0x3d')]();_0x479aea[_0xa5b8('0x4d')](function(_0x3c13fb){_0x41e49b['or'](_0xa5b8('0x61'),'%,'+_0x3c13fb+',%');});_0x5f33bc[_0xa5b8('0x62')](_0x41e49b);_0x1a5f06[_0xa5b8('0x63')]('cm_contact_has_tags','ct',_0xa5b8('0x64'));_0x1a5f06[_0xa5b8('0x63')](_0xa5b8('0x3a'),'t',_0xa5b8('0x65'));_0x1a5f06[_0xa5b8('0x36')](_0xa5b8('0x66'),_0x479aea);}}db['sequelize']['query'](_0x386039[_0xa5b8('0x67')](),_0x4b4e5b)[_0xa5b8('0x27')](function(_0x5b5fea){_0x1c1a6a=_[_0xa5b8('0x68')](_0x5b5fea,'id');return db[_0xa5b8('0x69')][_0xa5b8('0x2e')](_0x1a5f06[_0xa5b8('0x67')](),_0x4b4e5b);})[_0xa5b8('0x27')](function(_0xb34929){_0x348cb6[_0xa5b8('0x6a')]=_0xb34929['length'];_0x4b4e5b=_['merge'](_0x4b4e5b,{'model':db[_0xa5b8('0x6b')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x5f33bc[_0xa5b8('0x39')]('c.*');_0x5f33bc['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0xa5b8('0x6c'));_0x5f33bc[_0xa5b8('0x63')]('cm_contact_has_tags','ct',_0xa5b8('0x64'));_0x5f33bc[_0xa5b8('0x63')](_0xa5b8('0x3a'),'t',_0xa5b8('0x65'));if(_0x5829b9['limit']){_0x5f33bc['limit'](_0x5829b9[_0xa5b8('0x21')]);}if(_0x5829b9[_0xa5b8('0x20')]){_0x5f33bc[_0xa5b8('0x20')](_0x5829b9[_0xa5b8('0x20')]);}db[_0xa5b8('0x69')][_0xa5b8('0x2e')](_0x5f33bc[_0xa5b8('0x67')](),_0x4b4e5b)[_0xa5b8('0x27')](function(_0x45dc30){_0x45dc30[_0xa5b8('0x4d')](function(_0x4e155e){if(_0x4e155e['TagIds']){_0x4e155e[_0xa5b8('0x6d')]=[];_0x4e155e['TagIds'][_0xa5b8('0x6e')](',')['forEach'](function(_0x2e0678){_0x4e155e['Tags'][_0xa5b8('0x6f')](_0x1c1a6a[_0x2e0678]);});}delete _0x4e155e[_0xa5b8('0x6c')];});_0x348cb6[_0xa5b8('0x70')]=_0x45dc30;return _0x348cb6;})[_0xa5b8('0x27')](respondWithFilteredResult(_0x4a5298,_0x5829b9))['catch'](handleError(_0x4a5298,null));});});};exports['destroy']=function(_0x37798b,_0x35ed7c){return db[_0xa5b8('0x6b')][_0xa5b8('0x71')]({'where':{'id':_0x37798b[_0xa5b8('0x72')]['id']}})[_0xa5b8('0x27')](handleEntityNotFound(_0x35ed7c,null))[_0xa5b8('0x27')](removeEntity(_0x35ed7c,null))[_0xa5b8('0x73')](handleError(_0x35ed7c,null));};exports['describe']=function(_0x5016f1,_0x8fc9ba){return db[_0xa5b8('0x6b')]['describe']()[_0xa5b8('0x27')](function(_0x478a64){for(var _0x3798a5=0x0;_0x3798a5=_0x494dc9){_0x3f01ea=_0x494dc9;_0x1277f4=0xc8;}else{_0x1277f4=0xce;}_0x4d73f3['status'](_0x1277f4);return _0x4d73f3[_0x0df2('0x25')]('Content-Range',_0x9118ef+'-'+_0x3f01ea+'/'+_0x494dc9)[_0x0df2('0x21')](_0xa0cbe7);}return null;};}function patchUpdates(_0x50c13b){return function(_0x5f127b){try{jsonpatch[_0x0df2('0x26')](_0x5f127b,_0x50c13b,!![]);}catch(_0x291017){return BPromise[_0x0df2('0x27')](_0x291017);}return _0x5f127b['save']();};}function saveUpdates(_0x23f43f,_0x4fc1b4){return function(_0x3bc61a){if(_0x3bc61a){return _0x3bc61a[_0x0df2('0x28')](_0x23f43f)[_0x0df2('0x29')](function(_0x419330){return _0x419330;});}return null;};}function removeEntity(_0x1e170b,_0x1e231f){return function(_0x24290c){if(_0x24290c){return _0x24290c[_0x0df2('0x2a')]()[_0x0df2('0x29')](function(){_0x1e170b[_0x0df2('0x20')](0xcc)[_0x0df2('0x1f')]();});}};}function handleEntityNotFound(_0x55bc53,_0x48cb6c){return function(_0x230d25){if(!_0x230d25){_0x55bc53[_0x0df2('0x1e')](0x194);}return _0x230d25;};}function handleError(_0x387e40,_0x1132c8){_0x1132c8=_0x1132c8||0x1f4;return function(_0x1fbacc){logger['error'](_0x1fbacc[_0x0df2('0x2b')]);if(_0x1fbacc[_0x0df2('0x2c')]){delete _0x1fbacc[_0x0df2('0x2c')];}_0x387e40[_0x0df2('0x20')](_0x1132c8)[_0x0df2('0x2d')](_0x1fbacc);};}exports[_0x0df2('0x2e')]=function(_0x35b16e,_0x505274){var _0x2c69db={},_0x4086fb={},_0x35f792={'count':0x0,'rows':[]};return db['CmContact'][_0x0df2('0x2f')]()[_0x0df2('0x29')](function(_0x19ea9b){_0x4086fb['model']=_[_0x0df2('0x30')](_0x19ea9b);_0x4086fb[_0x0df2('0x31')]=_[_0x0df2('0x30')](_0x35b16e[_0x0df2('0x31')]);_0x4086fb[_0x0df2('0x32')]=_[_0x0df2('0x33')](_0x4086fb[_0x0df2('0x34')],_0x4086fb[_0x0df2('0x31')]);_0x2c69db[_0x0df2('0x35')]=_[_0x0df2('0x33')](_0x4086fb[_0x0df2('0x34')],qs['fields'](_0x35b16e[_0x0df2('0x31')][_0x0df2('0x36')]));_0x2c69db[_0x0df2('0x35')]=_0x2c69db[_0x0df2('0x35')]['length']?_0x2c69db[_0x0df2('0x35')]:_0x4086fb[_0x0df2('0x34')];if(!_0x35b16e[_0x0df2('0x31')]['hasOwnProperty'](_0x0df2('0x37'))){_0x2c69db[_0x0df2('0x24')]=qs['limit'](_0x35b16e[_0x0df2('0x31')][_0x0df2('0x24')]);_0x2c69db[_0x0df2('0x23')]=qs[_0x0df2('0x23')](_0x35b16e[_0x0df2('0x31')][_0x0df2('0x23')]);}_0x2c69db[_0x0df2('0x38')]=qs[_0x0df2('0x39')](_0x35b16e[_0x0df2('0x31')][_0x0df2('0x39')]);_0x2c69db[_0x0df2('0x3a')]=qs[_0x0df2('0x32')](_[_0x0df2('0x3b')](_0x35b16e[_0x0df2('0x31')],_0x4086fb['filters']));var _0x1bc0bb=[];var _0x287a8f=squel['select']()[_0x0df2('0x3c')]('id')[_0x0df2('0x3c')](_0x0df2('0x2c'))['field'](_0x0df2('0x3d'))['from']('tools_tags');var _0x1ebd3c=squel['select']()['from'](_0x0df2('0x3e'),'c')[_0x0df2('0x3a')](_0x0df2('0x3f'));var _0xa1976a=squel[_0x0df2('0x40')]();if(_0x35b16e[_0x0df2('0x31')]['advancedFilter']){var _0x37ea4a=JSON[_0x0df2('0x41')](_0x35b16e[_0x0df2('0x31')]['advancedFilter']);_[_0x0df2('0x30')](_0x37ea4a)[_0x0df2('0x42')](function(_0x23604c){var _0x2f3236=_0x37ea4a[_0x23604c];switch(_0x2f3236[_0x0df2('0x43')]){case'IS':if(_['isArray'](_0x2f3236[_0x0df2('0x44')])&&_0x2f3236[_0x0df2('0x44')][_0x0df2('0x45')]>0x1){_0xa1976a[_0x0df2('0x46')](_0x2f3236['tableAlias']+'.'+_0x23604c+_0x0df2('0x47'),_0x2f3236['value']);}else{_0xa1976a['and'](_0x2f3236[_0x0df2('0x48')]+'.'+_0x23604c+'\x20=\x20?',_0x2f3236[_0x0df2('0x44')][0x0]);}break;case'=':_0xa1976a[_0x0df2('0x46')](_0x2f3236[_0x0df2('0x48')]+'.'+_0x23604c+_0x0df2('0x49'),_0x2f3236[_0x0df2('0x44')]);break;case _0x0df2('0x4a'):_0xa1976a[_0x0df2('0x46')](_0x2f3236['tableAlias']+'.'+_0x23604c+'\x20LIKE\x20?','%'+_0x2f3236[_0x0df2('0x44')]+'%');break;case'>':_0xa1976a[_0x0df2('0x46')](_0x2f3236[_0x0df2('0x48')]+'.'+_0x23604c+'\x20>\x20?',_0x2f3236[_0x0df2('0x44')]);break;case'<':_0xa1976a['and'](_0x2f3236['tableAlias']+'.'+_0x23604c+_0x0df2('0x4b'),_0x2f3236['value']);break;}});}else{var _0x54c349=_(Object[_0x0df2('0x30')](_0x35b16e[_0x0df2('0x31')]))[_0x0df2('0x4c')](function(_0x23065c){return _0x19ea9b['hasOwnProperty'](_0x23065c)?_0x23065c:undefined;})['filter'](function(_0x54e9c1){return!_['isNil'](_0x54e9c1);})[_0x0df2('0x44')]();if(!_['isEmpty'](_0x54c349)){_0x54c349[_0x0df2('0x42')](function(_0x2f88c9){if(_0x2f88c9==='ListId'){_0x1ebd3c[_0x0df2('0x3a')]('c.ListId\x20IN\x20?',[]['concat'](_0x35b16e[_0x0df2('0x31')][_0x2f88c9]));}else{_0x1ebd3c[_0x0df2('0x3a')]('c.'+_0x2f88c9+_0x0df2('0x49'),_0x35b16e['query'][_0x2f88c9]);}});}if(_0x35b16e[_0x0df2('0x31')][_0x0df2('0x4d')]){var _0x4bc4ee=_0x35b16e[_0x0df2('0x31')][_0x0df2('0x4d')]['replace']('\x5c','\x5c\x5c')[_0x0df2('0x4e')]('\x27\x27',_0x0df2('0x4f'));if(qs[_0x0df2('0x50')](_0x4bc4ee)){_0xa1976a['or'](_0x0df2('0x51'),_0x4bc4ee+'%');_0xa1976a['or'](_0x0df2('0x52'),_0x4bc4ee+'%');_0xa1976a['or'](_0x0df2('0x53'),_0x4bc4ee+'%');_0xa1976a['or']('c.fax\x20LIKE\x20?',_0x4bc4ee+'%');}else if(qs[_0x0df2('0x54')](_0x4bc4ee)){_0xa1976a['or']('c.email\x20LIKE\x20?',_0x4bc4ee+'%');}else{_0xa1976a['or']('c.email\x20LIKE\x20?',_0x4bc4ee+'%');_0xa1976a['or'](_0x0df2('0x55'),_0x4bc4ee+'%');_0xa1976a['or']('c.lastName\x20LIKE\x20?',_0x4bc4ee+'%');}}}_0x1ebd3c['where'](_0xa1976a);if(_0x2c69db[_0x0df2('0x38')]){_0x2c69db[_0x0df2('0x38')][_0x0df2('0x42')](function(_0x475e41){_0x1ebd3c[_0x0df2('0x38')]('c.'+_0x475e41[0x0],_0x475e41[0x1]==='DESC'?![]:!![]);});}_0x1ebd3c[_0x0df2('0x56')](_0x0df2('0x57'));var _0x2b4123={'type':db[_0x0df2('0x58')][_0x0df2('0x59')][_0x0df2('0x5a')],'raw':!![]};var _0x4db655=_0x1ebd3c[_0x0df2('0x5b')]()[_0x0df2('0x3c')](_0x0df2('0x5c'));if(!_0x35b16e[_0x0df2('0x31')][_0x0df2('0x5d')]){if(_0x35b16e['query'][_0x0df2('0x5e')]){var _0x27a3ea=_['isArray'](_0x35b16e[_0x0df2('0x31')][_0x0df2('0x5e')])?_0x35b16e[_0x0df2('0x31')]['tag']:new Array(_0x35b16e[_0x0df2('0x31')][_0x0df2('0x5e')]);var _0x8b304c=squel['expr']();_0x27a3ea[_0x0df2('0x42')](function(_0x1dd2de){_0x8b304c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1dd2de+',%');});_0x1ebd3c[_0x0df2('0x5f')](_0x8b304c);_0x4db655[_0x0df2('0x60')]('cm_contact_has_tags','ct',_0x0df2('0x61'));_0x4db655['left_join']('tools_tags','t',_0x0df2('0x62'));_0x4db655[_0x0df2('0x3a')](_0x0df2('0x63'),_0x27a3ea);}}db[_0x0df2('0x64')]['query'](_0x287a8f[_0x0df2('0x65')](),_0x2b4123)[_0x0df2('0x29')](function(_0x5b5fc4){_0x1bc0bb=_['keyBy'](_0x5b5fc4,'id');return db[_0x0df2('0x64')][_0x0df2('0x31')](_0x4db655[_0x0df2('0x65')](),_0x2b4123);})[_0x0df2('0x29')](function(_0x6724e6){_0x35f792[_0x0df2('0x22')]=_0x6724e6[_0x0df2('0x45')];_0x2b4123=_['merge'](_0x2b4123,{'model':db[_0x0df2('0x66')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x1ebd3c[_0x0df2('0x3c')](_0x0df2('0x67'));_0x1ebd3c[_0x0df2('0x3c')](_0x0df2('0x68'),'TagIds');_0x1ebd3c[_0x0df2('0x60')]('cm_contact_has_tags','ct',_0x0df2('0x61'));_0x1ebd3c['left_join']('tools_tags','t',_0x0df2('0x62'));if(_0x2c69db[_0x0df2('0x24')]){_0x1ebd3c[_0x0df2('0x24')](_0x2c69db[_0x0df2('0x24')]);}if(_0x2c69db[_0x0df2('0x23')]){_0x1ebd3c[_0x0df2('0x23')](_0x2c69db[_0x0df2('0x23')]);}db['sequelize'][_0x0df2('0x31')](_0x1ebd3c[_0x0df2('0x65')](),_0x2b4123)[_0x0df2('0x29')](function(_0x954cb3){_0x954cb3[_0x0df2('0x42')](function(_0x41b0d9){if(_0x41b0d9[_0x0df2('0x69')]){_0x41b0d9[_0x0df2('0x6a')]=[];_0x41b0d9[_0x0df2('0x69')][_0x0df2('0x6b')](',')[_0x0df2('0x42')](function(_0x3e5790){_0x41b0d9[_0x0df2('0x6a')][_0x0df2('0x6c')](_0x1bc0bb[_0x3e5790]);});}delete _0x41b0d9[_0x0df2('0x69')];});_0x35f792[_0x0df2('0x6d')]=_0x954cb3;return _0x35f792;})[_0x0df2('0x29')](respondWithFilteredResult(_0x505274,_0x2c69db))['catch'](handleError(_0x505274,null));});});};exports[_0x0df2('0x2a')]=function(_0x3468c6,_0x4e9ac6){return db[_0x0df2('0x66')][_0x0df2('0x6e')]({'where':{'id':_0x3468c6[_0x0df2('0x6f')]['id']}})[_0x0df2('0x29')](handleEntityNotFound(_0x4e9ac6,null))[_0x0df2('0x29')](removeEntity(_0x4e9ac6,null))['catch'](handleError(_0x4e9ac6,null));};exports[_0x0df2('0x2f')]=function(_0x483e6d,_0x4b85cb){return db[_0x0df2('0x66')][_0x0df2('0x2f')]()['then'](function(_0x25a1ec){for(var _0x1c2a7c=0x0;_0x1c2a7c{}\s\\|]/g,'-');_0x642706(null,util[_0x7098('0x1e')](_0x7098('0x1f'),path[_0x7098('0x20')](_0x1f22ce[_0x7098('0x1d')],path['extname'](_0x1f22ce['originalname'])),Date[_0x7098('0x21')](),path[_0x7098('0x22')](_0x1f22ce[_0x7098('0x1d')])));}})});router[_0x7098('0x18')](_0x7098('0x23'),upload['single']('file'),controller['uploadCsv']);var upload=multer({'storage':multer[_0x7098('0x1a')]({'destination':function(_0xf34c39,_0x5cd70a,_0xefb486){_0xefb486(null,path[_0x7098('0x1b')](config['root'],_0x7098('0x1c')));},'filename':function(_0x5ecf6e,_0xf7aea3,_0x58d957){_0xf7aea3[_0x7098('0x1d')]=_0xf7aea3[_0x7098('0x1d')][_0x7098('0x24')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x58d957(null,util[_0x7098('0x1e')](_0x7098('0x1f'),path['basename'](_0xf7aea3[_0x7098('0x1d')],path['extname'](_0xf7aea3['originalname'])),Date[_0x7098('0x21')](),path['extname'](_0xf7aea3['originalname'])));}})});router[_0x7098('0x18')]('/upload',upload[_0x7098('0x25')](_0x7098('0x26')),controller[_0x7098('0x27')]);router[_0x7098('0x18')](_0x7098('0x28'),auth['isAuthenticated'](),controller['import']);router['put'](_0x7098('0x29'),auth[_0x7098('0x8')](),controller[_0x7098('0x2a')]);router['delete'](_0x7098('0x29'),auth[_0x7098('0x8')](),controller[_0x7098('0x2b')]);module[_0x7098('0x2c')]=router; \ No newline at end of file +var _0x6382=['../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','/:id/tags','getTags','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','post','/merge','create','/create_many','bulkCreate','diskStorage','root','server/files/tmp','originalname','replace','%s-%s%s','basename','extname','/csv','single','file','uploadCsv','format','now','/upload/:id','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6382,0xd0));var _0x2638=function(_0x38a9ce,_0x1f4fbb){_0x38a9ce=_0x38a9ce-0x0;var _0x23bb4b=_0x6382[_0x38a9ce];return _0x23bb4b;};'use strict';var multer=require(_0x2638('0x0'));var util=require(_0x2638('0x1'));var path=require(_0x2638('0x2'));var timeout=require(_0x2638('0x3'));var express=require(_0x2638('0x4'));var router=express[_0x2638('0x5')]();var auth=require(_0x2638('0x6'));var interaction=require(_0x2638('0x7'));var config=require(_0x2638('0x8'));var controller=require('./cmContact.controller');router[_0x2638('0x9')]('/',auth[_0x2638('0xa')](),controller['index']);router[_0x2638('0x9')]('/describe',auth[_0x2638('0xa')](),controller[_0x2638('0xb')]);router[_0x2638('0x9')](_0x2638('0xc'),auth[_0x2638('0xa')](),controller['show']);router['get'](_0x2638('0xd'),auth[_0x2638('0xa')](),controller[_0x2638('0xe')]);router[_0x2638('0x9')]('/:id/hoppers',auth[_0x2638('0xa')](),controller[_0x2638('0xf')]);router[_0x2638('0x9')](_0x2638('0x10'),auth[_0x2638('0xa')](),controller[_0x2638('0x11')]);router[_0x2638('0x9')](_0x2638('0x12'),auth[_0x2638('0xa')](),controller['getHopperFinals']);router['get']('/:id/jscripty_sessions',auth[_0x2638('0xa')](),controller['getJscriptySessions']);router[_0x2638('0x13')](_0x2638('0x14'),auth[_0x2638('0xa')](),controller['merge']);router[_0x2638('0x13')]('/',auth[_0x2638('0xa')](),controller[_0x2638('0x15')]);router[_0x2638('0x13')](_0x2638('0x16'),auth['isAuthenticated'](),controller[_0x2638('0x17')]);router['post']('/:id/tags',auth[_0x2638('0xa')](),controller['setTags']);var upload=multer({'storage':multer[_0x2638('0x18')]({'destination':function(_0x47fdb1,_0x4f17f5,_0xdb4c97){_0xdb4c97(null,path['join'](config[_0x2638('0x19')],_0x2638('0x1a')));},'filename':function(_0x38ef0b,_0x5696eb,_0x3c84de){_0x5696eb[_0x2638('0x1b')]=_0x5696eb[_0x2638('0x1b')][_0x2638('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3c84de(null,util['format'](_0x2638('0x1d'),path[_0x2638('0x1e')](_0x5696eb[_0x2638('0x1b')],path[_0x2638('0x1f')](_0x5696eb[_0x2638('0x1b')])),Date['now'](),path[_0x2638('0x1f')](_0x5696eb[_0x2638('0x1b')])));}})});router[_0x2638('0x13')](_0x2638('0x20'),upload[_0x2638('0x21')](_0x2638('0x22')),controller[_0x2638('0x23')]);var upload=multer({'storage':multer[_0x2638('0x18')]({'destination':function(_0x25877a,_0x699890,_0x30c5b8){_0x30c5b8(null,path['join'](config['root'],'server/files/tmp'));},'filename':function(_0x5898f7,_0x584131,_0x179dd0){_0x584131['originalname']=_0x584131[_0x2638('0x1b')][_0x2638('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x179dd0(null,util[_0x2638('0x24')](_0x2638('0x1d'),path[_0x2638('0x1e')](_0x584131[_0x2638('0x1b')],path['extname'](_0x584131[_0x2638('0x1b')])),Date[_0x2638('0x25')](),path[_0x2638('0x1f')](_0x584131['originalname'])));}})});router[_0x2638('0x13')]('/upload',upload['single'](_0x2638('0x22')),controller['upload']);router[_0x2638('0x13')](_0x2638('0x26'),auth['isAuthenticated'](),controller['import']);router[_0x2638('0x27')](_0x2638('0xc'),auth[_0x2638('0xa')](),controller[_0x2638('0x28')]);router[_0x2638('0x29')](_0x2638('0xc'),auth['isAuthenticated'](),controller[_0x2638('0x2a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 36d279d..15f176d 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 _0x8243=['lodash','exports','VIRTUAL','getDataValue','alias','STRING','name','TEXT','long','type','select','values','isArray','setDataValue','stringify','sequelize'];(function(_0x55c00d,_0x520cb6){var _0x254a8f=function(_0x2b3378){while(--_0x2b3378){_0x55c00d['push'](_0x55c00d['shift']());}};_0x254a8f(++_0x520cb6);}(_0x8243,0xef));var _0x3824=function(_0x1af91d,_0x5bb76c){_0x1af91d=_0x1af91d-0x0;var _0x4c27ce=_0x8243[_0x1af91d];return _0x4c27ce;};'use strict';var Sequelize=require(_0x3824('0x0'));var _=require(_0x3824('0x1'));module[_0x3824('0x2')]={'name':{'type':Sequelize[_0x3824('0x3')],'get':function(_0x4710f1){return this[_0x3824('0x4')](_0x3824('0x5'));}},'alias':{'type':Sequelize[_0x3824('0x6')],'allowNull':![],'set':function(_0x3e3b87){this['setDataValue'](_0x3824('0x5'),_0x3e3b87?_0x3e3b87:this[_0x3824('0x4')](_0x3824('0x7')));}},'type':{'type':Sequelize[_0x3824('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x3824('0x8')](_0x3824('0x9')),'get':function(){if(this['getDataValue'](_0x3824('0xa'))===_0x3824('0xb')){return JSON['parse'](this[_0x3824('0x4')](_0x3824('0xc')));}else{return this[_0x3824('0x4')](_0x3824('0xc'));}},'set':function(_0x4ce7d3){if(Array[_0x3824('0xd')](_0x4ce7d3)){this[_0x3824('0xe')]('values',JSON[_0x3824('0xf')](_0x4ce7d3));}else{this[_0x3824('0xe')](_0x3824('0xc'),_0x4ce7d3);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x6bcd=['TEXT','long','type','select','parse','values','isArray','stringify','BOOLEAN','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','setDataValue','name','STRING'];(function(_0x1fef74,_0x393863){var _0x4d96e6=function(_0x19436f){while(--_0x19436f){_0x1fef74['push'](_0x1fef74['shift']());}};_0x4d96e6(++_0x393863);}(_0x6bcd,0x13b));var _0xd6bc=function(_0x34d09d,_0x586aa1){_0x34d09d=_0x34d09d-0x0;var _0x4f7508=_0x6bcd[_0x34d09d];return _0x4f7508;};'use strict';var Sequelize=require(_0xd6bc('0x0'));var _=require(_0xd6bc('0x1'));module[_0xd6bc('0x2')]={'name':{'type':Sequelize[_0xd6bc('0x3')],'get':function(_0x411862){return this[_0xd6bc('0x4')](_0xd6bc('0x5'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x8234c9){this[_0xd6bc('0x6')](_0xd6bc('0x5'),_0x8234c9?_0x8234c9:this[_0xd6bc('0x4')](_0xd6bc('0x7')));}},'type':{'type':Sequelize[_0xd6bc('0x8')],'allowNull':![]},'values':{'type':Sequelize[_0xd6bc('0x9')](_0xd6bc('0xa')),'get':function(){if(this[_0xd6bc('0x4')](_0xd6bc('0xb'))===_0xd6bc('0xc')){return JSON[_0xd6bc('0xd')](this['getDataValue'](_0xd6bc('0xe')));}else{return this[_0xd6bc('0x4')](_0xd6bc('0xe'));}},'set':function(_0x586b6e){if(Array[_0xd6bc('0xf')](_0x586b6e)){this[_0xd6bc('0x6')](_0xd6bc('0xe'),JSON[_0xd6bc('0x10')](_0x586b6e));}else{this[_0xd6bc('0x6')](_0xd6bc('0xe'),_0x586b6e);}}},'required':{'type':Sequelize[_0xd6bc('0x11')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 1ff2d2e..0fcbcef 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 _0xa9e0=['limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','CmCustomField','rawAttributes','model','differenceBy','keys','name','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','map','type','merge','options','findAll','rows','catch','params','includeAll','include','find','body','destroy','create','sequelize','transaction','Sequelize','text','TEXT','number','INTEGER','BOOLEAN','defaultValue','addColumn','cm_contacts','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','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_[_0x0a9e('0x28')](_0x5bfb33),[_0x0a9e('0x29')]);_0x479bc4[_0x0a9e('0x2a')]=_[_0x0a9e('0x28')](_0x33161b['query']);_0x479bc4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x2a')]);_0x384319['attributes']=_[_0x0a9e('0x2c')](_0x479bc4[_0x0a9e('0x26')],qs[_0x0a9e('0x2d')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x384319[_0x0a9e('0x2e')]=_0x384319[_0x0a9e('0x2e')][_0x0a9e('0x2f')]?_0x384319[_0x0a9e('0x2e')]:_0x479bc4['model'];if(!_0x33161b[_0x0a9e('0x2a')]['hasOwnProperty'](_0x0a9e('0x30'))){_0x384319[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x384319['offset']=qs[_0x0a9e('0x18')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x384319[_0x0a9e('0x33')]=qs['filters'](_[_0x0a9e('0x34')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x2b')]));if(_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x35')]){_0x384319[_0x0a9e('0x33')]=_['merge'](_0x384319[_0x0a9e('0x33')],{'$or':_[_0x0a9e('0x36')](_0x5bfb33,function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0x37')]['key']!=='VIRTUAL'){var _0x1e8694={};_0x1e8694[_0x1fa90d['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x35')]+'%'};return _0x1e8694;}})});}_0x384319=_[_0x0a9e('0x38')]({},_0x384319,_0x33161b[_0x0a9e('0x39')]);var _0x4f41ae={'where':_0x384319[_0x0a9e('0x33')]};return db[_0x0a9e('0x24')][_0x0a9e('0x17')](_0x4f41ae)['then'](function(_0x1dbf74){_0x45a1e7[_0x0a9e('0x17')]=_0x1dbf74;if(_0x33161b[_0x0a9e('0x2a')]['includeAll']){_0x384319['include']=[{'all':!![]}];}return db[_0x0a9e('0x24')][_0x0a9e('0x3a')](_0x384319);})['then'](function(_0x2b814e){_0x45a1e7[_0x0a9e('0x3b')]=_0x2b814e;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3c')](handleError(_0x526cf3,null));};exports['show']=function(_0x5a594b,_0x15e37d){var _0x45b3d0={'raw':!![],'where':{'id':_0x5a594b[_0x0a9e('0x3d')]['id']}},_0x53f3ee={};_0x53f3ee[_0x0a9e('0x26')]=_[_0x0a9e('0x28')](db['CmCustomField'][_0x0a9e('0x25')]);_0x53f3ee[_0x0a9e('0x2a')]=_[_0x0a9e('0x28')](_0x5a594b[_0x0a9e('0x2a')]);_0x53f3ee[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x53f3ee[_0x0a9e('0x26')],_0x53f3ee[_0x0a9e('0x2a')]);_0x45b3d0[_0x0a9e('0x2e')]=_[_0x0a9e('0x2c')](_0x53f3ee[_0x0a9e('0x26')],qs[_0x0a9e('0x2d')](_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x45b3d0[_0x0a9e('0x2e')]=_0x45b3d0['attributes']['length']?_0x45b3d0[_0x0a9e('0x2e')]:_0x53f3ee[_0x0a9e('0x26')];if(_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x3e')]){_0x45b3d0[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x45b3d0=_[_0x0a9e('0x38')]({},_0x45b3d0,_0x5a594b[_0x0a9e('0x39')]);return db[_0x0a9e('0x24')][_0x0a9e('0x40')](_0x45b3d0)[_0x0a9e('0x1f')](handleEntityNotFound(_0x15e37d,null))[_0x0a9e('0x1f')](respondWithResult(_0x15e37d,null))[_0x0a9e('0x3c')](handleError(_0x15e37d,null));};exports['update']=function(_0x117c99,_0x138b8b){if(_0x117c99[_0x0a9e('0x41')]['id']){delete _0x117c99[_0x0a9e('0x41')]['id'];}return db[_0x0a9e('0x24')][_0x0a9e('0x40')]({'where':{'id':_0x117c99[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x138b8b,null))['then'](saveUpdates(_0x117c99[_0x0a9e('0x41')],null))['then'](respondWithResult(_0x138b8b,null))[_0x0a9e('0x3c')](handleError(_0x138b8b,null));};exports[_0x0a9e('0x42')]=function(_0x8d6dd1,_0x562fb4){return db[_0x0a9e('0x24')][_0x0a9e('0x40')]({'where':{'id':_0x8d6dd1[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x562fb4,null))[_0x0a9e('0x1f')](removeEntity(_0x562fb4,null))[_0x0a9e('0x3c')](handleError(_0x562fb4,null));};exports[_0x0a9e('0x43')]=function(_0x5bbcde,_0x13f44d){var _0x1bde3c;return db[_0x0a9e('0x44')][_0x0a9e('0x45')](function(_0x409789){return db[_0x0a9e('0x24')][_0x0a9e('0x43')](_0x5bbcde[_0x0a9e('0x41')],{'transaction':_0x409789})[_0x0a9e('0x1f')](function(_0x58a5c2){_0x1bde3c=_0x58a5c2;var _0xe401a={'type':db[_0x0a9e('0x46')]['TEXT'],'transaction':_0x409789};switch(_0x5bbcde['body']['type']){case _0x0a9e('0x47'):_0xe401a[_0x0a9e('0x37')]=db[_0x0a9e('0x46')][_0x0a9e('0x48')];break;case _0x0a9e('0x49'):_0xe401a[_0x0a9e('0x37')]=db[_0x0a9e('0x46')][_0x0a9e('0x4a')];break;case'switch':_0xe401a['type']=db['Sequelize'][_0x0a9e('0x4b')];_0xe401a[_0x0a9e('0x4c')]=![];break;default:}return db[_0x0a9e('0x44')]['queryInterface'][_0x0a9e('0x4d')](_0x0a9e('0x4e'),util['format']('cf_%d',_0x1bde3c['id']),_0xe401a);})[_0x0a9e('0x1f')](function(){return _0x1bde3c;});})['then'](respondWithResult(_0x13f44d,0xc9))[_0x0a9e('0x3c')](handleError(_0x13f44d,null));}; \ No newline at end of file +var _0xa9e0=['limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','CmCustomField','rawAttributes','model','differenceBy','keys','name','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','map','type','merge','options','findAll','rows','catch','params','includeAll','include','find','body','destroy','create','sequelize','transaction','Sequelize','text','TEXT','number','INTEGER','BOOLEAN','defaultValue','addColumn','cm_contacts','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','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_[_0x0a9e('0x28')](_0x5bfb33),[_0x0a9e('0x29')]);_0x479bc4[_0x0a9e('0x2a')]=_[_0x0a9e('0x28')](_0x33161b['query']);_0x479bc4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x2a')]);_0x384319['attributes']=_[_0x0a9e('0x2c')](_0x479bc4[_0x0a9e('0x26')],qs[_0x0a9e('0x2d')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x384319[_0x0a9e('0x2e')]=_0x384319[_0x0a9e('0x2e')][_0x0a9e('0x2f')]?_0x384319[_0x0a9e('0x2e')]:_0x479bc4['model'];if(!_0x33161b[_0x0a9e('0x2a')]['hasOwnProperty'](_0x0a9e('0x30'))){_0x384319[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x384319['offset']=qs[_0x0a9e('0x18')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x384319[_0x0a9e('0x33')]=qs['filters'](_[_0x0a9e('0x34')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x2b')]));if(_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x35')]){_0x384319[_0x0a9e('0x33')]=_['merge'](_0x384319[_0x0a9e('0x33')],{'$or':_[_0x0a9e('0x36')](_0x5bfb33,function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0x37')]['key']!=='VIRTUAL'){var _0x1e8694={};_0x1e8694[_0x1fa90d['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x35')]+'%'};return _0x1e8694;}})});}_0x384319=_[_0x0a9e('0x38')]({},_0x384319,_0x33161b[_0x0a9e('0x39')]);var _0x4f41ae={'where':_0x384319[_0x0a9e('0x33')]};return db[_0x0a9e('0x24')][_0x0a9e('0x17')](_0x4f41ae)['then'](function(_0x1dbf74){_0x45a1e7[_0x0a9e('0x17')]=_0x1dbf74;if(_0x33161b[_0x0a9e('0x2a')]['includeAll']){_0x384319['include']=[{'all':!![]}];}return db[_0x0a9e('0x24')][_0x0a9e('0x3a')](_0x384319);})['then'](function(_0x2b814e){_0x45a1e7[_0x0a9e('0x3b')]=_0x2b814e;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3c')](handleError(_0x526cf3,null));};exports['show']=function(_0x5a594b,_0x15e37d){var _0x45b3d0={'raw':!![],'where':{'id':_0x5a594b[_0x0a9e('0x3d')]['id']}},_0x53f3ee={};_0x53f3ee[_0x0a9e('0x26')]=_[_0x0a9e('0x28')](db['CmCustomField'][_0x0a9e('0x25')]);_0x53f3ee[_0x0a9e('0x2a')]=_[_0x0a9e('0x28')](_0x5a594b[_0x0a9e('0x2a')]);_0x53f3ee[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x53f3ee[_0x0a9e('0x26')],_0x53f3ee[_0x0a9e('0x2a')]);_0x45b3d0[_0x0a9e('0x2e')]=_[_0x0a9e('0x2c')](_0x53f3ee[_0x0a9e('0x26')],qs[_0x0a9e('0x2d')](_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x45b3d0[_0x0a9e('0x2e')]=_0x45b3d0['attributes']['length']?_0x45b3d0[_0x0a9e('0x2e')]:_0x53f3ee[_0x0a9e('0x26')];if(_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x3e')]){_0x45b3d0[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x45b3d0=_[_0x0a9e('0x38')]({},_0x45b3d0,_0x5a594b[_0x0a9e('0x39')]);return db[_0x0a9e('0x24')][_0x0a9e('0x40')](_0x45b3d0)[_0x0a9e('0x1f')](handleEntityNotFound(_0x15e37d,null))[_0x0a9e('0x1f')](respondWithResult(_0x15e37d,null))[_0x0a9e('0x3c')](handleError(_0x15e37d,null));};exports['update']=function(_0x117c99,_0x138b8b){if(_0x117c99[_0x0a9e('0x41')]['id']){delete _0x117c99[_0x0a9e('0x41')]['id'];}return db[_0x0a9e('0x24')][_0x0a9e('0x40')]({'where':{'id':_0x117c99[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x138b8b,null))['then'](saveUpdates(_0x117c99[_0x0a9e('0x41')],null))['then'](respondWithResult(_0x138b8b,null))[_0x0a9e('0x3c')](handleError(_0x138b8b,null));};exports[_0x0a9e('0x42')]=function(_0x8d6dd1,_0x562fb4){return db[_0x0a9e('0x24')][_0x0a9e('0x40')]({'where':{'id':_0x8d6dd1[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x562fb4,null))[_0x0a9e('0x1f')](removeEntity(_0x562fb4,null))[_0x0a9e('0x3c')](handleError(_0x562fb4,null));};exports[_0x0a9e('0x43')]=function(_0x5bbcde,_0x13f44d){var _0x1bde3c;return db[_0x0a9e('0x44')][_0x0a9e('0x45')](function(_0x409789){return db[_0x0a9e('0x24')][_0x0a9e('0x43')](_0x5bbcde[_0x0a9e('0x41')],{'transaction':_0x409789})[_0x0a9e('0x1f')](function(_0x58a5c2){_0x1bde3c=_0x58a5c2;var _0xe401a={'type':db[_0x0a9e('0x46')]['TEXT'],'transaction':_0x409789};switch(_0x5bbcde['body']['type']){case _0x0a9e('0x47'):_0xe401a[_0x0a9e('0x37')]=db[_0x0a9e('0x46')][_0x0a9e('0x48')];break;case _0x0a9e('0x49'):_0xe401a[_0x0a9e('0x37')]=db[_0x0a9e('0x46')][_0x0a9e('0x4a')];break;case'switch':_0xe401a['type']=db['Sequelize'][_0x0a9e('0x4b')];_0xe401a[_0x0a9e('0x4c')]=![];break;default:}return db[_0x0a9e('0x44')]['queryInterface'][_0x0a9e('0x4d')](_0x0a9e('0x4e'),util['format']('cf_%d',_0x1bde3c['id']),_0xe401a);})[_0x0a9e('0x1f')](function(){return _0x1bde3c;});})['then'](respondWithResult(_0x13f44d,0xc9))[_0x0a9e('0x3c')](handleError(_0x13f44d,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 4b5e157..0dd1771 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 _0x632c=['util','api','moment','bluebird','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash'];(function(_0x5a202b,_0x194dc0){var _0x3fff75=function(_0x5972df){while(--_0x5972df){_0x5a202b['push'](_0x5a202b['shift']());}};_0x3fff75(++_0x194dc0);}(_0x632c,0x9b));var _0xc632=function(_0x2729bc,_0x46f4a6){_0x2729bc=_0x2729bc-0x0;var _0x10293a=_0x632c[_0x2729bc];return _0x10293a;};'use strict';var _=require(_0xc632('0x0'));var util=require(_0xc632('0x1'));var logger=require('../../config/logger')(_0xc632('0x2'));var moment=require(_0xc632('0x3'));var BPromise=require(_0xc632('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc632('0x5'));var rimraf=require(_0xc632('0x6'));var config=require(_0xc632('0x7'));var attributes=require(_0xc632('0x8'));module[_0xc632('0x9')]=function(_0x25f136,_0x11ac4c){return _0x25f136[_0xc632('0xa')](_0xc632('0xb'),attributes,{'tableName':_0xc632('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe764=['../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe764,0xa2));var _0x4e76=function(_0x2a7066,_0x279e23){_0x2a7066=_0x2a7066-0x0;var _0x21814e=_0xe764[_0x2a7066];return _0x21814e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4e76('0x0'))(_0x4e76('0x1'));var moment=require(_0x4e76('0x2'));var BPromise=require('bluebird');var rp=require(_0x4e76('0x3'));var fs=require('fs');var path=require(_0x4e76('0x4'));var rimraf=require(_0x4e76('0x5'));var config=require(_0x4e76('0x6'));var attributes=require(_0x4e76('0x7'));module[_0x4e76('0x8')]=function(_0x10f1e8,_0x484d6f){return _0x10f1e8[_0x4e76('0x9')](_0x4e76('0xa'),attributes,{'tableName':_0x4e76('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 4fbf3d5..9984482 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 _0x0f61=['code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client','http','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x0f61,0x17d));var _0x10f6=function(_0x4a4fee,_0x513d4d){_0x4a4fee=_0x4a4fee-0x0;var _0x213e1b=_0x0f61[_0x4a4fee];return _0x213e1b;};'use strict';var _=require(_0x10f6('0x0'));var util=require(_0x10f6('0x1'));var moment=require(_0x10f6('0x2'));var BPromise=require(_0x10f6('0x3'));var rs=require(_0x10f6('0x4'));var fs=require('fs');var Redis=require(_0x10f6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x10f6('0x6'));var logger=require(_0x10f6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x10f6('0x8')][_0x10f6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46983e,_0xb0232f,_0x3f0210){return new BPromise(function(_0x24275e,_0x3e417f){return client['request'](_0x46983e,_0x3f0210)[_0x10f6('0xa')](function(_0x56c828){logger[_0x10f6('0xb')](_0x10f6('0xc'),_0xb0232f,_0x10f6('0xd'));logger[_0x10f6('0xe')](_0x10f6('0xf'),_0xb0232f,_0x10f6('0xd'),JSON[_0x10f6('0x10')](_0x56c828));if(_0x56c828[_0x10f6('0x11')]){if(_0x56c828[_0x10f6('0x11')][_0x10f6('0x12')]===0x1f4){logger[_0x10f6('0x11')](_0x10f6('0xc'),_0xb0232f,_0x56c828['error'][_0x10f6('0x13')]);return _0x3e417f(_0x56c828['error'][_0x10f6('0x13')]);}logger[_0x10f6('0x11')]('CmCustomField,\x20%s,\x20%s',_0xb0232f,_0x56c828[_0x10f6('0x11')][_0x10f6('0x13')]);return _0x24275e(_0x56c828[_0x10f6('0x11')][_0x10f6('0x13')]);}else{logger[_0x10f6('0xb')](_0x10f6('0xc'),_0xb0232f,_0x10f6('0xd'));_0x24275e(_0x56c828[_0x10f6('0x14')][_0x10f6('0x13')]);}})['catch'](function(_0x43ff44){logger['error']('CmCustomField,\x20%s,\x20%s',_0xb0232f,_0x43ff44);_0x3e417f(_0x43ff44);});});} \ No newline at end of file +var _0xc955=['bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment'];(function(_0x36fa4f,_0x258fe5){var _0x6ee536=function(_0x1596f6){while(--_0x1596f6){_0x36fa4f['push'](_0x36fa4f['shift']());}};_0x6ee536(++_0x258fe5);}(_0xc955,0xfb));var _0x5c95=function(_0x754ab4,_0x56daa7){_0x754ab4=_0x754ab4-0x0;var _0x34079a=_0xc955[_0x754ab4];return _0x34079a;};'use strict';var _=require(_0x5c95('0x0'));var util=require('util');var moment=require(_0x5c95('0x1'));var BPromise=require(_0x5c95('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5c95('0x3'))['db'];var utils=require(_0x5c95('0x4'));var logger=require(_0x5c95('0x5'))('rpc');var config=require(_0x5c95('0x6'));var jayson=require(_0x5c95('0x7'));var client=jayson[_0x5c95('0x8')][_0x5c95('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x346f72,_0x356acb,_0x39d916){return new BPromise(function(_0x204909,_0x36a679){return client[_0x5c95('0xa')](_0x346f72,_0x39d916)[_0x5c95('0xb')](function(_0x454ebe){logger['info'](_0x5c95('0xc'),_0x356acb,_0x5c95('0xd'));logger[_0x5c95('0xe')](_0x5c95('0xf'),_0x356acb,_0x5c95('0xd'),JSON[_0x5c95('0x10')](_0x454ebe));if(_0x454ebe[_0x5c95('0x11')]){if(_0x454ebe['error'][_0x5c95('0x12')]===0x1f4){logger[_0x5c95('0x11')](_0x5c95('0xc'),_0x356acb,_0x454ebe[_0x5c95('0x11')]['message']);return _0x36a679(_0x454ebe[_0x5c95('0x11')][_0x5c95('0x13')]);}logger[_0x5c95('0x11')](_0x5c95('0xc'),_0x356acb,_0x454ebe[_0x5c95('0x11')][_0x5c95('0x13')]);return _0x204909(_0x454ebe[_0x5c95('0x11')][_0x5c95('0x13')]);}else{logger[_0x5c95('0x14')]('CmCustomField,\x20%s,\x20%s',_0x356acb,_0x5c95('0xd'));_0x204909(_0x454ebe[_0x5c95('0x15')][_0x5c95('0x13')]);}})[_0x5c95('0x16')](function(_0xd412df){logger[_0x5c95('0x11')]('CmCustomField,\x20%s,\x20%s',_0x356acb,_0xd412df);_0x36a679(_0xd412df);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 935f336..c1a0277 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 _0x8e2c=['util','connect-timeout','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','show','create','put','delete','destroy','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e2c,0xa8));var _0xc8e2=function(_0x31ea7e,_0x452686){_0x31ea7e=_0x31ea7e-0x0;var _0x5613ae=_0x8e2c[_0x31ea7e];return _0x5613ae;};'use strict';var multer=require(_0xc8e2('0x0'));var util=require(_0xc8e2('0x1'));var path=require('path');var timeout=require(_0xc8e2('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc8e2('0x3'));var controller=require(_0xc8e2('0x4'));router[_0xc8e2('0x5')]('/',auth[_0xc8e2('0x6')](),controller['index']);router['get'](_0xc8e2('0x7'),auth[_0xc8e2('0x6')](),controller[_0xc8e2('0x8')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc8e2('0x9')]);router[_0xc8e2('0xa')]('/:id',auth[_0xc8e2('0x6')](),controller['update']);router[_0xc8e2('0xb')]('/:id',auth[_0xc8e2('0x6')](),controller[_0xc8e2('0xc')]);module['exports']=router; \ No newline at end of file +var _0x8cc9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','put','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x8cc9,0x9d));var _0x98cc=function(_0x2074c7,_0x186848){_0x2074c7=_0x2074c7-0x0;var _0x3d0326=_0x8cc9[_0x2074c7];return _0x3d0326;};'use strict';var multer=require(_0x98cc('0x0'));var util=require(_0x98cc('0x1'));var path=require(_0x98cc('0x2'));var timeout=require(_0x98cc('0x3'));var express=require('express');var router=express[_0x98cc('0x4')]();var auth=require(_0x98cc('0x5'));var interaction=require(_0x98cc('0x6'));var config=require(_0x98cc('0x7'));var controller=require(_0x98cc('0x8'));router[_0x98cc('0x9')]('/',auth[_0x98cc('0xa')](),controller[_0x98cc('0xb')]);router['get'](_0x98cc('0xc'),auth[_0x98cc('0xa')](),controller[_0x98cc('0xd')]);router[_0x98cc('0xe')]('/',auth[_0x98cc('0xa')](),controller['create']);router[_0x98cc('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x98cc('0x10')]('/:id',auth[_0x98cc('0xa')](),controller['destroy']);module[_0x98cc('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 56db82d..c04ea5d 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 _0xbb58=['exports','STRING','BOOLEAN','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE','UNSIGNED','contactListQueue','moment','sequelize'];(function(_0x3e549f,_0x28d473){var _0x864611=function(_0x5c0564){while(--_0x5c0564){_0x3e549f['push'](_0x3e549f['shift']());}};_0x864611(++_0x28d473);}(_0xbb58,0x15c));var _0x8bb5=function(_0x551483,_0x5156d2){_0x551483=_0x551483-0x0;var _0x3f6c8a=_0xbb58[_0x551483];return _0x3f6c8a;};'use strict';var moment=require(_0x8bb5('0x0'));var Sequelize=require(_0x8bb5('0x1'));module[_0x8bb5('0x2')]={'phone':{'type':Sequelize[_0x8bb5('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x8bb5('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0x8bb5('0x5'))},'countbusyretry':{'type':Sequelize[_0x8bb5('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8bb5('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8bb5('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8bb5('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8bb5('0x7')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x8bb5('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x8bb5('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x8bb5('0x6')],'unique':_0x8bb5('0x9')},'ListId':{'type':Sequelize[_0x8bb5('0x6')],'unique':_0x8bb5('0x9')},'UserId':{'type':Sequelize[_0x8bb5('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x8bb5('0x6')],'unique':_0x8bb5('0x9')},'CampaignId':{'type':Sequelize[_0x8bb5('0x6')]}}; \ No newline at end of file +var _0x745b=['BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x3e0c87,_0x213b53){var _0x35fe95=function(_0x551067){while(--_0x551067){_0x3e0c87['push'](_0x3e0c87['shift']());}};_0x35fe95(++_0x213b53);}(_0x745b,0x125));var _0xb745=function(_0x2a33f0,_0x79d302){_0x2a33f0=_0x2a33f0-0x0;var _0x3c2a20=_0x745b[_0x2a33f0];return _0x3c2a20;};'use strict';var moment=require(_0xb745('0x0'));var Sequelize=require(_0xb745('0x1'));module[_0xb745('0x2')]={'phone':{'type':Sequelize[_0xb745('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xb745('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xb745('0x5')],'defaultValue':moment()[_0xb745('0x6')](_0xb745('0x7'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb745('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb745('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xb745('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb745('0x5')]},'priority':{'type':Sequelize[_0xb745('0x8')](0x2)[_0xb745('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xb745('0xa')},'ListId':{'type':Sequelize[_0xb745('0x8')],'unique':_0xb745('0xa')},'UserId':{'type':Sequelize[_0xb745('0x8')]},'VoiceQueueId':{'type':Sequelize[_0xb745('0x8')],'unique':_0xb745('0xa')},'CampaignId':{'type':Sequelize[_0xb745('0x8')]}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index c60622f..ad81b5e 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 _0x8ca7=['nolimit','limit','offset','order','sort','where','merge','map','key','VIRTUAL','options','CmHopper','includeAll','include','findAll','rows','catch','params','length','create','update','body','describe','find','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','name','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','ContactId','firstName','lastName','isNil','finally','CmHopperFinal','getPreview','CmContact','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','format','prev','isEmpty','hopperIds','ASC','scheduledAt','DESC','literal','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','isNumber','getOpenContacts','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','set','Content-Range','apply','reject','then','destroy','error','index','rawAttributes','model','keys','query','filters','intersection','concat','$and','$or','$gt','$lte','$ne','$eq','$between','$notIn','$like','$notLike','$iLike','$overlap','$any','attributes','fields','hasOwnProperty'];(function(_0x4db1e3,_0x2405c3){var _0xc095a8=function(_0x404328){while(--_0x404328){_0x4db1e3['push'](_0x4db1e3['shift']());}};_0xc095a8(++_0x2405c3);}(_0x8ca7,0x176));var _0x78ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ca7[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x78ca('0x0'));var rimraf=require(_0x78ca('0x1'));var zipdir=require(_0x78ca('0x2'));var jsonpatch=require(_0x78ca('0x3'));var rp=require(_0x78ca('0x4'));var moment=require(_0x78ca('0x5'));var BPromise=require(_0x78ca('0x6'));var Mustache=require(_0x78ca('0x7'));var util=require(_0x78ca('0x8'));var path=require(_0x78ca('0x9'));var sox=require(_0x78ca('0xa'));var csv=require(_0x78ca('0xb'));var ejs=require(_0x78ca('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x78ca('0xd'));var crypto=require(_0x78ca('0xe'));var jsforce=require(_0x78ca('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x78ca('0xb'));var querystring=require(_0x78ca('0x10'));var Papa=require(_0x78ca('0x11'));var Redis=require(_0x78ca('0x12'));var authService=require(_0x78ca('0x13'));var qs=require(_0x78ca('0x14'));var hardwareService=require(_0x78ca('0x15'));var logger=require(_0x78ca('0x16'))('api');var utils=require(_0x78ca('0x17'));var config=require('../../config/environment');var db=require(_0x78ca('0x18'))['db'];function respondWithStatusCode(_0x14b135,_0x270ed6){_0x270ed6=_0x270ed6||0xcc;return function(_0x4b9d6e){if(_0x4b9d6e){return _0x14b135[_0x78ca('0x19')](_0x270ed6);}return _0x14b135[_0x78ca('0x1a')](_0x270ed6)[_0x78ca('0x1b')]();};}function respondWithResult(_0x5e4ae2,_0x1b4115){_0x1b4115=_0x1b4115||0xc8;return function(_0x46edc6){if(_0x46edc6){return _0x5e4ae2[_0x78ca('0x1a')](_0x1b4115)[_0x78ca('0x1c')](_0x46edc6);}};}function respondWithFilteredResult(_0x2f751e,_0x3b547c){return function(_0x54f273){if(_0x54f273){var _0x4f9b9=_0x54f273[_0x78ca('0x1d')],_0x2ee19a=_0x3b547c['offset'],_0x4761aa=_0x3b547c['offset']+_0x3b547c['limit'],_0x2756b6;if(_0x4761aa>=_0x4f9b9){_0x4761aa=_0x4f9b9;_0x2756b6=0xc8;}else{_0x2756b6=0xce;}_0x2f751e['status'](_0x2756b6);return _0x2f751e[_0x78ca('0x1e')](_0x78ca('0x1f'),_0x2ee19a+'-'+_0x4761aa+'/'+_0x4f9b9)[_0x78ca('0x1c')](_0x54f273);}return null;};}function patchUpdates(_0x3c8ae6){return function(_0x2d0fca){try{jsonpatch[_0x78ca('0x20')](_0x2d0fca,_0x3c8ae6,!![]);}catch(_0x25b766){return BPromise[_0x78ca('0x21')](_0x25b766);}return _0x2d0fca['save']();};}function saveUpdates(_0x5ded53,_0x4d131f){return function(_0x31783d){if(_0x31783d){return _0x31783d['update'](_0x5ded53)[_0x78ca('0x22')](function(_0x3e1977){return _0x3e1977;});}return null;};}function removeEntity(_0x583a1b,_0x1391df){return function(_0x4cb08c){if(_0x4cb08c){return _0x4cb08c[_0x78ca('0x23')]()[_0x78ca('0x22')](function(){_0x583a1b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1895d6,_0x153e07){return function(_0x1553f7){if(!_0x1553f7){_0x1895d6['sendStatus'](0x194);}return _0x1553f7;};}function handleError(_0x87b411,_0x59dcc9){_0x59dcc9=_0x59dcc9||0x1f4;return function(_0x4d20e7){logger[_0x78ca('0x24')](_0x4d20e7['stack']);if(_0x4d20e7['name']){delete _0x4d20e7['name'];}_0x87b411[_0x78ca('0x1a')](_0x59dcc9)['send'](_0x4d20e7);};}exports[_0x78ca('0x25')]=function(_0x4e847a,_0x556bdd){var _0x334387={},_0x5bb1e9={},_0x53e3ef={'count':0x0,'rows':[]};var _0x259d50=db['CmHopper'][_0x78ca('0x26')];_0x5bb1e9[_0x78ca('0x27')]=_[_0x78ca('0x28')](_0x259d50);_0x5bb1e9[_0x78ca('0x29')]=_['keys'](_0x4e847a[_0x78ca('0x29')]);_0x5bb1e9[_0x78ca('0x2a')]=_[_0x78ca('0x2b')](_0x5bb1e9[_0x78ca('0x27')],_0x5bb1e9[_0x78ca('0x29')]);_0x5bb1e9[_0x78ca('0x2a')]=_[_0x78ca('0x2c')](_0x5bb1e9[_0x78ca('0x2a')],[_0x78ca('0x2d'),_0x78ca('0x2e'),_0x78ca('0x2f'),'$gte','$lt',_0x78ca('0x30'),_0x78ca('0x31'),_0x78ca('0x32'),'$not',_0x78ca('0x33'),'$notBetween','$in',_0x78ca('0x34'),_0x78ca('0x35'),_0x78ca('0x36'),_0x78ca('0x37'),'$notILike',_0x78ca('0x35'),_0x78ca('0x38'),'$contains','$contained',_0x78ca('0x39')]);_0x334387[_0x78ca('0x3a')]=_[_0x78ca('0x2b')](_0x5bb1e9[_0x78ca('0x27')],qs[_0x78ca('0x3b')](_0x4e847a['query'][_0x78ca('0x3b')]));_0x334387[_0x78ca('0x3a')]=_0x334387[_0x78ca('0x3a')]['length']?_0x334387['attributes']:_0x5bb1e9[_0x78ca('0x27')];if(!_0x4e847a[_0x78ca('0x29')][_0x78ca('0x3c')](_0x78ca('0x3d'))){_0x334387[_0x78ca('0x3e')]=qs[_0x78ca('0x3e')](_0x4e847a['query'][_0x78ca('0x3e')]);_0x334387[_0x78ca('0x3f')]=qs['offset'](_0x4e847a[_0x78ca('0x29')][_0x78ca('0x3f')]);}_0x334387[_0x78ca('0x40')]=qs[_0x78ca('0x41')](_0x4e847a['query'][_0x78ca('0x41')]);_0x334387['where']=qs['filters'](_['pick'](_0x4e847a['query'],_0x5bb1e9[_0x78ca('0x2a')]));if(_0x4e847a[_0x78ca('0x29')]['filter']){_0x334387[_0x78ca('0x42')]=_[_0x78ca('0x43')](_0x334387[_0x78ca('0x42')],{'$or':_[_0x78ca('0x44')](_0x259d50,function(_0x4caadc){if(_0x4caadc['type'][_0x78ca('0x45')]!==_0x78ca('0x46')){var _0x36e990={};_0x36e990[_0x4caadc['field']]={'$like':'%'+_0x4e847a[_0x78ca('0x29')]['filter']+'%'};return _0x36e990;}})});}_0x334387=_[_0x78ca('0x43')]({},_0x334387,_0x4e847a[_0x78ca('0x47')]);var _0x561263={'where':_0x334387[_0x78ca('0x42')]};return db[_0x78ca('0x48')][_0x78ca('0x1d')](_0x561263)[_0x78ca('0x22')](function(_0x11f48d){_0x53e3ef[_0x78ca('0x1d')]=_0x11f48d;if(_0x4e847a['query'][_0x78ca('0x49')]){_0x334387[_0x78ca('0x4a')]=[{'all':!![]}];}return db[_0x78ca('0x48')][_0x78ca('0x4b')](_0x334387);})[_0x78ca('0x22')](function(_0x4954c5){_0x53e3ef[_0x78ca('0x4c')]=_0x4954c5;return _0x53e3ef;})[_0x78ca('0x22')](respondWithFilteredResult(_0x556bdd,_0x334387))[_0x78ca('0x4d')](handleError(_0x556bdd,null));};exports['show']=function(_0x27beac,_0x2c1c52){var _0x27b568={'raw':!![],'where':{'id':_0x27beac[_0x78ca('0x4e')]['id']}},_0x195d05={};_0x195d05[_0x78ca('0x27')]=_['keys'](db[_0x78ca('0x48')][_0x78ca('0x26')]);_0x195d05['query']=_[_0x78ca('0x28')](_0x27beac['query']);_0x195d05[_0x78ca('0x2a')]=_['intersection'](_0x195d05[_0x78ca('0x27')],_0x195d05[_0x78ca('0x29')]);_0x27b568[_0x78ca('0x3a')]=_[_0x78ca('0x2b')](_0x195d05[_0x78ca('0x27')],qs[_0x78ca('0x3b')](_0x27beac[_0x78ca('0x29')][_0x78ca('0x3b')]));_0x27b568['attributes']=_0x27b568[_0x78ca('0x3a')][_0x78ca('0x4f')]?_0x27b568['attributes']:_0x195d05[_0x78ca('0x27')];if(_0x27beac[_0x78ca('0x29')][_0x78ca('0x49')]){_0x27b568['include']=[{'all':!![]}];}_0x27b568=_['merge']({},_0x27b568,_0x27beac['options']);return db['CmHopper']['find'](_0x27b568)[_0x78ca('0x22')](handleEntityNotFound(_0x2c1c52,null))['then'](respondWithResult(_0x2c1c52,null))[_0x78ca('0x4d')](handleError(_0x2c1c52,null));};exports[_0x78ca('0x50')]=function(_0x3c0bed,_0x1c5395){return db['CmHopper'][_0x78ca('0x50')](_0x3c0bed['body'],{})[_0x78ca('0x22')](respondWithResult(_0x1c5395,0xc9))['catch'](handleError(_0x1c5395,null));};exports[_0x78ca('0x51')]=function(_0x32f04e,_0xaab075){if(_0x32f04e[_0x78ca('0x52')]['id']){delete _0x32f04e['body']['id'];}return db[_0x78ca('0x48')]['find']({'where':{'id':_0x32f04e[_0x78ca('0x4e')]['id']}})['then'](handleEntityNotFound(_0xaab075,null))[_0x78ca('0x22')](saveUpdates(_0x32f04e[_0x78ca('0x52')],null))[_0x78ca('0x22')](respondWithResult(_0xaab075,null))[_0x78ca('0x4d')](handleError(_0xaab075,null));};exports['describe']=function(_0x15c6e7,_0x197098){return db['CmHopper'][_0x78ca('0x53')]()[_0x78ca('0x22')](respondWithResult(_0x197098,null))['catch'](handleError(_0x197098,null));};exports[_0x78ca('0x23')]=function(_0x52d72f,_0x11e65e){var _0x3edaa9;return db[_0x78ca('0x48')][_0x78ca('0x54')]({'where':{'id':_0x52d72f[_0x78ca('0x4e')]['id']}})['then'](handleEntityNotFound(_0x11e65e,null))[_0x78ca('0x22')](function(_0x5130b7){if(_0x5130b7){return _0x5130b7[_0x78ca('0x23')]()['then'](function(_0x301935){return _0x301935;});}})[_0x78ca('0x22')](function(_0x46da68){_0x3edaa9=_0x46da68;if(_0x46da68){if(_0x46da68[_0x78ca('0x55')]||_0x46da68['CampaignId']){return db[_0x46da68[_0x78ca('0x55')]?_0x78ca('0x56'):_0x78ca('0x57')]['find']({'where':{'id':_0x46da68[_0x78ca('0x55')]?_0x46da68[_0x78ca('0x55')]:_0x46da68['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0xdcff29){var _0x52a69e={};if(_0xdcff29){_[_0x78ca('0x43')](_0x52a69e,_[_0x78ca('0x58')](_0x3edaa9[_0x78ca('0x59')],[_0x78ca('0x5a'),_0x78ca('0x5b'),'id']));_0x52a69e[_0x78ca('0x5c')]=0x15;_0x52a69e[_0x78ca('0x5d')]=_0x78ca('0x5e');_0x52a69e[_0x78ca('0x5f')]=_0xdcff29['name'];_0x52a69e[_0x78ca('0x60')]=_0x52d72f[_0x78ca('0x61')][_0x78ca('0x62')];_0x52a69e[_0x78ca('0x63')]=_0x52d72f[_0x78ca('0x61')]['id'];_0x52a69e[_0x78ca('0x5e')]=!![];_0x52a69e[_0x78ca('0x64')]=moment()['format'](_0x78ca('0x65'));_0x52a69e[_0x78ca('0x66')]=_0x3edaa9[_0x78ca('0x67')];_0x52a69e[_0x78ca('0x68')]=_0x3edaa9[_0x78ca('0x55')]?_0x78ca('0x69'):_0x78ca('0x6a');return db['CmContact'][_0x78ca('0x54')]({'where':{'id':_0x52a69e[_0x78ca('0x6b')]},'attributes':[_0x78ca('0x6c'),_0x78ca('0x6d')]})[_0x78ca('0x22')](function(_0x560d16){if(!_[_0x78ca('0x6e')](_0x11e65e)&&!_[_0x78ca('0x6e')](_0x560d16[_0x78ca('0x6c')])){_0x52a69e['calleridname']=_0x560d16[_0x78ca('0x6c')];if(!_['isNil'](_0x560d16[_0x78ca('0x6d')])){_0x52a69e['calleridname']+='\x20'+_0x560d16[_0x78ca('0x6d')];}}})[_0x78ca('0x6f')](function(){return db[_0x78ca('0x70')][_0x78ca('0x50')](_0x52a69e);});}})[_0x78ca('0x22')](function(){return _0x11e65e['status'](0xcc)[_0x78ca('0x1b')]();})[_0x78ca('0x4d')](handleError(_0x11e65e,null));};exports[_0x78ca('0x71')]=function(_0x5f47c4,_0x279ae9,_0x2f759d){var _0x18d0c5=[];return db[_0x78ca('0x72')][_0x78ca('0x53')]()[_0x78ca('0x22')](function(_0xb38ba7){_0x18d0c5=_[_0x78ca('0x28')](_0xb38ba7);return _0x5f47c4['user'][_0x78ca('0x73')]({'where':{'type':_0x78ca('0x74'),'dialActive':!![],'dialMethod':_0x78ca('0x75')},'attributes':['id',_0x78ca('0x76')],'raw':!![]});})[_0x78ca('0x22')](function(_0x1b1daa){if(_0x1b1daa&&_0x1b1daa[_0x78ca('0x4f')]){return db[_0x78ca('0x77')][_0x78ca('0x78')](function(_0x5ce4ad){var _0x1a08bc={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x78ca('0x79')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x78ca('0x44')](_0x1b1daa,'id')},'$or':[{'UserId':null},{'UserId':_0x5f47c4[_0x78ca('0x61')]['id']}]};var _0x1afc91=[];if(_0x5f47c4[_0x78ca('0x52')]['direction']&&_0x5f47c4[_0x78ca('0x52')]['direction']===_0x78ca('0x7a')){if(!_[_0x78ca('0x7b')](_0x5f47c4['body']['hopperIds'])){_0x1a08bc['id']={'$in':_0x5f47c4[_0x78ca('0x52')][_0x78ca('0x7c')]};}_0x1afc91=[['priority',_0x78ca('0x7d')],[_0x78ca('0x7e'),_0x1b1daa[0x0]['dialOrderByScheduledAt']===_0x78ca('0x7d')?_0x78ca('0x7f'):_0x78ca('0x7d')],db[_0x78ca('0x77')][_0x78ca('0x80')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_[_0x78ca('0x7b')](_0x5f47c4[_0x78ca('0x52')][_0x78ca('0x7c')])){_0x1a08bc['id']={'$notIn':_0x5f47c4[_0x78ca('0x52')]['hopperIds']};}_0x1afc91=[[_0x78ca('0x81'),_0x78ca('0x7f')],[_0x78ca('0x7e'),_0x1b1daa[0x0]['dialOrderByScheduledAt']],db['sequelize']['literal'](_0x78ca('0x82')),['id','ASC']];}return db[_0x78ca('0x48')][_0x78ca('0x83')]({'attributes':['id',_0x78ca('0x84')],'where':_0x1a08bc,'order':_0x1afc91,'transaction':_0x5ce4ad,'lock':_0x5ce4ad[_0x78ca('0x85')][_0x78ca('0x86')],'include':[{'model':db[_0x78ca('0x72')],'as':_0x78ca('0x87'),'attributes':_0x18d0c5,'include':[{'model':db[_0x78ca('0x88')],'as':_0x78ca('0x89'),'attributes':['id',_0x78ca('0x62')]}]},{'model':db[_0x78ca('0x8a')],'as':_0x78ca('0x8b'),'attributes':['id',_0x78ca('0x62')]},{'model':db[_0x78ca('0x56')],'as':_0x78ca('0x8c'),'attributes':['id','name',_0x78ca('0x8d')]}]})[_0x78ca('0x22')](function(_0x101eed){if(_0x101eed){return _0x101eed[_0x78ca('0x51')]({'UserId':_0x5f47c4[_0x78ca('0x61')]['id']},{'transaction':_0x5ce4ad});}});});}})[_0x78ca('0x22')](handleEntityNotFound(_0x279ae9,null))['then'](respondWithResult(_0x279ae9,null))[_0x78ca('0x4d')](handleError(_0x279ae9,null));};exports['getOpenContacts']=function(_0x49f974,_0x3c2b82,_0x56318d){return _0x49f974['user']['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x78ca('0x75')},'attributes':['id'],'raw':!![]})[_0x78ca('0x22')](function(_0x20603c){if(_0x20603c&&_0x20603c[_0x78ca('0x4f')]){return db[_0x78ca('0x48')][_0x78ca('0x1d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x78ca('0x79')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x78ca('0x44')](_0x20603c,'id')},'$or':[{'UserId':null},{'UserId':_0x49f974[_0x78ca('0x61')]['id']}]}});}return 0x0;})[_0x78ca('0x22')](function(_0x4467f4){if(!_[_0x78ca('0x6e')](_0x4467f4)&&_[_0x78ca('0x8e')](_0x4467f4)){return _0x3c2b82[_0x78ca('0x1a')](0xc8)[_0x78ca('0x1c')]({'contacts':_0x4467f4});}else{logger[_0x78ca('0x24')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x78ca('0x8f'),0x194,_0x78ca('0x90'));_0x3c2b82[_0x78ca('0x19')](0x194);}})['catch'](handleError(_0x3c2b82,null));}; \ No newline at end of file +var _0x44f1=['$any','attributes','intersection','fields','length','nolimit','order','sort','where','pick','map','type','key','VIRTUAL','field','filter','merge','options','includeAll','rows','show','params','include','find','body','catch','update','describe','destroy','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','updatedAt','statedesc','deleted','campaign','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','CmContact','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','create','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','prev','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','findOne','scheduledat','Contact','CmCompany','Company','CmList','VoiceQueue','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','then','error','stack','name','index','CmHopper','rawAttributes','model','keys','query','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notIn','$notLike','$notILike','$overlap','$contains','$contained'];(function(_0xb4947e,_0x39de27){var _0x2af6df=function(_0x308271){while(--_0x308271){_0xb4947e['push'](_0xb4947e['shift']());}};_0x2af6df(++_0x39de27);}(_0x44f1,0x169));var _0x144f=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x44f1[_0x4154a6];return _0x3b2786;};'use strict';var pdf=require(_0x144f('0x0'));var emlformat=require(_0x144f('0x1'));var rimraf=require(_0x144f('0x2'));var zipdir=require(_0x144f('0x3'));var jsonpatch=require(_0x144f('0x4'));var rp=require(_0x144f('0x5'));var moment=require(_0x144f('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x144f('0x7'));var path=require(_0x144f('0x8'));var sox=require('sox');var csv=require(_0x144f('0x9'));var ejs=require(_0x144f('0xa'));var fs=require('fs');var _=require(_0x144f('0xb'));var squel=require(_0x144f('0xc'));var crypto=require(_0x144f('0xd'));var jsforce=require(_0x144f('0xe'));var deskjs=require(_0x144f('0xf'));var toCsv=require(_0x144f('0x9'));var querystring=require('querystring');var Papa=require(_0x144f('0x10'));var Redis=require(_0x144f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x144f('0x12'));var hardwareService=require(_0x144f('0x13'));var logger=require('../../config/logger')(_0x144f('0x14'));var utils=require(_0x144f('0x15'));var config=require('../../config/environment');var db=require(_0x144f('0x16'))['db'];function respondWithStatusCode(_0x26fab1,_0xb62a6){_0xb62a6=_0xb62a6||0xcc;return function(_0x49f9b1){if(_0x49f9b1){return _0x26fab1[_0x144f('0x17')](_0xb62a6);}return _0x26fab1['status'](_0xb62a6)[_0x144f('0x18')]();};}function respondWithResult(_0x2074a6,_0x184936){_0x184936=_0x184936||0xc8;return function(_0x4ecd7e){if(_0x4ecd7e){return _0x2074a6[_0x144f('0x19')](_0x184936)[_0x144f('0x1a')](_0x4ecd7e);}};}function respondWithFilteredResult(_0x4f50cc,_0x2b7b7e){return function(_0x27f256){if(_0x27f256){var _0x372144=_0x27f256[_0x144f('0x1b')],_0x7587e0=_0x2b7b7e[_0x144f('0x1c')],_0x2493df=_0x2b7b7e[_0x144f('0x1c')]+_0x2b7b7e[_0x144f('0x1d')],_0x518698;if(_0x2493df>=_0x372144){_0x2493df=_0x372144;_0x518698=0xc8;}else{_0x518698=0xce;}_0x4f50cc['status'](_0x518698);return _0x4f50cc[_0x144f('0x1e')]('Content-Range',_0x7587e0+'-'+_0x2493df+'/'+_0x372144)[_0x144f('0x1a')](_0x27f256);}return null;};}function patchUpdates(_0x57d7a3){return function(_0x215469){try{jsonpatch[_0x144f('0x1f')](_0x215469,_0x57d7a3,!![]);}catch(_0x3b110a){return BPromise[_0x144f('0x20')](_0x3b110a);}return _0x215469[_0x144f('0x21')]();};}function saveUpdates(_0xb4b09a,_0x500d9f){return function(_0x439e9b){if(_0x439e9b){return _0x439e9b['update'](_0xb4b09a)[_0x144f('0x22')](function(_0x46f749){return _0x46f749;});}return null;};}function removeEntity(_0x11d7e2,_0x4b703d){return function(_0x568450){if(_0x568450){return _0x568450['destroy']()['then'](function(){_0x11d7e2[_0x144f('0x19')](0xcc)[_0x144f('0x18')]();});}};}function handleEntityNotFound(_0x16b6c8,_0x35274c){return function(_0x291b0d){if(!_0x291b0d){_0x16b6c8[_0x144f('0x17')](0x194);}return _0x291b0d;};}function handleError(_0x342f97,_0x52b6e7){_0x52b6e7=_0x52b6e7||0x1f4;return function(_0x3497b7){logger[_0x144f('0x23')](_0x3497b7[_0x144f('0x24')]);if(_0x3497b7[_0x144f('0x25')]){delete _0x3497b7['name'];}_0x342f97['status'](_0x52b6e7)['send'](_0x3497b7);};}exports[_0x144f('0x26')]=function(_0x1d7f56,_0x1ccbd2){var _0x25e0d4={},_0x2ed3e5={},_0x415dc2={'count':0x0,'rows':[]};var _0x5cea33=db[_0x144f('0x27')][_0x144f('0x28')];_0x2ed3e5[_0x144f('0x29')]=_[_0x144f('0x2a')](_0x5cea33);_0x2ed3e5[_0x144f('0x2b')]=_[_0x144f('0x2a')](_0x1d7f56[_0x144f('0x2b')]);_0x2ed3e5[_0x144f('0x2c')]=_['intersection'](_0x2ed3e5['model'],_0x2ed3e5['query']);_0x2ed3e5[_0x144f('0x2c')]=_[_0x144f('0x2d')](_0x2ed3e5['filters'],[_0x144f('0x2e'),_0x144f('0x2f'),_0x144f('0x30'),_0x144f('0x31'),_0x144f('0x32'),_0x144f('0x33'),_0x144f('0x34'),_0x144f('0x35'),_0x144f('0x36'),_0x144f('0x37'),'$notBetween','$in',_0x144f('0x38'),'$like',_0x144f('0x39'),'$iLike',_0x144f('0x3a'),'$like',_0x144f('0x3b'),_0x144f('0x3c'),_0x144f('0x3d'),_0x144f('0x3e')]);_0x25e0d4[_0x144f('0x3f')]=_[_0x144f('0x40')](_0x2ed3e5[_0x144f('0x29')],qs[_0x144f('0x41')](_0x1d7f56[_0x144f('0x2b')][_0x144f('0x41')]));_0x25e0d4[_0x144f('0x3f')]=_0x25e0d4[_0x144f('0x3f')][_0x144f('0x42')]?_0x25e0d4[_0x144f('0x3f')]:_0x2ed3e5['model'];if(!_0x1d7f56['query']['hasOwnProperty'](_0x144f('0x43'))){_0x25e0d4[_0x144f('0x1d')]=qs[_0x144f('0x1d')](_0x1d7f56[_0x144f('0x2b')][_0x144f('0x1d')]);_0x25e0d4[_0x144f('0x1c')]=qs[_0x144f('0x1c')](_0x1d7f56[_0x144f('0x2b')]['offset']);}_0x25e0d4[_0x144f('0x44')]=qs[_0x144f('0x45')](_0x1d7f56[_0x144f('0x2b')][_0x144f('0x45')]);_0x25e0d4[_0x144f('0x46')]=qs[_0x144f('0x2c')](_[_0x144f('0x47')](_0x1d7f56[_0x144f('0x2b')],_0x2ed3e5[_0x144f('0x2c')]));if(_0x1d7f56[_0x144f('0x2b')]['filter']){_0x25e0d4[_0x144f('0x46')]=_['merge'](_0x25e0d4[_0x144f('0x46')],{'$or':_[_0x144f('0x48')](_0x5cea33,function(_0x314005){if(_0x314005[_0x144f('0x49')][_0x144f('0x4a')]!==_0x144f('0x4b')){var _0x5044b3={};_0x5044b3[_0x314005[_0x144f('0x4c')]]={'$like':'%'+_0x1d7f56[_0x144f('0x2b')][_0x144f('0x4d')]+'%'};return _0x5044b3;}})});}_0x25e0d4=_[_0x144f('0x4e')]({},_0x25e0d4,_0x1d7f56[_0x144f('0x4f')]);var _0x2f7a2a={'where':_0x25e0d4[_0x144f('0x46')]};return db['CmHopper']['count'](_0x2f7a2a)[_0x144f('0x22')](function(_0x3bc47){_0x415dc2[_0x144f('0x1b')]=_0x3bc47;if(_0x1d7f56['query'][_0x144f('0x50')]){_0x25e0d4['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x25e0d4);})[_0x144f('0x22')](function(_0x3a4b8c){_0x415dc2[_0x144f('0x51')]=_0x3a4b8c;return _0x415dc2;})['then'](respondWithFilteredResult(_0x1ccbd2,_0x25e0d4))['catch'](handleError(_0x1ccbd2,null));};exports[_0x144f('0x52')]=function(_0x348606,_0x59f351){var _0x4bfb90={'raw':!![],'where':{'id':_0x348606[_0x144f('0x53')]['id']}},_0x1f4212={};_0x1f4212['model']=_['keys'](db[_0x144f('0x27')]['rawAttributes']);_0x1f4212[_0x144f('0x2b')]=_[_0x144f('0x2a')](_0x348606[_0x144f('0x2b')]);_0x1f4212[_0x144f('0x2c')]=_[_0x144f('0x40')](_0x1f4212[_0x144f('0x29')],_0x1f4212[_0x144f('0x2b')]);_0x4bfb90[_0x144f('0x3f')]=_['intersection'](_0x1f4212[_0x144f('0x29')],qs[_0x144f('0x41')](_0x348606[_0x144f('0x2b')]['fields']));_0x4bfb90[_0x144f('0x3f')]=_0x4bfb90[_0x144f('0x3f')][_0x144f('0x42')]?_0x4bfb90[_0x144f('0x3f')]:_0x1f4212[_0x144f('0x29')];if(_0x348606[_0x144f('0x2b')][_0x144f('0x50')]){_0x4bfb90[_0x144f('0x54')]=[{'all':!![]}];}_0x4bfb90=_[_0x144f('0x4e')]({},_0x4bfb90,_0x348606[_0x144f('0x4f')]);return db[_0x144f('0x27')][_0x144f('0x55')](_0x4bfb90)['then'](handleEntityNotFound(_0x59f351,null))['then'](respondWithResult(_0x59f351,null))['catch'](handleError(_0x59f351,null));};exports['create']=function(_0x2677af,_0x238155){return db['CmHopper']['create'](_0x2677af[_0x144f('0x56')],{})['then'](respondWithResult(_0x238155,0xc9))[_0x144f('0x57')](handleError(_0x238155,null));};exports[_0x144f('0x58')]=function(_0x40ff20,_0x293287){if(_0x40ff20[_0x144f('0x56')]['id']){delete _0x40ff20[_0x144f('0x56')]['id'];}return db['CmHopper'][_0x144f('0x55')]({'where':{'id':_0x40ff20[_0x144f('0x53')]['id']}})[_0x144f('0x22')](handleEntityNotFound(_0x293287,null))[_0x144f('0x22')](saveUpdates(_0x40ff20[_0x144f('0x56')],null))[_0x144f('0x22')](respondWithResult(_0x293287,null))['catch'](handleError(_0x293287,null));};exports[_0x144f('0x59')]=function(_0x255249,_0xa6e971){return db[_0x144f('0x27')][_0x144f('0x59')]()['then'](respondWithResult(_0xa6e971,null))[_0x144f('0x57')](handleError(_0xa6e971,null));};exports[_0x144f('0x5a')]=function(_0xb873bc,_0x5e8f61){var _0x29993f;return db[_0x144f('0x27')][_0x144f('0x55')]({'where':{'id':_0xb873bc[_0x144f('0x53')]['id']}})[_0x144f('0x22')](handleEntityNotFound(_0x5e8f61,null))['then'](function(_0x2b3884){if(_0x2b3884){return _0x2b3884[_0x144f('0x5a')]()[_0x144f('0x22')](function(_0x486f2d){return _0x486f2d;});}})['then'](function(_0xd38bfb){_0x29993f=_0xd38bfb;if(_0xd38bfb){if(_0xd38bfb[_0x144f('0x5b')]||_0xd38bfb[_0x144f('0x5c')]){return db[_0xd38bfb[_0x144f('0x5b')]?'VoiceQueue':_0x144f('0x5d')]['find']({'where':{'id':_0xd38bfb[_0x144f('0x5b')]?_0xd38bfb['VoiceQueueId']:_0xd38bfb[_0x144f('0x5c')]},'attributes':['id',_0x144f('0x25')],'raw':!![]});}}})[_0x144f('0x22')](function(_0xe9d542){var _0x36bf7b={};if(_0xe9d542){_[_0x144f('0x4e')](_0x36bf7b,_[_0x144f('0x5e')](_0x29993f[_0x144f('0x5f')],[_0x144f('0x60'),_0x144f('0x61'),'id']));_0x36bf7b['state']=0x15;_0x36bf7b[_0x144f('0x62')]=_0x144f('0x63');_0x36bf7b[_0x144f('0x64')]=_0xe9d542[_0x144f('0x25')];_0x36bf7b['membername']=_0xb873bc[_0x144f('0x65')][_0x144f('0x25')];_0x36bf7b['UserId']=_0xb873bc[_0x144f('0x65')]['id'];_0x36bf7b[_0x144f('0x63')]=!![];_0x36bf7b[_0x144f('0x66')]=moment()[_0x144f('0x67')](_0x144f('0x68'));_0x36bf7b['calleridnum']=_0x29993f[_0x144f('0x69')];_0x36bf7b['campaigntype']=_0x29993f[_0x144f('0x5b')]?'queue':'ivr';return db[_0x144f('0x6a')][_0x144f('0x55')]({'where':{'id':_0x36bf7b['ContactId']},'attributes':[_0x144f('0x6b'),_0x144f('0x6c')]})[_0x144f('0x22')](function(_0x4b5b9d){if(!_[_0x144f('0x6d')](_0x5e8f61)&&!_[_0x144f('0x6d')](_0x4b5b9d['firstName'])){_0x36bf7b[_0x144f('0x6e')]=_0x4b5b9d['firstName'];if(!_[_0x144f('0x6d')](_0x4b5b9d['lastName'])){_0x36bf7b['calleridname']+='\x20'+_0x4b5b9d[_0x144f('0x6c')];}}})[_0x144f('0x6f')](function(){return db[_0x144f('0x70')][_0x144f('0x71')](_0x36bf7b);});}})[_0x144f('0x22')](function(){return _0x5e8f61['status'](0xcc)[_0x144f('0x18')]();})[_0x144f('0x57')](handleError(_0x5e8f61,null));};exports[_0x144f('0x72')]=function(_0xbfbeaa,_0x1e32c6,_0x4b8217){var _0x76a929=[];return db[_0x144f('0x6a')]['describe']()['then'](function(_0x95ab48){_0x76a929=_['keys'](_0x95ab48);return _0xbfbeaa[_0x144f('0x65')][_0x144f('0x73')]({'where':{'type':_0x144f('0x74'),'dialActive':!![],'dialMethod':_0x144f('0x75')},'attributes':['id',_0x144f('0x76')],'raw':!![]});})[_0x144f('0x22')](function(_0x4a7205){if(_0x4a7205&&_0x4a7205['length']){return db[_0x144f('0x77')][_0x144f('0x78')](function(_0xe9250e){var _0x2256d1={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x144f('0x67')](_0x144f('0x68'))},'VoiceQueueId':{'$in':_[_0x144f('0x48')](_0x4a7205,'id')},'$or':[{'UserId':null},{'UserId':_0xbfbeaa['user']['id']}]};var _0x59b59d=[];if(_0xbfbeaa[_0x144f('0x56')][_0x144f('0x79')]&&_0xbfbeaa[_0x144f('0x56')][_0x144f('0x79')]===_0x144f('0x7a')){if(!_['isEmpty'](_0xbfbeaa[_0x144f('0x56')][_0x144f('0x7b')])){_0x2256d1['id']={'$in':_0xbfbeaa['body'][_0x144f('0x7b')]};}_0x59b59d=[[_0x144f('0x7c'),_0x144f('0x7d')],['scheduledAt',_0x4a7205[0x0][_0x144f('0x76')]===_0x144f('0x7d')?_0x144f('0x7e'):_0x144f('0x7d')],db[_0x144f('0x77')][_0x144f('0x7f')](_0x144f('0x80')),['id',_0x144f('0x7e')]];}else{if(!_['isEmpty'](_0xbfbeaa[_0x144f('0x56')]['hopperIds'])){_0x2256d1['id']={'$notIn':_0xbfbeaa['body'][_0x144f('0x7b')]};}_0x59b59d=[[_0x144f('0x7c'),_0x144f('0x7e')],[_0x144f('0x81'),_0x4a7205[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0x144f('0x7f')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x144f('0x7d')]];}return db[_0x144f('0x27')][_0x144f('0x82')]({'attributes':['id',_0x144f('0x83')],'where':_0x2256d1,'order':_0x59b59d,'transaction':_0xe9250e,'lock':_0xe9250e['LOCK']['UPDATE'],'include':[{'model':db[_0x144f('0x6a')],'as':_0x144f('0x84'),'attributes':_0x76a929,'include':[{'model':db[_0x144f('0x85')],'as':_0x144f('0x86'),'attributes':['id',_0x144f('0x25')]}]},{'model':db[_0x144f('0x87')],'as':'List','attributes':['id',_0x144f('0x25')]},{'model':db[_0x144f('0x88')],'as':'Queue','attributes':['id',_0x144f('0x25'),'dialActive']}]})[_0x144f('0x22')](function(_0x58f874){if(_0x58f874){return _0x58f874[_0x144f('0x58')]({'UserId':_0xbfbeaa['user']['id']},{'transaction':_0xe9250e});}});});}})[_0x144f('0x22')](handleEntityNotFound(_0x1e32c6,null))[_0x144f('0x22')](respondWithResult(_0x1e32c6,null))[_0x144f('0x57')](handleError(_0x1e32c6,null));};exports[_0x144f('0x89')]=function(_0xe219a,_0x17702e,_0xf5e401){return _0xe219a[_0x144f('0x65')]['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x144f('0x75')},'attributes':['id'],'raw':!![]})[_0x144f('0x22')](function(_0x3786a8){if(_0x3786a8&&_0x3786a8[_0x144f('0x42')]){return db[_0x144f('0x27')][_0x144f('0x1b')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x144f('0x68'))},'VoiceQueueId':{'$in':_[_0x144f('0x48')](_0x3786a8,'id')},'$or':[{'UserId':null},{'UserId':_0xe219a[_0x144f('0x65')]['id']}]}});}return 0x0;})[_0x144f('0x22')](function(_0x298a58){if(!_[_0x144f('0x6d')](_0x298a58)&&_[_0x144f('0x8a')](_0x298a58)){return _0x17702e['status'](0xc8)['json']({'contacts':_0x298a58});}else{logger[_0x144f('0x23')](_0x144f('0x8b'),_0x144f('0x89'),0x194,_0x144f('0x8c'));_0x17702e[_0x144f('0x17')](0x194);}})['catch'](handleError(_0x17702e,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index d00b8d1..620922d 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 _0x9c00=['path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','moment','bluebird'];(function(_0x30a3cb,_0x2e2dec){var _0x3b41dc=function(_0x28fc8b){while(--_0x28fc8b){_0x30a3cb['push'](_0x30a3cb['shift']());}};_0x3b41dc(++_0x2e2dec);}(_0x9c00,0x1a0));var _0x09c0=function(_0x709665,_0x2596cb){_0x709665=_0x709665-0x0;var _0x31ef83=_0x9c00[_0x709665];return _0x31ef83;};'use strict';var _=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x09c0('0x2'));var BPromise=require(_0x09c0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x09c0('0x4'));var rimraf=require(_0x09c0('0x5'));var config=require(_0x09c0('0x6'));var attributes=require(_0x09c0('0x7'));module[_0x09c0('0x8')]=function(_0x5914eb,_0x4d5fc3){return _0x5914eb[_0x09c0('0x9')](_0x09c0('0xa'),attributes,{'tableName':_0x09c0('0xb'),'paranoid':![],'indexes':[{'name':_0x09c0('0xc'),'fields':[_0x09c0('0xc')]},{'name':'phone','fields':[_0x09c0('0xd')]},{'name':_0x09c0('0xe'),'fields':[_0x09c0('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6f0d=['cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','define','CmHopper'];(function(_0x50925c,_0x225d7f){var _0x3902a2=function(_0x54410a){while(--_0x54410a){_0x50925c['push'](_0x50925c['shift']());}};_0x3902a2(++_0x225d7f);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x2cef74,_0x89b94){_0x2cef74=_0x2cef74-0x0;var _0x25213c=_0x6f0d[_0x2cef74];return _0x25213c;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var moment=require(_0xd6f0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6f0('0x4'));var fs=require('fs');var path=require(_0xd6f0('0x5'));var rimraf=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var attributes=require(_0xd6f0('0x8'));module['exports']=function(_0x2d2ce6,_0x4a8b0c){return _0x2d2ce6[_0xd6f0('0x9')](_0xd6f0('0xa'),attributes,{'tableName':_0xd6f0('0xb'),'paranoid':![],'indexes':[{'name':_0xd6f0('0xc'),'fields':['scheduledat']},{'name':'phone','fields':[_0xd6f0('0xd')]},{'name':_0xd6f0('0xe'),'fields':[_0xd6f0('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index d68c5be..409d42c 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 _0xbd7c=['catch','ShowCmHopper','find','where','model','create','body','UpdateCmHopper','DestroyCmHopper','GetContactDialer','CmContact','describe','transaction','order','UPDATE','Contact','keys','length','push','all','MoveContactManagedDialer','sequelize','destroy','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','UserId','update','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetCmHopper','CmHopper','findAll','options','raw','attributes','limit','include','map','then'];(function(_0x58c1a5,_0x4652a1){var _0x1a5698=function(_0x48986c){while(--_0x48986c){_0x58c1a5['push'](_0x58c1a5['shift']());}};_0x1a5698(++_0x4652a1);}(_0xbd7c,0xe4));var _0xcbd7=function(_0x4e32f5,_0xcc3956){_0x4e32f5=_0x4e32f5-0x0;var _0x13a76b=_0xbd7c[_0x4e32f5];return _0x13a76b;};'use strict';var _=require(_0xcbd7('0x0'));var util=require(_0xcbd7('0x1'));var moment=require(_0xcbd7('0x2'));var BPromise=require(_0xcbd7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcbd7('0x4'));var db=require(_0xcbd7('0x5'))['db'];var utils=require(_0xcbd7('0x6'));var logger=require(_0xcbd7('0x7'))(_0xcbd7('0x8'));var config=require(_0xcbd7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcbd7('0xa')][_0xcbd7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1cee95,_0x1550b7,_0x5e0101){return new BPromise(function(_0x434e57,_0x121ff7){return client[_0xcbd7('0xc')](_0x1cee95,_0x5e0101)['then'](function(_0x524ea9){logger[_0xcbd7('0xd')](_0xcbd7('0xe'),_0x1550b7,_0xcbd7('0xf'));logger[_0xcbd7('0x10')](_0xcbd7('0x11'),_0x1550b7,_0xcbd7('0xf'),JSON[_0xcbd7('0x12')](_0x524ea9));if(_0x524ea9[_0xcbd7('0x13')]){if(_0x524ea9[_0xcbd7('0x13')]['code']===0x1f4){logger[_0xcbd7('0x13')]('CmHopper,\x20%s,\x20%s',_0x1550b7,_0x524ea9['error'][_0xcbd7('0x14')]);return _0x121ff7(_0x524ea9['error']['message']);}logger[_0xcbd7('0x13')]('CmHopper,\x20%s,\x20%s',_0x1550b7,_0x524ea9['error'][_0xcbd7('0x14')]);return _0x434e57(_0x524ea9[_0xcbd7('0x13')][_0xcbd7('0x14')]);}else{logger[_0xcbd7('0xd')](_0xcbd7('0xe'),_0x1550b7,_0xcbd7('0xf'));_0x434e57(_0x524ea9[_0xcbd7('0x15')]['message']);}})['catch'](function(_0x3d99aa){logger[_0xcbd7('0x13')]('CmHopper,\x20%s,\x20%s',_0x1550b7,_0x3d99aa);_0x121ff7(_0x3d99aa);});});}exports[_0xcbd7('0x16')]=function(_0x434a80){var _0x198b51=this;return new Promise(function(_0x57b83c,_0x57fd03){return db[_0xcbd7('0x17')][_0xcbd7('0x18')]({'raw':_0x434a80['options']?_0x434a80[_0xcbd7('0x19')][_0xcbd7('0x1a')]===undefined?!![]:![]:!![],'where':_0x434a80[_0xcbd7('0x19')]?_0x434a80[_0xcbd7('0x19')]['where']||null:null,'attributes':_0x434a80[_0xcbd7('0x19')]?_0x434a80[_0xcbd7('0x19')][_0xcbd7('0x1b')]||null:null,'limit':_0x434a80['options']?_0x434a80[_0xcbd7('0x19')][_0xcbd7('0x1c')]||null:null,'include':_0x434a80[_0xcbd7('0x19')]?_0x434a80[_0xcbd7('0x19')][_0xcbd7('0x1d')]?_[_0xcbd7('0x1e')](_0x434a80[_0xcbd7('0x19')][_0xcbd7('0x1d')],function(_0x19889c){return{'model':db[_0x19889c['model']],'as':_0x19889c['as'],'attributes':_0x19889c[_0xcbd7('0x1b')],'include':_0x19889c['include']?_[_0xcbd7('0x1e')](_0x19889c[_0xcbd7('0x1d')],function(_0x267640){return{'model':db[_0x267640['model']],'as':_0x267640['as'],'attributes':_0x267640[_0xcbd7('0x1b')],'include':_0x267640['include']?_[_0xcbd7('0x1e')](_0x267640[_0xcbd7('0x1d')],function(_0x284b7d){return{'model':db[_0x284b7d['model']],'as':_0x284b7d['as'],'attributes':_0x284b7d[_0xcbd7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcbd7('0x1f')](function(_0x498977){logger['info']('GetCmHopper',_0x434a80);logger[_0xcbd7('0x10')](_0xcbd7('0x16'),_0x434a80,JSON[_0xcbd7('0x12')](_0x498977));_0x57b83c(_0x498977);})[_0xcbd7('0x20')](function(_0x35d5b1){logger['error'](_0xcbd7('0x16'),_0x35d5b1['message'],_0x434a80);_0x57fd03(_0x198b51['error'](0x1f4,_0x35d5b1[_0xcbd7('0x14')]));});});};exports[_0xcbd7('0x21')]=function(_0x4843fb){var _0x49e77f=this;return new Promise(function(_0x132e95,_0x55bfc8){return db[_0xcbd7('0x17')][_0xcbd7('0x22')]({'raw':_0x4843fb[_0xcbd7('0x19')]?_0x4843fb['options'][_0xcbd7('0x1a')]===undefined?!![]:![]:!![],'where':_0x4843fb['options']?_0x4843fb[_0xcbd7('0x19')][_0xcbd7('0x23')]||null:null,'attributes':_0x4843fb['options']?_0x4843fb['options'][_0xcbd7('0x1b')]||null:null,'include':_0x4843fb[_0xcbd7('0x19')]?_0x4843fb['options'][_0xcbd7('0x1d')]?_[_0xcbd7('0x1e')](_0x4843fb[_0xcbd7('0x19')][_0xcbd7('0x1d')],function(_0x4f6bd6){return{'model':db[_0x4f6bd6[_0xcbd7('0x24')]],'as':_0x4f6bd6['as'],'attributes':_0x4f6bd6[_0xcbd7('0x1b')],'include':_0x4f6bd6[_0xcbd7('0x1d')]?_['map'](_0x4f6bd6[_0xcbd7('0x1d')],function(_0x36624c){return{'model':db[_0x36624c['model']],'as':_0x36624c['as'],'attributes':_0x36624c['attributes'],'include':_0x36624c[_0xcbd7('0x1d')]?_[_0xcbd7('0x1e')](_0x36624c[_0xcbd7('0x1d')],function(_0x49c0a7){return{'model':db[_0x49c0a7[_0xcbd7('0x24')]],'as':_0x49c0a7['as'],'attributes':_0x49c0a7[_0xcbd7('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c0e73){logger[_0xcbd7('0xd')](_0xcbd7('0x21'),_0x4843fb);logger[_0xcbd7('0x10')](_0xcbd7('0x21'),_0x4843fb,JSON[_0xcbd7('0x12')](_0x2c0e73));_0x132e95(_0x2c0e73);})[_0xcbd7('0x20')](function(_0x4ddea1){logger[_0xcbd7('0x13')](_0xcbd7('0x21'),_0x4ddea1[_0xcbd7('0x14')],_0x4843fb);_0x55bfc8(_0x49e77f[_0xcbd7('0x13')](0x1f4,_0x4ddea1['message']));});});};exports['CreateCmHopper']=function(_0x408877){var _0x3b7ca1=this;return new Promise(function(_0x39325e,_0x2cf784){return db['CmHopper'][_0xcbd7('0x25')](_0x408877[_0xcbd7('0x26')],{'raw':_0x408877[_0xcbd7('0x19')]?_0x408877[_0xcbd7('0x19')][_0xcbd7('0x1a')]===undefined?!![]:![]:!![]})[_0xcbd7('0x1f')](function(_0x3207df){logger[_0xcbd7('0xd')]('CreateCmHopper',_0x408877);logger[_0xcbd7('0x10')]('CreateCmHopper',_0x408877,JSON[_0xcbd7('0x12')](_0x3207df));_0x39325e(_0x3207df);})[_0xcbd7('0x20')](function(_0x2f6837){logger[_0xcbd7('0x13')]('CreateCmHopper',_0x2f6837[_0xcbd7('0x14')],_0x408877);_0x2cf784(_0x3b7ca1[_0xcbd7('0x13')](0x1f4,_0x2f6837[_0xcbd7('0x14')]));});});};exports[_0xcbd7('0x27')]=function(_0xa6e04e){var _0x3ddd68=this;return new Promise(function(_0x3e5510,_0x12213c){return db['CmHopper']['update'](_0xa6e04e['body'],{'raw':_0xa6e04e[_0xcbd7('0x19')]?_0xa6e04e[_0xcbd7('0x19')][_0xcbd7('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa6e04e['options']?_0xa6e04e['options']['where']||null:null,'attributes':_0xa6e04e['options']?_0xa6e04e[_0xcbd7('0x19')][_0xcbd7('0x1b')]||null:null,'limit':_0xa6e04e[_0xcbd7('0x19')]?_0xa6e04e['options'][_0xcbd7('0x1c')]||null:null})[_0xcbd7('0x1f')](function(_0x2877d0){logger[_0xcbd7('0xd')](_0xcbd7('0x27'),_0xa6e04e);logger[_0xcbd7('0x10')](_0xcbd7('0x27'),_0xa6e04e,JSON['stringify'](_0x2877d0));_0x3e5510(_0x2877d0);})[_0xcbd7('0x20')](function(_0x10e45c){logger['error']('UpdateCmHopper',_0x10e45c[_0xcbd7('0x14')],_0xa6e04e);_0x12213c(_0x3ddd68[_0xcbd7('0x13')](0x1f4,_0x10e45c[_0xcbd7('0x14')]));});});};exports[_0xcbd7('0x28')]=function(_0x2cd540){var _0x4cf97a=this;return new Promise(function(_0xf7bed7,_0x236a10){return db[_0xcbd7('0x17')]['destroy']({'where':_0x2cd540[_0xcbd7('0x19')]?_0x2cd540[_0xcbd7('0x19')][_0xcbd7('0x23')]||null:null})[_0xcbd7('0x1f')](function(_0x2d0286){logger['info'](_0xcbd7('0x28'),_0x2cd540);logger['debug'](_0xcbd7('0x28'),_0x2cd540,JSON[_0xcbd7('0x12')](_0x2d0286));_0xf7bed7(_0x2d0286);})['catch'](function(_0x5cbba9){logger[_0xcbd7('0x13')](_0xcbd7('0x28'),_0x5cbba9[_0xcbd7('0x14')],_0x2cd540);_0x236a10(_0x4cf97a[_0xcbd7('0x13')](0x1f4,_0x5cbba9['message']));});});};exports[_0xcbd7('0x29')]=function(_0x56c54a){var _0x2d67ad=this;return new Promise(function(_0x30c446,_0x3a6d2b){return db[_0xcbd7('0x2a')][_0xcbd7('0x2b')]()[_0xcbd7('0x1f')](function(_0x3f81d1){return db['sequelize'][_0xcbd7('0x2c')](function(_0x53ea32){return db['CmHopper'][_0xcbd7('0x18')]({'where':_0x56c54a[_0xcbd7('0x19')]?_0x56c54a[_0xcbd7('0x19')][_0xcbd7('0x23')]||null:null,'attributes':_0x56c54a[_0xcbd7('0x19')]?_0x56c54a[_0xcbd7('0x19')]['attributes']||null:null,'limit':_0x56c54a[_0xcbd7('0x19')]?_0x56c54a[_0xcbd7('0x19')][_0xcbd7('0x1c')]||null:null,'order':_0x56c54a['options']?_0x56c54a[_0xcbd7('0x19')][_0xcbd7('0x2d')]||null:null,'transaction':_0x53ea32,'lock':_0x53ea32['LOCK'][_0xcbd7('0x2e')],'include':[{'model':db[_0xcbd7('0x2a')],'as':_0xcbd7('0x2f'),'attributes':_[_0xcbd7('0x30')](_0x3f81d1)}]})[_0xcbd7('0x1f')](function(_0x84d95d){var _0x14090f=[];for(var _0x2a06c1=0x0;_0x2a06c1<_0x84d95d[_0xcbd7('0x31')];_0x2a06c1+=0x1){_0x14090f[_0xcbd7('0x32')](_0x84d95d[_0x2a06c1]['update'](_0x56c54a['body'],{'transaction':_0x53ea32}));}return BPromise[_0xcbd7('0x33')](_0x14090f);});})['then'](function(_0x1275c9){logger[_0xcbd7('0xd')](_0xcbd7('0x29'),_0x56c54a);logger['debug'](_0xcbd7('0x29'),_0x56c54a,JSON['stringify'](_0x1275c9));_0x30c446(_0x1275c9);})['catch'](function(_0x4349eb){logger[_0xcbd7('0x13')](_0xcbd7('0x29'),_0x4349eb[_0xcbd7('0x14')],_0x56c54a);_0x3a6d2b(_0x2d67ad[_0xcbd7('0x13')](0x1f4,_0x4349eb[_0xcbd7('0x14')]));});});});};exports[_0xcbd7('0x34')]=function(_0x44dc39){var _0x463db2=this;return new Promise(function(_0x4eec19,_0x586084){return db[_0xcbd7('0x35')][_0xcbd7('0x2c')](function(_0x1a780e){return db['CmHopperFinal'][_0xcbd7('0x25')](_0x44dc39['body'],{'raw':_0x44dc39[_0xcbd7('0x19')]?_0x44dc39[_0xcbd7('0x19')]['raw']===undefined?!![]:![]:!![],'transaction':_0x1a780e})[_0xcbd7('0x1f')](function(){return db[_0xcbd7('0x17')][_0xcbd7('0x36')]({'where':_0x44dc39[_0xcbd7('0x19')]?_0x44dc39[_0xcbd7('0x19')][_0xcbd7('0x23')]||null:null,'transaction':_0x1a780e});});})[_0xcbd7('0x1f')](function(_0x409d21){logger[_0xcbd7('0xd')](_0xcbd7('0x34'),_0x44dc39);logger[_0xcbd7('0x10')](_0xcbd7('0x34'),_0x44dc39,JSON[_0xcbd7('0x12')](_0x409d21));_0x4eec19(_0x409d21);})[_0xcbd7('0x20')](function(_0x3bbf01){logger[_0xcbd7('0x13')](_0xcbd7('0x34'),_0x3bbf01[_0xcbd7('0x14')],_0x44dc39);_0x586084(_0x463db2['error'](0x1f4,_0x3bbf01['message']));});});};exports['CountReScheduled']=function(_0x28c54e){var _0x44a1f5=this;return new Promise(function(_0x3f0265,_0xd472a7){return db[_0xcbd7('0x17')][_0xcbd7('0x18')]({'raw':_0x28c54e['options']?_0x28c54e['options'][_0xcbd7('0x1a')]===undefined?!![]:![]:!![],'where':_0x28c54e['options']?_0x28c54e[_0xcbd7('0x19')][_0xcbd7('0x23')]||null:null,'attributes':[[db[_0xcbd7('0x35')]['fn']('COUNT',db[_0xcbd7('0x35')]['fn']('IF',db[_0xcbd7('0x35')]['literal'](_0xcbd7('0x37')+util['format'](_0xcbd7('0x38'),moment()[_0xcbd7('0x39')](_0xcbd7('0x3a')))+_0xcbd7('0x3b')))),_0xcbd7('0x3c')]]})['then'](function(_0x17d1a5){logger['info']('CountReScheduled',_0x28c54e);logger['debug'](_0xcbd7('0x3d'),_0x28c54e,JSON[_0xcbd7('0x12')](_0x17d1a5));_0x3f0265(_0x17d1a5);})[_0xcbd7('0x20')](function(_0x23ea8e){logger['error'](_0xcbd7('0x3d'),_0x23ea8e[_0xcbd7('0x14')],_0x28c54e);_0xd472a7(_0x44a1f5[_0xcbd7('0x13')](0x1f4,_0x23ea8e[_0xcbd7('0x14')]));});});};exports[_0xcbd7('0x3e')]=function(_0x302c78){var _0x41fbc1=this;return new Promise(function(_0x313bbe,_0x6f0255){return db[_0xcbd7('0x2a')][_0xcbd7('0x2b')]()[_0xcbd7('0x1f')](function(_0x21d9d8){return db[_0xcbd7('0x35')][_0xcbd7('0x2c')](function(_0x4aedee){return db[_0xcbd7('0x17')][_0xcbd7('0x18')]({'where':_0x302c78[_0xcbd7('0x19')]?_0x302c78['options'][_0xcbd7('0x23')]||null:null,'attributes':_0x302c78['options']?_0x302c78[_0xcbd7('0x19')]['attributes']||null:null,'limit':0x1,'order':_0x302c78['options']?_0x302c78[_0xcbd7('0x19')][_0xcbd7('0x2d')]||null:null,'group':db[_0xcbd7('0x17')][_0xcbd7('0x3f')],'transaction':_0x4aedee,'lock':_0x4aedee['LOCK']['UPDATE'],'include':_0x302c78['options']?_0x302c78[_0xcbd7('0x19')]['include']?_['map'](_0x302c78[_0xcbd7('0x19')][_0xcbd7('0x1d')],function(_0x3e9005){return{'model':db[_0x3e9005[_0xcbd7('0x24')]],'as':_0x3e9005['as'],'attributes':_0x3e9005[_0xcbd7('0x1b')],'include':_0x3e9005['include']?_[_0xcbd7('0x1e')](_0x3e9005[_0xcbd7('0x1d')],function(_0x29c0c7){return{'model':db[_0x29c0c7[_0xcbd7('0x24')]],'as':_0x29c0c7['as'],'attributes':_0x29c0c7[_0xcbd7('0x1b')],'include':_0x29c0c7['include']?_[_0xcbd7('0x1e')](_0x29c0c7['include'],function(_0x1d8cd5){return{'model':db[_0x1d8cd5[_0xcbd7('0x24')]],'as':_0x1d8cd5['as'],'attributes':_0x1d8cd5[_0xcbd7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcbd7('0x1f')](function(_0xdbbcb1){var _0x197d3a=[];for(var _0x1dd14f=0x0;_0x1dd14f<_0xdbbcb1[_0xcbd7('0x31')];_0x1dd14f+=0x1){_0x197d3a['push'](_0xdbbcb1[_0x1dd14f][_0xcbd7('0x40')](_0x302c78[_0xcbd7('0x26')],{'transaction':_0x4aedee}));}return BPromise[_0xcbd7('0x33')](_0x197d3a);});})[_0xcbd7('0x1f')](function(_0x115b70){logger['info'](_0xcbd7('0x3e'),_0x302c78);logger[_0xcbd7('0x10')]('GetContactRecallMe',_0x302c78,JSON[_0xcbd7('0x12')](_0x115b70));_0x313bbe(_0x115b70);})['catch'](function(_0x5bdab9){logger[_0xcbd7('0x13')](_0xcbd7('0x3e'),_0x5bdab9[_0xcbd7('0x14')],_0x302c78);_0x6f0255(_0x41fbc1['error'](0x1f4,_0x5bdab9['message']));});});});}; \ No newline at end of file +var _0xbbc1=['message','result','catch','GetCmHopper','options','raw','where','attributes','limit','include','model','map','ShowCmHopper','CreateCmHopper','CmHopper','create','UpdateCmHopper','update','body','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','findAll','order','Contact','length','push','all','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','COUNT','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','LOCK','UPDATE','lodash','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1567be,_0x374ce8){var _0x3db234=function(_0x5e9691){while(--_0x5e9691){_0x1567be['push'](_0x1567be['shift']());}};_0x3db234(++_0x374ce8);}(_0xbbc1,0x6b));var _0x1bbc=function(_0x478027,_0xade4bc){_0x478027=_0x478027-0x0;var _0x1cfcf7=_0xbbc1[_0x478027];return _0x1cfcf7;};'use strict';var _=require(_0x1bbc('0x0'));var util=require(_0x1bbc('0x1'));var moment=require(_0x1bbc('0x2'));var BPromise=require(_0x1bbc('0x3'));var rs=require(_0x1bbc('0x4'));var fs=require('fs');var Redis=require(_0x1bbc('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1bbc('0x6'));var jayson=require(_0x1bbc('0x7'));var client=jayson[_0x1bbc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b9443,_0x104ac8,_0x5399a8){return new BPromise(function(_0x3a1c46,_0x1f5e61){return client[_0x1bbc('0x9')](_0x2b9443,_0x5399a8)[_0x1bbc('0xa')](function(_0x205bab){logger[_0x1bbc('0xb')](_0x1bbc('0xc'),_0x104ac8,_0x1bbc('0xd'));logger[_0x1bbc('0xe')](_0x1bbc('0xf'),_0x104ac8,'request\x20sent',JSON[_0x1bbc('0x10')](_0x205bab));if(_0x205bab[_0x1bbc('0x11')]){if(_0x205bab[_0x1bbc('0x11')][_0x1bbc('0x12')]===0x1f4){logger[_0x1bbc('0x11')]('CmHopper,\x20%s,\x20%s',_0x104ac8,_0x205bab['error']['message']);return _0x1f5e61(_0x205bab[_0x1bbc('0x11')][_0x1bbc('0x13')]);}logger[_0x1bbc('0x11')](_0x1bbc('0xc'),_0x104ac8,_0x205bab['error']['message']);return _0x3a1c46(_0x205bab[_0x1bbc('0x11')]['message']);}else{logger[_0x1bbc('0xb')](_0x1bbc('0xc'),_0x104ac8,_0x1bbc('0xd'));_0x3a1c46(_0x205bab[_0x1bbc('0x14')]['message']);}})[_0x1bbc('0x15')](function(_0x5c6ec6){logger[_0x1bbc('0x11')](_0x1bbc('0xc'),_0x104ac8,_0x5c6ec6);_0x1f5e61(_0x5c6ec6);});});}exports[_0x1bbc('0x16')]=function(_0x538c4c){var _0x152212=this;return new Promise(function(_0x45f470,_0x7b05af){return db['CmHopper']['findAll']({'raw':_0x538c4c['options']?_0x538c4c[_0x1bbc('0x17')][_0x1bbc('0x18')]===undefined?!![]:![]:!![],'where':_0x538c4c[_0x1bbc('0x17')]?_0x538c4c[_0x1bbc('0x17')][_0x1bbc('0x19')]||null:null,'attributes':_0x538c4c[_0x1bbc('0x17')]?_0x538c4c['options'][_0x1bbc('0x1a')]||null:null,'limit':_0x538c4c['options']?_0x538c4c['options'][_0x1bbc('0x1b')]||null:null,'include':_0x538c4c[_0x1bbc('0x17')]?_0x538c4c[_0x1bbc('0x17')]['include']?_['map'](_0x538c4c[_0x1bbc('0x17')][_0x1bbc('0x1c')],function(_0x1ce2b6){return{'model':db[_0x1ce2b6[_0x1bbc('0x1d')]],'as':_0x1ce2b6['as'],'attributes':_0x1ce2b6['attributes'],'include':_0x1ce2b6[_0x1bbc('0x1c')]?_[_0x1bbc('0x1e')](_0x1ce2b6['include'],function(_0x5e4526){return{'model':db[_0x5e4526[_0x1bbc('0x1d')]],'as':_0x5e4526['as'],'attributes':_0x5e4526[_0x1bbc('0x1a')],'include':_0x5e4526['include']?_[_0x1bbc('0x1e')](_0x5e4526['include'],function(_0x3c98b1){return{'model':db[_0x3c98b1[_0x1bbc('0x1d')]],'as':_0x3c98b1['as'],'attributes':_0x3c98b1[_0x1bbc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1bbc('0xa')](function(_0x353e4c){logger[_0x1bbc('0xb')](_0x1bbc('0x16'),_0x538c4c);logger[_0x1bbc('0xe')](_0x1bbc('0x16'),_0x538c4c,JSON[_0x1bbc('0x10')](_0x353e4c));_0x45f470(_0x353e4c);})[_0x1bbc('0x15')](function(_0x3b3078){logger[_0x1bbc('0x11')](_0x1bbc('0x16'),_0x3b3078[_0x1bbc('0x13')],_0x538c4c);_0x7b05af(_0x152212[_0x1bbc('0x11')](0x1f4,_0x3b3078[_0x1bbc('0x13')]));});});};exports['ShowCmHopper']=function(_0x5a33dc){var _0x10bd88=this;return new Promise(function(_0x4a9ddf,_0x22c4c3){return db['CmHopper']['find']({'raw':_0x5a33dc[_0x1bbc('0x17')]?_0x5a33dc[_0x1bbc('0x17')][_0x1bbc('0x18')]===undefined?!![]:![]:!![],'where':_0x5a33dc[_0x1bbc('0x17')]?_0x5a33dc[_0x1bbc('0x17')][_0x1bbc('0x19')]||null:null,'attributes':_0x5a33dc['options']?_0x5a33dc[_0x1bbc('0x17')][_0x1bbc('0x1a')]||null:null,'include':_0x5a33dc['options']?_0x5a33dc['options'][_0x1bbc('0x1c')]?_[_0x1bbc('0x1e')](_0x5a33dc[_0x1bbc('0x17')][_0x1bbc('0x1c')],function(_0x5f157d){return{'model':db[_0x5f157d[_0x1bbc('0x1d')]],'as':_0x5f157d['as'],'attributes':_0x5f157d[_0x1bbc('0x1a')],'include':_0x5f157d[_0x1bbc('0x1c')]?_[_0x1bbc('0x1e')](_0x5f157d[_0x1bbc('0x1c')],function(_0xc9cf32){return{'model':db[_0xc9cf32[_0x1bbc('0x1d')]],'as':_0xc9cf32['as'],'attributes':_0xc9cf32[_0x1bbc('0x1a')],'include':_0xc9cf32['include']?_['map'](_0xc9cf32[_0x1bbc('0x1c')],function(_0xbd36b){return{'model':db[_0xbd36b[_0x1bbc('0x1d')]],'as':_0xbd36b['as'],'attributes':_0xbd36b[_0x1bbc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1bbc('0xa')](function(_0x38cd4a){logger[_0x1bbc('0xb')]('ShowCmHopper',_0x5a33dc);logger[_0x1bbc('0xe')](_0x1bbc('0x1f'),_0x5a33dc,JSON['stringify'](_0x38cd4a));_0x4a9ddf(_0x38cd4a);})[_0x1bbc('0x15')](function(_0x52c5f7){logger['error'](_0x1bbc('0x1f'),_0x52c5f7[_0x1bbc('0x13')],_0x5a33dc);_0x22c4c3(_0x10bd88[_0x1bbc('0x11')](0x1f4,_0x52c5f7['message']));});});};exports[_0x1bbc('0x20')]=function(_0x59f5d7){var _0x4011c9=this;return new Promise(function(_0x3d5935,_0x1006b2){return db[_0x1bbc('0x21')][_0x1bbc('0x22')](_0x59f5d7['body'],{'raw':_0x59f5d7[_0x1bbc('0x17')]?_0x59f5d7[_0x1bbc('0x17')][_0x1bbc('0x18')]===undefined?!![]:![]:!![]})[_0x1bbc('0xa')](function(_0x1b4e0f){logger[_0x1bbc('0xb')]('CreateCmHopper',_0x59f5d7);logger['debug'](_0x1bbc('0x20'),_0x59f5d7,JSON[_0x1bbc('0x10')](_0x1b4e0f));_0x3d5935(_0x1b4e0f);})[_0x1bbc('0x15')](function(_0x3ce2e4){logger[_0x1bbc('0x11')]('CreateCmHopper',_0x3ce2e4[_0x1bbc('0x13')],_0x59f5d7);_0x1006b2(_0x4011c9['error'](0x1f4,_0x3ce2e4[_0x1bbc('0x13')]));});});};exports[_0x1bbc('0x23')]=function(_0x107b3f){var _0x25e150=this;return new Promise(function(_0x3d43e3,_0x3b2d8d){return db[_0x1bbc('0x21')][_0x1bbc('0x24')](_0x107b3f[_0x1bbc('0x25')],{'raw':_0x107b3f[_0x1bbc('0x17')]?_0x107b3f[_0x1bbc('0x17')][_0x1bbc('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x107b3f[_0x1bbc('0x17')]?_0x107b3f[_0x1bbc('0x17')][_0x1bbc('0x19')]||null:null,'attributes':_0x107b3f[_0x1bbc('0x17')]?_0x107b3f[_0x1bbc('0x17')][_0x1bbc('0x1a')]||null:null,'limit':_0x107b3f['options']?_0x107b3f[_0x1bbc('0x17')][_0x1bbc('0x1b')]||null:null})[_0x1bbc('0xa')](function(_0x74016c){logger['info'](_0x1bbc('0x23'),_0x107b3f);logger[_0x1bbc('0xe')](_0x1bbc('0x23'),_0x107b3f,JSON['stringify'](_0x74016c));_0x3d43e3(_0x74016c);})[_0x1bbc('0x15')](function(_0x630711){logger[_0x1bbc('0x11')](_0x1bbc('0x23'),_0x630711[_0x1bbc('0x13')],_0x107b3f);_0x3b2d8d(_0x25e150[_0x1bbc('0x11')](0x1f4,_0x630711[_0x1bbc('0x13')]));});});};exports[_0x1bbc('0x26')]=function(_0x166b04){var _0x37f6da=this;return new Promise(function(_0x4b5964,_0x4b9b03){return db['CmHopper'][_0x1bbc('0x27')]({'where':_0x166b04[_0x1bbc('0x17')]?_0x166b04[_0x1bbc('0x17')]['where']||null:null})[_0x1bbc('0xa')](function(_0x199d85){logger['info'](_0x1bbc('0x26'),_0x166b04);logger['debug'](_0x1bbc('0x26'),_0x166b04,JSON[_0x1bbc('0x10')](_0x199d85));_0x4b5964(_0x199d85);})[_0x1bbc('0x15')](function(_0x320d4a){logger[_0x1bbc('0x11')](_0x1bbc('0x26'),_0x320d4a[_0x1bbc('0x13')],_0x166b04);_0x4b9b03(_0x37f6da['error'](0x1f4,_0x320d4a['message']));});});};exports[_0x1bbc('0x28')]=function(_0x5cf99f){var _0x2d346f=this;return new Promise(function(_0x42aaea,_0x4de0df){return db[_0x1bbc('0x29')][_0x1bbc('0x2a')]()['then'](function(_0x1f1231){return db[_0x1bbc('0x2b')][_0x1bbc('0x2c')](function(_0x290595){return db[_0x1bbc('0x21')][_0x1bbc('0x2d')]({'where':_0x5cf99f[_0x1bbc('0x17')]?_0x5cf99f['options'][_0x1bbc('0x19')]||null:null,'attributes':_0x5cf99f[_0x1bbc('0x17')]?_0x5cf99f[_0x1bbc('0x17')]['attributes']||null:null,'limit':_0x5cf99f['options']?_0x5cf99f[_0x1bbc('0x17')][_0x1bbc('0x1b')]||null:null,'order':_0x5cf99f[_0x1bbc('0x17')]?_0x5cf99f[_0x1bbc('0x17')][_0x1bbc('0x2e')]||null:null,'transaction':_0x290595,'lock':_0x290595['LOCK']['UPDATE'],'include':[{'model':db[_0x1bbc('0x29')],'as':_0x1bbc('0x2f'),'attributes':_['keys'](_0x1f1231)}]})[_0x1bbc('0xa')](function(_0x49191c){var _0x44544f=[];for(var _0x151e40=0x0;_0x151e40<_0x49191c[_0x1bbc('0x30')];_0x151e40+=0x1){_0x44544f[_0x1bbc('0x31')](_0x49191c[_0x151e40]['update'](_0x5cf99f[_0x1bbc('0x25')],{'transaction':_0x290595}));}return BPromise[_0x1bbc('0x32')](_0x44544f);});})[_0x1bbc('0xa')](function(_0xbb1200){logger['info']('GetContactDialer',_0x5cf99f);logger[_0x1bbc('0xe')](_0x1bbc('0x28'),_0x5cf99f,JSON[_0x1bbc('0x10')](_0xbb1200));_0x42aaea(_0xbb1200);})['catch'](function(_0x4dfc44){logger['error']('GetContactDialer',_0x4dfc44['message'],_0x5cf99f);_0x4de0df(_0x2d346f[_0x1bbc('0x11')](0x1f4,_0x4dfc44[_0x1bbc('0x13')]));});});});};exports[_0x1bbc('0x33')]=function(_0x46d488){var _0x56b3d6=this;return new Promise(function(_0x108f0c,_0x28ea5e){return db[_0x1bbc('0x2b')][_0x1bbc('0x2c')](function(_0x4269a7){return db[_0x1bbc('0x34')][_0x1bbc('0x22')](_0x46d488[_0x1bbc('0x25')],{'raw':_0x46d488[_0x1bbc('0x17')]?_0x46d488[_0x1bbc('0x17')][_0x1bbc('0x18')]===undefined?!![]:![]:!![],'transaction':_0x4269a7})[_0x1bbc('0xa')](function(){return db['CmHopper'][_0x1bbc('0x27')]({'where':_0x46d488['options']?_0x46d488['options'][_0x1bbc('0x19')]||null:null,'transaction':_0x4269a7});});})[_0x1bbc('0xa')](function(_0x5ca877){logger[_0x1bbc('0xb')](_0x1bbc('0x33'),_0x46d488);logger[_0x1bbc('0xe')](_0x1bbc('0x33'),_0x46d488,JSON[_0x1bbc('0x10')](_0x5ca877));_0x108f0c(_0x5ca877);})[_0x1bbc('0x15')](function(_0x17bb87){logger[_0x1bbc('0x11')](_0x1bbc('0x33'),_0x17bb87[_0x1bbc('0x13')],_0x46d488);_0x28ea5e(_0x56b3d6[_0x1bbc('0x11')](0x1f4,_0x17bb87[_0x1bbc('0x13')]));});});};exports[_0x1bbc('0x35')]=function(_0x523966){var _0x3cb821=this;return new Promise(function(_0x513f07,_0x3523b5){return db[_0x1bbc('0x21')][_0x1bbc('0x2d')]({'raw':_0x523966[_0x1bbc('0x17')]?_0x523966['options'][_0x1bbc('0x18')]===undefined?!![]:![]:!![],'where':_0x523966[_0x1bbc('0x17')]?_0x523966[_0x1bbc('0x17')][_0x1bbc('0x19')]||null:null,'attributes':[[db[_0x1bbc('0x2b')]['fn'](_0x1bbc('0x36'),db[_0x1bbc('0x2b')]['fn']('IF',db['sequelize']['literal']('`scheduledat`\x20>=\x20'+util['format']('\x22%s\x22',moment()[_0x1bbc('0x37')](_0x1bbc('0x38')))+_0x1bbc('0x39')))),_0x1bbc('0x3a')]]})[_0x1bbc('0xa')](function(_0x316ef2){logger[_0x1bbc('0xb')](_0x1bbc('0x35'),_0x523966);logger[_0x1bbc('0xe')](_0x1bbc('0x35'),_0x523966,JSON[_0x1bbc('0x10')](_0x316ef2));_0x513f07(_0x316ef2);})[_0x1bbc('0x15')](function(_0x367165){logger[_0x1bbc('0x11')](_0x1bbc('0x35'),_0x367165[_0x1bbc('0x13')],_0x523966);_0x3523b5(_0x3cb821[_0x1bbc('0x11')](0x1f4,_0x367165[_0x1bbc('0x13')]));});});};exports[_0x1bbc('0x3b')]=function(_0x53b1a7){var _0x1b00c5=this;return new Promise(function(_0x2c38f1,_0x1d69e8){return db[_0x1bbc('0x29')]['describe']()[_0x1bbc('0xa')](function(_0x5c3777){return db['sequelize'][_0x1bbc('0x2c')](function(_0x4897ab){return db[_0x1bbc('0x21')][_0x1bbc('0x2d')]({'where':_0x53b1a7[_0x1bbc('0x17')]?_0x53b1a7[_0x1bbc('0x17')][_0x1bbc('0x19')]||null:null,'attributes':_0x53b1a7[_0x1bbc('0x17')]?_0x53b1a7['options'][_0x1bbc('0x1a')]||null:null,'limit':0x1,'order':_0x53b1a7[_0x1bbc('0x17')]?_0x53b1a7[_0x1bbc('0x17')][_0x1bbc('0x2e')]||null:null,'group':db[_0x1bbc('0x21')][_0x1bbc('0x3c')],'transaction':_0x4897ab,'lock':_0x4897ab[_0x1bbc('0x3d')][_0x1bbc('0x3e')],'include':_0x53b1a7[_0x1bbc('0x17')]?_0x53b1a7[_0x1bbc('0x17')]['include']?_[_0x1bbc('0x1e')](_0x53b1a7[_0x1bbc('0x17')][_0x1bbc('0x1c')],function(_0x538244){return{'model':db[_0x538244[_0x1bbc('0x1d')]],'as':_0x538244['as'],'attributes':_0x538244[_0x1bbc('0x1a')],'include':_0x538244[_0x1bbc('0x1c')]?_[_0x1bbc('0x1e')](_0x538244[_0x1bbc('0x1c')],function(_0x504d2d){return{'model':db[_0x504d2d[_0x1bbc('0x1d')]],'as':_0x504d2d['as'],'attributes':_0x504d2d[_0x1bbc('0x1a')],'include':_0x504d2d[_0x1bbc('0x1c')]?_[_0x1bbc('0x1e')](_0x504d2d[_0x1bbc('0x1c')],function(_0xd84398){return{'model':db[_0xd84398[_0x1bbc('0x1d')]],'as':_0xd84398['as'],'attributes':_0xd84398['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x23ae29){var _0x1cbff2=[];for(var _0x4055f9=0x0;_0x4055f9<_0x23ae29['length'];_0x4055f9+=0x1){_0x1cbff2[_0x1bbc('0x31')](_0x23ae29[_0x4055f9][_0x1bbc('0x24')](_0x53b1a7[_0x1bbc('0x25')],{'transaction':_0x4897ab}));}return BPromise[_0x1bbc('0x32')](_0x1cbff2);});})['then'](function(_0x34d6fe){logger[_0x1bbc('0xb')](_0x1bbc('0x3b'),_0x53b1a7);logger['debug'](_0x1bbc('0x3b'),_0x53b1a7,JSON['stringify'](_0x34d6fe));_0x2c38f1(_0x34d6fe);})[_0x1bbc('0x15')](function(_0x528bc8){logger['error'](_0x1bbc('0x3b'),_0x528bc8[_0x1bbc('0x13')],_0x53b1a7);_0x1d69e8(_0x1b00c5[_0x1bbc('0x11')](0x1f4,_0x528bc8['message']));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 0248b37..7948afb 100644 --- a/server/api/cmHopper/index.js +++ b/server/api/cmHopper/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','describe','/opencontacts','/:id','post','/preview','getPreview','put','delete'];(function(_0x590ae3,_0x1a2e81){var _0x40f256=function(_0x5e7959){while(--_0x5e7959){_0x590ae3['push'](_0x590ae3['shift']());}};_0x40f256(++_0x1a2e81);}(_0x7a54,0x106));var _0x47a5=function(_0x31de76,_0x2f13c1){_0x31de76=_0x31de76-0x0;var _0x23edd7=_0x7a54[_0x31de76];return _0x23edd7;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['getOpenContacts']);router['get'](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x47a5('0xd')](_0x47a5('0xe'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['update']);router[_0x47a5('0x11')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router; \ No newline at end of file +var _0x9957=['/:id','show','post','/preview','getPreview','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./cmHopper.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0x10')](_0x7995('0x11'),auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x13')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x15')](_0x7995('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index da8b859..68f13e3 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 _0xdf41=['sequelize','exports','STRING','contactListQueue','INTEGER','moment'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xdf41,0x1d3));var _0x1df4=function(_0xd60857,_0x1aa733){_0xd60857=_0xd60857-0x0;var _0x516870=_0xdf41[_0xd60857];return _0x516870;};'use strict';var moment=require(_0x1df4('0x0'));var Sequelize=require(_0x1df4('0x1'));module[_0x1df4('0x2')]={'phone':{'type':Sequelize[_0x1df4('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x1df4('0x4')},'ListId':{'type':Sequelize[_0x1df4('0x5')],'unique':_0x1df4('0x4')},'VoiceQueueId':{'type':Sequelize[_0x1df4('0x5')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x71a7=['moment','sequelize','exports','INTEGER','contactListQueue'];(function(_0x1543fd,_0x385ec4){var _0x1ee883=function(_0x32f7e3){while(--_0x32f7e3){_0x1543fd['push'](_0x1543fd['shift']());}};_0x1ee883(++_0x385ec4);}(_0x71a7,0x1db));var _0x771a=function(_0x2193cc,_0x1f9e4b){_0x2193cc=_0x2193cc-0x0;var _0x143fa4=_0x71a7[_0x2193cc];return _0x143fa4;};'use strict';var moment=require(_0x771a('0x0'));var Sequelize=require(_0x771a('0x1'));module[_0x771a('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x771a('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x771a('0x3')],'unique':_0x771a('0x4')},'VoiceQueueId':{'type':Sequelize[_0x771a('0x3')],'unique':_0x771a('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 796966f..ddef12d 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 _0x0d19=['query','attributes','model','fields','length','nolimit','sort','where','filters','pick','filter','key','VIRTUAL','field','merge','options','count','includeAll','include','findAll','rows','show','params','intersection','catch','update','body','find','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','CmHopperBlack','rawAttributes','keys'];(function(_0x3c3930,_0x56f942){var _0x2fc3d1=function(_0x1b99d2){while(--_0x1b99d2){_0x3c3930['push'](_0x3c3930['shift']());}};_0x2fc3d1(++_0x56f942);}(_0x0d19,0xb0));var _0x90d1=function(_0x567d,_0x2f8123){_0x567d=_0x567d-0x0;var _0x3b7a37=_0x0d19[_0x567d];return _0x3b7a37;};'use strict';var pdf=require(_0x90d1('0x0'));var emlformat=require(_0x90d1('0x1'));var rimraf=require(_0x90d1('0x2'));var zipdir=require(_0x90d1('0x3'));var jsonpatch=require(_0x90d1('0x4'));var rp=require(_0x90d1('0x5'));var moment=require(_0x90d1('0x6'));var BPromise=require(_0x90d1('0x7'));var Mustache=require(_0x90d1('0x8'));var util=require('util');var path=require('path');var sox=require(_0x90d1('0x9'));var csv=require(_0x90d1('0xa'));var ejs=require(_0x90d1('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x90d1('0xc'));var crypto=require(_0x90d1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x90d1('0xe'));var toCsv=require(_0x90d1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x90d1('0xf'));var authService=require(_0x90d1('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x90d1('0x11'));var logger=require(_0x90d1('0x12'))(_0x90d1('0x13'));var utils=require(_0x90d1('0x14'));var config=require(_0x90d1('0x15'));var db=require(_0x90d1('0x16'))['db'];function respondWithStatusCode(_0x246248,_0xd06126){_0xd06126=_0xd06126||0xcc;return function(_0x5959bb){if(_0x5959bb){return _0x246248[_0x90d1('0x17')](_0xd06126);}return _0x246248[_0x90d1('0x18')](_0xd06126)[_0x90d1('0x19')]();};}function respondWithResult(_0x5837a9,_0x2828ba){_0x2828ba=_0x2828ba||0xc8;return function(_0x4644eb){if(_0x4644eb){return _0x5837a9[_0x90d1('0x18')](_0x2828ba)[_0x90d1('0x1a')](_0x4644eb);}};}function respondWithFilteredResult(_0x3f37f0,_0x2b560){return function(_0x314d38){if(_0x314d38){var _0x2fc619=_0x314d38['count'],_0x290196=_0x2b560[_0x90d1('0x1b')],_0x352da1=_0x2b560[_0x90d1('0x1b')]+_0x2b560[_0x90d1('0x1c')],_0x2b413f;if(_0x352da1>=_0x2fc619){_0x352da1=_0x2fc619;_0x2b413f=0xc8;}else{_0x2b413f=0xce;}_0x3f37f0[_0x90d1('0x18')](_0x2b413f);return _0x3f37f0[_0x90d1('0x1d')](_0x90d1('0x1e'),_0x290196+'-'+_0x352da1+'/'+_0x2fc619)['json'](_0x314d38);}return null;};}function patchUpdates(_0x24f698){return function(_0x56fed1){try{jsonpatch[_0x90d1('0x1f')](_0x56fed1,_0x24f698,!![]);}catch(_0x1e8e21){return BPromise[_0x90d1('0x20')](_0x1e8e21);}return _0x56fed1[_0x90d1('0x21')]();};}function saveUpdates(_0x48bb31,_0x71b74a){return function(_0x5593ab){if(_0x5593ab){return _0x5593ab['update'](_0x48bb31)['then'](function(_0x51714a){return _0x51714a;});}return null;};}function removeEntity(_0x537db6,_0x57248a){return function(_0x5a2ced){if(_0x5a2ced){return _0x5a2ced['destroy']()[_0x90d1('0x22')](function(){_0x537db6[_0x90d1('0x18')](0xcc)[_0x90d1('0x19')]();});}};}function handleEntityNotFound(_0x6f7889,_0x1e2063){return function(_0x103238){if(!_0x103238){_0x6f7889[_0x90d1('0x17')](0x194);}return _0x103238;};}function handleError(_0x15311d,_0x5d0d78){_0x5d0d78=_0x5d0d78||0x1f4;return function(_0x10acf2){logger[_0x90d1('0x23')](_0x10acf2[_0x90d1('0x24')]);if(_0x10acf2['name']){delete _0x10acf2[_0x90d1('0x25')];}_0x15311d[_0x90d1('0x18')](_0x5d0d78)[_0x90d1('0x26')](_0x10acf2);};}exports[_0x90d1('0x27')]=function(_0x3cc65c,_0x3f7ed3){var _0x4c3005={},_0x1c731a={},_0x40c989={'count':0x0,'rows':[]};var _0xe7b463=db[_0x90d1('0x28')][_0x90d1('0x29')];_0x1c731a['model']=_[_0x90d1('0x2a')](_0xe7b463);_0x1c731a[_0x90d1('0x2b')]=_['keys'](_0x3cc65c['query']);_0x1c731a['filters']=_['intersection'](_0x1c731a['model'],_0x1c731a['query']);_0x4c3005[_0x90d1('0x2c')]=_['intersection'](_0x1c731a[_0x90d1('0x2d')],qs[_0x90d1('0x2e')](_0x3cc65c[_0x90d1('0x2b')][_0x90d1('0x2e')]));_0x4c3005['attributes']=_0x4c3005['attributes'][_0x90d1('0x2f')]?_0x4c3005[_0x90d1('0x2c')]:_0x1c731a[_0x90d1('0x2d')];if(!_0x3cc65c[_0x90d1('0x2b')]['hasOwnProperty'](_0x90d1('0x30'))){_0x4c3005[_0x90d1('0x1c')]=qs['limit'](_0x3cc65c[_0x90d1('0x2b')][_0x90d1('0x1c')]);_0x4c3005[_0x90d1('0x1b')]=qs[_0x90d1('0x1b')](_0x3cc65c[_0x90d1('0x2b')][_0x90d1('0x1b')]);}_0x4c3005['order']=qs[_0x90d1('0x31')](_0x3cc65c[_0x90d1('0x2b')]['sort']);_0x4c3005[_0x90d1('0x32')]=qs[_0x90d1('0x33')](_[_0x90d1('0x34')](_0x3cc65c[_0x90d1('0x2b')],_0x1c731a[_0x90d1('0x33')]));if(_0x3cc65c[_0x90d1('0x2b')][_0x90d1('0x35')]){_0x4c3005['where']=_['merge'](_0x4c3005[_0x90d1('0x32')],{'$or':_['map'](_0xe7b463,function(_0x180a9c){if(_0x180a9c['type'][_0x90d1('0x36')]!==_0x90d1('0x37')){var _0x4b28a2={};_0x4b28a2[_0x180a9c[_0x90d1('0x38')]]={'$like':'%'+_0x3cc65c[_0x90d1('0x2b')][_0x90d1('0x35')]+'%'};return _0x4b28a2;}})});}_0x4c3005=_[_0x90d1('0x39')]({},_0x4c3005,_0x3cc65c[_0x90d1('0x3a')]);var _0x1184e7={'where':_0x4c3005[_0x90d1('0x32')]};return db[_0x90d1('0x28')][_0x90d1('0x3b')](_0x1184e7)[_0x90d1('0x22')](function(_0x332ad5){_0x40c989['count']=_0x332ad5;if(_0x3cc65c['query'][_0x90d1('0x3c')]){_0x4c3005[_0x90d1('0x3d')]=[{'all':!![]}];}return db[_0x90d1('0x28')][_0x90d1('0x3e')](_0x4c3005);})['then'](function(_0x168873){_0x40c989[_0x90d1('0x3f')]=_0x168873;return _0x40c989;})[_0x90d1('0x22')](respondWithFilteredResult(_0x3f7ed3,_0x4c3005))['catch'](handleError(_0x3f7ed3,null));};exports[_0x90d1('0x40')]=function(_0x58a741,_0x4756d7){var _0x5b7e31={'raw':!![],'where':{'id':_0x58a741[_0x90d1('0x41')]['id']}},_0x478c83={};_0x478c83[_0x90d1('0x2d')]=_[_0x90d1('0x2a')](db[_0x90d1('0x28')][_0x90d1('0x29')]);_0x478c83[_0x90d1('0x2b')]=_['keys'](_0x58a741[_0x90d1('0x2b')]);_0x478c83['filters']=_[_0x90d1('0x42')](_0x478c83[_0x90d1('0x2d')],_0x478c83['query']);_0x5b7e31['attributes']=_[_0x90d1('0x42')](_0x478c83[_0x90d1('0x2d')],qs['fields'](_0x58a741[_0x90d1('0x2b')][_0x90d1('0x2e')]));_0x5b7e31[_0x90d1('0x2c')]=_0x5b7e31['attributes'][_0x90d1('0x2f')]?_0x5b7e31[_0x90d1('0x2c')]:_0x478c83[_0x90d1('0x2d')];if(_0x58a741[_0x90d1('0x2b')][_0x90d1('0x3c')]){_0x5b7e31[_0x90d1('0x3d')]=[{'all':!![]}];}_0x5b7e31=_[_0x90d1('0x39')]({},_0x5b7e31,_0x58a741['options']);return db['CmHopperBlack']['find'](_0x5b7e31)[_0x90d1('0x22')](handleEntityNotFound(_0x4756d7,null))[_0x90d1('0x22')](respondWithResult(_0x4756d7,null))[_0x90d1('0x43')](handleError(_0x4756d7,null));};exports[_0x90d1('0x44')]=function(_0x4fe97a,_0x4cd8f0){if(_0x4fe97a[_0x90d1('0x45')]['id']){delete _0x4fe97a[_0x90d1('0x45')]['id'];}return db[_0x90d1('0x28')][_0x90d1('0x46')]({'where':{'id':_0x4fe97a[_0x90d1('0x41')]['id']}})[_0x90d1('0x22')](handleEntityNotFound(_0x4cd8f0,null))['then'](saveUpdates(_0x4fe97a[_0x90d1('0x45')],null))[_0x90d1('0x22')](respondWithResult(_0x4cd8f0,null))[_0x90d1('0x43')](handleError(_0x4cd8f0,null));};exports[_0x90d1('0x47')]=function(_0x238acf,_0xf50b56){return db[_0x90d1('0x28')][_0x90d1('0x46')]({'where':{'id':_0x238acf[_0x90d1('0x41')]['id']}})[_0x90d1('0x22')](handleEntityNotFound(_0xf50b56,null))[_0x90d1('0x22')](removeEntity(_0xf50b56,null))[_0x90d1('0x43')](handleError(_0xf50b56,null));};exports[_0x90d1('0x48')]=function(_0x12b7fc,_0x67d38d){return db[_0x90d1('0x28')]['describe']()['then'](respondWithResult(_0x67d38d,null))['catch'](handleError(_0x67d38d,null));}; \ No newline at end of file +var _0xb3be=['reject','then','destroy','end','stack','name','index','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','where','filters','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','CmHopperBlack','rows','catch','show','params','include','find','update','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json'];(function(_0x225e67,_0x2acaa1){var _0x53f022=function(_0x5e2b61){while(--_0x5e2b61){_0x225e67['push'](_0x225e67['shift']());}};_0x53f022(++_0x2acaa1);}(_0xb3be,0xb4));var _0xeb3b=function(_0x2f9753,_0x409db0){_0x2f9753=_0x2f9753-0x0;var _0x316197=_0xb3be[_0x2f9753];return _0x316197;};'use strict';var pdf=require(_0xeb3b('0x0'));var emlformat=require(_0xeb3b('0x1'));var rimraf=require(_0xeb3b('0x2'));var zipdir=require(_0xeb3b('0x3'));var jsonpatch=require(_0xeb3b('0x4'));var rp=require(_0xeb3b('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeb3b('0x6'));var util=require(_0xeb3b('0x7'));var path=require(_0xeb3b('0x8'));var sox=require(_0xeb3b('0x9'));var csv=require(_0xeb3b('0xa'));var ejs=require(_0xeb3b('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xeb3b('0xc'));var crypto=require(_0xeb3b('0xd'));var jsforce=require(_0xeb3b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xeb3b('0xa'));var querystring=require(_0xeb3b('0xf'));var Papa=require(_0xeb3b('0x10'));var Redis=require('ioredis');var authService=require(_0xeb3b('0x11'));var qs=require(_0xeb3b('0x12'));var hardwareService=require(_0xeb3b('0x13'));var logger=require(_0xeb3b('0x14'))(_0xeb3b('0x15'));var utils=require(_0xeb3b('0x16'));var config=require(_0xeb3b('0x17'));var db=require(_0xeb3b('0x18'))['db'];function respondWithStatusCode(_0x23609b,_0x50bfb2){_0x50bfb2=_0x50bfb2||0xcc;return function(_0x4d8495){if(_0x4d8495){return _0x23609b[_0xeb3b('0x19')](_0x50bfb2);}return _0x23609b[_0xeb3b('0x1a')](_0x50bfb2)['end']();};}function respondWithResult(_0x4fd6d2,_0x1c60c7){_0x1c60c7=_0x1c60c7||0xc8;return function(_0x3be599){if(_0x3be599){return _0x4fd6d2[_0xeb3b('0x1a')](_0x1c60c7)['json'](_0x3be599);}};}function respondWithFilteredResult(_0xbec800,_0xc730b4){return function(_0x24a9fe){if(_0x24a9fe){var _0x157846=_0x24a9fe[_0xeb3b('0x1b')],_0x32db4c=_0xc730b4[_0xeb3b('0x1c')],_0x4dae27=_0xc730b4[_0xeb3b('0x1c')]+_0xc730b4[_0xeb3b('0x1d')],_0x39d340;if(_0x4dae27>=_0x157846){_0x4dae27=_0x157846;_0x39d340=0xc8;}else{_0x39d340=0xce;}_0xbec800[_0xeb3b('0x1a')](_0x39d340);return _0xbec800[_0xeb3b('0x1e')](_0xeb3b('0x1f'),_0x32db4c+'-'+_0x4dae27+'/'+_0x157846)[_0xeb3b('0x20')](_0x24a9fe);}return null;};}function patchUpdates(_0x44181d){return function(_0x554427){try{jsonpatch['apply'](_0x554427,_0x44181d,!![]);}catch(_0x5bfe2a){return BPromise[_0xeb3b('0x21')](_0x5bfe2a);}return _0x554427['save']();};}function saveUpdates(_0x1c79dc,_0x36e30a){return function(_0x142dee){if(_0x142dee){return _0x142dee['update'](_0x1c79dc)[_0xeb3b('0x22')](function(_0x4fbecb){return _0x4fbecb;});}return null;};}function removeEntity(_0x2020c7,_0x3b1b96){return function(_0x3273eb){if(_0x3273eb){return _0x3273eb[_0xeb3b('0x23')]()['then'](function(){_0x2020c7[_0xeb3b('0x1a')](0xcc)[_0xeb3b('0x24')]();});}};}function handleEntityNotFound(_0x108b31,_0x198500){return function(_0x469d3f){if(!_0x469d3f){_0x108b31['sendStatus'](0x194);}return _0x469d3f;};}function handleError(_0x306569,_0x5831f9){_0x5831f9=_0x5831f9||0x1f4;return function(_0x40d391){logger['error'](_0x40d391[_0xeb3b('0x25')]);if(_0x40d391[_0xeb3b('0x26')]){delete _0x40d391['name'];}_0x306569[_0xeb3b('0x1a')](_0x5831f9)['send'](_0x40d391);};}exports[_0xeb3b('0x27')]=function(_0x40a59f,_0x84373f){var _0x29ffb4={},_0x347144={},_0x1d1ead={'count':0x0,'rows':[]};var _0x27e6aa=db['CmHopperBlack'][_0xeb3b('0x28')];_0x347144[_0xeb3b('0x29')]=_['keys'](_0x27e6aa);_0x347144['query']=_[_0xeb3b('0x2a')](_0x40a59f[_0xeb3b('0x2b')]);_0x347144['filters']=_['intersection'](_0x347144['model'],_0x347144[_0xeb3b('0x2b')]);_0x29ffb4[_0xeb3b('0x2c')]=_[_0xeb3b('0x2d')](_0x347144[_0xeb3b('0x29')],qs['fields'](_0x40a59f[_0xeb3b('0x2b')][_0xeb3b('0x2e')]));_0x29ffb4['attributes']=_0x29ffb4[_0xeb3b('0x2c')][_0xeb3b('0x2f')]?_0x29ffb4['attributes']:_0x347144[_0xeb3b('0x29')];if(!_0x40a59f[_0xeb3b('0x2b')][_0xeb3b('0x30')]('nolimit')){_0x29ffb4[_0xeb3b('0x1d')]=qs['limit'](_0x40a59f['query'][_0xeb3b('0x1d')]);_0x29ffb4[_0xeb3b('0x1c')]=qs[_0xeb3b('0x1c')](_0x40a59f[_0xeb3b('0x2b')][_0xeb3b('0x1c')]);}_0x29ffb4[_0xeb3b('0x31')]=qs['sort'](_0x40a59f['query']['sort']);_0x29ffb4[_0xeb3b('0x32')]=qs[_0xeb3b('0x33')](_[_0xeb3b('0x34')](_0x40a59f[_0xeb3b('0x2b')],_0x347144[_0xeb3b('0x33')]));if(_0x40a59f[_0xeb3b('0x2b')][_0xeb3b('0x35')]){_0x29ffb4[_0xeb3b('0x32')]=_[_0xeb3b('0x36')](_0x29ffb4[_0xeb3b('0x32')],{'$or':_[_0xeb3b('0x37')](_0x27e6aa,function(_0x22bd31){if(_0x22bd31[_0xeb3b('0x38')][_0xeb3b('0x39')]!==_0xeb3b('0x3a')){var _0x4ea8a3={};_0x4ea8a3[_0x22bd31['field']]={'$like':'%'+_0x40a59f[_0xeb3b('0x2b')]['filter']+'%'};return _0x4ea8a3;}})});}_0x29ffb4=_[_0xeb3b('0x36')]({},_0x29ffb4,_0x40a59f[_0xeb3b('0x3b')]);var _0x2e45f8={'where':_0x29ffb4[_0xeb3b('0x32')]};return db['CmHopperBlack'][_0xeb3b('0x1b')](_0x2e45f8)[_0xeb3b('0x22')](function(_0x549687){_0x1d1ead[_0xeb3b('0x1b')]=_0x549687;if(_0x40a59f[_0xeb3b('0x2b')][_0xeb3b('0x3c')]){_0x29ffb4['include']=[{'all':!![]}];}return db[_0xeb3b('0x3d')]['findAll'](_0x29ffb4);})['then'](function(_0x339300){_0x1d1ead[_0xeb3b('0x3e')]=_0x339300;return _0x1d1ead;})[_0xeb3b('0x22')](respondWithFilteredResult(_0x84373f,_0x29ffb4))[_0xeb3b('0x3f')](handleError(_0x84373f,null));};exports[_0xeb3b('0x40')]=function(_0x3840e3,_0xcf9011){var _0x1d0e36={'raw':!![],'where':{'id':_0x3840e3[_0xeb3b('0x41')]['id']}},_0x20423b={};_0x20423b[_0xeb3b('0x29')]=_[_0xeb3b('0x2a')](db['CmHopperBlack']['rawAttributes']);_0x20423b[_0xeb3b('0x2b')]=_[_0xeb3b('0x2a')](_0x3840e3[_0xeb3b('0x2b')]);_0x20423b['filters']=_[_0xeb3b('0x2d')](_0x20423b[_0xeb3b('0x29')],_0x20423b[_0xeb3b('0x2b')]);_0x1d0e36['attributes']=_[_0xeb3b('0x2d')](_0x20423b[_0xeb3b('0x29')],qs[_0xeb3b('0x2e')](_0x3840e3[_0xeb3b('0x2b')]['fields']));_0x1d0e36[_0xeb3b('0x2c')]=_0x1d0e36[_0xeb3b('0x2c')][_0xeb3b('0x2f')]?_0x1d0e36[_0xeb3b('0x2c')]:_0x20423b[_0xeb3b('0x29')];if(_0x3840e3[_0xeb3b('0x2b')][_0xeb3b('0x3c')]){_0x1d0e36[_0xeb3b('0x42')]=[{'all':!![]}];}_0x1d0e36=_[_0xeb3b('0x36')]({},_0x1d0e36,_0x3840e3[_0xeb3b('0x3b')]);return db[_0xeb3b('0x3d')][_0xeb3b('0x43')](_0x1d0e36)['then'](handleEntityNotFound(_0xcf9011,null))['then'](respondWithResult(_0xcf9011,null))[_0xeb3b('0x3f')](handleError(_0xcf9011,null));};exports[_0xeb3b('0x44')]=function(_0x1263ac,_0x1d934e){if(_0x1263ac[_0xeb3b('0x45')]['id']){delete _0x1263ac[_0xeb3b('0x45')]['id'];}return db[_0xeb3b('0x3d')][_0xeb3b('0x43')]({'where':{'id':_0x1263ac[_0xeb3b('0x41')]['id']}})['then'](handleEntityNotFound(_0x1d934e,null))[_0xeb3b('0x22')](saveUpdates(_0x1263ac[_0xeb3b('0x45')],null))[_0xeb3b('0x22')](respondWithResult(_0x1d934e,null))['catch'](handleError(_0x1d934e,null));};exports[_0xeb3b('0x23')]=function(_0x454b9a,_0x3d85d0){return db['CmHopperBlack']['find']({'where':{'id':_0x454b9a[_0xeb3b('0x41')]['id']}})['then'](handleEntityNotFound(_0x3d85d0,null))[_0xeb3b('0x22')](removeEntity(_0x3d85d0,null))[_0xeb3b('0x3f')](handleError(_0x3d85d0,null));};exports['describe']=function(_0x5c3a3b,_0x5bfd5c){return db[_0xeb3b('0x3d')][_0xeb3b('0x46')]()[_0xeb3b('0x22')](respondWithResult(_0x5bfd5c,null))[_0xeb3b('0x3f')](handleError(_0x5bfd5c,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 1bb6453..a2a5b76 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 _0xb821=['rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','util','../../config/logger','bluebird'];(function(_0x19ca7a,_0x118508){var _0x321426=function(_0xa338b){while(--_0xa338b){_0x19ca7a['push'](_0x19ca7a['shift']());}};_0x321426(++_0x118508);}(_0xb821,0xa7));var _0x1b82=function(_0xfaf9e9,_0x54e675){_0xfaf9e9=_0xfaf9e9-0x0;var _0xc28fbf=_0xb821[_0xfaf9e9];return _0xc28fbf;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var logger=require(_0x1b82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1b82('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var attributes=require(_0x1b82('0x5'));module[_0x1b82('0x6')]=function(_0x597ca7,_0x3e27c4){return _0x597ca7[_0x1b82('0x7')](_0x1b82('0x8'),attributes,{'tableName':_0x1b82('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa41a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','cm_hopper_black','lodash','util','api'];(function(_0x371798,_0x53cfd0){var _0x3a8632=function(_0x125c91){while(--_0x125c91){_0x371798['push'](_0x371798['shift']());}};_0x3a8632(++_0x53cfd0);}(_0xa41a,0x6b));var _0xaa41=function(_0x3be7fb,_0x3f4f3f){_0x3be7fb=_0x3be7fb-0x0;var _0x2f6f14=_0xa41a[_0x3be7fb];return _0x2f6f14;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var logger=require('../../config/logger')(_0xaa41('0x2'));var moment=require(_0xaa41('0x3'));var BPromise=require(_0xaa41('0x4'));var rp=require(_0xaa41('0x5'));var fs=require('fs');var path=require(_0xaa41('0x6'));var rimraf=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var attributes=require(_0xaa41('0x9'));module['exports']=function(_0x2122a0,_0x1ec9d4){return _0x2122a0['define']('CmHopperBlack',attributes,{'tableName':_0xaa41('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 76f40c9..7be173c 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 _0xb24a=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperBlack,\x20%s,\x20%s','message','info','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','attributes','include','map','model','then','debug','UpdateCmHopperBlack','update','where','limit','DestroyCmHopperBlack','destroy','lodash','util'];(function(_0x3b6126,_0x41b9ed){var _0x11f68a=function(_0x55e6e2){while(--_0x55e6e2){_0x3b6126['push'](_0x3b6126['shift']());}};_0x11f68a(++_0x41b9ed);}(_0xb24a,0x76));var _0xab24=function(_0x5e07a7,_0x1438b3){_0x5e07a7=_0x5e07a7-0x0;var _0x22ced5=_0xb24a[_0x5e07a7];return _0x22ced5;};'use strict';var _=require(_0xab24('0x0'));var util=require(_0xab24('0x1'));var moment=require(_0xab24('0x2'));var BPromise=require(_0xab24('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xab24('0x4'));var db=require(_0xab24('0x5'))['db'];var utils=require(_0xab24('0x6'));var logger=require(_0xab24('0x7'))(_0xab24('0x8'));var config=require(_0xab24('0x9'));var jayson=require(_0xab24('0xa'));var client=jayson[_0xab24('0xb')][_0xab24('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x44e61c,_0x5c310f,_0x4072fa){return new BPromise(function(_0x353635,_0x16fea7){return client[_0xab24('0xd')](_0x44e61c,_0x4072fa)['then'](function(_0x4a1ed5){logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x5c310f,_0xab24('0xe'));logger['debug'](_0xab24('0xf'),_0x5c310f,_0xab24('0xe'),JSON[_0xab24('0x10')](_0x4a1ed5));if(_0x4a1ed5['error']){if(_0x4a1ed5[_0xab24('0x11')]['code']===0x1f4){logger[_0xab24('0x11')](_0xab24('0x12'),_0x5c310f,_0x4a1ed5['error'][_0xab24('0x13')]);return _0x16fea7(_0x4a1ed5[_0xab24('0x11')]['message']);}logger[_0xab24('0x11')](_0xab24('0x12'),_0x5c310f,_0x4a1ed5[_0xab24('0x11')][_0xab24('0x13')]);return _0x353635(_0x4a1ed5[_0xab24('0x11')][_0xab24('0x13')]);}else{logger[_0xab24('0x14')](_0xab24('0x12'),_0x5c310f,_0xab24('0xe'));_0x353635(_0x4a1ed5[_0xab24('0x15')]['message']);}})[_0xab24('0x16')](function(_0x59f32e){logger[_0xab24('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x5c310f,_0x59f32e);_0x16fea7(_0x59f32e);});});}exports[_0xab24('0x17')]=function(_0x82dfbb){var _0xcb1793=this;return new Promise(function(_0x319fde,_0xc4d146){return db[_0xab24('0x18')][_0xab24('0x19')]({'raw':_0x82dfbb[_0xab24('0x1a')]?_0x82dfbb[_0xab24('0x1a')][_0xab24('0x1b')]===undefined?!![]:![]:!![],'where':_0x82dfbb[_0xab24('0x1a')]?_0x82dfbb[_0xab24('0x1a')]['where']||null:null,'attributes':_0x82dfbb[_0xab24('0x1a')]?_0x82dfbb[_0xab24('0x1a')][_0xab24('0x1c')]||null:null,'limit':_0x82dfbb[_0xab24('0x1a')]?_0x82dfbb[_0xab24('0x1a')]['limit']||null:null,'include':_0x82dfbb[_0xab24('0x1a')]?_0x82dfbb[_0xab24('0x1a')][_0xab24('0x1d')]?_[_0xab24('0x1e')](_0x82dfbb[_0xab24('0x1a')]['include'],function(_0x3ef2ce){return{'model':db[_0x3ef2ce[_0xab24('0x1f')]],'as':_0x3ef2ce['as'],'attributes':_0x3ef2ce[_0xab24('0x1c')],'include':_0x3ef2ce[_0xab24('0x1d')]?_[_0xab24('0x1e')](_0x3ef2ce['include'],function(_0x337b44){return{'model':db[_0x337b44[_0xab24('0x1f')]],'as':_0x337b44['as'],'attributes':_0x337b44[_0xab24('0x1c')],'include':_0x337b44[_0xab24('0x1d')]?_['map'](_0x337b44[_0xab24('0x1d')],function(_0x4ac251){return{'model':db[_0x4ac251[_0xab24('0x1f')]],'as':_0x4ac251['as'],'attributes':_0x4ac251['attributes']};}):[]};}):[]};}):[]:[]})[_0xab24('0x20')](function(_0x37ecb0){logger[_0xab24('0x14')](_0xab24('0x17'),_0x82dfbb);logger[_0xab24('0x21')](_0xab24('0x17'),_0x82dfbb,JSON[_0xab24('0x10')](_0x37ecb0));_0x319fde(_0x37ecb0);})[_0xab24('0x16')](function(_0x46edeb){logger[_0xab24('0x11')](_0xab24('0x17'),_0x46edeb[_0xab24('0x13')],_0x82dfbb);_0xc4d146(_0xcb1793[_0xab24('0x11')](0x1f4,_0x46edeb[_0xab24('0x13')]));});});};exports[_0xab24('0x22')]=function(_0x37bc81){var _0x15fde2=this;return new Promise(function(_0x535b76,_0x1b2f08){return db[_0xab24('0x18')][_0xab24('0x23')](_0x37bc81['body'],{'raw':_0x37bc81[_0xab24('0x1a')]?_0x37bc81[_0xab24('0x1a')][_0xab24('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37bc81[_0xab24('0x1a')]?_0x37bc81[_0xab24('0x1a')][_0xab24('0x24')]||null:null,'attributes':_0x37bc81[_0xab24('0x1a')]?_0x37bc81[_0xab24('0x1a')][_0xab24('0x1c')]||null:null,'limit':_0x37bc81['options']?_0x37bc81[_0xab24('0x1a')][_0xab24('0x25')]||null:null})['then'](function(_0x133218){logger[_0xab24('0x14')]('UpdateCmHopperBlack',_0x37bc81);logger[_0xab24('0x21')](_0xab24('0x22'),_0x37bc81,JSON['stringify'](_0x133218));_0x535b76(_0x133218);})[_0xab24('0x16')](function(_0x37744d){logger[_0xab24('0x11')](_0xab24('0x22'),_0x37744d[_0xab24('0x13')],_0x37bc81);_0x1b2f08(_0x15fde2[_0xab24('0x11')](0x1f4,_0x37744d[_0xab24('0x13')]));});});};exports[_0xab24('0x26')]=function(_0x22629a){var _0xec8767=this;return new Promise(function(_0xb61a42,_0x2b0c56){return db['CmHopperBlack'][_0xab24('0x27')]({'where':_0x22629a[_0xab24('0x1a')]?_0x22629a['options']['where']||null:null})[_0xab24('0x20')](function(_0x1a1fbe){logger[_0xab24('0x14')](_0xab24('0x26'),_0x22629a);logger['debug']('DestroyCmHopperBlack',_0x22629a,JSON[_0xab24('0x10')](_0x1a1fbe));_0xb61a42(_0x1a1fbe);})[_0xab24('0x16')](function(_0x356bd4){logger[_0xab24('0x11')](_0xab24('0x26'),_0x356bd4['message'],_0x22629a);_0x2b0c56(_0xec8767[_0xab24('0x11')](0x1f4,_0x356bd4['message']));});});}; \ No newline at end of file +var _0x222b=['catch','UpdateCmHopperBlack','CmHopperBlack','body','destroy','DestroyCmHopperBlack','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','GetCmHopperBlack','findAll','options','raw','where','attributes','limit','include','model','map','debug'];(function(_0xca01f2,_0x185e0a){var _0x5ade2d=function(_0x39563b){while(--_0x39563b){_0xca01f2['push'](_0xca01f2['shift']());}};_0x5ade2d(++_0x185e0a);}(_0x222b,0x10e));var _0xb222=function(_0x280bef,_0x5e1bd3){_0x280bef=_0x280bef-0x0;var _0x56dc85=_0x222b[_0x280bef];return _0x56dc85;};'use strict';var _=require(_0xb222('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb222('0x1'));var rs=require(_0xb222('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb222('0x3'))['db'];var utils=require(_0xb222('0x4'));var logger=require('../../config/logger')(_0xb222('0x5'));var config=require('../../config/environment');var jayson=require(_0xb222('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x24181b,_0x162c64,_0x1a56c8){return new BPromise(function(_0x2f13a9,_0x43225b){return client[_0xb222('0x7')](_0x24181b,_0x1a56c8)[_0xb222('0x8')](function(_0x46a25c){logger['info'](_0xb222('0x9'),_0x162c64,_0xb222('0xa'));logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x162c64,'request\x20sent',JSON[_0xb222('0xb')](_0x46a25c));if(_0x46a25c[_0xb222('0xc')]){if(_0x46a25c[_0xb222('0xc')][_0xb222('0xd')]===0x1f4){logger[_0xb222('0xc')](_0xb222('0x9'),_0x162c64,_0x46a25c[_0xb222('0xc')]['message']);return _0x43225b(_0x46a25c[_0xb222('0xc')][_0xb222('0xe')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x162c64,_0x46a25c[_0xb222('0xc')]['message']);return _0x2f13a9(_0x46a25c[_0xb222('0xc')]['message']);}else{logger[_0xb222('0xf')](_0xb222('0x9'),_0x162c64,_0xb222('0xa'));_0x2f13a9(_0x46a25c['result'][_0xb222('0xe')]);}})['catch'](function(_0x137481){logger['error'](_0xb222('0x9'),_0x162c64,_0x137481);_0x43225b(_0x137481);});});}exports[_0xb222('0x10')]=function(_0x3d8c37){var _0x230b57=this;return new Promise(function(_0x7e1f,_0x4c69e8){return db['CmHopperBlack'][_0xb222('0x11')]({'raw':_0x3d8c37[_0xb222('0x12')]?_0x3d8c37[_0xb222('0x12')][_0xb222('0x13')]===undefined?!![]:![]:!![],'where':_0x3d8c37['options']?_0x3d8c37[_0xb222('0x12')][_0xb222('0x14')]||null:null,'attributes':_0x3d8c37[_0xb222('0x12')]?_0x3d8c37[_0xb222('0x12')][_0xb222('0x15')]||null:null,'limit':_0x3d8c37[_0xb222('0x12')]?_0x3d8c37[_0xb222('0x12')][_0xb222('0x16')]||null:null,'include':_0x3d8c37[_0xb222('0x12')]?_0x3d8c37['options']['include']?_['map'](_0x3d8c37[_0xb222('0x12')][_0xb222('0x17')],function(_0x4429be){return{'model':db[_0x4429be[_0xb222('0x18')]],'as':_0x4429be['as'],'attributes':_0x4429be[_0xb222('0x15')],'include':_0x4429be[_0xb222('0x17')]?_[_0xb222('0x19')](_0x4429be[_0xb222('0x17')],function(_0x8a9250){return{'model':db[_0x8a9250[_0xb222('0x18')]],'as':_0x8a9250['as'],'attributes':_0x8a9250[_0xb222('0x15')],'include':_0x8a9250[_0xb222('0x17')]?_['map'](_0x8a9250['include'],function(_0x525809){return{'model':db[_0x525809[_0xb222('0x18')]],'as':_0x525809['as'],'attributes':_0x525809[_0xb222('0x15')]};}):[]};}):[]};}):[]:[]})[_0xb222('0x8')](function(_0x4fa5fe){logger[_0xb222('0xf')]('GetCmHopperBlack',_0x3d8c37);logger[_0xb222('0x1a')](_0xb222('0x10'),_0x3d8c37,JSON[_0xb222('0xb')](_0x4fa5fe));_0x7e1f(_0x4fa5fe);})[_0xb222('0x1b')](function(_0x14ed40){logger[_0xb222('0xc')](_0xb222('0x10'),_0x14ed40[_0xb222('0xe')],_0x3d8c37);_0x4c69e8(_0x230b57['error'](0x1f4,_0x14ed40[_0xb222('0xe')]));});});};exports[_0xb222('0x1c')]=function(_0x2f0013){var _0x4d879b=this;return new Promise(function(_0x44bd83,_0x3583e0){return db[_0xb222('0x1d')]['update'](_0x2f0013[_0xb222('0x1e')],{'raw':_0x2f0013[_0xb222('0x12')]?_0x2f0013[_0xb222('0x12')][_0xb222('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f0013[_0xb222('0x12')]?_0x2f0013[_0xb222('0x12')][_0xb222('0x14')]||null:null,'attributes':_0x2f0013[_0xb222('0x12')]?_0x2f0013['options'][_0xb222('0x15')]||null:null,'limit':_0x2f0013['options']?_0x2f0013[_0xb222('0x12')][_0xb222('0x16')]||null:null})[_0xb222('0x8')](function(_0x386566){logger[_0xb222('0xf')](_0xb222('0x1c'),_0x2f0013);logger['debug'](_0xb222('0x1c'),_0x2f0013,JSON[_0xb222('0xb')](_0x386566));_0x44bd83(_0x386566);})[_0xb222('0x1b')](function(_0x37fe99){logger['error'](_0xb222('0x1c'),_0x37fe99[_0xb222('0xe')],_0x2f0013);_0x3583e0(_0x4d879b[_0xb222('0xc')](0x1f4,_0x37fe99['message']));});});};exports['DestroyCmHopperBlack']=function(_0x186139){var _0x289fdb=this;return new Promise(function(_0x299afa,_0xf48566){return db[_0xb222('0x1d')][_0xb222('0x1f')]({'where':_0x186139[_0xb222('0x12')]?_0x186139['options'][_0xb222('0x14')]||null:null})['then'](function(_0x581732){logger['info']('DestroyCmHopperBlack',_0x186139);logger['debug'](_0xb222('0x20'),_0x186139,JSON['stringify'](_0x581732));_0x299afa(_0x581732);})['catch'](function(_0x16a60f){logger[_0xb222('0xc')]('DestroyCmHopperBlack',_0x16a60f['message'],_0x186139);_0xf48566(_0x289fdb['error'](0x1f4,_0x16a60f[_0xb222('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 03bb6be..b4bc795 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 _0xf6d0=['update','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x584a21,_0x215aa8){var _0x1897cf=function(_0x1049bb){while(--_0x1049bb){_0x584a21['push'](_0x584a21['shift']());}};_0x1897cf(++_0x215aa8);}(_0xf6d0,0x163));var _0x0f6d=function(_0x31950e,_0x1f901d){_0x31950e=_0x31950e-0x0;var _0x3ef5a0=_0xf6d0[_0x31950e];return _0x3ef5a0;};'use strict';var multer=require(_0x0f6d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0f6d('0x1'));var express=require(_0x0f6d('0x2'));var router=express[_0x0f6d('0x3')]();var auth=require(_0x0f6d('0x4'));var interaction=require(_0x0f6d('0x5'));var config=require('../../config/environment');var controller=require(_0x0f6d('0x6'));router[_0x0f6d('0x7')]('/',auth[_0x0f6d('0x8')](),controller[_0x0f6d('0x9')]);router[_0x0f6d('0x7')](_0x0f6d('0xa'),auth[_0x0f6d('0x8')](),controller['describe']);router['get'](_0x0f6d('0xb'),auth['isAuthenticated'](),controller[_0x0f6d('0xc')]);router['put']('/:id',auth[_0x0f6d('0x8')](),controller[_0x0f6d('0xd')]);router[_0x0f6d('0xe')](_0x0f6d('0xb'),auth['isAuthenticated'](),controller[_0x0f6d('0xf')]);module['exports']=router; \ No newline at end of file +var _0xcb26=['/:id','show','put','delete','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe'];(function(_0x46361e,_0x243aaf){var _0x14e302=function(_0x9ebecf){while(--_0x9ebecf){_0x46361e['push'](_0x46361e['shift']());}};_0x14e302(++_0x243aaf);}(_0xcb26,0xf6));var _0x6cb2=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xcb26[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require(_0x6cb2('0x0'));var util=require(_0x6cb2('0x1'));var path=require(_0x6cb2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6cb2('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x6cb2('0x4'));var config=require(_0x6cb2('0x5'));var controller=require('./cmHopperBlack.controller');router[_0x6cb2('0x6')]('/',auth[_0x6cb2('0x7')](),controller['index']);router['get'](_0x6cb2('0x8'),auth['isAuthenticated'](),controller[_0x6cb2('0x9')]);router[_0x6cb2('0x6')](_0x6cb2('0xa'),auth['isAuthenticated'](),controller[_0x6cb2('0xb')]);router[_0x6cb2('0xc')]('/:id',auth[_0x6cb2('0x7')](),controller['update']);router[_0x6cb2('0xd')](_0x6cb2('0xa'),auth[_0x6cb2('0x7')](),controller[_0x6cb2('0xe')]);module[_0x6cb2('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 79a4722..edae1d3 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 _0xe88c=['setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','moment','INTEGER','STRING','DATE','getDataValue'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xe88c,0x124));var _0xce88=function(_0x27a9cc,_0x1b1b55){_0x27a9cc=_0x27a9cc-0x0;var _0x412f06=_0xe88c[_0x27a9cc];return _0x412f06;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xce88('0x0'));module['exports']={'state':{'type':Sequelize[_0xce88('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xce88('0x2')]},'scheduledat':{'type':Sequelize[_0xce88('0x3')]},'countbusyretry':{'type':Sequelize[_0xce88('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xce88('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xce88('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xce88('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xce88('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xce88('0x2')]},'starttime':{'type':Sequelize[_0xce88('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xce88('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xce88('0x3')]},'ringtime':{'type':Sequelize[_0xce88('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xce88('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xce88('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xce88('0x2')]},'campaign':{'type':Sequelize[_0xce88('0x2')]},'campaigntype':{'type':Sequelize[_0xce88('0x2')]},'membername':{'type':Sequelize[_0xce88('0x2')]},'reason':{'type':Sequelize[_0xce88('0x2')]},'disposition':{'type':Sequelize[_0xce88('0x2')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x5a208a){var _0x356680=this[_0xce88('0x4')]('endtime');if(_0x356680&&_0x5a208a){this[_0xce88('0x5')](_0xce88('0x6'),moment(_0x5a208a)[_0xce88('0x7')](moment(_0x356680),_0xce88('0x8')));}return this[_0xce88('0x5')](_0xce88('0x9'),_0x5a208a);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xce88('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xce88('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xce88('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xce88('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xce88('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xce88('0x3')]}}; \ No newline at end of file +var _0xa3c3=['endtime','setDataValue','diff','seconds','BOOLEAN','moment','exports','INTEGER','STRING','DATE','getDataValue'];(function(_0x3ad667,_0x3c22de){var _0x5058da=function(_0x5b3d96){while(--_0x5b3d96){_0x3ad667['push'](_0x3ad667['shift']());}};_0x5058da(++_0x3c22de);}(_0xa3c3,0x1de));var _0x3a3c=function(_0x30412c,_0x10a6a3){_0x30412c=_0x30412c-0x0;var _0x1db569=_0xa3c3[_0x30412c];return _0x1db569;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3a3c('0x0'));module[_0x3a3c('0x1')]={'state':{'type':Sequelize[_0x3a3c('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x3a3c('0x3')]},'scheduledat':{'type':Sequelize[_0x3a3c('0x4')]},'countbusyretry':{'type':Sequelize[_0x3a3c('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3a3c('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x3a3c('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x3a3c('0x3')]},'originatecalleridname':{'type':Sequelize[_0x3a3c('0x3')]},'calleridnum':{'type':Sequelize[_0x3a3c('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x3a3c('0x4')]},'responsetime':{'type':Sequelize[_0x3a3c('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x3a3c('0x4')]},'endtime':{'type':Sequelize[_0x3a3c('0x4')]},'ringtime':{'type':Sequelize[_0x3a3c('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x3a3c('0x3')]},'campaign':{'type':Sequelize[_0x3a3c('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x3a3c('0x3')]},'disposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x37341d){var _0x2f276d=this[_0x3a3c('0x5')](_0x3a3c('0x6'));if(_0x2f276d&&_0x37341d){this[_0x3a3c('0x7')]('followuptime',moment(_0x37341d)[_0x3a3c('0x8')](moment(_0x2f276d),_0x3a3c('0x9')));}return this[_0x3a3c('0x7')]('dispositionat',_0x37341d);}},'amd':{'type':Sequelize[_0x3a3c('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x3a3c('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x3a3c('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x3a3c('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3a3c('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3a3c('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x3a3c('0x4')]},'recallme':{'type':Sequelize[_0x3a3c('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x3a3c('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 369d3b5..5998b42 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 _0x1280=['name','send','index','CmHopperFinal','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','merge','where','map','key','field','options','then','includeAll','include','findAll','rows','catch','show','params','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','noSuchContacts','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','phone','scheduledAt','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','cm_hopper','fromQuery','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','limit','set','apply','reject','update','destroy','end','sendStatus','error','stack'];(function(_0x6287b6,_0x5682e7){var _0x5d6be4=function(_0x3e3975){while(--_0x3e3975){_0x6287b6['push'](_0x6287b6['shift']());}};_0x5d6be4(++_0x5682e7);}(_0x1280,0x1e1));var _0x0128=function(_0x1ad901,_0x852d9e){_0x1ad901=_0x1ad901-0x0;var _0x3c0249=_0x1280[_0x1ad901];return _0x3c0249;};'use strict';var pdf=require(_0x0128('0x0'));var emlformat=require(_0x0128('0x1'));var rimraf=require(_0x0128('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0128('0x3'));var rp=require(_0x0128('0x4'));var moment=require(_0x0128('0x5'));var BPromise=require(_0x0128('0x6'));var Mustache=require(_0x0128('0x7'));var util=require('util');var path=require(_0x0128('0x8'));var sox=require(_0x0128('0x9'));var csv=require('to-csv');var ejs=require(_0x0128('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0128('0xb'));var deskjs=require(_0x0128('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0128('0xd'));var Redis=require('ioredis');var authService=require(_0x0128('0xe'));var qs=require(_0x0128('0xf'));var hardwareService=require(_0x0128('0x10'));var logger=require(_0x0128('0x11'))(_0x0128('0x12'));var utils=require(_0x0128('0x13'));var config=require(_0x0128('0x14'));var db=require(_0x0128('0x15'))['db'];function respondWithStatusCode(_0x3109ef,_0x757fa3){_0x757fa3=_0x757fa3||0xcc;return function(_0x44482c){if(_0x44482c){return _0x3109ef['sendStatus'](_0x757fa3);}return _0x3109ef[_0x0128('0x16')](_0x757fa3)['end']();};}function respondWithResult(_0x25fae5,_0x36a485){_0x36a485=_0x36a485||0xc8;return function(_0x2cc845){if(_0x2cc845){return _0x25fae5['status'](_0x36a485)['json'](_0x2cc845);}};}function respondWithFilteredResult(_0x251c51,_0x5cf4e4){return function(_0xb64f9){if(_0xb64f9){var _0x2388a3=_0xb64f9[_0x0128('0x17')],_0x33475e=_0x5cf4e4[_0x0128('0x18')],_0x176e05=_0x5cf4e4[_0x0128('0x18')]+_0x5cf4e4[_0x0128('0x19')],_0x538bfe;if(_0x176e05>=_0x2388a3){_0x176e05=_0x2388a3;_0x538bfe=0xc8;}else{_0x538bfe=0xce;}_0x251c51[_0x0128('0x16')](_0x538bfe);return _0x251c51[_0x0128('0x1a')]('Content-Range',_0x33475e+'-'+_0x176e05+'/'+_0x2388a3)['json'](_0xb64f9);}return null;};}function patchUpdates(_0x5b441d){return function(_0x3abb97){try{jsonpatch[_0x0128('0x1b')](_0x3abb97,_0x5b441d,!![]);}catch(_0x171805){return BPromise[_0x0128('0x1c')](_0x171805);}return _0x3abb97['save']();};}function saveUpdates(_0x113ba5,_0x26409e){return function(_0x3a68b7){if(_0x3a68b7){return _0x3a68b7[_0x0128('0x1d')](_0x113ba5)['then'](function(_0x44e67e){return _0x44e67e;});}return null;};}function removeEntity(_0x2aa0fc,_0x19d2c1){return function(_0x19925b){if(_0x19925b){return _0x19925b[_0x0128('0x1e')]()['then'](function(){_0x2aa0fc['status'](0xcc)[_0x0128('0x1f')]();});}};}function handleEntityNotFound(_0x5334bf,_0x5905fa){return function(_0x356616){if(!_0x356616){_0x5334bf[_0x0128('0x20')](0x194);}return _0x356616;};}function handleError(_0x209ffc,_0x3287f0){_0x3287f0=_0x3287f0||0x1f4;return function(_0x4a78e0){logger[_0x0128('0x21')](_0x4a78e0[_0x0128('0x22')]);if(_0x4a78e0[_0x0128('0x23')]){delete _0x4a78e0[_0x0128('0x23')];}_0x209ffc[_0x0128('0x16')](_0x3287f0)[_0x0128('0x24')](_0x4a78e0);};}exports[_0x0128('0x25')]=function(_0x5924ab,_0x253eaa){var _0x15df44={},_0xbab756={},_0xaf92b1={'count':0x0,'rows':[]};var _0x487a6a=db[_0x0128('0x26')][_0x0128('0x27')];_0xbab756['model']=_[_0x0128('0x28')](_0x487a6a);_0xbab756[_0x0128('0x29')]=_[_0x0128('0x28')](_0x5924ab[_0x0128('0x29')]);_0xbab756[_0x0128('0x2a')]=_[_0x0128('0x2b')](_0xbab756[_0x0128('0x2c')],_0xbab756[_0x0128('0x29')]);_0x15df44[_0x0128('0x2d')]=_['intersection'](_0xbab756['model'],qs['fields'](_0x5924ab[_0x0128('0x29')][_0x0128('0x2e')]));_0x15df44[_0x0128('0x2d')]=_0x15df44[_0x0128('0x2d')][_0x0128('0x2f')]?_0x15df44[_0x0128('0x2d')]:_0xbab756['model'];if(!_0x5924ab['query']['hasOwnProperty'](_0x0128('0x30'))){_0x15df44['limit']=qs[_0x0128('0x19')](_0x5924ab[_0x0128('0x29')]['limit']);_0x15df44[_0x0128('0x18')]=qs[_0x0128('0x18')](_0x5924ab['query']['offset']);}_0x15df44[_0x0128('0x31')]=qs['sort'](_0x5924ab[_0x0128('0x29')][_0x0128('0x32')]);_0x15df44['where']=qs['filters'](_[_0x0128('0x33')](_0x5924ab[_0x0128('0x29')],_0xbab756['filters']));if(_0x5924ab[_0x0128('0x29')]['filter']){_0x15df44['where']=_[_0x0128('0x34')](_0x15df44[_0x0128('0x35')],{'$or':_[_0x0128('0x36')](_0x487a6a,function(_0x519a10){if(_0x519a10['type'][_0x0128('0x37')]!=='VIRTUAL'){var _0x26b12b={};_0x26b12b[_0x519a10[_0x0128('0x38')]]={'$like':'%'+_0x5924ab[_0x0128('0x29')]['filter']+'%'};return _0x26b12b;}})});}_0x15df44=_[_0x0128('0x34')]({},_0x15df44,_0x5924ab[_0x0128('0x39')]);var _0x34accf={'where':_0x15df44['where']};return db[_0x0128('0x26')][_0x0128('0x17')](_0x34accf)[_0x0128('0x3a')](function(_0x5de5d5){_0xaf92b1[_0x0128('0x17')]=_0x5de5d5;if(_0x5924ab['query'][_0x0128('0x3b')]){_0x15df44[_0x0128('0x3c')]=[{'all':!![]}];}return db[_0x0128('0x26')][_0x0128('0x3d')](_0x15df44);})[_0x0128('0x3a')](function(_0x1ea369){_0xaf92b1[_0x0128('0x3e')]=_0x1ea369;return _0xaf92b1;})[_0x0128('0x3a')](respondWithFilteredResult(_0x253eaa,_0x15df44))[_0x0128('0x3f')](handleError(_0x253eaa,null));};exports[_0x0128('0x40')]=function(_0x539283,_0x4395f3){var _0x198629={'raw':!![],'where':{'id':_0x539283[_0x0128('0x41')]['id']}},_0x1f9007={};_0x1f9007[_0x0128('0x2c')]=_[_0x0128('0x28')](db[_0x0128('0x26')]['rawAttributes']);_0x1f9007[_0x0128('0x29')]=_[_0x0128('0x28')](_0x539283[_0x0128('0x29')]);_0x1f9007[_0x0128('0x2a')]=_[_0x0128('0x2b')](_0x1f9007[_0x0128('0x2c')],_0x1f9007[_0x0128('0x29')]);_0x198629[_0x0128('0x2d')]=_[_0x0128('0x2b')](_0x1f9007[_0x0128('0x2c')],qs[_0x0128('0x2e')](_0x539283[_0x0128('0x29')][_0x0128('0x2e')]));_0x198629[_0x0128('0x2d')]=_0x198629[_0x0128('0x2d')][_0x0128('0x2f')]?_0x198629[_0x0128('0x2d')]:_0x1f9007[_0x0128('0x2c')];if(_0x539283[_0x0128('0x29')][_0x0128('0x3b')]){_0x198629['include']=[{'all':!![]}];}_0x198629=_['merge']({},_0x198629,_0x539283[_0x0128('0x39')]);return db[_0x0128('0x26')][_0x0128('0x42')](_0x198629)[_0x0128('0x3a')](handleEntityNotFound(_0x4395f3,null))['then'](respondWithResult(_0x4395f3,null))[_0x0128('0x3f')](handleError(_0x4395f3,null));};exports[_0x0128('0x43')]=function(_0xd8e64f,_0x4f72d7){return db['CmHopperFinal']['describe']()[_0x0128('0x3a')](respondWithResult(_0x4f72d7,null))['catch'](handleError(_0x4f72d7,null));};exports['update']=function(_0x4b8d45,_0x179c08){if(_0x4b8d45[_0x0128('0x44')][_0x0128('0x45')]){delete _0x4b8d45[_0x0128('0x44')][_0x0128('0x45')];}return db['CmHopperFinal'][_0x0128('0x42')]({'where':{'uniqueid':_0x4b8d45['params']['id']}})['then'](handleEntityNotFound(_0x179c08,null))[_0x0128('0x3a')](saveUpdates(_0x4b8d45['body'],null))['then'](respondWithResult(_0x179c08,null))[_0x0128('0x3f')](handleError(_0x179c08,null));};exports[_0x0128('0x46')]=function(_0x3a2771,_0x2d284b,_0x1a8781){return db[_0x0128('0x26')][_0x0128('0x3d')]({'raw':![],'where':{'VoiceQueueId':_0x3a2771[_0x0128('0x41')]['id']},'attributes':[[db[_0x0128('0x47')]['fn'](_0x0128('0x48'),db[_0x0128('0x47')]['fn']('IF',db[_0x0128('0x47')][_0x0128('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0x0128('0x4a')],[db['sequelize']['fn'](_0x0128('0x48'),db[_0x0128('0x47')]['fn']('IF',db[_0x0128('0x47')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x0128('0x4b')],[db[_0x0128('0x47')]['fn']('COUNT',db[_0x0128('0x47')]['fn']('IF',db[_0x0128('0x47')][_0x0128('0x49')]('`state`\x20=\x205,\x201,\x20null'))),_0x0128('0x4c')],[db[_0x0128('0x47')]['fn'](_0x0128('0x48'),db[_0x0128('0x47')]['fn']('IF',db[_0x0128('0x47')][_0x0128('0x49')](_0x0128('0x4d')))),_0x0128('0x4e')],[db[_0x0128('0x47')]['fn'](_0x0128('0x48'),db[_0x0128('0x47')]['fn']('IF',db[_0x0128('0x47')][_0x0128('0x49')](_0x0128('0x4f')))),_0x0128('0x50')],[db[_0x0128('0x47')]['fn'](_0x0128('0x48'),db[_0x0128('0x47')]['fn']('IF',db[_0x0128('0x47')][_0x0128('0x49')](_0x0128('0x51')))),_0x0128('0x52')],[db[_0x0128('0x47')]['fn'](_0x0128('0x48'),db[_0x0128('0x47')]['fn']('IF',db[_0x0128('0x47')]['literal'](_0x0128('0x53')))),_0x0128('0x54')],[db[_0x0128('0x47')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x0128('0x47')]['literal'](_0x0128('0x55')))),_0x0128('0x56')]]})['then'](handleEntityNotFound(_0x2d284b,null))[_0x0128('0x3a')](respondWithResult(_0x2d284b,null))['catch'](handleError(_0x2d284b,null));};exports[_0x0128('0x57')]=function(_0x3382e8,_0x5a0882,_0x2833ec){return db['CmHopperFinal'][_0x0128('0x3d')]({'raw':![],'where':{'CampaignId':_0x3382e8[_0x0128('0x41')]['id']},'attributes':[[db[_0x0128('0x47')]['fn'](_0x0128('0x48'),db['sequelize']['fn']('IF',db[_0x0128('0x47')][_0x0128('0x49')](_0x0128('0x58')))),_0x0128('0x4a')],[db[_0x0128('0x47')]['fn'](_0x0128('0x48'),db[_0x0128('0x47')]['fn']('IF',db[_0x0128('0x47')]['literal'](_0x0128('0x59')))),_0x0128('0x4b')],[db[_0x0128('0x47')]['fn']('COUNT',db[_0x0128('0x47')]['fn']('IF',db[_0x0128('0x47')][_0x0128('0x49')](_0x0128('0x5a')))),_0x0128('0x4c')],[db[_0x0128('0x47')]['fn']('COUNT',db[_0x0128('0x47')]['fn']('IF',db[_0x0128('0x47')][_0x0128('0x49')](_0x0128('0x4d')))),_0x0128('0x4e')],[db[_0x0128('0x47')]['fn'](_0x0128('0x48'),db[_0x0128('0x47')]['fn']('IF',db[_0x0128('0x47')][_0x0128('0x49')](_0x0128('0x4f')))),_0x0128('0x50')],[db[_0x0128('0x47')]['fn'](_0x0128('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x0128('0x49')](_0x0128('0x51')))),_0x0128('0x52')],[db['sequelize']['fn']('COUNT',db[_0x0128('0x47')]['fn']('IF',db[_0x0128('0x47')][_0x0128('0x49')](_0x0128('0x53')))),_0x0128('0x54')],[db['sequelize']['fn'](_0x0128('0x48'),db[_0x0128('0x47')]['fn']('IF',db[_0x0128('0x47')][_0x0128('0x49')](_0x0128('0x55')))),_0x0128('0x56')]]})['then'](handleEntityNotFound(_0x5a0882,null))['then'](respondWithResult(_0x5a0882,null))['catch'](handleError(_0x5a0882,null));};exports[_0x0128('0x5b')]=function(_0x40f183,_0x4871f3,_0x27fa2a){return db[_0x0128('0x5c')][_0x0128('0x42')]({'where':{'id':_0x40f183[_0x0128('0x41')]['id']}})[_0x0128('0x3a')](handleEntityNotFound(_0x4871f3,null))[_0x0128('0x3a')](function(_0x3a7c37){var _0x161142;if(_0x3a7c37){_0x161142=squel[_0x0128('0x5d')]()[_0x0128('0x5e')]('cm_hopper')['fromQuery']([_0x0128('0x5f'),_0x0128('0x60'),'ContactId','ListId',_0x0128('0x61'),_0x0128('0x62'),_0x0128('0x63')],squel[_0x0128('0x64')]()[_0x0128('0x38')](_0x0128('0x65'),_0x0128('0x5f'))[_0x0128('0x38')](_0x0128('0x66'),_0x0128('0x60'))['field'](_0x0128('0x67'),_0x0128('0x68'))[_0x0128('0x38')](_0x0128('0x69'),_0x0128('0x6a'))[_0x0128('0x38')](_0x0128('0x6b'),_0x0128('0x61'))[_0x0128('0x38')]('NOW()',_0x0128('0x62'))[_0x0128('0x38')](_0x0128('0x66'),_0x0128('0x63'))[_0x0128('0x6c')](_0x0128('0x6d'))[_0x0128('0x35')](_0x0128('0x6e'),_0x40f183[_0x0128('0x41')]['id'][_0x0128('0x6f')]())[_0x0128('0x35')](_0x0128('0x70'),_0x40f183[_0x0128('0x44')][_0x0128('0x71')]['toString']())[_0x0128('0x35')](_0x0128('0x72'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x0128('0x64')]()[_0x0128('0x38')](_0x0128('0x5f'))[_0x0128('0x6c')]('cm_hopper')['where'](_0x0128('0x6e'),_0x40f183[_0x0128('0x41')]['id']['toString']()))[_0x0128('0x35')](_0x0128('0x73'),squel[_0x0128('0x64')]()[_0x0128('0x38')](_0x0128('0x74'))[_0x0128('0x6c')](_0x0128('0x6d'))[_0x0128('0x35')](_0x0128('0x6e'),_0x40f183['params']['id'][_0x0128('0x6f')]())['where'](_0x0128('0x75')))[_0x0128('0x76')](_0x0128('0x68')))[_0x0128('0x6f')]();return db[_0x0128('0x47')][_0x0128('0x29')](_0x161142);}return[];})[_0x0128('0x3a')](respondWithResult(_0x4871f3,null))[_0x0128('0x3f')](handleError(_0x4871f3,null));};exports[_0x0128('0x77')]=function(_0x34770e,_0x5010bf,_0x3df0fe){return db[_0x0128('0x78')]['find']({'where':{'id':_0x34770e['params']['id']}})[_0x0128('0x3a')](handleEntityNotFound(_0x5010bf,null))[_0x0128('0x3a')](function(_0x380650){var _0x3278d1;if(_0x380650){_0x3278d1=squel[_0x0128('0x5d')]()['into'](_0x0128('0x79'))[_0x0128('0x7a')]([_0x0128('0x5f'),'scheduledAt',_0x0128('0x68'),_0x0128('0x6a'),_0x0128('0x7b'),_0x0128('0x62'),'updatedAt'],squel['select']()[_0x0128('0x38')](_0x0128('0x65'),_0x0128('0x5f'))[_0x0128('0x38')](_0x0128('0x66'),_0x0128('0x60'))['field'](_0x0128('0x67'),_0x0128('0x68'))['field'](_0x0128('0x69'),_0x0128('0x6a'))[_0x0128('0x38')](_0x0128('0x7c'),_0x0128('0x7b'))[_0x0128('0x38')](_0x0128('0x66'),'createdAt')['field'](_0x0128('0x66'),'updatedAt')[_0x0128('0x6c')]('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x34770e['params']['id'][_0x0128('0x6f')]())['where'](_0x0128('0x70'),_0x34770e[_0x0128('0x44')][_0x0128('0x71')][_0x0128('0x6f')]())[_0x0128('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x0128('0x73'),squel[_0x0128('0x64')]()[_0x0128('0x38')](_0x0128('0x5f'))[_0x0128('0x6c')]('cm_hopper')[_0x0128('0x35')](_0x0128('0x7d'),_0x34770e[_0x0128('0x41')]['id']['toString']()))[_0x0128('0x35')](_0x0128('0x73'),squel[_0x0128('0x64')]()[_0x0128('0x38')](_0x0128('0x74'))[_0x0128('0x6c')](_0x0128('0x6d'))['where'](_0x0128('0x7d'),_0x34770e[_0x0128('0x41')]['id'][_0x0128('0x6f')]())[_0x0128('0x35')](_0x0128('0x75')))[_0x0128('0x76')](_0x0128('0x68')))[_0x0128('0x6f')]();return db[_0x0128('0x47')][_0x0128('0x29')](_0x3278d1);}return[];})[_0x0128('0x3a')](respondWithResult(_0x5010bf,null))['catch'](handleError(_0x5010bf,null));};exports[_0x0128('0x7e')]=function(_0x38d5c0,_0x342e92,_0x588345){return db[_0x0128('0x7f')][_0x0128('0x80')]({'where':{'VoiceQueueId':_0x38d5c0[_0x0128('0x44')][_0x0128('0x61')],'CampaignId':_0x38d5c0[_0x0128('0x44')][_0x0128('0x7b')],'ContactId':_0x38d5c0[_0x0128('0x44')]['ContactId']}})[_0x0128('0x3a')](handleEntityNotFound(_0x342e92,null))['then'](function(_0x3db315){if(_0x3db315){return _0x3db315;}return null;})[_0x0128('0x3a')](respondWithResult(_0x342e92,null))['catch'](handleError(_0x342e92,null));}; \ No newline at end of file +var _0x8eca=['../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','save','destroy','error','name','send','index','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filters','filter','merge','key','field','options','CmHopperFinal','then','includeAll','include','rows','catch','show','params','find','describe','body','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','findAll','noAnswerContacts','busyContacts','`state`\x20=\x2022,\x201,\x20null','VoiceQueue','insert','into','cm_hopper','phone','scheduledAt','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','NOW()','ContactId','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','fromQuery','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment'];(function(_0xb140a8,_0x2a65f0){var _0x1372e4=function(_0x2b0271){while(--_0x2b0271){_0xb140a8['push'](_0xb140a8['shift']());}};_0x1372e4(++_0x2a65f0);}(_0x8eca,0x65));var _0xa8ec=function(_0x250635,_0x2f621b){_0x250635=_0x250635-0x0;var _0x4f0688=_0x8eca[_0x250635];return _0x4f0688;};'use strict';var pdf=require(_0xa8ec('0x0'));var emlformat=require(_0xa8ec('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa8ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa8ec('0x3'));var moment=require(_0xa8ec('0x4'));var BPromise=require(_0xa8ec('0x5'));var Mustache=require(_0xa8ec('0x6'));var util=require(_0xa8ec('0x7'));var path=require(_0xa8ec('0x8'));var sox=require(_0xa8ec('0x9'));var csv=require('to-csv');var ejs=require(_0xa8ec('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa8ec('0xb'));var deskjs=require(_0xa8ec('0xc'));var toCsv=require(_0xa8ec('0xd'));var querystring=require(_0xa8ec('0xe'));var Papa=require(_0xa8ec('0xf'));var Redis=require(_0xa8ec('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa8ec('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa8ec('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xa8ec('0x13'));var db=require(_0xa8ec('0x14'))['db'];function respondWithStatusCode(_0x227947,_0x413f77){_0x413f77=_0x413f77||0xcc;return function(_0xa40285){if(_0xa40285){return _0x227947[_0xa8ec('0x15')](_0x413f77);}return _0x227947[_0xa8ec('0x16')](_0x413f77)[_0xa8ec('0x17')]();};}function respondWithResult(_0x5cf83c,_0x23740f){_0x23740f=_0x23740f||0xc8;return function(_0x27b172){if(_0x27b172){return _0x5cf83c[_0xa8ec('0x16')](_0x23740f)[_0xa8ec('0x18')](_0x27b172);}};}function respondWithFilteredResult(_0x502944,_0x3f7ad8){return function(_0x312f2d){if(_0x312f2d){var _0x178730=_0x312f2d[_0xa8ec('0x19')],_0xc395af=_0x3f7ad8[_0xa8ec('0x1a')],_0x2156aa=_0x3f7ad8[_0xa8ec('0x1a')]+_0x3f7ad8['limit'],_0x2b23a3;if(_0x2156aa>=_0x178730){_0x2156aa=_0x178730;_0x2b23a3=0xc8;}else{_0x2b23a3=0xce;}_0x502944[_0xa8ec('0x16')](_0x2b23a3);return _0x502944['set'](_0xa8ec('0x1b'),_0xc395af+'-'+_0x2156aa+'/'+_0x178730)[_0xa8ec('0x18')](_0x312f2d);}return null;};}function patchUpdates(_0x39689f){return function(_0x5d0fc2){try{jsonpatch['apply'](_0x5d0fc2,_0x39689f,!![]);}catch(_0x1c4e47){return BPromise['reject'](_0x1c4e47);}return _0x5d0fc2[_0xa8ec('0x1c')]();};}function saveUpdates(_0x12b09f,_0x8ded8c){return function(_0x34819a){if(_0x34819a){return _0x34819a['update'](_0x12b09f)['then'](function(_0x2f0d94){return _0x2f0d94;});}return null;};}function removeEntity(_0x5c5e5c,_0x1a26ca){return function(_0xa1f807){if(_0xa1f807){return _0xa1f807[_0xa8ec('0x1d')]()['then'](function(){_0x5c5e5c[_0xa8ec('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a44f4,_0x5980bb){return function(_0x3cc0bf){if(!_0x3cc0bf){_0x2a44f4['sendStatus'](0x194);}return _0x3cc0bf;};}function handleError(_0x19faa4,_0x213468){_0x213468=_0x213468||0x1f4;return function(_0x3aaa74){logger[_0xa8ec('0x1e')](_0x3aaa74['stack']);if(_0x3aaa74['name']){delete _0x3aaa74[_0xa8ec('0x1f')];}_0x19faa4[_0xa8ec('0x16')](_0x213468)[_0xa8ec('0x20')](_0x3aaa74);};}exports[_0xa8ec('0x21')]=function(_0x279115,_0xf5ed2b){var _0x3c140d={},_0x52bfe6={},_0x64c679={'count':0x0,'rows':[]};var _0x285c06=db['CmHopperFinal'][_0xa8ec('0x22')];_0x52bfe6[_0xa8ec('0x23')]=_['keys'](_0x285c06);_0x52bfe6['query']=_[_0xa8ec('0x24')](_0x279115[_0xa8ec('0x25')]);_0x52bfe6['filters']=_[_0xa8ec('0x26')](_0x52bfe6[_0xa8ec('0x23')],_0x52bfe6[_0xa8ec('0x25')]);_0x3c140d[_0xa8ec('0x27')]=_[_0xa8ec('0x26')](_0x52bfe6['model'],qs[_0xa8ec('0x28')](_0x279115[_0xa8ec('0x25')][_0xa8ec('0x28')]));_0x3c140d[_0xa8ec('0x27')]=_0x3c140d[_0xa8ec('0x27')][_0xa8ec('0x29')]?_0x3c140d[_0xa8ec('0x27')]:_0x52bfe6[_0xa8ec('0x23')];if(!_0x279115[_0xa8ec('0x25')][_0xa8ec('0x2a')](_0xa8ec('0x2b'))){_0x3c140d['limit']=qs[_0xa8ec('0x2c')](_0x279115['query'][_0xa8ec('0x2c')]);_0x3c140d[_0xa8ec('0x1a')]=qs[_0xa8ec('0x1a')](_0x279115[_0xa8ec('0x25')][_0xa8ec('0x1a')]);}_0x3c140d['order']=qs[_0xa8ec('0x2d')](_0x279115[_0xa8ec('0x25')][_0xa8ec('0x2d')]);_0x3c140d[_0xa8ec('0x2e')]=qs['filters'](_[_0xa8ec('0x2f')](_0x279115[_0xa8ec('0x25')],_0x52bfe6[_0xa8ec('0x30')]));if(_0x279115[_0xa8ec('0x25')][_0xa8ec('0x31')]){_0x3c140d[_0xa8ec('0x2e')]=_[_0xa8ec('0x32')](_0x3c140d[_0xa8ec('0x2e')],{'$or':_['map'](_0x285c06,function(_0x479bf5){if(_0x479bf5['type'][_0xa8ec('0x33')]!=='VIRTUAL'){var _0x33164b={};_0x33164b[_0x479bf5[_0xa8ec('0x34')]]={'$like':'%'+_0x279115[_0xa8ec('0x25')]['filter']+'%'};return _0x33164b;}})});}_0x3c140d=_[_0xa8ec('0x32')]({},_0x3c140d,_0x279115[_0xa8ec('0x35')]);var _0x20f6eb={'where':_0x3c140d[_0xa8ec('0x2e')]};return db[_0xa8ec('0x36')][_0xa8ec('0x19')](_0x20f6eb)[_0xa8ec('0x37')](function(_0x14c2cf){_0x64c679[_0xa8ec('0x19')]=_0x14c2cf;if(_0x279115[_0xa8ec('0x25')][_0xa8ec('0x38')]){_0x3c140d[_0xa8ec('0x39')]=[{'all':!![]}];}return db[_0xa8ec('0x36')]['findAll'](_0x3c140d);})[_0xa8ec('0x37')](function(_0x4cf8f4){_0x64c679[_0xa8ec('0x3a')]=_0x4cf8f4;return _0x64c679;})['then'](respondWithFilteredResult(_0xf5ed2b,_0x3c140d))[_0xa8ec('0x3b')](handleError(_0xf5ed2b,null));};exports[_0xa8ec('0x3c')]=function(_0x4133f3,_0x189944){var _0x86e45e={'raw':!![],'where':{'id':_0x4133f3[_0xa8ec('0x3d')]['id']}},_0xc4909b={};_0xc4909b[_0xa8ec('0x23')]=_[_0xa8ec('0x24')](db['CmHopperFinal'][_0xa8ec('0x22')]);_0xc4909b[_0xa8ec('0x25')]=_['keys'](_0x4133f3[_0xa8ec('0x25')]);_0xc4909b[_0xa8ec('0x30')]=_['intersection'](_0xc4909b[_0xa8ec('0x23')],_0xc4909b[_0xa8ec('0x25')]);_0x86e45e[_0xa8ec('0x27')]=_[_0xa8ec('0x26')](_0xc4909b[_0xa8ec('0x23')],qs[_0xa8ec('0x28')](_0x4133f3[_0xa8ec('0x25')]['fields']));_0x86e45e[_0xa8ec('0x27')]=_0x86e45e[_0xa8ec('0x27')][_0xa8ec('0x29')]?_0x86e45e[_0xa8ec('0x27')]:_0xc4909b['model'];if(_0x4133f3[_0xa8ec('0x25')]['includeAll']){_0x86e45e['include']=[{'all':!![]}];}_0x86e45e=_[_0xa8ec('0x32')]({},_0x86e45e,_0x4133f3[_0xa8ec('0x35')]);return db[_0xa8ec('0x36')][_0xa8ec('0x3e')](_0x86e45e)['then'](handleEntityNotFound(_0x189944,null))[_0xa8ec('0x37')](respondWithResult(_0x189944,null))[_0xa8ec('0x3b')](handleError(_0x189944,null));};exports[_0xa8ec('0x3f')]=function(_0x67a6a3,_0x55f09e){return db[_0xa8ec('0x36')][_0xa8ec('0x3f')]()[_0xa8ec('0x37')](respondWithResult(_0x55f09e,null))[_0xa8ec('0x3b')](handleError(_0x55f09e,null));};exports['update']=function(_0x3ab31b,_0xbb852f){if(_0x3ab31b[_0xa8ec('0x40')]['uniqueid']){delete _0x3ab31b[_0xa8ec('0x40')]['uniqueid'];}return db[_0xa8ec('0x36')][_0xa8ec('0x3e')]({'where':{'uniqueid':_0x3ab31b[_0xa8ec('0x3d')]['id']}})[_0xa8ec('0x37')](handleEntityNotFound(_0xbb852f,null))[_0xa8ec('0x37')](saveUpdates(_0x3ab31b[_0xa8ec('0x40')],null))[_0xa8ec('0x37')](respondWithResult(_0xbb852f,null))[_0xa8ec('0x3b')](handleError(_0xbb852f,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x330a42,_0x111c11,_0x4366fa){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x330a42[_0xa8ec('0x3d')]['id']},'attributes':[[db[_0xa8ec('0x41')]['fn'](_0xa8ec('0x42'),db[_0xa8ec('0x41')]['fn']('IF',db['sequelize']['literal'](_0xa8ec('0x43')))),_0xa8ec('0x44')],[db[_0xa8ec('0x41')]['fn'](_0xa8ec('0x42'),db[_0xa8ec('0x41')]['fn']('IF',db[_0xa8ec('0x41')][_0xa8ec('0x45')](_0xa8ec('0x46')))),'noAnswerContacts'],[db[_0xa8ec('0x41')]['fn']('COUNT',db[_0xa8ec('0x41')]['fn']('IF',db['sequelize'][_0xa8ec('0x45')](_0xa8ec('0x47')))),'busyContacts'],[db[_0xa8ec('0x41')]['fn'](_0xa8ec('0x42'),db[_0xa8ec('0x41')]['fn']('IF',db[_0xa8ec('0x41')]['literal'](_0xa8ec('0x48')))),_0xa8ec('0x49')],[db[_0xa8ec('0x41')]['fn'](_0xa8ec('0x42'),db['sequelize']['fn']('IF',db[_0xa8ec('0x41')][_0xa8ec('0x45')](_0xa8ec('0x4a')))),_0xa8ec('0x4b')],[db['sequelize']['fn'](_0xa8ec('0x42'),db[_0xa8ec('0x41')]['fn']('IF',db[_0xa8ec('0x41')][_0xa8ec('0x45')](_0xa8ec('0x4c')))),_0xa8ec('0x4d')],[db[_0xa8ec('0x41')]['fn']('COUNT',db[_0xa8ec('0x41')]['fn']('IF',db[_0xa8ec('0x41')][_0xa8ec('0x45')]('`state`\x20=\x2022,\x201,\x20null'))),_0xa8ec('0x4e')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xa8ec('0x41')][_0xa8ec('0x45')](_0xa8ec('0x4f')))),_0xa8ec('0x50')]]})[_0xa8ec('0x37')](handleEntityNotFound(_0x111c11,null))[_0xa8ec('0x37')](respondWithResult(_0x111c11,null))['catch'](handleError(_0x111c11,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x2c60ae,_0x39b693,_0x52daa1){return db[_0xa8ec('0x36')][_0xa8ec('0x51')]({'raw':![],'where':{'CampaignId':_0x2c60ae[_0xa8ec('0x3d')]['id']},'attributes':[[db[_0xa8ec('0x41')]['fn'](_0xa8ec('0x42'),db[_0xa8ec('0x41')]['fn']('IF',db[_0xa8ec('0x41')][_0xa8ec('0x45')](_0xa8ec('0x43')))),'noSuchContacts'],[db[_0xa8ec('0x41')]['fn'](_0xa8ec('0x42'),db[_0xa8ec('0x41')]['fn']('IF',db[_0xa8ec('0x41')]['literal'](_0xa8ec('0x46')))),_0xa8ec('0x52')],[db[_0xa8ec('0x41')]['fn'](_0xa8ec('0x42'),db[_0xa8ec('0x41')]['fn']('IF',db['sequelize']['literal'](_0xa8ec('0x47')))),_0xa8ec('0x53')],[db['sequelize']['fn'](_0xa8ec('0x42'),db[_0xa8ec('0x41')]['fn']('IF',db[_0xa8ec('0x41')][_0xa8ec('0x45')](_0xa8ec('0x48')))),_0xa8ec('0x49')],[db[_0xa8ec('0x41')]['fn'](_0xa8ec('0x42'),db[_0xa8ec('0x41')]['fn']('IF',db[_0xa8ec('0x41')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),'dropContacts'],[db[_0xa8ec('0x41')]['fn'](_0xa8ec('0x42'),db[_0xa8ec('0x41')]['fn']('IF',db['sequelize'][_0xa8ec('0x45')](_0xa8ec('0x4c')))),_0xa8ec('0x4d')],[db[_0xa8ec('0x41')]['fn'](_0xa8ec('0x42'),db[_0xa8ec('0x41')]['fn']('IF',db[_0xa8ec('0x41')]['literal'](_0xa8ec('0x54')))),_0xa8ec('0x4e')],[db[_0xa8ec('0x41')]['fn'](_0xa8ec('0x42'),db['sequelize']['fn']('IF',db[_0xa8ec('0x41')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0xa8ec('0x50')]]})[_0xa8ec('0x37')](handleEntityNotFound(_0x39b693,null))[_0xa8ec('0x37')](respondWithResult(_0x39b693,null))['catch'](handleError(_0x39b693,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x5b4b94,_0x480112,_0xd5141a){return db[_0xa8ec('0x55')][_0xa8ec('0x3e')]({'where':{'id':_0x5b4b94[_0xa8ec('0x3d')]['id']}})[_0xa8ec('0x37')](handleEntityNotFound(_0x480112,null))[_0xa8ec('0x37')](function(_0x3388c5){var _0x3afae9;if(_0x3388c5){_0x3afae9=squel[_0xa8ec('0x56')]()[_0xa8ec('0x57')](_0xa8ec('0x58'))['fromQuery']([_0xa8ec('0x59'),_0xa8ec('0x5a'),'ContactId',_0xa8ec('0x5b'),_0xa8ec('0x5c'),_0xa8ec('0x5d'),_0xa8ec('0x5e')],squel[_0xa8ec('0x5f')]()[_0xa8ec('0x34')](_0xa8ec('0x60'),'phone')[_0xa8ec('0x34')](_0xa8ec('0x61'),_0xa8ec('0x5a'))['field']('ANY_VALUE(ContactId)',_0xa8ec('0x62'))[_0xa8ec('0x34')](_0xa8ec('0x63'),_0xa8ec('0x5b'))['field'](_0xa8ec('0x64'),_0xa8ec('0x5c'))[_0xa8ec('0x34')](_0xa8ec('0x61'),'createdAt')[_0xa8ec('0x34')]('NOW()',_0xa8ec('0x5e'))[_0xa8ec('0x65')](_0xa8ec('0x66'))[_0xa8ec('0x2e')](_0xa8ec('0x67'),_0x5b4b94['params']['id'][_0xa8ec('0x68')]())[_0xa8ec('0x2e')](_0xa8ec('0x69'),_0x5b4b94[_0xa8ec('0x40')][_0xa8ec('0x6a')][_0xa8ec('0x68')]())[_0xa8ec('0x2e')](_0xa8ec('0x6b'))[_0xa8ec('0x2e')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xa8ec('0x5f')]()['field'](_0xa8ec('0x59'))['from'](_0xa8ec('0x58'))[_0xa8ec('0x2e')]('VoiceQueueId\x20=\x20?',_0x5b4b94[_0xa8ec('0x3d')]['id'][_0xa8ec('0x68')]()))[_0xa8ec('0x2e')](_0xa8ec('0x6c'),squel['select']()['field'](_0xa8ec('0x6d'))[_0xa8ec('0x65')]('cm_hopper_final')['where']('VoiceQueueId\x20=\x20?',_0x5b4b94['params']['id']['toString']())[_0xa8ec('0x2e')](_0xa8ec('0x6e')))[_0xa8ec('0x6f')](_0xa8ec('0x62')))[_0xa8ec('0x68')]();return db[_0xa8ec('0x41')]['query'](_0x3afae9);}return[];})[_0xa8ec('0x37')](respondWithResult(_0x480112,null))[_0xa8ec('0x3b')](handleError(_0x480112,null));};exports[_0xa8ec('0x70')]=function(_0xc62291,_0x549174,_0x3a1999){return db['Campaign'][_0xa8ec('0x3e')]({'where':{'id':_0xc62291['params']['id']}})[_0xa8ec('0x37')](handleEntityNotFound(_0x549174,null))['then'](function(_0x42afbf){var _0x26a9fe;if(_0x42afbf){_0x26a9fe=squel[_0xa8ec('0x56')]()[_0xa8ec('0x57')]('cm_hopper')[_0xa8ec('0x71')]([_0xa8ec('0x59'),'scheduledAt',_0xa8ec('0x62'),_0xa8ec('0x5b'),_0xa8ec('0x72'),_0xa8ec('0x5d'),_0xa8ec('0x5e')],squel[_0xa8ec('0x5f')]()[_0xa8ec('0x34')](_0xa8ec('0x60'),_0xa8ec('0x59'))[_0xa8ec('0x34')](_0xa8ec('0x61'),_0xa8ec('0x5a'))[_0xa8ec('0x34')](_0xa8ec('0x73'),_0xa8ec('0x62'))[_0xa8ec('0x34')](_0xa8ec('0x63'),_0xa8ec('0x5b'))[_0xa8ec('0x34')](_0xa8ec('0x74'),_0xa8ec('0x72'))[_0xa8ec('0x34')](_0xa8ec('0x61'),_0xa8ec('0x5d'))[_0xa8ec('0x34')]('NOW()',_0xa8ec('0x5e'))[_0xa8ec('0x65')](_0xa8ec('0x66'))['where'](_0xa8ec('0x75'),_0xc62291['params']['id'][_0xa8ec('0x68')]())[_0xa8ec('0x2e')](_0xa8ec('0x69'),_0xc62291[_0xa8ec('0x40')][_0xa8ec('0x6a')][_0xa8ec('0x68')]())[_0xa8ec('0x2e')](_0xa8ec('0x6b'))[_0xa8ec('0x2e')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xa8ec('0x5f')]()[_0xa8ec('0x34')](_0xa8ec('0x59'))[_0xa8ec('0x65')]('cm_hopper')[_0xa8ec('0x2e')](_0xa8ec('0x75'),_0xc62291['params']['id'][_0xa8ec('0x68')]()))[_0xa8ec('0x2e')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xa8ec('0x5f')]()[_0xa8ec('0x34')](_0xa8ec('0x6d'))[_0xa8ec('0x65')](_0xa8ec('0x66'))['where'](_0xa8ec('0x75'),_0xc62291['params']['id'][_0xa8ec('0x68')]())['where'](_0xa8ec('0x6e')))[_0xa8ec('0x6f')](_0xa8ec('0x62')))[_0xa8ec('0x68')]();return db[_0xa8ec('0x41')][_0xa8ec('0x25')](_0x26a9fe);}return[];})['then'](respondWithResult(_0x549174,null))[_0xa8ec('0x3b')](handleError(_0x549174,null));};exports[_0xa8ec('0x76')]=function(_0x45882e,_0x682f21,_0x14adc4){return db[_0xa8ec('0x77')][_0xa8ec('0x78')]({'where':{'VoiceQueueId':_0x45882e['body'][_0xa8ec('0x5c')],'CampaignId':_0x45882e['body'][_0xa8ec('0x72')],'ContactId':_0x45882e[_0xa8ec('0x40')][_0xa8ec('0x62')]}})[_0xa8ec('0x37')](handleEntityNotFound(_0x682f21,null))[_0xa8ec('0x37')](function(_0x5672d3){if(_0x5672d3){return _0x5672d3;}return null;})['then'](respondWithResult(_0x682f21,null))[_0xa8ec('0x3b')](handleError(_0x682f21,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index b2ebe79..1b57ad7 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 _0x187f=['rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3c3ec0,_0xaf75ef){var _0x31dc5a=function(_0x258420){while(--_0x258420){_0x3c3ec0['push'](_0x3c3ec0['shift']());}};_0x31dc5a(++_0xaf75ef);}(_0x187f,0x180));var _0xf187=function(_0x65b979,_0x1c9701){_0x65b979=_0x65b979-0x0;var _0x5c529b=_0x187f[_0x65b979];return _0x5c529b;};'use strict';var _=require(_0xf187('0x0'));var util=require('util');var logger=require(_0xf187('0x1'))('api');var moment=require(_0xf187('0x2'));var BPromise=require(_0xf187('0x3'));var rp=require(_0xf187('0x4'));var fs=require('fs');var path=require(_0xf187('0x5'));var rimraf=require(_0xf187('0x6'));var config=require(_0xf187('0x7'));var attributes=require(_0xf187('0x8'));module[_0xf187('0x9')]=function(_0x40a02d,_0x13e13d){return _0x40a02d[_0xf187('0xa')](_0xf187('0xb'),attributes,{'tableName':_0xf187('0xc'),'paranoid':![],'indexes':[{'name':_0xf187('0xd'),'fields':[_0xf187('0xd')]},{'name':_0xf187('0xe'),'fields':[_0xf187('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd4dd=['./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','api','request-promise','path','rimraf','../../config/environment'];(function(_0x38cd1a,_0xfd5008){var _0x43b6ce=function(_0xd25289){while(--_0xd25289){_0x38cd1a['push'](_0x38cd1a['shift']());}};_0x43b6ce(++_0xfd5008);}(_0xd4dd,0x1b9));var _0xdd4d=function(_0x473f25,_0x48495e){_0x473f25=_0x473f25-0x0;var _0x5b14c9=_0xd4dd[_0x473f25];return _0x5b14c9;};'use strict';var _=require(_0xdd4d('0x0'));var util=require(_0xdd4d('0x1'));var logger=require('../../config/logger')(_0xdd4d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdd4d('0x3'));var fs=require('fs');var path=require(_0xdd4d('0x4'));var rimraf=require(_0xdd4d('0x5'));var config=require(_0xdd4d('0x6'));var attributes=require(_0xdd4d('0x7'));module[_0xdd4d('0x8')]=function(_0xb65aba,_0x41607f){return _0xb65aba[_0xdd4d('0x9')](_0xdd4d('0xa'),attributes,{'tableName':_0xdd4d('0xb'),'paranoid':![],'indexes':[{'name':_0xdd4d('0xc'),'fields':['calleridnum']},{'name':_0xdd4d('0xd'),'fields':[_0xdd4d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 2c2775e..5fd211b 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 _0xb688=['body','options','raw','CreateCmHopperFinal','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CmHopperFinal','create'];(function(_0x36647f,_0x180371){var _0x174e04=function(_0x2f20d7){while(--_0x2f20d7){_0x36647f['push'](_0x36647f['shift']());}};_0x174e04(++_0x180371);}(_0xb688,0xcf));var _0x8b68=function(_0x1251d3,_0x435795){_0x1251d3=_0x1251d3-0x0;var _0xc33852=_0xb688[_0x1251d3];return _0xc33852;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var moment=require(_0x8b68('0x1'));var BPromise=require(_0x8b68('0x2'));var rs=require(_0x8b68('0x3'));var fs=require('fs');var Redis=require(_0x8b68('0x4'));var db=require(_0x8b68('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b68('0x6'))(_0x8b68('0x7'));var config=require(_0x8b68('0x8'));var jayson=require(_0x8b68('0x9'));var client=jayson['client'][_0x8b68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ee56,_0x37677d,_0x2bbffd){return new BPromise(function(_0x130892,_0xa5571b){return client[_0x8b68('0xb')](_0x57ee56,_0x2bbffd)[_0x8b68('0xc')](function(_0x261753){logger[_0x8b68('0xd')](_0x8b68('0xe'),_0x37677d,_0x8b68('0xf'));logger[_0x8b68('0x10')](_0x8b68('0x11'),_0x37677d,_0x8b68('0xf'),JSON['stringify'](_0x261753));if(_0x261753[_0x8b68('0x12')]){if(_0x261753[_0x8b68('0x12')][_0x8b68('0x13')]===0x1f4){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);return _0xa5571b(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}logger['error'](_0x8b68('0xe'),_0x37677d,_0x261753['error']['message']);return _0x130892(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}else{logger[_0x8b68('0xd')]('CmHopperFinal,\x20%s,\x20%s',_0x37677d,'request\x20sent');_0x130892(_0x261753[_0x8b68('0x15')]['message']);}})[_0x8b68('0x16')](function(_0xb44923){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0xb44923);_0xa5571b(_0xb44923);});});}exports['CreateCmHopperFinal']=function(_0xd17693){var _0x203dd4=this;return new Promise(function(_0x4a68c7,_0x42b3bd){return db[_0x8b68('0x17')][_0x8b68('0x18')](_0xd17693[_0x8b68('0x19')],{'raw':_0xd17693[_0x8b68('0x1a')]?_0xd17693['options'][_0x8b68('0x1b')]===undefined?!![]:![]:!![]})[_0x8b68('0xc')](function(_0x59e9b1){logger[_0x8b68('0xd')](_0x8b68('0x1c'),_0xd17693);logger[_0x8b68('0x10')]('CreateCmHopperFinal',_0xd17693,JSON['stringify'](_0x59e9b1));_0x4a68c7(_0x59e9b1);})[_0x8b68('0x16')](function(_0x59cb26){logger[_0x8b68('0x12')](_0x8b68('0x1c'),_0x59cb26[_0x8b68('0x14')],_0xd17693);_0x42b3bd(_0x203dd4[_0x8b68('0x12')](0x1f4,_0x59cb26[_0x8b68('0x14')]));});});}; \ No newline at end of file +var _0xb903=['CmHopperFinal,\x20%s,\x20%s','message','info','result','create','options','then','CreateCmHopperFinal','debug','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x81cf18,_0x45273d){var _0x105052=function(_0x5a64a8){while(--_0x5a64a8){_0x81cf18['push'](_0x81cf18['shift']());}};_0x105052(++_0x45273d);}(_0xb903,0x185));var _0x3b90=function(_0x3990cc,_0xa0adde){_0x3990cc=_0x3990cc-0x0;var _0x166711=_0xb903[_0x3990cc];return _0x166711;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var moment=require(_0x3b90('0x2'));var BPromise=require(_0x3b90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b90('0x4'));var db=require(_0x3b90('0x5'))['db'];var utils=require(_0x3b90('0x6'));var logger=require(_0x3b90('0x7'))(_0x3b90('0x8'));var config=require(_0x3b90('0x9'));var jayson=require(_0x3b90('0xa'));var client=jayson['client'][_0x3b90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e845a,_0x55792c,_0x153283){return new BPromise(function(_0x2e4c06,_0x42efe8){return client[_0x3b90('0xc')](_0x5e845a,_0x153283)['then'](function(_0x5cda1d){logger['info']('CmHopperFinal,\x20%s,\x20%s',_0x55792c,'request\x20sent');logger['debug'](_0x3b90('0xd'),_0x55792c,_0x3b90('0xe'),JSON['stringify'](_0x5cda1d));if(_0x5cda1d[_0x3b90('0xf')]){if(_0x5cda1d[_0x3b90('0xf')]['code']===0x1f4){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x5cda1d[_0x3b90('0xf')]['message']);return _0x42efe8(_0x5cda1d['error'][_0x3b90('0x11')]);}logger['error']('CmHopperFinal,\x20%s,\x20%s',_0x55792c,_0x5cda1d[_0x3b90('0xf')][_0x3b90('0x11')]);return _0x2e4c06(_0x5cda1d['error']['message']);}else{logger[_0x3b90('0x12')](_0x3b90('0x10'),_0x55792c,_0x3b90('0xe'));_0x2e4c06(_0x5cda1d[_0x3b90('0x13')][_0x3b90('0x11')]);}})['catch'](function(_0x494970){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x494970);_0x42efe8(_0x494970);});});}exports['CreateCmHopperFinal']=function(_0x269488){var _0x3cf281=this;return new Promise(function(_0x11ad7d,_0x131f3f){return db['CmHopperFinal'][_0x3b90('0x14')](_0x269488['body'],{'raw':_0x269488[_0x3b90('0x15')]?_0x269488[_0x3b90('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x3b90('0x16')](function(_0x12e1cf){logger[_0x3b90('0x12')](_0x3b90('0x17'),_0x269488);logger[_0x3b90('0x18')](_0x3b90('0x17'),_0x269488,JSON[_0x3b90('0x19')](_0x12e1cf));_0x11ad7d(_0x12e1cf);})[_0x3b90('0x1a')](function(_0xa98414){logger[_0x3b90('0xf')]('CreateCmHopperFinal',_0xa98414[_0x3b90('0x11')],_0x269488);_0x131f3f(_0x3cf281[_0x3b90('0xf')](0x1f4,_0xa98414[_0x3b90('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 66d4158..6c5ba2e 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 _0x9c44=['put','update','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','post','/checkContactHopper','checkContactHopper'];(function(_0x4de045,_0x2d2164){var _0x4fe777=function(_0x4e1d5a){while(--_0x4e1d5a){_0x4de045['push'](_0x4de045['shift']());}};_0x4fe777(++_0x2d2164);}(_0x9c44,0x178));var _0x49c4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9c44[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0x6')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0x49c4('0xd')]);router[_0x49c4('0x6')]('/campaign/countAttributes/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0xe')]);router['post']('/voice/queue/moveContacts/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0xf')]);router['post'](_0x49c4('0x10'),auth[_0x49c4('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x49c4('0x11')](_0x49c4('0x12'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x13')]);router[_0x49c4('0x14')](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x15')]);module['exports']=router; \ No newline at end of file +var _0x9c44=['put','update','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','post','/checkContactHopper','checkContactHopper'];(function(_0x5caa49,_0x4ba9e0){var _0x14cd4b=function(_0x51d089){while(--_0x51d089){_0x5caa49['push'](_0x5caa49['shift']());}};_0x14cd4b(++_0x4ba9e0);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0x6')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0x49c4('0xd')]);router[_0x49c4('0x6')]('/campaign/countAttributes/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0xe')]);router['post']('/voice/queue/moveContacts/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0xf')]);router['post'](_0x49c4('0x10'),auth[_0x49c4('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x49c4('0x11')](_0x49c4('0x12'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x13')]);router[_0x49c4('0x14')](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 9d8b90b..2a50b1a 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 _0x0faf=['BOOLEAN','sequelize','INTEGER','STRING','DATE'];(function(_0x35fb7c,_0x4ee512){var _0x3b319e=function(_0x381eaa){while(--_0x381eaa){_0x35fb7c['push'](_0x35fb7c['shift']());}};_0x3b319e(++_0x4ee512);}(_0x0faf,0x132));var _0xf0fa=function(_0x3f2855,_0x220576){_0x3f2855=_0x3f2855-0x0;var _0x20c16f=_0x0faf[_0x3f2855];return _0x20c16f;};'use strict';var Sequelize=require(_0xf0fa('0x0'));module['exports']={'state':{'type':Sequelize[_0xf0fa('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xf0fa('0x2')]},'scheduledat':{'type':Sequelize[_0xf0fa('0x3')]},'countbusyretry':{'type':Sequelize[_0xf0fa('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf0fa('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf0fa('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xf0fa('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xf0fa('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xf0fa('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xf0fa('0x2')]},'calleridname':{'type':Sequelize[_0xf0fa('0x2')]},'starttime':{'type':Sequelize[_0xf0fa('0x3')]},'responsetime':{'type':Sequelize[_0xf0fa('0x3')]},'answertime':{'type':Sequelize[_0xf0fa('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xf0fa('0x3')]},'ringtime':{'type':Sequelize[_0xf0fa('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf0fa('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xf0fa('0x2')]},'campaign':{'type':Sequelize[_0xf0fa('0x2')]},'campaigntype':{'type':Sequelize[_0xf0fa('0x2')]},'membername':{'type':Sequelize[_0xf0fa('0x2')]},'reason':{'type':Sequelize[_0xf0fa('0x2')]},'amd':{'type':Sequelize[_0xf0fa('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xf0fa('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf0fa('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xf0fa('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xf0fa('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x938d=['INTEGER','BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x44c935,_0x3653f0){var _0x465bee=function(_0x211d20){while(--_0x211d20){_0x44c935['push'](_0x44c935['shift']());}};_0x465bee(++_0x3653f0);}(_0x938d,0x122));var _0xd938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd938('0x0'));module[_0xd938('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xd938('0x2')]},'scheduledat':{'type':Sequelize[_0xd938('0x3')]},'countbusyretry':{'type':Sequelize[_0xd938('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd938('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xd938('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xd938('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd938('0x2')]},'calleridname':{'type':Sequelize[_0xd938('0x2')]},'starttime':{'type':Sequelize[_0xd938('0x3')]},'responsetime':{'type':Sequelize[_0xd938('0x3')]},'answertime':{'type':Sequelize[_0xd938('0x3')]},'droptime':{'type':Sequelize[_0xd938('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xd938('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd938('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd938('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xd938('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd938('0x2')]},'campaign':{'type':Sequelize[_0xd938('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xd938('0x2')]},'reason':{'type':Sequelize[_0xd938('0x2')]},'amd':{'type':Sequelize[_0xd938('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xd938('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xd938('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd938('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd938('0x3')]},'recallme':{'type':Sequelize[_0xd938('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xd938('0x3')]},'edited':{'type':Sequelize[_0xd938('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index c2f4a67..191d786 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 _0xa9e0=['where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','describe','update','uniqueid','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','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','CmHopperHistory','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x4e2503,_0xc463b0){var _0x450ca4=function(_0x4d5226){while(--_0x4d5226){_0x4e2503['push'](_0x4e2503['shift']());}};_0x450ca4(++_0xc463b0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['CmHopperHistory'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':!![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){return db['CmHopperHistory'][_0x0a9e('0x41')]()['then'](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x8d6dd1,_0x562fb4){if(_0x8d6dd1[_0x0a9e('0x40')][_0x0a9e('0x43')]){delete _0x8d6dd1[_0x0a9e('0x40')][_0x0a9e('0x43')];}return db[_0x0a9e('0x24')][_0x0a9e('0x3e')]({'where':{'uniqueid':_0x8d6dd1[_0x0a9e('0x3d')]['id']}})['then'](handleEntityNotFound(_0x562fb4,null))[_0x0a9e('0x1f')](saveUpdates(_0x8d6dd1[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x562fb4,null))[_0x0a9e('0x3b')](handleError(_0x562fb4,null));}; \ No newline at end of file +var _0xa9e0=['where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','describe','update','uniqueid','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','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','CmHopperHistory','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x2fc49d,_0x5bd725){var _0x39230d=function(_0x284ef1){while(--_0x284ef1){_0x2fc49d['push'](_0x2fc49d['shift']());}};_0x39230d(++_0x5bd725);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['CmHopperHistory'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':!![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){return db['CmHopperHistory'][_0x0a9e('0x41')]()['then'](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x8d6dd1,_0x562fb4){if(_0x8d6dd1[_0x0a9e('0x40')][_0x0a9e('0x43')]){delete _0x8d6dd1[_0x0a9e('0x40')][_0x0a9e('0x43')];}return db[_0x0a9e('0x24')][_0x0a9e('0x3e')]({'where':{'uniqueid':_0x8d6dd1[_0x0a9e('0x3d')]['id']}})['then'](handleEntityNotFound(_0x562fb4,null))[_0x0a9e('0x1f')](saveUpdates(_0x8d6dd1[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x562fb4,null))[_0x0a9e('0x3b')](handleError(_0x562fb4,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index b8e5d32..7f06624 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 _0xa9e0=['define','CmHopperHistory','endtime','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x3a4a56,_0x2b951e){var _0x4973b9=function(_0xbb7d88){while(--_0xbb7d88){_0x3a4a56['push'](_0x3a4a56['shift']());}};_0x4973b9(++_0x2b951e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':[_0x0a9e('0xb')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory'];(function(_0x775b8e,_0x522bb8){var _0x315989=function(_0x10c965){while(--_0x10c965){_0x775b8e['push'](_0x775b8e['shift']());}};_0x315989(++_0x522bb8);}(_0xe706,0xa3));var _0x6e70=function(_0x479c68,_0x4f2415){_0x479c68=_0x479c68-0x0;var _0x5215b1=_0xe706[_0x479c68];return _0x5215b1;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]},{'name':_0x6e70('0xf'),'fields':[_0x6e70('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 9fb4c8d..395c7d5 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 _0x6b1e=['request\x20sent','stringify','error','message','result','CreateCmHopperHistory','CmHopperHistory','create','body','debug','catch','AvgHandleTime','findAll','options','raw','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','then','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','CmHopperHistory,\x20%s,\x20%s','CmHopperHistory,\x20%s,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6b1e,0xd3));var _0xe6b1=function(_0x6b4dab,_0x1f1c9a){_0x6b4dab=_0x6b4dab-0x0;var _0x42e1e2=_0x6b1e[_0x6b4dab];return _0x42e1e2;};'use strict';var _=require(_0xe6b1('0x0'));var util=require(_0xe6b1('0x1'));var moment=require(_0xe6b1('0x2'));var BPromise=require(_0xe6b1('0x3'));var rs=require(_0xe6b1('0x4'));var fs=require('fs');var Redis=require(_0xe6b1('0x5'));var db=require(_0xe6b1('0x6'))['db'];var utils=require(_0xe6b1('0x7'));var logger=require(_0xe6b1('0x8'))(_0xe6b1('0x9'));var config=require(_0xe6b1('0xa'));var jayson=require(_0xe6b1('0xb'));var client=jayson[_0xe6b1('0xc')][_0xe6b1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x341acb,_0x5bc66f,_0x9b0fb8){return new BPromise(function(_0x23a822,_0x2ba98c){return client['request'](_0x341acb,_0x9b0fb8)['then'](function(_0x2015f7){logger[_0xe6b1('0xe')](_0xe6b1('0xf'),_0x5bc66f,'request\x20sent');logger['debug'](_0xe6b1('0x10'),_0x5bc66f,_0xe6b1('0x11'),JSON[_0xe6b1('0x12')](_0x2015f7));if(_0x2015f7[_0xe6b1('0x13')]){if(_0x2015f7[_0xe6b1('0x13')]['code']===0x1f4){logger[_0xe6b1('0x13')](_0xe6b1('0xf'),_0x5bc66f,_0x2015f7[_0xe6b1('0x13')][_0xe6b1('0x14')]);return _0x2ba98c(_0x2015f7[_0xe6b1('0x13')][_0xe6b1('0x14')]);}logger[_0xe6b1('0x13')](_0xe6b1('0xf'),_0x5bc66f,_0x2015f7[_0xe6b1('0x13')][_0xe6b1('0x14')]);return _0x23a822(_0x2015f7[_0xe6b1('0x13')][_0xe6b1('0x14')]);}else{logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x5bc66f,'request\x20sent');_0x23a822(_0x2015f7[_0xe6b1('0x15')][_0xe6b1('0x14')]);}})['catch'](function(_0x1c6fe3){logger['error'](_0xe6b1('0xf'),_0x5bc66f,_0x1c6fe3);_0x2ba98c(_0x1c6fe3);});});}exports[_0xe6b1('0x16')]=function(_0x23de8f){var _0x4a3dd8=this;return new Promise(function(_0x106ff9,_0x5c17a6){return db[_0xe6b1('0x17')][_0xe6b1('0x18')](_0x23de8f[_0xe6b1('0x19')],{'raw':_0x23de8f['options']?_0x23de8f['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0xe853c){logger[_0xe6b1('0xe')](_0xe6b1('0x16'),_0x23de8f);logger[_0xe6b1('0x1a')](_0xe6b1('0x16'),_0x23de8f,JSON['stringify'](_0xe853c));_0x106ff9(_0xe853c);})[_0xe6b1('0x1b')](function(_0x511fbb){logger[_0xe6b1('0x13')](_0xe6b1('0x16'),_0x511fbb['message'],_0x23de8f);_0x5c17a6(_0x4a3dd8[_0xe6b1('0x13')](0x1f4,_0x511fbb['message']));});});};exports[_0xe6b1('0x1c')]=function(_0x44f5c3){var _0x39cc9a=this;return new Promise(function(_0x56a6e9,_0x1480c4){return db[_0xe6b1('0x17')][_0xe6b1('0x1d')]({'raw':_0x44f5c3[_0xe6b1('0x1e')]?_0x44f5c3[_0xe6b1('0x1e')][_0xe6b1('0x1f')]===undefined?!![]:![]:!![],'where':_0x44f5c3['options']?_0x44f5c3[_0xe6b1('0x1e')][_0xe6b1('0x20')]||null:null,'attributes':[[db[_0xe6b1('0x21')]['fn']('COUNT',db[_0xe6b1('0x21')][_0xe6b1('0x22')]('id')),_0xe6b1('0x23')],[db[_0xe6b1('0x21')]['fn'](_0xe6b1('0x24'),db[_0xe6b1('0x21')]['fn']('IF',db['sequelize'][_0xe6b1('0x25')](_0xe6b1('0x26')))),_0xe6b1('0x27')],[db[_0xe6b1('0x21')]['fn'](_0xe6b1('0x24'),db[_0xe6b1('0x21')]['fn']('IF',db[_0xe6b1('0x21')][_0xe6b1('0x25')](_0xe6b1('0x28')))),_0xe6b1('0x29')],[db[_0xe6b1('0x21')]['fn']('COUNT',db[_0xe6b1('0x21')]['fn']('IF',db[_0xe6b1('0x21')][_0xe6b1('0x25')](_0xe6b1('0x2a')))),_0xe6b1('0x2b')],[db[_0xe6b1('0x21')]['fn'](_0xe6b1('0x2c'),db[_0xe6b1('0x21')]['fn']('IF',db[_0xe6b1('0x21')][_0xe6b1('0x25')](_0xe6b1('0x2d')))),'predictiveIntervalAvgHoldtime'],[db['sequelize']['fn']('AVG',db[_0xe6b1('0x21')]['fn']('IF',db['sequelize'][_0xe6b1('0x25')](_0xe6b1('0x2e')))),_0xe6b1('0x2f')]]})[_0xe6b1('0x30')](function(_0x1f64dd){logger[_0xe6b1('0xe')](_0xe6b1('0x1c'),_0x44f5c3);logger[_0xe6b1('0x1a')](_0xe6b1('0x1c'),_0x44f5c3,JSON[_0xe6b1('0x12')](_0x1f64dd));_0x56a6e9(_0x1f64dd);})[_0xe6b1('0x1b')](function(_0x353f43){logger[_0xe6b1('0x13')](_0xe6b1('0x1c'),_0x353f43[_0xe6b1('0x14')],_0x44f5c3);_0x1480c4(_0x39cc9a[_0xe6b1('0x13')](0x1f4,_0x353f43[_0xe6b1('0x14')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x253e6a){var _0x3fbd36=this;return new Promise(function(_0x338083,_0xc2106b){return db['CmHopperHistory'][_0xe6b1('0x1d')]({'raw':_0x253e6a[_0xe6b1('0x1e')]?_0x253e6a[_0xe6b1('0x1e')][_0xe6b1('0x1f')]===undefined?!![]:![]:!![],'where':_0x253e6a['options']?_0x253e6a[_0xe6b1('0x1e')][_0xe6b1('0x20')]||null:null,'attributes':[['campaign',_0xe6b1('0x31')],[db[_0xe6b1('0x21')]['fn'](_0xe6b1('0x24'),db[_0xe6b1('0x21')]['fn']('IF',db['sequelize'][_0xe6b1('0x25')](_0xe6b1('0x32')))),_0xe6b1('0x33')],[db[_0xe6b1('0x21')]['fn'](_0xe6b1('0x24'),db['sequelize']['fn']('IF',db[_0xe6b1('0x21')][_0xe6b1('0x25')](_0xe6b1('0x34')))),_0xe6b1('0x35')],[db[_0xe6b1('0x21')]['fn'](_0xe6b1('0x24'),db[_0xe6b1('0x21')]['fn']('IF',db[_0xe6b1('0x21')][_0xe6b1('0x25')](_0xe6b1('0x26')))),_0xe6b1('0x36')],[db[_0xe6b1('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xe6b1('0x37')))),_0xe6b1('0x38')],[db[_0xe6b1('0x21')]['fn']('COUNT',db[_0xe6b1('0x21')]['fn']('IF',db[_0xe6b1('0x21')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xe6b1('0x39')],[db[_0xe6b1('0x21')]['fn'](_0xe6b1('0x24'),db[_0xe6b1('0x21')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xe6b1('0x3a')],[db[_0xe6b1('0x21')]['fn'](_0xe6b1('0x24'),db[_0xe6b1('0x21')]['fn']('IF',db[_0xe6b1('0x21')][_0xe6b1('0x25')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xe6b1('0x3b')],[db[_0xe6b1('0x21')]['fn'](_0xe6b1('0x24'),db[_0xe6b1('0x21')]['fn']('IF',db[_0xe6b1('0x21')][_0xe6b1('0x25')]('`state`\x20=\x2012,\x201,\x20null'))),_0xe6b1('0x3c')],[db[_0xe6b1('0x21')]['fn'](_0xe6b1('0x24'),db[_0xe6b1('0x21')]['fn']('IF',db[_0xe6b1('0x21')]['literal'](_0xe6b1('0x3d')))),_0xe6b1('0x3e')],[db['sequelize']['fn'](_0xe6b1('0x24'),db[_0xe6b1('0x21')]['fn']('IF',db[_0xe6b1('0x21')][_0xe6b1('0x25')](_0xe6b1('0x3f')))),_0xe6b1('0x40')],[db[_0xe6b1('0x21')]['fn'](_0xe6b1('0x24'),db['sequelize']['fn']('IF',db[_0xe6b1('0x21')][_0xe6b1('0x25')]('`state`\x20=\x2018,\x201,\x20null'))),_0xe6b1('0x41')],[db[_0xe6b1('0x21')]['fn'](_0xe6b1('0x24'),db[_0xe6b1('0x21')]['fn']('IF',db[_0xe6b1('0x21')]['literal'](_0xe6b1('0x42')))),_0xe6b1('0x43')],[db[_0xe6b1('0x21')]['fn']('COUNT',db[_0xe6b1('0x21')]['fn']('IF',db[_0xe6b1('0x21')][_0xe6b1('0x25')](_0xe6b1('0x44')))),_0xe6b1('0x41')],[db['sequelize']['fn'](_0xe6b1('0x24'),db[_0xe6b1('0x21')]['fn']('IF',db[_0xe6b1('0x21')][_0xe6b1('0x25')](_0xe6b1('0x45')))),_0xe6b1('0x46')]],'group':[_0xe6b1('0x47')]})['then'](function(_0x119cef){logger[_0xe6b1('0xe')](_0xe6b1('0x48'),_0x253e6a);logger['debug'](_0xe6b1('0x48'),_0x253e6a,JSON['stringify'](_0x119cef));_0x338083(_0x119cef);})[_0xe6b1('0x1b')](function(_0xb07fff){logger[_0xe6b1('0x13')](_0xe6b1('0x48'),_0xb07fff[_0xe6b1('0x14')],_0x253e6a);_0xc2106b(_0x3fbd36[_0xe6b1('0x13')](0x1f4,_0xb07fff[_0xe6b1('0x14')]));});});};exports[_0xe6b1('0x49')]=function(_0x5a28c6){var _0x1c53f2=this;return new Promise(function(_0x262bda,_0x238339){return db[_0xe6b1('0x17')][_0xe6b1('0x1d')]({'raw':_0x5a28c6[_0xe6b1('0x1e')]?_0x5a28c6[_0xe6b1('0x1e')][_0xe6b1('0x1f')]===undefined?!![]:![]:!![],'where':_0x5a28c6['options']?_0x5a28c6[_0xe6b1('0x1e')][_0xe6b1('0x20')]||null:null,'attributes':[[_0xe6b1('0x47'),_0xe6b1('0x31')],[db[_0xe6b1('0x21')]['fn'](_0xe6b1('0x24'),db[_0xe6b1('0x21')][_0xe6b1('0x22')]('id')),_0xe6b1('0x4a')],[db['sequelize']['fn'](_0xe6b1('0x24'),db[_0xe6b1('0x21')]['fn']('IF',db[_0xe6b1('0x21')][_0xe6b1('0x25')](_0xe6b1('0x26')))),_0xe6b1('0x4b')]],'group':[_0xe6b1('0x47')]})['then'](function(_0xa083c9){logger[_0xe6b1('0xe')](_0xe6b1('0x49'),_0x5a28c6);logger[_0xe6b1('0x1a')](_0xe6b1('0x49'),_0x5a28c6,JSON[_0xe6b1('0x12')](_0xa083c9));_0x262bda(_0xa083c9);})[_0xe6b1('0x1b')](function(_0x505452){logger['error'](_0xe6b1('0x49'),_0x505452[_0xe6b1('0x14')],_0x5a28c6);_0x238339(_0x1c53f2[_0xe6b1('0x13')](0x1f4,_0x505452['message']));});});}; \ No newline at end of file +var _0xd1eb=['client','request','then','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','CmHopperHistory,\x20%s,\x20%s','message','info','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','stringify','AvgHandleTime','raw','sequelize','col','COUNT','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','findAll','where','campaign','name','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`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','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrTotalCallsDays','`state`\x20=\x204,\x201,\x20null','ivrAnswerCallsDay','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xf0f4e3,_0x25552f){var _0xecb2fd=function(_0x1f05ce){while(--_0x1f05ce){_0xf0f4e3['push'](_0xf0f4e3['shift']());}};_0xecb2fd(++_0x25552f);}(_0xd1eb,0xc3));var _0xbd1e=function(_0x100f80,_0xf0376a){_0x100f80=_0x100f80-0x0;var _0x5e9796=_0xd1eb[_0x100f80];return _0x5e9796;};'use strict';var _=require(_0xbd1e('0x0'));var util=require(_0xbd1e('0x1'));var moment=require(_0xbd1e('0x2'));var BPromise=require('bluebird');var rs=require(_0xbd1e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbd1e('0x4'));var logger=require(_0xbd1e('0x5'))(_0xbd1e('0x6'));var config=require(_0xbd1e('0x7'));var jayson=require(_0xbd1e('0x8'));var client=jayson[_0xbd1e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a5e0b,_0x2c5fd3,_0x3934dc){return new BPromise(function(_0x36776c,_0x5d44e){return client[_0xbd1e('0xa')](_0x4a5e0b,_0x3934dc)[_0xbd1e('0xb')](function(_0x221bf4){logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x2c5fd3,_0xbd1e('0xc'));logger[_0xbd1e('0xd')](_0xbd1e('0xe'),_0x2c5fd3,_0xbd1e('0xc'),JSON['stringify'](_0x221bf4));if(_0x221bf4[_0xbd1e('0xf')]){if(_0x221bf4[_0xbd1e('0xf')][_0xbd1e('0x10')]===0x1f4){logger[_0xbd1e('0xf')](_0xbd1e('0x11'),_0x2c5fd3,_0x221bf4[_0xbd1e('0xf')][_0xbd1e('0x12')]);return _0x5d44e(_0x221bf4[_0xbd1e('0xf')][_0xbd1e('0x12')]);}logger[_0xbd1e('0xf')](_0xbd1e('0x11'),_0x2c5fd3,_0x221bf4[_0xbd1e('0xf')][_0xbd1e('0x12')]);return _0x36776c(_0x221bf4[_0xbd1e('0xf')][_0xbd1e('0x12')]);}else{logger[_0xbd1e('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x2c5fd3,_0xbd1e('0xc'));_0x36776c(_0x221bf4['result'][_0xbd1e('0x12')]);}})[_0xbd1e('0x14')](function(_0x525980){logger[_0xbd1e('0xf')](_0xbd1e('0x11'),_0x2c5fd3,_0x525980);_0x5d44e(_0x525980);});});}exports[_0xbd1e('0x15')]=function(_0x211978){var _0x55c126=this;return new Promise(function(_0x1fb242,_0x4cb77b){return db[_0xbd1e('0x16')][_0xbd1e('0x17')](_0x211978[_0xbd1e('0x18')],{'raw':_0x211978[_0xbd1e('0x19')]?_0x211978[_0xbd1e('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xbd1e('0xb')](function(_0x3c8e6d){logger[_0xbd1e('0x13')](_0xbd1e('0x15'),_0x211978);logger[_0xbd1e('0xd')](_0xbd1e('0x15'),_0x211978,JSON[_0xbd1e('0x1a')](_0x3c8e6d));_0x1fb242(_0x3c8e6d);})[_0xbd1e('0x14')](function(_0x208932){logger[_0xbd1e('0xf')](_0xbd1e('0x15'),_0x208932[_0xbd1e('0x12')],_0x211978);_0x4cb77b(_0x55c126['error'](0x1f4,_0x208932['message']));});});};exports[_0xbd1e('0x1b')]=function(_0x3011bd){var _0x1fbe52=this;return new Promise(function(_0x4ef8d9,_0x4a2353){return db[_0xbd1e('0x16')]['findAll']({'raw':_0x3011bd[_0xbd1e('0x19')]?_0x3011bd[_0xbd1e('0x19')][_0xbd1e('0x1c')]===undefined?!![]:![]:!![],'where':_0x3011bd['options']?_0x3011bd[_0xbd1e('0x19')]['where']||null:null,'attributes':[[db[_0xbd1e('0x1d')]['fn']('COUNT',db[_0xbd1e('0x1d')][_0xbd1e('0x1e')]('id')),'predictiveIntervalTotalCalls'],[db[_0xbd1e('0x1d')]['fn'](_0xbd1e('0x1f'),db[_0xbd1e('0x1d')]['fn']('IF',db['sequelize'][_0xbd1e('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0xbd1e('0x21')],[db['sequelize']['fn'](_0xbd1e('0x1f'),db[_0xbd1e('0x1d')]['fn']('IF',db[_0xbd1e('0x1d')][_0xbd1e('0x20')](_0xbd1e('0x22')))),_0xbd1e('0x23')],[db[_0xbd1e('0x1d')]['fn'](_0xbd1e('0x1f'),db[_0xbd1e('0x1d')]['fn']('IF',db[_0xbd1e('0x1d')][_0xbd1e('0x20')](_0xbd1e('0x24')))),_0xbd1e('0x25')],[db['sequelize']['fn'](_0xbd1e('0x26'),db[_0xbd1e('0x1d')]['fn']('IF',db['sequelize'][_0xbd1e('0x20')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0xbd1e('0x1d')]['fn'](_0xbd1e('0x26'),db[_0xbd1e('0x1d')]['fn']('IF',db[_0xbd1e('0x1d')]['literal'](_0xbd1e('0x27')))),_0xbd1e('0x28')]]})[_0xbd1e('0xb')](function(_0xfb7353){logger[_0xbd1e('0x13')]('AvgHandleTime',_0x3011bd);logger[_0xbd1e('0xd')](_0xbd1e('0x1b'),_0x3011bd,JSON[_0xbd1e('0x1a')](_0xfb7353));_0x4ef8d9(_0xfb7353);})[_0xbd1e('0x14')](function(_0x21ae36){logger[_0xbd1e('0xf')](_0xbd1e('0x1b'),_0x21ae36['message'],_0x3011bd);_0x4a2353(_0x1fbe52['error'](0x1f4,_0x21ae36['message']));});});};exports['GetVoiceQueueHopperHistory']=function(_0x215910){var _0x552c83=this;return new Promise(function(_0x507f47,_0x6d5f3){return db[_0xbd1e('0x16')][_0xbd1e('0x29')]({'raw':_0x215910[_0xbd1e('0x19')]?_0x215910[_0xbd1e('0x19')][_0xbd1e('0x1c')]===undefined?!![]:![]:!![],'where':_0x215910[_0xbd1e('0x19')]?_0x215910[_0xbd1e('0x19')][_0xbd1e('0x2a')]||null:null,'attributes':[[_0xbd1e('0x2b'),_0xbd1e('0x2c')],[db['sequelize']['fn'](_0xbd1e('0x1f'),db[_0xbd1e('0x1d')]['fn']('IF',db[_0xbd1e('0x1d')][_0xbd1e('0x20')]('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xbd1e('0x1d')]['fn']('IF',db[_0xbd1e('0x1d')]['literal'](_0xbd1e('0x2d')))),_0xbd1e('0x2e')],[db[_0xbd1e('0x1d')]['fn'](_0xbd1e('0x1f'),db[_0xbd1e('0x1d')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x201,\x20null'))),_0xbd1e('0x2f')],[db[_0xbd1e('0x1d')]['fn'](_0xbd1e('0x1f'),db['sequelize']['fn']('IF',db[_0xbd1e('0x1d')]['literal'](_0xbd1e('0x30')))),'outboundBusyCallsDay'],[db[_0xbd1e('0x1d')]['fn'](_0xbd1e('0x1f'),db[_0xbd1e('0x1d')]['fn']('IF',db['sequelize'][_0xbd1e('0x20')](_0xbd1e('0x31')))),_0xbd1e('0x32')],[db[_0xbd1e('0x1d')]['fn'](_0xbd1e('0x1f'),db[_0xbd1e('0x1d')]['fn']('IF',db['sequelize'][_0xbd1e('0x20')](_0xbd1e('0x33')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn']('COUNT',db[_0xbd1e('0x1d')]['fn']('IF',db[_0xbd1e('0x1d')]['literal'](_0xbd1e('0x34')))),_0xbd1e('0x35')],[db[_0xbd1e('0x1d')]['fn'](_0xbd1e('0x1f'),db[_0xbd1e('0x1d')]['fn']('IF',db[_0xbd1e('0x1d')]['literal'](_0xbd1e('0x36')))),_0xbd1e('0x37')],[db[_0xbd1e('0x1d')]['fn'](_0xbd1e('0x1f'),db[_0xbd1e('0x1d')]['fn']('IF',db['sequelize'][_0xbd1e('0x20')]('`state`\x20=\x2013,\x201,\x20null'))),_0xbd1e('0x38')],[db['sequelize']['fn']('COUNT',db[_0xbd1e('0x1d')]['fn']('IF',db[_0xbd1e('0x1d')][_0xbd1e('0x20')](_0xbd1e('0x39')))),_0xbd1e('0x3a')],[db[_0xbd1e('0x1d')]['fn'](_0xbd1e('0x1f'),db[_0xbd1e('0x1d')]['fn']('IF',db['sequelize'][_0xbd1e('0x20')](_0xbd1e('0x3b')))),'outboundRejectCallsDay'],[db[_0xbd1e('0x1d')]['fn'](_0xbd1e('0x1f'),db[_0xbd1e('0x1d')]['fn']('IF',db[_0xbd1e('0x1d')][_0xbd1e('0x20')]('`state`\x20=\x2016,\x201,\x20null'))),_0xbd1e('0x3c')],[db[_0xbd1e('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbd1e('0x1d')][_0xbd1e('0x20')](_0xbd1e('0x3d')))),'outboundRejectCallsDay'],[db[_0xbd1e('0x1d')]['fn'](_0xbd1e('0x1f'),db['sequelize']['fn']('IF',db[_0xbd1e('0x1d')][_0xbd1e('0x20')](_0xbd1e('0x3e')))),'outboundReCallsDay']],'group':[_0xbd1e('0x2b')]})['then'](function(_0x190449){logger[_0xbd1e('0x13')](_0xbd1e('0x3f'),_0x215910);logger[_0xbd1e('0xd')]('GetVoiceQueueHopperHistory',_0x215910,JSON['stringify'](_0x190449));_0x507f47(_0x190449);})[_0xbd1e('0x14')](function(_0x283ac4){logger[_0xbd1e('0xf')]('GetVoiceQueueHopperHistory',_0x283ac4[_0xbd1e('0x12')],_0x215910);_0x6d5f3(_0x552c83[_0xbd1e('0xf')](0x1f4,_0x283ac4['message']));});});};exports[_0xbd1e('0x40')]=function(_0x476325){var _0x129ece=this;return new Promise(function(_0xcf9d3c,_0x438132){return db[_0xbd1e('0x16')][_0xbd1e('0x29')]({'raw':_0x476325[_0xbd1e('0x19')]?_0x476325['options'][_0xbd1e('0x1c')]===undefined?!![]:![]:!![],'where':_0x476325[_0xbd1e('0x19')]?_0x476325[_0xbd1e('0x19')][_0xbd1e('0x2a')]||null:null,'attributes':[['campaign',_0xbd1e('0x2c')],[db[_0xbd1e('0x1d')]['fn']('COUNT',db[_0xbd1e('0x1d')][_0xbd1e('0x1e')]('id')),_0xbd1e('0x41')],[db[_0xbd1e('0x1d')]['fn'](_0xbd1e('0x1f'),db[_0xbd1e('0x1d')]['fn']('IF',db[_0xbd1e('0x1d')]['literal'](_0xbd1e('0x42')))),_0xbd1e('0x43')]],'group':[_0xbd1e('0x2b')]})['then'](function(_0x3a3598){logger[_0xbd1e('0x13')](_0xbd1e('0x40'),_0x476325);logger[_0xbd1e('0xd')](_0xbd1e('0x40'),_0x476325,JSON[_0xbd1e('0x1a')](_0x3a3598));_0xcf9d3c(_0x3a3598);})[_0xbd1e('0x14')](function(_0x453540){logger[_0xbd1e('0xf')](_0xbd1e('0x40'),_0x453540[_0xbd1e('0x12')],_0x476325);_0x438132(_0x129ece[_0xbd1e('0xf')](0x1f4,_0x453540[_0xbd1e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 067765f..c5c0df7 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 _0x1c3b=['../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','index','/describe','isAuthenticated','post','create','/:id','update','multer','util','path','Router','../../components/auth/service'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x1c3b,0xab));var _0xb1c3=function(_0x449d50,_0x2d87ad){_0x449d50=_0x449d50-0x0;var _0x505c16=_0x1c3b[_0x449d50];return _0x505c16;};'use strict';var multer=require(_0xb1c3('0x0'));var util=require(_0xb1c3('0x1'));var path=require(_0xb1c3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb1c3('0x3')]();var auth=require(_0xb1c3('0x4'));var interaction=require(_0xb1c3('0x5'));var config=require(_0xb1c3('0x6'));var controller=require(_0xb1c3('0x7'));router[_0xb1c3('0x8')]('/',auth['isAuthenticated'](),controller[_0xb1c3('0x9')]);router[_0xb1c3('0x8')](_0xb1c3('0xa'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xb1c3('0xb')](),controller['show']);router[_0xb1c3('0xc')]('/',auth[_0xb1c3('0xb')](),controller[_0xb1c3('0xd')]);router['put'](_0xb1c3('0xe'),auth[_0xb1c3('0xb')](),controller[_0xb1c3('0xf')]);module['exports']=router; \ No newline at end of file +var _0xf698=['put','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','describe','get','/:id','show','post','create'];(function(_0x1bf4d4,_0x5213a8){var _0x150f5d=function(_0x4dcd21){while(--_0x4dcd21){_0x1bf4d4['push'](_0x1bf4d4['shift']());}};_0x150f5d(++_0x5213a8);}(_0xf698,0x1de));var _0x8f69=function(_0x576e2b,_0x328953){_0x576e2b=_0x576e2b-0x0;var _0x46461a=_0xf698[_0x576e2b];return _0x46461a;};'use strict';var multer=require(_0x8f69('0x0'));var util=require(_0x8f69('0x1'));var path=require('path');var timeout=require(_0x8f69('0x2'));var express=require(_0x8f69('0x3'));var router=express['Router']();var auth=require(_0x8f69('0x4'));var interaction=require(_0x8f69('0x5'));var config=require(_0x8f69('0x6'));var controller=require(_0x8f69('0x7'));router['get']('/',auth[_0x8f69('0x8')](),controller['index']);router['get']('/describe',auth[_0x8f69('0x8')](),controller[_0x8f69('0x9')]);router[_0x8f69('0xa')](_0x8f69('0xb'),auth[_0x8f69('0x8')](),controller[_0x8f69('0xc')]);router[_0x8f69('0xd')]('/',auth[_0x8f69('0x8')](),controller[_0x8f69('0xe')]);router[_0x8f69('0xf')](_0x8f69('0xb'),auth[_0x8f69('0x8')](),controller['update']);module[_0x8f69('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 33d8678..66d581a 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 _0x8ef6=['STRING','name','sequelize','exports'];(function(_0x3aa5cf,_0x4879b3){var _0x22854a=function(_0x3e8a49){while(--_0x3e8a49){_0x3aa5cf['push'](_0x3aa5cf['shift']());}};_0x22854a(++_0x4879b3);}(_0x8ef6,0xf2));var _0x68ef=function(_0x4cb621,_0x121e03){_0x4cb621=_0x4cb621-0x0;var _0x35ffda=_0x8ef6[_0x4cb621];return _0x35ffda;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'unique':_0x68ef('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x68ef('0x2')]},'dialPrefix':{'type':Sequelize[_0x68ef('0x2')]}}; \ No newline at end of file +var _0x24ca=['sequelize','STRING','name'];(function(_0x37d3f3,_0xca010f){var _0x185c9c=function(_0x5e2bf2){while(--_0x5e2bf2){_0x37d3f3['push'](_0x37d3f3['shift']());}};_0x185c9c(++_0xca010f);}(_0x24ca,0x1bc));var _0xa24c=function(_0x260f28,_0x4e9b30){_0x260f28=_0x260f28-0x0;var _0x3aefcc=_0x24ca[_0x260f28];return _0x3aefcc;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'unique':_0xa24c('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa24c('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 2378510..a9b5588 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 _0xcac2=['ids','success','dataValues','errors','message','getContacts','CmCustomField','CustomFields','map','format','raw','getContactsCsv','concat','cf_%d','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','number','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','localhost','socket.io-emitter','redis','./cmList.socket','register','sendStatus','status','json','count','offset','limit','Content-Range','reject','save','update','then','get','Lists','UserProfileResource','destroy','end','error','stack','name','send','index','CmList','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','key','VIRTUAL','field','filter','options','include','findAll','rows','catch','params','includeAll','find','create','body','user','role','userProfileId','autoAssociation','describe','ListId','Disposition','getDispositions','findOne','removeDispositions','addContacts','CmContact','isArray','tags','join','push','each','omit'];(function(_0x20945a,_0x1c99ad){var _0x260522=function(_0x3d402c){while(--_0x3d402c){_0x20945a['push'](_0x20945a['shift']());}};_0x260522(++_0x1c99ad);}(_0xcac2,0x1de));var _0x2cac=function(_0x4bf8e9,_0x3c7e32){_0x4bf8e9=_0x4bf8e9-0x0;var _0x413e1f=_0xcac2[_0x4bf8e9];return _0x413e1f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2cac('0x0'));var zipdir=require(_0x2cac('0x1'));var jsonpatch=require(_0x2cac('0x2'));var rp=require(_0x2cac('0x3'));var moment=require(_0x2cac('0x4'));var BPromise=require(_0x2cac('0x5'));var Mustache=require(_0x2cac('0x6'));var util=require('util');var path=require(_0x2cac('0x7'));var sox=require(_0x2cac('0x8'));var csv=require(_0x2cac('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2cac('0xa'));var squel=require(_0x2cac('0xb'));var crypto=require(_0x2cac('0xc'));var jsforce=require(_0x2cac('0xd'));var deskjs=require(_0x2cac('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2cac('0xf'));var Papa=require(_0x2cac('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2cac('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2cac('0x12'))(_0x2cac('0x13'));var utils=require('../../config/utils');var config=require(_0x2cac('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x2cac('0x15')](config['redis'],{'host':_0x2cac('0x16'),'port':0x18eb});var socket=require(_0x2cac('0x17'))(new Redis(config[_0x2cac('0x18')]));require(_0x2cac('0x19'))[_0x2cac('0x1a')](socket);function respondWithStatusCode(_0x1e9674,_0x3e8053){_0x3e8053=_0x3e8053||0xcc;return function(_0x2452da){if(_0x2452da){return _0x1e9674[_0x2cac('0x1b')](_0x3e8053);}return _0x1e9674[_0x2cac('0x1c')](_0x3e8053)['end']();};}function respondWithResult(_0x58f93a,_0x22dce2){_0x22dce2=_0x22dce2||0xc8;return function(_0x22fc57){if(_0x22fc57){return _0x58f93a[_0x2cac('0x1c')](_0x22dce2)[_0x2cac('0x1d')](_0x22fc57);}};}function respondWithFilteredResult(_0x37bff8,_0x5bd216){return function(_0x46079e){if(_0x46079e){var _0x170f6a=_0x46079e[_0x2cac('0x1e')],_0x3794c4=_0x5bd216[_0x2cac('0x1f')],_0x28bb7e=_0x5bd216[_0x2cac('0x1f')]+_0x5bd216[_0x2cac('0x20')],_0x3cb619;if(_0x28bb7e>=_0x170f6a){_0x28bb7e=_0x170f6a;_0x3cb619=0xc8;}else{_0x3cb619=0xce;}_0x37bff8[_0x2cac('0x1c')](_0x3cb619);return _0x37bff8['set'](_0x2cac('0x21'),_0x3794c4+'-'+_0x28bb7e+'/'+_0x170f6a)[_0x2cac('0x1d')](_0x46079e);}return null;};}function patchUpdates(_0x3109c7){return function(_0x35c22d){try{jsonpatch['apply'](_0x35c22d,_0x3109c7,!![]);}catch(_0x2c6164){return BPromise[_0x2cac('0x22')](_0x2c6164);}return _0x35c22d[_0x2cac('0x23')]();};}function saveUpdates(_0x10a0ef,_0x2abf73){return function(_0x17153b){if(_0x17153b){return _0x17153b[_0x2cac('0x24')](_0x10a0ef)['then'](function(_0x13eda9){return _0x13eda9;});}return null;};}function removeEntity(_0x3523e8,_0x6a777a){return function(_0x47d9f4){if(_0x47d9f4){return _0x47d9f4['destroy']()[_0x2cac('0x25')](function(){var _0xad7943=_0x47d9f4[_0x2cac('0x26')]({'plain':!![]});var _0x2f13a0=_0x2cac('0x27');return db[_0x2cac('0x28')][_0x2cac('0x29')]({'where':{'type':_0x2f13a0,'resourceId':_0xad7943['id']}})[_0x2cac('0x25')](function(){return _0x47d9f4;});})[_0x2cac('0x25')](function(){_0x3523e8[_0x2cac('0x1c')](0xcc)[_0x2cac('0x2a')]();});}};}function handleEntityNotFound(_0x351ae4,_0x9f6eb6){return function(_0x4ba14e){if(!_0x4ba14e){_0x351ae4[_0x2cac('0x1b')](0x194);}return _0x4ba14e;};}function handleError(_0x1cd473,_0x17284c){_0x17284c=_0x17284c||0x1f4;return function(_0x2d2cd5){logger[_0x2cac('0x2b')](_0x2d2cd5[_0x2cac('0x2c')]);if(_0x2d2cd5['name']){delete _0x2d2cd5[_0x2cac('0x2d')];}_0x1cd473['status'](_0x17284c)[_0x2cac('0x2e')](_0x2d2cd5);};}exports[_0x2cac('0x2f')]=function(_0x19d2ba,_0x50f3de){var _0x39925f={},_0x6fdb={},_0x2df544={'count':0x0,'rows':[]};var _0x246236=db[_0x2cac('0x30')][_0x2cac('0x31')];_0x6fdb[_0x2cac('0x32')]=_[_0x2cac('0x33')](_0x246236);_0x6fdb['query']=_[_0x2cac('0x33')](_0x19d2ba[_0x2cac('0x34')]);_0x6fdb['filters']=_[_0x2cac('0x35')](_0x6fdb[_0x2cac('0x32')],_0x6fdb[_0x2cac('0x34')]);_0x39925f[_0x2cac('0x36')]=_[_0x2cac('0x35')](_0x6fdb[_0x2cac('0x32')],qs['fields'](_0x19d2ba[_0x2cac('0x34')][_0x2cac('0x37')]));_0x39925f[_0x2cac('0x36')]=_0x39925f['attributes'][_0x2cac('0x38')]?_0x39925f[_0x2cac('0x36')]:_0x6fdb['model'];if(!_0x19d2ba[_0x2cac('0x34')][_0x2cac('0x39')](_0x2cac('0x3a'))){_0x39925f['limit']=qs[_0x2cac('0x20')](_0x19d2ba['query'][_0x2cac('0x20')]);_0x39925f['offset']=qs[_0x2cac('0x1f')](_0x19d2ba[_0x2cac('0x34')][_0x2cac('0x1f')]);}_0x39925f[_0x2cac('0x3b')]=qs[_0x2cac('0x3c')](_0x19d2ba[_0x2cac('0x34')][_0x2cac('0x3c')]);_0x39925f[_0x2cac('0x3d')]=qs[_0x2cac('0x3e')](_[_0x2cac('0x3f')](_0x19d2ba[_0x2cac('0x34')],_0x6fdb[_0x2cac('0x3e')]));if(_0x19d2ba[_0x2cac('0x34')]['filter']){_0x39925f[_0x2cac('0x3d')]=_[_0x2cac('0x40')](_0x39925f[_0x2cac('0x3d')],{'$or':_['map'](_0x246236,function(_0xbd54d1){if(_0xbd54d1[_0x2cac('0x41')][_0x2cac('0x42')]!==_0x2cac('0x43')){var _0x299b18={};_0x299b18[_0xbd54d1[_0x2cac('0x44')]]={'$like':'%'+_0x19d2ba['query'][_0x2cac('0x45')]+'%'};return _0x299b18;}})});}_0x39925f=_['merge']({},_0x39925f,_0x19d2ba[_0x2cac('0x46')]);var _0x348581={'where':_0x39925f[_0x2cac('0x3d')]};return db[_0x2cac('0x30')][_0x2cac('0x1e')](_0x348581)['then'](function(_0x2f3577){_0x2df544[_0x2cac('0x1e')]=_0x2f3577;if(_0x19d2ba[_0x2cac('0x34')]['includeAll']){_0x39925f[_0x2cac('0x47')]=[{'all':!![]}];}return db[_0x2cac('0x30')][_0x2cac('0x48')](_0x39925f);})[_0x2cac('0x25')](function(_0x12c8db){_0x2df544[_0x2cac('0x49')]=_0x12c8db;return _0x2df544;})['then'](respondWithFilteredResult(_0x50f3de,_0x39925f))[_0x2cac('0x4a')](handleError(_0x50f3de,null));};exports['show']=function(_0x4b7745,_0x16848a){var _0x2b0890={'raw':![],'where':{'id':_0x4b7745[_0x2cac('0x4b')]['id']}},_0x222d17={};_0x222d17[_0x2cac('0x32')]=_[_0x2cac('0x33')](db[_0x2cac('0x30')]['rawAttributes']);_0x222d17[_0x2cac('0x34')]=_[_0x2cac('0x33')](_0x4b7745[_0x2cac('0x34')]);_0x222d17[_0x2cac('0x3e')]=_[_0x2cac('0x35')](_0x222d17[_0x2cac('0x32')],_0x222d17[_0x2cac('0x34')]);_0x2b0890[_0x2cac('0x36')]=_[_0x2cac('0x35')](_0x222d17['model'],qs[_0x2cac('0x37')](_0x4b7745[_0x2cac('0x34')][_0x2cac('0x37')]));_0x2b0890[_0x2cac('0x36')]=_0x2b0890[_0x2cac('0x36')][_0x2cac('0x38')]?_0x2b0890[_0x2cac('0x36')]:_0x222d17[_0x2cac('0x32')];if(_0x4b7745[_0x2cac('0x34')][_0x2cac('0x4c')]){_0x2b0890['include']=[{'all':!![]}];}_0x2b0890=_[_0x2cac('0x40')]({},_0x2b0890,_0x4b7745[_0x2cac('0x46')]);return db[_0x2cac('0x30')][_0x2cac('0x4d')](_0x2b0890)[_0x2cac('0x25')](handleEntityNotFound(_0x16848a,null))[_0x2cac('0x25')](respondWithResult(_0x16848a,null))['catch'](handleError(_0x16848a,null));};exports[_0x2cac('0x4e')]=function(_0x566413,_0x226652){return db['CmList'][_0x2cac('0x4e')](_0x566413[_0x2cac('0x4f')],{})['then'](function(_0x242cea){var _0xd3d473=_0x566413[_0x2cac('0x50')]['get']({'plain':!![]});if(!_0xd3d473)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd3d473[_0x2cac('0x51')]===_0x2cac('0x50')){var _0x408100=_0x242cea[_0x2cac('0x26')]({'plain':!![]});var _0x3a96e2=_0x2cac('0x27');return db['UserProfileSection'][_0x2cac('0x4d')]({'where':{'name':_0x3a96e2,'userProfileId':_0xd3d473[_0x2cac('0x52')]},'raw':!![]})[_0x2cac('0x25')](function(_0x43f23d){if(_0x43f23d&&_0x43f23d[_0x2cac('0x53')]===0x0){return db[_0x2cac('0x28')]['create']({'name':_0x408100[_0x2cac('0x2d')],'resourceId':_0x408100['id'],'type':_0x43f23d[_0x2cac('0x2d')],'sectionId':_0x43f23d['id']},{})[_0x2cac('0x25')](function(){return _0x242cea;});}else{return _0x242cea;}})[_0x2cac('0x4a')](function(_0x1f75f6){logger[_0x2cac('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f75f6);throw _0x1f75f6;});}return _0x242cea;})[_0x2cac('0x25')](respondWithResult(_0x226652,0xc9))[_0x2cac('0x4a')](handleError(_0x226652,null));};exports[_0x2cac('0x24')]=function(_0x4af850,_0x39bb53){if(_0x4af850[_0x2cac('0x4f')]['id']){delete _0x4af850[_0x2cac('0x4f')]['id'];}return db[_0x2cac('0x30')][_0x2cac('0x4d')]({'where':{'id':_0x4af850[_0x2cac('0x4b')]['id']}})[_0x2cac('0x25')](handleEntityNotFound(_0x39bb53,null))[_0x2cac('0x25')](saveUpdates(_0x4af850[_0x2cac('0x4f')],null))[_0x2cac('0x25')](respondWithResult(_0x39bb53,null))[_0x2cac('0x4a')](handleError(_0x39bb53,null));};exports[_0x2cac('0x29')]=function(_0x390896,_0x626d20){return db[_0x2cac('0x30')]['find']({'where':{'id':_0x390896['params']['id']}})['then'](handleEntityNotFound(_0x626d20,null))['then'](removeEntity(_0x626d20,null))['catch'](handleError(_0x626d20,null));};exports['describe']=function(_0x1afc28,_0x50b957){return db['CmList'][_0x2cac('0x54')]()[_0x2cac('0x25')](respondWithResult(_0x50b957,null))[_0x2cac('0x4a')](handleError(_0x50b957,null));};exports['addDisposition']=function(_0x2cff40,_0x1101be,_0x2c4d9f){if(_0x2cff40[_0x2cac('0x4f')]['id']){delete _0x2cff40['body']['id'];}return db[_0x2cac('0x30')][_0x2cac('0x4d')]({'where':{'id':_0x2cff40['params']['id']}})[_0x2cac('0x25')](handleEntityNotFound(_0x1101be,null))['then'](function(_0x1d103d){if(_0x1d103d){_0x2cff40['body'][_0x2cac('0x55')]=_0x1d103d['id'];return db[_0x2cac('0x56')]['create'](_0x2cff40[_0x2cac('0x4f')]);}})[_0x2cac('0x25')](respondWithResult(_0x1101be,null))[_0x2cac('0x4a')](handleError(_0x1101be,null));};exports[_0x2cac('0x57')]=function(_0x200045,_0x23b27e,_0x514cd3){var _0x35e44f={'raw':![],'where':{}};var _0x2a235d={};var _0x326dab={'count':0x0,'rows':[]};return db['CmList'][_0x2cac('0x58')]({'where':{'id':_0x200045[_0x2cac('0x4b')]['id']}})[_0x2cac('0x25')](handleEntityNotFound(_0x23b27e,null))[_0x2cac('0x25')](function(_0x253462){if(_0x253462){_0x2a235d[_0x2cac('0x32')]=_[_0x2cac('0x33')](db[_0x2cac('0x56')][_0x2cac('0x31')]);_0x2a235d[_0x2cac('0x34')]=_[_0x2cac('0x33')](_0x200045[_0x2cac('0x34')]);_0x2a235d['filters']=_['intersection'](_0x2a235d[_0x2cac('0x32')],_0x2a235d[_0x2cac('0x34')]);_0x35e44f[_0x2cac('0x36')]=_[_0x2cac('0x35')](_0x2a235d[_0x2cac('0x32')],qs[_0x2cac('0x37')](_0x200045[_0x2cac('0x34')]['fields']));_0x35e44f[_0x2cac('0x36')]=_0x35e44f[_0x2cac('0x36')][_0x2cac('0x38')]?_0x35e44f[_0x2cac('0x36')]:_0x2a235d[_0x2cac('0x32')];if(!_0x200045[_0x2cac('0x34')][_0x2cac('0x39')](_0x2cac('0x3a'))){_0x35e44f[_0x2cac('0x20')]=qs[_0x2cac('0x20')](_0x200045[_0x2cac('0x34')][_0x2cac('0x20')]);_0x35e44f[_0x2cac('0x1f')]=qs[_0x2cac('0x1f')](_0x200045[_0x2cac('0x34')]['offset']);}_0x35e44f[_0x2cac('0x3b')]=qs[_0x2cac('0x3c')](_0x200045[_0x2cac('0x34')][_0x2cac('0x3c')]);_0x35e44f[_0x2cac('0x3d')]=qs[_0x2cac('0x3e')](_[_0x2cac('0x3f')](_0x200045[_0x2cac('0x34')],_0x2a235d['filters']));_0x35e44f[_0x2cac('0x3d')]['ListId']=_0x253462['id'];if(_0x200045[_0x2cac('0x34')]['filter']){_0x35e44f[_0x2cac('0x3d')]=_['merge'](_0x35e44f['where'],{'$or':_['map'](_0x35e44f['attributes'],function(_0x3d9645){var _0x28a034={};_0x28a034[_0x3d9645]={'$like':'%'+_0x200045[_0x2cac('0x34')]['filter']+'%'};return _0x28a034;})});}_0x35e44f=_[_0x2cac('0x40')]({},_0x35e44f,_0x200045['options']);return db[_0x2cac('0x56')]['count']({'where':_0x35e44f['where']})['then'](function(_0x2cbe8b){_0x326dab['count']=_0x2cbe8b;if(_0x200045[_0x2cac('0x34')][_0x2cac('0x4c')]){_0x35e44f[_0x2cac('0x47')]=[{'all':!![]}];}return db['Disposition'][_0x2cac('0x48')](_0x35e44f);})[_0x2cac('0x25')](function(_0x19ff4e){_0x326dab[_0x2cac('0x49')]=_0x19ff4e;return _0x326dab;});}})['then'](respondWithFilteredResult(_0x23b27e,_0x35e44f))[_0x2cac('0x4a')](handleError(_0x23b27e,null));};exports[_0x2cac('0x59')]=function(_0x9d17e3,_0x35a334,_0x495ce3){return db[_0x2cac('0x30')][_0x2cac('0x4d')]({'where':{'id':_0x9d17e3[_0x2cac('0x4b')]['id']}})['then'](handleEntityNotFound(_0x35a334,null))[_0x2cac('0x25')](function(_0x1400b7){if(_0x1400b7){return _0x1400b7[_0x2cac('0x59')](_0x9d17e3[_0x2cac('0x34')]['ids']);}})[_0x2cac('0x25')](respondWithStatusCode(_0x35a334,null))[_0x2cac('0x4a')](handleError(_0x35a334,null));};exports[_0x2cac('0x5a')]=function(_0x27c759,_0x16e82b,_0x2bf453){return db[_0x2cac('0x30')][_0x2cac('0x4d')]({'where':{'id':_0x27c759['params']['id']}})[_0x2cac('0x25')](handleEntityNotFound(_0x16e82b,null))[_0x2cac('0x25')](function(_0x5a9a32){if(_0x5a9a32){var _0x3b70d8=[];var _0x409f27={'success':[],'errors':[]};return db[_0x2cac('0x5b')][_0x2cac('0x54')]()[_0x2cac('0x25')](function(_0x238da7){if(_0x27c759[_0x2cac('0x4f')]['tags']&&_[_0x2cac('0x5c')](_0x27c759['body']['tags'])){if(_0x27c759['body'][_0x2cac('0x5d')][_0x2cac('0x38')]){_0x27c759[_0x2cac('0x4f')][_0x2cac('0x5d')]=_0x27c759[_0x2cac('0x4f')]['tags'][_0x2cac('0x5e')](';')+';';}else{_0x27c759['body'][_0x2cac('0x5d')]=null;}}else{_0x27c759[_0x2cac('0x4f')][_0x2cac('0x5d')]=null;}if(_0x27c759[_0x2cac('0x4f')]&&_[_0x2cac('0x5c')](_0x27c759[_0x2cac('0x4f')])){for(var _0x282503=0x0;_0x282503<_0x27c759[_0x2cac('0x4f')][_0x2cac('0x38')];_0x282503+=0x1){_0x27c759['body'][_0x282503][_0x2cac('0x55')]=_0x27c759[_0x2cac('0x4b')]['id'];_0x3b70d8[_0x2cac('0x5f')](_0x27c759[_0x2cac('0x4f')][_0x282503]);}return BPromise[_0x2cac('0x60')](_0x3b70d8,function(_0x1295d5){return db[_0x2cac('0x5b')][_0x2cac('0x4e')](_[_0x2cac('0x61')](_0x1295d5,[_0x2cac('0x62'),'id'])||{},{'fields':_[_0x2cac('0x33')](_0x238da7),'raw':!![]})['then'](function(_0x1838ce){_0x409f27[_0x2cac('0x63')][_0x2cac('0x5f')](_0x1838ce[_0x2cac('0x64')]);})[_0x2cac('0x4a')](function(_0x537978){_0x409f27[_0x2cac('0x65')]['push']({'data':_0x1295d5,'error':_0x537978[_0x2cac('0x66')]});});})[_0x2cac('0x25')](function(_0xe954e7){return _0x409f27;})[_0x2cac('0x4a')](function(_0xb1bd3e){return _0xb1bd3e;});}else{_0x16e82b[_0x2cac('0x1c')](0x190)[_0x2cac('0x1d')]({'message':'Malformed\x20request\x20syntax'});}});}})['then'](respondWithResult(_0x16e82b,null))[_0x2cac('0x4a')](handleError(_0x16e82b,null));};exports[_0x2cac('0x67')]=function(_0x2f7383,_0x172eb1,_0x1a07f7){var _0x573baa;return db[_0x2cac('0x30')]['find']({'where':{'id':_0x2f7383[_0x2cac('0x4b')]['id']},'include':[{'model':db[_0x2cac('0x68')],'as':_0x2cac('0x69')}]})[_0x2cac('0x25')](handleEntityNotFound(_0x172eb1,null))['then'](function(_0x17104a){if(_0x17104a){_0x573baa=_0x17104a;return db[_0x2cac('0x5b')][_0x2cac('0x31')];}})[_0x2cac('0x25')](function(_0x537a8a){if(_0x537a8a){var _0x2175f5={};var _0x58bf46={};_0x58bf46[_0x2cac('0x32')]=_['concat'](_[_0x2cac('0x33')](_0x537a8a),_[_0x2cac('0x6a')](_0x573baa['CustomFields'],function(_0x4b2f46){return util[_0x2cac('0x6b')]('cf_%d',_0x4b2f46['id']);}));_0x58bf46[_0x2cac('0x34')]=_['keys'](_0x2f7383['query']);_0x58bf46['filters']=_['intersection'](_0x58bf46[_0x2cac('0x32')],_0x58bf46[_0x2cac('0x34')]);_0x2175f5[_0x2cac('0x36')]=_[_0x2cac('0x35')](_0x58bf46['model'],qs[_0x2cac('0x37')](_0x2f7383[_0x2cac('0x34')][_0x2cac('0x37')]));_0x2175f5[_0x2cac('0x36')]=_0x2175f5[_0x2cac('0x36')][_0x2cac('0x38')]?_0x2175f5[_0x2cac('0x36')]:_0x58bf46[_0x2cac('0x32')];if(!_0x2f7383[_0x2cac('0x34')][_0x2cac('0x39')](_0x2cac('0x3a'))){_0x2175f5['limit']=qs[_0x2cac('0x20')](_0x2f7383[_0x2cac('0x34')][_0x2cac('0x20')]);_0x2175f5[_0x2cac('0x1f')]=qs[_0x2cac('0x1f')](_0x2f7383['query'][_0x2cac('0x1f')]);}_0x2175f5[_0x2cac('0x3b')]=qs[_0x2cac('0x3c')](_0x2f7383[_0x2cac('0x34')][_0x2cac('0x3c')]);_0x2175f5[_0x2cac('0x3d')]=qs['filters'](_[_0x2cac('0x3f')](_0x2f7383['query'],_0x58bf46[_0x2cac('0x3e')]));_0x2175f5[_0x2cac('0x6c')]=!![];if(_0x2f7383[_0x2cac('0x34')][_0x2cac('0x45')]){_0x2175f5[_0x2cac('0x3d')]=_[_0x2cac('0x40')](_0x2175f5[_0x2cac('0x3d')],{'$or':_[_0x2cac('0x6a')](_0x2175f5[_0x2cac('0x36')],function(_0x633e52){var _0x3d7cab={};_0x3d7cab[_0x633e52]={'$like':'%'+_0x2f7383[_0x2cac('0x34')][_0x2cac('0x45')]+'%'};return _0x3d7cab;})});}_0x2175f5=_[_0x2cac('0x40')]({},_0x2175f5,_0x2f7383[_0x2cac('0x46')]);return _0x573baa[_0x2cac('0x67')](_0x2175f5);}})['then'](respondWithResult(_0x172eb1,null))[_0x2cac('0x4a')](handleError(_0x172eb1,null));};exports[_0x2cac('0x6d')]=function(_0x2ef759,_0x35d576,_0x7b38d7){var _0x42637f;return db[_0x2cac('0x30')][_0x2cac('0x4d')]({'where':{'id':_0x2ef759[_0x2cac('0x4b')]['id']},'include':[{'model':db[_0x2cac('0x68')],'as':'CustomFields'}]})[_0x2cac('0x25')](handleEntityNotFound(_0x35d576,null))[_0x2cac('0x25')](function(_0x12d072){if(_0x12d072){_0x42637f=_0x12d072;return db['CmContact'][_0x2cac('0x31')];}})[_0x2cac('0x25')](function(_0x1536d3){if(_0x1536d3){var _0x4641f8={};var _0x4ab7ac={};_0x4ab7ac['model']=_[_0x2cac('0x6e')](_['keys'](_0x1536d3),_[_0x2cac('0x6a')](_0x42637f[_0x2cac('0x69')],function(_0x111a69){return util['format'](_0x2cac('0x6f'),_0x111a69['id']);}));_0x4ab7ac[_0x2cac('0x34')]=_['keys'](_0x2ef759[_0x2cac('0x34')]);_0x4ab7ac[_0x2cac('0x3e')]=_['intersection'](_0x4ab7ac['model'],_0x4ab7ac['query']);_0x4641f8['attributes']=_['intersection'](_0x4ab7ac[_0x2cac('0x32')],qs['fields'](_0x2ef759[_0x2cac('0x34')]['fields']));_0x4641f8[_0x2cac('0x36')]=_0x4641f8[_0x2cac('0x36')][_0x2cac('0x38')]?_0x4641f8[_0x2cac('0x36')]:_0x4ab7ac[_0x2cac('0x32')];if(!_0x2ef759[_0x2cac('0x34')]['hasOwnProperty'](_0x2cac('0x3a'))){_0x4641f8[_0x2cac('0x20')]=qs[_0x2cac('0x20')](_0x2ef759['query']['limit']);_0x4641f8['offset']=qs[_0x2cac('0x1f')](_0x2ef759['query'][_0x2cac('0x1f')]);}_0x4641f8[_0x2cac('0x3b')]=qs['sort'](_0x2ef759['query'][_0x2cac('0x3c')]);_0x4641f8[_0x2cac('0x3d')]=qs['filters'](_['pick'](_0x2ef759['query'],_0x4ab7ac[_0x2cac('0x3e')]));_0x4641f8[_0x2cac('0x6c')]=!![];if(_0x2ef759[_0x2cac('0x34')][_0x2cac('0x45')]){_0x4641f8[_0x2cac('0x3d')]=_[_0x2cac('0x40')](_0x4641f8[_0x2cac('0x3d')],{'$or':_[_0x2cac('0x6a')](_0x4641f8[_0x2cac('0x36')],function(_0x2a6c22){var _0x14f473={};_0x14f473[_0x2a6c22]={'$like':'%'+_0x2ef759[_0x2cac('0x34')][_0x2cac('0x45')]+'%'};return _0x14f473;})});}_0x4641f8=_[_0x2cac('0x40')]({},_0x4641f8,_0x2ef759[_0x2cac('0x46')]);return _0x42637f[_0x2cac('0x67')](_0x4641f8);}})[_0x2cac('0x25')](function(_0x1d4908){if(!_[_0x2cac('0x70')](_0x1d4908)){var _0x49f9a3=toCsv(_0x1d4908);var _0x5b3c04=Date[_0x2cac('0x71')]();fs[_0x2cac('0x72')](util['format'](_0x2cac('0x73'),_0x42637f['id'],_0x5b3c04),_0x49f9a3);_0x35d576[_0x2cac('0x74')](_0x2cac('0x75'),'attachment;\x20filename='+util['format'](_0x2cac('0x76'),_0x42637f['id'],_0x5b3c04));_0x35d576[_0x2cac('0x74')](_0x2cac('0x77'),_0x2cac('0x78'));return _0x35d576[_0x2cac('0x79')](util[_0x2cac('0x6b')](_0x2cac('0x73'),_0x42637f['id'],_0x5b3c04));}else{return _0x35d576[_0x2cac('0x1b')](0xcc);}})['catch'](handleError(_0x35d576,null));};exports[_0x2cac('0x7a')]=function(_0x114de7,_0x8a4398,_0x124f03){var _0x1e6ba6;delete _0x114de7[_0x2cac('0x4f')]['id'];return db[_0x2cac('0x30')][_0x2cac('0x58')]({'where':{'id':_0x114de7['params']['id']}})[_0x2cac('0x25')](handleEntityNotFound(_0x8a4398,null))[_0x2cac('0x25')](function(_0x4f875d){if(_0x4f875d){return db[_0x2cac('0x7b')][_0x2cac('0x7c')](function(_0x191b66){return db['CmCustomField'][_0x2cac('0x4e')](_0x114de7[_0x2cac('0x4f')],{'transaction':_0x191b66})[_0x2cac('0x25')](function(_0x1514f9){_0x1e6ba6=_0x1514f9;return _0x4f875d[_0x2cac('0x7d')](_0x1514f9,{'transaction':_0x191b66});})[_0x2cac('0x25')](function(){var _0x42e98d={'type':db[_0x2cac('0x7e')][_0x2cac('0x7f')],'transaction':_0x191b66};switch(_0x114de7['body'][_0x2cac('0x41')]){case'text':_0x42e98d[_0x2cac('0x41')]=db['Sequelize']['TEXT'];break;case _0x2cac('0x80'):_0x42e98d[_0x2cac('0x41')]=db['Sequelize']['INTEGER'];break;case'switch':_0x42e98d['type']=db[_0x2cac('0x7e')]['BOOLEAN'];_0x42e98d[_0x2cac('0x81')]=![];break;default:}return db[_0x2cac('0x7b')][_0x2cac('0x82')][_0x2cac('0x83')](_0x2cac('0x84'),util[_0x2cac('0x6b')](_0x2cac('0x85'),_0x1e6ba6['id']),_0x42e98d);})['then'](function(){return _0x1e6ba6;});});}})[_0x2cac('0x25')](respondWithResult(_0x8a4398,null))[_0x2cac('0x4a')](handleError(_0x8a4398,null));};exports[_0x2cac('0x86')]=function(_0x11253a,_0x361148,_0x2b4841){var _0xe06683={};var _0x5251f1={};var _0x150c7a;var _0x41959b;return db[_0x2cac('0x30')]['findOne']({'where':{'id':_0x11253a[_0x2cac('0x4b')]['id']}})[_0x2cac('0x25')](handleEntityNotFound(_0x361148,null))[_0x2cac('0x25')](function(_0x2f8280){if(_0x2f8280){_0x150c7a=_0x2f8280;_0x5251f1[_0x2cac('0x32')]=_['keys'](db[_0x2cac('0x68')][_0x2cac('0x31')]);_0x5251f1[_0x2cac('0x34')]=_[_0x2cac('0x33')](_0x11253a[_0x2cac('0x34')]);_0x5251f1[_0x2cac('0x3e')]=_['intersection'](_0x5251f1[_0x2cac('0x32')],_0x5251f1[_0x2cac('0x34')]);_0xe06683[_0x2cac('0x36')]=_['intersection'](_0x5251f1[_0x2cac('0x32')],qs[_0x2cac('0x37')](_0x11253a[_0x2cac('0x34')][_0x2cac('0x37')]));_0xe06683[_0x2cac('0x36')]=_0xe06683[_0x2cac('0x36')]['length']?_0xe06683['attributes']:_0x5251f1['model'];_0xe06683[_0x2cac('0x3b')]=qs[_0x2cac('0x3c')](_0x11253a[_0x2cac('0x34')][_0x2cac('0x3c')]);_0xe06683[_0x2cac('0x3d')]=qs[_0x2cac('0x3e')](_[_0x2cac('0x3f')](_0x11253a[_0x2cac('0x34')],_0x5251f1[_0x2cac('0x3e')]));_0xe06683['where']=_[_0x2cac('0x40')](_0xe06683[_0x2cac('0x3d')],{'$or':[{'ListId':_0x2f8280['id']},{'ListId':null}]});if(_0x11253a['query']['filter']){_0xe06683[_0x2cac('0x3d')]=_[_0x2cac('0x40')](_0xe06683[_0x2cac('0x3d')],{'$or':_['map'](_0xe06683[_0x2cac('0x36')],function(_0x46e87c){var _0xe69c56={};_0xe69c56[_0x46e87c]={'$like':'%'+_0x11253a['query'][_0x2cac('0x45')]+'%'};return _0xe69c56;})});}_0xe06683=_[_0x2cac('0x40')]({},_0xe06683,_0x11253a[_0x2cac('0x46')]);return db[_0x2cac('0x68')][_0x2cac('0x87')](_0xe06683);}})[_0x2cac('0x25')](respondWithResult(_0x361148,null))[_0x2cac('0x4a')](handleError(_0x361148,null));};exports[_0x2cac('0x88')]=function(_0x142214,_0x59b9a1,_0x1e49a2){return db[_0x2cac('0x30')][_0x2cac('0x4d')]({'where':{'id':_0x142214[_0x2cac('0x4b')]['id']}})['then'](handleEntityNotFound(_0x59b9a1,null))[_0x2cac('0x25')](function(_0x563c19){if(_0x563c19){return _0x563c19[_0x2cac('0x88')](_0x142214[_0x2cac('0x4f')][_0x2cac('0x62')],_[_0x2cac('0x61')](_0x142214[_0x2cac('0x4f')],[_0x2cac('0x62'),'id'])||{})[_0x2cac('0x89')](function(_0x4a217d){for(var _0x47b091=0x0;_0x47b091<_0x142214['body'][_0x2cac('0x62')][_0x2cac('0x38')];_0x47b091+=0x1){socket[_0x2cac('0x8a')](_0x2cac('0x8b'),{'UserId':_0x142214[_0x2cac('0x4f')]['ids'][_0x47b091],'CmListId':_0x142214[_0x2cac('0x4b')]['id']});}return _0x4a217d;});}})[_0x2cac('0x25')](respondWithResult(_0x59b9a1,null))[_0x2cac('0x4a')](handleError(_0x59b9a1,null));};exports[_0x2cac('0x8c')]=function(_0x267cdb,_0x5786b0,_0x31f484){return db[_0x2cac('0x30')][_0x2cac('0x4d')]({'where':{'id':_0x267cdb[_0x2cac('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5786b0,null))[_0x2cac('0x25')](function(_0x962c86){if(_0x962c86){return _0x962c86[_0x2cac('0x8c')](_0x267cdb['query'][_0x2cac('0x62')])[_0x2cac('0x25')](function(){if(_[_0x2cac('0x5c')](_0x267cdb[_0x2cac('0x34')][_0x2cac('0x62')])){for(var _0x398a79=0x0;_0x398a79<_0x267cdb['query'][_0x2cac('0x62')]['length'];_0x398a79+=0x1){socket[_0x2cac('0x8a')](_0x2cac('0x8d'),{'UserId':Number(_0x267cdb['query'][_0x2cac('0x62')][_0x398a79]),'CmListId':Number(_0x267cdb[_0x2cac('0x4b')]['id'])});}}else{socket['emit']('userCmList:remove',{'UserId':Number(_0x267cdb['query'][_0x2cac('0x62')]),'CmListId':Number(_0x267cdb[_0x2cac('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x5786b0,null))['catch'](handleError(_0x5786b0,null));};exports[_0x2cac('0x8e')]=function(_0xaf7fe6,_0x56c230,_0x2894e9){var _0x2867af={};var _0x572f8a={};var _0x9f5b5b;var _0x5790da;return db['CmList'][_0x2cac('0x58')]({'where':{'id':_0xaf7fe6[_0x2cac('0x4b')]['id']}})[_0x2cac('0x25')](handleEntityNotFound(_0x56c230,null))[_0x2cac('0x25')](function(_0x219b2e){if(_0x219b2e){_0x9f5b5b=_0x219b2e;_0x572f8a['model']=_['keys'](db[_0x2cac('0x8f')][_0x2cac('0x31')]);_0x572f8a[_0x2cac('0x34')]=_[_0x2cac('0x33')](_0xaf7fe6[_0x2cac('0x34')]);_0x572f8a[_0x2cac('0x3e')]=_[_0x2cac('0x35')](_0x572f8a['model'],_0x572f8a[_0x2cac('0x34')]);_0x2867af[_0x2cac('0x36')]=_[_0x2cac('0x35')](_0x572f8a[_0x2cac('0x32')],qs[_0x2cac('0x37')](_0xaf7fe6[_0x2cac('0x34')][_0x2cac('0x37')]));_0x2867af[_0x2cac('0x36')]=_0x2867af['attributes'][_0x2cac('0x38')]?_0x2867af[_0x2cac('0x36')]:_0x572f8a[_0x2cac('0x32')];_0x2867af[_0x2cac('0x3b')]=qs[_0x2cac('0x3c')](_0xaf7fe6[_0x2cac('0x34')][_0x2cac('0x3c')]);_0x2867af['where']=qs[_0x2cac('0x3e')](_[_0x2cac('0x3f')](_0xaf7fe6[_0x2cac('0x34')],_0x572f8a[_0x2cac('0x3e')]));if(_0xaf7fe6[_0x2cac('0x34')][_0x2cac('0x45')]){_0x2867af[_0x2cac('0x3d')]=_[_0x2cac('0x40')](_0x2867af[_0x2cac('0x3d')],{'$or':_[_0x2cac('0x6a')](_0x2867af[_0x2cac('0x36')],function(_0x12873b){var _0x380e3e={};_0x380e3e[_0x12873b]={'$like':'%'+_0xaf7fe6[_0x2cac('0x34')][_0x2cac('0x45')]+'%'};return _0x380e3e;})});}_0x2867af=_[_0x2cac('0x40')]({},_0x2867af,_0xaf7fe6[_0x2cac('0x46')]);return _0x9f5b5b[_0x2cac('0x8e')](_0x2867af);}})[_0x2cac('0x25')](function(_0x1d37bd){if(_0x1d37bd){_0x5790da=_0x1d37bd[_0x2cac('0x38')];if(!_0xaf7fe6[_0x2cac('0x34')][_0x2cac('0x39')](_0x2cac('0x3a'))){_0x2867af[_0x2cac('0x20')]=qs[_0x2cac('0x20')](_0xaf7fe6[_0x2cac('0x34')]['limit']);_0x2867af[_0x2cac('0x1f')]=qs[_0x2cac('0x1f')](_0xaf7fe6['query'][_0x2cac('0x1f')]);}return _0x9f5b5b['getAgents'](_0x2867af);}})[_0x2cac('0x25')](function(_0x12d2be){if(_0x12d2be){return _0x12d2be?{'count':_0x5790da,'rows':_0x12d2be}:null;}})[_0x2cac('0x25')](respondWithResult(_0x56c230,null))['catch'](handleError(_0x56c230,null));}; \ No newline at end of file +var _0x7c70=['end','status','json','offset','limit','Content-Range','reject','save','update','then','Lists','UserProfileResource','destroy','error','stack','name','send','index','CmList','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','field','count','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','get','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','ListId','map','removeDispositions','addContacts','CmContact','tags','isArray','join','push','each','ids','success','dataValues','getContacts','CmCustomField','CustomFields','format','raw','concat','cf_%d','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','Content-type','text/csv','download','addCustomField','transaction','addCustomFields','Sequelize','TEXT','number','switch','BOOLEAN','defaultValue','sequelize','cm_contacts','findAndCountAll','addAgents','removeAgents','userCmList:remove','emit','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x7c70,0xf8));var _0x07c7=function(_0x3da725,_0x7c378d){_0x3da725=_0x3da725-0x0;var _0x41bd11=_0x7c70[_0x3da725];return _0x41bd11;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x07c7('0x0'));var rimraf=require(_0x07c7('0x1'));var zipdir=require(_0x07c7('0x2'));var jsonpatch=require(_0x07c7('0x3'));var rp=require(_0x07c7('0x4'));var moment=require('moment');var BPromise=require(_0x07c7('0x5'));var Mustache=require(_0x07c7('0x6'));var util=require(_0x07c7('0x7'));var path=require(_0x07c7('0x8'));var sox=require(_0x07c7('0x9'));var csv=require(_0x07c7('0xa'));var ejs=require(_0x07c7('0xb'));var fs=require('fs');var _=require(_0x07c7('0xc'));var squel=require(_0x07c7('0xd'));var crypto=require(_0x07c7('0xe'));var jsforce=require(_0x07c7('0xf'));var deskjs=require(_0x07c7('0x10'));var toCsv=require(_0x07c7('0xa'));var querystring=require(_0x07c7('0x11'));var Papa=require(_0x07c7('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x07c7('0x13'));var hardwareService=require(_0x07c7('0x14'));var logger=require('../../config/logger')(_0x07c7('0x15'));var utils=require(_0x07c7('0x16'));var config=require(_0x07c7('0x17'));var db=require(_0x07c7('0x18'))['db'];config[_0x07c7('0x19')]=_[_0x07c7('0x1a')](config[_0x07c7('0x19')],{'host':_0x07c7('0x1b'),'port':0x18eb});var socket=require(_0x07c7('0x1c'))(new Redis(config['redis']));require(_0x07c7('0x1d'))[_0x07c7('0x1e')](socket);function respondWithStatusCode(_0x224d59,_0xda3327){_0xda3327=_0xda3327||0xcc;return function(_0x2f7c69){if(_0x2f7c69){return _0x224d59[_0x07c7('0x1f')](_0xda3327);}return _0x224d59['status'](_0xda3327)[_0x07c7('0x20')]();};}function respondWithResult(_0x185301,_0x4d4443){_0x4d4443=_0x4d4443||0xc8;return function(_0x3a33b2){if(_0x3a33b2){return _0x185301[_0x07c7('0x21')](_0x4d4443)[_0x07c7('0x22')](_0x3a33b2);}};}function respondWithFilteredResult(_0x16e7d6,_0x5b87da){return function(_0x4a525c){if(_0x4a525c){var _0x3beb88=_0x4a525c['count'],_0x167eb=_0x5b87da[_0x07c7('0x23')],_0x57f7d5=_0x5b87da['offset']+_0x5b87da[_0x07c7('0x24')],_0x3070f4;if(_0x57f7d5>=_0x3beb88){_0x57f7d5=_0x3beb88;_0x3070f4=0xc8;}else{_0x3070f4=0xce;}_0x16e7d6[_0x07c7('0x21')](_0x3070f4);return _0x16e7d6['set'](_0x07c7('0x25'),_0x167eb+'-'+_0x57f7d5+'/'+_0x3beb88)[_0x07c7('0x22')](_0x4a525c);}return null;};}function patchUpdates(_0x20891f){return function(_0x281283){try{jsonpatch['apply'](_0x281283,_0x20891f,!![]);}catch(_0x532cce){return BPromise[_0x07c7('0x26')](_0x532cce);}return _0x281283[_0x07c7('0x27')]();};}function saveUpdates(_0x84d795,_0x2ee70f){return function(_0xb65aac){if(_0xb65aac){return _0xb65aac[_0x07c7('0x28')](_0x84d795)[_0x07c7('0x29')](function(_0x17ecf3){return _0x17ecf3;});}return null;};}function removeEntity(_0x2ef4db,_0x1342bd){return function(_0x481775){if(_0x481775){return _0x481775['destroy']()['then'](function(){var _0x115d6c=_0x481775['get']({'plain':!![]});var _0x2a39a9=_0x07c7('0x2a');return db[_0x07c7('0x2b')][_0x07c7('0x2c')]({'where':{'type':_0x2a39a9,'resourceId':_0x115d6c['id']}})['then'](function(){return _0x481775;});})[_0x07c7('0x29')](function(){_0x2ef4db[_0x07c7('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbb092c,_0x210426){return function(_0x3b28d3){if(!_0x3b28d3){_0xbb092c[_0x07c7('0x1f')](0x194);}return _0x3b28d3;};}function handleError(_0x4b9a8f,_0x2106b0){_0x2106b0=_0x2106b0||0x1f4;return function(_0x161429){logger[_0x07c7('0x2d')](_0x161429[_0x07c7('0x2e')]);if(_0x161429['name']){delete _0x161429[_0x07c7('0x2f')];}_0x4b9a8f[_0x07c7('0x21')](_0x2106b0)[_0x07c7('0x30')](_0x161429);};}exports[_0x07c7('0x31')]=function(_0x1b8d76,_0x18fa6c){var _0x4f328c={},_0x18501a={},_0x171aef={'count':0x0,'rows':[]};var _0x24da0c=db[_0x07c7('0x32')][_0x07c7('0x33')];_0x18501a[_0x07c7('0x34')]=_['keys'](_0x24da0c);_0x18501a[_0x07c7('0x35')]=_[_0x07c7('0x36')](_0x1b8d76[_0x07c7('0x35')]);_0x18501a[_0x07c7('0x37')]=_[_0x07c7('0x38')](_0x18501a[_0x07c7('0x34')],_0x18501a[_0x07c7('0x35')]);_0x4f328c[_0x07c7('0x39')]=_[_0x07c7('0x38')](_0x18501a['model'],qs[_0x07c7('0x3a')](_0x1b8d76['query'][_0x07c7('0x3a')]));_0x4f328c[_0x07c7('0x39')]=_0x4f328c[_0x07c7('0x39')][_0x07c7('0x3b')]?_0x4f328c['attributes']:_0x18501a[_0x07c7('0x34')];if(!_0x1b8d76[_0x07c7('0x35')]['hasOwnProperty'](_0x07c7('0x3c'))){_0x4f328c[_0x07c7('0x24')]=qs['limit'](_0x1b8d76[_0x07c7('0x35')][_0x07c7('0x24')]);_0x4f328c[_0x07c7('0x23')]=qs[_0x07c7('0x23')](_0x1b8d76[_0x07c7('0x35')][_0x07c7('0x23')]);}_0x4f328c[_0x07c7('0x3d')]=qs[_0x07c7('0x3e')](_0x1b8d76[_0x07c7('0x35')]['sort']);_0x4f328c[_0x07c7('0x3f')]=qs[_0x07c7('0x37')](_[_0x07c7('0x40')](_0x1b8d76[_0x07c7('0x35')],_0x18501a[_0x07c7('0x37')]));if(_0x1b8d76[_0x07c7('0x35')][_0x07c7('0x41')]){_0x4f328c[_0x07c7('0x3f')]=_[_0x07c7('0x42')](_0x4f328c[_0x07c7('0x3f')],{'$or':_['map'](_0x24da0c,function(_0x4076e3){if(_0x4076e3[_0x07c7('0x43')]['key']!=='VIRTUAL'){var _0x5c7ca7={};_0x5c7ca7[_0x4076e3[_0x07c7('0x44')]]={'$like':'%'+_0x1b8d76[_0x07c7('0x35')][_0x07c7('0x41')]+'%'};return _0x5c7ca7;}})});}_0x4f328c=_['merge']({},_0x4f328c,_0x1b8d76['options']);var _0x166eac={'where':_0x4f328c[_0x07c7('0x3f')]};return db[_0x07c7('0x32')][_0x07c7('0x45')](_0x166eac)['then'](function(_0x5e79c2){_0x171aef['count']=_0x5e79c2;if(_0x1b8d76['query'][_0x07c7('0x46')]){_0x4f328c[_0x07c7('0x47')]=[{'all':!![]}];}return db[_0x07c7('0x32')][_0x07c7('0x48')](_0x4f328c);})['then'](function(_0x54ec75){_0x171aef[_0x07c7('0x49')]=_0x54ec75;return _0x171aef;})[_0x07c7('0x29')](respondWithFilteredResult(_0x18fa6c,_0x4f328c))[_0x07c7('0x4a')](handleError(_0x18fa6c,null));};exports[_0x07c7('0x4b')]=function(_0x538787,_0x3fa9b2){var _0x2300a5={'raw':![],'where':{'id':_0x538787[_0x07c7('0x4c')]['id']}},_0x49dc2b={};_0x49dc2b['model']=_[_0x07c7('0x36')](db[_0x07c7('0x32')][_0x07c7('0x33')]);_0x49dc2b['query']=_[_0x07c7('0x36')](_0x538787[_0x07c7('0x35')]);_0x49dc2b[_0x07c7('0x37')]=_[_0x07c7('0x38')](_0x49dc2b[_0x07c7('0x34')],_0x49dc2b[_0x07c7('0x35')]);_0x2300a5[_0x07c7('0x39')]=_['intersection'](_0x49dc2b[_0x07c7('0x34')],qs[_0x07c7('0x3a')](_0x538787['query'][_0x07c7('0x3a')]));_0x2300a5[_0x07c7('0x39')]=_0x2300a5[_0x07c7('0x39')]['length']?_0x2300a5[_0x07c7('0x39')]:_0x49dc2b[_0x07c7('0x34')];if(_0x538787[_0x07c7('0x35')]['includeAll']){_0x2300a5['include']=[{'all':!![]}];}_0x2300a5=_['merge']({},_0x2300a5,_0x538787[_0x07c7('0x4d')]);return db[_0x07c7('0x32')][_0x07c7('0x4e')](_0x2300a5)[_0x07c7('0x29')](handleEntityNotFound(_0x3fa9b2,null))[_0x07c7('0x29')](respondWithResult(_0x3fa9b2,null))[_0x07c7('0x4a')](handleError(_0x3fa9b2,null));};exports[_0x07c7('0x4f')]=function(_0x5e7f1a,_0x5c41a5){return db[_0x07c7('0x32')][_0x07c7('0x4f')](_0x5e7f1a[_0x07c7('0x50')],{})[_0x07c7('0x29')](function(_0x3ad7a5){var _0x440b79=_0x5e7f1a[_0x07c7('0x51')][_0x07c7('0x52')]({'plain':!![]});if(!_0x440b79)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x440b79[_0x07c7('0x53')]===_0x07c7('0x51')){var _0x539f0d=_0x3ad7a5[_0x07c7('0x52')]({'plain':!![]});var _0x49c1bd=_0x07c7('0x2a');return db['UserProfileSection'][_0x07c7('0x4e')]({'where':{'name':_0x49c1bd,'userProfileId':_0x440b79[_0x07c7('0x54')]},'raw':!![]})['then'](function(_0x22a18e){if(_0x22a18e&&_0x22a18e[_0x07c7('0x55')]===0x0){return db['UserProfileResource'][_0x07c7('0x4f')]({'name':_0x539f0d[_0x07c7('0x2f')],'resourceId':_0x539f0d['id'],'type':_0x22a18e[_0x07c7('0x2f')],'sectionId':_0x22a18e['id']},{})[_0x07c7('0x29')](function(){return _0x3ad7a5;});}else{return _0x3ad7a5;}})[_0x07c7('0x4a')](function(_0xe45cb){logger['error'](_0x07c7('0x56'),_0xe45cb);throw _0xe45cb;});}return _0x3ad7a5;})[_0x07c7('0x29')](respondWithResult(_0x5c41a5,0xc9))[_0x07c7('0x4a')](handleError(_0x5c41a5,null));};exports[_0x07c7('0x28')]=function(_0x3a43aa,_0xe0bae9){if(_0x3a43aa[_0x07c7('0x50')]['id']){delete _0x3a43aa['body']['id'];}return db[_0x07c7('0x32')][_0x07c7('0x4e')]({'where':{'id':_0x3a43aa[_0x07c7('0x4c')]['id']}})[_0x07c7('0x29')](handleEntityNotFound(_0xe0bae9,null))[_0x07c7('0x29')](saveUpdates(_0x3a43aa[_0x07c7('0x50')],null))[_0x07c7('0x29')](respondWithResult(_0xe0bae9,null))[_0x07c7('0x4a')](handleError(_0xe0bae9,null));};exports[_0x07c7('0x2c')]=function(_0x13c1c9,_0x36d65b){return db[_0x07c7('0x32')][_0x07c7('0x4e')]({'where':{'id':_0x13c1c9['params']['id']}})[_0x07c7('0x29')](handleEntityNotFound(_0x36d65b,null))[_0x07c7('0x29')](removeEntity(_0x36d65b,null))[_0x07c7('0x4a')](handleError(_0x36d65b,null));};exports['describe']=function(_0x18113f,_0x270060){return db[_0x07c7('0x32')][_0x07c7('0x57')]()['then'](respondWithResult(_0x270060,null))['catch'](handleError(_0x270060,null));};exports[_0x07c7('0x58')]=function(_0x42bc39,_0x49258e,_0x42d446){if(_0x42bc39[_0x07c7('0x50')]['id']){delete _0x42bc39[_0x07c7('0x50')]['id'];}return db[_0x07c7('0x32')][_0x07c7('0x4e')]({'where':{'id':_0x42bc39['params']['id']}})['then'](handleEntityNotFound(_0x49258e,null))[_0x07c7('0x29')](function(_0x2d1cbe){if(_0x2d1cbe){_0x42bc39[_0x07c7('0x50')]['ListId']=_0x2d1cbe['id'];return db[_0x07c7('0x59')]['create'](_0x42bc39[_0x07c7('0x50')]);}})[_0x07c7('0x29')](respondWithResult(_0x49258e,null))[_0x07c7('0x4a')](handleError(_0x49258e,null));};exports[_0x07c7('0x5a')]=function(_0x155bc9,_0x2ce873,_0x1cb07d){var _0x5ab61d={'raw':![],'where':{}};var _0x113eae={};var _0x46da5d={'count':0x0,'rows':[]};return db[_0x07c7('0x32')][_0x07c7('0x5b')]({'where':{'id':_0x155bc9[_0x07c7('0x4c')]['id']}})[_0x07c7('0x29')](handleEntityNotFound(_0x2ce873,null))['then'](function(_0x1a32fe){if(_0x1a32fe){_0x113eae['model']=_['keys'](db['Disposition'][_0x07c7('0x33')]);_0x113eae[_0x07c7('0x35')]=_['keys'](_0x155bc9[_0x07c7('0x35')]);_0x113eae['filters']=_[_0x07c7('0x38')](_0x113eae[_0x07c7('0x34')],_0x113eae[_0x07c7('0x35')]);_0x5ab61d[_0x07c7('0x39')]=_[_0x07c7('0x38')](_0x113eae[_0x07c7('0x34')],qs[_0x07c7('0x3a')](_0x155bc9['query'][_0x07c7('0x3a')]));_0x5ab61d[_0x07c7('0x39')]=_0x5ab61d[_0x07c7('0x39')][_0x07c7('0x3b')]?_0x5ab61d[_0x07c7('0x39')]:_0x113eae[_0x07c7('0x34')];if(!_0x155bc9['query'][_0x07c7('0x5c')](_0x07c7('0x3c'))){_0x5ab61d[_0x07c7('0x24')]=qs[_0x07c7('0x24')](_0x155bc9[_0x07c7('0x35')][_0x07c7('0x24')]);_0x5ab61d['offset']=qs[_0x07c7('0x23')](_0x155bc9[_0x07c7('0x35')][_0x07c7('0x23')]);}_0x5ab61d[_0x07c7('0x3d')]=qs[_0x07c7('0x3e')](_0x155bc9[_0x07c7('0x35')][_0x07c7('0x3e')]);_0x5ab61d['where']=qs[_0x07c7('0x37')](_[_0x07c7('0x40')](_0x155bc9['query'],_0x113eae['filters']));_0x5ab61d[_0x07c7('0x3f')][_0x07c7('0x5d')]=_0x1a32fe['id'];if(_0x155bc9[_0x07c7('0x35')]['filter']){_0x5ab61d[_0x07c7('0x3f')]=_['merge'](_0x5ab61d[_0x07c7('0x3f')],{'$or':_[_0x07c7('0x5e')](_0x5ab61d[_0x07c7('0x39')],function(_0x5f1089){var _0x45b46f={};_0x45b46f[_0x5f1089]={'$like':'%'+_0x155bc9[_0x07c7('0x35')][_0x07c7('0x41')]+'%'};return _0x45b46f;})});}_0x5ab61d=_['merge']({},_0x5ab61d,_0x155bc9[_0x07c7('0x4d')]);return db[_0x07c7('0x59')][_0x07c7('0x45')]({'where':_0x5ab61d[_0x07c7('0x3f')]})[_0x07c7('0x29')](function(_0x5315ee){_0x46da5d[_0x07c7('0x45')]=_0x5315ee;if(_0x155bc9['query'][_0x07c7('0x46')]){_0x5ab61d[_0x07c7('0x47')]=[{'all':!![]}];}return db[_0x07c7('0x59')][_0x07c7('0x48')](_0x5ab61d);})[_0x07c7('0x29')](function(_0x507a3e){_0x46da5d['rows']=_0x507a3e;return _0x46da5d;});}})[_0x07c7('0x29')](respondWithFilteredResult(_0x2ce873,_0x5ab61d))[_0x07c7('0x4a')](handleError(_0x2ce873,null));};exports[_0x07c7('0x5f')]=function(_0x40159c,_0x5b48ff,_0x4b4edb){return db['CmList'][_0x07c7('0x4e')]({'where':{'id':_0x40159c[_0x07c7('0x4c')]['id']}})[_0x07c7('0x29')](handleEntityNotFound(_0x5b48ff,null))[_0x07c7('0x29')](function(_0x8a6a98){if(_0x8a6a98){return _0x8a6a98[_0x07c7('0x5f')](_0x40159c[_0x07c7('0x35')]['ids']);}})['then'](respondWithStatusCode(_0x5b48ff,null))[_0x07c7('0x4a')](handleError(_0x5b48ff,null));};exports[_0x07c7('0x60')]=function(_0x2e9145,_0x52788e,_0x188704){return db[_0x07c7('0x32')][_0x07c7('0x4e')]({'where':{'id':_0x2e9145['params']['id']}})[_0x07c7('0x29')](handleEntityNotFound(_0x52788e,null))['then'](function(_0x815b){if(_0x815b){var _0x32bd66=[];var _0x1fb4f8={'success':[],'errors':[]};return db[_0x07c7('0x61')]['describe']()['then'](function(_0x19cd12){if(_0x2e9145[_0x07c7('0x50')][_0x07c7('0x62')]&&_[_0x07c7('0x63')](_0x2e9145[_0x07c7('0x50')][_0x07c7('0x62')])){if(_0x2e9145[_0x07c7('0x50')][_0x07c7('0x62')][_0x07c7('0x3b')]){_0x2e9145[_0x07c7('0x50')][_0x07c7('0x62')]=_0x2e9145[_0x07c7('0x50')][_0x07c7('0x62')][_0x07c7('0x64')](';')+';';}else{_0x2e9145['body'][_0x07c7('0x62')]=null;}}else{_0x2e9145[_0x07c7('0x50')][_0x07c7('0x62')]=null;}if(_0x2e9145[_0x07c7('0x50')]&&_[_0x07c7('0x63')](_0x2e9145[_0x07c7('0x50')])){for(var _0x4bb205=0x0;_0x4bb205<_0x2e9145[_0x07c7('0x50')]['length'];_0x4bb205+=0x1){_0x2e9145[_0x07c7('0x50')][_0x4bb205][_0x07c7('0x5d')]=_0x2e9145[_0x07c7('0x4c')]['id'];_0x32bd66[_0x07c7('0x65')](_0x2e9145[_0x07c7('0x50')][_0x4bb205]);}return BPromise[_0x07c7('0x66')](_0x32bd66,function(_0x21f77b){return db[_0x07c7('0x61')]['create'](_['omit'](_0x21f77b,[_0x07c7('0x67'),'id'])||{},{'fields':_[_0x07c7('0x36')](_0x19cd12),'raw':!![]})[_0x07c7('0x29')](function(_0x40ed9b){_0x1fb4f8[_0x07c7('0x68')][_0x07c7('0x65')](_0x40ed9b[_0x07c7('0x69')]);})['catch'](function(_0x3faa2e){_0x1fb4f8['errors'][_0x07c7('0x65')]({'data':_0x21f77b,'error':_0x3faa2e['message']});});})[_0x07c7('0x29')](function(_0x4a553a){return _0x1fb4f8;})[_0x07c7('0x4a')](function(_0x536273){return _0x536273;});}else{_0x52788e[_0x07c7('0x21')](0x190)[_0x07c7('0x22')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x07c7('0x29')](respondWithResult(_0x52788e,null))[_0x07c7('0x4a')](handleError(_0x52788e,null));};exports[_0x07c7('0x6a')]=function(_0x49fb38,_0xfdf5c2,_0x167763){var _0x436276;return db[_0x07c7('0x32')][_0x07c7('0x4e')]({'where':{'id':_0x49fb38[_0x07c7('0x4c')]['id']},'include':[{'model':db[_0x07c7('0x6b')],'as':_0x07c7('0x6c')}]})['then'](handleEntityNotFound(_0xfdf5c2,null))[_0x07c7('0x29')](function(_0x112aef){if(_0x112aef){_0x436276=_0x112aef;return db['CmContact'][_0x07c7('0x33')];}})['then'](function(_0x385cfb){if(_0x385cfb){var _0x3a26a7={};var _0x1328c8={};_0x1328c8[_0x07c7('0x34')]=_['concat'](_['keys'](_0x385cfb),_['map'](_0x436276[_0x07c7('0x6c')],function(_0x3498a4){return util[_0x07c7('0x6d')]('cf_%d',_0x3498a4['id']);}));_0x1328c8[_0x07c7('0x35')]=_[_0x07c7('0x36')](_0x49fb38[_0x07c7('0x35')]);_0x1328c8[_0x07c7('0x37')]=_[_0x07c7('0x38')](_0x1328c8[_0x07c7('0x34')],_0x1328c8['query']);_0x3a26a7[_0x07c7('0x39')]=_['intersection'](_0x1328c8[_0x07c7('0x34')],qs['fields'](_0x49fb38[_0x07c7('0x35')][_0x07c7('0x3a')]));_0x3a26a7[_0x07c7('0x39')]=_0x3a26a7['attributes'][_0x07c7('0x3b')]?_0x3a26a7[_0x07c7('0x39')]:_0x1328c8[_0x07c7('0x34')];if(!_0x49fb38['query'][_0x07c7('0x5c')](_0x07c7('0x3c'))){_0x3a26a7[_0x07c7('0x24')]=qs[_0x07c7('0x24')](_0x49fb38[_0x07c7('0x35')]['limit']);_0x3a26a7[_0x07c7('0x23')]=qs[_0x07c7('0x23')](_0x49fb38[_0x07c7('0x35')][_0x07c7('0x23')]);}_0x3a26a7[_0x07c7('0x3d')]=qs[_0x07c7('0x3e')](_0x49fb38[_0x07c7('0x35')]['sort']);_0x3a26a7[_0x07c7('0x3f')]=qs[_0x07c7('0x37')](_[_0x07c7('0x40')](_0x49fb38[_0x07c7('0x35')],_0x1328c8[_0x07c7('0x37')]));_0x3a26a7[_0x07c7('0x6e')]=!![];if(_0x49fb38[_0x07c7('0x35')][_0x07c7('0x41')]){_0x3a26a7[_0x07c7('0x3f')]=_[_0x07c7('0x42')](_0x3a26a7['where'],{'$or':_[_0x07c7('0x5e')](_0x3a26a7[_0x07c7('0x39')],function(_0x2dcc50){var _0x4cc42f={};_0x4cc42f[_0x2dcc50]={'$like':'%'+_0x49fb38['query'][_0x07c7('0x41')]+'%'};return _0x4cc42f;})});}_0x3a26a7=_[_0x07c7('0x42')]({},_0x3a26a7,_0x49fb38[_0x07c7('0x4d')]);return _0x436276[_0x07c7('0x6a')](_0x3a26a7);}})['then'](respondWithResult(_0xfdf5c2,null))[_0x07c7('0x4a')](handleError(_0xfdf5c2,null));};exports['getContactsCsv']=function(_0x50b457,_0x388c8d,_0x30edd5){var _0x5c09ef;return db[_0x07c7('0x32')][_0x07c7('0x4e')]({'where':{'id':_0x50b457[_0x07c7('0x4c')]['id']},'include':[{'model':db[_0x07c7('0x6b')],'as':_0x07c7('0x6c')}]})[_0x07c7('0x29')](handleEntityNotFound(_0x388c8d,null))[_0x07c7('0x29')](function(_0x5269e3){if(_0x5269e3){_0x5c09ef=_0x5269e3;return db[_0x07c7('0x61')][_0x07c7('0x33')];}})['then'](function(_0x5c6699){if(_0x5c6699){var _0x53c253={};var _0x1f71cb={};_0x1f71cb[_0x07c7('0x34')]=_[_0x07c7('0x6f')](_[_0x07c7('0x36')](_0x5c6699),_['map'](_0x5c09ef[_0x07c7('0x6c')],function(_0x4f47f2){return util[_0x07c7('0x6d')](_0x07c7('0x70'),_0x4f47f2['id']);}));_0x1f71cb[_0x07c7('0x35')]=_['keys'](_0x50b457[_0x07c7('0x35')]);_0x1f71cb[_0x07c7('0x37')]=_[_0x07c7('0x38')](_0x1f71cb['model'],_0x1f71cb[_0x07c7('0x35')]);_0x53c253[_0x07c7('0x39')]=_['intersection'](_0x1f71cb['model'],qs[_0x07c7('0x3a')](_0x50b457[_0x07c7('0x35')][_0x07c7('0x3a')]));_0x53c253[_0x07c7('0x39')]=_0x53c253[_0x07c7('0x39')]['length']?_0x53c253['attributes']:_0x1f71cb[_0x07c7('0x34')];if(!_0x50b457[_0x07c7('0x35')][_0x07c7('0x5c')]('nolimit')){_0x53c253[_0x07c7('0x24')]=qs[_0x07c7('0x24')](_0x50b457[_0x07c7('0x35')][_0x07c7('0x24')]);_0x53c253[_0x07c7('0x23')]=qs[_0x07c7('0x23')](_0x50b457['query'][_0x07c7('0x23')]);}_0x53c253['order']=qs['sort'](_0x50b457['query'][_0x07c7('0x3e')]);_0x53c253[_0x07c7('0x3f')]=qs['filters'](_[_0x07c7('0x40')](_0x50b457['query'],_0x1f71cb[_0x07c7('0x37')]));_0x53c253[_0x07c7('0x6e')]=!![];if(_0x50b457[_0x07c7('0x35')][_0x07c7('0x41')]){_0x53c253['where']=_[_0x07c7('0x42')](_0x53c253['where'],{'$or':_[_0x07c7('0x5e')](_0x53c253[_0x07c7('0x39')],function(_0x2eb8f7){var _0x521f78={};_0x521f78[_0x2eb8f7]={'$like':'%'+_0x50b457[_0x07c7('0x35')]['filter']+'%'};return _0x521f78;})});}_0x53c253=_[_0x07c7('0x42')]({},_0x53c253,_0x50b457[_0x07c7('0x4d')]);return _0x5c09ef['getContacts'](_0x53c253);}})[_0x07c7('0x29')](function(_0x2e4620){if(!_[_0x07c7('0x71')](_0x2e4620)){var _0x144afe=toCsv(_0x2e4620);var _0x12c59c=Date[_0x07c7('0x72')]();fs[_0x07c7('0x73')](util['format'](_0x07c7('0x74'),_0x5c09ef['id'],_0x12c59c),_0x144afe);_0x388c8d[_0x07c7('0x75')]('Content-disposition',_0x07c7('0x76')+util['format']('list_%d_%s.csv',_0x5c09ef['id'],_0x12c59c));_0x388c8d[_0x07c7('0x75')](_0x07c7('0x77'),_0x07c7('0x78'));return _0x388c8d[_0x07c7('0x79')](util[_0x07c7('0x6d')]('/tmp/list_%d_%s.csv',_0x5c09ef['id'],_0x12c59c));}else{return _0x388c8d[_0x07c7('0x1f')](0xcc);}})['catch'](handleError(_0x388c8d,null));};exports[_0x07c7('0x7a')]=function(_0x53f91e,_0x4a3044,_0x2afe0e){var _0x2c5a50;delete _0x53f91e['body']['id'];return db[_0x07c7('0x32')]['findOne']({'where':{'id':_0x53f91e[_0x07c7('0x4c')]['id']}})[_0x07c7('0x29')](handleEntityNotFound(_0x4a3044,null))[_0x07c7('0x29')](function(_0x1ff831){if(_0x1ff831){return db['sequelize'][_0x07c7('0x7b')](function(_0x2bd401){return db[_0x07c7('0x6b')][_0x07c7('0x4f')](_0x53f91e[_0x07c7('0x50')],{'transaction':_0x2bd401})['then'](function(_0x413d17){_0x2c5a50=_0x413d17;return _0x1ff831[_0x07c7('0x7c')](_0x413d17,{'transaction':_0x2bd401});})['then'](function(){var _0x5e44fc={'type':db[_0x07c7('0x7d')][_0x07c7('0x7e')],'transaction':_0x2bd401};switch(_0x53f91e[_0x07c7('0x50')][_0x07c7('0x43')]){case'text':_0x5e44fc[_0x07c7('0x43')]=db['Sequelize'][_0x07c7('0x7e')];break;case _0x07c7('0x7f'):_0x5e44fc[_0x07c7('0x43')]=db[_0x07c7('0x7d')]['INTEGER'];break;case _0x07c7('0x80'):_0x5e44fc[_0x07c7('0x43')]=db[_0x07c7('0x7d')][_0x07c7('0x81')];_0x5e44fc[_0x07c7('0x82')]=![];break;default:}return db[_0x07c7('0x83')]['queryInterface']['addColumn'](_0x07c7('0x84'),util[_0x07c7('0x6d')]('cf_%s',_0x2c5a50['id']),_0x5e44fc);})[_0x07c7('0x29')](function(){return _0x2c5a50;});});}})[_0x07c7('0x29')](respondWithResult(_0x4a3044,null))[_0x07c7('0x4a')](handleError(_0x4a3044,null));};exports['getCustomFields']=function(_0x16afad,_0x3aa98b,_0x47cdce){var _0x1d857e={};var _0x425b92={};var _0x1605c5;var _0x54846f;return db['CmList'][_0x07c7('0x5b')]({'where':{'id':_0x16afad[_0x07c7('0x4c')]['id']}})[_0x07c7('0x29')](handleEntityNotFound(_0x3aa98b,null))[_0x07c7('0x29')](function(_0xe9bec1){if(_0xe9bec1){_0x1605c5=_0xe9bec1;_0x425b92[_0x07c7('0x34')]=_[_0x07c7('0x36')](db['CmCustomField']['rawAttributes']);_0x425b92[_0x07c7('0x35')]=_[_0x07c7('0x36')](_0x16afad[_0x07c7('0x35')]);_0x425b92[_0x07c7('0x37')]=_[_0x07c7('0x38')](_0x425b92[_0x07c7('0x34')],_0x425b92[_0x07c7('0x35')]);_0x1d857e[_0x07c7('0x39')]=_['intersection'](_0x425b92[_0x07c7('0x34')],qs['fields'](_0x16afad[_0x07c7('0x35')]['fields']));_0x1d857e[_0x07c7('0x39')]=_0x1d857e[_0x07c7('0x39')][_0x07c7('0x3b')]?_0x1d857e[_0x07c7('0x39')]:_0x425b92[_0x07c7('0x34')];_0x1d857e[_0x07c7('0x3d')]=qs[_0x07c7('0x3e')](_0x16afad['query'][_0x07c7('0x3e')]);_0x1d857e[_0x07c7('0x3f')]=qs[_0x07c7('0x37')](_['pick'](_0x16afad[_0x07c7('0x35')],_0x425b92[_0x07c7('0x37')]));_0x1d857e['where']=_[_0x07c7('0x42')](_0x1d857e[_0x07c7('0x3f')],{'$or':[{'ListId':_0xe9bec1['id']},{'ListId':null}]});if(_0x16afad['query'][_0x07c7('0x41')]){_0x1d857e[_0x07c7('0x3f')]=_[_0x07c7('0x42')](_0x1d857e[_0x07c7('0x3f')],{'$or':_[_0x07c7('0x5e')](_0x1d857e[_0x07c7('0x39')],function(_0x1ea097){var _0x10bfce={};_0x10bfce[_0x1ea097]={'$like':'%'+_0x16afad[_0x07c7('0x35')][_0x07c7('0x41')]+'%'};return _0x10bfce;})});}_0x1d857e=_['merge']({},_0x1d857e,_0x16afad[_0x07c7('0x4d')]);return db[_0x07c7('0x6b')][_0x07c7('0x85')](_0x1d857e);}})['then'](respondWithResult(_0x3aa98b,null))[_0x07c7('0x4a')](handleError(_0x3aa98b,null));};exports[_0x07c7('0x86')]=function(_0x1f5f0a,_0x4fe95b,_0x56ea68){return db[_0x07c7('0x32')][_0x07c7('0x4e')]({'where':{'id':_0x1f5f0a[_0x07c7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4fe95b,null))[_0x07c7('0x29')](function(_0x36f25a){if(_0x36f25a){return _0x36f25a[_0x07c7('0x86')](_0x1f5f0a[_0x07c7('0x50')][_0x07c7('0x67')],_['omit'](_0x1f5f0a[_0x07c7('0x50')],[_0x07c7('0x67'),'id'])||{})['spread'](function(_0x4e61b1){for(var _0x2886b5=0x0;_0x2886b5<_0x1f5f0a[_0x07c7('0x50')][_0x07c7('0x67')][_0x07c7('0x3b')];_0x2886b5+=0x1){socket['emit']('userCmList:save',{'UserId':_0x1f5f0a[_0x07c7('0x50')][_0x07c7('0x67')][_0x2886b5],'CmListId':_0x1f5f0a['params']['id']});}return _0x4e61b1;});}})[_0x07c7('0x29')](respondWithResult(_0x4fe95b,null))[_0x07c7('0x4a')](handleError(_0x4fe95b,null));};exports[_0x07c7('0x87')]=function(_0x4e7602,_0x1d22a3,_0x2aeca6){return db[_0x07c7('0x32')][_0x07c7('0x4e')]({'where':{'id':_0x4e7602[_0x07c7('0x4c')]['id']}})[_0x07c7('0x29')](handleEntityNotFound(_0x1d22a3,null))[_0x07c7('0x29')](function(_0x45f27c){if(_0x45f27c){return _0x45f27c[_0x07c7('0x87')](_0x4e7602[_0x07c7('0x35')][_0x07c7('0x67')])[_0x07c7('0x29')](function(){if(_[_0x07c7('0x63')](_0x4e7602['query'][_0x07c7('0x67')])){for(var _0x1b3e16=0x0;_0x1b3e16<_0x4e7602[_0x07c7('0x35')][_0x07c7('0x67')][_0x07c7('0x3b')];_0x1b3e16+=0x1){socket['emit'](_0x07c7('0x88'),{'UserId':Number(_0x4e7602[_0x07c7('0x35')][_0x07c7('0x67')][_0x1b3e16]),'CmListId':Number(_0x4e7602[_0x07c7('0x4c')]['id'])});}}else{socket[_0x07c7('0x89')]('userCmList:remove',{'UserId':Number(_0x4e7602[_0x07c7('0x35')]['ids']),'CmListId':Number(_0x4e7602[_0x07c7('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x1d22a3,null))[_0x07c7('0x4a')](handleError(_0x1d22a3,null));};exports[_0x07c7('0x8a')]=function(_0x25e40e,_0x380c9a,_0x492e4d){var _0x42abec={};var _0x2877bf={};var _0x3fc3d3;var _0xc3d0bb;return db['CmList'][_0x07c7('0x5b')]({'where':{'id':_0x25e40e[_0x07c7('0x4c')]['id']}})[_0x07c7('0x29')](handleEntityNotFound(_0x380c9a,null))[_0x07c7('0x29')](function(_0x28e809){if(_0x28e809){_0x3fc3d3=_0x28e809;_0x2877bf[_0x07c7('0x34')]=_[_0x07c7('0x36')](db[_0x07c7('0x8b')]['rawAttributes']);_0x2877bf['query']=_[_0x07c7('0x36')](_0x25e40e['query']);_0x2877bf[_0x07c7('0x37')]=_[_0x07c7('0x38')](_0x2877bf[_0x07c7('0x34')],_0x2877bf['query']);_0x42abec['attributes']=_[_0x07c7('0x38')](_0x2877bf[_0x07c7('0x34')],qs[_0x07c7('0x3a')](_0x25e40e[_0x07c7('0x35')][_0x07c7('0x3a')]));_0x42abec[_0x07c7('0x39')]=_0x42abec[_0x07c7('0x39')]['length']?_0x42abec[_0x07c7('0x39')]:_0x2877bf[_0x07c7('0x34')];_0x42abec[_0x07c7('0x3d')]=qs[_0x07c7('0x3e')](_0x25e40e[_0x07c7('0x35')]['sort']);_0x42abec[_0x07c7('0x3f')]=qs[_0x07c7('0x37')](_[_0x07c7('0x40')](_0x25e40e[_0x07c7('0x35')],_0x2877bf['filters']));if(_0x25e40e[_0x07c7('0x35')][_0x07c7('0x41')]){_0x42abec[_0x07c7('0x3f')]=_[_0x07c7('0x42')](_0x42abec[_0x07c7('0x3f')],{'$or':_[_0x07c7('0x5e')](_0x42abec['attributes'],function(_0x2878a2){var _0x46975d={};_0x46975d[_0x2878a2]={'$like':'%'+_0x25e40e[_0x07c7('0x35')]['filter']+'%'};return _0x46975d;})});}_0x42abec=_[_0x07c7('0x42')]({},_0x42abec,_0x25e40e[_0x07c7('0x4d')]);return _0x3fc3d3[_0x07c7('0x8a')](_0x42abec);}})[_0x07c7('0x29')](function(_0x3e7401){if(_0x3e7401){_0xc3d0bb=_0x3e7401[_0x07c7('0x3b')];if(!_0x25e40e['query'][_0x07c7('0x5c')]('nolimit')){_0x42abec['limit']=qs['limit'](_0x25e40e[_0x07c7('0x35')][_0x07c7('0x24')]);_0x42abec[_0x07c7('0x23')]=qs['offset'](_0x25e40e['query'][_0x07c7('0x23')]);}return _0x3fc3d3[_0x07c7('0x8a')](_0x42abec);}})['then'](function(_0x15c164){if(_0x15c164){return _0x15c164?{'count':_0xc3d0bb,'rows':_0x15c164}:null;}})[_0x07c7('0x29')](respondWithResult(_0x380c9a,null))[_0x07c7('0x4a')](handleError(_0x380c9a,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index ca321b1..d8c11c0 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 _0x1e1e=['CmList','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1e1e,0x1f0));var _0xe1e1=function(_0x559a80,_0x3d193d){_0x559a80=_0x559a80-0x0;var _0x42f555=_0x1e1e[_0x559a80];return _0x42f555;};'use strict';var EventEmitter=require(_0xe1e1('0x0'));var CmList=require('../../mysqldb')['db'][_0xe1e1('0x1')];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe1e1('0x2')};function emitEvent(_0x2d58ed){return function(_0x59c66c,_0x3b7548,_0x5846a3){CmListEvents[_0xe1e1('0x3')](_0x2d58ed+':'+_0x59c66c['id'],_0x59c66c);CmListEvents[_0xe1e1('0x3')](_0x2d58ed,_0x59c66c);_0x5846a3(null);};}for(var e in events){if(events[_0xe1e1('0x4')](e)){var event=events[e];CmList[_0xe1e1('0x5')](e,emitEvent(event));}}module[_0xe1e1('0x6')]=CmListEvents; \ No newline at end of file +var _0xb7e9=['save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0xdbb6cb,_0x3b8fda){var _0x476b50=function(_0x470ebb){while(--_0x470ebb){_0xdbb6cb['push'](_0xdbb6cb['shift']());}};_0x476b50(++_0x3b8fda);}(_0xb7e9,0x176));var _0x9b7e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xb7e9[_0x12d033];return _0x3b4e80;};'use strict';var EventEmitter=require('events');var CmList=require(_0x9b7e('0x0'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x9b7e('0x1')](0x0);var events={'afterCreate':_0x9b7e('0x2'),'afterUpdate':'update','afterDestroy':_0x9b7e('0x3')};function emitEvent(_0x15c54b){return function(_0x95730,_0x312880,_0x484dfb){CmListEvents[_0x9b7e('0x4')](_0x15c54b+':'+_0x95730['id'],_0x95730);CmListEvents[_0x9b7e('0x4')](_0x15c54b,_0x95730);_0x484dfb(null);};}for(var e in events){if(events[_0x9b7e('0x5')](e)){var event=events[e];CmList[_0x9b7e('0x6')](e,emitEvent(event));}}module[_0x9b7e('0x7')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index eb86dd1..b68d8d0 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 _0xf874=['request-promise','path','rimraf','./cmList.attributes','exports','lodash','../../config/logger','api','moment','bluebird'];(function(_0x39f07b,_0x5a28a1){var _0x18934f=function(_0x539f8d){while(--_0x539f8d){_0x39f07b['push'](_0x39f07b['shift']());}};_0x18934f(++_0x5a28a1);}(_0xf874,0x177));var _0x4f87=function(_0x2861a2,_0x5e7d7f){_0x2861a2=_0x2861a2-0x0;var _0x139f05=_0xf874[_0x2861a2];return _0x139f05;};'use strict';var _=require(_0x4f87('0x0'));var util=require('util');var logger=require(_0x4f87('0x1'))(_0x4f87('0x2'));var moment=require(_0x4f87('0x3'));var BPromise=require(_0x4f87('0x4'));var rp=require(_0x4f87('0x5'));var fs=require('fs');var path=require(_0x4f87('0x6'));var rimraf=require(_0x4f87('0x7'));var config=require('../../config/environment');var attributes=require(_0x4f87('0x8'));module[_0x4f87('0x9')]=function(_0x5d9a23,_0x50bcb8){return _0x5d9a23['define']('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc577=['request-promise','path','rimraf','../../config/environment','exports','define','CmList','lodash','api','moment','bluebird'];(function(_0x561248,_0x360e7c){var _0x58e857=function(_0x1ff481){while(--_0x1ff481){_0x561248['push'](_0x561248['shift']());}};_0x58e857(++_0x360e7c);}(_0xc577,0x172));var _0x7c57=function(_0x7f9224,_0x186851){_0x7f9224=_0x7f9224-0x0;var _0x3bc305=_0xc577[_0x7f9224];return _0x3bc305;};'use strict';var _=require(_0x7c57('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7c57('0x1'));var moment=require(_0x7c57('0x2'));var BPromise=require(_0x7c57('0x3'));var rp=require(_0x7c57('0x4'));var fs=require('fs');var path=require(_0x7c57('0x5'));var rimraf=require(_0x7c57('0x6'));var config=require(_0x7c57('0x7'));var attributes=require('./cmList.attributes');module[_0x7c57('0x8')]=function(_0x1339b3,_0xf50a9f){return _0x1339b3[_0x7c57('0x9')](_0x7c57('0xa'),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 b3f04f9..074922e 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 _0x0f39=['lodash','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','then','info','CmList,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch'];(function(_0x527f7b,_0x137a81){var _0x5632b9=function(_0x48bc15){while(--_0x48bc15){_0x527f7b['push'](_0x527f7b['shift']());}};_0x5632b9(++_0x137a81);}(_0x0f39,0xf2));var _0x90f3=function(_0x2801f2,_0x4959c4){_0x2801f2=_0x2801f2-0x0;var _0x1555c7=_0x0f39[_0x2801f2];return _0x1555c7;};'use strict';var _=require(_0x90f3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x90f3('0x1'));var fs=require('fs');var Redis=require(_0x90f3('0x2'));var db=require(_0x90f3('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x90f3('0x4'));var config=require(_0x90f3('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x90f3('0x6')]({'port':0x232a});config[_0x90f3('0x7')]=_[_0x90f3('0x8')](config[_0x90f3('0x7')],{'host':_0x90f3('0x9'),'port':0x18eb});var socket=require(_0x90f3('0xa'))(new Redis(config[_0x90f3('0x7')]));require('./cmList.socket')[_0x90f3('0xb')](socket);function respondWithRpcPromise(_0x2361bc,_0x459949,_0x2c937a){return new BPromise(function(_0x1246ca,_0x377d15){return client['request'](_0x2361bc,_0x2c937a)[_0x90f3('0xc')](function(_0x1fb34b){logger[_0x90f3('0xd')](_0x90f3('0xe'),_0x459949,'request\x20sent');logger[_0x90f3('0xf')]('CmList,\x20%s,\x20%s,\x20%s',_0x459949,'request\x20sent',JSON[_0x90f3('0x10')](_0x1fb34b));if(_0x1fb34b[_0x90f3('0x11')]){if(_0x1fb34b[_0x90f3('0x11')][_0x90f3('0x12')]===0x1f4){logger[_0x90f3('0x11')](_0x90f3('0xe'),_0x459949,_0x1fb34b['error'][_0x90f3('0x13')]);return _0x377d15(_0x1fb34b['error'][_0x90f3('0x13')]);}logger[_0x90f3('0x11')]('CmList,\x20%s,\x20%s',_0x459949,_0x1fb34b[_0x90f3('0x11')][_0x90f3('0x13')]);return _0x1246ca(_0x1fb34b[_0x90f3('0x11')]['message']);}else{logger[_0x90f3('0xd')](_0x90f3('0xe'),_0x459949,_0x90f3('0x14'));_0x1246ca(_0x1fb34b['result'][_0x90f3('0x13')]);}})[_0x90f3('0x15')](function(_0x4a80bf){logger[_0x90f3('0x11')](_0x90f3('0xe'),_0x459949,_0x4a80bf);_0x377d15(_0x4a80bf);});});} \ No newline at end of file +var _0x1344=['rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmList,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x53ead1,_0x24ca4d){var _0x145364=function(_0x11b072){while(--_0x11b072){_0x53ead1['push'](_0x53ead1['shift']());}};_0x145364(++_0x24ca4d);}(_0x1344,0xa2));var _0x4134=function(_0x169d90,_0x1e8ddf){_0x169d90=_0x169d90-0x0;var _0x2b501e=_0x1344[_0x169d90];return _0x2b501e;};'use strict';var _=require('lodash');var util=require(_0x4134('0x0'));var moment=require(_0x4134('0x1'));var BPromise=require(_0x4134('0x2'));var rs=require(_0x4134('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4134('0x4'))['db'];var utils=require(_0x4134('0x5'));var logger=require('../../config/logger')(_0x4134('0x6'));var config=require(_0x4134('0x7'));var jayson=require(_0x4134('0x8'));var client=jayson['client'][_0x4134('0x9')]({'port':0x232a});config[_0x4134('0xa')]=_[_0x4134('0xb')](config['redis'],{'host':_0x4134('0xc'),'port':0x18eb});var socket=require(_0x4134('0xd'))(new Redis(config[_0x4134('0xa')]));require('./cmList.socket')[_0x4134('0xe')](socket);function respondWithRpcPromise(_0x316f96,_0x52f9be,_0xa1c9d5){return new BPromise(function(_0xeb895f,_0x5aa982){return client[_0x4134('0xf')](_0x316f96,_0xa1c9d5)[_0x4134('0x10')](function(_0x4683ea){logger[_0x4134('0x11')]('CmList,\x20%s,\x20%s',_0x52f9be,_0x4134('0x12'));logger[_0x4134('0x13')](_0x4134('0x14'),_0x52f9be,_0x4134('0x12'),JSON[_0x4134('0x15')](_0x4683ea));if(_0x4683ea[_0x4134('0x16')]){if(_0x4683ea[_0x4134('0x16')][_0x4134('0x17')]===0x1f4){logger['error']('CmList,\x20%s,\x20%s',_0x52f9be,_0x4683ea[_0x4134('0x16')][_0x4134('0x18')]);return _0x5aa982(_0x4683ea[_0x4134('0x16')][_0x4134('0x18')]);}logger[_0x4134('0x16')](_0x4134('0x19'),_0x52f9be,_0x4683ea[_0x4134('0x16')][_0x4134('0x18')]);return _0xeb895f(_0x4683ea[_0x4134('0x16')][_0x4134('0x18')]);}else{logger[_0x4134('0x11')](_0x4134('0x19'),_0x52f9be,_0x4134('0x12'));_0xeb895f(_0x4683ea[_0x4134('0x1a')]['message']);}})[_0x4134('0x1b')](function(_0x15496f){logger[_0x4134('0x16')](_0x4134('0x19'),_0x52f9be,_0x15496f);_0x5aa982(_0x15496f);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index b7312d6..7bc6c8a 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 _0x8dc0=['removeListener','register','length','cmList:','save','remove','update','emit'];(function(_0x2a7552,_0x3374b1){var _0x21c078=function(_0x389807){while(--_0x389807){_0x2a7552['push'](_0x2a7552['shift']());}};_0x21c078(++_0x3374b1);}(_0x8dc0,0x64));var _0x08dc=function(_0x13c70c,_0x546b34){_0x13c70c=_0x13c70c-0x0;var _0x50f0f2=_0x8dc0[_0x13c70c];return _0x50f0f2;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x08dc('0x0'),_0x08dc('0x1'),_0x08dc('0x2')];function createListener(_0x2a74e2,_0x56f68e){return function(_0x220548){_0x56f68e[_0x08dc('0x3')](_0x2a74e2,_0x220548);};}function removeListener(_0x144b4f,_0x306ba3){return function(){CmListEvents[_0x08dc('0x4')](_0x144b4f,_0x306ba3);};}exports[_0x08dc('0x5')]=function(_0x50f991){for(var _0x3aa12=0x0,_0x24ff65=events[_0x08dc('0x6')];_0x3aa12<_0x24ff65;_0x3aa12++){var _0x52561b=events[_0x3aa12];var _0x3391cb=createListener(_0x08dc('0x7')+_0x52561b,_0x50f991);CmListEvents['on'](_0x52561b,_0x3391cb);}}; \ No newline at end of file +var _0xb8ed=['register','cmList:','./cmList.events','removeListener'];(function(_0x2c0358,_0x19eb76){var _0x10dd7c=function(_0x1761fd){while(--_0x1761fd){_0x2c0358['push'](_0x2c0358['shift']());}};_0x10dd7c(++_0x19eb76);}(_0xb8ed,0x116));var _0xdb8e=function(_0x84c8cb,_0x3bdd75){_0x84c8cb=_0x84c8cb-0x0;var _0x2d8dea=_0xb8ed[_0x84c8cb];return _0x2d8dea;};'use strict';var CmListEvents=require(_0xdb8e('0x0'));var events=['save','remove','update'];function createListener(_0x4d8b68,_0x46eb70){return function(_0x296194){_0x46eb70['emit'](_0x4d8b68,_0x296194);};}function removeListener(_0x56cf69,_0x353060){return function(){CmListEvents[_0xdb8e('0x1')](_0x56cf69,_0x353060);};}exports[_0xdb8e('0x2')]=function(_0x40390e){for(var _0xaa2fe4=0x0,_0x513df6=events['length'];_0xaa2fe4<_0x513df6;_0xaa2fe4++){var _0x3dff7e=events[_0xaa2fe4];var _0x1c65ea=createListener(_0xdb8e('0x3')+_0x3dff7e,_0x40390e);CmListEvents['on'](_0x3dff7e,_0x1c65ea);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 2963020..dd565e8 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 _0x718c=['Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','getAgents','post','addDisposition','addContacts','addCustomField','addAgents','update','delete','destroy','/:id/users','removeAgents','util','path','connect-timeout','express'];(function(_0x14704d,_0x3d5593){var _0x63d0f=function(_0x1d5dfb){while(--_0x1d5dfb){_0x14704d['push'](_0x14704d['shift']());}};_0x63d0f(++_0x3d5593);}(_0x718c,0xd5));var _0xc718=function(_0x5e2705,_0x1b0d80){_0x5e2705=_0x5e2705-0x0;var _0x4b699c=_0x718c[_0x5e2705];return _0x4b699c;};'use strict';var multer=require('multer');var util=require(_0xc718('0x0'));var path=require(_0xc718('0x1'));var timeout=require(_0xc718('0x2'));var express=require(_0xc718('0x3'));var router=express[_0xc718('0x4')]();var auth=require(_0xc718('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc718('0x6'));var controller=require('./cmList.controller');router[_0xc718('0x7')]('/',auth[_0xc718('0x8')](),controller['index']);router['get'](_0xc718('0x9'),auth['isAuthenticated'](),controller[_0xc718('0xa')]);router[_0xc718('0x7')](_0xc718('0xb'),auth[_0xc718('0x8')](),controller[_0xc718('0xc')]);router[_0xc718('0x7')](_0xc718('0xd'),auth['isAuthenticated'](),controller[_0xc718('0xe')]);router['get'](_0xc718('0xf'),auth[_0xc718('0x8')](),controller[_0xc718('0x10')]);router[_0xc718('0x7')](_0xc718('0x11'),auth[_0xc718('0x8')](),controller['getContactsCsv']);router[_0xc718('0x7')](_0xc718('0x12'),auth[_0xc718('0x8')](),controller[_0xc718('0x13')]);router[_0xc718('0x7')]('/:id/users',auth[_0xc718('0x8')](),controller[_0xc718('0x14')]);router[_0xc718('0x15')]('/',auth[_0xc718('0x8')](),controller['create']);router[_0xc718('0x15')](_0xc718('0xd'),auth['isAuthenticated'](),controller[_0xc718('0x16')]);router['post'](_0xc718('0xf'),auth[_0xc718('0x8')](),controller[_0xc718('0x17')]);router[_0xc718('0x15')](_0xc718('0x12'),auth['isAuthenticated'](),controller[_0xc718('0x18')]);router[_0xc718('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0xc718('0x19')]);router['put'](_0xc718('0xb'),auth[_0xc718('0x8')](),controller[_0xc718('0x1a')]);router[_0xc718('0x1b')]('/:id',auth[_0xc718('0x8')](),controller[_0xc718('0x1c')]);router['delete'](_0xc718('0xd'),auth[_0xc718('0x8')](),controller['removeDispositions']);router[_0xc718('0x1b')](_0xc718('0x1d'),auth[_0xc718('0x8')](),controller[_0xc718('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x7972=['util','connect-timeout','Router','../../components/auth/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','post','addDisposition','/:id/contacts','/:id/users','addAgents','put','delete','destroy','removeDispositions','removeAgents','exports','multer'];(function(_0x1f4034,_0x18b0dc){var _0x2f6ddb=function(_0x116bac){while(--_0x116bac){_0x1f4034['push'](_0x1f4034['shift']());}};_0x2f6ddb(++_0x18b0dc);}(_0x7972,0x173));var _0x2797=function(_0x171ab6,_0x1fbfa0){_0x171ab6=_0x171ab6-0x0;var _0x30368d=_0x7972[_0x171ab6];return _0x30368d;};'use strict';var multer=require(_0x2797('0x0'));var util=require(_0x2797('0x1'));var path=require('path');var timeout=require(_0x2797('0x2'));var express=require('express');var router=express[_0x2797('0x3')]();var auth=require(_0x2797('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2797('0x5'));var controller=require(_0x2797('0x6'));router[_0x2797('0x7')]('/',auth[_0x2797('0x8')](),controller[_0x2797('0x9')]);router[_0x2797('0x7')](_0x2797('0xa'),auth[_0x2797('0x8')](),controller[_0x2797('0xb')]);router[_0x2797('0x7')](_0x2797('0xc'),auth[_0x2797('0x8')](),controller[_0x2797('0xd')]);router[_0x2797('0x7')](_0x2797('0xe'),auth[_0x2797('0x8')](),controller[_0x2797('0xf')]);router['get']('/:id/contacts',auth[_0x2797('0x8')](),controller['getContacts']);router[_0x2797('0x7')](_0x2797('0x10'),auth[_0x2797('0x8')](),controller[_0x2797('0x11')]);router['get'](_0x2797('0x12'),auth[_0x2797('0x8')](),controller[_0x2797('0x13')]);router[_0x2797('0x7')]('/:id/users',auth[_0x2797('0x8')](),controller['getAgents']);router[_0x2797('0x14')]('/',auth[_0x2797('0x8')](),controller['create']);router['post']('/:id/dispositions',auth[_0x2797('0x8')](),controller[_0x2797('0x15')]);router[_0x2797('0x14')](_0x2797('0x16'),auth[_0x2797('0x8')](),controller['addContacts']);router['post'](_0x2797('0x12'),auth[_0x2797('0x8')](),controller['addCustomField']);router[_0x2797('0x14')](_0x2797('0x17'),auth[_0x2797('0x8')](),controller[_0x2797('0x18')]);router[_0x2797('0x19')](_0x2797('0xc'),auth[_0x2797('0x8')](),controller['update']);router[_0x2797('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x2797('0x1b')]);router['delete'](_0x2797('0xe'),auth[_0x2797('0x8')](),controller[_0x2797('0x1c')]);router[_0x2797('0x1a')](_0x2797('0x17'),auth[_0x2797('0x8')](),controller[_0x2797('0x1d')]);module[_0x2797('0x1e')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 9df6ca1..0201984 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 _0x5c4c=['STRING','sequelize','exports','VIRTUAL','getDataValue','field'];(function(_0x3050ca,_0x3e36b0){var _0x1eed1d=function(_0x195e8f){while(--_0x195e8f){_0x3050ca['push'](_0x3050ca['shift']());}};_0x1eed1d(++_0x3e36b0);}(_0x5c4c,0x1b7));var _0xc5c4=function(_0x2aa00c,_0x52706b){_0x2aa00c=_0x2aa00c-0x0;var _0x3b52a3=_0x5c4c[_0x2aa00c];return _0x3b52a3;};'use strict';var Sequelize=require(_0xc5c4('0x0'));module[_0xc5c4('0x1')]={'name':{'type':Sequelize[_0xc5c4('0x2')],'get':function(_0x2966a1){return this[_0xc5c4('0x3')](_0xc5c4('0x4'));}},'field':{'type':Sequelize[_0xc5c4('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0xc5c4('0x5')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x3003=['getDataValue','STRING','sequelize','VIRTUAL'];(function(_0x309e79,_0x476e5f){var _0x31dccd=function(_0x1e1ebd){while(--_0x1e1ebd){_0x309e79['push'](_0x309e79['shift']());}};_0x31dccd(++_0x476e5f);}(_0x3003,0x14a));var _0x3300=function(_0x55f9de,_0x1b31b7){_0x55f9de=_0x55f9de-0x0;var _0x33b6ce=_0x3003[_0x55f9de];return _0x33b6ce;};'use strict';var Sequelize=require(_0x3300('0x0'));module['exports']={'name':{'type':Sequelize[_0x3300('0x1')],'get':function(_0xcf9fb8){return this[_0x3300('0x2')]('field');}},'field':{'type':Sequelize[_0x3300('0x3')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 98ac250..d307814 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 _0x495a=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../mysqldb','sendStatus','json','count','offset','limit','status','apply','save','update','then','end','error','stack','name','body','find','params','catch','destroy','Condition','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','squel','crypto'];(function(_0x11d4e6,_0x5c4cee){var _0x49c251=function(_0x396f42){while(--_0x396f42){_0x11d4e6['push'](_0x11d4e6['shift']());}};_0x49c251(++_0x5c4cee);}(_0x495a,0x1e3));var _0xa495=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x495a[_0x3bf83f];return _0x22c4a9;};'use strict';var pdf=require(_0xa495('0x0'));var emlformat=require(_0xa495('0x1'));var rimraf=require(_0xa495('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa495('0x3'));var moment=require(_0xa495('0x4'));var BPromise=require(_0xa495('0x5'));var Mustache=require(_0xa495('0x6'));var util=require('util');var path=require(_0xa495('0x7'));var sox=require(_0xa495('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xa495('0x9'));var crypto=require(_0xa495('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa495('0xb'));var toCsv=require('to-csv');var querystring=require(_0xa495('0xc'));var Papa=require(_0xa495('0xd'));var Redis=require('ioredis');var authService=require(_0xa495('0xe'));var qs=require(_0xa495('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa495('0x10'));var db=require(_0xa495('0x11'))['db'];function respondWithStatusCode(_0x2d42fb,_0x1096e5){_0x1096e5=_0x1096e5||0xcc;return function(_0x290fb3){if(_0x290fb3){return _0x2d42fb[_0xa495('0x12')](_0x1096e5);}return _0x2d42fb['status'](_0x1096e5)['end']();};}function respondWithResult(_0x2a425d,_0x5d6f23){_0x5d6f23=_0x5d6f23||0xc8;return function(_0x3eca01){if(_0x3eca01){return _0x2a425d['status'](_0x5d6f23)[_0xa495('0x13')](_0x3eca01);}};}function respondWithFilteredResult(_0x14a869,_0x48324f){return function(_0x6e7f41){if(_0x6e7f41){var _0xcdf0fa=_0x6e7f41[_0xa495('0x14')],_0x1919fd=_0x48324f[_0xa495('0x15')],_0x1c3c1f=_0x48324f[_0xa495('0x15')]+_0x48324f[_0xa495('0x16')],_0x1a6051;if(_0x1c3c1f>=_0xcdf0fa){_0x1c3c1f=_0xcdf0fa;_0x1a6051=0xc8;}else{_0x1a6051=0xce;}_0x14a869[_0xa495('0x17')](_0x1a6051);return _0x14a869['set']('Content-Range',_0x1919fd+'-'+_0x1c3c1f+'/'+_0xcdf0fa)['json'](_0x6e7f41);}return null;};}function patchUpdates(_0x22b34c){return function(_0x18774c){try{jsonpatch[_0xa495('0x18')](_0x18774c,_0x22b34c,!![]);}catch(_0x7a1588){return BPromise['reject'](_0x7a1588);}return _0x18774c[_0xa495('0x19')]();};}function saveUpdates(_0x263230,_0x4c2984){return function(_0x311cac){if(_0x311cac){return _0x311cac[_0xa495('0x1a')](_0x263230)[_0xa495('0x1b')](function(_0x1e134c){return _0x1e134c;});}return null;};}function removeEntity(_0x307db7,_0x38450e){return function(_0x92eb5e){if(_0x92eb5e){return _0x92eb5e['destroy']()[_0xa495('0x1b')](function(){_0x307db7[_0xa495('0x17')](0xcc)[_0xa495('0x1c')]();});}};}function handleEntityNotFound(_0x154f36,_0x5b98e7){return function(_0x4bc204){if(!_0x4bc204){_0x154f36[_0xa495('0x12')](0x194);}return _0x4bc204;};}function handleError(_0x56322b,_0x1bab4e){_0x1bab4e=_0x1bab4e||0x1f4;return function(_0x3dab02){logger[_0xa495('0x1d')](_0x3dab02[_0xa495('0x1e')]);if(_0x3dab02[_0xa495('0x1f')]){delete _0x3dab02['name'];}_0x56322b[_0xa495('0x17')](_0x1bab4e)['send'](_0x3dab02);};}exports[_0xa495('0x1a')]=function(_0x53b6cf,_0xebeca7){if(_0x53b6cf[_0xa495('0x20')]['id']){delete _0x53b6cf[_0xa495('0x20')]['id'];}return db['Condition'][_0xa495('0x21')]({'where':{'id':_0x53b6cf[_0xa495('0x22')]['id']}})[_0xa495('0x1b')](handleEntityNotFound(_0xebeca7,null))['then'](saveUpdates(_0x53b6cf['body'],null))[_0xa495('0x1b')](respondWithResult(_0xebeca7,null))[_0xa495('0x23')](handleError(_0xebeca7,null));};exports[_0xa495('0x24')]=function(_0x4c4f62,_0x17bd30){return db[_0xa495('0x25')][_0xa495('0x21')]({'where':{'id':_0x4c4f62[_0xa495('0x22')]['id']}})[_0xa495('0x1b')](handleEntityNotFound(_0x17bd30,null))['then'](removeEntity(_0x17bd30,null))['catch'](handleError(_0x17bd30,null));}; \ No newline at end of file +var _0x45e5=['save','update','then','destroy','stack','name','body','Condition','find','params','catch','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x45e5,0x13f));var _0x545e=function(_0x2e6319,_0x232551){_0x2e6319=_0x2e6319-0x0;var _0x30aaef=_0x45e5[_0x2e6319];return _0x30aaef;};'use strict';var pdf=require(_0x545e('0x0'));var emlformat=require(_0x545e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x545e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x545e('0x3'));var moment=require('moment');var BPromise=require(_0x545e('0x4'));var Mustache=require(_0x545e('0x5'));var util=require(_0x545e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x545e('0x7'));var ejs=require(_0x545e('0x8'));var fs=require('fs');var _=require(_0x545e('0x9'));var squel=require(_0x545e('0xa'));var crypto=require('crypto');var jsforce=require(_0x545e('0xb'));var deskjs=require(_0x545e('0xc'));var toCsv=require('to-csv');var querystring=require(_0x545e('0xd'));var Papa=require(_0x545e('0xe'));var Redis=require(_0x545e('0xf'));var authService=require(_0x545e('0x10'));var qs=require(_0x545e('0x11'));var hardwareService=require(_0x545e('0x12'));var logger=require(_0x545e('0x13'))(_0x545e('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x545e('0x15'))['db'];function respondWithStatusCode(_0x3b455b,_0x16705c){_0x16705c=_0x16705c||0xcc;return function(_0x124dbf){if(_0x124dbf){return _0x3b455b[_0x545e('0x16')](_0x16705c);}return _0x3b455b[_0x545e('0x17')](_0x16705c)[_0x545e('0x18')]();};}function respondWithResult(_0x192640,_0x3335e6){_0x3335e6=_0x3335e6||0xc8;return function(_0x1d9611){if(_0x1d9611){return _0x192640['status'](_0x3335e6)[_0x545e('0x19')](_0x1d9611);}};}function respondWithFilteredResult(_0x2802d5,_0x27541d){return function(_0x180f2c){if(_0x180f2c){var _0x16c18d=_0x180f2c[_0x545e('0x1a')],_0x45e06e=_0x27541d[_0x545e('0x1b')],_0x282626=_0x27541d[_0x545e('0x1b')]+_0x27541d[_0x545e('0x1c')],_0x41495f;if(_0x282626>=_0x16c18d){_0x282626=_0x16c18d;_0x41495f=0xc8;}else{_0x41495f=0xce;}_0x2802d5['status'](_0x41495f);return _0x2802d5[_0x545e('0x1d')](_0x545e('0x1e'),_0x45e06e+'-'+_0x282626+'/'+_0x16c18d)[_0x545e('0x19')](_0x180f2c);}return null;};}function patchUpdates(_0x37b74a){return function(_0x57e24d){try{jsonpatch[_0x545e('0x1f')](_0x57e24d,_0x37b74a,!![]);}catch(_0x254892){return BPromise[_0x545e('0x20')](_0x254892);}return _0x57e24d[_0x545e('0x21')]();};}function saveUpdates(_0x360f40,_0x3e3966){return function(_0x2a7de0){if(_0x2a7de0){return _0x2a7de0[_0x545e('0x22')](_0x360f40)[_0x545e('0x23')](function(_0x2907f5){return _0x2907f5;});}return null;};}function removeEntity(_0x58d906,_0x161ee3){return function(_0x5de73c){if(_0x5de73c){return _0x5de73c[_0x545e('0x24')]()[_0x545e('0x23')](function(){_0x58d906[_0x545e('0x17')](0xcc)[_0x545e('0x18')]();});}};}function handleEntityNotFound(_0x5b8590,_0x4499d8){return function(_0x58f486){if(!_0x58f486){_0x5b8590[_0x545e('0x16')](0x194);}return _0x58f486;};}function handleError(_0x3049e5,_0x26234d){_0x26234d=_0x26234d||0x1f4;return function(_0x5a18bf){logger['error'](_0x5a18bf[_0x545e('0x25')]);if(_0x5a18bf[_0x545e('0x26')]){delete _0x5a18bf[_0x545e('0x26')];}_0x3049e5[_0x545e('0x17')](_0x26234d)['send'](_0x5a18bf);};}exports['update']=function(_0x4e5d9d,_0x183eb4){if(_0x4e5d9d['body']['id']){delete _0x4e5d9d[_0x545e('0x27')]['id'];}return db[_0x545e('0x28')][_0x545e('0x29')]({'where':{'id':_0x4e5d9d[_0x545e('0x2a')]['id']}})[_0x545e('0x23')](handleEntityNotFound(_0x183eb4,null))['then'](saveUpdates(_0x4e5d9d[_0x545e('0x27')],null))[_0x545e('0x23')](respondWithResult(_0x183eb4,null))[_0x545e('0x2b')](handleError(_0x183eb4,null));};exports[_0x545e('0x24')]=function(_0x22e584,_0x46879d){return db['Condition'][_0x545e('0x29')]({'where':{'id':_0x22e584['params']['id']}})[_0x545e('0x23')](handleEntityNotFound(_0x46879d,null))['then'](removeEntity(_0x46879d,null))['catch'](handleError(_0x46879d,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 08e10ef..76ffba6 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 _0xd394=['request-promise','path','rimraf','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','api','moment','bluebird'];(function(_0x2c05d3,_0x3c3a4e){var _0x324087=function(_0x1f4f1c){while(--_0x1f4f1c){_0x2c05d3['push'](_0x2c05d3['shift']());}};_0x324087(++_0x3c3a4e);}(_0xd394,0x126));var _0x4d39=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd394[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x4d39('0x0'));var util=require(_0x4d39('0x1'));var logger=require('../../config/logger')(_0x4d39('0x2'));var moment=require(_0x4d39('0x3'));var BPromise=require(_0x4d39('0x4'));var rp=require(_0x4d39('0x5'));var fs=require('fs');var path=require(_0x4d39('0x6'));var rimraf=require(_0x4d39('0x7'));var config=require('../../config/environment');var attributes=require(_0x4d39('0x8'));module[_0x4d39('0x9')]=function(_0x5b373f,_0x1800d3){return _0x5b373f[_0x4d39('0xa')](_0x4d39('0xb'),attributes,{'tableName':_0x4d39('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x568a=['../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./condition.attributes','exports','Condition','tools_conditions','lodash','util'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0x568a,0x169));var _0xa568=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x568a[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0xa568('0x0'));var util=require(_0xa568('0x1'));var logger=require(_0xa568('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa568('0x3'));var rp=require(_0xa568('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa568('0x5'));var config=require(_0xa568('0x6'));var attributes=require(_0xa568('0x7'));module[_0xa568('0x8')]=function(_0x4dec9a,_0x19c82c){return _0x4dec9a['define'](_0xa568('0x9'),attributes,{'tableName':_0xa568('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 bed9ad3..ceb4caa 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 _0x10f2=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3c416f,_0x1df52d){var _0x22730c=function(_0xf84196){while(--_0xf84196){_0x3c416f['push'](_0x3c416f['shift']());}};_0x22730c(++_0x1df52d);}(_0x10f2,0x1cf));var _0x210f=function(_0x24c57b,_0x2ab0c0){_0x24c57b=_0x24c57b-0x0;var _0x1d0146=_0x10f2[_0x24c57b];return _0x1d0146;};'use strict';var _=require(_0x210f('0x0'));var util=require('util');var moment=require(_0x210f('0x1'));var BPromise=require(_0x210f('0x2'));var rs=require(_0x210f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x210f('0x4'))['db'];var utils=require(_0x210f('0x5'));var logger=require(_0x210f('0x6'))(_0x210f('0x7'));var config=require(_0x210f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x210f('0x9')][_0x210f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25e1c8,_0x165ddc,_0x491d13){return new BPromise(function(_0x3f81ad,_0x1c1138){return client['request'](_0x25e1c8,_0x491d13)['then'](function(_0x580fbf){logger[_0x210f('0xb')](_0x210f('0xc'),_0x165ddc,_0x210f('0xd'));logger['debug'](_0x210f('0xe'),_0x165ddc,'request\x20sent',JSON[_0x210f('0xf')](_0x580fbf));if(_0x580fbf[_0x210f('0x10')]){if(_0x580fbf[_0x210f('0x10')][_0x210f('0x11')]===0x1f4){logger[_0x210f('0x10')](_0x210f('0xc'),_0x165ddc,_0x580fbf[_0x210f('0x10')]['message']);return _0x1c1138(_0x580fbf['error']['message']);}logger[_0x210f('0x10')]('Condition,\x20%s,\x20%s',_0x165ddc,_0x580fbf[_0x210f('0x10')][_0x210f('0x12')]);return _0x3f81ad(_0x580fbf['error'][_0x210f('0x12')]);}else{logger[_0x210f('0xb')]('Condition,\x20%s,\x20%s',_0x165ddc,_0x210f('0xd'));_0x3f81ad(_0x580fbf[_0x210f('0x13')][_0x210f('0x12')]);}})[_0x210f('0x14')](function(_0x700869){logger[_0x210f('0x10')](_0x210f('0xc'),_0x165ddc,_0x700869);_0x1c1138(_0x700869);});});} \ No newline at end of file +var _0x2cac=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0x2cac,0xa3));var _0xc2ca=function(_0x1d8fa1,_0x18d00f){_0x1d8fa1=_0x1d8fa1-0x0;var _0x528467=_0x2cac[_0x1d8fa1];return _0x528467;};'use strict';var _=require(_0xc2ca('0x0'));var util=require(_0xc2ca('0x1'));var moment=require(_0xc2ca('0x2'));var BPromise=require(_0xc2ca('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc2ca('0x4'));var db=require(_0xc2ca('0x5'))['db'];var utils=require(_0xc2ca('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xc2ca('0x7'));var jayson=require(_0xc2ca('0x8'));var client=jayson['client'][_0xc2ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1037f3,_0x2f32fe,_0xf05dcc){return new BPromise(function(_0xbd8476,_0x37fc6a){return client[_0xc2ca('0xa')](_0x1037f3,_0xf05dcc)[_0xc2ca('0xb')](function(_0x2a42c6){logger['info'](_0xc2ca('0xc'),_0x2f32fe,'request\x20sent');logger[_0xc2ca('0xd')](_0xc2ca('0xe'),_0x2f32fe,_0xc2ca('0xf'),JSON[_0xc2ca('0x10')](_0x2a42c6));if(_0x2a42c6['error']){if(_0x2a42c6[_0xc2ca('0x11')][_0xc2ca('0x12')]===0x1f4){logger[_0xc2ca('0x11')]('Condition,\x20%s,\x20%s',_0x2f32fe,_0x2a42c6['error'][_0xc2ca('0x13')]);return _0x37fc6a(_0x2a42c6['error'][_0xc2ca('0x13')]);}logger[_0xc2ca('0x11')]('Condition,\x20%s,\x20%s',_0x2f32fe,_0x2a42c6[_0xc2ca('0x11')][_0xc2ca('0x13')]);return _0xbd8476(_0x2a42c6['error'][_0xc2ca('0x13')]);}else{logger[_0xc2ca('0x14')](_0xc2ca('0xc'),_0x2f32fe,'request\x20sent');_0xbd8476(_0x2a42c6[_0xc2ca('0x15')][_0xc2ca('0x13')]);}})[_0xc2ca('0x16')](function(_0x1d7ecd){logger[_0xc2ca('0x11')](_0xc2ca('0xc'),_0x2f32fe,_0x1d7ecd);_0x37fc6a(_0x1d7ecd);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index e079ac4..994d376 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 _0x7f19=['path','connect-timeout','express','Router','../../components/interaction/service','./condition.controller','put','isAuthenticated','update','delete','/:id','destroy','exports','multer','util'];(function(_0x1265b5,_0x1057bb){var _0x14c198=function(_0x3219dc){while(--_0x3219dc){_0x1265b5['push'](_0x1265b5['shift']());}};_0x14c198(++_0x1057bb);}(_0x7f19,0x11b));var _0x97f1=function(_0x584002,_0x5b4209){_0x584002=_0x584002-0x0;var _0x511c7a=_0x7f19[_0x584002];return _0x511c7a;};'use strict';var multer=require(_0x97f1('0x0'));var util=require(_0x97f1('0x1'));var path=require(_0x97f1('0x2'));var timeout=require(_0x97f1('0x3'));var express=require(_0x97f1('0x4'));var router=express[_0x97f1('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x97f1('0x6'));var config=require('../../config/environment');var controller=require(_0x97f1('0x7'));router[_0x97f1('0x8')]('/:id',auth[_0x97f1('0x9')](),controller[_0x97f1('0xa')]);router[_0x97f1('0xb')](_0x97f1('0xc'),auth[_0x97f1('0x9')](),controller[_0x97f1('0xd')]);module[_0x97f1('0xe')]=router; \ No newline at end of file +var _0xa954=['put','/:id','isAuthenticated','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4b0b01,_0x503d0e){var _0x477730=function(_0x5a64ec){while(--_0x5a64ec){_0x4b0b01['push'](_0x4b0b01['shift']());}};_0x477730(++_0x503d0e);}(_0xa954,0x19b));var _0x4a95=function(_0x5517c0,_0x358609){_0x5517c0=_0x5517c0-0x0;var _0x33803b=_0xa954[_0x5517c0];return _0x33803b;};'use strict';var multer=require(_0x4a95('0x0'));var util=require(_0x4a95('0x1'));var path=require(_0x4a95('0x2'));var timeout=require(_0x4a95('0x3'));var express=require(_0x4a95('0x4'));var router=express[_0x4a95('0x5')]();var auth=require(_0x4a95('0x6'));var interaction=require(_0x4a95('0x7'));var config=require(_0x4a95('0x8'));var controller=require('./condition.controller');router[_0x4a95('0x9')](_0x4a95('0xa'),auth[_0x4a95('0xb')](),controller['update']);router[_0x4a95('0xc')]('/:id',auth[_0x4a95('0xb')](),controller['destroy']);module[_0x4a95('0xd')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 1a0b6e0..661c733 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 _0x8f05=['sequelize','exports','STRING','name'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x8f05,0xc4));var _0x58f0=function(_0x22c4b6,_0x5a7777){_0x22c4b6=_0x22c4b6-0x0;var _0xa5b2a1=_0x8f05[_0x22c4b6];return _0xa5b2a1;};'use strict';var Sequelize=require(_0x58f0('0x0'));module[_0x58f0('0x1')]={'name':{'type':Sequelize[_0x58f0('0x2')],'allowNull':![],'unique':_0x58f0('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfd88=['STRING','sequelize'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0xfd88,0x1c3));var _0x8fd8=function(_0x26cd05,_0x1f7d74){_0x26cd05=_0x26cd05-0x0;var _0x3e13b9=_0xfd88[_0x26cd05];return _0x3e13b9;};'use strict';var Sequelize=require(_0x8fd8('0x0'));module['exports']={'name':{'type':Sequelize[_0x8fd8('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 474107b..d060af1 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 _0xb2b9=['user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','catch','error','clone','params','omit','createdAt','updatedAt','body','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','type','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','DashboardItem','getItems','findOne','map','nolimit','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','socket.io-emitter','./dashboard.socket','register','end','status','json','count','offset','Content-Range','reject','save','update','then','CustomDashboards','UserProfileResource','destroy','sendStatus','name','send','Dashboard','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','key','VIRTUAL','includeAll','include','rows','rawAttributes','options','find','create'];(function(_0x62566f,_0x363cf2){var _0x24e421=function(_0x10da27){while(--_0x10da27){_0x62566f['push'](_0x62566f['shift']());}};_0x24e421(++_0x363cf2);}(_0xb2b9,0x115));var _0x9b2b=function(_0x59eaf2,_0x5b5f67){_0x59eaf2=_0x59eaf2-0x0;var _0x12d8e9=_0xb2b9[_0x59eaf2];return _0x12d8e9;};'use strict';var pdf=require(_0x9b2b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9b2b('0x1'));var zipdir=require(_0x9b2b('0x2'));var jsonpatch=require(_0x9b2b('0x3'));var rp=require(_0x9b2b('0x4'));var moment=require(_0x9b2b('0x5'));var BPromise=require(_0x9b2b('0x6'));var Mustache=require(_0x9b2b('0x7'));var util=require(_0x9b2b('0x8'));var path=require(_0x9b2b('0x9'));var sox=require(_0x9b2b('0xa'));var csv=require(_0x9b2b('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9b2b('0xc'));var squel=require('squel');var crypto=require(_0x9b2b('0xd'));var jsforce=require(_0x9b2b('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9b2b('0xf'));var Papa=require(_0x9b2b('0x10'));var Redis=require(_0x9b2b('0x11'));var authService=require(_0x9b2b('0x12'));var qs=require(_0x9b2b('0x13'));var hardwareService=require(_0x9b2b('0x14'));var logger=require(_0x9b2b('0x15'))(_0x9b2b('0x16'));var utils=require(_0x9b2b('0x17'));var config=require(_0x9b2b('0x18'));var db=require('../../mysqldb')['db'];config[_0x9b2b('0x19')]=_['defaults'](config[_0x9b2b('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x9b2b('0x1a'))(new Redis(config[_0x9b2b('0x19')]));require(_0x9b2b('0x1b'))[_0x9b2b('0x1c')](socket);function respondWithStatusCode(_0x4b5a87,_0x58fa94){_0x58fa94=_0x58fa94||0xcc;return function(_0x120baf){if(_0x120baf){return _0x4b5a87['sendStatus'](_0x58fa94);}return _0x4b5a87['status'](_0x58fa94)[_0x9b2b('0x1d')]();};}function respondWithResult(_0x42987d,_0x278635){_0x278635=_0x278635||0xc8;return function(_0x49ac04){if(_0x49ac04){return _0x42987d[_0x9b2b('0x1e')](_0x278635)[_0x9b2b('0x1f')](_0x49ac04);}};}function respondWithFilteredResult(_0xc57669,_0x511274){return function(_0x3ffa1b){if(_0x3ffa1b){var _0x367f02=_0x3ffa1b[_0x9b2b('0x20')],_0x18e98e=_0x511274[_0x9b2b('0x21')],_0x3dca50=_0x511274['offset']+_0x511274['limit'],_0x54d79a;if(_0x3dca50>=_0x367f02){_0x3dca50=_0x367f02;_0x54d79a=0xc8;}else{_0x54d79a=0xce;}_0xc57669[_0x9b2b('0x1e')](_0x54d79a);return _0xc57669['set'](_0x9b2b('0x22'),_0x18e98e+'-'+_0x3dca50+'/'+_0x367f02)[_0x9b2b('0x1f')](_0x3ffa1b);}return null;};}function patchUpdates(_0x16df5b){return function(_0x1ca8b2){try{jsonpatch['apply'](_0x1ca8b2,_0x16df5b,!![]);}catch(_0x3977d4){return BPromise[_0x9b2b('0x23')](_0x3977d4);}return _0x1ca8b2[_0x9b2b('0x24')]();};}function saveUpdates(_0x4a6431,_0x5b1b96){return function(_0x33ed03){if(_0x33ed03){return _0x33ed03[_0x9b2b('0x25')](_0x4a6431)[_0x9b2b('0x26')](function(_0x293b0e){return _0x293b0e;});}return null;};}function removeEntity(_0xffe6a0,_0x50843e){return function(_0x23970f){if(_0x23970f){return _0x23970f['destroy']()[_0x9b2b('0x26')](function(){var _0x55e53a=_0x23970f['get']({'plain':!![]});var _0x5cc417=_0x9b2b('0x27');return db[_0x9b2b('0x28')][_0x9b2b('0x29')]({'where':{'type':_0x5cc417,'resourceId':_0x55e53a['id']}})[_0x9b2b('0x26')](function(){return _0x23970f;});})['then'](function(){_0xffe6a0[_0x9b2b('0x1e')](0xcc)[_0x9b2b('0x1d')]();});}};}function handleEntityNotFound(_0x1a36a2,_0x670500){return function(_0x13b79d){if(!_0x13b79d){_0x1a36a2[_0x9b2b('0x2a')](0x194);}return _0x13b79d;};}function handleError(_0xcbaf6b,_0x2a1640){_0x2a1640=_0x2a1640||0x1f4;return function(_0x252c92){logger['error'](_0x252c92['stack']);if(_0x252c92['name']){delete _0x252c92[_0x9b2b('0x2b')];}_0xcbaf6b['status'](_0x2a1640)[_0x9b2b('0x2c')](_0x252c92);};}exports['index']=function(_0x302b26,_0x542bec){var _0x3450f3={},_0x2a06e0={},_0x333db3={'count':0x0,'rows':[]};var _0x5a1cd9=db[_0x9b2b('0x2d')]['rawAttributes'];_0x2a06e0[_0x9b2b('0x2e')]=_['keys'](_0x5a1cd9);_0x2a06e0[_0x9b2b('0x2f')]=_[_0x9b2b('0x30')](_0x302b26['query']);_0x2a06e0[_0x9b2b('0x31')]=_[_0x9b2b('0x32')](_0x2a06e0[_0x9b2b('0x2e')],_0x2a06e0[_0x9b2b('0x2f')]);_0x3450f3[_0x9b2b('0x33')]=_[_0x9b2b('0x32')](_0x2a06e0['model'],qs[_0x9b2b('0x34')](_0x302b26[_0x9b2b('0x2f')]['fields']));_0x3450f3[_0x9b2b('0x33')]=_0x3450f3[_0x9b2b('0x33')][_0x9b2b('0x35')]?_0x3450f3[_0x9b2b('0x33')]:_0x2a06e0[_0x9b2b('0x2e')];if(!_0x302b26[_0x9b2b('0x2f')][_0x9b2b('0x36')]('nolimit')){_0x3450f3[_0x9b2b('0x37')]=qs[_0x9b2b('0x37')](_0x302b26[_0x9b2b('0x2f')][_0x9b2b('0x37')]);_0x3450f3[_0x9b2b('0x21')]=qs['offset'](_0x302b26['query'][_0x9b2b('0x21')]);}_0x3450f3[_0x9b2b('0x38')]=qs[_0x9b2b('0x39')](_0x302b26[_0x9b2b('0x2f')][_0x9b2b('0x39')]);_0x3450f3[_0x9b2b('0x3a')]=qs['filters'](_[_0x9b2b('0x3b')](_0x302b26[_0x9b2b('0x2f')],_0x2a06e0[_0x9b2b('0x31')]));if(_0x302b26[_0x9b2b('0x2f')][_0x9b2b('0x3c')]){_0x3450f3['where']=_[_0x9b2b('0x3d')](_0x3450f3[_0x9b2b('0x3a')],{'$or':_['map'](_0x5a1cd9,function(_0x3ccd75){if(_0x3ccd75['type'][_0x9b2b('0x3e')]!==_0x9b2b('0x3f')){var _0x1c477b={};_0x1c477b[_0x3ccd75['field']]={'$like':'%'+_0x302b26[_0x9b2b('0x2f')][_0x9b2b('0x3c')]+'%'};return _0x1c477b;}})});}_0x3450f3=_['merge']({},_0x3450f3,_0x302b26['options']);var _0x206a6b={'where':_0x3450f3[_0x9b2b('0x3a')]};return db[_0x9b2b('0x2d')][_0x9b2b('0x20')](_0x206a6b)[_0x9b2b('0x26')](function(_0x45d279){_0x333db3[_0x9b2b('0x20')]=_0x45d279;if(_0x302b26[_0x9b2b('0x2f')][_0x9b2b('0x40')]){_0x3450f3[_0x9b2b('0x41')]=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x3450f3);})['then'](function(_0x301c61){_0x333db3[_0x9b2b('0x42')]=_0x301c61;return _0x333db3;})[_0x9b2b('0x26')](respondWithFilteredResult(_0x542bec,_0x3450f3))['catch'](handleError(_0x542bec,null));};exports['show']=function(_0xeb409e,_0x5ccab3){var _0x295ca1={'raw':![],'where':{'id':_0xeb409e['params']['id']}},_0x5cecfc={};_0x5cecfc[_0x9b2b('0x2e')]=_[_0x9b2b('0x30')](db['Dashboard'][_0x9b2b('0x43')]);_0x5cecfc[_0x9b2b('0x2f')]=_['keys'](_0xeb409e[_0x9b2b('0x2f')]);_0x5cecfc[_0x9b2b('0x31')]=_[_0x9b2b('0x32')](_0x5cecfc['model'],_0x5cecfc['query']);_0x295ca1[_0x9b2b('0x33')]=_[_0x9b2b('0x32')](_0x5cecfc[_0x9b2b('0x2e')],qs[_0x9b2b('0x34')](_0xeb409e[_0x9b2b('0x2f')][_0x9b2b('0x34')]));_0x295ca1[_0x9b2b('0x33')]=_0x295ca1[_0x9b2b('0x33')][_0x9b2b('0x35')]?_0x295ca1[_0x9b2b('0x33')]:_0x5cecfc[_0x9b2b('0x2e')];if(_0xeb409e[_0x9b2b('0x2f')][_0x9b2b('0x40')]){_0x295ca1[_0x9b2b('0x41')]=[{'all':!![]}];}_0x295ca1=_['merge']({},_0x295ca1,_0xeb409e[_0x9b2b('0x44')]);return db[_0x9b2b('0x2d')][_0x9b2b('0x45')](_0x295ca1)[_0x9b2b('0x26')](handleEntityNotFound(_0x5ccab3,null))[_0x9b2b('0x26')](respondWithResult(_0x5ccab3,null))['catch'](handleError(_0x5ccab3,null));};exports[_0x9b2b('0x46')]=function(_0x30c956,_0x4d12ce){return db[_0x9b2b('0x2d')][_0x9b2b('0x46')](_0x30c956['body'],{})[_0x9b2b('0x26')](function(_0x3c85ee){var _0x231740=_0x30c956[_0x9b2b('0x47')][_0x9b2b('0x48')]({'plain':!![]});if(!_0x231740)throw new Error(_0x9b2b('0x49'));if(_0x231740[_0x9b2b('0x4a')]===_0x9b2b('0x47')){var _0x1789b0=_0x3c85ee[_0x9b2b('0x48')]({'plain':!![]});var _0x29a7e5=_0x9b2b('0x27');return db['UserProfileSection'][_0x9b2b('0x45')]({'where':{'name':_0x29a7e5,'userProfileId':_0x231740[_0x9b2b('0x4b')]},'raw':!![]})[_0x9b2b('0x26')](function(_0x55a4b1){if(_0x55a4b1&&_0x55a4b1[_0x9b2b('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x1789b0[_0x9b2b('0x2b')],'resourceId':_0x1789b0['id'],'type':_0x55a4b1['name'],'sectionId':_0x55a4b1['id']},{})[_0x9b2b('0x26')](function(){return _0x3c85ee;});}else{return _0x3c85ee;}})[_0x9b2b('0x4d')](function(_0x55a127){logger[_0x9b2b('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55a127);throw _0x55a127;});}return _0x3c85ee;})[_0x9b2b('0x26')](respondWithResult(_0x4d12ce,0xc9))[_0x9b2b('0x4d')](handleError(_0x4d12ce,null));};exports[_0x9b2b('0x4f')]=function(_0x5c0c35,_0x45b09e){var _0x4c4b4c={'raw':![],'where':{'id':_0x5c0c35[_0x9b2b('0x50')]['id']}},_0xecb420={};_0xecb420[_0x9b2b('0x2e')]=_[_0x9b2b('0x30')](db[_0x9b2b('0x2d')][_0x9b2b('0x43')]);_0x4c4b4c[_0x9b2b('0x33')]=_[_0x9b2b('0x32')](_0xecb420[_0x9b2b('0x2e')],qs[_0x9b2b('0x34')](_0x5c0c35[_0x9b2b('0x2f')]['fields']));_0x4c4b4c[_0x9b2b('0x33')]=_0x4c4b4c['attributes']['length']?_0x4c4b4c[_0x9b2b('0x33')]:_0xecb420[_0x9b2b('0x2e')];if(_0x5c0c35[_0x9b2b('0x2f')]['includeAll']){_0x4c4b4c[_0x9b2b('0x41')]=[{'all':!![]}];}_0x4c4b4c=_[_0x9b2b('0x3d')]({},_0x4c4b4c,_0x5c0c35[_0x9b2b('0x44')]);return db[_0x9b2b('0x2d')][_0x9b2b('0x45')](_0x4c4b4c)[_0x9b2b('0x26')](handleEntityNotFound(_0x45b09e,null))['then'](function(_0x32d297){if(_0x32d297){var _0x59b449=_0x32d297[_0x9b2b('0x48')]({'plain':!![]});_0x59b449=qs[_0x9b2b('0x51')](_0x59b449,['id',_0x9b2b('0x52'),_0x9b2b('0x53')]);_0x5c0c35[_0x9b2b('0x54')]=_[_0x9b2b('0x51')](_0x5c0c35['body'],['id','createdAt',_0x9b2b('0x53')]);return db[_0x9b2b('0x2d')]['create'](_['merge'](_0x59b449,_0x5c0c35[_0x9b2b('0x54')]),{'include':_0x5c0c35[_0x9b2b('0x2f')]['includeAll']?[{'all':!![]}]:undefined})[_0x9b2b('0x26')](function(_0x53c2a6){var _0x3061e8=_0x5c0c35[_0x9b2b('0x47')]['get']({'plain':!![]});if(!_0x3061e8)throw new Error(_0x9b2b('0x49'));if(_0x3061e8[_0x9b2b('0x4a')]===_0x9b2b('0x47')){var _0x463b98=_0x53c2a6[_0x9b2b('0x48')]({'plain':!![]});var _0xcd62ab=_0x9b2b('0x27');return db['UserProfileSection'][_0x9b2b('0x45')]({'where':{'name':_0xcd62ab,'userProfileId':_0x3061e8[_0x9b2b('0x4b')]},'raw':!![]})[_0x9b2b('0x26')](function(_0x456ff1){if(_0x456ff1&&_0x456ff1['autoAssociation']===0x0){return db[_0x9b2b('0x28')]['create']({'name':_0x463b98['name'],'resourceId':_0x463b98['id'],'type':_0x456ff1[_0x9b2b('0x2b')],'sectionId':_0x456ff1['id']},{})[_0x9b2b('0x26')](function(){return _0x53c2a6;});}else{return _0x53c2a6;}})[_0x9b2b('0x4d')](function(_0x1a6a1c){logger[_0x9b2b('0x4e')](_0x9b2b('0x55'),_0x1a6a1c);throw _0x1a6a1c;});}return _0x53c2a6;});}})[_0x9b2b('0x26')](respondWithResult(_0x45b09e,0xc9))[_0x9b2b('0x4d')](handleError(_0x45b09e,null));};exports['update']=function(_0x3b2183,_0x113ce8){if(_0x3b2183[_0x9b2b('0x54')]['id']){delete _0x3b2183[_0x9b2b('0x54')]['id'];}return db[_0x9b2b('0x2d')][_0x9b2b('0x45')]({'where':{'id':_0x3b2183[_0x9b2b('0x50')]['id']}})[_0x9b2b('0x26')](handleEntityNotFound(_0x113ce8,null))['then'](saveUpdates(_0x3b2183[_0x9b2b('0x54')],null))[_0x9b2b('0x26')](respondWithResult(_0x113ce8,null))[_0x9b2b('0x4d')](handleError(_0x113ce8,null));};exports[_0x9b2b('0x29')]=function(_0xb87374,_0x549d2f){return db[_0x9b2b('0x2d')][_0x9b2b('0x45')]({'where':{'id':_0xb87374[_0x9b2b('0x50')]['id']}})[_0x9b2b('0x26')](handleEntityNotFound(_0x549d2f,null))['then'](removeEntity(_0x549d2f,null))[_0x9b2b('0x4d')](handleError(_0x549d2f,null));};function widgetAttributes(_0x40789c){try{switch(_0x40789c[_0x9b2b('0x56')]){case'iframe':return[{'name':_0x9b2b('0x57'),'value':_0x40789c[_0x9b2b('0x57')]||(_0x40789c[_0x9b2b('0x58')]&&_0x40789c['attrs'][0x0]?_0x40789c[_0x9b2b('0x58')][0x0][_0x9b2b('0x59')]:undefined)||_0x9b2b('0x5a')}];case _0x9b2b('0x5b'):return[{'name':_0x9b2b('0x5c'),'value':_0x40789c[_0x9b2b('0x5c')]||(_0x40789c[_0x9b2b('0x58')]&&_0x40789c['attrs'][0x0]?_0x40789c[_0x9b2b('0x58')][0x0][_0x9b2b('0x59')]:undefined)||''}];case _0x9b2b('0x5d'):return[{'name':_0x9b2b('0x5e'),'value':_0x40789c['attrHourFormat']||(_0x40789c[_0x9b2b('0x58')]&&_0x40789c[_0x9b2b('0x58')][0x0]?_0x40789c[_0x9b2b('0x58')][0x0][_0x9b2b('0x59')]:undefined)||_0x9b2b('0x5f')},{'name':_0x9b2b('0x60'),'value':_0x40789c[_0x9b2b('0x60')]||(_0x40789c['attrs']&&_0x40789c['attrs'][0x1]?_0x40789c[_0x9b2b('0x58')][0x1][_0x9b2b('0x59')]:undefined)||_0x9b2b('0x61')},{'name':'attrFontSize','value':_0x40789c[_0x9b2b('0x62')]||(_0x40789c[_0x9b2b('0x58')]&&_0x40789c[_0x9b2b('0x58')][0x2]?_0x40789c[_0x9b2b('0x58')][0x2][_0x9b2b('0x59')]:undefined)||0xc}];case _0x9b2b('0x63'):return[{'name':'attrMetric','value':_0x40789c['attrMetric']||(_0x40789c[_0x9b2b('0x58')]&&_0x40789c[_0x9b2b('0x58')][0x0]?_0x40789c[_0x9b2b('0x58')][0x0][_0x9b2b('0x59')]:undefined)||_0x9b2b('0x64')},{'name':_0x9b2b('0x65'),'value':_0x40789c['attrVoiceQueues']||(_0x40789c[_0x9b2b('0x58')]&&_0x40789c['attrs'][0x1]?_0x40789c[_0x9b2b('0x58')][0x1][_0x9b2b('0x59')]:undefined)||[]},{'name':_0x9b2b('0x62'),'value':_0x40789c['attrFontSize']||(_0x40789c['attrs']&&_0x40789c[_0x9b2b('0x58')][0x2]?_0x40789c['attrs'][0x2][_0x9b2b('0x59')]:undefined)||0x14}];case'multibar-chart':case _0x9b2b('0x66'):return[{'name':_0x9b2b('0x67'),'value':_0x40789c[_0x9b2b('0x67')]||(_0x40789c['attrs']&&_0x40789c[_0x9b2b('0x58')][0x0]?_0x40789c[_0x9b2b('0x58')][0x0][_0x9b2b('0x59')]:undefined)||_0x9b2b('0x64')},{'name':_0x9b2b('0x68'),'value':_0x40789c[_0x9b2b('0x68')]||(_0x40789c[_0x9b2b('0x58')]&&_0x40789c[_0x9b2b('0x58')][0x1]?_0x40789c[_0x9b2b('0x58')][0x1]['value']:undefined)||null},{'name':_0x9b2b('0x69'),'value':_0x40789c['attrSerie3']||(_0x40789c[_0x9b2b('0x58')]&&_0x40789c['attrs'][0x2]?_0x40789c[_0x9b2b('0x58')][0x2][_0x9b2b('0x59')]:undefined)||null},{'name':_0x9b2b('0x65'),'value':_0x40789c[_0x9b2b('0x65')]||(_0x40789c['attrs']&&_0x40789c[_0x9b2b('0x58')][0x3]?_0x40789c[_0x9b2b('0x58')][0x3][_0x9b2b('0x59')]:undefined)||[]}];case _0x9b2b('0x6a'):return[{'name':_0x9b2b('0x6b'),'type':_0x40789c[_0x9b2b('0x6c')]||(_0x40789c[_0x9b2b('0x58')]&&_0x40789c['attrs'][0x0]?_0x40789c['attrs'][0x0][_0x9b2b('0x56')]:undefined)||null,'value':_0x40789c[_0x9b2b('0x6b')]||(_0x40789c[_0x9b2b('0x58')]&&_0x40789c[_0x9b2b('0x58')][0x0]?_0x40789c[_0x9b2b('0x58')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x40789c[_0x9b2b('0x6d')]||(_0x40789c['attrs']&&_0x40789c[_0x9b2b('0x58')][0x1]?_0x40789c[_0x9b2b('0x58')][0x1][_0x9b2b('0x59')]:undefined)||0x0}];default:return[];}}catch(_0x5e9b09){logger[_0x9b2b('0x4e')](_0x9b2b('0x6e'),JSON['stringify'](_0x5e9b09));return[];}}exports['addItem']=function(_0x10090a,_0x57b7e9,_0x438bb8){if(_0x10090a['body']['id']){delete _0x10090a[_0x9b2b('0x54')]['id'];}return db[_0x9b2b('0x2d')][_0x9b2b('0x45')]({'where':{'id':_0x10090a[_0x9b2b('0x50')]['id']}})[_0x9b2b('0x26')](handleEntityNotFound(_0x57b7e9,null))[_0x9b2b('0x26')](function(_0xf0221){if(_0xf0221){_0x10090a[_0x9b2b('0x54')]['DashboardId']=_0xf0221['id'];_0x10090a[_0x9b2b('0x54')][_0x9b2b('0x58')]=widgetAttributes(_0x10090a[_0x9b2b('0x54')]);return db[_0x9b2b('0x6f')][_0x9b2b('0x46')](_0x10090a['body']);}})[_0x9b2b('0x26')](respondWithResult(_0x57b7e9,null))[_0x9b2b('0x4d')](handleError(_0x57b7e9,null));};exports[_0x9b2b('0x70')]=function(_0x2f866b,_0x398f44,_0x31dc5a){var _0xb06f47={};var _0x479c95={};var _0x73bbf0;var _0x169081;return db[_0x9b2b('0x2d')][_0x9b2b('0x71')]({'where':{'id':_0x2f866b[_0x9b2b('0x50')]['id']}})[_0x9b2b('0x26')](handleEntityNotFound(_0x398f44,null))[_0x9b2b('0x26')](function(_0x59bf0c){if(_0x59bf0c){_0x73bbf0=_0x59bf0c;_0x479c95[_0x9b2b('0x2e')]=_[_0x9b2b('0x30')](db[_0x9b2b('0x6f')][_0x9b2b('0x43')]);_0x479c95[_0x9b2b('0x2f')]=_['keys'](_0x2f866b[_0x9b2b('0x2f')]);_0x479c95[_0x9b2b('0x31')]=_[_0x9b2b('0x32')](_0x479c95['model'],_0x479c95[_0x9b2b('0x2f')]);_0xb06f47['attributes']=_[_0x9b2b('0x32')](_0x479c95['model'],qs[_0x9b2b('0x34')](_0x2f866b[_0x9b2b('0x2f')]['fields']));_0xb06f47[_0x9b2b('0x33')]=_0xb06f47['attributes'][_0x9b2b('0x35')]?_0xb06f47[_0x9b2b('0x33')]:_0x479c95[_0x9b2b('0x2e')];_0xb06f47[_0x9b2b('0x38')]=qs[_0x9b2b('0x39')](_0x2f866b[_0x9b2b('0x2f')][_0x9b2b('0x39')]);_0xb06f47[_0x9b2b('0x3a')]=qs[_0x9b2b('0x31')](_[_0x9b2b('0x3b')](_0x2f866b[_0x9b2b('0x2f')],_0x479c95['filters']));if(_0x2f866b['query'][_0x9b2b('0x3c')]){_0xb06f47['where']=_['merge'](_0xb06f47['where'],{'$or':_[_0x9b2b('0x72')](_0xb06f47[_0x9b2b('0x33')],function(_0x516975){var _0x2c11b3={};_0x2c11b3[_0x516975]={'$like':'%'+_0x2f866b[_0x9b2b('0x2f')][_0x9b2b('0x3c')]+'%'};return _0x2c11b3;})});}_0xb06f47=_['merge']({},_0xb06f47,_0x2f866b[_0x9b2b('0x44')]);return _0x73bbf0['getItems'](_0xb06f47);}})[_0x9b2b('0x26')](function(_0x2c71bd){if(_0x2c71bd){_0x169081=_0x2c71bd[_0x9b2b('0x35')];if(!_0x2f866b['query'][_0x9b2b('0x36')](_0x9b2b('0x73'))){_0xb06f47[_0x9b2b('0x37')]=qs['limit'](_0x2f866b[_0x9b2b('0x2f')][_0x9b2b('0x37')]);_0xb06f47['offset']=qs[_0x9b2b('0x21')](_0x2f866b['query'][_0x9b2b('0x21')]);}return _0x73bbf0['getItems'](_0xb06f47);}})[_0x9b2b('0x26')](function(_0x4678d3){if(_0x4678d3){return _0x4678d3?{'count':_0x169081,'rows':_0x4678d3}:null;}})[_0x9b2b('0x26')](respondWithResult(_0x398f44,null))['catch'](handleError(_0x398f44,null));}; \ No newline at end of file +var _0x9bee=['sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','role','UserProfileSection','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','findOne','rawAttributes','getItems','html-pdf','eml-format','rimraf','bluebird','path','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','register','status','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','CustomDashboards','UserProfileResource','end','sendStatus','error','name','send','index','Dashboard','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order'];(function(_0x492af5,_0xd51471){var _0x59f529=function(_0x40c9aa){while(--_0x40c9aa){_0x492af5['push'](_0x492af5['shift']());}};_0x59f529(++_0xd51471);}(_0x9bee,0x1a0));var _0xe9be=function(_0x256237,_0x1c71e){_0x256237=_0x256237-0x0;var _0x2dcf41=_0x9bee[_0x256237];return _0x2dcf41;};'use strict';var pdf=require(_0xe9be('0x0'));var emlformat=require(_0xe9be('0x1'));var rimraf=require(_0xe9be('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe9be('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe9be('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xe9be('0x5'));var crypto=require(_0xe9be('0x6'));var jsforce=require(_0xe9be('0x7'));var deskjs=require(_0xe9be('0x8'));var toCsv=require('to-csv');var querystring=require(_0xe9be('0x9'));var Papa=require(_0xe9be('0xa'));var Redis=require(_0xe9be('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xe9be('0xc'));var hardwareService=require(_0xe9be('0xd'));var logger=require(_0xe9be('0xe'))(_0xe9be('0xf'));var utils=require(_0xe9be('0x10'));var config=require(_0xe9be('0x11'));var db=require(_0xe9be('0x12'))['db'];config['redis']=_['defaults'](config[_0xe9be('0x13')],{'host':_0xe9be('0x14'),'port':0x18eb});var socket=require(_0xe9be('0x15'))(new Redis(config['redis']));require(_0xe9be('0x16'))[_0xe9be('0x17')](socket);function respondWithStatusCode(_0xf3e275,_0x1301da){_0x1301da=_0x1301da||0xcc;return function(_0x52749f){if(_0x52749f){return _0xf3e275['sendStatus'](_0x1301da);}return _0xf3e275['status'](_0x1301da)['end']();};}function respondWithResult(_0x42204f,_0x5e1bb4){_0x5e1bb4=_0x5e1bb4||0xc8;return function(_0x242176){if(_0x242176){return _0x42204f[_0xe9be('0x18')](_0x5e1bb4)['json'](_0x242176);}};}function respondWithFilteredResult(_0x193cfc,_0x38b938){return function(_0x5371f8){if(_0x5371f8){var _0x1e7844=_0x5371f8[_0xe9be('0x19')],_0x4ac39d=_0x38b938[_0xe9be('0x1a')],_0x27e08b=_0x38b938[_0xe9be('0x1a')]+_0x38b938[_0xe9be('0x1b')],_0x223cb6;if(_0x27e08b>=_0x1e7844){_0x27e08b=_0x1e7844;_0x223cb6=0xc8;}else{_0x223cb6=0xce;}_0x193cfc[_0xe9be('0x18')](_0x223cb6);return _0x193cfc[_0xe9be('0x1c')](_0xe9be('0x1d'),_0x4ac39d+'-'+_0x27e08b+'/'+_0x1e7844)[_0xe9be('0x1e')](_0x5371f8);}return null;};}function patchUpdates(_0xf37ce2){return function(_0x5653b1){try{jsonpatch[_0xe9be('0x1f')](_0x5653b1,_0xf37ce2,!![]);}catch(_0x3a2abd){return BPromise[_0xe9be('0x20')](_0x3a2abd);}return _0x5653b1[_0xe9be('0x21')]();};}function saveUpdates(_0x4c8a1f,_0x5979b2){return function(_0x15db86){if(_0x15db86){return _0x15db86['update'](_0x4c8a1f)[_0xe9be('0x22')](function(_0x3e012b){return _0x3e012b;});}return null;};}function removeEntity(_0x257754,_0x115ea8){return function(_0x28a9c1){if(_0x28a9c1){return _0x28a9c1[_0xe9be('0x23')]()[_0xe9be('0x22')](function(){var _0x22d498=_0x28a9c1['get']({'plain':!![]});var _0x1bee1a=_0xe9be('0x24');return db[_0xe9be('0x25')][_0xe9be('0x23')]({'where':{'type':_0x1bee1a,'resourceId':_0x22d498['id']}})[_0xe9be('0x22')](function(){return _0x28a9c1;});})[_0xe9be('0x22')](function(){_0x257754[_0xe9be('0x18')](0xcc)[_0xe9be('0x26')]();});}};}function handleEntityNotFound(_0x2dfd7c,_0x8746f7){return function(_0x544147){if(!_0x544147){_0x2dfd7c[_0xe9be('0x27')](0x194);}return _0x544147;};}function handleError(_0x5bfbde,_0x413699){_0x413699=_0x413699||0x1f4;return function(_0x2fd591){logger[_0xe9be('0x28')](_0x2fd591['stack']);if(_0x2fd591['name']){delete _0x2fd591[_0xe9be('0x29')];}_0x5bfbde['status'](_0x413699)[_0xe9be('0x2a')](_0x2fd591);};}exports[_0xe9be('0x2b')]=function(_0x15feb6,_0x354f6a){var _0x339b43={},_0x3f7a42={},_0x1ade51={'count':0x0,'rows':[]};var _0x27d1aa=db[_0xe9be('0x2c')]['rawAttributes'];_0x3f7a42[_0xe9be('0x2d')]=_[_0xe9be('0x2e')](_0x27d1aa);_0x3f7a42['query']=_[_0xe9be('0x2e')](_0x15feb6[_0xe9be('0x2f')]);_0x3f7a42[_0xe9be('0x30')]=_['intersection'](_0x3f7a42[_0xe9be('0x2d')],_0x3f7a42[_0xe9be('0x2f')]);_0x339b43[_0xe9be('0x31')]=_[_0xe9be('0x32')](_0x3f7a42['model'],qs[_0xe9be('0x33')](_0x15feb6[_0xe9be('0x2f')][_0xe9be('0x33')]));_0x339b43[_0xe9be('0x31')]=_0x339b43['attributes'][_0xe9be('0x34')]?_0x339b43[_0xe9be('0x31')]:_0x3f7a42[_0xe9be('0x2d')];if(!_0x15feb6[_0xe9be('0x2f')][_0xe9be('0x35')](_0xe9be('0x36'))){_0x339b43[_0xe9be('0x1b')]=qs['limit'](_0x15feb6['query']['limit']);_0x339b43['offset']=qs[_0xe9be('0x1a')](_0x15feb6[_0xe9be('0x2f')][_0xe9be('0x1a')]);}_0x339b43[_0xe9be('0x37')]=qs['sort'](_0x15feb6[_0xe9be('0x2f')][_0xe9be('0x38')]);_0x339b43['where']=qs['filters'](_[_0xe9be('0x39')](_0x15feb6['query'],_0x3f7a42[_0xe9be('0x30')]));if(_0x15feb6[_0xe9be('0x2f')][_0xe9be('0x3a')]){_0x339b43[_0xe9be('0x3b')]=_[_0xe9be('0x3c')](_0x339b43[_0xe9be('0x3b')],{'$or':_[_0xe9be('0x3d')](_0x27d1aa,function(_0x4824f5){if(_0x4824f5[_0xe9be('0x3e')][_0xe9be('0x3f')]!==_0xe9be('0x40')){var _0x36b47b={};_0x36b47b[_0x4824f5[_0xe9be('0x41')]]={'$like':'%'+_0x15feb6[_0xe9be('0x2f')][_0xe9be('0x3a')]+'%'};return _0x36b47b;}})});}_0x339b43=_['merge']({},_0x339b43,_0x15feb6[_0xe9be('0x42')]);var _0x4ac5c8={'where':_0x339b43[_0xe9be('0x3b')]};return db['Dashboard'][_0xe9be('0x19')](_0x4ac5c8)[_0xe9be('0x22')](function(_0x59c1a3){_0x1ade51['count']=_0x59c1a3;if(_0x15feb6[_0xe9be('0x2f')][_0xe9be('0x43')]){_0x339b43[_0xe9be('0x44')]=[{'all':!![]}];}return db['Dashboard'][_0xe9be('0x45')](_0x339b43);})[_0xe9be('0x22')](function(_0x9f72f5){_0x1ade51[_0xe9be('0x46')]=_0x9f72f5;return _0x1ade51;})[_0xe9be('0x22')](respondWithFilteredResult(_0x354f6a,_0x339b43))[_0xe9be('0x47')](handleError(_0x354f6a,null));};exports['show']=function(_0x372e13,_0x351048){var _0x280bee={'raw':![],'where':{'id':_0x372e13[_0xe9be('0x48')]['id']}},_0x31eb0a={};_0x31eb0a['model']=_[_0xe9be('0x2e')](db[_0xe9be('0x2c')]['rawAttributes']);_0x31eb0a[_0xe9be('0x2f')]=_['keys'](_0x372e13[_0xe9be('0x2f')]);_0x31eb0a[_0xe9be('0x30')]=_['intersection'](_0x31eb0a[_0xe9be('0x2d')],_0x31eb0a[_0xe9be('0x2f')]);_0x280bee['attributes']=_[_0xe9be('0x32')](_0x31eb0a[_0xe9be('0x2d')],qs[_0xe9be('0x33')](_0x372e13[_0xe9be('0x2f')][_0xe9be('0x33')]));_0x280bee[_0xe9be('0x31')]=_0x280bee[_0xe9be('0x31')][_0xe9be('0x34')]?_0x280bee['attributes']:_0x31eb0a[_0xe9be('0x2d')];if(_0x372e13[_0xe9be('0x2f')][_0xe9be('0x43')]){_0x280bee['include']=[{'all':!![]}];}_0x280bee=_[_0xe9be('0x3c')]({},_0x280bee,_0x372e13['options']);return db[_0xe9be('0x2c')]['find'](_0x280bee)[_0xe9be('0x22')](handleEntityNotFound(_0x351048,null))[_0xe9be('0x22')](respondWithResult(_0x351048,null))['catch'](handleError(_0x351048,null));};exports['create']=function(_0x50f37a,_0x5ba1a1){return db[_0xe9be('0x2c')][_0xe9be('0x49')](_0x50f37a[_0xe9be('0x4a')],{})[_0xe9be('0x22')](function(_0x4cdacc){var _0x4a1eba=_0x50f37a[_0xe9be('0x4b')]['get']({'plain':!![]});if(!_0x4a1eba)throw new Error(_0xe9be('0x4c'));if(_0x4a1eba['role']===_0xe9be('0x4b')){var _0x58afc6=_0x4cdacc[_0xe9be('0x4d')]({'plain':!![]});var _0x11d8a5=_0xe9be('0x24');return db['UserProfileSection'][_0xe9be('0x4e')]({'where':{'name':_0x11d8a5,'userProfileId':_0x4a1eba['userProfileId']},'raw':!![]})[_0xe9be('0x22')](function(_0x398ff3){if(_0x398ff3&&_0x398ff3[_0xe9be('0x4f')]===0x0){return db[_0xe9be('0x25')][_0xe9be('0x49')]({'name':_0x58afc6[_0xe9be('0x29')],'resourceId':_0x58afc6['id'],'type':_0x398ff3[_0xe9be('0x29')],'sectionId':_0x398ff3['id']},{})[_0xe9be('0x22')](function(){return _0x4cdacc;});}else{return _0x4cdacc;}})['catch'](function(_0x4f28e8){logger[_0xe9be('0x28')](_0xe9be('0x50'),_0x4f28e8);throw _0x4f28e8;});}return _0x4cdacc;})[_0xe9be('0x22')](respondWithResult(_0x5ba1a1,0xc9))['catch'](handleError(_0x5ba1a1,null));};exports[_0xe9be('0x51')]=function(_0x1fbba8,_0x3f14a5){var _0x4ae9a3={'raw':![],'where':{'id':_0x1fbba8[_0xe9be('0x48')]['id']}},_0x2e52c9={};_0x2e52c9[_0xe9be('0x2d')]=_[_0xe9be('0x2e')](db[_0xe9be('0x2c')]['rawAttributes']);_0x4ae9a3['attributes']=_[_0xe9be('0x32')](_0x2e52c9[_0xe9be('0x2d')],qs['fields'](_0x1fbba8[_0xe9be('0x2f')]['fields']));_0x4ae9a3[_0xe9be('0x31')]=_0x4ae9a3[_0xe9be('0x31')][_0xe9be('0x34')]?_0x4ae9a3['attributes']:_0x2e52c9[_0xe9be('0x2d')];if(_0x1fbba8[_0xe9be('0x2f')][_0xe9be('0x43')]){_0x4ae9a3[_0xe9be('0x44')]=[{'all':!![]}];}_0x4ae9a3=_[_0xe9be('0x3c')]({},_0x4ae9a3,_0x1fbba8[_0xe9be('0x42')]);return db[_0xe9be('0x2c')][_0xe9be('0x4e')](_0x4ae9a3)[_0xe9be('0x22')](handleEntityNotFound(_0x3f14a5,null))[_0xe9be('0x22')](function(_0x203201){if(_0x203201){var _0x89fc67=_0x203201[_0xe9be('0x4d')]({'plain':!![]});_0x89fc67=qs['omit'](_0x89fc67,['id',_0xe9be('0x52'),_0xe9be('0x53')]);_0x1fbba8['body']=_[_0xe9be('0x54')](_0x1fbba8[_0xe9be('0x4a')],['id',_0xe9be('0x52'),_0xe9be('0x53')]);return db[_0xe9be('0x2c')]['create'](_['merge'](_0x89fc67,_0x1fbba8[_0xe9be('0x4a')]),{'include':_0x1fbba8[_0xe9be('0x2f')][_0xe9be('0x43')]?[{'all':!![]}]:undefined})[_0xe9be('0x22')](function(_0x1e277b){var _0x492b93=_0x1fbba8[_0xe9be('0x4b')][_0xe9be('0x4d')]({'plain':!![]});if(!_0x492b93)throw new Error(_0xe9be('0x4c'));if(_0x492b93[_0xe9be('0x55')]==='user'){var _0x2c8e05=_0x1e277b[_0xe9be('0x4d')]({'plain':!![]});var _0x3d83ff=_0xe9be('0x24');return db[_0xe9be('0x56')][_0xe9be('0x4e')]({'where':{'name':_0x3d83ff,'userProfileId':_0x492b93['userProfileId']},'raw':!![]})[_0xe9be('0x22')](function(_0x7b3921){if(_0x7b3921&&_0x7b3921[_0xe9be('0x4f')]===0x0){return db[_0xe9be('0x25')]['create']({'name':_0x2c8e05['name'],'resourceId':_0x2c8e05['id'],'type':_0x7b3921[_0xe9be('0x29')],'sectionId':_0x7b3921['id']},{})[_0xe9be('0x22')](function(){return _0x1e277b;});}else{return _0x1e277b;}})['catch'](function(_0x5245b1){logger[_0xe9be('0x28')](_0xe9be('0x50'),_0x5245b1);throw _0x5245b1;});}return _0x1e277b;});}})['then'](respondWithResult(_0x3f14a5,0xc9))['catch'](handleError(_0x3f14a5,null));};exports['update']=function(_0x352d4d,_0x331573){if(_0x352d4d['body']['id']){delete _0x352d4d[_0xe9be('0x4a')]['id'];}return db['Dashboard'][_0xe9be('0x4e')]({'where':{'id':_0x352d4d['params']['id']}})[_0xe9be('0x22')](handleEntityNotFound(_0x331573,null))['then'](saveUpdates(_0x352d4d[_0xe9be('0x4a')],null))[_0xe9be('0x22')](respondWithResult(_0x331573,null))[_0xe9be('0x47')](handleError(_0x331573,null));};exports['destroy']=function(_0x18919e,_0x361228){return db[_0xe9be('0x2c')]['find']({'where':{'id':_0x18919e['params']['id']}})[_0xe9be('0x22')](handleEntityNotFound(_0x361228,null))[_0xe9be('0x22')](removeEntity(_0x361228,null))['catch'](handleError(_0x361228,null));};function widgetAttributes(_0x236df8){try{switch(_0x236df8['type']){case _0xe9be('0x57'):return[{'name':_0xe9be('0x58'),'value':_0x236df8['attrUrl']||(_0x236df8[_0xe9be('0x59')]&&_0x236df8[_0xe9be('0x59')][0x0]?_0x236df8[_0xe9be('0x59')][0x0]['value']:undefined)||_0xe9be('0x5a')}];case _0xe9be('0x5b'):return[{'name':_0xe9be('0x5c'),'value':_0x236df8[_0xe9be('0x5c')]||(_0x236df8[_0xe9be('0x59')]&&_0x236df8['attrs'][0x0]?_0x236df8[_0xe9be('0x59')][0x0][_0xe9be('0x5d')]:undefined)||''}];case _0xe9be('0x5e'):return[{'name':_0xe9be('0x5f'),'value':_0x236df8[_0xe9be('0x5f')]||(_0x236df8[_0xe9be('0x59')]&&_0x236df8[_0xe9be('0x59')][0x0]?_0x236df8[_0xe9be('0x59')][0x0][_0xe9be('0x5d')]:undefined)||'HH:mm:ss'},{'name':_0xe9be('0x60'),'value':_0x236df8[_0xe9be('0x60')]||(_0x236df8[_0xe9be('0x59')]&&_0x236df8[_0xe9be('0x59')][0x1]?_0x236df8[_0xe9be('0x59')][0x1][_0xe9be('0x5d')]:undefined)||_0xe9be('0x61')},{'name':'attrFontSize','value':_0x236df8[_0xe9be('0x62')]||(_0x236df8[_0xe9be('0x59')]&&_0x236df8['attrs'][0x2]?_0x236df8[_0xe9be('0x59')][0x2][_0xe9be('0x5d')]:undefined)||0xc}];case'counter':return[{'name':_0xe9be('0x63'),'value':_0x236df8[_0xe9be('0x63')]||(_0x236df8[_0xe9be('0x59')]&&_0x236df8[_0xe9be('0x59')][0x0]?_0x236df8[_0xe9be('0x59')][0x0][_0xe9be('0x5d')]:undefined)||_0xe9be('0x64')},{'name':'attrVoiceQueues','value':_0x236df8[_0xe9be('0x65')]||(_0x236df8[_0xe9be('0x59')]&&_0x236df8[_0xe9be('0x59')][0x1]?_0x236df8[_0xe9be('0x59')][0x1][_0xe9be('0x5d')]:undefined)||[]},{'name':_0xe9be('0x62'),'value':_0x236df8[_0xe9be('0x62')]||(_0x236df8[_0xe9be('0x59')]&&_0x236df8[_0xe9be('0x59')][0x2]?_0x236df8[_0xe9be('0x59')][0x2][_0xe9be('0x5d')]:undefined)||0x14}];case'multibar-chart':case _0xe9be('0x66'):return[{'name':'attrSerie1','value':_0x236df8[_0xe9be('0x67')]||(_0x236df8[_0xe9be('0x59')]&&_0x236df8[_0xe9be('0x59')][0x0]?_0x236df8[_0xe9be('0x59')][0x0][_0xe9be('0x5d')]:undefined)||_0xe9be('0x64')},{'name':'attrSerie2','value':_0x236df8[_0xe9be('0x68')]||(_0x236df8[_0xe9be('0x59')]&&_0x236df8[_0xe9be('0x59')][0x1]?_0x236df8[_0xe9be('0x59')][0x1][_0xe9be('0x5d')]:undefined)||null},{'name':'attrSerie3','value':_0x236df8[_0xe9be('0x69')]||(_0x236df8[_0xe9be('0x59')]&&_0x236df8['attrs'][0x2]?_0x236df8[_0xe9be('0x59')][0x2][_0xe9be('0x5d')]:undefined)||null},{'name':_0xe9be('0x65'),'value':_0x236df8[_0xe9be('0x65')]||(_0x236df8[_0xe9be('0x59')]&&_0x236df8[_0xe9be('0x59')][0x3]?_0x236df8[_0xe9be('0x59')][0x3][_0xe9be('0x5d')]:undefined)||[]}];case _0xe9be('0x6a'):return[{'name':_0xe9be('0x6b'),'type':_0x236df8[_0xe9be('0x6c')]||(_0x236df8[_0xe9be('0x59')]&&_0x236df8['attrs'][0x0]?_0x236df8[_0xe9be('0x59')][0x0][_0xe9be('0x3e')]:undefined)||null,'value':_0x236df8[_0xe9be('0x6b')]||(_0x236df8['attrs']&&_0x236df8[_0xe9be('0x59')][0x0]?_0x236df8[_0xe9be('0x59')][0x0][_0xe9be('0x5d')]:undefined)||null},{'name':_0xe9be('0x6d'),'value':_0x236df8[_0xe9be('0x6d')]||(_0x236df8[_0xe9be('0x59')]&&_0x236df8[_0xe9be('0x59')][0x1]?_0x236df8['attrs'][0x1][_0xe9be('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x32b6a1){logger[_0xe9be('0x28')](_0xe9be('0x6e'),JSON[_0xe9be('0x6f')](_0x32b6a1));return[];}}exports[_0xe9be('0x70')]=function(_0x44323e,_0x4ccb56,_0x52a97e){if(_0x44323e[_0xe9be('0x4a')]['id']){delete _0x44323e[_0xe9be('0x4a')]['id'];}return db[_0xe9be('0x2c')][_0xe9be('0x4e')]({'where':{'id':_0x44323e[_0xe9be('0x48')]['id']}})[_0xe9be('0x22')](handleEntityNotFound(_0x4ccb56,null))[_0xe9be('0x22')](function(_0x1f78c7){if(_0x1f78c7){_0x44323e[_0xe9be('0x4a')][_0xe9be('0x71')]=_0x1f78c7['id'];_0x44323e[_0xe9be('0x4a')][_0xe9be('0x59')]=widgetAttributes(_0x44323e[_0xe9be('0x4a')]);return db[_0xe9be('0x72')][_0xe9be('0x49')](_0x44323e[_0xe9be('0x4a')]);}})[_0xe9be('0x22')](respondWithResult(_0x4ccb56,null))[_0xe9be('0x47')](handleError(_0x4ccb56,null));};exports['getItems']=function(_0x57de1e,_0xdaec76,_0x1cc0bc){var _0x4eedd1={};var _0x176682={};var _0x31f6c7;var _0x2b2f78;return db[_0xe9be('0x2c')][_0xe9be('0x73')]({'where':{'id':_0x57de1e[_0xe9be('0x48')]['id']}})[_0xe9be('0x22')](handleEntityNotFound(_0xdaec76,null))[_0xe9be('0x22')](function(_0x3ee148){if(_0x3ee148){_0x31f6c7=_0x3ee148;_0x176682['model']=_['keys'](db[_0xe9be('0x72')][_0xe9be('0x74')]);_0x176682[_0xe9be('0x2f')]=_[_0xe9be('0x2e')](_0x57de1e[_0xe9be('0x2f')]);_0x176682[_0xe9be('0x30')]=_[_0xe9be('0x32')](_0x176682['model'],_0x176682[_0xe9be('0x2f')]);_0x4eedd1[_0xe9be('0x31')]=_[_0xe9be('0x32')](_0x176682['model'],qs[_0xe9be('0x33')](_0x57de1e['query']['fields']));_0x4eedd1[_0xe9be('0x31')]=_0x4eedd1[_0xe9be('0x31')]['length']?_0x4eedd1[_0xe9be('0x31')]:_0x176682[_0xe9be('0x2d')];_0x4eedd1[_0xe9be('0x37')]=qs[_0xe9be('0x38')](_0x57de1e[_0xe9be('0x2f')][_0xe9be('0x38')]);_0x4eedd1[_0xe9be('0x3b')]=qs[_0xe9be('0x30')](_['pick'](_0x57de1e[_0xe9be('0x2f')],_0x176682[_0xe9be('0x30')]));if(_0x57de1e[_0xe9be('0x2f')][_0xe9be('0x3a')]){_0x4eedd1[_0xe9be('0x3b')]=_[_0xe9be('0x3c')](_0x4eedd1['where'],{'$or':_[_0xe9be('0x3d')](_0x4eedd1[_0xe9be('0x31')],function(_0x38f002){var _0x2ddd7f={};_0x2ddd7f[_0x38f002]={'$like':'%'+_0x57de1e['query']['filter']+'%'};return _0x2ddd7f;})});}_0x4eedd1=_['merge']({},_0x4eedd1,_0x57de1e[_0xe9be('0x42')]);return _0x31f6c7[_0xe9be('0x75')](_0x4eedd1);}})[_0xe9be('0x22')](function(_0x36c327){if(_0x36c327){_0x2b2f78=_0x36c327[_0xe9be('0x34')];if(!_0x57de1e[_0xe9be('0x2f')][_0xe9be('0x35')](_0xe9be('0x36'))){_0x4eedd1[_0xe9be('0x1b')]=qs[_0xe9be('0x1b')](_0x57de1e[_0xe9be('0x2f')][_0xe9be('0x1b')]);_0x4eedd1[_0xe9be('0x1a')]=qs[_0xe9be('0x1a')](_0x57de1e['query'][_0xe9be('0x1a')]);}return _0x31f6c7[_0xe9be('0x75')](_0x4eedd1);}})['then'](function(_0x22c046){if(_0x22c046){return _0x22c046?{'count':_0x2b2f78,'rows':_0x22c046}:null;}})['then'](respondWithResult(_0xdaec76,null))[_0xe9be('0x47')](handleError(_0xdaec76,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index c21af3e..0f458a3 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 _0x700c=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','Dashboard','setMaxListeners','save','update'];(function(_0x242a4f,_0x369c57){var _0x122117=function(_0x55a797){while(--_0x55a797){_0x242a4f['push'](_0x242a4f['shift']());}};_0x122117(++_0x369c57);}(_0x700c,0x127));var _0xc700=function(_0x11f404,_0x434321){_0x11f404=_0x11f404-0x0;var _0x493d6a=_0x700c[_0x11f404];return _0x493d6a;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xc700('0x0'))['db'][_0xc700('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xc700('0x2')](0x0);var events={'afterCreate':_0xc700('0x3'),'afterUpdate':_0xc700('0x4'),'afterDestroy':_0xc700('0x5')};function emitEvent(_0x31fc1d){return function(_0x35d8ed,_0x50fe7c,_0x508aba){DashboardEvents[_0xc700('0x6')](_0x31fc1d+':'+_0x35d8ed['id'],_0x35d8ed);DashboardEvents['emit'](_0x31fc1d,_0x35d8ed);_0x508aba(null);};}for(var e in events){if(events[_0xc700('0x7')](e)){var event=events[e];Dashboard[_0xc700('0x8')](e,emitEvent(event));}}module[_0xc700('0x9')]=DashboardEvents; \ No newline at end of file +var _0x631c=['setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x42cc89,_0x54b2ce){var _0x17b410=function(_0x970f91){while(--_0x970f91){_0x42cc89['push'](_0x42cc89['shift']());}};_0x17b410(++_0x54b2ce);}(_0x631c,0x1b6));var _0xc631=function(_0xf1ff0c,_0x2a768e){_0xf1ff0c=_0xf1ff0c-0x0;var _0x27bf5f=_0x631c[_0xf1ff0c];return _0x27bf5f;};'use strict';var EventEmitter=require(_0xc631('0x0'));var Dashboard=require(_0xc631('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xc631('0x2')](0x0);var events={'afterCreate':_0xc631('0x3'),'afterUpdate':'update','afterDestroy':_0xc631('0x4')};function emitEvent(_0x854d5b){return function(_0x128401,_0x4e8b9f,_0x17dc11){DashboardEvents[_0xc631('0x5')](_0x854d5b+':'+_0x128401['id'],_0x128401);DashboardEvents['emit'](_0x854d5b,_0x128401);_0x17dc11(null);};}for(var e in events){if(events[_0xc631('0x6')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xc631('0x7')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index eedf1fd..3db9892 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 _0x2d97=['./dashboard.attributes','exports','define','Dashboard','dashboards','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x40a2a2,_0x4f3c20){var _0x2314e5=function(_0x171d9d){while(--_0x171d9d){_0x40a2a2['push'](_0x40a2a2['shift']());}};_0x2314e5(++_0x4f3c20);}(_0x2d97,0x1f1));var _0x72d9=function(_0x24c0db,_0x25e2ce){_0x24c0db=_0x24c0db-0x0;var _0x1441bf=_0x2d97[_0x24c0db];return _0x1441bf;};'use strict';var _=require('lodash');var util=require(_0x72d9('0x0'));var logger=require('../../config/logger')(_0x72d9('0x1'));var moment=require(_0x72d9('0x2'));var BPromise=require('bluebird');var rp=require(_0x72d9('0x3'));var fs=require('fs');var path=require(_0x72d9('0x4'));var rimraf=require(_0x72d9('0x5'));var config=require(_0x72d9('0x6'));var attributes=require(_0x72d9('0x7'));module[_0x72d9('0x8')]=function(_0x559a61,_0x449366){return _0x559a61[_0x72d9('0x9')](_0x72d9('0xa'),attributes,{'tableName':_0x72d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x562d=['path','../../config/environment','define','Dashboard','dashboards','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x12e6f8,_0x328296){var _0x255897=function(_0x1d2f4c){while(--_0x1d2f4c){_0x12e6f8['push'](_0x12e6f8['shift']());}};_0x255897(++_0x328296);}(_0x562d,0xe1));var _0xd562=function(_0x2955f8,_0x416f01){_0x2955f8=_0x2955f8-0x0;var _0x433e82=_0x562d[_0x2955f8];return _0x433e82;};'use strict';var _=require(_0xd562('0x0'));var util=require(_0xd562('0x1'));var logger=require(_0xd562('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd562('0x3'));var rp=require(_0xd562('0x4'));var fs=require('fs');var path=require(_0xd562('0x5'));var rimraf=require('rimraf');var config=require(_0xd562('0x6'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x1d05e9,_0x46bf9b){return _0x1d05e9[_0xd562('0x7')](_0xd562('0x8'),attributes,{'tableName':_0xd562('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index f198416..05dbf27 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 _0xc060=['redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x29c8c4,_0x2cdf25){var _0xf11b18=function(_0x2e7fea){while(--_0x2e7fea){_0x29c8c4['push'](_0x29c8c4['shift']());}};_0xf11b18(++_0x2cdf25);}(_0xc060,0x12f));var _0x0c06=function(_0x176bb2,_0x34414f){_0x176bb2=_0x176bb2-0x0;var _0x836649=_0xc060[_0x176bb2];return _0x836649;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0c06('0x0'));var BPromise=require(_0x0c06('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c06('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c06('0x3'));var logger=require(_0x0c06('0x4'))(_0x0c06('0x5'));var config=require(_0x0c06('0x6'));var jayson=require(_0x0c06('0x7'));var client=jayson['client'][_0x0c06('0x8')]({'port':0x232a});config[_0x0c06('0x9')]=_[_0x0c06('0xa')](config[_0x0c06('0x9')],{'host':_0x0c06('0xb'),'port':0x18eb});var socket=require(_0x0c06('0xc'))(new Redis(config[_0x0c06('0x9')]));require(_0x0c06('0xd'))[_0x0c06('0xe')](socket);function respondWithRpcPromise(_0x590987,_0x2a4725,_0x535f2d){return new BPromise(function(_0x506870,_0x23abb2){return client[_0x0c06('0xf')](_0x590987,_0x535f2d)['then'](function(_0x143e83){logger[_0x0c06('0x10')](_0x0c06('0x11'),_0x2a4725,_0x0c06('0x12'));logger[_0x0c06('0x13')](_0x0c06('0x14'),_0x2a4725,'request\x20sent',JSON['stringify'](_0x143e83));if(_0x143e83[_0x0c06('0x15')]){if(_0x143e83[_0x0c06('0x15')][_0x0c06('0x16')]===0x1f4){logger[_0x0c06('0x15')](_0x0c06('0x11'),_0x2a4725,_0x143e83['error']['message']);return _0x23abb2(_0x143e83['error'][_0x0c06('0x17')]);}logger[_0x0c06('0x15')](_0x0c06('0x11'),_0x2a4725,_0x143e83[_0x0c06('0x15')][_0x0c06('0x17')]);return _0x506870(_0x143e83[_0x0c06('0x15')][_0x0c06('0x17')]);}else{logger[_0x0c06('0x10')]('Dashboard,\x20%s,\x20%s',_0x2a4725,_0x0c06('0x12'));_0x506870(_0x143e83[_0x0c06('0x18')][_0x0c06('0x17')]);}})[_0x0c06('0x19')](function(_0x22f4c4){logger['error']('Dashboard,\x20%s,\x20%s',_0x2a4725,_0x22f4c4);_0x23abb2(_0x22f4c4);});});} \ No newline at end of file +var _0x3144=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','register','request','info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment'];(function(_0x408b34,_0xb7d872){var _0x1182aa=function(_0x1825c4){while(--_0x1825c4){_0x408b34['push'](_0x408b34['shift']());}};_0x1182aa(++_0xb7d872);}(_0x3144,0x16a));var _0x4314=function(_0x1d6d70,_0x5c45d1){_0x1d6d70=_0x1d6d70-0x0;var _0x1b4d36=_0x3144[_0x1d6d70];return _0x1b4d36;};'use strict';var _=require('lodash');var util=require(_0x4314('0x0'));var moment=require(_0x4314('0x1'));var BPromise=require(_0x4314('0x2'));var rs=require(_0x4314('0x3'));var fs=require('fs');var Redis=require(_0x4314('0x4'));var db=require(_0x4314('0x5'))['db'];var utils=require(_0x4314('0x6'));var logger=require(_0x4314('0x7'))(_0x4314('0x8'));var config=require('../../config/environment');var jayson=require(_0x4314('0x9'));var client=jayson['client'][_0x4314('0xa')]({'port':0x232a});config[_0x4314('0xb')]=_[_0x4314('0xc')](config['redis'],{'host':_0x4314('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4314('0xb')]));require('./dashboard.socket')[_0x4314('0xe')](socket);function respondWithRpcPromise(_0xb1ff11,_0x308311,_0x4e5017){return new BPromise(function(_0x27d61c,_0x98ebb1){return client[_0x4314('0xf')](_0xb1ff11,_0x4e5017)['then'](function(_0x20eb6a){logger[_0x4314('0x10')](_0x4314('0x11'),_0x308311,'request\x20sent');logger[_0x4314('0x12')](_0x4314('0x13'),_0x308311,_0x4314('0x14'),JSON['stringify'](_0x20eb6a));if(_0x20eb6a[_0x4314('0x15')]){if(_0x20eb6a[_0x4314('0x15')][_0x4314('0x16')]===0x1f4){logger[_0x4314('0x15')](_0x4314('0x11'),_0x308311,_0x20eb6a[_0x4314('0x15')]['message']);return _0x98ebb1(_0x20eb6a['error'][_0x4314('0x17')]);}logger[_0x4314('0x15')](_0x4314('0x11'),_0x308311,_0x20eb6a[_0x4314('0x15')][_0x4314('0x17')]);return _0x27d61c(_0x20eb6a[_0x4314('0x15')]['message']);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x308311,_0x4314('0x14'));_0x27d61c(_0x20eb6a[_0x4314('0x18')][_0x4314('0x17')]);}})[_0x4314('0x19')](function(_0x4837b8){logger[_0x4314('0x15')](_0x4314('0x11'),_0x308311,_0x4837b8);_0x98ebb1(_0x4837b8);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index b349fee..1da7588 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 _0x10db=['register','length','dashboard:','./dashboard.events','save','update','emit','removeListener'];(function(_0x326c48,_0x31eee6){var _0xf71bc5=function(_0x391b95){while(--_0x391b95){_0x326c48['push'](_0x326c48['shift']());}};_0xf71bc5(++_0x31eee6);}(_0x10db,0x83));var _0xb10d=function(_0x49b259,_0x9c34eb){_0x49b259=_0x49b259-0x0;var _0x3f6b87=_0x10db[_0x49b259];return _0x3f6b87;};'use strict';var DashboardEvents=require(_0xb10d('0x0'));var events=[_0xb10d('0x1'),'remove',_0xb10d('0x2')];function createListener(_0x58ff7c,_0x47e041){return function(_0x3d3a8d){_0x47e041[_0xb10d('0x3')](_0x58ff7c,_0x3d3a8d);};}function removeListener(_0xe9e191,_0x53492e){return function(){DashboardEvents[_0xb10d('0x4')](_0xe9e191,_0x53492e);};}exports[_0xb10d('0x5')]=function(_0x3a38f2){for(var _0x61fca3=0x0,_0x47de1e=events[_0xb10d('0x6')];_0x61fca3<_0x47de1e;_0x61fca3++){var _0x195a00=events[_0x61fca3];var _0x301b0f=createListener(_0xb10d('0x7')+_0x195a00,_0x3a38f2);DashboardEvents['on'](_0x195a00,_0x301b0f);}}; \ No newline at end of file +var _0xa0e8=['dashboard:','./dashboard.events','save','remove','update','emit','removeListener','register','length'];(function(_0x2e844e,_0x2879d2){var _0x1fe97f=function(_0x615a11){while(--_0x615a11){_0x2e844e['push'](_0x2e844e['shift']());}};_0x1fe97f(++_0x2879d2);}(_0xa0e8,0x1ba));var _0x8a0e=function(_0x26d350,_0x28a857){_0x26d350=_0x26d350-0x0;var _0x2f9b67=_0xa0e8[_0x26d350];return _0x2f9b67;};'use strict';var DashboardEvents=require(_0x8a0e('0x0'));var events=[_0x8a0e('0x1'),_0x8a0e('0x2'),_0x8a0e('0x3')];function createListener(_0xe919c5,_0x2e3e89){return function(_0x1f61e7){_0x2e3e89[_0x8a0e('0x4')](_0xe919c5,_0x1f61e7);};}function removeListener(_0x4c44d5,_0x3a372f){return function(){DashboardEvents[_0x8a0e('0x5')](_0x4c44d5,_0x3a372f);};}exports[_0x8a0e('0x6')]=function(_0x2a21fd){for(var _0x18fa4c=0x0,_0x54efad=events[_0x8a0e('0x7')];_0x18fa4c<_0x54efad;_0x18fa4c++){var _0x30b083=events[_0x18fa4c];var _0x479d4c=createListener(_0x8a0e('0x8')+_0x30b083,_0x2a21fd);DashboardEvents['on'](_0x30b083,_0x479d4c);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 33b58d4..8c55aba 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 _0xbc14=['get','index','/:id','isAuthenticated','show','getItems','create','post','/:id/clone','/:id/items','addItem','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller'];(function(_0x237546,_0xa81b26){var _0x233e29=function(_0x728aa4){while(--_0x728aa4){_0x237546['push'](_0x237546['shift']());}};_0x233e29(++_0xa81b26);}(_0xbc14,0x1c6));var _0x4bc1=function(_0x1d3791,_0x51c613){_0x1d3791=_0x1d3791-0x0;var _0x40fbf5=_0xbc14[_0x1d3791];return _0x40fbf5;};'use strict';var multer=require(_0x4bc1('0x0'));var util=require('util');var path=require(_0x4bc1('0x1'));var timeout=require(_0x4bc1('0x2'));var express=require('express');var router=express[_0x4bc1('0x3')]();var auth=require(_0x4bc1('0x4'));var interaction=require(_0x4bc1('0x5'));var config=require(_0x4bc1('0x6'));var controller=require(_0x4bc1('0x7'));router[_0x4bc1('0x8')]('/',auth['isAuthenticated'](),controller[_0x4bc1('0x9')]);router['get'](_0x4bc1('0xa'),auth[_0x4bc1('0xb')](),controller[_0x4bc1('0xc')]);router[_0x4bc1('0x8')]('/:id/items',auth[_0x4bc1('0xb')](),controller[_0x4bc1('0xd')]);router['post']('/',auth[_0x4bc1('0xb')](),controller[_0x4bc1('0xe')]);router[_0x4bc1('0xf')](_0x4bc1('0x10'),auth['isAuthenticated'](),controller['clone']);router['post'](_0x4bc1('0x11'),auth['isAuthenticated'](),controller[_0x4bc1('0x12')]);router['put'](_0x4bc1('0xa'),auth[_0x4bc1('0xb')](),controller['update']);router[_0x4bc1('0x13')](_0x4bc1('0xa'),auth[_0x4bc1('0xb')](),controller[_0x4bc1('0x14')]);module[_0x4bc1('0x15')]=router; \ No newline at end of file +var _0x82f2=['post','create','/:id/clone','addItem','put','delete','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','index','get','/:id','isAuthenticated','show','/:id/items','getItems'];(function(_0x5cbf0e,_0x4cd140){var _0x1c76f8=function(_0xcc9be4){while(--_0xcc9be4){_0x5cbf0e['push'](_0x5cbf0e['shift']());}};_0x1c76f8(++_0x4cd140);}(_0x82f2,0x1ea));var _0x282f=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x82f2[_0x29d94e];return _0x106237;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x282f('0x0'));var timeout=require(_0x282f('0x1'));var express=require('express');var router=express[_0x282f('0x2')]();var auth=require(_0x282f('0x3'));var interaction=require(_0x282f('0x4'));var config=require(_0x282f('0x5'));var controller=require(_0x282f('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x282f('0x7')]);router[_0x282f('0x8')](_0x282f('0x9'),auth[_0x282f('0xa')](),controller[_0x282f('0xb')]);router['get'](_0x282f('0xc'),auth[_0x282f('0xa')](),controller[_0x282f('0xd')]);router[_0x282f('0xe')]('/',auth[_0x282f('0xa')](),controller[_0x282f('0xf')]);router[_0x282f('0xe')](_0x282f('0x10'),auth[_0x282f('0xa')](),controller['clone']);router[_0x282f('0xe')]('/:id/items',auth[_0x282f('0xa')](),controller[_0x282f('0x11')]);router[_0x282f('0x12')](_0x282f('0x9'),auth[_0x282f('0xa')](),controller['update']);router[_0x282f('0x13')](_0x282f('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x282f('0x14')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index c137be4..25f6751 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 _0x42c7=['exports','STRING','TEXT','long','getDataValue','attrs','setDataValue','stringify','INTEGER','#2196f3','squel','lodash'];(function(_0x824540,_0x23731e){var _0x52756d=function(_0x1ecaaf){while(--_0x1ecaaf){_0x824540['push'](_0x824540['shift']());}};_0x52756d(++_0x23731e);}(_0x42c7,0x14e));var _0x742c=function(_0x1a87d0,_0x55c67e){_0x1a87d0=_0x1a87d0-0x0;var _0x435978=_0x42c7[_0x1a87d0];return _0x435978;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x742c('0x0'));var _=require(_0x742c('0x1'));module[_0x742c('0x2')]={'title':{'type':Sequelize[_0x742c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x742c('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x742c('0x4')](_0x742c('0x5')),'get':function(){try{return JSON['parse'](this[_0x742c('0x6')](_0x742c('0x7')));}catch(_0x20f125){return[];}},'set':function(_0xaea7ee){try{this[_0x742c('0x8')](_0x742c('0x7'),JSON[_0x742c('0x9')](_0xaea7ee));}catch(_0x40a085){this[_0x742c('0x8')](_0x742c('0x7'),JSON[_0x742c('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0x742c('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x742c('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x742c('0xa')]},'col':{'type':Sequelize[_0x742c('0xa')]},'background':{'type':Sequelize[_0x742c('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x742c('0x3')],'allowNull':![],'defaultValue':_0x742c('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9ed5=['squel','lodash','STRING','long','parse','getDataValue','setDataValue','attrs','stringify','INTEGER','#ffffff','#2196f3','sequelize'];(function(_0x6d64ee,_0x325690){var _0x28d0d3=function(_0x489e5f){while(--_0x489e5f){_0x6d64ee['push'](_0x6d64ee['shift']());}};_0x28d0d3(++_0x325690);}(_0x9ed5,0xf6));var _0x59ed=function(_0x3e8270,_0x293590){_0x3e8270=_0x3e8270-0x0;var _0x1ccde9=_0x9ed5[_0x3e8270];return _0x1ccde9;};'use strict';var Sequelize=require(_0x59ed('0x0'));var squel=require(_0x59ed('0x1'));var _=require(_0x59ed('0x2'));module['exports']={'title':{'type':Sequelize[_0x59ed('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x59ed('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x59ed('0x4')),'get':function(){try{return JSON[_0x59ed('0x5')](this[_0x59ed('0x6')]('attrs'));}catch(_0x23f843){return[];}},'set':function(_0x81940f){try{this[_0x59ed('0x7')](_0x59ed('0x8'),JSON[_0x59ed('0x9')](_0x81940f));}catch(_0x4bbab8){this[_0x59ed('0x7')]('attrs',JSON[_0x59ed('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x59ed('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x59ed('0xa')]},'col':{'type':Sequelize[_0x59ed('0xa')]},'background':{'type':Sequelize[_0x59ed('0x3')],'allowNull':![],'defaultValue':_0x59ed('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x59ed('0x3')],'allowNull':![],'defaultValue':_0x59ed('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x59ed('0x3')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index bcf62e1..1028fe8 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 _0x5d8b=['sox','ejs','lodash','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','count','set','apply','save','update','then','destroy','error','stack','name','show','params','model','DashboardItem','query','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','type','iframe','attrUrl','attrs','value','custom','attrPath','clock','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','web-report','reportType','attrReport','attrRefresh','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path'];(function(_0x46a728,_0xcb3e1c){var _0xc7dca7=function(_0x5d29ff){while(--_0x5d29ff){_0x46a728['push'](_0x46a728['shift']());}};_0xc7dca7(++_0xcb3e1c);}(_0x5d8b,0x14c));var _0xb5d8=function(_0x1ade19,_0x494441){_0x1ade19=_0x1ade19-0x0;var _0x33bc11=_0x5d8b[_0x1ade19];return _0x33bc11;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb5d8('0x0'));var rimraf=require(_0xb5d8('0x1'));var zipdir=require(_0xb5d8('0x2'));var jsonpatch=require(_0xb5d8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb5d8('0x4'));var Mustache=require(_0xb5d8('0x5'));var util=require(_0xb5d8('0x6'));var path=require(_0xb5d8('0x7'));var sox=require(_0xb5d8('0x8'));var csv=require('to-csv');var ejs=require(_0xb5d8('0x9'));var fs=require('fs');var _=require(_0xb5d8('0xa'));var squel=require('squel');var crypto=require(_0xb5d8('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb5d8('0xc'));var querystring=require(_0xb5d8('0xd'));var Papa=require(_0xb5d8('0xe'));var Redis=require('ioredis');var authService=require(_0xb5d8('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb5d8('0x10'));var logger=require('../../config/logger')(_0xb5d8('0x11'));var utils=require(_0xb5d8('0x12'));var config=require(_0xb5d8('0x13'));var db=require(_0xb5d8('0x14'))['db'];config[_0xb5d8('0x15')]=_['defaults'](config[_0xb5d8('0x15')],{'host':_0xb5d8('0x16'),'port':0x18eb});var socket=require(_0xb5d8('0x17'))(new Redis(config[_0xb5d8('0x15')]));require(_0xb5d8('0x18'))[_0xb5d8('0x19')](socket);function respondWithStatusCode(_0x417cc2,_0x3bc3b4){_0x3bc3b4=_0x3bc3b4||0xcc;return function(_0x193f12){if(_0x193f12){return _0x417cc2[_0xb5d8('0x1a')](_0x3bc3b4);}return _0x417cc2[_0xb5d8('0x1b')](_0x3bc3b4)[_0xb5d8('0x1c')]();};}function respondWithResult(_0x5d85d0,_0xf711d){_0xf711d=_0xf711d||0xc8;return function(_0x7dea9e){if(_0x7dea9e){return _0x5d85d0[_0xb5d8('0x1b')](_0xf711d)[_0xb5d8('0x1d')](_0x7dea9e);}};}function respondWithFilteredResult(_0xb9a45d,_0x4f4dc9){return function(_0x4be9c0){if(_0x4be9c0){var _0x202f04=_0x4be9c0[_0xb5d8('0x1e')],_0x136e4c=_0x4f4dc9['offset'],_0x168113=_0x4f4dc9['offset']+_0x4f4dc9['limit'],_0x15fa42;if(_0x168113>=_0x202f04){_0x168113=_0x202f04;_0x15fa42=0xc8;}else{_0x15fa42=0xce;}_0xb9a45d[_0xb5d8('0x1b')](_0x15fa42);return _0xb9a45d[_0xb5d8('0x1f')]('Content-Range',_0x136e4c+'-'+_0x168113+'/'+_0x202f04)['json'](_0x4be9c0);}return null;};}function patchUpdates(_0x40db64){return function(_0x20ab9b){try{jsonpatch[_0xb5d8('0x20')](_0x20ab9b,_0x40db64,!![]);}catch(_0xbdc064){return BPromise['reject'](_0xbdc064);}return _0x20ab9b[_0xb5d8('0x21')]();};}function saveUpdates(_0x168e78,_0x545c17){return function(_0x2c7d24){if(_0x2c7d24){return _0x2c7d24[_0xb5d8('0x22')](_0x168e78)[_0xb5d8('0x23')](function(_0x3f001f){return _0x3f001f;});}return null;};}function removeEntity(_0xf27892,_0x5a37a7){return function(_0x3a46ab){if(_0x3a46ab){return _0x3a46ab[_0xb5d8('0x24')]()[_0xb5d8('0x23')](function(){_0xf27892[_0xb5d8('0x1b')](0xcc)[_0xb5d8('0x1c')]();});}};}function handleEntityNotFound(_0x6cc48a,_0xc184c1){return function(_0xd78d46){if(!_0xd78d46){_0x6cc48a['sendStatus'](0x194);}return _0xd78d46;};}function handleError(_0x51d22b,_0x4974b5){_0x4974b5=_0x4974b5||0x1f4;return function(_0xa86a93){logger[_0xb5d8('0x25')](_0xa86a93[_0xb5d8('0x26')]);if(_0xa86a93[_0xb5d8('0x27')]){delete _0xa86a93[_0xb5d8('0x27')];}_0x51d22b[_0xb5d8('0x1b')](_0x4974b5)['send'](_0xa86a93);};}exports[_0xb5d8('0x28')]=function(_0x7831d,_0x48d7b1){var _0x326664={'raw':![],'where':{'id':_0x7831d[_0xb5d8('0x29')]['id']}},_0xedad07={};_0xedad07[_0xb5d8('0x2a')]=_['keys'](db[_0xb5d8('0x2b')]['rawAttributes']);_0xedad07[_0xb5d8('0x2c')]=_[_0xb5d8('0x2d')](_0x7831d[_0xb5d8('0x2c')]);_0xedad07[_0xb5d8('0x2e')]=_[_0xb5d8('0x2f')](_0xedad07[_0xb5d8('0x2a')],_0xedad07[_0xb5d8('0x2c')]);_0x326664[_0xb5d8('0x30')]=_[_0xb5d8('0x2f')](_0xedad07[_0xb5d8('0x2a')],qs[_0xb5d8('0x31')](_0x7831d[_0xb5d8('0x2c')][_0xb5d8('0x31')]));_0x326664[_0xb5d8('0x30')]=_0x326664[_0xb5d8('0x30')][_0xb5d8('0x32')]?_0x326664[_0xb5d8('0x30')]:_0xedad07[_0xb5d8('0x2a')];if(_0x7831d[_0xb5d8('0x2c')][_0xb5d8('0x33')]){_0x326664[_0xb5d8('0x34')]=[{'all':!![]}];}_0x326664=_[_0xb5d8('0x35')]({},_0x326664,_0x7831d[_0xb5d8('0x36')]);return db[_0xb5d8('0x2b')][_0xb5d8('0x37')](_0x326664)['then'](handleEntityNotFound(_0x48d7b1,null))[_0xb5d8('0x23')](respondWithResult(_0x48d7b1,null))[_0xb5d8('0x38')](handleError(_0x48d7b1,null));};exports[_0xb5d8('0x24')]=function(_0x1cb89e,_0x214b2b){return db[_0xb5d8('0x2b')][_0xb5d8('0x37')]({'where':{'id':_0x1cb89e[_0xb5d8('0x29')]['id']}})[_0xb5d8('0x23')](handleEntityNotFound(_0x214b2b,null))[_0xb5d8('0x23')](removeEntity(_0x214b2b,null))[_0xb5d8('0x38')](handleError(_0x214b2b,null));};function widgetAttributes(_0x44d623){try{switch(_0x44d623[_0xb5d8('0x39')]){case _0xb5d8('0x3a'):return[{'name':_0xb5d8('0x3b'),'value':_0x44d623[_0xb5d8('0x3b')]||(_0x44d623[_0xb5d8('0x3c')]&&_0x44d623[_0xb5d8('0x3c')][0x0]?_0x44d623[_0xb5d8('0x3c')][0x0][_0xb5d8('0x3d')]:undefined)||'https://'}];case _0xb5d8('0x3e'):return[{'name':_0xb5d8('0x3f'),'value':_0x44d623[_0xb5d8('0x3f')]||(_0x44d623[_0xb5d8('0x3c')]&&_0x44d623[_0xb5d8('0x3c')][0x0]?_0x44d623[_0xb5d8('0x3c')][0x0]['value']:undefined)||''}];case _0xb5d8('0x40'):return[{'name':'attrHourFormat','value':_0x44d623['attrHourFormat']||(_0x44d623['attrs']&&_0x44d623[_0xb5d8('0x3c')][0x0]?_0x44d623['attrs'][0x0]['value']:undefined)||_0xb5d8('0x41')},{'name':_0xb5d8('0x42'),'value':_0x44d623[_0xb5d8('0x42')]||(_0x44d623[_0xb5d8('0x3c')]&&_0x44d623['attrs'][0x1]?_0x44d623['attrs'][0x1][_0xb5d8('0x3d')]:undefined)||_0xb5d8('0x43')},{'name':_0xb5d8('0x44'),'value':_0x44d623[_0xb5d8('0x44')]||(_0x44d623[_0xb5d8('0x3c')]&&_0x44d623['attrs'][0x2]?_0x44d623['attrs'][0x2][_0xb5d8('0x3d')]:undefined)||0xc}];case _0xb5d8('0x45'):return[{'name':_0xb5d8('0x46'),'value':_0x44d623[_0xb5d8('0x46')]||(_0x44d623[_0xb5d8('0x3c')]&&_0x44d623[_0xb5d8('0x3c')][0x0]?_0x44d623[_0xb5d8('0x3c')][0x0][_0xb5d8('0x3d')]:undefined)||_0xb5d8('0x47')},{'name':'attrVoiceQueues','value':_0x44d623['attrVoiceQueues']||(_0x44d623[_0xb5d8('0x3c')]&&_0x44d623[_0xb5d8('0x3c')][0x1]?_0x44d623[_0xb5d8('0x3c')][0x1][_0xb5d8('0x3d')]:undefined)||[]},{'name':'attrFontSize','value':_0x44d623[_0xb5d8('0x44')]||(_0x44d623['attrs']&&_0x44d623[_0xb5d8('0x3c')][0x2]?_0x44d623['attrs'][0x2][_0xb5d8('0x3d')]:undefined)||0x14}];case _0xb5d8('0x48'):case _0xb5d8('0x49'):return[{'name':'attrSerie1','value':_0x44d623[_0xb5d8('0x4a')]||(_0x44d623[_0xb5d8('0x3c')]&&_0x44d623[_0xb5d8('0x3c')][0x0]?_0x44d623[_0xb5d8('0x3c')][0x0][_0xb5d8('0x3d')]:undefined)||'total'},{'name':'attrSerie2','value':_0x44d623[_0xb5d8('0x4b')]||(_0x44d623[_0xb5d8('0x3c')]&&_0x44d623[_0xb5d8('0x3c')][0x1]?_0x44d623[_0xb5d8('0x3c')][0x1][_0xb5d8('0x3d')]:undefined)||null},{'name':'attrSerie3','value':_0x44d623[_0xb5d8('0x4c')]||(_0x44d623[_0xb5d8('0x3c')]&&_0x44d623['attrs'][0x2]?_0x44d623[_0xb5d8('0x3c')][0x2]['value']:undefined)||null},{'name':_0xb5d8('0x4d'),'value':_0x44d623[_0xb5d8('0x4d')]||(_0x44d623[_0xb5d8('0x3c')]&&_0x44d623[_0xb5d8('0x3c')][0x3]?_0x44d623[_0xb5d8('0x3c')][0x3][_0xb5d8('0x3d')]:undefined)||[]}];case _0xb5d8('0x4e'):return[{'name':'attrReport','type':_0x44d623[_0xb5d8('0x4f')]||(_0x44d623[_0xb5d8('0x3c')]&&_0x44d623[_0xb5d8('0x3c')][0x0]?_0x44d623[_0xb5d8('0x3c')][0x0][_0xb5d8('0x39')]:undefined)||null,'value':_0x44d623[_0xb5d8('0x50')]||(_0x44d623[_0xb5d8('0x3c')]&&_0x44d623[_0xb5d8('0x3c')][0x0]?_0x44d623[_0xb5d8('0x3c')][0x0][_0xb5d8('0x3d')]:undefined)||null},{'name':_0xb5d8('0x51'),'value':_0x44d623[_0xb5d8('0x51')]||(_0x44d623['attrs']&&_0x44d623['attrs'][0x1]?_0x44d623[_0xb5d8('0x3c')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x1f6024){logger['error']('widgetAttributes:\x20%s',JSON[_0xb5d8('0x52')](_0x1f6024));return[];}}exports[_0xb5d8('0x53')]=function(_0x76ee18,_0x392c27){if(_0x76ee18['body']){_0x76ee18[_0xb5d8('0x54')][_0xb5d8('0x3c')]=widgetAttributes(_0x76ee18[_0xb5d8('0x54')]);}return db[_0xb5d8('0x2b')][_0xb5d8('0x53')](_0x76ee18['body'],{})[_0xb5d8('0x23')](respondWithResult(_0x392c27,0xc9))['catch'](handleError(_0x392c27,null));};exports[_0xb5d8('0x22')]=function(_0x5c88ff,_0x481be0){if(_0x5c88ff['body']['id']){delete _0x5c88ff[_0xb5d8('0x54')]['id'];}_0x5c88ff[_0xb5d8('0x54')][_0xb5d8('0x3c')]=widgetAttributes(_0x5c88ff['body']);return db['DashboardItem']['find']({'where':{'id':_0x5c88ff['params']['id']}})[_0xb5d8('0x23')](handleEntityNotFound(_0x481be0,null))[_0xb5d8('0x23')](saveUpdates(_0x5c88ff[_0xb5d8('0x54')],null))[_0xb5d8('0x23')](respondWithResult(_0x481be0,null))['catch'](handleError(_0x481be0,null));}; \ No newline at end of file +var _0xd221=['util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','status','end','json','count','set','Content-Range','apply','reject','update','then','sendStatus','error','name','send','show','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','DashboardItem','find','destroy','params','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','catch','eml-format','fast-json-patch','request-promise','moment','mustache'];(function(_0x3823ff,_0x3635bf){var _0x49653a=function(_0x2030a6){while(--_0x2030a6){_0x3823ff['push'](_0x3823ff['shift']());}};_0x49653a(++_0x3635bf);}(_0xd221,0xa7));var _0x1d22=function(_0x17ef1c,_0x1c1e1b){_0x17ef1c=_0x17ef1c-0x0;var _0x5a66d0=_0xd221[_0x17ef1c];return _0x5a66d0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1d22('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1d22('0x1'));var rp=require(_0x1d22('0x2'));var moment=require(_0x1d22('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1d22('0x4'));var util=require(_0x1d22('0x5'));var path=require('path');var sox=require(_0x1d22('0x6'));var csv=require(_0x1d22('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1d22('0x8'));var squel=require(_0x1d22('0x9'));var crypto=require(_0x1d22('0xa'));var jsforce=require(_0x1d22('0xb'));var deskjs=require(_0x1d22('0xc'));var toCsv=require(_0x1d22('0x7'));var querystring=require(_0x1d22('0xd'));var Papa=require('papaparse');var Redis=require(_0x1d22('0xe'));var authService=require(_0x1d22('0xf'));var qs=require(_0x1d22('0x10'));var hardwareService=require(_0x1d22('0x11'));var logger=require('../../config/logger')(_0x1d22('0x12'));var utils=require(_0x1d22('0x13'));var config=require('../../config/environment');var db=require(_0x1d22('0x14'))['db'];config[_0x1d22('0x15')]=_[_0x1d22('0x16')](config[_0x1d22('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x1d22('0x17'))(new Redis(config[_0x1d22('0x15')]));require(_0x1d22('0x18'))[_0x1d22('0x19')](socket);function respondWithStatusCode(_0x448efd,_0x222b63){_0x222b63=_0x222b63||0xcc;return function(_0x576fe1){if(_0x576fe1){return _0x448efd['sendStatus'](_0x222b63);}return _0x448efd[_0x1d22('0x1a')](_0x222b63)[_0x1d22('0x1b')]();};}function respondWithResult(_0x19b930,_0x47081f){_0x47081f=_0x47081f||0xc8;return function(_0x5714a4){if(_0x5714a4){return _0x19b930[_0x1d22('0x1a')](_0x47081f)[_0x1d22('0x1c')](_0x5714a4);}};}function respondWithFilteredResult(_0xb9c728,_0x43ecde){return function(_0x2f21ab){if(_0x2f21ab){var _0x4aa210=_0x2f21ab[_0x1d22('0x1d')],_0x4f0de5=_0x43ecde['offset'],_0x6a5b6f=_0x43ecde['offset']+_0x43ecde['limit'],_0x1772ab;if(_0x6a5b6f>=_0x4aa210){_0x6a5b6f=_0x4aa210;_0x1772ab=0xc8;}else{_0x1772ab=0xce;}_0xb9c728[_0x1d22('0x1a')](_0x1772ab);return _0xb9c728[_0x1d22('0x1e')](_0x1d22('0x1f'),_0x4f0de5+'-'+_0x6a5b6f+'/'+_0x4aa210)[_0x1d22('0x1c')](_0x2f21ab);}return null;};}function patchUpdates(_0x40c830){return function(_0x1bc6c2){try{jsonpatch[_0x1d22('0x20')](_0x1bc6c2,_0x40c830,!![]);}catch(_0xd5e971){return BPromise[_0x1d22('0x21')](_0xd5e971);}return _0x1bc6c2['save']();};}function saveUpdates(_0x1bd4e2,_0x35e933){return function(_0xddbde0){if(_0xddbde0){return _0xddbde0[_0x1d22('0x22')](_0x1bd4e2)[_0x1d22('0x23')](function(_0x42aed1){return _0x42aed1;});}return null;};}function removeEntity(_0x5c7d3c,_0x5845cc){return function(_0x30b5f3){if(_0x30b5f3){return _0x30b5f3['destroy']()['then'](function(){_0x5c7d3c[_0x1d22('0x1a')](0xcc)[_0x1d22('0x1b')]();});}};}function handleEntityNotFound(_0x2c6fb5,_0x476351){return function(_0x43ae8f){if(!_0x43ae8f){_0x2c6fb5[_0x1d22('0x24')](0x194);}return _0x43ae8f;};}function handleError(_0x59e1b9,_0x5a9f8b){_0x5a9f8b=_0x5a9f8b||0x1f4;return function(_0x4efef5){logger[_0x1d22('0x25')](_0x4efef5['stack']);if(_0x4efef5[_0x1d22('0x26')]){delete _0x4efef5[_0x1d22('0x26')];}_0x59e1b9[_0x1d22('0x1a')](_0x5a9f8b)[_0x1d22('0x27')](_0x4efef5);};}exports[_0x1d22('0x28')]=function(_0x116ee6,_0x22ef69){var _0x33b64b={'raw':![],'where':{'id':_0x116ee6['params']['id']}},_0x1de3fb={};_0x1de3fb[_0x1d22('0x29')]=_[_0x1d22('0x2a')](db['DashboardItem']['rawAttributes']);_0x1de3fb['query']=_[_0x1d22('0x2a')](_0x116ee6[_0x1d22('0x2b')]);_0x1de3fb[_0x1d22('0x2c')]=_[_0x1d22('0x2d')](_0x1de3fb[_0x1d22('0x29')],_0x1de3fb[_0x1d22('0x2b')]);_0x33b64b[_0x1d22('0x2e')]=_[_0x1d22('0x2d')](_0x1de3fb[_0x1d22('0x29')],qs[_0x1d22('0x2f')](_0x116ee6[_0x1d22('0x2b')]['fields']));_0x33b64b[_0x1d22('0x2e')]=_0x33b64b['attributes'][_0x1d22('0x30')]?_0x33b64b[_0x1d22('0x2e')]:_0x1de3fb[_0x1d22('0x29')];if(_0x116ee6['query'][_0x1d22('0x31')]){_0x33b64b[_0x1d22('0x32')]=[{'all':!![]}];}_0x33b64b=_['merge']({},_0x33b64b,_0x116ee6['options']);return db[_0x1d22('0x33')][_0x1d22('0x34')](_0x33b64b)['then'](handleEntityNotFound(_0x22ef69,null))[_0x1d22('0x23')](respondWithResult(_0x22ef69,null))['catch'](handleError(_0x22ef69,null));};exports[_0x1d22('0x35')]=function(_0x227ecb,_0x3f981e){return db[_0x1d22('0x33')][_0x1d22('0x34')]({'where':{'id':_0x227ecb[_0x1d22('0x36')]['id']}})[_0x1d22('0x23')](handleEntityNotFound(_0x3f981e,null))[_0x1d22('0x23')](removeEntity(_0x3f981e,null))['catch'](handleError(_0x3f981e,null));};function widgetAttributes(_0x35ef5b){try{switch(_0x35ef5b[_0x1d22('0x37')]){case _0x1d22('0x38'):return[{'name':_0x1d22('0x39'),'value':_0x35ef5b[_0x1d22('0x39')]||(_0x35ef5b[_0x1d22('0x3a')]&&_0x35ef5b[_0x1d22('0x3a')][0x0]?_0x35ef5b[_0x1d22('0x3a')][0x0][_0x1d22('0x3b')]:undefined)||_0x1d22('0x3c')}];case _0x1d22('0x3d'):return[{'name':_0x1d22('0x3e'),'value':_0x35ef5b[_0x1d22('0x3e')]||(_0x35ef5b[_0x1d22('0x3a')]&&_0x35ef5b[_0x1d22('0x3a')][0x0]?_0x35ef5b[_0x1d22('0x3a')][0x0][_0x1d22('0x3b')]:undefined)||''}];case _0x1d22('0x3f'):return[{'name':_0x1d22('0x40'),'value':_0x35ef5b['attrHourFormat']||(_0x35ef5b[_0x1d22('0x3a')]&&_0x35ef5b[_0x1d22('0x3a')][0x0]?_0x35ef5b['attrs'][0x0][_0x1d22('0x3b')]:undefined)||_0x1d22('0x41')},{'name':_0x1d22('0x42'),'value':_0x35ef5b['attrTimezone']||(_0x35ef5b[_0x1d22('0x3a')]&&_0x35ef5b[_0x1d22('0x3a')][0x1]?_0x35ef5b['attrs'][0x1][_0x1d22('0x3b')]:undefined)||_0x1d22('0x43')},{'name':_0x1d22('0x44'),'value':_0x35ef5b[_0x1d22('0x44')]||(_0x35ef5b[_0x1d22('0x3a')]&&_0x35ef5b[_0x1d22('0x3a')][0x2]?_0x35ef5b[_0x1d22('0x3a')][0x2][_0x1d22('0x3b')]:undefined)||0xc}];case _0x1d22('0x45'):return[{'name':'attrMetric','value':_0x35ef5b[_0x1d22('0x46')]||(_0x35ef5b[_0x1d22('0x3a')]&&_0x35ef5b[_0x1d22('0x3a')][0x0]?_0x35ef5b[_0x1d22('0x3a')][0x0][_0x1d22('0x3b')]:undefined)||_0x1d22('0x47')},{'name':_0x1d22('0x48'),'value':_0x35ef5b[_0x1d22('0x48')]||(_0x35ef5b['attrs']&&_0x35ef5b[_0x1d22('0x3a')][0x1]?_0x35ef5b[_0x1d22('0x3a')][0x1][_0x1d22('0x3b')]:undefined)||[]},{'name':_0x1d22('0x44'),'value':_0x35ef5b[_0x1d22('0x44')]||(_0x35ef5b['attrs']&&_0x35ef5b['attrs'][0x2]?_0x35ef5b[_0x1d22('0x3a')][0x2][_0x1d22('0x3b')]:undefined)||0x14}];case _0x1d22('0x49'):case _0x1d22('0x4a'):return[{'name':_0x1d22('0x4b'),'value':_0x35ef5b['attrSerie1']||(_0x35ef5b[_0x1d22('0x3a')]&&_0x35ef5b[_0x1d22('0x3a')][0x0]?_0x35ef5b[_0x1d22('0x3a')][0x0][_0x1d22('0x3b')]:undefined)||_0x1d22('0x47')},{'name':_0x1d22('0x4c'),'value':_0x35ef5b[_0x1d22('0x4c')]||(_0x35ef5b[_0x1d22('0x3a')]&&_0x35ef5b['attrs'][0x1]?_0x35ef5b[_0x1d22('0x3a')][0x1][_0x1d22('0x3b')]:undefined)||null},{'name':_0x1d22('0x4d'),'value':_0x35ef5b[_0x1d22('0x4d')]||(_0x35ef5b[_0x1d22('0x3a')]&&_0x35ef5b[_0x1d22('0x3a')][0x2]?_0x35ef5b[_0x1d22('0x3a')][0x2]['value']:undefined)||null},{'name':_0x1d22('0x48'),'value':_0x35ef5b[_0x1d22('0x48')]||(_0x35ef5b[_0x1d22('0x3a')]&&_0x35ef5b[_0x1d22('0x3a')][0x3]?_0x35ef5b[_0x1d22('0x3a')][0x3][_0x1d22('0x3b')]:undefined)||[]}];case'web-report':return[{'name':_0x1d22('0x4e'),'type':_0x35ef5b[_0x1d22('0x4f')]||(_0x35ef5b['attrs']&&_0x35ef5b[_0x1d22('0x3a')][0x0]?_0x35ef5b[_0x1d22('0x3a')][0x0][_0x1d22('0x37')]:undefined)||null,'value':_0x35ef5b[_0x1d22('0x4e')]||(_0x35ef5b[_0x1d22('0x3a')]&&_0x35ef5b['attrs'][0x0]?_0x35ef5b[_0x1d22('0x3a')][0x0][_0x1d22('0x3b')]:undefined)||null},{'name':_0x1d22('0x50'),'value':_0x35ef5b[_0x1d22('0x50')]||(_0x35ef5b[_0x1d22('0x3a')]&&_0x35ef5b[_0x1d22('0x3a')][0x1]?_0x35ef5b['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x3e91af){logger[_0x1d22('0x25')](_0x1d22('0x51'),JSON[_0x1d22('0x52')](_0x3e91af));return[];}}exports['create']=function(_0x502e0b,_0x4f88c5){if(_0x502e0b[_0x1d22('0x53')]){_0x502e0b[_0x1d22('0x53')][_0x1d22('0x3a')]=widgetAttributes(_0x502e0b[_0x1d22('0x53')]);}return db[_0x1d22('0x33')][_0x1d22('0x54')](_0x502e0b[_0x1d22('0x53')],{})[_0x1d22('0x23')](respondWithResult(_0x4f88c5,0xc9))['catch'](handleError(_0x4f88c5,null));};exports['update']=function(_0x354a4a,_0x47bc82){if(_0x354a4a['body']['id']){delete _0x354a4a[_0x1d22('0x53')]['id'];}_0x354a4a[_0x1d22('0x53')]['attrs']=widgetAttributes(_0x354a4a[_0x1d22('0x53')]);return db[_0x1d22('0x33')]['find']({'where':{'id':_0x354a4a[_0x1d22('0x36')]['id']}})[_0x1d22('0x23')](handleEntityNotFound(_0x47bc82,null))[_0x1d22('0x23')](saveUpdates(_0x354a4a[_0x1d22('0x53')],null))[_0x1d22('0x23')](respondWithResult(_0x47bc82,null))[_0x1d22('0x55')](handleError(_0x47bc82,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 3e73a88..1ea4c39 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 _0x6629=['hasOwnProperty','hook','events','setMaxListeners','save','update','remove','emit'];(function(_0x28e3cd,_0x5c1739){var _0x1920cb=function(_0x577a08){while(--_0x577a08){_0x28e3cd['push'](_0x28e3cd['shift']());}};_0x1920cb(++_0x5c1739);}(_0x6629,0x1c2));var _0x9662=function(_0x136eb8,_0x4306bb){_0x136eb8=_0x136eb8-0x0;var _0x91ae87=_0x6629[_0x136eb8];return _0x91ae87;};'use strict';var EventEmitter=require(_0x9662('0x0'));var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x9662('0x1')](0x0);var events={'afterCreate':_0x9662('0x2'),'afterUpdate':_0x9662('0x3'),'afterDestroy':_0x9662('0x4')};function emitEvent(_0x54979b){return function(_0x43f66a,_0x41ad57,_0x285f7e){DashboardItemEvents['emit'](_0x54979b+':'+_0x43f66a['id'],_0x43f66a);DashboardItemEvents[_0x9662('0x5')](_0x54979b,_0x43f66a);_0x285f7e(null);};}for(var e in events){if(events[_0x9662('0x6')](e)){var event=events[e];DashboardItem[_0x9662('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x87bc=['hook','events','../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x32a97f,_0x4ea4c8){var _0x4993c4=function(_0x72989c){while(--_0x72989c){_0x32a97f['push'](_0x32a97f['shift']());}};_0x4993c4(++_0x4ea4c8);}(_0x87bc,0x189));var _0xc87b=function(_0x40aaed,_0x10887b){_0x40aaed=_0x40aaed-0x0;var _0x51acdb=_0x87bc[_0x40aaed];return _0x51acdb;};'use strict';var EventEmitter=require(_0xc87b('0x0'));var DashboardItem=require(_0xc87b('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xc87b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc87b('0x3')};function emitEvent(_0x53758a){return function(_0x37a3a8,_0x4ac5a9,_0x580a0a){DashboardItemEvents['emit'](_0x53758a+':'+_0x37a3a8['id'],_0x37a3a8);DashboardItemEvents[_0xc87b('0x4')](_0x53758a,_0x37a3a8);_0x580a0a(null);};}for(var e in events){if(events[_0xc87b('0x5')](e)){var event=events[e];DashboardItem[_0xc87b('0x6')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 9b5f022..90b3c48 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 _0x3b8e=['dashboard_items','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x28419f,_0x4c48a7){var _0xafa7f=function(_0x3e0deb){while(--_0x3e0deb){_0x28419f['push'](_0x28419f['shift']());}};_0xafa7f(++_0x4c48a7);}(_0x3b8e,0x1eb));var _0xe3b8=function(_0x20fc70,_0x48338a){_0x20fc70=_0x20fc70-0x0;var _0x413347=_0x3b8e[_0x20fc70];return _0x413347;};'use strict';var _=require(_0xe3b8('0x0'));var util=require(_0xe3b8('0x1'));var logger=require(_0xe3b8('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe3b8('0x3'));var fs=require('fs');var path=require(_0xe3b8('0x4'));var rimraf=require(_0xe3b8('0x5'));var config=require(_0xe3b8('0x6'));var attributes=require('./dashboardItem.attributes');module[_0xe3b8('0x7')]=function(_0x1d119a,_0x257d8c){return _0x1d119a[_0xe3b8('0x8')]('DashboardItem',attributes,{'tableName':_0xe3b8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a34=['util','../../config/logger','api','moment','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','lodash'];(function(_0x5cc41f,_0xd5190e){var _0x2de0ea=function(_0x2064bb){while(--_0x2064bb){_0x5cc41f['push'](_0x5cc41f['shift']());}};_0x2de0ea(++_0xd5190e);}(_0x0a34,0x6d));var _0x40a3=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x0a34[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0x40a3('0x0'));var util=require(_0x40a3('0x1'));var logger=require(_0x40a3('0x2'))(_0x40a3('0x3'));var moment=require(_0x40a3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x40a3('0x5'));var config=require(_0x40a3('0x6'));var attributes=require(_0x40a3('0x7'));module[_0x40a3('0x8')]=function(_0x3e3c57,_0x27ee96){return _0x3e3c57[_0x40a3('0x9')](_0x40a3('0xa'),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 aaafd50..33bcd26 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 _0x4d00=['defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','error','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x4d00,0x1e0));var _0x04d0=function(_0xce5cc,_0x17dcf2){_0xce5cc=_0xce5cc-0x0;var _0x8fbee1=_0x4d00[_0xce5cc];return _0x8fbee1;};'use strict';var _=require(_0x04d0('0x0'));var util=require(_0x04d0('0x1'));var moment=require(_0x04d0('0x2'));var BPromise=require(_0x04d0('0x3'));var rs=require(_0x04d0('0x4'));var fs=require('fs');var Redis=require(_0x04d0('0x5'));var db=require(_0x04d0('0x6'))['db'];var utils=require(_0x04d0('0x7'));var logger=require(_0x04d0('0x8'))(_0x04d0('0x9'));var config=require(_0x04d0('0xa'));var jayson=require(_0x04d0('0xb'));var client=jayson[_0x04d0('0xc')]['http']({'port':0x232a});config['redis']=_[_0x04d0('0xd')](config[_0x04d0('0xe')],{'host':_0x04d0('0xf'),'port':0x18eb});var socket=require(_0x04d0('0x10'))(new Redis(config[_0x04d0('0xe')]));require(_0x04d0('0x11'))[_0x04d0('0x12')](socket);function respondWithRpcPromise(_0xc8a18d,_0x37c19b,_0x58fc3f){return new BPromise(function(_0x56443a,_0x439772){return client[_0x04d0('0x13')](_0xc8a18d,_0x58fc3f)[_0x04d0('0x14')](function(_0x3542d1){logger[_0x04d0('0x15')]('DashboardItem,\x20%s,\x20%s',_0x37c19b,_0x04d0('0x16'));logger['debug'](_0x04d0('0x17'),_0x37c19b,'request\x20sent',JSON['stringify'](_0x3542d1));if(_0x3542d1[_0x04d0('0x18')]){if(_0x3542d1[_0x04d0('0x18')]['code']===0x1f4){logger[_0x04d0('0x18')](_0x04d0('0x19'),_0x37c19b,_0x3542d1[_0x04d0('0x18')][_0x04d0('0x1a')]);return _0x439772(_0x3542d1[_0x04d0('0x18')][_0x04d0('0x1a')]);}logger[_0x04d0('0x18')](_0x04d0('0x19'),_0x37c19b,_0x3542d1[_0x04d0('0x18')]['message']);return _0x56443a(_0x3542d1[_0x04d0('0x18')][_0x04d0('0x1a')]);}else{logger[_0x04d0('0x15')](_0x04d0('0x19'),_0x37c19b,_0x04d0('0x16'));_0x56443a(_0x3542d1[_0x04d0('0x1b')][_0x04d0('0x1a')]);}})[_0x04d0('0x1c')](function(_0x143193){logger[_0x04d0('0x18')](_0x04d0('0x19'),_0x37c19b,_0x143193);_0x439772(_0x143193);});});} \ No newline at end of file +var _0x3afc=['DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then'];(function(_0x565dfa,_0x5ca74b){var _0x3d8102=function(_0x34276a){while(--_0x34276a){_0x565dfa['push'](_0x565dfa['shift']());}};_0x3d8102(++_0x5ca74b);}(_0x3afc,0x1cd));var _0xc3af=function(_0x3d8b55,_0x2d1f0c){_0x3d8b55=_0x3d8b55-0x0;var _0x2203a6=_0x3afc[_0x3d8b55];return _0x2203a6;};'use strict';var _=require(_0xc3af('0x0'));var util=require(_0xc3af('0x1'));var moment=require(_0xc3af('0x2'));var BPromise=require(_0xc3af('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3af('0x4'))['db'];var utils=require(_0xc3af('0x5'));var logger=require(_0xc3af('0x6'))(_0xc3af('0x7'));var config=require(_0xc3af('0x8'));var jayson=require(_0xc3af('0x9'));var client=jayson[_0xc3af('0xa')][_0xc3af('0xb')]({'port':0x232a});config[_0xc3af('0xc')]=_['defaults'](config[_0xc3af('0xc')],{'host':_0xc3af('0xd'),'port':0x18eb});var socket=require(_0xc3af('0xe'))(new Redis(config[_0xc3af('0xc')]));require(_0xc3af('0xf'))[_0xc3af('0x10')](socket);function respondWithRpcPromise(_0x252ee5,_0x63be9f,_0x2b2b4d){return new BPromise(function(_0x4dad85,_0x3eaf13){return client[_0xc3af('0x11')](_0x252ee5,_0x2b2b4d)[_0xc3af('0x12')](function(_0x1fec33){logger['info'](_0xc3af('0x13'),_0x63be9f,'request\x20sent');logger[_0xc3af('0x14')](_0xc3af('0x15'),_0x63be9f,_0xc3af('0x16'),JSON[_0xc3af('0x17')](_0x1fec33));if(_0x1fec33[_0xc3af('0x18')]){if(_0x1fec33[_0xc3af('0x18')][_0xc3af('0x19')]===0x1f4){logger['error'](_0xc3af('0x13'),_0x63be9f,_0x1fec33[_0xc3af('0x18')]['message']);return _0x3eaf13(_0x1fec33['error'][_0xc3af('0x1a')]);}logger[_0xc3af('0x18')](_0xc3af('0x13'),_0x63be9f,_0x1fec33['error'][_0xc3af('0x1a')]);return _0x4dad85(_0x1fec33[_0xc3af('0x18')]['message']);}else{logger[_0xc3af('0x1b')](_0xc3af('0x13'),_0x63be9f,_0xc3af('0x16'));_0x4dad85(_0x1fec33[_0xc3af('0x1c')][_0xc3af('0x1a')]);}})[_0xc3af('0x1d')](function(_0x2e7c43){logger[_0xc3af('0x18')]('DashboardItem,\x20%s,\x20%s',_0x63be9f,_0x2e7c43);_0x3eaf13(_0x2e7c43);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index da7832f..55194e2 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 _0x34e8=['register','length','dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0x34e8,0x12c));var _0x834e=function(_0x49c0e4,_0x16aebf){_0x49c0e4=_0x49c0e4-0x0;var _0x3cdbfc=_0x34e8[_0x49c0e4];return _0x3cdbfc;};'use strict';var DashboardItemEvents=require(_0x834e('0x0'));var events=[_0x834e('0x1'),_0x834e('0x2'),_0x834e('0x3')];function createListener(_0x530939,_0x832422){return function(_0x21e2e0){_0x832422[_0x834e('0x4')](_0x530939,_0x21e2e0);};}function removeListener(_0x31bf20,_0x289ef2){return function(){DashboardItemEvents[_0x834e('0x5')](_0x31bf20,_0x289ef2);};}exports[_0x834e('0x6')]=function(_0x4a2018){for(var _0x858aa1=0x0,_0x52056d=events[_0x834e('0x7')];_0x858aa1<_0x52056d;_0x858aa1++){var _0x3cc2e3=events[_0x858aa1];var _0x3a3ef6=createListener(_0x834e('0x8')+_0x3cc2e3,_0x4a2018);DashboardItemEvents['on'](_0x3cc2e3,_0x3a3ef6);}}; \ No newline at end of file +var _0x9957=['register','length','dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener'];(function(_0xae01dd,_0xbd8a3c){var _0x8c26df=function(_0x359827){while(--_0x359827){_0xae01dd['push'](_0xae01dd['shift']());}};_0x8c26df(++_0xbd8a3c);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var DashboardItemEvents=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(){DashboardItemEvents[_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);DashboardItemEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 6ace084..71b7a1d 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 _0x06dc=['get','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./dashboardItem.controller'];(function(_0x494a77,_0x208509){var _0x7f10d6=function(_0x1efaec){while(--_0x1efaec){_0x494a77['push'](_0x494a77['shift']());}};_0x7f10d6(++_0x208509);}(_0x06dc,0xd9));var _0xc06d=function(_0x9efe0,_0x1e7272){_0x9efe0=_0x9efe0-0x0;var _0x232a0f=_0x06dc[_0x9efe0];return _0x232a0f;};'use strict';var multer=require(_0xc06d('0x0'));var util=require(_0xc06d('0x1'));var path=require(_0xc06d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc06d('0x3')]();var auth=require(_0xc06d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc06d('0x5'));var controller=require(_0xc06d('0x6'));router[_0xc06d('0x7')](_0xc06d('0x8'),auth[_0xc06d('0x9')](),controller['show']);router[_0xc06d('0xa')]('/',auth[_0xc06d('0x9')](),controller['create']);router[_0xc06d('0xb')]('/:id',auth[_0xc06d('0x9')](),controller[_0xc06d('0xc')]);router[_0xc06d('0xd')]('/:id',auth[_0xc06d('0x9')](),controller[_0xc06d('0xe')]);module[_0xc06d('0xf')]=router; \ No newline at end of file +var _0x16d7=['isAuthenticated','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get'];(function(_0x34291e,_0x413c83){var _0x57edbd=function(_0x28c2e3){while(--_0x28c2e3){_0x34291e['push'](_0x34291e['shift']());}};_0x57edbd(++_0x413c83);}(_0x16d7,0x112));var _0x716d=function(_0x3b5030,_0x31187f){_0x3b5030=_0x3b5030-0x0;var _0x5e0c24=_0x16d7[_0x3b5030];return _0x5e0c24;};'use strict';var multer=require(_0x716d('0x0'));var util=require(_0x716d('0x1'));var path=require(_0x716d('0x2'));var timeout=require(_0x716d('0x3'));var express=require(_0x716d('0x4'));var router=express[_0x716d('0x5')]();var auth=require(_0x716d('0x6'));var interaction=require(_0x716d('0x7'));var config=require(_0x716d('0x8'));var controller=require(_0x716d('0x9'));router[_0x716d('0xa')]('/:id',auth[_0x716d('0xb')](),controller['show']);router[_0x716d('0xc')]('/',auth['isAuthenticated'](),controller[_0x716d('0xd')]);router[_0x716d('0xe')](_0x716d('0xf'),auth[_0x716d('0xb')](),controller[_0x716d('0x10')]);router[_0x716d('0x11')](_0x716d('0xf'),auth[_0x716d('0xb')](),controller[_0x716d('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 4e2cf9a..f62f526 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 _0x6a92=['sequelize'];(function(_0x437a8e,_0x2744c6){var _0x58e374=function(_0x2fa4d4){while(--_0x2fa4d4){_0x437a8e['push'](_0x437a8e['shift']());}};_0x58e374(++_0x2744c6);}(_0x6a92,0xf7));var _0x26a9=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x6a92[_0x25d386];return _0x857f4a;};'use strict';var Sequelize=require(_0x26a9('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xb7ea=['exports','STRING'];(function(_0x50d527,_0x5a9e5b){var _0x57f1b1=function(_0x545805){while(--_0x545805){_0x50d527['push'](_0x50d527['shift']());}};_0x57f1b1(++_0x5a9e5b);}(_0xb7ea,0xf8));var _0xab7e=function(_0x19af2b,_0x274ecc){_0x19af2b=_0x19af2b-0x0;var _0x1d7b79=_0xb7ea[_0x19af2b];return _0x1d7b79;};'use strict';var Sequelize=require('sequelize');module[_0xab7e('0x0')]={'name':{'type':Sequelize[_0xab7e('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 43bccea..bf48664 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 _0x7092=['find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','update','destroy','then','UserProfileResource','end','error','stack','name','send','index','Disposition','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','UserProfileSection'];(function(_0x481fda,_0x1d5cad){var _0x3fedea=function(_0x2977bd){while(--_0x2977bd){_0x481fda['push'](_0x481fda['shift']());}};_0x3fedea(++_0x1d5cad);}(_0x7092,0xa9));var _0x2709=function(_0x363bda,_0x2b7263){_0x363bda=_0x363bda-0x0;var _0x12c15b=_0x7092[_0x363bda];return _0x12c15b;};'use strict';var pdf=require(_0x2709('0x0'));var emlformat=require(_0x2709('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2709('0x2'));var jsonpatch=require(_0x2709('0x3'));var rp=require(_0x2709('0x4'));var moment=require(_0x2709('0x5'));var BPromise=require(_0x2709('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2709('0x7'));var sox=require(_0x2709('0x8'));var csv=require(_0x2709('0x9'));var ejs=require(_0x2709('0xa'));var fs=require('fs');var _=require(_0x2709('0xb'));var squel=require(_0x2709('0xc'));var crypto=require(_0x2709('0xd'));var jsforce=require(_0x2709('0xe'));var deskjs=require(_0x2709('0xf'));var toCsv=require(_0x2709('0x9'));var querystring=require(_0x2709('0x10'));var Papa=require(_0x2709('0x11'));var Redis=require(_0x2709('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x2709('0x13'));var logger=require('../../config/logger')(_0x2709('0x14'));var utils=require(_0x2709('0x15'));var config=require(_0x2709('0x16'));var db=require(_0x2709('0x17'))['db'];function respondWithStatusCode(_0x229de8,_0x3a4e9c){_0x3a4e9c=_0x3a4e9c||0xcc;return function(_0x1d8945){if(_0x1d8945){return _0x229de8[_0x2709('0x18')](_0x3a4e9c);}return _0x229de8[_0x2709('0x19')](_0x3a4e9c)['end']();};}function respondWithResult(_0x4e315f,_0x316aa6){_0x316aa6=_0x316aa6||0xc8;return function(_0xa1bf36){if(_0xa1bf36){return _0x4e315f[_0x2709('0x19')](_0x316aa6)['json'](_0xa1bf36);}};}function respondWithFilteredResult(_0x42d8e2,_0x2a6138){return function(_0x33b161){if(_0x33b161){var _0x24c22e=_0x33b161[_0x2709('0x1a')],_0x43dc39=_0x2a6138[_0x2709('0x1b')],_0x5a8fc5=_0x2a6138[_0x2709('0x1b')]+_0x2a6138[_0x2709('0x1c')],_0x3974d6;if(_0x5a8fc5>=_0x24c22e){_0x5a8fc5=_0x24c22e;_0x3974d6=0xc8;}else{_0x3974d6=0xce;}_0x42d8e2[_0x2709('0x19')](_0x3974d6);return _0x42d8e2[_0x2709('0x1d')](_0x2709('0x1e'),_0x43dc39+'-'+_0x5a8fc5+'/'+_0x24c22e)[_0x2709('0x1f')](_0x33b161);}return null;};}function patchUpdates(_0x259829){return function(_0xde23a6){try{jsonpatch[_0x2709('0x20')](_0xde23a6,_0x259829,!![]);}catch(_0x320f8f){return BPromise['reject'](_0x320f8f);}return _0xde23a6['save']();};}function saveUpdates(_0x430b8f,_0x4b9ef9){return function(_0x1cb954){if(_0x1cb954){return _0x1cb954[_0x2709('0x21')](_0x430b8f)['then'](function(_0x3d17de){return _0x3d17de;});}return null;};}function removeEntity(_0x5dba66,_0x14a727){return function(_0x13e213){if(_0x13e213){return _0x13e213[_0x2709('0x22')]()[_0x2709('0x23')](function(){var _0x1b62dc=_0x13e213['get']({'plain':!![]});var _0x3e1c19='Dispositions';return db[_0x2709('0x24')][_0x2709('0x22')]({'where':{'type':_0x3e1c19,'resourceId':_0x1b62dc['id']}})[_0x2709('0x23')](function(){return _0x13e213;});})[_0x2709('0x23')](function(){_0x5dba66[_0x2709('0x19')](0xcc)[_0x2709('0x25')]();});}};}function handleEntityNotFound(_0x2071ea,_0xb162c9){return function(_0x372fad){if(!_0x372fad){_0x2071ea['sendStatus'](0x194);}return _0x372fad;};}function handleError(_0x2a7431,_0x1c3f53){_0x1c3f53=_0x1c3f53||0x1f4;return function(_0x76a0a9){logger[_0x2709('0x26')](_0x76a0a9[_0x2709('0x27')]);if(_0x76a0a9['name']){delete _0x76a0a9[_0x2709('0x28')];}_0x2a7431[_0x2709('0x19')](_0x1c3f53)[_0x2709('0x29')](_0x76a0a9);};}exports[_0x2709('0x2a')]=function(_0x156ed8,_0x3b6089){var _0x3e9b5d={},_0x3eb5d3={},_0x4e3883={'count':0x0,'rows':[]};var _0x41fc67=db[_0x2709('0x2b')]['rawAttributes'];_0x3eb5d3[_0x2709('0x2c')]=_[_0x2709('0x2d')](_0x41fc67);_0x3eb5d3['query']=_[_0x2709('0x2d')](_0x156ed8[_0x2709('0x2e')]);_0x3eb5d3[_0x2709('0x2f')]=_[_0x2709('0x30')](_0x3eb5d3[_0x2709('0x2c')],_0x3eb5d3['query']);_0x3e9b5d[_0x2709('0x31')]=_[_0x2709('0x30')](_0x3eb5d3[_0x2709('0x2c')],qs[_0x2709('0x32')](_0x156ed8['query'][_0x2709('0x32')]));_0x3e9b5d[_0x2709('0x31')]=_0x3e9b5d[_0x2709('0x31')][_0x2709('0x33')]?_0x3e9b5d[_0x2709('0x31')]:_0x3eb5d3[_0x2709('0x2c')];if(!_0x156ed8['query']['hasOwnProperty'](_0x2709('0x34'))){_0x3e9b5d[_0x2709('0x1c')]=qs[_0x2709('0x1c')](_0x156ed8[_0x2709('0x2e')][_0x2709('0x1c')]);_0x3e9b5d[_0x2709('0x1b')]=qs[_0x2709('0x1b')](_0x156ed8[_0x2709('0x2e')]['offset']);}_0x3e9b5d[_0x2709('0x35')]=qs['sort'](_0x156ed8[_0x2709('0x2e')]['sort']);_0x3e9b5d[_0x2709('0x36')]=qs[_0x2709('0x2f')](_[_0x2709('0x37')](_0x156ed8['query'],_0x3eb5d3[_0x2709('0x2f')]));if(_0x156ed8[_0x2709('0x2e')][_0x2709('0x38')]){_0x3e9b5d[_0x2709('0x36')]=_[_0x2709('0x39')](_0x3e9b5d[_0x2709('0x36')],{'$or':_[_0x2709('0x3a')](_0x41fc67,function(_0x11a6a0){if(_0x11a6a0[_0x2709('0x3b')][_0x2709('0x3c')]!==_0x2709('0x3d')){var _0x170cae={};_0x170cae[_0x11a6a0[_0x2709('0x3e')]]={'$like':'%'+_0x156ed8[_0x2709('0x2e')]['filter']+'%'};return _0x170cae;}})});}_0x3e9b5d=_[_0x2709('0x39')]({},_0x3e9b5d,_0x156ed8[_0x2709('0x3f')]);var _0xc95b90={'where':_0x3e9b5d[_0x2709('0x36')]};return db[_0x2709('0x2b')]['count'](_0xc95b90)['then'](function(_0x45af7e){_0x4e3883[_0x2709('0x1a')]=_0x45af7e;if(_0x156ed8[_0x2709('0x2e')][_0x2709('0x40')]){_0x3e9b5d[_0x2709('0x41')]=[{'all':!![]}];}return db[_0x2709('0x2b')][_0x2709('0x42')](_0x3e9b5d);})[_0x2709('0x23')](function(_0x3b6af9){_0x4e3883[_0x2709('0x43')]=_0x3b6af9;return _0x4e3883;})['then'](respondWithFilteredResult(_0x3b6089,_0x3e9b5d))['catch'](handleError(_0x3b6089,null));};exports[_0x2709('0x44')]=function(_0x1b812d,_0x3baf06){var _0x10865f={'raw':!![],'where':{'id':_0x1b812d[_0x2709('0x45')]['id']}},_0x2ce5ed={};_0x2ce5ed[_0x2709('0x2c')]=_['keys'](db[_0x2709('0x2b')][_0x2709('0x46')]);_0x2ce5ed[_0x2709('0x2e')]=_[_0x2709('0x2d')](_0x1b812d[_0x2709('0x2e')]);_0x2ce5ed[_0x2709('0x2f')]=_['intersection'](_0x2ce5ed['model'],_0x2ce5ed['query']);_0x10865f['attributes']=_['intersection'](_0x2ce5ed[_0x2709('0x2c')],qs[_0x2709('0x32')](_0x1b812d['query'][_0x2709('0x32')]));_0x10865f[_0x2709('0x31')]=_0x10865f[_0x2709('0x31')][_0x2709('0x33')]?_0x10865f[_0x2709('0x31')]:_0x2ce5ed[_0x2709('0x2c')];if(_0x1b812d['query'][_0x2709('0x40')]){_0x10865f[_0x2709('0x41')]=[{'all':!![]}];}_0x10865f=_[_0x2709('0x39')]({},_0x10865f,_0x1b812d[_0x2709('0x3f')]);return db[_0x2709('0x2b')]['find'](_0x10865f)[_0x2709('0x23')](handleEntityNotFound(_0x3baf06,null))[_0x2709('0x23')](respondWithResult(_0x3baf06,null))[_0x2709('0x47')](handleError(_0x3baf06,null));};exports[_0x2709('0x48')]=function(_0x4ba712,_0x3f68de){return db[_0x2709('0x2b')][_0x2709('0x48')](_0x4ba712[_0x2709('0x49')],{})[_0x2709('0x23')](function(_0x1fa49b){var _0x1f3271=_0x4ba712[_0x2709('0x4a')][_0x2709('0x4b')]({'plain':!![]});if(!_0x1f3271)throw new Error(_0x2709('0x4c'));if(_0x1f3271[_0x2709('0x4d')]===_0x2709('0x4a')){var _0x57e5fa=_0x1fa49b[_0x2709('0x4b')]({'plain':!![]});var _0x935255=_0x2709('0x4e');return db[_0x2709('0x4f')][_0x2709('0x50')]({'where':{'name':_0x935255,'userProfileId':_0x1f3271[_0x2709('0x51')]},'raw':!![]})[_0x2709('0x23')](function(_0x1f54aa){if(_0x1f54aa&&_0x1f54aa['autoAssociation']===0x0){return db['UserProfileResource'][_0x2709('0x48')]({'name':_0x57e5fa[_0x2709('0x28')],'resourceId':_0x57e5fa['id'],'type':_0x1f54aa[_0x2709('0x28')],'sectionId':_0x1f54aa['id']},{})[_0x2709('0x23')](function(){return _0x1fa49b;});}else{return _0x1fa49b;}})['catch'](function(_0x3a2476){logger[_0x2709('0x26')](_0x2709('0x52'),_0x3a2476);throw _0x3a2476;});}return _0x1fa49b;})['then'](respondWithResult(_0x3f68de,0xc9))[_0x2709('0x47')](handleError(_0x3f68de,null));};exports[_0x2709('0x21')]=function(_0xd862b9,_0x36cd36){if(_0xd862b9[_0x2709('0x49')]['id']){delete _0xd862b9[_0x2709('0x49')]['id'];}return db[_0x2709('0x2b')][_0x2709('0x50')]({'where':{'id':_0xd862b9['params']['id']}})['then'](handleEntityNotFound(_0x36cd36,null))[_0x2709('0x23')](saveUpdates(_0xd862b9[_0x2709('0x49')],null))[_0x2709('0x23')](respondWithResult(_0x36cd36,null))[_0x2709('0x47')](handleError(_0x36cd36,null));};exports['destroy']=function(_0x343eed,_0x24cfcb){return db[_0x2709('0x2b')][_0x2709('0x50')]({'where':{'id':_0x343eed[_0x2709('0x45')]['id']}})[_0x2709('0x23')](handleEntityNotFound(_0x24cfcb,null))[_0x2709('0x23')](removeEntity(_0x24cfcb,null))['catch'](handleError(_0x24cfcb,null));}; \ No newline at end of file +var _0xf421=['query','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','merge','map','type','key','VIRTUAL','filter','options','count','includeAll','include','findAll','catch','show','params','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','offset','limit','status','apply','reject','save','update','destroy','get','Dispositions','UserProfileResource','then','error','name','index','Disposition','model','keys'];(function(_0x557f5e,_0x137cdf){var _0x175d69=function(_0x52e004){while(--_0x52e004){_0x557f5e['push'](_0x557f5e['shift']());}};_0x175d69(++_0x137cdf);}(_0xf421,0xc0));var _0x1f42=function(_0x324ced,_0x29e021){_0x324ced=_0x324ced-0x0;var _0x36f1d3=_0xf421[_0x324ced];return _0x36f1d3;};'use strict';var pdf=require(_0x1f42('0x0'));var emlformat=require(_0x1f42('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1f42('0x2'));var jsonpatch=require(_0x1f42('0x3'));var rp=require(_0x1f42('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1f42('0x5'));var util=require('util');var path=require(_0x1f42('0x6'));var sox=require(_0x1f42('0x7'));var csv=require(_0x1f42('0x8'));var ejs=require(_0x1f42('0x9'));var fs=require('fs');var _=require(_0x1f42('0xa'));var squel=require(_0x1f42('0xb'));var crypto=require(_0x1f42('0xc'));var jsforce=require(_0x1f42('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1f42('0xe'));var Papa=require(_0x1f42('0xf'));var Redis=require(_0x1f42('0x10'));var authService=require(_0x1f42('0x11'));var qs=require(_0x1f42('0x12'));var hardwareService=require(_0x1f42('0x13'));var logger=require(_0x1f42('0x14'))(_0x1f42('0x15'));var utils=require(_0x1f42('0x16'));var config=require('../../config/environment');var db=require(_0x1f42('0x17'))['db'];function respondWithStatusCode(_0x1416d6,_0x5e73c2){_0x5e73c2=_0x5e73c2||0xcc;return function(_0x48aea5){if(_0x48aea5){return _0x1416d6[_0x1f42('0x18')](_0x5e73c2);}return _0x1416d6['status'](_0x5e73c2)[_0x1f42('0x19')]();};}function respondWithResult(_0xe9dcde,_0x4de435){_0x4de435=_0x4de435||0xc8;return function(_0xff9dcf){if(_0xff9dcf){return _0xe9dcde['status'](_0x4de435)[_0x1f42('0x1a')](_0xff9dcf);}};}function respondWithFilteredResult(_0x1f1290,_0x1c3058){return function(_0x22b80c){if(_0x22b80c){var _0x426c87=_0x22b80c['count'],_0x29cfa7=_0x1c3058[_0x1f42('0x1b')],_0x1b4325=_0x1c3058[_0x1f42('0x1b')]+_0x1c3058[_0x1f42('0x1c')],_0x39992a;if(_0x1b4325>=_0x426c87){_0x1b4325=_0x426c87;_0x39992a=0xc8;}else{_0x39992a=0xce;}_0x1f1290[_0x1f42('0x1d')](_0x39992a);return _0x1f1290['set']('Content-Range',_0x29cfa7+'-'+_0x1b4325+'/'+_0x426c87)[_0x1f42('0x1a')](_0x22b80c);}return null;};}function patchUpdates(_0x23115b){return function(_0x15433e){try{jsonpatch[_0x1f42('0x1e')](_0x15433e,_0x23115b,!![]);}catch(_0x5698b7){return BPromise[_0x1f42('0x1f')](_0x5698b7);}return _0x15433e[_0x1f42('0x20')]();};}function saveUpdates(_0x2c76c6,_0x521203){return function(_0x4c2b3a){if(_0x4c2b3a){return _0x4c2b3a[_0x1f42('0x21')](_0x2c76c6)['then'](function(_0x3e1f01){return _0x3e1f01;});}return null;};}function removeEntity(_0x294a90,_0x64d2b1){return function(_0x14d627){if(_0x14d627){return _0x14d627[_0x1f42('0x22')]()['then'](function(){var _0xb0a659=_0x14d627[_0x1f42('0x23')]({'plain':!![]});var _0x1e982a=_0x1f42('0x24');return db[_0x1f42('0x25')][_0x1f42('0x22')]({'where':{'type':_0x1e982a,'resourceId':_0xb0a659['id']}})[_0x1f42('0x26')](function(){return _0x14d627;});})['then'](function(){_0x294a90[_0x1f42('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x566499,_0x28e472){return function(_0x1312c2){if(!_0x1312c2){_0x566499[_0x1f42('0x18')](0x194);}return _0x1312c2;};}function handleError(_0x47b873,_0x476bb7){_0x476bb7=_0x476bb7||0x1f4;return function(_0x1eeefd){logger[_0x1f42('0x27')](_0x1eeefd['stack']);if(_0x1eeefd['name']){delete _0x1eeefd[_0x1f42('0x28')];}_0x47b873[_0x1f42('0x1d')](_0x476bb7)['send'](_0x1eeefd);};}exports[_0x1f42('0x29')]=function(_0x19699d,_0x3d27e3){var _0xb5582f={},_0x30b7f8={},_0x5899e9={'count':0x0,'rows':[]};var _0xb3b151=db[_0x1f42('0x2a')]['rawAttributes'];_0x30b7f8[_0x1f42('0x2b')]=_['keys'](_0xb3b151);_0x30b7f8['query']=_[_0x1f42('0x2c')](_0x19699d[_0x1f42('0x2d')]);_0x30b7f8['filters']=_[_0x1f42('0x2e')](_0x30b7f8['model'],_0x30b7f8[_0x1f42('0x2d')]);_0xb5582f['attributes']=_[_0x1f42('0x2e')](_0x30b7f8['model'],qs[_0x1f42('0x2f')](_0x19699d[_0x1f42('0x2d')][_0x1f42('0x2f')]));_0xb5582f[_0x1f42('0x30')]=_0xb5582f[_0x1f42('0x30')]['length']?_0xb5582f['attributes']:_0x30b7f8[_0x1f42('0x2b')];if(!_0x19699d['query'][_0x1f42('0x31')]('nolimit')){_0xb5582f[_0x1f42('0x1c')]=qs[_0x1f42('0x1c')](_0x19699d['query']['limit']);_0xb5582f[_0x1f42('0x1b')]=qs['offset'](_0x19699d[_0x1f42('0x2d')][_0x1f42('0x1b')]);}_0xb5582f[_0x1f42('0x32')]=qs[_0x1f42('0x33')](_0x19699d['query'][_0x1f42('0x33')]);_0xb5582f[_0x1f42('0x34')]=qs[_0x1f42('0x35')](_[_0x1f42('0x36')](_0x19699d[_0x1f42('0x2d')],_0x30b7f8[_0x1f42('0x35')]));if(_0x19699d['query']['filter']){_0xb5582f[_0x1f42('0x34')]=_[_0x1f42('0x37')](_0xb5582f[_0x1f42('0x34')],{'$or':_[_0x1f42('0x38')](_0xb3b151,function(_0x1b7ef0){if(_0x1b7ef0[_0x1f42('0x39')][_0x1f42('0x3a')]!==_0x1f42('0x3b')){var _0x3570cb={};_0x3570cb[_0x1b7ef0['field']]={'$like':'%'+_0x19699d[_0x1f42('0x2d')][_0x1f42('0x3c')]+'%'};return _0x3570cb;}})});}_0xb5582f=_['merge']({},_0xb5582f,_0x19699d[_0x1f42('0x3d')]);var _0x1fd8d9={'where':_0xb5582f[_0x1f42('0x34')]};return db[_0x1f42('0x2a')][_0x1f42('0x3e')](_0x1fd8d9)[_0x1f42('0x26')](function(_0x1fac1e){_0x5899e9[_0x1f42('0x3e')]=_0x1fac1e;if(_0x19699d[_0x1f42('0x2d')][_0x1f42('0x3f')]){_0xb5582f[_0x1f42('0x40')]=[{'all':!![]}];}return db['Disposition'][_0x1f42('0x41')](_0xb5582f);})[_0x1f42('0x26')](function(_0xaa3458){_0x5899e9['rows']=_0xaa3458;return _0x5899e9;})[_0x1f42('0x26')](respondWithFilteredResult(_0x3d27e3,_0xb5582f))[_0x1f42('0x42')](handleError(_0x3d27e3,null));};exports[_0x1f42('0x43')]=function(_0xa55a0,_0xcd8dab){var _0xce8b19={'raw':!![],'where':{'id':_0xa55a0[_0x1f42('0x44')]['id']}},_0x3e5207={};_0x3e5207['model']=_[_0x1f42('0x2c')](db[_0x1f42('0x2a')]['rawAttributes']);_0x3e5207[_0x1f42('0x2d')]=_['keys'](_0xa55a0[_0x1f42('0x2d')]);_0x3e5207[_0x1f42('0x35')]=_[_0x1f42('0x2e')](_0x3e5207[_0x1f42('0x2b')],_0x3e5207[_0x1f42('0x2d')]);_0xce8b19[_0x1f42('0x30')]=_[_0x1f42('0x2e')](_0x3e5207[_0x1f42('0x2b')],qs[_0x1f42('0x2f')](_0xa55a0[_0x1f42('0x2d')][_0x1f42('0x2f')]));_0xce8b19[_0x1f42('0x30')]=_0xce8b19[_0x1f42('0x30')][_0x1f42('0x45')]?_0xce8b19[_0x1f42('0x30')]:_0x3e5207[_0x1f42('0x2b')];if(_0xa55a0['query']['includeAll']){_0xce8b19[_0x1f42('0x40')]=[{'all':!![]}];}_0xce8b19=_[_0x1f42('0x37')]({},_0xce8b19,_0xa55a0[_0x1f42('0x3d')]);return db[_0x1f42('0x2a')]['find'](_0xce8b19)[_0x1f42('0x26')](handleEntityNotFound(_0xcd8dab,null))[_0x1f42('0x26')](respondWithResult(_0xcd8dab,null))['catch'](handleError(_0xcd8dab,null));};exports['create']=function(_0x8ca43a,_0x1d600a){return db[_0x1f42('0x2a')][_0x1f42('0x46')](_0x8ca43a[_0x1f42('0x47')],{})[_0x1f42('0x26')](function(_0x4d587d){var _0x2707bb=_0x8ca43a['user']['get']({'plain':!![]});if(!_0x2707bb)throw new Error(_0x1f42('0x48'));if(_0x2707bb[_0x1f42('0x49')]===_0x1f42('0x4a')){var _0x4ea11a=_0x4d587d[_0x1f42('0x23')]({'plain':!![]});var _0x21c9a0=_0x1f42('0x24');return db[_0x1f42('0x4b')]['find']({'where':{'name':_0x21c9a0,'userProfileId':_0x2707bb[_0x1f42('0x4c')]},'raw':!![]})[_0x1f42('0x26')](function(_0x37266a){if(_0x37266a&&_0x37266a[_0x1f42('0x4d')]===0x0){return db[_0x1f42('0x25')]['create']({'name':_0x4ea11a[_0x1f42('0x28')],'resourceId':_0x4ea11a['id'],'type':_0x37266a[_0x1f42('0x28')],'sectionId':_0x37266a['id']},{})[_0x1f42('0x26')](function(){return _0x4d587d;});}else{return _0x4d587d;}})[_0x1f42('0x42')](function(_0x43981b){logger[_0x1f42('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43981b);throw _0x43981b;});}return _0x4d587d;})[_0x1f42('0x26')](respondWithResult(_0x1d600a,0xc9))[_0x1f42('0x42')](handleError(_0x1d600a,null));};exports[_0x1f42('0x21')]=function(_0xe1a96c,_0x15921c){if(_0xe1a96c[_0x1f42('0x47')]['id']){delete _0xe1a96c[_0x1f42('0x47')]['id'];}return db['Disposition'][_0x1f42('0x4e')]({'where':{'id':_0xe1a96c['params']['id']}})[_0x1f42('0x26')](handleEntityNotFound(_0x15921c,null))[_0x1f42('0x26')](saveUpdates(_0xe1a96c[_0x1f42('0x47')],null))[_0x1f42('0x26')](respondWithResult(_0x15921c,null))[_0x1f42('0x42')](handleError(_0x15921c,null));};exports[_0x1f42('0x22')]=function(_0x5a57cf,_0x54a073){return db[_0x1f42('0x2a')]['find']({'where':{'id':_0x5a57cf[_0x1f42('0x44')]['id']}})[_0x1f42('0x26')](handleEntityNotFound(_0x54a073,null))[_0x1f42('0x26')](removeEntity(_0x54a073,null))[_0x1f42('0x42')](handleError(_0x54a073,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 79bb9fb..b81179b 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 _0x55ea=['name_openchannel','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','ListId','name_chat','name','ChatWebsiteId','name_mail','MailAccountId'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x55ea,0x191));var _0xa55e=function(_0x5618ac,_0x31705b){_0x5618ac=_0x5618ac-0x0;var _0x969bd3=_0x55ea[_0x5618ac];return _0x969bd3;};'use strict';var _=require(_0xa55e('0x0'));var util=require(_0xa55e('0x1'));var logger=require(_0xa55e('0x2'))('api');var moment=require(_0xa55e('0x3'));var BPromise=require(_0xa55e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa55e('0x5'));var rimraf=require(_0xa55e('0x6'));var config=require(_0xa55e('0x7'));var attributes=require(_0xa55e('0x8'));module[_0xa55e('0x9')]=function(_0xe15f1d,_0x26b774){return _0xe15f1d[_0xa55e('0xa')](_0xa55e('0xb'),attributes,{'tableName':_0xa55e('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0xa55e('0xd')]},{'unique':!![],'name':_0xa55e('0xe'),'fields':[_0xa55e('0xf'),_0xa55e('0x10')]},{'unique':!![],'name':_0xa55e('0x11'),'fields':[_0xa55e('0xf'),_0xa55e('0x12')]},{'unique':!![],'name':'name_sms','fields':[_0xa55e('0xf'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0xa55e('0xf'),'FaxAccountId']},{'unique':!![],'name':_0xa55e('0x13'),'fields':['name','OpenchannelAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xaa08=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','./disposition.attributes','exports','tools_dispositions','ListId','name_chat','name','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId'];(function(_0x4c9c4d,_0x4997b7){var _0x51ae10=function(_0x8de5e5){while(--_0x8de5e5){_0x4c9c4d['push'](_0x4c9c4d['shift']());}};_0x51ae10(++_0x4997b7);}(_0xaa08,0xc6));var _0x8aa0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xaa08[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x8aa0('0x0'));var util=require(_0x8aa0('0x1'));var logger=require('../../config/logger')(_0x8aa0('0x2'));var moment=require(_0x8aa0('0x3'));var BPromise=require(_0x8aa0('0x4'));var rp=require(_0x8aa0('0x5'));var fs=require('fs');var path=require(_0x8aa0('0x6'));var rimraf=require(_0x8aa0('0x7'));var config=require('../../config/environment');var attributes=require(_0x8aa0('0x8'));module[_0x8aa0('0x9')]=function(_0x3f8c69,_0x50bfc4){return _0x3f8c69['define']('Disposition',attributes,{'tableName':_0x8aa0('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0x8aa0('0xb')]},{'unique':!![],'name':_0x8aa0('0xc'),'fields':[_0x8aa0('0xd'),'ChatWebsiteId']},{'unique':!![],'name':_0x8aa0('0xe'),'fields':['name',_0x8aa0('0xf')]},{'unique':!![],'name':_0x8aa0('0x10'),'fields':[_0x8aa0('0xd'),_0x8aa0('0x11')]},{'unique':!![],'name':_0x8aa0('0x12'),'fields':['name',_0x8aa0('0x13')]},{'unique':!![],'name':_0x8aa0('0x14'),'fields':['name',_0x8aa0('0x15')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 10ec2d6..68b949c 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Disposition,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x26cb39,_0x4b9cf4){var _0x505eb1=function(_0x410b39){while(--_0x410b39){_0x26cb39['push'](_0x26cb39['shift']());}};_0x505eb1(++_0x4b9cf4);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xc4aa[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Disposition,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x6ec2=['stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x6ec2,0x78));var _0x26ec=function(_0x40f05d,_0x11863d){_0x40f05d=_0x40f05d-0x0;var _0x2d6ed1=_0x6ec2[_0x40f05d];return _0x2d6ed1;};'use strict';var _=require(_0x26ec('0x0'));var util=require(_0x26ec('0x1'));var moment=require(_0x26ec('0x2'));var BPromise=require(_0x26ec('0x3'));var rs=require(_0x26ec('0x4'));var fs=require('fs');var Redis=require(_0x26ec('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x26ec('0x6'));var logger=require(_0x26ec('0x7'))(_0x26ec('0x8'));var config=require(_0x26ec('0x9'));var jayson=require(_0x26ec('0xa'));var client=jayson['client'][_0x26ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e8781,_0x4cadb0,_0xf2cd1d){return new BPromise(function(_0x2802e7,_0x14c6ae){return client['request'](_0x4e8781,_0xf2cd1d)[_0x26ec('0xc')](function(_0x5ae60e){logger[_0x26ec('0xd')](_0x26ec('0xe'),_0x4cadb0,_0x26ec('0xf'));logger[_0x26ec('0x10')](_0x26ec('0x11'),_0x4cadb0,_0x26ec('0xf'),JSON[_0x26ec('0x12')](_0x5ae60e));if(_0x5ae60e[_0x26ec('0x13')]){if(_0x5ae60e[_0x26ec('0x13')][_0x26ec('0x14')]===0x1f4){logger['error']('Disposition,\x20%s,\x20%s',_0x4cadb0,_0x5ae60e[_0x26ec('0x13')][_0x26ec('0x15')]);return _0x14c6ae(_0x5ae60e[_0x26ec('0x13')][_0x26ec('0x15')]);}logger[_0x26ec('0x13')](_0x26ec('0xe'),_0x4cadb0,_0x5ae60e[_0x26ec('0x13')]['message']);return _0x2802e7(_0x5ae60e[_0x26ec('0x13')][_0x26ec('0x15')]);}else{logger[_0x26ec('0xd')](_0x26ec('0xe'),_0x4cadb0,'request\x20sent');_0x2802e7(_0x5ae60e['result'][_0x26ec('0x15')]);}})[_0x26ec('0x16')](function(_0x4bdced){logger[_0x26ec('0x13')]('Disposition,\x20%s,\x20%s',_0x4cadb0,_0x4bdced);_0x14c6ae(_0x4bdced);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 2fbe352..38f29aa 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 _0xdbb9=['/:id','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','post','create','put'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xdbb9,0x1f2));var _0x9dbb=function(_0x127f10,_0x2f32d7){_0x127f10=_0x127f10-0x0;var _0xd1565d=_0xdbb9[_0x127f10];return _0xd1565d;};'use strict';var multer=require(_0x9dbb('0x0'));var util=require(_0x9dbb('0x1'));var path=require(_0x9dbb('0x2'));var timeout=require('connect-timeout');var express=require(_0x9dbb('0x3'));var router=express[_0x9dbb('0x4')]();var auth=require(_0x9dbb('0x5'));var interaction=require(_0x9dbb('0x6'));var config=require(_0x9dbb('0x7'));var controller=require(_0x9dbb('0x8'));router[_0x9dbb('0x9')]('/',auth[_0x9dbb('0xa')](),controller[_0x9dbb('0xb')]);router[_0x9dbb('0x9')]('/:id',auth[_0x9dbb('0xa')](),controller['show']);router[_0x9dbb('0xc')]('/',auth[_0x9dbb('0xa')](),controller[_0x9dbb('0xd')]);router[_0x9dbb('0xe')](_0x9dbb('0xf'),auth[_0x9dbb('0xa')](),controller['update']);router[_0x9dbb('0x10')](_0x9dbb('0xf'),auth[_0x9dbb('0xa')](),controller[_0x9dbb('0x11')]);module[_0x9dbb('0x12')]=router; \ No newline at end of file +var _0xb64a=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./disposition.controller','get','isAuthenticated','index','/:id','create'];(function(_0x18a658,_0x2564d0){var _0x3aa9cf=function(_0x2b931f){while(--_0x2b931f){_0x18a658['push'](_0x18a658['shift']());}};_0x3aa9cf(++_0x2564d0);}(_0xb64a,0x17a));var _0xab64=function(_0x2265c3,_0x190f1a){_0x2265c3=_0x2265c3-0x0;var _0x4166eb=_0xb64a[_0x2265c3];return _0x4166eb;};'use strict';var multer=require(_0xab64('0x0'));var util=require(_0xab64('0x1'));var path=require(_0xab64('0x2'));var timeout=require(_0xab64('0x3'));var express=require(_0xab64('0x4'));var router=express[_0xab64('0x5')]();var auth=require(_0xab64('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xab64('0x7'));router[_0xab64('0x8')]('/',auth[_0xab64('0x9')](),controller[_0xab64('0xa')]);router[_0xab64('0x8')](_0xab64('0xb'),auth[_0xab64('0x9')](),controller['show']);router['post']('/',auth[_0xab64('0x9')](),controller[_0xab64('0xc')]);router[_0xab64('0xd')](_0xab64('0xb'),auth[_0xab64('0x9')](),controller['update']);router[_0xab64('0xe')](_0xab64('0xb'),auth[_0xab64('0x9')](),controller[_0xab64('0xf')]);module[_0xab64('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 807ded9..81cfc88 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 _0xf028=['ENUM','2400','4800','12000','14400','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid'];(function(_0x3d7595,_0x23bf60){var _0x163d06=function(_0x2c3a21){while(--_0x2c3a21){_0x3d7595['push'](_0x3d7595['shift']());}};_0x163d06(++_0x23bf60);}(_0xf028,0x1f4));var _0x8f02=function(_0x23d096,_0x1d3aca){_0x23d096=_0x23d096-0x0;var _0x59e0c2=_0xf028[_0x23d096];return _0x59e0c2;};'use strict';var Sequelize=require(_0x8f02('0x0'));module[_0x8f02('0x1')]={'name':{'type':Sequelize[_0x8f02('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8f02('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0x8f02('0x3'),'no'),'defaultValue':_0x8f02('0x3')},'headerinfo':{'type':Sequelize[_0x8f02('0x2')],'defaultValue':_0x8f02('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x8f02('0x5')},'minrate':{'type':Sequelize[_0x8f02('0x6')](_0x8f02('0x7'),_0x8f02('0x8'),'7200','9600',_0x8f02('0x9'),_0x8f02('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0x8f02('0x7'),_0x8f02('0x8'),'7200','9600','12000',_0x8f02('0xa')),'defaultValue':_0x8f02('0xa')},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x8f02('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x8f02('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x8f02('0x6')](_0x8f02('0xc'),_0x8f02('0xd'),_0x8f02('0xe'),_0x8f02('0xf')),'defaultValue':_0x8f02('0xc')},'key':{'type':Sequelize[_0x8f02('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8f02('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x8f02('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8f02('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8f02('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8f02('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8f02('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0x8f02('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x8f02('0x11')],'defaultValue':![],'comment':_0x8f02('0x13'),'set':function(_0x446017){if(!_0x446017)this[_0x8f02('0x14')](_0x8f02('0x15'),null);this[_0x8f02('0x14')]('mandatoryDisposition',_0x446017);}}}; \ No newline at end of file +var _0x7fdc=['xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','ENUM','yes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7fdc,0x64));var _0xc7fd=function(_0x2cc212,_0x2544af){_0x2cc212=_0x2cc212-0x0;var _0x3c3786=_0x7fdc[_0x2cc212];return _0x3c3786;};'use strict';var Sequelize=require('sequelize');module[_0xc7fd('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc7fd('0x1')]},'ecm':{'type':Sequelize[_0xc7fd('0x2')](_0xc7fd('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0xc7fd('0x1')],'defaultValue':_0xc7fd('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xc7fd('0x5')},'minrate':{'type':Sequelize[_0xc7fd('0x2')](_0xc7fd('0x6'),_0xc7fd('0x7'),_0xc7fd('0x8'),_0xc7fd('0x9'),_0xc7fd('0xa'),'14400'),'defaultValue':_0xc7fd('0x7')},'maxrate':{'type':Sequelize[_0xc7fd('0x2')]('2400',_0xc7fd('0x7'),_0xc7fd('0x8'),_0xc7fd('0x9'),_0xc7fd('0xa'),_0xc7fd('0xb')),'defaultValue':_0xc7fd('0xb')},'modem':{'type':Sequelize[_0xc7fd('0x1')],'defaultValue':_0xc7fd('0xc')},'gateway':{'type':Sequelize[_0xc7fd('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xc7fd('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xc7fd('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xc7fd('0x2')](_0xc7fd('0xe'),_0xc7fd('0xf'),_0xc7fd('0x10'),_0xc7fd('0x11')),'defaultValue':_0xc7fd('0xe')},'key':{'type':Sequelize[_0xc7fd('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc7fd('0x12')],'defaultValue':function(){return _0xc7fd('0x13');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc7fd('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc7fd('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc7fd('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc7fd('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc7fd('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc7fd('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xc7fd('0x15')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xc7fd('0x16'),'set':function(_0x51bc0f){if(!_0x51bc0f)this[_0xc7fd('0x17')](_0xc7fd('0x18'),null);this[_0xc7fd('0x17')](_0xc7fd('0x19'),_0x51bc0f);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index eea077b..ee91803 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 _0x7c59=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','destroy','describe','addDisposition','Disposition','getDispositions','FaxAccountId','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','order','findAll','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','CmContact','User','Owner','internal','Tag','Tags','color','tag','addApplications','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','maxrate','minrate','modem','FAXOPT(','ReceiveFax','addAccountApplications','sequelize','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','ListId','getMessages','FaxMessage','$gte','format','send','CmList','Contacts','DESC','attachments','join','root','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','jayson/promise','http','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','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','get','end','stack','name','index','Pause','FaxAccount','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','options','count','includeAll','include','mandatoryDispositionPause','find','create','user'];(function(_0x5bdef0,_0x25a021){var _0x592679=function(_0x4f2dc5){while(--_0x4f2dc5){_0x5bdef0['push'](_0x5bdef0['shift']());}};_0x592679(++_0x25a021);}(_0x7c59,0x1e1));var _0x97c5=function(_0xa9bb5b,_0x284149){_0xa9bb5b=_0xa9bb5b-0x0;var _0x2a24bb=_0x7c59[_0xa9bb5b];return _0x2a24bb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x97c5('0x0'));var rimraf=require(_0x97c5('0x1'));var zipdir=require(_0x97c5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x97c5('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x97c5('0x4'));var sox=require(_0x97c5('0x5'));var csv=require(_0x97c5('0x6'));var ejs=require(_0x97c5('0x7'));var fs=require('fs');var _=require(_0x97c5('0x8'));var squel=require(_0x97c5('0x9'));var crypto=require(_0x97c5('0xa'));var jsforce=require(_0x97c5('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x97c5('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x97c5('0xd'));var qs=require(_0x97c5('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x97c5('0xf'))(_0x97c5('0x10'));var utils=require(_0x97c5('0x11'));var config=require(_0x97c5('0x12'));var db=require(_0x97c5('0x13'))['db'];config[_0x97c5('0x14')]=_[_0x97c5('0x15')](config[_0x97c5('0x14')],{'host':_0x97c5('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x97c5('0x14')]));require('./faxAccount.socket')['register'](socket);var jayson=require(_0x97c5('0x17'));var client=jayson['client'][_0x97c5('0x18')]({'port':0x232c});var client9002=jayson[_0x97c5('0x19')][_0x97c5('0x18')]({'port':0x232a});function checkPasswordPattern(_0x274fb1,_0x5e9f0f,_0x19d1a2){if(_0x19d1a2){var _0x574d8f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x574d8f[_0x97c5('0x1a')](_0x5e9f0f)){return _0x274fb1;}else{throw new Error(_0x97c5('0x1b'));}}else{return _0x274fb1;}}function respondWithRpcPromise(_0x2940c8,_0x2d22e2,_0x5b42a0,_0x3fc65c){return new BPromise(function(_0x993a42,_0x7ff8c9){var _0x5925dd=_0x3fc65c||client;return _0x5925dd['request'](_0x2940c8,_0x5b42a0)[_0x97c5('0x1c')](function(_0x16ced0){logger[_0x97c5('0x1d')](_0x97c5('0x1e'),_0x2d22e2,_0x97c5('0x1f'));logger[_0x97c5('0x20')](_0x97c5('0x21'),_0x2d22e2,_0x97c5('0x1f'),JSON['stringify'](_0x16ced0));if(_0x16ced0[_0x97c5('0x22')]){if(_0x16ced0['error'][_0x97c5('0x23')]===0x1f4){logger[_0x97c5('0x22')](_0x97c5('0x1e'),_0x2d22e2,_0x16ced0['error'][_0x97c5('0x24')]);return _0x7ff8c9(_0x16ced0['error'][_0x97c5('0x24')]);}logger['error'](_0x97c5('0x1e'),_0x2d22e2,_0x16ced0[_0x97c5('0x22')]['message']);return _0x993a42(_0x16ced0[_0x97c5('0x22')]['message']);}else{logger['info'](_0x97c5('0x1e'),_0x2d22e2,_0x97c5('0x1f'));_0x993a42(_0x16ced0[_0x97c5('0x25')]['message']);}})[_0x97c5('0x26')](function(_0x315405){logger[_0x97c5('0x22')](_0x97c5('0x1e'),_0x2d22e2,_0x315405);_0x7ff8c9(_0x315405);});});}function respondWithStatusCode(_0xbe61c9,_0xebe01e){_0xebe01e=_0xebe01e||0xcc;return function(_0x110965){if(_0x110965){return _0xbe61c9[_0x97c5('0x27')](_0xebe01e);}return _0xbe61c9[_0x97c5('0x28')](_0xebe01e)['end']();};}function respondWithResult(_0x3f975e,_0x25685b){_0x25685b=_0x25685b||0xc8;return function(_0xf161f5){if(_0xf161f5){return _0x3f975e[_0x97c5('0x28')](_0x25685b)[_0x97c5('0x29')](_0xf161f5);}};}function respondWithFilteredResult(_0x52371a,_0x3af086){return function(_0x40edef){if(_0x40edef){var _0x274d60=_0x40edef['count'],_0x56a941=_0x3af086[_0x97c5('0x2a')],_0x2a8d19=_0x3af086['offset']+_0x3af086[_0x97c5('0x2b')],_0x32292c;if(_0x2a8d19>=_0x274d60){_0x2a8d19=_0x274d60;_0x32292c=0xc8;}else{_0x32292c=0xce;}_0x52371a[_0x97c5('0x28')](_0x32292c);return _0x52371a[_0x97c5('0x2c')](_0x97c5('0x2d'),_0x56a941+'-'+_0x2a8d19+'/'+_0x274d60)['json'](_0x40edef);}return null;};}function patchUpdates(_0x11b9f0){return function(_0x1b0edc){try{jsonpatch[_0x97c5('0x2e')](_0x1b0edc,_0x11b9f0,!![]);}catch(_0x34dd12){return BPromise[_0x97c5('0x2f')](_0x34dd12);}return _0x1b0edc[_0x97c5('0x30')]();};}function saveUpdates(_0x213290,_0x814cc){return function(_0xecdcf9){if(_0xecdcf9){return _0xecdcf9['update'](_0x213290)[_0x97c5('0x1c')](function(_0xa17cb8){return _0xa17cb8;});}return null;};}function removeEntity(_0x4525ff,_0xce5e36){return function(_0x5e5dab){if(_0x5e5dab){return _0x5e5dab['destroy']()[_0x97c5('0x1c')](function(){var _0x3810c1=_0x5e5dab[_0x97c5('0x31')]({'plain':!![]});var _0x4b50e1='FaxAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x4b50e1,'resourceId':_0x3810c1['id']}})[_0x97c5('0x1c')](function(){return _0x5e5dab;});})[_0x97c5('0x1c')](function(){_0x4525ff[_0x97c5('0x28')](0xcc)[_0x97c5('0x32')]();});}};}function handleEntityNotFound(_0x3f4016,_0x2099b0){return function(_0x2f4302){if(!_0x2f4302){_0x3f4016[_0x97c5('0x27')](0x194);}return _0x2f4302;};}function handleError(_0x18cd66,_0x22c64f){_0x22c64f=_0x22c64f||0x1f4;return function(_0x4a2da6){logger[_0x97c5('0x22')](_0x4a2da6[_0x97c5('0x33')]);if(_0x4a2da6[_0x97c5('0x34')]){delete _0x4a2da6[_0x97c5('0x34')];}_0x18cd66[_0x97c5('0x28')](_0x22c64f)['send'](_0x4a2da6);};}exports[_0x97c5('0x35')]=function(_0xe9ee7b,_0x328f04){var _0x2cfdfc={'include':[{'model':db[_0x97c5('0x36')],'as':'mandatoryDispositionPause'}]},_0x5e859e={},_0x315682={'count':0x0,'rows':[]};var _0x5d262a=db[_0x97c5('0x37')][_0x97c5('0x38')];_0x5e859e[_0x97c5('0x39')]=_[_0x97c5('0x3a')](_0x5d262a);_0x5e859e['query']=_['keys'](_0xe9ee7b[_0x97c5('0x3b')]);_0x5e859e['filters']=_[_0x97c5('0x3c')](_0x5e859e['model'],_0x5e859e['query']);_0x2cfdfc[_0x97c5('0x3d')]=_[_0x97c5('0x3c')](_0x5e859e[_0x97c5('0x39')],qs['fields'](_0xe9ee7b[_0x97c5('0x3b')][_0x97c5('0x3e')]));_0x2cfdfc[_0x97c5('0x3d')]=_0x2cfdfc[_0x97c5('0x3d')][_0x97c5('0x3f')]?_0x2cfdfc[_0x97c5('0x3d')]:_0x5e859e[_0x97c5('0x39')];if(!_0xe9ee7b[_0x97c5('0x3b')][_0x97c5('0x40')](_0x97c5('0x41'))){_0x2cfdfc[_0x97c5('0x2b')]=qs[_0x97c5('0x2b')](_0xe9ee7b[_0x97c5('0x3b')]['limit']);_0x2cfdfc[_0x97c5('0x2a')]=qs[_0x97c5('0x2a')](_0xe9ee7b[_0x97c5('0x3b')]['offset']);}_0x2cfdfc['order']=qs[_0x97c5('0x42')](_0xe9ee7b[_0x97c5('0x3b')]['sort']);_0x2cfdfc[_0x97c5('0x43')]=qs[_0x97c5('0x44')](_[_0x97c5('0x45')](_0xe9ee7b[_0x97c5('0x3b')],_0x5e859e[_0x97c5('0x44')]));if(_0xe9ee7b[_0x97c5('0x3b')][_0x97c5('0x46')]){_0x2cfdfc[_0x97c5('0x43')]=_[_0x97c5('0x47')](_0x2cfdfc[_0x97c5('0x43')],{'$or':_[_0x97c5('0x48')](_0x5d262a,function(_0x112f79){if(_0x112f79[_0x97c5('0x49')]['key']!==_0x97c5('0x4a')){var _0x4015a7={};_0x4015a7[_0x112f79['field']]={'$like':'%'+_0xe9ee7b[_0x97c5('0x3b')][_0x97c5('0x46')]+'%'};return _0x4015a7;}})});}_0x2cfdfc=_[_0x97c5('0x47')]({},_0x2cfdfc,_0xe9ee7b[_0x97c5('0x4b')]);var _0x3ab92e={'where':_0x2cfdfc[_0x97c5('0x43')]};return db['FaxAccount'][_0x97c5('0x4c')](_0x3ab92e)[_0x97c5('0x1c')](function(_0x5a1caf){_0x315682[_0x97c5('0x4c')]=_0x5a1caf;if(_0xe9ee7b[_0x97c5('0x3b')][_0x97c5('0x4d')]){_0x2cfdfc[_0x97c5('0x4e')]=[{'all':!![]}];}return db[_0x97c5('0x37')]['findAll'](_0x2cfdfc);})[_0x97c5('0x1c')](function(_0x514c44){_0x315682['rows']=_0x514c44;return _0x315682;})[_0x97c5('0x1c')](respondWithFilteredResult(_0x328f04,_0x2cfdfc))[_0x97c5('0x26')](handleError(_0x328f04,null));};exports['show']=function(_0x517618,_0x497708){var _0xa42a65={'raw':![],'where':{'id':_0x517618['params']['id']},'include':[{'model':db['Pause'],'as':_0x97c5('0x4f')}]},_0x11d737={};_0x11d737[_0x97c5('0x39')]=_[_0x97c5('0x3a')](db[_0x97c5('0x37')][_0x97c5('0x38')]);_0x11d737[_0x97c5('0x3b')]=_[_0x97c5('0x3a')](_0x517618['query']);_0x11d737[_0x97c5('0x44')]=_['intersection'](_0x11d737[_0x97c5('0x39')],_0x11d737[_0x97c5('0x3b')]);_0xa42a65['attributes']=_[_0x97c5('0x3c')](_0x11d737[_0x97c5('0x39')],qs[_0x97c5('0x3e')](_0x517618[_0x97c5('0x3b')][_0x97c5('0x3e')]));_0xa42a65[_0x97c5('0x3d')]=_0xa42a65[_0x97c5('0x3d')]['length']?_0xa42a65[_0x97c5('0x3d')]:_0x11d737[_0x97c5('0x39')];if(_0x517618['query'][_0x97c5('0x4d')]){_0xa42a65['include']=[{'all':!![]}];}_0xa42a65=_[_0x97c5('0x47')]({},_0xa42a65,_0x517618['options']);return db['FaxAccount'][_0x97c5('0x50')](_0xa42a65)[_0x97c5('0x1c')](handleEntityNotFound(_0x497708,null))[_0x97c5('0x1c')](respondWithResult(_0x497708,null))['catch'](handleError(_0x497708,null));};exports[_0x97c5('0x51')]=function(_0x128262,_0x4d0389){return db['FaxAccount']['create'](_0x128262['body'],{})[_0x97c5('0x1c')](function(_0xa07f0b){var _0x3302ef=_0x128262[_0x97c5('0x52')][_0x97c5('0x31')]({'plain':!![]});if(!_0x3302ef)throw new Error(_0x97c5('0x53'));if(_0x3302ef[_0x97c5('0x54')]===_0x97c5('0x52')){var _0x40994d=_0xa07f0b[_0x97c5('0x31')]({'plain':!![]});var _0x4f406a='FaxAccounts';return db[_0x97c5('0x55')][_0x97c5('0x50')]({'where':{'name':_0x4f406a,'userProfileId':_0x3302ef[_0x97c5('0x56')]},'raw':!![]})[_0x97c5('0x1c')](function(_0x19c976){if(_0x19c976&&_0x19c976['autoAssociation']===0x0){return db['UserProfileResource'][_0x97c5('0x51')]({'name':_0x40994d[_0x97c5('0x34')],'resourceId':_0x40994d['id'],'type':_0x19c976[_0x97c5('0x34')],'sectionId':_0x19c976['id']},{})['then'](function(){return _0xa07f0b;});}else{return _0xa07f0b;}})[_0x97c5('0x26')](function(_0x19711b){logger[_0x97c5('0x22')](_0x97c5('0x57'),_0x19711b);throw _0x19711b;});}return _0xa07f0b;})[_0x97c5('0x1c')](respondWithResult(_0x4d0389,0xc9))[_0x97c5('0x26')](handleError(_0x4d0389,null));};exports['update']=function(_0x53bc29,_0x5484f6){if(_0x53bc29[_0x97c5('0x58')]['id']){delete _0x53bc29[_0x97c5('0x58')]['id'];}return db[_0x97c5('0x37')][_0x97c5('0x50')]({'where':{'id':_0x53bc29[_0x97c5('0x59')]['id']},'include':[{'model':db[_0x97c5('0x36')],'as':_0x97c5('0x4f')}]})[_0x97c5('0x1c')](handleEntityNotFound(_0x5484f6,null))['then'](saveUpdates(_0x53bc29[_0x97c5('0x58')],null))[_0x97c5('0x1c')](respondWithResult(_0x5484f6,null))['catch'](handleError(_0x5484f6,null));};exports[_0x97c5('0x5a')]=function(_0x279b04,_0x4351e8){return db[_0x97c5('0x37')][_0x97c5('0x50')]({'where':{'id':_0x279b04[_0x97c5('0x59')]['id']}})['then'](handleEntityNotFound(_0x4351e8,null))['then'](removeEntity(_0x4351e8,null))[_0x97c5('0x26')](handleError(_0x4351e8,null));};exports[_0x97c5('0x5b')]=function(_0xa78ed2,_0x3a974e){return db[_0x97c5('0x37')][_0x97c5('0x5b')]()[_0x97c5('0x1c')](respondWithResult(_0x3a974e,null))[_0x97c5('0x26')](handleError(_0x3a974e,null));};exports[_0x97c5('0x5c')]=function(_0x11bb39,_0x595601,_0xa92ad8){if(_0x11bb39['body']['id']){delete _0x11bb39[_0x97c5('0x58')]['id'];}return db[_0x97c5('0x37')]['find']({'where':{'id':_0x11bb39[_0x97c5('0x59')]['id']}})['then'](handleEntityNotFound(_0x595601,null))[_0x97c5('0x1c')](function(_0x5ae8b8){if(_0x5ae8b8){_0x11bb39['body']['FaxAccountId']=_0x5ae8b8['id'];return db[_0x97c5('0x5d')]['create'](_0x11bb39[_0x97c5('0x58')]);}})['then'](respondWithResult(_0x595601,null))['catch'](handleError(_0x595601,null));};exports[_0x97c5('0x5e')]=function(_0x438ada,_0x139781,_0x496dfa){var _0x2a52dd={'raw':![],'where':{}};var _0x1234df={};var _0x3b653d={'count':0x0,'rows':[]};return db[_0x97c5('0x37')]['findOne']({'where':{'id':_0x438ada[_0x97c5('0x59')]['id']}})[_0x97c5('0x1c')](handleEntityNotFound(_0x139781,null))[_0x97c5('0x1c')](function(_0x2ab7d4){if(_0x2ab7d4){_0x1234df[_0x97c5('0x39')]=_['keys'](db[_0x97c5('0x5d')]['rawAttributes']);_0x1234df[_0x97c5('0x3b')]=_[_0x97c5('0x3a')](_0x438ada[_0x97c5('0x3b')]);_0x1234df[_0x97c5('0x44')]=_[_0x97c5('0x3c')](_0x1234df[_0x97c5('0x39')],_0x1234df['query']);_0x2a52dd['attributes']=_[_0x97c5('0x3c')](_0x1234df[_0x97c5('0x39')],qs['fields'](_0x438ada[_0x97c5('0x3b')][_0x97c5('0x3e')]));_0x2a52dd[_0x97c5('0x3d')]=_0x2a52dd[_0x97c5('0x3d')][_0x97c5('0x3f')]?_0x2a52dd[_0x97c5('0x3d')]:_0x1234df[_0x97c5('0x39')];if(!_0x438ada[_0x97c5('0x3b')]['hasOwnProperty'](_0x97c5('0x41'))){_0x2a52dd[_0x97c5('0x2b')]=qs['limit'](_0x438ada[_0x97c5('0x3b')][_0x97c5('0x2b')]);_0x2a52dd[_0x97c5('0x2a')]=qs[_0x97c5('0x2a')](_0x438ada['query'][_0x97c5('0x2a')]);}_0x2a52dd['order']=qs[_0x97c5('0x42')](_0x438ada[_0x97c5('0x3b')][_0x97c5('0x42')]);_0x2a52dd[_0x97c5('0x43')]=qs[_0x97c5('0x44')](_[_0x97c5('0x45')](_0x438ada['query'],_0x1234df['filters']));_0x2a52dd[_0x97c5('0x43')][_0x97c5('0x5f')]=_0x2ab7d4['id'];if(_0x438ada[_0x97c5('0x3b')]['filter']){_0x2a52dd['where']=_[_0x97c5('0x47')](_0x2a52dd[_0x97c5('0x43')],{'$or':_[_0x97c5('0x48')](_0x2a52dd[_0x97c5('0x3d')],function(_0x5d68ed){var _0x4c8d95={};_0x4c8d95[_0x5d68ed]={'$like':'%'+_0x438ada['query'][_0x97c5('0x46')]+'%'};return _0x4c8d95;})});}_0x2a52dd=_[_0x97c5('0x47')]({},_0x2a52dd,_0x438ada[_0x97c5('0x4b')]);return db[_0x97c5('0x5d')]['count']({'where':_0x2a52dd[_0x97c5('0x43')]})[_0x97c5('0x1c')](function(_0x3aeace){_0x3b653d[_0x97c5('0x4c')]=_0x3aeace;if(_0x438ada['query'][_0x97c5('0x4d')]){_0x2a52dd[_0x97c5('0x4e')]=[{'all':!![]}];}return db[_0x97c5('0x5d')]['findAll'](_0x2a52dd);})['then'](function(_0x5d1ea7){_0x3b653d[_0x97c5('0x60')]=_0x5d1ea7;return _0x3b653d;});}})[_0x97c5('0x1c')](respondWithFilteredResult(_0x139781,_0x2a52dd))['catch'](handleError(_0x139781,null));};exports[_0x97c5('0x61')]=function(_0x1ec7d3,_0x56721a,_0x184739){return db['FaxAccount'][_0x97c5('0x50')]({'where':{'id':_0x1ec7d3[_0x97c5('0x59')]['id']}})[_0x97c5('0x1c')](handleEntityNotFound(_0x56721a,null))[_0x97c5('0x1c')](function(_0x4881fb){if(_0x4881fb){return _0x4881fb['removeDispositions'](_0x1ec7d3[_0x97c5('0x3b')][_0x97c5('0x62')]);}})[_0x97c5('0x1c')](respondWithStatusCode(_0x56721a,null))[_0x97c5('0x26')](handleError(_0x56721a,null));};exports[_0x97c5('0x63')]=function(_0x3f2b17,_0x1cb50d,_0x42abcb){if(_0x3f2b17['body']['id']){delete _0x3f2b17['body']['id'];}return db['FaxAccount'][_0x97c5('0x50')]({'where':{'id':_0x3f2b17['params']['id']}})[_0x97c5('0x1c')](handleEntityNotFound(_0x1cb50d,null))[_0x97c5('0x1c')](function(_0x33b60a){if(_0x33b60a){_0x3f2b17['body'][_0x97c5('0x5f')]=_0x33b60a['id'];return db[_0x97c5('0x64')][_0x97c5('0x51')](_0x3f2b17[_0x97c5('0x58')]);}})[_0x97c5('0x1c')](respondWithResult(_0x1cb50d,null))[_0x97c5('0x26')](handleError(_0x1cb50d,null));};exports[_0x97c5('0x65')]=function(_0x1693d2,_0x5b81aa,_0x1a873e){var _0x295928={'raw':![],'where':{}};var _0x512204={};var _0x56a638={'count':0x0,'rows':[]};return db['FaxAccount'][_0x97c5('0x66')]({'where':{'id':_0x1693d2[_0x97c5('0x59')]['id']}})[_0x97c5('0x1c')](handleEntityNotFound(_0x5b81aa,null))['then'](function(_0x5b42c0){if(_0x5b42c0){_0x512204[_0x97c5('0x39')]=_[_0x97c5('0x3a')](db[_0x97c5('0x64')]['rawAttributes']);_0x512204[_0x97c5('0x3b')]=_[_0x97c5('0x3a')](_0x1693d2[_0x97c5('0x3b')]);_0x512204[_0x97c5('0x44')]=_[_0x97c5('0x3c')](_0x512204[_0x97c5('0x39')],_0x512204['query']);_0x295928['attributes']=_[_0x97c5('0x3c')](_0x512204['model'],qs[_0x97c5('0x3e')](_0x1693d2[_0x97c5('0x3b')][_0x97c5('0x3e')]));_0x295928[_0x97c5('0x3d')]=_0x295928[_0x97c5('0x3d')]['length']?_0x295928['attributes']:_0x512204[_0x97c5('0x39')];if(!_0x1693d2[_0x97c5('0x3b')][_0x97c5('0x40')](_0x97c5('0x41'))){_0x295928[_0x97c5('0x2b')]=qs[_0x97c5('0x2b')](_0x1693d2[_0x97c5('0x3b')][_0x97c5('0x2b')]);_0x295928['offset']=qs['offset'](_0x1693d2[_0x97c5('0x3b')][_0x97c5('0x2a')]);}_0x295928[_0x97c5('0x67')]=qs['sort'](_0x1693d2['query'][_0x97c5('0x42')]);_0x295928[_0x97c5('0x43')]=qs[_0x97c5('0x44')](_['pick'](_0x1693d2[_0x97c5('0x3b')],_0x512204[_0x97c5('0x44')]));_0x295928['where'][_0x97c5('0x5f')]=_0x5b42c0['id'];if(_0x1693d2['query'][_0x97c5('0x46')]){_0x295928[_0x97c5('0x43')]=_['merge'](_0x295928[_0x97c5('0x43')],{'$or':_['map'](_0x295928[_0x97c5('0x3d')],function(_0x21f9a9){var _0x37574e={};_0x37574e[_0x21f9a9]={'$like':'%'+_0x1693d2[_0x97c5('0x3b')]['filter']+'%'};return _0x37574e;})});}_0x295928=_[_0x97c5('0x47')]({},_0x295928,_0x1693d2[_0x97c5('0x4b')]);return db[_0x97c5('0x64')][_0x97c5('0x4c')]({'where':_0x295928[_0x97c5('0x43')]})[_0x97c5('0x1c')](function(_0x4ebb8c){_0x56a638[_0x97c5('0x4c')]=_0x4ebb8c;if(_0x1693d2['query'][_0x97c5('0x4d')]){_0x295928[_0x97c5('0x4e')]=[{'all':!![]}];}return db[_0x97c5('0x64')][_0x97c5('0x68')](_0x295928);})['then'](function(_0x147cbe){_0x56a638['rows']=_0x147cbe;return _0x56a638;});}})[_0x97c5('0x1c')](respondWithFilteredResult(_0x5b81aa,_0x295928))[_0x97c5('0x26')](handleError(_0x5b81aa,null));};exports[_0x97c5('0x69')]=function(_0x37e619,_0x219e3d,_0xa02222){return db['FaxAccount'][_0x97c5('0x50')]({'where':{'id':_0x37e619[_0x97c5('0x59')]['id']}})['then'](handleEntityNotFound(_0x219e3d,null))['then'](function(_0x29e122){if(_0x29e122){return _0x29e122[_0x97c5('0x69')](_0x37e619[_0x97c5('0x3b')][_0x97c5('0x62')]);}})[_0x97c5('0x1c')](respondWithStatusCode(_0x219e3d,null))[_0x97c5('0x26')](handleError(_0x219e3d,null));};exports['addInteraction']=function(_0x4c1d6f,_0x1b1aad,_0x1bb24a){return db[_0x97c5('0x6a')][_0x97c5('0x50')]({'where':{'id':_0x4c1d6f[_0x97c5('0x59')]['id']}})['then'](handleEntityNotFound(_0x1b1aad,null))['then'](function(_0x47ab84){if(_0x47ab84){return _0x47ab84[_0x97c5('0x6b')](_0x4c1d6f[_0x97c5('0x58')][_0x97c5('0x62')],_[_0x97c5('0x6c')](_0x4c1d6f[_0x97c5('0x58')],[_0x97c5('0x62'),'id'])||{});}})[_0x97c5('0x1c')](respondWithResult(_0x1b1aad,null))[_0x97c5('0x26')](handleError(_0x1b1aad,null));};exports[_0x97c5('0x6d')]=function(_0x217aba,_0x45e055,_0x25152f){var _0x2b94b2={'raw':![],'where':{}};var _0x352240={};var _0x123413={'count':0x0,'rows':[]};return db['FaxAccount'][_0x97c5('0x66')]({'where':{'id':_0x217aba[_0x97c5('0x59')]['id']}})[_0x97c5('0x1c')](handleEntityNotFound(_0x45e055,null))[_0x97c5('0x1c')](function(_0x37cf9d){if(_0x37cf9d){_0x352240[_0x97c5('0x39')]=_[_0x97c5('0x3a')](db[_0x97c5('0x6a')]['rawAttributes']);_0x352240[_0x97c5('0x3b')]=_[_0x97c5('0x3a')](_0x217aba[_0x97c5('0x3b')]);_0x352240[_0x97c5('0x44')]=_[_0x97c5('0x3c')](_0x352240[_0x97c5('0x39')],_0x352240[_0x97c5('0x3b')]);_0x2b94b2[_0x97c5('0x3d')]=_[_0x97c5('0x3c')](_0x352240[_0x97c5('0x39')],qs[_0x97c5('0x3e')](_0x217aba[_0x97c5('0x3b')][_0x97c5('0x3e')]));_0x2b94b2[_0x97c5('0x3d')]=_0x2b94b2['attributes']['length']?_0x2b94b2[_0x97c5('0x3d')]:_0x352240[_0x97c5('0x39')];if(!_0x217aba[_0x97c5('0x3b')][_0x97c5('0x40')](_0x97c5('0x41'))){_0x2b94b2[_0x97c5('0x2b')]=qs[_0x97c5('0x2b')](_0x217aba[_0x97c5('0x3b')][_0x97c5('0x2b')]);_0x2b94b2['offset']=qs[_0x97c5('0x2a')](_0x217aba['query'][_0x97c5('0x2a')]);}_0x2b94b2['order']=qs[_0x97c5('0x42')](_0x217aba['query'][_0x97c5('0x42')]);_0x2b94b2[_0x97c5('0x43')]=qs['filters'](_[_0x97c5('0x45')](_0x217aba['query'],_0x352240['filters']));_0x2b94b2[_0x97c5('0x43')][_0x97c5('0x5f')]=_0x37cf9d['id'];if(_0x217aba['query'][_0x97c5('0x46')]){_0x2b94b2[_0x97c5('0x43')]=_[_0x97c5('0x47')](_0x2b94b2[_0x97c5('0x43')],{'$or':_['map'](_0x2b94b2['attributes'],function(_0xf1861d){var _0x454d1f={};_0x454d1f[_0xf1861d]={'$like':'%'+_0x217aba['query'][_0x97c5('0x46')]+'%'};return _0x454d1f;})});}_0x2b94b2=_['merge']({},_0x2b94b2,_0x217aba[_0x97c5('0x4b')]);return db['FaxInteraction'][_0x97c5('0x4c')]({'where':_0x2b94b2['where']})['then'](function(_0x1b9274){_0x123413[_0x97c5('0x4c')]=_0x1b9274;if(_0x217aba[_0x97c5('0x3b')][_0x97c5('0x4d')]){_0x2b94b2[_0x97c5('0x4e')]=[{'model':db[_0x97c5('0x6e')],'as':'Contact','required':![]},{'model':db[_0x97c5('0x6f')],'as':_0x97c5('0x70'),'attributes':[_0x97c5('0x34'),'fullname',_0x97c5('0x71')],'required':![]},{'model':db[_0x97c5('0x72')],'as':_0x97c5('0x73'),'attributes':['id',_0x97c5('0x34'),_0x97c5('0x74')],'where':_0x217aba[_0x97c5('0x3b')][_0x97c5('0x75')]?{'id':_0x217aba[_0x97c5('0x3b')]['tag']}:undefined,'required':_0x217aba[_0x97c5('0x3b')][_0x97c5('0x75')]?!![]:![]}];}return db[_0x97c5('0x6a')][_0x97c5('0x68')](_0x2b94b2);})['then'](function(_0x2f3355){_0x123413[_0x97c5('0x60')]=_0x2f3355;return _0x123413;});}})[_0x97c5('0x1c')](respondWithFilteredResult(_0x45e055,_0x2b94b2))[_0x97c5('0x26')](handleError(_0x45e055,null));};exports[_0x97c5('0x76')]=function(_0x4dce9d,_0x4743d3,_0x4b6ade){return db['FaxAccount']['findOne']({'where':{'id':_0x4dce9d['params']['id']}})[_0x97c5('0x1c')](handleEntityNotFound(_0x4743d3,null))[_0x97c5('0x1c')](function(_0x18606e){if(_0x18606e){return db['sequelize'][_0x97c5('0x77')](function(_0x2732b1){return db[_0x97c5('0x78')]['destroy']({'where':{'FaxAccountId':_0x4dce9d[_0x97c5('0x59')]['id']},'transaction':_0x2732b1})['then'](function(_0x2aa652){var _0x33757c=_['map'](_0x4dce9d[_0x97c5('0x58')],function(_0x51d97a){_0x51d97a[_0x97c5('0x5f')]=_0x4dce9d[_0x97c5('0x59')]['id'];return _0x51d97a;});return db[_0x97c5('0x78')][_0x97c5('0x79')](_0x33757c,{'transaction':_0x2732b1});});})[_0x97c5('0x1c')](function(){return db[_0x97c5('0x78')][_0x97c5('0x7a')]({'where':{'FaxAccountId':_0x4dce9d[_0x97c5('0x59')]['id']},'order':_0x97c5('0x7b')});});}})['then'](respondWithResult(_0x4743d3,null))[_0x97c5('0x26')](handleError(_0x4743d3,null));};exports[_0x97c5('0x7c')]=function(_0x3d5d1e,_0x18755e,_0x1ec9c5){var _0x427c48={};var _0x41a592={};var _0x41dbc9;var _0x1c56a8;return db['FaxAccount'][_0x97c5('0x66')]({'where':{'id':_0x3d5d1e[_0x97c5('0x59')]['id']}})[_0x97c5('0x1c')](handleEntityNotFound(_0x18755e,null))['then'](function(_0x3a3158){if(_0x3a3158){_0x41dbc9=_0x3a3158;_0x41a592[_0x97c5('0x39')]=_[_0x97c5('0x3a')](db[_0x97c5('0x78')]['rawAttributes']);_0x41a592[_0x97c5('0x3b')]=_[_0x97c5('0x3a')](_0x3d5d1e[_0x97c5('0x3b')]);_0x41a592[_0x97c5('0x44')]=_[_0x97c5('0x3c')](_0x41a592[_0x97c5('0x39')],_0x41a592[_0x97c5('0x3b')]);_0x427c48[_0x97c5('0x3d')]=_['intersection'](_0x41a592[_0x97c5('0x39')],qs[_0x97c5('0x3e')](_0x3d5d1e['query'][_0x97c5('0x3e')]));_0x427c48[_0x97c5('0x3d')]=_0x427c48[_0x97c5('0x3d')][_0x97c5('0x3f')]?_0x427c48[_0x97c5('0x3d')]:_0x41a592[_0x97c5('0x39')];_0x427c48[_0x97c5('0x67')]=qs['sort'](_0x3d5d1e[_0x97c5('0x3b')][_0x97c5('0x42')]);_0x427c48[_0x97c5('0x43')]=qs['filters'](_[_0x97c5('0x45')](_0x3d5d1e[_0x97c5('0x3b')],_0x41a592[_0x97c5('0x44')]));if(_0x3d5d1e[_0x97c5('0x3b')][_0x97c5('0x46')]){_0x427c48[_0x97c5('0x43')]=_[_0x97c5('0x47')](_0x427c48[_0x97c5('0x43')],{'$or':_[_0x97c5('0x48')](_0x427c48[_0x97c5('0x3d')],function(_0x20566d){var _0x11fdb7={};_0x11fdb7[_0x20566d]={'$like':'%'+_0x3d5d1e[_0x97c5('0x3b')][_0x97c5('0x46')]+'%'};return _0x11fdb7;})});}_0x427c48=_[_0x97c5('0x47')]({},_0x427c48,_0x3d5d1e[_0x97c5('0x4b')]);return _0x41dbc9['getApplications'](_0x427c48);}})['then'](function(_0x7fdb8b){if(_0x7fdb8b){_0x1c56a8=_0x7fdb8b[_0x97c5('0x3f')];if(!_0x3d5d1e[_0x97c5('0x3b')][_0x97c5('0x40')](_0x97c5('0x41'))){_0x427c48[_0x97c5('0x2b')]=qs[_0x97c5('0x2b')](_0x3d5d1e[_0x97c5('0x3b')][_0x97c5('0x2b')]);_0x427c48[_0x97c5('0x2a')]=qs['offset'](_0x3d5d1e[_0x97c5('0x3b')][_0x97c5('0x2a')]);}return _0x41dbc9[_0x97c5('0x7c')](_0x427c48);}})[_0x97c5('0x1c')](function(_0x3e16b9){if(_0x3e16b9){return _0x3e16b9?{'count':_0x1c56a8,'rows':_0x3e16b9}:null;}})[_0x97c5('0x1c')](respondWithResult(_0x18755e,null))[_0x97c5('0x26')](handleError(_0x18755e,null));};function Extension(_0x15fc10,_0x581f20,_0x7ac545,_0x12364f){this[_0x97c5('0x7d')]=_0x97c5('0x7e');this[_0x97c5('0x7f')]=_0x15fc10[_0x97c5('0x80')];this[_0x97c5('0x81')]=_0x12364f;this[_0x97c5('0x49')]='system';this[_0x97c5('0x82')]=_0x97c5('0x83');this[_0x97c5('0x5f')]=_0x15fc10['id'];this['priority']=_0x581f20;this[_0x97c5('0x84')]=_0x7ac545;}function createExtensionsReciveFax(_0xafba3f){var _0x171306=0x1;var _0x2223a7=[];_0x2223a7[_0x97c5('0x85')](new Extension(_0xafba3f,_0x171306,'','Answer'));_0x171306+=0x1;_0x2223a7['push'](new Extension(_0xafba3f,_0x171306,_0x97c5('0x86'),_0x97c5('0x87')));_0x171306+=0x1;for(var _0x2b6f0d in _0xafba3f){if(_0xafba3f[_0x97c5('0x40')](_0x2b6f0d)&&(_0x2b6f0d==='ecm'||_0x2b6f0d===_0x97c5('0x80')||_0x2b6f0d===_0x97c5('0x88')||_0x2b6f0d===_0x97c5('0x89')||_0x2b6f0d===_0x97c5('0x8a')||_0x2b6f0d===_0x97c5('0x8b')||_0x2b6f0d===_0x97c5('0x8c')||_0x2b6f0d===_0x97c5('0x8d')||_0x2b6f0d==='t38timeout')){_0x2223a7[_0x97c5('0x85')](new Extension(_0xafba3f,_0x171306,_0x97c5('0x8e')+_0x2b6f0d+')='+_0xafba3f[_0x2b6f0d],'Set'));_0x171306+=0x1;}}_0x2223a7[_0x97c5('0x85')](new Extension(_0xafba3f,_0x171306,'6','Wait'));_0x171306+=0x1;_0x2223a7['push'](new Extension(_0xafba3f,_0x171306,'/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',_0x97c5('0x8f')));_0x171306=0x0;return _0x2223a7;}exports[_0x97c5('0x90')]=function(_0x1f4c0c,_0x4baebf,_0x277a25){var _0xf04cf2;return db[_0x97c5('0x91')]['transaction'](function(_0x1d7ea5){return db[_0x97c5('0x37')][_0x97c5('0x51')](_0x1f4c0c[_0x97c5('0x58')],{'transaction':_0x1d7ea5})[_0x97c5('0x1c')](function(_0x4d5c81){_0xf04cf2=_0x4d5c81[_0x97c5('0x31')]({'plain':!![]});return db[_0x97c5('0x92')][_0x97c5('0x79')](createExtensionsReciveFax(_0xf04cf2),{'transaction':_0x1d7ea5});});})['then'](function(){return _0xf04cf2;})[_0x97c5('0x1c')](respondWithResult(_0x4baebf,null))[_0x97c5('0x26')](handleError(_0x4baebf,null));};exports[_0x97c5('0x93')]=function(_0x3a0c9d,_0x1bad35,_0x50ff35){var _0x614afd;return db[_0x97c5('0x91')][_0x97c5('0x77')](function(_0x6ee32){return db[_0x97c5('0x37')]['update'](_0x3a0c9d[_0x97c5('0x58')],{'where':{'id':_0x3a0c9d[_0x97c5('0x58')]['id']},'transaction':_0x6ee32})[_0x97c5('0x1c')](function(_0x1a87f2){return db[_0x97c5('0x92')][_0x97c5('0x5a')]({'where':{'FaxAccountId':_0x3a0c9d['body']['id']},'transaction':_0x6ee32})[_0x97c5('0x1c')](function(_0x571be0){return db[_0x97c5('0x92')][_0x97c5('0x79')](createExtensionsReciveFax(_[_0x97c5('0x6c')](_0x3a0c9d['body'],[_0x97c5('0x94'),'key',_0x97c5('0x95'),_0x97c5('0x96'),_0x97c5('0x97'),_0x97c5('0x98')])),{'transaction':_0x6ee32});});});})[_0x97c5('0x1c')](function(){return db[_0x97c5('0x37')]['findById'](_0x3a0c9d['body']['id']);})[_0x97c5('0x1c')](respondWithResult(_0x1bad35,null))[_0x97c5('0x26')](handleError(_0x1bad35,null));};exports[_0x97c5('0x99')]=function(_0x543053,_0x450edf,_0x2b30bc){var _0x55b36f={'raw':!![],'where':{}};var _0x45e123={};var _0x232c85={'count':0x0,'rows':[]};return db['FaxAccount'][_0x97c5('0x66')]({'where':{'id':_0x543053[_0x97c5('0x59')]['id']}})[_0x97c5('0x1c')](handleEntityNotFound(_0x450edf,null))[_0x97c5('0x1c')](function(_0x4e66cf){if(_0x4e66cf){_0x45e123[_0x97c5('0x39')]=_[_0x97c5('0x3a')](db[_0x97c5('0x9a')]['rawAttributes']);_0x45e123['query']=_['keys'](_0x543053[_0x97c5('0x3b')]);_0x45e123[_0x97c5('0x44')]=_['intersection'](_0x45e123[_0x97c5('0x39')],_0x45e123[_0x97c5('0x3b')]);_0x55b36f[_0x97c5('0x3d')]=_[_0x97c5('0x3c')](_0x45e123[_0x97c5('0x39')],qs[_0x97c5('0x3e')](_0x543053['query'][_0x97c5('0x3e')]));_0x55b36f['attributes']=_0x55b36f[_0x97c5('0x3d')][_0x97c5('0x3f')]?_0x55b36f['attributes']:_0x45e123['model'];if(!_0x543053['query'][_0x97c5('0x40')](_0x97c5('0x41'))){_0x55b36f['limit']=qs[_0x97c5('0x2b')](_0x543053['query'][_0x97c5('0x2b')]);_0x55b36f[_0x97c5('0x2a')]=qs['offset'](_0x543053[_0x97c5('0x3b')][_0x97c5('0x2a')]);}_0x55b36f[_0x97c5('0x67')]=qs['sort'](_0x543053[_0x97c5('0x3b')]['sort']);_0x55b36f[_0x97c5('0x43')]=qs[_0x97c5('0x44')](_[_0x97c5('0x45')](_0x543053[_0x97c5('0x3b')],_0x45e123[_0x97c5('0x44')]));_0x55b36f['where'][_0x97c5('0x5f')]=_0x4e66cf['id'];if(_0x543053[_0x97c5('0x3b')][_0x97c5('0x46')]){_0x55b36f['where']=_[_0x97c5('0x47')](_0x55b36f[_0x97c5('0x43')],{'$or':_['map'](_0x55b36f['attributes'],function(_0x3ed542){var _0x558ba7={};_0x558ba7[_0x3ed542]={'$like':'%'+_0x543053[_0x97c5('0x3b')][_0x97c5('0x46')]+'%'};return _0x558ba7;})});}if(_0x543053['query'][_0x97c5('0x9b')]){var _0xfcb7e3=_0x543053[_0x97c5('0x3b')]['$gte']['split'](',');var _0xd0e275={};_0xd0e275[_0xfcb7e3[0x0]]={'$gte':moment(_0xfcb7e3[0x1])[_0x97c5('0x9c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x55b36f[_0x97c5('0x43')]=_[_0x97c5('0x47')](_0x55b36f[_0x97c5('0x43')],_0xd0e275);}_0x55b36f=_[_0x97c5('0x47')]({},_0x55b36f,_0x543053[_0x97c5('0x4b')]);return db[_0x97c5('0x9a')]['count']({'where':_0x55b36f[_0x97c5('0x43')]})['then'](function(_0x5c1509){_0x232c85['count']=_0x5c1509;if(_0x543053[_0x97c5('0x3b')][_0x97c5('0x4d')]){_0x55b36f[_0x97c5('0x4e')]=[{'all':!![]}];}return db[_0x97c5('0x9a')][_0x97c5('0x68')](_0x55b36f);})[_0x97c5('0x1c')](function(_0x23d498){_0x232c85[_0x97c5('0x60')]=_0x23d498;return _0x232c85;});}})[_0x97c5('0x1c')](respondWithFilteredResult(_0x450edf,_0x55b36f))[_0x97c5('0x26')](handleError(_0x450edf,null));};exports[_0x97c5('0x9d')]=function(_0x81c78b,_0x14bc94,_0xe28fd4){var _0xa07673,_0x54f7c9={},_0x354b54;if(_0x81c78b['body']['to']){_0x354b54=_0x81c78b[_0x97c5('0x58')]['to'][0x0];}return db['FaxAccount'][_0x97c5('0x50')]({'where':{'id':_0x81c78b[_0x97c5('0x59')]['id']},'include':[{'model':db[_0x97c5('0x9e')],'as':'List','include':[{'model':db[_0x97c5('0x6e')],'as':_0x97c5('0x9f'),'where':{'fax':_0x354b54},'limit':0x1,'order':[[_0x97c5('0x96'),_0x97c5('0xa0')]]}]}]})[_0x97c5('0x1c')](handleEntityNotFound(_0x14bc94,null))[_0x97c5('0x1c')](function(_0x43a952){_0xa07673=_0x43a952;if(_0x81c78b['body'][_0x97c5('0xa1')]&&_0x81c78b['body'][_0x97c5('0xa1')][_0x97c5('0x3f')]){for(var _0x520ce3=0x0;_0x520ce3<_0x81c78b[_0x97c5('0x58')]['attachments'][_0x97c5('0x3f')];_0x520ce3+=0x1){_0x81c78b[_0x97c5('0x58')][_0x97c5('0xa1')][_0x520ce3]={'filename':_0x81c78b['body'][_0x97c5('0xa1')][_0x520ce3][_0x97c5('0x34')],'id':_0x81c78b[_0x97c5('0x58')][_0x97c5('0xa1')][_0x520ce3]['id'],'path':path[_0x97c5('0xa2')](config[_0x97c5('0xa3')],'server/files/attachments',_0x81c78b[_0x97c5('0x58')][_0x97c5('0xa1')][_0x520ce3][_0x97c5('0xa4')])};}}return respondWithRpcPromise(_0x97c5('0xa5'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x81c78b[_0x97c5('0x59')]['id'])?undefined:_0x81c78b['params']['id'],'path':_[_0x97c5('0xa6')](_0x81c78b[_0x97c5('0x58')][_0x97c5('0xa1')][0x0][_0x97c5('0x4')])?undefined:_0x81c78b[_0x97c5('0x58')][_0x97c5('0xa1')][0x0][_0x97c5('0x4')],'fax':_[_0x97c5('0xa6')](_0x81c78b['body']['to'][0x0])?undefined:_0x81c78b[_0x97c5('0x58')]['to'][0x0]},client9002);})[_0x97c5('0x1c')](function(){if(_0xa07673){if(_[_0x97c5('0xa6')](_0x81c78b[_0x97c5('0x58')][_0x97c5('0xa7')])){_0x81c78b[_0x97c5('0x58')][_0x97c5('0xa7')]=util[_0x97c5('0x9c')](_0x97c5('0xa8'),_0xa07673['name'],_0xa07673[_0x97c5('0xa9')]);}if(_0xa07673['List']){if(_0xa07673['List'][_0x97c5('0x9f')]['length']){return _0xa07673[_0x97c5('0xaa')][_0x97c5('0x9f')][0x0];}else{return db[_0x97c5('0x6e')][_0x97c5('0x51')](_[_0x97c5('0x15')](_0x81c78b['body'],{'firstName':_0x81c78b[_0x97c5('0x58')]['to'][0x0],'phone':_0x81c78b[_0x97c5('0x58')]['to'][0x0],'fax':_0x81c78b[_0x97c5('0x58')]['to'][0x0],'ListId':_0xa07673[_0x97c5('0x98')]}));}}else{throw new Error(_0x97c5('0xab'));}}else{throw new Error(_0x97c5('0xac'));}})[_0x97c5('0x1c')](function(_0x64906a){if(_0x64906a){return db[_0x97c5('0x6a')][_0x97c5('0x50')]({'where':{'ContactId':_0x64906a['id'],'closed':![],'FaxAccountId':_0xa07673['id']}})[_0x97c5('0x1c')](function(_0x3cfbda){if(_0x3cfbda){return[_0x3cfbda,![]];}return db[_0x97c5('0x6a')][_0x97c5('0x51')]({'UserId':_0x81c78b[_0x97c5('0x52')]['id'],'ContactId':_0x64906a['id'],'FaxAccountId':_0xa07673['id'],'fax':_0x81c78b['body']['to'][0x0],'firstMsgDirection':_0x97c5('0xad'),'Messages':[_[_0x97c5('0x47')](_0x81c78b['body'],{'read':![],'body':_0x81c78b[_0x97c5('0x58')][_0x97c5('0xa1')][0x0][_0x97c5('0xae')],'FaxAccountId':_0xa07673['id'],'UserId':_0x81c78b[_0x97c5('0x52')]['id'],'ContactId':_0x64906a['id'],'AttachmentId':_0x81c78b[_0x97c5('0x58')][_0x97c5('0xa1')][0x0]['id']})]},{'include':[{'model':db[_0x97c5('0x9a')],'as':'Messages'}]})[_0x97c5('0x1c')](function(_0x1d5763){return[_0x1d5763,!![]];});});}else{throw new Error(_0x97c5('0xaf'));}})[_0x97c5('0xb0')](function(_0x1bf133,_0x102df5){if(_0x102df5){return _0x1bf133;}return db[_0x97c5('0x9a')]['create']({'direction':_0x97c5('0xad'),'read':![],'body':_0x81c78b['body'][_0x97c5('0xa1')][0x0][_0x97c5('0xae')],'FaxAccountId':_0xa07673['id'],'FaxInteractionId':_0x1bf133['id'],'UserId':_0x81c78b[_0x97c5('0x52')]['id'],'ContactId':_0x1bf133[_0x97c5('0xb1')],'AttachmentId':_0x81c78b[_0x97c5('0x58')][_0x97c5('0xa1')][0x0]['id']})[_0x97c5('0x1c')](function(_0x4204e1){_0x1bf133[_0x97c5('0xb2')][_0x97c5('0xb3')]=[];_0x1bf133[_0x97c5('0xb2')]['Messages'][_0x97c5('0x85')](_0x4204e1[_0x97c5('0xb2')]);return _0x1bf133;});})[_0x97c5('0x1c')](function(_0x309a71){respondWithRpcPromise(_0x97c5('0xb4'),_0x97c5('0xb4'),{'FaxAccountId':_[_0x97c5('0xa6')](_0x81c78b[_0x97c5('0x59')]['id'])?undefined:_0x81c78b[_0x97c5('0x59')]['id'],'path':_['isNil'](_0x81c78b[_0x97c5('0x58')][_0x97c5('0xa1')][0x0][_0x97c5('0x4')])?undefined:_0x81c78b[_0x97c5('0x58')][_0x97c5('0xa1')][0x0][_0x97c5('0x4')],'fax':_['isNil'](_0x81c78b[_0x97c5('0x58')]['to'][0x0])?undefined:_0x81c78b['body']['to'][0x0],'AttachmentId':_0x81c78b['body'][_0x97c5('0xa1')][0x0]['id']},client9002)[_0x97c5('0x1c')](function(_0x17cc55){logger[_0x97c5('0x1d')](_0x97c5('0xb5'),_0x17cc55);})['catch'](function(_0x3a71c3){logger[_0x97c5('0x1d')](_0x97c5('0xb5'),_0x3a71c3);});return _0x309a71;})[_0x97c5('0x1c')](respondWithResult(_0x14bc94,null))['catch'](handleError(_0x14bc94,null));};exports[_0x97c5('0xb6')]=function(_0x1f39e4,_0x41e129,_0x292ca2){return db[_0x97c5('0x37')][_0x97c5('0x50')]({'where':{'id':_0x1f39e4[_0x97c5('0x59')]['id']}})[_0x97c5('0x1c')](handleEntityNotFound(_0x41e129,null))[_0x97c5('0x1c')](function(_0x4364e6){if(_0x4364e6){return _0x4364e6[_0x97c5('0xb6')](_0x1f39e4['body'][_0x97c5('0x62')],_[_0x97c5('0x6c')](_0x1f39e4['body'],['ids','id'])||{})[_0x97c5('0xb0')](function(_0x3a0e48){for(var _0x570a00=0x0;_0x570a00<_0x1f39e4[_0x97c5('0x58')][_0x97c5('0x62')]['length'];_0x570a00+=0x1){socket[_0x97c5('0xb7')](_0x97c5('0xb8'),{'UserId':_0x1f39e4[_0x97c5('0x58')]['ids'][_0x570a00],'FaxAccountId':_0x1f39e4[_0x97c5('0x59')]['id']});}return _0x3a0e48;});}})['then'](respondWithResult(_0x41e129,null))[_0x97c5('0x26')](handleError(_0x41e129,null));};exports['removeAgents']=function(_0x1fd787,_0x15b80e,_0x467e19){return db['FaxAccount'][_0x97c5('0x50')]({'where':{'id':_0x1fd787['params']['id']}})[_0x97c5('0x1c')](handleEntityNotFound(_0x15b80e,null))[_0x97c5('0x1c')](function(_0x5d427b){if(_0x5d427b){return _0x5d427b['removeAgents'](_0x1fd787['query'][_0x97c5('0x62')])[_0x97c5('0x1c')](function(){if(_[_0x97c5('0xb9')](_0x1fd787[_0x97c5('0x3b')]['ids'])){for(var _0x2cca76=0x0;_0x2cca76<_0x1fd787[_0x97c5('0x3b')][_0x97c5('0x62')][_0x97c5('0x3f')];_0x2cca76+=0x1){socket['emit'](_0x97c5('0xba'),{'UserId':Number(_0x1fd787['query']['ids'][_0x2cca76]),'FaxAccountId':Number(_0x1fd787[_0x97c5('0x59')]['id'])});}}else{socket[_0x97c5('0xb7')]('userFaxAccount:remove',{'UserId':Number(_0x1fd787[_0x97c5('0x3b')][_0x97c5('0x62')]),'FaxAccountId':Number(_0x1fd787[_0x97c5('0x59')]['id'])});}});}})[_0x97c5('0x1c')](respondWithStatusCode(_0x15b80e,null))[_0x97c5('0x26')](handleError(_0x15b80e,null));};exports[_0x97c5('0xbb')]=function(_0x1c36bc,_0x44c315,_0x30db98){var _0xe6fcb1={};var _0x4fbcee={};var _0x3f25eb;var _0x4fc54b;return db[_0x97c5('0x37')][_0x97c5('0x66')]({'where':{'id':_0x1c36bc[_0x97c5('0x59')]['id']}})['then'](handleEntityNotFound(_0x44c315,null))[_0x97c5('0x1c')](function(_0x4aa433){if(_0x4aa433){_0x3f25eb=_0x4aa433;_0x4fbcee[_0x97c5('0x39')]=_[_0x97c5('0x3a')](db[_0x97c5('0x6f')][_0x97c5('0x38')]);_0x4fbcee[_0x97c5('0x3b')]=_[_0x97c5('0x3a')](_0x1c36bc['query']);_0x4fbcee['filters']=_[_0x97c5('0x3c')](_0x4fbcee['model'],_0x4fbcee[_0x97c5('0x3b')]);_0xe6fcb1[_0x97c5('0x3d')]=_['intersection'](_0x4fbcee['model'],qs['fields'](_0x1c36bc[_0x97c5('0x3b')][_0x97c5('0x3e')]));_0xe6fcb1['attributes']=_0xe6fcb1['attributes']['length']?_0xe6fcb1[_0x97c5('0x3d')]:_0x4fbcee[_0x97c5('0x39')];_0xe6fcb1['order']=qs[_0x97c5('0x42')](_0x1c36bc[_0x97c5('0x3b')][_0x97c5('0x42')]);_0xe6fcb1[_0x97c5('0x43')]=qs[_0x97c5('0x44')](_['pick'](_0x1c36bc['query'],_0x4fbcee[_0x97c5('0x44')]));if(_0x1c36bc['query'][_0x97c5('0x46')]){_0xe6fcb1[_0x97c5('0x43')]=_['merge'](_0xe6fcb1['where'],{'$or':_[_0x97c5('0x48')](_0xe6fcb1['attributes'],function(_0x1ff9c1){var _0x18a9c4={};_0x18a9c4[_0x1ff9c1]={'$like':'%'+_0x1c36bc[_0x97c5('0x3b')][_0x97c5('0x46')]+'%'};return _0x18a9c4;})});}_0xe6fcb1=_[_0x97c5('0x47')]({},_0xe6fcb1,_0x1c36bc[_0x97c5('0x4b')]);return _0x3f25eb[_0x97c5('0xbb')](_0xe6fcb1);}})[_0x97c5('0x1c')](function(_0x3e543d){if(_0x3e543d){_0x4fc54b=_0x3e543d['length'];if(!_0x1c36bc[_0x97c5('0x3b')][_0x97c5('0x40')](_0x97c5('0x41'))){_0xe6fcb1[_0x97c5('0x2b')]=qs[_0x97c5('0x2b')](_0x1c36bc[_0x97c5('0x3b')][_0x97c5('0x2b')]);_0xe6fcb1[_0x97c5('0x2a')]=qs[_0x97c5('0x2a')](_0x1c36bc[_0x97c5('0x3b')]['offset']);}return _0x3f25eb['getAgents'](_0xe6fcb1);}})[_0x97c5('0x1c')](function(_0x552ca0){if(_0x552ca0){return _0x552ca0?{'count':_0x4fc54b,'rows':_0x552ca0}:null;}})['then'](respondWithResult(_0x44c315,null))[_0x97c5('0x26')](handleError(_0x44c315,null));}; \ No newline at end of file +var _0x26bf=['find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','getDispositions','Disposition','findAll','removeDispositions','ids','addAnswer','CannedAnswer','order','removeAnswers','addInteraction','omit','getInteractions','findOne','FaxInteraction','CmContact','Contact','Owner','fullname','internal','color','tag','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','priority','FaxApplication','getApplications','from-voip-provider','exten','localstationid','app','system','description','push','Answer','CDR(type)=inbound-fax','gateway','faxdetect','headerinfo','maxrate','Set','addAccountApplications','VoiceExtension','tech','updatedAt','TrunkId','findById','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','List','Contacts','attachments','root','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','ListId','List\x20not\x20found','out','Messages','Contact\x20not\x20found','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','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','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','http','client','test','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','FaxAccount','includeAll','rows','catch','show','params','rawAttributes','length','include'];(function(_0x4e98b7,_0x1a8b85){var _0x79a066=function(_0x3b2fb6){while(--_0x3b2fb6){_0x4e98b7['push'](_0x4e98b7['shift']());}};_0x79a066(++_0x1a8b85);}(_0x26bf,0x1d4));var _0xf26b=function(_0x2185af,_0x265762){_0x2185af=_0x2185af-0x0;var _0x24a66f=_0x26bf[_0x2185af];return _0x24a66f;};'use strict';var pdf=require(_0xf26b('0x0'));var emlformat=require(_0xf26b('0x1'));var rimraf=require(_0xf26b('0x2'));var zipdir=require(_0xf26b('0x3'));var jsonpatch=require(_0xf26b('0x4'));var rp=require(_0xf26b('0x5'));var moment=require(_0xf26b('0x6'));var BPromise=require(_0xf26b('0x7'));var Mustache=require(_0xf26b('0x8'));var util=require(_0xf26b('0x9'));var path=require(_0xf26b('0xa'));var sox=require(_0xf26b('0xb'));var csv=require(_0xf26b('0xc'));var ejs=require(_0xf26b('0xd'));var fs=require('fs');var _=require(_0xf26b('0xe'));var squel=require(_0xf26b('0xf'));var crypto=require(_0xf26b('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xf26b('0x11'));var toCsv=require(_0xf26b('0xc'));var querystring=require(_0xf26b('0x12'));var Papa=require(_0xf26b('0x13'));var Redis=require(_0xf26b('0x14'));var authService=require(_0xf26b('0x15'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf26b('0x16'));var logger=require(_0xf26b('0x17'))(_0xf26b('0x18'));var utils=require(_0xf26b('0x19'));var config=require('../../config/environment');var db=require(_0xf26b('0x1a'))['db'];config['redis']=_[_0xf26b('0x1b')](config[_0xf26b('0x1c')],{'host':_0xf26b('0x1d'),'port':0x18eb});var socket=require(_0xf26b('0x1e'))(new Redis(config[_0xf26b('0x1c')]));require(_0xf26b('0x1f'))['register'](socket);var jayson=require(_0xf26b('0x20'));var client=jayson['client'][_0xf26b('0x21')]({'port':0x232c});var client9002=jayson[_0xf26b('0x22')][_0xf26b('0x21')]({'port':0x232a});function checkPasswordPattern(_0x4c4314,_0x408f4e,_0xbd55b2){if(_0xbd55b2){var _0x276410=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x276410[_0xf26b('0x23')](_0x408f4e)){return _0x4c4314;}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 _0x4c4314;}}function respondWithRpcPromise(_0x7d2ea9,_0x265639,_0x34a9f1,_0x46a3c3){return new BPromise(function(_0x1dbd86,_0x245fa1){var _0x4e5b44=_0x46a3c3||client;return _0x4e5b44[_0xf26b('0x24')](_0x7d2ea9,_0x34a9f1)[_0xf26b('0x25')](function(_0x41420a){logger[_0xf26b('0x26')](_0xf26b('0x27'),_0x265639,_0xf26b('0x28'));logger[_0xf26b('0x29')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x265639,_0xf26b('0x28'),JSON[_0xf26b('0x2a')](_0x41420a));if(_0x41420a['error']){if(_0x41420a['error'][_0xf26b('0x2b')]===0x1f4){logger[_0xf26b('0x2c')](_0xf26b('0x27'),_0x265639,_0x41420a[_0xf26b('0x2c')][_0xf26b('0x2d')]);return _0x245fa1(_0x41420a[_0xf26b('0x2c')][_0xf26b('0x2d')]);}logger['error'](_0xf26b('0x27'),_0x265639,_0x41420a[_0xf26b('0x2c')][_0xf26b('0x2d')]);return _0x1dbd86(_0x41420a[_0xf26b('0x2c')][_0xf26b('0x2d')]);}else{logger[_0xf26b('0x26')](_0xf26b('0x27'),_0x265639,'request\x20sent');_0x1dbd86(_0x41420a[_0xf26b('0x2e')][_0xf26b('0x2d')]);}})['catch'](function(_0x3d1107){logger[_0xf26b('0x2c')](_0xf26b('0x27'),_0x265639,_0x3d1107);_0x245fa1(_0x3d1107);});});}function respondWithStatusCode(_0x7e5599,_0x1b4fdd){_0x1b4fdd=_0x1b4fdd||0xcc;return function(_0x51eca5){if(_0x51eca5){return _0x7e5599[_0xf26b('0x2f')](_0x1b4fdd);}return _0x7e5599['status'](_0x1b4fdd)[_0xf26b('0x30')]();};}function respondWithResult(_0x3a407a,_0x44b312){_0x44b312=_0x44b312||0xc8;return function(_0x2047c6){if(_0x2047c6){return _0x3a407a[_0xf26b('0x31')](_0x44b312)[_0xf26b('0x32')](_0x2047c6);}};}function respondWithFilteredResult(_0x2b9851,_0x1fd5d4){return function(_0x4411f5){if(_0x4411f5){var _0x5ef689=_0x4411f5[_0xf26b('0x33')],_0x177d5c=_0x1fd5d4['offset'],_0x38dec7=_0x1fd5d4[_0xf26b('0x34')]+_0x1fd5d4[_0xf26b('0x35')],_0x154dcb;if(_0x38dec7>=_0x5ef689){_0x38dec7=_0x5ef689;_0x154dcb=0xc8;}else{_0x154dcb=0xce;}_0x2b9851[_0xf26b('0x31')](_0x154dcb);return _0x2b9851['set'](_0xf26b('0x36'),_0x177d5c+'-'+_0x38dec7+'/'+_0x5ef689)[_0xf26b('0x32')](_0x4411f5);}return null;};}function patchUpdates(_0x1c293a){return function(_0x3d0955){try{jsonpatch['apply'](_0x3d0955,_0x1c293a,!![]);}catch(_0x56d778){return BPromise[_0xf26b('0x37')](_0x56d778);}return _0x3d0955[_0xf26b('0x38')]();};}function saveUpdates(_0xb8737c,_0x27c02a){return function(_0x16490a){if(_0x16490a){return _0x16490a[_0xf26b('0x39')](_0xb8737c)[_0xf26b('0x25')](function(_0x4d9f5b){return _0x4d9f5b;});}return null;};}function removeEntity(_0x5aa178,_0x50fbc3){return function(_0x2bc9af){if(_0x2bc9af){return _0x2bc9af[_0xf26b('0x3a')]()[_0xf26b('0x25')](function(){var _0x27c1d1=_0x2bc9af[_0xf26b('0x3b')]({'plain':!![]});var _0x51842c=_0xf26b('0x3c');return db[_0xf26b('0x3d')][_0xf26b('0x3a')]({'where':{'type':_0x51842c,'resourceId':_0x27c1d1['id']}})[_0xf26b('0x25')](function(){return _0x2bc9af;});})[_0xf26b('0x25')](function(){_0x5aa178[_0xf26b('0x31')](0xcc)[_0xf26b('0x30')]();});}};}function handleEntityNotFound(_0x9a94c4,_0x140d8f){return function(_0x318dc0){if(!_0x318dc0){_0x9a94c4[_0xf26b('0x2f')](0x194);}return _0x318dc0;};}function handleError(_0x37f269,_0xf83e34){_0xf83e34=_0xf83e34||0x1f4;return function(_0x25538f){logger['error'](_0x25538f[_0xf26b('0x3e')]);if(_0x25538f[_0xf26b('0x3f')]){delete _0x25538f[_0xf26b('0x3f')];}_0x37f269[_0xf26b('0x31')](_0xf83e34)[_0xf26b('0x40')](_0x25538f);};}exports['index']=function(_0xc97b0c,_0x198051){var _0xc892de={'include':[{'model':db[_0xf26b('0x41')],'as':_0xf26b('0x42')}]},_0x809594={},_0x1b6ecb={'count':0x0,'rows':[]};var _0x2a037c=db['FaxAccount']['rawAttributes'];_0x809594[_0xf26b('0x43')]=_[_0xf26b('0x44')](_0x2a037c);_0x809594['query']=_['keys'](_0xc97b0c[_0xf26b('0x45')]);_0x809594[_0xf26b('0x46')]=_[_0xf26b('0x47')](_0x809594[_0xf26b('0x43')],_0x809594['query']);_0xc892de['attributes']=_[_0xf26b('0x47')](_0x809594[_0xf26b('0x43')],qs[_0xf26b('0x48')](_0xc97b0c['query'][_0xf26b('0x48')]));_0xc892de[_0xf26b('0x49')]=_0xc892de[_0xf26b('0x49')]['length']?_0xc892de[_0xf26b('0x49')]:_0x809594[_0xf26b('0x43')];if(!_0xc97b0c[_0xf26b('0x45')][_0xf26b('0x4a')](_0xf26b('0x4b'))){_0xc892de[_0xf26b('0x35')]=qs[_0xf26b('0x35')](_0xc97b0c[_0xf26b('0x45')][_0xf26b('0x35')]);_0xc892de[_0xf26b('0x34')]=qs[_0xf26b('0x34')](_0xc97b0c['query'][_0xf26b('0x34')]);}_0xc892de['order']=qs[_0xf26b('0x4c')](_0xc97b0c['query'][_0xf26b('0x4c')]);_0xc892de['where']=qs['filters'](_[_0xf26b('0x4d')](_0xc97b0c[_0xf26b('0x45')],_0x809594[_0xf26b('0x46')]));if(_0xc97b0c[_0xf26b('0x45')][_0xf26b('0x4e')]){_0xc892de[_0xf26b('0x4f')]=_[_0xf26b('0x50')](_0xc892de[_0xf26b('0x4f')],{'$or':_[_0xf26b('0x51')](_0x2a037c,function(_0x31822b){if(_0x31822b[_0xf26b('0x52')][_0xf26b('0x53')]!==_0xf26b('0x54')){var _0x452ea9={};_0x452ea9[_0x31822b[_0xf26b('0x55')]]={'$like':'%'+_0xc97b0c[_0xf26b('0x45')][_0xf26b('0x4e')]+'%'};return _0x452ea9;}})});}_0xc892de=_[_0xf26b('0x50')]({},_0xc892de,_0xc97b0c[_0xf26b('0x56')]);var _0x1236e0={'where':_0xc892de['where']};return db[_0xf26b('0x57')][_0xf26b('0x33')](_0x1236e0)[_0xf26b('0x25')](function(_0x39657d){_0x1b6ecb[_0xf26b('0x33')]=_0x39657d;if(_0xc97b0c['query'][_0xf26b('0x58')]){_0xc892de['include']=[{'all':!![]}];}return db[_0xf26b('0x57')]['findAll'](_0xc892de);})[_0xf26b('0x25')](function(_0x1fc4e2){_0x1b6ecb[_0xf26b('0x59')]=_0x1fc4e2;return _0x1b6ecb;})[_0xf26b('0x25')](respondWithFilteredResult(_0x198051,_0xc892de))[_0xf26b('0x5a')](handleError(_0x198051,null));};exports[_0xf26b('0x5b')]=function(_0x563c87,_0x280c79){var _0x5be747={'raw':![],'where':{'id':_0x563c87[_0xf26b('0x5c')]['id']},'include':[{'model':db[_0xf26b('0x41')],'as':_0xf26b('0x42')}]},_0x2b0052={};_0x2b0052[_0xf26b('0x43')]=_[_0xf26b('0x44')](db[_0xf26b('0x57')][_0xf26b('0x5d')]);_0x2b0052['query']=_[_0xf26b('0x44')](_0x563c87[_0xf26b('0x45')]);_0x2b0052[_0xf26b('0x46')]=_[_0xf26b('0x47')](_0x2b0052[_0xf26b('0x43')],_0x2b0052[_0xf26b('0x45')]);_0x5be747[_0xf26b('0x49')]=_['intersection'](_0x2b0052[_0xf26b('0x43')],qs['fields'](_0x563c87[_0xf26b('0x45')]['fields']));_0x5be747['attributes']=_0x5be747[_0xf26b('0x49')][_0xf26b('0x5e')]?_0x5be747[_0xf26b('0x49')]:_0x2b0052[_0xf26b('0x43')];if(_0x563c87[_0xf26b('0x45')][_0xf26b('0x58')]){_0x5be747[_0xf26b('0x5f')]=[{'all':!![]}];}_0x5be747=_[_0xf26b('0x50')]({},_0x5be747,_0x563c87[_0xf26b('0x56')]);return db[_0xf26b('0x57')][_0xf26b('0x60')](_0x5be747)[_0xf26b('0x25')](handleEntityNotFound(_0x280c79,null))['then'](respondWithResult(_0x280c79,null))['catch'](handleError(_0x280c79,null));};exports[_0xf26b('0x61')]=function(_0x4cae6,_0x146db2){return db[_0xf26b('0x57')][_0xf26b('0x61')](_0x4cae6['body'],{})['then'](function(_0x587267){var _0x2d822d=_0x4cae6[_0xf26b('0x62')][_0xf26b('0x3b')]({'plain':!![]});if(!_0x2d822d)throw new Error(_0xf26b('0x63'));if(_0x2d822d['role']===_0xf26b('0x62')){var _0x4cdb93=_0x587267[_0xf26b('0x3b')]({'plain':!![]});var _0x58e1d5=_0xf26b('0x3c');return db[_0xf26b('0x64')][_0xf26b('0x60')]({'where':{'name':_0x58e1d5,'userProfileId':_0x2d822d[_0xf26b('0x65')]},'raw':!![]})[_0xf26b('0x25')](function(_0x56501e){if(_0x56501e&&_0x56501e[_0xf26b('0x66')]===0x0){return db[_0xf26b('0x3d')]['create']({'name':_0x4cdb93['name'],'resourceId':_0x4cdb93['id'],'type':_0x56501e[_0xf26b('0x3f')],'sectionId':_0x56501e['id']},{})[_0xf26b('0x25')](function(){return _0x587267;});}else{return _0x587267;}})[_0xf26b('0x5a')](function(_0x47c125){logger[_0xf26b('0x2c')](_0xf26b('0x67'),_0x47c125);throw _0x47c125;});}return _0x587267;})[_0xf26b('0x25')](respondWithResult(_0x146db2,0xc9))[_0xf26b('0x5a')](handleError(_0x146db2,null));};exports['update']=function(_0x15491d,_0x2313c2){if(_0x15491d[_0xf26b('0x68')]['id']){delete _0x15491d[_0xf26b('0x68')]['id'];}return db[_0xf26b('0x57')][_0xf26b('0x60')]({'where':{'id':_0x15491d[_0xf26b('0x5c')]['id']},'include':[{'model':db[_0xf26b('0x41')],'as':_0xf26b('0x42')}]})[_0xf26b('0x25')](handleEntityNotFound(_0x2313c2,null))['then'](saveUpdates(_0x15491d[_0xf26b('0x68')],null))['then'](respondWithResult(_0x2313c2,null))[_0xf26b('0x5a')](handleError(_0x2313c2,null));};exports[_0xf26b('0x3a')]=function(_0x23465b,_0x4dcf4f){return db[_0xf26b('0x57')][_0xf26b('0x60')]({'where':{'id':_0x23465b[_0xf26b('0x5c')]['id']}})[_0xf26b('0x25')](handleEntityNotFound(_0x4dcf4f,null))['then'](removeEntity(_0x4dcf4f,null))[_0xf26b('0x5a')](handleError(_0x4dcf4f,null));};exports[_0xf26b('0x69')]=function(_0x31f409,_0x2c9d19){return db['FaxAccount']['describe']()['then'](respondWithResult(_0x2c9d19,null))['catch'](handleError(_0x2c9d19,null));};exports[_0xf26b('0x6a')]=function(_0x189187,_0x5a6db9,_0x32ced2){if(_0x189187[_0xf26b('0x68')]['id']){delete _0x189187[_0xf26b('0x68')]['id'];}return db[_0xf26b('0x57')][_0xf26b('0x60')]({'where':{'id':_0x189187[_0xf26b('0x5c')]['id']}})[_0xf26b('0x25')](handleEntityNotFound(_0x5a6db9,null))[_0xf26b('0x25')](function(_0x4f098e){if(_0x4f098e){_0x189187[_0xf26b('0x68')][_0xf26b('0x6b')]=_0x4f098e['id'];return db['Disposition'][_0xf26b('0x61')](_0x189187[_0xf26b('0x68')]);}})[_0xf26b('0x25')](respondWithResult(_0x5a6db9,null))['catch'](handleError(_0x5a6db9,null));};exports[_0xf26b('0x6c')]=function(_0x3855bd,_0x239a83,_0x19bd6b){var _0x36f116={'raw':![],'where':{}};var _0x5dbb6f={};var _0x5124c7={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x3855bd['params']['id']}})['then'](handleEntityNotFound(_0x239a83,null))['then'](function(_0x4a9a5c){if(_0x4a9a5c){_0x5dbb6f['model']=_[_0xf26b('0x44')](db[_0xf26b('0x6d')][_0xf26b('0x5d')]);_0x5dbb6f[_0xf26b('0x45')]=_[_0xf26b('0x44')](_0x3855bd[_0xf26b('0x45')]);_0x5dbb6f[_0xf26b('0x46')]=_[_0xf26b('0x47')](_0x5dbb6f['model'],_0x5dbb6f[_0xf26b('0x45')]);_0x36f116[_0xf26b('0x49')]=_[_0xf26b('0x47')](_0x5dbb6f[_0xf26b('0x43')],qs[_0xf26b('0x48')](_0x3855bd[_0xf26b('0x45')][_0xf26b('0x48')]));_0x36f116[_0xf26b('0x49')]=_0x36f116[_0xf26b('0x49')]['length']?_0x36f116[_0xf26b('0x49')]:_0x5dbb6f['model'];if(!_0x3855bd['query'][_0xf26b('0x4a')]('nolimit')){_0x36f116[_0xf26b('0x35')]=qs[_0xf26b('0x35')](_0x3855bd[_0xf26b('0x45')]['limit']);_0x36f116['offset']=qs[_0xf26b('0x34')](_0x3855bd[_0xf26b('0x45')][_0xf26b('0x34')]);}_0x36f116['order']=qs['sort'](_0x3855bd[_0xf26b('0x45')]['sort']);_0x36f116[_0xf26b('0x4f')]=qs['filters'](_[_0xf26b('0x4d')](_0x3855bd[_0xf26b('0x45')],_0x5dbb6f[_0xf26b('0x46')]));_0x36f116[_0xf26b('0x4f')][_0xf26b('0x6b')]=_0x4a9a5c['id'];if(_0x3855bd[_0xf26b('0x45')][_0xf26b('0x4e')]){_0x36f116[_0xf26b('0x4f')]=_[_0xf26b('0x50')](_0x36f116[_0xf26b('0x4f')],{'$or':_['map'](_0x36f116[_0xf26b('0x49')],function(_0x47a5f9){var _0x5da709={};_0x5da709[_0x47a5f9]={'$like':'%'+_0x3855bd[_0xf26b('0x45')][_0xf26b('0x4e')]+'%'};return _0x5da709;})});}_0x36f116=_['merge']({},_0x36f116,_0x3855bd[_0xf26b('0x56')]);return db[_0xf26b('0x6d')]['count']({'where':_0x36f116[_0xf26b('0x4f')]})[_0xf26b('0x25')](function(_0x534882){_0x5124c7['count']=_0x534882;if(_0x3855bd[_0xf26b('0x45')]['includeAll']){_0x36f116[_0xf26b('0x5f')]=[{'all':!![]}];}return db[_0xf26b('0x6d')][_0xf26b('0x6e')](_0x36f116);})[_0xf26b('0x25')](function(_0x3dce8d){_0x5124c7[_0xf26b('0x59')]=_0x3dce8d;return _0x5124c7;});}})[_0xf26b('0x25')](respondWithFilteredResult(_0x239a83,_0x36f116))[_0xf26b('0x5a')](handleError(_0x239a83,null));};exports[_0xf26b('0x6f')]=function(_0x5e90d5,_0x5b04e5,_0x30babf){return db[_0xf26b('0x57')][_0xf26b('0x60')]({'where':{'id':_0x5e90d5['params']['id']}})[_0xf26b('0x25')](handleEntityNotFound(_0x5b04e5,null))[_0xf26b('0x25')](function(_0x390d2b){if(_0x390d2b){return _0x390d2b[_0xf26b('0x6f')](_0x5e90d5['query'][_0xf26b('0x70')]);}})[_0xf26b('0x25')](respondWithStatusCode(_0x5b04e5,null))[_0xf26b('0x5a')](handleError(_0x5b04e5,null));};exports[_0xf26b('0x71')]=function(_0x349cf6,_0x11f9d9,_0x4094a6){if(_0x349cf6[_0xf26b('0x68')]['id']){delete _0x349cf6[_0xf26b('0x68')]['id'];}return db[_0xf26b('0x57')][_0xf26b('0x60')]({'where':{'id':_0x349cf6[_0xf26b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x11f9d9,null))['then'](function(_0x428485){if(_0x428485){_0x349cf6[_0xf26b('0x68')][_0xf26b('0x6b')]=_0x428485['id'];return db[_0xf26b('0x72')][_0xf26b('0x61')](_0x349cf6[_0xf26b('0x68')]);}})['then'](respondWithResult(_0x11f9d9,null))[_0xf26b('0x5a')](handleError(_0x11f9d9,null));};exports['getAnswers']=function(_0x967b70,_0x35a8b1,_0x149061){var _0x234708={'raw':![],'where':{}};var _0x18fc3d={};var _0x38a917={'count':0x0,'rows':[]};return db[_0xf26b('0x57')]['findOne']({'where':{'id':_0x967b70[_0xf26b('0x5c')]['id']}})[_0xf26b('0x25')](handleEntityNotFound(_0x35a8b1,null))[_0xf26b('0x25')](function(_0x357536){if(_0x357536){_0x18fc3d[_0xf26b('0x43')]=_[_0xf26b('0x44')](db[_0xf26b('0x72')][_0xf26b('0x5d')]);_0x18fc3d[_0xf26b('0x45')]=_[_0xf26b('0x44')](_0x967b70['query']);_0x18fc3d['filters']=_['intersection'](_0x18fc3d[_0xf26b('0x43')],_0x18fc3d['query']);_0x234708[_0xf26b('0x49')]=_[_0xf26b('0x47')](_0x18fc3d[_0xf26b('0x43')],qs[_0xf26b('0x48')](_0x967b70[_0xf26b('0x45')][_0xf26b('0x48')]));_0x234708['attributes']=_0x234708[_0xf26b('0x49')][_0xf26b('0x5e')]?_0x234708[_0xf26b('0x49')]:_0x18fc3d[_0xf26b('0x43')];if(!_0x967b70[_0xf26b('0x45')][_0xf26b('0x4a')](_0xf26b('0x4b'))){_0x234708[_0xf26b('0x35')]=qs[_0xf26b('0x35')](_0x967b70['query'][_0xf26b('0x35')]);_0x234708[_0xf26b('0x34')]=qs[_0xf26b('0x34')](_0x967b70[_0xf26b('0x45')][_0xf26b('0x34')]);}_0x234708[_0xf26b('0x73')]=qs[_0xf26b('0x4c')](_0x967b70[_0xf26b('0x45')][_0xf26b('0x4c')]);_0x234708['where']=qs[_0xf26b('0x46')](_['pick'](_0x967b70['query'],_0x18fc3d[_0xf26b('0x46')]));_0x234708[_0xf26b('0x4f')][_0xf26b('0x6b')]=_0x357536['id'];if(_0x967b70[_0xf26b('0x45')][_0xf26b('0x4e')]){_0x234708['where']=_[_0xf26b('0x50')](_0x234708[_0xf26b('0x4f')],{'$or':_[_0xf26b('0x51')](_0x234708[_0xf26b('0x49')],function(_0x87db16){var _0x3a3ed6={};_0x3a3ed6[_0x87db16]={'$like':'%'+_0x967b70['query'][_0xf26b('0x4e')]+'%'};return _0x3a3ed6;})});}_0x234708=_[_0xf26b('0x50')]({},_0x234708,_0x967b70[_0xf26b('0x56')]);return db[_0xf26b('0x72')][_0xf26b('0x33')]({'where':_0x234708[_0xf26b('0x4f')]})['then'](function(_0x4c3e23){_0x38a917[_0xf26b('0x33')]=_0x4c3e23;if(_0x967b70[_0xf26b('0x45')]['includeAll']){_0x234708['include']=[{'all':!![]}];}return db[_0xf26b('0x72')]['findAll'](_0x234708);})[_0xf26b('0x25')](function(_0x3abbf5){_0x38a917[_0xf26b('0x59')]=_0x3abbf5;return _0x38a917;});}})[_0xf26b('0x25')](respondWithFilteredResult(_0x35a8b1,_0x234708))['catch'](handleError(_0x35a8b1,null));};exports['removeAnswers']=function(_0x490350,_0xe4485e,_0x378b1a){return db[_0xf26b('0x57')][_0xf26b('0x60')]({'where':{'id':_0x490350[_0xf26b('0x5c')]['id']}})[_0xf26b('0x25')](handleEntityNotFound(_0xe4485e,null))[_0xf26b('0x25')](function(_0x2e5322){if(_0x2e5322){return _0x2e5322[_0xf26b('0x74')](_0x490350['query'][_0xf26b('0x70')]);}})[_0xf26b('0x25')](respondWithStatusCode(_0xe4485e,null))[_0xf26b('0x5a')](handleError(_0xe4485e,null));};exports[_0xf26b('0x75')]=function(_0x8062c6,_0x52f47e,_0x4636bd){return db['FaxInteraction'][_0xf26b('0x60')]({'where':{'id':_0x8062c6[_0xf26b('0x5c')]['id']}})[_0xf26b('0x25')](handleEntityNotFound(_0x52f47e,null))[_0xf26b('0x25')](function(_0xe95aeb){if(_0xe95aeb){return _0xe95aeb['addInteraction'](_0x8062c6[_0xf26b('0x68')]['ids'],_[_0xf26b('0x76')](_0x8062c6[_0xf26b('0x68')],['ids','id'])||{});}})[_0xf26b('0x25')](respondWithResult(_0x52f47e,null))[_0xf26b('0x5a')](handleError(_0x52f47e,null));};exports[_0xf26b('0x77')]=function(_0x126e8c,_0x16a19c,_0x5b03c9){var _0x26c3a2={'raw':![],'where':{}};var _0x23fb1a={};var _0x54acac={'count':0x0,'rows':[]};return db[_0xf26b('0x57')][_0xf26b('0x78')]({'where':{'id':_0x126e8c['params']['id']}})[_0xf26b('0x25')](handleEntityNotFound(_0x16a19c,null))['then'](function(_0x4da80b){if(_0x4da80b){_0x23fb1a[_0xf26b('0x43')]=_[_0xf26b('0x44')](db[_0xf26b('0x79')]['rawAttributes']);_0x23fb1a[_0xf26b('0x45')]=_[_0xf26b('0x44')](_0x126e8c[_0xf26b('0x45')]);_0x23fb1a[_0xf26b('0x46')]=_[_0xf26b('0x47')](_0x23fb1a[_0xf26b('0x43')],_0x23fb1a[_0xf26b('0x45')]);_0x26c3a2[_0xf26b('0x49')]=_[_0xf26b('0x47')](_0x23fb1a['model'],qs['fields'](_0x126e8c[_0xf26b('0x45')][_0xf26b('0x48')]));_0x26c3a2['attributes']=_0x26c3a2[_0xf26b('0x49')]['length']?_0x26c3a2[_0xf26b('0x49')]:_0x23fb1a[_0xf26b('0x43')];if(!_0x126e8c[_0xf26b('0x45')]['hasOwnProperty']('nolimit')){_0x26c3a2[_0xf26b('0x35')]=qs[_0xf26b('0x35')](_0x126e8c[_0xf26b('0x45')][_0xf26b('0x35')]);_0x26c3a2[_0xf26b('0x34')]=qs['offset'](_0x126e8c['query'][_0xf26b('0x34')]);}_0x26c3a2[_0xf26b('0x73')]=qs[_0xf26b('0x4c')](_0x126e8c[_0xf26b('0x45')]['sort']);_0x26c3a2['where']=qs[_0xf26b('0x46')](_[_0xf26b('0x4d')](_0x126e8c[_0xf26b('0x45')],_0x23fb1a[_0xf26b('0x46')]));_0x26c3a2['where'][_0xf26b('0x6b')]=_0x4da80b['id'];if(_0x126e8c[_0xf26b('0x45')][_0xf26b('0x4e')]){_0x26c3a2[_0xf26b('0x4f')]=_['merge'](_0x26c3a2[_0xf26b('0x4f')],{'$or':_[_0xf26b('0x51')](_0x26c3a2[_0xf26b('0x49')],function(_0xa1a72c){var _0x4b4900={};_0x4b4900[_0xa1a72c]={'$like':'%'+_0x126e8c[_0xf26b('0x45')][_0xf26b('0x4e')]+'%'};return _0x4b4900;})});}_0x26c3a2=_[_0xf26b('0x50')]({},_0x26c3a2,_0x126e8c[_0xf26b('0x56')]);return db[_0xf26b('0x79')][_0xf26b('0x33')]({'where':_0x26c3a2[_0xf26b('0x4f')]})[_0xf26b('0x25')](function(_0xaa9113){_0x54acac['count']=_0xaa9113;if(_0x126e8c[_0xf26b('0x45')][_0xf26b('0x58')]){_0x26c3a2[_0xf26b('0x5f')]=[{'model':db[_0xf26b('0x7a')],'as':_0xf26b('0x7b'),'required':![]},{'model':db['User'],'as':_0xf26b('0x7c'),'attributes':['name',_0xf26b('0x7d'),_0xf26b('0x7e')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xf26b('0x3f'),_0xf26b('0x7f')],'where':_0x126e8c[_0xf26b('0x45')][_0xf26b('0x80')]?{'id':_0x126e8c[_0xf26b('0x45')][_0xf26b('0x80')]}:undefined,'required':_0x126e8c[_0xf26b('0x45')][_0xf26b('0x80')]?!![]:![]}];}return db['FaxInteraction'][_0xf26b('0x6e')](_0x26c3a2);})['then'](function(_0x12b1eb){_0x54acac[_0xf26b('0x59')]=_0x12b1eb;return _0x54acac;});}})[_0xf26b('0x25')](respondWithFilteredResult(_0x16a19c,_0x26c3a2))[_0xf26b('0x5a')](handleError(_0x16a19c,null));};exports[_0xf26b('0x81')]=function(_0x5ee08b,_0x147585,_0xea3b06){return db['FaxAccount'][_0xf26b('0x78')]({'where':{'id':_0x5ee08b[_0xf26b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x147585,null))[_0xf26b('0x25')](function(_0x591146){if(_0x591146){return db[_0xf26b('0x82')][_0xf26b('0x83')](function(_0x166d4c){return db['FaxApplication'][_0xf26b('0x3a')]({'where':{'FaxAccountId':_0x5ee08b[_0xf26b('0x5c')]['id']},'transaction':_0x166d4c})[_0xf26b('0x25')](function(_0x1594f6){var _0x2e36d2=_['map'](_0x5ee08b[_0xf26b('0x68')],function(_0x7ed469){_0x7ed469[_0xf26b('0x6b')]=_0x5ee08b[_0xf26b('0x5c')]['id'];return _0x7ed469;});return db['FaxApplication'][_0xf26b('0x84')](_0x2e36d2,{'transaction':_0x166d4c});});})['then'](function(){return db['FaxApplication'][_0xf26b('0x85')]({'where':{'FaxAccountId':_0x5ee08b[_0xf26b('0x5c')]['id']},'order':_0xf26b('0x86')});});}})[_0xf26b('0x25')](respondWithResult(_0x147585,null))[_0xf26b('0x5a')](handleError(_0x147585,null));};exports['getApplications']=function(_0x534cea,_0x1758db,_0x109990){var _0x58c7b4={};var _0x9632a3={};var _0x47db71;var _0x5a1ead;return db[_0xf26b('0x57')][_0xf26b('0x78')]({'where':{'id':_0x534cea[_0xf26b('0x5c')]['id']}})[_0xf26b('0x25')](handleEntityNotFound(_0x1758db,null))['then'](function(_0x5d0f32){if(_0x5d0f32){_0x47db71=_0x5d0f32;_0x9632a3[_0xf26b('0x43')]=_[_0xf26b('0x44')](db[_0xf26b('0x87')][_0xf26b('0x5d')]);_0x9632a3[_0xf26b('0x45')]=_[_0xf26b('0x44')](_0x534cea[_0xf26b('0x45')]);_0x9632a3[_0xf26b('0x46')]=_[_0xf26b('0x47')](_0x9632a3[_0xf26b('0x43')],_0x9632a3[_0xf26b('0x45')]);_0x58c7b4['attributes']=_[_0xf26b('0x47')](_0x9632a3[_0xf26b('0x43')],qs['fields'](_0x534cea[_0xf26b('0x45')]['fields']));_0x58c7b4[_0xf26b('0x49')]=_0x58c7b4['attributes'][_0xf26b('0x5e')]?_0x58c7b4[_0xf26b('0x49')]:_0x9632a3[_0xf26b('0x43')];_0x58c7b4[_0xf26b('0x73')]=qs[_0xf26b('0x4c')](_0x534cea[_0xf26b('0x45')][_0xf26b('0x4c')]);_0x58c7b4['where']=qs[_0xf26b('0x46')](_['pick'](_0x534cea['query'],_0x9632a3['filters']));if(_0x534cea[_0xf26b('0x45')][_0xf26b('0x4e')]){_0x58c7b4[_0xf26b('0x4f')]=_[_0xf26b('0x50')](_0x58c7b4[_0xf26b('0x4f')],{'$or':_[_0xf26b('0x51')](_0x58c7b4['attributes'],function(_0x26c281){var _0xb29332={};_0xb29332[_0x26c281]={'$like':'%'+_0x534cea[_0xf26b('0x45')][_0xf26b('0x4e')]+'%'};return _0xb29332;})});}_0x58c7b4=_[_0xf26b('0x50')]({},_0x58c7b4,_0x534cea['options']);return _0x47db71[_0xf26b('0x88')](_0x58c7b4);}})[_0xf26b('0x25')](function(_0x4486ad){if(_0x4486ad){_0x5a1ead=_0x4486ad[_0xf26b('0x5e')];if(!_0x534cea[_0xf26b('0x45')][_0xf26b('0x4a')]('nolimit')){_0x58c7b4['limit']=qs[_0xf26b('0x35')](_0x534cea[_0xf26b('0x45')][_0xf26b('0x35')]);_0x58c7b4['offset']=qs['offset'](_0x534cea[_0xf26b('0x45')]['offset']);}return _0x47db71[_0xf26b('0x88')](_0x58c7b4);}})[_0xf26b('0x25')](function(_0x1f7824){if(_0x1f7824){return _0x1f7824?{'count':_0x5a1ead,'rows':_0x1f7824}:null;}})[_0xf26b('0x25')](respondWithResult(_0x1758db,null))[_0xf26b('0x5a')](handleError(_0x1758db,null));};function Extension(_0x18ade2,_0x1d9898,_0x4626ab,_0x36149b){this['context']=_0xf26b('0x89');this[_0xf26b('0x8a')]=_0x18ade2[_0xf26b('0x8b')];this[_0xf26b('0x8c')]=_0x36149b;this['type']=_0xf26b('0x8d');this[_0xf26b('0x8e')]='Fax\x20Extension';this['FaxAccountId']=_0x18ade2['id'];this['priority']=_0x1d9898;this['appdata']=_0x4626ab;}function createExtensionsReciveFax(_0x22f1de){var _0x48e7a6=0x1;var _0x2b2009=[];_0x2b2009[_0xf26b('0x8f')](new Extension(_0x22f1de,_0x48e7a6,'',_0xf26b('0x90')));_0x48e7a6+=0x1;_0x2b2009['push'](new Extension(_0x22f1de,_0x48e7a6,_0xf26b('0x91'),'Set'));_0x48e7a6+=0x1;for(var _0x5d5a14 in _0x22f1de){if(_0x22f1de['hasOwnProperty'](_0x5d5a14)&&(_0x5d5a14==='ecm'||_0x5d5a14===_0xf26b('0x8b')||_0x5d5a14===_0xf26b('0x92')||_0x5d5a14===_0xf26b('0x93')||_0x5d5a14===_0xf26b('0x94')||_0x5d5a14===_0xf26b('0x95')||_0x5d5a14==='minrate'||_0x5d5a14==='modem'||_0x5d5a14==='t38timeout')){_0x2b2009[_0xf26b('0x8f')](new Extension(_0x22f1de,_0x48e7a6,'FAXOPT('+_0x5d5a14+')='+_0x22f1de[_0x5d5a14],_0xf26b('0x96')));_0x48e7a6+=0x1;}}_0x2b2009[_0xf26b('0x8f')](new Extension(_0x22f1de,_0x48e7a6,'6','Wait'));_0x48e7a6+=0x1;_0x2b2009['push'](new Extension(_0x22f1de,_0x48e7a6,'/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax'));_0x48e7a6=0x0;return _0x2b2009;}exports[_0xf26b('0x97')]=function(_0x5987fe,_0x5e2147,_0x32ad0a){var _0x47aa6e;return db['sequelize']['transaction'](function(_0x33a262){return db['FaxAccount']['create'](_0x5987fe[_0xf26b('0x68')],{'transaction':_0x33a262})[_0xf26b('0x25')](function(_0x2bb749){_0x47aa6e=_0x2bb749[_0xf26b('0x3b')]({'plain':!![]});return db[_0xf26b('0x98')][_0xf26b('0x84')](createExtensionsReciveFax(_0x47aa6e),{'transaction':_0x33a262});});})[_0xf26b('0x25')](function(){return _0x47aa6e;})[_0xf26b('0x25')](respondWithResult(_0x5e2147,null))[_0xf26b('0x5a')](handleError(_0x5e2147,null));};exports['updateAccountApplications']=function(_0xb0c1dc,_0x1e7b9d,_0x54c6d5){var _0x1d4ba0;return db[_0xf26b('0x82')][_0xf26b('0x83')](function(_0x5271a8){return db[_0xf26b('0x57')][_0xf26b('0x39')](_0xb0c1dc[_0xf26b('0x68')],{'where':{'id':_0xb0c1dc[_0xf26b('0x68')]['id']},'transaction':_0x5271a8})[_0xf26b('0x25')](function(_0x42aa26){return db[_0xf26b('0x98')][_0xf26b('0x3a')]({'where':{'FaxAccountId':_0xb0c1dc[_0xf26b('0x68')]['id']},'transaction':_0x5271a8})[_0xf26b('0x25')](function(_0x46e115){return db[_0xf26b('0x98')][_0xf26b('0x84')](createExtensionsReciveFax(_[_0xf26b('0x76')](_0xb0c1dc[_0xf26b('0x68')],[_0xf26b('0x99'),_0xf26b('0x53'),'createdAt',_0xf26b('0x9a'),_0xf26b('0x9b'),'ListId'])),{'transaction':_0x5271a8});});});})['then'](function(){return db[_0xf26b('0x57')][_0xf26b('0x9c')](_0xb0c1dc['body']['id']);})['then'](respondWithResult(_0x1e7b9d,null))['catch'](handleError(_0x1e7b9d,null));};exports[_0xf26b('0x9d')]=function(_0x47ef37,_0x2869e6,_0x4612e8){var _0x3c1dd2={'raw':!![],'where':{}};var _0x4f1f16={};var _0x481a41={'count':0x0,'rows':[]};return db[_0xf26b('0x57')][_0xf26b('0x78')]({'where':{'id':_0x47ef37[_0xf26b('0x5c')]['id']}})[_0xf26b('0x25')](handleEntityNotFound(_0x2869e6,null))[_0xf26b('0x25')](function(_0x5c80bc){if(_0x5c80bc){_0x4f1f16[_0xf26b('0x43')]=_['keys'](db['FaxMessage'][_0xf26b('0x5d')]);_0x4f1f16['query']=_[_0xf26b('0x44')](_0x47ef37[_0xf26b('0x45')]);_0x4f1f16[_0xf26b('0x46')]=_['intersection'](_0x4f1f16[_0xf26b('0x43')],_0x4f1f16[_0xf26b('0x45')]);_0x3c1dd2[_0xf26b('0x49')]=_[_0xf26b('0x47')](_0x4f1f16['model'],qs[_0xf26b('0x48')](_0x47ef37['query'][_0xf26b('0x48')]));_0x3c1dd2[_0xf26b('0x49')]=_0x3c1dd2[_0xf26b('0x49')]['length']?_0x3c1dd2[_0xf26b('0x49')]:_0x4f1f16[_0xf26b('0x43')];if(!_0x47ef37[_0xf26b('0x45')][_0xf26b('0x4a')](_0xf26b('0x4b'))){_0x3c1dd2[_0xf26b('0x35')]=qs[_0xf26b('0x35')](_0x47ef37[_0xf26b('0x45')][_0xf26b('0x35')]);_0x3c1dd2[_0xf26b('0x34')]=qs[_0xf26b('0x34')](_0x47ef37[_0xf26b('0x45')][_0xf26b('0x34')]);}_0x3c1dd2[_0xf26b('0x73')]=qs[_0xf26b('0x4c')](_0x47ef37['query'][_0xf26b('0x4c')]);_0x3c1dd2[_0xf26b('0x4f')]=qs[_0xf26b('0x46')](_['pick'](_0x47ef37[_0xf26b('0x45')],_0x4f1f16[_0xf26b('0x46')]));_0x3c1dd2[_0xf26b('0x4f')]['FaxAccountId']=_0x5c80bc['id'];if(_0x47ef37['query'][_0xf26b('0x4e')]){_0x3c1dd2['where']=_[_0xf26b('0x50')](_0x3c1dd2[_0xf26b('0x4f')],{'$or':_['map'](_0x3c1dd2['attributes'],function(_0x494ca0){var _0x11462a={};_0x11462a[_0x494ca0]={'$like':'%'+_0x47ef37['query'][_0xf26b('0x4e')]+'%'};return _0x11462a;})});}if(_0x47ef37[_0xf26b('0x45')][_0xf26b('0x9e')]){var _0x767793=_0x47ef37[_0xf26b('0x45')][_0xf26b('0x9e')]['split'](',');var _0x5bfe3a={};_0x5bfe3a[_0x767793[0x0]]={'$gte':moment(_0x767793[0x1])[_0xf26b('0x9f')](_0xf26b('0xa0'))};_0x3c1dd2['where']=_['merge'](_0x3c1dd2[_0xf26b('0x4f')],_0x5bfe3a);}_0x3c1dd2=_[_0xf26b('0x50')]({},_0x3c1dd2,_0x47ef37['options']);return db['FaxMessage'][_0xf26b('0x33')]({'where':_0x3c1dd2[_0xf26b('0x4f')]})['then'](function(_0x2aa6d7){_0x481a41['count']=_0x2aa6d7;if(_0x47ef37[_0xf26b('0x45')][_0xf26b('0x58')]){_0x3c1dd2[_0xf26b('0x5f')]=[{'all':!![]}];}return db[_0xf26b('0xa1')][_0xf26b('0x6e')](_0x3c1dd2);})[_0xf26b('0x25')](function(_0x5b10e3){_0x481a41[_0xf26b('0x59')]=_0x5b10e3;return _0x481a41;});}})[_0xf26b('0x25')](respondWithFilteredResult(_0x2869e6,_0x3c1dd2))[_0xf26b('0x5a')](handleError(_0x2869e6,null));};exports[_0xf26b('0x40')]=function(_0x3de0de,_0x1cbbbc,_0x229cbe){var _0x1f9a9b,_0x1c9dd5={},_0xb0dc4c;if(_0x3de0de[_0xf26b('0x68')]['to']){_0xb0dc4c=_0x3de0de[_0xf26b('0x68')]['to'][0x0];}return db['FaxAccount'][_0xf26b('0x60')]({'where':{'id':_0x3de0de[_0xf26b('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0xf26b('0xa2'),'include':[{'model':db['CmContact'],'as':_0xf26b('0xa3'),'where':{'fax':_0xb0dc4c},'limit':0x1,'order':[[_0xf26b('0x9a'),'DESC']]}]}]})[_0xf26b('0x25')](handleEntityNotFound(_0x1cbbbc,null))['then'](function(_0x382a51){_0x1f9a9b=_0x382a51;if(_0x3de0de['body']['attachments']&&_0x3de0de[_0xf26b('0x68')]['attachments'][_0xf26b('0x5e')]){for(var _0x5e5301=0x0;_0x5e5301<_0x3de0de['body'][_0xf26b('0xa4')][_0xf26b('0x5e')];_0x5e5301+=0x1){_0x3de0de[_0xf26b('0x68')][_0xf26b('0xa4')][_0x5e5301]={'filename':_0x3de0de[_0xf26b('0x68')][_0xf26b('0xa4')][_0x5e5301][_0xf26b('0x3f')],'id':_0x3de0de[_0xf26b('0x68')][_0xf26b('0xa4')][_0x5e5301]['id'],'path':path['join'](config[_0xf26b('0xa5')],_0xf26b('0xa6'),_0x3de0de[_0xf26b('0x68')]['attachments'][_0x5e5301]['basename'])};}}return respondWithRpcPromise(_0xf26b('0xa7'),'CheckAfterSend',{'FaxAccountId':_[_0xf26b('0xa8')](_0x3de0de['params']['id'])?undefined:_0x3de0de['params']['id'],'path':_[_0xf26b('0xa8')](_0x3de0de[_0xf26b('0x68')][_0xf26b('0xa4')][0x0][_0xf26b('0xa')])?undefined:_0x3de0de[_0xf26b('0x68')][_0xf26b('0xa4')][0x0][_0xf26b('0xa')],'fax':_[_0xf26b('0xa8')](_0x3de0de[_0xf26b('0x68')]['to'][0x0])?undefined:_0x3de0de['body']['to'][0x0]},client9002);})[_0xf26b('0x25')](function(){if(_0x1f9a9b){if(_['isNil'](_0x3de0de[_0xf26b('0x68')][_0xf26b('0xa9')])){_0x3de0de[_0xf26b('0x68')][_0xf26b('0xa9')]=util[_0xf26b('0x9f')](_0xf26b('0xaa'),_0x1f9a9b[_0xf26b('0x3f')],_0x1f9a9b[_0xf26b('0xab')]);}if(_0x1f9a9b[_0xf26b('0xa2')]){if(_0x1f9a9b[_0xf26b('0xa2')][_0xf26b('0xa3')][_0xf26b('0x5e')]){return _0x1f9a9b['List']['Contacts'][0x0];}else{return db[_0xf26b('0x7a')][_0xf26b('0x61')](_[_0xf26b('0x1b')](_0x3de0de['body'],{'firstName':_0x3de0de[_0xf26b('0x68')]['to'][0x0],'phone':_0x3de0de[_0xf26b('0x68')]['to'][0x0],'fax':_0x3de0de[_0xf26b('0x68')]['to'][0x0],'ListId':_0x1f9a9b[_0xf26b('0xac')]}));}}else{throw new Error(_0xf26b('0xad'));}}else{throw new Error('Send\x20Fax\x20failed');}})['then'](function(_0x128851){if(_0x128851){return db[_0xf26b('0x79')][_0xf26b('0x60')]({'where':{'ContactId':_0x128851['id'],'closed':![],'FaxAccountId':_0x1f9a9b['id']}})[_0xf26b('0x25')](function(_0x3697a4){if(_0x3697a4){return[_0x3697a4,![]];}return db[_0xf26b('0x79')][_0xf26b('0x61')]({'UserId':_0x3de0de[_0xf26b('0x62')]['id'],'ContactId':_0x128851['id'],'FaxAccountId':_0x1f9a9b['id'],'fax':_0x3de0de[_0xf26b('0x68')]['to'][0x0],'firstMsgDirection':_0xf26b('0xae'),'Messages':[_[_0xf26b('0x50')](_0x3de0de[_0xf26b('0x68')],{'read':![],'body':_0x3de0de[_0xf26b('0x68')]['attachments'][0x0]['filename'],'FaxAccountId':_0x1f9a9b['id'],'UserId':_0x3de0de[_0xf26b('0x62')]['id'],'ContactId':_0x128851['id'],'AttachmentId':_0x3de0de['body'][_0xf26b('0xa4')][0x0]['id']})]},{'include':[{'model':db[_0xf26b('0xa1')],'as':_0xf26b('0xaf')}]})[_0xf26b('0x25')](function(_0x299923){return[_0x299923,!![]];});});}else{throw new Error(_0xf26b('0xb0'));}})['spread'](function(_0x5cbb34,_0x2c9c35){if(_0x2c9c35){return _0x5cbb34;}return db[_0xf26b('0xa1')][_0xf26b('0x61')]({'direction':'out','read':![],'body':_0x3de0de[_0xf26b('0x68')][_0xf26b('0xa4')][0x0][_0xf26b('0xb1')],'FaxAccountId':_0x1f9a9b['id'],'FaxInteractionId':_0x5cbb34['id'],'UserId':_0x3de0de[_0xf26b('0x62')]['id'],'ContactId':_0x5cbb34[_0xf26b('0xb2')],'AttachmentId':_0x3de0de[_0xf26b('0x68')][_0xf26b('0xa4')][0x0]['id']})['then'](function(_0x5dd28d){_0x5cbb34[_0xf26b('0xb3')][_0xf26b('0xaf')]=[];_0x5cbb34[_0xf26b('0xb3')][_0xf26b('0xaf')][_0xf26b('0x8f')](_0x5dd28d[_0xf26b('0xb3')]);return _0x5cbb34;});})['then'](function(_0x56ed46){respondWithRpcPromise(_0xf26b('0xb4'),_0xf26b('0xb4'),{'FaxAccountId':_[_0xf26b('0xa8')](_0x3de0de[_0xf26b('0x5c')]['id'])?undefined:_0x3de0de['params']['id'],'path':_[_0xf26b('0xa8')](_0x3de0de[_0xf26b('0x68')][_0xf26b('0xa4')][0x0][_0xf26b('0xa')])?undefined:_0x3de0de['body']['attachments'][0x0][_0xf26b('0xa')],'fax':_[_0xf26b('0xa8')](_0x3de0de[_0xf26b('0x68')]['to'][0x0])?undefined:_0x3de0de['body']['to'][0x0],'AttachmentId':_0x3de0de[_0xf26b('0x68')][_0xf26b('0xa4')][0x0]['id']},client9002)[_0xf26b('0x25')](function(_0x4a3e17){logger[_0xf26b('0x26')](_0xf26b('0xb5'),_0x4a3e17);})[_0xf26b('0x5a')](function(_0x8ec903){logger[_0xf26b('0x26')](_0xf26b('0xb5'),_0x8ec903);});return _0x56ed46;})[_0xf26b('0x25')](respondWithResult(_0x1cbbbc,null))[_0xf26b('0x5a')](handleError(_0x1cbbbc,null));};exports['addAgents']=function(_0xe67460,_0x42503b,_0x3798ef){return db['FaxAccount'][_0xf26b('0x60')]({'where':{'id':_0xe67460[_0xf26b('0x5c')]['id']}})[_0xf26b('0x25')](handleEntityNotFound(_0x42503b,null))['then'](function(_0x364aba){if(_0x364aba){return _0x364aba['addAgents'](_0xe67460[_0xf26b('0x68')][_0xf26b('0x70')],_[_0xf26b('0x76')](_0xe67460[_0xf26b('0x68')],[_0xf26b('0x70'),'id'])||{})['spread'](function(_0x25eac6){for(var _0xb16972=0x0;_0xb16972<_0xe67460[_0xf26b('0x68')][_0xf26b('0x70')][_0xf26b('0x5e')];_0xb16972+=0x1){socket[_0xf26b('0xb6')](_0xf26b('0xb7'),{'UserId':_0xe67460[_0xf26b('0x68')]['ids'][_0xb16972],'FaxAccountId':_0xe67460[_0xf26b('0x5c')]['id']});}return _0x25eac6;});}})[_0xf26b('0x25')](respondWithResult(_0x42503b,null))[_0xf26b('0x5a')](handleError(_0x42503b,null));};exports[_0xf26b('0xb8')]=function(_0x238429,_0xfe6464,_0x20287a){return db[_0xf26b('0x57')][_0xf26b('0x60')]({'where':{'id':_0x238429[_0xf26b('0x5c')]['id']}})[_0xf26b('0x25')](handleEntityNotFound(_0xfe6464,null))[_0xf26b('0x25')](function(_0x254d20){if(_0x254d20){return _0x254d20[_0xf26b('0xb8')](_0x238429['query'][_0xf26b('0x70')])[_0xf26b('0x25')](function(){if(_[_0xf26b('0xb9')](_0x238429[_0xf26b('0x45')][_0xf26b('0x70')])){for(var _0x23641b=0x0;_0x23641b<_0x238429[_0xf26b('0x45')]['ids'][_0xf26b('0x5e')];_0x23641b+=0x1){socket[_0xf26b('0xb6')](_0xf26b('0xba'),{'UserId':Number(_0x238429[_0xf26b('0x45')][_0xf26b('0x70')][_0x23641b]),'FaxAccountId':Number(_0x238429['params']['id'])});}}else{socket[_0xf26b('0xb6')](_0xf26b('0xba'),{'UserId':Number(_0x238429[_0xf26b('0x45')][_0xf26b('0x70')]),'FaxAccountId':Number(_0x238429['params']['id'])});}});}})[_0xf26b('0x25')](respondWithStatusCode(_0xfe6464,null))['catch'](handleError(_0xfe6464,null));};exports[_0xf26b('0xbb')]=function(_0x219ec9,_0x480ae5,_0x1c4848){var _0x85ff85={};var _0x2bce4d={};var _0x34cc9f;var _0x45f4e7;return db[_0xf26b('0x57')][_0xf26b('0x78')]({'where':{'id':_0x219ec9[_0xf26b('0x5c')]['id']}})[_0xf26b('0x25')](handleEntityNotFound(_0x480ae5,null))[_0xf26b('0x25')](function(_0x1c69a1){if(_0x1c69a1){_0x34cc9f=_0x1c69a1;_0x2bce4d['model']=_[_0xf26b('0x44')](db['User'][_0xf26b('0x5d')]);_0x2bce4d['query']=_[_0xf26b('0x44')](_0x219ec9[_0xf26b('0x45')]);_0x2bce4d[_0xf26b('0x46')]=_[_0xf26b('0x47')](_0x2bce4d[_0xf26b('0x43')],_0x2bce4d['query']);_0x85ff85[_0xf26b('0x49')]=_['intersection'](_0x2bce4d[_0xf26b('0x43')],qs[_0xf26b('0x48')](_0x219ec9[_0xf26b('0x45')][_0xf26b('0x48')]));_0x85ff85['attributes']=_0x85ff85[_0xf26b('0x49')][_0xf26b('0x5e')]?_0x85ff85[_0xf26b('0x49')]:_0x2bce4d[_0xf26b('0x43')];_0x85ff85[_0xf26b('0x73')]=qs[_0xf26b('0x4c')](_0x219ec9['query']['sort']);_0x85ff85['where']=qs[_0xf26b('0x46')](_['pick'](_0x219ec9[_0xf26b('0x45')],_0x2bce4d[_0xf26b('0x46')]));if(_0x219ec9['query'][_0xf26b('0x4e')]){_0x85ff85['where']=_[_0xf26b('0x50')](_0x85ff85[_0xf26b('0x4f')],{'$or':_[_0xf26b('0x51')](_0x85ff85[_0xf26b('0x49')],function(_0x428db0){var _0x4d67bd={};_0x4d67bd[_0x428db0]={'$like':'%'+_0x219ec9[_0xf26b('0x45')]['filter']+'%'};return _0x4d67bd;})});}_0x85ff85=_[_0xf26b('0x50')]({},_0x85ff85,_0x219ec9[_0xf26b('0x56')]);return _0x34cc9f['getAgents'](_0x85ff85);}})['then'](function(_0x411777){if(_0x411777){_0x45f4e7=_0x411777[_0xf26b('0x5e')];if(!_0x219ec9[_0xf26b('0x45')][_0xf26b('0x4a')](_0xf26b('0x4b'))){_0x85ff85[_0xf26b('0x35')]=qs[_0xf26b('0x35')](_0x219ec9[_0xf26b('0x45')][_0xf26b('0x35')]);_0x85ff85[_0xf26b('0x34')]=qs['offset'](_0x219ec9[_0xf26b('0x45')][_0xf26b('0x34')]);}return _0x34cc9f[_0xf26b('0xbb')](_0x85ff85);}})[_0xf26b('0x25')](function(_0x478aa9){if(_0x478aa9){return _0x478aa9?{'count':_0x45f4e7,'rows':_0x478aa9}:null;}})[_0xf26b('0x25')](respondWithResult(_0x480ae5,null))[_0xf26b('0x5a')](handleError(_0x480ae5,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 86f675d..b81fd02 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 _0x50d7=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','FaxAccount','setMaxListeners','save','update'];(function(_0x242b5d,_0x53bee2){var _0x430c3f=function(_0x1abbfb){while(--_0x1abbfb){_0x242b5d['push'](_0x242b5d['shift']());}};_0x430c3f(++_0x53bee2);}(_0x50d7,0x86));var _0x750d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x50d7[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0x750d('0x0'));var FaxAccount=require(_0x750d('0x1'))['db'][_0x750d('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x750d('0x3')](0x0);var events={'afterCreate':_0x750d('0x4'),'afterUpdate':_0x750d('0x5'),'afterDestroy':_0x750d('0x6')};function emitEvent(_0x127335){return function(_0x1e9643,_0x5443d5,_0x3f3efc){FaxAccountEvents[_0x750d('0x7')](_0x127335+':'+_0x1e9643['id'],_0x1e9643);FaxAccountEvents[_0x750d('0x7')](_0x127335,_0x1e9643);_0x3f3efc(null);};}for(var e in events){if(events[_0x750d('0x8')](e)){var event=events[e];FaxAccount[_0x750d('0x9')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x2277=['../../mysqldb','FaxAccount','setMaxListeners','remove','emit','hook','exports'];(function(_0x37628a,_0x92e3c6){var _0x1cf2bf=function(_0x4f3e74){while(--_0x4f3e74){_0x37628a['push'](_0x37628a['shift']());}};_0x1cf2bf(++_0x92e3c6);}(_0x2277,0x1b9));var _0x7227=function(_0xbac5b6,_0x5ba8da){_0xbac5b6=_0xbac5b6-0x0;var _0xec3e5e=_0x2277[_0xbac5b6];return _0xec3e5e;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x7227('0x0'))['db'][_0x7227('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x7227('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7227('0x3')};function emitEvent(_0x3dff52){return function(_0x39a327,_0x4e53d3,_0x1c765c){FaxAccountEvents[_0x7227('0x4')](_0x3dff52+':'+_0x39a327['id'],_0x39a327);FaxAccountEvents[_0x7227('0x4')](_0x3dff52,_0x39a327);_0x1c765c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x7227('0x5')](e,emitEvent(event));}}module[_0x7227('0x6')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index fc464c5..f11cfb1 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 _0x02fa=['bluebird','request-promise','path','rimraf','../../config/environment','define','FaxAccount','fax_accounts','lodash','util','api','moment'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0x02fa,0x74));var _0xa02f=function(_0x1f91ee,_0x3bc25d){_0x1f91ee=_0x1f91ee-0x0;var _0x3bf0b1=_0x02fa[_0x1f91ee];return _0x3bf0b1;};'use strict';var _=require(_0xa02f('0x0'));var util=require(_0xa02f('0x1'));var logger=require('../../config/logger')(_0xa02f('0x2'));var moment=require(_0xa02f('0x3'));var BPromise=require(_0xa02f('0x4'));var rp=require(_0xa02f('0x5'));var fs=require('fs');var path=require(_0xa02f('0x6'));var rimraf=require(_0xa02f('0x7'));var config=require(_0xa02f('0x8'));var attributes=require('./faxAccount.attributes');module['exports']=function(_0x23fd77,_0x54ae3a){return _0x23fd77[_0xa02f('0x9')](_0xa02f('0xa'),attributes,{'tableName':_0xa02f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe52b=['../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xe52b,0x132));var _0xbe52=function(_0x3fae42,_0x5b7bc4){_0x3fae42=_0x3fae42-0x0;var _0x4816db=_0xe52b[_0x3fae42];return _0x4816db;};'use strict';var _=require(_0xbe52('0x0'));var util=require(_0xbe52('0x1'));var logger=require(_0xbe52('0x2'))(_0xbe52('0x3'));var moment=require(_0xbe52('0x4'));var BPromise=require(_0xbe52('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbe52('0x6'));var attributes=require(_0xbe52('0x7'));module[_0xbe52('0x8')]=function(_0x5c47ca,_0x1b4a4d){return _0x5c47ca[_0xbe52('0x9')](_0xbe52('0xa'),attributes,{'tableName':_0xbe52('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 614a42f..ed8fcc5 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 _0x3c50=['body','fax','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','updatedAt','keys','createdAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','ValidationError','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','DESC','FaxApplication','Applications','List','get','account','applications','list','priority','asc','Contacts','length','contact','FaxInteraction','create','Contact\x20not\x20found','spread','autoclose','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','UserId','User','name','interaction','unshift','startRouting','Start','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFaxAccount','FaxAccount','findAll','options','attributes','include','map','model','NotifyFaxAccount'];(function(_0x3e7522,_0x2f04eb){var _0x3bb627=function(_0x3b40ff){while(--_0x3b40ff){_0x3e7522['push'](_0x3e7522['shift']());}};_0x3bb627(++_0x2f04eb);}(_0x3c50,0x132));var _0x03c5=function(_0x489d7b,_0x53767f){_0x489d7b=_0x489d7b-0x0;var _0x45b1fd=_0x3c50[_0x489d7b];return _0x45b1fd;};'use strict';var _=require(_0x03c5('0x0'));var util=require('util');var moment=require(_0x03c5('0x1'));var BPromise=require('bluebird');var rs=require(_0x03c5('0x2'));var fs=require('fs');var Redis=require(_0x03c5('0x3'));var db=require(_0x03c5('0x4'))['db'];var utils=require(_0x03c5('0x5'));var logger=require(_0x03c5('0x6'))(_0x03c5('0x7'));var config=require('../../config/environment');var jayson=require(_0x03c5('0x8'));var client=jayson['client'][_0x03c5('0x9')]({'port':0x232c});config[_0x03c5('0xa')]=_[_0x03c5('0xb')](config['redis'],{'host':_0x03c5('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x03c5('0xd'))['register'](socket);function respondWithRpcPromise(_0x457ec8,_0x5a3bed,_0x1893ed){return new BPromise(function(_0x30149d,_0x5f28a3){return client[_0x03c5('0xe')](_0x457ec8,_0x1893ed)[_0x03c5('0xf')](function(_0xdc225a){logger[_0x03c5('0x10')](_0x03c5('0x11'),_0x5a3bed,_0x03c5('0x12'));logger['debug'](_0x03c5('0x13'),_0x5a3bed,_0x03c5('0x12'),JSON[_0x03c5('0x14')](_0xdc225a));if(_0xdc225a[_0x03c5('0x15')]){if(_0xdc225a['error'][_0x03c5('0x16')]===0x1f4){logger[_0x03c5('0x15')]('FaxAccount,\x20%s,\x20%s',_0x5a3bed,_0xdc225a['error'][_0x03c5('0x17')]);return _0x5f28a3(_0xdc225a[_0x03c5('0x15')]['message']);}logger['error'](_0x03c5('0x11'),_0x5a3bed,_0xdc225a['error'][_0x03c5('0x17')]);return _0x30149d(_0xdc225a[_0x03c5('0x15')]['message']);}else{logger[_0x03c5('0x10')](_0x03c5('0x11'),_0x5a3bed,_0x03c5('0x12'));_0x30149d(_0xdc225a['result'][_0x03c5('0x17')]);}})[_0x03c5('0x18')](function(_0x59e1de){logger['error'](_0x03c5('0x11'),_0x5a3bed,_0x59e1de);_0x5f28a3(_0x59e1de);});});}exports[_0x03c5('0x19')]=function(_0x5ebf0a){var _0x57a601=this;return new Promise(function(_0x2347cb,_0x11a0ca){return db[_0x03c5('0x1a')][_0x03c5('0x1b')]({'raw':_0x5ebf0a['options']?_0x5ebf0a[_0x03c5('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5ebf0a[_0x03c5('0x1c')]?_0x5ebf0a[_0x03c5('0x1c')]['where']||null:null,'attributes':_0x5ebf0a[_0x03c5('0x1c')]?_0x5ebf0a[_0x03c5('0x1c')][_0x03c5('0x1d')]||null:null,'limit':_0x5ebf0a[_0x03c5('0x1c')]?_0x5ebf0a[_0x03c5('0x1c')]['limit']||null:null,'include':_0x5ebf0a['options']?_0x5ebf0a[_0x03c5('0x1c')][_0x03c5('0x1e')]?_['map'](_0x5ebf0a[_0x03c5('0x1c')][_0x03c5('0x1e')],function(_0x59f9ce){return{'model':db[_0x59f9ce['model']],'as':_0x59f9ce['as'],'attributes':_0x59f9ce[_0x03c5('0x1d')],'include':_0x59f9ce[_0x03c5('0x1e')]?_[_0x03c5('0x1f')](_0x59f9ce['include'],function(_0x21f51e){return{'model':db[_0x21f51e[_0x03c5('0x20')]],'as':_0x21f51e['as'],'attributes':_0x21f51e[_0x03c5('0x1d')],'include':_0x21f51e[_0x03c5('0x1e')]?_[_0x03c5('0x1f')](_0x21f51e[_0x03c5('0x1e')],function(_0x1d9eef){return{'model':db[_0x1d9eef[_0x03c5('0x20')]],'as':_0x1d9eef['as'],'attributes':_0x1d9eef['attributes']};}):[]};}):[]};}):[]:[]})[_0x03c5('0xf')](function(_0x43dde1){logger['info'](_0x03c5('0x19'),_0x5ebf0a);logger['debug']('GetFaxAccount',_0x5ebf0a,JSON['stringify'](_0x43dde1));_0x2347cb(_0x43dde1);})[_0x03c5('0x18')](function(_0x175df7){logger[_0x03c5('0x15')]('GetFaxAccount',_0x175df7['message'],_0x5ebf0a);_0x11a0ca(_0x57a601[_0x03c5('0x15')](0x1f4,_0x175df7['message']));});});};exports[_0x03c5('0x21')]=function(_0x5ec69e,_0x5c3c0b,_0x3eda89){var _0x7172b8=this;return new Promise(function(_0x5cb625,_0x3909fb){var _0x5d6bdc={'body':_0x5ec69e[_0x03c5('0x22')],'channel':_0x03c5('0x23')};var _0x1a23d5=[];var _0xf53e7=[];var _0x29d5f7={};return db[_0x03c5('0x24')][_0x03c5('0x25')]()[_0x03c5('0xf')](function(_0x5c1a1a){if(!_0x5c1a1a){throw new db[(_0x03c5('0x26'))]['ValidationError'](_0x03c5('0x27'));}_0x1a23d5=_[_0x03c5('0x28')](_['keys'](_0x5c1a1a),['createdAt',_0x03c5('0x29')]);_0xf53e7=_['difference'](_[_0x03c5('0x2a')](_0x5c1a1a),[_0x03c5('0x2b'),_0x03c5('0x29'),'CompanyId',_0x03c5('0x2c')]);if(_0x5ec69e[_0x03c5('0x22')]['id']){delete _0x5ec69e[_0x03c5('0x22')]['id'];}if(_[_0x03c5('0x2d')](_0x5ec69e[_0x03c5('0x22')][_0x03c5('0x2e')])){throw new db['Sequelize']['ValidationError'](_0x03c5('0x2f'));}if(_['isNil'](_0x5ec69e[_0x03c5('0x22')]['body'])||_0x5ec69e[_0x03c5('0x22')][_0x03c5('0x22')]===''){throw new db[(_0x03c5('0x26'))]['ValidationError'](_0x03c5('0x30'));}if(_['isNil'](_0x5ec69e['body'][_0x03c5('0x31')])){throw new db[(_0x03c5('0x26'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xf53e7);}if(!_['includes'](_0xf53e7,_0x5ec69e['body']['mapKey'])){throw new db[(_0x03c5('0x26'))][(_0x03c5('0x32'))](_0x03c5('0x33')+_0xf53e7);}_0x29d5f7[_0x5ec69e[_0x03c5('0x22')]['mapKey']]=_0x5ec69e[_0x03c5('0x22')]['from'];})[_0x03c5('0xf')](function(){return db['FaxAccount'][_0x03c5('0x34')]({'where':{'id':_0x5ec69e['account']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x03c5('0x24')],'as':'Contacts','where':_0x29d5f7,'limit':0x1,'order':[['updatedAt',_0x03c5('0x35')]]}]},{'model':db[_0x03c5('0x36')],'as':_0x03c5('0x37')}]});})[_0x03c5('0xf')](function(_0x37f24e){if(_0x37f24e&&_0x37f24e[_0x03c5('0x38')]){var _0x135af0=_0x37f24e[_0x03c5('0x39')]({'plain':!![]});_0x5d6bdc[_0x03c5('0x3a')]=_0x135af0;_0x5d6bdc[_0x03c5('0x3b')]=_0x135af0[_0x03c5('0x37')];_0x5d6bdc[_0x03c5('0x3c')]=_0x135af0[_0x03c5('0x38')];_0x5d6bdc[_0x03c5('0x3b')]=_['orderBy'](_0x5d6bdc['applications'],[_0x03c5('0x3d')],[_0x03c5('0x3e')]);if(_0x5d6bdc[_0x03c5('0x3a')][_0x03c5('0x37')]){delete _0x5d6bdc['account'][_0x03c5('0x37')];}if(_0x5d6bdc['account'][_0x03c5('0x38')]&&_0x5d6bdc[_0x03c5('0x3a')]['List'][_0x03c5('0x3f')][_0x03c5('0x40')]){return _0x5d6bdc[_0x03c5('0x3a')]['List']['Contacts'][0x0];}var _0x248d24=_[_0x03c5('0xb')](_0x5ec69e['body'],{'firstName':_0x5ec69e[_0x03c5('0x22')][_0x03c5('0x2e')],'ListId':_0x135af0[_0x03c5('0x2c')]});_0x248d24[_0x5ec69e[_0x03c5('0x22')][_0x03c5('0x31')]]=_0x5ec69e[_0x03c5('0x22')]['from'];return db[_0x03c5('0x24')]['create'](_0x248d24,{'fields':_0x1a23d5,'raw':!![]});}})[_0x03c5('0xf')](function(_0xa22da9){_0x5d6bdc[_0x03c5('0x41')]=_0xa22da9;if(_0xa22da9){var _0x4989a7={'ContactId':_0xa22da9['id'],'FaxAccountId':_0x5ec69e[_0x03c5('0x3a')]['id'],'fax':_0xa22da9[_0x03c5('0x23')]};return db['FaxInteraction']['find']({'where':{'ContactId':_0xa22da9['id'],'closed':![],'FaxAccountId':_0x5ec69e[_0x03c5('0x3a')]['id']}})['then'](function(_0x5b47f1){if(_0x5b47f1){return[_0x5b47f1,![]];}return db[_0x03c5('0x42')][_0x03c5('0x43')](_0x4989a7)[_0x03c5('0xf')](function(_0x2746ae){return[_0x2746ae,!![]];});});}else{throw new Error(_0x03c5('0x44'));}})[_0x03c5('0x45')](function(_0x4f2031,_0x18e73a){var _0x589495=_0x4f2031[_0x03c5('0x39')]({'plain':!![]});if(_0x18e73a){if(_0x5d6bdc['account'][_0x03c5('0x46')]){_0x5d6bdc['applications']['push']({'id':0x0,'priority':_0x5d6bdc[_0x03c5('0x3b')][_0x03c5('0x40')]+0x1,'app':_0x03c5('0x47'),'appdata':_0x03c5('0x48'),'interval':_0x03c5('0x49')});}_0x589495[_0x03c5('0x4a')]=!![];}else{_0x589495['created']=![];}_0x5d6bdc['interaction']=_0x589495;return db[_0x03c5('0x4b')][_0x03c5('0x43')]({'body':_0x5ec69e[_0x03c5('0x22')]['body'],'FaxAccountId':_0x5ec69e[_0x03c5('0x3a')]['id'],'FaxInteractionId':_0x4f2031['id'],'direction':'in','ContactId':_0x4f2031[_0x03c5('0x4c')],'AttachmentId':_0x5ec69e[_0x03c5('0x22')][_0x03c5('0x4d')]});})['then'](function(_0x3f40b3){_0x5d6bdc['message']=_0x3f40b3;if(_0x5d6bdc['interaction'][_0x03c5('0x4e')]){return db[_0x03c5('0x4f')][_0x03c5('0x34')]({'attributes':['id',_0x03c5('0x50')],'where':{'id':_0x5d6bdc[_0x03c5('0x51')][_0x03c5('0x4e')]}})[_0x03c5('0xf')](function(_0x32e66d){if(_0x32e66d){_0x5d6bdc[_0x03c5('0x3b')][_0x03c5('0x52')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x32e66d[_0x03c5('0x50')]+','+(_0x5d6bdc[_0x03c5('0x3a')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x03c5('0x53'),_0x5d6bdc);});}return respondWithRpcPromise(_0x03c5('0x54'),'startRouting',_0x5d6bdc);})[_0x03c5('0xf')](function(_0x535823){_0x5cb625(_0x535823);})[_0x03c5('0x18')](function(_0x400ce8){_0x3909fb(_0x7172b8[_0x03c5('0x15')](0x1f4,_0x400ce8[_0x03c5('0x17')]));});});}; \ No newline at end of file +var _0x9641=['mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','CmContact','Contacts','Applications','get','applications','list','priority','asc','defaults','create','FaxInteraction','spread','autoclose','length','close','*,*,*,*','created','interaction','AttachmentId','User','find','name','UserId','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','GetFaxAccount','FaxAccount','options','raw','where','attributes','limit','include','map','model','stringify','NotifyFaxAccount','body','fax','describe','ValidationError','keys','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty'];(function(_0x2fe24f,_0x34ef80){var _0x5c6bb8=function(_0x4f61c1){while(--_0x4f61c1){_0x2fe24f['push'](_0x2fe24f['shift']());}};_0x5c6bb8(++_0x34ef80);}(_0x9641,0x79));var _0x1964=function(_0x22a27c,_0x1aac06){_0x22a27c=_0x22a27c-0x0;var _0x9ecf55=_0x9641[_0x22a27c];return _0x9ecf55;};'use strict';var _=require(_0x1964('0x0'));var util=require(_0x1964('0x1'));var moment=require(_0x1964('0x2'));var BPromise=require(_0x1964('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1964('0x4'))['db'];var utils=require(_0x1964('0x5'));var logger=require('../../config/logger')(_0x1964('0x6'));var config=require(_0x1964('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1964('0x8')][_0x1964('0x9')]({'port':0x232c});config[_0x1964('0xa')]=_['defaults'](config[_0x1964('0xa')],{'host':_0x1964('0xb'),'port':0x18eb});var socket=require(_0x1964('0xc'))(new Redis(config['redis']));require(_0x1964('0xd'))['register'](socket);function respondWithRpcPromise(_0x18f1e6,_0x38812d,_0x42ba6c){return new BPromise(function(_0x5681c5,_0x553221){return client[_0x1964('0xe')](_0x18f1e6,_0x42ba6c)[_0x1964('0xf')](function(_0x3ee857){logger[_0x1964('0x10')](_0x1964('0x11'),_0x38812d,'request\x20sent');logger[_0x1964('0x12')](_0x1964('0x13'),_0x38812d,'request\x20sent',JSON['stringify'](_0x3ee857));if(_0x3ee857[_0x1964('0x14')]){if(_0x3ee857[_0x1964('0x14')][_0x1964('0x15')]===0x1f4){logger[_0x1964('0x14')](_0x1964('0x11'),_0x38812d,_0x3ee857['error'][_0x1964('0x16')]);return _0x553221(_0x3ee857[_0x1964('0x14')][_0x1964('0x16')]);}logger[_0x1964('0x14')](_0x1964('0x11'),_0x38812d,_0x3ee857['error'][_0x1964('0x16')]);return _0x5681c5(_0x3ee857[_0x1964('0x14')][_0x1964('0x16')]);}else{logger[_0x1964('0x10')](_0x1964('0x11'),_0x38812d,_0x1964('0x17'));_0x5681c5(_0x3ee857[_0x1964('0x18')][_0x1964('0x16')]);}})[_0x1964('0x19')](function(_0x42c0d1){logger[_0x1964('0x14')](_0x1964('0x11'),_0x38812d,_0x42c0d1);_0x553221(_0x42c0d1);});});}exports[_0x1964('0x1a')]=function(_0x2a89bf){var _0x559a75=this;return new Promise(function(_0x29fc3c,_0x3767f1){return db[_0x1964('0x1b')]['findAll']({'raw':_0x2a89bf[_0x1964('0x1c')]?_0x2a89bf[_0x1964('0x1c')][_0x1964('0x1d')]===undefined?!![]:![]:!![],'where':_0x2a89bf[_0x1964('0x1c')]?_0x2a89bf[_0x1964('0x1c')][_0x1964('0x1e')]||null:null,'attributes':_0x2a89bf[_0x1964('0x1c')]?_0x2a89bf[_0x1964('0x1c')][_0x1964('0x1f')]||null:null,'limit':_0x2a89bf[_0x1964('0x1c')]?_0x2a89bf[_0x1964('0x1c')][_0x1964('0x20')]||null:null,'include':_0x2a89bf[_0x1964('0x1c')]?_0x2a89bf[_0x1964('0x1c')][_0x1964('0x21')]?_[_0x1964('0x22')](_0x2a89bf[_0x1964('0x1c')][_0x1964('0x21')],function(_0x1b4207){return{'model':db[_0x1b4207[_0x1964('0x23')]],'as':_0x1b4207['as'],'attributes':_0x1b4207['attributes'],'include':_0x1b4207[_0x1964('0x21')]?_[_0x1964('0x22')](_0x1b4207['include'],function(_0x2a2376){return{'model':db[_0x2a2376['model']],'as':_0x2a2376['as'],'attributes':_0x2a2376[_0x1964('0x1f')],'include':_0x2a2376[_0x1964('0x21')]?_[_0x1964('0x22')](_0x2a2376['include'],function(_0x7ca6f9){return{'model':db[_0x7ca6f9[_0x1964('0x23')]],'as':_0x7ca6f9['as'],'attributes':_0x7ca6f9[_0x1964('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1964('0xf')](function(_0x1b415a){logger[_0x1964('0x10')](_0x1964('0x1a'),_0x2a89bf);logger[_0x1964('0x12')]('GetFaxAccount',_0x2a89bf,JSON[_0x1964('0x24')](_0x1b415a));_0x29fc3c(_0x1b415a);})[_0x1964('0x19')](function(_0x2fb8b0){logger[_0x1964('0x14')]('GetFaxAccount',_0x2fb8b0[_0x1964('0x16')],_0x2a89bf);_0x3767f1(_0x559a75['error'](0x1f4,_0x2fb8b0['message']));});});};exports[_0x1964('0x25')]=function(_0x2945b7,_0x506eba,_0x1bbdbc){var _0xd458b2=this;return new Promise(function(_0x256651,_0x115fd0){var _0x19b54b={'body':_0x2945b7[_0x1964('0x26')],'channel':_0x1964('0x27')};var _0x211e2e=[];var _0x1591a1=[];var _0xa106d3={};return db['CmContact'][_0x1964('0x28')]()['then'](function(_0x47b6f2){if(!_0x47b6f2){throw new db['Sequelize'][(_0x1964('0x29'))]('no\x20available\x20attributes');}_0x211e2e=_['difference'](_[_0x1964('0x2a')](_0x47b6f2),['createdAt','updatedAt']);_0x1591a1=_[_0x1964('0x2b')](_[_0x1964('0x2a')](_0x47b6f2),[_0x1964('0x2c'),_0x1964('0x2d'),_0x1964('0x2e'),_0x1964('0x2f')]);if(_0x2945b7[_0x1964('0x26')]['id']){delete _0x2945b7[_0x1964('0x26')]['id'];}if(_[_0x1964('0x30')](_0x2945b7[_0x1964('0x26')][_0x1964('0x31')])){throw new db['Sequelize']['ValidationError'](_0x1964('0x32'));}if(_[_0x1964('0x30')](_0x2945b7[_0x1964('0x26')][_0x1964('0x26')])||_0x2945b7[_0x1964('0x26')]['body']===''){throw new db[(_0x1964('0x33'))]['ValidationError'](_0x1964('0x34'));}if(_['isNil'](_0x2945b7[_0x1964('0x26')][_0x1964('0x35')])){throw new db[(_0x1964('0x33'))][(_0x1964('0x29'))](_0x1964('0x36')+_0x1591a1);}if(!_[_0x1964('0x37')](_0x1591a1,_0x2945b7[_0x1964('0x26')][_0x1964('0x35')])){throw new db[(_0x1964('0x33'))]['ValidationError'](_0x1964('0x38')+_0x1591a1);}_0xa106d3[_0x2945b7[_0x1964('0x26')][_0x1964('0x35')]]=_0x2945b7[_0x1964('0x26')][_0x1964('0x31')];})['then'](function(){return db[_0x1964('0x1b')]['find']({'where':{'id':_0x2945b7[_0x1964('0x39')]['id']},'include':[{'model':db[_0x1964('0x3a')],'as':_0x1964('0x3b'),'include':[{'model':db[_0x1964('0x3c')],'as':_0x1964('0x3d'),'where':_0xa106d3,'limit':0x1,'order':[[_0x1964('0x2d'),'DESC']]}]},{'model':db['FaxApplication'],'as':_0x1964('0x3e')}]});})['then'](function(_0x2b87f1){if(_0x2b87f1&&_0x2b87f1[_0x1964('0x3b')]){var _0x5165e=_0x2b87f1[_0x1964('0x3f')]({'plain':!![]});_0x19b54b[_0x1964('0x39')]=_0x5165e;_0x19b54b[_0x1964('0x40')]=_0x5165e['Applications'];_0x19b54b[_0x1964('0x41')]=_0x5165e[_0x1964('0x3b')];_0x19b54b[_0x1964('0x40')]=_['orderBy'](_0x19b54b[_0x1964('0x40')],[_0x1964('0x42')],[_0x1964('0x43')]);if(_0x19b54b['account'][_0x1964('0x3e')]){delete _0x19b54b['account'][_0x1964('0x3e')];}if(_0x19b54b['account'][_0x1964('0x3b')]&&_0x19b54b[_0x1964('0x39')][_0x1964('0x3b')]['Contacts']['length']){return _0x19b54b[_0x1964('0x39')][_0x1964('0x3b')][_0x1964('0x3d')][0x0];}var _0x255a64=_[_0x1964('0x44')](_0x2945b7['body'],{'firstName':_0x2945b7[_0x1964('0x26')][_0x1964('0x31')],'ListId':_0x5165e[_0x1964('0x2f')]});_0x255a64[_0x2945b7[_0x1964('0x26')][_0x1964('0x35')]]=_0x2945b7[_0x1964('0x26')][_0x1964('0x31')];return db[_0x1964('0x3c')][_0x1964('0x45')](_0x255a64,{'fields':_0x211e2e,'raw':!![]});}})[_0x1964('0xf')](function(_0xed0b14){_0x19b54b['contact']=_0xed0b14;if(_0xed0b14){var _0x4b777e={'ContactId':_0xed0b14['id'],'FaxAccountId':_0x2945b7[_0x1964('0x39')]['id'],'fax':_0xed0b14[_0x1964('0x27')]};return db['FaxInteraction']['find']({'where':{'ContactId':_0xed0b14['id'],'closed':![],'FaxAccountId':_0x2945b7[_0x1964('0x39')]['id']}})['then'](function(_0x2ed35b){if(_0x2ed35b){return[_0x2ed35b,![]];}return db[_0x1964('0x46')][_0x1964('0x45')](_0x4b777e)['then'](function(_0x3b9437){return[_0x3b9437,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x1964('0x47')](function(_0x41253b,_0x273bac){var _0x4d26f8=_0x41253b['get']({'plain':!![]});if(_0x273bac){if(_0x19b54b[_0x1964('0x39')][_0x1964('0x48')]){_0x19b54b[_0x1964('0x40')]['push']({'id':0x0,'priority':_0x19b54b[_0x1964('0x40')][_0x1964('0x49')]+0x1,'app':_0x1964('0x4a'),'appdata':'unmanaged','interval':_0x1964('0x4b')});}_0x4d26f8[_0x1964('0x4c')]=!![];}else{_0x4d26f8['created']=![];}_0x19b54b[_0x1964('0x4d')]=_0x4d26f8;return db['FaxMessage'][_0x1964('0x45')]({'body':_0x2945b7['body'][_0x1964('0x26')],'FaxAccountId':_0x2945b7[_0x1964('0x39')]['id'],'FaxInteractionId':_0x41253b['id'],'direction':'in','ContactId':_0x41253b['ContactId'],'AttachmentId':_0x2945b7[_0x1964('0x26')][_0x1964('0x4e')]});})[_0x1964('0xf')](function(_0x59a983){_0x19b54b[_0x1964('0x16')]=_0x59a983;if(_0x19b54b[_0x1964('0x4d')]['UserId']){return db[_0x1964('0x4f')][_0x1964('0x50')]({'attributes':['id',_0x1964('0x51')],'where':{'id':_0x19b54b[_0x1964('0x4d')][_0x1964('0x52')]}})[_0x1964('0xf')](function(_0x4cf9fd){if(_0x4cf9fd){_0x19b54b['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x1964('0x53'),'appdata':_0x4cf9fd[_0x1964('0x51')]+','+(_0x19b54b[_0x1964('0x39')][_0x1964('0x54')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x1964('0x55'),_0x1964('0x56'),_0x19b54b);});}return respondWithRpcPromise(_0x1964('0x55'),_0x1964('0x56'),_0x19b54b);})['then'](function(_0x28ead5){_0x256651(_0x28ead5);})[_0x1964('0x19')](function(_0x2fe935){_0x115fd0(_0xd458b2[_0x1964('0x14')](0x1f4,_0x2fe935[_0x1964('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 9a2166d..3916deb 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 _0x7bb9=['register','length','faxAccount:','./faxAccount.events','save','update'];(function(_0x318f40,_0x344b1c){var _0x178836=function(_0x47abb5){while(--_0x47abb5){_0x318f40['push'](_0x318f40['shift']());}};_0x178836(++_0x344b1c);}(_0x7bb9,0x9f));var _0x97bb=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x7bb9[_0x1ccdf7];return _0x52a0ae;};'use strict';var FaxAccountEvents=require(_0x97bb('0x0'));var events=[_0x97bb('0x1'),'remove',_0x97bb('0x2')];function createListener(_0x135428,_0x581692){return function(_0x17f947){_0x581692['emit'](_0x135428,_0x17f947);};}function removeListener(_0x12bede,_0xe7c693){return function(){FaxAccountEvents['removeListener'](_0x12bede,_0xe7c693);};}exports[_0x97bb('0x3')]=function(_0x52fbce){for(var _0x43be91=0x0,_0x3774d5=events[_0x97bb('0x4')];_0x43be91<_0x3774d5;_0x43be91++){var _0x355592=events[_0x43be91];var _0x28a6be=createListener(_0x97bb('0x5')+_0x355592,_0x52fbce);FaxAccountEvents['on'](_0x355592,_0x28a6be);}}; \ No newline at end of file +var _0xfce4=['length','faxAccount:','./faxAccount.events','remove','update','emit','removeListener','register'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0xfce4,0x15a));var _0x4fce=function(_0x34b6aa,_0x5ddd29){_0x34b6aa=_0x34b6aa-0x0;var _0x3ead29=_0xfce4[_0x34b6aa];return _0x3ead29;};'use strict';var FaxAccountEvents=require(_0x4fce('0x0'));var events=['save',_0x4fce('0x1'),_0x4fce('0x2')];function createListener(_0x3ef463,_0x1bdeee){return function(_0x53b67b){_0x1bdeee[_0x4fce('0x3')](_0x3ef463,_0x53b67b);};}function removeListener(_0x4a1348,_0x9246ef){return function(){FaxAccountEvents[_0x4fce('0x4')](_0x4a1348,_0x9246ef);};}exports[_0x4fce('0x5')]=function(_0x4a4d88){for(var _0x3b885b=0x0,_0x5570f2=events[_0x4fce('0x6')];_0x3b885b<_0x5570f2;_0x3b885b++){var _0x4bf293=events[_0x3b885b];var _0x45ccb3=createListener(_0x4fce('0x7')+_0x4bf293,_0x4a4d88);FaxAccountEvents['on'](_0x4bf293,_0x45ccb3);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 3d4bbfc..95759e3 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 _0x0b6e=['getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','/:id/applications','/:id/messages','/:id/users','post','create','addDisposition','addAnswer','/addaccountapplications','/updateaccountapplications','updateAccountApplications','send','addAgents','put','update','delete','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','multer','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x5bda16,_0x903980){var _0x17ab57=function(_0x300f3c){while(--_0x300f3c){_0x5bda16['push'](_0x5bda16['shift']());}};_0x17ab57(++_0x903980);}(_0x0b6e,0x1c7));var _0xe0b6=function(_0x34ad35,_0x3c4116){_0x34ad35=_0x34ad35-0x0;var _0x52aa7f=_0x0b6e[_0x34ad35];return _0x52aa7f;};'use strict';var multer=require(_0xe0b6('0x0'));var util=require('util');var path=require(_0xe0b6('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b6('0x2'));var router=express[_0xe0b6('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xe0b6('0x4'));var config=require(_0xe0b6('0x5'));var controller=require('./faxAccount.controller');router[_0xe0b6('0x6')]('/',auth[_0xe0b6('0x7')](),controller[_0xe0b6('0x8')]);router['get'](_0xe0b6('0x9'),auth[_0xe0b6('0x7')](),controller[_0xe0b6('0xa')]);router[_0xe0b6('0x6')](_0xe0b6('0xb'),auth[_0xe0b6('0x7')](),controller[_0xe0b6('0xc')]);router['get']('/:id/dispositions',auth[_0xe0b6('0x7')](),controller[_0xe0b6('0xd')]);router['get'](_0xe0b6('0xe'),auth[_0xe0b6('0x7')](),controller[_0xe0b6('0xf')]);router['get'](_0xe0b6('0x10'),auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0xe0b6('0x11'),auth[_0xe0b6('0x7')](),controller['getApplications']);router[_0xe0b6('0x6')](_0xe0b6('0x12'),auth[_0xe0b6('0x7')](),controller['getMessages']);router['get'](_0xe0b6('0x13'),auth[_0xe0b6('0x7')](),controller['getAgents']);router[_0xe0b6('0x14')]('/',auth[_0xe0b6('0x7')](),controller[_0xe0b6('0x15')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xe0b6('0x16')]);router[_0xe0b6('0x14')](_0xe0b6('0xe'),auth[_0xe0b6('0x7')](),controller[_0xe0b6('0x17')]);router[_0xe0b6('0x14')](_0xe0b6('0x10'),auth[_0xe0b6('0x7')](),controller['addInteraction']);router['post']('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router[_0xe0b6('0x14')](_0xe0b6('0x18'),auth[_0xe0b6('0x7')](),controller['addAccountApplications']);router['post'](_0xe0b6('0x19'),auth['isAuthenticated'](),controller[_0xe0b6('0x1a')]);router[_0xe0b6('0x14')]('/:id/send',auth[_0xe0b6('0x7')](),controller[_0xe0b6('0x1b')]);router['post'](_0xe0b6('0x13'),auth[_0xe0b6('0x7')](),controller[_0xe0b6('0x1c')]);router[_0xe0b6('0x1d')](_0xe0b6('0xb'),auth[_0xe0b6('0x7')](),controller[_0xe0b6('0x1e')]);router[_0xe0b6('0x1f')](_0xe0b6('0xb'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xe0b6('0x20'),auth['isAuthenticated'](),controller[_0xe0b6('0x21')]);router[_0xe0b6('0x1f')]('/:id/canned_answers',auth[_0xe0b6('0x7')](),controller[_0xe0b6('0x22')]);router[_0xe0b6('0x1f')](_0xe0b6('0x13'),auth[_0xe0b6('0x7')](),controller[_0xe0b6('0x23')]);module['exports']=router; \ No newline at end of file +var _0xffcd=['/:id','show','/:id/dispositions','getAnswers','/:id/interactions','getApplications','getMessages','/:id/users','getAgents','post','/:id/canned_answers','addInteraction','/:id/applications','addApplications','/addaccountapplications','addAccountApplications','updateAccountApplications','/:id/send','send','addAgents','put','update','destroy','removeAnswers','removeAgents','exports','multer','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x8c270d,_0x564f82){var _0x576be4=function(_0x37b5dc){while(--_0x37b5dc){_0x8c270d['push'](_0x8c270d['shift']());}};_0x576be4(++_0x564f82);}(_0xffcd,0x167));var _0xdffc=function(_0x1bdf0a,_0x510790){_0x1bdf0a=_0x1bdf0a-0x0;var _0x5ec6a2=_0xffcd[_0x1bdf0a];return _0x5ec6a2;};'use strict';var multer=require(_0xdffc('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdffc('0x1')]();var auth=require(_0xdffc('0x2'));var interaction=require(_0xdffc('0x3'));var config=require(_0xdffc('0x4'));var controller=require(_0xdffc('0x5'));router['get']('/',auth[_0xdffc('0x6')](),controller[_0xdffc('0x7')]);router[_0xdffc('0x8')](_0xdffc('0x9'),auth[_0xdffc('0x6')](),controller[_0xdffc('0xa')]);router['get'](_0xdffc('0xb'),auth['isAuthenticated'](),controller[_0xdffc('0xc')]);router[_0xdffc('0x8')](_0xdffc('0xd'),auth[_0xdffc('0x6')](),controller['getDispositions']);router[_0xdffc('0x8')]('/:id/canned_answers',auth[_0xdffc('0x6')](),controller[_0xdffc('0xe')]);router[_0xdffc('0x8')](_0xdffc('0xf'),auth[_0xdffc('0x6')](),controller['getInteractions']);router[_0xdffc('0x8')]('/:id/applications',auth[_0xdffc('0x6')](),controller[_0xdffc('0x10')]);router[_0xdffc('0x8')]('/:id/messages',auth[_0xdffc('0x6')](),controller[_0xdffc('0x11')]);router['get'](_0xdffc('0x12'),auth['isAuthenticated'](),controller[_0xdffc('0x13')]);router[_0xdffc('0x14')]('/',auth[_0xdffc('0x6')](),controller['create']);router['post'](_0xdffc('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xdffc('0x14')](_0xdffc('0x15'),auth[_0xdffc('0x6')](),controller['addAnswer']);router[_0xdffc('0x14')](_0xdffc('0xf'),auth[_0xdffc('0x6')](),controller[_0xdffc('0x16')]);router['post'](_0xdffc('0x17'),auth[_0xdffc('0x6')](),controller[_0xdffc('0x18')]);router[_0xdffc('0x14')](_0xdffc('0x19'),auth[_0xdffc('0x6')](),controller[_0xdffc('0x1a')]);router[_0xdffc('0x14')]('/updateaccountapplications',auth['isAuthenticated'](),controller[_0xdffc('0x1b')]);router[_0xdffc('0x14')](_0xdffc('0x1c'),auth['isAuthenticated'](),controller[_0xdffc('0x1d')]);router['post']('/:id/users',auth[_0xdffc('0x6')](),controller[_0xdffc('0x1e')]);router[_0xdffc('0x1f')](_0xdffc('0xb'),auth[_0xdffc('0x6')](),controller[_0xdffc('0x20')]);router['delete'](_0xdffc('0xb'),auth[_0xdffc('0x6')](),controller[_0xdffc('0x21')]);router['delete'](_0xdffc('0xd'),auth[_0xdffc('0x6')](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0xdffc('0x6')](),controller[_0xdffc('0x22')]);router['delete'](_0xdffc('0x12'),auth[_0xdffc('0x6')](),controller[_0xdffc('0x23')]);module[_0xdffc('0x24')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index d3f35ed..387d8c9 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 _0x3b90=['INTEGER','STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x192f16,_0x454664){var _0x5b6b0b=function(_0x33ff45){while(--_0x33ff45){_0x192f16['push'](_0x192f16['shift']());}};_0x5b6b0b(++_0x454664);}(_0x3b90,0x143));var _0x03b9=function(_0x1fd675,_0x165dfe){_0x1fd675=_0x1fd675-0x0;var _0x16b554=_0x3b90[_0x1fd675];return _0x16b554;};'use strict';var Sequelize=require('sequelize');module[_0x03b9('0x0')]={'priority':{'type':Sequelize[_0x03b9('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x03b9('0x2')],'allowNull':![],'defaultValue':_0x03b9('0x3')},'appdata':{'type':Sequelize[_0x03b9('0x4')]()},'description':{'type':Sequelize[_0x03b9('0x2')]},'interval':{'type':Sequelize[_0x03b9('0x2')],'defaultValue':_0x03b9('0x5')}}; \ No newline at end of file +var _0xdc91=['exports','STRING','*,*,*,*','sequelize'];(function(_0x185369,_0x1af9f4){var _0x57185b=function(_0x3373c9){while(--_0x3373c9){_0x185369['push'](_0x185369['shift']());}};_0x57185b(++_0x1af9f4);}(_0xdc91,0x8b));var _0x1dc9=function(_0x3b8868,_0x582cfd){_0x3b8868=_0x3b8868-0x0;var _0x504818=_0xdc91[_0x3b8868];return _0x504818;};'use strict';var Sequelize=require(_0x1dc9('0x0'));module[_0x1dc9('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x1dc9('0x2')]},'interval':{'type':Sequelize[_0x1dc9('0x2')],'defaultValue':_0x1dc9('0x3')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index a5b8828..f95868e 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 _0x8141=['status','end','json','count','offset','set','Content-Range','reject','save','then','destroy','stack','name','send','index','FaxApplication','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','nolimit','limit','sort','where','merge','map','type','key','field','options','include','findAll','rows','show','params','includeAll','catch','create','body','update','find','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x330723,_0x8de382){var _0x60c546=function(_0xd6d3fe){while(--_0xd6d3fe){_0x330723['push'](_0x330723['shift']());}};_0x60c546(++_0x8de382);}(_0x8141,0xb8));var _0x1814=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8141[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x1814('0x0'));var emlformat=require(_0x1814('0x1'));var rimraf=require(_0x1814('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1814('0x3'));var rp=require(_0x1814('0x4'));var moment=require(_0x1814('0x5'));var BPromise=require(_0x1814('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1814('0x7'));var sox=require('sox');var csv=require(_0x1814('0x8'));var ejs=require(_0x1814('0x9'));var fs=require('fs');var _=require(_0x1814('0xa'));var squel=require(_0x1814('0xb'));var crypto=require(_0x1814('0xc'));var jsforce=require(_0x1814('0xd'));var deskjs=require(_0x1814('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1814('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1814('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x1814('0x11'));var logger=require('../../config/logger')(_0x1814('0x12'));var utils=require(_0x1814('0x13'));var config=require(_0x1814('0x14'));var db=require(_0x1814('0x15'))['db'];function respondWithStatusCode(_0x22e882,_0x41525d){_0x41525d=_0x41525d||0xcc;return function(_0x77054){if(_0x77054){return _0x22e882[_0x1814('0x16')](_0x41525d);}return _0x22e882[_0x1814('0x17')](_0x41525d)[_0x1814('0x18')]();};}function respondWithResult(_0x8e559d,_0x22473f){_0x22473f=_0x22473f||0xc8;return function(_0x1a6c23){if(_0x1a6c23){return _0x8e559d[_0x1814('0x17')](_0x22473f)[_0x1814('0x19')](_0x1a6c23);}};}function respondWithFilteredResult(_0x10158d,_0x428a1f){return function(_0x45cb50){if(_0x45cb50){var _0x4275be=_0x45cb50[_0x1814('0x1a')],_0xec04bb=_0x428a1f[_0x1814('0x1b')],_0x41eb40=_0x428a1f[_0x1814('0x1b')]+_0x428a1f['limit'],_0x1fac69;if(_0x41eb40>=_0x4275be){_0x41eb40=_0x4275be;_0x1fac69=0xc8;}else{_0x1fac69=0xce;}_0x10158d[_0x1814('0x17')](_0x1fac69);return _0x10158d[_0x1814('0x1c')](_0x1814('0x1d'),_0xec04bb+'-'+_0x41eb40+'/'+_0x4275be)[_0x1814('0x19')](_0x45cb50);}return null;};}function patchUpdates(_0x38fa78){return function(_0x3c90d4){try{jsonpatch['apply'](_0x3c90d4,_0x38fa78,!![]);}catch(_0x7df594){return BPromise[_0x1814('0x1e')](_0x7df594);}return _0x3c90d4[_0x1814('0x1f')]();};}function saveUpdates(_0x13a7d2,_0x3da048){return function(_0x405828){if(_0x405828){return _0x405828['update'](_0x13a7d2)[_0x1814('0x20')](function(_0x4909b9){return _0x4909b9;});}return null;};}function removeEntity(_0x4f0bf2,_0x5e2842){return function(_0x455d73){if(_0x455d73){return _0x455d73[_0x1814('0x21')]()[_0x1814('0x20')](function(){_0x4f0bf2['status'](0xcc)[_0x1814('0x18')]();});}};}function handleEntityNotFound(_0x5c691c,_0x173d2c){return function(_0x17112d){if(!_0x17112d){_0x5c691c[_0x1814('0x16')](0x194);}return _0x17112d;};}function handleError(_0x62936f,_0x2212af){_0x2212af=_0x2212af||0x1f4;return function(_0x7d7ff2){logger['error'](_0x7d7ff2[_0x1814('0x22')]);if(_0x7d7ff2[_0x1814('0x23')]){delete _0x7d7ff2[_0x1814('0x23')];}_0x62936f[_0x1814('0x17')](_0x2212af)[_0x1814('0x24')](_0x7d7ff2);};}exports[_0x1814('0x25')]=function(_0x62c7a3,_0x186830){var _0x2559fb={},_0x4dff57={},_0x499a41={'count':0x0,'rows':[]};var _0x924a06=db[_0x1814('0x26')][_0x1814('0x27')];_0x4dff57['model']=_[_0x1814('0x28')](_0x924a06);_0x4dff57['query']=_[_0x1814('0x28')](_0x62c7a3[_0x1814('0x29')]);_0x4dff57[_0x1814('0x2a')]=_[_0x1814('0x2b')](_0x4dff57['model'],_0x4dff57[_0x1814('0x29')]);_0x2559fb[_0x1814('0x2c')]=_[_0x1814('0x2b')](_0x4dff57[_0x1814('0x2d')],qs[_0x1814('0x2e')](_0x62c7a3['query'][_0x1814('0x2e')]));_0x2559fb['attributes']=_0x2559fb['attributes'][_0x1814('0x2f')]?_0x2559fb[_0x1814('0x2c')]:_0x4dff57['model'];if(!_0x62c7a3[_0x1814('0x29')]['hasOwnProperty'](_0x1814('0x30'))){_0x2559fb[_0x1814('0x31')]=qs['limit'](_0x62c7a3['query'][_0x1814('0x31')]);_0x2559fb[_0x1814('0x1b')]=qs['offset'](_0x62c7a3[_0x1814('0x29')][_0x1814('0x1b')]);}_0x2559fb['order']=qs[_0x1814('0x32')](_0x62c7a3[_0x1814('0x29')][_0x1814('0x32')]);_0x2559fb[_0x1814('0x33')]=qs[_0x1814('0x2a')](_['pick'](_0x62c7a3['query'],_0x4dff57[_0x1814('0x2a')]));if(_0x62c7a3[_0x1814('0x29')]['filter']){_0x2559fb[_0x1814('0x33')]=_[_0x1814('0x34')](_0x2559fb['where'],{'$or':_[_0x1814('0x35')](_0x924a06,function(_0xb54a1e){if(_0xb54a1e[_0x1814('0x36')][_0x1814('0x37')]!=='VIRTUAL'){var _0x46a8b1={};_0x46a8b1[_0xb54a1e[_0x1814('0x38')]]={'$like':'%'+_0x62c7a3[_0x1814('0x29')]['filter']+'%'};return _0x46a8b1;}})});}_0x2559fb=_[_0x1814('0x34')]({},_0x2559fb,_0x62c7a3[_0x1814('0x39')]);var _0x55497f={'where':_0x2559fb[_0x1814('0x33')]};return db[_0x1814('0x26')]['count'](_0x55497f)[_0x1814('0x20')](function(_0x45e98b){_0x499a41[_0x1814('0x1a')]=_0x45e98b;if(_0x62c7a3['query']['includeAll']){_0x2559fb[_0x1814('0x3a')]=[{'all':!![]}];}return db['FaxApplication'][_0x1814('0x3b')](_0x2559fb);})[_0x1814('0x20')](function(_0x30d50e){_0x499a41[_0x1814('0x3c')]=_0x30d50e;return _0x499a41;})[_0x1814('0x20')](respondWithFilteredResult(_0x186830,_0x2559fb))['catch'](handleError(_0x186830,null));};exports[_0x1814('0x3d')]=function(_0x5de6ee,_0x7e0903){var _0x2a4899={'raw':!![],'where':{'id':_0x5de6ee[_0x1814('0x3e')]['id']}},_0x2dcf27={};_0x2dcf27['model']=_['keys'](db[_0x1814('0x26')][_0x1814('0x27')]);_0x2dcf27['query']=_[_0x1814('0x28')](_0x5de6ee[_0x1814('0x29')]);_0x2dcf27[_0x1814('0x2a')]=_[_0x1814('0x2b')](_0x2dcf27['model'],_0x2dcf27['query']);_0x2a4899[_0x1814('0x2c')]=_[_0x1814('0x2b')](_0x2dcf27[_0x1814('0x2d')],qs[_0x1814('0x2e')](_0x5de6ee[_0x1814('0x29')][_0x1814('0x2e')]));_0x2a4899[_0x1814('0x2c')]=_0x2a4899[_0x1814('0x2c')]['length']?_0x2a4899[_0x1814('0x2c')]:_0x2dcf27[_0x1814('0x2d')];if(_0x5de6ee[_0x1814('0x29')][_0x1814('0x3f')]){_0x2a4899[_0x1814('0x3a')]=[{'all':!![]}];}_0x2a4899=_[_0x1814('0x34')]({},_0x2a4899,_0x5de6ee[_0x1814('0x39')]);return db[_0x1814('0x26')]['find'](_0x2a4899)['then'](handleEntityNotFound(_0x7e0903,null))['then'](respondWithResult(_0x7e0903,null))[_0x1814('0x40')](handleError(_0x7e0903,null));};exports['create']=function(_0x1fd7c9,_0x3d05c6){return db['FaxApplication'][_0x1814('0x41')](_0x1fd7c9[_0x1814('0x42')],{})[_0x1814('0x20')](respondWithResult(_0x3d05c6,0xc9))[_0x1814('0x40')](handleError(_0x3d05c6,null));};exports[_0x1814('0x43')]=function(_0xbc2c41,_0x156ff7){if(_0xbc2c41[_0x1814('0x42')]['id']){delete _0xbc2c41[_0x1814('0x42')]['id'];}return db[_0x1814('0x26')][_0x1814('0x44')]({'where':{'id':_0xbc2c41[_0x1814('0x3e')]['id']}})['then'](handleEntityNotFound(_0x156ff7,null))[_0x1814('0x20')](saveUpdates(_0xbc2c41[_0x1814('0x42')],null))['then'](respondWithResult(_0x156ff7,null))[_0x1814('0x40')](handleError(_0x156ff7,null));};exports['destroy']=function(_0x4565b4,_0x55e7d1){return db[_0x1814('0x26')]['find']({'where':{'id':_0x4565b4[_0x1814('0x3e')]['id']}})[_0x1814('0x20')](handleEntityNotFound(_0x55e7d1,null))['then'](removeEntity(_0x55e7d1,null))[_0x1814('0x40')](handleError(_0x55e7d1,null));}; \ No newline at end of file +var _0xa7fa=['papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','reject','save','update','destroy','then','stack','name','send','index','FaxApplication','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','sort','pick','filter','where','map','type','VIRTUAL','options','includeAll','include','findAll','catch','show','merge','find','create','body','params','html-pdf','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa7fa,0x19a));var _0xaa7f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa7fa[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xaa7f('0x0'));var emlformat=require(_0xaa7f('0x1'));var rimraf=require(_0xaa7f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaa7f('0x3'));var BPromise=require(_0xaa7f('0x4'));var Mustache=require(_0xaa7f('0x5'));var util=require(_0xaa7f('0x6'));var path=require(_0xaa7f('0x7'));var sox=require(_0xaa7f('0x8'));var csv=require(_0xaa7f('0x9'));var ejs=require(_0xaa7f('0xa'));var fs=require('fs');var _=require(_0xaa7f('0xb'));var squel=require(_0xaa7f('0xc'));var crypto=require(_0xaa7f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaa7f('0xe'));var toCsv=require(_0xaa7f('0x9'));var querystring=require(_0xaa7f('0xf'));var Papa=require(_0xaa7f('0x10'));var Redis=require('ioredis');var authService=require(_0xaa7f('0x11'));var qs=require(_0xaa7f('0x12'));var hardwareService=require(_0xaa7f('0x13'));var logger=require(_0xaa7f('0x14'))(_0xaa7f('0x15'));var utils=require(_0xaa7f('0x16'));var config=require(_0xaa7f('0x17'));var db=require(_0xaa7f('0x18'))['db'];function respondWithStatusCode(_0x5d9e58,_0x52bb5c){_0x52bb5c=_0x52bb5c||0xcc;return function(_0x34db24){if(_0x34db24){return _0x5d9e58[_0xaa7f('0x19')](_0x52bb5c);}return _0x5d9e58[_0xaa7f('0x1a')](_0x52bb5c)[_0xaa7f('0x1b')]();};}function respondWithResult(_0x19a15f,_0x249da3){_0x249da3=_0x249da3||0xc8;return function(_0x4d45a0){if(_0x4d45a0){return _0x19a15f[_0xaa7f('0x1a')](_0x249da3)['json'](_0x4d45a0);}};}function respondWithFilteredResult(_0x27d7c3,_0x5cdcae){return function(_0x36c283){if(_0x36c283){var _0x545eaf=_0x36c283[_0xaa7f('0x1c')],_0x2fb04d=_0x5cdcae[_0xaa7f('0x1d')],_0x38ab10=_0x5cdcae['offset']+_0x5cdcae[_0xaa7f('0x1e')],_0xfb6e64;if(_0x38ab10>=_0x545eaf){_0x38ab10=_0x545eaf;_0xfb6e64=0xc8;}else{_0xfb6e64=0xce;}_0x27d7c3['status'](_0xfb6e64);return _0x27d7c3[_0xaa7f('0x1f')]('Content-Range',_0x2fb04d+'-'+_0x38ab10+'/'+_0x545eaf)[_0xaa7f('0x20')](_0x36c283);}return null;};}function patchUpdates(_0x1d714c){return function(_0x2892ca){try{jsonpatch['apply'](_0x2892ca,_0x1d714c,!![]);}catch(_0x174082){return BPromise[_0xaa7f('0x21')](_0x174082);}return _0x2892ca[_0xaa7f('0x22')]();};}function saveUpdates(_0x944576,_0x2c6e07){return function(_0x3d547){if(_0x3d547){return _0x3d547[_0xaa7f('0x23')](_0x944576)['then'](function(_0x38ab5f){return _0x38ab5f;});}return null;};}function removeEntity(_0x4012c5,_0x27710b){return function(_0x1476cb){if(_0x1476cb){return _0x1476cb[_0xaa7f('0x24')]()[_0xaa7f('0x25')](function(){_0x4012c5[_0xaa7f('0x1a')](0xcc)[_0xaa7f('0x1b')]();});}};}function handleEntityNotFound(_0x4c4509,_0x23c262){return function(_0x48fcd4){if(!_0x48fcd4){_0x4c4509[_0xaa7f('0x19')](0x194);}return _0x48fcd4;};}function handleError(_0x393ca3,_0x1c33dd){_0x1c33dd=_0x1c33dd||0x1f4;return function(_0x30234b){logger['error'](_0x30234b[_0xaa7f('0x26')]);if(_0x30234b[_0xaa7f('0x27')]){delete _0x30234b['name'];}_0x393ca3[_0xaa7f('0x1a')](_0x1c33dd)[_0xaa7f('0x28')](_0x30234b);};}exports[_0xaa7f('0x29')]=function(_0x408816,_0x11bdd2){var _0x2ad280={},_0x57ea08={},_0x3bd7f1={'count':0x0,'rows':[]};var _0x121497=db[_0xaa7f('0x2a')][_0xaa7f('0x2b')];_0x57ea08['model']=_[_0xaa7f('0x2c')](_0x121497);_0x57ea08[_0xaa7f('0x2d')]=_[_0xaa7f('0x2c')](_0x408816[_0xaa7f('0x2d')]);_0x57ea08[_0xaa7f('0x2e')]=_[_0xaa7f('0x2f')](_0x57ea08['model'],_0x57ea08['query']);_0x2ad280[_0xaa7f('0x30')]=_[_0xaa7f('0x2f')](_0x57ea08[_0xaa7f('0x31')],qs['fields'](_0x408816[_0xaa7f('0x2d')][_0xaa7f('0x32')]));_0x2ad280[_0xaa7f('0x30')]=_0x2ad280[_0xaa7f('0x30')][_0xaa7f('0x33')]?_0x2ad280['attributes']:_0x57ea08[_0xaa7f('0x31')];if(!_0x408816[_0xaa7f('0x2d')][_0xaa7f('0x34')]('nolimit')){_0x2ad280[_0xaa7f('0x1e')]=qs[_0xaa7f('0x1e')](_0x408816[_0xaa7f('0x2d')][_0xaa7f('0x1e')]);_0x2ad280[_0xaa7f('0x1d')]=qs['offset'](_0x408816[_0xaa7f('0x2d')][_0xaa7f('0x1d')]);}_0x2ad280['order']=qs[_0xaa7f('0x35')](_0x408816[_0xaa7f('0x2d')][_0xaa7f('0x35')]);_0x2ad280['where']=qs['filters'](_[_0xaa7f('0x36')](_0x408816[_0xaa7f('0x2d')],_0x57ea08[_0xaa7f('0x2e')]));if(_0x408816[_0xaa7f('0x2d')][_0xaa7f('0x37')]){_0x2ad280[_0xaa7f('0x38')]=_['merge'](_0x2ad280[_0xaa7f('0x38')],{'$or':_[_0xaa7f('0x39')](_0x121497,function(_0x1d765e){if(_0x1d765e[_0xaa7f('0x3a')]['key']!==_0xaa7f('0x3b')){var _0xf1315f={};_0xf1315f[_0x1d765e['field']]={'$like':'%'+_0x408816['query'][_0xaa7f('0x37')]+'%'};return _0xf1315f;}})});}_0x2ad280=_['merge']({},_0x2ad280,_0x408816[_0xaa7f('0x3c')]);var _0x556fec={'where':_0x2ad280['where']};return db[_0xaa7f('0x2a')][_0xaa7f('0x1c')](_0x556fec)['then'](function(_0xafaef0){_0x3bd7f1['count']=_0xafaef0;if(_0x408816[_0xaa7f('0x2d')][_0xaa7f('0x3d')]){_0x2ad280[_0xaa7f('0x3e')]=[{'all':!![]}];}return db[_0xaa7f('0x2a')][_0xaa7f('0x3f')](_0x2ad280);})[_0xaa7f('0x25')](function(_0x19c8fd){_0x3bd7f1['rows']=_0x19c8fd;return _0x3bd7f1;})[_0xaa7f('0x25')](respondWithFilteredResult(_0x11bdd2,_0x2ad280))[_0xaa7f('0x40')](handleError(_0x11bdd2,null));};exports[_0xaa7f('0x41')]=function(_0x3a2158,_0xe9620c){var _0x509266={'raw':!![],'where':{'id':_0x3a2158['params']['id']}},_0x51c67b={};_0x51c67b[_0xaa7f('0x31')]=_[_0xaa7f('0x2c')](db['FaxApplication'][_0xaa7f('0x2b')]);_0x51c67b[_0xaa7f('0x2d')]=_[_0xaa7f('0x2c')](_0x3a2158[_0xaa7f('0x2d')]);_0x51c67b[_0xaa7f('0x2e')]=_[_0xaa7f('0x2f')](_0x51c67b[_0xaa7f('0x31')],_0x51c67b['query']);_0x509266[_0xaa7f('0x30')]=_[_0xaa7f('0x2f')](_0x51c67b['model'],qs[_0xaa7f('0x32')](_0x3a2158['query'][_0xaa7f('0x32')]));_0x509266[_0xaa7f('0x30')]=_0x509266['attributes'][_0xaa7f('0x33')]?_0x509266['attributes']:_0x51c67b[_0xaa7f('0x31')];if(_0x3a2158[_0xaa7f('0x2d')][_0xaa7f('0x3d')]){_0x509266['include']=[{'all':!![]}];}_0x509266=_[_0xaa7f('0x42')]({},_0x509266,_0x3a2158[_0xaa7f('0x3c')]);return db[_0xaa7f('0x2a')][_0xaa7f('0x43')](_0x509266)[_0xaa7f('0x25')](handleEntityNotFound(_0xe9620c,null))[_0xaa7f('0x25')](respondWithResult(_0xe9620c,null))['catch'](handleError(_0xe9620c,null));};exports[_0xaa7f('0x44')]=function(_0x45d73b,_0x2025bf){return db[_0xaa7f('0x2a')][_0xaa7f('0x44')](_0x45d73b[_0xaa7f('0x45')],{})[_0xaa7f('0x25')](respondWithResult(_0x2025bf,0xc9))['catch'](handleError(_0x2025bf,null));};exports[_0xaa7f('0x23')]=function(_0x450510,_0x4e5992){if(_0x450510[_0xaa7f('0x45')]['id']){delete _0x450510[_0xaa7f('0x45')]['id'];}return db[_0xaa7f('0x2a')]['find']({'where':{'id':_0x450510[_0xaa7f('0x46')]['id']}})[_0xaa7f('0x25')](handleEntityNotFound(_0x4e5992,null))['then'](saveUpdates(_0x450510[_0xaa7f('0x45')],null))[_0xaa7f('0x25')](respondWithResult(_0x4e5992,null))[_0xaa7f('0x40')](handleError(_0x4e5992,null));};exports[_0xaa7f('0x24')]=function(_0x4b174a,_0x2d19b5){return db['FaxApplication'][_0xaa7f('0x43')]({'where':{'id':_0x4b174a['params']['id']}})['then'](handleEntityNotFound(_0x2d19b5,null))[_0xaa7f('0x25')](removeEntity(_0x2d19b5,null))[_0xaa7f('0x40')](handleError(_0x2d19b5,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index e88631f..e857ef5 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 _0x885a=['./faxApplication.attributes','exports','define','FaxApplication','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x885a,0x180));var _0xa885=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x885a[_0x138adb];return _0x1b27f2;};'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'));module[_0xa885('0x9')]=function(_0x5dfd7e,_0x7ac6bd){return _0x5dfd7e[_0xa885('0xa')](_0xa885('0xb'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa885('0xc'),'collate':_0xa885('0xd')});}; \ No newline at end of file +var _0x7bae=['fax_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication'];(function(_0x5e0f0e,_0x3f0607){var _0x32edb2=function(_0xcd3b9f){while(--_0xcd3b9f){_0x5e0f0e['push'](_0x5e0f0e['shift']());}};_0x32edb2(++_0x3f0607);}(_0x7bae,0x13b));var _0xe7ba=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x7bae[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7ba('0x0'))(_0xe7ba('0x1'));var moment=require('moment');var BPromise=require(_0xe7ba('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe7ba('0x3'));var rimraf=require(_0xe7ba('0x4'));var config=require(_0xe7ba('0x5'));var attributes=require(_0xe7ba('0x6'));module[_0xe7ba('0x7')]=function(_0xfd3a22,_0x2d31df){return _0xfd3a22[_0xe7ba('0x8')](_0xe7ba('0x9'),attributes,{'tableName':_0xe7ba('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe7ba('0xb'),'collate':_0xe7ba('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 6995a2b..356157e 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 _0xf289=['then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateFaxApplication','update','body','options','attributes','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x543242,_0xeac9fd){var _0x4c99b6=function(_0x47d087){while(--_0x47d087){_0x543242['push'](_0x543242['shift']());}};_0x4c99b6(++_0xeac9fd);}(_0xf289,0x132));var _0x9f28=function(_0x1a3a84,_0x4c0418){_0x1a3a84=_0x1a3a84-0x0;var _0x5291f7=_0xf289[_0x1a3a84];return _0x5291f7;};'use strict';var _=require(_0x9f28('0x0'));var util=require(_0x9f28('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9f28('0x2'));var fs=require('fs');var Redis=require(_0x9f28('0x3'));var db=require(_0x9f28('0x4'))['db'];var utils=require(_0x9f28('0x5'));var logger=require(_0x9f28('0x6'))(_0x9f28('0x7'));var config=require(_0x9f28('0x8'));var jayson=require(_0x9f28('0x9'));var client=jayson[_0x9f28('0xa')][_0x9f28('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c5ae5,_0x233e1d,_0x8e5cde){return new BPromise(function(_0x183370,_0x235ae9){return client[_0x9f28('0xc')](_0x1c5ae5,_0x8e5cde)[_0x9f28('0xd')](function(_0x4e018c){logger[_0x9f28('0xe')](_0x9f28('0xf'),_0x233e1d,_0x9f28('0x10'));logger[_0x9f28('0x11')](_0x9f28('0x12'),_0x233e1d,_0x9f28('0x10'),JSON[_0x9f28('0x13')](_0x4e018c));if(_0x4e018c[_0x9f28('0x14')]){if(_0x4e018c[_0x9f28('0x14')][_0x9f28('0x15')]===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0x233e1d,_0x4e018c[_0x9f28('0x14')]['message']);return _0x235ae9(_0x4e018c['error'][_0x9f28('0x16')]);}logger[_0x9f28('0x14')](_0x9f28('0xf'),_0x233e1d,_0x4e018c[_0x9f28('0x14')][_0x9f28('0x16')]);return _0x183370(_0x4e018c[_0x9f28('0x14')][_0x9f28('0x16')]);}else{logger[_0x9f28('0xe')](_0x9f28('0xf'),_0x233e1d,_0x9f28('0x10'));_0x183370(_0x4e018c['result']['message']);}})['catch'](function(_0x2ae20f){logger[_0x9f28('0x14')](_0x9f28('0xf'),_0x233e1d,_0x2ae20f);_0x235ae9(_0x2ae20f);});});}exports[_0x9f28('0x17')]=function(_0x3bb71){var _0x1c71e2=this;return new Promise(function(_0xbe0cb8,_0x55f210){return db['FaxApplication'][_0x9f28('0x18')](_0x3bb71[_0x9f28('0x19')],{'raw':_0x3bb71['options']?_0x3bb71['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bb71[_0x9f28('0x1a')]?_0x3bb71[_0x9f28('0x1a')]['where']||null:null,'attributes':_0x3bb71[_0x9f28('0x1a')]?_0x3bb71[_0x9f28('0x1a')][_0x9f28('0x1b')]||null:null,'limit':_0x3bb71['options']?_0x3bb71[_0x9f28('0x1a')][_0x9f28('0x1c')]||null:null})[_0x9f28('0xd')](function(_0x148c3a){logger[_0x9f28('0xe')]('UpdateFaxApplication',_0x3bb71);logger[_0x9f28('0x11')](_0x9f28('0x17'),_0x3bb71,JSON['stringify'](_0x148c3a));_0xbe0cb8(_0x148c3a);})['catch'](function(_0x4f461f){logger[_0x9f28('0x14')](_0x9f28('0x17'),_0x4f461f[_0x9f28('0x16')],_0x3bb71);_0x55f210(_0x1c71e2['error'](0x1f4,_0x4f461f[_0x9f28('0x16')]));});});}; \ No newline at end of file +var _0xf858=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','options','raw','where','attributes','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0xf858,0x7e));var _0x8f85=function(_0x1a1469,_0x3d3dc8){_0x1a1469=_0x1a1469-0x0;var _0x3c0336=_0xf858[_0x1a1469];return _0x3c0336;};'use strict';var _=require(_0x8f85('0x0'));var util=require(_0x8f85('0x1'));var moment=require(_0x8f85('0x2'));var BPromise=require(_0x8f85('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f85('0x4'));var db=require(_0x8f85('0x5'))['db'];var utils=require(_0x8f85('0x6'));var logger=require(_0x8f85('0x7'))(_0x8f85('0x8'));var config=require(_0x8f85('0x9'));var jayson=require(_0x8f85('0xa'));var client=jayson[_0x8f85('0xb')][_0x8f85('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x26733c,_0x2f067a,_0x4267fe){return new BPromise(function(_0x4da0a5,_0x572e0f){return client[_0x8f85('0xd')](_0x26733c,_0x4267fe)[_0x8f85('0xe')](function(_0x1b212f){logger[_0x8f85('0xf')](_0x8f85('0x10'),_0x2f067a,_0x8f85('0x11'));logger['debug'](_0x8f85('0x12'),_0x2f067a,'request\x20sent',JSON[_0x8f85('0x13')](_0x1b212f));if(_0x1b212f[_0x8f85('0x14')]){if(_0x1b212f['error'][_0x8f85('0x15')]===0x1f4){logger[_0x8f85('0x14')](_0x8f85('0x10'),_0x2f067a,_0x1b212f[_0x8f85('0x14')][_0x8f85('0x16')]);return _0x572e0f(_0x1b212f['error'][_0x8f85('0x16')]);}logger[_0x8f85('0x14')](_0x8f85('0x10'),_0x2f067a,_0x1b212f[_0x8f85('0x14')][_0x8f85('0x16')]);return _0x4da0a5(_0x1b212f['error'][_0x8f85('0x16')]);}else{logger[_0x8f85('0xf')](_0x8f85('0x10'),_0x2f067a,_0x8f85('0x11'));_0x4da0a5(_0x1b212f[_0x8f85('0x17')]['message']);}})[_0x8f85('0x18')](function(_0x48b8c5){logger[_0x8f85('0x14')](_0x8f85('0x10'),_0x2f067a,_0x48b8c5);_0x572e0f(_0x48b8c5);});});}exports[_0x8f85('0x19')]=function(_0x36e2fb){var _0x234139=this;return new Promise(function(_0x510e11,_0x371a4f){return db[_0x8f85('0x1a')][_0x8f85('0x1b')](_0x36e2fb['body'],{'raw':_0x36e2fb[_0x8f85('0x1c')]?_0x36e2fb[_0x8f85('0x1c')][_0x8f85('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36e2fb[_0x8f85('0x1c')]?_0x36e2fb[_0x8f85('0x1c')][_0x8f85('0x1e')]||null:null,'attributes':_0x36e2fb['options']?_0x36e2fb[_0x8f85('0x1c')][_0x8f85('0x1f')]||null:null,'limit':_0x36e2fb['options']?_0x36e2fb['options']['limit']||null:null})[_0x8f85('0xe')](function(_0x47f9b){logger['info'](_0x8f85('0x19'),_0x36e2fb);logger[_0x8f85('0x20')](_0x8f85('0x19'),_0x36e2fb,JSON['stringify'](_0x47f9b));_0x510e11(_0x47f9b);})[_0x8f85('0x18')](function(_0x557ba2){logger[_0x8f85('0x14')](_0x8f85('0x19'),_0x557ba2['message'],_0x36e2fb);_0x371a4f(_0x234139[_0x8f85('0x14')](0x1f4,_0x557ba2[_0x8f85('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 080b17d..3021474 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 _0xb78e=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb78e,0x1c9));var _0xeb78=function(_0x42e09d,_0x357e59){_0x42e09d=_0x42e09d-0x0;var _0x56d261=_0xb78e[_0x42e09d];return _0x56d261;};'use strict';var multer=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var path=require('path');var timeout=require(_0xeb78('0x2'));var express=require(_0xeb78('0x3'));var router=express[_0xeb78('0x4')]();var auth=require(_0xeb78('0x5'));var interaction=require(_0xeb78('0x6'));var config=require(_0xeb78('0x7'));var controller=require(_0xeb78('0x8'));router[_0xeb78('0x9')]('/',auth['isAuthenticated'](),controller[_0xeb78('0xa')]);router[_0xeb78('0x9')](_0xeb78('0xb'),auth[_0xeb78('0xc')](),controller[_0xeb78('0xd')]);router[_0xeb78('0xe')]('/',auth[_0xeb78('0xc')](),controller['create']);router[_0xeb78('0xf')](_0xeb78('0xb'),auth[_0xeb78('0xc')](),controller[_0xeb78('0x10')]);router[_0xeb78('0x11')](_0xeb78('0xb'),auth[_0xeb78('0xc')](),controller[_0xeb78('0x12')]);module[_0xeb78('0x13')]=router; \ No newline at end of file +var _0x58a4=['./faxApplication.controller','get','isAuthenticated','index','show','post','create','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x11dbaa,_0x4b7800){var _0x2223c0=function(_0x37d553){while(--_0x37d553){_0x11dbaa['push'](_0x11dbaa['shift']());}};_0x2223c0(++_0x4b7800);}(_0x58a4,0xbf));var _0x458a=function(_0x9647da,_0x1f7117){_0x9647da=_0x9647da-0x0;var _0x25c414=_0x58a4[_0x9647da];return _0x25c414;};'use strict';var multer=require(_0x458a('0x0'));var util=require(_0x458a('0x1'));var path=require(_0x458a('0x2'));var timeout=require(_0x458a('0x3'));var express=require(_0x458a('0x4'));var router=express[_0x458a('0x5')]();var auth=require(_0x458a('0x6'));var interaction=require(_0x458a('0x7'));var config=require(_0x458a('0x8'));var controller=require(_0x458a('0x9'));router[_0x458a('0xa')]('/',auth[_0x458a('0xb')](),controller[_0x458a('0xc')]);router['get']('/:id',auth[_0x458a('0xb')](),controller[_0x458a('0xd')]);router[_0x458a('0xe')]('/',auth[_0x458a('0xb')](),controller[_0x458a('0xf')]);router['put']('/:id',auth[_0x458a('0xb')](),controller[_0x458a('0x10')]);router[_0x458a('0x11')](_0x458a('0x12'),auth[_0x458a('0xb')](),controller['destroy']);module[_0x458a('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 44377d0..a4ea1ee 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 _0xe2d3=['sequelize','exports','BOOLEAN','STRING','DATE','out','ENUM'];(function(_0x4bf9ab,_0x42bf40){var _0xf90ec=function(_0x1ab570){while(--_0x1ab570){_0x4bf9ab['push'](_0x4bf9ab['shift']());}};_0xf90ec(++_0x42bf40);}(_0xe2d3,0x1ce));var _0x3e2d=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0xe2d3[_0x1d6a82];return _0x5834ac;};'use strict';var Sequelize=require(_0x3e2d('0x0'));module[_0x3e2d('0x1')]={'closed':{'type':Sequelize[_0x3e2d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x3e2d('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x3e2d('0x4')]},'fax':{'type':Sequelize[_0x3e2d('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x3e2d('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3e2d('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x3e2d('0x6')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x2f76=['ENUM','out','exports','BOOLEAN','DATE','STRING'];(function(_0x52a51b,_0x5be17c){var _0x25ef0f=function(_0x256474){while(--_0x256474){_0x52a51b['push'](_0x52a51b['shift']());}};_0x25ef0f(++_0x5be17c);}(_0x2f76,0x122));var _0x62f7=function(_0x4e5892,_0xadd59d){_0x4e5892=_0x4e5892-0x0;var _0x2652ef=_0x2f76[_0x4e5892];return _0x2652ef;};'use strict';var Sequelize=require('sequelize');module[_0x62f7('0x0')]={'closed':{'type':Sequelize[_0x62f7('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x62f7('0x2')]},'disposition':{'type':Sequelize[_0x62f7('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x62f7('0x2')]},'fax':{'type':Sequelize[_0x62f7('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x62f7('0x4')]('in',_0x62f7('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x62f7('0x4')]('in',_0x62f7('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index a9ea2a8..c9841f7 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 _0x1967=['$lte','null','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','i.id','Sequelize','QueryTypes','SELECT','clone','COUNT(me.id)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20IN\x20?','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','sequelize','toString','keyBy','merge','FaxInteraction','Account.key','i.*','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','rawAttributes','include','options','find','create','body','destroy','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','Tag','faxInteractionTags:save','unix','join','root','server','files','attachments','tmp','interaction-%s.zip','Attachment','basename','createReadStream','pipe','createWriteStream','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','json','count','offset','set','Content-Range','save','update','then','end','error','stack','name','send','TagIds','Tags','forEach','push','catch','index','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','filters','pick','select','field','color','from','tools_tags','COUNT(*)','fax_messages','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.FaxInteractionId','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','me.FaxInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','advancedFilter','parse','dateStart','startOf','utc','format','endOf','day','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','TagId','value','\x20IN\x20?','tableAlias','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','c.email','unreadMessages','isArray','\x20>\x20?','\x20<\x20?','map','filter','isNil','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','$gte'];(function(_0x45b5b1,_0x1f804c){var _0x2ae592=function(_0x55b836){while(--_0x55b836){_0x45b5b1['push'](_0x45b5b1['shift']());}};_0x2ae592(++_0x1f804c);}(_0x1967,0x1e5));var _0x7196=function(_0x13bcce,_0x3885b4){_0x13bcce=_0x13bcce-0x0;var _0x1276d6=_0x1967[_0x13bcce];return _0x1276d6;};'use strict';var pdf=require(_0x7196('0x0'));var emlformat=require(_0x7196('0x1'));var rimraf=require(_0x7196('0x2'));var zipdir=require(_0x7196('0x3'));var jsonpatch=require(_0x7196('0x4'));var rp=require('request-promise');var moment=require(_0x7196('0x5'));var BPromise=require(_0x7196('0x6'));var Mustache=require('mustache');var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));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(_0x7196('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x7196('0x14'));var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))('api');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':'localhost','port':0x18eb});var socket=require(_0x7196('0x1c'))(new Redis(config[_0x7196('0x1a')]));require(_0x7196('0x1d'))[_0x7196('0x1e')](socket);function respondWithStatusCode(_0x140b46,_0x4cd616){_0x4cd616=_0x4cd616||0xcc;return function(_0x530cd2){if(_0x530cd2){return _0x140b46[_0x7196('0x1f')](_0x4cd616);}return _0x140b46[_0x7196('0x20')](_0x4cd616)['end']();};}function respondWithResult(_0x1590f4,_0x1359f2){_0x1359f2=_0x1359f2||0xc8;return function(_0x5c0337){if(_0x5c0337){return _0x1590f4['status'](_0x1359f2)[_0x7196('0x21')](_0x5c0337);}};}function respondWithFilteredResult(_0x16100c,_0xda0779){return function(_0x36c1c0){if(_0x36c1c0){var _0xba845e=_0x36c1c0[_0x7196('0x22')],_0x2931d2=_0xda0779[_0x7196('0x23')],_0x30945f=_0xda0779[_0x7196('0x23')]+_0xda0779['limit'],_0x15dadc;if(_0x30945f>=_0xba845e){_0x30945f=_0xba845e;_0x15dadc=0xc8;}else{_0x15dadc=0xce;}_0x16100c['status'](_0x15dadc);return _0x16100c[_0x7196('0x24')](_0x7196('0x25'),_0x2931d2+'-'+_0x30945f+'/'+_0xba845e)[_0x7196('0x21')](_0x36c1c0);}return null;};}function patchUpdates(_0x42b942){return function(_0x56245e){try{jsonpatch['apply'](_0x56245e,_0x42b942,!![]);}catch(_0x39a4a6){return BPromise['reject'](_0x39a4a6);}return _0x56245e[_0x7196('0x26')]();};}function saveUpdates(_0xb1370e,_0x909500){return function(_0x411fa8){if(_0x411fa8){return _0x411fa8[_0x7196('0x27')](_0xb1370e)[_0x7196('0x28')](function(_0xbf0064){return _0xbf0064;});}return null;};}function removeEntity(_0x2714fc,_0x484394){return function(_0x5e9aa9){if(_0x5e9aa9){return _0x5e9aa9['destroy']()[_0x7196('0x28')](function(){_0x2714fc['status'](0xcc)[_0x7196('0x29')]();});}};}function handleEntityNotFound(_0x315514,_0x2383fb){return function(_0x1988d4){if(!_0x1988d4){_0x315514[_0x7196('0x1f')](0x194);}return _0x1988d4;};}function handleError(_0x30f501,_0x22a318){_0x22a318=_0x22a318||0x1f4;return function(_0x49a767){logger[_0x7196('0x2a')](_0x49a767[_0x7196('0x2b')]);if(_0x49a767[_0x7196('0x2c')]){delete _0x49a767[_0x7196('0x2c')];}_0x30f501[_0x7196('0x20')](_0x22a318)[_0x7196('0x2d')](_0x49a767);};}function getInteractionUsers(_0x5c9a6f,_0x38d068){return new BPromise(function(_0x54615f,_0x3624d3){try{if(_0x38d068[_0x5c9a6f['id']]){_0x5c9a6f['Users']=_['map'](_0x38d068[_0x5c9a6f['id']],function(_0x5aa299){return{'id':_0x5aa299['id']};});}}catch(_0x339431){_0x3624d3(_0x339431);}_0x54615f(_0x5c9a6f);});}function getInteractionTags(_0x3ac2c7,_0x34ef5e){return new BPromise(function(_0x25de7e,_0x1c1bf8){try{if(_0x3ac2c7[_0x7196('0x2e')]){_0x3ac2c7[_0x7196('0x2f')]=[];_0x3ac2c7[_0x7196('0x2e')]['split'](',')[_0x7196('0x30')](function(_0x4ed2b8){_0x3ac2c7[_0x7196('0x2f')][_0x7196('0x31')](_0x34ef5e[_0x4ed2b8]);});}delete _0x3ac2c7[_0x7196('0x2e')];}catch(_0x3afb79){_0x1c1bf8(_0x3afb79);}_0x25de7e(_0x3ac2c7);});}function updateFaxInteraction(_0x3fe6ca,_0x3f898d,_0x4faf46){return new BPromise(function(_0x3b7ea6,_0x3469c7){return getInteractionUsers(_0x3fe6ca,_0x4faf46)['then'](function(_0x3847e4){return getInteractionTags(_0x3847e4,_0x3f898d);})[_0x7196('0x28')](function(_0x242316){_0x3b7ea6(_0x242316);})[_0x7196('0x32')](function(_0x4ae1ec){_0x3469c7(_0x4ae1ec);});});}exports[_0x7196('0x33')]=function(_0x31080a,_0x2bc368){var _0x32561a={},_0x414763={},_0x47e255={'count':0x0,'rows':[]};var _0x5c005d=db['FaxInteraction']['rawAttributes'];_0x414763['model']=_[_0x7196('0x34')](_0x5c005d);_0x414763[_0x7196('0x35')]=_['keys'](_0x31080a[_0x7196('0x35')]);_0x414763['filters']=_[_0x7196('0x36')](_0x414763[_0x7196('0x37')],_0x414763[_0x7196('0x35')]);_0x32561a[_0x7196('0x38')]=_['intersection'](_0x414763[_0x7196('0x37')],qs[_0x7196('0x39')](_0x31080a[_0x7196('0x35')][_0x7196('0x39')]));_0x32561a[_0x7196('0x38')]=_0x32561a[_0x7196('0x38')][_0x7196('0x3a')]?_0x32561a[_0x7196('0x38')]:_0x414763[_0x7196('0x37')];if(!_0x31080a[_0x7196('0x35')][_0x7196('0x3b')]('nolimit')){_0x32561a[_0x7196('0x3c')]=qs[_0x7196('0x3c')](_0x31080a['query'][_0x7196('0x3c')]);_0x32561a[_0x7196('0x23')]=qs[_0x7196('0x23')](_0x31080a[_0x7196('0x35')]['offset']);}_0x32561a['order']=qs[_0x7196('0x3d')](_0x31080a[_0x7196('0x35')][_0x7196('0x3d')]);_0x32561a[_0x7196('0x3e')]=qs[_0x7196('0x3f')](_[_0x7196('0x40')](_0x31080a[_0x7196('0x35')],_0x414763[_0x7196('0x3f')]));var _0x415f4a=[];var _0x5b8a7a=squel[_0x7196('0x41')]()['field']('id')[_0x7196('0x42')](_0x7196('0x2c'))['field'](_0x7196('0x43'))[_0x7196('0x44')](_0x7196('0x45'));var _0x16605e=squel[_0x7196('0x41')]()['field'](_0x7196('0x46'))[_0x7196('0x44')](_0x7196('0x47'),'me')[_0x7196('0x3e')]('me.FaxInteractionId\x20=\x20i.id')[_0x7196('0x3e')](_0x7196('0x48'))['where'](_0x7196('0x49'));var _0x107117=squel[_0x7196('0x41')]()[_0x7196('0x42')](_0x7196('0x4a'))[_0x7196('0x42')](_0x7196('0x4b'))['from']('user_has_fax_interactions','ui')[_0x7196('0x4c')](_0x7196('0x4d'),'u',_0x7196('0x4e'));var _0xb995de=squel[_0x7196('0x41')]()['from'](_0x7196('0x4f'),'i')[_0x7196('0x4c')](_0x7196('0x50'),'c',_0x7196('0x51'))['left_join'](_0x7196('0x4d'),'o',_0x7196('0x52'))[_0x7196('0x4c')](_0x7196('0x53'),'a','a.id\x20=\x20i.FaxAccountId')[_0x7196('0x4c')](_0x7196('0x47'),'me',_0x7196('0x54'));var _0x5936ac=squel[_0x7196('0x55')]();if(_0x31080a[_0x7196('0x35')][_0x7196('0x56')]){var _0x3595ff=JSON[_0x7196('0x57')](_0x31080a[_0x7196('0x35')][_0x7196('0x56')]);_[_0x7196('0x34')](_0x3595ff)[_0x7196('0x30')](function(_0x173445){var _0x2c7740=_0x3595ff[_0x173445];if(_0x173445==='createdAt'){var _0x258a0c=moment(_0x2c7740['value'][_0x7196('0x58')])[_0x7196('0x59')]('day')[_0x7196('0x5a')]()[_0x7196('0x5b')]();var _0x116757=moment(_0x116757)[_0x7196('0x5a')]()[_0x7196('0x5c')](_0x7196('0x5d'))[_0x7196('0x5b')]();_0x5936ac[_0x7196('0x5e')](_0x7196('0x5f'),_0x258a0c,_0x116757);}else{if(_['isArray'](_0x2c7740[_0x7196('0x60')])){_0x2c7740[_0x7196('0x60')][_0x7196('0x30')](function(_0x589bf6){switch(_0x2c7740['condition']['value']){case'IS':if(_0x173445!==_0x7196('0x61')&&_0x173445!=='unreadMessages'){if(_['isArray'](_0x2c7740[_0x7196('0x62')])&&_0x2c7740['value']['length']>0x1){_0x5936ac[_0x7196('0x5e')](_0x2c7740['tableAlias']+'.'+_0x173445+_0x7196('0x63'),_0x2c7740[_0x7196('0x62')]);}else{_0x5936ac[_0x7196('0x5e')](_0x2c7740[_0x7196('0x64')]+'.'+_0x173445+_0x7196('0x65'),_0x2c7740[_0x7196('0x62')][0x0]);}}break;case'=':_0x5936ac[_0x7196('0x5e')](_0x2c7740[_0x7196('0x64')]+'.'+_0x173445+'\x20=\x20?',_0x2c7740['value']);break;case _0x7196('0x66'):if(_0x173445===_0x7196('0x67')){_0x5936ac[_0x7196('0x5e')](_0x7196('0x68')+_0x7196('0x69'),'%'+_0x2c7740[_0x7196('0x62')]+'%');_0x5936ac['or'](_0x7196('0x6a')+_0x7196('0x69'),'%'+_0x2c7740[_0x7196('0x62')]+'%');_0x5936ac['or'](_0x7196('0x6b')+_0x7196('0x69'),'%'+_0x2c7740[_0x7196('0x62')]+'%');}else{_0x5936ac[_0x7196('0x5e')](_0x2c7740[_0x7196('0x64')]+'.'+_0x173445+_0x7196('0x69'),'%'+_0x2c7740[_0x7196('0x62')]+'%');}break;case'>':_0x5936ac[_0x7196('0x5e')](_0x2c7740['tableAlias']+'.'+_0x173445+'\x20>\x20?',_0x2c7740[_0x7196('0x62')]);break;case'<':_0x5936ac[_0x7196('0x5e')](_0x2c7740[_0x7196('0x64')]+'.'+_0x173445+'\x20<\x20?',_0x2c7740[_0x7196('0x62')]);break;}});}else{switch(_0x2c7740[_0x7196('0x60')][_0x7196('0x62')]){case'IS':if(_0x173445!==_0x7196('0x61')&&_0x173445!==_0x7196('0x6c')){if(_[_0x7196('0x6d')](_0x2c7740[_0x7196('0x62')])&&_0x2c7740[_0x7196('0x62')]['length']>0x1){_0x5936ac[_0x7196('0x5e')](_0x2c7740[_0x7196('0x64')]+'.'+_0x173445+_0x7196('0x63'),_0x2c7740[_0x7196('0x62')]);}else{_0x5936ac[_0x7196('0x5e')](_0x2c7740['tableAlias']+'.'+_0x173445+'\x20=\x20?',_0x2c7740[_0x7196('0x62')][0x0]);}}break;case'=':_0x5936ac[_0x7196('0x5e')](_0x2c7740[_0x7196('0x64')]+'.'+_0x173445+_0x7196('0x65'),_0x2c7740[_0x7196('0x62')]);break;case _0x7196('0x66'):if(_0x173445===_0x7196('0x67')){_0x5936ac[_0x7196('0x5e')](_0x7196('0x68')+'\x20LIKE\x20?','%'+_0x2c7740['value']+'%');_0x5936ac['or'](_0x7196('0x6a')+_0x7196('0x69'),'%'+_0x2c7740[_0x7196('0x62')]+'%');_0x5936ac['or']('c.email'+'\x20LIKE\x20?','%'+_0x2c7740[_0x7196('0x62')]+'%');}else{_0x5936ac[_0x7196('0x5e')](_0x2c7740[_0x7196('0x64')]+'.'+_0x173445+_0x7196('0x69'),'%'+_0x2c7740[_0x7196('0x62')]+'%');}break;case'>':_0x5936ac[_0x7196('0x5e')](_0x2c7740['tableAlias']+'.'+_0x173445+_0x7196('0x6e'),_0x2c7740[_0x7196('0x62')]);break;case'<':_0x5936ac[_0x7196('0x5e')](_0x2c7740[_0x7196('0x64')]+'.'+_0x173445+_0x7196('0x6f'),_0x2c7740[_0x7196('0x62')]);break;}}}});}else{var _0xdae68c=_(Object[_0x7196('0x34')](_0x31080a['query']))[_0x7196('0x70')](function(_0x63d862){return _0x5c005d[_0x7196('0x3b')](_0x63d862)?_0x63d862:undefined;})[_0x7196('0x71')](function(_0x81afb3){return!_[_0x7196('0x72')](_0x81afb3);})['value']();if(!_[_0x7196('0x73')](_0xdae68c)){_0xdae68c[_0x7196('0x30')](function(_0x4e2ff7){if(_0x4e2ff7===_0x7196('0x74')){_0xb995de[_0x7196('0x3e')](_0x7196('0x75'),[][_0x7196('0x76')](_0x31080a[_0x7196('0x35')][_0x4e2ff7]));}else if(_0x4e2ff7===_0x7196('0x77')){var _0x520241=JSON[_0x7196('0x57')](_0x31080a[_0x7196('0x35')][_0x4e2ff7])[_0x7196('0x78')];var _0x7f34dc=JSON[_0x7196('0x57')](_0x31080a[_0x7196('0x35')][_0x4e2ff7])[_0x7196('0x79')];_0xb995de[_0x7196('0x3e')](_0x7196('0x5f'),_0x520241,_0x7f34dc);}else{if(_0x31080a[_0x7196('0x35')][_0x4e2ff7]===_0x7196('0x7a')){_0xb995de[_0x7196('0x3e')]('i.'+_0x4e2ff7+'\x20IS\x20NULL');}else{_0xb995de[_0x7196('0x3e')]('i.'+_0x4e2ff7+_0x7196('0x65'),_0x31080a[_0x7196('0x35')][_0x4e2ff7]);}}});}if(_0x31080a['query'][_0x7196('0x71')]){var _0x3e9646=_0x31080a[_0x7196('0x35')]['filter'][_0x7196('0x7b')]('\x5c','\x5c\x5c')[_0x7196('0x7b')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x7196('0x7c')](_0x3e9646)){_0x5936ac['or'](_0x7196('0x7d'),_0x3e9646+'%')['or'](_0x7196('0x7e'),_0x3e9646+'%');}_0x5936ac['or'](_0x7196('0x7f'),_0x3e9646+'%');}}_0xb995de['where'](_0x5936ac);if(_0x32561a[_0x7196('0x80')]){_0x32561a[_0x7196('0x80')]['forEach'](function(_0x2a4bc4){_0xb995de[_0x7196('0x80')]('i.'+_0x2a4bc4[0x0],_0x2a4bc4[0x1]===_0x7196('0x81')?![]:!![]);});}_0xb995de['group'](_0x7196('0x82'));var _0x4ea22d={'type':db[_0x7196('0x83')][_0x7196('0x84')][_0x7196('0x85')],'raw':!![]};var _0x1d2af5=_0xb995de[_0x7196('0x86')]()[_0x7196('0x42')](_0x7196('0x46'))[_0x7196('0x42')](_0x7196('0x87'),_0x7196('0x6c'));if(!_0x31080a[_0x7196('0x35')][_0x7196('0x56')]){if(_0x31080a['query'][_0x7196('0x88')]){if(_0x31080a['query'][_0x7196('0x88')]==0x1){_0x1d2af5[_0x7196('0x89')](_0x7196('0x8a'));_0xb995de[_0x7196('0x89')](_0x7196('0x8a'));}else{_0x1d2af5[_0x7196('0x89')](_0x7196('0x8b'));_0xb995de[_0x7196('0x89')](_0x7196('0x8b'));}}if(_0x31080a[_0x7196('0x35')][_0x7196('0x8c')]){var _0x419916=_[_0x7196('0x6d')](_0x31080a[_0x7196('0x35')]['tag'])?_0x31080a[_0x7196('0x35')][_0x7196('0x8c')]:new Array(_0x31080a[_0x7196('0x35')]['tag']);var _0x1e5307=squel[_0x7196('0x55')]();_0x419916['forEach'](function(_0x4d9984){_0x1e5307['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4d9984+',%');});_0xb995de[_0x7196('0x89')](_0x1e5307);_0x1d2af5['left_join'](_0x7196('0x8d'),'it',_0x7196('0x8e'));_0x1d2af5['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');_0x1d2af5['where'](_0x7196('0x8f'),_0x419916);}}else{var _0x3595ff=JSON['parse'](_0x31080a['query'][_0x7196('0x56')]);_['keys'](_0x3595ff)[_0x7196('0x30')](function(_0x5695b2){var _0x11898d=_0x3595ff[_0x5695b2];if(_0x5695b2===_0x7196('0x61')){var _0x52b966=_0x11898d['value'];var _0x9fee3=squel[_0x7196('0x55')]();_0x52b966[_0x7196('0x30')](function(_0x51d747){_0x9fee3['or'](_0x7196('0x90'),'%,'+_0x51d747+',%');});_0xb995de['having'](_0x9fee3);_0x1d2af5[_0x7196('0x4c')](_0x7196('0x91'),'it',_0x7196('0x92'));_0x1d2af5[_0x7196('0x4c')](_0x7196('0x45'),'t',_0x7196('0x93'));_0x1d2af5[_0x7196('0x3e')](_0x7196('0x8f'),_0x52b966);}else if(_0x5695b2==='unreadMessages'){if(_0x11898d[_0x7196('0x62')][_0x7196('0x3a')]===0x1){if(_0x11898d[_0x7196('0x62')][0x0]===0x1){_0x1d2af5[_0x7196('0x89')](_0x7196('0x8a'));_0xb995de['having'](_0x7196('0x8a'));}else{_0x1d2af5[_0x7196('0x89')](_0x7196('0x8b'));_0xb995de[_0x7196('0x89')](_0x7196('0x8b'));}}}});}db[_0x7196('0x94')]['query'](_0x1d2af5[_0x7196('0x95')](),_0x4ea22d)['then'](function(_0x516404){_0x47e255[_0x7196('0x22')]=_0x516404[_0x7196('0x3a')];if(_0x47e255[_0x7196('0x22')]===0x0)return[];return db[_0x7196('0x94')][_0x7196('0x35')](_0x5b8a7a[_0x7196('0x95')](),_0x4ea22d)['then'](function(_0x2c2d28){_0x415f4a=_[_0x7196('0x96')](_0x2c2d28,'id');_0x4ea22d=_[_0x7196('0x97')](_0x4ea22d,{'model':db[_0x7196('0x98')],'mapToModel':!![],'raw':!![],'nest':!![]});_0xb995de['field'](_0x7196('0x87'),_0x7196('0x6c'));_0xb995de['field']('a.key',_0x7196('0x99'));_0xb995de[_0x7196('0x42')](_0x7196('0x9a'));_0xb995de[_0x7196('0x42')](_0x7196('0x68'),'Contact.firstName');_0xb995de[_0x7196('0x42')](_0x7196('0x6a'),_0x7196('0x9b'));_0xb995de[_0x7196('0x42')](_0x7196('0x6b'),_0x7196('0x9c'));_0xb995de['field'](_0x7196('0x9d'),_0x7196('0x9e'));_0xb995de[_0x7196('0x42')](_0x7196('0x9f'),_0x7196('0xa0'));_0xb995de['field']('c.fax',_0x7196('0xa1'));_0xb995de[_0x7196('0x42')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x7196('0x2e'));_0xb995de[_0x7196('0x4c')](_0x7196('0x8d'),'it',_0x7196('0x8e'));_0xb995de[_0x7196('0x4c')](_0x7196('0x45'),'t','t.id\x20=\x20it.TagId');_0xb995de[_0x7196('0x3c')](_0x32561a[_0x7196('0x3c')]);_0xb995de[_0x7196('0x23')](_0x32561a['offset']);return db['sequelize'][_0x7196('0x35')](_0xb995de[_0x7196('0x95')](),_0x4ea22d);})[_0x7196('0x28')](function(_0x336ac9){_0x107117[_0x7196('0x3e')](_0x7196('0xa2'),_[_0x7196('0x70')](_0x336ac9,'id'));return db[_0x7196('0x94')][_0x7196('0x35')](_0x107117[_0x7196('0x95')](),_0x4ea22d)[_0x7196('0x28')](function(_0x5d7e8c){var _0x44cd0c=_[_0x7196('0xa3')](_0x5d7e8c,_0x7196('0xa4'));var _0x59c15e=[];_0x336ac9['forEach'](function(_0x2519cf){_0x59c15e[_0x7196('0x31')](updateFaxInteraction(_0x2519cf,_0x415f4a,_0x44cd0c));});return BPromise[_0x7196('0xa5')](_0x59c15e);});});})[_0x7196('0x28')](function(_0x11630a){_0x47e255[_0x7196('0xa6')]=_0x11630a;return _0x47e255;})[_0x7196('0x28')](respondWithFilteredResult(_0x2bc368,_0x32561a))[_0x7196('0x32')](handleError(_0x2bc368,null));};exports[_0x7196('0xa7')]=function(_0x12bb7a,_0x1fe739){var _0x161ded={'raw':![],'where':{'id':_0x12bb7a[_0x7196('0xa8')]['id']}},_0x3e0f00={};_0x3e0f00[_0x7196('0x37')]=_[_0x7196('0x34')](db[_0x7196('0x98')][_0x7196('0xa9')]);_0x3e0f00[_0x7196('0x35')]=_[_0x7196('0x34')](_0x12bb7a[_0x7196('0x35')]);_0x3e0f00['filters']=_[_0x7196('0x36')](_0x3e0f00[_0x7196('0x37')],_0x3e0f00[_0x7196('0x35')]);_0x161ded[_0x7196('0x38')]=_[_0x7196('0x36')](_0x3e0f00[_0x7196('0x37')],qs['fields'](_0x12bb7a[_0x7196('0x35')][_0x7196('0x39')]));_0x161ded['attributes']=_0x161ded[_0x7196('0x38')]['length']?_0x161ded[_0x7196('0x38')]:_0x3e0f00[_0x7196('0x37')];if(_0x12bb7a[_0x7196('0x35')]['includeAll']){_0x161ded[_0x7196('0xaa')]=[{'all':!![]}];}_0x161ded=_[_0x7196('0x97')]({},_0x161ded,_0x12bb7a[_0x7196('0xab')]);return db['FaxInteraction'][_0x7196('0xac')](_0x161ded)[_0x7196('0x28')](handleEntityNotFound(_0x1fe739,null))['then'](respondWithResult(_0x1fe739,null))[_0x7196('0x32')](handleError(_0x1fe739,null));};exports[_0x7196('0xad')]=function(_0x424944,_0x1f6201){return db[_0x7196('0x98')][_0x7196('0xad')](_0x424944['body'],{})[_0x7196('0x28')](respondWithResult(_0x1f6201,0xc9))[_0x7196('0x32')](handleError(_0x1f6201,null));};exports[_0x7196('0x27')]=function(_0x4a4c05,_0x3f80e2){if(_0x4a4c05['body']['id']){delete _0x4a4c05[_0x7196('0xae')]['id'];}return db[_0x7196('0x98')][_0x7196('0xac')]({'where':{'id':_0x4a4c05['params']['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x3f80e2,null))['then'](saveUpdates(_0x4a4c05['body'],null))['then'](respondWithResult(_0x3f80e2,null))['catch'](handleError(_0x3f80e2,null));};exports[_0x7196('0xaf')]=function(_0x6b96f2,_0x222d9c){return db[_0x7196('0x98')][_0x7196('0xac')]({'where':{'id':_0x6b96f2[_0x7196('0xa8')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x222d9c,null))[_0x7196('0x28')](removeEntity(_0x222d9c,null))[_0x7196('0x32')](handleError(_0x222d9c,null));};exports['describe']=function(_0x223215,_0x35dd3f){return db[_0x7196('0x98')][_0x7196('0xb0')]()['then'](respondWithResult(_0x35dd3f,null))['catch'](handleError(_0x35dd3f,null));};exports[_0x7196('0xb1')]=function(_0x5210c4,_0x42337e,_0x33cd34){return db[_0x7196('0xb2')][_0x7196('0xac')]({'where':{'id':_0x5210c4['params']['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x42337e,null))['then'](function(_0x2d30a3){if(_0x2d30a3){return _0x2d30a3[_0x7196('0xb1')](_0x5210c4[_0x7196('0xae')][_0x7196('0xb3')],_[_0x7196('0xb4')](_0x5210c4[_0x7196('0xae')],[_0x7196('0xb3'),'id'])||{});}})[_0x7196('0x28')](respondWithResult(_0x42337e,null))[_0x7196('0x32')](handleError(_0x42337e,null));};exports[_0x7196('0xb5')]=function(_0x42067c,_0x126461,_0x23bfd9){var _0x303299={'raw':![],'where':{}};var _0x5b1a42={};var _0x6affba={'count':0x0,'rows':[]};return db[_0x7196('0x98')][_0x7196('0xb6')]({'where':{'id':_0x42067c[_0x7196('0xa8')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x126461,null))['then'](function(_0x4380e3){if(_0x4380e3){_0x5b1a42[_0x7196('0x37')]=_[_0x7196('0x34')](db['FaxMessage'][_0x7196('0xa9')]);_0x5b1a42[_0x7196('0x35')]=_[_0x7196('0x34')](_0x42067c[_0x7196('0x35')]);_0x5b1a42['filters']=_[_0x7196('0x36')](_0x5b1a42[_0x7196('0x37')],_0x5b1a42[_0x7196('0x35')]);_0x303299[_0x7196('0x38')]=_[_0x7196('0x36')](_0x5b1a42[_0x7196('0x37')],qs[_0x7196('0x39')](_0x42067c['query'][_0x7196('0x39')]));_0x303299[_0x7196('0x38')]=_0x303299[_0x7196('0x38')][_0x7196('0x3a')]?_0x303299['attributes']:_0x5b1a42[_0x7196('0x37')];if(!_0x42067c[_0x7196('0x35')]['hasOwnProperty']('nolimit')){_0x303299[_0x7196('0x3c')]=qs[_0x7196('0x3c')](_0x42067c['query'][_0x7196('0x3c')]);_0x303299[_0x7196('0x23')]=qs['offset'](_0x42067c[_0x7196('0x35')][_0x7196('0x23')]);}_0x303299[_0x7196('0x80')]=qs['sort'](_0x42067c[_0x7196('0x35')][_0x7196('0x3d')]);_0x303299[_0x7196('0x3e')]=qs[_0x7196('0x3f')](_[_0x7196('0x40')](_0x42067c[_0x7196('0x35')],_0x5b1a42[_0x7196('0x3f')]));_0x303299[_0x7196('0x3e')][_0x7196('0xa4')]=_0x4380e3['id'];if(_0x42067c[_0x7196('0x35')][_0x7196('0x71')]){_0x303299[_0x7196('0x3e')]=_[_0x7196('0x97')](_0x303299[_0x7196('0x3e')],{'$or':_[_0x7196('0x70')](_0x303299[_0x7196('0x38')],function(_0x51e2ed){var _0x7ec15c={};_0x7ec15c[_0x51e2ed]={'$like':'%'+_0x42067c[_0x7196('0x35')]['filter']+'%'};return _0x7ec15c;})});}if(_0x42067c[_0x7196('0x35')][_0x7196('0x78')]){var _0x40be1d=_0x42067c[_0x7196('0x35')][_0x7196('0x78')]['split'](',');var _0xd4cfa={};_0xd4cfa[_0x40be1d[0x0]]={'$gte':moment(_0x40be1d[0x1])[_0x7196('0x5b')](_0x7196('0xb7'))};_0x303299['where']=_[_0x7196('0x97')](_0x303299[_0x7196('0x3e')],_0xd4cfa);}_0x303299=_[_0x7196('0x97')]({},_0x303299,_0x42067c['options']);return db[_0x7196('0xb2')][_0x7196('0x22')]({'where':_0x303299['where']})[_0x7196('0x28')](function(_0x1171c6){_0x6affba[_0x7196('0x22')]=_0x1171c6;if(_0x42067c[_0x7196('0x35')]['includeAll']){_0x303299[_0x7196('0xaa')]=[{'all':!![]}];}return db[_0x7196('0xb2')][_0x7196('0xb8')](_0x303299);})[_0x7196('0x28')](function(_0x6568d3){_0x6affba['rows']=_0x6568d3;return _0x6affba;});}})[_0x7196('0x28')](respondWithFilteredResult(_0x126461,_0x303299))['catch'](handleError(_0x126461,null));};exports[_0x7196('0xb9')]=function(_0x437c81,_0x129ec9,_0xcc8191){return db[_0x7196('0x98')][_0x7196('0xac')]({'where':{'id':_0x437c81['params']['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x129ec9,null))[_0x7196('0x28')](function(_0x3be57a){if(_0x3be57a){return _0x3be57a['setTags'](_0x437c81[_0x7196('0xae')][_0x7196('0xb3')],_[_0x7196('0xb4')](_0x437c81[_0x7196('0xae')],[_0x7196('0xb3'),'id'])||{})['spread'](function(){return db[_0x7196('0xba')][_0x7196('0xb8')]({'attributes':['id','name',_0x7196('0x43')],'where':{'id':_0x437c81['body']['ids']}});})[_0x7196('0x28')](function(_0x829eb9){socket['emit'](_0x7196('0xbb'),{'id':Number(_0x437c81[_0x7196('0xa8')]['id']),'tags':_0x829eb9||[]});return{'id':Number(_0x437c81[_0x7196('0xa8')]['id']),'tags':_0x829eb9||[]};});}})['then'](respondWithResult(_0x129ec9,null))['catch'](handleError(_0x129ec9,null));};exports['removeTags']=function(_0x70cd79,_0x4dac65,_0x56bb9d){return db['FaxInteraction'][_0x7196('0xac')]({'where':{'id':_0x70cd79[_0x7196('0xa8')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x4dac65,null))[_0x7196('0x28')](function(_0x1ecaab){if(_0x1ecaab){return _0x1ecaab['removeTags'](_0x70cd79[_0x7196('0x35')][_0x7196('0xb3')]);}})[_0x7196('0x28')](respondWithStatusCode(_0x4dac65,null))['catch'](handleError(_0x4dac65,null));};exports['download']=function(_0x9aa626,_0x9c3ad4){var _0x50e42d=moment()[_0x7196('0xbc')]()['toString']();var _0x14723f=path[_0x7196('0xbd')](config[_0x7196('0xbe')],_0x7196('0xbf'),_0x7196('0xc0'),_0x7196('0xc1'));var _0x4a6d8a=path['join'](config[_0x7196('0xbe')],_0x7196('0xbf'),_0x7196('0xc0'),_0x7196('0xc2'));var _0xcb0662=path[_0x7196('0xbd')](_0x4a6d8a,_0x50e42d);var _0x125113=util['format'](_0x7196('0xc3'),_0x50e42d);var _0x2d5293=path[_0x7196('0xbd')](_0x4a6d8a,_0x125113);var _0x51b3d8=![];return db['FaxInteraction']['find']({'where':{'id':_0x9aa626[_0x7196('0xa8')]['id']}})['then'](handleEntityNotFound(_0x9c3ad4,null))['then'](function(_0x470db6){if(_0x470db6){return _0x470db6[_0x7196('0xb5')]({'attributes':['id',_0x7196('0xae'),'createdAt'],'include':[{'model':db[_0x7196('0xc4')],'as':_0x7196('0xc4')}]});}return[];})[_0x7196('0x28')](function(_0x24cdc6){_0x51b3d8=_0x24cdc6[_0x7196('0x3a')];if(_0x24cdc6[_0x7196('0x3a')]){fs['mkdirSync'](_0xcb0662);for(var _0x4c4260=0x0;_0x4c4260<_0x24cdc6[_0x7196('0x3a')];_0x4c4260++){var _0x4c12f8=_0x24cdc6[_0x4c4260];var _0x45fdf9=_0x4c12f8[_0x7196('0xc4')];if(_0x45fdf9){var _0x328695=path[_0x7196('0xbd')](_0x14723f,_0x45fdf9[_0x7196('0xc5')]);if(fs['existsSync'](_0x328695)){fs[_0x7196('0xc6')](_0x328695)[_0x7196('0xc7')](fs[_0x7196('0xc8')](path[_0x7196('0xbd')](_0xcb0662,_0x45fdf9[_0x7196('0xc5')])));}}}}})[_0x7196('0x28')](function(){if(_0x51b3d8){return new BPromise(function(_0x338718,_0x5467ba){zipdir(_0xcb0662,{'saveTo':_0x2d5293},function(_0x5c1d3c,_0x1ca566){if(_0x5c1d3c)return _0x5467ba(_0x5c1d3c);return _0x338718(_0x1ca566);});});}})[_0x7196('0x28')](function(){if(_0x51b3d8){return new BPromise(function(_0x836a0,_0x1fe503){rimraf(_0xcb0662,function(_0x45bcaa){if(_0x45bcaa)_0x1fe503(_0x45bcaa);return _0x836a0();});});}})['then'](function(){if(_0x51b3d8){return _0x9c3ad4['download'](_0x2d5293,_0x125113,function(_0x49bfd4){if(_0x49bfd4){console['log']('err',_0x49bfd4);}else{fs[_0x7196('0xc9')](_0x2d5293);}});}else{return _0x9c3ad4[_0x7196('0x1f')](0xc8);}})[_0x7196('0x32')](handleError(_0x9c3ad4,null));}; \ No newline at end of file +var _0xb5cd=['error','stack','name','send','Users','TagIds','Tags','catch','index','FaxInteraction','rawAttributes','keys','query','model','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','select','field','color','from','tools_tags','fax_messages','where','me.FaxInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','u.id','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','fax_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','expr','advancedFilter','parse','dateStart','startOf','utc','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','forEach','value','TagId','unreadMessages','tableAlias','\x20IN\x20?','LIKE','ContactId','\x20LIKE\x20?','c.lastName','\x20>\x20?','\x20<\x20?','\x20=\x20?','hasOwnProperty','isNil','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','\x20IS\x20NULL','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','i.id','QueryTypes','clone','COUNT(*)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','fax_interaction_has_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','sequelize','toString','merge','COUNT(me.id)','a.key','Account.key','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.mobile','Contact.mobile','Contact.fax','it.FaxInteractionId\x20=\x20i.id','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','show','params','includeAll','include','options','find','create','body','update','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','Tag','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','interaction-%s.zip','createdAt','mkdirSync','Attachment','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb5cd,0x169));var _0xdb5c=function(_0x34f3b9,_0x4d069e){_0x34f3b9=_0x34f3b9-0x0;var _0xf8b67f=_0xb5cd[_0x34f3b9];return _0xf8b67f;};'use strict';var pdf=require(_0xdb5c('0x0'));var emlformat=require(_0xdb5c('0x1'));var rimraf=require(_0xdb5c('0x2'));var zipdir=require(_0xdb5c('0x3'));var jsonpatch=require(_0xdb5c('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdb5c('0x5'));var Mustache=require(_0xdb5c('0x6'));var util=require(_0xdb5c('0x7'));var path=require('path');var sox=require(_0xdb5c('0x8'));var csv=require(_0xdb5c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdb5c('0xa'));var squel=require(_0xdb5c('0xb'));var crypto=require(_0xdb5c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdb5c('0xd'));var toCsv=require(_0xdb5c('0x9'));var querystring=require('querystring');var Papa=require(_0xdb5c('0xe'));var Redis=require(_0xdb5c('0xf'));var authService=require(_0xdb5c('0x10'));var qs=require(_0xdb5c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb5c('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xdb5c('0x13'));var db=require(_0xdb5c('0x14'))['db'];config[_0xdb5c('0x15')]=_[_0xdb5c('0x16')](config[_0xdb5c('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xdb5c('0x17'))(new Redis(config[_0xdb5c('0x15')]));require(_0xdb5c('0x18'))[_0xdb5c('0x19')](socket);function respondWithStatusCode(_0x23905a,_0x2a799a){_0x2a799a=_0x2a799a||0xcc;return function(_0x3f598b){if(_0x3f598b){return _0x23905a[_0xdb5c('0x1a')](_0x2a799a);}return _0x23905a[_0xdb5c('0x1b')](_0x2a799a)[_0xdb5c('0x1c')]();};}function respondWithResult(_0x1281f5,_0x5590ed){_0x5590ed=_0x5590ed||0xc8;return function(_0xec2b91){if(_0xec2b91){return _0x1281f5['status'](_0x5590ed)[_0xdb5c('0x1d')](_0xec2b91);}};}function respondWithFilteredResult(_0x372270,_0x390589){return function(_0x55229e){if(_0x55229e){var _0x2228bc=_0x55229e[_0xdb5c('0x1e')],_0x30b22e=_0x390589[_0xdb5c('0x1f')],_0x1c5ad4=_0x390589[_0xdb5c('0x1f')]+_0x390589[_0xdb5c('0x20')],_0x2c2116;if(_0x1c5ad4>=_0x2228bc){_0x1c5ad4=_0x2228bc;_0x2c2116=0xc8;}else{_0x2c2116=0xce;}_0x372270[_0xdb5c('0x1b')](_0x2c2116);return _0x372270[_0xdb5c('0x21')]('Content-Range',_0x30b22e+'-'+_0x1c5ad4+'/'+_0x2228bc)[_0xdb5c('0x1d')](_0x55229e);}return null;};}function patchUpdates(_0x139d49){return function(_0x5b1158){try{jsonpatch[_0xdb5c('0x22')](_0x5b1158,_0x139d49,!![]);}catch(_0x1a486b){return BPromise[_0xdb5c('0x23')](_0x1a486b);}return _0x5b1158[_0xdb5c('0x24')]();};}function saveUpdates(_0x56d65f,_0x2d3c12){return function(_0x2c766c){if(_0x2c766c){return _0x2c766c['update'](_0x56d65f)[_0xdb5c('0x25')](function(_0x2419ac){return _0x2419ac;});}return null;};}function removeEntity(_0x46fed4,_0x2e45ee){return function(_0x1dac8c){if(_0x1dac8c){return _0x1dac8c[_0xdb5c('0x26')]()[_0xdb5c('0x25')](function(){_0x46fed4[_0xdb5c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c65f4,_0x19fd6d){return function(_0x4afbe){if(!_0x4afbe){_0x4c65f4[_0xdb5c('0x1a')](0x194);}return _0x4afbe;};}function handleError(_0x277c5c,_0x5a38c8){_0x5a38c8=_0x5a38c8||0x1f4;return function(_0x5f33e9){logger[_0xdb5c('0x27')](_0x5f33e9[_0xdb5c('0x28')]);if(_0x5f33e9['name']){delete _0x5f33e9[_0xdb5c('0x29')];}_0x277c5c[_0xdb5c('0x1b')](_0x5a38c8)[_0xdb5c('0x2a')](_0x5f33e9);};}function getInteractionUsers(_0x4f42ef,_0x319b77){return new BPromise(function(_0x1290b5,_0x6b2ca0){try{if(_0x319b77[_0x4f42ef['id']]){_0x4f42ef[_0xdb5c('0x2b')]=_['map'](_0x319b77[_0x4f42ef['id']],function(_0x32e31f){return{'id':_0x32e31f['id']};});}}catch(_0xb34e24){_0x6b2ca0(_0xb34e24);}_0x1290b5(_0x4f42ef);});}function getInteractionTags(_0x17cbfe,_0x3c0113){return new BPromise(function(_0x3a14da,_0xfa7e5e){try{if(_0x17cbfe[_0xdb5c('0x2c')]){_0x17cbfe[_0xdb5c('0x2d')]=[];_0x17cbfe[_0xdb5c('0x2c')]['split'](',')['forEach'](function(_0x1416da){_0x17cbfe[_0xdb5c('0x2d')]['push'](_0x3c0113[_0x1416da]);});}delete _0x17cbfe[_0xdb5c('0x2c')];}catch(_0x4aa0a1){_0xfa7e5e(_0x4aa0a1);}_0x3a14da(_0x17cbfe);});}function updateFaxInteraction(_0x4fb6d1,_0x35f4e1,_0x5134ae){return new BPromise(function(_0x2ab09e,_0x2af44d){return getInteractionUsers(_0x4fb6d1,_0x5134ae)[_0xdb5c('0x25')](function(_0x3f5a06){return getInteractionTags(_0x3f5a06,_0x35f4e1);})[_0xdb5c('0x25')](function(_0x2dfdba){_0x2ab09e(_0x2dfdba);})[_0xdb5c('0x2e')](function(_0x434d56){_0x2af44d(_0x434d56);});});}exports[_0xdb5c('0x2f')]=function(_0x57f0ec,_0x1d0013){var _0x4f0d70={},_0x563187={},_0x85aed3={'count':0x0,'rows':[]};var _0xb3e0d6=db[_0xdb5c('0x30')][_0xdb5c('0x31')];_0x563187['model']=_[_0xdb5c('0x32')](_0xb3e0d6);_0x563187[_0xdb5c('0x33')]=_['keys'](_0x57f0ec[_0xdb5c('0x33')]);_0x563187['filters']=_['intersection'](_0x563187[_0xdb5c('0x34')],_0x563187[_0xdb5c('0x33')]);_0x4f0d70[_0xdb5c('0x35')]=_[_0xdb5c('0x36')](_0x563187[_0xdb5c('0x34')],qs[_0xdb5c('0x37')](_0x57f0ec[_0xdb5c('0x33')][_0xdb5c('0x37')]));_0x4f0d70[_0xdb5c('0x35')]=_0x4f0d70[_0xdb5c('0x35')][_0xdb5c('0x38')]?_0x4f0d70[_0xdb5c('0x35')]:_0x563187['model'];if(!_0x57f0ec[_0xdb5c('0x33')]['hasOwnProperty'](_0xdb5c('0x39'))){_0x4f0d70[_0xdb5c('0x20')]=qs['limit'](_0x57f0ec[_0xdb5c('0x33')][_0xdb5c('0x20')]);_0x4f0d70['offset']=qs['offset'](_0x57f0ec[_0xdb5c('0x33')]['offset']);}_0x4f0d70[_0xdb5c('0x3a')]=qs[_0xdb5c('0x3b')](_0x57f0ec[_0xdb5c('0x33')]['sort']);_0x4f0d70['where']=qs[_0xdb5c('0x3c')](_[_0xdb5c('0x3d')](_0x57f0ec['query'],_0x563187[_0xdb5c('0x3c')]));var _0x275aec=[];var _0xb25b01=squel[_0xdb5c('0x3e')]()[_0xdb5c('0x3f')]('id')[_0xdb5c('0x3f')](_0xdb5c('0x29'))[_0xdb5c('0x3f')](_0xdb5c('0x40'))[_0xdb5c('0x41')](_0xdb5c('0x42'));var _0x551857=squel['select']()[_0xdb5c('0x3f')]('COUNT(*)')['from'](_0xdb5c('0x43'),'me')[_0xdb5c('0x44')](_0xdb5c('0x45'))[_0xdb5c('0x44')](_0xdb5c('0x46'))['where']('me.read\x20=\x20false');var _0x2d09ae=squel[_0xdb5c('0x3e')]()['field'](_0xdb5c('0x47'))[_0xdb5c('0x3f')]('ui.FaxInteractionId')['from'](_0xdb5c('0x48'),'ui')['left_join'](_0xdb5c('0x49'),'u',_0xdb5c('0x4a'));var _0xf0b21e=squel['select']()[_0xdb5c('0x41')](_0xdb5c('0x4b'),'i')[_0xdb5c('0x4c')](_0xdb5c('0x4d'),'c',_0xdb5c('0x4e'))['left_join'](_0xdb5c('0x49'),'o',_0xdb5c('0x4f'))[_0xdb5c('0x4c')](_0xdb5c('0x50'),'a','a.id\x20=\x20i.FaxAccountId')['left_join'](_0xdb5c('0x43'),'me','me.FaxInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false');var _0x15a2cb=squel[_0xdb5c('0x51')]();if(_0x57f0ec['query'][_0xdb5c('0x52')]){var _0x202ac6=JSON[_0xdb5c('0x53')](_0x57f0ec[_0xdb5c('0x33')]['advancedFilter']);_[_0xdb5c('0x32')](_0x202ac6)['forEach'](function(_0x457bd5){var _0x1b948e=_0x202ac6[_0x457bd5];if(_0x457bd5==='createdAt'){var _0x352a4e=moment(_0x1b948e['value'][_0xdb5c('0x54')])[_0xdb5c('0x55')]('day')[_0xdb5c('0x56')]()[_0xdb5c('0x57')]();var _0x343df2=moment(_0x343df2)[_0xdb5c('0x56')]()[_0xdb5c('0x58')]('day')[_0xdb5c('0x57')]();_0x15a2cb[_0xdb5c('0x59')](_0xdb5c('0x5a'),_0x352a4e,_0x343df2);}else{if(_[_0xdb5c('0x5b')](_0x1b948e[_0xdb5c('0x5c')])){_0x1b948e['condition'][_0xdb5c('0x5d')](function(_0x3eb7fb){switch(_0x1b948e[_0xdb5c('0x5c')][_0xdb5c('0x5e')]){case'IS':if(_0x457bd5!==_0xdb5c('0x5f')&&_0x457bd5!==_0xdb5c('0x60')){if(_[_0xdb5c('0x5b')](_0x1b948e['value'])&&_0x1b948e[_0xdb5c('0x5e')][_0xdb5c('0x38')]>0x1){_0x15a2cb[_0xdb5c('0x59')](_0x1b948e[_0xdb5c('0x61')]+'.'+_0x457bd5+_0xdb5c('0x62'),_0x1b948e[_0xdb5c('0x5e')]);}else{_0x15a2cb['and'](_0x1b948e[_0xdb5c('0x61')]+'.'+_0x457bd5+'\x20=\x20?',_0x1b948e[_0xdb5c('0x5e')][0x0]);}}break;case'=':_0x15a2cb[_0xdb5c('0x59')](_0x1b948e['tableAlias']+'.'+_0x457bd5+'\x20=\x20?',_0x1b948e[_0xdb5c('0x5e')]);break;case _0xdb5c('0x63'):if(_0x457bd5===_0xdb5c('0x64')){_0x15a2cb['and']('c.firstName'+_0xdb5c('0x65'),'%'+_0x1b948e[_0xdb5c('0x5e')]+'%');_0x15a2cb['or'](_0xdb5c('0x66')+_0xdb5c('0x65'),'%'+_0x1b948e[_0xdb5c('0x5e')]+'%');_0x15a2cb['or']('c.email'+_0xdb5c('0x65'),'%'+_0x1b948e[_0xdb5c('0x5e')]+'%');}else{_0x15a2cb[_0xdb5c('0x59')](_0x1b948e[_0xdb5c('0x61')]+'.'+_0x457bd5+'\x20LIKE\x20?','%'+_0x1b948e[_0xdb5c('0x5e')]+'%');}break;case'>':_0x15a2cb[_0xdb5c('0x59')](_0x1b948e[_0xdb5c('0x61')]+'.'+_0x457bd5+_0xdb5c('0x67'),_0x1b948e['value']);break;case'<':_0x15a2cb[_0xdb5c('0x59')](_0x1b948e[_0xdb5c('0x61')]+'.'+_0x457bd5+_0xdb5c('0x68'),_0x1b948e[_0xdb5c('0x5e')]);break;}});}else{switch(_0x1b948e['condition'][_0xdb5c('0x5e')]){case'IS':if(_0x457bd5!=='TagId'&&_0x457bd5!==_0xdb5c('0x60')){if(_[_0xdb5c('0x5b')](_0x1b948e[_0xdb5c('0x5e')])&&_0x1b948e[_0xdb5c('0x5e')][_0xdb5c('0x38')]>0x1){_0x15a2cb[_0xdb5c('0x59')](_0x1b948e[_0xdb5c('0x61')]+'.'+_0x457bd5+_0xdb5c('0x62'),_0x1b948e['value']);}else{_0x15a2cb[_0xdb5c('0x59')](_0x1b948e[_0xdb5c('0x61')]+'.'+_0x457bd5+_0xdb5c('0x69'),_0x1b948e[_0xdb5c('0x5e')][0x0]);}}break;case'=':_0x15a2cb[_0xdb5c('0x59')](_0x1b948e['tableAlias']+'.'+_0x457bd5+'\x20=\x20?',_0x1b948e[_0xdb5c('0x5e')]);break;case'LIKE':if(_0x457bd5===_0xdb5c('0x64')){_0x15a2cb['and']('c.firstName'+_0xdb5c('0x65'),'%'+_0x1b948e[_0xdb5c('0x5e')]+'%');_0x15a2cb['or'](_0xdb5c('0x66')+_0xdb5c('0x65'),'%'+_0x1b948e[_0xdb5c('0x5e')]+'%');_0x15a2cb['or']('c.email'+_0xdb5c('0x65'),'%'+_0x1b948e[_0xdb5c('0x5e')]+'%');}else{_0x15a2cb['and'](_0x1b948e[_0xdb5c('0x61')]+'.'+_0x457bd5+'\x20LIKE\x20?','%'+_0x1b948e[_0xdb5c('0x5e')]+'%');}break;case'>':_0x15a2cb['and'](_0x1b948e[_0xdb5c('0x61')]+'.'+_0x457bd5+_0xdb5c('0x67'),_0x1b948e[_0xdb5c('0x5e')]);break;case'<':_0x15a2cb[_0xdb5c('0x59')](_0x1b948e[_0xdb5c('0x61')]+'.'+_0x457bd5+'\x20<\x20?',_0x1b948e['value']);break;}}}});}else{var _0x2a46e3=_(Object[_0xdb5c('0x32')](_0x57f0ec[_0xdb5c('0x33')]))['map'](function(_0x2cb6f1){return _0xb3e0d6[_0xdb5c('0x6a')](_0x2cb6f1)?_0x2cb6f1:undefined;})['filter'](function(_0x32ceb0){return!_[_0xdb5c('0x6b')](_0x32ceb0);})[_0xdb5c('0x5e')]();if(!_[_0xdb5c('0x6c')](_0x2a46e3)){_0x2a46e3[_0xdb5c('0x5d')](function(_0x2111a9){if(_0x2111a9===_0xdb5c('0x6d')){_0xf0b21e[_0xdb5c('0x44')](_0xdb5c('0x6e'),[]['concat'](_0x57f0ec[_0xdb5c('0x33')][_0x2111a9]));}else if(_0x2111a9==='createdAt'){var _0x31e7dc=JSON[_0xdb5c('0x53')](_0x57f0ec[_0xdb5c('0x33')][_0x2111a9])['$gte'];var _0x4836da=JSON['parse'](_0x57f0ec[_0xdb5c('0x33')][_0x2111a9])['$lte'];_0xf0b21e[_0xdb5c('0x44')](_0xdb5c('0x5a'),_0x31e7dc,_0x4836da);}else{if(_0x57f0ec[_0xdb5c('0x33')][_0x2111a9]==='null'){_0xf0b21e[_0xdb5c('0x44')]('i.'+_0x2111a9+_0xdb5c('0x6f'));}else{_0xf0b21e[_0xdb5c('0x44')]('i.'+_0x2111a9+_0xdb5c('0x69'),_0x57f0ec['query'][_0x2111a9]);}}});}if(_0x57f0ec[_0xdb5c('0x33')][_0xdb5c('0x70')]){var _0x398ddc=_0x57f0ec[_0xdb5c('0x33')]['filter'][_0xdb5c('0x71')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xdb5c('0x72'));if(qs[_0xdb5c('0x73')](_0x398ddc)){_0x15a2cb['or'](_0xdb5c('0x74'),_0x398ddc+'%')['or'](_0xdb5c('0x75'),_0x398ddc+'%');}_0x15a2cb['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x398ddc+'%');}}_0xf0b21e[_0xdb5c('0x44')](_0x15a2cb);if(_0x4f0d70[_0xdb5c('0x3a')]){_0x4f0d70[_0xdb5c('0x3a')][_0xdb5c('0x5d')](function(_0x1dcde6){_0xf0b21e['order']('i.'+_0x1dcde6[0x0],_0x1dcde6[0x1]==='DESC'?![]:!![]);});}_0xf0b21e[_0xdb5c('0x76')](_0xdb5c('0x77'));var _0x525ab6={'type':db['Sequelize'][_0xdb5c('0x78')]['SELECT'],'raw':!![]};var _0x12217e=_0xf0b21e[_0xdb5c('0x79')]()[_0xdb5c('0x3f')](_0xdb5c('0x7a'))['field']('COUNT(me.id)',_0xdb5c('0x60'));if(!_0x57f0ec[_0xdb5c('0x33')]['advancedFilter']){if(_0x57f0ec['query'][_0xdb5c('0x7b')]){if(_0x57f0ec['query'][_0xdb5c('0x7b')]==0x1){_0x12217e[_0xdb5c('0x7c')](_0xdb5c('0x7d'));_0xf0b21e[_0xdb5c('0x7c')]('`unreadMessages`\x20=\x200');}else{_0x12217e[_0xdb5c('0x7c')](_0xdb5c('0x7e'));_0xf0b21e['having'](_0xdb5c('0x7e'));}}if(_0x57f0ec[_0xdb5c('0x33')][_0xdb5c('0x7f')]){var _0xe39121=_['isArray'](_0x57f0ec['query'][_0xdb5c('0x7f')])?_0x57f0ec['query']['tag']:new Array(_0x57f0ec[_0xdb5c('0x33')]['tag']);var _0x4bfcb6=squel[_0xdb5c('0x51')]();_0xe39121[_0xdb5c('0x5d')](function(_0xecb85d){_0x4bfcb6['or'](_0xdb5c('0x80'),'%,'+_0xecb85d+',%');});_0xf0b21e[_0xdb5c('0x7c')](_0x4bfcb6);_0x12217e['left_join'](_0xdb5c('0x81'),'it','it.FaxInteractionId\x20=\x20i.id');_0x12217e[_0xdb5c('0x4c')](_0xdb5c('0x42'),'t',_0xdb5c('0x82'));_0x12217e[_0xdb5c('0x44')](_0xdb5c('0x83'),_0xe39121);}}else{var _0x202ac6=JSON[_0xdb5c('0x53')](_0x57f0ec[_0xdb5c('0x33')]['advancedFilter']);_[_0xdb5c('0x32')](_0x202ac6)[_0xdb5c('0x5d')](function(_0x41303e){var _0x2c1626=_0x202ac6[_0x41303e];if(_0x41303e===_0xdb5c('0x5f')){var _0x2177e7=_0x2c1626[_0xdb5c('0x5e')];var _0x1f99a3=squel[_0xdb5c('0x51')]();_0x2177e7[_0xdb5c('0x5d')](function(_0x2505f2){_0x1f99a3['or'](_0xdb5c('0x80'),'%,'+_0x2505f2+',%');});_0xf0b21e[_0xdb5c('0x7c')](_0x1f99a3);_0x12217e['left_join'](_0xdb5c('0x84'),'it',_0xdb5c('0x85'));_0x12217e[_0xdb5c('0x4c')](_0xdb5c('0x42'),'t',_0xdb5c('0x82'));_0x12217e['where'](_0xdb5c('0x83'),_0x2177e7);}else if(_0x41303e===_0xdb5c('0x60')){if(_0x2c1626[_0xdb5c('0x5e')]['length']===0x1){if(_0x2c1626[_0xdb5c('0x5e')][0x0]===0x1){_0x12217e[_0xdb5c('0x7c')](_0xdb5c('0x7d'));_0xf0b21e[_0xdb5c('0x7c')]('`unreadMessages`\x20=\x200');}else{_0x12217e[_0xdb5c('0x7c')](_0xdb5c('0x7e'));_0xf0b21e[_0xdb5c('0x7c')](_0xdb5c('0x7e'));}}}});}db[_0xdb5c('0x86')][_0xdb5c('0x33')](_0x12217e['toString'](),_0x525ab6)[_0xdb5c('0x25')](function(_0x168579){_0x85aed3[_0xdb5c('0x1e')]=_0x168579[_0xdb5c('0x38')];if(_0x85aed3[_0xdb5c('0x1e')]===0x0)return[];return db[_0xdb5c('0x86')][_0xdb5c('0x33')](_0xb25b01[_0xdb5c('0x87')](),_0x525ab6)[_0xdb5c('0x25')](function(_0x18fb42){_0x275aec=_['keyBy'](_0x18fb42,'id');_0x525ab6=_[_0xdb5c('0x88')](_0x525ab6,{'model':db[_0xdb5c('0x30')],'mapToModel':!![],'raw':!![],'nest':!![]});_0xf0b21e[_0xdb5c('0x3f')](_0xdb5c('0x89'),_0xdb5c('0x60'));_0xf0b21e[_0xdb5c('0x3f')](_0xdb5c('0x8a'),_0xdb5c('0x8b'));_0xf0b21e['field'](_0xdb5c('0x8c'));_0xf0b21e[_0xdb5c('0x3f')](_0xdb5c('0x8d'),_0xdb5c('0x8e'));_0xf0b21e[_0xdb5c('0x3f')]('c.lastName',_0xdb5c('0x8f'));_0xf0b21e[_0xdb5c('0x3f')](_0xdb5c('0x90'),_0xdb5c('0x91'));_0xf0b21e[_0xdb5c('0x3f')]('c.phone','Contact.phone');_0xf0b21e[_0xdb5c('0x3f')](_0xdb5c('0x92'),_0xdb5c('0x93'));_0xf0b21e[_0xdb5c('0x3f')]('c.fax',_0xdb5c('0x94'));_0xf0b21e[_0xdb5c('0x3f')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');_0xf0b21e[_0xdb5c('0x4c')](_0xdb5c('0x81'),'it',_0xdb5c('0x95'));_0xf0b21e[_0xdb5c('0x4c')]('tools_tags','t',_0xdb5c('0x82'));_0xf0b21e[_0xdb5c('0x20')](_0x4f0d70[_0xdb5c('0x20')]);_0xf0b21e[_0xdb5c('0x1f')](_0x4f0d70[_0xdb5c('0x1f')]);return db[_0xdb5c('0x86')]['query'](_0xf0b21e['toString'](),_0x525ab6);})[_0xdb5c('0x25')](function(_0x50732d){_0x2d09ae[_0xdb5c('0x44')](_0xdb5c('0x96'),_['map'](_0x50732d,'id'));return db[_0xdb5c('0x86')][_0xdb5c('0x33')](_0x2d09ae[_0xdb5c('0x87')](),_0x525ab6)[_0xdb5c('0x25')](function(_0x4d0a94){var _0xc99855=_[_0xdb5c('0x97')](_0x4d0a94,_0xdb5c('0x98'));var _0x33efe=[];_0x50732d[_0xdb5c('0x5d')](function(_0x46b0c6){_0x33efe['push'](updateFaxInteraction(_0x46b0c6,_0x275aec,_0xc99855));});return BPromise[_0xdb5c('0x99')](_0x33efe);});});})[_0xdb5c('0x25')](function(_0x1fc5a7){_0x85aed3['rows']=_0x1fc5a7;return _0x85aed3;})[_0xdb5c('0x25')](respondWithFilteredResult(_0x1d0013,_0x4f0d70))['catch'](handleError(_0x1d0013,null));};exports[_0xdb5c('0x9a')]=function(_0x5cb068,_0x224f6c){var _0x76f456={'raw':![],'where':{'id':_0x5cb068[_0xdb5c('0x9b')]['id']}},_0x5b9085={};_0x5b9085['model']=_['keys'](db[_0xdb5c('0x30')][_0xdb5c('0x31')]);_0x5b9085[_0xdb5c('0x33')]=_[_0xdb5c('0x32')](_0x5cb068[_0xdb5c('0x33')]);_0x5b9085[_0xdb5c('0x3c')]=_['intersection'](_0x5b9085[_0xdb5c('0x34')],_0x5b9085[_0xdb5c('0x33')]);_0x76f456[_0xdb5c('0x35')]=_[_0xdb5c('0x36')](_0x5b9085[_0xdb5c('0x34')],qs[_0xdb5c('0x37')](_0x5cb068[_0xdb5c('0x33')][_0xdb5c('0x37')]));_0x76f456[_0xdb5c('0x35')]=_0x76f456['attributes'][_0xdb5c('0x38')]?_0x76f456[_0xdb5c('0x35')]:_0x5b9085[_0xdb5c('0x34')];if(_0x5cb068[_0xdb5c('0x33')][_0xdb5c('0x9c')]){_0x76f456[_0xdb5c('0x9d')]=[{'all':!![]}];}_0x76f456=_[_0xdb5c('0x88')]({},_0x76f456,_0x5cb068[_0xdb5c('0x9e')]);return db['FaxInteraction'][_0xdb5c('0x9f')](_0x76f456)[_0xdb5c('0x25')](handleEntityNotFound(_0x224f6c,null))[_0xdb5c('0x25')](respondWithResult(_0x224f6c,null))[_0xdb5c('0x2e')](handleError(_0x224f6c,null));};exports[_0xdb5c('0xa0')]=function(_0x187799,_0x66e169){return db[_0xdb5c('0x30')][_0xdb5c('0xa0')](_0x187799[_0xdb5c('0xa1')],{})[_0xdb5c('0x25')](respondWithResult(_0x66e169,0xc9))[_0xdb5c('0x2e')](handleError(_0x66e169,null));};exports[_0xdb5c('0xa2')]=function(_0xe0712e,_0x14dc0c){if(_0xe0712e['body']['id']){delete _0xe0712e[_0xdb5c('0xa1')]['id'];}return db[_0xdb5c('0x30')]['find']({'where':{'id':_0xe0712e['params']['id']}})[_0xdb5c('0x25')](handleEntityNotFound(_0x14dc0c,null))[_0xdb5c('0x25')](saveUpdates(_0xe0712e['body'],null))[_0xdb5c('0x25')](respondWithResult(_0x14dc0c,null))[_0xdb5c('0x2e')](handleError(_0x14dc0c,null));};exports['destroy']=function(_0x25bf61,_0x38960b){return db[_0xdb5c('0x30')][_0xdb5c('0x9f')]({'where':{'id':_0x25bf61[_0xdb5c('0x9b')]['id']}})['then'](handleEntityNotFound(_0x38960b,null))['then'](removeEntity(_0x38960b,null))[_0xdb5c('0x2e')](handleError(_0x38960b,null));};exports[_0xdb5c('0xa3')]=function(_0x2ba15c,_0x14c311){return db[_0xdb5c('0x30')][_0xdb5c('0xa3')]()['then'](respondWithResult(_0x14c311,null))[_0xdb5c('0x2e')](handleError(_0x14c311,null));};exports[_0xdb5c('0xa4')]=function(_0x4c2087,_0x31532b,_0x3202c2){return db[_0xdb5c('0xa5')][_0xdb5c('0x9f')]({'where':{'id':_0x4c2087[_0xdb5c('0x9b')]['id']}})[_0xdb5c('0x25')](handleEntityNotFound(_0x31532b,null))['then'](function(_0x247af5){if(_0x247af5){return _0x247af5[_0xdb5c('0xa4')](_0x4c2087[_0xdb5c('0xa1')][_0xdb5c('0xa6')],_[_0xdb5c('0xa7')](_0x4c2087[_0xdb5c('0xa1')],[_0xdb5c('0xa6'),'id'])||{});}})[_0xdb5c('0x25')](respondWithResult(_0x31532b,null))[_0xdb5c('0x2e')](handleError(_0x31532b,null));};exports[_0xdb5c('0xa8')]=function(_0x4120c6,_0x2f66e5,_0x174dab){var _0xad81f7={'raw':![],'where':{}};var _0x47163c={};var _0x185e4a={'count':0x0,'rows':[]};return db[_0xdb5c('0x30')][_0xdb5c('0xa9')]({'where':{'id':_0x4120c6[_0xdb5c('0x9b')]['id']}})[_0xdb5c('0x25')](handleEntityNotFound(_0x2f66e5,null))[_0xdb5c('0x25')](function(_0x26886d){if(_0x26886d){_0x47163c['model']=_[_0xdb5c('0x32')](db[_0xdb5c('0xa5')][_0xdb5c('0x31')]);_0x47163c['query']=_['keys'](_0x4120c6[_0xdb5c('0x33')]);_0x47163c['filters']=_['intersection'](_0x47163c['model'],_0x47163c['query']);_0xad81f7[_0xdb5c('0x35')]=_[_0xdb5c('0x36')](_0x47163c['model'],qs[_0xdb5c('0x37')](_0x4120c6['query'][_0xdb5c('0x37')]));_0xad81f7[_0xdb5c('0x35')]=_0xad81f7['attributes'][_0xdb5c('0x38')]?_0xad81f7[_0xdb5c('0x35')]:_0x47163c[_0xdb5c('0x34')];if(!_0x4120c6[_0xdb5c('0x33')][_0xdb5c('0x6a')](_0xdb5c('0x39'))){_0xad81f7['limit']=qs[_0xdb5c('0x20')](_0x4120c6['query'][_0xdb5c('0x20')]);_0xad81f7[_0xdb5c('0x1f')]=qs[_0xdb5c('0x1f')](_0x4120c6['query'][_0xdb5c('0x1f')]);}_0xad81f7['order']=qs[_0xdb5c('0x3b')](_0x4120c6[_0xdb5c('0x33')][_0xdb5c('0x3b')]);_0xad81f7[_0xdb5c('0x44')]=qs['filters'](_[_0xdb5c('0x3d')](_0x4120c6[_0xdb5c('0x33')],_0x47163c[_0xdb5c('0x3c')]));_0xad81f7[_0xdb5c('0x44')][_0xdb5c('0x98')]=_0x26886d['id'];if(_0x4120c6['query'][_0xdb5c('0x70')]){_0xad81f7['where']=_[_0xdb5c('0x88')](_0xad81f7[_0xdb5c('0x44')],{'$or':_[_0xdb5c('0xaa')](_0xad81f7['attributes'],function(_0x4e58f1){var _0x3ba7bd={};_0x3ba7bd[_0x4e58f1]={'$like':'%'+_0x4120c6['query'][_0xdb5c('0x70')]+'%'};return _0x3ba7bd;})});}if(_0x4120c6['query']['$gte']){var _0x41ba0a=_0x4120c6['query'][_0xdb5c('0xab')][_0xdb5c('0xac')](',');var _0x54a366={};_0x54a366[_0x41ba0a[0x0]]={'$gte':moment(_0x41ba0a[0x1])[_0xdb5c('0x57')](_0xdb5c('0xad'))};_0xad81f7[_0xdb5c('0x44')]=_['merge'](_0xad81f7['where'],_0x54a366);}_0xad81f7=_['merge']({},_0xad81f7,_0x4120c6[_0xdb5c('0x9e')]);return db['FaxMessage'][_0xdb5c('0x1e')]({'where':_0xad81f7[_0xdb5c('0x44')]})[_0xdb5c('0x25')](function(_0x384837){_0x185e4a[_0xdb5c('0x1e')]=_0x384837;if(_0x4120c6['query'][_0xdb5c('0x9c')]){_0xad81f7[_0xdb5c('0x9d')]=[{'all':!![]}];}return db[_0xdb5c('0xa5')][_0xdb5c('0xae')](_0xad81f7);})['then'](function(_0x4fff74){_0x185e4a[_0xdb5c('0xaf')]=_0x4fff74;return _0x185e4a;});}})['then'](respondWithFilteredResult(_0x2f66e5,_0xad81f7))[_0xdb5c('0x2e')](handleError(_0x2f66e5,null));};exports[_0xdb5c('0xb0')]=function(_0x33c7d4,_0x154474,_0x1b1706){return db[_0xdb5c('0x30')][_0xdb5c('0x9f')]({'where':{'id':_0x33c7d4[_0xdb5c('0x9b')]['id']}})[_0xdb5c('0x25')](handleEntityNotFound(_0x154474,null))[_0xdb5c('0x25')](function(_0x5a924a){if(_0x5a924a){return _0x5a924a[_0xdb5c('0xb1')](_0x33c7d4[_0xdb5c('0xa1')][_0xdb5c('0xa6')],_[_0xdb5c('0xa7')](_0x33c7d4[_0xdb5c('0xa1')],[_0xdb5c('0xa6'),'id'])||{})[_0xdb5c('0xb2')](function(){return db[_0xdb5c('0xb3')]['findAll']({'attributes':['id',_0xdb5c('0x29'),'color'],'where':{'id':_0x33c7d4[_0xdb5c('0xa1')][_0xdb5c('0xa6')]}});})[_0xdb5c('0x25')](function(_0x882b42){socket[_0xdb5c('0xb4')](_0xdb5c('0xb5'),{'id':Number(_0x33c7d4[_0xdb5c('0x9b')]['id']),'tags':_0x882b42||[]});return{'id':Number(_0x33c7d4[_0xdb5c('0x9b')]['id']),'tags':_0x882b42||[]};});}})[_0xdb5c('0x25')](respondWithResult(_0x154474,null))[_0xdb5c('0x2e')](handleError(_0x154474,null));};exports['removeTags']=function(_0x22d1f9,_0x42bc63,_0x22f415){return db[_0xdb5c('0x30')][_0xdb5c('0x9f')]({'where':{'id':_0x22d1f9[_0xdb5c('0x9b')]['id']}})[_0xdb5c('0x25')](handleEntityNotFound(_0x42bc63,null))[_0xdb5c('0x25')](function(_0x146043){if(_0x146043){return _0x146043[_0xdb5c('0xb6')](_0x22d1f9[_0xdb5c('0x33')][_0xdb5c('0xa6')]);}})[_0xdb5c('0x25')](respondWithStatusCode(_0x42bc63,null))[_0xdb5c('0x2e')](handleError(_0x42bc63,null));};exports[_0xdb5c('0xb7')]=function(_0x36e178,_0x1a09ba){var _0x87ddb4=moment()[_0xdb5c('0xb8')]()[_0xdb5c('0x87')]();var _0x329d06=path[_0xdb5c('0xb9')](config[_0xdb5c('0xba')],_0xdb5c('0xbb'),_0xdb5c('0xbc'),'attachments');var _0x3b537e=path[_0xdb5c('0xb9')](config[_0xdb5c('0xba')],_0xdb5c('0xbb'),_0xdb5c('0xbc'),'tmp');var _0x532b8f=path['join'](_0x3b537e,_0x87ddb4);var _0x5cd737=util[_0xdb5c('0x57')](_0xdb5c('0xbd'),_0x87ddb4);var _0x314849=path[_0xdb5c('0xb9')](_0x3b537e,_0x5cd737);var _0x4ca86b=![];return db[_0xdb5c('0x30')][_0xdb5c('0x9f')]({'where':{'id':_0x36e178[_0xdb5c('0x9b')]['id']}})['then'](handleEntityNotFound(_0x1a09ba,null))[_0xdb5c('0x25')](function(_0x48d95e){if(_0x48d95e){return _0x48d95e[_0xdb5c('0xa8')]({'attributes':['id','body',_0xdb5c('0xbe')],'include':[{'model':db['Attachment'],'as':'Attachment'}]});}return[];})[_0xdb5c('0x25')](function(_0x2e0f90){_0x4ca86b=_0x2e0f90[_0xdb5c('0x38')];if(_0x2e0f90['length']){fs[_0xdb5c('0xbf')](_0x532b8f);for(var _0x440248=0x0;_0x440248<_0x2e0f90[_0xdb5c('0x38')];_0x440248++){var _0x294369=_0x2e0f90[_0x440248];var _0x5bc958=_0x294369[_0xdb5c('0xc0')];if(_0x5bc958){var _0x16c622=path[_0xdb5c('0xb9')](_0x329d06,_0x5bc958[_0xdb5c('0xc1')]);if(fs[_0xdb5c('0xc2')](_0x16c622)){fs[_0xdb5c('0xc3')](_0x16c622)[_0xdb5c('0xc4')](fs[_0xdb5c('0xc5')](path[_0xdb5c('0xb9')](_0x532b8f,_0x5bc958[_0xdb5c('0xc1')])));}}}}})[_0xdb5c('0x25')](function(){if(_0x4ca86b){return new BPromise(function(_0x548114,_0x6e7b0a){zipdir(_0x532b8f,{'saveTo':_0x314849},function(_0x499e83,_0x23a33c){if(_0x499e83)return _0x6e7b0a(_0x499e83);return _0x548114(_0x23a33c);});});}})[_0xdb5c('0x25')](function(){if(_0x4ca86b){return new BPromise(function(_0x9afe50,_0x268a74){rimraf(_0x532b8f,function(_0x22be7b){if(_0x22be7b)_0x268a74(_0x22be7b);return _0x9afe50();});});}})[_0xdb5c('0x25')](function(){if(_0x4ca86b){return _0x1a09ba[_0xdb5c('0xb7')](_0x314849,_0x5cd737,function(_0x2522a3){if(_0x2522a3){console[_0xdb5c('0xc6')](_0xdb5c('0xc7'),_0x2522a3);}else{fs['unlinkSync'](_0x314849);}});}else{return _0x1a09ba['sendStatus'](0xc8);}})[_0xdb5c('0x2e')](handleError(_0x1a09ba,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 82d3fd4..d208390 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 _0xcb2d=['events','../../mysqldb','FaxMessage','setMaxListeners','save','update','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','exports'];(function(_0x4c0256,_0x435a87){var _0x48aa14=function(_0x302ac3){while(--_0x302ac3){_0x4c0256['push'](_0x4c0256['shift']());}};_0x48aa14(++_0x435a87);}(_0xcb2d,0x121));var _0xdcb2=function(_0x19e000,_0x189446){_0x19e000=_0x19e000-0x0;var _0x3da506=_0xcb2d[_0x19e000];return _0x3da506;};'use strict';var EventEmitter=require(_0xdcb2('0x0'));var FaxInteraction=require(_0xdcb2('0x1'))['db']['FaxInteraction'];var FaxMessage=require('../../mysqldb')['db'][_0xdcb2('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xdcb2('0x3')](0x0);var events={'afterCreate':_0xdcb2('0x4'),'afterUpdate':_0xdcb2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x392b76){return function(_0x2e4a6d,_0x2ed4c0,_0xc2ee4f){_0x2e4a6d[_0xdcb2('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1e3ef6){_0x2e4a6d[_0xdcb2('0x7')](_0xdcb2('0x8'),_0x1e3ef6[_0xdcb2('0x9')](function(_0x1f4558){return{'id':_0x1f4558['id']};}));return FaxMessage[_0xdcb2('0xa')]({'where':{'FaxInteractionId':_0x2e4a6d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdcb2('0xb')](function(_0x56e5a5){_0x2e4a6d[_0xdcb2('0x7')](_0xdcb2('0xc'),_0x56e5a5[_0xdcb2('0xd')]);FaxInteractionEvents[_0xdcb2('0xe')](_0x392b76+':'+_0x2e4a6d['id'],_0x2e4a6d);FaxInteractionEvents[_0xdcb2('0xe')](_0x392b76,_0x2e4a6d);_0xc2ee4f(null);})[_0xdcb2('0xf')](_0xc2ee4f(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xdcb2('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0x420a=['unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','setDataValue'];(function(_0x127316,_0x2774a8){var _0x34d919=function(_0x22691d){while(--_0x22691d){_0x127316['push'](_0x127316['shift']());}};_0x34d919(++_0x2774a8);}(_0x420a,0x15d));var _0xa420=function(_0x3a7f24,_0xe51ca4){_0x3a7f24=_0x3a7f24-0x0;var _0x2b344a=_0x420a[_0x3a7f24];return _0x2b344a;};'use strict';var EventEmitter=require(_0xa420('0x0'));var FaxInteraction=require(_0xa420('0x1'))['db']['FaxInteraction'];var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xa420('0x2')](0x0);var events={'afterCreate':_0xa420('0x3'),'afterUpdate':_0xa420('0x4'),'afterDestroy':_0xa420('0x5')};function emitEvent(_0x3ef319){return function(_0x48eaad,_0x2eae8a,_0x1965dc){_0x48eaad[_0xa420('0x6')]({'attributes':['id'],'raw':!![]})[_0xa420('0x7')](function(_0x34f4c4){_0x48eaad['setDataValue'](_0xa420('0x8'),_0x34f4c4[_0xa420('0x9')](function(_0x1609fe){return{'id':_0x1609fe['id']};}));return FaxMessage[_0xa420('0xa')]({'where':{'FaxInteractionId':_0x48eaad['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa420('0x7')](function(_0x119335){_0x48eaad[_0xa420('0xb')](_0xa420('0xc'),_0x119335[_0xa420('0xd')]);FaxInteractionEvents[_0xa420('0xe')](_0x3ef319+':'+_0x48eaad['id'],_0x48eaad);FaxInteractionEvents[_0xa420('0xe')](_0x3ef319,_0x48eaad);_0x1965dc(null);})[_0xa420('0xf')](_0x1965dc(null));};}for(var e in events){if(events[_0xa420('0x10')](e)){var event=events[e];FaxInteraction[_0xa420('0x11')](e,emitEvent(event));}}module[_0xa420('0x12')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 491cd79..0c4e7e2 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 _0xecd7=['bluebird','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment'];(function(_0x4235aa,_0x371cb7){var _0x3949ae=function(_0x3bb434){while(--_0x3bb434){_0x4235aa['push'](_0x4235aa['shift']());}};_0x3949ae(++_0x371cb7);}(_0xecd7,0x1f3));var _0x7ecd=function(_0x17aaf5,_0x342c3b){_0x17aaf5=_0x17aaf5-0x0;var _0x120f8b=_0xecd7[_0x17aaf5];return _0x120f8b;};'use strict';var _=require(_0x7ecd('0x0'));var util=require(_0x7ecd('0x1'));var logger=require(_0x7ecd('0x2'))(_0x7ecd('0x3'));var moment=require(_0x7ecd('0x4'));var BPromise=require(_0x7ecd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7ecd('0x6'));var rimraf=require(_0x7ecd('0x7'));var config=require(_0x7ecd('0x8'));var attributes=require(_0x7ecd('0x9'));module[_0x7ecd('0xa')]=function(_0x4f7435,_0x20a5a0){return _0x4f7435['define'](_0x7ecd('0xb'),attributes,{'tableName':_0x7ecd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5e8eed,_0x4a31a1,_0x5a0483){if(_0x5e8eed[_0x7ecd('0xd')](_0x7ecd('0xe'))){_0x5e8eed[_0x7ecd('0xf')]=moment()[_0x7ecd('0x10')](_0x7ecd('0x11'));}_0x5a0483(null,_0x5e8eed);}}});}; \ No newline at end of file +var _0x2cf7=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','exports','fax_interactions','changed','format'];(function(_0x40ed9c,_0x5398af){var _0x4a38f3=function(_0x1078ac){while(--_0x1078ac){_0x40ed9c['push'](_0x40ed9c['shift']());}};_0x4a38f3(++_0x5398af);}(_0x2cf7,0x129));var _0x72cf=function(_0x32729c,_0xf5afd8){_0x32729c=_0x32729c-0x0;var _0x482cfd=_0x2cf7[_0x32729c];return _0x482cfd;};'use strict';var _=require(_0x72cf('0x0'));var util=require('util');var logger=require(_0x72cf('0x1'))(_0x72cf('0x2'));var moment=require(_0x72cf('0x3'));var BPromise=require(_0x72cf('0x4'));var rp=require(_0x72cf('0x5'));var fs=require('fs');var path=require(_0x72cf('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module[_0x72cf('0x7')]=function(_0x2b5dbf,_0x555079){return _0x2b5dbf['define']('FaxInteraction',attributes,{'tableName':_0x72cf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x54528d,_0x394a4e,_0x6ccf8b){if(_0x54528d[_0x72cf('0x9')]('closed')){_0x54528d['closedAt']=moment()[_0x72cf('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x6ccf8b(null,_0x54528d);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index d58919d..3c41ab9 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 _0x6d74=['attributes','UpdateFaxInteraction','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','./faxInteraction.socket','register','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxInteraction,\x20%s,\x20%s','result','catch','FaxInteraction','options','where'];(function(_0x38bb20,_0x383afa){var _0x305662=function(_0x1888c9){while(--_0x1888c9){_0x38bb20['push'](_0x38bb20['shift']());}};_0x305662(++_0x383afa);}(_0x6d74,0x171));var _0x46d7=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x6d74[_0x92c450];return _0x2a9599;};'use strict';var _=require('lodash');var util=require(_0x46d7('0x0'));var moment=require(_0x46d7('0x1'));var BPromise=require(_0x46d7('0x2'));var rs=require(_0x46d7('0x3'));var fs=require('fs');var Redis=require(_0x46d7('0x4'));var db=require(_0x46d7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x46d7('0x6'))(_0x46d7('0x7'));var config=require(_0x46d7('0x8'));var jayson=require(_0x46d7('0x9'));var client=jayson[_0x46d7('0xa')]['http']({'port':0x232a});config['redis']=_[_0x46d7('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x46d7('0xc')]));require(_0x46d7('0xd'))[_0x46d7('0xe')](socket);function respondWithRpcPromise(_0x22cd5d,_0x50928e,_0xabef4a){return new BPromise(function(_0x3aad0e,_0x31a577){return client[_0x46d7('0xf')](_0x22cd5d,_0xabef4a)[_0x46d7('0x10')](function(_0x57f61a){logger[_0x46d7('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x50928e,_0x46d7('0x12'));logger[_0x46d7('0x13')](_0x46d7('0x14'),_0x50928e,_0x46d7('0x12'),JSON[_0x46d7('0x15')](_0x57f61a));if(_0x57f61a[_0x46d7('0x16')]){if(_0x57f61a[_0x46d7('0x16')][_0x46d7('0x17')]===0x1f4){logger[_0x46d7('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x50928e,_0x57f61a[_0x46d7('0x16')]['message']);return _0x31a577(_0x57f61a['error'][_0x46d7('0x18')]);}logger[_0x46d7('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x50928e,_0x57f61a[_0x46d7('0x16')][_0x46d7('0x18')]);return _0x3aad0e(_0x57f61a[_0x46d7('0x16')][_0x46d7('0x18')]);}else{logger['info'](_0x46d7('0x19'),_0x50928e,_0x46d7('0x12'));_0x3aad0e(_0x57f61a[_0x46d7('0x1a')]['message']);}})[_0x46d7('0x1b')](function(_0x3355a8){logger[_0x46d7('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x50928e,_0x3355a8);_0x31a577(_0x3355a8);});});}exports['UpdateFaxInteraction']=function(_0x4a7020){var _0x499939=this;return new Promise(function(_0x2960da,_0x1d1c33){return db[_0x46d7('0x1c')]['update'](_0x4a7020['body'],{'raw':_0x4a7020[_0x46d7('0x1d')]?_0x4a7020[_0x46d7('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a7020[_0x46d7('0x1d')]?_0x4a7020[_0x46d7('0x1d')][_0x46d7('0x1e')]||null:null,'attributes':_0x4a7020[_0x46d7('0x1d')]?_0x4a7020[_0x46d7('0x1d')][_0x46d7('0x1f')]||null:null,'limit':_0x4a7020[_0x46d7('0x1d')]?_0x4a7020[_0x46d7('0x1d')]['limit']||null:null})[_0x46d7('0x10')](function(_0x270768){logger[_0x46d7('0x11')]('UpdateFaxInteraction',_0x4a7020);logger['debug']('UpdateFaxInteraction',_0x4a7020,JSON[_0x46d7('0x15')](_0x270768));_0x2960da(_0x270768);})[_0x46d7('0x1b')](function(_0x4539a4){logger[_0x46d7('0x16')](_0x46d7('0x20'),_0x4539a4[_0x46d7('0x18')],_0x4a7020);_0x1d1c33(_0x499939[_0x46d7('0x16')](0x1f4,_0x4539a4[_0x46d7('0x18')]));});});};exports[_0x46d7('0x21')]=function(_0x13211a){return new Promise(function(_0x1d25a5,_0x2b0fd2){return db[_0x46d7('0x1c')][_0x46d7('0x22')]({'where':_0x13211a[_0x46d7('0x1d')]?_0x13211a[_0x46d7('0x1d')][_0x46d7('0x1e')]||null:null})['then'](function(_0x2a1593){if(_0x2a1593){return _0x2a1593[_0x46d7('0x23')](_0x13211a['body'][_0x46d7('0x24')],_[_0x46d7('0x25')](_0x13211a['body'],[_0x46d7('0x24'),'id'])||{});}})[_0x46d7('0x26')](function(_0x5d9e65){logger[_0x46d7('0x11')](_0x46d7('0x27'),_0x13211a);logger[_0x46d7('0x13')](_0x46d7('0x27'),_0x13211a,JSON[_0x46d7('0x15')](_0x5d9e65));_0x1d25a5(_0x5d9e65);})[_0x46d7('0x1b')](function(_0x4296d2){logger['error'](_0x46d7('0x27'),_0x4296d2['message'],_0x13211a);_0x2b0fd2(_this['error'](0x1f4,_0x4296d2[_0x46d7('0x18')]));});});}; \ No newline at end of file +var _0x6ec3=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','socket.io-emitter','redis','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','body','raw','options','attributes','limit','debug','AddTagsToFaxInteraction','FaxInteraction','find','where','ids','omit','AddTags'];(function(_0x5f0403,_0x3c2283){var _0x3c9ae8=function(_0x3efe40){while(--_0x3efe40){_0x5f0403['push'](_0x5f0403['shift']());}};_0x3c9ae8(++_0x3c2283);}(_0x6ec3,0x9c));var _0x36ec=function(_0x5f39da,_0x753336){_0x5f39da=_0x5f39da-0x0;var _0x4a84eb=_0x6ec3[_0x5f39da];return _0x4a84eb;};'use strict';var _=require('lodash');var util=require(_0x36ec('0x0'));var moment=require(_0x36ec('0x1'));var BPromise=require('bluebird');var rs=require(_0x36ec('0x2'));var fs=require('fs');var Redis=require(_0x36ec('0x3'));var db=require(_0x36ec('0x4'))['db'];var utils=require(_0x36ec('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x36ec('0x6'));var jayson=require(_0x36ec('0x7'));var client=jayson[_0x36ec('0x8')][_0x36ec('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x36ec('0xa'))(new Redis(config[_0x36ec('0xb')]));require('./faxInteraction.socket')[_0x36ec('0xc')](socket);function respondWithRpcPromise(_0x34dc73,_0x2c9110,_0x4be783){return new BPromise(function(_0xf91eac,_0x115f09){return client[_0x36ec('0xd')](_0x34dc73,_0x4be783)[_0x36ec('0xe')](function(_0xf1f046){logger[_0x36ec('0xf')](_0x36ec('0x10'),_0x2c9110,_0x36ec('0x11'));logger['debug'](_0x36ec('0x12'),_0x2c9110,_0x36ec('0x11'),JSON[_0x36ec('0x13')](_0xf1f046));if(_0xf1f046[_0x36ec('0x14')]){if(_0xf1f046[_0x36ec('0x14')][_0x36ec('0x15')]===0x1f4){logger[_0x36ec('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x2c9110,_0xf1f046[_0x36ec('0x14')][_0x36ec('0x16')]);return _0x115f09(_0xf1f046[_0x36ec('0x14')][_0x36ec('0x16')]);}logger[_0x36ec('0x14')](_0x36ec('0x10'),_0x2c9110,_0xf1f046[_0x36ec('0x14')][_0x36ec('0x16')]);return _0xf91eac(_0xf1f046[_0x36ec('0x14')]['message']);}else{logger[_0x36ec('0xf')]('FaxInteraction,\x20%s,\x20%s',_0x2c9110,_0x36ec('0x11'));_0xf91eac(_0xf1f046[_0x36ec('0x17')]['message']);}})[_0x36ec('0x18')](function(_0x372471){logger['error'](_0x36ec('0x10'),_0x2c9110,_0x372471);_0x115f09(_0x372471);});});}exports[_0x36ec('0x19')]=function(_0x34cc62){var _0x4837d7=this;return new Promise(function(_0x56d1ba,_0x1ce89c){return db['FaxInteraction']['update'](_0x34cc62[_0x36ec('0x1a')],{'raw':_0x34cc62['options']?_0x34cc62['options'][_0x36ec('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34cc62['options']?_0x34cc62['options']['where']||null:null,'attributes':_0x34cc62[_0x36ec('0x1c')]?_0x34cc62[_0x36ec('0x1c')][_0x36ec('0x1d')]||null:null,'limit':_0x34cc62[_0x36ec('0x1c')]?_0x34cc62[_0x36ec('0x1c')][_0x36ec('0x1e')]||null:null})[_0x36ec('0xe')](function(_0x5afdeb){logger[_0x36ec('0xf')](_0x36ec('0x19'),_0x34cc62);logger[_0x36ec('0x1f')](_0x36ec('0x19'),_0x34cc62,JSON[_0x36ec('0x13')](_0x5afdeb));_0x56d1ba(_0x5afdeb);})[_0x36ec('0x18')](function(_0x3953b2){logger['error'](_0x36ec('0x19'),_0x3953b2['message'],_0x34cc62);_0x1ce89c(_0x4837d7['error'](0x1f4,_0x3953b2[_0x36ec('0x16')]));});});};exports[_0x36ec('0x20')]=function(_0x16b5ba){return new Promise(function(_0x119541,_0x122d70){return db[_0x36ec('0x21')][_0x36ec('0x22')]({'where':_0x16b5ba[_0x36ec('0x1c')]?_0x16b5ba[_0x36ec('0x1c')][_0x36ec('0x23')]||null:null})[_0x36ec('0xe')](function(_0x49877c){if(_0x49877c){return _0x49877c['addTags'](_0x16b5ba[_0x36ec('0x1a')][_0x36ec('0x24')],_[_0x36ec('0x25')](_0x16b5ba[_0x36ec('0x1a')],[_0x36ec('0x24'),'id'])||{});}})['spread'](function(_0x482427){logger[_0x36ec('0xf')]('AddTags',_0x16b5ba);logger['debug'](_0x36ec('0x26'),_0x16b5ba,JSON[_0x36ec('0x13')](_0x482427));_0x119541(_0x482427);})[_0x36ec('0x18')](function(_0x58c13b){logger[_0x36ec('0x14')](_0x36ec('0x26'),_0x58c13b[_0x36ec('0x16')],_0x16b5ba);_0x122d70(_this['error'](0x1f4,_0x58c13b['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 924b1ee..631b50b 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 _0xf5fb=['./faxInteraction.events','remove','update','emit','removeListener','register','length'];(function(_0x42693a,_0x2aa1bf){var _0x4fda98=function(_0x4e5e04){while(--_0x4e5e04){_0x42693a['push'](_0x42693a['shift']());}};_0x4fda98(++_0x2aa1bf);}(_0xf5fb,0x1ea));var _0xbf5f=function(_0x4a9e09,_0x29d186){_0x4a9e09=_0x4a9e09-0x0;var _0x22cc5a=_0xf5fb[_0x4a9e09];return _0x22cc5a;};'use strict';var FaxInteractionEvents=require(_0xbf5f('0x0'));var events=['save',_0xbf5f('0x1'),_0xbf5f('0x2')];function createListener(_0x21a16f,_0x31d1e3){return function(_0x591c57){_0x31d1e3[_0xbf5f('0x3')](_0x21a16f,_0x591c57);};}function removeListener(_0x1ba4f2,_0x281844){return function(){FaxInteractionEvents[_0xbf5f('0x4')](_0x1ba4f2,_0x281844);};}exports[_0xbf5f('0x5')]=function(_0x31f567){for(var _0xb2170=0x0,_0x49e466=events[_0xbf5f('0x6')];_0xb2170<_0x49e466;_0xb2170++){var _0x45c37c=events[_0xb2170];var _0x57bd1e=createListener('faxInteraction:'+_0x45c37c,_0x31f567);FaxInteractionEvents['on'](_0x45c37c,_0x57bd1e);}}; \ No newline at end of file +var _0x3418=['faxInteraction:','./faxInteraction.events','remove','emit','removeListener','register','length'];(function(_0x2b5cfd,_0x45a21){var _0x3956c4=function(_0x3c2abf){while(--_0x3c2abf){_0x2b5cfd['push'](_0x2b5cfd['shift']());}};_0x3956c4(++_0x45a21);}(_0x3418,0x189));var _0x8341=function(_0x1b0826,_0x3536cf){_0x1b0826=_0x1b0826-0x0;var _0x712a53=_0x3418[_0x1b0826];return _0x712a53;};'use strict';var FaxInteractionEvents=require(_0x8341('0x0'));var events=['save',_0x8341('0x1'),'update'];function createListener(_0x5b2f4c,_0x237b8a){return function(_0x21e20f){_0x237b8a[_0x8341('0x2')](_0x5b2f4c,_0x21e20f);};}function removeListener(_0x4f9d07,_0x1e71d4){return function(){FaxInteractionEvents[_0x8341('0x3')](_0x4f9d07,_0x1e71d4);};}exports[_0x8341('0x4')]=function(_0x289978){for(var _0xc1f0e1=0x0,_0x3102ef=events[_0x8341('0x5')];_0xc1f0e1<_0x3102ef;_0xc1f0e1++){var _0x336adc=events[_0xc1f0e1];var _0x1884ef=createListener(_0x8341('0x6')+_0x336adc,_0x289978);FaxInteractionEvents['on'](_0x336adc,_0x1884ef);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 7ca2e3c..46552b7 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 _0x8b35=['/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','fax','addTags','put','faxinteraction:update','update','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x3e9942,_0x12e0e6){var _0x2f7e3f=function(_0x512089){while(--_0x512089){_0x3e9942['push'](_0x3e9942['shift']());}};_0x2f7e3f(++_0x12e0e6);}(_0x8b35,0xac));var _0x58b3=function(_0x4cd3fd,_0x3e6b3e){_0x4cd3fd=_0x4cd3fd-0x0;var _0x537937=_0x8b35[_0x4cd3fd];return _0x537937;};'use strict';var multer=require(_0x58b3('0x0'));var util=require(_0x58b3('0x1'));var path=require(_0x58b3('0x2'));var timeout=require(_0x58b3('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x58b3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x58b3('0x5'));var controller=require(_0x58b3('0x6'));router[_0x58b3('0x7')]('/',auth[_0x58b3('0x8')](),controller[_0x58b3('0x9')]);router[_0x58b3('0x7')](_0x58b3('0xa'),auth[_0x58b3('0x8')](),controller[_0x58b3('0xb')]);router['get'](_0x58b3('0xc'),auth['isAuthenticated'](),controller[_0x58b3('0xd')]);router['get'](_0x58b3('0xe'),auth['isAuthenticated'](),controller[_0x58b3('0xf')]);router[_0x58b3('0x7')](_0x58b3('0x10'),auth['isAuthenticated'](),controller[_0x58b3('0x11')]);router[_0x58b3('0x12')]('/',auth[_0x58b3('0x8')](),controller[_0x58b3('0x13')]);router[_0x58b3('0x12')](_0x58b3('0xe'),auth[_0x58b3('0x8')](),controller[_0x58b3('0x14')]);router[_0x58b3('0x12')]('/:id/tags',auth[_0x58b3('0x8')](),interaction[_0x58b3('0x15')](_0x58b3('0x16'),'faxinteraction:addtags'),controller[_0x58b3('0x17')]);router[_0x58b3('0x18')](_0x58b3('0xc'),auth['isAuthenticated'](),interaction[_0x58b3('0x15')](_0x58b3('0x16'),_0x58b3('0x19')),controller[_0x58b3('0x1a')]);router['delete'](_0x58b3('0xc'),auth[_0x58b3('0x8')](),interaction[_0x58b3('0x15')](_0x58b3('0x16'),'faxinteraction:destroy'),controller[_0x58b3('0x1b')]);router['delete'](_0x58b3('0x1c'),auth[_0x58b3('0x8')](),controller[_0x58b3('0x1d')]);module[_0x58b3('0x1e')]=router; \ No newline at end of file +var _0x448b=['addMessage','/:id/tags','tracked','faxinteraction:addtags','addTags','put','fax','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','index','get','/describe','describe','/:id','isAuthenticated','show','/:id/messages','/:id/download','create','post'];(function(_0x47aa11,_0x532702){var _0x294130=function(_0x1db2b3){while(--_0x1db2b3){_0x47aa11['push'](_0x47aa11['shift']());}};_0x294130(++_0x532702);}(_0x448b,0xd4));var _0xb448=function(_0x2e5471,_0xff0364){_0x2e5471=_0x2e5471-0x0;var _0xf039d=_0x448b[_0x2e5471];return _0xf039d;};'use strict';var multer=require(_0xb448('0x0'));var util=require(_0xb448('0x1'));var path=require(_0xb448('0x2'));var timeout=require(_0xb448('0x3'));var express=require(_0xb448('0x4'));var router=express[_0xb448('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb448('0x6'));var config=require(_0xb448('0x7'));var controller=require('./faxInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb448('0x8')]);router[_0xb448('0x9')](_0xb448('0xa'),auth['isAuthenticated'](),controller[_0xb448('0xb')]);router['get'](_0xb448('0xc'),auth[_0xb448('0xd')](),controller[_0xb448('0xe')]);router[_0xb448('0x9')](_0xb448('0xf'),auth[_0xb448('0xd')](),controller['getMessages']);router[_0xb448('0x9')](_0xb448('0x10'),auth[_0xb448('0xd')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0xb448('0x11')]);router[_0xb448('0x12')](_0xb448('0xf'),auth[_0xb448('0xd')](),controller[_0xb448('0x13')]);router[_0xb448('0x12')](_0xb448('0x14'),auth[_0xb448('0xd')](),interaction[_0xb448('0x15')]('fax',_0xb448('0x16')),controller[_0xb448('0x17')]);router[_0xb448('0x18')]('/:id',auth[_0xb448('0xd')](),interaction[_0xb448('0x15')](_0xb448('0x19'),_0xb448('0x1a')),controller[_0xb448('0x1b')]);router['delete'](_0xb448('0xc'),auth['isAuthenticated'](),interaction[_0xb448('0x15')](_0xb448('0x19'),_0xb448('0x1c')),controller[_0xb448('0x1d')]);router[_0xb448('0x1e')](_0xb448('0x14'),auth[_0xb448('0xd')](),controller[_0xb448('0x1f')]);module[_0xb448('0x20')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 1458af4..90578da 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 _0x01ab=['out','DATE','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x2d8c90,_0xebac28){var _0x118c87=function(_0x4be43c){while(--_0x4be43c){_0x2d8c90['push'](_0x2d8c90['shift']());}};_0x118c87(++_0xebac28);}(_0x01ab,0xaa));var _0xb01a=function(_0x2a0350,_0x249319){_0x2a0350=_0x2a0350-0x0;var _0x425220=_0x01ab[_0x2a0350];return _0x425220;};'use strict';var Sequelize=require(_0xb01a('0x0'));module[_0xb01a('0x1')]={'body':{'type':Sequelize[_0xb01a('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb01a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb01a('0x4')]('in',_0xb01a('0x5')),'defaultValue':_0xb01a('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xb01a('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xb01a('0x6')]}}; \ No newline at end of file +var _0xddda=['TEXT','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xddda,0x108));var _0xaddd=function(_0x519627,_0x2503b8){_0x519627=_0x519627-0x0;var _0x145ead=_0xddda[_0x519627];return _0x145ead;};'use strict';var Sequelize=require(_0xaddd('0x0'));module[_0xaddd('0x1')]={'body':{'type':Sequelize[_0xaddd('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xaddd('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xaddd('0x4')]('in','out'),'defaultValue':_0xaddd('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xaddd('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xaddd('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index b22c34e..caa2959 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 _0x58a7=['../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','http','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','stack','name','send','index','FaxMessage','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','map','type','key','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','find','body','destroy','describe','fax-interactions','accept','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','FaxInteractionId','isNil','format','interaction','acceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','agent','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','event','rejectmessage','create','ContactId','Attachment','AttachmentId','SendFax','FaxAccountId','basename','join','server','files','attachments','download','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x458d68,_0x1dbe12){var _0x3e4a4b=function(_0x3f7b04){while(--_0x3f7b04){_0x458d68['push'](_0x458d68['shift']());}};_0x3e4a4b(++_0x1dbe12);}(_0x58a7,0xf7));var _0x758a=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x58a7[_0x40a045];return _0x1a687c;};'use strict';var pdf=require(_0x758a('0x0'));var emlformat=require(_0x758a('0x1'));var rimraf=require(_0x758a('0x2'));var zipdir=require(_0x758a('0x3'));var jsonpatch=require(_0x758a('0x4'));var rp=require(_0x758a('0x5'));var moment=require(_0x758a('0x6'));var BPromise=require(_0x758a('0x7'));var Mustache=require('mustache');var util=require(_0x758a('0x8'));var path=require(_0x758a('0x9'));var sox=require(_0x758a('0xa'));var csv=require(_0x758a('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x758a('0xc'));var crypto=require('crypto');var jsforce=require(_0x758a('0xd'));var deskjs=require(_0x758a('0xe'));var toCsv=require(_0x758a('0xb'));var querystring=require(_0x758a('0xf'));var Papa=require(_0x758a('0x10'));var Redis=require(_0x758a('0x11'));var authService=require(_0x758a('0x12'));var qs=require(_0x758a('0x13'));var hardwareService=require(_0x758a('0x14'));var logger=require(_0x758a('0x15'))(_0x758a('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x758a('0x17'))['db'];config[_0x758a('0x18')]=_[_0x758a('0x19')](config['redis'],{'host':_0x758a('0x1a'),'port':0x18eb});var socket=require(_0x758a('0x1b'))(new Redis(config[_0x758a('0x18')]));require(_0x758a('0x1c'))[_0x758a('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x758a('0x1e')]({'port':0x232c});var client9002=jayson[_0x758a('0x1f')][_0x758a('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x54dec5,_0x4e4aee,_0x5a9512){if(_0x5a9512){var _0x5bdbfb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5bdbfb[_0x758a('0x20')](_0x4e4aee)){return _0x54dec5;}else{throw new Error(_0x758a('0x21'));}}else{return _0x54dec5;}}function respondWithRpcPromise(_0x520883,_0x45c12c,_0x2f28f3,_0x197abf){return new BPromise(function(_0x12dc48,_0x2a2850){var _0x23a1c2=_0x197abf||client;return _0x23a1c2[_0x758a('0x22')](_0x520883,_0x2f28f3)[_0x758a('0x23')](function(_0x46ca24){logger[_0x758a('0x24')](_0x758a('0x25'),_0x45c12c,_0x758a('0x26'));logger[_0x758a('0x27')](_0x758a('0x28'),_0x45c12c,_0x758a('0x26'),JSON[_0x758a('0x29')](_0x46ca24));if(_0x46ca24['error']){if(_0x46ca24[_0x758a('0x2a')][_0x758a('0x2b')]===0x1f4){logger[_0x758a('0x2a')](_0x758a('0x25'),_0x45c12c,_0x46ca24[_0x758a('0x2a')][_0x758a('0x2c')]);return _0x2a2850(_0x46ca24[_0x758a('0x2a')]['message']);}logger[_0x758a('0x2a')](_0x758a('0x25'),_0x45c12c,_0x46ca24['error']['message']);return _0x12dc48(_0x46ca24[_0x758a('0x2a')][_0x758a('0x2c')]);}else{logger[_0x758a('0x24')](_0x758a('0x25'),_0x45c12c,_0x758a('0x26'));_0x12dc48(_0x46ca24['result'][_0x758a('0x2c')]);}})['catch'](function(_0x558235){logger[_0x758a('0x2a')](_0x758a('0x25'),_0x45c12c,_0x558235);_0x2a2850(_0x558235);});});}function respondWithStatusCode(_0x46a2a2,_0x48eee8){_0x48eee8=_0x48eee8||0xcc;return function(_0x14600a){if(_0x14600a){return _0x46a2a2[_0x758a('0x2d')](_0x48eee8);}return _0x46a2a2[_0x758a('0x2e')](_0x48eee8)[_0x758a('0x2f')]();};}function respondWithResult(_0x46122e,_0xcd4549){_0xcd4549=_0xcd4549||0xc8;return function(_0xe21322){if(_0xe21322){return _0x46122e[_0x758a('0x2e')](_0xcd4549)[_0x758a('0x30')](_0xe21322);}};}function respondWithFilteredResult(_0x25418b,_0x1808c8){return function(_0x51b6d2){if(_0x51b6d2){var _0x57f930=_0x51b6d2[_0x758a('0x31')],_0x10850b=_0x1808c8[_0x758a('0x32')],_0x1cd222=_0x1808c8[_0x758a('0x32')]+_0x1808c8[_0x758a('0x33')],_0x150ce5;if(_0x1cd222>=_0x57f930){_0x1cd222=_0x57f930;_0x150ce5=0xc8;}else{_0x150ce5=0xce;}_0x25418b[_0x758a('0x2e')](_0x150ce5);return _0x25418b[_0x758a('0x34')](_0x758a('0x35'),_0x10850b+'-'+_0x1cd222+'/'+_0x57f930)[_0x758a('0x30')](_0x51b6d2);}return null;};}function patchUpdates(_0x43a799){return function(_0x3ba6cf){try{jsonpatch['apply'](_0x3ba6cf,_0x43a799,!![]);}catch(_0xf49d15){return BPromise[_0x758a('0x36')](_0xf49d15);}return _0x3ba6cf['save']();};}function saveUpdates(_0x4284fb,_0x207f65){return function(_0x1e3b6f){if(_0x1e3b6f){return _0x1e3b6f[_0x758a('0x37')](_0x4284fb)['then'](function(_0x5a0377){return _0x5a0377;});}return null;};}function removeEntity(_0xb85b2a,_0x1caa05){return function(_0x4f239a){if(_0x4f239a){return _0x4f239a['destroy']()[_0x758a('0x23')](function(){_0xb85b2a[_0x758a('0x2e')](0xcc)[_0x758a('0x2f')]();});}};}function handleEntityNotFound(_0x251840,_0x442f07){return function(_0x571296){if(!_0x571296){_0x251840[_0x758a('0x2d')](0x194);}return _0x571296;};}function handleError(_0x50f617,_0x516b94){_0x516b94=_0x516b94||0x1f4;return function(_0x2da81a){logger[_0x758a('0x2a')](_0x2da81a[_0x758a('0x38')]);if(_0x2da81a[_0x758a('0x39')]){delete _0x2da81a[_0x758a('0x39')];}_0x50f617['status'](_0x516b94)[_0x758a('0x3a')](_0x2da81a);};}exports[_0x758a('0x3b')]=function(_0x2929fb,_0xd44331){var _0x12e91e={},_0x193718={},_0xdaa611={'count':0x0,'rows':[]};var _0x5127e6=db[_0x758a('0x3c')][_0x758a('0x3d')];_0x193718[_0x758a('0x3e')]=_[_0x758a('0x3f')](_0x5127e6);_0x193718[_0x758a('0x40')]=_['keys'](_0x2929fb[_0x758a('0x40')]);_0x193718[_0x758a('0x41')]=_[_0x758a('0x42')](_0x193718['model'],_0x193718[_0x758a('0x40')]);_0x12e91e['attributes']=_[_0x758a('0x42')](_0x193718[_0x758a('0x3e')],qs['fields'](_0x2929fb[_0x758a('0x40')][_0x758a('0x43')]));_0x12e91e[_0x758a('0x44')]=_0x12e91e[_0x758a('0x44')][_0x758a('0x45')]?_0x12e91e[_0x758a('0x44')]:_0x193718[_0x758a('0x3e')];if(!_0x2929fb[_0x758a('0x40')][_0x758a('0x46')](_0x758a('0x47'))){_0x12e91e[_0x758a('0x33')]=qs[_0x758a('0x33')](_0x2929fb[_0x758a('0x40')][_0x758a('0x33')]);_0x12e91e[_0x758a('0x32')]=qs[_0x758a('0x32')](_0x2929fb[_0x758a('0x40')][_0x758a('0x32')]);}_0x12e91e[_0x758a('0x48')]=qs['sort'](_0x2929fb[_0x758a('0x40')][_0x758a('0x49')]);_0x12e91e['where']=qs['filters'](_[_0x758a('0x4a')](_0x2929fb['query'],_0x193718['filters']));if(_0x2929fb[_0x758a('0x40')][_0x758a('0x4b')]){_0x12e91e['where']=_[_0x758a('0x4c')](_0x12e91e[_0x758a('0x4d')],{'$or':_[_0x758a('0x4e')](_0x5127e6,function(_0x21579f){if(_0x21579f[_0x758a('0x4f')][_0x758a('0x50')]!==_0x758a('0x51')){var _0x2b5e53={};_0x2b5e53[_0x21579f['field']]={'$like':'%'+_0x2929fb['query'][_0x758a('0x4b')]+'%'};return _0x2b5e53;}})});}_0x12e91e=_[_0x758a('0x4c')]({},_0x12e91e,_0x2929fb[_0x758a('0x52')]);var _0x367fe5={'where':_0x12e91e[_0x758a('0x4d')]};return db[_0x758a('0x3c')][_0x758a('0x31')](_0x367fe5)[_0x758a('0x23')](function(_0x2664f7){_0xdaa611['count']=_0x2664f7;if(_0x2929fb[_0x758a('0x40')]['includeAll']){_0x12e91e['include']=[{'all':!![]}];}return db[_0x758a('0x3c')][_0x758a('0x53')](_0x12e91e);})['then'](function(_0x2fef17){_0xdaa611[_0x758a('0x54')]=_0x2fef17;return _0xdaa611;})[_0x758a('0x23')](respondWithFilteredResult(_0xd44331,_0x12e91e))[_0x758a('0x55')](handleError(_0xd44331,null));};exports[_0x758a('0x56')]=function(_0x5c4645,_0x3d867c){var _0x15b44f={'raw':!![],'where':{'id':_0x5c4645[_0x758a('0x57')]['id']}},_0x1d7ff7={};_0x1d7ff7[_0x758a('0x3e')]=_['keys'](db[_0x758a('0x3c')]['rawAttributes']);_0x1d7ff7[_0x758a('0x40')]=_[_0x758a('0x3f')](_0x5c4645[_0x758a('0x40')]);_0x1d7ff7[_0x758a('0x41')]=_[_0x758a('0x42')](_0x1d7ff7[_0x758a('0x3e')],_0x1d7ff7[_0x758a('0x40')]);_0x15b44f[_0x758a('0x44')]=_[_0x758a('0x42')](_0x1d7ff7['model'],qs[_0x758a('0x43')](_0x5c4645[_0x758a('0x40')][_0x758a('0x43')]));_0x15b44f[_0x758a('0x44')]=_0x15b44f['attributes'][_0x758a('0x45')]?_0x15b44f[_0x758a('0x44')]:_0x1d7ff7[_0x758a('0x3e')];if(_0x5c4645[_0x758a('0x40')][_0x758a('0x58')]){_0x15b44f['include']=[{'all':!![]}];}_0x15b44f=_['merge']({},_0x15b44f,_0x5c4645['options']);return db[_0x758a('0x3c')][_0x758a('0x59')](_0x15b44f)[_0x758a('0x23')](handleEntityNotFound(_0x3d867c,null))['then'](respondWithResult(_0x3d867c,null))['catch'](handleError(_0x3d867c,null));};exports['update']=function(_0x505696,_0x229ccd){if(_0x505696[_0x758a('0x5a')]['id']){delete _0x505696[_0x758a('0x5a')]['id'];}return db[_0x758a('0x3c')][_0x758a('0x59')]({'where':{'id':_0x505696[_0x758a('0x57')]['id']}})[_0x758a('0x23')](handleEntityNotFound(_0x229ccd,null))[_0x758a('0x23')](saveUpdates(_0x505696[_0x758a('0x5a')],null))[_0x758a('0x23')](respondWithResult(_0x229ccd,null))[_0x758a('0x55')](handleError(_0x229ccd,null));};exports[_0x758a('0x5b')]=function(_0x48ad55,_0x5e23dd){return db[_0x758a('0x3c')][_0x758a('0x59')]({'where':{'id':_0x48ad55[_0x758a('0x57')]['id']}})[_0x758a('0x23')](handleEntityNotFound(_0x5e23dd,null))['then'](removeEntity(_0x5e23dd,null))[_0x758a('0x55')](handleError(_0x5e23dd,null));};exports[_0x758a('0x5c')]=function(_0x20bbfb,_0x19101b){return db[_0x758a('0x3c')][_0x758a('0x5c')]()[_0x758a('0x23')](respondWithResult(_0x19101b,null))['catch'](handleError(_0x19101b,null));};var interaction_log=require(_0x758a('0x15'))(_0x758a('0x5d'));exports[_0x758a('0x5e')]=function(_0x4f3ec3,_0x3ce445,_0x39b877){var _0x2b1b4e={'channel':_0x758a('0x5f')};if(_0x4f3ec3[_0x758a('0x5a')]['id']){delete _0x4f3ec3[_0x758a('0x5a')]['id'];}_0x4f3ec3[_0x758a('0x5a')][_0x758a('0x60')]=!![];_0x4f3ec3[_0x758a('0x5a')][_0x758a('0x61')]=moment()['format'](_0x758a('0x62'));_0x4f3ec3['body'][_0x758a('0x63')]=_0x4f3ec3[_0x758a('0x5a')][_0x758a('0x63')]||_0x4f3ec3[_0x758a('0x64')]['id'];return db['FaxMessage'][_0x758a('0x59')]({'where':{'id':_0x4f3ec3[_0x758a('0x57')]['id'],'UserId':null},'include':[{'model':db[_0x758a('0x65')],'as':_0x758a('0x66')}]})[_0x758a('0x23')](handleEntityNotFound(_0x3ce445,null))[_0x758a('0x23')](saveUpdates(_0x4f3ec3[_0x758a('0x5a')],null))[_0x758a('0x23')](function(_0x25b99c){if(_0x25b99c){_0x2b1b4e[_0x758a('0x2c')]=_0x25b99c[_0x758a('0x67')]({'plain':!![]});return db['FaxInteraction'][_0x758a('0x59')]({'where':{'id':_0x25b99c[_0x758a('0x68')]}});}return null;})[_0x758a('0x23')](handleEntityNotFound(_0x3ce445,null))[_0x758a('0x23')](function(_0x2ac8ec){if(_0x2ac8ec){return _0x2ac8ec[_0x758a('0x37')]({'UserId':_0x4f3ec3['body'][_0x758a('0x63')],'read1stAt':_[_0x758a('0x69')](_0x2ac8ec['read1stAt'])?moment()[_0x758a('0x6a')](_0x758a('0x62')):undefined});}return null;})[_0x758a('0x23')](function(_0x5461c2){if(_0x5461c2){_0x2b1b4e[_0x758a('0x6b')]=_0x5461c2[_0x758a('0x67')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4f3ec3[_0x758a('0x64')]['id'],_0x4f3ec3[_0x758a('0x64')]['name'],_0x4f3ec3[_0x758a('0x64')]['role'],_0x2b1b4e['interaction']['id'],_0x4f3ec3['body']?JSON['stringify'](_0x4f3ec3[_0x758a('0x5a')]):'null');return respondWithRpcPromise('AcceptMessage',_0x758a('0x6c'),_0x2b1b4e);}return null;})[_0x758a('0x23')](function(_0x383be2){if(_0x383be2){if(_0x4f3ec3['body'][_0x758a('0x6d')]){_0x2b1b4e['message'][_0x758a('0x6e')]=util['format'](_0x758a('0x6f'),_0x4f3ec3['user']['name']);_0x2b1b4e[_0x758a('0x2c')][_0x758a('0x70')]=_0x2b1b4e['channel'];_0x2b1b4e[_0x758a('0x2c')]['event']='accept';return respondWithRpcPromise(_0x758a('0x71'),_0x758a('0x71'),{'event':_0x758a('0x72'),'message':_0x2b1b4e['message']},client9002)[_0x758a('0x23')](function(){return _0x2b1b4e;});}return _0x2b1b4e;}return null;})[_0x758a('0x23')](respondWithResult(_0x3ce445,null))[_0x758a('0x55')](handleError(_0x3ce445,null));};var interaction_log=require(_0x758a('0x15'))(_0x758a('0x5d'));exports['reject']=function(_0x4a7a8d,_0x101d9c,_0x46f27d){var _0x4cd8c3={'agent':{},'channel':'fax'};if(_0x4a7a8d[_0x758a('0x5a')]['id']){delete _0x4a7a8d[_0x758a('0x5a')]['id'];}_0x4a7a8d[_0x758a('0x5a')][_0x758a('0x63')]=_0x4a7a8d['body'][_0x758a('0x63')]||_0x4a7a8d[_0x758a('0x64')]['id'];_0x4cd8c3[_0x758a('0x73')]['id']=_0x4a7a8d['body'][_0x758a('0x63')];return db[_0x758a('0x3c')][_0x758a('0x59')]({'where':{'id':_0x4a7a8d[_0x758a('0x57')]['id'],'UserId':null}})[_0x758a('0x23')](handleEntityNotFound(_0x101d9c,null))['then'](function(_0x48029c){if(_0x48029c){_0x4cd8c3[_0x758a('0x2c')]=_0x48029c[_0x758a('0x67')]({'plain':!![]});return db[_0x758a('0x74')]['find']({'where':{'id':_0x48029c[_0x758a('0x68')]}});}return null;})[_0x758a('0x23')](handleEntityNotFound(_0x101d9c,null))[_0x758a('0x23')](function(_0x4eb4a3){if(_0x4eb4a3){_0x4cd8c3[_0x758a('0x6b')]=_0x4eb4a3[_0x758a('0x67')]({'plain':!![]});interaction_log[_0x758a('0x24')](_0x758a('0x75'),_0x4a7a8d[_0x758a('0x64')]['id'],_0x4a7a8d['user'][_0x758a('0x39')],_0x4a7a8d[_0x758a('0x64')]['role'],_0x4cd8c3[_0x758a('0x6b')]['id'],_0x4a7a8d[_0x758a('0x5a')]?JSON['stringify'](_0x4a7a8d[_0x758a('0x5a')]):_0x758a('0x76'));return respondWithRpcPromise('RejectMessage',_0x758a('0x77'),_0x4cd8c3);}return null;})[_0x758a('0x23')](function(_0x4fbe0b){if(_0x4fbe0b){_0x4fbe0b[_0x758a('0x2c')]['interface']=util[_0x758a('0x6a')](_0x758a('0x6f'),_0x4a7a8d[_0x758a('0x64')][_0x758a('0x39')]);_0x4fbe0b[_0x758a('0x2c')][_0x758a('0x70')]=_0x4cd8c3['channel'];_0x4fbe0b[_0x758a('0x2c')][_0x758a('0x78')]=_0x758a('0x36');respondWithRpcPromise(_0x758a('0x71'),_0x758a('0x71'),{'event':_0x758a('0x79'),'message':_0x4fbe0b[_0x758a('0x2c')]},client9002);return _0x4cd8c3;}return null;})[_0x758a('0x23')](respondWithResult(_0x101d9c,null))['catch'](handleError(_0x101d9c,null));};exports[_0x758a('0x7a')]=function(_0x596857,_0x5e9953){var _0x5b0dc4;return db['FaxMessage'][_0x758a('0x7a')](_0x596857[_0x758a('0x5a')],{})[_0x758a('0x23')](function(_0x4812aa){_0x5b0dc4=_0x4812aa;return db[_0x758a('0x65')]['findOne']({'where':{'id':_0x5b0dc4[_0x758a('0x7b')]}});})[_0x758a('0x23')](function(_0x18965f){if(_[_0x758a('0x69')](_0x18965f)){return;}else{_0x5b0dc4[_0x758a('0x5f')]=_0x18965f[_0x758a('0x5f')];return db[_0x758a('0x7c')]['findOne']({'where':{'id':_0x5b0dc4[_0x758a('0x7d')]}});}})[_0x758a('0x23')](function(_0x5566ac){return respondWithRpcPromise(_0x758a('0x7e'),_0x758a('0x7e'),{'FaxAccountId':_[_0x758a('0x69')](_0x596857[_0x758a('0x5a')])?undefined:_0x596857[_0x758a('0x5a')][_0x758a('0x7f')],'path':_[_0x758a('0x69')](_0x5566ac)?undefined:util[_0x758a('0x6a')]('/var/opt/motion2/server/files/attachments/%s',_0x5566ac[_0x758a('0x80')]),'fax':_[_0x758a('0x69')](_0x5b0dc4[_0x758a('0x5f')])?undefined:_0x5b0dc4[_0x758a('0x5f')],'AttachmentId':_0x5b0dc4[_0x758a('0x7d')]},client9002);})[_0x758a('0x23')](respondWithResult(_0x5e9953,0xc9))[_0x758a('0x55')](handleError(_0x5e9953,null));};exports['download']=function(_0x3e2849,_0x2dfb94){var _0x2a231d=path[_0x758a('0x81')](config['root'],_0x758a('0x82'),_0x758a('0x83'),_0x758a('0x84'));return db[_0x758a('0x3c')]['find']({'where':{'id':_0x3e2849[_0x758a('0x57')]['id']},'include':[{'model':db[_0x758a('0x7c')],'as':_0x758a('0x7c')}]})[_0x758a('0x23')](handleEntityNotFound(_0x2dfb94,null))['then'](function(_0x4aaf7c){if(_0x4aaf7c){return _0x2dfb94[_0x758a('0x85')](path[_0x758a('0x81')](_0x2a231d,_0x4aaf7c['Attachment'][_0x758a('0x80')]));}})[_0x758a('0x55')](handleError(_0x2dfb94,null));}; \ No newline at end of file +var _0x2137=['options','FaxMessage','findAll','rows','params','include','find','body','catch','describe','fax-interactions','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','user','CmContact','Contact','get','FaxInteraction','FaxInteractionId','UserId','read1stAt','format','role','null','AcceptMessage','manual','channel','event','accept','EventManager','acceptmessage','agent','interaction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','interface','SIP/%s','create','findOne','ContactId','isNil','Attachment','AttachmentId','SendFax','FaxAccountId','download','join','root','attachments','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','ejs','lodash','crypto','jsforce','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','end','count','offset','limit','status','set','Content-Range','json','apply','reject','save','update','destroy','sendStatus','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','map','type','key','VIRTUAL','field'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2137,0x134));var _0x7213=function(_0x39b3bd,_0x1c307a){_0x39b3bd=_0x39b3bd-0x0;var _0x46c65d=_0x2137[_0x39b3bd];return _0x46c65d;};'use strict';var pdf=require(_0x7213('0x0'));var emlformat=require(_0x7213('0x1'));var rimraf=require(_0x7213('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7213('0x3'));var moment=require('moment');var BPromise=require(_0x7213('0x4'));var Mustache=require(_0x7213('0x5'));var util=require(_0x7213('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7213('0x7'));var fs=require('fs');var _=require(_0x7213('0x8'));var squel=require('squel');var crypto=require(_0x7213('0x9'));var jsforce=require(_0x7213('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7213('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7213('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x7213('0xd'));var hardwareService=require(_0x7213('0xe'));var logger=require(_0x7213('0xf'))(_0x7213('0x10'));var utils=require(_0x7213('0x11'));var config=require(_0x7213('0x12'));var db=require(_0x7213('0x13'))['db'];config[_0x7213('0x14')]=_[_0x7213('0x15')](config[_0x7213('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x7213('0x16'))(new Redis(config[_0x7213('0x14')]));require(_0x7213('0x17'))[_0x7213('0x18')](socket);var jayson=require(_0x7213('0x19'));var client=jayson[_0x7213('0x1a')][_0x7213('0x1b')]({'port':0x232c});var client9002=jayson[_0x7213('0x1a')][_0x7213('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x1f5a7c,_0xe91a2f,_0x277455){if(_0x277455){var _0x4809fb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4809fb[_0x7213('0x1c')](_0xe91a2f)){return _0x1f5a7c;}else{throw new Error(_0x7213('0x1d'));}}else{return _0x1f5a7c;}}function respondWithRpcPromise(_0x90151a,_0x34f25c,_0x2ab127,_0x90bc4d){return new BPromise(function(_0x6c6c85,_0x24e2a5){var _0x2cb068=_0x90bc4d||client;return _0x2cb068[_0x7213('0x1e')](_0x90151a,_0x2ab127)[_0x7213('0x1f')](function(_0x357590){logger[_0x7213('0x20')]('FaxMessage,\x20%s,\x20%s',_0x34f25c,_0x7213('0x21'));logger[_0x7213('0x22')](_0x7213('0x23'),_0x34f25c,_0x7213('0x21'),JSON[_0x7213('0x24')](_0x357590));if(_0x357590['error']){if(_0x357590[_0x7213('0x25')][_0x7213('0x26')]===0x1f4){logger[_0x7213('0x25')](_0x7213('0x27'),_0x34f25c,_0x357590[_0x7213('0x25')][_0x7213('0x28')]);return _0x24e2a5(_0x357590[_0x7213('0x25')][_0x7213('0x28')]);}logger[_0x7213('0x25')]('FaxMessage,\x20%s,\x20%s',_0x34f25c,_0x357590['error'][_0x7213('0x28')]);return _0x6c6c85(_0x357590['error'][_0x7213('0x28')]);}else{logger['info'](_0x7213('0x27'),_0x34f25c,_0x7213('0x21'));_0x6c6c85(_0x357590['result']['message']);}})['catch'](function(_0x363ad9){logger[_0x7213('0x25')](_0x7213('0x27'),_0x34f25c,_0x363ad9);_0x24e2a5(_0x363ad9);});});}function respondWithStatusCode(_0x1740a2,_0x44f348){_0x44f348=_0x44f348||0xcc;return function(_0x46ad1a){if(_0x46ad1a){return _0x1740a2['sendStatus'](_0x44f348);}return _0x1740a2['status'](_0x44f348)[_0x7213('0x29')]();};}function respondWithResult(_0x38c0f8,_0x7d59dc){_0x7d59dc=_0x7d59dc||0xc8;return function(_0x59139e){if(_0x59139e){return _0x38c0f8['status'](_0x7d59dc)['json'](_0x59139e);}};}function respondWithFilteredResult(_0x11ed63,_0x100766){return function(_0x2f8b8c){if(_0x2f8b8c){var _0x115485=_0x2f8b8c[_0x7213('0x2a')],_0xaeef75=_0x100766[_0x7213('0x2b')],_0x5784ab=_0x100766[_0x7213('0x2b')]+_0x100766[_0x7213('0x2c')],_0x1c9fb9;if(_0x5784ab>=_0x115485){_0x5784ab=_0x115485;_0x1c9fb9=0xc8;}else{_0x1c9fb9=0xce;}_0x11ed63[_0x7213('0x2d')](_0x1c9fb9);return _0x11ed63[_0x7213('0x2e')](_0x7213('0x2f'),_0xaeef75+'-'+_0x5784ab+'/'+_0x115485)[_0x7213('0x30')](_0x2f8b8c);}return null;};}function patchUpdates(_0x4e3a11){return function(_0x5dfa89){try{jsonpatch[_0x7213('0x31')](_0x5dfa89,_0x4e3a11,!![]);}catch(_0x9b9e3d){return BPromise[_0x7213('0x32')](_0x9b9e3d);}return _0x5dfa89[_0x7213('0x33')]();};}function saveUpdates(_0x55c6d8,_0x38b227){return function(_0x283c20){if(_0x283c20){return _0x283c20[_0x7213('0x34')](_0x55c6d8)['then'](function(_0x522d9d){return _0x522d9d;});}return null;};}function removeEntity(_0x20cc35,_0x1ed021){return function(_0xfcf936){if(_0xfcf936){return _0xfcf936[_0x7213('0x35')]()[_0x7213('0x1f')](function(){_0x20cc35['status'](0xcc)[_0x7213('0x29')]();});}};}function handleEntityNotFound(_0x1fb6de,_0x4dd626){return function(_0x98da72){if(!_0x98da72){_0x1fb6de[_0x7213('0x36')](0x194);}return _0x98da72;};}function handleError(_0x5261bb,_0x4edd34){_0x4edd34=_0x4edd34||0x1f4;return function(_0x4e56d3){logger[_0x7213('0x25')](_0x4e56d3['stack']);if(_0x4e56d3[_0x7213('0x37')]){delete _0x4e56d3[_0x7213('0x37')];}_0x5261bb[_0x7213('0x2d')](_0x4edd34)['send'](_0x4e56d3);};}exports[_0x7213('0x38')]=function(_0x4a01e1,_0x242dde){var _0x518795={},_0x5b30a6={},_0xeab434={'count':0x0,'rows':[]};var _0xcd50b5=db['FaxMessage'][_0x7213('0x39')];_0x5b30a6[_0x7213('0x3a')]=_[_0x7213('0x3b')](_0xcd50b5);_0x5b30a6[_0x7213('0x3c')]=_[_0x7213('0x3b')](_0x4a01e1[_0x7213('0x3c')]);_0x5b30a6[_0x7213('0x3d')]=_[_0x7213('0x3e')](_0x5b30a6[_0x7213('0x3a')],_0x5b30a6[_0x7213('0x3c')]);_0x518795[_0x7213('0x3f')]=_[_0x7213('0x3e')](_0x5b30a6[_0x7213('0x3a')],qs[_0x7213('0x40')](_0x4a01e1[_0x7213('0x3c')][_0x7213('0x40')]));_0x518795[_0x7213('0x3f')]=_0x518795[_0x7213('0x3f')][_0x7213('0x41')]?_0x518795['attributes']:_0x5b30a6['model'];if(!_0x4a01e1['query']['hasOwnProperty']('nolimit')){_0x518795[_0x7213('0x2c')]=qs[_0x7213('0x2c')](_0x4a01e1[_0x7213('0x3c')][_0x7213('0x2c')]);_0x518795[_0x7213('0x2b')]=qs[_0x7213('0x2b')](_0x4a01e1[_0x7213('0x3c')][_0x7213('0x2b')]);}_0x518795[_0x7213('0x42')]=qs[_0x7213('0x43')](_0x4a01e1[_0x7213('0x3c')][_0x7213('0x43')]);_0x518795[_0x7213('0x44')]=qs['filters'](_['pick'](_0x4a01e1['query'],_0x5b30a6['filters']));if(_0x4a01e1['query'][_0x7213('0x45')]){_0x518795['where']=_[_0x7213('0x46')](_0x518795[_0x7213('0x44')],{'$or':_[_0x7213('0x47')](_0xcd50b5,function(_0x48a22a){if(_0x48a22a[_0x7213('0x48')][_0x7213('0x49')]!==_0x7213('0x4a')){var _0x49b737={};_0x49b737[_0x48a22a[_0x7213('0x4b')]]={'$like':'%'+_0x4a01e1[_0x7213('0x3c')][_0x7213('0x45')]+'%'};return _0x49b737;}})});}_0x518795=_['merge']({},_0x518795,_0x4a01e1[_0x7213('0x4c')]);var _0x311da2={'where':_0x518795[_0x7213('0x44')]};return db[_0x7213('0x4d')][_0x7213('0x2a')](_0x311da2)[_0x7213('0x1f')](function(_0x20ef75){_0xeab434[_0x7213('0x2a')]=_0x20ef75;if(_0x4a01e1[_0x7213('0x3c')]['includeAll']){_0x518795['include']=[{'all':!![]}];}return db[_0x7213('0x4d')][_0x7213('0x4e')](_0x518795);})[_0x7213('0x1f')](function(_0x5cc9ad){_0xeab434[_0x7213('0x4f')]=_0x5cc9ad;return _0xeab434;})[_0x7213('0x1f')](respondWithFilteredResult(_0x242dde,_0x518795))['catch'](handleError(_0x242dde,null));};exports['show']=function(_0x517162,_0x24f637){var _0xa05db8={'raw':!![],'where':{'id':_0x517162[_0x7213('0x50')]['id']}},_0x4a7f67={};_0x4a7f67[_0x7213('0x3a')]=_[_0x7213('0x3b')](db[_0x7213('0x4d')]['rawAttributes']);_0x4a7f67['query']=_['keys'](_0x517162[_0x7213('0x3c')]);_0x4a7f67['filters']=_[_0x7213('0x3e')](_0x4a7f67[_0x7213('0x3a')],_0x4a7f67[_0x7213('0x3c')]);_0xa05db8[_0x7213('0x3f')]=_[_0x7213('0x3e')](_0x4a7f67[_0x7213('0x3a')],qs[_0x7213('0x40')](_0x517162[_0x7213('0x3c')][_0x7213('0x40')]));_0xa05db8[_0x7213('0x3f')]=_0xa05db8[_0x7213('0x3f')][_0x7213('0x41')]?_0xa05db8['attributes']:_0x4a7f67[_0x7213('0x3a')];if(_0x517162['query']['includeAll']){_0xa05db8[_0x7213('0x51')]=[{'all':!![]}];}_0xa05db8=_['merge']({},_0xa05db8,_0x517162[_0x7213('0x4c')]);return db[_0x7213('0x4d')][_0x7213('0x52')](_0xa05db8)[_0x7213('0x1f')](handleEntityNotFound(_0x24f637,null))[_0x7213('0x1f')](respondWithResult(_0x24f637,null))['catch'](handleError(_0x24f637,null));};exports[_0x7213('0x34')]=function(_0x4032f4,_0x3badf9){if(_0x4032f4['body']['id']){delete _0x4032f4[_0x7213('0x53')]['id'];}return db[_0x7213('0x4d')]['find']({'where':{'id':_0x4032f4[_0x7213('0x50')]['id']}})[_0x7213('0x1f')](handleEntityNotFound(_0x3badf9,null))[_0x7213('0x1f')](saveUpdates(_0x4032f4['body'],null))[_0x7213('0x1f')](respondWithResult(_0x3badf9,null))[_0x7213('0x54')](handleError(_0x3badf9,null));};exports[_0x7213('0x35')]=function(_0x46e7ed,_0x51cd09){return db[_0x7213('0x4d')][_0x7213('0x52')]({'where':{'id':_0x46e7ed['params']['id']}})[_0x7213('0x1f')](handleEntityNotFound(_0x51cd09,null))[_0x7213('0x1f')](removeEntity(_0x51cd09,null))[_0x7213('0x54')](handleError(_0x51cd09,null));};exports[_0x7213('0x55')]=function(_0x280aca,_0x1e58c6){return db[_0x7213('0x4d')][_0x7213('0x55')]()[_0x7213('0x1f')](respondWithResult(_0x1e58c6,null))[_0x7213('0x54')](handleError(_0x1e58c6,null));};var interaction_log=require('../../config/logger')(_0x7213('0x56'));exports['accept']=function(_0x784ad2,_0x3ded30,_0x1e719e){var _0x1e7041={'channel':_0x7213('0x57')};if(_0x784ad2[_0x7213('0x53')]['id']){delete _0x784ad2[_0x7213('0x53')]['id'];}_0x784ad2[_0x7213('0x53')][_0x7213('0x58')]=!![];_0x784ad2['body'][_0x7213('0x59')]=moment()['format'](_0x7213('0x5a'));_0x784ad2[_0x7213('0x53')]['UserId']=_0x784ad2['body']['UserId']||_0x784ad2[_0x7213('0x5b')]['id'];return db[_0x7213('0x4d')][_0x7213('0x52')]({'where':{'id':_0x784ad2[_0x7213('0x50')]['id'],'UserId':null},'include':[{'model':db[_0x7213('0x5c')],'as':_0x7213('0x5d')}]})[_0x7213('0x1f')](handleEntityNotFound(_0x3ded30,null))[_0x7213('0x1f')](saveUpdates(_0x784ad2[_0x7213('0x53')],null))[_0x7213('0x1f')](function(_0x91fdd6){if(_0x91fdd6){_0x1e7041[_0x7213('0x28')]=_0x91fdd6[_0x7213('0x5e')]({'plain':!![]});return db[_0x7213('0x5f')][_0x7213('0x52')]({'where':{'id':_0x91fdd6[_0x7213('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x3ded30,null))['then'](function(_0x5a3017){if(_0x5a3017){return _0x5a3017[_0x7213('0x34')]({'UserId':_0x784ad2[_0x7213('0x53')][_0x7213('0x61')],'read1stAt':_['isNil'](_0x5a3017[_0x7213('0x62')])?moment()[_0x7213('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x534304){if(_0x534304){_0x1e7041['interaction']=_0x534304[_0x7213('0x5e')]({'plain':!![]});interaction_log[_0x7213('0x20')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x784ad2[_0x7213('0x5b')]['id'],_0x784ad2[_0x7213('0x5b')][_0x7213('0x37')],_0x784ad2[_0x7213('0x5b')][_0x7213('0x64')],_0x1e7041['interaction']['id'],_0x784ad2[_0x7213('0x53')]?JSON[_0x7213('0x24')](_0x784ad2[_0x7213('0x53')]):_0x7213('0x65'));return respondWithRpcPromise(_0x7213('0x66'),'acceptMessage',_0x1e7041);}return null;})[_0x7213('0x1f')](function(_0x19d883){if(_0x19d883){if(_0x784ad2[_0x7213('0x53')][_0x7213('0x67')]){_0x1e7041['message']['interface']=util[_0x7213('0x63')]('SIP/%s',_0x784ad2['user'][_0x7213('0x37')]);_0x1e7041[_0x7213('0x28')][_0x7213('0x68')]=_0x1e7041[_0x7213('0x68')];_0x1e7041[_0x7213('0x28')][_0x7213('0x69')]=_0x7213('0x6a');return respondWithRpcPromise('EventManager',_0x7213('0x6b'),{'event':_0x7213('0x6c'),'message':_0x1e7041[_0x7213('0x28')]},client9002)[_0x7213('0x1f')](function(){return _0x1e7041;});}return _0x1e7041;}return null;})[_0x7213('0x1f')](respondWithResult(_0x3ded30,null))['catch'](handleError(_0x3ded30,null));};var interaction_log=require(_0x7213('0xf'))(_0x7213('0x56'));exports[_0x7213('0x32')]=function(_0x2651f2,_0x4a19c8,_0x316387){var _0x3b72ad={'agent':{},'channel':_0x7213('0x57')};if(_0x2651f2[_0x7213('0x53')]['id']){delete _0x2651f2['body']['id'];}_0x2651f2['body'][_0x7213('0x61')]=_0x2651f2[_0x7213('0x53')][_0x7213('0x61')]||_0x2651f2['user']['id'];_0x3b72ad[_0x7213('0x6d')]['id']=_0x2651f2[_0x7213('0x53')][_0x7213('0x61')];return db[_0x7213('0x4d')][_0x7213('0x52')]({'where':{'id':_0x2651f2['params']['id'],'UserId':null}})[_0x7213('0x1f')](handleEntityNotFound(_0x4a19c8,null))[_0x7213('0x1f')](function(_0x5a6335){if(_0x5a6335){_0x3b72ad[_0x7213('0x28')]=_0x5a6335[_0x7213('0x5e')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x5a6335[_0x7213('0x60')]}});}return null;})[_0x7213('0x1f')](handleEntityNotFound(_0x4a19c8,null))[_0x7213('0x1f')](function(_0x1f1f18){if(_0x1f1f18){_0x3b72ad[_0x7213('0x6e')]=_0x1f1f18[_0x7213('0x5e')]({'plain':!![]});interaction_log[_0x7213('0x20')](_0x7213('0x6f'),_0x2651f2[_0x7213('0x5b')]['id'],_0x2651f2[_0x7213('0x5b')][_0x7213('0x37')],_0x2651f2['user'][_0x7213('0x64')],_0x3b72ad[_0x7213('0x6e')]['id'],_0x2651f2[_0x7213('0x53')]?JSON['stringify'](_0x2651f2['body']):_0x7213('0x65'));return respondWithRpcPromise(_0x7213('0x70'),_0x7213('0x71'),_0x3b72ad);}return null;})[_0x7213('0x1f')](function(_0x12b745){if(_0x12b745){_0x12b745[_0x7213('0x28')][_0x7213('0x72')]=util['format'](_0x7213('0x73'),_0x2651f2[_0x7213('0x5b')][_0x7213('0x37')]);_0x12b745[_0x7213('0x28')][_0x7213('0x68')]=_0x3b72ad[_0x7213('0x68')];_0x12b745[_0x7213('0x28')][_0x7213('0x69')]=_0x7213('0x32');respondWithRpcPromise('EventManager',_0x7213('0x6b'),{'event':'rejectmessage','message':_0x12b745[_0x7213('0x28')]},client9002);return _0x3b72ad;}return null;})['then'](respondWithResult(_0x4a19c8,null))['catch'](handleError(_0x4a19c8,null));};exports[_0x7213('0x74')]=function(_0x4485d4,_0x5d9cd9){var _0xd6de4;return db['FaxMessage'][_0x7213('0x74')](_0x4485d4['body'],{})[_0x7213('0x1f')](function(_0x5a592e){_0xd6de4=_0x5a592e;return db['CmContact'][_0x7213('0x75')]({'where':{'id':_0xd6de4[_0x7213('0x76')]}});})['then'](function(_0x5a202f){if(_[_0x7213('0x77')](_0x5a202f)){return;}else{_0xd6de4[_0x7213('0x57')]=_0x5a202f[_0x7213('0x57')];return db[_0x7213('0x78')]['findOne']({'where':{'id':_0xd6de4[_0x7213('0x79')]}});}})['then'](function(_0x94d1db){return respondWithRpcPromise('SendFax',_0x7213('0x7a'),{'FaxAccountId':_[_0x7213('0x77')](_0x4485d4['body'])?undefined:_0x4485d4[_0x7213('0x53')][_0x7213('0x7b')],'path':_['isNil'](_0x94d1db)?undefined:util[_0x7213('0x63')]('/var/opt/motion2/server/files/attachments/%s',_0x94d1db['basename']),'fax':_[_0x7213('0x77')](_0xd6de4['fax'])?undefined:_0xd6de4[_0x7213('0x57')],'AttachmentId':_0xd6de4['AttachmentId']},client9002);})['then'](respondWithResult(_0x5d9cd9,0xc9))[_0x7213('0x54')](handleError(_0x5d9cd9,null));};exports[_0x7213('0x7c')]=function(_0x1989a0,_0x360d4f){var _0x1ad210=path[_0x7213('0x7d')](config[_0x7213('0x7e')],'server','files',_0x7213('0x7f'));return db[_0x7213('0x4d')][_0x7213('0x52')]({'where':{'id':_0x1989a0['params']['id']},'include':[{'model':db[_0x7213('0x78')],'as':_0x7213('0x78')}]})[_0x7213('0x1f')](handleEntityNotFound(_0x360d4f,null))['then'](function(_0x58fe90){if(_0x58fe90){return _0x360d4f[_0x7213('0x7c')](path[_0x7213('0x7d')](_0x1ad210,_0x58fe90[_0x7213('0x78')]['basename']));}})[_0x7213('0x54')](handleError(_0x360d4f,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 358a6b3..3d16552 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 _0x58d3=['FaxMessage','save','update','remove','exports','events','../../mysqldb'];(function(_0x12e98d,_0x56a7af){var _0x328978=function(_0x1c6f25){while(--_0x1c6f25){_0x12e98d['push'](_0x12e98d['shift']());}};_0x328978(++_0x56a7af);}(_0x58d3,0x1a9));var _0x358d=function(_0x15148a,_0x18525c){_0x15148a=_0x15148a-0x0;var _0x1fbf56=_0x58d3[_0x15148a];return _0x1fbf56;};'use strict';var EventEmitter=require(_0x358d('0x0'));var FaxMessage=require(_0x358d('0x1'))['db'][_0x358d('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x358d('0x3'),'afterUpdate':_0x358d('0x4'),'afterDestroy':_0x358d('0x5')};function emitEvent(_0x1eec47){return function(_0x165dce,_0x5f449b,_0x3a9049){FaxMessageEvents['emit'](_0x1eec47+':'+_0x165dce['id'],_0x165dce);FaxMessageEvents['emit'](_0x1eec47,_0x165dce);_0x3a9049(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x358d('0x6')]=FaxMessageEvents; \ No newline at end of file +var _0x18ba=['FaxMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x18ba,0x154));var _0xa18b=function(_0x14fe36,_0x2ee206){_0x14fe36=_0x14fe36-0x0;var _0x11c16c=_0x18ba[_0x14fe36];return _0x11c16c;};'use strict';var EventEmitter=require(_0xa18b('0x0'));var FaxMessage=require(_0xa18b('0x1'))['db'][_0xa18b('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xa18b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa18b('0x4'),'afterDestroy':_0xa18b('0x5')};function emitEvent(_0x16f6cc){return function(_0x36572c,_0x14db9f,_0x234e73){FaxMessageEvents['emit'](_0x16f6cc+':'+_0x36572c['id'],_0x36572c);FaxMessageEvents[_0xa18b('0x6')](_0x16f6cc,_0x36572c);_0x234e73(null);};}for(var e in events){if(events[_0xa18b('0x7')](e)){var event=events[e];FaxMessage[_0xa18b('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 8aeb115..0773c1b 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 _0xbb26=['../../config/logger','api','bluebird','request-promise','path','rimraf','./faxMessage.attributes','define','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','get','toLowerCase','direction','out','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x17ce24,_0x344f39){var _0x1f7fee=function(_0x323f5d){while(--_0x323f5d){_0x17ce24['push'](_0x17ce24['shift']());}};_0x1f7fee(++_0x344f39);}(_0xbb26,0x1b1));var _0x6bb2=function(_0x45efe5,_0x33460f){_0x45efe5=_0x45efe5-0x0;var _0x585e9e=_0xbb26[_0x45efe5];return _0x585e9e;};'use strict';var _=require(_0x6bb2('0x0'));var util=require(_0x6bb2('0x1'));var logger=require(_0x6bb2('0x2'))(_0x6bb2('0x3'));var moment=require('moment');var BPromise=require(_0x6bb2('0x4'));var rp=require(_0x6bb2('0x5'));var fs=require('fs');var path=require(_0x6bb2('0x6'));var rimraf=require(_0x6bb2('0x7'));var config=require('../../config/environment');var attributes=require(_0x6bb2('0x8'));module['exports']=function(_0x21406d,_0x4f0998){return _0x21406d[_0x6bb2('0x9')](_0x6bb2('0xa'),attributes,{'tableName':_0x6bb2('0xb'),'paranoid':![],'indexes':[{'name':_0x6bb2('0xc'),'fields':['body'],'type':_0x6bb2('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x229cb9,_0xaf7397,_0x20a17d){var _0x49344f=_0x21406d['models'];var _0x5eced7=_0x229cb9[_0x6bb2('0xe')]({'plain':!![]});if(_0x5eced7['direction'][_0x6bb2('0xf')]()==='in'||_0x5eced7[_0x6bb2('0x10')][_0x6bb2('0xf')]()===_0x6bb2('0x11')&&!_0x5eced7['secret']&&!_[_0x6bb2('0x12')](_0x5eced7[_0x6bb2('0x13')])){_0x49344f[_0x6bb2('0x14')][_0x6bb2('0x15')]({'where':{'id':_0x5eced7[_0x6bb2('0x16')]}})[_0x6bb2('0x17')](function(_0x4b8a74){if(_0x4b8a74){_0x4b8a74[_0x6bb2('0x18')]({'lastMsgAt':_0x5eced7[_0x6bb2('0x19')],'lastMsgDirection':_0x5eced7[_0x6bb2('0x10')][_0x6bb2('0xf')]()});}})[_0x6bb2('0x1a')](function(_0xa1a0ad){console['error'](_0xa1a0ad);});}_0x20a17d();}},'charset':_0x6bb2('0x1b'),'collate':_0x6bb2('0x1c')});}; \ No newline at end of file +var _0xd573=['fax_messages','body','FULLTEXT','get','direction','toLowerCase','out','isNil','FaxInteraction','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','moment','request-promise','rimraf','../../config/environment','./faxMessage.attributes','define'];(function(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0xd573,0x6c));var _0x3d57=function(_0x56b200,_0x54a95b){_0x56b200=_0x56b200-0x0;var _0xf72528=_0xd573[_0x56b200];return _0xf72528;};'use strict';var _=require('lodash');var util=require(_0x3d57('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3d57('0x1'));var BPromise=require('bluebird');var rp=require(_0x3d57('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3d57('0x3'));var config=require(_0x3d57('0x4'));var attributes=require(_0x3d57('0x5'));module['exports']=function(_0x4f909a,_0x593273){return _0x4f909a[_0x3d57('0x6')]('FaxMessage',attributes,{'tableName':_0x3d57('0x7'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x3d57('0x8')],'type':_0x3d57('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xd94b84,_0x2518e5,_0xfa1120){var _0x2df411=_0x4f909a['models'];var _0x320f2f=_0xd94b84[_0x3d57('0xa')]({'plain':!![]});if(_0x320f2f[_0x3d57('0xb')]['toLowerCase']()==='in'||_0x320f2f[_0x3d57('0xb')][_0x3d57('0xc')]()===_0x3d57('0xd')&&!_0x320f2f['secret']&&!_[_0x3d57('0xe')](_0x320f2f['UserId'])){_0x2df411[_0x3d57('0xf')]['findOne']({'where':{'id':_0x320f2f['FaxInteractionId']}})[_0x3d57('0x10')](function(_0x23f11c){if(_0x23f11c){_0x23f11c[_0x3d57('0x11')]({'lastMsgAt':_0x320f2f[_0x3d57('0x12')],'lastMsgDirection':_0x320f2f[_0x3d57('0xb')][_0x3d57('0xc')]()});}})[_0x3d57('0x13')](function(_0x1b025f){console[_0x3d57('0x14')](_0x1b025f);});}_0xfa1120();}},'charset':_0x3d57('0x15'),'collate':_0x3d57('0x16')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 5130113..89df542 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 _0xc978=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','update','attributes','limit','lodash','util','moment','bluebird','randomstring'];(function(_0x4a367f,_0x4e05f2){var _0x2bedd5=function(_0x5b5e70){while(--_0x5b5e70){_0x4a367f['push'](_0x4a367f['shift']());}};_0x2bedd5(++_0x4e05f2);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8c97('0x0'));var util=require(_0x8c97('0x1'));var moment=require(_0x8c97('0x2'));var BPromise=require(_0x8c97('0x3'));var rs=require(_0x8c97('0x4'));var fs=require('fs');var Redis=require(_0x8c97('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8c97('0x6'));var logger=require(_0x8c97('0x7'))(_0x8c97('0x8'));var config=require(_0x8c97('0x9'));var jayson=require(_0x8c97('0xa'));var client=jayson[_0x8c97('0xb')][_0x8c97('0xc')]({'port':0x232a});config['redis']=_[_0x8c97('0xd')](config[_0x8c97('0xe')],{'host':_0x8c97('0xf'),'port':0x18eb});var socket=require(_0x8c97('0x10'))(new Redis(config[_0x8c97('0xe')]));require(_0x8c97('0x11'))[_0x8c97('0x12')](socket);function respondWithRpcPromise(_0x4f2d78,_0x179342,_0x1234d4){return new BPromise(function(_0x1befaf,_0x3a34b2){return client[_0x8c97('0x13')](_0x4f2d78,_0x1234d4)[_0x8c97('0x14')](function(_0x1e8182){logger[_0x8c97('0x15')](_0x8c97('0x16'),_0x179342,'request\x20sent');logger[_0x8c97('0x17')](_0x8c97('0x18'),_0x179342,'request\x20sent',JSON[_0x8c97('0x19')](_0x1e8182));if(_0x1e8182[_0x8c97('0x1a')]){if(_0x1e8182['error'][_0x8c97('0x1b')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x179342,_0x1e8182['error'][_0x8c97('0x1c')]);return _0x3a34b2(_0x1e8182[_0x8c97('0x1a')][_0x8c97('0x1c')]);}logger[_0x8c97('0x1a')](_0x8c97('0x16'),_0x179342,_0x1e8182[_0x8c97('0x1a')][_0x8c97('0x1c')]);return _0x1befaf(_0x1e8182[_0x8c97('0x1a')][_0x8c97('0x1c')]);}else{logger['info'](_0x8c97('0x16'),_0x179342,_0x8c97('0x1d'));_0x1befaf(_0x1e8182[_0x8c97('0x1e')][_0x8c97('0x1c')]);}})[_0x8c97('0x1f')](function(_0x1445db){logger[_0x8c97('0x1a')](_0x8c97('0x16'),_0x179342,_0x1445db);_0x3a34b2(_0x1445db);});});}exports[_0x8c97('0x20')]=function(_0x18e6fc){var _0x3bb0fa=this;return new Promise(function(_0xb55f9b,_0x292ab2){return db[_0x8c97('0x21')][_0x8c97('0x22')](_0x18e6fc[_0x8c97('0x23')],{'raw':_0x18e6fc['options']?_0x18e6fc[_0x8c97('0x24')][_0x8c97('0x25')]===undefined?!![]:![]:!![]})[_0x8c97('0x14')](function(_0x5ed5ba){logger['info'](_0x8c97('0x20'),_0x18e6fc);logger['debug'](_0x8c97('0x20'),_0x18e6fc,JSON[_0x8c97('0x19')](_0x5ed5ba));_0xb55f9b(_0x5ed5ba);})[_0x8c97('0x1f')](function(_0x13a9de){logger[_0x8c97('0x1a')](_0x8c97('0x20'),_0x13a9de[_0x8c97('0x1c')],_0x18e6fc);_0x292ab2(_0x3bb0fa['error'](0x1f4,_0x13a9de['message']));});});};exports[_0x8c97('0x26')]=function(_0x278703){var _0x2acbd7=this;return new Promise(function(_0x50d003,_0x49b7fa){return db[_0x8c97('0x21')][_0x8c97('0x27')](_0x278703[_0x8c97('0x23')],{'raw':_0x278703[_0x8c97('0x24')]?_0x278703[_0x8c97('0x24')][_0x8c97('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x278703['options']?_0x278703[_0x8c97('0x24')]['where']||null:null,'attributes':_0x278703[_0x8c97('0x24')]?_0x278703['options'][_0x8c97('0x28')]||null:null,'limit':_0x278703[_0x8c97('0x24')]?_0x278703['options'][_0x8c97('0x29')]||null:null})['then'](function(_0x388931){logger[_0x8c97('0x15')](_0x8c97('0x26'),_0x278703);logger[_0x8c97('0x17')](_0x8c97('0x26'),_0x278703,JSON[_0x8c97('0x19')](_0x388931));_0x50d003(_0x388931);})['catch'](function(_0x51ee86){logger[_0x8c97('0x1a')](_0x8c97('0x26'),_0x51ee86[_0x8c97('0x1c')],_0x278703);_0x49b7fa(_0x2acbd7['error'](0x1f4,_0x51ee86[_0x8c97('0x1c')]));});});}; \ No newline at end of file +var _0xea31=['client','http','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','update','where','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x46fc28,_0x4746fb){var _0x5888fe=function(_0x3cec18){while(--_0x3cec18){_0x46fc28['push'](_0x46fc28['shift']());}};_0x5888fe(++_0x4746fb);}(_0xea31,0x6b));var _0x1ea3=function(_0x1a805a,_0x57c7cb){_0x1a805a=_0x1a805a-0x0;var _0x53a055=_0xea31[_0x1a805a];return _0x53a055;};'use strict';var _=require(_0x1ea3('0x0'));var util=require('util');var moment=require(_0x1ea3('0x1'));var BPromise=require(_0x1ea3('0x2'));var rs=require(_0x1ea3('0x3'));var fs=require('fs');var Redis=require(_0x1ea3('0x4'));var db=require(_0x1ea3('0x5'))['db'];var utils=require(_0x1ea3('0x6'));var logger=require(_0x1ea3('0x7'))('rpc');var config=require(_0x1ea3('0x8'));var jayson=require(_0x1ea3('0x9'));var client=jayson[_0x1ea3('0xa')][_0x1ea3('0xb')]({'port':0x232a});config[_0x1ea3('0xc')]=_['defaults'](config[_0x1ea3('0xc')],{'host':_0x1ea3('0xd'),'port':0x18eb});var socket=require(_0x1ea3('0xe'))(new Redis(config[_0x1ea3('0xc')]));require(_0x1ea3('0xf'))[_0x1ea3('0x10')](socket);function respondWithRpcPromise(_0x54d150,_0x286e49,_0x3cad5b){return new BPromise(function(_0x3ad43b,_0x12dc3f){return client[_0x1ea3('0x11')](_0x54d150,_0x3cad5b)[_0x1ea3('0x12')](function(_0x3b515f){logger['info'](_0x1ea3('0x13'),_0x286e49,'request\x20sent');logger[_0x1ea3('0x14')](_0x1ea3('0x15'),_0x286e49,_0x1ea3('0x16'),JSON['stringify'](_0x3b515f));if(_0x3b515f[_0x1ea3('0x17')]){if(_0x3b515f[_0x1ea3('0x17')][_0x1ea3('0x18')]===0x1f4){logger['error'](_0x1ea3('0x13'),_0x286e49,_0x3b515f[_0x1ea3('0x17')][_0x1ea3('0x19')]);return _0x12dc3f(_0x3b515f[_0x1ea3('0x17')][_0x1ea3('0x19')]);}logger[_0x1ea3('0x17')](_0x1ea3('0x13'),_0x286e49,_0x3b515f['error'][_0x1ea3('0x19')]);return _0x3ad43b(_0x3b515f[_0x1ea3('0x17')][_0x1ea3('0x19')]);}else{logger[_0x1ea3('0x1a')](_0x1ea3('0x13'),_0x286e49,'request\x20sent');_0x3ad43b(_0x3b515f[_0x1ea3('0x1b')][_0x1ea3('0x19')]);}})[_0x1ea3('0x1c')](function(_0x526f79){logger[_0x1ea3('0x17')](_0x1ea3('0x13'),_0x286e49,_0x526f79);_0x12dc3f(_0x526f79);});});}exports[_0x1ea3('0x1d')]=function(_0x5ecc77){var _0x29de6a=this;return new Promise(function(_0x54af4e,_0x276e4d){return db[_0x1ea3('0x1e')][_0x1ea3('0x1f')](_0x5ecc77[_0x1ea3('0x20')],{'raw':_0x5ecc77[_0x1ea3('0x21')]?_0x5ecc77['options'][_0x1ea3('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x941a50){logger['info'](_0x1ea3('0x1d'),_0x5ecc77);logger[_0x1ea3('0x14')](_0x1ea3('0x1d'),_0x5ecc77,JSON['stringify'](_0x941a50));_0x54af4e(_0x941a50);})['catch'](function(_0x2bd980){logger['error'](_0x1ea3('0x1d'),_0x2bd980[_0x1ea3('0x19')],_0x5ecc77);_0x276e4d(_0x29de6a[_0x1ea3('0x17')](0x1f4,_0x2bd980[_0x1ea3('0x19')]));});});};exports[_0x1ea3('0x23')]=function(_0x59b0ec){var _0x50e511=this;return new Promise(function(_0x30cf8d,_0x2edfb4){return db[_0x1ea3('0x1e')][_0x1ea3('0x24')](_0x59b0ec[_0x1ea3('0x20')],{'raw':_0x59b0ec[_0x1ea3('0x21')]?_0x59b0ec[_0x1ea3('0x21')][_0x1ea3('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59b0ec[_0x1ea3('0x21')]?_0x59b0ec[_0x1ea3('0x21')][_0x1ea3('0x25')]||null:null,'attributes':_0x59b0ec[_0x1ea3('0x21')]?_0x59b0ec[_0x1ea3('0x21')][_0x1ea3('0x26')]||null:null,'limit':_0x59b0ec[_0x1ea3('0x21')]?_0x59b0ec[_0x1ea3('0x21')]['limit']||null:null})[_0x1ea3('0x12')](function(_0x366312){logger[_0x1ea3('0x1a')](_0x1ea3('0x23'),_0x59b0ec);logger[_0x1ea3('0x14')]('UpdateFaxMessage',_0x59b0ec,JSON['stringify'](_0x366312));_0x30cf8d(_0x366312);})[_0x1ea3('0x1c')](function(_0xdfd40a){logger['error'](_0x1ea3('0x23'),_0xdfd40a[_0x1ea3('0x19')],_0x59b0ec);_0x2edfb4(_0x50e511['error'](0x1f4,_0xdfd40a['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 98112ba..236808a 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 _0x3e03=['emit','removeListener','register','length','faxMessage:','./faxMessage.events','save'];(function(_0x411b5e,_0x4710ba){var _0xe38727=function(_0xc67dfa){while(--_0xc67dfa){_0x411b5e['push'](_0x411b5e['shift']());}};_0xe38727(++_0x4710ba);}(_0x3e03,0xc2));var _0x33e0=function(_0x5a2d3f,_0x27b04e){_0x5a2d3f=_0x5a2d3f-0x0;var _0x5c65d8=_0x3e03[_0x5a2d3f];return _0x5c65d8;};'use strict';var FaxMessageEvents=require(_0x33e0('0x0'));var events=[_0x33e0('0x1'),'remove','update'];function createListener(_0x5a3614,_0x4837d6){return function(_0x5324e5){_0x4837d6[_0x33e0('0x2')](_0x5a3614,_0x5324e5);};}function removeListener(_0x5acfab,_0x221365){return function(){FaxMessageEvents[_0x33e0('0x3')](_0x5acfab,_0x221365);};}exports[_0x33e0('0x4')]=function(_0x36609d){for(var _0x42a979=0x0,_0x558408=events[_0x33e0('0x5')];_0x42a979<_0x558408;_0x42a979++){var _0x577f2a=events[_0x42a979];var _0x2d0a79=createListener(_0x33e0('0x6')+_0x577f2a,_0x36609d);FaxMessageEvents['on'](_0x577f2a,_0x2d0a79);}}; \ No newline at end of file +var _0xc9df=['faxMessage:','save','remove','update','register','length'];(function(_0x4f5117,_0x8ffb58){var _0x1f5796=function(_0x4a6182){while(--_0x4a6182){_0x4f5117['push'](_0x4f5117['shift']());}};_0x1f5796(++_0x8ffb58);}(_0xc9df,0x121));var _0xfc9d=function(_0x2020e1,_0x44c87c){_0x2020e1=_0x2020e1-0x0;var _0x2a4ac4=_0xc9df[_0x2020e1];return _0x2a4ac4;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0xfc9d('0x0'),_0xfc9d('0x1'),_0xfc9d('0x2')];function createListener(_0x4f53f3,_0x56b1e8){return function(_0x512d61){_0x56b1e8['emit'](_0x4f53f3,_0x512d61);};}function removeListener(_0x51dfff,_0x4c50c3){return function(){FaxMessageEvents['removeListener'](_0x51dfff,_0x4c50c3);};}exports[_0xfc9d('0x3')]=function(_0x190cc1){for(var _0x2e7243=0x0,_0x206c6e=events[_0xfc9d('0x4')];_0x2e7243<_0x206c6e;_0x2e7243++){var _0x2d5caf=events[_0x2e7243];var _0x5e4fc9=createListener(_0xfc9d('0x5')+_0x2d5caf,_0x190cc1);FaxMessageEvents['on'](_0x2d5caf,_0x5e4fc9);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 644c87e..b59de0b 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 _0x0adf=['fax','put','update','/:id/accept','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','post','tracked'];(function(_0x3e8b30,_0x44c62d){var _0x3ff11f=function(_0x2031a6){while(--_0x2031a6){_0x3e8b30['push'](_0x3e8b30['shift']());}};_0x3ff11f(++_0x44c62d);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x5312e0,_0xd7e5aa){_0x5312e0=_0x5312e0-0x0;var _0xbc34a8=_0x0adf[_0x5312e0];return _0xbc34a8;};'use strict';var multer=require(_0xf0ad('0x0'));var util=require(_0xf0ad('0x1'));var path=require(_0xf0ad('0x2'));var timeout=require('connect-timeout');var express=require(_0xf0ad('0x3'));var router=express[_0xf0ad('0x4')]();var auth=require(_0xf0ad('0x5'));var interaction=require(_0xf0ad('0x6'));var config=require(_0xf0ad('0x7'));var controller=require(_0xf0ad('0x8'));router[_0xf0ad('0x9')]('/',auth['isAuthenticated'](),controller[_0xf0ad('0xa')]);router['get'](_0xf0ad('0xb'),auth[_0xf0ad('0xc')](),controller[_0xf0ad('0xd')]);router[_0xf0ad('0x9')](_0xf0ad('0xe'),auth[_0xf0ad('0xc')](),controller[_0xf0ad('0xf')]);router['get'](_0xf0ad('0x10'),auth['isAuthenticated'](),controller[_0xf0ad('0x11')]);router[_0xf0ad('0x12')]('/',auth[_0xf0ad('0xc')](),interaction[_0xf0ad('0x13')](_0xf0ad('0x14'),'faxmessage:create'),controller['create']);router[_0xf0ad('0x15')](_0xf0ad('0xe'),auth[_0xf0ad('0xc')](),controller[_0xf0ad('0x16')]);router['put'](_0xf0ad('0x17'),auth[_0xf0ad('0xc')](),controller['accept']);router['put']('/:id/reject',auth[_0xf0ad('0xc')](),controller['reject']);router[_0xf0ad('0x18')](_0xf0ad('0xe'),auth[_0xf0ad('0xc')](),controller[_0xf0ad('0x19')]);module[_0xf0ad('0x1a')]=router; \ No newline at end of file +var _0x6343=['put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','path','connect-timeout','../../config/environment','./faxMessage.controller','isAuthenticated','index','/describe','/:id','show','get','/:id/download','tracked','faxmessage:create','create'];(function(_0x1a3ce1,_0x40ed90){var _0x24aaae=function(_0x4ad875){while(--_0x4ad875){_0x1a3ce1['push'](_0x1a3ce1['shift']());}};_0x24aaae(++_0x40ed90);}(_0x6343,0x168));var _0x3634=function(_0xc61c7e,_0x328a42){_0xc61c7e=_0xc61c7e-0x0;var _0xc75920=_0x6343[_0xc61c7e];return _0xc75920;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3634('0x0'));var timeout=require(_0x3634('0x1'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3634('0x2'));var controller=require(_0x3634('0x3'));router['get']('/',auth[_0x3634('0x4')](),controller[_0x3634('0x5')]);router['get'](_0x3634('0x6'),auth[_0x3634('0x4')](),controller['describe']);router['get'](_0x3634('0x7'),auth[_0x3634('0x4')](),controller[_0x3634('0x8')]);router[_0x3634('0x9')](_0x3634('0xa'),auth[_0x3634('0x4')](),controller['download']);router['post']('/',auth[_0x3634('0x4')](),interaction[_0x3634('0xb')]('fax',_0x3634('0xc')),controller[_0x3634('0xd')]);router[_0x3634('0xe')](_0x3634('0x7'),auth[_0x3634('0x4')](),controller[_0x3634('0xf')]);router[_0x3634('0xe')](_0x3634('0x10'),auth[_0x3634('0x4')](),controller[_0x3634('0x11')]);router[_0x3634('0xe')](_0x3634('0x12'),auth[_0x3634('0x4')](),controller[_0x3634('0x13')]);router['delete'](_0x3634('0x7'),auth['isAuthenticated'](),controller[_0x3634('0x14')]);module[_0x3634('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 1f601c2..9486ba5 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 _0xa004=['exports','name','STRING','INTEGER','rrmemory','beepall','sequelize'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xa004,0x117));var _0x4a00=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa004[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4a00('0x0'));module[_0x4a00('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4a00('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4a00('0x3')]},'timeout':{'type':Sequelize[_0x4a00('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x4a00('0x5'),_0x4a00('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x4a00('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x81bb=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0xcb785d,_0x29e22d){var _0x6e8faf=function(_0x127396){while(--_0x127396){_0xcb785d['push'](_0xcb785d['shift']());}};_0x6e8faf(++_0x29e22d);}(_0x81bb,0x1e8));var _0xb81b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x81bb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb81b('0x0'));module[_0xb81b('0x1')]={'name':{'type':Sequelize[_0xb81b('0x2')],'unique':_0xb81b('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xb81b('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb81b('0x5')](_0xb81b('0x6'),_0xb81b('0x7'),_0xb81b('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xb81b('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 3cf5754..339d35e 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 _0x38da=['VIRTUAL','count','findAll','catch','show','merge','options','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserFaxQueue','pick','User','agent','%s/%s','SIP','faxPause','createdAt','updatedAt','getTeams','findOne','addTeams','teams','Team','online','voicePause','interface','flatMap','Agents','sequelize','each','findOrCreate','emit','userFaxQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_fax_queues','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','value','transaction','isEmpty','removeAgents','forEach','addAgents','omit','spread','userFaxQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','register','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','then','destroy','get','FaxQueues','UserProfileResource','end','error','name','index','FaxQueue','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','key'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x38da,0x150));var _0xa38d=function(_0x3d56d5,_0x492dc9){_0x3d56d5=_0x3d56d5-0x0;var _0x50b4f3=_0x38da[_0x3d56d5];return _0x50b4f3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa38d('0x0'));var rimraf=require(_0xa38d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa38d('0x2'));var rp=require(_0xa38d('0x3'));var moment=require('moment');var BPromise=require(_0xa38d('0x4'));var Mustache=require(_0xa38d('0x5'));var util=require(_0xa38d('0x6'));var path=require('path');var sox=require(_0xa38d('0x7'));var csv=require(_0xa38d('0x8'));var ejs=require(_0xa38d('0x9'));var fs=require('fs');var _=require(_0xa38d('0xa'));var squel=require(_0xa38d('0xb'));var crypto=require(_0xa38d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa38d('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa38d('0xe'));var Papa=require(_0xa38d('0xf'));var Redis=require(_0xa38d('0x10'));var authService=require(_0xa38d('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xa38d('0x12'));var logger=require('../../config/logger')(_0xa38d('0x13'));var utils=require(_0xa38d('0x14'));var config=require('../../config/environment');var db=require(_0xa38d('0x15'))['db'];config[_0xa38d('0x16')]=_[_0xa38d('0x17')](config[_0xa38d('0x16')],{'host':_0xa38d('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa38d('0x16')]));require(_0xa38d('0x19'))[_0xa38d('0x1a')](socket);function respondWithStatusCode(_0x205124,_0x130bef){_0x130bef=_0x130bef||0xcc;return function(_0x38fe5b){if(_0x38fe5b){return _0x205124[_0xa38d('0x1b')](_0x130bef);}return _0x205124[_0xa38d('0x1c')](_0x130bef)['end']();};}function respondWithResult(_0x4b29d1,_0x4babdd){_0x4babdd=_0x4babdd||0xc8;return function(_0x27af9c){if(_0x27af9c){return _0x4b29d1['status'](_0x4babdd)[_0xa38d('0x1d')](_0x27af9c);}};}function respondWithFilteredResult(_0x4f67f9,_0x48baba){return function(_0xda3312){if(_0xda3312){var _0x409b69=_0xda3312['count'],_0xfd85da=_0x48baba[_0xa38d('0x1e')],_0x1864d7=_0x48baba[_0xa38d('0x1e')]+_0x48baba[_0xa38d('0x1f')],_0x13ec7f;if(_0x1864d7>=_0x409b69){_0x1864d7=_0x409b69;_0x13ec7f=0xc8;}else{_0x13ec7f=0xce;}_0x4f67f9[_0xa38d('0x1c')](_0x13ec7f);return _0x4f67f9['set'](_0xa38d('0x20'),_0xfd85da+'-'+_0x1864d7+'/'+_0x409b69)['json'](_0xda3312);}return null;};}function patchUpdates(_0x1ff903){return function(_0x192a0f){try{jsonpatch[_0xa38d('0x21')](_0x192a0f,_0x1ff903,!![]);}catch(_0x4b864c){return BPromise[_0xa38d('0x22')](_0x4b864c);}return _0x192a0f[_0xa38d('0x23')]();};}function saveUpdates(_0x465bdf,_0x112c94){return function(_0x9e30ab){if(_0x9e30ab){return _0x9e30ab['update'](_0x465bdf)[_0xa38d('0x24')](function(_0x2936da){return _0x2936da;});}return null;};}function removeEntity(_0x101309,_0x292a80){return function(_0x3eb200){if(_0x3eb200){return _0x3eb200[_0xa38d('0x25')]()[_0xa38d('0x24')](function(){var _0x3bba3d=_0x3eb200[_0xa38d('0x26')]({'plain':!![]});var _0xc119a=_0xa38d('0x27');return db[_0xa38d('0x28')][_0xa38d('0x25')]({'where':{'type':_0xc119a,'resourceId':_0x3bba3d['id']}})['then'](function(){return _0x3eb200;});})[_0xa38d('0x24')](function(){_0x101309['status'](0xcc)[_0xa38d('0x29')]();});}};}function handleEntityNotFound(_0x4e5cd1,_0x549053){return function(_0x213040){if(!_0x213040){_0x4e5cd1['sendStatus'](0x194);}return _0x213040;};}function handleError(_0x589c0d,_0x3ea486){_0x3ea486=_0x3ea486||0x1f4;return function(_0x5e5c0c){logger[_0xa38d('0x2a')](_0x5e5c0c['stack']);if(_0x5e5c0c[_0xa38d('0x2b')]){delete _0x5e5c0c['name'];}_0x589c0d[_0xa38d('0x1c')](_0x3ea486)['send'](_0x5e5c0c);};}exports[_0xa38d('0x2c')]=function(_0x31bc9f,_0x5562d0){var _0xabd31b={},_0x150e34={},_0x7dc3e4={'count':0x0,'rows':[]};var _0x429939=db[_0xa38d('0x2d')][_0xa38d('0x2e')];_0x150e34[_0xa38d('0x2f')]=_[_0xa38d('0x30')](_0x429939);_0x150e34['query']=_[_0xa38d('0x30')](_0x31bc9f['query']);_0x150e34[_0xa38d('0x31')]=_[_0xa38d('0x32')](_0x150e34[_0xa38d('0x2f')],_0x150e34[_0xa38d('0x33')]);_0xabd31b[_0xa38d('0x34')]=_['intersection'](_0x150e34[_0xa38d('0x2f')],qs[_0xa38d('0x35')](_0x31bc9f['query'][_0xa38d('0x35')]));_0xabd31b['attributes']=_0xabd31b[_0xa38d('0x34')][_0xa38d('0x36')]?_0xabd31b[_0xa38d('0x34')]:_0x150e34['model'];if(!_0x31bc9f[_0xa38d('0x33')][_0xa38d('0x37')](_0xa38d('0x38'))){_0xabd31b[_0xa38d('0x1f')]=qs['limit'](_0x31bc9f[_0xa38d('0x33')][_0xa38d('0x1f')]);_0xabd31b['offset']=qs[_0xa38d('0x1e')](_0x31bc9f[_0xa38d('0x33')]['offset']);}_0xabd31b[_0xa38d('0x39')]=qs[_0xa38d('0x3a')](_0x31bc9f[_0xa38d('0x33')][_0xa38d('0x3a')]);_0xabd31b[_0xa38d('0x3b')]=qs[_0xa38d('0x31')](_['pick'](_0x31bc9f[_0xa38d('0x33')],_0x150e34[_0xa38d('0x31')]));if(_0x31bc9f[_0xa38d('0x33')][_0xa38d('0x3c')]){_0xabd31b['where']=_['merge'](_0xabd31b[_0xa38d('0x3b')],{'$or':_[_0xa38d('0x3d')](_0x429939,function(_0xa82fe9){if(_0xa82fe9['type'][_0xa38d('0x3e')]!==_0xa38d('0x3f')){var _0x1efe9a={};_0x1efe9a[_0xa82fe9['field']]={'$like':'%'+_0x31bc9f[_0xa38d('0x33')][_0xa38d('0x3c')]+'%'};return _0x1efe9a;}})});}_0xabd31b=_['merge']({},_0xabd31b,_0x31bc9f['options']);var _0x47dd3b={'where':_0xabd31b['where']};return db[_0xa38d('0x2d')][_0xa38d('0x40')](_0x47dd3b)[_0xa38d('0x24')](function(_0x4081bc){_0x7dc3e4[_0xa38d('0x40')]=_0x4081bc;if(_0x31bc9f[_0xa38d('0x33')]['includeAll']){_0xabd31b['include']=[{'all':!![]}];}return db[_0xa38d('0x2d')][_0xa38d('0x41')](_0xabd31b);})[_0xa38d('0x24')](function(_0x25c0b5){_0x7dc3e4['rows']=_0x25c0b5;return _0x7dc3e4;})[_0xa38d('0x24')](respondWithFilteredResult(_0x5562d0,_0xabd31b))[_0xa38d('0x42')](handleError(_0x5562d0,null));};exports[_0xa38d('0x43')]=function(_0x4704a3,_0x3c98ac){var _0x1adab7={'raw':!![],'where':{'id':_0x4704a3['params']['id']}},_0x2ff2f7={};_0x2ff2f7[_0xa38d('0x2f')]=_[_0xa38d('0x30')](db[_0xa38d('0x2d')][_0xa38d('0x2e')]);_0x2ff2f7[_0xa38d('0x33')]=_[_0xa38d('0x30')](_0x4704a3['query']);_0x2ff2f7['filters']=_[_0xa38d('0x32')](_0x2ff2f7['model'],_0x2ff2f7[_0xa38d('0x33')]);_0x1adab7[_0xa38d('0x34')]=_[_0xa38d('0x32')](_0x2ff2f7[_0xa38d('0x2f')],qs[_0xa38d('0x35')](_0x4704a3['query']['fields']));_0x1adab7[_0xa38d('0x34')]=_0x1adab7[_0xa38d('0x34')][_0xa38d('0x36')]?_0x1adab7[_0xa38d('0x34')]:_0x2ff2f7[_0xa38d('0x2f')];if(_0x4704a3[_0xa38d('0x33')]['includeAll']){_0x1adab7['include']=[{'all':!![]}];}_0x1adab7=_[_0xa38d('0x44')]({},_0x1adab7,_0x4704a3[_0xa38d('0x45')]);return db[_0xa38d('0x2d')][_0xa38d('0x46')](_0x1adab7)[_0xa38d('0x24')](handleEntityNotFound(_0x3c98ac,null))[_0xa38d('0x24')](respondWithResult(_0x3c98ac,null))[_0xa38d('0x42')](handleError(_0x3c98ac,null));};exports['create']=function(_0x7d1954,_0x7be3fc){return db['FaxQueue'][_0xa38d('0x47')](_0x7d1954[_0xa38d('0x48')],{})[_0xa38d('0x24')](function(_0x58d360){var _0x345edb=_0x7d1954[_0xa38d('0x49')][_0xa38d('0x26')]({'plain':!![]});if(!_0x345edb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x345edb[_0xa38d('0x4a')]===_0xa38d('0x49')){var _0x220f8b=_0x58d360[_0xa38d('0x26')]({'plain':!![]});var _0x1f75d0=_0xa38d('0x27');return db[_0xa38d('0x4b')][_0xa38d('0x46')]({'where':{'name':_0x1f75d0,'userProfileId':_0x345edb[_0xa38d('0x4c')]},'raw':!![]})[_0xa38d('0x24')](function(_0xcc971d){if(_0xcc971d&&_0xcc971d['autoAssociation']===0x0){return db['UserProfileResource'][_0xa38d('0x47')]({'name':_0x220f8b[_0xa38d('0x2b')],'resourceId':_0x220f8b['id'],'type':_0xcc971d[_0xa38d('0x2b')],'sectionId':_0xcc971d['id']},{})['then'](function(){return _0x58d360;});}else{return _0x58d360;}})[_0xa38d('0x42')](function(_0x2d37ae){logger[_0xa38d('0x2a')](_0xa38d('0x4d'),_0x2d37ae);throw _0x2d37ae;});}return _0x58d360;})['then'](respondWithResult(_0x7be3fc,0xc9))[_0xa38d('0x42')](handleError(_0x7be3fc,null));};exports['update']=function(_0x335895,_0x2572c1){if(_0x335895[_0xa38d('0x48')]['id']){delete _0x335895['body']['id'];}return db['FaxQueue'][_0xa38d('0x46')]({'where':{'id':_0x335895[_0xa38d('0x4e')]['id']}})[_0xa38d('0x24')](handleEntityNotFound(_0x2572c1,null))['then'](saveUpdates(_0x335895['body'],null))['then'](respondWithResult(_0x2572c1,null))[_0xa38d('0x42')](handleError(_0x2572c1,null));};exports['destroy']=function(_0x2bd59c,_0x534de0){return db['FaxQueue'][_0xa38d('0x46')]({'where':{'id':_0x2bd59c['params']['id']}})[_0xa38d('0x24')](handleEntityNotFound(_0x534de0,null))['then'](removeEntity(_0x534de0,null))[_0xa38d('0x42')](handleError(_0x534de0,null));};exports['describe']=function(_0x563be0,_0x46b679){return db['FaxQueue'][_0xa38d('0x4f')]()[_0xa38d('0x24')](respondWithResult(_0x46b679,null))[_0xa38d('0x42')](handleError(_0x46b679,null));};exports[_0xa38d('0x50')]=function(_0x2a05a3,_0x420ef8,_0x10bcdd){var _0x4a45ae={'raw':!![],'where':{}},_0x2327d4={},_0x94c4af;return db[_0xa38d('0x2d')]['findOne']({'where':{'id':_0x2a05a3['params']['id']}})[_0xa38d('0x24')](handleEntityNotFound(_0x420ef8,null))['then'](function(_0xe24438){if(_0xe24438){_0x94c4af=_0xe24438[_0xa38d('0x26')]({'plain':!![]});_0x2327d4[_0xa38d('0x2f')]=_[_0xa38d('0x30')](db[_0xa38d('0x51')]['rawAttributes']);_0x2327d4[_0xa38d('0x33')]=_['keys'](_0x2a05a3[_0xa38d('0x33')]);_0x2327d4[_0xa38d('0x31')]=_['intersection'](_0x2327d4[_0xa38d('0x2f')],_0x2327d4[_0xa38d('0x33')]);_0x4a45ae['attributes']=_[_0xa38d('0x32')](_0x2327d4[_0xa38d('0x2f')],qs[_0xa38d('0x35')](_0x2a05a3[_0xa38d('0x33')][_0xa38d('0x35')]));_0x4a45ae['attributes']=_0x4a45ae[_0xa38d('0x34')][_0xa38d('0x36')]?_0x4a45ae[_0xa38d('0x34')]:_0x2327d4[_0xa38d('0x2f')];if(!_0x2a05a3[_0xa38d('0x33')]['hasOwnProperty'](_0xa38d('0x38'))){_0x4a45ae[_0xa38d('0x1f')]=qs[_0xa38d('0x1f')](_0x2a05a3['query'][_0xa38d('0x1f')]);_0x4a45ae['offset']=qs['offset'](_0x2a05a3[_0xa38d('0x33')][_0xa38d('0x1e')]);}_0x4a45ae[_0xa38d('0x39')]=qs['sort'](_0x2a05a3[_0xa38d('0x33')][_0xa38d('0x3a')]);_0x4a45ae[_0xa38d('0x3b')]=qs['filters'](_[_0xa38d('0x52')](_0x2a05a3['query'],_0x2327d4[_0xa38d('0x31')]));_0x4a45ae[_0xa38d('0x3b')]['FaxQueueId']=_0xe24438['id'];if(_0x2a05a3['query'][_0xa38d('0x3c')]){_0x4a45ae[_0xa38d('0x3b')]=_[_0xa38d('0x44')](_0x4a45ae['where'],{'$or':_['map'](_0x4a45ae[_0xa38d('0x34')],function(_0x2357f8){var _0x397c91={};_0x397c91[_0x2357f8]={'$like':'%'+_0x2a05a3[_0xa38d('0x33')][_0xa38d('0x3c')]+'%'};return _0x397c91;})});}_0x4a45ae=_[_0xa38d('0x44')]({},_0x4a45ae,_0x2a05a3[_0xa38d('0x45')]);return db[_0xa38d('0x51')]['findAll'](_0x4a45ae);}})['then'](function(_0x25f5fd){if(_0x25f5fd){return db[_0xa38d('0x53')]['findAndCountAll']({'where':{'id':_[_0xa38d('0x3d')](_0x25f5fd,'UserId'),'role':_0xa38d('0x54')},'attributes':['id',_0xa38d('0x2b'),'faxPause','updatedAt','createdAt']});}})[_0xa38d('0x24')](function(_0x2327a6){if(_0x2327a6){return{'count':_0x2327a6['count'],'rows':_[_0xa38d('0x3d')](_0x2327a6['rows'],function(_0x5b04fd){return{'membername':_0x5b04fd[_0xa38d('0x2b')],'UserId':_0x5b04fd['id'],'queue_name':_0x94c4af[_0xa38d('0x2b')],'FaxQueueId':_0x94c4af['id'],'interface':util['format'](_0xa38d('0x55'),_0xa38d('0x56'),_0x5b04fd[_0xa38d('0x2b')]),'penalty':0x0,'paused':_0x5b04fd[_0xa38d('0x57')],'createdAt':_0x5b04fd[_0xa38d('0x58')],'updatedAt':_0x5b04fd[_0xa38d('0x59')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa38d('0x24')](respondWithFilteredResult(_0x420ef8,_0x4a45ae))['catch'](handleError(_0x420ef8,null));};exports[_0xa38d('0x5a')]=function(_0x4f2567,_0x44f6c4,_0x2b1a90){var _0x5335dd={};var _0x1e5adf={};var _0x27849d;var _0x254c6a;return db[_0xa38d('0x2d')][_0xa38d('0x5b')]({'where':{'id':_0x4f2567[_0xa38d('0x4e')]['id']}})[_0xa38d('0x24')](handleEntityNotFound(_0x44f6c4,null))[_0xa38d('0x24')](function(_0x56121f){if(_0x56121f){_0x27849d=_0x56121f;_0x1e5adf[_0xa38d('0x2f')]=_[_0xa38d('0x30')](db['Team'][_0xa38d('0x2e')]);_0x1e5adf['query']=_['keys'](_0x4f2567[_0xa38d('0x33')]);_0x1e5adf['filters']=_[_0xa38d('0x32')](_0x1e5adf[_0xa38d('0x2f')],_0x1e5adf['query']);_0x5335dd[_0xa38d('0x34')]=_[_0xa38d('0x32')](_0x1e5adf[_0xa38d('0x2f')],qs['fields'](_0x4f2567[_0xa38d('0x33')][_0xa38d('0x35')]));_0x5335dd['attributes']=_0x5335dd['attributes']['length']?_0x5335dd[_0xa38d('0x34')]:_0x1e5adf[_0xa38d('0x2f')];_0x5335dd[_0xa38d('0x39')]=qs['sort'](_0x4f2567[_0xa38d('0x33')][_0xa38d('0x3a')]);_0x5335dd[_0xa38d('0x3b')]=qs['filters'](_[_0xa38d('0x52')](_0x4f2567[_0xa38d('0x33')],_0x1e5adf[_0xa38d('0x31')]));if(_0x4f2567['query']['filter']){_0x5335dd[_0xa38d('0x3b')]=_[_0xa38d('0x44')](_0x5335dd[_0xa38d('0x3b')],{'$or':_[_0xa38d('0x3d')](_0x5335dd[_0xa38d('0x34')],function(_0x491ce8){var _0x45e13={};_0x45e13[_0x491ce8]={'$like':'%'+_0x4f2567['query'][_0xa38d('0x3c')]+'%'};return _0x45e13;})});}_0x5335dd=_[_0xa38d('0x44')]({},_0x5335dd,_0x4f2567[_0xa38d('0x45')]);return _0x27849d['getTeams'](_0x5335dd);}})[_0xa38d('0x24')](function(_0x24e61b){if(_0x24e61b){_0x254c6a=_0x24e61b['length'];if(!_0x4f2567[_0xa38d('0x33')][_0xa38d('0x37')]('nolimit')){_0x5335dd[_0xa38d('0x1f')]=qs[_0xa38d('0x1f')](_0x4f2567[_0xa38d('0x33')][_0xa38d('0x1f')]);_0x5335dd[_0xa38d('0x1e')]=qs[_0xa38d('0x1e')](_0x4f2567[_0xa38d('0x33')][_0xa38d('0x1e')]);}return _0x27849d['getTeams'](_0x5335dd);}})[_0xa38d('0x24')](function(_0x20857c){if(_0x20857c){return _0x20857c?{'count':_0x254c6a,'rows':_0x20857c}:null;}})[_0xa38d('0x24')](respondWithResult(_0x44f6c4,null))[_0xa38d('0x42')](handleError(_0x44f6c4,null));};exports[_0xa38d('0x5c')]=function(_0x1fef71,_0x460840,_0x3548f4){var _0x4884af=_0x1fef71['body'][_0xa38d('0x5d')];return db[_0xa38d('0x5e')][_0xa38d('0x41')]({'where':{'id':_[_0xa38d('0x3d')](_0x4884af,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xa38d('0x2b'),_0xa38d('0x5f'),_0xa38d('0x60'),_0xa38d('0x61')],'raw':!![]}]})[_0xa38d('0x24')](function(_0x311090){if(_0x311090){var _0x452436=_[_0xa38d('0x62')](_0x311090,function(_0x2db7e5){var _0x22bf17=_0x2db7e5['get']({'plain':!![]});return _0x22bf17[_0xa38d('0x63')];});return db['FaxQueue'][_0xa38d('0x46')]({'where':{'id':_0x1fef71[_0xa38d('0x4e')]['id']}})[_0xa38d('0x24')](function(_0x50bc83){return db[_0xa38d('0x64')]['transaction'](function(_0x54a05c){return _0x50bc83[_0xa38d('0x5c')](_['map'](_0x4884af,'id'),{'transaction':_0x54a05c})[_0xa38d('0x24')](function(){return BPromise[_0xa38d('0x65')](_0x452436,function(_0x8ce4f1){return db[_0xa38d('0x51')][_0xa38d('0x66')]({'where':{'UserId':_0x8ce4f1['id'],'FaxQueueId':_0x1fef71[_0xa38d('0x4e')]['id']},'transaction':_0x54a05c});});})[_0xa38d('0x24')](function(){_0x452436['forEach'](function(_0x1cf276){socket[_0xa38d('0x67')](_0xa38d('0x68'),{'UserId':_0x1cf276['id'],'FaxQueueId':_0x50bc83['id']});});});});});}})[_0xa38d('0x24')](respondWithStatusCode(_0x460840,null))[_0xa38d('0x42')](handleError(_0x460840,null));};exports[_0xa38d('0x69')]=function(_0xd16ff8,_0x2eacff,_0x2657c1){return db[_0xa38d('0x5e')][_0xa38d('0x41')]({'where':{'id':_0xd16ff8[_0xa38d('0x33')][_0xa38d('0x6a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa38d('0x63'),'attributes':['id'],'raw':!![]}]})[_0xa38d('0x24')](handleEntityNotFound(_0x2eacff,null))['then'](function(_0x5baa70){var _0x59d5ca=_[_0xa38d('0x3d')](_0x5baa70,'id');var _0x4c9fbf=[];var _0x4b93ab=[];var _0x388c8e=squel[_0xa38d('0x6b')]();_0x388c8e[_0xa38d('0x6c')](_0xa38d('0x6d'))[_0xa38d('0x6e')](_0xa38d('0x6f'),'tq')['join']('user_has_teams','ut',_0xa38d('0x70'))['where'](_0xa38d('0x71'),_0xd16ff8[_0xa38d('0x4e')]['id']);for(var _0x4dc1c0=0x0;_0x4dc1c0<_0x5baa70[_0xa38d('0x36')];_0x4dc1c0+=0x1){let _0x287e93=_0x5baa70[_0x4dc1c0];for(var _0x3b7d52=0x0;_0x3b7d52<_0x287e93[_0xa38d('0x63')][_0xa38d('0x36')];_0x3b7d52+=0x1){let _0xeb3c87=_0x287e93[_0xa38d('0x63')][_0x3b7d52];var _0x2f6139=_0x388c8e[_0xa38d('0x72')]();_0x2f6139['where']('ut.UserId\x20=\x20?',_0xeb3c87['id']);_0x4b93ab[_0xa38d('0x73')](db['sequelize'][_0xa38d('0x33')](_0x2f6139[_0xa38d('0x74')](),{'type':db[_0xa38d('0x64')][_0xa38d('0x75')][_0xa38d('0x76')]})[_0xa38d('0x24')](function(_0x1232ab){if(_0x1232ab[_0xa38d('0x36')]===0x1){return _0xeb3c87['id'];}else{var _0x4a80ea=_['every'](_['map'](_0x1232ab,_0xa38d('0x77')),function(_0x1d4fb6){return _[_0xa38d('0x78')](_0x59d5ca,_0x1d4fb6);});if(_0x4a80ea){return _0xeb3c87['id'];}}}));}}return BPromise[_0xa38d('0x79')](_0x4b93ab)[_0xa38d('0x24')](function(_0x43d359){_0x4c9fbf=_(_0x4c9fbf)[_0xa38d('0x7a')](_0x43d359)['compact']()[_0xa38d('0x7b')]();return db[_0xa38d('0x2d')][_0xa38d('0x46')]({'where':{'id':_0xd16ff8[_0xa38d('0x4e')]['id']}})[_0xa38d('0x24')](function(_0x3752e2){return db['sequelize'][_0xa38d('0x7c')](function(_0x2e8121){return _0x3752e2[_0xa38d('0x69')](_0xd16ff8[_0xa38d('0x33')][_0xa38d('0x6a')],{'transaction':_0x2e8121})[_0xa38d('0x24')](function(){if(!_[_0xa38d('0x7d')](_0x4c9fbf)){return _0x3752e2[_0xa38d('0x7e')](_0x4c9fbf,{'transaction':_0x2e8121});}})[_0xa38d('0x24')](function(){_0x4c9fbf[_0xa38d('0x7f')](function(_0x21ed99){socket[_0xa38d('0x67')]('userFaxQueue:remove',{'UserId':_0x21ed99,'FaxQueueId':_0x3752e2['id']});});});});});});})[_0xa38d('0x24')](respondWithStatusCode(_0x2eacff,null))[_0xa38d('0x42')](handleError(_0x2eacff,null));};exports['addAgents']=function(_0x5ba91e,_0x4019ca,_0xd9fb88){return db[_0xa38d('0x2d')]['find']({'where':{'id':_0x5ba91e['params']['id']}})[_0xa38d('0x24')](handleEntityNotFound(_0x4019ca,null))['then'](function(_0xb20216){if(_0xb20216){return _0xb20216[_0xa38d('0x80')](_0x5ba91e['body'][_0xa38d('0x6a')],_[_0xa38d('0x81')](_0x5ba91e[_0xa38d('0x48')],[_0xa38d('0x6a'),'id'])||{})[_0xa38d('0x82')](function(_0xa2b0e6){for(var _0x8238a0=0x0;_0x8238a0<_0x5ba91e[_0xa38d('0x48')][_0xa38d('0x6a')][_0xa38d('0x36')];_0x8238a0+=0x1){socket[_0xa38d('0x67')](_0xa38d('0x68'),{'UserId':_0x5ba91e[_0xa38d('0x48')]['ids'][_0x8238a0],'FaxQueueId':_0x5ba91e[_0xa38d('0x4e')]['id']});}return _0xa2b0e6;});}})[_0xa38d('0x24')](respondWithResult(_0x4019ca,null))['catch'](handleError(_0x4019ca,null));};exports[_0xa38d('0x7e')]=function(_0x321718,_0x43aa72,_0x176a58){return db[_0xa38d('0x2d')][_0xa38d('0x46')]({'where':{'id':_0x321718[_0xa38d('0x4e')]['id']}})[_0xa38d('0x24')](handleEntityNotFound(_0x43aa72,null))[_0xa38d('0x24')](function(_0x4be66f){if(_0x4be66f){return _0x4be66f[_0xa38d('0x7e')](_0x321718['query'][_0xa38d('0x6a')])[_0xa38d('0x24')](function(){if(_['isArray'](_0x321718[_0xa38d('0x33')][_0xa38d('0x6a')])){for(var _0x396b0d=0x0;_0x396b0d<_0x321718[_0xa38d('0x33')]['ids'][_0xa38d('0x36')];_0x396b0d+=0x1){socket[_0xa38d('0x67')]('userFaxQueue:remove',{'UserId':Number(_0x321718[_0xa38d('0x33')]['ids'][_0x396b0d]),'FaxQueueId':Number(_0x321718[_0xa38d('0x4e')]['id'])});}}else{socket[_0xa38d('0x67')](_0xa38d('0x83'),{'UserId':Number(_0x321718[_0xa38d('0x33')][_0xa38d('0x6a')]),'FaxQueueId':Number(_0x321718[_0xa38d('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x43aa72,null))[_0xa38d('0x42')](handleError(_0x43aa72,null));};exports[_0xa38d('0x84')]=function(_0x2b50e7,_0x529523,_0x2c38c7){var _0x2b9f94={};var _0x339905={};var _0x12454e;var _0x44d2a8;return db[_0xa38d('0x2d')]['findOne']({'where':{'id':_0x2b50e7['params']['id']}})[_0xa38d('0x24')](handleEntityNotFound(_0x529523,null))[_0xa38d('0x24')](function(_0xdb7423){if(_0xdb7423){_0x12454e=_0xdb7423;_0x339905[_0xa38d('0x2f')]=_[_0xa38d('0x30')](db[_0xa38d('0x53')][_0xa38d('0x2e')]);_0x339905[_0xa38d('0x33')]=_[_0xa38d('0x30')](_0x2b50e7[_0xa38d('0x33')]);_0x339905[_0xa38d('0x31')]=_[_0xa38d('0x32')](_0x339905['model'],_0x339905[_0xa38d('0x33')]);_0x2b9f94['attributes']=_[_0xa38d('0x32')](_0x339905['model'],qs[_0xa38d('0x35')](_0x2b50e7[_0xa38d('0x33')][_0xa38d('0x35')]));_0x2b9f94[_0xa38d('0x34')]=_0x2b9f94[_0xa38d('0x34')][_0xa38d('0x36')]?_0x2b9f94[_0xa38d('0x34')]:_0x339905[_0xa38d('0x2f')];_0x2b9f94[_0xa38d('0x39')]=qs[_0xa38d('0x3a')](_0x2b50e7[_0xa38d('0x33')]['sort']);_0x2b9f94[_0xa38d('0x3b')]=qs['filters'](_[_0xa38d('0x52')](_0x2b50e7[_0xa38d('0x33')],_0x339905[_0xa38d('0x31')]));if(_0x2b50e7[_0xa38d('0x33')][_0xa38d('0x3c')]){_0x2b9f94[_0xa38d('0x3b')]=_[_0xa38d('0x44')](_0x2b9f94[_0xa38d('0x3b')],{'$or':_['map'](_0x2b9f94['attributes'],function(_0x362a4e){var _0x17ba24={};_0x17ba24[_0x362a4e]={'$like':'%'+_0x2b50e7['query'][_0xa38d('0x3c')]+'%'};return _0x17ba24;})});}_0x2b9f94=_[_0xa38d('0x44')]({},_0x2b9f94,_0x2b50e7[_0xa38d('0x45')]);return _0x12454e['getAgents'](_0x2b9f94);}})[_0xa38d('0x24')](function(_0x7b0fe1){if(_0x7b0fe1){_0x44d2a8=_0x7b0fe1[_0xa38d('0x36')];if(!_0x2b50e7[_0xa38d('0x33')][_0xa38d('0x37')]('nolimit')){_0x2b9f94[_0xa38d('0x1f')]=qs['limit'](_0x2b50e7[_0xa38d('0x33')]['limit']);_0x2b9f94[_0xa38d('0x1e')]=qs[_0xa38d('0x1e')](_0x2b50e7[_0xa38d('0x33')][_0xa38d('0x1e')]);}return _0x12454e[_0xa38d('0x84')](_0x2b9f94);}})[_0xa38d('0x24')](function(_0x2686a8){if(_0x2686a8){return _0x2686a8?{'count':_0x44d2a8,'rows':_0x2686a8}:null;}})[_0xa38d('0x24')](respondWithResult(_0x529523,null))['catch'](handleError(_0x529523,null));}; \ No newline at end of file +var _0xa18b=['order','sort','where','filter','map','type','key','VIRTUAL','field','merge','include','findAll','catch','show','params','FaxQueue','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMembers','findOne','pick','FaxQueueId','options','UserFaxQueue','User','findAndCountAll','UserId','updatedAt','createdAt','rows','format','%s/%s','SIP','faxPause','Team','getTeams','addTeams','teams','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','userFaxQueue:save','removeTeams','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','toString','QueryTypes','every','includes','all','ids','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','count','offset','limit','set','Content-Range','json','destroy','get','FaxQueues','UserProfileResource','then','error','stack','name','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x58e61c,_0x497ea8){var _0x42881f=function(_0x28ed2f){while(--_0x28ed2f){_0x58e61c['push'](_0x58e61c['shift']());}};_0x42881f(++_0x497ea8);}(_0xa18b,0x1e9));var _0xba18=function(_0x3f39ab,_0x16c981){_0x3f39ab=_0x3f39ab-0x0;var _0x170952=_0xa18b[_0x3f39ab];return _0x170952;};'use strict';var pdf=require(_0xba18('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xba18('0x1'));var zipdir=require(_0xba18('0x2'));var jsonpatch=require(_0xba18('0x3'));var rp=require(_0xba18('0x4'));var moment=require(_0xba18('0x5'));var BPromise=require(_0xba18('0x6'));var Mustache=require(_0xba18('0x7'));var util=require(_0xba18('0x8'));var path=require(_0xba18('0x9'));var sox=require(_0xba18('0xa'));var csv=require(_0xba18('0xb'));var ejs=require(_0xba18('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xba18('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xba18('0xe'));var Papa=require(_0xba18('0xf'));var Redis=require(_0xba18('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xba18('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xba18('0x12'))(_0xba18('0x13'));var utils=require(_0xba18('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xba18('0x15')]=_[_0xba18('0x16')](config[_0xba18('0x15')],{'host':_0xba18('0x17'),'port':0x18eb});var socket=require(_0xba18('0x18'))(new Redis(config['redis']));require('./faxQueue.socket')[_0xba18('0x19')](socket);function respondWithStatusCode(_0x343f08,_0x1017f7){_0x1017f7=_0x1017f7||0xcc;return function(_0x11c6fc){if(_0x11c6fc){return _0x343f08[_0xba18('0x1a')](_0x1017f7);}return _0x343f08[_0xba18('0x1b')](_0x1017f7)[_0xba18('0x1c')]();};}function respondWithResult(_0x1b76a2,_0x55b0a9){_0x55b0a9=_0x55b0a9||0xc8;return function(_0x3a7c6e){if(_0x3a7c6e){return _0x1b76a2[_0xba18('0x1b')](_0x55b0a9)['json'](_0x3a7c6e);}};}function respondWithFilteredResult(_0x31d4b7,_0x57ac53){return function(_0x1a187e){if(_0x1a187e){var _0x3efb98=_0x1a187e[_0xba18('0x1d')],_0x39dcee=_0x57ac53[_0xba18('0x1e')],_0x2d4ba6=_0x57ac53[_0xba18('0x1e')]+_0x57ac53[_0xba18('0x1f')],_0x28a2f3;if(_0x2d4ba6>=_0x3efb98){_0x2d4ba6=_0x3efb98;_0x28a2f3=0xc8;}else{_0x28a2f3=0xce;}_0x31d4b7[_0xba18('0x1b')](_0x28a2f3);return _0x31d4b7[_0xba18('0x20')](_0xba18('0x21'),_0x39dcee+'-'+_0x2d4ba6+'/'+_0x3efb98)[_0xba18('0x22')](_0x1a187e);}return null;};}function patchUpdates(_0x553557){return function(_0x234930){try{jsonpatch['apply'](_0x234930,_0x553557,!![]);}catch(_0x3ae9ed){return BPromise['reject'](_0x3ae9ed);}return _0x234930['save']();};}function saveUpdates(_0x58bf62,_0x9c347c){return function(_0x559573){if(_0x559573){return _0x559573['update'](_0x58bf62)['then'](function(_0x29a4a3){return _0x29a4a3;});}return null;};}function removeEntity(_0x47a76f,_0x4cd154){return function(_0x3ad8c6){if(_0x3ad8c6){return _0x3ad8c6[_0xba18('0x23')]()['then'](function(){var _0x528fd3=_0x3ad8c6[_0xba18('0x24')]({'plain':!![]});var _0x3ab4cb=_0xba18('0x25');return db[_0xba18('0x26')]['destroy']({'where':{'type':_0x3ab4cb,'resourceId':_0x528fd3['id']}})[_0xba18('0x27')](function(){return _0x3ad8c6;});})['then'](function(){_0x47a76f[_0xba18('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d13ca,_0x3b179c){return function(_0x4bc497){if(!_0x4bc497){_0x1d13ca[_0xba18('0x1a')](0x194);}return _0x4bc497;};}function handleError(_0x11644f,_0x4c215e){_0x4c215e=_0x4c215e||0x1f4;return function(_0x3d8614){logger[_0xba18('0x28')](_0x3d8614[_0xba18('0x29')]);if(_0x3d8614[_0xba18('0x2a')]){delete _0x3d8614[_0xba18('0x2a')];}_0x11644f[_0xba18('0x1b')](_0x4c215e)['send'](_0x3d8614);};}exports[_0xba18('0x2b')]=function(_0x232c87,_0x84a104){var _0xe89ad7={},_0x155f1e={},_0x465f51={'count':0x0,'rows':[]};var _0x151c81=db['FaxQueue'][_0xba18('0x2c')];_0x155f1e[_0xba18('0x2d')]=_[_0xba18('0x2e')](_0x151c81);_0x155f1e[_0xba18('0x2f')]=_[_0xba18('0x2e')](_0x232c87[_0xba18('0x2f')]);_0x155f1e[_0xba18('0x30')]=_[_0xba18('0x31')](_0x155f1e['model'],_0x155f1e[_0xba18('0x2f')]);_0xe89ad7['attributes']=_[_0xba18('0x31')](_0x155f1e['model'],qs[_0xba18('0x32')](_0x232c87[_0xba18('0x2f')][_0xba18('0x32')]));_0xe89ad7['attributes']=_0xe89ad7[_0xba18('0x33')][_0xba18('0x34')]?_0xe89ad7[_0xba18('0x33')]:_0x155f1e['model'];if(!_0x232c87[_0xba18('0x2f')][_0xba18('0x35')](_0xba18('0x36'))){_0xe89ad7[_0xba18('0x1f')]=qs[_0xba18('0x1f')](_0x232c87[_0xba18('0x2f')][_0xba18('0x1f')]);_0xe89ad7[_0xba18('0x1e')]=qs[_0xba18('0x1e')](_0x232c87['query'][_0xba18('0x1e')]);}_0xe89ad7[_0xba18('0x37')]=qs[_0xba18('0x38')](_0x232c87[_0xba18('0x2f')]['sort']);_0xe89ad7[_0xba18('0x39')]=qs[_0xba18('0x30')](_['pick'](_0x232c87[_0xba18('0x2f')],_0x155f1e['filters']));if(_0x232c87[_0xba18('0x2f')][_0xba18('0x3a')]){_0xe89ad7[_0xba18('0x39')]=_['merge'](_0xe89ad7[_0xba18('0x39')],{'$or':_[_0xba18('0x3b')](_0x151c81,function(_0xf3fa87){if(_0xf3fa87[_0xba18('0x3c')][_0xba18('0x3d')]!==_0xba18('0x3e')){var _0x4c3fb4={};_0x4c3fb4[_0xf3fa87[_0xba18('0x3f')]]={'$like':'%'+_0x232c87[_0xba18('0x2f')][_0xba18('0x3a')]+'%'};return _0x4c3fb4;}})});}_0xe89ad7=_[_0xba18('0x40')]({},_0xe89ad7,_0x232c87['options']);var _0x1a8f25={'where':_0xe89ad7[_0xba18('0x39')]};return db['FaxQueue'][_0xba18('0x1d')](_0x1a8f25)[_0xba18('0x27')](function(_0x3514b3){_0x465f51[_0xba18('0x1d')]=_0x3514b3;if(_0x232c87[_0xba18('0x2f')]['includeAll']){_0xe89ad7[_0xba18('0x41')]=[{'all':!![]}];}return db['FaxQueue'][_0xba18('0x42')](_0xe89ad7);})[_0xba18('0x27')](function(_0x40799c){_0x465f51['rows']=_0x40799c;return _0x465f51;})['then'](respondWithFilteredResult(_0x84a104,_0xe89ad7))[_0xba18('0x43')](handleError(_0x84a104,null));};exports[_0xba18('0x44')]=function(_0x3be1fe,_0x2f2cae){var _0x532b72={'raw':!![],'where':{'id':_0x3be1fe[_0xba18('0x45')]['id']}},_0x46988e={};_0x46988e[_0xba18('0x2d')]=_[_0xba18('0x2e')](db[_0xba18('0x46')]['rawAttributes']);_0x46988e[_0xba18('0x2f')]=_['keys'](_0x3be1fe[_0xba18('0x2f')]);_0x46988e[_0xba18('0x30')]=_[_0xba18('0x31')](_0x46988e[_0xba18('0x2d')],_0x46988e['query']);_0x532b72[_0xba18('0x33')]=_[_0xba18('0x31')](_0x46988e['model'],qs['fields'](_0x3be1fe[_0xba18('0x2f')]['fields']));_0x532b72[_0xba18('0x33')]=_0x532b72[_0xba18('0x33')][_0xba18('0x34')]?_0x532b72[_0xba18('0x33')]:_0x46988e[_0xba18('0x2d')];if(_0x3be1fe[_0xba18('0x2f')]['includeAll']){_0x532b72[_0xba18('0x41')]=[{'all':!![]}];}_0x532b72=_['merge']({},_0x532b72,_0x3be1fe['options']);return db['FaxQueue'][_0xba18('0x47')](_0x532b72)[_0xba18('0x27')](handleEntityNotFound(_0x2f2cae,null))[_0xba18('0x27')](respondWithResult(_0x2f2cae,null))[_0xba18('0x43')](handleError(_0x2f2cae,null));};exports[_0xba18('0x48')]=function(_0x1e5b6a,_0x30cd50){return db['FaxQueue'][_0xba18('0x48')](_0x1e5b6a[_0xba18('0x49')],{})['then'](function(_0x24bd67){var _0x1577d6=_0x1e5b6a['user'][_0xba18('0x24')]({'plain':!![]});if(!_0x1577d6)throw new Error(_0xba18('0x4a'));if(_0x1577d6[_0xba18('0x4b')]===_0xba18('0x4c')){var _0x15573c=_0x24bd67[_0xba18('0x24')]({'plain':!![]});var _0x456087=_0xba18('0x25');return db['UserProfileSection'][_0xba18('0x47')]({'where':{'name':_0x456087,'userProfileId':_0x1577d6[_0xba18('0x4d')]},'raw':!![]})[_0xba18('0x27')](function(_0x51023d){if(_0x51023d&&_0x51023d[_0xba18('0x4e')]===0x0){return db[_0xba18('0x26')][_0xba18('0x48')]({'name':_0x15573c[_0xba18('0x2a')],'resourceId':_0x15573c['id'],'type':_0x51023d[_0xba18('0x2a')],'sectionId':_0x51023d['id']},{})[_0xba18('0x27')](function(){return _0x24bd67;});}else{return _0x24bd67;}})[_0xba18('0x43')](function(_0x2ad297){logger[_0xba18('0x28')](_0xba18('0x4f'),_0x2ad297);throw _0x2ad297;});}return _0x24bd67;})['then'](respondWithResult(_0x30cd50,0xc9))[_0xba18('0x43')](handleError(_0x30cd50,null));};exports[_0xba18('0x50')]=function(_0x180cd9,_0x5b66a8){if(_0x180cd9['body']['id']){delete _0x180cd9[_0xba18('0x49')]['id'];}return db[_0xba18('0x46')][_0xba18('0x47')]({'where':{'id':_0x180cd9[_0xba18('0x45')]['id']}})['then'](handleEntityNotFound(_0x5b66a8,null))[_0xba18('0x27')](saveUpdates(_0x180cd9[_0xba18('0x49')],null))[_0xba18('0x27')](respondWithResult(_0x5b66a8,null))[_0xba18('0x43')](handleError(_0x5b66a8,null));};exports[_0xba18('0x23')]=function(_0x4cf95f,_0x1b9a33){return db[_0xba18('0x46')]['find']({'where':{'id':_0x4cf95f[_0xba18('0x45')]['id']}})['then'](handleEntityNotFound(_0x1b9a33,null))[_0xba18('0x27')](removeEntity(_0x1b9a33,null))[_0xba18('0x43')](handleError(_0x1b9a33,null));};exports['describe']=function(_0x19f24d,_0x5ec98e){return db[_0xba18('0x46')]['describe']()[_0xba18('0x27')](respondWithResult(_0x5ec98e,null))['catch'](handleError(_0x5ec98e,null));};exports[_0xba18('0x51')]=function(_0x5e22e0,_0x3ccff7,_0x452f82){var _0x5b2cb4={'raw':!![],'where':{}},_0x5666c6={},_0x40450c;return db['FaxQueue'][_0xba18('0x52')]({'where':{'id':_0x5e22e0[_0xba18('0x45')]['id']}})['then'](handleEntityNotFound(_0x3ccff7,null))['then'](function(_0x28b9c3){if(_0x28b9c3){_0x40450c=_0x28b9c3['get']({'plain':!![]});_0x5666c6[_0xba18('0x2d')]=_[_0xba18('0x2e')](db['UserFaxQueue'][_0xba18('0x2c')]);_0x5666c6[_0xba18('0x2f')]=_['keys'](_0x5e22e0[_0xba18('0x2f')]);_0x5666c6['filters']=_[_0xba18('0x31')](_0x5666c6[_0xba18('0x2d')],_0x5666c6[_0xba18('0x2f')]);_0x5b2cb4[_0xba18('0x33')]=_[_0xba18('0x31')](_0x5666c6[_0xba18('0x2d')],qs[_0xba18('0x32')](_0x5e22e0['query'][_0xba18('0x32')]));_0x5b2cb4['attributes']=_0x5b2cb4[_0xba18('0x33')][_0xba18('0x34')]?_0x5b2cb4[_0xba18('0x33')]:_0x5666c6[_0xba18('0x2d')];if(!_0x5e22e0[_0xba18('0x2f')]['hasOwnProperty'](_0xba18('0x36'))){_0x5b2cb4[_0xba18('0x1f')]=qs[_0xba18('0x1f')](_0x5e22e0['query'][_0xba18('0x1f')]);_0x5b2cb4[_0xba18('0x1e')]=qs[_0xba18('0x1e')](_0x5e22e0[_0xba18('0x2f')][_0xba18('0x1e')]);}_0x5b2cb4[_0xba18('0x37')]=qs[_0xba18('0x38')](_0x5e22e0['query'][_0xba18('0x38')]);_0x5b2cb4['where']=qs['filters'](_[_0xba18('0x53')](_0x5e22e0['query'],_0x5666c6[_0xba18('0x30')]));_0x5b2cb4[_0xba18('0x39')][_0xba18('0x54')]=_0x28b9c3['id'];if(_0x5e22e0[_0xba18('0x2f')][_0xba18('0x3a')]){_0x5b2cb4[_0xba18('0x39')]=_[_0xba18('0x40')](_0x5b2cb4[_0xba18('0x39')],{'$or':_[_0xba18('0x3b')](_0x5b2cb4[_0xba18('0x33')],function(_0x13c161){var _0x5801d7={};_0x5801d7[_0x13c161]={'$like':'%'+_0x5e22e0['query'][_0xba18('0x3a')]+'%'};return _0x5801d7;})});}_0x5b2cb4=_['merge']({},_0x5b2cb4,_0x5e22e0[_0xba18('0x55')]);return db[_0xba18('0x56')][_0xba18('0x42')](_0x5b2cb4);}})[_0xba18('0x27')](function(_0x3ca51a){if(_0x3ca51a){return db[_0xba18('0x57')][_0xba18('0x58')]({'where':{'id':_[_0xba18('0x3b')](_0x3ca51a,_0xba18('0x59')),'role':'agent'},'attributes':['id',_0xba18('0x2a'),'faxPause',_0xba18('0x5a'),_0xba18('0x5b')]});}})['then'](function(_0x397f22){if(_0x397f22){return{'count':_0x397f22[_0xba18('0x1d')],'rows':_['map'](_0x397f22[_0xba18('0x5c')],function(_0x1bd4bd){return{'membername':_0x1bd4bd[_0xba18('0x2a')],'UserId':_0x1bd4bd['id'],'queue_name':_0x40450c[_0xba18('0x2a')],'FaxQueueId':_0x40450c['id'],'interface':util[_0xba18('0x5d')](_0xba18('0x5e'),_0xba18('0x5f'),_0x1bd4bd['name']),'penalty':0x0,'paused':_0x1bd4bd[_0xba18('0x60')],'createdAt':_0x1bd4bd[_0xba18('0x5b')],'updatedAt':_0x1bd4bd[_0xba18('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xba18('0x27')](respondWithFilteredResult(_0x3ccff7,_0x5b2cb4))[_0xba18('0x43')](handleError(_0x3ccff7,null));};exports['getTeams']=function(_0x21b0f5,_0x1626d1,_0x24ef8f){var _0xafd7a8={};var _0x277e32={};var _0x34ecda;var _0x831e88;return db[_0xba18('0x46')][_0xba18('0x52')]({'where':{'id':_0x21b0f5[_0xba18('0x45')]['id']}})[_0xba18('0x27')](handleEntityNotFound(_0x1626d1,null))[_0xba18('0x27')](function(_0x125ed9){if(_0x125ed9){_0x34ecda=_0x125ed9;_0x277e32[_0xba18('0x2d')]=_['keys'](db[_0xba18('0x61')]['rawAttributes']);_0x277e32[_0xba18('0x2f')]=_[_0xba18('0x2e')](_0x21b0f5[_0xba18('0x2f')]);_0x277e32[_0xba18('0x30')]=_['intersection'](_0x277e32['model'],_0x277e32[_0xba18('0x2f')]);_0xafd7a8[_0xba18('0x33')]=_[_0xba18('0x31')](_0x277e32['model'],qs[_0xba18('0x32')](_0x21b0f5[_0xba18('0x2f')][_0xba18('0x32')]));_0xafd7a8[_0xba18('0x33')]=_0xafd7a8[_0xba18('0x33')][_0xba18('0x34')]?_0xafd7a8[_0xba18('0x33')]:_0x277e32[_0xba18('0x2d')];_0xafd7a8['order']=qs[_0xba18('0x38')](_0x21b0f5[_0xba18('0x2f')][_0xba18('0x38')]);_0xafd7a8[_0xba18('0x39')]=qs[_0xba18('0x30')](_[_0xba18('0x53')](_0x21b0f5['query'],_0x277e32['filters']));if(_0x21b0f5[_0xba18('0x2f')]['filter']){_0xafd7a8['where']=_['merge'](_0xafd7a8[_0xba18('0x39')],{'$or':_[_0xba18('0x3b')](_0xafd7a8[_0xba18('0x33')],function(_0x90e93a){var _0x1204a2={};_0x1204a2[_0x90e93a]={'$like':'%'+_0x21b0f5['query'][_0xba18('0x3a')]+'%'};return _0x1204a2;})});}_0xafd7a8=_[_0xba18('0x40')]({},_0xafd7a8,_0x21b0f5[_0xba18('0x55')]);return _0x34ecda[_0xba18('0x62')](_0xafd7a8);}})['then'](function(_0x472d31){if(_0x472d31){_0x831e88=_0x472d31[_0xba18('0x34')];if(!_0x21b0f5['query'][_0xba18('0x35')](_0xba18('0x36'))){_0xafd7a8['limit']=qs['limit'](_0x21b0f5['query'][_0xba18('0x1f')]);_0xafd7a8[_0xba18('0x1e')]=qs[_0xba18('0x1e')](_0x21b0f5['query'][_0xba18('0x1e')]);}return _0x34ecda[_0xba18('0x62')](_0xafd7a8);}})[_0xba18('0x27')](function(_0x5c5ac7){if(_0x5c5ac7){return _0x5c5ac7?{'count':_0x831e88,'rows':_0x5c5ac7}:null;}})[_0xba18('0x27')](respondWithResult(_0x1626d1,null))['catch'](handleError(_0x1626d1,null));};exports[_0xba18('0x63')]=function(_0x32fc79,_0x50dc70,_0x4ec58b){var _0x59a136=_0x32fc79[_0xba18('0x49')][_0xba18('0x64')];return db[_0xba18('0x61')][_0xba18('0x42')]({'where':{'id':_[_0xba18('0x3b')](_0x59a136,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0xba18('0x65'),'attributes':['id',_0xba18('0x2a'),_0xba18('0x66'),_0xba18('0x67'),'interface'],'raw':!![]}]})['then'](function(_0x5cef27){if(_0x5cef27){var _0x4efa50=_[_0xba18('0x68')](_0x5cef27,function(_0x500f27){var _0x11030e=_0x500f27['get']({'plain':!![]});return _0x11030e['Agents'];});return db[_0xba18('0x46')]['find']({'where':{'id':_0x32fc79[_0xba18('0x45')]['id']}})['then'](function(_0x2a35d6){return db[_0xba18('0x69')][_0xba18('0x6a')](function(_0x3383a4){return _0x2a35d6['addTeams'](_[_0xba18('0x3b')](_0x59a136,'id'),{'transaction':_0x3383a4})['then'](function(){return BPromise[_0xba18('0x6b')](_0x4efa50,function(_0x1f9da2){return db['UserFaxQueue'][_0xba18('0x6c')]({'where':{'UserId':_0x1f9da2['id'],'FaxQueueId':_0x32fc79['params']['id']},'transaction':_0x3383a4});});})['then'](function(){_0x4efa50[_0xba18('0x6d')](function(_0x592724){socket['emit'](_0xba18('0x6e'),{'UserId':_0x592724['id'],'FaxQueueId':_0x2a35d6['id']});});});});});}})[_0xba18('0x27')](respondWithStatusCode(_0x50dc70,null))[_0xba18('0x43')](handleError(_0x50dc70,null));};exports[_0xba18('0x6f')]=function(_0x34a4a7,_0x5cae13,_0x48caf6){return db[_0xba18('0x61')][_0xba18('0x42')]({'where':{'id':_0x34a4a7[_0xba18('0x2f')]['ids']},'attributes':['id'],'include':[{'model':db[_0xba18('0x57')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xba18('0x27')](handleEntityNotFound(_0x5cae13,null))['then'](function(_0x14a670){var _0x47e0ea=_[_0xba18('0x3b')](_0x14a670,'id');var _0xf68853=[];var _0x2ab1ba=[];var _0x5e4658=squel[_0xba18('0x70')]();_0x5e4658['field'](_0xba18('0x71'))[_0xba18('0x72')]('team_has_fax_queues','tq')[_0xba18('0x73')](_0xba18('0x74'),'ut',_0xba18('0x75'))['where'](_0xba18('0x76'),_0x34a4a7[_0xba18('0x45')]['id']);for(var _0x4b6cba=0x0;_0x4b6cba<_0x14a670[_0xba18('0x34')];_0x4b6cba+=0x1){let _0x2ad0fa=_0x14a670[_0x4b6cba];for(var _0x108a4d=0x0;_0x108a4d<_0x2ad0fa[_0xba18('0x65')]['length'];_0x108a4d+=0x1){let _0x3516f0=_0x2ad0fa[_0xba18('0x65')][_0x108a4d];var _0x3c7e38=_0x5e4658[_0xba18('0x77')]();_0x3c7e38['where']('ut.UserId\x20=\x20?',_0x3516f0['id']);_0x2ab1ba[_0xba18('0x78')](db['sequelize'][_0xba18('0x2f')](_0x3c7e38[_0xba18('0x79')](),{'type':db[_0xba18('0x69')][_0xba18('0x7a')]['SELECT']})[_0xba18('0x27')](function(_0x4cb887){if(_0x4cb887[_0xba18('0x34')]===0x1){return _0x3516f0['id'];}else{var _0x5f1812=_[_0xba18('0x7b')](_[_0xba18('0x3b')](_0x4cb887,'TeamId'),function(_0x663f49){return _[_0xba18('0x7c')](_0x47e0ea,_0x663f49);});if(_0x5f1812){return _0x3516f0['id'];}}}));}}return BPromise[_0xba18('0x7d')](_0x2ab1ba)[_0xba18('0x27')](function(_0x4cf000){_0xf68853=_(_0xf68853)['union'](_0x4cf000)['compact']()['value']();return db[_0xba18('0x46')][_0xba18('0x47')]({'where':{'id':_0x34a4a7[_0xba18('0x45')]['id']}})[_0xba18('0x27')](function(_0x3ca2e7){return db['sequelize'][_0xba18('0x6a')](function(_0x317916){return _0x3ca2e7[_0xba18('0x6f')](_0x34a4a7[_0xba18('0x2f')][_0xba18('0x7e')],{'transaction':_0x317916})[_0xba18('0x27')](function(){if(!_[_0xba18('0x7f')](_0xf68853)){return _0x3ca2e7[_0xba18('0x80')](_0xf68853,{'transaction':_0x317916});}})[_0xba18('0x27')](function(){_0xf68853['forEach'](function(_0x5c92a8){socket[_0xba18('0x81')](_0xba18('0x82'),{'UserId':_0x5c92a8,'FaxQueueId':_0x3ca2e7['id']});});});});});});})[_0xba18('0x27')](respondWithStatusCode(_0x5cae13,null))[_0xba18('0x43')](handleError(_0x5cae13,null));};exports['addAgents']=function(_0x3d812f,_0x5b4591,_0x1f6d4e){return db['FaxQueue'][_0xba18('0x47')]({'where':{'id':_0x3d812f[_0xba18('0x45')]['id']}})[_0xba18('0x27')](handleEntityNotFound(_0x5b4591,null))['then'](function(_0x2fe1d8){if(_0x2fe1d8){return _0x2fe1d8[_0xba18('0x83')](_0x3d812f[_0xba18('0x49')]['ids'],_[_0xba18('0x84')](_0x3d812f[_0xba18('0x49')],[_0xba18('0x7e'),'id'])||{})[_0xba18('0x85')](function(_0x13c225){for(var _0xb38583=0x0;_0xb38583<_0x3d812f[_0xba18('0x49')][_0xba18('0x7e')][_0xba18('0x34')];_0xb38583+=0x1){socket[_0xba18('0x81')]('userFaxQueue:save',{'UserId':_0x3d812f[_0xba18('0x49')]['ids'][_0xb38583],'FaxQueueId':_0x3d812f[_0xba18('0x45')]['id']});}return _0x13c225;});}})[_0xba18('0x27')](respondWithResult(_0x5b4591,null))['catch'](handleError(_0x5b4591,null));};exports[_0xba18('0x80')]=function(_0x54a3e0,_0x2d594d,_0x8651f7){return db[_0xba18('0x46')][_0xba18('0x47')]({'where':{'id':_0x54a3e0['params']['id']}})['then'](handleEntityNotFound(_0x2d594d,null))['then'](function(_0xb90be5){if(_0xb90be5){return _0xb90be5['removeAgents'](_0x54a3e0[_0xba18('0x2f')][_0xba18('0x7e')])[_0xba18('0x27')](function(){if(_[_0xba18('0x86')](_0x54a3e0['query'][_0xba18('0x7e')])){for(var _0x3b6ce8=0x0;_0x3b6ce8<_0x54a3e0[_0xba18('0x2f')][_0xba18('0x7e')][_0xba18('0x34')];_0x3b6ce8+=0x1){socket[_0xba18('0x81')](_0xba18('0x82'),{'UserId':Number(_0x54a3e0[_0xba18('0x2f')]['ids'][_0x3b6ce8]),'FaxQueueId':Number(_0x54a3e0['params']['id'])});}}else{socket[_0xba18('0x81')](_0xba18('0x82'),{'UserId':Number(_0x54a3e0['query'][_0xba18('0x7e')]),'FaxQueueId':Number(_0x54a3e0[_0xba18('0x45')]['id'])});}});}})[_0xba18('0x27')](respondWithStatusCode(_0x2d594d,null))['catch'](handleError(_0x2d594d,null));};exports[_0xba18('0x87')]=function(_0x2bfb36,_0x2c9be5,_0x536ddc){var _0x743745={};var _0x29572f={};var _0x2afe12;var _0x27666c;return db[_0xba18('0x46')][_0xba18('0x52')]({'where':{'id':_0x2bfb36[_0xba18('0x45')]['id']}})[_0xba18('0x27')](handleEntityNotFound(_0x2c9be5,null))['then'](function(_0x1b6155){if(_0x1b6155){_0x2afe12=_0x1b6155;_0x29572f[_0xba18('0x2d')]=_[_0xba18('0x2e')](db[_0xba18('0x57')][_0xba18('0x2c')]);_0x29572f[_0xba18('0x2f')]=_['keys'](_0x2bfb36['query']);_0x29572f['filters']=_[_0xba18('0x31')](_0x29572f['model'],_0x29572f[_0xba18('0x2f')]);_0x743745[_0xba18('0x33')]=_[_0xba18('0x31')](_0x29572f['model'],qs[_0xba18('0x32')](_0x2bfb36['query'][_0xba18('0x32')]));_0x743745['attributes']=_0x743745[_0xba18('0x33')]['length']?_0x743745[_0xba18('0x33')]:_0x29572f[_0xba18('0x2d')];_0x743745[_0xba18('0x37')]=qs[_0xba18('0x38')](_0x2bfb36[_0xba18('0x2f')][_0xba18('0x38')]);_0x743745[_0xba18('0x39')]=qs[_0xba18('0x30')](_[_0xba18('0x53')](_0x2bfb36[_0xba18('0x2f')],_0x29572f[_0xba18('0x30')]));if(_0x2bfb36[_0xba18('0x2f')]['filter']){_0x743745['where']=_[_0xba18('0x40')](_0x743745['where'],{'$or':_['map'](_0x743745[_0xba18('0x33')],function(_0x36ddb3){var _0x46fb6c={};_0x46fb6c[_0x36ddb3]={'$like':'%'+_0x2bfb36[_0xba18('0x2f')][_0xba18('0x3a')]+'%'};return _0x46fb6c;})});}_0x743745=_[_0xba18('0x40')]({},_0x743745,_0x2bfb36[_0xba18('0x55')]);return _0x2afe12[_0xba18('0x87')](_0x743745);}})[_0xba18('0x27')](function(_0x2c09c3){if(_0x2c09c3){_0x27666c=_0x2c09c3[_0xba18('0x34')];if(!_0x2bfb36[_0xba18('0x2f')][_0xba18('0x35')](_0xba18('0x36'))){_0x743745['limit']=qs['limit'](_0x2bfb36[_0xba18('0x2f')]['limit']);_0x743745[_0xba18('0x1e')]=qs['offset'](_0x2bfb36[_0xba18('0x2f')][_0xba18('0x1e')]);}return _0x2afe12['getAgents'](_0x743745);}})[_0xba18('0x27')](function(_0xefb040){if(_0xefb040){return _0xefb040?{'count':_0x27666c,'rows':_0xefb040}:null;}})[_0xba18('0x27')](respondWithResult(_0x2c9be5,null))[_0xba18('0x43')](handleError(_0x2c9be5,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index a4cee24..19d7be7 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 _0x9aea=['update','emit','hasOwnProperty','hook','exports','events','FaxQueue','save'];(function(_0x28e6bb,_0xd58f7b){var _0x39b752=function(_0x2c9c31){while(--_0x2c9c31){_0x28e6bb['push'](_0x28e6bb['shift']());}};_0x39b752(++_0xd58f7b);}(_0x9aea,0xdd));var _0xa9ae=function(_0x120dd1,_0x1ac7fe){_0x120dd1=_0x120dd1-0x0;var _0x39756a=_0x9aea[_0x120dd1];return _0x39756a;};'use strict';var EventEmitter=require(_0xa9ae('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0xa9ae('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa9ae('0x2'),'afterUpdate':_0xa9ae('0x3'),'afterDestroy':'remove'};function emitEvent(_0x414638){return function(_0x115593,_0x41fb71,_0x10f91d){FaxQueueEvents[_0xa9ae('0x4')](_0x414638+':'+_0x115593['id'],_0x115593);FaxQueueEvents['emit'](_0x414638,_0x115593);_0x10f91d(null);};}for(var e in events){if(events[_0xa9ae('0x5')](e)){var event=events[e];FaxQueue[_0xa9ae('0x6')](e,emitEvent(event));}}module[_0xa9ae('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0x4e81=['emit','hook','exports','events','../../mysqldb','FaxQueue','remove'];(function(_0x404e9b,_0x266162){var _0x408496=function(_0x37e3f9){while(--_0x37e3f9){_0x404e9b['push'](_0x404e9b['shift']());}};_0x408496(++_0x266162);}(_0x4e81,0x1bc));var _0x14e8=function(_0x1344d6,_0x2181e6){_0x1344d6=_0x1344d6-0x0;var _0xf45b24=_0x4e81[_0x1344d6];return _0xf45b24;};'use strict';var EventEmitter=require(_0x14e8('0x0'));var FaxQueue=require(_0x14e8('0x1'))['db'][_0x14e8('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x14e8('0x3')};function emitEvent(_0x3a988b){return function(_0x224121,_0x436444,_0x325325){FaxQueueEvents[_0x14e8('0x4')](_0x3a988b+':'+_0x224121['id'],_0x224121);FaxQueueEvents['emit'](_0x3a988b,_0x224121);_0x325325(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x14e8('0x5')](e,emitEvent(event));}}module[_0x14e8('0x6')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 5b0af6c..78153d5 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 _0x5f2f=['bluebird','request-promise','path','./faxQueue.attributes','exports','define','FaxQueue','lodash','util','../../config/logger','api','moment'];(function(_0x1a37e2,_0x48148b){var _0x2901d2=function(_0x43c6a1){while(--_0x43c6a1){_0x1a37e2['push'](_0x1a37e2['shift']());}};_0x2901d2(++_0x48148b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x43077e,_0x3eafb4){_0x43077e=_0x43077e-0x0;var _0x3fc452=_0x5f2f[_0x43077e];return _0x3fc452;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f2f=['bluebird','request-promise','path','./faxQueue.attributes','exports','define','FaxQueue','lodash','util','../../config/logger','api','moment'];(function(_0xba6f26,_0x1b5694){var _0x2d7971=function(_0xd4b98b){while(--_0xd4b98b){_0xba6f26['push'](_0xba6f26['shift']());}};_0x2d7971(++_0x1b5694);}(_0x5f2f,0x73));var _0xf5f2=function(_0x557c7f,_0x3de638){_0x557c7f=_0x557c7f-0x0;var _0x2e596b=_0x5f2f[_0x557c7f];return _0x2e596b;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'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 41b104d..51c0b67 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 _0x1196=['rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetFaxQueue','findAll','options','raw','attributes','limit','map','model','include','ShowFaxQueue','find','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x1196,0x1d0));var _0x6119=function(_0x522201,_0x25d7b2){_0x522201=_0x522201-0x0;var _0x49b199=_0x1196[_0x522201];return _0x49b199;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x6119('0x0'));var rs=require(_0x6119('0x1'));var fs=require('fs');var Redis=require(_0x6119('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6119('0x3'))(_0x6119('0x4'));var config=require('../../config/environment');var jayson=require(_0x6119('0x5'));var client=jayson['client'][_0x6119('0x6')]({'port':0x232a});config[_0x6119('0x7')]=_['defaults'](config[_0x6119('0x7')],{'host':_0x6119('0x8'),'port':0x18eb});var socket=require(_0x6119('0x9'))(new Redis(config[_0x6119('0x7')]));require(_0x6119('0xa'))[_0x6119('0xb')](socket);function respondWithRpcPromise(_0x673bf6,_0x2d54a2,_0x17eff8){return new BPromise(function(_0x11e8d9,_0x49b42a){return client[_0x6119('0xc')](_0x673bf6,_0x17eff8)[_0x6119('0xd')](function(_0x212d5d){logger['info'](_0x6119('0xe'),_0x2d54a2,'request\x20sent');logger[_0x6119('0xf')](_0x6119('0x10'),_0x2d54a2,_0x6119('0x11'),JSON[_0x6119('0x12')](_0x212d5d));if(_0x212d5d['error']){if(_0x212d5d[_0x6119('0x13')][_0x6119('0x14')]===0x1f4){logger[_0x6119('0x13')](_0x6119('0xe'),_0x2d54a2,_0x212d5d[_0x6119('0x13')][_0x6119('0x15')]);return _0x49b42a(_0x212d5d[_0x6119('0x13')][_0x6119('0x15')]);}logger[_0x6119('0x13')](_0x6119('0xe'),_0x2d54a2,_0x212d5d[_0x6119('0x13')]['message']);return _0x11e8d9(_0x212d5d[_0x6119('0x13')]['message']);}else{logger[_0x6119('0x16')](_0x6119('0xe'),_0x2d54a2,_0x6119('0x11'));_0x11e8d9(_0x212d5d[_0x6119('0x17')]['message']);}})[_0x6119('0x18')](function(_0x8725dc){logger['error'](_0x6119('0xe'),_0x2d54a2,_0x8725dc);_0x49b42a(_0x8725dc);});});}exports[_0x6119('0x19')]=function(_0x1f4543){var _0x5ca27e=this;return new Promise(function(_0xc66d3a,_0x91f8e1){return db['FaxQueue'][_0x6119('0x1a')]({'raw':_0x1f4543[_0x6119('0x1b')]?_0x1f4543[_0x6119('0x1b')][_0x6119('0x1c')]===undefined?!![]:![]:!![],'where':_0x1f4543[_0x6119('0x1b')]?_0x1f4543[_0x6119('0x1b')]['where']||null:null,'attributes':_0x1f4543['options']?_0x1f4543['options'][_0x6119('0x1d')]||null:null,'limit':_0x1f4543['options']?_0x1f4543['options'][_0x6119('0x1e')]||null:null,'include':_0x1f4543[_0x6119('0x1b')]?_0x1f4543[_0x6119('0x1b')]['include']?_[_0x6119('0x1f')](_0x1f4543['options']['include'],function(_0x1b9381){return{'model':db[_0x1b9381[_0x6119('0x20')]],'as':_0x1b9381['as'],'attributes':_0x1b9381[_0x6119('0x1d')],'include':_0x1b9381[_0x6119('0x21')]?_[_0x6119('0x1f')](_0x1b9381[_0x6119('0x21')],function(_0x594ff8){return{'model':db[_0x594ff8[_0x6119('0x20')]],'as':_0x594ff8['as'],'attributes':_0x594ff8[_0x6119('0x1d')],'include':_0x594ff8[_0x6119('0x21')]?_[_0x6119('0x1f')](_0x594ff8['include'],function(_0x401145){return{'model':db[_0x401145[_0x6119('0x20')]],'as':_0x401145['as'],'attributes':_0x401145[_0x6119('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2350c4){logger['info']('GetFaxQueue',_0x1f4543);logger['debug'](_0x6119('0x19'),_0x1f4543,JSON[_0x6119('0x12')](_0x2350c4));_0xc66d3a(_0x2350c4);})[_0x6119('0x18')](function(_0x3bb4fa){logger[_0x6119('0x13')]('GetFaxQueue',_0x3bb4fa[_0x6119('0x15')],_0x1f4543);_0x91f8e1(_0x5ca27e[_0x6119('0x13')](0x1f4,_0x3bb4fa[_0x6119('0x15')]));});});};exports[_0x6119('0x22')]=function(_0x267b6a){var _0x1d7fa6=this;return new Promise(function(_0x5c1eec,_0x106447){return db['FaxQueue'][_0x6119('0x23')]({'raw':_0x267b6a[_0x6119('0x1b')]?_0x267b6a[_0x6119('0x1b')][_0x6119('0x1c')]===undefined?!![]:![]:!![],'where':_0x267b6a[_0x6119('0x1b')]?_0x267b6a['options']['where']||null:null,'attributes':_0x267b6a['options']?_0x267b6a[_0x6119('0x1b')][_0x6119('0x1d')]||null:null,'include':_0x267b6a['options']?_0x267b6a[_0x6119('0x1b')][_0x6119('0x21')]?_[_0x6119('0x1f')](_0x267b6a['options'][_0x6119('0x21')],function(_0x1ef930){return{'model':db[_0x1ef930[_0x6119('0x20')]],'as':_0x1ef930['as'],'attributes':_0x1ef930[_0x6119('0x1d')],'include':_0x1ef930[_0x6119('0x21')]?_[_0x6119('0x1f')](_0x1ef930['include'],function(_0x2148de){return{'model':db[_0x2148de[_0x6119('0x20')]],'as':_0x2148de['as'],'attributes':_0x2148de['attributes'],'include':_0x2148de[_0x6119('0x21')]?_[_0x6119('0x1f')](_0x2148de[_0x6119('0x21')],function(_0x129d31){return{'model':db[_0x129d31['model']],'as':_0x129d31['as'],'attributes':_0x129d31[_0x6119('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6119('0xd')](function(_0x3a5d10){logger[_0x6119('0x16')](_0x6119('0x22'),_0x267b6a);logger[_0x6119('0xf')](_0x6119('0x22'),_0x267b6a,JSON[_0x6119('0x12')](_0x3a5d10));_0x5c1eec(_0x3a5d10);})[_0x6119('0x18')](function(_0x1cf029){logger[_0x6119('0x13')](_0x6119('0x22'),_0x1cf029[_0x6119('0x15')],_0x267b6a);_0x106447(_0x1d7fa6[_0x6119('0x13')](0x1f4,_0x1cf029[_0x6119('0x15')]));});});}; \ No newline at end of file +var _0x8b5c=['FaxQueue,\x20%s,\x20%s','message','catch','GetFaxQueue','FaxQueue','findAll','options','where','attributes','limit','include','map','model','ShowFaxQueue','find','raw','debug','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','then','info','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5ee626,_0xa44ae){var _0x51083c=function(_0x12bf4f){while(--_0x12bf4f){_0x5ee626['push'](_0x5ee626['shift']());}};_0x51083c(++_0xa44ae);}(_0x8b5c,0x183));var _0xc8b5=function(_0x4da411,_0x477129){_0x4da411=_0x4da411-0x0;var _0x3ce858=_0x8b5c[_0x4da411];return _0x3ce858;};'use strict';var _=require('lodash');var util=require(_0xc8b5('0x0'));var moment=require(_0xc8b5('0x1'));var BPromise=require('bluebird');var rs=require(_0xc8b5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc8b5('0x3'))['db'];var utils=require(_0xc8b5('0x4'));var logger=require(_0xc8b5('0x5'))('rpc');var config=require(_0xc8b5('0x6'));var jayson=require(_0xc8b5('0x7'));var client=jayson[_0xc8b5('0x8')][_0xc8b5('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xc8b5('0xa')],{'host':_0xc8b5('0xb'),'port':0x18eb});var socket=require(_0xc8b5('0xc'))(new Redis(config[_0xc8b5('0xa')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x4ccc6c,_0x342e50,_0x10987a){return new BPromise(function(_0x207198,_0x4fe11a){return client['request'](_0x4ccc6c,_0x10987a)[_0xc8b5('0xd')](function(_0x5772c9){logger[_0xc8b5('0xe')]('FaxQueue,\x20%s,\x20%s',_0x342e50,'request\x20sent');logger['debug'](_0xc8b5('0xf'),_0x342e50,_0xc8b5('0x10'),JSON[_0xc8b5('0x11')](_0x5772c9));if(_0x5772c9[_0xc8b5('0x12')]){if(_0x5772c9[_0xc8b5('0x12')][_0xc8b5('0x13')]===0x1f4){logger[_0xc8b5('0x12')](_0xc8b5('0x14'),_0x342e50,_0x5772c9['error'][_0xc8b5('0x15')]);return _0x4fe11a(_0x5772c9[_0xc8b5('0x12')][_0xc8b5('0x15')]);}logger['error'](_0xc8b5('0x14'),_0x342e50,_0x5772c9[_0xc8b5('0x12')][_0xc8b5('0x15')]);return _0x207198(_0x5772c9[_0xc8b5('0x12')][_0xc8b5('0x15')]);}else{logger[_0xc8b5('0xe')](_0xc8b5('0x14'),_0x342e50,_0xc8b5('0x10'));_0x207198(_0x5772c9['result']['message']);}})[_0xc8b5('0x16')](function(_0x1b4a73){logger['error'](_0xc8b5('0x14'),_0x342e50,_0x1b4a73);_0x4fe11a(_0x1b4a73);});});}exports[_0xc8b5('0x17')]=function(_0x1a779d){var _0x18c7c9=this;return new Promise(function(_0x1b0ce3,_0x5ed09b){return db[_0xc8b5('0x18')][_0xc8b5('0x19')]({'raw':_0x1a779d[_0xc8b5('0x1a')]?_0x1a779d[_0xc8b5('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1a779d['options']?_0x1a779d[_0xc8b5('0x1a')][_0xc8b5('0x1b')]||null:null,'attributes':_0x1a779d['options']?_0x1a779d['options'][_0xc8b5('0x1c')]||null:null,'limit':_0x1a779d['options']?_0x1a779d[_0xc8b5('0x1a')][_0xc8b5('0x1d')]||null:null,'include':_0x1a779d[_0xc8b5('0x1a')]?_0x1a779d['options'][_0xc8b5('0x1e')]?_[_0xc8b5('0x1f')](_0x1a779d[_0xc8b5('0x1a')]['include'],function(_0x887ba0){return{'model':db[_0x887ba0['model']],'as':_0x887ba0['as'],'attributes':_0x887ba0[_0xc8b5('0x1c')],'include':_0x887ba0[_0xc8b5('0x1e')]?_[_0xc8b5('0x1f')](_0x887ba0[_0xc8b5('0x1e')],function(_0x344f76){return{'model':db[_0x344f76[_0xc8b5('0x20')]],'as':_0x344f76['as'],'attributes':_0x344f76[_0xc8b5('0x1c')],'include':_0x344f76[_0xc8b5('0x1e')]?_[_0xc8b5('0x1f')](_0x344f76[_0xc8b5('0x1e')],function(_0x457819){return{'model':db[_0x457819['model']],'as':_0x457819['as'],'attributes':_0x457819[_0xc8b5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc8b5('0xd')](function(_0x1a61df){logger['info'](_0xc8b5('0x17'),_0x1a779d);logger['debug']('GetFaxQueue',_0x1a779d,JSON[_0xc8b5('0x11')](_0x1a61df));_0x1b0ce3(_0x1a61df);})[_0xc8b5('0x16')](function(_0x4ed8c4){logger[_0xc8b5('0x12')](_0xc8b5('0x17'),_0x4ed8c4[_0xc8b5('0x15')],_0x1a779d);_0x5ed09b(_0x18c7c9[_0xc8b5('0x12')](0x1f4,_0x4ed8c4[_0xc8b5('0x15')]));});});};exports[_0xc8b5('0x21')]=function(_0x525718){var _0x12459d=this;return new Promise(function(_0x4b3517,_0x3949e5){return db[_0xc8b5('0x18')][_0xc8b5('0x22')]({'raw':_0x525718[_0xc8b5('0x1a')]?_0x525718[_0xc8b5('0x1a')][_0xc8b5('0x23')]===undefined?!![]:![]:!![],'where':_0x525718[_0xc8b5('0x1a')]?_0x525718['options'][_0xc8b5('0x1b')]||null:null,'attributes':_0x525718[_0xc8b5('0x1a')]?_0x525718[_0xc8b5('0x1a')]['attributes']||null:null,'include':_0x525718[_0xc8b5('0x1a')]?_0x525718[_0xc8b5('0x1a')][_0xc8b5('0x1e')]?_[_0xc8b5('0x1f')](_0x525718[_0xc8b5('0x1a')][_0xc8b5('0x1e')],function(_0x1d6508){return{'model':db[_0x1d6508['model']],'as':_0x1d6508['as'],'attributes':_0x1d6508[_0xc8b5('0x1c')],'include':_0x1d6508[_0xc8b5('0x1e')]?_['map'](_0x1d6508[_0xc8b5('0x1e')],function(_0x2dd700){return{'model':db[_0x2dd700['model']],'as':_0x2dd700['as'],'attributes':_0x2dd700['attributes'],'include':_0x2dd700['include']?_[_0xc8b5('0x1f')](_0x2dd700[_0xc8b5('0x1e')],function(_0x45ec3f){return{'model':db[_0x45ec3f[_0xc8b5('0x20')]],'as':_0x45ec3f['as'],'attributes':_0x45ec3f[_0xc8b5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc8b5('0xd')](function(_0x6622a5){logger[_0xc8b5('0xe')]('ShowFaxQueue',_0x525718);logger[_0xc8b5('0x24')]('ShowFaxQueue',_0x525718,JSON[_0xc8b5('0x11')](_0x6622a5));_0x4b3517(_0x6622a5);})['catch'](function(_0x415a5b){logger[_0xc8b5('0x12')](_0xc8b5('0x21'),_0x415a5b[_0xc8b5('0x15')],_0x525718);_0x3949e5(_0x12459d[_0xc8b5('0x12')](0x1f4,_0x415a5b[_0xc8b5('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 4c3b6ba..6fd59af 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 _0xd9d9=['length','save','update','emit','removeListener','register'];(function(_0x5efa54,_0x5dc76d){var _0x2ee4b0=function(_0x3064a2){while(--_0x3064a2){_0x5efa54['push'](_0x5efa54['shift']());}};_0x2ee4b0(++_0x5dc76d);}(_0xd9d9,0x1a5));var _0x9d9d=function(_0x143a87,_0x3deb12){_0x143a87=_0x143a87-0x0;var _0xeedda0=_0xd9d9[_0x143a87];return _0xeedda0;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x9d9d('0x0'),'remove',_0x9d9d('0x1')];function createListener(_0x47e43a,_0x5c7e02){return function(_0x2b22b5){_0x5c7e02[_0x9d9d('0x2')](_0x47e43a,_0x2b22b5);};}function removeListener(_0x1e2e34,_0x193866){return function(){FaxQueueEvents[_0x9d9d('0x3')](_0x1e2e34,_0x193866);};}exports[_0x9d9d('0x4')]=function(_0x24b7a5){for(var _0x2d510c=0x0,_0x40b3ee=events[_0x9d9d('0x5')];_0x2d510c<_0x40b3ee;_0x2d510c++){var _0x4b3373=events[_0x2d510c];var _0x3388f9=createListener('faxQueue:'+_0x4b3373,_0x24b7a5);FaxQueueEvents['on'](_0x4b3373,_0x3388f9);}}; \ No newline at end of file +var _0x8724=['length','faxQueue:','./faxQueue.events','save'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x8724,0x136));var _0x4872=function(_0x2d6a7e,_0x5074b7){_0x2d6a7e=_0x2d6a7e-0x0;var _0x421e44=_0x8724[_0x2d6a7e];return _0x421e44;};'use strict';var FaxQueueEvents=require(_0x4872('0x0'));var events=[_0x4872('0x1'),'remove','update'];function createListener(_0x1e73e5,_0x1004e2){return function(_0x55f906){_0x1004e2['emit'](_0x1e73e5,_0x55f906);};}function removeListener(_0x253543,_0x2790f2){return function(){FaxQueueEvents['removeListener'](_0x253543,_0x2790f2);};}exports['register']=function(_0x363ad0){for(var _0x53f9c2=0x0,_0x24066d=events[_0x4872('0x2')];_0x53f9c2<_0x24066d;_0x53f9c2++){var _0x41cc89=events[_0x53f9c2];var _0x5c4c58=createListener(_0x4872('0x3')+_0x41cc89,_0x363ad0);FaxQueueEvents['on'](_0x41cc89,_0x5c4c58);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 8fb1639..5c24a92 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 _0x40c4=['util','path','connect-timeout','express','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','show','getMembers','/:id/teams','/:id/users','getAgents','addTeams','post','update','delete','/:id','destroy','exports','multer'];(function(_0x13f33b,_0x1a2dab){var _0x3603af=function(_0x171dc4){while(--_0x171dc4){_0x13f33b['push'](_0x13f33b['shift']());}};_0x3603af(++_0x1a2dab);}(_0x40c4,0x1df));var _0x440c=function(_0x251098,_0xc29b4){_0x251098=_0x251098-0x0;var _0x1ebb5c=_0x40c4[_0x251098];return _0x1ebb5c;};'use strict';var multer=require(_0x440c('0x0'));var util=require(_0x440c('0x1'));var path=require(_0x440c('0x2'));var timeout=require(_0x440c('0x3'));var express=require(_0x440c('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x440c('0x5'));var controller=require(_0x440c('0x6'));router[_0x440c('0x7')]('/',auth['isAuthenticated'](),controller[_0x440c('0x8')]);router[_0x440c('0x7')](_0x440c('0x9'),auth[_0x440c('0xa')](),controller[_0x440c('0xb')]);router[_0x440c('0x7')]('/:id',auth[_0x440c('0xa')](),controller[_0x440c('0xc')]);router[_0x440c('0x7')]('/:id/members',auth[_0x440c('0xa')](),controller[_0x440c('0xd')]);router[_0x440c('0x7')](_0x440c('0xe'),auth[_0x440c('0xa')](),controller['getTeams']);router['get'](_0x440c('0xf'),auth[_0x440c('0xa')](),controller[_0x440c('0x10')]);router['post']('/',auth[_0x440c('0xa')](),controller['create']);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x440c('0x11')]);router[_0x440c('0x12')](_0x440c('0xf'),auth['isAuthenticated'](),controller['addAgents']);router['put']('/:id',auth[_0x440c('0xa')](),controller[_0x440c('0x13')]);router[_0x440c('0x14')](_0x440c('0x15'),auth[_0x440c('0xa')](),controller[_0x440c('0x16')]);router[_0x440c('0x14')](_0x440c('0xe'),auth[_0x440c('0xa')](),controller['removeTeams']);router[_0x440c('0x14')](_0x440c('0xf'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x440c('0x17')]=router; \ No newline at end of file +var _0x1ac9=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','post','create','addTeams','addAgents','put','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout'];(function(_0x2400a0,_0x2d9e26){var _0x1ba4c2=function(_0x1ef34a){while(--_0x1ef34a){_0x2400a0['push'](_0x2400a0['shift']());}};_0x1ba4c2(++_0x2d9e26);}(_0x1ac9,0x1ec));var _0x91ac=function(_0x2e208f,_0x31dec8){_0x2e208f=_0x2e208f-0x0;var _0xdb130c=_0x1ac9[_0x2e208f];return _0xdb130c;};'use strict';var multer=require(_0x91ac('0x0'));var util=require(_0x91ac('0x1'));var path=require(_0x91ac('0x2'));var timeout=require(_0x91ac('0x3'));var express=require(_0x91ac('0x4'));var router=express[_0x91ac('0x5')]();var auth=require(_0x91ac('0x6'));var interaction=require(_0x91ac('0x7'));var config=require(_0x91ac('0x8'));var controller=require(_0x91ac('0x9'));router[_0x91ac('0xa')]('/',auth['isAuthenticated'](),controller[_0x91ac('0xb')]);router['get'](_0x91ac('0xc'),auth[_0x91ac('0xd')](),controller[_0x91ac('0xe')]);router[_0x91ac('0xa')](_0x91ac('0xf'),auth[_0x91ac('0xd')](),controller[_0x91ac('0x10')]);router[_0x91ac('0xa')](_0x91ac('0x11'),auth[_0x91ac('0xd')](),controller[_0x91ac('0x12')]);router[_0x91ac('0xa')](_0x91ac('0x13'),auth[_0x91ac('0xd')](),controller['getTeams']);router['get'](_0x91ac('0x14'),auth['isAuthenticated'](),controller['getAgents']);router[_0x91ac('0x15')]('/',auth[_0x91ac('0xd')](),controller[_0x91ac('0x16')]);router[_0x91ac('0x15')](_0x91ac('0x13'),auth[_0x91ac('0xd')](),controller[_0x91ac('0x17')]);router[_0x91ac('0x15')](_0x91ac('0x14'),auth[_0x91ac('0xd')](),controller[_0x91ac('0x18')]);router[_0x91ac('0x19')](_0x91ac('0xf'),auth[_0x91ac('0xd')](),controller['update']);router['delete'](_0x91ac('0xf'),auth[_0x91ac('0xd')](),controller[_0x91ac('0x1a')]);router[_0x91ac('0x1b')]('/:id/teams',auth[_0x91ac('0xd')](),controller[_0x91ac('0x1c')]);router[_0x91ac('0x1b')]('/:id/users',auth['isAuthenticated'](),controller[_0x91ac('0x1d')]);module[_0x91ac('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 617d470..e1af3fa 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 _0xff64=['sequelize','exports','STRING','DATE','moment'];(function(_0x55821d,_0x27a22e){var _0x58ea8a=function(_0x5bdd3d){while(--_0x5bdd3d){_0x55821d['push'](_0x55821d['shift']());}};_0x58ea8a(++_0x27a22e);}(_0xff64,0xe5));var _0x4ff6=function(_0x47a5bd,_0x508329){_0x47a5bd=_0x47a5bd-0x0;var _0x5c2184=_0xff64[_0x47a5bd];return _0x5c2184;};'use strict';var moment=require(_0x4ff6('0x0'));var Sequelize=require(_0x4ff6('0x1'));module[_0x4ff6('0x2')]={'uniqueid':{'type':Sequelize[_0x4ff6('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x4ff6('0x4')]},'acceptAt':{'type':Sequelize[_0x4ff6('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x4ff6('0x3')]}}; \ No newline at end of file +var _0x4f3f=['exports','STRING','DATE','moment','sequelize'];(function(_0x3a2a3c,_0x37bd31){var _0x50ac9a=function(_0x494a7f){while(--_0x494a7f){_0x3a2a3c['push'](_0x3a2a3c['shift']());}};_0x50ac9a(++_0x37bd31);}(_0x4f3f,0x1e3));var _0xf4f3=function(_0x589e28,_0x2d86bf){_0x589e28=_0x589e28-0x0;var _0x39bac5=_0x4f3f[_0x589e28];return _0x39bac5;};'use strict';var moment=require(_0xf4f3('0x0'));var Sequelize=require(_0xf4f3('0x1'));module[_0xf4f3('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xf4f3('0x3')]},'joinAt':{'type':Sequelize[_0xf4f3('0x4')]},'leaveAt':{'type':Sequelize[_0xf4f3('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xf4f3('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 921bb5c..0340967 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 _0x0399=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','FaxQueueReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','map','type','key','VIRTUAL','field','merge','options','include','rows','catch','show','params','includeAll','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','util','lodash','squel'];(function(_0x14ea6e,_0x24217c){var _0xfe836c=function(_0x51406d){while(--_0x51406d){_0x14ea6e['push'](_0x14ea6e['shift']());}};_0xfe836c(++_0x24217c);}(_0x0399,0x15a));var _0x9039=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x0399[_0x1cc8fe];return _0x230054;};'use strict';var pdf=require(_0x9039('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9039('0x1'));var zipdir=require(_0x9039('0x2'));var jsonpatch=require(_0x9039('0x3'));var rp=require('request-promise');var moment=require(_0x9039('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9039('0x5'));var util=require(_0x9039('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9039('0x7'));var squel=require(_0x9039('0x8'));var crypto=require(_0x9039('0x9'));var jsforce=require(_0x9039('0xa'));var deskjs=require(_0x9039('0xb'));var toCsv=require(_0x9039('0xc'));var querystring=require(_0x9039('0xd'));var Papa=require(_0x9039('0xe'));var Redis=require(_0x9039('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9039('0x10'));var hardwareService=require(_0x9039('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x9039('0x12'));var db=require(_0x9039('0x13'))['db'];function respondWithStatusCode(_0x26c830,_0x3aeef2){_0x3aeef2=_0x3aeef2||0xcc;return function(_0xedd3cb){if(_0xedd3cb){return _0x26c830[_0x9039('0x14')](_0x3aeef2);}return _0x26c830[_0x9039('0x15')](_0x3aeef2)[_0x9039('0x16')]();};}function respondWithResult(_0x16176b,_0x1e51f){_0x1e51f=_0x1e51f||0xc8;return function(_0x504025){if(_0x504025){return _0x16176b[_0x9039('0x15')](_0x1e51f)[_0x9039('0x17')](_0x504025);}};}function respondWithFilteredResult(_0x51154e,_0x461b3f){return function(_0x10c29a){if(_0x10c29a){var _0x37a707=_0x10c29a[_0x9039('0x18')],_0x14c076=_0x461b3f[_0x9039('0x19')],_0x372be2=_0x461b3f[_0x9039('0x19')]+_0x461b3f['limit'],_0x51a8be;if(_0x372be2>=_0x37a707){_0x372be2=_0x37a707;_0x51a8be=0xc8;}else{_0x51a8be=0xce;}_0x51154e['status'](_0x51a8be);return _0x51154e[_0x9039('0x1a')](_0x9039('0x1b'),_0x14c076+'-'+_0x372be2+'/'+_0x37a707)[_0x9039('0x17')](_0x10c29a);}return null;};}function patchUpdates(_0x7309d7){return function(_0x52db25){try{jsonpatch['apply'](_0x52db25,_0x7309d7,!![]);}catch(_0x5ea0e4){return BPromise[_0x9039('0x1c')](_0x5ea0e4);}return _0x52db25[_0x9039('0x1d')]();};}function saveUpdates(_0xbddec2,_0x30e0a5){return function(_0x47461a){if(_0x47461a){return _0x47461a[_0x9039('0x1e')](_0xbddec2)['then'](function(_0x321f09){return _0x321f09;});}return null;};}function removeEntity(_0x2acc65,_0x2b0d6a){return function(_0x50941d){if(_0x50941d){return _0x50941d[_0x9039('0x1f')]()[_0x9039('0x20')](function(){_0x2acc65['status'](0xcc)[_0x9039('0x16')]();});}};}function handleEntityNotFound(_0x251713,_0x3f22c4){return function(_0x64021b){if(!_0x64021b){_0x251713['sendStatus'](0x194);}return _0x64021b;};}function handleError(_0x41b6ee,_0x36e30c){_0x36e30c=_0x36e30c||0x1f4;return function(_0x57710){logger[_0x9039('0x21')](_0x57710[_0x9039('0x22')]);if(_0x57710[_0x9039('0x23')]){delete _0x57710[_0x9039('0x23')];}_0x41b6ee[_0x9039('0x15')](_0x36e30c)['send'](_0x57710);};}exports['index']=function(_0x420fd8,_0x23f18e){var _0x3bc416={},_0x173d81={},_0x2fde22={'count':0x0,'rows':[]};var _0x55eecf=db[_0x9039('0x24')][_0x9039('0x25')];_0x173d81[_0x9039('0x26')]=_[_0x9039('0x27')](_0x55eecf);_0x173d81[_0x9039('0x28')]=_[_0x9039('0x27')](_0x420fd8[_0x9039('0x28')]);_0x173d81[_0x9039('0x29')]=_['intersection'](_0x173d81['model'],_0x173d81[_0x9039('0x28')]);_0x3bc416['attributes']=_[_0x9039('0x2a')](_0x173d81[_0x9039('0x26')],qs['fields'](_0x420fd8['query'][_0x9039('0x2b')]));_0x3bc416['attributes']=_0x3bc416[_0x9039('0x2c')][_0x9039('0x2d')]?_0x3bc416[_0x9039('0x2c')]:_0x173d81[_0x9039('0x26')];if(!_0x420fd8[_0x9039('0x28')][_0x9039('0x2e')](_0x9039('0x2f'))){_0x3bc416[_0x9039('0x30')]=qs[_0x9039('0x30')](_0x420fd8[_0x9039('0x28')][_0x9039('0x30')]);_0x3bc416[_0x9039('0x19')]=qs[_0x9039('0x19')](_0x420fd8['query'][_0x9039('0x19')]);}_0x3bc416[_0x9039('0x31')]=qs[_0x9039('0x32')](_0x420fd8[_0x9039('0x28')][_0x9039('0x32')]);_0x3bc416['where']=qs[_0x9039('0x29')](_[_0x9039('0x33')](_0x420fd8['query'],_0x173d81['filters']));if(_0x420fd8['query'][_0x9039('0x34')]){_0x3bc416['where']=_['merge'](_0x3bc416[_0x9039('0x35')],{'$or':_[_0x9039('0x36')](_0x55eecf,function(_0x5a6568){if(_0x5a6568[_0x9039('0x37')][_0x9039('0x38')]!==_0x9039('0x39')){var _0xffeff9={};_0xffeff9[_0x5a6568[_0x9039('0x3a')]]={'$like':'%'+_0x420fd8[_0x9039('0x28')][_0x9039('0x34')]+'%'};return _0xffeff9;}})});}_0x3bc416=_[_0x9039('0x3b')]({},_0x3bc416,_0x420fd8[_0x9039('0x3c')]);var _0x2ca16d={'where':_0x3bc416['where']};return db['FaxQueueReport'][_0x9039('0x18')](_0x2ca16d)[_0x9039('0x20')](function(_0x58b60d){_0x2fde22[_0x9039('0x18')]=_0x58b60d;if(_0x420fd8['query']['includeAll']){_0x3bc416[_0x9039('0x3d')]=[{'all':!![]}];}return db['FaxQueueReport']['findAll'](_0x3bc416);})[_0x9039('0x20')](function(_0x51f2a1){_0x2fde22[_0x9039('0x3e')]=_0x51f2a1;return _0x2fde22;})[_0x9039('0x20')](respondWithFilteredResult(_0x23f18e,_0x3bc416))[_0x9039('0x3f')](handleError(_0x23f18e,null));};exports[_0x9039('0x40')]=function(_0x41620f,_0x5ba1c7){var _0x45e98f={'raw':!![],'where':{'id':_0x41620f[_0x9039('0x41')]['id']}},_0x22270f={};_0x22270f[_0x9039('0x26')]=_[_0x9039('0x27')](db[_0x9039('0x24')][_0x9039('0x25')]);_0x22270f[_0x9039('0x28')]=_[_0x9039('0x27')](_0x41620f[_0x9039('0x28')]);_0x22270f['filters']=_[_0x9039('0x2a')](_0x22270f[_0x9039('0x26')],_0x22270f[_0x9039('0x28')]);_0x45e98f[_0x9039('0x2c')]=_[_0x9039('0x2a')](_0x22270f[_0x9039('0x26')],qs[_0x9039('0x2b')](_0x41620f[_0x9039('0x28')][_0x9039('0x2b')]));_0x45e98f[_0x9039('0x2c')]=_0x45e98f[_0x9039('0x2c')][_0x9039('0x2d')]?_0x45e98f['attributes']:_0x22270f[_0x9039('0x26')];if(_0x41620f[_0x9039('0x28')][_0x9039('0x42')]){_0x45e98f[_0x9039('0x3d')]=[{'all':!![]}];}_0x45e98f=_[_0x9039('0x3b')]({},_0x45e98f,_0x41620f[_0x9039('0x3c')]);return db[_0x9039('0x24')][_0x9039('0x43')](_0x45e98f)['then'](handleEntityNotFound(_0x5ba1c7,null))[_0x9039('0x20')](respondWithResult(_0x5ba1c7,null))[_0x9039('0x3f')](handleError(_0x5ba1c7,null));};exports[_0x9039('0x44')]=function(_0x50c0b3,_0x2da88f){return db[_0x9039('0x24')][_0x9039('0x44')](_0x50c0b3['body'],{})[_0x9039('0x20')](respondWithResult(_0x2da88f,0xc9))[_0x9039('0x3f')](handleError(_0x2da88f,null));};exports[_0x9039('0x1e')]=function(_0x5265c0,_0x2d9d15){if(_0x5265c0[_0x9039('0x45')]['id']){delete _0x5265c0[_0x9039('0x45')]['id'];}return db[_0x9039('0x24')]['find']({'where':{'id':_0x5265c0[_0x9039('0x41')]['id']}})['then'](handleEntityNotFound(_0x2d9d15,null))[_0x9039('0x20')](saveUpdates(_0x5265c0[_0x9039('0x45')],null))['then'](respondWithResult(_0x2d9d15,null))['catch'](handleError(_0x2d9d15,null));};exports[_0x9039('0x1f')]=function(_0x3a1ce1,_0x2fda25){return db[_0x9039('0x24')][_0x9039('0x43')]({'where':{'id':_0x3a1ce1[_0x9039('0x41')]['id']}})[_0x9039('0x20')](handleEntityNotFound(_0x2fda25,null))[_0x9039('0x20')](removeEntity(_0x2fda25,null))[_0x9039('0x3f')](handleError(_0x2fda25,null));};exports['describe']=function(_0x346fec,_0x142f0b){return db['FaxQueueReport'][_0x9039('0x46')]()[_0x9039('0x20')](respondWithResult(_0x142f0b,null))[_0x9039('0x3f')](handleError(_0x142f0b,null));}; \ No newline at end of file +var _0x6893=['path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','stack','name','send','FaxQueueReport','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','key','VIRTUAL','field','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','update','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x92cf73,_0x5c80fc){var _0x1abecf=function(_0x5b3609){while(--_0x5b3609){_0x92cf73['push'](_0x92cf73['shift']());}};_0x1abecf(++_0x5c80fc);}(_0x6893,0x16a));var _0x3689=function(_0x47643e,_0x337374){_0x47643e=_0x47643e-0x0;var _0x2aa5db=_0x6893[_0x47643e];return _0x2aa5db;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3689('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3689('0x1'));var jsonpatch=require(_0x3689('0x2'));var rp=require(_0x3689('0x3'));var moment=require(_0x3689('0x4'));var BPromise=require(_0x3689('0x5'));var Mustache=require(_0x3689('0x6'));var util=require(_0x3689('0x7'));var path=require(_0x3689('0x8'));var sox=require(_0x3689('0x9'));var csv=require(_0x3689('0xa'));var ejs=require(_0x3689('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3689('0xc'));var crypto=require(_0x3689('0xd'));var jsforce=require(_0x3689('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3689('0xa'));var querystring=require(_0x3689('0xf'));var Papa=require(_0x3689('0x10'));var Redis=require(_0x3689('0x11'));var authService=require(_0x3689('0x12'));var qs=require(_0x3689('0x13'));var hardwareService=require(_0x3689('0x14'));var logger=require(_0x3689('0x15'))(_0x3689('0x16'));var utils=require(_0x3689('0x17'));var config=require(_0x3689('0x18'));var db=require(_0x3689('0x19'))['db'];function respondWithStatusCode(_0x1476ec,_0x5f828e){_0x5f828e=_0x5f828e||0xcc;return function(_0x72f5e3){if(_0x72f5e3){return _0x1476ec['sendStatus'](_0x5f828e);}return _0x1476ec['status'](_0x5f828e)[_0x3689('0x1a')]();};}function respondWithResult(_0x48d07c,_0x5cb314){_0x5cb314=_0x5cb314||0xc8;return function(_0x1f0ab4){if(_0x1f0ab4){return _0x48d07c[_0x3689('0x1b')](_0x5cb314)[_0x3689('0x1c')](_0x1f0ab4);}};}function respondWithFilteredResult(_0x5557cf,_0x249b28){return function(_0x448778){if(_0x448778){var _0x50c70a=_0x448778[_0x3689('0x1d')],_0x344ab4=_0x249b28[_0x3689('0x1e')],_0xe465a2=_0x249b28[_0x3689('0x1e')]+_0x249b28[_0x3689('0x1f')],_0x3cd4be;if(_0xe465a2>=_0x50c70a){_0xe465a2=_0x50c70a;_0x3cd4be=0xc8;}else{_0x3cd4be=0xce;}_0x5557cf['status'](_0x3cd4be);return _0x5557cf['set'](_0x3689('0x20'),_0x344ab4+'-'+_0xe465a2+'/'+_0x50c70a)[_0x3689('0x1c')](_0x448778);}return null;};}function patchUpdates(_0x5b68ee){return function(_0x569acf){try{jsonpatch[_0x3689('0x21')](_0x569acf,_0x5b68ee,!![]);}catch(_0x22fe55){return BPromise[_0x3689('0x22')](_0x22fe55);}return _0x569acf[_0x3689('0x23')]();};}function saveUpdates(_0x44c219,_0x587cc4){return function(_0x6151b6){if(_0x6151b6){return _0x6151b6['update'](_0x44c219)[_0x3689('0x24')](function(_0x111779){return _0x111779;});}return null;};}function removeEntity(_0x267055,_0x238926){return function(_0x583f67){if(_0x583f67){return _0x583f67[_0x3689('0x25')]()[_0x3689('0x24')](function(){_0x267055[_0x3689('0x1b')](0xcc)[_0x3689('0x1a')]();});}};}function handleEntityNotFound(_0x2451a1,_0x47758c){return function(_0x39c910){if(!_0x39c910){_0x2451a1['sendStatus'](0x194);}return _0x39c910;};}function handleError(_0x4f2fd2,_0x3a4ee6){_0x3a4ee6=_0x3a4ee6||0x1f4;return function(_0x196ff1){logger['error'](_0x196ff1[_0x3689('0x26')]);if(_0x196ff1[_0x3689('0x27')]){delete _0x196ff1[_0x3689('0x27')];}_0x4f2fd2[_0x3689('0x1b')](_0x3a4ee6)[_0x3689('0x28')](_0x196ff1);};}exports['index']=function(_0x4659b0,_0x776da8){var _0x8fdf9b={},_0x39054d={},_0x378d19={'count':0x0,'rows':[]};var _0xd71fa8=db[_0x3689('0x29')]['rawAttributes'];_0x39054d['model']=_['keys'](_0xd71fa8);_0x39054d[_0x3689('0x2a')]=_[_0x3689('0x2b')](_0x4659b0[_0x3689('0x2a')]);_0x39054d[_0x3689('0x2c')]=_[_0x3689('0x2d')](_0x39054d[_0x3689('0x2e')],_0x39054d['query']);_0x8fdf9b[_0x3689('0x2f')]=_[_0x3689('0x2d')](_0x39054d[_0x3689('0x2e')],qs[_0x3689('0x30')](_0x4659b0[_0x3689('0x2a')][_0x3689('0x30')]));_0x8fdf9b[_0x3689('0x2f')]=_0x8fdf9b[_0x3689('0x2f')][_0x3689('0x31')]?_0x8fdf9b[_0x3689('0x2f')]:_0x39054d[_0x3689('0x2e')];if(!_0x4659b0[_0x3689('0x2a')][_0x3689('0x32')](_0x3689('0x33'))){_0x8fdf9b[_0x3689('0x1f')]=qs[_0x3689('0x1f')](_0x4659b0[_0x3689('0x2a')]['limit']);_0x8fdf9b[_0x3689('0x1e')]=qs[_0x3689('0x1e')](_0x4659b0[_0x3689('0x2a')][_0x3689('0x1e')]);}_0x8fdf9b['order']=qs[_0x3689('0x34')](_0x4659b0['query'][_0x3689('0x34')]);_0x8fdf9b[_0x3689('0x35')]=qs[_0x3689('0x2c')](_[_0x3689('0x36')](_0x4659b0[_0x3689('0x2a')],_0x39054d['filters']));if(_0x4659b0['query']['filter']){_0x8fdf9b[_0x3689('0x35')]=_[_0x3689('0x37')](_0x8fdf9b[_0x3689('0x35')],{'$or':_['map'](_0xd71fa8,function(_0x58c6a0){if(_0x58c6a0[_0x3689('0x38')][_0x3689('0x39')]!==_0x3689('0x3a')){var _0x278d32={};_0x278d32[_0x58c6a0[_0x3689('0x3b')]]={'$like':'%'+_0x4659b0[_0x3689('0x2a')][_0x3689('0x3c')]+'%'};return _0x278d32;}})});}_0x8fdf9b=_[_0x3689('0x37')]({},_0x8fdf9b,_0x4659b0[_0x3689('0x3d')]);var _0x38e90d={'where':_0x8fdf9b[_0x3689('0x35')]};return db[_0x3689('0x29')][_0x3689('0x1d')](_0x38e90d)[_0x3689('0x24')](function(_0x5b1db1){_0x378d19[_0x3689('0x1d')]=_0x5b1db1;if(_0x4659b0['query'][_0x3689('0x3e')]){_0x8fdf9b['include']=[{'all':!![]}];}return db[_0x3689('0x29')][_0x3689('0x3f')](_0x8fdf9b);})['then'](function(_0x42cc0e){_0x378d19[_0x3689('0x40')]=_0x42cc0e;return _0x378d19;})[_0x3689('0x24')](respondWithFilteredResult(_0x776da8,_0x8fdf9b))[_0x3689('0x41')](handleError(_0x776da8,null));};exports[_0x3689('0x42')]=function(_0xcf3db1,_0x3b61bf){var _0x13b25c={'raw':!![],'where':{'id':_0xcf3db1[_0x3689('0x43')]['id']}},_0x2c9d56={};_0x2c9d56[_0x3689('0x2e')]=_[_0x3689('0x2b')](db[_0x3689('0x29')]['rawAttributes']);_0x2c9d56[_0x3689('0x2a')]=_[_0x3689('0x2b')](_0xcf3db1[_0x3689('0x2a')]);_0x2c9d56['filters']=_[_0x3689('0x2d')](_0x2c9d56[_0x3689('0x2e')],_0x2c9d56['query']);_0x13b25c[_0x3689('0x2f')]=_[_0x3689('0x2d')](_0x2c9d56[_0x3689('0x2e')],qs[_0x3689('0x30')](_0xcf3db1[_0x3689('0x2a')]['fields']));_0x13b25c[_0x3689('0x2f')]=_0x13b25c[_0x3689('0x2f')][_0x3689('0x31')]?_0x13b25c[_0x3689('0x2f')]:_0x2c9d56['model'];if(_0xcf3db1[_0x3689('0x2a')][_0x3689('0x3e')]){_0x13b25c[_0x3689('0x44')]=[{'all':!![]}];}_0x13b25c=_[_0x3689('0x37')]({},_0x13b25c,_0xcf3db1[_0x3689('0x3d')]);return db[_0x3689('0x29')][_0x3689('0x45')](_0x13b25c)['then'](handleEntityNotFound(_0x3b61bf,null))[_0x3689('0x24')](respondWithResult(_0x3b61bf,null))['catch'](handleError(_0x3b61bf,null));};exports[_0x3689('0x46')]=function(_0x442c8e,_0x1edd0f){return db[_0x3689('0x29')][_0x3689('0x46')](_0x442c8e['body'],{})[_0x3689('0x24')](respondWithResult(_0x1edd0f,0xc9))['catch'](handleError(_0x1edd0f,null));};exports[_0x3689('0x47')]=function(_0xbdb4ae,_0x1acc86){if(_0xbdb4ae[_0x3689('0x48')]['id']){delete _0xbdb4ae[_0x3689('0x48')]['id'];}return db[_0x3689('0x29')]['find']({'where':{'id':_0xbdb4ae['params']['id']}})['then'](handleEntityNotFound(_0x1acc86,null))[_0x3689('0x24')](saveUpdates(_0xbdb4ae[_0x3689('0x48')],null))['then'](respondWithResult(_0x1acc86,null))[_0x3689('0x41')](handleError(_0x1acc86,null));};exports[_0x3689('0x25')]=function(_0x3fff2c,_0x9d55ae){return db[_0x3689('0x29')]['find']({'where':{'id':_0x3fff2c[_0x3689('0x43')]['id']}})[_0x3689('0x24')](handleEntityNotFound(_0x9d55ae,null))[_0x3689('0x24')](removeEntity(_0x9d55ae,null))[_0x3689('0x41')](handleError(_0x9d55ae,null));};exports['describe']=function(_0x4d508f,_0x280b5b){return db[_0x3689('0x29')][_0x3689('0x49')]()['then'](respondWithResult(_0x280b5b,null))['catch'](handleError(_0x280b5b,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 062eef9..ac46b83 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 _0x78dc=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','exports','define','FaxQueueReport','report_fax_queue'];(function(_0x529f1c,_0x437ed1){var _0x4d57ab=function(_0x39d479){while(--_0x39d479){_0x529f1c['push'](_0x529f1c['shift']());}};_0x4d57ab(++_0x437ed1);}(_0x78dc,0x187));var _0xc78d=function(_0x14e27a,_0x3b4136){_0x14e27a=_0x14e27a-0x0;var _0x288688=_0x78dc[_0x14e27a];return _0x288688;};'use strict';var _=require(_0xc78d('0x0'));var util=require(_0xc78d('0x1'));var logger=require(_0xc78d('0x2'))(_0xc78d('0x3'));var moment=require(_0xc78d('0x4'));var BPromise=require(_0xc78d('0x5'));var rp=require(_0xc78d('0x6'));var fs=require('fs');var path=require(_0xc78d('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxQueueReport.attributes');module[_0xc78d('0x8')]=function(_0x5adaff,_0x57cc2e){return _0x5adaff[_0xc78d('0x9')](_0xc78d('0xa'),attributes,{'tableName':_0xc78d('0xb'),'paranoid':![],'indexes':[{'name':_0xc78d('0xc'),'fields':[_0xc78d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x80e0=['request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x455f9f,_0x14c2b8){var _0x17e4ec=function(_0xfb8483){while(--_0xfb8483){_0x455f9f['push'](_0x455f9f['shift']());}};_0x17e4ec(++_0x14c2b8);}(_0x80e0,0xa0));var _0x080e=function(_0x56fa11,_0x26d830){_0x56fa11=_0x56fa11-0x0;var _0x5ec4a1=_0x80e0[_0x56fa11];return _0x5ec4a1;};'use strict';var _=require(_0x080e('0x0'));var util=require(_0x080e('0x1'));var logger=require(_0x080e('0x2'))('api');var moment=require(_0x080e('0x3'));var BPromise=require(_0x080e('0x4'));var rp=require(_0x080e('0x5'));var fs=require('fs');var path=require(_0x080e('0x6'));var rimraf=require(_0x080e('0x7'));var config=require(_0x080e('0x8'));var attributes=require(_0x080e('0x9'));module[_0x080e('0xa')]=function(_0xeb1853,_0xaf43b2){return _0xeb1853[_0x080e('0xb')](_0x080e('0xc'),attributes,{'tableName':_0x080e('0xd'),'paranoid':![],'indexes':[{'name':_0x080e('0xe'),'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 5003953..89f3de7 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 _0xa20a=['FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','create','body','options','raw','CreateFaxQueueReport','stringify','FaxQueueReport','update','where','attributes','UpdateFaxQueueReport','debug','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info'];(function(_0x3d259b,_0x29f950){var _0x108d50=function(_0x5b06c9){while(--_0x5b06c9){_0x3d259b['push'](_0x3d259b['shift']());}};_0x108d50(++_0x29f950);}(_0xa20a,0x74));var _0xaa20=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xa20a[_0x2070da];return _0x4f9fe1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaa20('0x0'));var BPromise=require(_0xaa20('0x1'));var rs=require(_0xaa20('0x2'));var fs=require('fs');var Redis=require(_0xaa20('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaa20('0x4'));var logger=require(_0xaa20('0x5'))(_0xaa20('0x6'));var config=require(_0xaa20('0x7'));var jayson=require(_0xaa20('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x413b88,_0x6d1518,_0x23a712){return new BPromise(function(_0x181df0,_0x271ed1){return client[_0xaa20('0x9')](_0x413b88,_0x23a712)[_0xaa20('0xa')](function(_0x12d403){logger[_0xaa20('0xb')](_0xaa20('0xc'),_0x6d1518,_0xaa20('0xd'));logger['debug'](_0xaa20('0xe'),_0x6d1518,_0xaa20('0xd'),JSON['stringify'](_0x12d403));if(_0x12d403[_0xaa20('0xf')]){if(_0x12d403[_0xaa20('0xf')][_0xaa20('0x10')]===0x1f4){logger[_0xaa20('0xf')](_0xaa20('0xc'),_0x6d1518,_0x12d403[_0xaa20('0xf')]['message']);return _0x271ed1(_0x12d403[_0xaa20('0xf')][_0xaa20('0x11')]);}logger[_0xaa20('0xf')](_0xaa20('0xc'),_0x6d1518,_0x12d403[_0xaa20('0xf')][_0xaa20('0x11')]);return _0x181df0(_0x12d403[_0xaa20('0xf')][_0xaa20('0x11')]);}else{logger[_0xaa20('0xb')](_0xaa20('0xc'),_0x6d1518,_0xaa20('0xd'));_0x181df0(_0x12d403[_0xaa20('0x12')][_0xaa20('0x11')]);}})[_0xaa20('0x13')](function(_0x34ddb9){logger[_0xaa20('0xf')](_0xaa20('0xc'),_0x6d1518,_0x34ddb9);_0x271ed1(_0x34ddb9);});});}exports['CreateFaxQueueReport']=function(_0x2acd8d){var _0x4c151c=this;return new Promise(function(_0x278b6a,_0x2a1683){return db['FaxQueueReport'][_0xaa20('0x14')](_0x2acd8d[_0xaa20('0x15')],{'raw':_0x2acd8d[_0xaa20('0x16')]?_0x2acd8d[_0xaa20('0x16')][_0xaa20('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4ace68){logger['info']('CreateFaxQueueReport',_0x2acd8d);logger['debug'](_0xaa20('0x18'),_0x2acd8d,JSON[_0xaa20('0x19')](_0x4ace68));_0x278b6a(_0x4ace68);})[_0xaa20('0x13')](function(_0x1766f5){logger[_0xaa20('0xf')](_0xaa20('0x18'),_0x1766f5[_0xaa20('0x11')],_0x2acd8d);_0x2a1683(_0x4c151c[_0xaa20('0xf')](0x1f4,_0x1766f5[_0xaa20('0x11')]));});});};exports['UpdateFaxQueueReport']=function(_0x5a2905){var _0xc4ba0b=this;return new Promise(function(_0x27bdcb,_0x55ac29){return db[_0xaa20('0x1a')][_0xaa20('0x1b')](_0x5a2905['body'],{'raw':_0x5a2905[_0xaa20('0x16')]?_0x5a2905[_0xaa20('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a2905[_0xaa20('0x16')]?_0x5a2905['options'][_0xaa20('0x1c')]||null:null,'attributes':_0x5a2905[_0xaa20('0x16')]?_0x5a2905[_0xaa20('0x16')][_0xaa20('0x1d')]||null:null,'limit':_0x5a2905[_0xaa20('0x16')]?_0x5a2905[_0xaa20('0x16')]['limit']||null:null})[_0xaa20('0xa')](function(_0x5e6d4f){logger['info'](_0xaa20('0x1e'),_0x5a2905);logger[_0xaa20('0x1f')](_0xaa20('0x1e'),_0x5a2905,JSON[_0xaa20('0x19')](_0x5e6d4f));_0x27bdcb(_0x5e6d4f);})['catch'](function(_0x4d46fc){logger[_0xaa20('0xf')](_0xaa20('0x1e'),_0x4d46fc['message'],_0x5a2905);_0x55ac29(_0xc4ba0b[_0xaa20('0xf')](0x1f4,_0x4d46fc[_0xaa20('0x11')]));});});}; \ No newline at end of file +var _0x3d2f=['update','where','attributes','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','stringify','UpdateFaxQueueReport'];(function(_0x58106d,_0x135852){var _0x3fcf5a=function(_0x1e1a1d){while(--_0x1e1a1d){_0x58106d['push'](_0x58106d['shift']());}};_0x3fcf5a(++_0x135852);}(_0x3d2f,0x18f));var _0xf3d2=function(_0x2a4f57,_0x57ac66){_0x2a4f57=_0x2a4f57-0x0;var _0x50c18e=_0x3d2f[_0x2a4f57];return _0x50c18e;};'use strict';var _=require(_0xf3d2('0x0'));var util=require(_0xf3d2('0x1'));var moment=require('moment');var BPromise=require(_0xf3d2('0x2'));var rs=require(_0xf3d2('0x3'));var fs=require('fs');var Redis=require(_0xf3d2('0x4'));var db=require(_0xf3d2('0x5'))['db'];var utils=require(_0xf3d2('0x6'));var logger=require(_0xf3d2('0x7'))(_0xf3d2('0x8'));var config=require('../../config/environment');var jayson=require(_0xf3d2('0x9'));var client=jayson[_0xf3d2('0xa')][_0xf3d2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf9a0c9,_0x23edba,_0x57f94b){return new BPromise(function(_0x26f330,_0x3f86f6){return client['request'](_0xf9a0c9,_0x57f94b)[_0xf3d2('0xc')](function(_0x4ef134){logger[_0xf3d2('0xd')](_0xf3d2('0xe'),_0x23edba,_0xf3d2('0xf'));logger[_0xf3d2('0x10')](_0xf3d2('0x11'),_0x23edba,_0xf3d2('0xf'),JSON['stringify'](_0x4ef134));if(_0x4ef134[_0xf3d2('0x12')]){if(_0x4ef134[_0xf3d2('0x12')]['code']===0x1f4){logger[_0xf3d2('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x23edba,_0x4ef134[_0xf3d2('0x12')][_0xf3d2('0x13')]);return _0x3f86f6(_0x4ef134[_0xf3d2('0x12')]['message']);}logger[_0xf3d2('0x12')](_0xf3d2('0xe'),_0x23edba,_0x4ef134[_0xf3d2('0x12')][_0xf3d2('0x13')]);return _0x26f330(_0x4ef134[_0xf3d2('0x12')][_0xf3d2('0x13')]);}else{logger['info'](_0xf3d2('0xe'),_0x23edba,_0xf3d2('0xf'));_0x26f330(_0x4ef134[_0xf3d2('0x14')][_0xf3d2('0x13')]);}})[_0xf3d2('0x15')](function(_0x3daaaf){logger[_0xf3d2('0x12')](_0xf3d2('0xe'),_0x23edba,_0x3daaaf);_0x3f86f6(_0x3daaaf);});});}exports[_0xf3d2('0x16')]=function(_0x5a4afd){var _0x454ab3=this;return new Promise(function(_0x9bb587,_0x567059){return db[_0xf3d2('0x17')][_0xf3d2('0x18')](_0x5a4afd[_0xf3d2('0x19')],{'raw':_0x5a4afd['options']?_0x5a4afd[_0xf3d2('0x1a')][_0xf3d2('0x1b')]===undefined?!![]:![]:!![]})[_0xf3d2('0xc')](function(_0x22eb78){logger[_0xf3d2('0xd')](_0xf3d2('0x16'),_0x5a4afd);logger[_0xf3d2('0x10')](_0xf3d2('0x16'),_0x5a4afd,JSON[_0xf3d2('0x1c')](_0x22eb78));_0x9bb587(_0x22eb78);})[_0xf3d2('0x15')](function(_0x5584ac){logger[_0xf3d2('0x12')](_0xf3d2('0x16'),_0x5584ac[_0xf3d2('0x13')],_0x5a4afd);_0x567059(_0x454ab3[_0xf3d2('0x12')](0x1f4,_0x5584ac[_0xf3d2('0x13')]));});});};exports[_0xf3d2('0x1d')]=function(_0x1d1b44){var _0x39f9a8=this;return new Promise(function(_0x11eed0,_0x5eadd6){return db[_0xf3d2('0x17')][_0xf3d2('0x1e')](_0x1d1b44['body'],{'raw':_0x1d1b44[_0xf3d2('0x1a')]?_0x1d1b44['options'][_0xf3d2('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d1b44['options']?_0x1d1b44[_0xf3d2('0x1a')][_0xf3d2('0x1f')]||null:null,'attributes':_0x1d1b44['options']?_0x1d1b44['options'][_0xf3d2('0x20')]||null:null,'limit':_0x1d1b44[_0xf3d2('0x1a')]?_0x1d1b44[_0xf3d2('0x1a')]['limit']||null:null})[_0xf3d2('0xc')](function(_0x3cdb21){logger[_0xf3d2('0xd')]('UpdateFaxQueueReport',_0x1d1b44);logger[_0xf3d2('0x10')](_0xf3d2('0x1d'),_0x1d1b44,JSON['stringify'](_0x3cdb21));_0x11eed0(_0x3cdb21);})['catch'](function(_0x187c53){logger[_0xf3d2('0x12')](_0xf3d2('0x1d'),_0x187c53['message'],_0x1d1b44);_0x5eadd6(_0x39f9a8[_0xf3d2('0x12')](0x1f4,_0x187c53[_0xf3d2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 7400745..2d4bae2 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 _0x6075=['show','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x1d6bcc,_0x2a1fad){var _0x249488=function(_0x2d3872){while(--_0x2d3872){_0x1d6bcc['push'](_0x1d6bcc['shift']());}};_0x249488(++_0x2a1fad);}(_0x6075,0x1c0));var _0x5607=function(_0x321161,_0x1bb940){_0x321161=_0x321161-0x0;var _0x156b2b=_0x6075[_0x321161];return _0x156b2b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5607('0x0'));var timeout=require(_0x5607('0x1'));var express=require(_0x5607('0x2'));var router=express[_0x5607('0x3')]();var auth=require(_0x5607('0x4'));var interaction=require(_0x5607('0x5'));var config=require('../../config/environment');var controller=require(_0x5607('0x6'));router[_0x5607('0x7')]('/',auth[_0x5607('0x8')](),controller[_0x5607('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x5607('0xa')]);router[_0x5607('0x7')](_0x5607('0xb'),auth[_0x5607('0x8')](),controller[_0x5607('0xc')]);router[_0x5607('0xd')]('/',auth[_0x5607('0x8')](),controller[_0x5607('0xe')]);router[_0x5607('0xf')](_0x5607('0xb'),auth[_0x5607('0x8')](),controller[_0x5607('0x10')]);router[_0x5607('0x11')](_0x5607('0xb'),auth['isAuthenticated'](),controller[_0x5607('0x12')]);module[_0x5607('0x13')]=router; \ No newline at end of file +var _0x422c=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','create','put','update','destroy','multer','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x422c,0x9c));var _0xc422=function(_0x4fbd61,_0x4d0605){_0x4fbd61=_0x4fbd61-0x0;var _0x579ea5=_0x422c[_0x4fbd61];return _0x579ea5;};'use strict';var multer=require(_0xc422('0x0'));var util=require('util');var path=require(_0xc422('0x1'));var timeout=require(_0xc422('0x2'));var express=require(_0xc422('0x3'));var router=express['Router']();var auth=require(_0xc422('0x4'));var interaction=require(_0xc422('0x5'));var config=require(_0xc422('0x6'));var controller=require('./faxQueueReport.controller');router[_0xc422('0x7')]('/',auth[_0xc422('0x8')](),controller['index']);router[_0xc422('0x7')]('/describe',auth[_0xc422('0x8')](),controller[_0xc422('0x9')]);router[_0xc422('0x7')](_0xc422('0xa'),auth['isAuthenticated'](),controller[_0xc422('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc422('0xc')]);router[_0xc422('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xc422('0xe')]);router['delete'](_0xc422('0xa'),auth[_0xc422('0x8')](),controller[_0xc422('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index d268206..632e60b 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 _0xadf7=['agent','queue','DATE','NOW','moment','ENUM','account'];(function(_0x2113f8,_0x3c4c77){var _0x10a531=function(_0x20adca){while(--_0x20adca){_0x2113f8['push'](_0x2113f8['shift']());}};_0x10a531(++_0x3c4c77);}(_0xadf7,0x107));var _0x7adf=function(_0x348f8e,_0x36250d){_0x348f8e=_0x348f8e-0x0;var _0x212261=_0xadf7[_0x348f8e];return _0x212261;};'use strict';var moment=require(_0x7adf('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7adf('0x1')](_0x7adf('0x2'),_0x7adf('0x3'),_0x7adf('0x4')),'allowNull':![],'defaultValue':_0x7adf('0x4')},'transferredAt':{'type':Sequelize[_0x7adf('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x7adf('0x6')]}}; \ No newline at end of file +var _0xd09e=['STRING','ENUM','queue','DATE','NOW','sequelize','exports'];(function(_0x502245,_0x4aa068){var _0x57544c=function(_0x2c57be){while(--_0x2c57be){_0x502245['push'](_0x502245['shift']());}};_0x57544c(++_0x4aa068);}(_0xd09e,0x1e8));var _0xed09=function(_0x2399a1,_0x38a4c8){_0x2399a1=_0x2399a1-0x0;var _0x272545=_0xd09e[_0x2399a1];return _0x272545;};'use strict';var moment=require('moment');var Sequelize=require(_0xed09('0x0'));module[_0xed09('0x1')]={'uniqueid':{'type':Sequelize[_0xed09('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xed09('0x3')]('account','agent',_0xed09('0x4')),'allowNull':![],'defaultValue':_0xed09('0x4')},'transferredAt':{'type':Sequelize[_0xed09('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xed09('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 4de147a..bf1402d 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 _0xe2d2=['params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','end','json','count','offset','limit','status','set','Content-Range','update','then','error','name','send','FaxTransferReport','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','catch','show','intersection','options','find','create','body','destroy'];(function(_0xc90fbf,_0x5d0d57){var _0x1acc40=function(_0x4b30f4){while(--_0x4b30f4){_0xc90fbf['push'](_0xc90fbf['shift']());}};_0x1acc40(++_0x5d0d57);}(_0xe2d2,0x1ec));var _0x2e2d=function(_0x3b3d83,_0x3d2483){_0x3b3d83=_0x3b3d83-0x0;var _0x34d8d2=_0xe2d2[_0x3b3d83];return _0x34d8d2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2e2d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2e2d('0x1'));var rp=require(_0x2e2d('0x2'));var moment=require(_0x2e2d('0x3'));var BPromise=require(_0x2e2d('0x4'));var Mustache=require(_0x2e2d('0x5'));var util=require(_0x2e2d('0x6'));var path=require(_0x2e2d('0x7'));var sox=require(_0x2e2d('0x8'));var csv=require(_0x2e2d('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2e2d('0xa'));var jsforce=require(_0x2e2d('0xb'));var deskjs=require(_0x2e2d('0xc'));var toCsv=require(_0x2e2d('0x9'));var querystring=require(_0x2e2d('0xd'));var Papa=require(_0x2e2d('0xe'));var Redis=require(_0x2e2d('0xf'));var authService=require(_0x2e2d('0x10'));var qs=require(_0x2e2d('0x11'));var hardwareService=require(_0x2e2d('0x12'));var logger=require(_0x2e2d('0x13'))('api');var utils=require(_0x2e2d('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ec3a9,_0x29ed56){_0x29ed56=_0x29ed56||0xcc;return function(_0x199698){if(_0x199698){return _0x4ec3a9[_0x2e2d('0x15')](_0x29ed56);}return _0x4ec3a9['status'](_0x29ed56)[_0x2e2d('0x16')]();};}function respondWithResult(_0x32fa9e,_0x31c41e){_0x31c41e=_0x31c41e||0xc8;return function(_0x19a458){if(_0x19a458){return _0x32fa9e['status'](_0x31c41e)[_0x2e2d('0x17')](_0x19a458);}};}function respondWithFilteredResult(_0x56ea22,_0x359752){return function(_0x5026c7){if(_0x5026c7){var _0x190bf2=_0x5026c7[_0x2e2d('0x18')],_0x1f06a2=_0x359752[_0x2e2d('0x19')],_0x1a3f9f=_0x359752['offset']+_0x359752[_0x2e2d('0x1a')],_0x4514b8;if(_0x1a3f9f>=_0x190bf2){_0x1a3f9f=_0x190bf2;_0x4514b8=0xc8;}else{_0x4514b8=0xce;}_0x56ea22[_0x2e2d('0x1b')](_0x4514b8);return _0x56ea22[_0x2e2d('0x1c')](_0x2e2d('0x1d'),_0x1f06a2+'-'+_0x1a3f9f+'/'+_0x190bf2)[_0x2e2d('0x17')](_0x5026c7);}return null;};}function patchUpdates(_0x331e7e){return function(_0x45902d){try{jsonpatch['apply'](_0x45902d,_0x331e7e,!![]);}catch(_0x4bae34){return BPromise['reject'](_0x4bae34);}return _0x45902d['save']();};}function saveUpdates(_0x27bb26,_0x22483c){return function(_0x581176){if(_0x581176){return _0x581176[_0x2e2d('0x1e')](_0x27bb26)['then'](function(_0x22316c){return _0x22316c;});}return null;};}function removeEntity(_0x5971ef,_0x298785){return function(_0x100959){if(_0x100959){return _0x100959['destroy']()[_0x2e2d('0x1f')](function(){_0x5971ef[_0x2e2d('0x1b')](0xcc)[_0x2e2d('0x16')]();});}};}function handleEntityNotFound(_0x5bacc5,_0x365df9){return function(_0x59b7b0){if(!_0x59b7b0){_0x5bacc5['sendStatus'](0x194);}return _0x59b7b0;};}function handleError(_0x59fa67,_0x559ada){_0x559ada=_0x559ada||0x1f4;return function(_0x49ef7d){logger[_0x2e2d('0x20')](_0x49ef7d['stack']);if(_0x49ef7d[_0x2e2d('0x21')]){delete _0x49ef7d[_0x2e2d('0x21')];}_0x59fa67[_0x2e2d('0x1b')](_0x559ada)[_0x2e2d('0x22')](_0x49ef7d);};}exports['index']=function(_0x5e4752,_0x24235d){var _0xe27934={},_0x3964e0={},_0xd19744={'count':0x0,'rows':[]};var _0x706462=db[_0x2e2d('0x23')][_0x2e2d('0x24')];_0x3964e0[_0x2e2d('0x25')]=_['keys'](_0x706462);_0x3964e0['query']=_[_0x2e2d('0x26')](_0x5e4752[_0x2e2d('0x27')]);_0x3964e0[_0x2e2d('0x28')]=_['intersection'](_0x3964e0[_0x2e2d('0x25')],_0x3964e0[_0x2e2d('0x27')]);_0xe27934[_0x2e2d('0x29')]=_['intersection'](_0x3964e0['model'],qs[_0x2e2d('0x2a')](_0x5e4752[_0x2e2d('0x27')]['fields']));_0xe27934[_0x2e2d('0x29')]=_0xe27934[_0x2e2d('0x29')][_0x2e2d('0x2b')]?_0xe27934[_0x2e2d('0x29')]:_0x3964e0[_0x2e2d('0x25')];if(!_0x5e4752[_0x2e2d('0x27')][_0x2e2d('0x2c')](_0x2e2d('0x2d'))){_0xe27934['limit']=qs[_0x2e2d('0x1a')](_0x5e4752['query']['limit']);_0xe27934['offset']=qs['offset'](_0x5e4752['query']['offset']);}_0xe27934[_0x2e2d('0x2e')]=qs[_0x2e2d('0x2f')](_0x5e4752[_0x2e2d('0x27')][_0x2e2d('0x2f')]);_0xe27934[_0x2e2d('0x30')]=qs[_0x2e2d('0x28')](_[_0x2e2d('0x31')](_0x5e4752[_0x2e2d('0x27')],_0x3964e0[_0x2e2d('0x28')]));if(_0x5e4752['query'][_0x2e2d('0x32')]){_0xe27934[_0x2e2d('0x30')]=_[_0x2e2d('0x33')](_0xe27934[_0x2e2d('0x30')],{'$or':_[_0x2e2d('0x34')](_0x706462,function(_0x2422e6){if(_0x2422e6[_0x2e2d('0x35')][_0x2e2d('0x36')]!==_0x2e2d('0x37')){var _0x2fd017={};_0x2fd017[_0x2422e6[_0x2e2d('0x38')]]={'$like':'%'+_0x5e4752[_0x2e2d('0x27')][_0x2e2d('0x32')]+'%'};return _0x2fd017;}})});}_0xe27934=_[_0x2e2d('0x33')]({},_0xe27934,_0x5e4752['options']);var _0x3ac9f3={'where':_0xe27934[_0x2e2d('0x30')]};return db[_0x2e2d('0x23')][_0x2e2d('0x18')](_0x3ac9f3)[_0x2e2d('0x1f')](function(_0x58df84){_0xd19744[_0x2e2d('0x18')]=_0x58df84;if(_0x5e4752[_0x2e2d('0x27')][_0x2e2d('0x39')]){_0xe27934[_0x2e2d('0x3a')]=[{'all':!![]}];}return db[_0x2e2d('0x23')][_0x2e2d('0x3b')](_0xe27934);})[_0x2e2d('0x1f')](function(_0x2e3379){_0xd19744['rows']=_0x2e3379;return _0xd19744;})['then'](respondWithFilteredResult(_0x24235d,_0xe27934))[_0x2e2d('0x3c')](handleError(_0x24235d,null));};exports[_0x2e2d('0x3d')]=function(_0x36464e,_0x498911){var _0x32da5e={'raw':!![],'where':{'id':_0x36464e['params']['id']}},_0x1e6a5f={};_0x1e6a5f[_0x2e2d('0x25')]=_[_0x2e2d('0x26')](db['FaxTransferReport']['rawAttributes']);_0x1e6a5f[_0x2e2d('0x27')]=_['keys'](_0x36464e[_0x2e2d('0x27')]);_0x1e6a5f[_0x2e2d('0x28')]=_[_0x2e2d('0x3e')](_0x1e6a5f['model'],_0x1e6a5f[_0x2e2d('0x27')]);_0x32da5e[_0x2e2d('0x29')]=_['intersection'](_0x1e6a5f[_0x2e2d('0x25')],qs[_0x2e2d('0x2a')](_0x36464e[_0x2e2d('0x27')][_0x2e2d('0x2a')]));_0x32da5e[_0x2e2d('0x29')]=_0x32da5e[_0x2e2d('0x29')][_0x2e2d('0x2b')]?_0x32da5e['attributes']:_0x1e6a5f['model'];if(_0x36464e[_0x2e2d('0x27')][_0x2e2d('0x39')]){_0x32da5e[_0x2e2d('0x3a')]=[{'all':!![]}];}_0x32da5e=_[_0x2e2d('0x33')]({},_0x32da5e,_0x36464e[_0x2e2d('0x3f')]);return db[_0x2e2d('0x23')][_0x2e2d('0x40')](_0x32da5e)['then'](handleEntityNotFound(_0x498911,null))[_0x2e2d('0x1f')](respondWithResult(_0x498911,null))[_0x2e2d('0x3c')](handleError(_0x498911,null));};exports[_0x2e2d('0x41')]=function(_0x5e9942,_0x17f0bc){return db[_0x2e2d('0x23')][_0x2e2d('0x41')](_0x5e9942[_0x2e2d('0x42')],{})[_0x2e2d('0x1f')](respondWithResult(_0x17f0bc,0xc9))[_0x2e2d('0x3c')](handleError(_0x17f0bc,null));};exports[_0x2e2d('0x1e')]=function(_0x1afbab,_0x383554){if(_0x1afbab[_0x2e2d('0x42')]['id']){delete _0x1afbab[_0x2e2d('0x42')]['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x1afbab['params']['id']}})[_0x2e2d('0x1f')](handleEntityNotFound(_0x383554,null))[_0x2e2d('0x1f')](saveUpdates(_0x1afbab[_0x2e2d('0x42')],null))[_0x2e2d('0x1f')](respondWithResult(_0x383554,null))[_0x2e2d('0x3c')](handleError(_0x383554,null));};exports[_0x2e2d('0x43')]=function(_0x48526d,_0x40a879){return db[_0x2e2d('0x23')][_0x2e2d('0x40')]({'where':{'id':_0x48526d[_0x2e2d('0x44')]['id']}})[_0x2e2d('0x1f')](handleEntityNotFound(_0x40a879,null))[_0x2e2d('0x1f')](removeEntity(_0x40a879,null))['catch'](handleError(_0x40a879,null));};exports['describe']=function(_0x4a04fb,_0x58c9a7){return db[_0x2e2d('0x23')][_0x2e2d('0x45')]()[_0x2e2d('0x1f')](respondWithResult(_0x58c9a7,null))[_0x2e2d('0x3c')](handleError(_0x58c9a7,null));}; \ No newline at end of file +var _0x728a=['lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','limit','set','apply','reject','then','destroy','end','stack','name','send','index','FaxTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','sort','pick','where','map','type','key','VIRTUAL','field','filter','merge','count','includeAll','include','findAll','rows','show','params','length','options','catch','create','body','update','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x728a,0x115));var _0xa728=function(_0x4a7414,_0x7c53e9){_0x4a7414=_0x4a7414-0x0;var _0x38a334=_0x728a[_0x4a7414];return _0x38a334;};'use strict';var pdf=require(_0xa728('0x0'));var emlformat=require(_0xa728('0x1'));var rimraf=require(_0xa728('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa728('0x3'));var rp=require(_0xa728('0x4'));var moment=require(_0xa728('0x5'));var BPromise=require(_0xa728('0x6'));var Mustache=require(_0xa728('0x7'));var util=require(_0xa728('0x8'));var path=require('path');var sox=require(_0xa728('0x9'));var csv=require(_0xa728('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa728('0xb'));var squel=require(_0xa728('0xc'));var crypto=require('crypto');var jsforce=require(_0xa728('0xd'));var deskjs=require(_0xa728('0xe'));var toCsv=require(_0xa728('0xa'));var querystring=require(_0xa728('0xf'));var Papa=require(_0xa728('0x10'));var Redis=require(_0xa728('0x11'));var authService=require(_0xa728('0x12'));var qs=require(_0xa728('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa728('0x14'))(_0xa728('0x15'));var utils=require(_0xa728('0x16'));var config=require('../../config/environment');var db=require(_0xa728('0x17'))['db'];function respondWithStatusCode(_0x26adf6,_0x133a5e){_0x133a5e=_0x133a5e||0xcc;return function(_0x2420f9){if(_0x2420f9){return _0x26adf6['sendStatus'](_0x133a5e);}return _0x26adf6[_0xa728('0x18')](_0x133a5e)['end']();};}function respondWithResult(_0x3d507f,_0x49e9b5){_0x49e9b5=_0x49e9b5||0xc8;return function(_0x5672d7){if(_0x5672d7){return _0x3d507f[_0xa728('0x18')](_0x49e9b5)[_0xa728('0x19')](_0x5672d7);}};}function respondWithFilteredResult(_0x3fa345,_0x282f46){return function(_0x5005b0){if(_0x5005b0){var _0x19abd4=_0x5005b0['count'],_0x1d0385=_0x282f46[_0xa728('0x1a')],_0x8a5034=_0x282f46[_0xa728('0x1a')]+_0x282f46[_0xa728('0x1b')],_0x1aa6e9;if(_0x8a5034>=_0x19abd4){_0x8a5034=_0x19abd4;_0x1aa6e9=0xc8;}else{_0x1aa6e9=0xce;}_0x3fa345[_0xa728('0x18')](_0x1aa6e9);return _0x3fa345[_0xa728('0x1c')]('Content-Range',_0x1d0385+'-'+_0x8a5034+'/'+_0x19abd4)[_0xa728('0x19')](_0x5005b0);}return null;};}function patchUpdates(_0x245d1c){return function(_0x103a69){try{jsonpatch[_0xa728('0x1d')](_0x103a69,_0x245d1c,!![]);}catch(_0x83dde){return BPromise[_0xa728('0x1e')](_0x83dde);}return _0x103a69['save']();};}function saveUpdates(_0x194cf3,_0x1c9145){return function(_0x28fff7){if(_0x28fff7){return _0x28fff7['update'](_0x194cf3)[_0xa728('0x1f')](function(_0x3bb799){return _0x3bb799;});}return null;};}function removeEntity(_0x4c75a8,_0x2a6687){return function(_0x567742){if(_0x567742){return _0x567742[_0xa728('0x20')]()[_0xa728('0x1f')](function(){_0x4c75a8[_0xa728('0x18')](0xcc)[_0xa728('0x21')]();});}};}function handleEntityNotFound(_0x5a937c,_0x2b77af){return function(_0x56dbad){if(!_0x56dbad){_0x5a937c['sendStatus'](0x194);}return _0x56dbad;};}function handleError(_0x230154,_0x3c23ab){_0x3c23ab=_0x3c23ab||0x1f4;return function(_0x5b116f){logger['error'](_0x5b116f[_0xa728('0x22')]);if(_0x5b116f[_0xa728('0x23')]){delete _0x5b116f[_0xa728('0x23')];}_0x230154['status'](_0x3c23ab)[_0xa728('0x24')](_0x5b116f);};}exports[_0xa728('0x25')]=function(_0xff6fbb,_0xde27ab){var _0x184531={},_0x453ff1={},_0x269f43={'count':0x0,'rows':[]};var _0x22c290=db[_0xa728('0x26')][_0xa728('0x27')];_0x453ff1[_0xa728('0x28')]=_[_0xa728('0x29')](_0x22c290);_0x453ff1[_0xa728('0x2a')]=_[_0xa728('0x29')](_0xff6fbb[_0xa728('0x2a')]);_0x453ff1[_0xa728('0x2b')]=_[_0xa728('0x2c')](_0x453ff1['model'],_0x453ff1[_0xa728('0x2a')]);_0x184531[_0xa728('0x2d')]=_['intersection'](_0x453ff1[_0xa728('0x28')],qs[_0xa728('0x2e')](_0xff6fbb[_0xa728('0x2a')][_0xa728('0x2e')]));_0x184531[_0xa728('0x2d')]=_0x184531[_0xa728('0x2d')]['length']?_0x184531[_0xa728('0x2d')]:_0x453ff1[_0xa728('0x28')];if(!_0xff6fbb[_0xa728('0x2a')]['hasOwnProperty']('nolimit')){_0x184531[_0xa728('0x1b')]=qs[_0xa728('0x1b')](_0xff6fbb[_0xa728('0x2a')][_0xa728('0x1b')]);_0x184531[_0xa728('0x1a')]=qs[_0xa728('0x1a')](_0xff6fbb[_0xa728('0x2a')]['offset']);}_0x184531['order']=qs[_0xa728('0x2f')](_0xff6fbb[_0xa728('0x2a')][_0xa728('0x2f')]);_0x184531['where']=qs[_0xa728('0x2b')](_[_0xa728('0x30')](_0xff6fbb[_0xa728('0x2a')],_0x453ff1[_0xa728('0x2b')]));if(_0xff6fbb[_0xa728('0x2a')]['filter']){_0x184531[_0xa728('0x31')]=_['merge'](_0x184531[_0xa728('0x31')],{'$or':_[_0xa728('0x32')](_0x22c290,function(_0x4ca7e2){if(_0x4ca7e2[_0xa728('0x33')][_0xa728('0x34')]!==_0xa728('0x35')){var _0x43d22b={};_0x43d22b[_0x4ca7e2[_0xa728('0x36')]]={'$like':'%'+_0xff6fbb[_0xa728('0x2a')][_0xa728('0x37')]+'%'};return _0x43d22b;}})});}_0x184531=_[_0xa728('0x38')]({},_0x184531,_0xff6fbb['options']);var _0x39b412={'where':_0x184531[_0xa728('0x31')]};return db[_0xa728('0x26')][_0xa728('0x39')](_0x39b412)['then'](function(_0x2ac3b3){_0x269f43[_0xa728('0x39')]=_0x2ac3b3;if(_0xff6fbb[_0xa728('0x2a')][_0xa728('0x3a')]){_0x184531[_0xa728('0x3b')]=[{'all':!![]}];}return db[_0xa728('0x26')][_0xa728('0x3c')](_0x184531);})[_0xa728('0x1f')](function(_0x5099a0){_0x269f43[_0xa728('0x3d')]=_0x5099a0;return _0x269f43;})[_0xa728('0x1f')](respondWithFilteredResult(_0xde27ab,_0x184531))['catch'](handleError(_0xde27ab,null));};exports[_0xa728('0x3e')]=function(_0x39ae1e,_0x1eac70){var _0x3ff718={'raw':!![],'where':{'id':_0x39ae1e[_0xa728('0x3f')]['id']}},_0x450587={};_0x450587[_0xa728('0x28')]=_[_0xa728('0x29')](db['FaxTransferReport'][_0xa728('0x27')]);_0x450587[_0xa728('0x2a')]=_[_0xa728('0x29')](_0x39ae1e['query']);_0x450587[_0xa728('0x2b')]=_[_0xa728('0x2c')](_0x450587[_0xa728('0x28')],_0x450587['query']);_0x3ff718[_0xa728('0x2d')]=_[_0xa728('0x2c')](_0x450587['model'],qs[_0xa728('0x2e')](_0x39ae1e[_0xa728('0x2a')][_0xa728('0x2e')]));_0x3ff718[_0xa728('0x2d')]=_0x3ff718['attributes'][_0xa728('0x40')]?_0x3ff718['attributes']:_0x450587[_0xa728('0x28')];if(_0x39ae1e[_0xa728('0x2a')]['includeAll']){_0x3ff718['include']=[{'all':!![]}];}_0x3ff718=_[_0xa728('0x38')]({},_0x3ff718,_0x39ae1e[_0xa728('0x41')]);return db[_0xa728('0x26')]['find'](_0x3ff718)['then'](handleEntityNotFound(_0x1eac70,null))[_0xa728('0x1f')](respondWithResult(_0x1eac70,null))[_0xa728('0x42')](handleError(_0x1eac70,null));};exports[_0xa728('0x43')]=function(_0x38e90c,_0x26d801){return db[_0xa728('0x26')][_0xa728('0x43')](_0x38e90c[_0xa728('0x44')],{})[_0xa728('0x1f')](respondWithResult(_0x26d801,0xc9))[_0xa728('0x42')](handleError(_0x26d801,null));};exports[_0xa728('0x45')]=function(_0xcd426d,_0x2e7051){if(_0xcd426d[_0xa728('0x44')]['id']){delete _0xcd426d[_0xa728('0x44')]['id'];}return db[_0xa728('0x26')][_0xa728('0x46')]({'where':{'id':_0xcd426d[_0xa728('0x3f')]['id']}})[_0xa728('0x1f')](handleEntityNotFound(_0x2e7051,null))[_0xa728('0x1f')](saveUpdates(_0xcd426d[_0xa728('0x44')],null))['then'](respondWithResult(_0x2e7051,null))[_0xa728('0x42')](handleError(_0x2e7051,null));};exports['destroy']=function(_0x28fd61,_0x152dbb){return db[_0xa728('0x26')][_0xa728('0x46')]({'where':{'id':_0x28fd61[_0xa728('0x3f')]['id']}})[_0xa728('0x1f')](handleEntityNotFound(_0x152dbb,null))['then'](removeEntity(_0x152dbb,null))[_0xa728('0x42')](handleError(_0x152dbb,null));};exports[_0xa728('0x47')]=function(_0x2c3348,_0x509063){return db['FaxTransferReport'][_0xa728('0x47')]()[_0xa728('0x1f')](respondWithResult(_0x509063,null))[_0xa728('0x42')](handleError(_0x509063,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index ab44f1d..8e37d39 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 _0x2929=['FaxTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','path','../../config/environment','define'];(function(_0x1db45e,_0x4f3665){var _0x4b9b80=function(_0x43ed7f){while(--_0x43ed7f){_0x1db45e['push'](_0x1db45e['shift']());}};_0x4b9b80(++_0x4f3665);}(_0x2929,0x70));var _0x9292=function(_0x114ae1,_0x16a914){_0x114ae1=_0x114ae1-0x0;var _0x4b540d=_0x2929[_0x114ae1];return _0x4b540d;};'use strict';var _=require(_0x9292('0x0'));var util=require(_0x9292('0x1'));var logger=require(_0x9292('0x2'))(_0x9292('0x3'));var moment=require(_0x9292('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9292('0x5'));var rimraf=require('rimraf');var config=require(_0x9292('0x6'));var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x2a087f,_0x3d3010){return _0x2a087f[_0x9292('0x7')](_0x9292('0x8'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x9292('0x9'),'fields':[_0x9292('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0d82=['FaxTransferReport','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define'];(function(_0x367238,_0x22b7bf){var _0x1e2d90=function(_0x182275){while(--_0x182275){_0x367238['push'](_0x367238['shift']());}};_0x1e2d90(++_0x22b7bf);}(_0x0d82,0x147));var _0x20d8=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x0d82[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x20d8('0x0'));var util=require('util');var logger=require(_0x20d8('0x1'))(_0x20d8('0x2'));var moment=require('moment');var BPromise=require(_0x20d8('0x3'));var rp=require(_0x20d8('0x4'));var fs=require('fs');var path=require(_0x20d8('0x5'));var rimraf=require(_0x20d8('0x6'));var config=require(_0x20d8('0x7'));var attributes=require(_0x20d8('0x8'));module[_0x20d8('0x9')]=function(_0x445df5,_0x3eb6c6){return _0x445df5[_0x20d8('0xa')](_0x20d8('0xb'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x20d8('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index e287c6a..e7fb880 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 _0x824f=['error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x2e3ef6,_0x7d3c9a){var _0x4780b5=function(_0x40adbb){while(--_0x40adbb){_0x2e3ef6['push'](_0x2e3ef6['shift']());}};_0x4780b5(++_0x7d3c9a);}(_0x824f,0x16d));var _0xf824=function(_0x5de214,_0x107e9d){_0x5de214=_0x5de214-0x0;var _0x4df627=_0x824f[_0x5de214];return _0x4df627;};'use strict';var _=require(_0xf824('0x0'));var util=require('util');var moment=require(_0xf824('0x1'));var BPromise=require(_0xf824('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf824('0x3'));var db=require(_0xf824('0x4'))['db'];var utils=require(_0xf824('0x5'));var logger=require(_0xf824('0x6'))(_0xf824('0x7'));var config=require(_0xf824('0x8'));var jayson=require(_0xf824('0x9'));var client=jayson[_0xf824('0xa')][_0xf824('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11ae36,_0x2a8eff,_0x408ec7){return new BPromise(function(_0x98d09c,_0x1ebc8b){return client[_0xf824('0xc')](_0x11ae36,_0x408ec7)[_0xf824('0xd')](function(_0x3feffa){logger[_0xf824('0xe')](_0xf824('0xf'),_0x2a8eff,_0xf824('0x10'));logger[_0xf824('0x11')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x2a8eff,_0xf824('0x10'),JSON[_0xf824('0x12')](_0x3feffa));if(_0x3feffa[_0xf824('0x13')]){if(_0x3feffa[_0xf824('0x13')][_0xf824('0x14')]===0x1f4){logger['error'](_0xf824('0xf'),_0x2a8eff,_0x3feffa[_0xf824('0x13')][_0xf824('0x15')]);return _0x1ebc8b(_0x3feffa['error'][_0xf824('0x15')]);}logger[_0xf824('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x2a8eff,_0x3feffa[_0xf824('0x13')][_0xf824('0x15')]);return _0x98d09c(_0x3feffa[_0xf824('0x13')][_0xf824('0x15')]);}else{logger[_0xf824('0xe')](_0xf824('0xf'),_0x2a8eff,_0xf824('0x10'));_0x98d09c(_0x3feffa[_0xf824('0x16')][_0xf824('0x15')]);}})[_0xf824('0x17')](function(_0x5a4adf){logger[_0xf824('0x13')](_0xf824('0xf'),_0x2a8eff,_0x5a4adf);_0x1ebc8b(_0x5a4adf);});});} \ No newline at end of file +var _0x3f8f=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x2fee96,_0x2f735d){var _0x2e6ad1=function(_0x2c55ad){while(--_0x2c55ad){_0x2fee96['push'](_0x2fee96['shift']());}};_0x2e6ad1(++_0x2f735d);}(_0x3f8f,0x1db));var _0xf3f8=function(_0xa61b5f,_0x3fee56){_0xa61b5f=_0xa61b5f-0x0;var _0x5f249b=_0x3f8f[_0xa61b5f];return _0x5f249b;};'use strict';var _=require('lodash');var util=require(_0xf3f8('0x0'));var moment=require(_0xf3f8('0x1'));var BPromise=require(_0xf3f8('0x2'));var rs=require(_0xf3f8('0x3'));var fs=require('fs');var Redis=require(_0xf3f8('0x4'));var db=require(_0xf3f8('0x5'))['db'];var utils=require(_0xf3f8('0x6'));var logger=require(_0xf3f8('0x7'))(_0xf3f8('0x8'));var config=require('../../config/environment');var jayson=require(_0xf3f8('0x9'));var client=jayson[_0xf3f8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd74f0d,_0x55f0fa,_0x2906d9){return new BPromise(function(_0x2f368d,_0x55a2b6){return client[_0xf3f8('0xb')](_0xd74f0d,_0x2906d9)[_0xf3f8('0xc')](function(_0x5a8ec6){logger[_0xf3f8('0xd')](_0xf3f8('0xe'),_0x55f0fa,_0xf3f8('0xf'));logger[_0xf3f8('0x10')](_0xf3f8('0x11'),_0x55f0fa,_0xf3f8('0xf'),JSON[_0xf3f8('0x12')](_0x5a8ec6));if(_0x5a8ec6[_0xf3f8('0x13')]){if(_0x5a8ec6[_0xf3f8('0x13')][_0xf3f8('0x14')]===0x1f4){logger['error'](_0xf3f8('0xe'),_0x55f0fa,_0x5a8ec6[_0xf3f8('0x13')][_0xf3f8('0x15')]);return _0x55a2b6(_0x5a8ec6[_0xf3f8('0x13')][_0xf3f8('0x15')]);}logger[_0xf3f8('0x13')](_0xf3f8('0xe'),_0x55f0fa,_0x5a8ec6[_0xf3f8('0x13')]['message']);return _0x2f368d(_0x5a8ec6['error'][_0xf3f8('0x15')]);}else{logger[_0xf3f8('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x55f0fa,_0xf3f8('0xf'));_0x2f368d(_0x5a8ec6[_0xf3f8('0x16')]['message']);}})[_0xf3f8('0x17')](function(_0x4dbd91){logger[_0xf3f8('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x55f0fa,_0x4dbd91);_0x55a2b6(_0x4dbd91);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 5cf32b2..12f1790 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 _0x4b84=['./faxTransferReport.controller','get','isAuthenticated','show','post','put','/:id','update','delete','exports','multer','util','express','../../components/interaction/service','../../config/environment'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x4b84,0x1cc));var _0x44b8=function(_0x112fe3,_0x16b642){_0x112fe3=_0x112fe3-0x0;var _0x1ec903=_0x4b84[_0x112fe3];return _0x1ec903;};'use strict';var multer=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x44b8('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x44b8('0x3'));var config=require(_0x44b8('0x4'));var controller=require(_0x44b8('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x44b8('0x6')]('/describe',auth[_0x44b8('0x7')](),controller['describe']);router[_0x44b8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x44b8('0x8')]);router[_0x44b8('0x9')]('/',auth[_0x44b8('0x7')](),controller['create']);router[_0x44b8('0xa')](_0x44b8('0xb'),auth[_0x44b8('0x7')](),controller[_0x44b8('0xc')]);router[_0x44b8('0xd')](_0x44b8('0xb'),auth[_0x44b8('0x7')](),controller['destroy']);module[_0x44b8('0xe')]=router; \ No newline at end of file +var _0xac31=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','put'];(function(_0x18f7b2,_0x47d157){var _0x56b12b=function(_0xe0d15c){while(--_0xe0d15c){_0x18f7b2['push'](_0x18f7b2['shift']());}};_0x56b12b(++_0x47d157);}(_0xac31,0xca));var _0x1ac3=function(_0x299d13,_0x589b06){_0x299d13=_0x299d13-0x0;var _0x1feb32=_0xac31[_0x299d13];return _0x1feb32;};'use strict';var multer=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var path=require(_0x1ac3('0x2'));var timeout=require(_0x1ac3('0x3'));var express=require(_0x1ac3('0x4'));var router=express[_0x1ac3('0x5')]();var auth=require(_0x1ac3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1ac3('0x7'));var controller=require(_0x1ac3('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1ac3('0x9')]);router[_0x1ac3('0xa')](_0x1ac3('0xb'),auth[_0x1ac3('0xc')](),controller[_0x1ac3('0xd')]);router['get'](_0x1ac3('0xe'),auth['isAuthenticated'](),controller[_0x1ac3('0xf')]);router[_0x1ac3('0x10')]('/',auth[_0x1ac3('0xc')](),controller['create']);router[_0x1ac3('0x11')](_0x1ac3('0xe'),auth[_0x1ac3('0xc')](),controller[_0x1ac3('0x12')]);router[_0x1ac3('0x13')](_0x1ac3('0xe'),auth['isAuthenticated'](),controller[_0x1ac3('0x14')]);module[_0x1ac3('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 5eecc71..5e8f996 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 _0x7d62=['delete','destroy','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','isAuthenticated','create','post','update'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x7d62,0x6b));var _0x27d6=function(_0x4a328d,_0x4a5df0){_0x4a328d=_0x4a328d-0x0;var _0x277eb5=_0x7d62[_0x4a328d];return _0x277eb5;};'use strict';var multer=require('multer');var util=require(_0x27d6('0x0'));var path=require(_0x27d6('0x1'));var timeout=require(_0x27d6('0x2'));var express=require(_0x27d6('0x3'));var router=express['Router']();var auth=require(_0x27d6('0x4'));var interaction=require(_0x27d6('0x5'));var config=require('../../config/environment');var controller=require(_0x27d6('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x27d6('0x7')]);router[_0x27d6('0x8')](_0x27d6('0x9'),auth['isAuthenticated'](),controller[_0x27d6('0xa')]);router[_0x27d6('0x8')](_0x27d6('0xb'),auth['isAuthenticated'](),controller[_0x27d6('0xc')]);router[_0x27d6('0x8')](_0x27d6('0xd'),auth['isAuthenticated'](),controller[_0x27d6('0xe')]);router['post']('/',auth[_0x27d6('0xf')](),controller[_0x27d6('0x10')]);router[_0x27d6('0x11')](_0x27d6('0xb'),auth[_0x27d6('0xf')](),controller['addConfiguration']);router['put'](_0x27d6('0x9'),auth['isAuthenticated'](),controller[_0x27d6('0x12')]);router[_0x27d6('0x13')](_0x27d6('0x9'),auth['isAuthenticated'](),controller[_0x27d6('0x14')]);module['exports']=router; \ No newline at end of file +var _0x81e2=['./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','create','post','/:id/configurations','addConfiguration','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x5b3dc6,_0xfbef97){var _0xef41d1=function(_0x562a5e){while(--_0x562a5e){_0x5b3dc6['push'](_0x5b3dc6['shift']());}};_0xef41d1(++_0xfbef97);}(_0x81e2,0xb1));var _0x281e=function(_0x684690,_0x1ffbfd){_0x684690=_0x684690-0x0;var _0x5959b5=_0x81e2[_0x684690];return _0x5959b5;};'use strict';var multer=require(_0x281e('0x0'));var util=require(_0x281e('0x1'));var path=require('path');var timeout=require(_0x281e('0x2'));var express=require(_0x281e('0x3'));var router=express[_0x281e('0x4')]();var auth=require(_0x281e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x281e('0x6'));var controller=require(_0x281e('0x7'));router[_0x281e('0x8')]('/',auth[_0x281e('0x9')](),controller[_0x281e('0xa')]);router[_0x281e('0x8')](_0x281e('0xb'),auth[_0x281e('0x9')](),controller[_0x281e('0xc')]);router['get']('/:id/configurations',auth[_0x281e('0x9')](),controller[_0x281e('0xd')]);router[_0x281e('0x8')](_0x281e('0xe'),auth[_0x281e('0x9')](),controller['getFields']);router['post']('/',auth[_0x281e('0x9')](),controller[_0x281e('0xf')]);router[_0x281e('0x10')](_0x281e('0x11'),auth['isAuthenticated'](),controller[_0x281e('0x12')]);router[_0x281e('0x13')]('/:id',auth[_0x281e('0x9')](),controller[_0x281e('0x14')]);router['delete'](_0x281e('0xb'),auth[_0x281e('0x9')](),controller[_0x281e('0x15')]);module[_0x281e('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 497579d..6dfd651 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 _0x3f94=['newTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x4031db,_0x5bad3d){var _0x247fa6=function(_0x33dfc3){while(--_0x33dfc3){_0x4031db['push'](_0x4031db['shift']());}};_0x247fa6(++_0x5bad3d);}(_0x3f94,0xdf));var _0x43f9=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x3f94[_0x1f9f37];return _0x21c080;};'use strict';var Sequelize=require(_0x43f9('0x0'));module[_0x43f9('0x1')]={'name':{'type':Sequelize[_0x43f9('0x2')]},'description':{'type':Sequelize[_0x43f9('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x43f9('0x2')]},'authType':{'type':Sequelize[_0x43f9('0x3')]('basic'),'defaultValue':_0x43f9('0x4')},'password':{'type':Sequelize[_0x43f9('0x2')]},'consumerKey':{'type':Sequelize[_0x43f9('0x2')]},'consumerSecret':{'type':Sequelize[_0x43f9('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x43f9('0x2')]},'serverUrl':{'type':Sequelize[_0x43f9('0x2')]},'type':{'type':Sequelize[_0x43f9('0x3')]('integrationTab',_0x43f9('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xa103=['newTab','integrationTab','sequelize','STRING','ENUM','basic'];(function(_0x49e5c6,_0x4e9402){var _0x12aaee=function(_0x62a1e1){while(--_0x62a1e1){_0x49e5c6['push'](_0x49e5c6['shift']());}};_0x12aaee(++_0x4e9402);}(_0xa103,0xf8));var _0x3a10=function(_0x1c667c,_0x420cdd){_0x1c667c=_0x1c667c-0x0;var _0x438e46=_0xa103[_0x1c667c];return _0x438e46;};'use strict';var Sequelize=require(_0x3a10('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3a10('0x1')]},'username':{'type':Sequelize[_0x3a10('0x1')]},'remoteUri':{'type':Sequelize[_0x3a10('0x1')]},'authType':{'type':Sequelize[_0x3a10('0x2')]('basic'),'defaultValue':_0x3a10('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x3a10('0x1')]},'consumerSecret':{'type':Sequelize[_0x3a10('0x1')]},'token':{'type':Sequelize[_0x3a10('0x1')]},'tokenSecret':{'type':Sequelize[_0x3a10('0x1')]},'serverUrl':{'type':Sequelize[_0x3a10('0x1')]},'type':{'type':Sequelize[_0x3a10('0x2')]('integrationTab',_0x3a10('0x4')),'defaultValue':_0x3a10('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 190ddfe..f733f8c 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 _0xa9e0=['includeAll','include','findAll','rows','params','model','rawAttributes','find','body','findOne','DeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','authType','username','password','consumerKey','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','toString','concat','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','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','../../config/license/hardware','../../config/logger','../../components/integrations/configuration','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~!@#$%^&-_=+[{]}.','then','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','status','sendStatus','stack','name','send','index','DeskAccount','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','field','options'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x0a9e('0x13'));var jayson=require(_0x0a9e('0x14'));var client=jayson[_0x0a9e('0x15')][_0x0a9e('0x16')]({'port':0x232a});function checkPasswordPattern(_0x32d742,_0x69aeb7,_0x5db4b0){if(_0x5db4b0){var _0x4283ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4283ce[_0x0a9e('0x17')](_0x69aeb7)){return _0x32d742;}else{throw new Error(_0x0a9e('0x18'));}}else{return _0x32d742;}}function respondWithRpcPromise(_0x281129,_0x44dcfd,_0x4d5611,_0x52a03d){return new BPromise(function(_0x22dccb,_0x5d0880){var _0x1985b6=_0x52a03d||client;return _0x1985b6['request'](_0x281129,_0x4d5611)[_0x0a9e('0x19')](function(_0x12066b){logger['info'](_0x0a9e('0x1a'),_0x44dcfd,'request\x20sent');logger[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x44dcfd,_0x0a9e('0x1d'),JSON[_0x0a9e('0x1e')](_0x12066b));if(_0x12066b[_0x0a9e('0x1f')]){if(_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x20')]===0x1f4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x21')]);return _0x5d0880(_0x12066b[_0x0a9e('0x1f')]['message']);}logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b['error'][_0x0a9e('0x21')]);return _0x22dccb(_0x12066b['error']['message']);}else{logger[_0x0a9e('0x22')](_0x0a9e('0x1a'),_0x44dcfd,_0x0a9e('0x1d'));_0x22dccb(_0x12066b[_0x0a9e('0x23')]['message']);}})[_0x0a9e('0x24')](function(_0x2fb0e4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x2fb0e4);_0x5d0880(_0x2fb0e4);});});}function respondWithStatusCode(_0x370d86,_0x42ac8f){_0x42ac8f=_0x42ac8f||0xcc;return function(_0x16b1ca){if(_0x16b1ca){return _0x370d86['sendStatus'](_0x42ac8f);}return _0x370d86['status'](_0x42ac8f)[_0x0a9e('0x25')]();};}function respondWithResult(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0xc8;return function(_0x33161b){if(_0x33161b){return _0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);}};}function respondWithFilteredResult(_0x479bc4,_0x45a1e7){return function(_0x5bfb33){if(_0x5bfb33){var _0x1dc186=_0x5bfb33[_0x0a9e('0x27')],_0x34dc65=_0x45a1e7[_0x0a9e('0x28')],_0x25fba9=_0x45a1e7[_0x0a9e('0x28')]+_0x45a1e7[_0x0a9e('0x29')],_0x14433c;if(_0x25fba9>=_0x1dc186){_0x25fba9=_0x1dc186;_0x14433c=0xc8;}else{_0x14433c=0xce;}_0x479bc4['status'](_0x14433c);return _0x479bc4[_0x0a9e('0x2a')](_0x0a9e('0x2b'),_0x34dc65+'-'+_0x25fba9+'/'+_0x1dc186)[_0x0a9e('0x26')](_0x5bfb33);}return null;};}function patchUpdates(_0x2ec755){return function(_0x5c877d){try{jsonpatch[_0x0a9e('0x2c')](_0x5c877d,_0x2ec755,!![]);}catch(_0x40e7a3){return BPromise[_0x0a9e('0x2d')](_0x40e7a3);}return _0x5c877d[_0x0a9e('0x2e')]();};}function saveUpdates(_0x58b06f,_0x563b45){return function(_0x296f41){if(_0x296f41){return _0x296f41[_0x0a9e('0x2f')](_0x58b06f)[_0x0a9e('0x19')](function(_0x540530){return _0x540530;});}return null;};}function removeEntity(_0x426950,_0x5d1e0e){return function(_0x2407f9){if(_0x2407f9){return _0x2407f9[_0x0a9e('0x30')]()[_0x0a9e('0x19')](function(){_0x426950[_0x0a9e('0x31')](0xcc)[_0x0a9e('0x25')]();});}};}function handleEntityNotFound(_0x5180f1,_0x66c1d2){return function(_0x46f0a5){if(!_0x46f0a5){_0x5180f1[_0x0a9e('0x32')](0x194);}return _0x46f0a5;};}function handleError(_0x2da5c0,_0x2b45ea){_0x2b45ea=_0x2b45ea||0x1f4;return function(_0x409319){logger[_0x0a9e('0x1f')](_0x409319[_0x0a9e('0x33')]);if(_0x409319['name']){delete _0x409319[_0x0a9e('0x34')];}_0x2da5c0['status'](_0x2b45ea)[_0x0a9e('0x35')](_0x409319);};}exports[_0x0a9e('0x36')]=function(_0x2b7e7f,_0x3f3d41){var _0x567193={},_0x191e91={},_0xd1836d={'count':0x0,'rows':[]};var _0x1fa90d=db[_0x0a9e('0x37')]['rawAttributes'];_0x191e91['model']=_[_0x0a9e('0x38')](_0x1fa90d);_0x191e91['query']=_[_0x0a9e('0x38')](_0x2b7e7f[_0x0a9e('0x39')]);_0x191e91[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x191e91['model'],_0x191e91[_0x0a9e('0x39')]);_0x567193[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x191e91['model'],qs[_0x0a9e('0x3d')](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x567193['attributes']=_0x567193['attributes'][_0x0a9e('0x3e')]?_0x567193[_0x0a9e('0x3c')]:_0x191e91['model'];if(!_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x567193[_0x0a9e('0x29')]=qs['limit'](_0x2b7e7f['query'][_0x0a9e('0x29')]);_0x567193[_0x0a9e('0x28')]=qs['offset'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x28')]);}_0x567193[_0x0a9e('0x41')]=qs['sort'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x42')]);_0x567193[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x2b7e7f[_0x0a9e('0x39')],_0x191e91[_0x0a9e('0x3a')]));if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x567193[_0x0a9e('0x43')]=_[_0x0a9e('0x46')](_0x567193[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x1fa90d,function(_0x11ca30){if(_0x11ca30[_0x0a9e('0x48')]['key']!=='VIRTUAL'){var _0x473fdc={};_0x473fdc[_0x11ca30[_0x0a9e('0x49')]]={'$like':'%'+_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x473fdc;}})});}_0x567193=_[_0x0a9e('0x46')]({},_0x567193,_0x2b7e7f[_0x0a9e('0x4a')]);var _0x10b040={'where':_0x567193[_0x0a9e('0x43')]};return db[_0x0a9e('0x37')][_0x0a9e('0x27')](_0x10b040)[_0x0a9e('0x19')](function(_0x35ed4a){_0xd1836d['count']=_0x35ed4a;if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x567193[_0x0a9e('0x4c')]=[{'all':!![]}];}return db[_0x0a9e('0x37')][_0x0a9e('0x4d')](_0x567193);})[_0x0a9e('0x19')](function(_0x21eb86){_0xd1836d[_0x0a9e('0x4e')]=_0x21eb86;return _0xd1836d;})['then'](respondWithFilteredResult(_0x3f3d41,_0x567193))[_0x0a9e('0x24')](handleError(_0x3f3d41,null));};exports['show']=function(_0x473dc8,_0x476688){var _0x8d6dd1={'raw':![],'where':{'id':_0x473dc8[_0x0a9e('0x4f')]['id']}},_0x562fb4={};_0x562fb4[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x37')][_0x0a9e('0x51')]);_0x562fb4[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x473dc8['query']);_0x562fb4[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],_0x562fb4[_0x0a9e('0x39')]);_0x8d6dd1[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],qs[_0x0a9e('0x3d')](_0x473dc8[_0x0a9e('0x39')]['fields']));_0x8d6dd1[_0x0a9e('0x3c')]=_0x8d6dd1[_0x0a9e('0x3c')]['length']?_0x8d6dd1['attributes']:_0x562fb4['model'];if(_0x473dc8[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x8d6dd1[_0x0a9e('0x4c')]=[{'all':!![]}];}_0x8d6dd1=_[_0x0a9e('0x46')]({},_0x8d6dd1,_0x473dc8[_0x0a9e('0x4a')]);return db[_0x0a9e('0x37')][_0x0a9e('0x52')](_0x8d6dd1)[_0x0a9e('0x19')](handleEntityNotFound(_0x476688,null))['then'](respondWithResult(_0x476688,null))['catch'](handleError(_0x476688,null));};exports['create']=function(_0x39d77d,_0x204173){return db[_0x0a9e('0x37')]['create'](_0x39d77d[_0x0a9e('0x53')],{})[_0x0a9e('0x19')](respondWithResult(_0x204173,0xc9))['catch'](handleError(_0x204173,null));};exports['update']=function(_0x2ef381,_0x59c6ff){if(_0x2ef381[_0x0a9e('0x53')]['id']){delete _0x2ef381['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x52')]({'where':{'id':_0x2ef381[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x59c6ff,null))[_0x0a9e('0x19')](saveUpdates(_0x2ef381[_0x0a9e('0x53')],null))['then'](respondWithResult(_0x59c6ff,null))['catch'](handleError(_0x59c6ff,null));};exports[_0x0a9e('0x30')]=function(_0x3aedd0,_0x49c095){return db[_0x0a9e('0x37')]['find']({'where':{'id':_0x3aedd0[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x49c095,null))[_0x0a9e('0x19')](removeEntity(_0x49c095,null))['catch'](handleError(_0x49c095,null));};exports['getConfigurations']=function(_0x5df0ad,_0x2da03c,_0x47de4c){var _0x2f7092={};var _0x65432={};var _0x3cfd00;var _0x19b4df;return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x5df0ad[_0x0a9e('0x4f')]['id']}})[_0x0a9e('0x19')](handleEntityNotFound(_0x2da03c,null))['then'](function(_0x1c693e){if(_0x1c693e){_0x3cfd00=_0x1c693e;_0x65432[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x55')][_0x0a9e('0x51')]);_0x65432[_0x0a9e('0x39')]=_['keys'](_0x5df0ad[_0x0a9e('0x39')]);_0x65432[_0x0a9e('0x3a')]=_['intersection'](_0x65432[_0x0a9e('0x50')],_0x65432['query']);_0x2f7092[_0x0a9e('0x3c')]=_['intersection'](_0x65432['model'],qs['fields'](_0x5df0ad[_0x0a9e('0x39')]['fields']));_0x2f7092[_0x0a9e('0x3c')]=_0x2f7092[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x2f7092[_0x0a9e('0x3c')]:_0x65432[_0x0a9e('0x50')];_0x2f7092[_0x0a9e('0x41')]=qs['sort'](_0x5df0ad[_0x0a9e('0x39')]['sort']);_0x2f7092[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x5df0ad['query'],_0x65432[_0x0a9e('0x3a')]));if(_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x2f7092[_0x0a9e('0x43')]=_['merge'](_0x2f7092[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x2f7092['attributes'],function(_0x797b45){var _0x17e88c={};_0x17e88c[_0x797b45]={'$like':'%'+_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x17e88c;})});}_0x2f7092=_[_0x0a9e('0x46')]({},_0x2f7092,_0x5df0ad['options']);return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x281c7d){if(_0x281c7d){_0x19b4df=_0x281c7d['length'];if(!_0x5df0ad[_0x0a9e('0x39')]['hasOwnProperty']('nolimit')){_0x2f7092[_0x0a9e('0x29')]=qs[_0x0a9e('0x29')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x29')]);_0x2f7092[_0x0a9e('0x28')]=qs[_0x0a9e('0x28')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x28')]);}return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x2e89b7){if(_0x2e89b7){return _0x2e89b7?{'count':_0x19b4df,'rows':_0x2e89b7}:null;}})[_0x0a9e('0x19')](respondWithResult(_0x2da03c,null))[_0x0a9e('0x24')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x57')]=function(_0x320898,_0x412a72,_0x2a28c0){if(_0x320898[_0x0a9e('0x53')]['id']){delete _0x320898['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x320898[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x412a72,null))[_0x0a9e('0x19')](function(_0x30944e){if(_0x30944e){_0x320898['body'][_0x0a9e('0x58')]=_0x30944e['id'];_0x320898[_0x0a9e('0x53')][_0x0a9e('0x59')]=integrations[_0x0a9e('0x5a')](_0x320898[_0x0a9e('0x53')]['channel'],_0x320898['body']['type']);_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5b')]=integrations[_0x0a9e('0x5c')](_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5d')],_0x320898[_0x0a9e('0x53')][_0x0a9e('0x48')]);return db[_0x0a9e('0x55')]['create'](_0x320898[_0x0a9e('0x53')],{'include':[{'model':db[_0x0a9e('0x5e')],'as':_0x0a9e('0x59')},{'model':db['DeskField'],'as':_0x0a9e('0x5b')}]});}return null;})['then'](respondWithResult(_0x412a72,null))[_0x0a9e('0x24')](handleError(_0x412a72,null));};exports[_0x0a9e('0x5f')]=function(_0x4c46c1,_0x2ed01e,_0x75912a){var _0x2cc7a7=[{'name':_0x0a9e('0x60'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x1d442c='';return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x4c46c1[_0x0a9e('0x4f')]['id']},'attributes':['id','remoteUri',_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),'consumerSecret',_0x0a9e('0x65'),_0x0a9e('0x66')]})[_0x0a9e('0x19')](handleEntityNotFound(_0x2ed01e,null))[_0x0a9e('0x19')](function(_0x332367){if(_0x332367){_0x1d442c=_0x332367[_0x0a9e('0x67')];var _0x40fc56=_0x1d442c[_0x0a9e('0x68')](-0x1);if(_0x40fc56==='/'){_0x1d442c=_0x1d442c[_0x0a9e('0x69')](0x0,_0x1d442c[_0x0a9e('0x6a')](_0x40fc56));}var _0xc4c230={'method':_0x0a9e('0x6b'),'uri':util[_0x0a9e('0x6c')](_0x0a9e('0x6d'),_0x1d442c),'headers':{'Content-Type':'application/json','Accept':_0x0a9e('0x6e')},'json':!![]};if(_0x332367[_0x0a9e('0x61')]===_0x0a9e('0x6f')){_0xc4c230['headers'][_0x0a9e('0x70')]=util[_0x0a9e('0x6c')](_0x0a9e('0x71'),new Buffer(util[_0x0a9e('0x6c')]('%s:%s',_0x332367['username'],_0x332367[_0x0a9e('0x63')]))[_0x0a9e('0x72')]('base64'));}return rp(_0xc4c230)[_0x0a9e('0x19')](function(_0x53a6a1){return _0x2cc7a7[_0x0a9e('0x73')](_[_0x0a9e('0x47')](_0x53a6a1['_embedded'][_0x0a9e('0x74')],function(_0x41cf12){return{'id':_0x41cf12[_0x0a9e('0x34')],'name':_0x41cf12[_0x0a9e('0x34')],'type':_0x41cf12[_0x0a9e('0x48')],'active':_0x41cf12[_0x0a9e('0x75')],'label':_0x41cf12[_0x0a9e('0x76')],'custom':!![]};}));});}})['then'](function(_0x2973d3){return{'count':_0x2973d3[_0x0a9e('0x3e')],'rows':_0x2973d3};})[_0x0a9e('0x19')](respondWithResult(_0x2ed01e,null))[_0x0a9e('0x24')](function(_0x492543){var _0xf51744=_0x4c46c1[_0x0a9e('0x39')]['test']?0x1f4:_0x492543[_0x0a9e('0x77')]||0x1f4;logger['error'](_0x0a9e('0x78'),_0x0a9e('0x5f'),_0xf51744,JSON[_0x0a9e('0x1e')](_0x492543));delete _0x492543[_0x0a9e('0x34')];if(_0xf51744===0x191){_0xf51744=0x190;}_0x2ed01e['status'](_0xf51744)['send'](_0x4c46c1[_0x0a9e('0x39')][_0x0a9e('0x17')]?{'message':_0x0a9e('0x79'),'statusCode':_0x492543['statusCode']}:_0x492543);});}; \ No newline at end of file +var _0xb10b=['includeAll','findAll','rows','show','params','intersection','include','find','create','body','update','getConfigurations','DeskConfiguration','map','nolimit','addConfiguration','findOne','AccountId','channel','Descriptions','getDescriptions','DeskField','Subjects','getFields','priority','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','format','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','_embedded','entries','active','label','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','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/logger','api','../../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','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','end','status','json','count','offset','limit','Content-Range','apply','reject','then','destroy','sendStatus','name','send','DeskAccount','rawAttributes','model','query','keys','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','field','merge','options'];(function(_0x30cf18,_0x1b65f7){var _0x42e978=function(_0x35b690){while(--_0x35b690){_0x30cf18['push'](_0x30cf18['shift']());}};_0x42e978(++_0x1b65f7);}(_0xb10b,0x12a));var _0xbb10=function(_0x10a187,_0xd916cd){_0x10a187=_0x10a187-0x0;var _0x505e94=_0xb10b[_0x10a187];return _0x505e94;};'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 hardwareService=require('../../config/license/hardware');var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require(_0xbb10('0x16'));var config=require('../../config/environment');var db=require(_0xbb10('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xbb10('0x18'));var client=jayson[_0xbb10('0x19')][_0xbb10('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x193a27,_0x442548,_0x147230){if(_0x147230){var _0x58a612=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x58a612[_0xbb10('0x1b')](_0x442548)){return _0x193a27;}else{throw new Error(_0xbb10('0x1c'));}}else{return _0x193a27;}}function respondWithRpcPromise(_0x45b9d6,_0x17fd46,_0x3df17b,_0x2f2ebf){return new BPromise(function(_0x24a57b,_0x36b5e8){var _0x3e26f4=_0x2f2ebf||client;return _0x3e26f4[_0xbb10('0x1d')](_0x45b9d6,_0x3df17b)['then'](function(_0x2eca0f){logger[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x17fd46,_0xbb10('0x20'));logger[_0xbb10('0x21')](_0xbb10('0x22'),_0x17fd46,_0xbb10('0x20'),JSON[_0xbb10('0x23')](_0x2eca0f));if(_0x2eca0f[_0xbb10('0x24')]){if(_0x2eca0f[_0xbb10('0x24')]['code']===0x1f4){logger[_0xbb10('0x24')](_0xbb10('0x1f'),_0x17fd46,_0x2eca0f[_0xbb10('0x24')][_0xbb10('0x25')]);return _0x36b5e8(_0x2eca0f[_0xbb10('0x24')][_0xbb10('0x25')]);}logger['error'](_0xbb10('0x1f'),_0x17fd46,_0x2eca0f[_0xbb10('0x24')]['message']);return _0x24a57b(_0x2eca0f['error'][_0xbb10('0x25')]);}else{logger[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x17fd46,_0xbb10('0x20'));_0x24a57b(_0x2eca0f[_0xbb10('0x26')][_0xbb10('0x25')]);}})[_0xbb10('0x27')](function(_0x436104){logger[_0xbb10('0x24')](_0xbb10('0x1f'),_0x17fd46,_0x436104);_0x36b5e8(_0x436104);});});}function respondWithStatusCode(_0x3ba6cd,_0x26ad93){_0x26ad93=_0x26ad93||0xcc;return function(_0x537898){if(_0x537898){return _0x3ba6cd['sendStatus'](_0x26ad93);}return _0x3ba6cd['status'](_0x26ad93)[_0xbb10('0x28')]();};}function respondWithResult(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0xc8;return function(_0x4e25ff){if(_0x4e25ff){return _0x3c5ae7[_0xbb10('0x29')](_0x2c89b9)[_0xbb10('0x2a')](_0x4e25ff);}};}function respondWithFilteredResult(_0x6ed43b,_0x1d5e95){return function(_0x1acce9){if(_0x1acce9){var _0x20d946=_0x1acce9[_0xbb10('0x2b')],_0x2a0e8b=_0x1d5e95[_0xbb10('0x2c')],_0x4aabb9=_0x1d5e95[_0xbb10('0x2c')]+_0x1d5e95[_0xbb10('0x2d')],_0x3796c7;if(_0x4aabb9>=_0x20d946){_0x4aabb9=_0x20d946;_0x3796c7=0xc8;}else{_0x3796c7=0xce;}_0x6ed43b[_0xbb10('0x29')](_0x3796c7);return _0x6ed43b['set'](_0xbb10('0x2e'),_0x2a0e8b+'-'+_0x4aabb9+'/'+_0x20d946)['json'](_0x1acce9);}return null;};}function patchUpdates(_0x448d5c){return function(_0x56f2da){try{jsonpatch[_0xbb10('0x2f')](_0x56f2da,_0x448d5c,!![]);}catch(_0x1dcc9c){return BPromise[_0xbb10('0x30')](_0x1dcc9c);}return _0x56f2da['save']();};}function saveUpdates(_0x518d47,_0x4c3744){return function(_0x34f65e){if(_0x34f65e){return _0x34f65e['update'](_0x518d47)[_0xbb10('0x31')](function(_0x37dde7){return _0x37dde7;});}return null;};}function removeEntity(_0x2f653f,_0x1c0b57){return function(_0x37a83f){if(_0x37a83f){return _0x37a83f[_0xbb10('0x32')]()[_0xbb10('0x31')](function(){_0x2f653f['status'](0xcc)[_0xbb10('0x28')]();});}};}function handleEntityNotFound(_0x1da9c9,_0x441d15){return function(_0x8c1ce6){if(!_0x8c1ce6){_0x1da9c9[_0xbb10('0x33')](0x194);}return _0x8c1ce6;};}function handleError(_0x9de708,_0x188cbd){_0x188cbd=_0x188cbd||0x1f4;return function(_0x10202c){logger[_0xbb10('0x24')](_0x10202c['stack']);if(_0x10202c[_0xbb10('0x34')]){delete _0x10202c[_0xbb10('0x34')];}_0x9de708[_0xbb10('0x29')](_0x188cbd)[_0xbb10('0x35')](_0x10202c);};}exports['index']=function(_0x111762,_0x5de37b){var _0x4e2754={},_0x3eb3cc={},_0x40c164={'count':0x0,'rows':[]};var _0x26e76a=db[_0xbb10('0x36')][_0xbb10('0x37')];_0x3eb3cc[_0xbb10('0x38')]=_['keys'](_0x26e76a);_0x3eb3cc[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x111762['query']);_0x3eb3cc['filters']=_['intersection'](_0x3eb3cc[_0xbb10('0x38')],_0x3eb3cc[_0xbb10('0x39')]);_0x4e2754[_0xbb10('0x3b')]=_['intersection'](_0x3eb3cc[_0xbb10('0x38')],qs[_0xbb10('0x3c')](_0x111762[_0xbb10('0x39')]['fields']));_0x4e2754[_0xbb10('0x3b')]=_0x4e2754[_0xbb10('0x3b')][_0xbb10('0x3d')]?_0x4e2754[_0xbb10('0x3b')]:_0x3eb3cc['model'];if(!_0x111762[_0xbb10('0x39')][_0xbb10('0x3e')]('nolimit')){_0x4e2754[_0xbb10('0x2d')]=qs[_0xbb10('0x2d')](_0x111762[_0xbb10('0x39')][_0xbb10('0x2d')]);_0x4e2754[_0xbb10('0x2c')]=qs[_0xbb10('0x2c')](_0x111762['query'][_0xbb10('0x2c')]);}_0x4e2754[_0xbb10('0x3f')]=qs[_0xbb10('0x40')](_0x111762[_0xbb10('0x39')]['sort']);_0x4e2754[_0xbb10('0x41')]=qs[_0xbb10('0x42')](_[_0xbb10('0x43')](_0x111762[_0xbb10('0x39')],_0x3eb3cc['filters']));if(_0x111762[_0xbb10('0x39')][_0xbb10('0x44')]){_0x4e2754['where']=_['merge'](_0x4e2754[_0xbb10('0x41')],{'$or':_['map'](_0x26e76a,function(_0x318984){if(_0x318984[_0xbb10('0x45')]['key']!==_0xbb10('0x46')){var _0x1d82bf={};_0x1d82bf[_0x318984[_0xbb10('0x47')]]={'$like':'%'+_0x111762['query'][_0xbb10('0x44')]+'%'};return _0x1d82bf;}})});}_0x4e2754=_[_0xbb10('0x48')]({},_0x4e2754,_0x111762[_0xbb10('0x49')]);var _0x32b729={'where':_0x4e2754[_0xbb10('0x41')]};return db[_0xbb10('0x36')][_0xbb10('0x2b')](_0x32b729)[_0xbb10('0x31')](function(_0x205bb4){_0x40c164[_0xbb10('0x2b')]=_0x205bb4;if(_0x111762[_0xbb10('0x39')][_0xbb10('0x4a')]){_0x4e2754['include']=[{'all':!![]}];}return db[_0xbb10('0x36')][_0xbb10('0x4b')](_0x4e2754);})['then'](function(_0x14e1cb){_0x40c164[_0xbb10('0x4c')]=_0x14e1cb;return _0x40c164;})[_0xbb10('0x31')](respondWithFilteredResult(_0x5de37b,_0x4e2754))[_0xbb10('0x27')](handleError(_0x5de37b,null));};exports[_0xbb10('0x4d')]=function(_0x39f0de,_0x3e06b0){var _0x5be85e={'raw':![],'where':{'id':_0x39f0de[_0xbb10('0x4e')]['id']}},_0x4a9793={};_0x4a9793[_0xbb10('0x38')]=_[_0xbb10('0x3a')](db['DeskAccount']['rawAttributes']);_0x4a9793[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x39f0de[_0xbb10('0x39')]);_0x4a9793[_0xbb10('0x42')]=_[_0xbb10('0x4f')](_0x4a9793[_0xbb10('0x38')],_0x4a9793[_0xbb10('0x39')]);_0x5be85e[_0xbb10('0x3b')]=_[_0xbb10('0x4f')](_0x4a9793[_0xbb10('0x38')],qs['fields'](_0x39f0de['query'][_0xbb10('0x3c')]));_0x5be85e[_0xbb10('0x3b')]=_0x5be85e[_0xbb10('0x3b')][_0xbb10('0x3d')]?_0x5be85e[_0xbb10('0x3b')]:_0x4a9793[_0xbb10('0x38')];if(_0x39f0de[_0xbb10('0x39')][_0xbb10('0x4a')]){_0x5be85e[_0xbb10('0x50')]=[{'all':!![]}];}_0x5be85e=_[_0xbb10('0x48')]({},_0x5be85e,_0x39f0de[_0xbb10('0x49')]);return db[_0xbb10('0x36')][_0xbb10('0x51')](_0x5be85e)[_0xbb10('0x31')](handleEntityNotFound(_0x3e06b0,null))[_0xbb10('0x31')](respondWithResult(_0x3e06b0,null))['catch'](handleError(_0x3e06b0,null));};exports[_0xbb10('0x52')]=function(_0x5bd44d,_0x33d60a){return db[_0xbb10('0x36')][_0xbb10('0x52')](_0x5bd44d[_0xbb10('0x53')],{})[_0xbb10('0x31')](respondWithResult(_0x33d60a,0xc9))[_0xbb10('0x27')](handleError(_0x33d60a,null));};exports[_0xbb10('0x54')]=function(_0x44eec1,_0x180400){if(_0x44eec1[_0xbb10('0x53')]['id']){delete _0x44eec1[_0xbb10('0x53')]['id'];}return db[_0xbb10('0x36')][_0xbb10('0x51')]({'where':{'id':_0x44eec1[_0xbb10('0x4e')]['id']}})[_0xbb10('0x31')](handleEntityNotFound(_0x180400,null))['then'](saveUpdates(_0x44eec1[_0xbb10('0x53')],null))[_0xbb10('0x31')](respondWithResult(_0x180400,null))[_0xbb10('0x27')](handleError(_0x180400,null));};exports[_0xbb10('0x32')]=function(_0xbffa3c,_0x379d8c){return db['DeskAccount'][_0xbb10('0x51')]({'where':{'id':_0xbffa3c[_0xbb10('0x4e')]['id']}})[_0xbb10('0x31')](handleEntityNotFound(_0x379d8c,null))[_0xbb10('0x31')](removeEntity(_0x379d8c,null))[_0xbb10('0x27')](handleError(_0x379d8c,null));};exports[_0xbb10('0x55')]=function(_0x175872,_0x12ec18,_0x205e01){var _0x40c4fb={};var _0x2eb05a={};var _0x2a1ce1;var _0x16932f;return db['DeskAccount']['findOne']({'where':{'id':_0x175872[_0xbb10('0x4e')]['id']}})[_0xbb10('0x31')](handleEntityNotFound(_0x12ec18,null))[_0xbb10('0x31')](function(_0x8b0a7d){if(_0x8b0a7d){_0x2a1ce1=_0x8b0a7d;_0x2eb05a['model']=_['keys'](db[_0xbb10('0x56')][_0xbb10('0x37')]);_0x2eb05a[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x175872[_0xbb10('0x39')]);_0x2eb05a[_0xbb10('0x42')]=_[_0xbb10('0x4f')](_0x2eb05a['model'],_0x2eb05a[_0xbb10('0x39')]);_0x40c4fb[_0xbb10('0x3b')]=_['intersection'](_0x2eb05a['model'],qs['fields'](_0x175872[_0xbb10('0x39')][_0xbb10('0x3c')]));_0x40c4fb[_0xbb10('0x3b')]=_0x40c4fb['attributes']['length']?_0x40c4fb['attributes']:_0x2eb05a[_0xbb10('0x38')];_0x40c4fb[_0xbb10('0x3f')]=qs[_0xbb10('0x40')](_0x175872['query'][_0xbb10('0x40')]);_0x40c4fb[_0xbb10('0x41')]=qs['filters'](_['pick'](_0x175872[_0xbb10('0x39')],_0x2eb05a[_0xbb10('0x42')]));if(_0x175872[_0xbb10('0x39')][_0xbb10('0x44')]){_0x40c4fb['where']=_[_0xbb10('0x48')](_0x40c4fb[_0xbb10('0x41')],{'$or':_[_0xbb10('0x57')](_0x40c4fb['attributes'],function(_0x402a01){var _0x2f05bc={};_0x2f05bc[_0x402a01]={'$like':'%'+_0x175872[_0xbb10('0x39')]['filter']+'%'};return _0x2f05bc;})});}_0x40c4fb=_[_0xbb10('0x48')]({},_0x40c4fb,_0x175872[_0xbb10('0x49')]);return _0x2a1ce1[_0xbb10('0x55')](_0x40c4fb);}})[_0xbb10('0x31')](function(_0x5e4a6e){if(_0x5e4a6e){_0x16932f=_0x5e4a6e[_0xbb10('0x3d')];if(!_0x175872[_0xbb10('0x39')][_0xbb10('0x3e')](_0xbb10('0x58'))){_0x40c4fb['limit']=qs[_0xbb10('0x2d')](_0x175872[_0xbb10('0x39')][_0xbb10('0x2d')]);_0x40c4fb[_0xbb10('0x2c')]=qs[_0xbb10('0x2c')](_0x175872[_0xbb10('0x39')][_0xbb10('0x2c')]);}return _0x2a1ce1['getConfigurations'](_0x40c4fb);}})['then'](function(_0x5acd5e){if(_0x5acd5e){return _0x5acd5e?{'count':_0x16932f,'rows':_0x5acd5e}:null;}})[_0xbb10('0x31')](respondWithResult(_0x12ec18,null))[_0xbb10('0x27')](handleError(_0x12ec18,null));};exports[_0xbb10('0x59')]=function(_0x5c9afc,_0x5cd089,_0x46f462){if(_0x5c9afc[_0xbb10('0x53')]['id']){delete _0x5c9afc[_0xbb10('0x53')]['id'];}return db[_0xbb10('0x36')][_0xbb10('0x5a')]({'where':{'id':_0x5c9afc[_0xbb10('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5cd089,null))[_0xbb10('0x31')](function(_0x15fae2){if(_0x15fae2){_0x5c9afc[_0xbb10('0x53')][_0xbb10('0x5b')]=_0x15fae2['id'];_0x5c9afc[_0xbb10('0x53')]['Subjects']=integrations['getSubjects'](_0x5c9afc['body'][_0xbb10('0x5c')],_0x5c9afc[_0xbb10('0x53')][_0xbb10('0x45')]);_0x5c9afc[_0xbb10('0x53')][_0xbb10('0x5d')]=integrations[_0xbb10('0x5e')](_0x5c9afc['body'][_0xbb10('0x5c')],_0x5c9afc['body']['type']);return db['DeskConfiguration'][_0xbb10('0x52')](_0x5c9afc[_0xbb10('0x53')],{'include':[{'model':db[_0xbb10('0x5f')],'as':_0xbb10('0x60')},{'model':db['DeskField'],'as':_0xbb10('0x5d')}]});}return null;})['then'](respondWithResult(_0x5cd089,null))['catch'](handleError(_0x5cd089,null));};exports[_0xbb10('0x61')]=function(_0xfe3db0,_0x29529c,_0x2bd2ab){var _0xfa3c7c=[{'name':'priority','label':_0xbb10('0x62'),'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 _0x19fcec='';return db[_0xbb10('0x36')][_0xbb10('0x5a')]({'where':{'id':_0xfe3db0[_0xbb10('0x4e')]['id']},'attributes':['id',_0xbb10('0x63'),_0xbb10('0x64'),'username',_0xbb10('0x65'),_0xbb10('0x66'),_0xbb10('0x67'),_0xbb10('0x68'),_0xbb10('0x69')]})[_0xbb10('0x31')](handleEntityNotFound(_0x29529c,null))[_0xbb10('0x31')](function(_0x312a08){if(_0x312a08){_0x19fcec=_0x312a08['remoteUri'];var _0x428146=_0x19fcec[_0xbb10('0x6a')](-0x1);if(_0x428146==='/'){_0x19fcec=_0x19fcec[_0xbb10('0x6b')](0x0,_0x19fcec['lastIndexOf'](_0x428146));}var _0x4ee101={'method':'GET','uri':util[_0xbb10('0x6c')]('%s/custom_fields',_0x19fcec),'headers':{'Content-Type':'application/json','Accept':_0xbb10('0x6d')},'json':!![]};if(_0x312a08[_0xbb10('0x64')]===_0xbb10('0x6e')){_0x4ee101[_0xbb10('0x6f')][_0xbb10('0x70')]=util[_0xbb10('0x6c')](_0xbb10('0x71'),new Buffer(util[_0xbb10('0x6c')](_0xbb10('0x72'),_0x312a08['username'],_0x312a08[_0xbb10('0x65')]))[_0xbb10('0x73')](_0xbb10('0x74')));}return rp(_0x4ee101)[_0xbb10('0x31')](function(_0x5c8eb8){return _0xfa3c7c['concat'](_[_0xbb10('0x57')](_0x5c8eb8[_0xbb10('0x75')][_0xbb10('0x76')],function(_0x32bb25){return{'id':_0x32bb25['name'],'name':_0x32bb25[_0xbb10('0x34')],'type':_0x32bb25[_0xbb10('0x45')],'active':_0x32bb25[_0xbb10('0x77')],'label':_0x32bb25[_0xbb10('0x78')],'custom':!![]};}));});}})[_0xbb10('0x31')](function(_0x517185){return{'count':_0x517185['length'],'rows':_0x517185};})[_0xbb10('0x31')](respondWithResult(_0x29529c,null))[_0xbb10('0x27')](function(_0x22c030){var _0x5239da=_0xfe3db0[_0xbb10('0x39')][_0xbb10('0x1b')]?0x1f4:_0x22c030['statusCode']||0x1f4;logger['error'](_0xbb10('0x79'),_0xbb10('0x61'),_0x5239da,JSON[_0xbb10('0x23')](_0x22c030));delete _0x22c030['name'];if(_0x5239da===0x191){_0x5239da=0x190;}_0x29529c[_0xbb10('0x29')](_0x5239da)[_0xbb10('0x35')](_0xfe3db0[_0xbb10('0x39')][_0xbb10('0x1b')]?{'message':_0xbb10('0x7a'),'statusCode':_0x22c030[_0xbb10('0x7b')]}:_0x22c030);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 7ce309b..e37eeec 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 _0x99e9=['./intDeskAccount.attributes','exports','define','int_desk_accounts','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x23ec33,_0x32f0f3){var _0x32ca9a=function(_0x2f628f){while(--_0x2f628f){_0x23ec33['push'](_0x23ec33['shift']());}};_0x32ca9a(++_0x32f0f3);}(_0x99e9,0xb4));var _0x999e=function(_0x11fb16,_0x29a381){_0x11fb16=_0x11fb16-0x0;var _0x343de1=_0x99e9[_0x11fb16];return _0x343de1;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var logger=require(_0x999e('0x1'))(_0x999e('0x2'));var moment=require(_0x999e('0x3'));var BPromise=require('bluebird');var rp=require(_0x999e('0x4'));var fs=require('fs');var path=require(_0x999e('0x5'));var rimraf=require(_0x999e('0x6'));var config=require('../../config/environment');var attributes=require(_0x999e('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x999e('0x8')]=function(_0x1bda0a,_0x100330){return _0x1bda0a[_0x999e('0x9')]('DeskAccount',attributes,{'tableName':_0x999e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbec5=['request-promise','path','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','lodash','util','api','moment','bluebird'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xbec5,0xe5));var _0x5bec=function(_0x5a7dd3,_0x26b7cf){_0x5a7dd3=_0x5a7dd3-0x0;var _0x2f4d07=_0xbec5[_0x5a7dd3];return _0x2f4d07;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var fs=require('fs');var path=require(_0x5bec('0x6'));var rimraf=require('rimraf');var config=require(_0x5bec('0x7'));var attributes=require(_0x5bec('0x8'));var integrations=require(_0x5bec('0x9'));module['exports']=function(_0x3ed67a,_0x28a427){return _0x3ed67a[_0x5bec('0xa')](_0x5bec('0xb'),attributes,{'tableName':_0x5bec('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 7d4f860..30dfb5f 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 _0x2b10=['ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','DeskAccount,\x20%s,\x20%s','message','result','GetDeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowDeskAccount','DeskAccount','catch','lodash','moment','bluebird','randomstring'];(function(_0x1d0bea,_0x5c7582){var _0x565555=function(_0x3aecdb){while(--_0x3aecdb){_0x1d0bea['push'](_0x1d0bea['shift']());}};_0x565555(++_0x5c7582);}(_0x2b10,0x114));var _0x02b1=function(_0x485fd3,_0x2890b8){_0x485fd3=_0x485fd3-0x0;var _0x4df795=_0x2b10[_0x485fd3];return _0x4df795;};'use strict';var _=require(_0x02b1('0x0'));var util=require('util');var moment=require(_0x02b1('0x1'));var BPromise=require(_0x02b1('0x2'));var rs=require(_0x02b1('0x3'));var fs=require('fs');var Redis=require(_0x02b1('0x4'));var db=require(_0x02b1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x02b1('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x02b1('0x7'));var client=jayson[_0x02b1('0x8')][_0x02b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2645ff,_0x5151bc,_0x150191){return new BPromise(function(_0x21caaa,_0x88baeb){return client[_0x02b1('0xa')](_0x2645ff,_0x150191)[_0x02b1('0xb')](function(_0x32c509){logger[_0x02b1('0xc')]('DeskAccount,\x20%s,\x20%s',_0x5151bc,'request\x20sent');logger[_0x02b1('0xd')](_0x02b1('0xe'),_0x5151bc,_0x02b1('0xf'),JSON['stringify'](_0x32c509));if(_0x32c509[_0x02b1('0x10')]){if(_0x32c509[_0x02b1('0x10')][_0x02b1('0x11')]===0x1f4){logger[_0x02b1('0x10')](_0x02b1('0x12'),_0x5151bc,_0x32c509['error'][_0x02b1('0x13')]);return _0x88baeb(_0x32c509[_0x02b1('0x10')]['message']);}logger[_0x02b1('0x10')](_0x02b1('0x12'),_0x5151bc,_0x32c509['error'][_0x02b1('0x13')]);return _0x21caaa(_0x32c509[_0x02b1('0x10')][_0x02b1('0x13')]);}else{logger[_0x02b1('0xc')](_0x02b1('0x12'),_0x5151bc,_0x02b1('0xf'));_0x21caaa(_0x32c509[_0x02b1('0x14')][_0x02b1('0x13')]);}})['catch'](function(_0x311cb7){logger[_0x02b1('0x10')](_0x02b1('0x12'),_0x5151bc,_0x311cb7);_0x88baeb(_0x311cb7);});});}exports[_0x02b1('0x15')]=function(_0x3054e8){var _0x29c60a=this;return new Promise(function(_0x11f568,_0x4158b1){return db['DeskAccount'][_0x02b1('0x16')]({'raw':_0x3054e8[_0x02b1('0x17')]?_0x3054e8[_0x02b1('0x17')][_0x02b1('0x18')]===undefined?!![]:![]:!![],'where':_0x3054e8['options']?_0x3054e8[_0x02b1('0x17')][_0x02b1('0x19')]||null:null,'attributes':_0x3054e8['options']?_0x3054e8[_0x02b1('0x17')][_0x02b1('0x1a')]||null:null,'limit':_0x3054e8[_0x02b1('0x17')]?_0x3054e8[_0x02b1('0x17')][_0x02b1('0x1b')]||null:null,'include':_0x3054e8[_0x02b1('0x17')]?_0x3054e8[_0x02b1('0x17')][_0x02b1('0x1c')]?_[_0x02b1('0x1d')](_0x3054e8[_0x02b1('0x17')]['include'],function(_0x2aa334){return{'model':db[_0x2aa334[_0x02b1('0x1e')]],'as':_0x2aa334['as'],'attributes':_0x2aa334[_0x02b1('0x1a')],'include':_0x2aa334[_0x02b1('0x1c')]?_[_0x02b1('0x1d')](_0x2aa334['include'],function(_0x3684be){return{'model':db[_0x3684be[_0x02b1('0x1e')]],'as':_0x3684be['as'],'attributes':_0x3684be[_0x02b1('0x1a')],'include':_0x3684be[_0x02b1('0x1c')]?_[_0x02b1('0x1d')](_0x3684be[_0x02b1('0x1c')],function(_0x568286){return{'model':db[_0x568286[_0x02b1('0x1e')]],'as':_0x568286['as'],'attributes':_0x568286[_0x02b1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x02b1('0xb')](function(_0xa0b0a9){logger[_0x02b1('0xc')](_0x02b1('0x15'),_0x3054e8);logger[_0x02b1('0xd')](_0x02b1('0x15'),_0x3054e8,JSON[_0x02b1('0x1f')](_0xa0b0a9));_0x11f568(_0xa0b0a9);})['catch'](function(_0x244b4d){logger[_0x02b1('0x10')](_0x02b1('0x15'),_0x244b4d[_0x02b1('0x13')],_0x3054e8);_0x4158b1(_0x29c60a['error'](0x1f4,_0x244b4d[_0x02b1('0x13')]));});});};exports[_0x02b1('0x20')]=function(_0x18ddbb){var _0x291bdd=this;return new Promise(function(_0x5634f3,_0xc1f4d2){return db[_0x02b1('0x21')]['find']({'raw':_0x18ddbb[_0x02b1('0x17')]?_0x18ddbb[_0x02b1('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x18ddbb['options']?_0x18ddbb[_0x02b1('0x17')][_0x02b1('0x19')]||null:null,'attributes':_0x18ddbb['options']?_0x18ddbb[_0x02b1('0x17')][_0x02b1('0x1a')]||null:null,'include':_0x18ddbb[_0x02b1('0x17')]?_0x18ddbb[_0x02b1('0x17')][_0x02b1('0x1c')]?_[_0x02b1('0x1d')](_0x18ddbb[_0x02b1('0x17')][_0x02b1('0x1c')],function(_0x2d7121){return{'model':db[_0x2d7121[_0x02b1('0x1e')]],'as':_0x2d7121['as'],'attributes':_0x2d7121[_0x02b1('0x1a')],'include':_0x2d7121[_0x02b1('0x1c')]?_[_0x02b1('0x1d')](_0x2d7121['include'],function(_0x168950){return{'model':db[_0x168950[_0x02b1('0x1e')]],'as':_0x168950['as'],'attributes':_0x168950[_0x02b1('0x1a')],'include':_0x168950[_0x02b1('0x1c')]?_['map'](_0x168950[_0x02b1('0x1c')],function(_0xf67267){return{'model':db[_0xf67267[_0x02b1('0x1e')]],'as':_0xf67267['as'],'attributes':_0xf67267[_0x02b1('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x58d0fa){logger[_0x02b1('0xc')](_0x02b1('0x20'),_0x18ddbb);logger[_0x02b1('0xd')]('ShowDeskAccount',_0x18ddbb,JSON[_0x02b1('0x1f')](_0x58d0fa));_0x5634f3(_0x58d0fa);})[_0x02b1('0x22')](function(_0x5814b6){logger[_0x02b1('0x10')](_0x02b1('0x20'),_0x5814b6['message'],_0x18ddbb);_0xc1f4d2(_0x291bdd[_0x02b1('0x10')](0x1f4,_0x5814b6[_0x02b1('0x13')]));});});}; \ No newline at end of file +var _0x61f1=['findAll','options','raw','where','attributes','include','model','map','stringify','ShowDeskAccount','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetDeskAccount','DeskAccount'];(function(_0x466e57,_0x21b819){var _0x34df42=function(_0x3e9758){while(--_0x3e9758){_0x466e57['push'](_0x466e57['shift']());}};_0x34df42(++_0x21b819);}(_0x61f1,0x18a));var _0x161f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x61f1[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x161f('0x0'));var moment=require('moment');var BPromise=require(_0x161f('0x1'));var rs=require(_0x161f('0x2'));var fs=require('fs');var Redis=require(_0x161f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x161f('0x4'))(_0x161f('0x5'));var config=require('../../config/environment');var jayson=require(_0x161f('0x6'));var client=jayson[_0x161f('0x7')][_0x161f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf8174c,_0xd1ad5d,_0x4ff5e1){return new BPromise(function(_0x910af4,_0x31f44e){return client[_0x161f('0x9')](_0xf8174c,_0x4ff5e1)[_0x161f('0xa')](function(_0x24bc8a){logger[_0x161f('0xb')](_0x161f('0xc'),_0xd1ad5d,_0x161f('0xd'));logger[_0x161f('0xe')](_0x161f('0xf'),_0xd1ad5d,_0x161f('0xd'),JSON['stringify'](_0x24bc8a));if(_0x24bc8a[_0x161f('0x10')]){if(_0x24bc8a[_0x161f('0x10')][_0x161f('0x11')]===0x1f4){logger[_0x161f('0x10')](_0x161f('0xc'),_0xd1ad5d,_0x24bc8a['error'][_0x161f('0x12')]);return _0x31f44e(_0x24bc8a[_0x161f('0x10')][_0x161f('0x12')]);}logger[_0x161f('0x10')]('DeskAccount,\x20%s,\x20%s',_0xd1ad5d,_0x24bc8a[_0x161f('0x10')][_0x161f('0x12')]);return _0x910af4(_0x24bc8a[_0x161f('0x10')][_0x161f('0x12')]);}else{logger[_0x161f('0xb')](_0x161f('0xc'),_0xd1ad5d,'request\x20sent');_0x910af4(_0x24bc8a['result'][_0x161f('0x12')]);}})[_0x161f('0x13')](function(_0x189a95){logger['error'](_0x161f('0xc'),_0xd1ad5d,_0x189a95);_0x31f44e(_0x189a95);});});}exports[_0x161f('0x14')]=function(_0x2cf920){var _0x561a13=this;return new Promise(function(_0x420818,_0x5943e7){return db[_0x161f('0x15')][_0x161f('0x16')]({'raw':_0x2cf920[_0x161f('0x17')]?_0x2cf920[_0x161f('0x17')][_0x161f('0x18')]===undefined?!![]:![]:!![],'where':_0x2cf920[_0x161f('0x17')]?_0x2cf920[_0x161f('0x17')][_0x161f('0x19')]||null:null,'attributes':_0x2cf920[_0x161f('0x17')]?_0x2cf920[_0x161f('0x17')][_0x161f('0x1a')]||null:null,'limit':_0x2cf920[_0x161f('0x17')]?_0x2cf920[_0x161f('0x17')]['limit']||null:null,'include':_0x2cf920[_0x161f('0x17')]?_0x2cf920[_0x161f('0x17')][_0x161f('0x1b')]?_['map'](_0x2cf920['options'][_0x161f('0x1b')],function(_0xaf2a44){return{'model':db[_0xaf2a44[_0x161f('0x1c')]],'as':_0xaf2a44['as'],'attributes':_0xaf2a44[_0x161f('0x1a')],'include':_0xaf2a44[_0x161f('0x1b')]?_['map'](_0xaf2a44[_0x161f('0x1b')],function(_0x2b501f){return{'model':db[_0x2b501f[_0x161f('0x1c')]],'as':_0x2b501f['as'],'attributes':_0x2b501f['attributes'],'include':_0x2b501f[_0x161f('0x1b')]?_[_0x161f('0x1d')](_0x2b501f[_0x161f('0x1b')],function(_0x413c75){return{'model':db[_0x413c75[_0x161f('0x1c')]],'as':_0x413c75['as'],'attributes':_0x413c75[_0x161f('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x168b66){logger[_0x161f('0xb')](_0x161f('0x14'),_0x2cf920);logger[_0x161f('0xe')](_0x161f('0x14'),_0x2cf920,JSON[_0x161f('0x1e')](_0x168b66));_0x420818(_0x168b66);})['catch'](function(_0x18e910){logger[_0x161f('0x10')](_0x161f('0x14'),_0x18e910['message'],_0x2cf920);_0x5943e7(_0x561a13[_0x161f('0x10')](0x1f4,_0x18e910[_0x161f('0x12')]));});});};exports[_0x161f('0x1f')]=function(_0x389c45){var _0x27ebc7=this;return new Promise(function(_0x2f570e,_0x2bd3b0){return db[_0x161f('0x15')]['find']({'raw':_0x389c45['options']?_0x389c45[_0x161f('0x17')][_0x161f('0x18')]===undefined?!![]:![]:!![],'where':_0x389c45[_0x161f('0x17')]?_0x389c45['options']['where']||null:null,'attributes':_0x389c45['options']?_0x389c45[_0x161f('0x17')][_0x161f('0x1a')]||null:null,'include':_0x389c45['options']?_0x389c45[_0x161f('0x17')][_0x161f('0x1b')]?_[_0x161f('0x1d')](_0x389c45[_0x161f('0x17')]['include'],function(_0x3ea752){return{'model':db[_0x3ea752['model']],'as':_0x3ea752['as'],'attributes':_0x3ea752[_0x161f('0x1a')],'include':_0x3ea752[_0x161f('0x1b')]?_[_0x161f('0x1d')](_0x3ea752[_0x161f('0x1b')],function(_0x34a923){return{'model':db[_0x34a923[_0x161f('0x1c')]],'as':_0x34a923['as'],'attributes':_0x34a923[_0x161f('0x1a')],'include':_0x34a923[_0x161f('0x1b')]?_[_0x161f('0x1d')](_0x34a923[_0x161f('0x1b')],function(_0x4b90cb){return{'model':db[_0x4b90cb[_0x161f('0x1c')]],'as':_0x4b90cb['as'],'attributes':_0x4b90cb['attributes']};}):[]};}):[]};}):[]:[]})[_0x161f('0xa')](function(_0x2387da){logger['info'](_0x161f('0x1f'),_0x389c45);logger[_0x161f('0xe')](_0x161f('0x1f'),_0x389c45,JSON[_0x161f('0x1e')](_0x2387da));_0x2f570e(_0x2387da);})['catch'](function(_0xc63286){logger[_0x161f('0x10')]('ShowDeskAccount',_0xc63286['message'],_0x389c45);_0x2bd3b0(_0x27ebc7['error'](0x1f4,_0xc63286[_0x161f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 6e67add..996fd6f 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 _0xcb6e=['/:id','exports','multer','path','connect-timeout','express','Router','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','create','post','update','delete'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0xcb6e,0x15b));var _0xecb6=function(_0x427da7,_0xadc085){_0x427da7=_0x427da7-0x0;var _0x24e0f7=_0xcb6e[_0x427da7];return _0x24e0f7;};'use strict';var multer=require(_0xecb6('0x0'));var util=require('util');var path=require(_0xecb6('0x1'));var timeout=require(_0xecb6('0x2'));var express=require(_0xecb6('0x3'));var router=express[_0xecb6('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xecb6('0x5'));var controller=require(_0xecb6('0x6'));router[_0xecb6('0x7')]('/',auth[_0xecb6('0x8')](),controller['index']);router['get']('/:id',auth[_0xecb6('0x8')](),controller[_0xecb6('0x9')]);router[_0xecb6('0x7')](_0xecb6('0xa'),auth['isAuthenticated'](),controller[_0xecb6('0xb')]);router[_0xecb6('0x7')](_0xecb6('0xc'),auth[_0xecb6('0x8')](),controller[_0xecb6('0xd')]);router[_0xecb6('0x7')]('/:id/descriptions',auth[_0xecb6('0x8')](),controller[_0xecb6('0xe')]);router[_0xecb6('0x7')](_0xecb6('0xf'),auth['isAuthenticated'](),controller[_0xecb6('0x10')]);router['post']('/',auth[_0xecb6('0x8')](),controller[_0xecb6('0x11')]);router[_0xecb6('0x12')](_0xecb6('0xf'),auth['isAuthenticated'](),controller['setTags']);router['put']('/:id',auth[_0xecb6('0x8')](),controller[_0xecb6('0x13')]);router[_0xecb6('0x14')](_0xecb6('0x15'),auth[_0xecb6('0x8')](),controller['destroy']);module[_0xecb6('0x16')]=router; \ No newline at end of file +var _0x433a=['get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','setTags','put','update','delete','destroy','util','path','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller'];(function(_0x4a8227,_0x27ab19){var _0x403b2c=function(_0x6e793d){while(--_0x6e793d){_0x4a8227['push'](_0x4a8227['shift']());}};_0x403b2c(++_0x27ab19);}(_0x433a,0x13d));var _0xa433=function(_0x55d31c,_0x2d3c9f){_0x55d31c=_0x55d31c-0x0;var _0x8b2644=_0x433a[_0x55d31c];return _0x8b2644;};'use strict';var multer=require('multer');var util=require(_0xa433('0x0'));var path=require(_0xa433('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xa433('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xa433('0x3'));var controller=require(_0xa433('0x4'));router[_0xa433('0x5')]('/',auth[_0xa433('0x6')](),controller[_0xa433('0x7')]);router[_0xa433('0x5')](_0xa433('0x8'),auth[_0xa433('0x6')](),controller[_0xa433('0x9')]);router[_0xa433('0x5')](_0xa433('0xa'),auth[_0xa433('0x6')](),controller['getFields']);router['get'](_0xa433('0xb'),auth[_0xa433('0x6')](),controller[_0xa433('0xc')]);router['get'](_0xa433('0xd'),auth['isAuthenticated'](),controller[_0xa433('0xe')]);router[_0xa433('0x5')](_0xa433('0xf'),auth['isAuthenticated'](),controller['getTags']);router[_0xa433('0x10')]('/',auth[_0xa433('0x6')](),controller[_0xa433('0x11')]);router['post']('/:id/tags',auth[_0xa433('0x6')](),controller[_0xa433('0x12')]);router[_0xa433('0x13')](_0xa433('0x8'),auth['isAuthenticated'](),controller[_0xa433('0x14')]);router[_0xa433('0x15')](_0xa433('0x8'),auth[_0xa433('0x6')](),controller[_0xa433('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 4817502..931b4ee 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 _0x0ab0=['sequelize','STRING'];(function(_0x33e3c3,_0x225ffe){var _0x224fc1=function(_0x43188c){while(--_0x43188c){_0x33e3c3['push'](_0x33e3c3['shift']());}};_0x224fc1(++_0x225ffe);}(_0x0ab0,0xf4));var _0x00ab=function(_0x27fd4c,_0x42d9a4){_0x27fd4c=_0x27fd4c-0x0;var _0x54657c=_0x0ab0[_0x27fd4c];return _0x54657c;};'use strict';var Sequelize=require(_0x00ab('0x0'));module['exports']={'name':{'type':Sequelize[_0x00ab('0x1')]},'description':{'type':Sequelize[_0x00ab('0x1')]}}; \ No newline at end of file +var _0xaee8=['STRING','sequelize'];(function(_0x4afa19,_0x4440ef){var _0x2e6278=function(_0x42a542){while(--_0x42a542){_0x4afa19['push'](_0x4afa19['shift']());}};_0x2e6278(++_0x4440ef);}(_0xaee8,0x1b9));var _0x8aee=function(_0x2e65ca,_0x25b3eb){_0x2e65ca=_0x2e65ca-0x0;var _0x338614=_0xaee8[_0x2e65ca];return _0x338614;};'use strict';var Sequelize=require(_0x8aee('0x0'));module['exports']={'name':{'type':Sequelize[_0x8aee('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 68a4581..0fb2403 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 _0xf296=['error','code','message','DeskConfiguration,\x20%s,\x20%s','info','result','catch','status','json','count','offset','limit','Content-Range','apply','reject','destroy','end','sendStatus','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','map','key','VIRTUAL','field','options','DeskConfiguration','includeAll','findAll','rows','show','params','length','find','create','body','update','getFields','findOne','DeskField','order','pick','getSubjects','getDescriptions','getTags','Tag','html-pdf','eml-format','zip-dir','moment','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../mysqldb','jayson/promise','client','test','request','then','request\x20sent','debug','stringify'];(function(_0x535641,_0x1c6000){var _0x395d0a=function(_0x6c76f0){while(--_0x6c76f0){_0x535641['push'](_0x535641['shift']());}};_0x395d0a(++_0x1c6000);}(_0xf296,0x94));var _0x6f29=function(_0x26658e,_0x1bb1a9){_0x26658e=_0x26658e-0x0;var _0x572802=_0xf296[_0x26658e];return _0x572802;};'use strict';var pdf=require(_0x6f29('0x0'));var emlformat=require(_0x6f29('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6f29('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6f29('0x3'));var BPromise=require(_0x6f29('0x4'));var Mustache=require('mustache');var util=require(_0x6f29('0x5'));var path=require(_0x6f29('0x6'));var sox=require(_0x6f29('0x7'));var csv=require('to-csv');var ejs=require(_0x6f29('0x8'));var fs=require('fs');var _=require(_0x6f29('0x9'));var squel=require('squel');var crypto=require(_0x6f29('0xa'));var jsforce=require(_0x6f29('0xb'));var deskjs=require(_0x6f29('0xc'));var toCsv=require(_0x6f29('0xd'));var querystring=require(_0x6f29('0xe'));var Papa=require(_0x6f29('0xf'));var Redis=require(_0x6f29('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6f29('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x6f29('0x12'));var config=require('../../config/environment');var db=require(_0x6f29('0x13'))['db'];var jayson=require(_0x6f29('0x14'));var client=jayson[_0x6f29('0x15')]['http']({'port':0x232a});function checkPasswordPattern(_0x1ce6a2,_0x3cec2a,_0x1014fa){if(_0x1014fa){var _0x1a50f2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1a50f2[_0x6f29('0x16')](_0x3cec2a)){return _0x1ce6a2;}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 _0x1ce6a2;}}function respondWithRpcPromise(_0x429604,_0x115d08,_0x3a9802,_0x4975c9){return new BPromise(function(_0x3602e4,_0x50e0d6){var _0x3959e4=_0x4975c9||client;return _0x3959e4[_0x6f29('0x17')](_0x429604,_0x3a9802)[_0x6f29('0x18')](function(_0x2f1f53){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x115d08,_0x6f29('0x19'));logger[_0x6f29('0x1a')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x115d08,'request\x20sent',JSON[_0x6f29('0x1b')](_0x2f1f53));if(_0x2f1f53[_0x6f29('0x1c')]){if(_0x2f1f53[_0x6f29('0x1c')][_0x6f29('0x1d')]===0x1f4){logger[_0x6f29('0x1c')]('DeskConfiguration,\x20%s,\x20%s',_0x115d08,_0x2f1f53[_0x6f29('0x1c')][_0x6f29('0x1e')]);return _0x50e0d6(_0x2f1f53[_0x6f29('0x1c')][_0x6f29('0x1e')]);}logger[_0x6f29('0x1c')](_0x6f29('0x1f'),_0x115d08,_0x2f1f53['error']['message']);return _0x3602e4(_0x2f1f53[_0x6f29('0x1c')][_0x6f29('0x1e')]);}else{logger[_0x6f29('0x20')]('DeskConfiguration,\x20%s,\x20%s',_0x115d08,_0x6f29('0x19'));_0x3602e4(_0x2f1f53[_0x6f29('0x21')][_0x6f29('0x1e')]);}})[_0x6f29('0x22')](function(_0x16eaa9){logger[_0x6f29('0x1c')]('DeskConfiguration,\x20%s,\x20%s',_0x115d08,_0x16eaa9);_0x50e0d6(_0x16eaa9);});});}function respondWithStatusCode(_0x2a02a9,_0x1dd081){_0x1dd081=_0x1dd081||0xcc;return function(_0x2d0a81){if(_0x2d0a81){return _0x2a02a9['sendStatus'](_0x1dd081);}return _0x2a02a9['status'](_0x1dd081)['end']();};}function respondWithResult(_0x1b2d26,_0x2593ba){_0x2593ba=_0x2593ba||0xc8;return function(_0x1b0ff7){if(_0x1b0ff7){return _0x1b2d26[_0x6f29('0x23')](_0x2593ba)[_0x6f29('0x24')](_0x1b0ff7);}};}function respondWithFilteredResult(_0x445de9,_0x19a87b){return function(_0x246460){if(_0x246460){var _0x4c2c7e=_0x246460[_0x6f29('0x25')],_0x36384c=_0x19a87b[_0x6f29('0x26')],_0x45e490=_0x19a87b[_0x6f29('0x26')]+_0x19a87b[_0x6f29('0x27')],_0x4ceaea;if(_0x45e490>=_0x4c2c7e){_0x45e490=_0x4c2c7e;_0x4ceaea=0xc8;}else{_0x4ceaea=0xce;}_0x445de9[_0x6f29('0x23')](_0x4ceaea);return _0x445de9['set'](_0x6f29('0x28'),_0x36384c+'-'+_0x45e490+'/'+_0x4c2c7e)[_0x6f29('0x24')](_0x246460);}return null;};}function patchUpdates(_0x5b57a3){return function(_0x2ed762){try{jsonpatch[_0x6f29('0x29')](_0x2ed762,_0x5b57a3,!![]);}catch(_0x4bbedf){return BPromise[_0x6f29('0x2a')](_0x4bbedf);}return _0x2ed762['save']();};}function saveUpdates(_0x1f47d5,_0x1b1a5e){return function(_0x100bbf){if(_0x100bbf){return _0x100bbf['update'](_0x1f47d5)[_0x6f29('0x18')](function(_0x220ddf){return _0x220ddf;});}return null;};}function removeEntity(_0x1837b9,_0x512048){return function(_0x3041be){if(_0x3041be){return _0x3041be[_0x6f29('0x2b')]()['then'](function(){_0x1837b9[_0x6f29('0x23')](0xcc)[_0x6f29('0x2c')]();});}};}function handleEntityNotFound(_0x404097,_0x748069){return function(_0x20fa96){if(!_0x20fa96){_0x404097[_0x6f29('0x2d')](0x194);}return _0x20fa96;};}function handleError(_0xc95f09,_0x1f29e0){_0x1f29e0=_0x1f29e0||0x1f4;return function(_0x1b3f96){logger[_0x6f29('0x1c')](_0x1b3f96['stack']);if(_0x1b3f96['name']){delete _0x1b3f96[_0x6f29('0x2e')];}_0xc95f09['status'](_0x1f29e0)[_0x6f29('0x2f')](_0x1b3f96);};}exports[_0x6f29('0x30')]=function(_0x1f6912,_0x4c0181){var _0x278a0b={},_0x16321b={},_0x4f427e={'count':0x0,'rows':[]};var _0x46c00b=db['DeskConfiguration'][_0x6f29('0x31')];_0x16321b[_0x6f29('0x32')]=_[_0x6f29('0x33')](_0x46c00b);_0x16321b['query']=_[_0x6f29('0x33')](_0x1f6912[_0x6f29('0x34')]);_0x16321b[_0x6f29('0x35')]=_[_0x6f29('0x36')](_0x16321b[_0x6f29('0x32')],_0x16321b[_0x6f29('0x34')]);_0x278a0b[_0x6f29('0x37')]=_[_0x6f29('0x36')](_0x16321b[_0x6f29('0x32')],qs[_0x6f29('0x38')](_0x1f6912[_0x6f29('0x34')][_0x6f29('0x38')]));_0x278a0b[_0x6f29('0x37')]=_0x278a0b['attributes']['length']?_0x278a0b[_0x6f29('0x37')]:_0x16321b[_0x6f29('0x32')];if(!_0x1f6912[_0x6f29('0x34')][_0x6f29('0x39')](_0x6f29('0x3a'))){_0x278a0b[_0x6f29('0x27')]=qs[_0x6f29('0x27')](_0x1f6912['query'][_0x6f29('0x27')]);_0x278a0b[_0x6f29('0x26')]=qs['offset'](_0x1f6912['query'][_0x6f29('0x26')]);}_0x278a0b['order']=qs[_0x6f29('0x3b')](_0x1f6912[_0x6f29('0x34')][_0x6f29('0x3b')]);_0x278a0b[_0x6f29('0x3c')]=qs['filters'](_['pick'](_0x1f6912[_0x6f29('0x34')],_0x16321b[_0x6f29('0x35')]));if(_0x1f6912[_0x6f29('0x34')][_0x6f29('0x3d')]){_0x278a0b[_0x6f29('0x3c')]=_[_0x6f29('0x3e')](_0x278a0b['where'],{'$or':_[_0x6f29('0x3f')](_0x46c00b,function(_0xcede83){if(_0xcede83['type'][_0x6f29('0x40')]!==_0x6f29('0x41')){var _0x2d7ddb={};_0x2d7ddb[_0xcede83[_0x6f29('0x42')]]={'$like':'%'+_0x1f6912[_0x6f29('0x34')][_0x6f29('0x3d')]+'%'};return _0x2d7ddb;}})});}_0x278a0b=_[_0x6f29('0x3e')]({},_0x278a0b,_0x1f6912[_0x6f29('0x43')]);var _0x257ed1={'where':_0x278a0b[_0x6f29('0x3c')]};return db[_0x6f29('0x44')][_0x6f29('0x25')](_0x257ed1)[_0x6f29('0x18')](function(_0x190005){_0x4f427e['count']=_0x190005;if(_0x1f6912[_0x6f29('0x34')][_0x6f29('0x45')]){_0x278a0b['include']=[{'all':!![]}];}return db[_0x6f29('0x44')][_0x6f29('0x46')](_0x278a0b);})[_0x6f29('0x18')](function(_0x5b2651){_0x4f427e[_0x6f29('0x47')]=_0x5b2651;return _0x4f427e;})[_0x6f29('0x18')](respondWithFilteredResult(_0x4c0181,_0x278a0b))['catch'](handleError(_0x4c0181,null));};exports[_0x6f29('0x48')]=function(_0x3d8d1e,_0x2c97e7){var _0x9e10e={'raw':![],'where':{'id':_0x3d8d1e[_0x6f29('0x49')]['id']}},_0x259567={};_0x259567[_0x6f29('0x32')]=_[_0x6f29('0x33')](db['DeskConfiguration'][_0x6f29('0x31')]);_0x259567[_0x6f29('0x34')]=_[_0x6f29('0x33')](_0x3d8d1e[_0x6f29('0x34')]);_0x259567[_0x6f29('0x35')]=_['intersection'](_0x259567[_0x6f29('0x32')],_0x259567[_0x6f29('0x34')]);_0x9e10e[_0x6f29('0x37')]=_[_0x6f29('0x36')](_0x259567['model'],qs[_0x6f29('0x38')](_0x3d8d1e[_0x6f29('0x34')][_0x6f29('0x38')]));_0x9e10e[_0x6f29('0x37')]=_0x9e10e['attributes'][_0x6f29('0x4a')]?_0x9e10e[_0x6f29('0x37')]:_0x259567[_0x6f29('0x32')];if(_0x3d8d1e[_0x6f29('0x34')]['includeAll']){_0x9e10e['include']=[{'all':!![]}];}_0x9e10e=_[_0x6f29('0x3e')]({},_0x9e10e,_0x3d8d1e[_0x6f29('0x43')]);return db[_0x6f29('0x44')][_0x6f29('0x4b')](_0x9e10e)[_0x6f29('0x18')](handleEntityNotFound(_0x2c97e7,null))[_0x6f29('0x18')](respondWithResult(_0x2c97e7,null))[_0x6f29('0x22')](handleError(_0x2c97e7,null));};exports[_0x6f29('0x4c')]=function(_0x3d2907,_0x2ffd50){return db['DeskConfiguration'][_0x6f29('0x4c')](_0x3d2907[_0x6f29('0x4d')],{})['then'](respondWithResult(_0x2ffd50,0xc9))['catch'](handleError(_0x2ffd50,null));};exports[_0x6f29('0x4e')]=function(_0x397a03,_0x5e70f1){if(_0x397a03[_0x6f29('0x4d')]['id']){delete _0x397a03[_0x6f29('0x4d')]['id'];}return db[_0x6f29('0x44')]['find']({'where':{'id':_0x397a03[_0x6f29('0x49')]['id']}})[_0x6f29('0x18')](handleEntityNotFound(_0x5e70f1,null))[_0x6f29('0x18')](saveUpdates(_0x397a03[_0x6f29('0x4d')],null))[_0x6f29('0x18')](respondWithResult(_0x5e70f1,null))[_0x6f29('0x22')](handleError(_0x5e70f1,null));};exports['destroy']=function(_0x4e945f,_0x454e68){return db[_0x6f29('0x44')][_0x6f29('0x4b')]({'where':{'id':_0x4e945f['params']['id']}})[_0x6f29('0x18')](handleEntityNotFound(_0x454e68,null))[_0x6f29('0x18')](removeEntity(_0x454e68,null))[_0x6f29('0x22')](handleError(_0x454e68,null));};exports[_0x6f29('0x4f')]=function(_0x515451,_0x3dbd9b,_0x145220){var _0x56f730={};var _0x2e716c={};var _0x289974;var _0x28ca50;return db[_0x6f29('0x44')][_0x6f29('0x50')]({'where':{'id':_0x515451[_0x6f29('0x49')]['id']}})[_0x6f29('0x18')](handleEntityNotFound(_0x3dbd9b,null))['then'](function(_0xe87fa7){if(_0xe87fa7){_0x289974=_0xe87fa7;_0x2e716c[_0x6f29('0x32')]=_[_0x6f29('0x33')](db[_0x6f29('0x51')][_0x6f29('0x31')]);_0x2e716c[_0x6f29('0x34')]=_['keys'](_0x515451[_0x6f29('0x34')]);_0x2e716c[_0x6f29('0x35')]=_[_0x6f29('0x36')](_0x2e716c['model'],_0x2e716c['query']);_0x56f730[_0x6f29('0x37')]=_[_0x6f29('0x36')](_0x2e716c[_0x6f29('0x32')],qs[_0x6f29('0x38')](_0x515451[_0x6f29('0x34')]['fields']));_0x56f730[_0x6f29('0x37')]=_0x56f730[_0x6f29('0x37')][_0x6f29('0x4a')]?_0x56f730['attributes']:_0x2e716c[_0x6f29('0x32')];_0x56f730[_0x6f29('0x52')]=qs[_0x6f29('0x3b')](_0x515451[_0x6f29('0x34')][_0x6f29('0x3b')]);_0x56f730[_0x6f29('0x3c')]=qs[_0x6f29('0x35')](_[_0x6f29('0x53')](_0x515451['query'],_0x2e716c[_0x6f29('0x35')]));if(_0x515451[_0x6f29('0x34')][_0x6f29('0x3d')]){_0x56f730['where']=_['merge'](_0x56f730['where'],{'$or':_[_0x6f29('0x3f')](_0x56f730[_0x6f29('0x37')],function(_0x666fcc){var _0x582319={};_0x582319[_0x666fcc]={'$like':'%'+_0x515451[_0x6f29('0x34')][_0x6f29('0x3d')]+'%'};return _0x582319;})});}_0x56f730=_[_0x6f29('0x3e')]({},_0x56f730,_0x515451[_0x6f29('0x43')]);return _0x289974[_0x6f29('0x4f')](_0x56f730);}})[_0x6f29('0x18')](function(_0x1f6827){if(_0x1f6827){_0x28ca50=_0x1f6827[_0x6f29('0x4a')];if(!_0x515451[_0x6f29('0x34')][_0x6f29('0x39')]('nolimit')){_0x56f730[_0x6f29('0x27')]=qs['limit'](_0x515451[_0x6f29('0x34')][_0x6f29('0x27')]);_0x56f730[_0x6f29('0x26')]=qs['offset'](_0x515451[_0x6f29('0x34')][_0x6f29('0x26')]);}return _0x289974[_0x6f29('0x4f')](_0x56f730);}})[_0x6f29('0x18')](function(_0x3f84a7){if(_0x3f84a7){return _0x3f84a7?{'count':_0x28ca50,'rows':_0x3f84a7}:null;}})['then'](respondWithResult(_0x3dbd9b,null))[_0x6f29('0x22')](handleError(_0x3dbd9b,null));};exports[_0x6f29('0x54')]=function(_0x474562,_0x3712b9,_0x130a0f){var _0x292532={};var _0x1e00dc={};var _0x422f12;var _0x3f1391;return db[_0x6f29('0x44')][_0x6f29('0x50')]({'where':{'id':_0x474562[_0x6f29('0x49')]['id']}})[_0x6f29('0x18')](handleEntityNotFound(_0x3712b9,null))[_0x6f29('0x18')](function(_0x4caf53){if(_0x4caf53){_0x422f12=_0x4caf53;_0x1e00dc[_0x6f29('0x32')]=_[_0x6f29('0x33')](db[_0x6f29('0x51')][_0x6f29('0x31')]);_0x1e00dc[_0x6f29('0x34')]=_[_0x6f29('0x33')](_0x474562[_0x6f29('0x34')]);_0x1e00dc['filters']=_[_0x6f29('0x36')](_0x1e00dc[_0x6f29('0x32')],_0x1e00dc[_0x6f29('0x34')]);_0x292532[_0x6f29('0x37')]=_[_0x6f29('0x36')](_0x1e00dc[_0x6f29('0x32')],qs[_0x6f29('0x38')](_0x474562[_0x6f29('0x34')][_0x6f29('0x38')]));_0x292532[_0x6f29('0x37')]=_0x292532[_0x6f29('0x37')][_0x6f29('0x4a')]?_0x292532['attributes']:_0x1e00dc['model'];_0x292532['order']=qs[_0x6f29('0x3b')](_0x474562[_0x6f29('0x34')]['sort']);_0x292532[_0x6f29('0x3c')]=qs[_0x6f29('0x35')](_['pick'](_0x474562['query'],_0x1e00dc[_0x6f29('0x35')]));if(_0x474562[_0x6f29('0x34')][_0x6f29('0x3d')]){_0x292532[_0x6f29('0x3c')]=_[_0x6f29('0x3e')](_0x292532[_0x6f29('0x3c')],{'$or':_[_0x6f29('0x3f')](_0x292532[_0x6f29('0x37')],function(_0x31827c){var _0x188c11={};_0x188c11[_0x31827c]={'$like':'%'+_0x474562[_0x6f29('0x34')][_0x6f29('0x3d')]+'%'};return _0x188c11;})});}_0x292532=_[_0x6f29('0x3e')]({},_0x292532,_0x474562[_0x6f29('0x43')]);return _0x422f12[_0x6f29('0x54')](_0x292532);}})['then'](function(_0x270906){if(_0x270906){_0x3f1391=_0x270906[_0x6f29('0x4a')];if(!_0x474562[_0x6f29('0x34')][_0x6f29('0x39')](_0x6f29('0x3a'))){_0x292532['limit']=qs[_0x6f29('0x27')](_0x474562[_0x6f29('0x34')][_0x6f29('0x27')]);_0x292532[_0x6f29('0x26')]=qs[_0x6f29('0x26')](_0x474562[_0x6f29('0x34')][_0x6f29('0x26')]);}return _0x422f12[_0x6f29('0x54')](_0x292532);}})[_0x6f29('0x18')](function(_0x1ec590){if(_0x1ec590){return _0x1ec590?{'count':_0x3f1391,'rows':_0x1ec590}:null;}})[_0x6f29('0x18')](respondWithResult(_0x3712b9,null))[_0x6f29('0x22')](handleError(_0x3712b9,null));};exports[_0x6f29('0x55')]=function(_0x110e75,_0x4f5231,_0x53796c){var _0x231dd7={};var _0x5be23e={};var _0x4b7381;var _0x5c79dc;return db[_0x6f29('0x44')][_0x6f29('0x50')]({'where':{'id':_0x110e75[_0x6f29('0x49')]['id']}})['then'](handleEntityNotFound(_0x4f5231,null))[_0x6f29('0x18')](function(_0x5e643c){if(_0x5e643c){_0x4b7381=_0x5e643c;_0x5be23e[_0x6f29('0x32')]=_[_0x6f29('0x33')](db['DeskField'][_0x6f29('0x31')]);_0x5be23e['query']=_[_0x6f29('0x33')](_0x110e75[_0x6f29('0x34')]);_0x5be23e['filters']=_[_0x6f29('0x36')](_0x5be23e[_0x6f29('0x32')],_0x5be23e[_0x6f29('0x34')]);_0x231dd7[_0x6f29('0x37')]=_[_0x6f29('0x36')](_0x5be23e['model'],qs[_0x6f29('0x38')](_0x110e75['query'][_0x6f29('0x38')]));_0x231dd7[_0x6f29('0x37')]=_0x231dd7[_0x6f29('0x37')]['length']?_0x231dd7[_0x6f29('0x37')]:_0x5be23e[_0x6f29('0x32')];_0x231dd7[_0x6f29('0x52')]=qs['sort'](_0x110e75[_0x6f29('0x34')]['sort']);_0x231dd7[_0x6f29('0x3c')]=qs[_0x6f29('0x35')](_[_0x6f29('0x53')](_0x110e75['query'],_0x5be23e[_0x6f29('0x35')]));if(_0x110e75[_0x6f29('0x34')]['filter']){_0x231dd7['where']=_[_0x6f29('0x3e')](_0x231dd7[_0x6f29('0x3c')],{'$or':_[_0x6f29('0x3f')](_0x231dd7[_0x6f29('0x37')],function(_0x583211){var _0x1f2fc9={};_0x1f2fc9[_0x583211]={'$like':'%'+_0x110e75['query'][_0x6f29('0x3d')]+'%'};return _0x1f2fc9;})});}_0x231dd7=_['merge']({},_0x231dd7,_0x110e75[_0x6f29('0x43')]);return _0x4b7381[_0x6f29('0x55')](_0x231dd7);}})['then'](function(_0x16e4e8){if(_0x16e4e8){_0x5c79dc=_0x16e4e8['length'];if(!_0x110e75[_0x6f29('0x34')]['hasOwnProperty']('nolimit')){_0x231dd7[_0x6f29('0x27')]=qs[_0x6f29('0x27')](_0x110e75[_0x6f29('0x34')][_0x6f29('0x27')]);_0x231dd7['offset']=qs['offset'](_0x110e75['query'][_0x6f29('0x26')]);}return _0x4b7381[_0x6f29('0x55')](_0x231dd7);}})['then'](function(_0x5b33b2){if(_0x5b33b2){return _0x5b33b2?{'count':_0x5c79dc,'rows':_0x5b33b2}:null;}})[_0x6f29('0x18')](respondWithResult(_0x4f5231,null))['catch'](handleError(_0x4f5231,null));};exports[_0x6f29('0x56')]=function(_0x5b8448,_0x13ba55,_0x196387){var _0x3f79ed={};var _0x15d2fd={};var _0x2f2ac5;var _0x1a3183;return db['DeskConfiguration']['findOne']({'where':{'id':_0x5b8448[_0x6f29('0x49')]['id']}})[_0x6f29('0x18')](handleEntityNotFound(_0x13ba55,null))[_0x6f29('0x18')](function(_0x13f76d){if(_0x13f76d){_0x2f2ac5=_0x13f76d;_0x15d2fd['model']=_['keys'](db[_0x6f29('0x57')][_0x6f29('0x31')]);_0x15d2fd[_0x6f29('0x34')]=_[_0x6f29('0x33')](_0x5b8448[_0x6f29('0x34')]);_0x15d2fd[_0x6f29('0x35')]=_[_0x6f29('0x36')](_0x15d2fd[_0x6f29('0x32')],_0x15d2fd[_0x6f29('0x34')]);_0x3f79ed[_0x6f29('0x37')]=_[_0x6f29('0x36')](_0x15d2fd[_0x6f29('0x32')],qs['fields'](_0x5b8448[_0x6f29('0x34')][_0x6f29('0x38')]));_0x3f79ed[_0x6f29('0x37')]=_0x3f79ed['attributes']['length']?_0x3f79ed[_0x6f29('0x37')]:_0x15d2fd[_0x6f29('0x32')];_0x3f79ed[_0x6f29('0x52')]=qs[_0x6f29('0x3b')](_0x5b8448[_0x6f29('0x34')]['sort']);_0x3f79ed[_0x6f29('0x3c')]=qs[_0x6f29('0x35')](_[_0x6f29('0x53')](_0x5b8448['query'],_0x15d2fd['filters']));if(_0x5b8448[_0x6f29('0x34')][_0x6f29('0x3d')]){_0x3f79ed['where']=_[_0x6f29('0x3e')](_0x3f79ed[_0x6f29('0x3c')],{'$or':_['map'](_0x3f79ed[_0x6f29('0x37')],function(_0x447dd4){var _0x5b9c0b={};_0x5b9c0b[_0x447dd4]={'$like':'%'+_0x5b8448[_0x6f29('0x34')][_0x6f29('0x3d')]+'%'};return _0x5b9c0b;})});}_0x3f79ed=_[_0x6f29('0x3e')]({},_0x3f79ed,_0x5b8448[_0x6f29('0x43')]);return _0x2f2ac5['getTags'](_0x3f79ed);}})['then'](function(_0x52c1f4){if(_0x52c1f4){_0x1a3183=_0x52c1f4[_0x6f29('0x4a')];if(!_0x5b8448[_0x6f29('0x34')][_0x6f29('0x39')](_0x6f29('0x3a'))){_0x3f79ed[_0x6f29('0x27')]=qs['limit'](_0x5b8448[_0x6f29('0x34')][_0x6f29('0x27')]);_0x3f79ed[_0x6f29('0x26')]=qs[_0x6f29('0x26')](_0x5b8448[_0x6f29('0x34')][_0x6f29('0x26')]);}return _0x2f2ac5[_0x6f29('0x56')](_0x3f79ed);}})['then'](function(_0x28ead5){if(_0x28ead5){return _0x28ead5?{'count':_0x1a3183,'rows':_0x28ead5}:null;}})[_0x6f29('0x18')](respondWithResult(_0x13ba55,null))[_0x6f29('0x22')](handleError(_0x13ba55,null));};exports['setTags']=function(_0x3f90b5,_0x5e3163,_0x2dfdcc){if(_0x3f90b5['body']['id']){delete _0x3f90b5[_0x6f29('0x4d')]['id'];}return db[_0x6f29('0x44')][_0x6f29('0x50')]({'where':{'id':_0x3f90b5[_0x6f29('0x49')]['id']}})[_0x6f29('0x18')](handleEntityNotFound(_0x5e3163,null))[_0x6f29('0x18')](function(_0x3f7748){if(_0x3f7748){return _0x3f7748['setTags'](_0x3f90b5[_0x6f29('0x4d')]['ids']||[]);}return null;})['then'](respondWithResult(_0x5e3163,null))[_0x6f29('0x22')](handleError(_0x5e3163,null));}; \ No newline at end of file +var _0x5e14=['status','end','json','offset','set','Content-Range','apply','reject','update','destroy','then','name','DeskConfiguration','rawAttributes','query','keys','filters','attributes','intersection','model','length','nolimit','limit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','count','includeAll','include','findAll','rows','show','params','fields','find','create','body','findOne','DeskField','getFields','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','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','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus'];(function(_0x55a6f0,_0x385821){var _0x3a3e99=function(_0x5042d2){while(--_0x5042d2){_0x55a6f0['push'](_0x55a6f0['shift']());}};_0x3a3e99(++_0x385821);}(_0x5e14,0x164));var _0x45e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e14[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x45e1('0x0'));var emlformat=require(_0x45e1('0x1'));var rimraf=require(_0x45e1('0x2'));var zipdir=require(_0x45e1('0x3'));var jsonpatch=require(_0x45e1('0x4'));var rp=require(_0x45e1('0x5'));var moment=require(_0x45e1('0x6'));var BPromise=require(_0x45e1('0x7'));var Mustache=require(_0x45e1('0x8'));var util=require(_0x45e1('0x9'));var path=require(_0x45e1('0xa'));var sox=require(_0x45e1('0xb'));var csv=require(_0x45e1('0xc'));var ejs=require(_0x45e1('0xd'));var fs=require('fs');var _=require(_0x45e1('0xe'));var squel=require(_0x45e1('0xf'));var crypto=require(_0x45e1('0x10'));var jsforce=require(_0x45e1('0x11'));var deskjs=require(_0x45e1('0x12'));var toCsv=require(_0x45e1('0xc'));var querystring=require(_0x45e1('0x13'));var Papa=require(_0x45e1('0x14'));var Redis=require('ioredis');var authService=require(_0x45e1('0x15'));var qs=require(_0x45e1('0x16'));var hardwareService=require(_0x45e1('0x17'));var logger=require('../../config/logger')(_0x45e1('0x18'));var utils=require('../../config/utils');var config=require(_0x45e1('0x19'));var db=require(_0x45e1('0x1a'))['db'];var jayson=require(_0x45e1('0x1b'));var client=jayson[_0x45e1('0x1c')][_0x45e1('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x2ec2b9,_0x2ab53e,_0x59e307){if(_0x59e307){var _0xfcb873=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xfcb873[_0x45e1('0x1e')](_0x2ab53e)){return _0x2ec2b9;}else{throw new Error(_0x45e1('0x1f'));}}else{return _0x2ec2b9;}}function respondWithRpcPromise(_0x370297,_0x4364a0,_0x235cb9,_0x35cce5){return new BPromise(function(_0x4c2344,_0x5d9dba){var _0x2de680=_0x35cce5||client;return _0x2de680['request'](_0x370297,_0x235cb9)['then'](function(_0x586ebd){logger[_0x45e1('0x20')](_0x45e1('0x21'),_0x4364a0,_0x45e1('0x22'));logger[_0x45e1('0x23')](_0x45e1('0x24'),_0x4364a0,_0x45e1('0x22'),JSON[_0x45e1('0x25')](_0x586ebd));if(_0x586ebd[_0x45e1('0x26')]){if(_0x586ebd['error'][_0x45e1('0x27')]===0x1f4){logger['error'](_0x45e1('0x21'),_0x4364a0,_0x586ebd[_0x45e1('0x26')][_0x45e1('0x28')]);return _0x5d9dba(_0x586ebd[_0x45e1('0x26')][_0x45e1('0x28')]);}logger['error'](_0x45e1('0x21'),_0x4364a0,_0x586ebd[_0x45e1('0x26')][_0x45e1('0x28')]);return _0x4c2344(_0x586ebd[_0x45e1('0x26')][_0x45e1('0x28')]);}else{logger[_0x45e1('0x20')](_0x45e1('0x21'),_0x4364a0,_0x45e1('0x22'));_0x4c2344(_0x586ebd[_0x45e1('0x29')][_0x45e1('0x28')]);}})[_0x45e1('0x2a')](function(_0x51fb60){logger[_0x45e1('0x26')](_0x45e1('0x21'),_0x4364a0,_0x51fb60);_0x5d9dba(_0x51fb60);});});}function respondWithStatusCode(_0xbbaadd,_0x2d615a){_0x2d615a=_0x2d615a||0xcc;return function(_0x200ac2){if(_0x200ac2){return _0xbbaadd[_0x45e1('0x2b')](_0x2d615a);}return _0xbbaadd[_0x45e1('0x2c')](_0x2d615a)[_0x45e1('0x2d')]();};}function respondWithResult(_0x5cd4c6,_0x353eb6){_0x353eb6=_0x353eb6||0xc8;return function(_0x3889bf){if(_0x3889bf){return _0x5cd4c6[_0x45e1('0x2c')](_0x353eb6)[_0x45e1('0x2e')](_0x3889bf);}};}function respondWithFilteredResult(_0x2a3f95,_0x2d2b14){return function(_0x371cf5){if(_0x371cf5){var _0x29aadb=_0x371cf5['count'],_0x8b253=_0x2d2b14[_0x45e1('0x2f')],_0x541a9a=_0x2d2b14[_0x45e1('0x2f')]+_0x2d2b14['limit'],_0x2b6287;if(_0x541a9a>=_0x29aadb){_0x541a9a=_0x29aadb;_0x2b6287=0xc8;}else{_0x2b6287=0xce;}_0x2a3f95[_0x45e1('0x2c')](_0x2b6287);return _0x2a3f95[_0x45e1('0x30')](_0x45e1('0x31'),_0x8b253+'-'+_0x541a9a+'/'+_0x29aadb)[_0x45e1('0x2e')](_0x371cf5);}return null;};}function patchUpdates(_0x1f2069){return function(_0x290d99){try{jsonpatch[_0x45e1('0x32')](_0x290d99,_0x1f2069,!![]);}catch(_0x47e77d){return BPromise[_0x45e1('0x33')](_0x47e77d);}return _0x290d99['save']();};}function saveUpdates(_0x2c87e0,_0x5d906){return function(_0x3df426){if(_0x3df426){return _0x3df426[_0x45e1('0x34')](_0x2c87e0)['then'](function(_0x5dde68){return _0x5dde68;});}return null;};}function removeEntity(_0xe7ad70,_0x51e5b0){return function(_0x36e74a){if(_0x36e74a){return _0x36e74a[_0x45e1('0x35')]()[_0x45e1('0x36')](function(){_0xe7ad70['status'](0xcc)[_0x45e1('0x2d')]();});}};}function handleEntityNotFound(_0x3ffeb4,_0x41d382){return function(_0x40dc92){if(!_0x40dc92){_0x3ffeb4[_0x45e1('0x2b')](0x194);}return _0x40dc92;};}function handleError(_0x5ad231,_0xb3e047){_0xb3e047=_0xb3e047||0x1f4;return function(_0x32bd49){logger[_0x45e1('0x26')](_0x32bd49['stack']);if(_0x32bd49['name']){delete _0x32bd49[_0x45e1('0x37')];}_0x5ad231[_0x45e1('0x2c')](_0xb3e047)['send'](_0x32bd49);};}exports['index']=function(_0x3bf693,_0x29b20b){var _0x54142a={},_0x207a71={},_0x588017={'count':0x0,'rows':[]};var _0x2447db=db[_0x45e1('0x38')][_0x45e1('0x39')];_0x207a71['model']=_['keys'](_0x2447db);_0x207a71[_0x45e1('0x3a')]=_[_0x45e1('0x3b')](_0x3bf693[_0x45e1('0x3a')]);_0x207a71[_0x45e1('0x3c')]=_['intersection'](_0x207a71['model'],_0x207a71['query']);_0x54142a[_0x45e1('0x3d')]=_[_0x45e1('0x3e')](_0x207a71[_0x45e1('0x3f')],qs['fields'](_0x3bf693['query']['fields']));_0x54142a[_0x45e1('0x3d')]=_0x54142a[_0x45e1('0x3d')][_0x45e1('0x40')]?_0x54142a[_0x45e1('0x3d')]:_0x207a71[_0x45e1('0x3f')];if(!_0x3bf693[_0x45e1('0x3a')]['hasOwnProperty'](_0x45e1('0x41'))){_0x54142a[_0x45e1('0x42')]=qs[_0x45e1('0x42')](_0x3bf693[_0x45e1('0x3a')]['limit']);_0x54142a[_0x45e1('0x2f')]=qs['offset'](_0x3bf693[_0x45e1('0x3a')]['offset']);}_0x54142a[_0x45e1('0x43')]=qs[_0x45e1('0x44')](_0x3bf693[_0x45e1('0x3a')][_0x45e1('0x44')]);_0x54142a[_0x45e1('0x45')]=qs['filters'](_[_0x45e1('0x46')](_0x3bf693[_0x45e1('0x3a')],_0x207a71[_0x45e1('0x3c')]));if(_0x3bf693[_0x45e1('0x3a')][_0x45e1('0x47')]){_0x54142a[_0x45e1('0x45')]=_['merge'](_0x54142a[_0x45e1('0x45')],{'$or':_[_0x45e1('0x48')](_0x2447db,function(_0x5e25f8){if(_0x5e25f8[_0x45e1('0x49')][_0x45e1('0x4a')]!==_0x45e1('0x4b')){var _0x2b1d95={};_0x2b1d95[_0x5e25f8[_0x45e1('0x4c')]]={'$like':'%'+_0x3bf693[_0x45e1('0x3a')][_0x45e1('0x47')]+'%'};return _0x2b1d95;}})});}_0x54142a=_[_0x45e1('0x4d')]({},_0x54142a,_0x3bf693[_0x45e1('0x4e')]);var _0x3ff8af={'where':_0x54142a[_0x45e1('0x45')]};return db[_0x45e1('0x38')][_0x45e1('0x4f')](_0x3ff8af)[_0x45e1('0x36')](function(_0x20f299){_0x588017['count']=_0x20f299;if(_0x3bf693[_0x45e1('0x3a')][_0x45e1('0x50')]){_0x54142a[_0x45e1('0x51')]=[{'all':!![]}];}return db[_0x45e1('0x38')][_0x45e1('0x52')](_0x54142a);})[_0x45e1('0x36')](function(_0x241a06){_0x588017[_0x45e1('0x53')]=_0x241a06;return _0x588017;})[_0x45e1('0x36')](respondWithFilteredResult(_0x29b20b,_0x54142a))[_0x45e1('0x2a')](handleError(_0x29b20b,null));};exports[_0x45e1('0x54')]=function(_0x4ca1a0,_0x839808){var _0x4a6b2e={'raw':![],'where':{'id':_0x4ca1a0[_0x45e1('0x55')]['id']}},_0x21f7e9={};_0x21f7e9[_0x45e1('0x3f')]=_[_0x45e1('0x3b')](db['DeskConfiguration'][_0x45e1('0x39')]);_0x21f7e9[_0x45e1('0x3a')]=_[_0x45e1('0x3b')](_0x4ca1a0[_0x45e1('0x3a')]);_0x21f7e9[_0x45e1('0x3c')]=_[_0x45e1('0x3e')](_0x21f7e9['model'],_0x21f7e9[_0x45e1('0x3a')]);_0x4a6b2e[_0x45e1('0x3d')]=_[_0x45e1('0x3e')](_0x21f7e9[_0x45e1('0x3f')],qs['fields'](_0x4ca1a0[_0x45e1('0x3a')][_0x45e1('0x56')]));_0x4a6b2e[_0x45e1('0x3d')]=_0x4a6b2e[_0x45e1('0x3d')][_0x45e1('0x40')]?_0x4a6b2e[_0x45e1('0x3d')]:_0x21f7e9[_0x45e1('0x3f')];if(_0x4ca1a0[_0x45e1('0x3a')][_0x45e1('0x50')]){_0x4a6b2e[_0x45e1('0x51')]=[{'all':!![]}];}_0x4a6b2e=_['merge']({},_0x4a6b2e,_0x4ca1a0[_0x45e1('0x4e')]);return db[_0x45e1('0x38')][_0x45e1('0x57')](_0x4a6b2e)[_0x45e1('0x36')](handleEntityNotFound(_0x839808,null))['then'](respondWithResult(_0x839808,null))[_0x45e1('0x2a')](handleError(_0x839808,null));};exports[_0x45e1('0x58')]=function(_0x4e0bca,_0x41efd0){return db[_0x45e1('0x38')][_0x45e1('0x58')](_0x4e0bca[_0x45e1('0x59')],{})[_0x45e1('0x36')](respondWithResult(_0x41efd0,0xc9))['catch'](handleError(_0x41efd0,null));};exports[_0x45e1('0x34')]=function(_0x34ba63,_0x4456e0){if(_0x34ba63[_0x45e1('0x59')]['id']){delete _0x34ba63['body']['id'];}return db[_0x45e1('0x38')][_0x45e1('0x57')]({'where':{'id':_0x34ba63['params']['id']}})[_0x45e1('0x36')](handleEntityNotFound(_0x4456e0,null))[_0x45e1('0x36')](saveUpdates(_0x34ba63[_0x45e1('0x59')],null))[_0x45e1('0x36')](respondWithResult(_0x4456e0,null))[_0x45e1('0x2a')](handleError(_0x4456e0,null));};exports[_0x45e1('0x35')]=function(_0x5a34c5,_0x5840d4){return db['DeskConfiguration'][_0x45e1('0x57')]({'where':{'id':_0x5a34c5['params']['id']}})[_0x45e1('0x36')](handleEntityNotFound(_0x5840d4,null))[_0x45e1('0x36')](removeEntity(_0x5840d4,null))[_0x45e1('0x2a')](handleError(_0x5840d4,null));};exports['getFields']=function(_0x177e3c,_0x2eb1c6,_0x18aadd){var _0x472f10={};var _0xbf2cc4={};var _0x4de9a0;var _0x21cc7c;return db[_0x45e1('0x38')][_0x45e1('0x5a')]({'where':{'id':_0x177e3c[_0x45e1('0x55')]['id']}})[_0x45e1('0x36')](handleEntityNotFound(_0x2eb1c6,null))[_0x45e1('0x36')](function(_0x447151){if(_0x447151){_0x4de9a0=_0x447151;_0xbf2cc4['model']=_[_0x45e1('0x3b')](db[_0x45e1('0x5b')][_0x45e1('0x39')]);_0xbf2cc4[_0x45e1('0x3a')]=_[_0x45e1('0x3b')](_0x177e3c[_0x45e1('0x3a')]);_0xbf2cc4[_0x45e1('0x3c')]=_[_0x45e1('0x3e')](_0xbf2cc4[_0x45e1('0x3f')],_0xbf2cc4[_0x45e1('0x3a')]);_0x472f10['attributes']=_[_0x45e1('0x3e')](_0xbf2cc4[_0x45e1('0x3f')],qs[_0x45e1('0x56')](_0x177e3c[_0x45e1('0x3a')]['fields']));_0x472f10[_0x45e1('0x3d')]=_0x472f10[_0x45e1('0x3d')]['length']?_0x472f10[_0x45e1('0x3d')]:_0xbf2cc4[_0x45e1('0x3f')];_0x472f10[_0x45e1('0x43')]=qs['sort'](_0x177e3c[_0x45e1('0x3a')]['sort']);_0x472f10[_0x45e1('0x45')]=qs[_0x45e1('0x3c')](_[_0x45e1('0x46')](_0x177e3c[_0x45e1('0x3a')],_0xbf2cc4['filters']));if(_0x177e3c['query'][_0x45e1('0x47')]){_0x472f10[_0x45e1('0x45')]=_[_0x45e1('0x4d')](_0x472f10['where'],{'$or':_[_0x45e1('0x48')](_0x472f10[_0x45e1('0x3d')],function(_0x4568e4){var _0x1e9735={};_0x1e9735[_0x4568e4]={'$like':'%'+_0x177e3c['query'][_0x45e1('0x47')]+'%'};return _0x1e9735;})});}_0x472f10=_[_0x45e1('0x4d')]({},_0x472f10,_0x177e3c[_0x45e1('0x4e')]);return _0x4de9a0[_0x45e1('0x5c')](_0x472f10);}})[_0x45e1('0x36')](function(_0x4278ec){if(_0x4278ec){_0x21cc7c=_0x4278ec[_0x45e1('0x40')];if(!_0x177e3c[_0x45e1('0x3a')][_0x45e1('0x5d')]('nolimit')){_0x472f10[_0x45e1('0x42')]=qs['limit'](_0x177e3c[_0x45e1('0x3a')][_0x45e1('0x42')]);_0x472f10['offset']=qs[_0x45e1('0x2f')](_0x177e3c[_0x45e1('0x3a')][_0x45e1('0x2f')]);}return _0x4de9a0[_0x45e1('0x5c')](_0x472f10);}})[_0x45e1('0x36')](function(_0x422c9b){if(_0x422c9b){return _0x422c9b?{'count':_0x21cc7c,'rows':_0x422c9b}:null;}})[_0x45e1('0x36')](respondWithResult(_0x2eb1c6,null))[_0x45e1('0x2a')](handleError(_0x2eb1c6,null));};exports[_0x45e1('0x5e')]=function(_0x308d49,_0xdd2fd1,_0x2c2b42){var _0x47218e={};var _0x398cf8={};var _0x3aa63a;var _0x574d2e;return db[_0x45e1('0x38')][_0x45e1('0x5a')]({'where':{'id':_0x308d49[_0x45e1('0x55')]['id']}})[_0x45e1('0x36')](handleEntityNotFound(_0xdd2fd1,null))[_0x45e1('0x36')](function(_0xf29469){if(_0xf29469){_0x3aa63a=_0xf29469;_0x398cf8[_0x45e1('0x3f')]=_[_0x45e1('0x3b')](db[_0x45e1('0x5b')]['rawAttributes']);_0x398cf8[_0x45e1('0x3a')]=_[_0x45e1('0x3b')](_0x308d49[_0x45e1('0x3a')]);_0x398cf8['filters']=_[_0x45e1('0x3e')](_0x398cf8['model'],_0x398cf8['query']);_0x47218e[_0x45e1('0x3d')]=_[_0x45e1('0x3e')](_0x398cf8['model'],qs['fields'](_0x308d49[_0x45e1('0x3a')][_0x45e1('0x56')]));_0x47218e[_0x45e1('0x3d')]=_0x47218e[_0x45e1('0x3d')][_0x45e1('0x40')]?_0x47218e[_0x45e1('0x3d')]:_0x398cf8['model'];_0x47218e[_0x45e1('0x43')]=qs[_0x45e1('0x44')](_0x308d49[_0x45e1('0x3a')][_0x45e1('0x44')]);_0x47218e[_0x45e1('0x45')]=qs[_0x45e1('0x3c')](_[_0x45e1('0x46')](_0x308d49['query'],_0x398cf8['filters']));if(_0x308d49[_0x45e1('0x3a')]['filter']){_0x47218e['where']=_[_0x45e1('0x4d')](_0x47218e[_0x45e1('0x45')],{'$or':_[_0x45e1('0x48')](_0x47218e[_0x45e1('0x3d')],function(_0x1f976e){var _0x295edf={};_0x295edf[_0x1f976e]={'$like':'%'+_0x308d49[_0x45e1('0x3a')][_0x45e1('0x47')]+'%'};return _0x295edf;})});}_0x47218e=_[_0x45e1('0x4d')]({},_0x47218e,_0x308d49['options']);return _0x3aa63a[_0x45e1('0x5e')](_0x47218e);}})[_0x45e1('0x36')](function(_0x7a70e0){if(_0x7a70e0){_0x574d2e=_0x7a70e0[_0x45e1('0x40')];if(!_0x308d49['query']['hasOwnProperty']('nolimit')){_0x47218e[_0x45e1('0x42')]=qs['limit'](_0x308d49[_0x45e1('0x3a')][_0x45e1('0x42')]);_0x47218e[_0x45e1('0x2f')]=qs[_0x45e1('0x2f')](_0x308d49[_0x45e1('0x3a')][_0x45e1('0x2f')]);}return _0x3aa63a['getSubjects'](_0x47218e);}})[_0x45e1('0x36')](function(_0x3e4589){if(_0x3e4589){return _0x3e4589?{'count':_0x574d2e,'rows':_0x3e4589}:null;}})[_0x45e1('0x36')](respondWithResult(_0xdd2fd1,null))[_0x45e1('0x2a')](handleError(_0xdd2fd1,null));};exports[_0x45e1('0x5f')]=function(_0x141a3b,_0x2e7374,_0xf12da5){var _0x84481c={};var _0x315040={};var _0x577a2b;var _0xafdc3b;return db['DeskConfiguration'][_0x45e1('0x5a')]({'where':{'id':_0x141a3b[_0x45e1('0x55')]['id']}})[_0x45e1('0x36')](handleEntityNotFound(_0x2e7374,null))[_0x45e1('0x36')](function(_0x10fc34){if(_0x10fc34){_0x577a2b=_0x10fc34;_0x315040[_0x45e1('0x3f')]=_['keys'](db[_0x45e1('0x5b')][_0x45e1('0x39')]);_0x315040['query']=_[_0x45e1('0x3b')](_0x141a3b[_0x45e1('0x3a')]);_0x315040['filters']=_[_0x45e1('0x3e')](_0x315040['model'],_0x315040[_0x45e1('0x3a')]);_0x84481c['attributes']=_[_0x45e1('0x3e')](_0x315040[_0x45e1('0x3f')],qs[_0x45e1('0x56')](_0x141a3b[_0x45e1('0x3a')][_0x45e1('0x56')]));_0x84481c[_0x45e1('0x3d')]=_0x84481c[_0x45e1('0x3d')][_0x45e1('0x40')]?_0x84481c['attributes']:_0x315040['model'];_0x84481c[_0x45e1('0x43')]=qs['sort'](_0x141a3b['query'][_0x45e1('0x44')]);_0x84481c[_0x45e1('0x45')]=qs[_0x45e1('0x3c')](_[_0x45e1('0x46')](_0x141a3b[_0x45e1('0x3a')],_0x315040[_0x45e1('0x3c')]));if(_0x141a3b[_0x45e1('0x3a')][_0x45e1('0x47')]){_0x84481c[_0x45e1('0x45')]=_[_0x45e1('0x4d')](_0x84481c[_0x45e1('0x45')],{'$or':_[_0x45e1('0x48')](_0x84481c[_0x45e1('0x3d')],function(_0x4cbbc7){var _0x2635c6={};_0x2635c6[_0x4cbbc7]={'$like':'%'+_0x141a3b[_0x45e1('0x3a')][_0x45e1('0x47')]+'%'};return _0x2635c6;})});}_0x84481c=_[_0x45e1('0x4d')]({},_0x84481c,_0x141a3b[_0x45e1('0x4e')]);return _0x577a2b['getDescriptions'](_0x84481c);}})['then'](function(_0x1e1b5f){if(_0x1e1b5f){_0xafdc3b=_0x1e1b5f[_0x45e1('0x40')];if(!_0x141a3b[_0x45e1('0x3a')]['hasOwnProperty'](_0x45e1('0x41'))){_0x84481c[_0x45e1('0x42')]=qs[_0x45e1('0x42')](_0x141a3b['query'][_0x45e1('0x42')]);_0x84481c['offset']=qs['offset'](_0x141a3b[_0x45e1('0x3a')][_0x45e1('0x2f')]);}return _0x577a2b[_0x45e1('0x5f')](_0x84481c);}})[_0x45e1('0x36')](function(_0x15eb5a){if(_0x15eb5a){return _0x15eb5a?{'count':_0xafdc3b,'rows':_0x15eb5a}:null;}})[_0x45e1('0x36')](respondWithResult(_0x2e7374,null))[_0x45e1('0x2a')](handleError(_0x2e7374,null));};exports[_0x45e1('0x60')]=function(_0x32998d,_0x5c120d,_0x5cc772){var _0x59d07e={};var _0x143655={};var _0x50b341;var _0x3d43cc;return db[_0x45e1('0x38')]['findOne']({'where':{'id':_0x32998d[_0x45e1('0x55')]['id']}})[_0x45e1('0x36')](handleEntityNotFound(_0x5c120d,null))['then'](function(_0x1ce6ae){if(_0x1ce6ae){_0x50b341=_0x1ce6ae;_0x143655[_0x45e1('0x3f')]=_[_0x45e1('0x3b')](db[_0x45e1('0x61')][_0x45e1('0x39')]);_0x143655[_0x45e1('0x3a')]=_[_0x45e1('0x3b')](_0x32998d[_0x45e1('0x3a')]);_0x143655[_0x45e1('0x3c')]=_[_0x45e1('0x3e')](_0x143655[_0x45e1('0x3f')],_0x143655[_0x45e1('0x3a')]);_0x59d07e[_0x45e1('0x3d')]=_[_0x45e1('0x3e')](_0x143655[_0x45e1('0x3f')],qs[_0x45e1('0x56')](_0x32998d['query'][_0x45e1('0x56')]));_0x59d07e[_0x45e1('0x3d')]=_0x59d07e[_0x45e1('0x3d')][_0x45e1('0x40')]?_0x59d07e['attributes']:_0x143655['model'];_0x59d07e[_0x45e1('0x43')]=qs[_0x45e1('0x44')](_0x32998d[_0x45e1('0x3a')][_0x45e1('0x44')]);_0x59d07e['where']=qs[_0x45e1('0x3c')](_['pick'](_0x32998d[_0x45e1('0x3a')],_0x143655[_0x45e1('0x3c')]));if(_0x32998d[_0x45e1('0x3a')][_0x45e1('0x47')]){_0x59d07e[_0x45e1('0x45')]=_['merge'](_0x59d07e[_0x45e1('0x45')],{'$or':_[_0x45e1('0x48')](_0x59d07e[_0x45e1('0x3d')],function(_0x1c54da){var _0x2401fb={};_0x2401fb[_0x1c54da]={'$like':'%'+_0x32998d[_0x45e1('0x3a')][_0x45e1('0x47')]+'%'};return _0x2401fb;})});}_0x59d07e=_['merge']({},_0x59d07e,_0x32998d[_0x45e1('0x4e')]);return _0x50b341[_0x45e1('0x60')](_0x59d07e);}})['then'](function(_0x44de22){if(_0x44de22){_0x3d43cc=_0x44de22[_0x45e1('0x40')];if(!_0x32998d[_0x45e1('0x3a')][_0x45e1('0x5d')](_0x45e1('0x41'))){_0x59d07e['limit']=qs[_0x45e1('0x42')](_0x32998d[_0x45e1('0x3a')][_0x45e1('0x42')]);_0x59d07e[_0x45e1('0x2f')]=qs[_0x45e1('0x2f')](_0x32998d[_0x45e1('0x3a')][_0x45e1('0x2f')]);}return _0x50b341[_0x45e1('0x60')](_0x59d07e);}})[_0x45e1('0x36')](function(_0x32b34f){if(_0x32b34f){return _0x32b34f?{'count':_0x3d43cc,'rows':_0x32b34f}:null;}})[_0x45e1('0x36')](respondWithResult(_0x5c120d,null))[_0x45e1('0x2a')](handleError(_0x5c120d,null));};exports['setTags']=function(_0x5769b5,_0x31eda9,_0x36d587){if(_0x5769b5['body']['id']){delete _0x5769b5['body']['id'];}return db[_0x45e1('0x38')][_0x45e1('0x5a')]({'where':{'id':_0x5769b5[_0x45e1('0x55')]['id']}})[_0x45e1('0x36')](handleEntityNotFound(_0x31eda9,null))[_0x45e1('0x36')](function(_0x1edb30){if(_0x1edb30){return _0x1edb30[_0x45e1('0x62')](_0x5769b5[_0x45e1('0x59')][_0x45e1('0x63')]||[]);}return null;})[_0x45e1('0x36')](respondWithResult(_0x31eda9,null))[_0x45e1('0x2a')](handleError(_0x31eda9,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index bae1366..962def6 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 _0x3a24=['define','DeskConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports'];(function(_0x5f2d26,_0x24eb3b){var _0x241574=function(_0x3e2cae){while(--_0x3e2cae){_0x5f2d26['push'](_0x5f2d26['shift']());}};_0x241574(++_0x24eb3b);}(_0x3a24,0xe2));var _0x43a2=function(_0x396466,_0xe9857b){_0x396466=_0x396466-0x0;var _0x5e9ab4=_0x3a24[_0x396466];return _0x5e9ab4;};'use strict';var _=require(_0x43a2('0x0'));var util=require(_0x43a2('0x1'));var logger=require(_0x43a2('0x2'))(_0x43a2('0x3'));var moment=require(_0x43a2('0x4'));var BPromise=require(_0x43a2('0x5'));var rp=require(_0x43a2('0x6'));var fs=require('fs');var path=require(_0x43a2('0x7'));var rimraf=require(_0x43a2('0x8'));var config=require(_0x43a2('0x9'));var attributes=require(_0x43a2('0xa'));module[_0x43a2('0xb')]=function(_0x597c8a,_0x2c1221){return _0x597c8a[_0x43a2('0xc')](_0x43a2('0xd'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4d6=['../../config/environment','./intDeskConfiguration.attributes','exports','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x37e63d,_0x47a578){var _0x48a8e4=function(_0xb9e16){while(--_0xb9e16){_0x37e63d['push'](_0x37e63d['shift']());}};_0x48a8e4(++_0x47a578);}(_0xf4d6,0x116));var _0x6f4d=function(_0xdebf35,_0x267495){_0xdebf35=_0xdebf35-0x0;var _0x169487=_0xf4d6[_0xdebf35];return _0x169487;};'use strict';var _=require(_0x6f4d('0x0'));var util=require(_0x6f4d('0x1'));var logger=require(_0x6f4d('0x2'))('api');var moment=require(_0x6f4d('0x3'));var BPromise=require(_0x6f4d('0x4'));var rp=require(_0x6f4d('0x5'));var fs=require('fs');var path=require(_0x6f4d('0x6'));var rimraf=require(_0x6f4d('0x7'));var config=require(_0x6f4d('0x8'));var attributes=require(_0x6f4d('0x9'));module[_0x6f4d('0xa')]=function(_0x59e906,_0x1f6b03){return _0x59e906['define']('DeskConfiguration',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 4da1e5c..51dcb57 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 _0x1261=['then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x3af7f5,_0x1bb3ac){var _0x4c0f47=function(_0x36f4ad){while(--_0x36f4ad){_0x3af7f5['push'](_0x3af7f5['shift']());}};_0x4c0f47(++_0x1bb3ac);}(_0x1261,0x144));var _0x1126=function(_0x3aeb36,_0x312dc9){_0x3aeb36=_0x3aeb36-0x0;var _0xa2ef21=_0x1261[_0x3aeb36];return _0xa2ef21;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0xdc97=['DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x35a26a,_0x531187){var _0x53df95=function(_0x560179){while(--_0x560179){_0x35a26a['push'](_0x35a26a['shift']());}};_0x53df95(++_0x531187);}(_0xdc97,0x13b));var _0x7dc9=function(_0xa612cc,_0x3f50bc){_0xa612cc=_0xa612cc-0x0;var _0x3f7177=_0xdc97[_0xa612cc];return _0x3f7177;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var moment=require(_0x7dc9('0x2'));var BPromise=require('bluebird');var rs=require(_0x7dc9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7dc9('0x4'))['db'];var utils=require(_0x7dc9('0x5'));var logger=require('../../config/logger')(_0x7dc9('0x6'));var config=require(_0x7dc9('0x7'));var jayson=require(_0x7dc9('0x8'));var client=jayson[_0x7dc9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2636ef,_0x4f91c7,_0x4b3229){return new BPromise(function(_0x2ff923,_0x23737d){return client[_0x7dc9('0xa')](_0x2636ef,_0x4b3229)[_0x7dc9('0xb')](function(_0x3dd07e){logger['info'](_0x7dc9('0xc'),_0x4f91c7,_0x7dc9('0xd'));logger[_0x7dc9('0xe')](_0x7dc9('0xf'),_0x4f91c7,_0x7dc9('0xd'),JSON[_0x7dc9('0x10')](_0x3dd07e));if(_0x3dd07e[_0x7dc9('0x11')]){if(_0x3dd07e['error']['code']===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x4f91c7,_0x3dd07e[_0x7dc9('0x11')][_0x7dc9('0x12')]);return _0x23737d(_0x3dd07e['error'][_0x7dc9('0x12')]);}logger[_0x7dc9('0x11')](_0x7dc9('0xc'),_0x4f91c7,_0x3dd07e[_0x7dc9('0x11')][_0x7dc9('0x12')]);return _0x2ff923(_0x3dd07e[_0x7dc9('0x11')]['message']);}else{logger[_0x7dc9('0x13')](_0x7dc9('0xc'),_0x4f91c7,_0x7dc9('0xd'));_0x2ff923(_0x3dd07e[_0x7dc9('0x14')][_0x7dc9('0x12')]);}})[_0x7dc9('0x15')](function(_0x45698c){logger[_0x7dc9('0x11')](_0x7dc9('0xc'),_0x4f91c7,_0x45698c);_0x23737d(_0x45698c);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index c79709e..09a38eb 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 _0xe0aa=['delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x437d00,_0x4bb576){var _0x18d119=function(_0x4834da){while(--_0x4834da){_0x437d00['push'](_0x437d00['shift']());}};_0x18d119(++_0x4bb576);}(_0xe0aa,0xe7));var _0xae0a=function(_0x2892da,_0x191a40){_0x2892da=_0x2892da-0x0;var _0x28cff2=_0xe0aa[_0x2892da];return _0x28cff2;};'use strict';var multer=require(_0xae0a('0x0'));var util=require(_0xae0a('0x1'));var path=require(_0xae0a('0x2'));var timeout=require(_0xae0a('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xae0a('0x4'));var interaction=require(_0xae0a('0x5'));var config=require(_0xae0a('0x6'));var controller=require(_0xae0a('0x7'));router[_0xae0a('0x8')]('/',auth[_0xae0a('0x9')](),controller[_0xae0a('0xa')]);router[_0xae0a('0x8')](_0xae0a('0xb'),auth[_0xae0a('0x9')](),controller['show']);router[_0xae0a('0xc')]('/',auth[_0xae0a('0x9')](),controller[_0xae0a('0xd')]);router[_0xae0a('0xe')](_0xae0a('0xb'),auth[_0xae0a('0x9')](),controller[_0xae0a('0xf')]);router[_0xae0a('0x10')](_0xae0a('0xb'),auth[_0xae0a('0x9')](),controller[_0xae0a('0x11')]);module[_0xae0a('0x12')]=router; \ No newline at end of file +var _0x7d27=['index','show','post','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','../../config/environment','./intDeskField.controller','get','isAuthenticated'];(function(_0x1991b1,_0x254017){var _0x1774d4=function(_0x55778c){while(--_0x55778c){_0x1991b1['push'](_0x1991b1['shift']());}};_0x1774d4(++_0x254017);}(_0x7d27,0x17e));var _0x77d2=function(_0x3b119f,_0x4f10d3){_0x3b119f=_0x3b119f-0x0;var _0x1aff29=_0x7d27[_0x3b119f];return _0x1aff29;};'use strict';var multer=require(_0x77d2('0x0'));var util=require(_0x77d2('0x1'));var path=require('path');var timeout=require(_0x77d2('0x2'));var express=require(_0x77d2('0x3'));var router=express[_0x77d2('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x77d2('0x5'));var controller=require(_0x77d2('0x6'));router[_0x77d2('0x7')]('/',auth[_0x77d2('0x8')](),controller[_0x77d2('0x9')]);router[_0x77d2('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x77d2('0xa')]);router[_0x77d2('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x77d2('0xc')](_0x77d2('0xd'),auth['isAuthenticated'](),controller[_0x77d2('0xe')]);router[_0x77d2('0xf')](_0x77d2('0xd'),auth['isAuthenticated'](),controller[_0x77d2('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 9d03815..ad6b8d2 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 _0xd8b0=['keyValue','string','STRING','variable','BOOLEAN','sequelize','exports','customVariable'];(function(_0x845647,_0x2c8c85){var _0x5051be=function(_0x130475){while(--_0x130475){_0x845647['push'](_0x845647['shift']());}};_0x5051be(++_0x2c8c85);}(_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')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x0d8b('0x2'),_0x0d8b('0x3')),'defaultValue':_0x0d8b('0x4')},'content':{'type':Sequelize[_0x0d8b('0x5')]},'key':{'type':Sequelize[_0x0d8b('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x0d8b('0x6'),_0x0d8b('0x2'))},'keyContent':{'type':Sequelize[_0x0d8b('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0d8b('0x5')]},'customField':{'type':Sequelize[_0x0d8b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3c81=['customVariable','BOOLEAN','sequelize','exports','string','variable','STRING','ENUM'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3c81,0x102));var _0x13c8=function(_0x420811,_0xe7654c){_0x420811=_0x420811-0x0;var _0x4eb8a9=_0x3c81[_0x420811];return _0x4eb8a9;};'use strict';var Sequelize=require(_0x13c8('0x0'));module[_0x13c8('0x1')]={'type':{'type':Sequelize['ENUM'](_0x13c8('0x2'),_0x13c8('0x3'),'customVariable','keyValue'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x13c8('0x4')]},'keyType':{'type':Sequelize[_0x13c8('0x5')](_0x13c8('0x2'),_0x13c8('0x3'),_0x13c8('0x6'))},'keyContent':{'type':Sequelize[_0x13c8('0x4')]},'idField':{'type':Sequelize[_0x13c8('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index cdf187d..3bddbc6 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 _0x207d=['lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','status','end','json','count','offset','set','Content-Range','reject','save','update','then','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','type','key','field','options','DeskField','includeAll','findAll','catch','params','include','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x207d,0x10d));var _0xd207=function(_0x1bd2eb,_0x53f35d){_0x1bd2eb=_0x1bd2eb-0x0;var _0x36b53e=_0x207d[_0x1bd2eb];return _0x36b53e;};'use strict';var pdf=require(_0xd207('0x0'));var emlformat=require(_0xd207('0x1'));var rimraf=require(_0xd207('0x2'));var zipdir=require(_0xd207('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd207('0x4'));var moment=require('moment');var BPromise=require(_0xd207('0x5'));var Mustache=require(_0xd207('0x6'));var util=require('util');var path=require(_0xd207('0x7'));var sox=require(_0xd207('0x8'));var csv=require(_0xd207('0x9'));var ejs=require(_0xd207('0xa'));var fs=require('fs');var _=require(_0xd207('0xb'));var squel=require(_0xd207('0xc'));var crypto=require(_0xd207('0xd'));var jsforce=require(_0xd207('0xe'));var deskjs=require(_0xd207('0xf'));var toCsv=require(_0xd207('0x9'));var querystring=require(_0xd207('0x10'));var Papa=require('papaparse');var Redis=require(_0xd207('0x11'));var authService=require(_0xd207('0x12'));var qs=require(_0xd207('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd207('0x14'));var utils=require(_0xd207('0x15'));var config=require(_0xd207('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18c785,_0x4fc800){_0x4fc800=_0x4fc800||0xcc;return function(_0x4d9123){if(_0x4d9123){return _0x18c785['sendStatus'](_0x4fc800);}return _0x18c785[_0xd207('0x17')](_0x4fc800)[_0xd207('0x18')]();};}function respondWithResult(_0x25934c,_0x1f6a3e){_0x1f6a3e=_0x1f6a3e||0xc8;return function(_0x46c7e7){if(_0x46c7e7){return _0x25934c[_0xd207('0x17')](_0x1f6a3e)[_0xd207('0x19')](_0x46c7e7);}};}function respondWithFilteredResult(_0x2ba01f,_0x194eef){return function(_0x2ab263){if(_0x2ab263){var _0x1c5a1d=_0x2ab263[_0xd207('0x1a')],_0x518746=_0x194eef[_0xd207('0x1b')],_0x540c2d=_0x194eef['offset']+_0x194eef['limit'],_0x12eb54;if(_0x540c2d>=_0x1c5a1d){_0x540c2d=_0x1c5a1d;_0x12eb54=0xc8;}else{_0x12eb54=0xce;}_0x2ba01f[_0xd207('0x17')](_0x12eb54);return _0x2ba01f[_0xd207('0x1c')](_0xd207('0x1d'),_0x518746+'-'+_0x540c2d+'/'+_0x1c5a1d)[_0xd207('0x19')](_0x2ab263);}return null;};}function patchUpdates(_0x5c2799){return function(_0x46aa4b){try{jsonpatch['apply'](_0x46aa4b,_0x5c2799,!![]);}catch(_0x49f5f7){return BPromise[_0xd207('0x1e')](_0x49f5f7);}return _0x46aa4b[_0xd207('0x1f')]();};}function saveUpdates(_0x2d60b7,_0x128a0f){return function(_0x2eb236){if(_0x2eb236){return _0x2eb236[_0xd207('0x20')](_0x2d60b7)[_0xd207('0x21')](function(_0x3247a7){return _0x3247a7;});}return null;};}function removeEntity(_0x34efca,_0x25c0e2){return function(_0x4df77d){if(_0x4df77d){return _0x4df77d['destroy']()['then'](function(){_0x34efca[_0xd207('0x17')](0xcc)[_0xd207('0x18')]();});}};}function handleEntityNotFound(_0x5539bd,_0x4448a4){return function(_0x714d90){if(!_0x714d90){_0x5539bd['sendStatus'](0x194);}return _0x714d90;};}function handleError(_0x3b86db,_0x1b1646){_0x1b1646=_0x1b1646||0x1f4;return function(_0x4d2233){logger[_0xd207('0x22')](_0x4d2233[_0xd207('0x23')]);if(_0x4d2233[_0xd207('0x24')]){delete _0x4d2233[_0xd207('0x24')];}_0x3b86db['status'](_0x1b1646)[_0xd207('0x25')](_0x4d2233);};}exports['index']=function(_0x2496f6,_0x246320){var _0x2e01a8={},_0x2f88e8={},_0x11ad07={'count':0x0,'rows':[]};var _0x1c3d45=db['DeskField'][_0xd207('0x26')];_0x2f88e8[_0xd207('0x27')]=_[_0xd207('0x28')](_0x1c3d45);_0x2f88e8[_0xd207('0x29')]=_[_0xd207('0x28')](_0x2496f6[_0xd207('0x29')]);_0x2f88e8[_0xd207('0x2a')]=_[_0xd207('0x2b')](_0x2f88e8[_0xd207('0x27')],_0x2f88e8[_0xd207('0x29')]);_0x2e01a8['attributes']=_[_0xd207('0x2b')](_0x2f88e8[_0xd207('0x27')],qs[_0xd207('0x2c')](_0x2496f6[_0xd207('0x29')][_0xd207('0x2c')]));_0x2e01a8['attributes']=_0x2e01a8[_0xd207('0x2d')][_0xd207('0x2e')]?_0x2e01a8[_0xd207('0x2d')]:_0x2f88e8[_0xd207('0x27')];if(!_0x2496f6[_0xd207('0x29')][_0xd207('0x2f')](_0xd207('0x30'))){_0x2e01a8[_0xd207('0x31')]=qs[_0xd207('0x31')](_0x2496f6[_0xd207('0x29')]['limit']);_0x2e01a8['offset']=qs['offset'](_0x2496f6[_0xd207('0x29')][_0xd207('0x1b')]);}_0x2e01a8['order']=qs[_0xd207('0x32')](_0x2496f6['query'][_0xd207('0x32')]);_0x2e01a8[_0xd207('0x33')]=qs[_0xd207('0x2a')](_[_0xd207('0x34')](_0x2496f6[_0xd207('0x29')],_0x2f88e8[_0xd207('0x2a')]));if(_0x2496f6[_0xd207('0x29')][_0xd207('0x35')]){_0x2e01a8[_0xd207('0x33')]=_[_0xd207('0x36')](_0x2e01a8[_0xd207('0x33')],{'$or':_[_0xd207('0x37')](_0x1c3d45,function(_0x379698){if(_0x379698[_0xd207('0x38')][_0xd207('0x39')]!=='VIRTUAL'){var _0x29306b={};_0x29306b[_0x379698[_0xd207('0x3a')]]={'$like':'%'+_0x2496f6['query'][_0xd207('0x35')]+'%'};return _0x29306b;}})});}_0x2e01a8=_[_0xd207('0x36')]({},_0x2e01a8,_0x2496f6[_0xd207('0x3b')]);var _0x53f081={'where':_0x2e01a8[_0xd207('0x33')]};return db[_0xd207('0x3c')][_0xd207('0x1a')](_0x53f081)[_0xd207('0x21')](function(_0x26dd5){_0x11ad07[_0xd207('0x1a')]=_0x26dd5;if(_0x2496f6[_0xd207('0x29')][_0xd207('0x3d')]){_0x2e01a8['include']=[{'all':!![]}];}return db[_0xd207('0x3c')][_0xd207('0x3e')](_0x2e01a8);})['then'](function(_0x56c219){_0x11ad07['rows']=_0x56c219;return _0x11ad07;})[_0xd207('0x21')](respondWithFilteredResult(_0x246320,_0x2e01a8))[_0xd207('0x3f')](handleError(_0x246320,null));};exports['show']=function(_0x38bb6a,_0x252431){var _0x24e8f8={'raw':!![],'where':{'id':_0x38bb6a[_0xd207('0x40')]['id']}},_0x33e3d4={};_0x33e3d4[_0xd207('0x27')]=_[_0xd207('0x28')](db[_0xd207('0x3c')][_0xd207('0x26')]);_0x33e3d4[_0xd207('0x29')]=_[_0xd207('0x28')](_0x38bb6a[_0xd207('0x29')]);_0x33e3d4[_0xd207('0x2a')]=_[_0xd207('0x2b')](_0x33e3d4[_0xd207('0x27')],_0x33e3d4[_0xd207('0x29')]);_0x24e8f8['attributes']=_[_0xd207('0x2b')](_0x33e3d4[_0xd207('0x27')],qs[_0xd207('0x2c')](_0x38bb6a['query']['fields']));_0x24e8f8[_0xd207('0x2d')]=_0x24e8f8[_0xd207('0x2d')][_0xd207('0x2e')]?_0x24e8f8[_0xd207('0x2d')]:_0x33e3d4[_0xd207('0x27')];if(_0x38bb6a[_0xd207('0x29')][_0xd207('0x3d')]){_0x24e8f8[_0xd207('0x41')]=[{'all':!![]}];}_0x24e8f8=_[_0xd207('0x36')]({},_0x24e8f8,_0x38bb6a[_0xd207('0x3b')]);return db['DeskField'][_0xd207('0x42')](_0x24e8f8)['then'](handleEntityNotFound(_0x252431,null))[_0xd207('0x21')](respondWithResult(_0x252431,null))[_0xd207('0x3f')](handleError(_0x252431,null));};exports['create']=function(_0x230939,_0x3135a0){return db[_0xd207('0x3c')][_0xd207('0x43')](_0x230939[_0xd207('0x44')],{})['then'](respondWithResult(_0x3135a0,0xc9))[_0xd207('0x3f')](handleError(_0x3135a0,null));};exports[_0xd207('0x20')]=function(_0x1d74d7,_0x4dfe5e){if(_0x1d74d7[_0xd207('0x44')]['id']){delete _0x1d74d7['body']['id'];}return db[_0xd207('0x3c')][_0xd207('0x42')]({'where':{'id':_0x1d74d7[_0xd207('0x40')]['id']}})[_0xd207('0x21')](handleEntityNotFound(_0x4dfe5e,null))[_0xd207('0x21')](saveUpdates(_0x1d74d7[_0xd207('0x44')],null))[_0xd207('0x21')](respondWithResult(_0x4dfe5e,null))[_0xd207('0x3f')](handleError(_0x4dfe5e,null));};exports[_0xd207('0x45')]=function(_0x1234d1,_0x28533c){return db[_0xd207('0x3c')][_0xd207('0x42')]({'where':{'id':_0x1234d1[_0xd207('0x40')]['id']}})['then'](handleEntityNotFound(_0x28533c,null))[_0xd207('0x21')](removeEntity(_0x28533c,null))[_0xd207('0x3f')](handleError(_0x28533c,null));}; \ No newline at end of file +var _0x0b14=['stack','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','type','key','VIRTUAL','merge','includeAll','include','findAll','catch','DeskField','options','find','create','body','update','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','status','count','offset','limit','Content-Range','json','apply','reject','save','destroy','then'];(function(_0x114d22,_0x2f5dea){var _0x374ed2=function(_0x582168){while(--_0x582168){_0x114d22['push'](_0x114d22['shift']());}};_0x374ed2(++_0x2f5dea);}(_0x0b14,0x117));var _0x40b1=function(_0x3f022c,_0x5830b6){_0x3f022c=_0x3f022c-0x0;var _0x53163a=_0x0b14[_0x3f022c];return _0x53163a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x40b1('0x0'));var zipdir=require(_0x40b1('0x1'));var jsonpatch=require(_0x40b1('0x2'));var rp=require(_0x40b1('0x3'));var moment=require(_0x40b1('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x40b1('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x40b1('0x6'));var ejs=require(_0x40b1('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x40b1('0x8'));var crypto=require(_0x40b1('0x9'));var jsforce=require(_0x40b1('0xa'));var deskjs=require(_0x40b1('0xb'));var toCsv=require('to-csv');var querystring=require(_0x40b1('0xc'));var Papa=require(_0x40b1('0xd'));var Redis=require(_0x40b1('0xe'));var authService=require(_0x40b1('0xf'));var qs=require(_0x40b1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x40b1('0x11'))(_0x40b1('0x12'));var utils=require(_0x40b1('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x589065,_0x21be11){_0x21be11=_0x21be11||0xcc;return function(_0x4c400c){if(_0x4c400c){return _0x589065['sendStatus'](_0x21be11);}return _0x589065[_0x40b1('0x14')](_0x21be11)['end']();};}function respondWithResult(_0x3eb344,_0x3fbbfd){_0x3fbbfd=_0x3fbbfd||0xc8;return function(_0x788bc2){if(_0x788bc2){return _0x3eb344[_0x40b1('0x14')](_0x3fbbfd)['json'](_0x788bc2);}};}function respondWithFilteredResult(_0x3f9968,_0x3f3196){return function(_0x1e969f){if(_0x1e969f){var _0x1cf1ae=_0x1e969f[_0x40b1('0x15')],_0x20a544=_0x3f3196['offset'],_0x3a5418=_0x3f3196[_0x40b1('0x16')]+_0x3f3196[_0x40b1('0x17')],_0x5226bf;if(_0x3a5418>=_0x1cf1ae){_0x3a5418=_0x1cf1ae;_0x5226bf=0xc8;}else{_0x5226bf=0xce;}_0x3f9968[_0x40b1('0x14')](_0x5226bf);return _0x3f9968['set'](_0x40b1('0x18'),_0x20a544+'-'+_0x3a5418+'/'+_0x1cf1ae)[_0x40b1('0x19')](_0x1e969f);}return null;};}function patchUpdates(_0x422a88){return function(_0x261d6d){try{jsonpatch[_0x40b1('0x1a')](_0x261d6d,_0x422a88,!![]);}catch(_0x134283){return BPromise[_0x40b1('0x1b')](_0x134283);}return _0x261d6d[_0x40b1('0x1c')]();};}function saveUpdates(_0x34eb2a,_0x1d47da){return function(_0x4a136d){if(_0x4a136d){return _0x4a136d['update'](_0x34eb2a)['then'](function(_0x574e81){return _0x574e81;});}return null;};}function removeEntity(_0x522237,_0x142c8a){return function(_0x1c28ed){if(_0x1c28ed){return _0x1c28ed[_0x40b1('0x1d')]()[_0x40b1('0x1e')](function(){_0x522237[_0x40b1('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a15f6,_0x1c2e74){return function(_0x4f9692){if(!_0x4f9692){_0x3a15f6['sendStatus'](0x194);}return _0x4f9692;};}function handleError(_0x26a891,_0x2702b1){_0x2702b1=_0x2702b1||0x1f4;return function(_0x529a3b){logger['error'](_0x529a3b[_0x40b1('0x1f')]);if(_0x529a3b[_0x40b1('0x20')]){delete _0x529a3b[_0x40b1('0x20')];}_0x26a891['status'](_0x2702b1)[_0x40b1('0x21')](_0x529a3b);};}exports['index']=function(_0x6fbc31,_0x2ae54a){var _0x4c1603={},_0x102804={},_0x3be5b5={'count':0x0,'rows':[]};var _0x19bb73=db['DeskField'][_0x40b1('0x22')];_0x102804[_0x40b1('0x23')]=_[_0x40b1('0x24')](_0x19bb73);_0x102804[_0x40b1('0x25')]=_['keys'](_0x6fbc31[_0x40b1('0x25')]);_0x102804[_0x40b1('0x26')]=_[_0x40b1('0x27')](_0x102804[_0x40b1('0x23')],_0x102804['query']);_0x4c1603[_0x40b1('0x28')]=_[_0x40b1('0x27')](_0x102804['model'],qs[_0x40b1('0x29')](_0x6fbc31[_0x40b1('0x25')][_0x40b1('0x29')]));_0x4c1603['attributes']=_0x4c1603[_0x40b1('0x28')][_0x40b1('0x2a')]?_0x4c1603['attributes']:_0x102804[_0x40b1('0x23')];if(!_0x6fbc31['query']['hasOwnProperty']('nolimit')){_0x4c1603[_0x40b1('0x17')]=qs['limit'](_0x6fbc31[_0x40b1('0x25')][_0x40b1('0x17')]);_0x4c1603[_0x40b1('0x16')]=qs[_0x40b1('0x16')](_0x6fbc31[_0x40b1('0x25')][_0x40b1('0x16')]);}_0x4c1603[_0x40b1('0x2b')]=qs[_0x40b1('0x2c')](_0x6fbc31[_0x40b1('0x25')][_0x40b1('0x2c')]);_0x4c1603[_0x40b1('0x2d')]=qs[_0x40b1('0x26')](_[_0x40b1('0x2e')](_0x6fbc31[_0x40b1('0x25')],_0x102804[_0x40b1('0x26')]));if(_0x6fbc31['query']['filter']){_0x4c1603[_0x40b1('0x2d')]=_['merge'](_0x4c1603['where'],{'$or':_['map'](_0x19bb73,function(_0x335d8b){if(_0x335d8b[_0x40b1('0x2f')][_0x40b1('0x30')]!==_0x40b1('0x31')){var _0x5a6941={};_0x5a6941[_0x335d8b['field']]={'$like':'%'+_0x6fbc31['query']['filter']+'%'};return _0x5a6941;}})});}_0x4c1603=_[_0x40b1('0x32')]({},_0x4c1603,_0x6fbc31['options']);var _0x48f506={'where':_0x4c1603['where']};return db['DeskField']['count'](_0x48f506)[_0x40b1('0x1e')](function(_0x450aef){_0x3be5b5['count']=_0x450aef;if(_0x6fbc31[_0x40b1('0x25')][_0x40b1('0x33')]){_0x4c1603[_0x40b1('0x34')]=[{'all':!![]}];}return db['DeskField'][_0x40b1('0x35')](_0x4c1603);})[_0x40b1('0x1e')](function(_0x5274aa){_0x3be5b5['rows']=_0x5274aa;return _0x3be5b5;})['then'](respondWithFilteredResult(_0x2ae54a,_0x4c1603))[_0x40b1('0x36')](handleError(_0x2ae54a,null));};exports['show']=function(_0xce6b83,_0x2fe832){var _0xb914c1={'raw':!![],'where':{'id':_0xce6b83['params']['id']}},_0x43f3e3={};_0x43f3e3[_0x40b1('0x23')]=_[_0x40b1('0x24')](db[_0x40b1('0x37')]['rawAttributes']);_0x43f3e3[_0x40b1('0x25')]=_[_0x40b1('0x24')](_0xce6b83['query']);_0x43f3e3['filters']=_[_0x40b1('0x27')](_0x43f3e3[_0x40b1('0x23')],_0x43f3e3[_0x40b1('0x25')]);_0xb914c1[_0x40b1('0x28')]=_[_0x40b1('0x27')](_0x43f3e3[_0x40b1('0x23')],qs[_0x40b1('0x29')](_0xce6b83[_0x40b1('0x25')][_0x40b1('0x29')]));_0xb914c1[_0x40b1('0x28')]=_0xb914c1[_0x40b1('0x28')][_0x40b1('0x2a')]?_0xb914c1[_0x40b1('0x28')]:_0x43f3e3['model'];if(_0xce6b83[_0x40b1('0x25')][_0x40b1('0x33')]){_0xb914c1[_0x40b1('0x34')]=[{'all':!![]}];}_0xb914c1=_[_0x40b1('0x32')]({},_0xb914c1,_0xce6b83[_0x40b1('0x38')]);return db[_0x40b1('0x37')][_0x40b1('0x39')](_0xb914c1)['then'](handleEntityNotFound(_0x2fe832,null))[_0x40b1('0x1e')](respondWithResult(_0x2fe832,null))[_0x40b1('0x36')](handleError(_0x2fe832,null));};exports[_0x40b1('0x3a')]=function(_0x1f223c,_0x3b5f5a){return db[_0x40b1('0x37')]['create'](_0x1f223c[_0x40b1('0x3b')],{})[_0x40b1('0x1e')](respondWithResult(_0x3b5f5a,0xc9))['catch'](handleError(_0x3b5f5a,null));};exports[_0x40b1('0x3c')]=function(_0x18230a,_0x580f4c){if(_0x18230a[_0x40b1('0x3b')]['id']){delete _0x18230a['body']['id'];}return db[_0x40b1('0x37')][_0x40b1('0x39')]({'where':{'id':_0x18230a[_0x40b1('0x3d')]['id']}})[_0x40b1('0x1e')](handleEntityNotFound(_0x580f4c,null))[_0x40b1('0x1e')](saveUpdates(_0x18230a[_0x40b1('0x3b')],null))[_0x40b1('0x1e')](respondWithResult(_0x580f4c,null))[_0x40b1('0x36')](handleError(_0x580f4c,null));};exports[_0x40b1('0x1d')]=function(_0x14f662,_0x318282){return db['DeskField']['find']({'where':{'id':_0x14f662[_0x40b1('0x3d')]['id']}})[_0x40b1('0x1e')](handleEntityNotFound(_0x318282,null))[_0x40b1('0x1e')](removeEntity(_0x318282,null))[_0x40b1('0x36')](handleError(_0x318282,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 5494943..9382136 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 _0x0bb0=['bluebird','request-promise','path','../../config/environment','./intDeskField.attributes','exports','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0x0bb0,0x15b));var _0x00bb=function(_0x37929f,_0x2e0146){_0x37929f=_0x37929f-0x0;var _0xf6b6e1=_0x0bb0[_0x37929f];return _0xf6b6e1;};'use strict';var _=require(_0x00bb('0x0'));var util=require(_0x00bb('0x1'));var logger=require(_0x00bb('0x2'))(_0x00bb('0x3'));var moment=require(_0x00bb('0x4'));var BPromise=require(_0x00bb('0x5'));var rp=require(_0x00bb('0x6'));var fs=require('fs');var path=require(_0x00bb('0x7'));var rimraf=require('rimraf');var config=require(_0x00bb('0x8'));var attributes=require(_0x00bb('0x9'));module[_0x00bb('0xa')]=function(_0x59de6c,_0xdbd856){return _0x59de6c['define'](_0x00bb('0xb'),attributes,{'tableName':_0x00bb('0xc'),'paranoid':![],'indexes':[{'name':_0x00bb('0xd'),'fields':[_0x00bb('0xe'),_0x00bb('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd7cc=['moment','bluebird','rimraf','./intDeskField.attributes','exports','DeskField','int_desk_fields','idField','FieldId','lodash'];(function(_0x568f8a,_0x2e09b5){var _0x622b7f=function(_0x53d9f1){while(--_0x53d9f1){_0x568f8a['push'](_0x568f8a['shift']());}};_0x622b7f(++_0x2e09b5);}(_0xd7cc,0xc7));var _0xcd7c=function(_0x40da67,_0x330789){_0x40da67=_0x40da67-0x0;var _0x168fcd=_0xd7cc[_0x40da67];return _0x168fcd;};'use strict';var _=require(_0xcd7c('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xcd7c('0x1'));var BPromise=require(_0xcd7c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcd7c('0x3'));var config=require('../../config/environment');var attributes=require(_0xcd7c('0x4'));module[_0xcd7c('0x5')]=function(_0x58eac4,_0x2771a3){return _0x58eac4['define'](_0xcd7c('0x6'),attributes,{'tableName':_0xcd7c('0x7'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xcd7c('0x8'),_0xcd7c('0x9')],'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 9dfc5db..c593495 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 _0xbd50=['DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbd50,0x196));var _0x0bd5=function(_0x5d5e89,_0x79d8af){_0x5d5e89=_0x5d5e89-0x0;var _0x524532=_0xbd50[_0x5d5e89];return _0x524532;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bd5('0x3'));var fs=require('fs');var Redis=require(_0x0bd5('0x4'));var db=require(_0x0bd5('0x5'))['db'];var utils=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bd5('0x8')][_0x0bd5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcc6cfa,_0x2c0db1,_0x1b99f3){return new BPromise(function(_0x5ebe64,_0x47e78d){return client[_0x0bd5('0xa')](_0xcc6cfa,_0x1b99f3)[_0x0bd5('0xb')](function(_0x259f4c){logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));logger['debug'](_0x0bd5('0xe'),_0x2c0db1,_0x0bd5('0xd'),JSON['stringify'](_0x259f4c));if(_0x259f4c[_0x0bd5('0xf')]){if(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x10')]===0x1f4){logger['error'](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);return _0x47e78d(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')]['message']);return _0x5ebe64(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}else{logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));_0x5ebe64(_0x259f4c[_0x0bd5('0x12')][_0x0bd5('0x11')]);}})['catch'](function(_0x14f32c){logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x14f32c);_0x47e78d(_0x14f32c);});});} \ No newline at end of file +var _0x0e85=['bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x25ff44,_0x479f7f){var _0x4f7a7a=function(_0x2621b1){while(--_0x2621b1){_0x25ff44['push'](_0x25ff44['shift']());}};_0x4f7a7a(++_0x479f7f);}(_0x0e85,0x7c));var _0x50e8=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x0e85[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var moment=require('moment');var BPromise=require(_0x50e8('0x2'));var rs=require(_0x50e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x50e8('0x4'))('rpc');var config=require(_0x50e8('0x5'));var jayson=require(_0x50e8('0x6'));var client=jayson[_0x50e8('0x7')][_0x50e8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e8b01,_0x3ce904,_0x108edc){return new BPromise(function(_0x42665e,_0x988da0){return client[_0x50e8('0x9')](_0x5e8b01,_0x108edc)[_0x50e8('0xa')](function(_0x5825f5){logger[_0x50e8('0xb')](_0x50e8('0xc'),_0x3ce904,_0x50e8('0xd'));logger[_0x50e8('0xe')](_0x50e8('0xf'),_0x3ce904,_0x50e8('0xd'),JSON[_0x50e8('0x10')](_0x5825f5));if(_0x5825f5[_0x50e8('0x11')]){if(_0x5825f5['error']['code']===0x1f4){logger[_0x50e8('0x11')](_0x50e8('0xc'),_0x3ce904,_0x5825f5['error']['message']);return _0x988da0(_0x5825f5[_0x50e8('0x11')][_0x50e8('0x12')]);}logger[_0x50e8('0x11')](_0x50e8('0xc'),_0x3ce904,_0x5825f5['error'][_0x50e8('0x12')]);return _0x42665e(_0x5825f5[_0x50e8('0x11')][_0x50e8('0x12')]);}else{logger['info']('DeskField,\x20%s,\x20%s',_0x3ce904,_0x50e8('0xd'));_0x42665e(_0x5825f5[_0x50e8('0x13')][_0x50e8('0x12')]);}})[_0x50e8('0x14')](function(_0x211731){logger[_0x50e8('0x11')]('DeskField,\x20%s,\x20%s',_0x3ce904,_0x211731);_0x988da0(_0x211731);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index b70f991..fcbff56 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 _0x517b=['update','delete','destroy','exports','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x3718b7,_0x2da677){var _0xf8c91e=function(_0x2519b4){while(--_0x2519b4){_0x3718b7['push'](_0x3718b7['shift']());}};_0xf8c91e(++_0x2da677);}(_0x517b,0x1b9));var _0xb517=function(_0x1c2831,_0x3fca61){_0x1c2831=_0x1c2831-0x0;var _0x425ea1=_0x517b[_0x1c2831];return _0x425ea1;};'use strict';var multer=require('multer');var util=require(_0xb517('0x0'));var path=require(_0xb517('0x1'));var timeout=require(_0xb517('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xb517('0x3'));var config=require(_0xb517('0x4'));var controller=require(_0xb517('0x5'));router[_0xb517('0x6')]('/',auth[_0xb517('0x7')](),controller[_0xb517('0x8')]);router[_0xb517('0x6')](_0xb517('0x9'),auth[_0xb517('0x7')](),controller[_0xb517('0xa')]);router[_0xb517('0x6')](_0xb517('0xb'),auth[_0xb517('0x7')](),controller[_0xb517('0xc')]);router[_0xb517('0x6')](_0xb517('0xd'),auth[_0xb517('0x7')](),controller[_0xb517('0xe')]);router[_0xb517('0xf')]('/',auth[_0xb517('0x7')](),controller[_0xb517('0x10')]);router[_0xb517('0xf')]('/:id/configurations',auth[_0xb517('0x7')](),controller[_0xb517('0x11')]);router[_0xb517('0x12')](_0xb517('0x9'),auth[_0xb517('0x7')](),controller[_0xb517('0x13')]);router[_0xb517('0x14')]('/:id',auth[_0xb517('0x7')](),controller[_0xb517('0x15')]);module[_0xb517('0x16')]=router; \ No newline at end of file +var _0xeeb2=['/:id/configurations','getConfigurations','/:id/fields','getFields','addConfiguration','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show'];(function(_0x16d5b4,_0x2b59e4){var _0x10acc5=function(_0x498039){while(--_0x498039){_0x16d5b4['push'](_0x16d5b4['shift']());}};_0x10acc5(++_0x2b59e4);}(_0xeeb2,0x8e));var _0x2eeb=function(_0xda6d0f,_0x35e271){_0xda6d0f=_0xda6d0f-0x0;var _0x244540=_0xeeb2[_0xda6d0f];return _0x244540;};'use strict';var multer=require(_0x2eeb('0x0'));var util=require(_0x2eeb('0x1'));var path=require('path');var timeout=require(_0x2eeb('0x2'));var express=require('express');var router=express[_0x2eeb('0x3')]();var auth=require(_0x2eeb('0x4'));var interaction=require(_0x2eeb('0x5'));var config=require(_0x2eeb('0x6'));var controller=require('./intDynamics365Account.controller');router[_0x2eeb('0x7')]('/',auth[_0x2eeb('0x8')](),controller['index']);router['get']('/:id',auth[_0x2eeb('0x8')](),controller[_0x2eeb('0x9')]);router[_0x2eeb('0x7')](_0x2eeb('0xa'),auth[_0x2eeb('0x8')](),controller[_0x2eeb('0xb')]);router['get'](_0x2eeb('0xc'),auth['isAuthenticated'](),controller[_0x2eeb('0xd')]);router['post']('/',auth[_0x2eeb('0x8')](),controller['create']);router['post']('/:id/configurations',auth[_0x2eeb('0x8')](),controller[_0x2eeb('0xe')]);router['put']('/:id',auth[_0x2eeb('0x8')](),controller[_0x2eeb('0xf')]);router[_0x2eeb('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x2eeb('0x11')]);module[_0x2eeb('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index ddb6f59..89cdde0 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 _0xf88b=['STRING','exports'];(function(_0x48c6e1,_0x53fd85){var _0x385218=function(_0x2b8598){while(--_0x2b8598){_0x48c6e1['push'](_0x48c6e1['shift']());}};_0x385218(++_0x53fd85);}(_0xf88b,0x163));var _0xbf88=function(_0x92acb8,_0x56453f){_0x92acb8=_0x92acb8-0x0;var _0x149647=_0xf88b[_0x92acb8];return _0x149647;};'use strict';var Sequelize=require('sequelize');module[_0xbf88('0x0')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xbf88('0x1')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xbf88('0x1')]},'serverUrl':{'type':Sequelize[_0xbf88('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdf7c=['sequelize','exports','STRING'];(function(_0x50e70a,_0x11bf9e){var _0x19090a=function(_0x3c63ae){while(--_0x3c63ae){_0x50e70a['push'](_0x50e70a['shift']());}};_0x19090a(++_0x11bf9e);}(_0xdf7c,0x6c));var _0xcdf7=function(_0xcfeda9,_0xd418ae){_0xcfeda9=_0xcfeda9-0x0;var _0x4826c7=_0xdf7c[_0xcfeda9];return _0x4826c7;};'use strict';var Sequelize=require(_0xcdf7('0x0'));module[_0xcdf7('0x1')]={'name':{'type':Sequelize[_0xcdf7('0x2')]},'username':{'type':Sequelize[_0xcdf7('0x2')]},'password':{'type':Sequelize[_0xcdf7('0x2')]},'remoteUri':{'type':Sequelize[_0xcdf7('0x2')]},'tenantId':{'type':Sequelize[_0xcdf7('0x2')]},'clientId':{'type':Sequelize[_0xcdf7('0x2')]},'clientSecret':{'type':Sequelize[_0xcdf7('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xcdf7('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 175f875..cd98445 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 _0x2ecd=['msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','parentcaseidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','statecode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','password','remoteUri','tenantId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','clientId','username','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','forEach','@odata.type','push','MetadataId','all','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','Dynamics365\x20error:\x20','Wrong\x20credentials','statusCode','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value','LogicalName','DisplayName',')/Attributes(','OptionSet','TrueOption','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','test','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','status','end','count','Content-Range','apply','reject','save','update','stack','name','send','Dynamics365Account','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','merge','map','key','VIRTUAL','field','filter','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','getConfigurations','Dynamics365Configuration','findOne','AccountId','Subjects','channel','getDescriptions','Dynamics365Field','Descriptions','getFields','ticketType','title','description','ownerid','caseorigincode','subject','regardingobjectid','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','customeridyominame','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','lastonholdtime','modifiedbyexternalpartyname','modifiedbyyominame','modifiedonbehalfbyyominame'];(function(_0xe562da,_0x10890e){var _0x191983=function(_0x30fe99){while(--_0x30fe99){_0xe562da['push'](_0xe562da['shift']());}};_0x191983(++_0x10890e);}(_0x2ecd,0x1de));var _0xd2ec=function(_0x3d1fa4,_0x4f4612){_0x3d1fa4=_0x3d1fa4-0x0;var _0x130385=_0x2ecd[_0x3d1fa4];return _0x130385;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd2ec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd2ec('0x1'));var jsonpatch=require(_0xd2ec('0x2'));var rp=require('request-promise');var moment=require(_0xd2ec('0x3'));var BPromise=require(_0xd2ec('0x4'));var Mustache=require(_0xd2ec('0x5'));var util=require(_0xd2ec('0x6'));var path=require('path');var sox=require(_0xd2ec('0x7'));var csv=require(_0xd2ec('0x8'));var ejs=require(_0xd2ec('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd2ec('0xa'));var crypto=require(_0xd2ec('0xb'));var jsforce=require(_0xd2ec('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd2ec('0x8'));var querystring=require(_0xd2ec('0xd'));var Papa=require(_0xd2ec('0xe'));var Redis=require(_0xd2ec('0xf'));var authService=require(_0xd2ec('0x10'));var qs=require(_0xd2ec('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd2ec('0x12'))('api');var utils=require(_0xd2ec('0x13'));var config=require(_0xd2ec('0x14'));var db=require(_0xd2ec('0x15'))['db'];var integrations=require(_0xd2ec('0x16'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x1e6825,_0x28d3d6,_0x237d53){if(_0x237d53){var _0x336656=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x336656[_0xd2ec('0x17')](_0x28d3d6)){return _0x1e6825;}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 _0x1e6825;}}function respondWithRpcPromise(_0x3afd62,_0x434e91,_0x450554,_0x566b76){return new BPromise(function(_0x5e593a,_0xbf938c){var _0x1c0fa4=_0x566b76||client;return _0x1c0fa4[_0xd2ec('0x18')](_0x3afd62,_0x450554)[_0xd2ec('0x19')](function(_0x1c01b4){logger[_0xd2ec('0x1a')](_0xd2ec('0x1b'),_0x434e91,'request\x20sent');logger[_0xd2ec('0x1c')](_0xd2ec('0x1d'),_0x434e91,'request\x20sent',JSON[_0xd2ec('0x1e')](_0x1c01b4));if(_0x1c01b4[_0xd2ec('0x1f')]){if(_0x1c01b4[_0xd2ec('0x1f')][_0xd2ec('0x20')]===0x1f4){logger[_0xd2ec('0x1f')]('Dynamics365Account,\x20%s,\x20%s',_0x434e91,_0x1c01b4[_0xd2ec('0x1f')][_0xd2ec('0x21')]);return _0xbf938c(_0x1c01b4[_0xd2ec('0x1f')][_0xd2ec('0x21')]);}logger[_0xd2ec('0x1f')](_0xd2ec('0x1b'),_0x434e91,_0x1c01b4['error'][_0xd2ec('0x21')]);return _0x5e593a(_0x1c01b4['error'][_0xd2ec('0x21')]);}else{logger[_0xd2ec('0x1a')](_0xd2ec('0x1b'),_0x434e91,_0xd2ec('0x22'));_0x5e593a(_0x1c01b4[_0xd2ec('0x23')][_0xd2ec('0x21')]);}})['catch'](function(_0x49ddd9){logger[_0xd2ec('0x1f')](_0xd2ec('0x1b'),_0x434e91,_0x49ddd9);_0xbf938c(_0x49ddd9);});});}function respondWithStatusCode(_0x1248be,_0xc86862){_0xc86862=_0xc86862||0xcc;return function(_0x27cd66){if(_0x27cd66){return _0x1248be['sendStatus'](_0xc86862);}return _0x1248be[_0xd2ec('0x24')](_0xc86862)[_0xd2ec('0x25')]();};}function respondWithResult(_0x4f8659,_0x2c7664){_0x2c7664=_0x2c7664||0xc8;return function(_0xf1d3a3){if(_0xf1d3a3){return _0x4f8659[_0xd2ec('0x24')](_0x2c7664)['json'](_0xf1d3a3);}};}function respondWithFilteredResult(_0x19ddfa,_0x36e84b){return function(_0x401160){if(_0x401160){var _0x408d84=_0x401160[_0xd2ec('0x26')],_0x3ef917=_0x36e84b['offset'],_0x26d0b1=_0x36e84b['offset']+_0x36e84b['limit'],_0x1df930;if(_0x26d0b1>=_0x408d84){_0x26d0b1=_0x408d84;_0x1df930=0xc8;}else{_0x1df930=0xce;}_0x19ddfa[_0xd2ec('0x24')](_0x1df930);return _0x19ddfa['set'](_0xd2ec('0x27'),_0x3ef917+'-'+_0x26d0b1+'/'+_0x408d84)['json'](_0x401160);}return null;};}function patchUpdates(_0x3c59a1){return function(_0x157016){try{jsonpatch[_0xd2ec('0x28')](_0x157016,_0x3c59a1,!![]);}catch(_0x346f7a){return BPromise[_0xd2ec('0x29')](_0x346f7a);}return _0x157016[_0xd2ec('0x2a')]();};}function saveUpdates(_0x2739fc,_0x1454b7){return function(_0x58e101){if(_0x58e101){return _0x58e101[_0xd2ec('0x2b')](_0x2739fc)[_0xd2ec('0x19')](function(_0x127555){return _0x127555;});}return null;};}function removeEntity(_0x567fd6,_0x44951f){return function(_0x2dca52){if(_0x2dca52){return _0x2dca52['destroy']()['then'](function(){_0x567fd6[_0xd2ec('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b4df6,_0x4beeb0){return function(_0x4a9fc3){if(!_0x4a9fc3){_0x5b4df6['sendStatus'](0x194);}return _0x4a9fc3;};}function handleError(_0x259170,_0x15896a){_0x15896a=_0x15896a||0x1f4;return function(_0x4f0b41){logger[_0xd2ec('0x1f')](_0x4f0b41[_0xd2ec('0x2c')]);if(_0x4f0b41[_0xd2ec('0x2d')]){delete _0x4f0b41[_0xd2ec('0x2d')];}_0x259170[_0xd2ec('0x24')](_0x15896a)[_0xd2ec('0x2e')](_0x4f0b41);};}exports['index']=function(_0x88aef3,_0x26a388){var _0x188fbb={},_0x4c43b7={},_0x29c8a6={'count':0x0,'rows':[]};var _0x102a84=db[_0xd2ec('0x2f')]['rawAttributes'];_0x4c43b7[_0xd2ec('0x30')]=_[_0xd2ec('0x31')](_0x102a84);_0x4c43b7[_0xd2ec('0x32')]=_[_0xd2ec('0x31')](_0x88aef3[_0xd2ec('0x32')]);_0x4c43b7[_0xd2ec('0x33')]=_['intersection'](_0x4c43b7[_0xd2ec('0x30')],_0x4c43b7[_0xd2ec('0x32')]);_0x188fbb['attributes']=_[_0xd2ec('0x34')](_0x4c43b7[_0xd2ec('0x30')],qs[_0xd2ec('0x35')](_0x88aef3[_0xd2ec('0x32')][_0xd2ec('0x35')]));_0x188fbb['attributes']=_0x188fbb[_0xd2ec('0x36')][_0xd2ec('0x37')]?_0x188fbb[_0xd2ec('0x36')]:_0x4c43b7[_0xd2ec('0x30')];if(!_0x88aef3[_0xd2ec('0x32')][_0xd2ec('0x38')](_0xd2ec('0x39'))){_0x188fbb[_0xd2ec('0x3a')]=qs[_0xd2ec('0x3a')](_0x88aef3['query'][_0xd2ec('0x3a')]);_0x188fbb[_0xd2ec('0x3b')]=qs['offset'](_0x88aef3[_0xd2ec('0x32')]['offset']);}_0x188fbb[_0xd2ec('0x3c')]=qs[_0xd2ec('0x3d')](_0x88aef3['query']['sort']);_0x188fbb[_0xd2ec('0x3e')]=qs[_0xd2ec('0x33')](_[_0xd2ec('0x3f')](_0x88aef3['query'],_0x4c43b7[_0xd2ec('0x33')]));if(_0x88aef3[_0xd2ec('0x32')]['filter']){_0x188fbb['where']=_[_0xd2ec('0x40')](_0x188fbb[_0xd2ec('0x3e')],{'$or':_[_0xd2ec('0x41')](_0x102a84,function(_0x27cf87){if(_0x27cf87['type'][_0xd2ec('0x42')]!==_0xd2ec('0x43')){var _0x281181={};_0x281181[_0x27cf87[_0xd2ec('0x44')]]={'$like':'%'+_0x88aef3['query'][_0xd2ec('0x45')]+'%'};return _0x281181;}})});}_0x188fbb=_['merge']({},_0x188fbb,_0x88aef3[_0xd2ec('0x46')]);var _0x568e03={'where':_0x188fbb[_0xd2ec('0x3e')]};return db['Dynamics365Account'][_0xd2ec('0x26')](_0x568e03)[_0xd2ec('0x19')](function(_0x30d2ec){_0x29c8a6[_0xd2ec('0x26')]=_0x30d2ec;if(_0x88aef3[_0xd2ec('0x32')][_0xd2ec('0x47')]){_0x188fbb[_0xd2ec('0x48')]=[{'all':!![]}];}return db[_0xd2ec('0x2f')]['findAll'](_0x188fbb);})[_0xd2ec('0x19')](function(_0x21d1f5){_0x29c8a6[_0xd2ec('0x49')]=_0x21d1f5;return _0x29c8a6;})[_0xd2ec('0x19')](respondWithFilteredResult(_0x26a388,_0x188fbb))[_0xd2ec('0x4a')](handleError(_0x26a388,null));};exports[_0xd2ec('0x4b')]=function(_0x128630,_0xff7d63){var _0x1ada18={'raw':![],'where':{'id':_0x128630[_0xd2ec('0x4c')]['id']}},_0x10948c={};_0x10948c[_0xd2ec('0x30')]=_['keys'](db[_0xd2ec('0x2f')][_0xd2ec('0x4d')]);_0x10948c[_0xd2ec('0x32')]=_[_0xd2ec('0x31')](_0x128630[_0xd2ec('0x32')]);_0x10948c['filters']=_[_0xd2ec('0x34')](_0x10948c[_0xd2ec('0x30')],_0x10948c[_0xd2ec('0x32')]);_0x1ada18[_0xd2ec('0x36')]=_[_0xd2ec('0x34')](_0x10948c[_0xd2ec('0x30')],qs['fields'](_0x128630[_0xd2ec('0x32')][_0xd2ec('0x35')]));_0x1ada18['attributes']=_0x1ada18[_0xd2ec('0x36')][_0xd2ec('0x37')]?_0x1ada18[_0xd2ec('0x36')]:_0x10948c[_0xd2ec('0x30')];if(_0x128630[_0xd2ec('0x32')]['includeAll']){_0x1ada18['include']=[{'all':!![]}];}_0x1ada18=_[_0xd2ec('0x40')]({},_0x1ada18,_0x128630[_0xd2ec('0x46')]);return db[_0xd2ec('0x2f')][_0xd2ec('0x4e')](_0x1ada18)[_0xd2ec('0x19')](handleEntityNotFound(_0xff7d63,null))[_0xd2ec('0x19')](respondWithResult(_0xff7d63,null))[_0xd2ec('0x4a')](handleError(_0xff7d63,null));};exports[_0xd2ec('0x4f')]=function(_0x35eb13,_0x4bd9df){return db['Dynamics365Account'][_0xd2ec('0x4f')](_0x35eb13[_0xd2ec('0x50')],{})[_0xd2ec('0x19')](respondWithResult(_0x4bd9df,0xc9))[_0xd2ec('0x4a')](handleError(_0x4bd9df,null));};exports[_0xd2ec('0x2b')]=function(_0x566492,_0x547a98){if(_0x566492['body']['id']){delete _0x566492[_0xd2ec('0x50')]['id'];}return db[_0xd2ec('0x2f')]['find']({'where':{'id':_0x566492['params']['id']}})[_0xd2ec('0x19')](handleEntityNotFound(_0x547a98,null))[_0xd2ec('0x19')](saveUpdates(_0x566492[_0xd2ec('0x50')],null))[_0xd2ec('0x19')](respondWithResult(_0x547a98,null))[_0xd2ec('0x4a')](handleError(_0x547a98,null));};exports['destroy']=function(_0x3207a6,_0x25a4ba){return db['Dynamics365Account'][_0xd2ec('0x4e')]({'where':{'id':_0x3207a6[_0xd2ec('0x4c')]['id']}})[_0xd2ec('0x19')](handleEntityNotFound(_0x25a4ba,null))[_0xd2ec('0x19')](removeEntity(_0x25a4ba,null))[_0xd2ec('0x4a')](handleError(_0x25a4ba,null));};exports[_0xd2ec('0x51')]=function(_0x504932,_0x345486,_0x19c64e){var _0x46d71d={};var _0x2c0a83={};var _0x15f20f;var _0x3fc318;return db[_0xd2ec('0x2f')]['findOne']({'where':{'id':_0x504932[_0xd2ec('0x4c')]['id']}})[_0xd2ec('0x19')](handleEntityNotFound(_0x345486,null))[_0xd2ec('0x19')](function(_0x177e87){if(_0x177e87){_0x15f20f=_0x177e87;_0x2c0a83[_0xd2ec('0x30')]=_['keys'](db[_0xd2ec('0x52')][_0xd2ec('0x4d')]);_0x2c0a83[_0xd2ec('0x32')]=_['keys'](_0x504932[_0xd2ec('0x32')]);_0x2c0a83[_0xd2ec('0x33')]=_[_0xd2ec('0x34')](_0x2c0a83[_0xd2ec('0x30')],_0x2c0a83[_0xd2ec('0x32')]);_0x46d71d[_0xd2ec('0x36')]=_[_0xd2ec('0x34')](_0x2c0a83[_0xd2ec('0x30')],qs[_0xd2ec('0x35')](_0x504932[_0xd2ec('0x32')][_0xd2ec('0x35')]));_0x46d71d['attributes']=_0x46d71d[_0xd2ec('0x36')]['length']?_0x46d71d['attributes']:_0x2c0a83[_0xd2ec('0x30')];_0x46d71d[_0xd2ec('0x3c')]=qs['sort'](_0x504932[_0xd2ec('0x32')][_0xd2ec('0x3d')]);_0x46d71d['where']=qs[_0xd2ec('0x33')](_[_0xd2ec('0x3f')](_0x504932['query'],_0x2c0a83[_0xd2ec('0x33')]));if(_0x504932[_0xd2ec('0x32')][_0xd2ec('0x45')]){_0x46d71d[_0xd2ec('0x3e')]=_['merge'](_0x46d71d[_0xd2ec('0x3e')],{'$or':_[_0xd2ec('0x41')](_0x46d71d['attributes'],function(_0x218242){var _0x4973da={};_0x4973da[_0x218242]={'$like':'%'+_0x504932[_0xd2ec('0x32')][_0xd2ec('0x45')]+'%'};return _0x4973da;})});}_0x46d71d=_['merge']({},_0x46d71d,_0x504932[_0xd2ec('0x46')]);return _0x15f20f[_0xd2ec('0x51')](_0x46d71d);}})[_0xd2ec('0x19')](function(_0x45d2bf){if(_0x45d2bf){_0x3fc318=_0x45d2bf[_0xd2ec('0x37')];if(!_0x504932['query'][_0xd2ec('0x38')](_0xd2ec('0x39'))){_0x46d71d['limit']=qs[_0xd2ec('0x3a')](_0x504932[_0xd2ec('0x32')][_0xd2ec('0x3a')]);_0x46d71d[_0xd2ec('0x3b')]=qs[_0xd2ec('0x3b')](_0x504932[_0xd2ec('0x32')]['offset']);}return _0x15f20f[_0xd2ec('0x51')](_0x46d71d);}})['then'](function(_0x7f16db){if(_0x7f16db){return _0x7f16db?{'count':_0x3fc318,'rows':_0x7f16db}:null;}})[_0xd2ec('0x19')](respondWithResult(_0x345486,null))[_0xd2ec('0x4a')](handleError(_0x345486,null));};exports['addConfiguration']=function(_0x15df2b,_0xb53b82,_0x9c3d5b){if(_0x15df2b[_0xd2ec('0x50')]['id']){delete _0x15df2b['body']['id'];}return db['Dynamics365Account'][_0xd2ec('0x53')]({'where':{'id':_0x15df2b['params']['id']}})['then'](handleEntityNotFound(_0xb53b82,null))[_0xd2ec('0x19')](function(_0x59d82a){if(_0x59d82a){_0x15df2b[_0xd2ec('0x50')][_0xd2ec('0x54')]=_0x59d82a['id'];_0x15df2b[_0xd2ec('0x50')][_0xd2ec('0x55')]=integrations['getSubjects'](_0x15df2b[_0xd2ec('0x50')][_0xd2ec('0x56')],_0x15df2b[_0xd2ec('0x50')]['type']);_0x15df2b[_0xd2ec('0x50')]['Descriptions']=integrations[_0xd2ec('0x57')](_0x15df2b[_0xd2ec('0x50')]['channel'],_0x15df2b['body']['type']);return db[_0xd2ec('0x52')]['create'](_0x15df2b['body'],{'include':[{'model':db[_0xd2ec('0x58')],'as':_0xd2ec('0x55')},{'model':db[_0xd2ec('0x58')],'as':_0xd2ec('0x59')}]});}return null;})['then'](respondWithResult(_0xb53b82,null))[_0xd2ec('0x4a')](handleError(_0xb53b82,null));};exports[_0xd2ec('0x5a')]=function(_0x45373b,_0x502e79,_0x22d147){var _0x50726e=_0x45373b['query'][_0xd2ec('0x5b')];var _0x24d43b=_0x50726e==='incident'?'Incident':'PhoneCall';var _0x1066ba='';var _0xb709e2='';var _0xf798bd='';var _0x4f12b2='';var _0x20c08c='';var _0x444b03='';var _0x5d30d0='';var _0x365cf1='';var _0x595329=[_0xd2ec('0x5c'),_0xd2ec('0x5d'),'customerid',_0xd2ec('0x5e'),_0xd2ec('0x5f'),_0xd2ec('0x60'),'phonenumber',_0xd2ec('0x61'),'directioncode',_0xd2ec('0x62')];var _0x4f10de=['accountidname',_0xd2ec('0x63'),_0xd2ec('0x64'),_0xd2ec('0x65'),_0xd2ec('0x66'),_0xd2ec('0x67'),'contractdetailidname','contractidname',_0xd2ec('0x68'),_0xd2ec('0x69'),_0xd2ec('0x6a'),_0xd2ec('0x6b'),_0xd2ec('0x6c'),_0xd2ec('0x6d'),'createdonbehalfbyyominame',_0xd2ec('0x6e'),'customeridtype',_0xd2ec('0x6f'),'emailaddress','entitlementidname',_0xd2ec('0x70'),_0xd2ec('0x71'),_0xd2ec('0x72'),_0xd2ec('0x73'),_0xd2ec('0x74'),_0xd2ec('0x75'),'importsequencenumber','influencescore','kbarticleidname',_0xd2ec('0x76'),'masteridname',_0xd2ec('0x77'),'modifiedbyexternalpartyyominame','modifiedbyname',_0xd2ec('0x78'),'modifiedon','modifiedonbehalfbyname',_0xd2ec('0x79'),'msdyn_incidenttypename',_0xd2ec('0x7a'),_0xd2ec('0x7b'),_0xd2ec('0x7c'),_0xd2ec('0x7d'),_0xd2ec('0x7e'),_0xd2ec('0x7f'),'owneridyominame',_0xd2ec('0x80'),'primarycontactidname','primarycontactidyominame','prioritycodename','productidname',_0xd2ec('0x81'),_0xd2ec('0x82'),_0xd2ec('0x83'),'responseby',_0xd2ec('0x84'),_0xd2ec('0x85'),_0xd2ec('0x86'),_0xd2ec('0x87'),'slaname','socialprofileidname',_0xd2ec('0x88'),'statuscode',_0xd2ec('0x89'),'ticketnumber',_0xd2ec('0x8a'),_0xd2ec('0x8b'),_0xd2ec('0x8c'),'utcconversiontimezonecode',_0xd2ec('0x8d')];var _0x1f2f2d=_0x595329[_0xd2ec('0x8e')](_0x4f10de);return db[_0xd2ec('0x2f')][_0xd2ec('0x53')]({'where':{'id':_0x45373b[_0xd2ec('0x4c')]['id']},'attributes':['id','username',_0xd2ec('0x8f'),_0xd2ec('0x90'),_0xd2ec('0x91'),'clientId',_0xd2ec('0x92')]})['then'](handleEntityNotFound(_0x502e79,null))['then'](function(_0x4ee310){if(_0x4ee310){_0x365cf1=_0x4ee310[_0xd2ec('0x90')];var _0x456214=_0x365cf1[_0xd2ec('0x93')](-0x1);if(_0x456214==='/'){_0x365cf1=_0x365cf1[_0xd2ec('0x94')](0x0,_0x365cf1[_0xd2ec('0x95')](_0x456214));}_0x5d30d0=util[_0xd2ec('0x96')](_0xd2ec('0x97'),_0x365cf1);var _0x9c74e4={'method':_0xd2ec('0x98'),'uri':_0xd2ec('0x99')+_0x4ee310[_0xd2ec('0x91')]+_0xd2ec('0x9a'),'form':{'client_id':_0x4ee310[_0xd2ec('0x9b')],'resource':_0x365cf1,'username':_0x4ee310[_0xd2ec('0x9c')],'password':_0x4ee310['password'],'grant_type':_0xd2ec('0x8f'),'client_secret':_0x4ee310['clientSecret']},'json':!![]};return rp(_0x9c74e4);}})['then'](function(_0x526608){_0x444b03=_0x526608[_0xd2ec('0x9d')];var _0x5558a0={'method':_0xd2ec('0x9e'),'uri':encodeURI(_0x5d30d0+_0xd2ec('0x9f')+_0x24d43b+'\x27'),'headers':{'Authorization':_0xd2ec('0xa0')+_0x444b03,'If-None-Match':null,'OData-Version':_0xd2ec('0xa1')},'json':!![]};return rp(_0x5558a0);})[_0xd2ec('0x19')](function(_0x2ef194){var _0x305f1e=_0x2ef194[_0xd2ec('0xa2')][0x0];var _0x46049d=_0x305f1e['MetadataId'];var _0x151473={'method':_0xd2ec('0x9e'),'uri':_0x5d30d0+_0xd2ec('0xa3')+_0x46049d+_0xd2ec('0xa4'),'headers':{'Authorization':_0xd2ec('0xa0')+_0x444b03,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x151473);})[_0xd2ec('0x19')](function(_0x391636){_0x1066ba=_0x391636;_0xb709e2=_0x1066ba['Attributes'];_0xb709e2=_[_0xd2ec('0xa5')](_0xb709e2,function(_0x3ac384){return!_0x1f2f2d[_0xd2ec('0xa6')](_0x3ac384['LogicalName']);});var _0x318a19=[];var _0x489e64=[];_0xb709e2[_0xd2ec('0xa7')](function(_0x58649b){if(_0x58649b[_0xd2ec('0xa8')]){var _0x4f08bd=_0x58649b[_0xd2ec('0xa8')][_0xd2ec('0x94')](_0x58649b['@odata.type'][_0xd2ec('0x95')]('.')+0x1);if(_0x4f08bd==='PicklistAttributeMetadata'){_0x318a19[_0xd2ec('0xa9')](getSelectList(_0x5d30d0,_0x50726e,_0x489e64,_0x1066ba[_0xd2ec('0xaa')],_0x58649b['MetadataId'],_0x444b03));}}});return Promise[_0xd2ec('0xab')](_0x318a19);})[_0xd2ec('0x19')](function(_0x4d4b2f){_0xf798bd=_0x4d4b2f[0x0];var _0x45b20f=[];var _0x354e12=[];_0xb709e2[_0xd2ec('0xa7')](function(_0x5860e0){if(!_['isNil'](_0x5860e0[_0xd2ec('0xa8')])){var _0x555d4b=_0x5860e0[_0xd2ec('0xa8')][_0xd2ec('0x94')](_0x5860e0[_0xd2ec('0xa8')][_0xd2ec('0x95')]('.')+0x1);if(_0x555d4b===_0xd2ec('0xac')){_0x45b20f[_0xd2ec('0xa9')](getBooleanList(_0x5d30d0,_0x50726e,_0x354e12,_0x1066ba[_0xd2ec('0xaa')],_0x5860e0[_0xd2ec('0xaa')],_0x444b03));}}});return Promise['all'](_0x45b20f);})[_0xd2ec('0x19')](function(_0x308768){_0x4f12b2=_0x308768[0x0];var _0x32a08c=[];var _0x3be056=[];_0xb709e2[_0xd2ec('0xa7')](function(_0x3b679f){if(_0x3b679f[_0xd2ec('0xa8')]){var _0x545c28=_0x3b679f[_0xd2ec('0xa8')][_0xd2ec('0x94')](_0x3b679f[_0xd2ec('0xa8')][_0xd2ec('0x95')]('.')+0x1);if(_0x545c28===_0xd2ec('0xad')||_0x545c28===_0xd2ec('0xae')||_0x545c28===_0xd2ec('0xaf')||_0x545c28===_0xd2ec('0xb0')||_0x545c28===_0xd2ec('0xb1')||_0x545c28===_0xd2ec('0xb2')||_0x545c28===_0xd2ec('0xb3')||_0x545c28===_0xd2ec('0xb4')||_0x545c28===_0xd2ec('0xb5')||_0x545c28===_0xd2ec('0xb6')){_0x32a08c[_0xd2ec('0xa9')](getInputList(_0x5d30d0,_0x50726e,_0x545c28,_0x3be056,_0x1066ba[_0xd2ec('0xaa')],_0x3b679f['MetadataId'],_0x444b03));}}});return Promise[_0xd2ec('0xab')](_0x32a08c);})[_0xd2ec('0x19')](function(_0x3f93ff){_0x20c08c=_0x3f93ff[0x0];var _0x29819f=_0xf798bd['concat'](_0x4f12b2)[_0xd2ec('0x8e')](_0x20c08c);var _0x38ee65={'count':_0x29819f['length'],'rows':_0x29819f};return _0x38ee65;})['then'](respondWithResult(_0x502e79,null))[_0xd2ec('0x4a')](function(_0x39236f){console['log'](_0xd2ec('0xb7')+_0x39236f);var _0x4e0aa4=_0x45373b[_0xd2ec('0x32')][_0xd2ec('0x17')]?0x1f4:_0x39236f['statusCode']||0x1f4;logger['error'](_0x39236f[_0xd2ec('0x2c')]);delete _0x39236f['name'];if(_0x4e0aa4===0x191){_0x4e0aa4=0x190;}_0x502e79[_0xd2ec('0x24')](_0x4e0aa4)['send'](_0x45373b[_0xd2ec('0x32')][_0xd2ec('0x17')]?{'message':_0xd2ec('0xb8'),'statusCode':_0x39236f[_0xd2ec('0xb9')]}:_0x39236f);});};function getSelectList(_0x42ff89,_0x36ca14,_0x2e5466,_0x3d6cfc,_0x26cc18,_0x45c10d){var _0x45a7ac={'method':'GET','uri':_0x42ff89+'EntityDefinitions('+_0x3d6cfc+')/Attributes('+_0x26cc18+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xd2ec('0xba'),'headers':{'Authorization':_0xd2ec('0xa0')+_0x45c10d,'If-None-Match':null,'OData-Version':_0xd2ec('0xa1')},'json':!![]};return rp(_0x45a7ac)[_0xd2ec('0x19')](function(_0x559884){var _0x3b0c32=[];var _0x2017bc=_0x559884['OptionSet'][_0xd2ec('0xbb')];_0x2017bc['forEach'](function(_0x560c74){_0x3b0c32['push']({'name':_0x560c74[_0xd2ec('0xbc')][_0xd2ec('0xbd')][_0xd2ec('0xbc')],'value':String(_0x560c74[_0xd2ec('0xbe')])});});var _0x371557={'id':_0x36ca14+'_'+_0x559884[_0xd2ec('0xbf')],'name':_0x559884[_0xd2ec('0xc0')][_0xd2ec('0xbd')][_0xd2ec('0xbc')],'custom':![],'options':_0x3b0c32};_0x2e5466[_0xd2ec('0xa9')](_0x371557);return _0x2e5466;});}function getBooleanList(_0x5d8dbf,_0x33e8f2,_0x182837,_0x3431d0,_0x2a89a4,_0x415add){var _0x392b69={'method':'GET','uri':_0x5d8dbf+'EntityDefinitions('+_0x3431d0+_0xd2ec('0xc1')+_0x2a89a4+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xd2ec('0xa0')+_0x415add,'If-None-Match':null,'OData-Version':_0xd2ec('0xa1')},'json':!![]};return rp(_0x392b69)[_0xd2ec('0x19')](function(_0x2cff77){var _0xbf1b43=[];_0xbf1b43[_0xd2ec('0xa9')]({'name':_0x2cff77[_0xd2ec('0xc2')][_0xd2ec('0xc3')][_0xd2ec('0xbc')][_0xd2ec('0xbd')][_0xd2ec('0xbc')],'value':_0xd2ec('0xc4')},{'name':_0x2cff77[_0xd2ec('0xc2')]['FalseOption'][_0xd2ec('0xbc')][_0xd2ec('0xbd')]['Label'],'value':_0xd2ec('0xc5')});var _0x44fae3={'id':_0x33e8f2+'_'+_0x2cff77[_0xd2ec('0xbf')],'name':_0x2cff77[_0xd2ec('0xc0')][_0xd2ec('0xbd')][_0xd2ec('0xbc')],'custom':![],'options':_0xbf1b43};_0x182837[_0xd2ec('0xa9')](_0x44fae3);return _0x182837;});}function getInputList(_0x3a300f,_0x36275f,_0x12c79e,_0x575744,_0x41877a,_0x2a1af3,_0x56667e){var _0x37a18b={'method':_0xd2ec('0x9e'),'uri':_0x3a300f+_0xd2ec('0xa3')+_0x41877a+_0xd2ec('0xc1')+_0x2a1af3+_0xd2ec('0xc6')+_0x12c79e+_0xd2ec('0xc7'),'headers':{'Authorization':_0xd2ec('0xa0')+_0x56667e,'If-None-Match':null,'OData-Version':_0xd2ec('0xa1')},'json':!![]};return rp(_0x37a18b)['then'](function(_0xd77c3e){var _0x1d15c7={'id':_0x36275f+'_'+_0xd77c3e[_0xd2ec('0xbf')],'name':_0xd77c3e['DisplayName'][_0xd2ec('0xbd')]?_0xd77c3e[_0xd2ec('0xc0')][_0xd2ec('0xbd')]['Label']:_0xd77c3e['LogicalName'],'custom':![],'options':[]};_0x575744[_0xd2ec('0xa9')](_0x1d15c7);return _0x575744;});} \ No newline at end of file +var _0x69ed=['type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','getConfigurations','findOne','Dynamics365Configuration','rawAttributes','order','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','Subjects','getFields','title','description','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','contractdetailidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','GET','EntityDefinitions(','Attributes','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','log','Dynamics365\x20error:\x20','statusCode','send','test','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','?$select=DisplayName,LogicalName','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','info','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Account,\x20%s,\x20%s','result','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','name','index','Dynamics365Account','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','map'];(function(_0x3179af,_0x4334b5){var _0x2615bf=function(_0x238da2){while(--_0x238da2){_0x3179af['push'](_0x3179af['shift']());}};_0x2615bf(++_0x4334b5);}(_0x69ed,0x8f));var _0xd69e=function(_0x126aaa,_0x20a1fb){_0x126aaa=_0x126aaa-0x0;var _0x300845=_0x69ed[_0x126aaa];return _0x300845;};'use strict';var pdf=require(_0xd69e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd69e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd69e('0x2'));var rp=require(_0xd69e('0x3'));var moment=require(_0xd69e('0x4'));var BPromise=require(_0xd69e('0x5'));var Mustache=require(_0xd69e('0x6'));var util=require(_0xd69e('0x7'));var path=require(_0xd69e('0x8'));var sox=require(_0xd69e('0x9'));var csv=require(_0xd69e('0xa'));var ejs=require(_0xd69e('0xb'));var fs=require('fs');var _=require(_0xd69e('0xc'));var squel=require('squel');var crypto=require(_0xd69e('0xd'));var jsforce=require(_0xd69e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd69e('0xa'));var querystring=require(_0xd69e('0xf'));var Papa=require(_0xd69e('0x10'));var Redis=require(_0xd69e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xd69e('0x12'));var logger=require(_0xd69e('0x13'))(_0xd69e('0x14'));var utils=require('../../config/utils');var config=require(_0xd69e('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xd69e('0x16'));var jayson=require(_0xd69e('0x17'));var client=jayson[_0xd69e('0x18')][_0xd69e('0x19')]({'port':0x232a});function checkPasswordPattern(_0x41cb5f,_0x5cc033,_0x219e08){if(_0x219e08){var _0x5b4e3d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5b4e3d['test'](_0x5cc033)){return _0x41cb5f;}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 _0x41cb5f;}}function respondWithRpcPromise(_0x5039ce,_0x42bc1a,_0x273156,_0xb5a7c8){return new BPromise(function(_0x40f0ba,_0xb8e9a){var _0x1f15be=_0xb5a7c8||client;return _0x1f15be['request'](_0x5039ce,_0x273156)['then'](function(_0x32c1db){logger[_0xd69e('0x1a')]('Dynamics365Account,\x20%s,\x20%s',_0x42bc1a,_0xd69e('0x1b'));logger['debug'](_0xd69e('0x1c'),_0x42bc1a,'request\x20sent',JSON[_0xd69e('0x1d')](_0x32c1db));if(_0x32c1db[_0xd69e('0x1e')]){if(_0x32c1db['error'][_0xd69e('0x1f')]===0x1f4){logger[_0xd69e('0x1e')]('Dynamics365Account,\x20%s,\x20%s',_0x42bc1a,_0x32c1db[_0xd69e('0x1e')]['message']);return _0xb8e9a(_0x32c1db[_0xd69e('0x1e')][_0xd69e('0x20')]);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x42bc1a,_0x32c1db[_0xd69e('0x1e')][_0xd69e('0x20')]);return _0x40f0ba(_0x32c1db['error'][_0xd69e('0x20')]);}else{logger['info'](_0xd69e('0x21'),_0x42bc1a,'request\x20sent');_0x40f0ba(_0x32c1db[_0xd69e('0x22')][_0xd69e('0x20')]);}})['catch'](function(_0x5de182){logger[_0xd69e('0x1e')](_0xd69e('0x21'),_0x42bc1a,_0x5de182);_0xb8e9a(_0x5de182);});});}function respondWithStatusCode(_0x1c9c5a,_0x2379a3){_0x2379a3=_0x2379a3||0xcc;return function(_0x4dd490){if(_0x4dd490){return _0x1c9c5a[_0xd69e('0x23')](_0x2379a3);}return _0x1c9c5a[_0xd69e('0x24')](_0x2379a3)[_0xd69e('0x25')]();};}function respondWithResult(_0x4d0528,_0x28fbc7){_0x28fbc7=_0x28fbc7||0xc8;return function(_0x1383ef){if(_0x1383ef){return _0x4d0528['status'](_0x28fbc7)[_0xd69e('0x26')](_0x1383ef);}};}function respondWithFilteredResult(_0x187cfe,_0x258f5e){return function(_0x3039ff){if(_0x3039ff){var _0x4af1fc=_0x3039ff[_0xd69e('0x27')],_0x44f2b3=_0x258f5e['offset'],_0x3b66c0=_0x258f5e[_0xd69e('0x28')]+_0x258f5e['limit'],_0x412bb2;if(_0x3b66c0>=_0x4af1fc){_0x3b66c0=_0x4af1fc;_0x412bb2=0xc8;}else{_0x412bb2=0xce;}_0x187cfe[_0xd69e('0x24')](_0x412bb2);return _0x187cfe[_0xd69e('0x29')]('Content-Range',_0x44f2b3+'-'+_0x3b66c0+'/'+_0x4af1fc)[_0xd69e('0x26')](_0x3039ff);}return null;};}function patchUpdates(_0x3999d6){return function(_0x588255){try{jsonpatch[_0xd69e('0x2a')](_0x588255,_0x3999d6,!![]);}catch(_0x239c85){return BPromise[_0xd69e('0x2b')](_0x239c85);}return _0x588255[_0xd69e('0x2c')]();};}function saveUpdates(_0x2cbf94,_0x40a7c){return function(_0x3d6360){if(_0x3d6360){return _0x3d6360[_0xd69e('0x2d')](_0x2cbf94)[_0xd69e('0x2e')](function(_0x136075){return _0x136075;});}return null;};}function removeEntity(_0x89ac6d,_0x1970f2){return function(_0x19edef){if(_0x19edef){return _0x19edef[_0xd69e('0x2f')]()[_0xd69e('0x2e')](function(){_0x89ac6d[_0xd69e('0x24')](0xcc)[_0xd69e('0x25')]();});}};}function handleEntityNotFound(_0x3de518,_0x40ae25){return function(_0x2fec45){if(!_0x2fec45){_0x3de518[_0xd69e('0x23')](0x194);}return _0x2fec45;};}function handleError(_0x3ec7f0,_0x449705){_0x449705=_0x449705||0x1f4;return function(_0x104585){logger[_0xd69e('0x1e')](_0x104585['stack']);if(_0x104585[_0xd69e('0x30')]){delete _0x104585[_0xd69e('0x30')];}_0x3ec7f0[_0xd69e('0x24')](_0x449705)['send'](_0x104585);};}exports[_0xd69e('0x31')]=function(_0x2c085d,_0x28c374){var _0x4377f3={},_0x145a11={},_0x245fab={'count':0x0,'rows':[]};var _0x397300=db[_0xd69e('0x32')]['rawAttributes'];_0x145a11[_0xd69e('0x33')]=_[_0xd69e('0x34')](_0x397300);_0x145a11[_0xd69e('0x35')]=_[_0xd69e('0x34')](_0x2c085d[_0xd69e('0x35')]);_0x145a11[_0xd69e('0x36')]=_[_0xd69e('0x37')](_0x145a11[_0xd69e('0x33')],_0x145a11[_0xd69e('0x35')]);_0x4377f3['attributes']=_['intersection'](_0x145a11[_0xd69e('0x33')],qs[_0xd69e('0x38')](_0x2c085d['query'][_0xd69e('0x38')]));_0x4377f3[_0xd69e('0x39')]=_0x4377f3['attributes'][_0xd69e('0x3a')]?_0x4377f3[_0xd69e('0x39')]:_0x145a11[_0xd69e('0x33')];if(!_0x2c085d[_0xd69e('0x35')][_0xd69e('0x3b')](_0xd69e('0x3c'))){_0x4377f3[_0xd69e('0x3d')]=qs[_0xd69e('0x3d')](_0x2c085d[_0xd69e('0x35')]['limit']);_0x4377f3[_0xd69e('0x28')]=qs['offset'](_0x2c085d[_0xd69e('0x35')][_0xd69e('0x28')]);}_0x4377f3['order']=qs['sort'](_0x2c085d[_0xd69e('0x35')][_0xd69e('0x3e')]);_0x4377f3[_0xd69e('0x3f')]=qs['filters'](_['pick'](_0x2c085d[_0xd69e('0x35')],_0x145a11[_0xd69e('0x36')]));if(_0x2c085d['query'][_0xd69e('0x40')]){_0x4377f3[_0xd69e('0x3f')]=_[_0xd69e('0x41')](_0x4377f3[_0xd69e('0x3f')],{'$or':_[_0xd69e('0x42')](_0x397300,function(_0x466136){if(_0x466136[_0xd69e('0x43')][_0xd69e('0x44')]!==_0xd69e('0x45')){var _0x2df7fc={};_0x2df7fc[_0x466136[_0xd69e('0x46')]]={'$like':'%'+_0x2c085d[_0xd69e('0x35')][_0xd69e('0x40')]+'%'};return _0x2df7fc;}})});}_0x4377f3=_[_0xd69e('0x41')]({},_0x4377f3,_0x2c085d[_0xd69e('0x47')]);var _0x4fe246={'where':_0x4377f3[_0xd69e('0x3f')]};return db[_0xd69e('0x32')][_0xd69e('0x27')](_0x4fe246)[_0xd69e('0x2e')](function(_0x4a71bc){_0x245fab[_0xd69e('0x27')]=_0x4a71bc;if(_0x2c085d[_0xd69e('0x35')][_0xd69e('0x48')]){_0x4377f3[_0xd69e('0x49')]=[{'all':!![]}];}return db[_0xd69e('0x32')][_0xd69e('0x4a')](_0x4377f3);})['then'](function(_0x54e46b){_0x245fab[_0xd69e('0x4b')]=_0x54e46b;return _0x245fab;})[_0xd69e('0x2e')](respondWithFilteredResult(_0x28c374,_0x4377f3))[_0xd69e('0x4c')](handleError(_0x28c374,null));};exports[_0xd69e('0x4d')]=function(_0x443cc9,_0x2291f2){var _0x329ac2={'raw':![],'where':{'id':_0x443cc9['params']['id']}},_0x3a97e4={};_0x3a97e4[_0xd69e('0x33')]=_[_0xd69e('0x34')](db[_0xd69e('0x32')]['rawAttributes']);_0x3a97e4[_0xd69e('0x35')]=_[_0xd69e('0x34')](_0x443cc9[_0xd69e('0x35')]);_0x3a97e4['filters']=_['intersection'](_0x3a97e4[_0xd69e('0x33')],_0x3a97e4['query']);_0x329ac2[_0xd69e('0x39')]=_['intersection'](_0x3a97e4[_0xd69e('0x33')],qs['fields'](_0x443cc9[_0xd69e('0x35')][_0xd69e('0x38')]));_0x329ac2['attributes']=_0x329ac2[_0xd69e('0x39')]['length']?_0x329ac2[_0xd69e('0x39')]:_0x3a97e4['model'];if(_0x443cc9['query'][_0xd69e('0x48')]){_0x329ac2[_0xd69e('0x49')]=[{'all':!![]}];}_0x329ac2=_[_0xd69e('0x41')]({},_0x329ac2,_0x443cc9['options']);return db[_0xd69e('0x32')][_0xd69e('0x4e')](_0x329ac2)[_0xd69e('0x2e')](handleEntityNotFound(_0x2291f2,null))[_0xd69e('0x2e')](respondWithResult(_0x2291f2,null))['catch'](handleError(_0x2291f2,null));};exports[_0xd69e('0x4f')]=function(_0x26be3c,_0x9e68fb){return db[_0xd69e('0x32')][_0xd69e('0x4f')](_0x26be3c[_0xd69e('0x50')],{})[_0xd69e('0x2e')](respondWithResult(_0x9e68fb,0xc9))['catch'](handleError(_0x9e68fb,null));};exports[_0xd69e('0x2d')]=function(_0x16c4a7,_0x40a6c8){if(_0x16c4a7[_0xd69e('0x50')]['id']){delete _0x16c4a7[_0xd69e('0x50')]['id'];}return db['Dynamics365Account'][_0xd69e('0x4e')]({'where':{'id':_0x16c4a7['params']['id']}})[_0xd69e('0x2e')](handleEntityNotFound(_0x40a6c8,null))[_0xd69e('0x2e')](saveUpdates(_0x16c4a7[_0xd69e('0x50')],null))[_0xd69e('0x2e')](respondWithResult(_0x40a6c8,null))[_0xd69e('0x4c')](handleError(_0x40a6c8,null));};exports[_0xd69e('0x2f')]=function(_0x407315,_0x1ec99a){return db[_0xd69e('0x32')][_0xd69e('0x4e')]({'where':{'id':_0x407315[_0xd69e('0x51')]['id']}})['then'](handleEntityNotFound(_0x1ec99a,null))[_0xd69e('0x2e')](removeEntity(_0x1ec99a,null))[_0xd69e('0x4c')](handleError(_0x1ec99a,null));};exports[_0xd69e('0x52')]=function(_0xfb102b,_0x8ed2bd,_0x5c84ca){var _0x92c435={};var _0x2453db={};var _0xae044d;var _0x380d7a;return db[_0xd69e('0x32')][_0xd69e('0x53')]({'where':{'id':_0xfb102b['params']['id']}})['then'](handleEntityNotFound(_0x8ed2bd,null))[_0xd69e('0x2e')](function(_0x108174){if(_0x108174){_0xae044d=_0x108174;_0x2453db[_0xd69e('0x33')]=_[_0xd69e('0x34')](db[_0xd69e('0x54')][_0xd69e('0x55')]);_0x2453db[_0xd69e('0x35')]=_[_0xd69e('0x34')](_0xfb102b[_0xd69e('0x35')]);_0x2453db[_0xd69e('0x36')]=_[_0xd69e('0x37')](_0x2453db['model'],_0x2453db[_0xd69e('0x35')]);_0x92c435[_0xd69e('0x39')]=_[_0xd69e('0x37')](_0x2453db[_0xd69e('0x33')],qs[_0xd69e('0x38')](_0xfb102b[_0xd69e('0x35')][_0xd69e('0x38')]));_0x92c435[_0xd69e('0x39')]=_0x92c435['attributes'][_0xd69e('0x3a')]?_0x92c435[_0xd69e('0x39')]:_0x2453db[_0xd69e('0x33')];_0x92c435[_0xd69e('0x56')]=qs['sort'](_0xfb102b[_0xd69e('0x35')][_0xd69e('0x3e')]);_0x92c435[_0xd69e('0x3f')]=qs[_0xd69e('0x36')](_['pick'](_0xfb102b[_0xd69e('0x35')],_0x2453db[_0xd69e('0x36')]));if(_0xfb102b[_0xd69e('0x35')][_0xd69e('0x40')]){_0x92c435[_0xd69e('0x3f')]=_['merge'](_0x92c435[_0xd69e('0x3f')],{'$or':_[_0xd69e('0x42')](_0x92c435[_0xd69e('0x39')],function(_0x2e5cf8){var _0x2ab30c={};_0x2ab30c[_0x2e5cf8]={'$like':'%'+_0xfb102b[_0xd69e('0x35')][_0xd69e('0x40')]+'%'};return _0x2ab30c;})});}_0x92c435=_[_0xd69e('0x41')]({},_0x92c435,_0xfb102b[_0xd69e('0x47')]);return _0xae044d['getConfigurations'](_0x92c435);}})[_0xd69e('0x2e')](function(_0x28dfa8){if(_0x28dfa8){_0x380d7a=_0x28dfa8[_0xd69e('0x3a')];if(!_0xfb102b[_0xd69e('0x35')]['hasOwnProperty'](_0xd69e('0x3c'))){_0x92c435['limit']=qs['limit'](_0xfb102b[_0xd69e('0x35')][_0xd69e('0x3d')]);_0x92c435['offset']=qs['offset'](_0xfb102b['query'][_0xd69e('0x28')]);}return _0xae044d['getConfigurations'](_0x92c435);}})[_0xd69e('0x2e')](function(_0x42d311){if(_0x42d311){return _0x42d311?{'count':_0x380d7a,'rows':_0x42d311}:null;}})[_0xd69e('0x2e')](respondWithResult(_0x8ed2bd,null))['catch'](handleError(_0x8ed2bd,null));};exports[_0xd69e('0x57')]=function(_0x683786,_0x576830,_0x12616f){if(_0x683786[_0xd69e('0x50')]['id']){delete _0x683786[_0xd69e('0x50')]['id'];}return db[_0xd69e('0x32')][_0xd69e('0x53')]({'where':{'id':_0x683786[_0xd69e('0x51')]['id']}})[_0xd69e('0x2e')](handleEntityNotFound(_0x576830,null))[_0xd69e('0x2e')](function(_0x5d5fa0){if(_0x5d5fa0){_0x683786[_0xd69e('0x50')][_0xd69e('0x58')]=_0x5d5fa0['id'];_0x683786[_0xd69e('0x50')]['Subjects']=integrations[_0xd69e('0x59')](_0x683786[_0xd69e('0x50')][_0xd69e('0x5a')],_0x683786[_0xd69e('0x50')]['type']);_0x683786[_0xd69e('0x50')][_0xd69e('0x5b')]=integrations[_0xd69e('0x5c')](_0x683786['body']['channel'],_0x683786[_0xd69e('0x50')]['type']);return db[_0xd69e('0x54')][_0xd69e('0x4f')](_0x683786[_0xd69e('0x50')],{'include':[{'model':db[_0xd69e('0x5d')],'as':_0xd69e('0x5e')},{'model':db[_0xd69e('0x5d')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x576830,null))[_0xd69e('0x4c')](handleError(_0x576830,null));};exports[_0xd69e('0x5f')]=function(_0xca660d,_0x5629ca,_0x129724){var _0x503710=_0xca660d[_0xd69e('0x35')]['ticketType'];var _0x54e86f=_0x503710==='incident'?'Incident':'PhoneCall';var _0x4821f8='';var _0x45bec7='';var _0x3ff600='';var _0x5622eb='';var _0x49a777='';var _0x57311f='';var _0x3d95a7='';var _0x43e874='';var _0x5e0f45=[_0xd69e('0x60'),_0xd69e('0x61'),'customerid',_0xd69e('0x62'),_0xd69e('0x63'),_0xd69e('0x64'),_0xd69e('0x65'),_0xd69e('0x66'),_0xd69e('0x67'),'phonecall_activity_parties'];var _0x329df6=[_0xd69e('0x68'),_0xd69e('0x69'),_0xd69e('0x6a'),'billedserviceunits','contactidname','contactidyominame',_0xd69e('0x6b'),'contractidname',_0xd69e('0x6c'),'createdbyexternalpartyyominame',_0xd69e('0x6d'),_0xd69e('0x6e'),'createdon',_0xd69e('0x6f'),'createdonbehalfbyyominame',_0xd69e('0x70'),_0xd69e('0x71'),_0xd69e('0x72'),'emailaddress',_0xd69e('0x73'),_0xd69e('0x74'),_0xd69e('0x75'),_0xd69e('0x76'),_0xd69e('0x77'),_0xd69e('0x78'),_0xd69e('0x79'),_0xd69e('0x7a'),_0xd69e('0x7b'),'kbarticleidname','lastonholdtime','masteridname',_0xd69e('0x7c'),'modifiedbyexternalpartyyominame',_0xd69e('0x7d'),_0xd69e('0x7e'),_0xd69e('0x7f'),_0xd69e('0x80'),_0xd69e('0x81'),'msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon',_0xd69e('0x82'),_0xd69e('0x83'),'owneridyominame',_0xd69e('0x84'),_0xd69e('0x85'),_0xd69e('0x86'),'prioritycodename',_0xd69e('0x87'),_0xd69e('0x88'),_0xd69e('0x89'),'resolvebykpiidname',_0xd69e('0x8a'),_0xd69e('0x8b'),_0xd69e('0x8c'),_0xd69e('0x8d'),_0xd69e('0x8e'),_0xd69e('0x8f'),'socialprofileidname',_0xd69e('0x90'),'statuscode',_0xd69e('0x91'),_0xd69e('0x92'),_0xd69e('0x93'),_0xd69e('0x94'),_0xd69e('0x95'),'utcconversiontimezonecode',_0xd69e('0x96')];var _0x3a5866=_0x5e0f45[_0xd69e('0x97')](_0x329df6);return db[_0xd69e('0x32')][_0xd69e('0x53')]({'where':{'id':_0xca660d['params']['id']},'attributes':['id',_0xd69e('0x98'),_0xd69e('0x99'),_0xd69e('0x9a'),_0xd69e('0x9b'),_0xd69e('0x9c'),_0xd69e('0x9d')]})[_0xd69e('0x2e')](handleEntityNotFound(_0x5629ca,null))[_0xd69e('0x2e')](function(_0x1d834b){if(_0x1d834b){_0x43e874=_0x1d834b[_0xd69e('0x9a')];var _0x2328d7=_0x43e874[_0xd69e('0x9e')](-0x1);if(_0x2328d7==='/'){_0x43e874=_0x43e874[_0xd69e('0x9f')](0x0,_0x43e874[_0xd69e('0xa0')](_0x2328d7));}_0x3d95a7=util[_0xd69e('0xa1')](_0xd69e('0xa2'),_0x43e874);var _0x1b0e79={'method':_0xd69e('0xa3'),'uri':_0xd69e('0xa4')+_0x1d834b[_0xd69e('0x9b')]+_0xd69e('0xa5'),'form':{'client_id':_0x1d834b[_0xd69e('0x9c')],'resource':_0x43e874,'username':_0x1d834b['username'],'password':_0x1d834b[_0xd69e('0x99')],'grant_type':_0xd69e('0x99'),'client_secret':_0x1d834b['clientSecret']},'json':!![]};return rp(_0x1b0e79);}})[_0xd69e('0x2e')](function(_0x486ddd){_0x57311f=_0x486ddd[_0xd69e('0xa6')];var _0x3a6711={'method':'GET','uri':encodeURI(_0x3d95a7+_0xd69e('0xa7')+_0x54e86f+'\x27'),'headers':{'Authorization':_0xd69e('0xa8')+_0x57311f,'If-None-Match':null,'OData-Version':_0xd69e('0xa9')},'json':!![]};return rp(_0x3a6711);})[_0xd69e('0x2e')](function(_0x47afc3){var _0x4cf05a=_0x47afc3[_0xd69e('0xaa')][0x0];var _0xe0b023=_0x4cf05a['MetadataId'];var _0x17ec80={'method':_0xd69e('0xab'),'uri':_0x3d95a7+_0xd69e('0xac')+_0xe0b023+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xd69e('0xa8')+_0x57311f,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x17ec80);})[_0xd69e('0x2e')](function(_0x40a7c0){_0x4821f8=_0x40a7c0;_0x45bec7=_0x4821f8[_0xd69e('0xad')];_0x45bec7=_['remove'](_0x45bec7,function(_0x43d5a5){return!_0x3a5866[_0xd69e('0xae')](_0x43d5a5[_0xd69e('0xaf')]);});var _0x116c07=[];var _0x41d5cb=[];_0x45bec7[_0xd69e('0xb0')](function(_0x933bc6){if(_0x933bc6[_0xd69e('0xb1')]){var _0x53b46a=_0x933bc6[_0xd69e('0xb1')][_0xd69e('0x9f')](_0x933bc6[_0xd69e('0xb1')]['lastIndexOf']('.')+0x1);if(_0x53b46a===_0xd69e('0xb2')){_0x116c07[_0xd69e('0xb3')](getSelectList(_0x3d95a7,_0x503710,_0x41d5cb,_0x4821f8[_0xd69e('0xb4')],_0x933bc6[_0xd69e('0xb4')],_0x57311f));}}});return Promise[_0xd69e('0xb5')](_0x116c07);})[_0xd69e('0x2e')](function(_0xb2c68b){_0x3ff600=_0xb2c68b[0x0];var _0x4a9b36=[];var _0x3e5e77=[];_0x45bec7[_0xd69e('0xb0')](function(_0x18e60f){if(!_['isNil'](_0x18e60f['@odata.type'])){var _0x57cb01=_0x18e60f[_0xd69e('0xb1')][_0xd69e('0x9f')](_0x18e60f['@odata.type'][_0xd69e('0xa0')]('.')+0x1);if(_0x57cb01==='BooleanAttributeMetadata'){_0x4a9b36[_0xd69e('0xb3')](getBooleanList(_0x3d95a7,_0x503710,_0x3e5e77,_0x4821f8[_0xd69e('0xb4')],_0x18e60f[_0xd69e('0xb4')],_0x57311f));}}});return Promise[_0xd69e('0xb5')](_0x4a9b36);})[_0xd69e('0x2e')](function(_0x879d3d){_0x5622eb=_0x879d3d[0x0];var _0x2039ff=[];var _0x45a62a=[];_0x45bec7[_0xd69e('0xb0')](function(_0x551dd4){if(_0x551dd4[_0xd69e('0xb1')]){var _0x23f751=_0x551dd4[_0xd69e('0xb1')]['substring'](_0x551dd4[_0xd69e('0xb1')][_0xd69e('0xa0')]('.')+0x1);if(_0x23f751===_0xd69e('0xb6')||_0x23f751===_0xd69e('0xb7')||_0x23f751===_0xd69e('0xb8')||_0x23f751===_0xd69e('0xb9')||_0x23f751===_0xd69e('0xba')||_0x23f751===_0xd69e('0xbb')||_0x23f751===_0xd69e('0xbc')||_0x23f751==='EntityNameAttributeMetadata'||_0x23f751===_0xd69e('0xbd')||_0x23f751===_0xd69e('0xbe')){_0x2039ff[_0xd69e('0xb3')](getInputList(_0x3d95a7,_0x503710,_0x23f751,_0x45a62a,_0x4821f8['MetadataId'],_0x551dd4[_0xd69e('0xb4')],_0x57311f));}}});return Promise['all'](_0x2039ff);})[_0xd69e('0x2e')](function(_0x4d17d8){_0x49a777=_0x4d17d8[0x0];var _0x44ba36=_0x3ff600[_0xd69e('0x97')](_0x5622eb)[_0xd69e('0x97')](_0x49a777);var _0x304108={'count':_0x44ba36[_0xd69e('0x3a')],'rows':_0x44ba36};return _0x304108;})[_0xd69e('0x2e')](respondWithResult(_0x5629ca,null))[_0xd69e('0x4c')](function(_0x4b5c1f){console[_0xd69e('0xbf')](_0xd69e('0xc0')+_0x4b5c1f);var _0x20fc2c=_0xca660d[_0xd69e('0x35')]['test']?0x1f4:_0x4b5c1f[_0xd69e('0xc1')]||0x1f4;logger[_0xd69e('0x1e')](_0x4b5c1f['stack']);delete _0x4b5c1f[_0xd69e('0x30')];if(_0x20fc2c===0x191){_0x20fc2c=0x190;}_0x5629ca[_0xd69e('0x24')](_0x20fc2c)[_0xd69e('0xc2')](_0xca660d[_0xd69e('0x35')][_0xd69e('0xc3')]?{'message':_0xd69e('0xc4'),'statusCode':_0x4b5c1f[_0xd69e('0xc1')]}:_0x4b5c1f);});};function getSelectList(_0x4a09ec,_0x2755cf,_0xcd997,_0x21989e,_0x37526e,_0x3a872c){var _0x5e48c7={'method':_0xd69e('0xab'),'uri':_0x4a09ec+_0xd69e('0xac')+_0x21989e+_0xd69e('0xc5')+_0x37526e+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xd69e('0xc6'),'headers':{'Authorization':_0xd69e('0xa8')+_0x3a872c,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5e48c7)['then'](function(_0x184e56){var _0x267f9a=[];var _0x2d2d6d=_0x184e56[_0xd69e('0xc7')][_0xd69e('0xc8')];_0x2d2d6d['forEach'](function(_0x4570e7){_0x267f9a[_0xd69e('0xb3')]({'name':_0x4570e7[_0xd69e('0xc9')][_0xd69e('0xca')][_0xd69e('0xc9')],'value':String(_0x4570e7[_0xd69e('0xcb')])});});var _0x21c3a6={'id':_0x2755cf+'_'+_0x184e56[_0xd69e('0xaf')],'name':_0x184e56[_0xd69e('0xcc')][_0xd69e('0xca')]['Label'],'custom':![],'options':_0x267f9a};_0xcd997[_0xd69e('0xb3')](_0x21c3a6);return _0xcd997;});}function getBooleanList(_0xa38007,_0x30490f,_0x56f17c,_0x5d3f7f,_0xf67d1a,_0x1cd302){var _0x5a7b95={'method':_0xd69e('0xab'),'uri':_0xa38007+_0xd69e('0xac')+_0x5d3f7f+_0xd69e('0xc5')+_0xf67d1a+_0xd69e('0xcd'),'headers':{'Authorization':'Bearer\x20'+_0x1cd302,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5a7b95)[_0xd69e('0x2e')](function(_0x1f6f81){var _0x2f3d47=[];_0x2f3d47['push']({'name':_0x1f6f81[_0xd69e('0xc7')][_0xd69e('0xce')][_0xd69e('0xc9')]['UserLocalizedLabel']['Label'],'value':_0xd69e('0xcf')},{'name':_0x1f6f81[_0xd69e('0xc7')][_0xd69e('0xd0')]['Label']['UserLocalizedLabel'][_0xd69e('0xc9')],'value':'false'});var _0x3085b9={'id':_0x30490f+'_'+_0x1f6f81[_0xd69e('0xaf')],'name':_0x1f6f81[_0xd69e('0xcc')]['UserLocalizedLabel'][_0xd69e('0xc9')],'custom':![],'options':_0x2f3d47};_0x56f17c[_0xd69e('0xb3')](_0x3085b9);return _0x56f17c;});}function getInputList(_0xf9ac41,_0xbe8fed,_0x477ba1,_0xa7f7a2,_0x4be140,_0x25856a,_0x519f24){var _0x20b36d={'method':_0xd69e('0xab'),'uri':_0xf9ac41+_0xd69e('0xac')+_0x4be140+_0xd69e('0xc5')+_0x25856a+')/Microsoft.Dynamics.CRM.'+_0x477ba1+_0xd69e('0xd1'),'headers':{'Authorization':'Bearer\x20'+_0x519f24,'If-None-Match':null,'OData-Version':_0xd69e('0xa9')},'json':!![]};return rp(_0x20b36d)[_0xd69e('0x2e')](function(_0xf88b8d){var _0x285867={'id':_0xbe8fed+'_'+_0xf88b8d[_0xd69e('0xaf')],'name':_0xf88b8d['DisplayName']['UserLocalizedLabel']?_0xf88b8d[_0xd69e('0xcc')][_0xd69e('0xca')][_0xd69e('0xc9')]:_0xf88b8d[_0xd69e('0xaf')],'custom':![],'options':[]};_0xa7f7a2[_0xd69e('0xb3')](_0x285867);return _0xa7f7a2;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 9bac00b..ed2dde4 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 _0xa35a=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','Dynamics365Account','int_dynamics365_accounts'];(function(_0x543ec1,_0x295d1e){var _0x243525=function(_0x31faea){while(--_0x31faea){_0x543ec1['push'](_0x543ec1['shift']());}};_0x243525(++_0x295d1e);}(_0xa35a,0x111));var _0xaa35=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xa35a[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0xaa35('0x0'));var util=require(_0xaa35('0x1'));var logger=require(_0xaa35('0x2'))('api');var moment=require(_0xaa35('0x3'));var BPromise=require(_0xaa35('0x4'));var rp=require(_0xaa35('0x5'));var fs=require('fs');var path=require(_0xaa35('0x6'));var rimraf=require('rimraf');var config=require(_0xaa35('0x7'));var attributes=require(_0xaa35('0x8'));var integrations=require(_0xaa35('0x9'));module[_0xaa35('0xa')]=function(_0x16ea84,_0x3956a6){return _0x16ea84['define'](_0xaa35('0xb'),attributes,{'tableName':_0xaa35('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf6a=['../../components/integrations/configuration','exports','Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intDynamics365Account.attributes'];(function(_0x929c7e,_0x38c4cc){var _0x5de099=function(_0xc4e8d8){while(--_0xc4e8d8){_0x929c7e['push'](_0x929c7e['shift']());}};_0x5de099(++_0x38c4cc);}(_0xaf6a,0x1a8));var _0xaaf6=function(_0x58ecb4,_0x2c03c4){_0x58ecb4=_0x58ecb4-0x0;var _0x4b2adc=_0xaf6a[_0x58ecb4];return _0x4b2adc;};'use strict';var _=require('lodash');var util=require(_0xaaf6('0x0'));var logger=require(_0xaaf6('0x1'))(_0xaaf6('0x2'));var moment=require('moment');var BPromise=require(_0xaaf6('0x3'));var rp=require(_0xaaf6('0x4'));var fs=require('fs');var path=require(_0xaaf6('0x5'));var rimraf=require('rimraf');var config=require(_0xaaf6('0x6'));var attributes=require(_0xaaf6('0x7'));var integrations=require(_0xaaf6('0x8'));module[_0xaaf6('0x9')]=function(_0x3974f6,_0x47d2bb){return _0x3974f6['define'](_0xaaf6('0xa'),attributes,{'tableName':_0xaaf6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 1191708..e20783f 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 _0xcc76=['GetDynamics365Account','Dynamics365Account','findAll','options','attributes','limit','include','map','model','then','catch','where','ShowDynamics365Account','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x342299,_0x307e1c){var _0xf1dfd2=function(_0x1be4f0){while(--_0x1be4f0){_0x342299['push'](_0x342299['shift']());}};_0xf1dfd2(++_0x307e1c);}(_0xcc76,0xd3));var _0x6cc7=function(_0xd57b87,_0x1aba9f){_0xd57b87=_0xd57b87-0x0;var _0x50cd60=_0xcc76[_0xd57b87];return _0x50cd60;};'use strict';var _=require(_0x6cc7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6cc7('0x1'));var rs=require(_0x6cc7('0x2'));var fs=require('fs');var Redis=require(_0x6cc7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6cc7('0x4'));var logger=require(_0x6cc7('0x5'))(_0x6cc7('0x6'));var config=require(_0x6cc7('0x7'));var jayson=require(_0x6cc7('0x8'));var client=jayson['client'][_0x6cc7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x444deb,_0x5ab6e5,_0x366d72){return new BPromise(function(_0x3209e0,_0x4e4e7e){return client[_0x6cc7('0xa')](_0x444deb,_0x366d72)['then'](function(_0x2cfe4b){logger[_0x6cc7('0xb')](_0x6cc7('0xc'),_0x5ab6e5,_0x6cc7('0xd'));logger[_0x6cc7('0xe')](_0x6cc7('0xf'),_0x5ab6e5,_0x6cc7('0xd'),JSON[_0x6cc7('0x10')](_0x2cfe4b));if(_0x2cfe4b[_0x6cc7('0x11')]){if(_0x2cfe4b[_0x6cc7('0x11')]['code']===0x1f4){logger[_0x6cc7('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x5ab6e5,_0x2cfe4b[_0x6cc7('0x11')][_0x6cc7('0x12')]);return _0x4e4e7e(_0x2cfe4b['error'][_0x6cc7('0x12')]);}logger['error'](_0x6cc7('0xc'),_0x5ab6e5,_0x2cfe4b[_0x6cc7('0x11')][_0x6cc7('0x12')]);return _0x3209e0(_0x2cfe4b[_0x6cc7('0x11')][_0x6cc7('0x12')]);}else{logger['info'](_0x6cc7('0xc'),_0x5ab6e5,_0x6cc7('0xd'));_0x3209e0(_0x2cfe4b[_0x6cc7('0x13')]['message']);}})['catch'](function(_0x162e1a){logger[_0x6cc7('0x11')](_0x6cc7('0xc'),_0x5ab6e5,_0x162e1a);_0x4e4e7e(_0x162e1a);});});}exports[_0x6cc7('0x14')]=function(_0xbdc795){var _0x412841=this;return new Promise(function(_0x1f5917,_0x3d705b){return db[_0x6cc7('0x15')][_0x6cc7('0x16')]({'raw':_0xbdc795[_0x6cc7('0x17')]?_0xbdc795['options']['raw']===undefined?!![]:![]:!![],'where':_0xbdc795['options']?_0xbdc795[_0x6cc7('0x17')]['where']||null:null,'attributes':_0xbdc795[_0x6cc7('0x17')]?_0xbdc795[_0x6cc7('0x17')][_0x6cc7('0x18')]||null:null,'limit':_0xbdc795[_0x6cc7('0x17')]?_0xbdc795[_0x6cc7('0x17')][_0x6cc7('0x19')]||null:null,'include':_0xbdc795[_0x6cc7('0x17')]?_0xbdc795[_0x6cc7('0x17')][_0x6cc7('0x1a')]?_[_0x6cc7('0x1b')](_0xbdc795[_0x6cc7('0x17')]['include'],function(_0x33a4bb){return{'model':db[_0x33a4bb[_0x6cc7('0x1c')]],'as':_0x33a4bb['as'],'attributes':_0x33a4bb[_0x6cc7('0x18')],'include':_0x33a4bb[_0x6cc7('0x1a')]?_['map'](_0x33a4bb['include'],function(_0xfcd3a7){return{'model':db[_0xfcd3a7[_0x6cc7('0x1c')]],'as':_0xfcd3a7['as'],'attributes':_0xfcd3a7['attributes'],'include':_0xfcd3a7[_0x6cc7('0x1a')]?_[_0x6cc7('0x1b')](_0xfcd3a7['include'],function(_0x20292c){return{'model':db[_0x20292c[_0x6cc7('0x1c')]],'as':_0x20292c['as'],'attributes':_0x20292c[_0x6cc7('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6cc7('0x1d')](function(_0x353051){logger['info'](_0x6cc7('0x14'),_0xbdc795);logger[_0x6cc7('0xe')](_0x6cc7('0x14'),_0xbdc795,JSON['stringify'](_0x353051));_0x1f5917(_0x353051);})[_0x6cc7('0x1e')](function(_0x3f5391){logger[_0x6cc7('0x11')]('GetDynamics365Account',_0x3f5391['message'],_0xbdc795);_0x3d705b(_0x412841[_0x6cc7('0x11')](0x1f4,_0x3f5391['message']));});});};exports['ShowDynamics365Account']=function(_0x3df392){var _0x198e54=this;return new Promise(function(_0x4b8efc,_0x1cc776){return db['Dynamics365Account']['find']({'raw':_0x3df392['options']?_0x3df392[_0x6cc7('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3df392[_0x6cc7('0x17')]?_0x3df392[_0x6cc7('0x17')][_0x6cc7('0x1f')]||null:null,'attributes':_0x3df392[_0x6cc7('0x17')]?_0x3df392[_0x6cc7('0x17')][_0x6cc7('0x18')]||null:null,'include':_0x3df392[_0x6cc7('0x17')]?_0x3df392['options']['include']?_[_0x6cc7('0x1b')](_0x3df392['options']['include'],function(_0x5bc771){return{'model':db[_0x5bc771['model']],'as':_0x5bc771['as'],'attributes':_0x5bc771[_0x6cc7('0x18')],'include':_0x5bc771[_0x6cc7('0x1a')]?_[_0x6cc7('0x1b')](_0x5bc771[_0x6cc7('0x1a')],function(_0x2b46da){return{'model':db[_0x2b46da[_0x6cc7('0x1c')]],'as':_0x2b46da['as'],'attributes':_0x2b46da['attributes'],'include':_0x2b46da[_0x6cc7('0x1a')]?_[_0x6cc7('0x1b')](_0x2b46da[_0x6cc7('0x1a')],function(_0x5eb41e){return{'model':db[_0x5eb41e[_0x6cc7('0x1c')]],'as':_0x5eb41e['as'],'attributes':_0x5eb41e[_0x6cc7('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa285bb){logger[_0x6cc7('0xb')](_0x6cc7('0x20'),_0x3df392);logger['debug'](_0x6cc7('0x20'),_0x3df392,JSON[_0x6cc7('0x10')](_0xa285bb));_0x4b8efc(_0xa285bb);})[_0x6cc7('0x1e')](function(_0x4703ad){logger[_0x6cc7('0x11')]('ShowDynamics365Account',_0x4703ad[_0x6cc7('0x12')],_0x3df392);_0x1cc776(_0x198e54[_0x6cc7('0x11')](0x1f4,_0x4703ad['message']));});});}; \ No newline at end of file +var _0x0d75=['client','http','request','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','ShowDynamics365Account','find','then','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3d5351,_0x27bc80){var _0x1db4db=function(_0x3f572b){while(--_0x3f572b){_0x3d5351['push'](_0x3d5351['shift']());}};_0x1db4db(++_0x27bc80);}(_0x0d75,0x183));var _0x50d7=function(_0x167718,_0x3e72a6){_0x167718=_0x167718-0x0;var _0x45df84=_0x0d75[_0x167718];return _0x45df84;};'use strict';var _=require(_0x50d7('0x0'));var util=require(_0x50d7('0x1'));var moment=require(_0x50d7('0x2'));var BPromise=require(_0x50d7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x50d7('0x4'))['db'];var utils=require(_0x50d7('0x5'));var logger=require(_0x50d7('0x6'))('rpc');var config=require(_0x50d7('0x7'));var jayson=require(_0x50d7('0x8'));var client=jayson[_0x50d7('0x9')][_0x50d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3130c7,_0x3f9f90,_0xd8bb35){return new BPromise(function(_0x3c99bb,_0x5cbcdf){return client[_0x50d7('0xb')](_0x3130c7,_0xd8bb35)['then'](function(_0x26dbca){logger[_0x50d7('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x3f9f90,_0x50d7('0xd'));logger[_0x50d7('0xe')](_0x50d7('0xf'),_0x3f9f90,_0x50d7('0xd'),JSON[_0x50d7('0x10')](_0x26dbca));if(_0x26dbca[_0x50d7('0x11')]){if(_0x26dbca['error'][_0x50d7('0x12')]===0x1f4){logger[_0x50d7('0x11')](_0x50d7('0x13'),_0x3f9f90,_0x26dbca[_0x50d7('0x11')][_0x50d7('0x14')]);return _0x5cbcdf(_0x26dbca[_0x50d7('0x11')][_0x50d7('0x14')]);}logger[_0x50d7('0x11')](_0x50d7('0x13'),_0x3f9f90,_0x26dbca['error']['message']);return _0x3c99bb(_0x26dbca[_0x50d7('0x11')][_0x50d7('0x14')]);}else{logger['info'](_0x50d7('0x13'),_0x3f9f90,_0x50d7('0xd'));_0x3c99bb(_0x26dbca['result']['message']);}})[_0x50d7('0x15')](function(_0x3a512a){logger[_0x50d7('0x11')](_0x50d7('0x13'),_0x3f9f90,_0x3a512a);_0x5cbcdf(_0x3a512a);});});}exports[_0x50d7('0x16')]=function(_0x2b5325){var _0x45422b=this;return new Promise(function(_0x2c0036,_0x5c8846){return db[_0x50d7('0x17')][_0x50d7('0x18')]({'raw':_0x2b5325[_0x50d7('0x19')]?_0x2b5325[_0x50d7('0x19')][_0x50d7('0x1a')]===undefined?!![]:![]:!![],'where':_0x2b5325[_0x50d7('0x19')]?_0x2b5325[_0x50d7('0x19')][_0x50d7('0x1b')]||null:null,'attributes':_0x2b5325[_0x50d7('0x19')]?_0x2b5325[_0x50d7('0x19')][_0x50d7('0x1c')]||null:null,'limit':_0x2b5325[_0x50d7('0x19')]?_0x2b5325[_0x50d7('0x19')][_0x50d7('0x1d')]||null:null,'include':_0x2b5325['options']?_0x2b5325[_0x50d7('0x19')][_0x50d7('0x1e')]?_[_0x50d7('0x1f')](_0x2b5325['options'][_0x50d7('0x1e')],function(_0x708560){return{'model':db[_0x708560[_0x50d7('0x20')]],'as':_0x708560['as'],'attributes':_0x708560[_0x50d7('0x1c')],'include':_0x708560[_0x50d7('0x1e')]?_[_0x50d7('0x1f')](_0x708560[_0x50d7('0x1e')],function(_0xb24e00){return{'model':db[_0xb24e00[_0x50d7('0x20')]],'as':_0xb24e00['as'],'attributes':_0xb24e00[_0x50d7('0x1c')],'include':_0xb24e00[_0x50d7('0x1e')]?_[_0x50d7('0x1f')](_0xb24e00[_0x50d7('0x1e')],function(_0x1ab4c6){return{'model':db[_0x1ab4c6[_0x50d7('0x20')]],'as':_0x1ab4c6['as'],'attributes':_0x1ab4c6[_0x50d7('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x276091){logger[_0x50d7('0xc')](_0x50d7('0x16'),_0x2b5325);logger[_0x50d7('0xe')]('GetDynamics365Account',_0x2b5325,JSON[_0x50d7('0x10')](_0x276091));_0x2c0036(_0x276091);})[_0x50d7('0x15')](function(_0x176d6d){logger[_0x50d7('0x11')](_0x50d7('0x16'),_0x176d6d[_0x50d7('0x14')],_0x2b5325);_0x5c8846(_0x45422b[_0x50d7('0x11')](0x1f4,_0x176d6d[_0x50d7('0x14')]));});});};exports[_0x50d7('0x21')]=function(_0x4b0b75){var _0x133b60=this;return new Promise(function(_0x2fa8d1,_0x39e54d){return db[_0x50d7('0x17')][_0x50d7('0x22')]({'raw':_0x4b0b75[_0x50d7('0x19')]?_0x4b0b75[_0x50d7('0x19')][_0x50d7('0x1a')]===undefined?!![]:![]:!![],'where':_0x4b0b75[_0x50d7('0x19')]?_0x4b0b75['options'][_0x50d7('0x1b')]||null:null,'attributes':_0x4b0b75['options']?_0x4b0b75[_0x50d7('0x19')][_0x50d7('0x1c')]||null:null,'include':_0x4b0b75[_0x50d7('0x19')]?_0x4b0b75[_0x50d7('0x19')]['include']?_[_0x50d7('0x1f')](_0x4b0b75['options'][_0x50d7('0x1e')],function(_0x3d2614){return{'model':db[_0x3d2614[_0x50d7('0x20')]],'as':_0x3d2614['as'],'attributes':_0x3d2614['attributes'],'include':_0x3d2614['include']?_[_0x50d7('0x1f')](_0x3d2614[_0x50d7('0x1e')],function(_0x166aac){return{'model':db[_0x166aac[_0x50d7('0x20')]],'as':_0x166aac['as'],'attributes':_0x166aac[_0x50d7('0x1c')],'include':_0x166aac['include']?_[_0x50d7('0x1f')](_0x166aac['include'],function(_0x2135ae){return{'model':db[_0x2135ae['model']],'as':_0x2135ae['as'],'attributes':_0x2135ae[_0x50d7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x50d7('0x23')](function(_0x22f7be){logger[_0x50d7('0xc')](_0x50d7('0x21'),_0x4b0b75);logger['debug'](_0x50d7('0x21'),_0x4b0b75,JSON[_0x50d7('0x10')](_0x22f7be));_0x2fa8d1(_0x22f7be);})[_0x50d7('0x15')](function(_0xf0bec8){logger[_0x50d7('0x11')](_0x50d7('0x21'),_0xf0bec8[_0x50d7('0x14')],_0x4b0b75);_0x39e54d(_0x133b60['error'](0x1f4,_0xf0bec8[_0x50d7('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 68d849f..1c53e69 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 _0x5fd6=['../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','util','connect-timeout','Router','../../components/interaction/service'];(function(_0x59aedf,_0x1e5baa){var _0x465a37=function(_0x581e5a){while(--_0x581e5a){_0x59aedf['push'](_0x59aedf['shift']());}};_0x465a37(++_0x1e5baa);}(_0x5fd6,0xee));var _0x65fd=function(_0x263d48,_0xb3861d){_0x263d48=_0x263d48-0x0;var _0x43a21a=_0x5fd6[_0x263d48];return _0x43a21a;};'use strict';var multer=require('multer');var util=require(_0x65fd('0x0'));var path=require('path');var timeout=require(_0x65fd('0x1'));var express=require('express');var router=express[_0x65fd('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x65fd('0x3'));var config=require(_0x65fd('0x4'));var controller=require(_0x65fd('0x5'));router[_0x65fd('0x6')]('/',auth[_0x65fd('0x7')](),controller[_0x65fd('0x8')]);router[_0x65fd('0x6')](_0x65fd('0x9'),auth[_0x65fd('0x7')](),controller['show']);router[_0x65fd('0x6')](_0x65fd('0xa'),auth['isAuthenticated'](),controller[_0x65fd('0xb')]);router[_0x65fd('0x6')](_0x65fd('0xc'),auth[_0x65fd('0x7')](),controller[_0x65fd('0xd')]);router[_0x65fd('0x6')](_0x65fd('0xe'),auth['isAuthenticated'](),controller[_0x65fd('0xf')]);router['post']('/',auth[_0x65fd('0x7')](),controller[_0x65fd('0x10')]);router[_0x65fd('0x11')]('/:id',auth[_0x65fd('0x7')](),controller[_0x65fd('0x12')]);router[_0x65fd('0x13')](_0x65fd('0x9'),auth[_0x65fd('0x7')](),controller[_0x65fd('0x14')]);module[_0x65fd('0x15')]=router; \ No newline at end of file +var _0x193d=['show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post','create','update','delete','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x193d,0x1c3));var _0xd193=function(_0x5b34c0,_0x3ad403){_0x5b34c0=_0x5b34c0-0x0;var _0x242bd3=_0x193d[_0x5b34c0];return _0x242bd3;};'use strict';var multer=require('multer');var util=require(_0xd193('0x0'));var path=require('path');var timeout=require(_0xd193('0x1'));var express=require(_0xd193('0x2'));var router=express['Router']();var auth=require(_0xd193('0x3'));var interaction=require(_0xd193('0x4'));var config=require(_0xd193('0x5'));var controller=require('./intDynamics365Configuration.controller');router['get']('/',auth[_0xd193('0x6')](),controller['index']);router[_0xd193('0x7')](_0xd193('0x8'),auth['isAuthenticated'](),controller[_0xd193('0x9')]);router[_0xd193('0x7')](_0xd193('0xa'),auth[_0xd193('0x6')](),controller[_0xd193('0xb')]);router[_0xd193('0x7')](_0xd193('0xc'),auth[_0xd193('0x6')](),controller['getSubjects']);router[_0xd193('0x7')](_0xd193('0xd'),auth[_0xd193('0x6')](),controller['getDescriptions']);router[_0xd193('0xe')]('/',auth[_0xd193('0x6')](),controller[_0xd193('0xf')]);router['put'](_0xd193('0x8'),auth['isAuthenticated'](),controller[_0xd193('0x10')]);router[_0xd193('0x11')]('/:id',auth[_0xd193('0x6')](),controller[_0xd193('0x12')]);module[_0xd193('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 3642145..eb75af0 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 _0x0301=['incident','phonecall','sequelize','exports','STRING'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0x0301,0x129));var _0x1030=function(_0x5c6aeb,_0x1a3eda){_0x5c6aeb=_0x5c6aeb-0x0;var _0x518281=_0x0301[_0x5c6aeb];return _0x518281;};'use strict';var Sequelize=require(_0x1030('0x0'));module[_0x1030('0x1')]={'name':{'type':Sequelize[_0x1030('0x2')]},'description':{'type':Sequelize[_0x1030('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x1030('0x3'),_0x1030('0x4')),'defaultValue':_0x1030('0x3')}}; \ No newline at end of file +var _0x344a=['ENUM','incident','phonecall','sequelize','exports','STRING'];(function(_0x196d54,_0x151536){var _0x21deb1=function(_0x2481ce){while(--_0x2481ce){_0x196d54['push'](_0x196d54['shift']());}};_0x21deb1(++_0x151536);}(_0x344a,0xcf));var _0xa344=function(_0x1e3571,_0x111c87){_0x1e3571=_0x1e3571-0x0;var _0x5a9991=_0x344a[_0x1e3571];return _0x5a9991;};'use strict';var Sequelize=require(_0xa344('0x0'));module[_0xa344('0x1')]={'name':{'type':Sequelize[_0xa344('0x2')]},'description':{'type':Sequelize[_0xa344('0x2')]},'ticketType':{'type':Sequelize[_0xa344('0x3')](_0xa344('0x4'),_0xa344('0x5')),'defaultValue':_0xa344('0x4')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index df66cc1..4c48f32 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 _0xbfb9=['map','type','key','VIRTUAL','field','options','count','include','findAll','rows','catch','show','params','create','body','find','destroy','getFields','Dynamics365Field','pick','getSubjects','findOne','getDescriptions','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','set','Content-Range','apply','save','update','stack','name','send','Dynamics365Configuration','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','filter','merge'];(function(_0x88082,_0x308342){var _0x377916=function(_0x23ccd1){while(--_0x23ccd1){_0x88082['push'](_0x88082['shift']());}};_0x377916(++_0x308342);}(_0xbfb9,0x1e9));var _0x9bfb=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbfb9[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0x9bfb('0x0'));var emlformat=require(_0x9bfb('0x1'));var rimraf=require(_0x9bfb('0x2'));var zipdir=require(_0x9bfb('0x3'));var jsonpatch=require(_0x9bfb('0x4'));var rp=require(_0x9bfb('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x9bfb('0x6'));var sox=require(_0x9bfb('0x7'));var csv=require('to-csv');var ejs=require(_0x9bfb('0x8'));var fs=require('fs');var _=require(_0x9bfb('0x9'));var squel=require(_0x9bfb('0xa'));var crypto=require(_0x9bfb('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9bfb('0xc'));var toCsv=require(_0x9bfb('0xd'));var querystring=require(_0x9bfb('0xe'));var Papa=require(_0x9bfb('0xf'));var Redis=require(_0x9bfb('0x10'));var authService=require(_0x9bfb('0x11'));var qs=require(_0x9bfb('0x12'));var hardwareService=require(_0x9bfb('0x13'));var logger=require(_0x9bfb('0x14'))(_0x9bfb('0x15'));var utils=require(_0x9bfb('0x16'));var config=require(_0x9bfb('0x17'));var db=require(_0x9bfb('0x18'))['db'];var jayson=require(_0x9bfb('0x19'));var client=jayson['client'][_0x9bfb('0x1a')]({'port':0x232a});function checkPasswordPattern(_0xb7f26c,_0x261ca0,_0x17ba2d){if(_0x17ba2d){var _0x17594e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x17594e['test'](_0x261ca0)){return _0xb7f26c;}else{throw new Error(_0x9bfb('0x1b'));}}else{return _0xb7f26c;}}function respondWithRpcPromise(_0x4f13d5,_0x3c694d,_0x421908,_0x462800){return new BPromise(function(_0x5f4a20,_0xab3e99){var _0x2d7f14=_0x462800||client;return _0x2d7f14['request'](_0x4f13d5,_0x421908)[_0x9bfb('0x1c')](function(_0x5e3e0e){logger['info'](_0x9bfb('0x1d'),_0x3c694d,_0x9bfb('0x1e'));logger[_0x9bfb('0x1f')](_0x9bfb('0x20'),_0x3c694d,_0x9bfb('0x1e'),JSON[_0x9bfb('0x21')](_0x5e3e0e));if(_0x5e3e0e['error']){if(_0x5e3e0e[_0x9bfb('0x22')][_0x9bfb('0x23')]===0x1f4){logger[_0x9bfb('0x22')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3c694d,_0x5e3e0e[_0x9bfb('0x22')][_0x9bfb('0x24')]);return _0xab3e99(_0x5e3e0e[_0x9bfb('0x22')][_0x9bfb('0x24')]);}logger[_0x9bfb('0x22')](_0x9bfb('0x1d'),_0x3c694d,_0x5e3e0e[_0x9bfb('0x22')][_0x9bfb('0x24')]);return _0x5f4a20(_0x5e3e0e[_0x9bfb('0x22')][_0x9bfb('0x24')]);}else{logger[_0x9bfb('0x25')](_0x9bfb('0x1d'),_0x3c694d,_0x9bfb('0x1e'));_0x5f4a20(_0x5e3e0e[_0x9bfb('0x26')][_0x9bfb('0x24')]);}})['catch'](function(_0x4fb805){logger[_0x9bfb('0x22')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3c694d,_0x4fb805);_0xab3e99(_0x4fb805);});});}function respondWithStatusCode(_0x1aaf5d,_0x3cf9de){_0x3cf9de=_0x3cf9de||0xcc;return function(_0x380223){if(_0x380223){return _0x1aaf5d[_0x9bfb('0x27')](_0x3cf9de);}return _0x1aaf5d[_0x9bfb('0x28')](_0x3cf9de)[_0x9bfb('0x29')]();};}function respondWithResult(_0x473838,_0x48ab0b){_0x48ab0b=_0x48ab0b||0xc8;return function(_0x48f7f0){if(_0x48f7f0){return _0x473838['status'](_0x48ab0b)[_0x9bfb('0x2a')](_0x48f7f0);}};}function respondWithFilteredResult(_0x92c322,_0x8d2b5a){return function(_0x25e242){if(_0x25e242){var _0x539345=_0x25e242['count'],_0x205e43=_0x8d2b5a[_0x9bfb('0x2b')],_0x2d4a1b=_0x8d2b5a[_0x9bfb('0x2b')]+_0x8d2b5a['limit'],_0x466f03;if(_0x2d4a1b>=_0x539345){_0x2d4a1b=_0x539345;_0x466f03=0xc8;}else{_0x466f03=0xce;}_0x92c322[_0x9bfb('0x28')](_0x466f03);return _0x92c322[_0x9bfb('0x2c')](_0x9bfb('0x2d'),_0x205e43+'-'+_0x2d4a1b+'/'+_0x539345)[_0x9bfb('0x2a')](_0x25e242);}return null;};}function patchUpdates(_0x451792){return function(_0x4450ae){try{jsonpatch[_0x9bfb('0x2e')](_0x4450ae,_0x451792,!![]);}catch(_0x33ce85){return BPromise['reject'](_0x33ce85);}return _0x4450ae[_0x9bfb('0x2f')]();};}function saveUpdates(_0x5b71f4,_0x4ffe2c){return function(_0x4e0cd2){if(_0x4e0cd2){return _0x4e0cd2[_0x9bfb('0x30')](_0x5b71f4)[_0x9bfb('0x1c')](function(_0x568fdc){return _0x568fdc;});}return null;};}function removeEntity(_0x4ab691,_0x1c7220){return function(_0x5efeac){if(_0x5efeac){return _0x5efeac['destroy']()['then'](function(){_0x4ab691[_0x9bfb('0x28')](0xcc)[_0x9bfb('0x29')]();});}};}function handleEntityNotFound(_0x1ba1c8,_0xf47901){return function(_0x2dc8ff){if(!_0x2dc8ff){_0x1ba1c8[_0x9bfb('0x27')](0x194);}return _0x2dc8ff;};}function handleError(_0x3f8629,_0x489e76){_0x489e76=_0x489e76||0x1f4;return function(_0x447567){logger[_0x9bfb('0x22')](_0x447567[_0x9bfb('0x31')]);if(_0x447567['name']){delete _0x447567[_0x9bfb('0x32')];}_0x3f8629[_0x9bfb('0x28')](_0x489e76)[_0x9bfb('0x33')](_0x447567);};}exports['index']=function(_0x24b3b2,_0x34c35c){var _0x1efc17={},_0x148400={},_0x5a599d={'count':0x0,'rows':[]};var _0x5466b1=db[_0x9bfb('0x34')][_0x9bfb('0x35')];_0x148400[_0x9bfb('0x36')]=_['keys'](_0x5466b1);_0x148400['query']=_[_0x9bfb('0x37')](_0x24b3b2[_0x9bfb('0x38')]);_0x148400[_0x9bfb('0x39')]=_[_0x9bfb('0x3a')](_0x148400['model'],_0x148400[_0x9bfb('0x38')]);_0x1efc17['attributes']=_[_0x9bfb('0x3a')](_0x148400[_0x9bfb('0x36')],qs[_0x9bfb('0x3b')](_0x24b3b2['query'][_0x9bfb('0x3b')]));_0x1efc17[_0x9bfb('0x3c')]=_0x1efc17['attributes'][_0x9bfb('0x3d')]?_0x1efc17[_0x9bfb('0x3c')]:_0x148400[_0x9bfb('0x36')];if(!_0x24b3b2[_0x9bfb('0x38')]['hasOwnProperty'](_0x9bfb('0x3e'))){_0x1efc17['limit']=qs[_0x9bfb('0x3f')](_0x24b3b2['query'][_0x9bfb('0x3f')]);_0x1efc17[_0x9bfb('0x2b')]=qs['offset'](_0x24b3b2[_0x9bfb('0x38')]['offset']);}_0x1efc17[_0x9bfb('0x40')]=qs[_0x9bfb('0x41')](_0x24b3b2['query'][_0x9bfb('0x41')]);_0x1efc17[_0x9bfb('0x42')]=qs[_0x9bfb('0x39')](_['pick'](_0x24b3b2[_0x9bfb('0x38')],_0x148400[_0x9bfb('0x39')]));if(_0x24b3b2['query'][_0x9bfb('0x43')]){_0x1efc17['where']=_[_0x9bfb('0x44')](_0x1efc17['where'],{'$or':_[_0x9bfb('0x45')](_0x5466b1,function(_0x4ccf7e){if(_0x4ccf7e[_0x9bfb('0x46')][_0x9bfb('0x47')]!==_0x9bfb('0x48')){var _0x43adba={};_0x43adba[_0x4ccf7e[_0x9bfb('0x49')]]={'$like':'%'+_0x24b3b2[_0x9bfb('0x38')][_0x9bfb('0x43')]+'%'};return _0x43adba;}})});}_0x1efc17=_[_0x9bfb('0x44')]({},_0x1efc17,_0x24b3b2[_0x9bfb('0x4a')]);var _0x5b918f={'where':_0x1efc17[_0x9bfb('0x42')]};return db[_0x9bfb('0x34')][_0x9bfb('0x4b')](_0x5b918f)[_0x9bfb('0x1c')](function(_0x59903c){_0x5a599d[_0x9bfb('0x4b')]=_0x59903c;if(_0x24b3b2['query']['includeAll']){_0x1efc17[_0x9bfb('0x4c')]=[{'all':!![]}];}return db[_0x9bfb('0x34')][_0x9bfb('0x4d')](_0x1efc17);})['then'](function(_0x42374e){_0x5a599d[_0x9bfb('0x4e')]=_0x42374e;return _0x5a599d;})[_0x9bfb('0x1c')](respondWithFilteredResult(_0x34c35c,_0x1efc17))[_0x9bfb('0x4f')](handleError(_0x34c35c,null));};exports[_0x9bfb('0x50')]=function(_0x48a307,_0x43c40d){var _0x40b42b={'raw':![],'where':{'id':_0x48a307[_0x9bfb('0x51')]['id']}},_0x3d158c={};_0x3d158c[_0x9bfb('0x36')]=_['keys'](db[_0x9bfb('0x34')][_0x9bfb('0x35')]);_0x3d158c[_0x9bfb('0x38')]=_[_0x9bfb('0x37')](_0x48a307[_0x9bfb('0x38')]);_0x3d158c[_0x9bfb('0x39')]=_['intersection'](_0x3d158c[_0x9bfb('0x36')],_0x3d158c[_0x9bfb('0x38')]);_0x40b42b[_0x9bfb('0x3c')]=_[_0x9bfb('0x3a')](_0x3d158c[_0x9bfb('0x36')],qs[_0x9bfb('0x3b')](_0x48a307['query'][_0x9bfb('0x3b')]));_0x40b42b[_0x9bfb('0x3c')]=_0x40b42b[_0x9bfb('0x3c')][_0x9bfb('0x3d')]?_0x40b42b[_0x9bfb('0x3c')]:_0x3d158c['model'];if(_0x48a307['query']['includeAll']){_0x40b42b[_0x9bfb('0x4c')]=[{'all':!![]}];}_0x40b42b=_['merge']({},_0x40b42b,_0x48a307[_0x9bfb('0x4a')]);return db[_0x9bfb('0x34')]['find'](_0x40b42b)[_0x9bfb('0x1c')](handleEntityNotFound(_0x43c40d,null))['then'](respondWithResult(_0x43c40d,null))[_0x9bfb('0x4f')](handleError(_0x43c40d,null));};exports['create']=function(_0x484c8c,_0x302b2a){return db[_0x9bfb('0x34')][_0x9bfb('0x52')](_0x484c8c['body'],{})['then'](respondWithResult(_0x302b2a,0xc9))['catch'](handleError(_0x302b2a,null));};exports[_0x9bfb('0x30')]=function(_0x3cb47d,_0xcdf2c2){if(_0x3cb47d[_0x9bfb('0x53')]['id']){delete _0x3cb47d[_0x9bfb('0x53')]['id'];}return db[_0x9bfb('0x34')][_0x9bfb('0x54')]({'where':{'id':_0x3cb47d[_0x9bfb('0x51')]['id']}})[_0x9bfb('0x1c')](handleEntityNotFound(_0xcdf2c2,null))[_0x9bfb('0x1c')](saveUpdates(_0x3cb47d['body'],null))['then'](respondWithResult(_0xcdf2c2,null))['catch'](handleError(_0xcdf2c2,null));};exports[_0x9bfb('0x55')]=function(_0x3748e0,_0x558c4e){return db[_0x9bfb('0x34')][_0x9bfb('0x54')]({'where':{'id':_0x3748e0['params']['id']}})['then'](handleEntityNotFound(_0x558c4e,null))[_0x9bfb('0x1c')](removeEntity(_0x558c4e,null))[_0x9bfb('0x4f')](handleError(_0x558c4e,null));};exports[_0x9bfb('0x56')]=function(_0x29a751,_0x31d2c4,_0x2ac4c6){var _0x613963={};var _0x33f46d={};var _0x5553e6;var _0x2c412d;return db[_0x9bfb('0x34')]['findOne']({'where':{'id':_0x29a751['params']['id']}})[_0x9bfb('0x1c')](handleEntityNotFound(_0x31d2c4,null))[_0x9bfb('0x1c')](function(_0x38d47b){if(_0x38d47b){_0x5553e6=_0x38d47b;_0x33f46d[_0x9bfb('0x36')]=_[_0x9bfb('0x37')](db[_0x9bfb('0x57')][_0x9bfb('0x35')]);_0x33f46d[_0x9bfb('0x38')]=_[_0x9bfb('0x37')](_0x29a751[_0x9bfb('0x38')]);_0x33f46d[_0x9bfb('0x39')]=_[_0x9bfb('0x3a')](_0x33f46d[_0x9bfb('0x36')],_0x33f46d['query']);_0x613963[_0x9bfb('0x3c')]=_[_0x9bfb('0x3a')](_0x33f46d[_0x9bfb('0x36')],qs['fields'](_0x29a751['query']['fields']));_0x613963[_0x9bfb('0x3c')]=_0x613963['attributes']['length']?_0x613963[_0x9bfb('0x3c')]:_0x33f46d[_0x9bfb('0x36')];_0x613963[_0x9bfb('0x40')]=qs[_0x9bfb('0x41')](_0x29a751[_0x9bfb('0x38')][_0x9bfb('0x41')]);_0x613963[_0x9bfb('0x42')]=qs['filters'](_[_0x9bfb('0x58')](_0x29a751[_0x9bfb('0x38')],_0x33f46d[_0x9bfb('0x39')]));if(_0x29a751[_0x9bfb('0x38')][_0x9bfb('0x43')]){_0x613963['where']=_[_0x9bfb('0x44')](_0x613963[_0x9bfb('0x42')],{'$or':_[_0x9bfb('0x45')](_0x613963['attributes'],function(_0x4c93da){var _0x3eaa93={};_0x3eaa93[_0x4c93da]={'$like':'%'+_0x29a751[_0x9bfb('0x38')][_0x9bfb('0x43')]+'%'};return _0x3eaa93;})});}_0x613963=_[_0x9bfb('0x44')]({},_0x613963,_0x29a751[_0x9bfb('0x4a')]);return _0x5553e6['getFields'](_0x613963);}})[_0x9bfb('0x1c')](function(_0x2c6084){if(_0x2c6084){_0x2c412d=_0x2c6084[_0x9bfb('0x3d')];if(!_0x29a751[_0x9bfb('0x38')]['hasOwnProperty'](_0x9bfb('0x3e'))){_0x613963['limit']=qs[_0x9bfb('0x3f')](_0x29a751[_0x9bfb('0x38')][_0x9bfb('0x3f')]);_0x613963[_0x9bfb('0x2b')]=qs[_0x9bfb('0x2b')](_0x29a751[_0x9bfb('0x38')][_0x9bfb('0x2b')]);}return _0x5553e6[_0x9bfb('0x56')](_0x613963);}})[_0x9bfb('0x1c')](function(_0x3dafa0){if(_0x3dafa0){return _0x3dafa0?{'count':_0x2c412d,'rows':_0x3dafa0}:null;}})['then'](respondWithResult(_0x31d2c4,null))[_0x9bfb('0x4f')](handleError(_0x31d2c4,null));};exports[_0x9bfb('0x59')]=function(_0x2264d2,_0x79f5c4,_0x197121){var _0x258324={};var _0x37b4b2={};var _0x57b99c;var _0x4d712c;return db[_0x9bfb('0x34')][_0x9bfb('0x5a')]({'where':{'id':_0x2264d2[_0x9bfb('0x51')]['id']}})['then'](handleEntityNotFound(_0x79f5c4,null))['then'](function(_0x5e26f9){if(_0x5e26f9){_0x57b99c=_0x5e26f9;_0x37b4b2[_0x9bfb('0x36')]=_[_0x9bfb('0x37')](db['Dynamics365Field'][_0x9bfb('0x35')]);_0x37b4b2[_0x9bfb('0x38')]=_[_0x9bfb('0x37')](_0x2264d2[_0x9bfb('0x38')]);_0x37b4b2[_0x9bfb('0x39')]=_[_0x9bfb('0x3a')](_0x37b4b2['model'],_0x37b4b2[_0x9bfb('0x38')]);_0x258324[_0x9bfb('0x3c')]=_[_0x9bfb('0x3a')](_0x37b4b2[_0x9bfb('0x36')],qs['fields'](_0x2264d2[_0x9bfb('0x38')][_0x9bfb('0x3b')]));_0x258324['attributes']=_0x258324[_0x9bfb('0x3c')][_0x9bfb('0x3d')]?_0x258324[_0x9bfb('0x3c')]:_0x37b4b2[_0x9bfb('0x36')];_0x258324[_0x9bfb('0x40')]=qs['sort'](_0x2264d2[_0x9bfb('0x38')]['sort']);_0x258324[_0x9bfb('0x42')]=qs[_0x9bfb('0x39')](_[_0x9bfb('0x58')](_0x2264d2[_0x9bfb('0x38')],_0x37b4b2[_0x9bfb('0x39')]));if(_0x2264d2[_0x9bfb('0x38')][_0x9bfb('0x43')]){_0x258324[_0x9bfb('0x42')]=_[_0x9bfb('0x44')](_0x258324[_0x9bfb('0x42')],{'$or':_[_0x9bfb('0x45')](_0x258324[_0x9bfb('0x3c')],function(_0x1fd311){var _0x4ae848={};_0x4ae848[_0x1fd311]={'$like':'%'+_0x2264d2[_0x9bfb('0x38')][_0x9bfb('0x43')]+'%'};return _0x4ae848;})});}_0x258324=_['merge']({},_0x258324,_0x2264d2[_0x9bfb('0x4a')]);return _0x57b99c[_0x9bfb('0x59')](_0x258324);}})[_0x9bfb('0x1c')](function(_0x533830){if(_0x533830){_0x4d712c=_0x533830[_0x9bfb('0x3d')];if(!_0x2264d2['query']['hasOwnProperty'](_0x9bfb('0x3e'))){_0x258324[_0x9bfb('0x3f')]=qs[_0x9bfb('0x3f')](_0x2264d2[_0x9bfb('0x38')][_0x9bfb('0x3f')]);_0x258324[_0x9bfb('0x2b')]=qs['offset'](_0x2264d2[_0x9bfb('0x38')][_0x9bfb('0x2b')]);}return _0x57b99c[_0x9bfb('0x59')](_0x258324);}})['then'](function(_0x47e91c){if(_0x47e91c){return _0x47e91c?{'count':_0x4d712c,'rows':_0x47e91c}:null;}})[_0x9bfb('0x1c')](respondWithResult(_0x79f5c4,null))[_0x9bfb('0x4f')](handleError(_0x79f5c4,null));};exports[_0x9bfb('0x5b')]=function(_0x5e21f7,_0x3ccfa8,_0x4a6094){var _0x56e466={};var _0x3f6bfc={};var _0x16b020;var _0x50ddf9;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x5e21f7[_0x9bfb('0x51')]['id']}})[_0x9bfb('0x1c')](handleEntityNotFound(_0x3ccfa8,null))[_0x9bfb('0x1c')](function(_0x591ae2){if(_0x591ae2){_0x16b020=_0x591ae2;_0x3f6bfc['model']=_[_0x9bfb('0x37')](db[_0x9bfb('0x57')]['rawAttributes']);_0x3f6bfc[_0x9bfb('0x38')]=_[_0x9bfb('0x37')](_0x5e21f7[_0x9bfb('0x38')]);_0x3f6bfc['filters']=_[_0x9bfb('0x3a')](_0x3f6bfc[_0x9bfb('0x36')],_0x3f6bfc[_0x9bfb('0x38')]);_0x56e466[_0x9bfb('0x3c')]=_['intersection'](_0x3f6bfc[_0x9bfb('0x36')],qs['fields'](_0x5e21f7[_0x9bfb('0x38')][_0x9bfb('0x3b')]));_0x56e466[_0x9bfb('0x3c')]=_0x56e466[_0x9bfb('0x3c')][_0x9bfb('0x3d')]?_0x56e466[_0x9bfb('0x3c')]:_0x3f6bfc[_0x9bfb('0x36')];_0x56e466['order']=qs['sort'](_0x5e21f7['query'][_0x9bfb('0x41')]);_0x56e466[_0x9bfb('0x42')]=qs['filters'](_[_0x9bfb('0x58')](_0x5e21f7[_0x9bfb('0x38')],_0x3f6bfc[_0x9bfb('0x39')]));if(_0x5e21f7[_0x9bfb('0x38')][_0x9bfb('0x43')]){_0x56e466[_0x9bfb('0x42')]=_[_0x9bfb('0x44')](_0x56e466['where'],{'$or':_[_0x9bfb('0x45')](_0x56e466['attributes'],function(_0x5a816d){var _0x3c6c37={};_0x3c6c37[_0x5a816d]={'$like':'%'+_0x5e21f7['query'][_0x9bfb('0x43')]+'%'};return _0x3c6c37;})});}_0x56e466=_[_0x9bfb('0x44')]({},_0x56e466,_0x5e21f7[_0x9bfb('0x4a')]);return _0x16b020[_0x9bfb('0x5b')](_0x56e466);}})[_0x9bfb('0x1c')](function(_0x575d59){if(_0x575d59){_0x50ddf9=_0x575d59[_0x9bfb('0x3d')];if(!_0x5e21f7[_0x9bfb('0x38')][_0x9bfb('0x5c')]('nolimit')){_0x56e466[_0x9bfb('0x3f')]=qs[_0x9bfb('0x3f')](_0x5e21f7[_0x9bfb('0x38')]['limit']);_0x56e466[_0x9bfb('0x2b')]=qs['offset'](_0x5e21f7[_0x9bfb('0x38')][_0x9bfb('0x2b')]);}return _0x16b020[_0x9bfb('0x5b')](_0x56e466);}})[_0x9bfb('0x1c')](function(_0x229798){if(_0x229798){return _0x229798?{'count':_0x50ddf9,'rows':_0x229798}:null;}})[_0x9bfb('0x1c')](respondWithResult(_0x3ccfa8,null))[_0x9bfb('0x4f')](handleError(_0x3ccfa8,null));}; \ No newline at end of file +var _0xd94e=['sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','Dynamics365Configuration','includeAll','findAll','rows','show','params','include','find','body','destroy','findOne','Dynamics365Field','hasOwnProperty','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','catch','sendStatus','end','status','count','offset','json','reject','save','update','stack','name','send','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','limit','order'];(function(_0x1fd023,_0x15969d){var _0x4b928c=function(_0x57cb65){while(--_0x57cb65){_0x1fd023['push'](_0x1fd023['shift']());}};_0x4b928c(++_0x15969d);}(_0xd94e,0x17e));var _0xed94=function(_0x33f404,_0x344c7f){_0x33f404=_0x33f404-0x0;var _0x5c9437=_0xd94e[_0x33f404];return _0x5c9437;};'use strict';var pdf=require(_0xed94('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xed94('0x1'));var zipdir=require(_0xed94('0x2'));var jsonpatch=require(_0xed94('0x3'));var rp=require(_0xed94('0x4'));var moment=require('moment');var BPromise=require(_0xed94('0x5'));var Mustache=require(_0xed94('0x6'));var util=require(_0xed94('0x7'));var path=require(_0xed94('0x8'));var sox=require(_0xed94('0x9'));var csv=require(_0xed94('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xed94('0xb'));var squel=require(_0xed94('0xc'));var crypto=require('crypto');var jsforce=require(_0xed94('0xd'));var deskjs=require(_0xed94('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xed94('0xf'));var Redis=require(_0xed94('0x10'));var authService=require(_0xed94('0x11'));var qs=require(_0xed94('0x12'));var hardwareService=require(_0xed94('0x13'));var logger=require(_0xed94('0x14'))(_0xed94('0x15'));var utils=require(_0xed94('0x16'));var config=require(_0xed94('0x17'));var db=require(_0xed94('0x18'))['db'];var jayson=require(_0xed94('0x19'));var client=jayson['client'][_0xed94('0x1a')]({'port':0x232a});function checkPasswordPattern(_0xb5286a,_0x355b26,_0x32c6a8){if(_0x32c6a8){var _0x424a19=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x424a19[_0xed94('0x1b')](_0x355b26)){return _0xb5286a;}else{throw new Error(_0xed94('0x1c'));}}else{return _0xb5286a;}}function respondWithRpcPromise(_0x469a33,_0x12bfea,_0x3a5103,_0x2d3921){return new BPromise(function(_0x525a61,_0x1ea65d){var _0x3bf6f8=_0x2d3921||client;return _0x3bf6f8[_0xed94('0x1d')](_0x469a33,_0x3a5103)[_0xed94('0x1e')](function(_0xa3730b){logger[_0xed94('0x1f')]('Dynamics365Configuration,\x20%s,\x20%s',_0x12bfea,_0xed94('0x20'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x12bfea,_0xed94('0x20'),JSON[_0xed94('0x21')](_0xa3730b));if(_0xa3730b['error']){if(_0xa3730b[_0xed94('0x22')][_0xed94('0x23')]===0x1f4){logger[_0xed94('0x22')](_0xed94('0x24'),_0x12bfea,_0xa3730b[_0xed94('0x22')]['message']);return _0x1ea65d(_0xa3730b['error']['message']);}logger[_0xed94('0x22')](_0xed94('0x24'),_0x12bfea,_0xa3730b[_0xed94('0x22')][_0xed94('0x25')]);return _0x525a61(_0xa3730b[_0xed94('0x22')][_0xed94('0x25')]);}else{logger[_0xed94('0x1f')](_0xed94('0x24'),_0x12bfea,_0xed94('0x20'));_0x525a61(_0xa3730b['result']['message']);}})[_0xed94('0x26')](function(_0x51b79f){logger[_0xed94('0x22')]('Dynamics365Configuration,\x20%s,\x20%s',_0x12bfea,_0x51b79f);_0x1ea65d(_0x51b79f);});});}function respondWithStatusCode(_0x957db0,_0x2c5720){_0x2c5720=_0x2c5720||0xcc;return function(_0xb4f6f8){if(_0xb4f6f8){return _0x957db0[_0xed94('0x27')](_0x2c5720);}return _0x957db0['status'](_0x2c5720)[_0xed94('0x28')]();};}function respondWithResult(_0x2d9bad,_0x20f67c){_0x20f67c=_0x20f67c||0xc8;return function(_0x1d234f){if(_0x1d234f){return _0x2d9bad[_0xed94('0x29')](_0x20f67c)['json'](_0x1d234f);}};}function respondWithFilteredResult(_0x23b328,_0x2d8850){return function(_0x18dbf2){if(_0x18dbf2){var _0x504c7d=_0x18dbf2[_0xed94('0x2a')],_0xa99d4a=_0x2d8850[_0xed94('0x2b')],_0x5876a9=_0x2d8850['offset']+_0x2d8850['limit'],_0x454010;if(_0x5876a9>=_0x504c7d){_0x5876a9=_0x504c7d;_0x454010=0xc8;}else{_0x454010=0xce;}_0x23b328['status'](_0x454010);return _0x23b328['set']('Content-Range',_0xa99d4a+'-'+_0x5876a9+'/'+_0x504c7d)[_0xed94('0x2c')](_0x18dbf2);}return null;};}function patchUpdates(_0x567858){return function(_0x237836){try{jsonpatch['apply'](_0x237836,_0x567858,!![]);}catch(_0x57cef6){return BPromise[_0xed94('0x2d')](_0x57cef6);}return _0x237836[_0xed94('0x2e')]();};}function saveUpdates(_0x53dd6c,_0x3037a7){return function(_0x5330c1){if(_0x5330c1){return _0x5330c1[_0xed94('0x2f')](_0x53dd6c)['then'](function(_0x32b1d8){return _0x32b1d8;});}return null;};}function removeEntity(_0x4b7a19,_0x5ae834){return function(_0x376eed){if(_0x376eed){return _0x376eed['destroy']()[_0xed94('0x1e')](function(){_0x4b7a19[_0xed94('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33bf20,_0x1419f6){return function(_0xc061b5){if(!_0xc061b5){_0x33bf20[_0xed94('0x27')](0x194);}return _0xc061b5;};}function handleError(_0x49cafe,_0x2b1f44){_0x2b1f44=_0x2b1f44||0x1f4;return function(_0x217447){logger['error'](_0x217447[_0xed94('0x30')]);if(_0x217447['name']){delete _0x217447[_0xed94('0x31')];}_0x49cafe['status'](_0x2b1f44)[_0xed94('0x32')](_0x217447);};}exports['index']=function(_0xa1543a,_0x35a18c){var _0x3f939c={},_0x2ac0e1={},_0x25d03b={'count':0x0,'rows':[]};var _0x5557f9=db['Dynamics365Configuration'][_0xed94('0x33')];_0x2ac0e1[_0xed94('0x34')]=_['keys'](_0x5557f9);_0x2ac0e1['query']=_[_0xed94('0x35')](_0xa1543a[_0xed94('0x36')]);_0x2ac0e1[_0xed94('0x37')]=_['intersection'](_0x2ac0e1[_0xed94('0x34')],_0x2ac0e1[_0xed94('0x36')]);_0x3f939c[_0xed94('0x38')]=_[_0xed94('0x39')](_0x2ac0e1[_0xed94('0x34')],qs[_0xed94('0x3a')](_0xa1543a['query'][_0xed94('0x3a')]));_0x3f939c[_0xed94('0x38')]=_0x3f939c[_0xed94('0x38')][_0xed94('0x3b')]?_0x3f939c[_0xed94('0x38')]:_0x2ac0e1[_0xed94('0x34')];if(!_0xa1543a[_0xed94('0x36')]['hasOwnProperty'](_0xed94('0x3c'))){_0x3f939c[_0xed94('0x3d')]=qs[_0xed94('0x3d')](_0xa1543a[_0xed94('0x36')][_0xed94('0x3d')]);_0x3f939c[_0xed94('0x2b')]=qs[_0xed94('0x2b')](_0xa1543a[_0xed94('0x36')][_0xed94('0x2b')]);}_0x3f939c[_0xed94('0x3e')]=qs[_0xed94('0x3f')](_0xa1543a['query'][_0xed94('0x3f')]);_0x3f939c[_0xed94('0x40')]=qs[_0xed94('0x37')](_[_0xed94('0x41')](_0xa1543a[_0xed94('0x36')],_0x2ac0e1[_0xed94('0x37')]));if(_0xa1543a[_0xed94('0x36')][_0xed94('0x42')]){_0x3f939c[_0xed94('0x40')]=_[_0xed94('0x43')](_0x3f939c[_0xed94('0x40')],{'$or':_[_0xed94('0x44')](_0x5557f9,function(_0x4c778b){if(_0x4c778b[_0xed94('0x45')][_0xed94('0x46')]!==_0xed94('0x47')){var _0x4bc9b9={};_0x4bc9b9[_0x4c778b[_0xed94('0x48')]]={'$like':'%'+_0xa1543a[_0xed94('0x36')][_0xed94('0x42')]+'%'};return _0x4bc9b9;}})});}_0x3f939c=_[_0xed94('0x43')]({},_0x3f939c,_0xa1543a[_0xed94('0x49')]);var _0x1b2a99={'where':_0x3f939c[_0xed94('0x40')]};return db[_0xed94('0x4a')]['count'](_0x1b2a99)['then'](function(_0x555380){_0x25d03b[_0xed94('0x2a')]=_0x555380;if(_0xa1543a[_0xed94('0x36')][_0xed94('0x4b')]){_0x3f939c['include']=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xed94('0x4c')](_0x3f939c);})[_0xed94('0x1e')](function(_0x59c352){_0x25d03b[_0xed94('0x4d')]=_0x59c352;return _0x25d03b;})[_0xed94('0x1e')](respondWithFilteredResult(_0x35a18c,_0x3f939c))[_0xed94('0x26')](handleError(_0x35a18c,null));};exports[_0xed94('0x4e')]=function(_0x2d0770,_0x5e6660){var _0x2ea7d5={'raw':![],'where':{'id':_0x2d0770[_0xed94('0x4f')]['id']}},_0x48e3c5={};_0x48e3c5['model']=_['keys'](db[_0xed94('0x4a')][_0xed94('0x33')]);_0x48e3c5[_0xed94('0x36')]=_[_0xed94('0x35')](_0x2d0770[_0xed94('0x36')]);_0x48e3c5[_0xed94('0x37')]=_[_0xed94('0x39')](_0x48e3c5['model'],_0x48e3c5[_0xed94('0x36')]);_0x2ea7d5[_0xed94('0x38')]=_['intersection'](_0x48e3c5[_0xed94('0x34')],qs[_0xed94('0x3a')](_0x2d0770[_0xed94('0x36')][_0xed94('0x3a')]));_0x2ea7d5[_0xed94('0x38')]=_0x2ea7d5['attributes'][_0xed94('0x3b')]?_0x2ea7d5[_0xed94('0x38')]:_0x48e3c5[_0xed94('0x34')];if(_0x2d0770[_0xed94('0x36')][_0xed94('0x4b')]){_0x2ea7d5[_0xed94('0x50')]=[{'all':!![]}];}_0x2ea7d5=_[_0xed94('0x43')]({},_0x2ea7d5,_0x2d0770[_0xed94('0x49')]);return db[_0xed94('0x4a')][_0xed94('0x51')](_0x2ea7d5)[_0xed94('0x1e')](handleEntityNotFound(_0x5e6660,null))['then'](respondWithResult(_0x5e6660,null))[_0xed94('0x26')](handleError(_0x5e6660,null));};exports['create']=function(_0x8191fd,_0x5c2ecf){return db[_0xed94('0x4a')]['create'](_0x8191fd[_0xed94('0x52')],{})[_0xed94('0x1e')](respondWithResult(_0x5c2ecf,0xc9))[_0xed94('0x26')](handleError(_0x5c2ecf,null));};exports[_0xed94('0x2f')]=function(_0x5bad3f,_0x4ed66e){if(_0x5bad3f[_0xed94('0x52')]['id']){delete _0x5bad3f[_0xed94('0x52')]['id'];}return db[_0xed94('0x4a')]['find']({'where':{'id':_0x5bad3f[_0xed94('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4ed66e,null))[_0xed94('0x1e')](saveUpdates(_0x5bad3f['body'],null))['then'](respondWithResult(_0x4ed66e,null))[_0xed94('0x26')](handleError(_0x4ed66e,null));};exports[_0xed94('0x53')]=function(_0x13d55b,_0x5c2fce){return db['Dynamics365Configuration'][_0xed94('0x51')]({'where':{'id':_0x13d55b[_0xed94('0x4f')]['id']}})[_0xed94('0x1e')](handleEntityNotFound(_0x5c2fce,null))[_0xed94('0x1e')](removeEntity(_0x5c2fce,null))[_0xed94('0x26')](handleError(_0x5c2fce,null));};exports['getFields']=function(_0x5e0fc,_0x45a12a,_0x1b19e7){var _0x48cb6d={};var _0x2033ec={};var _0x27dfd4;var _0x1d2167;return db[_0xed94('0x4a')][_0xed94('0x54')]({'where':{'id':_0x5e0fc[_0xed94('0x4f')]['id']}})[_0xed94('0x1e')](handleEntityNotFound(_0x45a12a,null))[_0xed94('0x1e')](function(_0x2485c4){if(_0x2485c4){_0x27dfd4=_0x2485c4;_0x2033ec[_0xed94('0x34')]=_['keys'](db[_0xed94('0x55')][_0xed94('0x33')]);_0x2033ec['query']=_['keys'](_0x5e0fc[_0xed94('0x36')]);_0x2033ec[_0xed94('0x37')]=_[_0xed94('0x39')](_0x2033ec[_0xed94('0x34')],_0x2033ec[_0xed94('0x36')]);_0x48cb6d[_0xed94('0x38')]=_['intersection'](_0x2033ec['model'],qs['fields'](_0x5e0fc['query'][_0xed94('0x3a')]));_0x48cb6d['attributes']=_0x48cb6d['attributes'][_0xed94('0x3b')]?_0x48cb6d[_0xed94('0x38')]:_0x2033ec['model'];_0x48cb6d[_0xed94('0x3e')]=qs[_0xed94('0x3f')](_0x5e0fc['query'][_0xed94('0x3f')]);_0x48cb6d[_0xed94('0x40')]=qs['filters'](_[_0xed94('0x41')](_0x5e0fc[_0xed94('0x36')],_0x2033ec['filters']));if(_0x5e0fc[_0xed94('0x36')][_0xed94('0x42')]){_0x48cb6d['where']=_[_0xed94('0x43')](_0x48cb6d[_0xed94('0x40')],{'$or':_[_0xed94('0x44')](_0x48cb6d[_0xed94('0x38')],function(_0x34d199){var _0x2f7aa4={};_0x2f7aa4[_0x34d199]={'$like':'%'+_0x5e0fc[_0xed94('0x36')][_0xed94('0x42')]+'%'};return _0x2f7aa4;})});}_0x48cb6d=_['merge']({},_0x48cb6d,_0x5e0fc[_0xed94('0x49')]);return _0x27dfd4['getFields'](_0x48cb6d);}})['then'](function(_0x1052a2){if(_0x1052a2){_0x1d2167=_0x1052a2[_0xed94('0x3b')];if(!_0x5e0fc[_0xed94('0x36')][_0xed94('0x56')]('nolimit')){_0x48cb6d['limit']=qs[_0xed94('0x3d')](_0x5e0fc['query']['limit']);_0x48cb6d[_0xed94('0x2b')]=qs['offset'](_0x5e0fc[_0xed94('0x36')][_0xed94('0x2b')]);}return _0x27dfd4['getFields'](_0x48cb6d);}})['then'](function(_0x45dc69){if(_0x45dc69){return _0x45dc69?{'count':_0x1d2167,'rows':_0x45dc69}:null;}})['then'](respondWithResult(_0x45a12a,null))[_0xed94('0x26')](handleError(_0x45a12a,null));};exports[_0xed94('0x57')]=function(_0x3cd002,_0x58b78b,_0x521cad){var _0x10aa6a={};var _0x3df1a1={};var _0x1f3949;var _0x5902a9;return db['Dynamics365Configuration'][_0xed94('0x54')]({'where':{'id':_0x3cd002[_0xed94('0x4f')]['id']}})[_0xed94('0x1e')](handleEntityNotFound(_0x58b78b,null))[_0xed94('0x1e')](function(_0x45998e){if(_0x45998e){_0x1f3949=_0x45998e;_0x3df1a1['model']=_[_0xed94('0x35')](db[_0xed94('0x55')][_0xed94('0x33')]);_0x3df1a1['query']=_[_0xed94('0x35')](_0x3cd002['query']);_0x3df1a1[_0xed94('0x37')]=_['intersection'](_0x3df1a1['model'],_0x3df1a1[_0xed94('0x36')]);_0x10aa6a['attributes']=_[_0xed94('0x39')](_0x3df1a1[_0xed94('0x34')],qs[_0xed94('0x3a')](_0x3cd002[_0xed94('0x36')][_0xed94('0x3a')]));_0x10aa6a[_0xed94('0x38')]=_0x10aa6a[_0xed94('0x38')][_0xed94('0x3b')]?_0x10aa6a[_0xed94('0x38')]:_0x3df1a1[_0xed94('0x34')];_0x10aa6a[_0xed94('0x3e')]=qs['sort'](_0x3cd002[_0xed94('0x36')][_0xed94('0x3f')]);_0x10aa6a[_0xed94('0x40')]=qs[_0xed94('0x37')](_[_0xed94('0x41')](_0x3cd002['query'],_0x3df1a1[_0xed94('0x37')]));if(_0x3cd002['query'][_0xed94('0x42')]){_0x10aa6a['where']=_[_0xed94('0x43')](_0x10aa6a['where'],{'$or':_[_0xed94('0x44')](_0x10aa6a['attributes'],function(_0x268d2e){var _0x6f99ce={};_0x6f99ce[_0x268d2e]={'$like':'%'+_0x3cd002[_0xed94('0x36')][_0xed94('0x42')]+'%'};return _0x6f99ce;})});}_0x10aa6a=_[_0xed94('0x43')]({},_0x10aa6a,_0x3cd002['options']);return _0x1f3949[_0xed94('0x57')](_0x10aa6a);}})[_0xed94('0x1e')](function(_0x2dffcf){if(_0x2dffcf){_0x5902a9=_0x2dffcf['length'];if(!_0x3cd002['query'][_0xed94('0x56')]('nolimit')){_0x10aa6a[_0xed94('0x3d')]=qs['limit'](_0x3cd002[_0xed94('0x36')]['limit']);_0x10aa6a[_0xed94('0x2b')]=qs['offset'](_0x3cd002[_0xed94('0x36')][_0xed94('0x2b')]);}return _0x1f3949['getSubjects'](_0x10aa6a);}})['then'](function(_0x1f9cd7){if(_0x1f9cd7){return _0x1f9cd7?{'count':_0x5902a9,'rows':_0x1f9cd7}:null;}})[_0xed94('0x1e')](respondWithResult(_0x58b78b,null))['catch'](handleError(_0x58b78b,null));};exports[_0xed94('0x58')]=function(_0x2dafd0,_0x3cd6b5,_0x117ad7){var _0x5e9c25={};var _0x547783={};var _0x5f023f;var _0x3e2b86;return db[_0xed94('0x4a')][_0xed94('0x54')]({'where':{'id':_0x2dafd0[_0xed94('0x4f')]['id']}})[_0xed94('0x1e')](handleEntityNotFound(_0x3cd6b5,null))['then'](function(_0x131659){if(_0x131659){_0x5f023f=_0x131659;_0x547783['model']=_['keys'](db[_0xed94('0x55')][_0xed94('0x33')]);_0x547783[_0xed94('0x36')]=_['keys'](_0x2dafd0['query']);_0x547783[_0xed94('0x37')]=_['intersection'](_0x547783[_0xed94('0x34')],_0x547783[_0xed94('0x36')]);_0x5e9c25['attributes']=_[_0xed94('0x39')](_0x547783[_0xed94('0x34')],qs[_0xed94('0x3a')](_0x2dafd0['query'][_0xed94('0x3a')]));_0x5e9c25[_0xed94('0x38')]=_0x5e9c25['attributes'][_0xed94('0x3b')]?_0x5e9c25[_0xed94('0x38')]:_0x547783[_0xed94('0x34')];_0x5e9c25['order']=qs['sort'](_0x2dafd0['query'][_0xed94('0x3f')]);_0x5e9c25[_0xed94('0x40')]=qs[_0xed94('0x37')](_['pick'](_0x2dafd0[_0xed94('0x36')],_0x547783[_0xed94('0x37')]));if(_0x2dafd0[_0xed94('0x36')]['filter']){_0x5e9c25[_0xed94('0x40')]=_[_0xed94('0x43')](_0x5e9c25[_0xed94('0x40')],{'$or':_['map'](_0x5e9c25[_0xed94('0x38')],function(_0x3a21f2){var _0xaa2f67={};_0xaa2f67[_0x3a21f2]={'$like':'%'+_0x2dafd0[_0xed94('0x36')]['filter']+'%'};return _0xaa2f67;})});}_0x5e9c25=_[_0xed94('0x43')]({},_0x5e9c25,_0x2dafd0['options']);return _0x5f023f[_0xed94('0x58')](_0x5e9c25);}})[_0xed94('0x1e')](function(_0x230d0d){if(_0x230d0d){_0x3e2b86=_0x230d0d['length'];if(!_0x2dafd0['query'][_0xed94('0x56')](_0xed94('0x3c'))){_0x5e9c25[_0xed94('0x3d')]=qs[_0xed94('0x3d')](_0x2dafd0[_0xed94('0x36')][_0xed94('0x3d')]);_0x5e9c25[_0xed94('0x2b')]=qs[_0xed94('0x2b')](_0x2dafd0[_0xed94('0x36')]['offset']);}return _0x5f023f[_0xed94('0x58')](_0x5e9c25);}})['then'](function(_0x48d4c6){if(_0x48d4c6){return _0x48d4c6?{'count':_0x3e2b86,'rows':_0x48d4c6}:null;}})[_0xed94('0x1e')](respondWithResult(_0x3cd6b5,null))[_0xed94('0x26')](handleError(_0x3cd6b5,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 1bdaacd..6bac004 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 _0xf470=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations'];(function(_0x5bdcce,_0x251b9d){var _0x176a41=function(_0xe7b6c1){while(--_0xe7b6c1){_0x5bdcce['push'](_0x5bdcce['shift']());}};_0x176a41(++_0x251b9d);}(_0xf470,0x12b));var _0x0f47=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xf470[_0x44bcb0];return _0xfaf881;};'use strict';var _=require(_0x0f47('0x0'));var util=require(_0x0f47('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0f47('0x2'));var BPromise=require(_0x0f47('0x3'));var rp=require(_0x0f47('0x4'));var fs=require('fs');var path=require(_0x0f47('0x5'));var rimraf=require(_0x0f47('0x6'));var config=require(_0x0f47('0x7'));var attributes=require(_0x0f47('0x8'));module[_0x0f47('0x9')]=function(_0x169dc5,_0x550350){return _0x169dc5[_0x0f47('0xa')](_0x0f47('0xb'),attributes,{'tableName':_0x0f47('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x285a=['Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','moment','./intDynamics365Configuration.attributes','exports'];(function(_0x31ecbe,_0x5a424f){var _0x62cb0d=function(_0x59cb16){while(--_0x59cb16){_0x31ecbe['push'](_0x31ecbe['shift']());}};_0x62cb0d(++_0x5a424f);}(_0x285a,0x10a));var _0xa285=function(_0x47e96d,_0x5ad1ae){_0x47e96d=_0x47e96d-0x0;var _0x23810e=_0x285a[_0x47e96d];return _0x23810e;};'use strict';var _=require(_0xa285('0x0'));var util=require(_0xa285('0x1'));var logger=require(_0xa285('0x2'))('api');var moment=require(_0xa285('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa285('0x4'));module[_0xa285('0x5')]=function(_0x1577a2,_0x2de8bf){return _0x1577a2['define'](_0xa285('0x6'),attributes,{'tableName':_0xa285('0x7'),'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 1efadfa..eada273 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 _0xea98=['jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x31f5cd,_0x1a49ff){var _0x169279=function(_0x20c72d){while(--_0x20c72d){_0x31f5cd['push'](_0x31f5cd['shift']());}};_0x169279(++_0x1a49ff);}(_0xea98,0x1c6));var _0x8ea9=function(_0x4f7b5e,_0x555f6f){_0x4f7b5e=_0x4f7b5e-0x0;var _0x4bac7b=_0xea98[_0x4f7b5e];return _0x4bac7b;};'use strict';var _=require('lodash');var util=require(_0x8ea9('0x0'));var moment=require(_0x8ea9('0x1'));var BPromise=require(_0x8ea9('0x2'));var rs=require(_0x8ea9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ea9('0x4'))['db'];var utils=require(_0x8ea9('0x5'));var logger=require(_0x8ea9('0x6'))(_0x8ea9('0x7'));var config=require('../../config/environment');var jayson=require(_0x8ea9('0x8'));var client=jayson[_0x8ea9('0x9')][_0x8ea9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x215d23,_0x58c79e,_0x30e43d){return new BPromise(function(_0x1f2fe1,_0x2323e4){return client[_0x8ea9('0xb')](_0x215d23,_0x30e43d)[_0x8ea9('0xc')](function(_0x26eda4){logger[_0x8ea9('0xd')](_0x8ea9('0xe'),_0x58c79e,_0x8ea9('0xf'));logger['debug'](_0x8ea9('0x10'),_0x58c79e,_0x8ea9('0xf'),JSON[_0x8ea9('0x11')](_0x26eda4));if(_0x26eda4[_0x8ea9('0x12')]){if(_0x26eda4[_0x8ea9('0x12')]['code']===0x1f4){logger[_0x8ea9('0x12')](_0x8ea9('0xe'),_0x58c79e,_0x26eda4[_0x8ea9('0x12')][_0x8ea9('0x13')]);return _0x2323e4(_0x26eda4[_0x8ea9('0x12')][_0x8ea9('0x13')]);}logger[_0x8ea9('0x12')](_0x8ea9('0xe'),_0x58c79e,_0x26eda4[_0x8ea9('0x12')][_0x8ea9('0x13')]);return _0x1f2fe1(_0x26eda4['error'][_0x8ea9('0x13')]);}else{logger[_0x8ea9('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x58c79e,'request\x20sent');_0x1f2fe1(_0x26eda4[_0x8ea9('0x14')][_0x8ea9('0x13')]);}})[_0x8ea9('0x15')](function(_0x564aa0){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x58c79e,_0x564aa0);_0x2323e4(_0x564aa0);});});} \ No newline at end of file +var _0x8c2a=['Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','request\x20sent','debug'];(function(_0x5bc323,_0x1813bc){var _0x109148=function(_0x39047c){while(--_0x39047c){_0x5bc323['push'](_0x5bc323['shift']());}};_0x109148(++_0x1813bc);}(_0x8c2a,0x1aa));var _0xa8c2=function(_0x767b78,_0x16270b){_0x767b78=_0x767b78-0x0;var _0x5daeed=_0x8c2a[_0x767b78];return _0x5daeed;};'use strict';var _=require(_0xa8c2('0x0'));var util=require('util');var moment=require(_0xa8c2('0x1'));var BPromise=require(_0xa8c2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa8c2('0x3'));var db=require(_0xa8c2('0x4'))['db'];var utils=require(_0xa8c2('0x5'));var logger=require(_0xa8c2('0x6'))(_0xa8c2('0x7'));var config=require(_0xa8c2('0x8'));var jayson=require(_0xa8c2('0x9'));var client=jayson[_0xa8c2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5042f5,_0xa89752,_0x1a22c1){return new BPromise(function(_0x4c189,_0x2aba4d){return client['request'](_0x5042f5,_0x1a22c1)['then'](function(_0x3ffb2d){logger[_0xa8c2('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0xa89752,_0xa8c2('0xc'));logger[_0xa8c2('0xd')](_0xa8c2('0xe'),_0xa89752,_0xa8c2('0xc'),JSON[_0xa8c2('0xf')](_0x3ffb2d));if(_0x3ffb2d['error']){if(_0x3ffb2d[_0xa8c2('0x10')][_0xa8c2('0x11')]===0x1f4){logger[_0xa8c2('0x10')](_0xa8c2('0x12'),_0xa89752,_0x3ffb2d[_0xa8c2('0x10')]['message']);return _0x2aba4d(_0x3ffb2d[_0xa8c2('0x10')]['message']);}logger[_0xa8c2('0x10')](_0xa8c2('0x12'),_0xa89752,_0x3ffb2d['error'][_0xa8c2('0x13')]);return _0x4c189(_0x3ffb2d['error'][_0xa8c2('0x13')]);}else{logger[_0xa8c2('0xb')](_0xa8c2('0x12'),_0xa89752,_0xa8c2('0xc'));_0x4c189(_0x3ffb2d[_0xa8c2('0x14')]['message']);}})[_0xa8c2('0x15')](function(_0x1f15e2){logger['error'](_0xa8c2('0x12'),_0xa89752,_0x1f15e2);_0x2aba4d(_0x1f15e2);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index a05fc4a..298e856 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 _0x6874=['create','/:id','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','./intDynamics365Field.controller','get','isAuthenticated','show'];(function(_0x35b682,_0x4d5bb0){var _0x535df2=function(_0x53af7e){while(--_0x53af7e){_0x35b682['push'](_0x35b682['shift']());}};_0x535df2(++_0x4d5bb0);}(_0x6874,0x18c));var _0x4687=function(_0x4cd507,_0x230d35){_0x4cd507=_0x4cd507-0x0;var _0xa2a55e=_0x6874[_0x4cd507];return _0xa2a55e;};'use strict';var multer=require('multer');var util=require(_0x4687('0x0'));var path=require(_0x4687('0x1'));var timeout=require(_0x4687('0x2'));var express=require('express');var router=express[_0x4687('0x3')]();var auth=require(_0x4687('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4687('0x5'));router[_0x4687('0x6')]('/',auth[_0x4687('0x7')](),controller['index']);router[_0x4687('0x6')]('/:id',auth[_0x4687('0x7')](),controller[_0x4687('0x8')]);router['post']('/',auth[_0x4687('0x7')](),controller[_0x4687('0x9')]);router['put'](_0x4687('0xa'),auth['isAuthenticated'](),controller[_0x4687('0xb')]);router[_0x4687('0xc')](_0x4687('0xa'),auth[_0x4687('0x7')](),controller[_0x4687('0xd')]);module[_0x4687('0xe')]=router; \ No newline at end of file +var _0xec2e=['put','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','get','/:id','show','post','create'];(function(_0x582284,_0x1b9496){var _0x5d1921=function(_0x4d06f1){while(--_0x4d06f1){_0x582284['push'](_0x582284['shift']());}};_0x5d1921(++_0x1b9496);}(_0xec2e,0x1a1));var _0xeec2=function(_0x27010b,_0x1f735c){_0x27010b=_0x27010b-0x0;var _0x39abe1=_0xec2e[_0x27010b];return _0x39abe1;};'use strict';var multer=require('multer');var util=require(_0xeec2('0x0'));var path=require('path');var timeout=require(_0xeec2('0x1'));var express=require(_0xeec2('0x2'));var router=express[_0xeec2('0x3')]();var auth=require(_0xeec2('0x4'));var interaction=require(_0xeec2('0x5'));var config=require(_0xeec2('0x6'));var controller=require(_0xeec2('0x7'));router['get']('/',auth[_0xeec2('0x8')](),controller[_0xeec2('0x9')]);router[_0xeec2('0xa')](_0xeec2('0xb'),auth[_0xeec2('0x8')](),controller[_0xeec2('0xc')]);router[_0xeec2('0xd')]('/',auth['isAuthenticated'](),controller[_0xeec2('0xe')]);router[_0xeec2('0xf')](_0xeec2('0xb'),auth[_0xeec2('0x8')](),controller['update']);router[_0xeec2('0x10')](_0xeec2('0xb'),auth[_0xeec2('0x8')](),controller['destroy']);module[_0xeec2('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 081f291..7f4da36 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 _0xd8b0=['keyValue','string','STRING','variable','BOOLEAN','sequelize','exports','customVariable'];(function(_0x3b0ead,_0x48db0a){var _0x32a67b=function(_0x4d5e75){while(--_0x4d5e75){_0x3b0ead['push'](_0x3b0ead['shift']());}};_0x32a67b(++_0x48db0a);}(_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')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x0d8b('0x2'),_0x0d8b('0x3')),'defaultValue':_0x0d8b('0x4')},'content':{'type':Sequelize[_0x0d8b('0x5')]},'key':{'type':Sequelize[_0x0d8b('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x0d8b('0x6'),_0x0d8b('0x2'))},'keyContent':{'type':Sequelize[_0x0d8b('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0d8b('0x5')]},'customField':{'type':Sequelize[_0x0d8b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa571=['exports','ENUM','string','customVariable','keyValue','STRING','variable','sequelize'];(function(_0x4792d4,_0xc22c15){var _0xd5deaf=function(_0x24464e){while(--_0x24464e){_0x4792d4['push'](_0x4792d4['shift']());}};_0xd5deaf(++_0xc22c15);}(_0xa571,0x107));var _0x1a57=function(_0x519151,_0x4f2b94){_0x519151=_0x519151-0x0;var _0x438307=_0xa571[_0x519151];return _0x438307;};'use strict';var Sequelize=require(_0x1a57('0x0'));module[_0x1a57('0x1')]={'type':{'type':Sequelize[_0x1a57('0x2')](_0x1a57('0x3'),'variable',_0x1a57('0x4'),_0x1a57('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1a57('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x1a57('0x3'),_0x1a57('0x7'),_0x1a57('0x4'))},'keyContent':{'type':Sequelize[_0x1a57('0x6')]},'idField':{'type':Sequelize[_0x1a57('0x6')]},'nameField':{'type':Sequelize[_0x1a57('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1a57('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 5b30c13..88c2433 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 _0xd8b0=['stack','name','index','rawAttributes','keys','filters','model','attributes','intersection','length','query','hasOwnProperty','nolimit','sort','pick','where','merge','map','type','key','VIRTUAL','options','Dynamics365Field','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','destroy','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then'];(function(_0x4255cf,_0xaeb97a){var _0x263a47=function(_0x12c136){while(--_0x12c136){_0x4255cf['push'](_0x4255cf['shift']());}};_0x263a47(++_0xaeb97a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var authService=require(_0x0d8b('0xf'));var qs=require(_0x0d8b('0x10'));var hardwareService=require(_0x0d8b('0x11'));var logger=require(_0x0d8b('0x12'))('api');var utils=require(_0x0d8b('0x13'));var config=require('../../config/environment');var db=require(_0x0d8b('0x14'))['db'];function respondWithStatusCode(_0xc574a3,_0x340cc4){_0x340cc4=_0x340cc4||0xcc;return function(_0x92cdd8){if(_0x92cdd8){return _0xc574a3[_0x0d8b('0x15')](_0x340cc4);}return _0xc574a3[_0x0d8b('0x16')](_0x340cc4)[_0x0d8b('0x17')]();};}function respondWithResult(_0x31a8cc,_0x1d4bbc){_0x1d4bbc=_0x1d4bbc||0xc8;return function(_0x2ce75e){if(_0x2ce75e){return _0x31a8cc[_0x0d8b('0x16')](_0x1d4bbc)[_0x0d8b('0x18')](_0x2ce75e);}};}function respondWithFilteredResult(_0x1567ce,_0x2d4e1c){return function(_0x4f6f21){if(_0x4f6f21){var _0x23eb7b=_0x4f6f21[_0x0d8b('0x19')],_0xa86349=_0x2d4e1c['offset'],_0x17f7df=_0x2d4e1c[_0x0d8b('0x1a')]+_0x2d4e1c[_0x0d8b('0x1b')],_0xe2e167;if(_0x17f7df>=_0x23eb7b){_0x17f7df=_0x23eb7b;_0xe2e167=0xc8;}else{_0xe2e167=0xce;}_0x1567ce[_0x0d8b('0x16')](_0xe2e167);return _0x1567ce[_0x0d8b('0x1c')](_0x0d8b('0x1d'),_0xa86349+'-'+_0x17f7df+'/'+_0x23eb7b)[_0x0d8b('0x18')](_0x4f6f21);}return null;};}function patchUpdates(_0x264b39){return function(_0xa3612a){try{jsonpatch['apply'](_0xa3612a,_0x264b39,!![]);}catch(_0x27512e){return BPromise[_0x0d8b('0x1e')](_0x27512e);}return _0xa3612a[_0x0d8b('0x1f')]();};}function saveUpdates(_0x143372,_0x24e8ed){return function(_0x5b709c){if(_0x5b709c){return _0x5b709c[_0x0d8b('0x20')](_0x143372)[_0x0d8b('0x21')](function(_0x50ec1e){return _0x50ec1e;});}return null;};}function removeEntity(_0x4f0a1a,_0x33fb87){return function(_0x54a9a7){if(_0x54a9a7){return _0x54a9a7['destroy']()['then'](function(){_0x4f0a1a[_0x0d8b('0x16')](0xcc)[_0x0d8b('0x17')]();});}};}function handleEntityNotFound(_0x214778,_0x38efc8){return function(_0x221071){if(!_0x221071){_0x214778[_0x0d8b('0x15')](0x194);}return _0x221071;};}function handleError(_0x30980c,_0x4562cb){_0x4562cb=_0x4562cb||0x1f4;return function(_0x27b695){logger['error'](_0x27b695[_0x0d8b('0x22')]);if(_0x27b695[_0x0d8b('0x23')]){delete _0x27b695['name'];}_0x30980c[_0x0d8b('0x16')](_0x4562cb)['send'](_0x27b695);};}exports[_0x0d8b('0x24')]=function(_0x234bdd,_0xa2af02){var _0x4fe6f9={},_0x59a905={},_0x28f639={'count':0x0,'rows':[]};var _0x3ef745=db['Dynamics365Field'][_0x0d8b('0x25')];_0x59a905['model']=_[_0x0d8b('0x26')](_0x3ef745);_0x59a905['query']=_[_0x0d8b('0x26')](_0x234bdd['query']);_0x59a905[_0x0d8b('0x27')]=_['intersection'](_0x59a905[_0x0d8b('0x28')],_0x59a905['query']);_0x4fe6f9[_0x0d8b('0x29')]=_[_0x0d8b('0x2a')](_0x59a905[_0x0d8b('0x28')],qs['fields'](_0x234bdd['query']['fields']));_0x4fe6f9[_0x0d8b('0x29')]=_0x4fe6f9['attributes'][_0x0d8b('0x2b')]?_0x4fe6f9['attributes']:_0x59a905['model'];if(!_0x234bdd[_0x0d8b('0x2c')][_0x0d8b('0x2d')](_0x0d8b('0x2e'))){_0x4fe6f9[_0x0d8b('0x1b')]=qs[_0x0d8b('0x1b')](_0x234bdd[_0x0d8b('0x2c')][_0x0d8b('0x1b')]);_0x4fe6f9[_0x0d8b('0x1a')]=qs['offset'](_0x234bdd[_0x0d8b('0x2c')][_0x0d8b('0x1a')]);}_0x4fe6f9['order']=qs[_0x0d8b('0x2f')](_0x234bdd[_0x0d8b('0x2c')][_0x0d8b('0x2f')]);_0x4fe6f9['where']=qs[_0x0d8b('0x27')](_[_0x0d8b('0x30')](_0x234bdd[_0x0d8b('0x2c')],_0x59a905[_0x0d8b('0x27')]));if(_0x234bdd[_0x0d8b('0x2c')]['filter']){_0x4fe6f9[_0x0d8b('0x31')]=_[_0x0d8b('0x32')](_0x4fe6f9['where'],{'$or':_[_0x0d8b('0x33')](_0x3ef745,function(_0x3cc3ee){if(_0x3cc3ee[_0x0d8b('0x34')][_0x0d8b('0x35')]!==_0x0d8b('0x36')){var _0x519088={};_0x519088[_0x3cc3ee['field']]={'$like':'%'+_0x234bdd[_0x0d8b('0x2c')]['filter']+'%'};return _0x519088;}})});}_0x4fe6f9=_['merge']({},_0x4fe6f9,_0x234bdd[_0x0d8b('0x37')]);var _0x2e279c={'where':_0x4fe6f9[_0x0d8b('0x31')]};return db[_0x0d8b('0x38')][_0x0d8b('0x19')](_0x2e279c)[_0x0d8b('0x21')](function(_0x579324){_0x28f639[_0x0d8b('0x19')]=_0x579324;if(_0x234bdd[_0x0d8b('0x2c')][_0x0d8b('0x39')]){_0x4fe6f9[_0x0d8b('0x3a')]=[{'all':!![]}];}return db[_0x0d8b('0x38')][_0x0d8b('0x3b')](_0x4fe6f9);})[_0x0d8b('0x21')](function(_0x5c980b){_0x28f639[_0x0d8b('0x3c')]=_0x5c980b;return _0x28f639;})[_0x0d8b('0x21')](respondWithFilteredResult(_0xa2af02,_0x4fe6f9))[_0x0d8b('0x3d')](handleError(_0xa2af02,null));};exports[_0x0d8b('0x3e')]=function(_0x59d3ad,_0xe0bf42){var _0x4b4bde={'raw':!![],'where':{'id':_0x59d3ad[_0x0d8b('0x3f')]['id']}},_0x37b26c={};_0x37b26c[_0x0d8b('0x28')]=_[_0x0d8b('0x26')](db[_0x0d8b('0x38')][_0x0d8b('0x25')]);_0x37b26c[_0x0d8b('0x2c')]=_[_0x0d8b('0x26')](_0x59d3ad[_0x0d8b('0x2c')]);_0x37b26c[_0x0d8b('0x27')]=_['intersection'](_0x37b26c['model'],_0x37b26c['query']);_0x4b4bde['attributes']=_['intersection'](_0x37b26c[_0x0d8b('0x28')],qs[_0x0d8b('0x40')](_0x59d3ad[_0x0d8b('0x2c')]['fields']));_0x4b4bde['attributes']=_0x4b4bde[_0x0d8b('0x29')][_0x0d8b('0x2b')]?_0x4b4bde[_0x0d8b('0x29')]:_0x37b26c['model'];if(_0x59d3ad[_0x0d8b('0x2c')][_0x0d8b('0x39')]){_0x4b4bde['include']=[{'all':!![]}];}_0x4b4bde=_['merge']({},_0x4b4bde,_0x59d3ad[_0x0d8b('0x37')]);return db['Dynamics365Field'][_0x0d8b('0x41')](_0x4b4bde)['then'](handleEntityNotFound(_0xe0bf42,null))['then'](respondWithResult(_0xe0bf42,null))[_0x0d8b('0x3d')](handleError(_0xe0bf42,null));};exports[_0x0d8b('0x42')]=function(_0x5a75c7,_0x5ebe8a){return db['Dynamics365Field']['create'](_0x5a75c7[_0x0d8b('0x43')],{})[_0x0d8b('0x21')](respondWithResult(_0x5ebe8a,0xc9))[_0x0d8b('0x3d')](handleError(_0x5ebe8a,null));};exports['update']=function(_0xb0910e,_0x1afe8a){if(_0xb0910e[_0x0d8b('0x43')]['id']){delete _0xb0910e[_0x0d8b('0x43')]['id'];}return db[_0x0d8b('0x38')][_0x0d8b('0x41')]({'where':{'id':_0xb0910e[_0x0d8b('0x3f')]['id']}})[_0x0d8b('0x21')](handleEntityNotFound(_0x1afe8a,null))[_0x0d8b('0x21')](saveUpdates(_0xb0910e[_0x0d8b('0x43')],null))[_0x0d8b('0x21')](respondWithResult(_0x1afe8a,null))[_0x0d8b('0x3d')](handleError(_0x1afe8a,null));};exports[_0x0d8b('0x44')]=function(_0x3e569b,_0x570af8){return db[_0x0d8b('0x38')][_0x0d8b('0x41')]({'where':{'id':_0x3e569b[_0x0d8b('0x3f')]['id']}})[_0x0d8b('0x21')](handleEntityNotFound(_0x570af8,null))['then'](removeEntity(_0x570af8,null))[_0x0d8b('0x3d')](handleError(_0x570af8,null));}; \ No newline at end of file +var _0xcb91=['options','create','body','find','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','count','offset','limit','status','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','Dynamics365Field','rawAttributes','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','map','type','key','VIRTUAL','filter','includeAll','include','rows','catch','show','fields'];(function(_0x53edf7,_0x40e285){var _0x383491=function(_0x2b0e51){while(--_0x2b0e51){_0x53edf7['push'](_0x53edf7['shift']());}};_0x383491(++_0x40e285);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x695b76,_0x551526){_0x695b76=_0x695b76-0x0;var _0x1dc21f=_0xcb91[_0x695b76];return _0x1dc21f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1cb9('0x0'));var zipdir=require(_0x1cb9('0x1'));var jsonpatch=require(_0x1cb9('0x2'));var rp=require(_0x1cb9('0x3'));var moment=require('moment');var BPromise=require(_0x1cb9('0x4'));var Mustache=require(_0x1cb9('0x5'));var util=require('util');var path=require(_0x1cb9('0x6'));var sox=require(_0x1cb9('0x7'));var csv=require('to-csv');var ejs=require(_0x1cb9('0x8'));var fs=require('fs');var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xd'));var authService=require(_0x1cb9('0xe'));var qs=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require(_0x1cb9('0x11'))('api');var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var db=require(_0x1cb9('0x14'))['db'];function respondWithStatusCode(_0x3fdd83,_0x46af58){_0x46af58=_0x46af58||0xcc;return function(_0x5445e1){if(_0x5445e1){return _0x3fdd83['sendStatus'](_0x46af58);}return _0x3fdd83['status'](_0x46af58)[_0x1cb9('0x15')]();};}function respondWithResult(_0x282bc6,_0x384496){_0x384496=_0x384496||0xc8;return function(_0x1c714f){if(_0x1c714f){return _0x282bc6['status'](_0x384496)[_0x1cb9('0x16')](_0x1c714f);}};}function respondWithFilteredResult(_0x6ef389,_0x1b3cd7){return function(_0x8dfa55){if(_0x8dfa55){var _0x3e2d11=_0x8dfa55[_0x1cb9('0x17')],_0x5806d8=_0x1b3cd7[_0x1cb9('0x18')],_0x5572cb=_0x1b3cd7[_0x1cb9('0x18')]+_0x1b3cd7[_0x1cb9('0x19')],_0xd446a3;if(_0x5572cb>=_0x3e2d11){_0x5572cb=_0x3e2d11;_0xd446a3=0xc8;}else{_0xd446a3=0xce;}_0x6ef389[_0x1cb9('0x1a')](_0xd446a3);return _0x6ef389[_0x1cb9('0x1b')]('Content-Range',_0x5806d8+'-'+_0x5572cb+'/'+_0x3e2d11)['json'](_0x8dfa55);}return null;};}function patchUpdates(_0x1b2fa6){return function(_0x41ac41){try{jsonpatch[_0x1cb9('0x1c')](_0x41ac41,_0x1b2fa6,!![]);}catch(_0x31481a){return BPromise[_0x1cb9('0x1d')](_0x31481a);}return _0x41ac41[_0x1cb9('0x1e')]();};}function saveUpdates(_0x24fa1f,_0x4ac422){return function(_0x559bcc){if(_0x559bcc){return _0x559bcc[_0x1cb9('0x1f')](_0x24fa1f)['then'](function(_0x4750b1){return _0x4750b1;});}return null;};}function removeEntity(_0x2265ea,_0x523b26){return function(_0x599275){if(_0x599275){return _0x599275[_0x1cb9('0x20')]()[_0x1cb9('0x21')](function(){_0x2265ea[_0x1cb9('0x1a')](0xcc)[_0x1cb9('0x15')]();});}};}function handleEntityNotFound(_0x45b8d3,_0x27db16){return function(_0x59ebea){if(!_0x59ebea){_0x45b8d3['sendStatus'](0x194);}return _0x59ebea;};}function handleError(_0x6c6f61,_0x557199){_0x557199=_0x557199||0x1f4;return function(_0x10a419){logger[_0x1cb9('0x22')](_0x10a419[_0x1cb9('0x23')]);if(_0x10a419[_0x1cb9('0x24')]){delete _0x10a419[_0x1cb9('0x24')];}_0x6c6f61['status'](_0x557199)[_0x1cb9('0x25')](_0x10a419);};}exports[_0x1cb9('0x26')]=function(_0x4c8d76,_0xd6891c){var _0x21effa={},_0x41a9a0={},_0x1804fd={'count':0x0,'rows':[]};var _0x406821=db[_0x1cb9('0x27')][_0x1cb9('0x28')];_0x41a9a0[_0x1cb9('0x29')]=_[_0x1cb9('0x2a')](_0x406821);_0x41a9a0[_0x1cb9('0x2b')]=_['keys'](_0x4c8d76[_0x1cb9('0x2b')]);_0x41a9a0['filters']=_[_0x1cb9('0x2c')](_0x41a9a0['model'],_0x41a9a0[_0x1cb9('0x2b')]);_0x21effa[_0x1cb9('0x2d')]=_[_0x1cb9('0x2c')](_0x41a9a0[_0x1cb9('0x29')],qs['fields'](_0x4c8d76[_0x1cb9('0x2b')]['fields']));_0x21effa[_0x1cb9('0x2d')]=_0x21effa[_0x1cb9('0x2d')][_0x1cb9('0x2e')]?_0x21effa['attributes']:_0x41a9a0[_0x1cb9('0x29')];if(!_0x4c8d76['query'][_0x1cb9('0x2f')]('nolimit')){_0x21effa[_0x1cb9('0x19')]=qs[_0x1cb9('0x19')](_0x4c8d76[_0x1cb9('0x2b')][_0x1cb9('0x19')]);_0x21effa['offset']=qs[_0x1cb9('0x18')](_0x4c8d76[_0x1cb9('0x2b')][_0x1cb9('0x18')]);}_0x21effa[_0x1cb9('0x30')]=qs[_0x1cb9('0x31')](_0x4c8d76[_0x1cb9('0x2b')][_0x1cb9('0x31')]);_0x21effa[_0x1cb9('0x32')]=qs[_0x1cb9('0x33')](_[_0x1cb9('0x34')](_0x4c8d76[_0x1cb9('0x2b')],_0x41a9a0[_0x1cb9('0x33')]));if(_0x4c8d76[_0x1cb9('0x2b')]['filter']){_0x21effa['where']=_[_0x1cb9('0x35')](_0x21effa[_0x1cb9('0x32')],{'$or':_[_0x1cb9('0x36')](_0x406821,function(_0x29f451){if(_0x29f451[_0x1cb9('0x37')][_0x1cb9('0x38')]!==_0x1cb9('0x39')){var _0x3f5637={};_0x3f5637[_0x29f451['field']]={'$like':'%'+_0x4c8d76[_0x1cb9('0x2b')][_0x1cb9('0x3a')]+'%'};return _0x3f5637;}})});}_0x21effa=_[_0x1cb9('0x35')]({},_0x21effa,_0x4c8d76['options']);var _0x2a5aac={'where':_0x21effa['where']};return db[_0x1cb9('0x27')]['count'](_0x2a5aac)[_0x1cb9('0x21')](function(_0x13d4fd){_0x1804fd[_0x1cb9('0x17')]=_0x13d4fd;if(_0x4c8d76[_0x1cb9('0x2b')][_0x1cb9('0x3b')]){_0x21effa[_0x1cb9('0x3c')]=[{'all':!![]}];}return db[_0x1cb9('0x27')]['findAll'](_0x21effa);})['then'](function(_0x4111b8){_0x1804fd[_0x1cb9('0x3d')]=_0x4111b8;return _0x1804fd;})[_0x1cb9('0x21')](respondWithFilteredResult(_0xd6891c,_0x21effa))[_0x1cb9('0x3e')](handleError(_0xd6891c,null));};exports[_0x1cb9('0x3f')]=function(_0x1d7304,_0x32130b){var _0x4a670c={'raw':!![],'where':{'id':_0x1d7304['params']['id']}},_0xbcaa32={};_0xbcaa32['model']=_['keys'](db[_0x1cb9('0x27')][_0x1cb9('0x28')]);_0xbcaa32[_0x1cb9('0x2b')]=_[_0x1cb9('0x2a')](_0x1d7304[_0x1cb9('0x2b')]);_0xbcaa32['filters']=_[_0x1cb9('0x2c')](_0xbcaa32['model'],_0xbcaa32[_0x1cb9('0x2b')]);_0x4a670c[_0x1cb9('0x2d')]=_[_0x1cb9('0x2c')](_0xbcaa32['model'],qs[_0x1cb9('0x40')](_0x1d7304['query'][_0x1cb9('0x40')]));_0x4a670c[_0x1cb9('0x2d')]=_0x4a670c['attributes']['length']?_0x4a670c[_0x1cb9('0x2d')]:_0xbcaa32[_0x1cb9('0x29')];if(_0x1d7304[_0x1cb9('0x2b')][_0x1cb9('0x3b')]){_0x4a670c[_0x1cb9('0x3c')]=[{'all':!![]}];}_0x4a670c=_['merge']({},_0x4a670c,_0x1d7304[_0x1cb9('0x41')]);return db['Dynamics365Field']['find'](_0x4a670c)['then'](handleEntityNotFound(_0x32130b,null))[_0x1cb9('0x21')](respondWithResult(_0x32130b,null))[_0x1cb9('0x3e')](handleError(_0x32130b,null));};exports[_0x1cb9('0x42')]=function(_0x11cea5,_0x116c05){return db[_0x1cb9('0x27')][_0x1cb9('0x42')](_0x11cea5[_0x1cb9('0x43')],{})[_0x1cb9('0x21')](respondWithResult(_0x116c05,0xc9))[_0x1cb9('0x3e')](handleError(_0x116c05,null));};exports[_0x1cb9('0x1f')]=function(_0x4ce899,_0x9d08cb){if(_0x4ce899[_0x1cb9('0x43')]['id']){delete _0x4ce899[_0x1cb9('0x43')]['id'];}return db['Dynamics365Field'][_0x1cb9('0x44')]({'where':{'id':_0x4ce899[_0x1cb9('0x45')]['id']}})[_0x1cb9('0x21')](handleEntityNotFound(_0x9d08cb,null))[_0x1cb9('0x21')](saveUpdates(_0x4ce899[_0x1cb9('0x43')],null))['then'](respondWithResult(_0x9d08cb,null))[_0x1cb9('0x3e')](handleError(_0x9d08cb,null));};exports['destroy']=function(_0x2eaa11,_0x4ac483){return db[_0x1cb9('0x27')][_0x1cb9('0x44')]({'where':{'id':_0x2eaa11[_0x1cb9('0x45')]['id']}})[_0x1cb9('0x21')](handleEntityNotFound(_0x4ac483,null))['then'](removeEntity(_0x4ac483,null))[_0x1cb9('0x3e')](handleError(_0x4ac483,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index c28768b..27feeab 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 _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x19e5cc,_0xf577ba){var _0xeb07c9=function(_0x3d4170){while(--_0x3d4170){_0x19e5cc['push'](_0x19e5cc['shift']());}};_0xeb07c9(++_0xf577ba);}(_0xb10b,0x12a));var _0xbb10=function(_0x4d692a,_0x5c1506){_0x4d692a=_0x4d692a-0x0;var _0x9ef565=_0xb10b[_0x4d692a];return _0x9ef565;};'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')]('Dynamics365Field',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xd'),_0xbb10('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x39147b,_0x22c8ad){var _0x2448dd=function(_0x50e15b){while(--_0x50e15b){_0x39147b['push'](_0x39147b['shift']());}};_0x2448dd(++_0x22c8ad);}(_0xb10b,0x12a));var _0xbb10=function(_0x19cae9,_0xd6039b){_0x19cae9=_0x19cae9-0x0;var _0x163452=_0xb10b[_0x19cae9];return _0x163452;};'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')]('Dynamics365Field',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xd'),_0xbb10('0xe')],'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 8e5fda6..5989e52 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 _0xb91a=['request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http','request','Dynamics365Field,\x20%s,\x20%s'];(function(_0x51d6cb,_0x351087){var _0x32bbd5=function(_0xb7d7d0){while(--_0xb7d7d0){_0x51d6cb['push'](_0x51d6cb['shift']());}};_0x32bbd5(++_0x351087);}(_0xb91a,0xe5));var _0xab91=function(_0x360679,_0x489802){_0x360679=_0x360679-0x0;var _0x5808d0=_0xb91a[_0x360679];return _0x5808d0;};'use strict';var _=require('lodash');var util=require(_0xab91('0x0'));var moment=require(_0xab91('0x1'));var BPromise=require(_0xab91('0x2'));var rs=require(_0xab91('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab91('0x4'))['db'];var utils=require(_0xab91('0x5'));var logger=require('../../config/logger')(_0xab91('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xab91('0x7')][_0xab91('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x56f24d,_0x2ebd86,_0x26e44b){return new BPromise(function(_0x55a554,_0x1748f2){return client[_0xab91('0x9')](_0x56f24d,_0x26e44b)['then'](function(_0x5765fc){logger['info'](_0xab91('0xa'),_0x2ebd86,_0xab91('0xb'));logger[_0xab91('0xc')](_0xab91('0xd'),_0x2ebd86,'request\x20sent',JSON[_0xab91('0xe')](_0x5765fc));if(_0x5765fc[_0xab91('0xf')]){if(_0x5765fc['error'][_0xab91('0x10')]===0x1f4){logger['error'](_0xab91('0xa'),_0x2ebd86,_0x5765fc['error']['message']);return _0x1748f2(_0x5765fc[_0xab91('0xf')]['message']);}logger[_0xab91('0xf')](_0xab91('0xa'),_0x2ebd86,_0x5765fc[_0xab91('0xf')][_0xab91('0x11')]);return _0x55a554(_0x5765fc[_0xab91('0xf')][_0xab91('0x11')]);}else{logger['info'](_0xab91('0xa'),_0x2ebd86,'request\x20sent');_0x55a554(_0x5765fc[_0xab91('0x12')][_0xab91('0x11')]);}})[_0xab91('0x13')](function(_0x32df88){logger['error'](_0xab91('0xa'),_0x2ebd86,_0x32df88);_0x1748f2(_0x32df88);});});} \ No newline at end of file +var _0x2bce=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash'];(function(_0x2cbc2f,_0x32d59e){var _0x569f27=function(_0x14e021){while(--_0x14e021){_0x2cbc2f['push'](_0x2cbc2f['shift']());}};_0x569f27(++_0x32d59e);}(_0x2bce,0x6d));var _0xe2bc=function(_0x20186f,_0x188ec9){_0x20186f=_0x20186f-0x0;var _0xfde9f6=_0x2bce[_0x20186f];return _0xfde9f6;};'use strict';var _=require(_0xe2bc('0x0'));var util=require(_0xe2bc('0x1'));var moment=require(_0xe2bc('0x2'));var BPromise=require('bluebird');var rs=require(_0xe2bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe2bc('0x4'))['db'];var utils=require(_0xe2bc('0x5'));var logger=require(_0xe2bc('0x6'))(_0xe2bc('0x7'));var config=require(_0xe2bc('0x8'));var jayson=require(_0xe2bc('0x9'));var client=jayson['client'][_0xe2bc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x494308,_0x4f5cf,_0x43e828){return new BPromise(function(_0x13b676,_0x316fc4){return client['request'](_0x494308,_0x43e828)[_0xe2bc('0xb')](function(_0x57d41b){logger[_0xe2bc('0xc')](_0xe2bc('0xd'),_0x4f5cf,'request\x20sent');logger[_0xe2bc('0xe')](_0xe2bc('0xf'),_0x4f5cf,_0xe2bc('0x10'),JSON['stringify'](_0x57d41b));if(_0x57d41b['error']){if(_0x57d41b[_0xe2bc('0x11')][_0xe2bc('0x12')]===0x1f4){logger[_0xe2bc('0x11')](_0xe2bc('0xd'),_0x4f5cf,_0x57d41b[_0xe2bc('0x11')][_0xe2bc('0x13')]);return _0x316fc4(_0x57d41b[_0xe2bc('0x11')][_0xe2bc('0x13')]);}logger[_0xe2bc('0x11')](_0xe2bc('0xd'),_0x4f5cf,_0x57d41b['error'][_0xe2bc('0x13')]);return _0x13b676(_0x57d41b['error'][_0xe2bc('0x13')]);}else{logger[_0xe2bc('0xc')](_0xe2bc('0xd'),_0x4f5cf,_0xe2bc('0x10'));_0x13b676(_0x57d41b[_0xe2bc('0x14')][_0xe2bc('0x13')]);}})[_0xe2bc('0x15')](function(_0x59af2e){logger[_0xe2bc('0x11')](_0xe2bc('0xd'),_0x4f5cf,_0x59af2e);_0x316fc4(_0x59af2e);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 92d64e2..f12d284 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 _0xc264=['/:id/fields','post','addConfiguration','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc264,0xa6));var _0x4c26=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0xc264[_0x2a5099];return _0x2802f1;};'use strict';var multer=require(_0x4c26('0x0'));var util=require(_0x4c26('0x1'));var path=require(_0x4c26('0x2'));var timeout=require('connect-timeout');var express=require(_0x4c26('0x3'));var router=express[_0x4c26('0x4')]();var auth=require(_0x4c26('0x5'));var interaction=require(_0x4c26('0x6'));var config=require(_0x4c26('0x7'));var controller=require(_0x4c26('0x8'));router[_0x4c26('0x9')]('/',auth[_0x4c26('0xa')](),controller['index']);router[_0x4c26('0x9')](_0x4c26('0xb'),auth[_0x4c26('0xa')](),controller['show']);router[_0x4c26('0x9')](_0x4c26('0xc'),auth['isAuthenticated'](),controller[_0x4c26('0xd')]);router[_0x4c26('0x9')](_0x4c26('0xe'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x4c26('0xa')](),controller['create']);router[_0x4c26('0xf')](_0x4c26('0xc'),auth['isAuthenticated'](),controller[_0x4c26('0x10')]);router['put'](_0x4c26('0xb'),auth[_0x4c26('0xa')](),controller[_0x4c26('0x11')]);router[_0x4c26('0x12')](_0x4c26('0xb'),auth[_0x4c26('0xa')](),controller[_0x4c26('0x13')]);module['exports']=router; \ No newline at end of file +var _0x393e=['/:id','show','getConfigurations','/:id/fields','getFields','create','/:id/configurations','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x110441,_0x5bb5d7){var _0x29e03b=function(_0x1b180e){while(--_0x1b180e){_0x110441['push'](_0x110441['shift']());}};_0x29e03b(++_0x5bb5d7);}(_0x393e,0x1c4));var _0xe393=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x393e[_0x346737];return _0x1ade2e;};'use strict';var multer=require(_0xe393('0x0'));var util=require(_0xe393('0x1'));var path=require(_0xe393('0x2'));var timeout=require(_0xe393('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xe393('0x4'));var interaction=require(_0xe393('0x5'));var config=require(_0xe393('0x6'));var controller=require('./intFreshdeskAccount.controller');router[_0xe393('0x7')]('/',auth[_0xe393('0x8')](),controller[_0xe393('0x9')]);router['get'](_0xe393('0xa'),auth[_0xe393('0x8')](),controller[_0xe393('0xb')]);router[_0xe393('0x7')]('/:id/configurations',auth[_0xe393('0x8')](),controller[_0xe393('0xc')]);router[_0xe393('0x7')](_0xe393('0xd'),auth[_0xe393('0x8')](),controller[_0xe393('0xe')]);router['post']('/',auth[_0xe393('0x8')](),controller[_0xe393('0xf')]);router['post'](_0xe393('0x10'),auth[_0xe393('0x8')](),controller[_0xe393('0x11')]);router['put'](_0xe393('0xa'),auth['isAuthenticated'](),controller[_0xe393('0x12')]);router[_0xe393('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xe393('0x14')]);module[_0xe393('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index f2445ec..04d7713 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 _0xca79=['exports','STRING','username','remoteUri','sequelize'];(function(_0x742be0,_0x65857c){var _0x4ec6fc=function(_0x18ebff){while(--_0x18ebff){_0x742be0['push'](_0x742be0['shift']());}};_0x4ec6fc(++_0x65857c);}(_0xca79,0x144));var _0x9ca7=function(_0x17e8f2,_0x2ab183){_0x17e8f2=_0x17e8f2-0x0;var _0x508ef3=_0xca79[_0x17e8f2];return _0x508ef3;};'use strict';var Sequelize=require(_0x9ca7('0x0'));module[_0x9ca7('0x1')]={'name':{'type':Sequelize[_0x9ca7('0x2')]},'description':{'type':Sequelize[_0x9ca7('0x2')]},'username':{'type':Sequelize[_0x9ca7('0x2')],'unique':_0x9ca7('0x3')},'apiKey':{'type':Sequelize[_0x9ca7('0x2')]},'remoteUri':{'type':Sequelize[_0x9ca7('0x2')],'unique':_0x9ca7('0x4')},'serverUrl':{'type':Sequelize[_0x9ca7('0x2')]}}; \ No newline at end of file +var _0xc269=['STRING','username','remoteUri','exports'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0xc269,0x127));var _0x9c26=function(_0x4fcad0,_0x869361){_0x4fcad0=_0x4fcad0-0x0;var _0x5f1dec=_0xc269[_0x4fcad0];return _0x5f1dec;};'use strict';var Sequelize=require('sequelize');module[_0x9c26('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9c26('0x1')]},'username':{'type':Sequelize[_0x9c26('0x1')],'unique':_0x9c26('0x2')},'apiKey':{'type':Sequelize[_0x9c26('0x1')]},'remoteUri':{'type':Sequelize[_0x9c26('0x1')],'unique':_0x9c26('0x3')},'serverUrl':{'type':Sequelize[_0x9c26('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 1351ac6..41d0835 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 _0x5278=['rimraf','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','stringify','error','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','name','send','FreshdeskAccount','rawAttributes','model','keys','query','filters','attributes','fields','limit','order','sort','pick','where','merge','map','type','VIRTUAL','field','filter','options','include','findAll','params','intersection','length','includeAll','find','create','update','body','destroy','getConfigurations','findOne','FreshdeskConfiguration','hasOwnProperty','nolimit','addConfiguration','getSubjects','channel','Descriptions','FreshdeskField','Subjects','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s/%s','format','%s:X','base64','requester','subject','agent','description','source','group','company','remove','includes','default','custom_dropdown','label','choices','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format'];(function(_0x4cc07d,_0x39339e){var _0x2555c9=function(_0x1e23e4){while(--_0x1e23e4){_0x4cc07d['push'](_0x4cc07d['shift']());}};_0x2555c9(++_0x39339e);}(_0x5278,0x166));var _0x8527=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x5278[_0x15c421];return _0x5e5ed5;};'use strict';var pdf=require(_0x8527('0x0'));var emlformat=require(_0x8527('0x1'));var rimraf=require(_0x8527('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8527('0x3'));var moment=require(_0x8527('0x4'));var BPromise=require(_0x8527('0x5'));var Mustache=require('mustache');var util=require(_0x8527('0x6'));var path=require(_0x8527('0x7'));var sox=require(_0x8527('0x8'));var csv=require('to-csv');var ejs=require(_0x8527('0x9'));var fs=require('fs');var _=require(_0x8527('0xa'));var squel=require(_0x8527('0xb'));var crypto=require(_0x8527('0xc'));var jsforce=require(_0x8527('0xd'));var deskjs=require(_0x8527('0xe'));var toCsv=require(_0x8527('0xf'));var querystring=require('querystring');var Papa=require(_0x8527('0x10'));var Redis=require(_0x8527('0x11'));var authService=require(_0x8527('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8527('0x13'))(_0x8527('0x14'));var utils=require(_0x8527('0x15'));var config=require(_0x8527('0x16'));var db=require(_0x8527('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x8527('0x18'));var client=jayson[_0x8527('0x19')][_0x8527('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x400694,_0x7e43b4,_0xd8605f){if(_0xd8605f){var _0x29e508=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x29e508[_0x8527('0x1b')](_0x7e43b4)){return _0x400694;}else{throw new Error(_0x8527('0x1c'));}}else{return _0x400694;}}function respondWithRpcPromise(_0x3c98f7,_0x1b6253,_0x32d317,_0x1e42c7){return new BPromise(function(_0x445dd2,_0x3f9fc1){var _0x1c1af7=_0x1e42c7||client;return _0x1c1af7[_0x8527('0x1d')](_0x3c98f7,_0x32d317)[_0x8527('0x1e')](function(_0x270988){logger[_0x8527('0x1f')]('FreshdeskAccount,\x20%s,\x20%s',_0x1b6253,_0x8527('0x20'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x1b6253,_0x8527('0x20'),JSON[_0x8527('0x21')](_0x270988));if(_0x270988['error']){if(_0x270988['error']['code']===0x1f4){logger[_0x8527('0x22')](_0x8527('0x23'),_0x1b6253,_0x270988['error'][_0x8527('0x24')]);return _0x3f9fc1(_0x270988[_0x8527('0x22')][_0x8527('0x24')]);}logger[_0x8527('0x22')](_0x8527('0x23'),_0x1b6253,_0x270988[_0x8527('0x22')][_0x8527('0x24')]);return _0x445dd2(_0x270988['error'][_0x8527('0x24')]);}else{logger[_0x8527('0x1f')](_0x8527('0x23'),_0x1b6253,_0x8527('0x20'));_0x445dd2(_0x270988[_0x8527('0x25')][_0x8527('0x24')]);}})[_0x8527('0x26')](function(_0x491dce){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x1b6253,_0x491dce);_0x3f9fc1(_0x491dce);});});}function respondWithStatusCode(_0x3d01bf,_0x4f4ed0){_0x4f4ed0=_0x4f4ed0||0xcc;return function(_0x3ddfbf){if(_0x3ddfbf){return _0x3d01bf[_0x8527('0x27')](_0x4f4ed0);}return _0x3d01bf[_0x8527('0x28')](_0x4f4ed0)[_0x8527('0x29')]();};}function respondWithResult(_0x4150a7,_0xb8450){_0xb8450=_0xb8450||0xc8;return function(_0x4e0877){if(_0x4e0877){return _0x4150a7['status'](_0xb8450)[_0x8527('0x2a')](_0x4e0877);}};}function respondWithFilteredResult(_0x229448,_0x1a27d3){return function(_0x536b5b){if(_0x536b5b){var _0x490edc=_0x536b5b[_0x8527('0x2b')],_0x5d4448=_0x1a27d3['offset'],_0x1c2ea4=_0x1a27d3[_0x8527('0x2c')]+_0x1a27d3['limit'],_0x1bd1c2;if(_0x1c2ea4>=_0x490edc){_0x1c2ea4=_0x490edc;_0x1bd1c2=0xc8;}else{_0x1bd1c2=0xce;}_0x229448[_0x8527('0x28')](_0x1bd1c2);return _0x229448['set'](_0x8527('0x2d'),_0x5d4448+'-'+_0x1c2ea4+'/'+_0x490edc)['json'](_0x536b5b);}return null;};}function patchUpdates(_0x54dd5f){return function(_0x4ddb03){try{jsonpatch[_0x8527('0x2e')](_0x4ddb03,_0x54dd5f,!![]);}catch(_0xf385fc){return BPromise[_0x8527('0x2f')](_0xf385fc);}return _0x4ddb03[_0x8527('0x30')]();};}function saveUpdates(_0x4394dd,_0x145f67){return function(_0xff169f){if(_0xff169f){return _0xff169f['update'](_0x4394dd)['then'](function(_0x586985){return _0x586985;});}return null;};}function removeEntity(_0x43008d,_0x50f118){return function(_0xc13f13){if(_0xc13f13){return _0xc13f13['destroy']()[_0x8527('0x1e')](function(){_0x43008d[_0x8527('0x28')](0xcc)[_0x8527('0x29')]();});}};}function handleEntityNotFound(_0xdbd12a,_0x19ed3c){return function(_0x3c1543){if(!_0x3c1543){_0xdbd12a[_0x8527('0x27')](0x194);}return _0x3c1543;};}function handleError(_0x48395a,_0x585b5e){_0x585b5e=_0x585b5e||0x1f4;return function(_0x4e2aa4){logger[_0x8527('0x22')](_0x4e2aa4['stack']);if(_0x4e2aa4[_0x8527('0x31')]){delete _0x4e2aa4[_0x8527('0x31')];}_0x48395a[_0x8527('0x28')](_0x585b5e)[_0x8527('0x32')](_0x4e2aa4);};}exports['index']=function(_0x429d03,_0x3cfd33){var _0xdad982={},_0x19266a={},_0x57b839={'count':0x0,'rows':[]};var _0x5aa462=db[_0x8527('0x33')][_0x8527('0x34')];_0x19266a[_0x8527('0x35')]=_[_0x8527('0x36')](_0x5aa462);_0x19266a['query']=_['keys'](_0x429d03[_0x8527('0x37')]);_0x19266a[_0x8527('0x38')]=_['intersection'](_0x19266a[_0x8527('0x35')],_0x19266a[_0x8527('0x37')]);_0xdad982[_0x8527('0x39')]=_['intersection'](_0x19266a[_0x8527('0x35')],qs[_0x8527('0x3a')](_0x429d03[_0x8527('0x37')][_0x8527('0x3a')]));_0xdad982['attributes']=_0xdad982['attributes']['length']?_0xdad982[_0x8527('0x39')]:_0x19266a[_0x8527('0x35')];if(!_0x429d03[_0x8527('0x37')]['hasOwnProperty']('nolimit')){_0xdad982[_0x8527('0x3b')]=qs[_0x8527('0x3b')](_0x429d03[_0x8527('0x37')][_0x8527('0x3b')]);_0xdad982[_0x8527('0x2c')]=qs[_0x8527('0x2c')](_0x429d03[_0x8527('0x37')][_0x8527('0x2c')]);}_0xdad982[_0x8527('0x3c')]=qs['sort'](_0x429d03['query'][_0x8527('0x3d')]);_0xdad982['where']=qs['filters'](_[_0x8527('0x3e')](_0x429d03[_0x8527('0x37')],_0x19266a['filters']));if(_0x429d03[_0x8527('0x37')]['filter']){_0xdad982[_0x8527('0x3f')]=_[_0x8527('0x40')](_0xdad982[_0x8527('0x3f')],{'$or':_[_0x8527('0x41')](_0x5aa462,function(_0x3c5ed4){if(_0x3c5ed4[_0x8527('0x42')]['key']!==_0x8527('0x43')){var _0x14e539={};_0x14e539[_0x3c5ed4[_0x8527('0x44')]]={'$like':'%'+_0x429d03['query'][_0x8527('0x45')]+'%'};return _0x14e539;}})});}_0xdad982=_[_0x8527('0x40')]({},_0xdad982,_0x429d03[_0x8527('0x46')]);var _0x12c20d={'where':_0xdad982[_0x8527('0x3f')]};return db[_0x8527('0x33')][_0x8527('0x2b')](_0x12c20d)[_0x8527('0x1e')](function(_0x4f1efa){_0x57b839['count']=_0x4f1efa;if(_0x429d03[_0x8527('0x37')]['includeAll']){_0xdad982[_0x8527('0x47')]=[{'all':!![]}];}return db[_0x8527('0x33')][_0x8527('0x48')](_0xdad982);})['then'](function(_0x5d3c97){_0x57b839['rows']=_0x5d3c97;return _0x57b839;})[_0x8527('0x1e')](respondWithFilteredResult(_0x3cfd33,_0xdad982))[_0x8527('0x26')](handleError(_0x3cfd33,null));};exports['show']=function(_0xa9398c,_0x27c149){var _0x18a985={'raw':![],'where':{'id':_0xa9398c[_0x8527('0x49')]['id']}},_0xd0a510={};_0xd0a510[_0x8527('0x35')]=_[_0x8527('0x36')](db[_0x8527('0x33')][_0x8527('0x34')]);_0xd0a510[_0x8527('0x37')]=_[_0x8527('0x36')](_0xa9398c[_0x8527('0x37')]);_0xd0a510[_0x8527('0x38')]=_[_0x8527('0x4a')](_0xd0a510[_0x8527('0x35')],_0xd0a510['query']);_0x18a985[_0x8527('0x39')]=_[_0x8527('0x4a')](_0xd0a510['model'],qs[_0x8527('0x3a')](_0xa9398c[_0x8527('0x37')]['fields']));_0x18a985['attributes']=_0x18a985[_0x8527('0x39')][_0x8527('0x4b')]?_0x18a985[_0x8527('0x39')]:_0xd0a510['model'];if(_0xa9398c[_0x8527('0x37')][_0x8527('0x4c')]){_0x18a985[_0x8527('0x47')]=[{'all':!![]}];}_0x18a985=_[_0x8527('0x40')]({},_0x18a985,_0xa9398c[_0x8527('0x46')]);return db[_0x8527('0x33')][_0x8527('0x4d')](_0x18a985)[_0x8527('0x1e')](handleEntityNotFound(_0x27c149,null))['then'](respondWithResult(_0x27c149,null))[_0x8527('0x26')](handleError(_0x27c149,null));};exports[_0x8527('0x4e')]=function(_0x2cff73,_0x7fd0e){return db['FreshdeskAccount']['create'](_0x2cff73['body'],{})['then'](respondWithResult(_0x7fd0e,0xc9))[_0x8527('0x26')](handleError(_0x7fd0e,null));};exports[_0x8527('0x4f')]=function(_0x6f293c,_0x2d8e51){if(_0x6f293c[_0x8527('0x50')]['id']){delete _0x6f293c[_0x8527('0x50')]['id'];}return db[_0x8527('0x33')][_0x8527('0x4d')]({'where':{'id':_0x6f293c[_0x8527('0x49')]['id']}})[_0x8527('0x1e')](handleEntityNotFound(_0x2d8e51,null))[_0x8527('0x1e')](saveUpdates(_0x6f293c[_0x8527('0x50')],null))[_0x8527('0x1e')](respondWithResult(_0x2d8e51,null))['catch'](handleError(_0x2d8e51,null));};exports[_0x8527('0x51')]=function(_0x5c00f7,_0xbf899b){return db[_0x8527('0x33')][_0x8527('0x4d')]({'where':{'id':_0x5c00f7[_0x8527('0x49')]['id']}})['then'](handleEntityNotFound(_0xbf899b,null))['then'](removeEntity(_0xbf899b,null))[_0x8527('0x26')](handleError(_0xbf899b,null));};exports[_0x8527('0x52')]=function(_0xb535df,_0x2527b9,_0x595ab4){var _0x170ae0={};var _0x6459cd={};var _0xcf8f88;var _0x1b804d;return db[_0x8527('0x33')][_0x8527('0x53')]({'where':{'id':_0xb535df[_0x8527('0x49')]['id']}})['then'](handleEntityNotFound(_0x2527b9,null))['then'](function(_0x419490){if(_0x419490){_0xcf8f88=_0x419490;_0x6459cd[_0x8527('0x35')]=_['keys'](db[_0x8527('0x54')][_0x8527('0x34')]);_0x6459cd[_0x8527('0x37')]=_['keys'](_0xb535df[_0x8527('0x37')]);_0x6459cd[_0x8527('0x38')]=_[_0x8527('0x4a')](_0x6459cd['model'],_0x6459cd[_0x8527('0x37')]);_0x170ae0[_0x8527('0x39')]=_['intersection'](_0x6459cd[_0x8527('0x35')],qs[_0x8527('0x3a')](_0xb535df[_0x8527('0x37')][_0x8527('0x3a')]));_0x170ae0[_0x8527('0x39')]=_0x170ae0['attributes'][_0x8527('0x4b')]?_0x170ae0['attributes']:_0x6459cd['model'];_0x170ae0[_0x8527('0x3c')]=qs[_0x8527('0x3d')](_0xb535df[_0x8527('0x37')][_0x8527('0x3d')]);_0x170ae0[_0x8527('0x3f')]=qs[_0x8527('0x38')](_['pick'](_0xb535df['query'],_0x6459cd[_0x8527('0x38')]));if(_0xb535df[_0x8527('0x37')][_0x8527('0x45')]){_0x170ae0[_0x8527('0x3f')]=_[_0x8527('0x40')](_0x170ae0[_0x8527('0x3f')],{'$or':_['map'](_0x170ae0[_0x8527('0x39')],function(_0x2abf35){var _0xc9ae83={};_0xc9ae83[_0x2abf35]={'$like':'%'+_0xb535df[_0x8527('0x37')]['filter']+'%'};return _0xc9ae83;})});}_0x170ae0=_[_0x8527('0x40')]({},_0x170ae0,_0xb535df[_0x8527('0x46')]);return _0xcf8f88[_0x8527('0x52')](_0x170ae0);}})[_0x8527('0x1e')](function(_0x13f65d){if(_0x13f65d){_0x1b804d=_0x13f65d[_0x8527('0x4b')];if(!_0xb535df[_0x8527('0x37')][_0x8527('0x55')](_0x8527('0x56'))){_0x170ae0[_0x8527('0x3b')]=qs[_0x8527('0x3b')](_0xb535df[_0x8527('0x37')][_0x8527('0x3b')]);_0x170ae0['offset']=qs[_0x8527('0x2c')](_0xb535df[_0x8527('0x37')]['offset']);}return _0xcf8f88[_0x8527('0x52')](_0x170ae0);}})[_0x8527('0x1e')](function(_0x4f8444){if(_0x4f8444){return _0x4f8444?{'count':_0x1b804d,'rows':_0x4f8444}:null;}})['then'](respondWithResult(_0x2527b9,null))['catch'](handleError(_0x2527b9,null));};exports[_0x8527('0x57')]=function(_0x14b171,_0x52ac55,_0x480abd){if(_0x14b171[_0x8527('0x50')]['id']){delete _0x14b171[_0x8527('0x50')]['id'];}return db[_0x8527('0x33')][_0x8527('0x53')]({'where':{'id':_0x14b171['params']['id']}})['then'](handleEntityNotFound(_0x52ac55,null))[_0x8527('0x1e')](function(_0x30007c){if(_0x30007c){_0x14b171['body']['AccountId']=_0x30007c['id'];_0x14b171[_0x8527('0x50')]['Subjects']=integrations[_0x8527('0x58')](_0x14b171[_0x8527('0x50')][_0x8527('0x59')],_0x14b171[_0x8527('0x50')][_0x8527('0x42')]);_0x14b171[_0x8527('0x50')][_0x8527('0x5a')]=integrations['getDescriptions'](_0x14b171['body'][_0x8527('0x59')],_0x14b171[_0x8527('0x50')][_0x8527('0x42')]);return db[_0x8527('0x54')][_0x8527('0x4e')](_0x14b171['body'],{'include':[{'model':db[_0x8527('0x5b')],'as':_0x8527('0x5c')},{'model':db[_0x8527('0x5b')],'as':'Descriptions'}]});}return null;})[_0x8527('0x1e')](respondWithResult(_0x52ac55,null))[_0x8527('0x26')](handleError(_0x52ac55,null));};exports[_0x8527('0x5d')]=function(_0x32bfd3,_0x1c15e1,_0x3909f6){var _0x4aafb2='';return db[_0x8527('0x33')][_0x8527('0x53')]({'where':{'id':_0x32bfd3[_0x8527('0x49')]['id']},'attributes':['id',_0x8527('0x5e'),_0x8527('0x5f')]})['then'](handleEntityNotFound(_0x1c15e1,null))[_0x8527('0x1e')](function(_0x5ee142){if(_0x5ee142){_0x4aafb2=_0x5ee142['remoteUri'];var _0x36ebec=_0x4aafb2[_0x8527('0x60')](-0x1);if(_0x36ebec==='/'){_0x4aafb2=_0x4aafb2[_0x8527('0x61')](0x0,_0x4aafb2[_0x8527('0x62')](_0x36ebec));}return rp({'method':_0x8527('0x63'),'uri':util['format'](_0x8527('0x64'),_0x4aafb2,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x8527('0x65')]('Basic\x20%s',new Buffer(util[_0x8527('0x65')](_0x8527('0x66'),_0x5ee142['apiKey']))['toString'](_0x8527('0x67')))},'json':!![]});}})[_0x8527('0x1e')](function(_0x3a9289){if(_0x3a9289){var _0x5e28de=[_0x8527('0x68'),_0x8527('0x69'),_0x8527('0x6a'),_0x8527('0x6b'),_0x8527('0x28'),'priority','group',_0x8527('0x6c'),'ticket_type',_0x8527('0x6d'),_0x8527('0x6e')];_[_0x8527('0x6f')](_0x3a9289,function(_0x3bae68){return _0x5e28de[_0x8527('0x70')](_0x3bae68[_0x8527('0x31')])||!_0x3bae68[_0x8527('0x71')]&&_0x3bae68[_0x8527('0x42')]!=='custom_text'&&_0x3bae68[_0x8527('0x42')]!==_0x8527('0x72');});return{'count':_0x3a9289[_0x8527('0x4b')],'rows':_[_0x8527('0x41')](_0x3a9289,function(_0x571285){return{'id':_0x571285[_0x8527('0x31')],'name':_0x571285[_0x8527('0x73')],'custom':!_0x571285[_0x8527('0x71')],'options':_0x571285[_0x8527('0x74')]?_[_0x8527('0x41')](_0x571285['choices'],function(_0x7b9123){return{'name':_['capitalize'](_0x7b9123),'value':_0x7b9123};}):[]};})};}})[_0x8527('0x1e')](respondWithResult(_0x1c15e1,null))[_0x8527('0x26')](function(_0x2e1df9){var _0x32935e=_0x32bfd3[_0x8527('0x37')][_0x8527('0x1b')]?0x1f4:_0x2e1df9[_0x8527('0x75')]||0x1f4;logger[_0x8527('0x22')](_0x8527('0x76'),_0x8527('0x5d'),_0x32935e,JSON[_0x8527('0x21')](_0x2e1df9));delete _0x2e1df9['name'];if(_0x32935e===0x191){_0x32935e=0x190;}_0x1c15e1[_0x8527('0x28')](_0x32935e)[_0x8527('0x32')](_0x32bfd3['query'][_0x8527('0x1b')]?{'message':_0x8527('0x77'),'statusCode':_0x2e1df9[_0x8527('0x75')]}:_0x2e1df9);});}; \ No newline at end of file +var _0x0670=['apiKey','slice','substring','lastIndexOf','GET','format','api/v2/ticket_fields','base64','agent','priority','group','source','company','remove','default','custom_text','custom_dropdown','label','choices','statusCode','getFields','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','json','count','offset','set','apply','reject','save','update','destroy','end','stack','name','send','index','FreshdeskAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','map','type','key','VIRTUAL','includeAll','include','rows','show','length','merge','catch','create','body','find','params','getConfigurations','findOne','FreshdeskConfiguration','pick','options','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','Subjects','remoteUri'];(function(_0x250f7d,_0x243911){var _0x8f6bdc=function(_0xad5857){while(--_0xad5857){_0x250f7d['push'](_0x250f7d['shift']());}};_0x8f6bdc(++_0x243911);}(_0x0670,0x8f));var _0x0067=function(_0x4c9f6a,_0xcb2cb2){_0x4c9f6a=_0x4c9f6a-0x0;var _0x5df5b9=_0x0670[_0x4c9f6a];return _0x5df5b9;};'use strict';var pdf=require(_0x0067('0x0'));var emlformat=require(_0x0067('0x1'));var rimraf=require(_0x0067('0x2'));var zipdir=require(_0x0067('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0067('0x4'));var moment=require(_0x0067('0x5'));var BPromise=require(_0x0067('0x6'));var Mustache=require('mustache');var util=require(_0x0067('0x7'));var path=require('path');var sox=require(_0x0067('0x8'));var csv=require(_0x0067('0x9'));var ejs=require(_0x0067('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0067('0xb'));var deskjs=require(_0x0067('0xc'));var toCsv=require(_0x0067('0x9'));var querystring=require(_0x0067('0xd'));var Papa=require(_0x0067('0xe'));var Redis=require(_0x0067('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0067('0x10'));var hardwareService=require(_0x0067('0x11'));var logger=require(_0x0067('0x12'))(_0x0067('0x13'));var utils=require(_0x0067('0x14'));var config=require(_0x0067('0x15'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x0067('0x16'));var client=jayson[_0x0067('0x17')][_0x0067('0x18')]({'port':0x232a});function checkPasswordPattern(_0x313801,_0x21e2c9,_0x5efe81){if(_0x5efe81){var _0x2b5fb3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2b5fb3[_0x0067('0x19')](_0x21e2c9)){return _0x313801;}else{throw new Error(_0x0067('0x1a'));}}else{return _0x313801;}}function respondWithRpcPromise(_0x2facc8,_0x37cba7,_0xe5e55c,_0x229cfb){return new BPromise(function(_0x30a8bb,_0x1ea2ec){var _0xc30789=_0x229cfb||client;return _0xc30789[_0x0067('0x1b')](_0x2facc8,_0xe5e55c)[_0x0067('0x1c')](function(_0x495575){logger[_0x0067('0x1d')](_0x0067('0x1e'),_0x37cba7,_0x0067('0x1f'));logger[_0x0067('0x20')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x37cba7,_0x0067('0x1f'),JSON[_0x0067('0x21')](_0x495575));if(_0x495575['error']){if(_0x495575[_0x0067('0x22')][_0x0067('0x23')]===0x1f4){logger[_0x0067('0x22')]('FreshdeskAccount,\x20%s,\x20%s',_0x37cba7,_0x495575[_0x0067('0x22')][_0x0067('0x24')]);return _0x1ea2ec(_0x495575[_0x0067('0x22')]['message']);}logger[_0x0067('0x22')](_0x0067('0x1e'),_0x37cba7,_0x495575['error']['message']);return _0x30a8bb(_0x495575['error']['message']);}else{logger[_0x0067('0x1d')](_0x0067('0x1e'),_0x37cba7,_0x0067('0x1f'));_0x30a8bb(_0x495575[_0x0067('0x25')][_0x0067('0x24')]);}})['catch'](function(_0x40ba96){logger['error'](_0x0067('0x1e'),_0x37cba7,_0x40ba96);_0x1ea2ec(_0x40ba96);});});}function respondWithStatusCode(_0x52924c,_0x5bf8e7){_0x5bf8e7=_0x5bf8e7||0xcc;return function(_0x534d39){if(_0x534d39){return _0x52924c[_0x0067('0x26')](_0x5bf8e7);}return _0x52924c[_0x0067('0x27')](_0x5bf8e7)['end']();};}function respondWithResult(_0x55cdd1,_0x469c85){_0x469c85=_0x469c85||0xc8;return function(_0xfc385a){if(_0xfc385a){return _0x55cdd1[_0x0067('0x27')](_0x469c85)[_0x0067('0x28')](_0xfc385a);}};}function respondWithFilteredResult(_0x1e4068,_0x3bf740){return function(_0x5497f0){if(_0x5497f0){var _0x387b96=_0x5497f0[_0x0067('0x29')],_0x47ebbd=_0x3bf740[_0x0067('0x2a')],_0x39e546=_0x3bf740[_0x0067('0x2a')]+_0x3bf740['limit'],_0x1476b9;if(_0x39e546>=_0x387b96){_0x39e546=_0x387b96;_0x1476b9=0xc8;}else{_0x1476b9=0xce;}_0x1e4068[_0x0067('0x27')](_0x1476b9);return _0x1e4068[_0x0067('0x2b')]('Content-Range',_0x47ebbd+'-'+_0x39e546+'/'+_0x387b96)['json'](_0x5497f0);}return null;};}function patchUpdates(_0x1fea6f){return function(_0x592361){try{jsonpatch[_0x0067('0x2c')](_0x592361,_0x1fea6f,!![]);}catch(_0x92ba07){return BPromise[_0x0067('0x2d')](_0x92ba07);}return _0x592361[_0x0067('0x2e')]();};}function saveUpdates(_0x1eca20,_0x57a070){return function(_0xa9f3b5){if(_0xa9f3b5){return _0xa9f3b5[_0x0067('0x2f')](_0x1eca20)[_0x0067('0x1c')](function(_0x5d0109){return _0x5d0109;});}return null;};}function removeEntity(_0x4516e5,_0x1784d4){return function(_0x53bfd0){if(_0x53bfd0){return _0x53bfd0[_0x0067('0x30')]()[_0x0067('0x1c')](function(){_0x4516e5['status'](0xcc)[_0x0067('0x31')]();});}};}function handleEntityNotFound(_0x34960a,_0x5b86e0){return function(_0x5db58e){if(!_0x5db58e){_0x34960a[_0x0067('0x26')](0x194);}return _0x5db58e;};}function handleError(_0x9ade22,_0xc0e601){_0xc0e601=_0xc0e601||0x1f4;return function(_0x252706){logger[_0x0067('0x22')](_0x252706[_0x0067('0x32')]);if(_0x252706[_0x0067('0x33')]){delete _0x252706[_0x0067('0x33')];}_0x9ade22['status'](_0xc0e601)[_0x0067('0x34')](_0x252706);};}exports[_0x0067('0x35')]=function(_0x777f8a,_0x28a06b){var _0x24724d={},_0x84bd2f={},_0x396205={'count':0x0,'rows':[]};var _0xd2692f=db[_0x0067('0x36')][_0x0067('0x37')];_0x84bd2f[_0x0067('0x38')]=_[_0x0067('0x39')](_0xd2692f);_0x84bd2f[_0x0067('0x3a')]=_[_0x0067('0x39')](_0x777f8a[_0x0067('0x3a')]);_0x84bd2f[_0x0067('0x3b')]=_[_0x0067('0x3c')](_0x84bd2f['model'],_0x84bd2f[_0x0067('0x3a')]);_0x24724d[_0x0067('0x3d')]=_['intersection'](_0x84bd2f[_0x0067('0x38')],qs[_0x0067('0x3e')](_0x777f8a[_0x0067('0x3a')][_0x0067('0x3e')]));_0x24724d[_0x0067('0x3d')]=_0x24724d[_0x0067('0x3d')]['length']?_0x24724d[_0x0067('0x3d')]:_0x84bd2f[_0x0067('0x38')];if(!_0x777f8a[_0x0067('0x3a')][_0x0067('0x3f')](_0x0067('0x40'))){_0x24724d[_0x0067('0x41')]=qs[_0x0067('0x41')](_0x777f8a[_0x0067('0x3a')][_0x0067('0x41')]);_0x24724d[_0x0067('0x2a')]=qs['offset'](_0x777f8a[_0x0067('0x3a')][_0x0067('0x2a')]);}_0x24724d[_0x0067('0x42')]=qs['sort'](_0x777f8a['query'][_0x0067('0x43')]);_0x24724d[_0x0067('0x44')]=qs['filters'](_['pick'](_0x777f8a[_0x0067('0x3a')],_0x84bd2f[_0x0067('0x3b')]));if(_0x777f8a['query'][_0x0067('0x45')]){_0x24724d[_0x0067('0x44')]=_['merge'](_0x24724d[_0x0067('0x44')],{'$or':_[_0x0067('0x46')](_0xd2692f,function(_0x45eace){if(_0x45eace[_0x0067('0x47')][_0x0067('0x48')]!==_0x0067('0x49')){var _0x205ea5={};_0x205ea5[_0x45eace['field']]={'$like':'%'+_0x777f8a['query']['filter']+'%'};return _0x205ea5;}})});}_0x24724d=_['merge']({},_0x24724d,_0x777f8a['options']);var _0x49ac4b={'where':_0x24724d['where']};return db[_0x0067('0x36')]['count'](_0x49ac4b)[_0x0067('0x1c')](function(_0x219587){_0x396205[_0x0067('0x29')]=_0x219587;if(_0x777f8a[_0x0067('0x3a')][_0x0067('0x4a')]){_0x24724d[_0x0067('0x4b')]=[{'all':!![]}];}return db[_0x0067('0x36')]['findAll'](_0x24724d);})[_0x0067('0x1c')](function(_0x64120e){_0x396205[_0x0067('0x4c')]=_0x64120e;return _0x396205;})[_0x0067('0x1c')](respondWithFilteredResult(_0x28a06b,_0x24724d))['catch'](handleError(_0x28a06b,null));};exports[_0x0067('0x4d')]=function(_0x4a45ce,_0x469815){var _0x112d38={'raw':![],'where':{'id':_0x4a45ce['params']['id']}},_0x3f3fe3={};_0x3f3fe3[_0x0067('0x38')]=_[_0x0067('0x39')](db[_0x0067('0x36')][_0x0067('0x37')]);_0x3f3fe3[_0x0067('0x3a')]=_['keys'](_0x4a45ce['query']);_0x3f3fe3[_0x0067('0x3b')]=_[_0x0067('0x3c')](_0x3f3fe3[_0x0067('0x38')],_0x3f3fe3[_0x0067('0x3a')]);_0x112d38['attributes']=_[_0x0067('0x3c')](_0x3f3fe3[_0x0067('0x38')],qs[_0x0067('0x3e')](_0x4a45ce['query']['fields']));_0x112d38['attributes']=_0x112d38[_0x0067('0x3d')][_0x0067('0x4e')]?_0x112d38[_0x0067('0x3d')]:_0x3f3fe3[_0x0067('0x38')];if(_0x4a45ce[_0x0067('0x3a')][_0x0067('0x4a')]){_0x112d38[_0x0067('0x4b')]=[{'all':!![]}];}_0x112d38=_[_0x0067('0x4f')]({},_0x112d38,_0x4a45ce['options']);return db['FreshdeskAccount']['find'](_0x112d38)['then'](handleEntityNotFound(_0x469815,null))[_0x0067('0x1c')](respondWithResult(_0x469815,null))[_0x0067('0x50')](handleError(_0x469815,null));};exports[_0x0067('0x51')]=function(_0x342547,_0xa6c1a8){return db[_0x0067('0x36')][_0x0067('0x51')](_0x342547[_0x0067('0x52')],{})[_0x0067('0x1c')](respondWithResult(_0xa6c1a8,0xc9))[_0x0067('0x50')](handleError(_0xa6c1a8,null));};exports[_0x0067('0x2f')]=function(_0x2475a2,_0x355589){if(_0x2475a2['body']['id']){delete _0x2475a2[_0x0067('0x52')]['id'];}return db[_0x0067('0x36')][_0x0067('0x53')]({'where':{'id':_0x2475a2[_0x0067('0x54')]['id']}})['then'](handleEntityNotFound(_0x355589,null))[_0x0067('0x1c')](saveUpdates(_0x2475a2[_0x0067('0x52')],null))[_0x0067('0x1c')](respondWithResult(_0x355589,null))[_0x0067('0x50')](handleError(_0x355589,null));};exports[_0x0067('0x30')]=function(_0x1e1803,_0x321b1b){return db[_0x0067('0x36')][_0x0067('0x53')]({'where':{'id':_0x1e1803[_0x0067('0x54')]['id']}})[_0x0067('0x1c')](handleEntityNotFound(_0x321b1b,null))[_0x0067('0x1c')](removeEntity(_0x321b1b,null))['catch'](handleError(_0x321b1b,null));};exports[_0x0067('0x55')]=function(_0x5f4564,_0x209869,_0x1cae5c){var _0x2f383a={};var _0x1aad4b={};var _0x247df9;var _0x55e0e6;return db[_0x0067('0x36')][_0x0067('0x56')]({'where':{'id':_0x5f4564[_0x0067('0x54')]['id']}})[_0x0067('0x1c')](handleEntityNotFound(_0x209869,null))[_0x0067('0x1c')](function(_0x412c1f){if(_0x412c1f){_0x247df9=_0x412c1f;_0x1aad4b[_0x0067('0x38')]=_[_0x0067('0x39')](db[_0x0067('0x57')][_0x0067('0x37')]);_0x1aad4b[_0x0067('0x3a')]=_['keys'](_0x5f4564[_0x0067('0x3a')]);_0x1aad4b[_0x0067('0x3b')]=_['intersection'](_0x1aad4b[_0x0067('0x38')],_0x1aad4b[_0x0067('0x3a')]);_0x2f383a['attributes']=_['intersection'](_0x1aad4b[_0x0067('0x38')],qs[_0x0067('0x3e')](_0x5f4564[_0x0067('0x3a')][_0x0067('0x3e')]));_0x2f383a[_0x0067('0x3d')]=_0x2f383a['attributes'][_0x0067('0x4e')]?_0x2f383a[_0x0067('0x3d')]:_0x1aad4b['model'];_0x2f383a['order']=qs[_0x0067('0x43')](_0x5f4564[_0x0067('0x3a')][_0x0067('0x43')]);_0x2f383a['where']=qs[_0x0067('0x3b')](_[_0x0067('0x58')](_0x5f4564[_0x0067('0x3a')],_0x1aad4b[_0x0067('0x3b')]));if(_0x5f4564[_0x0067('0x3a')]['filter']){_0x2f383a[_0x0067('0x44')]=_[_0x0067('0x4f')](_0x2f383a[_0x0067('0x44')],{'$or':_['map'](_0x2f383a[_0x0067('0x3d')],function(_0xca3b8f){var _0x59c959={};_0x59c959[_0xca3b8f]={'$like':'%'+_0x5f4564[_0x0067('0x3a')][_0x0067('0x45')]+'%'};return _0x59c959;})});}_0x2f383a=_['merge']({},_0x2f383a,_0x5f4564[_0x0067('0x59')]);return _0x247df9[_0x0067('0x55')](_0x2f383a);}})[_0x0067('0x1c')](function(_0x14831f){if(_0x14831f){_0x55e0e6=_0x14831f[_0x0067('0x4e')];if(!_0x5f4564[_0x0067('0x3a')][_0x0067('0x3f')]('nolimit')){_0x2f383a['limit']=qs['limit'](_0x5f4564[_0x0067('0x3a')]['limit']);_0x2f383a[_0x0067('0x2a')]=qs[_0x0067('0x2a')](_0x5f4564[_0x0067('0x3a')][_0x0067('0x2a')]);}return _0x247df9['getConfigurations'](_0x2f383a);}})[_0x0067('0x1c')](function(_0x45eb35){if(_0x45eb35){return _0x45eb35?{'count':_0x55e0e6,'rows':_0x45eb35}:null;}})[_0x0067('0x1c')](respondWithResult(_0x209869,null))[_0x0067('0x50')](handleError(_0x209869,null));};exports[_0x0067('0x5a')]=function(_0x3302df,_0x4f7f7f,_0x217899){if(_0x3302df['body']['id']){delete _0x3302df[_0x0067('0x52')]['id'];}return db[_0x0067('0x36')][_0x0067('0x56')]({'where':{'id':_0x3302df[_0x0067('0x54')]['id']}})[_0x0067('0x1c')](handleEntityNotFound(_0x4f7f7f,null))[_0x0067('0x1c')](function(_0x19999f){if(_0x19999f){_0x3302df[_0x0067('0x52')][_0x0067('0x5b')]=_0x19999f['id'];_0x3302df[_0x0067('0x52')]['Subjects']=integrations[_0x0067('0x5c')](_0x3302df[_0x0067('0x52')][_0x0067('0x5d')],_0x3302df[_0x0067('0x52')][_0x0067('0x47')]);_0x3302df[_0x0067('0x52')][_0x0067('0x5e')]=integrations[_0x0067('0x5f')](_0x3302df[_0x0067('0x52')][_0x0067('0x5d')],_0x3302df[_0x0067('0x52')][_0x0067('0x47')]);return db['FreshdeskConfiguration'][_0x0067('0x51')](_0x3302df['body'],{'include':[{'model':db[_0x0067('0x60')],'as':_0x0067('0x61')},{'model':db[_0x0067('0x60')],'as':'Descriptions'}]});}return null;})[_0x0067('0x1c')](respondWithResult(_0x4f7f7f,null))[_0x0067('0x50')](handleError(_0x4f7f7f,null));};exports['getFields']=function(_0x71574c,_0x38087f,_0x536b38){var _0x37fcc2='';return db['FreshdeskAccount'][_0x0067('0x56')]({'where':{'id':_0x71574c[_0x0067('0x54')]['id']},'attributes':['id',_0x0067('0x62'),_0x0067('0x63')]})['then'](handleEntityNotFound(_0x38087f,null))[_0x0067('0x1c')](function(_0x5c6d86){if(_0x5c6d86){_0x37fcc2=_0x5c6d86[_0x0067('0x62')];var _0x187e87=_0x37fcc2[_0x0067('0x64')](-0x1);if(_0x187e87==='/'){_0x37fcc2=_0x37fcc2[_0x0067('0x65')](0x0,_0x37fcc2[_0x0067('0x66')](_0x187e87));}return rp({'method':_0x0067('0x67'),'uri':util[_0x0067('0x68')]('%s/%s',_0x37fcc2,_0x0067('0x69')),'headers':{'Authorization':util[_0x0067('0x68')]('Basic\x20%s',new Buffer(util['format']('%s:X',_0x5c6d86[_0x0067('0x63')]))['toString'](_0x0067('0x6a')))},'json':!![]});}})['then'](function(_0x11cbbc){if(_0x11cbbc){var _0x1f4fac=['requester','subject',_0x0067('0x6b'),'description',_0x0067('0x27'),_0x0067('0x6c'),_0x0067('0x6d'),_0x0067('0x6e'),'ticket_type',_0x0067('0x6d'),_0x0067('0x6f')];_[_0x0067('0x70')](_0x11cbbc,function(_0x1b40f6){return _0x1f4fac['includes'](_0x1b40f6['name'])||!_0x1b40f6[_0x0067('0x71')]&&_0x1b40f6[_0x0067('0x47')]!==_0x0067('0x72')&&_0x1b40f6[_0x0067('0x47')]!==_0x0067('0x73');});return{'count':_0x11cbbc[_0x0067('0x4e')],'rows':_[_0x0067('0x46')](_0x11cbbc,function(_0x3006f3){return{'id':_0x3006f3[_0x0067('0x33')],'name':_0x3006f3[_0x0067('0x74')],'custom':!_0x3006f3[_0x0067('0x71')],'options':_0x3006f3['choices']?_['map'](_0x3006f3[_0x0067('0x75')],function(_0x209451){return{'name':_['capitalize'](_0x209451),'value':_0x209451};}):[]};})};}})[_0x0067('0x1c')](respondWithResult(_0x38087f,null))[_0x0067('0x50')](function(_0x15afc3){var _0x2e6ce8=_0x71574c[_0x0067('0x3a')][_0x0067('0x19')]?0x1f4:_0x15afc3[_0x0067('0x76')]||0x1f4;logger[_0x0067('0x22')]('getFields,\x20%s,\x20%s,\x20%s',_0x0067('0x77'),_0x2e6ce8,JSON[_0x0067('0x21')](_0x15afc3));delete _0x15afc3[_0x0067('0x33')];if(_0x2e6ce8===0x191){_0x2e6ce8=0x190;}_0x38087f['status'](_0x2e6ce8)[_0x0067('0x34')](_0x71574c[_0x0067('0x3a')][_0x0067('0x19')]?{'message':_0x0067('0x78'),'statusCode':_0x15afc3['statusCode']}:_0x15afc3);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 5c47dde..7d91e59 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 _0xb6b1=['path','rimraf','../../config/environment','../../components/integrations/configuration','exports','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xb6b1,0x127));var _0x1b6b=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0xb6b1[_0x270adf];return _0x29eda9;};'use strict';var _=require(_0x1b6b('0x0'));var util=require('util');var logger=require(_0x1b6b('0x1'))(_0x1b6b('0x2'));var moment=require('moment');var BPromise=require(_0x1b6b('0x3'));var rp=require(_0x1b6b('0x4'));var fs=require('fs');var path=require(_0x1b6b('0x5'));var rimraf=require(_0x1b6b('0x6'));var config=require(_0x1b6b('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x1b6b('0x8'));module[_0x1b6b('0x9')]=function(_0x8e332,_0x32f98a){return _0x8e332['define'](_0x1b6b('0xa'),attributes,{'tableName':_0x1b6b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xceed=['rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','FreshdeskAccount','int_freshdesk_accounts','lodash','util','api','moment','request-promise','path'];(function(_0x34ea1c,_0x774616){var _0x18f473=function(_0x2cf160){while(--_0x2cf160){_0x34ea1c['push'](_0x34ea1c['shift']());}};_0x18f473(++_0x774616);}(_0xceed,0x17a));var _0xdcee=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xceed[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0xdcee('0x0'));var util=require(_0xdcee('0x1'));var logger=require('../../config/logger')(_0xdcee('0x2'));var moment=require(_0xdcee('0x3'));var BPromise=require('bluebird');var rp=require(_0xdcee('0x4'));var fs=require('fs');var path=require(_0xdcee('0x5'));var rimraf=require(_0xdcee('0x6'));var config=require(_0xdcee('0x7'));var attributes=require(_0xdcee('0x8'));var integrations=require(_0xdcee('0x9'));module['exports']=function(_0x39f89e,_0x4b347b){return _0x39f89e['define'](_0xdcee('0xa'),attributes,{'tableName':_0xdcee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index a45b759..1d61a82 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 _0x171f=['info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','attributes','limit','include','map','model','stringify','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x345433,_0x1d56af){var _0x35f4a0=function(_0x2440b9){while(--_0x2440b9){_0x345433['push'](_0x345433['shift']());}};_0x35f4a0(++_0x1d56af);}(_0x171f,0xee));var _0xf171=function(_0xe501ff,_0x955b7e){_0xe501ff=_0xe501ff-0x0;var _0x17135d=_0x171f[_0xe501ff];return _0x17135d;};'use strict';var _=require(_0xf171('0x0'));var util=require(_0xf171('0x1'));var moment=require(_0xf171('0x2'));var BPromise=require(_0xf171('0x3'));var rs=require(_0xf171('0x4'));var fs=require('fs');var Redis=require(_0xf171('0x5'));var db=require(_0xf171('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf171('0x7'))(_0xf171('0x8'));var config=require(_0xf171('0x9'));var jayson=require(_0xf171('0xa'));var client=jayson[_0xf171('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x472663,_0x28cddc,_0x417464){return new BPromise(function(_0x14fa71,_0x586948){return client[_0xf171('0xc')](_0x472663,_0x417464)[_0xf171('0xd')](function(_0x2200c8){logger[_0xf171('0xe')](_0xf171('0xf'),_0x28cddc,'request\x20sent');logger[_0xf171('0x10')](_0xf171('0x11'),_0x28cddc,'request\x20sent',JSON['stringify'](_0x2200c8));if(_0x2200c8[_0xf171('0x12')]){if(_0x2200c8[_0xf171('0x12')][_0xf171('0x13')]===0x1f4){logger['error'](_0xf171('0xf'),_0x28cddc,_0x2200c8[_0xf171('0x12')]['message']);return _0x586948(_0x2200c8[_0xf171('0x12')][_0xf171('0x14')]);}logger[_0xf171('0x12')](_0xf171('0xf'),_0x28cddc,_0x2200c8['error'][_0xf171('0x14')]);return _0x14fa71(_0x2200c8[_0xf171('0x12')][_0xf171('0x14')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x28cddc,'request\x20sent');_0x14fa71(_0x2200c8[_0xf171('0x15')][_0xf171('0x14')]);}})[_0xf171('0x16')](function(_0x54e67d){logger['error'](_0xf171('0xf'),_0x28cddc,_0x54e67d);_0x586948(_0x54e67d);});});}exports[_0xf171('0x17')]=function(_0x15af6f){var _0x33c5c7=this;return new Promise(function(_0x302766,_0x2d575d){return db[_0xf171('0x18')]['findAll']({'raw':_0x15af6f[_0xf171('0x19')]?_0x15af6f['options'][_0xf171('0x1a')]===undefined?!![]:![]:!![],'where':_0x15af6f['options']?_0x15af6f[_0xf171('0x19')][_0xf171('0x1b')]||null:null,'attributes':_0x15af6f[_0xf171('0x19')]?_0x15af6f['options'][_0xf171('0x1c')]||null:null,'limit':_0x15af6f[_0xf171('0x19')]?_0x15af6f[_0xf171('0x19')][_0xf171('0x1d')]||null:null,'include':_0x15af6f[_0xf171('0x19')]?_0x15af6f[_0xf171('0x19')][_0xf171('0x1e')]?_[_0xf171('0x1f')](_0x15af6f['options'][_0xf171('0x1e')],function(_0x564237){return{'model':db[_0x564237['model']],'as':_0x564237['as'],'attributes':_0x564237[_0xf171('0x1c')],'include':_0x564237['include']?_[_0xf171('0x1f')](_0x564237['include'],function(_0x137e2f){return{'model':db[_0x137e2f[_0xf171('0x20')]],'as':_0x137e2f['as'],'attributes':_0x137e2f[_0xf171('0x1c')],'include':_0x137e2f[_0xf171('0x1e')]?_[_0xf171('0x1f')](_0x137e2f[_0xf171('0x1e')],function(_0x4cfc15){return{'model':db[_0x4cfc15['model']],'as':_0x4cfc15['as'],'attributes':_0x4cfc15[_0xf171('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf171('0xd')](function(_0xf66482){logger[_0xf171('0xe')](_0xf171('0x17'),_0x15af6f);logger[_0xf171('0x10')]('GetFreshdeskAccount',_0x15af6f,JSON[_0xf171('0x21')](_0xf66482));_0x302766(_0xf66482);})[_0xf171('0x16')](function(_0x336d31){logger[_0xf171('0x12')](_0xf171('0x17'),_0x336d31[_0xf171('0x14')],_0x15af6f);_0x2d575d(_0x33c5c7[_0xf171('0x12')](0x1f4,_0x336d31[_0xf171('0x14')]));});});};exports[_0xf171('0x22')]=function(_0x44c32a){var _0x563561=this;return new Promise(function(_0x22c2cb,_0x547eba){return db['FreshdeskAccount'][_0xf171('0x23')]({'raw':_0x44c32a[_0xf171('0x19')]?_0x44c32a[_0xf171('0x19')][_0xf171('0x1a')]===undefined?!![]:![]:!![],'where':_0x44c32a['options']?_0x44c32a[_0xf171('0x19')][_0xf171('0x1b')]||null:null,'attributes':_0x44c32a[_0xf171('0x19')]?_0x44c32a[_0xf171('0x19')]['attributes']||null:null,'include':_0x44c32a[_0xf171('0x19')]?_0x44c32a['options'][_0xf171('0x1e')]?_[_0xf171('0x1f')](_0x44c32a[_0xf171('0x19')][_0xf171('0x1e')],function(_0x597880){return{'model':db[_0x597880[_0xf171('0x20')]],'as':_0x597880['as'],'attributes':_0x597880[_0xf171('0x1c')],'include':_0x597880[_0xf171('0x1e')]?_[_0xf171('0x1f')](_0x597880[_0xf171('0x1e')],function(_0x58f896){return{'model':db[_0x58f896['model']],'as':_0x58f896['as'],'attributes':_0x58f896[_0xf171('0x1c')],'include':_0x58f896[_0xf171('0x1e')]?_[_0xf171('0x1f')](_0x58f896[_0xf171('0x1e')],function(_0x5f4611){return{'model':db[_0x5f4611['model']],'as':_0x5f4611['as'],'attributes':_0x5f4611[_0xf171('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x55f64a){logger[_0xf171('0xe')](_0xf171('0x22'),_0x44c32a);logger['debug'](_0xf171('0x22'),_0x44c32a,JSON[_0xf171('0x21')](_0x55f64a));_0x22c2cb(_0x55f64a);})[_0xf171('0x16')](function(_0x2f9e2d){logger[_0xf171('0x12')](_0xf171('0x22'),_0x2f9e2d['message'],_0x44c32a);_0x547eba(_0x563561[_0xf171('0x12')](0x1f4,_0x2f9e2d[_0xf171('0x14')]));});});}; \ No newline at end of file +var _0x3c74=['request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','attributes','limit','map','include','model','then','stringify','ShowFreshdeskAccount','find','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','FreshdeskAccount,\x20%s,\x20%s'];(function(_0x295d23,_0x5db7b0){var _0x34272a=function(_0x2860cc){while(--_0x2860cc){_0x295d23['push'](_0x295d23['shift']());}};_0x34272a(++_0x5db7b0);}(_0x3c74,0xc5));var _0x43c7=function(_0x2781ee,_0x4c2b0f){_0x2781ee=_0x2781ee-0x0;var _0x55497a=_0x3c74[_0x2781ee];return _0x55497a;};'use strict';var _=require(_0x43c7('0x0'));var util=require(_0x43c7('0x1'));var moment=require('moment');var BPromise=require(_0x43c7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43c7('0x3'));var db=require(_0x43c7('0x4'))['db'];var utils=require(_0x43c7('0x5'));var logger=require('../../config/logger')(_0x43c7('0x6'));var config=require(_0x43c7('0x7'));var jayson=require(_0x43c7('0x8'));var client=jayson[_0x43c7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d1fe8,_0x400d18,_0x3ebffc){return new BPromise(function(_0x475692,_0x148ed8){return client[_0x43c7('0xa')](_0x2d1fe8,_0x3ebffc)['then'](function(_0x5ec57f){logger[_0x43c7('0xb')](_0x43c7('0xc'),_0x400d18,_0x43c7('0xd'));logger[_0x43c7('0xe')](_0x43c7('0xf'),_0x400d18,_0x43c7('0xd'),JSON['stringify'](_0x5ec57f));if(_0x5ec57f[_0x43c7('0x10')]){if(_0x5ec57f['error'][_0x43c7('0x11')]===0x1f4){logger[_0x43c7('0x10')](_0x43c7('0xc'),_0x400d18,_0x5ec57f['error'][_0x43c7('0x12')]);return _0x148ed8(_0x5ec57f['error'][_0x43c7('0x12')]);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x400d18,_0x5ec57f[_0x43c7('0x10')][_0x43c7('0x12')]);return _0x475692(_0x5ec57f[_0x43c7('0x10')][_0x43c7('0x12')]);}else{logger[_0x43c7('0xb')](_0x43c7('0xc'),_0x400d18,_0x43c7('0xd'));_0x475692(_0x5ec57f['result'][_0x43c7('0x12')]);}})[_0x43c7('0x13')](function(_0x506e83){logger[_0x43c7('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x400d18,_0x506e83);_0x148ed8(_0x506e83);});});}exports[_0x43c7('0x14')]=function(_0xa19010){var _0x2e6529=this;return new Promise(function(_0x1e615e,_0x52af47){return db[_0x43c7('0x15')][_0x43c7('0x16')]({'raw':_0xa19010[_0x43c7('0x17')]?_0xa19010[_0x43c7('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xa19010[_0x43c7('0x17')]?_0xa19010[_0x43c7('0x17')][_0x43c7('0x18')]||null:null,'attributes':_0xa19010[_0x43c7('0x17')]?_0xa19010[_0x43c7('0x17')][_0x43c7('0x19')]||null:null,'limit':_0xa19010[_0x43c7('0x17')]?_0xa19010[_0x43c7('0x17')][_0x43c7('0x1a')]||null:null,'include':_0xa19010['options']?_0xa19010[_0x43c7('0x17')]['include']?_[_0x43c7('0x1b')](_0xa19010['options'][_0x43c7('0x1c')],function(_0x5b5b68){return{'model':db[_0x5b5b68[_0x43c7('0x1d')]],'as':_0x5b5b68['as'],'attributes':_0x5b5b68[_0x43c7('0x19')],'include':_0x5b5b68['include']?_['map'](_0x5b5b68[_0x43c7('0x1c')],function(_0x4d3f03){return{'model':db[_0x4d3f03[_0x43c7('0x1d')]],'as':_0x4d3f03['as'],'attributes':_0x4d3f03[_0x43c7('0x19')],'include':_0x4d3f03['include']?_[_0x43c7('0x1b')](_0x4d3f03[_0x43c7('0x1c')],function(_0x352ff5){return{'model':db[_0x352ff5[_0x43c7('0x1d')]],'as':_0x352ff5['as'],'attributes':_0x352ff5['attributes']};}):[]};}):[]};}):[]:[]})[_0x43c7('0x1e')](function(_0x1469d2){logger[_0x43c7('0xb')](_0x43c7('0x14'),_0xa19010);logger['debug'](_0x43c7('0x14'),_0xa19010,JSON[_0x43c7('0x1f')](_0x1469d2));_0x1e615e(_0x1469d2);})[_0x43c7('0x13')](function(_0x5330ca){logger[_0x43c7('0x10')](_0x43c7('0x14'),_0x5330ca[_0x43c7('0x12')],_0xa19010);_0x52af47(_0x2e6529[_0x43c7('0x10')](0x1f4,_0x5330ca[_0x43c7('0x12')]));});});};exports[_0x43c7('0x20')]=function(_0x1db444){var _0x1779e5=this;return new Promise(function(_0x4763ca,_0x31e06f){return db[_0x43c7('0x15')][_0x43c7('0x21')]({'raw':_0x1db444[_0x43c7('0x17')]?_0x1db444[_0x43c7('0x17')][_0x43c7('0x22')]===undefined?!![]:![]:!![],'where':_0x1db444[_0x43c7('0x17')]?_0x1db444[_0x43c7('0x17')][_0x43c7('0x18')]||null:null,'attributes':_0x1db444[_0x43c7('0x17')]?_0x1db444[_0x43c7('0x17')][_0x43c7('0x19')]||null:null,'include':_0x1db444['options']?_0x1db444[_0x43c7('0x17')][_0x43c7('0x1c')]?_[_0x43c7('0x1b')](_0x1db444[_0x43c7('0x17')]['include'],function(_0x55e5ad){return{'model':db[_0x55e5ad[_0x43c7('0x1d')]],'as':_0x55e5ad['as'],'attributes':_0x55e5ad['attributes'],'include':_0x55e5ad[_0x43c7('0x1c')]?_[_0x43c7('0x1b')](_0x55e5ad['include'],function(_0x41d30e){return{'model':db[_0x41d30e[_0x43c7('0x1d')]],'as':_0x41d30e['as'],'attributes':_0x41d30e['attributes'],'include':_0x41d30e[_0x43c7('0x1c')]?_[_0x43c7('0x1b')](_0x41d30e[_0x43c7('0x1c')],function(_0x43b07){return{'model':db[_0x43b07[_0x43c7('0x1d')]],'as':_0x43b07['as'],'attributes':_0x43b07['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x32d5e3){logger['info'](_0x43c7('0x20'),_0x1db444);logger[_0x43c7('0xe')](_0x43c7('0x20'),_0x1db444,JSON[_0x43c7('0x1f')](_0x32d5e3));_0x4763ca(_0x32d5e3);})[_0x43c7('0x13')](function(_0x100dd9){logger[_0x43c7('0x10')](_0x43c7('0x20'),_0x100dd9['message'],_0x1db444);_0x31e06f(_0x1779e5[_0x43c7('0x10')](0x1f4,_0x100dd9[_0x43c7('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 0dd4c0c..cf36abd 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 _0x6b8f=['put','update','destroy','exports','util','connect-timeout','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','setTags'];(function(_0x1f90e1,_0x52ff56){var _0x5eac3a=function(_0xcfa3){while(--_0xcfa3){_0x1f90e1['push'](_0x1f90e1['shift']());}};_0x5eac3a(++_0x52ff56);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x2ef06f,_0x943828){_0x2ef06f=_0x2ef06f-0x0;var _0x42c420=_0x6b8f[_0x2ef06f];return _0x42c420;};'use strict';var multer=require('multer');var util=require(_0xf6b8('0x0'));var path=require('path');var timeout=require(_0xf6b8('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xf6b8('0x2'));var interaction=require(_0xf6b8('0x3'));var config=require('../../config/environment');var controller=require(_0xf6b8('0x4'));router[_0xf6b8('0x5')]('/',auth[_0xf6b8('0x6')](),controller['index']);router[_0xf6b8('0x5')](_0xf6b8('0x7'),auth[_0xf6b8('0x6')](),controller[_0xf6b8('0x8')]);router['get']('/:id/fields',auth[_0xf6b8('0x6')](),controller['getFields']);router[_0xf6b8('0x5')](_0xf6b8('0x9'),auth[_0xf6b8('0x6')](),controller[_0xf6b8('0xa')]);router[_0xf6b8('0x5')](_0xf6b8('0xb'),auth['isAuthenticated'](),controller['getDescriptions']);router['get'](_0xf6b8('0xc'),auth[_0xf6b8('0x6')](),controller[_0xf6b8('0xd')]);router[_0xf6b8('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf6b8('0xe')](_0xf6b8('0xc'),auth['isAuthenticated'](),controller[_0xf6b8('0xf')]);router[_0xf6b8('0x10')](_0xf6b8('0x7'),auth['isAuthenticated'](),controller[_0xf6b8('0x11')]);router['delete'](_0xf6b8('0x7'),auth[_0xf6b8('0x6')](),controller[_0xf6b8('0x12')]);module[_0xf6b8('0x13')]=router; \ No newline at end of file +var _0xed1f=['show','getFields','/:id/subjects','getDescriptions','getTags','/:id/tags','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x388ce5,_0xabc88c){var _0x42df10=function(_0x44671b){while(--_0x44671b){_0x388ce5['push'](_0x388ce5['shift']());}};_0x42df10(++_0xabc88c);}(_0xed1f,0x6a));var _0xfed1=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xed1f[_0x1deb03];return _0x189fe7;};'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/fields',auth[_0xfed1('0xb')](),controller[_0xfed1('0xf')]);router['get'](_0xfed1('0x10'),auth[_0xfed1('0xb')](),controller['getSubjects']);router[_0xfed1('0xa')]('/:id/descriptions',auth[_0xfed1('0xb')](),controller[_0xfed1('0x11')]);router['get']('/:id/tags',auth[_0xfed1('0xb')](),controller[_0xfed1('0x12')]);router['post']('/',auth[_0xfed1('0xb')](),controller['create']);router['post'](_0xfed1('0x13'),auth[_0xfed1('0xb')](),controller['setTags']);router[_0xfed1('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xfed1('0x15')]);router[_0xfed1('0x16')](_0xfed1('0xd'),auth[_0xfed1('0xb')](),controller['destroy']);module[_0xfed1('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 45dc97c..bdd88db 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 _0x7ba0=['exports','STRING','sequelize'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x7ba0,0xda));var _0x07ba=function(_0x1cc70b,_0xe34d7d){_0x1cc70b=_0x1cc70b-0x0;var _0x5073e3=_0x7ba0[_0x1cc70b];return _0x5073e3;};'use strict';var Sequelize=require(_0x07ba('0x0'));module[_0x07ba('0x1')]={'name':{'type':Sequelize[_0x07ba('0x2')]},'description':{'type':Sequelize[_0x07ba('0x2')]}}; \ No newline at end of file +var _0x172d=['sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x172d,0xbd));var _0xd172=function(_0x6b8e6,_0x5b5b8d){_0x6b8e6=_0x6b8e6-0x0;var _0x11e8d9=_0x172d[_0x6b8e6];return _0x11e8d9;};'use strict';var Sequelize=require(_0xd172('0x0'));module[_0xd172('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd172('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index be21c43..dc8a0a4 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 _0xa5d7=['ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','catch','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','stack','name','index','FreshdeskConfiguration','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','map','type','VIRTUAL','field','options','includeAll','findAll','rows','show','params','create','body','destroy','find','findOne','FreshdeskField','pick','getFields','hasOwnProperty','getSubjects','getDescriptions','Tag','getTags','setTags','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv'];(function(_0x2544f1,_0xb653af){var _0x3cab4f=function(_0x5e535c){while(--_0x5e535c){_0x2544f1['push'](_0x2544f1['shift']());}};_0x3cab4f(++_0xb653af);}(_0xa5d7,0x1c3));var _0x7a5d=function(_0x1330c2,_0x27a429){_0x1330c2=_0x1330c2-0x0;var _0x170285=_0xa5d7[_0x1330c2];return _0x170285;};'use strict';var pdf=require(_0x7a5d('0x0'));var emlformat=require(_0x7a5d('0x1'));var rimraf=require(_0x7a5d('0x2'));var zipdir=require(_0x7a5d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7a5d('0x4'));var moment=require('moment');var BPromise=require(_0x7a5d('0x5'));var Mustache=require('mustache');var util=require(_0x7a5d('0x6'));var path=require('path');var sox=require(_0x7a5d('0x7'));var csv=require(_0x7a5d('0x8'));var ejs=require(_0x7a5d('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7a5d('0xa'));var crypto=require(_0x7a5d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7a5d('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7a5d('0xd'));var Papa=require(_0x7a5d('0xe'));var Redis=require(_0x7a5d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7a5d('0x10'));var hardwareService=require(_0x7a5d('0x11'));var logger=require(_0x7a5d('0x12'))(_0x7a5d('0x13'));var utils=require(_0x7a5d('0x14'));var config=require(_0x7a5d('0x15'));var db=require(_0x7a5d('0x16'))['db'];var jayson=require(_0x7a5d('0x17'));var client=jayson[_0x7a5d('0x18')][_0x7a5d('0x19')]({'port':0x232a});function checkPasswordPattern(_0x3a3344,_0x40b7e4,_0x4f8584){if(_0x4f8584){var _0x5e50f0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e50f0[_0x7a5d('0x1a')](_0x40b7e4)){return _0x3a3344;}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 _0x3a3344;}}function respondWithRpcPromise(_0x1e6179,_0x15a440,_0x18edf4,_0x1650c7){return new BPromise(function(_0xd9d560,_0x342f63){var _0x50070a=_0x1650c7||client;return _0x50070a[_0x7a5d('0x1b')](_0x1e6179,_0x18edf4)[_0x7a5d('0x1c')](function(_0xaca430){logger[_0x7a5d('0x1d')](_0x7a5d('0x1e'),_0x15a440,'request\x20sent');logger[_0x7a5d('0x1f')](_0x7a5d('0x20'),_0x15a440,'request\x20sent',JSON['stringify'](_0xaca430));if(_0xaca430[_0x7a5d('0x21')]){if(_0xaca430[_0x7a5d('0x21')]['code']===0x1f4){logger[_0x7a5d('0x21')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x15a440,_0xaca430[_0x7a5d('0x21')]['message']);return _0x342f63(_0xaca430[_0x7a5d('0x21')][_0x7a5d('0x22')]);}logger['error'](_0x7a5d('0x1e'),_0x15a440,_0xaca430['error'][_0x7a5d('0x22')]);return _0xd9d560(_0xaca430['error']['message']);}else{logger[_0x7a5d('0x1d')](_0x7a5d('0x1e'),_0x15a440,_0x7a5d('0x23'));_0xd9d560(_0xaca430['result'][_0x7a5d('0x22')]);}})[_0x7a5d('0x24')](function(_0x1bd069){logger['error'](_0x7a5d('0x1e'),_0x15a440,_0x1bd069);_0x342f63(_0x1bd069);});});}function respondWithStatusCode(_0x512831,_0x476cd2){_0x476cd2=_0x476cd2||0xcc;return function(_0x393069){if(_0x393069){return _0x512831[_0x7a5d('0x25')](_0x476cd2);}return _0x512831[_0x7a5d('0x26')](_0x476cd2)[_0x7a5d('0x27')]();};}function respondWithResult(_0x65cc6f,_0x58d59c){_0x58d59c=_0x58d59c||0xc8;return function(_0x5556bc){if(_0x5556bc){return _0x65cc6f[_0x7a5d('0x26')](_0x58d59c)['json'](_0x5556bc);}};}function respondWithFilteredResult(_0x1c33f5,_0x431fe9){return function(_0x2b1f0b){if(_0x2b1f0b){var _0x72bedd=_0x2b1f0b[_0x7a5d('0x28')],_0x5c89c8=_0x431fe9[_0x7a5d('0x29')],_0x1055b8=_0x431fe9[_0x7a5d('0x29')]+_0x431fe9[_0x7a5d('0x2a')],_0x2f922d;if(_0x1055b8>=_0x72bedd){_0x1055b8=_0x72bedd;_0x2f922d=0xc8;}else{_0x2f922d=0xce;}_0x1c33f5[_0x7a5d('0x26')](_0x2f922d);return _0x1c33f5[_0x7a5d('0x2b')]('Content-Range',_0x5c89c8+'-'+_0x1055b8+'/'+_0x72bedd)[_0x7a5d('0x2c')](_0x2b1f0b);}return null;};}function patchUpdates(_0x10394a){return function(_0x263f61){try{jsonpatch[_0x7a5d('0x2d')](_0x263f61,_0x10394a,!![]);}catch(_0x46d2d7){return BPromise[_0x7a5d('0x2e')](_0x46d2d7);}return _0x263f61[_0x7a5d('0x2f')]();};}function saveUpdates(_0x33f617,_0x3d70fc){return function(_0x32778d){if(_0x32778d){return _0x32778d[_0x7a5d('0x30')](_0x33f617)[_0x7a5d('0x1c')](function(_0x76b29c){return _0x76b29c;});}return null;};}function removeEntity(_0x6a9295,_0x58c177){return function(_0x407f6e){if(_0x407f6e){return _0x407f6e['destroy']()[_0x7a5d('0x1c')](function(){_0x6a9295[_0x7a5d('0x26')](0xcc)[_0x7a5d('0x27')]();});}};}function handleEntityNotFound(_0x5ac2b2,_0x2f172a){return function(_0x1251ab){if(!_0x1251ab){_0x5ac2b2[_0x7a5d('0x25')](0x194);}return _0x1251ab;};}function handleError(_0x1966c2,_0x53789d){_0x53789d=_0x53789d||0x1f4;return function(_0x17d017){logger[_0x7a5d('0x21')](_0x17d017[_0x7a5d('0x31')]);if(_0x17d017[_0x7a5d('0x32')]){delete _0x17d017[_0x7a5d('0x32')];}_0x1966c2[_0x7a5d('0x26')](_0x53789d)['send'](_0x17d017);};}exports[_0x7a5d('0x33')]=function(_0x2f9b24,_0x2cb7a5){var _0x564509={},_0x47e7c0={},_0x2b5edf={'count':0x0,'rows':[]};var _0x2a0204=db[_0x7a5d('0x34')][_0x7a5d('0x35')];_0x47e7c0[_0x7a5d('0x36')]=_[_0x7a5d('0x37')](_0x2a0204);_0x47e7c0[_0x7a5d('0x38')]=_[_0x7a5d('0x37')](_0x2f9b24[_0x7a5d('0x38')]);_0x47e7c0[_0x7a5d('0x39')]=_[_0x7a5d('0x3a')](_0x47e7c0[_0x7a5d('0x36')],_0x47e7c0[_0x7a5d('0x38')]);_0x564509['attributes']=_[_0x7a5d('0x3a')](_0x47e7c0[_0x7a5d('0x36')],qs[_0x7a5d('0x3b')](_0x2f9b24[_0x7a5d('0x38')][_0x7a5d('0x3b')]));_0x564509[_0x7a5d('0x3c')]=_0x564509[_0x7a5d('0x3c')][_0x7a5d('0x3d')]?_0x564509[_0x7a5d('0x3c')]:_0x47e7c0['model'];if(!_0x2f9b24[_0x7a5d('0x38')]['hasOwnProperty'](_0x7a5d('0x3e'))){_0x564509['limit']=qs[_0x7a5d('0x2a')](_0x2f9b24[_0x7a5d('0x38')][_0x7a5d('0x2a')]);_0x564509['offset']=qs[_0x7a5d('0x29')](_0x2f9b24['query']['offset']);}_0x564509[_0x7a5d('0x3f')]=qs[_0x7a5d('0x40')](_0x2f9b24['query'][_0x7a5d('0x40')]);_0x564509[_0x7a5d('0x41')]=qs[_0x7a5d('0x39')](_['pick'](_0x2f9b24[_0x7a5d('0x38')],_0x47e7c0[_0x7a5d('0x39')]));if(_0x2f9b24['query'][_0x7a5d('0x42')]){_0x564509[_0x7a5d('0x41')]=_[_0x7a5d('0x43')](_0x564509[_0x7a5d('0x41')],{'$or':_[_0x7a5d('0x44')](_0x2a0204,function(_0x3bf875){if(_0x3bf875[_0x7a5d('0x45')]['key']!==_0x7a5d('0x46')){var _0x425381={};_0x425381[_0x3bf875[_0x7a5d('0x47')]]={'$like':'%'+_0x2f9b24[_0x7a5d('0x38')][_0x7a5d('0x42')]+'%'};return _0x425381;}})});}_0x564509=_[_0x7a5d('0x43')]({},_0x564509,_0x2f9b24[_0x7a5d('0x48')]);var _0x2cf395={'where':_0x564509[_0x7a5d('0x41')]};return db['FreshdeskConfiguration'][_0x7a5d('0x28')](_0x2cf395)[_0x7a5d('0x1c')](function(_0x1c5a05){_0x2b5edf[_0x7a5d('0x28')]=_0x1c5a05;if(_0x2f9b24[_0x7a5d('0x38')][_0x7a5d('0x49')]){_0x564509['include']=[{'all':!![]}];}return db[_0x7a5d('0x34')][_0x7a5d('0x4a')](_0x564509);})[_0x7a5d('0x1c')](function(_0x5231ef){_0x2b5edf[_0x7a5d('0x4b')]=_0x5231ef;return _0x2b5edf;})[_0x7a5d('0x1c')](respondWithFilteredResult(_0x2cb7a5,_0x564509))['catch'](handleError(_0x2cb7a5,null));};exports[_0x7a5d('0x4c')]=function(_0x3d0a2f,_0x496193){var _0x4584bc={'raw':![],'where':{'id':_0x3d0a2f[_0x7a5d('0x4d')]['id']}},_0x5800e7={};_0x5800e7[_0x7a5d('0x36')]=_['keys'](db[_0x7a5d('0x34')]['rawAttributes']);_0x5800e7[_0x7a5d('0x38')]=_[_0x7a5d('0x37')](_0x3d0a2f[_0x7a5d('0x38')]);_0x5800e7[_0x7a5d('0x39')]=_[_0x7a5d('0x3a')](_0x5800e7[_0x7a5d('0x36')],_0x5800e7[_0x7a5d('0x38')]);_0x4584bc[_0x7a5d('0x3c')]=_['intersection'](_0x5800e7[_0x7a5d('0x36')],qs[_0x7a5d('0x3b')](_0x3d0a2f[_0x7a5d('0x38')][_0x7a5d('0x3b')]));_0x4584bc['attributes']=_0x4584bc[_0x7a5d('0x3c')][_0x7a5d('0x3d')]?_0x4584bc[_0x7a5d('0x3c')]:_0x5800e7[_0x7a5d('0x36')];if(_0x3d0a2f['query'][_0x7a5d('0x49')]){_0x4584bc['include']=[{'all':!![]}];}_0x4584bc=_[_0x7a5d('0x43')]({},_0x4584bc,_0x3d0a2f[_0x7a5d('0x48')]);return db['FreshdeskConfiguration']['find'](_0x4584bc)[_0x7a5d('0x1c')](handleEntityNotFound(_0x496193,null))[_0x7a5d('0x1c')](respondWithResult(_0x496193,null))[_0x7a5d('0x24')](handleError(_0x496193,null));};exports[_0x7a5d('0x4e')]=function(_0x354939,_0x50f589){return db[_0x7a5d('0x34')][_0x7a5d('0x4e')](_0x354939[_0x7a5d('0x4f')],{})[_0x7a5d('0x1c')](respondWithResult(_0x50f589,0xc9))[_0x7a5d('0x24')](handleError(_0x50f589,null));};exports[_0x7a5d('0x30')]=function(_0x13f598,_0x1c60aa){if(_0x13f598[_0x7a5d('0x4f')]['id']){delete _0x13f598[_0x7a5d('0x4f')]['id'];}return db['FreshdeskConfiguration']['find']({'where':{'id':_0x13f598[_0x7a5d('0x4d')]['id']}})[_0x7a5d('0x1c')](handleEntityNotFound(_0x1c60aa,null))['then'](saveUpdates(_0x13f598[_0x7a5d('0x4f')],null))[_0x7a5d('0x1c')](respondWithResult(_0x1c60aa,null))[_0x7a5d('0x24')](handleError(_0x1c60aa,null));};exports[_0x7a5d('0x50')]=function(_0x3c91d2,_0x1d62e8){return db['FreshdeskConfiguration'][_0x7a5d('0x51')]({'where':{'id':_0x3c91d2[_0x7a5d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1d62e8,null))[_0x7a5d('0x1c')](removeEntity(_0x1d62e8,null))[_0x7a5d('0x24')](handleError(_0x1d62e8,null));};exports['getFields']=function(_0x290459,_0x4cfeef,_0x500692){var _0x4b88e3={};var _0xb96b90={};var _0x2768cf;var _0x413f68;return db['FreshdeskConfiguration'][_0x7a5d('0x52')]({'where':{'id':_0x290459[_0x7a5d('0x4d')]['id']}})[_0x7a5d('0x1c')](handleEntityNotFound(_0x4cfeef,null))[_0x7a5d('0x1c')](function(_0x54a6a7){if(_0x54a6a7){_0x2768cf=_0x54a6a7;_0xb96b90['model']=_[_0x7a5d('0x37')](db[_0x7a5d('0x53')][_0x7a5d('0x35')]);_0xb96b90[_0x7a5d('0x38')]=_[_0x7a5d('0x37')](_0x290459[_0x7a5d('0x38')]);_0xb96b90['filters']=_[_0x7a5d('0x3a')](_0xb96b90[_0x7a5d('0x36')],_0xb96b90[_0x7a5d('0x38')]);_0x4b88e3[_0x7a5d('0x3c')]=_[_0x7a5d('0x3a')](_0xb96b90['model'],qs[_0x7a5d('0x3b')](_0x290459['query'][_0x7a5d('0x3b')]));_0x4b88e3['attributes']=_0x4b88e3['attributes'][_0x7a5d('0x3d')]?_0x4b88e3[_0x7a5d('0x3c')]:_0xb96b90[_0x7a5d('0x36')];_0x4b88e3[_0x7a5d('0x3f')]=qs['sort'](_0x290459[_0x7a5d('0x38')]['sort']);_0x4b88e3['where']=qs[_0x7a5d('0x39')](_[_0x7a5d('0x54')](_0x290459['query'],_0xb96b90[_0x7a5d('0x39')]));if(_0x290459['query'][_0x7a5d('0x42')]){_0x4b88e3['where']=_['merge'](_0x4b88e3['where'],{'$or':_[_0x7a5d('0x44')](_0x4b88e3['attributes'],function(_0xeb9616){var _0x70bad1={};_0x70bad1[_0xeb9616]={'$like':'%'+_0x290459[_0x7a5d('0x38')]['filter']+'%'};return _0x70bad1;})});}_0x4b88e3=_[_0x7a5d('0x43')]({},_0x4b88e3,_0x290459[_0x7a5d('0x48')]);return _0x2768cf[_0x7a5d('0x55')](_0x4b88e3);}})[_0x7a5d('0x1c')](function(_0x4b90df){if(_0x4b90df){_0x413f68=_0x4b90df[_0x7a5d('0x3d')];if(!_0x290459[_0x7a5d('0x38')][_0x7a5d('0x56')](_0x7a5d('0x3e'))){_0x4b88e3[_0x7a5d('0x2a')]=qs[_0x7a5d('0x2a')](_0x290459[_0x7a5d('0x38')][_0x7a5d('0x2a')]);_0x4b88e3[_0x7a5d('0x29')]=qs[_0x7a5d('0x29')](_0x290459[_0x7a5d('0x38')][_0x7a5d('0x29')]);}return _0x2768cf[_0x7a5d('0x55')](_0x4b88e3);}})[_0x7a5d('0x1c')](function(_0x2ff2d2){if(_0x2ff2d2){return _0x2ff2d2?{'count':_0x413f68,'rows':_0x2ff2d2}:null;}})[_0x7a5d('0x1c')](respondWithResult(_0x4cfeef,null))[_0x7a5d('0x24')](handleError(_0x4cfeef,null));};exports[_0x7a5d('0x57')]=function(_0x37c3fe,_0x2f4a98,_0x59f50d){var _0x3ecece={};var _0x26c3e2={};var _0x56b5bc;var _0x1725f0;return db[_0x7a5d('0x34')][_0x7a5d('0x52')]({'where':{'id':_0x37c3fe[_0x7a5d('0x4d')]['id']}})[_0x7a5d('0x1c')](handleEntityNotFound(_0x2f4a98,null))[_0x7a5d('0x1c')](function(_0x549a1){if(_0x549a1){_0x56b5bc=_0x549a1;_0x26c3e2['model']=_[_0x7a5d('0x37')](db[_0x7a5d('0x53')][_0x7a5d('0x35')]);_0x26c3e2[_0x7a5d('0x38')]=_[_0x7a5d('0x37')](_0x37c3fe[_0x7a5d('0x38')]);_0x26c3e2[_0x7a5d('0x39')]=_['intersection'](_0x26c3e2['model'],_0x26c3e2[_0x7a5d('0x38')]);_0x3ecece[_0x7a5d('0x3c')]=_[_0x7a5d('0x3a')](_0x26c3e2[_0x7a5d('0x36')],qs['fields'](_0x37c3fe[_0x7a5d('0x38')]['fields']));_0x3ecece['attributes']=_0x3ecece[_0x7a5d('0x3c')][_0x7a5d('0x3d')]?_0x3ecece['attributes']:_0x26c3e2[_0x7a5d('0x36')];_0x3ecece['order']=qs[_0x7a5d('0x40')](_0x37c3fe[_0x7a5d('0x38')][_0x7a5d('0x40')]);_0x3ecece[_0x7a5d('0x41')]=qs[_0x7a5d('0x39')](_['pick'](_0x37c3fe['query'],_0x26c3e2[_0x7a5d('0x39')]));if(_0x37c3fe['query'][_0x7a5d('0x42')]){_0x3ecece[_0x7a5d('0x41')]=_['merge'](_0x3ecece[_0x7a5d('0x41')],{'$or':_[_0x7a5d('0x44')](_0x3ecece[_0x7a5d('0x3c')],function(_0x4f83b3){var _0x5b7283={};_0x5b7283[_0x4f83b3]={'$like':'%'+_0x37c3fe['query']['filter']+'%'};return _0x5b7283;})});}_0x3ecece=_[_0x7a5d('0x43')]({},_0x3ecece,_0x37c3fe[_0x7a5d('0x48')]);return _0x56b5bc[_0x7a5d('0x57')](_0x3ecece);}})['then'](function(_0x2e6bf3){if(_0x2e6bf3){_0x1725f0=_0x2e6bf3[_0x7a5d('0x3d')];if(!_0x37c3fe[_0x7a5d('0x38')][_0x7a5d('0x56')](_0x7a5d('0x3e'))){_0x3ecece['limit']=qs[_0x7a5d('0x2a')](_0x37c3fe[_0x7a5d('0x38')][_0x7a5d('0x2a')]);_0x3ecece[_0x7a5d('0x29')]=qs[_0x7a5d('0x29')](_0x37c3fe[_0x7a5d('0x38')]['offset']);}return _0x56b5bc[_0x7a5d('0x57')](_0x3ecece);}})['then'](function(_0x5a2840){if(_0x5a2840){return _0x5a2840?{'count':_0x1725f0,'rows':_0x5a2840}:null;}})[_0x7a5d('0x1c')](respondWithResult(_0x2f4a98,null))[_0x7a5d('0x24')](handleError(_0x2f4a98,null));};exports[_0x7a5d('0x58')]=function(_0x598e65,_0x20b292,_0x477169){var _0x4b5041={};var _0x204b72={};var _0x9e29c8;var _0x50ee07;return db['FreshdeskConfiguration'][_0x7a5d('0x52')]({'where':{'id':_0x598e65[_0x7a5d('0x4d')]['id']}})[_0x7a5d('0x1c')](handleEntityNotFound(_0x20b292,null))[_0x7a5d('0x1c')](function(_0x549454){if(_0x549454){_0x9e29c8=_0x549454;_0x204b72['model']=_[_0x7a5d('0x37')](db['FreshdeskField'][_0x7a5d('0x35')]);_0x204b72['query']=_['keys'](_0x598e65[_0x7a5d('0x38')]);_0x204b72['filters']=_[_0x7a5d('0x3a')](_0x204b72['model'],_0x204b72['query']);_0x4b5041[_0x7a5d('0x3c')]=_[_0x7a5d('0x3a')](_0x204b72[_0x7a5d('0x36')],qs['fields'](_0x598e65['query']['fields']));_0x4b5041['attributes']=_0x4b5041[_0x7a5d('0x3c')][_0x7a5d('0x3d')]?_0x4b5041[_0x7a5d('0x3c')]:_0x204b72[_0x7a5d('0x36')];_0x4b5041[_0x7a5d('0x3f')]=qs['sort'](_0x598e65[_0x7a5d('0x38')]['sort']);_0x4b5041[_0x7a5d('0x41')]=qs['filters'](_[_0x7a5d('0x54')](_0x598e65[_0x7a5d('0x38')],_0x204b72[_0x7a5d('0x39')]));if(_0x598e65['query']['filter']){_0x4b5041['where']=_[_0x7a5d('0x43')](_0x4b5041['where'],{'$or':_[_0x7a5d('0x44')](_0x4b5041[_0x7a5d('0x3c')],function(_0x195a6){var _0x2c30f5={};_0x2c30f5[_0x195a6]={'$like':'%'+_0x598e65[_0x7a5d('0x38')][_0x7a5d('0x42')]+'%'};return _0x2c30f5;})});}_0x4b5041=_[_0x7a5d('0x43')]({},_0x4b5041,_0x598e65[_0x7a5d('0x48')]);return _0x9e29c8[_0x7a5d('0x58')](_0x4b5041);}})[_0x7a5d('0x1c')](function(_0x56f7e1){if(_0x56f7e1){_0x50ee07=_0x56f7e1['length'];if(!_0x598e65[_0x7a5d('0x38')]['hasOwnProperty'](_0x7a5d('0x3e'))){_0x4b5041['limit']=qs[_0x7a5d('0x2a')](_0x598e65['query'][_0x7a5d('0x2a')]);_0x4b5041[_0x7a5d('0x29')]=qs['offset'](_0x598e65[_0x7a5d('0x38')][_0x7a5d('0x29')]);}return _0x9e29c8[_0x7a5d('0x58')](_0x4b5041);}})[_0x7a5d('0x1c')](function(_0x590802){if(_0x590802){return _0x590802?{'count':_0x50ee07,'rows':_0x590802}:null;}})[_0x7a5d('0x1c')](respondWithResult(_0x20b292,null))['catch'](handleError(_0x20b292,null));};exports['getTags']=function(_0x58625e,_0x435e8d,_0x2f3a0d){var _0x195a0d={};var _0x5c6a0e={};var _0x25fb41;var _0x38f1a5;return db[_0x7a5d('0x34')]['findOne']({'where':{'id':_0x58625e[_0x7a5d('0x4d')]['id']}})[_0x7a5d('0x1c')](handleEntityNotFound(_0x435e8d,null))['then'](function(_0x45f1ee){if(_0x45f1ee){_0x25fb41=_0x45f1ee;_0x5c6a0e['model']=_['keys'](db[_0x7a5d('0x59')]['rawAttributes']);_0x5c6a0e['query']=_[_0x7a5d('0x37')](_0x58625e['query']);_0x5c6a0e[_0x7a5d('0x39')]=_[_0x7a5d('0x3a')](_0x5c6a0e[_0x7a5d('0x36')],_0x5c6a0e['query']);_0x195a0d[_0x7a5d('0x3c')]=_[_0x7a5d('0x3a')](_0x5c6a0e[_0x7a5d('0x36')],qs[_0x7a5d('0x3b')](_0x58625e[_0x7a5d('0x38')]['fields']));_0x195a0d['attributes']=_0x195a0d[_0x7a5d('0x3c')]['length']?_0x195a0d['attributes']:_0x5c6a0e[_0x7a5d('0x36')];_0x195a0d['order']=qs[_0x7a5d('0x40')](_0x58625e['query']['sort']);_0x195a0d['where']=qs[_0x7a5d('0x39')](_[_0x7a5d('0x54')](_0x58625e[_0x7a5d('0x38')],_0x5c6a0e['filters']));if(_0x58625e[_0x7a5d('0x38')][_0x7a5d('0x42')]){_0x195a0d[_0x7a5d('0x41')]=_['merge'](_0x195a0d[_0x7a5d('0x41')],{'$or':_[_0x7a5d('0x44')](_0x195a0d[_0x7a5d('0x3c')],function(_0x377402){var _0x5220a4={};_0x5220a4[_0x377402]={'$like':'%'+_0x58625e[_0x7a5d('0x38')]['filter']+'%'};return _0x5220a4;})});}_0x195a0d=_['merge']({},_0x195a0d,_0x58625e[_0x7a5d('0x48')]);return _0x25fb41[_0x7a5d('0x5a')](_0x195a0d);}})['then'](function(_0x56cd0b){if(_0x56cd0b){_0x38f1a5=_0x56cd0b[_0x7a5d('0x3d')];if(!_0x58625e[_0x7a5d('0x38')][_0x7a5d('0x56')](_0x7a5d('0x3e'))){_0x195a0d['limit']=qs[_0x7a5d('0x2a')](_0x58625e[_0x7a5d('0x38')][_0x7a5d('0x2a')]);_0x195a0d[_0x7a5d('0x29')]=qs['offset'](_0x58625e[_0x7a5d('0x38')][_0x7a5d('0x29')]);}return _0x25fb41[_0x7a5d('0x5a')](_0x195a0d);}})[_0x7a5d('0x1c')](function(_0xb091a7){if(_0xb091a7){return _0xb091a7?{'count':_0x38f1a5,'rows':_0xb091a7}:null;}})[_0x7a5d('0x1c')](respondWithResult(_0x435e8d,null))[_0x7a5d('0x24')](handleError(_0x435e8d,null));};exports['setTags']=function(_0x308b84,_0x34d95b,_0x52aed9){if(_0x308b84[_0x7a5d('0x4f')]['id']){delete _0x308b84[_0x7a5d('0x4f')]['id'];}return db[_0x7a5d('0x34')][_0x7a5d('0x52')]({'where':{'id':_0x308b84[_0x7a5d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x34d95b,null))[_0x7a5d('0x1c')](function(_0x3308b4){if(_0x3308b4){return _0x3308b4[_0x7a5d('0x5b')](_0x308b84['body']['ids']||[]);}return null;})[_0x7a5d('0x1c')](respondWithResult(_0x34d95b,null))['catch'](handleError(_0x34d95b,null));}; \ No newline at end of file +var _0x2af8=['offset','limit','set','Content-Range','json','apply','update','destroy','stack','name','send','index','FreshdeskConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','options','count','includeAll','include','show','params','find','create','body','findOne','FreshdeskField','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','path','sox','ejs','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','jayson/promise','client','http','test','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end'];(function(_0x3a4a0e,_0x5dcf22){var _0x4c0220=function(_0x3d67eb){while(--_0x3d67eb){_0x3a4a0e['push'](_0x3a4a0e['shift']());}};_0x4c0220(++_0x5dcf22);}(_0x2af8,0xf6));var _0x82af=function(_0x24a8e3,_0x31ee31){_0x24a8e3=_0x24a8e3-0x0;var _0x392f80=_0x2af8[_0x24a8e3];return _0x392f80;};'use strict';var pdf=require(_0x82af('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x82af('0x1'));var zipdir=require(_0x82af('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x82af('0x3'));var moment=require(_0x82af('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x82af('0x5'));var util=require('util');var path=require(_0x82af('0x6'));var sox=require(_0x82af('0x7'));var csv=require('to-csv');var ejs=require(_0x82af('0x8'));var fs=require('fs');var _=require(_0x82af('0x9'));var squel=require('squel');var crypto=require(_0x82af('0xa'));var jsforce=require(_0x82af('0xb'));var deskjs=require(_0x82af('0xc'));var toCsv=require(_0x82af('0xd'));var querystring=require(_0x82af('0xe'));var Papa=require(_0x82af('0xf'));var Redis=require(_0x82af('0x10'));var authService=require(_0x82af('0x11'));var qs=require(_0x82af('0x12'));var hardwareService=require(_0x82af('0x13'));var logger=require(_0x82af('0x14'))(_0x82af('0x15'));var utils=require(_0x82af('0x16'));var config=require(_0x82af('0x17'));var db=require(_0x82af('0x18'))['db'];var jayson=require(_0x82af('0x19'));var client=jayson[_0x82af('0x1a')][_0x82af('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x56a38b,_0x5e3332,_0x108ba3){if(_0x108ba3){var _0xee9ccb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xee9ccb[_0x82af('0x1c')](_0x5e3332)){return _0x56a38b;}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 _0x56a38b;}}function respondWithRpcPromise(_0x2ed907,_0x18332f,_0x195bd2,_0x2b7ce8){return new BPromise(function(_0x5941f3,_0x190cad){var _0x3a9077=_0x2b7ce8||client;return _0x3a9077[_0x82af('0x1d')](_0x2ed907,_0x195bd2)[_0x82af('0x1e')](function(_0x216527){logger[_0x82af('0x1f')](_0x82af('0x20'),_0x18332f,_0x82af('0x21'));logger[_0x82af('0x22')](_0x82af('0x23'),_0x18332f,_0x82af('0x21'),JSON[_0x82af('0x24')](_0x216527));if(_0x216527[_0x82af('0x25')]){if(_0x216527['error'][_0x82af('0x26')]===0x1f4){logger[_0x82af('0x25')](_0x82af('0x20'),_0x18332f,_0x216527[_0x82af('0x25')]['message']);return _0x190cad(_0x216527['error'][_0x82af('0x27')]);}logger['error'](_0x82af('0x20'),_0x18332f,_0x216527[_0x82af('0x25')][_0x82af('0x27')]);return _0x5941f3(_0x216527[_0x82af('0x25')][_0x82af('0x27')]);}else{logger[_0x82af('0x1f')](_0x82af('0x20'),_0x18332f,'request\x20sent');_0x5941f3(_0x216527[_0x82af('0x28')]['message']);}})[_0x82af('0x29')](function(_0x4cd163){logger['error'](_0x82af('0x20'),_0x18332f,_0x4cd163);_0x190cad(_0x4cd163);});});}function respondWithStatusCode(_0x582800,_0x7d204e){_0x7d204e=_0x7d204e||0xcc;return function(_0x244235){if(_0x244235){return _0x582800[_0x82af('0x2a')](_0x7d204e);}return _0x582800[_0x82af('0x2b')](_0x7d204e)[_0x82af('0x2c')]();};}function respondWithResult(_0x21123d,_0x4579c1){_0x4579c1=_0x4579c1||0xc8;return function(_0x1adceb){if(_0x1adceb){return _0x21123d['status'](_0x4579c1)['json'](_0x1adceb);}};}function respondWithFilteredResult(_0x122825,_0x37cf2b){return function(_0x5c0a33){if(_0x5c0a33){var _0x1e42e3=_0x5c0a33['count'],_0x2e6753=_0x37cf2b['offset'],_0x428c5e=_0x37cf2b[_0x82af('0x2d')]+_0x37cf2b[_0x82af('0x2e')],_0x1561f7;if(_0x428c5e>=_0x1e42e3){_0x428c5e=_0x1e42e3;_0x1561f7=0xc8;}else{_0x1561f7=0xce;}_0x122825[_0x82af('0x2b')](_0x1561f7);return _0x122825[_0x82af('0x2f')](_0x82af('0x30'),_0x2e6753+'-'+_0x428c5e+'/'+_0x1e42e3)[_0x82af('0x31')](_0x5c0a33);}return null;};}function patchUpdates(_0x389452){return function(_0x9cdb3a){try{jsonpatch[_0x82af('0x32')](_0x9cdb3a,_0x389452,!![]);}catch(_0x31b813){return BPromise['reject'](_0x31b813);}return _0x9cdb3a['save']();};}function saveUpdates(_0x2412f2,_0x4dba5d){return function(_0x5d6602){if(_0x5d6602){return _0x5d6602[_0x82af('0x33')](_0x2412f2)[_0x82af('0x1e')](function(_0x5247a2){return _0x5247a2;});}return null;};}function removeEntity(_0x59f0e8,_0x2e6542){return function(_0x347b8f){if(_0x347b8f){return _0x347b8f[_0x82af('0x34')]()[_0x82af('0x1e')](function(){_0x59f0e8['status'](0xcc)[_0x82af('0x2c')]();});}};}function handleEntityNotFound(_0x1104b9,_0x2765c1){return function(_0xebcbd9){if(!_0xebcbd9){_0x1104b9[_0x82af('0x2a')](0x194);}return _0xebcbd9;};}function handleError(_0x4a6aae,_0x39a256){_0x39a256=_0x39a256||0x1f4;return function(_0x24b611){logger[_0x82af('0x25')](_0x24b611[_0x82af('0x35')]);if(_0x24b611[_0x82af('0x36')]){delete _0x24b611[_0x82af('0x36')];}_0x4a6aae['status'](_0x39a256)[_0x82af('0x37')](_0x24b611);};}exports[_0x82af('0x38')]=function(_0x26f582,_0x1db53f){var _0x1904d8={},_0x3fb475={},_0x537a1d={'count':0x0,'rows':[]};var _0x18e212=db[_0x82af('0x39')][_0x82af('0x3a')];_0x3fb475[_0x82af('0x3b')]=_[_0x82af('0x3c')](_0x18e212);_0x3fb475[_0x82af('0x3d')]=_['keys'](_0x26f582[_0x82af('0x3d')]);_0x3fb475[_0x82af('0x3e')]=_[_0x82af('0x3f')](_0x3fb475[_0x82af('0x3b')],_0x3fb475['query']);_0x1904d8[_0x82af('0x40')]=_[_0x82af('0x3f')](_0x3fb475['model'],qs[_0x82af('0x41')](_0x26f582[_0x82af('0x3d')][_0x82af('0x41')]));_0x1904d8[_0x82af('0x40')]=_0x1904d8[_0x82af('0x40')][_0x82af('0x42')]?_0x1904d8['attributes']:_0x3fb475[_0x82af('0x3b')];if(!_0x26f582['query'][_0x82af('0x43')](_0x82af('0x44'))){_0x1904d8[_0x82af('0x2e')]=qs['limit'](_0x26f582[_0x82af('0x3d')][_0x82af('0x2e')]);_0x1904d8[_0x82af('0x2d')]=qs[_0x82af('0x2d')](_0x26f582[_0x82af('0x3d')][_0x82af('0x2d')]);}_0x1904d8[_0x82af('0x45')]=qs[_0x82af('0x46')](_0x26f582[_0x82af('0x3d')]['sort']);_0x1904d8[_0x82af('0x47')]=qs['filters'](_[_0x82af('0x48')](_0x26f582[_0x82af('0x3d')],_0x3fb475[_0x82af('0x3e')]));if(_0x26f582['query'][_0x82af('0x49')]){_0x1904d8[_0x82af('0x47')]=_[_0x82af('0x4a')](_0x1904d8[_0x82af('0x47')],{'$or':_[_0x82af('0x4b')](_0x18e212,function(_0x5276bf){if(_0x5276bf[_0x82af('0x4c')][_0x82af('0x4d')]!=='VIRTUAL'){var _0x5aaa40={};_0x5aaa40[_0x5276bf[_0x82af('0x4e')]]={'$like':'%'+_0x26f582[_0x82af('0x3d')][_0x82af('0x49')]+'%'};return _0x5aaa40;}})});}_0x1904d8=_['merge']({},_0x1904d8,_0x26f582[_0x82af('0x4f')]);var _0x76e15b={'where':_0x1904d8[_0x82af('0x47')]};return db[_0x82af('0x39')]['count'](_0x76e15b)[_0x82af('0x1e')](function(_0x1120b3){_0x537a1d[_0x82af('0x50')]=_0x1120b3;if(_0x26f582[_0x82af('0x3d')][_0x82af('0x51')]){_0x1904d8[_0x82af('0x52')]=[{'all':!![]}];}return db['FreshdeskConfiguration']['findAll'](_0x1904d8);})[_0x82af('0x1e')](function(_0x5882e6){_0x537a1d['rows']=_0x5882e6;return _0x537a1d;})[_0x82af('0x1e')](respondWithFilteredResult(_0x1db53f,_0x1904d8))[_0x82af('0x29')](handleError(_0x1db53f,null));};exports[_0x82af('0x53')]=function(_0x502b4d,_0x1b0929){var _0x4eea7a={'raw':![],'where':{'id':_0x502b4d[_0x82af('0x54')]['id']}},_0x7676a9={};_0x7676a9['model']=_[_0x82af('0x3c')](db[_0x82af('0x39')][_0x82af('0x3a')]);_0x7676a9[_0x82af('0x3d')]=_[_0x82af('0x3c')](_0x502b4d[_0x82af('0x3d')]);_0x7676a9[_0x82af('0x3e')]=_[_0x82af('0x3f')](_0x7676a9['model'],_0x7676a9[_0x82af('0x3d')]);_0x4eea7a[_0x82af('0x40')]=_['intersection'](_0x7676a9[_0x82af('0x3b')],qs['fields'](_0x502b4d[_0x82af('0x3d')][_0x82af('0x41')]));_0x4eea7a[_0x82af('0x40')]=_0x4eea7a[_0x82af('0x40')][_0x82af('0x42')]?_0x4eea7a[_0x82af('0x40')]:_0x7676a9[_0x82af('0x3b')];if(_0x502b4d[_0x82af('0x3d')][_0x82af('0x51')]){_0x4eea7a[_0x82af('0x52')]=[{'all':!![]}];}_0x4eea7a=_['merge']({},_0x4eea7a,_0x502b4d[_0x82af('0x4f')]);return db[_0x82af('0x39')][_0x82af('0x55')](_0x4eea7a)[_0x82af('0x1e')](handleEntityNotFound(_0x1b0929,null))[_0x82af('0x1e')](respondWithResult(_0x1b0929,null))[_0x82af('0x29')](handleError(_0x1b0929,null));};exports[_0x82af('0x56')]=function(_0x5ce440,_0x48925c){return db[_0x82af('0x39')]['create'](_0x5ce440[_0x82af('0x57')],{})['then'](respondWithResult(_0x48925c,0xc9))[_0x82af('0x29')](handleError(_0x48925c,null));};exports[_0x82af('0x33')]=function(_0x37139b,_0x27a285){if(_0x37139b[_0x82af('0x57')]['id']){delete _0x37139b[_0x82af('0x57')]['id'];}return db['FreshdeskConfiguration']['find']({'where':{'id':_0x37139b['params']['id']}})[_0x82af('0x1e')](handleEntityNotFound(_0x27a285,null))['then'](saveUpdates(_0x37139b[_0x82af('0x57')],null))[_0x82af('0x1e')](respondWithResult(_0x27a285,null))['catch'](handleError(_0x27a285,null));};exports[_0x82af('0x34')]=function(_0x5bb7af,_0x4d222e){return db[_0x82af('0x39')][_0x82af('0x55')]({'where':{'id':_0x5bb7af[_0x82af('0x54')]['id']}})[_0x82af('0x1e')](handleEntityNotFound(_0x4d222e,null))['then'](removeEntity(_0x4d222e,null))[_0x82af('0x29')](handleError(_0x4d222e,null));};exports['getFields']=function(_0x319f40,_0x2c81c3,_0x57927a){var _0x4bbc0f={};var _0x32b6bc={};var _0x23f550;var _0x2bd917;return db['FreshdeskConfiguration'][_0x82af('0x58')]({'where':{'id':_0x319f40[_0x82af('0x54')]['id']}})[_0x82af('0x1e')](handleEntityNotFound(_0x2c81c3,null))[_0x82af('0x1e')](function(_0x5821e8){if(_0x5821e8){_0x23f550=_0x5821e8;_0x32b6bc['model']=_[_0x82af('0x3c')](db[_0x82af('0x59')]['rawAttributes']);_0x32b6bc[_0x82af('0x3d')]=_[_0x82af('0x3c')](_0x319f40[_0x82af('0x3d')]);_0x32b6bc[_0x82af('0x3e')]=_[_0x82af('0x3f')](_0x32b6bc[_0x82af('0x3b')],_0x32b6bc[_0x82af('0x3d')]);_0x4bbc0f['attributes']=_[_0x82af('0x3f')](_0x32b6bc[_0x82af('0x3b')],qs[_0x82af('0x41')](_0x319f40['query'][_0x82af('0x41')]));_0x4bbc0f[_0x82af('0x40')]=_0x4bbc0f['attributes'][_0x82af('0x42')]?_0x4bbc0f[_0x82af('0x40')]:_0x32b6bc['model'];_0x4bbc0f[_0x82af('0x45')]=qs[_0x82af('0x46')](_0x319f40[_0x82af('0x3d')]['sort']);_0x4bbc0f[_0x82af('0x47')]=qs[_0x82af('0x3e')](_[_0x82af('0x48')](_0x319f40['query'],_0x32b6bc[_0x82af('0x3e')]));if(_0x319f40[_0x82af('0x3d')][_0x82af('0x49')]){_0x4bbc0f[_0x82af('0x47')]=_['merge'](_0x4bbc0f[_0x82af('0x47')],{'$or':_[_0x82af('0x4b')](_0x4bbc0f['attributes'],function(_0x5f378f){var _0x521983={};_0x521983[_0x5f378f]={'$like':'%'+_0x319f40[_0x82af('0x3d')]['filter']+'%'};return _0x521983;})});}_0x4bbc0f=_[_0x82af('0x4a')]({},_0x4bbc0f,_0x319f40[_0x82af('0x4f')]);return _0x23f550[_0x82af('0x5a')](_0x4bbc0f);}})[_0x82af('0x1e')](function(_0x375194){if(_0x375194){_0x2bd917=_0x375194[_0x82af('0x42')];if(!_0x319f40[_0x82af('0x3d')][_0x82af('0x43')]('nolimit')){_0x4bbc0f[_0x82af('0x2e')]=qs[_0x82af('0x2e')](_0x319f40[_0x82af('0x3d')]['limit']);_0x4bbc0f[_0x82af('0x2d')]=qs[_0x82af('0x2d')](_0x319f40[_0x82af('0x3d')][_0x82af('0x2d')]);}return _0x23f550[_0x82af('0x5a')](_0x4bbc0f);}})['then'](function(_0x2642e1){if(_0x2642e1){return _0x2642e1?{'count':_0x2bd917,'rows':_0x2642e1}:null;}})[_0x82af('0x1e')](respondWithResult(_0x2c81c3,null))[_0x82af('0x29')](handleError(_0x2c81c3,null));};exports['getSubjects']=function(_0x12ce1b,_0x6c1155,_0x3c47d1){var _0x57e7a1={};var _0x7a6139={};var _0x42c20c;var _0x4f78fb;return db[_0x82af('0x39')][_0x82af('0x58')]({'where':{'id':_0x12ce1b['params']['id']}})[_0x82af('0x1e')](handleEntityNotFound(_0x6c1155,null))[_0x82af('0x1e')](function(_0xd81db3){if(_0xd81db3){_0x42c20c=_0xd81db3;_0x7a6139[_0x82af('0x3b')]=_[_0x82af('0x3c')](db[_0x82af('0x59')]['rawAttributes']);_0x7a6139[_0x82af('0x3d')]=_[_0x82af('0x3c')](_0x12ce1b['query']);_0x7a6139['filters']=_[_0x82af('0x3f')](_0x7a6139[_0x82af('0x3b')],_0x7a6139['query']);_0x57e7a1[_0x82af('0x40')]=_[_0x82af('0x3f')](_0x7a6139['model'],qs[_0x82af('0x41')](_0x12ce1b[_0x82af('0x3d')]['fields']));_0x57e7a1[_0x82af('0x40')]=_0x57e7a1[_0x82af('0x40')][_0x82af('0x42')]?_0x57e7a1['attributes']:_0x7a6139[_0x82af('0x3b')];_0x57e7a1[_0x82af('0x45')]=qs['sort'](_0x12ce1b[_0x82af('0x3d')][_0x82af('0x46')]);_0x57e7a1[_0x82af('0x47')]=qs[_0x82af('0x3e')](_[_0x82af('0x48')](_0x12ce1b[_0x82af('0x3d')],_0x7a6139[_0x82af('0x3e')]));if(_0x12ce1b['query'][_0x82af('0x49')]){_0x57e7a1['where']=_[_0x82af('0x4a')](_0x57e7a1[_0x82af('0x47')],{'$or':_[_0x82af('0x4b')](_0x57e7a1[_0x82af('0x40')],function(_0xda0149){var _0x1fa114={};_0x1fa114[_0xda0149]={'$like':'%'+_0x12ce1b[_0x82af('0x3d')][_0x82af('0x49')]+'%'};return _0x1fa114;})});}_0x57e7a1=_[_0x82af('0x4a')]({},_0x57e7a1,_0x12ce1b[_0x82af('0x4f')]);return _0x42c20c[_0x82af('0x5b')](_0x57e7a1);}})[_0x82af('0x1e')](function(_0x1f8668){if(_0x1f8668){_0x4f78fb=_0x1f8668[_0x82af('0x42')];if(!_0x12ce1b[_0x82af('0x3d')][_0x82af('0x43')](_0x82af('0x44'))){_0x57e7a1[_0x82af('0x2e')]=qs[_0x82af('0x2e')](_0x12ce1b[_0x82af('0x3d')][_0x82af('0x2e')]);_0x57e7a1['offset']=qs['offset'](_0x12ce1b[_0x82af('0x3d')][_0x82af('0x2d')]);}return _0x42c20c[_0x82af('0x5b')](_0x57e7a1);}})[_0x82af('0x1e')](function(_0x93fd53){if(_0x93fd53){return _0x93fd53?{'count':_0x4f78fb,'rows':_0x93fd53}:null;}})[_0x82af('0x1e')](respondWithResult(_0x6c1155,null))['catch'](handleError(_0x6c1155,null));};exports[_0x82af('0x5c')]=function(_0x133db2,_0x186fd4,_0x4ad872){var _0x50a0f6={};var _0x7f9fe8={};var _0x32a3f7;var _0x578b30;return db[_0x82af('0x39')]['findOne']({'where':{'id':_0x133db2[_0x82af('0x54')]['id']}})['then'](handleEntityNotFound(_0x186fd4,null))[_0x82af('0x1e')](function(_0x521518){if(_0x521518){_0x32a3f7=_0x521518;_0x7f9fe8[_0x82af('0x3b')]=_[_0x82af('0x3c')](db['FreshdeskField'][_0x82af('0x3a')]);_0x7f9fe8[_0x82af('0x3d')]=_[_0x82af('0x3c')](_0x133db2[_0x82af('0x3d')]);_0x7f9fe8[_0x82af('0x3e')]=_[_0x82af('0x3f')](_0x7f9fe8['model'],_0x7f9fe8[_0x82af('0x3d')]);_0x50a0f6[_0x82af('0x40')]=_[_0x82af('0x3f')](_0x7f9fe8['model'],qs[_0x82af('0x41')](_0x133db2['query'][_0x82af('0x41')]));_0x50a0f6['attributes']=_0x50a0f6[_0x82af('0x40')][_0x82af('0x42')]?_0x50a0f6[_0x82af('0x40')]:_0x7f9fe8[_0x82af('0x3b')];_0x50a0f6['order']=qs[_0x82af('0x46')](_0x133db2[_0x82af('0x3d')][_0x82af('0x46')]);_0x50a0f6[_0x82af('0x47')]=qs[_0x82af('0x3e')](_['pick'](_0x133db2[_0x82af('0x3d')],_0x7f9fe8[_0x82af('0x3e')]));if(_0x133db2[_0x82af('0x3d')][_0x82af('0x49')]){_0x50a0f6[_0x82af('0x47')]=_[_0x82af('0x4a')](_0x50a0f6['where'],{'$or':_[_0x82af('0x4b')](_0x50a0f6[_0x82af('0x40')],function(_0xb7e1e3){var _0x188bdd={};_0x188bdd[_0xb7e1e3]={'$like':'%'+_0x133db2['query'][_0x82af('0x49')]+'%'};return _0x188bdd;})});}_0x50a0f6=_[_0x82af('0x4a')]({},_0x50a0f6,_0x133db2[_0x82af('0x4f')]);return _0x32a3f7[_0x82af('0x5c')](_0x50a0f6);}})['then'](function(_0xb69e80){if(_0xb69e80){_0x578b30=_0xb69e80[_0x82af('0x42')];if(!_0x133db2['query'][_0x82af('0x43')](_0x82af('0x44'))){_0x50a0f6[_0x82af('0x2e')]=qs['limit'](_0x133db2['query'][_0x82af('0x2e')]);_0x50a0f6[_0x82af('0x2d')]=qs[_0x82af('0x2d')](_0x133db2['query'][_0x82af('0x2d')]);}return _0x32a3f7['getDescriptions'](_0x50a0f6);}})['then'](function(_0x147b3c){if(_0x147b3c){return _0x147b3c?{'count':_0x578b30,'rows':_0x147b3c}:null;}})[_0x82af('0x1e')](respondWithResult(_0x186fd4,null))[_0x82af('0x29')](handleError(_0x186fd4,null));};exports[_0x82af('0x5d')]=function(_0x4f449d,_0x1aa413,_0xf3b9ee){var _0x14d017={};var _0x206dfa={};var _0x317f34;var _0x3a2f51;return db[_0x82af('0x39')][_0x82af('0x58')]({'where':{'id':_0x4f449d[_0x82af('0x54')]['id']}})[_0x82af('0x1e')](handleEntityNotFound(_0x1aa413,null))[_0x82af('0x1e')](function(_0x785487){if(_0x785487){_0x317f34=_0x785487;_0x206dfa[_0x82af('0x3b')]=_[_0x82af('0x3c')](db[_0x82af('0x5e')][_0x82af('0x3a')]);_0x206dfa[_0x82af('0x3d')]=_[_0x82af('0x3c')](_0x4f449d['query']);_0x206dfa[_0x82af('0x3e')]=_[_0x82af('0x3f')](_0x206dfa[_0x82af('0x3b')],_0x206dfa[_0x82af('0x3d')]);_0x14d017[_0x82af('0x40')]=_[_0x82af('0x3f')](_0x206dfa[_0x82af('0x3b')],qs[_0x82af('0x41')](_0x4f449d['query'][_0x82af('0x41')]));_0x14d017[_0x82af('0x40')]=_0x14d017['attributes']['length']?_0x14d017[_0x82af('0x40')]:_0x206dfa[_0x82af('0x3b')];_0x14d017[_0x82af('0x45')]=qs[_0x82af('0x46')](_0x4f449d['query'][_0x82af('0x46')]);_0x14d017[_0x82af('0x47')]=qs[_0x82af('0x3e')](_[_0x82af('0x48')](_0x4f449d['query'],_0x206dfa[_0x82af('0x3e')]));if(_0x4f449d[_0x82af('0x3d')]['filter']){_0x14d017[_0x82af('0x47')]=_['merge'](_0x14d017[_0x82af('0x47')],{'$or':_[_0x82af('0x4b')](_0x14d017['attributes'],function(_0x30b981){var _0x3447af={};_0x3447af[_0x30b981]={'$like':'%'+_0x4f449d[_0x82af('0x3d')][_0x82af('0x49')]+'%'};return _0x3447af;})});}_0x14d017=_[_0x82af('0x4a')]({},_0x14d017,_0x4f449d[_0x82af('0x4f')]);return _0x317f34[_0x82af('0x5d')](_0x14d017);}})[_0x82af('0x1e')](function(_0x574490){if(_0x574490){_0x3a2f51=_0x574490['length'];if(!_0x4f449d[_0x82af('0x3d')]['hasOwnProperty'](_0x82af('0x44'))){_0x14d017[_0x82af('0x2e')]=qs['limit'](_0x4f449d[_0x82af('0x3d')]['limit']);_0x14d017['offset']=qs['offset'](_0x4f449d['query'][_0x82af('0x2d')]);}return _0x317f34[_0x82af('0x5d')](_0x14d017);}})[_0x82af('0x1e')](function(_0x153b8b){if(_0x153b8b){return _0x153b8b?{'count':_0x3a2f51,'rows':_0x153b8b}:null;}})[_0x82af('0x1e')](respondWithResult(_0x1aa413,null))[_0x82af('0x29')](handleError(_0x1aa413,null));};exports[_0x82af('0x5f')]=function(_0x4d9614,_0x5ed772,_0x27b458){if(_0x4d9614[_0x82af('0x57')]['id']){delete _0x4d9614[_0x82af('0x57')]['id'];}return db[_0x82af('0x39')]['findOne']({'where':{'id':_0x4d9614[_0x82af('0x54')]['id']}})[_0x82af('0x1e')](handleEntityNotFound(_0x5ed772,null))[_0x82af('0x1e')](function(_0xee4d7f){if(_0xee4d7f){return _0xee4d7f[_0x82af('0x5f')](_0x4d9614[_0x82af('0x57')][_0x82af('0x60')]||[]);}return null;})[_0x82af('0x1e')](respondWithResult(_0x5ed772,null))[_0x82af('0x29')](handleError(_0x5ed772,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index d72320a..1ba4afc 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 _0x121a=['int_freshdesk_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FreshdeskConfiguration'];(function(_0x1b61de,_0x21e19d){var _0x4f1de1=function(_0x4e6058){while(--_0x4e6058){_0x1b61de['push'](_0x1b61de['shift']());}};_0x4f1de1(++_0x21e19d);}(_0x121a,0x11f));var _0xa121=function(_0x4a3eef,_0x16388a){_0x4a3eef=_0x4a3eef-0x0;var _0x2d5b79=_0x121a[_0x4a3eef];return _0x2d5b79;};'use strict';var _=require(_0xa121('0x0'));var util=require(_0xa121('0x1'));var logger=require(_0xa121('0x2'))('api');var moment=require(_0xa121('0x3'));var BPromise=require(_0xa121('0x4'));var rp=require(_0xa121('0x5'));var fs=require('fs');var path=require(_0xa121('0x6'));var rimraf=require(_0xa121('0x7'));var config=require(_0xa121('0x8'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xa121('0x9')]=function(_0x8d7ecf,_0x4c32a2){return _0x8d7ecf[_0xa121('0xa')](_0xa121('0xb'),attributes,{'tableName':_0xa121('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc03b=['bluebird','request-promise','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x3be7ff,_0x12e714){var _0x186721=function(_0x2bc9e1){while(--_0x2bc9e1){_0x3be7ff['push'](_0x3be7ff['shift']());}};_0x186721(++_0x12e714);}(_0xc03b,0x15a));var _0xbc03=function(_0x2416b9,_0x313d5d){_0x2416b9=_0x2416b9-0x0;var _0x9eefeb=_0xc03b[_0x2416b9];return _0x9eefeb;};'use strict';var _=require(_0xbc03('0x0'));var util=require(_0xbc03('0x1'));var logger=require(_0xbc03('0x2'))(_0xbc03('0x3'));var moment=require(_0xbc03('0x4'));var BPromise=require(_0xbc03('0x5'));var rp=require(_0xbc03('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbc03('0x7'));var attributes=require(_0xbc03('0x8'));module[_0xbc03('0x9')]=function(_0x56bc75,_0x39b05e){return _0x56bc75[_0xbc03('0xa')](_0xbc03('0xb'),attributes,{'tableName':_0xbc03('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 0e5103c..f79a98f 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 _0x5bb2=['../../config/utils','../../config/logger','rpc','http','request','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','lodash','bluebird','randomstring','ioredis'];(function(_0x470751,_0x17ef61){var _0x486173=function(_0x1a23f1){while(--_0x1a23f1){_0x470751['push'](_0x470751['shift']());}};_0x486173(++_0x17ef61);}(_0x5bb2,0xa7));var _0x25bb=function(_0x4e6fda,_0x487f04){_0x4e6fda=_0x4e6fda-0x0;var _0x29e7b7=_0x5bb2[_0x4e6fda];return _0x29e7b7;};'use strict';var _=require(_0x25bb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x25bb('0x1'));var rs=require(_0x25bb('0x2'));var fs=require('fs');var Redis=require(_0x25bb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x25bb('0x4'));var logger=require(_0x25bb('0x5'))(_0x25bb('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x25bb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xa87b7d,_0x44adbd,_0x39b107){return new BPromise(function(_0x12735e,_0x34798a){return client[_0x25bb('0x8')](_0xa87b7d,_0x39b107)['then'](function(_0x46c3e8){logger[_0x25bb('0x9')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x44adbd,_0x25bb('0xa'));logger[_0x25bb('0xb')](_0x25bb('0xc'),_0x44adbd,_0x25bb('0xa'),JSON[_0x25bb('0xd')](_0x46c3e8));if(_0x46c3e8['error']){if(_0x46c3e8[_0x25bb('0xe')][_0x25bb('0xf')]===0x1f4){logger[_0x25bb('0xe')](_0x25bb('0x10'),_0x44adbd,_0x46c3e8[_0x25bb('0xe')]['message']);return _0x34798a(_0x46c3e8['error'][_0x25bb('0x11')]);}logger[_0x25bb('0xe')](_0x25bb('0x10'),_0x44adbd,_0x46c3e8[_0x25bb('0xe')]['message']);return _0x12735e(_0x46c3e8['error'][_0x25bb('0x11')]);}else{logger[_0x25bb('0x9')](_0x25bb('0x10'),_0x44adbd,_0x25bb('0xa'));_0x12735e(_0x46c3e8[_0x25bb('0x12')][_0x25bb('0x11')]);}})['catch'](function(_0x37ba88){logger[_0x25bb('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x44adbd,_0x37ba88);_0x34798a(_0x37ba88);});});} \ No newline at end of file +var _0x84d5=['client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x488f90,_0x33fbf7){var _0x234a4f=function(_0x1c8e60){while(--_0x1c8e60){_0x488f90['push'](_0x488f90['shift']());}};_0x234a4f(++_0x33fbf7);}(_0x84d5,0x147));var _0x584d=function(_0x21313b,_0x5eaba2){_0x21313b=_0x21313b-0x0;var _0x179a66=_0x84d5[_0x21313b];return _0x179a66;};'use strict';var _=require(_0x584d('0x0'));var util=require(_0x584d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x584d('0x2'));var fs=require('fs');var Redis=require(_0x584d('0x3'));var db=require(_0x584d('0x4'))['db'];var utils=require(_0x584d('0x5'));var logger=require('../../config/logger')(_0x584d('0x6'));var config=require(_0x584d('0x7'));var jayson=require(_0x584d('0x8'));var client=jayson[_0x584d('0x9')][_0x584d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x288037,_0x46b01f,_0x66cd4a){return new BPromise(function(_0x327573,_0x5b54df){return client[_0x584d('0xb')](_0x288037,_0x66cd4a)[_0x584d('0xc')](function(_0x10fd37){logger[_0x584d('0xd')](_0x584d('0xe'),_0x46b01f,_0x584d('0xf'));logger[_0x584d('0x10')](_0x584d('0x11'),_0x46b01f,_0x584d('0xf'),JSON[_0x584d('0x12')](_0x10fd37));if(_0x10fd37['error']){if(_0x10fd37[_0x584d('0x13')][_0x584d('0x14')]===0x1f4){logger[_0x584d('0x13')](_0x584d('0xe'),_0x46b01f,_0x10fd37[_0x584d('0x13')][_0x584d('0x15')]);return _0x5b54df(_0x10fd37[_0x584d('0x13')]['message']);}logger['error'](_0x584d('0xe'),_0x46b01f,_0x10fd37[_0x584d('0x13')][_0x584d('0x15')]);return _0x327573(_0x10fd37['error'][_0x584d('0x15')]);}else{logger['info'](_0x584d('0xe'),_0x46b01f,_0x584d('0xf'));_0x327573(_0x10fd37[_0x584d('0x16')][_0x584d('0x15')]);}})[_0x584d('0x17')](function(_0x1aeb75){logger[_0x584d('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x46b01f,_0x1aeb75);_0x5b54df(_0x1aeb75);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 5d77e57..9082ac0 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 _0x1c83=['post','create','put','delete','util','path','Router','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x1884b0,_0x490146){var _0xee5bad=function(_0x2bd35c){while(--_0x2bd35c){_0x1884b0['push'](_0x1884b0['shift']());}};_0xee5bad(++_0x490146);}(_0x1c83,0x16c));var _0x31c8=function(_0x5867e6,_0x4d5bbd){_0x5867e6=_0x5867e6-0x0;var _0x1450b7=_0x1c83[_0x5867e6];return _0x1450b7;};'use strict';var multer=require('multer');var util=require(_0x31c8('0x0'));var path=require(_0x31c8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x31c8('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x31c8('0x3'));var config=require(_0x31c8('0x4'));var controller=require(_0x31c8('0x5'));router[_0x31c8('0x6')]('/',auth[_0x31c8('0x7')](),controller[_0x31c8('0x8')]);router[_0x31c8('0x6')](_0x31c8('0x9'),auth[_0x31c8('0x7')](),controller[_0x31c8('0xa')]);router[_0x31c8('0xb')]('/',auth[_0x31c8('0x7')](),controller[_0x31c8('0xc')]);router[_0x31c8('0xd')](_0x31c8('0x9'),auth[_0x31c8('0x7')](),controller['update']);router[_0x31c8('0xe')]('/:id',auth[_0x31c8('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x936d=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','/:id','show','create','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x5a1cc9,_0x28f54d){var _0x471761=function(_0xda51c0){while(--_0xda51c0){_0x5a1cc9['push'](_0x5a1cc9['shift']());}};_0x471761(++_0x28f54d);}(_0x936d,0x183));var _0xd936=function(_0x309c00,_0x18520e){_0x309c00=_0x309c00-0x0;var _0x47a694=_0x936d[_0x309c00];return _0x47a694;};'use strict';var multer=require(_0xd936('0x0'));var util=require(_0xd936('0x1'));var path=require(_0xd936('0x2'));var timeout=require(_0xd936('0x3'));var express=require('express');var router=express[_0xd936('0x4')]();var auth=require(_0xd936('0x5'));var interaction=require(_0xd936('0x6'));var config=require(_0xd936('0x7'));var controller=require(_0xd936('0x8'));router[_0xd936('0x9')]('/',auth[_0xd936('0xa')](),controller['index']);router[_0xd936('0x9')](_0xd936('0xb'),auth[_0xd936('0xa')](),controller[_0xd936('0xc')]);router['post']('/',auth[_0xd936('0xa')](),controller[_0xd936('0xd')]);router['put'](_0xd936('0xb'),auth[_0xd936('0xa')](),controller['update']);router[_0xd936('0xe')]('/:id',auth[_0xd936('0xa')](),controller[_0xd936('0xf')]);module[_0xd936('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 196508f..f5de85e 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 _0x5c00=['string','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','variable','keyValue'];(function(_0xe583d4,_0x367f59){var _0x54f27c=function(_0x54a1aa){while(--_0x54a1aa){_0xe583d4['push'](_0xe583d4['shift']());}};_0x54f27c(++_0x367f59);}(_0x5c00,0x17e));var _0x05c0=function(_0x476f49,_0x105660){_0x476f49=_0x476f49-0x0;var _0x48addd=_0x5c00[_0x476f49];return _0x48addd;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'type':{'type':Sequelize[_0x05c0('0x2')]('string',_0x05c0('0x3'),'customVariable',_0x05c0('0x4')),'defaultValue':_0x05c0('0x5')},'content':{'type':Sequelize[_0x05c0('0x6')]},'key':{'type':Sequelize[_0x05c0('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x05c0('0x5'),_0x05c0('0x3'),_0x05c0('0x7'))},'keyContent':{'type':Sequelize[_0x05c0('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x05c0('0x6')]},'customField':{'type':Sequelize[_0x05c0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x05c0('0x6')]}}; \ No newline at end of file +var _0x1339=['keyValue','STRING','BOOLEAN','ENUM','string','variable','customVariable'];(function(_0x434d00,_0x1353a9){var _0x505655=function(_0x165154){while(--_0x165154){_0x434d00['push'](_0x434d00['shift']());}};_0x505655(++_0x1353a9);}(_0x1339,0x1ed));var _0x9133=function(_0x2f91b3,_0x2df2f7){_0x2f91b3=_0x2f91b3-0x0;var _0xc84f2b=_0x1339[_0x2f91b3];return _0xc84f2b;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x9133('0x0')](_0x9133('0x1'),_0x9133('0x2'),_0x9133('0x3'),_0x9133('0x4')),'defaultValue':_0x9133('0x1')},'content':{'type':Sequelize[_0x9133('0x5')]},'key':{'type':Sequelize[_0x9133('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x9133('0x1'),_0x9133('0x2'),_0x9133('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9133('0x5')]},'nameField':{'type':Sequelize[_0x9133('0x5')]},'customField':{'type':Sequelize[_0x9133('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9133('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 75aa5c6..f767f19 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 _0x9383=['status','end','json','count','offset','set','apply','reject','then','destroy','error','stack','name','send','index','FreshdeskField','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','map','type','VIRTUAL','field','filter','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x9383,0x7a));var _0x3938=function(_0x14b79c,_0x3b9464){_0x14b79c=_0x14b79c-0x0;var _0x2e4cdc=_0x9383[_0x14b79c];return _0x2e4cdc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3938('0x0'));var rimraf=require(_0x3938('0x1'));var zipdir=require(_0x3938('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3938('0x3'));var moment=require(_0x3938('0x4'));var BPromise=require(_0x3938('0x5'));var Mustache=require(_0x3938('0x6'));var util=require(_0x3938('0x7'));var path=require('path');var sox=require(_0x3938('0x8'));var csv=require('to-csv');var ejs=require(_0x3938('0x9'));var fs=require('fs');var _=require(_0x3938('0xa'));var squel=require(_0x3938('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3938('0xc'));var toCsv=require(_0x3938('0xd'));var querystring=require(_0x3938('0xe'));var Papa=require(_0x3938('0xf'));var Redis=require(_0x3938('0x10'));var authService=require(_0x3938('0x11'));var qs=require(_0x3938('0x12'));var hardwareService=require(_0x3938('0x13'));var logger=require('../../config/logger')(_0x3938('0x14'));var utils=require(_0x3938('0x15'));var config=require(_0x3938('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f50ca,_0x47672b){_0x47672b=_0x47672b||0xcc;return function(_0x9155ce){if(_0x9155ce){return _0x5f50ca[_0x3938('0x17')](_0x47672b);}return _0x5f50ca[_0x3938('0x18')](_0x47672b)[_0x3938('0x19')]();};}function respondWithResult(_0x439031,_0x1d45c7){_0x1d45c7=_0x1d45c7||0xc8;return function(_0x148325){if(_0x148325){return _0x439031[_0x3938('0x18')](_0x1d45c7)[_0x3938('0x1a')](_0x148325);}};}function respondWithFilteredResult(_0x346db6,_0x47af38){return function(_0x53a0ed){if(_0x53a0ed){var _0x2d9e41=_0x53a0ed[_0x3938('0x1b')],_0x5a75d2=_0x47af38[_0x3938('0x1c')],_0x2eb816=_0x47af38[_0x3938('0x1c')]+_0x47af38['limit'],_0x4582ad;if(_0x2eb816>=_0x2d9e41){_0x2eb816=_0x2d9e41;_0x4582ad=0xc8;}else{_0x4582ad=0xce;}_0x346db6[_0x3938('0x18')](_0x4582ad);return _0x346db6[_0x3938('0x1d')]('Content-Range',_0x5a75d2+'-'+_0x2eb816+'/'+_0x2d9e41)[_0x3938('0x1a')](_0x53a0ed);}return null;};}function patchUpdates(_0x3358c1){return function(_0x1e07f1){try{jsonpatch[_0x3938('0x1e')](_0x1e07f1,_0x3358c1,!![]);}catch(_0x4af27b){return BPromise[_0x3938('0x1f')](_0x4af27b);}return _0x1e07f1['save']();};}function saveUpdates(_0x5bb940,_0x1fff1d){return function(_0x41cd71){if(_0x41cd71){return _0x41cd71['update'](_0x5bb940)[_0x3938('0x20')](function(_0x298841){return _0x298841;});}return null;};}function removeEntity(_0x23eee8,_0x316c06){return function(_0x357ead){if(_0x357ead){return _0x357ead[_0x3938('0x21')]()[_0x3938('0x20')](function(){_0x23eee8['status'](0xcc)[_0x3938('0x19')]();});}};}function handleEntityNotFound(_0x130763,_0x2eb819){return function(_0x2d4759){if(!_0x2d4759){_0x130763[_0x3938('0x17')](0x194);}return _0x2d4759;};}function handleError(_0xe2f276,_0x3de88f){_0x3de88f=_0x3de88f||0x1f4;return function(_0x2e36a1){logger[_0x3938('0x22')](_0x2e36a1[_0x3938('0x23')]);if(_0x2e36a1['name']){delete _0x2e36a1[_0x3938('0x24')];}_0xe2f276['status'](_0x3de88f)[_0x3938('0x25')](_0x2e36a1);};}exports[_0x3938('0x26')]=function(_0xf6c5c,_0x3392e0){var _0x453bb1={},_0xcbb931={},_0x4be0cf={'count':0x0,'rows':[]};var _0x405843=db[_0x3938('0x27')][_0x3938('0x28')];_0xcbb931['model']=_['keys'](_0x405843);_0xcbb931[_0x3938('0x29')]=_[_0x3938('0x2a')](_0xf6c5c[_0x3938('0x29')]);_0xcbb931[_0x3938('0x2b')]=_[_0x3938('0x2c')](_0xcbb931[_0x3938('0x2d')],_0xcbb931[_0x3938('0x29')]);_0x453bb1['attributes']=_[_0x3938('0x2c')](_0xcbb931[_0x3938('0x2d')],qs[_0x3938('0x2e')](_0xf6c5c[_0x3938('0x29')][_0x3938('0x2e')]));_0x453bb1[_0x3938('0x2f')]=_0x453bb1['attributes'][_0x3938('0x30')]?_0x453bb1['attributes']:_0xcbb931[_0x3938('0x2d')];if(!_0xf6c5c[_0x3938('0x29')][_0x3938('0x31')](_0x3938('0x32'))){_0x453bb1['limit']=qs[_0x3938('0x33')](_0xf6c5c[_0x3938('0x29')][_0x3938('0x33')]);_0x453bb1[_0x3938('0x1c')]=qs['offset'](_0xf6c5c['query'][_0x3938('0x1c')]);}_0x453bb1['order']=qs[_0x3938('0x34')](_0xf6c5c[_0x3938('0x29')]['sort']);_0x453bb1[_0x3938('0x35')]=qs[_0x3938('0x2b')](_[_0x3938('0x36')](_0xf6c5c[_0x3938('0x29')],_0xcbb931[_0x3938('0x2b')]));if(_0xf6c5c[_0x3938('0x29')]['filter']){_0x453bb1[_0x3938('0x35')]=_['merge'](_0x453bb1[_0x3938('0x35')],{'$or':_[_0x3938('0x37')](_0x405843,function(_0x1699e9){if(_0x1699e9[_0x3938('0x38')]['key']!==_0x3938('0x39')){var _0x4867a8={};_0x4867a8[_0x1699e9[_0x3938('0x3a')]]={'$like':'%'+_0xf6c5c[_0x3938('0x29')][_0x3938('0x3b')]+'%'};return _0x4867a8;}})});}_0x453bb1=_[_0x3938('0x3c')]({},_0x453bb1,_0xf6c5c[_0x3938('0x3d')]);var _0x30e5df={'where':_0x453bb1[_0x3938('0x35')]};return db[_0x3938('0x27')][_0x3938('0x1b')](_0x30e5df)['then'](function(_0x37782d){_0x4be0cf[_0x3938('0x1b')]=_0x37782d;if(_0xf6c5c[_0x3938('0x29')][_0x3938('0x3e')]){_0x453bb1[_0x3938('0x3f')]=[{'all':!![]}];}return db[_0x3938('0x27')][_0x3938('0x40')](_0x453bb1);})[_0x3938('0x20')](function(_0x180896){_0x4be0cf[_0x3938('0x41')]=_0x180896;return _0x4be0cf;})['then'](respondWithFilteredResult(_0x3392e0,_0x453bb1))['catch'](handleError(_0x3392e0,null));};exports[_0x3938('0x42')]=function(_0x399d7f,_0x4657f8){var _0x30011b={'raw':!![],'where':{'id':_0x399d7f[_0x3938('0x43')]['id']}},_0x315cb7={};_0x315cb7['model']=_[_0x3938('0x2a')](db[_0x3938('0x27')]['rawAttributes']);_0x315cb7[_0x3938('0x29')]=_[_0x3938('0x2a')](_0x399d7f[_0x3938('0x29')]);_0x315cb7[_0x3938('0x2b')]=_[_0x3938('0x2c')](_0x315cb7[_0x3938('0x2d')],_0x315cb7[_0x3938('0x29')]);_0x30011b[_0x3938('0x2f')]=_[_0x3938('0x2c')](_0x315cb7[_0x3938('0x2d')],qs[_0x3938('0x2e')](_0x399d7f[_0x3938('0x29')][_0x3938('0x2e')]));_0x30011b[_0x3938('0x2f')]=_0x30011b[_0x3938('0x2f')]['length']?_0x30011b['attributes']:_0x315cb7['model'];if(_0x399d7f['query'][_0x3938('0x3e')]){_0x30011b[_0x3938('0x3f')]=[{'all':!![]}];}_0x30011b=_['merge']({},_0x30011b,_0x399d7f[_0x3938('0x3d')]);return db[_0x3938('0x27')][_0x3938('0x44')](_0x30011b)[_0x3938('0x20')](handleEntityNotFound(_0x4657f8,null))[_0x3938('0x20')](respondWithResult(_0x4657f8,null))[_0x3938('0x45')](handleError(_0x4657f8,null));};exports['create']=function(_0x4dc7e5,_0x3da4e1){return db[_0x3938('0x27')][_0x3938('0x46')](_0x4dc7e5[_0x3938('0x47')],{})[_0x3938('0x20')](respondWithResult(_0x3da4e1,0xc9))[_0x3938('0x45')](handleError(_0x3da4e1,null));};exports[_0x3938('0x48')]=function(_0x7433c8,_0x2caa14){if(_0x7433c8[_0x3938('0x47')]['id']){delete _0x7433c8[_0x3938('0x47')]['id'];}return db[_0x3938('0x27')][_0x3938('0x44')]({'where':{'id':_0x7433c8[_0x3938('0x43')]['id']}})['then'](handleEntityNotFound(_0x2caa14,null))[_0x3938('0x20')](saveUpdates(_0x7433c8['body'],null))[_0x3938('0x20')](respondWithResult(_0x2caa14,null))[_0x3938('0x45')](handleError(_0x2caa14,null));};exports[_0x3938('0x21')]=function(_0x255b04,_0x12d421){return db[_0x3938('0x27')]['find']({'where':{'id':_0x255b04[_0x3938('0x43')]['id']}})[_0x3938('0x20')](handleEntityNotFound(_0x12d421,null))['then'](removeEntity(_0x12d421,null))['catch'](handleError(_0x12d421,null));}; \ No newline at end of file +var _0x726c=['body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','reject','save','update','destroy','then','end','error','stack','name','send','index','FreshdeskField','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','field','options','includeAll','include','show','params','rawAttributes','intersection','find','create','catch'];(function(_0x2930e0,_0x48003a){var _0x3d0699=function(_0x8df4b0){while(--_0x8df4b0){_0x2930e0['push'](_0x2930e0['shift']());}};_0x3d0699(++_0x48003a);}(_0x726c,0x1e4));var _0xc726=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x726c[_0x4d613c];return _0x301fe3;};'use strict';var pdf=require(_0xc726('0x0'));var emlformat=require(_0xc726('0x1'));var rimraf=require(_0xc726('0x2'));var zipdir=require(_0xc726('0x3'));var jsonpatch=require(_0xc726('0x4'));var rp=require('request-promise');var moment=require(_0xc726('0x5'));var BPromise=require(_0xc726('0x6'));var Mustache=require('mustache');var util=require(_0xc726('0x7'));var path=require('path');var sox=require(_0xc726('0x8'));var csv=require(_0xc726('0x9'));var ejs=require(_0xc726('0xa'));var fs=require('fs');var _=require(_0xc726('0xb'));var squel=require(_0xc726('0xc'));var crypto=require(_0xc726('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc726('0x9'));var querystring=require(_0xc726('0xe'));var Papa=require(_0xc726('0xf'));var Redis=require(_0xc726('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc726('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xc726('0x12'));var config=require(_0xc726('0x13'));var db=require(_0xc726('0x14'))['db'];function respondWithStatusCode(_0x42aa55,_0x95a432){_0x95a432=_0x95a432||0xcc;return function(_0x17cc5b){if(_0x17cc5b){return _0x42aa55[_0xc726('0x15')](_0x95a432);}return _0x42aa55['status'](_0x95a432)['end']();};}function respondWithResult(_0xf7a30,_0x4bb976){_0x4bb976=_0x4bb976||0xc8;return function(_0x3d8169){if(_0x3d8169){return _0xf7a30[_0xc726('0x16')](_0x4bb976)[_0xc726('0x17')](_0x3d8169);}};}function respondWithFilteredResult(_0x50f988,_0xb3c23d){return function(_0x565a2e){if(_0x565a2e){var _0x23d237=_0x565a2e[_0xc726('0x18')],_0x282d97=_0xb3c23d[_0xc726('0x19')],_0xcab81d=_0xb3c23d[_0xc726('0x19')]+_0xb3c23d[_0xc726('0x1a')],_0x1ab900;if(_0xcab81d>=_0x23d237){_0xcab81d=_0x23d237;_0x1ab900=0xc8;}else{_0x1ab900=0xce;}_0x50f988['status'](_0x1ab900);return _0x50f988['set'](_0xc726('0x1b'),_0x282d97+'-'+_0xcab81d+'/'+_0x23d237)[_0xc726('0x17')](_0x565a2e);}return null;};}function patchUpdates(_0x25870c){return function(_0x22ce20){try{jsonpatch['apply'](_0x22ce20,_0x25870c,!![]);}catch(_0x3907b5){return BPromise[_0xc726('0x1c')](_0x3907b5);}return _0x22ce20[_0xc726('0x1d')]();};}function saveUpdates(_0x2342bc,_0x127a24){return function(_0x3f0c01){if(_0x3f0c01){return _0x3f0c01[_0xc726('0x1e')](_0x2342bc)['then'](function(_0x18e6e8){return _0x18e6e8;});}return null;};}function removeEntity(_0x506bfa,_0x544e66){return function(_0x38dcaa){if(_0x38dcaa){return _0x38dcaa[_0xc726('0x1f')]()[_0xc726('0x20')](function(){_0x506bfa[_0xc726('0x16')](0xcc)[_0xc726('0x21')]();});}};}function handleEntityNotFound(_0x238189,_0x193842){return function(_0x3ca20a){if(!_0x3ca20a){_0x238189[_0xc726('0x15')](0x194);}return _0x3ca20a;};}function handleError(_0x259591,_0x905e27){_0x905e27=_0x905e27||0x1f4;return function(_0x525b82){logger[_0xc726('0x22')](_0x525b82[_0xc726('0x23')]);if(_0x525b82['name']){delete _0x525b82[_0xc726('0x24')];}_0x259591[_0xc726('0x16')](_0x905e27)[_0xc726('0x25')](_0x525b82);};}exports[_0xc726('0x26')]=function(_0x3f457c,_0x38de15){var _0x233788={},_0x5e6b7f={},_0x37788e={'count':0x0,'rows':[]};var _0x19b8f5=db[_0xc726('0x27')]['rawAttributes'];_0x5e6b7f[_0xc726('0x28')]=_['keys'](_0x19b8f5);_0x5e6b7f[_0xc726('0x29')]=_[_0xc726('0x2a')](_0x3f457c[_0xc726('0x29')]);_0x5e6b7f[_0xc726('0x2b')]=_['intersection'](_0x5e6b7f[_0xc726('0x28')],_0x5e6b7f[_0xc726('0x29')]);_0x233788[_0xc726('0x2c')]=_['intersection'](_0x5e6b7f[_0xc726('0x28')],qs[_0xc726('0x2d')](_0x3f457c[_0xc726('0x29')][_0xc726('0x2d')]));_0x233788[_0xc726('0x2c')]=_0x233788[_0xc726('0x2c')][_0xc726('0x2e')]?_0x233788['attributes']:_0x5e6b7f[_0xc726('0x28')];if(!_0x3f457c[_0xc726('0x29')][_0xc726('0x2f')](_0xc726('0x30'))){_0x233788[_0xc726('0x1a')]=qs['limit'](_0x3f457c[_0xc726('0x29')][_0xc726('0x1a')]);_0x233788[_0xc726('0x19')]=qs[_0xc726('0x19')](_0x3f457c[_0xc726('0x29')][_0xc726('0x19')]);}_0x233788[_0xc726('0x31')]=qs[_0xc726('0x32')](_0x3f457c['query'][_0xc726('0x32')]);_0x233788[_0xc726('0x33')]=qs[_0xc726('0x2b')](_[_0xc726('0x34')](_0x3f457c[_0xc726('0x29')],_0x5e6b7f[_0xc726('0x2b')]));if(_0x3f457c[_0xc726('0x29')][_0xc726('0x35')]){_0x233788[_0xc726('0x33')]=_['merge'](_0x233788[_0xc726('0x33')],{'$or':_[_0xc726('0x36')](_0x19b8f5,function(_0x165418){if(_0x165418[_0xc726('0x37')][_0xc726('0x38')]!=='VIRTUAL'){var _0x3753f4={};_0x3753f4[_0x165418[_0xc726('0x39')]]={'$like':'%'+_0x3f457c['query'][_0xc726('0x35')]+'%'};return _0x3753f4;}})});}_0x233788=_['merge']({},_0x233788,_0x3f457c[_0xc726('0x3a')]);var _0x893ab2={'where':_0x233788['where']};return db[_0xc726('0x27')][_0xc726('0x18')](_0x893ab2)[_0xc726('0x20')](function(_0x50eac9){_0x37788e[_0xc726('0x18')]=_0x50eac9;if(_0x3f457c[_0xc726('0x29')][_0xc726('0x3b')]){_0x233788[_0xc726('0x3c')]=[{'all':!![]}];}return db[_0xc726('0x27')]['findAll'](_0x233788);})[_0xc726('0x20')](function(_0xf2d7dd){_0x37788e['rows']=_0xf2d7dd;return _0x37788e;})['then'](respondWithFilteredResult(_0x38de15,_0x233788))['catch'](handleError(_0x38de15,null));};exports[_0xc726('0x3d')]=function(_0x498bcc,_0x459f57){var _0x2fbddd={'raw':!![],'where':{'id':_0x498bcc[_0xc726('0x3e')]['id']}},_0x2cf47d={};_0x2cf47d[_0xc726('0x28')]=_[_0xc726('0x2a')](db['FreshdeskField'][_0xc726('0x3f')]);_0x2cf47d[_0xc726('0x29')]=_[_0xc726('0x2a')](_0x498bcc[_0xc726('0x29')]);_0x2cf47d[_0xc726('0x2b')]=_[_0xc726('0x40')](_0x2cf47d[_0xc726('0x28')],_0x2cf47d[_0xc726('0x29')]);_0x2fbddd[_0xc726('0x2c')]=_['intersection'](_0x2cf47d['model'],qs[_0xc726('0x2d')](_0x498bcc[_0xc726('0x29')][_0xc726('0x2d')]));_0x2fbddd[_0xc726('0x2c')]=_0x2fbddd[_0xc726('0x2c')]['length']?_0x2fbddd[_0xc726('0x2c')]:_0x2cf47d[_0xc726('0x28')];if(_0x498bcc[_0xc726('0x29')][_0xc726('0x3b')]){_0x2fbddd[_0xc726('0x3c')]=[{'all':!![]}];}_0x2fbddd=_['merge']({},_0x2fbddd,_0x498bcc[_0xc726('0x3a')]);return db['FreshdeskField'][_0xc726('0x41')](_0x2fbddd)[_0xc726('0x20')](handleEntityNotFound(_0x459f57,null))[_0xc726('0x20')](respondWithResult(_0x459f57,null))['catch'](handleError(_0x459f57,null));};exports[_0xc726('0x42')]=function(_0xb32ae7,_0x20af01){return db['FreshdeskField'][_0xc726('0x42')](_0xb32ae7['body'],{})[_0xc726('0x20')](respondWithResult(_0x20af01,0xc9))[_0xc726('0x43')](handleError(_0x20af01,null));};exports[_0xc726('0x1e')]=function(_0x3dc8e2,_0x379e31){if(_0x3dc8e2[_0xc726('0x44')]['id']){delete _0x3dc8e2['body']['id'];}return db[_0xc726('0x27')][_0xc726('0x41')]({'where':{'id':_0x3dc8e2[_0xc726('0x3e')]['id']}})[_0xc726('0x20')](handleEntityNotFound(_0x379e31,null))[_0xc726('0x20')](saveUpdates(_0x3dc8e2[_0xc726('0x44')],null))[_0xc726('0x20')](respondWithResult(_0x379e31,null))['catch'](handleError(_0x379e31,null));};exports['destroy']=function(_0x1e04d0,_0x1b6d4b){return db[_0xc726('0x27')][_0xc726('0x41')]({'where':{'id':_0x1e04d0[_0xc726('0x3e')]['id']}})[_0xc726('0x20')](handleEntityNotFound(_0x1b6d4b,null))[_0xc726('0x20')](removeEntity(_0x1b6d4b,null))[_0xc726('0x43')](handleError(_0x1b6d4b,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 619b868..3a9f35c 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 _0x0d1d=['moment','bluebird','request-promise','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x3c5d90,_0x43f607){var _0x1d12d2=function(_0x3a2171){while(--_0x3a2171){_0x3c5d90['push'](_0x3c5d90['shift']());}};_0x1d12d2(++_0x43f607);}(_0x0d1d,0xf8));var _0xd0d1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0d1d[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xd0d1('0x0'));var util=require(_0xd0d1('0x1'));var logger=require(_0xd0d1('0x2'))(_0xd0d1('0x3'));var moment=require(_0xd0d1('0x4'));var BPromise=require(_0xd0d1('0x5'));var rp=require(_0xd0d1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd0d1('0x7'));var attributes=require(_0xd0d1('0x8'));module[_0xd0d1('0x9')]=function(_0x412790,_0x39f2bf){return _0x412790[_0xd0d1('0xa')](_0xd0d1('0xb'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xd0d1('0xc'),_0xd0d1('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6502=['freshdesk_unique_index','idField','FieldId','lodash','util','api','bluebird','request-promise','rimraf','exports','define','int_freshdesk_fields'];(function(_0x576e2b,_0x328953){var _0x46461a=function(_0xce4d9e){while(--_0xce4d9e){_0x576e2b['push'](_0x576e2b['shift']());}};_0x46461a(++_0x328953);}(_0x6502,0x117));var _0x2650=function(_0x4c8632,_0xf414ad){_0x4c8632=_0x4c8632-0x0;var _0x27eeb7=_0x6502[_0x4c8632];return _0x27eeb7;};'use strict';var _=require(_0x2650('0x0'));var util=require(_0x2650('0x1'));var logger=require('../../config/logger')(_0x2650('0x2'));var moment=require('moment');var BPromise=require(_0x2650('0x3'));var rp=require(_0x2650('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2650('0x5'));var config=require('../../config/environment');var attributes=require('./intFreshdeskField.attributes');module[_0x2650('0x6')]=function(_0x14d8a0,_0x3555ae){return _0x14d8a0[_0x2650('0x7')]('FreshdeskField',attributes,{'tableName':_0x2650('0x8'),'paranoid':![],'indexes':[{'name':_0x2650('0x9'),'fields':[_0x2650('0xa'),_0x2650('0xb')],'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 7a07f08..35a9b2f 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 _0xe5b3=['request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FreshdeskField,\x20%s,\x20%s'];(function(_0x5d9867,_0x5e9030){var _0x7d2118=function(_0x2e5149){while(--_0x2e5149){_0x5d9867['push'](_0x5d9867['shift']());}};_0x7d2118(++_0x5e9030);}(_0xe5b3,0x133));var _0x3e5b=function(_0x2b77fb,_0x898d65){_0x2b77fb=_0x2b77fb-0x0;var _0x3bad33=_0xe5b3[_0x2b77fb];return _0x3bad33;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var moment=require(_0x3e5b('0x1'));var BPromise=require(_0x3e5b('0x2'));var rs=require(_0x3e5b('0x3'));var fs=require('fs');var Redis=require(_0x3e5b('0x4'));var db=require(_0x3e5b('0x5'))['db'];var utils=require(_0x3e5b('0x6'));var logger=require(_0x3e5b('0x7'))(_0x3e5b('0x8'));var config=require(_0x3e5b('0x9'));var jayson=require(_0x3e5b('0xa'));var client=jayson['client'][_0x3e5b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5dcf55,_0x534e7d,_0x41d46f){return new BPromise(function(_0x3901c2,_0x3c7c2e){return client[_0x3e5b('0xc')](_0x5dcf55,_0x41d46f)['then'](function(_0x4ed6bc){logger[_0x3e5b('0xd')](_0x3e5b('0xe'),_0x534e7d,_0x3e5b('0xf'));logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x534e7d,'request\x20sent',JSON[_0x3e5b('0x12')](_0x4ed6bc));if(_0x4ed6bc['error']){if(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x14')]===0x1f4){logger[_0x3e5b('0x13')](_0x3e5b('0xe'),_0x534e7d,_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);return _0x3c7c2e(_0x4ed6bc[_0x3e5b('0x13')]['message']);}logger[_0x3e5b('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x534e7d,_0x4ed6bc['error']['message']);return _0x3901c2(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);}else{logger[_0x3e5b('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x534e7d,_0x3e5b('0xf'));_0x3901c2(_0x4ed6bc['result']['message']);}})[_0x3e5b('0x16')](function(_0x11b41b){logger['error'](_0x3e5b('0xe'),_0x534e7d,_0x11b41b);_0x3c7c2e(_0x11b41b);});});} \ No newline at end of file +var _0x3140=['jayson/promise','client','http','request','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x52f6ef,_0x1d0756){var _0x5b6a22=function(_0x45edb5){while(--_0x45edb5){_0x52f6ef['push'](_0x52f6ef['shift']());}};_0x5b6a22(++_0x1d0756);}(_0x3140,0xaf));var _0x0314=function(_0xc34e78,_0x19638f){_0xc34e78=_0xc34e78-0x0;var _0x205de5=_0x3140[_0xc34e78];return _0x205de5;};'use strict';var _=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var moment=require(_0x0314('0x2'));var BPromise=require(_0x0314('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0314('0x4'))['db'];var utils=require(_0x0314('0x5'));var logger=require(_0x0314('0x6'))(_0x0314('0x7'));var config=require(_0x0314('0x8'));var jayson=require(_0x0314('0x9'));var client=jayson[_0x0314('0xa')][_0x0314('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11ee94,_0x44762d,_0x176944){return new BPromise(function(_0x495b27,_0x26031f){return client[_0x0314('0xc')](_0x11ee94,_0x176944)['then'](function(_0x5e9bca){logger[_0x0314('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x44762d,_0x0314('0xe'));logger[_0x0314('0xf')](_0x0314('0x10'),_0x44762d,_0x0314('0xe'),JSON[_0x0314('0x11')](_0x5e9bca));if(_0x5e9bca[_0x0314('0x12')]){if(_0x5e9bca['error'][_0x0314('0x13')]===0x1f4){logger[_0x0314('0x12')](_0x0314('0x14'),_0x44762d,_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);return _0x26031f(_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);}logger['error'](_0x0314('0x14'),_0x44762d,_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);return _0x495b27(_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);}else{logger[_0x0314('0xd')](_0x0314('0x14'),_0x44762d,_0x0314('0xe'));_0x495b27(_0x5e9bca['result'][_0x0314('0x15')]);}})[_0x0314('0x16')](function(_0x1f23c6){logger['error'](_0x0314('0x14'),_0x44762d,_0x1f23c6);_0x26031f(_0x1f23c6);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index ecbaced..4f4f683 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 _0xb4af=['/:id/fields','getFields','create','post','addConfiguration','put','update','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations'];(function(_0x3f2cfe,_0x16fd1c){var _0x36c4ae=function(_0x5893cb){while(--_0x5893cb){_0x3f2cfe['push'](_0x3f2cfe['shift']());}};_0x36c4ae(++_0x16fd1c);}(_0xb4af,0x189));var _0xfb4a=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xb4af[_0x1a36a5];return _0x746243;};'use strict';var multer=require(_0xfb4a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfb4a('0x1'));var express=require(_0xfb4a('0x2'));var router=express[_0xfb4a('0x3')]();var auth=require(_0xfb4a('0x4'));var interaction=require(_0xfb4a('0x5'));var config=require(_0xfb4a('0x6'));var controller=require(_0xfb4a('0x7'));router[_0xfb4a('0x8')]('/',auth[_0xfb4a('0x9')](),controller[_0xfb4a('0xa')]);router[_0xfb4a('0x8')](_0xfb4a('0xb'),auth[_0xfb4a('0x9')](),controller[_0xfb4a('0xc')]);router[_0xfb4a('0x8')](_0xfb4a('0xd'),auth[_0xfb4a('0x9')](),controller[_0xfb4a('0xe')]);router[_0xfb4a('0x8')](_0xfb4a('0xf'),auth[_0xfb4a('0x9')](),controller[_0xfb4a('0x10')]);router['post']('/',auth[_0xfb4a('0x9')](),controller[_0xfb4a('0x11')]);router[_0xfb4a('0x12')](_0xfb4a('0xd'),auth[_0xfb4a('0x9')](),controller[_0xfb4a('0x13')]);router[_0xfb4a('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xfb4a('0x15')]);router[_0xfb4a('0x16')](_0xfb4a('0xb'),auth[_0xfb4a('0x9')](),controller['destroy']);module[_0xfb4a('0x17')]=router; \ No newline at end of file +var _0x4a2e=['util','path','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','get','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','/:id','update','delete','destroy','exports','multer'];(function(_0x279924,_0x2965cc){var _0x4415bf=function(_0x14460b){while(--_0x14460b){_0x279924['push'](_0x279924['shift']());}};_0x4415bf(++_0x2965cc);}(_0x4a2e,0x125));var _0xe4a2=function(_0x4d7707,_0x9784ca){_0x4d7707=_0x4d7707-0x0;var _0x5d3421=_0x4a2e[_0x4d7707];return _0x5d3421;};'use strict';var multer=require(_0xe4a2('0x0'));var util=require(_0xe4a2('0x1'));var path=require(_0xe4a2('0x2'));var timeout=require('connect-timeout');var express=require(_0xe4a2('0x3'));var router=express[_0xe4a2('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xe4a2('0x5'));var config=require(_0xe4a2('0x6'));var controller=require('./intSalesforceAccount.controller');router['get']('/',auth[_0xe4a2('0x7')](),controller['index']);router[_0xe4a2('0x8')]('/:id',auth[_0xe4a2('0x7')](),controller['show']);router[_0xe4a2('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xe4a2('0x9')]);router[_0xe4a2('0x8')](_0xe4a2('0xa'),auth[_0xe4a2('0x7')](),controller[_0xe4a2('0xb')]);router[_0xe4a2('0xc')]('/',auth['isAuthenticated'](),controller[_0xe4a2('0xd')]);router[_0xe4a2('0xc')](_0xe4a2('0xe'),auth['isAuthenticated'](),controller[_0xe4a2('0xf')]);router['put'](_0xe4a2('0x10'),auth[_0xe4a2('0x7')](),controller[_0xe4a2('0x11')]);router[_0xe4a2('0x12')]('/:id',auth[_0xe4a2('0x7')](),controller[_0xe4a2('0x13')]);module[_0xe4a2('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 830f0f8..7b6e2d8 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 _0x4a34=['sequelize','STRING','ENUM','integrationTab','newTab'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x4a34,0x1ae));var _0x44a3=function(_0xc9efae,_0x3cdb84){_0xc9efae=_0xc9efae-0x0;var _0x4bf28b=_0x4a34[_0xc9efae];return _0x4bf28b;};'use strict';var Sequelize=require(_0x44a3('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x44a3('0x1')]},'username':{'type':Sequelize[_0x44a3('0x1')],'unique':'username'},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x44a3('0x1')]},'clientId':{'type':Sequelize[_0x44a3('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x44a3('0x1')]},'serverUrl':{'type':Sequelize[_0x44a3('0x1')]},'type':{'type':Sequelize[_0x44a3('0x2')](_0x44a3('0x3'),_0x44a3('0x4')),'defaultValue':_0x44a3('0x3')}}; \ No newline at end of file +var _0x77b0=['integrationTab','newTab','STRING','ENUM'];(function(_0x316510,_0x3e1cd6){var _0x352be0=function(_0xd74ac3){while(--_0xd74ac3){_0x316510['push'](_0x316510['shift']());}};_0x352be0(++_0x3e1cd6);}(_0x77b0,0x1c6));var _0x077b=function(_0x5cefbf,_0x3a1458){_0x5cefbf=_0x5cefbf-0x0;var _0x500c72=_0x77b0[_0x5cefbf];return _0x500c72;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x077b('0x0')]},'username':{'type':Sequelize[_0x077b('0x0')],'unique':'username'},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x077b('0x0')]},'clientId':{'type':Sequelize[_0x077b('0x0')]},'clientSecret':{'type':Sequelize[_0x077b('0x0')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x077b('0x1')](_0x077b('0x2'),_0x077b('0x3')),'defaultValue':_0x077b('0x2')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index cfc1262..ce82840 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 _0xe751=['getFields','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','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~!@#$%^&-_=+[{]}.','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','status','offset','limit','set','Content-Range','json','reject','update','destroy','end','stack','name','send','SalesforceAccount','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','where','pick','filter','merge','map','type','key','options','count','includeAll','include','catch','params','rawAttributes','create','find','getConfigurations','findOne','sort','addConfiguration','body','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceField','remoteUri','clientId','clientSecret','username','password','substring','lastIndexOf','Connection','concat','isNil','ticketType','sobject','describe','CallDisposition','CallDurationInSeconds','CallObject','IsArchived','Case','Type','Origin','Reason','Status','Priority','SuppliedName','SuppliedCompany','remove','custom','label','picklistValues','boolean','True','false','getFields,\x20%s,\x20%s,\x20%s'];(function(_0x438f7d,_0x53e39b){var _0x548365=function(_0x3aeefc){while(--_0x3aeefc){_0x438f7d['push'](_0x438f7d['shift']());}};_0x548365(++_0x53e39b);}(_0xe751,0xf7));var _0x1e75=function(_0x2cf396,_0x441789){_0x2cf396=_0x2cf396-0x0;var _0x4176ad=_0xe751[_0x2cf396];return _0x4176ad;};'use strict';var pdf=require(_0x1e75('0x0'));var emlformat=require(_0x1e75('0x1'));var rimraf=require(_0x1e75('0x2'));var zipdir=require(_0x1e75('0x3'));var jsonpatch=require(_0x1e75('0x4'));var rp=require(_0x1e75('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1e75('0x6'));var util=require('util');var path=require(_0x1e75('0x7'));var sox=require(_0x1e75('0x8'));var csv=require(_0x1e75('0x9'));var ejs=require(_0x1e75('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1e75('0xb'));var crypto=require(_0x1e75('0xc'));var jsforce=require(_0x1e75('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1e75('0x9'));var querystring=require(_0x1e75('0xe'));var Papa=require(_0x1e75('0xf'));var Redis=require(_0x1e75('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x1e75('0x11'));var logger=require(_0x1e75('0x12'))(_0x1e75('0x13'));var utils=require(_0x1e75('0x14'));var config=require('../../config/environment');var db=require(_0x1e75('0x15'))['db'];var integrations=require(_0x1e75('0x16'));var jayson=require(_0x1e75('0x17'));var client=jayson[_0x1e75('0x18')][_0x1e75('0x19')]({'port':0x232a});function checkPasswordPattern(_0x275bb8,_0xd8570d,_0x2d867c){if(_0x2d867c){var _0x57c8c9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x57c8c9[_0x1e75('0x1a')](_0xd8570d)){return _0x275bb8;}else{throw new Error(_0x1e75('0x1b'));}}else{return _0x275bb8;}}function respondWithRpcPromise(_0x29377e,_0x24abe0,_0xd73ee6,_0x22c381){return new BPromise(function(_0x371cea,_0x3eda0a){var _0x519f76=_0x22c381||client;return _0x519f76['request'](_0x29377e,_0xd73ee6)[_0x1e75('0x1c')](function(_0x3d2e95){logger[_0x1e75('0x1d')](_0x1e75('0x1e'),_0x24abe0,_0x1e75('0x1f'));logger[_0x1e75('0x20')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x24abe0,_0x1e75('0x1f'),JSON['stringify'](_0x3d2e95));if(_0x3d2e95[_0x1e75('0x21')]){if(_0x3d2e95[_0x1e75('0x21')][_0x1e75('0x22')]===0x1f4){logger['error'](_0x1e75('0x1e'),_0x24abe0,_0x3d2e95['error'][_0x1e75('0x23')]);return _0x3eda0a(_0x3d2e95[_0x1e75('0x21')][_0x1e75('0x23')]);}logger[_0x1e75('0x21')]('SalesforceAccount,\x20%s,\x20%s',_0x24abe0,_0x3d2e95[_0x1e75('0x21')][_0x1e75('0x23')]);return _0x371cea(_0x3d2e95[_0x1e75('0x21')][_0x1e75('0x23')]);}else{logger[_0x1e75('0x1d')](_0x1e75('0x1e'),_0x24abe0,_0x1e75('0x1f'));_0x371cea(_0x3d2e95[_0x1e75('0x24')]['message']);}})['catch'](function(_0x961204){logger[_0x1e75('0x21')](_0x1e75('0x1e'),_0x24abe0,_0x961204);_0x3eda0a(_0x961204);});});}function respondWithStatusCode(_0x449727,_0xa96ce4){_0xa96ce4=_0xa96ce4||0xcc;return function(_0x25e354){if(_0x25e354){return _0x449727[_0x1e75('0x25')](_0xa96ce4);}return _0x449727[_0x1e75('0x26')](_0xa96ce4)['end']();};}function respondWithResult(_0x3d85a2,_0x25694f){_0x25694f=_0x25694f||0xc8;return function(_0x5a2da1){if(_0x5a2da1){return _0x3d85a2[_0x1e75('0x26')](_0x25694f)['json'](_0x5a2da1);}};}function respondWithFilteredResult(_0x28e138,_0x583e1d){return function(_0x6a17b4){if(_0x6a17b4){var _0x1d169c=_0x6a17b4['count'],_0x25beba=_0x583e1d['offset'],_0xe86821=_0x583e1d[_0x1e75('0x27')]+_0x583e1d[_0x1e75('0x28')],_0x2c0c30;if(_0xe86821>=_0x1d169c){_0xe86821=_0x1d169c;_0x2c0c30=0xc8;}else{_0x2c0c30=0xce;}_0x28e138[_0x1e75('0x26')](_0x2c0c30);return _0x28e138[_0x1e75('0x29')](_0x1e75('0x2a'),_0x25beba+'-'+_0xe86821+'/'+_0x1d169c)[_0x1e75('0x2b')](_0x6a17b4);}return null;};}function patchUpdates(_0x5c6da5){return function(_0x527d4e){try{jsonpatch['apply'](_0x527d4e,_0x5c6da5,!![]);}catch(_0x7469ca){return BPromise[_0x1e75('0x2c')](_0x7469ca);}return _0x527d4e['save']();};}function saveUpdates(_0x18b107,_0x425d10){return function(_0x53b5f0){if(_0x53b5f0){return _0x53b5f0[_0x1e75('0x2d')](_0x18b107)[_0x1e75('0x1c')](function(_0x24edc7){return _0x24edc7;});}return null;};}function removeEntity(_0x16f72d,_0x243438){return function(_0x58fd62){if(_0x58fd62){return _0x58fd62[_0x1e75('0x2e')]()['then'](function(){_0x16f72d['status'](0xcc)[_0x1e75('0x2f')]();});}};}function handleEntityNotFound(_0x123d4f,_0x1116f8){return function(_0x51de84){if(!_0x51de84){_0x123d4f[_0x1e75('0x25')](0x194);}return _0x51de84;};}function handleError(_0x26565c,_0x562b7f){_0x562b7f=_0x562b7f||0x1f4;return function(_0x4f495c){logger[_0x1e75('0x21')](_0x4f495c[_0x1e75('0x30')]);if(_0x4f495c['name']){delete _0x4f495c[_0x1e75('0x31')];}_0x26565c[_0x1e75('0x26')](_0x562b7f)[_0x1e75('0x32')](_0x4f495c);};}exports['index']=function(_0x5965eb,_0x326d44){var _0x5263ba={},_0xae9fca={},_0x2d5d68={'count':0x0,'rows':[]};var _0x4218ef=db[_0x1e75('0x33')]['rawAttributes'];_0xae9fca[_0x1e75('0x34')]=_[_0x1e75('0x35')](_0x4218ef);_0xae9fca[_0x1e75('0x36')]=_['keys'](_0x5965eb['query']);_0xae9fca[_0x1e75('0x37')]=_['intersection'](_0xae9fca[_0x1e75('0x34')],_0xae9fca[_0x1e75('0x36')]);_0x5263ba[_0x1e75('0x38')]=_[_0x1e75('0x39')](_0xae9fca[_0x1e75('0x34')],qs[_0x1e75('0x3a')](_0x5965eb[_0x1e75('0x36')]['fields']));_0x5263ba[_0x1e75('0x38')]=_0x5263ba[_0x1e75('0x38')][_0x1e75('0x3b')]?_0x5263ba[_0x1e75('0x38')]:_0xae9fca[_0x1e75('0x34')];if(!_0x5965eb[_0x1e75('0x36')][_0x1e75('0x3c')]('nolimit')){_0x5263ba[_0x1e75('0x28')]=qs['limit'](_0x5965eb[_0x1e75('0x36')][_0x1e75('0x28')]);_0x5263ba[_0x1e75('0x27')]=qs['offset'](_0x5965eb[_0x1e75('0x36')][_0x1e75('0x27')]);}_0x5263ba[_0x1e75('0x3d')]=qs['sort'](_0x5965eb['query']['sort']);_0x5263ba[_0x1e75('0x3e')]=qs['filters'](_[_0x1e75('0x3f')](_0x5965eb[_0x1e75('0x36')],_0xae9fca[_0x1e75('0x37')]));if(_0x5965eb[_0x1e75('0x36')][_0x1e75('0x40')]){_0x5263ba[_0x1e75('0x3e')]=_[_0x1e75('0x41')](_0x5263ba[_0x1e75('0x3e')],{'$or':_[_0x1e75('0x42')](_0x4218ef,function(_0x450145){if(_0x450145[_0x1e75('0x43')][_0x1e75('0x44')]!=='VIRTUAL'){var _0x2d9013={};_0x2d9013[_0x450145['field']]={'$like':'%'+_0x5965eb['query'][_0x1e75('0x40')]+'%'};return _0x2d9013;}})});}_0x5263ba=_[_0x1e75('0x41')]({},_0x5263ba,_0x5965eb[_0x1e75('0x45')]);var _0x3b7a6f={'where':_0x5263ba[_0x1e75('0x3e')]};return db[_0x1e75('0x33')]['count'](_0x3b7a6f)[_0x1e75('0x1c')](function(_0x321c61){_0x2d5d68[_0x1e75('0x46')]=_0x321c61;if(_0x5965eb['query'][_0x1e75('0x47')]){_0x5263ba[_0x1e75('0x48')]=[{'all':!![]}];}return db['SalesforceAccount']['findAll'](_0x5263ba);})['then'](function(_0x3d8c49){_0x2d5d68['rows']=_0x3d8c49;return _0x2d5d68;})[_0x1e75('0x1c')](respondWithFilteredResult(_0x326d44,_0x5263ba))[_0x1e75('0x49')](handleError(_0x326d44,null));};exports['show']=function(_0x596315,_0x1299db){var _0x49b47f={'raw':![],'where':{'id':_0x596315[_0x1e75('0x4a')]['id']}},_0x1f8d9c={};_0x1f8d9c[_0x1e75('0x34')]=_[_0x1e75('0x35')](db[_0x1e75('0x33')][_0x1e75('0x4b')]);_0x1f8d9c[_0x1e75('0x36')]=_['keys'](_0x596315['query']);_0x1f8d9c[_0x1e75('0x37')]=_['intersection'](_0x1f8d9c[_0x1e75('0x34')],_0x1f8d9c[_0x1e75('0x36')]);_0x49b47f[_0x1e75('0x38')]=_[_0x1e75('0x39')](_0x1f8d9c['model'],qs[_0x1e75('0x3a')](_0x596315[_0x1e75('0x36')][_0x1e75('0x3a')]));_0x49b47f[_0x1e75('0x38')]=_0x49b47f[_0x1e75('0x38')]['length']?_0x49b47f[_0x1e75('0x38')]:_0x1f8d9c[_0x1e75('0x34')];if(_0x596315[_0x1e75('0x36')]['includeAll']){_0x49b47f[_0x1e75('0x48')]=[{'all':!![]}];}_0x49b47f=_['merge']({},_0x49b47f,_0x596315[_0x1e75('0x45')]);return db[_0x1e75('0x33')]['find'](_0x49b47f)[_0x1e75('0x1c')](handleEntityNotFound(_0x1299db,null))[_0x1e75('0x1c')](respondWithResult(_0x1299db,null))[_0x1e75('0x49')](handleError(_0x1299db,null));};exports[_0x1e75('0x4c')]=function(_0x4e886e,_0x5d2643){return db[_0x1e75('0x33')][_0x1e75('0x4c')](_0x4e886e['body'],{})[_0x1e75('0x1c')](respondWithResult(_0x5d2643,0xc9))['catch'](handleError(_0x5d2643,null));};exports[_0x1e75('0x2d')]=function(_0x564928,_0x415483){if(_0x564928['body']['id']){delete _0x564928['body']['id'];}return db[_0x1e75('0x33')][_0x1e75('0x4d')]({'where':{'id':_0x564928[_0x1e75('0x4a')]['id']}})[_0x1e75('0x1c')](handleEntityNotFound(_0x415483,null))['then'](saveUpdates(_0x564928['body'],null))['then'](respondWithResult(_0x415483,null))['catch'](handleError(_0x415483,null));};exports[_0x1e75('0x2e')]=function(_0x524124,_0x692028){return db[_0x1e75('0x33')]['find']({'where':{'id':_0x524124['params']['id']}})[_0x1e75('0x1c')](handleEntityNotFound(_0x692028,null))['then'](removeEntity(_0x692028,null))[_0x1e75('0x49')](handleError(_0x692028,null));};exports[_0x1e75('0x4e')]=function(_0x2ef345,_0x51fb43,_0x5e2196){var _0x4ca3c2={};var _0x26ccb7={};var _0x17d86f;var _0x59a0ab;return db[_0x1e75('0x33')][_0x1e75('0x4f')]({'where':{'id':_0x2ef345[_0x1e75('0x4a')]['id']}})[_0x1e75('0x1c')](handleEntityNotFound(_0x51fb43,null))[_0x1e75('0x1c')](function(_0x5e7413){if(_0x5e7413){_0x17d86f=_0x5e7413;_0x26ccb7[_0x1e75('0x34')]=_['keys'](db['SalesforceConfiguration'][_0x1e75('0x4b')]);_0x26ccb7[_0x1e75('0x36')]=_['keys'](_0x2ef345['query']);_0x26ccb7[_0x1e75('0x37')]=_[_0x1e75('0x39')](_0x26ccb7[_0x1e75('0x34')],_0x26ccb7[_0x1e75('0x36')]);_0x4ca3c2[_0x1e75('0x38')]=_['intersection'](_0x26ccb7['model'],qs[_0x1e75('0x3a')](_0x2ef345['query'][_0x1e75('0x3a')]));_0x4ca3c2[_0x1e75('0x38')]=_0x4ca3c2[_0x1e75('0x38')][_0x1e75('0x3b')]?_0x4ca3c2[_0x1e75('0x38')]:_0x26ccb7[_0x1e75('0x34')];_0x4ca3c2['order']=qs[_0x1e75('0x50')](_0x2ef345[_0x1e75('0x36')][_0x1e75('0x50')]);_0x4ca3c2[_0x1e75('0x3e')]=qs[_0x1e75('0x37')](_['pick'](_0x2ef345[_0x1e75('0x36')],_0x26ccb7[_0x1e75('0x37')]));if(_0x2ef345[_0x1e75('0x36')][_0x1e75('0x40')]){_0x4ca3c2[_0x1e75('0x3e')]=_[_0x1e75('0x41')](_0x4ca3c2['where'],{'$or':_[_0x1e75('0x42')](_0x4ca3c2['attributes'],function(_0x5ce969){var _0x20da31={};_0x20da31[_0x5ce969]={'$like':'%'+_0x2ef345[_0x1e75('0x36')]['filter']+'%'};return _0x20da31;})});}_0x4ca3c2=_[_0x1e75('0x41')]({},_0x4ca3c2,_0x2ef345[_0x1e75('0x45')]);return _0x17d86f[_0x1e75('0x4e')](_0x4ca3c2);}})[_0x1e75('0x1c')](function(_0x39882c){if(_0x39882c){_0x59a0ab=_0x39882c[_0x1e75('0x3b')];if(!_0x2ef345[_0x1e75('0x36')]['hasOwnProperty']('nolimit')){_0x4ca3c2[_0x1e75('0x28')]=qs[_0x1e75('0x28')](_0x2ef345['query']['limit']);_0x4ca3c2[_0x1e75('0x27')]=qs[_0x1e75('0x27')](_0x2ef345['query'][_0x1e75('0x27')]);}return _0x17d86f['getConfigurations'](_0x4ca3c2);}})[_0x1e75('0x1c')](function(_0x1e6ffb){if(_0x1e6ffb){return _0x1e6ffb?{'count':_0x59a0ab,'rows':_0x1e6ffb}:null;}})[_0x1e75('0x1c')](respondWithResult(_0x51fb43,null))[_0x1e75('0x49')](handleError(_0x51fb43,null));};exports[_0x1e75('0x51')]=function(_0xd8b836,_0x6fe5c4,_0x581bbd){if(_0xd8b836['body']['id']){delete _0xd8b836[_0x1e75('0x52')]['id'];}return db[_0x1e75('0x33')][_0x1e75('0x4f')]({'where':{'id':_0xd8b836[_0x1e75('0x4a')]['id']}})[_0x1e75('0x1c')](handleEntityNotFound(_0x6fe5c4,null))['then'](function(_0x389f9){if(_0x389f9){_0xd8b836[_0x1e75('0x52')][_0x1e75('0x53')]=_0x389f9['id'];_0xd8b836[_0x1e75('0x52')][_0x1e75('0x54')]=integrations[_0x1e75('0x55')](_0xd8b836[_0x1e75('0x52')][_0x1e75('0x56')],_0xd8b836[_0x1e75('0x52')][_0x1e75('0x43')]);_0xd8b836[_0x1e75('0x52')][_0x1e75('0x57')]=integrations['getDescriptions'](_0xd8b836['body'][_0x1e75('0x56')],_0xd8b836[_0x1e75('0x52')][_0x1e75('0x43')]);return db['SalesforceConfiguration'][_0x1e75('0x4c')](_0xd8b836[_0x1e75('0x52')],{'include':[{'model':db['SalesforceField'],'as':_0x1e75('0x54')},{'model':db[_0x1e75('0x58')],'as':_0x1e75('0x57')}]});}return null;})[_0x1e75('0x1c')](respondWithResult(_0x6fe5c4,null))[_0x1e75('0x49')](handleError(_0x6fe5c4,null));};exports['getFields']=function(_0x21bf48,_0x2d91e0,_0x5a0a40){var _0x18d059;var _0x30167f='';var _0xcf7860='Task';return db[_0x1e75('0x33')][_0x1e75('0x4f')]({'where':{'id':_0x21bf48['params']['id']},'attributes':['id',_0x1e75('0x59'),_0x1e75('0x5a'),_0x1e75('0x5b'),_0x1e75('0x5c'),_0x1e75('0x5d'),'securityToken']})[_0x1e75('0x1c')](handleEntityNotFound(_0x2d91e0,null))['then'](function(_0x192dca){if(_0x192dca){_0x30167f=_0x192dca['remoteUri'];var _0x31db5c=_0x30167f['slice'](-0x1);if(_0x31db5c==='/'){_0x30167f=_0x30167f[_0x1e75('0x5e')](0x0,_0x30167f[_0x1e75('0x5f')](_0x31db5c));}_0x18d059=new jsforce[(_0x1e75('0x60'))]({'oauth2':{'loginUrl':_0x30167f,'clientId':_0x192dca[_0x1e75('0x5a')],'clientSecret':_0x192dca[_0x1e75('0x5b')]}});return _0x18d059['login'](_0x192dca[_0x1e75('0x5c')],_0x192dca['password'][_0x1e75('0x61')](_0x192dca['securityToken']));}})[_0x1e75('0x1c')](function(_0x4f0d29){if(_0x4f0d29){if(!_[_0x1e75('0x62')](_0x21bf48['query'][_0x1e75('0x63')])){_0xcf7860=_0x21bf48[_0x1e75('0x36')][_0x1e75('0x63')];}return _0x18d059[_0x1e75('0x64')](_0xcf7860)[_0x1e75('0x65')]();}})[_0x1e75('0x1c')](function(_0x3315f1){var _0x49c741=[_0x1e75('0x66'),_0x1e75('0x67'),_0x1e75('0x68'),'CallType',_0x1e75('0x69'),'Priority','Status','Type'];if(!_[_0x1e75('0x62')](_0x21bf48['query'][_0x1e75('0x63')])&&_0x21bf48[_0x1e75('0x36')][_0x1e75('0x63')]===_0x1e75('0x6a')){_0x49c741=[_0x1e75('0x6b'),_0x1e75('0x6c'),_0x1e75('0x6d'),_0x1e75('0x6e'),_0x1e75('0x6f'),'IsEscalated',_0x1e75('0x70'),_0x1e75('0x71')];}if(_0x3315f1){_[_0x1e75('0x72')](_0x3315f1[_0x1e75('0x3a')],function(_0x329366){return _0x329366[_0x1e75('0x73')]===![]&&!_0x49c741['includes'](_0x329366[_0x1e75('0x31')]);});return{'count':_0x3315f1[_0x1e75('0x3a')]['length'],'rows':_[_0x1e75('0x42')](_0x3315f1['fields'],function(_0x4bf650){return{'id':_0x4bf650[_0x1e75('0x31')],'name':_0x4bf650[_0x1e75('0x74')],'custom':_0x4bf650[_0x1e75('0x73')],'options':_0x4bf650[_0x1e75('0x75')]['length']>0x0?_[_0x1e75('0x42')](_0x4bf650[_0x1e75('0x75')],function(_0x34c709){return{'name':_0x34c709[_0x1e75('0x74')],'value':_0x34c709['value']};}):_0x4bf650[_0x1e75('0x43')]==_0x1e75('0x76')?[{'name':_0x1e75('0x77'),'value':'true'},{'name':'False','value':_0x1e75('0x78')}]:[]};})};}})[_0x1e75('0x1c')](respondWithResult(_0x2d91e0,null))[_0x1e75('0x49')](function(_0x2a0c1e){var _0x55863f=_0x21bf48[_0x1e75('0x36')][_0x1e75('0x1a')]?0x1f4:_0x2a0c1e['statusCode']||0x1f4;logger[_0x1e75('0x21')](_0x1e75('0x79'),_0x1e75('0x7a'),_0x55863f,JSON['stringify'](_0x2a0c1e));delete _0x2a0c1e['name'];if(_0x55863f===0x191){_0x55863f=0x190;}_0x2d91e0[_0x1e75('0x26')](_0x55863f)['send'](_0x21bf48[_0x1e75('0x36')][_0x1e75('0x1a')]?{'message':'Wrong\x20credentials','statusCode':_0x2a0c1e['statusCode']}:_0x2a0c1e);});}; \ No newline at end of file +var _0x9bdf=['name','send','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','type','key','VIRTUAL','field','filter','merge','options','includeAll','SalesforceAccount','rows','find','create','body','update','params','getConfigurations','SalesforceConfiguration','order','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','slice','substring','lastIndexOf','Connection','login','concat','securityToken','ticketType','describe','CallDisposition','CallDurationInSeconds','CallObject','CallType','IsArchived','Status','Type','isNil','Case','Origin','Priority','SuppliedName','remove','custom','includes','map','picklistValues','label','value','boolean','True','true','test','statusCode','Wrong\x20credentials','html-pdf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','request','info','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SalesforceAccount,\x20%s,\x20%s','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','save','then','destroy','sendStatus','stack'];(function(_0x54f3e8,_0x3ed493){var _0x267b37=function(_0x58247e){while(--_0x58247e){_0x54f3e8['push'](_0x54f3e8['shift']());}};_0x267b37(++_0x3ed493);}(_0x9bdf,0x1dd));var _0xf9bd=function(_0x29f898,_0x19e965){_0x29f898=_0x29f898-0x0;var _0xe54e4c=_0x9bdf[_0x29f898];return _0xe54e4c;};'use strict';var pdf=require(_0xf9bd('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf9bd('0x1'));var rp=require('request-promise');var moment=require(_0xf9bd('0x2'));var BPromise=require(_0xf9bd('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf9bd('0x4'));var sox=require(_0xf9bd('0x5'));var csv=require(_0xf9bd('0x6'));var ejs=require(_0xf9bd('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf9bd('0x8'));var crypto=require(_0xf9bd('0x9'));var jsforce=require(_0xf9bd('0xa'));var deskjs=require(_0xf9bd('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf9bd('0xc'));var Papa=require('papaparse');var Redis=require(_0xf9bd('0xd'));var authService=require(_0xf9bd('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf9bd('0xf'));var logger=require(_0xf9bd('0x10'))('api');var utils=require(_0xf9bd('0x11'));var config=require(_0xf9bd('0x12'));var db=require(_0xf9bd('0x13'))['db'];var integrations=require(_0xf9bd('0x14'));var jayson=require('jayson/promise');var client=jayson[_0xf9bd('0x15')][_0xf9bd('0x16')]({'port':0x232a});function checkPasswordPattern(_0x3db689,_0x36d90d,_0x4728f6){if(_0x4728f6){var _0x3dcfc8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3dcfc8['test'](_0x36d90d)){return _0x3db689;}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 _0x3db689;}}function respondWithRpcPromise(_0x225ed5,_0xa6f418,_0x33d727,_0x409858){return new BPromise(function(_0x83bc53,_0x2d8a36){var _0x521075=_0x409858||client;return _0x521075[_0xf9bd('0x17')](_0x225ed5,_0x33d727)['then'](function(_0x13594d){logger[_0xf9bd('0x18')]('SalesforceAccount,\x20%s,\x20%s',_0xa6f418,'request\x20sent');logger[_0xf9bd('0x19')](_0xf9bd('0x1a'),_0xa6f418,_0xf9bd('0x1b'),JSON[_0xf9bd('0x1c')](_0x13594d));if(_0x13594d[_0xf9bd('0x1d')]){if(_0x13594d[_0xf9bd('0x1d')]['code']===0x1f4){logger[_0xf9bd('0x1d')](_0xf9bd('0x1e'),_0xa6f418,_0x13594d[_0xf9bd('0x1d')]['message']);return _0x2d8a36(_0x13594d[_0xf9bd('0x1d')][_0xf9bd('0x1f')]);}logger[_0xf9bd('0x1d')](_0xf9bd('0x1e'),_0xa6f418,_0x13594d[_0xf9bd('0x1d')]['message']);return _0x83bc53(_0x13594d[_0xf9bd('0x1d')][_0xf9bd('0x1f')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0xa6f418,_0xf9bd('0x1b'));_0x83bc53(_0x13594d[_0xf9bd('0x20')][_0xf9bd('0x1f')]);}})[_0xf9bd('0x21')](function(_0x46db7f){logger[_0xf9bd('0x1d')](_0xf9bd('0x1e'),_0xa6f418,_0x46db7f);_0x2d8a36(_0x46db7f);});});}function respondWithStatusCode(_0xf1e4a3,_0x5dafa8){_0x5dafa8=_0x5dafa8||0xcc;return function(_0x20b81f){if(_0x20b81f){return _0xf1e4a3['sendStatus'](_0x5dafa8);}return _0xf1e4a3[_0xf9bd('0x22')](_0x5dafa8)[_0xf9bd('0x23')]();};}function respondWithResult(_0x2843d9,_0x47b841){_0x47b841=_0x47b841||0xc8;return function(_0x4a2ce9){if(_0x4a2ce9){return _0x2843d9['status'](_0x47b841)[_0xf9bd('0x24')](_0x4a2ce9);}};}function respondWithFilteredResult(_0x176305,_0x70b16b){return function(_0x5aff23){if(_0x5aff23){var _0x4ed500=_0x5aff23[_0xf9bd('0x25')],_0x33a787=_0x70b16b[_0xf9bd('0x26')],_0x30425c=_0x70b16b['offset']+_0x70b16b[_0xf9bd('0x27')],_0x4ca556;if(_0x30425c>=_0x4ed500){_0x30425c=_0x4ed500;_0x4ca556=0xc8;}else{_0x4ca556=0xce;}_0x176305['status'](_0x4ca556);return _0x176305[_0xf9bd('0x28')](_0xf9bd('0x29'),_0x33a787+'-'+_0x30425c+'/'+_0x4ed500)[_0xf9bd('0x24')](_0x5aff23);}return null;};}function patchUpdates(_0x441693){return function(_0x36583a){try{jsonpatch['apply'](_0x36583a,_0x441693,!![]);}catch(_0x3b6397){return BPromise['reject'](_0x3b6397);}return _0x36583a[_0xf9bd('0x2a')]();};}function saveUpdates(_0x419d84,_0x5f153a){return function(_0x260bc6){if(_0x260bc6){return _0x260bc6['update'](_0x419d84)[_0xf9bd('0x2b')](function(_0x82e6d7){return _0x82e6d7;});}return null;};}function removeEntity(_0x5a0397,_0xd517e4){return function(_0x1fde23){if(_0x1fde23){return _0x1fde23[_0xf9bd('0x2c')]()['then'](function(){_0x5a0397['status'](0xcc)[_0xf9bd('0x23')]();});}};}function handleEntityNotFound(_0x584d2a,_0xe483ef){return function(_0x217fb8){if(!_0x217fb8){_0x584d2a[_0xf9bd('0x2d')](0x194);}return _0x217fb8;};}function handleError(_0x5e6adf,_0x4d1a84){_0x4d1a84=_0x4d1a84||0x1f4;return function(_0xd2c055){logger[_0xf9bd('0x1d')](_0xd2c055[_0xf9bd('0x2e')]);if(_0xd2c055[_0xf9bd('0x2f')]){delete _0xd2c055['name'];}_0x5e6adf[_0xf9bd('0x22')](_0x4d1a84)[_0xf9bd('0x30')](_0xd2c055);};}exports['index']=function(_0x4403f8,_0x57beda){var _0x24a7a1={},_0x5cc3e={},_0x3c7de0={'count':0x0,'rows':[]};var _0x577292=db['SalesforceAccount'][_0xf9bd('0x31')];_0x5cc3e['model']=_[_0xf9bd('0x32')](_0x577292);_0x5cc3e['query']=_['keys'](_0x4403f8[_0xf9bd('0x33')]);_0x5cc3e[_0xf9bd('0x34')]=_[_0xf9bd('0x35')](_0x5cc3e['model'],_0x5cc3e['query']);_0x24a7a1['attributes']=_['intersection'](_0x5cc3e[_0xf9bd('0x36')],qs[_0xf9bd('0x37')](_0x4403f8[_0xf9bd('0x33')][_0xf9bd('0x37')]));_0x24a7a1[_0xf9bd('0x38')]=_0x24a7a1[_0xf9bd('0x38')][_0xf9bd('0x39')]?_0x24a7a1[_0xf9bd('0x38')]:_0x5cc3e[_0xf9bd('0x36')];if(!_0x4403f8['query'][_0xf9bd('0x3a')](_0xf9bd('0x3b'))){_0x24a7a1[_0xf9bd('0x27')]=qs[_0xf9bd('0x27')](_0x4403f8[_0xf9bd('0x33')][_0xf9bd('0x27')]);_0x24a7a1[_0xf9bd('0x26')]=qs[_0xf9bd('0x26')](_0x4403f8[_0xf9bd('0x33')][_0xf9bd('0x26')]);}_0x24a7a1['order']=qs[_0xf9bd('0x3c')](_0x4403f8[_0xf9bd('0x33')]['sort']);_0x24a7a1[_0xf9bd('0x3d')]=qs['filters'](_[_0xf9bd('0x3e')](_0x4403f8[_0xf9bd('0x33')],_0x5cc3e[_0xf9bd('0x34')]));if(_0x4403f8['query']['filter']){_0x24a7a1[_0xf9bd('0x3d')]=_['merge'](_0x24a7a1['where'],{'$or':_['map'](_0x577292,function(_0x908e8b){if(_0x908e8b[_0xf9bd('0x3f')][_0xf9bd('0x40')]!==_0xf9bd('0x41')){var _0x57e844={};_0x57e844[_0x908e8b[_0xf9bd('0x42')]]={'$like':'%'+_0x4403f8[_0xf9bd('0x33')][_0xf9bd('0x43')]+'%'};return _0x57e844;}})});}_0x24a7a1=_[_0xf9bd('0x44')]({},_0x24a7a1,_0x4403f8[_0xf9bd('0x45')]);var _0x267298={'where':_0x24a7a1[_0xf9bd('0x3d')]};return db['SalesforceAccount'][_0xf9bd('0x25')](_0x267298)['then'](function(_0x40bc3f){_0x3c7de0['count']=_0x40bc3f;if(_0x4403f8[_0xf9bd('0x33')][_0xf9bd('0x46')]){_0x24a7a1['include']=[{'all':!![]}];}return db[_0xf9bd('0x47')]['findAll'](_0x24a7a1);})[_0xf9bd('0x2b')](function(_0x13ad2e){_0x3c7de0[_0xf9bd('0x48')]=_0x13ad2e;return _0x3c7de0;})[_0xf9bd('0x2b')](respondWithFilteredResult(_0x57beda,_0x24a7a1))[_0xf9bd('0x21')](handleError(_0x57beda,null));};exports['show']=function(_0x523a09,_0xd70236){var _0x14f2ef={'raw':![],'where':{'id':_0x523a09['params']['id']}},_0x5209b5={};_0x5209b5[_0xf9bd('0x36')]=_[_0xf9bd('0x32')](db[_0xf9bd('0x47')][_0xf9bd('0x31')]);_0x5209b5['query']=_['keys'](_0x523a09['query']);_0x5209b5[_0xf9bd('0x34')]=_['intersection'](_0x5209b5['model'],_0x5209b5[_0xf9bd('0x33')]);_0x14f2ef[_0xf9bd('0x38')]=_['intersection'](_0x5209b5[_0xf9bd('0x36')],qs['fields'](_0x523a09['query'][_0xf9bd('0x37')]));_0x14f2ef[_0xf9bd('0x38')]=_0x14f2ef[_0xf9bd('0x38')][_0xf9bd('0x39')]?_0x14f2ef[_0xf9bd('0x38')]:_0x5209b5[_0xf9bd('0x36')];if(_0x523a09['query']['includeAll']){_0x14f2ef['include']=[{'all':!![]}];}_0x14f2ef=_[_0xf9bd('0x44')]({},_0x14f2ef,_0x523a09[_0xf9bd('0x45')]);return db[_0xf9bd('0x47')][_0xf9bd('0x49')](_0x14f2ef)[_0xf9bd('0x2b')](handleEntityNotFound(_0xd70236,null))[_0xf9bd('0x2b')](respondWithResult(_0xd70236,null))[_0xf9bd('0x21')](handleError(_0xd70236,null));};exports[_0xf9bd('0x4a')]=function(_0xceb740,_0xce6a74){return db[_0xf9bd('0x47')][_0xf9bd('0x4a')](_0xceb740[_0xf9bd('0x4b')],{})[_0xf9bd('0x2b')](respondWithResult(_0xce6a74,0xc9))[_0xf9bd('0x21')](handleError(_0xce6a74,null));};exports[_0xf9bd('0x4c')]=function(_0x3aef73,_0xfb1db9){if(_0x3aef73[_0xf9bd('0x4b')]['id']){delete _0x3aef73[_0xf9bd('0x4b')]['id'];}return db[_0xf9bd('0x47')][_0xf9bd('0x49')]({'where':{'id':_0x3aef73[_0xf9bd('0x4d')]['id']}})[_0xf9bd('0x2b')](handleEntityNotFound(_0xfb1db9,null))[_0xf9bd('0x2b')](saveUpdates(_0x3aef73[_0xf9bd('0x4b')],null))[_0xf9bd('0x2b')](respondWithResult(_0xfb1db9,null))[_0xf9bd('0x21')](handleError(_0xfb1db9,null));};exports[_0xf9bd('0x2c')]=function(_0x4433d2,_0x49a500){return db[_0xf9bd('0x47')][_0xf9bd('0x49')]({'where':{'id':_0x4433d2['params']['id']}})[_0xf9bd('0x2b')](handleEntityNotFound(_0x49a500,null))['then'](removeEntity(_0x49a500,null))[_0xf9bd('0x21')](handleError(_0x49a500,null));};exports[_0xf9bd('0x4e')]=function(_0x35a378,_0x46b32a,_0x49eaf3){var _0x3df741={};var _0x159208={};var _0x52bfeb;var _0x5656eb;return db['SalesforceAccount']['findOne']({'where':{'id':_0x35a378[_0xf9bd('0x4d')]['id']}})[_0xf9bd('0x2b')](handleEntityNotFound(_0x46b32a,null))[_0xf9bd('0x2b')](function(_0x388ce1){if(_0x388ce1){_0x52bfeb=_0x388ce1;_0x159208[_0xf9bd('0x36')]=_['keys'](db[_0xf9bd('0x4f')][_0xf9bd('0x31')]);_0x159208[_0xf9bd('0x33')]=_[_0xf9bd('0x32')](_0x35a378['query']);_0x159208[_0xf9bd('0x34')]=_[_0xf9bd('0x35')](_0x159208[_0xf9bd('0x36')],_0x159208[_0xf9bd('0x33')]);_0x3df741[_0xf9bd('0x38')]=_[_0xf9bd('0x35')](_0x159208[_0xf9bd('0x36')],qs[_0xf9bd('0x37')](_0x35a378[_0xf9bd('0x33')][_0xf9bd('0x37')]));_0x3df741[_0xf9bd('0x38')]=_0x3df741['attributes'][_0xf9bd('0x39')]?_0x3df741[_0xf9bd('0x38')]:_0x159208[_0xf9bd('0x36')];_0x3df741[_0xf9bd('0x50')]=qs[_0xf9bd('0x3c')](_0x35a378[_0xf9bd('0x33')][_0xf9bd('0x3c')]);_0x3df741[_0xf9bd('0x3d')]=qs[_0xf9bd('0x34')](_[_0xf9bd('0x3e')](_0x35a378['query'],_0x159208['filters']));if(_0x35a378[_0xf9bd('0x33')][_0xf9bd('0x43')]){_0x3df741[_0xf9bd('0x3d')]=_[_0xf9bd('0x44')](_0x3df741[_0xf9bd('0x3d')],{'$or':_['map'](_0x3df741['attributes'],function(_0x287203){var _0x3389ba={};_0x3389ba[_0x287203]={'$like':'%'+_0x35a378[_0xf9bd('0x33')][_0xf9bd('0x43')]+'%'};return _0x3389ba;})});}_0x3df741=_[_0xf9bd('0x44')]({},_0x3df741,_0x35a378[_0xf9bd('0x45')]);return _0x52bfeb[_0xf9bd('0x4e')](_0x3df741);}})['then'](function(_0x5ebf31){if(_0x5ebf31){_0x5656eb=_0x5ebf31['length'];if(!_0x35a378[_0xf9bd('0x33')][_0xf9bd('0x3a')](_0xf9bd('0x3b'))){_0x3df741[_0xf9bd('0x27')]=qs[_0xf9bd('0x27')](_0x35a378['query']['limit']);_0x3df741['offset']=qs[_0xf9bd('0x26')](_0x35a378['query'][_0xf9bd('0x26')]);}return _0x52bfeb['getConfigurations'](_0x3df741);}})[_0xf9bd('0x2b')](function(_0x2a8c4f){if(_0x2a8c4f){return _0x2a8c4f?{'count':_0x5656eb,'rows':_0x2a8c4f}:null;}})[_0xf9bd('0x2b')](respondWithResult(_0x46b32a,null))[_0xf9bd('0x21')](handleError(_0x46b32a,null));};exports[_0xf9bd('0x51')]=function(_0x56702e,_0x339d23,_0x3dd152){if(_0x56702e['body']['id']){delete _0x56702e[_0xf9bd('0x4b')]['id'];}return db[_0xf9bd('0x47')][_0xf9bd('0x52')]({'where':{'id':_0x56702e[_0xf9bd('0x4d')]['id']}})[_0xf9bd('0x2b')](handleEntityNotFound(_0x339d23,null))[_0xf9bd('0x2b')](function(_0x2fd5a5){if(_0x2fd5a5){_0x56702e[_0xf9bd('0x4b')][_0xf9bd('0x53')]=_0x2fd5a5['id'];_0x56702e[_0xf9bd('0x4b')][_0xf9bd('0x54')]=integrations[_0xf9bd('0x55')](_0x56702e[_0xf9bd('0x4b')][_0xf9bd('0x56')],_0x56702e[_0xf9bd('0x4b')][_0xf9bd('0x3f')]);_0x56702e[_0xf9bd('0x4b')][_0xf9bd('0x57')]=integrations[_0xf9bd('0x58')](_0x56702e['body']['channel'],_0x56702e[_0xf9bd('0x4b')][_0xf9bd('0x3f')]);return db[_0xf9bd('0x4f')][_0xf9bd('0x4a')](_0x56702e[_0xf9bd('0x4b')],{'include':[{'model':db[_0xf9bd('0x59')],'as':_0xf9bd('0x54')},{'model':db['SalesforceField'],'as':_0xf9bd('0x57')}]});}return null;})[_0xf9bd('0x2b')](respondWithResult(_0x339d23,null))['catch'](handleError(_0x339d23,null));};exports[_0xf9bd('0x5a')]=function(_0x3e99e0,_0x24f185,_0x24f537){var _0x500283;var _0x4466e7='';var _0x381db5=_0xf9bd('0x5b');return db[_0xf9bd('0x47')][_0xf9bd('0x52')]({'where':{'id':_0x3e99e0[_0xf9bd('0x4d')]['id']},'attributes':['id',_0xf9bd('0x5c'),_0xf9bd('0x5d'),_0xf9bd('0x5e'),_0xf9bd('0x5f'),_0xf9bd('0x60'),'securityToken']})['then'](handleEntityNotFound(_0x24f185,null))[_0xf9bd('0x2b')](function(_0x1b6f5c){if(_0x1b6f5c){_0x4466e7=_0x1b6f5c[_0xf9bd('0x5c')];var _0x1cc69f=_0x4466e7[_0xf9bd('0x61')](-0x1);if(_0x1cc69f==='/'){_0x4466e7=_0x4466e7[_0xf9bd('0x62')](0x0,_0x4466e7[_0xf9bd('0x63')](_0x1cc69f));}_0x500283=new jsforce[(_0xf9bd('0x64'))]({'oauth2':{'loginUrl':_0x4466e7,'clientId':_0x1b6f5c[_0xf9bd('0x5d')],'clientSecret':_0x1b6f5c[_0xf9bd('0x5e')]}});return _0x500283[_0xf9bd('0x65')](_0x1b6f5c[_0xf9bd('0x5f')],_0x1b6f5c[_0xf9bd('0x60')][_0xf9bd('0x66')](_0x1b6f5c[_0xf9bd('0x67')]));}})[_0xf9bd('0x2b')](function(_0x24a2e6){if(_0x24a2e6){if(!_['isNil'](_0x3e99e0[_0xf9bd('0x33')]['ticketType'])){_0x381db5=_0x3e99e0[_0xf9bd('0x33')][_0xf9bd('0x68')];}return _0x500283['sobject'](_0x381db5)[_0xf9bd('0x69')]();}})[_0xf9bd('0x2b')](function(_0x1902f0){var _0x4d2114=[_0xf9bd('0x6a'),_0xf9bd('0x6b'),_0xf9bd('0x6c'),_0xf9bd('0x6d'),_0xf9bd('0x6e'),'Priority',_0xf9bd('0x6f'),_0xf9bd('0x70')];if(!_[_0xf9bd('0x71')](_0x3e99e0['query']['ticketType'])&&_0x3e99e0[_0xf9bd('0x33')]['ticketType']===_0xf9bd('0x72')){_0x4d2114=['Type',_0xf9bd('0x73'),'Reason','Status',_0xf9bd('0x74'),'IsEscalated',_0xf9bd('0x75'),'SuppliedCompany'];}if(_0x1902f0){_[_0xf9bd('0x76')](_0x1902f0['fields'],function(_0x4e03f4){return _0x4e03f4[_0xf9bd('0x77')]===![]&&!_0x4d2114[_0xf9bd('0x78')](_0x4e03f4[_0xf9bd('0x2f')]);});return{'count':_0x1902f0[_0xf9bd('0x37')][_0xf9bd('0x39')],'rows':_[_0xf9bd('0x79')](_0x1902f0[_0xf9bd('0x37')],function(_0x4c8800){return{'id':_0x4c8800[_0xf9bd('0x2f')],'name':_0x4c8800['label'],'custom':_0x4c8800['custom'],'options':_0x4c8800[_0xf9bd('0x7a')][_0xf9bd('0x39')]>0x0?_[_0xf9bd('0x79')](_0x4c8800[_0xf9bd('0x7a')],function(_0x4b35ee){return{'name':_0x4b35ee[_0xf9bd('0x7b')],'value':_0x4b35ee[_0xf9bd('0x7c')]};}):_0x4c8800[_0xf9bd('0x3f')]==_0xf9bd('0x7d')?[{'name':_0xf9bd('0x7e'),'value':_0xf9bd('0x7f')},{'name':'False','value':'false'}]:[]};})};}})[_0xf9bd('0x2b')](respondWithResult(_0x24f185,null))['catch'](function(_0xbfbcab){var _0xfb6e3=_0x3e99e0[_0xf9bd('0x33')][_0xf9bd('0x80')]?0x1f4:_0xbfbcab[_0xf9bd('0x81')]||0x1f4;logger[_0xf9bd('0x1d')]('getFields,\x20%s,\x20%s,\x20%s',_0xf9bd('0x5a'),_0xfb6e3,JSON[_0xf9bd('0x1c')](_0xbfbcab));delete _0xbfbcab[_0xf9bd('0x2f')];if(_0xfb6e3===0x191){_0xfb6e3=0x190;}_0x24f185[_0xf9bd('0x22')](_0xfb6e3)[_0xf9bd('0x30')](_0x3e99e0['query'][_0xf9bd('0x80')]?{'message':_0xf9bd('0x82'),'statusCode':_0xbfbcab[_0xf9bd('0x81')]}:_0xbfbcab);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index ab11439..632d5c9 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 _0x407f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','api'];(function(_0x4f4b9c,_0x11b44a){var _0x15fec8=function(_0xd91bd9){while(--_0xd91bd9){_0x4f4b9c['push'](_0x4f4b9c['shift']());}};_0x15fec8(++_0x11b44a);}(_0x407f,0xc2));var _0xf407=function(_0x56e0e5,_0x2e3937){_0x56e0e5=_0x56e0e5-0x0;var _0x27bb15=_0x407f[_0x56e0e5];return _0x27bb15;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf407('0x0'));var moment=require(_0xf407('0x1'));var BPromise=require(_0xf407('0x2'));var rp=require(_0xf407('0x3'));var fs=require('fs');var path=require(_0xf407('0x4'));var rimraf=require(_0xf407('0x5'));var config=require(_0xf407('0x6'));var attributes=require(_0xf407('0x7'));var integrations=require(_0xf407('0x8'));module[_0xf407('0x9')]=function(_0x438076,_0x2bce9d){return _0x438076[_0xf407('0xa')](_0xf407('0xb'),attributes,{'tableName':_0xf407('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c00=['path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','util','moment','bluebird'];(function(_0x11a55c,_0x4eced9){var _0x26c390=function(_0x5b0662){while(--_0x5b0662){_0x11a55c['push'](_0x11a55c['shift']());}};_0x26c390(++_0x4eced9);}(_0x9c00,0x1a0));var _0x09c0=function(_0x2ddb6d,_0x25d45b){_0x2ddb6d=_0x2ddb6d-0x0;var _0x56c103=_0x9c00[_0x2ddb6d];return _0x56c103;};'use strict';var _=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x09c0('0x2'));var BPromise=require(_0x09c0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x09c0('0x4'));var rimraf=require(_0x09c0('0x5'));var config=require(_0x09c0('0x6'));var attributes=require(_0x09c0('0x7'));var integrations=require(_0x09c0('0x8'));module['exports']=function(_0x4d5fc3,_0x1f3d7e){return _0x4d5fc3[_0x09c0('0x9')](_0x09c0('0xa'),attributes,{'tableName':_0x09c0('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 00c4c7c..200574d 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 _0x8b4a=['message','result','catch','GetSalesforceAccount','findAll','options','where','attributes','limit','include','model','ShowSalesforceAccount','SalesforceAccount','find','raw','map','util','moment','bluebird','ioredis','../../config/logger','rpc','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5ea94a,_0x208bbe){var _0x27cece=function(_0x53f0db){while(--_0x53f0db){_0x5ea94a['push'](_0x5ea94a['shift']());}};_0x27cece(++_0x208bbe);}(_0x8b4a,0x76));var _0xa8b4=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x8b4a[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0xa8b4('0x0'));var moment=require(_0xa8b4('0x1'));var BPromise=require(_0xa8b4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa8b4('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa8b4('0x4'))(_0xa8b4('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa8b4('0x6')][_0xa8b4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x190250,_0x5293f9,_0x5750a5){return new BPromise(function(_0xfe9ba8,_0x18afee){return client[_0xa8b4('0x8')](_0x190250,_0x5750a5)[_0xa8b4('0x9')](function(_0x1ee878){logger[_0xa8b4('0xa')](_0xa8b4('0xb'),_0x5293f9,'request\x20sent');logger[_0xa8b4('0xc')](_0xa8b4('0xd'),_0x5293f9,_0xa8b4('0xe'),JSON[_0xa8b4('0xf')](_0x1ee878));if(_0x1ee878[_0xa8b4('0x10')]){if(_0x1ee878[_0xa8b4('0x10')][_0xa8b4('0x11')]===0x1f4){logger[_0xa8b4('0x10')](_0xa8b4('0xb'),_0x5293f9,_0x1ee878[_0xa8b4('0x10')][_0xa8b4('0x12')]);return _0x18afee(_0x1ee878['error'][_0xa8b4('0x12')]);}logger[_0xa8b4('0x10')](_0xa8b4('0xb'),_0x5293f9,_0x1ee878['error'][_0xa8b4('0x12')]);return _0xfe9ba8(_0x1ee878['error'][_0xa8b4('0x12')]);}else{logger[_0xa8b4('0xa')]('SalesforceAccount,\x20%s,\x20%s',_0x5293f9,_0xa8b4('0xe'));_0xfe9ba8(_0x1ee878[_0xa8b4('0x13')][_0xa8b4('0x12')]);}})[_0xa8b4('0x14')](function(_0x372418){logger[_0xa8b4('0x10')](_0xa8b4('0xb'),_0x5293f9,_0x372418);_0x18afee(_0x372418);});});}exports[_0xa8b4('0x15')]=function(_0x368762){var _0x5f2356=this;return new Promise(function(_0x103b31,_0x488efa){return db['SalesforceAccount'][_0xa8b4('0x16')]({'raw':_0x368762[_0xa8b4('0x17')]?_0x368762['options']['raw']===undefined?!![]:![]:!![],'where':_0x368762[_0xa8b4('0x17')]?_0x368762[_0xa8b4('0x17')][_0xa8b4('0x18')]||null:null,'attributes':_0x368762[_0xa8b4('0x17')]?_0x368762[_0xa8b4('0x17')][_0xa8b4('0x19')]||null:null,'limit':_0x368762[_0xa8b4('0x17')]?_0x368762[_0xa8b4('0x17')][_0xa8b4('0x1a')]||null:null,'include':_0x368762['options']?_0x368762[_0xa8b4('0x17')]['include']?_['map'](_0x368762[_0xa8b4('0x17')][_0xa8b4('0x1b')],function(_0x2a6ea5){return{'model':db[_0x2a6ea5[_0xa8b4('0x1c')]],'as':_0x2a6ea5['as'],'attributes':_0x2a6ea5[_0xa8b4('0x19')],'include':_0x2a6ea5[_0xa8b4('0x1b')]?_['map'](_0x2a6ea5[_0xa8b4('0x1b')],function(_0x132a4a){return{'model':db[_0x132a4a[_0xa8b4('0x1c')]],'as':_0x132a4a['as'],'attributes':_0x132a4a[_0xa8b4('0x19')],'include':_0x132a4a[_0xa8b4('0x1b')]?_['map'](_0x132a4a[_0xa8b4('0x1b')],function(_0x7071ca){return{'model':db[_0x7071ca[_0xa8b4('0x1c')]],'as':_0x7071ca['as'],'attributes':_0x7071ca[_0xa8b4('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa8b4('0x9')](function(_0x4e8ab0){logger['info']('GetSalesforceAccount',_0x368762);logger['debug'](_0xa8b4('0x15'),_0x368762,JSON[_0xa8b4('0xf')](_0x4e8ab0));_0x103b31(_0x4e8ab0);})['catch'](function(_0x267b8b){logger[_0xa8b4('0x10')](_0xa8b4('0x15'),_0x267b8b[_0xa8b4('0x12')],_0x368762);_0x488efa(_0x5f2356[_0xa8b4('0x10')](0x1f4,_0x267b8b['message']));});});};exports[_0xa8b4('0x1d')]=function(_0x137102){var _0x59f85d=this;return new Promise(function(_0x4564a2,_0x424b5d){return db[_0xa8b4('0x1e')][_0xa8b4('0x1f')]({'raw':_0x137102[_0xa8b4('0x17')]?_0x137102[_0xa8b4('0x17')][_0xa8b4('0x20')]===undefined?!![]:![]:!![],'where':_0x137102['options']?_0x137102[_0xa8b4('0x17')][_0xa8b4('0x18')]||null:null,'attributes':_0x137102[_0xa8b4('0x17')]?_0x137102[_0xa8b4('0x17')][_0xa8b4('0x19')]||null:null,'include':_0x137102['options']?_0x137102[_0xa8b4('0x17')][_0xa8b4('0x1b')]?_[_0xa8b4('0x21')](_0x137102['options'][_0xa8b4('0x1b')],function(_0x33759c){return{'model':db[_0x33759c[_0xa8b4('0x1c')]],'as':_0x33759c['as'],'attributes':_0x33759c[_0xa8b4('0x19')],'include':_0x33759c[_0xa8b4('0x1b')]?_['map'](_0x33759c[_0xa8b4('0x1b')],function(_0x4ede4a){return{'model':db[_0x4ede4a[_0xa8b4('0x1c')]],'as':_0x4ede4a['as'],'attributes':_0x4ede4a[_0xa8b4('0x19')],'include':_0x4ede4a['include']?_[_0xa8b4('0x21')](_0x4ede4a[_0xa8b4('0x1b')],function(_0x58081e){return{'model':db[_0x58081e[_0xa8b4('0x1c')]],'as':_0x58081e['as'],'attributes':_0x58081e[_0xa8b4('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa8b4('0x9')](function(_0x599a7b){logger[_0xa8b4('0xa')](_0xa8b4('0x1d'),_0x137102);logger[_0xa8b4('0xc')](_0xa8b4('0x1d'),_0x137102,JSON[_0xa8b4('0xf')](_0x599a7b));_0x4564a2(_0x599a7b);})['catch'](function(_0x4a6f59){logger[_0xa8b4('0x10')](_0xa8b4('0x1d'),_0x4a6f59[_0xa8b4('0x12')],_0x137102);_0x424b5d(_0x59f85d[_0xa8b4('0x10')](0x1f4,_0x4a6f59[_0xa8b4('0x12')]));});});}; \ No newline at end of file +var _0x9d85=['stringify','error','code','message','info','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','attributes','limit','map','model','include','ShowSalesforceAccount','find','raw','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','then','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x9d85,0x7d));var _0x59d8=function(_0x2ae463,_0x19084d){_0x2ae463=_0x2ae463-0x0;var _0x26d9d0=_0x9d85[_0x2ae463];return _0x26d9d0;};'use strict';var _=require(_0x59d8('0x0'));var util=require('util');var moment=require(_0x59d8('0x1'));var BPromise=require(_0x59d8('0x2'));var rs=require(_0x59d8('0x3'));var fs=require('fs');var Redis=require(_0x59d8('0x4'));var db=require(_0x59d8('0x5'))['db'];var utils=require(_0x59d8('0x6'));var logger=require('../../config/logger')(_0x59d8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x59d8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x445010,_0x3fddd6,_0x214254){return new BPromise(function(_0x48e034,_0x4e4c76){return client[_0x59d8('0x9')](_0x445010,_0x214254)[_0x59d8('0xa')](function(_0x4b48c3){logger['info'](_0x59d8('0xb'),_0x3fddd6,'request\x20sent');logger[_0x59d8('0xc')](_0x59d8('0xd'),_0x3fddd6,_0x59d8('0xe'),JSON[_0x59d8('0xf')](_0x4b48c3));if(_0x4b48c3['error']){if(_0x4b48c3[_0x59d8('0x10')][_0x59d8('0x11')]===0x1f4){logger[_0x59d8('0x10')](_0x59d8('0xb'),_0x3fddd6,_0x4b48c3[_0x59d8('0x10')]['message']);return _0x4e4c76(_0x4b48c3['error'][_0x59d8('0x12')]);}logger[_0x59d8('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x3fddd6,_0x4b48c3[_0x59d8('0x10')]['message']);return _0x48e034(_0x4b48c3[_0x59d8('0x10')][_0x59d8('0x12')]);}else{logger[_0x59d8('0x13')](_0x59d8('0xb'),_0x3fddd6,_0x59d8('0xe'));_0x48e034(_0x4b48c3[_0x59d8('0x14')][_0x59d8('0x12')]);}})[_0x59d8('0x15')](function(_0x7436bc){logger[_0x59d8('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x3fddd6,_0x7436bc);_0x4e4c76(_0x7436bc);});});}exports[_0x59d8('0x16')]=function(_0x26ab59){var _0x242fc4=this;return new Promise(function(_0x5082ff,_0x3968be){return db[_0x59d8('0x17')][_0x59d8('0x18')]({'raw':_0x26ab59[_0x59d8('0x19')]?_0x26ab59['options']['raw']===undefined?!![]:![]:!![],'where':_0x26ab59[_0x59d8('0x19')]?_0x26ab59[_0x59d8('0x19')]['where']||null:null,'attributes':_0x26ab59[_0x59d8('0x19')]?_0x26ab59[_0x59d8('0x19')][_0x59d8('0x1a')]||null:null,'limit':_0x26ab59[_0x59d8('0x19')]?_0x26ab59[_0x59d8('0x19')][_0x59d8('0x1b')]||null:null,'include':_0x26ab59[_0x59d8('0x19')]?_0x26ab59[_0x59d8('0x19')]['include']?_[_0x59d8('0x1c')](_0x26ab59[_0x59d8('0x19')]['include'],function(_0x3d007c){return{'model':db[_0x3d007c[_0x59d8('0x1d')]],'as':_0x3d007c['as'],'attributes':_0x3d007c[_0x59d8('0x1a')],'include':_0x3d007c[_0x59d8('0x1e')]?_['map'](_0x3d007c['include'],function(_0x54559f){return{'model':db[_0x54559f[_0x59d8('0x1d')]],'as':_0x54559f['as'],'attributes':_0x54559f[_0x59d8('0x1a')],'include':_0x54559f[_0x59d8('0x1e')]?_[_0x59d8('0x1c')](_0x54559f[_0x59d8('0x1e')],function(_0x374797){return{'model':db[_0x374797['model']],'as':_0x374797['as'],'attributes':_0x374797[_0x59d8('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x59d8('0xa')](function(_0x151c28){logger[_0x59d8('0x13')](_0x59d8('0x16'),_0x26ab59);logger[_0x59d8('0xc')](_0x59d8('0x16'),_0x26ab59,JSON[_0x59d8('0xf')](_0x151c28));_0x5082ff(_0x151c28);})[_0x59d8('0x15')](function(_0x97ce9a){logger[_0x59d8('0x10')](_0x59d8('0x16'),_0x97ce9a[_0x59d8('0x12')],_0x26ab59);_0x3968be(_0x242fc4['error'](0x1f4,_0x97ce9a['message']));});});};exports[_0x59d8('0x1f')]=function(_0xd97d3){var _0x4c8fab=this;return new Promise(function(_0x37ddd9,_0x55c3b4){return db[_0x59d8('0x17')][_0x59d8('0x20')]({'raw':_0xd97d3['options']?_0xd97d3[_0x59d8('0x19')][_0x59d8('0x21')]===undefined?!![]:![]:!![],'where':_0xd97d3['options']?_0xd97d3[_0x59d8('0x19')][_0x59d8('0x22')]||null:null,'attributes':_0xd97d3[_0x59d8('0x19')]?_0xd97d3['options']['attributes']||null:null,'include':_0xd97d3[_0x59d8('0x19')]?_0xd97d3[_0x59d8('0x19')][_0x59d8('0x1e')]?_[_0x59d8('0x1c')](_0xd97d3[_0x59d8('0x19')][_0x59d8('0x1e')],function(_0x9fc9c1){return{'model':db[_0x9fc9c1[_0x59d8('0x1d')]],'as':_0x9fc9c1['as'],'attributes':_0x9fc9c1[_0x59d8('0x1a')],'include':_0x9fc9c1['include']?_[_0x59d8('0x1c')](_0x9fc9c1['include'],function(_0x1d549f){return{'model':db[_0x1d549f[_0x59d8('0x1d')]],'as':_0x1d549f['as'],'attributes':_0x1d549f[_0x59d8('0x1a')],'include':_0x1d549f[_0x59d8('0x1e')]?_[_0x59d8('0x1c')](_0x1d549f['include'],function(_0x29e7a1){return{'model':db[_0x29e7a1[_0x59d8('0x1d')]],'as':_0x29e7a1['as'],'attributes':_0x29e7a1[_0x59d8('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x59d8('0xa')](function(_0x166582){logger[_0x59d8('0x13')](_0x59d8('0x1f'),_0xd97d3);logger[_0x59d8('0xc')](_0x59d8('0x1f'),_0xd97d3,JSON[_0x59d8('0xf')](_0x166582));_0x37ddd9(_0x166582);})['catch'](function(_0x49292b){logger[_0x59d8('0x10')](_0x59d8('0x1f'),_0x49292b['message'],_0xd97d3);_0x55c3b4(_0x4c8fab[_0x59d8('0x10')](0x1f4,_0x49292b[_0x59d8('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index cca315d..7459117 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 _0x5073=['../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getDescriptions','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x34e752,_0x32e2a2){var _0x7c6347=function(_0x4db671){while(--_0x4db671){_0x34e752['push'](_0x34e752['shift']());}};_0x7c6347(++_0x32e2a2);}(_0x5073,0x15a));var _0x3507=function(_0x147e56,_0x2efae8){_0x147e56=_0x147e56-0x0;var _0x40c49c=_0x5073[_0x147e56];return _0x40c49c;};'use strict';var multer=require(_0x3507('0x0'));var util=require(_0x3507('0x1'));var path=require(_0x3507('0x2'));var timeout=require(_0x3507('0x3'));var express=require('express');var router=express[_0x3507('0x4')]();var auth=require(_0x3507('0x5'));var interaction=require(_0x3507('0x6'));var config=require(_0x3507('0x7'));var controller=require(_0x3507('0x8'));router[_0x3507('0x9')]('/',auth[_0x3507('0xa')](),controller['index']);router['get'](_0x3507('0xb'),auth[_0x3507('0xa')](),controller[_0x3507('0xc')]);router['get'](_0x3507('0xd'),auth[_0x3507('0xa')](),controller['getFields']);router[_0x3507('0x9')](_0x3507('0xe'),auth[_0x3507('0xa')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0x3507('0xa')](),controller[_0x3507('0xf')]);router[_0x3507('0x10')]('/',auth[_0x3507('0xa')](),controller[_0x3507('0x11')]);router[_0x3507('0x12')](_0x3507('0xb'),auth[_0x3507('0xa')](),controller['update']);router[_0x3507('0x13')](_0x3507('0xb'),auth[_0x3507('0xa')](),controller[_0x3507('0x14')]);module[_0x3507('0x15')]=router; \ No newline at end of file +var _0xef84=['show','/:id/fields','isAuthenticated','getFields','getSubjects','getDescriptions','post','create','update','delete','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','index','get','/:id'];(function(_0x4a3cb8,_0x1286d5){var _0xa6cf5a=function(_0x19c8a9){while(--_0x19c8a9){_0x4a3cb8['push'](_0x4a3cb8['shift']());}};_0xa6cf5a(++_0x1286d5);}(_0xef84,0x1d9));var _0x4ef8=function(_0x5b472d,_0x3eb4e1){_0x5b472d=_0x5b472d-0x0;var _0x2543ac=_0xef84[_0x5b472d];return _0x2543ac;};'use strict';var multer=require(_0x4ef8('0x0'));var util=require('util');var path=require(_0x4ef8('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ef8('0x2'));var router=express[_0x4ef8('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4ef8('0x4'));var config=require(_0x4ef8('0x5'));var controller=require(_0x4ef8('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x4ef8('0x7')]);router[_0x4ef8('0x8')](_0x4ef8('0x9'),auth['isAuthenticated'](),controller[_0x4ef8('0xa')]);router[_0x4ef8('0x8')](_0x4ef8('0xb'),auth[_0x4ef8('0xc')](),controller[_0x4ef8('0xd')]);router[_0x4ef8('0x8')]('/:id/subjects',auth[_0x4ef8('0xc')](),controller[_0x4ef8('0xe')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0x4ef8('0xf')]);router[_0x4ef8('0x10')]('/',auth[_0x4ef8('0xc')](),controller[_0x4ef8('0x11')]);router['put'](_0x4ef8('0x9'),auth['isAuthenticated'](),controller[_0x4ef8('0x12')]);router[_0x4ef8('0x13')](_0x4ef8('0x9'),auth[_0x4ef8('0xc')](),controller['destroy']);module[_0x4ef8('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 8ba215a..4cdf992 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 _0x0bd1=['lead','exports','STRING','ENUM','Task','Case','contact','contact_lead','nothing'];(function(_0x514419,_0x46a102){var _0x2827b3=function(_0x236ba3){while(--_0x236ba3){_0x514419['push'](_0x514419['shift']());}};_0x2827b3(++_0x46a102);}(_0x0bd1,0xfd));var _0x10bd=function(_0x52f159,_0x419d8a){_0x52f159=_0x52f159-0x0;var _0x156799=_0x0bd1[_0x52f159];return _0x156799;};'use strict';var Sequelize=require('sequelize');module[_0x10bd('0x0')]={'name':{'type':Sequelize[_0x10bd('0x1')]},'description':{'type':Sequelize[_0x10bd('0x1')]},'ticketType':{'type':Sequelize[_0x10bd('0x2')](_0x10bd('0x3'),_0x10bd('0x4')),'defaultValue':_0x10bd('0x3')},'moduleSearch':{'type':Sequelize[_0x10bd('0x2')]('contact_lead',_0x10bd('0x5'),'lead'),'defaultValue':_0x10bd('0x6')},'moduleCreate':{'type':Sequelize[_0x10bd('0x2')](_0x10bd('0x7'),_0x10bd('0x5'),_0x10bd('0x8')),'defaultValue':_0x10bd('0x8')}}; \ No newline at end of file +var _0x5158=['Case','contact_lead','contact','nothing','lead','sequelize','exports','STRING','ENUM','Task'];(function(_0x5b03f6,_0x471967){var _0xd86457=function(_0x5aaa31){while(--_0x5aaa31){_0x5b03f6['push'](_0x5b03f6['shift']());}};_0xd86457(++_0x471967);}(_0x5158,0x1bd));var _0x8515=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x5158[_0xaa1b3e];return _0x454d7d;};'use strict';var Sequelize=require(_0x8515('0x0'));module[_0x8515('0x1')]={'name':{'type':Sequelize[_0x8515('0x2')]},'description':{'type':Sequelize[_0x8515('0x2')]},'ticketType':{'type':Sequelize[_0x8515('0x3')](_0x8515('0x4'),_0x8515('0x5')),'defaultValue':_0x8515('0x4')},'moduleSearch':{'type':Sequelize[_0x8515('0x3')](_0x8515('0x6'),_0x8515('0x7'),'lead'),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x8515('0x3')](_0x8515('0x8'),_0x8515('0x7'),'lead'),'defaultValue':_0x8515('0x9')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 4c9faa5..6c91fdd 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 _0x3174=['merge','map','type','key','field','options','rows','show','params','includeAll','include','create','body','find','getFields','findOne','SalesforceField','getSubjects','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','json','count','offset','Content-Range','save','update','destroy','stack','name','index','SalesforceConfiguration','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter'];(function(_0x384b87,_0x28ecbb){var _0x2cd01f=function(_0x4ec743){while(--_0x4ec743){_0x384b87['push'](_0x384b87['shift']());}};_0x2cd01f(++_0x28ecbb);}(_0x3174,0x187));var _0x4317=function(_0x337f0a,_0x5f2e06){_0x337f0a=_0x337f0a-0x0;var _0x2d1207=_0x3174[_0x337f0a];return _0x2d1207;};'use strict';var pdf=require(_0x4317('0x0'));var emlformat=require(_0x4317('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4317('0x2'));var jsonpatch=require(_0x4317('0x3'));var rp=require(_0x4317('0x4'));var moment=require(_0x4317('0x5'));var BPromise=require(_0x4317('0x6'));var Mustache=require(_0x4317('0x7'));var util=require(_0x4317('0x8'));var path=require(_0x4317('0x9'));var sox=require(_0x4317('0xa'));var csv=require('to-csv');var ejs=require(_0x4317('0xb'));var fs=require('fs');var _=require(_0x4317('0xc'));var squel=require(_0x4317('0xd'));var crypto=require(_0x4317('0xe'));var jsforce=require(_0x4317('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4317('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4317('0x11'));var authService=require(_0x4317('0x12'));var qs=require(_0x4317('0x13'));var hardwareService=require(_0x4317('0x14'));var logger=require(_0x4317('0x15'))(_0x4317('0x16'));var utils=require(_0x4317('0x17'));var config=require(_0x4317('0x18'));var db=require(_0x4317('0x19'))['db'];var jayson=require(_0x4317('0x1a'));var client=jayson[_0x4317('0x1b')][_0x4317('0x1c')]({'port':0x232a});function checkPasswordPattern(_0xbe44f5,_0x23f7e3,_0x5d5a93){if(_0x5d5a93){var _0x17af1d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x17af1d[_0x4317('0x1d')](_0x23f7e3)){return _0xbe44f5;}else{throw new Error(_0x4317('0x1e'));}}else{return _0xbe44f5;}}function respondWithRpcPromise(_0x3b0cc7,_0x35ba05,_0x2473e4,_0x4529d0){return new BPromise(function(_0x49dc21,_0xd7693){var _0x30be97=_0x4529d0||client;return _0x30be97[_0x4317('0x1f')](_0x3b0cc7,_0x2473e4)[_0x4317('0x20')](function(_0x21e21b){logger['info'](_0x4317('0x21'),_0x35ba05,_0x4317('0x22'));logger[_0x4317('0x23')](_0x4317('0x24'),_0x35ba05,_0x4317('0x22'),JSON[_0x4317('0x25')](_0x21e21b));if(_0x21e21b[_0x4317('0x26')]){if(_0x21e21b[_0x4317('0x26')][_0x4317('0x27')]===0x1f4){logger[_0x4317('0x26')](_0x4317('0x21'),_0x35ba05,_0x21e21b[_0x4317('0x26')]['message']);return _0xd7693(_0x21e21b[_0x4317('0x26')]['message']);}logger['error'](_0x4317('0x21'),_0x35ba05,_0x21e21b['error'][_0x4317('0x28')]);return _0x49dc21(_0x21e21b[_0x4317('0x26')][_0x4317('0x28')]);}else{logger[_0x4317('0x29')](_0x4317('0x21'),_0x35ba05,_0x4317('0x22'));_0x49dc21(_0x21e21b['result'][_0x4317('0x28')]);}})[_0x4317('0x2a')](function(_0x1f865b){logger[_0x4317('0x26')]('SalesforceConfiguration,\x20%s,\x20%s',_0x35ba05,_0x1f865b);_0xd7693(_0x1f865b);});});}function respondWithStatusCode(_0x612832,_0x58c83b){_0x58c83b=_0x58c83b||0xcc;return function(_0x242b0f){if(_0x242b0f){return _0x612832[_0x4317('0x2b')](_0x58c83b);}return _0x612832[_0x4317('0x2c')](_0x58c83b)[_0x4317('0x2d')]();};}function respondWithResult(_0x2559ab,_0x235555){_0x235555=_0x235555||0xc8;return function(_0xe1920c){if(_0xe1920c){return _0x2559ab[_0x4317('0x2c')](_0x235555)[_0x4317('0x2e')](_0xe1920c);}};}function respondWithFilteredResult(_0x390409,_0x26b2fc){return function(_0x4051a2){if(_0x4051a2){var _0x44185d=_0x4051a2[_0x4317('0x2f')],_0x514e7f=_0x26b2fc[_0x4317('0x30')],_0x1cb9f7=_0x26b2fc['offset']+_0x26b2fc['limit'],_0x401a01;if(_0x1cb9f7>=_0x44185d){_0x1cb9f7=_0x44185d;_0x401a01=0xc8;}else{_0x401a01=0xce;}_0x390409[_0x4317('0x2c')](_0x401a01);return _0x390409['set'](_0x4317('0x31'),_0x514e7f+'-'+_0x1cb9f7+'/'+_0x44185d)[_0x4317('0x2e')](_0x4051a2);}return null;};}function patchUpdates(_0x4fdbef){return function(_0x36adea){try{jsonpatch['apply'](_0x36adea,_0x4fdbef,!![]);}catch(_0x66f423){return BPromise['reject'](_0x66f423);}return _0x36adea[_0x4317('0x32')]();};}function saveUpdates(_0x51f97d,_0x205588){return function(_0x40caf9){if(_0x40caf9){return _0x40caf9[_0x4317('0x33')](_0x51f97d)[_0x4317('0x20')](function(_0xdfcd2d){return _0xdfcd2d;});}return null;};}function removeEntity(_0xd50990,_0x279446){return function(_0x5dced7){if(_0x5dced7){return _0x5dced7[_0x4317('0x34')]()[_0x4317('0x20')](function(){_0xd50990[_0x4317('0x2c')](0xcc)[_0x4317('0x2d')]();});}};}function handleEntityNotFound(_0x1c5f18,_0x33b173){return function(_0x28f122){if(!_0x28f122){_0x1c5f18[_0x4317('0x2b')](0x194);}return _0x28f122;};}function handleError(_0x4c2b06,_0x31c1d3){_0x31c1d3=_0x31c1d3||0x1f4;return function(_0x379815){logger[_0x4317('0x26')](_0x379815[_0x4317('0x35')]);if(_0x379815[_0x4317('0x36')]){delete _0x379815[_0x4317('0x36')];}_0x4c2b06[_0x4317('0x2c')](_0x31c1d3)['send'](_0x379815);};}exports[_0x4317('0x37')]=function(_0x1be01a,_0xf4b4d){var _0x36db0a={},_0x343336={},_0x17925e={'count':0x0,'rows':[]};var _0x21564a=db[_0x4317('0x38')][_0x4317('0x39')];_0x343336[_0x4317('0x3a')]=_[_0x4317('0x3b')](_0x21564a);_0x343336[_0x4317('0x3c')]=_[_0x4317('0x3b')](_0x1be01a['query']);_0x343336['filters']=_['intersection'](_0x343336['model'],_0x343336[_0x4317('0x3c')]);_0x36db0a['attributes']=_[_0x4317('0x3d')](_0x343336['model'],qs[_0x4317('0x3e')](_0x1be01a[_0x4317('0x3c')][_0x4317('0x3e')]));_0x36db0a['attributes']=_0x36db0a[_0x4317('0x3f')][_0x4317('0x40')]?_0x36db0a['attributes']:_0x343336[_0x4317('0x3a')];if(!_0x1be01a[_0x4317('0x3c')][_0x4317('0x41')](_0x4317('0x42'))){_0x36db0a[_0x4317('0x43')]=qs[_0x4317('0x43')](_0x1be01a['query']['limit']);_0x36db0a[_0x4317('0x30')]=qs[_0x4317('0x30')](_0x1be01a[_0x4317('0x3c')][_0x4317('0x30')]);}_0x36db0a[_0x4317('0x44')]=qs['sort'](_0x1be01a[_0x4317('0x3c')][_0x4317('0x45')]);_0x36db0a[_0x4317('0x46')]=qs[_0x4317('0x47')](_[_0x4317('0x48')](_0x1be01a[_0x4317('0x3c')],_0x343336[_0x4317('0x47')]));if(_0x1be01a[_0x4317('0x3c')][_0x4317('0x49')]){_0x36db0a[_0x4317('0x46')]=_[_0x4317('0x4a')](_0x36db0a['where'],{'$or':_[_0x4317('0x4b')](_0x21564a,function(_0x284724){if(_0x284724[_0x4317('0x4c')][_0x4317('0x4d')]!=='VIRTUAL'){var _0x5350b4={};_0x5350b4[_0x284724[_0x4317('0x4e')]]={'$like':'%'+_0x1be01a[_0x4317('0x3c')]['filter']+'%'};return _0x5350b4;}})});}_0x36db0a=_[_0x4317('0x4a')]({},_0x36db0a,_0x1be01a[_0x4317('0x4f')]);var _0x599198={'where':_0x36db0a['where']};return db['SalesforceConfiguration']['count'](_0x599198)['then'](function(_0x47290d){_0x17925e[_0x4317('0x2f')]=_0x47290d;if(_0x1be01a[_0x4317('0x3c')]['includeAll']){_0x36db0a['include']=[{'all':!![]}];}return db[_0x4317('0x38')]['findAll'](_0x36db0a);})[_0x4317('0x20')](function(_0x166163){_0x17925e[_0x4317('0x50')]=_0x166163;return _0x17925e;})['then'](respondWithFilteredResult(_0xf4b4d,_0x36db0a))[_0x4317('0x2a')](handleError(_0xf4b4d,null));};exports[_0x4317('0x51')]=function(_0x3d002a,_0x301699){var _0x335678={'raw':![],'where':{'id':_0x3d002a[_0x4317('0x52')]['id']}},_0x379fe8={};_0x379fe8[_0x4317('0x3a')]=_[_0x4317('0x3b')](db[_0x4317('0x38')][_0x4317('0x39')]);_0x379fe8['query']=_[_0x4317('0x3b')](_0x3d002a['query']);_0x379fe8[_0x4317('0x47')]=_[_0x4317('0x3d')](_0x379fe8[_0x4317('0x3a')],_0x379fe8['query']);_0x335678['attributes']=_['intersection'](_0x379fe8[_0x4317('0x3a')],qs[_0x4317('0x3e')](_0x3d002a[_0x4317('0x3c')][_0x4317('0x3e')]));_0x335678[_0x4317('0x3f')]=_0x335678[_0x4317('0x3f')]['length']?_0x335678[_0x4317('0x3f')]:_0x379fe8[_0x4317('0x3a')];if(_0x3d002a[_0x4317('0x3c')][_0x4317('0x53')]){_0x335678[_0x4317('0x54')]=[{'all':!![]}];}_0x335678=_[_0x4317('0x4a')]({},_0x335678,_0x3d002a[_0x4317('0x4f')]);return db[_0x4317('0x38')]['find'](_0x335678)[_0x4317('0x20')](handleEntityNotFound(_0x301699,null))['then'](respondWithResult(_0x301699,null))[_0x4317('0x2a')](handleError(_0x301699,null));};exports[_0x4317('0x55')]=function(_0x262a3d,_0x267285){return db[_0x4317('0x38')][_0x4317('0x55')](_0x262a3d[_0x4317('0x56')],{})[_0x4317('0x20')](respondWithResult(_0x267285,0xc9))[_0x4317('0x2a')](handleError(_0x267285,null));};exports[_0x4317('0x33')]=function(_0x2bfaf8,_0x3bef48){if(_0x2bfaf8[_0x4317('0x56')]['id']){delete _0x2bfaf8[_0x4317('0x56')]['id'];}return db['SalesforceConfiguration'][_0x4317('0x57')]({'where':{'id':_0x2bfaf8[_0x4317('0x52')]['id']}})['then'](handleEntityNotFound(_0x3bef48,null))[_0x4317('0x20')](saveUpdates(_0x2bfaf8[_0x4317('0x56')],null))['then'](respondWithResult(_0x3bef48,null))[_0x4317('0x2a')](handleError(_0x3bef48,null));};exports['destroy']=function(_0x36eb65,_0x565c67){return db['SalesforceConfiguration']['find']({'where':{'id':_0x36eb65[_0x4317('0x52')]['id']}})[_0x4317('0x20')](handleEntityNotFound(_0x565c67,null))[_0x4317('0x20')](removeEntity(_0x565c67,null))[_0x4317('0x2a')](handleError(_0x565c67,null));};exports[_0x4317('0x58')]=function(_0x282802,_0x4db214,_0x44d904){var _0x2325ac={};var _0x27a1b2={};var _0x38194e;var _0xa52456;return db['SalesforceConfiguration'][_0x4317('0x59')]({'where':{'id':_0x282802[_0x4317('0x52')]['id']}})[_0x4317('0x20')](handleEntityNotFound(_0x4db214,null))[_0x4317('0x20')](function(_0x41506f){if(_0x41506f){_0x38194e=_0x41506f;_0x27a1b2[_0x4317('0x3a')]=_[_0x4317('0x3b')](db[_0x4317('0x5a')]['rawAttributes']);_0x27a1b2[_0x4317('0x3c')]=_[_0x4317('0x3b')](_0x282802[_0x4317('0x3c')]);_0x27a1b2[_0x4317('0x47')]=_[_0x4317('0x3d')](_0x27a1b2['model'],_0x27a1b2[_0x4317('0x3c')]);_0x2325ac[_0x4317('0x3f')]=_[_0x4317('0x3d')](_0x27a1b2[_0x4317('0x3a')],qs['fields'](_0x282802['query']['fields']));_0x2325ac[_0x4317('0x3f')]=_0x2325ac[_0x4317('0x3f')][_0x4317('0x40')]?_0x2325ac[_0x4317('0x3f')]:_0x27a1b2[_0x4317('0x3a')];_0x2325ac['order']=qs[_0x4317('0x45')](_0x282802[_0x4317('0x3c')][_0x4317('0x45')]);_0x2325ac[_0x4317('0x46')]=qs[_0x4317('0x47')](_[_0x4317('0x48')](_0x282802[_0x4317('0x3c')],_0x27a1b2[_0x4317('0x47')]));if(_0x282802[_0x4317('0x3c')]['filter']){_0x2325ac[_0x4317('0x46')]=_[_0x4317('0x4a')](_0x2325ac[_0x4317('0x46')],{'$or':_[_0x4317('0x4b')](_0x2325ac[_0x4317('0x3f')],function(_0x39b3b3){var _0x45626a={};_0x45626a[_0x39b3b3]={'$like':'%'+_0x282802['query'][_0x4317('0x49')]+'%'};return _0x45626a;})});}_0x2325ac=_[_0x4317('0x4a')]({},_0x2325ac,_0x282802[_0x4317('0x4f')]);return _0x38194e[_0x4317('0x58')](_0x2325ac);}})[_0x4317('0x20')](function(_0x247fb4){if(_0x247fb4){_0xa52456=_0x247fb4['length'];if(!_0x282802['query'][_0x4317('0x41')](_0x4317('0x42'))){_0x2325ac[_0x4317('0x43')]=qs[_0x4317('0x43')](_0x282802[_0x4317('0x3c')]['limit']);_0x2325ac['offset']=qs['offset'](_0x282802[_0x4317('0x3c')][_0x4317('0x30')]);}return _0x38194e['getFields'](_0x2325ac);}})[_0x4317('0x20')](function(_0x2244e9){if(_0x2244e9){return _0x2244e9?{'count':_0xa52456,'rows':_0x2244e9}:null;}})[_0x4317('0x20')](respondWithResult(_0x4db214,null))[_0x4317('0x2a')](handleError(_0x4db214,null));};exports[_0x4317('0x5b')]=function(_0xd8e043,_0x347fbe,_0x2e6eb6){var _0x515edd={};var _0x353018={};var _0x32711b;var _0x5af296;return db[_0x4317('0x38')][_0x4317('0x59')]({'where':{'id':_0xd8e043[_0x4317('0x52')]['id']}})[_0x4317('0x20')](handleEntityNotFound(_0x347fbe,null))[_0x4317('0x20')](function(_0x5e30b1){if(_0x5e30b1){_0x32711b=_0x5e30b1;_0x353018[_0x4317('0x3a')]=_[_0x4317('0x3b')](db[_0x4317('0x5a')][_0x4317('0x39')]);_0x353018[_0x4317('0x3c')]=_['keys'](_0xd8e043[_0x4317('0x3c')]);_0x353018[_0x4317('0x47')]=_[_0x4317('0x3d')](_0x353018[_0x4317('0x3a')],_0x353018[_0x4317('0x3c')]);_0x515edd[_0x4317('0x3f')]=_[_0x4317('0x3d')](_0x353018['model'],qs[_0x4317('0x3e')](_0xd8e043[_0x4317('0x3c')][_0x4317('0x3e')]));_0x515edd['attributes']=_0x515edd[_0x4317('0x3f')][_0x4317('0x40')]?_0x515edd['attributes']:_0x353018['model'];_0x515edd[_0x4317('0x44')]=qs[_0x4317('0x45')](_0xd8e043['query'][_0x4317('0x45')]);_0x515edd[_0x4317('0x46')]=qs['filters'](_[_0x4317('0x48')](_0xd8e043[_0x4317('0x3c')],_0x353018[_0x4317('0x47')]));if(_0xd8e043['query']['filter']){_0x515edd[_0x4317('0x46')]=_[_0x4317('0x4a')](_0x515edd[_0x4317('0x46')],{'$or':_['map'](_0x515edd[_0x4317('0x3f')],function(_0x2a5261){var _0x1d11c0={};_0x1d11c0[_0x2a5261]={'$like':'%'+_0xd8e043[_0x4317('0x3c')][_0x4317('0x49')]+'%'};return _0x1d11c0;})});}_0x515edd=_[_0x4317('0x4a')]({},_0x515edd,_0xd8e043[_0x4317('0x4f')]);return _0x32711b[_0x4317('0x5b')](_0x515edd);}})[_0x4317('0x20')](function(_0x57b13a){if(_0x57b13a){_0x5af296=_0x57b13a[_0x4317('0x40')];if(!_0xd8e043[_0x4317('0x3c')][_0x4317('0x41')](_0x4317('0x42'))){_0x515edd['limit']=qs['limit'](_0xd8e043[_0x4317('0x3c')]['limit']);_0x515edd['offset']=qs[_0x4317('0x30')](_0xd8e043[_0x4317('0x3c')][_0x4317('0x30')]);}return _0x32711b['getSubjects'](_0x515edd);}})[_0x4317('0x20')](function(_0x11f9d7){if(_0x11f9d7){return _0x11f9d7?{'count':_0x5af296,'rows':_0x11f9d7}:null;}})[_0x4317('0x20')](respondWithResult(_0x347fbe,null))[_0x4317('0x2a')](handleError(_0x347fbe,null));};exports[_0x4317('0x5c')]=function(_0x101099,_0x228c10,_0x280b1d){var _0x1d8264={};var _0x1d40d9={};var _0x13ace3;var _0x25097f;return db[_0x4317('0x38')]['findOne']({'where':{'id':_0x101099[_0x4317('0x52')]['id']}})[_0x4317('0x20')](handleEntityNotFound(_0x228c10,null))[_0x4317('0x20')](function(_0x20147f){if(_0x20147f){_0x13ace3=_0x20147f;_0x1d40d9[_0x4317('0x3a')]=_['keys'](db['SalesforceField'][_0x4317('0x39')]);_0x1d40d9[_0x4317('0x3c')]=_[_0x4317('0x3b')](_0x101099[_0x4317('0x3c')]);_0x1d40d9[_0x4317('0x47')]=_[_0x4317('0x3d')](_0x1d40d9[_0x4317('0x3a')],_0x1d40d9[_0x4317('0x3c')]);_0x1d8264[_0x4317('0x3f')]=_['intersection'](_0x1d40d9[_0x4317('0x3a')],qs[_0x4317('0x3e')](_0x101099[_0x4317('0x3c')][_0x4317('0x3e')]));_0x1d8264[_0x4317('0x3f')]=_0x1d8264[_0x4317('0x3f')][_0x4317('0x40')]?_0x1d8264['attributes']:_0x1d40d9['model'];_0x1d8264['order']=qs[_0x4317('0x45')](_0x101099[_0x4317('0x3c')][_0x4317('0x45')]);_0x1d8264['where']=qs[_0x4317('0x47')](_[_0x4317('0x48')](_0x101099[_0x4317('0x3c')],_0x1d40d9[_0x4317('0x47')]));if(_0x101099[_0x4317('0x3c')][_0x4317('0x49')]){_0x1d8264[_0x4317('0x46')]=_[_0x4317('0x4a')](_0x1d8264[_0x4317('0x46')],{'$or':_[_0x4317('0x4b')](_0x1d8264['attributes'],function(_0x32dc55){var _0x4f93e9={};_0x4f93e9[_0x32dc55]={'$like':'%'+_0x101099[_0x4317('0x3c')][_0x4317('0x49')]+'%'};return _0x4f93e9;})});}_0x1d8264=_['merge']({},_0x1d8264,_0x101099[_0x4317('0x4f')]);return _0x13ace3['getDescriptions'](_0x1d8264);}})[_0x4317('0x20')](function(_0x375a9d){if(_0x375a9d){_0x25097f=_0x375a9d[_0x4317('0x40')];if(!_0x101099[_0x4317('0x3c')][_0x4317('0x41')](_0x4317('0x42'))){_0x1d8264[_0x4317('0x43')]=qs[_0x4317('0x43')](_0x101099['query'][_0x4317('0x43')]);_0x1d8264[_0x4317('0x30')]=qs[_0x4317('0x30')](_0x101099[_0x4317('0x3c')]['offset']);}return _0x13ace3[_0x4317('0x5c')](_0x1d8264);}})['then'](function(_0x511840){if(_0x511840){return _0x511840?{'count':_0x25097f,'rows':_0x511840}:null;}})[_0x4317('0x20')](respondWithResult(_0x228c10,null))[_0x4317('0x2a')](handleError(_0x228c10,null));}; \ No newline at end of file +var _0xd282=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','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~!@#$%^&-_=+[{]}.','then','info','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceConfiguration,\x20%s,\x20%s','message','request\x20sent','result','status','end','json','count','offset','limit','save','update','destroy','sendStatus','stack','name','send','index','SalesforceConfiguration','rawAttributes','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','field','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','getFields','findOne','SalesforceField','length','pick','map','getSubjects','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xd282,0x153));var _0x2d28=function(_0x277fbc,_0x133abf){_0x277fbc=_0x277fbc-0x0;var _0x9e7117=_0xd282[_0x277fbc];return _0x9e7117;};'use strict';var pdf=require(_0x2d28('0x0'));var emlformat=require(_0x2d28('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2d28('0x2'));var jsonpatch=require(_0x2d28('0x3'));var rp=require(_0x2d28('0x4'));var moment=require('moment');var BPromise=require(_0x2d28('0x5'));var Mustache=require(_0x2d28('0x6'));var util=require(_0x2d28('0x7'));var path=require(_0x2d28('0x8'));var sox=require(_0x2d28('0x9'));var csv=require(_0x2d28('0xa'));var ejs=require(_0x2d28('0xb'));var fs=require('fs');var _=require(_0x2d28('0xc'));var squel=require(_0x2d28('0xd'));var crypto=require(_0x2d28('0xe'));var jsforce=require(_0x2d28('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2d28('0xa'));var querystring=require(_0x2d28('0x10'));var Papa=require(_0x2d28('0x11'));var Redis=require(_0x2d28('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2d28('0x13'));var hardwareService=require(_0x2d28('0x14'));var logger=require(_0x2d28('0x15'))(_0x2d28('0x16'));var utils=require(_0x2d28('0x17'));var config=require(_0x2d28('0x18'));var db=require(_0x2d28('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x2d28('0x1a')][_0x2d28('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x1a5ecb,_0x59bd5a,_0x5edcce){if(_0x5edcce){var _0x214dfc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x214dfc[_0x2d28('0x1c')](_0x59bd5a)){return _0x1a5ecb;}else{throw new Error(_0x2d28('0x1d'));}}else{return _0x1a5ecb;}}function respondWithRpcPromise(_0x489910,_0x2b8265,_0xb23ccf,_0x14bf99){return new BPromise(function(_0x521c0e,_0x57435a){var _0x38593b=_0x14bf99||client;return _0x38593b['request'](_0x489910,_0xb23ccf)[_0x2d28('0x1e')](function(_0x4ef3a9){logger[_0x2d28('0x1f')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2b8265,'request\x20sent');logger[_0x2d28('0x20')](_0x2d28('0x21'),_0x2b8265,'request\x20sent',JSON[_0x2d28('0x22')](_0x4ef3a9));if(_0x4ef3a9[_0x2d28('0x23')]){if(_0x4ef3a9['error']['code']===0x1f4){logger[_0x2d28('0x23')](_0x2d28('0x24'),_0x2b8265,_0x4ef3a9[_0x2d28('0x23')][_0x2d28('0x25')]);return _0x57435a(_0x4ef3a9[_0x2d28('0x23')]['message']);}logger['error'](_0x2d28('0x24'),_0x2b8265,_0x4ef3a9[_0x2d28('0x23')]['message']);return _0x521c0e(_0x4ef3a9[_0x2d28('0x23')]['message']);}else{logger[_0x2d28('0x1f')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2b8265,_0x2d28('0x26'));_0x521c0e(_0x4ef3a9[_0x2d28('0x27')][_0x2d28('0x25')]);}})['catch'](function(_0x3b064a){logger[_0x2d28('0x23')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2b8265,_0x3b064a);_0x57435a(_0x3b064a);});});}function respondWithStatusCode(_0x3c3e59,_0x5e656c){_0x5e656c=_0x5e656c||0xcc;return function(_0x25e180){if(_0x25e180){return _0x3c3e59['sendStatus'](_0x5e656c);}return _0x3c3e59[_0x2d28('0x28')](_0x5e656c)[_0x2d28('0x29')]();};}function respondWithResult(_0x5a2a60,_0x1bd430){_0x1bd430=_0x1bd430||0xc8;return function(_0x19af35){if(_0x19af35){return _0x5a2a60[_0x2d28('0x28')](_0x1bd430)[_0x2d28('0x2a')](_0x19af35);}};}function respondWithFilteredResult(_0x2e7be9,_0x39b047){return function(_0x490618){if(_0x490618){var _0x191002=_0x490618[_0x2d28('0x2b')],_0x5e45cc=_0x39b047[_0x2d28('0x2c')],_0x6eafbd=_0x39b047[_0x2d28('0x2c')]+_0x39b047[_0x2d28('0x2d')],_0x37218e;if(_0x6eafbd>=_0x191002){_0x6eafbd=_0x191002;_0x37218e=0xc8;}else{_0x37218e=0xce;}_0x2e7be9[_0x2d28('0x28')](_0x37218e);return _0x2e7be9['set']('Content-Range',_0x5e45cc+'-'+_0x6eafbd+'/'+_0x191002)['json'](_0x490618);}return null;};}function patchUpdates(_0x4dce23){return function(_0x1046bf){try{jsonpatch['apply'](_0x1046bf,_0x4dce23,!![]);}catch(_0x444657){return BPromise['reject'](_0x444657);}return _0x1046bf[_0x2d28('0x2e')]();};}function saveUpdates(_0x37b5ee,_0x95ee14){return function(_0x3b1cbc){if(_0x3b1cbc){return _0x3b1cbc[_0x2d28('0x2f')](_0x37b5ee)['then'](function(_0xe7b733){return _0xe7b733;});}return null;};}function removeEntity(_0x3b7535,_0x478540){return function(_0x3c535b){if(_0x3c535b){return _0x3c535b[_0x2d28('0x30')]()['then'](function(){_0x3b7535['status'](0xcc)[_0x2d28('0x29')]();});}};}function handleEntityNotFound(_0x55c978,_0x3e0eae){return function(_0x16ec47){if(!_0x16ec47){_0x55c978[_0x2d28('0x31')](0x194);}return _0x16ec47;};}function handleError(_0x58bc26,_0x22906a){_0x22906a=_0x22906a||0x1f4;return function(_0x67f4d1){logger[_0x2d28('0x23')](_0x67f4d1[_0x2d28('0x32')]);if(_0x67f4d1[_0x2d28('0x33')]){delete _0x67f4d1[_0x2d28('0x33')];}_0x58bc26[_0x2d28('0x28')](_0x22906a)[_0x2d28('0x34')](_0x67f4d1);};}exports[_0x2d28('0x35')]=function(_0x1102ad,_0x36af47){var _0x168b5b={},_0x47f043={},_0x438ff0={'count':0x0,'rows':[]};var _0x47793c=db[_0x2d28('0x36')][_0x2d28('0x37')];_0x47f043[_0x2d28('0x38')]=_['keys'](_0x47793c);_0x47f043[_0x2d28('0x39')]=_[_0x2d28('0x3a')](_0x1102ad['query']);_0x47f043[_0x2d28('0x3b')]=_[_0x2d28('0x3c')](_0x47f043[_0x2d28('0x38')],_0x47f043[_0x2d28('0x39')]);_0x168b5b['attributes']=_[_0x2d28('0x3c')](_0x47f043[_0x2d28('0x38')],qs['fields'](_0x1102ad[_0x2d28('0x39')][_0x2d28('0x3d')]));_0x168b5b['attributes']=_0x168b5b[_0x2d28('0x3e')]['length']?_0x168b5b[_0x2d28('0x3e')]:_0x47f043['model'];if(!_0x1102ad[_0x2d28('0x39')][_0x2d28('0x3f')](_0x2d28('0x40'))){_0x168b5b['limit']=qs[_0x2d28('0x2d')](_0x1102ad[_0x2d28('0x39')][_0x2d28('0x2d')]);_0x168b5b['offset']=qs['offset'](_0x1102ad[_0x2d28('0x39')][_0x2d28('0x2c')]);}_0x168b5b[_0x2d28('0x41')]=qs['sort'](_0x1102ad[_0x2d28('0x39')][_0x2d28('0x42')]);_0x168b5b[_0x2d28('0x43')]=qs[_0x2d28('0x3b')](_['pick'](_0x1102ad[_0x2d28('0x39')],_0x47f043[_0x2d28('0x3b')]));if(_0x1102ad[_0x2d28('0x39')][_0x2d28('0x44')]){_0x168b5b[_0x2d28('0x43')]=_[_0x2d28('0x45')](_0x168b5b[_0x2d28('0x43')],{'$or':_['map'](_0x47793c,function(_0x26c4ab){if(_0x26c4ab['type']['key']!==_0x2d28('0x46')){var _0x3910b5={};_0x3910b5[_0x26c4ab[_0x2d28('0x47')]]={'$like':'%'+_0x1102ad[_0x2d28('0x39')]['filter']+'%'};return _0x3910b5;}})});}_0x168b5b=_[_0x2d28('0x45')]({},_0x168b5b,_0x1102ad[_0x2d28('0x48')]);var _0x1dca9c={'where':_0x168b5b[_0x2d28('0x43')]};return db[_0x2d28('0x36')]['count'](_0x1dca9c)[_0x2d28('0x1e')](function(_0x1d3b08){_0x438ff0[_0x2d28('0x2b')]=_0x1d3b08;if(_0x1102ad[_0x2d28('0x39')]['includeAll']){_0x168b5b[_0x2d28('0x49')]=[{'all':!![]}];}return db[_0x2d28('0x36')][_0x2d28('0x4a')](_0x168b5b);})[_0x2d28('0x1e')](function(_0x48e10d){_0x438ff0[_0x2d28('0x4b')]=_0x48e10d;return _0x438ff0;})[_0x2d28('0x1e')](respondWithFilteredResult(_0x36af47,_0x168b5b))[_0x2d28('0x4c')](handleError(_0x36af47,null));};exports[_0x2d28('0x4d')]=function(_0x24f87c,_0x109333){var _0x2d7972={'raw':![],'where':{'id':_0x24f87c[_0x2d28('0x4e')]['id']}},_0x546d11={};_0x546d11[_0x2d28('0x38')]=_[_0x2d28('0x3a')](db['SalesforceConfiguration'][_0x2d28('0x37')]);_0x546d11[_0x2d28('0x39')]=_[_0x2d28('0x3a')](_0x24f87c[_0x2d28('0x39')]);_0x546d11[_0x2d28('0x3b')]=_['intersection'](_0x546d11[_0x2d28('0x38')],_0x546d11[_0x2d28('0x39')]);_0x2d7972['attributes']=_[_0x2d28('0x3c')](_0x546d11[_0x2d28('0x38')],qs[_0x2d28('0x3d')](_0x24f87c[_0x2d28('0x39')]['fields']));_0x2d7972[_0x2d28('0x3e')]=_0x2d7972['attributes']['length']?_0x2d7972['attributes']:_0x546d11[_0x2d28('0x38')];if(_0x24f87c[_0x2d28('0x39')][_0x2d28('0x4f')]){_0x2d7972['include']=[{'all':!![]}];}_0x2d7972=_['merge']({},_0x2d7972,_0x24f87c[_0x2d28('0x48')]);return db['SalesforceConfiguration'][_0x2d28('0x50')](_0x2d7972)['then'](handleEntityNotFound(_0x109333,null))[_0x2d28('0x1e')](respondWithResult(_0x109333,null))['catch'](handleError(_0x109333,null));};exports[_0x2d28('0x51')]=function(_0x2f4801,_0x5a24a3){return db[_0x2d28('0x36')][_0x2d28('0x51')](_0x2f4801[_0x2d28('0x52')],{})[_0x2d28('0x1e')](respondWithResult(_0x5a24a3,0xc9))[_0x2d28('0x4c')](handleError(_0x5a24a3,null));};exports['update']=function(_0x5f58c0,_0x1616ba){if(_0x5f58c0[_0x2d28('0x52')]['id']){delete _0x5f58c0['body']['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x5f58c0['params']['id']}})[_0x2d28('0x1e')](handleEntityNotFound(_0x1616ba,null))['then'](saveUpdates(_0x5f58c0[_0x2d28('0x52')],null))[_0x2d28('0x1e')](respondWithResult(_0x1616ba,null))[_0x2d28('0x4c')](handleError(_0x1616ba,null));};exports[_0x2d28('0x30')]=function(_0x1188a3,_0x6e1b01){return db[_0x2d28('0x36')]['find']({'where':{'id':_0x1188a3[_0x2d28('0x4e')]['id']}})[_0x2d28('0x1e')](handleEntityNotFound(_0x6e1b01,null))[_0x2d28('0x1e')](removeEntity(_0x6e1b01,null))[_0x2d28('0x4c')](handleError(_0x6e1b01,null));};exports[_0x2d28('0x53')]=function(_0x3500ab,_0x549653,_0x15dd5b){var _0x3a4277={};var _0x2d2d40={};var _0x3b0438;var _0x2f140b;return db['SalesforceConfiguration'][_0x2d28('0x54')]({'where':{'id':_0x3500ab['params']['id']}})[_0x2d28('0x1e')](handleEntityNotFound(_0x549653,null))[_0x2d28('0x1e')](function(_0x605a0f){if(_0x605a0f){_0x3b0438=_0x605a0f;_0x2d2d40['model']=_['keys'](db[_0x2d28('0x55')][_0x2d28('0x37')]);_0x2d2d40[_0x2d28('0x39')]=_['keys'](_0x3500ab[_0x2d28('0x39')]);_0x2d2d40[_0x2d28('0x3b')]=_[_0x2d28('0x3c')](_0x2d2d40[_0x2d28('0x38')],_0x2d2d40[_0x2d28('0x39')]);_0x3a4277['attributes']=_[_0x2d28('0x3c')](_0x2d2d40[_0x2d28('0x38')],qs[_0x2d28('0x3d')](_0x3500ab['query']['fields']));_0x3a4277[_0x2d28('0x3e')]=_0x3a4277[_0x2d28('0x3e')][_0x2d28('0x56')]?_0x3a4277['attributes']:_0x2d2d40[_0x2d28('0x38')];_0x3a4277[_0x2d28('0x41')]=qs[_0x2d28('0x42')](_0x3500ab[_0x2d28('0x39')][_0x2d28('0x42')]);_0x3a4277[_0x2d28('0x43')]=qs[_0x2d28('0x3b')](_[_0x2d28('0x57')](_0x3500ab['query'],_0x2d2d40[_0x2d28('0x3b')]));if(_0x3500ab['query']['filter']){_0x3a4277[_0x2d28('0x43')]=_[_0x2d28('0x45')](_0x3a4277[_0x2d28('0x43')],{'$or':_[_0x2d28('0x58')](_0x3a4277[_0x2d28('0x3e')],function(_0x9af62e){var _0x40d0cd={};_0x40d0cd[_0x9af62e]={'$like':'%'+_0x3500ab['query']['filter']+'%'};return _0x40d0cd;})});}_0x3a4277=_[_0x2d28('0x45')]({},_0x3a4277,_0x3500ab['options']);return _0x3b0438[_0x2d28('0x53')](_0x3a4277);}})[_0x2d28('0x1e')](function(_0x268460){if(_0x268460){_0x2f140b=_0x268460[_0x2d28('0x56')];if(!_0x3500ab[_0x2d28('0x39')]['hasOwnProperty'](_0x2d28('0x40'))){_0x3a4277[_0x2d28('0x2d')]=qs[_0x2d28('0x2d')](_0x3500ab[_0x2d28('0x39')][_0x2d28('0x2d')]);_0x3a4277[_0x2d28('0x2c')]=qs[_0x2d28('0x2c')](_0x3500ab['query']['offset']);}return _0x3b0438[_0x2d28('0x53')](_0x3a4277);}})[_0x2d28('0x1e')](function(_0x2ccf75){if(_0x2ccf75){return _0x2ccf75?{'count':_0x2f140b,'rows':_0x2ccf75}:null;}})[_0x2d28('0x1e')](respondWithResult(_0x549653,null))[_0x2d28('0x4c')](handleError(_0x549653,null));};exports[_0x2d28('0x59')]=function(_0x5ec88e,_0x501ed1,_0x1572b1){var _0x2969a5={};var _0xa5d1d0={};var _0x32ddf7;var _0x29d167;return db[_0x2d28('0x36')][_0x2d28('0x54')]({'where':{'id':_0x5ec88e['params']['id']}})['then'](handleEntityNotFound(_0x501ed1,null))[_0x2d28('0x1e')](function(_0x593c71){if(_0x593c71){_0x32ddf7=_0x593c71;_0xa5d1d0[_0x2d28('0x38')]=_[_0x2d28('0x3a')](db[_0x2d28('0x55')]['rawAttributes']);_0xa5d1d0[_0x2d28('0x39')]=_[_0x2d28('0x3a')](_0x5ec88e[_0x2d28('0x39')]);_0xa5d1d0[_0x2d28('0x3b')]=_[_0x2d28('0x3c')](_0xa5d1d0['model'],_0xa5d1d0[_0x2d28('0x39')]);_0x2969a5[_0x2d28('0x3e')]=_[_0x2d28('0x3c')](_0xa5d1d0[_0x2d28('0x38')],qs['fields'](_0x5ec88e[_0x2d28('0x39')][_0x2d28('0x3d')]));_0x2969a5[_0x2d28('0x3e')]=_0x2969a5['attributes'][_0x2d28('0x56')]?_0x2969a5[_0x2d28('0x3e')]:_0xa5d1d0[_0x2d28('0x38')];_0x2969a5[_0x2d28('0x41')]=qs[_0x2d28('0x42')](_0x5ec88e[_0x2d28('0x39')][_0x2d28('0x42')]);_0x2969a5[_0x2d28('0x43')]=qs[_0x2d28('0x3b')](_[_0x2d28('0x57')](_0x5ec88e[_0x2d28('0x39')],_0xa5d1d0[_0x2d28('0x3b')]));if(_0x5ec88e['query'][_0x2d28('0x44')]){_0x2969a5[_0x2d28('0x43')]=_[_0x2d28('0x45')](_0x2969a5['where'],{'$or':_['map'](_0x2969a5[_0x2d28('0x3e')],function(_0x1fdf56){var _0x207359={};_0x207359[_0x1fdf56]={'$like':'%'+_0x5ec88e[_0x2d28('0x39')][_0x2d28('0x44')]+'%'};return _0x207359;})});}_0x2969a5=_[_0x2d28('0x45')]({},_0x2969a5,_0x5ec88e[_0x2d28('0x48')]);return _0x32ddf7['getSubjects'](_0x2969a5);}})[_0x2d28('0x1e')](function(_0x57e403){if(_0x57e403){_0x29d167=_0x57e403[_0x2d28('0x56')];if(!_0x5ec88e[_0x2d28('0x39')][_0x2d28('0x3f')](_0x2d28('0x40'))){_0x2969a5[_0x2d28('0x2d')]=qs[_0x2d28('0x2d')](_0x5ec88e[_0x2d28('0x39')]['limit']);_0x2969a5[_0x2d28('0x2c')]=qs[_0x2d28('0x2c')](_0x5ec88e['query']['offset']);}return _0x32ddf7[_0x2d28('0x59')](_0x2969a5);}})['then'](function(_0x2a7352){if(_0x2a7352){return _0x2a7352?{'count':_0x29d167,'rows':_0x2a7352}:null;}})[_0x2d28('0x1e')](respondWithResult(_0x501ed1,null))[_0x2d28('0x4c')](handleError(_0x501ed1,null));};exports['getDescriptions']=function(_0x19b3c7,_0x5ed8c8,_0x556fb4){var _0x3a17be={};var _0x2aeb15={};var _0x41e294;var _0x1b1859;return db[_0x2d28('0x36')]['findOne']({'where':{'id':_0x19b3c7[_0x2d28('0x4e')]['id']}})[_0x2d28('0x1e')](handleEntityNotFound(_0x5ed8c8,null))[_0x2d28('0x1e')](function(_0x2f0430){if(_0x2f0430){_0x41e294=_0x2f0430;_0x2aeb15['model']=_[_0x2d28('0x3a')](db[_0x2d28('0x55')][_0x2d28('0x37')]);_0x2aeb15[_0x2d28('0x39')]=_[_0x2d28('0x3a')](_0x19b3c7[_0x2d28('0x39')]);_0x2aeb15[_0x2d28('0x3b')]=_[_0x2d28('0x3c')](_0x2aeb15[_0x2d28('0x38')],_0x2aeb15[_0x2d28('0x39')]);_0x3a17be[_0x2d28('0x3e')]=_[_0x2d28('0x3c')](_0x2aeb15[_0x2d28('0x38')],qs[_0x2d28('0x3d')](_0x19b3c7[_0x2d28('0x39')][_0x2d28('0x3d')]));_0x3a17be['attributes']=_0x3a17be[_0x2d28('0x3e')][_0x2d28('0x56')]?_0x3a17be[_0x2d28('0x3e')]:_0x2aeb15['model'];_0x3a17be[_0x2d28('0x41')]=qs[_0x2d28('0x42')](_0x19b3c7[_0x2d28('0x39')][_0x2d28('0x42')]);_0x3a17be['where']=qs[_0x2d28('0x3b')](_[_0x2d28('0x57')](_0x19b3c7[_0x2d28('0x39')],_0x2aeb15[_0x2d28('0x3b')]));if(_0x19b3c7[_0x2d28('0x39')][_0x2d28('0x44')]){_0x3a17be['where']=_[_0x2d28('0x45')](_0x3a17be[_0x2d28('0x43')],{'$or':_[_0x2d28('0x58')](_0x3a17be['attributes'],function(_0x838bdf){var _0x139013={};_0x139013[_0x838bdf]={'$like':'%'+_0x19b3c7[_0x2d28('0x39')][_0x2d28('0x44')]+'%'};return _0x139013;})});}_0x3a17be=_[_0x2d28('0x45')]({},_0x3a17be,_0x19b3c7[_0x2d28('0x48')]);return _0x41e294['getDescriptions'](_0x3a17be);}})[_0x2d28('0x1e')](function(_0x1775fa){if(_0x1775fa){_0x1b1859=_0x1775fa[_0x2d28('0x56')];if(!_0x19b3c7[_0x2d28('0x39')][_0x2d28('0x3f')](_0x2d28('0x40'))){_0x3a17be[_0x2d28('0x2d')]=qs[_0x2d28('0x2d')](_0x19b3c7[_0x2d28('0x39')]['limit']);_0x3a17be[_0x2d28('0x2c')]=qs[_0x2d28('0x2c')](_0x19b3c7[_0x2d28('0x39')]['offset']);}return _0x41e294['getDescriptions'](_0x3a17be);}})[_0x2d28('0x1e')](function(_0x33598c){if(_0x33598c){return _0x33598c?{'count':_0x1b1859,'rows':_0x33598c}:null;}})[_0x2d28('0x1e')](respondWithResult(_0x5ed8c8,null))[_0x2d28('0x4c')](handleError(_0x5ed8c8,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 1285b35..1f12145 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 _0x9fb1=['path','rimraf','../../config/environment','exports','define','SalesforceConfiguration','int_salesforce_configurations','util','moment','bluebird'];(function(_0x3eaa94,_0x25ed9b){var _0x4e6e35=function(_0x22f863){while(--_0x22f863){_0x3eaa94['push'](_0x3eaa94['shift']());}};_0x4e6e35(++_0x25ed9b);}(_0x9fb1,0x1f1));var _0x19fb=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x9fb1[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require('lodash');var util=require(_0x19fb('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x19fb('0x1'));var BPromise=require(_0x19fb('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x19fb('0x3'));var rimraf=require(_0x19fb('0x4'));var config=require(_0x19fb('0x5'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x19fb('0x6')]=function(_0xca1024,_0x1578c1){return _0xca1024[_0x19fb('0x7')](_0x19fb('0x8'),attributes,{'tableName':_0x19fb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd01c=['rimraf','../../config/environment','./intSalesforceConfiguration.attributes','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x324645,_0xdc9c60){var _0x518909=function(_0x48a9f9){while(--_0x48a9f9){_0x324645['push'](_0x324645['shift']());}};_0x518909(++_0xdc9c60);}(_0xd01c,0x185));var _0xcd01=function(_0x366484,_0x4805bc){_0x366484=_0x366484-0x0;var _0x347366=_0xd01c[_0x366484];return _0x347366;};'use strict';var _=require(_0xcd01('0x0'));var util=require(_0xcd01('0x1'));var logger=require(_0xcd01('0x2'))(_0xcd01('0x3'));var moment=require(_0xcd01('0x4'));var BPromise=require(_0xcd01('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd01('0x6'));var rimraf=require(_0xcd01('0x7'));var config=require(_0xcd01('0x8'));var attributes=require(_0xcd01('0x9'));module['exports']=function(_0x28cc10,_0x4b48b7){return _0x28cc10['define'](_0xcd01('0xa'),attributes,{'tableName':_0xcd01('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 18f14ac..ad819bb 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 _0x326f=['info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xbbc44c,_0x41675c){var _0x2fbf6c=function(_0xab518e){while(--_0xab518e){_0xbbc44c['push'](_0xbbc44c['shift']());}};_0x2fbf6c(++_0x41675c);}(_0x326f,0xd1));var _0xf326=function(_0x21725a,_0x4ef2d5){_0x21725a=_0x21725a-0x0;var _0x456fa5=_0x326f[_0x21725a];return _0x456fa5;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file +var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x105f20,_0x4b1ff3){var _0x53ddc9=function(_0x5622b6){while(--_0x5622b6){_0x105f20['push'](_0x105f20['shift']());}};_0x53ddc9(++_0x4b1ff3);}(_0xe14b,0x93));var _0xbe14=function(_0x361190,_0x4da5cd){_0x361190=_0x361190-0x0;var _0xc4c00c=_0xe14b[_0x361190];return _0xc4c00c;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index b619290..1c6af03 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 _0xdf4b=['path','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','/:id','exports','multer','util'];(function(_0x77794,_0x400015){var _0x583124=function(_0x448382){while(--_0x448382){_0x77794['push'](_0x77794['shift']());}};_0x583124(++_0x400015);}(_0xdf4b,0x124));var _0xbdf4=function(_0x525a73,_0x5e56af){_0x525a73=_0x525a73-0x0;var _0x2f50e0=_0xdf4b[_0x525a73];return _0x2f50e0;};'use strict';var multer=require(_0xbdf4('0x0'));var util=require(_0xbdf4('0x1'));var path=require(_0xbdf4('0x2'));var timeout=require('connect-timeout');var express=require(_0xbdf4('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xbdf4('0x4'));var config=require(_0xbdf4('0x5'));var controller=require('./intSalesforceField.controller');router[_0xbdf4('0x6')]('/',auth[_0xbdf4('0x7')](),controller[_0xbdf4('0x8')]);router[_0xbdf4('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xbdf4('0x9')]('/',auth[_0xbdf4('0x7')](),controller[_0xbdf4('0xa')]);router[_0xbdf4('0xb')](_0xbdf4('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xbdf4('0xc'),auth[_0xbdf4('0x7')](),controller['destroy']);module[_0xbdf4('0xd')]=router; \ No newline at end of file +var _0x54fa=['isAuthenticated','index','get','show','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x54fa,0x1df));var _0xa54f=function(_0x503306,_0x356f2f){_0x503306=_0x503306-0x0;var _0x44a99d=_0x54fa[_0x503306];return _0x44a99d;};'use strict';var multer=require(_0xa54f('0x0'));var util=require(_0xa54f('0x1'));var path=require(_0xa54f('0x2'));var timeout=require(_0xa54f('0x3'));var express=require(_0xa54f('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xa54f('0x5'));var config=require(_0xa54f('0x6'));var controller=require('./intSalesforceField.controller');router['get']('/',auth[_0xa54f('0x7')](),controller[_0xa54f('0x8')]);router[_0xa54f('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xa54f('0xa')]);router[_0xa54f('0xb')]('/',auth[_0xa54f('0x7')](),controller[_0xa54f('0xc')]);router[_0xa54f('0xd')](_0xa54f('0xe'),auth['isAuthenticated'](),controller[_0xa54f('0xf')]);router['delete'](_0xa54f('0xe'),auth['isAuthenticated'](),controller[_0xa54f('0x10')]);module[_0xa54f('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 66a71d4..b331b94 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 _0x0e6f=['exports','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x0e6f,0x1d5));var _0xf0e6=function(_0x21f27d,_0x2305ba){_0x21f27d=_0x21f27d-0x0;var _0x504a7b=_0x0e6f[_0x21f27d];return _0x504a7b;};'use strict';var Sequelize=require('sequelize');module[_0xf0e6('0x0')]={'type':{'type':Sequelize[_0xf0e6('0x1')]('string',_0xf0e6('0x2'),_0xf0e6('0x3'),_0xf0e6('0x4')),'defaultValue':_0xf0e6('0x5')},'content':{'type':Sequelize[_0xf0e6('0x6')]},'key':{'type':Sequelize[_0xf0e6('0x6')]},'keyType':{'type':Sequelize[_0xf0e6('0x1')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0xf0e6('0x6')]},'idField':{'type':Sequelize[_0xf0e6('0x6')]},'variableName':{'type':Sequelize[_0xf0e6('0x6')]}}; \ No newline at end of file +var _0x0230=['variable','keyValue','STRING','sequelize','ENUM','string'];(function(_0x261931,_0x5b654a){var _0x11083a=function(_0x4b17af){while(--_0x4b17af){_0x261931['push'](_0x261931['shift']());}};_0x11083a(++_0x5b654a);}(_0x0230,0x135));var _0x0023=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x0230[_0x8a969d];return _0x1d8dc7;};'use strict';var Sequelize=require(_0x0023('0x0'));module['exports']={'type':{'type':Sequelize[_0x0023('0x1')](_0x0023('0x2'),_0x0023('0x3'),'customVariable',_0x0023('0x4')),'defaultValue':_0x0023('0x2')},'content':{'type':Sequelize[_0x0023('0x5')]},'key':{'type':Sequelize[_0x0023('0x5')]},'keyType':{'type':Sequelize[_0x0023('0x1')](_0x0023('0x2'),_0x0023('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x0023('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 95d8d35..98ee37b 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 _0x1605=['ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','stack','name','index','SalesforceField','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','field','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x1ad53c,_0x13ebf8){var _0x33afe4=function(_0x2fa995){while(--_0x2fa995){_0x1ad53c['push'](_0x1ad53c['shift']());}};_0x33afe4(++_0x13ebf8);}(_0x1605,0x1d4));var _0x5160=function(_0x437362,_0x55b1f2){_0x437362=_0x437362-0x0;var _0x14cbb2=_0x1605[_0x437362];return _0x14cbb2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5160('0x0'));var rimraf=require(_0x5160('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5160('0x2'));var rp=require(_0x5160('0x3'));var moment=require(_0x5160('0x4'));var BPromise=require(_0x5160('0x5'));var Mustache=require(_0x5160('0x6'));var util=require(_0x5160('0x7'));var path=require(_0x5160('0x8'));var sox=require(_0x5160('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5160('0xa'));var crypto=require(_0x5160('0xb'));var jsforce=require(_0x5160('0xc'));var deskjs=require(_0x5160('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5160('0xe'));var Redis=require(_0x5160('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5160('0x10'));var hardwareService=require(_0x5160('0x11'));var logger=require(_0x5160('0x12'))('api');var utils=require(_0x5160('0x13'));var config=require(_0x5160('0x14'));var db=require(_0x5160('0x15'))['db'];function respondWithStatusCode(_0x436934,_0x5bc889){_0x5bc889=_0x5bc889||0xcc;return function(_0x3e8672){if(_0x3e8672){return _0x436934[_0x5160('0x16')](_0x5bc889);}return _0x436934['status'](_0x5bc889)[_0x5160('0x17')]();};}function respondWithResult(_0x123a36,_0x38e932){_0x38e932=_0x38e932||0xc8;return function(_0x321fb4){if(_0x321fb4){return _0x123a36[_0x5160('0x18')](_0x38e932)[_0x5160('0x19')](_0x321fb4);}};}function respondWithFilteredResult(_0x143b99,_0x2799b8){return function(_0x5d5d6c){if(_0x5d5d6c){var _0xe0717a=_0x5d5d6c[_0x5160('0x1a')],_0x30680e=_0x2799b8[_0x5160('0x1b')],_0x36f435=_0x2799b8[_0x5160('0x1b')]+_0x2799b8[_0x5160('0x1c')],_0x54d973;if(_0x36f435>=_0xe0717a){_0x36f435=_0xe0717a;_0x54d973=0xc8;}else{_0x54d973=0xce;}_0x143b99['status'](_0x54d973);return _0x143b99[_0x5160('0x1d')](_0x5160('0x1e'),_0x30680e+'-'+_0x36f435+'/'+_0xe0717a)[_0x5160('0x19')](_0x5d5d6c);}return null;};}function patchUpdates(_0x3a6fc6){return function(_0x483bef){try{jsonpatch[_0x5160('0x1f')](_0x483bef,_0x3a6fc6,!![]);}catch(_0x2e3314){return BPromise[_0x5160('0x20')](_0x2e3314);}return _0x483bef['save']();};}function saveUpdates(_0x541195,_0x10ad22){return function(_0x3a5d9e){if(_0x3a5d9e){return _0x3a5d9e[_0x5160('0x21')](_0x541195)['then'](function(_0xff6460){return _0xff6460;});}return null;};}function removeEntity(_0x310be9,_0x2409a0){return function(_0x344b48){if(_0x344b48){return _0x344b48[_0x5160('0x22')]()[_0x5160('0x23')](function(){_0x310be9[_0x5160('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3621c7,_0x5ee10c){return function(_0x4ca4d1){if(!_0x4ca4d1){_0x3621c7['sendStatus'](0x194);}return _0x4ca4d1;};}function handleError(_0x1ba783,_0x38bb1d){_0x38bb1d=_0x38bb1d||0x1f4;return function(_0x23bb01){logger['error'](_0x23bb01[_0x5160('0x24')]);if(_0x23bb01[_0x5160('0x25')]){delete _0x23bb01[_0x5160('0x25')];}_0x1ba783[_0x5160('0x18')](_0x38bb1d)['send'](_0x23bb01);};}exports[_0x5160('0x26')]=function(_0x2881cc,_0xa1dbe7){var _0x5eafa5={},_0x117765={},_0x87b527={'count':0x0,'rows':[]};var _0x557813=db[_0x5160('0x27')][_0x5160('0x28')];_0x117765[_0x5160('0x29')]=_[_0x5160('0x2a')](_0x557813);_0x117765[_0x5160('0x2b')]=_['keys'](_0x2881cc['query']);_0x117765['filters']=_['intersection'](_0x117765[_0x5160('0x29')],_0x117765[_0x5160('0x2b')]);_0x5eafa5['attributes']=_[_0x5160('0x2c')](_0x117765[_0x5160('0x29')],qs[_0x5160('0x2d')](_0x2881cc[_0x5160('0x2b')]['fields']));_0x5eafa5['attributes']=_0x5eafa5[_0x5160('0x2e')][_0x5160('0x2f')]?_0x5eafa5[_0x5160('0x2e')]:_0x117765[_0x5160('0x29')];if(!_0x2881cc[_0x5160('0x2b')][_0x5160('0x30')](_0x5160('0x31'))){_0x5eafa5[_0x5160('0x1c')]=qs['limit'](_0x2881cc[_0x5160('0x2b')][_0x5160('0x1c')]);_0x5eafa5[_0x5160('0x1b')]=qs[_0x5160('0x1b')](_0x2881cc[_0x5160('0x2b')][_0x5160('0x1b')]);}_0x5eafa5['order']=qs[_0x5160('0x32')](_0x2881cc[_0x5160('0x2b')]['sort']);_0x5eafa5[_0x5160('0x33')]=qs[_0x5160('0x34')](_[_0x5160('0x35')](_0x2881cc[_0x5160('0x2b')],_0x117765[_0x5160('0x34')]));if(_0x2881cc[_0x5160('0x2b')][_0x5160('0x36')]){_0x5eafa5['where']=_[_0x5160('0x37')](_0x5eafa5[_0x5160('0x33')],{'$or':_[_0x5160('0x38')](_0x557813,function(_0xee4ab9){if(_0xee4ab9['type']['key']!=='VIRTUAL'){var _0x2376e4={};_0x2376e4[_0xee4ab9[_0x5160('0x39')]]={'$like':'%'+_0x2881cc['query'][_0x5160('0x36')]+'%'};return _0x2376e4;}})});}_0x5eafa5=_[_0x5160('0x37')]({},_0x5eafa5,_0x2881cc[_0x5160('0x3a')]);var _0x12b261={'where':_0x5eafa5[_0x5160('0x33')]};return db[_0x5160('0x27')][_0x5160('0x1a')](_0x12b261)[_0x5160('0x23')](function(_0x25b89){_0x87b527['count']=_0x25b89;if(_0x2881cc['query'][_0x5160('0x3b')]){_0x5eafa5[_0x5160('0x3c')]=[{'all':!![]}];}return db[_0x5160('0x27')][_0x5160('0x3d')](_0x5eafa5);})[_0x5160('0x23')](function(_0x4c2fac){_0x87b527[_0x5160('0x3e')]=_0x4c2fac;return _0x87b527;})['then'](respondWithFilteredResult(_0xa1dbe7,_0x5eafa5))[_0x5160('0x3f')](handleError(_0xa1dbe7,null));};exports[_0x5160('0x40')]=function(_0x28a3e9,_0x34b563){var _0x48c39e={'raw':!![],'where':{'id':_0x28a3e9[_0x5160('0x41')]['id']}},_0x2ed17e={};_0x2ed17e[_0x5160('0x29')]=_[_0x5160('0x2a')](db[_0x5160('0x27')][_0x5160('0x28')]);_0x2ed17e['query']=_[_0x5160('0x2a')](_0x28a3e9[_0x5160('0x2b')]);_0x2ed17e[_0x5160('0x34')]=_[_0x5160('0x2c')](_0x2ed17e['model'],_0x2ed17e['query']);_0x48c39e[_0x5160('0x2e')]=_[_0x5160('0x2c')](_0x2ed17e[_0x5160('0x29')],qs[_0x5160('0x2d')](_0x28a3e9[_0x5160('0x2b')][_0x5160('0x2d')]));_0x48c39e[_0x5160('0x2e')]=_0x48c39e[_0x5160('0x2e')][_0x5160('0x2f')]?_0x48c39e[_0x5160('0x2e')]:_0x2ed17e[_0x5160('0x29')];if(_0x28a3e9[_0x5160('0x2b')][_0x5160('0x3b')]){_0x48c39e['include']=[{'all':!![]}];}_0x48c39e=_['merge']({},_0x48c39e,_0x28a3e9['options']);return db[_0x5160('0x27')][_0x5160('0x42')](_0x48c39e)[_0x5160('0x23')](handleEntityNotFound(_0x34b563,null))[_0x5160('0x23')](respondWithResult(_0x34b563,null))[_0x5160('0x3f')](handleError(_0x34b563,null));};exports[_0x5160('0x43')]=function(_0x41774a,_0x5f5950){return db[_0x5160('0x27')][_0x5160('0x43')](_0x41774a['body'],{})[_0x5160('0x23')](respondWithResult(_0x5f5950,0xc9))[_0x5160('0x3f')](handleError(_0x5f5950,null));};exports[_0x5160('0x21')]=function(_0x236e23,_0x55accf){if(_0x236e23[_0x5160('0x44')]['id']){delete _0x236e23['body']['id'];}return db[_0x5160('0x27')][_0x5160('0x42')]({'where':{'id':_0x236e23['params']['id']}})['then'](handleEntityNotFound(_0x55accf,null))[_0x5160('0x23')](saveUpdates(_0x236e23[_0x5160('0x44')],null))['then'](respondWithResult(_0x55accf,null))['catch'](handleError(_0x55accf,null));};exports[_0x5160('0x22')]=function(_0x2881c6,_0x3c3405){return db['SalesforceField'][_0x5160('0x42')]({'where':{'id':_0x2881c6['params']['id']}})[_0x5160('0x23')](handleEntityNotFound(_0x3c3405,null))[_0x5160('0x23')](removeEntity(_0x3c3405,null))[_0x5160('0x3f')](handleError(_0x3c3405,null));}; \ No newline at end of file +var _0xeefb=['bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','sendStatus','end','status','json','count','offset','set','Content-Range','apply','update','destroy','then','error','stack','name','SalesforceField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','html-pdf','eml-format','rimraf','fast-json-patch','moment'];(function(_0x688df,_0x3cc215){var _0x266fef=function(_0x439d3f){while(--_0x439d3f){_0x688df['push'](_0x688df['shift']());}};_0x266fef(++_0x3cc215);}(_0xeefb,0xcd));var _0xbeef=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xeefb[_0x25e7cb];return _0x375d92;};'use strict';var pdf=require(_0xbeef('0x0'));var emlformat=require(_0xbeef('0x1'));var rimraf=require(_0xbeef('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbeef('0x3'));var rp=require('request-promise');var moment=require(_0xbeef('0x4'));var BPromise=require(_0xbeef('0x5'));var Mustache=require(_0xbeef('0x6'));var util=require(_0xbeef('0x7'));var path=require(_0xbeef('0x8'));var sox=require(_0xbeef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xbeef('0xa'));var squel=require(_0xbeef('0xb'));var crypto=require(_0xbeef('0xc'));var jsforce=require(_0xbeef('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbeef('0xe'));var querystring=require('querystring');var Papa=require(_0xbeef('0xf'));var Redis=require(_0xbeef('0x10'));var authService=require(_0xbeef('0x11'));var qs=require(_0xbeef('0x12'));var hardwareService=require(_0xbeef('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3863e2,_0x30ecc5){_0x30ecc5=_0x30ecc5||0xcc;return function(_0x4ed0a4){if(_0x4ed0a4){return _0x3863e2[_0xbeef('0x14')](_0x30ecc5);}return _0x3863e2['status'](_0x30ecc5)[_0xbeef('0x15')]();};}function respondWithResult(_0x233ee0,_0x237e05){_0x237e05=_0x237e05||0xc8;return function(_0x46ceeb){if(_0x46ceeb){return _0x233ee0[_0xbeef('0x16')](_0x237e05)[_0xbeef('0x17')](_0x46ceeb);}};}function respondWithFilteredResult(_0x3a7bd4,_0xb8fe8e){return function(_0x34035e){if(_0x34035e){var _0x4277ef=_0x34035e[_0xbeef('0x18')],_0x377a30=_0xb8fe8e['offset'],_0x4cc50d=_0xb8fe8e[_0xbeef('0x19')]+_0xb8fe8e['limit'],_0x10b88c;if(_0x4cc50d>=_0x4277ef){_0x4cc50d=_0x4277ef;_0x10b88c=0xc8;}else{_0x10b88c=0xce;}_0x3a7bd4[_0xbeef('0x16')](_0x10b88c);return _0x3a7bd4[_0xbeef('0x1a')](_0xbeef('0x1b'),_0x377a30+'-'+_0x4cc50d+'/'+_0x4277ef)[_0xbeef('0x17')](_0x34035e);}return null;};}function patchUpdates(_0x4bd12a){return function(_0x579b37){try{jsonpatch[_0xbeef('0x1c')](_0x579b37,_0x4bd12a,!![]);}catch(_0x348919){return BPromise['reject'](_0x348919);}return _0x579b37['save']();};}function saveUpdates(_0x440b5e,_0x3eb45d){return function(_0xdf2cb5){if(_0xdf2cb5){return _0xdf2cb5[_0xbeef('0x1d')](_0x440b5e)['then'](function(_0x5047e9){return _0x5047e9;});}return null;};}function removeEntity(_0x5257a4,_0xecc7e7){return function(_0x5a0a0c){if(_0x5a0a0c){return _0x5a0a0c[_0xbeef('0x1e')]()[_0xbeef('0x1f')](function(){_0x5257a4[_0xbeef('0x16')](0xcc)[_0xbeef('0x15')]();});}};}function handleEntityNotFound(_0x3d7ebb,_0x5887b7){return function(_0x751907){if(!_0x751907){_0x3d7ebb['sendStatus'](0x194);}return _0x751907;};}function handleError(_0x586c18,_0xd13be1){_0xd13be1=_0xd13be1||0x1f4;return function(_0x1b7f18){logger[_0xbeef('0x20')](_0x1b7f18[_0xbeef('0x21')]);if(_0x1b7f18[_0xbeef('0x22')]){delete _0x1b7f18['name'];}_0x586c18[_0xbeef('0x16')](_0xd13be1)['send'](_0x1b7f18);};}exports['index']=function(_0x39a84d,_0x47b7fa){var _0x14979d={},_0x5b3206={},_0x26a56f={'count':0x0,'rows':[]};var _0x2edd11=db[_0xbeef('0x23')][_0xbeef('0x24')];_0x5b3206[_0xbeef('0x25')]=_[_0xbeef('0x26')](_0x2edd11);_0x5b3206[_0xbeef('0x27')]=_[_0xbeef('0x26')](_0x39a84d[_0xbeef('0x27')]);_0x5b3206[_0xbeef('0x28')]=_[_0xbeef('0x29')](_0x5b3206[_0xbeef('0x25')],_0x5b3206['query']);_0x14979d[_0xbeef('0x2a')]=_[_0xbeef('0x29')](_0x5b3206[_0xbeef('0x25')],qs['fields'](_0x39a84d[_0xbeef('0x27')][_0xbeef('0x2b')]));_0x14979d['attributes']=_0x14979d[_0xbeef('0x2a')][_0xbeef('0x2c')]?_0x14979d['attributes']:_0x5b3206[_0xbeef('0x25')];if(!_0x39a84d[_0xbeef('0x27')][_0xbeef('0x2d')](_0xbeef('0x2e'))){_0x14979d[_0xbeef('0x2f')]=qs[_0xbeef('0x2f')](_0x39a84d[_0xbeef('0x27')]['limit']);_0x14979d['offset']=qs[_0xbeef('0x19')](_0x39a84d[_0xbeef('0x27')]['offset']);}_0x14979d[_0xbeef('0x30')]=qs[_0xbeef('0x31')](_0x39a84d[_0xbeef('0x27')][_0xbeef('0x31')]);_0x14979d[_0xbeef('0x32')]=qs[_0xbeef('0x28')](_[_0xbeef('0x33')](_0x39a84d[_0xbeef('0x27')],_0x5b3206[_0xbeef('0x28')]));if(_0x39a84d[_0xbeef('0x27')][_0xbeef('0x34')]){_0x14979d[_0xbeef('0x32')]=_[_0xbeef('0x35')](_0x14979d[_0xbeef('0x32')],{'$or':_[_0xbeef('0x36')](_0x2edd11,function(_0x465283){if(_0x465283[_0xbeef('0x37')][_0xbeef('0x38')]!==_0xbeef('0x39')){var _0x51267c={};_0x51267c[_0x465283[_0xbeef('0x3a')]]={'$like':'%'+_0x39a84d[_0xbeef('0x27')]['filter']+'%'};return _0x51267c;}})});}_0x14979d=_[_0xbeef('0x35')]({},_0x14979d,_0x39a84d[_0xbeef('0x3b')]);var _0x131981={'where':_0x14979d[_0xbeef('0x32')]};return db[_0xbeef('0x23')][_0xbeef('0x18')](_0x131981)['then'](function(_0x100555){_0x26a56f['count']=_0x100555;if(_0x39a84d[_0xbeef('0x27')]['includeAll']){_0x14979d[_0xbeef('0x3c')]=[{'all':!![]}];}return db[_0xbeef('0x23')][_0xbeef('0x3d')](_0x14979d);})[_0xbeef('0x1f')](function(_0x2c00c4){_0x26a56f[_0xbeef('0x3e')]=_0x2c00c4;return _0x26a56f;})[_0xbeef('0x1f')](respondWithFilteredResult(_0x47b7fa,_0x14979d))['catch'](handleError(_0x47b7fa,null));};exports[_0xbeef('0x3f')]=function(_0x29e4c3,_0x4a5726){var _0xa5df1c={'raw':!![],'where':{'id':_0x29e4c3[_0xbeef('0x40')]['id']}},_0x25c1e6={};_0x25c1e6[_0xbeef('0x25')]=_['keys'](db[_0xbeef('0x23')][_0xbeef('0x24')]);_0x25c1e6[_0xbeef('0x27')]=_[_0xbeef('0x26')](_0x29e4c3[_0xbeef('0x27')]);_0x25c1e6[_0xbeef('0x28')]=_[_0xbeef('0x29')](_0x25c1e6[_0xbeef('0x25')],_0x25c1e6[_0xbeef('0x27')]);_0xa5df1c[_0xbeef('0x2a')]=_['intersection'](_0x25c1e6['model'],qs[_0xbeef('0x2b')](_0x29e4c3[_0xbeef('0x27')][_0xbeef('0x2b')]));_0xa5df1c[_0xbeef('0x2a')]=_0xa5df1c[_0xbeef('0x2a')][_0xbeef('0x2c')]?_0xa5df1c['attributes']:_0x25c1e6[_0xbeef('0x25')];if(_0x29e4c3[_0xbeef('0x27')][_0xbeef('0x41')]){_0xa5df1c['include']=[{'all':!![]}];}_0xa5df1c=_[_0xbeef('0x35')]({},_0xa5df1c,_0x29e4c3[_0xbeef('0x3b')]);return db[_0xbeef('0x23')][_0xbeef('0x42')](_0xa5df1c)['then'](handleEntityNotFound(_0x4a5726,null))[_0xbeef('0x1f')](respondWithResult(_0x4a5726,null))[_0xbeef('0x43')](handleError(_0x4a5726,null));};exports[_0xbeef('0x44')]=function(_0xcd05b8,_0x3c111d){return db[_0xbeef('0x23')]['create'](_0xcd05b8['body'],{})[_0xbeef('0x1f')](respondWithResult(_0x3c111d,0xc9))['catch'](handleError(_0x3c111d,null));};exports['update']=function(_0x357d48,_0x3f60dc){if(_0x357d48[_0xbeef('0x45')]['id']){delete _0x357d48[_0xbeef('0x45')]['id'];}return db[_0xbeef('0x23')][_0xbeef('0x42')]({'where':{'id':_0x357d48[_0xbeef('0x40')]['id']}})[_0xbeef('0x1f')](handleEntityNotFound(_0x3f60dc,null))['then'](saveUpdates(_0x357d48[_0xbeef('0x45')],null))[_0xbeef('0x1f')](respondWithResult(_0x3f60dc,null))[_0xbeef('0x43')](handleError(_0x3f60dc,null));};exports[_0xbeef('0x1e')]=function(_0xf71165,_0x5087dc){return db[_0xbeef('0x23')]['find']({'where':{'id':_0xf71165[_0xbeef('0x40')]['id']}})[_0xbeef('0x1f')](handleEntityNotFound(_0x5087dc,null))[_0xbeef('0x1f')](removeEntity(_0x5087dc,null))[_0xbeef('0x43')](handleError(_0x5087dc,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 045d9c5..f7c2e0a 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 _0x3b83=['int_salesforce_fields','idField','FieldId','lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','exports','define'];(function(_0x2024b7,_0xafba7a){var _0x3fdf00=function(_0x1a9dae){while(--_0x1a9dae){_0x2024b7['push'](_0x2024b7['shift']());}};_0x3fdf00(++_0xafba7a);}(_0x3b83,0x1f2));var _0x33b8=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x3b83[_0x5f0089];return _0x193892;};'use strict';var _=require(_0x33b8('0x0'));var util=require(_0x33b8('0x1'));var logger=require(_0x33b8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x33b8('0x3'));var rp=require(_0x33b8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x33b8('0x5'));var attributes=require('./intSalesforceField.attributes');module[_0x33b8('0x6')]=function(_0x1c4249,_0x5342e7){return _0x1c4249[_0x33b8('0x7')]('SalesforceField',attributes,{'tableName':_0x33b8('0x8'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x33b8('0x9'),_0x33b8('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x63e8=['FieldId','lodash','util','api','request-promise','path','rimraf','./intSalesforceField.attributes','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField'];(function(_0x196ca8,_0x3e5a25){var _0x442928=function(_0x41a28a){while(--_0x41a28a){_0x196ca8['push'](_0x196ca8['shift']());}};_0x442928(++_0x3e5a25);}(_0x63e8,0xd1));var _0x863e=function(_0x3e7601,_0x5cfa78){_0x3e7601=_0x3e7601-0x0;var _0x4553dc=_0x63e8[_0x3e7601];return _0x4553dc;};'use strict';var _=require(_0x863e('0x0'));var util=require(_0x863e('0x1'));var logger=require('../../config/logger')(_0x863e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x863e('0x3'));var fs=require('fs');var path=require(_0x863e('0x4'));var rimraf=require(_0x863e('0x5'));var config=require('../../config/environment');var attributes=require(_0x863e('0x6'));module['exports']=function(_0x55835d,_0x5b2ed7){return _0x55835d[_0x863e('0x7')](_0x863e('0x8'),attributes,{'tableName':_0x863e('0x9'),'paranoid':![],'indexes':[{'name':_0x863e('0xa'),'fields':[_0x863e('0xb'),_0x863e('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 8e835ac..e5cb803 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 _0xe497=['request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client'];(function(_0xed97a,_0x534cf9){var _0x46d5da=function(_0x4170f5){while(--_0x4170f5){_0xed97a['push'](_0xed97a['shift']());}};_0x46d5da(++_0x534cf9);}(_0xe497,0x89));var _0x7e49=function(_0x4584c7,_0x355d8f){_0x4584c7=_0x4584c7-0x0;var _0x56bfb2=_0xe497[_0x4584c7];return _0x56bfb2;};'use strict';var _=require(_0x7e49('0x0'));var util=require(_0x7e49('0x1'));var moment=require(_0x7e49('0x2'));var BPromise=require(_0x7e49('0x3'));var rs=require(_0x7e49('0x4'));var fs=require('fs');var Redis=require(_0x7e49('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7e49('0x6'));var config=require(_0x7e49('0x7'));var jayson=require(_0x7e49('0x8'));var client=jayson[_0x7e49('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5de314,_0x8c6831,_0x1ae1da){return new BPromise(function(_0x51d17a,_0x4e0913){return client[_0x7e49('0xa')](_0x5de314,_0x1ae1da)[_0x7e49('0xb')](function(_0x239dc1){logger[_0x7e49('0xc')](_0x7e49('0xd'),_0x8c6831,_0x7e49('0xe'));logger[_0x7e49('0xf')](_0x7e49('0x10'),_0x8c6831,_0x7e49('0xe'),JSON['stringify'](_0x239dc1));if(_0x239dc1[_0x7e49('0x11')]){if(_0x239dc1[_0x7e49('0x11')][_0x7e49('0x12')]===0x1f4){logger[_0x7e49('0x11')](_0x7e49('0xd'),_0x8c6831,_0x239dc1[_0x7e49('0x11')][_0x7e49('0x13')]);return _0x4e0913(_0x239dc1[_0x7e49('0x11')]['message']);}logger['error']('SalesforceField,\x20%s,\x20%s',_0x8c6831,_0x239dc1[_0x7e49('0x11')]['message']);return _0x51d17a(_0x239dc1[_0x7e49('0x11')]['message']);}else{logger[_0x7e49('0xc')]('SalesforceField,\x20%s,\x20%s',_0x8c6831,_0x7e49('0xe'));_0x51d17a(_0x239dc1['result'][_0x7e49('0x13')]);}})[_0x7e49('0x14')](function(_0x471298){logger[_0x7e49('0x11')](_0x7e49('0xd'),_0x8c6831,_0x471298);_0x4e0913(_0x471298);});});} \ No newline at end of file +var _0xd0ca=['SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x512d95,_0xcfbe8b){var _0xfd6086=function(_0x53bd1a){while(--_0x53bd1a){_0x512d95['push'](_0x512d95['shift']());}};_0xfd6086(++_0xcfbe8b);}(_0xd0ca,0x106));var _0xad0c=function(_0x528f3b,_0x9ed503){_0x528f3b=_0x528f3b-0x0;var _0x110cbc=_0xd0ca[_0x528f3b];return _0x110cbc;};'use strict';var _=require(_0xad0c('0x0'));var util=require(_0xad0c('0x1'));var moment=require(_0xad0c('0x2'));var BPromise=require(_0xad0c('0x3'));var rs=require(_0xad0c('0x4'));var fs=require('fs');var Redis=require(_0xad0c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xad0c('0x6'));var logger=require(_0xad0c('0x7'))('rpc');var config=require(_0xad0c('0x8'));var jayson=require(_0xad0c('0x9'));var client=jayson['client'][_0xad0c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4174f2,_0x4016e9,_0x2f686b){return new BPromise(function(_0x4502c9,_0x2d2be3){return client[_0xad0c('0xb')](_0x4174f2,_0x2f686b)[_0xad0c('0xc')](function(_0x4698a5){logger[_0xad0c('0xd')](_0xad0c('0xe'),_0x4016e9,_0xad0c('0xf'));logger[_0xad0c('0x10')](_0xad0c('0x11'),_0x4016e9,_0xad0c('0xf'),JSON[_0xad0c('0x12')](_0x4698a5));if(_0x4698a5[_0xad0c('0x13')]){if(_0x4698a5[_0xad0c('0x13')]['code']===0x1f4){logger['error'](_0xad0c('0xe'),_0x4016e9,_0x4698a5[_0xad0c('0x13')][_0xad0c('0x14')]);return _0x2d2be3(_0x4698a5['error'][_0xad0c('0x14')]);}logger[_0xad0c('0x13')](_0xad0c('0xe'),_0x4016e9,_0x4698a5[_0xad0c('0x13')][_0xad0c('0x14')]);return _0x4502c9(_0x4698a5[_0xad0c('0x13')][_0xad0c('0x14')]);}else{logger[_0xad0c('0xd')](_0xad0c('0xe'),_0x4016e9,'request\x20sent');_0x4502c9(_0x4698a5[_0xad0c('0x15')][_0xad0c('0x14')]);}})[_0xad0c('0x16')](function(_0x394a60){logger[_0xad0c('0x13')]('SalesforceField,\x20%s,\x20%s',_0x4016e9,_0x394a60);_0x2d2be3(_0x394a60);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index ce9c7f0..e2d9482 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 _0x5722=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','destroy','exports','multer','path','connect-timeout','express'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x5722,0x65));var _0x2572=function(_0x2c903f,_0xa1372d){_0x2c903f=_0x2c903f-0x0;var _0x1b82b9=_0x5722[_0x2c903f];return _0x1b82b9;};'use strict';var multer=require(_0x2572('0x0'));var util=require('util');var path=require(_0x2572('0x1'));var timeout=require(_0x2572('0x2'));var express=require(_0x2572('0x3'));var router=express[_0x2572('0x4')]();var auth=require(_0x2572('0x5'));var interaction=require(_0x2572('0x6'));var config=require(_0x2572('0x7'));var controller=require('./intServicenowAccount.controller');router[_0x2572('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2572('0x8')](_0x2572('0x9'),auth[_0x2572('0xa')](),controller['show']);router[_0x2572('0x8')](_0x2572('0xb'),auth[_0x2572('0xa')](),controller[_0x2572('0xc')]);router[_0x2572('0x8')](_0x2572('0xd'),auth[_0x2572('0xa')](),controller[_0x2572('0xe')]);router[_0x2572('0xf')]('/',auth[_0x2572('0xa')](),controller[_0x2572('0x10')]);router[_0x2572('0xf')](_0x2572('0xb'),auth[_0x2572('0xa')](),controller[_0x2572('0x11')]);router[_0x2572('0x12')](_0x2572('0x9'),auth[_0x2572('0xa')](),controller['update']);router['delete'](_0x2572('0x9'),auth[_0x2572('0xa')](),controller[_0x2572('0x13')]);module[_0x2572('0x14')]=router; \ No newline at end of file +var _0xd996=['get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xd996,0x18f));var _0x6d99=function(_0x2993e4,_0x2af2db){_0x2993e4=_0x2993e4-0x0;var _0x4167b5=_0xd996[_0x2993e4];return _0x4167b5;};'use strict';var multer=require(_0x6d99('0x0'));var util=require(_0x6d99('0x1'));var path=require(_0x6d99('0x2'));var timeout=require(_0x6d99('0x3'));var express=require(_0x6d99('0x4'));var router=express[_0x6d99('0x5')]();var auth=require(_0x6d99('0x6'));var interaction=require(_0x6d99('0x7'));var config=require(_0x6d99('0x8'));var controller=require('./intServicenowAccount.controller');router[_0x6d99('0x9')]('/',auth[_0x6d99('0xa')](),controller[_0x6d99('0xb')]);router[_0x6d99('0x9')](_0x6d99('0xc'),auth[_0x6d99('0xa')](),controller[_0x6d99('0xd')]);router[_0x6d99('0x9')]('/:id/configurations',auth[_0x6d99('0xa')](),controller[_0x6d99('0xe')]);router['get'](_0x6d99('0xf'),auth[_0x6d99('0xa')](),controller[_0x6d99('0x10')]);router[_0x6d99('0x11')]('/',auth['isAuthenticated'](),controller[_0x6d99('0x12')]);router[_0x6d99('0x11')](_0x6d99('0x13'),auth[_0x6d99('0xa')](),controller[_0x6d99('0x14')]);router[_0x6d99('0x15')](_0x6d99('0xc'),auth['isAuthenticated'](),controller[_0x6d99('0x16')]);router[_0x6d99('0x17')](_0x6d99('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 79c5002..6d41403 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 _0x6f0d=['remoteUri','exports','STRING'];(function(_0x5dcc7e,_0x3cff04){var _0x53b18f=function(_0x56d6b0){while(--_0x56d6b0){_0x5dcc7e['push'](_0x5dcc7e['shift']());}};_0x53b18f(++_0x3cff04);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x54b45c,_0x244f67){_0x54b45c=_0x54b45c-0x0;var _0x2371b5=_0x6f0d[_0x54b45c];return _0x2371b5;};'use strict';var Sequelize=require('sequelize');module[_0xd6f0('0x0')]={'name':{'type':Sequelize[_0xd6f0('0x1')]},'description':{'type':Sequelize[_0xd6f0('0x1')]},'username':{'type':Sequelize[_0xd6f0('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xd6f0('0x1')]},'email':{'type':Sequelize[_0xd6f0('0x1')]},'remoteUri':{'type':Sequelize[_0xd6f0('0x1')],'unique':_0xd6f0('0x2')},'serverUrl':{'type':Sequelize[_0xd6f0('0x1')]}}; \ No newline at end of file +var _0x4fdb=['sequelize','exports','STRING','username'];(function(_0x2c2f71,_0x1387c4){var _0xf78fb6=function(_0x570300){while(--_0x570300){_0x2c2f71['push'](_0x2c2f71['shift']());}};_0xf78fb6(++_0x1387c4);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x3ff223,_0x4004d5){_0x3ff223=_0x3ff223-0x0;var _0x396818=_0x4fdb[_0x3ff223];return _0x396818;};'use strict';var Sequelize=require(_0xb4fd('0x0'));module[_0xb4fd('0x1')]={'name':{'type':Sequelize[_0xb4fd('0x2')]},'description':{'type':Sequelize[_0xb4fd('0x2')]},'username':{'type':Sequelize[_0xb4fd('0x2')],'unique':_0xb4fd('0x3')},'password':{'type':Sequelize[_0xb4fd('0x2')]},'email':{'type':Sequelize[_0xb4fd('0x2')]},'remoteUri':{'type':Sequelize[_0xb4fd('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xb4fd('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 1b03649..7988f37 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 _0x7b63=['info','ServicenowAccount,\x20%s,\x20%s','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','end','count','offset','set','json','apply','reject','save','update','stack','name','send','index','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','map','type','key','VIRTUAL','field','options','includeAll','include','ServicenowAccount','findAll','show','merge','find','create','body','params','getConfigurations','findOne','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','Subjects','getFields','hold_reason','knowledge','close_code','incident_state','severity','category','parent','made_sla','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','reopened_time','resolved_at','caller_id','approval_set','subcategory','work_notes','correlation_display','work_start','assignment_group','additional_assignee_list','description','notify','sys_class_name','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','activity_due','assigned_to','comments','approval','comments_and_work_notes','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','password','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','concat','ServiceNow\x20error:\x20','Wrong\x20credentials','statusCode','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','html-pdf','zip-dir','fast-json-patch','mustache','util','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','request','then'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x7b63,0xac));var _0x37b6=function(_0x1cd674,_0x8d3638){_0x1cd674=_0x1cd674-0x0;var _0x27928f=_0x7b63[_0x1cd674];return _0x27928f;};'use strict';var pdf=require(_0x37b6('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x37b6('0x1'));var jsonpatch=require(_0x37b6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x37b6('0x3'));var util=require(_0x37b6('0x4'));var path=require('path');var sox=require(_0x37b6('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x37b6('0x6'));var crypto=require(_0x37b6('0x7'));var jsforce=require(_0x37b6('0x8'));var deskjs=require(_0x37b6('0x9'));var toCsv=require(_0x37b6('0xa'));var querystring=require(_0x37b6('0xb'));var Papa=require('papaparse');var Redis=require(_0x37b6('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x37b6('0xd'));var hardwareService=require(_0x37b6('0xe'));var logger=require(_0x37b6('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x37b6('0x10'));var db=require(_0x37b6('0x11'))['db'];var integrations=require(_0x37b6('0x12'));var jayson=require(_0x37b6('0x13'));var client=jayson[_0x37b6('0x14')][_0x37b6('0x15')]({'port':0x232a});function checkPasswordPattern(_0x8cae76,_0x52c313,_0x311fdd){if(_0x311fdd){var _0x32cd22=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x32cd22[_0x37b6('0x16')](_0x52c313)){return _0x8cae76;}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 _0x8cae76;}}function respondWithRpcPromise(_0x46280d,_0x5d8c41,_0x988161,_0x37474d){return new BPromise(function(_0x2961c4,_0x330993){var _0x29fa26=_0x37474d||client;return _0x29fa26[_0x37b6('0x17')](_0x46280d,_0x988161)[_0x37b6('0x18')](function(_0x3c8acb){logger[_0x37b6('0x19')](_0x37b6('0x1a'),_0x5d8c41,'request\x20sent');logger['debug'](_0x37b6('0x1b'),_0x5d8c41,_0x37b6('0x1c'),JSON[_0x37b6('0x1d')](_0x3c8acb));if(_0x3c8acb['error']){if(_0x3c8acb[_0x37b6('0x1e')]['code']===0x1f4){logger[_0x37b6('0x1e')](_0x37b6('0x1a'),_0x5d8c41,_0x3c8acb[_0x37b6('0x1e')][_0x37b6('0x1f')]);return _0x330993(_0x3c8acb[_0x37b6('0x1e')]['message']);}logger[_0x37b6('0x1e')](_0x37b6('0x1a'),_0x5d8c41,_0x3c8acb['error'][_0x37b6('0x1f')]);return _0x2961c4(_0x3c8acb[_0x37b6('0x1e')][_0x37b6('0x1f')]);}else{logger[_0x37b6('0x19')](_0x37b6('0x1a'),_0x5d8c41,_0x37b6('0x1c'));_0x2961c4(_0x3c8acb['result']['message']);}})[_0x37b6('0x20')](function(_0x18b880){logger[_0x37b6('0x1e')]('ServicenowAccount,\x20%s,\x20%s',_0x5d8c41,_0x18b880);_0x330993(_0x18b880);});});}function respondWithStatusCode(_0xaa36dc,_0x14c588){_0x14c588=_0x14c588||0xcc;return function(_0x2222cc){if(_0x2222cc){return _0xaa36dc[_0x37b6('0x21')](_0x14c588);}return _0xaa36dc[_0x37b6('0x22')](_0x14c588)[_0x37b6('0x23')]();};}function respondWithResult(_0x50f051,_0x924a9c){_0x924a9c=_0x924a9c||0xc8;return function(_0x31e143){if(_0x31e143){return _0x50f051[_0x37b6('0x22')](_0x924a9c)['json'](_0x31e143);}};}function respondWithFilteredResult(_0x4f5270,_0x446dee){return function(_0x387f2a){if(_0x387f2a){var _0x185293=_0x387f2a[_0x37b6('0x24')],_0x274ee2=_0x446dee[_0x37b6('0x25')],_0x2097d9=_0x446dee[_0x37b6('0x25')]+_0x446dee['limit'],_0x250d61;if(_0x2097d9>=_0x185293){_0x2097d9=_0x185293;_0x250d61=0xc8;}else{_0x250d61=0xce;}_0x4f5270['status'](_0x250d61);return _0x4f5270[_0x37b6('0x26')]('Content-Range',_0x274ee2+'-'+_0x2097d9+'/'+_0x185293)[_0x37b6('0x27')](_0x387f2a);}return null;};}function patchUpdates(_0x397a8a){return function(_0x25faf7){try{jsonpatch[_0x37b6('0x28')](_0x25faf7,_0x397a8a,!![]);}catch(_0x4fb1fe){return BPromise[_0x37b6('0x29')](_0x4fb1fe);}return _0x25faf7[_0x37b6('0x2a')]();};}function saveUpdates(_0xab63ee,_0x55d320){return function(_0x4031d7){if(_0x4031d7){return _0x4031d7[_0x37b6('0x2b')](_0xab63ee)['then'](function(_0x342308){return _0x342308;});}return null;};}function removeEntity(_0x321ff0,_0x5afc9e){return function(_0x2d604){if(_0x2d604){return _0x2d604['destroy']()[_0x37b6('0x18')](function(){_0x321ff0['status'](0xcc)[_0x37b6('0x23')]();});}};}function handleEntityNotFound(_0x407a17,_0x3edad3){return function(_0x175264){if(!_0x175264){_0x407a17[_0x37b6('0x21')](0x194);}return _0x175264;};}function handleError(_0x53633f,_0x370068){_0x370068=_0x370068||0x1f4;return function(_0xa2c567){logger[_0x37b6('0x1e')](_0xa2c567[_0x37b6('0x2c')]);if(_0xa2c567[_0x37b6('0x2d')]){delete _0xa2c567[_0x37b6('0x2d')];}_0x53633f[_0x37b6('0x22')](_0x370068)[_0x37b6('0x2e')](_0xa2c567);};}exports[_0x37b6('0x2f')]=function(_0x2aedcd,_0x581934){var _0x17a67e={},_0x42e447={},_0x43e4f6={'count':0x0,'rows':[]};var _0x320a25=db['ServicenowAccount'][_0x37b6('0x30')];_0x42e447[_0x37b6('0x31')]=_[_0x37b6('0x32')](_0x320a25);_0x42e447[_0x37b6('0x33')]=_[_0x37b6('0x32')](_0x2aedcd[_0x37b6('0x33')]);_0x42e447['filters']=_[_0x37b6('0x34')](_0x42e447[_0x37b6('0x31')],_0x42e447[_0x37b6('0x33')]);_0x17a67e['attributes']=_[_0x37b6('0x34')](_0x42e447[_0x37b6('0x31')],qs[_0x37b6('0x35')](_0x2aedcd[_0x37b6('0x33')][_0x37b6('0x35')]));_0x17a67e[_0x37b6('0x36')]=_0x17a67e[_0x37b6('0x36')][_0x37b6('0x37')]?_0x17a67e[_0x37b6('0x36')]:_0x42e447[_0x37b6('0x31')];if(!_0x2aedcd['query'][_0x37b6('0x38')](_0x37b6('0x39'))){_0x17a67e[_0x37b6('0x3a')]=qs['limit'](_0x2aedcd[_0x37b6('0x33')][_0x37b6('0x3a')]);_0x17a67e[_0x37b6('0x25')]=qs['offset'](_0x2aedcd[_0x37b6('0x33')]['offset']);}_0x17a67e[_0x37b6('0x3b')]=qs[_0x37b6('0x3c')](_0x2aedcd['query'][_0x37b6('0x3c')]);_0x17a67e[_0x37b6('0x3d')]=qs[_0x37b6('0x3e')](_[_0x37b6('0x3f')](_0x2aedcd['query'],_0x42e447[_0x37b6('0x3e')]));if(_0x2aedcd[_0x37b6('0x33')][_0x37b6('0x40')]){_0x17a67e[_0x37b6('0x3d')]=_['merge'](_0x17a67e[_0x37b6('0x3d')],{'$or':_[_0x37b6('0x41')](_0x320a25,function(_0x48965f){if(_0x48965f[_0x37b6('0x42')][_0x37b6('0x43')]!==_0x37b6('0x44')){var _0x1ddc9a={};_0x1ddc9a[_0x48965f[_0x37b6('0x45')]]={'$like':'%'+_0x2aedcd[_0x37b6('0x33')][_0x37b6('0x40')]+'%'};return _0x1ddc9a;}})});}_0x17a67e=_['merge']({},_0x17a67e,_0x2aedcd[_0x37b6('0x46')]);var _0x5e794d={'where':_0x17a67e[_0x37b6('0x3d')]};return db['ServicenowAccount'][_0x37b6('0x24')](_0x5e794d)[_0x37b6('0x18')](function(_0x49baeb){_0x43e4f6[_0x37b6('0x24')]=_0x49baeb;if(_0x2aedcd['query'][_0x37b6('0x47')]){_0x17a67e[_0x37b6('0x48')]=[{'all':!![]}];}return db[_0x37b6('0x49')][_0x37b6('0x4a')](_0x17a67e);})['then'](function(_0x108628){_0x43e4f6['rows']=_0x108628;return _0x43e4f6;})[_0x37b6('0x18')](respondWithFilteredResult(_0x581934,_0x17a67e))['catch'](handleError(_0x581934,null));};exports[_0x37b6('0x4b')]=function(_0xcdb7af,_0x30fd7d){var _0x3ee907={'raw':![],'where':{'id':_0xcdb7af['params']['id']}},_0x141c43={};_0x141c43[_0x37b6('0x31')]=_[_0x37b6('0x32')](db[_0x37b6('0x49')][_0x37b6('0x30')]);_0x141c43[_0x37b6('0x33')]=_[_0x37b6('0x32')](_0xcdb7af[_0x37b6('0x33')]);_0x141c43[_0x37b6('0x3e')]=_[_0x37b6('0x34')](_0x141c43['model'],_0x141c43[_0x37b6('0x33')]);_0x3ee907['attributes']=_[_0x37b6('0x34')](_0x141c43['model'],qs[_0x37b6('0x35')](_0xcdb7af[_0x37b6('0x33')][_0x37b6('0x35')]));_0x3ee907[_0x37b6('0x36')]=_0x3ee907[_0x37b6('0x36')][_0x37b6('0x37')]?_0x3ee907[_0x37b6('0x36')]:_0x141c43[_0x37b6('0x31')];if(_0xcdb7af[_0x37b6('0x33')][_0x37b6('0x47')]){_0x3ee907[_0x37b6('0x48')]=[{'all':!![]}];}_0x3ee907=_[_0x37b6('0x4c')]({},_0x3ee907,_0xcdb7af['options']);return db[_0x37b6('0x49')][_0x37b6('0x4d')](_0x3ee907)['then'](handleEntityNotFound(_0x30fd7d,null))[_0x37b6('0x18')](respondWithResult(_0x30fd7d,null))['catch'](handleError(_0x30fd7d,null));};exports[_0x37b6('0x4e')]=function(_0x4325ee,_0xfb8780){return db[_0x37b6('0x49')][_0x37b6('0x4e')](_0x4325ee['body'],{})[_0x37b6('0x18')](respondWithResult(_0xfb8780,0xc9))['catch'](handleError(_0xfb8780,null));};exports[_0x37b6('0x2b')]=function(_0x4935cc,_0xcf1b7f){if(_0x4935cc[_0x37b6('0x4f')]['id']){delete _0x4935cc[_0x37b6('0x4f')]['id'];}return db[_0x37b6('0x49')][_0x37b6('0x4d')]({'where':{'id':_0x4935cc[_0x37b6('0x50')]['id']}})[_0x37b6('0x18')](handleEntityNotFound(_0xcf1b7f,null))['then'](saveUpdates(_0x4935cc['body'],null))[_0x37b6('0x18')](respondWithResult(_0xcf1b7f,null))[_0x37b6('0x20')](handleError(_0xcf1b7f,null));};exports['destroy']=function(_0x4017e3,_0x1150e0){return db[_0x37b6('0x49')][_0x37b6('0x4d')]({'where':{'id':_0x4017e3[_0x37b6('0x50')]['id']}})['then'](handleEntityNotFound(_0x1150e0,null))[_0x37b6('0x18')](removeEntity(_0x1150e0,null))[_0x37b6('0x20')](handleError(_0x1150e0,null));};exports[_0x37b6('0x51')]=function(_0x3e18d6,_0x346d89,_0x5e41d4){var _0x17f690={};var _0x50d68c={};var _0x256782;var _0x27e717;return db[_0x37b6('0x49')][_0x37b6('0x52')]({'where':{'id':_0x3e18d6['params']['id']}})[_0x37b6('0x18')](handleEntityNotFound(_0x346d89,null))[_0x37b6('0x18')](function(_0x23a9b6){if(_0x23a9b6){_0x256782=_0x23a9b6;_0x50d68c[_0x37b6('0x31')]=_['keys'](db['ServicenowConfiguration']['rawAttributes']);_0x50d68c[_0x37b6('0x33')]=_[_0x37b6('0x32')](_0x3e18d6['query']);_0x50d68c[_0x37b6('0x3e')]=_[_0x37b6('0x34')](_0x50d68c[_0x37b6('0x31')],_0x50d68c[_0x37b6('0x33')]);_0x17f690[_0x37b6('0x36')]=_[_0x37b6('0x34')](_0x50d68c['model'],qs[_0x37b6('0x35')](_0x3e18d6['query'][_0x37b6('0x35')]));_0x17f690[_0x37b6('0x36')]=_0x17f690[_0x37b6('0x36')][_0x37b6('0x37')]?_0x17f690[_0x37b6('0x36')]:_0x50d68c[_0x37b6('0x31')];_0x17f690[_0x37b6('0x3b')]=qs[_0x37b6('0x3c')](_0x3e18d6[_0x37b6('0x33')][_0x37b6('0x3c')]);_0x17f690[_0x37b6('0x3d')]=qs[_0x37b6('0x3e')](_[_0x37b6('0x3f')](_0x3e18d6['query'],_0x50d68c[_0x37b6('0x3e')]));if(_0x3e18d6['query'][_0x37b6('0x40')]){_0x17f690['where']=_['merge'](_0x17f690[_0x37b6('0x3d')],{'$or':_[_0x37b6('0x41')](_0x17f690[_0x37b6('0x36')],function(_0x210a5e){var _0x3286d2={};_0x3286d2[_0x210a5e]={'$like':'%'+_0x3e18d6[_0x37b6('0x33')][_0x37b6('0x40')]+'%'};return _0x3286d2;})});}_0x17f690=_[_0x37b6('0x4c')]({},_0x17f690,_0x3e18d6[_0x37b6('0x46')]);return _0x256782[_0x37b6('0x51')](_0x17f690);}})['then'](function(_0x173448){if(_0x173448){_0x27e717=_0x173448[_0x37b6('0x37')];if(!_0x3e18d6[_0x37b6('0x33')][_0x37b6('0x38')](_0x37b6('0x39'))){_0x17f690['limit']=qs['limit'](_0x3e18d6[_0x37b6('0x33')]['limit']);_0x17f690[_0x37b6('0x25')]=qs['offset'](_0x3e18d6[_0x37b6('0x33')][_0x37b6('0x25')]);}return _0x256782['getConfigurations'](_0x17f690);}})[_0x37b6('0x18')](function(_0x150ad7){if(_0x150ad7){return _0x150ad7?{'count':_0x27e717,'rows':_0x150ad7}:null;}})[_0x37b6('0x18')](respondWithResult(_0x346d89,null))['catch'](handleError(_0x346d89,null));};exports[_0x37b6('0x53')]=function(_0x2caf09,_0x131089,_0x119e6d){if(_0x2caf09['body']['id']){delete _0x2caf09[_0x37b6('0x4f')]['id'];}return db[_0x37b6('0x49')][_0x37b6('0x52')]({'where':{'id':_0x2caf09[_0x37b6('0x50')]['id']}})[_0x37b6('0x18')](handleEntityNotFound(_0x131089,null))[_0x37b6('0x18')](function(_0x4703ed){if(_0x4703ed){_0x2caf09['body'][_0x37b6('0x54')]=_0x4703ed['id'];_0x2caf09[_0x37b6('0x4f')]['Subjects']=integrations[_0x37b6('0x55')](_0x2caf09[_0x37b6('0x4f')][_0x37b6('0x56')],_0x2caf09[_0x37b6('0x4f')][_0x37b6('0x42')]);_0x2caf09[_0x37b6('0x4f')][_0x37b6('0x57')]=integrations[_0x37b6('0x58')](_0x2caf09[_0x37b6('0x4f')][_0x37b6('0x56')],_0x2caf09[_0x37b6('0x4f')][_0x37b6('0x42')]);return db[_0x37b6('0x59')][_0x37b6('0x4e')](_0x2caf09['body'],{'include':[{'model':db[_0x37b6('0x5a')],'as':_0x37b6('0x5b')},{'model':db[_0x37b6('0x5a')],'as':_0x37b6('0x57')}]});}return null;})[_0x37b6('0x18')](respondWithResult(_0x131089,null))[_0x37b6('0x20')](handleError(_0x131089,null));};exports[_0x37b6('0x5c')]=function(_0x3e508f,_0x25dd86,_0xb8bd2c){var _0x4ee84c=['made_sla',_0x37b6('0x5d'),_0x37b6('0x5e'),'subcategory',_0x37b6('0x5f'),'notify',_0x37b6('0x60'),_0x37b6('0x61'),_0x37b6('0x62')];var _0x3cfb15=[_0x37b6('0x63'),_0x37b6('0x64'),'caused_by','watch_list',_0x37b6('0x65'),_0x37b6('0x66'),_0x37b6('0x67'),_0x37b6('0x5d'),_0x37b6('0x68'),_0x37b6('0x69'),_0x37b6('0x6a'),_0x37b6('0x6b'),'opened_by',_0x37b6('0x6c'),_0x37b6('0x6d'),_0x37b6('0x6e'),_0x37b6('0x6f'),_0x37b6('0x70'),_0x37b6('0x5e'),_0x37b6('0x3b'),_0x37b6('0x71'),_0x37b6('0x72'),_0x37b6('0x73'),_0x37b6('0x74'),_0x37b6('0x75'),_0x37b6('0x76'),_0x37b6('0x77'),_0x37b6('0x78'),_0x37b6('0x79'),_0x37b6('0x7a'),_0x37b6('0x7b'),_0x37b6('0x7c'),_0x37b6('0x7d'),_0x37b6('0x7e'),'business_duration','group_list','work_end',_0x37b6('0x7f'),_0x37b6('0x80'),_0x37b6('0x81'),_0x37b6('0x82'),_0x37b6('0x83'),_0x37b6('0x84'),'short_description',_0x37b6('0x5f'),_0x37b6('0x85'),'delivery_task',_0x37b6('0x86'),_0x37b6('0x87'),'business_stc',_0x37b6('0x88'),_0x37b6('0x89'),'calendar_duration',_0x37b6('0x8a'),_0x37b6('0x8b'),'close_notes',_0x37b6('0x8c'),_0x37b6('0x8d'),_0x37b6('0x8e'),_0x37b6('0x8f'),_0x37b6('0x90'),_0x37b6('0x91'),_0x37b6('0x60'),_0x37b6('0x92'),_0x37b6('0x93'),_0x37b6('0x94'),'reassignment_count',_0x37b6('0x95'),_0x37b6('0x96'),_0x37b6('0x61'),_0x37b6('0x97'),'sla_due',_0x37b6('0x98'),_0x37b6('0x99'),'due_date','sys_mod_count',_0x37b6('0x9a'),_0x37b6('0x9b'),_0x37b6('0x9c'),_0x37b6('0x9d'),_0x37b6('0x9e'),_0x37b6('0x9f'),'category'];var _0x2e99ba='';var _0x10af31='';var _0x4a26a4=[];var _0xb8ca0e='';var _0x17f14a='';var _0x21f023=[];var _0x292631='';var _0x2ce2df='';var _0x14f156={};var _0x59a6de='';return db['ServicenowAccount'][_0x37b6('0x52')]({'where':{'id':_0x3e508f[_0x37b6('0x50')]['id']},'attributes':['id',_0x37b6('0xa0'),'password',_0x37b6('0xa1'),_0x37b6('0xa2'),_0x37b6('0xa3')]})[_0x37b6('0x18')](handleEntityNotFound(_0x25dd86,null))[_0x37b6('0x18')](function(_0x5f4e59){if(_0x5f4e59){_0x59a6de=_0x5f4e59['remoteUri'];var _0x49aa41=_0x59a6de[_0x37b6('0xa4')](-0x1);if(_0x49aa41==='/'){_0x59a6de=_0x59a6de[_0x37b6('0xa5')](0x0,_0x59a6de[_0x37b6('0xa6')](_0x49aa41));}_0x2ce2df=util[_0x37b6('0xa7')](_0x37b6('0xa8'),_0x59a6de);_0x292631=util['format']('%s/api/now/table/',_0x59a6de);_0x14f156={'user':_0x5f4e59[_0x37b6('0xa0')],'pass':_0x5f4e59[_0x37b6('0xa9')]};var _0x195409={'method':_0x37b6('0xaa'),'uri':_0x2ce2df+_0x37b6('0xab'),'auth':_0x14f156,'json':!![]};return rp(_0x195409);}})[_0x37b6('0x18')](function(_0x32396e){if(_0x32396e[_0x37b6('0xac')][_0x37b6('0x37')]>0x0){_0x2e99ba=_0x32396e[_0x37b6('0xac')];}console[_0x37b6('0xad')](_0x37b6('0xae'),_0x2e99ba);_0x21f023=[];_0x10af31=Object[_0x37b6('0xaf')]([],_0x2e99ba);_[_0x37b6('0xb0')](_0x10af31,function(_0x42bd04){return!_0x4ee84c[_0x37b6('0xb1')](_0x42bd04['name']);});_0x10af31[_0x37b6('0xb2')](function(_0x574bc6){var _0x126bff=createFieldObject(_0x292631,_0x14f156,_0x574bc6[_0x37b6('0xb3')],_0x574bc6['name'],_0x574bc6[_0x37b6('0xb4')],![]);_0x21f023['push'](_0x126bff);});return Promise[_0x37b6('0xb5')](_0x21f023);})[_0x37b6('0x18')](function(_0x15f266){_0x4a26a4=_0x15f266;_0xb8ca0e=Object['assign']([],_0x2e99ba);console['log'](_0x37b6('0xb6'),_0x2e99ba);_['remove'](_0xb8ca0e,function(_0x2c4763){return _0x3cfb15['includes'](_0x2c4763[_0x37b6('0x2d')]);});console['log'](_0x37b6('0xb7'),_0xb8ca0e);_0x21f023=[];_0xb8ca0e[_0x37b6('0xb2')](function(_0x325271){var _0x4b3309=createFieldObject(_0x292631,_0x14f156,_0x325271[_0x37b6('0xb3')],_0x325271[_0x37b6('0x2d')],_0x325271[_0x37b6('0xb4')],!![]);_0x21f023[_0x37b6('0xb8')](_0x4b3309);});return Promise[_0x37b6('0xb5')](_0x21f023);})[_0x37b6('0x18')](function(_0x288434){_0x17f14a=_0x288434;var _0x1f93a8=_0x4a26a4[_0x37b6('0xb9')](_0x17f14a);return{'count':_0x1f93a8['length'],'rows':_0x1f93a8};})[_0x37b6('0x18')](respondWithResult(_0x25dd86,null))[_0x37b6('0x20')](function(_0x788096){console[_0x37b6('0xad')](_0x37b6('0xba')+_0x788096);var _0x34f791=_0x3e508f['query']['test']?0x1f4:_0x788096['statusCode']||0x1f4;logger['error'](_0x788096['stack']);delete _0x788096['name'];if(_0x34f791===0x191){_0x34f791=0x190;}_0x25dd86[_0x37b6('0x22')](_0x34f791)[_0x37b6('0x2e')](_0x3e508f[_0x37b6('0x33')][_0x37b6('0x16')]?{'message':_0x37b6('0xbb'),'statusCode':_0x788096[_0x37b6('0xbc')]}:_0x788096);});};function createFieldObject(_0x493012,_0x3f5d4f,_0x48d335,_0x518eba,_0x33b2ea,_0x4ea6a7){return new Promise(function(_0x4e4592,_0x42a10a){var _0x44ac51={'id':_0x518eba,'name':_0x33b2ea,'custom':_0x4ea6a7};if(_0x48d335===_0x37b6('0xbd')){_0x44ac51['options']=[{'name':_0x37b6('0xbe'),'value':_0x37b6('0xbf')},{'name':_0x37b6('0xc0'),'value':_0x37b6('0xc1')}];_0x4e4592(_0x44ac51);}else{var _0xff7ceb={'method':_0x37b6('0xaa'),'uri':_0x493012+_0x37b6('0xc2')+_0x518eba,'auth':_0x3f5d4f,'json':!![]};return rp(_0xff7ceb)[_0x37b6('0x18')](function(_0x2611b1){var _0x1cab00=[];if(_0x2611b1[_0x37b6('0xac')][_0x37b6('0x37')]>0x0){_0x2611b1[_0x37b6('0xac')]['forEach'](function(_0x14ad87){if(_0x14ad87[_0x37b6('0xc3')]==='false'){var _0x46a4d2={'name':_0x14ad87[_0x37b6('0xb4')],'value':_0x14ad87[_0x37b6('0xc4')]};_0x1cab00[_0x37b6('0xb8')](_0x46a4d2);}});}_0x44ac51[_0x37b6('0x46')]=_0x1cab00;if(_0x44ac51[_0x37b6('0x46')][_0x37b6('0x37')]>0x0){_0x4e4592(_0x44ac51);}else{if(_0x4ea6a7==![]){_0x4e4592();}else{_0x4e4592(_0x44ac51);}}});}});} \ No newline at end of file +var _0x48b1=['incident?sysparm_display_value=all','assign','remove','forEach','internalType','label','all','log','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','statusCode','send','Wrong\x20credentials','boolean','true','False','false','sys_choice?sysparm_query=name=incident^element=','push','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','stringify','error','code','message','ServicenowAccount,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','then','destroy','stack','name','index','ServicenowAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','key','options','includeAll','include','findAll','rows','params','find','create','body','update','findOne','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','getFields','hold_reason','knowledge','subcategory','close_code','notify','incident_state','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','number','sys_updated_by','user_input','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','description','calendar_duration','sys_class_name','close_notes','closed_by','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','severity','comments','sla_due','approval','due_date','sys_mod_count','reopen_count','escalation','correlation_id','location','category','username','password','email','remoteUri','serverUrl','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','GET'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x48b1,0x197));var _0x148b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x48b1[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x148b('0x0'));var jsonpatch=require(_0x148b('0x1'));var rp=require(_0x148b('0x2'));var moment=require(_0x148b('0x3'));var BPromise=require(_0x148b('0x4'));var Mustache=require(_0x148b('0x5'));var util=require(_0x148b('0x6'));var path=require(_0x148b('0x7'));var sox=require(_0x148b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x148b('0x9'));var squel=require(_0x148b('0xa'));var crypto=require(_0x148b('0xb'));var jsforce=require(_0x148b('0xc'));var deskjs=require(_0x148b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x148b('0xe'));var Papa=require('papaparse');var Redis=require(_0x148b('0xf'));var authService=require(_0x148b('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x148b('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x148b('0x12'));var config=require(_0x148b('0x13'));var db=require(_0x148b('0x14'))['db'];var integrations=require(_0x148b('0x15'));var jayson=require(_0x148b('0x16'));var client=jayson['client'][_0x148b('0x17')]({'port':0x232a});function checkPasswordPattern(_0x1919ed,_0x16aa32,_0x14e2b8){if(_0x14e2b8){var _0x2ba0e6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ba0e6['test'](_0x16aa32)){return _0x1919ed;}else{throw new Error(_0x148b('0x18'));}}else{return _0x1919ed;}}function respondWithRpcPromise(_0x1e59e9,_0x15c5fd,_0x15b2f1,_0x2ecaf2){return new BPromise(function(_0x16c4b6,_0x2b91d7){var _0x3852c9=_0x2ecaf2||client;return _0x3852c9[_0x148b('0x19')](_0x1e59e9,_0x15b2f1)['then'](function(_0x35420d){logger[_0x148b('0x1a')]('ServicenowAccount,\x20%s,\x20%s',_0x15c5fd,_0x148b('0x1b'));logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x15c5fd,'request\x20sent',JSON[_0x148b('0x1c')](_0x35420d));if(_0x35420d[_0x148b('0x1d')]){if(_0x35420d['error'][_0x148b('0x1e')]===0x1f4){logger[_0x148b('0x1d')]('ServicenowAccount,\x20%s,\x20%s',_0x15c5fd,_0x35420d['error'][_0x148b('0x1f')]);return _0x2b91d7(_0x35420d[_0x148b('0x1d')][_0x148b('0x1f')]);}logger[_0x148b('0x1d')](_0x148b('0x20'),_0x15c5fd,_0x35420d[_0x148b('0x1d')][_0x148b('0x1f')]);return _0x16c4b6(_0x35420d[_0x148b('0x1d')]['message']);}else{logger[_0x148b('0x1a')]('ServicenowAccount,\x20%s,\x20%s',_0x15c5fd,_0x148b('0x1b'));_0x16c4b6(_0x35420d[_0x148b('0x21')]['message']);}})[_0x148b('0x22')](function(_0x6594cf){logger[_0x148b('0x1d')](_0x148b('0x20'),_0x15c5fd,_0x6594cf);_0x2b91d7(_0x6594cf);});});}function respondWithStatusCode(_0x13c3a2,_0x3bceb9){_0x3bceb9=_0x3bceb9||0xcc;return function(_0x4f559a){if(_0x4f559a){return _0x13c3a2[_0x148b('0x23')](_0x3bceb9);}return _0x13c3a2[_0x148b('0x24')](_0x3bceb9)[_0x148b('0x25')]();};}function respondWithResult(_0x7c2de7,_0x65b099){_0x65b099=_0x65b099||0xc8;return function(_0x164604){if(_0x164604){return _0x7c2de7[_0x148b('0x24')](_0x65b099)[_0x148b('0x26')](_0x164604);}};}function respondWithFilteredResult(_0x2e164d,_0x6e3649){return function(_0x5c1ead){if(_0x5c1ead){var _0x246104=_0x5c1ead[_0x148b('0x27')],_0x3d5799=_0x6e3649[_0x148b('0x28')],_0x41b31b=_0x6e3649['offset']+_0x6e3649[_0x148b('0x29')],_0x1c8dec;if(_0x41b31b>=_0x246104){_0x41b31b=_0x246104;_0x1c8dec=0xc8;}else{_0x1c8dec=0xce;}_0x2e164d[_0x148b('0x24')](_0x1c8dec);return _0x2e164d[_0x148b('0x2a')](_0x148b('0x2b'),_0x3d5799+'-'+_0x41b31b+'/'+_0x246104)[_0x148b('0x26')](_0x5c1ead);}return null;};}function patchUpdates(_0x3f8ab0){return function(_0x452827){try{jsonpatch['apply'](_0x452827,_0x3f8ab0,!![]);}catch(_0x197782){return BPromise[_0x148b('0x2c')](_0x197782);}return _0x452827['save']();};}function saveUpdates(_0xf01f40,_0x327171){return function(_0x540fd7){if(_0x540fd7){return _0x540fd7['update'](_0xf01f40)[_0x148b('0x2d')](function(_0x5b294e){return _0x5b294e;});}return null;};}function removeEntity(_0x2cb0c9,_0x5b9a2f){return function(_0x2ca31b){if(_0x2ca31b){return _0x2ca31b[_0x148b('0x2e')]()[_0x148b('0x2d')](function(){_0x2cb0c9[_0x148b('0x24')](0xcc)[_0x148b('0x25')]();});}};}function handleEntityNotFound(_0x98b07c,_0x15f297){return function(_0x12a6e8){if(!_0x12a6e8){_0x98b07c[_0x148b('0x23')](0x194);}return _0x12a6e8;};}function handleError(_0x4003de,_0x4e385b){_0x4e385b=_0x4e385b||0x1f4;return function(_0x35afa4){logger[_0x148b('0x1d')](_0x35afa4[_0x148b('0x2f')]);if(_0x35afa4[_0x148b('0x30')]){delete _0x35afa4[_0x148b('0x30')];}_0x4003de[_0x148b('0x24')](_0x4e385b)['send'](_0x35afa4);};}exports[_0x148b('0x31')]=function(_0x4b55c3,_0xb66b18){var _0x5e1d48={},_0x4d40ea={},_0x4250b4={'count':0x0,'rows':[]};var _0x2ad01a=db[_0x148b('0x32')][_0x148b('0x33')];_0x4d40ea[_0x148b('0x34')]=_[_0x148b('0x35')](_0x2ad01a);_0x4d40ea[_0x148b('0x36')]=_[_0x148b('0x35')](_0x4b55c3[_0x148b('0x36')]);_0x4d40ea[_0x148b('0x37')]=_[_0x148b('0x38')](_0x4d40ea[_0x148b('0x34')],_0x4d40ea[_0x148b('0x36')]);_0x5e1d48[_0x148b('0x39')]=_[_0x148b('0x38')](_0x4d40ea[_0x148b('0x34')],qs[_0x148b('0x3a')](_0x4b55c3[_0x148b('0x36')][_0x148b('0x3a')]));_0x5e1d48['attributes']=_0x5e1d48[_0x148b('0x39')][_0x148b('0x3b')]?_0x5e1d48['attributes']:_0x4d40ea['model'];if(!_0x4b55c3[_0x148b('0x36')][_0x148b('0x3c')]('nolimit')){_0x5e1d48[_0x148b('0x29')]=qs[_0x148b('0x29')](_0x4b55c3[_0x148b('0x36')][_0x148b('0x29')]);_0x5e1d48[_0x148b('0x28')]=qs[_0x148b('0x28')](_0x4b55c3[_0x148b('0x36')]['offset']);}_0x5e1d48[_0x148b('0x3d')]=qs['sort'](_0x4b55c3[_0x148b('0x36')][_0x148b('0x3e')]);_0x5e1d48[_0x148b('0x3f')]=qs[_0x148b('0x37')](_[_0x148b('0x40')](_0x4b55c3['query'],_0x4d40ea[_0x148b('0x37')]));if(_0x4b55c3[_0x148b('0x36')][_0x148b('0x41')]){_0x5e1d48[_0x148b('0x3f')]=_[_0x148b('0x42')](_0x5e1d48[_0x148b('0x3f')],{'$or':_[_0x148b('0x43')](_0x2ad01a,function(_0x2f3d51){if(_0x2f3d51[_0x148b('0x44')][_0x148b('0x45')]!=='VIRTUAL'){var _0x4c6476={};_0x4c6476[_0x2f3d51['field']]={'$like':'%'+_0x4b55c3[_0x148b('0x36')][_0x148b('0x41')]+'%'};return _0x4c6476;}})});}_0x5e1d48=_[_0x148b('0x42')]({},_0x5e1d48,_0x4b55c3[_0x148b('0x46')]);var _0x5905d0={'where':_0x5e1d48[_0x148b('0x3f')]};return db['ServicenowAccount'][_0x148b('0x27')](_0x5905d0)[_0x148b('0x2d')](function(_0x2ca8b1){_0x4250b4['count']=_0x2ca8b1;if(_0x4b55c3[_0x148b('0x36')][_0x148b('0x47')]){_0x5e1d48[_0x148b('0x48')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x148b('0x49')](_0x5e1d48);})[_0x148b('0x2d')](function(_0x181f0e){_0x4250b4[_0x148b('0x4a')]=_0x181f0e;return _0x4250b4;})[_0x148b('0x2d')](respondWithFilteredResult(_0xb66b18,_0x5e1d48))[_0x148b('0x22')](handleError(_0xb66b18,null));};exports['show']=function(_0x57dbb2,_0x38a06a){var _0x299b85={'raw':![],'where':{'id':_0x57dbb2[_0x148b('0x4b')]['id']}},_0x412205={};_0x412205[_0x148b('0x34')]=_['keys'](db[_0x148b('0x32')][_0x148b('0x33')]);_0x412205[_0x148b('0x36')]=_[_0x148b('0x35')](_0x57dbb2[_0x148b('0x36')]);_0x412205[_0x148b('0x37')]=_[_0x148b('0x38')](_0x412205[_0x148b('0x34')],_0x412205[_0x148b('0x36')]);_0x299b85[_0x148b('0x39')]=_[_0x148b('0x38')](_0x412205['model'],qs[_0x148b('0x3a')](_0x57dbb2['query'][_0x148b('0x3a')]));_0x299b85['attributes']=_0x299b85[_0x148b('0x39')][_0x148b('0x3b')]?_0x299b85['attributes']:_0x412205['model'];if(_0x57dbb2['query']['includeAll']){_0x299b85[_0x148b('0x48')]=[{'all':!![]}];}_0x299b85=_[_0x148b('0x42')]({},_0x299b85,_0x57dbb2['options']);return db[_0x148b('0x32')][_0x148b('0x4c')](_0x299b85)[_0x148b('0x2d')](handleEntityNotFound(_0x38a06a,null))[_0x148b('0x2d')](respondWithResult(_0x38a06a,null))[_0x148b('0x22')](handleError(_0x38a06a,null));};exports[_0x148b('0x4d')]=function(_0x25c101,_0x229a5d){return db[_0x148b('0x32')][_0x148b('0x4d')](_0x25c101[_0x148b('0x4e')],{})[_0x148b('0x2d')](respondWithResult(_0x229a5d,0xc9))[_0x148b('0x22')](handleError(_0x229a5d,null));};exports[_0x148b('0x4f')]=function(_0x15915d,_0x64940e){if(_0x15915d[_0x148b('0x4e')]['id']){delete _0x15915d[_0x148b('0x4e')]['id'];}return db[_0x148b('0x32')][_0x148b('0x4c')]({'where':{'id':_0x15915d[_0x148b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x64940e,null))[_0x148b('0x2d')](saveUpdates(_0x15915d[_0x148b('0x4e')],null))['then'](respondWithResult(_0x64940e,null))[_0x148b('0x22')](handleError(_0x64940e,null));};exports[_0x148b('0x2e')]=function(_0x1bc3f6,_0x4caceb){return db['ServicenowAccount'][_0x148b('0x4c')]({'where':{'id':_0x1bc3f6[_0x148b('0x4b')]['id']}})[_0x148b('0x2d')](handleEntityNotFound(_0x4caceb,null))[_0x148b('0x2d')](removeEntity(_0x4caceb,null))[_0x148b('0x22')](handleError(_0x4caceb,null));};exports['getConfigurations']=function(_0x360df3,_0x287a28,_0x15d050){var _0x177ba3={};var _0xce1d0a={};var _0x737a67;var _0x5312b6;return db['ServicenowAccount'][_0x148b('0x50')]({'where':{'id':_0x360df3[_0x148b('0x4b')]['id']}})[_0x148b('0x2d')](handleEntityNotFound(_0x287a28,null))[_0x148b('0x2d')](function(_0x13a544){if(_0x13a544){_0x737a67=_0x13a544;_0xce1d0a['model']=_[_0x148b('0x35')](db['ServicenowConfiguration'][_0x148b('0x33')]);_0xce1d0a[_0x148b('0x36')]=_[_0x148b('0x35')](_0x360df3[_0x148b('0x36')]);_0xce1d0a['filters']=_['intersection'](_0xce1d0a[_0x148b('0x34')],_0xce1d0a['query']);_0x177ba3['attributes']=_['intersection'](_0xce1d0a[_0x148b('0x34')],qs[_0x148b('0x3a')](_0x360df3[_0x148b('0x36')][_0x148b('0x3a')]));_0x177ba3[_0x148b('0x39')]=_0x177ba3[_0x148b('0x39')][_0x148b('0x3b')]?_0x177ba3['attributes']:_0xce1d0a[_0x148b('0x34')];_0x177ba3[_0x148b('0x3d')]=qs[_0x148b('0x3e')](_0x360df3[_0x148b('0x36')]['sort']);_0x177ba3[_0x148b('0x3f')]=qs['filters'](_[_0x148b('0x40')](_0x360df3['query'],_0xce1d0a[_0x148b('0x37')]));if(_0x360df3[_0x148b('0x36')][_0x148b('0x41')]){_0x177ba3['where']=_[_0x148b('0x42')](_0x177ba3[_0x148b('0x3f')],{'$or':_[_0x148b('0x43')](_0x177ba3[_0x148b('0x39')],function(_0x32867e){var _0x3b4b86={};_0x3b4b86[_0x32867e]={'$like':'%'+_0x360df3[_0x148b('0x36')][_0x148b('0x41')]+'%'};return _0x3b4b86;})});}_0x177ba3=_['merge']({},_0x177ba3,_0x360df3[_0x148b('0x46')]);return _0x737a67[_0x148b('0x51')](_0x177ba3);}})[_0x148b('0x2d')](function(_0xd95aba){if(_0xd95aba){_0x5312b6=_0xd95aba[_0x148b('0x3b')];if(!_0x360df3[_0x148b('0x36')][_0x148b('0x3c')]('nolimit')){_0x177ba3[_0x148b('0x29')]=qs[_0x148b('0x29')](_0x360df3[_0x148b('0x36')]['limit']);_0x177ba3[_0x148b('0x28')]=qs[_0x148b('0x28')](_0x360df3[_0x148b('0x36')][_0x148b('0x28')]);}return _0x737a67['getConfigurations'](_0x177ba3);}})[_0x148b('0x2d')](function(_0x499c99){if(_0x499c99){return _0x499c99?{'count':_0x5312b6,'rows':_0x499c99}:null;}})[_0x148b('0x2d')](respondWithResult(_0x287a28,null))['catch'](handleError(_0x287a28,null));};exports[_0x148b('0x52')]=function(_0x4eecc0,_0x4b0226,_0x463b65){if(_0x4eecc0['body']['id']){delete _0x4eecc0['body']['id'];}return db['ServicenowAccount'][_0x148b('0x50')]({'where':{'id':_0x4eecc0[_0x148b('0x4b')]['id']}})[_0x148b('0x2d')](handleEntityNotFound(_0x4b0226,null))['then'](function(_0x384e19){if(_0x384e19){_0x4eecc0[_0x148b('0x4e')][_0x148b('0x53')]=_0x384e19['id'];_0x4eecc0[_0x148b('0x4e')][_0x148b('0x54')]=integrations[_0x148b('0x55')](_0x4eecc0['body'][_0x148b('0x56')],_0x4eecc0[_0x148b('0x4e')][_0x148b('0x44')]);_0x4eecc0[_0x148b('0x4e')]['Descriptions']=integrations[_0x148b('0x57')](_0x4eecc0['body'][_0x148b('0x56')],_0x4eecc0[_0x148b('0x4e')][_0x148b('0x44')]);return db['ServicenowConfiguration']['create'](_0x4eecc0[_0x148b('0x4e')],{'include':[{'model':db['ServicenowField'],'as':_0x148b('0x54')},{'model':db[_0x148b('0x58')],'as':_0x148b('0x59')}]});}return null;})[_0x148b('0x2d')](respondWithResult(_0x4b0226,null))[_0x148b('0x22')](handleError(_0x4b0226,null));};exports[_0x148b('0x5a')]=function(_0x430127,_0x545b48,_0x59e8fb){var _0x57bc34=['made_sla',_0x148b('0x5b'),_0x148b('0x5c'),_0x148b('0x5d'),_0x148b('0x5e'),_0x148b('0x5f'),_0x148b('0x60'),'severity','category'];var _0x1343e7=[_0x148b('0x61'),_0x148b('0x62'),_0x148b('0x63'),_0x148b('0x64'),_0x148b('0x65'),_0x148b('0x66'),_0x148b('0x67'),_0x148b('0x5b'),'approval_history',_0x148b('0x68'),'resolved_by',_0x148b('0x69'),'opened_by',_0x148b('0x6a'),'sys_created_on',_0x148b('0x6b'),_0x148b('0x6c'),_0x148b('0x6d'),_0x148b('0x5c'),_0x148b('0x3d'),_0x148b('0x6e'),_0x148b('0x6f'),_0x148b('0x70'),_0x148b('0x71'),_0x148b('0x72'),_0x148b('0x73'),'work_notes_list','business_service',_0x148b('0x74'),_0x148b('0x75'),_0x148b('0x76'),_0x148b('0x77'),_0x148b('0x78'),_0x148b('0x79'),_0x148b('0x7a'),_0x148b('0x7b'),_0x148b('0x7c'),_0x148b('0x7d'),_0x148b('0x7e'),_0x148b('0x7f'),_0x148b('0x80'),'subcategory',_0x148b('0x81'),_0x148b('0x82'),_0x148b('0x5e'),_0x148b('0x83'),_0x148b('0x84'),_0x148b('0x85'),_0x148b('0x86'),_0x148b('0x87'),'additional_assignee_list',_0x148b('0x88'),_0x148b('0x89'),_0x148b('0x5f'),_0x148b('0x8a'),_0x148b('0x8b'),_0x148b('0x8c'),'follow_up',_0x148b('0x8d'),_0x148b('0x8e'),_0x148b('0x8f'),_0x148b('0x90'),_0x148b('0x60'),_0x148b('0x91'),_0x148b('0x92'),_0x148b('0x93'),_0x148b('0x94'),_0x148b('0x95'),_0x148b('0x96'),_0x148b('0x97'),_0x148b('0x98'),_0x148b('0x99'),_0x148b('0x9a'),'comments_and_work_notes',_0x148b('0x9b'),_0x148b('0x9c'),_0x148b('0x9d'),'sys_tags',_0x148b('0x9e'),'upon_approval',_0x148b('0x9f'),_0x148b('0xa0'),_0x148b('0xa1')];var _0x315af8='';var _0xa24729='';var _0x4bafdf=[];var _0x371652='';var _0x2db8c6='';var _0x23cf99=[];var _0x5a926d='';var _0xb4bb86='';var _0x1a4a4e={};var _0x3f9c16='';return db[_0x148b('0x32')][_0x148b('0x50')]({'where':{'id':_0x430127['params']['id']},'attributes':['id',_0x148b('0xa2'),_0x148b('0xa3'),_0x148b('0xa4'),_0x148b('0xa5'),_0x148b('0xa6')]})[_0x148b('0x2d')](handleEntityNotFound(_0x545b48,null))[_0x148b('0x2d')](function(_0x1a4e7b){if(_0x1a4e7b){_0x3f9c16=_0x1a4e7b[_0x148b('0xa5')];var _0x46013f=_0x3f9c16['slice'](-0x1);if(_0x46013f==='/'){_0x3f9c16=_0x3f9c16[_0x148b('0xa7')](0x0,_0x3f9c16[_0x148b('0xa8')](_0x46013f));}_0xb4bb86=util[_0x148b('0xa9')](_0x148b('0xaa'),_0x3f9c16);_0x5a926d=util[_0x148b('0xa9')]('%s/api/now/table/',_0x3f9c16);_0x1a4a4e={'user':_0x1a4e7b[_0x148b('0xa2')],'pass':_0x1a4e7b[_0x148b('0xa3')]};var _0x59b96a={'method':_0x148b('0xab'),'uri':_0xb4bb86+_0x148b('0xac'),'auth':_0x1a4a4e,'json':!![]};return rp(_0x59b96a);}})[_0x148b('0x2d')](function(_0x8a1f85){if(_0x8a1f85[_0x148b('0x21')]['length']>0x0){_0x315af8=_0x8a1f85[_0x148b('0x21')];}console['log']('incident\x20table\x20objects',_0x315af8);_0x23cf99=[];_0xa24729=Object[_0x148b('0xad')]([],_0x315af8);_[_0x148b('0xae')](_0xa24729,function(_0x58324c){return!_0x57bc34['includes'](_0x58324c['name']);});_0xa24729[_0x148b('0xaf')](function(_0x22e54a){var _0x2adba6=createFieldObject(_0x5a926d,_0x1a4a4e,_0x22e54a[_0x148b('0xb0')],_0x22e54a[_0x148b('0x30')],_0x22e54a[_0x148b('0xb1')],![]);_0x23cf99['push'](_0x2adba6);});return Promise[_0x148b('0xb2')](_0x23cf99);})['then'](function(_0x5d76ee){_0x4bafdf=_0x5d76ee;_0x371652=Object['assign']([],_0x315af8);console[_0x148b('0xb3')](_0x148b('0xb4'),_0x315af8);_['remove'](_0x371652,function(_0x30d8b8){return _0x1343e7[_0x148b('0xb5')](_0x30d8b8[_0x148b('0x30')]);});console[_0x148b('0xb3')](_0x148b('0xb6'),_0x371652);_0x23cf99=[];_0x371652[_0x148b('0xaf')](function(_0x4fe956){var _0x339526=createFieldObject(_0x5a926d,_0x1a4a4e,_0x4fe956['internalType'],_0x4fe956['name'],_0x4fe956[_0x148b('0xb1')],!![]);_0x23cf99['push'](_0x339526);});return Promise[_0x148b('0xb2')](_0x23cf99);})[_0x148b('0x2d')](function(_0x339137){_0x2db8c6=_0x339137;var _0x5e2794=_0x4bafdf[_0x148b('0xb7')](_0x2db8c6);return{'count':_0x5e2794[_0x148b('0x3b')],'rows':_0x5e2794};})[_0x148b('0x2d')](respondWithResult(_0x545b48,null))[_0x148b('0x22')](function(_0x52167a){console[_0x148b('0xb3')]('ServiceNow\x20error:\x20'+_0x52167a);var _0x34f674=_0x430127[_0x148b('0x36')]['test']?0x1f4:_0x52167a[_0x148b('0xb8')]||0x1f4;logger[_0x148b('0x1d')](_0x52167a[_0x148b('0x2f')]);delete _0x52167a[_0x148b('0x30')];if(_0x34f674===0x191){_0x34f674=0x190;}_0x545b48['status'](_0x34f674)[_0x148b('0xb9')](_0x430127[_0x148b('0x36')]['test']?{'message':_0x148b('0xba'),'statusCode':_0x52167a[_0x148b('0xb8')]}:_0x52167a);});};function createFieldObject(_0x17ab48,_0x5bc318,_0x50d813,_0x1e4cc9,_0x5e2440,_0x12d6f7){return new Promise(function(_0x4036c1,_0x3b5858){var _0x1bde33={'id':_0x1e4cc9,'name':_0x5e2440,'custom':_0x12d6f7};if(_0x50d813===_0x148b('0xbb')){_0x1bde33['options']=[{'name':'True','value':_0x148b('0xbc')},{'name':_0x148b('0xbd'),'value':_0x148b('0xbe')}];_0x4036c1(_0x1bde33);}else{var _0x17f25b={'method':'GET','uri':_0x17ab48+_0x148b('0xbf')+_0x1e4cc9,'auth':_0x5bc318,'json':!![]};return rp(_0x17f25b)[_0x148b('0x2d')](function(_0x52d617){var _0x5bddae=[];if(_0x52d617[_0x148b('0x21')]['length']>0x0){_0x52d617[_0x148b('0x21')][_0x148b('0xaf')](function(_0x19c65c){if(_0x19c65c['inactive']===_0x148b('0xbe')){var _0x2aeb6e={'name':_0x19c65c['label'],'value':_0x19c65c['value']};_0x5bddae[_0x148b('0xc0')](_0x2aeb6e);}});}_0x1bde33[_0x148b('0x46')]=_0x5bddae;if(_0x1bde33['options']['length']>0x0){_0x4036c1(_0x1bde33);}else{if(_0x12d6f7==![]){_0x4036c1();}else{_0x4036c1(_0x1bde33);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index dfa3ccf..c113cb8 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util'];(function(_0x40b788,_0x4396a9){var _0x704454=function(_0x51d256){while(--_0x51d256){_0x40b788['push'](_0x40b788['shift']());}};_0x704454(++_0x4396a9);}(_0x814b,0x1a2));var _0xb814=function(_0x3ec333,_0x26bcbe){_0x3ec333=_0x3ec333-0x0;var _0x15ccb8=_0x814b[_0x3ec333];return _0x15ccb8;};'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'));var integrations=require(_0xb814('0xa'));module[_0xb814('0xb')]=function(_0x53e507,_0x3b0829){return _0x53e507[_0xb814('0xc')]('ServicenowAccount',attributes,{'tableName':_0xb814('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intServicenowAccount.attributes'];(function(_0xef4cf0,_0x16c9c3){var _0x497ad2=function(_0xce63d4){while(--_0xce63d4){_0xef4cf0['push'](_0xef4cf0['shift']());}};_0x497ad2(++_0x16c9c3);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));var integrations=require(_0x7995('0x9'));module[_0x7995('0xa')]=function(_0x219534,_0xbda126){return _0x219534[_0x7995('0xb')]('ServicenowAccount',attributes,{'tableName':_0x7995('0xc'),'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 80dad2f..b7c4b1c 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 _0x694e=['options','raw','where','attributes','limit','include','map','model','GetServicenowAccount','ShowServicenowAccount','ServicenowAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','findAll'];(function(_0x52632a,_0xe5d3a2){var _0x4346cb=function(_0x479511){while(--_0x479511){_0x52632a['push'](_0x52632a['shift']());}};_0x4346cb(++_0xe5d3a2);}(_0x694e,0x123));var _0xe694=function(_0x17515d,_0x41a967){_0x17515d=_0x17515d-0x0;var _0x4e0ffb=_0x694e[_0x17515d];return _0x4e0ffb;};'use strict';var _=require(_0xe694('0x0'));var util=require(_0xe694('0x1'));var moment=require(_0xe694('0x2'));var BPromise=require(_0xe694('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe694('0x4'));var db=require(_0xe694('0x5'))['db'];var utils=require(_0xe694('0x6'));var logger=require('../../config/logger')(_0xe694('0x7'));var config=require(_0xe694('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe694('0x9')][_0xe694('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47d255,_0x150353,_0x111338){return new BPromise(function(_0x23aa05,_0x12e912){return client[_0xe694('0xb')](_0x47d255,_0x111338)[_0xe694('0xc')](function(_0x40f65c){logger['info'](_0xe694('0xd'),_0x150353,_0xe694('0xe'));logger[_0xe694('0xf')](_0xe694('0x10'),_0x150353,_0xe694('0xe'),JSON[_0xe694('0x11')](_0x40f65c));if(_0x40f65c[_0xe694('0x12')]){if(_0x40f65c['error']['code']===0x1f4){logger[_0xe694('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x150353,_0x40f65c[_0xe694('0x12')][_0xe694('0x13')]);return _0x12e912(_0x40f65c['error'][_0xe694('0x13')]);}logger['error'](_0xe694('0xd'),_0x150353,_0x40f65c[_0xe694('0x12')]['message']);return _0x23aa05(_0x40f65c[_0xe694('0x12')]['message']);}else{logger[_0xe694('0x14')](_0xe694('0xd'),_0x150353,_0xe694('0xe'));_0x23aa05(_0x40f65c[_0xe694('0x15')][_0xe694('0x13')]);}})[_0xe694('0x16')](function(_0x47fa0c){logger[_0xe694('0x12')](_0xe694('0xd'),_0x150353,_0x47fa0c);_0x12e912(_0x47fa0c);});});}exports['GetServicenowAccount']=function(_0x21d42b){var _0x24ac03=this;return new Promise(function(_0x4cb83e,_0x5473a5){return db['ServicenowAccount'][_0xe694('0x17')]({'raw':_0x21d42b[_0xe694('0x18')]?_0x21d42b[_0xe694('0x18')][_0xe694('0x19')]===undefined?!![]:![]:!![],'where':_0x21d42b[_0xe694('0x18')]?_0x21d42b[_0xe694('0x18')][_0xe694('0x1a')]||null:null,'attributes':_0x21d42b[_0xe694('0x18')]?_0x21d42b['options'][_0xe694('0x1b')]||null:null,'limit':_0x21d42b[_0xe694('0x18')]?_0x21d42b[_0xe694('0x18')][_0xe694('0x1c')]||null:null,'include':_0x21d42b[_0xe694('0x18')]?_0x21d42b[_0xe694('0x18')][_0xe694('0x1d')]?_[_0xe694('0x1e')](_0x21d42b[_0xe694('0x18')][_0xe694('0x1d')],function(_0x456eab){return{'model':db[_0x456eab['model']],'as':_0x456eab['as'],'attributes':_0x456eab[_0xe694('0x1b')],'include':_0x456eab[_0xe694('0x1d')]?_[_0xe694('0x1e')](_0x456eab[_0xe694('0x1d')],function(_0x3261c4){return{'model':db[_0x3261c4[_0xe694('0x1f')]],'as':_0x3261c4['as'],'attributes':_0x3261c4['attributes'],'include':_0x3261c4[_0xe694('0x1d')]?_[_0xe694('0x1e')](_0x3261c4[_0xe694('0x1d')],function(_0x5a3384){return{'model':db[_0x5a3384['model']],'as':_0x5a3384['as'],'attributes':_0x5a3384[_0xe694('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe694('0xc')](function(_0x48f33e){logger[_0xe694('0x14')]('GetServicenowAccount',_0x21d42b);logger[_0xe694('0xf')](_0xe694('0x20'),_0x21d42b,JSON[_0xe694('0x11')](_0x48f33e));_0x4cb83e(_0x48f33e);})[_0xe694('0x16')](function(_0x2958a5){logger[_0xe694('0x12')]('GetServicenowAccount',_0x2958a5[_0xe694('0x13')],_0x21d42b);_0x5473a5(_0x24ac03['error'](0x1f4,_0x2958a5[_0xe694('0x13')]));});});};exports[_0xe694('0x21')]=function(_0x1d46a2){var _0x590877=this;return new Promise(function(_0x2b7136,_0x246cf6){return db[_0xe694('0x22')]['find']({'raw':_0x1d46a2[_0xe694('0x18')]?_0x1d46a2['options']['raw']===undefined?!![]:![]:!![],'where':_0x1d46a2[_0xe694('0x18')]?_0x1d46a2[_0xe694('0x18')]['where']||null:null,'attributes':_0x1d46a2[_0xe694('0x18')]?_0x1d46a2[_0xe694('0x18')][_0xe694('0x1b')]||null:null,'include':_0x1d46a2['options']?_0x1d46a2[_0xe694('0x18')][_0xe694('0x1d')]?_[_0xe694('0x1e')](_0x1d46a2[_0xe694('0x18')]['include'],function(_0x2602e7){return{'model':db[_0x2602e7['model']],'as':_0x2602e7['as'],'attributes':_0x2602e7[_0xe694('0x1b')],'include':_0x2602e7[_0xe694('0x1d')]?_['map'](_0x2602e7[_0xe694('0x1d')],function(_0x38a14c){return{'model':db[_0x38a14c[_0xe694('0x1f')]],'as':_0x38a14c['as'],'attributes':_0x38a14c[_0xe694('0x1b')],'include':_0x38a14c['include']?_[_0xe694('0x1e')](_0x38a14c[_0xe694('0x1d')],function(_0x489a74){return{'model':db[_0x489a74['model']],'as':_0x489a74['as'],'attributes':_0x489a74[_0xe694('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe694('0xc')](function(_0x50f903){logger[_0xe694('0x14')]('ShowServicenowAccount',_0x1d46a2);logger[_0xe694('0xf')]('ShowServicenowAccount',_0x1d46a2,JSON['stringify'](_0x50f903));_0x2b7136(_0x50f903);})[_0xe694('0x16')](function(_0x41e912){logger[_0xe694('0x12')](_0xe694('0x21'),_0x41e912[_0xe694('0x13')],_0x1d46a2);_0x246cf6(_0x590877[_0xe694('0x12')](0x1f4,_0x41e912['message']));});});}; \ No newline at end of file +var _0xfb41=['attributes','stringify','find','ShowServicenowAccount','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','limit','include','map','model'];(function(_0x3baf7d,_0x38ebf2){var _0x4aa325=function(_0x328ff6){while(--_0x328ff6){_0x3baf7d['push'](_0x3baf7d['shift']());}};_0x4aa325(++_0x38ebf2);}(_0xfb41,0x164));var _0x1fb4=function(_0x18cac4,_0x57a4d5){_0x18cac4=_0x18cac4-0x0;var _0x2227c6=_0xfb41[_0x18cac4];return _0x2227c6;};'use strict';var _=require(_0x1fb4('0x0'));var util=require(_0x1fb4('0x1'));var moment=require(_0x1fb4('0x2'));var BPromise=require(_0x1fb4('0x3'));var rs=require(_0x1fb4('0x4'));var fs=require('fs');var Redis=require(_0x1fb4('0x5'));var db=require(_0x1fb4('0x6'))['db'];var utils=require(_0x1fb4('0x7'));var logger=require(_0x1fb4('0x8'))(_0x1fb4('0x9'));var config=require(_0x1fb4('0xa'));var jayson=require(_0x1fb4('0xb'));var client=jayson[_0x1fb4('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b53e0,_0x56892f,_0x1d81d8){return new BPromise(function(_0x29b6f0,_0x5d6451){return client[_0x1fb4('0xd')](_0x2b53e0,_0x1d81d8)[_0x1fb4('0xe')](function(_0x35078c){logger[_0x1fb4('0xf')](_0x1fb4('0x10'),_0x56892f,_0x1fb4('0x11'));logger['debug'](_0x1fb4('0x12'),_0x56892f,'request\x20sent',JSON['stringify'](_0x35078c));if(_0x35078c[_0x1fb4('0x13')]){if(_0x35078c[_0x1fb4('0x13')][_0x1fb4('0x14')]===0x1f4){logger['error'](_0x1fb4('0x10'),_0x56892f,_0x35078c[_0x1fb4('0x13')]['message']);return _0x5d6451(_0x35078c[_0x1fb4('0x13')][_0x1fb4('0x15')]);}logger[_0x1fb4('0x13')](_0x1fb4('0x10'),_0x56892f,_0x35078c['error'][_0x1fb4('0x15')]);return _0x29b6f0(_0x35078c['error']['message']);}else{logger[_0x1fb4('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x56892f,'request\x20sent');_0x29b6f0(_0x35078c[_0x1fb4('0x16')][_0x1fb4('0x15')]);}})[_0x1fb4('0x17')](function(_0x14cbfa){logger[_0x1fb4('0x13')](_0x1fb4('0x10'),_0x56892f,_0x14cbfa);_0x5d6451(_0x14cbfa);});});}exports[_0x1fb4('0x18')]=function(_0x251fab){var _0x19586e=this;return new Promise(function(_0x3a5bca,_0x396c5a){return db[_0x1fb4('0x19')][_0x1fb4('0x1a')]({'raw':_0x251fab[_0x1fb4('0x1b')]?_0x251fab['options'][_0x1fb4('0x1c')]===undefined?!![]:![]:!![],'where':_0x251fab[_0x1fb4('0x1b')]?_0x251fab[_0x1fb4('0x1b')][_0x1fb4('0x1d')]||null:null,'attributes':_0x251fab[_0x1fb4('0x1b')]?_0x251fab[_0x1fb4('0x1b')]['attributes']||null:null,'limit':_0x251fab['options']?_0x251fab[_0x1fb4('0x1b')][_0x1fb4('0x1e')]||null:null,'include':_0x251fab[_0x1fb4('0x1b')]?_0x251fab[_0x1fb4('0x1b')][_0x1fb4('0x1f')]?_[_0x1fb4('0x20')](_0x251fab['options']['include'],function(_0x17ba73){return{'model':db[_0x17ba73[_0x1fb4('0x21')]],'as':_0x17ba73['as'],'attributes':_0x17ba73[_0x1fb4('0x22')],'include':_0x17ba73[_0x1fb4('0x1f')]?_['map'](_0x17ba73[_0x1fb4('0x1f')],function(_0x3c09c7){return{'model':db[_0x3c09c7['model']],'as':_0x3c09c7['as'],'attributes':_0x3c09c7[_0x1fb4('0x22')],'include':_0x3c09c7[_0x1fb4('0x1f')]?_[_0x1fb4('0x20')](_0x3c09c7[_0x1fb4('0x1f')],function(_0x25382c){return{'model':db[_0x25382c['model']],'as':_0x25382c['as'],'attributes':_0x25382c[_0x1fb4('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1fb4('0xe')](function(_0x4bd9a8){logger[_0x1fb4('0xf')]('GetServicenowAccount',_0x251fab);logger['debug'](_0x1fb4('0x18'),_0x251fab,JSON[_0x1fb4('0x23')](_0x4bd9a8));_0x3a5bca(_0x4bd9a8);})[_0x1fb4('0x17')](function(_0xb3f37d){logger[_0x1fb4('0x13')]('GetServicenowAccount',_0xb3f37d[_0x1fb4('0x15')],_0x251fab);_0x396c5a(_0x19586e[_0x1fb4('0x13')](0x1f4,_0xb3f37d['message']));});});};exports['ShowServicenowAccount']=function(_0x352737){var _0x278233=this;return new Promise(function(_0x2d5d52,_0x5229e0){return db[_0x1fb4('0x19')][_0x1fb4('0x24')]({'raw':_0x352737[_0x1fb4('0x1b')]?_0x352737['options'][_0x1fb4('0x1c')]===undefined?!![]:![]:!![],'where':_0x352737[_0x1fb4('0x1b')]?_0x352737['options']['where']||null:null,'attributes':_0x352737[_0x1fb4('0x1b')]?_0x352737['options']['attributes']||null:null,'include':_0x352737[_0x1fb4('0x1b')]?_0x352737[_0x1fb4('0x1b')][_0x1fb4('0x1f')]?_[_0x1fb4('0x20')](_0x352737[_0x1fb4('0x1b')][_0x1fb4('0x1f')],function(_0x8d4e9){return{'model':db[_0x8d4e9[_0x1fb4('0x21')]],'as':_0x8d4e9['as'],'attributes':_0x8d4e9['attributes'],'include':_0x8d4e9[_0x1fb4('0x1f')]?_[_0x1fb4('0x20')](_0x8d4e9[_0x1fb4('0x1f')],function(_0x11bd1d){return{'model':db[_0x11bd1d[_0x1fb4('0x21')]],'as':_0x11bd1d['as'],'attributes':_0x11bd1d[_0x1fb4('0x22')],'include':_0x11bd1d['include']?_[_0x1fb4('0x20')](_0x11bd1d[_0x1fb4('0x1f')],function(_0x17b54d){return{'model':db[_0x17b54d[_0x1fb4('0x21')]],'as':_0x17b54d['as'],'attributes':_0x17b54d['attributes']};}):[]};}):[]};}):[]:[]})[_0x1fb4('0xe')](function(_0x582e99){logger['info'](_0x1fb4('0x25'),_0x352737);logger[_0x1fb4('0x26')]('ShowServicenowAccount',_0x352737,JSON['stringify'](_0x582e99));_0x2d5d52(_0x582e99);})[_0x1fb4('0x17')](function(_0x3eb234){logger[_0x1fb4('0x13')](_0x1fb4('0x25'),_0x3eb234['message'],_0x352737);_0x5229e0(_0x278233[_0x1fb4('0x13')](0x1f4,_0x3eb234[_0x1fb4('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index f1b23b4..3f6f0cb 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 _0xc810=['multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','create','put','update','destroy','exports'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0xc810,0x118));var _0x0c81=function(_0x4757fc,_0x69fcc7){_0x4757fc=_0x4757fc-0x0;var _0x3dcd65=_0xc810[_0x4757fc];return _0x3dcd65;};'use strict';var multer=require(_0x0c81('0x0'));var util=require('util');var path=require(_0x0c81('0x1'));var timeout=require(_0x0c81('0x2'));var express=require(_0x0c81('0x3'));var router=express[_0x0c81('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0c81('0x5'));var config=require(_0x0c81('0x6'));var controller=require(_0x0c81('0x7'));router[_0x0c81('0x8')]('/',auth[_0x0c81('0x9')](),controller['index']);router[_0x0c81('0x8')](_0x0c81('0xa'),auth[_0x0c81('0x9')](),controller[_0x0c81('0xb')]);router['get'](_0x0c81('0xc'),auth[_0x0c81('0x9')](),controller[_0x0c81('0xd')]);router[_0x0c81('0x8')](_0x0c81('0xe'),auth[_0x0c81('0x9')](),controller['getSubjects']);router[_0x0c81('0x8')]('/:id/descriptions',auth[_0x0c81('0x9')](),controller['getDescriptions']);router['post']('/',auth[_0x0c81('0x9')](),controller[_0x0c81('0xf')]);router[_0x0c81('0x10')](_0x0c81('0xa'),auth[_0x0c81('0x9')](),controller[_0x0c81('0x11')]);router['delete'](_0x0c81('0xa'),auth[_0x0c81('0x9')](),controller[_0x0c81('0x12')]);module[_0x0c81('0x13')]=router; \ No newline at end of file +var _0xe33a=['delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe33a,0x1d0));var _0xae33=function(_0x3118b2,_0x46781b){_0x3118b2=_0x3118b2-0x0;var _0x136eeb=_0xe33a[_0x3118b2];return _0x136eeb;};'use strict';var multer=require(_0xae33('0x0'));var util=require(_0xae33('0x1'));var path=require('path');var timeout=require(_0xae33('0x2'));var express=require(_0xae33('0x3'));var router=express[_0xae33('0x4')]();var auth=require(_0xae33('0x5'));var interaction=require(_0xae33('0x6'));var config=require(_0xae33('0x7'));var controller=require(_0xae33('0x8'));router[_0xae33('0x9')]('/',auth[_0xae33('0xa')](),controller[_0xae33('0xb')]);router[_0xae33('0x9')](_0xae33('0xc'),auth[_0xae33('0xa')](),controller[_0xae33('0xd')]);router[_0xae33('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xae33('0xe')]);router['get'](_0xae33('0xf'),auth[_0xae33('0xa')](),controller[_0xae33('0x10')]);router['get'](_0xae33('0x11'),auth[_0xae33('0xa')](),controller['getDescriptions']);router[_0xae33('0x12')]('/',auth[_0xae33('0xa')](),controller[_0xae33('0x13')]);router['put'](_0xae33('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xae33('0x14')](_0xae33('0xc'),auth[_0xae33('0xa')](),controller['destroy']);module[_0xae33('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 9ceb309..34dde1b 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 _0xe6ec=['sequelize','exports'];(function(_0x5d48f5,_0xedd5a2){var _0x3c705b=function(_0xd2c553){while(--_0xd2c553){_0x5d48f5['push'](_0x5d48f5['shift']());}};_0x3c705b(++_0xedd5a2);}(_0xe6ec,0x1be));var _0xce6e=function(_0x15e7fd,_0x1f8fd2){_0x15e7fd=_0x15e7fd-0x0;var _0x39133b=_0xe6ec[_0x15e7fd];return _0x39133b;};'use strict';var Sequelize=require(_0xce6e('0x0'));module[_0xce6e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xeeba=['STRING','sequelize','exports'];(function(_0x339a47,_0x5de456){var _0x4fc82e=function(_0x572fb3){while(--_0x572fb3){_0x339a47['push'](_0x339a47['shift']());}};_0x4fc82e(++_0x5de456);}(_0xeeba,0x94));var _0xaeeb=function(_0x1f40f0,_0x30ecdc){_0x1f40f0=_0x1f40f0-0x0;var _0x4feb4d=_0xeeba[_0x1f40f0];return _0x4feb4d;};'use strict';var Sequelize=require(_0xaeeb('0x0'));module[_0xaeeb('0x1')]={'name':{'type':Sequelize[_0xaeeb('0x2')]},'description':{'type':Sequelize[_0xaeeb('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 356ba08..37e37f6 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 _0xcdd0=['intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','field','options','then','includeAll','rows','fields','include','find','create','body','destroy','params','getFields','ServicenowField','getSubjects','findOne','map','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','count','offset','limit','set','Content-Range','apply','reject','update','stack','name','index','ServicenowConfiguration','rawAttributes','model','keys','query','filters'];(function(_0x4f734b,_0x365908){var _0x2ca620=function(_0x19f510){while(--_0x19f510){_0x4f734b['push'](_0x4f734b['shift']());}};_0x2ca620(++_0x365908);}(_0xcdd0,0x169));var _0x0cdd=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xcdd0[_0x1035c1];return _0x308d67;};'use strict';var pdf=require(_0x0cdd('0x0'));var emlformat=require(_0x0cdd('0x1'));var rimraf=require(_0x0cdd('0x2'));var zipdir=require(_0x0cdd('0x3'));var jsonpatch=require(_0x0cdd('0x4'));var rp=require(_0x0cdd('0x5'));var moment=require(_0x0cdd('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x0cdd('0x7'));var util=require('util');var path=require(_0x0cdd('0x8'));var sox=require(_0x0cdd('0x9'));var csv=require(_0x0cdd('0xa'));var ejs=require(_0x0cdd('0xb'));var fs=require('fs');var _=require(_0x0cdd('0xc'));var squel=require(_0x0cdd('0xd'));var crypto=require(_0x0cdd('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0cdd('0xa'));var querystring=require('querystring');var Papa=require(_0x0cdd('0xf'));var Redis=require(_0x0cdd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0cdd('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0cdd('0x12'))(_0x0cdd('0x13'));var utils=require(_0x0cdd('0x14'));var config=require(_0x0cdd('0x15'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x0cdd('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x3c31a0,_0x391e3c,_0x217080){if(_0x217080){var _0x37ac50=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x37ac50[_0x0cdd('0x17')](_0x391e3c)){return _0x3c31a0;}else{throw new Error(_0x0cdd('0x18'));}}else{return _0x3c31a0;}}function respondWithRpcPromise(_0x2a13e3,_0x2284e7,_0x185585,_0x55a634){return new BPromise(function(_0x4f8fa1,_0x508417){var _0x4098c7=_0x55a634||client;return _0x4098c7[_0x0cdd('0x19')](_0x2a13e3,_0x185585)['then'](function(_0x3ab88f){logger[_0x0cdd('0x1a')](_0x0cdd('0x1b'),_0x2284e7,_0x0cdd('0x1c'));logger['debug'](_0x0cdd('0x1d'),_0x2284e7,_0x0cdd('0x1c'),JSON[_0x0cdd('0x1e')](_0x3ab88f));if(_0x3ab88f[_0x0cdd('0x1f')]){if(_0x3ab88f[_0x0cdd('0x1f')][_0x0cdd('0x20')]===0x1f4){logger[_0x0cdd('0x1f')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2284e7,_0x3ab88f[_0x0cdd('0x1f')][_0x0cdd('0x21')]);return _0x508417(_0x3ab88f[_0x0cdd('0x1f')]['message']);}logger['error'](_0x0cdd('0x1b'),_0x2284e7,_0x3ab88f[_0x0cdd('0x1f')][_0x0cdd('0x21')]);return _0x4f8fa1(_0x3ab88f['error'][_0x0cdd('0x21')]);}else{logger[_0x0cdd('0x1a')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2284e7,_0x0cdd('0x1c'));_0x4f8fa1(_0x3ab88f['result'][_0x0cdd('0x21')]);}})[_0x0cdd('0x22')](function(_0x58d1fe){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x2284e7,_0x58d1fe);_0x508417(_0x58d1fe);});});}function respondWithStatusCode(_0xc9be3,_0x136c06){_0x136c06=_0x136c06||0xcc;return function(_0x502378){if(_0x502378){return _0xc9be3['sendStatus'](_0x136c06);}return _0xc9be3[_0x0cdd('0x23')](_0x136c06)['end']();};}function respondWithResult(_0x3ebee4,_0x14b1fb){_0x14b1fb=_0x14b1fb||0xc8;return function(_0x877d08){if(_0x877d08){return _0x3ebee4[_0x0cdd('0x23')](_0x14b1fb)[_0x0cdd('0x24')](_0x877d08);}};}function respondWithFilteredResult(_0x23bc6b,_0xd3ada4){return function(_0x4ac856){if(_0x4ac856){var _0x21dfbb=_0x4ac856[_0x0cdd('0x25')],_0x2ec0ec=_0xd3ada4['offset'],_0x4d9075=_0xd3ada4[_0x0cdd('0x26')]+_0xd3ada4[_0x0cdd('0x27')],_0x4ddfb4;if(_0x4d9075>=_0x21dfbb){_0x4d9075=_0x21dfbb;_0x4ddfb4=0xc8;}else{_0x4ddfb4=0xce;}_0x23bc6b[_0x0cdd('0x23')](_0x4ddfb4);return _0x23bc6b[_0x0cdd('0x28')](_0x0cdd('0x29'),_0x2ec0ec+'-'+_0x4d9075+'/'+_0x21dfbb)['json'](_0x4ac856);}return null;};}function patchUpdates(_0x5770f2){return function(_0x5860aa){try{jsonpatch[_0x0cdd('0x2a')](_0x5860aa,_0x5770f2,!![]);}catch(_0x1ec45f){return BPromise[_0x0cdd('0x2b')](_0x1ec45f);}return _0x5860aa['save']();};}function saveUpdates(_0x457279,_0x11cf6d){return function(_0x1ebf00){if(_0x1ebf00){return _0x1ebf00[_0x0cdd('0x2c')](_0x457279)['then'](function(_0x4d1904){return _0x4d1904;});}return null;};}function removeEntity(_0x587a9d,_0x39a86d){return function(_0x39e2fd){if(_0x39e2fd){return _0x39e2fd['destroy']()['then'](function(){_0x587a9d[_0x0cdd('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f8bf9,_0x48fcfd){return function(_0x513b3d){if(!_0x513b3d){_0x2f8bf9['sendStatus'](0x194);}return _0x513b3d;};}function handleError(_0x515c7c,_0x151ebb){_0x151ebb=_0x151ebb||0x1f4;return function(_0x4bd79b){logger['error'](_0x4bd79b[_0x0cdd('0x2d')]);if(_0x4bd79b[_0x0cdd('0x2e')]){delete _0x4bd79b[_0x0cdd('0x2e')];}_0x515c7c[_0x0cdd('0x23')](_0x151ebb)['send'](_0x4bd79b);};}exports[_0x0cdd('0x2f')]=function(_0x1daabc,_0x395b4d){var _0x39fa25={},_0x25baf8={},_0x40dd3d={'count':0x0,'rows':[]};var _0x16fcb6=db[_0x0cdd('0x30')][_0x0cdd('0x31')];_0x25baf8[_0x0cdd('0x32')]=_[_0x0cdd('0x33')](_0x16fcb6);_0x25baf8[_0x0cdd('0x34')]=_[_0x0cdd('0x33')](_0x1daabc['query']);_0x25baf8[_0x0cdd('0x35')]=_[_0x0cdd('0x36')](_0x25baf8[_0x0cdd('0x32')],_0x25baf8[_0x0cdd('0x34')]);_0x39fa25['attributes']=_[_0x0cdd('0x36')](_0x25baf8[_0x0cdd('0x32')],qs['fields'](_0x1daabc[_0x0cdd('0x34')]['fields']));_0x39fa25[_0x0cdd('0x37')]=_0x39fa25['attributes'][_0x0cdd('0x38')]?_0x39fa25[_0x0cdd('0x37')]:_0x25baf8[_0x0cdd('0x32')];if(!_0x1daabc[_0x0cdd('0x34')][_0x0cdd('0x39')](_0x0cdd('0x3a'))){_0x39fa25[_0x0cdd('0x27')]=qs[_0x0cdd('0x27')](_0x1daabc['query'][_0x0cdd('0x27')]);_0x39fa25['offset']=qs['offset'](_0x1daabc[_0x0cdd('0x34')][_0x0cdd('0x26')]);}_0x39fa25[_0x0cdd('0x3b')]=qs[_0x0cdd('0x3c')](_0x1daabc['query'][_0x0cdd('0x3c')]);_0x39fa25[_0x0cdd('0x3d')]=qs[_0x0cdd('0x35')](_[_0x0cdd('0x3e')](_0x1daabc[_0x0cdd('0x34')],_0x25baf8[_0x0cdd('0x35')]));if(_0x1daabc[_0x0cdd('0x34')][_0x0cdd('0x3f')]){_0x39fa25[_0x0cdd('0x3d')]=_[_0x0cdd('0x40')](_0x39fa25[_0x0cdd('0x3d')],{'$or':_['map'](_0x16fcb6,function(_0x1888c4){if(_0x1888c4['type']['key']!=='VIRTUAL'){var _0x2cf068={};_0x2cf068[_0x1888c4[_0x0cdd('0x41')]]={'$like':'%'+_0x1daabc['query'][_0x0cdd('0x3f')]+'%'};return _0x2cf068;}})});}_0x39fa25=_['merge']({},_0x39fa25,_0x1daabc[_0x0cdd('0x42')]);var _0x3033d5={'where':_0x39fa25[_0x0cdd('0x3d')]};return db['ServicenowConfiguration'][_0x0cdd('0x25')](_0x3033d5)[_0x0cdd('0x43')](function(_0x3fe6c8){_0x40dd3d[_0x0cdd('0x25')]=_0x3fe6c8;if(_0x1daabc['query'][_0x0cdd('0x44')]){_0x39fa25['include']=[{'all':!![]}];}return db[_0x0cdd('0x30')]['findAll'](_0x39fa25);})[_0x0cdd('0x43')](function(_0x27b9f7){_0x40dd3d[_0x0cdd('0x45')]=_0x27b9f7;return _0x40dd3d;})['then'](respondWithFilteredResult(_0x395b4d,_0x39fa25))['catch'](handleError(_0x395b4d,null));};exports['show']=function(_0x3748e0,_0x2ccf90){var _0x496b90={'raw':![],'where':{'id':_0x3748e0['params']['id']}},_0x12676e={};_0x12676e['model']=_[_0x0cdd('0x33')](db['ServicenowConfiguration'][_0x0cdd('0x31')]);_0x12676e[_0x0cdd('0x34')]=_[_0x0cdd('0x33')](_0x3748e0[_0x0cdd('0x34')]);_0x12676e[_0x0cdd('0x35')]=_[_0x0cdd('0x36')](_0x12676e[_0x0cdd('0x32')],_0x12676e['query']);_0x496b90[_0x0cdd('0x37')]=_['intersection'](_0x12676e[_0x0cdd('0x32')],qs['fields'](_0x3748e0[_0x0cdd('0x34')][_0x0cdd('0x46')]));_0x496b90[_0x0cdd('0x37')]=_0x496b90[_0x0cdd('0x37')][_0x0cdd('0x38')]?_0x496b90[_0x0cdd('0x37')]:_0x12676e[_0x0cdd('0x32')];if(_0x3748e0[_0x0cdd('0x34')][_0x0cdd('0x44')]){_0x496b90[_0x0cdd('0x47')]=[{'all':!![]}];}_0x496b90=_[_0x0cdd('0x40')]({},_0x496b90,_0x3748e0[_0x0cdd('0x42')]);return db[_0x0cdd('0x30')][_0x0cdd('0x48')](_0x496b90)[_0x0cdd('0x43')](handleEntityNotFound(_0x2ccf90,null))[_0x0cdd('0x43')](respondWithResult(_0x2ccf90,null))['catch'](handleError(_0x2ccf90,null));};exports[_0x0cdd('0x49')]=function(_0x10d09a,_0x554411){return db[_0x0cdd('0x30')][_0x0cdd('0x49')](_0x10d09a['body'],{})[_0x0cdd('0x43')](respondWithResult(_0x554411,0xc9))[_0x0cdd('0x22')](handleError(_0x554411,null));};exports[_0x0cdd('0x2c')]=function(_0x30d54e,_0x3b0167){if(_0x30d54e[_0x0cdd('0x4a')]['id']){delete _0x30d54e[_0x0cdd('0x4a')]['id'];}return db[_0x0cdd('0x30')][_0x0cdd('0x48')]({'where':{'id':_0x30d54e['params']['id']}})[_0x0cdd('0x43')](handleEntityNotFound(_0x3b0167,null))[_0x0cdd('0x43')](saveUpdates(_0x30d54e[_0x0cdd('0x4a')],null))[_0x0cdd('0x43')](respondWithResult(_0x3b0167,null))[_0x0cdd('0x22')](handleError(_0x3b0167,null));};exports[_0x0cdd('0x4b')]=function(_0x46a981,_0x148119){return db[_0x0cdd('0x30')][_0x0cdd('0x48')]({'where':{'id':_0x46a981[_0x0cdd('0x4c')]['id']}})[_0x0cdd('0x43')](handleEntityNotFound(_0x148119,null))[_0x0cdd('0x43')](removeEntity(_0x148119,null))[_0x0cdd('0x22')](handleError(_0x148119,null));};exports[_0x0cdd('0x4d')]=function(_0x73ceb1,_0x403436,_0x534a01){var _0x2ccd66={};var _0x3c513a={};var _0xe7b938;var _0x279c1e;return db[_0x0cdd('0x30')]['findOne']({'where':{'id':_0x73ceb1[_0x0cdd('0x4c')]['id']}})[_0x0cdd('0x43')](handleEntityNotFound(_0x403436,null))[_0x0cdd('0x43')](function(_0x5b4e0a){if(_0x5b4e0a){_0xe7b938=_0x5b4e0a;_0x3c513a['model']=_['keys'](db[_0x0cdd('0x4e')][_0x0cdd('0x31')]);_0x3c513a[_0x0cdd('0x34')]=_['keys'](_0x73ceb1[_0x0cdd('0x34')]);_0x3c513a[_0x0cdd('0x35')]=_['intersection'](_0x3c513a[_0x0cdd('0x32')],_0x3c513a[_0x0cdd('0x34')]);_0x2ccd66[_0x0cdd('0x37')]=_[_0x0cdd('0x36')](_0x3c513a[_0x0cdd('0x32')],qs['fields'](_0x73ceb1[_0x0cdd('0x34')][_0x0cdd('0x46')]));_0x2ccd66['attributes']=_0x2ccd66[_0x0cdd('0x37')][_0x0cdd('0x38')]?_0x2ccd66[_0x0cdd('0x37')]:_0x3c513a[_0x0cdd('0x32')];_0x2ccd66[_0x0cdd('0x3b')]=qs['sort'](_0x73ceb1[_0x0cdd('0x34')][_0x0cdd('0x3c')]);_0x2ccd66[_0x0cdd('0x3d')]=qs[_0x0cdd('0x35')](_[_0x0cdd('0x3e')](_0x73ceb1[_0x0cdd('0x34')],_0x3c513a[_0x0cdd('0x35')]));if(_0x73ceb1['query'][_0x0cdd('0x3f')]){_0x2ccd66[_0x0cdd('0x3d')]=_[_0x0cdd('0x40')](_0x2ccd66[_0x0cdd('0x3d')],{'$or':_['map'](_0x2ccd66['attributes'],function(_0x6ad9f8){var _0x3d0db1={};_0x3d0db1[_0x6ad9f8]={'$like':'%'+_0x73ceb1['query'][_0x0cdd('0x3f')]+'%'};return _0x3d0db1;})});}_0x2ccd66=_[_0x0cdd('0x40')]({},_0x2ccd66,_0x73ceb1['options']);return _0xe7b938[_0x0cdd('0x4d')](_0x2ccd66);}})[_0x0cdd('0x43')](function(_0x5d87a5){if(_0x5d87a5){_0x279c1e=_0x5d87a5[_0x0cdd('0x38')];if(!_0x73ceb1['query'][_0x0cdd('0x39')](_0x0cdd('0x3a'))){_0x2ccd66[_0x0cdd('0x27')]=qs[_0x0cdd('0x27')](_0x73ceb1[_0x0cdd('0x34')][_0x0cdd('0x27')]);_0x2ccd66['offset']=qs[_0x0cdd('0x26')](_0x73ceb1['query'][_0x0cdd('0x26')]);}return _0xe7b938[_0x0cdd('0x4d')](_0x2ccd66);}})[_0x0cdd('0x43')](function(_0x239c0c){if(_0x239c0c){return _0x239c0c?{'count':_0x279c1e,'rows':_0x239c0c}:null;}})[_0x0cdd('0x43')](respondWithResult(_0x403436,null))[_0x0cdd('0x22')](handleError(_0x403436,null));};exports[_0x0cdd('0x4f')]=function(_0x2118fa,_0x1f3a2c,_0x56e238){var _0x4e4f34={};var _0x171315={};var _0x4dccb1;var _0x412699;return db[_0x0cdd('0x30')][_0x0cdd('0x50')]({'where':{'id':_0x2118fa['params']['id']}})[_0x0cdd('0x43')](handleEntityNotFound(_0x1f3a2c,null))[_0x0cdd('0x43')](function(_0x56534a){if(_0x56534a){_0x4dccb1=_0x56534a;_0x171315[_0x0cdd('0x32')]=_[_0x0cdd('0x33')](db[_0x0cdd('0x4e')]['rawAttributes']);_0x171315[_0x0cdd('0x34')]=_[_0x0cdd('0x33')](_0x2118fa['query']);_0x171315['filters']=_[_0x0cdd('0x36')](_0x171315[_0x0cdd('0x32')],_0x171315[_0x0cdd('0x34')]);_0x4e4f34[_0x0cdd('0x37')]=_[_0x0cdd('0x36')](_0x171315[_0x0cdd('0x32')],qs[_0x0cdd('0x46')](_0x2118fa[_0x0cdd('0x34')]['fields']));_0x4e4f34['attributes']=_0x4e4f34[_0x0cdd('0x37')][_0x0cdd('0x38')]?_0x4e4f34[_0x0cdd('0x37')]:_0x171315['model'];_0x4e4f34[_0x0cdd('0x3b')]=qs[_0x0cdd('0x3c')](_0x2118fa[_0x0cdd('0x34')][_0x0cdd('0x3c')]);_0x4e4f34[_0x0cdd('0x3d')]=qs[_0x0cdd('0x35')](_[_0x0cdd('0x3e')](_0x2118fa['query'],_0x171315[_0x0cdd('0x35')]));if(_0x2118fa[_0x0cdd('0x34')][_0x0cdd('0x3f')]){_0x4e4f34[_0x0cdd('0x3d')]=_[_0x0cdd('0x40')](_0x4e4f34[_0x0cdd('0x3d')],{'$or':_[_0x0cdd('0x51')](_0x4e4f34[_0x0cdd('0x37')],function(_0x15d13a){var _0x6c364b={};_0x6c364b[_0x15d13a]={'$like':'%'+_0x2118fa[_0x0cdd('0x34')][_0x0cdd('0x3f')]+'%'};return _0x6c364b;})});}_0x4e4f34=_[_0x0cdd('0x40')]({},_0x4e4f34,_0x2118fa[_0x0cdd('0x42')]);return _0x4dccb1[_0x0cdd('0x4f')](_0x4e4f34);}})[_0x0cdd('0x43')](function(_0x54627a){if(_0x54627a){_0x412699=_0x54627a['length'];if(!_0x2118fa[_0x0cdd('0x34')][_0x0cdd('0x39')](_0x0cdd('0x3a'))){_0x4e4f34['limit']=qs[_0x0cdd('0x27')](_0x2118fa[_0x0cdd('0x34')][_0x0cdd('0x27')]);_0x4e4f34['offset']=qs[_0x0cdd('0x26')](_0x2118fa[_0x0cdd('0x34')][_0x0cdd('0x26')]);}return _0x4dccb1[_0x0cdd('0x4f')](_0x4e4f34);}})[_0x0cdd('0x43')](function(_0x14689b){if(_0x14689b){return _0x14689b?{'count':_0x412699,'rows':_0x14689b}:null;}})[_0x0cdd('0x43')](respondWithResult(_0x1f3a2c,null))[_0x0cdd('0x22')](handleError(_0x1f3a2c,null));};exports[_0x0cdd('0x52')]=function(_0x200243,_0x34f5cf,_0x2f3e80){var _0x2026f1={};var _0x407fdd={};var _0x14eb1c;var _0x188e5f;return db[_0x0cdd('0x30')][_0x0cdd('0x50')]({'where':{'id':_0x200243[_0x0cdd('0x4c')]['id']}})['then'](handleEntityNotFound(_0x34f5cf,null))['then'](function(_0x4e5a48){if(_0x4e5a48){_0x14eb1c=_0x4e5a48;_0x407fdd[_0x0cdd('0x32')]=_[_0x0cdd('0x33')](db[_0x0cdd('0x4e')][_0x0cdd('0x31')]);_0x407fdd[_0x0cdd('0x34')]=_[_0x0cdd('0x33')](_0x200243[_0x0cdd('0x34')]);_0x407fdd[_0x0cdd('0x35')]=_[_0x0cdd('0x36')](_0x407fdd[_0x0cdd('0x32')],_0x407fdd['query']);_0x2026f1[_0x0cdd('0x37')]=_[_0x0cdd('0x36')](_0x407fdd['model'],qs[_0x0cdd('0x46')](_0x200243['query'][_0x0cdd('0x46')]));_0x2026f1[_0x0cdd('0x37')]=_0x2026f1[_0x0cdd('0x37')]['length']?_0x2026f1[_0x0cdd('0x37')]:_0x407fdd[_0x0cdd('0x32')];_0x2026f1['order']=qs[_0x0cdd('0x3c')](_0x200243[_0x0cdd('0x34')][_0x0cdd('0x3c')]);_0x2026f1['where']=qs['filters'](_[_0x0cdd('0x3e')](_0x200243[_0x0cdd('0x34')],_0x407fdd[_0x0cdd('0x35')]));if(_0x200243['query'][_0x0cdd('0x3f')]){_0x2026f1[_0x0cdd('0x3d')]=_[_0x0cdd('0x40')](_0x2026f1[_0x0cdd('0x3d')],{'$or':_['map'](_0x2026f1[_0x0cdd('0x37')],function(_0x249cc9){var _0x2f1acd={};_0x2f1acd[_0x249cc9]={'$like':'%'+_0x200243[_0x0cdd('0x34')][_0x0cdd('0x3f')]+'%'};return _0x2f1acd;})});}_0x2026f1=_['merge']({},_0x2026f1,_0x200243['options']);return _0x14eb1c[_0x0cdd('0x52')](_0x2026f1);}})[_0x0cdd('0x43')](function(_0x357bde){if(_0x357bde){_0x188e5f=_0x357bde[_0x0cdd('0x38')];if(!_0x200243[_0x0cdd('0x34')]['hasOwnProperty']('nolimit')){_0x2026f1[_0x0cdd('0x27')]=qs[_0x0cdd('0x27')](_0x200243[_0x0cdd('0x34')][_0x0cdd('0x27')]);_0x2026f1['offset']=qs[_0x0cdd('0x26')](_0x200243[_0x0cdd('0x34')]['offset']);}return _0x14eb1c[_0x0cdd('0x52')](_0x2026f1);}})['then'](function(_0x1593e3){if(_0x1593e3){return _0x1593e3?{'count':_0x188e5f,'rows':_0x1593e3}:null;}})[_0x0cdd('0x43')](respondWithResult(_0x34f5cf,null))['catch'](handleError(_0x34f5cf,null));}; \ No newline at end of file +var _0x6ce8=['message','request\x20sent','result','catch','sendStatus','status','end','offset','limit','set','Content-Range','json','reject','destroy','name','send','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','map','field','merge','options','ServicenowConfiguration','count','includeAll','include','show','find','create','body','update','params','getFields','findOne','pick','filter','getSubjects','ServicenowField','getDescriptions','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xee5d2a,_0x534134){var _0x346948=function(_0x458fdf){while(--_0x458fdf){_0xee5d2a['push'](_0xee5d2a['shift']());}};_0x346948(++_0x534134);}(_0x6ce8,0x13e));var _0x86ce=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x6ce8[_0x13b02f];return _0x12e9a6;};'use strict';var pdf=require(_0x86ce('0x0'));var emlformat=require('eml-format');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('bluebird');var Mustache=require(_0x86ce('0x5'));var util=require(_0x86ce('0x6'));var path=require(_0x86ce('0x7'));var sox=require(_0x86ce('0x8'));var csv=require(_0x86ce('0x9'));var ejs=require(_0x86ce('0xa'));var fs=require('fs');var _=require(_0x86ce('0xb'));var squel=require(_0x86ce('0xc'));var crypto=require(_0x86ce('0xd'));var jsforce=require(_0x86ce('0xe'));var deskjs=require(_0x86ce('0xf'));var toCsv=require('to-csv');var querystring=require(_0x86ce('0x10'));var Papa=require(_0x86ce('0x11'));var Redis=require(_0x86ce('0x12'));var authService=require(_0x86ce('0x13'));var qs=require(_0x86ce('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x86ce('0x15'))(_0x86ce('0x16'));var utils=require('../../config/utils');var config=require(_0x86ce('0x17'));var db=require(_0x86ce('0x18'))['db'];var jayson=require(_0x86ce('0x19'));var client=jayson[_0x86ce('0x1a')][_0x86ce('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x8d9f9f,_0x430751,_0x591d77){if(_0x591d77){var _0x3523c3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3523c3[_0x86ce('0x1c')](_0x430751)){return _0x8d9f9f;}else{throw new Error(_0x86ce('0x1d'));}}else{return _0x8d9f9f;}}function respondWithRpcPromise(_0x83c250,_0x3c76a9,_0x26e5a2,_0x4c97a3){return new BPromise(function(_0x3a271c,_0x35e4b5){var _0x42446e=_0x4c97a3||client;return _0x42446e[_0x86ce('0x1e')](_0x83c250,_0x26e5a2)[_0x86ce('0x1f')](function(_0x3aa7c7){logger['info'](_0x86ce('0x20'),_0x3c76a9,'request\x20sent');logger[_0x86ce('0x21')](_0x86ce('0x22'),_0x3c76a9,'request\x20sent',JSON[_0x86ce('0x23')](_0x3aa7c7));if(_0x3aa7c7[_0x86ce('0x24')]){if(_0x3aa7c7['error'][_0x86ce('0x25')]===0x1f4){logger[_0x86ce('0x24')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3c76a9,_0x3aa7c7[_0x86ce('0x24')]['message']);return _0x35e4b5(_0x3aa7c7[_0x86ce('0x24')]['message']);}logger[_0x86ce('0x24')](_0x86ce('0x20'),_0x3c76a9,_0x3aa7c7['error'][_0x86ce('0x26')]);return _0x3a271c(_0x3aa7c7['error'][_0x86ce('0x26')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x3c76a9,_0x86ce('0x27'));_0x3a271c(_0x3aa7c7[_0x86ce('0x28')][_0x86ce('0x26')]);}})[_0x86ce('0x29')](function(_0x23d386){logger[_0x86ce('0x24')](_0x86ce('0x20'),_0x3c76a9,_0x23d386);_0x35e4b5(_0x23d386);});});}function respondWithStatusCode(_0x429b0d,_0x3a9664){_0x3a9664=_0x3a9664||0xcc;return function(_0x597be5){if(_0x597be5){return _0x429b0d[_0x86ce('0x2a')](_0x3a9664);}return _0x429b0d[_0x86ce('0x2b')](_0x3a9664)[_0x86ce('0x2c')]();};}function respondWithResult(_0x539191,_0x2a9c43){_0x2a9c43=_0x2a9c43||0xc8;return function(_0x4f4060){if(_0x4f4060){return _0x539191['status'](_0x2a9c43)['json'](_0x4f4060);}};}function respondWithFilteredResult(_0x1c2f18,_0x40dfde){return function(_0x7ea6bb){if(_0x7ea6bb){var _0x72b3ea=_0x7ea6bb['count'],_0x2e2ed9=_0x40dfde[_0x86ce('0x2d')],_0x5d3dea=_0x40dfde['offset']+_0x40dfde[_0x86ce('0x2e')],_0x4e775d;if(_0x5d3dea>=_0x72b3ea){_0x5d3dea=_0x72b3ea;_0x4e775d=0xc8;}else{_0x4e775d=0xce;}_0x1c2f18[_0x86ce('0x2b')](_0x4e775d);return _0x1c2f18[_0x86ce('0x2f')](_0x86ce('0x30'),_0x2e2ed9+'-'+_0x5d3dea+'/'+_0x72b3ea)[_0x86ce('0x31')](_0x7ea6bb);}return null;};}function patchUpdates(_0x583aff){return function(_0x187225){try{jsonpatch['apply'](_0x187225,_0x583aff,!![]);}catch(_0x2a03de){return BPromise[_0x86ce('0x32')](_0x2a03de);}return _0x187225['save']();};}function saveUpdates(_0x34e8ab,_0x4bc672){return function(_0x335a25){if(_0x335a25){return _0x335a25['update'](_0x34e8ab)[_0x86ce('0x1f')](function(_0x1ade52){return _0x1ade52;});}return null;};}function removeEntity(_0x5043e3,_0x452c9a){return function(_0x244262){if(_0x244262){return _0x244262[_0x86ce('0x33')]()[_0x86ce('0x1f')](function(){_0x5043e3[_0x86ce('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x68b0e5,_0x46d243){return function(_0x45aeb0){if(!_0x45aeb0){_0x68b0e5[_0x86ce('0x2a')](0x194);}return _0x45aeb0;};}function handleError(_0x2c2968,_0x160c88){_0x160c88=_0x160c88||0x1f4;return function(_0x2aebbe){logger['error'](_0x2aebbe['stack']);if(_0x2aebbe[_0x86ce('0x34')]){delete _0x2aebbe[_0x86ce('0x34')];}_0x2c2968[_0x86ce('0x2b')](_0x160c88)[_0x86ce('0x35')](_0x2aebbe);};}exports['index']=function(_0x538eb9,_0x1a0bf1){var _0x471a29={},_0x36c0b4={},_0x2716f9={'count':0x0,'rows':[]};var _0x4dd4b1=db['ServicenowConfiguration'][_0x86ce('0x36')];_0x36c0b4[_0x86ce('0x37')]=_['keys'](_0x4dd4b1);_0x36c0b4[_0x86ce('0x38')]=_[_0x86ce('0x39')](_0x538eb9[_0x86ce('0x38')]);_0x36c0b4[_0x86ce('0x3a')]=_[_0x86ce('0x3b')](_0x36c0b4['model'],_0x36c0b4['query']);_0x471a29[_0x86ce('0x3c')]=_[_0x86ce('0x3b')](_0x36c0b4['model'],qs['fields'](_0x538eb9[_0x86ce('0x38')][_0x86ce('0x3d')]));_0x471a29[_0x86ce('0x3c')]=_0x471a29['attributes'][_0x86ce('0x3e')]?_0x471a29[_0x86ce('0x3c')]:_0x36c0b4[_0x86ce('0x37')];if(!_0x538eb9[_0x86ce('0x38')][_0x86ce('0x3f')](_0x86ce('0x40'))){_0x471a29[_0x86ce('0x2e')]=qs['limit'](_0x538eb9['query']['limit']);_0x471a29['offset']=qs[_0x86ce('0x2d')](_0x538eb9['query'][_0x86ce('0x2d')]);}_0x471a29[_0x86ce('0x41')]=qs[_0x86ce('0x42')](_0x538eb9[_0x86ce('0x38')][_0x86ce('0x42')]);_0x471a29['where']=qs[_0x86ce('0x3a')](_['pick'](_0x538eb9['query'],_0x36c0b4[_0x86ce('0x3a')]));if(_0x538eb9['query']['filter']){_0x471a29[_0x86ce('0x43')]=_['merge'](_0x471a29['where'],{'$or':_[_0x86ce('0x44')](_0x4dd4b1,function(_0x111bed){if(_0x111bed['type']['key']!=='VIRTUAL'){var _0x506824={};_0x506824[_0x111bed[_0x86ce('0x45')]]={'$like':'%'+_0x538eb9[_0x86ce('0x38')]['filter']+'%'};return _0x506824;}})});}_0x471a29=_[_0x86ce('0x46')]({},_0x471a29,_0x538eb9[_0x86ce('0x47')]);var _0xd14bb5={'where':_0x471a29[_0x86ce('0x43')]};return db[_0x86ce('0x48')][_0x86ce('0x49')](_0xd14bb5)[_0x86ce('0x1f')](function(_0x4fe9a8){_0x2716f9['count']=_0x4fe9a8;if(_0x538eb9['query'][_0x86ce('0x4a')]){_0x471a29[_0x86ce('0x4b')]=[{'all':!![]}];}return db['ServicenowConfiguration']['findAll'](_0x471a29);})[_0x86ce('0x1f')](function(_0x45f3e5){_0x2716f9['rows']=_0x45f3e5;return _0x2716f9;})['then'](respondWithFilteredResult(_0x1a0bf1,_0x471a29))[_0x86ce('0x29')](handleError(_0x1a0bf1,null));};exports[_0x86ce('0x4c')]=function(_0x5411bf,_0x3f939e){var _0x141b0e={'raw':![],'where':{'id':_0x5411bf['params']['id']}},_0x3b23ae={};_0x3b23ae[_0x86ce('0x37')]=_['keys'](db[_0x86ce('0x48')][_0x86ce('0x36')]);_0x3b23ae[_0x86ce('0x38')]=_[_0x86ce('0x39')](_0x5411bf['query']);_0x3b23ae['filters']=_[_0x86ce('0x3b')](_0x3b23ae[_0x86ce('0x37')],_0x3b23ae['query']);_0x141b0e[_0x86ce('0x3c')]=_['intersection'](_0x3b23ae['model'],qs[_0x86ce('0x3d')](_0x5411bf[_0x86ce('0x38')][_0x86ce('0x3d')]));_0x141b0e[_0x86ce('0x3c')]=_0x141b0e[_0x86ce('0x3c')][_0x86ce('0x3e')]?_0x141b0e['attributes']:_0x3b23ae[_0x86ce('0x37')];if(_0x5411bf[_0x86ce('0x38')][_0x86ce('0x4a')]){_0x141b0e['include']=[{'all':!![]}];}_0x141b0e=_[_0x86ce('0x46')]({},_0x141b0e,_0x5411bf[_0x86ce('0x47')]);return db['ServicenowConfiguration'][_0x86ce('0x4d')](_0x141b0e)['then'](handleEntityNotFound(_0x3f939e,null))[_0x86ce('0x1f')](respondWithResult(_0x3f939e,null))[_0x86ce('0x29')](handleError(_0x3f939e,null));};exports[_0x86ce('0x4e')]=function(_0x734340,_0x23ee83){return db[_0x86ce('0x48')][_0x86ce('0x4e')](_0x734340[_0x86ce('0x4f')],{})['then'](respondWithResult(_0x23ee83,0xc9))[_0x86ce('0x29')](handleError(_0x23ee83,null));};exports[_0x86ce('0x50')]=function(_0x4cf26d,_0x7d2be1){if(_0x4cf26d[_0x86ce('0x4f')]['id']){delete _0x4cf26d[_0x86ce('0x4f')]['id'];}return db[_0x86ce('0x48')]['find']({'where':{'id':_0x4cf26d[_0x86ce('0x51')]['id']}})[_0x86ce('0x1f')](handleEntityNotFound(_0x7d2be1,null))[_0x86ce('0x1f')](saveUpdates(_0x4cf26d['body'],null))[_0x86ce('0x1f')](respondWithResult(_0x7d2be1,null))[_0x86ce('0x29')](handleError(_0x7d2be1,null));};exports[_0x86ce('0x33')]=function(_0x43d4ca,_0xc7f037){return db[_0x86ce('0x48')][_0x86ce('0x4d')]({'where':{'id':_0x43d4ca[_0x86ce('0x51')]['id']}})[_0x86ce('0x1f')](handleEntityNotFound(_0xc7f037,null))['then'](removeEntity(_0xc7f037,null))[_0x86ce('0x29')](handleError(_0xc7f037,null));};exports[_0x86ce('0x52')]=function(_0x5464f8,_0x3d407a,_0x283fa3){var _0x4e6baa={};var _0xb37782={};var _0x51cec8;var _0x2b2545;return db[_0x86ce('0x48')][_0x86ce('0x53')]({'where':{'id':_0x5464f8[_0x86ce('0x51')]['id']}})['then'](handleEntityNotFound(_0x3d407a,null))[_0x86ce('0x1f')](function(_0x34b1e1){if(_0x34b1e1){_0x51cec8=_0x34b1e1;_0xb37782[_0x86ce('0x37')]=_[_0x86ce('0x39')](db['ServicenowField'][_0x86ce('0x36')]);_0xb37782[_0x86ce('0x38')]=_[_0x86ce('0x39')](_0x5464f8['query']);_0xb37782['filters']=_[_0x86ce('0x3b')](_0xb37782[_0x86ce('0x37')],_0xb37782[_0x86ce('0x38')]);_0x4e6baa[_0x86ce('0x3c')]=_[_0x86ce('0x3b')](_0xb37782['model'],qs[_0x86ce('0x3d')](_0x5464f8[_0x86ce('0x38')][_0x86ce('0x3d')]));_0x4e6baa[_0x86ce('0x3c')]=_0x4e6baa[_0x86ce('0x3c')][_0x86ce('0x3e')]?_0x4e6baa[_0x86ce('0x3c')]:_0xb37782[_0x86ce('0x37')];_0x4e6baa['order']=qs[_0x86ce('0x42')](_0x5464f8[_0x86ce('0x38')]['sort']);_0x4e6baa[_0x86ce('0x43')]=qs[_0x86ce('0x3a')](_[_0x86ce('0x54')](_0x5464f8['query'],_0xb37782['filters']));if(_0x5464f8['query']['filter']){_0x4e6baa[_0x86ce('0x43')]=_[_0x86ce('0x46')](_0x4e6baa[_0x86ce('0x43')],{'$or':_[_0x86ce('0x44')](_0x4e6baa[_0x86ce('0x3c')],function(_0x36c4c2){var _0x3ffaaf={};_0x3ffaaf[_0x36c4c2]={'$like':'%'+_0x5464f8[_0x86ce('0x38')][_0x86ce('0x55')]+'%'};return _0x3ffaaf;})});}_0x4e6baa=_['merge']({},_0x4e6baa,_0x5464f8[_0x86ce('0x47')]);return _0x51cec8[_0x86ce('0x52')](_0x4e6baa);}})['then'](function(_0x221863){if(_0x221863){_0x2b2545=_0x221863[_0x86ce('0x3e')];if(!_0x5464f8['query'][_0x86ce('0x3f')]('nolimit')){_0x4e6baa['limit']=qs[_0x86ce('0x2e')](_0x5464f8[_0x86ce('0x38')][_0x86ce('0x2e')]);_0x4e6baa[_0x86ce('0x2d')]=qs[_0x86ce('0x2d')](_0x5464f8[_0x86ce('0x38')][_0x86ce('0x2d')]);}return _0x51cec8[_0x86ce('0x52')](_0x4e6baa);}})[_0x86ce('0x1f')](function(_0x481ab6){if(_0x481ab6){return _0x481ab6?{'count':_0x2b2545,'rows':_0x481ab6}:null;}})[_0x86ce('0x1f')](respondWithResult(_0x3d407a,null))['catch'](handleError(_0x3d407a,null));};exports[_0x86ce('0x56')]=function(_0x3c980d,_0x14dbf5,_0x5124d8){var _0x33ae44={};var _0x287122={};var _0x5b979f;var _0x7f1292;return db['ServicenowConfiguration'][_0x86ce('0x53')]({'where':{'id':_0x3c980d[_0x86ce('0x51')]['id']}})[_0x86ce('0x1f')](handleEntityNotFound(_0x14dbf5,null))[_0x86ce('0x1f')](function(_0x59e78d){if(_0x59e78d){_0x5b979f=_0x59e78d;_0x287122['model']=_[_0x86ce('0x39')](db[_0x86ce('0x57')][_0x86ce('0x36')]);_0x287122['query']=_[_0x86ce('0x39')](_0x3c980d[_0x86ce('0x38')]);_0x287122[_0x86ce('0x3a')]=_[_0x86ce('0x3b')](_0x287122[_0x86ce('0x37')],_0x287122[_0x86ce('0x38')]);_0x33ae44['attributes']=_[_0x86ce('0x3b')](_0x287122[_0x86ce('0x37')],qs[_0x86ce('0x3d')](_0x3c980d[_0x86ce('0x38')][_0x86ce('0x3d')]));_0x33ae44[_0x86ce('0x3c')]=_0x33ae44[_0x86ce('0x3c')][_0x86ce('0x3e')]?_0x33ae44[_0x86ce('0x3c')]:_0x287122[_0x86ce('0x37')];_0x33ae44[_0x86ce('0x41')]=qs[_0x86ce('0x42')](_0x3c980d['query'][_0x86ce('0x42')]);_0x33ae44[_0x86ce('0x43')]=qs[_0x86ce('0x3a')](_[_0x86ce('0x54')](_0x3c980d[_0x86ce('0x38')],_0x287122['filters']));if(_0x3c980d['query'][_0x86ce('0x55')]){_0x33ae44['where']=_[_0x86ce('0x46')](_0x33ae44['where'],{'$or':_['map'](_0x33ae44['attributes'],function(_0x17b4c8){var _0x548ff7={};_0x548ff7[_0x17b4c8]={'$like':'%'+_0x3c980d[_0x86ce('0x38')][_0x86ce('0x55')]+'%'};return _0x548ff7;})});}_0x33ae44=_[_0x86ce('0x46')]({},_0x33ae44,_0x3c980d['options']);return _0x5b979f[_0x86ce('0x56')](_0x33ae44);}})['then'](function(_0x5d097e){if(_0x5d097e){_0x7f1292=_0x5d097e[_0x86ce('0x3e')];if(!_0x3c980d['query']['hasOwnProperty'](_0x86ce('0x40'))){_0x33ae44[_0x86ce('0x2e')]=qs[_0x86ce('0x2e')](_0x3c980d[_0x86ce('0x38')]['limit']);_0x33ae44[_0x86ce('0x2d')]=qs[_0x86ce('0x2d')](_0x3c980d[_0x86ce('0x38')][_0x86ce('0x2d')]);}return _0x5b979f[_0x86ce('0x56')](_0x33ae44);}})['then'](function(_0x46dfcf){if(_0x46dfcf){return _0x46dfcf?{'count':_0x7f1292,'rows':_0x46dfcf}:null;}})['then'](respondWithResult(_0x14dbf5,null))[_0x86ce('0x29')](handleError(_0x14dbf5,null));};exports['getDescriptions']=function(_0x3246f3,_0x33e4e5,_0x1829e9){var _0xc966f1={};var _0x152ccb={};var _0x223031;var _0x1e5c2f;return db[_0x86ce('0x48')][_0x86ce('0x53')]({'where':{'id':_0x3246f3[_0x86ce('0x51')]['id']}})[_0x86ce('0x1f')](handleEntityNotFound(_0x33e4e5,null))[_0x86ce('0x1f')](function(_0x81284c){if(_0x81284c){_0x223031=_0x81284c;_0x152ccb[_0x86ce('0x37')]=_[_0x86ce('0x39')](db['ServicenowField'][_0x86ce('0x36')]);_0x152ccb[_0x86ce('0x38')]=_[_0x86ce('0x39')](_0x3246f3[_0x86ce('0x38')]);_0x152ccb[_0x86ce('0x3a')]=_[_0x86ce('0x3b')](_0x152ccb[_0x86ce('0x37')],_0x152ccb['query']);_0xc966f1[_0x86ce('0x3c')]=_['intersection'](_0x152ccb['model'],qs['fields'](_0x3246f3[_0x86ce('0x38')][_0x86ce('0x3d')]));_0xc966f1['attributes']=_0xc966f1[_0x86ce('0x3c')]['length']?_0xc966f1[_0x86ce('0x3c')]:_0x152ccb[_0x86ce('0x37')];_0xc966f1['order']=qs[_0x86ce('0x42')](_0x3246f3[_0x86ce('0x38')][_0x86ce('0x42')]);_0xc966f1['where']=qs[_0x86ce('0x3a')](_[_0x86ce('0x54')](_0x3246f3['query'],_0x152ccb['filters']));if(_0x3246f3[_0x86ce('0x38')][_0x86ce('0x55')]){_0xc966f1[_0x86ce('0x43')]=_[_0x86ce('0x46')](_0xc966f1[_0x86ce('0x43')],{'$or':_[_0x86ce('0x44')](_0xc966f1[_0x86ce('0x3c')],function(_0x2f347f){var _0x5e86b7={};_0x5e86b7[_0x2f347f]={'$like':'%'+_0x3246f3[_0x86ce('0x38')]['filter']+'%'};return _0x5e86b7;})});}_0xc966f1=_[_0x86ce('0x46')]({},_0xc966f1,_0x3246f3[_0x86ce('0x47')]);return _0x223031[_0x86ce('0x58')](_0xc966f1);}})[_0x86ce('0x1f')](function(_0x44a774){if(_0x44a774){_0x1e5c2f=_0x44a774[_0x86ce('0x3e')];if(!_0x3246f3[_0x86ce('0x38')]['hasOwnProperty'](_0x86ce('0x40'))){_0xc966f1[_0x86ce('0x2e')]=qs[_0x86ce('0x2e')](_0x3246f3[_0x86ce('0x38')]['limit']);_0xc966f1['offset']=qs[_0x86ce('0x2d')](_0x3246f3['query'][_0x86ce('0x2d')]);}return _0x223031[_0x86ce('0x58')](_0xc966f1);}})['then'](function(_0x48e39c){if(_0x48e39c){return _0x48e39c?{'count':_0x1e5c2f,'rows':_0x48e39c}:null;}})[_0x86ce('0x1f')](respondWithResult(_0x33e4e5,null))[_0x86ce('0x29')](handleError(_0x33e4e5,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 663a9ad..9ed3d35 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 _0xf58e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intServicenowConfiguration.attributes','int_servicenow_configurations'];(function(_0x5d085e,_0x47382e){var _0x3ac3c5=function(_0x4f51c4){while(--_0x4f51c4){_0x5d085e['push'](_0x5d085e['shift']());}};_0x3ac3c5(++_0x47382e);}(_0xf58e,0xd1));var _0xef58=function(_0x2c8394,_0x29af2c){_0x2c8394=_0x2c8394-0x0;var _0x1206b0=_0xf58e[_0x2c8394];return _0x1206b0;};'use strict';var _=require(_0xef58('0x0'));var util=require(_0xef58('0x1'));var logger=require(_0xef58('0x2'))(_0xef58('0x3'));var moment=require(_0xef58('0x4'));var BPromise=require(_0xef58('0x5'));var rp=require(_0xef58('0x6'));var fs=require('fs');var path=require(_0xef58('0x7'));var rimraf=require('rimraf');var config=require(_0xef58('0x8'));var attributes=require(_0xef58('0x9'));module['exports']=function(_0x3d80c7,_0x1ef752){return _0x3d80c7['define']('ServicenowConfiguration',attributes,{'tableName':_0xef58('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2371=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger','api'];(function(_0x32aa00,_0x53e494){var _0x3ae564=function(_0x1eeb8f){while(--_0x1eeb8f){_0x32aa00['push'](_0x32aa00['shift']());}};_0x3ae564(++_0x53e494);}(_0x2371,0x7b));var _0x1237=function(_0x4001ad,_0x1e22dd){_0x4001ad=_0x4001ad-0x0;var _0x4c7ec2=_0x2371[_0x4001ad];return _0x4c7ec2;};'use strict';var _=require(_0x1237('0x0'));var util=require('util');var logger=require(_0x1237('0x1'))(_0x1237('0x2'));var moment=require(_0x1237('0x3'));var BPromise=require(_0x1237('0x4'));var rp=require(_0x1237('0x5'));var fs=require('fs');var path=require(_0x1237('0x6'));var rimraf=require(_0x1237('0x7'));var config=require(_0x1237('0x8'));var attributes=require(_0x1237('0x9'));module[_0x1237('0xa')]=function(_0x135158,_0x58a108){return _0x135158[_0x1237('0xb')](_0x1237('0xc'),attributes,{'tableName':_0x1237('0xd'),'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 571f03b..1155d05 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 _0xe9eb=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','error','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x3a24e3,_0x54ffa5){var _0x3b9494=function(_0x2863ba){while(--_0x2863ba){_0x3a24e3['push'](_0x3a24e3['shift']());}};_0x3b9494(++_0x54ffa5);}(_0xe9eb,0x95));var _0xbe9e=function(_0x5bd767,_0x3ce53b){_0x5bd767=_0x5bd767-0x0;var _0x258cb1=_0xe9eb[_0x5bd767];return _0x258cb1;};'use strict';var _=require(_0xbe9e('0x0'));var util=require(_0xbe9e('0x1'));var moment=require(_0xbe9e('0x2'));var BPromise=require(_0xbe9e('0x3'));var rs=require(_0xbe9e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbe9e('0x5'));var logger=require(_0xbe9e('0x6'))(_0xbe9e('0x7'));var config=require(_0xbe9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbe9e('0x9')][_0xbe9e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48159f,_0x25b345,_0xaaafc8){return new BPromise(function(_0x5874eb,_0x2ea4e1){return client[_0xbe9e('0xb')](_0x48159f,_0xaaafc8)[_0xbe9e('0xc')](function(_0x12da9a){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x25b345,_0xbe9e('0xd'));logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x25b345,_0xbe9e('0xd'),JSON['stringify'](_0x12da9a));if(_0x12da9a[_0xbe9e('0xe')]){if(_0x12da9a[_0xbe9e('0xe')]['code']===0x1f4){logger[_0xbe9e('0xe')](_0xbe9e('0xf'),_0x25b345,_0x12da9a[_0xbe9e('0xe')]['message']);return _0x2ea4e1(_0x12da9a[_0xbe9e('0xe')][_0xbe9e('0x10')]);}logger[_0xbe9e('0xe')](_0xbe9e('0xf'),_0x25b345,_0x12da9a[_0xbe9e('0xe')][_0xbe9e('0x10')]);return _0x5874eb(_0x12da9a[_0xbe9e('0xe')]['message']);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x25b345,_0xbe9e('0xd'));_0x5874eb(_0x12da9a[_0xbe9e('0x11')][_0xbe9e('0x10')]);}})[_0xbe9e('0x12')](function(_0x3ccb7b){logger[_0xbe9e('0xe')](_0xbe9e('0xf'),_0x25b345,_0x3ccb7b);_0x2ea4e1(_0x3ccb7b);});});} \ No newline at end of file +var _0xef6f=['util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x4309eb,_0x319008){var _0x45cbe7=function(_0x4102a6){while(--_0x4102a6){_0x4309eb['push'](_0x4309eb['shift']());}};_0x45cbe7(++_0x319008);}(_0xef6f,0x1b7));var _0xfef6=function(_0x3ab381,_0x8074c3){_0x3ab381=_0x3ab381-0x0;var _0x3ef3ac=_0xef6f[_0x3ab381];return _0x3ef3ac;};'use strict';var _=require(_0xfef6('0x0'));var util=require(_0xfef6('0x1'));var moment=require(_0xfef6('0x2'));var BPromise=require(_0xfef6('0x3'));var rs=require(_0xfef6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfef6('0x6'))('rpc');var config=require(_0xfef6('0x7'));var jayson=require(_0xfef6('0x8'));var client=jayson[_0xfef6('0x9')][_0xfef6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16d1d2,_0x483a19,_0x21ffea){return new BPromise(function(_0x35048b,_0x40c44a){return client['request'](_0x16d1d2,_0x21ffea)[_0xfef6('0xb')](function(_0x424273){logger[_0xfef6('0xc')](_0xfef6('0xd'),_0x483a19,_0xfef6('0xe'));logger[_0xfef6('0xf')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x483a19,_0xfef6('0xe'),JSON[_0xfef6('0x10')](_0x424273));if(_0x424273[_0xfef6('0x11')]){if(_0x424273[_0xfef6('0x11')][_0xfef6('0x12')]===0x1f4){logger[_0xfef6('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x483a19,_0x424273[_0xfef6('0x11')][_0xfef6('0x13')]);return _0x40c44a(_0x424273['error'][_0xfef6('0x13')]);}logger[_0xfef6('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x483a19,_0x424273[_0xfef6('0x11')][_0xfef6('0x13')]);return _0x35048b(_0x424273['error'][_0xfef6('0x13')]);}else{logger[_0xfef6('0xc')](_0xfef6('0xd'),_0x483a19,'request\x20sent');_0x35048b(_0x424273[_0xfef6('0x14')][_0xfef6('0x13')]);}})[_0xfef6('0x15')](function(_0xe2d5ba){logger[_0xfef6('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x483a19,_0xe2d5ba);_0x40c44a(_0xe2d5ba);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 97a0593..d0dffb0 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 _0x78dd=['./intServicenowField.controller','get','isAuthenticated','index','/:id','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x5d78d7,_0x115a53){var _0x4e0225=function(_0x1e05ac){while(--_0x1e05ac){_0x5d78d7['push'](_0x5d78d7['shift']());}};_0x4e0225(++_0x115a53);}(_0x78dd,0x1de));var _0xd78d=function(_0x4bcf38,_0x3c12be){_0x4bcf38=_0x4bcf38-0x0;var _0x4a89be=_0x78dd[_0x4bcf38];return _0x4a89be;};'use strict';var multer=require(_0xd78d('0x0'));var util=require(_0xd78d('0x1'));var path=require(_0xd78d('0x2'));var timeout=require(_0xd78d('0x3'));var express=require(_0xd78d('0x4'));var router=express[_0xd78d('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xd78d('0x6'));var config=require(_0xd78d('0x7'));var controller=require(_0xd78d('0x8'));router[_0xd78d('0x9')]('/',auth[_0xd78d('0xa')](),controller[_0xd78d('0xb')]);router[_0xd78d('0x9')](_0xd78d('0xc'),auth[_0xd78d('0xa')](),controller['show']);router[_0xd78d('0xd')]('/',auth[_0xd78d('0xa')](),controller[_0xd78d('0xe')]);router[_0xd78d('0xf')](_0xd78d('0xc'),auth['isAuthenticated'](),controller[_0xd78d('0x10')]);router['delete']('/:id',auth[_0xd78d('0xa')](),controller['destroy']);module[_0xd78d('0x11')]=router; \ No newline at end of file +var _0x774f=['delete','exports','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','show','post','put','update'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x774f,0x1a6));var _0xf774=function(_0x4c9174,_0x45ca39){_0x4c9174=_0x4c9174-0x0;var _0x335b94=_0x774f[_0x4c9174];return _0x335b94;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf774('0x0'));var timeout=require(_0xf774('0x1'));var express=require(_0xf774('0x2'));var router=express['Router']();var auth=require(_0xf774('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf774('0x4'));var controller=require('./intServicenowField.controller');router[_0xf774('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xf774('0x6'),auth[_0xf774('0x7')](),controller[_0xf774('0x8')]);router[_0xf774('0x9')]('/',auth[_0xf774('0x7')](),controller['create']);router[_0xf774('0xa')]('/:id',auth[_0xf774('0x7')](),controller[_0xf774('0xb')]);router[_0xf774('0xc')](_0xf774('0x6'),auth[_0xf774('0x7')](),controller['destroy']);module[_0xf774('0xd')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 09538c8..dad392a 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 _0x6324=['variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','STRING'];(function(_0x59fa0a,_0xb23d44){var _0x2c78d9=function(_0xc5fcb){while(--_0xc5fcb){_0x59fa0a['push'](_0x59fa0a['shift']());}};_0x2c78d9(++_0xb23d44);}(_0x6324,0x142));var _0x4632=function(_0x44ad4b,_0x13ccad){_0x44ad4b=_0x44ad4b-0x0;var _0x4c0516=_0x6324[_0x44ad4b];return _0x4c0516;};'use strict';var Sequelize=require(_0x4632('0x0'));module[_0x4632('0x1')]={'type':{'type':Sequelize[_0x4632('0x2')](_0x4632('0x3'),'variable',_0x4632('0x4'),'keyValue'),'defaultValue':_0x4632('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4632('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x4632('0x3'),_0x4632('0x6'),_0x4632('0x4'))},'keyContent':{'type':Sequelize[_0x4632('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4632('0x5')]},'customField':{'type':Sequelize[_0x4632('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4632('0x5')]}}; \ No newline at end of file +var _0x41bb=['exports','string','customVariable','keyValue','STRING','ENUM','variable','BOOLEAN','sequelize'];(function(_0x3c8ed3,_0x156fe7){var _0x2db4ba=function(_0x2a95cd){while(--_0x2a95cd){_0x3c8ed3['push'](_0x3c8ed3['shift']());}};_0x2db4ba(++_0x156fe7);}(_0x41bb,0xc5));var _0xb41b=function(_0x40cac4,_0x276d96){_0x40cac4=_0x40cac4-0x0;var _0x111308=_0x41bb[_0x40cac4];return _0x111308;};'use strict';var Sequelize=require(_0xb41b('0x0'));module[_0xb41b('0x1')]={'type':{'type':Sequelize['ENUM'](_0xb41b('0x2'),'variable',_0xb41b('0x3'),_0xb41b('0x4')),'defaultValue':_0xb41b('0x2')},'content':{'type':Sequelize[_0xb41b('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb41b('0x6')](_0xb41b('0x2'),_0xb41b('0x7'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb41b('0x5')]},'customField':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 9ab45d6..848b23d 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 _0x54a2=['keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','map','type','key','VIRTUAL','field','merge','options','ServicenowField','include','show','params','includeAll','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','apply','reject','save','then','stack','name','index','rawAttributes','model','query'];(function(_0x238b73,_0x5df76f){var _0x5966d9=function(_0x57802d){while(--_0x57802d){_0x238b73['push'](_0x238b73['shift']());}};_0x5966d9(++_0x5df76f);}(_0x54a2,0x9d));var _0x254a=function(_0xee9aba,_0x3630d5){_0xee9aba=_0xee9aba-0x0;var _0x558030=_0x54a2[_0xee9aba];return _0x558030;};'use strict';var pdf=require(_0x254a('0x0'));var emlformat=require(_0x254a('0x1'));var rimraf=require(_0x254a('0x2'));var zipdir=require(_0x254a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x254a('0x4'));var moment=require(_0x254a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x254a('0x6'));var util=require(_0x254a('0x7'));var path=require(_0x254a('0x8'));var sox=require(_0x254a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x254a('0xa'));var jsforce=require(_0x254a('0xb'));var deskjs=require(_0x254a('0xc'));var toCsv=require(_0x254a('0xd'));var querystring=require(_0x254a('0xe'));var Papa=require('papaparse');var Redis=require(_0x254a('0xf'));var authService=require(_0x254a('0x10'));var qs=require(_0x254a('0x11'));var hardwareService=require(_0x254a('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x254a('0x13'));var config=require(_0x254a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bf3b9,_0x548a05){_0x548a05=_0x548a05||0xcc;return function(_0x18af24){if(_0x18af24){return _0x4bf3b9[_0x254a('0x15')](_0x548a05);}return _0x4bf3b9[_0x254a('0x16')](_0x548a05)[_0x254a('0x17')]();};}function respondWithResult(_0x59ce9e,_0x5586fc){_0x5586fc=_0x5586fc||0xc8;return function(_0x4c9956){if(_0x4c9956){return _0x59ce9e[_0x254a('0x16')](_0x5586fc)[_0x254a('0x18')](_0x4c9956);}};}function respondWithFilteredResult(_0x4ffd4d,_0x31c2a2){return function(_0x24f2a4){if(_0x24f2a4){var _0x225566=_0x24f2a4[_0x254a('0x19')],_0x32ff4d=_0x31c2a2[_0x254a('0x1a')],_0x487fd2=_0x31c2a2['offset']+_0x31c2a2[_0x254a('0x1b')],_0x5c236f;if(_0x487fd2>=_0x225566){_0x487fd2=_0x225566;_0x5c236f=0xc8;}else{_0x5c236f=0xce;}_0x4ffd4d[_0x254a('0x16')](_0x5c236f);return _0x4ffd4d['set']('Content-Range',_0x32ff4d+'-'+_0x487fd2+'/'+_0x225566)[_0x254a('0x18')](_0x24f2a4);}return null;};}function patchUpdates(_0x127a31){return function(_0x204d4a){try{jsonpatch[_0x254a('0x1c')](_0x204d4a,_0x127a31,!![]);}catch(_0x48168f){return BPromise[_0x254a('0x1d')](_0x48168f);}return _0x204d4a[_0x254a('0x1e')]();};}function saveUpdates(_0x1a8343,_0x3489f5){return function(_0x5e766e){if(_0x5e766e){return _0x5e766e['update'](_0x1a8343)[_0x254a('0x1f')](function(_0xcda28){return _0xcda28;});}return null;};}function removeEntity(_0x34cfec,_0x59eb05){return function(_0xf0624b){if(_0xf0624b){return _0xf0624b['destroy']()[_0x254a('0x1f')](function(){_0x34cfec[_0x254a('0x16')](0xcc)[_0x254a('0x17')]();});}};}function handleEntityNotFound(_0x7e7b75,_0xc24976){return function(_0x5e6ed3){if(!_0x5e6ed3){_0x7e7b75['sendStatus'](0x194);}return _0x5e6ed3;};}function handleError(_0x250455,_0x326c67){_0x326c67=_0x326c67||0x1f4;return function(_0x2dd90f){logger['error'](_0x2dd90f[_0x254a('0x20')]);if(_0x2dd90f[_0x254a('0x21')]){delete _0x2dd90f['name'];}_0x250455[_0x254a('0x16')](_0x326c67)['send'](_0x2dd90f);};}exports[_0x254a('0x22')]=function(_0x5d3c2e,_0x1106a2){var _0x1db515={},_0x4ccffa={},_0x6c59e2={'count':0x0,'rows':[]};var _0x575079=db['ServicenowField'][_0x254a('0x23')];_0x4ccffa[_0x254a('0x24')]=_['keys'](_0x575079);_0x4ccffa[_0x254a('0x25')]=_[_0x254a('0x26')](_0x5d3c2e[_0x254a('0x25')]);_0x4ccffa['filters']=_[_0x254a('0x27')](_0x4ccffa[_0x254a('0x24')],_0x4ccffa[_0x254a('0x25')]);_0x1db515[_0x254a('0x28')]=_[_0x254a('0x27')](_0x4ccffa[_0x254a('0x24')],qs[_0x254a('0x29')](_0x5d3c2e[_0x254a('0x25')][_0x254a('0x29')]));_0x1db515['attributes']=_0x1db515[_0x254a('0x28')][_0x254a('0x2a')]?_0x1db515[_0x254a('0x28')]:_0x4ccffa['model'];if(!_0x5d3c2e['query'][_0x254a('0x2b')](_0x254a('0x2c'))){_0x1db515[_0x254a('0x1b')]=qs[_0x254a('0x1b')](_0x5d3c2e[_0x254a('0x25')][_0x254a('0x1b')]);_0x1db515['offset']=qs[_0x254a('0x1a')](_0x5d3c2e['query'][_0x254a('0x1a')]);}_0x1db515['order']=qs[_0x254a('0x2d')](_0x5d3c2e['query'][_0x254a('0x2d')]);_0x1db515[_0x254a('0x2e')]=qs[_0x254a('0x2f')](_['pick'](_0x5d3c2e[_0x254a('0x25')],_0x4ccffa[_0x254a('0x2f')]));if(_0x5d3c2e['query'][_0x254a('0x30')]){_0x1db515['where']=_['merge'](_0x1db515['where'],{'$or':_[_0x254a('0x31')](_0x575079,function(_0x5cf460){if(_0x5cf460[_0x254a('0x32')][_0x254a('0x33')]!==_0x254a('0x34')){var _0x592f91={};_0x592f91[_0x5cf460[_0x254a('0x35')]]={'$like':'%'+_0x5d3c2e[_0x254a('0x25')][_0x254a('0x30')]+'%'};return _0x592f91;}})});}_0x1db515=_[_0x254a('0x36')]({},_0x1db515,_0x5d3c2e[_0x254a('0x37')]);var _0x3839aa={'where':_0x1db515[_0x254a('0x2e')]};return db[_0x254a('0x38')][_0x254a('0x19')](_0x3839aa)[_0x254a('0x1f')](function(_0x438059){_0x6c59e2[_0x254a('0x19')]=_0x438059;if(_0x5d3c2e['query']['includeAll']){_0x1db515[_0x254a('0x39')]=[{'all':!![]}];}return db[_0x254a('0x38')]['findAll'](_0x1db515);})[_0x254a('0x1f')](function(_0x2bf4a4){_0x6c59e2['rows']=_0x2bf4a4;return _0x6c59e2;})[_0x254a('0x1f')](respondWithFilteredResult(_0x1106a2,_0x1db515))['catch'](handleError(_0x1106a2,null));};exports[_0x254a('0x3a')]=function(_0x539f2b,_0x5b9c3c){var _0x3f1f21={'raw':!![],'where':{'id':_0x539f2b[_0x254a('0x3b')]['id']}},_0x15a47c={};_0x15a47c[_0x254a('0x24')]=_[_0x254a('0x26')](db[_0x254a('0x38')][_0x254a('0x23')]);_0x15a47c['query']=_[_0x254a('0x26')](_0x539f2b['query']);_0x15a47c[_0x254a('0x2f')]=_[_0x254a('0x27')](_0x15a47c['model'],_0x15a47c['query']);_0x3f1f21[_0x254a('0x28')]=_[_0x254a('0x27')](_0x15a47c['model'],qs['fields'](_0x539f2b[_0x254a('0x25')][_0x254a('0x29')]));_0x3f1f21['attributes']=_0x3f1f21[_0x254a('0x28')][_0x254a('0x2a')]?_0x3f1f21[_0x254a('0x28')]:_0x15a47c['model'];if(_0x539f2b['query'][_0x254a('0x3c')]){_0x3f1f21[_0x254a('0x39')]=[{'all':!![]}];}_0x3f1f21=_[_0x254a('0x36')]({},_0x3f1f21,_0x539f2b[_0x254a('0x37')]);return db[_0x254a('0x38')][_0x254a('0x3d')](_0x3f1f21)[_0x254a('0x1f')](handleEntityNotFound(_0x5b9c3c,null))['then'](respondWithResult(_0x5b9c3c,null))[_0x254a('0x3e')](handleError(_0x5b9c3c,null));};exports[_0x254a('0x3f')]=function(_0x3d1022,_0x4a7bd4){return db[_0x254a('0x38')][_0x254a('0x3f')](_0x3d1022['body'],{})['then'](respondWithResult(_0x4a7bd4,0xc9))[_0x254a('0x3e')](handleError(_0x4a7bd4,null));};exports['update']=function(_0x6c9df2,_0x3c94f3){if(_0x6c9df2['body']['id']){delete _0x6c9df2[_0x254a('0x40')]['id'];}return db[_0x254a('0x38')]['find']({'where':{'id':_0x6c9df2[_0x254a('0x3b')]['id']}})[_0x254a('0x1f')](handleEntityNotFound(_0x3c94f3,null))['then'](saveUpdates(_0x6c9df2[_0x254a('0x40')],null))[_0x254a('0x1f')](respondWithResult(_0x3c94f3,null))['catch'](handleError(_0x3c94f3,null));};exports['destroy']=function(_0x59a6ca,_0x271d13){return db[_0x254a('0x38')][_0x254a('0x3d')]({'where':{'id':_0x59a6ca[_0x254a('0x3b')]['id']}})['then'](handleEntityNotFound(_0x271d13,null))[_0x254a('0x1f')](removeEntity(_0x271d13,null))[_0x254a('0x3e')](handleError(_0x271d13,null));}; \ No newline at end of file +var _0x8751=['options','count','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','send','index','ServicenowField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field'];(function(_0x28c249,_0x380399){var _0x38b10f=function(_0x4e7610){while(--_0x4e7610){_0x28c249['push'](_0x28c249['shift']());}};_0x38b10f(++_0x380399);}(_0x8751,0x178));var _0x1875=function(_0x247755,_0x8412f8){_0x247755=_0x247755-0x0;var _0x328b26=_0x8751[_0x247755];return _0x328b26;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1875('0x0'));var rimraf=require(_0x1875('0x1'));var zipdir=require(_0x1875('0x2'));var jsonpatch=require(_0x1875('0x3'));var rp=require(_0x1875('0x4'));var moment=require(_0x1875('0x5'));var BPromise=require(_0x1875('0x6'));var Mustache=require(_0x1875('0x7'));var util=require(_0x1875('0x8'));var path=require(_0x1875('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1875('0xa'));var fs=require('fs');var _=require(_0x1875('0xb'));var squel=require(_0x1875('0xc'));var crypto=require(_0x1875('0xd'));var jsforce=require(_0x1875('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1875('0xf'));var querystring=require(_0x1875('0x10'));var Papa=require(_0x1875('0x11'));var Redis=require(_0x1875('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x1875('0x13'));var logger=require(_0x1875('0x14'))(_0x1875('0x15'));var utils=require(_0x1875('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x64bd59,_0x4416c7){_0x4416c7=_0x4416c7||0xcc;return function(_0x4bf913){if(_0x4bf913){return _0x64bd59['sendStatus'](_0x4416c7);}return _0x64bd59[_0x1875('0x17')](_0x4416c7)[_0x1875('0x18')]();};}function respondWithResult(_0x1ed207,_0x5115ef){_0x5115ef=_0x5115ef||0xc8;return function(_0x5b68f8){if(_0x5b68f8){return _0x1ed207['status'](_0x5115ef)[_0x1875('0x19')](_0x5b68f8);}};}function respondWithFilteredResult(_0x144557,_0x46baa8){return function(_0x413712){if(_0x413712){var _0x1286fe=_0x413712['count'],_0x34db7a=_0x46baa8[_0x1875('0x1a')],_0x2ca65d=_0x46baa8[_0x1875('0x1a')]+_0x46baa8[_0x1875('0x1b')],_0x278387;if(_0x2ca65d>=_0x1286fe){_0x2ca65d=_0x1286fe;_0x278387=0xc8;}else{_0x278387=0xce;}_0x144557[_0x1875('0x17')](_0x278387);return _0x144557[_0x1875('0x1c')](_0x1875('0x1d'),_0x34db7a+'-'+_0x2ca65d+'/'+_0x1286fe)[_0x1875('0x19')](_0x413712);}return null;};}function patchUpdates(_0x23e8a7){return function(_0x35e646){try{jsonpatch[_0x1875('0x1e')](_0x35e646,_0x23e8a7,!![]);}catch(_0x367d7a){return BPromise['reject'](_0x367d7a);}return _0x35e646[_0x1875('0x1f')]();};}function saveUpdates(_0x5e4457,_0x1922ae){return function(_0x5828ed){if(_0x5828ed){return _0x5828ed[_0x1875('0x20')](_0x5e4457)[_0x1875('0x21')](function(_0x93126d){return _0x93126d;});}return null;};}function removeEntity(_0x1f213e,_0x3e862d){return function(_0x5cb0b5){if(_0x5cb0b5){return _0x5cb0b5[_0x1875('0x22')]()[_0x1875('0x21')](function(){_0x1f213e[_0x1875('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fe24c,_0x2ef4d2){return function(_0x54e8ce){if(!_0x54e8ce){_0x1fe24c[_0x1875('0x23')](0x194);}return _0x54e8ce;};}function handleError(_0x2d423a,_0x5a711c){_0x5a711c=_0x5a711c||0x1f4;return function(_0x4bdd49){logger['error'](_0x4bdd49[_0x1875('0x24')]);if(_0x4bdd49[_0x1875('0x25')]){delete _0x4bdd49[_0x1875('0x25')];}_0x2d423a[_0x1875('0x17')](_0x5a711c)[_0x1875('0x26')](_0x4bdd49);};}exports[_0x1875('0x27')]=function(_0x1946f8,_0x14c54b){var _0xcc51b6={},_0x141ebd={},_0x2de9f8={'count':0x0,'rows':[]};var _0x3f4128=db[_0x1875('0x28')][_0x1875('0x29')];_0x141ebd[_0x1875('0x2a')]=_[_0x1875('0x2b')](_0x3f4128);_0x141ebd[_0x1875('0x2c')]=_[_0x1875('0x2b')](_0x1946f8[_0x1875('0x2c')]);_0x141ebd[_0x1875('0x2d')]=_[_0x1875('0x2e')](_0x141ebd['model'],_0x141ebd[_0x1875('0x2c')]);_0xcc51b6[_0x1875('0x2f')]=_['intersection'](_0x141ebd['model'],qs[_0x1875('0x30')](_0x1946f8['query'][_0x1875('0x30')]));_0xcc51b6[_0x1875('0x2f')]=_0xcc51b6['attributes'][_0x1875('0x31')]?_0xcc51b6[_0x1875('0x2f')]:_0x141ebd[_0x1875('0x2a')];if(!_0x1946f8['query'][_0x1875('0x32')]('nolimit')){_0xcc51b6[_0x1875('0x1b')]=qs[_0x1875('0x1b')](_0x1946f8['query']['limit']);_0xcc51b6[_0x1875('0x1a')]=qs[_0x1875('0x1a')](_0x1946f8[_0x1875('0x2c')][_0x1875('0x1a')]);}_0xcc51b6[_0x1875('0x33')]=qs['sort'](_0x1946f8[_0x1875('0x2c')][_0x1875('0x34')]);_0xcc51b6[_0x1875('0x35')]=qs[_0x1875('0x2d')](_[_0x1875('0x36')](_0x1946f8['query'],_0x141ebd[_0x1875('0x2d')]));if(_0x1946f8['query'][_0x1875('0x37')]){_0xcc51b6[_0x1875('0x35')]=_[_0x1875('0x38')](_0xcc51b6[_0x1875('0x35')],{'$or':_[_0x1875('0x39')](_0x3f4128,function(_0xb3d79a){if(_0xb3d79a[_0x1875('0x3a')][_0x1875('0x3b')]!==_0x1875('0x3c')){var _0x1be22d={};_0x1be22d[_0xb3d79a[_0x1875('0x3d')]]={'$like':'%'+_0x1946f8[_0x1875('0x2c')]['filter']+'%'};return _0x1be22d;}})});}_0xcc51b6=_[_0x1875('0x38')]({},_0xcc51b6,_0x1946f8[_0x1875('0x3e')]);var _0x293a32={'where':_0xcc51b6[_0x1875('0x35')]};return db[_0x1875('0x28')]['count'](_0x293a32)[_0x1875('0x21')](function(_0x43cbb6){_0x2de9f8[_0x1875('0x3f')]=_0x43cbb6;if(_0x1946f8[_0x1875('0x2c')][_0x1875('0x40')]){_0xcc51b6[_0x1875('0x41')]=[{'all':!![]}];}return db[_0x1875('0x28')]['findAll'](_0xcc51b6);})[_0x1875('0x21')](function(_0x1c239b){_0x2de9f8[_0x1875('0x42')]=_0x1c239b;return _0x2de9f8;})[_0x1875('0x21')](respondWithFilteredResult(_0x14c54b,_0xcc51b6))[_0x1875('0x43')](handleError(_0x14c54b,null));};exports[_0x1875('0x44')]=function(_0x2f39ff,_0x2fb430){var _0x33328a={'raw':!![],'where':{'id':_0x2f39ff[_0x1875('0x45')]['id']}},_0x5ea1e5={};_0x5ea1e5[_0x1875('0x2a')]=_['keys'](db['ServicenowField'][_0x1875('0x29')]);_0x5ea1e5['query']=_[_0x1875('0x2b')](_0x2f39ff['query']);_0x5ea1e5[_0x1875('0x2d')]=_[_0x1875('0x2e')](_0x5ea1e5[_0x1875('0x2a')],_0x5ea1e5[_0x1875('0x2c')]);_0x33328a['attributes']=_[_0x1875('0x2e')](_0x5ea1e5[_0x1875('0x2a')],qs[_0x1875('0x30')](_0x2f39ff[_0x1875('0x2c')][_0x1875('0x30')]));_0x33328a[_0x1875('0x2f')]=_0x33328a['attributes'][_0x1875('0x31')]?_0x33328a[_0x1875('0x2f')]:_0x5ea1e5['model'];if(_0x2f39ff[_0x1875('0x2c')]['includeAll']){_0x33328a['include']=[{'all':!![]}];}_0x33328a=_[_0x1875('0x38')]({},_0x33328a,_0x2f39ff[_0x1875('0x3e')]);return db[_0x1875('0x28')][_0x1875('0x46')](_0x33328a)[_0x1875('0x21')](handleEntityNotFound(_0x2fb430,null))[_0x1875('0x21')](respondWithResult(_0x2fb430,null))['catch'](handleError(_0x2fb430,null));};exports['create']=function(_0x2d2dc6,_0x237dbb){return db[_0x1875('0x28')][_0x1875('0x47')](_0x2d2dc6[_0x1875('0x48')],{})[_0x1875('0x21')](respondWithResult(_0x237dbb,0xc9))['catch'](handleError(_0x237dbb,null));};exports[_0x1875('0x20')]=function(_0x584f38,_0x489084){if(_0x584f38['body']['id']){delete _0x584f38[_0x1875('0x48')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x584f38[_0x1875('0x45')]['id']}})[_0x1875('0x21')](handleEntityNotFound(_0x489084,null))[_0x1875('0x21')](saveUpdates(_0x584f38[_0x1875('0x48')],null))[_0x1875('0x21')](respondWithResult(_0x489084,null))[_0x1875('0x43')](handleError(_0x489084,null));};exports[_0x1875('0x22')]=function(_0x1947ca,_0x4b3886){return db['ServicenowField'][_0x1875('0x46')]({'where':{'id':_0x1947ca[_0x1875('0x45')]['id']}})[_0x1875('0x21')](handleEntityNotFound(_0x4b3886,null))[_0x1875('0x21')](removeEntity(_0x4b3886,null))['catch'](handleError(_0x4b3886,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 05de269..7a764c7 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 _0x2f79=['FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','ServicenowField','int_servicenow_fields'];(function(_0x4b8c25,_0x191470){var _0x4c6c25=function(_0x2263c8){while(--_0x2263c8){_0x4b8c25['push'](_0x4b8c25['shift']());}};_0x4c6c25(++_0x191470);}(_0x2f79,0x1ae));var _0x92f7=function(_0x5b2d1e,_0x223e54){_0x5b2d1e=_0x5b2d1e-0x0;var _0x4bb3ec=_0x2f79[_0x5b2d1e];return _0x4bb3ec;};'use strict';var _=require(_0x92f7('0x0'));var util=require(_0x92f7('0x1'));var logger=require('../../config/logger')(_0x92f7('0x2'));var moment=require(_0x92f7('0x3'));var BPromise=require(_0x92f7('0x4'));var rp=require(_0x92f7('0x5'));var fs=require('fs');var path=require(_0x92f7('0x6'));var rimraf=require(_0x92f7('0x7'));var config=require(_0x92f7('0x8'));var attributes=require(_0x92f7('0x9'));module['exports']=function(_0x57126c,_0x4e565a){return _0x57126c['define'](_0x92f7('0xa'),attributes,{'tableName':_0x92f7('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':['idField',_0x92f7('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x212d=['../../config/environment','./intServicenowField.attributes','exports','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x3fd282,_0xe8c753){var _0x2a295d=function(_0x42e80d){while(--_0x42e80d){_0x3fd282['push'](_0x3fd282['shift']());}};_0x2a295d(++_0xe8c753);}(_0x212d,0x1db));var _0xd212=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x212d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd212('0x0'));var logger=require(_0xd212('0x1'))(_0xd212('0x2'));var moment=require('moment');var BPromise=require(_0xd212('0x3'));var rp=require(_0xd212('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd212('0x5'));var config=require(_0xd212('0x6'));var attributes=require(_0xd212('0x7'));module[_0xd212('0x8')]=function(_0x35e6fd,_0x1af900){return _0x35e6fd['define'](_0xd212('0x9'),attributes,{'tableName':_0xd212('0xa'),'paranoid':![],'indexes':[{'name':_0xd212('0xb'),'fields':[_0xd212('0xc'),'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 58abc94..30ae7a1 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 _0x68b3=['rpc','jayson/promise','client','http','request','then','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4d9d4c,_0x2fef19){var _0x62ea8=function(_0x6c584b){while(--_0x6c584b){_0x4d9d4c['push'](_0x4d9d4c['shift']());}};_0x62ea8(++_0x2fef19);}(_0x68b3,0x1d8));var _0x368b=function(_0x3c726d,_0x11b18a){_0x3c726d=_0x3c726d-0x0;var _0xb72179=_0x68b3[_0x3c726d];return _0xb72179;};'use strict';var _=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var moment=require(_0x368b('0x2'));var BPromise=require(_0x368b('0x3'));var rs=require(_0x368b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x368b('0x5'))['db'];var utils=require(_0x368b('0x6'));var logger=require(_0x368b('0x7'))(_0x368b('0x8'));var config=require('../../config/environment');var jayson=require(_0x368b('0x9'));var client=jayson[_0x368b('0xa')][_0x368b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23584a,_0x4406c8,_0x127c1e){return new BPromise(function(_0x2dec1c,_0x142d05){return client[_0x368b('0xc')](_0x23584a,_0x127c1e)[_0x368b('0xd')](function(_0x2a7b9f){logger['info'](_0x368b('0xe'),_0x4406c8,_0x368b('0xf'));logger[_0x368b('0x10')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x4406c8,_0x368b('0xf'),JSON[_0x368b('0x11')](_0x2a7b9f));if(_0x2a7b9f[_0x368b('0x12')]){if(_0x2a7b9f['error'][_0x368b('0x13')]===0x1f4){logger[_0x368b('0x12')]('ServicenowField,\x20%s,\x20%s',_0x4406c8,_0x2a7b9f[_0x368b('0x12')][_0x368b('0x14')]);return _0x142d05(_0x2a7b9f[_0x368b('0x12')][_0x368b('0x14')]);}logger[_0x368b('0x12')]('ServicenowField,\x20%s,\x20%s',_0x4406c8,_0x2a7b9f[_0x368b('0x12')][_0x368b('0x14')]);return _0x2dec1c(_0x2a7b9f['error'][_0x368b('0x14')]);}else{logger[_0x368b('0x15')](_0x368b('0xe'),_0x4406c8,'request\x20sent');_0x2dec1c(_0x2a7b9f[_0x368b('0x16')][_0x368b('0x14')]);}})[_0x368b('0x17')](function(_0x4d6d9d){logger[_0x368b('0x12')](_0x368b('0xe'),_0x4406c8,_0x4d6d9d);_0x142d05(_0x4d6d9d);});});} \ No newline at end of file +var _0x4bd3=['request','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x15415d,_0xe43297){var _0xdbac62=function(_0x17c443){while(--_0x17c443){_0x15415d['push'](_0x15415d['shift']());}};_0xdbac62(++_0xe43297);}(_0x4bd3,0x174));var _0x34bd=function(_0x5c298e,_0x460542){_0x5c298e=_0x5c298e-0x0;var _0x4eb3ad=_0x4bd3[_0x5c298e];return _0x4eb3ad;};'use strict';var _=require(_0x34bd('0x0'));var util=require('util');var moment=require(_0x34bd('0x1'));var BPromise=require(_0x34bd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x34bd('0x3'));var logger=require(_0x34bd('0x4'))(_0x34bd('0x5'));var config=require('../../config/environment');var jayson=require(_0x34bd('0x6'));var client=jayson[_0x34bd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e8744,_0x213716,_0x51a4d7){return new BPromise(function(_0xd600e1,_0x76de8d){return client[_0x34bd('0x8')](_0x3e8744,_0x51a4d7)[_0x34bd('0x9')](function(_0x1ac77f){logger[_0x34bd('0xa')]('ServicenowField,\x20%s,\x20%s',_0x213716,_0x34bd('0xb'));logger[_0x34bd('0xc')](_0x34bd('0xd'),_0x213716,_0x34bd('0xb'),JSON['stringify'](_0x1ac77f));if(_0x1ac77f['error']){if(_0x1ac77f[_0x34bd('0xe')]['code']===0x1f4){logger['error'](_0x34bd('0xf'),_0x213716,_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);return _0x76de8d(_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);}logger[_0x34bd('0xe')](_0x34bd('0xf'),_0x213716,_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);return _0xd600e1(_0x1ac77f['error'][_0x34bd('0x10')]);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x213716,_0x34bd('0xb'));_0xd600e1(_0x1ac77f[_0x34bd('0x11')][_0x34bd('0x10')]);}})[_0x34bd('0x12')](function(_0x34b91b){logger[_0x34bd('0xe')](_0x34bd('0xf'),_0x213716,_0x34b91b);_0x76de8d(_0x34b91b);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index d6d5cf4..1651ee2 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 _0xc552=['destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated','index','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','/:id','update','delete'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xc552,0x160));var _0x2c55=function(_0x3d1d8e,_0x533b1c){_0x3d1d8e=_0x3d1d8e-0x0;var _0x175671=_0xc552[_0x3d1d8e];return _0x175671;};'use strict';var multer=require(_0x2c55('0x0'));var util=require(_0x2c55('0x1'));var path=require('path');var timeout=require(_0x2c55('0x2'));var express=require(_0x2c55('0x3'));var router=express['Router']();var auth=require(_0x2c55('0x4'));var interaction=require(_0x2c55('0x5'));var config=require(_0x2c55('0x6'));var controller=require(_0x2c55('0x7'));router[_0x2c55('0x8')]('/',auth[_0x2c55('0x9')](),controller[_0x2c55('0xa')]);router[_0x2c55('0x8')]('/:id',auth[_0x2c55('0x9')](),controller[_0x2c55('0xb')]);router[_0x2c55('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x2c55('0xc')]);router['get'](_0x2c55('0xd'),auth[_0x2c55('0x9')](),controller[_0x2c55('0xe')]);router[_0x2c55('0xf')]('/',auth[_0x2c55('0x9')](),controller[_0x2c55('0x10')]);router[_0x2c55('0xf')](_0x2c55('0x11'),auth['isAuthenticated'](),controller[_0x2c55('0x12')]);router[_0x2c55('0x13')](_0x2c55('0x14'),auth[_0x2c55('0x9')](),controller[_0x2c55('0x15')]);router[_0x2c55('0x16')](_0x2c55('0x14'),auth[_0x2c55('0x9')](),controller[_0x2c55('0x17')]);module[_0x2c55('0x18')]=router; \ No newline at end of file +var _0x959f=['Router','../../components/auth/service','../../config/environment','./intSugarcrmAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','put','delete','destroy','exports','util','connect-timeout','express'];(function(_0x5f5413,_0x5d9261){var _0x111f08=function(_0x1daf37){while(--_0x1daf37){_0x5f5413['push'](_0x5f5413['shift']());}};_0x111f08(++_0x5d9261);}(_0x959f,0x81));var _0xf959=function(_0xb2f0c2,_0x3ceace){_0xb2f0c2=_0xb2f0c2-0x0;var _0x35d1f4=_0x959f[_0xb2f0c2];return _0x35d1f4;};'use strict';var multer=require('multer');var util=require(_0xf959('0x0'));var path=require('path');var timeout=require(_0xf959('0x1'));var express=require(_0xf959('0x2'));var router=express[_0xf959('0x3')]();var auth=require(_0xf959('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf959('0x5'));var controller=require(_0xf959('0x6'));router['get']('/',auth[_0xf959('0x7')](),controller[_0xf959('0x8')]);router[_0xf959('0x9')](_0xf959('0xa'),auth['isAuthenticated'](),controller[_0xf959('0xb')]);router[_0xf959('0x9')](_0xf959('0xc'),auth[_0xf959('0x7')](),controller[_0xf959('0xd')]);router[_0xf959('0x9')](_0xf959('0xe'),auth[_0xf959('0x7')](),controller['getFields']);router['post']('/',auth[_0xf959('0x7')](),controller[_0xf959('0xf')]);router[_0xf959('0x10')](_0xf959('0xc'),auth[_0xf959('0x7')](),controller[_0xf959('0x11')]);router[_0xf959('0x12')](_0xf959('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xf959('0x13')](_0xf959('0xa'),auth[_0xf959('0x7')](),controller[_0xf959('0x14')]);module[_0xf959('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index fe28ff7..84e1126 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 _0x7223=['username','remoteUri','sequelize','exports','STRING'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x7223,0xbb));var _0x3722=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x7223[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x3722('0x0'));module[_0x3722('0x1')]={'name':{'type':Sequelize[_0x3722('0x2')]},'description':{'type':Sequelize[_0x3722('0x2')]},'username':{'type':Sequelize[_0x3722('0x2')],'unique':_0x3722('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3722('0x2')],'unique':_0x3722('0x4')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd153=['sequelize','exports','STRING','username'];(function(_0x32af67,_0x15880c){var _0x5cfede=function(_0x51b35d){while(--_0x51b35d){_0x32af67['push'](_0x32af67['shift']());}};_0x5cfede(++_0x15880c);}(_0xd153,0x70));var _0x3d15=function(_0x1bd506,_0x4a493c){_0x1bd506=_0x1bd506-0x0;var _0x5bd328=_0xd153[_0x1bd506];return _0x5bd328;};'use strict';var Sequelize=require(_0x3d15('0x0'));module[_0x3d15('0x1')]={'name':{'type':Sequelize[_0x3d15('0x2')]},'description':{'type':Sequelize[_0x3d15('0x2')]},'username':{'type':Sequelize[_0x3d15('0x2')],'unique':_0x3d15('0x3')},'password':{'type':Sequelize[_0x3d15('0x2')]},'remoteUri':{'type':Sequelize[_0x3d15('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x3d15('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 138d131..67a0521 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 _0xf913=['created_by','date_start','duration_hours','duration_minutes','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','%s%s','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','/service/v4_1/rest.php','get_module_fields','values','module_fields','remove','includes','label','endsWith','value','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','send','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','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~!@#$%^&-_=+[{]}.','then','request\x20sent','debug','stringify','code','error','SugarcrmAccount,\x20%s,\x20%s','message','info','catch','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','sendStatus','stack','name','index','SugarcrmAccount','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','include','params','length','includeAll','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','rawAttributes','map','addConfiguration','AccountId','Subjects','getDescriptions','channel','SugarcrmField','Descriptions','getFields','assigned_user_id'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xf913,0x11c));var _0x3f91=function(_0x537634,_0x5da3e4){_0x537634=_0x537634-0x0;var _0x28badd=_0xf913[_0x537634];return _0x28badd;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3f91('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3f91('0x1'));var rp=require('request-promise');var moment=require(_0x3f91('0x2'));var BPromise=require(_0x3f91('0x3'));var Mustache=require(_0x3f91('0x4'));var util=require('util');var path=require(_0x3f91('0x5'));var sox=require(_0x3f91('0x6'));var csv=require('to-csv');var ejs=require(_0x3f91('0x7'));var fs=require('fs');var _=require(_0x3f91('0x8'));var squel=require(_0x3f91('0x9'));var crypto=require('crypto');var jsforce=require(_0x3f91('0xa'));var deskjs=require(_0x3f91('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3f91('0xc'));var Papa=require('papaparse');var Redis=require(_0x3f91('0xd'));var authService=require(_0x3f91('0xe'));var qs=require(_0x3f91('0xf'));var hardwareService=require(_0x3f91('0x10'));var logger=require(_0x3f91('0x11'))('api');var utils=require(_0x3f91('0x12'));var config=require(_0x3f91('0x13'));var db=require(_0x3f91('0x14'))['db'];var integrations=require(_0x3f91('0x15'));var jayson=require(_0x3f91('0x16'));var client=jayson[_0x3f91('0x17')][_0x3f91('0x18')]({'port':0x232a});function checkPasswordPattern(_0x48b9c8,_0x23f901,_0x2247ce){if(_0x2247ce){var _0x2e5746=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2e5746[_0x3f91('0x19')](_0x23f901)){return _0x48b9c8;}else{throw new Error(_0x3f91('0x1a'));}}else{return _0x48b9c8;}}function respondWithRpcPromise(_0xfc1d45,_0x5288b4,_0x4e1a3e,_0x3428d1){return new BPromise(function(_0x193eb8,_0xa4e817){var _0x573429=_0x3428d1||client;return _0x573429['request'](_0xfc1d45,_0x4e1a3e)[_0x3f91('0x1b')](function(_0x4673de){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x5288b4,_0x3f91('0x1c'));logger[_0x3f91('0x1d')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x5288b4,_0x3f91('0x1c'),JSON[_0x3f91('0x1e')](_0x4673de));if(_0x4673de['error']){if(_0x4673de['error'][_0x3f91('0x1f')]===0x1f4){logger[_0x3f91('0x20')](_0x3f91('0x21'),_0x5288b4,_0x4673de[_0x3f91('0x20')][_0x3f91('0x22')]);return _0xa4e817(_0x4673de['error'][_0x3f91('0x22')]);}logger[_0x3f91('0x20')](_0x3f91('0x21'),_0x5288b4,_0x4673de[_0x3f91('0x20')][_0x3f91('0x22')]);return _0x193eb8(_0x4673de[_0x3f91('0x20')][_0x3f91('0x22')]);}else{logger[_0x3f91('0x23')](_0x3f91('0x21'),_0x5288b4,_0x3f91('0x1c'));_0x193eb8(_0x4673de['result'][_0x3f91('0x22')]);}})[_0x3f91('0x24')](function(_0x40856b){logger[_0x3f91('0x20')](_0x3f91('0x21'),_0x5288b4,_0x40856b);_0xa4e817(_0x40856b);});});}function respondWithStatusCode(_0x31ddbf,_0x1ec433){_0x1ec433=_0x1ec433||0xcc;return function(_0x2d17f2){if(_0x2d17f2){return _0x31ddbf['sendStatus'](_0x1ec433);}return _0x31ddbf[_0x3f91('0x25')](_0x1ec433)[_0x3f91('0x26')]();};}function respondWithResult(_0x58d774,_0xec5d61){_0xec5d61=_0xec5d61||0xc8;return function(_0x954cb0){if(_0x954cb0){return _0x58d774[_0x3f91('0x25')](_0xec5d61)[_0x3f91('0x27')](_0x954cb0);}};}function respondWithFilteredResult(_0x39dd8c,_0x168452){return function(_0x186df3){if(_0x186df3){var _0x1de090=_0x186df3[_0x3f91('0x28')],_0x3b42a1=_0x168452['offset'],_0x5b409a=_0x168452[_0x3f91('0x29')]+_0x168452[_0x3f91('0x2a')],_0x39198d;if(_0x5b409a>=_0x1de090){_0x5b409a=_0x1de090;_0x39198d=0xc8;}else{_0x39198d=0xce;}_0x39dd8c[_0x3f91('0x25')](_0x39198d);return _0x39dd8c[_0x3f91('0x2b')](_0x3f91('0x2c'),_0x3b42a1+'-'+_0x5b409a+'/'+_0x1de090)[_0x3f91('0x27')](_0x186df3);}return null;};}function patchUpdates(_0x4d9167){return function(_0x11657d){try{jsonpatch['apply'](_0x11657d,_0x4d9167,!![]);}catch(_0x24c78b){return BPromise[_0x3f91('0x2d')](_0x24c78b);}return _0x11657d[_0x3f91('0x2e')]();};}function saveUpdates(_0x5176bf,_0x11c8a9){return function(_0x553a85){if(_0x553a85){return _0x553a85[_0x3f91('0x2f')](_0x5176bf)[_0x3f91('0x1b')](function(_0x3e5c67){return _0x3e5c67;});}return null;};}function removeEntity(_0x5982f2,_0x47ec27){return function(_0x18e989){if(_0x18e989){return _0x18e989[_0x3f91('0x30')]()[_0x3f91('0x1b')](function(){_0x5982f2[_0x3f91('0x25')](0xcc)[_0x3f91('0x26')]();});}};}function handleEntityNotFound(_0x17a3ee,_0x18881f){return function(_0x473521){if(!_0x473521){_0x17a3ee[_0x3f91('0x31')](0x194);}return _0x473521;};}function handleError(_0x27223f,_0x46b57d){_0x46b57d=_0x46b57d||0x1f4;return function(_0x2f4b6b){logger[_0x3f91('0x20')](_0x2f4b6b[_0x3f91('0x32')]);if(_0x2f4b6b[_0x3f91('0x33')]){delete _0x2f4b6b['name'];}_0x27223f[_0x3f91('0x25')](_0x46b57d)['send'](_0x2f4b6b);};}exports[_0x3f91('0x34')]=function(_0x1195d3,_0x2a7002){var _0x1d725f={},_0x48eeda={},_0x5282ce={'count':0x0,'rows':[]};var _0x4804dd=db[_0x3f91('0x35')]['rawAttributes'];_0x48eeda[_0x3f91('0x36')]=_[_0x3f91('0x37')](_0x4804dd);_0x48eeda[_0x3f91('0x38')]=_[_0x3f91('0x37')](_0x1195d3['query']);_0x48eeda[_0x3f91('0x39')]=_[_0x3f91('0x3a')](_0x48eeda[_0x3f91('0x36')],_0x48eeda[_0x3f91('0x38')]);_0x1d725f['attributes']=_[_0x3f91('0x3a')](_0x48eeda[_0x3f91('0x36')],qs[_0x3f91('0x3b')](_0x1195d3[_0x3f91('0x38')]['fields']));_0x1d725f[_0x3f91('0x3c')]=_0x1d725f[_0x3f91('0x3c')]['length']?_0x1d725f[_0x3f91('0x3c')]:_0x48eeda['model'];if(!_0x1195d3[_0x3f91('0x38')][_0x3f91('0x3d')](_0x3f91('0x3e'))){_0x1d725f[_0x3f91('0x2a')]=qs[_0x3f91('0x2a')](_0x1195d3[_0x3f91('0x38')][_0x3f91('0x2a')]);_0x1d725f[_0x3f91('0x29')]=qs[_0x3f91('0x29')](_0x1195d3[_0x3f91('0x38')][_0x3f91('0x29')]);}_0x1d725f[_0x3f91('0x3f')]=qs[_0x3f91('0x40')](_0x1195d3[_0x3f91('0x38')][_0x3f91('0x40')]);_0x1d725f[_0x3f91('0x41')]=qs[_0x3f91('0x39')](_[_0x3f91('0x42')](_0x1195d3['query'],_0x48eeda['filters']));if(_0x1195d3['query'][_0x3f91('0x43')]){_0x1d725f[_0x3f91('0x41')]=_[_0x3f91('0x44')](_0x1d725f[_0x3f91('0x41')],{'$or':_['map'](_0x4804dd,function(_0x313f39){if(_0x313f39[_0x3f91('0x45')][_0x3f91('0x46')]!==_0x3f91('0x47')){var _0x118a49={};_0x118a49[_0x313f39['field']]={'$like':'%'+_0x1195d3[_0x3f91('0x38')][_0x3f91('0x43')]+'%'};return _0x118a49;}})});}_0x1d725f=_[_0x3f91('0x44')]({},_0x1d725f,_0x1195d3[_0x3f91('0x48')]);var _0x2cd82f={'where':_0x1d725f[_0x3f91('0x41')]};return db[_0x3f91('0x35')][_0x3f91('0x28')](_0x2cd82f)[_0x3f91('0x1b')](function(_0x25b931){_0x5282ce['count']=_0x25b931;if(_0x1195d3[_0x3f91('0x38')]['includeAll']){_0x1d725f[_0x3f91('0x49')]=[{'all':!![]}];}return db[_0x3f91('0x35')]['findAll'](_0x1d725f);})[_0x3f91('0x1b')](function(_0x123e2c){_0x5282ce['rows']=_0x123e2c;return _0x5282ce;})[_0x3f91('0x1b')](respondWithFilteredResult(_0x2a7002,_0x1d725f))[_0x3f91('0x24')](handleError(_0x2a7002,null));};exports['show']=function(_0x39b40d,_0x20a704){var _0x557c48={'raw':![],'where':{'id':_0x39b40d[_0x3f91('0x4a')]['id']}},_0x177160={};_0x177160[_0x3f91('0x36')]=_['keys'](db[_0x3f91('0x35')]['rawAttributes']);_0x177160[_0x3f91('0x38')]=_[_0x3f91('0x37')](_0x39b40d[_0x3f91('0x38')]);_0x177160[_0x3f91('0x39')]=_[_0x3f91('0x3a')](_0x177160[_0x3f91('0x36')],_0x177160['query']);_0x557c48[_0x3f91('0x3c')]=_[_0x3f91('0x3a')](_0x177160[_0x3f91('0x36')],qs[_0x3f91('0x3b')](_0x39b40d['query'][_0x3f91('0x3b')]));_0x557c48[_0x3f91('0x3c')]=_0x557c48[_0x3f91('0x3c')][_0x3f91('0x4b')]?_0x557c48['attributes']:_0x177160[_0x3f91('0x36')];if(_0x39b40d[_0x3f91('0x38')][_0x3f91('0x4c')]){_0x557c48[_0x3f91('0x49')]=[{'all':!![]}];}_0x557c48=_[_0x3f91('0x44')]({},_0x557c48,_0x39b40d['options']);return db['SugarcrmAccount'][_0x3f91('0x4d')](_0x557c48)[_0x3f91('0x1b')](handleEntityNotFound(_0x20a704,null))['then'](respondWithResult(_0x20a704,null))[_0x3f91('0x24')](handleError(_0x20a704,null));};exports['create']=function(_0x3d9f92,_0x228c0c){return db[_0x3f91('0x35')][_0x3f91('0x4e')](_0x3d9f92[_0x3f91('0x4f')],{})[_0x3f91('0x1b')](respondWithResult(_0x228c0c,0xc9))[_0x3f91('0x24')](handleError(_0x228c0c,null));};exports[_0x3f91('0x2f')]=function(_0x59f723,_0x4e7eeb){if(_0x59f723['body']['id']){delete _0x59f723['body']['id'];}return db[_0x3f91('0x35')][_0x3f91('0x4d')]({'where':{'id':_0x59f723['params']['id']}})[_0x3f91('0x1b')](handleEntityNotFound(_0x4e7eeb,null))[_0x3f91('0x1b')](saveUpdates(_0x59f723['body'],null))[_0x3f91('0x1b')](respondWithResult(_0x4e7eeb,null))['catch'](handleError(_0x4e7eeb,null));};exports[_0x3f91('0x30')]=function(_0x217bf5,_0x421542){return db['SugarcrmAccount']['find']({'where':{'id':_0x217bf5[_0x3f91('0x4a')]['id']}})[_0x3f91('0x1b')](handleEntityNotFound(_0x421542,null))[_0x3f91('0x1b')](removeEntity(_0x421542,null))[_0x3f91('0x24')](handleError(_0x421542,null));};exports[_0x3f91('0x50')]=function(_0x2c689a,_0x767641,_0x3ea358){var _0x384577={};var _0x29bc09={};var _0x525037;var _0x1f1daf;return db[_0x3f91('0x35')][_0x3f91('0x51')]({'where':{'id':_0x2c689a[_0x3f91('0x4a')]['id']}})[_0x3f91('0x1b')](handleEntityNotFound(_0x767641,null))[_0x3f91('0x1b')](function(_0x3b3367){if(_0x3b3367){_0x525037=_0x3b3367;_0x29bc09['model']=_[_0x3f91('0x37')](db[_0x3f91('0x52')][_0x3f91('0x53')]);_0x29bc09[_0x3f91('0x38')]=_['keys'](_0x2c689a[_0x3f91('0x38')]);_0x29bc09['filters']=_['intersection'](_0x29bc09[_0x3f91('0x36')],_0x29bc09[_0x3f91('0x38')]);_0x384577['attributes']=_[_0x3f91('0x3a')](_0x29bc09[_0x3f91('0x36')],qs[_0x3f91('0x3b')](_0x2c689a['query']['fields']));_0x384577[_0x3f91('0x3c')]=_0x384577['attributes'][_0x3f91('0x4b')]?_0x384577[_0x3f91('0x3c')]:_0x29bc09[_0x3f91('0x36')];_0x384577[_0x3f91('0x3f')]=qs[_0x3f91('0x40')](_0x2c689a[_0x3f91('0x38')][_0x3f91('0x40')]);_0x384577[_0x3f91('0x41')]=qs[_0x3f91('0x39')](_[_0x3f91('0x42')](_0x2c689a[_0x3f91('0x38')],_0x29bc09[_0x3f91('0x39')]));if(_0x2c689a[_0x3f91('0x38')][_0x3f91('0x43')]){_0x384577[_0x3f91('0x41')]=_[_0x3f91('0x44')](_0x384577[_0x3f91('0x41')],{'$or':_[_0x3f91('0x54')](_0x384577['attributes'],function(_0x4cba80){var _0x468ab6={};_0x468ab6[_0x4cba80]={'$like':'%'+_0x2c689a['query'][_0x3f91('0x43')]+'%'};return _0x468ab6;})});}_0x384577=_['merge']({},_0x384577,_0x2c689a[_0x3f91('0x48')]);return _0x525037['getConfigurations'](_0x384577);}})[_0x3f91('0x1b')](function(_0xca4777){if(_0xca4777){_0x1f1daf=_0xca4777[_0x3f91('0x4b')];if(!_0x2c689a[_0x3f91('0x38')][_0x3f91('0x3d')](_0x3f91('0x3e'))){_0x384577[_0x3f91('0x2a')]=qs[_0x3f91('0x2a')](_0x2c689a['query']['limit']);_0x384577[_0x3f91('0x29')]=qs['offset'](_0x2c689a[_0x3f91('0x38')][_0x3f91('0x29')]);}return _0x525037[_0x3f91('0x50')](_0x384577);}})[_0x3f91('0x1b')](function(_0x1bc001){if(_0x1bc001){return _0x1bc001?{'count':_0x1f1daf,'rows':_0x1bc001}:null;}})[_0x3f91('0x1b')](respondWithResult(_0x767641,null))[_0x3f91('0x24')](handleError(_0x767641,null));};exports[_0x3f91('0x55')]=function(_0x31e480,_0x564bb8,_0x5c8f3c){if(_0x31e480[_0x3f91('0x4f')]['id']){delete _0x31e480[_0x3f91('0x4f')]['id'];}return db[_0x3f91('0x35')]['findOne']({'where':{'id':_0x31e480['params']['id']}})[_0x3f91('0x1b')](handleEntityNotFound(_0x564bb8,null))[_0x3f91('0x1b')](function(_0x1ccc24){if(_0x1ccc24){_0x31e480[_0x3f91('0x4f')][_0x3f91('0x56')]=_0x1ccc24['id'];_0x31e480['body'][_0x3f91('0x57')]=integrations['getSubjects'](_0x31e480[_0x3f91('0x4f')]['channel'],_0x31e480[_0x3f91('0x4f')]['type']);_0x31e480[_0x3f91('0x4f')]['Descriptions']=integrations[_0x3f91('0x58')](_0x31e480[_0x3f91('0x4f')][_0x3f91('0x59')],_0x31e480['body'][_0x3f91('0x45')]);return db[_0x3f91('0x52')][_0x3f91('0x4e')](_0x31e480['body'],{'include':[{'model':db[_0x3f91('0x5a')],'as':_0x3f91('0x57')},{'model':db[_0x3f91('0x5a')],'as':_0x3f91('0x5b')}]});}return null;})[_0x3f91('0x1b')](respondWithResult(_0x564bb8,null))[_0x3f91('0x24')](handleError(_0x564bb8,null));};exports[_0x3f91('0x5c')]=function(_0x225f87,_0x86a0cf,_0x4f1bdc){var _0x3c8047='';var _0x207b62=['id',_0x3f91('0x33'),_0x3f91('0x5d'),_0x3f91('0x5e'),'description',_0x3f91('0x5f'),_0x3f91('0x60'),_0x3f91('0x61'),'parent_id','parent_type',_0x3f91('0x62'),_0x3f91('0x63')];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x225f87[_0x3f91('0x4a')]['id']},'attributes':['id',_0x3f91('0x64'),_0x3f91('0x65'),'remoteUri']})[_0x3f91('0x1b')](handleEntityNotFound(_0x86a0cf,null))[_0x3f91('0x1b')](function(_0x51bb39){if(_0x51bb39){_0x3c8047=_0x51bb39[_0x3f91('0x66')];var _0x2a1c03=_0x3c8047[_0x3f91('0x67')](-0x1);if(_0x2a1c03==='/'){_0x3c8047=_0x3c8047[_0x3f91('0x68')](0x0,_0x3c8047[_0x3f91('0x69')](_0x2a1c03));}return rp({'method':_0x3f91('0x6a'),'uri':util['format'](_0x3f91('0x6b'),_0x3c8047,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x3f91('0x6c'),'input_type':_0x3f91('0x6d'),'response_type':_0x3f91('0x6d'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x51bb39[_0x3f91('0x64')],'password':_0x51bb39['password'],'encryption':_0x3f91('0x6e')},'application':_0x3f91('0x6f')})}});}})[_0x3f91('0x1b')](function(_0x1c130f){if(_0x1c130f&&_0x1c130f[_0x3f91('0x33')]!==_0x3f91('0x70')&&_0x1c130f[_0x3f91('0x33')]!==_0x3f91('0x71')){return rp({'method':'POST','uri':util['format'](_0x3f91('0x6b'),_0x3c8047,_0x3f91('0x72')),'json':!![],'form':{'method':_0x3f91('0x73'),'input_type':'JSON','response_type':_0x3f91('0x6d'),'rest_data':JSON[_0x3f91('0x1e')]({'session':_0x1c130f['id'],'module_name':'Calls'})}})['then'](function(_0x169f04){if(_0x169f04){var _0x262776=_[_0x3f91('0x74')](_0x169f04[_0x3f91('0x75')]);_[_0x3f91('0x76')](_0x262776,function(_0x5d7466){return _0x207b62[_0x3f91('0x77')](_0x5d7466['name']);});return{'count':_0x262776[_0x3f91('0x4b')],'rows':_[_0x3f91('0x54')](_0x262776,function(_0x2982d1){return{'id':_0x2982d1[_0x3f91('0x33')],'name':_0x2982d1[_0x3f91('0x78')],'custom':_[_0x3f91('0x79')](_0x2982d1[_0x3f91('0x33')],'_c')?!![]:![],'options':_0x2982d1['options']?_['map'](_['values'](_0x2982d1['options']),function(_0x1a35fd){return{'name':_0x1a35fd[_0x3f91('0x7a')],'value':_0x1a35fd['name']};}):[]};})};}})[_0x3f91('0x1b')](respondWithResult(_0x86a0cf,null))['catch'](function(_0x2dc83e){var _0x199479=_0x225f87[_0x3f91('0x38')][_0x3f91('0x19')]?0x1f4:_0x2dc83e['statusCode']||0x1f4;logger[_0x3f91('0x20')](_0x3f91('0x7b'),_0x3f91('0x5c'),_0x199479,JSON[_0x3f91('0x1e')](_0x2dc83e));delete _0x2dc83e['name'];if(_0x199479===0x191){_0x199479=0x190;}_0x86a0cf['status'](_0x199479)['send'](_0x225f87['query'][_0x3f91('0x19')]?{'message':_0x3f91('0x7c'),'statusCode':_0x2dc83e['statusCode']}:_0x2dc83e);});}else{var _0x2be0e1=0x1f4;_0x86a0cf[_0x3f91('0x25')](_0x2be0e1)[_0x3f91('0x7d')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0xf683=['crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','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','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','SugarcrmAccount,\x20%s,\x20%s','info','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','then','destroy','stack','name','send','index','SugarcrmAccount','keys','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','pick','filter','where','merge','type','field','options','includeAll','include','findAll','rows','show','params','create','body','update','find','getConfigurations','findOne','SugarcrmConfiguration','rawAttributes','map','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','format','/service/v4_1/rest.php','login','xCALLY\x20Motion\x20Integration','Password\x20Expired','POST','get_module_fields','JSON','Calls','values','module_fields','includes','label','endsWith','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash'];(function(_0x2b64b7,_0x8730ef){var _0x2a456f=function(_0x28772c){while(--_0x28772c){_0x2b64b7['push'](_0x2b64b7['shift']());}};_0x2a456f(++_0x8730ef);}(_0xf683,0x75));var _0x3f68=function(_0x168256,_0x49052e){_0x168256=_0x168256-0x0;var _0x602eee=_0xf683[_0x168256];return _0x602eee;};'use strict';var pdf=require(_0x3f68('0x0'));var emlformat=require(_0x3f68('0x1'));var rimraf=require(_0x3f68('0x2'));var zipdir=require(_0x3f68('0x3'));var jsonpatch=require(_0x3f68('0x4'));var rp=require(_0x3f68('0x5'));var moment=require(_0x3f68('0x6'));var BPromise=require(_0x3f68('0x7'));var Mustache=require(_0x3f68('0x8'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3f68('0x9'));var ejs=require(_0x3f68('0xa'));var fs=require('fs');var _=require(_0x3f68('0xb'));var squel=require('squel');var crypto=require(_0x3f68('0xc'));var jsforce=require(_0x3f68('0xd'));var deskjs=require(_0x3f68('0xe'));var toCsv=require(_0x3f68('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3f68('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3f68('0x10'));var hardwareService=require(_0x3f68('0x11'));var logger=require(_0x3f68('0x12'))('api');var utils=require(_0x3f68('0x13'));var config=require(_0x3f68('0x14'));var db=require(_0x3f68('0x15'))['db'];var integrations=require(_0x3f68('0x16'));var jayson=require(_0x3f68('0x17'));var client=jayson[_0x3f68('0x18')][_0x3f68('0x19')]({'port':0x232a});function checkPasswordPattern(_0xb71062,_0x4def04,_0x54208a){if(_0x54208a){var _0x16786c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x16786c[_0x3f68('0x1a')](_0x4def04)){return _0xb71062;}else{throw new Error(_0x3f68('0x1b'));}}else{return _0xb71062;}}function respondWithRpcPromise(_0x5aa973,_0x566c23,_0x2d87cd,_0x14df15){return new BPromise(function(_0x418ae3,_0x265c81){var _0x167904=_0x14df15||client;return _0x167904[_0x3f68('0x1c')](_0x5aa973,_0x2d87cd)['then'](function(_0x39ce7f){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x566c23,_0x3f68('0x1d'));logger[_0x3f68('0x1e')](_0x3f68('0x1f'),_0x566c23,_0x3f68('0x1d'),JSON[_0x3f68('0x20')](_0x39ce7f));if(_0x39ce7f[_0x3f68('0x21')]){if(_0x39ce7f[_0x3f68('0x21')]['code']===0x1f4){logger[_0x3f68('0x21')]('SugarcrmAccount,\x20%s,\x20%s',_0x566c23,_0x39ce7f[_0x3f68('0x21')]['message']);return _0x265c81(_0x39ce7f[_0x3f68('0x21')][_0x3f68('0x22')]);}logger['error'](_0x3f68('0x23'),_0x566c23,_0x39ce7f['error']['message']);return _0x418ae3(_0x39ce7f[_0x3f68('0x21')]['message']);}else{logger[_0x3f68('0x24')]('SugarcrmAccount,\x20%s,\x20%s',_0x566c23,'request\x20sent');_0x418ae3(_0x39ce7f[_0x3f68('0x25')][_0x3f68('0x22')]);}})[_0x3f68('0x26')](function(_0x4ae54b){logger['error'](_0x3f68('0x23'),_0x566c23,_0x4ae54b);_0x265c81(_0x4ae54b);});});}function respondWithStatusCode(_0x1c0eef,_0x5144e5){_0x5144e5=_0x5144e5||0xcc;return function(_0x2c3595){if(_0x2c3595){return _0x1c0eef[_0x3f68('0x27')](_0x5144e5);}return _0x1c0eef[_0x3f68('0x28')](_0x5144e5)[_0x3f68('0x29')]();};}function respondWithResult(_0x1cd107,_0x577511){_0x577511=_0x577511||0xc8;return function(_0x4a33d3){if(_0x4a33d3){return _0x1cd107[_0x3f68('0x28')](_0x577511)[_0x3f68('0x2a')](_0x4a33d3);}};}function respondWithFilteredResult(_0x3b154e,_0x318f85){return function(_0x2c6a05){if(_0x2c6a05){var _0x4caa2a=_0x2c6a05[_0x3f68('0x2b')],_0x5aa493=_0x318f85[_0x3f68('0x2c')],_0x584643=_0x318f85[_0x3f68('0x2c')]+_0x318f85[_0x3f68('0x2d')],_0x168dc8;if(_0x584643>=_0x4caa2a){_0x584643=_0x4caa2a;_0x168dc8=0xc8;}else{_0x168dc8=0xce;}_0x3b154e[_0x3f68('0x28')](_0x168dc8);return _0x3b154e['set'](_0x3f68('0x2e'),_0x5aa493+'-'+_0x584643+'/'+_0x4caa2a)[_0x3f68('0x2a')](_0x2c6a05);}return null;};}function patchUpdates(_0x3dbc8f){return function(_0x166aea){try{jsonpatch[_0x3f68('0x2f')](_0x166aea,_0x3dbc8f,!![]);}catch(_0x55a416){return BPromise[_0x3f68('0x30')](_0x55a416);}return _0x166aea['save']();};}function saveUpdates(_0x201928,_0x311e8e){return function(_0xc48e69){if(_0xc48e69){return _0xc48e69['update'](_0x201928)[_0x3f68('0x31')](function(_0x16d82b){return _0x16d82b;});}return null;};}function removeEntity(_0x3e48c4,_0x11e7c7){return function(_0x3eb603){if(_0x3eb603){return _0x3eb603[_0x3f68('0x32')]()['then'](function(){_0x3e48c4[_0x3f68('0x28')](0xcc)[_0x3f68('0x29')]();});}};}function handleEntityNotFound(_0x4f32ec,_0x45a176){return function(_0x4be4e5){if(!_0x4be4e5){_0x4f32ec[_0x3f68('0x27')](0x194);}return _0x4be4e5;};}function handleError(_0x1e3718,_0x49b22d){_0x49b22d=_0x49b22d||0x1f4;return function(_0x484387){logger[_0x3f68('0x21')](_0x484387[_0x3f68('0x33')]);if(_0x484387[_0x3f68('0x34')]){delete _0x484387[_0x3f68('0x34')];}_0x1e3718[_0x3f68('0x28')](_0x49b22d)[_0x3f68('0x35')](_0x484387);};}exports[_0x3f68('0x36')]=function(_0x1b0dbf,_0x4b3a4a){var _0x343900={},_0x3b338e={},_0x455a53={'count':0x0,'rows':[]};var _0x157d34=db[_0x3f68('0x37')]['rawAttributes'];_0x3b338e['model']=_[_0x3f68('0x38')](_0x157d34);_0x3b338e[_0x3f68('0x39')]=_['keys'](_0x1b0dbf[_0x3f68('0x39')]);_0x3b338e[_0x3f68('0x3a')]=_[_0x3f68('0x3b')](_0x3b338e['model'],_0x3b338e[_0x3f68('0x39')]);_0x343900[_0x3f68('0x3c')]=_['intersection'](_0x3b338e[_0x3f68('0x3d')],qs['fields'](_0x1b0dbf['query'][_0x3f68('0x3e')]));_0x343900[_0x3f68('0x3c')]=_0x343900['attributes'][_0x3f68('0x3f')]?_0x343900[_0x3f68('0x3c')]:_0x3b338e['model'];if(!_0x1b0dbf['query']['hasOwnProperty'](_0x3f68('0x40'))){_0x343900[_0x3f68('0x2d')]=qs[_0x3f68('0x2d')](_0x1b0dbf[_0x3f68('0x39')][_0x3f68('0x2d')]);_0x343900[_0x3f68('0x2c')]=qs[_0x3f68('0x2c')](_0x1b0dbf['query'][_0x3f68('0x2c')]);}_0x343900[_0x3f68('0x41')]=qs[_0x3f68('0x42')](_0x1b0dbf[_0x3f68('0x39')][_0x3f68('0x42')]);_0x343900['where']=qs[_0x3f68('0x3a')](_[_0x3f68('0x43')](_0x1b0dbf[_0x3f68('0x39')],_0x3b338e['filters']));if(_0x1b0dbf['query'][_0x3f68('0x44')]){_0x343900[_0x3f68('0x45')]=_[_0x3f68('0x46')](_0x343900['where'],{'$or':_['map'](_0x157d34,function(_0x1e4382){if(_0x1e4382[_0x3f68('0x47')]['key']!=='VIRTUAL'){var _0x125079={};_0x125079[_0x1e4382[_0x3f68('0x48')]]={'$like':'%'+_0x1b0dbf[_0x3f68('0x39')][_0x3f68('0x44')]+'%'};return _0x125079;}})});}_0x343900=_[_0x3f68('0x46')]({},_0x343900,_0x1b0dbf[_0x3f68('0x49')]);var _0x4187c2={'where':_0x343900[_0x3f68('0x45')]};return db[_0x3f68('0x37')]['count'](_0x4187c2)[_0x3f68('0x31')](function(_0x314354){_0x455a53[_0x3f68('0x2b')]=_0x314354;if(_0x1b0dbf[_0x3f68('0x39')][_0x3f68('0x4a')]){_0x343900[_0x3f68('0x4b')]=[{'all':!![]}];}return db[_0x3f68('0x37')][_0x3f68('0x4c')](_0x343900);})[_0x3f68('0x31')](function(_0x255a08){_0x455a53[_0x3f68('0x4d')]=_0x255a08;return _0x455a53;})[_0x3f68('0x31')](respondWithFilteredResult(_0x4b3a4a,_0x343900))['catch'](handleError(_0x4b3a4a,null));};exports[_0x3f68('0x4e')]=function(_0x298b65,_0x2e00c1){var _0x38cad5={'raw':![],'where':{'id':_0x298b65[_0x3f68('0x4f')]['id']}},_0x28c4e2={};_0x28c4e2[_0x3f68('0x3d')]=_[_0x3f68('0x38')](db[_0x3f68('0x37')]['rawAttributes']);_0x28c4e2['query']=_[_0x3f68('0x38')](_0x298b65['query']);_0x28c4e2[_0x3f68('0x3a')]=_['intersection'](_0x28c4e2[_0x3f68('0x3d')],_0x28c4e2[_0x3f68('0x39')]);_0x38cad5['attributes']=_['intersection'](_0x28c4e2[_0x3f68('0x3d')],qs[_0x3f68('0x3e')](_0x298b65[_0x3f68('0x39')][_0x3f68('0x3e')]));_0x38cad5[_0x3f68('0x3c')]=_0x38cad5[_0x3f68('0x3c')][_0x3f68('0x3f')]?_0x38cad5[_0x3f68('0x3c')]:_0x28c4e2[_0x3f68('0x3d')];if(_0x298b65[_0x3f68('0x39')][_0x3f68('0x4a')]){_0x38cad5[_0x3f68('0x4b')]=[{'all':!![]}];}_0x38cad5=_['merge']({},_0x38cad5,_0x298b65[_0x3f68('0x49')]);return db[_0x3f68('0x37')]['find'](_0x38cad5)[_0x3f68('0x31')](handleEntityNotFound(_0x2e00c1,null))[_0x3f68('0x31')](respondWithResult(_0x2e00c1,null))[_0x3f68('0x26')](handleError(_0x2e00c1,null));};exports[_0x3f68('0x50')]=function(_0x395b50,_0x3fb958){return db[_0x3f68('0x37')]['create'](_0x395b50[_0x3f68('0x51')],{})[_0x3f68('0x31')](respondWithResult(_0x3fb958,0xc9))['catch'](handleError(_0x3fb958,null));};exports[_0x3f68('0x52')]=function(_0x47794a,_0x11e5ff){if(_0x47794a[_0x3f68('0x51')]['id']){delete _0x47794a['body']['id'];}return db[_0x3f68('0x37')][_0x3f68('0x53')]({'where':{'id':_0x47794a[_0x3f68('0x4f')]['id']}})[_0x3f68('0x31')](handleEntityNotFound(_0x11e5ff,null))[_0x3f68('0x31')](saveUpdates(_0x47794a[_0x3f68('0x51')],null))[_0x3f68('0x31')](respondWithResult(_0x11e5ff,null))[_0x3f68('0x26')](handleError(_0x11e5ff,null));};exports[_0x3f68('0x32')]=function(_0x2b4fc0,_0x46ce1d){return db[_0x3f68('0x37')][_0x3f68('0x53')]({'where':{'id':_0x2b4fc0['params']['id']}})[_0x3f68('0x31')](handleEntityNotFound(_0x46ce1d,null))[_0x3f68('0x31')](removeEntity(_0x46ce1d,null))[_0x3f68('0x26')](handleError(_0x46ce1d,null));};exports[_0x3f68('0x54')]=function(_0xe7a5d5,_0x84eff1,_0x5d30ce){var _0x1eb1b4={};var _0x5ebf58={};var _0x6afcec;var _0x553179;return db[_0x3f68('0x37')][_0x3f68('0x55')]({'where':{'id':_0xe7a5d5[_0x3f68('0x4f')]['id']}})[_0x3f68('0x31')](handleEntityNotFound(_0x84eff1,null))[_0x3f68('0x31')](function(_0x1f8faf){if(_0x1f8faf){_0x6afcec=_0x1f8faf;_0x5ebf58['model']=_['keys'](db[_0x3f68('0x56')][_0x3f68('0x57')]);_0x5ebf58[_0x3f68('0x39')]=_[_0x3f68('0x38')](_0xe7a5d5['query']);_0x5ebf58[_0x3f68('0x3a')]=_[_0x3f68('0x3b')](_0x5ebf58[_0x3f68('0x3d')],_0x5ebf58[_0x3f68('0x39')]);_0x1eb1b4['attributes']=_['intersection'](_0x5ebf58[_0x3f68('0x3d')],qs[_0x3f68('0x3e')](_0xe7a5d5[_0x3f68('0x39')]['fields']));_0x1eb1b4[_0x3f68('0x3c')]=_0x1eb1b4['attributes'][_0x3f68('0x3f')]?_0x1eb1b4['attributes']:_0x5ebf58[_0x3f68('0x3d')];_0x1eb1b4[_0x3f68('0x41')]=qs[_0x3f68('0x42')](_0xe7a5d5[_0x3f68('0x39')][_0x3f68('0x42')]);_0x1eb1b4[_0x3f68('0x45')]=qs['filters'](_[_0x3f68('0x43')](_0xe7a5d5[_0x3f68('0x39')],_0x5ebf58['filters']));if(_0xe7a5d5['query']['filter']){_0x1eb1b4[_0x3f68('0x45')]=_[_0x3f68('0x46')](_0x1eb1b4['where'],{'$or':_[_0x3f68('0x58')](_0x1eb1b4['attributes'],function(_0x516d44){var _0x4c7459={};_0x4c7459[_0x516d44]={'$like':'%'+_0xe7a5d5[_0x3f68('0x39')][_0x3f68('0x44')]+'%'};return _0x4c7459;})});}_0x1eb1b4=_[_0x3f68('0x46')]({},_0x1eb1b4,_0xe7a5d5[_0x3f68('0x49')]);return _0x6afcec[_0x3f68('0x54')](_0x1eb1b4);}})[_0x3f68('0x31')](function(_0x462054){if(_0x462054){_0x553179=_0x462054[_0x3f68('0x3f')];if(!_0xe7a5d5[_0x3f68('0x39')][_0x3f68('0x59')]('nolimit')){_0x1eb1b4[_0x3f68('0x2d')]=qs[_0x3f68('0x2d')](_0xe7a5d5[_0x3f68('0x39')][_0x3f68('0x2d')]);_0x1eb1b4[_0x3f68('0x2c')]=qs[_0x3f68('0x2c')](_0xe7a5d5['query'][_0x3f68('0x2c')]);}return _0x6afcec[_0x3f68('0x54')](_0x1eb1b4);}})['then'](function(_0x3280ee){if(_0x3280ee){return _0x3280ee?{'count':_0x553179,'rows':_0x3280ee}:null;}})[_0x3f68('0x31')](respondWithResult(_0x84eff1,null))['catch'](handleError(_0x84eff1,null));};exports[_0x3f68('0x5a')]=function(_0x44e137,_0x53eb62,_0x3900b3){if(_0x44e137[_0x3f68('0x51')]['id']){delete _0x44e137[_0x3f68('0x51')]['id'];}return db[_0x3f68('0x37')][_0x3f68('0x55')]({'where':{'id':_0x44e137[_0x3f68('0x4f')]['id']}})[_0x3f68('0x31')](handleEntityNotFound(_0x53eb62,null))['then'](function(_0x1462e4){if(_0x1462e4){_0x44e137[_0x3f68('0x51')][_0x3f68('0x5b')]=_0x1462e4['id'];_0x44e137[_0x3f68('0x51')][_0x3f68('0x5c')]=integrations[_0x3f68('0x5d')](_0x44e137['body'][_0x3f68('0x5e')],_0x44e137[_0x3f68('0x51')][_0x3f68('0x47')]);_0x44e137['body'][_0x3f68('0x5f')]=integrations[_0x3f68('0x60')](_0x44e137[_0x3f68('0x51')]['channel'],_0x44e137[_0x3f68('0x51')][_0x3f68('0x47')]);return db['SugarcrmConfiguration'][_0x3f68('0x50')](_0x44e137[_0x3f68('0x51')],{'include':[{'model':db['SugarcrmField'],'as':_0x3f68('0x5c')},{'model':db[_0x3f68('0x61')],'as':'Descriptions'}]});}return null;})[_0x3f68('0x31')](respondWithResult(_0x53eb62,null))[_0x3f68('0x26')](handleError(_0x53eb62,null));};exports[_0x3f68('0x62')]=function(_0x4226cd,_0x14e92d,_0x2f73a8){var _0x4a47dc='';var _0x11eb07=['id','name','assigned_user_id','created_by',_0x3f68('0x63'),_0x3f68('0x64'),_0x3f68('0x65'),_0x3f68('0x66'),_0x3f68('0x67'),_0x3f68('0x68'),_0x3f68('0x69'),_0x3f68('0x6a')];return db[_0x3f68('0x37')][_0x3f68('0x55')]({'where':{'id':_0x4226cd[_0x3f68('0x4f')]['id']},'attributes':['id',_0x3f68('0x6b'),_0x3f68('0x6c'),'remoteUri']})[_0x3f68('0x31')](handleEntityNotFound(_0x14e92d,null))[_0x3f68('0x31')](function(_0x3d650d){if(_0x3d650d){_0x4a47dc=_0x3d650d[_0x3f68('0x6d')];var _0x11fb84=_0x4a47dc[_0x3f68('0x6e')](-0x1);if(_0x11fb84==='/'){_0x4a47dc=_0x4a47dc[_0x3f68('0x6f')](0x0,_0x4a47dc[_0x3f68('0x70')](_0x11fb84));}return rp({'method':'POST','uri':util[_0x3f68('0x71')]('%s%s',_0x4a47dc,_0x3f68('0x72')),'json':!![],'form':{'method':_0x3f68('0x73'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x3f68('0x20')]({'user_auth':{'user_name':_0x3d650d[_0x3f68('0x6b')],'password':_0x3d650d[_0x3f68('0x6c')],'encryption':'PLAIN'},'application':_0x3f68('0x74')})}});}})[_0x3f68('0x31')](function(_0x280e54){if(_0x280e54&&_0x280e54['name']!=='Invalid\x20Login'&&_0x280e54[_0x3f68('0x34')]!==_0x3f68('0x75')){return rp({'method':_0x3f68('0x76'),'uri':util[_0x3f68('0x71')]('%s%s',_0x4a47dc,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x3f68('0x77'),'input_type':'JSON','response_type':_0x3f68('0x78'),'rest_data':JSON[_0x3f68('0x20')]({'session':_0x280e54['id'],'module_name':_0x3f68('0x79')})}})[_0x3f68('0x31')](function(_0xf5afaf){if(_0xf5afaf){var _0x125aef=_[_0x3f68('0x7a')](_0xf5afaf[_0x3f68('0x7b')]);_['remove'](_0x125aef,function(_0x12ed8a){return _0x11eb07[_0x3f68('0x7c')](_0x12ed8a['name']);});return{'count':_0x125aef[_0x3f68('0x3f')],'rows':_['map'](_0x125aef,function(_0x542e42){return{'id':_0x542e42[_0x3f68('0x34')],'name':_0x542e42[_0x3f68('0x7d')],'custom':_[_0x3f68('0x7e')](_0x542e42[_0x3f68('0x34')],'_c')?!![]:![],'options':_0x542e42[_0x3f68('0x49')]?_[_0x3f68('0x58')](_[_0x3f68('0x7a')](_0x542e42[_0x3f68('0x49')]),function(_0x127593){return{'name':_0x127593['value'],'value':_0x127593[_0x3f68('0x34')]};}):[]};})};}})['then'](respondWithResult(_0x14e92d,null))[_0x3f68('0x26')](function(_0x3fd192){var _0x3eb062=_0x4226cd['query'][_0x3f68('0x1a')]?0x1f4:_0x3fd192[_0x3f68('0x7f')]||0x1f4;logger[_0x3f68('0x21')]('getFields,\x20%s,\x20%s,\x20%s',_0x3f68('0x62'),_0x3eb062,JSON[_0x3f68('0x20')](_0x3fd192));delete _0x3fd192[_0x3f68('0x34')];if(_0x3eb062===0x191){_0x3eb062=0x190;}_0x14e92d[_0x3f68('0x28')](_0x3eb062)[_0x3f68('0x35')](_0x4226cd[_0x3f68('0x39')]['test']?{'message':_0x3f68('0x80'),'statusCode':_0x3fd192['statusCode']}:_0x3fd192);});}else{var _0x1fd88f=0x1f4;_0x14e92d[_0x3f68('0x28')](_0x1fd88f)[_0x3f68('0x35')]({'message':_0x3f68('0x80'),'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 a2c7ead..406ade9 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 _0xdbfe=['path','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x460577,_0x42c272){var _0x3b35af=function(_0x537a2f){while(--_0x537a2f){_0x460577['push'](_0x460577['shift']());}};_0x3b35af(++_0x42c272);}(_0xdbfe,0x174));var _0xedbf=function(_0x23726b,_0x4b6e51){_0x23726b=_0x23726b-0x0;var _0x468c2d=_0xdbfe[_0x23726b];return _0x468c2d;};'use strict';var _=require(_0xedbf('0x0'));var util=require(_0xedbf('0x1'));var logger=require(_0xedbf('0x2'))(_0xedbf('0x3'));var moment=require('moment');var BPromise=require(_0xedbf('0x4'));var rp=require(_0xedbf('0x5'));var fs=require('fs');var path=require(_0xedbf('0x6'));var rimraf=require(_0xedbf('0x7'));var config=require('../../config/environment');var attributes=require(_0xedbf('0x8'));var integrations=require(_0xedbf('0x9'));module[_0xedbf('0xa')]=function(_0x3d1b9f,_0x3206e1){return _0x3d1b9f[_0xedbf('0xb')](_0xedbf('0xc'),attributes,{'tableName':_0xedbf('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ebd=['./intSugarcrmAccount.attributes','define','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x522171,_0x18ddb9){var _0x51471d=function(_0xeafdfe){while(--_0xeafdfe){_0x522171['push'](_0x522171['shift']());}};_0x51471d(++_0x18ddb9);}(_0x6ebd,0x6b));var _0xd6eb=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x6ebd[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0xd6eb('0x0'));var util=require(_0xd6eb('0x1'));var logger=require(_0xd6eb('0x2'))(_0xd6eb('0x3'));var moment=require(_0xd6eb('0x4'));var BPromise=require(_0xd6eb('0x5'));var rp=require(_0xd6eb('0x6'));var fs=require('fs');var path=require(_0xd6eb('0x7'));var rimraf=require(_0xd6eb('0x8'));var config=require(_0xd6eb('0x9'));var attributes=require(_0xd6eb('0xa'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0xc6ec55,_0x379719){return _0xc6ec55[_0xd6eb('0xb')]('SugarcrmAccount',attributes,{'tableName':_0xd6eb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 4311e6d..1705dc4 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 _0xbf5f=['message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','model','then','ShowSugarcrmAccount','find','map','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','http','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error'];(function(_0x1414dc,_0x262e6c){var _0x36ba21=function(_0x577214){while(--_0x577214){_0x1414dc['push'](_0x1414dc['shift']());}};_0x36ba21(++_0x262e6c);}(_0xbf5f,0x19d));var _0xfbf5=function(_0x1cb97b,_0x52318b){_0x1cb97b=_0x1cb97b-0x0;var _0x6adf9b=_0xbf5f[_0x1cb97b];return _0x6adf9b;};'use strict';var _=require(_0xfbf5('0x0'));var util=require(_0xfbf5('0x1'));var moment=require('moment');var BPromise=require(_0xfbf5('0x2'));var rs=require(_0xfbf5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfbf5('0x4'));var logger=require(_0xfbf5('0x5'))(_0xfbf5('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfbf5('0x7')][_0xfbf5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26e391,_0x13f599,_0x30359d){return new BPromise(function(_0x2ff6f0,_0x4e34d5){return client['request'](_0x26e391,_0x30359d)['then'](function(_0x562be3){logger[_0xfbf5('0x9')](_0xfbf5('0xa'),_0x13f599,_0xfbf5('0xb'));logger[_0xfbf5('0xc')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x13f599,_0xfbf5('0xb'),JSON[_0xfbf5('0xd')](_0x562be3));if(_0x562be3['error']){if(_0x562be3['error'][_0xfbf5('0xe')]===0x1f4){logger[_0xfbf5('0xf')](_0xfbf5('0xa'),_0x13f599,_0x562be3[_0xfbf5('0xf')][_0xfbf5('0x10')]);return _0x4e34d5(_0x562be3[_0xfbf5('0xf')][_0xfbf5('0x10')]);}logger[_0xfbf5('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x13f599,_0x562be3['error'][_0xfbf5('0x10')]);return _0x2ff6f0(_0x562be3[_0xfbf5('0xf')][_0xfbf5('0x10')]);}else{logger[_0xfbf5('0x9')](_0xfbf5('0xa'),_0x13f599,_0xfbf5('0xb'));_0x2ff6f0(_0x562be3[_0xfbf5('0x11')][_0xfbf5('0x10')]);}})[_0xfbf5('0x12')](function(_0x4d433d){logger['error'](_0xfbf5('0xa'),_0x13f599,_0x4d433d);_0x4e34d5(_0x4d433d);});});}exports[_0xfbf5('0x13')]=function(_0x34f6bf){var _0x1b0746=this;return new Promise(function(_0x30ee6d,_0x56f0b0){return db[_0xfbf5('0x14')][_0xfbf5('0x15')]({'raw':_0x34f6bf['options']?_0x34f6bf[_0xfbf5('0x16')][_0xfbf5('0x17')]===undefined?!![]:![]:!![],'where':_0x34f6bf[_0xfbf5('0x16')]?_0x34f6bf[_0xfbf5('0x16')][_0xfbf5('0x18')]||null:null,'attributes':_0x34f6bf[_0xfbf5('0x16')]?_0x34f6bf[_0xfbf5('0x16')][_0xfbf5('0x19')]||null:null,'limit':_0x34f6bf[_0xfbf5('0x16')]?_0x34f6bf[_0xfbf5('0x16')][_0xfbf5('0x1a')]||null:null,'include':_0x34f6bf[_0xfbf5('0x16')]?_0x34f6bf[_0xfbf5('0x16')][_0xfbf5('0x1b')]?_['map'](_0x34f6bf['options']['include'],function(_0xa868ed){return{'model':db[_0xa868ed[_0xfbf5('0x1c')]],'as':_0xa868ed['as'],'attributes':_0xa868ed[_0xfbf5('0x19')],'include':_0xa868ed[_0xfbf5('0x1b')]?_['map'](_0xa868ed['include'],function(_0x1e8537){return{'model':db[_0x1e8537[_0xfbf5('0x1c')]],'as':_0x1e8537['as'],'attributes':_0x1e8537[_0xfbf5('0x19')],'include':_0x1e8537['include']?_['map'](_0x1e8537[_0xfbf5('0x1b')],function(_0x476283){return{'model':db[_0x476283[_0xfbf5('0x1c')]],'as':_0x476283['as'],'attributes':_0x476283[_0xfbf5('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfbf5('0x1d')](function(_0x25ab84){logger[_0xfbf5('0x9')]('GetSugarcrmAccount',_0x34f6bf);logger[_0xfbf5('0xc')]('GetSugarcrmAccount',_0x34f6bf,JSON[_0xfbf5('0xd')](_0x25ab84));_0x30ee6d(_0x25ab84);})['catch'](function(_0x1bf1ef){logger[_0xfbf5('0xf')](_0xfbf5('0x13'),_0x1bf1ef[_0xfbf5('0x10')],_0x34f6bf);_0x56f0b0(_0x1b0746[_0xfbf5('0xf')](0x1f4,_0x1bf1ef[_0xfbf5('0x10')]));});});};exports[_0xfbf5('0x1e')]=function(_0x797b3d){var _0x36c488=this;return new Promise(function(_0xf55ae9,_0x189026){return db[_0xfbf5('0x14')][_0xfbf5('0x1f')]({'raw':_0x797b3d['options']?_0x797b3d['options']['raw']===undefined?!![]:![]:!![],'where':_0x797b3d['options']?_0x797b3d[_0xfbf5('0x16')][_0xfbf5('0x18')]||null:null,'attributes':_0x797b3d[_0xfbf5('0x16')]?_0x797b3d[_0xfbf5('0x16')]['attributes']||null:null,'include':_0x797b3d[_0xfbf5('0x16')]?_0x797b3d[_0xfbf5('0x16')]['include']?_[_0xfbf5('0x20')](_0x797b3d[_0xfbf5('0x16')]['include'],function(_0x45d120){return{'model':db[_0x45d120[_0xfbf5('0x1c')]],'as':_0x45d120['as'],'attributes':_0x45d120[_0xfbf5('0x19')],'include':_0x45d120[_0xfbf5('0x1b')]?_[_0xfbf5('0x20')](_0x45d120[_0xfbf5('0x1b')],function(_0x5197bd){return{'model':db[_0x5197bd[_0xfbf5('0x1c')]],'as':_0x5197bd['as'],'attributes':_0x5197bd[_0xfbf5('0x19')],'include':_0x5197bd[_0xfbf5('0x1b')]?_[_0xfbf5('0x20')](_0x5197bd[_0xfbf5('0x1b')],function(_0x47061d){return{'model':db[_0x47061d[_0xfbf5('0x1c')]],'as':_0x47061d['as'],'attributes':_0x47061d[_0xfbf5('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3af2e0){logger[_0xfbf5('0x9')]('ShowSugarcrmAccount',_0x797b3d);logger['debug'](_0xfbf5('0x1e'),_0x797b3d,JSON[_0xfbf5('0xd')](_0x3af2e0));_0xf55ae9(_0x3af2e0);})[_0xfbf5('0x12')](function(_0xdeab7e){logger[_0xfbf5('0xf')](_0xfbf5('0x1e'),_0xdeab7e['message'],_0x797b3d);_0x189026(_0x36c488[_0xfbf5('0xf')](0x1f4,_0xdeab7e[_0xfbf5('0x10')]));});});}; \ No newline at end of file +var _0x54d4=['GetSugarcrmAccount','findAll','options','raw','where','attributes','include','map','model','ShowSugarcrmAccount','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','SugarcrmAccount,\x20%s,\x20%s','message','info','result','catch'];(function(_0x246119,_0x30a4f3){var _0x59c74f=function(_0x313fb5){while(--_0x313fb5){_0x246119['push'](_0x246119['shift']());}};_0x59c74f(++_0x30a4f3);}(_0x54d4,0x113));var _0x454d=function(_0x3cc479,_0x8c62c3){_0x3cc479=_0x3cc479-0x0;var _0x13a0e6=_0x54d4[_0x3cc479];return _0x13a0e6;};'use strict';var _=require(_0x454d('0x0'));var util=require(_0x454d('0x1'));var moment=require('moment');var BPromise=require(_0x454d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x454d('0x3'));var db=require(_0x454d('0x4'))['db'];var utils=require(_0x454d('0x5'));var logger=require(_0x454d('0x6'))('rpc');var config=require(_0x454d('0x7'));var jayson=require(_0x454d('0x8'));var client=jayson['client'][_0x454d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x118056,_0x43cb66,_0x546447){return new BPromise(function(_0xd3e93d,_0x5a0088){return client[_0x454d('0xa')](_0x118056,_0x546447)[_0x454d('0xb')](function(_0x5f0dc3){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x43cb66,_0x454d('0xc'));logger[_0x454d('0xd')](_0x454d('0xe'),_0x43cb66,_0x454d('0xc'),JSON[_0x454d('0xf')](_0x5f0dc3));if(_0x5f0dc3['error']){if(_0x5f0dc3[_0x454d('0x10')]['code']===0x1f4){logger['error'](_0x454d('0x11'),_0x43cb66,_0x5f0dc3['error'][_0x454d('0x12')]);return _0x5a0088(_0x5f0dc3[_0x454d('0x10')]['message']);}logger[_0x454d('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x43cb66,_0x5f0dc3[_0x454d('0x10')][_0x454d('0x12')]);return _0xd3e93d(_0x5f0dc3[_0x454d('0x10')][_0x454d('0x12')]);}else{logger[_0x454d('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x43cb66,_0x454d('0xc'));_0xd3e93d(_0x5f0dc3[_0x454d('0x14')]['message']);}})[_0x454d('0x15')](function(_0x242333){logger[_0x454d('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x43cb66,_0x242333);_0x5a0088(_0x242333);});});}exports[_0x454d('0x16')]=function(_0x38ff3d){var _0x284bc9=this;return new Promise(function(_0x35115f,_0x27a488){return db['SugarcrmAccount'][_0x454d('0x17')]({'raw':_0x38ff3d[_0x454d('0x18')]?_0x38ff3d[_0x454d('0x18')][_0x454d('0x19')]===undefined?!![]:![]:!![],'where':_0x38ff3d[_0x454d('0x18')]?_0x38ff3d[_0x454d('0x18')][_0x454d('0x1a')]||null:null,'attributes':_0x38ff3d['options']?_0x38ff3d[_0x454d('0x18')][_0x454d('0x1b')]||null:null,'limit':_0x38ff3d[_0x454d('0x18')]?_0x38ff3d[_0x454d('0x18')]['limit']||null:null,'include':_0x38ff3d[_0x454d('0x18')]?_0x38ff3d[_0x454d('0x18')][_0x454d('0x1c')]?_[_0x454d('0x1d')](_0x38ff3d[_0x454d('0x18')][_0x454d('0x1c')],function(_0x3b9a53){return{'model':db[_0x3b9a53[_0x454d('0x1e')]],'as':_0x3b9a53['as'],'attributes':_0x3b9a53[_0x454d('0x1b')],'include':_0x3b9a53[_0x454d('0x1c')]?_[_0x454d('0x1d')](_0x3b9a53[_0x454d('0x1c')],function(_0x58db4a){return{'model':db[_0x58db4a[_0x454d('0x1e')]],'as':_0x58db4a['as'],'attributes':_0x58db4a[_0x454d('0x1b')],'include':_0x58db4a[_0x454d('0x1c')]?_[_0x454d('0x1d')](_0x58db4a['include'],function(_0xf3743b){return{'model':db[_0xf3743b['model']],'as':_0xf3743b['as'],'attributes':_0xf3743b[_0x454d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x454d('0xb')](function(_0x3fe6fe){logger[_0x454d('0x13')](_0x454d('0x16'),_0x38ff3d);logger[_0x454d('0xd')](_0x454d('0x16'),_0x38ff3d,JSON[_0x454d('0xf')](_0x3fe6fe));_0x35115f(_0x3fe6fe);})['catch'](function(_0x3bec06){logger['error'](_0x454d('0x16'),_0x3bec06['message'],_0x38ff3d);_0x27a488(_0x284bc9[_0x454d('0x10')](0x1f4,_0x3bec06['message']));});});};exports[_0x454d('0x1f')]=function(_0x4f138b){var _0x82480d=this;return new Promise(function(_0x482941,_0xdaada8){return db['SugarcrmAccount'][_0x454d('0x20')]({'raw':_0x4f138b[_0x454d('0x18')]?_0x4f138b[_0x454d('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4f138b[_0x454d('0x18')]?_0x4f138b['options'][_0x454d('0x1a')]||null:null,'attributes':_0x4f138b[_0x454d('0x18')]?_0x4f138b['options'][_0x454d('0x1b')]||null:null,'include':_0x4f138b[_0x454d('0x18')]?_0x4f138b[_0x454d('0x18')]['include']?_[_0x454d('0x1d')](_0x4f138b['options'][_0x454d('0x1c')],function(_0x30a8d2){return{'model':db[_0x30a8d2[_0x454d('0x1e')]],'as':_0x30a8d2['as'],'attributes':_0x30a8d2[_0x454d('0x1b')],'include':_0x30a8d2[_0x454d('0x1c')]?_[_0x454d('0x1d')](_0x30a8d2[_0x454d('0x1c')],function(_0x20e3bf){return{'model':db[_0x20e3bf[_0x454d('0x1e')]],'as':_0x20e3bf['as'],'attributes':_0x20e3bf['attributes'],'include':_0x20e3bf[_0x454d('0x1c')]?_['map'](_0x20e3bf[_0x454d('0x1c')],function(_0x54a215){return{'model':db[_0x54a215[_0x454d('0x1e')]],'as':_0x54a215['as'],'attributes':_0x54a215[_0x454d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x454d('0xb')](function(_0x4d3a3c){logger[_0x454d('0x13')](_0x454d('0x1f'),_0x4f138b);logger['debug'](_0x454d('0x1f'),_0x4f138b,JSON['stringify'](_0x4d3a3c));_0x482941(_0x4d3a3c);})[_0x454d('0x15')](function(_0x3e9746){logger[_0x454d('0x10')](_0x454d('0x1f'),_0x3e9746[_0x454d('0x12')],_0x4f138b);_0xdaada8(_0x82480d[_0x454d('0x10')](0x1f4,_0x3e9746[_0x454d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 386b5a4..b889c59 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 _0x4036=['post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x267c52,_0x3c0df3){var _0x46c47b=function(_0x3c3740){while(--_0x3c3740){_0x267c52['push'](_0x267c52['shift']());}};_0x46c47b(++_0x3c0df3);}(_0x4036,0x160));var _0x6403=function(_0x4bafc2,_0x578a80){_0x4bafc2=_0x4bafc2-0x0;var _0x226728=_0x4036[_0x4bafc2];return _0x226728;};'use strict';var multer=require(_0x6403('0x0'));var util=require(_0x6403('0x1'));var path=require(_0x6403('0x2'));var timeout=require(_0x6403('0x3'));var express=require('express');var router=express[_0x6403('0x4')]();var auth=require(_0x6403('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6403('0x6'));var controller=require(_0x6403('0x7'));router[_0x6403('0x8')]('/',auth[_0x6403('0x9')](),controller[_0x6403('0xa')]);router['get']('/:id',auth[_0x6403('0x9')](),controller[_0x6403('0xb')]);router[_0x6403('0x8')]('/:id/fields',auth[_0x6403('0x9')](),controller['getFields']);router[_0x6403('0x8')](_0x6403('0xc'),auth[_0x6403('0x9')](),controller[_0x6403('0xd')]);router[_0x6403('0x8')](_0x6403('0xe'),auth[_0x6403('0x9')](),controller[_0x6403('0xf')]);router[_0x6403('0x10')]('/',auth[_0x6403('0x9')](),controller[_0x6403('0x11')]);router[_0x6403('0x12')](_0x6403('0x13'),auth[_0x6403('0x9')](),controller['update']);router[_0x6403('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x6403('0x15')]);module[_0x6403('0x16')]=router; \ No newline at end of file +var _0x805f=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','exports','multer'];(function(_0x334e9b,_0x3b3a1e){var _0x45599f=function(_0x2b20eb){while(--_0x2b20eb){_0x334e9b['push'](_0x334e9b['shift']());}};_0x45599f(++_0x3b3a1e);}(_0x805f,0x110));var _0xf805=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x805f[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0xf805('0x0'));var util=require(_0xf805('0x1'));var path=require(_0xf805('0x2'));var timeout=require(_0xf805('0x3'));var express=require(_0xf805('0x4'));var router=express['Router']();var auth=require(_0xf805('0x5'));var interaction=require(_0xf805('0x6'));var config=require(_0xf805('0x7'));var controller=require('./intSugarcrmConfiguration.controller');router[_0xf805('0x8')]('/',auth[_0xf805('0x9')](),controller[_0xf805('0xa')]);router[_0xf805('0x8')](_0xf805('0xb'),auth[_0xf805('0x9')](),controller[_0xf805('0xc')]);router[_0xf805('0x8')]('/:id/fields',auth[_0xf805('0x9')](),controller[_0xf805('0xd')]);router[_0xf805('0x8')](_0xf805('0xe'),auth[_0xf805('0x9')](),controller[_0xf805('0xf')]);router[_0xf805('0x8')](_0xf805('0x10'),auth[_0xf805('0x9')](),controller['getDescriptions']);router[_0xf805('0x11')]('/',auth[_0xf805('0x9')](),controller[_0xf805('0x12')]);router[_0xf805('0x13')](_0xf805('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xf805('0xb'),auth[_0xf805('0x9')](),controller['destroy']);module[_0xf805('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 4e25523..8db4551 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 _0xc45f=['sequelize','exports','STRING'];(function(_0xc8db6b,_0x320abd){var _0x12cb81=function(_0x417540){while(--_0x417540){_0xc8db6b['push'](_0xc8db6b['shift']());}};_0x12cb81(++_0x320abd);}(_0xc45f,0x162));var _0xfc45=function(_0x710353,_0x147326){_0x710353=_0x710353-0x0;var _0x3b1f6c=_0xc45f[_0x710353];return _0x3b1f6c;};'use strict';var Sequelize=require(_0xfc45('0x0'));module[_0xfc45('0x1')]={'name':{'type':Sequelize[_0xfc45('0x2')]},'description':{'type':Sequelize[_0xfc45('0x2')]}}; \ No newline at end of file +var _0x5901=['sequelize','exports','STRING'];(function(_0x5beb90,_0x26e5b5){var _0x5083b7=function(_0x33cd66){while(--_0x33cd66){_0x5beb90['push'](_0x5beb90['shift']());}};_0x5083b7(++_0x26e5b5);}(_0x5901,0x84));var _0x1590=function(_0x2ce52f,_0x31f3a2){_0x2ce52f=_0x2ce52f-0x0;var _0x14d4d1=_0x5901[_0x2ce52f];return _0x14d4d1;};'use strict';var Sequelize=require(_0x1590('0x0'));module[_0x1590('0x1')]={'name':{'type':Sequelize[_0x1590('0x2')]},'description':{'type':Sequelize[_0x1590('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index c9767fe..18c9264 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 _0xe440=['sort','where','map','type','VIRTUAL','field','filter','merge','options','includeAll','include','findAll','rows','show','params','length','find','create','body','destroy','findOne','pick','getFields','getSubjects','SugarcrmField','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../mysqldb','jayson/promise','client','test','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','stack','name','send','SugarcrmConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x4af1c8,_0x227473){var _0x8d66eb=function(_0x2db160){while(--_0x2db160){_0x4af1c8['push'](_0x4af1c8['shift']());}};_0x8d66eb(++_0x227473);}(_0xe440,0xcc));var _0x0e44=function(_0x155fe8,_0x2dc36f){_0x155fe8=_0x155fe8-0x0;var _0x1885f0=_0xe440[_0x155fe8];return _0x1885f0;};'use strict';var pdf=require(_0x0e44('0x0'));var emlformat=require(_0x0e44('0x1'));var rimraf=require(_0x0e44('0x2'));var zipdir=require(_0x0e44('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0e44('0x4'));var moment=require('moment');var BPromise=require(_0x0e44('0x5'));var Mustache=require(_0x0e44('0x6'));var util=require(_0x0e44('0x7'));var path=require(_0x0e44('0x8'));var sox=require(_0x0e44('0x9'));var csv=require('to-csv');var ejs=require(_0x0e44('0xa'));var fs=require('fs');var _=require(_0x0e44('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0e44('0xc'));var deskjs=require(_0x0e44('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0e44('0xe'));var Papa=require(_0x0e44('0xf'));var Redis=require(_0x0e44('0x10'));var authService=require(_0x0e44('0x11'));var qs=require(_0x0e44('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0e44('0x13'));var db=require(_0x0e44('0x14'))['db'];var jayson=require(_0x0e44('0x15'));var client=jayson[_0x0e44('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x402aea,_0x244bf9,_0x2f467e){if(_0x2f467e){var _0x1d8e44=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1d8e44[_0x0e44('0x17')](_0x244bf9)){return _0x402aea;}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 _0x402aea;}}function respondWithRpcPromise(_0x6de37c,_0xd49e81,_0x4f3426,_0x5cd3bb){return new BPromise(function(_0x586c83,_0x6ba348){var _0x72e208=_0x5cd3bb||client;return _0x72e208[_0x0e44('0x18')](_0x6de37c,_0x4f3426)[_0x0e44('0x19')](function(_0x55481b){logger[_0x0e44('0x1a')](_0x0e44('0x1b'),_0xd49e81,_0x0e44('0x1c'));logger[_0x0e44('0x1d')](_0x0e44('0x1e'),_0xd49e81,_0x0e44('0x1c'),JSON['stringify'](_0x55481b));if(_0x55481b[_0x0e44('0x1f')]){if(_0x55481b[_0x0e44('0x1f')][_0x0e44('0x20')]===0x1f4){logger[_0x0e44('0x1f')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xd49e81,_0x55481b[_0x0e44('0x1f')][_0x0e44('0x21')]);return _0x6ba348(_0x55481b['error']['message']);}logger[_0x0e44('0x1f')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xd49e81,_0x55481b[_0x0e44('0x1f')]['message']);return _0x586c83(_0x55481b['error']['message']);}else{logger[_0x0e44('0x1a')](_0x0e44('0x1b'),_0xd49e81,_0x0e44('0x1c'));_0x586c83(_0x55481b[_0x0e44('0x22')][_0x0e44('0x21')]);}})[_0x0e44('0x23')](function(_0x3fb18e){logger[_0x0e44('0x1f')](_0x0e44('0x1b'),_0xd49e81,_0x3fb18e);_0x6ba348(_0x3fb18e);});});}function respondWithStatusCode(_0x3f4090,_0xf3cfec){_0xf3cfec=_0xf3cfec||0xcc;return function(_0x245f14){if(_0x245f14){return _0x3f4090[_0x0e44('0x24')](_0xf3cfec);}return _0x3f4090['status'](_0xf3cfec)[_0x0e44('0x25')]();};}function respondWithResult(_0x1fbd8b,_0x4c5680){_0x4c5680=_0x4c5680||0xc8;return function(_0x5d7eb0){if(_0x5d7eb0){return _0x1fbd8b[_0x0e44('0x26')](_0x4c5680)[_0x0e44('0x27')](_0x5d7eb0);}};}function respondWithFilteredResult(_0x34ef6e,_0x130e3a){return function(_0x10867b){if(_0x10867b){var _0x254b9e=_0x10867b[_0x0e44('0x28')],_0x1fb671=_0x130e3a['offset'],_0x10be6f=_0x130e3a[_0x0e44('0x29')]+_0x130e3a[_0x0e44('0x2a')],_0x1c5878;if(_0x10be6f>=_0x254b9e){_0x10be6f=_0x254b9e;_0x1c5878=0xc8;}else{_0x1c5878=0xce;}_0x34ef6e[_0x0e44('0x26')](_0x1c5878);return _0x34ef6e[_0x0e44('0x2b')]('Content-Range',_0x1fb671+'-'+_0x10be6f+'/'+_0x254b9e)[_0x0e44('0x27')](_0x10867b);}return null;};}function patchUpdates(_0x35a5ad){return function(_0x54fb44){try{jsonpatch[_0x0e44('0x2c')](_0x54fb44,_0x35a5ad,!![]);}catch(_0x5a5d1a){return BPromise[_0x0e44('0x2d')](_0x5a5d1a);}return _0x54fb44[_0x0e44('0x2e')]();};}function saveUpdates(_0x1d5426,_0x25fd3d){return function(_0x4ceafa){if(_0x4ceafa){return _0x4ceafa[_0x0e44('0x2f')](_0x1d5426)['then'](function(_0x273a3b){return _0x273a3b;});}return null;};}function removeEntity(_0x17ce65,_0x54a604){return function(_0x352fed){if(_0x352fed){return _0x352fed['destroy']()['then'](function(){_0x17ce65[_0x0e44('0x26')](0xcc)[_0x0e44('0x25')]();});}};}function handleEntityNotFound(_0x365a84,_0x4679f2){return function(_0x3d6623){if(!_0x3d6623){_0x365a84[_0x0e44('0x24')](0x194);}return _0x3d6623;};}function handleError(_0x5032b4,_0x4dd6f5){_0x4dd6f5=_0x4dd6f5||0x1f4;return function(_0x5b641a){logger[_0x0e44('0x1f')](_0x5b641a[_0x0e44('0x30')]);if(_0x5b641a['name']){delete _0x5b641a[_0x0e44('0x31')];}_0x5032b4[_0x0e44('0x26')](_0x4dd6f5)[_0x0e44('0x32')](_0x5b641a);};}exports['index']=function(_0x3867ed,_0x5be42e){var _0x3a19d5={},_0xfdd1b={},_0xb18f36={'count':0x0,'rows':[]};var _0x35a3da=db[_0x0e44('0x33')][_0x0e44('0x34')];_0xfdd1b[_0x0e44('0x35')]=_[_0x0e44('0x36')](_0x35a3da);_0xfdd1b[_0x0e44('0x37')]=_[_0x0e44('0x36')](_0x3867ed[_0x0e44('0x37')]);_0xfdd1b[_0x0e44('0x38')]=_[_0x0e44('0x39')](_0xfdd1b['model'],_0xfdd1b[_0x0e44('0x37')]);_0x3a19d5[_0x0e44('0x3a')]=_['intersection'](_0xfdd1b[_0x0e44('0x35')],qs[_0x0e44('0x3b')](_0x3867ed[_0x0e44('0x37')][_0x0e44('0x3b')]));_0x3a19d5[_0x0e44('0x3a')]=_0x3a19d5[_0x0e44('0x3a')]['length']?_0x3a19d5[_0x0e44('0x3a')]:_0xfdd1b['model'];if(!_0x3867ed['query'][_0x0e44('0x3c')](_0x0e44('0x3d'))){_0x3a19d5[_0x0e44('0x2a')]=qs[_0x0e44('0x2a')](_0x3867ed[_0x0e44('0x37')]['limit']);_0x3a19d5[_0x0e44('0x29')]=qs['offset'](_0x3867ed['query'][_0x0e44('0x29')]);}_0x3a19d5[_0x0e44('0x3e')]=qs[_0x0e44('0x3f')](_0x3867ed[_0x0e44('0x37')][_0x0e44('0x3f')]);_0x3a19d5[_0x0e44('0x40')]=qs[_0x0e44('0x38')](_['pick'](_0x3867ed[_0x0e44('0x37')],_0xfdd1b[_0x0e44('0x38')]));if(_0x3867ed['query']['filter']){_0x3a19d5[_0x0e44('0x40')]=_['merge'](_0x3a19d5[_0x0e44('0x40')],{'$or':_[_0x0e44('0x41')](_0x35a3da,function(_0x720cef){if(_0x720cef[_0x0e44('0x42')]['key']!==_0x0e44('0x43')){var _0x55779d={};_0x55779d[_0x720cef[_0x0e44('0x44')]]={'$like':'%'+_0x3867ed['query'][_0x0e44('0x45')]+'%'};return _0x55779d;}})});}_0x3a19d5=_[_0x0e44('0x46')]({},_0x3a19d5,_0x3867ed[_0x0e44('0x47')]);var _0x40e804={'where':_0x3a19d5[_0x0e44('0x40')]};return db['SugarcrmConfiguration']['count'](_0x40e804)[_0x0e44('0x19')](function(_0x41bf18){_0xb18f36[_0x0e44('0x28')]=_0x41bf18;if(_0x3867ed[_0x0e44('0x37')][_0x0e44('0x48')]){_0x3a19d5[_0x0e44('0x49')]=[{'all':!![]}];}return db[_0x0e44('0x33')][_0x0e44('0x4a')](_0x3a19d5);})['then'](function(_0x491402){_0xb18f36[_0x0e44('0x4b')]=_0x491402;return _0xb18f36;})[_0x0e44('0x19')](respondWithFilteredResult(_0x5be42e,_0x3a19d5))['catch'](handleError(_0x5be42e,null));};exports[_0x0e44('0x4c')]=function(_0x3a897a,_0x3ec303){var _0x3fce4d={'raw':![],'where':{'id':_0x3a897a[_0x0e44('0x4d')]['id']}},_0x4eacca={};_0x4eacca[_0x0e44('0x35')]=_[_0x0e44('0x36')](db[_0x0e44('0x33')][_0x0e44('0x34')]);_0x4eacca[_0x0e44('0x37')]=_['keys'](_0x3a897a[_0x0e44('0x37')]);_0x4eacca[_0x0e44('0x38')]=_[_0x0e44('0x39')](_0x4eacca['model'],_0x4eacca[_0x0e44('0x37')]);_0x3fce4d['attributes']=_[_0x0e44('0x39')](_0x4eacca['model'],qs[_0x0e44('0x3b')](_0x3a897a[_0x0e44('0x37')][_0x0e44('0x3b')]));_0x3fce4d['attributes']=_0x3fce4d[_0x0e44('0x3a')][_0x0e44('0x4e')]?_0x3fce4d[_0x0e44('0x3a')]:_0x4eacca[_0x0e44('0x35')];if(_0x3a897a[_0x0e44('0x37')][_0x0e44('0x48')]){_0x3fce4d[_0x0e44('0x49')]=[{'all':!![]}];}_0x3fce4d=_[_0x0e44('0x46')]({},_0x3fce4d,_0x3a897a[_0x0e44('0x47')]);return db['SugarcrmConfiguration'][_0x0e44('0x4f')](_0x3fce4d)['then'](handleEntityNotFound(_0x3ec303,null))['then'](respondWithResult(_0x3ec303,null))[_0x0e44('0x23')](handleError(_0x3ec303,null));};exports[_0x0e44('0x50')]=function(_0x5f3aff,_0x3a3270){return db['SugarcrmConfiguration']['create'](_0x5f3aff[_0x0e44('0x51')],{})[_0x0e44('0x19')](respondWithResult(_0x3a3270,0xc9))[_0x0e44('0x23')](handleError(_0x3a3270,null));};exports[_0x0e44('0x2f')]=function(_0x133859,_0xf2705b){if(_0x133859['body']['id']){delete _0x133859['body']['id'];}return db['SugarcrmConfiguration'][_0x0e44('0x4f')]({'where':{'id':_0x133859[_0x0e44('0x4d')]['id']}})[_0x0e44('0x19')](handleEntityNotFound(_0xf2705b,null))[_0x0e44('0x19')](saveUpdates(_0x133859['body'],null))[_0x0e44('0x19')](respondWithResult(_0xf2705b,null))[_0x0e44('0x23')](handleError(_0xf2705b,null));};exports[_0x0e44('0x52')]=function(_0x1ce0f3,_0x34d834){return db[_0x0e44('0x33')][_0x0e44('0x4f')]({'where':{'id':_0x1ce0f3[_0x0e44('0x4d')]['id']}})[_0x0e44('0x19')](handleEntityNotFound(_0x34d834,null))['then'](removeEntity(_0x34d834,null))['catch'](handleError(_0x34d834,null));};exports['getFields']=function(_0x332180,_0x438846,_0xa7b4ce){var _0x26fbaf={};var _0x152d9d={};var _0x280834;var _0x2c3cd0;return db[_0x0e44('0x33')][_0x0e44('0x53')]({'where':{'id':_0x332180[_0x0e44('0x4d')]['id']}})[_0x0e44('0x19')](handleEntityNotFound(_0x438846,null))['then'](function(_0x2bacc5){if(_0x2bacc5){_0x280834=_0x2bacc5;_0x152d9d[_0x0e44('0x35')]=_[_0x0e44('0x36')](db['SugarcrmField']['rawAttributes']);_0x152d9d[_0x0e44('0x37')]=_[_0x0e44('0x36')](_0x332180[_0x0e44('0x37')]);_0x152d9d[_0x0e44('0x38')]=_[_0x0e44('0x39')](_0x152d9d[_0x0e44('0x35')],_0x152d9d[_0x0e44('0x37')]);_0x26fbaf['attributes']=_[_0x0e44('0x39')](_0x152d9d['model'],qs[_0x0e44('0x3b')](_0x332180[_0x0e44('0x37')][_0x0e44('0x3b')]));_0x26fbaf['attributes']=_0x26fbaf[_0x0e44('0x3a')][_0x0e44('0x4e')]?_0x26fbaf[_0x0e44('0x3a')]:_0x152d9d[_0x0e44('0x35')];_0x26fbaf[_0x0e44('0x3e')]=qs[_0x0e44('0x3f')](_0x332180['query'][_0x0e44('0x3f')]);_0x26fbaf[_0x0e44('0x40')]=qs[_0x0e44('0x38')](_[_0x0e44('0x54')](_0x332180['query'],_0x152d9d[_0x0e44('0x38')]));if(_0x332180[_0x0e44('0x37')][_0x0e44('0x45')]){_0x26fbaf[_0x0e44('0x40')]=_[_0x0e44('0x46')](_0x26fbaf['where'],{'$or':_[_0x0e44('0x41')](_0x26fbaf['attributes'],function(_0x4a5608){var _0x11961a={};_0x11961a[_0x4a5608]={'$like':'%'+_0x332180[_0x0e44('0x37')][_0x0e44('0x45')]+'%'};return _0x11961a;})});}_0x26fbaf=_[_0x0e44('0x46')]({},_0x26fbaf,_0x332180[_0x0e44('0x47')]);return _0x280834[_0x0e44('0x55')](_0x26fbaf);}})[_0x0e44('0x19')](function(_0x93f524){if(_0x93f524){_0x2c3cd0=_0x93f524[_0x0e44('0x4e')];if(!_0x332180['query'][_0x0e44('0x3c')](_0x0e44('0x3d'))){_0x26fbaf[_0x0e44('0x2a')]=qs[_0x0e44('0x2a')](_0x332180[_0x0e44('0x37')]['limit']);_0x26fbaf[_0x0e44('0x29')]=qs['offset'](_0x332180[_0x0e44('0x37')][_0x0e44('0x29')]);}return _0x280834[_0x0e44('0x55')](_0x26fbaf);}})['then'](function(_0xc26a0c){if(_0xc26a0c){return _0xc26a0c?{'count':_0x2c3cd0,'rows':_0xc26a0c}:null;}})[_0x0e44('0x19')](respondWithResult(_0x438846,null))[_0x0e44('0x23')](handleError(_0x438846,null));};exports[_0x0e44('0x56')]=function(_0x455ba0,_0x3c0276,_0x534137){var _0x469e16={};var _0x8c3c90={};var _0x2e008f;var _0x2639bc;return db[_0x0e44('0x33')][_0x0e44('0x53')]({'where':{'id':_0x455ba0[_0x0e44('0x4d')]['id']}})[_0x0e44('0x19')](handleEntityNotFound(_0x3c0276,null))['then'](function(_0x1c9775){if(_0x1c9775){_0x2e008f=_0x1c9775;_0x8c3c90['model']=_[_0x0e44('0x36')](db[_0x0e44('0x57')][_0x0e44('0x34')]);_0x8c3c90[_0x0e44('0x37')]=_[_0x0e44('0x36')](_0x455ba0[_0x0e44('0x37')]);_0x8c3c90['filters']=_[_0x0e44('0x39')](_0x8c3c90[_0x0e44('0x35')],_0x8c3c90[_0x0e44('0x37')]);_0x469e16[_0x0e44('0x3a')]=_[_0x0e44('0x39')](_0x8c3c90[_0x0e44('0x35')],qs[_0x0e44('0x3b')](_0x455ba0['query'][_0x0e44('0x3b')]));_0x469e16[_0x0e44('0x3a')]=_0x469e16[_0x0e44('0x3a')][_0x0e44('0x4e')]?_0x469e16[_0x0e44('0x3a')]:_0x8c3c90[_0x0e44('0x35')];_0x469e16[_0x0e44('0x3e')]=qs[_0x0e44('0x3f')](_0x455ba0['query'][_0x0e44('0x3f')]);_0x469e16[_0x0e44('0x40')]=qs[_0x0e44('0x38')](_['pick'](_0x455ba0[_0x0e44('0x37')],_0x8c3c90[_0x0e44('0x38')]));if(_0x455ba0[_0x0e44('0x37')]['filter']){_0x469e16[_0x0e44('0x40')]=_['merge'](_0x469e16[_0x0e44('0x40')],{'$or':_[_0x0e44('0x41')](_0x469e16['attributes'],function(_0x574e6e){var _0x44013c={};_0x44013c[_0x574e6e]={'$like':'%'+_0x455ba0[_0x0e44('0x37')][_0x0e44('0x45')]+'%'};return _0x44013c;})});}_0x469e16=_['merge']({},_0x469e16,_0x455ba0[_0x0e44('0x47')]);return _0x2e008f[_0x0e44('0x56')](_0x469e16);}})[_0x0e44('0x19')](function(_0x16c9b3){if(_0x16c9b3){_0x2639bc=_0x16c9b3[_0x0e44('0x4e')];if(!_0x455ba0[_0x0e44('0x37')]['hasOwnProperty'](_0x0e44('0x3d'))){_0x469e16[_0x0e44('0x2a')]=qs[_0x0e44('0x2a')](_0x455ba0[_0x0e44('0x37')][_0x0e44('0x2a')]);_0x469e16['offset']=qs[_0x0e44('0x29')](_0x455ba0[_0x0e44('0x37')]['offset']);}return _0x2e008f[_0x0e44('0x56')](_0x469e16);}})[_0x0e44('0x19')](function(_0x13d52e){if(_0x13d52e){return _0x13d52e?{'count':_0x2639bc,'rows':_0x13d52e}:null;}})['then'](respondWithResult(_0x3c0276,null))[_0x0e44('0x23')](handleError(_0x3c0276,null));};exports[_0x0e44('0x58')]=function(_0x1477cf,_0x359bc0,_0x14d406){var _0xb40c04={};var _0x102fd8={};var _0x15e031;var _0x3d663f;return db[_0x0e44('0x33')][_0x0e44('0x53')]({'where':{'id':_0x1477cf['params']['id']}})[_0x0e44('0x19')](handleEntityNotFound(_0x359bc0,null))['then'](function(_0x2e6531){if(_0x2e6531){_0x15e031=_0x2e6531;_0x102fd8[_0x0e44('0x35')]=_[_0x0e44('0x36')](db[_0x0e44('0x57')][_0x0e44('0x34')]);_0x102fd8['query']=_[_0x0e44('0x36')](_0x1477cf[_0x0e44('0x37')]);_0x102fd8[_0x0e44('0x38')]=_[_0x0e44('0x39')](_0x102fd8[_0x0e44('0x35')],_0x102fd8['query']);_0xb40c04[_0x0e44('0x3a')]=_[_0x0e44('0x39')](_0x102fd8[_0x0e44('0x35')],qs['fields'](_0x1477cf[_0x0e44('0x37')][_0x0e44('0x3b')]));_0xb40c04[_0x0e44('0x3a')]=_0xb40c04[_0x0e44('0x3a')]['length']?_0xb40c04[_0x0e44('0x3a')]:_0x102fd8[_0x0e44('0x35')];_0xb40c04[_0x0e44('0x3e')]=qs[_0x0e44('0x3f')](_0x1477cf[_0x0e44('0x37')][_0x0e44('0x3f')]);_0xb40c04[_0x0e44('0x40')]=qs[_0x0e44('0x38')](_['pick'](_0x1477cf[_0x0e44('0x37')],_0x102fd8[_0x0e44('0x38')]));if(_0x1477cf['query'][_0x0e44('0x45')]){_0xb40c04[_0x0e44('0x40')]=_[_0x0e44('0x46')](_0xb40c04[_0x0e44('0x40')],{'$or':_[_0x0e44('0x41')](_0xb40c04[_0x0e44('0x3a')],function(_0x268642){var _0x56afe0={};_0x56afe0[_0x268642]={'$like':'%'+_0x1477cf[_0x0e44('0x37')][_0x0e44('0x45')]+'%'};return _0x56afe0;})});}_0xb40c04=_['merge']({},_0xb40c04,_0x1477cf[_0x0e44('0x47')]);return _0x15e031[_0x0e44('0x58')](_0xb40c04);}})[_0x0e44('0x19')](function(_0x379c85){if(_0x379c85){_0x3d663f=_0x379c85[_0x0e44('0x4e')];if(!_0x1477cf[_0x0e44('0x37')][_0x0e44('0x3c')](_0x0e44('0x3d'))){_0xb40c04[_0x0e44('0x2a')]=qs[_0x0e44('0x2a')](_0x1477cf[_0x0e44('0x37')][_0x0e44('0x2a')]);_0xb40c04[_0x0e44('0x29')]=qs[_0x0e44('0x29')](_0x1477cf[_0x0e44('0x37')][_0x0e44('0x29')]);}return _0x15e031[_0x0e44('0x58')](_0xb40c04);}})[_0x0e44('0x19')](function(_0x29ca90){if(_0x29ca90){return _0x29ca90?{'count':_0x3d663f,'rows':_0x29ca90}:null;}})[_0x0e44('0x19')](respondWithResult(_0x359bc0,null))[_0x0e44('0x23')](handleError(_0x359bc0,null));}; \ No newline at end of file +var _0x119f=['SugarcrmConfiguration','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','limit','sort','where','filters','pick','filter','merge','key','VIRTUAL','field','options','includeAll','include','findAll','show','params','create','body','find','getFields','SugarcrmField','map','length','nolimit','getSubjects','order','getDescriptions','findOne','html-pdf','rimraf','request-promise','moment','bluebird','mustache','util','to-csv','ejs','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','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~!@#$%^&-_=+[{]}.','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','json','count','offset','set','Content-Range','reject','save','update','destroy','name','send','index'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x119f,0x77));var _0xf119=function(_0x3ae43c,_0x459183){_0x3ae43c=_0x3ae43c-0x0;var _0xdcb32f=_0x119f[_0x3ae43c];return _0xdcb32f;};'use strict';var pdf=require(_0xf119('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf119('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf119('0x2'));var moment=require(_0xf119('0x3'));var BPromise=require(_0xf119('0x4'));var Mustache=require(_0xf119('0x5'));var util=require(_0xf119('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf119('0x7'));var ejs=require(_0xf119('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf119('0x9'));var Papa=require(_0xf119('0xa'));var Redis=require(_0xf119('0xb'));var authService=require(_0xf119('0xc'));var qs=require(_0xf119('0xd'));var hardwareService=require(_0xf119('0xe'));var logger=require('../../config/logger')('api');var utils=require(_0xf119('0xf'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0xf119('0x10'));var client=jayson[_0xf119('0x11')][_0xf119('0x12')]({'port':0x232a});function checkPasswordPattern(_0x144824,_0x766180,_0x1f2ee8){if(_0x1f2ee8){var _0x5e2209=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e2209['test'](_0x766180)){return _0x144824;}else{throw new Error(_0xf119('0x13'));}}else{return _0x144824;}}function respondWithRpcPromise(_0x4c343a,_0x5ab5ac,_0x4eb6d4,_0x3c4678){return new BPromise(function(_0x4989c6,_0x37fa01){var _0x27e524=_0x3c4678||client;return _0x27e524[_0xf119('0x14')](_0x4c343a,_0x4eb6d4)[_0xf119('0x15')](function(_0x2b9e8f){logger[_0xf119('0x16')](_0xf119('0x17'),_0x5ab5ac,_0xf119('0x18'));logger[_0xf119('0x19')](_0xf119('0x1a'),_0x5ab5ac,_0xf119('0x18'),JSON['stringify'](_0x2b9e8f));if(_0x2b9e8f[_0xf119('0x1b')]){if(_0x2b9e8f['error'][_0xf119('0x1c')]===0x1f4){logger[_0xf119('0x1b')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5ab5ac,_0x2b9e8f['error'][_0xf119('0x1d')]);return _0x37fa01(_0x2b9e8f[_0xf119('0x1b')][_0xf119('0x1d')]);}logger[_0xf119('0x1b')](_0xf119('0x17'),_0x5ab5ac,_0x2b9e8f[_0xf119('0x1b')][_0xf119('0x1d')]);return _0x4989c6(_0x2b9e8f['error'][_0xf119('0x1d')]);}else{logger[_0xf119('0x16')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5ab5ac,_0xf119('0x18'));_0x4989c6(_0x2b9e8f['result'][_0xf119('0x1d')]);}})[_0xf119('0x1e')](function(_0xb753d6){logger[_0xf119('0x1b')](_0xf119('0x17'),_0x5ab5ac,_0xb753d6);_0x37fa01(_0xb753d6);});});}function respondWithStatusCode(_0x162761,_0x650e6e){_0x650e6e=_0x650e6e||0xcc;return function(_0x265fdb){if(_0x265fdb){return _0x162761[_0xf119('0x1f')](_0x650e6e);}return _0x162761[_0xf119('0x20')](_0x650e6e)['end']();};}function respondWithResult(_0x200273,_0x57f490){_0x57f490=_0x57f490||0xc8;return function(_0x1205fc){if(_0x1205fc){return _0x200273[_0xf119('0x20')](_0x57f490)[_0xf119('0x21')](_0x1205fc);}};}function respondWithFilteredResult(_0x144b80,_0x52ff26){return function(_0x55ab57){if(_0x55ab57){var _0x149892=_0x55ab57[_0xf119('0x22')],_0x1f66b9=_0x52ff26[_0xf119('0x23')],_0x419601=_0x52ff26[_0xf119('0x23')]+_0x52ff26['limit'],_0x562b3a;if(_0x419601>=_0x149892){_0x419601=_0x149892;_0x562b3a=0xc8;}else{_0x562b3a=0xce;}_0x144b80[_0xf119('0x20')](_0x562b3a);return _0x144b80[_0xf119('0x24')](_0xf119('0x25'),_0x1f66b9+'-'+_0x419601+'/'+_0x149892)[_0xf119('0x21')](_0x55ab57);}return null;};}function patchUpdates(_0x449d6d){return function(_0x5c7e87){try{jsonpatch['apply'](_0x5c7e87,_0x449d6d,!![]);}catch(_0x3a20b2){return BPromise[_0xf119('0x26')](_0x3a20b2);}return _0x5c7e87[_0xf119('0x27')]();};}function saveUpdates(_0x4c67e8,_0x4cf40c){return function(_0x16b2ae){if(_0x16b2ae){return _0x16b2ae[_0xf119('0x28')](_0x4c67e8)[_0xf119('0x15')](function(_0x875d20){return _0x875d20;});}return null;};}function removeEntity(_0x30641b,_0x57f859){return function(_0xf01b86){if(_0xf01b86){return _0xf01b86[_0xf119('0x29')]()['then'](function(){_0x30641b[_0xf119('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e3c0f,_0x281318){return function(_0xaa04fc){if(!_0xaa04fc){_0x5e3c0f[_0xf119('0x1f')](0x194);}return _0xaa04fc;};}function handleError(_0x2d2bcb,_0x1b41c0){_0x1b41c0=_0x1b41c0||0x1f4;return function(_0x39e442){logger[_0xf119('0x1b')](_0x39e442['stack']);if(_0x39e442[_0xf119('0x2a')]){delete _0x39e442['name'];}_0x2d2bcb[_0xf119('0x20')](_0x1b41c0)[_0xf119('0x2b')](_0x39e442);};}exports[_0xf119('0x2c')]=function(_0xd536b8,_0x8cebe7){var _0x488381={},_0x44fd5e={},_0x8243d5={'count':0x0,'rows':[]};var _0x26c3cc=db[_0xf119('0x2d')][_0xf119('0x2e')];_0x44fd5e[_0xf119('0x2f')]=_[_0xf119('0x30')](_0x26c3cc);_0x44fd5e[_0xf119('0x31')]=_[_0xf119('0x30')](_0xd536b8['query']);_0x44fd5e['filters']=_[_0xf119('0x32')](_0x44fd5e[_0xf119('0x2f')],_0x44fd5e[_0xf119('0x31')]);_0x488381[_0xf119('0x33')]=_[_0xf119('0x32')](_0x44fd5e['model'],qs[_0xf119('0x34')](_0xd536b8[_0xf119('0x31')][_0xf119('0x34')]));_0x488381['attributes']=_0x488381[_0xf119('0x33')]['length']?_0x488381[_0xf119('0x33')]:_0x44fd5e[_0xf119('0x2f')];if(!_0xd536b8['query'][_0xf119('0x35')]('nolimit')){_0x488381[_0xf119('0x36')]=qs[_0xf119('0x36')](_0xd536b8[_0xf119('0x31')][_0xf119('0x36')]);_0x488381[_0xf119('0x23')]=qs[_0xf119('0x23')](_0xd536b8[_0xf119('0x31')][_0xf119('0x23')]);}_0x488381['order']=qs['sort'](_0xd536b8[_0xf119('0x31')][_0xf119('0x37')]);_0x488381[_0xf119('0x38')]=qs[_0xf119('0x39')](_[_0xf119('0x3a')](_0xd536b8['query'],_0x44fd5e[_0xf119('0x39')]));if(_0xd536b8['query'][_0xf119('0x3b')]){_0x488381[_0xf119('0x38')]=_[_0xf119('0x3c')](_0x488381[_0xf119('0x38')],{'$or':_['map'](_0x26c3cc,function(_0x5e7de6){if(_0x5e7de6['type'][_0xf119('0x3d')]!==_0xf119('0x3e')){var _0x126592={};_0x126592[_0x5e7de6[_0xf119('0x3f')]]={'$like':'%'+_0xd536b8['query'][_0xf119('0x3b')]+'%'};return _0x126592;}})});}_0x488381=_[_0xf119('0x3c')]({},_0x488381,_0xd536b8[_0xf119('0x40')]);var _0x2d0b3b={'where':_0x488381[_0xf119('0x38')]};return db[_0xf119('0x2d')][_0xf119('0x22')](_0x2d0b3b)[_0xf119('0x15')](function(_0x56ef85){_0x8243d5[_0xf119('0x22')]=_0x56ef85;if(_0xd536b8[_0xf119('0x31')][_0xf119('0x41')]){_0x488381[_0xf119('0x42')]=[{'all':!![]}];}return db[_0xf119('0x2d')][_0xf119('0x43')](_0x488381);})[_0xf119('0x15')](function(_0x4078fb){_0x8243d5['rows']=_0x4078fb;return _0x8243d5;})[_0xf119('0x15')](respondWithFilteredResult(_0x8cebe7,_0x488381))['catch'](handleError(_0x8cebe7,null));};exports[_0xf119('0x44')]=function(_0x1d34af,_0x28ba27){var _0xc6334a={'raw':![],'where':{'id':_0x1d34af[_0xf119('0x45')]['id']}},_0x315055={};_0x315055['model']=_['keys'](db['SugarcrmConfiguration'][_0xf119('0x2e')]);_0x315055[_0xf119('0x31')]=_[_0xf119('0x30')](_0x1d34af['query']);_0x315055[_0xf119('0x39')]=_[_0xf119('0x32')](_0x315055['model'],_0x315055[_0xf119('0x31')]);_0xc6334a[_0xf119('0x33')]=_[_0xf119('0x32')](_0x315055['model'],qs[_0xf119('0x34')](_0x1d34af[_0xf119('0x31')][_0xf119('0x34')]));_0xc6334a[_0xf119('0x33')]=_0xc6334a[_0xf119('0x33')]['length']?_0xc6334a[_0xf119('0x33')]:_0x315055[_0xf119('0x2f')];if(_0x1d34af['query']['includeAll']){_0xc6334a['include']=[{'all':!![]}];}_0xc6334a=_[_0xf119('0x3c')]({},_0xc6334a,_0x1d34af[_0xf119('0x40')]);return db[_0xf119('0x2d')]['find'](_0xc6334a)[_0xf119('0x15')](handleEntityNotFound(_0x28ba27,null))[_0xf119('0x15')](respondWithResult(_0x28ba27,null))[_0xf119('0x1e')](handleError(_0x28ba27,null));};exports[_0xf119('0x46')]=function(_0x43e97f,_0x3aeac7){return db[_0xf119('0x2d')][_0xf119('0x46')](_0x43e97f[_0xf119('0x47')],{})[_0xf119('0x15')](respondWithResult(_0x3aeac7,0xc9))[_0xf119('0x1e')](handleError(_0x3aeac7,null));};exports[_0xf119('0x28')]=function(_0x48f574,_0x41ecf6){if(_0x48f574[_0xf119('0x47')]['id']){delete _0x48f574[_0xf119('0x47')]['id'];}return db[_0xf119('0x2d')][_0xf119('0x48')]({'where':{'id':_0x48f574[_0xf119('0x45')]['id']}})['then'](handleEntityNotFound(_0x41ecf6,null))[_0xf119('0x15')](saveUpdates(_0x48f574[_0xf119('0x47')],null))[_0xf119('0x15')](respondWithResult(_0x41ecf6,null))['catch'](handleError(_0x41ecf6,null));};exports[_0xf119('0x29')]=function(_0xeca5fb,_0x142a7e){return db['SugarcrmConfiguration'][_0xf119('0x48')]({'where':{'id':_0xeca5fb['params']['id']}})[_0xf119('0x15')](handleEntityNotFound(_0x142a7e,null))['then'](removeEntity(_0x142a7e,null))['catch'](handleError(_0x142a7e,null));};exports[_0xf119('0x49')]=function(_0x235a1f,_0x1ed361,_0x3e0629){var _0x2ccd44={};var _0x2d3ff0={};var _0x3f10b7;var _0x59b925;return db[_0xf119('0x2d')]['findOne']({'where':{'id':_0x235a1f[_0xf119('0x45')]['id']}})[_0xf119('0x15')](handleEntityNotFound(_0x1ed361,null))['then'](function(_0x440870){if(_0x440870){_0x3f10b7=_0x440870;_0x2d3ff0[_0xf119('0x2f')]=_['keys'](db[_0xf119('0x4a')]['rawAttributes']);_0x2d3ff0[_0xf119('0x31')]=_[_0xf119('0x30')](_0x235a1f[_0xf119('0x31')]);_0x2d3ff0[_0xf119('0x39')]=_[_0xf119('0x32')](_0x2d3ff0[_0xf119('0x2f')],_0x2d3ff0[_0xf119('0x31')]);_0x2ccd44[_0xf119('0x33')]=_[_0xf119('0x32')](_0x2d3ff0[_0xf119('0x2f')],qs[_0xf119('0x34')](_0x235a1f[_0xf119('0x31')][_0xf119('0x34')]));_0x2ccd44[_0xf119('0x33')]=_0x2ccd44[_0xf119('0x33')]['length']?_0x2ccd44[_0xf119('0x33')]:_0x2d3ff0[_0xf119('0x2f')];_0x2ccd44['order']=qs['sort'](_0x235a1f[_0xf119('0x31')]['sort']);_0x2ccd44[_0xf119('0x38')]=qs['filters'](_[_0xf119('0x3a')](_0x235a1f['query'],_0x2d3ff0[_0xf119('0x39')]));if(_0x235a1f[_0xf119('0x31')]['filter']){_0x2ccd44['where']=_['merge'](_0x2ccd44[_0xf119('0x38')],{'$or':_[_0xf119('0x4b')](_0x2ccd44[_0xf119('0x33')],function(_0x12a653){var _0x160454={};_0x160454[_0x12a653]={'$like':'%'+_0x235a1f[_0xf119('0x31')][_0xf119('0x3b')]+'%'};return _0x160454;})});}_0x2ccd44=_[_0xf119('0x3c')]({},_0x2ccd44,_0x235a1f[_0xf119('0x40')]);return _0x3f10b7['getFields'](_0x2ccd44);}})[_0xf119('0x15')](function(_0x45a106){if(_0x45a106){_0x59b925=_0x45a106[_0xf119('0x4c')];if(!_0x235a1f[_0xf119('0x31')][_0xf119('0x35')](_0xf119('0x4d'))){_0x2ccd44['limit']=qs['limit'](_0x235a1f[_0xf119('0x31')][_0xf119('0x36')]);_0x2ccd44[_0xf119('0x23')]=qs[_0xf119('0x23')](_0x235a1f[_0xf119('0x31')][_0xf119('0x23')]);}return _0x3f10b7[_0xf119('0x49')](_0x2ccd44);}})[_0xf119('0x15')](function(_0x5d245c){if(_0x5d245c){return _0x5d245c?{'count':_0x59b925,'rows':_0x5d245c}:null;}})[_0xf119('0x15')](respondWithResult(_0x1ed361,null))[_0xf119('0x1e')](handleError(_0x1ed361,null));};exports[_0xf119('0x4e')]=function(_0x5b489a,_0x1637f2,_0x52844c){var _0x14a9e9={};var _0x56acbc={};var _0x3f2248;var _0x348325;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x5b489a[_0xf119('0x45')]['id']}})[_0xf119('0x15')](handleEntityNotFound(_0x1637f2,null))[_0xf119('0x15')](function(_0x3650d1){if(_0x3650d1){_0x3f2248=_0x3650d1;_0x56acbc['model']=_['keys'](db[_0xf119('0x4a')][_0xf119('0x2e')]);_0x56acbc['query']=_[_0xf119('0x30')](_0x5b489a[_0xf119('0x31')]);_0x56acbc['filters']=_[_0xf119('0x32')](_0x56acbc[_0xf119('0x2f')],_0x56acbc[_0xf119('0x31')]);_0x14a9e9['attributes']=_[_0xf119('0x32')](_0x56acbc[_0xf119('0x2f')],qs[_0xf119('0x34')](_0x5b489a[_0xf119('0x31')]['fields']));_0x14a9e9['attributes']=_0x14a9e9[_0xf119('0x33')][_0xf119('0x4c')]?_0x14a9e9['attributes']:_0x56acbc[_0xf119('0x2f')];_0x14a9e9[_0xf119('0x4f')]=qs['sort'](_0x5b489a[_0xf119('0x31')][_0xf119('0x37')]);_0x14a9e9['where']=qs[_0xf119('0x39')](_[_0xf119('0x3a')](_0x5b489a[_0xf119('0x31')],_0x56acbc['filters']));if(_0x5b489a[_0xf119('0x31')]['filter']){_0x14a9e9[_0xf119('0x38')]=_[_0xf119('0x3c')](_0x14a9e9['where'],{'$or':_[_0xf119('0x4b')](_0x14a9e9['attributes'],function(_0x2a5eb7){var _0x19c46f={};_0x19c46f[_0x2a5eb7]={'$like':'%'+_0x5b489a['query'][_0xf119('0x3b')]+'%'};return _0x19c46f;})});}_0x14a9e9=_[_0xf119('0x3c')]({},_0x14a9e9,_0x5b489a['options']);return _0x3f2248['getSubjects'](_0x14a9e9);}})[_0xf119('0x15')](function(_0x510b5c){if(_0x510b5c){_0x348325=_0x510b5c[_0xf119('0x4c')];if(!_0x5b489a[_0xf119('0x31')][_0xf119('0x35')]('nolimit')){_0x14a9e9[_0xf119('0x36')]=qs[_0xf119('0x36')](_0x5b489a[_0xf119('0x31')][_0xf119('0x36')]);_0x14a9e9[_0xf119('0x23')]=qs['offset'](_0x5b489a[_0xf119('0x31')][_0xf119('0x23')]);}return _0x3f2248[_0xf119('0x4e')](_0x14a9e9);}})['then'](function(_0x3497ec){if(_0x3497ec){return _0x3497ec?{'count':_0x348325,'rows':_0x3497ec}:null;}})['then'](respondWithResult(_0x1637f2,null))[_0xf119('0x1e')](handleError(_0x1637f2,null));};exports[_0xf119('0x50')]=function(_0x5df970,_0x105d0c,_0x296b24){var _0x1d5e50={};var _0x146636={};var _0x865845;var _0xc5d28a;return db[_0xf119('0x2d')][_0xf119('0x51')]({'where':{'id':_0x5df970[_0xf119('0x45')]['id']}})[_0xf119('0x15')](handleEntityNotFound(_0x105d0c,null))[_0xf119('0x15')](function(_0x18df7f){if(_0x18df7f){_0x865845=_0x18df7f;_0x146636['model']=_[_0xf119('0x30')](db['SugarcrmField'][_0xf119('0x2e')]);_0x146636[_0xf119('0x31')]=_['keys'](_0x5df970[_0xf119('0x31')]);_0x146636['filters']=_[_0xf119('0x32')](_0x146636['model'],_0x146636[_0xf119('0x31')]);_0x1d5e50[_0xf119('0x33')]=_[_0xf119('0x32')](_0x146636[_0xf119('0x2f')],qs[_0xf119('0x34')](_0x5df970['query'][_0xf119('0x34')]));_0x1d5e50[_0xf119('0x33')]=_0x1d5e50[_0xf119('0x33')]['length']?_0x1d5e50[_0xf119('0x33')]:_0x146636[_0xf119('0x2f')];_0x1d5e50[_0xf119('0x4f')]=qs[_0xf119('0x37')](_0x5df970[_0xf119('0x31')][_0xf119('0x37')]);_0x1d5e50[_0xf119('0x38')]=qs[_0xf119('0x39')](_[_0xf119('0x3a')](_0x5df970[_0xf119('0x31')],_0x146636['filters']));if(_0x5df970['query'][_0xf119('0x3b')]){_0x1d5e50[_0xf119('0x38')]=_[_0xf119('0x3c')](_0x1d5e50[_0xf119('0x38')],{'$or':_['map'](_0x1d5e50[_0xf119('0x33')],function(_0x1bedd4){var _0x285f3d={};_0x285f3d[_0x1bedd4]={'$like':'%'+_0x5df970['query'][_0xf119('0x3b')]+'%'};return _0x285f3d;})});}_0x1d5e50=_['merge']({},_0x1d5e50,_0x5df970[_0xf119('0x40')]);return _0x865845['getDescriptions'](_0x1d5e50);}})[_0xf119('0x15')](function(_0x3f6f73){if(_0x3f6f73){_0xc5d28a=_0x3f6f73[_0xf119('0x4c')];if(!_0x5df970['query'][_0xf119('0x35')](_0xf119('0x4d'))){_0x1d5e50[_0xf119('0x36')]=qs[_0xf119('0x36')](_0x5df970[_0xf119('0x31')][_0xf119('0x36')]);_0x1d5e50[_0xf119('0x23')]=qs[_0xf119('0x23')](_0x5df970[_0xf119('0x31')][_0xf119('0x23')]);}return _0x865845[_0xf119('0x50')](_0x1d5e50);}})[_0xf119('0x15')](function(_0x15aeb1){if(_0x15aeb1){return _0x15aeb1?{'count':_0xc5d28a,'rows':_0x15aeb1}:null;}})[_0xf119('0x15')](respondWithResult(_0x105d0c,null))['catch'](handleError(_0x105d0c,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 555672e..03d5262 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 _0xe96a=['api','moment','request-promise','path','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger'];(function(_0x2f5192,_0x15e251){var _0x2009a2=function(_0x29818c){while(--_0x29818c){_0x2f5192['push'](_0x2f5192['shift']());}};_0x2009a2(++_0x15e251);}(_0xe96a,0x111));var _0xae96=function(_0xf48e32,_0x5193b1){_0xf48e32=_0xf48e32-0x0;var _0x65b3a4=_0xe96a[_0xf48e32];return _0x65b3a4;};'use strict';var _=require(_0xae96('0x0'));var util=require(_0xae96('0x1'));var logger=require(_0xae96('0x2'))(_0xae96('0x3'));var moment=require(_0xae96('0x4'));var BPromise=require('bluebird');var rp=require(_0xae96('0x5'));var fs=require('fs');var path=require(_0xae96('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xae96('0x7'));module[_0xae96('0x8')]=function(_0x23ab15,_0x324ee5){return _0x23ab15[_0xae96('0x9')](_0xae96('0xa'),attributes,{'tableName':_0xae96('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16f6=['SugarcrmConfiguration','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports'];(function(_0x332749,_0x5d5455){var _0x196522=function(_0x15a411){while(--_0x15a411){_0x332749['push'](_0x332749['shift']());}};_0x196522(++_0x5d5455);}(_0x16f6,0x17b));var _0x616f=function(_0x4ed047,_0x460878){_0x4ed047=_0x4ed047-0x0;var _0x5e89d5=_0x16f6[_0x4ed047];return _0x5e89d5;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x616f('0x0'));var fs=require('fs');var path=require(_0x616f('0x1'));var rimraf=require(_0x616f('0x2'));var config=require(_0x616f('0x3'));var attributes=require(_0x616f('0x4'));module[_0x616f('0x5')]=function(_0x3fb7b0,_0x501916){return _0x3fb7b0['define'](_0x616f('0x6'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index b2d1f5b..2ed08b1 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 _0xf8c4=['error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x31cc0e,_0x24ba4c){var _0x144862=function(_0x4d236e){while(--_0x4d236e){_0x31cc0e['push'](_0x31cc0e['shift']());}};_0x144862(++_0x24ba4c);}(_0xf8c4,0x185));var _0x4f8c=function(_0x86b219,_0x43038f){_0x86b219=_0x86b219-0x0;var _0x1f320c=_0xf8c4[_0x86b219];return _0x1f320c;};'use strict';var _=require(_0x4f8c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f8c('0x1'));var rs=require(_0x4f8c('0x2'));var fs=require('fs');var Redis=require(_0x4f8c('0x3'));var db=require(_0x4f8c('0x4'))['db'];var utils=require(_0x4f8c('0x5'));var logger=require(_0x4f8c('0x6'))(_0x4f8c('0x7'));var config=require(_0x4f8c('0x8'));var jayson=require(_0x4f8c('0x9'));var client=jayson[_0x4f8c('0xa')][_0x4f8c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1946e4,_0x243ed3,_0x211e9f){return new BPromise(function(_0x25f2ee,_0x320cfa){return client[_0x4f8c('0xc')](_0x1946e4,_0x211e9f)[_0x4f8c('0xd')](function(_0x2517ec){logger[_0x4f8c('0xe')](_0x4f8c('0xf'),_0x243ed3,'request\x20sent');logger[_0x4f8c('0x10')](_0x4f8c('0x11'),_0x243ed3,_0x4f8c('0x12'),JSON['stringify'](_0x2517ec));if(_0x2517ec[_0x4f8c('0x13')]){if(_0x2517ec[_0x4f8c('0x13')][_0x4f8c('0x14')]===0x1f4){logger['error'](_0x4f8c('0xf'),_0x243ed3,_0x2517ec[_0x4f8c('0x13')][_0x4f8c('0x15')]);return _0x320cfa(_0x2517ec[_0x4f8c('0x13')]['message']);}logger[_0x4f8c('0x13')](_0x4f8c('0xf'),_0x243ed3,_0x2517ec[_0x4f8c('0x13')][_0x4f8c('0x15')]);return _0x25f2ee(_0x2517ec[_0x4f8c('0x13')][_0x4f8c('0x15')]);}else{logger[_0x4f8c('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x243ed3,_0x4f8c('0x12'));_0x25f2ee(_0x2517ec[_0x4f8c('0x16')][_0x4f8c('0x15')]);}})[_0x4f8c('0x17')](function(_0x211a14){logger[_0x4f8c('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x243ed3,_0x211a14);_0x320cfa(_0x211a14);});});} \ No newline at end of file +var _0x454e=['request\x20sent','debug','stringify','error','message','info','result','util','moment','../../config/logger','rpc','../../config/environment','client','http','SugarcrmConfiguration,\x20%s,\x20%s'];(function(_0x2590b5,_0x21e782){var _0x5ed80d=function(_0x3ac620){while(--_0x3ac620){_0x2590b5['push'](_0x2590b5['shift']());}};_0x5ed80d(++_0x21e782);}(_0x454e,0xca));var _0xe454=function(_0x21e78c,_0x436943){_0x21e78c=_0x21e78c-0x0;var _0x56dc51=_0x454e[_0x21e78c];return _0x56dc51;};'use strict';var _=require('lodash');var util=require(_0xe454('0x0'));var moment=require(_0xe454('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe454('0x2'))(_0xe454('0x3'));var config=require(_0xe454('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xe454('0x5')][_0xe454('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x23ecdc,_0x12e31e,_0x5ecba2){return new BPromise(function(_0x3dea00,_0x347870){return client['request'](_0x23ecdc,_0x5ecba2)['then'](function(_0x314e17){logger['info'](_0xe454('0x7'),_0x12e31e,_0xe454('0x8'));logger[_0xe454('0x9')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x12e31e,_0xe454('0x8'),JSON[_0xe454('0xa')](_0x314e17));if(_0x314e17[_0xe454('0xb')]){if(_0x314e17[_0xe454('0xb')]['code']===0x1f4){logger[_0xe454('0xb')](_0xe454('0x7'),_0x12e31e,_0x314e17[_0xe454('0xb')]['message']);return _0x347870(_0x314e17['error'][_0xe454('0xc')]);}logger[_0xe454('0xb')](_0xe454('0x7'),_0x12e31e,_0x314e17[_0xe454('0xb')][_0xe454('0xc')]);return _0x3dea00(_0x314e17[_0xe454('0xb')][_0xe454('0xc')]);}else{logger[_0xe454('0xd')](_0xe454('0x7'),_0x12e31e,_0xe454('0x8'));_0x3dea00(_0x314e17[_0xe454('0xe')][_0xe454('0xc')]);}})['catch'](function(_0x19be9e){logger[_0xe454('0xb')](_0xe454('0x7'),_0x12e31e,_0x19be9e);_0x347870(_0x19be9e);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 7643313..2361057 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 _0xa534=['./intSugarcrmField.controller','index','get','post','isAuthenticated','/:id','delete','destroy','util','path','connect-timeout','../../config/environment'];(function(_0x40d9ec,_0x2e39c8){var _0x3b7afa=function(_0x2437d0){while(--_0x2437d0){_0x40d9ec['push'](_0x40d9ec['shift']());}};_0x3b7afa(++_0x2e39c8);}(_0xa534,0x188));var _0x4a53=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0xa534[_0x2d34d6];return _0x1d3d12;};'use strict';var multer=require('multer');var util=require(_0x4a53('0x0'));var path=require(_0x4a53('0x1'));var timeout=require(_0x4a53('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4a53('0x3'));var controller=require(_0x4a53('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x4a53('0x5')]);router[_0x4a53('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4a53('0x7')]('/',auth[_0x4a53('0x8')](),controller['create']);router['put'](_0x4a53('0x9'),auth[_0x4a53('0x8')](),controller['update']);router[_0x4a53('0xa')](_0x4a53('0x9'),auth[_0x4a53('0x8')](),controller[_0x4a53('0xb')]);module['exports']=router; \ No newline at end of file +var _0x9244=['express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','get','index','/:id','post','isAuthenticated','create','put','update','destroy','exports','multer','util','connect-timeout'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x9244,0x10b));var _0x4924=function(_0x155729,_0x1fc4f7){_0x155729=_0x155729-0x0;var _0x17703e=_0x9244[_0x155729];return _0x17703e;};'use strict';var multer=require(_0x4924('0x0'));var util=require(_0x4924('0x1'));var path=require('path');var timeout=require(_0x4924('0x2'));var express=require(_0x4924('0x3'));var router=express[_0x4924('0x4')]();var auth=require(_0x4924('0x5'));var interaction=require(_0x4924('0x6'));var config=require('../../config/environment');var controller=require(_0x4924('0x7'));router[_0x4924('0x8')]('/',auth['isAuthenticated'](),controller[_0x4924('0x9')]);router[_0x4924('0x8')](_0x4924('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x4924('0xb')]('/',auth[_0x4924('0xc')](),controller[_0x4924('0xd')]);router[_0x4924('0xe')](_0x4924('0xa'),auth[_0x4924('0xc')](),controller[_0x4924('0xf')]);router['delete'](_0x4924('0xa'),auth[_0x4924('0xc')](),controller[_0x4924('0x10')]);module[_0x4924('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 e9a67ac..445e299 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 _0x2750=['sequelize','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0xb4947e,_0x39de27){var _0x2af6df=function(_0x308271){while(--_0x308271){_0xb4947e['push'](_0xb4947e['shift']());}};_0x2af6df(++_0x39de27);}(_0x2750,0x13b));var _0x0275=function(_0xea3338,_0x26674f){_0xea3338=_0xea3338-0x0;var _0x3cedff=_0x2750[_0xea3338];return _0x3cedff;};'use strict';var Sequelize=require(_0x0275('0x0'));module['exports']={'type':{'type':Sequelize[_0x0275('0x1')](_0x0275('0x2'),_0x0275('0x3'),_0x0275('0x4'),_0x0275('0x5')),'defaultValue':_0x0275('0x2')},'content':{'type':Sequelize[_0x0275('0x6')]},'key':{'type':Sequelize[_0x0275('0x6')]},'keyType':{'type':Sequelize[_0x0275('0x1')](_0x0275('0x2'),'variable',_0x0275('0x4'))},'keyContent':{'type':Sequelize[_0x0275('0x6')]},'idField':{'type':Sequelize[_0x0275('0x6')]},'nameField':{'type':Sequelize[_0x0275('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0275('0x6')]}}; \ No newline at end of file +var _0x2dae=['keyValue','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable'];(function(_0xf716f6,_0x15f475){var _0x3484c8=function(_0x252089){while(--_0x252089){_0xf716f6['push'](_0xf716f6['shift']());}};_0x3484c8(++_0x15f475);}(_0x2dae,0xc3));var _0xe2da=function(_0x4c4037,_0x15054b){_0x4c4037=_0x4c4037-0x0;var _0x357862=_0x2dae[_0x4c4037];return _0x357862;};'use strict';var Sequelize=require(_0xe2da('0x0'));module['exports']={'type':{'type':Sequelize[_0xe2da('0x1')](_0xe2da('0x2'),_0xe2da('0x3'),_0xe2da('0x4'),_0xe2da('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xe2da('0x6')]},'key':{'type':Sequelize[_0xe2da('0x6')]},'keyType':{'type':Sequelize[_0xe2da('0x1')](_0xe2da('0x2'),'variable',_0xe2da('0x4'))},'keyContent':{'type':Sequelize[_0xe2da('0x6')]},'idField':{'type':Sequelize[_0xe2da('0x6')]},'nameField':{'type':Sequelize[_0xe2da('0x6')]},'customField':{'type':Sequelize[_0xe2da('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe2da('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 2805a84..619fbd5 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 _0x18c5=['field','count','findAll','rows','catch','rawAttributes','includeAll','include','options','find','create','body','params','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','json','offset','limit','set','save','update','then','destroy','error','name','index','SugarcrmField','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','VIRTUAL'];(function(_0x1097ec,_0x236441){var _0x17b9e0=function(_0x48ec7f){while(--_0x48ec7f){_0x1097ec['push'](_0x1097ec['shift']());}};_0x17b9e0(++_0x236441);}(_0x18c5,0x17b));var _0x518c=function(_0x121b1a,_0x42fdb7){_0x121b1a=_0x121b1a-0x0;var _0x2d89a6=_0x18c5[_0x121b1a];return _0x2d89a6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x518c('0x0'));var rimraf=require(_0x518c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x518c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x518c('0x3'));var util=require(_0x518c('0x4'));var path=require(_0x518c('0x5'));var sox=require(_0x518c('0x6'));var csv=require(_0x518c('0x7'));var ejs=require(_0x518c('0x8'));var fs=require('fs');var _=require(_0x518c('0x9'));var squel=require(_0x518c('0xa'));var crypto=require('crypto');var jsforce=require(_0x518c('0xb'));var deskjs=require(_0x518c('0xc'));var toCsv=require(_0x518c('0x7'));var querystring=require(_0x518c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x518c('0xe'));var qs=require(_0x518c('0xf'));var hardwareService=require(_0x518c('0x10'));var logger=require(_0x518c('0x11'))('api');var utils=require(_0x518c('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44beb9,_0x2de6b4){_0x2de6b4=_0x2de6b4||0xcc;return function(_0xd9f17f){if(_0xd9f17f){return _0x44beb9[_0x518c('0x13')](_0x2de6b4);}return _0x44beb9['status'](_0x2de6b4)['end']();};}function respondWithResult(_0x26af98,_0x67fb6e){_0x67fb6e=_0x67fb6e||0xc8;return function(_0x10fb0a){if(_0x10fb0a){return _0x26af98['status'](_0x67fb6e)[_0x518c('0x14')](_0x10fb0a);}};}function respondWithFilteredResult(_0x180f62,_0x549103){return function(_0x3b2440){if(_0x3b2440){var _0x339857=_0x3b2440['count'],_0x416735=_0x549103[_0x518c('0x15')],_0x244257=_0x549103[_0x518c('0x15')]+_0x549103[_0x518c('0x16')],_0x12a084;if(_0x244257>=_0x339857){_0x244257=_0x339857;_0x12a084=0xc8;}else{_0x12a084=0xce;}_0x180f62['status'](_0x12a084);return _0x180f62[_0x518c('0x17')]('Content-Range',_0x416735+'-'+_0x244257+'/'+_0x339857)[_0x518c('0x14')](_0x3b2440);}return null;};}function patchUpdates(_0x15a0a8){return function(_0x5e90bf){try{jsonpatch['apply'](_0x5e90bf,_0x15a0a8,!![]);}catch(_0x427f8a){return BPromise['reject'](_0x427f8a);}return _0x5e90bf[_0x518c('0x18')]();};}function saveUpdates(_0x5e3935,_0xb99e15){return function(_0x312644){if(_0x312644){return _0x312644[_0x518c('0x19')](_0x5e3935)[_0x518c('0x1a')](function(_0x165255){return _0x165255;});}return null;};}function removeEntity(_0x5f4fa4,_0xf12719){return function(_0x236865){if(_0x236865){return _0x236865[_0x518c('0x1b')]()[_0x518c('0x1a')](function(){_0x5f4fa4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d049d,_0x54e450){return function(_0x3a3890){if(!_0x3a3890){_0x3d049d[_0x518c('0x13')](0x194);}return _0x3a3890;};}function handleError(_0x23b2f2,_0x3c3e8b){_0x3c3e8b=_0x3c3e8b||0x1f4;return function(_0x10de98){logger[_0x518c('0x1c')](_0x10de98['stack']);if(_0x10de98['name']){delete _0x10de98[_0x518c('0x1d')];}_0x23b2f2['status'](_0x3c3e8b)['send'](_0x10de98);};}exports[_0x518c('0x1e')]=function(_0xa75f0a,_0x17c973){var _0x268bbe={},_0x154cf6={},_0x147bf9={'count':0x0,'rows':[]};var _0x5102a6=db[_0x518c('0x1f')]['rawAttributes'];_0x154cf6[_0x518c('0x20')]=_[_0x518c('0x21')](_0x5102a6);_0x154cf6[_0x518c('0x22')]=_[_0x518c('0x21')](_0xa75f0a['query']);_0x154cf6[_0x518c('0x23')]=_[_0x518c('0x24')](_0x154cf6['model'],_0x154cf6['query']);_0x268bbe[_0x518c('0x25')]=_[_0x518c('0x24')](_0x154cf6[_0x518c('0x20')],qs[_0x518c('0x26')](_0xa75f0a[_0x518c('0x22')][_0x518c('0x26')]));_0x268bbe['attributes']=_0x268bbe[_0x518c('0x25')][_0x518c('0x27')]?_0x268bbe[_0x518c('0x25')]:_0x154cf6[_0x518c('0x20')];if(!_0xa75f0a[_0x518c('0x22')][_0x518c('0x28')](_0x518c('0x29'))){_0x268bbe[_0x518c('0x16')]=qs[_0x518c('0x16')](_0xa75f0a['query']['limit']);_0x268bbe[_0x518c('0x15')]=qs['offset'](_0xa75f0a[_0x518c('0x22')][_0x518c('0x15')]);}_0x268bbe['order']=qs[_0x518c('0x2a')](_0xa75f0a[_0x518c('0x22')][_0x518c('0x2a')]);_0x268bbe[_0x518c('0x2b')]=qs[_0x518c('0x23')](_['pick'](_0xa75f0a[_0x518c('0x22')],_0x154cf6[_0x518c('0x23')]));if(_0xa75f0a[_0x518c('0x22')][_0x518c('0x2c')]){_0x268bbe[_0x518c('0x2b')]=_[_0x518c('0x2d')](_0x268bbe[_0x518c('0x2b')],{'$or':_[_0x518c('0x2e')](_0x5102a6,function(_0x4292ae){if(_0x4292ae['type']['key']!==_0x518c('0x2f')){var _0x530032={};_0x530032[_0x4292ae[_0x518c('0x30')]]={'$like':'%'+_0xa75f0a[_0x518c('0x22')][_0x518c('0x2c')]+'%'};return _0x530032;}})});}_0x268bbe=_['merge']({},_0x268bbe,_0xa75f0a['options']);var _0x1f03e8={'where':_0x268bbe[_0x518c('0x2b')]};return db[_0x518c('0x1f')][_0x518c('0x31')](_0x1f03e8)[_0x518c('0x1a')](function(_0x2ba95c){_0x147bf9['count']=_0x2ba95c;if(_0xa75f0a[_0x518c('0x22')]['includeAll']){_0x268bbe['include']=[{'all':!![]}];}return db[_0x518c('0x1f')][_0x518c('0x32')](_0x268bbe);})['then'](function(_0x190b88){_0x147bf9[_0x518c('0x33')]=_0x190b88;return _0x147bf9;})[_0x518c('0x1a')](respondWithFilteredResult(_0x17c973,_0x268bbe))[_0x518c('0x34')](handleError(_0x17c973,null));};exports['show']=function(_0x44f770,_0x160ca1){var _0x49ba0b={'raw':!![],'where':{'id':_0x44f770['params']['id']}},_0x55c53a={};_0x55c53a[_0x518c('0x20')]=_[_0x518c('0x21')](db[_0x518c('0x1f')][_0x518c('0x35')]);_0x55c53a[_0x518c('0x22')]=_['keys'](_0x44f770[_0x518c('0x22')]);_0x55c53a['filters']=_[_0x518c('0x24')](_0x55c53a['model'],_0x55c53a[_0x518c('0x22')]);_0x49ba0b['attributes']=_['intersection'](_0x55c53a['model'],qs[_0x518c('0x26')](_0x44f770[_0x518c('0x22')]['fields']));_0x49ba0b[_0x518c('0x25')]=_0x49ba0b['attributes'][_0x518c('0x27')]?_0x49ba0b['attributes']:_0x55c53a[_0x518c('0x20')];if(_0x44f770[_0x518c('0x22')][_0x518c('0x36')]){_0x49ba0b[_0x518c('0x37')]=[{'all':!![]}];}_0x49ba0b=_[_0x518c('0x2d')]({},_0x49ba0b,_0x44f770[_0x518c('0x38')]);return db[_0x518c('0x1f')][_0x518c('0x39')](_0x49ba0b)[_0x518c('0x1a')](handleEntityNotFound(_0x160ca1,null))[_0x518c('0x1a')](respondWithResult(_0x160ca1,null))[_0x518c('0x34')](handleError(_0x160ca1,null));};exports[_0x518c('0x3a')]=function(_0x5d0079,_0x43ee1d){return db[_0x518c('0x1f')][_0x518c('0x3a')](_0x5d0079[_0x518c('0x3b')],{})[_0x518c('0x1a')](respondWithResult(_0x43ee1d,0xc9))[_0x518c('0x34')](handleError(_0x43ee1d,null));};exports['update']=function(_0x211713,_0x529fcb){if(_0x211713['body']['id']){delete _0x211713['body']['id'];}return db[_0x518c('0x1f')]['find']({'where':{'id':_0x211713[_0x518c('0x3c')]['id']}})[_0x518c('0x1a')](handleEntityNotFound(_0x529fcb,null))['then'](saveUpdates(_0x211713['body'],null))[_0x518c('0x1a')](respondWithResult(_0x529fcb,null))[_0x518c('0x34')](handleError(_0x529fcb,null));};exports['destroy']=function(_0x41a431,_0x108d1f){return db[_0x518c('0x1f')][_0x518c('0x39')]({'where':{'id':_0x41a431[_0x518c('0x3c')]['id']}})[_0x518c('0x1a')](handleEntityNotFound(_0x108d1f,null))[_0x518c('0x1a')](removeEntity(_0x108d1f,null))[_0x518c('0x34')](handleError(_0x108d1f,null));}; \ No newline at end of file +var _0x8eda=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','save','then','destroy','stack','name','SugarcrmField','rawAttributes','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','rows','show','params','catch','create','body','update','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce'];(function(_0x4e0036,_0x293b94){var _0xa28b09=function(_0x25fe1b){while(--_0x25fe1b){_0x4e0036['push'](_0x4e0036['shift']());}};_0xa28b09(++_0x293b94);}(_0x8eda,0xc5));var _0xa8ed=function(_0x2b4c45,_0x4b0b4a){_0x2b4c45=_0x2b4c45-0x0;var _0x1aff0a=_0x8eda[_0x2b4c45];return _0x1aff0a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa8ed('0x0'));var rimraf=require(_0xa8ed('0x1'));var zipdir=require(_0xa8ed('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa8ed('0x3'));var moment=require(_0xa8ed('0x4'));var BPromise=require(_0xa8ed('0x5'));var Mustache=require(_0xa8ed('0x6'));var util=require(_0xa8ed('0x7'));var path=require('path');var sox=require(_0xa8ed('0x8'));var csv=require(_0xa8ed('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xa8ed('0xa'));var crypto=require(_0xa8ed('0xb'));var jsforce=require(_0xa8ed('0xc'));var deskjs=require(_0xa8ed('0xd'));var toCsv=require(_0xa8ed('0x9'));var querystring=require(_0xa8ed('0xe'));var Papa=require(_0xa8ed('0xf'));var Redis=require('ioredis');var authService=require(_0xa8ed('0x10'));var qs=require(_0xa8ed('0x11'));var hardwareService=require(_0xa8ed('0x12'));var logger=require(_0xa8ed('0x13'))(_0xa8ed('0x14'));var utils=require(_0xa8ed('0x15'));var config=require('../../config/environment');var db=require(_0xa8ed('0x16'))['db'];function respondWithStatusCode(_0x6cd7f1,_0x9284bc){_0x9284bc=_0x9284bc||0xcc;return function(_0x973467){if(_0x973467){return _0x6cd7f1[_0xa8ed('0x17')](_0x9284bc);}return _0x6cd7f1[_0xa8ed('0x18')](_0x9284bc)[_0xa8ed('0x19')]();};}function respondWithResult(_0x40f281,_0x3c61c9){_0x3c61c9=_0x3c61c9||0xc8;return function(_0x4c619f){if(_0x4c619f){return _0x40f281[_0xa8ed('0x18')](_0x3c61c9)['json'](_0x4c619f);}};}function respondWithFilteredResult(_0x32d2aa,_0x42ff92){return function(_0xe66020){if(_0xe66020){var _0x4a69e1=_0xe66020[_0xa8ed('0x1a')],_0x4fa172=_0x42ff92[_0xa8ed('0x1b')],_0x2436bd=_0x42ff92[_0xa8ed('0x1b')]+_0x42ff92['limit'],_0x228ca5;if(_0x2436bd>=_0x4a69e1){_0x2436bd=_0x4a69e1;_0x228ca5=0xc8;}else{_0x228ca5=0xce;}_0x32d2aa[_0xa8ed('0x18')](_0x228ca5);return _0x32d2aa['set'](_0xa8ed('0x1c'),_0x4fa172+'-'+_0x2436bd+'/'+_0x4a69e1)[_0xa8ed('0x1d')](_0xe66020);}return null;};}function patchUpdates(_0x549d3d){return function(_0x4e4660){try{jsonpatch[_0xa8ed('0x1e')](_0x4e4660,_0x549d3d,!![]);}catch(_0x1aee87){return BPromise[_0xa8ed('0x1f')](_0x1aee87);}return _0x4e4660[_0xa8ed('0x20')]();};}function saveUpdates(_0x39c69c,_0x3daaeb){return function(_0x52174f){if(_0x52174f){return _0x52174f['update'](_0x39c69c)[_0xa8ed('0x21')](function(_0x2baf49){return _0x2baf49;});}return null;};}function removeEntity(_0x35bc72,_0x4d8cc2){return function(_0x3efd43){if(_0x3efd43){return _0x3efd43[_0xa8ed('0x22')]()[_0xa8ed('0x21')](function(){_0x35bc72['status'](0xcc)[_0xa8ed('0x19')]();});}};}function handleEntityNotFound(_0x25098d,_0x5063ec){return function(_0x51daff){if(!_0x51daff){_0x25098d[_0xa8ed('0x17')](0x194);}return _0x51daff;};}function handleError(_0x55d6a7,_0x10a2e3){_0x10a2e3=_0x10a2e3||0x1f4;return function(_0x495d0b){logger['error'](_0x495d0b[_0xa8ed('0x23')]);if(_0x495d0b[_0xa8ed('0x24')]){delete _0x495d0b['name'];}_0x55d6a7['status'](_0x10a2e3)['send'](_0x495d0b);};}exports['index']=function(_0x3b157f,_0x88c8e6){var _0x4332f7={},_0x2fd486={},_0x56b666={'count':0x0,'rows':[]};var _0x13edad=db[_0xa8ed('0x25')][_0xa8ed('0x26')];_0x2fd486[_0xa8ed('0x27')]=_[_0xa8ed('0x28')](_0x13edad);_0x2fd486['query']=_[_0xa8ed('0x28')](_0x3b157f['query']);_0x2fd486[_0xa8ed('0x29')]=_['intersection'](_0x2fd486[_0xa8ed('0x27')],_0x2fd486[_0xa8ed('0x2a')]);_0x4332f7[_0xa8ed('0x2b')]=_[_0xa8ed('0x2c')](_0x2fd486['model'],qs[_0xa8ed('0x2d')](_0x3b157f['query'][_0xa8ed('0x2d')]));_0x4332f7['attributes']=_0x4332f7[_0xa8ed('0x2b')][_0xa8ed('0x2e')]?_0x4332f7[_0xa8ed('0x2b')]:_0x2fd486[_0xa8ed('0x27')];if(!_0x3b157f['query'][_0xa8ed('0x2f')](_0xa8ed('0x30'))){_0x4332f7[_0xa8ed('0x31')]=qs[_0xa8ed('0x31')](_0x3b157f[_0xa8ed('0x2a')][_0xa8ed('0x31')]);_0x4332f7[_0xa8ed('0x1b')]=qs['offset'](_0x3b157f[_0xa8ed('0x2a')][_0xa8ed('0x1b')]);}_0x4332f7[_0xa8ed('0x32')]=qs[_0xa8ed('0x33')](_0x3b157f[_0xa8ed('0x2a')][_0xa8ed('0x33')]);_0x4332f7[_0xa8ed('0x34')]=qs[_0xa8ed('0x29')](_['pick'](_0x3b157f[_0xa8ed('0x2a')],_0x2fd486['filters']));if(_0x3b157f[_0xa8ed('0x2a')][_0xa8ed('0x35')]){_0x4332f7['where']=_[_0xa8ed('0x36')](_0x4332f7['where'],{'$or':_[_0xa8ed('0x37')](_0x13edad,function(_0x344109){if(_0x344109['type'][_0xa8ed('0x38')]!==_0xa8ed('0x39')){var _0x294940={};_0x294940[_0x344109[_0xa8ed('0x3a')]]={'$like':'%'+_0x3b157f[_0xa8ed('0x2a')]['filter']+'%'};return _0x294940;}})});}_0x4332f7=_[_0xa8ed('0x36')]({},_0x4332f7,_0x3b157f[_0xa8ed('0x3b')]);var _0x232d74={'where':_0x4332f7[_0xa8ed('0x34')]};return db[_0xa8ed('0x25')][_0xa8ed('0x1a')](_0x232d74)[_0xa8ed('0x21')](function(_0x565992){_0x56b666[_0xa8ed('0x1a')]=_0x565992;if(_0x3b157f[_0xa8ed('0x2a')][_0xa8ed('0x3c')]){_0x4332f7[_0xa8ed('0x3d')]=[{'all':!![]}];}return db[_0xa8ed('0x25')]['findAll'](_0x4332f7);})[_0xa8ed('0x21')](function(_0x13bca1){_0x56b666[_0xa8ed('0x3e')]=_0x13bca1;return _0x56b666;})[_0xa8ed('0x21')](respondWithFilteredResult(_0x88c8e6,_0x4332f7))['catch'](handleError(_0x88c8e6,null));};exports[_0xa8ed('0x3f')]=function(_0x1bffce,_0xdc0b64){var _0x5e4bb8={'raw':!![],'where':{'id':_0x1bffce[_0xa8ed('0x40')]['id']}},_0x4ce73e={};_0x4ce73e[_0xa8ed('0x27')]=_[_0xa8ed('0x28')](db[_0xa8ed('0x25')][_0xa8ed('0x26')]);_0x4ce73e[_0xa8ed('0x2a')]=_[_0xa8ed('0x28')](_0x1bffce['query']);_0x4ce73e[_0xa8ed('0x29')]=_[_0xa8ed('0x2c')](_0x4ce73e[_0xa8ed('0x27')],_0x4ce73e[_0xa8ed('0x2a')]);_0x5e4bb8[_0xa8ed('0x2b')]=_['intersection'](_0x4ce73e['model'],qs[_0xa8ed('0x2d')](_0x1bffce['query'][_0xa8ed('0x2d')]));_0x5e4bb8['attributes']=_0x5e4bb8[_0xa8ed('0x2b')][_0xa8ed('0x2e')]?_0x5e4bb8[_0xa8ed('0x2b')]:_0x4ce73e[_0xa8ed('0x27')];if(_0x1bffce['query'][_0xa8ed('0x3c')]){_0x5e4bb8['include']=[{'all':!![]}];}_0x5e4bb8=_[_0xa8ed('0x36')]({},_0x5e4bb8,_0x1bffce[_0xa8ed('0x3b')]);return db[_0xa8ed('0x25')]['find'](_0x5e4bb8)[_0xa8ed('0x21')](handleEntityNotFound(_0xdc0b64,null))['then'](respondWithResult(_0xdc0b64,null))[_0xa8ed('0x41')](handleError(_0xdc0b64,null));};exports[_0xa8ed('0x42')]=function(_0x53d122,_0x22aba6){return db[_0xa8ed('0x25')][_0xa8ed('0x42')](_0x53d122[_0xa8ed('0x43')],{})[_0xa8ed('0x21')](respondWithResult(_0x22aba6,0xc9))[_0xa8ed('0x41')](handleError(_0x22aba6,null));};exports[_0xa8ed('0x44')]=function(_0x3ab2d5,_0xd5a186){if(_0x3ab2d5[_0xa8ed('0x43')]['id']){delete _0x3ab2d5[_0xa8ed('0x43')]['id'];}return db['SugarcrmField'][_0xa8ed('0x45')]({'where':{'id':_0x3ab2d5[_0xa8ed('0x40')]['id']}})[_0xa8ed('0x21')](handleEntityNotFound(_0xd5a186,null))[_0xa8ed('0x21')](saveUpdates(_0x3ab2d5[_0xa8ed('0x43')],null))[_0xa8ed('0x21')](respondWithResult(_0xd5a186,null))[_0xa8ed('0x41')](handleError(_0xd5a186,null));};exports[_0xa8ed('0x22')]=function(_0x10798a,_0x1e61c6){return db['SugarcrmField'][_0xa8ed('0x45')]({'where':{'id':_0x10798a[_0xa8ed('0x40')]['id']}})[_0xa8ed('0x21')](handleEntityNotFound(_0x1e61c6,null))[_0xa8ed('0x21')](removeEntity(_0x1e61c6,null))['catch'](handleError(_0x1e61c6,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index bf3e255..4272cdf 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 _0x2b03=['idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','int_sugarcrm_fields','sugarcrm_unique_index'];(function(_0x566075,_0xc98385){var _0x9fdd4d=function(_0x2876b3){while(--_0x2876b3){_0x566075['push'](_0x566075['shift']());}};_0x9fdd4d(++_0xc98385);}(_0x2b03,0x14c));var _0x32b0=function(_0x2b128e,_0x9f8dd0){_0x2b128e=_0x2b128e-0x0;var _0x3822a3=_0x2b03[_0x2b128e];return _0x3822a3;};'use strict';var _=require(_0x32b0('0x0'));var util=require(_0x32b0('0x1'));var logger=require(_0x32b0('0x2'))('api');var moment=require(_0x32b0('0x3'));var BPromise=require(_0x32b0('0x4'));var rp=require(_0x32b0('0x5'));var fs=require('fs');var path=require(_0x32b0('0x6'));var rimraf=require(_0x32b0('0x7'));var config=require(_0x32b0('0x8'));var attributes=require(_0x32b0('0x9'));module[_0x32b0('0xa')]=function(_0x3b9e1d,_0x1efff2){return _0x3b9e1d['define']('SugarcrmField',attributes,{'tableName':_0x32b0('0xb'),'paranoid':![],'indexes':[{'name':_0x32b0('0xc'),'fields':[_0x32b0('0xd'),_0x32b0('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xab4c=['rimraf','exports','define','int_sugarcrm_fields','idField','lodash','util','moment','bluebird','path'];(function(_0xe83c31,_0x2bf5ec){var _0x4c8bcd=function(_0x322e28){while(--_0x322e28){_0xe83c31['push'](_0xe83c31['shift']());}};_0x4c8bcd(++_0x2bf5ec);}(_0xab4c,0x1ef));var _0xcab4=function(_0x482e30,_0x11c205){_0x482e30=_0x482e30-0x0;var _0x59bf70=_0xab4c[_0x482e30];return _0x59bf70;};'use strict';var _=require(_0xcab4('0x0'));var util=require(_0xcab4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcab4('0x2'));var BPromise=require(_0xcab4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcab4('0x4'));var rimraf=require(_0xcab4('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmField.attributes');module[_0xcab4('0x6')]=function(_0x51d282,_0x3bfac0){return _0x51d282[_0xcab4('0x7')]('SugarcrmField',attributes,{'tableName':_0xcab4('0x8'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xcab4('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index fd1d355..b4d5940 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 _0xb187=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird'];(function(_0x5401ae,_0x5e58ac){var _0x286068=function(_0x2cac88){while(--_0x2cac88){_0x5401ae['push'](_0x5401ae['shift']());}};_0x286068(++_0x5e58ac);}(_0xb187,0x173));var _0x7b18=function(_0x43cd8c,_0x53b715){_0x43cd8c=_0x43cd8c-0x0;var _0x4f879e=_0xb187[_0x43cd8c];return _0x4f879e;};'use strict';var _=require(_0x7b18('0x0'));var util=require('util');var moment=require(_0x7b18('0x1'));var BPromise=require(_0x7b18('0x2'));var rs=require(_0x7b18('0x3'));var fs=require('fs');var Redis=require(_0x7b18('0x4'));var db=require(_0x7b18('0x5'))['db'];var utils=require(_0x7b18('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x7b18('0x7'));var jayson=require(_0x7b18('0x8'));var client=jayson[_0x7b18('0x9')][_0x7b18('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10921b,_0x301725,_0x187955){return new BPromise(function(_0x29213a,_0x155d10){return client['request'](_0x10921b,_0x187955)[_0x7b18('0xb')](function(_0x33c1c4){logger[_0x7b18('0xc')](_0x7b18('0xd'),_0x301725,_0x7b18('0xe'));logger[_0x7b18('0xf')](_0x7b18('0x10'),_0x301725,_0x7b18('0xe'),JSON[_0x7b18('0x11')](_0x33c1c4));if(_0x33c1c4[_0x7b18('0x12')]){if(_0x33c1c4['error'][_0x7b18('0x13')]===0x1f4){logger[_0x7b18('0x12')](_0x7b18('0xd'),_0x301725,_0x33c1c4['error'][_0x7b18('0x14')]);return _0x155d10(_0x33c1c4[_0x7b18('0x12')][_0x7b18('0x14')]);}logger[_0x7b18('0x12')](_0x7b18('0xd'),_0x301725,_0x33c1c4['error'][_0x7b18('0x14')]);return _0x29213a(_0x33c1c4[_0x7b18('0x12')][_0x7b18('0x14')]);}else{logger['info']('SugarcrmField,\x20%s,\x20%s',_0x301725,_0x7b18('0xe'));_0x29213a(_0x33c1c4[_0x7b18('0x15')][_0x7b18('0x14')]);}})['catch'](function(_0x52b700){logger[_0x7b18('0x12')](_0x7b18('0xd'),_0x301725,_0x52b700);_0x155d10(_0x52b700);});});} \ No newline at end of file +var _0x0af2=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','SugarcrmField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash'];(function(_0x5b2833,_0x33c626){var _0x323c3b=function(_0x324cb9){while(--_0x324cb9){_0x5b2833['push'](_0x5b2833['shift']());}};_0x323c3b(++_0x33c626);}(_0x0af2,0x18b));var _0x20af=function(_0x512ca6,_0x4db627){_0x512ca6=_0x512ca6-0x0;var _0x590e38=_0x0af2[_0x512ca6];return _0x590e38;};'use strict';var _=require(_0x20af('0x0'));var util=require(_0x20af('0x1'));var moment=require(_0x20af('0x2'));var BPromise=require('bluebird');var rs=require(_0x20af('0x3'));var fs=require('fs');var Redis=require(_0x20af('0x4'));var db=require(_0x20af('0x5'))['db'];var utils=require(_0x20af('0x6'));var logger=require(_0x20af('0x7'))(_0x20af('0x8'));var config=require(_0x20af('0x9'));var jayson=require(_0x20af('0xa'));var client=jayson[_0x20af('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd96a17,_0x565e8b,_0x13d23c){return new BPromise(function(_0x5b59cf,_0x23a976){return client[_0x20af('0xc')](_0xd96a17,_0x13d23c)['then'](function(_0x2f84bb){logger[_0x20af('0xd')](_0x20af('0xe'),_0x565e8b,'request\x20sent');logger[_0x20af('0xf')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x565e8b,_0x20af('0x10'),JSON[_0x20af('0x11')](_0x2f84bb));if(_0x2f84bb[_0x20af('0x12')]){if(_0x2f84bb['error']['code']===0x1f4){logger[_0x20af('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x565e8b,_0x2f84bb[_0x20af('0x12')]['message']);return _0x23a976(_0x2f84bb['error'][_0x20af('0x13')]);}logger[_0x20af('0x12')](_0x20af('0xe'),_0x565e8b,_0x2f84bb[_0x20af('0x12')][_0x20af('0x13')]);return _0x5b59cf(_0x2f84bb['error'][_0x20af('0x13')]);}else{logger[_0x20af('0xd')](_0x20af('0xe'),_0x565e8b,_0x20af('0x10'));_0x5b59cf(_0x2f84bb[_0x20af('0x14')][_0x20af('0x13')]);}})[_0x20af('0x15')](function(_0x36b7d5){logger[_0x20af('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x565e8b,_0x36b7d5);_0x23a976(_0x36b7d5);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 6c6820b..c24fb18 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 _0x18b2=['/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','/:id','update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','show'];(function(_0x4a5438,_0x19aa59){var _0x35a70d=function(_0x42b805){while(--_0x42b805){_0x4a5438['push'](_0x4a5438['shift']());}};_0x35a70d(++_0x19aa59);}(_0x18b2,0x1a5));var _0x218b=function(_0x2470f4,_0x14116f){_0x2470f4=_0x2470f4-0x0;var _0x2474ad=_0x18b2[_0x2470f4];return _0x2474ad;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x218b('0x0'));var express=require(_0x218b('0x1'));var router=express[_0x218b('0x2')]();var auth=require(_0x218b('0x3'));var interaction=require(_0x218b('0x4'));var config=require(_0x218b('0x5'));var controller=require(_0x218b('0x6'));router[_0x218b('0x7')]('/',auth[_0x218b('0x8')](),controller[_0x218b('0x9')]);router[_0x218b('0x7')]('/:id',auth[_0x218b('0x8')](),controller[_0x218b('0xa')]);router[_0x218b('0x7')](_0x218b('0xb'),auth[_0x218b('0x8')](),controller[_0x218b('0xc')]);router['get'](_0x218b('0xd'),auth['isAuthenticated'](),controller[_0x218b('0xe')]);router['post']('/',auth[_0x218b('0x8')](),controller[_0x218b('0xf')]);router[_0x218b('0x10')](_0x218b('0xb'),auth[_0x218b('0x8')](),controller[_0x218b('0x11')]);router[_0x218b('0x12')](_0x218b('0x13'),auth['isAuthenticated'](),controller[_0x218b('0x14')]);router[_0x218b('0x15')](_0x218b('0x13'),auth[_0x218b('0x8')](),controller[_0x218b('0x16')]);module[_0x218b('0x17')]=router; \ No newline at end of file +var _0x1696=['getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','/:id','show'];(function(_0x1ea88d,_0x62eec6){var _0x5d3098=function(_0x3e7327){while(--_0x3e7327){_0x1ea88d['push'](_0x1ea88d['shift']());}};_0x5d3098(++_0x62eec6);}(_0x1696,0x1ad));var _0x6169=function(_0x4372f9,_0x1bfb71){_0x4372f9=_0x4372f9-0x0;var _0x410a78=_0x1696[_0x4372f9];return _0x410a78;};'use strict';var multer=require('multer');var util=require(_0x6169('0x0'));var path=require('path');var timeout=require(_0x6169('0x1'));var express=require(_0x6169('0x2'));var router=express[_0x6169('0x3')]();var auth=require(_0x6169('0x4'));var interaction=require(_0x6169('0x5'));var config=require(_0x6169('0x6'));var controller=require(_0x6169('0x7'));router[_0x6169('0x8')]('/',auth[_0x6169('0x9')](),controller['index']);router['get'](_0x6169('0xa'),auth[_0x6169('0x9')](),controller[_0x6169('0xb')]);router['get']('/:id/configurations',auth[_0x6169('0x9')](),controller[_0x6169('0xc')]);router[_0x6169('0x8')](_0x6169('0xd'),auth[_0x6169('0x9')](),controller[_0x6169('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6169('0xf')]);router[_0x6169('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x6169('0x11')]);router[_0x6169('0x12')](_0x6169('0xa'),auth[_0x6169('0x9')](),controller[_0x6169('0x13')]);router['delete']('/:id',auth[_0x6169('0x9')](),controller['destroy']);module[_0x6169('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index daa5a5d..731cd64 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 _0x20ae=['sequelize','STRING','HelpDesk'];(function(_0xc2f4c4,_0x29ef61){var _0x2b76ae=function(_0x3bb418){while(--_0x3bb418){_0xc2f4c4['push'](_0xc2f4c4['shift']());}};_0x2b76ae(++_0x29ef61);}(_0x20ae,0xd5));var _0xe20a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x20ae[_0x5d2803];return _0xdcad2c;};'use strict';var Sequelize=require(_0xe20a('0x0'));module['exports']={'name':{'type':Sequelize[_0xe20a('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xe20a('0x1')]},'username':{'type':Sequelize[_0xe20a('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xe20a('0x1')],'allowNull':![],'defaultValue':_0xe20a('0x2')},'remoteUri':{'type':Sequelize[_0xe20a('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xe20a('0x1')]},'accessKey':{'type':Sequelize[_0xe20a('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x4ead=['STRING','HelpDesk','sequelize','exports'];(function(_0x547456,_0x1de17e){var _0xc1fd7b=function(_0x12be35){while(--_0x12be35){_0x547456['push'](_0x547456['shift']());}};_0xc1fd7b(++_0x1de17e);}(_0x4ead,0x9e));var _0xd4ea=function(_0x244862,_0x3da79e){_0x244862=_0x244862-0x0;var _0x2bce23=_0x4ead[_0x244862];return _0x2bce23;};'use strict';var Sequelize=require(_0xd4ea('0x0'));module[_0xd4ea('0x1')]={'name':{'type':Sequelize[_0xd4ea('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0xd4ea('0x2')],'allowNull':![],'defaultValue':_0xd4ea('0x3')},'remoteUri':{'type':Sequelize[_0xd4ea('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xd4ea('0x2')]},'accessKey':{'type':Sequelize[_0xd4ea('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index eed3293..bba98de 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 _0xb87a=['username','description','moduleName','remoteUri','serverUrl','accessKey','slice','lastIndexOf','format','GET','getchallenge','login','result','success','sessionName','autogenerated','reference','owner','remove','includes','editable','false','cf_','picklist','picklistValues','label','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','then','destroy','stack','name','send','VtigerAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','map','key','field','filter','options','count','include','findAll','rows','params','length','includeAll','find','create','body','getConfigurations','findOne','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','type','VtigerConfiguration','VtigerField','md5'];(function(_0x54c213,_0x53baa1){var _0x5482c2=function(_0x1746aa){while(--_0x1746aa){_0x54c213['push'](_0x54c213['shift']());}};_0x5482c2(++_0x53baa1);}(_0xb87a,0x117));var _0xab87=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xb87a[_0x3054be];return _0x3df150;};'use strict';var pdf=require(_0xab87('0x0'));var emlformat=require(_0xab87('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xab87('0x2'));var jsonpatch=require(_0xab87('0x3'));var rp=require(_0xab87('0x4'));var moment=require(_0xab87('0x5'));var BPromise=require(_0xab87('0x6'));var Mustache=require('mustache');var util=require(_0xab87('0x7'));var path=require(_0xab87('0x8'));var sox=require(_0xab87('0x9'));var csv=require(_0xab87('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xab87('0xb'));var squel=require(_0xab87('0xc'));var crypto=require(_0xab87('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xab87('0xe'));var toCsv=require(_0xab87('0xa'));var querystring=require(_0xab87('0xf'));var Papa=require(_0xab87('0x10'));var Redis=require(_0xab87('0x11'));var authService=require(_0xab87('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xab87('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xab87('0x14'))['db'];var integrations=require(_0xab87('0x15'));var jayson=require(_0xab87('0x16'));var client=jayson['client'][_0xab87('0x17')]({'port':0x232a});function checkPasswordPattern(_0x5e7adf,_0x57e0a0,_0x4cac1a){if(_0x4cac1a){var _0x14d689=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x14d689[_0xab87('0x18')](_0x57e0a0)){return _0x5e7adf;}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 _0x5e7adf;}}function respondWithRpcPromise(_0x52f0bc,_0x397790,_0x5cfb8c,_0xc1f263){return new BPromise(function(_0x468492,_0x345fbc){var _0x22edd7=_0xc1f263||client;return _0x22edd7['request'](_0x52f0bc,_0x5cfb8c)['then'](function(_0x54712d){logger[_0xab87('0x19')]('VtigerAccount,\x20%s,\x20%s',_0x397790,_0xab87('0x1a'));logger[_0xab87('0x1b')](_0xab87('0x1c'),_0x397790,_0xab87('0x1a'),JSON[_0xab87('0x1d')](_0x54712d));if(_0x54712d['error']){if(_0x54712d[_0xab87('0x1e')][_0xab87('0x1f')]===0x1f4){logger['error'](_0xab87('0x20'),_0x397790,_0x54712d['error']['message']);return _0x345fbc(_0x54712d[_0xab87('0x1e')][_0xab87('0x21')]);}logger[_0xab87('0x1e')]('VtigerAccount,\x20%s,\x20%s',_0x397790,_0x54712d['error'][_0xab87('0x21')]);return _0x468492(_0x54712d[_0xab87('0x1e')][_0xab87('0x21')]);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x397790,'request\x20sent');_0x468492(_0x54712d['result'][_0xab87('0x21')]);}})[_0xab87('0x22')](function(_0x316bf8){logger[_0xab87('0x1e')]('VtigerAccount,\x20%s,\x20%s',_0x397790,_0x316bf8);_0x345fbc(_0x316bf8);});});}function respondWithStatusCode(_0x3a2248,_0x3898f6){_0x3898f6=_0x3898f6||0xcc;return function(_0x326561){if(_0x326561){return _0x3a2248[_0xab87('0x23')](_0x3898f6);}return _0x3a2248[_0xab87('0x24')](_0x3898f6)[_0xab87('0x25')]();};}function respondWithResult(_0x51db58,_0x4fc569){_0x4fc569=_0x4fc569||0xc8;return function(_0x1507c3){if(_0x1507c3){return _0x51db58['status'](_0x4fc569)[_0xab87('0x26')](_0x1507c3);}};}function respondWithFilteredResult(_0x495a11,_0x285c57){return function(_0x5231bd){if(_0x5231bd){var _0x38eb5b=_0x5231bd['count'],_0x741730=_0x285c57[_0xab87('0x27')],_0x53443b=_0x285c57[_0xab87('0x27')]+_0x285c57[_0xab87('0x28')],_0x49b97a;if(_0x53443b>=_0x38eb5b){_0x53443b=_0x38eb5b;_0x49b97a=0xc8;}else{_0x49b97a=0xce;}_0x495a11[_0xab87('0x24')](_0x49b97a);return _0x495a11['set'](_0xab87('0x29'),_0x741730+'-'+_0x53443b+'/'+_0x38eb5b)[_0xab87('0x26')](_0x5231bd);}return null;};}function patchUpdates(_0x4bcee4){return function(_0x41f396){try{jsonpatch[_0xab87('0x2a')](_0x41f396,_0x4bcee4,!![]);}catch(_0x2e8876){return BPromise[_0xab87('0x2b')](_0x2e8876);}return _0x41f396[_0xab87('0x2c')]();};}function saveUpdates(_0x3d3100,_0x5761d4){return function(_0x88f376){if(_0x88f376){return _0x88f376['update'](_0x3d3100)[_0xab87('0x2d')](function(_0x1e2d4a){return _0x1e2d4a;});}return null;};}function removeEntity(_0x78cfe1,_0x2092a1){return function(_0x17f3d8){if(_0x17f3d8){return _0x17f3d8[_0xab87('0x2e')]()[_0xab87('0x2d')](function(){_0x78cfe1['status'](0xcc)[_0xab87('0x25')]();});}};}function handleEntityNotFound(_0x106976,_0x3500f8){return function(_0x512557){if(!_0x512557){_0x106976[_0xab87('0x23')](0x194);}return _0x512557;};}function handleError(_0x2db997,_0x224538){_0x224538=_0x224538||0x1f4;return function(_0x56faad){logger[_0xab87('0x1e')](_0x56faad[_0xab87('0x2f')]);if(_0x56faad[_0xab87('0x30')]){delete _0x56faad[_0xab87('0x30')];}_0x2db997[_0xab87('0x24')](_0x224538)[_0xab87('0x31')](_0x56faad);};}exports['index']=function(_0x27c12d,_0x55b695){var _0x1c0b8b={},_0x310aed={},_0x41668d={'count':0x0,'rows':[]};var _0x60c763=db[_0xab87('0x32')][_0xab87('0x33')];_0x310aed[_0xab87('0x34')]=_[_0xab87('0x35')](_0x60c763);_0x310aed[_0xab87('0x36')]=_[_0xab87('0x35')](_0x27c12d[_0xab87('0x36')]);_0x310aed[_0xab87('0x37')]=_[_0xab87('0x38')](_0x310aed[_0xab87('0x34')],_0x310aed[_0xab87('0x36')]);_0x1c0b8b[_0xab87('0x39')]=_[_0xab87('0x38')](_0x310aed['model'],qs[_0xab87('0x3a')](_0x27c12d[_0xab87('0x36')][_0xab87('0x3a')]));_0x1c0b8b[_0xab87('0x39')]=_0x1c0b8b[_0xab87('0x39')]['length']?_0x1c0b8b['attributes']:_0x310aed['model'];if(!_0x27c12d[_0xab87('0x36')][_0xab87('0x3b')]('nolimit')){_0x1c0b8b[_0xab87('0x28')]=qs[_0xab87('0x28')](_0x27c12d[_0xab87('0x36')][_0xab87('0x28')]);_0x1c0b8b[_0xab87('0x27')]=qs[_0xab87('0x27')](_0x27c12d['query']['offset']);}_0x1c0b8b[_0xab87('0x3c')]=qs[_0xab87('0x3d')](_0x27c12d[_0xab87('0x36')]['sort']);_0x1c0b8b[_0xab87('0x3e')]=qs['filters'](_[_0xab87('0x3f')](_0x27c12d['query'],_0x310aed[_0xab87('0x37')]));if(_0x27c12d[_0xab87('0x36')]['filter']){_0x1c0b8b[_0xab87('0x3e')]=_[_0xab87('0x40')](_0x1c0b8b[_0xab87('0x3e')],{'$or':_[_0xab87('0x41')](_0x60c763,function(_0x1f9478){if(_0x1f9478['type'][_0xab87('0x42')]!=='VIRTUAL'){var _0x1928f7={};_0x1928f7[_0x1f9478[_0xab87('0x43')]]={'$like':'%'+_0x27c12d['query'][_0xab87('0x44')]+'%'};return _0x1928f7;}})});}_0x1c0b8b=_[_0xab87('0x40')]({},_0x1c0b8b,_0x27c12d[_0xab87('0x45')]);var _0x32e799={'where':_0x1c0b8b['where']};return db[_0xab87('0x32')][_0xab87('0x46')](_0x32e799)[_0xab87('0x2d')](function(_0x2a925c){_0x41668d[_0xab87('0x46')]=_0x2a925c;if(_0x27c12d[_0xab87('0x36')]['includeAll']){_0x1c0b8b[_0xab87('0x47')]=[{'all':!![]}];}return db[_0xab87('0x32')][_0xab87('0x48')](_0x1c0b8b);})[_0xab87('0x2d')](function(_0xa829a5){_0x41668d[_0xab87('0x49')]=_0xa829a5;return _0x41668d;})[_0xab87('0x2d')](respondWithFilteredResult(_0x55b695,_0x1c0b8b))[_0xab87('0x22')](handleError(_0x55b695,null));};exports['show']=function(_0xd4f24f,_0xbd1a55){var _0x241020={'raw':![],'where':{'id':_0xd4f24f[_0xab87('0x4a')]['id']}},_0x4717d9={};_0x4717d9['model']=_[_0xab87('0x35')](db[_0xab87('0x32')][_0xab87('0x33')]);_0x4717d9[_0xab87('0x36')]=_['keys'](_0xd4f24f['query']);_0x4717d9[_0xab87('0x37')]=_['intersection'](_0x4717d9[_0xab87('0x34')],_0x4717d9[_0xab87('0x36')]);_0x241020[_0xab87('0x39')]=_[_0xab87('0x38')](_0x4717d9[_0xab87('0x34')],qs['fields'](_0xd4f24f['query'][_0xab87('0x3a')]));_0x241020[_0xab87('0x39')]=_0x241020[_0xab87('0x39')][_0xab87('0x4b')]?_0x241020[_0xab87('0x39')]:_0x4717d9['model'];if(_0xd4f24f[_0xab87('0x36')][_0xab87('0x4c')]){_0x241020[_0xab87('0x47')]=[{'all':!![]}];}_0x241020=_['merge']({},_0x241020,_0xd4f24f[_0xab87('0x45')]);return db[_0xab87('0x32')][_0xab87('0x4d')](_0x241020)[_0xab87('0x2d')](handleEntityNotFound(_0xbd1a55,null))[_0xab87('0x2d')](respondWithResult(_0xbd1a55,null))[_0xab87('0x22')](handleError(_0xbd1a55,null));};exports[_0xab87('0x4e')]=function(_0x109e35,_0x2bd4d0){return db[_0xab87('0x32')]['create'](_0x109e35['body'],{})[_0xab87('0x2d')](respondWithResult(_0x2bd4d0,0xc9))['catch'](handleError(_0x2bd4d0,null));};exports['update']=function(_0x3ade85,_0x29a0e4){if(_0x3ade85[_0xab87('0x4f')]['id']){delete _0x3ade85[_0xab87('0x4f')]['id'];}return db[_0xab87('0x32')][_0xab87('0x4d')]({'where':{'id':_0x3ade85[_0xab87('0x4a')]['id']}})[_0xab87('0x2d')](handleEntityNotFound(_0x29a0e4,null))['then'](saveUpdates(_0x3ade85[_0xab87('0x4f')],null))[_0xab87('0x2d')](respondWithResult(_0x29a0e4,null))[_0xab87('0x22')](handleError(_0x29a0e4,null));};exports[_0xab87('0x2e')]=function(_0x278ad1,_0x5cc698){return db[_0xab87('0x32')]['find']({'where':{'id':_0x278ad1[_0xab87('0x4a')]['id']}})[_0xab87('0x2d')](handleEntityNotFound(_0x5cc698,null))[_0xab87('0x2d')](removeEntity(_0x5cc698,null))[_0xab87('0x22')](handleError(_0x5cc698,null));};exports[_0xab87('0x50')]=function(_0x12c65d,_0x532ab6,_0x45612b){var _0x5e28c8={};var _0xbf812f={};var _0x395efa;var _0xc35294;return db[_0xab87('0x32')][_0xab87('0x51')]({'where':{'id':_0x12c65d[_0xab87('0x4a')]['id']}})[_0xab87('0x2d')](handleEntityNotFound(_0x532ab6,null))['then'](function(_0x5272ed){if(_0x5272ed){_0x395efa=_0x5272ed;_0xbf812f['model']=_[_0xab87('0x35')](db['VtigerConfiguration'][_0xab87('0x33')]);_0xbf812f[_0xab87('0x36')]=_[_0xab87('0x35')](_0x12c65d[_0xab87('0x36')]);_0xbf812f['filters']=_[_0xab87('0x38')](_0xbf812f[_0xab87('0x34')],_0xbf812f[_0xab87('0x36')]);_0x5e28c8['attributes']=_['intersection'](_0xbf812f[_0xab87('0x34')],qs[_0xab87('0x3a')](_0x12c65d[_0xab87('0x36')][_0xab87('0x3a')]));_0x5e28c8[_0xab87('0x39')]=_0x5e28c8['attributes'][_0xab87('0x4b')]?_0x5e28c8[_0xab87('0x39')]:_0xbf812f['model'];_0x5e28c8['order']=qs[_0xab87('0x3d')](_0x12c65d[_0xab87('0x36')]['sort']);_0x5e28c8[_0xab87('0x3e')]=qs[_0xab87('0x37')](_['pick'](_0x12c65d[_0xab87('0x36')],_0xbf812f['filters']));if(_0x12c65d[_0xab87('0x36')][_0xab87('0x44')]){_0x5e28c8['where']=_[_0xab87('0x40')](_0x5e28c8[_0xab87('0x3e')],{'$or':_[_0xab87('0x41')](_0x5e28c8[_0xab87('0x39')],function(_0xda33ea){var _0x518787={};_0x518787[_0xda33ea]={'$like':'%'+_0x12c65d['query'][_0xab87('0x44')]+'%'};return _0x518787;})});}_0x5e28c8=_[_0xab87('0x40')]({},_0x5e28c8,_0x12c65d['options']);return _0x395efa[_0xab87('0x50')](_0x5e28c8);}})[_0xab87('0x2d')](function(_0x3c7003){if(_0x3c7003){_0xc35294=_0x3c7003[_0xab87('0x4b')];if(!_0x12c65d[_0xab87('0x36')]['hasOwnProperty'](_0xab87('0x52'))){_0x5e28c8[_0xab87('0x28')]=qs[_0xab87('0x28')](_0x12c65d[_0xab87('0x36')][_0xab87('0x28')]);_0x5e28c8[_0xab87('0x27')]=qs['offset'](_0x12c65d['query']['offset']);}return _0x395efa[_0xab87('0x50')](_0x5e28c8);}})[_0xab87('0x2d')](function(_0x35a84a){if(_0x35a84a){return _0x35a84a?{'count':_0xc35294,'rows':_0x35a84a}:null;}})['then'](respondWithResult(_0x532ab6,null))['catch'](handleError(_0x532ab6,null));};exports[_0xab87('0x53')]=function(_0x11d7a7,_0x57b6ad,_0x243eaf){if(_0x11d7a7[_0xab87('0x4f')]['id']){delete _0x11d7a7[_0xab87('0x4f')]['id'];}return db[_0xab87('0x32')]['findOne']({'where':{'id':_0x11d7a7[_0xab87('0x4a')]['id']}})[_0xab87('0x2d')](handleEntityNotFound(_0x57b6ad,null))['then'](function(_0x1b043c){if(_0x1b043c){_0x11d7a7['body'][_0xab87('0x54')]=_0x1b043c['id'];_0x11d7a7[_0xab87('0x4f')][_0xab87('0x55')]=integrations['getSubjects'](_0x11d7a7[_0xab87('0x4f')][_0xab87('0x56')],_0x11d7a7[_0xab87('0x4f')]['type']);_0x11d7a7[_0xab87('0x4f')][_0xab87('0x57')]=integrations[_0xab87('0x58')](_0x11d7a7['body'][_0xab87('0x56')],_0x11d7a7[_0xab87('0x4f')][_0xab87('0x59')]);return db[_0xab87('0x5a')][_0xab87('0x4e')](_0x11d7a7[_0xab87('0x4f')],{'include':[{'model':db[_0xab87('0x5b')],'as':_0xab87('0x55')},{'model':db[_0xab87('0x5b')],'as':_0xab87('0x57')}]});}return null;})[_0xab87('0x2d')](respondWithResult(_0x57b6ad,null))[_0xab87('0x22')](handleError(_0x57b6ad,null));};var md5=require(_0xab87('0x5c'));exports['getFields']=function(_0x58b0c7,_0x40195c,_0x4d7fc9){var _0x4e406a=null;var _0x3c5b57=null;var _0x2a48ac=null;var _0x57043c=null;var _0x15c1a7='';return db[_0xab87('0x32')][_0xab87('0x51')]({'where':{'id':_0x58b0c7[_0xab87('0x4a')]['id']},'attributes':['id','name',_0xab87('0x5d'),_0xab87('0x5e'),_0xab87('0x5f'),_0xab87('0x60'),_0xab87('0x61'),_0xab87('0x62')]})[_0xab87('0x2d')](handleEntityNotFound(_0x40195c,null))[_0xab87('0x2d')](function(_0x2be7fe){if(_0x2be7fe){_0x4e406a=_0x2be7fe[_0xab87('0x5d')];_0x3c5b57=_0x2be7fe[_0xab87('0x62')];_0x2a48ac=_0x2be7fe[_0xab87('0x5f')];_0x15c1a7=_0x2be7fe[_0xab87('0x60')];var _0x5b1b27=_0x15c1a7[_0xab87('0x63')](-0x1);if(_0x5b1b27==='/'){_0x15c1a7=_0x15c1a7['substring'](0x0,_0x15c1a7[_0xab87('0x64')](_0x5b1b27));}_0x57043c=util[_0xab87('0x65')]('%s/webservice.php',_0x15c1a7);var _0x11c48a={'method':_0xab87('0x66'),'uri':_0x57043c,'qs':{'operation':_0xab87('0x67'),'username':_0x2be7fe['username']},'json':!![]};return rp(_0x11c48a);}})[_0xab87('0x2d')](function(_0x43ab43){if(_0x43ab43['success']){var _0x3d6570={'method':'POST','uri':_0x57043c,'form':{'operation':_0xab87('0x68'),'username':_0x4e406a,'accessKey':md5(_0x43ab43[_0xab87('0x69')]['token']+_0x3c5b57)},'json':!![]};return rp(_0x3d6570);}})[_0xab87('0x2d')](function(_0x558672){if(_0x558672[_0xab87('0x6a')]){var _0x5d67fc={'method':'GET','uri':_0x57043c,'qs':{'operation':'describe','username':_0x4e406a,'sessionName':_0x558672[_0xab87('0x69')][_0xab87('0x6b')],'elementType':_0x2a48ac},'json':!![]};return rp(_0x5d67fc);}})[_0xab87('0x2d')](function(_0x5613af){if(_0x5613af[_0xab87('0x6a')]){var _0x351b5b=[_0xab87('0x6c'),_0xab87('0x6d'),_0xab87('0x6e')];_[_0xab87('0x6f')](_0x5613af[_0xab87('0x69')][_0xab87('0x3a')],function(_0x1f6b14){return _0x351b5b[_0xab87('0x70')](_0x1f6b14['type'][_0xab87('0x30')]);});_[_0xab87('0x6f')](_0x5613af[_0xab87('0x69')][_0xab87('0x3a')],function(_0x443011){return _0x443011[_0xab87('0x71')]===_0xab87('0x72');});return{'count':_0x5613af['result']['fields'][_0xab87('0x4b')],'rows':_[_0xab87('0x41')](_0x5613af[_0xab87('0x69')]['fields'],function(_0x16bed5){return{'id':_0x16bed5[_0xab87('0x30')],'name':_0x16bed5['label'],'custom':_['startsWith'](_0x16bed5['name'],_0xab87('0x73'))?!![]:![],'options':_0x16bed5['type'][_0xab87('0x30')]===_0xab87('0x74')&&_0x16bed5['type'][_0xab87('0x75')]['length']>0x0?_[_0xab87('0x41')](_0x16bed5[_0xab87('0x59')]['picklistValues'],function(_0xfa2bbb){return{'name':_0xfa2bbb[_0xab87('0x76')],'value':_0xfa2bbb['value']};}):[]};})};}})[_0xab87('0x2d')](respondWithResult(_0x40195c,null))[_0xab87('0x22')](function(_0x2d3ba2){console[_0xab87('0x77')](_0xab87('0x78')+_0x2d3ba2);var _0x4e3cd7=_0x58b0c7[_0xab87('0x36')]['test']?0x1f4:_0x2d3ba2[_0xab87('0x79')]||0x1f4;logger[_0xab87('0x1e')](_0xab87('0x7a'),'getFields',_0x4e3cd7,JSON['stringify'](_0x2d3ba2));delete _0x2d3ba2[_0xab87('0x30')];if(_0x4e3cd7===0x191){_0x4e3cd7=0x190;}_0x40195c[_0xab87('0x24')](_0x4e3cd7)['send'](_0x58b0c7[_0xab87('0x36')][_0xab87('0x18')]?{'message':_0xab87('0x7b'),'statusCode':_0x2d3ba2['statusCode']}:_0x2d3ba2);});}; \ No newline at end of file +var _0x4980=['../../components/integrations/configuration','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','limit','set','Content-Range','reject','update','sendStatus','stack','name','index','VtigerAccount','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','key','VIRTUAL','field','filter','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','keys','find','catch','create','body','destroy','getConfigurations','findOne','VtigerConfiguration','map','addConfiguration','AccountId','Subjects','getSubjects','type','Descriptions','getDescriptions','channel','VtigerField','md5','getFields','username','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','POST','login','success','describe','sessionName','autogenerated','reference','owner','includes','editable','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x5ea6a0,_0x5dd6a4){var _0x26da67=function(_0x1b1e7f){while(--_0x1b1e7f){_0x5ea6a0['push'](_0x5ea6a0['shift']());}};_0x26da67(++_0x5dd6a4);}(_0x4980,0x17c));var _0x0498=function(_0x5e5d39,_0x45c2e9){_0x5e5d39=_0x5e5d39-0x0;var _0x499861=_0x4980[_0x5e5d39];return _0x499861;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0498('0x0'));var rimraf=require(_0x0498('0x1'));var zipdir=require(_0x0498('0x2'));var jsonpatch=require(_0x0498('0x3'));var rp=require(_0x0498('0x4'));var moment=require(_0x0498('0x5'));var BPromise=require(_0x0498('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0498('0x7'));var sox=require('sox');var csv=require(_0x0498('0x8'));var ejs=require(_0x0498('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0498('0xa'));var crypto=require(_0x0498('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0498('0xc'));var toCsv=require(_0x0498('0x8'));var querystring=require(_0x0498('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0498('0xe'));var qs=require(_0x0498('0xf'));var hardwareService=require(_0x0498('0x10'));var logger=require(_0x0498('0x11'))(_0x0498('0x12'));var utils=require(_0x0498('0x13'));var config=require(_0x0498('0x14'));var db=require(_0x0498('0x15'))['db'];var integrations=require(_0x0498('0x16'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0498('0x17')]({'port':0x232a});function checkPasswordPattern(_0x489d1d,_0x5ba1b1,_0x73577){if(_0x73577){var _0x4896c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4896c[_0x0498('0x18')](_0x5ba1b1)){return _0x489d1d;}else{throw new Error(_0x0498('0x19'));}}else{return _0x489d1d;}}function respondWithRpcPromise(_0x586cec,_0x214351,_0x4aa00f,_0x1397b6){return new BPromise(function(_0x400cb4,_0x1a88d6){var _0x58c3ba=_0x1397b6||client;return _0x58c3ba[_0x0498('0x1a')](_0x586cec,_0x4aa00f)[_0x0498('0x1b')](function(_0x33e31f){logger[_0x0498('0x1c')](_0x0498('0x1d'),_0x214351,_0x0498('0x1e'));logger[_0x0498('0x1f')](_0x0498('0x20'),_0x214351,_0x0498('0x1e'),JSON[_0x0498('0x21')](_0x33e31f));if(_0x33e31f[_0x0498('0x22')]){if(_0x33e31f[_0x0498('0x22')][_0x0498('0x23')]===0x1f4){logger['error'](_0x0498('0x1d'),_0x214351,_0x33e31f[_0x0498('0x22')][_0x0498('0x24')]);return _0x1a88d6(_0x33e31f[_0x0498('0x22')]['message']);}logger[_0x0498('0x22')](_0x0498('0x1d'),_0x214351,_0x33e31f[_0x0498('0x22')][_0x0498('0x24')]);return _0x400cb4(_0x33e31f[_0x0498('0x22')]['message']);}else{logger['info'](_0x0498('0x1d'),_0x214351,_0x0498('0x1e'));_0x400cb4(_0x33e31f[_0x0498('0x25')][_0x0498('0x24')]);}})['catch'](function(_0x1cc2f2){logger[_0x0498('0x22')]('VtigerAccount,\x20%s,\x20%s',_0x214351,_0x1cc2f2);_0x1a88d6(_0x1cc2f2);});});}function respondWithStatusCode(_0x3fe017,_0x14ff89){_0x14ff89=_0x14ff89||0xcc;return function(_0x1abf96){if(_0x1abf96){return _0x3fe017['sendStatus'](_0x14ff89);}return _0x3fe017[_0x0498('0x26')](_0x14ff89)[_0x0498('0x27')]();};}function respondWithResult(_0xe9efc9,_0x4a6139){_0x4a6139=_0x4a6139||0xc8;return function(_0x4a630e){if(_0x4a630e){return _0xe9efc9[_0x0498('0x26')](_0x4a6139)[_0x0498('0x28')](_0x4a630e);}};}function respondWithFilteredResult(_0x51e828,_0x296b0e){return function(_0x2e1e27){if(_0x2e1e27){var _0x24c91c=_0x2e1e27['count'],_0x1cb1fd=_0x296b0e[_0x0498('0x29')],_0x3a9249=_0x296b0e[_0x0498('0x29')]+_0x296b0e[_0x0498('0x2a')],_0x4d68a3;if(_0x3a9249>=_0x24c91c){_0x3a9249=_0x24c91c;_0x4d68a3=0xc8;}else{_0x4d68a3=0xce;}_0x51e828[_0x0498('0x26')](_0x4d68a3);return _0x51e828[_0x0498('0x2b')](_0x0498('0x2c'),_0x1cb1fd+'-'+_0x3a9249+'/'+_0x24c91c)['json'](_0x2e1e27);}return null;};}function patchUpdates(_0x38fa22){return function(_0x5c53d2){try{jsonpatch['apply'](_0x5c53d2,_0x38fa22,!![]);}catch(_0x55b9d9){return BPromise[_0x0498('0x2d')](_0x55b9d9);}return _0x5c53d2['save']();};}function saveUpdates(_0x3d52ab,_0x37f968){return function(_0x6ed6a4){if(_0x6ed6a4){return _0x6ed6a4[_0x0498('0x2e')](_0x3d52ab)[_0x0498('0x1b')](function(_0x43863a){return _0x43863a;});}return null;};}function removeEntity(_0x3c0df3,_0x5dce99){return function(_0x2870bb){if(_0x2870bb){return _0x2870bb['destroy']()[_0x0498('0x1b')](function(){_0x3c0df3[_0x0498('0x26')](0xcc)[_0x0498('0x27')]();});}};}function handleEntityNotFound(_0x13f566,_0x38e9ee){return function(_0x538cf1){if(!_0x538cf1){_0x13f566[_0x0498('0x2f')](0x194);}return _0x538cf1;};}function handleError(_0x424d56,_0x32e0d8){_0x32e0d8=_0x32e0d8||0x1f4;return function(_0x182de0){logger[_0x0498('0x22')](_0x182de0[_0x0498('0x30')]);if(_0x182de0['name']){delete _0x182de0[_0x0498('0x31')];}_0x424d56[_0x0498('0x26')](_0x32e0d8)['send'](_0x182de0);};}exports[_0x0498('0x32')]=function(_0x4597f6,_0x48e53c){var _0x49a8a5={},_0x120c0e={},_0x4df19f={'count':0x0,'rows':[]};var _0x140c2f=db[_0x0498('0x33')]['rawAttributes'];_0x120c0e[_0x0498('0x34')]=_['keys'](_0x140c2f);_0x120c0e['query']=_['keys'](_0x4597f6[_0x0498('0x35')]);_0x120c0e[_0x0498('0x36')]=_[_0x0498('0x37')](_0x120c0e[_0x0498('0x34')],_0x120c0e['query']);_0x49a8a5[_0x0498('0x38')]=_[_0x0498('0x37')](_0x120c0e[_0x0498('0x34')],qs[_0x0498('0x39')](_0x4597f6[_0x0498('0x35')][_0x0498('0x39')]));_0x49a8a5[_0x0498('0x38')]=_0x49a8a5[_0x0498('0x38')][_0x0498('0x3a')]?_0x49a8a5[_0x0498('0x38')]:_0x120c0e[_0x0498('0x34')];if(!_0x4597f6['query'][_0x0498('0x3b')](_0x0498('0x3c'))){_0x49a8a5['limit']=qs['limit'](_0x4597f6['query'][_0x0498('0x2a')]);_0x49a8a5[_0x0498('0x29')]=qs['offset'](_0x4597f6[_0x0498('0x35')][_0x0498('0x29')]);}_0x49a8a5[_0x0498('0x3d')]=qs[_0x0498('0x3e')](_0x4597f6[_0x0498('0x35')][_0x0498('0x3e')]);_0x49a8a5[_0x0498('0x3f')]=qs[_0x0498('0x36')](_[_0x0498('0x40')](_0x4597f6[_0x0498('0x35')],_0x120c0e[_0x0498('0x36')]));if(_0x4597f6[_0x0498('0x35')]['filter']){_0x49a8a5[_0x0498('0x3f')]=_[_0x0498('0x41')](_0x49a8a5[_0x0498('0x3f')],{'$or':_['map'](_0x140c2f,function(_0x2b387b){if(_0x2b387b['type'][_0x0498('0x42')]!==_0x0498('0x43')){var _0x3400c0={};_0x3400c0[_0x2b387b[_0x0498('0x44')]]={'$like':'%'+_0x4597f6[_0x0498('0x35')][_0x0498('0x45')]+'%'};return _0x3400c0;}})});}_0x49a8a5=_[_0x0498('0x41')]({},_0x49a8a5,_0x4597f6[_0x0498('0x46')]);var _0x4b10c0={'where':_0x49a8a5[_0x0498('0x3f')]};return db[_0x0498('0x33')][_0x0498('0x47')](_0x4b10c0)[_0x0498('0x1b')](function(_0x4be86c){_0x4df19f[_0x0498('0x47')]=_0x4be86c;if(_0x4597f6['query'][_0x0498('0x48')]){_0x49a8a5[_0x0498('0x49')]=[{'all':!![]}];}return db['VtigerAccount'][_0x0498('0x4a')](_0x49a8a5);})[_0x0498('0x1b')](function(_0x3ee10e){_0x4df19f[_0x0498('0x4b')]=_0x3ee10e;return _0x4df19f;})[_0x0498('0x1b')](respondWithFilteredResult(_0x48e53c,_0x49a8a5))['catch'](handleError(_0x48e53c,null));};exports[_0x0498('0x4c')]=function(_0x3b82ec,_0x434deb){var _0x1d6347={'raw':![],'where':{'id':_0x3b82ec[_0x0498('0x4d')]['id']}},_0x3f2857={};_0x3f2857[_0x0498('0x34')]=_['keys'](db[_0x0498('0x33')][_0x0498('0x4e')]);_0x3f2857[_0x0498('0x35')]=_[_0x0498('0x4f')](_0x3b82ec[_0x0498('0x35')]);_0x3f2857[_0x0498('0x36')]=_['intersection'](_0x3f2857[_0x0498('0x34')],_0x3f2857[_0x0498('0x35')]);_0x1d6347['attributes']=_[_0x0498('0x37')](_0x3f2857[_0x0498('0x34')],qs[_0x0498('0x39')](_0x3b82ec[_0x0498('0x35')][_0x0498('0x39')]));_0x1d6347[_0x0498('0x38')]=_0x1d6347['attributes'][_0x0498('0x3a')]?_0x1d6347[_0x0498('0x38')]:_0x3f2857[_0x0498('0x34')];if(_0x3b82ec[_0x0498('0x35')][_0x0498('0x48')]){_0x1d6347[_0x0498('0x49')]=[{'all':!![]}];}_0x1d6347=_[_0x0498('0x41')]({},_0x1d6347,_0x3b82ec[_0x0498('0x46')]);return db[_0x0498('0x33')][_0x0498('0x50')](_0x1d6347)[_0x0498('0x1b')](handleEntityNotFound(_0x434deb,null))[_0x0498('0x1b')](respondWithResult(_0x434deb,null))[_0x0498('0x51')](handleError(_0x434deb,null));};exports[_0x0498('0x52')]=function(_0x88db52,_0x5da571){return db[_0x0498('0x33')][_0x0498('0x52')](_0x88db52['body'],{})['then'](respondWithResult(_0x5da571,0xc9))[_0x0498('0x51')](handleError(_0x5da571,null));};exports[_0x0498('0x2e')]=function(_0x5d1abc,_0x3b6950){if(_0x5d1abc[_0x0498('0x53')]['id']){delete _0x5d1abc[_0x0498('0x53')]['id'];}return db[_0x0498('0x33')][_0x0498('0x50')]({'where':{'id':_0x5d1abc[_0x0498('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3b6950,null))[_0x0498('0x1b')](saveUpdates(_0x5d1abc[_0x0498('0x53')],null))[_0x0498('0x1b')](respondWithResult(_0x3b6950,null))[_0x0498('0x51')](handleError(_0x3b6950,null));};exports[_0x0498('0x54')]=function(_0x12953e,_0x5d4828){return db['VtigerAccount'][_0x0498('0x50')]({'where':{'id':_0x12953e[_0x0498('0x4d')]['id']}})[_0x0498('0x1b')](handleEntityNotFound(_0x5d4828,null))[_0x0498('0x1b')](removeEntity(_0x5d4828,null))[_0x0498('0x51')](handleError(_0x5d4828,null));};exports[_0x0498('0x55')]=function(_0x4ddf86,_0x133c9e,_0x206fce){var _0x2297f7={};var _0x26ed29={};var _0x1e4943;var _0x5413f4;return db[_0x0498('0x33')][_0x0498('0x56')]({'where':{'id':_0x4ddf86[_0x0498('0x4d')]['id']}})[_0x0498('0x1b')](handleEntityNotFound(_0x133c9e,null))[_0x0498('0x1b')](function(_0x5a2460){if(_0x5a2460){_0x1e4943=_0x5a2460;_0x26ed29[_0x0498('0x34')]=_['keys'](db[_0x0498('0x57')][_0x0498('0x4e')]);_0x26ed29['query']=_[_0x0498('0x4f')](_0x4ddf86[_0x0498('0x35')]);_0x26ed29[_0x0498('0x36')]=_[_0x0498('0x37')](_0x26ed29['model'],_0x26ed29['query']);_0x2297f7[_0x0498('0x38')]=_[_0x0498('0x37')](_0x26ed29['model'],qs['fields'](_0x4ddf86[_0x0498('0x35')][_0x0498('0x39')]));_0x2297f7[_0x0498('0x38')]=_0x2297f7[_0x0498('0x38')][_0x0498('0x3a')]?_0x2297f7[_0x0498('0x38')]:_0x26ed29[_0x0498('0x34')];_0x2297f7['order']=qs[_0x0498('0x3e')](_0x4ddf86[_0x0498('0x35')][_0x0498('0x3e')]);_0x2297f7[_0x0498('0x3f')]=qs[_0x0498('0x36')](_[_0x0498('0x40')](_0x4ddf86[_0x0498('0x35')],_0x26ed29[_0x0498('0x36')]));if(_0x4ddf86[_0x0498('0x35')][_0x0498('0x45')]){_0x2297f7[_0x0498('0x3f')]=_[_0x0498('0x41')](_0x2297f7[_0x0498('0x3f')],{'$or':_[_0x0498('0x58')](_0x2297f7[_0x0498('0x38')],function(_0x26934b){var _0x56b2de={};_0x56b2de[_0x26934b]={'$like':'%'+_0x4ddf86[_0x0498('0x35')][_0x0498('0x45')]+'%'};return _0x56b2de;})});}_0x2297f7=_[_0x0498('0x41')]({},_0x2297f7,_0x4ddf86[_0x0498('0x46')]);return _0x1e4943[_0x0498('0x55')](_0x2297f7);}})[_0x0498('0x1b')](function(_0x4e8658){if(_0x4e8658){_0x5413f4=_0x4e8658[_0x0498('0x3a')];if(!_0x4ddf86[_0x0498('0x35')][_0x0498('0x3b')](_0x0498('0x3c'))){_0x2297f7['limit']=qs[_0x0498('0x2a')](_0x4ddf86[_0x0498('0x35')][_0x0498('0x2a')]);_0x2297f7[_0x0498('0x29')]=qs['offset'](_0x4ddf86[_0x0498('0x35')][_0x0498('0x29')]);}return _0x1e4943[_0x0498('0x55')](_0x2297f7);}})[_0x0498('0x1b')](function(_0x540ba0){if(_0x540ba0){return _0x540ba0?{'count':_0x5413f4,'rows':_0x540ba0}:null;}})[_0x0498('0x1b')](respondWithResult(_0x133c9e,null))['catch'](handleError(_0x133c9e,null));};exports[_0x0498('0x59')]=function(_0x5b87b0,_0x5a58fd,_0x28d324){if(_0x5b87b0[_0x0498('0x53')]['id']){delete _0x5b87b0['body']['id'];}return db[_0x0498('0x33')][_0x0498('0x56')]({'where':{'id':_0x5b87b0[_0x0498('0x4d')]['id']}})[_0x0498('0x1b')](handleEntityNotFound(_0x5a58fd,null))[_0x0498('0x1b')](function(_0x3d5e05){if(_0x3d5e05){_0x5b87b0[_0x0498('0x53')][_0x0498('0x5a')]=_0x3d5e05['id'];_0x5b87b0[_0x0498('0x53')][_0x0498('0x5b')]=integrations[_0x0498('0x5c')](_0x5b87b0['body']['channel'],_0x5b87b0[_0x0498('0x53')][_0x0498('0x5d')]);_0x5b87b0[_0x0498('0x53')][_0x0498('0x5e')]=integrations[_0x0498('0x5f')](_0x5b87b0[_0x0498('0x53')][_0x0498('0x60')],_0x5b87b0[_0x0498('0x53')][_0x0498('0x5d')]);return db['VtigerConfiguration']['create'](_0x5b87b0['body'],{'include':[{'model':db[_0x0498('0x61')],'as':_0x0498('0x5b')},{'model':db[_0x0498('0x61')],'as':_0x0498('0x5e')}]});}return null;})[_0x0498('0x1b')](respondWithResult(_0x5a58fd,null))[_0x0498('0x51')](handleError(_0x5a58fd,null));};var md5=require(_0x0498('0x62'));exports[_0x0498('0x63')]=function(_0x1dca84,_0x209f52,_0x43a4eb){var _0xe6ac3e=null;var _0x2d0454=null;var _0x1991be=null;var _0x32f105=null;var _0x165802='';return db[_0x0498('0x33')][_0x0498('0x56')]({'where':{'id':_0x1dca84[_0x0498('0x4d')]['id']},'attributes':['id',_0x0498('0x31'),_0x0498('0x64'),'description',_0x0498('0x65'),_0x0498('0x66'),_0x0498('0x67'),_0x0498('0x68')]})[_0x0498('0x1b')](handleEntityNotFound(_0x209f52,null))[_0x0498('0x1b')](function(_0x3d295d){if(_0x3d295d){_0xe6ac3e=_0x3d295d['username'];_0x2d0454=_0x3d295d[_0x0498('0x68')];_0x1991be=_0x3d295d['moduleName'];_0x165802=_0x3d295d[_0x0498('0x66')];var _0x2374a1=_0x165802[_0x0498('0x69')](-0x1);if(_0x2374a1==='/'){_0x165802=_0x165802[_0x0498('0x6a')](0x0,_0x165802[_0x0498('0x6b')](_0x2374a1));}_0x32f105=util[_0x0498('0x6c')](_0x0498('0x6d'),_0x165802);var _0x55d93f={'method':_0x0498('0x6e'),'uri':_0x32f105,'qs':{'operation':_0x0498('0x6f'),'username':_0x3d295d[_0x0498('0x64')]},'json':!![]};return rp(_0x55d93f);}})['then'](function(_0x5d4841){if(_0x5d4841['success']){var _0x4091b8={'method':_0x0498('0x70'),'uri':_0x32f105,'form':{'operation':_0x0498('0x71'),'username':_0xe6ac3e,'accessKey':md5(_0x5d4841[_0x0498('0x25')]['token']+_0x2d0454)},'json':!![]};return rp(_0x4091b8);}})[_0x0498('0x1b')](function(_0x280d1e){if(_0x280d1e[_0x0498('0x72')]){var _0x3c115c={'method':_0x0498('0x6e'),'uri':_0x32f105,'qs':{'operation':_0x0498('0x73'),'username':_0xe6ac3e,'sessionName':_0x280d1e[_0x0498('0x25')][_0x0498('0x74')],'elementType':_0x1991be},'json':!![]};return rp(_0x3c115c);}})[_0x0498('0x1b')](function(_0x503fd1){if(_0x503fd1[_0x0498('0x72')]){var _0x308e7e=[_0x0498('0x75'),_0x0498('0x76'),_0x0498('0x77')];_['remove'](_0x503fd1['result'][_0x0498('0x39')],function(_0x520c1e){return _0x308e7e[_0x0498('0x78')](_0x520c1e[_0x0498('0x5d')][_0x0498('0x31')]);});_['remove'](_0x503fd1['result'][_0x0498('0x39')],function(_0x9e380e){return _0x9e380e[_0x0498('0x79')]==='false';});return{'count':_0x503fd1['result'][_0x0498('0x39')]['length'],'rows':_[_0x0498('0x58')](_0x503fd1[_0x0498('0x25')][_0x0498('0x39')],function(_0x31179f){return{'id':_0x31179f[_0x0498('0x31')],'name':_0x31179f[_0x0498('0x7a')],'custom':_[_0x0498('0x7b')](_0x31179f[_0x0498('0x31')],_0x0498('0x7c'))?!![]:![],'options':_0x31179f[_0x0498('0x5d')][_0x0498('0x31')]===_0x0498('0x7d')&&_0x31179f['type'][_0x0498('0x7e')][_0x0498('0x3a')]>0x0?_[_0x0498('0x58')](_0x31179f[_0x0498('0x5d')][_0x0498('0x7e')],function(_0xa5c850){return{'name':_0xa5c850[_0x0498('0x7a')],'value':_0xa5c850[_0x0498('0x7f')]};}):[]};})};}})[_0x0498('0x1b')](respondWithResult(_0x209f52,null))[_0x0498('0x51')](function(_0x382327){console[_0x0498('0x80')](_0x0498('0x81')+_0x382327);var _0x368618=_0x1dca84[_0x0498('0x35')][_0x0498('0x18')]?0x1f4:_0x382327[_0x0498('0x82')]||0x1f4;logger['error'](_0x0498('0x83'),'getFields',_0x368618,JSON[_0x0498('0x21')](_0x382327));delete _0x382327[_0x0498('0x31')];if(_0x368618===0x191){_0x368618=0x190;}_0x209f52['status'](_0x368618)[_0x0498('0x84')](_0x1dca84['query'][_0x0498('0x18')]?{'message':_0x0498('0x85'),'statusCode':_0x382327[_0x0498('0x82')]}:_0x382327);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 92fe592..10ed66b 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 _0x2542=['api','bluebird','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger'];(function(_0x2f4a28,_0x16fce1){var _0x23cf6d=function(_0x5c5da3){while(--_0x5c5da3){_0x2f4a28['push'](_0x2f4a28['shift']());}};_0x23cf6d(++_0x16fce1);}(_0x2542,0x169));var _0x2254=function(_0x46f8e2,_0x5b5363){_0x46f8e2=_0x46f8e2-0x0;var _0xa87cd0=_0x2542[_0x46f8e2];return _0xa87cd0;};'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'));var integrations=require(_0x2254('0x9'));module['exports']=function(_0x19ad3c,_0xe8ca50){return _0x19ad3c[_0x2254('0xa')](_0x2254('0xb'),attributes,{'tableName':_0x2254('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x896e=['request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x46dbac,_0x294195){var _0x36baa1=function(_0x2d9ad3){while(--_0x2d9ad3){_0x46dbac['push'](_0x46dbac['shift']());}};_0x36baa1(++_0x294195);}(_0x896e,0x1e9));var _0xe896=function(_0x3ee9bc,_0x47ec6d){_0x3ee9bc=_0x3ee9bc-0x0;var _0x14b308=_0x896e[_0x3ee9bc];return _0x14b308;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var logger=require(_0xe896('0x2'))(_0xe896('0x3'));var moment=require(_0xe896('0x4'));var BPromise=require(_0xe896('0x5'));var rp=require(_0xe896('0x6'));var fs=require('fs');var path=require(_0xe896('0x7'));var rimraf=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var attributes=require(_0xe896('0xa'));var integrations=require(_0xe896('0xb'));module['exports']=function(_0x24c430,_0x7a0721){return _0x24c430[_0xe896('0xc')](_0xe896('0xd'),attributes,{'tableName':_0xe896('0xe'),'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 d691f5a..a2fb3ef 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 _0x44a5=['request\x20sent','stringify','error','code','message','result','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','limit','include','map','model','ShowVtigerAccount','find','raw','debug','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','VtigerAccount,\x20%s,\x20%s'];(function(_0x564c4d,_0x1d88c1){var _0x5a5c33=function(_0x4762f5){while(--_0x4762f5){_0x564c4d['push'](_0x564c4d['shift']());}};_0x5a5c33(++_0x1d88c1);}(_0x44a5,0x9d));var _0x544a=function(_0x1fa007,_0x5d3503){_0x1fa007=_0x1fa007-0x0;var _0x24a0c2=_0x44a5[_0x1fa007];return _0x24a0c2;};'use strict';var _=require(_0x544a('0x0'));var util=require('util');var moment=require(_0x544a('0x1'));var BPromise=require('bluebird');var rs=require(_0x544a('0x2'));var fs=require('fs');var Redis=require(_0x544a('0x3'));var db=require(_0x544a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x544a('0x5'))(_0x544a('0x6'));var config=require('../../config/environment');var jayson=require(_0x544a('0x7'));var client=jayson['client'][_0x544a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x30fd87,_0x1dd165,_0x19b0a7){return new BPromise(function(_0x38df26,_0x5e5004){return client[_0x544a('0x9')](_0x30fd87,_0x19b0a7)[_0x544a('0xa')](function(_0x5eb361){logger[_0x544a('0xb')](_0x544a('0xc'),_0x1dd165,_0x544a('0xd'));logger['debug']('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x1dd165,_0x544a('0xd'),JSON[_0x544a('0xe')](_0x5eb361));if(_0x5eb361[_0x544a('0xf')]){if(_0x5eb361[_0x544a('0xf')][_0x544a('0x10')]===0x1f4){logger[_0x544a('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x1dd165,_0x5eb361[_0x544a('0xf')][_0x544a('0x11')]);return _0x5e5004(_0x5eb361[_0x544a('0xf')][_0x544a('0x11')]);}logger[_0x544a('0xf')](_0x544a('0xc'),_0x1dd165,_0x5eb361[_0x544a('0xf')]['message']);return _0x38df26(_0x5eb361[_0x544a('0xf')]['message']);}else{logger[_0x544a('0xb')](_0x544a('0xc'),_0x1dd165,_0x544a('0xd'));_0x38df26(_0x5eb361[_0x544a('0x12')][_0x544a('0x11')]);}})['catch'](function(_0x15bf83){logger[_0x544a('0xf')](_0x544a('0xc'),_0x1dd165,_0x15bf83);_0x5e5004(_0x15bf83);});});}exports[_0x544a('0x13')]=function(_0x5aefdd){var _0x16f431=this;return new Promise(function(_0x56e884,_0x21aed7){return db[_0x544a('0x14')][_0x544a('0x15')]({'raw':_0x5aefdd[_0x544a('0x16')]?_0x5aefdd['options']['raw']===undefined?!![]:![]:!![],'where':_0x5aefdd[_0x544a('0x16')]?_0x5aefdd[_0x544a('0x16')][_0x544a('0x17')]||null:null,'attributes':_0x5aefdd[_0x544a('0x16')]?_0x5aefdd[_0x544a('0x16')][_0x544a('0x18')]||null:null,'limit':_0x5aefdd[_0x544a('0x16')]?_0x5aefdd[_0x544a('0x16')][_0x544a('0x19')]||null:null,'include':_0x5aefdd['options']?_0x5aefdd['options'][_0x544a('0x1a')]?_[_0x544a('0x1b')](_0x5aefdd[_0x544a('0x16')][_0x544a('0x1a')],function(_0x878583){return{'model':db[_0x878583[_0x544a('0x1c')]],'as':_0x878583['as'],'attributes':_0x878583[_0x544a('0x18')],'include':_0x878583['include']?_['map'](_0x878583[_0x544a('0x1a')],function(_0x19cdc1){return{'model':db[_0x19cdc1[_0x544a('0x1c')]],'as':_0x19cdc1['as'],'attributes':_0x19cdc1['attributes'],'include':_0x19cdc1[_0x544a('0x1a')]?_[_0x544a('0x1b')](_0x19cdc1['include'],function(_0x24177f){return{'model':db[_0x24177f[_0x544a('0x1c')]],'as':_0x24177f['as'],'attributes':_0x24177f[_0x544a('0x18')]};}):[]};}):[]};}):[]:[]})[_0x544a('0xa')](function(_0x534d38){logger[_0x544a('0xb')](_0x544a('0x13'),_0x5aefdd);logger['debug'](_0x544a('0x13'),_0x5aefdd,JSON[_0x544a('0xe')](_0x534d38));_0x56e884(_0x534d38);})['catch'](function(_0x38c410){logger[_0x544a('0xf')](_0x544a('0x13'),_0x38c410[_0x544a('0x11')],_0x5aefdd);_0x21aed7(_0x16f431[_0x544a('0xf')](0x1f4,_0x38c410[_0x544a('0x11')]));});});};exports[_0x544a('0x1d')]=function(_0x7d3b1e){var _0x7ccf24=this;return new Promise(function(_0x393bd7,_0xc271fe){return db[_0x544a('0x14')][_0x544a('0x1e')]({'raw':_0x7d3b1e[_0x544a('0x16')]?_0x7d3b1e['options'][_0x544a('0x1f')]===undefined?!![]:![]:!![],'where':_0x7d3b1e[_0x544a('0x16')]?_0x7d3b1e[_0x544a('0x16')]['where']||null:null,'attributes':_0x7d3b1e[_0x544a('0x16')]?_0x7d3b1e['options'][_0x544a('0x18')]||null:null,'include':_0x7d3b1e[_0x544a('0x16')]?_0x7d3b1e['options'][_0x544a('0x1a')]?_['map'](_0x7d3b1e[_0x544a('0x16')][_0x544a('0x1a')],function(_0x979483){return{'model':db[_0x979483[_0x544a('0x1c')]],'as':_0x979483['as'],'attributes':_0x979483[_0x544a('0x18')],'include':_0x979483[_0x544a('0x1a')]?_[_0x544a('0x1b')](_0x979483[_0x544a('0x1a')],function(_0x116845){return{'model':db[_0x116845[_0x544a('0x1c')]],'as':_0x116845['as'],'attributes':_0x116845[_0x544a('0x18')],'include':_0x116845['include']?_[_0x544a('0x1b')](_0x116845[_0x544a('0x1a')],function(_0x42348d){return{'model':db[_0x42348d[_0x544a('0x1c')]],'as':_0x42348d['as'],'attributes':_0x42348d[_0x544a('0x18')]};}):[]};}):[]};}):[]:[]})[_0x544a('0xa')](function(_0x387591){logger[_0x544a('0xb')](_0x544a('0x1d'),_0x7d3b1e);logger[_0x544a('0x20')](_0x544a('0x1d'),_0x7d3b1e,JSON[_0x544a('0xe')](_0x387591));_0x393bd7(_0x387591);})[_0x544a('0x21')](function(_0xfb2055){logger[_0x544a('0xf')]('ShowVtigerAccount',_0xfb2055[_0x544a('0x11')],_0x7d3b1e);_0xc271fe(_0x7ccf24[_0x544a('0xf')](0x1f4,_0xfb2055[_0x544a('0x11')]));});});}; \ No newline at end of file +var _0xe48a=['options','raw','where','attributes','limit','include','model','map','GetVtigerAccount','ShowVtigerAccount','find','debug','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','VtigerAccount,\x20%s,\x20%s','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','VtigerAccount','findAll'];(function(_0x3760f1,_0x498373){var _0x14d886=function(_0x104123){while(--_0x104123){_0x3760f1['push'](_0x3760f1['shift']());}};_0x14d886(++_0x498373);}(_0xe48a,0x1da));var _0xae48=function(_0x498b9e,_0x46ae26){_0x498b9e=_0x498b9e-0x0;var _0x29dd57=_0xe48a[_0x498b9e];return _0x29dd57;};'use strict';var _=require('lodash');var util=require(_0xae48('0x0'));var moment=require('moment');var BPromise=require(_0xae48('0x1'));var rs=require(_0xae48('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae48('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xae48('0x4'))(_0xae48('0x5'));var config=require(_0xae48('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xae48('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cdd8e,_0x51d620,_0x289417){return new BPromise(function(_0x58d7b3,_0x23ec4d){return client[_0xae48('0x8')](_0x2cdd8e,_0x289417)[_0xae48('0x9')](function(_0x3809fa){logger[_0xae48('0xa')](_0xae48('0xb'),_0x51d620,'request\x20sent');logger['debug'](_0xae48('0xc'),_0x51d620,_0xae48('0xd'),JSON[_0xae48('0xe')](_0x3809fa));if(_0x3809fa['error']){if(_0x3809fa[_0xae48('0xf')]['code']===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x51d620,_0x3809fa['error'][_0xae48('0x10')]);return _0x23ec4d(_0x3809fa['error']['message']);}logger[_0xae48('0xf')](_0xae48('0xb'),_0x51d620,_0x3809fa[_0xae48('0xf')][_0xae48('0x10')]);return _0x58d7b3(_0x3809fa['error']['message']);}else{logger[_0xae48('0xa')](_0xae48('0xb'),_0x51d620,_0xae48('0xd'));_0x58d7b3(_0x3809fa[_0xae48('0x11')][_0xae48('0x10')]);}})[_0xae48('0x12')](function(_0x5f1a83){logger[_0xae48('0xf')](_0xae48('0xb'),_0x51d620,_0x5f1a83);_0x23ec4d(_0x5f1a83);});});}exports['GetVtigerAccount']=function(_0x4fdfda){var _0x2d51cf=this;return new Promise(function(_0x3ba056,_0x594ac6){return db[_0xae48('0x13')][_0xae48('0x14')]({'raw':_0x4fdfda['options']?_0x4fdfda[_0xae48('0x15')][_0xae48('0x16')]===undefined?!![]:![]:!![],'where':_0x4fdfda[_0xae48('0x15')]?_0x4fdfda[_0xae48('0x15')][_0xae48('0x17')]||null:null,'attributes':_0x4fdfda[_0xae48('0x15')]?_0x4fdfda[_0xae48('0x15')][_0xae48('0x18')]||null:null,'limit':_0x4fdfda[_0xae48('0x15')]?_0x4fdfda[_0xae48('0x15')][_0xae48('0x19')]||null:null,'include':_0x4fdfda['options']?_0x4fdfda[_0xae48('0x15')][_0xae48('0x1a')]?_['map'](_0x4fdfda[_0xae48('0x15')]['include'],function(_0x336147){return{'model':db[_0x336147[_0xae48('0x1b')]],'as':_0x336147['as'],'attributes':_0x336147['attributes'],'include':_0x336147['include']?_['map'](_0x336147[_0xae48('0x1a')],function(_0x5e6056){return{'model':db[_0x5e6056[_0xae48('0x1b')]],'as':_0x5e6056['as'],'attributes':_0x5e6056[_0xae48('0x18')],'include':_0x5e6056[_0xae48('0x1a')]?_[_0xae48('0x1c')](_0x5e6056[_0xae48('0x1a')],function(_0x1b8db5){return{'model':db[_0x1b8db5[_0xae48('0x1b')]],'as':_0x1b8db5['as'],'attributes':_0x1b8db5[_0xae48('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x25e5bd){logger[_0xae48('0xa')](_0xae48('0x1d'),_0x4fdfda);logger['debug'](_0xae48('0x1d'),_0x4fdfda,JSON[_0xae48('0xe')](_0x25e5bd));_0x3ba056(_0x25e5bd);})['catch'](function(_0x196366){logger[_0xae48('0xf')](_0xae48('0x1d'),_0x196366[_0xae48('0x10')],_0x4fdfda);_0x594ac6(_0x2d51cf[_0xae48('0xf')](0x1f4,_0x196366[_0xae48('0x10')]));});});};exports[_0xae48('0x1e')]=function(_0x90c7b5){var _0x59b5e7=this;return new Promise(function(_0x5bf56d,_0xe41ec9){return db[_0xae48('0x13')][_0xae48('0x1f')]({'raw':_0x90c7b5['options']?_0x90c7b5['options'][_0xae48('0x16')]===undefined?!![]:![]:!![],'where':_0x90c7b5[_0xae48('0x15')]?_0x90c7b5[_0xae48('0x15')][_0xae48('0x17')]||null:null,'attributes':_0x90c7b5[_0xae48('0x15')]?_0x90c7b5[_0xae48('0x15')][_0xae48('0x18')]||null:null,'include':_0x90c7b5[_0xae48('0x15')]?_0x90c7b5[_0xae48('0x15')][_0xae48('0x1a')]?_[_0xae48('0x1c')](_0x90c7b5[_0xae48('0x15')][_0xae48('0x1a')],function(_0x2fc01f){return{'model':db[_0x2fc01f[_0xae48('0x1b')]],'as':_0x2fc01f['as'],'attributes':_0x2fc01f['attributes'],'include':_0x2fc01f['include']?_[_0xae48('0x1c')](_0x2fc01f['include'],function(_0x2343dd){return{'model':db[_0x2343dd['model']],'as':_0x2343dd['as'],'attributes':_0x2343dd[_0xae48('0x18')],'include':_0x2343dd[_0xae48('0x1a')]?_[_0xae48('0x1c')](_0x2343dd[_0xae48('0x1a')],function(_0x36bba5){return{'model':db[_0x36bba5['model']],'as':_0x36bba5['as'],'attributes':_0x36bba5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x44e943){logger['info']('ShowVtigerAccount',_0x90c7b5);logger[_0xae48('0x20')](_0xae48('0x1e'),_0x90c7b5,JSON['stringify'](_0x44e943));_0x5bf56d(_0x44e943);})['catch'](function(_0x485f66){logger[_0xae48('0xf')]('ShowVtigerAccount',_0x485f66[_0xae48('0x10')],_0x90c7b5);_0xe41ec9(_0x59b5e7[_0xae48('0xf')](0x1f4,_0x485f66[_0xae48('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 8605179..f35ecd3 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 _0x757a=['exports','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x3f8e83,_0x457fd5){var _0x1a1b44=function(_0x40f473){while(--_0x40f473){_0x3f8e83['push'](_0x3f8e83['shift']());}};_0x1a1b44(++_0x457fd5);}(_0x757a,0xde));var _0xa757=function(_0x272f9d,_0x563d72){_0x272f9d=_0x272f9d-0x0;var _0x32324e=_0x757a[_0x272f9d];return _0x32324e;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xa757('0x2'));var interaction=require(_0xa757('0x3'));var config=require(_0xa757('0x4'));var controller=require(_0xa757('0x5'));router[_0xa757('0x6')]('/',auth[_0xa757('0x7')](),controller['index']);router[_0xa757('0x6')](_0xa757('0x8'),auth['isAuthenticated'](),controller[_0xa757('0x9')]);router[_0xa757('0x6')](_0xa757('0xa'),auth[_0xa757('0x7')](),controller[_0xa757('0xb')]);router['get'](_0xa757('0xc'),auth[_0xa757('0x7')](),controller[_0xa757('0xd')]);router[_0xa757('0x6')](_0xa757('0xe'),auth[_0xa757('0x7')](),controller[_0xa757('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xa757('0x7')](),controller['update']);router['delete'](_0xa757('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xa757('0x10')]=router; \ No newline at end of file +var _0xcb91=['/:id/descriptions','getDescriptions','post','create','put','delete','destroy','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/subjects','getSubjects'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x53b8e0,_0x55d46e){_0x53b8e0=_0x53b8e0-0x0;var _0x10630c=_0xcb91[_0x53b8e0];return _0x10630c;};'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('./intVtigerConfiguration.controller');router[_0x1cb9('0x6')]('/',auth[_0x1cb9('0x7')](),controller['index']);router[_0x1cb9('0x6')](_0x1cb9('0x8'),auth['isAuthenticated'](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0x6')]('/:id/fields',auth[_0x1cb9('0x7')](),controller['getFields']);router['get'](_0x1cb9('0xa'),auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xb')]);router[_0x1cb9('0x6')](_0x1cb9('0xc'),auth['isAuthenticated'](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0xe')]('/',auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xf')]);router[_0x1cb9('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1cb9('0x11')](_0x1cb9('0x8'),auth[_0x1cb9('0x7')](),controller[_0x1cb9('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 48ded74..5d8f399 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 _0x6623=['STRING','exports'];(function(_0x73c836,_0x8aba2f){var _0x140fde=function(_0x2b7c55){while(--_0x2b7c55){_0x73c836['push'](_0x73c836['shift']());}};_0x140fde(++_0x8aba2f);}(_0x6623,0x12f));var _0x3662=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x6623[_0x550d12];return _0x12103d;};'use strict';var Sequelize=require('sequelize');module[_0x3662('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3662('0x1')]}}; \ No newline at end of file +var _0x1045=['exports','STRING','sequelize'];(function(_0x5de2fc,_0x19a1a9){var _0x4c3483=function(_0x3ce1d2){while(--_0x3ce1d2){_0x5de2fc['push'](_0x5de2fc['shift']());}};_0x4c3483(++_0x19a1a9);}(_0x1045,0x188));var _0x5104=function(_0x381be3,_0x5a6dc1){_0x381be3=_0x381be3-0x0;var _0x25363b=_0x1045[_0x381be3];return _0x25363b;};'use strict';var Sequelize=require(_0x5104('0x0'));module[_0x5104('0x1')]={'name':{'type':Sequelize[_0x5104('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 2b90992..8a66501 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 _0xf2b8=['json','count','limit','set','apply','reject','save','end','stack','name','index','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','pick','merge','where','map','type','key','VIRTUAL','field','filter','options','VtigerConfiguration','include','findAll','rows','params','rawAttributes','includeAll','find','create','body','update','destroy','VtigerField','order','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','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~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','catch','sendStatus','status'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0xf2b8,0x140));var _0x8f2b=function(_0x466669,_0x73eade){_0x466669=_0x466669-0x0;var _0x43d27c=_0xf2b8[_0x466669];return _0x43d27c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8f2b('0x0'));var rimraf=require(_0x8f2b('0x1'));var zipdir=require(_0x8f2b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8f2b('0x3'));var moment=require(_0x8f2b('0x4'));var BPromise=require(_0x8f2b('0x5'));var Mustache=require(_0x8f2b('0x6'));var util=require(_0x8f2b('0x7'));var path=require(_0x8f2b('0x8'));var sox=require(_0x8f2b('0x9'));var csv=require('to-csv');var ejs=require(_0x8f2b('0xa'));var fs=require('fs');var _=require(_0x8f2b('0xb'));var squel=require(_0x8f2b('0xc'));var crypto=require(_0x8f2b('0xd'));var jsforce=require(_0x8f2b('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8f2b('0xf'));var Papa=require(_0x8f2b('0x10'));var Redis=require('ioredis');var authService=require(_0x8f2b('0x11'));var qs=require(_0x8f2b('0x12'));var hardwareService=require(_0x8f2b('0x13'));var logger=require(_0x8f2b('0x14'))(_0x8f2b('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x8f2b('0x16'));var client=jayson[_0x8f2b('0x17')][_0x8f2b('0x18')]({'port':0x232a});function checkPasswordPattern(_0x32d325,_0x2cc0b2,_0x158907){if(_0x158907){var _0x487bde=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x487bde['test'](_0x2cc0b2)){return _0x32d325;}else{throw new Error(_0x8f2b('0x19'));}}else{return _0x32d325;}}function respondWithRpcPromise(_0x14146c,_0xc7f7cb,_0x39ce80,_0x485481){return new BPromise(function(_0x44f6fa,_0x40ac71){var _0x2bad79=_0x485481||client;return _0x2bad79[_0x8f2b('0x1a')](_0x14146c,_0x39ce80)[_0x8f2b('0x1b')](function(_0x535cb4){logger[_0x8f2b('0x1c')]('VtigerConfiguration,\x20%s,\x20%s',_0xc7f7cb,_0x8f2b('0x1d'));logger[_0x8f2b('0x1e')](_0x8f2b('0x1f'),_0xc7f7cb,_0x8f2b('0x1d'),JSON[_0x8f2b('0x20')](_0x535cb4));if(_0x535cb4[_0x8f2b('0x21')]){if(_0x535cb4[_0x8f2b('0x21')][_0x8f2b('0x22')]===0x1f4){logger[_0x8f2b('0x21')](_0x8f2b('0x23'),_0xc7f7cb,_0x535cb4[_0x8f2b('0x21')][_0x8f2b('0x24')]);return _0x40ac71(_0x535cb4[_0x8f2b('0x21')][_0x8f2b('0x24')]);}logger[_0x8f2b('0x21')]('VtigerConfiguration,\x20%s,\x20%s',_0xc7f7cb,_0x535cb4[_0x8f2b('0x21')]['message']);return _0x44f6fa(_0x535cb4[_0x8f2b('0x21')][_0x8f2b('0x24')]);}else{logger[_0x8f2b('0x1c')](_0x8f2b('0x23'),_0xc7f7cb,_0x8f2b('0x1d'));_0x44f6fa(_0x535cb4['result']['message']);}})[_0x8f2b('0x25')](function(_0x2db3ed){logger[_0x8f2b('0x21')]('VtigerConfiguration,\x20%s,\x20%s',_0xc7f7cb,_0x2db3ed);_0x40ac71(_0x2db3ed);});});}function respondWithStatusCode(_0x12a9ae,_0x4bc316){_0x4bc316=_0x4bc316||0xcc;return function(_0x586ee0){if(_0x586ee0){return _0x12a9ae[_0x8f2b('0x26')](_0x4bc316);}return _0x12a9ae[_0x8f2b('0x27')](_0x4bc316)['end']();};}function respondWithResult(_0x59e059,_0x39f741){_0x39f741=_0x39f741||0xc8;return function(_0x7a28b2){if(_0x7a28b2){return _0x59e059[_0x8f2b('0x27')](_0x39f741)[_0x8f2b('0x28')](_0x7a28b2);}};}function respondWithFilteredResult(_0x409111,_0x26ff2c){return function(_0x55e48e){if(_0x55e48e){var _0x2d71ba=_0x55e48e[_0x8f2b('0x29')],_0x35de49=_0x26ff2c['offset'],_0x24d909=_0x26ff2c['offset']+_0x26ff2c[_0x8f2b('0x2a')],_0x56fd0b;if(_0x24d909>=_0x2d71ba){_0x24d909=_0x2d71ba;_0x56fd0b=0xc8;}else{_0x56fd0b=0xce;}_0x409111[_0x8f2b('0x27')](_0x56fd0b);return _0x409111[_0x8f2b('0x2b')]('Content-Range',_0x35de49+'-'+_0x24d909+'/'+_0x2d71ba)[_0x8f2b('0x28')](_0x55e48e);}return null;};}function patchUpdates(_0x563cdf){return function(_0x117746){try{jsonpatch[_0x8f2b('0x2c')](_0x117746,_0x563cdf,!![]);}catch(_0x4ee660){return BPromise[_0x8f2b('0x2d')](_0x4ee660);}return _0x117746[_0x8f2b('0x2e')]();};}function saveUpdates(_0x58caaa,_0x1ce21f){return function(_0x1f90b4){if(_0x1f90b4){return _0x1f90b4['update'](_0x58caaa)[_0x8f2b('0x1b')](function(_0x59cb39){return _0x59cb39;});}return null;};}function removeEntity(_0x102a1f,_0x43a44c){return function(_0x2e1a81){if(_0x2e1a81){return _0x2e1a81['destroy']()['then'](function(){_0x102a1f['status'](0xcc)[_0x8f2b('0x2f')]();});}};}function handleEntityNotFound(_0x2ffcf9,_0x3ccf15){return function(_0x171b78){if(!_0x171b78){_0x2ffcf9[_0x8f2b('0x26')](0x194);}return _0x171b78;};}function handleError(_0x3f4e6a,_0x229571){_0x229571=_0x229571||0x1f4;return function(_0x350244){logger['error'](_0x350244[_0x8f2b('0x30')]);if(_0x350244[_0x8f2b('0x31')]){delete _0x350244[_0x8f2b('0x31')];}_0x3f4e6a[_0x8f2b('0x27')](_0x229571)['send'](_0x350244);};}exports[_0x8f2b('0x32')]=function(_0x3c0223,_0x16ab2d){var _0x2b12e6={},_0x478f12={},_0x169238={'count':0x0,'rows':[]};var _0x2ae953=db['VtigerConfiguration']['rawAttributes'];_0x478f12[_0x8f2b('0x33')]=_['keys'](_0x2ae953);_0x478f12['query']=_[_0x8f2b('0x34')](_0x3c0223[_0x8f2b('0x35')]);_0x478f12[_0x8f2b('0x36')]=_[_0x8f2b('0x37')](_0x478f12[_0x8f2b('0x33')],_0x478f12['query']);_0x2b12e6[_0x8f2b('0x38')]=_[_0x8f2b('0x37')](_0x478f12[_0x8f2b('0x33')],qs[_0x8f2b('0x39')](_0x3c0223[_0x8f2b('0x35')][_0x8f2b('0x39')]));_0x2b12e6[_0x8f2b('0x38')]=_0x2b12e6[_0x8f2b('0x38')][_0x8f2b('0x3a')]?_0x2b12e6[_0x8f2b('0x38')]:_0x478f12['model'];if(!_0x3c0223[_0x8f2b('0x35')][_0x8f2b('0x3b')](_0x8f2b('0x3c'))){_0x2b12e6[_0x8f2b('0x2a')]=qs[_0x8f2b('0x2a')](_0x3c0223[_0x8f2b('0x35')][_0x8f2b('0x2a')]);_0x2b12e6[_0x8f2b('0x3d')]=qs['offset'](_0x3c0223[_0x8f2b('0x35')]['offset']);}_0x2b12e6['order']=qs['sort'](_0x3c0223[_0x8f2b('0x35')][_0x8f2b('0x3e')]);_0x2b12e6['where']=qs['filters'](_[_0x8f2b('0x3f')](_0x3c0223[_0x8f2b('0x35')],_0x478f12['filters']));if(_0x3c0223[_0x8f2b('0x35')]['filter']){_0x2b12e6['where']=_[_0x8f2b('0x40')](_0x2b12e6[_0x8f2b('0x41')],{'$or':_[_0x8f2b('0x42')](_0x2ae953,function(_0x1fac47){if(_0x1fac47[_0x8f2b('0x43')][_0x8f2b('0x44')]!==_0x8f2b('0x45')){var _0x178b8e={};_0x178b8e[_0x1fac47[_0x8f2b('0x46')]]={'$like':'%'+_0x3c0223['query'][_0x8f2b('0x47')]+'%'};return _0x178b8e;}})});}_0x2b12e6=_['merge']({},_0x2b12e6,_0x3c0223[_0x8f2b('0x48')]);var _0xe464={'where':_0x2b12e6['where']};return db[_0x8f2b('0x49')][_0x8f2b('0x29')](_0xe464)['then'](function(_0xa8a083){_0x169238[_0x8f2b('0x29')]=_0xa8a083;if(_0x3c0223['query']['includeAll']){_0x2b12e6[_0x8f2b('0x4a')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x8f2b('0x4b')](_0x2b12e6);})['then'](function(_0x2b2852){_0x169238[_0x8f2b('0x4c')]=_0x2b2852;return _0x169238;})[_0x8f2b('0x1b')](respondWithFilteredResult(_0x16ab2d,_0x2b12e6))[_0x8f2b('0x25')](handleError(_0x16ab2d,null));};exports['show']=function(_0x1bcd7e,_0x53c5e6){var _0x18dea0={'raw':![],'where':{'id':_0x1bcd7e[_0x8f2b('0x4d')]['id']}},_0x1b2ff1={};_0x1b2ff1['model']=_[_0x8f2b('0x34')](db[_0x8f2b('0x49')][_0x8f2b('0x4e')]);_0x1b2ff1['query']=_[_0x8f2b('0x34')](_0x1bcd7e[_0x8f2b('0x35')]);_0x1b2ff1['filters']=_[_0x8f2b('0x37')](_0x1b2ff1[_0x8f2b('0x33')],_0x1b2ff1['query']);_0x18dea0[_0x8f2b('0x38')]=_[_0x8f2b('0x37')](_0x1b2ff1['model'],qs['fields'](_0x1bcd7e[_0x8f2b('0x35')][_0x8f2b('0x39')]));_0x18dea0[_0x8f2b('0x38')]=_0x18dea0[_0x8f2b('0x38')][_0x8f2b('0x3a')]?_0x18dea0[_0x8f2b('0x38')]:_0x1b2ff1[_0x8f2b('0x33')];if(_0x1bcd7e[_0x8f2b('0x35')][_0x8f2b('0x4f')]){_0x18dea0[_0x8f2b('0x4a')]=[{'all':!![]}];}_0x18dea0=_['merge']({},_0x18dea0,_0x1bcd7e[_0x8f2b('0x48')]);return db['VtigerConfiguration'][_0x8f2b('0x50')](_0x18dea0)[_0x8f2b('0x1b')](handleEntityNotFound(_0x53c5e6,null))[_0x8f2b('0x1b')](respondWithResult(_0x53c5e6,null))['catch'](handleError(_0x53c5e6,null));};exports['create']=function(_0x1afca0,_0x5b41c7){return db[_0x8f2b('0x49')][_0x8f2b('0x51')](_0x1afca0[_0x8f2b('0x52')],{})[_0x8f2b('0x1b')](respondWithResult(_0x5b41c7,0xc9))[_0x8f2b('0x25')](handleError(_0x5b41c7,null));};exports[_0x8f2b('0x53')]=function(_0x2938e7,_0x4c3156){if(_0x2938e7[_0x8f2b('0x52')]['id']){delete _0x2938e7[_0x8f2b('0x52')]['id'];}return db[_0x8f2b('0x49')][_0x8f2b('0x50')]({'where':{'id':_0x2938e7['params']['id']}})['then'](handleEntityNotFound(_0x4c3156,null))[_0x8f2b('0x1b')](saveUpdates(_0x2938e7[_0x8f2b('0x52')],null))[_0x8f2b('0x1b')](respondWithResult(_0x4c3156,null))['catch'](handleError(_0x4c3156,null));};exports[_0x8f2b('0x54')]=function(_0x262b45,_0x309bab){return db[_0x8f2b('0x49')][_0x8f2b('0x50')]({'where':{'id':_0x262b45['params']['id']}})['then'](handleEntityNotFound(_0x309bab,null))[_0x8f2b('0x1b')](removeEntity(_0x309bab,null))['catch'](handleError(_0x309bab,null));};exports['getFields']=function(_0x5f0956,_0xabe422,_0x2e80cb){var _0x445969={};var _0x573129={};var _0x55f82d;var _0x2c25df;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x5f0956[_0x8f2b('0x4d')]['id']}})['then'](handleEntityNotFound(_0xabe422,null))['then'](function(_0x5a5ffb){if(_0x5a5ffb){_0x55f82d=_0x5a5ffb;_0x573129[_0x8f2b('0x33')]=_[_0x8f2b('0x34')](db[_0x8f2b('0x55')][_0x8f2b('0x4e')]);_0x573129[_0x8f2b('0x35')]=_[_0x8f2b('0x34')](_0x5f0956[_0x8f2b('0x35')]);_0x573129[_0x8f2b('0x36')]=_[_0x8f2b('0x37')](_0x573129[_0x8f2b('0x33')],_0x573129['query']);_0x445969[_0x8f2b('0x38')]=_[_0x8f2b('0x37')](_0x573129['model'],qs[_0x8f2b('0x39')](_0x5f0956['query'][_0x8f2b('0x39')]));_0x445969['attributes']=_0x445969[_0x8f2b('0x38')]['length']?_0x445969[_0x8f2b('0x38')]:_0x573129[_0x8f2b('0x33')];_0x445969[_0x8f2b('0x56')]=qs[_0x8f2b('0x3e')](_0x5f0956[_0x8f2b('0x35')][_0x8f2b('0x3e')]);_0x445969['where']=qs[_0x8f2b('0x36')](_['pick'](_0x5f0956[_0x8f2b('0x35')],_0x573129['filters']));if(_0x5f0956[_0x8f2b('0x35')][_0x8f2b('0x47')]){_0x445969[_0x8f2b('0x41')]=_[_0x8f2b('0x40')](_0x445969[_0x8f2b('0x41')],{'$or':_[_0x8f2b('0x42')](_0x445969[_0x8f2b('0x38')],function(_0x1b7570){var _0x47a7a1={};_0x47a7a1[_0x1b7570]={'$like':'%'+_0x5f0956[_0x8f2b('0x35')][_0x8f2b('0x47')]+'%'};return _0x47a7a1;})});}_0x445969=_[_0x8f2b('0x40')]({},_0x445969,_0x5f0956[_0x8f2b('0x48')]);return _0x55f82d[_0x8f2b('0x57')](_0x445969);}})['then'](function(_0x4be2ca){if(_0x4be2ca){_0x2c25df=_0x4be2ca[_0x8f2b('0x3a')];if(!_0x5f0956[_0x8f2b('0x35')]['hasOwnProperty'](_0x8f2b('0x3c'))){_0x445969[_0x8f2b('0x2a')]=qs['limit'](_0x5f0956[_0x8f2b('0x35')][_0x8f2b('0x2a')]);_0x445969[_0x8f2b('0x3d')]=qs[_0x8f2b('0x3d')](_0x5f0956['query'][_0x8f2b('0x3d')]);}return _0x55f82d[_0x8f2b('0x57')](_0x445969);}})[_0x8f2b('0x1b')](function(_0x2f0f63){if(_0x2f0f63){return _0x2f0f63?{'count':_0x2c25df,'rows':_0x2f0f63}:null;}})['then'](respondWithResult(_0xabe422,null))[_0x8f2b('0x25')](handleError(_0xabe422,null));};exports['getSubjects']=function(_0xbd4622,_0x598806,_0x9100c2){var _0x41822b={};var _0x3ff647={};var _0x35bbfd;var _0x1cc60f;return db[_0x8f2b('0x49')]['findOne']({'where':{'id':_0xbd4622['params']['id']}})['then'](handleEntityNotFound(_0x598806,null))[_0x8f2b('0x1b')](function(_0x2ef6b8){if(_0x2ef6b8){_0x35bbfd=_0x2ef6b8;_0x3ff647[_0x8f2b('0x33')]=_['keys'](db[_0x8f2b('0x55')]['rawAttributes']);_0x3ff647['query']=_[_0x8f2b('0x34')](_0xbd4622[_0x8f2b('0x35')]);_0x3ff647[_0x8f2b('0x36')]=_[_0x8f2b('0x37')](_0x3ff647[_0x8f2b('0x33')],_0x3ff647[_0x8f2b('0x35')]);_0x41822b['attributes']=_[_0x8f2b('0x37')](_0x3ff647[_0x8f2b('0x33')],qs[_0x8f2b('0x39')](_0xbd4622['query'][_0x8f2b('0x39')]));_0x41822b[_0x8f2b('0x38')]=_0x41822b[_0x8f2b('0x38')][_0x8f2b('0x3a')]?_0x41822b[_0x8f2b('0x38')]:_0x3ff647['model'];_0x41822b[_0x8f2b('0x56')]=qs[_0x8f2b('0x3e')](_0xbd4622[_0x8f2b('0x35')][_0x8f2b('0x3e')]);_0x41822b[_0x8f2b('0x41')]=qs[_0x8f2b('0x36')](_[_0x8f2b('0x3f')](_0xbd4622[_0x8f2b('0x35')],_0x3ff647['filters']));if(_0xbd4622[_0x8f2b('0x35')][_0x8f2b('0x47')]){_0x41822b[_0x8f2b('0x41')]=_[_0x8f2b('0x40')](_0x41822b[_0x8f2b('0x41')],{'$or':_['map'](_0x41822b['attributes'],function(_0x5567c4){var _0x31c58c={};_0x31c58c[_0x5567c4]={'$like':'%'+_0xbd4622[_0x8f2b('0x35')][_0x8f2b('0x47')]+'%'};return _0x31c58c;})});}_0x41822b=_[_0x8f2b('0x40')]({},_0x41822b,_0xbd4622['options']);return _0x35bbfd[_0x8f2b('0x58')](_0x41822b);}})[_0x8f2b('0x1b')](function(_0x431f6f){if(_0x431f6f){_0x1cc60f=_0x431f6f['length'];if(!_0xbd4622[_0x8f2b('0x35')][_0x8f2b('0x3b')]('nolimit')){_0x41822b[_0x8f2b('0x2a')]=qs[_0x8f2b('0x2a')](_0xbd4622[_0x8f2b('0x35')]['limit']);_0x41822b[_0x8f2b('0x3d')]=qs['offset'](_0xbd4622[_0x8f2b('0x35')][_0x8f2b('0x3d')]);}return _0x35bbfd[_0x8f2b('0x58')](_0x41822b);}})['then'](function(_0x16b5fd){if(_0x16b5fd){return _0x16b5fd?{'count':_0x1cc60f,'rows':_0x16b5fd}:null;}})[_0x8f2b('0x1b')](respondWithResult(_0x598806,null))['catch'](handleError(_0x598806,null));};exports[_0x8f2b('0x59')]=function(_0x4f1b29,_0x6cb3c6,_0x56c909){var _0x36e456={};var _0x4499a2={};var _0x3f72ef;var _0x49a9e4;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x4f1b29['params']['id']}})['then'](handleEntityNotFound(_0x6cb3c6,null))['then'](function(_0x23b762){if(_0x23b762){_0x3f72ef=_0x23b762;_0x4499a2[_0x8f2b('0x33')]=_[_0x8f2b('0x34')](db['VtigerField']['rawAttributes']);_0x4499a2[_0x8f2b('0x35')]=_[_0x8f2b('0x34')](_0x4f1b29[_0x8f2b('0x35')]);_0x4499a2['filters']=_[_0x8f2b('0x37')](_0x4499a2[_0x8f2b('0x33')],_0x4499a2['query']);_0x36e456[_0x8f2b('0x38')]=_['intersection'](_0x4499a2[_0x8f2b('0x33')],qs['fields'](_0x4f1b29[_0x8f2b('0x35')][_0x8f2b('0x39')]));_0x36e456[_0x8f2b('0x38')]=_0x36e456[_0x8f2b('0x38')][_0x8f2b('0x3a')]?_0x36e456[_0x8f2b('0x38')]:_0x4499a2[_0x8f2b('0x33')];_0x36e456[_0x8f2b('0x56')]=qs[_0x8f2b('0x3e')](_0x4f1b29['query'][_0x8f2b('0x3e')]);_0x36e456[_0x8f2b('0x41')]=qs['filters'](_[_0x8f2b('0x3f')](_0x4f1b29[_0x8f2b('0x35')],_0x4499a2[_0x8f2b('0x36')]));if(_0x4f1b29['query'][_0x8f2b('0x47')]){_0x36e456[_0x8f2b('0x41')]=_[_0x8f2b('0x40')](_0x36e456[_0x8f2b('0x41')],{'$or':_[_0x8f2b('0x42')](_0x36e456[_0x8f2b('0x38')],function(_0x33ffc7){var _0x562290={};_0x562290[_0x33ffc7]={'$like':'%'+_0x4f1b29['query'][_0x8f2b('0x47')]+'%'};return _0x562290;})});}_0x36e456=_[_0x8f2b('0x40')]({},_0x36e456,_0x4f1b29['options']);return _0x3f72ef['getDescriptions'](_0x36e456);}})['then'](function(_0x31c3dc){if(_0x31c3dc){_0x49a9e4=_0x31c3dc[_0x8f2b('0x3a')];if(!_0x4f1b29[_0x8f2b('0x35')][_0x8f2b('0x3b')](_0x8f2b('0x3c'))){_0x36e456[_0x8f2b('0x2a')]=qs[_0x8f2b('0x2a')](_0x4f1b29[_0x8f2b('0x35')][_0x8f2b('0x2a')]);_0x36e456[_0x8f2b('0x3d')]=qs['offset'](_0x4f1b29[_0x8f2b('0x35')][_0x8f2b('0x3d')]);}return _0x3f72ef[_0x8f2b('0x59')](_0x36e456);}})[_0x8f2b('0x1b')](function(_0x5521e7){if(_0x5521e7){return _0x5521e7?{'count':_0x49a9e4,'rows':_0x5521e7}:null;}})[_0x8f2b('0x1b')](respondWithResult(_0x6cb3c6,null))[_0x8f2b('0x25')](handleError(_0x6cb3c6,null));}; \ No newline at end of file +var _0xd62c=['key','VIRTUAL','field','options','includeAll','VtigerConfiguration','findAll','show','params','rawAttributes','length','include','find','create','body','findOne','map','getFields','getSubjects','VtigerField','getDescriptions','eml-format','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','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','info','request\x20sent','debug','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','catch','status','end','json','count','offset','limit','set','Content-Range','reject','update','destroy','sendStatus','stack','name','index','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type'];(function(_0xccc73e,_0x487285){var _0x282ce8=function(_0x27ff37){while(--_0x27ff37){_0xccc73e['push'](_0xccc73e['shift']());}};_0x282ce8(++_0x487285);}(_0xd62c,0x69));var _0xcd62=function(_0xc92806,_0x38f1db){_0xc92806=_0xc92806-0x0;var _0x13253c=_0xd62c[_0xc92806];return _0x13253c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcd62('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcd62('0x1'));var rp=require(_0xcd62('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcd62('0x3'));var util=require('util');var path=require('path');var sox=require(_0xcd62('0x4'));var csv=require(_0xcd62('0x5'));var ejs=require(_0xcd62('0x6'));var fs=require('fs');var _=require(_0xcd62('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcd62('0x8'));var deskjs=require(_0xcd62('0x9'));var toCsv=require(_0xcd62('0x5'));var querystring=require(_0xcd62('0xa'));var Papa=require(_0xcd62('0xb'));var Redis=require(_0xcd62('0xc'));var authService=require(_0xcd62('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xcd62('0xe'));var logger=require('../../config/logger')(_0xcd62('0xf'));var utils=require(_0xcd62('0x10'));var config=require(_0xcd62('0x11'));var db=require('../../mysqldb')['db'];var jayson=require(_0xcd62('0x12'));var client=jayson[_0xcd62('0x13')]['http']({'port':0x232a});function checkPasswordPattern(_0x1f94ce,_0x46c0c1,_0x38a846){if(_0x38a846){var _0x91abc8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x91abc8[_0xcd62('0x14')](_0x46c0c1)){return _0x1f94ce;}else{throw new Error(_0xcd62('0x15'));}}else{return _0x1f94ce;}}function respondWithRpcPromise(_0x3d7561,_0x20f39f,_0x40b0d5,_0x931929){return new BPromise(function(_0x14cfee,_0x5d4459){var _0x1b52b2=_0x931929||client;return _0x1b52b2['request'](_0x3d7561,_0x40b0d5)[_0xcd62('0x16')](function(_0x164111){logger[_0xcd62('0x17')]('VtigerConfiguration,\x20%s,\x20%s',_0x20f39f,_0xcd62('0x18'));logger[_0xcd62('0x19')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x20f39f,_0xcd62('0x18'),JSON[_0xcd62('0x1a')](_0x164111));if(_0x164111[_0xcd62('0x1b')]){if(_0x164111[_0xcd62('0x1b')][_0xcd62('0x1c')]===0x1f4){logger[_0xcd62('0x1b')](_0xcd62('0x1d'),_0x20f39f,_0x164111[_0xcd62('0x1b')][_0xcd62('0x1e')]);return _0x5d4459(_0x164111[_0xcd62('0x1b')][_0xcd62('0x1e')]);}logger[_0xcd62('0x1b')]('VtigerConfiguration,\x20%s,\x20%s',_0x20f39f,_0x164111['error'][_0xcd62('0x1e')]);return _0x14cfee(_0x164111[_0xcd62('0x1b')][_0xcd62('0x1e')]);}else{logger[_0xcd62('0x17')]('VtigerConfiguration,\x20%s,\x20%s',_0x20f39f,'request\x20sent');_0x14cfee(_0x164111['result'][_0xcd62('0x1e')]);}})[_0xcd62('0x1f')](function(_0x18b4a3){logger['error'](_0xcd62('0x1d'),_0x20f39f,_0x18b4a3);_0x5d4459(_0x18b4a3);});});}function respondWithStatusCode(_0x35d147,_0x210c6b){_0x210c6b=_0x210c6b||0xcc;return function(_0x882135){if(_0x882135){return _0x35d147['sendStatus'](_0x210c6b);}return _0x35d147[_0xcd62('0x20')](_0x210c6b)[_0xcd62('0x21')]();};}function respondWithResult(_0x1b1f49,_0x8e1207){_0x8e1207=_0x8e1207||0xc8;return function(_0x43dad7){if(_0x43dad7){return _0x1b1f49[_0xcd62('0x20')](_0x8e1207)[_0xcd62('0x22')](_0x43dad7);}};}function respondWithFilteredResult(_0x36a4f3,_0x5c5d09){return function(_0x776b84){if(_0x776b84){var _0x3de4de=_0x776b84[_0xcd62('0x23')],_0x155e2c=_0x5c5d09[_0xcd62('0x24')],_0x36d153=_0x5c5d09[_0xcd62('0x24')]+_0x5c5d09[_0xcd62('0x25')],_0x52cd98;if(_0x36d153>=_0x3de4de){_0x36d153=_0x3de4de;_0x52cd98=0xc8;}else{_0x52cd98=0xce;}_0x36a4f3[_0xcd62('0x20')](_0x52cd98);return _0x36a4f3[_0xcd62('0x26')](_0xcd62('0x27'),_0x155e2c+'-'+_0x36d153+'/'+_0x3de4de)[_0xcd62('0x22')](_0x776b84);}return null;};}function patchUpdates(_0x54691b){return function(_0x44163b){try{jsonpatch['apply'](_0x44163b,_0x54691b,!![]);}catch(_0x446d6a){return BPromise[_0xcd62('0x28')](_0x446d6a);}return _0x44163b['save']();};}function saveUpdates(_0x11f428,_0x53f9ef){return function(_0x3e7c4d){if(_0x3e7c4d){return _0x3e7c4d[_0xcd62('0x29')](_0x11f428)[_0xcd62('0x16')](function(_0x59453f){return _0x59453f;});}return null;};}function removeEntity(_0x1bf737,_0x40e1b4){return function(_0x3ff66d){if(_0x3ff66d){return _0x3ff66d[_0xcd62('0x2a')]()['then'](function(){_0x1bf737[_0xcd62('0x20')](0xcc)[_0xcd62('0x21')]();});}};}function handleEntityNotFound(_0x10dab2,_0x1f8140){return function(_0x18ea31){if(!_0x18ea31){_0x10dab2[_0xcd62('0x2b')](0x194);}return _0x18ea31;};}function handleError(_0x307fed,_0x30cde3){_0x30cde3=_0x30cde3||0x1f4;return function(_0x2e7fce){logger[_0xcd62('0x1b')](_0x2e7fce[_0xcd62('0x2c')]);if(_0x2e7fce[_0xcd62('0x2d')]){delete _0x2e7fce[_0xcd62('0x2d')];}_0x307fed[_0xcd62('0x20')](_0x30cde3)['send'](_0x2e7fce);};}exports[_0xcd62('0x2e')]=function(_0x40a810,_0xbf2ae9){var _0x123c1a={},_0x5bfe39={},_0x23203e={'count':0x0,'rows':[]};var _0x239e7f=db['VtigerConfiguration']['rawAttributes'];_0x5bfe39[_0xcd62('0x2f')]=_[_0xcd62('0x30')](_0x239e7f);_0x5bfe39[_0xcd62('0x31')]=_['keys'](_0x40a810[_0xcd62('0x31')]);_0x5bfe39[_0xcd62('0x32')]=_[_0xcd62('0x33')](_0x5bfe39[_0xcd62('0x2f')],_0x5bfe39['query']);_0x123c1a['attributes']=_['intersection'](_0x5bfe39[_0xcd62('0x2f')],qs[_0xcd62('0x34')](_0x40a810[_0xcd62('0x31')]['fields']));_0x123c1a[_0xcd62('0x35')]=_0x123c1a['attributes']['length']?_0x123c1a['attributes']:_0x5bfe39[_0xcd62('0x2f')];if(!_0x40a810[_0xcd62('0x31')][_0xcd62('0x36')](_0xcd62('0x37'))){_0x123c1a[_0xcd62('0x25')]=qs[_0xcd62('0x25')](_0x40a810[_0xcd62('0x31')]['limit']);_0x123c1a['offset']=qs[_0xcd62('0x24')](_0x40a810['query'][_0xcd62('0x24')]);}_0x123c1a[_0xcd62('0x38')]=qs[_0xcd62('0x39')](_0x40a810['query'][_0xcd62('0x39')]);_0x123c1a[_0xcd62('0x3a')]=qs[_0xcd62('0x32')](_[_0xcd62('0x3b')](_0x40a810[_0xcd62('0x31')],_0x5bfe39[_0xcd62('0x32')]));if(_0x40a810[_0xcd62('0x31')][_0xcd62('0x3c')]){_0x123c1a[_0xcd62('0x3a')]=_[_0xcd62('0x3d')](_0x123c1a[_0xcd62('0x3a')],{'$or':_['map'](_0x239e7f,function(_0x1c2399){if(_0x1c2399[_0xcd62('0x3e')][_0xcd62('0x3f')]!==_0xcd62('0x40')){var _0x545c89={};_0x545c89[_0x1c2399[_0xcd62('0x41')]]={'$like':'%'+_0x40a810['query'][_0xcd62('0x3c')]+'%'};return _0x545c89;}})});}_0x123c1a=_[_0xcd62('0x3d')]({},_0x123c1a,_0x40a810[_0xcd62('0x42')]);var _0x1d3c50={'where':_0x123c1a['where']};return db['VtigerConfiguration'][_0xcd62('0x23')](_0x1d3c50)['then'](function(_0x54bfb7){_0x23203e['count']=_0x54bfb7;if(_0x40a810[_0xcd62('0x31')][_0xcd62('0x43')]){_0x123c1a['include']=[{'all':!![]}];}return db[_0xcd62('0x44')][_0xcd62('0x45')](_0x123c1a);})[_0xcd62('0x16')](function(_0x3e9b04){_0x23203e['rows']=_0x3e9b04;return _0x23203e;})['then'](respondWithFilteredResult(_0xbf2ae9,_0x123c1a))[_0xcd62('0x1f')](handleError(_0xbf2ae9,null));};exports[_0xcd62('0x46')]=function(_0x301850,_0x5daf83){var _0x1f95bf={'raw':![],'where':{'id':_0x301850[_0xcd62('0x47')]['id']}},_0x29396a={};_0x29396a['model']=_[_0xcd62('0x30')](db[_0xcd62('0x44')][_0xcd62('0x48')]);_0x29396a[_0xcd62('0x31')]=_[_0xcd62('0x30')](_0x301850[_0xcd62('0x31')]);_0x29396a[_0xcd62('0x32')]=_[_0xcd62('0x33')](_0x29396a[_0xcd62('0x2f')],_0x29396a[_0xcd62('0x31')]);_0x1f95bf[_0xcd62('0x35')]=_[_0xcd62('0x33')](_0x29396a[_0xcd62('0x2f')],qs[_0xcd62('0x34')](_0x301850[_0xcd62('0x31')][_0xcd62('0x34')]));_0x1f95bf[_0xcd62('0x35')]=_0x1f95bf['attributes'][_0xcd62('0x49')]?_0x1f95bf[_0xcd62('0x35')]:_0x29396a[_0xcd62('0x2f')];if(_0x301850[_0xcd62('0x31')][_0xcd62('0x43')]){_0x1f95bf[_0xcd62('0x4a')]=[{'all':!![]}];}_0x1f95bf=_['merge']({},_0x1f95bf,_0x301850['options']);return db[_0xcd62('0x44')][_0xcd62('0x4b')](_0x1f95bf)[_0xcd62('0x16')](handleEntityNotFound(_0x5daf83,null))[_0xcd62('0x16')](respondWithResult(_0x5daf83,null))[_0xcd62('0x1f')](handleError(_0x5daf83,null));};exports[_0xcd62('0x4c')]=function(_0x496416,_0x56d56c){return db[_0xcd62('0x44')]['create'](_0x496416[_0xcd62('0x4d')],{})['then'](respondWithResult(_0x56d56c,0xc9))[_0xcd62('0x1f')](handleError(_0x56d56c,null));};exports[_0xcd62('0x29')]=function(_0x1f76f5,_0x1d442a){if(_0x1f76f5[_0xcd62('0x4d')]['id']){delete _0x1f76f5[_0xcd62('0x4d')]['id'];}return db['VtigerConfiguration'][_0xcd62('0x4b')]({'where':{'id':_0x1f76f5[_0xcd62('0x47')]['id']}})[_0xcd62('0x16')](handleEntityNotFound(_0x1d442a,null))['then'](saveUpdates(_0x1f76f5['body'],null))[_0xcd62('0x16')](respondWithResult(_0x1d442a,null))[_0xcd62('0x1f')](handleError(_0x1d442a,null));};exports['destroy']=function(_0x42a1ca,_0x973d9){return db[_0xcd62('0x44')][_0xcd62('0x4b')]({'where':{'id':_0x42a1ca['params']['id']}})['then'](handleEntityNotFound(_0x973d9,null))[_0xcd62('0x16')](removeEntity(_0x973d9,null))[_0xcd62('0x1f')](handleError(_0x973d9,null));};exports['getFields']=function(_0x3761be,_0x121b4a,_0x1fccf2){var _0x278733={};var _0x3a4deb={};var _0x1a1ff1;var _0x57e841;return db['VtigerConfiguration'][_0xcd62('0x4e')]({'where':{'id':_0x3761be[_0xcd62('0x47')]['id']}})[_0xcd62('0x16')](handleEntityNotFound(_0x121b4a,null))[_0xcd62('0x16')](function(_0x2c2102){if(_0x2c2102){_0x1a1ff1=_0x2c2102;_0x3a4deb[_0xcd62('0x2f')]=_[_0xcd62('0x30')](db['VtigerField'][_0xcd62('0x48')]);_0x3a4deb['query']=_[_0xcd62('0x30')](_0x3761be[_0xcd62('0x31')]);_0x3a4deb[_0xcd62('0x32')]=_[_0xcd62('0x33')](_0x3a4deb['model'],_0x3a4deb[_0xcd62('0x31')]);_0x278733['attributes']=_['intersection'](_0x3a4deb[_0xcd62('0x2f')],qs[_0xcd62('0x34')](_0x3761be[_0xcd62('0x31')][_0xcd62('0x34')]));_0x278733[_0xcd62('0x35')]=_0x278733[_0xcd62('0x35')][_0xcd62('0x49')]?_0x278733['attributes']:_0x3a4deb[_0xcd62('0x2f')];_0x278733['order']=qs[_0xcd62('0x39')](_0x3761be[_0xcd62('0x31')]['sort']);_0x278733['where']=qs[_0xcd62('0x32')](_['pick'](_0x3761be['query'],_0x3a4deb[_0xcd62('0x32')]));if(_0x3761be[_0xcd62('0x31')][_0xcd62('0x3c')]){_0x278733[_0xcd62('0x3a')]=_[_0xcd62('0x3d')](_0x278733['where'],{'$or':_[_0xcd62('0x4f')](_0x278733[_0xcd62('0x35')],function(_0x3d13e8){var _0x13d9e5={};_0x13d9e5[_0x3d13e8]={'$like':'%'+_0x3761be[_0xcd62('0x31')][_0xcd62('0x3c')]+'%'};return _0x13d9e5;})});}_0x278733=_['merge']({},_0x278733,_0x3761be['options']);return _0x1a1ff1[_0xcd62('0x50')](_0x278733);}})[_0xcd62('0x16')](function(_0x4a2cb9){if(_0x4a2cb9){_0x57e841=_0x4a2cb9[_0xcd62('0x49')];if(!_0x3761be[_0xcd62('0x31')]['hasOwnProperty'](_0xcd62('0x37'))){_0x278733[_0xcd62('0x25')]=qs[_0xcd62('0x25')](_0x3761be[_0xcd62('0x31')][_0xcd62('0x25')]);_0x278733['offset']=qs[_0xcd62('0x24')](_0x3761be[_0xcd62('0x31')]['offset']);}return _0x1a1ff1[_0xcd62('0x50')](_0x278733);}})[_0xcd62('0x16')](function(_0x57ecbd){if(_0x57ecbd){return _0x57ecbd?{'count':_0x57e841,'rows':_0x57ecbd}:null;}})['then'](respondWithResult(_0x121b4a,null))[_0xcd62('0x1f')](handleError(_0x121b4a,null));};exports[_0xcd62('0x51')]=function(_0x1b1724,_0x40b4f8,_0x3b0d6f){var _0x126f8b={};var _0x22b706={};var _0x715a6f;var _0x575ca3;return db['VtigerConfiguration'][_0xcd62('0x4e')]({'where':{'id':_0x1b1724['params']['id']}})[_0xcd62('0x16')](handleEntityNotFound(_0x40b4f8,null))[_0xcd62('0x16')](function(_0x56b9b0){if(_0x56b9b0){_0x715a6f=_0x56b9b0;_0x22b706[_0xcd62('0x2f')]=_[_0xcd62('0x30')](db[_0xcd62('0x52')][_0xcd62('0x48')]);_0x22b706[_0xcd62('0x31')]=_['keys'](_0x1b1724[_0xcd62('0x31')]);_0x22b706[_0xcd62('0x32')]=_[_0xcd62('0x33')](_0x22b706['model'],_0x22b706['query']);_0x126f8b[_0xcd62('0x35')]=_['intersection'](_0x22b706['model'],qs[_0xcd62('0x34')](_0x1b1724[_0xcd62('0x31')]['fields']));_0x126f8b['attributes']=_0x126f8b[_0xcd62('0x35')][_0xcd62('0x49')]?_0x126f8b[_0xcd62('0x35')]:_0x22b706[_0xcd62('0x2f')];_0x126f8b[_0xcd62('0x38')]=qs['sort'](_0x1b1724[_0xcd62('0x31')][_0xcd62('0x39')]);_0x126f8b[_0xcd62('0x3a')]=qs[_0xcd62('0x32')](_[_0xcd62('0x3b')](_0x1b1724['query'],_0x22b706[_0xcd62('0x32')]));if(_0x1b1724[_0xcd62('0x31')][_0xcd62('0x3c')]){_0x126f8b[_0xcd62('0x3a')]=_[_0xcd62('0x3d')](_0x126f8b[_0xcd62('0x3a')],{'$or':_['map'](_0x126f8b[_0xcd62('0x35')],function(_0x34f842){var _0x12b94e={};_0x12b94e[_0x34f842]={'$like':'%'+_0x1b1724['query'][_0xcd62('0x3c')]+'%'};return _0x12b94e;})});}_0x126f8b=_[_0xcd62('0x3d')]({},_0x126f8b,_0x1b1724[_0xcd62('0x42')]);return _0x715a6f[_0xcd62('0x51')](_0x126f8b);}})[_0xcd62('0x16')](function(_0x5bc74f){if(_0x5bc74f){_0x575ca3=_0x5bc74f[_0xcd62('0x49')];if(!_0x1b1724[_0xcd62('0x31')][_0xcd62('0x36')](_0xcd62('0x37'))){_0x126f8b[_0xcd62('0x25')]=qs[_0xcd62('0x25')](_0x1b1724['query'][_0xcd62('0x25')]);_0x126f8b[_0xcd62('0x24')]=qs[_0xcd62('0x24')](_0x1b1724['query'][_0xcd62('0x24')]);}return _0x715a6f[_0xcd62('0x51')](_0x126f8b);}})['then'](function(_0x4ce62a){if(_0x4ce62a){return _0x4ce62a?{'count':_0x575ca3,'rows':_0x4ce62a}:null;}})[_0xcd62('0x16')](respondWithResult(_0x40b4f8,null))[_0xcd62('0x1f')](handleError(_0x40b4f8,null));};exports['getDescriptions']=function(_0x350d63,_0x40bb05,_0x2a1933){var _0x1088cb={};var _0x346ea3={};var _0x52c66e;var _0x5a1a52;return db['VtigerConfiguration'][_0xcd62('0x4e')]({'where':{'id':_0x350d63['params']['id']}})[_0xcd62('0x16')](handleEntityNotFound(_0x40bb05,null))['then'](function(_0x4a39df){if(_0x4a39df){_0x52c66e=_0x4a39df;_0x346ea3['model']=_[_0xcd62('0x30')](db[_0xcd62('0x52')][_0xcd62('0x48')]);_0x346ea3['query']=_[_0xcd62('0x30')](_0x350d63[_0xcd62('0x31')]);_0x346ea3[_0xcd62('0x32')]=_[_0xcd62('0x33')](_0x346ea3[_0xcd62('0x2f')],_0x346ea3[_0xcd62('0x31')]);_0x1088cb[_0xcd62('0x35')]=_[_0xcd62('0x33')](_0x346ea3[_0xcd62('0x2f')],qs['fields'](_0x350d63['query'][_0xcd62('0x34')]));_0x1088cb[_0xcd62('0x35')]=_0x1088cb['attributes']['length']?_0x1088cb['attributes']:_0x346ea3[_0xcd62('0x2f')];_0x1088cb[_0xcd62('0x38')]=qs[_0xcd62('0x39')](_0x350d63[_0xcd62('0x31')]['sort']);_0x1088cb['where']=qs[_0xcd62('0x32')](_[_0xcd62('0x3b')](_0x350d63[_0xcd62('0x31')],_0x346ea3[_0xcd62('0x32')]));if(_0x350d63[_0xcd62('0x31')][_0xcd62('0x3c')]){_0x1088cb[_0xcd62('0x3a')]=_[_0xcd62('0x3d')](_0x1088cb['where'],{'$or':_[_0xcd62('0x4f')](_0x1088cb[_0xcd62('0x35')],function(_0x363ad0){var _0x23740c={};_0x23740c[_0x363ad0]={'$like':'%'+_0x350d63[_0xcd62('0x31')][_0xcd62('0x3c')]+'%'};return _0x23740c;})});}_0x1088cb=_[_0xcd62('0x3d')]({},_0x1088cb,_0x350d63[_0xcd62('0x42')]);return _0x52c66e[_0xcd62('0x53')](_0x1088cb);}})['then'](function(_0x166168){if(_0x166168){_0x5a1a52=_0x166168[_0xcd62('0x49')];if(!_0x350d63[_0xcd62('0x31')]['hasOwnProperty']('nolimit')){_0x1088cb[_0xcd62('0x25')]=qs[_0xcd62('0x25')](_0x350d63[_0xcd62('0x31')][_0xcd62('0x25')]);_0x1088cb[_0xcd62('0x24')]=qs[_0xcd62('0x24')](_0x350d63['query']['offset']);}return _0x52c66e[_0xcd62('0x53')](_0x1088cb);}})['then'](function(_0x330b7f){if(_0x330b7f){return _0x330b7f?{'count':_0x5a1a52,'rows':_0x330b7f}:null;}})[_0xcd62('0x16')](respondWithResult(_0x40bb05,null))['catch'](handleError(_0x40bb05,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index f24f621..7f2de11 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 _0xa9e0=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x308227,_0x324908){var _0x5bcbb2=function(_0x241e57){while(--_0x241e57){_0x308227['push'](_0x308227['shift']());}};_0x5bcbb2(++_0x324908);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x5a188a,_0x17d262){var _0x5bb23c=function(_0x20a384){while(--_0x20a384){_0x5a188a['push'](_0x5a188a['shift']());}};_0x5bb23c(++_0x17d262);}(_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 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':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index e4cf9b7..940e510 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 _0x17f7=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x44249d,_0xcf593a){var _0x435090=function(_0x1612a4){while(--_0x1612a4){_0x44249d['push'](_0x44249d['shift']());}};_0x435090(++_0xcf593a);}(_0x17f7,0x155));var _0x717f=function(_0x4672a3,_0x10240c){_0x4672a3=_0x4672a3-0x0;var _0x25ec8b=_0x17f7[_0x4672a3];return _0x25ec8b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x717f('0x0'));var BPromise=require(_0x717f('0x1'));var rs=require(_0x717f('0x2'));var fs=require('fs');var Redis=require(_0x717f('0x3'));var db=require(_0x717f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x717f('0x5'))('rpc');var config=require(_0x717f('0x6'));var jayson=require(_0x717f('0x7'));var client=jayson[_0x717f('0x8')][_0x717f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f5cea,_0x422712,_0x965e52){return new BPromise(function(_0x3a9465,_0x89d5ac){return client[_0x717f('0xa')](_0x2f5cea,_0x965e52)[_0x717f('0xb')](function(_0x26d484){logger[_0x717f('0xc')](_0x717f('0xd'),_0x422712,_0x717f('0xe'));logger[_0x717f('0xf')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x422712,'request\x20sent',JSON[_0x717f('0x10')](_0x26d484));if(_0x26d484['error']){if(_0x26d484[_0x717f('0x11')]['code']===0x1f4){logger[_0x717f('0x11')](_0x717f('0xd'),_0x422712,_0x26d484[_0x717f('0x11')][_0x717f('0x12')]);return _0x89d5ac(_0x26d484['error'][_0x717f('0x12')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x422712,_0x26d484['error'][_0x717f('0x12')]);return _0x3a9465(_0x26d484[_0x717f('0x11')][_0x717f('0x12')]);}else{logger['info'](_0x717f('0xd'),_0x422712,_0x717f('0xe'));_0x3a9465(_0x26d484['result'][_0x717f('0x12')]);}})[_0x717f('0x13')](function(_0x35e813){logger[_0x717f('0x11')](_0x717f('0xd'),_0x422712,_0x35e813);_0x89d5ac(_0x35e813);});});} \ No newline at end of file +var _0x0622=['VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','request','then','info','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0622,0x1ab));var _0x2062=function(_0x33822d,_0x4a2a19){_0x33822d=_0x33822d-0x0;var _0x21335d=_0x0622[_0x33822d];return _0x21335d;};'use strict';var _=require(_0x2062('0x0'));var util=require(_0x2062('0x1'));var moment=require(_0x2062('0x2'));var BPromise=require(_0x2062('0x3'));var rs=require(_0x2062('0x4'));var fs=require('fs');var Redis=require(_0x2062('0x5'));var db=require(_0x2062('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2062('0x7'))('rpc');var config=require(_0x2062('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2062('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x428361,_0x4f9748,_0x1e6dbf){return new BPromise(function(_0x309015,_0x57c5f0){return client[_0x2062('0xa')](_0x428361,_0x1e6dbf)[_0x2062('0xb')](function(_0x421edf){logger[_0x2062('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x4f9748,_0x2062('0xd'));logger['debug'](_0x2062('0xe'),_0x4f9748,_0x2062('0xd'),JSON[_0x2062('0xf')](_0x421edf));if(_0x421edf[_0x2062('0x10')]){if(_0x421edf['error'][_0x2062('0x11')]===0x1f4){logger['error'](_0x2062('0x12'),_0x4f9748,_0x421edf[_0x2062('0x10')][_0x2062('0x13')]);return _0x57c5f0(_0x421edf['error'][_0x2062('0x13')]);}logger[_0x2062('0x10')](_0x2062('0x12'),_0x4f9748,_0x421edf[_0x2062('0x10')][_0x2062('0x13')]);return _0x309015(_0x421edf[_0x2062('0x10')][_0x2062('0x13')]);}else{logger[_0x2062('0xc')](_0x2062('0x12'),_0x4f9748,_0x2062('0xd'));_0x309015(_0x421edf['result'][_0x2062('0x13')]);}})[_0x2062('0x14')](function(_0x5e5284){logger['error'](_0x2062('0x12'),_0x4f9748,_0x5e5284);_0x57c5f0(_0x5e5284);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index f34be39..072c1fc 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 _0xea12=['/:id','show','post','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index'];(function(_0x4e6b3c,_0x2ad9db){var _0x344aaf=function(_0x419b2){while(--_0x419b2){_0x4e6b3c['push'](_0x4e6b3c['shift']());}};_0x344aaf(++_0x2ad9db);}(_0xea12,0x17c));var _0x2ea1=function(_0x39b763,_0x1a6653){_0x39b763=_0x39b763-0x0;var _0x3fb6de=_0xea12[_0x39b763];return _0x3fb6de;};'use strict';var multer=require('multer');var util=require(_0x2ea1('0x0'));var path=require(_0x2ea1('0x1'));var timeout=require(_0x2ea1('0x2'));var express=require('express');var router=express[_0x2ea1('0x3')]();var auth=require(_0x2ea1('0x4'));var interaction=require(_0x2ea1('0x5'));var config=require(_0x2ea1('0x6'));var controller=require(_0x2ea1('0x7'));router[_0x2ea1('0x8')]('/',auth[_0x2ea1('0x9')](),controller[_0x2ea1('0xa')]);router[_0x2ea1('0x8')](_0x2ea1('0xb'),auth['isAuthenticated'](),controller[_0x2ea1('0xc')]);router[_0x2ea1('0xd')]('/',auth[_0x2ea1('0x9')](),controller['create']);router['put'](_0x2ea1('0xb'),auth[_0x2ea1('0x9')](),controller[_0x2ea1('0xe')]);router['delete']('/:id',auth[_0x2ea1('0x9')](),controller[_0x2ea1('0xf')]);module[_0x2ea1('0x10')]=router; \ No newline at end of file +var _0xf8f1=['../../config/environment','get','isAuthenticated','index','/:id','show','put','update','destroy','exports','multer','path','express','Router','../../components/auth/service'];(function(_0x395155,_0x192ffd){var _0x179767=function(_0xb18ee3){while(--_0xb18ee3){_0x395155['push'](_0x395155['shift']());}};_0x179767(++_0x192ffd);}(_0xf8f1,0xcd));var _0x1f8f=function(_0x5a92ad,_0x2219a6){_0x5a92ad=_0x5a92ad-0x0;var _0x2466f8=_0xf8f1[_0x5a92ad];return _0x2466f8;};'use strict';var multer=require(_0x1f8f('0x0'));var util=require('util');var path=require(_0x1f8f('0x1'));var timeout=require('connect-timeout');var express=require(_0x1f8f('0x2'));var router=express[_0x1f8f('0x3')]();var auth=require(_0x1f8f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1f8f('0x5'));var controller=require('./intVtigerField.controller');router[_0x1f8f('0x6')]('/',auth[_0x1f8f('0x7')](),controller[_0x1f8f('0x8')]);router[_0x1f8f('0x6')](_0x1f8f('0x9'),auth[_0x1f8f('0x7')](),controller[_0x1f8f('0xa')]);router['post']('/',auth[_0x1f8f('0x7')](),controller['create']);router[_0x1f8f('0xb')]('/:id',auth[_0x1f8f('0x7')](),controller[_0x1f8f('0xc')]);router['delete'](_0x1f8f('0x9'),auth[_0x1f8f('0x7')](),controller[_0x1f8f('0xd')]);module[_0x1f8f('0xe')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 424f3ae..59a9451 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 _0x9348=['exports','ENUM','string','variable','keyValue','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x554c78,_0xa2c882){var _0x263b0f=function(_0x5af6fc){while(--_0x5af6fc){_0x554c78['push'](_0x554c78['shift']());}};_0x263b0f(++_0xa2c882);}(_0x9348,0x10d));var _0x8934=function(_0x1b0ca6,_0x174f60){_0x1b0ca6=_0x1b0ca6-0x0;var _0x226e4a=_0x9348[_0x1b0ca6];return _0x226e4a;};'use strict';var Sequelize=require(_0x8934('0x0'));module[_0x8934('0x1')]={'type':{'type':Sequelize[_0x8934('0x2')](_0x8934('0x3'),_0x8934('0x4'),'customVariable',_0x8934('0x5')),'defaultValue':_0x8934('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8934('0x6')]},'keyType':{'type':Sequelize[_0x8934('0x2')](_0x8934('0x3'),_0x8934('0x4'),_0x8934('0x7'))},'keyContent':{'type':Sequelize[_0x8934('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8934('0x6')]},'customField':{'type':Sequelize[_0x8934('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8934('0x6')]}}; \ No newline at end of file +var _0xdace=['variable','keyValue','STRING','customVariable','BOOLEAN','sequelize','ENUM','string'];(function(_0x566956,_0x104ff1){var _0x502468=function(_0x500e13){while(--_0x500e13){_0x566956['push'](_0x566956['shift']());}};_0x502468(++_0x104ff1);}(_0xdace,0xc5));var _0xedac=function(_0x5d8018,_0x588592){_0x5d8018=_0x5d8018-0x0;var _0x151ac4=_0xdace[_0x5d8018];return _0x151ac4;};'use strict';var Sequelize=require(_0xedac('0x0'));module['exports']={'type':{'type':Sequelize[_0xedac('0x1')](_0xedac('0x2'),_0xedac('0x3'),'customVariable',_0xedac('0x4')),'defaultValue':_0xedac('0x2')},'content':{'type':Sequelize[_0xedac('0x5')]},'key':{'type':Sequelize[_0xedac('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xedac('0x2'),_0xedac('0x3'),_0xedac('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xedac('0x5')]},'nameField':{'type':Sequelize[_0xedac('0x5')]},'customField':{'type':Sequelize[_0xedac('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 65e4191..7547a09 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 _0x1c7c=['Content-Range','apply','reject','update','then','error','stack','name','send','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','VtigerField','create','body','find','destroy','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set'];(function(_0x2c5718,_0x47c690){var _0x4f984b=function(_0x2c18b2){while(--_0x2c18b2){_0x2c5718['push'](_0x2c5718['shift']());}};_0x4f984b(++_0x47c690);}(_0x1c7c,0x164));var _0xc1c7=function(_0x54e5b1,_0x253f07){_0x54e5b1=_0x54e5b1-0x0;var _0x1a02aa=_0x1c7c[_0x54e5b1];return _0x1a02aa;};'use strict';var pdf=require(_0xc1c7('0x0'));var emlformat=require(_0xc1c7('0x1'));var rimraf=require(_0xc1c7('0x2'));var zipdir=require(_0xc1c7('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc1c7('0x4'));var moment=require('moment');var BPromise=require(_0xc1c7('0x5'));var Mustache=require(_0xc1c7('0x6'));var util=require(_0xc1c7('0x7'));var path=require(_0xc1c7('0x8'));var sox=require(_0xc1c7('0x9'));var csv=require(_0xc1c7('0xa'));var ejs=require(_0xc1c7('0xb'));var fs=require('fs');var _=require(_0xc1c7('0xc'));var squel=require(_0xc1c7('0xd'));var crypto=require(_0xc1c7('0xe'));var jsforce=require(_0xc1c7('0xf'));var deskjs=require(_0xc1c7('0x10'));var toCsv=require(_0xc1c7('0xa'));var querystring=require(_0xc1c7('0x11'));var Papa=require(_0xc1c7('0x12'));var Redis=require(_0xc1c7('0x13'));var authService=require(_0xc1c7('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xc1c7('0x15'));var logger=require(_0xc1c7('0x16'))('api');var utils=require(_0xc1c7('0x17'));var config=require(_0xc1c7('0x18'));var db=require(_0xc1c7('0x19'))['db'];function respondWithStatusCode(_0x5d58e5,_0x473248){_0x473248=_0x473248||0xcc;return function(_0x44bf88){if(_0x44bf88){return _0x5d58e5[_0xc1c7('0x1a')](_0x473248);}return _0x5d58e5[_0xc1c7('0x1b')](_0x473248)[_0xc1c7('0x1c')]();};}function respondWithResult(_0x2236a8,_0x40c313){_0x40c313=_0x40c313||0xc8;return function(_0x1b57ab){if(_0x1b57ab){return _0x2236a8[_0xc1c7('0x1b')](_0x40c313)[_0xc1c7('0x1d')](_0x1b57ab);}};}function respondWithFilteredResult(_0x99b874,_0x34d392){return function(_0x49576d){if(_0x49576d){var _0x3e1f0e=_0x49576d[_0xc1c7('0x1e')],_0x335600=_0x34d392[_0xc1c7('0x1f')],_0x21911c=_0x34d392[_0xc1c7('0x1f')]+_0x34d392[_0xc1c7('0x20')],_0x555b59;if(_0x21911c>=_0x3e1f0e){_0x21911c=_0x3e1f0e;_0x555b59=0xc8;}else{_0x555b59=0xce;}_0x99b874[_0xc1c7('0x1b')](_0x555b59);return _0x99b874[_0xc1c7('0x21')](_0xc1c7('0x22'),_0x335600+'-'+_0x21911c+'/'+_0x3e1f0e)[_0xc1c7('0x1d')](_0x49576d);}return null;};}function patchUpdates(_0x5d44e9){return function(_0x37d748){try{jsonpatch[_0xc1c7('0x23')](_0x37d748,_0x5d44e9,!![]);}catch(_0x3ec66a){return BPromise[_0xc1c7('0x24')](_0x3ec66a);}return _0x37d748['save']();};}function saveUpdates(_0x124fd8,_0x4d6171){return function(_0x5e7e4a){if(_0x5e7e4a){return _0x5e7e4a[_0xc1c7('0x25')](_0x124fd8)['then'](function(_0x5846f0){return _0x5846f0;});}return null;};}function removeEntity(_0x2d006f,_0x17a265){return function(_0x2f1b87){if(_0x2f1b87){return _0x2f1b87['destroy']()[_0xc1c7('0x26')](function(){_0x2d006f[_0xc1c7('0x1b')](0xcc)[_0xc1c7('0x1c')]();});}};}function handleEntityNotFound(_0x31a0e0,_0x2e64c4){return function(_0x3a2483){if(!_0x3a2483){_0x31a0e0[_0xc1c7('0x1a')](0x194);}return _0x3a2483;};}function handleError(_0x120168,_0x22b654){_0x22b654=_0x22b654||0x1f4;return function(_0x1540c1){logger[_0xc1c7('0x27')](_0x1540c1[_0xc1c7('0x28')]);if(_0x1540c1[_0xc1c7('0x29')]){delete _0x1540c1[_0xc1c7('0x29')];}_0x120168[_0xc1c7('0x1b')](_0x22b654)[_0xc1c7('0x2a')](_0x1540c1);};}exports['index']=function(_0xf0ab9c,_0x13a1f9){var _0x4e1721={},_0x52a1d5={},_0x352f24={'count':0x0,'rows':[]};var _0x539931=db['VtigerField'][_0xc1c7('0x2b')];_0x52a1d5[_0xc1c7('0x2c')]=_[_0xc1c7('0x2d')](_0x539931);_0x52a1d5[_0xc1c7('0x2e')]=_[_0xc1c7('0x2d')](_0xf0ab9c['query']);_0x52a1d5['filters']=_[_0xc1c7('0x2f')](_0x52a1d5[_0xc1c7('0x2c')],_0x52a1d5[_0xc1c7('0x2e')]);_0x4e1721[_0xc1c7('0x30')]=_[_0xc1c7('0x2f')](_0x52a1d5['model'],qs['fields'](_0xf0ab9c[_0xc1c7('0x2e')][_0xc1c7('0x31')]));_0x4e1721['attributes']=_0x4e1721[_0xc1c7('0x30')][_0xc1c7('0x32')]?_0x4e1721[_0xc1c7('0x30')]:_0x52a1d5[_0xc1c7('0x2c')];if(!_0xf0ab9c[_0xc1c7('0x2e')][_0xc1c7('0x33')](_0xc1c7('0x34'))){_0x4e1721['limit']=qs[_0xc1c7('0x20')](_0xf0ab9c[_0xc1c7('0x2e')][_0xc1c7('0x20')]);_0x4e1721[_0xc1c7('0x1f')]=qs[_0xc1c7('0x1f')](_0xf0ab9c[_0xc1c7('0x2e')][_0xc1c7('0x1f')]);}_0x4e1721[_0xc1c7('0x35')]=qs[_0xc1c7('0x36')](_0xf0ab9c['query']['sort']);_0x4e1721[_0xc1c7('0x37')]=qs[_0xc1c7('0x38')](_[_0xc1c7('0x39')](_0xf0ab9c[_0xc1c7('0x2e')],_0x52a1d5[_0xc1c7('0x38')]));if(_0xf0ab9c[_0xc1c7('0x2e')][_0xc1c7('0x3a')]){_0x4e1721[_0xc1c7('0x37')]=_[_0xc1c7('0x3b')](_0x4e1721[_0xc1c7('0x37')],{'$or':_[_0xc1c7('0x3c')](_0x539931,function(_0x3cb2a0){if(_0x3cb2a0[_0xc1c7('0x3d')][_0xc1c7('0x3e')]!==_0xc1c7('0x3f')){var _0x11ce7f={};_0x11ce7f[_0x3cb2a0[_0xc1c7('0x40')]]={'$like':'%'+_0xf0ab9c[_0xc1c7('0x2e')][_0xc1c7('0x3a')]+'%'};return _0x11ce7f;}})});}_0x4e1721=_[_0xc1c7('0x3b')]({},_0x4e1721,_0xf0ab9c[_0xc1c7('0x41')]);var _0x49e9ac={'where':_0x4e1721['where']};return db['VtigerField'][_0xc1c7('0x1e')](_0x49e9ac)['then'](function(_0x53bf70){_0x352f24[_0xc1c7('0x1e')]=_0x53bf70;if(_0xf0ab9c[_0xc1c7('0x2e')][_0xc1c7('0x42')]){_0x4e1721[_0xc1c7('0x43')]=[{'all':!![]}];}return db['VtigerField'][_0xc1c7('0x44')](_0x4e1721);})[_0xc1c7('0x26')](function(_0x32e9fd){_0x352f24[_0xc1c7('0x45')]=_0x32e9fd;return _0x352f24;})[_0xc1c7('0x26')](respondWithFilteredResult(_0x13a1f9,_0x4e1721))[_0xc1c7('0x46')](handleError(_0x13a1f9,null));};exports[_0xc1c7('0x47')]=function(_0x26343d,_0x1d4621){var _0x1810c7={'raw':!![],'where':{'id':_0x26343d[_0xc1c7('0x48')]['id']}},_0x955ba6={};_0x955ba6[_0xc1c7('0x2c')]=_['keys'](db[_0xc1c7('0x49')][_0xc1c7('0x2b')]);_0x955ba6['query']=_[_0xc1c7('0x2d')](_0x26343d[_0xc1c7('0x2e')]);_0x955ba6[_0xc1c7('0x38')]=_[_0xc1c7('0x2f')](_0x955ba6[_0xc1c7('0x2c')],_0x955ba6[_0xc1c7('0x2e')]);_0x1810c7[_0xc1c7('0x30')]=_[_0xc1c7('0x2f')](_0x955ba6[_0xc1c7('0x2c')],qs[_0xc1c7('0x31')](_0x26343d['query'][_0xc1c7('0x31')]));_0x1810c7[_0xc1c7('0x30')]=_0x1810c7['attributes']['length']?_0x1810c7[_0xc1c7('0x30')]:_0x955ba6[_0xc1c7('0x2c')];if(_0x26343d[_0xc1c7('0x2e')][_0xc1c7('0x42')]){_0x1810c7[_0xc1c7('0x43')]=[{'all':!![]}];}_0x1810c7=_['merge']({},_0x1810c7,_0x26343d[_0xc1c7('0x41')]);return db[_0xc1c7('0x49')]['find'](_0x1810c7)['then'](handleEntityNotFound(_0x1d4621,null))['then'](respondWithResult(_0x1d4621,null))[_0xc1c7('0x46')](handleError(_0x1d4621,null));};exports[_0xc1c7('0x4a')]=function(_0x169792,_0x57194c){return db[_0xc1c7('0x49')][_0xc1c7('0x4a')](_0x169792['body'],{})[_0xc1c7('0x26')](respondWithResult(_0x57194c,0xc9))[_0xc1c7('0x46')](handleError(_0x57194c,null));};exports[_0xc1c7('0x25')]=function(_0x13d412,_0xf8b797){if(_0x13d412[_0xc1c7('0x4b')]['id']){delete _0x13d412[_0xc1c7('0x4b')]['id'];}return db[_0xc1c7('0x49')][_0xc1c7('0x4c')]({'where':{'id':_0x13d412[_0xc1c7('0x48')]['id']}})[_0xc1c7('0x26')](handleEntityNotFound(_0xf8b797,null))[_0xc1c7('0x26')](saveUpdates(_0x13d412[_0xc1c7('0x4b')],null))[_0xc1c7('0x26')](respondWithResult(_0xf8b797,null))[_0xc1c7('0x46')](handleError(_0xf8b797,null));};exports[_0xc1c7('0x4d')]=function(_0x2967b7,_0x1addc8){return db['VtigerField'][_0xc1c7('0x4c')]({'where':{'id':_0x2967b7['params']['id']}})[_0xc1c7('0x26')](handleEntityNotFound(_0x1addc8,null))[_0xc1c7('0x26')](removeEntity(_0x1addc8,null))[_0xc1c7('0x46')](handleError(_0x1addc8,null));}; \ No newline at end of file +var _0x16d2=['options','includeAll','include','catch','show','params','length','merge','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','index','VtigerField','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','map','type','key','filter'];(function(_0x5bc467,_0x226e6a){var _0x57d630=function(_0x5ba99b){while(--_0x5ba99b){_0x5bc467['push'](_0x5bc467['shift']());}};_0x57d630(++_0x226e6a);}(_0x16d2,0x123));var _0x216d=function(_0x4776ba,_0x250658){_0x4776ba=_0x4776ba-0x0;var _0x354c17=_0x16d2[_0x4776ba];return _0x354c17;};'use strict';var pdf=require(_0x216d('0x0'));var emlformat=require(_0x216d('0x1'));var rimraf=require(_0x216d('0x2'));var zipdir=require(_0x216d('0x3'));var jsonpatch=require(_0x216d('0x4'));var rp=require(_0x216d('0x5'));var moment=require(_0x216d('0x6'));var BPromise=require(_0x216d('0x7'));var Mustache=require(_0x216d('0x8'));var util=require('util');var path=require(_0x216d('0x9'));var sox=require(_0x216d('0xa'));var csv=require(_0x216d('0xb'));var ejs=require(_0x216d('0xc'));var fs=require('fs');var _=require(_0x216d('0xd'));var squel=require(_0x216d('0xe'));var crypto=require(_0x216d('0xf'));var jsforce=require(_0x216d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x216d('0xb'));var querystring=require(_0x216d('0x11'));var Papa=require(_0x216d('0x12'));var Redis=require(_0x216d('0x13'));var authService=require(_0x216d('0x14'));var qs=require(_0x216d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x216d('0x16'))('api');var utils=require(_0x216d('0x17'));var config=require(_0x216d('0x18'));var db=require(_0x216d('0x19'))['db'];function respondWithStatusCode(_0x398970,_0x113eab){_0x113eab=_0x113eab||0xcc;return function(_0x23ecf9){if(_0x23ecf9){return _0x398970['sendStatus'](_0x113eab);}return _0x398970[_0x216d('0x1a')](_0x113eab)['end']();};}function respondWithResult(_0x271bb1,_0xfb7154){_0xfb7154=_0xfb7154||0xc8;return function(_0x4dc2a2){if(_0x4dc2a2){return _0x271bb1[_0x216d('0x1a')](_0xfb7154)[_0x216d('0x1b')](_0x4dc2a2);}};}function respondWithFilteredResult(_0x54a816,_0x1b3215){return function(_0x494e92){if(_0x494e92){var _0x448c0d=_0x494e92[_0x216d('0x1c')],_0xf571a4=_0x1b3215[_0x216d('0x1d')],_0x4631b0=_0x1b3215[_0x216d('0x1d')]+_0x1b3215[_0x216d('0x1e')],_0x23ff86;if(_0x4631b0>=_0x448c0d){_0x4631b0=_0x448c0d;_0x23ff86=0xc8;}else{_0x23ff86=0xce;}_0x54a816[_0x216d('0x1a')](_0x23ff86);return _0x54a816['set'](_0x216d('0x1f'),_0xf571a4+'-'+_0x4631b0+'/'+_0x448c0d)['json'](_0x494e92);}return null;};}function patchUpdates(_0x4ddc51){return function(_0x133838){try{jsonpatch[_0x216d('0x20')](_0x133838,_0x4ddc51,!![]);}catch(_0x574758){return BPromise[_0x216d('0x21')](_0x574758);}return _0x133838[_0x216d('0x22')]();};}function saveUpdates(_0x5abab0,_0x27e1c7){return function(_0x13b8e0){if(_0x13b8e0){return _0x13b8e0[_0x216d('0x23')](_0x5abab0)[_0x216d('0x24')](function(_0x5c3e03){return _0x5c3e03;});}return null;};}function removeEntity(_0x20ee7c,_0x294bbf){return function(_0x10f299){if(_0x10f299){return _0x10f299[_0x216d('0x25')]()[_0x216d('0x24')](function(){_0x20ee7c['status'](0xcc)[_0x216d('0x26')]();});}};}function handleEntityNotFound(_0x1bd4db,_0x188494){return function(_0x2880c6){if(!_0x2880c6){_0x1bd4db[_0x216d('0x27')](0x194);}return _0x2880c6;};}function handleError(_0x54d96f,_0x68d7){_0x68d7=_0x68d7||0x1f4;return function(_0xab672){logger[_0x216d('0x28')](_0xab672['stack']);if(_0xab672['name']){delete _0xab672['name'];}_0x54d96f['status'](_0x68d7)['send'](_0xab672);};}exports[_0x216d('0x29')]=function(_0x470d8a,_0x189413){var _0x73b509={},_0x46d0ef={},_0x47fa6d={'count':0x0,'rows':[]};var _0x5b21d8=db[_0x216d('0x2a')]['rawAttributes'];_0x46d0ef[_0x216d('0x2b')]=_[_0x216d('0x2c')](_0x5b21d8);_0x46d0ef[_0x216d('0x2d')]=_[_0x216d('0x2c')](_0x470d8a[_0x216d('0x2d')]);_0x46d0ef[_0x216d('0x2e')]=_[_0x216d('0x2f')](_0x46d0ef[_0x216d('0x2b')],_0x46d0ef[_0x216d('0x2d')]);_0x73b509[_0x216d('0x30')]=_[_0x216d('0x2f')](_0x46d0ef[_0x216d('0x2b')],qs[_0x216d('0x31')](_0x470d8a['query'][_0x216d('0x31')]));_0x73b509[_0x216d('0x30')]=_0x73b509[_0x216d('0x30')]['length']?_0x73b509[_0x216d('0x30')]:_0x46d0ef[_0x216d('0x2b')];if(!_0x470d8a[_0x216d('0x2d')][_0x216d('0x32')]('nolimit')){_0x73b509[_0x216d('0x1e')]=qs[_0x216d('0x1e')](_0x470d8a[_0x216d('0x2d')][_0x216d('0x1e')]);_0x73b509[_0x216d('0x1d')]=qs[_0x216d('0x1d')](_0x470d8a[_0x216d('0x2d')][_0x216d('0x1d')]);}_0x73b509[_0x216d('0x33')]=qs[_0x216d('0x34')](_0x470d8a[_0x216d('0x2d')]['sort']);_0x73b509[_0x216d('0x35')]=qs[_0x216d('0x2e')](_[_0x216d('0x36')](_0x470d8a['query'],_0x46d0ef[_0x216d('0x2e')]));if(_0x470d8a[_0x216d('0x2d')]['filter']){_0x73b509[_0x216d('0x35')]=_['merge'](_0x73b509['where'],{'$or':_[_0x216d('0x37')](_0x5b21d8,function(_0xbf4639){if(_0xbf4639[_0x216d('0x38')][_0x216d('0x39')]!=='VIRTUAL'){var _0x4fd477={};_0x4fd477[_0xbf4639['field']]={'$like':'%'+_0x470d8a[_0x216d('0x2d')][_0x216d('0x3a')]+'%'};return _0x4fd477;}})});}_0x73b509=_['merge']({},_0x73b509,_0x470d8a[_0x216d('0x3b')]);var _0x2e334b={'where':_0x73b509['where']};return db[_0x216d('0x2a')][_0x216d('0x1c')](_0x2e334b)[_0x216d('0x24')](function(_0x474fab){_0x47fa6d[_0x216d('0x1c')]=_0x474fab;if(_0x470d8a[_0x216d('0x2d')][_0x216d('0x3c')]){_0x73b509[_0x216d('0x3d')]=[{'all':!![]}];}return db['VtigerField']['findAll'](_0x73b509);})[_0x216d('0x24')](function(_0x2be24f){_0x47fa6d['rows']=_0x2be24f;return _0x47fa6d;})[_0x216d('0x24')](respondWithFilteredResult(_0x189413,_0x73b509))[_0x216d('0x3e')](handleError(_0x189413,null));};exports[_0x216d('0x3f')]=function(_0x47f796,_0x2c3e44){var _0x3519ab={'raw':!![],'where':{'id':_0x47f796[_0x216d('0x40')]['id']}},_0x13d787={};_0x13d787['model']=_[_0x216d('0x2c')](db[_0x216d('0x2a')]['rawAttributes']);_0x13d787[_0x216d('0x2d')]=_[_0x216d('0x2c')](_0x47f796['query']);_0x13d787['filters']=_[_0x216d('0x2f')](_0x13d787[_0x216d('0x2b')],_0x13d787[_0x216d('0x2d')]);_0x3519ab['attributes']=_[_0x216d('0x2f')](_0x13d787['model'],qs['fields'](_0x47f796[_0x216d('0x2d')][_0x216d('0x31')]));_0x3519ab[_0x216d('0x30')]=_0x3519ab['attributes'][_0x216d('0x41')]?_0x3519ab['attributes']:_0x13d787[_0x216d('0x2b')];if(_0x47f796[_0x216d('0x2d')][_0x216d('0x3c')]){_0x3519ab['include']=[{'all':!![]}];}_0x3519ab=_[_0x216d('0x42')]({},_0x3519ab,_0x47f796[_0x216d('0x3b')]);return db[_0x216d('0x2a')][_0x216d('0x43')](_0x3519ab)['then'](handleEntityNotFound(_0x2c3e44,null))['then'](respondWithResult(_0x2c3e44,null))['catch'](handleError(_0x2c3e44,null));};exports[_0x216d('0x44')]=function(_0x257397,_0x5d4bf){return db[_0x216d('0x2a')][_0x216d('0x44')](_0x257397[_0x216d('0x45')],{})[_0x216d('0x24')](respondWithResult(_0x5d4bf,0xc9))[_0x216d('0x3e')](handleError(_0x5d4bf,null));};exports['update']=function(_0x3771dc,_0x2c6248){if(_0x3771dc[_0x216d('0x45')]['id']){delete _0x3771dc[_0x216d('0x45')]['id'];}return db['VtigerField'][_0x216d('0x43')]({'where':{'id':_0x3771dc['params']['id']}})[_0x216d('0x24')](handleEntityNotFound(_0x2c6248,null))[_0x216d('0x24')](saveUpdates(_0x3771dc[_0x216d('0x45')],null))['then'](respondWithResult(_0x2c6248,null))['catch'](handleError(_0x2c6248,null));};exports[_0x216d('0x25')]=function(_0x32d499,_0x3932a3){return db[_0x216d('0x2a')][_0x216d('0x43')]({'where':{'id':_0x32d499[_0x216d('0x40')]['id']}})['then'](handleEntityNotFound(_0x3932a3,null))['then'](removeEntity(_0x3932a3,null))[_0x216d('0x3e')](handleError(_0x3932a3,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 400c0e3..48dec75 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 _0x5386=['lodash','util','../../config/logger','api','moment','bluebird','vtiger_unique_index','idField'];(function(_0x25c005,_0x3b6858){var _0x3e7f97=function(_0x3d37cd){while(--_0x3d37cd){_0x25c005['push'](_0x25c005['shift']());}};_0x3e7f97(++_0x3b6858);}(_0x5386,0x1c8));var _0x6538=function(_0x434783,_0xff395d){_0x434783=_0x434783-0x0;var _0x13efcf=_0x5386[_0x434783];return _0x13efcf;};'use strict';var _=require(_0x6538('0x0'));var util=require(_0x6538('0x1'));var logger=require(_0x6538('0x2'))(_0x6538('0x3'));var moment=require(_0x6538('0x4'));var BPromise=require(_0x6538('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x568465,_0x42100a){return _0x568465['define']('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x6538('0x6'),'fields':[_0x6538('0x7'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x996f=['bluebird','path','rimraf','../../config/environment','exports','define','VtigerField','int_vtiger_fields','idField','FieldId','lodash','util','../../config/logger'];(function(_0x3bfa9b,_0x38075f){var _0x2be554=function(_0x5a2442){while(--_0x5a2442){_0x3bfa9b['push'](_0x3bfa9b['shift']());}};_0x2be554(++_0x38075f);}(_0x996f,0x1d1));var _0xf996=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x996f[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xf996('0x0'));var util=require(_0xf996('0x1'));var logger=require(_0xf996('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf996('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf996('0x4'));var rimraf=require(_0xf996('0x5'));var config=require(_0xf996('0x6'));var attributes=require('./intVtigerField.attributes');module[_0xf996('0x7')]=function(_0x4cdaea,_0x909240){return _0x4cdaea[_0xf996('0x8')](_0xf996('0x9'),attributes,{'tableName':_0xf996('0xa'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0xf996('0xb'),_0xf996('0xc')],'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 0be99a9..1a12f24 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 _0xa9a7=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0xa9a7,0xbd));var _0x7a9a=function(_0x43900c,_0x1d0541){_0x43900c=_0x43900c-0x0;var _0x1b58cf=_0xa9a7[_0x43900c];return _0x1b58cf;};'use strict';var _=require(_0x7a9a('0x0'));var util=require('util');var moment=require(_0x7a9a('0x1'));var BPromise=require(_0x7a9a('0x2'));var rs=require(_0x7a9a('0x3'));var fs=require('fs');var Redis=require(_0x7a9a('0x4'));var db=require(_0x7a9a('0x5'))['db'];var utils=require(_0x7a9a('0x6'));var logger=require(_0x7a9a('0x7'))('rpc');var config=require(_0x7a9a('0x8'));var jayson=require(_0x7a9a('0x9'));var client=jayson[_0x7a9a('0xa')][_0x7a9a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d5101,_0x571cf1,_0x558ce2){return new BPromise(function(_0x2513e4,_0x54e4b8){return client[_0x7a9a('0xc')](_0x4d5101,_0x558ce2)[_0x7a9a('0xd')](function(_0x353da6){logger[_0x7a9a('0xe')](_0x7a9a('0xf'),_0x571cf1,_0x7a9a('0x10'));logger[_0x7a9a('0x11')](_0x7a9a('0x12'),_0x571cf1,_0x7a9a('0x10'),JSON['stringify'](_0x353da6));if(_0x353da6[_0x7a9a('0x13')]){if(_0x353da6[_0x7a9a('0x13')][_0x7a9a('0x14')]===0x1f4){logger[_0x7a9a('0x13')](_0x7a9a('0xf'),_0x571cf1,_0x353da6['error'][_0x7a9a('0x15')]);return _0x54e4b8(_0x353da6['error'][_0x7a9a('0x15')]);}logger[_0x7a9a('0x13')](_0x7a9a('0xf'),_0x571cf1,_0x353da6[_0x7a9a('0x13')][_0x7a9a('0x15')]);return _0x2513e4(_0x353da6[_0x7a9a('0x13')][_0x7a9a('0x15')]);}else{logger[_0x7a9a('0xe')](_0x7a9a('0xf'),_0x571cf1,_0x7a9a('0x10'));_0x2513e4(_0x353da6[_0x7a9a('0x16')][_0x7a9a('0x15')]);}})[_0x7a9a('0x17')](function(_0x2c2515){logger[_0x7a9a('0x13')]('VtigerField,\x20%s,\x20%s',_0x571cf1,_0x2c2515);_0x54e4b8(_0x2c2515);});});} \ No newline at end of file +var _0xda42=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','result','moment','bluebird','ioredis'];(function(_0x2c76f5,_0x1e87a6){var _0x1b450d=function(_0x139b20){while(--_0x139b20){_0x2c76f5['push'](_0x2c76f5['shift']());}};_0x1b450d(++_0x1e87a6);}(_0xda42,0x16d));var _0x2da4=function(_0x5cfd28,_0x2ea06b){_0x5cfd28=_0x5cfd28-0x0;var _0x33d7c1=_0xda42[_0x5cfd28];return _0x33d7c1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2da4('0x0'));var BPromise=require(_0x2da4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2da4('0x2'));var db=require(_0x2da4('0x3'))['db'];var utils=require(_0x2da4('0x4'));var logger=require(_0x2da4('0x5'))(_0x2da4('0x6'));var config=require(_0x2da4('0x7'));var jayson=require(_0x2da4('0x8'));var client=jayson[_0x2da4('0x9')][_0x2da4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f350b,_0x1d525c,_0x50e704){return new BPromise(function(_0x111cef,_0x5836c6){return client[_0x2da4('0xb')](_0x4f350b,_0x50e704)[_0x2da4('0xc')](function(_0x2ed7d4){logger[_0x2da4('0xd')]('VtigerField,\x20%s,\x20%s',_0x1d525c,_0x2da4('0xe'));logger[_0x2da4('0xf')](_0x2da4('0x10'),_0x1d525c,_0x2da4('0xe'),JSON[_0x2da4('0x11')](_0x2ed7d4));if(_0x2ed7d4[_0x2da4('0x12')]){if(_0x2ed7d4[_0x2da4('0x12')][_0x2da4('0x13')]===0x1f4){logger['error'](_0x2da4('0x14'),_0x1d525c,_0x2ed7d4['error'][_0x2da4('0x15')]);return _0x5836c6(_0x2ed7d4[_0x2da4('0x12')][_0x2da4('0x15')]);}logger[_0x2da4('0x12')](_0x2da4('0x14'),_0x1d525c,_0x2ed7d4[_0x2da4('0x12')][_0x2da4('0x15')]);return _0x111cef(_0x2ed7d4[_0x2da4('0x12')][_0x2da4('0x15')]);}else{logger[_0x2da4('0xd')](_0x2da4('0x14'),_0x1d525c,_0x2da4('0xe'));_0x111cef(_0x2ed7d4[_0x2da4('0x16')]['message']);}})['catch'](function(_0x20dab9){logger[_0x2da4('0x12')](_0x2da4('0x14'),_0x1d525c,_0x20dab9);_0x5836c6(_0x20dab9);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index faf535b..31a1d08 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 _0xf748=['delete','destroy','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x4949aa,_0x2d6ada){var _0xf3222e=function(_0x1c7893){while(--_0x1c7893){_0x4949aa['push'](_0x4949aa['shift']());}};_0xf3222e(++_0x2d6ada);}(_0xf748,0xc8));var _0x8f74=function(_0x1e1f74,_0x190226){_0x1e1f74=_0x1e1f74-0x0;var _0x54139e=_0xf748[_0x1e1f74];return _0x54139e;};'use strict';var multer=require('multer');var util=require(_0x8f74('0x0'));var path=require(_0x8f74('0x1'));var timeout=require('connect-timeout');var express=require(_0x8f74('0x2'));var router=express['Router']();var auth=require(_0x8f74('0x3'));var interaction=require(_0x8f74('0x4'));var config=require(_0x8f74('0x5'));var controller=require('./intZendeskAccount.controller');router[_0x8f74('0x6')]('/',auth[_0x8f74('0x7')](),controller[_0x8f74('0x8')]);router[_0x8f74('0x6')](_0x8f74('0x9'),auth[_0x8f74('0x7')](),controller['show']);router['get'](_0x8f74('0xa'),auth[_0x8f74('0x7')](),controller['getConfigurations']);router['get'](_0x8f74('0xb'),auth[_0x8f74('0x7')](),controller[_0x8f74('0xc')]);router[_0x8f74('0xd')]('/',auth[_0x8f74('0x7')](),controller[_0x8f74('0xe')]);router[_0x8f74('0xd')](_0x8f74('0xa'),auth[_0x8f74('0x7')](),controller[_0x8f74('0xf')]);router['put'](_0x8f74('0x9'),auth[_0x8f74('0x7')](),controller['update']);router[_0x8f74('0x10')](_0x8f74('0x9'),auth[_0x8f74('0x7')](),controller[_0x8f74('0x11')]);module['exports']=router; \ No newline at end of file +var _0x4d8f=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','index','get','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2c8d62,_0x3e849c){var _0xeab21=function(_0x5c0d98){while(--_0x5c0d98){_0x2c8d62['push'](_0x2c8d62['shift']());}};_0xeab21(++_0x3e849c);}(_0x4d8f,0x1eb));var _0xf4d8=function(_0x26cf9f,_0x111459){_0x26cf9f=_0x26cf9f-0x0;var _0x43d921=_0x4d8f[_0x26cf9f];return _0x43d921;};'use strict';var multer=require(_0xf4d8('0x0'));var util=require(_0xf4d8('0x1'));var path=require(_0xf4d8('0x2'));var timeout=require(_0xf4d8('0x3'));var express=require(_0xf4d8('0x4'));var router=express[_0xf4d8('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xf4d8('0x6'));var config=require(_0xf4d8('0x7'));var controller=require(_0xf4d8('0x8'));router['get']('/',auth[_0xf4d8('0x9')](),controller[_0xf4d8('0xa')]);router[_0xf4d8('0xb')](_0xf4d8('0xc'),auth[_0xf4d8('0x9')](),controller[_0xf4d8('0xd')]);router[_0xf4d8('0xb')]('/:id/configurations',auth[_0xf4d8('0x9')](),controller[_0xf4d8('0xe')]);router[_0xf4d8('0xb')](_0xf4d8('0xf'),auth[_0xf4d8('0x9')](),controller[_0xf4d8('0x10')]);router[_0xf4d8('0x11')]('/',auth[_0xf4d8('0x9')](),controller[_0xf4d8('0x12')]);router[_0xf4d8('0x11')](_0xf4d8('0x13'),auth[_0xf4d8('0x9')](),controller[_0xf4d8('0x14')]);router[_0xf4d8('0x15')](_0xf4d8('0xc'),auth[_0xf4d8('0x9')](),controller[_0xf4d8('0x16')]);router[_0xf4d8('0x17')](_0xf4d8('0xc'),auth[_0xf4d8('0x9')](),controller[_0xf4d8('0x18')]);module[_0xf4d8('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index cf7332c..0d2d25b 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 _0xeccb=['ENUM','password','integrationTab','newTab','sequelize','STRING','username','remoteUri'];(function(_0x5cbace,_0x33943c){var _0x6de5b8=function(_0x5aae38){while(--_0x5aae38){_0x5cbace['push'](_0x5cbace['shift']());}};_0x6de5b8(++_0x33943c);}(_0xeccb,0x16c));var _0xbecc=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0xeccb[_0x4e6ae6];return _0x23c108;};'use strict';var Sequelize=require(_0xbecc('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbecc('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xbecc('0x2')},'password':{'type':Sequelize[_0xbecc('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbecc('0x1')],'unique':_0xbecc('0x3')},'authType':{'type':Sequelize[_0xbecc('0x4')](_0xbecc('0x5'),'token'),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xbecc('0x4')](_0xbecc('0x6'),_0xbecc('0x7')),'defaultValue':_0xbecc('0x6')}}; \ No newline at end of file +var _0x4832=['integrationTab','newTab','sequelize','STRING','remoteUri','token','password'];(function(_0x33581c,_0x619b7e){var _0x4bab8e=function(_0x5c9543){while(--_0x5c9543){_0x33581c['push'](_0x33581c['shift']());}};_0x4bab8e(++_0x619b7e);}(_0x4832,0x183));var _0x2483=function(_0x5c6994,_0x19ad9a){_0x5c6994=_0x5c6994-0x0;var _0x1d5c84=_0x4832[_0x5c6994];return _0x1d5c84;};'use strict';var Sequelize=require(_0x2483('0x0'));module['exports']={'name':{'type':Sequelize[_0x2483('0x1')]},'description':{'type':Sequelize[_0x2483('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x2483('0x1')]},'token':{'type':Sequelize[_0x2483('0x1')]},'remoteUri':{'type':Sequelize[_0x2483('0x1')],'unique':_0x2483('0x2')},'authType':{'type':Sequelize['ENUM']('password',_0x2483('0x3')),'defaultValue':_0x2483('0x4')},'serverUrl':{'type':Sequelize[_0x2483('0x1')]},'type':{'type':Sequelize['ENUM'](_0x2483('0x5'),_0x2483('0x6')),'defaultValue':_0x2483('0x5')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index e5f926d..72745ad 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 _0x8f98=['../../config/logger','../../config/environment','../../mysqldb','jayson/promise','http','test','request','then','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','status','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','index','ZendeskAccount','model','keys','query','filters','attributes','intersection','fields','length','order','sort','where','pick','map','key','field','filter','merge','options','count','includeAll','params','rawAttributes','include','create','body','find','getConfigurations','findOne','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','username','token','authType','remoteUri','slice','substring','GET','format','%s/%s','ticket_fields','password','Basic\x20%s','%s:%s','base64','headers','%s/token:%s','toString','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x8f98,0x69));var _0x88f9=function(_0x5058dd,_0x2b2b79){_0x5058dd=_0x5058dd-0x0;var _0x5c8f13=_0x8f98[_0x5058dd];return _0x5c8f13;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x88f9('0x0'));var rimraf=require(_0x88f9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x88f9('0x2'));var rp=require(_0x88f9('0x3'));var moment=require('moment');var BPromise=require(_0x88f9('0x4'));var Mustache=require(_0x88f9('0x5'));var util=require(_0x88f9('0x6'));var path=require(_0x88f9('0x7'));var sox=require(_0x88f9('0x8'));var csv=require(_0x88f9('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x88f9('0xa'));var squel=require('squel');var crypto=require(_0x88f9('0xb'));var jsforce=require(_0x88f9('0xc'));var deskjs=require(_0x88f9('0xd'));var toCsv=require(_0x88f9('0x9'));var querystring=require(_0x88f9('0xe'));var Papa=require(_0x88f9('0xf'));var Redis=require('ioredis');var authService=require(_0x88f9('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x88f9('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x88f9('0x12'));var db=require(_0x88f9('0x13'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x88f9('0x14'));var client=jayson['client'][_0x88f9('0x15')]({'port':0x232a});function checkPasswordPattern(_0x4b8db3,_0x5c801d,_0x5f06b8){if(_0x5f06b8){var _0x3a320c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3a320c[_0x88f9('0x16')](_0x5c801d)){return _0x4b8db3;}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 _0x4b8db3;}}function respondWithRpcPromise(_0x199940,_0x4f9f05,_0x3dc93f,_0x52ab41){return new BPromise(function(_0x1fcd02,_0x4bc5d8){var _0x5dec1c=_0x52ab41||client;return _0x5dec1c[_0x88f9('0x17')](_0x199940,_0x3dc93f)[_0x88f9('0x18')](function(_0x1927d0){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x4f9f05,_0x88f9('0x19'));logger[_0x88f9('0x1a')](_0x88f9('0x1b'),_0x4f9f05,'request\x20sent',JSON[_0x88f9('0x1c')](_0x1927d0));if(_0x1927d0[_0x88f9('0x1d')]){if(_0x1927d0[_0x88f9('0x1d')][_0x88f9('0x1e')]===0x1f4){logger['error'](_0x88f9('0x1f'),_0x4f9f05,_0x1927d0[_0x88f9('0x1d')][_0x88f9('0x20')]);return _0x4bc5d8(_0x1927d0[_0x88f9('0x1d')][_0x88f9('0x20')]);}logger[_0x88f9('0x1d')](_0x88f9('0x1f'),_0x4f9f05,_0x1927d0[_0x88f9('0x1d')][_0x88f9('0x20')]);return _0x1fcd02(_0x1927d0['error'][_0x88f9('0x20')]);}else{logger[_0x88f9('0x21')]('ZendeskAccount,\x20%s,\x20%s',_0x4f9f05,_0x88f9('0x19'));_0x1fcd02(_0x1927d0[_0x88f9('0x22')][_0x88f9('0x20')]);}})[_0x88f9('0x23')](function(_0x3494cd){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x4f9f05,_0x3494cd);_0x4bc5d8(_0x3494cd);});});}function respondWithStatusCode(_0x184091,_0x47f3a3){_0x47f3a3=_0x47f3a3||0xcc;return function(_0x41072d){if(_0x41072d){return _0x184091[_0x88f9('0x24')](_0x47f3a3);}return _0x184091['status'](_0x47f3a3)[_0x88f9('0x25')]();};}function respondWithResult(_0x28743f,_0x19a3fd){_0x19a3fd=_0x19a3fd||0xc8;return function(_0x2c521d){if(_0x2c521d){return _0x28743f[_0x88f9('0x26')](_0x19a3fd)['json'](_0x2c521d);}};}function respondWithFilteredResult(_0x3b2814,_0x4af366){return function(_0x48516b){if(_0x48516b){var _0x1789af=_0x48516b['count'],_0x3b4530=_0x4af366['offset'],_0x5c31a5=_0x4af366[_0x88f9('0x27')]+_0x4af366[_0x88f9('0x28')],_0x522409;if(_0x5c31a5>=_0x1789af){_0x5c31a5=_0x1789af;_0x522409=0xc8;}else{_0x522409=0xce;}_0x3b2814[_0x88f9('0x26')](_0x522409);return _0x3b2814[_0x88f9('0x29')](_0x88f9('0x2a'),_0x3b4530+'-'+_0x5c31a5+'/'+_0x1789af)['json'](_0x48516b);}return null;};}function patchUpdates(_0x52a0f8){return function(_0x31fc60){try{jsonpatch['apply'](_0x31fc60,_0x52a0f8,!![]);}catch(_0x29637a){return BPromise[_0x88f9('0x2b')](_0x29637a);}return _0x31fc60[_0x88f9('0x2c')]();};}function saveUpdates(_0x5b76b9,_0x579be4){return function(_0x42e138){if(_0x42e138){return _0x42e138[_0x88f9('0x2d')](_0x5b76b9)['then'](function(_0x48072a){return _0x48072a;});}return null;};}function removeEntity(_0x22ebc8,_0x6e5d44){return function(_0x4af13c){if(_0x4af13c){return _0x4af13c[_0x88f9('0x2e')]()[_0x88f9('0x18')](function(){_0x22ebc8['status'](0xcc)[_0x88f9('0x25')]();});}};}function handleEntityNotFound(_0x46bdb6,_0x595a7e){return function(_0x39725d){if(!_0x39725d){_0x46bdb6[_0x88f9('0x24')](0x194);}return _0x39725d;};}function handleError(_0x30d739,_0x58f358){_0x58f358=_0x58f358||0x1f4;return function(_0x479c98){logger[_0x88f9('0x1d')](_0x479c98[_0x88f9('0x2f')]);if(_0x479c98['name']){delete _0x479c98[_0x88f9('0x30')];}_0x30d739[_0x88f9('0x26')](_0x58f358)[_0x88f9('0x31')](_0x479c98);};}exports[_0x88f9('0x32')]=function(_0x3b867a,_0x3af5a9){var _0x5aa39f={},_0x1785b9={},_0x5a1acd={'count':0x0,'rows':[]};var _0x31dffe=db[_0x88f9('0x33')]['rawAttributes'];_0x1785b9[_0x88f9('0x34')]=_[_0x88f9('0x35')](_0x31dffe);_0x1785b9[_0x88f9('0x36')]=_[_0x88f9('0x35')](_0x3b867a[_0x88f9('0x36')]);_0x1785b9[_0x88f9('0x37')]=_['intersection'](_0x1785b9[_0x88f9('0x34')],_0x1785b9[_0x88f9('0x36')]);_0x5aa39f[_0x88f9('0x38')]=_[_0x88f9('0x39')](_0x1785b9[_0x88f9('0x34')],qs[_0x88f9('0x3a')](_0x3b867a[_0x88f9('0x36')][_0x88f9('0x3a')]));_0x5aa39f[_0x88f9('0x38')]=_0x5aa39f[_0x88f9('0x38')][_0x88f9('0x3b')]?_0x5aa39f['attributes']:_0x1785b9[_0x88f9('0x34')];if(!_0x3b867a[_0x88f9('0x36')]['hasOwnProperty']('nolimit')){_0x5aa39f[_0x88f9('0x28')]=qs[_0x88f9('0x28')](_0x3b867a[_0x88f9('0x36')][_0x88f9('0x28')]);_0x5aa39f[_0x88f9('0x27')]=qs[_0x88f9('0x27')](_0x3b867a[_0x88f9('0x36')][_0x88f9('0x27')]);}_0x5aa39f[_0x88f9('0x3c')]=qs[_0x88f9('0x3d')](_0x3b867a[_0x88f9('0x36')][_0x88f9('0x3d')]);_0x5aa39f[_0x88f9('0x3e')]=qs['filters'](_[_0x88f9('0x3f')](_0x3b867a[_0x88f9('0x36')],_0x1785b9[_0x88f9('0x37')]));if(_0x3b867a[_0x88f9('0x36')]['filter']){_0x5aa39f[_0x88f9('0x3e')]=_['merge'](_0x5aa39f[_0x88f9('0x3e')],{'$or':_[_0x88f9('0x40')](_0x31dffe,function(_0x5c810c){if(_0x5c810c['type'][_0x88f9('0x41')]!=='VIRTUAL'){var _0x490ce9={};_0x490ce9[_0x5c810c[_0x88f9('0x42')]]={'$like':'%'+_0x3b867a[_0x88f9('0x36')][_0x88f9('0x43')]+'%'};return _0x490ce9;}})});}_0x5aa39f=_[_0x88f9('0x44')]({},_0x5aa39f,_0x3b867a[_0x88f9('0x45')]);var _0x1ac74={'where':_0x5aa39f['where']};return db['ZendeskAccount'][_0x88f9('0x46')](_0x1ac74)['then'](function(_0x6eb30f){_0x5a1acd['count']=_0x6eb30f;if(_0x3b867a[_0x88f9('0x36')][_0x88f9('0x47')]){_0x5aa39f['include']=[{'all':!![]}];}return db['ZendeskAccount']['findAll'](_0x5aa39f);})[_0x88f9('0x18')](function(_0x424a43){_0x5a1acd['rows']=_0x424a43;return _0x5a1acd;})[_0x88f9('0x18')](respondWithFilteredResult(_0x3af5a9,_0x5aa39f))[_0x88f9('0x23')](handleError(_0x3af5a9,null));};exports['show']=function(_0x5d4f74,_0x5bad16){var _0x18f162={'raw':![],'where':{'id':_0x5d4f74[_0x88f9('0x48')]['id']}},_0xb87202={};_0xb87202[_0x88f9('0x34')]=_[_0x88f9('0x35')](db[_0x88f9('0x33')][_0x88f9('0x49')]);_0xb87202[_0x88f9('0x36')]=_[_0x88f9('0x35')](_0x5d4f74['query']);_0xb87202['filters']=_[_0x88f9('0x39')](_0xb87202[_0x88f9('0x34')],_0xb87202['query']);_0x18f162[_0x88f9('0x38')]=_[_0x88f9('0x39')](_0xb87202[_0x88f9('0x34')],qs[_0x88f9('0x3a')](_0x5d4f74[_0x88f9('0x36')][_0x88f9('0x3a')]));_0x18f162[_0x88f9('0x38')]=_0x18f162['attributes'][_0x88f9('0x3b')]?_0x18f162[_0x88f9('0x38')]:_0xb87202[_0x88f9('0x34')];if(_0x5d4f74[_0x88f9('0x36')][_0x88f9('0x47')]){_0x18f162[_0x88f9('0x4a')]=[{'all':!![]}];}_0x18f162=_['merge']({},_0x18f162,_0x5d4f74['options']);return db[_0x88f9('0x33')]['find'](_0x18f162)[_0x88f9('0x18')](handleEntityNotFound(_0x5bad16,null))['then'](respondWithResult(_0x5bad16,null))[_0x88f9('0x23')](handleError(_0x5bad16,null));};exports[_0x88f9('0x4b')]=function(_0x3a2170,_0x1f585d){return db[_0x88f9('0x33')][_0x88f9('0x4b')](_0x3a2170[_0x88f9('0x4c')],{})[_0x88f9('0x18')](respondWithResult(_0x1f585d,0xc9))[_0x88f9('0x23')](handleError(_0x1f585d,null));};exports[_0x88f9('0x2d')]=function(_0x4736c4,_0x48cc64){if(_0x4736c4[_0x88f9('0x4c')]['id']){delete _0x4736c4[_0x88f9('0x4c')]['id'];}return db[_0x88f9('0x33')][_0x88f9('0x4d')]({'where':{'id':_0x4736c4[_0x88f9('0x48')]['id']}})[_0x88f9('0x18')](handleEntityNotFound(_0x48cc64,null))[_0x88f9('0x18')](saveUpdates(_0x4736c4[_0x88f9('0x4c')],null))[_0x88f9('0x18')](respondWithResult(_0x48cc64,null))[_0x88f9('0x23')](handleError(_0x48cc64,null));};exports['destroy']=function(_0x1dc3ee,_0x278d97){return db[_0x88f9('0x33')][_0x88f9('0x4d')]({'where':{'id':_0x1dc3ee['params']['id']}})[_0x88f9('0x18')](handleEntityNotFound(_0x278d97,null))[_0x88f9('0x18')](removeEntity(_0x278d97,null))[_0x88f9('0x23')](handleError(_0x278d97,null));};exports[_0x88f9('0x4e')]=function(_0x232bdf,_0x5f08b4,_0x413cca){var _0xa99e35={};var _0x4eb0ae={};var _0x10c82d;var _0x1b3c0a;return db['ZendeskAccount'][_0x88f9('0x4f')]({'where':{'id':_0x232bdf[_0x88f9('0x48')]['id']}})['then'](handleEntityNotFound(_0x5f08b4,null))[_0x88f9('0x18')](function(_0x5213c2){if(_0x5213c2){_0x10c82d=_0x5213c2;_0x4eb0ae[_0x88f9('0x34')]=_[_0x88f9('0x35')](db['ZendeskConfiguration'][_0x88f9('0x49')]);_0x4eb0ae[_0x88f9('0x36')]=_[_0x88f9('0x35')](_0x232bdf['query']);_0x4eb0ae['filters']=_[_0x88f9('0x39')](_0x4eb0ae[_0x88f9('0x34')],_0x4eb0ae[_0x88f9('0x36')]);_0xa99e35[_0x88f9('0x38')]=_[_0x88f9('0x39')](_0x4eb0ae[_0x88f9('0x34')],qs['fields'](_0x232bdf[_0x88f9('0x36')][_0x88f9('0x3a')]));_0xa99e35['attributes']=_0xa99e35[_0x88f9('0x38')][_0x88f9('0x3b')]?_0xa99e35['attributes']:_0x4eb0ae[_0x88f9('0x34')];_0xa99e35[_0x88f9('0x3c')]=qs[_0x88f9('0x3d')](_0x232bdf[_0x88f9('0x36')]['sort']);_0xa99e35[_0x88f9('0x3e')]=qs['filters'](_[_0x88f9('0x3f')](_0x232bdf[_0x88f9('0x36')],_0x4eb0ae[_0x88f9('0x37')]));if(_0x232bdf['query'][_0x88f9('0x43')]){_0xa99e35[_0x88f9('0x3e')]=_[_0x88f9('0x44')](_0xa99e35[_0x88f9('0x3e')],{'$or':_['map'](_0xa99e35[_0x88f9('0x38')],function(_0x41cb59){var _0x3aad0c={};_0x3aad0c[_0x41cb59]={'$like':'%'+_0x232bdf['query'][_0x88f9('0x43')]+'%'};return _0x3aad0c;})});}_0xa99e35=_[_0x88f9('0x44')]({},_0xa99e35,_0x232bdf[_0x88f9('0x45')]);return _0x10c82d[_0x88f9('0x4e')](_0xa99e35);}})[_0x88f9('0x18')](function(_0x52681a){if(_0x52681a){_0x1b3c0a=_0x52681a[_0x88f9('0x3b')];if(!_0x232bdf['query'][_0x88f9('0x50')]('nolimit')){_0xa99e35[_0x88f9('0x28')]=qs[_0x88f9('0x28')](_0x232bdf['query'][_0x88f9('0x28')]);_0xa99e35['offset']=qs['offset'](_0x232bdf[_0x88f9('0x36')][_0x88f9('0x27')]);}return _0x10c82d[_0x88f9('0x4e')](_0xa99e35);}})['then'](function(_0x4db811){if(_0x4db811){return _0x4db811?{'count':_0x1b3c0a,'rows':_0x4db811}:null;}})[_0x88f9('0x18')](respondWithResult(_0x5f08b4,null))[_0x88f9('0x23')](handleError(_0x5f08b4,null));};exports[_0x88f9('0x51')]=function(_0x2a8719,_0x3b60d8,_0xed497){if(_0x2a8719['body']['id']){delete _0x2a8719[_0x88f9('0x4c')]['id'];}return db[_0x88f9('0x33')][_0x88f9('0x4f')]({'where':{'id':_0x2a8719[_0x88f9('0x48')]['id']}})[_0x88f9('0x18')](handleEntityNotFound(_0x3b60d8,null))[_0x88f9('0x18')](function(_0x12e0a6){if(_0x12e0a6){_0x2a8719[_0x88f9('0x4c')]['AccountId']=_0x12e0a6['id'];_0x2a8719[_0x88f9('0x4c')][_0x88f9('0x52')]=integrations[_0x88f9('0x53')](_0x2a8719[_0x88f9('0x4c')][_0x88f9('0x54')],_0x2a8719[_0x88f9('0x4c')][_0x88f9('0x55')]);_0x2a8719['body'][_0x88f9('0x56')]=integrations[_0x88f9('0x57')](_0x2a8719[_0x88f9('0x4c')][_0x88f9('0x54')],_0x2a8719[_0x88f9('0x4c')][_0x88f9('0x55')]);return db[_0x88f9('0x58')][_0x88f9('0x4b')](_0x2a8719[_0x88f9('0x4c')],{'include':[{'model':db[_0x88f9('0x59')],'as':_0x88f9('0x52')},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0x88f9('0x18')](respondWithResult(_0x3b60d8,null))[_0x88f9('0x23')](handleError(_0x3b60d8,null));};exports['getFields']=function(_0x547851,_0x427b6c,_0x39b310){var _0x2054c3='';return db[_0x88f9('0x33')]['findOne']({'where':{'id':_0x547851[_0x88f9('0x48')]['id']},'attributes':['id',_0x88f9('0x5a'),'password',_0x88f9('0x5b'),_0x88f9('0x5c'),'remoteUri']})[_0x88f9('0x18')](handleEntityNotFound(_0x427b6c,null))[_0x88f9('0x18')](function(_0x162998){if(_0x162998){_0x2054c3=_0x162998[_0x88f9('0x5d')];var _0x215aec=_0x2054c3[_0x88f9('0x5e')](-0x1);if(_0x215aec==='/'){_0x2054c3=_0x2054c3[_0x88f9('0x5f')](0x0,_0x2054c3['lastIndexOf'](_0x215aec));}var _0x143b63={'method':_0x88f9('0x60'),'uri':util[_0x88f9('0x61')](_0x88f9('0x62'),_0x2054c3,_0x88f9('0x63')),'json':!![]};switch(_0x162998['authType']){case _0x88f9('0x64'):_0x143b63['headers']={'Authorization':util[_0x88f9('0x61')](_0x88f9('0x65'),new Buffer(util[_0x88f9('0x61')](_0x88f9('0x66'),_0x162998['username'],_0x162998[_0x88f9('0x64')]))['toString'](_0x88f9('0x67')))};break;case _0x88f9('0x5b'):_0x143b63[_0x88f9('0x68')]={'Authorization':util[_0x88f9('0x61')]('Basic\x20%s',new Buffer(util[_0x88f9('0x61')](_0x88f9('0x69'),_0x162998[_0x88f9('0x5a')],_0x162998[_0x88f9('0x5b')]))[_0x88f9('0x6a')](_0x88f9('0x67')))};break;default:throw new db[(_0x88f9('0x6b'))][(_0x88f9('0x6c'))](_0x88f9('0x6d'));}return rp(_0x143b63);}})[_0x88f9('0x18')](function(_0x91ee6c){if(_0x91ee6c){var _0x241337=[_0x88f9('0x6e'),_0x88f9('0x6f'),_0x88f9('0x70'),_0x88f9('0x71')];_[_0x88f9('0x72')](_0x91ee6c[_0x88f9('0x63')],function(_0x5c52df){return _0x241337[_0x88f9('0x73')](_0x5c52df[_0x88f9('0x55')]);});return{'count':_0x91ee6c[_0x88f9('0x63')][_0x88f9('0x3b')],'rows':_[_0x88f9('0x40')](_0x91ee6c[_0x88f9('0x63')],function(_0x5a24bb){return{'id':_0x5a24bb['id'],'name':_0x5a24bb[_0x88f9('0x74')]>0x7?_0x5a24bb['title']:_0x5a24bb[_0x88f9('0x55')],'custom':_0x5a24bb[_0x88f9('0x74')]>0x7?!![]:![],'options':_0x5a24bb['system_field_options']?_0x5a24bb[_0x88f9('0x75')]:_0x5a24bb['custom_field_options']?_0x5a24bb[_0x88f9('0x76')]:[]};})};}})['then'](respondWithResult(_0x427b6c,null))['catch'](function(_0x3fee4e){var _0x41ef71=_0x547851['query']['test']?0x1f4:_0x3fee4e[_0x88f9('0x77')]||0x1f4;logger['error'](_0x88f9('0x78'),_0x88f9('0x79'),_0x41ef71,JSON[_0x88f9('0x1c')](_0x3fee4e));delete _0x3fee4e['name'];if(_0x41ef71===0x191){_0x41ef71=0x190;}_0x427b6c['status'](_0x41ef71)[_0x88f9('0x31')](_0x547851[_0x88f9('0x36')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x3fee4e[_0x88f9('0x77')]}:_0x3fee4e);});}; \ No newline at end of file +var _0xe4f6=['../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','end','status','json','offset','limit','set','Content-Range','save','update','destroy','rawAttributes','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','filters','filter','where','merge','map','type','key','VIRTUAL','ZendeskAccount','count','includeAll','show','params','include','options','find','create','body','getConfigurations','findOne','ZendeskConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','lastIndexOf','GET','format','%s/%s','Basic\x20%s','%s:%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','getFields,\x20%s,\x20%s,\x20%s','name','send','test','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x102f97,_0x5bda2f){var _0xd22058=function(_0x2ccc1f){while(--_0x2ccc1f){_0x102f97['push'](_0x102f97['shift']());}};_0xd22058(++_0x5bda2f);}(_0xe4f6,0x15e));var _0x6e4f=function(_0x21f0d1,_0x3ddfd6){_0x21f0d1=_0x21f0d1-0x0;var _0xdac23f=_0xe4f6[_0x21f0d1];return _0xdac23f;};'use strict';var pdf=require(_0x6e4f('0x0'));var emlformat=require(_0x6e4f('0x1'));var rimraf=require(_0x6e4f('0x2'));var zipdir=require(_0x6e4f('0x3'));var jsonpatch=require(_0x6e4f('0x4'));var rp=require(_0x6e4f('0x5'));var moment=require(_0x6e4f('0x6'));var BPromise=require(_0x6e4f('0x7'));var Mustache=require('mustache');var util=require(_0x6e4f('0x8'));var path=require(_0x6e4f('0x9'));var sox=require(_0x6e4f('0xa'));var csv=require(_0x6e4f('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6e4f('0xc'));var squel=require(_0x6e4f('0xd'));var crypto=require('crypto');var jsforce=require(_0x6e4f('0xe'));var deskjs=require(_0x6e4f('0xf'));var toCsv=require(_0x6e4f('0xb'));var querystring=require(_0x6e4f('0x10'));var Papa=require(_0x6e4f('0x11'));var Redis=require(_0x6e4f('0x12'));var authService=require(_0x6e4f('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6e4f('0x14'));var logger=require(_0x6e4f('0x15'))(_0x6e4f('0x16'));var utils=require(_0x6e4f('0x17'));var config=require('../../config/environment');var db=require(_0x6e4f('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x6e4f('0x19'));var client=jayson['client'][_0x6e4f('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x5095b2,_0x27bb2a,_0x4cf187){if(_0x4cf187){var _0x3407f5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3407f5['test'](_0x27bb2a)){return _0x5095b2;}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 _0x5095b2;}}function respondWithRpcPromise(_0x5e0e95,_0x30de69,_0x188822,_0x21eb60){return new BPromise(function(_0x337d21,_0x24634f){var _0x16e0ee=_0x21eb60||client;return _0x16e0ee[_0x6e4f('0x1b')](_0x5e0e95,_0x188822)[_0x6e4f('0x1c')](function(_0x35cb32){logger[_0x6e4f('0x1d')](_0x6e4f('0x1e'),_0x30de69,'request\x20sent');logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x30de69,_0x6e4f('0x1f'),JSON[_0x6e4f('0x20')](_0x35cb32));if(_0x35cb32[_0x6e4f('0x21')]){if(_0x35cb32['error']['code']===0x1f4){logger[_0x6e4f('0x21')](_0x6e4f('0x1e'),_0x30de69,_0x35cb32[_0x6e4f('0x21')][_0x6e4f('0x22')]);return _0x24634f(_0x35cb32[_0x6e4f('0x21')][_0x6e4f('0x22')]);}logger[_0x6e4f('0x21')](_0x6e4f('0x1e'),_0x30de69,_0x35cb32[_0x6e4f('0x21')]['message']);return _0x337d21(_0x35cb32[_0x6e4f('0x21')]['message']);}else{logger['info'](_0x6e4f('0x1e'),_0x30de69,_0x6e4f('0x1f'));_0x337d21(_0x35cb32[_0x6e4f('0x23')][_0x6e4f('0x22')]);}})[_0x6e4f('0x24')](function(_0x4caccc){logger[_0x6e4f('0x21')](_0x6e4f('0x1e'),_0x30de69,_0x4caccc);_0x24634f(_0x4caccc);});});}function respondWithStatusCode(_0x5a15e0,_0x329c78){_0x329c78=_0x329c78||0xcc;return function(_0x3e6c17){if(_0x3e6c17){return _0x5a15e0[_0x6e4f('0x25')](_0x329c78);}return _0x5a15e0['status'](_0x329c78)[_0x6e4f('0x26')]();};}function respondWithResult(_0x13200e,_0x458967){_0x458967=_0x458967||0xc8;return function(_0x2a5049){if(_0x2a5049){return _0x13200e[_0x6e4f('0x27')](_0x458967)[_0x6e4f('0x28')](_0x2a5049);}};}function respondWithFilteredResult(_0x2de7c2,_0x553814){return function(_0x398f6a){if(_0x398f6a){var _0xd76817=_0x398f6a['count'],_0x172c68=_0x553814['offset'],_0x5ddf80=_0x553814[_0x6e4f('0x29')]+_0x553814[_0x6e4f('0x2a')],_0x736b57;if(_0x5ddf80>=_0xd76817){_0x5ddf80=_0xd76817;_0x736b57=0xc8;}else{_0x736b57=0xce;}_0x2de7c2['status'](_0x736b57);return _0x2de7c2[_0x6e4f('0x2b')](_0x6e4f('0x2c'),_0x172c68+'-'+_0x5ddf80+'/'+_0xd76817)[_0x6e4f('0x28')](_0x398f6a);}return null;};}function patchUpdates(_0x1aafab){return function(_0xa82e64){try{jsonpatch['apply'](_0xa82e64,_0x1aafab,!![]);}catch(_0x142ddc){return BPromise['reject'](_0x142ddc);}return _0xa82e64[_0x6e4f('0x2d')]();};}function saveUpdates(_0x88e955,_0x62f429){return function(_0x50109c){if(_0x50109c){return _0x50109c[_0x6e4f('0x2e')](_0x88e955)[_0x6e4f('0x1c')](function(_0x18e530){return _0x18e530;});}return null;};}function removeEntity(_0x5a0719,_0x2c41ce){return function(_0x11dddd){if(_0x11dddd){return _0x11dddd[_0x6e4f('0x2f')]()[_0x6e4f('0x1c')](function(){_0x5a0719['status'](0xcc)[_0x6e4f('0x26')]();});}};}function handleEntityNotFound(_0x46d8d8,_0x1ea81d){return function(_0x432c94){if(!_0x432c94){_0x46d8d8[_0x6e4f('0x25')](0x194);}return _0x432c94;};}function handleError(_0x3712a8,_0x4453db){_0x4453db=_0x4453db||0x1f4;return function(_0x41a591){logger['error'](_0x41a591['stack']);if(_0x41a591['name']){delete _0x41a591['name'];}_0x3712a8['status'](_0x4453db)['send'](_0x41a591);};}exports['index']=function(_0x5475dc,_0x22bcaf){var _0x253f6e={},_0x2b8a33={},_0x5d263a={'count':0x0,'rows':[]};var _0x20b3f7=db['ZendeskAccount'][_0x6e4f('0x30')];_0x2b8a33[_0x6e4f('0x31')]=_[_0x6e4f('0x32')](_0x20b3f7);_0x2b8a33['query']=_[_0x6e4f('0x32')](_0x5475dc[_0x6e4f('0x33')]);_0x2b8a33['filters']=_[_0x6e4f('0x34')](_0x2b8a33[_0x6e4f('0x31')],_0x2b8a33[_0x6e4f('0x33')]);_0x253f6e[_0x6e4f('0x35')]=_[_0x6e4f('0x34')](_0x2b8a33[_0x6e4f('0x31')],qs[_0x6e4f('0x36')](_0x5475dc[_0x6e4f('0x33')][_0x6e4f('0x36')]));_0x253f6e[_0x6e4f('0x35')]=_0x253f6e['attributes'][_0x6e4f('0x37')]?_0x253f6e[_0x6e4f('0x35')]:_0x2b8a33[_0x6e4f('0x31')];if(!_0x5475dc[_0x6e4f('0x33')]['hasOwnProperty'](_0x6e4f('0x38'))){_0x253f6e[_0x6e4f('0x2a')]=qs[_0x6e4f('0x2a')](_0x5475dc[_0x6e4f('0x33')][_0x6e4f('0x2a')]);_0x253f6e[_0x6e4f('0x29')]=qs[_0x6e4f('0x29')](_0x5475dc['query'][_0x6e4f('0x29')]);}_0x253f6e[_0x6e4f('0x39')]=qs[_0x6e4f('0x3a')](_0x5475dc['query'][_0x6e4f('0x3a')]);_0x253f6e['where']=qs[_0x6e4f('0x3b')](_['pick'](_0x5475dc[_0x6e4f('0x33')],_0x2b8a33[_0x6e4f('0x3b')]));if(_0x5475dc[_0x6e4f('0x33')][_0x6e4f('0x3c')]){_0x253f6e[_0x6e4f('0x3d')]=_[_0x6e4f('0x3e')](_0x253f6e['where'],{'$or':_[_0x6e4f('0x3f')](_0x20b3f7,function(_0x58f006){if(_0x58f006[_0x6e4f('0x40')][_0x6e4f('0x41')]!==_0x6e4f('0x42')){var _0x715933={};_0x715933[_0x58f006['field']]={'$like':'%'+_0x5475dc['query'][_0x6e4f('0x3c')]+'%'};return _0x715933;}})});}_0x253f6e=_[_0x6e4f('0x3e')]({},_0x253f6e,_0x5475dc['options']);var _0x3b4898={'where':_0x253f6e[_0x6e4f('0x3d')]};return db[_0x6e4f('0x43')][_0x6e4f('0x44')](_0x3b4898)[_0x6e4f('0x1c')](function(_0x47f396){_0x5d263a[_0x6e4f('0x44')]=_0x47f396;if(_0x5475dc[_0x6e4f('0x33')][_0x6e4f('0x45')]){_0x253f6e['include']=[{'all':!![]}];}return db[_0x6e4f('0x43')]['findAll'](_0x253f6e);})[_0x6e4f('0x1c')](function(_0xa734f5){_0x5d263a['rows']=_0xa734f5;return _0x5d263a;})[_0x6e4f('0x1c')](respondWithFilteredResult(_0x22bcaf,_0x253f6e))[_0x6e4f('0x24')](handleError(_0x22bcaf,null));};exports[_0x6e4f('0x46')]=function(_0x1e9fce,_0xe82de7){var _0x43a37c={'raw':![],'where':{'id':_0x1e9fce[_0x6e4f('0x47')]['id']}},_0x307c38={};_0x307c38['model']=_[_0x6e4f('0x32')](db[_0x6e4f('0x43')][_0x6e4f('0x30')]);_0x307c38[_0x6e4f('0x33')]=_[_0x6e4f('0x32')](_0x1e9fce['query']);_0x307c38[_0x6e4f('0x3b')]=_[_0x6e4f('0x34')](_0x307c38[_0x6e4f('0x31')],_0x307c38[_0x6e4f('0x33')]);_0x43a37c['attributes']=_[_0x6e4f('0x34')](_0x307c38['model'],qs[_0x6e4f('0x36')](_0x1e9fce[_0x6e4f('0x33')][_0x6e4f('0x36')]));_0x43a37c[_0x6e4f('0x35')]=_0x43a37c[_0x6e4f('0x35')][_0x6e4f('0x37')]?_0x43a37c['attributes']:_0x307c38[_0x6e4f('0x31')];if(_0x1e9fce['query'][_0x6e4f('0x45')]){_0x43a37c[_0x6e4f('0x48')]=[{'all':!![]}];}_0x43a37c=_[_0x6e4f('0x3e')]({},_0x43a37c,_0x1e9fce[_0x6e4f('0x49')]);return db['ZendeskAccount'][_0x6e4f('0x4a')](_0x43a37c)[_0x6e4f('0x1c')](handleEntityNotFound(_0xe82de7,null))[_0x6e4f('0x1c')](respondWithResult(_0xe82de7,null))[_0x6e4f('0x24')](handleError(_0xe82de7,null));};exports[_0x6e4f('0x4b')]=function(_0x38c07a,_0x3c9f3f){return db['ZendeskAccount'][_0x6e4f('0x4b')](_0x38c07a[_0x6e4f('0x4c')],{})[_0x6e4f('0x1c')](respondWithResult(_0x3c9f3f,0xc9))['catch'](handleError(_0x3c9f3f,null));};exports[_0x6e4f('0x2e')]=function(_0x2a8a10,_0x56d55c){if(_0x2a8a10[_0x6e4f('0x4c')]['id']){delete _0x2a8a10[_0x6e4f('0x4c')]['id'];}return db['ZendeskAccount'][_0x6e4f('0x4a')]({'where':{'id':_0x2a8a10['params']['id']}})[_0x6e4f('0x1c')](handleEntityNotFound(_0x56d55c,null))['then'](saveUpdates(_0x2a8a10[_0x6e4f('0x4c')],null))[_0x6e4f('0x1c')](respondWithResult(_0x56d55c,null))[_0x6e4f('0x24')](handleError(_0x56d55c,null));};exports['destroy']=function(_0x21e2d4,_0x259e79){return db[_0x6e4f('0x43')][_0x6e4f('0x4a')]({'where':{'id':_0x21e2d4[_0x6e4f('0x47')]['id']}})[_0x6e4f('0x1c')](handleEntityNotFound(_0x259e79,null))['then'](removeEntity(_0x259e79,null))[_0x6e4f('0x24')](handleError(_0x259e79,null));};exports[_0x6e4f('0x4d')]=function(_0x480e3c,_0x1e748c,_0x53aae3){var _0x52b099={};var _0x5c2003={};var _0x2e96a6;var _0x730db4;return db['ZendeskAccount'][_0x6e4f('0x4e')]({'where':{'id':_0x480e3c[_0x6e4f('0x47')]['id']}})[_0x6e4f('0x1c')](handleEntityNotFound(_0x1e748c,null))[_0x6e4f('0x1c')](function(_0x54ac0f){if(_0x54ac0f){_0x2e96a6=_0x54ac0f;_0x5c2003['model']=_['keys'](db[_0x6e4f('0x4f')]['rawAttributes']);_0x5c2003[_0x6e4f('0x33')]=_[_0x6e4f('0x32')](_0x480e3c[_0x6e4f('0x33')]);_0x5c2003[_0x6e4f('0x3b')]=_[_0x6e4f('0x34')](_0x5c2003[_0x6e4f('0x31')],_0x5c2003[_0x6e4f('0x33')]);_0x52b099['attributes']=_['intersection'](_0x5c2003[_0x6e4f('0x31')],qs['fields'](_0x480e3c[_0x6e4f('0x33')][_0x6e4f('0x36')]));_0x52b099[_0x6e4f('0x35')]=_0x52b099['attributes'][_0x6e4f('0x37')]?_0x52b099[_0x6e4f('0x35')]:_0x5c2003[_0x6e4f('0x31')];_0x52b099[_0x6e4f('0x39')]=qs['sort'](_0x480e3c[_0x6e4f('0x33')][_0x6e4f('0x3a')]);_0x52b099[_0x6e4f('0x3d')]=qs[_0x6e4f('0x3b')](_['pick'](_0x480e3c[_0x6e4f('0x33')],_0x5c2003[_0x6e4f('0x3b')]));if(_0x480e3c[_0x6e4f('0x33')][_0x6e4f('0x3c')]){_0x52b099[_0x6e4f('0x3d')]=_[_0x6e4f('0x3e')](_0x52b099[_0x6e4f('0x3d')],{'$or':_[_0x6e4f('0x3f')](_0x52b099[_0x6e4f('0x35')],function(_0x9f1851){var _0xb4e33e={};_0xb4e33e[_0x9f1851]={'$like':'%'+_0x480e3c[_0x6e4f('0x33')][_0x6e4f('0x3c')]+'%'};return _0xb4e33e;})});}_0x52b099=_[_0x6e4f('0x3e')]({},_0x52b099,_0x480e3c[_0x6e4f('0x49')]);return _0x2e96a6[_0x6e4f('0x4d')](_0x52b099);}})[_0x6e4f('0x1c')](function(_0x48fc73){if(_0x48fc73){_0x730db4=_0x48fc73[_0x6e4f('0x37')];if(!_0x480e3c['query'][_0x6e4f('0x50')](_0x6e4f('0x38'))){_0x52b099['limit']=qs['limit'](_0x480e3c[_0x6e4f('0x33')][_0x6e4f('0x2a')]);_0x52b099[_0x6e4f('0x29')]=qs[_0x6e4f('0x29')](_0x480e3c['query']['offset']);}return _0x2e96a6['getConfigurations'](_0x52b099);}})[_0x6e4f('0x1c')](function(_0x482f16){if(_0x482f16){return _0x482f16?{'count':_0x730db4,'rows':_0x482f16}:null;}})[_0x6e4f('0x1c')](respondWithResult(_0x1e748c,null))['catch'](handleError(_0x1e748c,null));};exports[_0x6e4f('0x51')]=function(_0x5a39c1,_0x44343e,_0x3c816d){if(_0x5a39c1[_0x6e4f('0x4c')]['id']){delete _0x5a39c1['body']['id'];}return db['ZendeskAccount'][_0x6e4f('0x4e')]({'where':{'id':_0x5a39c1[_0x6e4f('0x47')]['id']}})['then'](handleEntityNotFound(_0x44343e,null))['then'](function(_0x1c15a4){if(_0x1c15a4){_0x5a39c1[_0x6e4f('0x4c')][_0x6e4f('0x52')]=_0x1c15a4['id'];_0x5a39c1['body'][_0x6e4f('0x53')]=integrations[_0x6e4f('0x54')](_0x5a39c1[_0x6e4f('0x4c')][_0x6e4f('0x55')],_0x5a39c1[_0x6e4f('0x4c')]['type']);_0x5a39c1['body'][_0x6e4f('0x56')]=integrations[_0x6e4f('0x57')](_0x5a39c1[_0x6e4f('0x4c')][_0x6e4f('0x55')],_0x5a39c1['body'][_0x6e4f('0x40')]);return db[_0x6e4f('0x4f')]['create'](_0x5a39c1[_0x6e4f('0x4c')],{'include':[{'model':db[_0x6e4f('0x58')],'as':_0x6e4f('0x53')},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0x6e4f('0x1c')](respondWithResult(_0x44343e,null))['catch'](handleError(_0x44343e,null));};exports[_0x6e4f('0x59')]=function(_0x1f307f,_0x3e1a88,_0x365c2e){var _0x1ceeca='';return db['ZendeskAccount'][_0x6e4f('0x4e')]({'where':{'id':_0x1f307f[_0x6e4f('0x47')]['id']},'attributes':['id',_0x6e4f('0x5a'),_0x6e4f('0x5b'),_0x6e4f('0x5c'),_0x6e4f('0x5d'),_0x6e4f('0x5e')]})[_0x6e4f('0x1c')](handleEntityNotFound(_0x3e1a88,null))[_0x6e4f('0x1c')](function(_0x585b3d){if(_0x585b3d){_0x1ceeca=_0x585b3d[_0x6e4f('0x5e')];var _0x12d58c=_0x1ceeca['slice'](-0x1);if(_0x12d58c==='/'){_0x1ceeca=_0x1ceeca['substring'](0x0,_0x1ceeca[_0x6e4f('0x5f')](_0x12d58c));}var _0x31a5cc={'method':_0x6e4f('0x60'),'uri':util[_0x6e4f('0x61')](_0x6e4f('0x62'),_0x1ceeca,'ticket_fields'),'json':!![]};switch(_0x585b3d['authType']){case'password':_0x31a5cc['headers']={'Authorization':util[_0x6e4f('0x61')](_0x6e4f('0x63'),new Buffer(util[_0x6e4f('0x61')](_0x6e4f('0x64'),_0x585b3d['username'],_0x585b3d['password']))[_0x6e4f('0x65')](_0x6e4f('0x66')))};break;case _0x6e4f('0x5c'):_0x31a5cc['headers']={'Authorization':util[_0x6e4f('0x61')](_0x6e4f('0x63'),new Buffer(util['format']('%s/token:%s',_0x585b3d[_0x6e4f('0x5a')],_0x585b3d[_0x6e4f('0x5c')]))[_0x6e4f('0x65')](_0x6e4f('0x66')))};break;default:throw new db[(_0x6e4f('0x67'))][(_0x6e4f('0x68'))](_0x6e4f('0x69'));}return rp(_0x31a5cc);}})['then'](function(_0x5077ae){if(_0x5077ae){var _0x130239=[_0x6e4f('0x6a'),_0x6e4f('0x6b'),_0x6e4f('0x6c'),_0x6e4f('0x6d')];_[_0x6e4f('0x6e')](_0x5077ae[_0x6e4f('0x6f')],function(_0x24986a){return _0x130239[_0x6e4f('0x70')](_0x24986a[_0x6e4f('0x40')]);});return{'count':_0x5077ae['ticket_fields'][_0x6e4f('0x37')],'rows':_[_0x6e4f('0x3f')](_0x5077ae['ticket_fields'],function(_0x4208a7){return{'id':_0x4208a7['id'],'name':_0x4208a7[_0x6e4f('0x71')]>0x7?_0x4208a7[_0x6e4f('0x72')]:_0x4208a7['type'],'custom':_0x4208a7[_0x6e4f('0x71')]>0x7?!![]:![],'options':_0x4208a7[_0x6e4f('0x73')]?_0x4208a7[_0x6e4f('0x73')]:_0x4208a7[_0x6e4f('0x74')]?_0x4208a7[_0x6e4f('0x74')]:[]};})};}})[_0x6e4f('0x1c')](respondWithResult(_0x3e1a88,null))[_0x6e4f('0x24')](function(_0x4f5044){var _0x4c1b71=_0x1f307f['query']['test']?0x1f4:_0x4f5044['statusCode']||0x1f4;logger[_0x6e4f('0x21')](_0x6e4f('0x75'),_0x6e4f('0x59'),_0x4c1b71,JSON[_0x6e4f('0x20')](_0x4f5044));delete _0x4f5044[_0x6e4f('0x76')];if(_0x4c1b71===0x191){_0x4c1b71=0x190;}_0x3e1a88[_0x6e4f('0x27')](_0x4c1b71)[_0x6e4f('0x77')](_0x1f307f[_0x6e4f('0x33')][_0x6e4f('0x78')]?{'message':_0x6e4f('0x79'),'statusCode':_0x4f5044[_0x6e4f('0x7a')]}:_0x4f5044);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index cae7e1a..cb328cf 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 _0x3618=['./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','int_zendesk_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x3618,0x10d));var _0x8361=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x3618[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x8361('0x0'));var util=require(_0x8361('0x1'));var logger=require(_0x8361('0x2'))('api');var moment=require(_0x8361('0x3'));var BPromise=require(_0x8361('0x4'));var rp=require(_0x8361('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8361('0x6'));var attributes=require(_0x8361('0x7'));var integrations=require(_0x8361('0x8'));module[_0x8361('0x9')]=function(_0x4634d4,_0x4d92b0){return _0x4634d4[_0x8361('0xa')]('ZendeskAccount',attributes,{'tableName':_0x8361('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2876=['int_zendesk_accounts','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./intZendeskAccount.attributes','exports','define','ZendeskAccount'];(function(_0x5a41ed,_0x4c9080){var _0x5b37fe=function(_0x12a046){while(--_0x12a046){_0x5a41ed['push'](_0x5a41ed['shift']());}};_0x5b37fe(++_0x4c9080);}(_0x2876,0x91));var _0x6287=function(_0xc18ce1,_0x329f9b){_0xc18ce1=_0xc18ce1-0x0;var _0x12ea8b=_0x2876[_0xc18ce1];return _0x12ea8b;};'use strict';var _=require(_0x6287('0x0'));var util=require(_0x6287('0x1'));var logger=require(_0x6287('0x2'))(_0x6287('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6287('0x4'));var rimraf=require(_0x6287('0x5'));var config=require(_0x6287('0x6'));var attributes=require(_0x6287('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x6287('0x8')]=function(_0x5a1d70,_0x1c527e){return _0x5a1d70[_0x6287('0x9')](_0x6287('0xa'),attributes,{'tableName':_0x6287('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 a5d855e..103b0c3 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 _0x43f8=['message','result','catch','GetZendeskAccount','options','where','attributes','limit','map','include','model','ShowZendeskAccount','ZendeskAccount','raw','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5d00e9,_0x496174){var _0x399693=function(_0x241538){while(--_0x241538){_0x5d00e9['push'](_0x5d00e9['shift']());}};_0x399693(++_0x496174);}(_0x43f8,0x1bb));var _0x843f=function(_0x1c1314,_0x5972aa){_0x1c1314=_0x1c1314-0x0;var _0x2efd18=_0x43f8[_0x1c1314];return _0x2efd18;};'use strict';var _=require(_0x843f('0x0'));var util=require(_0x843f('0x1'));var moment=require(_0x843f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x843f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x843f('0x4'));var logger=require(_0x843f('0x5'))('rpc');var config=require(_0x843f('0x6'));var jayson=require(_0x843f('0x7'));var client=jayson[_0x843f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d312b,_0x12bce4,_0x1a6d65){return new BPromise(function(_0x277417,_0x30526e){return client[_0x843f('0x9')](_0x5d312b,_0x1a6d65)[_0x843f('0xa')](function(_0x136a9c){logger[_0x843f('0xb')](_0x843f('0xc'),_0x12bce4,_0x843f('0xd'));logger[_0x843f('0xe')](_0x843f('0xf'),_0x12bce4,_0x843f('0xd'),JSON[_0x843f('0x10')](_0x136a9c));if(_0x136a9c[_0x843f('0x11')]){if(_0x136a9c[_0x843f('0x11')][_0x843f('0x12')]===0x1f4){logger['error'](_0x843f('0xc'),_0x12bce4,_0x136a9c[_0x843f('0x11')][_0x843f('0x13')]);return _0x30526e(_0x136a9c[_0x843f('0x11')]['message']);}logger[_0x843f('0x11')](_0x843f('0xc'),_0x12bce4,_0x136a9c[_0x843f('0x11')][_0x843f('0x13')]);return _0x277417(_0x136a9c[_0x843f('0x11')][_0x843f('0x13')]);}else{logger[_0x843f('0xb')](_0x843f('0xc'),_0x12bce4,_0x843f('0xd'));_0x277417(_0x136a9c[_0x843f('0x14')][_0x843f('0x13')]);}})[_0x843f('0x15')](function(_0x320178){logger[_0x843f('0x11')](_0x843f('0xc'),_0x12bce4,_0x320178);_0x30526e(_0x320178);});});}exports[_0x843f('0x16')]=function(_0x1b89f1){var _0x5c2de0=this;return new Promise(function(_0x1a8587,_0x476be2){return db['ZendeskAccount']['findAll']({'raw':_0x1b89f1['options']?_0x1b89f1[_0x843f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1b89f1[_0x843f('0x17')]?_0x1b89f1[_0x843f('0x17')][_0x843f('0x18')]||null:null,'attributes':_0x1b89f1[_0x843f('0x17')]?_0x1b89f1[_0x843f('0x17')][_0x843f('0x19')]||null:null,'limit':_0x1b89f1['options']?_0x1b89f1[_0x843f('0x17')][_0x843f('0x1a')]||null:null,'include':_0x1b89f1[_0x843f('0x17')]?_0x1b89f1[_0x843f('0x17')]['include']?_[_0x843f('0x1b')](_0x1b89f1[_0x843f('0x17')][_0x843f('0x1c')],function(_0x2da72c){return{'model':db[_0x2da72c[_0x843f('0x1d')]],'as':_0x2da72c['as'],'attributes':_0x2da72c[_0x843f('0x19')],'include':_0x2da72c[_0x843f('0x1c')]?_[_0x843f('0x1b')](_0x2da72c[_0x843f('0x1c')],function(_0x454e34){return{'model':db[_0x454e34[_0x843f('0x1d')]],'as':_0x454e34['as'],'attributes':_0x454e34[_0x843f('0x19')],'include':_0x454e34[_0x843f('0x1c')]?_[_0x843f('0x1b')](_0x454e34['include'],function(_0x461563){return{'model':db[_0x461563[_0x843f('0x1d')]],'as':_0x461563['as'],'attributes':_0x461563['attributes']};}):[]};}):[]};}):[]:[]})[_0x843f('0xa')](function(_0x464800){logger[_0x843f('0xb')](_0x843f('0x16'),_0x1b89f1);logger[_0x843f('0xe')]('GetZendeskAccount',_0x1b89f1,JSON['stringify'](_0x464800));_0x1a8587(_0x464800);})[_0x843f('0x15')](function(_0x611c0c){logger[_0x843f('0x11')](_0x843f('0x16'),_0x611c0c[_0x843f('0x13')],_0x1b89f1);_0x476be2(_0x5c2de0[_0x843f('0x11')](0x1f4,_0x611c0c[_0x843f('0x13')]));});});};exports[_0x843f('0x1e')]=function(_0x492d60){var _0x4036e1=this;return new Promise(function(_0x6ef9f5,_0x5b846b){return db[_0x843f('0x1f')]['find']({'raw':_0x492d60[_0x843f('0x17')]?_0x492d60[_0x843f('0x17')][_0x843f('0x20')]===undefined?!![]:![]:!![],'where':_0x492d60['options']?_0x492d60['options'][_0x843f('0x18')]||null:null,'attributes':_0x492d60[_0x843f('0x17')]?_0x492d60['options']['attributes']||null:null,'include':_0x492d60[_0x843f('0x17')]?_0x492d60[_0x843f('0x17')][_0x843f('0x1c')]?_[_0x843f('0x1b')](_0x492d60[_0x843f('0x17')][_0x843f('0x1c')],function(_0x59dcae){return{'model':db[_0x59dcae[_0x843f('0x1d')]],'as':_0x59dcae['as'],'attributes':_0x59dcae[_0x843f('0x19')],'include':_0x59dcae['include']?_[_0x843f('0x1b')](_0x59dcae['include'],function(_0x5e0604){return{'model':db[_0x5e0604[_0x843f('0x1d')]],'as':_0x5e0604['as'],'attributes':_0x5e0604[_0x843f('0x19')],'include':_0x5e0604[_0x843f('0x1c')]?_[_0x843f('0x1b')](_0x5e0604[_0x843f('0x1c')],function(_0x14ccf5){return{'model':db[_0x14ccf5['model']],'as':_0x14ccf5['as'],'attributes':_0x14ccf5[_0x843f('0x19')]};}):[]};}):[]};}):[]:[]})[_0x843f('0xa')](function(_0x2d1287){logger[_0x843f('0xb')](_0x843f('0x1e'),_0x492d60);logger[_0x843f('0xe')](_0x843f('0x1e'),_0x492d60,JSON['stringify'](_0x2d1287));_0x6ef9f5(_0x2d1287);})[_0x843f('0x15')](function(_0x4771d8){logger['error'](_0x843f('0x1e'),_0x4771d8[_0x843f('0x13')],_0x492d60);_0x5b846b(_0x4036e1[_0x843f('0x11')](0x1f4,_0x4771d8[_0x843f('0x13')]));});});}; \ No newline at end of file +var _0xc3ac=['jayson/promise','client','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','include','map','stringify','ShowZendeskAccount','find','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc3ac,0x86));var _0xcc3a=function(_0x97f30a,_0x5d4196){_0x97f30a=_0x97f30a-0x0;var _0x121a5c=_0xc3ac[_0x97f30a];return _0x121a5c;};'use strict';var _=require(_0xcc3a('0x0'));var util=require(_0xcc3a('0x1'));var moment=require(_0xcc3a('0x2'));var BPromise=require(_0xcc3a('0x3'));var rs=require(_0xcc3a('0x4'));var fs=require('fs');var Redis=require(_0xcc3a('0x5'));var db=require(_0xcc3a('0x6'))['db'];var utils=require(_0xcc3a('0x7'));var logger=require(_0xcc3a('0x8'))('rpc');var config=require(_0xcc3a('0x9'));var jayson=require(_0xcc3a('0xa'));var client=jayson[_0xcc3a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27761c,_0x40b60a,_0x2a68de){return new BPromise(function(_0x5609e8,_0x11c83b){return client['request'](_0x27761c,_0x2a68de)[_0xcc3a('0xc')](function(_0xe4852b){logger[_0xcc3a('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x40b60a,_0xcc3a('0xe'));logger[_0xcc3a('0xf')](_0xcc3a('0x10'),_0x40b60a,_0xcc3a('0xe'),JSON['stringify'](_0xe4852b));if(_0xe4852b[_0xcc3a('0x11')]){if(_0xe4852b[_0xcc3a('0x11')][_0xcc3a('0x12')]===0x1f4){logger[_0xcc3a('0x11')](_0xcc3a('0x13'),_0x40b60a,_0xe4852b['error'][_0xcc3a('0x14')]);return _0x11c83b(_0xe4852b[_0xcc3a('0x11')]['message']);}logger[_0xcc3a('0x11')](_0xcc3a('0x13'),_0x40b60a,_0xe4852b[_0xcc3a('0x11')][_0xcc3a('0x14')]);return _0x5609e8(_0xe4852b[_0xcc3a('0x11')][_0xcc3a('0x14')]);}else{logger[_0xcc3a('0xd')](_0xcc3a('0x13'),_0x40b60a,_0xcc3a('0xe'));_0x5609e8(_0xe4852b[_0xcc3a('0x15')][_0xcc3a('0x14')]);}})[_0xcc3a('0x16')](function(_0xd60bee){logger[_0xcc3a('0x11')](_0xcc3a('0x13'),_0x40b60a,_0xd60bee);_0x11c83b(_0xd60bee);});});}exports[_0xcc3a('0x17')]=function(_0x528e5c){var _0x39d8f2=this;return new Promise(function(_0x522290,_0x3d1f56){return db[_0xcc3a('0x18')][_0xcc3a('0x19')]({'raw':_0x528e5c['options']?_0x528e5c[_0xcc3a('0x1a')][_0xcc3a('0x1b')]===undefined?!![]:![]:!![],'where':_0x528e5c[_0xcc3a('0x1a')]?_0x528e5c[_0xcc3a('0x1a')][_0xcc3a('0x1c')]||null:null,'attributes':_0x528e5c[_0xcc3a('0x1a')]?_0x528e5c['options'][_0xcc3a('0x1d')]||null:null,'limit':_0x528e5c[_0xcc3a('0x1a')]?_0x528e5c[_0xcc3a('0x1a')]['limit']||null:null,'include':_0x528e5c['options']?_0x528e5c[_0xcc3a('0x1a')][_0xcc3a('0x1e')]?_[_0xcc3a('0x1f')](_0x528e5c[_0xcc3a('0x1a')]['include'],function(_0x28b0ba){return{'model':db[_0x28b0ba['model']],'as':_0x28b0ba['as'],'attributes':_0x28b0ba['attributes'],'include':_0x28b0ba[_0xcc3a('0x1e')]?_[_0xcc3a('0x1f')](_0x28b0ba[_0xcc3a('0x1e')],function(_0x12bffe){return{'model':db[_0x12bffe['model']],'as':_0x12bffe['as'],'attributes':_0x12bffe['attributes'],'include':_0x12bffe[_0xcc3a('0x1e')]?_[_0xcc3a('0x1f')](_0x12bffe[_0xcc3a('0x1e')],function(_0x4db65f){return{'model':db[_0x4db65f['model']],'as':_0x4db65f['as'],'attributes':_0x4db65f[_0xcc3a('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x22e228){logger[_0xcc3a('0xd')](_0xcc3a('0x17'),_0x528e5c);logger[_0xcc3a('0xf')](_0xcc3a('0x17'),_0x528e5c,JSON[_0xcc3a('0x20')](_0x22e228));_0x522290(_0x22e228);})['catch'](function(_0x3294bf){logger['error'](_0xcc3a('0x17'),_0x3294bf[_0xcc3a('0x14')],_0x528e5c);_0x3d1f56(_0x39d8f2[_0xcc3a('0x11')](0x1f4,_0x3294bf[_0xcc3a('0x14')]));});});};exports[_0xcc3a('0x21')]=function(_0x116069){var _0x49e819=this;return new Promise(function(_0x22e2a0,_0x59a272){return db[_0xcc3a('0x18')][_0xcc3a('0x22')]({'raw':_0x116069[_0xcc3a('0x1a')]?_0x116069[_0xcc3a('0x1a')][_0xcc3a('0x1b')]===undefined?!![]:![]:!![],'where':_0x116069['options']?_0x116069['options'][_0xcc3a('0x1c')]||null:null,'attributes':_0x116069[_0xcc3a('0x1a')]?_0x116069[_0xcc3a('0x1a')][_0xcc3a('0x1d')]||null:null,'include':_0x116069['options']?_0x116069['options'][_0xcc3a('0x1e')]?_[_0xcc3a('0x1f')](_0x116069[_0xcc3a('0x1a')][_0xcc3a('0x1e')],function(_0x493b24){return{'model':db[_0x493b24[_0xcc3a('0x23')]],'as':_0x493b24['as'],'attributes':_0x493b24[_0xcc3a('0x1d')],'include':_0x493b24['include']?_['map'](_0x493b24[_0xcc3a('0x1e')],function(_0x537ad5){return{'model':db[_0x537ad5[_0xcc3a('0x23')]],'as':_0x537ad5['as'],'attributes':_0x537ad5['attributes'],'include':_0x537ad5[_0xcc3a('0x1e')]?_[_0xcc3a('0x1f')](_0x537ad5[_0xcc3a('0x1e')],function(_0x58d756){return{'model':db[_0x58d756['model']],'as':_0x58d756['as'],'attributes':_0x58d756[_0xcc3a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcc3a('0xc')](function(_0x43364c){logger[_0xcc3a('0xd')](_0xcc3a('0x21'),_0x116069);logger['debug'](_0xcc3a('0x21'),_0x116069,JSON[_0xcc3a('0x20')](_0x43364c));_0x22e2a0(_0x43364c);})[_0xcc3a('0x16')](function(_0xfc0b14){logger[_0xcc3a('0x11')](_0xcc3a('0x21'),_0xfc0b14['message'],_0x116069);_0x59a272(_0x49e819[_0xcc3a('0x11')](0x1f4,_0xfc0b14[_0xcc3a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 128435f..27fbaaa 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 _0x1407=['express','Router','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','/:id','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','put','destroy','exports','multer','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1407,0x105));var _0x7140=function(_0x51aab0,_0x537d99){_0x51aab0=_0x51aab0-0x0;var _0x3652cc=_0x1407[_0x51aab0];return _0x3652cc;};'use strict';var multer=require(_0x7140('0x0'));var util=require('util');var path=require(_0x7140('0x1'));var timeout=require(_0x7140('0x2'));var express=require(_0x7140('0x3'));var router=express[_0x7140('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x7140('0x5'));var config=require(_0x7140('0x6'));var controller=require(_0x7140('0x7'));router['get']('/',auth[_0x7140('0x8')](),controller[_0x7140('0x9')]);router['get'](_0x7140('0xa'),auth[_0x7140('0x8')](),controller['show']);router[_0x7140('0xb')](_0x7140('0xc'),auth[_0x7140('0x8')](),controller[_0x7140('0xd')]);router[_0x7140('0xb')](_0x7140('0xe'),auth[_0x7140('0x8')](),controller[_0x7140('0xf')]);router[_0x7140('0xb')](_0x7140('0x10'),auth[_0x7140('0x8')](),controller[_0x7140('0x11')]);router[_0x7140('0xb')]('/:id/tags',auth[_0x7140('0x8')](),controller[_0x7140('0x12')]);router[_0x7140('0x13')]('/',auth[_0x7140('0x8')](),controller['create']);router[_0x7140('0x13')](_0x7140('0x14'),auth[_0x7140('0x8')](),controller['setTags']);router[_0x7140('0x15')](_0x7140('0xa'),auth[_0x7140('0x8')](),controller['update']);router['delete']('/:id',auth[_0x7140('0x8')](),controller[_0x7140('0x16')]);module[_0x7140('0x17')]=router; \ No newline at end of file +var _0x0d49=['/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','create','post','put','/:id','update','delete','exports','multer','util','connect-timeout','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index'];(function(_0x59befa,_0x4af99b){var _0x1dd63d=function(_0x4c1df4){while(--_0x4c1df4){_0x59befa['push'](_0x59befa['shift']());}};_0x1dd63d(++_0x4af99b);}(_0x0d49,0x1da));var _0x90d4=function(_0x32f94b,_0x5e1538){_0x32f94b=_0x32f94b-0x0;var _0x2f29a8=_0x0d49[_0x32f94b];return _0x2f29a8;};'use strict';var multer=require(_0x90d4('0x0'));var util=require(_0x90d4('0x1'));var path=require('path');var timeout=require(_0x90d4('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x90d4('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x90d4('0x4'));var controller=require(_0x90d4('0x5'));router[_0x90d4('0x6')]('/',auth[_0x90d4('0x7')](),controller[_0x90d4('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x90d4('0x6')](_0x90d4('0x9'),auth[_0x90d4('0x7')](),controller[_0x90d4('0xa')]);router[_0x90d4('0x6')](_0x90d4('0xb'),auth[_0x90d4('0x7')](),controller[_0x90d4('0xc')]);router[_0x90d4('0x6')](_0x90d4('0xd'),auth['isAuthenticated'](),controller[_0x90d4('0xe')]);router[_0x90d4('0x6')]('/:id/tags',auth[_0x90d4('0x7')](),controller[_0x90d4('0xf')]);router['post']('/',auth[_0x90d4('0x7')](),controller[_0x90d4('0x10')]);router[_0x90d4('0x11')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0x90d4('0x12')](_0x90d4('0x13'),auth[_0x90d4('0x7')](),controller[_0x90d4('0x14')]);router[_0x90d4('0x15')](_0x90d4('0x13'),auth[_0x90d4('0x7')](),controller['destroy']);module[_0x90d4('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 0ebef88..eec77ad 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 _0x1564=['STRING'];(function(_0x2d5023,_0x23178e){var _0x459de3=function(_0x97d826){while(--_0x97d826){_0x2d5023['push'](_0x2d5023['shift']());}};_0x459de3(++_0x23178e);}(_0x1564,0x13e));var _0x4156=function(_0x53fb43,_0x223a27){_0x53fb43=_0x53fb43-0x0;var _0x35ca6e=_0x1564[_0x53fb43];return _0x35ca6e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4156('0x0')]},'description':{'type':Sequelize[_0x4156('0x0')]}}; \ No newline at end of file +var _0x7042=['exports','STRING','sequelize'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x7042,0x8f));var _0x2704=function(_0x49dfdc,_0xf933ef){_0x49dfdc=_0x49dfdc-0x0;var _0x5eb183=_0x7042[_0x49dfdc];return _0x5eb183;};'use strict';var Sequelize=require(_0x2704('0x0'));module[_0x2704('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2704('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 0f0d385..a858847 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 _0x42d7=['ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','end','status','json','offset','limit','set','reject','save','update','destroy','name','send','index','ZendeskConfiguration','rawAttributes','model','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','sort','filter','where','merge','map','field','options','includeAll','include','rows','show','find','create','body','getFields','findOne','params','ZendeskField','order','getSubjects','getDescriptions','Tag','pick','getTags','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','request','then','info'];(function(_0xd5bb22,_0x5cfccb){var _0x2d105a=function(_0x54b74c){while(--_0x54b74c){_0xd5bb22['push'](_0xd5bb22['shift']());}};_0x2d105a(++_0x5cfccb);}(_0x42d7,0xf4));var _0x742d=function(_0x135904,_0x1e252b){_0x135904=_0x135904-0x0;var _0x1ce7d5=_0x42d7[_0x135904];return _0x1ce7d5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x742d('0x0'));var rimraf=require(_0x742d('0x1'));var zipdir=require(_0x742d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x742d('0x3'));var moment=require(_0x742d('0x4'));var BPromise=require(_0x742d('0x5'));var Mustache=require(_0x742d('0x6'));var util=require(_0x742d('0x7'));var path=require(_0x742d('0x8'));var sox=require('sox');var csv=require(_0x742d('0x9'));var ejs=require(_0x742d('0xa'));var fs=require('fs');var _=require(_0x742d('0xb'));var squel=require('squel');var crypto=require(_0x742d('0xc'));var jsforce=require(_0x742d('0xd'));var deskjs=require(_0x742d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x742d('0xf'));var Papa=require(_0x742d('0x10'));var Redis=require('ioredis');var authService=require(_0x742d('0x11'));var qs=require(_0x742d('0x12'));var hardwareService=require(_0x742d('0x13'));var logger=require(_0x742d('0x14'))(_0x742d('0x15'));var utils=require(_0x742d('0x16'));var config=require(_0x742d('0x17'));var db=require(_0x742d('0x18'))['db'];var jayson=require(_0x742d('0x19'));var client=jayson[_0x742d('0x1a')][_0x742d('0x1b')]({'port':0x232a});function checkPasswordPattern(_0xff209a,_0x30b617,_0x21df63){if(_0x21df63){var _0x56f915=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x56f915[_0x742d('0x1c')](_0x30b617)){return _0xff209a;}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 _0xff209a;}}function respondWithRpcPromise(_0x49f90e,_0x38eb01,_0x3f062b,_0x1f2425){return new BPromise(function(_0x5c45e7,_0x3f6c6c){var _0x58ffd1=_0x1f2425||client;return _0x58ffd1[_0x742d('0x1d')](_0x49f90e,_0x3f062b)[_0x742d('0x1e')](function(_0x16319e){logger[_0x742d('0x1f')](_0x742d('0x20'),_0x38eb01,_0x742d('0x21'));logger[_0x742d('0x22')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x38eb01,_0x742d('0x21'),JSON[_0x742d('0x23')](_0x16319e));if(_0x16319e[_0x742d('0x24')]){if(_0x16319e[_0x742d('0x24')]['code']===0x1f4){logger[_0x742d('0x24')](_0x742d('0x20'),_0x38eb01,_0x16319e[_0x742d('0x24')][_0x742d('0x25')]);return _0x3f6c6c(_0x16319e[_0x742d('0x24')]['message']);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x38eb01,_0x16319e[_0x742d('0x24')][_0x742d('0x25')]);return _0x5c45e7(_0x16319e[_0x742d('0x24')][_0x742d('0x25')]);}else{logger[_0x742d('0x1f')](_0x742d('0x20'),_0x38eb01,'request\x20sent');_0x5c45e7(_0x16319e[_0x742d('0x26')]['message']);}})[_0x742d('0x27')](function(_0x4d6e34){logger['error'](_0x742d('0x20'),_0x38eb01,_0x4d6e34);_0x3f6c6c(_0x4d6e34);});});}function respondWithStatusCode(_0x3b5a89,_0x4b265d){_0x4b265d=_0x4b265d||0xcc;return function(_0x2edcbd){if(_0x2edcbd){return _0x3b5a89[_0x742d('0x28')](_0x4b265d);}return _0x3b5a89['status'](_0x4b265d)[_0x742d('0x29')]();};}function respondWithResult(_0x2ded5b,_0x1b02b1){_0x1b02b1=_0x1b02b1||0xc8;return function(_0x519508){if(_0x519508){return _0x2ded5b[_0x742d('0x2a')](_0x1b02b1)[_0x742d('0x2b')](_0x519508);}};}function respondWithFilteredResult(_0x16877d,_0x1f4f29){return function(_0x1c926f){if(_0x1c926f){var _0x2ea727=_0x1c926f['count'],_0x5bacc1=_0x1f4f29[_0x742d('0x2c')],_0xca316e=_0x1f4f29[_0x742d('0x2c')]+_0x1f4f29[_0x742d('0x2d')],_0x5f2874;if(_0xca316e>=_0x2ea727){_0xca316e=_0x2ea727;_0x5f2874=0xc8;}else{_0x5f2874=0xce;}_0x16877d[_0x742d('0x2a')](_0x5f2874);return _0x16877d[_0x742d('0x2e')]('Content-Range',_0x5bacc1+'-'+_0xca316e+'/'+_0x2ea727)['json'](_0x1c926f);}return null;};}function patchUpdates(_0x28a35d){return function(_0x4de66e){try{jsonpatch['apply'](_0x4de66e,_0x28a35d,!![]);}catch(_0x190e3c){return BPromise[_0x742d('0x2f')](_0x190e3c);}return _0x4de66e[_0x742d('0x30')]();};}function saveUpdates(_0x4fa5c2,_0xede917){return function(_0x58ce99){if(_0x58ce99){return _0x58ce99[_0x742d('0x31')](_0x4fa5c2)[_0x742d('0x1e')](function(_0x302e4b){return _0x302e4b;});}return null;};}function removeEntity(_0x16f4e1,_0x5d1139){return function(_0x3096e2){if(_0x3096e2){return _0x3096e2[_0x742d('0x32')]()['then'](function(){_0x16f4e1[_0x742d('0x2a')](0xcc)[_0x742d('0x29')]();});}};}function handleEntityNotFound(_0x128299,_0x5a4c36){return function(_0x40786c){if(!_0x40786c){_0x128299['sendStatus'](0x194);}return _0x40786c;};}function handleError(_0x919842,_0x50f45f){_0x50f45f=_0x50f45f||0x1f4;return function(_0x3bae82){logger[_0x742d('0x24')](_0x3bae82['stack']);if(_0x3bae82[_0x742d('0x33')]){delete _0x3bae82[_0x742d('0x33')];}_0x919842[_0x742d('0x2a')](_0x50f45f)[_0x742d('0x34')](_0x3bae82);};}exports[_0x742d('0x35')]=function(_0x2fb6d3,_0x2773df){var _0x182f1f={},_0x53dfbf={},_0x37f7e7={'count':0x0,'rows':[]};var _0x60a6e3=db[_0x742d('0x36')][_0x742d('0x37')];_0x53dfbf[_0x742d('0x38')]=_[_0x742d('0x39')](_0x60a6e3);_0x53dfbf['query']=_[_0x742d('0x39')](_0x2fb6d3['query']);_0x53dfbf[_0x742d('0x3a')]=_[_0x742d('0x3b')](_0x53dfbf['model'],_0x53dfbf['query']);_0x182f1f['attributes']=_[_0x742d('0x3b')](_0x53dfbf[_0x742d('0x38')],qs[_0x742d('0x3c')](_0x2fb6d3[_0x742d('0x3d')][_0x742d('0x3c')]));_0x182f1f[_0x742d('0x3e')]=_0x182f1f[_0x742d('0x3e')][_0x742d('0x3f')]?_0x182f1f['attributes']:_0x53dfbf[_0x742d('0x38')];if(!_0x2fb6d3[_0x742d('0x3d')][_0x742d('0x40')](_0x742d('0x41'))){_0x182f1f[_0x742d('0x2d')]=qs[_0x742d('0x2d')](_0x2fb6d3[_0x742d('0x3d')]['limit']);_0x182f1f[_0x742d('0x2c')]=qs[_0x742d('0x2c')](_0x2fb6d3['query']['offset']);}_0x182f1f['order']=qs[_0x742d('0x42')](_0x2fb6d3['query']['sort']);_0x182f1f['where']=qs[_0x742d('0x3a')](_['pick'](_0x2fb6d3[_0x742d('0x3d')],_0x53dfbf[_0x742d('0x3a')]));if(_0x2fb6d3[_0x742d('0x3d')][_0x742d('0x43')]){_0x182f1f[_0x742d('0x44')]=_[_0x742d('0x45')](_0x182f1f[_0x742d('0x44')],{'$or':_[_0x742d('0x46')](_0x60a6e3,function(_0x11d99c){if(_0x11d99c['type']['key']!=='VIRTUAL'){var _0x288495={};_0x288495[_0x11d99c[_0x742d('0x47')]]={'$like':'%'+_0x2fb6d3['query']['filter']+'%'};return _0x288495;}})});}_0x182f1f=_[_0x742d('0x45')]({},_0x182f1f,_0x2fb6d3[_0x742d('0x48')]);var _0x2f45c8={'where':_0x182f1f[_0x742d('0x44')]};return db['ZendeskConfiguration']['count'](_0x2f45c8)[_0x742d('0x1e')](function(_0x1ae70d){_0x37f7e7['count']=_0x1ae70d;if(_0x2fb6d3[_0x742d('0x3d')][_0x742d('0x49')]){_0x182f1f[_0x742d('0x4a')]=[{'all':!![]}];}return db[_0x742d('0x36')]['findAll'](_0x182f1f);})[_0x742d('0x1e')](function(_0x5a81e7){_0x37f7e7[_0x742d('0x4b')]=_0x5a81e7;return _0x37f7e7;})[_0x742d('0x1e')](respondWithFilteredResult(_0x2773df,_0x182f1f))[_0x742d('0x27')](handleError(_0x2773df,null));};exports[_0x742d('0x4c')]=function(_0x3f1010,_0x15701b){var _0x42b5ba={'raw':![],'where':{'id':_0x3f1010['params']['id']}},_0x3c4129={};_0x3c4129['model']=_[_0x742d('0x39')](db[_0x742d('0x36')][_0x742d('0x37')]);_0x3c4129[_0x742d('0x3d')]=_[_0x742d('0x39')](_0x3f1010['query']);_0x3c4129['filters']=_['intersection'](_0x3c4129[_0x742d('0x38')],_0x3c4129['query']);_0x42b5ba[_0x742d('0x3e')]=_[_0x742d('0x3b')](_0x3c4129['model'],qs['fields'](_0x3f1010[_0x742d('0x3d')][_0x742d('0x3c')]));_0x42b5ba['attributes']=_0x42b5ba[_0x742d('0x3e')][_0x742d('0x3f')]?_0x42b5ba[_0x742d('0x3e')]:_0x3c4129[_0x742d('0x38')];if(_0x3f1010[_0x742d('0x3d')][_0x742d('0x49')]){_0x42b5ba['include']=[{'all':!![]}];}_0x42b5ba=_['merge']({},_0x42b5ba,_0x3f1010['options']);return db[_0x742d('0x36')][_0x742d('0x4d')](_0x42b5ba)[_0x742d('0x1e')](handleEntityNotFound(_0x15701b,null))['then'](respondWithResult(_0x15701b,null))[_0x742d('0x27')](handleError(_0x15701b,null));};exports[_0x742d('0x4e')]=function(_0x2694f8,_0x40ae34){return db[_0x742d('0x36')][_0x742d('0x4e')](_0x2694f8[_0x742d('0x4f')],{})[_0x742d('0x1e')](respondWithResult(_0x40ae34,0xc9))[_0x742d('0x27')](handleError(_0x40ae34,null));};exports['update']=function(_0x3369e5,_0x239d2c){if(_0x3369e5['body']['id']){delete _0x3369e5[_0x742d('0x4f')]['id'];}return db['ZendeskConfiguration'][_0x742d('0x4d')]({'where':{'id':_0x3369e5['params']['id']}})[_0x742d('0x1e')](handleEntityNotFound(_0x239d2c,null))[_0x742d('0x1e')](saveUpdates(_0x3369e5[_0x742d('0x4f')],null))[_0x742d('0x1e')](respondWithResult(_0x239d2c,null))['catch'](handleError(_0x239d2c,null));};exports[_0x742d('0x32')]=function(_0x2ce70c,_0x36a682){return db[_0x742d('0x36')][_0x742d('0x4d')]({'where':{'id':_0x2ce70c['params']['id']}})[_0x742d('0x1e')](handleEntityNotFound(_0x36a682,null))[_0x742d('0x1e')](removeEntity(_0x36a682,null))[_0x742d('0x27')](handleError(_0x36a682,null));};exports[_0x742d('0x50')]=function(_0x431f39,_0x544d40,_0x4bd1e4){var _0x36c485={};var _0x659f36={};var _0x272828;var _0x3327eb;return db[_0x742d('0x36')][_0x742d('0x51')]({'where':{'id':_0x431f39[_0x742d('0x52')]['id']}})[_0x742d('0x1e')](handleEntityNotFound(_0x544d40,null))['then'](function(_0x1477c2){if(_0x1477c2){_0x272828=_0x1477c2;_0x659f36[_0x742d('0x38')]=_[_0x742d('0x39')](db[_0x742d('0x53')][_0x742d('0x37')]);_0x659f36[_0x742d('0x3d')]=_[_0x742d('0x39')](_0x431f39[_0x742d('0x3d')]);_0x659f36[_0x742d('0x3a')]=_['intersection'](_0x659f36['model'],_0x659f36[_0x742d('0x3d')]);_0x36c485[_0x742d('0x3e')]=_[_0x742d('0x3b')](_0x659f36[_0x742d('0x38')],qs[_0x742d('0x3c')](_0x431f39[_0x742d('0x3d')][_0x742d('0x3c')]));_0x36c485[_0x742d('0x3e')]=_0x36c485[_0x742d('0x3e')][_0x742d('0x3f')]?_0x36c485['attributes']:_0x659f36[_0x742d('0x38')];_0x36c485[_0x742d('0x54')]=qs[_0x742d('0x42')](_0x431f39[_0x742d('0x3d')]['sort']);_0x36c485[_0x742d('0x44')]=qs[_0x742d('0x3a')](_['pick'](_0x431f39[_0x742d('0x3d')],_0x659f36['filters']));if(_0x431f39[_0x742d('0x3d')][_0x742d('0x43')]){_0x36c485[_0x742d('0x44')]=_[_0x742d('0x45')](_0x36c485[_0x742d('0x44')],{'$or':_[_0x742d('0x46')](_0x36c485[_0x742d('0x3e')],function(_0xb04935){var _0x3b9a30={};_0x3b9a30[_0xb04935]={'$like':'%'+_0x431f39[_0x742d('0x3d')][_0x742d('0x43')]+'%'};return _0x3b9a30;})});}_0x36c485=_['merge']({},_0x36c485,_0x431f39['options']);return _0x272828[_0x742d('0x50')](_0x36c485);}})['then'](function(_0x56f41d){if(_0x56f41d){_0x3327eb=_0x56f41d['length'];if(!_0x431f39[_0x742d('0x3d')][_0x742d('0x40')](_0x742d('0x41'))){_0x36c485[_0x742d('0x2d')]=qs[_0x742d('0x2d')](_0x431f39[_0x742d('0x3d')][_0x742d('0x2d')]);_0x36c485[_0x742d('0x2c')]=qs[_0x742d('0x2c')](_0x431f39[_0x742d('0x3d')]['offset']);}return _0x272828[_0x742d('0x50')](_0x36c485);}})[_0x742d('0x1e')](function(_0x5a0614){if(_0x5a0614){return _0x5a0614?{'count':_0x3327eb,'rows':_0x5a0614}:null;}})[_0x742d('0x1e')](respondWithResult(_0x544d40,null))['catch'](handleError(_0x544d40,null));};exports['getSubjects']=function(_0x473571,_0x4e197c,_0x4c7358){var _0x3db72c={};var _0x36794d={};var _0xbd2020;var _0x127fd9;return db[_0x742d('0x36')][_0x742d('0x51')]({'where':{'id':_0x473571[_0x742d('0x52')]['id']}})[_0x742d('0x1e')](handleEntityNotFound(_0x4e197c,null))[_0x742d('0x1e')](function(_0x1f0a49){if(_0x1f0a49){_0xbd2020=_0x1f0a49;_0x36794d[_0x742d('0x38')]=_['keys'](db[_0x742d('0x53')][_0x742d('0x37')]);_0x36794d[_0x742d('0x3d')]=_['keys'](_0x473571[_0x742d('0x3d')]);_0x36794d[_0x742d('0x3a')]=_[_0x742d('0x3b')](_0x36794d['model'],_0x36794d[_0x742d('0x3d')]);_0x3db72c['attributes']=_['intersection'](_0x36794d['model'],qs['fields'](_0x473571['query'][_0x742d('0x3c')]));_0x3db72c['attributes']=_0x3db72c['attributes']['length']?_0x3db72c[_0x742d('0x3e')]:_0x36794d[_0x742d('0x38')];_0x3db72c[_0x742d('0x54')]=qs[_0x742d('0x42')](_0x473571['query'][_0x742d('0x42')]);_0x3db72c['where']=qs['filters'](_['pick'](_0x473571[_0x742d('0x3d')],_0x36794d[_0x742d('0x3a')]));if(_0x473571[_0x742d('0x3d')][_0x742d('0x43')]){_0x3db72c[_0x742d('0x44')]=_[_0x742d('0x45')](_0x3db72c['where'],{'$or':_['map'](_0x3db72c['attributes'],function(_0x242577){var _0x285066={};_0x285066[_0x242577]={'$like':'%'+_0x473571[_0x742d('0x3d')]['filter']+'%'};return _0x285066;})});}_0x3db72c=_[_0x742d('0x45')]({},_0x3db72c,_0x473571[_0x742d('0x48')]);return _0xbd2020[_0x742d('0x55')](_0x3db72c);}})[_0x742d('0x1e')](function(_0xb3061a){if(_0xb3061a){_0x127fd9=_0xb3061a[_0x742d('0x3f')];if(!_0x473571[_0x742d('0x3d')][_0x742d('0x40')]('nolimit')){_0x3db72c[_0x742d('0x2d')]=qs[_0x742d('0x2d')](_0x473571['query']['limit']);_0x3db72c[_0x742d('0x2c')]=qs['offset'](_0x473571[_0x742d('0x3d')][_0x742d('0x2c')]);}return _0xbd2020[_0x742d('0x55')](_0x3db72c);}})[_0x742d('0x1e')](function(_0x87597e){if(_0x87597e){return _0x87597e?{'count':_0x127fd9,'rows':_0x87597e}:null;}})[_0x742d('0x1e')](respondWithResult(_0x4e197c,null))[_0x742d('0x27')](handleError(_0x4e197c,null));};exports['getDescriptions']=function(_0x122071,_0x540d3c,_0x134e60){var _0x322699={};var _0x4a1259={};var _0x492825;var _0x99afe4;return db[_0x742d('0x36')][_0x742d('0x51')]({'where':{'id':_0x122071[_0x742d('0x52')]['id']}})[_0x742d('0x1e')](handleEntityNotFound(_0x540d3c,null))['then'](function(_0x15c43a){if(_0x15c43a){_0x492825=_0x15c43a;_0x4a1259[_0x742d('0x38')]=_[_0x742d('0x39')](db[_0x742d('0x53')][_0x742d('0x37')]);_0x4a1259['query']=_[_0x742d('0x39')](_0x122071[_0x742d('0x3d')]);_0x4a1259[_0x742d('0x3a')]=_[_0x742d('0x3b')](_0x4a1259[_0x742d('0x38')],_0x4a1259[_0x742d('0x3d')]);_0x322699[_0x742d('0x3e')]=_['intersection'](_0x4a1259[_0x742d('0x38')],qs[_0x742d('0x3c')](_0x122071['query'][_0x742d('0x3c')]));_0x322699[_0x742d('0x3e')]=_0x322699[_0x742d('0x3e')][_0x742d('0x3f')]?_0x322699['attributes']:_0x4a1259[_0x742d('0x38')];_0x322699[_0x742d('0x54')]=qs[_0x742d('0x42')](_0x122071[_0x742d('0x3d')]['sort']);_0x322699[_0x742d('0x44')]=qs[_0x742d('0x3a')](_['pick'](_0x122071['query'],_0x4a1259[_0x742d('0x3a')]));if(_0x122071[_0x742d('0x3d')][_0x742d('0x43')]){_0x322699[_0x742d('0x44')]=_[_0x742d('0x45')](_0x322699['where'],{'$or':_['map'](_0x322699[_0x742d('0x3e')],function(_0x523eca){var _0x4ea604={};_0x4ea604[_0x523eca]={'$like':'%'+_0x122071[_0x742d('0x3d')][_0x742d('0x43')]+'%'};return _0x4ea604;})});}_0x322699=_[_0x742d('0x45')]({},_0x322699,_0x122071['options']);return _0x492825['getDescriptions'](_0x322699);}})[_0x742d('0x1e')](function(_0x199003){if(_0x199003){_0x99afe4=_0x199003[_0x742d('0x3f')];if(!_0x122071[_0x742d('0x3d')][_0x742d('0x40')](_0x742d('0x41'))){_0x322699[_0x742d('0x2d')]=qs[_0x742d('0x2d')](_0x122071[_0x742d('0x3d')]['limit']);_0x322699['offset']=qs[_0x742d('0x2c')](_0x122071[_0x742d('0x3d')]['offset']);}return _0x492825[_0x742d('0x56')](_0x322699);}})['then'](function(_0x1d001b){if(_0x1d001b){return _0x1d001b?{'count':_0x99afe4,'rows':_0x1d001b}:null;}})['then'](respondWithResult(_0x540d3c,null))['catch'](handleError(_0x540d3c,null));};exports['getTags']=function(_0x182dad,_0x315b11,_0x49f500){var _0x3de7f1={};var _0x436e3f={};var _0x4cee6b;var _0x2c3b84;return db['ZendeskConfiguration'][_0x742d('0x51')]({'where':{'id':_0x182dad[_0x742d('0x52')]['id']}})['then'](handleEntityNotFound(_0x315b11,null))[_0x742d('0x1e')](function(_0x44ec9f){if(_0x44ec9f){_0x4cee6b=_0x44ec9f;_0x436e3f[_0x742d('0x38')]=_['keys'](db[_0x742d('0x57')][_0x742d('0x37')]);_0x436e3f[_0x742d('0x3d')]=_[_0x742d('0x39')](_0x182dad['query']);_0x436e3f[_0x742d('0x3a')]=_[_0x742d('0x3b')](_0x436e3f[_0x742d('0x38')],_0x436e3f[_0x742d('0x3d')]);_0x3de7f1['attributes']=_[_0x742d('0x3b')](_0x436e3f[_0x742d('0x38')],qs[_0x742d('0x3c')](_0x182dad[_0x742d('0x3d')][_0x742d('0x3c')]));_0x3de7f1[_0x742d('0x3e')]=_0x3de7f1['attributes'][_0x742d('0x3f')]?_0x3de7f1['attributes']:_0x436e3f['model'];_0x3de7f1[_0x742d('0x54')]=qs[_0x742d('0x42')](_0x182dad[_0x742d('0x3d')][_0x742d('0x42')]);_0x3de7f1[_0x742d('0x44')]=qs[_0x742d('0x3a')](_[_0x742d('0x58')](_0x182dad[_0x742d('0x3d')],_0x436e3f[_0x742d('0x3a')]));if(_0x182dad[_0x742d('0x3d')]['filter']){_0x3de7f1[_0x742d('0x44')]=_[_0x742d('0x45')](_0x3de7f1[_0x742d('0x44')],{'$or':_[_0x742d('0x46')](_0x3de7f1[_0x742d('0x3e')],function(_0x2664a7){var _0xe01826={};_0xe01826[_0x2664a7]={'$like':'%'+_0x182dad[_0x742d('0x3d')][_0x742d('0x43')]+'%'};return _0xe01826;})});}_0x3de7f1=_['merge']({},_0x3de7f1,_0x182dad[_0x742d('0x48')]);return _0x4cee6b[_0x742d('0x59')](_0x3de7f1);}})[_0x742d('0x1e')](function(_0x4d77bd){if(_0x4d77bd){_0x2c3b84=_0x4d77bd[_0x742d('0x3f')];if(!_0x182dad[_0x742d('0x3d')][_0x742d('0x40')]('nolimit')){_0x3de7f1[_0x742d('0x2d')]=qs[_0x742d('0x2d')](_0x182dad[_0x742d('0x3d')]['limit']);_0x3de7f1[_0x742d('0x2c')]=qs[_0x742d('0x2c')](_0x182dad[_0x742d('0x3d')][_0x742d('0x2c')]);}return _0x4cee6b[_0x742d('0x59')](_0x3de7f1);}})['then'](function(_0x1286a7){if(_0x1286a7){return _0x1286a7?{'count':_0x2c3b84,'rows':_0x1286a7}:null;}})[_0x742d('0x1e')](respondWithResult(_0x315b11,null))[_0x742d('0x27')](handleError(_0x315b11,null));};exports['setTags']=function(_0x3c0975,_0x19236d,_0x5c8bf3){if(_0x3c0975['body']['id']){delete _0x3c0975['body']['id'];}return db[_0x742d('0x36')][_0x742d('0x51')]({'where':{'id':_0x3c0975[_0x742d('0x52')]['id']}})[_0x742d('0x1e')](handleEntityNotFound(_0x19236d,null))['then'](function(_0x34644e){if(_0x34644e){return _0x34644e[_0x742d('0x5a')](_0x3c0975[_0x742d('0x4f')][_0x742d('0x5b')]||[]);}return null;})[_0x742d('0x1e')](respondWithResult(_0x19236d,null))['catch'](handleError(_0x19236d,null));}; \ No newline at end of file +var _0xed66=['Content-Range','apply','destroy','stack','name','send','index','ZendeskConfiguration','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','key','field','options','includeAll','include','findAll','rows','show','params','find','create','body','update','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../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','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','count','offset','status','set'];(function(_0x127316,_0x2774a8){var _0x34d919=function(_0x22691d){while(--_0x22691d){_0x127316['push'](_0x127316['shift']());}};_0x34d919(++_0x2774a8);}(_0xed66,0xf9));var _0x6ed6=function(_0x4135e7,_0x14f68b){_0x4135e7=_0x4135e7-0x0;var _0x3032f9=_0xed66[_0x4135e7];return _0x3032f9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6ed6('0x0'));var rimraf=require(_0x6ed6('0x1'));var zipdir=require(_0x6ed6('0x2'));var jsonpatch=require(_0x6ed6('0x3'));var rp=require(_0x6ed6('0x4'));var moment=require(_0x6ed6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6ed6('0x6'));var util=require(_0x6ed6('0x7'));var path=require(_0x6ed6('0x8'));var sox=require(_0x6ed6('0x9'));var csv=require(_0x6ed6('0xa'));var ejs=require(_0x6ed6('0xb'));var fs=require('fs');var _=require(_0x6ed6('0xc'));var squel=require(_0x6ed6('0xd'));var crypto=require(_0x6ed6('0xe'));var jsforce=require(_0x6ed6('0xf'));var deskjs=require(_0x6ed6('0x10'));var toCsv=require(_0x6ed6('0xa'));var querystring=require(_0x6ed6('0x11'));var Papa=require(_0x6ed6('0x12'));var Redis=require(_0x6ed6('0x13'));var authService=require(_0x6ed6('0x14'));var qs=require(_0x6ed6('0x15'));var hardwareService=require(_0x6ed6('0x16'));var logger=require(_0x6ed6('0x17'))(_0x6ed6('0x18'));var utils=require(_0x6ed6('0x19'));var config=require('../../config/environment');var db=require(_0x6ed6('0x1a'))['db'];var jayson=require(_0x6ed6('0x1b'));var client=jayson[_0x6ed6('0x1c')][_0x6ed6('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x8b55,_0x3b1af8,_0x194b7e){if(_0x194b7e){var _0x6b57a5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6b57a5[_0x6ed6('0x1e')](_0x3b1af8)){return _0x8b55;}else{throw new Error(_0x6ed6('0x1f'));}}else{return _0x8b55;}}function respondWithRpcPromise(_0x1870b0,_0xae10f4,_0x4ba9f6,_0x18095e){return new BPromise(function(_0x4de34b,_0x17330d){var _0x578720=_0x18095e||client;return _0x578720[_0x6ed6('0x20')](_0x1870b0,_0x4ba9f6)[_0x6ed6('0x21')](function(_0x5343f4){logger[_0x6ed6('0x22')](_0x6ed6('0x23'),_0xae10f4,_0x6ed6('0x24'));logger['debug'](_0x6ed6('0x25'),_0xae10f4,_0x6ed6('0x24'),JSON[_0x6ed6('0x26')](_0x5343f4));if(_0x5343f4[_0x6ed6('0x27')]){if(_0x5343f4[_0x6ed6('0x27')][_0x6ed6('0x28')]===0x1f4){logger['error'](_0x6ed6('0x23'),_0xae10f4,_0x5343f4[_0x6ed6('0x27')][_0x6ed6('0x29')]);return _0x17330d(_0x5343f4[_0x6ed6('0x27')][_0x6ed6('0x29')]);}logger[_0x6ed6('0x27')](_0x6ed6('0x23'),_0xae10f4,_0x5343f4['error'][_0x6ed6('0x29')]);return _0x4de34b(_0x5343f4[_0x6ed6('0x27')][_0x6ed6('0x29')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0xae10f4,_0x6ed6('0x24'));_0x4de34b(_0x5343f4[_0x6ed6('0x2a')][_0x6ed6('0x29')]);}})[_0x6ed6('0x2b')](function(_0x25904a){logger[_0x6ed6('0x27')](_0x6ed6('0x23'),_0xae10f4,_0x25904a);_0x17330d(_0x25904a);});});}function respondWithStatusCode(_0x239a78,_0x5b1a5e){_0x5b1a5e=_0x5b1a5e||0xcc;return function(_0x34692e){if(_0x34692e){return _0x239a78[_0x6ed6('0x2c')](_0x5b1a5e);}return _0x239a78['status'](_0x5b1a5e)[_0x6ed6('0x2d')]();};}function respondWithResult(_0x146272,_0x28f2a1){_0x28f2a1=_0x28f2a1||0xc8;return function(_0x5eb06e){if(_0x5eb06e){return _0x146272['status'](_0x28f2a1)[_0x6ed6('0x2e')](_0x5eb06e);}};}function respondWithFilteredResult(_0x5535d1,_0x4ca71f){return function(_0x415a25){if(_0x415a25){var _0x5ad450=_0x415a25[_0x6ed6('0x2f')],_0x220dd4=_0x4ca71f[_0x6ed6('0x30')],_0x1101db=_0x4ca71f[_0x6ed6('0x30')]+_0x4ca71f['limit'],_0x1bed84;if(_0x1101db>=_0x5ad450){_0x1101db=_0x5ad450;_0x1bed84=0xc8;}else{_0x1bed84=0xce;}_0x5535d1[_0x6ed6('0x31')](_0x1bed84);return _0x5535d1[_0x6ed6('0x32')](_0x6ed6('0x33'),_0x220dd4+'-'+_0x1101db+'/'+_0x5ad450)['json'](_0x415a25);}return null;};}function patchUpdates(_0x28deaa){return function(_0x587840){try{jsonpatch[_0x6ed6('0x34')](_0x587840,_0x28deaa,!![]);}catch(_0x2d4066){return BPromise['reject'](_0x2d4066);}return _0x587840['save']();};}function saveUpdates(_0x22bc2c,_0xb60ced){return function(_0x54b6f6){if(_0x54b6f6){return _0x54b6f6['update'](_0x22bc2c)[_0x6ed6('0x21')](function(_0x583d8e){return _0x583d8e;});}return null;};}function removeEntity(_0x37e1be,_0xc8a1db){return function(_0x458d89){if(_0x458d89){return _0x458d89[_0x6ed6('0x35')]()['then'](function(){_0x37e1be[_0x6ed6('0x31')](0xcc)[_0x6ed6('0x2d')]();});}};}function handleEntityNotFound(_0x38e1ff,_0x380d6c){return function(_0x2707ac){if(!_0x2707ac){_0x38e1ff[_0x6ed6('0x2c')](0x194);}return _0x2707ac;};}function handleError(_0x1cac82,_0x5c213a){_0x5c213a=_0x5c213a||0x1f4;return function(_0x1d74dd){logger[_0x6ed6('0x27')](_0x1d74dd[_0x6ed6('0x36')]);if(_0x1d74dd[_0x6ed6('0x37')]){delete _0x1d74dd[_0x6ed6('0x37')];}_0x1cac82[_0x6ed6('0x31')](_0x5c213a)[_0x6ed6('0x38')](_0x1d74dd);};}exports[_0x6ed6('0x39')]=function(_0x3d71d9,_0x29367e){var _0x5393e0={},_0x35e21e={},_0x2f0b41={'count':0x0,'rows':[]};var _0x420b17=db[_0x6ed6('0x3a')][_0x6ed6('0x3b')];_0x35e21e[_0x6ed6('0x3c')]=_[_0x6ed6('0x3d')](_0x420b17);_0x35e21e[_0x6ed6('0x3e')]=_['keys'](_0x3d71d9['query']);_0x35e21e[_0x6ed6('0x3f')]=_[_0x6ed6('0x40')](_0x35e21e[_0x6ed6('0x3c')],_0x35e21e['query']);_0x5393e0['attributes']=_[_0x6ed6('0x40')](_0x35e21e[_0x6ed6('0x3c')],qs['fields'](_0x3d71d9[_0x6ed6('0x3e')][_0x6ed6('0x41')]));_0x5393e0[_0x6ed6('0x42')]=_0x5393e0[_0x6ed6('0x42')][_0x6ed6('0x43')]?_0x5393e0[_0x6ed6('0x42')]:_0x35e21e[_0x6ed6('0x3c')];if(!_0x3d71d9['query'][_0x6ed6('0x44')](_0x6ed6('0x45'))){_0x5393e0[_0x6ed6('0x46')]=qs[_0x6ed6('0x46')](_0x3d71d9[_0x6ed6('0x3e')][_0x6ed6('0x46')]);_0x5393e0[_0x6ed6('0x30')]=qs[_0x6ed6('0x30')](_0x3d71d9[_0x6ed6('0x3e')][_0x6ed6('0x30')]);}_0x5393e0[_0x6ed6('0x47')]=qs[_0x6ed6('0x48')](_0x3d71d9[_0x6ed6('0x3e')]['sort']);_0x5393e0[_0x6ed6('0x49')]=qs[_0x6ed6('0x3f')](_[_0x6ed6('0x4a')](_0x3d71d9[_0x6ed6('0x3e')],_0x35e21e[_0x6ed6('0x3f')]));if(_0x3d71d9[_0x6ed6('0x3e')][_0x6ed6('0x4b')]){_0x5393e0[_0x6ed6('0x49')]=_[_0x6ed6('0x4c')](_0x5393e0[_0x6ed6('0x49')],{'$or':_[_0x6ed6('0x4d')](_0x420b17,function(_0x2c5936){if(_0x2c5936['type'][_0x6ed6('0x4e')]!=='VIRTUAL'){var _0x129df6={};_0x129df6[_0x2c5936[_0x6ed6('0x4f')]]={'$like':'%'+_0x3d71d9[_0x6ed6('0x3e')][_0x6ed6('0x4b')]+'%'};return _0x129df6;}})});}_0x5393e0=_[_0x6ed6('0x4c')]({},_0x5393e0,_0x3d71d9[_0x6ed6('0x50')]);var _0x21d613={'where':_0x5393e0[_0x6ed6('0x49')]};return db['ZendeskConfiguration'][_0x6ed6('0x2f')](_0x21d613)[_0x6ed6('0x21')](function(_0x278db3){_0x2f0b41['count']=_0x278db3;if(_0x3d71d9[_0x6ed6('0x3e')][_0x6ed6('0x51')]){_0x5393e0[_0x6ed6('0x52')]=[{'all':!![]}];}return db[_0x6ed6('0x3a')][_0x6ed6('0x53')](_0x5393e0);})['then'](function(_0x4d5e83){_0x2f0b41[_0x6ed6('0x54')]=_0x4d5e83;return _0x2f0b41;})[_0x6ed6('0x21')](respondWithFilteredResult(_0x29367e,_0x5393e0))[_0x6ed6('0x2b')](handleError(_0x29367e,null));};exports[_0x6ed6('0x55')]=function(_0x485f61,_0xd0fae1){var _0xa6509f={'raw':![],'where':{'id':_0x485f61[_0x6ed6('0x56')]['id']}},_0x5773b9={};_0x5773b9[_0x6ed6('0x3c')]=_[_0x6ed6('0x3d')](db[_0x6ed6('0x3a')][_0x6ed6('0x3b')]);_0x5773b9[_0x6ed6('0x3e')]=_[_0x6ed6('0x3d')](_0x485f61[_0x6ed6('0x3e')]);_0x5773b9['filters']=_[_0x6ed6('0x40')](_0x5773b9[_0x6ed6('0x3c')],_0x5773b9[_0x6ed6('0x3e')]);_0xa6509f['attributes']=_['intersection'](_0x5773b9[_0x6ed6('0x3c')],qs[_0x6ed6('0x41')](_0x485f61[_0x6ed6('0x3e')][_0x6ed6('0x41')]));_0xa6509f[_0x6ed6('0x42')]=_0xa6509f[_0x6ed6('0x42')][_0x6ed6('0x43')]?_0xa6509f[_0x6ed6('0x42')]:_0x5773b9[_0x6ed6('0x3c')];if(_0x485f61['query'][_0x6ed6('0x51')]){_0xa6509f['include']=[{'all':!![]}];}_0xa6509f=_['merge']({},_0xa6509f,_0x485f61['options']);return db[_0x6ed6('0x3a')][_0x6ed6('0x57')](_0xa6509f)[_0x6ed6('0x21')](handleEntityNotFound(_0xd0fae1,null))[_0x6ed6('0x21')](respondWithResult(_0xd0fae1,null))[_0x6ed6('0x2b')](handleError(_0xd0fae1,null));};exports[_0x6ed6('0x58')]=function(_0x123aec,_0xdae18){return db[_0x6ed6('0x3a')][_0x6ed6('0x58')](_0x123aec[_0x6ed6('0x59')],{})[_0x6ed6('0x21')](respondWithResult(_0xdae18,0xc9))[_0x6ed6('0x2b')](handleError(_0xdae18,null));};exports[_0x6ed6('0x5a')]=function(_0x4410ee,_0x3fac73){if(_0x4410ee[_0x6ed6('0x59')]['id']){delete _0x4410ee[_0x6ed6('0x59')]['id'];}return db[_0x6ed6('0x3a')][_0x6ed6('0x57')]({'where':{'id':_0x4410ee[_0x6ed6('0x56')]['id']}})[_0x6ed6('0x21')](handleEntityNotFound(_0x3fac73,null))[_0x6ed6('0x21')](saveUpdates(_0x4410ee['body'],null))[_0x6ed6('0x21')](respondWithResult(_0x3fac73,null))['catch'](handleError(_0x3fac73,null));};exports[_0x6ed6('0x35')]=function(_0x2d7da9,_0x3d3344){return db[_0x6ed6('0x3a')][_0x6ed6('0x57')]({'where':{'id':_0x2d7da9[_0x6ed6('0x56')]['id']}})[_0x6ed6('0x21')](handleEntityNotFound(_0x3d3344,null))[_0x6ed6('0x21')](removeEntity(_0x3d3344,null))[_0x6ed6('0x2b')](handleError(_0x3d3344,null));};exports[_0x6ed6('0x5b')]=function(_0x486775,_0x3ebd01,_0x1008ce){var _0x26b79f={};var _0x45d063={};var _0x253c10;var _0x29a29b;return db[_0x6ed6('0x3a')][_0x6ed6('0x5c')]({'where':{'id':_0x486775['params']['id']}})[_0x6ed6('0x21')](handleEntityNotFound(_0x3ebd01,null))['then'](function(_0x2fcd9c){if(_0x2fcd9c){_0x253c10=_0x2fcd9c;_0x45d063[_0x6ed6('0x3c')]=_[_0x6ed6('0x3d')](db[_0x6ed6('0x5d')][_0x6ed6('0x3b')]);_0x45d063[_0x6ed6('0x3e')]=_[_0x6ed6('0x3d')](_0x486775[_0x6ed6('0x3e')]);_0x45d063['filters']=_[_0x6ed6('0x40')](_0x45d063[_0x6ed6('0x3c')],_0x45d063[_0x6ed6('0x3e')]);_0x26b79f[_0x6ed6('0x42')]=_[_0x6ed6('0x40')](_0x45d063[_0x6ed6('0x3c')],qs['fields'](_0x486775[_0x6ed6('0x3e')][_0x6ed6('0x41')]));_0x26b79f['attributes']=_0x26b79f[_0x6ed6('0x42')]['length']?_0x26b79f['attributes']:_0x45d063['model'];_0x26b79f['order']=qs[_0x6ed6('0x48')](_0x486775['query'][_0x6ed6('0x48')]);_0x26b79f[_0x6ed6('0x49')]=qs[_0x6ed6('0x3f')](_['pick'](_0x486775[_0x6ed6('0x3e')],_0x45d063[_0x6ed6('0x3f')]));if(_0x486775['query'][_0x6ed6('0x4b')]){_0x26b79f[_0x6ed6('0x49')]=_['merge'](_0x26b79f[_0x6ed6('0x49')],{'$or':_['map'](_0x26b79f['attributes'],function(_0x5e75f5){var _0x169d3c={};_0x169d3c[_0x5e75f5]={'$like':'%'+_0x486775[_0x6ed6('0x3e')]['filter']+'%'};return _0x169d3c;})});}_0x26b79f=_[_0x6ed6('0x4c')]({},_0x26b79f,_0x486775[_0x6ed6('0x50')]);return _0x253c10['getFields'](_0x26b79f);}})[_0x6ed6('0x21')](function(_0x9a1b79){if(_0x9a1b79){_0x29a29b=_0x9a1b79[_0x6ed6('0x43')];if(!_0x486775[_0x6ed6('0x3e')][_0x6ed6('0x44')](_0x6ed6('0x45'))){_0x26b79f[_0x6ed6('0x46')]=qs[_0x6ed6('0x46')](_0x486775[_0x6ed6('0x3e')][_0x6ed6('0x46')]);_0x26b79f['offset']=qs[_0x6ed6('0x30')](_0x486775[_0x6ed6('0x3e')][_0x6ed6('0x30')]);}return _0x253c10['getFields'](_0x26b79f);}})[_0x6ed6('0x21')](function(_0x324141){if(_0x324141){return _0x324141?{'count':_0x29a29b,'rows':_0x324141}:null;}})[_0x6ed6('0x21')](respondWithResult(_0x3ebd01,null))['catch'](handleError(_0x3ebd01,null));};exports[_0x6ed6('0x5e')]=function(_0x5b959d,_0x18509a,_0x231ea9){var _0x4e73c3={};var _0x5eded8={};var _0x4cff51;var _0x591ffb;return db[_0x6ed6('0x3a')][_0x6ed6('0x5c')]({'where':{'id':_0x5b959d[_0x6ed6('0x56')]['id']}})[_0x6ed6('0x21')](handleEntityNotFound(_0x18509a,null))[_0x6ed6('0x21')](function(_0x45ff14){if(_0x45ff14){_0x4cff51=_0x45ff14;_0x5eded8[_0x6ed6('0x3c')]=_['keys'](db[_0x6ed6('0x5d')][_0x6ed6('0x3b')]);_0x5eded8[_0x6ed6('0x3e')]=_[_0x6ed6('0x3d')](_0x5b959d[_0x6ed6('0x3e')]);_0x5eded8[_0x6ed6('0x3f')]=_[_0x6ed6('0x40')](_0x5eded8[_0x6ed6('0x3c')],_0x5eded8[_0x6ed6('0x3e')]);_0x4e73c3[_0x6ed6('0x42')]=_['intersection'](_0x5eded8[_0x6ed6('0x3c')],qs[_0x6ed6('0x41')](_0x5b959d[_0x6ed6('0x3e')][_0x6ed6('0x41')]));_0x4e73c3['attributes']=_0x4e73c3['attributes'][_0x6ed6('0x43')]?_0x4e73c3[_0x6ed6('0x42')]:_0x5eded8[_0x6ed6('0x3c')];_0x4e73c3[_0x6ed6('0x47')]=qs[_0x6ed6('0x48')](_0x5b959d[_0x6ed6('0x3e')][_0x6ed6('0x48')]);_0x4e73c3[_0x6ed6('0x49')]=qs[_0x6ed6('0x3f')](_[_0x6ed6('0x4a')](_0x5b959d[_0x6ed6('0x3e')],_0x5eded8['filters']));if(_0x5b959d[_0x6ed6('0x3e')][_0x6ed6('0x4b')]){_0x4e73c3[_0x6ed6('0x49')]=_['merge'](_0x4e73c3['where'],{'$or':_[_0x6ed6('0x4d')](_0x4e73c3[_0x6ed6('0x42')],function(_0x3e6f43){var _0x3a7e64={};_0x3a7e64[_0x3e6f43]={'$like':'%'+_0x5b959d[_0x6ed6('0x3e')][_0x6ed6('0x4b')]+'%'};return _0x3a7e64;})});}_0x4e73c3=_[_0x6ed6('0x4c')]({},_0x4e73c3,_0x5b959d['options']);return _0x4cff51['getSubjects'](_0x4e73c3);}})[_0x6ed6('0x21')](function(_0x3dd592){if(_0x3dd592){_0x591ffb=_0x3dd592[_0x6ed6('0x43')];if(!_0x5b959d[_0x6ed6('0x3e')][_0x6ed6('0x44')](_0x6ed6('0x45'))){_0x4e73c3['limit']=qs[_0x6ed6('0x46')](_0x5b959d[_0x6ed6('0x3e')]['limit']);_0x4e73c3[_0x6ed6('0x30')]=qs[_0x6ed6('0x30')](_0x5b959d[_0x6ed6('0x3e')][_0x6ed6('0x30')]);}return _0x4cff51[_0x6ed6('0x5e')](_0x4e73c3);}})[_0x6ed6('0x21')](function(_0x4ca949){if(_0x4ca949){return _0x4ca949?{'count':_0x591ffb,'rows':_0x4ca949}:null;}})[_0x6ed6('0x21')](respondWithResult(_0x18509a,null))[_0x6ed6('0x2b')](handleError(_0x18509a,null));};exports['getDescriptions']=function(_0x44065b,_0x5299b0,_0x2a117d){var _0x5d2e12={};var _0x620391={};var _0x2d6fd4;var _0x4f9d40;return db[_0x6ed6('0x3a')][_0x6ed6('0x5c')]({'where':{'id':_0x44065b[_0x6ed6('0x56')]['id']}})[_0x6ed6('0x21')](handleEntityNotFound(_0x5299b0,null))[_0x6ed6('0x21')](function(_0x2d770c){if(_0x2d770c){_0x2d6fd4=_0x2d770c;_0x620391['model']=_[_0x6ed6('0x3d')](db[_0x6ed6('0x5d')][_0x6ed6('0x3b')]);_0x620391[_0x6ed6('0x3e')]=_[_0x6ed6('0x3d')](_0x44065b['query']);_0x620391['filters']=_[_0x6ed6('0x40')](_0x620391[_0x6ed6('0x3c')],_0x620391['query']);_0x5d2e12[_0x6ed6('0x42')]=_[_0x6ed6('0x40')](_0x620391[_0x6ed6('0x3c')],qs[_0x6ed6('0x41')](_0x44065b[_0x6ed6('0x3e')][_0x6ed6('0x41')]));_0x5d2e12['attributes']=_0x5d2e12[_0x6ed6('0x42')][_0x6ed6('0x43')]?_0x5d2e12[_0x6ed6('0x42')]:_0x620391[_0x6ed6('0x3c')];_0x5d2e12[_0x6ed6('0x47')]=qs[_0x6ed6('0x48')](_0x44065b[_0x6ed6('0x3e')][_0x6ed6('0x48')]);_0x5d2e12[_0x6ed6('0x49')]=qs[_0x6ed6('0x3f')](_[_0x6ed6('0x4a')](_0x44065b[_0x6ed6('0x3e')],_0x620391[_0x6ed6('0x3f')]));if(_0x44065b[_0x6ed6('0x3e')][_0x6ed6('0x4b')]){_0x5d2e12[_0x6ed6('0x49')]=_[_0x6ed6('0x4c')](_0x5d2e12[_0x6ed6('0x49')],{'$or':_[_0x6ed6('0x4d')](_0x5d2e12[_0x6ed6('0x42')],function(_0xb713a4){var _0x493517={};_0x493517[_0xb713a4]={'$like':'%'+_0x44065b[_0x6ed6('0x3e')][_0x6ed6('0x4b')]+'%'};return _0x493517;})});}_0x5d2e12=_[_0x6ed6('0x4c')]({},_0x5d2e12,_0x44065b[_0x6ed6('0x50')]);return _0x2d6fd4[_0x6ed6('0x5f')](_0x5d2e12);}})[_0x6ed6('0x21')](function(_0x5d17af){if(_0x5d17af){_0x4f9d40=_0x5d17af[_0x6ed6('0x43')];if(!_0x44065b[_0x6ed6('0x3e')][_0x6ed6('0x44')](_0x6ed6('0x45'))){_0x5d2e12[_0x6ed6('0x46')]=qs[_0x6ed6('0x46')](_0x44065b[_0x6ed6('0x3e')][_0x6ed6('0x46')]);_0x5d2e12[_0x6ed6('0x30')]=qs[_0x6ed6('0x30')](_0x44065b[_0x6ed6('0x3e')]['offset']);}return _0x2d6fd4['getDescriptions'](_0x5d2e12);}})[_0x6ed6('0x21')](function(_0x5e0a23){if(_0x5e0a23){return _0x5e0a23?{'count':_0x4f9d40,'rows':_0x5e0a23}:null;}})[_0x6ed6('0x21')](respondWithResult(_0x5299b0,null))[_0x6ed6('0x2b')](handleError(_0x5299b0,null));};exports[_0x6ed6('0x60')]=function(_0x1d4859,_0x256d1f,_0x239953){var _0x5838c6={};var _0x98a911={};var _0x276912;var _0x420531;return db[_0x6ed6('0x3a')]['findOne']({'where':{'id':_0x1d4859[_0x6ed6('0x56')]['id']}})['then'](handleEntityNotFound(_0x256d1f,null))[_0x6ed6('0x21')](function(_0x23fe46){if(_0x23fe46){_0x276912=_0x23fe46;_0x98a911[_0x6ed6('0x3c')]=_['keys'](db[_0x6ed6('0x61')][_0x6ed6('0x3b')]);_0x98a911[_0x6ed6('0x3e')]=_['keys'](_0x1d4859[_0x6ed6('0x3e')]);_0x98a911['filters']=_[_0x6ed6('0x40')](_0x98a911[_0x6ed6('0x3c')],_0x98a911[_0x6ed6('0x3e')]);_0x5838c6[_0x6ed6('0x42')]=_[_0x6ed6('0x40')](_0x98a911[_0x6ed6('0x3c')],qs[_0x6ed6('0x41')](_0x1d4859[_0x6ed6('0x3e')][_0x6ed6('0x41')]));_0x5838c6[_0x6ed6('0x42')]=_0x5838c6[_0x6ed6('0x42')]['length']?_0x5838c6[_0x6ed6('0x42')]:_0x98a911['model'];_0x5838c6[_0x6ed6('0x47')]=qs['sort'](_0x1d4859[_0x6ed6('0x3e')][_0x6ed6('0x48')]);_0x5838c6[_0x6ed6('0x49')]=qs['filters'](_[_0x6ed6('0x4a')](_0x1d4859[_0x6ed6('0x3e')],_0x98a911[_0x6ed6('0x3f')]));if(_0x1d4859[_0x6ed6('0x3e')][_0x6ed6('0x4b')]){_0x5838c6[_0x6ed6('0x49')]=_[_0x6ed6('0x4c')](_0x5838c6[_0x6ed6('0x49')],{'$or':_['map'](_0x5838c6[_0x6ed6('0x42')],function(_0x2c307e){var _0x4e0364={};_0x4e0364[_0x2c307e]={'$like':'%'+_0x1d4859[_0x6ed6('0x3e')]['filter']+'%'};return _0x4e0364;})});}_0x5838c6=_['merge']({},_0x5838c6,_0x1d4859[_0x6ed6('0x50')]);return _0x276912[_0x6ed6('0x60')](_0x5838c6);}})['then'](function(_0x27e591){if(_0x27e591){_0x420531=_0x27e591['length'];if(!_0x1d4859['query'][_0x6ed6('0x44')](_0x6ed6('0x45'))){_0x5838c6[_0x6ed6('0x46')]=qs[_0x6ed6('0x46')](_0x1d4859[_0x6ed6('0x3e')][_0x6ed6('0x46')]);_0x5838c6[_0x6ed6('0x30')]=qs[_0x6ed6('0x30')](_0x1d4859[_0x6ed6('0x3e')][_0x6ed6('0x30')]);}return _0x276912[_0x6ed6('0x60')](_0x5838c6);}})['then'](function(_0x66b798){if(_0x66b798){return _0x66b798?{'count':_0x420531,'rows':_0x66b798}:null;}})[_0x6ed6('0x21')](respondWithResult(_0x256d1f,null))[_0x6ed6('0x2b')](handleError(_0x256d1f,null));};exports[_0x6ed6('0x62')]=function(_0x499f55,_0x45ffdb,_0x575bae){if(_0x499f55['body']['id']){delete _0x499f55[_0x6ed6('0x59')]['id'];}return db[_0x6ed6('0x3a')][_0x6ed6('0x5c')]({'where':{'id':_0x499f55[_0x6ed6('0x56')]['id']}})[_0x6ed6('0x21')](handleEntityNotFound(_0x45ffdb,null))[_0x6ed6('0x21')](function(_0x17c4b2){if(_0x17c4b2){return _0x17c4b2['setTags'](_0x499f55[_0x6ed6('0x59')][_0x6ed6('0x63')]||[]);}return null;})['then'](respondWithResult(_0x45ffdb,null))[_0x6ed6('0x2b')](handleError(_0x45ffdb,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 5cd0c60..fe7c51b 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 _0x3cb7=['int_zendesk_configurations','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration'];(function(_0xa73cba,_0x7b2b96){var _0x3f7d37=function(_0x1deea5){while(--_0x1deea5){_0xa73cba['push'](_0xa73cba['shift']());}};_0x3f7d37(++_0x7b2b96);}(_0x3cb7,0x1ae));var _0x73cb=function(_0x533bf7,_0x29485b){_0x533bf7=_0x533bf7-0x0;var _0x9e4c57=_0x3cb7[_0x533bf7];return _0x9e4c57;};'use strict';var _=require(_0x73cb('0x0'));var util=require(_0x73cb('0x1'));var logger=require('../../config/logger')(_0x73cb('0x2'));var moment=require(_0x73cb('0x3'));var BPromise=require(_0x73cb('0x4'));var rp=require(_0x73cb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x73cb('0x6'));var config=require(_0x73cb('0x7'));var attributes=require(_0x73cb('0x8'));module[_0x73cb('0x9')]=function(_0x4386e9,_0x2e260a){return _0x4386e9[_0x73cb('0xa')](_0x73cb('0xb'),attributes,{'tableName':_0x73cb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d15=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZendeskConfiguration.attributes','define','ZendeskConfiguration','lodash'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x4d15,0x137));var _0x54d1=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4d15[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x54d1('0x0'));var util=require(_0x54d1('0x1'));var logger=require(_0x54d1('0x2'))(_0x54d1('0x3'));var moment=require(_0x54d1('0x4'));var BPromise=require(_0x54d1('0x5'));var rp=require(_0x54d1('0x6'));var fs=require('fs');var path=require(_0x54d1('0x7'));var rimraf=require('rimraf');var config=require(_0x54d1('0x8'));var attributes=require(_0x54d1('0x9'));module['exports']=function(_0x3ae7d7,_0x283452){return _0x3ae7d7[_0x54d1('0xa')](_0x54d1('0xb'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index a962c4f..b2ca32f 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 _0x6d44=['jayson/promise','http','then','info','request\x20sent','debug','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x14e2dc,_0x5f3535){var _0x1843c3=function(_0x56f5cc){while(--_0x56f5cc){_0x14e2dc['push'](_0x14e2dc['shift']());}};_0x1843c3(++_0x5f3535);}(_0x6d44,0x166));var _0x46d4=function(_0x1f1feb,_0x5782e1){_0x1f1feb=_0x1f1feb-0x0;var _0x43ca65=_0x6d44[_0x1f1feb];return _0x43ca65;};'use strict';var _=require(_0x46d4('0x0'));var util=require(_0x46d4('0x1'));var moment=require(_0x46d4('0x2'));var BPromise=require(_0x46d4('0x3'));var rs=require(_0x46d4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46d4('0x5'))['db'];var utils=require(_0x46d4('0x6'));var logger=require(_0x46d4('0x7'))(_0x46d4('0x8'));var config=require(_0x46d4('0x9'));var jayson=require(_0x46d4('0xa'));var client=jayson['client'][_0x46d4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b740a,_0x39767c,_0x51a1bb){return new BPromise(function(_0x4e892f,_0x38c815){return client['request'](_0x3b740a,_0x51a1bb)[_0x46d4('0xc')](function(_0x5436bf){logger[_0x46d4('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x39767c,_0x46d4('0xe'));logger[_0x46d4('0xf')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x39767c,_0x46d4('0xe'),JSON[_0x46d4('0x10')](_0x5436bf));if(_0x5436bf[_0x46d4('0x11')]){if(_0x5436bf[_0x46d4('0x11')][_0x46d4('0x12')]===0x1f4){logger[_0x46d4('0x11')](_0x46d4('0x13'),_0x39767c,_0x5436bf[_0x46d4('0x11')]['message']);return _0x38c815(_0x5436bf['error'][_0x46d4('0x14')]);}logger['error'](_0x46d4('0x13'),_0x39767c,_0x5436bf[_0x46d4('0x11')]['message']);return _0x4e892f(_0x5436bf[_0x46d4('0x11')][_0x46d4('0x14')]);}else{logger[_0x46d4('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x39767c,_0x46d4('0xe'));_0x4e892f(_0x5436bf[_0x46d4('0x15')][_0x46d4('0x14')]);}})[_0x46d4('0x16')](function(_0x5bb83d){logger[_0x46d4('0x11')](_0x46d4('0x13'),_0x39767c,_0x5bb83d);_0x38c815(_0x5bb83d);});});} \ No newline at end of file +var _0x0455=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x0455,0x108));var _0x5045=function(_0xc850b5,_0x3362ce){_0xc850b5=_0xc850b5-0x0;var _0xdaa67e=_0x0455[_0xc850b5];return _0xdaa67e;};'use strict';var _=require(_0x5045('0x0'));var util=require(_0x5045('0x1'));var moment=require(_0x5045('0x2'));var BPromise=require(_0x5045('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5045('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5045('0x5'));var logger=require(_0x5045('0x6'))(_0x5045('0x7'));var config=require(_0x5045('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5045('0x9')][_0x5045('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40221a,_0x7e3dc8,_0x2ed8d4){return new BPromise(function(_0x2b35bf,_0x4d1f2f){return client['request'](_0x40221a,_0x2ed8d4)['then'](function(_0x27b6fe){logger['info'](_0x5045('0xb'),_0x7e3dc8,_0x5045('0xc'));logger[_0x5045('0xd')](_0x5045('0xe'),_0x7e3dc8,_0x5045('0xc'),JSON[_0x5045('0xf')](_0x27b6fe));if(_0x27b6fe[_0x5045('0x10')]){if(_0x27b6fe[_0x5045('0x10')][_0x5045('0x11')]===0x1f4){logger[_0x5045('0x10')](_0x5045('0xb'),_0x7e3dc8,_0x27b6fe['error'][_0x5045('0x12')]);return _0x4d1f2f(_0x27b6fe[_0x5045('0x10')][_0x5045('0x12')]);}logger[_0x5045('0x10')](_0x5045('0xb'),_0x7e3dc8,_0x27b6fe['error'][_0x5045('0x12')]);return _0x2b35bf(_0x27b6fe[_0x5045('0x10')][_0x5045('0x12')]);}else{logger[_0x5045('0x13')](_0x5045('0xb'),_0x7e3dc8,_0x5045('0xc'));_0x2b35bf(_0x27b6fe[_0x5045('0x14')][_0x5045('0x12')]);}})[_0x5045('0x15')](function(_0x5c2b77){logger[_0x5045('0x10')](_0x5045('0xb'),_0x7e3dc8,_0x5c2b77);_0x4d1f2f(_0x5c2b77);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 206c472..74c8b26 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 _0x9957=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0xd2e768,_0x3e76ec){var _0x292b87=function(_0x4578cb){while(--_0x4578cb){_0xd2e768['push'](_0xd2e768['shift']());}};_0x292b87(++_0x3e76ec);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./intZendeskField.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0xc')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0xd')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller[_0x7995('0xe')]);router[_0x7995('0xf')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['destroy']);module[_0x7995('0x10')]=router; \ No newline at end of file +var _0xa9e0=['/:id','update','delete','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated'];(function(_0x16493a,_0x59a0c5){var _0x3b8be5=function(_0x112d11){while(--_0x112d11){_0x16493a['push'](_0x16493a['shift']());}};_0x3b8be5(++_0x59a0c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['post']('/',auth[_0x0a9e('0x8')](),controller['create']);router['put'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xa')]);router[_0x0a9e('0xb')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 875f8cb..43908fb 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 _0x13f6=['variable','customVariable','keyValue','STRING','ENUM','sequelize','exports'];(function(_0x1b31a4,_0xaa8946){var _0x305b4a=function(_0x1895d2){while(--_0x1895d2){_0x1b31a4['push'](_0x1b31a4['shift']());}};_0x305b4a(++_0xaa8946);}(_0x13f6,0x124));var _0x613f=function(_0x478689,_0x31ba63){_0x478689=_0x478689-0x0;var _0xbf75cf=_0x13f6[_0x478689];return _0xbf75cf;};'use strict';var Sequelize=require(_0x613f('0x0'));module[_0x613f('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x613f('0x2'),_0x613f('0x3'),_0x613f('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x613f('0x5')]},'key':{'type':Sequelize[_0x613f('0x5')]},'keyType':{'type':Sequelize[_0x613f('0x6')]('string',_0x613f('0x2'),_0x613f('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x613f('0x5')]}}; \ No newline at end of file +var _0x0bb5=['string','STRING','ENUM','BOOLEAN','sequelize','exports','variable','customVariable','keyValue'];(function(_0x37a9d7,_0x2b6fde){var _0x1343d3=function(_0x3bde45){while(--_0x3bde45){_0x37a9d7['push'](_0x37a9d7['shift']());}};_0x1343d3(++_0x2b6fde);}(_0x0bb5,0x148));var _0x50bb=function(_0x5d86c8,_0x2440c4){_0x5d86c8=_0x5d86c8-0x0;var _0x1e3b2d=_0x0bb5[_0x5d86c8];return _0x1e3b2d;};'use strict';var Sequelize=require(_0x50bb('0x0'));module[_0x50bb('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x50bb('0x2'),_0x50bb('0x3'),_0x50bb('0x4')),'defaultValue':_0x50bb('0x5')},'content':{'type':Sequelize[_0x50bb('0x6')]},'key':{'type':Sequelize[_0x50bb('0x6')]},'keyType':{'type':Sequelize[_0x50bb('0x7')](_0x50bb('0x5'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x50bb('0x6')]},'idField':{'type':Sequelize[_0x50bb('0x6')]},'nameField':{'type':Sequelize[_0x50bb('0x6')]},'customField':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 32a3c4e..a665953 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 _0x0cdd=['limit','set','Content-Range','reject','update','destroy','error','stack','name','index','ZendeskField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','then','includeAll','rows','catch','show','params','create','body','find','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','../../components/auth/service','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset'];(function(_0x4a681a,_0x34ada9){var _0xe01680=function(_0x1f1483){while(--_0x1f1483){_0x4a681a['push'](_0x4a681a['shift']());}};_0xe01680(++_0x34ada9);}(_0x0cdd,0x184));var _0xd0cd=function(_0x3c460f,_0x1dcbed){_0x3c460f=_0x3c460f-0x0;var _0xb5842c=_0x0cdd[_0x3c460f];return _0xb5842c;};'use strict';var pdf=require(_0xd0cd('0x0'));var emlformat=require(_0xd0cd('0x1'));var rimraf=require(_0xd0cd('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd0cd('0x3'));var rp=require(_0xd0cd('0x4'));var moment=require(_0xd0cd('0x5'));var BPromise=require(_0xd0cd('0x6'));var Mustache=require(_0xd0cd('0x7'));var util=require(_0xd0cd('0x8'));var path=require(_0xd0cd('0x9'));var sox=require(_0xd0cd('0xa'));var csv=require(_0xd0cd('0xb'));var ejs=require(_0xd0cd('0xc'));var fs=require('fs');var _=require(_0xd0cd('0xd'));var squel=require(_0xd0cd('0xe'));var crypto=require('crypto');var jsforce=require(_0xd0cd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd0cd('0xb'));var querystring=require(_0xd0cd('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd0cd('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd0cd('0x12'));var utils=require('../../config/utils');var config=require(_0xd0cd('0x13'));var db=require(_0xd0cd('0x14'))['db'];function respondWithStatusCode(_0x5792b3,_0x5f0957){_0x5f0957=_0x5f0957||0xcc;return function(_0x29afe8){if(_0x29afe8){return _0x5792b3[_0xd0cd('0x15')](_0x5f0957);}return _0x5792b3['status'](_0x5f0957)['end']();};}function respondWithResult(_0x27f604,_0x3b7601){_0x3b7601=_0x3b7601||0xc8;return function(_0x161a51){if(_0x161a51){return _0x27f604[_0xd0cd('0x16')](_0x3b7601)[_0xd0cd('0x17')](_0x161a51);}};}function respondWithFilteredResult(_0x261939,_0x7e2231){return function(_0x15f086){if(_0x15f086){var _0x54c9ba=_0x15f086[_0xd0cd('0x18')],_0x3371e5=_0x7e2231[_0xd0cd('0x19')],_0x297cab=_0x7e2231[_0xd0cd('0x19')]+_0x7e2231[_0xd0cd('0x1a')],_0x4edc17;if(_0x297cab>=_0x54c9ba){_0x297cab=_0x54c9ba;_0x4edc17=0xc8;}else{_0x4edc17=0xce;}_0x261939[_0xd0cd('0x16')](_0x4edc17);return _0x261939[_0xd0cd('0x1b')](_0xd0cd('0x1c'),_0x3371e5+'-'+_0x297cab+'/'+_0x54c9ba)[_0xd0cd('0x17')](_0x15f086);}return null;};}function patchUpdates(_0x2b428a){return function(_0x2a7fcb){try{jsonpatch['apply'](_0x2a7fcb,_0x2b428a,!![]);}catch(_0x1f39e7){return BPromise[_0xd0cd('0x1d')](_0x1f39e7);}return _0x2a7fcb['save']();};}function saveUpdates(_0x49fd48,_0x3caeb4){return function(_0x40c447){if(_0x40c447){return _0x40c447[_0xd0cd('0x1e')](_0x49fd48)['then'](function(_0x1551d8){return _0x1551d8;});}return null;};}function removeEntity(_0x4de3b6,_0xfaed90){return function(_0x294b1f){if(_0x294b1f){return _0x294b1f[_0xd0cd('0x1f')]()['then'](function(){_0x4de3b6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x398e0d,_0x217603){return function(_0x1897e0){if(!_0x1897e0){_0x398e0d['sendStatus'](0x194);}return _0x1897e0;};}function handleError(_0xe43b2e,_0x35f84f){_0x35f84f=_0x35f84f||0x1f4;return function(_0x4dc0a5){logger[_0xd0cd('0x20')](_0x4dc0a5[_0xd0cd('0x21')]);if(_0x4dc0a5[_0xd0cd('0x22')]){delete _0x4dc0a5[_0xd0cd('0x22')];}_0xe43b2e[_0xd0cd('0x16')](_0x35f84f)['send'](_0x4dc0a5);};}exports[_0xd0cd('0x23')]=function(_0x5caf9b,_0x39194a){var _0x474303={},_0x18505c={},_0x40258e={'count':0x0,'rows':[]};var _0x2b94d7=db[_0xd0cd('0x24')][_0xd0cd('0x25')];_0x18505c[_0xd0cd('0x26')]=_[_0xd0cd('0x27')](_0x2b94d7);_0x18505c[_0xd0cd('0x28')]=_[_0xd0cd('0x27')](_0x5caf9b[_0xd0cd('0x28')]);_0x18505c[_0xd0cd('0x29')]=_[_0xd0cd('0x2a')](_0x18505c[_0xd0cd('0x26')],_0x18505c['query']);_0x474303[_0xd0cd('0x2b')]=_[_0xd0cd('0x2a')](_0x18505c[_0xd0cd('0x26')],qs[_0xd0cd('0x2c')](_0x5caf9b[_0xd0cd('0x28')][_0xd0cd('0x2c')]));_0x474303[_0xd0cd('0x2b')]=_0x474303[_0xd0cd('0x2b')][_0xd0cd('0x2d')]?_0x474303[_0xd0cd('0x2b')]:_0x18505c[_0xd0cd('0x26')];if(!_0x5caf9b[_0xd0cd('0x28')][_0xd0cd('0x2e')](_0xd0cd('0x2f'))){_0x474303[_0xd0cd('0x1a')]=qs[_0xd0cd('0x1a')](_0x5caf9b['query'][_0xd0cd('0x1a')]);_0x474303[_0xd0cd('0x19')]=qs[_0xd0cd('0x19')](_0x5caf9b['query'][_0xd0cd('0x19')]);}_0x474303[_0xd0cd('0x30')]=qs[_0xd0cd('0x31')](_0x5caf9b[_0xd0cd('0x28')][_0xd0cd('0x31')]);_0x474303['where']=qs[_0xd0cd('0x29')](_[_0xd0cd('0x32')](_0x5caf9b[_0xd0cd('0x28')],_0x18505c[_0xd0cd('0x29')]));if(_0x5caf9b[_0xd0cd('0x28')][_0xd0cd('0x33')]){_0x474303[_0xd0cd('0x34')]=_[_0xd0cd('0x35')](_0x474303[_0xd0cd('0x34')],{'$or':_[_0xd0cd('0x36')](_0x2b94d7,function(_0x270007){if(_0x270007[_0xd0cd('0x37')][_0xd0cd('0x38')]!==_0xd0cd('0x39')){var _0x4c20ea={};_0x4c20ea[_0x270007[_0xd0cd('0x3a')]]={'$like':'%'+_0x5caf9b['query'][_0xd0cd('0x33')]+'%'};return _0x4c20ea;}})});}_0x474303=_['merge']({},_0x474303,_0x5caf9b[_0xd0cd('0x3b')]);var _0x140990={'where':_0x474303[_0xd0cd('0x34')]};return db[_0xd0cd('0x24')][_0xd0cd('0x18')](_0x140990)[_0xd0cd('0x3c')](function(_0x25fce9){_0x40258e[_0xd0cd('0x18')]=_0x25fce9;if(_0x5caf9b[_0xd0cd('0x28')][_0xd0cd('0x3d')]){_0x474303['include']=[{'all':!![]}];}return db[_0xd0cd('0x24')]['findAll'](_0x474303);})[_0xd0cd('0x3c')](function(_0x17454b){_0x40258e[_0xd0cd('0x3e')]=_0x17454b;return _0x40258e;})[_0xd0cd('0x3c')](respondWithFilteredResult(_0x39194a,_0x474303))[_0xd0cd('0x3f')](handleError(_0x39194a,null));};exports[_0xd0cd('0x40')]=function(_0x4d42d7,_0x81b28e){var _0x480d2c={'raw':!![],'where':{'id':_0x4d42d7[_0xd0cd('0x41')]['id']}},_0x1d9d23={};_0x1d9d23['model']=_[_0xd0cd('0x27')](db[_0xd0cd('0x24')][_0xd0cd('0x25')]);_0x1d9d23['query']=_[_0xd0cd('0x27')](_0x4d42d7[_0xd0cd('0x28')]);_0x1d9d23['filters']=_[_0xd0cd('0x2a')](_0x1d9d23[_0xd0cd('0x26')],_0x1d9d23[_0xd0cd('0x28')]);_0x480d2c[_0xd0cd('0x2b')]=_['intersection'](_0x1d9d23['model'],qs[_0xd0cd('0x2c')](_0x4d42d7[_0xd0cd('0x28')][_0xd0cd('0x2c')]));_0x480d2c[_0xd0cd('0x2b')]=_0x480d2c[_0xd0cd('0x2b')][_0xd0cd('0x2d')]?_0x480d2c[_0xd0cd('0x2b')]:_0x1d9d23[_0xd0cd('0x26')];if(_0x4d42d7[_0xd0cd('0x28')][_0xd0cd('0x3d')]){_0x480d2c['include']=[{'all':!![]}];}_0x480d2c=_['merge']({},_0x480d2c,_0x4d42d7['options']);return db[_0xd0cd('0x24')]['find'](_0x480d2c)[_0xd0cd('0x3c')](handleEntityNotFound(_0x81b28e,null))[_0xd0cd('0x3c')](respondWithResult(_0x81b28e,null))['catch'](handleError(_0x81b28e,null));};exports[_0xd0cd('0x42')]=function(_0x4fff26,_0x72c533){return db['ZendeskField'][_0xd0cd('0x42')](_0x4fff26[_0xd0cd('0x43')],{})[_0xd0cd('0x3c')](respondWithResult(_0x72c533,0xc9))['catch'](handleError(_0x72c533,null));};exports['update']=function(_0x145217,_0x374587){if(_0x145217[_0xd0cd('0x43')]['id']){delete _0x145217[_0xd0cd('0x43')]['id'];}return db[_0xd0cd('0x24')][_0xd0cd('0x44')]({'where':{'id':_0x145217[_0xd0cd('0x41')]['id']}})['then'](handleEntityNotFound(_0x374587,null))[_0xd0cd('0x3c')](saveUpdates(_0x145217['body'],null))[_0xd0cd('0x3c')](respondWithResult(_0x374587,null))['catch'](handleError(_0x374587,null));};exports[_0xd0cd('0x1f')]=function(_0x43a2f1,_0x55f8af){return db[_0xd0cd('0x24')]['find']({'where':{'id':_0x43a2f1[_0xd0cd('0x41')]['id']}})[_0xd0cd('0x3c')](handleEntityNotFound(_0x55f8af,null))[_0xd0cd('0x3c')](removeEntity(_0x55f8af,null))[_0xd0cd('0x3f')](handleError(_0x55f8af,null));}; \ No newline at end of file +var _0xa57e=['model','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','catch','show','params','fields','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','name','send','ZendeskField','rawAttributes'];(function(_0x56a272,_0x2fd680){var _0x2a7704=function(_0x39b201){while(--_0x39b201){_0x56a272['push'](_0x56a272['shift']());}};_0x2a7704(++_0x2fd680);}(_0xa57e,0x67));var _0xea57=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa57e[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0xea57('0x0'));var emlformat=require(_0xea57('0x1'));var rimraf=require(_0xea57('0x2'));var zipdir=require(_0xea57('0x3'));var jsonpatch=require(_0xea57('0x4'));var rp=require(_0xea57('0x5'));var moment=require(_0xea57('0x6'));var BPromise=require(_0xea57('0x7'));var Mustache=require(_0xea57('0x8'));var util=require(_0xea57('0x9'));var path=require(_0xea57('0xa'));var sox=require(_0xea57('0xb'));var csv=require(_0xea57('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xea57('0xd'));var squel=require(_0xea57('0xe'));var crypto=require(_0xea57('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xea57('0x10'));var toCsv=require(_0xea57('0xc'));var querystring=require(_0xea57('0x11'));var Papa=require('papaparse');var Redis=require(_0xea57('0x12'));var authService=require(_0xea57('0x13'));var qs=require(_0xea57('0x14'));var hardwareService=require(_0xea57('0x15'));var logger=require(_0xea57('0x16'))(_0xea57('0x17'));var utils=require(_0xea57('0x18'));var config=require(_0xea57('0x19'));var db=require(_0xea57('0x1a'))['db'];function respondWithStatusCode(_0x2f6958,_0x5654c7){_0x5654c7=_0x5654c7||0xcc;return function(_0x1c9a7d){if(_0x1c9a7d){return _0x2f6958[_0xea57('0x1b')](_0x5654c7);}return _0x2f6958[_0xea57('0x1c')](_0x5654c7)[_0xea57('0x1d')]();};}function respondWithResult(_0x23a095,_0x3435da){_0x3435da=_0x3435da||0xc8;return function(_0x43a975){if(_0x43a975){return _0x23a095['status'](_0x3435da)[_0xea57('0x1e')](_0x43a975);}};}function respondWithFilteredResult(_0x5eeb7c,_0x4a8731){return function(_0x19936a){if(_0x19936a){var _0x1cc12b=_0x19936a[_0xea57('0x1f')],_0x3a34f7=_0x4a8731[_0xea57('0x20')],_0x30fefa=_0x4a8731[_0xea57('0x20')]+_0x4a8731[_0xea57('0x21')],_0x1268fa;if(_0x30fefa>=_0x1cc12b){_0x30fefa=_0x1cc12b;_0x1268fa=0xc8;}else{_0x1268fa=0xce;}_0x5eeb7c[_0xea57('0x1c')](_0x1268fa);return _0x5eeb7c[_0xea57('0x22')](_0xea57('0x23'),_0x3a34f7+'-'+_0x30fefa+'/'+_0x1cc12b)[_0xea57('0x1e')](_0x19936a);}return null;};}function patchUpdates(_0x5bd1c5){return function(_0xf87039){try{jsonpatch[_0xea57('0x24')](_0xf87039,_0x5bd1c5,!![]);}catch(_0x3abd95){return BPromise['reject'](_0x3abd95);}return _0xf87039['save']();};}function saveUpdates(_0x1514b7,_0x1dad68){return function(_0x22e743){if(_0x22e743){return _0x22e743[_0xea57('0x25')](_0x1514b7)[_0xea57('0x26')](function(_0x3a6051){return _0x3a6051;});}return null;};}function removeEntity(_0xf4ab28,_0x142219){return function(_0x48f5db){if(_0x48f5db){return _0x48f5db[_0xea57('0x27')]()[_0xea57('0x26')](function(){_0xf4ab28[_0xea57('0x1c')](0xcc)[_0xea57('0x1d')]();});}};}function handleEntityNotFound(_0x2bad6d,_0x5e534b){return function(_0x3e724f){if(!_0x3e724f){_0x2bad6d['sendStatus'](0x194);}return _0x3e724f;};}function handleError(_0x1a5551,_0x287d7e){_0x287d7e=_0x287d7e||0x1f4;return function(_0x314ff7){logger[_0xea57('0x28')](_0x314ff7['stack']);if(_0x314ff7['name']){delete _0x314ff7[_0xea57('0x29')];}_0x1a5551[_0xea57('0x1c')](_0x287d7e)[_0xea57('0x2a')](_0x314ff7);};}exports['index']=function(_0x2c7fa2,_0xce5a5d){var _0x52a23f={},_0x2a7446={},_0x58bbcf={'count':0x0,'rows':[]};var _0x1c01df=db[_0xea57('0x2b')][_0xea57('0x2c')];_0x2a7446[_0xea57('0x2d')]=_[_0xea57('0x2e')](_0x1c01df);_0x2a7446['query']=_[_0xea57('0x2e')](_0x2c7fa2[_0xea57('0x2f')]);_0x2a7446[_0xea57('0x30')]=_[_0xea57('0x31')](_0x2a7446[_0xea57('0x2d')],_0x2a7446['query']);_0x52a23f[_0xea57('0x32')]=_[_0xea57('0x31')](_0x2a7446['model'],qs['fields'](_0x2c7fa2[_0xea57('0x2f')]['fields']));_0x52a23f[_0xea57('0x32')]=_0x52a23f['attributes'][_0xea57('0x33')]?_0x52a23f['attributes']:_0x2a7446['model'];if(!_0x2c7fa2['query'][_0xea57('0x34')]('nolimit')){_0x52a23f[_0xea57('0x21')]=qs['limit'](_0x2c7fa2['query']['limit']);_0x52a23f['offset']=qs[_0xea57('0x20')](_0x2c7fa2[_0xea57('0x2f')]['offset']);}_0x52a23f[_0xea57('0x35')]=qs[_0xea57('0x36')](_0x2c7fa2[_0xea57('0x2f')][_0xea57('0x36')]);_0x52a23f[_0xea57('0x37')]=qs[_0xea57('0x30')](_['pick'](_0x2c7fa2[_0xea57('0x2f')],_0x2a7446['filters']));if(_0x2c7fa2[_0xea57('0x2f')]['filter']){_0x52a23f[_0xea57('0x37')]=_[_0xea57('0x38')](_0x52a23f['where'],{'$or':_[_0xea57('0x39')](_0x1c01df,function(_0x338e95){if(_0x338e95[_0xea57('0x3a')][_0xea57('0x3b')]!==_0xea57('0x3c')){var _0x5a25d5={};_0x5a25d5[_0x338e95[_0xea57('0x3d')]]={'$like':'%'+_0x2c7fa2[_0xea57('0x2f')][_0xea57('0x3e')]+'%'};return _0x5a25d5;}})});}_0x52a23f=_[_0xea57('0x38')]({},_0x52a23f,_0x2c7fa2[_0xea57('0x3f')]);var _0x41b049={'where':_0x52a23f[_0xea57('0x37')]};return db['ZendeskField'][_0xea57('0x1f')](_0x41b049)[_0xea57('0x26')](function(_0x45b198){_0x58bbcf[_0xea57('0x1f')]=_0x45b198;if(_0x2c7fa2[_0xea57('0x2f')][_0xea57('0x40')]){_0x52a23f[_0xea57('0x41')]=[{'all':!![]}];}return db['ZendeskField'][_0xea57('0x42')](_0x52a23f);})[_0xea57('0x26')](function(_0x2e53b8){_0x58bbcf['rows']=_0x2e53b8;return _0x58bbcf;})[_0xea57('0x26')](respondWithFilteredResult(_0xce5a5d,_0x52a23f))[_0xea57('0x43')](handleError(_0xce5a5d,null));};exports[_0xea57('0x44')]=function(_0x18e028,_0xdcfebb){var _0x1cea26={'raw':!![],'where':{'id':_0x18e028[_0xea57('0x45')]['id']}},_0x45684a={};_0x45684a[_0xea57('0x2d')]=_['keys'](db[_0xea57('0x2b')][_0xea57('0x2c')]);_0x45684a[_0xea57('0x2f')]=_[_0xea57('0x2e')](_0x18e028['query']);_0x45684a['filters']=_['intersection'](_0x45684a[_0xea57('0x2d')],_0x45684a[_0xea57('0x2f')]);_0x1cea26['attributes']=_[_0xea57('0x31')](_0x45684a[_0xea57('0x2d')],qs[_0xea57('0x46')](_0x18e028[_0xea57('0x2f')][_0xea57('0x46')]));_0x1cea26[_0xea57('0x32')]=_0x1cea26[_0xea57('0x32')]['length']?_0x1cea26['attributes']:_0x45684a[_0xea57('0x2d')];if(_0x18e028[_0xea57('0x2f')]['includeAll']){_0x1cea26['include']=[{'all':!![]}];}_0x1cea26=_[_0xea57('0x38')]({},_0x1cea26,_0x18e028[_0xea57('0x3f')]);return db[_0xea57('0x2b')][_0xea57('0x47')](_0x1cea26)[_0xea57('0x26')](handleEntityNotFound(_0xdcfebb,null))[_0xea57('0x26')](respondWithResult(_0xdcfebb,null))[_0xea57('0x43')](handleError(_0xdcfebb,null));};exports['create']=function(_0x4557a1,_0x3b6032){return db[_0xea57('0x2b')][_0xea57('0x48')](_0x4557a1[_0xea57('0x49')],{})[_0xea57('0x26')](respondWithResult(_0x3b6032,0xc9))[_0xea57('0x43')](handleError(_0x3b6032,null));};exports[_0xea57('0x25')]=function(_0x53f7d6,_0x58ac73){if(_0x53f7d6[_0xea57('0x49')]['id']){delete _0x53f7d6[_0xea57('0x49')]['id'];}return db[_0xea57('0x2b')]['find']({'where':{'id':_0x53f7d6['params']['id']}})[_0xea57('0x26')](handleEntityNotFound(_0x58ac73,null))[_0xea57('0x26')](saveUpdates(_0x53f7d6['body'],null))[_0xea57('0x26')](respondWithResult(_0x58ac73,null))[_0xea57('0x43')](handleError(_0x58ac73,null));};exports[_0xea57('0x27')]=function(_0xa04989,_0x44c044){return db[_0xea57('0x2b')][_0xea57('0x47')]({'where':{'id':_0xa04989[_0xea57('0x45')]['id']}})['then'](handleEntityNotFound(_0x44c044,null))[_0xea57('0x26')](removeEntity(_0x44c044,null))['catch'](handleError(_0x44c044,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 7b2a905..93f1a06 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 _0xeba2=['rimraf','../../config/environment','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2e70ef,_0x30d7e7){var _0x39e77e=function(_0x2f60e1){while(--_0x2f60e1){_0x2e70ef['push'](_0x2e70ef['shift']());}};_0x39e77e(++_0x30d7e7);}(_0xeba2,0x19d));var _0x2eba=function(_0x1dac7a,_0x1828ce){_0x1dac7a=_0x1dac7a-0x0;var _0x4cb363=_0xeba2[_0x1dac7a];return _0x4cb363;};'use strict';var _=require(_0x2eba('0x0'));var util=require(_0x2eba('0x1'));var logger=require(_0x2eba('0x2'))(_0x2eba('0x3'));var moment=require(_0x2eba('0x4'));var BPromise=require(_0x2eba('0x5'));var rp=require(_0x2eba('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2eba('0x7'));var config=require(_0x2eba('0x8'));var attributes=require('./intZendeskField.attributes');module[_0x2eba('0x9')]=function(_0x561e0f,_0xf92027){return _0x561e0f[_0x2eba('0xa')](_0x2eba('0xb'),attributes,{'tableName':_0x2eba('0xc'),'paranoid':![],'indexes':[{'name':_0x2eba('0xd'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb603=['FieldId','lodash','../../config/logger','bluebird','request-promise','rimraf','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index'];(function(_0x89be60,_0x20f601){var _0x5e4784=function(_0x2d8815){while(--_0x2d8815){_0x89be60['push'](_0x89be60['shift']());}};_0x5e4784(++_0x20f601);}(_0xb603,0x145));var _0x3b60=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xb603[_0x35885a];return _0xe86249;};'use strict';var _=require(_0x3b60('0x0'));var util=require('util');var logger=require(_0x3b60('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3b60('0x2'));var rp=require(_0x3b60('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b60('0x4'));var config=require('../../config/environment');var attributes=require(_0x3b60('0x5'));module[_0x3b60('0x6')]=function(_0x5c4ae7,_0x558f1c){return _0x5c4ae7[_0x3b60('0x7')](_0x3b60('0x8'),attributes,{'tableName':_0x3b60('0x9'),'paranoid':![],'indexes':[{'name':_0x3b60('0xa'),'fields':['idField',_0x3b60('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index ea1d24f..f4386fb 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 _0x6582=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6582,0x108));var _0x2658=function(_0x13bea0,_0x210a0c){_0x13bea0=_0x13bea0-0x0;var _0x3f12df=_0x6582[_0x13bea0];return _0x3f12df;};'use strict';var _=require(_0x2658('0x0'));var util=require(_0x2658('0x1'));var moment=require(_0x2658('0x2'));var BPromise=require(_0x2658('0x3'));var rs=require(_0x2658('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2658('0x5'))['db'];var utils=require(_0x2658('0x6'));var logger=require(_0x2658('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2658('0x8')][_0x2658('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cb94f,_0x3f53e7,_0x443df){return new BPromise(function(_0x412a9f,_0x52ef38){return client[_0x2658('0xa')](_0x2cb94f,_0x443df)[_0x2658('0xb')](function(_0x426744){logger[_0x2658('0xc')](_0x2658('0xd'),_0x3f53e7,_0x2658('0xe'));logger[_0x2658('0xf')](_0x2658('0x10'),_0x3f53e7,_0x2658('0xe'),JSON['stringify'](_0x426744));if(_0x426744[_0x2658('0x11')]){if(_0x426744['error'][_0x2658('0x12')]===0x1f4){logger[_0x2658('0x11')](_0x2658('0xd'),_0x3f53e7,_0x426744[_0x2658('0x11')][_0x2658('0x13')]);return _0x52ef38(_0x426744[_0x2658('0x11')][_0x2658('0x13')]);}logger['error'](_0x2658('0xd'),_0x3f53e7,_0x426744[_0x2658('0x11')][_0x2658('0x13')]);return _0x412a9f(_0x426744[_0x2658('0x11')][_0x2658('0x13')]);}else{logger['info'](_0x2658('0xd'),_0x3f53e7,_0x2658('0xe'));_0x412a9f(_0x426744[_0x2658('0x14')]['message']);}})[_0x2658('0x15')](function(_0x44c6d2){logger[_0x2658('0x11')](_0x2658('0xd'),_0x3f53e7,_0x44c6d2);_0x52ef38(_0x44c6d2);});});} \ No newline at end of file +var _0xb248=['lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x34fa8d,_0x305b7c){var _0x42aced=function(_0x2971d2){while(--_0x2971d2){_0x34fa8d['push'](_0x34fa8d['shift']());}};_0x42aced(++_0x305b7c);}(_0xb248,0xc6));var _0x8b24=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xb248[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0x8b24('0x0'));var util=require('util');var moment=require(_0x8b24('0x1'));var BPromise=require(_0x8b24('0x2'));var rs=require(_0x8b24('0x3'));var fs=require('fs');var Redis=require(_0x8b24('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8b24('0x5'));var logger=require(_0x8b24('0x6'))('rpc');var config=require(_0x8b24('0x7'));var jayson=require(_0x8b24('0x8'));var client=jayson['client'][_0x8b24('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4705e0,_0x588ca8,_0x3198a2){return new BPromise(function(_0x51bbad,_0x43b851){return client[_0x8b24('0xa')](_0x4705e0,_0x3198a2)[_0x8b24('0xb')](function(_0x4ad0db){logger[_0x8b24('0xc')](_0x8b24('0xd'),_0x588ca8,_0x8b24('0xe'));logger[_0x8b24('0xf')](_0x8b24('0x10'),_0x588ca8,_0x8b24('0xe'),JSON[_0x8b24('0x11')](_0x4ad0db));if(_0x4ad0db[_0x8b24('0x12')]){if(_0x4ad0db[_0x8b24('0x12')][_0x8b24('0x13')]===0x1f4){logger[_0x8b24('0x12')](_0x8b24('0xd'),_0x588ca8,_0x4ad0db[_0x8b24('0x12')][_0x8b24('0x14')]);return _0x43b851(_0x4ad0db['error']['message']);}logger[_0x8b24('0x12')](_0x8b24('0xd'),_0x588ca8,_0x4ad0db[_0x8b24('0x12')][_0x8b24('0x14')]);return _0x51bbad(_0x4ad0db[_0x8b24('0x12')][_0x8b24('0x14')]);}else{logger[_0x8b24('0xc')](_0x8b24('0xd'),_0x588ca8,'request\x20sent');_0x51bbad(_0x4ad0db['result']['message']);}})[_0x8b24('0x15')](function(_0x523863){logger['error'](_0x8b24('0xd'),_0x588ca8,_0x523863);_0x43b851(_0x523863);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 3595c97..01fe4ac 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 _0x4d8b=['/:id','show','/:id/configurations','getConfigurations','post','create','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated'];(function(_0x7ec790,_0x45113d){var _0x50e134=function(_0x4a919c){while(--_0x4a919c){_0x7ec790['push'](_0x7ec790['shift']());}};_0x50e134(++_0x45113d);}(_0x4d8b,0x12a));var _0xb4d8=function(_0x512490,_0x474d3d){_0x512490=_0x512490-0x0;var _0x4cf8e4=_0x4d8b[_0x512490];return _0x4cf8e4;};'use strict';var multer=require(_0xb4d8('0x0'));var util=require('util');var path=require(_0xb4d8('0x1'));var timeout=require(_0xb4d8('0x2'));var express=require(_0xb4d8('0x3'));var router=express[_0xb4d8('0x4')]();var auth=require(_0xb4d8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb4d8('0x6'));var controller=require(_0xb4d8('0x7'));router[_0xb4d8('0x8')]('/',auth[_0xb4d8('0x9')](),controller['index']);router[_0xb4d8('0x8')](_0xb4d8('0xa'),auth[_0xb4d8('0x9')](),controller[_0xb4d8('0xb')]);router[_0xb4d8('0x8')](_0xb4d8('0xc'),auth[_0xb4d8('0x9')](),controller[_0xb4d8('0xd')]);router['get']('/:id/fields',auth[_0xb4d8('0x9')](),controller['getFields']);router[_0xb4d8('0xe')]('/',auth[_0xb4d8('0x9')](),controller[_0xb4d8('0xf')]);router[_0xb4d8('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xb4d8('0x10')]);router[_0xb4d8('0x11')](_0xb4d8('0xa'),auth[_0xb4d8('0x9')](),controller[_0xb4d8('0x12')]);router[_0xb4d8('0x13')]('/:id',auth[_0xb4d8('0x9')](),controller[_0xb4d8('0x14')]);module[_0xb4d8('0x15')]=router; \ No newline at end of file +var _0x3d23=['exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','update','delete','destroy'];(function(_0x1c2087,_0x2476c5){var _0x28a907=function(_0x39479c){while(--_0x39479c){_0x1c2087['push'](_0x1c2087['shift']());}};_0x28a907(++_0x2476c5);}(_0x3d23,0xfe));var _0x33d2=function(_0x294b6,_0x2907ae){_0x294b6=_0x294b6-0x0;var _0x38bb97=_0x3d23[_0x294b6];return _0x38bb97;};'use strict';var multer=require(_0x33d2('0x0'));var util=require('util');var path=require(_0x33d2('0x1'));var timeout=require(_0x33d2('0x2'));var express=require(_0x33d2('0x3'));var router=express['Router']();var auth=require(_0x33d2('0x4'));var interaction=require(_0x33d2('0x5'));var config=require(_0x33d2('0x6'));var controller=require(_0x33d2('0x7'));router['get']('/',auth[_0x33d2('0x8')](),controller[_0x33d2('0x9')]);router[_0x33d2('0xa')](_0x33d2('0xb'),auth[_0x33d2('0x8')](),controller[_0x33d2('0xc')]);router[_0x33d2('0xa')](_0x33d2('0xd'),auth[_0x33d2('0x8')](),controller[_0x33d2('0xe')]);router[_0x33d2('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x33d2('0xf')]);router[_0x33d2('0x10')]('/',auth['isAuthenticated'](),controller[_0x33d2('0x11')]);router[_0x33d2('0x10')](_0x33d2('0xd'),auth[_0x33d2('0x8')](),controller[_0x33d2('0x12')]);router['put'](_0x33d2('0xb'),auth[_0x33d2('0x8')](),controller[_0x33d2('0x13')]);router[_0x33d2('0x14')]('/:id',auth[_0x33d2('0x8')](),controller[_0x33d2('0x15')]);module[_0x33d2('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 67ed261..34bed2a 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 _0xc24f=['sequelize','exports','STRING'];(function(_0x13ce7d,_0x1a1aa9){var _0x592aea=function(_0x51daf3){while(--_0x51daf3){_0x13ce7d['push'](_0x13ce7d['shift']());}};_0x592aea(++_0x1a1aa9);}(_0xc24f,0x81));var _0xfc24=function(_0x1a9d7f,_0x1442f6){_0x1a9d7f=_0x1a9d7f-0x0;var _0xd20d0a=_0xc24f[_0x1a9d7f];return _0xd20d0a;};'use strict';var Sequelize=require(_0xfc24('0x0'));module[_0xfc24('0x1')]={'name':{'type':Sequelize[_0xfc24('0x2')]},'description':{'type':Sequelize[_0xfc24('0x2')]},'host':{'type':Sequelize[_0xfc24('0x2')]},'zone':{'type':Sequelize[_0xfc24('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xfc24('0x2')]},'code':{'type':Sequelize[_0xfc24('0x2')]},'refreshToken':{'type':Sequelize[_0xfc24('0x2')]}}; \ No newline at end of file +var _0x225d=['STRING','sequelize','exports'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x225d,0x12a));var _0xd225=function(_0x2836ae,_0x216a8d){_0x2836ae=_0x2836ae-0x0;var _0x30c0ba=_0x225d[_0x2836ae];return _0x30c0ba;};'use strict';var Sequelize=require(_0xd225('0x0'));module[_0xd225('0x1')]={'name':{'type':Sequelize[_0xd225('0x2')]},'description':{'type':Sequelize[_0xd225('0x2')]},'host':{'type':Sequelize[_0xd225('0x2')]},'zone':{'type':Sequelize[_0xd225('0x2')]},'clientId':{'type':Sequelize[_0xd225('0x2')]},'clientSecret':{'type':Sequelize[_0xd225('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'code':{'type':Sequelize[_0xd225('0x2')]},'refreshToken':{'type':Sequelize[_0xd225('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index f88c9a3..9ff5a28 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 _0xf1c6=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','test','then','info','request\x20sent','debug','stringify','error','ZohoAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','destroy','stack','name','send','index','ZohoAccount','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','map','type','key','VIRTUAL','field','includeAll','findAll','rows','show','include','options','create','body','find','params','getConfigurations','findOne','ZohoConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZohoField','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','zone','serverUrl','host','zoho.eu','com','slice','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','Owner','Description','Call_Result','Call_Start_Time','Call_Type','remove','includes','system_mandatory','push','display_label','data_type','picklist','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x71f738,_0xa7190){var _0x345744=function(_0x28b6bd){while(--_0x28b6bd){_0x71f738['push'](_0x71f738['shift']());}};_0x345744(++_0xa7190);}(_0xf1c6,0xf4));var _0x6f1c=function(_0x59ae89,_0x36772f){_0x59ae89=_0x59ae89-0x0;var _0x1ba3b8=_0xf1c6[_0x59ae89];return _0x1ba3b8;};'use strict';var pdf=require(_0x6f1c('0x0'));var emlformat=require(_0x6f1c('0x1'));var rimraf=require(_0x6f1c('0x2'));var zipdir=require(_0x6f1c('0x3'));var jsonpatch=require(_0x6f1c('0x4'));var rp=require(_0x6f1c('0x5'));var moment=require(_0x6f1c('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x6f1c('0x7'));var util=require(_0x6f1c('0x8'));var path=require(_0x6f1c('0x9'));var sox=require(_0x6f1c('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6f1c('0xb'));var squel=require(_0x6f1c('0xc'));var crypto=require(_0x6f1c('0xd'));var jsforce=require(_0x6f1c('0xe'));var deskjs=require(_0x6f1c('0xf'));var toCsv=require(_0x6f1c('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6f1c('0x11'));var authService=require(_0x6f1c('0x12'));var qs=require(_0x6f1c('0x13'));var hardwareService=require(_0x6f1c('0x14'));var logger=require(_0x6f1c('0x15'))(_0x6f1c('0x16'));var utils=require('../../config/utils');var config=require(_0x6f1c('0x17'));var db=require(_0x6f1c('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x6f1c('0x19'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x380d6,_0x2d5956,_0x52d50f){if(_0x52d50f){var _0x523066=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x523066[_0x6f1c('0x1a')](_0x2d5956)){return _0x380d6;}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 _0x380d6;}}function respondWithRpcPromise(_0x206ed5,_0xb36b41,_0x14c412,_0x28d9ca){return new BPromise(function(_0xa3cc6e,_0x229e31){var _0xbac2ee=_0x28d9ca||client;return _0xbac2ee['request'](_0x206ed5,_0x14c412)[_0x6f1c('0x1b')](function(_0x554c42){logger[_0x6f1c('0x1c')]('ZohoAccount,\x20%s,\x20%s',_0xb36b41,_0x6f1c('0x1d'));logger[_0x6f1c('0x1e')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0xb36b41,'request\x20sent',JSON[_0x6f1c('0x1f')](_0x554c42));if(_0x554c42[_0x6f1c('0x20')]){if(_0x554c42[_0x6f1c('0x20')]['code']===0x1f4){logger[_0x6f1c('0x20')](_0x6f1c('0x21'),_0xb36b41,_0x554c42[_0x6f1c('0x20')]['message']);return _0x229e31(_0x554c42[_0x6f1c('0x20')][_0x6f1c('0x22')]);}logger[_0x6f1c('0x20')]('ZohoAccount,\x20%s,\x20%s',_0xb36b41,_0x554c42[_0x6f1c('0x20')][_0x6f1c('0x22')]);return _0xa3cc6e(_0x554c42['error'][_0x6f1c('0x22')]);}else{logger[_0x6f1c('0x1c')](_0x6f1c('0x21'),_0xb36b41,_0x6f1c('0x1d'));_0xa3cc6e(_0x554c42['result'][_0x6f1c('0x22')]);}})[_0x6f1c('0x23')](function(_0x235773){logger[_0x6f1c('0x20')](_0x6f1c('0x21'),_0xb36b41,_0x235773);_0x229e31(_0x235773);});});}function respondWithStatusCode(_0x21fdd4,_0x4970bd){_0x4970bd=_0x4970bd||0xcc;return function(_0x1ac41){if(_0x1ac41){return _0x21fdd4[_0x6f1c('0x24')](_0x4970bd);}return _0x21fdd4[_0x6f1c('0x25')](_0x4970bd)[_0x6f1c('0x26')]();};}function respondWithResult(_0xe441e0,_0x4fd4a2){_0x4fd4a2=_0x4fd4a2||0xc8;return function(_0x2c6da4){if(_0x2c6da4){return _0xe441e0[_0x6f1c('0x25')](_0x4fd4a2)[_0x6f1c('0x27')](_0x2c6da4);}};}function respondWithFilteredResult(_0x1faa4a,_0x31e829){return function(_0x145ae9){if(_0x145ae9){var _0x4d120d=_0x145ae9[_0x6f1c('0x28')],_0x492912=_0x31e829['offset'],_0x30ba57=_0x31e829[_0x6f1c('0x29')]+_0x31e829[_0x6f1c('0x2a')],_0x2b3732;if(_0x30ba57>=_0x4d120d){_0x30ba57=_0x4d120d;_0x2b3732=0xc8;}else{_0x2b3732=0xce;}_0x1faa4a[_0x6f1c('0x25')](_0x2b3732);return _0x1faa4a[_0x6f1c('0x2b')]('Content-Range',_0x492912+'-'+_0x30ba57+'/'+_0x4d120d)[_0x6f1c('0x27')](_0x145ae9);}return null;};}function patchUpdates(_0x11f1f6){return function(_0x5c09ba){try{jsonpatch[_0x6f1c('0x2c')](_0x5c09ba,_0x11f1f6,!![]);}catch(_0x346c4a){return BPromise[_0x6f1c('0x2d')](_0x346c4a);}return _0x5c09ba['save']();};}function saveUpdates(_0x477e37,_0x5970f3){return function(_0x41adda){if(_0x41adda){return _0x41adda[_0x6f1c('0x2e')](_0x477e37)[_0x6f1c('0x1b')](function(_0x5e6e02){return _0x5e6e02;});}return null;};}function removeEntity(_0x5e786f,_0x29cbaa){return function(_0x1e7d96){if(_0x1e7d96){return _0x1e7d96[_0x6f1c('0x2f')]()[_0x6f1c('0x1b')](function(){_0x5e786f[_0x6f1c('0x25')](0xcc)[_0x6f1c('0x26')]();});}};}function handleEntityNotFound(_0x215e8e,_0x2a146e){return function(_0x3a50e8){if(!_0x3a50e8){_0x215e8e[_0x6f1c('0x24')](0x194);}return _0x3a50e8;};}function handleError(_0x42f44e,_0x2ad9a6){_0x2ad9a6=_0x2ad9a6||0x1f4;return function(_0xfa77bd){logger[_0x6f1c('0x20')](_0xfa77bd[_0x6f1c('0x30')]);if(_0xfa77bd['name']){delete _0xfa77bd[_0x6f1c('0x31')];}_0x42f44e[_0x6f1c('0x25')](_0x2ad9a6)[_0x6f1c('0x32')](_0xfa77bd);};}exports[_0x6f1c('0x33')]=function(_0x500982,_0x2fb07d){var _0x370f60={},_0x2a802c={},_0x130966={'count':0x0,'rows':[]};var _0x214842=db[_0x6f1c('0x34')][_0x6f1c('0x35')];_0x2a802c['model']=_[_0x6f1c('0x36')](_0x214842);_0x2a802c[_0x6f1c('0x37')]=_[_0x6f1c('0x36')](_0x500982[_0x6f1c('0x37')]);_0x2a802c[_0x6f1c('0x38')]=_[_0x6f1c('0x39')](_0x2a802c[_0x6f1c('0x3a')],_0x2a802c[_0x6f1c('0x37')]);_0x370f60[_0x6f1c('0x3b')]=_[_0x6f1c('0x39')](_0x2a802c['model'],qs[_0x6f1c('0x3c')](_0x500982[_0x6f1c('0x37')][_0x6f1c('0x3c')]));_0x370f60[_0x6f1c('0x3b')]=_0x370f60[_0x6f1c('0x3b')][_0x6f1c('0x3d')]?_0x370f60[_0x6f1c('0x3b')]:_0x2a802c[_0x6f1c('0x3a')];if(!_0x500982[_0x6f1c('0x37')][_0x6f1c('0x3e')](_0x6f1c('0x3f'))){_0x370f60['limit']=qs[_0x6f1c('0x2a')](_0x500982[_0x6f1c('0x37')][_0x6f1c('0x2a')]);_0x370f60['offset']=qs['offset'](_0x500982[_0x6f1c('0x37')]['offset']);}_0x370f60['order']=qs[_0x6f1c('0x40')](_0x500982[_0x6f1c('0x37')][_0x6f1c('0x40')]);_0x370f60['where']=qs[_0x6f1c('0x38')](_[_0x6f1c('0x41')](_0x500982[_0x6f1c('0x37')],_0x2a802c[_0x6f1c('0x38')]));if(_0x500982[_0x6f1c('0x37')][_0x6f1c('0x42')]){_0x370f60['where']=_[_0x6f1c('0x43')](_0x370f60[_0x6f1c('0x44')],{'$or':_[_0x6f1c('0x45')](_0x214842,function(_0x234d79){if(_0x234d79[_0x6f1c('0x46')][_0x6f1c('0x47')]!==_0x6f1c('0x48')){var _0x3e3df7={};_0x3e3df7[_0x234d79[_0x6f1c('0x49')]]={'$like':'%'+_0x500982[_0x6f1c('0x37')][_0x6f1c('0x42')]+'%'};return _0x3e3df7;}})});}_0x370f60=_[_0x6f1c('0x43')]({},_0x370f60,_0x500982['options']);var _0x51117d={'where':_0x370f60[_0x6f1c('0x44')]};return db['ZohoAccount'][_0x6f1c('0x28')](_0x51117d)[_0x6f1c('0x1b')](function(_0x47c9d3){_0x130966[_0x6f1c('0x28')]=_0x47c9d3;if(_0x500982[_0x6f1c('0x37')][_0x6f1c('0x4a')]){_0x370f60['include']=[{'all':!![]}];}return db['ZohoAccount'][_0x6f1c('0x4b')](_0x370f60);})[_0x6f1c('0x1b')](function(_0x2aa4da){_0x130966[_0x6f1c('0x4c')]=_0x2aa4da;return _0x130966;})['then'](respondWithFilteredResult(_0x2fb07d,_0x370f60))[_0x6f1c('0x23')](handleError(_0x2fb07d,null));};exports[_0x6f1c('0x4d')]=function(_0x3423b1,_0x31ee86){var _0x248568={'raw':![],'where':{'id':_0x3423b1['params']['id']}},_0x3bb54d={};_0x3bb54d[_0x6f1c('0x3a')]=_['keys'](db['ZohoAccount'][_0x6f1c('0x35')]);_0x3bb54d['query']=_[_0x6f1c('0x36')](_0x3423b1[_0x6f1c('0x37')]);_0x3bb54d[_0x6f1c('0x38')]=_[_0x6f1c('0x39')](_0x3bb54d[_0x6f1c('0x3a')],_0x3bb54d[_0x6f1c('0x37')]);_0x248568[_0x6f1c('0x3b')]=_[_0x6f1c('0x39')](_0x3bb54d[_0x6f1c('0x3a')],qs[_0x6f1c('0x3c')](_0x3423b1['query']['fields']));_0x248568[_0x6f1c('0x3b')]=_0x248568[_0x6f1c('0x3b')][_0x6f1c('0x3d')]?_0x248568[_0x6f1c('0x3b')]:_0x3bb54d[_0x6f1c('0x3a')];if(_0x3423b1[_0x6f1c('0x37')][_0x6f1c('0x4a')]){_0x248568[_0x6f1c('0x4e')]=[{'all':!![]}];}_0x248568=_['merge']({},_0x248568,_0x3423b1[_0x6f1c('0x4f')]);return db['ZohoAccount']['find'](_0x248568)[_0x6f1c('0x1b')](handleEntityNotFound(_0x31ee86,null))[_0x6f1c('0x1b')](respondWithResult(_0x31ee86,null))['catch'](handleError(_0x31ee86,null));};exports[_0x6f1c('0x50')]=function(_0x50528b,_0xfd8e59){return db['ZohoAccount'][_0x6f1c('0x50')](_0x50528b['body'],{})[_0x6f1c('0x1b')](respondWithResult(_0xfd8e59,0xc9))[_0x6f1c('0x23')](handleError(_0xfd8e59,null));};exports[_0x6f1c('0x2e')]=function(_0x5687d,_0x8c058){if(_0x5687d[_0x6f1c('0x51')]['id']){delete _0x5687d[_0x6f1c('0x51')]['id'];}return db[_0x6f1c('0x34')][_0x6f1c('0x52')]({'where':{'id':_0x5687d[_0x6f1c('0x53')]['id']}})[_0x6f1c('0x1b')](handleEntityNotFound(_0x8c058,null))[_0x6f1c('0x1b')](saveUpdates(_0x5687d[_0x6f1c('0x51')],null))['then'](respondWithResult(_0x8c058,null))[_0x6f1c('0x23')](handleError(_0x8c058,null));};exports[_0x6f1c('0x2f')]=function(_0x4213fb,_0x1790c6){return db['ZohoAccount'][_0x6f1c('0x52')]({'where':{'id':_0x4213fb['params']['id']}})[_0x6f1c('0x1b')](handleEntityNotFound(_0x1790c6,null))[_0x6f1c('0x1b')](removeEntity(_0x1790c6,null))['catch'](handleError(_0x1790c6,null));};exports[_0x6f1c('0x54')]=function(_0x50e498,_0xd9e2a2,_0x43b6c1){var _0x5ce94a={};var _0x12d3c9={};var _0x5d9dfe;var _0x3b9011;return db[_0x6f1c('0x34')][_0x6f1c('0x55')]({'where':{'id':_0x50e498['params']['id']}})[_0x6f1c('0x1b')](handleEntityNotFound(_0xd9e2a2,null))['then'](function(_0x3b9eba){if(_0x3b9eba){_0x5d9dfe=_0x3b9eba;_0x12d3c9['model']=_[_0x6f1c('0x36')](db[_0x6f1c('0x56')][_0x6f1c('0x35')]);_0x12d3c9[_0x6f1c('0x37')]=_[_0x6f1c('0x36')](_0x50e498[_0x6f1c('0x37')]);_0x12d3c9['filters']=_[_0x6f1c('0x39')](_0x12d3c9['model'],_0x12d3c9[_0x6f1c('0x37')]);_0x5ce94a[_0x6f1c('0x3b')]=_[_0x6f1c('0x39')](_0x12d3c9[_0x6f1c('0x3a')],qs[_0x6f1c('0x3c')](_0x50e498[_0x6f1c('0x37')][_0x6f1c('0x3c')]));_0x5ce94a[_0x6f1c('0x3b')]=_0x5ce94a['attributes'][_0x6f1c('0x3d')]?_0x5ce94a[_0x6f1c('0x3b')]:_0x12d3c9[_0x6f1c('0x3a')];_0x5ce94a[_0x6f1c('0x57')]=qs[_0x6f1c('0x40')](_0x50e498[_0x6f1c('0x37')][_0x6f1c('0x40')]);_0x5ce94a[_0x6f1c('0x44')]=qs[_0x6f1c('0x38')](_[_0x6f1c('0x41')](_0x50e498['query'],_0x12d3c9['filters']));if(_0x50e498[_0x6f1c('0x37')][_0x6f1c('0x42')]){_0x5ce94a[_0x6f1c('0x44')]=_[_0x6f1c('0x43')](_0x5ce94a['where'],{'$or':_['map'](_0x5ce94a[_0x6f1c('0x3b')],function(_0x4ed318){var _0x29d835={};_0x29d835[_0x4ed318]={'$like':'%'+_0x50e498[_0x6f1c('0x37')][_0x6f1c('0x42')]+'%'};return _0x29d835;})});}_0x5ce94a=_['merge']({},_0x5ce94a,_0x50e498[_0x6f1c('0x4f')]);return _0x5d9dfe[_0x6f1c('0x54')](_0x5ce94a);}})[_0x6f1c('0x1b')](function(_0x4ba13f){if(_0x4ba13f){_0x3b9011=_0x4ba13f['length'];if(!_0x50e498[_0x6f1c('0x37')][_0x6f1c('0x3e')]('nolimit')){_0x5ce94a[_0x6f1c('0x2a')]=qs[_0x6f1c('0x2a')](_0x50e498['query']['limit']);_0x5ce94a[_0x6f1c('0x29')]=qs[_0x6f1c('0x29')](_0x50e498[_0x6f1c('0x37')][_0x6f1c('0x29')]);}return _0x5d9dfe[_0x6f1c('0x54')](_0x5ce94a);}})[_0x6f1c('0x1b')](function(_0x27490c){if(_0x27490c){return _0x27490c?{'count':_0x3b9011,'rows':_0x27490c}:null;}})[_0x6f1c('0x1b')](respondWithResult(_0xd9e2a2,null))[_0x6f1c('0x23')](handleError(_0xd9e2a2,null));};exports[_0x6f1c('0x58')]=function(_0x2c8fbe,_0x1cef8f,_0x5b5227){if(_0x2c8fbe[_0x6f1c('0x51')]['id']){delete _0x2c8fbe['body']['id'];}return db[_0x6f1c('0x34')][_0x6f1c('0x55')]({'where':{'id':_0x2c8fbe[_0x6f1c('0x53')]['id']}})[_0x6f1c('0x1b')](handleEntityNotFound(_0x1cef8f,null))[_0x6f1c('0x1b')](function(_0x5ef254){if(_0x5ef254){_0x2c8fbe[_0x6f1c('0x51')][_0x6f1c('0x59')]=_0x5ef254['id'];_0x2c8fbe[_0x6f1c('0x51')][_0x6f1c('0x5a')]=integrations[_0x6f1c('0x5b')](_0x2c8fbe['body']['channel'],_0x2c8fbe[_0x6f1c('0x51')][_0x6f1c('0x46')]);_0x2c8fbe[_0x6f1c('0x51')][_0x6f1c('0x5c')]=integrations[_0x6f1c('0x5d')](_0x2c8fbe['body'][_0x6f1c('0x5e')],_0x2c8fbe[_0x6f1c('0x51')][_0x6f1c('0x46')]);return db[_0x6f1c('0x56')]['create'](_0x2c8fbe[_0x6f1c('0x51')],{'include':[{'model':db[_0x6f1c('0x5f')],'as':_0x6f1c('0x5a')},{'model':db[_0x6f1c('0x5f')],'as':_0x6f1c('0x5c')}]});}return null;})['then'](respondWithResult(_0x1cef8f,null))[_0x6f1c('0x23')](handleError(_0x1cef8f,null));};function getAccessToken(_0x103723){return new Promise(function(_0x1d3ba3,_0x31ba89){var _0x5c01e8;switch(_0x103723['zone']){case'US':_0x5c01e8=_0x6f1c('0x60');break;case'AU':_0x5c01e8='https://accounts.zoho.eu.au';break;case'EU':_0x5c01e8=_0x6f1c('0x60');break;case'IN':_0x5c01e8=_0x6f1c('0x61');break;case'CN':_0x5c01e8='https://accounts.zoho.com.cn';break;default:_0x5c01e8='https://accounts.zoho.eu';break;}var _0x2e0cb4={'method':_0x6f1c('0x62'),'uri':_0x5c01e8+_0x6f1c('0x63'),'qs':{'refresh_token':_0x103723[_0x6f1c('0x64')],'client_id':_0x103723[_0x6f1c('0x65')],'client_secret':_0x103723['clientSecret'],'grant_type':_0x6f1c('0x66')},'json':!![]};return rp(_0x2e0cb4)['then'](function(_0x2391d7){if(_0x2391d7['access_token']){_0x1d3ba3(_0x2391d7['access_token']);}else{_0x31ba89(_0x6f1c('0x67'));}})[_0x6f1c('0x23')](function(_0x5c964f){_0x31ba89(_0x5c964f);});});}exports[_0x6f1c('0x68')]=function(_0x5067b7,_0x4c605f,_0x57329c){var _0x11f25,_0x51d9b5,_0x311966,_0x3d3a95,_0x256bab;return db[_0x6f1c('0x34')][_0x6f1c('0x55')]({'where':{'id':_0x5067b7[_0x6f1c('0x53')]['id']},'attributes':['id','host',_0x6f1c('0x69'),_0x6f1c('0x65'),'clientSecret',_0x6f1c('0x6a'),'code',_0x6f1c('0x64')]})[_0x6f1c('0x1b')](handleEntityNotFound(_0x4c605f,null))[_0x6f1c('0x1b')](function(_0x15e0bf){_0x256bab=_0x15e0bf;_0x11f25=_0x256bab[_0x6f1c('0x6b')];_0x51d9b5=_0x11f25===_0x6f1c('0x6c')?'eu':_0x6f1c('0x6d');_0x311966=_0x256bab[_0x6f1c('0x6a')];var _0x2907cb=_0x311966[_0x6f1c('0x6e')](-0x1);if(_0x2907cb==='/'||_0x2907cb==='\x5c'||_0x2907cb===':'){_0x311966=_0x311966['substring'](0x0,_0x311966['lastIndexOf'](_0x2907cb));}if(!_0x256bab[_0x6f1c('0x64')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x256bab);})['then'](function(_0x58135c){if(_0x58135c){return rp({'method':_0x6f1c('0x6f'),'uri':util[_0x6f1c('0x70')](_0x6f1c('0x71'),_0x51d9b5),'qs':{'module':_0x6f1c('0x72')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x58135c},'json':!![]});}})[_0x6f1c('0x1b')](function(_0x28b590){if(_0x28b590){if(_0x28b590['response']&&_0x28b590[_0x6f1c('0x73')][_0x6f1c('0x20')]){throw new Error(_0x28b590[_0x6f1c('0x73')][_0x6f1c('0x20')][_0x6f1c('0x22')]);}var _0xe6470c=[];var _0x1f645b=[];var _0x3d7273=[_0x6f1c('0x74'),'Subject',_0x6f1c('0x75'),'WhoId','Call_Duration',_0x6f1c('0x76'),_0x6f1c('0x77'),_0x6f1c('0x78')];_0x1f645b=_[_0x6f1c('0x79')](_0x28b590[_0x6f1c('0x3c')],function(_0x1cc020){return _0x3d7273[_0x6f1c('0x7a')](_0x1cc020['api_name']);});for(var _0x4bb22c=0x0;_0x4bb22c<_0x1f645b[_0x6f1c('0x3d')];_0x4bb22c++){if(_0x1f645b[_0x4bb22c][_0x6f1c('0x7b')]===![]){_0xe6470c[_0x6f1c('0x7c')]({'id':_0x1f645b[_0x4bb22c]['id'],'name':_0x1f645b[_0x4bb22c][_0x6f1c('0x7d')],'custom':_0x1f645b[_0x4bb22c]['custom_field'],'options':_0x1f645b[_0x4bb22c][_0x6f1c('0x7e')]===_0x6f1c('0x7f')&&_0x1f645b[_0x4bb22c][_0x6f1c('0x80')][_0x6f1c('0x3d')]>-0x1?_['map'](_0x1f645b[_0x4bb22c]['pick_list_values'],function(_0x271646){return{'name':_0x271646,'value':_0x271646};}):[]});}}return{'count':_0xe6470c[_0x6f1c('0x3d')],'rows':_0xe6470c};}else{return{'count':0x0,'rows':[]};}})[_0x6f1c('0x1b')](respondWithResult(_0x4c605f,null))[_0x6f1c('0x23')](function(_0x4d7218){var _0x43bed7=_0x5067b7[_0x6f1c('0x37')]['test']?0x1f4:_0x4d7218['statusCode']||0x1f4;logger[_0x6f1c('0x20')](_0x6f1c('0x81'),_0x6f1c('0x68'),_0x43bed7,JSON[_0x6f1c('0x1f')](_0x4d7218));delete _0x4d7218[_0x6f1c('0x31')];if(_0x43bed7===0x191){_0x43bed7=0x190;}_0x4c605f['status'](_0x43bed7)[_0x6f1c('0x32')](_0x5067b7['query']['test']?{'message':_0x6f1c('0x82'),'statusCode':_0x4d7218[_0x6f1c('0x83')]}:_0x4d7218);});}; \ No newline at end of file +var _0x147b=['push','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','ZohoAccount,\x20%s,\x20%s','message','info','catch','status','end','offset','limit','set','json','apply','save','update','destroy','sendStatus','stack','name','index','ZohoAccount','rawAttributes','model','keys','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','field','options','count','includeAll','include','rows','show','params','find','create','body','getConfigurations','ZohoConfiguration','AccountId','getSubjects','Descriptions','channel','ZohoField','zone','https://accounts.zoho.eu.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','findOne','host','serverUrl','code','zoho.eu','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','includes','api_name','system_mandatory'];(function(_0x3a1710,_0x4b3a6e){var _0x3518ce=function(_0x133f23){while(--_0x133f23){_0x3a1710['push'](_0x3a1710['shift']());}};_0x3518ce(++_0x4b3a6e);}(_0x147b,0x193));var _0xb147=function(_0x4dba2b,_0x4f2f25){_0x4dba2b=_0x4dba2b-0x0;var _0x4a3f5c=_0x147b[_0x4dba2b];return _0x4a3f5c;};'use strict';var pdf=require(_0xb147('0x0'));var emlformat=require(_0xb147('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb147('0x2'));var jsonpatch=require(_0xb147('0x3'));var rp=require('request-promise');var moment=require(_0xb147('0x4'));var BPromise=require(_0xb147('0x5'));var Mustache=require(_0xb147('0x6'));var util=require('util');var path=require(_0xb147('0x7'));var sox=require('sox');var csv=require(_0xb147('0x8'));var ejs=require(_0xb147('0x9'));var fs=require('fs');var _=require(_0xb147('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb147('0xb'));var deskjs=require(_0xb147('0xc'));var toCsv=require(_0xb147('0x8'));var querystring=require(_0xb147('0xd'));var Papa=require(_0xb147('0xe'));var Redis=require(_0xb147('0xf'));var authService=require(_0xb147('0x10'));var qs=require(_0xb147('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb147('0x12'));var utils=require(_0xb147('0x13'));var config=require(_0xb147('0x14'));var db=require(_0xb147('0x15'))['db'];var integrations=require(_0xb147('0x16'));var jayson=require(_0xb147('0x17'));var client=jayson[_0xb147('0x18')][_0xb147('0x19')]({'port':0x232a});function checkPasswordPattern(_0x38040c,_0x2e6d77,_0x1eaac2){if(_0x1eaac2){var _0x557ec2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x557ec2[_0xb147('0x1a')](_0x2e6d77)){return _0x38040c;}else{throw new Error(_0xb147('0x1b'));}}else{return _0x38040c;}}function respondWithRpcPromise(_0x23ad29,_0x2c1952,_0x5479b4,_0x2a0eeb){return new BPromise(function(_0x394614,_0x4ab867){var _0x4df7e9=_0x2a0eeb||client;return _0x4df7e9[_0xb147('0x1c')](_0x23ad29,_0x5479b4)[_0xb147('0x1d')](function(_0x34e3c1){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x2c1952,_0xb147('0x1e'));logger['debug'](_0xb147('0x1f'),_0x2c1952,_0xb147('0x1e'),JSON[_0xb147('0x20')](_0x34e3c1));if(_0x34e3c1['error']){if(_0x34e3c1['error']['code']===0x1f4){logger[_0xb147('0x21')](_0xb147('0x22'),_0x2c1952,_0x34e3c1[_0xb147('0x21')]['message']);return _0x4ab867(_0x34e3c1[_0xb147('0x21')][_0xb147('0x23')]);}logger[_0xb147('0x21')](_0xb147('0x22'),_0x2c1952,_0x34e3c1[_0xb147('0x21')]['message']);return _0x394614(_0x34e3c1[_0xb147('0x21')][_0xb147('0x23')]);}else{logger[_0xb147('0x24')](_0xb147('0x22'),_0x2c1952,_0xb147('0x1e'));_0x394614(_0x34e3c1['result']['message']);}})[_0xb147('0x25')](function(_0x98509e){logger[_0xb147('0x21')](_0xb147('0x22'),_0x2c1952,_0x98509e);_0x4ab867(_0x98509e);});});}function respondWithStatusCode(_0x5f2806,_0x174004){_0x174004=_0x174004||0xcc;return function(_0x4c5475){if(_0x4c5475){return _0x5f2806['sendStatus'](_0x174004);}return _0x5f2806[_0xb147('0x26')](_0x174004)[_0xb147('0x27')]();};}function respondWithResult(_0x444d58,_0x139057){_0x139057=_0x139057||0xc8;return function(_0x12c18f){if(_0x12c18f){return _0x444d58[_0xb147('0x26')](_0x139057)['json'](_0x12c18f);}};}function respondWithFilteredResult(_0x5691de,_0x3bf2ae){return function(_0x456718){if(_0x456718){var _0x4c58a5=_0x456718['count'],_0xf23eed=_0x3bf2ae[_0xb147('0x28')],_0x45887f=_0x3bf2ae[_0xb147('0x28')]+_0x3bf2ae[_0xb147('0x29')],_0x50f831;if(_0x45887f>=_0x4c58a5){_0x45887f=_0x4c58a5;_0x50f831=0xc8;}else{_0x50f831=0xce;}_0x5691de[_0xb147('0x26')](_0x50f831);return _0x5691de[_0xb147('0x2a')]('Content-Range',_0xf23eed+'-'+_0x45887f+'/'+_0x4c58a5)[_0xb147('0x2b')](_0x456718);}return null;};}function patchUpdates(_0x315896){return function(_0x273fff){try{jsonpatch[_0xb147('0x2c')](_0x273fff,_0x315896,!![]);}catch(_0x40608d){return BPromise['reject'](_0x40608d);}return _0x273fff[_0xb147('0x2d')]();};}function saveUpdates(_0x7c6129,_0x9a2bb2){return function(_0x35102b){if(_0x35102b){return _0x35102b[_0xb147('0x2e')](_0x7c6129)[_0xb147('0x1d')](function(_0x35d348){return _0x35d348;});}return null;};}function removeEntity(_0xb2b398,_0x2199e6){return function(_0x5d23b2){if(_0x5d23b2){return _0x5d23b2[_0xb147('0x2f')]()[_0xb147('0x1d')](function(){_0xb2b398[_0xb147('0x26')](0xcc)[_0xb147('0x27')]();});}};}function handleEntityNotFound(_0x2f8bee,_0x3d0b9d){return function(_0x1e5799){if(!_0x1e5799){_0x2f8bee[_0xb147('0x30')](0x194);}return _0x1e5799;};}function handleError(_0x5a8261,_0x2103bc){_0x2103bc=_0x2103bc||0x1f4;return function(_0x2c03e0){logger[_0xb147('0x21')](_0x2c03e0[_0xb147('0x31')]);if(_0x2c03e0[_0xb147('0x32')]){delete _0x2c03e0[_0xb147('0x32')];}_0x5a8261[_0xb147('0x26')](_0x2103bc)['send'](_0x2c03e0);};}exports[_0xb147('0x33')]=function(_0x48cc99,_0x221a7c){var _0x2977fe={},_0x481a3f={},_0x5d3e2b={'count':0x0,'rows':[]};var _0x516d5d=db[_0xb147('0x34')][_0xb147('0x35')];_0x481a3f[_0xb147('0x36')]=_[_0xb147('0x37')](_0x516d5d);_0x481a3f[_0xb147('0x38')]=_['keys'](_0x48cc99[_0xb147('0x38')]);_0x481a3f['filters']=_['intersection'](_0x481a3f['model'],_0x481a3f[_0xb147('0x38')]);_0x2977fe[_0xb147('0x39')]=_[_0xb147('0x3a')](_0x481a3f[_0xb147('0x36')],qs[_0xb147('0x3b')](_0x48cc99[_0xb147('0x38')]['fields']));_0x2977fe[_0xb147('0x39')]=_0x2977fe[_0xb147('0x39')][_0xb147('0x3c')]?_0x2977fe[_0xb147('0x39')]:_0x481a3f[_0xb147('0x36')];if(!_0x48cc99[_0xb147('0x38')]['hasOwnProperty'](_0xb147('0x3d'))){_0x2977fe[_0xb147('0x29')]=qs[_0xb147('0x29')](_0x48cc99['query'][_0xb147('0x29')]);_0x2977fe[_0xb147('0x28')]=qs['offset'](_0x48cc99['query']['offset']);}_0x2977fe[_0xb147('0x3e')]=qs['sort'](_0x48cc99['query'][_0xb147('0x3f')]);_0x2977fe[_0xb147('0x40')]=qs[_0xb147('0x41')](_[_0xb147('0x42')](_0x48cc99['query'],_0x481a3f[_0xb147('0x41')]));if(_0x48cc99['query'][_0xb147('0x43')]){_0x2977fe[_0xb147('0x40')]=_[_0xb147('0x44')](_0x2977fe[_0xb147('0x40')],{'$or':_[_0xb147('0x45')](_0x516d5d,function(_0x1fe210){if(_0x1fe210[_0xb147('0x46')][_0xb147('0x47')]!=='VIRTUAL'){var _0x45bd14={};_0x45bd14[_0x1fe210[_0xb147('0x48')]]={'$like':'%'+_0x48cc99[_0xb147('0x38')][_0xb147('0x43')]+'%'};return _0x45bd14;}})});}_0x2977fe=_[_0xb147('0x44')]({},_0x2977fe,_0x48cc99[_0xb147('0x49')]);var _0x4e4f46={'where':_0x2977fe[_0xb147('0x40')]};return db['ZohoAccount'][_0xb147('0x4a')](_0x4e4f46)[_0xb147('0x1d')](function(_0x3b8449){_0x5d3e2b[_0xb147('0x4a')]=_0x3b8449;if(_0x48cc99['query'][_0xb147('0x4b')]){_0x2977fe[_0xb147('0x4c')]=[{'all':!![]}];}return db[_0xb147('0x34')]['findAll'](_0x2977fe);})[_0xb147('0x1d')](function(_0x5000cd){_0x5d3e2b[_0xb147('0x4d')]=_0x5000cd;return _0x5d3e2b;})[_0xb147('0x1d')](respondWithFilteredResult(_0x221a7c,_0x2977fe))[_0xb147('0x25')](handleError(_0x221a7c,null));};exports[_0xb147('0x4e')]=function(_0x1d679e,_0x17975d){var _0x3ae243={'raw':![],'where':{'id':_0x1d679e[_0xb147('0x4f')]['id']}},_0x1f5c65={};_0x1f5c65[_0xb147('0x36')]=_[_0xb147('0x37')](db[_0xb147('0x34')][_0xb147('0x35')]);_0x1f5c65[_0xb147('0x38')]=_[_0xb147('0x37')](_0x1d679e['query']);_0x1f5c65[_0xb147('0x41')]=_[_0xb147('0x3a')](_0x1f5c65[_0xb147('0x36')],_0x1f5c65[_0xb147('0x38')]);_0x3ae243[_0xb147('0x39')]=_['intersection'](_0x1f5c65[_0xb147('0x36')],qs[_0xb147('0x3b')](_0x1d679e['query'][_0xb147('0x3b')]));_0x3ae243['attributes']=_0x3ae243['attributes'][_0xb147('0x3c')]?_0x3ae243[_0xb147('0x39')]:_0x1f5c65['model'];if(_0x1d679e[_0xb147('0x38')][_0xb147('0x4b')]){_0x3ae243[_0xb147('0x4c')]=[{'all':!![]}];}_0x3ae243=_[_0xb147('0x44')]({},_0x3ae243,_0x1d679e[_0xb147('0x49')]);return db['ZohoAccount'][_0xb147('0x50')](_0x3ae243)[_0xb147('0x1d')](handleEntityNotFound(_0x17975d,null))[_0xb147('0x1d')](respondWithResult(_0x17975d,null))[_0xb147('0x25')](handleError(_0x17975d,null));};exports[_0xb147('0x51')]=function(_0x3fdbd4,_0x3a85c3){return db[_0xb147('0x34')][_0xb147('0x51')](_0x3fdbd4[_0xb147('0x52')],{})[_0xb147('0x1d')](respondWithResult(_0x3a85c3,0xc9))['catch'](handleError(_0x3a85c3,null));};exports[_0xb147('0x2e')]=function(_0x1ea2e1,_0x4dde95){if(_0x1ea2e1[_0xb147('0x52')]['id']){delete _0x1ea2e1[_0xb147('0x52')]['id'];}return db[_0xb147('0x34')]['find']({'where':{'id':_0x1ea2e1[_0xb147('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4dde95,null))[_0xb147('0x1d')](saveUpdates(_0x1ea2e1[_0xb147('0x52')],null))['then'](respondWithResult(_0x4dde95,null))[_0xb147('0x25')](handleError(_0x4dde95,null));};exports[_0xb147('0x2f')]=function(_0x584b3b,_0xb55948){return db[_0xb147('0x34')][_0xb147('0x50')]({'where':{'id':_0x584b3b[_0xb147('0x4f')]['id']}})[_0xb147('0x1d')](handleEntityNotFound(_0xb55948,null))[_0xb147('0x1d')](removeEntity(_0xb55948,null))[_0xb147('0x25')](handleError(_0xb55948,null));};exports[_0xb147('0x53')]=function(_0x2a0660,_0xb5959,_0x52b498){var _0x20f32c={};var _0x202d4e={};var _0x58fb47;var _0x3c833e;return db[_0xb147('0x34')]['findOne']({'where':{'id':_0x2a0660[_0xb147('0x4f')]['id']}})[_0xb147('0x1d')](handleEntityNotFound(_0xb5959,null))[_0xb147('0x1d')](function(_0x2559d6){if(_0x2559d6){_0x58fb47=_0x2559d6;_0x202d4e[_0xb147('0x36')]=_[_0xb147('0x37')](db[_0xb147('0x54')][_0xb147('0x35')]);_0x202d4e[_0xb147('0x38')]=_[_0xb147('0x37')](_0x2a0660['query']);_0x202d4e['filters']=_[_0xb147('0x3a')](_0x202d4e[_0xb147('0x36')],_0x202d4e[_0xb147('0x38')]);_0x20f32c['attributes']=_['intersection'](_0x202d4e[_0xb147('0x36')],qs[_0xb147('0x3b')](_0x2a0660['query']['fields']));_0x20f32c[_0xb147('0x39')]=_0x20f32c[_0xb147('0x39')][_0xb147('0x3c')]?_0x20f32c['attributes']:_0x202d4e[_0xb147('0x36')];_0x20f32c[_0xb147('0x3e')]=qs[_0xb147('0x3f')](_0x2a0660[_0xb147('0x38')][_0xb147('0x3f')]);_0x20f32c['where']=qs[_0xb147('0x41')](_[_0xb147('0x42')](_0x2a0660['query'],_0x202d4e[_0xb147('0x41')]));if(_0x2a0660[_0xb147('0x38')][_0xb147('0x43')]){_0x20f32c[_0xb147('0x40')]=_['merge'](_0x20f32c[_0xb147('0x40')],{'$or':_[_0xb147('0x45')](_0x20f32c['attributes'],function(_0x216cbf){var _0x586362={};_0x586362[_0x216cbf]={'$like':'%'+_0x2a0660[_0xb147('0x38')][_0xb147('0x43')]+'%'};return _0x586362;})});}_0x20f32c=_[_0xb147('0x44')]({},_0x20f32c,_0x2a0660['options']);return _0x58fb47[_0xb147('0x53')](_0x20f32c);}})[_0xb147('0x1d')](function(_0x5b3e50){if(_0x5b3e50){_0x3c833e=_0x5b3e50[_0xb147('0x3c')];if(!_0x2a0660[_0xb147('0x38')]['hasOwnProperty'](_0xb147('0x3d'))){_0x20f32c['limit']=qs[_0xb147('0x29')](_0x2a0660[_0xb147('0x38')][_0xb147('0x29')]);_0x20f32c[_0xb147('0x28')]=qs[_0xb147('0x28')](_0x2a0660['query'][_0xb147('0x28')]);}return _0x58fb47['getConfigurations'](_0x20f32c);}})[_0xb147('0x1d')](function(_0x13d67d){if(_0x13d67d){return _0x13d67d?{'count':_0x3c833e,'rows':_0x13d67d}:null;}})[_0xb147('0x1d')](respondWithResult(_0xb5959,null))[_0xb147('0x25')](handleError(_0xb5959,null));};exports['addConfiguration']=function(_0x1fe869,_0x130851,_0x2ba7c8){if(_0x1fe869['body']['id']){delete _0x1fe869[_0xb147('0x52')]['id'];}return db[_0xb147('0x34')]['findOne']({'where':{'id':_0x1fe869[_0xb147('0x4f')]['id']}})[_0xb147('0x1d')](handleEntityNotFound(_0x130851,null))[_0xb147('0x1d')](function(_0x48d248){if(_0x48d248){_0x1fe869[_0xb147('0x52')][_0xb147('0x55')]=_0x48d248['id'];_0x1fe869[_0xb147('0x52')]['Subjects']=integrations[_0xb147('0x56')](_0x1fe869['body']['channel'],_0x1fe869[_0xb147('0x52')][_0xb147('0x46')]);_0x1fe869[_0xb147('0x52')][_0xb147('0x57')]=integrations['getDescriptions'](_0x1fe869[_0xb147('0x52')][_0xb147('0x58')],_0x1fe869['body'][_0xb147('0x46')]);return db['ZohoConfiguration'][_0xb147('0x51')](_0x1fe869['body'],{'include':[{'model':db[_0xb147('0x59')],'as':'Subjects'},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})[_0xb147('0x1d')](respondWithResult(_0x130851,null))[_0xb147('0x25')](handleError(_0x130851,null));};function getAccessToken(_0x330068){return new Promise(function(_0x35bd8b,_0x272e76){var _0x3798a0;switch(_0x330068[_0xb147('0x5a')]){case'US':_0x3798a0='https://accounts.zoho.eu';break;case'AU':_0x3798a0=_0xb147('0x5b');break;case'EU':_0x3798a0=_0xb147('0x5c');break;case'IN':_0x3798a0=_0xb147('0x5d');break;case'CN':_0x3798a0=_0xb147('0x5e');break;default:_0x3798a0='https://accounts.zoho.eu';break;}var _0x3bc1c2={'method':_0xb147('0x5f'),'uri':_0x3798a0+_0xb147('0x60'),'qs':{'refresh_token':_0x330068[_0xb147('0x61')],'client_id':_0x330068[_0xb147('0x62')],'client_secret':_0x330068[_0xb147('0x63')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x3bc1c2)[_0xb147('0x1d')](function(_0x58429d){if(_0x58429d[_0xb147('0x64')]){_0x35bd8b(_0x58429d[_0xb147('0x64')]);}else{_0x272e76(_0xb147('0x65'));}})[_0xb147('0x25')](function(_0xf147e7){_0x272e76(_0xf147e7);});});}exports[_0xb147('0x66')]=function(_0x2e8558,_0x278157,_0x2e57c5){var _0x3dab41,_0x444df4,_0x24c142,_0x5afcef,_0x5dadd3;return db[_0xb147('0x34')][_0xb147('0x67')]({'where':{'id':_0x2e8558[_0xb147('0x4f')]['id']},'attributes':['id',_0xb147('0x68'),_0xb147('0x5a'),'clientId',_0xb147('0x63'),_0xb147('0x69'),_0xb147('0x6a'),'refreshToken']})[_0xb147('0x1d')](handleEntityNotFound(_0x278157,null))[_0xb147('0x1d')](function(_0x20479c){_0x5dadd3=_0x20479c;_0x3dab41=_0x5dadd3[_0xb147('0x68')];_0x444df4=_0x3dab41===_0xb147('0x6b')?'eu':'com';_0x24c142=_0x5dadd3[_0xb147('0x69')];var _0x37672b=_0x24c142['slice'](-0x1);if(_0x37672b==='/'||_0x37672b==='\x5c'||_0x37672b===':'){_0x24c142=_0x24c142[_0xb147('0x6c')](0x0,_0x24c142['lastIndexOf'](_0x37672b));}if(!_0x5dadd3[_0xb147('0x61')]){throw new Error(_0xb147('0x6d'));}return getAccessToken(_0x5dadd3);})[_0xb147('0x1d')](function(_0x2ef8e8){if(_0x2ef8e8){return rp({'method':'GET','uri':util[_0xb147('0x6e')](_0xb147('0x6f'),_0x444df4),'qs':{'module':_0xb147('0x70')},'headers':{'Authorization':_0xb147('0x71')+_0x2ef8e8},'json':!![]});}})[_0xb147('0x1d')](function(_0x1091e5){if(_0x1091e5){if(_0x1091e5[_0xb147('0x72')]&&_0x1091e5[_0xb147('0x72')][_0xb147('0x21')]){throw new Error(_0x1091e5[_0xb147('0x72')][_0xb147('0x21')][_0xb147('0x23')]);}var _0x109fd4=[];var _0x384934=[];var _0x58a339=[_0xb147('0x73'),'Subject',_0xb147('0x74'),_0xb147('0x75'),_0xb147('0x76'),_0xb147('0x77'),_0xb147('0x78'),'Call_Type'];_0x384934=_[_0xb147('0x79')](_0x1091e5[_0xb147('0x3b')],function(_0x13a056){return _0x58a339[_0xb147('0x7a')](_0x13a056[_0xb147('0x7b')]);});for(var _0x539938=0x0;_0x539938<_0x384934['length'];_0x539938++){if(_0x384934[_0x539938][_0xb147('0x7c')]===![]){_0x109fd4[_0xb147('0x7d')]({'id':_0x384934[_0x539938]['id'],'name':_0x384934[_0x539938]['display_label'],'custom':_0x384934[_0x539938]['custom_field'],'options':_0x384934[_0x539938][_0xb147('0x7e')]===_0xb147('0x7f')&&_0x384934[_0x539938][_0xb147('0x80')][_0xb147('0x3c')]>-0x1?_['map'](_0x384934[_0x539938][_0xb147('0x80')],function(_0x3e15c8){return{'name':_0x3e15c8,'value':_0x3e15c8};}):[]});}}return{'count':_0x109fd4[_0xb147('0x3c')],'rows':_0x109fd4};}else{return{'count':0x0,'rows':[]};}})[_0xb147('0x1d')](respondWithResult(_0x278157,null))['catch'](function(_0x8fa353){var _0x56ac87=_0x2e8558['query'][_0xb147('0x1a')]?0x1f4:_0x8fa353[_0xb147('0x81')]||0x1f4;logger[_0xb147('0x21')](_0xb147('0x82'),'getFields',_0x56ac87,JSON[_0xb147('0x20')](_0x8fa353));delete _0x8fa353[_0xb147('0x32')];if(_0x56ac87===0x191){_0x56ac87=0x190;}_0x278157[_0xb147('0x26')](_0x56ac87)['send'](_0x2e8558[_0xb147('0x38')][_0xb147('0x1a')]?{'message':_0xb147('0x83'),'statusCode':_0x8fa353[_0xb147('0x81')]}:_0x8fa353);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index b83a7ec..b4b9856 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 _0xc3b5=['code','slice','substring','lastIndexOf','https://accounts.zoho.eu.au','https://accounts.zoho.in','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','inspect','host','https://accounts.zoho.com.cn','POST','then','parse','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret'];(function(_0x51ae90,_0x4d67cf){var _0x38ac33=function(_0x5cbfcc){while(--_0x5cbfcc){_0x51ae90['push'](_0x51ae90['shift']());}};_0x38ac33(++_0x4d67cf);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x253712,_0x3f844b){_0x253712=_0x253712-0x0;var _0x4530b6=_0xc3b5[_0x253712];return _0x4530b6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5c3b('0x0'))(_0x5c3b('0x1'));var moment=require(_0x5c3b('0x2'));var BPromise=require(_0x5c3b('0x3'));var rp=require(_0x5c3b('0x4'));var fs=require('fs');var path=require(_0x5c3b('0x5'));var rimraf=require(_0x5c3b('0x6'));var config=require(_0x5c3b('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x5c3b('0x8'));module[_0x5c3b('0x9')]=function(_0x56345e,_0x568a28){return _0x56345e[_0x5c3b('0xa')](_0x5c3b('0xb'),attributes,{'tableName':_0x5c3b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5be9ee,_0x1c68a5,_0x438255){if(_0x5be9ee[_0x5c3b('0xd')](_0x5c3b('0xe'))||_0x5be9ee['changed'](_0x5c3b('0xf'))||_0x5be9ee[_0x5c3b('0xd')](_0x5c3b('0x10'))||_0x5be9ee[_0x5c3b('0xd')](_0x5c3b('0x11'))||_0x5be9ee['changed'](_0x5c3b('0x12'))||_0x5be9ee[_0x5c3b('0xd')]('host')){var _0x1b2815,_0x3b953d;_0x1b2815=_0x5be9ee['serverUrl'];var _0x24b9d0=_0x1b2815[_0x5c3b('0x13')](-0x1);if(_0x24b9d0==='/'||_0x24b9d0==='\x5c'||_0x24b9d0===':'){_0x1b2815=_0x1b2815[_0x5c3b('0x14')](0x0,_0x1b2815[_0x5c3b('0x15')](_0x24b9d0));}switch(_0x5be9ee[_0x5c3b('0xe')]){case'AU':_0x3b953d=_0x5c3b('0x16');break;case'IN':_0x3b953d=_0x5c3b('0x17');break;case'CN':_0x3b953d='https://accounts.zoho.com.cn';break;default:_0x3b953d=_0x5c3b('0x18');break;}var _0x5b55be={'method':'POST','uri':_0x3b953d+_0x5c3b('0x19'),'form':{'grant_type':_0x5c3b('0x1a'),'client_id':_0x5be9ee[_0x5c3b('0x10')],'client_secret':_0x5be9ee['clientSecret'],'redirect_uri':_0x5be9ee[_0x5c3b('0xf')],'code':_0x5be9ee[_0x5c3b('0x12')]},'headers':{'Content-Type':_0x5c3b('0x1b')}};return rp(_0x5b55be)['then'](function(_0x385053){var _0x34144d=JSON['parse'](_0x385053);if(_0x34144d[_0x5c3b('0x1c')]){_0x5be9ee[_0x5c3b('0x1d')]=_0x34144d[_0x5c3b('0x1c')];logger[_0x5c3b('0x1e')](util[_0x5c3b('0x1f')](_0x5c3b('0x20'),_0x5be9ee[_0x5c3b('0x21')],_0x5be9ee['id']));}else{logger[_0x5c3b('0x22')](util[_0x5c3b('0x1f')](_0x5c3b('0x23'),_0x5be9ee['name'],_0x5be9ee['id']),util['inspect'](_0x34144d,{'showHidden':![],'depth':null}));}return _0x438255(null,_0x1c68a5);})[_0x5c3b('0x24')](function(_0x143022){logger['error'](util[_0x5c3b('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5be9ee[_0x5c3b('0x21')],_0x5be9ee['id']),util[_0x5c3b('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x438255(_0x143022);});}else{return _0x438255(null,_0x1c68a5);}},'beforeUpdate':function(_0x2bb9dc,_0xe9261d,_0x529c39){if(_0x2bb9dc[_0x5c3b('0xd')](_0x5c3b('0xe'))||_0x2bb9dc['changed'](_0x5c3b('0xf'))||_0x2bb9dc[_0x5c3b('0xd')](_0x5c3b('0x10'))||_0x2bb9dc[_0x5c3b('0xd')]('clientSecret')||_0x2bb9dc[_0x5c3b('0xd')](_0x5c3b('0x12'))||_0x2bb9dc[_0x5c3b('0xd')](_0x5c3b('0x26'))){var _0x28dfbc,_0x2a293d;_0x28dfbc=_0x2bb9dc['serverUrl'];var _0x51fa32=_0x28dfbc['slice'](-0x1);if(_0x51fa32==='/'||_0x51fa32==='\x5c'||_0x51fa32===':'){_0x28dfbc=_0x28dfbc[_0x5c3b('0x14')](0x0,_0x28dfbc[_0x5c3b('0x15')](_0x51fa32));}switch(_0x2bb9dc['zone']){case'AU':_0x2a293d=_0x5c3b('0x16');break;case'IN':_0x2a293d=_0x5c3b('0x17');break;case'CN':_0x2a293d=_0x5c3b('0x27');break;default:_0x2a293d=_0x5c3b('0x18');break;}var _0x19a73d={'method':_0x5c3b('0x28'),'uri':_0x2a293d+_0x5c3b('0x19'),'form':{'grant_type':_0x5c3b('0x1a'),'client_id':_0x2bb9dc[_0x5c3b('0x10')],'client_secret':_0x2bb9dc[_0x5c3b('0x11')],'redirect_uri':_0x2bb9dc[_0x5c3b('0xf')],'code':_0x2bb9dc[_0x5c3b('0x12')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x19a73d)[_0x5c3b('0x29')](function(_0x3b56a1){var _0x3b80c9=JSON[_0x5c3b('0x2a')](_0x3b56a1);if(_0x3b80c9[_0x5c3b('0x1c')]){_0x2bb9dc[_0x5c3b('0x1d')]=_0x3b80c9[_0x5c3b('0x1c')];logger[_0x5c3b('0x1e')](util[_0x5c3b('0x1f')](_0x5c3b('0x20'),_0x2bb9dc[_0x5c3b('0x21')],_0x2bb9dc['id']));}else{logger[_0x5c3b('0x22')](util[_0x5c3b('0x1f')](_0x5c3b('0x23'),_0x2bb9dc[_0x5c3b('0x21')],_0x2bb9dc['id']),util[_0x5c3b('0x25')](_0x3b80c9,{'showHidden':![],'depth':null}));}return _0x529c39(null,_0xe9261d);})[_0x5c3b('0x24')](function(_0x4cfe1b){logger[_0x5c3b('0x22')](util[_0x5c3b('0x1f')](_0x5c3b('0x23'),_0x2bb9dc[_0x5c3b('0x21')],_0x2bb9dc['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x529c39(_0x4cfe1b);});}else{return _0x529c39(null,_0xe9261d);}}}});}; \ No newline at end of file +var _0x5fd1=['https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','then','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','clientId','slice','substring','lastIndexOf','authorization_code','parse','catch','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_zoho_accounts','changed','serverUrl','clientSecret','code','host','zone','https://accounts.zoho.eu.au','https://accounts.zoho.in'];(function(_0x8962d6,_0x503ed6){var _0x566f25=function(_0x56b0f0){while(--_0x56b0f0){_0x8962d6['push'](_0x8962d6['shift']());}};_0x566f25(++_0x503ed6);}(_0x5fd1,0x155));var _0x15fd=function(_0x5011fb,_0x375eda){_0x5011fb=_0x5011fb-0x0;var _0x394481=_0x5fd1[_0x5011fb];return _0x394481;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var logger=require(_0x15fd('0x1'))(_0x15fd('0x2'));var moment=require(_0x15fd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x15fd('0x4'));var rimraf=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x15fd('0x7'));module[_0x15fd('0x8')]=function(_0x18450c,_0x2e88bf){return _0x18450c[_0x15fd('0x9')]('ZohoAccount',attributes,{'tableName':_0x15fd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1ee117,_0x19806f,_0x4c861f){if(_0x1ee117[_0x15fd('0xb')]('zone')||_0x1ee117[_0x15fd('0xb')](_0x15fd('0xc'))||_0x1ee117['changed']('clientId')||_0x1ee117['changed'](_0x15fd('0xd'))||_0x1ee117[_0x15fd('0xb')](_0x15fd('0xe'))||_0x1ee117[_0x15fd('0xb')](_0x15fd('0xf'))){var _0x2e18ec,_0x346ab1;_0x2e18ec=_0x1ee117[_0x15fd('0xc')];var _0x459fa4=_0x2e18ec['slice'](-0x1);if(_0x459fa4==='/'||_0x459fa4==='\x5c'||_0x459fa4===':'){_0x2e18ec=_0x2e18ec['substring'](0x0,_0x2e18ec['lastIndexOf'](_0x459fa4));}switch(_0x1ee117[_0x15fd('0x10')]){case'AU':_0x346ab1=_0x15fd('0x11');break;case'IN':_0x346ab1=_0x15fd('0x12');break;case'CN':_0x346ab1=_0x15fd('0x13');break;default:_0x346ab1=_0x15fd('0x14');break;}var _0x2ffa03={'method':_0x15fd('0x15'),'uri':_0x346ab1+_0x15fd('0x16'),'form':{'grant_type':'authorization_code','client_id':_0x1ee117['clientId'],'client_secret':_0x1ee117[_0x15fd('0xd')],'redirect_uri':_0x1ee117['serverUrl'],'code':_0x1ee117[_0x15fd('0xe')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x2ffa03)[_0x15fd('0x17')](function(_0x318f47){var _0x855bae=JSON['parse'](_0x318f47);if(_0x855bae[_0x15fd('0x18')]){_0x1ee117[_0x15fd('0x19')]=_0x855bae[_0x15fd('0x18')];logger[_0x15fd('0x1a')](util[_0x15fd('0x1b')](_0x15fd('0x1c'),_0x1ee117[_0x15fd('0x1d')],_0x1ee117['id']));}else{logger[_0x15fd('0x1e')](util[_0x15fd('0x1b')](_0x15fd('0x1f'),_0x1ee117[_0x15fd('0x1d')],_0x1ee117['id']),util['inspect'](_0x855bae,{'showHidden':![],'depth':null}));}return _0x4c861f(null,_0x19806f);})['catch'](function(_0x293d7b){logger[_0x15fd('0x1e')](util[_0x15fd('0x1b')](_0x15fd('0x1f'),_0x1ee117[_0x15fd('0x1d')],_0x1ee117['id']),util[_0x15fd('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x4c861f(_0x293d7b);});}else{return _0x4c861f(null,_0x19806f);}},'beforeUpdate':function(_0x2073da,_0x50d493,_0x40d43){if(_0x2073da[_0x15fd('0xb')](_0x15fd('0x10'))||_0x2073da['changed'](_0x15fd('0xc'))||_0x2073da['changed'](_0x15fd('0x21'))||_0x2073da[_0x15fd('0xb')](_0x15fd('0xd'))||_0x2073da['changed'](_0x15fd('0xe'))||_0x2073da[_0x15fd('0xb')](_0x15fd('0xf'))){var _0x5d4789,_0x44e8c8;_0x5d4789=_0x2073da['serverUrl'];var _0x3d33cd=_0x5d4789[_0x15fd('0x22')](-0x1);if(_0x3d33cd==='/'||_0x3d33cd==='\x5c'||_0x3d33cd===':'){_0x5d4789=_0x5d4789[_0x15fd('0x23')](0x0,_0x5d4789[_0x15fd('0x24')](_0x3d33cd));}switch(_0x2073da[_0x15fd('0x10')]){case'AU':_0x44e8c8=_0x15fd('0x11');break;case'IN':_0x44e8c8=_0x15fd('0x12');break;case'CN':_0x44e8c8=_0x15fd('0x13');break;default:_0x44e8c8=_0x15fd('0x14');break;}var _0x160226={'method':_0x15fd('0x15'),'uri':_0x44e8c8+'/oauth/v2/token','form':{'grant_type':_0x15fd('0x25'),'client_id':_0x2073da[_0x15fd('0x21')],'client_secret':_0x2073da['clientSecret'],'redirect_uri':_0x2073da[_0x15fd('0xc')],'code':_0x2073da[_0x15fd('0xe')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x160226)[_0x15fd('0x17')](function(_0x197d15){var _0x5dc5fe=JSON[_0x15fd('0x26')](_0x197d15);if(_0x5dc5fe[_0x15fd('0x18')]){_0x2073da[_0x15fd('0x19')]=_0x5dc5fe[_0x15fd('0x18')];logger[_0x15fd('0x1a')](util[_0x15fd('0x1b')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2073da[_0x15fd('0x1d')],_0x2073da['id']));}else{logger[_0x15fd('0x1e')](util[_0x15fd('0x1b')](_0x15fd('0x1f'),_0x2073da['name'],_0x2073da['id']),util[_0x15fd('0x20')](_0x5dc5fe,{'showHidden':![],'depth':null}));}return _0x40d43(null,_0x50d493);})[_0x15fd('0x27')](function(_0x11b3a1){logger[_0x15fd('0x1e')](util[_0x15fd('0x1b')](_0x15fd('0x1f'),_0x2073da['name'],_0x2073da['id']),util[_0x15fd('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x40d43(_0x11b3a1);});}else{return _0x40d43(null,_0x50d493);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index ccf1d4b..406f2b7 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 _0xef0f=['ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','where','include','model','attributes','map','ShowZohoAccount','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x25986b,_0x3a8bc2){var _0xdbcd85=function(_0x190b06){while(--_0x190b06){_0x25986b['push'](_0x25986b['shift']());}};_0xdbcd85(++_0x3a8bc2);}(_0xef0f,0x168));var _0xfef0=function(_0x39283e,_0x81a14d){_0x39283e=_0x39283e-0x0;var _0x5f2a54=_0xef0f[_0x39283e];return _0x5f2a54;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var moment=require(_0xfef0('0x1'));var BPromise=require(_0xfef0('0x2'));var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef0('0x4'))['db'];var utils=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('rpc');var config=require(_0xfef0('0x7'));var jayson=require(_0xfef0('0x8'));var client=jayson[_0xfef0('0x9')][_0xfef0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xad43e,_0x11dfd7,_0x5130bd){return new BPromise(function(_0x41ec94,_0x58cf6d){return client[_0xfef0('0xb')](_0xad43e,_0x5130bd)[_0xfef0('0xc')](function(_0x3a81cc){logger[_0xfef0('0xd')](_0xfef0('0xe'),_0x11dfd7,_0xfef0('0xf'));logger[_0xfef0('0x10')](_0xfef0('0x11'),_0x11dfd7,_0xfef0('0xf'),JSON[_0xfef0('0x12')](_0x3a81cc));if(_0x3a81cc[_0xfef0('0x13')]){if(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x14')]===0x1f4){logger[_0xfef0('0x13')]('ZohoAccount,\x20%s,\x20%s',_0x11dfd7,_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);return _0x58cf6d(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);}logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x3a81cc[_0xfef0('0x13')]['message']);return _0x41ec94(_0x3a81cc[_0xfef0('0x13')]['message']);}else{logger['info']('ZohoAccount,\x20%s,\x20%s',_0x11dfd7,_0xfef0('0xf'));_0x41ec94(_0x3a81cc[_0xfef0('0x16')][_0xfef0('0x15')]);}})[_0xfef0('0x17')](function(_0x2a96d9){logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x2a96d9);_0x58cf6d(_0x2a96d9);});});}exports[_0xfef0('0x18')]=function(_0x581459){var _0xd60678=this;return new Promise(function(_0x1642cd,_0x1577fa){return db[_0xfef0('0x19')][_0xfef0('0x1a')]({'raw':_0x581459['options']?_0x581459[_0xfef0('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x581459[_0xfef0('0x1b')]?_0x581459[_0xfef0('0x1b')][_0xfef0('0x1c')]||null:null,'attributes':_0x581459['options']?_0x581459[_0xfef0('0x1b')]['attributes']||null:null,'limit':_0x581459[_0xfef0('0x1b')]?_0x581459[_0xfef0('0x1b')]['limit']||null:null,'include':_0x581459['options']?_0x581459['options'][_0xfef0('0x1d')]?_['map'](_0x581459[_0xfef0('0x1b')][_0xfef0('0x1d')],function(_0x1a8d66){return{'model':db[_0x1a8d66[_0xfef0('0x1e')]],'as':_0x1a8d66['as'],'attributes':_0x1a8d66[_0xfef0('0x1f')],'include':_0x1a8d66[_0xfef0('0x1d')]?_['map'](_0x1a8d66['include'],function(_0x316e20){return{'model':db[_0x316e20[_0xfef0('0x1e')]],'as':_0x316e20['as'],'attributes':_0x316e20[_0xfef0('0x1f')],'include':_0x316e20[_0xfef0('0x1d')]?_[_0xfef0('0x20')](_0x316e20[_0xfef0('0x1d')],function(_0x5df04f){return{'model':db[_0x5df04f[_0xfef0('0x1e')]],'as':_0x5df04f['as'],'attributes':_0x5df04f[_0xfef0('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a6758){logger[_0xfef0('0xd')](_0xfef0('0x18'),_0x581459);logger[_0xfef0('0x10')](_0xfef0('0x18'),_0x581459,JSON[_0xfef0('0x12')](_0x1a6758));_0x1642cd(_0x1a6758);})[_0xfef0('0x17')](function(_0x3e026a){logger[_0xfef0('0x13')](_0xfef0('0x18'),_0x3e026a[_0xfef0('0x15')],_0x581459);_0x1577fa(_0xd60678[_0xfef0('0x13')](0x1f4,_0x3e026a['message']));});});};exports[_0xfef0('0x21')]=function(_0x5806bd){var _0x4eaf74=this;return new Promise(function(_0x7d1692,_0x2ae54a){return db['ZohoAccount']['find']({'raw':_0x5806bd['options']?_0x5806bd['options']['raw']===undefined?!![]:![]:!![],'where':_0x5806bd[_0xfef0('0x1b')]?_0x5806bd[_0xfef0('0x1b')][_0xfef0('0x1c')]||null:null,'attributes':_0x5806bd['options']?_0x5806bd['options']['attributes']||null:null,'include':_0x5806bd[_0xfef0('0x1b')]?_0x5806bd['options'][_0xfef0('0x1d')]?_[_0xfef0('0x20')](_0x5806bd[_0xfef0('0x1b')]['include'],function(_0x3cad13){return{'model':db[_0x3cad13['model']],'as':_0x3cad13['as'],'attributes':_0x3cad13[_0xfef0('0x1f')],'include':_0x3cad13[_0xfef0('0x1d')]?_[_0xfef0('0x20')](_0x3cad13[_0xfef0('0x1d')],function(_0x3e1a64){return{'model':db[_0x3e1a64[_0xfef0('0x1e')]],'as':_0x3e1a64['as'],'attributes':_0x3e1a64[_0xfef0('0x1f')],'include':_0x3e1a64[_0xfef0('0x1d')]?_['map'](_0x3e1a64[_0xfef0('0x1d')],function(_0xea09ec){return{'model':db[_0xea09ec[_0xfef0('0x1e')]],'as':_0xea09ec['as'],'attributes':_0xea09ec[_0xfef0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfef0('0xc')](function(_0x262341){logger[_0xfef0('0xd')](_0xfef0('0x21'),_0x5806bd);logger[_0xfef0('0x10')](_0xfef0('0x21'),_0x5806bd,JSON[_0xfef0('0x12')](_0x262341));_0x7d1692(_0x262341);})[_0xfef0('0x17')](function(_0x366667){logger['error'](_0xfef0('0x21'),_0x366667['message'],_0x5806bd);_0x2ae54a(_0x4eaf74[_0xfef0('0x13')](0x1f4,_0x366667[_0xfef0('0x15')]));});});}; \ No newline at end of file +var _0x6b16=['error','code','message','result','ZohoAccount','options','where','attributes','limit','include','model','map','then','GetZohoAccount','debug','catch','ShowZohoAccount','raw','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x303064,_0x12f0c2){var _0x5a1d3d=function(_0x5b9d81){while(--_0x5b9d81){_0x303064['push'](_0x303064['shift']());}};_0x5a1d3d(++_0x12f0c2);}(_0x6b16,0x188));var _0x66b1=function(_0x338f73,_0x1945c8){_0x338f73=_0x338f73-0x0;var _0x163fdf=_0x6b16[_0x338f73];return _0x163fdf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x66b1('0x0'));var BPromise=require('bluebird');var rs=require(_0x66b1('0x1'));var fs=require('fs');var Redis=require(_0x66b1('0x2'));var db=require(_0x66b1('0x3'))['db'];var utils=require(_0x66b1('0x4'));var logger=require(_0x66b1('0x5'))(_0x66b1('0x6'));var config=require(_0x66b1('0x7'));var jayson=require(_0x66b1('0x8'));var client=jayson[_0x66b1('0x9')][_0x66b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x504d48,_0x4103c4,_0x413dde){return new BPromise(function(_0x1d62c8,_0x59c59f){return client['request'](_0x504d48,_0x413dde)['then'](function(_0x59334){logger[_0x66b1('0xb')](_0x66b1('0xc'),_0x4103c4,_0x66b1('0xd'));logger['debug'](_0x66b1('0xe'),_0x4103c4,_0x66b1('0xd'),JSON[_0x66b1('0xf')](_0x59334));if(_0x59334[_0x66b1('0x10')]){if(_0x59334[_0x66b1('0x10')][_0x66b1('0x11')]===0x1f4){logger[_0x66b1('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x4103c4,_0x59334['error'][_0x66b1('0x12')]);return _0x59c59f(_0x59334['error'][_0x66b1('0x12')]);}logger[_0x66b1('0x10')](_0x66b1('0xc'),_0x4103c4,_0x59334['error']['message']);return _0x1d62c8(_0x59334[_0x66b1('0x10')][_0x66b1('0x12')]);}else{logger[_0x66b1('0xb')](_0x66b1('0xc'),_0x4103c4,'request\x20sent');_0x1d62c8(_0x59334[_0x66b1('0x13')]['message']);}})['catch'](function(_0x47c430){logger[_0x66b1('0x10')](_0x66b1('0xc'),_0x4103c4,_0x47c430);_0x59c59f(_0x47c430);});});}exports['GetZohoAccount']=function(_0x1a381f){var _0x27ed10=this;return new Promise(function(_0x584b67,_0xc08b81){return db[_0x66b1('0x14')]['findAll']({'raw':_0x1a381f[_0x66b1('0x15')]?_0x1a381f[_0x66b1('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1a381f[_0x66b1('0x15')]?_0x1a381f[_0x66b1('0x15')][_0x66b1('0x16')]||null:null,'attributes':_0x1a381f[_0x66b1('0x15')]?_0x1a381f['options'][_0x66b1('0x17')]||null:null,'limit':_0x1a381f[_0x66b1('0x15')]?_0x1a381f[_0x66b1('0x15')][_0x66b1('0x18')]||null:null,'include':_0x1a381f['options']?_0x1a381f[_0x66b1('0x15')]['include']?_['map'](_0x1a381f[_0x66b1('0x15')][_0x66b1('0x19')],function(_0x558b0a){return{'model':db[_0x558b0a[_0x66b1('0x1a')]],'as':_0x558b0a['as'],'attributes':_0x558b0a['attributes'],'include':_0x558b0a[_0x66b1('0x19')]?_[_0x66b1('0x1b')](_0x558b0a[_0x66b1('0x19')],function(_0xa10ebf){return{'model':db[_0xa10ebf[_0x66b1('0x1a')]],'as':_0xa10ebf['as'],'attributes':_0xa10ebf['attributes'],'include':_0xa10ebf[_0x66b1('0x19')]?_[_0x66b1('0x1b')](_0xa10ebf['include'],function(_0x4487bb){return{'model':db[_0x4487bb[_0x66b1('0x1a')]],'as':_0x4487bb['as'],'attributes':_0x4487bb[_0x66b1('0x17')]};}):[]};}):[]};}):[]:[]})[_0x66b1('0x1c')](function(_0x1b4af7){logger[_0x66b1('0xb')](_0x66b1('0x1d'),_0x1a381f);logger[_0x66b1('0x1e')](_0x66b1('0x1d'),_0x1a381f,JSON[_0x66b1('0xf')](_0x1b4af7));_0x584b67(_0x1b4af7);})[_0x66b1('0x1f')](function(_0x3e838f){logger['error'](_0x66b1('0x1d'),_0x3e838f[_0x66b1('0x12')],_0x1a381f);_0xc08b81(_0x27ed10[_0x66b1('0x10')](0x1f4,_0x3e838f[_0x66b1('0x12')]));});});};exports[_0x66b1('0x20')]=function(_0x27b02b){var _0x5ec487=this;return new Promise(function(_0x291f65,_0xeac780){return db[_0x66b1('0x14')]['find']({'raw':_0x27b02b[_0x66b1('0x15')]?_0x27b02b[_0x66b1('0x15')][_0x66b1('0x21')]===undefined?!![]:![]:!![],'where':_0x27b02b[_0x66b1('0x15')]?_0x27b02b[_0x66b1('0x15')]['where']||null:null,'attributes':_0x27b02b['options']?_0x27b02b[_0x66b1('0x15')][_0x66b1('0x17')]||null:null,'include':_0x27b02b['options']?_0x27b02b[_0x66b1('0x15')][_0x66b1('0x19')]?_[_0x66b1('0x1b')](_0x27b02b[_0x66b1('0x15')][_0x66b1('0x19')],function(_0xd27272){return{'model':db[_0xd27272[_0x66b1('0x1a')]],'as':_0xd27272['as'],'attributes':_0xd27272[_0x66b1('0x17')],'include':_0xd27272['include']?_[_0x66b1('0x1b')](_0xd27272[_0x66b1('0x19')],function(_0x431877){return{'model':db[_0x431877[_0x66b1('0x1a')]],'as':_0x431877['as'],'attributes':_0x431877[_0x66b1('0x17')],'include':_0x431877[_0x66b1('0x19')]?_[_0x66b1('0x1b')](_0x431877['include'],function(_0x3fae7e){return{'model':db[_0x3fae7e[_0x66b1('0x1a')]],'as':_0x3fae7e['as'],'attributes':_0x3fae7e[_0x66b1('0x17')]};}):[]};}):[]};}):[]:[]})[_0x66b1('0x1c')](function(_0x3f13e0){logger[_0x66b1('0xb')](_0x66b1('0x20'),_0x27b02b);logger[_0x66b1('0x1e')](_0x66b1('0x20'),_0x27b02b,JSON[_0x66b1('0xf')](_0x3f13e0));_0x291f65(_0x3f13e0);})['catch'](function(_0x6f497b){logger[_0x66b1('0x10')](_0x66b1('0x20'),_0x6f497b[_0x66b1('0x12')],_0x27b02b);_0xeac780(_0x5ec487[_0x66b1('0x10')](0x1f4,_0x6f497b[_0x66b1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 347d4d4..e824caa 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 _0xbe22=['util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xbe22,0x1c1));var _0x2be2=function(_0x302558,_0x1ff6e9){_0x302558=_0x302558-0x0;var _0x5509e2=_0xbe22[_0x302558];return _0x5509e2;};'use strict';var multer=require(_0x2be2('0x0'));var util=require(_0x2be2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2be2('0x2'));var router=express[_0x2be2('0x3')]();var auth=require(_0x2be2('0x4'));var interaction=require(_0x2be2('0x5'));var config=require(_0x2be2('0x6'));var controller=require(_0x2be2('0x7'));router[_0x2be2('0x8')]('/',auth[_0x2be2('0x9')](),controller[_0x2be2('0xa')]);router[_0x2be2('0x8')]('/:id',auth[_0x2be2('0x9')](),controller[_0x2be2('0xb')]);router[_0x2be2('0x8')]('/:id/fields',auth[_0x2be2('0x9')](),controller[_0x2be2('0xc')]);router[_0x2be2('0x8')](_0x2be2('0xd'),auth[_0x2be2('0x9')](),controller[_0x2be2('0xe')]);router[_0x2be2('0x8')](_0x2be2('0xf'),auth['isAuthenticated'](),controller[_0x2be2('0x10')]);router[_0x2be2('0x11')]('/',auth['isAuthenticated'](),controller[_0x2be2('0x12')]);router[_0x2be2('0x13')](_0x2be2('0x14'),auth['isAuthenticated'](),controller[_0x2be2('0x15')]);router[_0x2be2('0x16')]('/:id',auth[_0x2be2('0x9')](),controller[_0x2be2('0x17')]);module[_0x2be2('0x18')]=router; \ No newline at end of file +var _0x925e=['getSubjects','/:id/descriptions','getDescriptions','post','put','/:id','update','delete','destroy','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id/subjects'];(function(_0x774200,_0x25e124){var _0xcd69c7=function(_0x426664){while(--_0x426664){_0x774200['push'](_0x774200['shift']());}};_0xcd69c7(++_0x25e124);}(_0x925e,0x199));var _0xe925=function(_0x279576,_0x3f860f){_0x279576=_0x279576-0x0;var _0x544f5f=_0x925e[_0x279576];return _0x544f5f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe925('0x0'));var timeout=require(_0xe925('0x1'));var express=require(_0xe925('0x2'));var router=express['Router']();var auth=require(_0xe925('0x3'));var interaction=require(_0xe925('0x4'));var config=require(_0xe925('0x5'));var controller=require(_0xe925('0x6'));router[_0xe925('0x7')]('/',auth[_0xe925('0x8')](),controller[_0xe925('0x9')]);router[_0xe925('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xe925('0x7')]('/:id/fields',auth[_0xe925('0x8')](),controller['getFields']);router[_0xe925('0x7')](_0xe925('0xa'),auth[_0xe925('0x8')](),controller[_0xe925('0xb')]);router[_0xe925('0x7')](_0xe925('0xc'),auth[_0xe925('0x8')](),controller[_0xe925('0xd')]);router[_0xe925('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe925('0xf')](_0xe925('0x10'),auth['isAuthenticated'](),controller[_0xe925('0x11')]);router[_0xe925('0x12')](_0xe925('0x10'),auth[_0xe925('0x8')](),controller[_0xe925('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 1bf19f8..01ca7d0 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 _0x2924=['exports','STRING','sequelize'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x2924,0x1dc));var _0x4292=function(_0x455150,_0x274121){_0x455150=_0x455150-0x0;var _0x12ca9c=_0x2924[_0x455150];return _0x12ca9c;};'use strict';var Sequelize=require(_0x4292('0x0'));module[_0x4292('0x1')]={'name':{'type':Sequelize[_0x4292('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x88f3=['exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x88f3,0x72));var _0x388f=function(_0x40af14,_0x28b2d1){_0x40af14=_0x40af14-0x0;var _0x47812a=_0x88f3[_0x40af14];return _0x47812a;};'use strict';var Sequelize=require('sequelize');module[_0x388f('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x388f('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index ed364ef..5d84b3a 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 _0xc776=['intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','find','create','body','params','getFields','findOne','nolimit','ZohoField','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','lodash','squel','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','request\x20sent','debug','stringify','error','message','ZohoConfiguration,\x20%s,\x20%s','result','catch','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','then','destroy','stack','name','send','index','ZohoConfiguration','rawAttributes','model','keys','query','attributes'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc776,0x126));var _0x6c77=function(_0x2fb86a,_0xbe0327){_0x2fb86a=_0x2fb86a-0x0;var _0x3683d8=_0xc776[_0x2fb86a];return _0x3683d8;};'use strict';var pdf=require(_0x6c77('0x0'));var emlformat=require(_0x6c77('0x1'));var rimraf=require(_0x6c77('0x2'));var zipdir=require(_0x6c77('0x3'));var jsonpatch=require(_0x6c77('0x4'));var rp=require(_0x6c77('0x5'));var moment=require('moment');var BPromise=require(_0x6c77('0x6'));var Mustache=require('mustache');var util=require(_0x6c77('0x7'));var path=require('path');var sox=require(_0x6c77('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6c77('0x9'));var squel=require(_0x6c77('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6c77('0xb'));var querystring=require(_0x6c77('0xc'));var Papa=require(_0x6c77('0xd'));var Redis=require('ioredis');var authService=require(_0x6c77('0xe'));var qs=require(_0x6c77('0xf'));var hardwareService=require(_0x6c77('0x10'));var logger=require(_0x6c77('0x11'))(_0x6c77('0x12'));var utils=require(_0x6c77('0x13'));var config=require(_0x6c77('0x14'));var db=require(_0x6c77('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x6c77('0x16')][_0x6c77('0x17')]({'port':0x232a});function checkPasswordPattern(_0x3a8043,_0x1754dc,_0x4c1033){if(_0x4c1033){var _0x254192=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x254192[_0x6c77('0x18')](_0x1754dc)){return _0x3a8043;}else{throw new Error(_0x6c77('0x19'));}}else{return _0x3a8043;}}function respondWithRpcPromise(_0x871e16,_0x152b74,_0x233a9e,_0x464bf3){return new BPromise(function(_0x38ffce,_0x4f24c9){var _0x58b43a=_0x464bf3||client;return _0x58b43a['request'](_0x871e16,_0x233a9e)['then'](function(_0x36bb8a){logger[_0x6c77('0x1a')]('ZohoConfiguration,\x20%s,\x20%s',_0x152b74,_0x6c77('0x1b'));logger[_0x6c77('0x1c')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x152b74,_0x6c77('0x1b'),JSON[_0x6c77('0x1d')](_0x36bb8a));if(_0x36bb8a['error']){if(_0x36bb8a[_0x6c77('0x1e')]['code']===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x152b74,_0x36bb8a['error'][_0x6c77('0x1f')]);return _0x4f24c9(_0x36bb8a[_0x6c77('0x1e')][_0x6c77('0x1f')]);}logger[_0x6c77('0x1e')](_0x6c77('0x20'),_0x152b74,_0x36bb8a[_0x6c77('0x1e')]['message']);return _0x38ffce(_0x36bb8a[_0x6c77('0x1e')]['message']);}else{logger['info'](_0x6c77('0x20'),_0x152b74,_0x6c77('0x1b'));_0x38ffce(_0x36bb8a[_0x6c77('0x21')][_0x6c77('0x1f')]);}})[_0x6c77('0x22')](function(_0x486aaa){logger[_0x6c77('0x1e')](_0x6c77('0x20'),_0x152b74,_0x486aaa);_0x4f24c9(_0x486aaa);});});}function respondWithStatusCode(_0x24768c,_0x129911){_0x129911=_0x129911||0xcc;return function(_0x5ba3e0){if(_0x5ba3e0){return _0x24768c[_0x6c77('0x23')](_0x129911);}return _0x24768c['status'](_0x129911)[_0x6c77('0x24')]();};}function respondWithResult(_0x4633db,_0x53c657){_0x53c657=_0x53c657||0xc8;return function(_0x55549d){if(_0x55549d){return _0x4633db[_0x6c77('0x25')](_0x53c657)[_0x6c77('0x26')](_0x55549d);}};}function respondWithFilteredResult(_0x577f2c,_0x42676d){return function(_0x4c666f){if(_0x4c666f){var _0xcd1b17=_0x4c666f[_0x6c77('0x27')],_0x20bf44=_0x42676d[_0x6c77('0x28')],_0x516cf4=_0x42676d[_0x6c77('0x28')]+_0x42676d[_0x6c77('0x29')],_0x3160ee;if(_0x516cf4>=_0xcd1b17){_0x516cf4=_0xcd1b17;_0x3160ee=0xc8;}else{_0x3160ee=0xce;}_0x577f2c[_0x6c77('0x25')](_0x3160ee);return _0x577f2c[_0x6c77('0x2a')]('Content-Range',_0x20bf44+'-'+_0x516cf4+'/'+_0xcd1b17)[_0x6c77('0x26')](_0x4c666f);}return null;};}function patchUpdates(_0x95dc3){return function(_0x3b38b2){try{jsonpatch[_0x6c77('0x2b')](_0x3b38b2,_0x95dc3,!![]);}catch(_0x4f26df){return BPromise[_0x6c77('0x2c')](_0x4f26df);}return _0x3b38b2[_0x6c77('0x2d')]();};}function saveUpdates(_0x4afda6,_0x572820){return function(_0x2fc0d2){if(_0x2fc0d2){return _0x2fc0d2['update'](_0x4afda6)[_0x6c77('0x2e')](function(_0x28e0ef){return _0x28e0ef;});}return null;};}function removeEntity(_0x523330,_0x1e04c8){return function(_0x316948){if(_0x316948){return _0x316948[_0x6c77('0x2f')]()[_0x6c77('0x2e')](function(){_0x523330[_0x6c77('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8f7048,_0x581c0e){return function(_0x12c7b0){if(!_0x12c7b0){_0x8f7048[_0x6c77('0x23')](0x194);}return _0x12c7b0;};}function handleError(_0x222eb5,_0x55f3e0){_0x55f3e0=_0x55f3e0||0x1f4;return function(_0x37a5e1){logger[_0x6c77('0x1e')](_0x37a5e1[_0x6c77('0x30')]);if(_0x37a5e1[_0x6c77('0x31')]){delete _0x37a5e1['name'];}_0x222eb5['status'](_0x55f3e0)[_0x6c77('0x32')](_0x37a5e1);};}exports[_0x6c77('0x33')]=function(_0x27e4cc,_0x22b112){var _0x10e68d={},_0x5b1d42={},_0x56c46b={'count':0x0,'rows':[]};var _0x12e523=db[_0x6c77('0x34')][_0x6c77('0x35')];_0x5b1d42[_0x6c77('0x36')]=_[_0x6c77('0x37')](_0x12e523);_0x5b1d42[_0x6c77('0x38')]=_[_0x6c77('0x37')](_0x27e4cc['query']);_0x5b1d42['filters']=_['intersection'](_0x5b1d42[_0x6c77('0x36')],_0x5b1d42[_0x6c77('0x38')]);_0x10e68d[_0x6c77('0x39')]=_[_0x6c77('0x3a')](_0x5b1d42[_0x6c77('0x36')],qs[_0x6c77('0x3b')](_0x27e4cc[_0x6c77('0x38')]['fields']));_0x10e68d[_0x6c77('0x39')]=_0x10e68d[_0x6c77('0x39')][_0x6c77('0x3c')]?_0x10e68d[_0x6c77('0x39')]:_0x5b1d42[_0x6c77('0x36')];if(!_0x27e4cc[_0x6c77('0x38')][_0x6c77('0x3d')]('nolimit')){_0x10e68d[_0x6c77('0x29')]=qs['limit'](_0x27e4cc[_0x6c77('0x38')][_0x6c77('0x29')]);_0x10e68d[_0x6c77('0x28')]=qs[_0x6c77('0x28')](_0x27e4cc[_0x6c77('0x38')][_0x6c77('0x28')]);}_0x10e68d[_0x6c77('0x3e')]=qs[_0x6c77('0x3f')](_0x27e4cc[_0x6c77('0x38')][_0x6c77('0x3f')]);_0x10e68d[_0x6c77('0x40')]=qs[_0x6c77('0x41')](_[_0x6c77('0x42')](_0x27e4cc[_0x6c77('0x38')],_0x5b1d42[_0x6c77('0x41')]));if(_0x27e4cc[_0x6c77('0x38')][_0x6c77('0x43')]){_0x10e68d[_0x6c77('0x40')]=_[_0x6c77('0x44')](_0x10e68d['where'],{'$or':_[_0x6c77('0x45')](_0x12e523,function(_0x24fbd0){if(_0x24fbd0[_0x6c77('0x46')]['key']!==_0x6c77('0x47')){var _0x4b90ef={};_0x4b90ef[_0x24fbd0[_0x6c77('0x48')]]={'$like':'%'+_0x27e4cc[_0x6c77('0x38')][_0x6c77('0x43')]+'%'};return _0x4b90ef;}})});}_0x10e68d=_[_0x6c77('0x44')]({},_0x10e68d,_0x27e4cc[_0x6c77('0x49')]);var _0x5afb2b={'where':_0x10e68d[_0x6c77('0x40')]};return db[_0x6c77('0x34')][_0x6c77('0x27')](_0x5afb2b)[_0x6c77('0x2e')](function(_0x967f5d){_0x56c46b[_0x6c77('0x27')]=_0x967f5d;if(_0x27e4cc[_0x6c77('0x38')][_0x6c77('0x4a')]){_0x10e68d[_0x6c77('0x4b')]=[{'all':!![]}];}return db[_0x6c77('0x34')][_0x6c77('0x4c')](_0x10e68d);})[_0x6c77('0x2e')](function(_0x154505){_0x56c46b[_0x6c77('0x4d')]=_0x154505;return _0x56c46b;})[_0x6c77('0x2e')](respondWithFilteredResult(_0x22b112,_0x10e68d))[_0x6c77('0x22')](handleError(_0x22b112,null));};exports['show']=function(_0x28cca5,_0x4b2763){var _0x39d5af={'raw':![],'where':{'id':_0x28cca5['params']['id']}},_0x21c631={};_0x21c631[_0x6c77('0x36')]=_[_0x6c77('0x37')](db[_0x6c77('0x34')][_0x6c77('0x35')]);_0x21c631[_0x6c77('0x38')]=_[_0x6c77('0x37')](_0x28cca5['query']);_0x21c631[_0x6c77('0x41')]=_[_0x6c77('0x3a')](_0x21c631[_0x6c77('0x36')],_0x21c631['query']);_0x39d5af[_0x6c77('0x39')]=_[_0x6c77('0x3a')](_0x21c631[_0x6c77('0x36')],qs[_0x6c77('0x3b')](_0x28cca5[_0x6c77('0x38')][_0x6c77('0x3b')]));_0x39d5af[_0x6c77('0x39')]=_0x39d5af[_0x6c77('0x39')][_0x6c77('0x3c')]?_0x39d5af['attributes']:_0x21c631[_0x6c77('0x36')];if(_0x28cca5[_0x6c77('0x38')][_0x6c77('0x4a')]){_0x39d5af[_0x6c77('0x4b')]=[{'all':!![]}];}_0x39d5af=_[_0x6c77('0x44')]({},_0x39d5af,_0x28cca5['options']);return db[_0x6c77('0x34')][_0x6c77('0x4e')](_0x39d5af)['then'](handleEntityNotFound(_0x4b2763,null))[_0x6c77('0x2e')](respondWithResult(_0x4b2763,null))[_0x6c77('0x22')](handleError(_0x4b2763,null));};exports[_0x6c77('0x4f')]=function(_0x2c0e78,_0x3f3c77){return db[_0x6c77('0x34')][_0x6c77('0x4f')](_0x2c0e78[_0x6c77('0x50')],{})[_0x6c77('0x2e')](respondWithResult(_0x3f3c77,0xc9))[_0x6c77('0x22')](handleError(_0x3f3c77,null));};exports['update']=function(_0x5e3367,_0x1d76d2){if(_0x5e3367['body']['id']){delete _0x5e3367[_0x6c77('0x50')]['id'];}return db[_0x6c77('0x34')][_0x6c77('0x4e')]({'where':{'id':_0x5e3367[_0x6c77('0x51')]['id']}})[_0x6c77('0x2e')](handleEntityNotFound(_0x1d76d2,null))[_0x6c77('0x2e')](saveUpdates(_0x5e3367[_0x6c77('0x50')],null))['then'](respondWithResult(_0x1d76d2,null))['catch'](handleError(_0x1d76d2,null));};exports[_0x6c77('0x2f')]=function(_0x14d889,_0x454aa6){return db['ZohoConfiguration'][_0x6c77('0x4e')]({'where':{'id':_0x14d889[_0x6c77('0x51')]['id']}})[_0x6c77('0x2e')](handleEntityNotFound(_0x454aa6,null))[_0x6c77('0x2e')](removeEntity(_0x454aa6,null))['catch'](handleError(_0x454aa6,null));};exports[_0x6c77('0x52')]=function(_0x159d30,_0x12190f,_0x3071d3){var _0x366bb6={};var _0x13a373={};var _0x19c41e;var _0x20ec6c;return db[_0x6c77('0x34')][_0x6c77('0x53')]({'where':{'id':_0x159d30[_0x6c77('0x51')]['id']}})[_0x6c77('0x2e')](handleEntityNotFound(_0x12190f,null))[_0x6c77('0x2e')](function(_0x583814){if(_0x583814){_0x19c41e=_0x583814;_0x13a373[_0x6c77('0x36')]=_['keys'](db['ZohoField'][_0x6c77('0x35')]);_0x13a373[_0x6c77('0x38')]=_[_0x6c77('0x37')](_0x159d30[_0x6c77('0x38')]);_0x13a373[_0x6c77('0x41')]=_[_0x6c77('0x3a')](_0x13a373[_0x6c77('0x36')],_0x13a373['query']);_0x366bb6['attributes']=_[_0x6c77('0x3a')](_0x13a373[_0x6c77('0x36')],qs[_0x6c77('0x3b')](_0x159d30[_0x6c77('0x38')][_0x6c77('0x3b')]));_0x366bb6[_0x6c77('0x39')]=_0x366bb6['attributes'][_0x6c77('0x3c')]?_0x366bb6['attributes']:_0x13a373[_0x6c77('0x36')];_0x366bb6[_0x6c77('0x3e')]=qs['sort'](_0x159d30[_0x6c77('0x38')]['sort']);_0x366bb6[_0x6c77('0x40')]=qs[_0x6c77('0x41')](_[_0x6c77('0x42')](_0x159d30[_0x6c77('0x38')],_0x13a373[_0x6c77('0x41')]));if(_0x159d30[_0x6c77('0x38')]['filter']){_0x366bb6['where']=_['merge'](_0x366bb6[_0x6c77('0x40')],{'$or':_[_0x6c77('0x45')](_0x366bb6[_0x6c77('0x39')],function(_0x16d81d){var _0x3e9446={};_0x3e9446[_0x16d81d]={'$like':'%'+_0x159d30['query'][_0x6c77('0x43')]+'%'};return _0x3e9446;})});}_0x366bb6=_[_0x6c77('0x44')]({},_0x366bb6,_0x159d30[_0x6c77('0x49')]);return _0x19c41e['getFields'](_0x366bb6);}})['then'](function(_0x4f34c4){if(_0x4f34c4){_0x20ec6c=_0x4f34c4[_0x6c77('0x3c')];if(!_0x159d30[_0x6c77('0x38')][_0x6c77('0x3d')](_0x6c77('0x54'))){_0x366bb6[_0x6c77('0x29')]=qs[_0x6c77('0x29')](_0x159d30[_0x6c77('0x38')][_0x6c77('0x29')]);_0x366bb6['offset']=qs[_0x6c77('0x28')](_0x159d30[_0x6c77('0x38')][_0x6c77('0x28')]);}return _0x19c41e[_0x6c77('0x52')](_0x366bb6);}})['then'](function(_0x3e12a9){if(_0x3e12a9){return _0x3e12a9?{'count':_0x20ec6c,'rows':_0x3e12a9}:null;}})[_0x6c77('0x2e')](respondWithResult(_0x12190f,null))[_0x6c77('0x22')](handleError(_0x12190f,null));};exports['getSubjects']=function(_0x27f46d,_0x4e57a5,_0x2aa3aa){var _0x24fb9f={};var _0x3ee68c={};var _0x2e871c;var _0x346194;return db[_0x6c77('0x34')][_0x6c77('0x53')]({'where':{'id':_0x27f46d[_0x6c77('0x51')]['id']}})[_0x6c77('0x2e')](handleEntityNotFound(_0x4e57a5,null))[_0x6c77('0x2e')](function(_0x115d86){if(_0x115d86){_0x2e871c=_0x115d86;_0x3ee68c[_0x6c77('0x36')]=_['keys'](db[_0x6c77('0x55')][_0x6c77('0x35')]);_0x3ee68c['query']=_[_0x6c77('0x37')](_0x27f46d[_0x6c77('0x38')]);_0x3ee68c['filters']=_[_0x6c77('0x3a')](_0x3ee68c[_0x6c77('0x36')],_0x3ee68c['query']);_0x24fb9f[_0x6c77('0x39')]=_[_0x6c77('0x3a')](_0x3ee68c[_0x6c77('0x36')],qs[_0x6c77('0x3b')](_0x27f46d[_0x6c77('0x38')]['fields']));_0x24fb9f[_0x6c77('0x39')]=_0x24fb9f[_0x6c77('0x39')][_0x6c77('0x3c')]?_0x24fb9f[_0x6c77('0x39')]:_0x3ee68c[_0x6c77('0x36')];_0x24fb9f[_0x6c77('0x3e')]=qs[_0x6c77('0x3f')](_0x27f46d['query'][_0x6c77('0x3f')]);_0x24fb9f[_0x6c77('0x40')]=qs['filters'](_[_0x6c77('0x42')](_0x27f46d[_0x6c77('0x38')],_0x3ee68c[_0x6c77('0x41')]));if(_0x27f46d[_0x6c77('0x38')]['filter']){_0x24fb9f['where']=_[_0x6c77('0x44')](_0x24fb9f[_0x6c77('0x40')],{'$or':_[_0x6c77('0x45')](_0x24fb9f[_0x6c77('0x39')],function(_0x4a6b82){var _0x14a5d2={};_0x14a5d2[_0x4a6b82]={'$like':'%'+_0x27f46d[_0x6c77('0x38')][_0x6c77('0x43')]+'%'};return _0x14a5d2;})});}_0x24fb9f=_[_0x6c77('0x44')]({},_0x24fb9f,_0x27f46d[_0x6c77('0x49')]);return _0x2e871c[_0x6c77('0x56')](_0x24fb9f);}})[_0x6c77('0x2e')](function(_0x216590){if(_0x216590){_0x346194=_0x216590[_0x6c77('0x3c')];if(!_0x27f46d[_0x6c77('0x38')][_0x6c77('0x3d')](_0x6c77('0x54'))){_0x24fb9f[_0x6c77('0x29')]=qs[_0x6c77('0x29')](_0x27f46d[_0x6c77('0x38')]['limit']);_0x24fb9f[_0x6c77('0x28')]=qs[_0x6c77('0x28')](_0x27f46d[_0x6c77('0x38')][_0x6c77('0x28')]);}return _0x2e871c[_0x6c77('0x56')](_0x24fb9f);}})['then'](function(_0x50f243){if(_0x50f243){return _0x50f243?{'count':_0x346194,'rows':_0x50f243}:null;}})[_0x6c77('0x2e')](respondWithResult(_0x4e57a5,null))[_0x6c77('0x22')](handleError(_0x4e57a5,null));};exports['getDescriptions']=function(_0x56e51c,_0x21967e,_0x2f4548){var _0x53f778={};var _0x4607b7={};var _0xc4971c;var _0x356996;return db['ZohoConfiguration'][_0x6c77('0x53')]({'where':{'id':_0x56e51c[_0x6c77('0x51')]['id']}})[_0x6c77('0x2e')](handleEntityNotFound(_0x21967e,null))[_0x6c77('0x2e')](function(_0x3539c2){if(_0x3539c2){_0xc4971c=_0x3539c2;_0x4607b7[_0x6c77('0x36')]=_['keys'](db['ZohoField'][_0x6c77('0x35')]);_0x4607b7[_0x6c77('0x38')]=_[_0x6c77('0x37')](_0x56e51c[_0x6c77('0x38')]);_0x4607b7['filters']=_[_0x6c77('0x3a')](_0x4607b7[_0x6c77('0x36')],_0x4607b7[_0x6c77('0x38')]);_0x53f778['attributes']=_[_0x6c77('0x3a')](_0x4607b7[_0x6c77('0x36')],qs['fields'](_0x56e51c['query']['fields']));_0x53f778[_0x6c77('0x39')]=_0x53f778['attributes'][_0x6c77('0x3c')]?_0x53f778['attributes']:_0x4607b7['model'];_0x53f778['order']=qs[_0x6c77('0x3f')](_0x56e51c[_0x6c77('0x38')][_0x6c77('0x3f')]);_0x53f778[_0x6c77('0x40')]=qs[_0x6c77('0x41')](_[_0x6c77('0x42')](_0x56e51c[_0x6c77('0x38')],_0x4607b7[_0x6c77('0x41')]));if(_0x56e51c['query']['filter']){_0x53f778['where']=_[_0x6c77('0x44')](_0x53f778['where'],{'$or':_['map'](_0x53f778[_0x6c77('0x39')],function(_0x574eb6){var _0x1c500a={};_0x1c500a[_0x574eb6]={'$like':'%'+_0x56e51c['query'][_0x6c77('0x43')]+'%'};return _0x1c500a;})});}_0x53f778=_[_0x6c77('0x44')]({},_0x53f778,_0x56e51c[_0x6c77('0x49')]);return _0xc4971c[_0x6c77('0x57')](_0x53f778);}})[_0x6c77('0x2e')](function(_0x171cd1){if(_0x171cd1){_0x356996=_0x171cd1[_0x6c77('0x3c')];if(!_0x56e51c['query'][_0x6c77('0x3d')](_0x6c77('0x54'))){_0x53f778[_0x6c77('0x29')]=qs[_0x6c77('0x29')](_0x56e51c[_0x6c77('0x38')][_0x6c77('0x29')]);_0x53f778[_0x6c77('0x28')]=qs[_0x6c77('0x28')](_0x56e51c[_0x6c77('0x38')][_0x6c77('0x28')]);}return _0xc4971c['getDescriptions'](_0x53f778);}})[_0x6c77('0x2e')](function(_0x198166){if(_0x198166){return _0x198166?{'count':_0x356996,'rows':_0x198166}:null;}})['then'](respondWithResult(_0x21967e,null))[_0x6c77('0x22')](handleError(_0x21967e,null));}; \ No newline at end of file +var _0xec0f=['set','reject','update','destroy','end','stack','name','send','ZohoConfiguration','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','map','type','key','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','getFields','findOne','ZohoField','sort','rawAttributes','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','moment','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/environment','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','json','count','offset','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xec0f,0x18a));var _0xfec0=function(_0xf3fd60,_0x37946c){_0xf3fd60=_0xf3fd60-0x0;var _0x3d6b5d=_0xec0f[_0xf3fd60];return _0x3d6b5d;};'use strict';var pdf=require(_0xfec0('0x0'));var emlformat=require(_0xfec0('0x1'));var rimraf=require(_0xfec0('0x2'));var zipdir=require(_0xfec0('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfec0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfec0('0x5'));var util=require('util');var path=require(_0xfec0('0x6'));var sox=require(_0xfec0('0x7'));var csv=require(_0xfec0('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfec0('0x9'));var squel=require(_0xfec0('0xa'));var crypto=require(_0xfec0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfec0('0xc'));var toCsv=require(_0xfec0('0x8'));var querystring=require(_0xfec0('0xd'));var Papa=require(_0xfec0('0xe'));var Redis=require(_0xfec0('0xf'));var authService=require(_0xfec0('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfec0('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xfec0('0x12'));var db=require(_0xfec0('0x13'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xfec0('0x14')][_0xfec0('0x15')]({'port':0x232a});function checkPasswordPattern(_0x2b59d7,_0x1c2440,_0xb4e9b){if(_0xb4e9b){var _0x371b3d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x371b3d[_0xfec0('0x16')](_0x1c2440)){return _0x2b59d7;}else{throw new Error(_0xfec0('0x17'));}}else{return _0x2b59d7;}}function respondWithRpcPromise(_0x18fa86,_0x120dc3,_0x13e484,_0xbe49f3){return new BPromise(function(_0x5cd4c3,_0x1aab8d){var _0x3d8d27=_0xbe49f3||client;return _0x3d8d27[_0xfec0('0x18')](_0x18fa86,_0x13e484)[_0xfec0('0x19')](function(_0x4596ab){logger['info'](_0xfec0('0x1a'),_0x120dc3,_0xfec0('0x1b'));logger['debug'](_0xfec0('0x1c'),_0x120dc3,_0xfec0('0x1b'),JSON[_0xfec0('0x1d')](_0x4596ab));if(_0x4596ab[_0xfec0('0x1e')]){if(_0x4596ab[_0xfec0('0x1e')][_0xfec0('0x1f')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x120dc3,_0x4596ab[_0xfec0('0x1e')][_0xfec0('0x20')]);return _0x1aab8d(_0x4596ab[_0xfec0('0x1e')]['message']);}logger[_0xfec0('0x1e')]('ZohoConfiguration,\x20%s,\x20%s',_0x120dc3,_0x4596ab['error'][_0xfec0('0x20')]);return _0x5cd4c3(_0x4596ab[_0xfec0('0x1e')]['message']);}else{logger[_0xfec0('0x21')](_0xfec0('0x1a'),_0x120dc3,_0xfec0('0x1b'));_0x5cd4c3(_0x4596ab[_0xfec0('0x22')]['message']);}})['catch'](function(_0x4519e5){logger[_0xfec0('0x1e')](_0xfec0('0x1a'),_0x120dc3,_0x4519e5);_0x1aab8d(_0x4519e5);});});}function respondWithStatusCode(_0x43bfcf,_0x45f459){_0x45f459=_0x45f459||0xcc;return function(_0x35d36c){if(_0x35d36c){return _0x43bfcf[_0xfec0('0x23')](_0x45f459);}return _0x43bfcf[_0xfec0('0x24')](_0x45f459)['end']();};}function respondWithResult(_0x19ecc7,_0xed6920){_0xed6920=_0xed6920||0xc8;return function(_0xae846f){if(_0xae846f){return _0x19ecc7[_0xfec0('0x24')](_0xed6920)[_0xfec0('0x25')](_0xae846f);}};}function respondWithFilteredResult(_0x347480,_0x33891d){return function(_0x31e247){if(_0x31e247){var _0x9b43c2=_0x31e247[_0xfec0('0x26')],_0x2dc2b0=_0x33891d[_0xfec0('0x27')],_0x3cb0ef=_0x33891d['offset']+_0x33891d[_0xfec0('0x28')],_0x526c06;if(_0x3cb0ef>=_0x9b43c2){_0x3cb0ef=_0x9b43c2;_0x526c06=0xc8;}else{_0x526c06=0xce;}_0x347480[_0xfec0('0x24')](_0x526c06);return _0x347480[_0xfec0('0x29')]('Content-Range',_0x2dc2b0+'-'+_0x3cb0ef+'/'+_0x9b43c2)[_0xfec0('0x25')](_0x31e247);}return null;};}function patchUpdates(_0x5bc254){return function(_0x307462){try{jsonpatch['apply'](_0x307462,_0x5bc254,!![]);}catch(_0x20d4a2){return BPromise[_0xfec0('0x2a')](_0x20d4a2);}return _0x307462['save']();};}function saveUpdates(_0x1171b7,_0x553d65){return function(_0x54c0c7){if(_0x54c0c7){return _0x54c0c7[_0xfec0('0x2b')](_0x1171b7)[_0xfec0('0x19')](function(_0x155c07){return _0x155c07;});}return null;};}function removeEntity(_0x12fd0c,_0x5e6ed0){return function(_0x160b0d){if(_0x160b0d){return _0x160b0d[_0xfec0('0x2c')]()['then'](function(){_0x12fd0c[_0xfec0('0x24')](0xcc)[_0xfec0('0x2d')]();});}};}function handleEntityNotFound(_0x32e9f2,_0x173589){return function(_0x1f59cd){if(!_0x1f59cd){_0x32e9f2[_0xfec0('0x23')](0x194);}return _0x1f59cd;};}function handleError(_0x30b132,_0x33daf7){_0x33daf7=_0x33daf7||0x1f4;return function(_0x5d871c){logger[_0xfec0('0x1e')](_0x5d871c[_0xfec0('0x2e')]);if(_0x5d871c[_0xfec0('0x2f')]){delete _0x5d871c[_0xfec0('0x2f')];}_0x30b132['status'](_0x33daf7)[_0xfec0('0x30')](_0x5d871c);};}exports['index']=function(_0x3b1136,_0x2aecd1){var _0x2a31ce={},_0x1fedf0={},_0x4c4cca={'count':0x0,'rows':[]};var _0x3c788f=db[_0xfec0('0x31')]['rawAttributes'];_0x1fedf0[_0xfec0('0x32')]=_['keys'](_0x3c788f);_0x1fedf0[_0xfec0('0x33')]=_[_0xfec0('0x34')](_0x3b1136[_0xfec0('0x33')]);_0x1fedf0[_0xfec0('0x35')]=_[_0xfec0('0x36')](_0x1fedf0[_0xfec0('0x32')],_0x1fedf0[_0xfec0('0x33')]);_0x2a31ce[_0xfec0('0x37')]=_['intersection'](_0x1fedf0[_0xfec0('0x32')],qs[_0xfec0('0x38')](_0x3b1136[_0xfec0('0x33')]['fields']));_0x2a31ce[_0xfec0('0x37')]=_0x2a31ce[_0xfec0('0x37')][_0xfec0('0x39')]?_0x2a31ce['attributes']:_0x1fedf0['model'];if(!_0x3b1136[_0xfec0('0x33')][_0xfec0('0x3a')](_0xfec0('0x3b'))){_0x2a31ce[_0xfec0('0x28')]=qs[_0xfec0('0x28')](_0x3b1136[_0xfec0('0x33')]['limit']);_0x2a31ce[_0xfec0('0x27')]=qs[_0xfec0('0x27')](_0x3b1136[_0xfec0('0x33')]['offset']);}_0x2a31ce[_0xfec0('0x3c')]=qs['sort'](_0x3b1136[_0xfec0('0x33')]['sort']);_0x2a31ce[_0xfec0('0x3d')]=qs[_0xfec0('0x35')](_[_0xfec0('0x3e')](_0x3b1136[_0xfec0('0x33')],_0x1fedf0[_0xfec0('0x35')]));if(_0x3b1136[_0xfec0('0x33')]['filter']){_0x2a31ce[_0xfec0('0x3d')]=_[_0xfec0('0x3f')](_0x2a31ce['where'],{'$or':_[_0xfec0('0x40')](_0x3c788f,function(_0x2348f1){if(_0x2348f1[_0xfec0('0x41')][_0xfec0('0x42')]!==_0xfec0('0x43')){var _0x24193c={};_0x24193c[_0x2348f1['field']]={'$like':'%'+_0x3b1136[_0xfec0('0x33')][_0xfec0('0x44')]+'%'};return _0x24193c;}})});}_0x2a31ce=_[_0xfec0('0x3f')]({},_0x2a31ce,_0x3b1136['options']);var _0x31ecd6={'where':_0x2a31ce[_0xfec0('0x3d')]};return db[_0xfec0('0x31')][_0xfec0('0x26')](_0x31ecd6)[_0xfec0('0x19')](function(_0x1c62a3){_0x4c4cca[_0xfec0('0x26')]=_0x1c62a3;if(_0x3b1136[_0xfec0('0x33')][_0xfec0('0x45')]){_0x2a31ce[_0xfec0('0x46')]=[{'all':!![]}];}return db[_0xfec0('0x31')][_0xfec0('0x47')](_0x2a31ce);})['then'](function(_0x32969c){_0x4c4cca[_0xfec0('0x48')]=_0x32969c;return _0x4c4cca;})[_0xfec0('0x19')](respondWithFilteredResult(_0x2aecd1,_0x2a31ce))[_0xfec0('0x49')](handleError(_0x2aecd1,null));};exports[_0xfec0('0x4a')]=function(_0x194f79,_0x154d32){var _0x272304={'raw':![],'where':{'id':_0x194f79[_0xfec0('0x4b')]['id']}},_0xf335b8={};_0xf335b8[_0xfec0('0x32')]=_[_0xfec0('0x34')](db[_0xfec0('0x31')]['rawAttributes']);_0xf335b8[_0xfec0('0x33')]=_[_0xfec0('0x34')](_0x194f79[_0xfec0('0x33')]);_0xf335b8[_0xfec0('0x35')]=_[_0xfec0('0x36')](_0xf335b8['model'],_0xf335b8[_0xfec0('0x33')]);_0x272304[_0xfec0('0x37')]=_[_0xfec0('0x36')](_0xf335b8[_0xfec0('0x32')],qs[_0xfec0('0x38')](_0x194f79['query'][_0xfec0('0x38')]));_0x272304[_0xfec0('0x37')]=_0x272304[_0xfec0('0x37')]['length']?_0x272304['attributes']:_0xf335b8[_0xfec0('0x32')];if(_0x194f79[_0xfec0('0x33')][_0xfec0('0x45')]){_0x272304[_0xfec0('0x46')]=[{'all':!![]}];}_0x272304=_['merge']({},_0x272304,_0x194f79[_0xfec0('0x4c')]);return db[_0xfec0('0x31')][_0xfec0('0x4d')](_0x272304)['then'](handleEntityNotFound(_0x154d32,null))[_0xfec0('0x19')](respondWithResult(_0x154d32,null))['catch'](handleError(_0x154d32,null));};exports[_0xfec0('0x4e')]=function(_0x1bd852,_0xdf0140){return db[_0xfec0('0x31')][_0xfec0('0x4e')](_0x1bd852[_0xfec0('0x4f')],{})[_0xfec0('0x19')](respondWithResult(_0xdf0140,0xc9))[_0xfec0('0x49')](handleError(_0xdf0140,null));};exports[_0xfec0('0x2b')]=function(_0x548fa9,_0x42383d){if(_0x548fa9[_0xfec0('0x4f')]['id']){delete _0x548fa9[_0xfec0('0x4f')]['id'];}return db[_0xfec0('0x31')][_0xfec0('0x4d')]({'where':{'id':_0x548fa9[_0xfec0('0x4b')]['id']}})[_0xfec0('0x19')](handleEntityNotFound(_0x42383d,null))[_0xfec0('0x19')](saveUpdates(_0x548fa9[_0xfec0('0x4f')],null))[_0xfec0('0x19')](respondWithResult(_0x42383d,null))[_0xfec0('0x49')](handleError(_0x42383d,null));};exports[_0xfec0('0x2c')]=function(_0x15c941,_0x4e0385){return db[_0xfec0('0x31')]['find']({'where':{'id':_0x15c941['params']['id']}})['then'](handleEntityNotFound(_0x4e0385,null))[_0xfec0('0x19')](removeEntity(_0x4e0385,null))['catch'](handleError(_0x4e0385,null));};exports[_0xfec0('0x50')]=function(_0xa4cc1b,_0x1ab891,_0x5178ed){var _0x149655={};var _0x3ebf41={};var _0x155017;var _0x11f925;return db[_0xfec0('0x31')][_0xfec0('0x51')]({'where':{'id':_0xa4cc1b[_0xfec0('0x4b')]['id']}})[_0xfec0('0x19')](handleEntityNotFound(_0x1ab891,null))[_0xfec0('0x19')](function(_0x21dc3b){if(_0x21dc3b){_0x155017=_0x21dc3b;_0x3ebf41['model']=_[_0xfec0('0x34')](db[_0xfec0('0x52')]['rawAttributes']);_0x3ebf41[_0xfec0('0x33')]=_[_0xfec0('0x34')](_0xa4cc1b[_0xfec0('0x33')]);_0x3ebf41[_0xfec0('0x35')]=_['intersection'](_0x3ebf41['model'],_0x3ebf41[_0xfec0('0x33')]);_0x149655[_0xfec0('0x37')]=_[_0xfec0('0x36')](_0x3ebf41['model'],qs[_0xfec0('0x38')](_0xa4cc1b[_0xfec0('0x33')]['fields']));_0x149655[_0xfec0('0x37')]=_0x149655[_0xfec0('0x37')][_0xfec0('0x39')]?_0x149655['attributes']:_0x3ebf41[_0xfec0('0x32')];_0x149655[_0xfec0('0x3c')]=qs[_0xfec0('0x53')](_0xa4cc1b[_0xfec0('0x33')][_0xfec0('0x53')]);_0x149655[_0xfec0('0x3d')]=qs[_0xfec0('0x35')](_['pick'](_0xa4cc1b[_0xfec0('0x33')],_0x3ebf41['filters']));if(_0xa4cc1b[_0xfec0('0x33')][_0xfec0('0x44')]){_0x149655[_0xfec0('0x3d')]=_['merge'](_0x149655[_0xfec0('0x3d')],{'$or':_[_0xfec0('0x40')](_0x149655[_0xfec0('0x37')],function(_0x5ad0ce){var _0x298d61={};_0x298d61[_0x5ad0ce]={'$like':'%'+_0xa4cc1b['query'][_0xfec0('0x44')]+'%'};return _0x298d61;})});}_0x149655=_[_0xfec0('0x3f')]({},_0x149655,_0xa4cc1b[_0xfec0('0x4c')]);return _0x155017['getFields'](_0x149655);}})['then'](function(_0x10ce64){if(_0x10ce64){_0x11f925=_0x10ce64[_0xfec0('0x39')];if(!_0xa4cc1b[_0xfec0('0x33')]['hasOwnProperty'](_0xfec0('0x3b'))){_0x149655[_0xfec0('0x28')]=qs[_0xfec0('0x28')](_0xa4cc1b['query'][_0xfec0('0x28')]);_0x149655[_0xfec0('0x27')]=qs[_0xfec0('0x27')](_0xa4cc1b['query'][_0xfec0('0x27')]);}return _0x155017[_0xfec0('0x50')](_0x149655);}})[_0xfec0('0x19')](function(_0x4c8c5a){if(_0x4c8c5a){return _0x4c8c5a?{'count':_0x11f925,'rows':_0x4c8c5a}:null;}})[_0xfec0('0x19')](respondWithResult(_0x1ab891,null))[_0xfec0('0x49')](handleError(_0x1ab891,null));};exports['getSubjects']=function(_0x3d9617,_0x3fa220,_0x335c01){var _0x257013={};var _0x589d20={};var _0x3c6734;var _0x532eba;return db[_0xfec0('0x31')][_0xfec0('0x51')]({'where':{'id':_0x3d9617[_0xfec0('0x4b')]['id']}})[_0xfec0('0x19')](handleEntityNotFound(_0x3fa220,null))[_0xfec0('0x19')](function(_0x426e2b){if(_0x426e2b){_0x3c6734=_0x426e2b;_0x589d20[_0xfec0('0x32')]=_['keys'](db[_0xfec0('0x52')][_0xfec0('0x54')]);_0x589d20['query']=_[_0xfec0('0x34')](_0x3d9617[_0xfec0('0x33')]);_0x589d20[_0xfec0('0x35')]=_[_0xfec0('0x36')](_0x589d20[_0xfec0('0x32')],_0x589d20[_0xfec0('0x33')]);_0x257013[_0xfec0('0x37')]=_[_0xfec0('0x36')](_0x589d20[_0xfec0('0x32')],qs['fields'](_0x3d9617[_0xfec0('0x33')][_0xfec0('0x38')]));_0x257013[_0xfec0('0x37')]=_0x257013[_0xfec0('0x37')][_0xfec0('0x39')]?_0x257013[_0xfec0('0x37')]:_0x589d20['model'];_0x257013[_0xfec0('0x3c')]=qs[_0xfec0('0x53')](_0x3d9617[_0xfec0('0x33')][_0xfec0('0x53')]);_0x257013[_0xfec0('0x3d')]=qs[_0xfec0('0x35')](_['pick'](_0x3d9617[_0xfec0('0x33')],_0x589d20[_0xfec0('0x35')]));if(_0x3d9617[_0xfec0('0x33')][_0xfec0('0x44')]){_0x257013['where']=_['merge'](_0x257013[_0xfec0('0x3d')],{'$or':_[_0xfec0('0x40')](_0x257013[_0xfec0('0x37')],function(_0x1409af){var _0x568368={};_0x568368[_0x1409af]={'$like':'%'+_0x3d9617[_0xfec0('0x33')][_0xfec0('0x44')]+'%'};return _0x568368;})});}_0x257013=_[_0xfec0('0x3f')]({},_0x257013,_0x3d9617['options']);return _0x3c6734['getSubjects'](_0x257013);}})[_0xfec0('0x19')](function(_0x4d2d70){if(_0x4d2d70){_0x532eba=_0x4d2d70[_0xfec0('0x39')];if(!_0x3d9617[_0xfec0('0x33')][_0xfec0('0x3a')](_0xfec0('0x3b'))){_0x257013[_0xfec0('0x28')]=qs['limit'](_0x3d9617[_0xfec0('0x33')][_0xfec0('0x28')]);_0x257013[_0xfec0('0x27')]=qs[_0xfec0('0x27')](_0x3d9617[_0xfec0('0x33')][_0xfec0('0x27')]);}return _0x3c6734[_0xfec0('0x55')](_0x257013);}})[_0xfec0('0x19')](function(_0x4053f8){if(_0x4053f8){return _0x4053f8?{'count':_0x532eba,'rows':_0x4053f8}:null;}})[_0xfec0('0x19')](respondWithResult(_0x3fa220,null))[_0xfec0('0x49')](handleError(_0x3fa220,null));};exports[_0xfec0('0x56')]=function(_0x1d1ea0,_0x57ddb1,_0x166d13){var _0x259875={};var _0x505bb6={};var _0xec480d;var _0x52b407;return db[_0xfec0('0x31')]['findOne']({'where':{'id':_0x1d1ea0['params']['id']}})[_0xfec0('0x19')](handleEntityNotFound(_0x57ddb1,null))[_0xfec0('0x19')](function(_0x362d85){if(_0x362d85){_0xec480d=_0x362d85;_0x505bb6[_0xfec0('0x32')]=_[_0xfec0('0x34')](db['ZohoField'][_0xfec0('0x54')]);_0x505bb6['query']=_['keys'](_0x1d1ea0[_0xfec0('0x33')]);_0x505bb6[_0xfec0('0x35')]=_['intersection'](_0x505bb6['model'],_0x505bb6[_0xfec0('0x33')]);_0x259875[_0xfec0('0x37')]=_[_0xfec0('0x36')](_0x505bb6['model'],qs[_0xfec0('0x38')](_0x1d1ea0[_0xfec0('0x33')]['fields']));_0x259875['attributes']=_0x259875[_0xfec0('0x37')][_0xfec0('0x39')]?_0x259875[_0xfec0('0x37')]:_0x505bb6[_0xfec0('0x32')];_0x259875[_0xfec0('0x3c')]=qs[_0xfec0('0x53')](_0x1d1ea0[_0xfec0('0x33')]['sort']);_0x259875[_0xfec0('0x3d')]=qs[_0xfec0('0x35')](_[_0xfec0('0x3e')](_0x1d1ea0[_0xfec0('0x33')],_0x505bb6[_0xfec0('0x35')]));if(_0x1d1ea0['query'][_0xfec0('0x44')]){_0x259875[_0xfec0('0x3d')]=_['merge'](_0x259875[_0xfec0('0x3d')],{'$or':_[_0xfec0('0x40')](_0x259875[_0xfec0('0x37')],function(_0x23102c){var _0x41c5cb={};_0x41c5cb[_0x23102c]={'$like':'%'+_0x1d1ea0[_0xfec0('0x33')][_0xfec0('0x44')]+'%'};return _0x41c5cb;})});}_0x259875=_['merge']({},_0x259875,_0x1d1ea0[_0xfec0('0x4c')]);return _0xec480d['getDescriptions'](_0x259875);}})[_0xfec0('0x19')](function(_0x4219ef){if(_0x4219ef){_0x52b407=_0x4219ef['length'];if(!_0x1d1ea0[_0xfec0('0x33')][_0xfec0('0x3a')]('nolimit')){_0x259875[_0xfec0('0x28')]=qs['limit'](_0x1d1ea0[_0xfec0('0x33')][_0xfec0('0x28')]);_0x259875['offset']=qs[_0xfec0('0x27')](_0x1d1ea0[_0xfec0('0x33')]['offset']);}return _0xec480d[_0xfec0('0x56')](_0x259875);}})[_0xfec0('0x19')](function(_0x2009d5){if(_0x2009d5){return _0x2009d5?{'count':_0x52b407,'rows':_0x2009d5}:null;}})['then'](respondWithResult(_0x57ddb1,null))[_0xfec0('0x49')](handleError(_0x57ddb1,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index b244c66..5158160 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 _0x2547=['rimraf','./intZohoConfiguration.attributes','exports','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x237120,_0x2e7c40){var _0x5d7957=function(_0x54c43d){while(--_0x54c43d){_0x237120['push'](_0x237120['shift']());}};_0x5d7957(++_0x2e7c40);}(_0x2547,0x1cd));var _0x7254=function(_0x24c819,_0x434e42){_0x24c819=_0x24c819-0x0;var _0x546c3b=_0x2547[_0x24c819];return _0x546c3b;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var logger=require(_0x7254('0x1'))(_0x7254('0x2'));var moment=require(_0x7254('0x3'));var BPromise=require(_0x7254('0x4'));var rp=require(_0x7254('0x5'));var fs=require('fs');var path=require(_0x7254('0x6'));var rimraf=require(_0x7254('0x7'));var config=require('../../config/environment');var attributes=require(_0x7254('0x8'));module[_0x7254('0x9')]=function(_0x67f427,_0x119f66){return _0x67f427['define'](_0x7254('0xa'),attributes,{'tableName':_0x7254('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb62e=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','define','int_zoho_configurations','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb62e,0x1de));var _0xeb62=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xb62e[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var logger=require(_0xeb62('0x2'))(_0xeb62('0x3'));var moment=require('moment');var BPromise=require(_0xeb62('0x4'));var rp=require(_0xeb62('0x5'));var fs=require('fs');var path=require(_0xeb62('0x6'));var rimraf=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var attributes=require(_0xeb62('0x9'));module['exports']=function(_0x3ec879,_0x455e1a){return _0x3ec879[_0xeb62('0xa')]('ZohoConfiguration',attributes,{'tableName':_0xeb62('0xb'),'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 a3f8313..eff2def 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 _0xe783=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0xfcc029,_0x23bb00){var _0x2b838b=function(_0x55cf7b){while(--_0x55cf7b){_0xfcc029['push'](_0xfcc029['shift']());}};_0x2b838b(++_0x23bb00);}(_0xe783,0x182));var _0x3e78=function(_0x224340,_0x9108bc){_0x224340=_0x224340-0x0;var _0x39b0c6=_0xe783[_0x224340];return _0x39b0c6;};'use strict';var _=require('lodash');var util=require(_0x3e78('0x0'));var moment=require(_0x3e78('0x1'));var BPromise=require(_0x3e78('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e78('0x3'));var db=require(_0x3e78('0x4'))['db'];var utils=require(_0x3e78('0x5'));var logger=require(_0x3e78('0x6'))(_0x3e78('0x7'));var config=require(_0x3e78('0x8'));var jayson=require(_0x3e78('0x9'));var client=jayson[_0x3e78('0xa')][_0x3e78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c6b90,_0x3a2695,_0x551939){return new BPromise(function(_0xdf6c51,_0x251fbb){return client[_0x3e78('0xc')](_0x4c6b90,_0x551939)[_0x3e78('0xd')](function(_0x504f1d){logger[_0x3e78('0xe')](_0x3e78('0xf'),_0x3a2695,_0x3e78('0x10'));logger[_0x3e78('0x11')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3a2695,_0x3e78('0x10'),JSON[_0x3e78('0x12')](_0x504f1d));if(_0x504f1d[_0x3e78('0x13')]){if(_0x504f1d['error']['code']===0x1f4){logger[_0x3e78('0x13')](_0x3e78('0xf'),_0x3a2695,_0x504f1d[_0x3e78('0x13')][_0x3e78('0x14')]);return _0x251fbb(_0x504f1d[_0x3e78('0x13')][_0x3e78('0x14')]);}logger[_0x3e78('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x3a2695,_0x504f1d[_0x3e78('0x13')][_0x3e78('0x14')]);return _0xdf6c51(_0x504f1d[_0x3e78('0x13')][_0x3e78('0x14')]);}else{logger[_0x3e78('0xe')](_0x3e78('0xf'),_0x3a2695,_0x3e78('0x10'));_0xdf6c51(_0x504f1d[_0x3e78('0x15')][_0x3e78('0x14')]);}})[_0x3e78('0x16')](function(_0x1ccefc){logger[_0x3e78('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x3a2695,_0x1ccefc);_0x251fbb(_0x1ccefc);});});} \ No newline at end of file +var _0x748d=['stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x136d0f,_0x320bc5){var _0x330586=function(_0x17580f){while(--_0x17580f){_0x136d0f['push'](_0x136d0f['shift']());}};_0x330586(++_0x320bc5);}(_0x748d,0x98));var _0xd748=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x748d[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xd748('0x0'));var util=require(_0xd748('0x1'));var moment=require('moment');var BPromise=require(_0xd748('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd748('0x3'));var db=require(_0xd748('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd748('0x5'))(_0xd748('0x6'));var config=require(_0xd748('0x7'));var jayson=require(_0xd748('0x8'));var client=jayson[_0xd748('0x9')][_0xd748('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e1e63,_0x22b2fa,_0x2a647d){return new BPromise(function(_0x336b7a,_0x3d6fa1){return client[_0xd748('0xb')](_0x2e1e63,_0x2a647d)[_0xd748('0xc')](function(_0x3e3136){logger[_0xd748('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x22b2fa,_0xd748('0xe'));logger[_0xd748('0xf')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x22b2fa,_0xd748('0xe'),JSON[_0xd748('0x10')](_0x3e3136));if(_0x3e3136[_0xd748('0x11')]){if(_0x3e3136[_0xd748('0x11')][_0xd748('0x12')]===0x1f4){logger[_0xd748('0x11')](_0xd748('0x13'),_0x22b2fa,_0x3e3136[_0xd748('0x11')][_0xd748('0x14')]);return _0x3d6fa1(_0x3e3136[_0xd748('0x11')][_0xd748('0x14')]);}logger[_0xd748('0x11')](_0xd748('0x13'),_0x22b2fa,_0x3e3136[_0xd748('0x11')][_0xd748('0x14')]);return _0x336b7a(_0x3e3136['error']['message']);}else{logger[_0xd748('0xd')](_0xd748('0x13'),_0x22b2fa,_0xd748('0xe'));_0x336b7a(_0x3e3136['result']['message']);}})['catch'](function(_0x3970a5){logger['error'](_0xd748('0x13'),_0x22b2fa,_0x3970a5);_0x3d6fa1(_0x3970a5);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 5114fff..f14e441 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 _0x1bf1=['Router','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','index','/:id','show','post','isAuthenticated','put','exports','multer','util','express'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x1bf1,0x138));var _0x11bf=function(_0x3e3936,_0x24c3a6){_0x3e3936=_0x3e3936-0x0;var _0x10be4e=_0x1bf1[_0x3e3936];return _0x10be4e;};'use strict';var multer=require(_0x11bf('0x0'));var util=require(_0x11bf('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x11bf('0x2'));var router=express[_0x11bf('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x11bf('0x4'));var config=require(_0x11bf('0x5'));var controller=require(_0x11bf('0x6'));router[_0x11bf('0x7')]('/',auth['isAuthenticated'](),controller[_0x11bf('0x8')]);router[_0x11bf('0x7')](_0x11bf('0x9'),auth['isAuthenticated'](),controller[_0x11bf('0xa')]);router[_0x11bf('0xb')]('/',auth[_0x11bf('0xc')](),controller['create']);router[_0x11bf('0xd')](_0x11bf('0x9'),auth[_0x11bf('0xc')](),controller['update']);router['delete'](_0x11bf('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x11bf('0xe')]=router; \ No newline at end of file +var _0x3a25=['index','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated'];(function(_0x719eae,_0x508449){var _0x2e0901=function(_0x4ce454){while(--_0x4ce454){_0x719eae['push'](_0x719eae['shift']());}};_0x2e0901(++_0x508449);}(_0x3a25,0x15d));var _0x53a2=function(_0x1498a2,_0x3feed4){_0x1498a2=_0x1498a2-0x0;var _0x20427d=_0x3a25[_0x1498a2];return _0x20427d;};'use strict';var multer=require(_0x53a2('0x0'));var util=require(_0x53a2('0x1'));var path=require(_0x53a2('0x2'));var timeout=require(_0x53a2('0x3'));var express=require('express');var router=express[_0x53a2('0x4')]();var auth=require(_0x53a2('0x5'));var interaction=require(_0x53a2('0x6'));var config=require(_0x53a2('0x7'));var controller=require(_0x53a2('0x8'));router[_0x53a2('0x9')]('/',auth[_0x53a2('0xa')](),controller[_0x53a2('0xb')]);router['get']('/:id',auth[_0x53a2('0xa')](),controller[_0x53a2('0xc')]);router[_0x53a2('0xd')]('/',auth[_0x53a2('0xa')](),controller['create']);router[_0x53a2('0xe')](_0x53a2('0xf'),auth[_0x53a2('0xa')](),controller[_0x53a2('0x10')]);router[_0x53a2('0x11')](_0x53a2('0xf'),auth[_0x53a2('0xa')](),controller[_0x53a2('0x12')]);module[_0x53a2('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 47031a3..e4af292 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 _0x55e0=['keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x4ccf96,_0x34978e){var _0xd103b7=function(_0x55736b){while(--_0x55736b){_0x4ccf96['push'](_0x4ccf96['shift']());}};_0xd103b7(++_0x34978e);}(_0x55e0,0xdc));var _0x055e=function(_0x306596,_0x3dd0ab){_0x306596=_0x306596-0x0;var _0x2cf5fb=_0x55e0[_0x306596];return _0x2cf5fb;};'use strict';var Sequelize=require(_0x055e('0x0'));module[_0x055e('0x1')]={'type':{'type':Sequelize[_0x055e('0x2')](_0x055e('0x3'),'variable','customVariable',_0x055e('0x4')),'defaultValue':_0x055e('0x3')},'content':{'type':Sequelize[_0x055e('0x5')]},'key':{'type':Sequelize[_0x055e('0x5')]},'keyType':{'type':Sequelize[_0x055e('0x2')](_0x055e('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x055e('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x055e('0x5')]},'customField':{'type':Sequelize[_0x055e('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x055e('0x5')]}}; \ No newline at end of file +var _0x9348=['exports','ENUM','string','variable','keyValue','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x4e4d92,_0x43a617){var _0x12e150=function(_0x4685e1){while(--_0x4685e1){_0x4e4d92['push'](_0x4e4d92['shift']());}};_0x12e150(++_0x43a617);}(_0x9348,0x10d));var _0x8934=function(_0x4eb470,_0x2792b9){_0x4eb470=_0x4eb470-0x0;var _0x2a8484=_0x9348[_0x4eb470];return _0x2a8484;};'use strict';var Sequelize=require(_0x8934('0x0'));module[_0x8934('0x1')]={'type':{'type':Sequelize[_0x8934('0x2')](_0x8934('0x3'),_0x8934('0x4'),'customVariable',_0x8934('0x5')),'defaultValue':_0x8934('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8934('0x6')]},'keyType':{'type':Sequelize[_0x8934('0x2')](_0x8934('0x3'),_0x8934('0x4'),_0x8934('0x7'))},'keyContent':{'type':Sequelize[_0x8934('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8934('0x6')]},'customField':{'type':Sequelize[_0x8934('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8934('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index d49c744..e7b2ae8 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 _0x4024=['field','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','lodash','crypto','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','reject','update','then','sendStatus','error','name','send','ZohoField','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','key'];(function(_0x5b6150,_0x1f02cd){var _0x5d0e5c=function(_0xf1b6d9){while(--_0xf1b6d9){_0x5b6150['push'](_0x5b6150['shift']());}};_0x5d0e5c(++_0x1f02cd);}(_0x4024,0x89));var _0x4402=function(_0x7385bf,_0x2063cf){_0x7385bf=_0x7385bf-0x0;var _0x4d7b6f=_0x4024[_0x7385bf];return _0x4d7b6f;};'use strict';var pdf=require(_0x4402('0x0'));var emlformat=require(_0x4402('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4402('0x2'));var jsonpatch=require(_0x4402('0x3'));var rp=require('request-promise');var moment=require(_0x4402('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4402('0x5'));var util=require(_0x4402('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4402('0x7'));var ejs=require(_0x4402('0x8'));var fs=require('fs');var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4402('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x4402('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4402('0xd'))('api');var utils=require(_0x4402('0xe'));var config=require(_0x4402('0xf'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x949ab7,_0x302c4d){_0x302c4d=_0x302c4d||0xcc;return function(_0xa819e9){if(_0xa819e9){return _0x949ab7['sendStatus'](_0x302c4d);}return _0x949ab7[_0x4402('0x10')](_0x302c4d)[_0x4402('0x11')]();};}function respondWithResult(_0x42f1b0,_0x19d2f4){_0x19d2f4=_0x19d2f4||0xc8;return function(_0x248ad9){if(_0x248ad9){return _0x42f1b0[_0x4402('0x10')](_0x19d2f4)[_0x4402('0x12')](_0x248ad9);}};}function respondWithFilteredResult(_0x3c7dd2,_0x295ac5){return function(_0x263a57){if(_0x263a57){var _0x375166=_0x263a57[_0x4402('0x13')],_0xc03f65=_0x295ac5[_0x4402('0x14')],_0x2a2ce8=_0x295ac5[_0x4402('0x14')]+_0x295ac5[_0x4402('0x15')],_0x19fe7b;if(_0x2a2ce8>=_0x375166){_0x2a2ce8=_0x375166;_0x19fe7b=0xc8;}else{_0x19fe7b=0xce;}_0x3c7dd2[_0x4402('0x10')](_0x19fe7b);return _0x3c7dd2[_0x4402('0x16')]('Content-Range',_0xc03f65+'-'+_0x2a2ce8+'/'+_0x375166)['json'](_0x263a57);}return null;};}function patchUpdates(_0x663ab7){return function(_0x2a7afc){try{jsonpatch['apply'](_0x2a7afc,_0x663ab7,!![]);}catch(_0x756962){return BPromise[_0x4402('0x17')](_0x756962);}return _0x2a7afc['save']();};}function saveUpdates(_0x38b459,_0x4e0340){return function(_0x55cc8c){if(_0x55cc8c){return _0x55cc8c[_0x4402('0x18')](_0x38b459)[_0x4402('0x19')](function(_0x28f44b){return _0x28f44b;});}return null;};}function removeEntity(_0x49bc21,_0x42509b){return function(_0x57a25e){if(_0x57a25e){return _0x57a25e['destroy']()[_0x4402('0x19')](function(){_0x49bc21[_0x4402('0x10')](0xcc)[_0x4402('0x11')]();});}};}function handleEntityNotFound(_0xc583b,_0x258d10){return function(_0x2e6fee){if(!_0x2e6fee){_0xc583b[_0x4402('0x1a')](0x194);}return _0x2e6fee;};}function handleError(_0x6b1fc5,_0x24a9b8){_0x24a9b8=_0x24a9b8||0x1f4;return function(_0x4d6846){logger[_0x4402('0x1b')](_0x4d6846['stack']);if(_0x4d6846[_0x4402('0x1c')]){delete _0x4d6846[_0x4402('0x1c')];}_0x6b1fc5[_0x4402('0x10')](_0x24a9b8)[_0x4402('0x1d')](_0x4d6846);};}exports['index']=function(_0x15c19f,_0x4e9cb5){var _0x59d52f={},_0x1be54d={},_0x395e49={'count':0x0,'rows':[]};var _0x327d60=db[_0x4402('0x1e')][_0x4402('0x1f')];_0x1be54d['model']=_[_0x4402('0x20')](_0x327d60);_0x1be54d['query']=_[_0x4402('0x20')](_0x15c19f[_0x4402('0x21')]);_0x1be54d[_0x4402('0x22')]=_['intersection'](_0x1be54d[_0x4402('0x23')],_0x1be54d[_0x4402('0x21')]);_0x59d52f[_0x4402('0x24')]=_[_0x4402('0x25')](_0x1be54d[_0x4402('0x23')],qs[_0x4402('0x26')](_0x15c19f[_0x4402('0x21')][_0x4402('0x26')]));_0x59d52f[_0x4402('0x24')]=_0x59d52f[_0x4402('0x24')][_0x4402('0x27')]?_0x59d52f['attributes']:_0x1be54d[_0x4402('0x23')];if(!_0x15c19f['query'][_0x4402('0x28')]('nolimit')){_0x59d52f[_0x4402('0x15')]=qs[_0x4402('0x15')](_0x15c19f[_0x4402('0x21')][_0x4402('0x15')]);_0x59d52f[_0x4402('0x14')]=qs['offset'](_0x15c19f[_0x4402('0x21')][_0x4402('0x14')]);}_0x59d52f[_0x4402('0x29')]=qs['sort'](_0x15c19f[_0x4402('0x21')][_0x4402('0x2a')]);_0x59d52f['where']=qs[_0x4402('0x22')](_[_0x4402('0x2b')](_0x15c19f[_0x4402('0x21')],_0x1be54d[_0x4402('0x22')]));if(_0x15c19f[_0x4402('0x21')][_0x4402('0x2c')]){_0x59d52f[_0x4402('0x2d')]=_[_0x4402('0x2e')](_0x59d52f[_0x4402('0x2d')],{'$or':_['map'](_0x327d60,function(_0x2995b6){if(_0x2995b6[_0x4402('0x2f')][_0x4402('0x30')]!=='VIRTUAL'){var _0x34e4ae={};_0x34e4ae[_0x2995b6[_0x4402('0x31')]]={'$like':'%'+_0x15c19f['query']['filter']+'%'};return _0x34e4ae;}})});}_0x59d52f=_[_0x4402('0x2e')]({},_0x59d52f,_0x15c19f[_0x4402('0x32')]);var _0x433c1e={'where':_0x59d52f[_0x4402('0x2d')]};return db['ZohoField']['count'](_0x433c1e)['then'](function(_0x3a5e62){_0x395e49[_0x4402('0x13')]=_0x3a5e62;if(_0x15c19f[_0x4402('0x21')][_0x4402('0x33')]){_0x59d52f['include']=[{'all':!![]}];}return db[_0x4402('0x1e')][_0x4402('0x34')](_0x59d52f);})[_0x4402('0x19')](function(_0x57843d){_0x395e49[_0x4402('0x35')]=_0x57843d;return _0x395e49;})['then'](respondWithFilteredResult(_0x4e9cb5,_0x59d52f))[_0x4402('0x36')](handleError(_0x4e9cb5,null));};exports[_0x4402('0x37')]=function(_0x5c74b1,_0x16ef2e){var _0x529526={'raw':!![],'where':{'id':_0x5c74b1[_0x4402('0x38')]['id']}},_0x423628={};_0x423628['model']=_[_0x4402('0x20')](db[_0x4402('0x1e')][_0x4402('0x1f')]);_0x423628[_0x4402('0x21')]=_['keys'](_0x5c74b1['query']);_0x423628[_0x4402('0x22')]=_['intersection'](_0x423628[_0x4402('0x23')],_0x423628[_0x4402('0x21')]);_0x529526[_0x4402('0x24')]=_[_0x4402('0x25')](_0x423628[_0x4402('0x23')],qs[_0x4402('0x26')](_0x5c74b1[_0x4402('0x21')][_0x4402('0x26')]));_0x529526[_0x4402('0x24')]=_0x529526[_0x4402('0x24')]['length']?_0x529526[_0x4402('0x24')]:_0x423628[_0x4402('0x23')];if(_0x5c74b1['query'][_0x4402('0x33')]){_0x529526[_0x4402('0x39')]=[{'all':!![]}];}_0x529526=_['merge']({},_0x529526,_0x5c74b1[_0x4402('0x32')]);return db[_0x4402('0x1e')][_0x4402('0x3a')](_0x529526)[_0x4402('0x19')](handleEntityNotFound(_0x16ef2e,null))[_0x4402('0x19')](respondWithResult(_0x16ef2e,null))['catch'](handleError(_0x16ef2e,null));};exports[_0x4402('0x3b')]=function(_0x3575b6,_0x21d34f){return db[_0x4402('0x1e')][_0x4402('0x3b')](_0x3575b6[_0x4402('0x3c')],{})[_0x4402('0x19')](respondWithResult(_0x21d34f,0xc9))[_0x4402('0x36')](handleError(_0x21d34f,null));};exports[_0x4402('0x18')]=function(_0x100489,_0x22b463){if(_0x100489['body']['id']){delete _0x100489[_0x4402('0x3c')]['id'];}return db['ZohoField'][_0x4402('0x3a')]({'where':{'id':_0x100489[_0x4402('0x38')]['id']}})['then'](handleEntityNotFound(_0x22b463,null))[_0x4402('0x19')](saveUpdates(_0x100489[_0x4402('0x3c')],null))[_0x4402('0x19')](respondWithResult(_0x22b463,null))[_0x4402('0x36')](handleError(_0x22b463,null));};exports[_0x4402('0x3d')]=function(_0x2503eb,_0x5b094b){return db[_0x4402('0x1e')][_0x4402('0x3a')]({'where':{'id':_0x2503eb[_0x4402('0x38')]['id']}})[_0x4402('0x19')](handleEntityNotFound(_0x5b094b,null))[_0x4402('0x19')](removeEntity(_0x5b094b,null))[_0x4402('0x36')](handleError(_0x5b094b,null));}; \ No newline at end of file +var _0x0bb5=['../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','reject','save','update','then','sendStatus','error','stack','name','ZohoField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','map','type','key','filter','merge','include','findAll','rows','catch','show','options','find','create','body','params','destroy','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x51b1a5,_0x285a4f){var _0x15c738=function(_0x5c94d7){while(--_0x5c94d7){_0x51b1a5['push'](_0x51b1a5['shift']());}};_0x15c738(++_0x285a4f);}(_0x0bb5,0x148));var _0x50bb=function(_0x459e5b,_0xdb5fee){_0x459e5b=_0x459e5b-0x0;var _0x5cf232=_0x0bb5[_0x459e5b];return _0x5cf232;};'use strict';var pdf=require(_0x50bb('0x0'));var emlformat=require(_0x50bb('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x50bb('0x2'));var rp=require(_0x50bb('0x3'));var moment=require(_0x50bb('0x4'));var BPromise=require(_0x50bb('0x5'));var Mustache=require(_0x50bb('0x6'));var util=require(_0x50bb('0x7'));var path=require(_0x50bb('0x8'));var sox=require(_0x50bb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x50bb('0xa'));var squel=require(_0x50bb('0xb'));var crypto=require(_0x50bb('0xc'));var jsforce=require(_0x50bb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x50bb('0xe'));var Papa=require(_0x50bb('0xf'));var Redis=require(_0x50bb('0x10'));var authService=require(_0x50bb('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x50bb('0x12'));var logger=require(_0x50bb('0x13'))(_0x50bb('0x14'));var utils=require(_0x50bb('0x15'));var config=require(_0x50bb('0x16'));var db=require(_0x50bb('0x17'))['db'];function respondWithStatusCode(_0x38d3b6,_0x4d7e3d){_0x4d7e3d=_0x4d7e3d||0xcc;return function(_0x226370){if(_0x226370){return _0x38d3b6['sendStatus'](_0x4d7e3d);}return _0x38d3b6[_0x50bb('0x18')](_0x4d7e3d)[_0x50bb('0x19')]();};}function respondWithResult(_0x155864,_0x502250){_0x502250=_0x502250||0xc8;return function(_0x17007f){if(_0x17007f){return _0x155864[_0x50bb('0x18')](_0x502250)[_0x50bb('0x1a')](_0x17007f);}};}function respondWithFilteredResult(_0x5244b0,_0xbbc6a0){return function(_0x5e8478){if(_0x5e8478){var _0x21befa=_0x5e8478[_0x50bb('0x1b')],_0x3e1a51=_0xbbc6a0['offset'],_0x253073=_0xbbc6a0[_0x50bb('0x1c')]+_0xbbc6a0[_0x50bb('0x1d')],_0x42ffab;if(_0x253073>=_0x21befa){_0x253073=_0x21befa;_0x42ffab=0xc8;}else{_0x42ffab=0xce;}_0x5244b0['status'](_0x42ffab);return _0x5244b0[_0x50bb('0x1e')]('Content-Range',_0x3e1a51+'-'+_0x253073+'/'+_0x21befa)[_0x50bb('0x1a')](_0x5e8478);}return null;};}function patchUpdates(_0x431ed4){return function(_0x4b06f5){try{jsonpatch['apply'](_0x4b06f5,_0x431ed4,!![]);}catch(_0x43465b){return BPromise[_0x50bb('0x1f')](_0x43465b);}return _0x4b06f5[_0x50bb('0x20')]();};}function saveUpdates(_0x26abe7,_0x56b25a){return function(_0x19dc5d){if(_0x19dc5d){return _0x19dc5d[_0x50bb('0x21')](_0x26abe7)[_0x50bb('0x22')](function(_0x597e95){return _0x597e95;});}return null;};}function removeEntity(_0x3104c8,_0x879fea){return function(_0x1344ec){if(_0x1344ec){return _0x1344ec['destroy']()[_0x50bb('0x22')](function(){_0x3104c8['status'](0xcc)[_0x50bb('0x19')]();});}};}function handleEntityNotFound(_0x3391da,_0x1a2a0b){return function(_0x2ee87a){if(!_0x2ee87a){_0x3391da[_0x50bb('0x23')](0x194);}return _0x2ee87a;};}function handleError(_0x342078,_0x4f7f73){_0x4f7f73=_0x4f7f73||0x1f4;return function(_0xad17ac){logger[_0x50bb('0x24')](_0xad17ac[_0x50bb('0x25')]);if(_0xad17ac[_0x50bb('0x26')]){delete _0xad17ac['name'];}_0x342078[_0x50bb('0x18')](_0x4f7f73)['send'](_0xad17ac);};}exports['index']=function(_0x2befd9,_0x491632){var _0x5cfe4b={},_0x41fd89={},_0x12ee2c={'count':0x0,'rows':[]};var _0x3004a3=db[_0x50bb('0x27')][_0x50bb('0x28')];_0x41fd89[_0x50bb('0x29')]=_[_0x50bb('0x2a')](_0x3004a3);_0x41fd89[_0x50bb('0x2b')]=_['keys'](_0x2befd9[_0x50bb('0x2b')]);_0x41fd89[_0x50bb('0x2c')]=_[_0x50bb('0x2d')](_0x41fd89[_0x50bb('0x29')],_0x41fd89['query']);_0x5cfe4b[_0x50bb('0x2e')]=_[_0x50bb('0x2d')](_0x41fd89[_0x50bb('0x29')],qs[_0x50bb('0x2f')](_0x2befd9[_0x50bb('0x2b')][_0x50bb('0x2f')]));_0x5cfe4b[_0x50bb('0x2e')]=_0x5cfe4b[_0x50bb('0x2e')][_0x50bb('0x30')]?_0x5cfe4b[_0x50bb('0x2e')]:_0x41fd89[_0x50bb('0x29')];if(!_0x2befd9[_0x50bb('0x2b')]['hasOwnProperty'](_0x50bb('0x31'))){_0x5cfe4b[_0x50bb('0x1d')]=qs[_0x50bb('0x1d')](_0x2befd9[_0x50bb('0x2b')][_0x50bb('0x1d')]);_0x5cfe4b[_0x50bb('0x1c')]=qs[_0x50bb('0x1c')](_0x2befd9[_0x50bb('0x2b')][_0x50bb('0x1c')]);}_0x5cfe4b[_0x50bb('0x32')]=qs[_0x50bb('0x33')](_0x2befd9['query'][_0x50bb('0x33')]);_0x5cfe4b[_0x50bb('0x34')]=qs[_0x50bb('0x2c')](_[_0x50bb('0x35')](_0x2befd9[_0x50bb('0x2b')],_0x41fd89[_0x50bb('0x2c')]));if(_0x2befd9['query']['filter']){_0x5cfe4b[_0x50bb('0x34')]=_['merge'](_0x5cfe4b[_0x50bb('0x34')],{'$or':_[_0x50bb('0x36')](_0x3004a3,function(_0x3c94ea){if(_0x3c94ea[_0x50bb('0x37')][_0x50bb('0x38')]!=='VIRTUAL'){var _0x3a5f09={};_0x3a5f09[_0x3c94ea['field']]={'$like':'%'+_0x2befd9[_0x50bb('0x2b')][_0x50bb('0x39')]+'%'};return _0x3a5f09;}})});}_0x5cfe4b=_[_0x50bb('0x3a')]({},_0x5cfe4b,_0x2befd9['options']);var _0x55d29c={'where':_0x5cfe4b[_0x50bb('0x34')]};return db[_0x50bb('0x27')][_0x50bb('0x1b')](_0x55d29c)[_0x50bb('0x22')](function(_0x51750b){_0x12ee2c[_0x50bb('0x1b')]=_0x51750b;if(_0x2befd9['query']['includeAll']){_0x5cfe4b[_0x50bb('0x3b')]=[{'all':!![]}];}return db['ZohoField'][_0x50bb('0x3c')](_0x5cfe4b);})[_0x50bb('0x22')](function(_0x1ef231){_0x12ee2c[_0x50bb('0x3d')]=_0x1ef231;return _0x12ee2c;})[_0x50bb('0x22')](respondWithFilteredResult(_0x491632,_0x5cfe4b))[_0x50bb('0x3e')](handleError(_0x491632,null));};exports[_0x50bb('0x3f')]=function(_0x1cf782,_0x46039a){var _0x718128={'raw':!![],'where':{'id':_0x1cf782['params']['id']}},_0x594f16={};_0x594f16[_0x50bb('0x29')]=_[_0x50bb('0x2a')](db[_0x50bb('0x27')][_0x50bb('0x28')]);_0x594f16['query']=_[_0x50bb('0x2a')](_0x1cf782['query']);_0x594f16[_0x50bb('0x2c')]=_[_0x50bb('0x2d')](_0x594f16[_0x50bb('0x29')],_0x594f16[_0x50bb('0x2b')]);_0x718128[_0x50bb('0x2e')]=_[_0x50bb('0x2d')](_0x594f16[_0x50bb('0x29')],qs[_0x50bb('0x2f')](_0x1cf782[_0x50bb('0x2b')][_0x50bb('0x2f')]));_0x718128[_0x50bb('0x2e')]=_0x718128[_0x50bb('0x2e')][_0x50bb('0x30')]?_0x718128[_0x50bb('0x2e')]:_0x594f16[_0x50bb('0x29')];if(_0x1cf782[_0x50bb('0x2b')]['includeAll']){_0x718128[_0x50bb('0x3b')]=[{'all':!![]}];}_0x718128=_['merge']({},_0x718128,_0x1cf782[_0x50bb('0x40')]);return db[_0x50bb('0x27')][_0x50bb('0x41')](_0x718128)[_0x50bb('0x22')](handleEntityNotFound(_0x46039a,null))[_0x50bb('0x22')](respondWithResult(_0x46039a,null))[_0x50bb('0x3e')](handleError(_0x46039a,null));};exports[_0x50bb('0x42')]=function(_0x67c519,_0x3ecec7){return db[_0x50bb('0x27')][_0x50bb('0x42')](_0x67c519[_0x50bb('0x43')],{})[_0x50bb('0x22')](respondWithResult(_0x3ecec7,0xc9))[_0x50bb('0x3e')](handleError(_0x3ecec7,null));};exports['update']=function(_0x3eb429,_0x4e545f){if(_0x3eb429[_0x50bb('0x43')]['id']){delete _0x3eb429[_0x50bb('0x43')]['id'];}return db[_0x50bb('0x27')][_0x50bb('0x41')]({'where':{'id':_0x3eb429[_0x50bb('0x44')]['id']}})[_0x50bb('0x22')](handleEntityNotFound(_0x4e545f,null))[_0x50bb('0x22')](saveUpdates(_0x3eb429[_0x50bb('0x43')],null))['then'](respondWithResult(_0x4e545f,null))[_0x50bb('0x3e')](handleError(_0x4e545f,null));};exports[_0x50bb('0x45')]=function(_0xf52a22,_0x13afe2){return db[_0x50bb('0x27')]['find']({'where':{'id':_0xf52a22[_0x50bb('0x44')]['id']}})[_0x50bb('0x22')](handleEntityNotFound(_0x13afe2,null))[_0x50bb('0x22')](removeEntity(_0x13afe2,null))[_0x50bb('0x3e')](handleError(_0x13afe2,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 8d085ec..88412e1 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 _0x8a1a=['./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x535358,_0x9228){var _0x1630ec=function(_0x439599){while(--_0x439599){_0x535358['push'](_0x535358['shift']());}};_0x1630ec(++_0x9228);}(_0x8a1a,0x107));var _0xa8a1=function(_0x2f57b2,_0xa8e91a){_0x2f57b2=_0x2f57b2-0x0;var _0x5ace77=_0x8a1a[_0x2f57b2];return _0x5ace77;};'use strict';var _=require('lodash');var util=require(_0xa8a1('0x0'));var logger=require(_0xa8a1('0x1'))(_0xa8a1('0x2'));var moment=require(_0xa8a1('0x3'));var BPromise=require(_0xa8a1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa8a1('0x5'));var config=require(_0xa8a1('0x6'));var attributes=require(_0xa8a1('0x7'));module[_0xa8a1('0x8')]=function(_0x933781,_0x258531){return _0x933781[_0xa8a1('0x9')](_0xa8a1('0xa'),attributes,{'tableName':_0xa8a1('0xb'),'paranoid':![],'indexes':[{'name':_0xa8a1('0xc'),'fields':[_0xa8a1('0xd'),_0xa8a1('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x659d=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ZohoField','zoho_unique_index','idField','FieldId','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x659d,0x167));var _0xd659=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x659d[_0x5cb1af];return _0x8d7940;};'use strict';var _=require(_0xd659('0x0'));var util=require(_0xd659('0x1'));var logger=require(_0xd659('0x2'))(_0xd659('0x3'));var moment=require(_0xd659('0x4'));var BPromise=require(_0xd659('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd659('0x6'));var rimraf=require(_0xd659('0x7'));var config=require(_0xd659('0x8'));var attributes=require('./intZohoField.attributes');module[_0xd659('0x9')]=function(_0x26db24,_0x4c8320){return _0x26db24[_0xd659('0xa')](_0xd659('0xb'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xd659('0xc'),'fields':[_0xd659('0xd'),_0xd659('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 6970af6..ba194f8 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 _0xc323=['bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x5909c4,_0x4ba641){var _0x41c19f=function(_0x13d912){while(--_0x13d912){_0x5909c4['push'](_0x5909c4['shift']());}};_0x41c19f(++_0x4ba641);}(_0xc323,0x66));var _0x3c32=function(_0x53cc35,_0x228629){_0x53cc35=_0x53cc35-0x0;var _0x2ad457=_0xc323[_0x53cc35];return _0x2ad457;};'use strict';var _=require(_0x3c32('0x0'));var util=require(_0x3c32('0x1'));var moment=require(_0x3c32('0x2'));var BPromise=require(_0x3c32('0x3'));var rs=require(_0x3c32('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c32('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x3c32('0x6'));var jayson=require(_0x3c32('0x7'));var client=jayson[_0x3c32('0x8')][_0x3c32('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4cf304,_0x4278f6,_0x2b6a1e){return new BPromise(function(_0x28d139,_0x71d04){return client['request'](_0x4cf304,_0x2b6a1e)[_0x3c32('0xa')](function(_0x1788fb){logger[_0x3c32('0xb')](_0x3c32('0xc'),_0x4278f6,_0x3c32('0xd'));logger['debug'](_0x3c32('0xe'),_0x4278f6,_0x3c32('0xd'),JSON[_0x3c32('0xf')](_0x1788fb));if(_0x1788fb[_0x3c32('0x10')]){if(_0x1788fb[_0x3c32('0x10')][_0x3c32('0x11')]===0x1f4){logger['error'](_0x3c32('0xc'),_0x4278f6,_0x1788fb[_0x3c32('0x10')]['message']);return _0x71d04(_0x1788fb[_0x3c32('0x10')][_0x3c32('0x12')]);}logger[_0x3c32('0x10')](_0x3c32('0xc'),_0x4278f6,_0x1788fb[_0x3c32('0x10')][_0x3c32('0x12')]);return _0x28d139(_0x1788fb[_0x3c32('0x10')][_0x3c32('0x12')]);}else{logger['info'](_0x3c32('0xc'),_0x4278f6,'request\x20sent');_0x28d139(_0x1788fb[_0x3c32('0x13')]['message']);}})[_0x3c32('0x14')](function(_0x2ae8c1){logger[_0x3c32('0x10')]('ZohoField,\x20%s,\x20%s',_0x4278f6,_0x2ae8c1);_0x71d04(_0x2ae8c1);});});} \ No newline at end of file +var _0xcdb6=['ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info'];(function(_0x1b1dc5,_0x202ab5){var _0x31cecb=function(_0x51a981){while(--_0x51a981){_0x1b1dc5['push'](_0x1b1dc5['shift']());}};_0x31cecb(++_0x202ab5);}(_0xcdb6,0x162));var _0x6cdb=function(_0x58c9c6,_0x32f3b4){_0x58c9c6=_0x58c9c6-0x0;var _0x1c6cb7=_0xcdb6[_0x58c9c6];return _0x1c6cb7;};'use strict';var _=require('lodash');var util=require(_0x6cdb('0x0'));var moment=require(_0x6cdb('0x1'));var BPromise=require(_0x6cdb('0x2'));var rs=require(_0x6cdb('0x3'));var fs=require('fs');var Redis=require(_0x6cdb('0x4'));var db=require(_0x6cdb('0x5'))['db'];var utils=require(_0x6cdb('0x6'));var logger=require(_0x6cdb('0x7'))(_0x6cdb('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6cdb('0x9')][_0x6cdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4423a2,_0x13ecf3,_0x292d8e){return new BPromise(function(_0x596cad,_0x74851){return client[_0x6cdb('0xb')](_0x4423a2,_0x292d8e)[_0x6cdb('0xc')](function(_0x2cce06){logger[_0x6cdb('0xd')](_0x6cdb('0xe'),_0x13ecf3,_0x6cdb('0xf'));logger[_0x6cdb('0x10')](_0x6cdb('0x11'),_0x13ecf3,_0x6cdb('0xf'),JSON[_0x6cdb('0x12')](_0x2cce06));if(_0x2cce06[_0x6cdb('0x13')]){if(_0x2cce06['error'][_0x6cdb('0x14')]===0x1f4){logger['error'](_0x6cdb('0xe'),_0x13ecf3,_0x2cce06[_0x6cdb('0x13')][_0x6cdb('0x15')]);return _0x74851(_0x2cce06['error'][_0x6cdb('0x15')]);}logger['error'](_0x6cdb('0xe'),_0x13ecf3,_0x2cce06[_0x6cdb('0x13')][_0x6cdb('0x15')]);return _0x596cad(_0x2cce06[_0x6cdb('0x13')][_0x6cdb('0x15')]);}else{logger[_0x6cdb('0xd')]('ZohoField,\x20%s,\x20%s',_0x13ecf3,_0x6cdb('0xf'));_0x596cad(_0x2cce06['result'][_0x6cdb('0x15')]);}})[_0x6cdb('0x16')](function(_0x54caf9){logger[_0x6cdb('0x13')](_0x6cdb('0xe'),_0x13ecf3,_0x54caf9);_0x74851(_0x54caf9);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 210028d..25d8b74 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 _0x5b47=['../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x3d15f9,_0x3cabd3){var _0xcdbd6a=function(_0x500938){while(--_0x500938){_0x3d15f9['push'](_0x3d15f9['shift']());}};_0xcdbd6a(++_0x3cabd3);}(_0x5b47,0x120));var _0x75b4=function(_0x47e022,_0x5b12d6){_0x47e022=_0x47e022-0x0;var _0x2ee91c=_0x5b47[_0x47e022];return _0x2ee91c;};'use strict';var multer=require(_0x75b4('0x0'));var util=require(_0x75b4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x75b4('0x2'));var config=require(_0x75b4('0x3'));module[_0x75b4('0x4')]=router; \ No newline at end of file +var _0xf03a=['../../components/auth/service','../../components/interaction/service','exports','util','path','connect-timeout','express'];(function(_0xf1789c,_0x3fbbc0){var _0x5d8988=function(_0x1f39c4){while(--_0x1f39c4){_0xf1789c['push'](_0xf1789c['shift']());}};_0x5d8988(++_0x3fbbc0);}(_0xf03a,0x1a0));var _0xaf03=function(_0x5b155a,_0x4266ff){_0x5b155a=_0x5b155a-0x0;var _0xaa205a=_0xf03a[_0x5b155a];return _0xaa205a;};'use strict';var multer=require('multer');var util=require(_0xaf03('0x0'));var path=require(_0xaf03('0x1'));var timeout=require(_0xaf03('0x2'));var express=require(_0xaf03('0x3'));var router=express['Router']();var auth=require(_0xaf03('0x4'));var interaction=require(_0xaf03('0x5'));var config=require('../../config/environment');module[_0xaf03('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 37fa2b3..f2dfdbf 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 _0x3245=['unique_name_and_version','app.js','INTEGER','BOOLEAN','state','exports','STRING'];(function(_0x25d2fb,_0x18a774){var _0x1ded53=function(_0x4c0715){while(--_0x4c0715){_0x25d2fb['push'](_0x25d2fb['shift']());}};_0x1ded53(++_0x18a774);}(_0x3245,0x15c));var _0x5324=function(_0x1fcc94,_0x10a6e2){_0x1fcc94=_0x1fcc94-0x0;var _0x4ba780=_0x3245[_0x1fcc94];return _0x4ba780;};'use strict';var Sequelize=require('sequelize');module[_0x5324('0x0')]={'name':{'type':Sequelize[_0x5324('0x1')],'allowNull':![],'unique':_0x5324('0x2')},'version':{'type':Sequelize[_0x5324('0x1')],'allowNull':![],'unique':_0x5324('0x2')},'main':{'type':Sequelize[_0x5324('0x1')],'defaultValue':_0x5324('0x3')},'filename':{'type':Sequelize[_0x5324('0x1')]},'path':{'type':Sequelize[_0x5324('0x1')]},'type':{'type':Sequelize[_0x5324('0x1')]},'size':{'type':Sequelize[_0x5324('0x4')]},'active':{'type':Sequelize[_0x5324('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x5324('0x1')]},'logo':{'type':Sequelize[_0x5324('0x1')]},'state':{'type':Sequelize[_0x5324('0x1')],'unique':_0x5324('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x5324('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x5324('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x4e99=['INTEGER','BOOLEAN','state','sequelize','STRING','unique_name_and_version','app.js'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4e99,0x11b));var _0x94e9=function(_0x2be942,_0x65abc9){_0x2be942=_0x2be942-0x0;var _0xb40d48=_0x4e99[_0x2be942];return _0xb40d48;};'use strict';var Sequelize=require(_0x94e9('0x0'));module['exports']={'name':{'type':Sequelize[_0x94e9('0x1')],'allowNull':![],'unique':_0x94e9('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x94e9('0x1')],'defaultValue':_0x94e9('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x94e9('0x1')]},'type':{'type':Sequelize[_0x94e9('0x1')]},'size':{'type':Sequelize[_0x94e9('0x4')]},'active':{'type':Sequelize[_0x94e9('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x94e9('0x1')]},'state':{'type':Sequelize[_0x94e9('0x1')],'unique':_0x94e9('0x6')},'description':{'type':Sequelize[_0x94e9('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x94e9('0x1')]},'link':{'type':Sequelize[_0x94e9('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 44c51e6..96d146c 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 _0xf9f5=['offset','set','Content-Range','apply','reject','save','then','stack','name','send','index','Integration','rawAttributes','model','query','keys','filters','intersection','attributes','fields','nolimit','limit','where','pick','filter','merge','type','key','VIRTUAL','field','includeAll','include','findAll','catch','params','length','create','body','update','find','destroy','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','end','status','json','count'];(function(_0x7c7d77,_0x11b296){var _0x4bf7d4=function(_0x47bb25){while(--_0x47bb25){_0x7c7d77['push'](_0x7c7d77['shift']());}};_0x4bf7d4(++_0x11b296);}(_0xf9f5,0x1b5));var _0x5f9f=function(_0x1bfd57,_0x451642){_0x1bfd57=_0x1bfd57-0x0;var _0x40a450=_0xf9f5[_0x1bfd57];return _0x40a450;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5f9f('0x0'));var jsonpatch=require(_0x5f9f('0x1'));var rp=require(_0x5f9f('0x2'));var moment=require(_0x5f9f('0x3'));var BPromise=require(_0x5f9f('0x4'));var Mustache=require('mustache');var util=require(_0x5f9f('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x5f9f('0x6'));var ejs=require(_0x5f9f('0x7'));var fs=require('fs');var _=require(_0x5f9f('0x8'));var squel=require(_0x5f9f('0x9'));var crypto=require('crypto');var jsforce=require(_0x5f9f('0xa'));var deskjs=require(_0x5f9f('0xb'));var toCsv=require(_0x5f9f('0x6'));var querystring=require(_0x5f9f('0xc'));var Papa=require(_0x5f9f('0xd'));var Redis=require(_0x5f9f('0xe'));var authService=require(_0x5f9f('0xf'));var qs=require(_0x5f9f('0x10'));var hardwareService=require(_0x5f9f('0x11'));var logger=require(_0x5f9f('0x12'))('api');var utils=require(_0x5f9f('0x13'));var config=require(_0x5f9f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4df301,_0x23c1dc){_0x23c1dc=_0x23c1dc||0xcc;return function(_0x5edadc){if(_0x5edadc){return _0x4df301['sendStatus'](_0x23c1dc);}return _0x4df301['status'](_0x23c1dc)[_0x5f9f('0x15')]();};}function respondWithResult(_0x41765a,_0xbe67a2){_0xbe67a2=_0xbe67a2||0xc8;return function(_0x4b3435){if(_0x4b3435){return _0x41765a[_0x5f9f('0x16')](_0xbe67a2)[_0x5f9f('0x17')](_0x4b3435);}};}function respondWithFilteredResult(_0x49d701,_0x5ddbd4){return function(_0x150c28){if(_0x150c28){var _0x4852dc=_0x150c28[_0x5f9f('0x18')],_0x2fb77f=_0x5ddbd4[_0x5f9f('0x19')],_0x33ba63=_0x5ddbd4['offset']+_0x5ddbd4['limit'],_0x30a1e6;if(_0x33ba63>=_0x4852dc){_0x33ba63=_0x4852dc;_0x30a1e6=0xc8;}else{_0x30a1e6=0xce;}_0x49d701[_0x5f9f('0x16')](_0x30a1e6);return _0x49d701[_0x5f9f('0x1a')](_0x5f9f('0x1b'),_0x2fb77f+'-'+_0x33ba63+'/'+_0x4852dc)[_0x5f9f('0x17')](_0x150c28);}return null;};}function patchUpdates(_0x2890f9){return function(_0x2e4389){try{jsonpatch[_0x5f9f('0x1c')](_0x2e4389,_0x2890f9,!![]);}catch(_0x41b140){return BPromise[_0x5f9f('0x1d')](_0x41b140);}return _0x2e4389[_0x5f9f('0x1e')]();};}function saveUpdates(_0x167978,_0x3f5437){return function(_0x45e648){if(_0x45e648){return _0x45e648['update'](_0x167978)[_0x5f9f('0x1f')](function(_0x55406f){return _0x55406f;});}return null;};}function removeEntity(_0x2abdf5,_0x378629){return function(_0x13a5cd){if(_0x13a5cd){return _0x13a5cd['destroy']()[_0x5f9f('0x1f')](function(){_0x2abdf5['status'](0xcc)[_0x5f9f('0x15')]();});}};}function handleEntityNotFound(_0x327ef4,_0x19777a){return function(_0x48d7a1){if(!_0x48d7a1){_0x327ef4['sendStatus'](0x194);}return _0x48d7a1;};}function handleError(_0x4f0b02,_0xea0cd1){_0xea0cd1=_0xea0cd1||0x1f4;return function(_0x11d7d7){logger['error'](_0x11d7d7[_0x5f9f('0x20')]);if(_0x11d7d7[_0x5f9f('0x21')]){delete _0x11d7d7[_0x5f9f('0x21')];}_0x4f0b02[_0x5f9f('0x16')](_0xea0cd1)[_0x5f9f('0x22')](_0x11d7d7);};}exports[_0x5f9f('0x23')]=function(_0x371d00,_0x2a4d3d){var _0x5a3e9c={},_0xdeb1b7={},_0x3e2c87={'count':0x0,'rows':[]};var _0x3f98c5=db[_0x5f9f('0x24')][_0x5f9f('0x25')];_0xdeb1b7[_0x5f9f('0x26')]=_['keys'](_0x3f98c5);_0xdeb1b7[_0x5f9f('0x27')]=_[_0x5f9f('0x28')](_0x371d00[_0x5f9f('0x27')]);_0xdeb1b7[_0x5f9f('0x29')]=_[_0x5f9f('0x2a')](_0xdeb1b7[_0x5f9f('0x26')],_0xdeb1b7[_0x5f9f('0x27')]);_0x5a3e9c[_0x5f9f('0x2b')]=_['intersection'](_0xdeb1b7[_0x5f9f('0x26')],qs[_0x5f9f('0x2c')](_0x371d00[_0x5f9f('0x27')][_0x5f9f('0x2c')]));_0x5a3e9c['attributes']=_0x5a3e9c['attributes']['length']?_0x5a3e9c[_0x5f9f('0x2b')]:_0xdeb1b7['model'];if(!_0x371d00['query']['hasOwnProperty'](_0x5f9f('0x2d'))){_0x5a3e9c[_0x5f9f('0x2e')]=qs[_0x5f9f('0x2e')](_0x371d00['query']['limit']);_0x5a3e9c[_0x5f9f('0x19')]=qs['offset'](_0x371d00[_0x5f9f('0x27')][_0x5f9f('0x19')]);}_0x5a3e9c['order']=qs['sort'](_0x371d00['query']['sort']);_0x5a3e9c[_0x5f9f('0x2f')]=qs['filters'](_[_0x5f9f('0x30')](_0x371d00[_0x5f9f('0x27')],_0xdeb1b7['filters']));if(_0x371d00['query'][_0x5f9f('0x31')]){_0x5a3e9c[_0x5f9f('0x2f')]=_[_0x5f9f('0x32')](_0x5a3e9c[_0x5f9f('0x2f')],{'$or':_['map'](_0x3f98c5,function(_0x14ab7e){if(_0x14ab7e[_0x5f9f('0x33')][_0x5f9f('0x34')]!==_0x5f9f('0x35')){var _0x935e98={};_0x935e98[_0x14ab7e[_0x5f9f('0x36')]]={'$like':'%'+_0x371d00[_0x5f9f('0x27')]['filter']+'%'};return _0x935e98;}})});}_0x5a3e9c=_[_0x5f9f('0x32')]({},_0x5a3e9c,_0x371d00['options']);var _0x2a0486={'where':_0x5a3e9c[_0x5f9f('0x2f')]};return db[_0x5f9f('0x24')][_0x5f9f('0x18')](_0x2a0486)[_0x5f9f('0x1f')](function(_0x54753e){_0x3e2c87[_0x5f9f('0x18')]=_0x54753e;if(_0x371d00[_0x5f9f('0x27')][_0x5f9f('0x37')]){_0x5a3e9c[_0x5f9f('0x38')]=[{'all':!![]}];}return db[_0x5f9f('0x24')][_0x5f9f('0x39')](_0x5a3e9c);})['then'](function(_0x3700a5){_0x3e2c87['rows']=_0x3700a5;return _0x3e2c87;})[_0x5f9f('0x1f')](respondWithFilteredResult(_0x2a4d3d,_0x5a3e9c))[_0x5f9f('0x3a')](handleError(_0x2a4d3d,null));};exports['show']=function(_0x57bb4c,_0x3b92c6){var _0x4a59eb={'raw':![],'where':{'id':_0x57bb4c[_0x5f9f('0x3b')]['id']}},_0x57dabd={};_0x57dabd[_0x5f9f('0x26')]=_[_0x5f9f('0x28')](db[_0x5f9f('0x24')]['rawAttributes']);_0x57dabd[_0x5f9f('0x27')]=_[_0x5f9f('0x28')](_0x57bb4c['query']);_0x57dabd[_0x5f9f('0x29')]=_[_0x5f9f('0x2a')](_0x57dabd['model'],_0x57dabd[_0x5f9f('0x27')]);_0x4a59eb[_0x5f9f('0x2b')]=_['intersection'](_0x57dabd[_0x5f9f('0x26')],qs[_0x5f9f('0x2c')](_0x57bb4c[_0x5f9f('0x27')]['fields']));_0x4a59eb[_0x5f9f('0x2b')]=_0x4a59eb[_0x5f9f('0x2b')][_0x5f9f('0x3c')]?_0x4a59eb[_0x5f9f('0x2b')]:_0x57dabd[_0x5f9f('0x26')];if(_0x57bb4c[_0x5f9f('0x27')][_0x5f9f('0x37')]){_0x4a59eb['include']=[{'all':!![]}];}_0x4a59eb=_[_0x5f9f('0x32')]({},_0x4a59eb,_0x57bb4c['options']);return db[_0x5f9f('0x24')]['find'](_0x4a59eb)[_0x5f9f('0x1f')](handleEntityNotFound(_0x3b92c6,null))[_0x5f9f('0x1f')](respondWithResult(_0x3b92c6,null))[_0x5f9f('0x3a')](handleError(_0x3b92c6,null));};exports[_0x5f9f('0x3d')]=function(_0x67b27d,_0x3ee4a6){return db[_0x5f9f('0x24')][_0x5f9f('0x3d')](_0x67b27d[_0x5f9f('0x3e')],{})[_0x5f9f('0x1f')](respondWithResult(_0x3ee4a6,0xc9))[_0x5f9f('0x3a')](handleError(_0x3ee4a6,null));};exports[_0x5f9f('0x3f')]=function(_0x4a789b,_0xe06091){if(_0x4a789b[_0x5f9f('0x3e')]['id']){delete _0x4a789b['body']['id'];}return db[_0x5f9f('0x24')][_0x5f9f('0x40')]({'where':{'id':_0x4a789b['params']['id']}})[_0x5f9f('0x1f')](handleEntityNotFound(_0xe06091,null))[_0x5f9f('0x1f')](saveUpdates(_0x4a789b[_0x5f9f('0x3e')],null))['then'](respondWithResult(_0xe06091,null))['catch'](handleError(_0xe06091,null));};exports[_0x5f9f('0x41')]=function(_0x2ca1a7,_0x54dca2){return db[_0x5f9f('0x24')][_0x5f9f('0x40')]({'where':{'id':_0x2ca1a7[_0x5f9f('0x3b')]['id']}})['then'](handleEntityNotFound(_0x54dca2,null))[_0x5f9f('0x1f')](removeEntity(_0x54dca2,null))['catch'](handleError(_0x54dca2,null));}; \ No newline at end of file +var _0xcae2=['findAll','rows','catch','show','keys','include','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','error','stack','name','send','index','Integration','rawAttributes','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','options','includeAll'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xcae2,0xe3));var _0x2cae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcae2[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2cae('0x0'));var rimraf=require(_0x2cae('0x1'));var zipdir=require(_0x2cae('0x2'));var jsonpatch=require(_0x2cae('0x3'));var rp=require('request-promise');var moment=require(_0x2cae('0x4'));var BPromise=require(_0x2cae('0x5'));var Mustache=require(_0x2cae('0x6'));var util=require(_0x2cae('0x7'));var path=require(_0x2cae('0x8'));var sox=require(_0x2cae('0x9'));var csv=require('to-csv');var ejs=require(_0x2cae('0xa'));var fs=require('fs');var _=require(_0x2cae('0xb'));var squel=require(_0x2cae('0xc'));var crypto=require('crypto');var jsforce=require(_0x2cae('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2cae('0xe'));var querystring=require('querystring');var Papa=require(_0x2cae('0xf'));var Redis=require(_0x2cae('0x10'));var authService=require(_0x2cae('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2cae('0x12'))('api');var utils=require(_0x2cae('0x13'));var config=require(_0x2cae('0x14'));var db=require(_0x2cae('0x15'))['db'];function respondWithStatusCode(_0x4e33d6,_0x54aa43){_0x54aa43=_0x54aa43||0xcc;return function(_0xbd619){if(_0xbd619){return _0x4e33d6[_0x2cae('0x16')](_0x54aa43);}return _0x4e33d6[_0x2cae('0x17')](_0x54aa43)[_0x2cae('0x18')]();};}function respondWithResult(_0x103d26,_0xcae96){_0xcae96=_0xcae96||0xc8;return function(_0x913d22){if(_0x913d22){return _0x103d26['status'](_0xcae96)[_0x2cae('0x19')](_0x913d22);}};}function respondWithFilteredResult(_0x362ca1,_0x4efcf6){return function(_0x383ab6){if(_0x383ab6){var _0x3d2081=_0x383ab6[_0x2cae('0x1a')],_0x7cfefd=_0x4efcf6[_0x2cae('0x1b')],_0x419e58=_0x4efcf6[_0x2cae('0x1b')]+_0x4efcf6[_0x2cae('0x1c')],_0x39f229;if(_0x419e58>=_0x3d2081){_0x419e58=_0x3d2081;_0x39f229=0xc8;}else{_0x39f229=0xce;}_0x362ca1['status'](_0x39f229);return _0x362ca1[_0x2cae('0x1d')]('Content-Range',_0x7cfefd+'-'+_0x419e58+'/'+_0x3d2081)[_0x2cae('0x19')](_0x383ab6);}return null;};}function patchUpdates(_0x1f82bc){return function(_0x143b4d){try{jsonpatch[_0x2cae('0x1e')](_0x143b4d,_0x1f82bc,!![]);}catch(_0x3bc572){return BPromise[_0x2cae('0x1f')](_0x3bc572);}return _0x143b4d['save']();};}function saveUpdates(_0xad9a2c,_0x46fb6e){return function(_0x2309ec){if(_0x2309ec){return _0x2309ec[_0x2cae('0x20')](_0xad9a2c)[_0x2cae('0x21')](function(_0x5ac7c1){return _0x5ac7c1;});}return null;};}function removeEntity(_0x5179e8,_0x57ad24){return function(_0x21471c){if(_0x21471c){return _0x21471c['destroy']()[_0x2cae('0x21')](function(){_0x5179e8[_0x2cae('0x17')](0xcc)[_0x2cae('0x18')]();});}};}function handleEntityNotFound(_0x2707c9,_0x21eb91){return function(_0x22f4b2){if(!_0x22f4b2){_0x2707c9['sendStatus'](0x194);}return _0x22f4b2;};}function handleError(_0x32a8b6,_0x4d65f8){_0x4d65f8=_0x4d65f8||0x1f4;return function(_0x15a8d7){logger[_0x2cae('0x22')](_0x15a8d7[_0x2cae('0x23')]);if(_0x15a8d7[_0x2cae('0x24')]){delete _0x15a8d7['name'];}_0x32a8b6[_0x2cae('0x17')](_0x4d65f8)[_0x2cae('0x25')](_0x15a8d7);};}exports[_0x2cae('0x26')]=function(_0x2e70d5,_0x541d56){var _0x1db931={},_0x19f251={},_0x35562b={'count':0x0,'rows':[]};var _0x4ffb16=db[_0x2cae('0x27')][_0x2cae('0x28')];_0x19f251[_0x2cae('0x29')]=_['keys'](_0x4ffb16);_0x19f251[_0x2cae('0x2a')]=_['keys'](_0x2e70d5['query']);_0x19f251[_0x2cae('0x2b')]=_['intersection'](_0x19f251[_0x2cae('0x29')],_0x19f251[_0x2cae('0x2a')]);_0x1db931[_0x2cae('0x2c')]=_[_0x2cae('0x2d')](_0x19f251[_0x2cae('0x29')],qs['fields'](_0x2e70d5[_0x2cae('0x2a')][_0x2cae('0x2e')]));_0x1db931['attributes']=_0x1db931['attributes'][_0x2cae('0x2f')]?_0x1db931['attributes']:_0x19f251[_0x2cae('0x29')];if(!_0x2e70d5['query'][_0x2cae('0x30')](_0x2cae('0x31'))){_0x1db931[_0x2cae('0x1c')]=qs[_0x2cae('0x1c')](_0x2e70d5[_0x2cae('0x2a')][_0x2cae('0x1c')]);_0x1db931[_0x2cae('0x1b')]=qs[_0x2cae('0x1b')](_0x2e70d5[_0x2cae('0x2a')]['offset']);}_0x1db931[_0x2cae('0x32')]=qs[_0x2cae('0x33')](_0x2e70d5['query'][_0x2cae('0x33')]);_0x1db931[_0x2cae('0x34')]=qs[_0x2cae('0x2b')](_[_0x2cae('0x35')](_0x2e70d5['query'],_0x19f251[_0x2cae('0x2b')]));if(_0x2e70d5[_0x2cae('0x2a')][_0x2cae('0x36')]){_0x1db931['where']=_[_0x2cae('0x37')](_0x1db931['where'],{'$or':_[_0x2cae('0x38')](_0x4ffb16,function(_0x502c0b){if(_0x502c0b[_0x2cae('0x39')][_0x2cae('0x3a')]!=='VIRTUAL'){var _0x37ae7d={};_0x37ae7d[_0x502c0b['field']]={'$like':'%'+_0x2e70d5['query'][_0x2cae('0x36')]+'%'};return _0x37ae7d;}})});}_0x1db931=_[_0x2cae('0x37')]({},_0x1db931,_0x2e70d5[_0x2cae('0x3b')]);var _0x50c889={'where':_0x1db931[_0x2cae('0x34')]};return db[_0x2cae('0x27')]['count'](_0x50c889)[_0x2cae('0x21')](function(_0xd235c5){_0x35562b[_0x2cae('0x1a')]=_0xd235c5;if(_0x2e70d5[_0x2cae('0x2a')][_0x2cae('0x3c')]){_0x1db931['include']=[{'all':!![]}];}return db[_0x2cae('0x27')][_0x2cae('0x3d')](_0x1db931);})[_0x2cae('0x21')](function(_0x2cd4ef){_0x35562b[_0x2cae('0x3e')]=_0x2cd4ef;return _0x35562b;})[_0x2cae('0x21')](respondWithFilteredResult(_0x541d56,_0x1db931))[_0x2cae('0x3f')](handleError(_0x541d56,null));};exports[_0x2cae('0x40')]=function(_0x2b63fc,_0x459637){var _0x1baed4={'raw':![],'where':{'id':_0x2b63fc['params']['id']}},_0xdd1d5e={};_0xdd1d5e[_0x2cae('0x29')]=_[_0x2cae('0x41')](db[_0x2cae('0x27')][_0x2cae('0x28')]);_0xdd1d5e[_0x2cae('0x2a')]=_[_0x2cae('0x41')](_0x2b63fc[_0x2cae('0x2a')]);_0xdd1d5e['filters']=_['intersection'](_0xdd1d5e['model'],_0xdd1d5e['query']);_0x1baed4[_0x2cae('0x2c')]=_[_0x2cae('0x2d')](_0xdd1d5e[_0x2cae('0x29')],qs[_0x2cae('0x2e')](_0x2b63fc['query']['fields']));_0x1baed4[_0x2cae('0x2c')]=_0x1baed4[_0x2cae('0x2c')][_0x2cae('0x2f')]?_0x1baed4[_0x2cae('0x2c')]:_0xdd1d5e[_0x2cae('0x29')];if(_0x2b63fc[_0x2cae('0x2a')][_0x2cae('0x3c')]){_0x1baed4[_0x2cae('0x42')]=[{'all':!![]}];}_0x1baed4=_['merge']({},_0x1baed4,_0x2b63fc[_0x2cae('0x3b')]);return db['Integration'][_0x2cae('0x43')](_0x1baed4)[_0x2cae('0x21')](handleEntityNotFound(_0x459637,null))['then'](respondWithResult(_0x459637,null))[_0x2cae('0x3f')](handleError(_0x459637,null));};exports[_0x2cae('0x44')]=function(_0x105b79,_0x4bd9ec){return db[_0x2cae('0x27')][_0x2cae('0x44')](_0x105b79[_0x2cae('0x45')],{})['then'](respondWithResult(_0x4bd9ec,0xc9))[_0x2cae('0x3f')](handleError(_0x4bd9ec,null));};exports[_0x2cae('0x20')]=function(_0x30ec59,_0x20e585){if(_0x30ec59['body']['id']){delete _0x30ec59[_0x2cae('0x45')]['id'];}return db[_0x2cae('0x27')]['find']({'where':{'id':_0x30ec59[_0x2cae('0x46')]['id']}})[_0x2cae('0x21')](handleEntityNotFound(_0x20e585,null))['then'](saveUpdates(_0x30ec59[_0x2cae('0x45')],null))['then'](respondWithResult(_0x20e585,null))['catch'](handleError(_0x20e585,null));};exports[_0x2cae('0x47')]=function(_0x571f4b,_0x4521b9){return db['Integration'][_0x2cae('0x43')]({'where':{'id':_0x571f4b['params']['id']}})[_0x2cae('0x21')](handleEntityNotFound(_0x4521b9,null))[_0x2cae('0x21')](removeEntity(_0x4521b9,null))[_0x2cae('0x3f')](handleError(_0x4521b9,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index cf00a0b..97b0ead 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 _0x027a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations'];(function(_0x23c9d1,_0xa08b83){var _0x4c7ae3=function(_0x464299){while(--_0x464299){_0x23c9d1['push'](_0x23c9d1['shift']());}};_0x4c7ae3(++_0xa08b83);}(_0x027a,0x1e0));var _0xa027=function(_0x363e5f,_0x3ba46d){_0x363e5f=_0x363e5f-0x0;var _0x5cdbd9=_0x027a[_0x363e5f];return _0x5cdbd9;};'use strict';var _=require(_0xa027('0x0'));var util=require(_0xa027('0x1'));var logger=require(_0xa027('0x2'))(_0xa027('0x3'));var moment=require(_0xa027('0x4'));var BPromise=require(_0xa027('0x5'));var rp=require(_0xa027('0x6'));var fs=require('fs');var path=require(_0xa027('0x7'));var rimraf=require(_0xa027('0x8'));var config=require(_0xa027('0x9'));var attributes=require(_0xa027('0xa'));module[_0xa027('0xb')]=function(_0x4cedc7,_0x3fe5da){return _0x4cedc7[_0xa027('0xc')](_0xa027('0xd'),attributes,{'tableName':_0xa027('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf168=['rimraf','../../config/environment','define','integrations','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3c52d3,_0x1ba447){var _0x574e4f=function(_0x35069f){while(--_0x35069f){_0x3c52d3['push'](_0x3c52d3['shift']());}};_0x574e4f(++_0x1ba447);}(_0xf168,0xeb));var _0x8f16=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xf168[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x8f16('0x0'));var util=require(_0x8f16('0x1'));var logger=require(_0x8f16('0x2'))(_0x8f16('0x3'));var moment=require('moment');var BPromise=require(_0x8f16('0x4'));var rp=require(_0x8f16('0x5'));var fs=require('fs');var path=require(_0x8f16('0x6'));var rimraf=require(_0x8f16('0x7'));var config=require(_0x8f16('0x8'));var attributes=require('./integration.attributes');module['exports']=function(_0x33c1ba,_0x4c4da9){return _0x33c1ba[_0x8f16('0x9')]('Integration',attributes,{'tableName':_0x8f16('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 3c1b666..024df3d 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 _0xcc9c=['catch','lodash','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x4ed293,_0x3a7710){var _0x44c9f1=function(_0x38b81c){while(--_0x38b81c){_0x4ed293['push'](_0x4ed293['shift']());}};_0x44c9f1(++_0x3a7710);}(_0xcc9c,0x79));var _0xccc9=function(_0x5cfb82,_0x2206ca){_0x5cfb82=_0x5cfb82-0x0;var _0x151087=_0xcc9c[_0x5cfb82];return _0x151087;};'use strict';var _=require(_0xccc9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xccc9('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xccc9('0x2'));var logger=require(_0xccc9('0x3'))(_0xccc9('0x4'));var config=require(_0xccc9('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xccc9('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12b6d2,_0x533b9e,_0x1ed107){return new BPromise(function(_0x4e7d42,_0x5c6e3d){return client[_0xccc9('0x7')](_0x12b6d2,_0x1ed107)[_0xccc9('0x8')](function(_0x1a5325){logger[_0xccc9('0x9')](_0xccc9('0xa'),_0x533b9e,'request\x20sent');logger[_0xccc9('0xb')](_0xccc9('0xc'),_0x533b9e,_0xccc9('0xd'),JSON[_0xccc9('0xe')](_0x1a5325));if(_0x1a5325[_0xccc9('0xf')]){if(_0x1a5325[_0xccc9('0xf')][_0xccc9('0x10')]===0x1f4){logger[_0xccc9('0xf')](_0xccc9('0xa'),_0x533b9e,_0x1a5325[_0xccc9('0xf')][_0xccc9('0x11')]);return _0x5c6e3d(_0x1a5325['error'][_0xccc9('0x11')]);}logger[_0xccc9('0xf')](_0xccc9('0xa'),_0x533b9e,_0x1a5325['error'][_0xccc9('0x11')]);return _0x4e7d42(_0x1a5325[_0xccc9('0xf')][_0xccc9('0x11')]);}else{logger[_0xccc9('0x9')](_0xccc9('0xa'),_0x533b9e,_0xccc9('0xd'));_0x4e7d42(_0x1a5325[_0xccc9('0x12')][_0xccc9('0x11')]);}})[_0xccc9('0x13')](function(_0x46b89f){logger[_0xccc9('0xf')]('Integration,\x20%s,\x20%s',_0x533b9e,_0x46b89f);_0x5c6e3d(_0x46b89f);});});} \ No newline at end of file +var _0x8f1d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','randomstring','ioredis'];(function(_0x2df26e,_0x3c5989){var _0x2293bf=function(_0x255ef5){while(--_0x255ef5){_0x2df26e['push'](_0x2df26e['shift']());}};_0x2293bf(++_0x3c5989);}(_0x8f1d,0x1df));var _0xd8f1=function(_0x252805,_0x1d1e8e){_0x252805=_0x252805-0x0;var _0x3e74b9=_0x8f1d[_0x252805];return _0x3e74b9;};'use strict';var _=require(_0xd8f1('0x0'));var util=require(_0xd8f1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd8f1('0x2'));var fs=require('fs');var Redis=require(_0xd8f1('0x3'));var db=require(_0xd8f1('0x4'))['db'];var utils=require(_0xd8f1('0x5'));var logger=require(_0xd8f1('0x6'))(_0xd8f1('0x7'));var config=require(_0xd8f1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd8f1('0x9')][_0xd8f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31ab50,_0x2de5dd,_0x3210ce){return new BPromise(function(_0x59bf0e,_0x2836b8){return client[_0xd8f1('0xb')](_0x31ab50,_0x3210ce)[_0xd8f1('0xc')](function(_0xbc0190){logger['info'](_0xd8f1('0xd'),_0x2de5dd,_0xd8f1('0xe'));logger[_0xd8f1('0xf')](_0xd8f1('0x10'),_0x2de5dd,_0xd8f1('0xe'),JSON[_0xd8f1('0x11')](_0xbc0190));if(_0xbc0190['error']){if(_0xbc0190[_0xd8f1('0x12')][_0xd8f1('0x13')]===0x1f4){logger[_0xd8f1('0x12')](_0xd8f1('0xd'),_0x2de5dd,_0xbc0190[_0xd8f1('0x12')][_0xd8f1('0x14')]);return _0x2836b8(_0xbc0190[_0xd8f1('0x12')]['message']);}logger[_0xd8f1('0x12')](_0xd8f1('0xd'),_0x2de5dd,_0xbc0190[_0xd8f1('0x12')]['message']);return _0x59bf0e(_0xbc0190[_0xd8f1('0x12')][_0xd8f1('0x14')]);}else{logger[_0xd8f1('0x15')](_0xd8f1('0xd'),_0x2de5dd,_0xd8f1('0xe'));_0x59bf0e(_0xbc0190['result']['message']);}})[_0xd8f1('0x16')](function(_0x3c1747){logger[_0xd8f1('0x12')](_0xd8f1('0xd'),_0x2de5dd,_0x3c1747);_0x2836b8(_0x3c1747);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 9ee0ff6..79008f3 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 _0x1294=['describe','/:id','show','post','multer','path','express','Router','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x1294,0xb8));var _0x4129=function(_0x3bab09,_0x217c29){_0x3bab09=_0x3bab09-0x0;var _0x164376=_0x1294[_0x3bab09];return _0x164376;};'use strict';var multer=require(_0x4129('0x0'));var util=require('util');var path=require(_0x4129('0x1'));var timeout=require('connect-timeout');var express=require(_0x4129('0x2'));var router=express[_0x4129('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4129('0x4'));var config=require(_0x4129('0x5'));var controller=require(_0x4129('0x6'));router[_0x4129('0x7')]('/',auth[_0x4129('0x8')](),controller[_0x4129('0x9')]);router[_0x4129('0x7')](_0x4129('0xa'),auth[_0x4129('0x8')](),controller[_0x4129('0xb')]);router[_0x4129('0x7')](_0x4129('0xc'),auth['isAuthenticated'](),controller[_0x4129('0xd')]);router[_0x4129('0xe')]('/',auth[_0x4129('0x8')](),controller['create']);router['put'](_0x4129('0xc'),auth[_0x4129('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xcb4f=['exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','index','/describe','isAuthenticated','show','post','create','put','/:id','delete'];(function(_0x4f4ac6,_0x521d86){var _0x49d4b8=function(_0x55a7fe){while(--_0x55a7fe){_0x4f4ac6['push'](_0x4f4ac6['shift']());}};_0x49d4b8(++_0x521d86);}(_0xcb4f,0x1b1));var _0xfcb4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xcb4f[_0xb0f7c3];return _0x28ea68;};'use strict';var multer=require('multer');var util=require(_0xfcb4('0x0'));var path=require('path');var timeout=require(_0xfcb4('0x1'));var express=require('express');var router=express[_0xfcb4('0x2')]();var auth=require(_0xfcb4('0x3'));var interaction=require(_0xfcb4('0x4'));var config=require('../../config/environment');var controller=require(_0xfcb4('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xfcb4('0x6')]);router['get'](_0xfcb4('0x7'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xfcb4('0x8')](),controller[_0xfcb4('0x9')]);router[_0xfcb4('0xa')]('/',auth[_0xfcb4('0x8')](),controller[_0xfcb4('0xb')]);router[_0xfcb4('0xc')](_0xfcb4('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xfcb4('0xe')](_0xfcb4('0xd'),auth[_0xfcb4('0x8')](),controller['destroy']);module[_0xfcb4('0xf')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 347849f..3b74f10 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 _0xd8fc=['sequelize','STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM','RECEIVED','FAILED'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd8fc,0x99));var _0xcd8f=function(_0x3ef8f7,_0x35359a){_0x3ef8f7=_0x3ef8f7-0x0;var _0x3b097e=_0xd8fc[_0x3ef8f7];return _0x3b097e;};'use strict';var Sequelize=require(_0xcd8f('0x0'));module['exports']={'integration':{'type':Sequelize[_0xcd8f('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xcd8f('0x1')]},'ticketId':{'type':Sequelize[_0xcd8f('0x1')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0xcd8f('0x1')]},'uniqueid':{'type':Sequelize[_0xcd8f('0x1')]},'calleridnum':{'type':Sequelize[_0xcd8f('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xcd8f('0x1')]},'membername':{'type':Sequelize[_0xcd8f('0x1')]},'agentcalledAt':{'type':Sequelize[_0xcd8f('0x2')]},'agentconnectAt':{'type':Sequelize[_0xcd8f('0x2')]},'holdtime':{'type':Sequelize[_0xcd8f('0x3')]},'agentcomplete':{'type':Sequelize[_0xcd8f('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xcd8f('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xcd8f('0x3')]},'reason':{'type':Sequelize[_0xcd8f('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xcd8f('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xcd8f('0x2')]},'agentdump':{'type':Sequelize[_0xcd8f('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xcd8f('0x1')]},'channelstate':{'type':Sequelize[_0xcd8f('0x3')]},'channelstatedesc':{'type':Sequelize[_0xcd8f('0x1')]},'connectedlinenum':{'type':Sequelize[_0xcd8f('0x1')]},'connectedlinename':{'type':Sequelize[_0xcd8f('0x1')]},'language':{'type':Sequelize[_0xcd8f('0x1')]},'accountcode':{'type':Sequelize[_0xcd8f('0x1')]},'context':{'type':Sequelize[_0xcd8f('0x1')]},'exten':{'type':Sequelize[_0xcd8f('0x1')]},'priority':{'type':Sequelize[_0xcd8f('0x1')]},'destchannel':{'type':Sequelize[_0xcd8f('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xcd8f('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xcd8f('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xcd8f('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xcd8f('0x1')]},'destuniqueid':{'type':Sequelize[_0xcd8f('0x1')]},'messageId':{'type':Sequelize[_0xcd8f('0x1')]},'inReplyTo':{'type':Sequelize[_0xcd8f('0x1')]},'subject':{'type':Sequelize[_0xcd8f('0x1')]},'from':{'type':Sequelize[_0xcd8f('0x1')]},'to':{'type':Sequelize[_0xcd8f('0x1')]},'cc':{'type':Sequelize[_0xcd8f('0x1')]},'attachment':{'type':Sequelize[_0xcd8f('0x5')]},'html':{'type':Sequelize[_0xcd8f('0x5')]},'text':{'type':Sequelize[_0xcd8f('0x5')]},'status':{'type':Sequelize[_0xcd8f('0x6')]('SENT','SENDING',_0xcd8f('0x7'),_0xcd8f('0x8'))},'url':{'type':Sequelize[_0xcd8f('0x1')]},'app':{'type':Sequelize[_0xcd8f('0x1')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0xcd8f('0x3')]}}; \ No newline at end of file +var _0x2a28=['FAILED','exports','STRING','DATE','INTEGER','BOOLEAN','TEXT'];(function(_0xb2fbd0,_0x2433e9){var _0x5c8d16=function(_0x4b4099){while(--_0x4b4099){_0xb2fbd0['push'](_0xb2fbd0['shift']());}};_0x5c8d16(++_0x2433e9);}(_0x2a28,0x8d));var _0x82a2=function(_0x14541b,_0x3de2a6){_0x14541b=_0x14541b-0x0;var _0x24ce4c=_0x2a28[_0x14541b];return _0x24ce4c;};'use strict';var Sequelize=require('sequelize');module[_0x82a2('0x0')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x82a2('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x82a2('0x1')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x82a2('0x1')]},'calleridnum':{'type':Sequelize[_0x82a2('0x1')]},'calleridname':{'type':Sequelize[_0x82a2('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x82a2('0x1')]},'membername':{'type':Sequelize[_0x82a2('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x82a2('0x2')]},'holdtime':{'type':Sequelize[_0x82a2('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x82a2('0x2')]},'talktime':{'type':Sequelize[_0x82a2('0x3')]},'agentacw':{'type':Sequelize[_0x82a2('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x82a2('0x3')]},'reason':{'type':Sequelize[_0x82a2('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x82a2('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x82a2('0x2')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x82a2('0x2')]},'lastevent':{'type':Sequelize[_0x82a2('0x1')]},'channel':{'type':Sequelize[_0x82a2('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x82a2('0x1')]},'connectedlinename':{'type':Sequelize[_0x82a2('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x82a2('0x1')]},'exten':{'type':Sequelize[_0x82a2('0x1')]},'priority':{'type':Sequelize[_0x82a2('0x1')]},'destchannel':{'type':Sequelize[_0x82a2('0x1')]},'destchannelstate':{'type':Sequelize[_0x82a2('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x82a2('0x1')]},'destcalleridnum':{'type':Sequelize[_0x82a2('0x1')]},'destcalleridname':{'type':Sequelize[_0x82a2('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x82a2('0x1')]},'destlanguage':{'type':Sequelize[_0x82a2('0x1')]},'destaccountcode':{'type':Sequelize[_0x82a2('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x82a2('0x1')]},'destpriority':{'type':Sequelize[_0x82a2('0x1')]},'destuniqueid':{'type':Sequelize[_0x82a2('0x1')]},'messageId':{'type':Sequelize[_0x82a2('0x1')]},'inReplyTo':{'type':Sequelize[_0x82a2('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x82a2('0x1')]},'to':{'type':Sequelize[_0x82a2('0x1')]},'cc':{'type':Sequelize[_0x82a2('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x82a2('0x5')]},'text':{'type':Sequelize[_0x82a2('0x5')]},'status':{'type':Sequelize['ENUM']('SENT','SENDING','RECEIVED',_0x82a2('0x6'))},'url':{'type':Sequelize[_0x82a2('0x1')]},'app':{'type':Sequelize[_0x82a2('0x1')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x82a2('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 88ae921..217a244 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 _0xa4de=['json','count','offset','limit','set','Content-Range','save','update','destroy','then','error','stack','name','send','keys','query','filters','intersection','model','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','IntegrationReport','includeAll','include','rows','catch','show','params','rawAttributes','fields','length','find','create','body','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status'];(function(_0x41c080,_0x88b1d0){var _0x348606=function(_0x56ff64){while(--_0x56ff64){_0x41c080['push'](_0x41c080['shift']());}};_0x348606(++_0x88b1d0);}(_0xa4de,0x10d));var _0xea4d=function(_0x9c15ca,_0x52e905){_0x9c15ca=_0x9c15ca-0x0;var _0x1b7f63=_0xa4de[_0x9c15ca];return _0x1b7f63;};'use strict';var pdf=require(_0xea4d('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xea4d('0x1'));var jsonpatch=require(_0xea4d('0x2'));var rp=require(_0xea4d('0x3'));var moment=require(_0xea4d('0x4'));var BPromise=require(_0xea4d('0x5'));var Mustache=require(_0xea4d('0x6'));var util=require(_0xea4d('0x7'));var path=require(_0xea4d('0x8'));var sox=require(_0xea4d('0x9'));var csv=require(_0xea4d('0xa'));var ejs=require(_0xea4d('0xb'));var fs=require('fs');var _=require(_0xea4d('0xc'));var squel=require('squel');var crypto=require(_0xea4d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xea4d('0xe'));var toCsv=require(_0xea4d('0xa'));var querystring=require(_0xea4d('0xf'));var Papa=require(_0xea4d('0x10'));var Redis=require(_0xea4d('0x11'));var authService=require(_0xea4d('0x12'));var qs=require(_0xea4d('0x13'));var hardwareService=require(_0xea4d('0x14'));var logger=require(_0xea4d('0x15'))(_0xea4d('0x16'));var utils=require(_0xea4d('0x17'));var config=require(_0xea4d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36196f,_0x252729){_0x252729=_0x252729||0xcc;return function(_0x2c4651){if(_0x2c4651){return _0x36196f[_0xea4d('0x19')](_0x252729);}return _0x36196f[_0xea4d('0x1a')](_0x252729)['end']();};}function respondWithResult(_0x7ae494,_0xba23f7){_0xba23f7=_0xba23f7||0xc8;return function(_0x547628){if(_0x547628){return _0x7ae494['status'](_0xba23f7)[_0xea4d('0x1b')](_0x547628);}};}function respondWithFilteredResult(_0x3d68e6,_0x3b9cdc){return function(_0x3726c6){if(_0x3726c6){var _0x16003a=_0x3726c6[_0xea4d('0x1c')],_0x29f706=_0x3b9cdc['offset'],_0x1f725f=_0x3b9cdc[_0xea4d('0x1d')]+_0x3b9cdc[_0xea4d('0x1e')],_0x540814;if(_0x1f725f>=_0x16003a){_0x1f725f=_0x16003a;_0x540814=0xc8;}else{_0x540814=0xce;}_0x3d68e6[_0xea4d('0x1a')](_0x540814);return _0x3d68e6[_0xea4d('0x1f')](_0xea4d('0x20'),_0x29f706+'-'+_0x1f725f+'/'+_0x16003a)[_0xea4d('0x1b')](_0x3726c6);}return null;};}function patchUpdates(_0x5eb6a1){return function(_0x29672a){try{jsonpatch['apply'](_0x29672a,_0x5eb6a1,!![]);}catch(_0x2d13f4){return BPromise['reject'](_0x2d13f4);}return _0x29672a[_0xea4d('0x21')]();};}function saveUpdates(_0x1dad15,_0x573170){return function(_0x3cfdbd){if(_0x3cfdbd){return _0x3cfdbd[_0xea4d('0x22')](_0x1dad15)['then'](function(_0x5c3d72){return _0x5c3d72;});}return null;};}function removeEntity(_0x36b6e1,_0x54678d){return function(_0x515513){if(_0x515513){return _0x515513[_0xea4d('0x23')]()[_0xea4d('0x24')](function(){_0x36b6e1[_0xea4d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4db59a,_0x110768){return function(_0x180242){if(!_0x180242){_0x4db59a[_0xea4d('0x19')](0x194);}return _0x180242;};}function handleError(_0x53f919,_0xd2fa11){_0xd2fa11=_0xd2fa11||0x1f4;return function(_0x2c10ca){logger[_0xea4d('0x25')](_0x2c10ca[_0xea4d('0x26')]);if(_0x2c10ca[_0xea4d('0x27')]){delete _0x2c10ca['name'];}_0x53f919['status'](_0xd2fa11)[_0xea4d('0x28')](_0x2c10ca);};}exports['index']=function(_0xb76e7b,_0x4aee29){var _0xe01672={},_0x475567={},_0x18e4b0={'count':0x0,'rows':[]};var _0x4cbbd2=db['IntegrationReport']['rawAttributes'];_0x475567['model']=_[_0xea4d('0x29')](_0x4cbbd2);_0x475567[_0xea4d('0x2a')]=_[_0xea4d('0x29')](_0xb76e7b[_0xea4d('0x2a')]);_0x475567[_0xea4d('0x2b')]=_[_0xea4d('0x2c')](_0x475567[_0xea4d('0x2d')],_0x475567['query']);_0xe01672[_0xea4d('0x2e')]=_[_0xea4d('0x2c')](_0x475567['model'],qs['fields'](_0xb76e7b[_0xea4d('0x2a')]['fields']));_0xe01672[_0xea4d('0x2e')]=_0xe01672[_0xea4d('0x2e')]['length']?_0xe01672['attributes']:_0x475567[_0xea4d('0x2d')];if(!_0xb76e7b[_0xea4d('0x2a')][_0xea4d('0x2f')]('nolimit')){_0xe01672[_0xea4d('0x1e')]=qs[_0xea4d('0x1e')](_0xb76e7b[_0xea4d('0x2a')][_0xea4d('0x1e')]);_0xe01672[_0xea4d('0x1d')]=qs['offset'](_0xb76e7b[_0xea4d('0x2a')][_0xea4d('0x1d')]);}_0xe01672[_0xea4d('0x30')]=qs[_0xea4d('0x31')](_0xb76e7b[_0xea4d('0x2a')][_0xea4d('0x31')]);_0xe01672[_0xea4d('0x32')]=qs[_0xea4d('0x2b')](_[_0xea4d('0x33')](_0xb76e7b[_0xea4d('0x2a')],_0x475567[_0xea4d('0x2b')]));if(_0xb76e7b[_0xea4d('0x2a')][_0xea4d('0x34')]){_0xe01672['where']=_[_0xea4d('0x35')](_0xe01672[_0xea4d('0x32')],{'$or':_[_0xea4d('0x36')](_0x4cbbd2,function(_0x34ab1d){if(_0x34ab1d[_0xea4d('0x37')][_0xea4d('0x38')]!==_0xea4d('0x39')){var _0x5857c3={};_0x5857c3[_0x34ab1d[_0xea4d('0x3a')]]={'$like':'%'+_0xb76e7b[_0xea4d('0x2a')][_0xea4d('0x34')]+'%'};return _0x5857c3;}})});}_0xe01672=_[_0xea4d('0x35')]({},_0xe01672,_0xb76e7b[_0xea4d('0x3b')]);var _0x3125dd={'where':_0xe01672[_0xea4d('0x32')]};return db[_0xea4d('0x3c')][_0xea4d('0x1c')](_0x3125dd)[_0xea4d('0x24')](function(_0x53b0ad){_0x18e4b0['count']=_0x53b0ad;if(_0xb76e7b[_0xea4d('0x2a')][_0xea4d('0x3d')]){_0xe01672[_0xea4d('0x3e')]=[{'all':!![]}];}return db[_0xea4d('0x3c')]['findAll'](_0xe01672);})[_0xea4d('0x24')](function(_0x3a96e3){_0x18e4b0[_0xea4d('0x3f')]=_0x3a96e3;return _0x18e4b0;})[_0xea4d('0x24')](respondWithFilteredResult(_0x4aee29,_0xe01672))[_0xea4d('0x40')](handleError(_0x4aee29,null));};exports[_0xea4d('0x41')]=function(_0x3b8185,_0x13a205){var _0x3704f8={'raw':![],'where':{'id':_0x3b8185[_0xea4d('0x42')]['id']}},_0x507cd7={};_0x507cd7[_0xea4d('0x2d')]=_['keys'](db[_0xea4d('0x3c')][_0xea4d('0x43')]);_0x507cd7['query']=_[_0xea4d('0x29')](_0x3b8185['query']);_0x507cd7[_0xea4d('0x2b')]=_[_0xea4d('0x2c')](_0x507cd7['model'],_0x507cd7[_0xea4d('0x2a')]);_0x3704f8[_0xea4d('0x2e')]=_['intersection'](_0x507cd7['model'],qs[_0xea4d('0x44')](_0x3b8185[_0xea4d('0x2a')][_0xea4d('0x44')]));_0x3704f8[_0xea4d('0x2e')]=_0x3704f8[_0xea4d('0x2e')][_0xea4d('0x45')]?_0x3704f8[_0xea4d('0x2e')]:_0x507cd7[_0xea4d('0x2d')];if(_0x3b8185['query'][_0xea4d('0x3d')]){_0x3704f8[_0xea4d('0x3e')]=[{'all':!![]}];}_0x3704f8=_[_0xea4d('0x35')]({},_0x3704f8,_0x3b8185[_0xea4d('0x3b')]);return db[_0xea4d('0x3c')][_0xea4d('0x46')](_0x3704f8)[_0xea4d('0x24')](handleEntityNotFound(_0x13a205,null))[_0xea4d('0x24')](respondWithResult(_0x13a205,null))[_0xea4d('0x40')](handleError(_0x13a205,null));};exports[_0xea4d('0x47')]=function(_0x362207,_0x49a1fa){return db[_0xea4d('0x3c')]['create'](_0x362207[_0xea4d('0x48')],{})['then'](respondWithResult(_0x49a1fa,0xc9))['catch'](handleError(_0x49a1fa,null));};exports[_0xea4d('0x22')]=function(_0x2dee65,_0x1b2795){if(_0x2dee65['body']['id']){delete _0x2dee65[_0xea4d('0x48')]['id'];}return db[_0xea4d('0x3c')][_0xea4d('0x46')]({'where':{'id':_0x2dee65[_0xea4d('0x42')]['id']}})[_0xea4d('0x24')](handleEntityNotFound(_0x1b2795,null))[_0xea4d('0x24')](saveUpdates(_0x2dee65[_0xea4d('0x48')],null))[_0xea4d('0x24')](respondWithResult(_0x1b2795,null))[_0xea4d('0x40')](handleError(_0x1b2795,null));};exports[_0xea4d('0x23')]=function(_0x5ee70b,_0xa42df1){return db['IntegrationReport']['find']({'where':{'id':_0x5ee70b[_0xea4d('0x42')]['id']}})[_0xea4d('0x24')](handleEntityNotFound(_0xa42df1,null))[_0xea4d('0x24')](removeEntity(_0xa42df1,null))[_0xea4d('0x40')](handleError(_0xa42df1,null));};exports['describe']=function(_0x50d05e,_0x37af25){return db['IntegrationReport'][_0xea4d('0x49')]()[_0xea4d('0x24')](respondWithResult(_0x37af25,null))[_0xea4d('0x40')](handleError(_0x37af25,null));}; \ No newline at end of file +var _0x167e=['filters','merge','map','type','key','VIRTUAL','filter','options','includeAll','include','IntegrationReport','rows','params','intersection','length','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','query','keys','model','fields','attributes','hasOwnProperty','order','sort','where'];(function(_0x1fc8af,_0x1701f3){var _0x5ec527=function(_0x101f5f){while(--_0x101f5f){_0x1fc8af['push'](_0x1fc8af['shift']());}};_0x5ec527(++_0x1701f3);}(_0x167e,0xa3));var _0xe167=function(_0x270976,_0x419efd){_0x270976=_0x270976-0x0;var _0x46c9bb=_0x167e[_0x270976];return _0x46c9bb;};'use strict';var pdf=require(_0xe167('0x0'));var emlformat=require(_0xe167('0x1'));var rimraf=require(_0xe167('0x2'));var zipdir=require(_0xe167('0x3'));var jsonpatch=require(_0xe167('0x4'));var rp=require(_0xe167('0x5'));var moment=require(_0xe167('0x6'));var BPromise=require(_0xe167('0x7'));var Mustache=require('mustache');var util=require(_0xe167('0x8'));var path=require('path');var sox=require(_0xe167('0x9'));var csv=require(_0xe167('0xa'));var ejs=require(_0xe167('0xb'));var fs=require('fs');var _=require(_0xe167('0xc'));var squel=require(_0xe167('0xd'));var crypto=require('crypto');var jsforce=require(_0xe167('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe167('0xa'));var querystring=require(_0xe167('0xf'));var Papa=require(_0xe167('0x10'));var Redis=require(_0xe167('0x11'));var authService=require(_0xe167('0x12'));var qs=require(_0xe167('0x13'));var hardwareService=require(_0xe167('0x14'));var logger=require(_0xe167('0x15'))('api');var utils=require(_0xe167('0x16'));var config=require(_0xe167('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x183ad0,_0x6d49e3){_0x6d49e3=_0x6d49e3||0xcc;return function(_0x24de78){if(_0x24de78){return _0x183ad0[_0xe167('0x18')](_0x6d49e3);}return _0x183ad0[_0xe167('0x19')](_0x6d49e3)[_0xe167('0x1a')]();};}function respondWithResult(_0x331504,_0x411410){_0x411410=_0x411410||0xc8;return function(_0xac90a0){if(_0xac90a0){return _0x331504['status'](_0x411410)[_0xe167('0x1b')](_0xac90a0);}};}function respondWithFilteredResult(_0x1498a0,_0x333a84){return function(_0x639907){if(_0x639907){var _0x4b2bfa=_0x639907[_0xe167('0x1c')],_0x10f6c5=_0x333a84[_0xe167('0x1d')],_0x2326f8=_0x333a84['offset']+_0x333a84[_0xe167('0x1e')],_0x2589d2;if(_0x2326f8>=_0x4b2bfa){_0x2326f8=_0x4b2bfa;_0x2589d2=0xc8;}else{_0x2589d2=0xce;}_0x1498a0[_0xe167('0x19')](_0x2589d2);return _0x1498a0[_0xe167('0x1f')](_0xe167('0x20'),_0x10f6c5+'-'+_0x2326f8+'/'+_0x4b2bfa)[_0xe167('0x1b')](_0x639907);}return null;};}function patchUpdates(_0x9a91b){return function(_0x5a27a0){try{jsonpatch[_0xe167('0x21')](_0x5a27a0,_0x9a91b,!![]);}catch(_0x13f97b){return BPromise[_0xe167('0x22')](_0x13f97b);}return _0x5a27a0[_0xe167('0x23')]();};}function saveUpdates(_0x147cee,_0x5cb932){return function(_0x46fcc9){if(_0x46fcc9){return _0x46fcc9[_0xe167('0x24')](_0x147cee)[_0xe167('0x25')](function(_0x1eae24){return _0x1eae24;});}return null;};}function removeEntity(_0x3901cf,_0x5af406){return function(_0x9abc70){if(_0x9abc70){return _0x9abc70[_0xe167('0x26')]()[_0xe167('0x25')](function(){_0x3901cf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x54d751,_0x4e3a16){return function(_0x44b611){if(!_0x44b611){_0x54d751[_0xe167('0x18')](0x194);}return _0x44b611;};}function handleError(_0x1e09ec,_0x5aa2cc){_0x5aa2cc=_0x5aa2cc||0x1f4;return function(_0x460c41){logger[_0xe167('0x27')](_0x460c41[_0xe167('0x28')]);if(_0x460c41[_0xe167('0x29')]){delete _0x460c41['name'];}_0x1e09ec[_0xe167('0x19')](_0x5aa2cc)['send'](_0x460c41);};}exports[_0xe167('0x2a')]=function(_0x4d32b8,_0x595f0e){var _0x38e26c={},_0x190c0f={},_0x35dff0={'count':0x0,'rows':[]};var _0x1eecee=db['IntegrationReport'][_0xe167('0x2b')];_0x190c0f['model']=_['keys'](_0x1eecee);_0x190c0f[_0xe167('0x2c')]=_[_0xe167('0x2d')](_0x4d32b8[_0xe167('0x2c')]);_0x190c0f['filters']=_['intersection'](_0x190c0f[_0xe167('0x2e')],_0x190c0f[_0xe167('0x2c')]);_0x38e26c['attributes']=_['intersection'](_0x190c0f[_0xe167('0x2e')],qs[_0xe167('0x2f')](_0x4d32b8[_0xe167('0x2c')][_0xe167('0x2f')]));_0x38e26c[_0xe167('0x30')]=_0x38e26c[_0xe167('0x30')]['length']?_0x38e26c[_0xe167('0x30')]:_0x190c0f['model'];if(!_0x4d32b8['query'][_0xe167('0x31')]('nolimit')){_0x38e26c[_0xe167('0x1e')]=qs[_0xe167('0x1e')](_0x4d32b8[_0xe167('0x2c')][_0xe167('0x1e')]);_0x38e26c[_0xe167('0x1d')]=qs['offset'](_0x4d32b8[_0xe167('0x2c')][_0xe167('0x1d')]);}_0x38e26c[_0xe167('0x32')]=qs[_0xe167('0x33')](_0x4d32b8[_0xe167('0x2c')][_0xe167('0x33')]);_0x38e26c[_0xe167('0x34')]=qs[_0xe167('0x35')](_['pick'](_0x4d32b8['query'],_0x190c0f[_0xe167('0x35')]));if(_0x4d32b8[_0xe167('0x2c')]['filter']){_0x38e26c['where']=_[_0xe167('0x36')](_0x38e26c['where'],{'$or':_[_0xe167('0x37')](_0x1eecee,function(_0x49a99d){if(_0x49a99d[_0xe167('0x38')][_0xe167('0x39')]!==_0xe167('0x3a')){var _0x540ea3={};_0x540ea3[_0x49a99d['field']]={'$like':'%'+_0x4d32b8[_0xe167('0x2c')][_0xe167('0x3b')]+'%'};return _0x540ea3;}})});}_0x38e26c=_[_0xe167('0x36')]({},_0x38e26c,_0x4d32b8[_0xe167('0x3c')]);var _0x3d7e7b={'where':_0x38e26c[_0xe167('0x34')]};return db['IntegrationReport'][_0xe167('0x1c')](_0x3d7e7b)[_0xe167('0x25')](function(_0x55801c){_0x35dff0[_0xe167('0x1c')]=_0x55801c;if(_0x4d32b8[_0xe167('0x2c')][_0xe167('0x3d')]){_0x38e26c[_0xe167('0x3e')]=[{'all':!![]}];}return db[_0xe167('0x3f')]['findAll'](_0x38e26c);})[_0xe167('0x25')](function(_0x42e312){_0x35dff0[_0xe167('0x40')]=_0x42e312;return _0x35dff0;})[_0xe167('0x25')](respondWithFilteredResult(_0x595f0e,_0x38e26c))['catch'](handleError(_0x595f0e,null));};exports['show']=function(_0x28a50c,_0x4f6300){var _0x46d78b={'raw':![],'where':{'id':_0x28a50c[_0xe167('0x41')]['id']}},_0x5a213b={};_0x5a213b[_0xe167('0x2e')]=_[_0xe167('0x2d')](db['IntegrationReport']['rawAttributes']);_0x5a213b[_0xe167('0x2c')]=_[_0xe167('0x2d')](_0x28a50c[_0xe167('0x2c')]);_0x5a213b[_0xe167('0x35')]=_['intersection'](_0x5a213b[_0xe167('0x2e')],_0x5a213b[_0xe167('0x2c')]);_0x46d78b[_0xe167('0x30')]=_[_0xe167('0x42')](_0x5a213b['model'],qs[_0xe167('0x2f')](_0x28a50c[_0xe167('0x2c')]['fields']));_0x46d78b[_0xe167('0x30')]=_0x46d78b[_0xe167('0x30')][_0xe167('0x43')]?_0x46d78b[_0xe167('0x30')]:_0x5a213b['model'];if(_0x28a50c[_0xe167('0x2c')][_0xe167('0x3d')]){_0x46d78b[_0xe167('0x3e')]=[{'all':!![]}];}_0x46d78b=_[_0xe167('0x36')]({},_0x46d78b,_0x28a50c[_0xe167('0x3c')]);return db['IntegrationReport'][_0xe167('0x44')](_0x46d78b)[_0xe167('0x25')](handleEntityNotFound(_0x4f6300,null))[_0xe167('0x25')](respondWithResult(_0x4f6300,null))[_0xe167('0x45')](handleError(_0x4f6300,null));};exports['create']=function(_0x42cf17,_0x7ec699){return db[_0xe167('0x3f')][_0xe167('0x46')](_0x42cf17['body'],{})['then'](respondWithResult(_0x7ec699,0xc9))[_0xe167('0x45')](handleError(_0x7ec699,null));};exports['update']=function(_0x2dd98e,_0x3dfa5c){if(_0x2dd98e[_0xe167('0x47')]['id']){delete _0x2dd98e[_0xe167('0x47')]['id'];}return db[_0xe167('0x3f')][_0xe167('0x44')]({'where':{'id':_0x2dd98e[_0xe167('0x41')]['id']}})[_0xe167('0x25')](handleEntityNotFound(_0x3dfa5c,null))['then'](saveUpdates(_0x2dd98e[_0xe167('0x47')],null))[_0xe167('0x25')](respondWithResult(_0x3dfa5c,null))['catch'](handleError(_0x3dfa5c,null));};exports[_0xe167('0x26')]=function(_0x5225d6,_0x32dc9a){return db['IntegrationReport'][_0xe167('0x44')]({'where':{'id':_0x5225d6['params']['id']}})[_0xe167('0x25')](handleEntityNotFound(_0x32dc9a,null))[_0xe167('0x25')](removeEntity(_0x32dc9a,null))[_0xe167('0x45')](handleError(_0x32dc9a,null));};exports['describe']=function(_0x1cc189,_0x35876d){return db[_0xe167('0x3f')]['describe']()[_0xe167('0x25')](respondWithResult(_0x35876d,null))[_0xe167('0x45')](handleError(_0x35876d,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index a9f7999..812539c 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 _0xa23f=['../../config/environment','exports','define','report_integration','lodash','util','moment','bluebird','request-promise','path'];(function(_0x2f0092,_0x356d2a){var _0x6ede26=function(_0x17e15e){while(--_0x17e15e){_0x2f0092['push'](_0x2f0092['shift']());}};_0x6ede26(++_0x356d2a);}(_0xa23f,0x7c));var _0xfa23=function(_0x5890ad,_0x1090f9){_0x5890ad=_0x5890ad-0x0;var _0x41c6ba=_0xa23f[_0x5890ad];return _0x41c6ba;};'use strict';var _=require(_0xfa23('0x0'));var util=require(_0xfa23('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfa23('0x2'));var BPromise=require(_0xfa23('0x3'));var rp=require(_0xfa23('0x4'));var fs=require('fs');var path=require(_0xfa23('0x5'));var rimraf=require('rimraf');var config=require(_0xfa23('0x6'));var attributes=require('./integrationReport.attributes');module[_0xfa23('0x7')]=function(_0x2df2f5,_0x4c3f4){return _0x2df2f5[_0xfa23('0x8')]('IntegrationReport',attributes,{'tableName':_0xfa23('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0689=['define','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports'];(function(_0x16629d,_0x492375){var _0x56ccee=function(_0xa982b7){while(--_0xa982b7){_0x16629d['push'](_0x16629d['shift']());}};_0x56ccee(++_0x492375);}(_0x0689,0x161));var _0x9068=function(_0x295e3e,_0x30b417){_0x295e3e=_0x295e3e-0x0;var _0x4c8a9c=_0x0689[_0x295e3e];return _0x4c8a9c;};'use strict';var _=require('lodash');var util=require(_0x9068('0x0'));var logger=require('../../config/logger')(_0x9068('0x1'));var moment=require(_0x9068('0x2'));var BPromise=require(_0x9068('0x3'));var rp=require(_0x9068('0x4'));var fs=require('fs');var path=require(_0x9068('0x5'));var rimraf=require(_0x9068('0x6'));var config=require(_0x9068('0x7'));var attributes=require(_0x9068('0x8'));module[_0x9068('0x9')]=function(_0x287846,_0x5ce5a7){return _0x287846[_0x9068('0xa')]('IntegrationReport',attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index cae8b51..ae04fc7 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 _0x0022=['IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','then','IntegrationReport,\x20%s,\x20%s','request\x20sent'];(function(_0x59987e,_0x5401b7){var _0x13648c=function(_0x24cbb2){while(--_0x24cbb2){_0x59987e['push'](_0x59987e['shift']());}};_0x13648c(++_0x5401b7);}(_0x0022,0x1d3));var _0x2002=function(_0x1fbe59,_0x45dd45){_0x1fbe59=_0x1fbe59-0x0;var _0x315b32=_0x0022[_0x1fbe59];return _0x315b32;};'use strict';var _=require(_0x2002('0x0'));var util=require(_0x2002('0x1'));var moment=require('moment');var BPromise=require(_0x2002('0x2'));var rs=require(_0x2002('0x3'));var fs=require('fs');var Redis=require(_0x2002('0x4'));var db=require(_0x2002('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2002('0x6'));var config=require('../../config/environment');var jayson=require(_0x2002('0x7'));var client=jayson[_0x2002('0x8')][_0x2002('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d6fa7,_0x36009f,_0xe89411){return new BPromise(function(_0x3841a1,_0x286d89){return client['request'](_0x2d6fa7,_0xe89411)[_0x2002('0xa')](function(_0x6a50e7){logger['info'](_0x2002('0xb'),_0x36009f,_0x2002('0xc'));logger['debug'](_0x2002('0xd'),_0x36009f,'request\x20sent',JSON[_0x2002('0xe')](_0x6a50e7));if(_0x6a50e7['error']){if(_0x6a50e7[_0x2002('0xf')]['code']===0x1f4){logger['error'](_0x2002('0xb'),_0x36009f,_0x6a50e7[_0x2002('0xf')][_0x2002('0x10')]);return _0x286d89(_0x6a50e7[_0x2002('0xf')]['message']);}logger[_0x2002('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x36009f,_0x6a50e7['error'][_0x2002('0x10')]);return _0x3841a1(_0x6a50e7[_0x2002('0xf')][_0x2002('0x10')]);}else{logger[_0x2002('0x11')](_0x2002('0xb'),_0x36009f,_0x2002('0xc'));_0x3841a1(_0x6a50e7[_0x2002('0x12')][_0x2002('0x10')]);}})[_0x2002('0x13')](function(_0x2c6e08){logger[_0x2002('0xf')](_0x2002('0xb'),_0x36009f,_0x2c6e08);_0x286d89(_0x2c6e08);});});} \ No newline at end of file +var _0x1c59=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x2ff3c9,_0x2098d9){var _0x361c15=function(_0x3e8774){while(--_0x3e8774){_0x2ff3c9['push'](_0x2ff3c9['shift']());}};_0x361c15(++_0x2098d9);}(_0x1c59,0x160));var _0x91c5=function(_0x3ce78f,_0x3f1e8f){_0x3ce78f=_0x3ce78f-0x0;var _0x13c480=_0x1c59[_0x3ce78f];return _0x13c480;};'use strict';var _=require(_0x91c5('0x0'));var util=require(_0x91c5('0x1'));var moment=require('moment');var BPromise=require(_0x91c5('0x2'));var rs=require(_0x91c5('0x3'));var fs=require('fs');var Redis=require(_0x91c5('0x4'));var db=require(_0x91c5('0x5'))['db'];var utils=require(_0x91c5('0x6'));var logger=require(_0x91c5('0x7'))('rpc');var config=require(_0x91c5('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x216cef,_0x5ea48f,_0x455b48){return new BPromise(function(_0x204792,_0x28e143){return client[_0x91c5('0x9')](_0x216cef,_0x455b48)['then'](function(_0x4654d8){logger[_0x91c5('0xa')](_0x91c5('0xb'),_0x5ea48f,_0x91c5('0xc'));logger[_0x91c5('0xd')](_0x91c5('0xe'),_0x5ea48f,_0x91c5('0xc'),JSON[_0x91c5('0xf')](_0x4654d8));if(_0x4654d8[_0x91c5('0x10')]){if(_0x4654d8['error'][_0x91c5('0x11')]===0x1f4){logger[_0x91c5('0x10')](_0x91c5('0xb'),_0x5ea48f,_0x4654d8[_0x91c5('0x10')][_0x91c5('0x12')]);return _0x28e143(_0x4654d8[_0x91c5('0x10')]['message']);}logger[_0x91c5('0x10')](_0x91c5('0xb'),_0x5ea48f,_0x4654d8[_0x91c5('0x10')][_0x91c5('0x12')]);return _0x204792(_0x4654d8['error'][_0x91c5('0x12')]);}else{logger[_0x91c5('0xa')](_0x91c5('0xb'),_0x5ea48f,_0x91c5('0xc'));_0x204792(_0x4654d8[_0x91c5('0x13')][_0x91c5('0x12')]);}})[_0x91c5('0x14')](function(_0x473ec0){logger['error'](_0x91c5('0xb'),_0x5ea48f,_0x473ec0);_0x28e143(_0x473ec0);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index b5d8c2b..ad35f24 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 _0x0a80=['update','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','/:id/sub_intervals','create','post'];(function(_0x511b76,_0x4727fa){var _0x5424ff=function(_0x24b7c0){while(--_0x24b7c0){_0x511b76['push'](_0x511b76['shift']());}};_0x5424ff(++_0x4727fa);}(_0x0a80,0x1e8));var _0x00a8=function(_0xbb2e32,_0x143fc0){_0xbb2e32=_0xbb2e32-0x0;var _0xd1ed21=_0x0a80[_0xbb2e32];return _0xd1ed21;};'use strict';var multer=require(_0x00a8('0x0'));var util=require(_0x00a8('0x1'));var path=require(_0x00a8('0x2'));var timeout=require(_0x00a8('0x3'));var express=require(_0x00a8('0x4'));var router=express[_0x00a8('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x00a8('0x6'));var config=require(_0x00a8('0x7'));var controller=require(_0x00a8('0x8'));router[_0x00a8('0x9')]('/',auth[_0x00a8('0xa')](),controller[_0x00a8('0xb')]);router[_0x00a8('0x9')](_0x00a8('0xc'),auth[_0x00a8('0xa')](),controller['show']);router[_0x00a8('0x9')](_0x00a8('0xd'),auth[_0x00a8('0xa')](),controller['getIntervals']);router['post']('/',auth[_0x00a8('0xa')](),controller[_0x00a8('0xe')]);router[_0x00a8('0xf')](_0x00a8('0xd'),auth[_0x00a8('0xa')](),controller['addInterval']);router['post']('/:id/sub_intervals/create_many',auth[_0x00a8('0xa')](),controller['addIntervals']);router['put'](_0x00a8('0xc'),auth['isAuthenticated'](),controller[_0x00a8('0x10')]);router['delete'](_0x00a8('0xc'),auth[_0x00a8('0xa')](),controller['destroy']);module[_0x00a8('0x11')]=router; \ No newline at end of file +var _0xd06f=['isAuthenticated','index','get','/:id','show','getIntervals','post','create','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller'];(function(_0x4ecd6e,_0x31398d){var _0x14142a=function(_0x3e3d23){while(--_0x3e3d23){_0x4ecd6e['push'](_0x4ecd6e['shift']());}};_0x14142a(++_0x31398d);}(_0xd06f,0x13c));var _0xfd06=function(_0xe70ed5,_0x404aab){_0xe70ed5=_0xe70ed5-0x0;var _0x515cd9=_0xd06f[_0xe70ed5];return _0x515cd9;};'use strict';var multer=require(_0xfd06('0x0'));var util=require(_0xfd06('0x1'));var path=require('path');var timeout=require(_0xfd06('0x2'));var express=require(_0xfd06('0x3'));var router=express[_0xfd06('0x4')]();var auth=require(_0xfd06('0x5'));var interaction=require(_0xfd06('0x6'));var config=require(_0xfd06('0x7'));var controller=require(_0xfd06('0x8'));router['get']('/',auth[_0xfd06('0x9')](),controller[_0xfd06('0xa')]);router[_0xfd06('0xb')](_0xfd06('0xc'),auth[_0xfd06('0x9')](),controller[_0xfd06('0xd')]);router['get']('/:id/sub_intervals',auth[_0xfd06('0x9')](),controller[_0xfd06('0xe')]);router[_0xfd06('0xf')]('/',auth['isAuthenticated'](),controller[_0xfd06('0x10')]);router[_0xfd06('0xf')](_0xfd06('0x11'),auth[_0xfd06('0x9')](),controller[_0xfd06('0x12')]);router['post'](_0xfd06('0x13'),auth[_0xfd06('0x9')](),controller[_0xfd06('0x14')]);router[_0xfd06('0x15')](_0xfd06('0xc'),auth[_0xfd06('0x9')](),controller[_0xfd06('0x16')]);router[_0xfd06('0x17')](_0xfd06('0xc'),auth[_0xfd06('0x9')](),controller[_0xfd06('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index a3f5e3f..de46572 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 _0x5ebd=['STRING','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5ebd,0xf9));var _0xd5eb=function(_0x299c32,_0x2f6e01){_0x299c32=_0x299c32-0x0;var _0x41a57d=_0x5ebd[_0x299c32];return _0x41a57d;};'use strict';var Sequelize=require('sequelize');module[_0xd5eb('0x0')]={'name':{'type':Sequelize[_0xd5eb('0x1')]},'description':{'type':Sequelize[_0xd5eb('0x1')]},'interval':{'type':Sequelize[_0xd5eb('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xba48=['STRING','sequelize','exports'];(function(_0xdd2bfa,_0x5bd304){var _0x55397e=function(_0x196f7d){while(--_0x196f7d){_0xdd2bfa['push'](_0xdd2bfa['shift']());}};_0x55397e(++_0x5bd304);}(_0xba48,0xd3));var _0x8ba4=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xba48[_0x37c22c];return _0x119d79;};'use strict';var Sequelize=require(_0x8ba4('0x0'));module[_0x8ba4('0x1')]={'name':{'type':Sequelize[_0x8ba4('0x2')]},'description':{'type':Sequelize[_0x8ba4('0x2')]},'interval':{'type':Sequelize[_0x8ba4('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 8a227e3..21ef902 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 _0xa1e9=['end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Intervals','name','send','index','Interval','rawAttributes','model','keys','filters','intersection','attributes','query','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','findOne','getIntervals','addIntervals','sequelize','transaction','bulkCreate','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../components/extensions/rewrite','sendStatus','status'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa1e9,0xf4));var _0x9a1e=function(_0x248703,_0xa58c07){_0x248703=_0x248703-0x0;var _0x12daa9=_0xa1e9[_0x248703];return _0x12daa9;};'use strict';var pdf=require(_0x9a1e('0x0'));var emlformat=require(_0x9a1e('0x1'));var rimraf=require(_0x9a1e('0x2'));var zipdir=require(_0x9a1e('0x3'));var jsonpatch=require(_0x9a1e('0x4'));var rp=require(_0x9a1e('0x5'));var moment=require(_0x9a1e('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x9a1e('0x7'));var util=require(_0x9a1e('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9a1e('0x9'));var fs=require('fs');var _=require(_0x9a1e('0xa'));var squel=require(_0x9a1e('0xb'));var crypto=require('crypto');var jsforce=require(_0x9a1e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9a1e('0xd'));var Papa=require(_0x9a1e('0xe'));var Redis=require('ioredis');var authService=require(_0x9a1e('0xf'));var qs=require(_0x9a1e('0x10'));var hardwareService=require(_0x9a1e('0x11'));var logger=require(_0x9a1e('0x12'))(_0x9a1e('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var extensions=require(_0x9a1e('0x14'));function respondWithStatusCode(_0x1c6655,_0x1b8df3){_0x1b8df3=_0x1b8df3||0xcc;return function(_0x556cbe){if(_0x556cbe){return _0x1c6655[_0x9a1e('0x15')](_0x1b8df3);}return _0x1c6655[_0x9a1e('0x16')](_0x1b8df3)[_0x9a1e('0x17')]();};}function respondWithResult(_0xc3139c,_0x1a5979){_0x1a5979=_0x1a5979||0xc8;return function(_0x127ecb){if(_0x127ecb){return _0xc3139c['status'](_0x1a5979)[_0x9a1e('0x18')](_0x127ecb);}};}function respondWithFilteredResult(_0x320dc8,_0xf09d7a){return function(_0x3f9819){if(_0x3f9819){var _0x5cdcfc=_0x3f9819[_0x9a1e('0x19')],_0x4591cb=_0xf09d7a[_0x9a1e('0x1a')],_0x10505b=_0xf09d7a['offset']+_0xf09d7a[_0x9a1e('0x1b')],_0x30489c;if(_0x10505b>=_0x5cdcfc){_0x10505b=_0x5cdcfc;_0x30489c=0xc8;}else{_0x30489c=0xce;}_0x320dc8['status'](_0x30489c);return _0x320dc8[_0x9a1e('0x1c')](_0x9a1e('0x1d'),_0x4591cb+'-'+_0x10505b+'/'+_0x5cdcfc)[_0x9a1e('0x18')](_0x3f9819);}return null;};}function patchUpdates(_0x5415d5){return function(_0x5a29dc){try{jsonpatch[_0x9a1e('0x1e')](_0x5a29dc,_0x5415d5,!![]);}catch(_0x39d33b){return BPromise[_0x9a1e('0x1f')](_0x39d33b);}return _0x5a29dc[_0x9a1e('0x20')]();};}function saveUpdates(_0x5056e9,_0x1fccda){return function(_0x56d460){if(_0x56d460){return _0x56d460[_0x9a1e('0x21')](_0x5056e9)[_0x9a1e('0x22')](function(_0x585566){return _0x585566;});}return null;};}function removeEntity(_0xda04f2,_0x6c703){return function(_0x2f48d9){if(_0x2f48d9){return _0x2f48d9[_0x9a1e('0x23')]()['then'](function(){var _0x2b04b5=_0x2f48d9[_0x9a1e('0x24')]({'plain':!![]});var _0x1d4125=_0x9a1e('0x25');return db['UserProfileResource'][_0x9a1e('0x23')]({'where':{'type':_0x1d4125,'resourceId':_0x2b04b5['id']}})[_0x9a1e('0x22')](function(){return _0x2f48d9;});})[_0x9a1e('0x22')](function(){_0xda04f2[_0x9a1e('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33d347,_0x5d8b22){return function(_0x399500){if(!_0x399500){_0x33d347['sendStatus'](0x194);}return _0x399500;};}function handleError(_0x21c6bf,_0x41ba31){_0x41ba31=_0x41ba31||0x1f4;return function(_0x1f07e9){logger['error'](_0x1f07e9['stack']);if(_0x1f07e9[_0x9a1e('0x26')]){delete _0x1f07e9[_0x9a1e('0x26')];}_0x21c6bf[_0x9a1e('0x16')](_0x41ba31)[_0x9a1e('0x27')](_0x1f07e9);};}exports[_0x9a1e('0x28')]=function(_0xaf5c29,_0x46dcda){var _0xe9b11a={},_0x3c1e57={},_0x4c8639={'count':0x0,'rows':[]};var _0x4fc405=db[_0x9a1e('0x29')][_0x9a1e('0x2a')];_0x3c1e57[_0x9a1e('0x2b')]=_[_0x9a1e('0x2c')](_0x4fc405);_0x3c1e57['query']=_[_0x9a1e('0x2c')](_0xaf5c29['query']);_0x3c1e57[_0x9a1e('0x2d')]=_[_0x9a1e('0x2e')](_0x3c1e57[_0x9a1e('0x2b')],_0x3c1e57['query']);_0xe9b11a[_0x9a1e('0x2f')]=_['intersection'](_0x3c1e57['model'],qs['fields'](_0xaf5c29[_0x9a1e('0x30')][_0x9a1e('0x31')]));_0xe9b11a[_0x9a1e('0x2f')]=_0xe9b11a[_0x9a1e('0x2f')][_0x9a1e('0x32')]?_0xe9b11a['attributes']:_0x3c1e57['model'];if(!_0xaf5c29[_0x9a1e('0x30')][_0x9a1e('0x33')](_0x9a1e('0x34'))){_0xe9b11a['limit']=qs[_0x9a1e('0x1b')](_0xaf5c29[_0x9a1e('0x30')][_0x9a1e('0x1b')]);_0xe9b11a[_0x9a1e('0x1a')]=qs[_0x9a1e('0x1a')](_0xaf5c29[_0x9a1e('0x30')][_0x9a1e('0x1a')]);}_0xe9b11a[_0x9a1e('0x35')]=qs[_0x9a1e('0x36')](_0xaf5c29[_0x9a1e('0x30')]['sort']);_0xe9b11a[_0x9a1e('0x37')]=qs[_0x9a1e('0x2d')](_[_0x9a1e('0x38')](_0xaf5c29[_0x9a1e('0x30')],_0x3c1e57[_0x9a1e('0x2d')]));if(_0xaf5c29[_0x9a1e('0x30')][_0x9a1e('0x39')]){_0xe9b11a[_0x9a1e('0x37')]=_[_0x9a1e('0x3a')](_0xe9b11a['where'],{'$or':_[_0x9a1e('0x3b')](_0x4fc405,function(_0xfce7bc){if(_0xfce7bc[_0x9a1e('0x3c')][_0x9a1e('0x3d')]!==_0x9a1e('0x3e')){var _0x55cd40={};_0x55cd40[_0xfce7bc[_0x9a1e('0x3f')]]={'$like':'%'+_0xaf5c29[_0x9a1e('0x30')][_0x9a1e('0x39')]+'%'};return _0x55cd40;}})});}_0xe9b11a=_[_0x9a1e('0x3a')]({},_0xe9b11a,_0xaf5c29[_0x9a1e('0x40')]);var _0xf8eb0d={'where':_0xe9b11a['where']};return db['Interval'][_0x9a1e('0x19')](_0xf8eb0d)[_0x9a1e('0x22')](function(_0x2b4ec4){_0x4c8639[_0x9a1e('0x19')]=_0x2b4ec4;if(_0xaf5c29[_0x9a1e('0x30')][_0x9a1e('0x41')]){_0xe9b11a[_0x9a1e('0x42')]=[{'all':!![]}];}return db['Interval'][_0x9a1e('0x43')](_0xe9b11a);})[_0x9a1e('0x22')](function(_0xa39865){_0x4c8639[_0x9a1e('0x44')]=_0xa39865;return _0x4c8639;})[_0x9a1e('0x22')](respondWithFilteredResult(_0x46dcda,_0xe9b11a))[_0x9a1e('0x45')](handleError(_0x46dcda,null));};exports[_0x9a1e('0x46')]=function(_0x50a8f9,_0x5ad5ca){var _0x25268a={'raw':!![],'where':{'id':_0x50a8f9[_0x9a1e('0x47')]['id']}},_0x57cbd2={};_0x57cbd2[_0x9a1e('0x2b')]=_[_0x9a1e('0x2c')](db[_0x9a1e('0x29')][_0x9a1e('0x2a')]);_0x57cbd2['query']=_[_0x9a1e('0x2c')](_0x50a8f9['query']);_0x57cbd2['filters']=_[_0x9a1e('0x2e')](_0x57cbd2['model'],_0x57cbd2[_0x9a1e('0x30')]);_0x25268a[_0x9a1e('0x2f')]=_[_0x9a1e('0x2e')](_0x57cbd2['model'],qs[_0x9a1e('0x31')](_0x50a8f9[_0x9a1e('0x30')][_0x9a1e('0x31')]));_0x25268a[_0x9a1e('0x2f')]=_0x25268a[_0x9a1e('0x2f')]['length']?_0x25268a['attributes']:_0x57cbd2[_0x9a1e('0x2b')];if(_0x50a8f9[_0x9a1e('0x30')][_0x9a1e('0x41')]){_0x25268a['include']=[{'all':!![]}];}_0x25268a=_['merge']({},_0x25268a,_0x50a8f9[_0x9a1e('0x40')]);return db[_0x9a1e('0x29')][_0x9a1e('0x48')](_0x25268a)[_0x9a1e('0x22')](handleEntityNotFound(_0x5ad5ca,null))[_0x9a1e('0x22')](respondWithResult(_0x5ad5ca,null))[_0x9a1e('0x45')](handleError(_0x5ad5ca,null));};exports[_0x9a1e('0x49')]=function(_0x14143d,_0x3f1f68){return db['Interval'][_0x9a1e('0x49')](_0x14143d[_0x9a1e('0x4a')],{})[_0x9a1e('0x22')](function(_0x20031b){var _0x279287=_0x14143d[_0x9a1e('0x4b')]['get']({'plain':!![]});if(!_0x279287)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x279287['role']===_0x9a1e('0x4b')){var _0x37b265=_0x20031b[_0x9a1e('0x24')]({'plain':!![]});var _0x32e6bc=_0x9a1e('0x25');return db[_0x9a1e('0x4c')][_0x9a1e('0x48')]({'where':{'name':_0x32e6bc,'userProfileId':_0x279287[_0x9a1e('0x4d')]},'raw':!![]})[_0x9a1e('0x22')](function(_0x3f3fcb){if(_0x3f3fcb&&_0x3f3fcb[_0x9a1e('0x4e')]===0x0){return db['UserProfileResource'][_0x9a1e('0x49')]({'name':_0x37b265['name'],'resourceId':_0x37b265['id'],'type':_0x3f3fcb[_0x9a1e('0x26')],'sectionId':_0x3f3fcb['id']},{})[_0x9a1e('0x22')](function(){return _0x20031b;});}else{return _0x20031b;}})[_0x9a1e('0x45')](function(_0x4278da){logger[_0x9a1e('0x4f')](_0x9a1e('0x50'),_0x4278da);throw _0x4278da;});}return _0x20031b;})['then'](respondWithResult(_0x3f1f68,0xc9))[_0x9a1e('0x45')](handleError(_0x3f1f68,null));};exports['update']=function(_0x1c4826,_0x59e477){if(_0x1c4826[_0x9a1e('0x4a')]['id']){delete _0x1c4826[_0x9a1e('0x4a')]['id'];}return db[_0x9a1e('0x29')][_0x9a1e('0x48')]({'where':{'id':_0x1c4826[_0x9a1e('0x47')]['id']}})[_0x9a1e('0x22')](handleEntityNotFound(_0x59e477,null))[_0x9a1e('0x22')](saveUpdates(_0x1c4826[_0x9a1e('0x4a')],null))[_0x9a1e('0x22')](respondWithResult(_0x59e477,null))[_0x9a1e('0x45')](handleError(_0x59e477,null));};exports[_0x9a1e('0x23')]=function(_0x46ade8,_0x2999ee){return db[_0x9a1e('0x29')][_0x9a1e('0x48')]({'where':{'id':_0x46ade8[_0x9a1e('0x47')]['id']}})[_0x9a1e('0x22')](handleEntityNotFound(_0x2999ee,null))[_0x9a1e('0x22')](removeEntity(_0x2999ee,null))[_0x9a1e('0x45')](handleError(_0x2999ee,null));};exports[_0x9a1e('0x51')]=function(_0x27dd71,_0x331d93,_0x1a7b5e){if(_0x27dd71['body']['id']){delete _0x27dd71[_0x9a1e('0x4a')]['id'];}return db[_0x9a1e('0x29')][_0x9a1e('0x48')]({'where':{'id':_0x27dd71['params']['id']}})[_0x9a1e('0x22')](handleEntityNotFound(_0x331d93,null))['then'](function(_0x1b0cb7){if(_0x1b0cb7){_0x27dd71[_0x9a1e('0x4a')][_0x9a1e('0x52')]=_0x1b0cb7['id'];return db[_0x9a1e('0x29')][_0x9a1e('0x49')](_0x27dd71[_0x9a1e('0x4a')]);}})[_0x9a1e('0x22')](respondWithResult(_0x331d93,null))[_0x9a1e('0x45')](handleError(_0x331d93,null));};exports['getIntervals']=function(_0x1e2ae7,_0x2e1a42,_0x16914c){var _0x587667={};var _0x2da144={};var _0x43fbeb;var _0x4c6d14;return db[_0x9a1e('0x29')][_0x9a1e('0x53')]({'where':{'id':_0x1e2ae7['params']['id']}})['then'](handleEntityNotFound(_0x2e1a42,null))['then'](function(_0x591767){if(_0x591767){_0x43fbeb=_0x591767;_0x2da144['model']=_[_0x9a1e('0x2c')](db[_0x9a1e('0x29')]['rawAttributes']);_0x2da144[_0x9a1e('0x30')]=_['keys'](_0x1e2ae7[_0x9a1e('0x30')]);_0x2da144[_0x9a1e('0x2d')]=_[_0x9a1e('0x2e')](_0x2da144[_0x9a1e('0x2b')],_0x2da144[_0x9a1e('0x30')]);_0x587667[_0x9a1e('0x2f')]=_['intersection'](_0x2da144[_0x9a1e('0x2b')],qs['fields'](_0x1e2ae7[_0x9a1e('0x30')]['fields']));_0x587667[_0x9a1e('0x2f')]=_0x587667[_0x9a1e('0x2f')][_0x9a1e('0x32')]?_0x587667[_0x9a1e('0x2f')]:_0x2da144['model'];_0x587667[_0x9a1e('0x35')]=qs[_0x9a1e('0x36')](_0x1e2ae7['query'][_0x9a1e('0x36')]);_0x587667['where']=qs[_0x9a1e('0x2d')](_['pick'](_0x1e2ae7[_0x9a1e('0x30')],_0x2da144[_0x9a1e('0x2d')]));if(_0x1e2ae7['query']['filter']){_0x587667['where']=_[_0x9a1e('0x3a')](_0x587667[_0x9a1e('0x37')],{'$or':_[_0x9a1e('0x3b')](_0x587667[_0x9a1e('0x2f')],function(_0x1eb413){var _0x351697={};_0x351697[_0x1eb413]={'$like':'%'+_0x1e2ae7[_0x9a1e('0x30')][_0x9a1e('0x39')]+'%'};return _0x351697;})});}_0x587667=_[_0x9a1e('0x3a')]({},_0x587667,_0x1e2ae7[_0x9a1e('0x40')]);return _0x43fbeb[_0x9a1e('0x54')](_0x587667);}})[_0x9a1e('0x22')](function(_0x497a44){if(_0x497a44){_0x4c6d14=_0x497a44[_0x9a1e('0x32')];if(!_0x1e2ae7['query'][_0x9a1e('0x33')](_0x9a1e('0x34'))){_0x587667[_0x9a1e('0x1b')]=qs['limit'](_0x1e2ae7[_0x9a1e('0x30')]['limit']);_0x587667[_0x9a1e('0x1a')]=qs[_0x9a1e('0x1a')](_0x1e2ae7[_0x9a1e('0x30')][_0x9a1e('0x1a')]);}return _0x43fbeb[_0x9a1e('0x54')](_0x587667);}})['then'](function(_0x2be50b){if(_0x2be50b){return _0x2be50b?{'count':_0x4c6d14,'rows':_0x2be50b}:null;}})[_0x9a1e('0x22')](respondWithResult(_0x2e1a42,null))[_0x9a1e('0x45')](handleError(_0x2e1a42,null));};exports[_0x9a1e('0x55')]=function(_0x3592e5,_0x58dbe7,_0x353653){return db['Interval']['findOne']({'where':{'id':_0x3592e5[_0x9a1e('0x47')]['id']}})['then'](handleEntityNotFound(_0x58dbe7,null))['then'](function(_0x3347da){if(_0x3347da){return db[_0x9a1e('0x56')][_0x9a1e('0x57')](function(_0x138157){return db['Interval'][_0x9a1e('0x23')]({'where':{'IntervalId':_0x3592e5[_0x9a1e('0x47')]['id']},'transaction':_0x138157})[_0x9a1e('0x22')](function(_0x1a0535){var _0x2642cd=_[_0x9a1e('0x3b')](_0x3592e5[_0x9a1e('0x4a')],function(_0x67c43c){delete _0x67c43c['id'];_0x67c43c[_0x9a1e('0x52')]=_0x3592e5[_0x9a1e('0x47')]['id'];return _0x67c43c;});return db[_0x9a1e('0x29')][_0x9a1e('0x58')](_0x2642cd,{'transaction':_0x138157});});})[_0x9a1e('0x22')](function(){return db[_0x9a1e('0x29')][_0x9a1e('0x43')]({'where':{'IntervalId':_0x3592e5['params']['id']}});});}})[_0x9a1e('0x22')](respondWithResult(_0x58dbe7,null))['catch'](handleError(_0x58dbe7,null));}; \ No newline at end of file +var _0xd0c1=['where','merge','type','field','filter','options','Interval','includeAll','findAll','rows','catch','params','create','get','role','Intervals','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','getIntervals','map','addIntervals','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','count','offset','set','apply','save','update','then','destroy','UserProfileResource','end','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick'];(function(_0x153f70,_0x5e37da){var _0x2e0666=function(_0x4e38c3){while(--_0x4e38c3){_0x153f70['push'](_0x153f70['shift']());}};_0x2e0666(++_0x5e37da);}(_0xd0c1,0x175));var _0x1d0c=function(_0x249015,_0x374893){_0x249015=_0x249015-0x0;var _0x5232fa=_0xd0c1[_0x249015];return _0x5232fa;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1d0c('0x0'));var rimraf=require(_0x1d0c('0x1'));var zipdir=require(_0x1d0c('0x2'));var jsonpatch=require(_0x1d0c('0x3'));var rp=require(_0x1d0c('0x4'));var moment=require(_0x1d0c('0x5'));var BPromise=require(_0x1d0c('0x6'));var Mustache=require(_0x1d0c('0x7'));var util=require(_0x1d0c('0x8'));var path=require(_0x1d0c('0x9'));var sox=require(_0x1d0c('0xa'));var csv=require(_0x1d0c('0xb'));var ejs=require(_0x1d0c('0xc'));var fs=require('fs');var _=require(_0x1d0c('0xd'));var squel=require('squel');var crypto=require(_0x1d0c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1d0c('0xf'));var toCsv=require(_0x1d0c('0xb'));var querystring=require(_0x1d0c('0x10'));var Papa=require(_0x1d0c('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1d0c('0x12'));var hardwareService=require(_0x1d0c('0x13'));var logger=require('../../config/logger')(_0x1d0c('0x14'));var utils=require(_0x1d0c('0x15'));var config=require('../../config/environment');var db=require(_0x1d0c('0x16'))['db'];var extensions=require(_0x1d0c('0x17'));function respondWithStatusCode(_0x4e4a71,_0x39bf8a){_0x39bf8a=_0x39bf8a||0xcc;return function(_0x6ef592){if(_0x6ef592){return _0x4e4a71[_0x1d0c('0x18')](_0x39bf8a);}return _0x4e4a71[_0x1d0c('0x19')](_0x39bf8a)['end']();};}function respondWithResult(_0x5c803d,_0x5f563a){_0x5f563a=_0x5f563a||0xc8;return function(_0x37dd5a){if(_0x37dd5a){return _0x5c803d[_0x1d0c('0x19')](_0x5f563a)[_0x1d0c('0x1a')](_0x37dd5a);}};}function respondWithFilteredResult(_0x251396,_0x1b88c7){return function(_0x45cd7c){if(_0x45cd7c){var _0x450155=_0x45cd7c[_0x1d0c('0x1b')],_0x361afe=_0x1b88c7[_0x1d0c('0x1c')],_0xb1c434=_0x1b88c7[_0x1d0c('0x1c')]+_0x1b88c7['limit'],_0x2c6b88;if(_0xb1c434>=_0x450155){_0xb1c434=_0x450155;_0x2c6b88=0xc8;}else{_0x2c6b88=0xce;}_0x251396['status'](_0x2c6b88);return _0x251396[_0x1d0c('0x1d')]('Content-Range',_0x361afe+'-'+_0xb1c434+'/'+_0x450155)[_0x1d0c('0x1a')](_0x45cd7c);}return null;};}function patchUpdates(_0x3ef342){return function(_0x3c5837){try{jsonpatch[_0x1d0c('0x1e')](_0x3c5837,_0x3ef342,!![]);}catch(_0x39556c){return BPromise['reject'](_0x39556c);}return _0x3c5837[_0x1d0c('0x1f')]();};}function saveUpdates(_0x3964c6,_0x2f576e){return function(_0x5e7726){if(_0x5e7726){return _0x5e7726[_0x1d0c('0x20')](_0x3964c6)[_0x1d0c('0x21')](function(_0xb39ba8){return _0xb39ba8;});}return null;};}function removeEntity(_0x4e76a9,_0x532d3d){return function(_0x2d0c1e){if(_0x2d0c1e){return _0x2d0c1e[_0x1d0c('0x22')]()[_0x1d0c('0x21')](function(){var _0x44dc58=_0x2d0c1e['get']({'plain':!![]});var _0x4c715e='Intervals';return db[_0x1d0c('0x23')][_0x1d0c('0x22')]({'where':{'type':_0x4c715e,'resourceId':_0x44dc58['id']}})[_0x1d0c('0x21')](function(){return _0x2d0c1e;});})['then'](function(){_0x4e76a9[_0x1d0c('0x19')](0xcc)[_0x1d0c('0x24')]();});}};}function handleEntityNotFound(_0x13dc9e,_0x26b9ef){return function(_0x1311f2){if(!_0x1311f2){_0x13dc9e['sendStatus'](0x194);}return _0x1311f2;};}function handleError(_0x4d95c6,_0x50de4c){_0x50de4c=_0x50de4c||0x1f4;return function(_0x2c3831){logger[_0x1d0c('0x25')](_0x2c3831[_0x1d0c('0x26')]);if(_0x2c3831[_0x1d0c('0x27')]){delete _0x2c3831['name'];}_0x4d95c6[_0x1d0c('0x19')](_0x50de4c)[_0x1d0c('0x28')](_0x2c3831);};}exports[_0x1d0c('0x29')]=function(_0x3d52ab,_0xa632bf){var _0x456d25={},_0x47b219={},_0x2722e7={'count':0x0,'rows':[]};var _0x30f8be=db['Interval'][_0x1d0c('0x2a')];_0x47b219[_0x1d0c('0x2b')]=_[_0x1d0c('0x2c')](_0x30f8be);_0x47b219[_0x1d0c('0x2d')]=_[_0x1d0c('0x2c')](_0x3d52ab[_0x1d0c('0x2d')]);_0x47b219[_0x1d0c('0x2e')]=_[_0x1d0c('0x2f')](_0x47b219[_0x1d0c('0x2b')],_0x47b219[_0x1d0c('0x2d')]);_0x456d25[_0x1d0c('0x30')]=_[_0x1d0c('0x2f')](_0x47b219[_0x1d0c('0x2b')],qs[_0x1d0c('0x31')](_0x3d52ab[_0x1d0c('0x2d')]['fields']));_0x456d25[_0x1d0c('0x30')]=_0x456d25[_0x1d0c('0x30')][_0x1d0c('0x32')]?_0x456d25['attributes']:_0x47b219['model'];if(!_0x3d52ab[_0x1d0c('0x2d')][_0x1d0c('0x33')](_0x1d0c('0x34'))){_0x456d25[_0x1d0c('0x35')]=qs[_0x1d0c('0x35')](_0x3d52ab[_0x1d0c('0x2d')][_0x1d0c('0x35')]);_0x456d25[_0x1d0c('0x1c')]=qs[_0x1d0c('0x1c')](_0x3d52ab['query'][_0x1d0c('0x1c')]);}_0x456d25[_0x1d0c('0x36')]=qs['sort'](_0x3d52ab[_0x1d0c('0x2d')][_0x1d0c('0x37')]);_0x456d25['where']=qs[_0x1d0c('0x2e')](_[_0x1d0c('0x38')](_0x3d52ab['query'],_0x47b219['filters']));if(_0x3d52ab[_0x1d0c('0x2d')]['filter']){_0x456d25[_0x1d0c('0x39')]=_[_0x1d0c('0x3a')](_0x456d25['where'],{'$or':_['map'](_0x30f8be,function(_0x5e7ee1){if(_0x5e7ee1[_0x1d0c('0x3b')]['key']!=='VIRTUAL'){var _0x1cf96b={};_0x1cf96b[_0x5e7ee1[_0x1d0c('0x3c')]]={'$like':'%'+_0x3d52ab[_0x1d0c('0x2d')][_0x1d0c('0x3d')]+'%'};return _0x1cf96b;}})});}_0x456d25=_['merge']({},_0x456d25,_0x3d52ab[_0x1d0c('0x3e')]);var _0x3f863f={'where':_0x456d25[_0x1d0c('0x39')]};return db[_0x1d0c('0x3f')][_0x1d0c('0x1b')](_0x3f863f)[_0x1d0c('0x21')](function(_0x54abe6){_0x2722e7['count']=_0x54abe6;if(_0x3d52ab[_0x1d0c('0x2d')][_0x1d0c('0x40')]){_0x456d25['include']=[{'all':!![]}];}return db['Interval'][_0x1d0c('0x41')](_0x456d25);})[_0x1d0c('0x21')](function(_0x30caef){_0x2722e7[_0x1d0c('0x42')]=_0x30caef;return _0x2722e7;})['then'](respondWithFilteredResult(_0xa632bf,_0x456d25))[_0x1d0c('0x43')](handleError(_0xa632bf,null));};exports['show']=function(_0x3b7348,_0x184ecd){var _0x3554af={'raw':!![],'where':{'id':_0x3b7348[_0x1d0c('0x44')]['id']}},_0x138a03={};_0x138a03[_0x1d0c('0x2b')]=_[_0x1d0c('0x2c')](db[_0x1d0c('0x3f')]['rawAttributes']);_0x138a03[_0x1d0c('0x2d')]=_[_0x1d0c('0x2c')](_0x3b7348['query']);_0x138a03[_0x1d0c('0x2e')]=_[_0x1d0c('0x2f')](_0x138a03[_0x1d0c('0x2b')],_0x138a03[_0x1d0c('0x2d')]);_0x3554af['attributes']=_[_0x1d0c('0x2f')](_0x138a03[_0x1d0c('0x2b')],qs['fields'](_0x3b7348['query'][_0x1d0c('0x31')]));_0x3554af[_0x1d0c('0x30')]=_0x3554af[_0x1d0c('0x30')]['length']?_0x3554af['attributes']:_0x138a03[_0x1d0c('0x2b')];if(_0x3b7348['query'][_0x1d0c('0x40')]){_0x3554af['include']=[{'all':!![]}];}_0x3554af=_['merge']({},_0x3554af,_0x3b7348[_0x1d0c('0x3e')]);return db[_0x1d0c('0x3f')]['find'](_0x3554af)[_0x1d0c('0x21')](handleEntityNotFound(_0x184ecd,null))[_0x1d0c('0x21')](respondWithResult(_0x184ecd,null))[_0x1d0c('0x43')](handleError(_0x184ecd,null));};exports[_0x1d0c('0x45')]=function(_0x2b0ae9,_0x4808b8){return db['Interval'][_0x1d0c('0x45')](_0x2b0ae9['body'],{})[_0x1d0c('0x21')](function(_0x33cb49){var _0x1f4bdf=_0x2b0ae9['user'][_0x1d0c('0x46')]({'plain':!![]});if(!_0x1f4bdf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f4bdf[_0x1d0c('0x47')]==='user'){var _0x3af3c9=_0x33cb49[_0x1d0c('0x46')]({'plain':!![]});var _0x5ec6df=_0x1d0c('0x48');return db[_0x1d0c('0x49')][_0x1d0c('0x4a')]({'where':{'name':_0x5ec6df,'userProfileId':_0x1f4bdf[_0x1d0c('0x4b')]},'raw':!![]})[_0x1d0c('0x21')](function(_0x306576){if(_0x306576&&_0x306576[_0x1d0c('0x4c')]===0x0){return db[_0x1d0c('0x23')][_0x1d0c('0x45')]({'name':_0x3af3c9[_0x1d0c('0x27')],'resourceId':_0x3af3c9['id'],'type':_0x306576[_0x1d0c('0x27')],'sectionId':_0x306576['id']},{})[_0x1d0c('0x21')](function(){return _0x33cb49;});}else{return _0x33cb49;}})[_0x1d0c('0x43')](function(_0x4143e3){logger[_0x1d0c('0x25')](_0x1d0c('0x4d'),_0x4143e3);throw _0x4143e3;});}return _0x33cb49;})['then'](respondWithResult(_0x4808b8,0xc9))[_0x1d0c('0x43')](handleError(_0x4808b8,null));};exports[_0x1d0c('0x20')]=function(_0x255fbc,_0x5d512e){if(_0x255fbc[_0x1d0c('0x4e')]['id']){delete _0x255fbc[_0x1d0c('0x4e')]['id'];}return db[_0x1d0c('0x3f')][_0x1d0c('0x4a')]({'where':{'id':_0x255fbc['params']['id']}})['then'](handleEntityNotFound(_0x5d512e,null))[_0x1d0c('0x21')](saveUpdates(_0x255fbc[_0x1d0c('0x4e')],null))[_0x1d0c('0x21')](respondWithResult(_0x5d512e,null))[_0x1d0c('0x43')](handleError(_0x5d512e,null));};exports[_0x1d0c('0x22')]=function(_0xc87ce1,_0x127e32){return db['Interval'][_0x1d0c('0x4a')]({'where':{'id':_0xc87ce1[_0x1d0c('0x44')]['id']}})[_0x1d0c('0x21')](handleEntityNotFound(_0x127e32,null))[_0x1d0c('0x21')](removeEntity(_0x127e32,null))[_0x1d0c('0x43')](handleError(_0x127e32,null));};exports[_0x1d0c('0x4f')]=function(_0x45089a,_0x5106cb,_0x592698){if(_0x45089a[_0x1d0c('0x4e')]['id']){delete _0x45089a[_0x1d0c('0x4e')]['id'];}return db[_0x1d0c('0x3f')]['find']({'where':{'id':_0x45089a[_0x1d0c('0x44')]['id']}})[_0x1d0c('0x21')](handleEntityNotFound(_0x5106cb,null))[_0x1d0c('0x21')](function(_0x4cff08){if(_0x4cff08){_0x45089a[_0x1d0c('0x4e')][_0x1d0c('0x50')]=_0x4cff08['id'];return db[_0x1d0c('0x3f')]['create'](_0x45089a[_0x1d0c('0x4e')]);}})[_0x1d0c('0x21')](respondWithResult(_0x5106cb,null))[_0x1d0c('0x43')](handleError(_0x5106cb,null));};exports[_0x1d0c('0x51')]=function(_0x3ec226,_0x3d9197,_0x583239){var _0x58ba48={};var _0x594b2b={};var _0xddffbd;var _0x376a96;return db[_0x1d0c('0x3f')]['findOne']({'where':{'id':_0x3ec226[_0x1d0c('0x44')]['id']}})['then'](handleEntityNotFound(_0x3d9197,null))[_0x1d0c('0x21')](function(_0x299895){if(_0x299895){_0xddffbd=_0x299895;_0x594b2b[_0x1d0c('0x2b')]=_[_0x1d0c('0x2c')](db[_0x1d0c('0x3f')][_0x1d0c('0x2a')]);_0x594b2b[_0x1d0c('0x2d')]=_[_0x1d0c('0x2c')](_0x3ec226['query']);_0x594b2b[_0x1d0c('0x2e')]=_[_0x1d0c('0x2f')](_0x594b2b[_0x1d0c('0x2b')],_0x594b2b[_0x1d0c('0x2d')]);_0x58ba48[_0x1d0c('0x30')]=_[_0x1d0c('0x2f')](_0x594b2b[_0x1d0c('0x2b')],qs[_0x1d0c('0x31')](_0x3ec226[_0x1d0c('0x2d')][_0x1d0c('0x31')]));_0x58ba48[_0x1d0c('0x30')]=_0x58ba48[_0x1d0c('0x30')][_0x1d0c('0x32')]?_0x58ba48[_0x1d0c('0x30')]:_0x594b2b[_0x1d0c('0x2b')];_0x58ba48[_0x1d0c('0x36')]=qs[_0x1d0c('0x37')](_0x3ec226[_0x1d0c('0x2d')][_0x1d0c('0x37')]);_0x58ba48[_0x1d0c('0x39')]=qs[_0x1d0c('0x2e')](_['pick'](_0x3ec226[_0x1d0c('0x2d')],_0x594b2b['filters']));if(_0x3ec226[_0x1d0c('0x2d')][_0x1d0c('0x3d')]){_0x58ba48[_0x1d0c('0x39')]=_[_0x1d0c('0x3a')](_0x58ba48[_0x1d0c('0x39')],{'$or':_[_0x1d0c('0x52')](_0x58ba48[_0x1d0c('0x30')],function(_0x5014eb){var _0x5240a0={};_0x5240a0[_0x5014eb]={'$like':'%'+_0x3ec226[_0x1d0c('0x2d')][_0x1d0c('0x3d')]+'%'};return _0x5240a0;})});}_0x58ba48=_[_0x1d0c('0x3a')]({},_0x58ba48,_0x3ec226[_0x1d0c('0x3e')]);return _0xddffbd[_0x1d0c('0x51')](_0x58ba48);}})[_0x1d0c('0x21')](function(_0x34a764){if(_0x34a764){_0x376a96=_0x34a764[_0x1d0c('0x32')];if(!_0x3ec226['query']['hasOwnProperty']('nolimit')){_0x58ba48[_0x1d0c('0x35')]=qs['limit'](_0x3ec226[_0x1d0c('0x2d')][_0x1d0c('0x35')]);_0x58ba48[_0x1d0c('0x1c')]=qs[_0x1d0c('0x1c')](_0x3ec226[_0x1d0c('0x2d')][_0x1d0c('0x1c')]);}return _0xddffbd[_0x1d0c('0x51')](_0x58ba48);}})[_0x1d0c('0x21')](function(_0x1b975e){if(_0x1b975e){return _0x1b975e?{'count':_0x376a96,'rows':_0x1b975e}:null;}})[_0x1d0c('0x21')](respondWithResult(_0x3d9197,null))[_0x1d0c('0x43')](handleError(_0x3d9197,null));};exports[_0x1d0c('0x53')]=function(_0x201521,_0x3d62e8,_0x5be83a){return db[_0x1d0c('0x3f')]['findOne']({'where':{'id':_0x201521['params']['id']}})['then'](handleEntityNotFound(_0x3d62e8,null))[_0x1d0c('0x21')](function(_0x3a4a0a){if(_0x3a4a0a){return db['sequelize'][_0x1d0c('0x54')](function(_0xb451a0){return db[_0x1d0c('0x3f')]['destroy']({'where':{'IntervalId':_0x201521[_0x1d0c('0x44')]['id']},'transaction':_0xb451a0})[_0x1d0c('0x21')](function(_0xb89e6c){var _0x146bfa=_[_0x1d0c('0x52')](_0x201521['body'],function(_0x1d6492){delete _0x1d6492['id'];_0x1d6492[_0x1d0c('0x50')]=_0x201521['params']['id'];return _0x1d6492;});return db['Interval'][_0x1d0c('0x55')](_0x146bfa,{'transaction':_0xb451a0});});})[_0x1d0c('0x21')](function(){return db[_0x1d0c('0x3f')][_0x1d0c('0x41')]({'where':{'IntervalId':_0x201521['params']['id']}});});}})[_0x1d0c('0x21')](respondWithResult(_0x3d62e8,null))[_0x1d0c('0x43')](handleError(_0x3d62e8,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index eda3f48..4f0b602 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 _0x890f=['rewrite','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval'];(function(_0x1f6afb,_0x4c02fc){var _0x235759=function(_0x2b0c17){while(--_0x2b0c17){_0x1f6afb['push'](_0x1f6afb['shift']());}};_0x235759(++_0x4c02fc);}(_0x890f,0x1ae));var _0xf890=function(_0x3a49ed,_0x5942c0){_0x3a49ed=_0x3a49ed-0x0;var _0xfc681=_0x890f[_0x3a49ed];return _0xfc681;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf890('0x0'));var moment=require(_0xf890('0x1'));var BPromise=require(_0xf890('0x2'));var rp=require(_0xf890('0x3'));var fs=require('fs');var path=require(_0xf890('0x4'));var rimraf=require(_0xf890('0x5'));var config=require(_0xf890('0x6'));var attributes=require(_0xf890('0x7'));var extensions=require(_0xf890('0x8'));module[_0xf890('0x9')]=function(_0x565d0c,_0x1b8e4d){return _0x565d0c[_0xf890('0xa')](_0xf890('0xb'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x320951,_0x4fe04d){extensions[_0xf890('0xc')](_0x565d0c,_0x320951);},'afterBulkCreate':function(_0x502529,_0x4f19f7,_0x7b7987){_0x7b7987();extensions[_0xf890('0xc')](_0x565d0c,_0x502529[0x0]);},'afterUpdate':function(_0x853fb2,_0x103587){extensions[_0xf890('0xc')](_0x565d0c,_0x853fb2);},'afterDestroy':function(_0x202795,_0x1a22bd){extensions[_0xf890('0xc')](_0x565d0c,_0x202795);}}});}; \ No newline at end of file +var _0xaae5=['moment','bluebird','request-promise','path','../../config/environment','./interval.attributes','../../components/extensions/rewrite','define','tools_intervals','rewrite','lodash','util','../../config/logger','api'];(function(_0x207a02,_0x278c56){var _0xd995c3=function(_0x24e415){while(--_0x24e415){_0x207a02['push'](_0x207a02['shift']());}};_0xd995c3(++_0x278c56);}(_0xaae5,0x176));var _0x5aae=function(_0x2b46e5,_0x3d3196){_0x2b46e5=_0x2b46e5-0x0;var _0xf1434=_0xaae5[_0x2b46e5];return _0xf1434;};'use strict';var _=require(_0x5aae('0x0'));var util=require(_0x5aae('0x1'));var logger=require(_0x5aae('0x2'))(_0x5aae('0x3'));var moment=require(_0x5aae('0x4'));var BPromise=require(_0x5aae('0x5'));var rp=require(_0x5aae('0x6'));var fs=require('fs');var path=require(_0x5aae('0x7'));var rimraf=require('rimraf');var config=require(_0x5aae('0x8'));var attributes=require(_0x5aae('0x9'));var extensions=require(_0x5aae('0xa'));module['exports']=function(_0xbec9b1,_0x1abd27){return _0xbec9b1[_0x5aae('0xb')]('Interval',attributes,{'tableName':_0x5aae('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2bb22b,_0x2f308a){extensions[_0x5aae('0xd')](_0xbec9b1,_0x2bb22b);},'afterBulkCreate':function(_0x117466,_0xf52ae0,_0x34d203){_0x34d203();extensions['rewrite'](_0xbec9b1,_0x117466[0x0]);},'afterUpdate':function(_0x58c2e0,_0x533196){extensions['rewrite'](_0xbec9b1,_0x58c2e0);},'afterDestroy':function(_0x2d1986,_0x2d5190){extensions[_0x5aae('0xd')](_0xbec9b1,_0x2d1986);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 965bee9..9590804 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 _0xd6d6=['message','result','catch','options','raw','where','attributes','limit','include','map','model','then','GetInterval','ShowInterval','Interval','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x5b11dd,_0x496680){_0x5b11dd=_0x5b11dd-0x0;var _0x41e544=_0xd6d6[_0x5b11dd];return _0x41e544;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var moment=require(_0x6d6d('0x2'));var BPromise=require(_0x6d6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d6d('0x4'));var db=require(_0x6d6d('0x5'))['db'];var utils=require(_0x6d6d('0x6'));var logger=require(_0x6d6d('0x7'))(_0x6d6d('0x8'));var config=require(_0x6d6d('0x9'));var jayson=require(_0x6d6d('0xa'));var client=jayson['client'][_0x6d6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bf731,_0x44f83d,_0x18f824){return new BPromise(function(_0xd49f57,_0x408f88){return client[_0x6d6d('0xc')](_0x1bf731,_0x18f824)['then'](function(_0x51dd38){logger[_0x6d6d('0xd')](_0x6d6d('0xe'),_0x44f83d,_0x6d6d('0xf'));logger[_0x6d6d('0x10')](_0x6d6d('0x11'),_0x44f83d,'request\x20sent',JSON[_0x6d6d('0x12')](_0x51dd38));if(_0x51dd38[_0x6d6d('0x13')]){if(_0x51dd38['error']['code']===0x1f4){logger[_0x6d6d('0x13')](_0x6d6d('0xe'),_0x44f83d,_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);return _0x408f88(_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);}logger[_0x6d6d('0x13')](_0x6d6d('0xe'),_0x44f83d,_0x51dd38['error'][_0x6d6d('0x14')]);return _0xd49f57(_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);}else{logger[_0x6d6d('0xd')](_0x6d6d('0xe'),_0x44f83d,'request\x20sent');_0xd49f57(_0x51dd38[_0x6d6d('0x15')]['message']);}})[_0x6d6d('0x16')](function(_0x2cbc86){logger[_0x6d6d('0x13')]('Interval,\x20%s,\x20%s',_0x44f83d,_0x2cbc86);_0x408f88(_0x2cbc86);});});}exports['GetInterval']=function(_0x9e1e18){var _0x1a75d8=this;return new Promise(function(_0x2b59d4,_0x2c5314){return db['Interval']['findAll']({'raw':_0x9e1e18[_0x6d6d('0x17')]?_0x9e1e18['options'][_0x6d6d('0x18')]===undefined?!![]:![]:!![],'where':_0x9e1e18[_0x6d6d('0x17')]?_0x9e1e18[_0x6d6d('0x17')][_0x6d6d('0x19')]||null:null,'attributes':_0x9e1e18[_0x6d6d('0x17')]?_0x9e1e18[_0x6d6d('0x17')][_0x6d6d('0x1a')]||null:null,'limit':_0x9e1e18[_0x6d6d('0x17')]?_0x9e1e18[_0x6d6d('0x17')][_0x6d6d('0x1b')]||null:null,'include':_0x9e1e18[_0x6d6d('0x17')]?_0x9e1e18[_0x6d6d('0x17')][_0x6d6d('0x1c')]?_[_0x6d6d('0x1d')](_0x9e1e18[_0x6d6d('0x17')][_0x6d6d('0x1c')],function(_0xced622){return{'model':db[_0xced622['model']],'as':_0xced622['as'],'attributes':_0xced622[_0x6d6d('0x1a')],'include':_0xced622[_0x6d6d('0x1c')]?_[_0x6d6d('0x1d')](_0xced622[_0x6d6d('0x1c')],function(_0xf0df7f){return{'model':db[_0xf0df7f[_0x6d6d('0x1e')]],'as':_0xf0df7f['as'],'attributes':_0xf0df7f['attributes'],'include':_0xf0df7f[_0x6d6d('0x1c')]?_[_0x6d6d('0x1d')](_0xf0df7f[_0x6d6d('0x1c')],function(_0x126ac8){return{'model':db[_0x126ac8[_0x6d6d('0x1e')]],'as':_0x126ac8['as'],'attributes':_0x126ac8[_0x6d6d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6d6d('0x1f')](function(_0x4a57a1){logger[_0x6d6d('0xd')](_0x6d6d('0x20'),_0x9e1e18);logger['debug']('GetInterval',_0x9e1e18,JSON[_0x6d6d('0x12')](_0x4a57a1));_0x2b59d4(_0x4a57a1);})[_0x6d6d('0x16')](function(_0x8a9a84){logger['error'](_0x6d6d('0x20'),_0x8a9a84[_0x6d6d('0x14')],_0x9e1e18);_0x2c5314(_0x1a75d8[_0x6d6d('0x13')](0x1f4,_0x8a9a84[_0x6d6d('0x14')]));});});};exports[_0x6d6d('0x21')]=function(_0x428c17){var _0xdda3f2=this;return new Promise(function(_0x359cfd,_0x6c4741){return db[_0x6d6d('0x22')]['find']({'raw':_0x428c17[_0x6d6d('0x17')]?_0x428c17['options'][_0x6d6d('0x18')]===undefined?!![]:![]:!![],'where':_0x428c17[_0x6d6d('0x17')]?_0x428c17[_0x6d6d('0x17')][_0x6d6d('0x19')]||null:null,'attributes':_0x428c17['options']?_0x428c17[_0x6d6d('0x17')]['attributes']||null:null,'include':_0x428c17[_0x6d6d('0x17')]?_0x428c17[_0x6d6d('0x17')]['include']?_[_0x6d6d('0x1d')](_0x428c17[_0x6d6d('0x17')][_0x6d6d('0x1c')],function(_0xa73803){return{'model':db[_0xa73803[_0x6d6d('0x1e')]],'as':_0xa73803['as'],'attributes':_0xa73803[_0x6d6d('0x1a')],'include':_0xa73803[_0x6d6d('0x1c')]?_[_0x6d6d('0x1d')](_0xa73803[_0x6d6d('0x1c')],function(_0x1d0545){return{'model':db[_0x1d0545[_0x6d6d('0x1e')]],'as':_0x1d0545['as'],'attributes':_0x1d0545[_0x6d6d('0x1a')],'include':_0x1d0545[_0x6d6d('0x1c')]?_[_0x6d6d('0x1d')](_0x1d0545['include'],function(_0x1335ef){return{'model':db[_0x1335ef[_0x6d6d('0x1e')]],'as':_0x1335ef['as'],'attributes':_0x1335ef[_0x6d6d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6d6d('0x1f')](function(_0x4acf0f){logger['info'](_0x6d6d('0x21'),_0x428c17);logger[_0x6d6d('0x10')](_0x6d6d('0x21'),_0x428c17,JSON['stringify'](_0x4acf0f));_0x359cfd(_0x4acf0f);})[_0x6d6d('0x16')](function(_0x2607c1){logger[_0x6d6d('0x13')](_0x6d6d('0x21'),_0x2607c1['message'],_0x428c17);_0x6c4741(_0xdda3f2['error'](0x1f4,_0x2607c1['message']));});});}; \ No newline at end of file +var _0x2bd8=['request','Interval,\x20%s,\x20%s','Interval,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent','result','catch','GetInterval','Interval','findAll','raw','options','where','attributes','limit','include','map','model','debug','stringify','ShowInterval','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x3b3084,_0x3e93b2){var _0x27e674=function(_0x2a90e3){while(--_0x2a90e3){_0x3b3084['push'](_0x3b3084['shift']());}};_0x27e674(++_0x3e93b2);}(_0x2bd8,0x130));var _0x82bd=function(_0x4ff254,_0x413aee){_0x4ff254=_0x4ff254-0x0;var _0x4c650f=_0x2bd8[_0x4ff254];return _0x4c650f;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var moment=require(_0x82bd('0x1'));var BPromise=require(_0x82bd('0x2'));var rs=require(_0x82bd('0x3'));var fs=require('fs');var Redis=require(_0x82bd('0x4'));var db=require(_0x82bd('0x5'))['db'];var utils=require(_0x82bd('0x6'));var logger=require(_0x82bd('0x7'))('rpc');var config=require(_0x82bd('0x8'));var jayson=require(_0x82bd('0x9'));var client=jayson[_0x82bd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19dbb1,_0x77d7a9,_0x226f60){return new BPromise(function(_0x1f7463,_0x4dc3a6){return client[_0x82bd('0xb')](_0x19dbb1,_0x226f60)['then'](function(_0x4a9b2c){logger['info'](_0x82bd('0xc'),_0x77d7a9,'request\x20sent');logger['debug'](_0x82bd('0xd'),_0x77d7a9,'request\x20sent',JSON['stringify'](_0x4a9b2c));if(_0x4a9b2c[_0x82bd('0xe')]){if(_0x4a9b2c[_0x82bd('0xe')]['code']===0x1f4){logger[_0x82bd('0xe')]('Interval,\x20%s,\x20%s',_0x77d7a9,_0x4a9b2c[_0x82bd('0xe')]['message']);return _0x4dc3a6(_0x4a9b2c[_0x82bd('0xe')][_0x82bd('0xf')]);}logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x4a9b2c['error'][_0x82bd('0xf')]);return _0x1f7463(_0x4a9b2c[_0x82bd('0xe')]['message']);}else{logger[_0x82bd('0x10')]('Interval,\x20%s,\x20%s',_0x77d7a9,_0x82bd('0x11'));_0x1f7463(_0x4a9b2c[_0x82bd('0x12')][_0x82bd('0xf')]);}})[_0x82bd('0x13')](function(_0x209081){logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x209081);_0x4dc3a6(_0x209081);});});}exports[_0x82bd('0x14')]=function(_0x31a350){var _0xf180aa=this;return new Promise(function(_0x390107,_0x29b689){return db[_0x82bd('0x15')][_0x82bd('0x16')]({'raw':_0x31a350['options']?_0x31a350['options'][_0x82bd('0x17')]===undefined?!![]:![]:!![],'where':_0x31a350[_0x82bd('0x18')]?_0x31a350[_0x82bd('0x18')][_0x82bd('0x19')]||null:null,'attributes':_0x31a350[_0x82bd('0x18')]?_0x31a350[_0x82bd('0x18')][_0x82bd('0x1a')]||null:null,'limit':_0x31a350[_0x82bd('0x18')]?_0x31a350[_0x82bd('0x18')][_0x82bd('0x1b')]||null:null,'include':_0x31a350[_0x82bd('0x18')]?_0x31a350[_0x82bd('0x18')][_0x82bd('0x1c')]?_[_0x82bd('0x1d')](_0x31a350[_0x82bd('0x18')][_0x82bd('0x1c')],function(_0x13a42a){return{'model':db[_0x13a42a[_0x82bd('0x1e')]],'as':_0x13a42a['as'],'attributes':_0x13a42a[_0x82bd('0x1a')],'include':_0x13a42a['include']?_['map'](_0x13a42a[_0x82bd('0x1c')],function(_0x436ecd){return{'model':db[_0x436ecd[_0x82bd('0x1e')]],'as':_0x436ecd['as'],'attributes':_0x436ecd[_0x82bd('0x1a')],'include':_0x436ecd[_0x82bd('0x1c')]?_[_0x82bd('0x1d')](_0x436ecd[_0x82bd('0x1c')],function(_0xbef23b){return{'model':db[_0xbef23b[_0x82bd('0x1e')]],'as':_0xbef23b['as'],'attributes':_0xbef23b[_0x82bd('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bd22f){logger['info']('GetInterval',_0x31a350);logger[_0x82bd('0x1f')](_0x82bd('0x14'),_0x31a350,JSON[_0x82bd('0x20')](_0x5bd22f));_0x390107(_0x5bd22f);})[_0x82bd('0x13')](function(_0x363ef9){logger['error']('GetInterval',_0x363ef9['message'],_0x31a350);_0x29b689(_0xf180aa[_0x82bd('0xe')](0x1f4,_0x363ef9[_0x82bd('0xf')]));});});};exports[_0x82bd('0x21')]=function(_0x580ba8){var _0x166c46=this;return new Promise(function(_0x4f209e,_0x9cc69b){return db[_0x82bd('0x15')][_0x82bd('0x22')]({'raw':_0x580ba8[_0x82bd('0x18')]?_0x580ba8[_0x82bd('0x18')][_0x82bd('0x17')]===undefined?!![]:![]:!![],'where':_0x580ba8['options']?_0x580ba8[_0x82bd('0x18')][_0x82bd('0x19')]||null:null,'attributes':_0x580ba8[_0x82bd('0x18')]?_0x580ba8['options'][_0x82bd('0x1a')]||null:null,'include':_0x580ba8['options']?_0x580ba8['options'][_0x82bd('0x1c')]?_[_0x82bd('0x1d')](_0x580ba8[_0x82bd('0x18')][_0x82bd('0x1c')],function(_0xd30754){return{'model':db[_0xd30754[_0x82bd('0x1e')]],'as':_0xd30754['as'],'attributes':_0xd30754[_0x82bd('0x1a')],'include':_0xd30754[_0x82bd('0x1c')]?_[_0x82bd('0x1d')](_0xd30754[_0x82bd('0x1c')],function(_0x1ebf6f){return{'model':db[_0x1ebf6f[_0x82bd('0x1e')]],'as':_0x1ebf6f['as'],'attributes':_0x1ebf6f[_0x82bd('0x1a')],'include':_0x1ebf6f[_0x82bd('0x1c')]?_[_0x82bd('0x1d')](_0x1ebf6f[_0x82bd('0x1c')],function(_0x1097e3){return{'model':db[_0x1097e3['model']],'as':_0x1097e3['as'],'attributes':_0x1097e3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3fea10){logger[_0x82bd('0x10')]('ShowInterval',_0x580ba8);logger[_0x82bd('0x1f')]('ShowInterval',_0x580ba8,JSON['stringify'](_0x3fea10));_0x4f209e(_0x3fea10);})['catch'](function(_0x2b7675){logger[_0x82bd('0xe')](_0x82bd('0x21'),_0x2b7675[_0x82bd('0xf')],_0x580ba8);_0x9cc69b(_0x166c46[_0x82bd('0xe')](0x1f4,_0x2b7675['message']));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index d33f54b..c2e1867 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 _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x4494fb,_0x214efb){var _0x472e38=function(_0x2c6247){while(--_0x2c6247){_0x4494fb['push'](_0x4494fb['shift']());}};_0x472e38(++_0x214efb);}(_0x5f2f,0x73));var _0xf5f2=function(_0x49552e,_0x370ce2){_0x49552e=_0x49552e-0x0;var _0x2559f9=_0x5f2f[_0x49552e];return _0x2559f9;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file +var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x25eef2,_0xe76236){var _0x3c4341=function(_0x4046ad){while(--_0x4046ad){_0x25eef2['push'](_0x25eef2['shift']());}};_0x3c4341(++_0xe76236);}(_0xadb5,0xad));var _0x5adb=function(_0x1778c5,_0x106fe4){_0x1778c5=_0x1778c5-0x0;var _0x294e48=_0xadb5[_0x1778c5];return _0x294e48;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index d5bab68..48f653c 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 _0xd8b0=['fields','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','remoteAddress','socket','connection','bluebird','https','3eAmWpBVP0','key','Report','\x20from\x20','description','issuetype','Bug','customfield_11500','email'];(function(_0x4a6470,_0x167a61){var _0x5203d7=function(_0x107a98){while(--_0x107a98){_0x4a6470['push'](_0x4a6470['shift']());}};_0x5203d7(++_0x167a61);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x0d8b('0x0'));var https=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var USERNAME='support';var PASSWORD=_0x0d8b('0x2');function openIssue(_0x5b9b89,_0x43bca1){var _0x364286={'fields':{'project':{'key':_0x5b9b89[_0x0d8b('0x3')]||'MOTGUI'},'summary':(_0x5b9b89['summary']||_0x0d8b('0x4'))+_0x0d8b('0x5')+_0x5b9b89['ip'],'description':_0x5b9b89[_0x0d8b('0x6')]||JSON['stringify'](_0x5b9b89),'issuetype':{'name':_0x5b9b89[_0x0d8b('0x7')]||_0x0d8b('0x8')}}};_0x364286['fields'][_0x0d8b('0x9')]=_0x5b9b89[_0x0d8b('0xa')];_0x364286[_0x0d8b('0xb')][_0x0d8b('0xc')]=_0x5b9b89[_0x0d8b('0xd')];_0x364286[_0x0d8b('0xb')][_0x0d8b('0xe')]=_0x5b9b89[_0x0d8b('0xf')];_0x364286['fields'][_0x0d8b('0x10')]=_0x5b9b89['name'];_0x364286[_0x0d8b('0xb')][_0x0d8b('0x11')]=_0x5b9b89[_0x0d8b('0x12')];_0x364286[_0x0d8b('0xb')][_0x0d8b('0x13')]=_0x5b9b89['ip'];var _0x32bb1a={'host':_0x0d8b('0x14'),'port':0x1bb,'path':_0x0d8b('0x15'),'method':_0x0d8b('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x0d8b('0x17'),'Authorization':_0x0d8b('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x0d8b('0x19')](_0x0d8b('0x1a'))}};var _0x2d4e1c=JSON['stringify'](_0x364286);var _0x23eb7b=https[_0x0d8b('0x1b')](_0x32bb1a,function(_0x17f7df){_0x17f7df[_0x0d8b('0x1c')](_0x0d8b('0x1d'));var _0x5cd485='';_0x17f7df['on'](_0x0d8b('0x1e'),function(_0x4586c2){_0x5cd485+=_0x4586c2;});_0x17f7df['on'](_0x0d8b('0x1f'),function(){if(_0x43bca1){return _0x43bca1[_0x0d8b('0x20')](_0x17f7df[_0x0d8b('0x21')])[_0x0d8b('0x22')](JSON[_0x0d8b('0x23')](_0x5cd485));}});});_0x23eb7b['on'](_0x0d8b('0x24'),function(_0x4a15bf){if(_0x43bca1){return _0x43bca1[_0x0d8b('0x20')](0x1f4)[_0x0d8b('0x22')]({'errors':[{'message':_0x0d8b('0x25'),'type':_0x0d8b('0x26')}]});}});_0x23eb7b[_0x0d8b('0x27')](_0x2d4e1c);_0x23eb7b[_0x0d8b('0x1f')]();}exports[_0x0d8b('0x28')]=openIssue;exports[_0x0d8b('0x29')]=function(_0x50ec1e,_0x4f0a1a){_0x50ec1e[_0x0d8b('0x2a')]['ip']=_0x50ec1e['headers']['x-forwarded-for']||_0x50ec1e['connection'][_0x0d8b('0x2b')]||_0x50ec1e[_0x0d8b('0x2c')][_0x0d8b('0x2b')]||_0x50ec1e[_0x0d8b('0x2d')][_0x0d8b('0x2c')][_0x0d8b('0x2b')];return openIssue(_0x50ec1e[_0x0d8b('0x2a')],_0x4f0a1a);}; \ No newline at end of file +var _0xe706=['key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','toString','utf8','end','statusCode','json','status','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','remoteAddress','socket','bluebird','https','../../config/logger','support','3eAmWpBVP0'];(function(_0x1b9438,_0x5081c6){var _0x132e53=function(_0xf906ef){while(--_0xf906ef){_0x1b9438['push'](_0x1b9438['shift']());}};_0x132e53(++_0x5081c6);}(_0xe706,0xa3));var _0x6e70=function(_0x2714ec,_0x36daa4){_0x2714ec=_0x2714ec-0x0;var _0x2608e5=_0xe706[_0x2714ec];return _0x2608e5;};'use strict';var BPromise=require(_0x6e70('0x0'));var https=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var USERNAME=_0x6e70('0x3');var PASSWORD=_0x6e70('0x4');function openIssue(_0x2ca810,_0x7dfbc3){var _0x142c27={'fields':{'project':{'key':_0x2ca810[_0x6e70('0x5')]||_0x6e70('0x6')},'summary':(_0x2ca810[_0x6e70('0x7')]||_0x6e70('0x8'))+_0x6e70('0x9')+_0x2ca810['ip'],'description':_0x2ca810[_0x6e70('0xa')]||JSON[_0x6e70('0xb')](_0x2ca810),'issuetype':{'name':_0x2ca810[_0x6e70('0xc')]||_0x6e70('0xd')}}};_0x142c27[_0x6e70('0xe')][_0x6e70('0xf')]=_0x2ca810[_0x6e70('0x10')];_0x142c27[_0x6e70('0xe')][_0x6e70('0x11')]=_0x2ca810[_0x6e70('0x12')];_0x142c27[_0x6e70('0xe')][_0x6e70('0x13')]=_0x2ca810[_0x6e70('0x14')];_0x142c27[_0x6e70('0xe')]['customfield_11503']=_0x2ca810['name'];_0x142c27[_0x6e70('0xe')][_0x6e70('0x15')]=_0x2ca810[_0x6e70('0x16')];_0x142c27[_0x6e70('0xe')][_0x6e70('0x17')]=_0x2ca810['ip'];var _0x310eb7={'host':_0x6e70('0x18'),'port':0x1bb,'path':_0x6e70('0x19'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x6e70('0x1a')]('base64')}};var _0x53aed0=JSON[_0x6e70('0xb')](_0x142c27);var _0x22c50c=https['request'](_0x310eb7,function(_0x24f3ac){_0x24f3ac['setEncoding'](_0x6e70('0x1b'));var _0x161f23='';_0x24f3ac['on']('data',function(_0x49029f){_0x161f23+=_0x49029f;});_0x24f3ac['on'](_0x6e70('0x1c'),function(){if(_0x7dfbc3){return _0x7dfbc3['status'](_0x24f3ac[_0x6e70('0x1d')])[_0x6e70('0x1e')](JSON['parse'](_0x161f23));}});});_0x22c50c['on']('error',function(_0xc238ba){if(_0x7dfbc3){return _0x7dfbc3[_0x6e70('0x1f')](0x1f4)[_0x6e70('0x1e')]({'errors':[{'message':_0x6e70('0x20'),'type':_0x6e70('0x21')}]});}});_0x22c50c[_0x6e70('0x22')](_0x53aed0);_0x22c50c[_0x6e70('0x1c')]();}exports[_0x6e70('0x23')]=openIssue;exports[_0x6e70('0x24')]=function(_0xb29a2a,_0x4a0cfe){_0xb29a2a[_0x6e70('0x25')]['ip']=_0xb29a2a[_0x6e70('0x26')][_0x6e70('0x27')]||_0xb29a2a['connection'][_0x6e70('0x28')]||_0xb29a2a[_0x6e70('0x29')][_0x6e70('0x28')]||_0xb29a2a['connection'][_0x6e70('0x29')]['remoteAddress'];return openIssue(_0xb29a2a['body'],_0x4a0cfe);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 8a09c38..79a395b 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 _0x3a4f=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','isAuthenticated','get','/describe','describe','/:id','post','create','update','delete','destroy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3a4f,0x1b6));var _0xf3a4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3a4f[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xf3a4('0x0'));var util=require(_0xf3a4('0x1'));var path=require(_0xf3a4('0x2'));var timeout=require(_0xf3a4('0x3'));var express=require(_0xf3a4('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xf3a4('0x5'));var config=require(_0xf3a4('0x6'));var controller=require(_0xf3a4('0x7'));router['get']('/',auth[_0xf3a4('0x8')](),controller['index']);router[_0xf3a4('0x9')](_0xf3a4('0xa'),auth[_0xf3a4('0x8')](),controller[_0xf3a4('0xb')]);router[_0xf3a4('0x9')](_0xf3a4('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf3a4('0xd')]('/',auth[_0xf3a4('0x8')](),controller[_0xf3a4('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf3a4('0xf')]);router[_0xf3a4('0x10')]('/:id',auth[_0xf3a4('0x8')](),controller[_0xf3a4('0x11')]);module[_0xf3a4('0x12')]=router; \ No newline at end of file +var _0x9495=['create','put','update','delete','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x434804,_0x415f68){var _0x573fc8=function(_0x3ce265){while(--_0x3ce265){_0x434804['push'](_0x434804['shift']());}};_0x573fc8(++_0x415f68);}(_0x9495,0xdc));var _0x5949=function(_0x1522db,_0x7efece){_0x1522db=_0x1522db-0x0;var _0x165585=_0x9495[_0x1522db];return _0x165585;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5949('0x0'));var express=require(_0x5949('0x1'));var router=express[_0x5949('0x2')]();var auth=require(_0x5949('0x3'));var interaction=require(_0x5949('0x4'));var config=require('../../config/environment');var controller=require(_0x5949('0x5'));router[_0x5949('0x6')]('/',auth[_0x5949('0x7')](),controller[_0x5949('0x8')]);router[_0x5949('0x6')](_0x5949('0x9'),auth[_0x5949('0x7')](),controller[_0x5949('0xa')]);router[_0x5949('0x6')](_0x5949('0xb'),auth['isAuthenticated'](),controller[_0x5949('0xc')]);router[_0x5949('0xd')]('/',auth[_0x5949('0x7')](),controller[_0x5949('0xe')]);router[_0x5949('0xf')]('/:id',auth[_0x5949('0x7')](),controller[_0x5949('0x10')]);router[_0x5949('0x11')](_0x5949('0xb'),auth[_0x5949('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 37f7282..93e370e 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 _0xa3b9=['exports','STRING','TEXT','long','sequelize'];(function(_0x4ce10f,_0x37f9be){var _0x201517=function(_0x193e8e){while(--_0x193e8e){_0x4ce10f['push'](_0x4ce10f['shift']());}};_0x201517(++_0x37f9be);}(_0xa3b9,0x112));var _0x9a3b=function(_0x20f7c6,_0x207ec9){_0x20f7c6=_0x20f7c6-0x0;var _0x61cfb2=_0xa3b9[_0x20f7c6];return _0x61cfb2;};'use strict';var Sequelize=require(_0x9a3b('0x0'));module[_0x9a3b('0x1')]={'question':{'type':Sequelize[_0x9a3b('0x2')]},'answer':{'type':Sequelize[_0x9a3b('0x3')](_0x9a3b('0x4'))},'membername':{'type':Sequelize[_0x9a3b('0x2')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x9a3b('0x2')]},'uniqueid':{'type':Sequelize[_0x9a3b('0x2')]},'calleridname':{'type':Sequelize[_0x9a3b('0x2')]},'calleridnum':{'type':Sequelize[_0x9a3b('0x2')]},'questionId':{'type':Sequelize[_0x9a3b('0x2')]}}; \ No newline at end of file +var _0x71f4=['STRING','TEXT','long'];(function(_0x5390f1,_0x2237bd){var _0x1b35ad=function(_0x5ba841){while(--_0x5ba841){_0x5390f1['push'](_0x5390f1['shift']());}};_0x1b35ad(++_0x2237bd);}(_0x71f4,0xf9));var _0x471f=function(_0x4aa48a,_0x175a97){_0x4aa48a=_0x4aa48a-0x0;var _0x1e068a=_0x71f4[_0x4aa48a];return _0x1e068a;};'use strict';var Sequelize=require('sequelize');module['exports']={'question':{'type':Sequelize[_0x471f('0x0')]},'answer':{'type':Sequelize[_0x471f('0x1')](_0x471f('0x2'))},'membername':{'type':Sequelize[_0x471f('0x0')]},'projectname':{'type':Sequelize[_0x471f('0x0')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x471f('0x0')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x471f('0x0')]},'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 028d9db..f1e1a5b 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 _0xf888=['index','JscriptyAnswerReport','rawAttributes','model','query','keys','filters','intersection','fields','attributes','limit','where','pick','filter','merge','map','type','key','field','options','includeAll','findAll','rows','show','params','catch','create','body','find','describe','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','destroy','then','error','name'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xf888,0x12a));var _0x8f88=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xf888[_0x122096];return _0x3d1966;};'use strict';var pdf=require(_0x8f88('0x0'));var emlformat=require(_0x8f88('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8f88('0x2'));var rp=require('request-promise');var moment=require(_0x8f88('0x3'));var BPromise=require(_0x8f88('0x4'));var Mustache=require(_0x8f88('0x5'));var util=require(_0x8f88('0x6'));var path=require(_0x8f88('0x7'));var sox=require('sox');var csv=require(_0x8f88('0x8'));var ejs=require(_0x8f88('0x9'));var fs=require('fs');var _=require(_0x8f88('0xa'));var squel=require(_0x8f88('0xb'));var crypto=require(_0x8f88('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8f88('0xd'));var toCsv=require(_0x8f88('0x8'));var querystring=require(_0x8f88('0xe'));var Papa=require(_0x8f88('0xf'));var Redis=require('ioredis');var authService=require(_0x8f88('0x10'));var qs=require(_0x8f88('0x11'));var hardwareService=require(_0x8f88('0x12'));var logger=require(_0x8f88('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x8f88('0x14'));var db=require(_0x8f88('0x15'))['db'];function respondWithStatusCode(_0x5b4190,_0x57042a){_0x57042a=_0x57042a||0xcc;return function(_0x398759){if(_0x398759){return _0x5b4190[_0x8f88('0x16')](_0x57042a);}return _0x5b4190[_0x8f88('0x17')](_0x57042a)[_0x8f88('0x18')]();};}function respondWithResult(_0x11a3a8,_0x5c0c02){_0x5c0c02=_0x5c0c02||0xc8;return function(_0x2871e1){if(_0x2871e1){return _0x11a3a8[_0x8f88('0x17')](_0x5c0c02)[_0x8f88('0x19')](_0x2871e1);}};}function respondWithFilteredResult(_0x39525f,_0x5220a5){return function(_0x53a4d1){if(_0x53a4d1){var _0x3654ce=_0x53a4d1[_0x8f88('0x1a')],_0x1df8b1=_0x5220a5[_0x8f88('0x1b')],_0x58dc7f=_0x5220a5[_0x8f88('0x1b')]+_0x5220a5['limit'],_0x1298eb;if(_0x58dc7f>=_0x3654ce){_0x58dc7f=_0x3654ce;_0x1298eb=0xc8;}else{_0x1298eb=0xce;}_0x39525f[_0x8f88('0x17')](_0x1298eb);return _0x39525f[_0x8f88('0x1c')]('Content-Range',_0x1df8b1+'-'+_0x58dc7f+'/'+_0x3654ce)['json'](_0x53a4d1);}return null;};}function patchUpdates(_0x21d6cf){return function(_0x3b3d05){try{jsonpatch[_0x8f88('0x1d')](_0x3b3d05,_0x21d6cf,!![]);}catch(_0x3a6d60){return BPromise[_0x8f88('0x1e')](_0x3a6d60);}return _0x3b3d05[_0x8f88('0x1f')]();};}function saveUpdates(_0x189a51,_0x249582){return function(_0x11808f){if(_0x11808f){return _0x11808f[_0x8f88('0x20')](_0x189a51)['then'](function(_0x512d9a){return _0x512d9a;});}return null;};}function removeEntity(_0x4a441e,_0x12a8c2){return function(_0x6528a5){if(_0x6528a5){return _0x6528a5[_0x8f88('0x21')]()[_0x8f88('0x22')](function(){_0x4a441e[_0x8f88('0x17')](0xcc)[_0x8f88('0x18')]();});}};}function handleEntityNotFound(_0x220646,_0x53f243){return function(_0x52b272){if(!_0x52b272){_0x220646['sendStatus'](0x194);}return _0x52b272;};}function handleError(_0x2ccb3c,_0x2f859b){_0x2f859b=_0x2f859b||0x1f4;return function(_0x1894fc){logger[_0x8f88('0x23')](_0x1894fc['stack']);if(_0x1894fc[_0x8f88('0x24')]){delete _0x1894fc[_0x8f88('0x24')];}_0x2ccb3c[_0x8f88('0x17')](_0x2f859b)['send'](_0x1894fc);};}exports[_0x8f88('0x25')]=function(_0x4812a1,_0x2b8217){var _0xcb4b95={},_0x15c379={},_0x1fecf8={'count':0x0,'rows':[]};var _0x14a5da=db[_0x8f88('0x26')][_0x8f88('0x27')];_0x15c379[_0x8f88('0x28')]=_['keys'](_0x14a5da);_0x15c379[_0x8f88('0x29')]=_[_0x8f88('0x2a')](_0x4812a1[_0x8f88('0x29')]);_0x15c379[_0x8f88('0x2b')]=_['intersection'](_0x15c379['model'],_0x15c379[_0x8f88('0x29')]);_0xcb4b95['attributes']=_[_0x8f88('0x2c')](_0x15c379[_0x8f88('0x28')],qs[_0x8f88('0x2d')](_0x4812a1[_0x8f88('0x29')]['fields']));_0xcb4b95[_0x8f88('0x2e')]=_0xcb4b95[_0x8f88('0x2e')]['length']?_0xcb4b95[_0x8f88('0x2e')]:_0x15c379[_0x8f88('0x28')];if(!_0x4812a1[_0x8f88('0x29')]['hasOwnProperty']('nolimit')){_0xcb4b95['limit']=qs[_0x8f88('0x2f')](_0x4812a1['query'][_0x8f88('0x2f')]);_0xcb4b95[_0x8f88('0x1b')]=qs[_0x8f88('0x1b')](_0x4812a1[_0x8f88('0x29')][_0x8f88('0x1b')]);}_0xcb4b95['order']=qs['sort'](_0x4812a1['query']['sort']);_0xcb4b95[_0x8f88('0x30')]=qs[_0x8f88('0x2b')](_[_0x8f88('0x31')](_0x4812a1[_0x8f88('0x29')],_0x15c379[_0x8f88('0x2b')]));if(_0x4812a1[_0x8f88('0x29')][_0x8f88('0x32')]){_0xcb4b95['where']=_[_0x8f88('0x33')](_0xcb4b95[_0x8f88('0x30')],{'$or':_[_0x8f88('0x34')](_0x14a5da,function(_0x29ed49){if(_0x29ed49[_0x8f88('0x35')][_0x8f88('0x36')]!=='VIRTUAL'){var _0x3958b1={};_0x3958b1[_0x29ed49[_0x8f88('0x37')]]={'$like':'%'+_0x4812a1[_0x8f88('0x29')][_0x8f88('0x32')]+'%'};return _0x3958b1;}})});}_0xcb4b95=_[_0x8f88('0x33')]({},_0xcb4b95,_0x4812a1[_0x8f88('0x38')]);var _0x19af53={'where':_0xcb4b95[_0x8f88('0x30')]};return db[_0x8f88('0x26')][_0x8f88('0x1a')](_0x19af53)['then'](function(_0x519329){_0x1fecf8[_0x8f88('0x1a')]=_0x519329;if(_0x4812a1[_0x8f88('0x29')][_0x8f88('0x39')]){_0xcb4b95['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x8f88('0x3a')](_0xcb4b95);})[_0x8f88('0x22')](function(_0x221d1e){_0x1fecf8[_0x8f88('0x3b')]=_0x221d1e;return _0x1fecf8;})[_0x8f88('0x22')](respondWithFilteredResult(_0x2b8217,_0xcb4b95))['catch'](handleError(_0x2b8217,null));};exports[_0x8f88('0x3c')]=function(_0x373104,_0x29da2e){var _0x54b64f={'raw':!![],'where':{'id':_0x373104[_0x8f88('0x3d')]['id']}},_0x1776fb={};_0x1776fb[_0x8f88('0x28')]=_['keys'](db[_0x8f88('0x26')]['rawAttributes']);_0x1776fb[_0x8f88('0x29')]=_[_0x8f88('0x2a')](_0x373104['query']);_0x1776fb['filters']=_[_0x8f88('0x2c')](_0x1776fb[_0x8f88('0x28')],_0x1776fb[_0x8f88('0x29')]);_0x54b64f[_0x8f88('0x2e')]=_[_0x8f88('0x2c')](_0x1776fb[_0x8f88('0x28')],qs['fields'](_0x373104[_0x8f88('0x29')]['fields']));_0x54b64f[_0x8f88('0x2e')]=_0x54b64f['attributes']['length']?_0x54b64f[_0x8f88('0x2e')]:_0x1776fb[_0x8f88('0x28')];if(_0x373104[_0x8f88('0x29')][_0x8f88('0x39')]){_0x54b64f['include']=[{'all':!![]}];}_0x54b64f=_[_0x8f88('0x33')]({},_0x54b64f,_0x373104[_0x8f88('0x38')]);return db[_0x8f88('0x26')]['find'](_0x54b64f)[_0x8f88('0x22')](handleEntityNotFound(_0x29da2e,null))[_0x8f88('0x22')](respondWithResult(_0x29da2e,null))[_0x8f88('0x3e')](handleError(_0x29da2e,null));};exports[_0x8f88('0x3f')]=function(_0x38d68c,_0x202ff6){return db[_0x8f88('0x26')][_0x8f88('0x3f')](_0x38d68c['body'],{})['then'](respondWithResult(_0x202ff6,0xc9))['catch'](handleError(_0x202ff6,null));};exports[_0x8f88('0x20')]=function(_0x317bdd,_0x41271){if(_0x317bdd[_0x8f88('0x40')]['id']){delete _0x317bdd[_0x8f88('0x40')]['id'];}return db[_0x8f88('0x26')]['find']({'where':{'id':_0x317bdd[_0x8f88('0x3d')]['id']}})['then'](handleEntityNotFound(_0x41271,null))[_0x8f88('0x22')](saveUpdates(_0x317bdd[_0x8f88('0x40')],null))[_0x8f88('0x22')](respondWithResult(_0x41271,null))['catch'](handleError(_0x41271,null));};exports[_0x8f88('0x21')]=function(_0x12f805,_0x2a0c85){return db['JscriptyAnswerReport'][_0x8f88('0x41')]({'where':{'id':_0x12f805[_0x8f88('0x3d')]['id']}})[_0x8f88('0x22')](handleEntityNotFound(_0x2a0c85,null))[_0x8f88('0x22')](removeEntity(_0x2a0c85,null))['catch'](handleError(_0x2a0c85,null));};exports[_0x8f88('0x42')]=function(_0x40bb4f,_0xded0b){return db['JscriptyAnswerReport'][_0x8f88('0x42')]()['then'](respondWithResult(_0xded0b,null))[_0x8f88('0x3e')](handleError(_0xded0b,null));}; \ No newline at end of file +var _0x0224=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','count','offset','limit','status','set','apply','update','destroy','then','end','error','stack','name','index','rawAttributes','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','where','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','JscriptyAnswerReport','findAll','rows','catch','show','params','model','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware'];(function(_0x5e5ec1,_0x4ece15){var _0xb09b02=function(_0x12ba75){while(--_0x12ba75){_0x5e5ec1['push'](_0x5e5ec1['shift']());}};_0xb09b02(++_0x4ece15);}(_0x0224,0x11b));var _0x4022=function(_0x4af2c3,_0xf4d1f4){_0x4af2c3=_0x4af2c3-0x0;var _0x74088=_0x0224[_0x4af2c3];return _0x74088;};'use strict';var pdf=require(_0x4022('0x0'));var emlformat=require(_0x4022('0x1'));var rimraf=require(_0x4022('0x2'));var zipdir=require(_0x4022('0x3'));var jsonpatch=require(_0x4022('0x4'));var rp=require(_0x4022('0x5'));var moment=require('moment');var BPromise=require(_0x4022('0x6'));var Mustache=require(_0x4022('0x7'));var util=require(_0x4022('0x8'));var path=require(_0x4022('0x9'));var sox=require(_0x4022('0xa'));var csv=require(_0x4022('0xb'));var ejs=require(_0x4022('0xc'));var fs=require('fs');var _=require(_0x4022('0xd'));var squel=require(_0x4022('0xe'));var crypto=require(_0x4022('0xf'));var jsforce=require(_0x4022('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x4022('0xb'));var querystring=require(_0x4022('0x11'));var Papa=require('papaparse');var Redis=require(_0x4022('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4022('0x13'));var hardwareService=require(_0x4022('0x14'));var logger=require(_0x4022('0x15'))(_0x4022('0x16'));var utils=require(_0x4022('0x17'));var config=require(_0x4022('0x18'));var db=require(_0x4022('0x19'))['db'];function respondWithStatusCode(_0x28d9b7,_0x2ca9ec){_0x2ca9ec=_0x2ca9ec||0xcc;return function(_0x19c4ce){if(_0x19c4ce){return _0x28d9b7[_0x4022('0x1a')](_0x2ca9ec);}return _0x28d9b7['status'](_0x2ca9ec)['end']();};}function respondWithResult(_0x5c8797,_0x5b9ab4){_0x5b9ab4=_0x5b9ab4||0xc8;return function(_0x51a382){if(_0x51a382){return _0x5c8797['status'](_0x5b9ab4)[_0x4022('0x1b')](_0x51a382);}};}function respondWithFilteredResult(_0x531a42,_0x39c1e2){return function(_0x4fce78){if(_0x4fce78){var _0x450330=_0x4fce78[_0x4022('0x1c')],_0x4c845b=_0x39c1e2[_0x4022('0x1d')],_0x3ac4a3=_0x39c1e2[_0x4022('0x1d')]+_0x39c1e2[_0x4022('0x1e')],_0x4baaad;if(_0x3ac4a3>=_0x450330){_0x3ac4a3=_0x450330;_0x4baaad=0xc8;}else{_0x4baaad=0xce;}_0x531a42[_0x4022('0x1f')](_0x4baaad);return _0x531a42[_0x4022('0x20')]('Content-Range',_0x4c845b+'-'+_0x3ac4a3+'/'+_0x450330)['json'](_0x4fce78);}return null;};}function patchUpdates(_0x2b3625){return function(_0xd04c77){try{jsonpatch[_0x4022('0x21')](_0xd04c77,_0x2b3625,!![]);}catch(_0x4da959){return BPromise['reject'](_0x4da959);}return _0xd04c77['save']();};}function saveUpdates(_0x233145,_0x22abf6){return function(_0x331e3c){if(_0x331e3c){return _0x331e3c[_0x4022('0x22')](_0x233145)['then'](function(_0x382a92){return _0x382a92;});}return null;};}function removeEntity(_0x6279ea,_0x44cff5){return function(_0x12318d){if(_0x12318d){return _0x12318d[_0x4022('0x23')]()[_0x4022('0x24')](function(){_0x6279ea[_0x4022('0x1f')](0xcc)[_0x4022('0x25')]();});}};}function handleEntityNotFound(_0x462dc4,_0x380cf7){return function(_0x167eb0){if(!_0x167eb0){_0x462dc4[_0x4022('0x1a')](0x194);}return _0x167eb0;};}function handleError(_0x519887,_0x49779f){_0x49779f=_0x49779f||0x1f4;return function(_0x14a3a3){logger[_0x4022('0x26')](_0x14a3a3[_0x4022('0x27')]);if(_0x14a3a3[_0x4022('0x28')]){delete _0x14a3a3[_0x4022('0x28')];}_0x519887['status'](_0x49779f)['send'](_0x14a3a3);};}exports[_0x4022('0x29')]=function(_0x38569b,_0x5af10){var _0x31d390={},_0x3822e1={},_0x126875={'count':0x0,'rows':[]};var _0xaae957=db['JscriptyAnswerReport'][_0x4022('0x2a')];_0x3822e1['model']=_['keys'](_0xaae957);_0x3822e1['query']=_[_0x4022('0x2b')](_0x38569b[_0x4022('0x2c')]);_0x3822e1[_0x4022('0x2d')]=_[_0x4022('0x2e')](_0x3822e1['model'],_0x3822e1[_0x4022('0x2c')]);_0x31d390[_0x4022('0x2f')]=_[_0x4022('0x2e')](_0x3822e1['model'],qs[_0x4022('0x30')](_0x38569b[_0x4022('0x2c')]['fields']));_0x31d390['attributes']=_0x31d390[_0x4022('0x2f')][_0x4022('0x31')]?_0x31d390[_0x4022('0x2f')]:_0x3822e1['model'];if(!_0x38569b['query'][_0x4022('0x32')](_0x4022('0x33'))){_0x31d390[_0x4022('0x1e')]=qs['limit'](_0x38569b['query'][_0x4022('0x1e')]);_0x31d390['offset']=qs[_0x4022('0x1d')](_0x38569b[_0x4022('0x2c')]['offset']);}_0x31d390[_0x4022('0x34')]=qs['sort'](_0x38569b[_0x4022('0x2c')]['sort']);_0x31d390['where']=qs['filters'](_[_0x4022('0x35')](_0x38569b[_0x4022('0x2c')],_0x3822e1[_0x4022('0x2d')]));if(_0x38569b[_0x4022('0x2c')]['filter']){_0x31d390[_0x4022('0x36')]=_[_0x4022('0x37')](_0x31d390[_0x4022('0x36')],{'$or':_[_0x4022('0x38')](_0xaae957,function(_0x448046){if(_0x448046[_0x4022('0x39')][_0x4022('0x3a')]!==_0x4022('0x3b')){var _0x2b31f4={};_0x2b31f4[_0x448046[_0x4022('0x3c')]]={'$like':'%'+_0x38569b[_0x4022('0x2c')][_0x4022('0x3d')]+'%'};return _0x2b31f4;}})});}_0x31d390=_[_0x4022('0x37')]({},_0x31d390,_0x38569b[_0x4022('0x3e')]);var _0x5cd5bf={'where':_0x31d390[_0x4022('0x36')]};return db['JscriptyAnswerReport']['count'](_0x5cd5bf)[_0x4022('0x24')](function(_0x31bf2b){_0x126875[_0x4022('0x1c')]=_0x31bf2b;if(_0x38569b['query'][_0x4022('0x3f')]){_0x31d390[_0x4022('0x40')]=[{'all':!![]}];}return db[_0x4022('0x41')][_0x4022('0x42')](_0x31d390);})[_0x4022('0x24')](function(_0x4ffbd0){_0x126875[_0x4022('0x43')]=_0x4ffbd0;return _0x126875;})['then'](respondWithFilteredResult(_0x5af10,_0x31d390))[_0x4022('0x44')](handleError(_0x5af10,null));};exports[_0x4022('0x45')]=function(_0xd82a76,_0x2d60b5){var _0x1cbc38={'raw':!![],'where':{'id':_0xd82a76[_0x4022('0x46')]['id']}},_0x5eb0fc={};_0x5eb0fc[_0x4022('0x47')]=_['keys'](db[_0x4022('0x41')][_0x4022('0x2a')]);_0x5eb0fc[_0x4022('0x2c')]=_[_0x4022('0x2b')](_0xd82a76[_0x4022('0x2c')]);_0x5eb0fc[_0x4022('0x2d')]=_[_0x4022('0x2e')](_0x5eb0fc['model'],_0x5eb0fc[_0x4022('0x2c')]);_0x1cbc38[_0x4022('0x2f')]=_['intersection'](_0x5eb0fc['model'],qs[_0x4022('0x30')](_0xd82a76[_0x4022('0x2c')][_0x4022('0x30')]));_0x1cbc38[_0x4022('0x2f')]=_0x1cbc38[_0x4022('0x2f')]['length']?_0x1cbc38[_0x4022('0x2f')]:_0x5eb0fc['model'];if(_0xd82a76[_0x4022('0x2c')]['includeAll']){_0x1cbc38[_0x4022('0x40')]=[{'all':!![]}];}_0x1cbc38=_['merge']({},_0x1cbc38,_0xd82a76['options']);return db[_0x4022('0x41')][_0x4022('0x48')](_0x1cbc38)['then'](handleEntityNotFound(_0x2d60b5,null))['then'](respondWithResult(_0x2d60b5,null))[_0x4022('0x44')](handleError(_0x2d60b5,null));};exports['create']=function(_0x394f3f,_0x2390d6){return db[_0x4022('0x41')][_0x4022('0x49')](_0x394f3f[_0x4022('0x4a')],{})[_0x4022('0x24')](respondWithResult(_0x2390d6,0xc9))['catch'](handleError(_0x2390d6,null));};exports[_0x4022('0x22')]=function(_0x18482e,_0x42f4c8){if(_0x18482e[_0x4022('0x4a')]['id']){delete _0x18482e[_0x4022('0x4a')]['id'];}return db['JscriptyAnswerReport'][_0x4022('0x48')]({'where':{'id':_0x18482e[_0x4022('0x46')]['id']}})[_0x4022('0x24')](handleEntityNotFound(_0x42f4c8,null))[_0x4022('0x24')](saveUpdates(_0x18482e[_0x4022('0x4a')],null))[_0x4022('0x24')](respondWithResult(_0x42f4c8,null))[_0x4022('0x44')](handleError(_0x42f4c8,null));};exports['destroy']=function(_0xf0ad72,_0x3ee343){return db[_0x4022('0x41')][_0x4022('0x48')]({'where':{'id':_0xf0ad72[_0x4022('0x46')]['id']}})[_0x4022('0x24')](handleEntityNotFound(_0x3ee343,null))['then'](removeEntity(_0x3ee343,null))[_0x4022('0x44')](handleError(_0x3ee343,null));};exports[_0x4022('0x4b')]=function(_0x43437c,_0x3c17a4){return db['JscriptyAnswerReport']['describe']()['then'](respondWithResult(_0x3c17a4,null))[_0x4022('0x44')](handleError(_0x3c17a4,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index f20fba3..c68e26c 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 _0xfb68=['bluebird','request-promise','path','rimraf','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment'];(function(_0x4371ae,_0x218bbb){var _0x9a56a0=function(_0x4cde56){while(--_0x4cde56){_0x4371ae['push'](_0x4371ae['shift']());}};_0x9a56a0(++_0x218bbb);}(_0xfb68,0x7d));var _0x8fb6=function(_0x446c21,_0x1f8a5c){_0x446c21=_0x446c21-0x0;var _0x1e3758=_0xfb68[_0x446c21];return _0x1e3758;};'use strict';var _=require(_0x8fb6('0x0'));var util=require(_0x8fb6('0x1'));var logger=require(_0x8fb6('0x2'))(_0x8fb6('0x3'));var moment=require(_0x8fb6('0x4'));var BPromise=require(_0x8fb6('0x5'));var rp=require(_0x8fb6('0x6'));var fs=require('fs');var path=require(_0x8fb6('0x7'));var rimraf=require(_0x8fb6('0x8'));var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module[_0x8fb6('0x9')]=function(_0x8567ab,_0x434cf0){return _0x8567ab[_0x8fb6('0xa')](_0x8fb6('0xb'),attributes,{'tableName':_0x8fb6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf567=['lodash','../../config/logger','api','bluebird','request-promise','rimraf','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers'];(function(_0x1c9bbe,_0x553bbd){var _0x114ad8=function(_0x460937){while(--_0x460937){_0x1c9bbe['push'](_0x1c9bbe['shift']());}};_0x114ad8(++_0x553bbd);}(_0xf567,0x176));var _0x7f56=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf567[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x7f56('0x0'));var util=require('util');var logger=require(_0x7f56('0x1'))(_0x7f56('0x2'));var moment=require('moment');var BPromise=require(_0x7f56('0x3'));var rp=require(_0x7f56('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7f56('0x5'));var config=require('../../config/environment');var attributes=require(_0x7f56('0x6'));module[_0x7f56('0x7')]=function(_0x3895bc,_0x3036c7){return _0x3895bc[_0x7f56('0x8')](_0x7f56('0x9'),attributes,{'tableName':_0x7f56('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index e407072..dadd70a 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 _0xdf10=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird'];(function(_0x40189c,_0x9a13d){var _0x2fb386=function(_0x2f2aba){while(--_0x2f2aba){_0x40189c['push'](_0x40189c['shift']());}};_0x2fb386(++_0x9a13d);}(_0xdf10,0xcf));var _0x0df1=function(_0x4086ae,_0x1022b4){_0x4086ae=_0x4086ae-0x0;var _0x2004bf=_0xdf10[_0x4086ae];return _0x2004bf;};'use strict';var _=require('lodash');var util=require(_0x0df1('0x0'));var moment=require(_0x0df1('0x1'));var BPromise=require(_0x0df1('0x2'));var rs=require(_0x0df1('0x3'));var fs=require('fs');var Redis=require(_0x0df1('0x4'));var db=require(_0x0df1('0x5'))['db'];var utils=require(_0x0df1('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0df1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0df1('0x8')][_0x0df1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53f950,_0x2998c0,_0x31264d){return new BPromise(function(_0x304f53,_0x49c7dd){return client[_0x0df1('0xa')](_0x53f950,_0x31264d)[_0x0df1('0xb')](function(_0x5127ba){logger[_0x0df1('0xc')](_0x0df1('0xd'),_0x2998c0,_0x0df1('0xe'));logger[_0x0df1('0xf')](_0x0df1('0x10'),_0x2998c0,'request\x20sent',JSON[_0x0df1('0x11')](_0x5127ba));if(_0x5127ba[_0x0df1('0x12')]){if(_0x5127ba[_0x0df1('0x12')]['code']===0x1f4){logger[_0x0df1('0x12')](_0x0df1('0xd'),_0x2998c0,_0x5127ba[_0x0df1('0x12')][_0x0df1('0x13')]);return _0x49c7dd(_0x5127ba['error']['message']);}logger['error'](_0x0df1('0xd'),_0x2998c0,_0x5127ba[_0x0df1('0x12')][_0x0df1('0x13')]);return _0x304f53(_0x5127ba[_0x0df1('0x12')][_0x0df1('0x13')]);}else{logger[_0x0df1('0xc')](_0x0df1('0xd'),_0x2998c0,'request\x20sent');_0x304f53(_0x5127ba[_0x0df1('0x14')][_0x0df1('0x13')]);}})['catch'](function(_0x233b81){logger[_0x0df1('0x12')](_0x0df1('0xd'),_0x2998c0,_0x233b81);_0x49c7dd(_0x233b81);});});} \ No newline at end of file +var _0x8403=['stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s'];(function(_0x488731,_0x493d8b){var _0xd79279=function(_0x437776){while(--_0x437776){_0x488731['push'](_0x488731['shift']());}};_0xd79279(++_0x493d8b);}(_0x8403,0xc2));var _0x3840=function(_0x4a7741,_0x18f8c0){_0x4a7741=_0x4a7741-0x0;var _0x5abff9=_0x8403[_0x4a7741];return _0x5abff9;};'use strict';var _=require(_0x3840('0x0'));var util=require(_0x3840('0x1'));var moment=require('moment');var BPromise=require(_0x3840('0x2'));var rs=require(_0x3840('0x3'));var fs=require('fs');var Redis=require(_0x3840('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3840('0x5'));var logger=require(_0x3840('0x6'))(_0x3840('0x7'));var config=require(_0x3840('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a6265,_0x15efc6,_0x2b26e8){return new BPromise(function(_0x63fe0,_0x28a0b1){return client['request'](_0x5a6265,_0x2b26e8)[_0x3840('0x9')](function(_0x1cef25){logger[_0x3840('0xa')](_0x3840('0xb'),_0x15efc6,_0x3840('0xc'));logger[_0x3840('0xd')](_0x3840('0xe'),_0x15efc6,_0x3840('0xc'),JSON[_0x3840('0xf')](_0x1cef25));if(_0x1cef25[_0x3840('0x10')]){if(_0x1cef25['error'][_0x3840('0x11')]===0x1f4){logger[_0x3840('0x10')](_0x3840('0xb'),_0x15efc6,_0x1cef25['error'][_0x3840('0x12')]);return _0x28a0b1(_0x1cef25['error'][_0x3840('0x12')]);}logger[_0x3840('0x10')](_0x3840('0xb'),_0x15efc6,_0x1cef25['error'][_0x3840('0x12')]);return _0x63fe0(_0x1cef25[_0x3840('0x10')][_0x3840('0x12')]);}else{logger[_0x3840('0xa')](_0x3840('0xb'),_0x15efc6,'request\x20sent');_0x63fe0(_0x1cef25['result']['message']);}})['catch'](function(_0x54f220){logger[_0x3840('0x10')](_0x3840('0xb'),_0x15efc6,_0x54f220);_0x28a0b1(_0x54f220);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 85c17be..5e8de3c 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 _0x49aa=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','index','get','/:id','/:id/sessions','getSessions','/:id/answers','/:id/summary','30s','getSummary','post','/:id/clone','clone','put','delete','destroy','multer','util','path','express'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x49aa,0x173));var _0xa49a=function(_0x1418d8,_0x3661f3){_0x1418d8=_0x1418d8-0x0;var _0x3e6c33=_0x49aa[_0x1418d8];return _0x3e6c33;};'use strict';var multer=require(_0xa49a('0x0'));var util=require(_0xa49a('0x1'));var path=require(_0xa49a('0x2'));var timeout=require('connect-timeout');var express=require(_0xa49a('0x3'));var router=express[_0xa49a('0x4')]();var auth=require(_0xa49a('0x5'));var interaction=require(_0xa49a('0x6'));var config=require(_0xa49a('0x7'));var controller=require(_0xa49a('0x8'));router['get']('/',auth[_0xa49a('0x9')](),controller[_0xa49a('0xa')]);router[_0xa49a('0xb')](_0xa49a('0xc'),auth[_0xa49a('0x9')](),controller['show']);router['get'](_0xa49a('0xd'),auth[_0xa49a('0x9')](),controller[_0xa49a('0xe')]);router[_0xa49a('0xb')](_0xa49a('0xf'),auth[_0xa49a('0x9')](),controller['getAnswers']);router[_0xa49a('0xb')](_0xa49a('0x10'),auth[_0xa49a('0x9')](),timeout(_0xa49a('0x11')),controller[_0xa49a('0x12')]);router[_0xa49a('0x13')]('/',auth[_0xa49a('0x9')](),controller['create']);router[_0xa49a('0x13')](_0xa49a('0x14'),auth[_0xa49a('0x9')](),controller[_0xa49a('0x15')]);router[_0xa49a('0x16')](_0xa49a('0xc'),auth[_0xa49a('0x9')](),controller['update']);router[_0xa49a('0x17')](_0xa49a('0xc'),auth[_0xa49a('0x9')](),controller[_0xa49a('0x18')]);module['exports']=router; \ No newline at end of file +var _0x8ae0=['./jscriptyProject.controller','isAuthenticated','get','/:id','show','/:id/sessions','/:id/answers','/:id/summary','30s','getSummary','post','clone','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment'];(function(_0x3ef4cd,_0x10d8e3){var _0x593010=function(_0x31d9d7){while(--_0x31d9d7){_0x3ef4cd['push'](_0x3ef4cd['shift']());}};_0x593010(++_0x10d8e3);}(_0x8ae0,0x169));var _0x08ae=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x8ae0[_0x160c73];return _0xd9302;};'use strict';var multer=require(_0x08ae('0x0'));var util=require(_0x08ae('0x1'));var path=require(_0x08ae('0x2'));var timeout=require(_0x08ae('0x3'));var express=require(_0x08ae('0x4'));var router=express[_0x08ae('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x08ae('0x6'));var controller=require(_0x08ae('0x7'));router['get']('/',auth[_0x08ae('0x8')](),controller['index']);router[_0x08ae('0x9')](_0x08ae('0xa'),auth[_0x08ae('0x8')](),controller[_0x08ae('0xb')]);router[_0x08ae('0x9')](_0x08ae('0xc'),auth[_0x08ae('0x8')](),controller['getSessions']);router[_0x08ae('0x9')](_0x08ae('0xd'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x08ae('0xe'),auth[_0x08ae('0x8')](),timeout(_0x08ae('0xf')),controller[_0x08ae('0x10')]);router[_0x08ae('0x11')]('/',auth[_0x08ae('0x8')](),controller['create']);router['post']('/:id/clone',auth[_0x08ae('0x8')](),controller[_0x08ae('0x12')]);router[_0x08ae('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x08ae('0x14')]);router['delete'](_0x08ae('0xa'),auth[_0x08ae('0x8')](),controller[_0x08ae('0x15')]);module[_0x08ae('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 3db7aa8..ce430a6 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 _0x255f=['format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','BOOLEAN','sequelize','lodash','util','STRING','long','formData','stringify','isString','setDataValue'];(function(_0x538e95,_0x2592d9){var _0x267475=function(_0x4ebdf2){while(--_0x4ebdf2){_0x538e95['push'](_0x538e95['shift']());}};_0x267475(++_0x2592d9);}(_0x255f,0xe5));var _0xf255=function(_0x1f0b55,_0x20360a){_0x1f0b55=_0x1f0b55-0x0;var _0x49df7e=_0x255f[_0x1f0b55];return _0x49df7e;};'use strict';var Sequelize=require(_0xf255('0x0'));var _=require(_0xf255('0x1'));var util=require(_0xf255('0x2'));module['exports']={'name':{'type':Sequelize[_0xf255('0x3')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0xf255('0x4')),'set':function(_0xf3195d){if(_['isObjectLike'](_0xf3195d)){this['setDataValue'](_0xf255('0x5'),JSON[_0xf255('0x6')](_0xf3195d));}else if(_[_0xf255('0x7')](_0xf3195d)){this[_0xf255('0x8')]('formData',_0xf3195d);}else{this['setDataValue'](_0xf255('0x5'),util[_0xf255('0x9')](_0xf255('0xa'),this[_0xf255('0xb')](_0xf255('0xc'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xf255('0xd')],'defaultValue':!![]}}; \ No newline at end of file +var _0x2a4d=['{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','isObjectLike','stringify','isString','setDataValue','formData','format'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x2a4d,0x9d));var _0xd2a4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x2a4d[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require(_0xd2a4('0x0'));var _=require(_0xd2a4('0x1'));var util=require(_0xd2a4('0x2'));module[_0xd2a4('0x3')]={'name':{'type':Sequelize[_0xd2a4('0x4')],'unique':_0xd2a4('0x5')},'description':{'type':Sequelize[_0xd2a4('0x4')]},'formData':{'type':Sequelize[_0xd2a4('0x6')]('long'),'set':function(_0x1bf3a9){if(_[_0xd2a4('0x7')](_0x1bf3a9)){this['setDataValue']('formData',JSON[_0xd2a4('0x8')](_0x1bf3a9));}else if(_[_0xd2a4('0x9')](_0x1bf3a9)){this[_0xd2a4('0xa')]('formData',_0x1bf3a9);}else{this[_0xd2a4('0xa')](_0xd2a4('0xb'),util[_0xd2a4('0xc')](_0xd2a4('0xd'),this[_0xd2a4('0xe')](_0xd2a4('0x5'))||'',this[_0xd2a4('0xe')](_0xd2a4('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xd2a4('0x10')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 162523d..49410a8 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 _0x8dce=['util','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','save','update','then','destroy','get','Projects','UserProfileResource','error','stack','name','JscriptyProject','model','keys','query','intersection','fields','attributes','length','order','sort','filters','pick','filter','where','merge','map','key','field','options','includeAll','findAll','rows','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','rawAttributes','updatedAt','omit','createdAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','JscriptySessionReport','nolimit','getAnswers','findOne','JscriptyAnswerReport','hasOwnProperty','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','push','isEmpty','now','writeFileSync','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x470a6f,_0x33081e){var _0x21b86a=function(_0x3fa3f5){while(--_0x3fa3f5){_0x470a6f['push'](_0x470a6f['shift']());}};_0x21b86a(++_0x33081e);}(_0x8dce,0x1b5));var _0xe8dc=function(_0x4b4543,_0x19b1fe){_0x4b4543=_0x4b4543-0x0;var _0x5ee8f0=_0x8dce[_0x4b4543];return _0x5ee8f0;};'use strict';var pdf=require(_0xe8dc('0x0'));var emlformat=require(_0xe8dc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe8dc('0x2'));var jsonpatch=require(_0xe8dc('0x3'));var rp=require(_0xe8dc('0x4'));var moment=require(_0xe8dc('0x5'));var BPromise=require(_0xe8dc('0x6'));var Mustache=require('mustache');var util=require(_0xe8dc('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xe8dc('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xe8dc('0x9'));var crypto=require(_0xe8dc('0xa'));var jsforce=require(_0xe8dc('0xb'));var deskjs=require(_0xe8dc('0xc'));var toCsv=require(_0xe8dc('0x8'));var querystring=require('querystring');var Papa=require(_0xe8dc('0xd'));var Redis=require(_0xe8dc('0xe'));var authService=require(_0xe8dc('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe8dc('0x10'));var logger=require(_0xe8dc('0x11'))('api');var utils=require(_0xe8dc('0x12'));var config=require(_0xe8dc('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x417fd7,_0x445050){_0x445050=_0x445050||0xcc;return function(_0x4aecba){if(_0x4aecba){return _0x417fd7[_0xe8dc('0x14')](_0x445050);}return _0x417fd7[_0xe8dc('0x15')](_0x445050)[_0xe8dc('0x16')]();};}function respondWithResult(_0x154540,_0x1f1421){_0x1f1421=_0x1f1421||0xc8;return function(_0x5c4aa3){if(_0x5c4aa3){return _0x154540[_0xe8dc('0x15')](_0x1f1421)['json'](_0x5c4aa3);}};}function respondWithFilteredResult(_0x73205b,_0x1c1531){return function(_0x24188e){if(_0x24188e){var _0x4b8be1=_0x24188e[_0xe8dc('0x17')],_0x3837ed=_0x1c1531['offset'],_0x5f3e0d=_0x1c1531[_0xe8dc('0x18')]+_0x1c1531[_0xe8dc('0x19')],_0x2284dd;if(_0x5f3e0d>=_0x4b8be1){_0x5f3e0d=_0x4b8be1;_0x2284dd=0xc8;}else{_0x2284dd=0xce;}_0x73205b['status'](_0x2284dd);return _0x73205b['set'](_0xe8dc('0x1a'),_0x3837ed+'-'+_0x5f3e0d+'/'+_0x4b8be1)[_0xe8dc('0x1b')](_0x24188e);}return null;};}function patchUpdates(_0x532dff){return function(_0x6754fb){try{jsonpatch[_0xe8dc('0x1c')](_0x6754fb,_0x532dff,!![]);}catch(_0xbd4ec1){return BPromise['reject'](_0xbd4ec1);}return _0x6754fb[_0xe8dc('0x1d')]();};}function saveUpdates(_0x55d9f2,_0x4494a8){return function(_0x1c6ced){if(_0x1c6ced){return _0x1c6ced[_0xe8dc('0x1e')](_0x55d9f2)[_0xe8dc('0x1f')](function(_0x366253){return _0x366253;});}return null;};}function removeEntity(_0x236a21,_0x2851d1){return function(_0xeedf3c){if(_0xeedf3c){return _0xeedf3c[_0xe8dc('0x20')]()[_0xe8dc('0x1f')](function(){var _0x39c637=_0xeedf3c[_0xe8dc('0x21')]({'plain':!![]});var _0x1f0cd9=_0xe8dc('0x22');return db[_0xe8dc('0x23')][_0xe8dc('0x20')]({'where':{'type':_0x1f0cd9,'resourceId':_0x39c637['id']}})[_0xe8dc('0x1f')](function(){return _0xeedf3c;});})['then'](function(){_0x236a21[_0xe8dc('0x15')](0xcc)[_0xe8dc('0x16')]();});}};}function handleEntityNotFound(_0x2c953f,_0x55733f){return function(_0xa41026){if(!_0xa41026){_0x2c953f[_0xe8dc('0x14')](0x194);}return _0xa41026;};}function handleError(_0x128ec2,_0x2e0431){_0x2e0431=_0x2e0431||0x1f4;return function(_0x113802){logger[_0xe8dc('0x24')](_0x113802[_0xe8dc('0x25')]);if(_0x113802['name']){delete _0x113802[_0xe8dc('0x26')];}_0x128ec2[_0xe8dc('0x15')](_0x2e0431)['send'](_0x113802);};}exports['index']=function(_0x33aa2d,_0x523572){var _0x6ab811={},_0x5a4e56={},_0x1f051f={'count':0x0,'rows':[]};var _0x46d305=db[_0xe8dc('0x27')]['rawAttributes'];_0x5a4e56[_0xe8dc('0x28')]=_[_0xe8dc('0x29')](_0x46d305);_0x5a4e56[_0xe8dc('0x2a')]=_['keys'](_0x33aa2d[_0xe8dc('0x2a')]);_0x5a4e56['filters']=_[_0xe8dc('0x2b')](_0x5a4e56[_0xe8dc('0x28')],_0x5a4e56[_0xe8dc('0x2a')]);_0x6ab811['attributes']=_['intersection'](_0x5a4e56[_0xe8dc('0x28')],qs['fields'](_0x33aa2d[_0xe8dc('0x2a')][_0xe8dc('0x2c')]));_0x6ab811['attributes']=_0x6ab811[_0xe8dc('0x2d')][_0xe8dc('0x2e')]?_0x6ab811[_0xe8dc('0x2d')]:_0x5a4e56[_0xe8dc('0x28')];if(!_0x33aa2d['query']['hasOwnProperty']('nolimit')){_0x6ab811[_0xe8dc('0x19')]=qs[_0xe8dc('0x19')](_0x33aa2d[_0xe8dc('0x2a')][_0xe8dc('0x19')]);_0x6ab811['offset']=qs[_0xe8dc('0x18')](_0x33aa2d[_0xe8dc('0x2a')][_0xe8dc('0x18')]);}_0x6ab811[_0xe8dc('0x2f')]=qs['sort'](_0x33aa2d['query'][_0xe8dc('0x30')]);_0x6ab811['where']=qs[_0xe8dc('0x31')](_[_0xe8dc('0x32')](_0x33aa2d[_0xe8dc('0x2a')],_0x5a4e56[_0xe8dc('0x31')]));if(_0x33aa2d[_0xe8dc('0x2a')][_0xe8dc('0x33')]){_0x6ab811[_0xe8dc('0x34')]=_[_0xe8dc('0x35')](_0x6ab811['where'],{'$or':_[_0xe8dc('0x36')](_0x46d305,function(_0x53c73e){if(_0x53c73e['type'][_0xe8dc('0x37')]!=='VIRTUAL'){var _0x1770e9={};_0x1770e9[_0x53c73e[_0xe8dc('0x38')]]={'$like':'%'+_0x33aa2d['query']['filter']+'%'};return _0x1770e9;}})});}_0x6ab811=_[_0xe8dc('0x35')]({},_0x6ab811,_0x33aa2d[_0xe8dc('0x39')]);var _0x5547ea={'where':_0x6ab811[_0xe8dc('0x34')]};return db[_0xe8dc('0x27')][_0xe8dc('0x17')](_0x5547ea)[_0xe8dc('0x1f')](function(_0x35f220){_0x1f051f[_0xe8dc('0x17')]=_0x35f220;if(_0x33aa2d[_0xe8dc('0x2a')][_0xe8dc('0x3a')]){_0x6ab811['include']=[{'all':!![]}];}return db[_0xe8dc('0x27')][_0xe8dc('0x3b')](_0x6ab811);})[_0xe8dc('0x1f')](function(_0x15883a){_0x1f051f[_0xe8dc('0x3c')]=_0x15883a;return _0x1f051f;})['then'](respondWithFilteredResult(_0x523572,_0x6ab811))[_0xe8dc('0x3d')](handleError(_0x523572,null));};exports[_0xe8dc('0x3e')]=function(_0x12ece5,_0x3f7659){var _0x5b005f={'raw':![],'where':{'id':_0x12ece5['params']['id']}},_0x5428bc={};_0x5428bc[_0xe8dc('0x28')]=_[_0xe8dc('0x29')](db['JscriptyProject']['rawAttributes']);_0x5428bc['query']=_['keys'](_0x12ece5[_0xe8dc('0x2a')]);_0x5428bc[_0xe8dc('0x31')]=_[_0xe8dc('0x2b')](_0x5428bc[_0xe8dc('0x28')],_0x5428bc[_0xe8dc('0x2a')]);_0x5b005f[_0xe8dc('0x2d')]=_[_0xe8dc('0x2b')](_0x5428bc['model'],qs[_0xe8dc('0x2c')](_0x12ece5['query']['fields']));_0x5b005f[_0xe8dc('0x2d')]=_0x5b005f['attributes'][_0xe8dc('0x2e')]?_0x5b005f[_0xe8dc('0x2d')]:_0x5428bc[_0xe8dc('0x28')];if(_0x12ece5[_0xe8dc('0x2a')][_0xe8dc('0x3a')]){_0x5b005f[_0xe8dc('0x3f')]=[{'all':!![]}];}_0x5b005f=_[_0xe8dc('0x35')]({},_0x5b005f,_0x12ece5['options']);return db[_0xe8dc('0x27')][_0xe8dc('0x40')](_0x5b005f)[_0xe8dc('0x1f')](handleEntityNotFound(_0x3f7659,null))[_0xe8dc('0x1f')](respondWithResult(_0x3f7659,null))[_0xe8dc('0x3d')](handleError(_0x3f7659,null));};exports['create']=function(_0x22026f,_0x1c9846){return db['JscriptyProject'][_0xe8dc('0x41')](_0x22026f[_0xe8dc('0x42')],{})['then'](function(_0x577f29){var _0x116dad=_0x22026f[_0xe8dc('0x43')]['get']({'plain':!![]});if(!_0x116dad)throw new Error(_0xe8dc('0x44'));if(_0x116dad[_0xe8dc('0x45')]==='user'){var _0x7b699d=_0x577f29[_0xe8dc('0x21')]({'plain':!![]});var _0x1d2182='Projects';return db[_0xe8dc('0x46')]['find']({'where':{'name':_0x1d2182,'userProfileId':_0x116dad[_0xe8dc('0x47')]},'raw':!![]})['then'](function(_0x299e1d){if(_0x299e1d&&_0x299e1d[_0xe8dc('0x48')]===0x0){return db['UserProfileResource'][_0xe8dc('0x41')]({'name':_0x7b699d['name'],'resourceId':_0x7b699d['id'],'type':_0x299e1d[_0xe8dc('0x26')],'sectionId':_0x299e1d['id']},{})[_0xe8dc('0x1f')](function(){return _0x577f29;});}else{return _0x577f29;}})[_0xe8dc('0x3d')](function(_0x1b5c45){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b5c45);throw _0x1b5c45;});}return _0x577f29;})['then'](respondWithResult(_0x1c9846,0xc9))[_0xe8dc('0x3d')](handleError(_0x1c9846,null));};exports['clone']=function(_0x2fe25a,_0x3fe3bc){var _0x2ecac6={'raw':![],'where':{'id':_0x2fe25a[_0xe8dc('0x49')]['id']}},_0x2b62b8={};_0x2b62b8['model']=_[_0xe8dc('0x29')](db[_0xe8dc('0x27')][_0xe8dc('0x4a')]);_0x2ecac6[_0xe8dc('0x2d')]=_['intersection'](_0x2b62b8[_0xe8dc('0x28')],qs['fields'](_0x2fe25a[_0xe8dc('0x2a')]['fields']));_0x2ecac6[_0xe8dc('0x2d')]=_0x2ecac6[_0xe8dc('0x2d')][_0xe8dc('0x2e')]?_0x2ecac6[_0xe8dc('0x2d')]:_0x2b62b8[_0xe8dc('0x28')];if(_0x2fe25a[_0xe8dc('0x2a')][_0xe8dc('0x3a')]){_0x2ecac6[_0xe8dc('0x3f')]=[{'all':!![]}];}_0x2ecac6=_['merge']({},_0x2ecac6,_0x2fe25a['options']);return db['JscriptyProject'][_0xe8dc('0x40')](_0x2ecac6)[_0xe8dc('0x1f')](handleEntityNotFound(_0x3fe3bc,null))[_0xe8dc('0x1f')](function(_0x116a00){if(_0x116a00){var _0x18b1ac=_0x116a00[_0xe8dc('0x21')]({'plain':!![]});_0x18b1ac=qs['omit'](_0x18b1ac,['id','createdAt',_0xe8dc('0x4b')]);_0x2fe25a[_0xe8dc('0x42')]=_[_0xe8dc('0x4c')](_0x2fe25a[_0xe8dc('0x42')],['id',_0xe8dc('0x4d'),_0xe8dc('0x4b')]);return db[_0xe8dc('0x27')][_0xe8dc('0x41')](_[_0xe8dc('0x35')](_0x18b1ac,_0x2fe25a[_0xe8dc('0x42')]),{'include':_0x2fe25a[_0xe8dc('0x2a')][_0xe8dc('0x3a')]?[{'all':!![]}]:undefined})[_0xe8dc('0x1f')](function(_0x3d0c3a){var _0x2a324d=_0x2fe25a[_0xe8dc('0x43')][_0xe8dc('0x21')]({'plain':!![]});if(!_0x2a324d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a324d[_0xe8dc('0x45')]===_0xe8dc('0x43')){var _0x25720d=_0x3d0c3a[_0xe8dc('0x21')]({'plain':!![]});var _0x17c886=_0xe8dc('0x22');return db[_0xe8dc('0x46')][_0xe8dc('0x40')]({'where':{'name':_0x17c886,'userProfileId':_0x2a324d[_0xe8dc('0x47')]},'raw':!![]})[_0xe8dc('0x1f')](function(_0x1490cd){if(_0x1490cd&&_0x1490cd[_0xe8dc('0x48')]===0x0){return db['UserProfileResource']['create']({'name':_0x25720d['name'],'resourceId':_0x25720d['id'],'type':_0x1490cd['name'],'sectionId':_0x1490cd['id']},{})[_0xe8dc('0x1f')](function(){return _0x3d0c3a;});}else{return _0x3d0c3a;}})[_0xe8dc('0x3d')](function(_0x457651){logger[_0xe8dc('0x24')](_0xe8dc('0x4e'),_0x457651);throw _0x457651;});}return _0x3d0c3a;});}})['then'](respondWithResult(_0x3fe3bc,0xc9))['catch'](handleError(_0x3fe3bc,null));};exports['update']=function(_0x99fd3c,_0x3d9fad){if(_0x99fd3c[_0xe8dc('0x42')]['id']){delete _0x99fd3c['body']['id'];}return db[_0xe8dc('0x27')][_0xe8dc('0x40')]({'where':{'id':_0x99fd3c['params']['id']}})['then'](handleEntityNotFound(_0x3d9fad,null))['then'](saveUpdates(_0x99fd3c[_0xe8dc('0x42')],null))[_0xe8dc('0x1f')](respondWithResult(_0x3d9fad,null))[_0xe8dc('0x3d')](handleError(_0x3d9fad,null));};exports[_0xe8dc('0x20')]=function(_0x1e61bf,_0x28a91c){return db['JscriptyProject'][_0xe8dc('0x40')]({'where':{'id':_0x1e61bf[_0xe8dc('0x49')]['id']}})[_0xe8dc('0x1f')](handleEntityNotFound(_0x28a91c,null))[_0xe8dc('0x1f')](removeEntity(_0x28a91c,null))[_0xe8dc('0x3d')](handleError(_0x28a91c,null));};exports[_0xe8dc('0x4f')]=function(_0x3da606,_0x146279,_0x21a7ed){var _0x10b719={'raw':!![],'where':{}};var _0x1bce7f={};var _0x44b09e={'count':0x0,'rows':[]};return db[_0xe8dc('0x27')]['findOne']({'where':{'id':_0x3da606[_0xe8dc('0x49')]['id']}})[_0xe8dc('0x1f')](handleEntityNotFound(_0x146279,null))['then'](function(_0x2cbcae){if(_0x2cbcae){_0x1bce7f[_0xe8dc('0x28')]=_['keys'](db[_0xe8dc('0x50')][_0xe8dc('0x4a')]);_0x1bce7f['query']=_[_0xe8dc('0x29')](_0x3da606[_0xe8dc('0x2a')]);_0x1bce7f[_0xe8dc('0x31')]=_[_0xe8dc('0x2b')](_0x1bce7f['model'],_0x1bce7f[_0xe8dc('0x2a')]);_0x10b719['attributes']=_['intersection'](_0x1bce7f[_0xe8dc('0x28')],qs[_0xe8dc('0x2c')](_0x3da606[_0xe8dc('0x2a')][_0xe8dc('0x2c')]));_0x10b719[_0xe8dc('0x2d')]=_0x10b719['attributes'][_0xe8dc('0x2e')]?_0x10b719[_0xe8dc('0x2d')]:_0x1bce7f['model'];if(!_0x3da606[_0xe8dc('0x2a')]['hasOwnProperty'](_0xe8dc('0x51'))){_0x10b719['limit']=qs[_0xe8dc('0x19')](_0x3da606[_0xe8dc('0x2a')][_0xe8dc('0x19')]);_0x10b719[_0xe8dc('0x18')]=qs['offset'](_0x3da606[_0xe8dc('0x2a')][_0xe8dc('0x18')]);}_0x10b719[_0xe8dc('0x2f')]=qs['sort'](_0x3da606[_0xe8dc('0x2a')][_0xe8dc('0x30')]);_0x10b719[_0xe8dc('0x34')]=qs['filters'](_[_0xe8dc('0x32')](_0x3da606[_0xe8dc('0x2a')],_0x1bce7f[_0xe8dc('0x31')]));_0x10b719[_0xe8dc('0x34')]['ProjectId']=_0x2cbcae['id'];if(_0x3da606['query'][_0xe8dc('0x33')]){_0x10b719['where']=_[_0xe8dc('0x35')](_0x10b719[_0xe8dc('0x34')],{'$or':_[_0xe8dc('0x36')](_0x10b719[_0xe8dc('0x2d')],function(_0x6330e0){var _0x430335={};_0x430335[_0x6330e0]={'$like':'%'+_0x3da606[_0xe8dc('0x2a')]['filter']+'%'};return _0x430335;})});}_0x10b719=_[_0xe8dc('0x35')]({},_0x10b719,_0x3da606[_0xe8dc('0x39')]);return db[_0xe8dc('0x50')][_0xe8dc('0x17')]({'where':_0x10b719[_0xe8dc('0x34')]})[_0xe8dc('0x1f')](function(_0x4e9b9a){_0x44b09e['count']=_0x4e9b9a;if(_0x3da606[_0xe8dc('0x2a')][_0xe8dc('0x3a')]){_0x10b719['include']=[{'all':!![]}];}return db[_0xe8dc('0x50')][_0xe8dc('0x3b')](_0x10b719);})[_0xe8dc('0x1f')](function(_0xf656b8){_0x44b09e['rows']=_0xf656b8;return _0x44b09e;});}})[_0xe8dc('0x1f')](respondWithFilteredResult(_0x146279,_0x10b719))[_0xe8dc('0x3d')](handleError(_0x146279,null));};exports[_0xe8dc('0x52')]=function(_0x5a8e55,_0x5935ed,_0x22c75e){var _0x508595={'raw':!![],'where':{}};var _0x4afdcc={};var _0x2a2656={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xe8dc('0x53')]({'where':{'id':_0x5a8e55[_0xe8dc('0x49')]['id']}})[_0xe8dc('0x1f')](handleEntityNotFound(_0x5935ed,null))[_0xe8dc('0x1f')](function(_0x42495a){if(_0x42495a){_0x4afdcc['model']=_['keys'](db[_0xe8dc('0x54')][_0xe8dc('0x4a')]);_0x4afdcc[_0xe8dc('0x2a')]=_[_0xe8dc('0x29')](_0x5a8e55[_0xe8dc('0x2a')]);_0x4afdcc['filters']=_[_0xe8dc('0x2b')](_0x4afdcc[_0xe8dc('0x28')],_0x4afdcc[_0xe8dc('0x2a')]);_0x508595[_0xe8dc('0x2d')]=_['intersection'](_0x4afdcc[_0xe8dc('0x28')],qs[_0xe8dc('0x2c')](_0x5a8e55['query']['fields']));_0x508595['attributes']=_0x508595['attributes']['length']?_0x508595[_0xe8dc('0x2d')]:_0x4afdcc['model'];if(!_0x5a8e55[_0xe8dc('0x2a')][_0xe8dc('0x55')]('nolimit')){_0x508595[_0xe8dc('0x19')]=qs[_0xe8dc('0x19')](_0x5a8e55[_0xe8dc('0x2a')]['limit']);_0x508595['offset']=qs[_0xe8dc('0x18')](_0x5a8e55[_0xe8dc('0x2a')][_0xe8dc('0x18')]);}_0x508595[_0xe8dc('0x2f')]=qs['sort'](_0x5a8e55[_0xe8dc('0x2a')]['sort']);_0x508595[_0xe8dc('0x34')]=qs[_0xe8dc('0x31')](_['pick'](_0x5a8e55[_0xe8dc('0x2a')],_0x4afdcc[_0xe8dc('0x31')]));_0x508595[_0xe8dc('0x34')]['ProjectId']=_0x42495a['id'];if(_0x5a8e55[_0xe8dc('0x2a')]['filter']){_0x508595['where']=_[_0xe8dc('0x35')](_0x508595[_0xe8dc('0x34')],{'$or':_[_0xe8dc('0x36')](_0x508595[_0xe8dc('0x2d')],function(_0x40198d){var _0xcd5c55={};_0xcd5c55[_0x40198d]={'$like':'%'+_0x5a8e55[_0xe8dc('0x2a')][_0xe8dc('0x33')]+'%'};return _0xcd5c55;})});}_0x508595=_[_0xe8dc('0x35')]({},_0x508595,_0x5a8e55['options']);return db[_0xe8dc('0x54')]['count']({'where':_0x508595['where']})[_0xe8dc('0x1f')](function(_0x4490bb){_0x2a2656['count']=_0x4490bb;if(_0x5a8e55[_0xe8dc('0x2a')][_0xe8dc('0x3a')]){_0x508595['include']=[{'all':!![]}];}return db[_0xe8dc('0x54')][_0xe8dc('0x3b')](_0x508595);})['then'](function(_0x42eb3c){_0x2a2656[_0xe8dc('0x3c')]=_0x42eb3c;return _0x2a2656;});}})[_0xe8dc('0x1f')](respondWithFilteredResult(_0x5935ed,_0x508595))['catch'](handleError(_0x5935ed,null));};function char(_0x421701){return'number'===typeof _0x421701?String[_0xe8dc('0x56')][_0xe8dc('0x1c')](null,arguments):_0x421701;}function needsEncapsulation(_0x3161e2){return!!_0x3161e2&&(_0x3161e2[_0xe8dc('0x57')]()['indexOf'](char(0xd))>=0x0||_0x3161e2[_0xe8dc('0x57')]()['indexOf'](char(0xa))>=0x0||_0x3161e2[_0xe8dc('0x57')]()['indexOf'](char(0x2c))>=0x0||_0x3161e2[_0xe8dc('0x57')]()[_0xe8dc('0x58')](char(0x22))>=0x0);}function encapsulate(_0x2f1971){var _0x505c62=char(0x22),_0x1d73db='\x5c'+char(0x22),_0x10e91f=_0x2f1971['toString']()[_0xe8dc('0x59')](new RegExp(_0x505c62,'g'),_0x1d73db);return _0x505c62+_0x10e91f+_0x505c62;}exports[_0xe8dc('0x5a')]=function(_0x58d173,_0x28fc02,_0x44fb90){var _0x426067,_0x2b3270;var _0x2e25cc={'where':{'ProjectId':_0x58d173['params']['id']}};if(_0x58d173['query'][_0xe8dc('0x5b')]){_0x2e25cc['where'][_0xe8dc('0x5c')]=JSON[_0xe8dc('0x5d')](_0x58d173[_0xe8dc('0x2a')][_0xe8dc('0x5b')]);}return db[_0xe8dc('0x50')]['findAll'](_0x2e25cc)[_0xe8dc('0x1f')](handleEntityNotFound(_0x28fc02,null))[_0xe8dc('0x1f')](function(_0x6960ae){if(_0x6960ae){_0x426067=_0x6960ae;return db[_0xe8dc('0x5e')]['findAll']({'where':{'SessionId':{'$in':_[_0xe8dc('0x36')](_0x426067,'id')},'ProjectId':_0x58d173['params']['id']},'order':_0xe8dc('0x5f')});}})[_0xe8dc('0x1f')](handleEntityNotFound(_0x28fc02,null))['then'](function(_0x3cfa93){if(_0x3cfa93){_0x2b3270=_0x3cfa93;var _0x307d36={};for(var _0x572993=0x0,_0x542c38=_0x2b3270['length'];_0x572993<_0x542c38;_0x572993++){if(!_0x307d36['hasOwnProperty'](_0x2b3270[_0x572993][_0xe8dc('0x60')])){_0x307d36[_0x2b3270[_0x572993]['questionId']]=needsEncapsulation(_0x2b3270[_0x572993]['question'])?encapsulate(_0x2b3270[_0x572993]['question']):_0x2b3270[_0x572993][_0xe8dc('0x61')];}}var _0x29aedc=[],_0x4a9a81={};for(var _0xffc844=0x0,_0x48def6=_0x426067['length'];_0xffc844<_0x48def6;_0xffc844++){_0x4a9a81={'ProjectId':_0x58d173[_0xe8dc('0x49')]['id'],'SessionId':_0x426067[_0xffc844]['id'],'StartTime':moment(_0x426067[_0xffc844][_0xe8dc('0x5c')])[_0xe8dc('0x62')](_0xe8dc('0x63'))};for(var _0x493364=0x0,_0x363816=_0x2b3270[_0xe8dc('0x2e')];_0x493364<_0x363816;_0x493364++){if(_0x2b3270[_0x493364]['SessionId']==_0x426067[_0xffc844]['id']&&_0x307d36[_0xe8dc('0x55')](_0x2b3270[_0x493364][_0xe8dc('0x60')])){_0x4a9a81[_0x307d36[_0x2b3270[_0x493364]['questionId']]]=_0x2b3270[_0x493364]['answer'];}}for(var _0x5d3520 in _0x307d36){if(!_0x4a9a81[_0xe8dc('0x55')](_0x307d36[_0x5d3520])){_0x4a9a81[_0x307d36[_0x5d3520]]=null;}}_0x29aedc[_0xe8dc('0x64')](_0x4a9a81);}return _0x29aedc;}})[_0xe8dc('0x1f')](function(_0x5521bd){if(!_[_0xe8dc('0x65')](_0x5521bd)){var _0x1f3647=toCsv(_0x5521bd);var _0x149953=Date[_0xe8dc('0x66')]();fs[_0xe8dc('0x67')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x58d173[_0xe8dc('0x49')]['id'],_0x149953),_0x1f3647);_0x28fc02[_0xe8dc('0x68')](_0xe8dc('0x69'),'attachment;\x20filename='+util[_0xe8dc('0x62')](_0xe8dc('0x6a'),_0x58d173['params']['id'],_0x149953));_0x28fc02[_0xe8dc('0x68')](_0xe8dc('0x6b'),_0xe8dc('0x6c'));return _0x28fc02[_0xe8dc('0x6d')](util[_0xe8dc('0x62')](_0xe8dc('0x6e'),_0x58d173[_0xe8dc('0x49')]['id'],_0x149953));}else{return _0x28fc02[_0xe8dc('0x14')](0xcc);}})[_0xe8dc('0x3d')](handleError(_0x28fc02,null));}; \ No newline at end of file +var _0x6ec6=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/utils','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','get','Projects','UserProfileResource','destroy','error','stack','name','send','index','JscriptyProject','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','type','key','VIRTUAL','field','merge','count','includeAll','findAll','rows','show','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','createdAt','updatedAt','body','UserProfileSection','userProfileId','autoAssociation','pick','ProjectId','JscriptySessionReport','include','getAnswers','findOne','JscriptyAnswerReport','number','toString','indexOf','replace','starttime','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download'];(function(_0x2b27ad,_0x3bb818){var _0x1c71d2=function(_0x2d5eb6){while(--_0x2d5eb6){_0x2b27ad['push'](_0x2b27ad['shift']());}};_0x1c71d2(++_0x3bb818);}(_0x6ec6,0xee));var _0x66ec=function(_0x82140,_0x3a9d87){_0x82140=_0x82140-0x0;var _0x2b15a6=_0x6ec6[_0x82140];return _0x2b15a6;};'use strict';var pdf=require(_0x66ec('0x0'));var emlformat=require(_0x66ec('0x1'));var rimraf=require(_0x66ec('0x2'));var zipdir=require(_0x66ec('0x3'));var jsonpatch=require(_0x66ec('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x66ec('0x5'));var Mustache=require(_0x66ec('0x6'));var util=require(_0x66ec('0x7'));var path=require(_0x66ec('0x8'));var sox=require(_0x66ec('0x9'));var csv=require(_0x66ec('0xa'));var ejs=require(_0x66ec('0xb'));var fs=require('fs');var _=require(_0x66ec('0xc'));var squel=require(_0x66ec('0xd'));var crypto=require(_0x66ec('0xe'));var jsforce=require(_0x66ec('0xf'));var deskjs=require(_0x66ec('0x10'));var toCsv=require(_0x66ec('0xa'));var querystring=require(_0x66ec('0x11'));var Papa=require('papaparse');var Redis=require(_0x66ec('0x12'));var authService=require(_0x66ec('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x66ec('0x14'))('api');var utils=require(_0x66ec('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1eab85,_0x15876a){_0x15876a=_0x15876a||0xcc;return function(_0x509a92){if(_0x509a92){return _0x1eab85[_0x66ec('0x16')](_0x15876a);}return _0x1eab85[_0x66ec('0x17')](_0x15876a)[_0x66ec('0x18')]();};}function respondWithResult(_0x71e395,_0x1a2eba){_0x1a2eba=_0x1a2eba||0xc8;return function(_0x2bb7d8){if(_0x2bb7d8){return _0x71e395[_0x66ec('0x17')](_0x1a2eba)[_0x66ec('0x19')](_0x2bb7d8);}};}function respondWithFilteredResult(_0x2da45a,_0x322609){return function(_0x21c098){if(_0x21c098){var _0x55fcb2=_0x21c098['count'],_0x1ea995=_0x322609[_0x66ec('0x1a')],_0x22f63e=_0x322609[_0x66ec('0x1a')]+_0x322609[_0x66ec('0x1b')],_0x8efa59;if(_0x22f63e>=_0x55fcb2){_0x22f63e=_0x55fcb2;_0x8efa59=0xc8;}else{_0x8efa59=0xce;}_0x2da45a['status'](_0x8efa59);return _0x2da45a[_0x66ec('0x1c')](_0x66ec('0x1d'),_0x1ea995+'-'+_0x22f63e+'/'+_0x55fcb2)[_0x66ec('0x19')](_0x21c098);}return null;};}function patchUpdates(_0x407cf7){return function(_0x1a1778){try{jsonpatch[_0x66ec('0x1e')](_0x1a1778,_0x407cf7,!![]);}catch(_0x17bce7){return BPromise[_0x66ec('0x1f')](_0x17bce7);}return _0x1a1778[_0x66ec('0x20')]();};}function saveUpdates(_0x15110f,_0x5a0264){return function(_0x2c87ac){if(_0x2c87ac){return _0x2c87ac[_0x66ec('0x21')](_0x15110f)['then'](function(_0x1d78d5){return _0x1d78d5;});}return null;};}function removeEntity(_0x526171,_0x32a605){return function(_0x178ec7){if(_0x178ec7){return _0x178ec7['destroy']()[_0x66ec('0x22')](function(){var _0x4f4969=_0x178ec7[_0x66ec('0x23')]({'plain':!![]});var _0x224737=_0x66ec('0x24');return db[_0x66ec('0x25')][_0x66ec('0x26')]({'where':{'type':_0x224737,'resourceId':_0x4f4969['id']}})[_0x66ec('0x22')](function(){return _0x178ec7;});})[_0x66ec('0x22')](function(){_0x526171[_0x66ec('0x17')](0xcc)[_0x66ec('0x18')]();});}};}function handleEntityNotFound(_0xa075f6,_0x2367ba){return function(_0xda59c0){if(!_0xda59c0){_0xa075f6[_0x66ec('0x16')](0x194);}return _0xda59c0;};}function handleError(_0x1f0657,_0x17faaf){_0x17faaf=_0x17faaf||0x1f4;return function(_0x2c5bf5){logger[_0x66ec('0x27')](_0x2c5bf5[_0x66ec('0x28')]);if(_0x2c5bf5[_0x66ec('0x29')]){delete _0x2c5bf5[_0x66ec('0x29')];}_0x1f0657[_0x66ec('0x17')](_0x17faaf)[_0x66ec('0x2a')](_0x2c5bf5);};}exports[_0x66ec('0x2b')]=function(_0x382131,_0x152bd5){var _0x26bf21={},_0x19d81b={},_0x23a312={'count':0x0,'rows':[]};var _0x50b55e=db[_0x66ec('0x2c')][_0x66ec('0x2d')];_0x19d81b[_0x66ec('0x2e')]=_[_0x66ec('0x2f')](_0x50b55e);_0x19d81b[_0x66ec('0x30')]=_[_0x66ec('0x2f')](_0x382131[_0x66ec('0x30')]);_0x19d81b[_0x66ec('0x31')]=_[_0x66ec('0x32')](_0x19d81b[_0x66ec('0x2e')],_0x19d81b[_0x66ec('0x30')]);_0x26bf21[_0x66ec('0x33')]=_['intersection'](_0x19d81b['model'],qs[_0x66ec('0x34')](_0x382131[_0x66ec('0x30')][_0x66ec('0x34')]));_0x26bf21[_0x66ec('0x33')]=_0x26bf21['attributes'][_0x66ec('0x35')]?_0x26bf21[_0x66ec('0x33')]:_0x19d81b[_0x66ec('0x2e')];if(!_0x382131[_0x66ec('0x30')][_0x66ec('0x36')](_0x66ec('0x37'))){_0x26bf21['limit']=qs['limit'](_0x382131[_0x66ec('0x30')]['limit']);_0x26bf21[_0x66ec('0x1a')]=qs[_0x66ec('0x1a')](_0x382131[_0x66ec('0x30')]['offset']);}_0x26bf21[_0x66ec('0x38')]=qs[_0x66ec('0x39')](_0x382131[_0x66ec('0x30')][_0x66ec('0x39')]);_0x26bf21[_0x66ec('0x3a')]=qs[_0x66ec('0x31')](_['pick'](_0x382131[_0x66ec('0x30')],_0x19d81b[_0x66ec('0x31')]));if(_0x382131[_0x66ec('0x30')][_0x66ec('0x3b')]){_0x26bf21[_0x66ec('0x3a')]=_['merge'](_0x26bf21['where'],{'$or':_[_0x66ec('0x3c')](_0x50b55e,function(_0x2c1f3a){if(_0x2c1f3a[_0x66ec('0x3d')][_0x66ec('0x3e')]!==_0x66ec('0x3f')){var _0x284348={};_0x284348[_0x2c1f3a[_0x66ec('0x40')]]={'$like':'%'+_0x382131['query'][_0x66ec('0x3b')]+'%'};return _0x284348;}})});}_0x26bf21=_[_0x66ec('0x41')]({},_0x26bf21,_0x382131['options']);var _0x456083={'where':_0x26bf21[_0x66ec('0x3a')]};return db[_0x66ec('0x2c')]['count'](_0x456083)['then'](function(_0x412c10){_0x23a312[_0x66ec('0x42')]=_0x412c10;if(_0x382131[_0x66ec('0x30')][_0x66ec('0x43')]){_0x26bf21['include']=[{'all':!![]}];}return db[_0x66ec('0x2c')][_0x66ec('0x44')](_0x26bf21);})[_0x66ec('0x22')](function(_0x51bf9c){_0x23a312[_0x66ec('0x45')]=_0x51bf9c;return _0x23a312;})[_0x66ec('0x22')](respondWithFilteredResult(_0x152bd5,_0x26bf21))['catch'](handleError(_0x152bd5,null));};exports[_0x66ec('0x46')]=function(_0x4735db,_0x1e391e){var _0x272284={'raw':![],'where':{'id':_0x4735db['params']['id']}},_0x5b401c={};_0x5b401c['model']=_[_0x66ec('0x2f')](db[_0x66ec('0x2c')][_0x66ec('0x2d')]);_0x5b401c[_0x66ec('0x30')]=_[_0x66ec('0x2f')](_0x4735db[_0x66ec('0x30')]);_0x5b401c[_0x66ec('0x31')]=_[_0x66ec('0x32')](_0x5b401c[_0x66ec('0x2e')],_0x5b401c[_0x66ec('0x30')]);_0x272284['attributes']=_['intersection'](_0x5b401c[_0x66ec('0x2e')],qs['fields'](_0x4735db[_0x66ec('0x30')][_0x66ec('0x34')]));_0x272284['attributes']=_0x272284[_0x66ec('0x33')][_0x66ec('0x35')]?_0x272284['attributes']:_0x5b401c[_0x66ec('0x2e')];if(_0x4735db[_0x66ec('0x30')]['includeAll']){_0x272284['include']=[{'all':!![]}];}_0x272284=_[_0x66ec('0x41')]({},_0x272284,_0x4735db[_0x66ec('0x47')]);return db[_0x66ec('0x2c')][_0x66ec('0x48')](_0x272284)[_0x66ec('0x22')](handleEntityNotFound(_0x1e391e,null))['then'](respondWithResult(_0x1e391e,null))[_0x66ec('0x49')](handleError(_0x1e391e,null));};exports[_0x66ec('0x4a')]=function(_0x11346a,_0x1ee291){return db[_0x66ec('0x2c')][_0x66ec('0x4a')](_0x11346a['body'],{})['then'](function(_0x5b996b){var _0x110141=_0x11346a[_0x66ec('0x4b')][_0x66ec('0x23')]({'plain':!![]});if(!_0x110141)throw new Error(_0x66ec('0x4c'));if(_0x110141[_0x66ec('0x4d')]===_0x66ec('0x4b')){var _0x5d3531=_0x5b996b[_0x66ec('0x23')]({'plain':!![]});var _0x1a2cf3=_0x66ec('0x24');return db['UserProfileSection'][_0x66ec('0x48')]({'where':{'name':_0x1a2cf3,'userProfileId':_0x110141['userProfileId']},'raw':!![]})[_0x66ec('0x22')](function(_0x460fcd){if(_0x460fcd&&_0x460fcd['autoAssociation']===0x0){return db['UserProfileResource'][_0x66ec('0x4a')]({'name':_0x5d3531[_0x66ec('0x29')],'resourceId':_0x5d3531['id'],'type':_0x460fcd['name'],'sectionId':_0x460fcd['id']},{})['then'](function(){return _0x5b996b;});}else{return _0x5b996b;}})['catch'](function(_0x3010fa){logger['error'](_0x66ec('0x4e'),_0x3010fa);throw _0x3010fa;});}return _0x5b996b;})[_0x66ec('0x22')](respondWithResult(_0x1ee291,0xc9))[_0x66ec('0x49')](handleError(_0x1ee291,null));};exports['clone']=function(_0xd2d810,_0xb56b77){var _0x4d795a={'raw':![],'where':{'id':_0xd2d810[_0x66ec('0x4f')]['id']}},_0x158fef={};_0x158fef['model']=_[_0x66ec('0x2f')](db['JscriptyProject']['rawAttributes']);_0x4d795a['attributes']=_[_0x66ec('0x32')](_0x158fef['model'],qs[_0x66ec('0x34')](_0xd2d810[_0x66ec('0x30')]['fields']));_0x4d795a[_0x66ec('0x33')]=_0x4d795a['attributes']['length']?_0x4d795a[_0x66ec('0x33')]:_0x158fef[_0x66ec('0x2e')];if(_0xd2d810[_0x66ec('0x30')][_0x66ec('0x43')]){_0x4d795a['include']=[{'all':!![]}];}_0x4d795a=_[_0x66ec('0x41')]({},_0x4d795a,_0xd2d810[_0x66ec('0x47')]);return db[_0x66ec('0x2c')][_0x66ec('0x48')](_0x4d795a)['then'](handleEntityNotFound(_0xb56b77,null))[_0x66ec('0x22')](function(_0x4ee7cd){if(_0x4ee7cd){var _0x35d32d=_0x4ee7cd['get']({'plain':!![]});_0x35d32d=qs[_0x66ec('0x50')](_0x35d32d,['id',_0x66ec('0x51'),_0x66ec('0x52')]);_0xd2d810[_0x66ec('0x53')]=_[_0x66ec('0x50')](_0xd2d810[_0x66ec('0x53')],['id',_0x66ec('0x51'),_0x66ec('0x52')]);return db[_0x66ec('0x2c')][_0x66ec('0x4a')](_[_0x66ec('0x41')](_0x35d32d,_0xd2d810[_0x66ec('0x53')]),{'include':_0xd2d810[_0x66ec('0x30')][_0x66ec('0x43')]?[{'all':!![]}]:undefined})[_0x66ec('0x22')](function(_0x34fdb0){var _0x1f81ee=_0xd2d810[_0x66ec('0x4b')][_0x66ec('0x23')]({'plain':!![]});if(!_0x1f81ee)throw new Error(_0x66ec('0x4c'));if(_0x1f81ee[_0x66ec('0x4d')]==='user'){var _0x4ab84c=_0x34fdb0[_0x66ec('0x23')]({'plain':!![]});var _0x366cc2=_0x66ec('0x24');return db[_0x66ec('0x54')]['find']({'where':{'name':_0x366cc2,'userProfileId':_0x1f81ee[_0x66ec('0x55')]},'raw':!![]})[_0x66ec('0x22')](function(_0x2bbc81){if(_0x2bbc81&&_0x2bbc81[_0x66ec('0x56')]===0x0){return db['UserProfileResource'][_0x66ec('0x4a')]({'name':_0x4ab84c[_0x66ec('0x29')],'resourceId':_0x4ab84c['id'],'type':_0x2bbc81[_0x66ec('0x29')],'sectionId':_0x2bbc81['id']},{})[_0x66ec('0x22')](function(){return _0x34fdb0;});}else{return _0x34fdb0;}})[_0x66ec('0x49')](function(_0x125848){logger[_0x66ec('0x27')](_0x66ec('0x4e'),_0x125848);throw _0x125848;});}return _0x34fdb0;});}})[_0x66ec('0x22')](respondWithResult(_0xb56b77,0xc9))[_0x66ec('0x49')](handleError(_0xb56b77,null));};exports[_0x66ec('0x21')]=function(_0x5ee6d6,_0x22a327){if(_0x5ee6d6[_0x66ec('0x53')]['id']){delete _0x5ee6d6['body']['id'];}return db[_0x66ec('0x2c')]['find']({'where':{'id':_0x5ee6d6['params']['id']}})[_0x66ec('0x22')](handleEntityNotFound(_0x22a327,null))[_0x66ec('0x22')](saveUpdates(_0x5ee6d6[_0x66ec('0x53')],null))[_0x66ec('0x22')](respondWithResult(_0x22a327,null))[_0x66ec('0x49')](handleError(_0x22a327,null));};exports[_0x66ec('0x26')]=function(_0x2e157c,_0x1f69d1){return db[_0x66ec('0x2c')][_0x66ec('0x48')]({'where':{'id':_0x2e157c[_0x66ec('0x4f')]['id']}})[_0x66ec('0x22')](handleEntityNotFound(_0x1f69d1,null))[_0x66ec('0x22')](removeEntity(_0x1f69d1,null))[_0x66ec('0x49')](handleError(_0x1f69d1,null));};exports['getSessions']=function(_0x36bb25,_0xd5ceee,_0x48fb6f){var _0x4b961c={'raw':!![],'where':{}};var _0x2b7ce5={};var _0x5de156={'count':0x0,'rows':[]};return db[_0x66ec('0x2c')]['findOne']({'where':{'id':_0x36bb25[_0x66ec('0x4f')]['id']}})['then'](handleEntityNotFound(_0xd5ceee,null))[_0x66ec('0x22')](function(_0x40fb52){if(_0x40fb52){_0x2b7ce5[_0x66ec('0x2e')]=_['keys'](db['JscriptySessionReport'][_0x66ec('0x2d')]);_0x2b7ce5[_0x66ec('0x30')]=_['keys'](_0x36bb25['query']);_0x2b7ce5['filters']=_[_0x66ec('0x32')](_0x2b7ce5['model'],_0x2b7ce5[_0x66ec('0x30')]);_0x4b961c[_0x66ec('0x33')]=_['intersection'](_0x2b7ce5['model'],qs[_0x66ec('0x34')](_0x36bb25[_0x66ec('0x30')][_0x66ec('0x34')]));_0x4b961c['attributes']=_0x4b961c[_0x66ec('0x33')]['length']?_0x4b961c['attributes']:_0x2b7ce5[_0x66ec('0x2e')];if(!_0x36bb25['query'][_0x66ec('0x36')]('nolimit')){_0x4b961c[_0x66ec('0x1b')]=qs[_0x66ec('0x1b')](_0x36bb25[_0x66ec('0x30')][_0x66ec('0x1b')]);_0x4b961c['offset']=qs[_0x66ec('0x1a')](_0x36bb25[_0x66ec('0x30')][_0x66ec('0x1a')]);}_0x4b961c[_0x66ec('0x38')]=qs[_0x66ec('0x39')](_0x36bb25['query']['sort']);_0x4b961c[_0x66ec('0x3a')]=qs[_0x66ec('0x31')](_[_0x66ec('0x57')](_0x36bb25[_0x66ec('0x30')],_0x2b7ce5['filters']));_0x4b961c[_0x66ec('0x3a')][_0x66ec('0x58')]=_0x40fb52['id'];if(_0x36bb25[_0x66ec('0x30')][_0x66ec('0x3b')]){_0x4b961c[_0x66ec('0x3a')]=_[_0x66ec('0x41')](_0x4b961c[_0x66ec('0x3a')],{'$or':_[_0x66ec('0x3c')](_0x4b961c[_0x66ec('0x33')],function(_0x2c25d7){var _0x3ad37a={};_0x3ad37a[_0x2c25d7]={'$like':'%'+_0x36bb25[_0x66ec('0x30')][_0x66ec('0x3b')]+'%'};return _0x3ad37a;})});}_0x4b961c=_[_0x66ec('0x41')]({},_0x4b961c,_0x36bb25[_0x66ec('0x47')]);return db[_0x66ec('0x59')][_0x66ec('0x42')]({'where':_0x4b961c['where']})[_0x66ec('0x22')](function(_0xe4e1b3){_0x5de156['count']=_0xe4e1b3;if(_0x36bb25[_0x66ec('0x30')]['includeAll']){_0x4b961c[_0x66ec('0x5a')]=[{'all':!![]}];}return db[_0x66ec('0x59')]['findAll'](_0x4b961c);})['then'](function(_0x531e5c){_0x5de156['rows']=_0x531e5c;return _0x5de156;});}})[_0x66ec('0x22')](respondWithFilteredResult(_0xd5ceee,_0x4b961c))['catch'](handleError(_0xd5ceee,null));};exports[_0x66ec('0x5b')]=function(_0x4fc880,_0x155378,_0x14c2ec){var _0x565ded={'raw':!![],'where':{}};var _0x54cf57={};var _0x1d7474={'count':0x0,'rows':[]};return db[_0x66ec('0x2c')][_0x66ec('0x5c')]({'where':{'id':_0x4fc880[_0x66ec('0x4f')]['id']}})['then'](handleEntityNotFound(_0x155378,null))['then'](function(_0x4444fd){if(_0x4444fd){_0x54cf57[_0x66ec('0x2e')]=_[_0x66ec('0x2f')](db['JscriptyAnswerReport']['rawAttributes']);_0x54cf57['query']=_[_0x66ec('0x2f')](_0x4fc880[_0x66ec('0x30')]);_0x54cf57[_0x66ec('0x31')]=_['intersection'](_0x54cf57[_0x66ec('0x2e')],_0x54cf57['query']);_0x565ded['attributes']=_[_0x66ec('0x32')](_0x54cf57['model'],qs['fields'](_0x4fc880[_0x66ec('0x30')][_0x66ec('0x34')]));_0x565ded['attributes']=_0x565ded['attributes'][_0x66ec('0x35')]?_0x565ded[_0x66ec('0x33')]:_0x54cf57[_0x66ec('0x2e')];if(!_0x4fc880[_0x66ec('0x30')][_0x66ec('0x36')](_0x66ec('0x37'))){_0x565ded[_0x66ec('0x1b')]=qs[_0x66ec('0x1b')](_0x4fc880[_0x66ec('0x30')][_0x66ec('0x1b')]);_0x565ded[_0x66ec('0x1a')]=qs[_0x66ec('0x1a')](_0x4fc880['query'][_0x66ec('0x1a')]);}_0x565ded[_0x66ec('0x38')]=qs[_0x66ec('0x39')](_0x4fc880[_0x66ec('0x30')][_0x66ec('0x39')]);_0x565ded['where']=qs[_0x66ec('0x31')](_[_0x66ec('0x57')](_0x4fc880[_0x66ec('0x30')],_0x54cf57[_0x66ec('0x31')]));_0x565ded['where']['ProjectId']=_0x4444fd['id'];if(_0x4fc880[_0x66ec('0x30')]['filter']){_0x565ded[_0x66ec('0x3a')]=_[_0x66ec('0x41')](_0x565ded['where'],{'$or':_[_0x66ec('0x3c')](_0x565ded[_0x66ec('0x33')],function(_0x46d8ee){var _0x196e12={};_0x196e12[_0x46d8ee]={'$like':'%'+_0x4fc880[_0x66ec('0x30')][_0x66ec('0x3b')]+'%'};return _0x196e12;})});}_0x565ded=_[_0x66ec('0x41')]({},_0x565ded,_0x4fc880['options']);return db[_0x66ec('0x5d')][_0x66ec('0x42')]({'where':_0x565ded[_0x66ec('0x3a')]})[_0x66ec('0x22')](function(_0x1233fa){_0x1d7474[_0x66ec('0x42')]=_0x1233fa;if(_0x4fc880['query'][_0x66ec('0x43')]){_0x565ded['include']=[{'all':!![]}];}return db[_0x66ec('0x5d')][_0x66ec('0x44')](_0x565ded);})[_0x66ec('0x22')](function(_0x379ad5){_0x1d7474[_0x66ec('0x45')]=_0x379ad5;return _0x1d7474;});}})[_0x66ec('0x22')](respondWithFilteredResult(_0x155378,_0x565ded))[_0x66ec('0x49')](handleError(_0x155378,null));};function char(_0x3ca565){return _0x66ec('0x5e')===typeof _0x3ca565?String['fromCharCode'][_0x66ec('0x1e')](null,arguments):_0x3ca565;}function needsEncapsulation(_0x584ee1){return!!_0x584ee1&&(_0x584ee1[_0x66ec('0x5f')]()[_0x66ec('0x60')](char(0xd))>=0x0||_0x584ee1[_0x66ec('0x5f')]()[_0x66ec('0x60')](char(0xa))>=0x0||_0x584ee1[_0x66ec('0x5f')]()[_0x66ec('0x60')](char(0x2c))>=0x0||_0x584ee1[_0x66ec('0x5f')]()[_0x66ec('0x60')](char(0x22))>=0x0);}function encapsulate(_0x41c384){var _0x41aaa9=char(0x22),_0x1f8889='\x5c'+char(0x22),_0x29d82d=_0x41c384[_0x66ec('0x5f')]()[_0x66ec('0x61')](new RegExp(_0x41aaa9,'g'),_0x1f8889);return _0x41aaa9+_0x29d82d+_0x41aaa9;}exports['getSummary']=function(_0x2ba795,_0x517b94,_0x5ed389){var _0x3c44da,_0x1501ee;var _0x4831b3={'where':{'ProjectId':_0x2ba795[_0x66ec('0x4f')]['id']}};if(_0x2ba795[_0x66ec('0x30')]['startTime']){_0x4831b3['where'][_0x66ec('0x62')]=JSON[_0x66ec('0x63')](_0x2ba795['query'][_0x66ec('0x64')]);}return db[_0x66ec('0x59')][_0x66ec('0x44')](_0x4831b3)[_0x66ec('0x22')](handleEntityNotFound(_0x517b94,null))[_0x66ec('0x22')](function(_0x34097c){if(_0x34097c){_0x3c44da=_0x34097c;return db[_0x66ec('0x65')][_0x66ec('0x44')]({'where':{'SessionId':{'$in':_[_0x66ec('0x3c')](_0x3c44da,'id')},'ProjectId':_0x2ba795[_0x66ec('0x4f')]['id']},'order':_0x66ec('0x66')});}})['then'](handleEntityNotFound(_0x517b94,null))[_0x66ec('0x22')](function(_0x42d832){if(_0x42d832){_0x1501ee=_0x42d832;var _0x4af8d7={};for(var _0x31c11d=0x0,_0x3ed7b4=_0x1501ee['length'];_0x31c11d<_0x3ed7b4;_0x31c11d++){if(!_0x4af8d7[_0x66ec('0x36')](_0x1501ee[_0x31c11d]['questionId'])){_0x4af8d7[_0x1501ee[_0x31c11d][_0x66ec('0x67')]]=needsEncapsulation(_0x1501ee[_0x31c11d][_0x66ec('0x68')])?encapsulate(_0x1501ee[_0x31c11d][_0x66ec('0x68')]):_0x1501ee[_0x31c11d][_0x66ec('0x68')];}}var _0x2f2c6e=[],_0x3a9700={};for(var _0x25b47d=0x0,_0x2dd28c=_0x3c44da[_0x66ec('0x35')];_0x25b47d<_0x2dd28c;_0x25b47d++){_0x3a9700={'ProjectId':_0x2ba795[_0x66ec('0x4f')]['id'],'SessionId':_0x3c44da[_0x25b47d]['id'],'StartTime':moment(_0x3c44da[_0x25b47d][_0x66ec('0x62')])[_0x66ec('0x69')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0xcbe295=0x0,_0x53dc57=_0x1501ee['length'];_0xcbe295<_0x53dc57;_0xcbe295++){if(_0x1501ee[_0xcbe295][_0x66ec('0x6a')]==_0x3c44da[_0x25b47d]['id']&&_0x4af8d7['hasOwnProperty'](_0x1501ee[_0xcbe295][_0x66ec('0x67')])){_0x3a9700[_0x4af8d7[_0x1501ee[_0xcbe295][_0x66ec('0x67')]]]=_0x1501ee[_0xcbe295][_0x66ec('0x6b')];}}for(var _0x41c1ee in _0x4af8d7){if(!_0x3a9700[_0x66ec('0x36')](_0x4af8d7[_0x41c1ee])){_0x3a9700[_0x4af8d7[_0x41c1ee]]=null;}}_0x2f2c6e[_0x66ec('0x6c')](_0x3a9700);}return _0x2f2c6e;}})[_0x66ec('0x22')](function(_0x1a3462){if(!_[_0x66ec('0x6d')](_0x1a3462)){var _0x2eaae1=toCsv(_0x1a3462);var _0x147ad8=Date[_0x66ec('0x6e')]();fs[_0x66ec('0x6f')](util[_0x66ec('0x69')](_0x66ec('0x70'),_0x2ba795[_0x66ec('0x4f')]['id'],_0x147ad8),_0x2eaae1);_0x517b94[_0x66ec('0x71')](_0x66ec('0x72'),'attachment;\x20filename='+util[_0x66ec('0x69')](_0x66ec('0x73'),_0x2ba795[_0x66ec('0x4f')]['id'],_0x147ad8));_0x517b94[_0x66ec('0x71')](_0x66ec('0x74'),_0x66ec('0x75'));return _0x517b94[_0x66ec('0x76')](util['format'](_0x66ec('0x70'),_0x2ba795['params']['id'],_0x147ad8));}else{return _0x517b94[_0x66ec('0x16')](0xcc);}})[_0x66ec('0x49')](handleError(_0x517b94,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 8b75e72..691df3d 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 _0x83b3=['JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x28b585,_0x2c649){var _0x1ff47d=function(_0xd746af){while(--_0xd746af){_0x28b585['push'](_0x28b585['shift']());}};_0x1ff47d(++_0x2c649);}(_0x83b3,0x147));var _0x383b=function(_0x2d7d5b,_0x574aff){_0x2d7d5b=_0x2d7d5b-0x0;var _0x4c6823=_0x83b3[_0x2d7d5b];return _0x4c6823;};'use strict';var _=require(_0x383b('0x0'));var util=require(_0x383b('0x1'));var logger=require(_0x383b('0x2'))(_0x383b('0x3'));var moment=require(_0x383b('0x4'));var BPromise=require(_0x383b('0x5'));var rp=require(_0x383b('0x6'));var fs=require('fs');var path=require(_0x383b('0x7'));var rimraf=require(_0x383b('0x8'));var config=require('../../config/environment');var attributes=require('./jscriptyProject.attributes');module[_0x383b('0x9')]=function(_0x2e09c9,_0x11e6c3){return _0x2e09c9[_0x383b('0xa')](_0x383b('0xb'),attributes,{'tableName':_0x383b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8caf=['moment','bluebird','request-promise','path','rimraf','JscriptyProject','jscripty_projects','lodash','util','api'];(function(_0x24b42f,_0x2b1e32){var _0x177edb=function(_0x4ee34a){while(--_0x4ee34a){_0x24b42f['push'](_0x24b42f['shift']());}};_0x177edb(++_0x2b1e32);}(_0x8caf,0x16f));var _0xf8ca=function(_0x16848e,_0x8effbf){_0x16848e=_0x16848e-0x0;var _0x1c459c=_0x8caf[_0x16848e];return _0x1c459c;};'use strict';var _=require(_0xf8ca('0x0'));var util=require(_0xf8ca('0x1'));var logger=require('../../config/logger')(_0xf8ca('0x2'));var moment=require(_0xf8ca('0x3'));var BPromise=require(_0xf8ca('0x4'));var rp=require(_0xf8ca('0x5'));var fs=require('fs');var path=require(_0xf8ca('0x6'));var rimraf=require(_0xf8ca('0x7'));var config=require('../../config/environment');var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x5808d5,_0x1ebd7e){return _0x5808d5['define'](_0xf8ca('0x8'),attributes,{'tableName':_0xf8ca('0x9'),'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 8d5656f..ea8bd06 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 _0x2632=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x10bfd7,_0x38dd2d){var _0x4a1015=function(_0x513232){while(--_0x513232){_0x10bfd7['push'](_0x10bfd7['shift']());}};_0x4a1015(++_0x38dd2d);}(_0x2632,0xea));var _0x2263=function(_0x5b51d9,_0x4e9360){_0x5b51d9=_0x5b51d9-0x0;var _0x1d6709=_0x2632[_0x5b51d9];return _0x1d6709;};'use strict';var _=require(_0x2263('0x0'));var util=require(_0x2263('0x1'));var moment=require('moment');var BPromise=require(_0x2263('0x2'));var rs=require(_0x2263('0x3'));var fs=require('fs');var Redis=require(_0x2263('0x4'));var db=require(_0x2263('0x5'))['db'];var utils=require(_0x2263('0x6'));var logger=require('../../config/logger')(_0x2263('0x7'));var config=require(_0x2263('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5de3df,_0x44eebb,_0x522b42){return new BPromise(function(_0x34cd54,_0x212e8e){return client[_0x2263('0x9')](_0x5de3df,_0x522b42)[_0x2263('0xa')](function(_0x1b7818){logger[_0x2263('0xb')](_0x2263('0xc'),_0x44eebb,_0x2263('0xd'));logger['debug'](_0x2263('0xe'),_0x44eebb,'request\x20sent',JSON[_0x2263('0xf')](_0x1b7818));if(_0x1b7818[_0x2263('0x10')]){if(_0x1b7818[_0x2263('0x10')][_0x2263('0x11')]===0x1f4){logger[_0x2263('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x44eebb,_0x1b7818['error'][_0x2263('0x12')]);return _0x212e8e(_0x1b7818['error'][_0x2263('0x12')]);}logger[_0x2263('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x44eebb,_0x1b7818['error'][_0x2263('0x12')]);return _0x34cd54(_0x1b7818[_0x2263('0x10')][_0x2263('0x12')]);}else{logger[_0x2263('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x44eebb,_0x2263('0xd'));_0x34cd54(_0x1b7818[_0x2263('0x13')]['message']);}})[_0x2263('0x14')](function(_0x5c66cb){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x44eebb,_0x5c66cb);_0x212e8e(_0x5c66cb);});});} \ No newline at end of file +var _0x7756=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','JscriptyProject,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xc492a3,_0x2b42ee){var _0x414593=function(_0x4489ad){while(--_0x4489ad){_0xc492a3['push'](_0xc492a3['shift']());}};_0x414593(++_0x2b42ee);}(_0x7756,0x131));var _0x6775=function(_0x2b1efc,_0x3043a4){_0x2b1efc=_0x2b1efc-0x0;var _0x5123e8=_0x7756[_0x2b1efc];return _0x5123e8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6775('0x0'));var BPromise=require(_0x6775('0x1'));var rs=require(_0x6775('0x2'));var fs=require('fs');var Redis=require(_0x6775('0x3'));var db=require(_0x6775('0x4'))['db'];var utils=require(_0x6775('0x5'));var logger=require(_0x6775('0x6'))(_0x6775('0x7'));var config=require(_0x6775('0x8'));var jayson=require(_0x6775('0x9'));var client=jayson[_0x6775('0xa')][_0x6775('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17a5d2,_0x3c53e0,_0x22cc26){return new BPromise(function(_0x426515,_0x5307e8){return client[_0x6775('0xc')](_0x17a5d2,_0x22cc26)[_0x6775('0xd')](function(_0x50c248){logger[_0x6775('0xe')]('JscriptyProject,\x20%s,\x20%s',_0x3c53e0,_0x6775('0xf'));logger[_0x6775('0x10')](_0x6775('0x11'),_0x3c53e0,_0x6775('0xf'),JSON[_0x6775('0x12')](_0x50c248));if(_0x50c248[_0x6775('0x13')]){if(_0x50c248[_0x6775('0x13')]['code']===0x1f4){logger[_0x6775('0x13')](_0x6775('0x14'),_0x3c53e0,_0x50c248[_0x6775('0x13')][_0x6775('0x15')]);return _0x5307e8(_0x50c248[_0x6775('0x13')][_0x6775('0x15')]);}logger[_0x6775('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x3c53e0,_0x50c248[_0x6775('0x13')]['message']);return _0x426515(_0x50c248[_0x6775('0x13')][_0x6775('0x15')]);}else{logger[_0x6775('0xe')](_0x6775('0x14'),_0x3c53e0,_0x6775('0xf'));_0x426515(_0x50c248[_0x6775('0x16')]['message']);}})[_0x6775('0x17')](function(_0x40c63f){logger[_0x6775('0x13')](_0x6775('0x14'),_0x3c53e0,_0x40c63f);_0x5307e8(_0x40c63f);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index c42faa6..d0b3816 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 _0x5204=['express','Router','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path'];(function(_0x21be37,_0x5146c4){var _0x3bff86=function(_0x4421a5){while(--_0x4421a5){_0x21be37['push'](_0x21be37['shift']());}};_0x3bff86(++_0x5146c4);}(_0x5204,0x1b6));var _0x4520=function(_0x102881,_0x58d723){_0x102881=_0x102881-0x0;var _0x5c63d0=_0x5204[_0x102881];return _0x5c63d0;};'use strict';var multer=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var path=require(_0x4520('0x2'));var timeout=require('connect-timeout');var express=require(_0x4520('0x3'));var router=express[_0x4520('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4520('0x5'));var config=require(_0x4520('0x6'));var controller=require(_0x4520('0x7'));router[_0x4520('0x8')]('/',auth['isAuthenticated'](),controller[_0x4520('0x9')]);router[_0x4520('0x8')](_0x4520('0xa'),auth[_0x4520('0xb')](),controller[_0x4520('0xc')]);router[_0x4520('0x8')](_0x4520('0xd'),auth['isAuthenticated'](),controller[_0x4520('0xe')]);router[_0x4520('0xf')]('/',auth[_0x4520('0xb')](),controller[_0x4520('0x10')]);router[_0x4520('0x11')]('/:id',auth[_0x4520('0xb')](),controller[_0x4520('0x12')]);router[_0x4520('0x13')]('/:id',auth[_0x4520('0xb')](),controller[_0x4520('0x14')]);module['exports']=router; \ No newline at end of file +var _0xbe2f=['express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xbe2f,0xb0));var _0xfbe2=function(_0x37cb87,_0x18c155){_0x37cb87=_0x37cb87-0x0;var _0x37c7ba=_0xbe2f[_0x37cb87];return _0x37c7ba;};'use strict';var multer=require(_0xfbe2('0x0'));var util=require(_0xfbe2('0x1'));var path=require(_0xfbe2('0x2'));var timeout=require(_0xfbe2('0x3'));var express=require(_0xfbe2('0x4'));var router=express[_0xfbe2('0x5')]();var auth=require(_0xfbe2('0x6'));var interaction=require(_0xfbe2('0x7'));var config=require('../../config/environment');var controller=require(_0xfbe2('0x8'));router[_0xfbe2('0x9')]('/',auth[_0xfbe2('0xa')](),controller['index']);router['get'](_0xfbe2('0xb'),auth['isAuthenticated'](),controller[_0xfbe2('0xc')]);router['get'](_0xfbe2('0xd'),auth['isAuthenticated'](),controller[_0xfbe2('0xe')]);router[_0xfbe2('0xf')]('/',auth[_0xfbe2('0xa')](),controller[_0xfbe2('0x10')]);router['put'](_0xfbe2('0xd'),auth[_0xfbe2('0xa')](),controller[_0xfbe2('0x11')]);router[_0xfbe2('0x12')](_0xfbe2('0xd'),auth['isAuthenticated'](),controller[_0xfbe2('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index ab59067..4bba555 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 _0xf9bc=['TEXT','long','exports','STRING'];(function(_0x36a699,_0x12c074){var _0x2a6346=function(_0x267acf){while(--_0x267acf){_0x36a699['push'](_0x36a699['shift']());}};_0x2a6346(++_0x12c074);}(_0xf9bc,0x7e));var _0xcf9b=function(_0x2c8528,_0x17aade){_0x2c8528=_0x2c8528-0x0;var _0x459053=_0xf9bc[_0x2c8528];return _0x459053;};'use strict';var Sequelize=require('sequelize');module[_0xcf9b('0x0')]={'question':{'type':Sequelize[_0xcf9b('0x1')]},'answer':{'type':Sequelize[_0xcf9b('0x2')](_0xcf9b('0x3'))},'membername':{'type':Sequelize[_0xcf9b('0x1')]},'projectname':{'type':Sequelize[_0xcf9b('0x1')]},'queue':{'type':Sequelize[_0xcf9b('0x1')]},'uniqueid':{'type':Sequelize[_0xcf9b('0x1')]},'calleridname':{'type':Sequelize[_0xcf9b('0x1')]},'calleridnum':{'type':Sequelize[_0xcf9b('0x1')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8868=['STRING','TEXT','long','sequelize','exports'];(function(_0x45c0da,_0x4f9492){var _0x51efff=function(_0x53b3b2){while(--_0x53b3b2){_0x45c0da['push'](_0x45c0da['shift']());}};_0x51efff(++_0x4f9492);}(_0x8868,0x1ca));var _0x8886=function(_0x23e320,_0x157a21){_0x23e320=_0x23e320-0x0;var _0x2bb53b=_0x8868[_0x23e320];return _0x2bb53b;};'use strict';var Sequelize=require(_0x8886('0x0'));module[_0x8886('0x1')]={'question':{'type':Sequelize[_0x8886('0x2')]},'answer':{'type':Sequelize[_0x8886('0x3')](_0x8886('0x4'))},'membername':{'type':Sequelize[_0x8886('0x2')]},'projectname':{'type':Sequelize[_0x8886('0x2')]},'queue':{'type':Sequelize[_0x8886('0x2')]},'uniqueid':{'type':Sequelize[_0x8886('0x2')]},'calleridname':{'type':Sequelize[_0x8886('0x2')]},'calleridnum':{'type':Sequelize[_0x8886('0x2')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index de8ebe7..4eb9b16 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 _0xc21c=['show','params','fields','length','create','body','find','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','error','stack','name','send','JscriptyQuestionReport','rawAttributes','model','keys','filters','intersection','attributes','query','hasOwnProperty','nolimit','sort','where','merge','map','type','VIRTUAL','field','filter','options','then','include','rows','catch'];(function(_0x5c920d,_0x4b12ca){var _0x35e4ad=function(_0x248052){while(--_0x248052){_0x5c920d['push'](_0x5c920d['shift']());}};_0x35e4ad(++_0x4b12ca);}(_0xc21c,0x166));var _0xcc21=function(_0x3cb377,_0x492635){_0x3cb377=_0x3cb377-0x0;var _0x741b4b=_0xc21c[_0x3cb377];return _0x741b4b;};'use strict';var pdf=require(_0xcc21('0x0'));var emlformat=require(_0xcc21('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xcc21('0x2'));var jsonpatch=require(_0xcc21('0x3'));var rp=require(_0xcc21('0x4'));var moment=require(_0xcc21('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xcc21('0x6'));var util=require(_0xcc21('0x7'));var path=require(_0xcc21('0x8'));var sox=require(_0xcc21('0x9'));var csv=require(_0xcc21('0xa'));var ejs=require(_0xcc21('0xb'));var fs=require('fs');var _=require(_0xcc21('0xc'));var squel=require('squel');var crypto=require(_0xcc21('0xd'));var jsforce=require(_0xcc21('0xe'));var deskjs=require(_0xcc21('0xf'));var toCsv=require(_0xcc21('0xa'));var querystring=require('querystring');var Papa=require(_0xcc21('0x10'));var Redis=require('ioredis');var authService=require(_0xcc21('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xcc21('0x12'));var logger=require(_0xcc21('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xcc21('0x14'));var db=require(_0xcc21('0x15'))['db'];function respondWithStatusCode(_0x4c103f,_0x314564){_0x314564=_0x314564||0xcc;return function(_0x5a9e2e){if(_0x5a9e2e){return _0x4c103f[_0xcc21('0x16')](_0x314564);}return _0x4c103f[_0xcc21('0x17')](_0x314564)[_0xcc21('0x18')]();};}function respondWithResult(_0x5aaf2b,_0x73243b){_0x73243b=_0x73243b||0xc8;return function(_0x4d183b){if(_0x4d183b){return _0x5aaf2b[_0xcc21('0x17')](_0x73243b)[_0xcc21('0x19')](_0x4d183b);}};}function respondWithFilteredResult(_0x2214b6,_0xa9e14d){return function(_0x6e9b5a){if(_0x6e9b5a){var _0x123438=_0x6e9b5a[_0xcc21('0x1a')],_0x160e8d=_0xa9e14d['offset'],_0x5b3cd2=_0xa9e14d[_0xcc21('0x1b')]+_0xa9e14d[_0xcc21('0x1c')],_0x4c999b;if(_0x5b3cd2>=_0x123438){_0x5b3cd2=_0x123438;_0x4c999b=0xc8;}else{_0x4c999b=0xce;}_0x2214b6[_0xcc21('0x17')](_0x4c999b);return _0x2214b6[_0xcc21('0x1d')](_0xcc21('0x1e'),_0x160e8d+'-'+_0x5b3cd2+'/'+_0x123438)['json'](_0x6e9b5a);}return null;};}function patchUpdates(_0x30f62e){return function(_0x2a3056){try{jsonpatch[_0xcc21('0x1f')](_0x2a3056,_0x30f62e,!![]);}catch(_0x309350){return BPromise['reject'](_0x309350);}return _0x2a3056[_0xcc21('0x20')]();};}function saveUpdates(_0xb96492,_0x399f99){return function(_0x36cf4e){if(_0x36cf4e){return _0x36cf4e[_0xcc21('0x21')](_0xb96492)['then'](function(_0x668f39){return _0x668f39;});}return null;};}function removeEntity(_0x34b021,_0x532290){return function(_0x5d8ce3){if(_0x5d8ce3){return _0x5d8ce3[_0xcc21('0x22')]()['then'](function(){_0x34b021[_0xcc21('0x17')](0xcc)[_0xcc21('0x18')]();});}};}function handleEntityNotFound(_0x38ec30,_0x44e857){return function(_0x438d6c){if(!_0x438d6c){_0x38ec30[_0xcc21('0x16')](0x194);}return _0x438d6c;};}function handleError(_0x4e16c9,_0x3965f4){_0x3965f4=_0x3965f4||0x1f4;return function(_0x4aae2d){logger[_0xcc21('0x23')](_0x4aae2d[_0xcc21('0x24')]);if(_0x4aae2d[_0xcc21('0x25')]){delete _0x4aae2d[_0xcc21('0x25')];}_0x4e16c9['status'](_0x3965f4)[_0xcc21('0x26')](_0x4aae2d);};}exports['index']=function(_0x6280ac,_0x1af008){var _0x2d525b={},_0x83b75b={},_0x7ff7d2={'count':0x0,'rows':[]};var _0x1f2539=db[_0xcc21('0x27')][_0xcc21('0x28')];_0x83b75b[_0xcc21('0x29')]=_[_0xcc21('0x2a')](_0x1f2539);_0x83b75b['query']=_[_0xcc21('0x2a')](_0x6280ac['query']);_0x83b75b[_0xcc21('0x2b')]=_[_0xcc21('0x2c')](_0x83b75b[_0xcc21('0x29')],_0x83b75b['query']);_0x2d525b[_0xcc21('0x2d')]=_['intersection'](_0x83b75b[_0xcc21('0x29')],qs['fields'](_0x6280ac['query']['fields']));_0x2d525b['attributes']=_0x2d525b[_0xcc21('0x2d')]['length']?_0x2d525b[_0xcc21('0x2d')]:_0x83b75b['model'];if(!_0x6280ac[_0xcc21('0x2e')][_0xcc21('0x2f')](_0xcc21('0x30'))){_0x2d525b['limit']=qs[_0xcc21('0x1c')](_0x6280ac[_0xcc21('0x2e')][_0xcc21('0x1c')]);_0x2d525b[_0xcc21('0x1b')]=qs['offset'](_0x6280ac['query'][_0xcc21('0x1b')]);}_0x2d525b['order']=qs[_0xcc21('0x31')](_0x6280ac[_0xcc21('0x2e')][_0xcc21('0x31')]);_0x2d525b['where']=qs[_0xcc21('0x2b')](_['pick'](_0x6280ac['query'],_0x83b75b[_0xcc21('0x2b')]));if(_0x6280ac[_0xcc21('0x2e')]['filter']){_0x2d525b[_0xcc21('0x32')]=_[_0xcc21('0x33')](_0x2d525b[_0xcc21('0x32')],{'$or':_[_0xcc21('0x34')](_0x1f2539,function(_0x233c66){if(_0x233c66[_0xcc21('0x35')]['key']!==_0xcc21('0x36')){var _0x25bb55={};_0x25bb55[_0x233c66[_0xcc21('0x37')]]={'$like':'%'+_0x6280ac[_0xcc21('0x2e')][_0xcc21('0x38')]+'%'};return _0x25bb55;}})});}_0x2d525b=_['merge']({},_0x2d525b,_0x6280ac[_0xcc21('0x39')]);var _0x472935={'where':_0x2d525b[_0xcc21('0x32')]};return db['JscriptyQuestionReport'][_0xcc21('0x1a')](_0x472935)[_0xcc21('0x3a')](function(_0x1c1a96){_0x7ff7d2[_0xcc21('0x1a')]=_0x1c1a96;if(_0x6280ac['query']['includeAll']){_0x2d525b[_0xcc21('0x3b')]=[{'all':!![]}];}return db[_0xcc21('0x27')]['findAll'](_0x2d525b);})[_0xcc21('0x3a')](function(_0x3a58af){_0x7ff7d2[_0xcc21('0x3c')]=_0x3a58af;return _0x7ff7d2;})[_0xcc21('0x3a')](respondWithFilteredResult(_0x1af008,_0x2d525b))[_0xcc21('0x3d')](handleError(_0x1af008,null));};exports[_0xcc21('0x3e')]=function(_0xd01693,_0x2031bf){var _0x4c9e0e={'raw':!![],'where':{'id':_0xd01693[_0xcc21('0x3f')]['id']}},_0x1cabe0={};_0x1cabe0[_0xcc21('0x29')]=_['keys'](db['JscriptyQuestionReport']['rawAttributes']);_0x1cabe0[_0xcc21('0x2e')]=_[_0xcc21('0x2a')](_0xd01693[_0xcc21('0x2e')]);_0x1cabe0[_0xcc21('0x2b')]=_[_0xcc21('0x2c')](_0x1cabe0['model'],_0x1cabe0[_0xcc21('0x2e')]);_0x4c9e0e[_0xcc21('0x2d')]=_[_0xcc21('0x2c')](_0x1cabe0[_0xcc21('0x29')],qs[_0xcc21('0x40')](_0xd01693[_0xcc21('0x2e')][_0xcc21('0x40')]));_0x4c9e0e[_0xcc21('0x2d')]=_0x4c9e0e[_0xcc21('0x2d')][_0xcc21('0x41')]?_0x4c9e0e[_0xcc21('0x2d')]:_0x1cabe0[_0xcc21('0x29')];if(_0xd01693['query']['includeAll']){_0x4c9e0e['include']=[{'all':!![]}];}_0x4c9e0e=_[_0xcc21('0x33')]({},_0x4c9e0e,_0xd01693[_0xcc21('0x39')]);return db[_0xcc21('0x27')]['find'](_0x4c9e0e)['then'](handleEntityNotFound(_0x2031bf,null))['then'](respondWithResult(_0x2031bf,null))[_0xcc21('0x3d')](handleError(_0x2031bf,null));};exports[_0xcc21('0x42')]=function(_0x462b15,_0x2a1bbc){return db[_0xcc21('0x27')][_0xcc21('0x42')](_0x462b15[_0xcc21('0x43')],{})['then'](respondWithResult(_0x2a1bbc,0xc9))['catch'](handleError(_0x2a1bbc,null));};exports[_0xcc21('0x21')]=function(_0x302d26,_0x416d96){if(_0x302d26['body']['id']){delete _0x302d26[_0xcc21('0x43')]['id'];}return db[_0xcc21('0x27')][_0xcc21('0x44')]({'where':{'id':_0x302d26[_0xcc21('0x3f')]['id']}})['then'](handleEntityNotFound(_0x416d96,null))[_0xcc21('0x3a')](saveUpdates(_0x302d26[_0xcc21('0x43')],null))[_0xcc21('0x3a')](respondWithResult(_0x416d96,null))[_0xcc21('0x3d')](handleError(_0x416d96,null));};exports[_0xcc21('0x22')]=function(_0x8e3e18,_0x241506){return db[_0xcc21('0x27')]['find']({'where':{'id':_0x8e3e18['params']['id']}})['then'](handleEntityNotFound(_0x241506,null))['then'](removeEntity(_0x241506,null))['catch'](handleError(_0x241506,null));};exports[_0xcc21('0x45')]=function(_0x3e42c7,_0x5a02f9){return db[_0xcc21('0x27')][_0xcc21('0x45')]()[_0xcc21('0x3a')](respondWithResult(_0x5a02f9,null))[_0xcc21('0x3d')](handleError(_0x5a02f9,null));}; \ No newline at end of file +var _0xe1d3=['set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','index','JscriptyQuestionReport','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','includeAll','rows','catch','show','params','rawAttributes','include','options','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit'];(function(_0x39fff0,_0x259d98){var _0x547163=function(_0x267edf){while(--_0x267edf){_0x39fff0['push'](_0x39fff0['shift']());}};_0x547163(++_0x259d98);}(_0xe1d3,0x159));var _0x3e1d=function(_0x4b9407,_0x359402){_0x4b9407=_0x4b9407-0x0;var _0x4347f7=_0xe1d3[_0x4b9407];return _0x4347f7;};'use strict';var pdf=require(_0x3e1d('0x0'));var emlformat=require(_0x3e1d('0x1'));var rimraf=require(_0x3e1d('0x2'));var zipdir=require(_0x3e1d('0x3'));var jsonpatch=require(_0x3e1d('0x4'));var rp=require('request-promise');var moment=require(_0x3e1d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3e1d('0x6'));var util=require(_0x3e1d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x3e1d('0x8'));var ejs=require(_0x3e1d('0x9'));var fs=require('fs');var _=require(_0x3e1d('0xa'));var squel=require(_0x3e1d('0xb'));var crypto=require(_0x3e1d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3e1d('0xd'));var toCsv=require(_0x3e1d('0x8'));var querystring=require('querystring');var Papa=require(_0x3e1d('0xe'));var Redis=require(_0x3e1d('0xf'));var authService=require(_0x3e1d('0x10'));var qs=require(_0x3e1d('0x11'));var hardwareService=require(_0x3e1d('0x12'));var logger=require(_0x3e1d('0x13'))(_0x3e1d('0x14'));var utils=require(_0x3e1d('0x15'));var config=require(_0x3e1d('0x16'));var db=require(_0x3e1d('0x17'))['db'];function respondWithStatusCode(_0x1ccdb2,_0x3bd2bb){_0x3bd2bb=_0x3bd2bb||0xcc;return function(_0x1b3608){if(_0x1b3608){return _0x1ccdb2[_0x3e1d('0x18')](_0x3bd2bb);}return _0x1ccdb2['status'](_0x3bd2bb)[_0x3e1d('0x19')]();};}function respondWithResult(_0x14b88f,_0x536c9f){_0x536c9f=_0x536c9f||0xc8;return function(_0x35dec5){if(_0x35dec5){return _0x14b88f[_0x3e1d('0x1a')](_0x536c9f)['json'](_0x35dec5);}};}function respondWithFilteredResult(_0x1b9a1f,_0xa58738){return function(_0x99c3fd){if(_0x99c3fd){var _0x2fb109=_0x99c3fd[_0x3e1d('0x1b')],_0x2c8b09=_0xa58738['offset'],_0x5a6513=_0xa58738[_0x3e1d('0x1c')]+_0xa58738[_0x3e1d('0x1d')],_0x26626c;if(_0x5a6513>=_0x2fb109){_0x5a6513=_0x2fb109;_0x26626c=0xc8;}else{_0x26626c=0xce;}_0x1b9a1f['status'](_0x26626c);return _0x1b9a1f[_0x3e1d('0x1e')](_0x3e1d('0x1f'),_0x2c8b09+'-'+_0x5a6513+'/'+_0x2fb109)[_0x3e1d('0x20')](_0x99c3fd);}return null;};}function patchUpdates(_0x201482){return function(_0x1064bd){try{jsonpatch[_0x3e1d('0x21')](_0x1064bd,_0x201482,!![]);}catch(_0x4bc1a4){return BPromise[_0x3e1d('0x22')](_0x4bc1a4);}return _0x1064bd[_0x3e1d('0x23')]();};}function saveUpdates(_0x53ee08,_0x135af0){return function(_0x17a64a){if(_0x17a64a){return _0x17a64a[_0x3e1d('0x24')](_0x53ee08)['then'](function(_0x22e8f0){return _0x22e8f0;});}return null;};}function removeEntity(_0x52cd49,_0x25a96e){return function(_0x2259ee){if(_0x2259ee){return _0x2259ee[_0x3e1d('0x25')]()[_0x3e1d('0x26')](function(){_0x52cd49[_0x3e1d('0x1a')](0xcc)[_0x3e1d('0x19')]();});}};}function handleEntityNotFound(_0x263231,_0x3f7b06){return function(_0x2f4abb){if(!_0x2f4abb){_0x263231['sendStatus'](0x194);}return _0x2f4abb;};}function handleError(_0x3d7e21,_0x3d9985){_0x3d9985=_0x3d9985||0x1f4;return function(_0x2afbdf){logger[_0x3e1d('0x27')](_0x2afbdf[_0x3e1d('0x28')]);if(_0x2afbdf[_0x3e1d('0x29')]){delete _0x2afbdf['name'];}_0x3d7e21['status'](_0x3d9985)['send'](_0x2afbdf);};}exports[_0x3e1d('0x2a')]=function(_0x8d01e2,_0x74a647){var _0x438bd4={},_0x49c9b3={},_0x13eb37={'count':0x0,'rows':[]};var _0xbc14b8=db[_0x3e1d('0x2b')]['rawAttributes'];_0x49c9b3['model']=_['keys'](_0xbc14b8);_0x49c9b3[_0x3e1d('0x2c')]=_[_0x3e1d('0x2d')](_0x8d01e2[_0x3e1d('0x2c')]);_0x49c9b3[_0x3e1d('0x2e')]=_['intersection'](_0x49c9b3[_0x3e1d('0x2f')],_0x49c9b3[_0x3e1d('0x2c')]);_0x438bd4[_0x3e1d('0x30')]=_[_0x3e1d('0x31')](_0x49c9b3['model'],qs[_0x3e1d('0x32')](_0x8d01e2['query'][_0x3e1d('0x32')]));_0x438bd4['attributes']=_0x438bd4['attributes'][_0x3e1d('0x33')]?_0x438bd4[_0x3e1d('0x30')]:_0x49c9b3[_0x3e1d('0x2f')];if(!_0x8d01e2[_0x3e1d('0x2c')][_0x3e1d('0x34')](_0x3e1d('0x35'))){_0x438bd4[_0x3e1d('0x1d')]=qs[_0x3e1d('0x1d')](_0x8d01e2['query'][_0x3e1d('0x1d')]);_0x438bd4['offset']=qs[_0x3e1d('0x1c')](_0x8d01e2[_0x3e1d('0x2c')][_0x3e1d('0x1c')]);}_0x438bd4[_0x3e1d('0x36')]=qs[_0x3e1d('0x37')](_0x8d01e2['query'][_0x3e1d('0x37')]);_0x438bd4[_0x3e1d('0x38')]=qs[_0x3e1d('0x2e')](_[_0x3e1d('0x39')](_0x8d01e2[_0x3e1d('0x2c')],_0x49c9b3[_0x3e1d('0x2e')]));if(_0x8d01e2['query'][_0x3e1d('0x3a')]){_0x438bd4[_0x3e1d('0x38')]=_[_0x3e1d('0x3b')](_0x438bd4[_0x3e1d('0x38')],{'$or':_[_0x3e1d('0x3c')](_0xbc14b8,function(_0x25d742){if(_0x25d742['type'][_0x3e1d('0x3d')]!==_0x3e1d('0x3e')){var _0x52b6bb={};_0x52b6bb[_0x25d742['field']]={'$like':'%'+_0x8d01e2['query'][_0x3e1d('0x3a')]+'%'};return _0x52b6bb;}})});}_0x438bd4=_[_0x3e1d('0x3b')]({},_0x438bd4,_0x8d01e2['options']);var _0x53c94d={'where':_0x438bd4['where']};return db['JscriptyQuestionReport']['count'](_0x53c94d)[_0x3e1d('0x26')](function(_0x192b63){_0x13eb37[_0x3e1d('0x1b')]=_0x192b63;if(_0x8d01e2[_0x3e1d('0x2c')][_0x3e1d('0x3f')]){_0x438bd4['include']=[{'all':!![]}];}return db[_0x3e1d('0x2b')]['findAll'](_0x438bd4);})[_0x3e1d('0x26')](function(_0x3eee32){_0x13eb37[_0x3e1d('0x40')]=_0x3eee32;return _0x13eb37;})[_0x3e1d('0x26')](respondWithFilteredResult(_0x74a647,_0x438bd4))[_0x3e1d('0x41')](handleError(_0x74a647,null));};exports[_0x3e1d('0x42')]=function(_0x228c25,_0x2ef218){var _0x257ec6={'raw':!![],'where':{'id':_0x228c25[_0x3e1d('0x43')]['id']}},_0x4081cc={};_0x4081cc[_0x3e1d('0x2f')]=_[_0x3e1d('0x2d')](db['JscriptyQuestionReport'][_0x3e1d('0x44')]);_0x4081cc[_0x3e1d('0x2c')]=_[_0x3e1d('0x2d')](_0x228c25[_0x3e1d('0x2c')]);_0x4081cc['filters']=_[_0x3e1d('0x31')](_0x4081cc[_0x3e1d('0x2f')],_0x4081cc['query']);_0x257ec6[_0x3e1d('0x30')]=_[_0x3e1d('0x31')](_0x4081cc[_0x3e1d('0x2f')],qs['fields'](_0x228c25[_0x3e1d('0x2c')]['fields']));_0x257ec6[_0x3e1d('0x30')]=_0x257ec6[_0x3e1d('0x30')][_0x3e1d('0x33')]?_0x257ec6['attributes']:_0x4081cc['model'];if(_0x228c25[_0x3e1d('0x2c')]['includeAll']){_0x257ec6[_0x3e1d('0x45')]=[{'all':!![]}];}_0x257ec6=_[_0x3e1d('0x3b')]({},_0x257ec6,_0x228c25[_0x3e1d('0x46')]);return db[_0x3e1d('0x2b')]['find'](_0x257ec6)['then'](handleEntityNotFound(_0x2ef218,null))[_0x3e1d('0x26')](respondWithResult(_0x2ef218,null))[_0x3e1d('0x41')](handleError(_0x2ef218,null));};exports[_0x3e1d('0x47')]=function(_0x1fe34b,_0x2f9481){return db['JscriptyQuestionReport'][_0x3e1d('0x47')](_0x1fe34b[_0x3e1d('0x48')],{})[_0x3e1d('0x26')](respondWithResult(_0x2f9481,0xc9))[_0x3e1d('0x41')](handleError(_0x2f9481,null));};exports['update']=function(_0x139c51,_0x24969d){if(_0x139c51['body']['id']){delete _0x139c51[_0x3e1d('0x48')]['id'];}return db[_0x3e1d('0x2b')]['find']({'where':{'id':_0x139c51[_0x3e1d('0x43')]['id']}})[_0x3e1d('0x26')](handleEntityNotFound(_0x24969d,null))[_0x3e1d('0x26')](saveUpdates(_0x139c51[_0x3e1d('0x48')],null))[_0x3e1d('0x26')](respondWithResult(_0x24969d,null))[_0x3e1d('0x41')](handleError(_0x24969d,null));};exports[_0x3e1d('0x25')]=function(_0x16a1a9,_0x1aed27){return db[_0x3e1d('0x2b')][_0x3e1d('0x49')]({'where':{'id':_0x16a1a9[_0x3e1d('0x43')]['id']}})[_0x3e1d('0x26')](handleEntityNotFound(_0x1aed27,null))['then'](removeEntity(_0x1aed27,null))['catch'](handleError(_0x1aed27,null));};exports[_0x3e1d('0x4a')]=function(_0x54cbdd,_0x420209){return db[_0x3e1d('0x2b')][_0x3e1d('0x4a')]()[_0x3e1d('0x26')](respondWithResult(_0x420209,null))[_0x3e1d('0x41')](handleError(_0x420209,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index c1ce61a..2c2ba9c 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 _0x1e84=['report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x1e84,0x1ae));var _0x41e8=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x1e84[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x41e8('0x0'));var util=require(_0x41e8('0x1'));var logger=require(_0x41e8('0x2'))(_0x41e8('0x3'));var moment=require(_0x41e8('0x4'));var BPromise=require(_0x41e8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x41e8('0x6'));var config=require(_0x41e8('0x7'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x41e8('0x8')]=function(_0x552df0,_0x4f3ce4){return _0x552df0[_0x41e8('0x9')]('JscriptyQuestionReport',attributes,{'tableName':_0x41e8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70cd=['moment','bluebird','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','define','report_jscripty_questions','lodash','util','../../config/logger','api'];(function(_0x3f3b8d,_0x5b71bb){var _0xcfb4cd=function(_0x1a668f){while(--_0x1a668f){_0x3f3b8d['push'](_0x3f3b8d['shift']());}};_0xcfb4cd(++_0x5b71bb);}(_0x70cd,0x1f4));var _0xd70c=function(_0x27a5bb,_0x3f4cfb){_0x27a5bb=_0x27a5bb-0x0;var _0x2e17ea=_0x70cd[_0x27a5bb];return _0x2e17ea;};'use strict';var _=require(_0xd70c('0x0'));var util=require(_0xd70c('0x1'));var logger=require(_0xd70c('0x2'))(_0xd70c('0x3'));var moment=require(_0xd70c('0x4'));var BPromise=require(_0xd70c('0x5'));var rp=require(_0xd70c('0x6'));var fs=require('fs');var path=require(_0xd70c('0x7'));var rimraf=require('rimraf');var config=require(_0xd70c('0x8'));var attributes=require(_0xd70c('0x9'));module['exports']=function(_0x4f689b,_0x26002b){return _0x4f689b[_0xd70c('0xa')]('JscriptyQuestionReport',attributes,{'tableName':_0xd70c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index d60b364..c1a7e39 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 _0x4c7f=['JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3e0c17,_0x1fc5de){var _0x3fafec=function(_0x553774){while(--_0x553774){_0x3e0c17['push'](_0x3e0c17['shift']());}};_0x3fafec(++_0x1fc5de);}(_0x4c7f,0x166));var _0xf4c7=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x4c7f[_0x15c421];return _0x5e5ed5;};'use strict';var _=require(_0xf4c7('0x0'));var util=require('util');var moment=require(_0xf4c7('0x1'));var BPromise=require('bluebird');var rs=require(_0xf4c7('0x2'));var fs=require('fs');var Redis=require(_0xf4c7('0x3'));var db=require(_0xf4c7('0x4'))['db'];var utils=require(_0xf4c7('0x5'));var logger=require(_0xf4c7('0x6'))(_0xf4c7('0x7'));var config=require(_0xf4c7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf4c7('0x9')][_0xf4c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40b301,_0x2f8dab,_0x2fe9e5){return new BPromise(function(_0x52d9ef,_0x12db6d){return client['request'](_0x40b301,_0x2fe9e5)[_0xf4c7('0xb')](function(_0x37df0f){logger[_0xf4c7('0xc')](_0xf4c7('0xd'),_0x2f8dab,_0xf4c7('0xe'));logger[_0xf4c7('0xf')](_0xf4c7('0x10'),_0x2f8dab,_0xf4c7('0xe'),JSON[_0xf4c7('0x11')](_0x37df0f));if(_0x37df0f[_0xf4c7('0x12')]){if(_0x37df0f[_0xf4c7('0x12')][_0xf4c7('0x13')]===0x1f4){logger[_0xf4c7('0x12')](_0xf4c7('0xd'),_0x2f8dab,_0x37df0f[_0xf4c7('0x12')][_0xf4c7('0x14')]);return _0x12db6d(_0x37df0f[_0xf4c7('0x12')][_0xf4c7('0x14')]);}logger[_0xf4c7('0x12')](_0xf4c7('0xd'),_0x2f8dab,_0x37df0f[_0xf4c7('0x12')][_0xf4c7('0x14')]);return _0x52d9ef(_0x37df0f[_0xf4c7('0x12')][_0xf4c7('0x14')]);}else{logger['info'](_0xf4c7('0xd'),_0x2f8dab,'request\x20sent');_0x52d9ef(_0x37df0f['result'][_0xf4c7('0x14')]);}})[_0xf4c7('0x15')](function(_0x2aad97){logger[_0xf4c7('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2f8dab,_0x2aad97);_0x12db6d(_0x2aad97);});});} \ No newline at end of file +var _0xa624=['JscriptyQuestionReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code'];(function(_0x34b795,_0x85e89d){var _0x1ed92d=function(_0x234835){while(--_0x234835){_0x34b795['push'](_0x34b795['shift']());}};_0x1ed92d(++_0x85e89d);}(_0xa624,0xbb));var _0x4a62=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xa624[_0x1caf6a];return _0x1bf493;};'use strict';var _=require('lodash');var util=require(_0x4a62('0x0'));var moment=require(_0x4a62('0x1'));var BPromise=require(_0x4a62('0x2'));var rs=require(_0x4a62('0x3'));var fs=require('fs');var Redis=require(_0x4a62('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4a62('0x5'));var logger=require(_0x4a62('0x6'))(_0x4a62('0x7'));var config=require(_0x4a62('0x8'));var jayson=require(_0x4a62('0x9'));var client=jayson[_0x4a62('0xa')][_0x4a62('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36c1d0,_0x2422b8,_0x281d1f){return new BPromise(function(_0x32b754,_0xccab2b){return client[_0x4a62('0xc')](_0x36c1d0,_0x281d1f)[_0x4a62('0xd')](function(_0x36371e){logger[_0x4a62('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2422b8,'request\x20sent');logger[_0x4a62('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x2422b8,_0x4a62('0x10'),JSON[_0x4a62('0x11')](_0x36371e));if(_0x36371e[_0x4a62('0x12')]){if(_0x36371e[_0x4a62('0x12')][_0x4a62('0x13')]===0x1f4){logger[_0x4a62('0x12')](_0x4a62('0x14'),_0x2422b8,_0x36371e['error'][_0x4a62('0x15')]);return _0xccab2b(_0x36371e[_0x4a62('0x12')][_0x4a62('0x15')]);}logger[_0x4a62('0x12')](_0x4a62('0x14'),_0x2422b8,_0x36371e['error'][_0x4a62('0x15')]);return _0x32b754(_0x36371e[_0x4a62('0x12')][_0x4a62('0x15')]);}else{logger[_0x4a62('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2422b8,_0x4a62('0x10'));_0x32b754(_0x36371e['result'][_0x4a62('0x15')]);}})[_0x4a62('0x16')](function(_0x1155ce){logger['error'](_0x4a62('0x14'),_0x2422b8,_0x1155ce);_0xccab2b(_0x1155ce);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index a6ee410..e03faa1 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 _0x4506=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','post','put','delete','destroy','exports'];(function(_0x43c566,_0x5a450e){var _0x949b2=function(_0x532677){while(--_0x532677){_0x43c566['push'](_0x43c566['shift']());}};_0x949b2(++_0x5a450e);}(_0x4506,0x108));var _0x6450=function(_0x36f32c,_0x1109c4){_0x36f32c=_0x36f32c-0x0;var _0x3a28dc=_0x4506[_0x36f32c];return _0x3a28dc;};'use strict';var multer=require(_0x6450('0x0'));var util=require(_0x6450('0x1'));var path=require('path');var timeout=require(_0x6450('0x2'));var express=require(_0x6450('0x3'));var router=express[_0x6450('0x4')]();var auth=require(_0x6450('0x5'));var interaction=require(_0x6450('0x6'));var config=require(_0x6450('0x7'));var controller=require(_0x6450('0x8'));router[_0x6450('0x9')]('/',auth[_0x6450('0xa')](),controller[_0x6450('0xb')]);router[_0x6450('0x9')](_0x6450('0xc'),auth['isAuthenticated'](),controller[_0x6450('0xd')]);router[_0x6450('0x9')](_0x6450('0xe'),auth[_0x6450('0xa')](),controller[_0x6450('0xf')]);router[_0x6450('0x9')](_0x6450('0x10'),auth[_0x6450('0xa')](),controller['getQuestions']);router[_0x6450('0x11')]('/',auth[_0x6450('0xa')](),controller['create']);router[_0x6450('0x12')](_0x6450('0xe'),auth[_0x6450('0xa')](),controller['update']);router[_0x6450('0x13')](_0x6450('0xe'),auth['isAuthenticated'](),controller[_0x6450('0x14')]);module[_0x6450('0x15')]=router; \ No newline at end of file +var _0xed71=['put','update','delete','multer','util','express','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','index','describe','/:id','show','/:id/questions','getQuestions','post','create'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0xed71,0x192));var _0x1ed7=function(_0x32056c,_0x1b6db7){_0x32056c=_0x32056c-0x0;var _0x317313=_0xed71[_0x32056c];return _0x317313;};'use strict';var multer=require(_0x1ed7('0x0'));var util=require(_0x1ed7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1ed7('0x2'));var router=express['Router']();var auth=require(_0x1ed7('0x3'));var interaction=require(_0x1ed7('0x4'));var config=require('../../config/environment');var controller=require(_0x1ed7('0x5'));router[_0x1ed7('0x6')]('/',auth[_0x1ed7('0x7')](),controller[_0x1ed7('0x8')]);router[_0x1ed7('0x6')]('/describe',auth[_0x1ed7('0x7')](),controller[_0x1ed7('0x9')]);router[_0x1ed7('0x6')](_0x1ed7('0xa'),auth[_0x1ed7('0x7')](),controller[_0x1ed7('0xb')]);router[_0x1ed7('0x6')](_0x1ed7('0xc'),auth[_0x1ed7('0x7')](),controller[_0x1ed7('0xd')]);router[_0x1ed7('0xe')]('/',auth[_0x1ed7('0x7')](),controller[_0x1ed7('0xf')]);router[_0x1ed7('0x10')](_0x1ed7('0xa'),auth[_0x1ed7('0x7')](),controller[_0x1ed7('0x11')]);router[_0x1ed7('0x12')](_0x1ed7('0xa'),auth[_0x1ed7('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 735c182..dec530b 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 _0x8882=['BOOLEAN','moment','sequelize','exports','DATE','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x8882,0x169));var _0x2888=function(_0x288598,_0x5cd1af){_0x288598=_0x288598-0x0;var _0xe040b3=_0x8882[_0x288598];return _0xe040b3;};'use strict';var moment=require(_0x2888('0x0'));var Sequelize=require(_0x2888('0x1'));module[_0x2888('0x2')]={'starttime':{'type':Sequelize[_0x2888('0x3')],'set':function(_0x57ac66){this[_0x2888('0x4')]('starttime',_0x57ac66);this[_0x2888('0x4')](_0x2888('0x5'),moment()[_0x2888('0x6')](_0x2888('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x2888('0x8')]},'projectname':{'type':Sequelize[_0x2888('0x8')]},'queue':{'type':Sequelize[_0x2888('0x8')]},'uniqueid':{'type':Sequelize[_0x2888('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x2888('0x8')]},'completed':{'type':Sequelize[_0x2888('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0x0849=['STRING','BOOLEAN','moment','sequelize','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x0849,0xca));var _0x9084=function(_0x1a8d28,_0x273169){_0x1a8d28=_0x1a8d28-0x0;var _0x1ceee2=_0x0849[_0x1a8d28];return _0x1ceee2;};'use strict';var moment=require(_0x9084('0x0'));var Sequelize=require(_0x9084('0x1'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x25a1a3){this[_0x9084('0x2')]('starttime',_0x25a1a3);this[_0x9084('0x2')](_0x9084('0x3'),moment()[_0x9084('0x4')](_0x9084('0x5')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x9084('0x6')]},'projectname':{'type':Sequelize[_0x9084('0x6')]},'queue':{'type':Sequelize[_0x9084('0x6')]},'uniqueid':{'type':Sequelize[_0x9084('0x6')]},'calleridname':{'type':Sequelize[_0x9084('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x9084('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 4fb0df3..f887075 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 _0x57b7=['merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','filters','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','SessionId','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','send','index','JscriptySessionReport','rawAttributes','keys','query','attributes','intersection','model','fields','length','hasOwnProperty','offset','sort','pick','filter','where'];(function(_0x754022,_0x127de0){var _0x3ba7ce=function(_0xd913ea){while(--_0xd913ea){_0x754022['push'](_0x754022['shift']());}};_0x3ba7ce(++_0x127de0);}(_0x57b7,0x160));var _0x757b=function(_0x1639c4,_0x214adb){_0x1639c4=_0x1639c4-0x0;var _0x2f191a=_0x57b7[_0x1639c4];return _0x2f191a;};'use strict';var pdf=require(_0x757b('0x0'));var emlformat=require(_0x757b('0x1'));var rimraf=require(_0x757b('0x2'));var zipdir=require(_0x757b('0x3'));var jsonpatch=require(_0x757b('0x4'));var rp=require(_0x757b('0x5'));var moment=require(_0x757b('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x757b('0x7'));var util=require(_0x757b('0x8'));var path=require(_0x757b('0x9'));var sox=require(_0x757b('0xa'));var csv=require('to-csv');var ejs=require(_0x757b('0xb'));var fs=require('fs');var _=require(_0x757b('0xc'));var squel=require(_0x757b('0xd'));var crypto=require(_0x757b('0xe'));var jsforce=require(_0x757b('0xf'));var deskjs=require(_0x757b('0x10'));var toCsv=require(_0x757b('0x11'));var querystring=require(_0x757b('0x12'));var Papa=require('papaparse');var Redis=require(_0x757b('0x13'));var authService=require(_0x757b('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x757b('0x15'));var logger=require('../../config/logger')(_0x757b('0x16'));var utils=require('../../config/utils');var config=require(_0x757b('0x17'));var db=require(_0x757b('0x18'))['db'];function respondWithStatusCode(_0x5429e4,_0x2af9cb){_0x2af9cb=_0x2af9cb||0xcc;return function(_0xf94550){if(_0xf94550){return _0x5429e4['sendStatus'](_0x2af9cb);}return _0x5429e4[_0x757b('0x19')](_0x2af9cb)['end']();};}function respondWithResult(_0x1dc490,_0x282354){_0x282354=_0x282354||0xc8;return function(_0x55438b){if(_0x55438b){return _0x1dc490[_0x757b('0x19')](_0x282354)['json'](_0x55438b);}};}function respondWithFilteredResult(_0x274538,_0x10abf4){return function(_0x1a4c30){if(_0x1a4c30){var _0x47e990=_0x1a4c30[_0x757b('0x1a')],_0x1336e0=_0x10abf4['offset'],_0x585943=_0x10abf4['offset']+_0x10abf4[_0x757b('0x1b')],_0x5c338e;if(_0x585943>=_0x47e990){_0x585943=_0x47e990;_0x5c338e=0xc8;}else{_0x5c338e=0xce;}_0x274538['status'](_0x5c338e);return _0x274538[_0x757b('0x1c')](_0x757b('0x1d'),_0x1336e0+'-'+_0x585943+'/'+_0x47e990)[_0x757b('0x1e')](_0x1a4c30);}return null;};}function patchUpdates(_0x5eaa15){return function(_0x5c86f8){try{jsonpatch[_0x757b('0x1f')](_0x5c86f8,_0x5eaa15,!![]);}catch(_0xe6cfdc){return BPromise[_0x757b('0x20')](_0xe6cfdc);}return _0x5c86f8[_0x757b('0x21')]();};}function saveUpdates(_0xda81d9,_0x9f4476){return function(_0x4680e9){if(_0x4680e9){return _0x4680e9[_0x757b('0x22')](_0xda81d9)[_0x757b('0x23')](function(_0x9ed122){return _0x9ed122;});}return null;};}function removeEntity(_0x5ee3f8,_0x6d680){return function(_0x3a7c32){if(_0x3a7c32){return _0x3a7c32[_0x757b('0x24')]()[_0x757b('0x23')](function(){_0x5ee3f8[_0x757b('0x19')](0xcc)[_0x757b('0x25')]();});}};}function handleEntityNotFound(_0x4d50cc,_0x200891){return function(_0x4f7d6a){if(!_0x4f7d6a){_0x4d50cc[_0x757b('0x26')](0x194);}return _0x4f7d6a;};}function handleError(_0x1cda09,_0x2985ca){_0x2985ca=_0x2985ca||0x1f4;return function(_0x110063){logger[_0x757b('0x27')](_0x110063[_0x757b('0x28')]);if(_0x110063['name']){delete _0x110063['name'];}_0x1cda09['status'](_0x2985ca)[_0x757b('0x29')](_0x110063);};}exports[_0x757b('0x2a')]=function(_0x13c242,_0x583dde){var _0x29be76={},_0x108022={},_0x1ef05b={'count':0x0,'rows':[]};var _0x1f9312=db[_0x757b('0x2b')][_0x757b('0x2c')];_0x108022['model']=_[_0x757b('0x2d')](_0x1f9312);_0x108022[_0x757b('0x2e')]=_[_0x757b('0x2d')](_0x13c242[_0x757b('0x2e')]);_0x108022['filters']=_['intersection'](_0x108022['model'],_0x108022[_0x757b('0x2e')]);_0x29be76[_0x757b('0x2f')]=_[_0x757b('0x30')](_0x108022[_0x757b('0x31')],qs[_0x757b('0x32')](_0x13c242[_0x757b('0x2e')][_0x757b('0x32')]));_0x29be76[_0x757b('0x2f')]=_0x29be76[_0x757b('0x2f')][_0x757b('0x33')]?_0x29be76[_0x757b('0x2f')]:_0x108022[_0x757b('0x31')];if(!_0x13c242[_0x757b('0x2e')][_0x757b('0x34')]('nolimit')){_0x29be76['limit']=qs[_0x757b('0x1b')](_0x13c242[_0x757b('0x2e')][_0x757b('0x1b')]);_0x29be76[_0x757b('0x35')]=qs[_0x757b('0x35')](_0x13c242[_0x757b('0x2e')]['offset']);}_0x29be76['order']=qs[_0x757b('0x36')](_0x13c242[_0x757b('0x2e')][_0x757b('0x36')]);_0x29be76['where']=qs['filters'](_[_0x757b('0x37')](_0x13c242[_0x757b('0x2e')],_0x108022['filters']));if(_0x13c242[_0x757b('0x2e')][_0x757b('0x38')]){_0x29be76[_0x757b('0x39')]=_[_0x757b('0x3a')](_0x29be76[_0x757b('0x39')],{'$or':_[_0x757b('0x3b')](_0x1f9312,function(_0x13fa8c){if(_0x13fa8c[_0x757b('0x3c')][_0x757b('0x3d')]!==_0x757b('0x3e')){var _0x34f447={};_0x34f447[_0x13fa8c[_0x757b('0x3f')]]={'$like':'%'+_0x13c242[_0x757b('0x2e')][_0x757b('0x38')]+'%'};return _0x34f447;}})});}_0x29be76=_['merge']({},_0x29be76,_0x13c242[_0x757b('0x40')]);var _0x56f89e={'where':_0x29be76['where']};return db[_0x757b('0x2b')][_0x757b('0x1a')](_0x56f89e)[_0x757b('0x23')](function(_0x5bc32b){_0x1ef05b[_0x757b('0x1a')]=_0x5bc32b;if(_0x13c242[_0x757b('0x2e')][_0x757b('0x41')]){_0x29be76[_0x757b('0x42')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x757b('0x43')](_0x29be76);})[_0x757b('0x23')](function(_0x59ffed){_0x1ef05b[_0x757b('0x44')]=_0x59ffed;return _0x1ef05b;})[_0x757b('0x23')](respondWithFilteredResult(_0x583dde,_0x29be76))[_0x757b('0x45')](handleError(_0x583dde,null));};exports[_0x757b('0x46')]=function(_0x489a8a,_0x295ade){var _0x37bff3={'raw':!![],'where':{'id':_0x489a8a[_0x757b('0x47')]['id']}},_0x32747e={};_0x32747e[_0x757b('0x31')]=_[_0x757b('0x2d')](db[_0x757b('0x2b')][_0x757b('0x2c')]);_0x32747e[_0x757b('0x2e')]=_[_0x757b('0x2d')](_0x489a8a[_0x757b('0x2e')]);_0x32747e[_0x757b('0x48')]=_['intersection'](_0x32747e[_0x757b('0x31')],_0x32747e['query']);_0x37bff3[_0x757b('0x2f')]=_[_0x757b('0x30')](_0x32747e['model'],qs['fields'](_0x489a8a[_0x757b('0x2e')][_0x757b('0x32')]));_0x37bff3[_0x757b('0x2f')]=_0x37bff3[_0x757b('0x2f')]['length']?_0x37bff3[_0x757b('0x2f')]:_0x32747e['model'];if(_0x489a8a[_0x757b('0x2e')][_0x757b('0x41')]){_0x37bff3[_0x757b('0x42')]=[{'all':!![]}];}_0x37bff3=_[_0x757b('0x3a')]({},_0x37bff3,_0x489a8a['options']);return db[_0x757b('0x2b')][_0x757b('0x49')](_0x37bff3)['then'](handleEntityNotFound(_0x295ade,null))[_0x757b('0x23')](respondWithResult(_0x295ade,null))['catch'](handleError(_0x295ade,null));};exports[_0x757b('0x4a')]=function(_0x141fb2,_0x4a9b81){return db[_0x757b('0x2b')][_0x757b('0x4a')](_0x141fb2[_0x757b('0x4b')],{})['then'](respondWithResult(_0x4a9b81,0xc9))[_0x757b('0x45')](handleError(_0x4a9b81,null));};exports[_0x757b('0x22')]=function(_0x518363,_0x5859c0){if(_0x518363[_0x757b('0x4b')]['id']){delete _0x518363['body']['id'];}return db['JscriptySessionReport'][_0x757b('0x49')]({'where':{'id':_0x518363[_0x757b('0x47')]['id']}})[_0x757b('0x23')](handleEntityNotFound(_0x5859c0,null))[_0x757b('0x23')](saveUpdates(_0x518363['body'],null))[_0x757b('0x23')](respondWithResult(_0x5859c0,null))[_0x757b('0x45')](handleError(_0x5859c0,null));};exports[_0x757b('0x24')]=function(_0x3ad7c2,_0x24b930){return db[_0x757b('0x2b')][_0x757b('0x49')]({'where':{'id':_0x3ad7c2[_0x757b('0x47')]['id']}})[_0x757b('0x23')](handleEntityNotFound(_0x24b930,null))[_0x757b('0x23')](removeEntity(_0x24b930,null))[_0x757b('0x45')](handleError(_0x24b930,null));};exports[_0x757b('0x4c')]=function(_0x568d4d,_0x285032){return db['JscriptySessionReport'][_0x757b('0x4c')]()[_0x757b('0x23')](respondWithResult(_0x285032,null))[_0x757b('0x45')](handleError(_0x285032,null));};exports[_0x757b('0x4d')]=function(_0x3fc9f1,_0x461eab,_0x5d8a9b){var _0x31b66d={'raw':!![],'where':{}};var _0x21d11d={};var _0x12f396={'count':0x0,'rows':[]};return db[_0x757b('0x2b')][_0x757b('0x4e')]({'where':{'id':_0x3fc9f1['params']['id']}})[_0x757b('0x23')](handleEntityNotFound(_0x461eab,null))[_0x757b('0x23')](function(_0x2342d0){if(_0x2342d0){_0x21d11d[_0x757b('0x31')]=_[_0x757b('0x2d')](db[_0x757b('0x4f')][_0x757b('0x2c')]);_0x21d11d[_0x757b('0x2e')]=_[_0x757b('0x2d')](_0x3fc9f1[_0x757b('0x2e')]);_0x21d11d['filters']=_['intersection'](_0x21d11d['model'],_0x21d11d[_0x757b('0x2e')]);_0x31b66d[_0x757b('0x2f')]=_[_0x757b('0x30')](_0x21d11d[_0x757b('0x31')],qs[_0x757b('0x32')](_0x3fc9f1[_0x757b('0x2e')][_0x757b('0x32')]));_0x31b66d[_0x757b('0x2f')]=_0x31b66d[_0x757b('0x2f')][_0x757b('0x33')]?_0x31b66d[_0x757b('0x2f')]:_0x21d11d[_0x757b('0x31')];if(!_0x3fc9f1['query'][_0x757b('0x34')](_0x757b('0x50'))){_0x31b66d[_0x757b('0x1b')]=qs['limit'](_0x3fc9f1[_0x757b('0x2e')][_0x757b('0x1b')]);_0x31b66d[_0x757b('0x35')]=qs[_0x757b('0x35')](_0x3fc9f1[_0x757b('0x2e')][_0x757b('0x35')]);}_0x31b66d['order']=qs['sort'](_0x3fc9f1['query'][_0x757b('0x36')]);_0x31b66d[_0x757b('0x39')]=qs['filters'](_['pick'](_0x3fc9f1[_0x757b('0x2e')],_0x21d11d[_0x757b('0x48')]));_0x31b66d[_0x757b('0x39')][_0x757b('0x51')]=_0x2342d0['id'];if(_0x3fc9f1[_0x757b('0x2e')][_0x757b('0x38')]){_0x31b66d[_0x757b('0x39')]=_[_0x757b('0x3a')](_0x31b66d[_0x757b('0x39')],{'$or':_['map'](_0x31b66d[_0x757b('0x2f')],function(_0x54e570){var _0x2f6f72={};_0x2f6f72[_0x54e570]={'$like':'%'+_0x3fc9f1['query']['filter']+'%'};return _0x2f6f72;})});}_0x31b66d=_['merge']({},_0x31b66d,_0x3fc9f1[_0x757b('0x40')]);return db[_0x757b('0x4f')][_0x757b('0x1a')]({'where':_0x31b66d['where']})[_0x757b('0x23')](function(_0x262dcb){_0x12f396[_0x757b('0x1a')]=_0x262dcb;if(_0x3fc9f1['query']['includeAll']){_0x31b66d['include']=[{'all':!![]}];}return db[_0x757b('0x4f')]['findAll'](_0x31b66d);})['then'](function(_0x2255f5){_0x12f396[_0x757b('0x44')]=_0x2255f5;return _0x12f396;});}})[_0x757b('0x23')](respondWithFilteredResult(_0x461eab,_0x31b66d))[_0x757b('0x45')](handleError(_0x461eab,null));}; \ No newline at end of file +var _0x00d9=['hasOwnProperty','nolimit','sort','pick','filter','where','map','key','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','find','create','update','body','destroy','describe','getQuestions','findOne','order','SessionId','JscriptyQuestionReport','rows','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','JscriptySessionReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x26a679,_0x4c1784){var _0xa503cd=function(_0x1f877a){while(--_0x1f877a){_0x26a679['push'](_0x26a679['shift']());}};_0xa503cd(++_0x4c1784);}(_0x00d9,0x154));var _0x900d=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x00d9[_0x36eaaa];return _0x461349;};'use strict';var pdf=require(_0x900d('0x0'));var emlformat=require(_0x900d('0x1'));var rimraf=require(_0x900d('0x2'));var zipdir=require(_0x900d('0x3'));var jsonpatch=require(_0x900d('0x4'));var rp=require(_0x900d('0x5'));var moment=require('moment');var BPromise=require(_0x900d('0x6'));var Mustache=require(_0x900d('0x7'));var util=require(_0x900d('0x8'));var path=require(_0x900d('0x9'));var sox=require(_0x900d('0xa'));var csv=require(_0x900d('0xb'));var ejs=require(_0x900d('0xc'));var fs=require('fs');var _=require(_0x900d('0xd'));var squel=require(_0x900d('0xe'));var crypto=require(_0x900d('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x900d('0x10'));var toCsv=require(_0x900d('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x900d('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x900d('0x12'));var logger=require(_0x900d('0x13'))(_0x900d('0x14'));var utils=require(_0x900d('0x15'));var config=require('../../config/environment');var db=require(_0x900d('0x16'))['db'];function respondWithStatusCode(_0x39492b,_0x19f115){_0x19f115=_0x19f115||0xcc;return function(_0x4e273d){if(_0x4e273d){return _0x39492b[_0x900d('0x17')](_0x19f115);}return _0x39492b[_0x900d('0x18')](_0x19f115)[_0x900d('0x19')]();};}function respondWithResult(_0x108cf0,_0x5c8615){_0x5c8615=_0x5c8615||0xc8;return function(_0x4be740){if(_0x4be740){return _0x108cf0[_0x900d('0x18')](_0x5c8615)[_0x900d('0x1a')](_0x4be740);}};}function respondWithFilteredResult(_0x582fe8,_0x3e99f7){return function(_0x3d4d77){if(_0x3d4d77){var _0x144ecc=_0x3d4d77[_0x900d('0x1b')],_0x5016b1=_0x3e99f7[_0x900d('0x1c')],_0x3d1361=_0x3e99f7['offset']+_0x3e99f7[_0x900d('0x1d')],_0x5bf99f;if(_0x3d1361>=_0x144ecc){_0x3d1361=_0x144ecc;_0x5bf99f=0xc8;}else{_0x5bf99f=0xce;}_0x582fe8[_0x900d('0x18')](_0x5bf99f);return _0x582fe8[_0x900d('0x1e')](_0x900d('0x1f'),_0x5016b1+'-'+_0x3d1361+'/'+_0x144ecc)[_0x900d('0x1a')](_0x3d4d77);}return null;};}function patchUpdates(_0x1602c9){return function(_0x492be3){try{jsonpatch[_0x900d('0x20')](_0x492be3,_0x1602c9,!![]);}catch(_0x5c9631){return BPromise[_0x900d('0x21')](_0x5c9631);}return _0x492be3[_0x900d('0x22')]();};}function saveUpdates(_0x482dc1,_0x418ec7){return function(_0x2054c0){if(_0x2054c0){return _0x2054c0['update'](_0x482dc1)['then'](function(_0x1d57b5){return _0x1d57b5;});}return null;};}function removeEntity(_0x4694f3,_0x445d3c){return function(_0x44d2d0){if(_0x44d2d0){return _0x44d2d0['destroy']()[_0x900d('0x23')](function(){_0x4694f3['status'](0xcc)[_0x900d('0x19')]();});}};}function handleEntityNotFound(_0x378bcb,_0x143313){return function(_0x432fdb){if(!_0x432fdb){_0x378bcb[_0x900d('0x17')](0x194);}return _0x432fdb;};}function handleError(_0xf892c1,_0x539d0e){_0x539d0e=_0x539d0e||0x1f4;return function(_0x200b5a){logger[_0x900d('0x24')](_0x200b5a[_0x900d('0x25')]);if(_0x200b5a[_0x900d('0x26')]){delete _0x200b5a[_0x900d('0x26')];}_0xf892c1[_0x900d('0x18')](_0x539d0e)[_0x900d('0x27')](_0x200b5a);};}exports['index']=function(_0x5a9168,_0x2b1d07){var _0x260c1d={},_0x1fec9f={},_0xe4b502={'count':0x0,'rows':[]};var _0x1241c0=db[_0x900d('0x28')][_0x900d('0x29')];_0x1fec9f[_0x900d('0x2a')]=_[_0x900d('0x2b')](_0x1241c0);_0x1fec9f[_0x900d('0x2c')]=_['keys'](_0x5a9168[_0x900d('0x2c')]);_0x1fec9f[_0x900d('0x2d')]=_[_0x900d('0x2e')](_0x1fec9f['model'],_0x1fec9f[_0x900d('0x2c')]);_0x260c1d[_0x900d('0x2f')]=_[_0x900d('0x2e')](_0x1fec9f[_0x900d('0x2a')],qs[_0x900d('0x30')](_0x5a9168[_0x900d('0x2c')][_0x900d('0x30')]));_0x260c1d[_0x900d('0x2f')]=_0x260c1d['attributes'][_0x900d('0x31')]?_0x260c1d[_0x900d('0x2f')]:_0x1fec9f[_0x900d('0x2a')];if(!_0x5a9168[_0x900d('0x2c')][_0x900d('0x32')](_0x900d('0x33'))){_0x260c1d['limit']=qs[_0x900d('0x1d')](_0x5a9168['query'][_0x900d('0x1d')]);_0x260c1d[_0x900d('0x1c')]=qs['offset'](_0x5a9168[_0x900d('0x2c')][_0x900d('0x1c')]);}_0x260c1d['order']=qs['sort'](_0x5a9168[_0x900d('0x2c')][_0x900d('0x34')]);_0x260c1d['where']=qs[_0x900d('0x2d')](_[_0x900d('0x35')](_0x5a9168[_0x900d('0x2c')],_0x1fec9f[_0x900d('0x2d')]));if(_0x5a9168[_0x900d('0x2c')][_0x900d('0x36')]){_0x260c1d['where']=_['merge'](_0x260c1d[_0x900d('0x37')],{'$or':_[_0x900d('0x38')](_0x1241c0,function(_0x36f6ec){if(_0x36f6ec['type'][_0x900d('0x39')]!==_0x900d('0x3a')){var _0x66589c={};_0x66589c[_0x36f6ec['field']]={'$like':'%'+_0x5a9168[_0x900d('0x2c')][_0x900d('0x36')]+'%'};return _0x66589c;}})});}_0x260c1d=_[_0x900d('0x3b')]({},_0x260c1d,_0x5a9168[_0x900d('0x3c')]);var _0x3b55da={'where':_0x260c1d[_0x900d('0x37')]};return db[_0x900d('0x28')]['count'](_0x3b55da)['then'](function(_0x5c3520){_0xe4b502[_0x900d('0x1b')]=_0x5c3520;if(_0x5a9168['query'][_0x900d('0x3d')]){_0x260c1d[_0x900d('0x3e')]=[{'all':!![]}];}return db[_0x900d('0x28')][_0x900d('0x3f')](_0x260c1d);})[_0x900d('0x23')](function(_0x201a26){_0xe4b502['rows']=_0x201a26;return _0xe4b502;})[_0x900d('0x23')](respondWithFilteredResult(_0x2b1d07,_0x260c1d))[_0x900d('0x40')](handleError(_0x2b1d07,null));};exports['show']=function(_0xfec6fe,_0x395fbc){var _0x1f9da9={'raw':!![],'where':{'id':_0xfec6fe[_0x900d('0x41')]['id']}},_0x309f12={};_0x309f12[_0x900d('0x2a')]=_[_0x900d('0x2b')](db[_0x900d('0x28')][_0x900d('0x29')]);_0x309f12[_0x900d('0x2c')]=_['keys'](_0xfec6fe['query']);_0x309f12[_0x900d('0x2d')]=_[_0x900d('0x2e')](_0x309f12[_0x900d('0x2a')],_0x309f12[_0x900d('0x2c')]);_0x1f9da9[_0x900d('0x2f')]=_[_0x900d('0x2e')](_0x309f12[_0x900d('0x2a')],qs[_0x900d('0x30')](_0xfec6fe[_0x900d('0x2c')][_0x900d('0x30')]));_0x1f9da9[_0x900d('0x2f')]=_0x1f9da9[_0x900d('0x2f')][_0x900d('0x31')]?_0x1f9da9[_0x900d('0x2f')]:_0x309f12[_0x900d('0x2a')];if(_0xfec6fe[_0x900d('0x2c')][_0x900d('0x3d')]){_0x1f9da9[_0x900d('0x3e')]=[{'all':!![]}];}_0x1f9da9=_[_0x900d('0x3b')]({},_0x1f9da9,_0xfec6fe['options']);return db[_0x900d('0x28')][_0x900d('0x42')](_0x1f9da9)[_0x900d('0x23')](handleEntityNotFound(_0x395fbc,null))[_0x900d('0x23')](respondWithResult(_0x395fbc,null))['catch'](handleError(_0x395fbc,null));};exports[_0x900d('0x43')]=function(_0x13acd9,_0x5dcaa1){return db[_0x900d('0x28')]['create'](_0x13acd9['body'],{})[_0x900d('0x23')](respondWithResult(_0x5dcaa1,0xc9))[_0x900d('0x40')](handleError(_0x5dcaa1,null));};exports[_0x900d('0x44')]=function(_0x580286,_0x388a20){if(_0x580286[_0x900d('0x45')]['id']){delete _0x580286[_0x900d('0x45')]['id'];}return db[_0x900d('0x28')][_0x900d('0x42')]({'where':{'id':_0x580286[_0x900d('0x41')]['id']}})[_0x900d('0x23')](handleEntityNotFound(_0x388a20,null))[_0x900d('0x23')](saveUpdates(_0x580286['body'],null))[_0x900d('0x23')](respondWithResult(_0x388a20,null))[_0x900d('0x40')](handleError(_0x388a20,null));};exports[_0x900d('0x46')]=function(_0x575c75,_0x53c066){return db[_0x900d('0x28')]['find']({'where':{'id':_0x575c75[_0x900d('0x41')]['id']}})[_0x900d('0x23')](handleEntityNotFound(_0x53c066,null))[_0x900d('0x23')](removeEntity(_0x53c066,null))['catch'](handleError(_0x53c066,null));};exports[_0x900d('0x47')]=function(_0x4df52c,_0x81428e){return db[_0x900d('0x28')][_0x900d('0x47')]()[_0x900d('0x23')](respondWithResult(_0x81428e,null))['catch'](handleError(_0x81428e,null));};exports[_0x900d('0x48')]=function(_0x1bad73,_0xe73ca9,_0x1298e0){var _0x537f3e={'raw':!![],'where':{}};var _0x2d36e1={};var _0x13abc9={'count':0x0,'rows':[]};return db[_0x900d('0x28')][_0x900d('0x49')]({'where':{'id':_0x1bad73['params']['id']}})[_0x900d('0x23')](handleEntityNotFound(_0xe73ca9,null))['then'](function(_0x525b82){if(_0x525b82){_0x2d36e1['model']=_[_0x900d('0x2b')](db['JscriptyQuestionReport']['rawAttributes']);_0x2d36e1['query']=_[_0x900d('0x2b')](_0x1bad73[_0x900d('0x2c')]);_0x2d36e1['filters']=_[_0x900d('0x2e')](_0x2d36e1['model'],_0x2d36e1[_0x900d('0x2c')]);_0x537f3e[_0x900d('0x2f')]=_['intersection'](_0x2d36e1[_0x900d('0x2a')],qs[_0x900d('0x30')](_0x1bad73[_0x900d('0x2c')][_0x900d('0x30')]));_0x537f3e[_0x900d('0x2f')]=_0x537f3e[_0x900d('0x2f')][_0x900d('0x31')]?_0x537f3e[_0x900d('0x2f')]:_0x2d36e1[_0x900d('0x2a')];if(!_0x1bad73[_0x900d('0x2c')]['hasOwnProperty'](_0x900d('0x33'))){_0x537f3e[_0x900d('0x1d')]=qs[_0x900d('0x1d')](_0x1bad73[_0x900d('0x2c')]['limit']);_0x537f3e[_0x900d('0x1c')]=qs[_0x900d('0x1c')](_0x1bad73[_0x900d('0x2c')]['offset']);}_0x537f3e[_0x900d('0x4a')]=qs['sort'](_0x1bad73[_0x900d('0x2c')]['sort']);_0x537f3e[_0x900d('0x37')]=qs['filters'](_['pick'](_0x1bad73[_0x900d('0x2c')],_0x2d36e1[_0x900d('0x2d')]));_0x537f3e['where'][_0x900d('0x4b')]=_0x525b82['id'];if(_0x1bad73['query'][_0x900d('0x36')]){_0x537f3e[_0x900d('0x37')]=_['merge'](_0x537f3e[_0x900d('0x37')],{'$or':_[_0x900d('0x38')](_0x537f3e[_0x900d('0x2f')],function(_0x34beff){var _0x17f6fb={};_0x17f6fb[_0x34beff]={'$like':'%'+_0x1bad73[_0x900d('0x2c')][_0x900d('0x36')]+'%'};return _0x17f6fb;})});}_0x537f3e=_['merge']({},_0x537f3e,_0x1bad73[_0x900d('0x3c')]);return db['JscriptyQuestionReport'][_0x900d('0x1b')]({'where':_0x537f3e[_0x900d('0x37')]})[_0x900d('0x23')](function(_0x3eec88){_0x13abc9[_0x900d('0x1b')]=_0x3eec88;if(_0x1bad73['query'][_0x900d('0x3d')]){_0x537f3e[_0x900d('0x3e')]=[{'all':!![]}];}return db[_0x900d('0x4c')][_0x900d('0x3f')](_0x537f3e);})[_0x900d('0x23')](function(_0x451218){_0x13abc9[_0x900d('0x4d')]=_0x451218;return _0x13abc9;});}})['then'](respondWithFilteredResult(_0xe73ca9,_0x537f3e))[_0x900d('0x40')](handleError(_0xe73ca9,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index b57d03e..1b1883d 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 _0x7c17=['./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x463cc5,_0x2ae8ff){var _0x4383a2=function(_0x2ba879){while(--_0x2ba879){_0x463cc5['push'](_0x463cc5['shift']());}};_0x4383a2(++_0x2ae8ff);}(_0x7c17,0x15a));var _0x77c1=function(_0xf5601a,_0x13b8d3){_0xf5601a=_0xf5601a-0x0;var _0x1695e5=_0x7c17[_0xf5601a];return _0x1695e5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x77c1('0x0'))(_0x77c1('0x1'));var moment=require(_0x77c1('0x2'));var BPromise=require(_0x77c1('0x3'));var rp=require(_0x77c1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x77c1('0x5'));var attributes=require(_0x77c1('0x6'));module[_0x77c1('0x7')]=function(_0xf4c644,_0x13195f){return _0xf4c644[_0x77c1('0x8')](_0x77c1('0x9'),attributes,{'tableName':_0x77c1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5913=['../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x2dff8c,_0x340da7){var _0x3b7c1c=function(_0x46ed14){while(--_0x46ed14){_0x2dff8c['push'](_0x2dff8c['shift']());}};_0x3b7c1c(++_0x340da7);}(_0x5913,0x180));var _0x3591=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5913[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3591('0x0'));var util=require(_0x3591('0x1'));var logger=require(_0x3591('0x2'))(_0x3591('0x3'));var moment=require(_0x3591('0x4'));var BPromise=require('bluebird');var rp=require(_0x3591('0x5'));var fs=require('fs');var path=require(_0x3591('0x6'));var rimraf=require(_0x3591('0x7'));var config=require(_0x3591('0x8'));var attributes=require(_0x3591('0x9'));module[_0x3591('0xa')]=function(_0x3d50a8,_0x53a129){return _0x3d50a8[_0x3591('0xb')](_0x3591('0xc'),attributes,{'tableName':_0x3591('0xd'),'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 3067123..0aaa1c6 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 _0xfbbb=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x3b63d1,_0x12f938){var _0x462cb4=function(_0x4eddd){while(--_0x4eddd){_0x3b63d1['push'](_0x3b63d1['shift']());}};_0x462cb4(++_0x12f938);}(_0xfbbb,0x1b3));var _0xbfbb=function(_0x5c7a51,_0x5c4502){_0x5c7a51=_0x5c7a51-0x0;var _0x3a9fb5=_0xfbbb[_0x5c7a51];return _0x3a9fb5;};'use strict';var _=require(_0xbfbb('0x0'));var util=require(_0xbfbb('0x1'));var moment=require(_0xbfbb('0x2'));var BPromise=require(_0xbfbb('0x3'));var rs=require(_0xbfbb('0x4'));var fs=require('fs');var Redis=require(_0xbfbb('0x5'));var db=require(_0xbfbb('0x6'))['db'];var utils=require(_0xbfbb('0x7'));var logger=require(_0xbfbb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbfbb('0x9'));var client=jayson['client'][_0xbfbb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16c6cc,_0x16a41c,_0x5a69b3){return new BPromise(function(_0x1f2c31,_0x3260a7){return client[_0xbfbb('0xb')](_0x16c6cc,_0x5a69b3)[_0xbfbb('0xc')](function(_0x1baefa){logger[_0xbfbb('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x16a41c,_0xbfbb('0xe'));logger[_0xbfbb('0xf')](_0xbfbb('0x10'),_0x16a41c,_0xbfbb('0xe'),JSON['stringify'](_0x1baefa));if(_0x1baefa[_0xbfbb('0x11')]){if(_0x1baefa[_0xbfbb('0x11')][_0xbfbb('0x12')]===0x1f4){logger[_0xbfbb('0x11')](_0xbfbb('0x13'),_0x16a41c,_0x1baefa[_0xbfbb('0x11')][_0xbfbb('0x14')]);return _0x3260a7(_0x1baefa[_0xbfbb('0x11')]['message']);}logger[_0xbfbb('0x11')](_0xbfbb('0x13'),_0x16a41c,_0x1baefa[_0xbfbb('0x11')][_0xbfbb('0x14')]);return _0x1f2c31(_0x1baefa[_0xbfbb('0x11')]['message']);}else{logger[_0xbfbb('0xd')](_0xbfbb('0x13'),_0x16a41c,_0xbfbb('0xe'));_0x1f2c31(_0x1baefa[_0xbfbb('0x15')][_0xbfbb('0x14')]);}})[_0xbfbb('0x16')](function(_0x2f49e5){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x16a41c,_0x2f49e5);_0x3260a7(_0x2f49e5);});});} \ No newline at end of file +var _0x7ed1=['message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x28b7ab,_0x16a764){var _0x56791b=function(_0x25d20d){while(--_0x25d20d){_0x28b7ab['push'](_0x28b7ab['shift']());}};_0x56791b(++_0x16a764);}(_0x7ed1,0xca));var _0x17ed=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7ed1[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x17ed('0x0'));var util=require('util');var moment=require(_0x17ed('0x1'));var BPromise=require(_0x17ed('0x2'));var rs=require(_0x17ed('0x3'));var fs=require('fs');var Redis=require(_0x17ed('0x4'));var db=require(_0x17ed('0x5'))['db'];var utils=require(_0x17ed('0x6'));var logger=require('../../config/logger')(_0x17ed('0x7'));var config=require(_0x17ed('0x8'));var jayson=require(_0x17ed('0x9'));var client=jayson[_0x17ed('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x566a07,_0x3f6dca,_0x408fc2){return new BPromise(function(_0xcd3d39,_0x6e2d89){return client['request'](_0x566a07,_0x408fc2)[_0x17ed('0xb')](function(_0x321cd2){logger[_0x17ed('0xc')](_0x17ed('0xd'),_0x3f6dca,_0x17ed('0xe'));logger[_0x17ed('0xf')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x3f6dca,_0x17ed('0xe'),JSON['stringify'](_0x321cd2));if(_0x321cd2['error']){if(_0x321cd2[_0x17ed('0x10')][_0x17ed('0x11')]===0x1f4){logger[_0x17ed('0x10')](_0x17ed('0xd'),_0x3f6dca,_0x321cd2[_0x17ed('0x10')]['message']);return _0x6e2d89(_0x321cd2[_0x17ed('0x10')][_0x17ed('0x12')]);}logger[_0x17ed('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x3f6dca,_0x321cd2[_0x17ed('0x10')]['message']);return _0xcd3d39(_0x321cd2['error'][_0x17ed('0x12')]);}else{logger['info'](_0x17ed('0xd'),_0x3f6dca,_0x17ed('0xe'));_0xcd3d39(_0x321cd2[_0x17ed('0x13')][_0x17ed('0x12')]);}})['catch'](function(_0x897d4b){logger[_0x17ed('0x10')](_0x17ed('0xd'),_0x3f6dca,_0x897d4b);_0x6e2d89(_0x897d4b);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index e809325..5b542f6 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 _0x300b=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','isAuthenticated','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x300b,0xf7));var _0xb300=function(_0x4a9d98,_0x2cadbd){_0x4a9d98=_0x4a9d98-0x0;var _0x28279a=_0x300b[_0x4a9d98];return _0x28279a;};'use strict';var multer=require(_0xb300('0x0'));var util=require('util');var path=require(_0xb300('0x1'));var timeout=require('connect-timeout');var express=require(_0xb300('0x2'));var router=express[_0xb300('0x3')]();var auth=require(_0xb300('0x4'));var interaction=require(_0xb300('0x5'));var config=require(_0xb300('0x6'));var controller=require(_0xb300('0x7'));router[_0xb300('0x8')]('/',controller[_0xb300('0x9')]);router['put'](_0xb300('0xa'),auth[_0xb300('0xb')](),controller['update']);module[_0xb300('0xc')]=router; \ No newline at end of file +var _0x31ca=['express','../../components/auth/service','../../components/interaction/service','./license.controller','index','/:id','update','multer','util'];(function(_0x43446f,_0x2af360){var _0x2a1369=function(_0x2ba4e4){while(--_0x2ba4e4){_0x43446f['push'](_0x43446f['shift']());}};_0x2a1369(++_0x2af360);}(_0x31ca,0xf1));var _0xa31c=function(_0x50bbfb,_0x496cb5){_0x50bbfb=_0x50bbfb-0x0;var _0x24db3a=_0x31ca[_0x50bbfb];return _0x24db3a;};'use strict';var multer=require(_0xa31c('0x0'));var util=require(_0xa31c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa31c('0x2'));var router=express['Router']();var auth=require(_0xa31c('0x3'));var interaction=require(_0xa31c('0x4'));var config=require('../../config/environment');var controller=require(_0xa31c('0x5'));router['get']('/',controller[_0xa31c('0x6')]);router['put'](_0xa31c('0x7'),auth['isAuthenticated'](),controller[_0xa31c('0x8')]);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 ad47b47..414b083 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 _0x0aec=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0aec,0xc2));var _0xc0ae=function(_0xe4201d,_0x4dd4a1){_0xe4201d=_0xe4201d-0x0;var _0x1a889e=_0x0aec[_0xe4201d];return _0x1a889e;};'use strict';var Sequelize=require(_0xc0ae('0x0'));module[_0xc0ae('0x1')]={'license':{'type':Sequelize[_0xc0ae('0x2')]},'data1':{'type':Sequelize[_0xc0ae('0x3')]},'data2':{'type':Sequelize[_0xc0ae('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xc0ae('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x55a6=['sequelize','TEXT','STRING','INTEGER'];(function(_0x5e3139,_0x5bad26){var _0x3cdf31=function(_0x51647e){while(--_0x51647e){_0x5e3139['push'](_0x5e3139['shift']());}};_0x3cdf31(++_0x5bad26);}(_0x55a6,0x70));var _0x655a=function(_0x13772c,_0x4544b3){_0x13772c=_0x13772c-0x0;var _0x3397db=_0x55a6[_0x13772c];return _0x3397db;};'use strict';var Sequelize=require(_0x655a('0x0'));module['exports']={'license':{'type':Sequelize[_0x655a('0x1')]},'data1':{'type':Sequelize[_0x655a('0x2')]},'data2':{'type':Sequelize[_0x655a('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x655a('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 7d3b35a..fad5105 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 _0x5c84=['../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','apply','reject','save','then','error','stack','name','send','../../config/license/util','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','merge','options','getLicense','update','body','find','params','get','key','demo','catch','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x6acb35,_0x4352a5){var _0x164262=function(_0x2e697b){while(--_0x2e697b){_0x6acb35['push'](_0x6acb35['shift']());}};_0x164262(++_0x4352a5);}(_0x5c84,0x1ca));var _0x45c8=function(_0x44e105,_0x1683a7){_0x44e105=_0x44e105-0x0;var _0xb23089=_0x5c84[_0x44e105];return _0xb23089;};'use strict';var pdf=require(_0x45c8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x45c8('0x1'));var zipdir=require(_0x45c8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x45c8('0x3'));var moment=require(_0x45c8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x45c8('0x5'));var util=require('util');var path=require(_0x45c8('0x6'));var sox=require(_0x45c8('0x7'));var csv=require(_0x45c8('0x8'));var ejs=require(_0x45c8('0x9'));var fs=require('fs');var _=require(_0x45c8('0xa'));var squel=require(_0x45c8('0xb'));var crypto=require(_0x45c8('0xc'));var jsforce=require(_0x45c8('0xd'));var deskjs=require(_0x45c8('0xe'));var toCsv=require(_0x45c8('0x8'));var querystring=require(_0x45c8('0xf'));var Papa=require(_0x45c8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x45c8('0x11'));var hardwareService=require(_0x45c8('0x12'));var logger=require(_0x45c8('0x13'))(_0x45c8('0x14'));var utils=require(_0x45c8('0x15'));var config=require(_0x45c8('0x16'));var db=require(_0x45c8('0x17'))['db'];function respondWithStatusCode(_0x2da758,_0x43eb51){_0x43eb51=_0x43eb51||0xcc;return function(_0x33ebab){if(_0x33ebab){return _0x2da758[_0x45c8('0x18')](_0x43eb51);}return _0x2da758['status'](_0x43eb51)[_0x45c8('0x19')]();};}function respondWithResult(_0x3c1bde,_0x10b5b8){_0x10b5b8=_0x10b5b8||0xc8;return function(_0x393b74){if(_0x393b74){return _0x3c1bde[_0x45c8('0x1a')](_0x10b5b8)[_0x45c8('0x1b')](_0x393b74);}};}function respondWithFilteredResult(_0xfd50e5,_0x8f1929){return function(_0x2eb2ea){if(_0x2eb2ea){var _0x417d51=_0x2eb2ea[_0x45c8('0x1c')],_0x15acd5=_0x8f1929[_0x45c8('0x1d')],_0x4f7283=_0x8f1929[_0x45c8('0x1d')]+_0x8f1929[_0x45c8('0x1e')],_0x585109;if(_0x4f7283>=_0x417d51){_0x4f7283=_0x417d51;_0x585109=0xc8;}else{_0x585109=0xce;}_0xfd50e5['status'](_0x585109);return _0xfd50e5['set']('Content-Range',_0x15acd5+'-'+_0x4f7283+'/'+_0x417d51)[_0x45c8('0x1b')](_0x2eb2ea);}return null;};}function patchUpdates(_0x2e5aa9){return function(_0x142d8d){try{jsonpatch[_0x45c8('0x1f')](_0x142d8d,_0x2e5aa9,!![]);}catch(_0x3853ab){return BPromise[_0x45c8('0x20')](_0x3853ab);}return _0x142d8d[_0x45c8('0x21')]();};}function saveUpdates(_0x55d4d5,_0x586444){return function(_0x4cfa8){if(_0x4cfa8){return _0x4cfa8['update'](_0x55d4d5)[_0x45c8('0x22')](function(_0x461bde){return _0x461bde;});}return null;};}function removeEntity(_0x2c8905,_0x573ef7){return function(_0x38f51d){if(_0x38f51d){return _0x38f51d['destroy']()[_0x45c8('0x22')](function(){_0x2c8905[_0x45c8('0x1a')](0xcc)[_0x45c8('0x19')]();});}};}function handleEntityNotFound(_0x146147,_0x4e4eab){return function(_0x3fe54f){if(!_0x3fe54f){_0x146147[_0x45c8('0x18')](0x194);}return _0x3fe54f;};}function handleError(_0x452658,_0x159e71){_0x159e71=_0x159e71||0x1f4;return function(_0xd466b0){logger[_0x45c8('0x23')](_0xd466b0[_0x45c8('0x24')]);if(_0xd466b0[_0x45c8('0x25')]){delete _0xd466b0[_0x45c8('0x25')];}_0x452658['status'](_0x159e71)[_0x45c8('0x26')](_0xd466b0);};}var utilLicense=require(_0x45c8('0x27'));exports['index']=function(_0x68adc,_0x2e8f61){var _0x28beae={'raw':!![],'where':{'id':0x1}},_0x1ec4bc={};_0x1ec4bc[_0x45c8('0x28')]=_[_0x45c8('0x29')](db['License'][_0x45c8('0x2a')]);_0x1ec4bc[_0x45c8('0x2b')]=_[_0x45c8('0x29')](_0x68adc[_0x45c8('0x2b')]);_0x1ec4bc[_0x45c8('0x2c')]=_['intersection'](_0x1ec4bc[_0x45c8('0x28')],_0x1ec4bc[_0x45c8('0x2b')]);_0x28beae['attributes']=_[_0x45c8('0x2d')](_0x1ec4bc['model'],qs[_0x45c8('0x2e')](_0x68adc[_0x45c8('0x2b')]['fields']));_0x28beae['attributes']=_0x28beae[_0x45c8('0x2f')][_0x45c8('0x30')]?_0x28beae[_0x45c8('0x2f')]:_0x1ec4bc[_0x45c8('0x28')];_0x28beae=_[_0x45c8('0x31')]({},_0x28beae,_0x68adc[_0x45c8('0x32')]);return utilLicense[_0x45c8('0x33')](_0x28beae)[_0x45c8('0x22')](respondWithResult(_0x2e8f61,null))['catch'](handleError(_0x2e8f61,null));};exports[_0x45c8('0x34')]=function(_0x4313df,_0xacc2f8){if(_0x4313df[_0x45c8('0x35')]['id']){delete _0x4313df['body']['id'];}return db['License'][_0x45c8('0x36')]({'where':{'id':_0x4313df[_0x45c8('0x37')]['id']}})[_0x45c8('0x22')](handleEntityNotFound(_0xacc2f8,null))[_0x45c8('0x22')](function(_0x12b2e7){var _0x4fb39b=_0x12b2e7[_0x45c8('0x38')]({'plain':!![]});return utilLicense['checkLicense'](_0x4fb39b,_0x4313df[_0x45c8('0x35')][_0x45c8('0x39')]);})[_0x45c8('0x22')](function(_0x4fcce6){if(!_0x4fcce6[_0x45c8('0x3a')]){return saveUpdates(_0x4313df['body'],null);}return _0x4fcce6;})[_0x45c8('0x22')](respondWithResult(_0xacc2f8,null))[_0x45c8('0x3b')](handleError(_0xacc2f8,null));}; \ No newline at end of file +var _0x41fe=['../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','Content-Range','apply','reject','update','then','destroy','error','name','../../config/license/util','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','getLicense','body','find','params','get','checkLicense','key','demo','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','papaparse'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x41fe,0xd1));var _0xe41f=function(_0x5c2c7c,_0xa7d3b1){_0x5c2c7c=_0x5c2c7c-0x0;var _0xea7ffe=_0x41fe[_0x5c2c7c];return _0xea7ffe;};'use strict';var pdf=require(_0xe41f('0x0'));var emlformat=require(_0xe41f('0x1'));var rimraf=require(_0xe41f('0x2'));var zipdir=require(_0xe41f('0x3'));var jsonpatch=require(_0xe41f('0x4'));var rp=require(_0xe41f('0x5'));var moment=require(_0xe41f('0x6'));var BPromise=require(_0xe41f('0x7'));var Mustache=require(_0xe41f('0x8'));var util=require(_0xe41f('0x9'));var path=require(_0xe41f('0xa'));var sox=require(_0xe41f('0xb'));var csv=require(_0xe41f('0xc'));var ejs=require(_0xe41f('0xd'));var fs=require('fs');var _=require(_0xe41f('0xe'));var squel=require(_0xe41f('0xf'));var crypto=require(_0xe41f('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xe41f('0x11'));var toCsv=require(_0xe41f('0xc'));var querystring=require('querystring');var Papa=require(_0xe41f('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe41f('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe41f('0x14'));var db=require(_0xe41f('0x15'))['db'];function respondWithStatusCode(_0x1ef366,_0xc582a1){_0xc582a1=_0xc582a1||0xcc;return function(_0x2ed268){if(_0x2ed268){return _0x1ef366[_0xe41f('0x16')](_0xc582a1);}return _0x1ef366[_0xe41f('0x17')](_0xc582a1)[_0xe41f('0x18')]();};}function respondWithResult(_0x2563ca,_0x431536){_0x431536=_0x431536||0xc8;return function(_0x53e2f6){if(_0x53e2f6){return _0x2563ca[_0xe41f('0x17')](_0x431536)[_0xe41f('0x19')](_0x53e2f6);}};}function respondWithFilteredResult(_0x544753,_0x16bc30){return function(_0x9cb27c){if(_0x9cb27c){var _0x3b5992=_0x9cb27c[_0xe41f('0x1a')],_0x1fb373=_0x16bc30['offset'],_0x194653=_0x16bc30['offset']+_0x16bc30[_0xe41f('0x1b')],_0x3e4e83;if(_0x194653>=_0x3b5992){_0x194653=_0x3b5992;_0x3e4e83=0xc8;}else{_0x3e4e83=0xce;}_0x544753['status'](_0x3e4e83);return _0x544753['set'](_0xe41f('0x1c'),_0x1fb373+'-'+_0x194653+'/'+_0x3b5992)[_0xe41f('0x19')](_0x9cb27c);}return null;};}function patchUpdates(_0x9185b1){return function(_0x33cfd6){try{jsonpatch[_0xe41f('0x1d')](_0x33cfd6,_0x9185b1,!![]);}catch(_0x5bd220){return BPromise[_0xe41f('0x1e')](_0x5bd220);}return _0x33cfd6['save']();};}function saveUpdates(_0x28501a,_0x2c264c){return function(_0x4dcb21){if(_0x4dcb21){return _0x4dcb21[_0xe41f('0x1f')](_0x28501a)[_0xe41f('0x20')](function(_0x171851){return _0x171851;});}return null;};}function removeEntity(_0x49e80d,_0x1c5908){return function(_0x3666c3){if(_0x3666c3){return _0x3666c3[_0xe41f('0x21')]()[_0xe41f('0x20')](function(){_0x49e80d[_0xe41f('0x17')](0xcc)[_0xe41f('0x18')]();});}};}function handleEntityNotFound(_0x9c0c33,_0x520136){return function(_0x18c6ba){if(!_0x18c6ba){_0x9c0c33['sendStatus'](0x194);}return _0x18c6ba;};}function handleError(_0x4e8587,_0x2f586e){_0x2f586e=_0x2f586e||0x1f4;return function(_0x234451){logger[_0xe41f('0x22')](_0x234451['stack']);if(_0x234451[_0xe41f('0x23')]){delete _0x234451[_0xe41f('0x23')];}_0x4e8587[_0xe41f('0x17')](_0x2f586e)['send'](_0x234451);};}var utilLicense=require(_0xe41f('0x24'));exports['index']=function(_0x16444d,_0x44fb04){var _0x5d30f5={'raw':!![],'where':{'id':0x1}},_0x20c671={};_0x20c671[_0xe41f('0x25')]=_[_0xe41f('0x26')](db[_0xe41f('0x27')][_0xe41f('0x28')]);_0x20c671[_0xe41f('0x29')]=_[_0xe41f('0x26')](_0x16444d[_0xe41f('0x29')]);_0x20c671[_0xe41f('0x2a')]=_[_0xe41f('0x2b')](_0x20c671[_0xe41f('0x25')],_0x20c671[_0xe41f('0x29')]);_0x5d30f5[_0xe41f('0x2c')]=_[_0xe41f('0x2b')](_0x20c671[_0xe41f('0x25')],qs['fields'](_0x16444d[_0xe41f('0x29')][_0xe41f('0x2d')]));_0x5d30f5[_0xe41f('0x2c')]=_0x5d30f5[_0xe41f('0x2c')][_0xe41f('0x2e')]?_0x5d30f5['attributes']:_0x20c671[_0xe41f('0x25')];_0x5d30f5=_[_0xe41f('0x2f')]({},_0x5d30f5,_0x16444d[_0xe41f('0x30')]);return utilLicense[_0xe41f('0x31')](_0x5d30f5)['then'](respondWithResult(_0x44fb04,null))['catch'](handleError(_0x44fb04,null));};exports['update']=function(_0x2d260c,_0x4b0fae){if(_0x2d260c[_0xe41f('0x32')]['id']){delete _0x2d260c['body']['id'];}return db[_0xe41f('0x27')][_0xe41f('0x33')]({'where':{'id':_0x2d260c[_0xe41f('0x34')]['id']}})[_0xe41f('0x20')](handleEntityNotFound(_0x4b0fae,null))[_0xe41f('0x20')](function(_0x3d9090){var _0x44f99b=_0x3d9090[_0xe41f('0x35')]({'plain':!![]});return utilLicense[_0xe41f('0x36')](_0x44f99b,_0x2d260c[_0xe41f('0x32')][_0xe41f('0x37')]);})[_0xe41f('0x20')](function(_0x508d2a){if(!_0x508d2a[_0xe41f('0x38')]){return saveUpdates(_0x2d260c['body'],null);}return _0x508d2a;})[_0xe41f('0x20')](respondWithResult(_0x4b0fae,null))['catch'](handleError(_0x4b0fae,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 469959d..8c53fdb 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 _0x720c=['./license.attributes','exports','License','license','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2ebd68,_0x10e9cc){var _0x2e68d5=function(_0x57b080){while(--_0x57b080){_0x2ebd68['push'](_0x2ebd68['shift']());}};_0x2e68d5(++_0x10e9cc);}(_0x720c,0x154));var _0xc720=function(_0x4c4038,_0x46375b){_0x4c4038=_0x4c4038-0x0;var _0x398114=_0x720c[_0x4c4038];return _0x398114;};'use strict';var _=require(_0xc720('0x0'));var util=require('util');var logger=require(_0xc720('0x1'))(_0xc720('0x2'));var moment=require(_0xc720('0x3'));var BPromise=require(_0xc720('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc720('0x5'));var rimraf=require(_0xc720('0x6'));var config=require(_0xc720('0x7'));var attributes=require(_0xc720('0x8'));module[_0xc720('0x9')]=function(_0x6f8d9f,_0x7d6830){return _0x6f8d9f['define'](_0xc720('0xa'),attributes,{'tableName':_0xc720('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe605=['exports','define','license','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes'];(function(_0x4172b4,_0x20e312){var _0x1135c9=function(_0x5f4943){while(--_0x5f4943){_0x4172b4['push'](_0x4172b4['shift']());}};_0x1135c9(++_0x20e312);}(_0xe605,0x92));var _0x5e60=function(_0x35f5d6,_0x3882c1){_0x35f5d6=_0x35f5d6-0x0;var _0x191cc1=_0xe605[_0x35f5d6];return _0x191cc1;};'use strict';var _=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var logger=require('../../config/logger')(_0x5e60('0x2'));var moment=require(_0x5e60('0x3'));var BPromise=require(_0x5e60('0x4'));var rp=require(_0x5e60('0x5'));var fs=require('fs');var path=require(_0x5e60('0x6'));var rimraf=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var attributes=require(_0x5e60('0x9'));module[_0x5e60('0xa')]=function(_0xc41535,_0x1d4a08){return _0xc41535[_0x5e60('0xb')]('License',attributes,{'tableName':_0x5e60('0xc'),'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 73c2d08..15cf8c3 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 _0xd831=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x2058a8,_0x45c259){var _0x3ee9a4=function(_0x4dac51){while(--_0x4dac51){_0x2058a8['push'](_0x2058a8['shift']());}};_0x3ee9a4(++_0x45c259);}(_0xd831,0xa2));var _0x1d83=function(_0x473dae,_0x4a47b3){_0x473dae=_0x473dae-0x0;var _0x5d38bf=_0xd831[_0x473dae];return _0x5d38bf;};'use strict';var _=require(_0x1d83('0x0'));var util=require(_0x1d83('0x1'));var moment=require(_0x1d83('0x2'));var BPromise=require('bluebird');var rs=require(_0x1d83('0x3'));var fs=require('fs');var Redis=require(_0x1d83('0x4'));var db=require(_0x1d83('0x5'))['db'];var utils=require(_0x1d83('0x6'));var logger=require(_0x1d83('0x7'))(_0x1d83('0x8'));var config=require(_0x1d83('0x9'));var jayson=require(_0x1d83('0xa'));var client=jayson[_0x1d83('0xb')][_0x1d83('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x28673e,_0x192ff9,_0xfbf543){return new BPromise(function(_0x10b5d2,_0x5cf04d){return client[_0x1d83('0xd')](_0x28673e,_0xfbf543)[_0x1d83('0xe')](function(_0x42deb0){logger[_0x1d83('0xf')](_0x1d83('0x10'),_0x192ff9,_0x1d83('0x11'));logger[_0x1d83('0x12')](_0x1d83('0x13'),_0x192ff9,'request\x20sent',JSON[_0x1d83('0x14')](_0x42deb0));if(_0x42deb0[_0x1d83('0x15')]){if(_0x42deb0[_0x1d83('0x15')][_0x1d83('0x16')]===0x1f4){logger[_0x1d83('0x15')](_0x1d83('0x10'),_0x192ff9,_0x42deb0[_0x1d83('0x15')]['message']);return _0x5cf04d(_0x42deb0[_0x1d83('0x15')][_0x1d83('0x17')]);}logger[_0x1d83('0x15')]('License,\x20%s,\x20%s',_0x192ff9,_0x42deb0[_0x1d83('0x15')][_0x1d83('0x17')]);return _0x10b5d2(_0x42deb0[_0x1d83('0x15')][_0x1d83('0x17')]);}else{logger[_0x1d83('0xf')]('License,\x20%s,\x20%s',_0x192ff9,'request\x20sent');_0x10b5d2(_0x42deb0['result']['message']);}})['catch'](function(_0x1c0ddd){logger[_0x1d83('0x15')]('License,\x20%s,\x20%s',_0x192ff9,_0x1c0ddd);_0x5cf04d(_0x1c0ddd);});});} \ No newline at end of file +var _0x9b2b=['debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','License,\x20%s,\x20%s','request\x20sent'];(function(_0x245b51,_0x4305b1){var _0x3fc749=function(_0x5ef181){while(--_0x5ef181){_0x245b51['push'](_0x245b51['shift']());}};_0x3fc749(++_0x4305b1);}(_0x9b2b,0xee));var _0xb9b2=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0x9b2b[_0x4e93a9];return _0x43013c;};'use strict';var _=require(_0xb9b2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb9b2('0x1'));var rs=require(_0xb9b2('0x2'));var fs=require('fs');var Redis=require(_0xb9b2('0x3'));var db=require(_0xb9b2('0x4'))['db'];var utils=require(_0xb9b2('0x5'));var logger=require(_0xb9b2('0x6'))(_0xb9b2('0x7'));var config=require(_0xb9b2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb9b2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25cd27,_0x5d619c,_0x973136){return new BPromise(function(_0x2b2fe7,_0x26cb7d){return client[_0xb9b2('0xa')](_0x25cd27,_0x973136)[_0xb9b2('0xb')](function(_0x17d16d){logger[_0xb9b2('0xc')](_0xb9b2('0xd'),_0x5d619c,_0xb9b2('0xe'));logger[_0xb9b2('0xf')](_0xb9b2('0x10'),_0x5d619c,_0xb9b2('0xe'),JSON[_0xb9b2('0x11')](_0x17d16d));if(_0x17d16d[_0xb9b2('0x12')]){if(_0x17d16d[_0xb9b2('0x12')][_0xb9b2('0x13')]===0x1f4){logger[_0xb9b2('0x12')](_0xb9b2('0xd'),_0x5d619c,_0x17d16d[_0xb9b2('0x12')][_0xb9b2('0x14')]);return _0x26cb7d(_0x17d16d[_0xb9b2('0x12')][_0xb9b2('0x14')]);}logger[_0xb9b2('0x12')]('License,\x20%s,\x20%s',_0x5d619c,_0x17d16d[_0xb9b2('0x12')][_0xb9b2('0x14')]);return _0x2b2fe7(_0x17d16d[_0xb9b2('0x12')][_0xb9b2('0x14')]);}else{logger['info']('License,\x20%s,\x20%s',_0x5d619c,_0xb9b2('0xe'));_0x2b2fe7(_0x17d16d[_0xb9b2('0x15')][_0xb9b2('0x14')]);}})[_0xb9b2('0x16')](function(_0x3df2b5){logger[_0xb9b2('0x12')](_0xb9b2('0xd'),_0x5d619c,_0x3df2b5);_0x26cb7d(_0x3df2b5);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index fb24c4f..128dd31 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 _0xe98b=['../../config/environment','isAuthenticated','index','get','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','getAgents','addDisposition','post','addAnswer','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','/:id/users','addAgents','put','/:id','update','delete','removeDispositions','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x28014d,_0x383e2f){var _0x2572cc=function(_0x17aabd){while(--_0x17aabd){_0x28014d['push'](_0x28014d['shift']());}};_0x2572cc(++_0x383e2f);}(_0xe98b,0x1ed));var _0xbe98=function(_0x3d4e15,_0x2725c1){_0x3d4e15=_0x3d4e15-0x0;var _0x16a2d1=_0xe98b[_0x3d4e15];return _0x16a2d1;};'use strict';var multer=require(_0xbe98('0x0'));var util=require(_0xbe98('0x1'));var path=require('path');var timeout=require(_0xbe98('0x2'));var express=require(_0xbe98('0x3'));var router=express[_0xbe98('0x4')]();var auth=require(_0xbe98('0x5'));var interaction=require(_0xbe98('0x6'));var config=require(_0xbe98('0x7'));var controller=require('./mailAccount.controller');router['get']('/',auth[_0xbe98('0x8')](),controller[_0xbe98('0x9')]);router[_0xbe98('0xa')](_0xbe98('0xb'),auth[_0xbe98('0x8')](),controller[_0xbe98('0xc')]);router[_0xbe98('0xa')]('/:id',auth[_0xbe98('0x8')](),controller[_0xbe98('0xd')]);router[_0xbe98('0xa')](_0xbe98('0xe'),auth[_0xbe98('0x8')](),controller[_0xbe98('0xf')]);router[_0xbe98('0xa')](_0xbe98('0x10'),auth[_0xbe98('0x8')](),controller[_0xbe98('0x11')]);router[_0xbe98('0xa')](_0xbe98('0x12'),auth[_0xbe98('0x8')](),controller[_0xbe98('0x13')]);router['get'](_0xbe98('0x14'),auth[_0xbe98('0x8')](),controller[_0xbe98('0x15')]);router[_0xbe98('0xa')](_0xbe98('0x16'),auth['isAuthenticated'](),controller['getInteractions']);router[_0xbe98('0xa')](_0xbe98('0x17'),auth[_0xbe98('0x8')](),controller[_0xbe98('0x18')]);router[_0xbe98('0xa')](_0xbe98('0x19'),auth[_0xbe98('0x8')](),controller[_0xbe98('0x1a')]);router['get'](_0xbe98('0x1b'),auth[_0xbe98('0x8')](),controller['verifySmtp']);router[_0xbe98('0xa')]('/:id/users',auth[_0xbe98('0x8')](),controller[_0xbe98('0x1c')]);router['post'](_0xbe98('0xe'),auth[_0xbe98('0x8')](),controller[_0xbe98('0x1d')]);router[_0xbe98('0x1e')](_0xbe98('0x10'),auth['isAuthenticated'](),controller[_0xbe98('0x1f')]);router[_0xbe98('0x1e')]('/',auth[_0xbe98('0x8')](),controller['create']);router[_0xbe98('0x1e')](_0xbe98('0x12'),auth[_0xbe98('0x8')](),controller[_0xbe98('0x20')]);router['post']('/:id/out_servers',auth['isAuthenticated'](),controller[_0xbe98('0x21')]);router[_0xbe98('0x1e')]('/:id/interactions',auth[_0xbe98('0x8')](),controller[_0xbe98('0x22')]);router[_0xbe98('0x1e')](_0xbe98('0x17'),auth[_0xbe98('0x8')](),controller[_0xbe98('0x23')]);router[_0xbe98('0x1e')](_0xbe98('0x24'),auth[_0xbe98('0x8')](),controller[_0xbe98('0x25')]);router[_0xbe98('0x1e')](_0xbe98('0x26'),auth[_0xbe98('0x8')](),controller[_0xbe98('0x27')]);router[_0xbe98('0x28')](_0xbe98('0x29'),auth[_0xbe98('0x8')](),controller[_0xbe98('0x2a')]);router[_0xbe98('0x2b')]('/:id/dispositions',auth[_0xbe98('0x8')](),controller[_0xbe98('0x2c')]);router[_0xbe98('0x2b')](_0xbe98('0x10'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0xbe98('0x2b')](_0xbe98('0x12'),auth[_0xbe98('0x8')](),controller[_0xbe98('0x2d')]);router['delete'](_0xbe98('0x14'),auth[_0xbe98('0x8')](),controller[_0xbe98('0x2e')]);router[_0xbe98('0x2b')]('/:id',auth[_0xbe98('0x8')](),controller[_0xbe98('0x2f')]);router['delete']('/:id/users',auth[_0xbe98('0x8')](),controller[_0xbe98('0x30')]);module[_0xbe98('0x31')]=router; \ No newline at end of file +var _0xcf48=['/:id','delete','removeDispositions','/:id/canned_answers','removeAnswers','removeImap','removeSmtp','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./mailAccount.controller','isAuthenticated','index','get','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/applications','getApplications','/:id/verify','verifySmtp','addDisposition','post','addAnswer','addImap','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','/:id/users'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xcf48,0x136));var _0x8cf4=function(_0x2e4035,_0x2eb25e){_0x2e4035=_0x2e4035-0x0;var _0x3dd64e=_0xcf48[_0x2e4035];return _0x3dd64e;};'use strict';var multer=require(_0x8cf4('0x0'));var util=require(_0x8cf4('0x1'));var path=require(_0x8cf4('0x2'));var timeout=require(_0x8cf4('0x3'));var express=require('express');var router=express[_0x8cf4('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8cf4('0x5'));var config=require(_0x8cf4('0x6'));var controller=require(_0x8cf4('0x7'));router['get']('/',auth[_0x8cf4('0x8')](),controller[_0x8cf4('0x9')]);router[_0x8cf4('0xa')](_0x8cf4('0xb'),auth[_0x8cf4('0x8')](),controller[_0x8cf4('0xc')]);router[_0x8cf4('0xa')]('/:id',auth[_0x8cf4('0x8')](),controller[_0x8cf4('0xd')]);router[_0x8cf4('0xa')](_0x8cf4('0xe'),auth[_0x8cf4('0x8')](),controller[_0x8cf4('0xf')]);router[_0x8cf4('0xa')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x8cf4('0x10')]);router[_0x8cf4('0xa')](_0x8cf4('0x11'),auth[_0x8cf4('0x8')](),controller['getImap']);router[_0x8cf4('0xa')](_0x8cf4('0x12'),auth['isAuthenticated'](),controller[_0x8cf4('0x13')]);router[_0x8cf4('0xa')]('/:id/interactions',auth[_0x8cf4('0x8')](),controller['getInteractions']);router[_0x8cf4('0xa')](_0x8cf4('0x14'),auth[_0x8cf4('0x8')](),controller[_0x8cf4('0x15')]);router[_0x8cf4('0xa')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x8cf4('0xa')](_0x8cf4('0x16'),auth[_0x8cf4('0x8')](),controller[_0x8cf4('0x17')]);router[_0x8cf4('0xa')]('/:id/users',auth[_0x8cf4('0x8')](),controller['getAgents']);router['post'](_0x8cf4('0xe'),auth[_0x8cf4('0x8')](),controller[_0x8cf4('0x18')]);router[_0x8cf4('0x19')]('/:id/canned_answers',auth[_0x8cf4('0x8')](),controller[_0x8cf4('0x1a')]);router[_0x8cf4('0x19')]('/',auth[_0x8cf4('0x8')](),controller['create']);router[_0x8cf4('0x19')]('/:id/in_servers',auth[_0x8cf4('0x8')](),controller[_0x8cf4('0x1b')]);router['post'](_0x8cf4('0x12'),auth['isAuthenticated'](),controller[_0x8cf4('0x1c')]);router[_0x8cf4('0x19')](_0x8cf4('0x1d'),auth[_0x8cf4('0x8')](),controller[_0x8cf4('0x1e')]);router[_0x8cf4('0x19')](_0x8cf4('0x14'),auth[_0x8cf4('0x8')](),controller[_0x8cf4('0x1f')]);router['post'](_0x8cf4('0x20'),auth['isAuthenticated'](),controller['send']);router[_0x8cf4('0x19')](_0x8cf4('0x21'),auth[_0x8cf4('0x8')](),controller['addAgents']);router['put'](_0x8cf4('0x22'),auth[_0x8cf4('0x8')](),controller['update']);router[_0x8cf4('0x23')](_0x8cf4('0xe'),auth[_0x8cf4('0x8')](),controller[_0x8cf4('0x24')]);router[_0x8cf4('0x23')](_0x8cf4('0x25'),auth['isAuthenticated'](),controller[_0x8cf4('0x26')]);router[_0x8cf4('0x23')]('/:id/in_servers',auth[_0x8cf4('0x8')](),controller[_0x8cf4('0x27')]);router[_0x8cf4('0x23')](_0x8cf4('0x12'),auth[_0x8cf4('0x8')](),controller[_0x8cf4('0x28')]);router['delete'](_0x8cf4('0x22'),auth['isAuthenticated'](),controller['destroy']);router[_0x8cf4('0x23')](_0x8cf4('0x21'),auth[_0x8cf4('0x8')](),controller[_0x8cf4('0x29')]);module[_0x8cf4('0x2a')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index b8d4be8..6ed231a 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 _0x6a22=['TEXT','Arial,Helvetica,sans-serif','UNSIGNED','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN'];(function(_0x45dde7,_0x55c28b){var _0x5cedf3=function(_0x2661f7){while(--_0x2661f7){_0x45dde7['push'](_0x45dde7['shift']());}};_0x5cedf3(++_0x55c28b);}(_0x6a22,0xe6));var _0x26a2=function(_0x38490b,_0x108ad7){_0x38490b=_0x38490b-0x0;var _0x197661=_0x6a22[_0x38490b];return _0x197661;};'use strict';var Sequelize=require(_0x26a2('0x0'));module[_0x26a2('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x26a2('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x26a2('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x26a2('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x26a2('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x26a2('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x26a2('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x26a2('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x26a2('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x26a2('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[_0x26a2('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x26a2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x26a2('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x26a2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x26a2('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x26a2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x26a2('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x26a2('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x26a2('0x3')],'defaultValue':![],'comment':_0x26a2('0x9'),'set':function(_0x563b42){if(!_0x563b42)this[_0x26a2('0xa')](_0x26a2('0xb'),null);this[_0x26a2('0xa')](_0x26a2('0xc'),_0x563b42);}}}; \ No newline at end of file +var _0x3170=['BOOLEAN','TEXT','INTEGER','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','STRING'];(function(_0x3124f8,_0x1a8b23){var _0x5bab5f=function(_0x18b09b){while(--_0x18b09b){_0x3124f8['push'](_0x3124f8['shift']());}};_0x5bab5f(++_0x1a8b23);}(_0x3170,0xf9));var _0x0317=function(_0xd81623,_0x57468d){_0xd81623=_0xd81623-0x0;var _0x4353f8=_0x3170[_0xd81623];return _0x4353f8;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x0317('0x0')]},'name':{'type':Sequelize[_0x0317('0x0')],'allowNull':![]},'service':{'type':Sequelize[_0x0317('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x0317('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x0317('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0x0317('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0x0317('0x2')]},'markAsUnread':{'type':Sequelize[_0x0317('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x0317('0x3')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x0317('0x2')],'defaultValue':function(){return _0x0317('0x4');}},'notificationSound':{'type':Sequelize[_0x0317('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0317('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0317('0x3')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0317('0x1')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0317('0x3')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x0317('0x5')},'mandatoryDisposition':{'type':Sequelize[_0x0317('0x1')],'defaultValue':![],'comment':_0x0317('0x6'),'set':function(_0x3b1a82){if(!_0x3b1a82)this['setDataValue'](_0x0317('0x7'),null);this[_0x0317('0x8')](_0x0317('0x9'),_0x3b1a82);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index b2aed3c..9bc1367 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 _0x82b0=['Smtp','Pause','MailAccount','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','key','VIRTUAL','field','merge','options','includeAll','include','findAll','show','params','MailServerIn','mandatoryDispositionPause','find','body','update','describe','addDisposition','Disposition','getDispositions','findOne','rows','removeDispositions','addAnswer','MailAccountId','CannedAnswer','create','getAnswers','removeAnswers','email','ListId','isNil','active','description','cservice','cauthentication','user','cuser','pass','authentication','host','port','service','password','cpassword','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','omit','ids','getInteractions','MailInteraction','CmContact','Contact','User','Owner','fullname','internal','Tags','color','tag','MailApplication','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','format','split','CmList','List','DESC','from','%s\x20<%s>','attachments','join','root','basename','auth','secure','sendMail','List\x20not\x20found','Contacts','defaults','messageId','subject','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','test','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','count','offset','limit','set','Content-Range','apply','reject','destroy','get','MailAccounts','UserProfileResource','end','sendStatus','stack','name','send','index','Imap','MailServerOut'];(function(_0x424526,_0x4180ff){var _0x3340f6=function(_0x125867){while(--_0x125867){_0x424526['push'](_0x424526['shift']());}};_0x3340f6(++_0x4180ff);}(_0x82b0,0x81));var _0x082b=function(_0x2867a6,_0x10d905){_0x2867a6=_0x2867a6-0x0;var _0x4afc2b=_0x82b0[_0x2867a6];return _0x4afc2b;};'use strict';var pdf=require(_0x082b('0x0'));var emlformat=require(_0x082b('0x1'));var rimraf=require(_0x082b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x082b('0x3'));var rp=require(_0x082b('0x4'));var moment=require(_0x082b('0x5'));var BPromise=require(_0x082b('0x6'));var Mustache=require('mustache');var util=require(_0x082b('0x7'));var path=require(_0x082b('0x8'));var sox=require(_0x082b('0x9'));var csv=require(_0x082b('0xa'));var ejs=require(_0x082b('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x082b('0xc'));var crypto=require(_0x082b('0xd'));var jsforce=require(_0x082b('0xe'));var deskjs=require(_0x082b('0xf'));var toCsv=require(_0x082b('0xa'));var querystring=require(_0x082b('0x10'));var Papa=require(_0x082b('0x11'));var Redis=require(_0x082b('0x12'));var authService=require(_0x082b('0x13'));var qs=require(_0x082b('0x14'));var hardwareService=require(_0x082b('0x15'));var logger=require(_0x082b('0x16'))(_0x082b('0x17'));var utils=require(_0x082b('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x082b('0x19')]=_['defaults'](config['redis'],{'host':_0x082b('0x1a'),'port':0x18eb});var socket=require(_0x082b('0x1b'))(new Redis(config['redis']));require(_0x082b('0x1c'))[_0x082b('0x1d')](socket);var jayson=require(_0x082b('0x1e'));var client=jayson[_0x082b('0x1f')][_0x082b('0x20')]({'port':0x232b});function checkPasswordPattern(_0x4d7ad9,_0x23e79c,_0x1dc46e){if(_0x1dc46e){var _0x49db08=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x49db08[_0x082b('0x21')](_0x23e79c)){return _0x4d7ad9;}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 _0x4d7ad9;}}function respondWithRpcPromise(_0xb373c9,_0x115675,_0x4e5791,_0x135785){return new BPromise(function(_0x4785fb,_0x2442d1){var _0x3aa0ed=_0x135785||client;return _0x3aa0ed['request'](_0xb373c9,_0x4e5791)[_0x082b('0x22')](function(_0x2d5cbc){logger[_0x082b('0x23')](_0x082b('0x24'),_0x115675,_0x082b('0x25'));logger[_0x082b('0x26')](_0x082b('0x27'),_0x115675,_0x082b('0x25'),JSON['stringify'](_0x2d5cbc));if(_0x2d5cbc[_0x082b('0x28')]){if(_0x2d5cbc[_0x082b('0x28')][_0x082b('0x29')]===0x1f4){logger['error'](_0x082b('0x24'),_0x115675,_0x2d5cbc[_0x082b('0x28')][_0x082b('0x2a')]);return _0x2442d1(_0x2d5cbc['error']['message']);}logger[_0x082b('0x28')]('MailAccount,\x20%s,\x20%s',_0x115675,_0x2d5cbc['error'][_0x082b('0x2a')]);return _0x4785fb(_0x2d5cbc[_0x082b('0x28')][_0x082b('0x2a')]);}else{logger[_0x082b('0x23')](_0x082b('0x24'),_0x115675,'request\x20sent');_0x4785fb(_0x2d5cbc[_0x082b('0x2b')][_0x082b('0x2a')]);}})[_0x082b('0x2c')](function(_0x1082bf){logger[_0x082b('0x28')](_0x082b('0x24'),_0x115675,_0x1082bf);_0x2442d1(_0x1082bf);});});}function respondWithStatusCode(_0x1b6dfc,_0x4e30e8){_0x4e30e8=_0x4e30e8||0xcc;return function(_0x20ff4a){if(_0x20ff4a){return _0x1b6dfc['sendStatus'](_0x4e30e8);}return _0x1b6dfc[_0x082b('0x2d')](_0x4e30e8)['end']();};}function respondWithResult(_0x505e48,_0x15c093){_0x15c093=_0x15c093||0xc8;return function(_0x545fd6){if(_0x545fd6){return _0x505e48[_0x082b('0x2d')](_0x15c093)['json'](_0x545fd6);}};}function respondWithFilteredResult(_0x228a5a,_0x55d059){return function(_0x528e52){if(_0x528e52){var _0x25dcaf=_0x528e52[_0x082b('0x2e')],_0x1f8ce4=_0x55d059[_0x082b('0x2f')],_0x23b651=_0x55d059[_0x082b('0x2f')]+_0x55d059[_0x082b('0x30')],_0x2f4e63;if(_0x23b651>=_0x25dcaf){_0x23b651=_0x25dcaf;_0x2f4e63=0xc8;}else{_0x2f4e63=0xce;}_0x228a5a[_0x082b('0x2d')](_0x2f4e63);return _0x228a5a[_0x082b('0x31')](_0x082b('0x32'),_0x1f8ce4+'-'+_0x23b651+'/'+_0x25dcaf)['json'](_0x528e52);}return null;};}function patchUpdates(_0x2ed47f){return function(_0x32e57d){try{jsonpatch[_0x082b('0x33')](_0x32e57d,_0x2ed47f,!![]);}catch(_0x2ede9f){return BPromise[_0x082b('0x34')](_0x2ede9f);}return _0x32e57d['save']();};}function saveUpdates(_0x47c8e1,_0x465783){return function(_0x2de0bc){if(_0x2de0bc){return _0x2de0bc['update'](_0x47c8e1)[_0x082b('0x22')](function(_0x2e6bf6){return _0x2e6bf6;});}return null;};}function removeEntity(_0x4b97e2,_0x3fed1e){return function(_0x4b7c1b){if(_0x4b7c1b){return _0x4b7c1b[_0x082b('0x35')]()[_0x082b('0x22')](function(){var _0x55e89e=_0x4b7c1b[_0x082b('0x36')]({'plain':!![]});var _0x17570=_0x082b('0x37');return db[_0x082b('0x38')][_0x082b('0x35')]({'where':{'type':_0x17570,'resourceId':_0x55e89e['id']}})['then'](function(){return _0x4b7c1b;});})[_0x082b('0x22')](function(){_0x4b97e2['status'](0xcc)[_0x082b('0x39')]();});}};}function handleEntityNotFound(_0x458840,_0x40e422){return function(_0x441bb5){if(!_0x441bb5){_0x458840[_0x082b('0x3a')](0x194);}return _0x441bb5;};}function handleError(_0x122077,_0x6bf96c){_0x6bf96c=_0x6bf96c||0x1f4;return function(_0x133805){logger['error'](_0x133805[_0x082b('0x3b')]);if(_0x133805[_0x082b('0x3c')]){delete _0x133805['name'];}_0x122077[_0x082b('0x2d')](_0x6bf96c)[_0x082b('0x3d')](_0x133805);};}exports[_0x082b('0x3e')]=function(_0xe585f3,_0x4213a9){var _0x2c7d91={'include':[{'model':db['MailServerIn'],'as':_0x082b('0x3f')},{'model':db[_0x082b('0x40')],'as':_0x082b('0x41')},{'model':db[_0x082b('0x42')],'as':'mandatoryDispositionPause'}]},_0xe01d7a={},_0x65836e={'count':0x0,'rows':[]};var _0x3f182d=db[_0x082b('0x43')][_0x082b('0x44')];_0xe01d7a[_0x082b('0x45')]=_[_0x082b('0x46')](_0x3f182d);_0xe01d7a['query']=_[_0x082b('0x46')](_0xe585f3[_0x082b('0x47')]);_0xe01d7a['filters']=_[_0x082b('0x48')](_0xe01d7a[_0x082b('0x45')],_0xe01d7a['query']);_0x2c7d91[_0x082b('0x49')]=_[_0x082b('0x48')](_0xe01d7a[_0x082b('0x45')],qs[_0x082b('0x4a')](_0xe585f3[_0x082b('0x47')][_0x082b('0x4a')]));_0x2c7d91[_0x082b('0x49')]=_0x2c7d91[_0x082b('0x49')][_0x082b('0x4b')]?_0x2c7d91['attributes']:_0xe01d7a[_0x082b('0x45')];if(!_0xe585f3[_0x082b('0x47')][_0x082b('0x4c')](_0x082b('0x4d'))){_0x2c7d91['limit']=qs[_0x082b('0x30')](_0xe585f3[_0x082b('0x47')][_0x082b('0x30')]);_0x2c7d91['offset']=qs[_0x082b('0x2f')](_0xe585f3[_0x082b('0x47')][_0x082b('0x2f')]);}_0x2c7d91[_0x082b('0x4e')]=qs[_0x082b('0x4f')](_0xe585f3[_0x082b('0x47')]['sort']);_0x2c7d91[_0x082b('0x50')]=qs[_0x082b('0x51')](_[_0x082b('0x52')](_0xe585f3[_0x082b('0x47')],_0xe01d7a[_0x082b('0x51')]));if(_0xe585f3[_0x082b('0x47')][_0x082b('0x53')]){_0x2c7d91[_0x082b('0x50')]=_['merge'](_0x2c7d91[_0x082b('0x50')],{'$or':_[_0x082b('0x54')](_0x3f182d,function(_0x44401f){if(_0x44401f['type'][_0x082b('0x55')]!==_0x082b('0x56')){var _0x4d2716={};_0x4d2716[_0x44401f[_0x082b('0x57')]]={'$like':'%'+_0xe585f3['query'][_0x082b('0x53')]+'%'};return _0x4d2716;}})});}_0x2c7d91=_[_0x082b('0x58')]({},_0x2c7d91,_0xe585f3[_0x082b('0x59')]);var _0x5bdeae={'where':_0x2c7d91[_0x082b('0x50')]};return db['MailAccount'][_0x082b('0x2e')](_0x5bdeae)['then'](function(_0x3d043c){_0x65836e['count']=_0x3d043c;if(_0xe585f3[_0x082b('0x47')][_0x082b('0x5a')]){_0x2c7d91[_0x082b('0x5b')]=[{'all':!![]}];}return db[_0x082b('0x43')][_0x082b('0x5c')](_0x2c7d91);})[_0x082b('0x22')](function(_0x230e77){_0x65836e['rows']=_0x230e77;return _0x65836e;})[_0x082b('0x22')](respondWithFilteredResult(_0x4213a9,_0x2c7d91))[_0x082b('0x2c')](handleError(_0x4213a9,null));};exports[_0x082b('0x5d')]=function(_0x57ed0a,_0x221b13){var _0x41d21c={'raw':![],'where':{'id':_0x57ed0a[_0x082b('0x5e')]['id']},'include':[{'model':db[_0x082b('0x5f')],'as':_0x082b('0x3f')},{'model':db[_0x082b('0x40')],'as':'Smtp'},{'model':db['Pause'],'as':_0x082b('0x60')}]},_0x874601={};_0x874601['model']=_[_0x082b('0x46')](db[_0x082b('0x43')][_0x082b('0x44')]);_0x874601['query']=_['keys'](_0x57ed0a['query']);_0x874601['filters']=_[_0x082b('0x48')](_0x874601[_0x082b('0x45')],_0x874601['query']);_0x41d21c[_0x082b('0x49')]=_[_0x082b('0x48')](_0x874601[_0x082b('0x45')],qs[_0x082b('0x4a')](_0x57ed0a['query'][_0x082b('0x4a')]));_0x41d21c[_0x082b('0x49')]=_0x41d21c[_0x082b('0x49')][_0x082b('0x4b')]?_0x41d21c[_0x082b('0x49')]:_0x874601['model'];if(_0x57ed0a[_0x082b('0x47')][_0x082b('0x5a')]){_0x41d21c['include']=[{'all':!![]}];}_0x41d21c=_[_0x082b('0x58')]({},_0x41d21c,_0x57ed0a[_0x082b('0x59')]);return db['MailAccount'][_0x082b('0x61')](_0x41d21c)['then'](handleEntityNotFound(_0x221b13,null))[_0x082b('0x22')](respondWithResult(_0x221b13,null))[_0x082b('0x2c')](handleError(_0x221b13,null));};exports['update']=function(_0xe0c2f5,_0x57830d){if(_0xe0c2f5[_0x082b('0x62')]['id']){delete _0xe0c2f5[_0x082b('0x62')]['id'];}return db['MailAccount']['find']({'where':{'id':_0xe0c2f5['params']['id']},'include':[{'model':db[_0x082b('0x5f')],'as':_0x082b('0x3f')},{'model':db[_0x082b('0x40')],'as':_0x082b('0x41')},{'model':db[_0x082b('0x42')],'as':_0x082b('0x60')}]})[_0x082b('0x22')](handleEntityNotFound(_0x57830d,null))[_0x082b('0x22')](saveUpdates(_0xe0c2f5['body'],null))[_0x082b('0x22')](function(_0x195328){if(_0x195328&&_0xe0c2f5['body'][_0x082b('0x3f')]){return db[_0x082b('0x5f')][_0x082b('0x63')](_0xe0c2f5[_0x082b('0x62')][_0x082b('0x3f')],{'where':{'MailAccountId':_0x195328['id']}})[_0x082b('0x22')](function(){return _0x195328;});}return _0x195328;})[_0x082b('0x22')](function(_0x4e1c12){if(_0x4e1c12&&_0xe0c2f5[_0x082b('0x62')][_0x082b('0x41')]){return db['MailServerOut'][_0x082b('0x63')](_0xe0c2f5[_0x082b('0x62')]['Smtp'],{'where':{'MailAccountId':_0x4e1c12['id']}})['then'](function(){return _0x4e1c12;});}return _0x4e1c12;})[_0x082b('0x22')](respondWithResult(_0x57830d,null))[_0x082b('0x2c')](handleError(_0x57830d,null));};exports[_0x082b('0x64')]=function(_0x3db2d9,_0x5e9ce6){return db[_0x082b('0x43')][_0x082b('0x64')]()['then'](respondWithResult(_0x5e9ce6,null))[_0x082b('0x2c')](handleError(_0x5e9ce6,null));};exports[_0x082b('0x65')]=function(_0x6c21f8,_0x36b87d,_0x49928b){if(_0x6c21f8[_0x082b('0x62')]['id']){delete _0x6c21f8[_0x082b('0x62')]['id'];}return db[_0x082b('0x43')][_0x082b('0x61')]({'where':{'id':_0x6c21f8[_0x082b('0x5e')]['id']}})[_0x082b('0x22')](handleEntityNotFound(_0x36b87d,null))[_0x082b('0x22')](function(_0x80ae28){if(_0x80ae28){_0x6c21f8[_0x082b('0x62')]['MailAccountId']=_0x80ae28['id'];return db[_0x082b('0x66')]['create'](_0x6c21f8[_0x082b('0x62')]);}})[_0x082b('0x22')](respondWithResult(_0x36b87d,null))['catch'](handleError(_0x36b87d,null));};exports[_0x082b('0x67')]=function(_0x54f66a,_0x592dac,_0x5a5f3e){var _0x551faa={'raw':![],'where':{}};var _0x222f47={};var _0x3a6af0={'count':0x0,'rows':[]};return db[_0x082b('0x43')][_0x082b('0x68')]({'where':{'id':_0x54f66a[_0x082b('0x5e')]['id']}})[_0x082b('0x22')](handleEntityNotFound(_0x592dac,null))['then'](function(_0x443813){if(_0x443813){_0x222f47[_0x082b('0x45')]=_['keys'](db[_0x082b('0x66')][_0x082b('0x44')]);_0x222f47[_0x082b('0x47')]=_[_0x082b('0x46')](_0x54f66a[_0x082b('0x47')]);_0x222f47[_0x082b('0x51')]=_[_0x082b('0x48')](_0x222f47[_0x082b('0x45')],_0x222f47[_0x082b('0x47')]);_0x551faa[_0x082b('0x49')]=_['intersection'](_0x222f47[_0x082b('0x45')],qs['fields'](_0x54f66a[_0x082b('0x47')][_0x082b('0x4a')]));_0x551faa[_0x082b('0x49')]=_0x551faa[_0x082b('0x49')][_0x082b('0x4b')]?_0x551faa[_0x082b('0x49')]:_0x222f47['model'];if(!_0x54f66a[_0x082b('0x47')][_0x082b('0x4c')](_0x082b('0x4d'))){_0x551faa[_0x082b('0x30')]=qs[_0x082b('0x30')](_0x54f66a[_0x082b('0x47')][_0x082b('0x30')]);_0x551faa['offset']=qs[_0x082b('0x2f')](_0x54f66a[_0x082b('0x47')]['offset']);}_0x551faa['order']=qs[_0x082b('0x4f')](_0x54f66a[_0x082b('0x47')]['sort']);_0x551faa['where']=qs[_0x082b('0x51')](_[_0x082b('0x52')](_0x54f66a[_0x082b('0x47')],_0x222f47[_0x082b('0x51')]));_0x551faa[_0x082b('0x50')]['MailAccountId']=_0x443813['id'];if(_0x54f66a[_0x082b('0x47')]['filter']){_0x551faa[_0x082b('0x50')]=_[_0x082b('0x58')](_0x551faa[_0x082b('0x50')],{'$or':_[_0x082b('0x54')](_0x551faa['attributes'],function(_0x22a449){var _0x32bbf1={};_0x32bbf1[_0x22a449]={'$like':'%'+_0x54f66a['query']['filter']+'%'};return _0x32bbf1;})});}_0x551faa=_[_0x082b('0x58')]({},_0x551faa,_0x54f66a[_0x082b('0x59')]);return db['Disposition']['count']({'where':_0x551faa[_0x082b('0x50')]})[_0x082b('0x22')](function(_0x5937bc){_0x3a6af0[_0x082b('0x2e')]=_0x5937bc;if(_0x54f66a[_0x082b('0x47')][_0x082b('0x5a')]){_0x551faa[_0x082b('0x5b')]=[{'all':!![]}];}return db[_0x082b('0x66')][_0x082b('0x5c')](_0x551faa);})[_0x082b('0x22')](function(_0x379bb3){_0x3a6af0[_0x082b('0x69')]=_0x379bb3;return _0x3a6af0;});}})['then'](respondWithFilteredResult(_0x592dac,_0x551faa))[_0x082b('0x2c')](handleError(_0x592dac,null));};exports[_0x082b('0x6a')]=function(_0x32e29b,_0x3fc060,_0x1a06e8){return db[_0x082b('0x43')]['find']({'where':{'id':_0x32e29b[_0x082b('0x5e')]['id']}})[_0x082b('0x22')](handleEntityNotFound(_0x3fc060,null))[_0x082b('0x22')](function(_0x31df16){if(_0x31df16){return _0x31df16[_0x082b('0x6a')](_0x32e29b[_0x082b('0x47')]['ids']);}})[_0x082b('0x22')](respondWithStatusCode(_0x3fc060,null))['catch'](handleError(_0x3fc060,null));};exports[_0x082b('0x6b')]=function(_0xdd0ee5,_0xf78c13,_0x45f9fd){if(_0xdd0ee5['body']['id']){delete _0xdd0ee5['body']['id'];}return db[_0x082b('0x43')][_0x082b('0x61')]({'where':{'id':_0xdd0ee5[_0x082b('0x5e')]['id']}})[_0x082b('0x22')](handleEntityNotFound(_0xf78c13,null))[_0x082b('0x22')](function(_0x36933a){if(_0x36933a){_0xdd0ee5[_0x082b('0x62')][_0x082b('0x6c')]=_0x36933a['id'];return db[_0x082b('0x6d')][_0x082b('0x6e')](_0xdd0ee5[_0x082b('0x62')]);}})[_0x082b('0x22')](respondWithResult(_0xf78c13,null))[_0x082b('0x2c')](handleError(_0xf78c13,null));};exports[_0x082b('0x6f')]=function(_0x47cd37,_0x25c384,_0x50c326){var _0x360a41={'raw':![],'where':{}};var _0x57a62a={};var _0x371667={'count':0x0,'rows':[]};return db[_0x082b('0x43')]['findOne']({'where':{'id':_0x47cd37['params']['id']}})['then'](handleEntityNotFound(_0x25c384,null))[_0x082b('0x22')](function(_0x128bf8){if(_0x128bf8){_0x57a62a[_0x082b('0x45')]=_[_0x082b('0x46')](db[_0x082b('0x6d')]['rawAttributes']);_0x57a62a[_0x082b('0x47')]=_['keys'](_0x47cd37[_0x082b('0x47')]);_0x57a62a['filters']=_[_0x082b('0x48')](_0x57a62a[_0x082b('0x45')],_0x57a62a[_0x082b('0x47')]);_0x360a41['attributes']=_['intersection'](_0x57a62a[_0x082b('0x45')],qs[_0x082b('0x4a')](_0x47cd37[_0x082b('0x47')][_0x082b('0x4a')]));_0x360a41[_0x082b('0x49')]=_0x360a41[_0x082b('0x49')][_0x082b('0x4b')]?_0x360a41['attributes']:_0x57a62a['model'];if(!_0x47cd37['query'][_0x082b('0x4c')](_0x082b('0x4d'))){_0x360a41[_0x082b('0x30')]=qs[_0x082b('0x30')](_0x47cd37['query'][_0x082b('0x30')]);_0x360a41['offset']=qs[_0x082b('0x2f')](_0x47cd37['query'][_0x082b('0x2f')]);}_0x360a41['order']=qs[_0x082b('0x4f')](_0x47cd37[_0x082b('0x47')][_0x082b('0x4f')]);_0x360a41[_0x082b('0x50')]=qs[_0x082b('0x51')](_[_0x082b('0x52')](_0x47cd37['query'],_0x57a62a['filters']));_0x360a41[_0x082b('0x50')][_0x082b('0x6c')]=_0x128bf8['id'];if(_0x47cd37['query'][_0x082b('0x53')]){_0x360a41[_0x082b('0x50')]=_['merge'](_0x360a41[_0x082b('0x50')],{'$or':_[_0x082b('0x54')](_0x360a41[_0x082b('0x49')],function(_0x196825){var _0x1025fc={};_0x1025fc[_0x196825]={'$like':'%'+_0x47cd37[_0x082b('0x47')][_0x082b('0x53')]+'%'};return _0x1025fc;})});}_0x360a41=_[_0x082b('0x58')]({},_0x360a41,_0x47cd37[_0x082b('0x59')]);return db[_0x082b('0x6d')][_0x082b('0x2e')]({'where':_0x360a41['where']})[_0x082b('0x22')](function(_0x40afe7){_0x371667[_0x082b('0x2e')]=_0x40afe7;if(_0x47cd37['query'][_0x082b('0x5a')]){_0x360a41[_0x082b('0x5b')]=[{'all':!![]}];}return db[_0x082b('0x6d')][_0x082b('0x5c')](_0x360a41);})[_0x082b('0x22')](function(_0xb0d7ce){_0x371667[_0x082b('0x69')]=_0xb0d7ce;return _0x371667;});}})[_0x082b('0x22')](respondWithFilteredResult(_0x25c384,_0x360a41))[_0x082b('0x2c')](handleError(_0x25c384,null));};exports['removeAnswers']=function(_0x3875e1,_0x335a29,_0x3a7a3c){return db[_0x082b('0x43')][_0x082b('0x61')]({'where':{'id':_0x3875e1[_0x082b('0x5e')]['id']}})['then'](handleEntityNotFound(_0x335a29,null))['then'](function(_0x4d6f59){if(_0x4d6f59){return _0x4d6f59[_0x082b('0x70')](_0x3875e1[_0x082b('0x47')]['ids']);}})[_0x082b('0x22')](respondWithStatusCode(_0x335a29,null))['catch'](handleError(_0x335a29,null));};exports[_0x082b('0x6e')]=function(_0x13ed99,_0x25199e){var _0x378a76={'name':_0x13ed99[_0x082b('0x62')]['name'],'key':_0x13ed99[_0x082b('0x62')]['key'],'email':_0x13ed99[_0x082b('0x62')][_0x082b('0x71')],'ListId':_0x13ed99[_0x082b('0x62')][_0x082b('0x72')],'active':!_[_0x082b('0x73')](_0x13ed99['body']['active'])?_0x13ed99[_0x082b('0x62')][_0x082b('0x74')]:!![],'description':_0x13ed99[_0x082b('0x62')][_0x082b('0x75')]||null,'Imap':{},'Smtp':{}};if(_[_0x082b('0x73')](_0x13ed99[_0x082b('0x62')][_0x082b('0x76')])){if(_0x13ed99[_0x082b('0x62')][_0x082b('0x77')]){_0x378a76['Imap'][_0x082b('0x78')]=_0x378a76[_0x082b('0x41')][_0x082b('0x78')]=_0x13ed99['body'][_0x082b('0x79')];_0x378a76[_0x082b('0x3f')]['password']=_0x378a76['Smtp'][_0x082b('0x7a')]=_0x13ed99[_0x082b('0x62')]['cpassword'];}else{_0x378a76[_0x082b('0x3f')][_0x082b('0x7b')]=_0x378a76[_0x082b('0x41')][_0x082b('0x7b')]=![];}_0x378a76['Imap'][_0x082b('0x7c')]=_0x13ed99[_0x082b('0x62')][_0x082b('0x3f')][_0x082b('0x7c')];_0x378a76['Imap'][_0x082b('0x7d')]=_0x13ed99[_0x082b('0x62')]['Imap'][_0x082b('0x7d')];_0x378a76[_0x082b('0x41')]['host']=_0x13ed99['body']['Smtp']['host'];_0x378a76['Smtp'][_0x082b('0x7d')]=_0x13ed99[_0x082b('0x62')][_0x082b('0x41')][_0x082b('0x7d')];}else{_0x378a76[_0x082b('0x3f')]['service']=_0x378a76[_0x082b('0x41')][_0x082b('0x7e')]=_0x13ed99[_0x082b('0x62')]['cservice'];_0x378a76[_0x082b('0x3f')][_0x082b('0x78')]=_0x378a76[_0x082b('0x41')][_0x082b('0x78')]=_0x13ed99[_0x082b('0x62')]['cuser'];_0x378a76[_0x082b('0x3f')][_0x082b('0x7f')]=_0x378a76[_0x082b('0x41')][_0x082b('0x7a')]=_0x13ed99[_0x082b('0x62')][_0x082b('0x80')];}return db['MailAccount'][_0x082b('0x6e')](_0x378a76,{'include':[{'model':db[_0x082b('0x40')],'as':_0x082b('0x41')},{'model':db[_0x082b('0x5f')],'as':_0x082b('0x3f')}]})[_0x082b('0x22')](function(_0x2bd796){var _0x37c96f=_0x13ed99[_0x082b('0x78')][_0x082b('0x36')]({'plain':!![]});if(!_0x37c96f)throw new Error(_0x082b('0x81'));if(_0x37c96f['role']===_0x082b('0x78')){var _0xac6f4a=_0x2bd796[_0x082b('0x36')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x082b('0x37'),'userProfileId':_0x37c96f['userProfileId']},'raw':!![]})[_0x082b('0x22')](function(_0x15cffa){if(_0x15cffa&&_0x15cffa[_0x082b('0x82')]===0x0){return db[_0x082b('0x38')][_0x082b('0x6e')]({'name':_0xac6f4a[_0x082b('0x3c')],'resourceId':_0xac6f4a['id'],'type':_0x15cffa[_0x082b('0x3c')],'sectionId':_0x15cffa['id']},{})[_0x082b('0x22')](function(){return _0x2bd796;});}else{return _0x2bd796;}})[_0x082b('0x2c')](function(_0x5392ae){logger[_0x082b('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5392ae);throw _0x5392ae;});}return _0x2bd796;})['then'](respondWithResult(_0x25199e,0xc9))[_0x082b('0x2c')](handleError(_0x25199e,null));};exports[_0x082b('0x83')]=function(_0x510694,_0x36ee2e,_0x27500f){return db[_0x082b('0x43')][_0x082b('0x68')]({'where':{'id':_0x510694['params']['id']}})[_0x082b('0x22')](handleEntityNotFound(_0x36ee2e,null))[_0x082b('0x22')](function(_0x3d7fb0){if(_0x3d7fb0){return _0x3d7fb0[_0x082b('0x83')]();}return null;})[_0x082b('0x22')](respondWithResult(_0x36ee2e,null))[_0x082b('0x2c')](handleError(_0x36ee2e,null));};exports[_0x082b('0x84')]=function(_0x202b9d,_0x59495f,_0x529837){if(_0x202b9d[_0x082b('0x62')]['id']){delete _0x202b9d[_0x082b('0x62')]['id'];}return db[_0x082b('0x43')][_0x082b('0x61')]({'where':{'id':_0x202b9d[_0x082b('0x5e')]['id']}})['then'](handleEntityNotFound(_0x59495f,null))[_0x082b('0x22')](function(_0x567ee1){if(_0x567ee1){_0x202b9d[_0x082b('0x62')][_0x082b('0x6c')]=_0x567ee1['id'];return db[_0x082b('0x5f')]['create'](_0x202b9d[_0x082b('0x62')]);}})[_0x082b('0x22')](respondWithResult(_0x59495f,null))[_0x082b('0x2c')](handleError(_0x59495f,null));};exports[_0x082b('0x85')]=function(_0x4d91ea,_0xdd789b,_0x5a5d12){return db[_0x082b('0x43')][_0x082b('0x68')]({'where':{'id':_0x4d91ea['params']['id']}})[_0x082b('0x22')](handleEntityNotFound(_0xdd789b,null))[_0x082b('0x22')](function(_0x3beef5){if(_0x3beef5){return _0x3beef5[_0x082b('0x86')](null);}return null;})['then'](respondWithStatusCode(_0xdd789b,null))[_0x082b('0x2c')](handleError(_0xdd789b,null));};exports[_0x082b('0x87')]=function(_0x3dd6a1,_0x15791e,_0x574309){return db[_0x082b('0x43')][_0x082b('0x68')]({'where':{'id':_0x3dd6a1[_0x082b('0x5e')]['id']}})[_0x082b('0x22')](handleEntityNotFound(_0x15791e,null))[_0x082b('0x22')](function(_0x597aba){if(_0x597aba){return _0x597aba[_0x082b('0x87')]();}return null;})['then'](respondWithResult(_0x15791e,null))['catch'](handleError(_0x15791e,null));};exports[_0x082b('0x88')]=function(_0x4c6ed0,_0x3d3ca4,_0x19e869){if(_0x4c6ed0['body']['id']){delete _0x4c6ed0[_0x082b('0x62')]['id'];}return db[_0x082b('0x43')][_0x082b('0x61')]({'where':{'id':_0x4c6ed0[_0x082b('0x5e')]['id']}})[_0x082b('0x22')](handleEntityNotFound(_0x3d3ca4,null))[_0x082b('0x22')](function(_0x55b4d4){if(_0x55b4d4){_0x4c6ed0['body']['MailAccountId']=_0x55b4d4['id'];return db[_0x082b('0x40')][_0x082b('0x6e')](_0x4c6ed0[_0x082b('0x62')]);}})[_0x082b('0x22')](respondWithResult(_0x3d3ca4,null))['catch'](handleError(_0x3d3ca4,null));};exports[_0x082b('0x89')]=function(_0x70b39f,_0x57abb1,_0x28ba00){return db[_0x082b('0x43')]['findOne']({'where':{'id':_0x70b39f[_0x082b('0x5e')]['id']}})[_0x082b('0x22')](handleEntityNotFound(_0x57abb1,null))['then'](function(_0x11d932){if(_0x11d932){return _0x11d932['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x57abb1,null))[_0x082b('0x2c')](handleError(_0x57abb1,null));};exports[_0x082b('0x8a')]=function(_0x345616,_0x18286b,_0xd0b810){return db['MailInteraction'][_0x082b('0x61')]({'where':{'id':_0x345616[_0x082b('0x5e')]['id']}})[_0x082b('0x22')](handleEntityNotFound(_0x18286b,null))[_0x082b('0x22')](function(_0x1675b3){if(_0x1675b3){return _0x1675b3[_0x082b('0x8a')](_0x345616[_0x082b('0x62')]['ids'],_[_0x082b('0x8b')](_0x345616[_0x082b('0x62')],[_0x082b('0x8c'),'id'])||{});}})[_0x082b('0x22')](respondWithResult(_0x18286b,null))[_0x082b('0x2c')](handleError(_0x18286b,null));};exports[_0x082b('0x8d')]=function(_0x54b5ea,_0x4a261e,_0x52f574){var _0x5d2ab6={'raw':![],'where':{}};var _0x108dba={};var _0x4ad98c={'count':0x0,'rows':[]};return db[_0x082b('0x43')][_0x082b('0x68')]({'where':{'id':_0x54b5ea[_0x082b('0x5e')]['id']}})[_0x082b('0x22')](handleEntityNotFound(_0x4a261e,null))[_0x082b('0x22')](function(_0xe0250a){if(_0xe0250a){_0x108dba['model']=_[_0x082b('0x46')](db[_0x082b('0x8e')]['rawAttributes']);_0x108dba[_0x082b('0x47')]=_[_0x082b('0x46')](_0x54b5ea[_0x082b('0x47')]);_0x108dba['filters']=_[_0x082b('0x48')](_0x108dba[_0x082b('0x45')],_0x108dba[_0x082b('0x47')]);_0x5d2ab6['attributes']=_[_0x082b('0x48')](_0x108dba[_0x082b('0x45')],qs[_0x082b('0x4a')](_0x54b5ea[_0x082b('0x47')][_0x082b('0x4a')]));_0x5d2ab6['attributes']=_0x5d2ab6[_0x082b('0x49')][_0x082b('0x4b')]?_0x5d2ab6[_0x082b('0x49')]:_0x108dba[_0x082b('0x45')];if(!_0x54b5ea[_0x082b('0x47')]['hasOwnProperty'](_0x082b('0x4d'))){_0x5d2ab6[_0x082b('0x30')]=qs[_0x082b('0x30')](_0x54b5ea[_0x082b('0x47')][_0x082b('0x30')]);_0x5d2ab6[_0x082b('0x2f')]=qs[_0x082b('0x2f')](_0x54b5ea[_0x082b('0x47')][_0x082b('0x2f')]);}_0x5d2ab6[_0x082b('0x4e')]=qs[_0x082b('0x4f')](_0x54b5ea[_0x082b('0x47')][_0x082b('0x4f')]);_0x5d2ab6[_0x082b('0x50')]=qs[_0x082b('0x51')](_[_0x082b('0x52')](_0x54b5ea[_0x082b('0x47')],_0x108dba[_0x082b('0x51')]));_0x5d2ab6[_0x082b('0x50')][_0x082b('0x6c')]=_0xe0250a['id'];if(_0x54b5ea[_0x082b('0x47')][_0x082b('0x53')]){_0x5d2ab6['where']=_[_0x082b('0x58')](_0x5d2ab6['where'],{'$or':_['map'](_0x5d2ab6[_0x082b('0x49')],function(_0x51a862){var _0x150f4f={};_0x150f4f[_0x51a862]={'$like':'%'+_0x54b5ea[_0x082b('0x47')]['filter']+'%'};return _0x150f4f;})});}_0x5d2ab6=_[_0x082b('0x58')]({},_0x5d2ab6,_0x54b5ea[_0x082b('0x59')]);return db[_0x082b('0x8e')]['count']({'where':_0x5d2ab6[_0x082b('0x50')]})[_0x082b('0x22')](function(_0x255a24){_0x4ad98c['count']=_0x255a24;if(_0x54b5ea[_0x082b('0x47')][_0x082b('0x5a')]){_0x5d2ab6[_0x082b('0x5b')]=[{'model':db[_0x082b('0x8f')],'as':_0x082b('0x90'),'required':![]},{'model':db[_0x082b('0x91')],'as':_0x082b('0x92'),'attributes':[_0x082b('0x3c'),_0x082b('0x93'),_0x082b('0x94')],'required':![]},{'model':db['Tag'],'as':_0x082b('0x95'),'attributes':['id',_0x082b('0x3c'),_0x082b('0x96')],'where':_0x54b5ea['query'][_0x082b('0x97')]?{'id':_0x54b5ea[_0x082b('0x47')][_0x082b('0x97')]}:undefined,'required':_0x54b5ea[_0x082b('0x47')][_0x082b('0x97')]?!![]:![]}];}return db[_0x082b('0x8e')][_0x082b('0x5c')](_0x5d2ab6);})[_0x082b('0x22')](function(_0xb30ffd){_0x4ad98c[_0x082b('0x69')]=_0xb30ffd;return _0x4ad98c;});}})[_0x082b('0x22')](respondWithFilteredResult(_0x4a261e,_0x5d2ab6))['catch'](handleError(_0x4a261e,null));};exports['addApplications']=function(_0x39def5,_0x3fb4f0,_0x510574){return db[_0x082b('0x43')][_0x082b('0x68')]({'where':{'id':_0x39def5[_0x082b('0x5e')]['id']}})[_0x082b('0x22')](handleEntityNotFound(_0x3fb4f0,null))['then'](function(_0x373796){if(_0x373796){return db['sequelize']['transaction'](function(_0x566b9f){return db['MailApplication'][_0x082b('0x35')]({'where':{'MailAccountId':_0x39def5['params']['id']},'transaction':_0x566b9f})[_0x082b('0x22')](function(_0xd96e26){var _0x5ac20f=_[_0x082b('0x54')](_0x39def5[_0x082b('0x62')],function(_0x437490){_0x437490[_0x082b('0x6c')]=_0x39def5[_0x082b('0x5e')]['id'];return _0x437490;});return db[_0x082b('0x98')]['bulkCreate'](_0x5ac20f,{'transaction':_0x566b9f});});})[_0x082b('0x22')](function(){return db['MailApplication'][_0x082b('0x99')]({'where':{'MailAccountId':_0x39def5['params']['id']},'order':_0x082b('0x9a')});});}})['then'](respondWithResult(_0x3fb4f0,null))['catch'](handleError(_0x3fb4f0,null));};exports['getApplications']=function(_0x3611b7,_0x462faa,_0x9f938f){var _0x3e5ec5={};var _0x3d291b={};var _0x251eb7;var _0x7a7bfe;return db[_0x082b('0x43')][_0x082b('0x68')]({'where':{'id':_0x3611b7[_0x082b('0x5e')]['id']}})[_0x082b('0x22')](handleEntityNotFound(_0x462faa,null))['then'](function(_0xf8ca66){if(_0xf8ca66){_0x251eb7=_0xf8ca66;_0x3d291b[_0x082b('0x45')]=_[_0x082b('0x46')](db[_0x082b('0x98')][_0x082b('0x44')]);_0x3d291b[_0x082b('0x47')]=_[_0x082b('0x46')](_0x3611b7[_0x082b('0x47')]);_0x3d291b['filters']=_['intersection'](_0x3d291b[_0x082b('0x45')],_0x3d291b[_0x082b('0x47')]);_0x3e5ec5[_0x082b('0x49')]=_[_0x082b('0x48')](_0x3d291b[_0x082b('0x45')],qs['fields'](_0x3611b7[_0x082b('0x47')][_0x082b('0x4a')]));_0x3e5ec5[_0x082b('0x49')]=_0x3e5ec5[_0x082b('0x49')]['length']?_0x3e5ec5['attributes']:_0x3d291b[_0x082b('0x45')];_0x3e5ec5[_0x082b('0x4e')]=qs[_0x082b('0x4f')](_0x3611b7[_0x082b('0x47')][_0x082b('0x4f')]);_0x3e5ec5[_0x082b('0x50')]=qs[_0x082b('0x51')](_[_0x082b('0x52')](_0x3611b7[_0x082b('0x47')],_0x3d291b[_0x082b('0x51')]));if(_0x3611b7[_0x082b('0x47')]['filter']){_0x3e5ec5[_0x082b('0x50')]=_[_0x082b('0x58')](_0x3e5ec5[_0x082b('0x50')],{'$or':_[_0x082b('0x54')](_0x3e5ec5['attributes'],function(_0x405603){var _0x470e15={};_0x470e15[_0x405603]={'$like':'%'+_0x3611b7[_0x082b('0x47')][_0x082b('0x53')]+'%'};return _0x470e15;})});}_0x3e5ec5=_[_0x082b('0x58')]({},_0x3e5ec5,_0x3611b7[_0x082b('0x59')]);return _0x251eb7[_0x082b('0x9b')](_0x3e5ec5);}})['then'](function(_0x5030cd){if(_0x5030cd){_0x7a7bfe=_0x5030cd['length'];if(!_0x3611b7['query'][_0x082b('0x4c')](_0x082b('0x4d'))){_0x3e5ec5[_0x082b('0x30')]=qs[_0x082b('0x30')](_0x3611b7['query'][_0x082b('0x30')]);_0x3e5ec5[_0x082b('0x2f')]=qs[_0x082b('0x2f')](_0x3611b7['query'][_0x082b('0x2f')]);}return _0x251eb7[_0x082b('0x9b')](_0x3e5ec5);}})[_0x082b('0x22')](function(_0x421f4a){if(_0x421f4a){return _0x421f4a?{'count':_0x7a7bfe,'rows':_0x421f4a}:null;}})[_0x082b('0x22')](respondWithResult(_0x462faa,null))[_0x082b('0x2c')](handleError(_0x462faa,null));};exports[_0x082b('0x9c')]=function(_0x4260ec,_0x21d5a9,_0x109b9b){var _0x56d405={'raw':!![],'where':{}};var _0x9505ef={};var _0x1e8598={'count':0x0,'rows':[]};return db[_0x082b('0x43')][_0x082b('0x68')]({'where':{'id':_0x4260ec[_0x082b('0x5e')]['id']}})[_0x082b('0x22')](handleEntityNotFound(_0x21d5a9,null))[_0x082b('0x22')](function(_0x5d6a79){if(_0x5d6a79){_0x9505ef[_0x082b('0x45')]=_[_0x082b('0x46')](db[_0x082b('0x9d')][_0x082b('0x44')]);_0x9505ef[_0x082b('0x47')]=_[_0x082b('0x46')](_0x4260ec['query']);_0x9505ef[_0x082b('0x51')]=_[_0x082b('0x48')](_0x9505ef[_0x082b('0x45')],_0x9505ef[_0x082b('0x47')]);_0x56d405[_0x082b('0x49')]=_[_0x082b('0x48')](_0x9505ef[_0x082b('0x45')],qs[_0x082b('0x4a')](_0x4260ec[_0x082b('0x47')][_0x082b('0x4a')]));_0x56d405[_0x082b('0x49')]=_0x56d405[_0x082b('0x49')][_0x082b('0x4b')]?_0x56d405[_0x082b('0x49')]:_0x9505ef[_0x082b('0x45')];if(!_0x4260ec[_0x082b('0x47')][_0x082b('0x4c')](_0x082b('0x4d'))){_0x56d405['limit']=qs[_0x082b('0x30')](_0x4260ec[_0x082b('0x47')][_0x082b('0x30')]);_0x56d405[_0x082b('0x2f')]=qs[_0x082b('0x2f')](_0x4260ec['query']['offset']);}_0x56d405['order']=qs[_0x082b('0x4f')](_0x4260ec[_0x082b('0x47')][_0x082b('0x4f')]);_0x56d405[_0x082b('0x50')]=qs[_0x082b('0x51')](_[_0x082b('0x52')](_0x4260ec['query'],_0x9505ef[_0x082b('0x51')]));_0x56d405['where']['MailAccountId']=_0x5d6a79['id'];if(_0x4260ec['query'][_0x082b('0x53')]){_0x56d405[_0x082b('0x50')]=_['merge'](_0x56d405[_0x082b('0x50')],{'$or':_[_0x082b('0x54')](_0x56d405[_0x082b('0x49')],function(_0x62a2c2){var _0x433385={};_0x433385[_0x62a2c2]={'$like':'%'+_0x4260ec[_0x082b('0x47')][_0x082b('0x53')]+'%'};return _0x433385;})});}if(_0x4260ec[_0x082b('0x47')][_0x082b('0x9e')]){var _0x1e829e=_0x4260ec[_0x082b('0x47')][_0x082b('0x9e')]['split'](',');var _0x5a34f9={};_0x5a34f9[_0x1e829e[0x0]]={'$gte':moment(_0x1e829e[0x1])[_0x082b('0x9f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x56d405['where']=_[_0x082b('0x58')](_0x56d405[_0x082b('0x50')],_0x5a34f9);}_0x56d405=_[_0x082b('0x58')]({},_0x56d405,_0x4260ec[_0x082b('0x59')]);return db[_0x082b('0x9d')][_0x082b('0x2e')]({'where':_0x56d405[_0x082b('0x50')]})[_0x082b('0x22')](function(_0x77180f){_0x1e8598['count']=_0x77180f;if(_0x4260ec[_0x082b('0x47')][_0x082b('0x5a')]){_0x56d405[_0x082b('0x5b')]=[{'all':!![]}];}return db[_0x082b('0x9d')][_0x082b('0x5c')](_0x56d405);})[_0x082b('0x22')](function(_0xb784c3){_0x1e8598[_0x082b('0x69')]=_0xb784c3;return _0x1e8598;});}})[_0x082b('0x22')](respondWithFilteredResult(_0x21d5a9,_0x56d405))[_0x082b('0x2c')](handleError(_0x21d5a9,null));};exports[_0x082b('0x3d')]=function(_0x150f0d,_0x3537d6,_0x53765a){var _0x572ae3,_0x483c67={},_0x1b63be;if(_0x150f0d[_0x082b('0x62')]['to']){_0x1b63be=_0x150f0d[_0x082b('0x62')]['to'][_0x082b('0xa0')](',')[0x0];}return db[_0x082b('0x43')][_0x082b('0x61')]({'where':{'id':_0x150f0d[_0x082b('0x5e')]['id']},'include':[{'model':db[_0x082b('0xa1')],'as':_0x082b('0xa2'),'include':[{'model':db[_0x082b('0x8f')],'as':'Contacts','where':{'email':_0x1b63be},'limit':0x1,'order':[['updatedAt',_0x082b('0xa3')]]}]},{'model':db['MailServerOut'],'as':_0x082b('0x41'),'raw':!![]}]})[_0x082b('0x22')](handleEntityNotFound(_0x3537d6,null))[_0x082b('0x22')](function(_0x48a013){if(_0x48a013){_0x572ae3=_0x48a013;if(_0x48a013['Smtp']){if(_['isNil'](_0x150f0d['body']['from'])){_0x150f0d[_0x082b('0x62')][_0x082b('0xa4')]=util[_0x082b('0x9f')](_0x082b('0xa5'),_0x48a013[_0x082b('0x3c')],_0x48a013[_0x082b('0x71')]||_0x48a013[_0x082b('0x41')][_0x082b('0x78')]);}if(_0x150f0d[_0x082b('0x62')][_0x082b('0xa6')]&&_0x150f0d[_0x082b('0x62')][_0x082b('0xa6')][_0x082b('0x4b')]){for(var _0x381128=0x0;_0x381128<_0x150f0d[_0x082b('0x62')][_0x082b('0xa6')][_0x082b('0x4b')];_0x381128+=0x1){_0x150f0d[_0x082b('0x62')][_0x082b('0xa6')][_0x381128]={'filename':_0x150f0d[_0x082b('0x62')]['attachments'][_0x381128]['name'],'path':path[_0x082b('0xa7')](config[_0x082b('0xa8')],'server/files/attachments',_0x150f0d[_0x082b('0x62')][_0x082b('0xa6')][_0x381128][_0x082b('0xa9')])};}}var _0x53f00c={'tls':{'rejectUnauthorized':![]}};if(_[_0x082b('0x73')](_0x48a013[_0x082b('0x41')][_0x082b('0x7e')])){if(_0x48a013[_0x082b('0x41')]['authentication']){_0x53f00c[_0x082b('0xaa')]={'user':_0x48a013['Smtp'][_0x082b('0x78')],'pass':_0x48a013[_0x082b('0x41')][_0x082b('0x7a')]};}_0x53f00c['host']=_0x48a013['Smtp']['host'];_0x53f00c[_0x082b('0x7d')]=_0x48a013[_0x082b('0x41')][_0x082b('0x7d')];_0x53f00c[_0x082b('0xab')]=_0x48a013[_0x082b('0x41')][_0x082b('0xab')];}else{_0x53f00c[_0x082b('0x7e')]=_0x48a013[_0x082b('0x41')][_0x082b('0x7e')];_0x53f00c['auth']={'user':_0x48a013[_0x082b('0x41')][_0x082b('0x78')],'pass':_0x48a013[_0x082b('0x41')][_0x082b('0x7a')]};}return respondWithRpcPromise('SendMail',_0x082b('0xac'),{'account':_0x53f00c,'message':_0x150f0d['body']});}else{throw new Error(_0x082b('0xad'));}}})['then'](function(_0x106f1c){if(_0x106f1c){_0x483c67=_0x106f1c;if(_0x572ae3[_0x082b('0xa2')]){if(_0x572ae3[_0x082b('0xa2')][_0x082b('0xae')]['length']){return _0x572ae3['List']['Contacts'][0x0];}else{return db['CmContact'][_0x082b('0x6e')](_[_0x082b('0xaf')](_0x150f0d[_0x082b('0x62')],{'firstName':_0x150f0d['body']['to'],'email':_0x150f0d[_0x082b('0x62')]['to'],'phone':_0x150f0d[_0x082b('0x62')]['to'],'ListId':_0x572ae3['ListId']}));}}else{throw new Error(_0x082b('0xad'));}}})['then'](function(_0x4f9f76){if(_0x4f9f76){var _0x5a28fa={'UserId':_0x150f0d[_0x082b('0x78')]['id'],'ContactId':_0x4f9f76['id'],'MailAccountId':_0x572ae3['id'],'inReplyTo':_0x483c67[_0x082b('0xb0')],'to':_0x150f0d['body'][_0x082b('0xa4')],'cc':_0x150f0d[_0x082b('0x62')]['cc'],'subject':_0x150f0d[_0x082b('0x62')][_0x082b('0xb1')],'attach':_0x150f0d[_0x082b('0x62')]['attach'],'firstMsgDirection':_0x082b('0xb2'),'lastMsgAt':moment()['format'](_0x082b('0xb3')),'lastMsgDirection':_0x082b('0xb2'),'lastMsgBody':_0x150f0d[_0x082b('0x62')][_0x082b('0x62')],'Messages':[_[_0x082b('0x58')](_0x150f0d['body'],{'messageId':_0x483c67[_0x082b('0xb0')],'sentAt':moment()[_0x082b('0x9f')](_0x082b('0xb3')),'read':!![],'MailAccountId':_0x572ae3['id'],'UserId':_0x150f0d[_0x082b('0x78')]['id'],'ContactId':_0x4f9f76['id']})]};if(_0x150f0d[_0x082b('0x62')][_0x082b('0xb4')]){_0x5a28fa=_[_0x082b('0x58')](_0x5a28fa,_0x150f0d[_0x082b('0x62')]['Interaction']);}return db[_0x082b('0x8e')][_0x082b('0x6e')](_0x5a28fa,{'include':[{'model':db[_0x082b('0x9d')],'as':_0x082b('0xb5')}]});}})[_0x082b('0x22')](respondWithResult(_0x3537d6,null))['catch'](handleError(_0x3537d6,null));};exports[_0x082b('0xb6')]=function(_0x567326,_0x3efa0b,_0x6e0516){return db['MailAccount'][_0x082b('0x61')]({'where':{'id':_0x567326[_0x082b('0x5e')]['id']},'include':[{'model':db[_0x082b('0x40')],'as':_0x082b('0x41'),'raw':!![]}]})[_0x082b('0x22')](handleEntityNotFound(_0x3efa0b,null))['then'](function(_0x348976){if(_0x348976&&_0x348976[_0x082b('0x41')]){var _0x1dd180={'id':_0x348976['id'],'tls':{'rejectUnauthorized':![]}};if(_0x348976[_0x082b('0x41')]['service']){_0x1dd180[_0x082b('0x7e')]=_0x348976[_0x082b('0x41')][_0x082b('0x7e')];}else{_0x1dd180['host']=_0x348976['Smtp'][_0x082b('0x7c')];_0x1dd180['port']=_0x348976['Smtp'][_0x082b('0x7d')];_0x1dd180[_0x082b('0xab')]=_0x348976[_0x082b('0x41')][_0x082b('0xab')];}if(_0x348976['Smtp'][_0x082b('0x7b')]){_0x1dd180[_0x082b('0xaa')]={'user':_0x348976[_0x082b('0x41')][_0x082b('0x78')],'pass':_0x348976[_0x082b('0x41')][_0x082b('0x7a')]};}return respondWithRpcPromise(_0x082b('0xb7'),_0x082b('0xb6'),{'account':_0x1dd180});}})[_0x082b('0x22')](respondWithResult(_0x3efa0b,null))[_0x082b('0x2c')](handleError(_0x3efa0b,null));};exports[_0x082b('0x35')]=function(_0x574e5d,_0x502907){return db[_0x082b('0x43')][_0x082b('0x61')]({'where':{'id':_0x574e5d[_0x082b('0x5e')]['id']}})[_0x082b('0x22')](handleEntityNotFound(_0x502907,null))[_0x082b('0x22')](function(_0x201df1){if(_0x201df1&&_0x201df1[_0x082b('0x7e')]){throw new db[(_0x082b('0xb8'))][(_0x082b('0xb9'))](_0x082b('0xba'));}return _0x201df1;})[_0x082b('0x22')](removeEntity(_0x502907,null))[_0x082b('0x2c')](handleError(_0x502907,null));};exports[_0x082b('0xbb')]=function(_0xd292ed,_0x3e43bd,_0x4bfdbf){return db['MailAccount']['find']({'where':{'id':_0xd292ed['params']['id']}})[_0x082b('0x22')](handleEntityNotFound(_0x3e43bd,null))[_0x082b('0x22')](function(_0x1a13c6){if(_0x1a13c6){return _0x1a13c6[_0x082b('0xbb')](_0xd292ed[_0x082b('0x62')][_0x082b('0x8c')],_[_0x082b('0x8b')](_0xd292ed[_0x082b('0x62')],[_0x082b('0x8c'),'id'])||{})[_0x082b('0xbc')](function(_0x2b05a8){for(var _0x17e740=0x0;_0x17e740<_0xd292ed[_0x082b('0x62')][_0x082b('0x8c')]['length'];_0x17e740+=0x1){socket[_0x082b('0xbd')](_0x082b('0xbe'),{'UserId':_0xd292ed['body'][_0x082b('0x8c')][_0x17e740],'MailAccountId':_0xd292ed[_0x082b('0x5e')]['id']});}return _0x2b05a8;});}})['then'](respondWithResult(_0x3e43bd,null))[_0x082b('0x2c')](handleError(_0x3e43bd,null));};exports[_0x082b('0xbf')]=function(_0x341e00,_0x5d66c4,_0x5f26b3){return db[_0x082b('0x43')][_0x082b('0x61')]({'where':{'id':_0x341e00[_0x082b('0x5e')]['id']}})[_0x082b('0x22')](handleEntityNotFound(_0x5d66c4,null))['then'](function(_0xeacd36){if(_0xeacd36){return _0xeacd36[_0x082b('0xbf')](_0x341e00[_0x082b('0x47')][_0x082b('0x8c')])[_0x082b('0x22')](function(){if(_['isArray'](_0x341e00[_0x082b('0x47')][_0x082b('0x8c')])){for(var _0x37d028=0x0;_0x37d028<_0x341e00[_0x082b('0x47')][_0x082b('0x8c')][_0x082b('0x4b')];_0x37d028+=0x1){socket[_0x082b('0xbd')](_0x082b('0xc0'),{'UserId':Number(_0x341e00[_0x082b('0x47')][_0x082b('0x8c')][_0x37d028]),'MailAccountId':Number(_0x341e00[_0x082b('0x5e')]['id'])});}}else{socket['emit'](_0x082b('0xc0'),{'UserId':Number(_0x341e00['query']['ids']),'MailAccountId':Number(_0x341e00['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5d66c4,null))[_0x082b('0x2c')](handleError(_0x5d66c4,null));};exports[_0x082b('0xc1')]=function(_0x3ec5fe,_0x4da2a5,_0x51568a){var _0x24dfdd={};var _0x3255c2={};var _0x1f3d23;var _0x2fd428;return db[_0x082b('0x43')][_0x082b('0x68')]({'where':{'id':_0x3ec5fe[_0x082b('0x5e')]['id']}})[_0x082b('0x22')](handleEntityNotFound(_0x4da2a5,null))[_0x082b('0x22')](function(_0x4379cb){if(_0x4379cb){_0x1f3d23=_0x4379cb;_0x3255c2[_0x082b('0x45')]=_[_0x082b('0x46')](db[_0x082b('0x91')]['rawAttributes']);_0x3255c2[_0x082b('0x47')]=_[_0x082b('0x46')](_0x3ec5fe[_0x082b('0x47')]);_0x3255c2[_0x082b('0x51')]=_[_0x082b('0x48')](_0x3255c2[_0x082b('0x45')],_0x3255c2['query']);_0x24dfdd[_0x082b('0x49')]=_[_0x082b('0x48')](_0x3255c2[_0x082b('0x45')],qs[_0x082b('0x4a')](_0x3ec5fe[_0x082b('0x47')][_0x082b('0x4a')]));_0x24dfdd[_0x082b('0x49')]=_0x24dfdd['attributes']['length']?_0x24dfdd[_0x082b('0x49')]:_0x3255c2['model'];_0x24dfdd[_0x082b('0x4e')]=qs[_0x082b('0x4f')](_0x3ec5fe[_0x082b('0x47')][_0x082b('0x4f')]);_0x24dfdd[_0x082b('0x50')]=qs[_0x082b('0x51')](_[_0x082b('0x52')](_0x3ec5fe['query'],_0x3255c2['filters']));if(_0x3ec5fe['query']['filter']){_0x24dfdd[_0x082b('0x50')]=_[_0x082b('0x58')](_0x24dfdd[_0x082b('0x50')],{'$or':_[_0x082b('0x54')](_0x24dfdd['attributes'],function(_0x56c560){var _0x500c9d={};_0x500c9d[_0x56c560]={'$like':'%'+_0x3ec5fe[_0x082b('0x47')][_0x082b('0x53')]+'%'};return _0x500c9d;})});}_0x24dfdd=_[_0x082b('0x58')]({},_0x24dfdd,_0x3ec5fe[_0x082b('0x59')]);return _0x1f3d23[_0x082b('0xc1')](_0x24dfdd);}})['then'](function(_0x85d4f9){if(_0x85d4f9){_0x2fd428=_0x85d4f9[_0x082b('0x4b')];if(!_0x3ec5fe[_0x082b('0x47')][_0x082b('0x4c')](_0x082b('0x4d'))){_0x24dfdd['limit']=qs[_0x082b('0x30')](_0x3ec5fe[_0x082b('0x47')]['limit']);_0x24dfdd[_0x082b('0x2f')]=qs['offset'](_0x3ec5fe[_0x082b('0x47')][_0x082b('0x2f')]);}return _0x1f3d23[_0x082b('0xc1')](_0x24dfdd);}})[_0x082b('0x22')](function(_0x302f4c){if(_0x302f4c){return _0x302f4c?{'count':_0x2fd428,'rows':_0x302f4c}:null;}})[_0x082b('0x22')](respondWithResult(_0x4da2a5,null))[_0x082b('0x2c')](handleError(_0x4da2a5,null));}; \ No newline at end of file +var _0x2948=['secure','auth','SendMail','sendMail','Contacts','messageId','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','removeAgents','isArray','emit','getAgents','User','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','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','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','end','json','offset','set','reject','save','update','destroy','MailAccounts','UserProfileResource','stack','name','send','index','MailServerIn','MailServerOut','Smtp','mandatoryDispositionPause','MailAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','field','options','count','include','findAll','rows','catch','params','Imap','includeAll','find','body','Pause','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','nolimit','removeDispositions','ids','CannedAnswer','removeAnswers','key','ListId','active','isNil','cservice','user','cuser','pass','authentication','host','port','service','password','cpassword','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','removeSmtp','addInteraction','MailInteraction','omit','CmContact','Contact','Owner','fullname','internal','Tag','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','priority','getApplications','getMessages','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','List','from','format','%s\x20<%s>','email','attachments','join','root','basename'];(function(_0x411172,_0x5f3b53){var _0x489979=function(_0x295d59){while(--_0x295d59){_0x411172['push'](_0x411172['shift']());}};_0x489979(++_0x5f3b53);}(_0x2948,0xcb));var _0x8294=function(_0x2d3ac6,_0x1e61e4){_0x2d3ac6=_0x2d3ac6-0x0;var _0x24eef8=_0x2948[_0x2d3ac6];return _0x24eef8;};'use strict';var pdf=require(_0x8294('0x0'));var emlformat=require(_0x8294('0x1'));var rimraf=require(_0x8294('0x2'));var zipdir=require(_0x8294('0x3'));var jsonpatch=require(_0x8294('0x4'));var rp=require(_0x8294('0x5'));var moment=require(_0x8294('0x6'));var BPromise=require(_0x8294('0x7'));var Mustache=require(_0x8294('0x8'));var util=require('util');var path=require(_0x8294('0x9'));var sox=require('sox');var csv=require(_0x8294('0xa'));var ejs=require(_0x8294('0xb'));var fs=require('fs');var _=require(_0x8294('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8294('0xa'));var querystring=require(_0x8294('0xd'));var Papa=require('papaparse');var Redis=require(_0x8294('0xe'));var authService=require(_0x8294('0xf'));var qs=require(_0x8294('0x10'));var hardwareService=require(_0x8294('0x11'));var logger=require(_0x8294('0x12'))(_0x8294('0x13'));var utils=require('../../config/utils');var config=require(_0x8294('0x14'));var db=require(_0x8294('0x15'))['db'];config[_0x8294('0x16')]=_[_0x8294('0x17')](config[_0x8294('0x16')],{'host':_0x8294('0x18'),'port':0x18eb});var socket=require(_0x8294('0x19'))(new Redis(config[_0x8294('0x16')]));require('./mailAccount.socket')[_0x8294('0x1a')](socket);var jayson=require(_0x8294('0x1b'));var client=jayson[_0x8294('0x1c')]['http']({'port':0x232b});function checkPasswordPattern(_0x5f473f,_0x4e3369,_0x19295d){if(_0x19295d){var _0x1bccf6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1bccf6[_0x8294('0x1d')](_0x4e3369)){return _0x5f473f;}else{throw new Error(_0x8294('0x1e'));}}else{return _0x5f473f;}}function respondWithRpcPromise(_0x38e295,_0x37ea5b,_0x2a501a,_0xfe249e){return new BPromise(function(_0xf93bde,_0x1ecf57){var _0x3d194a=_0xfe249e||client;return _0x3d194a['request'](_0x38e295,_0x2a501a)[_0x8294('0x1f')](function(_0x4d1981){logger[_0x8294('0x20')](_0x8294('0x21'),_0x37ea5b,_0x8294('0x22'));logger[_0x8294('0x23')](_0x8294('0x24'),_0x37ea5b,_0x8294('0x22'),JSON[_0x8294('0x25')](_0x4d1981));if(_0x4d1981[_0x8294('0x26')]){if(_0x4d1981[_0x8294('0x26')]['code']===0x1f4){logger[_0x8294('0x26')](_0x8294('0x21'),_0x37ea5b,_0x4d1981['error'][_0x8294('0x27')]);return _0x1ecf57(_0x4d1981[_0x8294('0x26')][_0x8294('0x27')]);}logger[_0x8294('0x26')](_0x8294('0x21'),_0x37ea5b,_0x4d1981[_0x8294('0x26')][_0x8294('0x27')]);return _0xf93bde(_0x4d1981[_0x8294('0x26')][_0x8294('0x27')]);}else{logger[_0x8294('0x20')](_0x8294('0x21'),_0x37ea5b,'request\x20sent');_0xf93bde(_0x4d1981['result'][_0x8294('0x27')]);}})['catch'](function(_0x83f0c4){logger['error']('MailAccount,\x20%s,\x20%s',_0x37ea5b,_0x83f0c4);_0x1ecf57(_0x83f0c4);});});}function respondWithStatusCode(_0x37601e,_0x399c9d){_0x399c9d=_0x399c9d||0xcc;return function(_0x51ef39){if(_0x51ef39){return _0x37601e[_0x8294('0x28')](_0x399c9d);}return _0x37601e[_0x8294('0x29')](_0x399c9d)[_0x8294('0x2a')]();};}function respondWithResult(_0x1f00b6,_0x58c4d2){_0x58c4d2=_0x58c4d2||0xc8;return function(_0x4ce49e){if(_0x4ce49e){return _0x1f00b6[_0x8294('0x29')](_0x58c4d2)[_0x8294('0x2b')](_0x4ce49e);}};}function respondWithFilteredResult(_0x3ae908,_0x4fa43c){return function(_0x5ae09f){if(_0x5ae09f){var _0x460431=_0x5ae09f['count'],_0x45072c=_0x4fa43c[_0x8294('0x2c')],_0x32cb49=_0x4fa43c[_0x8294('0x2c')]+_0x4fa43c['limit'],_0x4925e0;if(_0x32cb49>=_0x460431){_0x32cb49=_0x460431;_0x4925e0=0xc8;}else{_0x4925e0=0xce;}_0x3ae908[_0x8294('0x29')](_0x4925e0);return _0x3ae908[_0x8294('0x2d')]('Content-Range',_0x45072c+'-'+_0x32cb49+'/'+_0x460431)[_0x8294('0x2b')](_0x5ae09f);}return null;};}function patchUpdates(_0x518b56){return function(_0x26e67d){try{jsonpatch['apply'](_0x26e67d,_0x518b56,!![]);}catch(_0x3f3228){return BPromise[_0x8294('0x2e')](_0x3f3228);}return _0x26e67d[_0x8294('0x2f')]();};}function saveUpdates(_0x39b73d,_0x4cd83f){return function(_0x254581){if(_0x254581){return _0x254581[_0x8294('0x30')](_0x39b73d)['then'](function(_0x29622a){return _0x29622a;});}return null;};}function removeEntity(_0x85f5b3,_0x26e29a){return function(_0x584fe3){if(_0x584fe3){return _0x584fe3[_0x8294('0x31')]()[_0x8294('0x1f')](function(){var _0xd22e91=_0x584fe3['get']({'plain':!![]});var _0x59508c=_0x8294('0x32');return db[_0x8294('0x33')][_0x8294('0x31')]({'where':{'type':_0x59508c,'resourceId':_0xd22e91['id']}})[_0x8294('0x1f')](function(){return _0x584fe3;});})[_0x8294('0x1f')](function(){_0x85f5b3[_0x8294('0x29')](0xcc)[_0x8294('0x2a')]();});}};}function handleEntityNotFound(_0x23cd76,_0x396420){return function(_0x55087a){if(!_0x55087a){_0x23cd76[_0x8294('0x28')](0x194);}return _0x55087a;};}function handleError(_0x1a9a0d,_0x49c90d){_0x49c90d=_0x49c90d||0x1f4;return function(_0xbf910){logger[_0x8294('0x26')](_0xbf910[_0x8294('0x34')]);if(_0xbf910[_0x8294('0x35')]){delete _0xbf910['name'];}_0x1a9a0d[_0x8294('0x29')](_0x49c90d)[_0x8294('0x36')](_0xbf910);};}exports[_0x8294('0x37')]=function(_0x19f86a,_0x81b7b0){var _0x1c1107={'include':[{'model':db[_0x8294('0x38')],'as':'Imap'},{'model':db[_0x8294('0x39')],'as':_0x8294('0x3a')},{'model':db['Pause'],'as':_0x8294('0x3b')}]},_0x497481={},_0x5e0ebe={'count':0x0,'rows':[]};var _0x11efe0=db[_0x8294('0x3c')][_0x8294('0x3d')];_0x497481[_0x8294('0x3e')]=_[_0x8294('0x3f')](_0x11efe0);_0x497481[_0x8294('0x40')]=_[_0x8294('0x3f')](_0x19f86a[_0x8294('0x40')]);_0x497481[_0x8294('0x41')]=_[_0x8294('0x42')](_0x497481['model'],_0x497481[_0x8294('0x40')]);_0x1c1107[_0x8294('0x43')]=_[_0x8294('0x42')](_0x497481['model'],qs[_0x8294('0x44')](_0x19f86a['query'][_0x8294('0x44')]));_0x1c1107['attributes']=_0x1c1107['attributes'][_0x8294('0x45')]?_0x1c1107['attributes']:_0x497481[_0x8294('0x3e')];if(!_0x19f86a['query'][_0x8294('0x46')]('nolimit')){_0x1c1107[_0x8294('0x47')]=qs[_0x8294('0x47')](_0x19f86a[_0x8294('0x40')]['limit']);_0x1c1107[_0x8294('0x2c')]=qs[_0x8294('0x2c')](_0x19f86a[_0x8294('0x40')]['offset']);}_0x1c1107[_0x8294('0x48')]=qs[_0x8294('0x49')](_0x19f86a['query'][_0x8294('0x49')]);_0x1c1107[_0x8294('0x4a')]=qs[_0x8294('0x41')](_[_0x8294('0x4b')](_0x19f86a[_0x8294('0x40')],_0x497481[_0x8294('0x41')]));if(_0x19f86a['query'][_0x8294('0x4c')]){_0x1c1107['where']=_[_0x8294('0x4d')](_0x1c1107['where'],{'$or':_[_0x8294('0x4e')](_0x11efe0,function(_0x1829a6){if(_0x1829a6['type']['key']!=='VIRTUAL'){var _0x4db635={};_0x4db635[_0x1829a6[_0x8294('0x4f')]]={'$like':'%'+_0x19f86a[_0x8294('0x40')][_0x8294('0x4c')]+'%'};return _0x4db635;}})});}_0x1c1107=_['merge']({},_0x1c1107,_0x19f86a[_0x8294('0x50')]);var _0xafbd90={'where':_0x1c1107[_0x8294('0x4a')]};return db['MailAccount']['count'](_0xafbd90)[_0x8294('0x1f')](function(_0x3a2101){_0x5e0ebe[_0x8294('0x51')]=_0x3a2101;if(_0x19f86a[_0x8294('0x40')]['includeAll']){_0x1c1107[_0x8294('0x52')]=[{'all':!![]}];}return db[_0x8294('0x3c')][_0x8294('0x53')](_0x1c1107);})[_0x8294('0x1f')](function(_0x43cd25){_0x5e0ebe[_0x8294('0x54')]=_0x43cd25;return _0x5e0ebe;})['then'](respondWithFilteredResult(_0x81b7b0,_0x1c1107))[_0x8294('0x55')](handleError(_0x81b7b0,null));};exports['show']=function(_0x15bbf7,_0x20e96e){var _0x304301={'raw':![],'where':{'id':_0x15bbf7[_0x8294('0x56')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x8294('0x57')},{'model':db[_0x8294('0x39')],'as':'Smtp'},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x391001={};_0x391001['model']=_['keys'](db[_0x8294('0x3c')][_0x8294('0x3d')]);_0x391001['query']=_[_0x8294('0x3f')](_0x15bbf7['query']);_0x391001[_0x8294('0x41')]=_['intersection'](_0x391001['model'],_0x391001[_0x8294('0x40')]);_0x304301[_0x8294('0x43')]=_[_0x8294('0x42')](_0x391001[_0x8294('0x3e')],qs['fields'](_0x15bbf7['query'][_0x8294('0x44')]));_0x304301[_0x8294('0x43')]=_0x304301[_0x8294('0x43')]['length']?_0x304301['attributes']:_0x391001[_0x8294('0x3e')];if(_0x15bbf7[_0x8294('0x40')][_0x8294('0x58')]){_0x304301[_0x8294('0x52')]=[{'all':!![]}];}_0x304301=_[_0x8294('0x4d')]({},_0x304301,_0x15bbf7[_0x8294('0x50')]);return db[_0x8294('0x3c')][_0x8294('0x59')](_0x304301)[_0x8294('0x1f')](handleEntityNotFound(_0x20e96e,null))[_0x8294('0x1f')](respondWithResult(_0x20e96e,null))[_0x8294('0x55')](handleError(_0x20e96e,null));};exports[_0x8294('0x30')]=function(_0x22d67f,_0x26125b){if(_0x22d67f['body']['id']){delete _0x22d67f[_0x8294('0x5a')]['id'];}return db[_0x8294('0x3c')]['find']({'where':{'id':_0x22d67f[_0x8294('0x56')]['id']},'include':[{'model':db[_0x8294('0x38')],'as':_0x8294('0x57')},{'model':db[_0x8294('0x39')],'as':_0x8294('0x3a')},{'model':db[_0x8294('0x5b')],'as':_0x8294('0x3b')}]})['then'](handleEntityNotFound(_0x26125b,null))['then'](saveUpdates(_0x22d67f[_0x8294('0x5a')],null))[_0x8294('0x1f')](function(_0x24e59e){if(_0x24e59e&&_0x22d67f[_0x8294('0x5a')][_0x8294('0x57')]){return db[_0x8294('0x38')][_0x8294('0x30')](_0x22d67f['body'][_0x8294('0x57')],{'where':{'MailAccountId':_0x24e59e['id']}})[_0x8294('0x1f')](function(){return _0x24e59e;});}return _0x24e59e;})['then'](function(_0x1dd184){if(_0x1dd184&&_0x22d67f[_0x8294('0x5a')][_0x8294('0x3a')]){return db[_0x8294('0x39')]['update'](_0x22d67f[_0x8294('0x5a')][_0x8294('0x3a')],{'where':{'MailAccountId':_0x1dd184['id']}})[_0x8294('0x1f')](function(){return _0x1dd184;});}return _0x1dd184;})[_0x8294('0x1f')](respondWithResult(_0x26125b,null))['catch'](handleError(_0x26125b,null));};exports[_0x8294('0x5c')]=function(_0x165a52,_0x17a962){return db[_0x8294('0x3c')]['describe']()[_0x8294('0x1f')](respondWithResult(_0x17a962,null))['catch'](handleError(_0x17a962,null));};exports[_0x8294('0x5d')]=function(_0x1a2853,_0xedfa85,_0x58fe07){if(_0x1a2853['body']['id']){delete _0x1a2853[_0x8294('0x5a')]['id'];}return db[_0x8294('0x3c')][_0x8294('0x59')]({'where':{'id':_0x1a2853[_0x8294('0x56')]['id']}})[_0x8294('0x1f')](handleEntityNotFound(_0xedfa85,null))[_0x8294('0x1f')](function(_0x52d5af){if(_0x52d5af){_0x1a2853[_0x8294('0x5a')][_0x8294('0x5e')]=_0x52d5af['id'];return db[_0x8294('0x5f')][_0x8294('0x60')](_0x1a2853[_0x8294('0x5a')]);}})['then'](respondWithResult(_0xedfa85,null))[_0x8294('0x55')](handleError(_0xedfa85,null));};exports[_0x8294('0x61')]=function(_0x35d2d9,_0x31cec7,_0xe434e0){var _0x537fc5={'raw':![],'where':{}};var _0x45efd4={};var _0x3bef45={'count':0x0,'rows':[]};return db[_0x8294('0x3c')][_0x8294('0x62')]({'where':{'id':_0x35d2d9[_0x8294('0x56')]['id']}})[_0x8294('0x1f')](handleEntityNotFound(_0x31cec7,null))['then'](function(_0x56bcdf){if(_0x56bcdf){_0x45efd4['model']=_[_0x8294('0x3f')](db[_0x8294('0x5f')]['rawAttributes']);_0x45efd4['query']=_[_0x8294('0x3f')](_0x35d2d9[_0x8294('0x40')]);_0x45efd4['filters']=_[_0x8294('0x42')](_0x45efd4['model'],_0x45efd4[_0x8294('0x40')]);_0x537fc5[_0x8294('0x43')]=_[_0x8294('0x42')](_0x45efd4[_0x8294('0x3e')],qs[_0x8294('0x44')](_0x35d2d9['query'][_0x8294('0x44')]));_0x537fc5[_0x8294('0x43')]=_0x537fc5[_0x8294('0x43')][_0x8294('0x45')]?_0x537fc5[_0x8294('0x43')]:_0x45efd4[_0x8294('0x3e')];if(!_0x35d2d9['query'][_0x8294('0x46')](_0x8294('0x63'))){_0x537fc5[_0x8294('0x47')]=qs[_0x8294('0x47')](_0x35d2d9['query'][_0x8294('0x47')]);_0x537fc5[_0x8294('0x2c')]=qs[_0x8294('0x2c')](_0x35d2d9[_0x8294('0x40')][_0x8294('0x2c')]);}_0x537fc5[_0x8294('0x48')]=qs['sort'](_0x35d2d9[_0x8294('0x40')][_0x8294('0x49')]);_0x537fc5['where']=qs[_0x8294('0x41')](_[_0x8294('0x4b')](_0x35d2d9['query'],_0x45efd4[_0x8294('0x41')]));_0x537fc5['where'][_0x8294('0x5e')]=_0x56bcdf['id'];if(_0x35d2d9[_0x8294('0x40')][_0x8294('0x4c')]){_0x537fc5[_0x8294('0x4a')]=_['merge'](_0x537fc5[_0x8294('0x4a')],{'$or':_[_0x8294('0x4e')](_0x537fc5[_0x8294('0x43')],function(_0x54d423){var _0x562039={};_0x562039[_0x54d423]={'$like':'%'+_0x35d2d9[_0x8294('0x40')]['filter']+'%'};return _0x562039;})});}_0x537fc5=_['merge']({},_0x537fc5,_0x35d2d9[_0x8294('0x50')]);return db[_0x8294('0x5f')][_0x8294('0x51')]({'where':_0x537fc5['where']})['then'](function(_0x373991){_0x3bef45[_0x8294('0x51')]=_0x373991;if(_0x35d2d9['query']['includeAll']){_0x537fc5[_0x8294('0x52')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x537fc5);})['then'](function(_0x491341){_0x3bef45[_0x8294('0x54')]=_0x491341;return _0x3bef45;});}})['then'](respondWithFilteredResult(_0x31cec7,_0x537fc5))[_0x8294('0x55')](handleError(_0x31cec7,null));};exports[_0x8294('0x64')]=function(_0x2723ac,_0x18bea0,_0x151482){return db[_0x8294('0x3c')][_0x8294('0x59')]({'where':{'id':_0x2723ac[_0x8294('0x56')]['id']}})[_0x8294('0x1f')](handleEntityNotFound(_0x18bea0,null))['then'](function(_0x3bdcf2){if(_0x3bdcf2){return _0x3bdcf2[_0x8294('0x64')](_0x2723ac[_0x8294('0x40')][_0x8294('0x65')]);}})[_0x8294('0x1f')](respondWithStatusCode(_0x18bea0,null))[_0x8294('0x55')](handleError(_0x18bea0,null));};exports['addAnswer']=function(_0x218d71,_0x4c739b,_0x11910d){if(_0x218d71[_0x8294('0x5a')]['id']){delete _0x218d71[_0x8294('0x5a')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x218d71[_0x8294('0x56')]['id']}})[_0x8294('0x1f')](handleEntityNotFound(_0x4c739b,null))[_0x8294('0x1f')](function(_0x1cbf16){if(_0x1cbf16){_0x218d71['body'][_0x8294('0x5e')]=_0x1cbf16['id'];return db['CannedAnswer']['create'](_0x218d71[_0x8294('0x5a')]);}})[_0x8294('0x1f')](respondWithResult(_0x4c739b,null))[_0x8294('0x55')](handleError(_0x4c739b,null));};exports['getAnswers']=function(_0xee725a,_0x5e8a8f,_0x133b09){var _0x2c4795={'raw':![],'where':{}};var _0x39146d={};var _0x4d3de8={'count':0x0,'rows':[]};return db[_0x8294('0x3c')][_0x8294('0x62')]({'where':{'id':_0xee725a['params']['id']}})[_0x8294('0x1f')](handleEntityNotFound(_0x5e8a8f,null))[_0x8294('0x1f')](function(_0x409d45){if(_0x409d45){_0x39146d[_0x8294('0x3e')]=_[_0x8294('0x3f')](db['CannedAnswer'][_0x8294('0x3d')]);_0x39146d['query']=_[_0x8294('0x3f')](_0xee725a[_0x8294('0x40')]);_0x39146d['filters']=_[_0x8294('0x42')](_0x39146d[_0x8294('0x3e')],_0x39146d[_0x8294('0x40')]);_0x2c4795[_0x8294('0x43')]=_[_0x8294('0x42')](_0x39146d[_0x8294('0x3e')],qs[_0x8294('0x44')](_0xee725a[_0x8294('0x40')][_0x8294('0x44')]));_0x2c4795[_0x8294('0x43')]=_0x2c4795['attributes'][_0x8294('0x45')]?_0x2c4795[_0x8294('0x43')]:_0x39146d[_0x8294('0x3e')];if(!_0xee725a[_0x8294('0x40')]['hasOwnProperty'](_0x8294('0x63'))){_0x2c4795[_0x8294('0x47')]=qs[_0x8294('0x47')](_0xee725a[_0x8294('0x40')][_0x8294('0x47')]);_0x2c4795[_0x8294('0x2c')]=qs[_0x8294('0x2c')](_0xee725a[_0x8294('0x40')][_0x8294('0x2c')]);}_0x2c4795[_0x8294('0x48')]=qs['sort'](_0xee725a[_0x8294('0x40')]['sort']);_0x2c4795[_0x8294('0x4a')]=qs[_0x8294('0x41')](_['pick'](_0xee725a['query'],_0x39146d[_0x8294('0x41')]));_0x2c4795[_0x8294('0x4a')][_0x8294('0x5e')]=_0x409d45['id'];if(_0xee725a['query'][_0x8294('0x4c')]){_0x2c4795[_0x8294('0x4a')]=_[_0x8294('0x4d')](_0x2c4795[_0x8294('0x4a')],{'$or':_[_0x8294('0x4e')](_0x2c4795[_0x8294('0x43')],function(_0x35d2ff){var _0x1ed4cf={};_0x1ed4cf[_0x35d2ff]={'$like':'%'+_0xee725a['query'][_0x8294('0x4c')]+'%'};return _0x1ed4cf;})});}_0x2c4795=_[_0x8294('0x4d')]({},_0x2c4795,_0xee725a[_0x8294('0x50')]);return db[_0x8294('0x66')][_0x8294('0x51')]({'where':_0x2c4795[_0x8294('0x4a')]})['then'](function(_0x45bbdf){_0x4d3de8[_0x8294('0x51')]=_0x45bbdf;if(_0xee725a[_0x8294('0x40')]['includeAll']){_0x2c4795[_0x8294('0x52')]=[{'all':!![]}];}return db[_0x8294('0x66')][_0x8294('0x53')](_0x2c4795);})[_0x8294('0x1f')](function(_0x38fcfc){_0x4d3de8[_0x8294('0x54')]=_0x38fcfc;return _0x4d3de8;});}})[_0x8294('0x1f')](respondWithFilteredResult(_0x5e8a8f,_0x2c4795))[_0x8294('0x55')](handleError(_0x5e8a8f,null));};exports[_0x8294('0x67')]=function(_0x2ab3f2,_0xa50f33,_0x292b09){return db[_0x8294('0x3c')][_0x8294('0x59')]({'where':{'id':_0x2ab3f2[_0x8294('0x56')]['id']}})[_0x8294('0x1f')](handleEntityNotFound(_0xa50f33,null))[_0x8294('0x1f')](function(_0x21ffbd){if(_0x21ffbd){return _0x21ffbd[_0x8294('0x67')](_0x2ab3f2['query'][_0x8294('0x65')]);}})[_0x8294('0x1f')](respondWithStatusCode(_0xa50f33,null))['catch'](handleError(_0xa50f33,null));};exports[_0x8294('0x60')]=function(_0x4fa090,_0x570d42){var _0x22e999={'name':_0x4fa090['body'][_0x8294('0x35')],'key':_0x4fa090[_0x8294('0x5a')][_0x8294('0x68')],'email':_0x4fa090['body']['email'],'ListId':_0x4fa090[_0x8294('0x5a')][_0x8294('0x69')],'active':!_['isNil'](_0x4fa090[_0x8294('0x5a')]['active'])?_0x4fa090['body'][_0x8294('0x6a')]:!![],'description':_0x4fa090[_0x8294('0x5a')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0x8294('0x6b')](_0x4fa090[_0x8294('0x5a')][_0x8294('0x6c')])){if(_0x4fa090[_0x8294('0x5a')]['cauthentication']){_0x22e999[_0x8294('0x57')][_0x8294('0x6d')]=_0x22e999[_0x8294('0x3a')][_0x8294('0x6d')]=_0x4fa090['body'][_0x8294('0x6e')];_0x22e999[_0x8294('0x57')]['password']=_0x22e999[_0x8294('0x3a')][_0x8294('0x6f')]=_0x4fa090[_0x8294('0x5a')]['cpassword'];}else{_0x22e999[_0x8294('0x57')][_0x8294('0x70')]=_0x22e999[_0x8294('0x3a')][_0x8294('0x70')]=![];}_0x22e999[_0x8294('0x57')][_0x8294('0x71')]=_0x4fa090['body']['Imap'][_0x8294('0x71')];_0x22e999[_0x8294('0x57')]['port']=_0x4fa090[_0x8294('0x5a')]['Imap'][_0x8294('0x72')];_0x22e999[_0x8294('0x3a')][_0x8294('0x71')]=_0x4fa090['body'][_0x8294('0x3a')][_0x8294('0x71')];_0x22e999['Smtp'][_0x8294('0x72')]=_0x4fa090[_0x8294('0x5a')][_0x8294('0x3a')][_0x8294('0x72')];}else{_0x22e999[_0x8294('0x57')]['service']=_0x22e999[_0x8294('0x3a')][_0x8294('0x73')]=_0x4fa090[_0x8294('0x5a')][_0x8294('0x6c')];_0x22e999[_0x8294('0x57')][_0x8294('0x6d')]=_0x22e999[_0x8294('0x3a')][_0x8294('0x6d')]=_0x4fa090[_0x8294('0x5a')][_0x8294('0x6e')];_0x22e999['Imap'][_0x8294('0x74')]=_0x22e999[_0x8294('0x3a')][_0x8294('0x6f')]=_0x4fa090[_0x8294('0x5a')][_0x8294('0x75')];}return db[_0x8294('0x3c')][_0x8294('0x60')](_0x22e999,{'include':[{'model':db[_0x8294('0x39')],'as':_0x8294('0x3a')},{'model':db[_0x8294('0x38')],'as':'Imap'}]})[_0x8294('0x1f')](function(_0x490e6d){var _0x545a0f=_0x4fa090[_0x8294('0x6d')][_0x8294('0x76')]({'plain':!![]});if(!_0x545a0f)throw new Error(_0x8294('0x77'));if(_0x545a0f['role']===_0x8294('0x6d')){var _0x2dec28=_0x490e6d[_0x8294('0x76')]({'plain':!![]});return db[_0x8294('0x78')][_0x8294('0x59')]({'where':{'name':'MailAccounts','userProfileId':_0x545a0f['userProfileId']},'raw':!![]})[_0x8294('0x1f')](function(_0x49f072){if(_0x49f072&&_0x49f072['autoAssociation']===0x0){return db[_0x8294('0x33')]['create']({'name':_0x2dec28[_0x8294('0x35')],'resourceId':_0x2dec28['id'],'type':_0x49f072[_0x8294('0x35')],'sectionId':_0x49f072['id']},{})[_0x8294('0x1f')](function(){return _0x490e6d;});}else{return _0x490e6d;}})[_0x8294('0x55')](function(_0x4a106b){logger[_0x8294('0x26')](_0x8294('0x79'),_0x4a106b);throw _0x4a106b;});}return _0x490e6d;})[_0x8294('0x1f')](respondWithResult(_0x570d42,0xc9))[_0x8294('0x55')](handleError(_0x570d42,null));};exports['getImap']=function(_0x1dc5f7,_0x58c487,_0x30050f){return db[_0x8294('0x3c')][_0x8294('0x62')]({'where':{'id':_0x1dc5f7[_0x8294('0x56')]['id']}})[_0x8294('0x1f')](handleEntityNotFound(_0x58c487,null))['then'](function(_0x56a0c3){if(_0x56a0c3){return _0x56a0c3[_0x8294('0x7a')]();}return null;})[_0x8294('0x1f')](respondWithResult(_0x58c487,null))['catch'](handleError(_0x58c487,null));};exports[_0x8294('0x7b')]=function(_0x398cce,_0x5b7a50,_0x4a4b4c){if(_0x398cce['body']['id']){delete _0x398cce[_0x8294('0x5a')]['id'];}return db[_0x8294('0x3c')][_0x8294('0x59')]({'where':{'id':_0x398cce[_0x8294('0x56')]['id']}})['then'](handleEntityNotFound(_0x5b7a50,null))[_0x8294('0x1f')](function(_0x17c433){if(_0x17c433){_0x398cce[_0x8294('0x5a')][_0x8294('0x5e')]=_0x17c433['id'];return db[_0x8294('0x38')][_0x8294('0x60')](_0x398cce[_0x8294('0x5a')]);}})[_0x8294('0x1f')](respondWithResult(_0x5b7a50,null))[_0x8294('0x55')](handleError(_0x5b7a50,null));};exports[_0x8294('0x7c')]=function(_0x212608,_0x4bbf5b,_0x50daaf){return db['MailAccount']['findOne']({'where':{'id':_0x212608[_0x8294('0x56')]['id']}})['then'](handleEntityNotFound(_0x4bbf5b,null))[_0x8294('0x1f')](function(_0x53dd7d){if(_0x53dd7d){return _0x53dd7d[_0x8294('0x7d')](null);}return null;})['then'](respondWithStatusCode(_0x4bbf5b,null))[_0x8294('0x55')](handleError(_0x4bbf5b,null));};exports[_0x8294('0x7e')]=function(_0x42a782,_0x14d8c7,_0x34baf0){return db[_0x8294('0x3c')][_0x8294('0x62')]({'where':{'id':_0x42a782[_0x8294('0x56')]['id']}})['then'](handleEntityNotFound(_0x14d8c7,null))[_0x8294('0x1f')](function(_0x5b3975){if(_0x5b3975){return _0x5b3975[_0x8294('0x7e')]();}return null;})[_0x8294('0x1f')](respondWithResult(_0x14d8c7,null))[_0x8294('0x55')](handleError(_0x14d8c7,null));};exports['addSmtp']=function(_0x1fe8d6,_0x4c83df,_0x2a2beb){if(_0x1fe8d6[_0x8294('0x5a')]['id']){delete _0x1fe8d6[_0x8294('0x5a')]['id'];}return db[_0x8294('0x3c')][_0x8294('0x59')]({'where':{'id':_0x1fe8d6[_0x8294('0x56')]['id']}})[_0x8294('0x1f')](handleEntityNotFound(_0x4c83df,null))['then'](function(_0x13ec2e){if(_0x13ec2e){_0x1fe8d6[_0x8294('0x5a')][_0x8294('0x5e')]=_0x13ec2e['id'];return db[_0x8294('0x39')][_0x8294('0x60')](_0x1fe8d6['body']);}})[_0x8294('0x1f')](respondWithResult(_0x4c83df,null))[_0x8294('0x55')](handleError(_0x4c83df,null));};exports[_0x8294('0x7f')]=function(_0x4cb8ea,_0x571c2a,_0x26ff69){return db[_0x8294('0x3c')][_0x8294('0x62')]({'where':{'id':_0x4cb8ea[_0x8294('0x56')]['id']}})[_0x8294('0x1f')](handleEntityNotFound(_0x571c2a,null))[_0x8294('0x1f')](function(_0x457ca9){if(_0x457ca9){return _0x457ca9['setSmtp'](null);}return null;})[_0x8294('0x1f')](respondWithStatusCode(_0x571c2a,null))[_0x8294('0x55')](handleError(_0x571c2a,null));};exports[_0x8294('0x80')]=function(_0x2f636e,_0x265abd,_0x39fc5d){return db[_0x8294('0x81')]['find']({'where':{'id':_0x2f636e[_0x8294('0x56')]['id']}})[_0x8294('0x1f')](handleEntityNotFound(_0x265abd,null))['then'](function(_0x43d677){if(_0x43d677){return _0x43d677['addInteraction'](_0x2f636e[_0x8294('0x5a')][_0x8294('0x65')],_[_0x8294('0x82')](_0x2f636e[_0x8294('0x5a')],[_0x8294('0x65'),'id'])||{});}})[_0x8294('0x1f')](respondWithResult(_0x265abd,null))['catch'](handleError(_0x265abd,null));};exports['getInteractions']=function(_0x403527,_0x3db9d8,_0x207caf){var _0x55e61c={'raw':![],'where':{}};var _0x4fb426={};var _0x5ac2cd={'count':0x0,'rows':[]};return db[_0x8294('0x3c')][_0x8294('0x62')]({'where':{'id':_0x403527[_0x8294('0x56')]['id']}})[_0x8294('0x1f')](handleEntityNotFound(_0x3db9d8,null))['then'](function(_0x4741d5){if(_0x4741d5){_0x4fb426[_0x8294('0x3e')]=_[_0x8294('0x3f')](db[_0x8294('0x81')][_0x8294('0x3d')]);_0x4fb426[_0x8294('0x40')]=_[_0x8294('0x3f')](_0x403527[_0x8294('0x40')]);_0x4fb426['filters']=_['intersection'](_0x4fb426[_0x8294('0x3e')],_0x4fb426[_0x8294('0x40')]);_0x55e61c['attributes']=_[_0x8294('0x42')](_0x4fb426[_0x8294('0x3e')],qs['fields'](_0x403527[_0x8294('0x40')][_0x8294('0x44')]));_0x55e61c[_0x8294('0x43')]=_0x55e61c[_0x8294('0x43')]['length']?_0x55e61c[_0x8294('0x43')]:_0x4fb426[_0x8294('0x3e')];if(!_0x403527[_0x8294('0x40')][_0x8294('0x46')](_0x8294('0x63'))){_0x55e61c[_0x8294('0x47')]=qs[_0x8294('0x47')](_0x403527['query'][_0x8294('0x47')]);_0x55e61c[_0x8294('0x2c')]=qs[_0x8294('0x2c')](_0x403527['query']['offset']);}_0x55e61c[_0x8294('0x48')]=qs[_0x8294('0x49')](_0x403527[_0x8294('0x40')][_0x8294('0x49')]);_0x55e61c[_0x8294('0x4a')]=qs['filters'](_[_0x8294('0x4b')](_0x403527['query'],_0x4fb426[_0x8294('0x41')]));_0x55e61c[_0x8294('0x4a')][_0x8294('0x5e')]=_0x4741d5['id'];if(_0x403527[_0x8294('0x40')][_0x8294('0x4c')]){_0x55e61c['where']=_[_0x8294('0x4d')](_0x55e61c['where'],{'$or':_[_0x8294('0x4e')](_0x55e61c[_0x8294('0x43')],function(_0x4cdfd6){var _0x1b12ef={};_0x1b12ef[_0x4cdfd6]={'$like':'%'+_0x403527['query']['filter']+'%'};return _0x1b12ef;})});}_0x55e61c=_['merge']({},_0x55e61c,_0x403527['options']);return db[_0x8294('0x81')][_0x8294('0x51')]({'where':_0x55e61c[_0x8294('0x4a')]})[_0x8294('0x1f')](function(_0x570ae4){_0x5ac2cd[_0x8294('0x51')]=_0x570ae4;if(_0x403527[_0x8294('0x40')][_0x8294('0x58')]){_0x55e61c['include']=[{'model':db[_0x8294('0x83')],'as':_0x8294('0x84'),'required':![]},{'model':db['User'],'as':_0x8294('0x85'),'attributes':[_0x8294('0x35'),_0x8294('0x86'),_0x8294('0x87')],'required':![]},{'model':db[_0x8294('0x88')],'as':'Tags','attributes':['id',_0x8294('0x35'),'color'],'where':_0x403527[_0x8294('0x40')][_0x8294('0x89')]?{'id':_0x403527[_0x8294('0x40')][_0x8294('0x89')]}:undefined,'required':_0x403527[_0x8294('0x40')][_0x8294('0x89')]?!![]:![]}];}return db['MailInteraction'][_0x8294('0x53')](_0x55e61c);})['then'](function(_0x48609){_0x5ac2cd[_0x8294('0x54')]=_0x48609;return _0x5ac2cd;});}})['then'](respondWithFilteredResult(_0x3db9d8,_0x55e61c))[_0x8294('0x55')](handleError(_0x3db9d8,null));};exports[_0x8294('0x8a')]=function(_0x566c8a,_0x47dcf7,_0x283d3c){return db[_0x8294('0x3c')][_0x8294('0x62')]({'where':{'id':_0x566c8a[_0x8294('0x56')]['id']}})[_0x8294('0x1f')](handleEntityNotFound(_0x47dcf7,null))[_0x8294('0x1f')](function(_0x388270){if(_0x388270){return db[_0x8294('0x8b')][_0x8294('0x8c')](function(_0x1af49d){return db[_0x8294('0x8d')][_0x8294('0x31')]({'where':{'MailAccountId':_0x566c8a['params']['id']},'transaction':_0x1af49d})['then'](function(_0x1bb3b1){var _0x172134=_['map'](_0x566c8a[_0x8294('0x5a')],function(_0x467af2){_0x467af2[_0x8294('0x5e')]=_0x566c8a[_0x8294('0x56')]['id'];return _0x467af2;});return db[_0x8294('0x8d')][_0x8294('0x8e')](_0x172134,{'transaction':_0x1af49d});});})[_0x8294('0x1f')](function(){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x566c8a[_0x8294('0x56')]['id']},'order':_0x8294('0x8f')});});}})[_0x8294('0x1f')](respondWithResult(_0x47dcf7,null))[_0x8294('0x55')](handleError(_0x47dcf7,null));};exports[_0x8294('0x90')]=function(_0x103d57,_0x131e69,_0x1d9c13){var _0xfc0c8f={};var _0x27bee7={};var _0x38e75e;var _0x1f8a43;return db[_0x8294('0x3c')][_0x8294('0x62')]({'where':{'id':_0x103d57[_0x8294('0x56')]['id']}})[_0x8294('0x1f')](handleEntityNotFound(_0x131e69,null))[_0x8294('0x1f')](function(_0x330411){if(_0x330411){_0x38e75e=_0x330411;_0x27bee7[_0x8294('0x3e')]=_[_0x8294('0x3f')](db[_0x8294('0x8d')][_0x8294('0x3d')]);_0x27bee7['query']=_['keys'](_0x103d57[_0x8294('0x40')]);_0x27bee7[_0x8294('0x41')]=_[_0x8294('0x42')](_0x27bee7[_0x8294('0x3e')],_0x27bee7[_0x8294('0x40')]);_0xfc0c8f[_0x8294('0x43')]=_[_0x8294('0x42')](_0x27bee7[_0x8294('0x3e')],qs[_0x8294('0x44')](_0x103d57[_0x8294('0x40')]['fields']));_0xfc0c8f['attributes']=_0xfc0c8f[_0x8294('0x43')][_0x8294('0x45')]?_0xfc0c8f['attributes']:_0x27bee7[_0x8294('0x3e')];_0xfc0c8f[_0x8294('0x48')]=qs['sort'](_0x103d57[_0x8294('0x40')]['sort']);_0xfc0c8f[_0x8294('0x4a')]=qs[_0x8294('0x41')](_['pick'](_0x103d57[_0x8294('0x40')],_0x27bee7[_0x8294('0x41')]));if(_0x103d57[_0x8294('0x40')][_0x8294('0x4c')]){_0xfc0c8f[_0x8294('0x4a')]=_[_0x8294('0x4d')](_0xfc0c8f[_0x8294('0x4a')],{'$or':_[_0x8294('0x4e')](_0xfc0c8f[_0x8294('0x43')],function(_0x560a1a){var _0x597f8b={};_0x597f8b[_0x560a1a]={'$like':'%'+_0x103d57[_0x8294('0x40')][_0x8294('0x4c')]+'%'};return _0x597f8b;})});}_0xfc0c8f=_['merge']({},_0xfc0c8f,_0x103d57[_0x8294('0x50')]);return _0x38e75e['getApplications'](_0xfc0c8f);}})[_0x8294('0x1f')](function(_0x32b0e6){if(_0x32b0e6){_0x1f8a43=_0x32b0e6['length'];if(!_0x103d57[_0x8294('0x40')]['hasOwnProperty'](_0x8294('0x63'))){_0xfc0c8f[_0x8294('0x47')]=qs[_0x8294('0x47')](_0x103d57[_0x8294('0x40')]['limit']);_0xfc0c8f[_0x8294('0x2c')]=qs[_0x8294('0x2c')](_0x103d57[_0x8294('0x40')]['offset']);}return _0x38e75e[_0x8294('0x90')](_0xfc0c8f);}})[_0x8294('0x1f')](function(_0x3f8580){if(_0x3f8580){return _0x3f8580?{'count':_0x1f8a43,'rows':_0x3f8580}:null;}})[_0x8294('0x1f')](respondWithResult(_0x131e69,null))[_0x8294('0x55')](handleError(_0x131e69,null));};exports[_0x8294('0x91')]=function(_0x72de54,_0x35d2f1,_0x5cba14){var _0x2e41cc={'raw':!![],'where':{}};var _0x2664cb={};var _0x3a096f={'count':0x0,'rows':[]};return db[_0x8294('0x3c')]['findOne']({'where':{'id':_0x72de54[_0x8294('0x56')]['id']}})[_0x8294('0x1f')](handleEntityNotFound(_0x35d2f1,null))[_0x8294('0x1f')](function(_0x57157c){if(_0x57157c){_0x2664cb[_0x8294('0x3e')]=_[_0x8294('0x3f')](db[_0x8294('0x92')][_0x8294('0x3d')]);_0x2664cb[_0x8294('0x40')]=_[_0x8294('0x3f')](_0x72de54[_0x8294('0x40')]);_0x2664cb['filters']=_[_0x8294('0x42')](_0x2664cb[_0x8294('0x3e')],_0x2664cb[_0x8294('0x40')]);_0x2e41cc[_0x8294('0x43')]=_['intersection'](_0x2664cb[_0x8294('0x3e')],qs[_0x8294('0x44')](_0x72de54['query'][_0x8294('0x44')]));_0x2e41cc[_0x8294('0x43')]=_0x2e41cc[_0x8294('0x43')][_0x8294('0x45')]?_0x2e41cc[_0x8294('0x43')]:_0x2664cb[_0x8294('0x3e')];if(!_0x72de54[_0x8294('0x40')][_0x8294('0x46')]('nolimit')){_0x2e41cc[_0x8294('0x47')]=qs[_0x8294('0x47')](_0x72de54[_0x8294('0x40')][_0x8294('0x47')]);_0x2e41cc[_0x8294('0x2c')]=qs[_0x8294('0x2c')](_0x72de54['query'][_0x8294('0x2c')]);}_0x2e41cc[_0x8294('0x48')]=qs['sort'](_0x72de54['query']['sort']);_0x2e41cc['where']=qs[_0x8294('0x41')](_[_0x8294('0x4b')](_0x72de54[_0x8294('0x40')],_0x2664cb['filters']));_0x2e41cc[_0x8294('0x4a')][_0x8294('0x5e')]=_0x57157c['id'];if(_0x72de54['query']['filter']){_0x2e41cc[_0x8294('0x4a')]=_[_0x8294('0x4d')](_0x2e41cc[_0x8294('0x4a')],{'$or':_[_0x8294('0x4e')](_0x2e41cc['attributes'],function(_0xb12d63){var _0x54126e={};_0x54126e[_0xb12d63]={'$like':'%'+_0x72de54['query']['filter']+'%'};return _0x54126e;})});}if(_0x72de54[_0x8294('0x40')]['$gte']){var _0xc937a9=_0x72de54[_0x8294('0x40')][_0x8294('0x93')][_0x8294('0x94')](',');var _0x3f7d3c={};_0x3f7d3c[_0xc937a9[0x0]]={'$gte':moment(_0xc937a9[0x1])['format'](_0x8294('0x95'))};_0x2e41cc[_0x8294('0x4a')]=_[_0x8294('0x4d')](_0x2e41cc[_0x8294('0x4a')],_0x3f7d3c);}_0x2e41cc=_[_0x8294('0x4d')]({},_0x2e41cc,_0x72de54[_0x8294('0x50')]);return db['MailMessage'][_0x8294('0x51')]({'where':_0x2e41cc[_0x8294('0x4a')]})[_0x8294('0x1f')](function(_0x107ccf){_0x3a096f['count']=_0x107ccf;if(_0x72de54[_0x8294('0x40')][_0x8294('0x58')]){_0x2e41cc['include']=[{'all':!![]}];}return db[_0x8294('0x92')][_0x8294('0x53')](_0x2e41cc);})['then'](function(_0x24bcf0){_0x3a096f[_0x8294('0x54')]=_0x24bcf0;return _0x3a096f;});}})[_0x8294('0x1f')](respondWithFilteredResult(_0x35d2f1,_0x2e41cc))[_0x8294('0x55')](handleError(_0x35d2f1,null));};exports['send']=function(_0x63ca8e,_0x4ba160,_0x50cdbe){var _0xdf60af,_0x3b5d4a={},_0x6879f8;if(_0x63ca8e[_0x8294('0x5a')]['to']){_0x6879f8=_0x63ca8e[_0x8294('0x5a')]['to'][_0x8294('0x94')](',')[0x0];}return db['MailAccount'][_0x8294('0x59')]({'where':{'id':_0x63ca8e[_0x8294('0x56')]['id']},'include':[{'model':db['CmList'],'as':_0x8294('0x96'),'include':[{'model':db[_0x8294('0x83')],'as':'Contacts','where':{'email':_0x6879f8},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x8294('0x39')],'as':_0x8294('0x3a'),'raw':!![]}]})[_0x8294('0x1f')](handleEntityNotFound(_0x4ba160,null))['then'](function(_0x3db936){if(_0x3db936){_0xdf60af=_0x3db936;if(_0x3db936[_0x8294('0x3a')]){if(_[_0x8294('0x6b')](_0x63ca8e[_0x8294('0x5a')]['from'])){_0x63ca8e['body'][_0x8294('0x97')]=util[_0x8294('0x98')](_0x8294('0x99'),_0x3db936['name'],_0x3db936[_0x8294('0x9a')]||_0x3db936['Smtp']['user']);}if(_0x63ca8e[_0x8294('0x5a')][_0x8294('0x9b')]&&_0x63ca8e[_0x8294('0x5a')]['attachments'][_0x8294('0x45')]){for(var _0x5f0d4e=0x0;_0x5f0d4e<_0x63ca8e[_0x8294('0x5a')][_0x8294('0x9b')][_0x8294('0x45')];_0x5f0d4e+=0x1){_0x63ca8e['body'][_0x8294('0x9b')][_0x5f0d4e]={'filename':_0x63ca8e[_0x8294('0x5a')][_0x8294('0x9b')][_0x5f0d4e]['name'],'path':path[_0x8294('0x9c')](config[_0x8294('0x9d')],'server/files/attachments',_0x63ca8e[_0x8294('0x5a')][_0x8294('0x9b')][_0x5f0d4e][_0x8294('0x9e')])};}}var _0x1ed35a={'tls':{'rejectUnauthorized':![]}};if(_[_0x8294('0x6b')](_0x3db936['Smtp']['service'])){if(_0x3db936[_0x8294('0x3a')][_0x8294('0x70')]){_0x1ed35a['auth']={'user':_0x3db936[_0x8294('0x3a')][_0x8294('0x6d')],'pass':_0x3db936[_0x8294('0x3a')][_0x8294('0x6f')]};}_0x1ed35a[_0x8294('0x71')]=_0x3db936[_0x8294('0x3a')]['host'];_0x1ed35a[_0x8294('0x72')]=_0x3db936[_0x8294('0x3a')]['port'];_0x1ed35a[_0x8294('0x9f')]=_0x3db936[_0x8294('0x3a')][_0x8294('0x9f')];}else{_0x1ed35a[_0x8294('0x73')]=_0x3db936[_0x8294('0x3a')]['service'];_0x1ed35a[_0x8294('0xa0')]={'user':_0x3db936[_0x8294('0x3a')]['user'],'pass':_0x3db936['Smtp'][_0x8294('0x6f')]};}return respondWithRpcPromise(_0x8294('0xa1'),_0x8294('0xa2'),{'account':_0x1ed35a,'message':_0x63ca8e[_0x8294('0x5a')]});}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x34d2b8){if(_0x34d2b8){_0x3b5d4a=_0x34d2b8;if(_0xdf60af[_0x8294('0x96')]){if(_0xdf60af[_0x8294('0x96')][_0x8294('0xa3')][_0x8294('0x45')]){return _0xdf60af[_0x8294('0x96')][_0x8294('0xa3')][0x0];}else{return db['CmContact'][_0x8294('0x60')](_['defaults'](_0x63ca8e[_0x8294('0x5a')],{'firstName':_0x63ca8e['body']['to'],'email':_0x63ca8e[_0x8294('0x5a')]['to'],'phone':_0x63ca8e['body']['to'],'ListId':_0xdf60af[_0x8294('0x69')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0x8294('0x1f')](function(_0x321535){if(_0x321535){var _0x289b1e={'UserId':_0x63ca8e[_0x8294('0x6d')]['id'],'ContactId':_0x321535['id'],'MailAccountId':_0xdf60af['id'],'inReplyTo':_0x3b5d4a[_0x8294('0xa4')],'to':_0x63ca8e[_0x8294('0x5a')]['from'],'cc':_0x63ca8e[_0x8294('0x5a')]['cc'],'subject':_0x63ca8e[_0x8294('0x5a')]['subject'],'attach':_0x63ca8e[_0x8294('0x5a')][_0x8294('0xa5')],'firstMsgDirection':_0x8294('0xa6'),'lastMsgAt':moment()['format'](_0x8294('0x95')),'lastMsgDirection':'out','lastMsgBody':_0x63ca8e[_0x8294('0x5a')][_0x8294('0x5a')],'Messages':[_[_0x8294('0x4d')](_0x63ca8e[_0x8294('0x5a')],{'messageId':_0x3b5d4a['messageId'],'sentAt':moment()[_0x8294('0x98')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0xdf60af['id'],'UserId':_0x63ca8e['user']['id'],'ContactId':_0x321535['id']})]};if(_0x63ca8e[_0x8294('0x5a')][_0x8294('0xa7')]){_0x289b1e=_[_0x8294('0x4d')](_0x289b1e,_0x63ca8e[_0x8294('0x5a')][_0x8294('0xa7')]);}return db[_0x8294('0x81')][_0x8294('0x60')](_0x289b1e,{'include':[{'model':db['MailMessage'],'as':_0x8294('0xa8')}]});}})['then'](respondWithResult(_0x4ba160,null))[_0x8294('0x55')](handleError(_0x4ba160,null));};exports[_0x8294('0xa9')]=function(_0x34b23b,_0x52b8fc,_0x27531e){return db['MailAccount'][_0x8294('0x59')]({'where':{'id':_0x34b23b[_0x8294('0x56')]['id']},'include':[{'model':db[_0x8294('0x39')],'as':_0x8294('0x3a'),'raw':!![]}]})[_0x8294('0x1f')](handleEntityNotFound(_0x52b8fc,null))[_0x8294('0x1f')](function(_0x473793){if(_0x473793&&_0x473793[_0x8294('0x3a')]){var _0x25e7a6={'id':_0x473793['id'],'tls':{'rejectUnauthorized':![]}};if(_0x473793[_0x8294('0x3a')][_0x8294('0x73')]){_0x25e7a6[_0x8294('0x73')]=_0x473793['Smtp']['service'];}else{_0x25e7a6[_0x8294('0x71')]=_0x473793['Smtp'][_0x8294('0x71')];_0x25e7a6['port']=_0x473793[_0x8294('0x3a')][_0x8294('0x72')];_0x25e7a6[_0x8294('0x9f')]=_0x473793[_0x8294('0x3a')][_0x8294('0x9f')];}if(_0x473793[_0x8294('0x3a')]['authentication']){_0x25e7a6[_0x8294('0xa0')]={'user':_0x473793[_0x8294('0x3a')][_0x8294('0x6d')],'pass':_0x473793[_0x8294('0x3a')][_0x8294('0x6f')]};}return respondWithRpcPromise(_0x8294('0xaa'),_0x8294('0xa9'),{'account':_0x25e7a6});}})[_0x8294('0x1f')](respondWithResult(_0x52b8fc,null))['catch'](handleError(_0x52b8fc,null));};exports[_0x8294('0x31')]=function(_0x14321f,_0x3c4c6a){return db['MailAccount'][_0x8294('0x59')]({'where':{'id':_0x14321f[_0x8294('0x56')]['id']}})['then'](handleEntityNotFound(_0x3c4c6a,null))[_0x8294('0x1f')](function(_0x550273){if(_0x550273&&_0x550273[_0x8294('0x73')]){throw new db[(_0x8294('0xab'))][(_0x8294('0xac'))](_0x8294('0xad'));}return _0x550273;})[_0x8294('0x1f')](removeEntity(_0x3c4c6a,null))[_0x8294('0x55')](handleError(_0x3c4c6a,null));};exports[_0x8294('0xae')]=function(_0x5ef55d,_0x41833f,_0x3af731){return db[_0x8294('0x3c')][_0x8294('0x59')]({'where':{'id':_0x5ef55d[_0x8294('0x56')]['id']}})[_0x8294('0x1f')](handleEntityNotFound(_0x41833f,null))[_0x8294('0x1f')](function(_0x1535fb){if(_0x1535fb){return _0x1535fb['addAgents'](_0x5ef55d['body'][_0x8294('0x65')],_[_0x8294('0x82')](_0x5ef55d[_0x8294('0x5a')],[_0x8294('0x65'),'id'])||{})[_0x8294('0xaf')](function(_0x365c79){for(var _0x49d064=0x0;_0x49d064<_0x5ef55d['body'][_0x8294('0x65')][_0x8294('0x45')];_0x49d064+=0x1){socket['emit']('userMailAccount:save',{'UserId':_0x5ef55d[_0x8294('0x5a')][_0x8294('0x65')][_0x49d064],'MailAccountId':_0x5ef55d[_0x8294('0x56')]['id']});}return _0x365c79;});}})[_0x8294('0x1f')](respondWithResult(_0x41833f,null))['catch'](handleError(_0x41833f,null));};exports[_0x8294('0xb0')]=function(_0x2469cd,_0xe40f41,_0x2b8d7a){return db[_0x8294('0x3c')][_0x8294('0x59')]({'where':{'id':_0x2469cd[_0x8294('0x56')]['id']}})[_0x8294('0x1f')](handleEntityNotFound(_0xe40f41,null))[_0x8294('0x1f')](function(_0x4725c7){if(_0x4725c7){return _0x4725c7[_0x8294('0xb0')](_0x2469cd[_0x8294('0x40')][_0x8294('0x65')])[_0x8294('0x1f')](function(){if(_[_0x8294('0xb1')](_0x2469cd['query'][_0x8294('0x65')])){for(var _0x307c83=0x0;_0x307c83<_0x2469cd[_0x8294('0x40')][_0x8294('0x65')][_0x8294('0x45')];_0x307c83+=0x1){socket['emit']('userMailAccount:remove',{'UserId':Number(_0x2469cd[_0x8294('0x40')][_0x8294('0x65')][_0x307c83]),'MailAccountId':Number(_0x2469cd[_0x8294('0x56')]['id'])});}}else{socket[_0x8294('0xb2')]('userMailAccount:remove',{'UserId':Number(_0x2469cd[_0x8294('0x40')][_0x8294('0x65')]),'MailAccountId':Number(_0x2469cd[_0x8294('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0xe40f41,null))['catch'](handleError(_0xe40f41,null));};exports[_0x8294('0xb3')]=function(_0x57d347,_0x17c45d,_0x213abe){var _0x4aa941={};var _0x4afc16={};var _0x3f90ec;var _0x26c6d5;return db[_0x8294('0x3c')][_0x8294('0x62')]({'where':{'id':_0x57d347['params']['id']}})[_0x8294('0x1f')](handleEntityNotFound(_0x17c45d,null))[_0x8294('0x1f')](function(_0x5cf8e4){if(_0x5cf8e4){_0x3f90ec=_0x5cf8e4;_0x4afc16[_0x8294('0x3e')]=_['keys'](db[_0x8294('0xb4')][_0x8294('0x3d')]);_0x4afc16['query']=_['keys'](_0x57d347['query']);_0x4afc16[_0x8294('0x41')]=_['intersection'](_0x4afc16[_0x8294('0x3e')],_0x4afc16[_0x8294('0x40')]);_0x4aa941[_0x8294('0x43')]=_[_0x8294('0x42')](_0x4afc16['model'],qs[_0x8294('0x44')](_0x57d347['query'][_0x8294('0x44')]));_0x4aa941[_0x8294('0x43')]=_0x4aa941[_0x8294('0x43')][_0x8294('0x45')]?_0x4aa941[_0x8294('0x43')]:_0x4afc16['model'];_0x4aa941[_0x8294('0x48')]=qs[_0x8294('0x49')](_0x57d347[_0x8294('0x40')][_0x8294('0x49')]);_0x4aa941[_0x8294('0x4a')]=qs[_0x8294('0x41')](_[_0x8294('0x4b')](_0x57d347[_0x8294('0x40')],_0x4afc16[_0x8294('0x41')]));if(_0x57d347['query'][_0x8294('0x4c')]){_0x4aa941[_0x8294('0x4a')]=_[_0x8294('0x4d')](_0x4aa941['where'],{'$or':_[_0x8294('0x4e')](_0x4aa941[_0x8294('0x43')],function(_0x523809){var _0x50bcdc={};_0x50bcdc[_0x523809]={'$like':'%'+_0x57d347[_0x8294('0x40')][_0x8294('0x4c')]+'%'};return _0x50bcdc;})});}_0x4aa941=_[_0x8294('0x4d')]({},_0x4aa941,_0x57d347[_0x8294('0x50')]);return _0x3f90ec[_0x8294('0xb3')](_0x4aa941);}})[_0x8294('0x1f')](function(_0x56a650){if(_0x56a650){_0x26c6d5=_0x56a650[_0x8294('0x45')];if(!_0x57d347[_0x8294('0x40')][_0x8294('0x46')](_0x8294('0x63'))){_0x4aa941[_0x8294('0x47')]=qs['limit'](_0x57d347['query'][_0x8294('0x47')]);_0x4aa941[_0x8294('0x2c')]=qs[_0x8294('0x2c')](_0x57d347[_0x8294('0x40')]['offset']);}return _0x3f90ec[_0x8294('0xb3')](_0x4aa941);}})['then'](function(_0x25ef5a){if(_0x25ef5a){return _0x25ef5a?{'count':_0x26c6d5,'rows':_0x25ef5a}:null;}})[_0x8294('0x1f')](respondWithResult(_0x17c45d,null))[_0x8294('0x55')](handleError(_0x17c45d,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 34425d0..9242f8b 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 _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','update','emit'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var MailAccount=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){MailAccountEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);MailAccountEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];MailAccount[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=MailAccountEvents; \ No newline at end of file +var _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','update','emit'];(function(_0x555ebb,_0x4b1b68){var _0x3c0a4a=function(_0x312e2f){while(--_0x312e2f){_0x555ebb['push'](_0x555ebb['shift']());}};_0x3c0a4a(++_0x4b1b68);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var MailAccount=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){MailAccountEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);MailAccountEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];MailAccount[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index ad3e979..9d405c9 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 _0x01a6=['rimraf','./mailAccount.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x45c0a2,_0x3ab615){var _0x26f3f9=function(_0x54f838){while(--_0x54f838){_0x45c0a2['push'](_0x45c0a2['shift']());}};_0x26f3f9(++_0x3ab615);}(_0x01a6,0x162));var _0x601a=function(_0x6af1bd,_0x4bb56a){_0x6af1bd=_0x6af1bd-0x0;var _0x5df9a5=_0x01a6[_0x6af1bd];return _0x5df9a5;};'use strict';var _=require(_0x601a('0x0'));var util=require('util');var logger=require(_0x601a('0x1'))(_0x601a('0x2'));var moment=require(_0x601a('0x3'));var BPromise=require(_0x601a('0x4'));var rp=require(_0x601a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x601a('0x6'));var config=require('../../config/environment');var attributes=require(_0x601a('0x7'));module[_0x601a('0x8')]=function(_0x30df8c,_0x196c77){return _0x30df8c[_0x601a('0x9')]('MailAccount',attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbff5=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','MailAccount','mail_accounts'];(function(_0x5253b1,_0x514726){var _0x4ff1c7=function(_0x4256d7){while(--_0x4256d7){_0x5253b1['push'](_0x5253b1['shift']());}};_0x4ff1c7(++_0x514726);}(_0xbff5,0x1bc));var _0x5bff=function(_0xda879b,_0x92f8a7){_0xda879b=_0xda879b-0x0;var _0x11ebda=_0xbff5[_0xda879b];return _0x11ebda;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var logger=require(_0x5bff('0x2'))(_0x5bff('0x3'));var moment=require(_0x5bff('0x4'));var BPromise=require(_0x5bff('0x5'));var rp=require(_0x5bff('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5bff('0x7'));var config=require('../../config/environment');var attributes=require('./mailAccount.attributes');module[_0x5bff('0x8')]=function(_0x1d8650,_0x151add){return _0x1d8650[_0x5bff('0x9')](_0x5bff('0xa'),attributes,{'tableName':_0x5bff('0xb'),'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 015531e..cbbfbea 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 _0x7462=['includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','get','omit','applications','list','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','CmContact','create','List\x20not\x20found','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','interaction','created','attachments','originTo','originCc','bcc','Attachment','Attachments','UserId','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','where','attributes','limit','include','map','model','debug','stringify','ShowMailAccount','raw','NotifyMailAccount','body','mail','difference','keys','rawAttributes','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7462,0x17c));var _0x2746=function(_0x3c5f8d,_0x39891f){_0x3c5f8d=_0x3c5f8d-0x0;var _0x3b7beb=_0x7462[_0x3c5f8d];return _0x3b7beb;};'use strict';var _=require(_0x2746('0x0'));var util=require(_0x2746('0x1'));var moment=require(_0x2746('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2746('0x3'));var db=require(_0x2746('0x4'))['db'];var utils=require(_0x2746('0x5'));var logger=require(_0x2746('0x6'))(_0x2746('0x7'));var config=require(_0x2746('0x8'));var jayson=require(_0x2746('0x9'));var client=jayson['client'][_0x2746('0xa')]({'port':0x232c});config[_0x2746('0xb')]=_[_0x2746('0xc')](config['redis'],{'host':_0x2746('0xd'),'port':0x18eb});var socket=require(_0x2746('0xe'))(new Redis(config[_0x2746('0xb')]));require(_0x2746('0xf'))[_0x2746('0x10')](socket);function respondWithRpcPromise(_0x5213a4,_0x8e48db,_0x512eb7){return new BPromise(function(_0x2b834e,_0x53557c){return client[_0x2746('0x11')](_0x5213a4,_0x512eb7)[_0x2746('0x12')](function(_0x5d67df){logger[_0x2746('0x13')](_0x2746('0x14'),_0x8e48db,_0x2746('0x15'));logger['debug'](_0x2746('0x16'),_0x8e48db,_0x2746('0x15'),JSON['stringify'](_0x5d67df));if(_0x5d67df[_0x2746('0x17')]){if(_0x5d67df[_0x2746('0x17')][_0x2746('0x18')]===0x1f4){logger[_0x2746('0x17')](_0x2746('0x14'),_0x8e48db,_0x5d67df[_0x2746('0x17')][_0x2746('0x19')]);return _0x53557c(_0x5d67df['error'][_0x2746('0x19')]);}logger[_0x2746('0x17')]('MailAccount,\x20%s,\x20%s',_0x8e48db,_0x5d67df[_0x2746('0x17')]['message']);return _0x2b834e(_0x5d67df[_0x2746('0x17')]['message']);}else{logger[_0x2746('0x13')]('MailAccount,\x20%s,\x20%s',_0x8e48db,_0x2746('0x15'));_0x2b834e(_0x5d67df[_0x2746('0x1a')][_0x2746('0x19')]);}})[_0x2746('0x1b')](function(_0xee9d5f){logger[_0x2746('0x17')](_0x2746('0x14'),_0x8e48db,_0xee9d5f);_0x53557c(_0xee9d5f);});});}exports[_0x2746('0x1c')]=function(_0x2f503b){var _0x4982ca=this;return new Promise(function(_0x22d25d,_0x47dd6c){return db[_0x2746('0x1d')][_0x2746('0x1e')]({'raw':_0x2f503b['options']?_0x2f503b['options']['raw']===undefined?!![]:![]:!![],'where':_0x2f503b[_0x2746('0x1f')]?_0x2f503b[_0x2746('0x1f')][_0x2746('0x20')]||null:null,'attributes':_0x2f503b['options']?_0x2f503b[_0x2746('0x1f')][_0x2746('0x21')]||null:null,'limit':_0x2f503b[_0x2746('0x1f')]?_0x2f503b[_0x2746('0x1f')][_0x2746('0x22')]||null:null,'include':_0x2f503b[_0x2746('0x1f')]?_0x2f503b['options'][_0x2746('0x23')]?_[_0x2746('0x24')](_0x2f503b['options'][_0x2746('0x23')],function(_0x4f354b){return{'model':db[_0x4f354b[_0x2746('0x25')]],'as':_0x4f354b['as'],'attributes':_0x4f354b[_0x2746('0x21')],'include':_0x4f354b['include']?_[_0x2746('0x24')](_0x4f354b[_0x2746('0x23')],function(_0x480472){return{'model':db[_0x480472[_0x2746('0x25')]],'as':_0x480472['as'],'attributes':_0x480472[_0x2746('0x21')],'include':_0x480472[_0x2746('0x23')]?_[_0x2746('0x24')](_0x480472[_0x2746('0x23')],function(_0x2f890c){return{'model':db[_0x2f890c[_0x2746('0x25')]],'as':_0x2f890c['as'],'attributes':_0x2f890c[_0x2746('0x21')]};}):[]};}):[]};}):[]:[]})[_0x2746('0x12')](function(_0x4bb84f){logger[_0x2746('0x13')](_0x2746('0x1c'),_0x2f503b);logger[_0x2746('0x26')](_0x2746('0x1c'),_0x2f503b,JSON[_0x2746('0x27')](_0x4bb84f));_0x22d25d(_0x4bb84f);})[_0x2746('0x1b')](function(_0xc9e104){logger[_0x2746('0x17')](_0x2746('0x1c'),_0xc9e104[_0x2746('0x19')],_0x2f503b);_0x47dd6c(_0x4982ca[_0x2746('0x17')](0x1f4,_0xc9e104[_0x2746('0x19')]));});});};exports[_0x2746('0x28')]=function(_0x23cb69){var _0x6e6fa=this;return new Promise(function(_0x8d4835,_0x37ff22){return db['MailAccount']['find']({'raw':_0x23cb69['options']?_0x23cb69['options'][_0x2746('0x29')]===undefined?!![]:![]:!![],'where':_0x23cb69[_0x2746('0x1f')]?_0x23cb69[_0x2746('0x1f')][_0x2746('0x20')]||null:null,'attributes':_0x23cb69['options']?_0x23cb69[_0x2746('0x1f')][_0x2746('0x21')]||null:null,'include':_0x23cb69[_0x2746('0x1f')]?_0x23cb69['options'][_0x2746('0x23')]?_[_0x2746('0x24')](_0x23cb69[_0x2746('0x1f')]['include'],function(_0x13b427){return{'model':db[_0x13b427[_0x2746('0x25')]],'as':_0x13b427['as'],'attributes':_0x13b427['attributes'],'include':_0x13b427['include']?_[_0x2746('0x24')](_0x13b427[_0x2746('0x23')],function(_0x1b70ab){return{'model':db[_0x1b70ab[_0x2746('0x25')]],'as':_0x1b70ab['as'],'attributes':_0x1b70ab[_0x2746('0x21')],'include':_0x1b70ab['include']?_[_0x2746('0x24')](_0x1b70ab[_0x2746('0x23')],function(_0x38ca03){return{'model':db[_0x38ca03['model']],'as':_0x38ca03['as'],'attributes':_0x38ca03[_0x2746('0x21')]};}):[]};}):[]};}):[]:[]})[_0x2746('0x12')](function(_0x2eaa0a){logger[_0x2746('0x13')](_0x2746('0x28'),_0x23cb69);logger[_0x2746('0x26')](_0x2746('0x28'),_0x23cb69,JSON[_0x2746('0x27')](_0x2eaa0a));_0x8d4835(_0x2eaa0a);})[_0x2746('0x1b')](function(_0x41a02c){logger['error'](_0x2746('0x28'),_0x41a02c[_0x2746('0x19')],_0x23cb69);_0x37ff22(_0x6e6fa[_0x2746('0x17')](0x1f4,_0x41a02c[_0x2746('0x19')]));});});};exports[_0x2746('0x2a')]=function(_0x53c818){var _0x5d4a0d=this;return new Promise(function(_0x4336f1,_0x1abd14){var _0xdbab55={'body':_0x53c818[_0x2746('0x2b')],'channel':_0x2746('0x2c')};var _0x3c2a33=_[_0x2746('0x2d')](_[_0x2746('0x2e')](db['CmContact'][_0x2746('0x2f')]),[_0x2746('0x30'),_0x2746('0x31'),'CompanyId',_0x2746('0x32')]);var _0x3d33ed=![];if(_0x53c818[_0x2746('0x2b')]['id']){delete _0x53c818[_0x2746('0x2b')]['id'];}if(_[_0x2746('0x33')](_0x53c818[_0x2746('0x2b')][_0x2746('0x34')])){return _0x1abd14(_0x5d4a0d[_0x2746('0x17')](0x1f4,_0x2746('0x35')));}if(_[_0x2746('0x33')](_0x53c818['body'][_0x2746('0x2b')])||_0x53c818[_0x2746('0x2b')][_0x2746('0x2b')]===''){return _0x1abd14(_0x5d4a0d[_0x2746('0x17')](0x1f4,_0x2746('0x36')));}if(_[_0x2746('0x33')](_0x53c818[_0x2746('0x2b')]['mapKey'])){return _0x1abd14(_0x5d4a0d[_0x2746('0x17')](0x1f4,_0x2746('0x37')+_0x3c2a33));}if(!_[_0x2746('0x38')](_0x3c2a33,_0x53c818[_0x2746('0x2b')][_0x2746('0x39')])){return _0x1abd14(_0x5d4a0d[_0x2746('0x17')](0x1f4,_0x2746('0x3a')+_0x3c2a33));}var _0x44bbd0={};_0x44bbd0[_0x53c818['body'][_0x2746('0x39')]]=_0x53c818[_0x2746('0x2b')][_0x2746('0x34')];return db['MailAccount'][_0x2746('0x3b')]({'where':{'id':_0x53c818[_0x2746('0x3c')]['id']},'include':[{'model':db[_0x2746('0x3d')],'as':_0x2746('0x3e'),'include':[{'model':db['CmContact'],'as':_0x2746('0x3f'),'where':_0x44bbd0,'limit':0x1,'order':[[_0x2746('0x31'),_0x2746('0x40')]]}]},{'model':db[_0x2746('0x41')],'as':_0x2746('0x42')},{'model':db[_0x2746('0x43')],'as':_0x2746('0x44')}]})[_0x2746('0x12')](function(_0x4593c1){if(_0x4593c1&&_0x4593c1[_0x2746('0x3e')]){var _0x508514=_0x4593c1[_0x2746('0x45')]({'plain':!![]});_0xdbab55['account']=_[_0x2746('0x46')](_0x508514,['Applications',_0x2746('0x3e')]);_0xdbab55[_0x2746('0x47')]=_0x508514[_0x2746('0x42')];_0xdbab55[_0x2746('0x48')]=_0x508514['List'];_0xdbab55['applications']=_[_0x2746('0x49')](_0xdbab55['applications'],[_0x2746('0x4a')],[_0x2746('0x4b')]);if(_0xdbab55['account']&&_0xdbab55[_0x2746('0x3c')][_0x2746('0x4c')]){_0xdbab55[_0x2746('0x47')][_0x2746('0x4d')]({'id':0x0,'priority':_0xdbab55[_0x2746('0x47')][_0x2746('0x4e')]+0x1,'app':_0x2746('0x4f'),'appdata':_0x2746('0x4c'),'interval':_0x2746('0x50')});}if(_0xdbab55[_0x2746('0x3c')][_0x2746('0x42')]){delete _0xdbab55[_0x2746('0x3c')][_0x2746('0x42')];}if(_0xdbab55['account'][_0x2746('0x3e')]){delete _0xdbab55[_0x2746('0x3c')][_0x2746('0x3e')];}if(_0x508514[_0x2746('0x3e')][_0x2746('0x3f')][_0x2746('0x4e')]){return _0x508514[_0x2746('0x3e')][_0x2746('0x3f')][0x0];}var _0x190593=_[_0x2746('0xc')](_0x53c818[_0x2746('0x2b')],{'firstName':_0x53c818[_0x2746('0x2b')][_0x2746('0x34')],'ListId':_0x508514['ListId']});_0x190593[_0x53c818[_0x2746('0x2b')][_0x2746('0x39')]]=_0x53c818[_0x2746('0x2b')][_0x2746('0x34')];return db[_0x2746('0x51')][_0x2746('0x52')](_0x190593);}else{throw new Error(_0x2746('0x53'));}})[_0x2746('0x12')](function(_0x1de3ec){_0xdbab55['contact']=_0x1de3ec;if(_0x1de3ec){if(!_0x53c818[_0x2746('0x2b')]['message']['messageId']){_0x53c818[_0x2746('0x2b')][_0x2746('0x19')][_0x2746('0x54')]=rs[_0x2746('0x55')]()+'\x20'+_0x53c818[_0x2746('0x2b')]['message']['from'];}var _0x5eb725={'ContactId':_0x1de3ec['id'],'MailAccountId':_0x53c818[_0x2746('0x3c')]['id'],'inReplyTo':_0x53c818[_0x2746('0x2b')][_0x2746('0x19')][_0x2746('0x54')],'to':_0x53c818[_0x2746('0x2b')]['message'][_0x2746('0x34')],'cc':_0x53c818[_0x2746('0x2b')]['message']['cc'],'subject':_0x53c818[_0x2746('0x2b')][_0x2746('0x19')][_0x2746('0x56')],'attach':_0x53c818['body']['message'][_0x2746('0x57')],'lastMsgAt':moment()[_0x2746('0x58')](_0x2746('0x59')),'lastMsgDirection':'in','lastMsgBody':_0x53c818[_0x2746('0x2b')][_0x2746('0x2b')]};return db[_0x2746('0x5a')]['find']({'where':{'closed':![],'MailAccountId':_0x53c818['account']['id']},'include':[{'model':db[_0x2746('0x5b')],'as':'Messages','attributes':[_0x2746('0x54')],'where':{'messageId':_0x53c818[_0x2746('0x2b')]['message'][_0x2746('0x5c')]}}]})[_0x2746('0x12')](function(_0x43bd0e){if(_0x43bd0e){return[_0x43bd0e,![]];}return db[_0x2746('0x5a')]['create'](_0x5eb725)[_0x2746('0x12')](function(_0xfd73ad){return[_0xfd73ad,!![]];});});}else{throw new Error(_0x2746('0x5d'));}})['spread'](function(_0x2d58ce,_0x39ec12){if(_0x2d58ce){_0x3d33ed=_0x39ec12;if(!_0x39ec12){return _0x2d58ce['update']({'inReplyTo':_0x53c818['body'][_0x2746('0x19')]['messageId'],'to':_0x53c818['body']['message'][_0x2746('0x34')],'cc':_0x53c818[_0x2746('0x2b')][_0x2746('0x19')]['cc'],'subject':_0x53c818[_0x2746('0x2b')][_0x2746('0x19')][_0x2746('0x56')],'attach':_0x2d58ce['attach']?_0x2d58ce[_0x2746('0x57')]:_0x53c818[_0x2746('0x2b')][_0x2746('0x19')][_0x2746('0x57')],'substatus':null,'substatusAt':moment()[_0x2746('0x58')](_0x2746('0x59')),'lastMsgAt':moment()[_0x2746('0x58')](_0x2746('0x59')),'lastMsgDirection':'in','lastMsgBody':_0x53c818[_0x2746('0x2b')][_0x2746('0x2b')]});}else{return _0x2d58ce;}}})[_0x2746('0x12')](function(_0x1fab62){_0xdbab55['interaction']=_0x1fab62[_0x2746('0x45')]({'plain':!![]});_0xdbab55[_0x2746('0x5e')][_0x2746('0x5f')]=_0x3d33ed;return db[_0x2746('0x5b')][_0x2746('0x52')]({'body':_0x53c818[_0x2746('0x2b')][_0x2746('0x2b')],'MailAccountId':_0x53c818[_0x2746('0x3c')]['id'],'MailInteractionId':_0x1fab62['id'],'direction':'in','ContactId':_0xdbab55['contact']['id'],'messageId':_0x53c818['body'][_0x2746('0x19')][_0x2746('0x54')],'from':_0x53c818['body'][_0x2746('0x19')][_0x2746('0x34')],'to':_0x53c818[_0x2746('0x2b')][_0x2746('0x19')]['to'],'cc':_0x53c818['body'][_0x2746('0x19')]['cc'],'subject':_0x53c818[_0x2746('0x2b')][_0x2746('0x19')]['subject'],'attach':_0x53c818[_0x2746('0x2b')][_0x2746('0x19')][_0x2746('0x57')],'Attachments':_0x53c818[_0x2746('0x2b')][_0x2746('0x19')][_0x2746('0x60')],'originTo':_0x53c818['body']['message'][_0x2746('0x61')],'originCc':_0x53c818[_0x2746('0x2b')][_0x2746('0x19')][_0x2746('0x62')],'bcc':_0x53c818['body'][_0x2746('0x19')][_0x2746('0x63')]},{'include':[{'model':db[_0x2746('0x64')],'as':_0x2746('0x65')}]});})[_0x2746('0x12')](function(_0x2ef2f2){_0xdbab55[_0x2746('0x19')]=_0x2ef2f2;if(_0xdbab55[_0x2746('0x5e')]['UserId']){return db['User'][_0x2746('0x3b')]({'attributes':['id','name'],'where':{'id':_0xdbab55[_0x2746('0x5e')][_0x2746('0x66')]}})[_0x2746('0x12')](function(_0x146396){if(_0x146396){_0xdbab55[_0x2746('0x47')][_0x2746('0x67')]({'id':0x0,'priority':0x0,'app':_0x2746('0x68'),'appdata':_0x146396[_0x2746('0x69')]+','+(_0xdbab55[_0x2746('0x3c')][_0x2746('0x6a')]||0xa),'interval':_0x2746('0x50')});}return respondWithRpcPromise(_0x2746('0x6b'),_0x2746('0x6c'),_0xdbab55);});}return respondWithRpcPromise(_0x2746('0x6b'),_0x2746('0x6c'),_0xdbab55);})[_0x2746('0x12')](function(_0x2b2818){_0x4336f1(_0x2b2818);})[_0x2746('0x1b')](function(_0x2d330a){_0x1abd14(_0x5d4a0d[_0x2746('0x17')](0x1f4,_0x2d330a[_0x2746('0x19')]));});});}; \ No newline at end of file +var _0x3fb0=['generate','subject','attach','format','MailInteraction','messageId','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','created','MailMessage','attachments','originCc','bcc','Attachment','Attachments','UserId','User','name','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./mailAccount.socket','register','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','model','map','ShowMailAccount','find','NotifyMailAccount','body','mail','difference','keys','rawAttributes','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','account','CmList','List','CmContact','Contacts','MailApplication','Applications','MailServerOut','Smtp','get','applications','orderBy','priority','autoclose','push','length','close','*,*,*,*','create','contact'];(function(_0x354343,_0x4366af){var _0xaa5dfd=function(_0x28481a){while(--_0x28481a){_0x354343['push'](_0x354343['shift']());}};_0xaa5dfd(++_0x4366af);}(_0x3fb0,0xe2));var _0x03fb=function(_0x5c7786,_0x39e696){_0x5c7786=_0x5c7786-0x0;var _0x55319c=_0x3fb0[_0x5c7786];return _0x55319c;};'use strict';var _=require(_0x03fb('0x0'));var util=require('util');var moment=require(_0x03fb('0x1'));var BPromise=require(_0x03fb('0x2'));var rs=require(_0x03fb('0x3'));var fs=require('fs');var Redis=require(_0x03fb('0x4'));var db=require(_0x03fb('0x5'))['db'];var utils=require(_0x03fb('0x6'));var logger=require(_0x03fb('0x7'))(_0x03fb('0x8'));var config=require(_0x03fb('0x9'));var jayson=require(_0x03fb('0xa'));var client=jayson[_0x03fb('0xb')][_0x03fb('0xc')]({'port':0x232c});config[_0x03fb('0xd')]=_[_0x03fb('0xe')](config[_0x03fb('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x03fb('0xd')]));require(_0x03fb('0xf'))[_0x03fb('0x10')](socket);function respondWithRpcPromise(_0x4666f8,_0x5dda34,_0x19108c){return new BPromise(function(_0x46da31,_0x51141f){return client['request'](_0x4666f8,_0x19108c)[_0x03fb('0x11')](function(_0x3e0a14){logger[_0x03fb('0x12')]('MailAccount,\x20%s,\x20%s',_0x5dda34,_0x03fb('0x13'));logger[_0x03fb('0x14')](_0x03fb('0x15'),_0x5dda34,_0x03fb('0x13'),JSON[_0x03fb('0x16')](_0x3e0a14));if(_0x3e0a14['error']){if(_0x3e0a14[_0x03fb('0x17')][_0x03fb('0x18')]===0x1f4){logger[_0x03fb('0x17')](_0x03fb('0x19'),_0x5dda34,_0x3e0a14[_0x03fb('0x17')]['message']);return _0x51141f(_0x3e0a14[_0x03fb('0x17')][_0x03fb('0x1a')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x5dda34,_0x3e0a14[_0x03fb('0x17')][_0x03fb('0x1a')]);return _0x46da31(_0x3e0a14[_0x03fb('0x17')][_0x03fb('0x1a')]);}else{logger[_0x03fb('0x12')](_0x03fb('0x19'),_0x5dda34,'request\x20sent');_0x46da31(_0x3e0a14[_0x03fb('0x1b')][_0x03fb('0x1a')]);}})[_0x03fb('0x1c')](function(_0x5f3a94){logger[_0x03fb('0x17')]('MailAccount,\x20%s,\x20%s',_0x5dda34,_0x5f3a94);_0x51141f(_0x5f3a94);});});}exports[_0x03fb('0x1d')]=function(_0x2a5cf7){var _0x56d9ea=this;return new Promise(function(_0x8c05e2,_0x3bd892){return db[_0x03fb('0x1e')][_0x03fb('0x1f')]({'raw':_0x2a5cf7['options']?_0x2a5cf7[_0x03fb('0x20')][_0x03fb('0x21')]===undefined?!![]:![]:!![],'where':_0x2a5cf7['options']?_0x2a5cf7['options'][_0x03fb('0x22')]||null:null,'attributes':_0x2a5cf7[_0x03fb('0x20')]?_0x2a5cf7[_0x03fb('0x20')][_0x03fb('0x23')]||null:null,'limit':_0x2a5cf7['options']?_0x2a5cf7[_0x03fb('0x20')][_0x03fb('0x24')]||null:null,'include':_0x2a5cf7[_0x03fb('0x20')]?_0x2a5cf7[_0x03fb('0x20')][_0x03fb('0x25')]?_['map'](_0x2a5cf7[_0x03fb('0x20')][_0x03fb('0x25')],function(_0x45c597){return{'model':db[_0x45c597[_0x03fb('0x26')]],'as':_0x45c597['as'],'attributes':_0x45c597[_0x03fb('0x23')],'include':_0x45c597[_0x03fb('0x25')]?_['map'](_0x45c597[_0x03fb('0x25')],function(_0x5410ab){return{'model':db[_0x5410ab[_0x03fb('0x26')]],'as':_0x5410ab['as'],'attributes':_0x5410ab[_0x03fb('0x23')],'include':_0x5410ab[_0x03fb('0x25')]?_[_0x03fb('0x27')](_0x5410ab['include'],function(_0x13f8a6){return{'model':db[_0x13f8a6[_0x03fb('0x26')]],'as':_0x13f8a6['as'],'attributes':_0x13f8a6[_0x03fb('0x23')]};}):[]};}):[]};}):[]:[]})[_0x03fb('0x11')](function(_0x55987c){logger[_0x03fb('0x12')](_0x03fb('0x1d'),_0x2a5cf7);logger[_0x03fb('0x14')]('GetMailAccount',_0x2a5cf7,JSON[_0x03fb('0x16')](_0x55987c));_0x8c05e2(_0x55987c);})[_0x03fb('0x1c')](function(_0x2e86b6){logger[_0x03fb('0x17')](_0x03fb('0x1d'),_0x2e86b6[_0x03fb('0x1a')],_0x2a5cf7);_0x3bd892(_0x56d9ea[_0x03fb('0x17')](0x1f4,_0x2e86b6[_0x03fb('0x1a')]));});});};exports[_0x03fb('0x28')]=function(_0x465cee){var _0x36dfb4=this;return new Promise(function(_0x4dd5de,_0x422b3d){return db['MailAccount'][_0x03fb('0x29')]({'raw':_0x465cee['options']?_0x465cee[_0x03fb('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x465cee[_0x03fb('0x20')]?_0x465cee[_0x03fb('0x20')][_0x03fb('0x22')]||null:null,'attributes':_0x465cee[_0x03fb('0x20')]?_0x465cee[_0x03fb('0x20')][_0x03fb('0x23')]||null:null,'include':_0x465cee[_0x03fb('0x20')]?_0x465cee[_0x03fb('0x20')][_0x03fb('0x25')]?_[_0x03fb('0x27')](_0x465cee[_0x03fb('0x20')][_0x03fb('0x25')],function(_0x2e7819){return{'model':db[_0x2e7819[_0x03fb('0x26')]],'as':_0x2e7819['as'],'attributes':_0x2e7819[_0x03fb('0x23')],'include':_0x2e7819[_0x03fb('0x25')]?_[_0x03fb('0x27')](_0x2e7819[_0x03fb('0x25')],function(_0x242a2d){return{'model':db[_0x242a2d[_0x03fb('0x26')]],'as':_0x242a2d['as'],'attributes':_0x242a2d[_0x03fb('0x23')],'include':_0x242a2d[_0x03fb('0x25')]?_[_0x03fb('0x27')](_0x242a2d[_0x03fb('0x25')],function(_0x690e95){return{'model':db[_0x690e95[_0x03fb('0x26')]],'as':_0x690e95['as'],'attributes':_0x690e95['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x46053a){logger['info'](_0x03fb('0x28'),_0x465cee);logger[_0x03fb('0x14')](_0x03fb('0x28'),_0x465cee,JSON[_0x03fb('0x16')](_0x46053a));_0x4dd5de(_0x46053a);})[_0x03fb('0x1c')](function(_0x2d66d9){logger['error']('ShowMailAccount',_0x2d66d9['message'],_0x465cee);_0x422b3d(_0x36dfb4[_0x03fb('0x17')](0x1f4,_0x2d66d9[_0x03fb('0x1a')]));});});};exports[_0x03fb('0x2a')]=function(_0x501c0e){var _0x363c06=this;return new Promise(function(_0x2954fb,_0x422e8c){var _0x3b7ef2={'body':_0x501c0e[_0x03fb('0x2b')],'channel':_0x03fb('0x2c')};var _0x1d8f51=_[_0x03fb('0x2d')](_[_0x03fb('0x2e')](db['CmContact'][_0x03fb('0x2f')]),['createdAt',_0x03fb('0x30'),_0x03fb('0x31'),_0x03fb('0x32')]);var _0x1bb458=![];if(_0x501c0e['body']['id']){delete _0x501c0e[_0x03fb('0x2b')]['id'];}if(_['isNil'](_0x501c0e[_0x03fb('0x2b')][_0x03fb('0x33')])){return _0x422e8c(_0x363c06[_0x03fb('0x17')](0x1f4,_0x03fb('0x34')));}if(_[_0x03fb('0x35')](_0x501c0e[_0x03fb('0x2b')][_0x03fb('0x2b')])||_0x501c0e['body'][_0x03fb('0x2b')]===''){return _0x422e8c(_0x363c06['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x03fb('0x35')](_0x501c0e[_0x03fb('0x2b')][_0x03fb('0x36')])){return _0x422e8c(_0x363c06['error'](0x1f4,_0x03fb('0x37')+_0x1d8f51));}if(!_[_0x03fb('0x38')](_0x1d8f51,_0x501c0e[_0x03fb('0x2b')][_0x03fb('0x36')])){return _0x422e8c(_0x363c06[_0x03fb('0x17')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1d8f51));}var _0xa1c13c={};_0xa1c13c[_0x501c0e['body']['mapKey']]=_0x501c0e[_0x03fb('0x2b')][_0x03fb('0x33')];return db[_0x03fb('0x1e')][_0x03fb('0x29')]({'where':{'id':_0x501c0e[_0x03fb('0x39')]['id']},'include':[{'model':db[_0x03fb('0x3a')],'as':_0x03fb('0x3b'),'include':[{'model':db[_0x03fb('0x3c')],'as':_0x03fb('0x3d'),'where':_0xa1c13c,'limit':0x1,'order':[[_0x03fb('0x30'),'DESC']]}]},{'model':db[_0x03fb('0x3e')],'as':_0x03fb('0x3f')},{'model':db[_0x03fb('0x40')],'as':_0x03fb('0x41')}]})[_0x03fb('0x11')](function(_0x380fb7){if(_0x380fb7&&_0x380fb7[_0x03fb('0x3b')]){var _0x27aa01=_0x380fb7[_0x03fb('0x42')]({'plain':!![]});_0x3b7ef2[_0x03fb('0x39')]=_['omit'](_0x27aa01,[_0x03fb('0x3f'),_0x03fb('0x3b')]);_0x3b7ef2['applications']=_0x27aa01[_0x03fb('0x3f')];_0x3b7ef2['list']=_0x27aa01[_0x03fb('0x3b')];_0x3b7ef2[_0x03fb('0x43')]=_[_0x03fb('0x44')](_0x3b7ef2['applications'],[_0x03fb('0x45')],['asc']);if(_0x3b7ef2[_0x03fb('0x39')]&&_0x3b7ef2[_0x03fb('0x39')][_0x03fb('0x46')]){_0x3b7ef2['applications'][_0x03fb('0x47')]({'id':0x0,'priority':_0x3b7ef2[_0x03fb('0x43')][_0x03fb('0x48')]+0x1,'app':_0x03fb('0x49'),'appdata':_0x03fb('0x46'),'interval':_0x03fb('0x4a')});}if(_0x3b7ef2[_0x03fb('0x39')][_0x03fb('0x3f')]){delete _0x3b7ef2['account'][_0x03fb('0x3f')];}if(_0x3b7ef2[_0x03fb('0x39')]['List']){delete _0x3b7ef2[_0x03fb('0x39')][_0x03fb('0x3b')];}if(_0x27aa01[_0x03fb('0x3b')][_0x03fb('0x3d')][_0x03fb('0x48')]){return _0x27aa01['List'][_0x03fb('0x3d')][0x0];}var _0x405f4f=_[_0x03fb('0xe')](_0x501c0e['body'],{'firstName':_0x501c0e['body'][_0x03fb('0x33')],'ListId':_0x27aa01[_0x03fb('0x32')]});_0x405f4f[_0x501c0e[_0x03fb('0x2b')][_0x03fb('0x36')]]=_0x501c0e[_0x03fb('0x2b')]['from'];return db[_0x03fb('0x3c')][_0x03fb('0x4b')](_0x405f4f);}else{throw new Error('List\x20not\x20found');}})[_0x03fb('0x11')](function(_0x3f871d){_0x3b7ef2[_0x03fb('0x4c')]=_0x3f871d;if(_0x3f871d){if(!_0x501c0e['body'][_0x03fb('0x1a')]['messageId']){_0x501c0e[_0x03fb('0x2b')][_0x03fb('0x1a')]['messageId']=rs[_0x03fb('0x4d')]()+'\x20'+_0x501c0e[_0x03fb('0x2b')]['message'][_0x03fb('0x33')];}var _0x1fe6ff={'ContactId':_0x3f871d['id'],'MailAccountId':_0x501c0e[_0x03fb('0x39')]['id'],'inReplyTo':_0x501c0e[_0x03fb('0x2b')]['message']['messageId'],'to':_0x501c0e[_0x03fb('0x2b')][_0x03fb('0x1a')][_0x03fb('0x33')],'cc':_0x501c0e[_0x03fb('0x2b')][_0x03fb('0x1a')]['cc'],'subject':_0x501c0e[_0x03fb('0x2b')][_0x03fb('0x1a')][_0x03fb('0x4e')],'attach':_0x501c0e['body'][_0x03fb('0x1a')][_0x03fb('0x4f')],'lastMsgAt':moment()[_0x03fb('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x501c0e['body'][_0x03fb('0x2b')]};return db[_0x03fb('0x51')][_0x03fb('0x29')]({'where':{'closed':![],'MailAccountId':_0x501c0e[_0x03fb('0x39')]['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':[_0x03fb('0x52')],'where':{'messageId':_0x501c0e[_0x03fb('0x2b')][_0x03fb('0x1a')]['inReplyTo']}}]})[_0x03fb('0x11')](function(_0x276f58){if(_0x276f58){return[_0x276f58,![]];}return db['MailInteraction'][_0x03fb('0x4b')](_0x1fe6ff)[_0x03fb('0x11')](function(_0x388e5e){return[_0x388e5e,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x03fb('0x53')](function(_0x447308,_0x1e6744){if(_0x447308){_0x1bb458=_0x1e6744;if(!_0x1e6744){return _0x447308[_0x03fb('0x54')]({'inReplyTo':_0x501c0e[_0x03fb('0x2b')]['message'][_0x03fb('0x52')],'to':_0x501c0e[_0x03fb('0x2b')]['message']['from'],'cc':_0x501c0e[_0x03fb('0x2b')][_0x03fb('0x1a')]['cc'],'subject':_0x501c0e[_0x03fb('0x2b')]['message']['subject'],'attach':_0x447308[_0x03fb('0x4f')]?_0x447308[_0x03fb('0x4f')]:_0x501c0e[_0x03fb('0x2b')][_0x03fb('0x1a')][_0x03fb('0x4f')],'substatus':null,'substatusAt':moment()[_0x03fb('0x50')](_0x03fb('0x55')),'lastMsgAt':moment()[_0x03fb('0x50')](_0x03fb('0x55')),'lastMsgDirection':'in','lastMsgBody':_0x501c0e[_0x03fb('0x2b')]['body']});}else{return _0x447308;}}})['then'](function(_0x5a77d9){_0x3b7ef2[_0x03fb('0x56')]=_0x5a77d9[_0x03fb('0x42')]({'plain':!![]});_0x3b7ef2[_0x03fb('0x56')][_0x03fb('0x57')]=_0x1bb458;return db[_0x03fb('0x58')]['create']({'body':_0x501c0e[_0x03fb('0x2b')]['body'],'MailAccountId':_0x501c0e[_0x03fb('0x39')]['id'],'MailInteractionId':_0x5a77d9['id'],'direction':'in','ContactId':_0x3b7ef2[_0x03fb('0x4c')]['id'],'messageId':_0x501c0e[_0x03fb('0x2b')][_0x03fb('0x1a')][_0x03fb('0x52')],'from':_0x501c0e[_0x03fb('0x2b')][_0x03fb('0x1a')][_0x03fb('0x33')],'to':_0x501c0e['body'][_0x03fb('0x1a')]['to'],'cc':_0x501c0e[_0x03fb('0x2b')][_0x03fb('0x1a')]['cc'],'subject':_0x501c0e[_0x03fb('0x2b')]['message'][_0x03fb('0x4e')],'attach':_0x501c0e[_0x03fb('0x2b')][_0x03fb('0x1a')][_0x03fb('0x4f')],'Attachments':_0x501c0e[_0x03fb('0x2b')][_0x03fb('0x1a')][_0x03fb('0x59')],'originTo':_0x501c0e[_0x03fb('0x2b')][_0x03fb('0x1a')]['originTo'],'originCc':_0x501c0e[_0x03fb('0x2b')]['message'][_0x03fb('0x5a')],'bcc':_0x501c0e[_0x03fb('0x2b')][_0x03fb('0x1a')][_0x03fb('0x5b')]},{'include':[{'model':db[_0x03fb('0x5c')],'as':_0x03fb('0x5d')}]});})[_0x03fb('0x11')](function(_0x563602){_0x3b7ef2[_0x03fb('0x1a')]=_0x563602;if(_0x3b7ef2['interaction'][_0x03fb('0x5e')]){return db[_0x03fb('0x5f')]['find']({'attributes':['id',_0x03fb('0x60')],'where':{'id':_0x3b7ef2[_0x03fb('0x56')][_0x03fb('0x5e')]}})[_0x03fb('0x11')](function(_0x2e383a){if(_0x2e383a){_0x3b7ef2[_0x03fb('0x43')][_0x03fb('0x61')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2e383a[_0x03fb('0x60')]+','+(_0x3b7ef2[_0x03fb('0x39')][_0x03fb('0x62')]||0xa),'interval':_0x03fb('0x4a')});}return respondWithRpcPromise(_0x03fb('0x63'),_0x03fb('0x64'),_0x3b7ef2);});}return respondWithRpcPromise('Start',_0x03fb('0x64'),_0x3b7ef2);})[_0x03fb('0x11')](function(_0x583b35){_0x2954fb(_0x583b35);})['catch'](function(_0x72a1a2){_0x422e8c(_0x363c06[_0x03fb('0x17')](0x1f4,_0x72a1a2[_0x03fb('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index baf83c5..2df5e95 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 _0x3873=['remove','emit','removeListener','length','mailAccount:','./mailAccount.events','save'];(function(_0x6a734c,_0x1b2d9f){var _0x494d0d=function(_0x36fd39){while(--_0x36fd39){_0x6a734c['push'](_0x6a734c['shift']());}};_0x494d0d(++_0x1b2d9f);}(_0x3873,0x1a9));var _0x3387=function(_0x444209,_0x274875){_0x444209=_0x444209-0x0;var _0x4cedd6=_0x3873[_0x444209];return _0x4cedd6;};'use strict';var MailAccountEvents=require(_0x3387('0x0'));var events=[_0x3387('0x1'),_0x3387('0x2'),'update'];function createListener(_0x184aa,_0x2ccb11){return function(_0x48268e){_0x2ccb11[_0x3387('0x3')](_0x184aa,_0x48268e);};}function removeListener(_0x3be2b2,_0x2dc24d){return function(){MailAccountEvents[_0x3387('0x4')](_0x3be2b2,_0x2dc24d);};}exports['register']=function(_0x225c12){for(var _0x340805=0x0,_0x700e15=events[_0x3387('0x5')];_0x340805<_0x700e15;_0x340805++){var _0x3154ce=events[_0x340805];var _0x146f53=createListener(_0x3387('0x6')+_0x3154ce,_0x225c12);MailAccountEvents['on'](_0x3154ce,_0x146f53);}}; \ No newline at end of file +var _0x4df2=['removeListener','register','length','mailAccount:','save','remove','update','emit'];(function(_0x58fb70,_0x2b3065){var _0x54b80a=function(_0x278526){while(--_0x278526){_0x58fb70['push'](_0x58fb70['shift']());}};_0x54b80a(++_0x2b3065);}(_0x4df2,0xcc));var _0x24df=function(_0x297af7,_0x96c06a){_0x297af7=_0x297af7-0x0;var _0x28037a=_0x4df2[_0x297af7];return _0x28037a;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x24df('0x0'),_0x24df('0x1'),_0x24df('0x2')];function createListener(_0xbdea43,_0x407e91){return function(_0x4bb85a){_0x407e91[_0x24df('0x3')](_0xbdea43,_0x4bb85a);};}function removeListener(_0x14dde1,_0x2de3ec){return function(){MailAccountEvents[_0x24df('0x4')](_0x14dde1,_0x2de3ec);};}exports[_0x24df('0x5')]=function(_0x163e30){for(var _0x1e43e5=0x0,_0x271b0e=events[_0x24df('0x6')];_0x1e43e5<_0x271b0e;_0x1e43e5++){var _0xfab64a=events[_0x1e43e5];var _0x38e3cc=createListener(_0x24df('0x7')+_0xfab64a,_0x163e30);MailAccountEvents['on'](_0xfab64a,_0x38e3cc);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 69f26d0..6de4310 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 _0xe130=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','/:id','isAuthenticated','put','delete'];(function(_0x3ef4f1,_0x5f0f9b){var _0x69953c=function(_0xb4e621){while(--_0xb4e621){_0x3ef4f1['push'](_0x3ef4f1['shift']());}};_0x69953c(++_0x5f0f9b);}(_0xe130,0x127));var _0x0e13=function(_0x5c3e53,_0x21f09b){_0x5c3e53=_0x5c3e53-0x0;var _0x471b03=_0xe130[_0x5c3e53];return _0x471b03;};'use strict';var multer=require(_0x0e13('0x0'));var util=require(_0x0e13('0x1'));var path=require('path');var timeout=require(_0x0e13('0x2'));var express=require(_0x0e13('0x3'));var router=express[_0x0e13('0x4')]();var auth=require(_0x0e13('0x5'));var interaction=require(_0x0e13('0x6'));var config=require('../../config/environment');var controller=require(_0x0e13('0x7'));router[_0x0e13('0x8')](_0x0e13('0x9'),auth[_0x0e13('0xa')](),controller['show']);router[_0x0e13('0xb')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x0e13('0xc')](_0x0e13('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x0e13('0xd')]=router; \ No newline at end of file +var _0x6282=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','/:id','isAuthenticated','show','update','delete','destroy','exports','multer','util'];(function(_0x179388,_0x4c4ce3){var _0xaa9a2f=function(_0xd50d1b){while(--_0xd50d1b){_0x179388['push'](_0x179388['shift']());}};_0xaa9a2f(++_0x4c4ce3);}(_0x6282,0x76));var _0x2628=function(_0xc1faf9,_0x5e0083){_0xc1faf9=_0xc1faf9-0x0;var _0x1223f5=_0x6282[_0xc1faf9];return _0x1223f5;};'use strict';var multer=require(_0x2628('0x0'));var util=require(_0x2628('0x1'));var path=require(_0x2628('0x2'));var timeout=require(_0x2628('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x2628('0x4'));var interaction=require(_0x2628('0x5'));var config=require('../../config/environment');var controller=require(_0x2628('0x6'));router[_0x2628('0x7')](_0x2628('0x8'),auth[_0x2628('0x9')](),controller[_0x2628('0xa')]);router['put'](_0x2628('0x8'),auth[_0x2628('0x9')](),controller[_0x2628('0xb')]);router[_0x2628('0xc')](_0x2628('0x8'),auth[_0x2628('0x9')](),controller[_0x2628('0xd')]);module[_0x2628('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index ccde009..5f78dcb 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 _0x9ccd=['INTEGER','STRING','*,*,*,*','sequelize'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9ccd[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xd9cc('0x0'));module['exports']={'priority':{'type':Sequelize[_0xd9cc('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd9cc('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd9cc('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xd9cc('0x3')}}; \ No newline at end of file +var _0x7adb=['*,*,*,*','exports','INTEGER','noop','TEXT','STRING'];(function(_0x4e54c0,_0x1599ad){var _0x2bd3ba=function(_0x760d2f){while(--_0x760d2f){_0x4e54c0['push'](_0x4e54c0['shift']());}};_0x2bd3ba(++_0x1599ad);}(_0x7adb,0x7f));var _0xb7ad=function(_0x49afec,_0x5f2f5e){_0x49afec=_0x49afec-0x0;var _0x89c4f0=_0x7adb[_0x49afec];return _0x89c4f0;};'use strict';var Sequelize=require('sequelize');module[_0xb7ad('0x0')]={'priority':{'type':Sequelize[_0xb7ad('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb7ad('0x2')},'appdata':{'type':Sequelize[_0xb7ad('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb7ad('0x4')],'defaultValue':_0xb7ad('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index cfa7a79..666a593 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 _0x8969=['length','includeAll','include','options','MailApplication','find','body','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','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','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','show','params','model','query','keys','filters','intersection','attributes','fields'];(function(_0x54f404,_0x470547){var _0x94d400=function(_0x1ef3a1){while(--_0x1ef3a1){_0x54f404['push'](_0x54f404['shift']());}};_0x94d400(++_0x470547);}(_0x8969,0xc2));var _0x9896=function(_0xb2fb5c,_0x281e92){_0xb2fb5c=_0xb2fb5c-0x0;var _0x96b4ad=_0x8969[_0xb2fb5c];return _0x96b4ad;};'use strict';var pdf=require(_0x9896('0x0'));var emlformat=require(_0x9896('0x1'));var rimraf=require(_0x9896('0x2'));var zipdir=require(_0x9896('0x3'));var jsonpatch=require(_0x9896('0x4'));var rp=require('request-promise');var moment=require(_0x9896('0x5'));var BPromise=require(_0x9896('0x6'));var Mustache=require(_0x9896('0x7'));var util=require(_0x9896('0x8'));var path=require(_0x9896('0x9'));var sox=require(_0x9896('0xa'));var csv=require('to-csv');var ejs=require(_0x9896('0xb'));var fs=require('fs');var _=require(_0x9896('0xc'));var squel=require(_0x9896('0xd'));var crypto=require(_0x9896('0xe'));var jsforce=require(_0x9896('0xf'));var deskjs=require(_0x9896('0x10'));var toCsv=require(_0x9896('0x11'));var querystring=require(_0x9896('0x12'));var Papa=require(_0x9896('0x13'));var Redis=require(_0x9896('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x9896('0x15'));var hardwareService=require(_0x9896('0x16'));var logger=require(_0x9896('0x17'))(_0x9896('0x18'));var utils=require(_0x9896('0x19'));var config=require(_0x9896('0x1a'));var db=require(_0x9896('0x1b'))['db'];function respondWithStatusCode(_0x503f1c,_0x2c7585){_0x2c7585=_0x2c7585||0xcc;return function(_0x128b6a){if(_0x128b6a){return _0x503f1c['sendStatus'](_0x2c7585);}return _0x503f1c[_0x9896('0x1c')](_0x2c7585)['end']();};}function respondWithResult(_0x2717b6,_0x34b482){_0x34b482=_0x34b482||0xc8;return function(_0x201447){if(_0x201447){return _0x2717b6[_0x9896('0x1c')](_0x34b482)[_0x9896('0x1d')](_0x201447);}};}function respondWithFilteredResult(_0x28f85b,_0x4e21e3){return function(_0xe96930){if(_0xe96930){var _0x2d2561=_0xe96930['count'],_0x5590b2=_0x4e21e3['offset'],_0x2ac18c=_0x4e21e3[_0x9896('0x1e')]+_0x4e21e3[_0x9896('0x1f')],_0x4dbbd8;if(_0x2ac18c>=_0x2d2561){_0x2ac18c=_0x2d2561;_0x4dbbd8=0xc8;}else{_0x4dbbd8=0xce;}_0x28f85b[_0x9896('0x1c')](_0x4dbbd8);return _0x28f85b[_0x9896('0x20')](_0x9896('0x21'),_0x5590b2+'-'+_0x2ac18c+'/'+_0x2d2561)['json'](_0xe96930);}return null;};}function patchUpdates(_0x339d92){return function(_0x2f5a5b){try{jsonpatch[_0x9896('0x22')](_0x2f5a5b,_0x339d92,!![]);}catch(_0x3459d9){return BPromise[_0x9896('0x23')](_0x3459d9);}return _0x2f5a5b[_0x9896('0x24')]();};}function saveUpdates(_0x2c0073,_0x196961){return function(_0x17d025){if(_0x17d025){return _0x17d025[_0x9896('0x25')](_0x2c0073)[_0x9896('0x26')](function(_0x50a4e7){return _0x50a4e7;});}return null;};}function removeEntity(_0x49945d,_0x327695){return function(_0x3363a1){if(_0x3363a1){return _0x3363a1[_0x9896('0x27')]()[_0x9896('0x26')](function(){_0x49945d[_0x9896('0x1c')](0xcc)[_0x9896('0x28')]();});}};}function handleEntityNotFound(_0x430497,_0x29edfb){return function(_0x141a38){if(!_0x141a38){_0x430497[_0x9896('0x29')](0x194);}return _0x141a38;};}function handleError(_0x2e53bb,_0x5c3037){_0x5c3037=_0x5c3037||0x1f4;return function(_0x3ec5f2){logger[_0x9896('0x2a')](_0x3ec5f2['stack']);if(_0x3ec5f2['name']){delete _0x3ec5f2[_0x9896('0x2b')];}_0x2e53bb[_0x9896('0x1c')](_0x5c3037)[_0x9896('0x2c')](_0x3ec5f2);};}exports[_0x9896('0x2d')]=function(_0x40da5d,_0x1cfebf){var _0x193016={'raw':!![],'where':{'id':_0x40da5d[_0x9896('0x2e')]['id']}},_0x58948d={};_0x58948d[_0x9896('0x2f')]=_['keys'](db['MailApplication']['rawAttributes']);_0x58948d[_0x9896('0x30')]=_[_0x9896('0x31')](_0x40da5d[_0x9896('0x30')]);_0x58948d[_0x9896('0x32')]=_[_0x9896('0x33')](_0x58948d['model'],_0x58948d[_0x9896('0x30')]);_0x193016[_0x9896('0x34')]=_[_0x9896('0x33')](_0x58948d[_0x9896('0x2f')],qs['fields'](_0x40da5d[_0x9896('0x30')][_0x9896('0x35')]));_0x193016[_0x9896('0x34')]=_0x193016[_0x9896('0x34')][_0x9896('0x36')]?_0x193016[_0x9896('0x34')]:_0x58948d[_0x9896('0x2f')];if(_0x40da5d[_0x9896('0x30')][_0x9896('0x37')]){_0x193016[_0x9896('0x38')]=[{'all':!![]}];}_0x193016=_['merge']({},_0x193016,_0x40da5d[_0x9896('0x39')]);return db[_0x9896('0x3a')][_0x9896('0x3b')](_0x193016)[_0x9896('0x26')](handleEntityNotFound(_0x1cfebf,null))['then'](respondWithResult(_0x1cfebf,null))['catch'](handleError(_0x1cfebf,null));};exports[_0x9896('0x25')]=function(_0x17075e,_0x29fc32){if(_0x17075e[_0x9896('0x3c')]['id']){delete _0x17075e[_0x9896('0x3c')]['id'];}return db[_0x9896('0x3a')][_0x9896('0x3b')]({'where':{'id':_0x17075e[_0x9896('0x2e')]['id']}})[_0x9896('0x26')](handleEntityNotFound(_0x29fc32,null))[_0x9896('0x26')](saveUpdates(_0x17075e['body'],null))[_0x9896('0x26')](respondWithResult(_0x29fc32,null))[_0x9896('0x3d')](handleError(_0x29fc32,null));};exports['destroy']=function(_0x16dbe7,_0x3d000f){return db[_0x9896('0x3a')]['find']({'where':{'id':_0x16dbe7[_0x9896('0x2e')]['id']}})[_0x9896('0x26')](handleEntityNotFound(_0x3d000f,null))[_0x9896('0x26')](removeEntity(_0x3d000f,null))[_0x9896('0x3d')](handleError(_0x3d000f,null));}; \ No newline at end of file +var _0x73b6=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','show','model','rawAttributes','query','keys','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','body','MailApplication','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js'];(function(_0xb6ab21,_0x31d196){var _0x33c993=function(_0xba2eb5){while(--_0xba2eb5){_0xb6ab21['push'](_0xb6ab21['shift']());}};_0x33c993(++_0x31d196);}(_0x73b6,0x6a));var _0x673b=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x73b6[_0x5b78e8];return _0xf2c321;};'use strict';var pdf=require(_0x673b('0x0'));var emlformat=require(_0x673b('0x1'));var rimraf=require(_0x673b('0x2'));var zipdir=require(_0x673b('0x3'));var jsonpatch=require(_0x673b('0x4'));var rp=require(_0x673b('0x5'));var moment=require(_0x673b('0x6'));var BPromise=require(_0x673b('0x7'));var Mustache=require(_0x673b('0x8'));var util=require(_0x673b('0x9'));var path=require(_0x673b('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x673b('0xb'));var fs=require('fs');var _=require(_0x673b('0xc'));var squel=require('squel');var crypto=require(_0x673b('0xd'));var jsforce=require(_0x673b('0xe'));var deskjs=require(_0x673b('0xf'));var toCsv=require(_0x673b('0x10'));var querystring=require(_0x673b('0x11'));var Papa=require(_0x673b('0x12'));var Redis=require(_0x673b('0x13'));var authService=require(_0x673b('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x673b('0x15'));var logger=require(_0x673b('0x16'))(_0x673b('0x17'));var utils=require(_0x673b('0x18'));var config=require(_0x673b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b87d1,_0x5e6ec4){_0x5e6ec4=_0x5e6ec4||0xcc;return function(_0x422bd0){if(_0x422bd0){return _0x4b87d1[_0x673b('0x1a')](_0x5e6ec4);}return _0x4b87d1[_0x673b('0x1b')](_0x5e6ec4)[_0x673b('0x1c')]();};}function respondWithResult(_0x370a3e,_0x2f14b1){_0x2f14b1=_0x2f14b1||0xc8;return function(_0xf3e685){if(_0xf3e685){return _0x370a3e[_0x673b('0x1b')](_0x2f14b1)[_0x673b('0x1d')](_0xf3e685);}};}function respondWithFilteredResult(_0x2636da,_0x48d338){return function(_0x321b70){if(_0x321b70){var _0x466e49=_0x321b70[_0x673b('0x1e')],_0x79b07b=_0x48d338[_0x673b('0x1f')],_0x218f92=_0x48d338[_0x673b('0x1f')]+_0x48d338[_0x673b('0x20')],_0x4fd9f3;if(_0x218f92>=_0x466e49){_0x218f92=_0x466e49;_0x4fd9f3=0xc8;}else{_0x4fd9f3=0xce;}_0x2636da['status'](_0x4fd9f3);return _0x2636da[_0x673b('0x21')]('Content-Range',_0x79b07b+'-'+_0x218f92+'/'+_0x466e49)[_0x673b('0x1d')](_0x321b70);}return null;};}function patchUpdates(_0x541eae){return function(_0x13a818){try{jsonpatch[_0x673b('0x22')](_0x13a818,_0x541eae,!![]);}catch(_0x320439){return BPromise[_0x673b('0x23')](_0x320439);}return _0x13a818[_0x673b('0x24')]();};}function saveUpdates(_0x56e034,_0xce9df7){return function(_0x822b70){if(_0x822b70){return _0x822b70[_0x673b('0x25')](_0x56e034)[_0x673b('0x26')](function(_0x5e7935){return _0x5e7935;});}return null;};}function removeEntity(_0x42bdaf,_0x4a1bc2){return function(_0x245c17){if(_0x245c17){return _0x245c17[_0x673b('0x27')]()[_0x673b('0x26')](function(){_0x42bdaf['status'](0xcc)[_0x673b('0x1c')]();});}};}function handleEntityNotFound(_0x104eb8,_0x196cad){return function(_0x59ca36){if(!_0x59ca36){_0x104eb8[_0x673b('0x1a')](0x194);}return _0x59ca36;};}function handleError(_0xa08108,_0x46d2dc){_0x46d2dc=_0x46d2dc||0x1f4;return function(_0x3516d3){logger[_0x673b('0x28')](_0x3516d3[_0x673b('0x29')]);if(_0x3516d3[_0x673b('0x2a')]){delete _0x3516d3[_0x673b('0x2a')];}_0xa08108[_0x673b('0x1b')](_0x46d2dc)[_0x673b('0x2b')](_0x3516d3);};}exports[_0x673b('0x2c')]=function(_0x99c637,_0x3ac560){var _0x424b77={'raw':!![],'where':{'id':_0x99c637['params']['id']}},_0x23e1fc={};_0x23e1fc[_0x673b('0x2d')]=_['keys'](db['MailApplication'][_0x673b('0x2e')]);_0x23e1fc[_0x673b('0x2f')]=_[_0x673b('0x30')](_0x99c637[_0x673b('0x2f')]);_0x23e1fc[_0x673b('0x31')]=_[_0x673b('0x32')](_0x23e1fc[_0x673b('0x2d')],_0x23e1fc[_0x673b('0x2f')]);_0x424b77[_0x673b('0x33')]=_['intersection'](_0x23e1fc[_0x673b('0x2d')],qs[_0x673b('0x34')](_0x99c637[_0x673b('0x2f')]['fields']));_0x424b77[_0x673b('0x33')]=_0x424b77[_0x673b('0x33')]['length']?_0x424b77[_0x673b('0x33')]:_0x23e1fc[_0x673b('0x2d')];if(_0x99c637[_0x673b('0x2f')][_0x673b('0x35')]){_0x424b77[_0x673b('0x36')]=[{'all':!![]}];}_0x424b77=_[_0x673b('0x37')]({},_0x424b77,_0x99c637[_0x673b('0x38')]);return db['MailApplication'][_0x673b('0x39')](_0x424b77)[_0x673b('0x26')](handleEntityNotFound(_0x3ac560,null))[_0x673b('0x26')](respondWithResult(_0x3ac560,null))[_0x673b('0x3a')](handleError(_0x3ac560,null));};exports[_0x673b('0x25')]=function(_0x3d8856,_0x546cea){if(_0x3d8856[_0x673b('0x3b')]['id']){delete _0x3d8856[_0x673b('0x3b')]['id'];}return db['MailApplication']['find']({'where':{'id':_0x3d8856['params']['id']}})[_0x673b('0x26')](handleEntityNotFound(_0x546cea,null))['then'](saveUpdates(_0x3d8856[_0x673b('0x3b')],null))[_0x673b('0x26')](respondWithResult(_0x546cea,null))['catch'](handleError(_0x546cea,null));};exports[_0x673b('0x27')]=function(_0x35f32b,_0x407c31){return db[_0x673b('0x3c')][_0x673b('0x39')]({'where':{'id':_0x35f32b['params']['id']}})[_0x673b('0x26')](handleEntityNotFound(_0x407c31,null))['then'](removeEntity(_0x407c31,null))['catch'](handleError(_0x407c31,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 01699d7..1cc35fc 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 _0x6e2a=['path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x414cf2,_0x2136dd){var _0x27c0dc=function(_0x46062d){while(--_0x46062d){_0x414cf2['push'](_0x414cf2['shift']());}};_0x27c0dc(++_0x2136dd);}(_0x6e2a,0x18f));var _0xa6e2=function(_0x3b330e,_0x350e11){_0x3b330e=_0x3b330e-0x0;var _0xa61a79=_0x6e2a[_0x3b330e];return _0xa61a79;};'use strict';var _=require(_0xa6e2('0x0'));var util=require(_0xa6e2('0x1'));var logger=require(_0xa6e2('0x2'))('api');var moment=require(_0xa6e2('0x3'));var BPromise=require(_0xa6e2('0x4'));var rp=require(_0xa6e2('0x5'));var fs=require('fs');var path=require(_0xa6e2('0x6'));var rimraf=require(_0xa6e2('0x7'));var config=require(_0xa6e2('0x8'));var attributes=require(_0xa6e2('0x9'));module[_0xa6e2('0xa')]=function(_0x317ae5,_0x34ce46){return _0x317ae5[_0xa6e2('0xb')](_0xa6e2('0xc'),attributes,{'tableName':_0xa6e2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa6e2('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc0a7=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x2bfe5,_0x4d9f2e){var _0x15d633=function(_0x6a5e96){while(--_0x6a5e96){_0x2bfe5['push'](_0x2bfe5['shift']());}};_0x15d633(++_0x4d9f2e);}(_0xc0a7,0xee));var _0x7c0a=function(_0x2bce24,_0x53eecb){_0x2bce24=_0x2bce24-0x0;var _0x1e1319=_0xc0a7[_0x2bce24];return _0x1e1319;};'use strict';var _=require(_0x7c0a('0x0'));var util=require(_0x7c0a('0x1'));var logger=require(_0x7c0a('0x2'))('api');var moment=require(_0x7c0a('0x3'));var BPromise=require(_0x7c0a('0x4'));var rp=require(_0x7c0a('0x5'));var fs=require('fs');var path=require(_0x7c0a('0x6'));var rimraf=require('rimraf');var config=require(_0x7c0a('0x7'));var attributes=require(_0x7c0a('0x8'));module[_0x7c0a('0x9')]=function(_0x3d906d,_0x391925){return _0x3d906d[_0x7c0a('0xa')](_0x7c0a('0xb'),attributes,{'tableName':_0x7c0a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7c0a('0xd'),'collate':_0x7c0a('0xe')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index f1ba887..f196516 100644 --- a/server/api/mailApplication/mailApplication.rpc.js +++ b/server/api/mailApplication/mailApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','MailApplication','update','body','options','raw','where','attributes','limit','then','UpdateMailApplication','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailApplication,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x2e9843,_0x42029a){var _0x57651e=function(_0x3a0d7e){while(--_0x3a0d7e){_0x2e9843['push'](_0x2e9843['shift']());}};_0x57651e(++_0x42029a);}(_0x7a54,0x106));var _0x47a5=function(_0x5077c3,_0x579280){_0x5077c3=_0x5077c3-0x0;var _0x4d2b6c=_0x7a54[_0x5077c3];return _0x4d2b6c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['UpdateMailApplication']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1a')]||null:null,'attributes':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1b')]||null:null,'limit':_0x5247fd[_0x47a5('0x18')]?_0x5247fd['options'][_0x47a5('0x1c')]||null:null})[_0x47a5('0x1d')](function(_0x23db32){logger[_0x47a5('0xb')]('UpdateMailApplication',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON['stringify'](_0x23db32));_0xaf70a6(_0x23db32);})[_0x47a5('0x14')](function(_0xc4cd63){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0xc4cd63[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xc4cd63['message']));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','MailApplication','update','body','options','raw','where','attributes','limit','then','UpdateMailApplication','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailApplication,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x5607d3,_0x3a9923){var _0x3e6599=function(_0x5afdf0){while(--_0x5afdf0){_0x5607d3['push'](_0x5607d3['shift']());}};_0x3e6599(++_0x3a9923);}(_0x7a54,0x106));var _0x47a5=function(_0x54ef4b,_0x1e06cc){_0x54ef4b=_0x54ef4b-0x0;var _0x422771=_0x7a54[_0x54ef4b];return _0x422771;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['UpdateMailApplication']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1a')]||null:null,'attributes':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1b')]||null:null,'limit':_0x5247fd[_0x47a5('0x18')]?_0x5247fd['options'][_0x47a5('0x1c')]||null:null})[_0x47a5('0x1d')](function(_0x23db32){logger[_0x47a5('0xb')]('UpdateMailApplication',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON['stringify'](_0x23db32));_0xaf70a6(_0x23db32);})[_0x47a5('0x14')](function(_0xc4cd63){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0xc4cd63[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xc4cd63['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 9080a4e..01cdbb1 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 _0x54ef=['post','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','put','tracked','delete','/:id','mailinteraction:destroy','destroy','removeTags','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','/describe','isAuthenticated','show','/:id/messages','getMessages','download'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x54ef,0x112));var _0xf54e=function(_0x4f89a4,_0x4f7464){_0x4f89a4=_0x4f89a4-0x0;var _0x54130b=_0x54ef[_0x4f89a4];return _0x54130b;};'use strict';var multer=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var path=require(_0xf54e('0x2'));var timeout=require('connect-timeout');var express=require(_0xf54e('0x3'));var router=express[_0xf54e('0x4')]();var auth=require(_0xf54e('0x5'));var interaction=require(_0xf54e('0x6'));var config=require(_0xf54e('0x7'));var controller=require(_0xf54e('0x8'));router[_0xf54e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf54e('0x9')](_0xf54e('0xa'),auth[_0xf54e('0xb')](),controller['describe']);router[_0xf54e('0x9')]('/:id',auth[_0xf54e('0xb')](),controller[_0xf54e('0xc')]);router['get'](_0xf54e('0xd'),auth[_0xf54e('0xb')](),controller[_0xf54e('0xe')]);router[_0xf54e('0x9')]('/:id/download',auth[_0xf54e('0xb')](),controller[_0xf54e('0xf')]);router[_0xf54e('0x10')]('/',auth[_0xf54e('0xb')](),controller['create']);router[_0xf54e('0x10')]('/:id/messages',auth['isAuthenticated'](),controller[_0xf54e('0x11')]);router[_0xf54e('0x10')](_0xf54e('0x12'),auth[_0xf54e('0xb')](),interaction['tracked'](_0xf54e('0x13'),_0xf54e('0x14')),controller[_0xf54e('0x15')]);router[_0xf54e('0x16')]('/:id',auth[_0xf54e('0xb')](),interaction[_0xf54e('0x17')](_0xf54e('0x13'),'mailinteraction:update'),controller['update']);router[_0xf54e('0x18')](_0xf54e('0x19'),auth[_0xf54e('0xb')](),interaction[_0xf54e('0x17')](_0xf54e('0x13'),_0xf54e('0x1a')),controller[_0xf54e('0x1b')]);router[_0xf54e('0x18')](_0xf54e('0x12'),auth[_0xf54e('0xb')](),controller[_0xf54e('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xedd9=['isAuthenticated','index','/:id','show','/:id/messages','getMessages','download','create','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x4b2135,_0x232362){var _0x19963c=function(_0x4be891){while(--_0x4be891){_0x4b2135['push'](_0x4b2135['shift']());}};_0x19963c(++_0x232362);}(_0xedd9,0xfc));var _0x9edd=function(_0x3ddf26,_0x15c898){_0x3ddf26=_0x3ddf26-0x0;var _0x32a6c3=_0xedd9[_0x3ddf26];return _0x32a6c3;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var auth=require(_0x9edd('0x5'));var interaction=require(_0x9edd('0x6'));var config=require(_0x9edd('0x7'));var controller=require('./mailInteraction.controller');router[_0x9edd('0x8')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xa')]);router[_0x9edd('0x8')]('/describe',auth[_0x9edd('0x9')](),controller['describe']);router[_0x9edd('0x8')](_0x9edd('0xb'),auth[_0x9edd('0x9')](),controller[_0x9edd('0xc')]);router['get'](_0x9edd('0xd'),auth['isAuthenticated'](),controller[_0x9edd('0xe')]);router[_0x9edd('0x8')]('/:id/download',auth[_0x9edd('0x9')](),controller[_0x9edd('0xf')]);router['post']('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')](_0x9edd('0xd'),auth[_0x9edd('0x9')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x11')](_0x9edd('0x13'),auth['isAuthenticated'](),interaction[_0x9edd('0x14')](_0x9edd('0x15'),_0x9edd('0x16')),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xb'),auth[_0x9edd('0x9')](),interaction[_0x9edd('0x14')]('mail',_0x9edd('0x19')),controller[_0x9edd('0x1a')]);router[_0x9edd('0x1b')]('/:id',auth[_0x9edd('0x9')](),interaction[_0x9edd('0x14')](_0x9edd('0x15'),'mailinteraction:destroy'),controller[_0x9edd('0x1c')]);router['delete'](_0x9edd('0x13'),auth[_0x9edd('0x9')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index df83b0d..423a740 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 _0x210a=['STRING','TEXT','ENUM','out','long','sequelize','iconv','exports','BOOLEAN','DATE'];(function(_0x52fd3d,_0x3af718){var _0x49b06d=function(_0x2f4a2b){while(--_0x2f4a2b){_0x52fd3d['push'](_0x52fd3d['shift']());}};_0x49b06d(++_0x3af718);}(_0x210a,0x1d1));var _0xa210=function(_0x1b71ad,_0x4be346){_0x1b71ad=_0x1b71ad-0x0;var _0x3b19bc=_0x210a[_0x1b71ad];return _0x3b19bc;};'use strict';var Sequelize=require(_0xa210('0x0'));var iconv=require(_0xa210('0x1'));module[_0xa210('0x2')]={'closed':{'type':Sequelize[_0xa210('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa210('0x4')]},'disposition':{'type':Sequelize[_0xa210('0x5')]},'note':{'type':Sequelize[_0xa210('0x5')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xa210('0x6')]('long')},'subject':{'type':Sequelize[_0xa210('0x6')]()},'attach':{'type':Sequelize[_0xa210('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xa210('0x4')]},'substatus':{'type':Sequelize[_0xa210('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0xa210('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xa210('0x7')]('in',_0xa210('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa210('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xa210('0x7')]('in',_0xa210('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0xa210('0x6')](_0xa210('0x9'))},'lastMsgText':{'type':Sequelize[_0xa210('0x6')]('long')}}; \ No newline at end of file +var _0x0dcf=['ENUM','iconv','exports','DATE','STRING','TEXT','long','BOOLEAN','out'];(function(_0x266c17,_0x4058fd){var _0x349d83=function(_0x11e8e0){while(--_0x11e8e0){_0x266c17['push'](_0x266c17['shift']());}};_0x349d83(++_0x4058fd);}(_0x0dcf,0xeb));var _0xf0dc=function(_0x2bad4b,_0x1456c5){_0x2bad4b=_0x2bad4b-0x0;var _0x220d87=_0x0dcf[_0x2bad4b];return _0x220d87;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0xf0dc('0x0'));module[_0xf0dc('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf0dc('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xf0dc('0x3')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xf0dc('0x4')](_0xf0dc('0x5'))},'subject':{'type':Sequelize[_0xf0dc('0x4')]()},'attach':{'type':Sequelize[_0xf0dc('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xf0dc('0x2')]},'substatus':{'type':Sequelize[_0xf0dc('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0xf0dc('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xf0dc('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xf0dc('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0xf0dc('0x4')](_0xf0dc('0x5'))},'lastMsgText':{'type':Sequelize[_0xf0dc('0x4')](_0xf0dc('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 8ecb1e1..a0062fc 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 _0xe706=['query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','mail_messages','me.MailInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','u.id','user_has_mail_interactions','left_join','mail_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','mail_accounts','me.MailInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','parse','advancedFilter','createdAt','value','dateStart','day','utc','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','unreadMessages','length','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','c.lastName','c.email','\x20LIKE\x20?','\x20>\x20?','\x20<\x20?','filter','isNil','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','$gte','$lte','null','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','split','push','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','order','i.id','Sequelize','QueryTypes','SELECT','clone','COUNT(*)','COUNT(me.id)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','sequelize','toString','count','merge','a.key','Account.key','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','ui.MailInteractionId\x20IN\x20?','MailInteractionId','Setting','all','rows','show','params','includeAll','include','options','find','create','body','describe','addMessage','MailMessage','ids','omit','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','spread','Tag','removeTags','join','root','files','attachments','server','tmp','interaction-%s.zip','getMessages','bcc','subject','Attachment','mkdirSync','headers','Bcc','Attachments','existsSync','build','writeFileSync','download','log','err','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','Users','map','TagIds','forEach','Tags','findOne','lastMsgBody','lastMsgText','trimStart','fromString','catch','MailInteraction','rawAttributes','keys'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe706,0xa3));var _0x6e70=function(_0x4a2995,_0x3644c9){_0x4a2995=_0x4a2995-0x0;var _0x5141dd=_0xe706[_0x4a2995];return _0x5141dd;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var htmlToText=require(_0x6e70('0x14'));var Redis=require(_0x6e70('0x15'));var authService=require(_0x6e70('0x16'));var qs=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var db=require(_0x6e70('0x1b'))['db'];config[_0x6e70('0x1c')]=_[_0x6e70('0x1d')](config[_0x6e70('0x1c')],{'host':_0x6e70('0x1e'),'port':0x18eb});var socket=require(_0x6e70('0x1f'))(new Redis(config[_0x6e70('0x1c')]));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x48bc72,_0x257e81){_0x257e81=_0x257e81||0xcc;return function(_0x5a37a6){if(_0x5a37a6){return _0x48bc72['sendStatus'](_0x257e81);}return _0x48bc72[_0x6e70('0x20')](_0x257e81)[_0x6e70('0x21')]();};}function respondWithResult(_0x5d9263,_0x24f3ac){_0x24f3ac=_0x24f3ac||0xc8;return function(_0x5c3fe7){if(_0x5c3fe7){return _0x5d9263[_0x6e70('0x20')](_0x24f3ac)[_0x6e70('0x22')](_0x5c3fe7);}};}function respondWithFilteredResult(_0x4ca554,_0x49029f){return function(_0x3bd572){if(_0x3bd572){var _0x5ea7a5=_0x3bd572['count'],_0x28a21f=_0x49029f[_0x6e70('0x23')],_0x173afe=_0x49029f[_0x6e70('0x23')]+_0x49029f[_0x6e70('0x24')],_0x53acdc;if(_0x173afe>=_0x5ea7a5){_0x173afe=_0x5ea7a5;_0x53acdc=0xc8;}else{_0x53acdc=0xce;}_0x4ca554[_0x6e70('0x20')](_0x53acdc);return _0x4ca554[_0x6e70('0x25')](_0x6e70('0x26'),_0x28a21f+'-'+_0x173afe+'/'+_0x5ea7a5)[_0x6e70('0x22')](_0x3bd572);}return null;};}function patchUpdates(_0x44a49f){return function(_0x29326f){try{jsonpatch[_0x6e70('0x27')](_0x29326f,_0x44a49f,!![]);}catch(_0x4a0cfe){return BPromise[_0x6e70('0x28')](_0x4a0cfe);}return _0x29326f[_0x6e70('0x29')]();};}function saveUpdates(_0x27b294,_0x502b2d){return function(_0x3ccd87){if(_0x3ccd87){return _0x3ccd87[_0x6e70('0x2a')](_0x27b294)[_0x6e70('0x2b')](function(_0x50da2c){return _0x50da2c;});}return null;};}function removeEntity(_0x10fc91,_0x538b9c){return function(_0x50aec2){if(_0x50aec2){return _0x50aec2['destroy']()[_0x6e70('0x2b')](function(){_0x10fc91[_0x6e70('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ecdf1,_0x1196ed){return function(_0x5f268f){if(!_0x5f268f){_0x3ecdf1[_0x6e70('0x2c')](0x194);}return _0x5f268f;};}function handleError(_0x67fb43,_0x2bb231){_0x2bb231=_0x2bb231||0x1f4;return function(_0x4a67ac){logger['error'](_0x4a67ac[_0x6e70('0x2d')]);if(_0x4a67ac[_0x6e70('0x2e')]){delete _0x4a67ac[_0x6e70('0x2e')];}_0x67fb43[_0x6e70('0x20')](_0x2bb231)[_0x6e70('0x2f')](_0x4a67ac);};}function getInteractionUsers(_0x5d772a,_0x1952ea){return new BPromise(function(_0x406f29,_0xecf336){try{if(_0x1952ea[_0x5d772a['id']]){_0x5d772a[_0x6e70('0x30')]=_[_0x6e70('0x31')](_0x1952ea[_0x5d772a['id']],function(_0x20a225){return{'id':_0x20a225['id']};});}}catch(_0x3f78d2){_0xecf336(_0x3f78d2);}_0x406f29(_0x5d772a);});}function getInteractionTags(_0x24114a,_0x3a0821){return new BPromise(function(_0x3a5d30,_0x4b1229){try{if(_0x24114a[_0x6e70('0x32')]){_0x24114a['Tags']=[];_0x24114a[_0x6e70('0x32')]['split'](',')[_0x6e70('0x33')](function(_0x2722e8){_0x24114a[_0x6e70('0x34')]['push'](_0x3a0821[_0x2722e8]);});}delete _0x24114a[_0x6e70('0x32')];}catch(_0x42b094){_0x4b1229(_0x42b094);}_0x3a5d30(_0x24114a);});}function getLastMessageText(_0x5780a1){return new BPromise(function(_0x13d673,_0x154925){return db['MailInteraction'][_0x6e70('0x35')]({'where':{'id':_0x5780a1['id']},'attributes':[_0x6e70('0x36'),_0x6e70('0x37')],'raw':!![]})[_0x6e70('0x2b')](function(_0x3b4a13){if(!_0x3b4a13[_0x6e70('0x37')]){_0x5780a1[_0x6e70('0x37')]=_[_0x6e70('0x38')](htmlToText[_0x6e70('0x39')](_0x3b4a13[_0x6e70('0x36')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x5780a1['lastMsgText']=_0x3b4a13[_0x6e70('0x37')];}_0x13d673(_0x5780a1);})['catch'](function(_0x23cd1a){_0x154925(_0x23cd1a);});});}function updateMailInteraction(_0x3222a2,_0x98c683,_0x32d12d,_0x233a83){return new BPromise(function(_0x989b80,_0x2440be){return getInteractionUsers(_0x3222a2,_0x32d12d)[_0x6e70('0x2b')](function(_0x80bebb){return getInteractionTags(_0x80bebb,_0x98c683);})[_0x6e70('0x2b')](function(_0x2a5444){if(_0x233a83){_0x989b80(getLastMessageText(_0x2a5444));}else{_0x989b80(_0x2a5444);}})[_0x6e70('0x3a')](function(_0x5594d3){_0x2440be(_0x5594d3);});});}exports['index']=function(_0x5446a2,_0x5424eb){var _0x155a46={},_0x3841a0={},_0x2cb5b0={'count':0x0,'rows':[]};var _0x1f6955=db[_0x6e70('0x3b')][_0x6e70('0x3c')];_0x3841a0['model']=_[_0x6e70('0x3d')](_0x1f6955);_0x3841a0[_0x6e70('0x3e')]=_[_0x6e70('0x3d')](_0x5446a2[_0x6e70('0x3e')]);_0x3841a0[_0x6e70('0x3f')]=_[_0x6e70('0x40')](_0x3841a0[_0x6e70('0x41')],_0x3841a0[_0x6e70('0x3e')]);_0x155a46['attributes']=_[_0x6e70('0x40')](_0x3841a0[_0x6e70('0x41')],qs[_0x6e70('0x42')](_0x5446a2[_0x6e70('0x3e')][_0x6e70('0x42')]));_0x155a46[_0x6e70('0x43')]=_0x155a46[_0x6e70('0x43')]['length']?_0x155a46['attributes']:_0x3841a0['model'];if(!_0x5446a2[_0x6e70('0x3e')][_0x6e70('0x44')](_0x6e70('0x45'))){_0x155a46[_0x6e70('0x24')]=qs[_0x6e70('0x24')](_0x5446a2['query'][_0x6e70('0x24')]);_0x155a46[_0x6e70('0x23')]=qs[_0x6e70('0x23')](_0x5446a2['query']['offset']);}_0x155a46['order']=qs[_0x6e70('0x46')](_0x5446a2['query'][_0x6e70('0x46')]);_0x155a46[_0x6e70('0x47')]=qs[_0x6e70('0x3f')](_[_0x6e70('0x48')](_0x5446a2['query'],_0x3841a0[_0x6e70('0x3f')]));var _0x4d1243=[];var _0x9f5b94=squel[_0x6e70('0x49')]()[_0x6e70('0x4a')]('id')[_0x6e70('0x4a')]('name')[_0x6e70('0x4a')](_0x6e70('0x4b'))[_0x6e70('0x4c')](_0x6e70('0x4d'));var _0x8f243d=squel[_0x6e70('0x49')]()[_0x6e70('0x4a')]('COUNT(*)')[_0x6e70('0x4c')](_0x6e70('0x4e'),'me')[_0x6e70('0x47')](_0x6e70('0x4f'))[_0x6e70('0x47')](_0x6e70('0x50'))[_0x6e70('0x47')]('me.read\x20=\x20false');var _0x3f5c89=squel['select']()[_0x6e70('0x4a')](_0x6e70('0x51'))['field']('ui.MailInteractionId')[_0x6e70('0x4c')](_0x6e70('0x52'),'ui')[_0x6e70('0x53')]('users','u','u.id\x20=\x20ui.UserId');var _0x238ebb=squel[_0x6e70('0x49')]()[_0x6e70('0x4c')](_0x6e70('0x54'),'i')[_0x6e70('0x53')](_0x6e70('0x55'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x6e70('0x53')](_0x6e70('0x56'),'o',_0x6e70('0x57'))[_0x6e70('0x53')](_0x6e70('0x58'),'a','a.id\x20=\x20i.MailAccountId')['left_join'](_0x6e70('0x4e'),'me',_0x6e70('0x59'));var _0x34fdba=squel[_0x6e70('0x5a')]();if(_0x5446a2[_0x6e70('0x3e')]['advancedFilter']){var _0x4b201f=JSON[_0x6e70('0x5b')](_0x5446a2[_0x6e70('0x3e')][_0x6e70('0x5c')]);_[_0x6e70('0x3d')](_0x4b201f)['forEach'](function(_0x1142cd){var _0x1dd242=_0x4b201f[_0x1142cd];if(_0x1142cd===_0x6e70('0x5d')){var _0x3fb0d3=moment(_0x1dd242[_0x6e70('0x5e')][_0x6e70('0x5f')])['startOf'](_0x6e70('0x60'))[_0x6e70('0x61')]()['format']();var _0x382fde=moment(_0x382fde)[_0x6e70('0x61')]()['endOf'](_0x6e70('0x60'))[_0x6e70('0x62')]();_0x34fdba[_0x6e70('0x63')](_0x6e70('0x64'),_0x3fb0d3,_0x382fde);}else{if(_[_0x6e70('0x65')](_0x1dd242['condition'])){_0x1dd242[_0x6e70('0x66')][_0x6e70('0x33')](function(_0x10d655){switch(_0x1dd242[_0x6e70('0x66')][_0x6e70('0x5e')]){case'IS':if(_0x1142cd!==_0x6e70('0x67')&&_0x1142cd!==_0x6e70('0x68')){if(_[_0x6e70('0x65')](_0x1dd242[_0x6e70('0x5e')])&&_0x1dd242[_0x6e70('0x5e')][_0x6e70('0x69')]>0x1){_0x34fdba[_0x6e70('0x63')](_0x1dd242[_0x6e70('0x6a')]+'.'+_0x1142cd+_0x6e70('0x6b'),_0x1dd242[_0x6e70('0x5e')]);}else{_0x34fdba[_0x6e70('0x63')](_0x1dd242[_0x6e70('0x6a')]+'.'+_0x1142cd+_0x6e70('0x6c'),_0x1dd242[_0x6e70('0x5e')][0x0]);}}break;case'=':_0x34fdba[_0x6e70('0x63')](_0x1dd242['tableAlias']+'.'+_0x1142cd+_0x6e70('0x6c'),_0x1dd242[_0x6e70('0x5e')]);break;case _0x6e70('0x6d'):if(_0x1142cd===_0x6e70('0x6e')){_0x34fdba[_0x6e70('0x63')](_0x6e70('0x6f')+'\x20LIKE\x20?','%'+_0x1dd242[_0x6e70('0x5e')]+'%');_0x34fdba['or'](_0x6e70('0x70')+'\x20LIKE\x20?','%'+_0x1dd242[_0x6e70('0x5e')]+'%');_0x34fdba['or'](_0x6e70('0x71')+_0x6e70('0x72'),'%'+_0x1dd242['value']+'%');}else{_0x34fdba['and'](_0x1dd242[_0x6e70('0x6a')]+'.'+_0x1142cd+_0x6e70('0x72'),'%'+_0x1dd242[_0x6e70('0x5e')]+'%');}break;case'>':_0x34fdba[_0x6e70('0x63')](_0x1dd242[_0x6e70('0x6a')]+'.'+_0x1142cd+_0x6e70('0x73'),_0x1dd242[_0x6e70('0x5e')]);break;case'<':_0x34fdba['and'](_0x1dd242['tableAlias']+'.'+_0x1142cd+_0x6e70('0x74'),_0x1dd242[_0x6e70('0x5e')]);break;}});}else{switch(_0x1dd242[_0x6e70('0x66')][_0x6e70('0x5e')]){case'IS':if(_0x1142cd!=='TagId'&&_0x1142cd!=='unreadMessages'){if(_[_0x6e70('0x65')](_0x1dd242[_0x6e70('0x5e')])&&_0x1dd242['value']['length']>0x1){_0x34fdba[_0x6e70('0x63')](_0x1dd242['tableAlias']+'.'+_0x1142cd+_0x6e70('0x6b'),_0x1dd242[_0x6e70('0x5e')]);}else{_0x34fdba[_0x6e70('0x63')](_0x1dd242[_0x6e70('0x6a')]+'.'+_0x1142cd+_0x6e70('0x6c'),_0x1dd242[_0x6e70('0x5e')][0x0]);}}break;case'=':_0x34fdba[_0x6e70('0x63')](_0x1dd242[_0x6e70('0x6a')]+'.'+_0x1142cd+'\x20=\x20?',_0x1dd242[_0x6e70('0x5e')]);break;case _0x6e70('0x6d'):if(_0x1142cd===_0x6e70('0x6e')){_0x34fdba[_0x6e70('0x63')](_0x6e70('0x6f')+'\x20LIKE\x20?','%'+_0x1dd242['value']+'%');_0x34fdba['or']('c.lastName'+_0x6e70('0x72'),'%'+_0x1dd242[_0x6e70('0x5e')]+'%');_0x34fdba['or'](_0x6e70('0x71')+'\x20LIKE\x20?','%'+_0x1dd242['value']+'%');}else{_0x34fdba[_0x6e70('0x63')](_0x1dd242[_0x6e70('0x6a')]+'.'+_0x1142cd+_0x6e70('0x72'),'%'+_0x1dd242[_0x6e70('0x5e')]+'%');}break;case'>':_0x34fdba[_0x6e70('0x63')](_0x1dd242[_0x6e70('0x6a')]+'.'+_0x1142cd+'\x20>\x20?',_0x1dd242[_0x6e70('0x5e')]);break;case'<':_0x34fdba[_0x6e70('0x63')](_0x1dd242[_0x6e70('0x6a')]+'.'+_0x1142cd+_0x6e70('0x74'),_0x1dd242['value']);break;}}}});}else{var _0xce964b=_(Object['keys'](_0x5446a2['query']))[_0x6e70('0x31')](function(_0x3249a5){return _0x1f6955[_0x6e70('0x44')](_0x3249a5)?_0x3249a5:undefined;})[_0x6e70('0x75')](function(_0x326584){return!_[_0x6e70('0x76')](_0x326584);})['value']();if(!_[_0x6e70('0x77')](_0xce964b)){_0xce964b[_0x6e70('0x33')](function(_0x186550){if(_0x186550===_0x6e70('0x78')){_0x238ebb[_0x6e70('0x47')](_0x6e70('0x79'),[][_0x6e70('0x7a')](_0x5446a2[_0x6e70('0x3e')][_0x186550]));}else if(_0x186550===_0x6e70('0x5d')){var _0x29621a=JSON['parse'](_0x5446a2[_0x6e70('0x3e')][_0x186550])[_0x6e70('0x7b')];var _0x577c3b=JSON['parse'](_0x5446a2['query'][_0x186550])[_0x6e70('0x7c')];_0x238ebb[_0x6e70('0x47')](_0x6e70('0x64'),_0x29621a,_0x577c3b);}else{if(_0x5446a2[_0x6e70('0x3e')][_0x186550]===_0x6e70('0x7d')){_0x238ebb['where']('i.'+_0x186550+'\x20IS\x20NULL');}else{_0x238ebb[_0x6e70('0x47')]('i.'+_0x186550+_0x6e70('0x6c'),_0x5446a2['query'][_0x186550]);}}});}if(_0x5446a2[_0x6e70('0x3e')][_0x6e70('0x75')]){var _0xf7a034=_0x5446a2[_0x6e70('0x3e')][_0x6e70('0x75')][_0x6e70('0x7e')]('\x5c','\x5c\x5c')[_0x6e70('0x7e')]('\x27\x27',_0x6e70('0x7f'));if(qs[_0x6e70('0x80')](_0xf7a034)){_0x34fdba['or'](_0x6e70('0x81'),_0xf7a034+'%');}else if(qs[_0x6e70('0x82')](_0xf7a034)){_0x34fdba['or'](_0x6e70('0x83'),_0xf7a034+'%');}else{var _0x2eb58b=[];_0xf7a034[_0x6e70('0x84')]('\x20')['forEach'](function(_0x5b3cb0){_0x2eb58b[_0x6e70('0x85')]('+'+_0x5b3cb0['toString']());});var _0x267dcb=_0x2eb58b['join']('\x20');_0x34fdba['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x267dcb)['or'](_0x6e70('0x86'),_0x267dcb);}}}_0x238ebb['where'](_0x34fdba);if(_0x155a46['order']){_0x155a46[_0x6e70('0x87')][_0x6e70('0x33')](function(_0x3d1b42){_0x238ebb['order']('i.'+_0x3d1b42[0x0],_0x3d1b42[0x1]==='DESC'?![]:!![]);});}_0x238ebb['group'](_0x6e70('0x88'));var _0x512b0a={'type':db[_0x6e70('0x89')][_0x6e70('0x8a')][_0x6e70('0x8b')],'raw':!![]};var _0x3fe93d=_0x238ebb[_0x6e70('0x8c')]()[_0x6e70('0x4a')](_0x6e70('0x8d'))['field'](_0x6e70('0x8e'),_0x6e70('0x68'));if(!_0x5446a2[_0x6e70('0x3e')]['advancedFilter']){if(_0x5446a2[_0x6e70('0x3e')][_0x6e70('0x8f')]){if(_0x5446a2[_0x6e70('0x3e')][_0x6e70('0x8f')]==0x1){_0x3fe93d[_0x6e70('0x90')](_0x6e70('0x91'));_0x238ebb[_0x6e70('0x90')](_0x6e70('0x91'));}else{_0x3fe93d[_0x6e70('0x90')]('`unreadMessages`\x20>\x200');_0x238ebb[_0x6e70('0x90')](_0x6e70('0x92'));}}if(_0x5446a2['query'][_0x6e70('0x93')]){var _0x3d29e0=_['isArray'](_0x5446a2['query'][_0x6e70('0x93')])?_0x5446a2['query'][_0x6e70('0x93')]:new Array(_0x5446a2['query'][_0x6e70('0x93')]);var _0x459a51=squel[_0x6e70('0x5a')]();_0x3d29e0[_0x6e70('0x33')](function(_0x2ffc87){_0x459a51['or'](_0x6e70('0x94'),'%,'+_0x2ffc87+',%');});_0x238ebb[_0x6e70('0x90')](_0x459a51);_0x3fe93d['left_join']('mail_interaction_has_tags','it',_0x6e70('0x95'));_0x3fe93d['left_join'](_0x6e70('0x4d'),'t',_0x6e70('0x96'));_0x3fe93d[_0x6e70('0x47')](_0x6e70('0x97'),_0x3d29e0);}}else{var _0x4b201f=JSON[_0x6e70('0x5b')](_0x5446a2['query'][_0x6e70('0x5c')]);_[_0x6e70('0x3d')](_0x4b201f)[_0x6e70('0x33')](function(_0x44cf73){var _0x35aff6=_0x4b201f[_0x44cf73];if(_0x44cf73===_0x6e70('0x67')){var _0x2c3bf6=_0x35aff6['value'];var _0x1d6acf=squel['expr']();_0x2c3bf6[_0x6e70('0x33')](function(_0x5f1e62){_0x1d6acf['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5f1e62+',%');});_0x238ebb['having'](_0x1d6acf);_0x3fe93d[_0x6e70('0x53')](_0x6e70('0x98'),'it',_0x6e70('0x95'));_0x3fe93d[_0x6e70('0x53')](_0x6e70('0x4d'),'t','t.id\x20=\x20it.TagId');_0x3fe93d[_0x6e70('0x47')](_0x6e70('0x97'),_0x2c3bf6);}else if(_0x44cf73==='unreadMessages'){if(_0x35aff6[_0x6e70('0x5e')]['length']===0x1){if(_0x35aff6[_0x6e70('0x5e')][0x0]===0x1){_0x3fe93d['having']('`unreadMessages`\x20=\x200');_0x238ebb[_0x6e70('0x90')](_0x6e70('0x91'));}else{_0x3fe93d[_0x6e70('0x90')](_0x6e70('0x92'));_0x238ebb[_0x6e70('0x90')](_0x6e70('0x92'));}}}});}db[_0x6e70('0x99')]['query'](_0x3fe93d[_0x6e70('0x9a')](),_0x512b0a)['then'](function(_0x1e74c0){_0x2cb5b0[_0x6e70('0x9b')]=_0x1e74c0[_0x6e70('0x69')];if(_0x2cb5b0[_0x6e70('0x9b')]===0x0)return[];return db[_0x6e70('0x99')][_0x6e70('0x3e')](_0x9f5b94[_0x6e70('0x9a')](),_0x512b0a)['then'](function(_0x4466f0){_0x4d1243=_['keyBy'](_0x4466f0,'id');_0x512b0a=_[_0x6e70('0x9c')](_0x512b0a,{'model':db[_0x6e70('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x238ebb[_0x6e70('0x4a')](_0x6e70('0x8e'),_0x6e70('0x68'));_0x238ebb[_0x6e70('0x4a')](_0x6e70('0x9d'),_0x6e70('0x9e'));_0x238ebb[_0x6e70('0x4a')](_0x6e70('0x88'));_0x238ebb['field'](_0x6e70('0x9f'));_0x238ebb[_0x6e70('0x4a')](_0x6e70('0xa0'));_0x238ebb[_0x6e70('0x4a')](_0x6e70('0xa1'));_0x238ebb['field']('i.closedAt');_0x238ebb['field'](_0x6e70('0xa2'));_0x238ebb[_0x6e70('0x4a')](_0x6e70('0xa3'));_0x238ebb[_0x6e70('0x4a')](_0x6e70('0xa4'));_0x238ebb[_0x6e70('0x4a')](_0x6e70('0xa5'));_0x238ebb[_0x6e70('0x4a')](_0x6e70('0xa6'));_0x238ebb[_0x6e70('0x4a')](_0x6e70('0xa7'));_0x238ebb[_0x6e70('0x4a')](_0x6e70('0xa8'));_0x238ebb[_0x6e70('0x4a')](_0x6e70('0xa9'));_0x238ebb['field'](_0x6e70('0xaa'));_0x238ebb[_0x6e70('0x4a')](_0x6e70('0xab'));_0x238ebb[_0x6e70('0x4a')](_0x6e70('0x6f'),_0x6e70('0xac'));_0x238ebb['field']('c.lastName',_0x6e70('0xad'));_0x238ebb[_0x6e70('0x4a')](_0x6e70('0x71'),_0x6e70('0xae'));_0x238ebb[_0x6e70('0x4a')](_0x6e70('0xaf'),_0x6e70('0xb0'));_0x238ebb['field'](_0x6e70('0xb1'),'Contact.mobile');_0x238ebb[_0x6e70('0x4a')](_0x6e70('0xb2'),_0x6e70('0xb3'));_0x238ebb[_0x6e70('0x4a')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x6e70('0x32'));_0x238ebb[_0x6e70('0x53')]('mail_interaction_has_tags','it',_0x6e70('0x95'));_0x238ebb['left_join'](_0x6e70('0x4d'),'t','t.id\x20=\x20it.TagId');_0x238ebb['limit'](_0x155a46[_0x6e70('0x24')]);_0x238ebb[_0x6e70('0x23')](_0x155a46[_0x6e70('0x23')]);return db['sequelize'][_0x6e70('0x3e')](_0x238ebb[_0x6e70('0x9a')](),_0x512b0a);})['then'](function(_0x30acfb){_0x3f5c89[_0x6e70('0x47')](_0x6e70('0xb4'),_[_0x6e70('0x31')](_0x30acfb,'id'));return db[_0x6e70('0x99')][_0x6e70('0x3e')](_0x3f5c89[_0x6e70('0x9a')](),_0x512b0a)[_0x6e70('0x2b')](function(_0x46cf82){var _0x534ffb=_['groupBy'](_0x46cf82,_0x6e70('0xb5'));var _0x564d55=[];return db[_0x6e70('0xb6')][_0x6e70('0x35')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0x6e70('0x2b')](function(_0x1dce0b){var _0x43c0a7=_0x1dce0b['enableEmailPreview'];_0x30acfb[_0x6e70('0x33')](function(_0x25e567){_0x564d55[_0x6e70('0x85')](updateMailInteraction(_0x25e567,_0x4d1243,_0x534ffb,_0x43c0a7));});return BPromise[_0x6e70('0xb7')](_0x564d55);});});});})[_0x6e70('0x2b')](function(_0x2bce15){_0x2cb5b0[_0x6e70('0xb8')]=_0x2bce15;return _0x2cb5b0;})[_0x6e70('0x2b')](respondWithFilteredResult(_0x5424eb,_0x155a46))[_0x6e70('0x3a')](handleError(_0x5424eb,null));};exports[_0x6e70('0xb9')]=function(_0x273ed6,_0x41b70a){var _0x5f41ae={'raw':![],'where':{'id':_0x273ed6[_0x6e70('0xba')]['id']}},_0x5bcfcf={};_0x5bcfcf[_0x6e70('0x41')]=_[_0x6e70('0x3d')](db[_0x6e70('0x3b')][_0x6e70('0x3c')]);_0x5bcfcf['query']=_[_0x6e70('0x3d')](_0x273ed6[_0x6e70('0x3e')]);_0x5bcfcf[_0x6e70('0x3f')]=_['intersection'](_0x5bcfcf[_0x6e70('0x41')],_0x5bcfcf['query']);_0x5f41ae['attributes']=_[_0x6e70('0x40')](_0x5bcfcf[_0x6e70('0x41')],qs[_0x6e70('0x42')](_0x273ed6[_0x6e70('0x3e')]['fields']));_0x5f41ae[_0x6e70('0x43')]=_0x5f41ae[_0x6e70('0x43')]['length']?_0x5f41ae['attributes']:_0x5bcfcf['model'];if(_0x273ed6[_0x6e70('0x3e')][_0x6e70('0xbb')]){_0x5f41ae[_0x6e70('0xbc')]=[{'all':!![]}];}_0x5f41ae=_[_0x6e70('0x9c')]({},_0x5f41ae,_0x273ed6[_0x6e70('0xbd')]);return db[_0x6e70('0x3b')][_0x6e70('0xbe')](_0x5f41ae)['then'](handleEntityNotFound(_0x41b70a,null))[_0x6e70('0x2b')](respondWithResult(_0x41b70a,null))[_0x6e70('0x3a')](handleError(_0x41b70a,null));};exports[_0x6e70('0xbf')]=function(_0x6a4149,_0x3ec6da){return db[_0x6e70('0x3b')][_0x6e70('0xbf')](_0x6a4149[_0x6e70('0xc0')],{})[_0x6e70('0x2b')](respondWithResult(_0x3ec6da,0xc9))[_0x6e70('0x3a')](handleError(_0x3ec6da,null));};exports[_0x6e70('0x2a')]=function(_0x321da8,_0x5b4a66){if(_0x321da8[_0x6e70('0xc0')]['id']){delete _0x321da8[_0x6e70('0xc0')]['id'];}return db[_0x6e70('0x3b')]['find']({'where':{'id':_0x321da8[_0x6e70('0xba')]['id']}})[_0x6e70('0x2b')](handleEntityNotFound(_0x5b4a66,null))[_0x6e70('0x2b')](saveUpdates(_0x321da8[_0x6e70('0xc0')],null))[_0x6e70('0x2b')](respondWithResult(_0x5b4a66,null))[_0x6e70('0x3a')](handleError(_0x5b4a66,null));};exports['destroy']=function(_0x4a2d17,_0x454149){return db[_0x6e70('0x3b')][_0x6e70('0xbe')]({'where':{'id':_0x4a2d17[_0x6e70('0xba')]['id']}})[_0x6e70('0x2b')](handleEntityNotFound(_0x454149,null))[_0x6e70('0x2b')](removeEntity(_0x454149,null))['catch'](handleError(_0x454149,null));};exports[_0x6e70('0xc1')]=function(_0xdaad1a,_0x34ab4c){return db[_0x6e70('0x3b')][_0x6e70('0xc1')]()[_0x6e70('0x2b')](respondWithResult(_0x34ab4c,null))[_0x6e70('0x3a')](handleError(_0x34ab4c,null));};exports[_0x6e70('0xc2')]=function(_0x3d703c,_0x1e31c5,_0xd2d74f){return db[_0x6e70('0xc3')][_0x6e70('0xbe')]({'where':{'id':_0x3d703c[_0x6e70('0xba')]['id']}})[_0x6e70('0x2b')](handleEntityNotFound(_0x1e31c5,null))[_0x6e70('0x2b')](function(_0x3b9f61){if(_0x3b9f61){return _0x3b9f61['addMessage'](_0x3d703c['body'][_0x6e70('0xc4')],_[_0x6e70('0xc5')](_0x3d703c[_0x6e70('0xc0')],[_0x6e70('0xc4'),'id'])||{});}})[_0x6e70('0x2b')](respondWithResult(_0x1e31c5,null))[_0x6e70('0x3a')](handleError(_0x1e31c5,null));};exports['getMessages']=function(_0x8476fd,_0x59ac79,_0x2f05b2){var _0x4c06bd={'raw':![],'where':{}};var _0x2f2b92={};var _0x5a6164={'count':0x0,'rows':[]};return db[_0x6e70('0x3b')][_0x6e70('0x35')]({'where':{'id':_0x8476fd[_0x6e70('0xba')]['id']}})['then'](handleEntityNotFound(_0x59ac79,null))[_0x6e70('0x2b')](function(_0x21209e){if(_0x21209e){_0x2f2b92[_0x6e70('0x41')]=_[_0x6e70('0x3d')](db[_0x6e70('0xc3')][_0x6e70('0x3c')]);_0x2f2b92[_0x6e70('0x3e')]=_['keys'](_0x8476fd[_0x6e70('0x3e')]);_0x2f2b92[_0x6e70('0x3f')]=_['intersection'](_0x2f2b92[_0x6e70('0x41')],_0x2f2b92[_0x6e70('0x3e')]);_0x4c06bd['attributes']=_['intersection'](_0x2f2b92[_0x6e70('0x41')],qs['fields'](_0x8476fd[_0x6e70('0x3e')][_0x6e70('0x42')]));_0x4c06bd[_0x6e70('0x43')]=_0x4c06bd[_0x6e70('0x43')][_0x6e70('0x69')]?_0x4c06bd[_0x6e70('0x43')]:_0x2f2b92[_0x6e70('0x41')];if(!_0x8476fd[_0x6e70('0x3e')][_0x6e70('0x44')](_0x6e70('0x45'))){_0x4c06bd[_0x6e70('0x24')]=qs[_0x6e70('0x24')](_0x8476fd[_0x6e70('0x3e')]['limit']);_0x4c06bd[_0x6e70('0x23')]=qs[_0x6e70('0x23')](_0x8476fd[_0x6e70('0x3e')][_0x6e70('0x23')]);}_0x4c06bd[_0x6e70('0x87')]=qs[_0x6e70('0x46')](_0x8476fd[_0x6e70('0x3e')][_0x6e70('0x46')]);_0x4c06bd[_0x6e70('0x47')]=qs['filters'](_[_0x6e70('0x48')](_0x8476fd[_0x6e70('0x3e')],_0x2f2b92[_0x6e70('0x3f')]));_0x4c06bd['where'][_0x6e70('0xb5')]=_0x21209e['id'];if(_0x8476fd[_0x6e70('0x3e')][_0x6e70('0x75')]){_0x4c06bd[_0x6e70('0x47')]=_['merge'](_0x4c06bd['where'],{'$or':_[_0x6e70('0x31')](_0x4c06bd['attributes'],function(_0x4fa241){var _0x34da0c={};_0x34da0c[_0x4fa241]={'$like':'%'+_0x8476fd[_0x6e70('0x3e')][_0x6e70('0x75')]+'%'};return _0x34da0c;})});}if(_0x8476fd[_0x6e70('0x3e')][_0x6e70('0x7b')]){var _0x22827=_0x8476fd[_0x6e70('0x3e')][_0x6e70('0x7b')][_0x6e70('0x84')](',');var _0x41df1b={};_0x41df1b[_0x22827[0x0]]={'$gte':moment(_0x22827[0x1])['format'](_0x6e70('0xc6'))};_0x4c06bd[_0x6e70('0x47')]=_[_0x6e70('0x9c')](_0x4c06bd[_0x6e70('0x47')],_0x41df1b);}_0x4c06bd=_[_0x6e70('0x9c')]({},_0x4c06bd,_0x8476fd[_0x6e70('0xbd')]);return db[_0x6e70('0xc3')][_0x6e70('0x9b')]({'where':_0x4c06bd[_0x6e70('0x47')]})[_0x6e70('0x2b')](function(_0x4fcbd8){_0x5a6164['count']=_0x4fcbd8;if(_0x8476fd['query']['includeAll']){_0x4c06bd[_0x6e70('0xbc')]=[{'all':!![]}];}return db[_0x6e70('0xc3')][_0x6e70('0xc7')](_0x4c06bd);})['then'](function(_0xff81ac){_0x5a6164['rows']=_0xff81ac;return _0x5a6164;});}})[_0x6e70('0x2b')](respondWithFilteredResult(_0x59ac79,_0x4c06bd))['catch'](handleError(_0x59ac79,null));};exports['addTags']=function(_0xe4b9f8,_0x1721b9,_0x3668d5){return db[_0x6e70('0x3b')][_0x6e70('0xbe')]({'where':{'id':_0xe4b9f8[_0x6e70('0xba')]['id']}})[_0x6e70('0x2b')](handleEntityNotFound(_0x1721b9,null))['then'](function(_0x2ec683){if(_0x2ec683){return _0x2ec683[_0x6e70('0xc8')](_0xe4b9f8['body'][_0x6e70('0xc4')],_[_0x6e70('0xc5')](_0xe4b9f8[_0x6e70('0xc0')],['ids','id'])||{})[_0x6e70('0xc9')](function(){return db[_0x6e70('0xca')]['findAll']({'attributes':['id','name',_0x6e70('0x4b')],'where':{'id':_0xe4b9f8[_0x6e70('0xc0')][_0x6e70('0xc4')]}});})[_0x6e70('0x2b')](function(_0x2943a6){socket['emit']('mailInteractionTags:save',{'id':Number(_0xe4b9f8[_0x6e70('0xba')]['id']),'tags':_0x2943a6||[]});return{'id':Number(_0xe4b9f8[_0x6e70('0xba')]['id']),'tags':_0x2943a6||[]};});}})[_0x6e70('0x2b')](respondWithResult(_0x1721b9,null))['catch'](handleError(_0x1721b9,null));};exports[_0x6e70('0xcb')]=function(_0x3a8f49,_0xcdfd32,_0x231873){return db[_0x6e70('0x3b')][_0x6e70('0xbe')]({'where':{'id':_0x3a8f49[_0x6e70('0xba')]['id']}})[_0x6e70('0x2b')](handleEntityNotFound(_0xcdfd32,null))[_0x6e70('0x2b')](function(_0x297ebe){if(_0x297ebe){return _0x297ebe['removeTags'](_0x3a8f49[_0x6e70('0x3e')][_0x6e70('0xc4')]);}})[_0x6e70('0x2b')](respondWithStatusCode(_0xcdfd32,null))[_0x6e70('0x3a')](handleError(_0xcdfd32,null));};exports['download']=function(_0x7ffbdf,_0x1eb2ae){var _0x13c15f=moment()['unix']()[_0x6e70('0x9a')]();var _0x20b50d=path[_0x6e70('0xcc')](config[_0x6e70('0xcd')],'server',_0x6e70('0xce'),_0x6e70('0xcf'));var _0x7db944=path[_0x6e70('0xcc')](config[_0x6e70('0xcd')],_0x6e70('0xd0'),_0x6e70('0xce'),_0x6e70('0xd1'));var _0x2eb49f=path[_0x6e70('0xcc')](_0x7db944,_0x13c15f);var _0x4e0788=util['format'](_0x6e70('0xd2'),_0x13c15f);var _0x3dec80=path[_0x6e70('0xcc')](_0x7db944,_0x4e0788);var _0x3e3ac2=![];return db[_0x6e70('0x3b')][_0x6e70('0xbe')]({'where':{'id':_0x7ffbdf[_0x6e70('0xba')]['id']}})[_0x6e70('0x2b')](handleEntityNotFound(_0x1eb2ae,null))[_0x6e70('0x2b')](function(_0x166244){if(_0x166244){return _0x166244[_0x6e70('0xd3')]({'attributes':['id',_0x6e70('0xc0'),_0x6e70('0x4c'),'to','cc',_0x6e70('0xd4'),_0x6e70('0xd5'),'createdAt'],'where':{'secret':![]},'include':_0x7ffbdf[_0x6e70('0x3e')][_0x6e70('0xcf')]?[{'model':db[_0x6e70('0xd6')],'as':'Attachments'}]:undefined,'order':qs[_0x6e70('0x46')]('id')});}return[];})[_0x6e70('0x2b')](function(_0xdfa993){_0x3e3ac2=_0xdfa993[_0x6e70('0x69')];if(_0xdfa993[_0x6e70('0x69')]){fs[_0x6e70('0xd7')](_0x2eb49f);return BPromise['each'](_0xdfa993,function(_0x139751,_0x2669f1){var _0x486c80=_0x139751;var _0x1021bf={'from':_0x486c80[_0x6e70('0x4c')],'to':_0x486c80['to'],'subject':_0x486c80[_0x6e70('0xd5')],'html':_0x486c80[_0x6e70('0xc0')],'headers':{'Date':moment(_0x486c80[_0x6e70('0x5d')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x139751['cc']){_0x1021bf[_0x6e70('0xd8')]['Cc']=_0x139751['cc'];}if(_0x139751['bcc']){_0x1021bf[_0x6e70('0xd8')][_0x6e70('0xd9')]=_0x139751[_0x6e70('0xd4')];}return new BPromise(function(_0x50b1b0,_0x2afe2e){if(_0x139751['Attachments']){for(var _0x103f3c=0x0;_0x103f3c<_0x139751[_0x6e70('0xda')][_0x6e70('0x69')];_0x103f3c++){var _0x14086b=_0x139751[_0x6e70('0xda')][_0x103f3c];var _0x38efd0=path['join'](_0x20b50d,_0x14086b['basename']);if(fs[_0x6e70('0xdb')](_0x38efd0)){_0x1021bf[_0x6e70('0xcf')][_0x6e70('0x85')]({'name':_0x14086b[_0x6e70('0x2e')],'contentType':_0x14086b['type'],'data':fs['readFileSync'](_0x38efd0)});}}}emlformat[_0x6e70('0xdc')](_0x1021bf,function(_0x30cfe3,_0x548c01){if(_0x30cfe3)return _0x2afe2e(_0x30cfe3);fs[_0x6e70('0xdd')](path[_0x6e70('0xcc')](_0x2eb49f,util[_0x6e70('0x62')]('message%d.eml',_0x2669f1)),_0x548c01);return _0x50b1b0(_0x548c01);});});});}})[_0x6e70('0x2b')](function(){if(_0x3e3ac2){return new BPromise(function(_0x4655e7,_0x4b28d2){zipdir(_0x2eb49f,{'saveTo':_0x3dec80},function(_0x2acf0c,_0x5b4411){if(_0x2acf0c)return _0x4b28d2(_0x2acf0c);return _0x4655e7(_0x5b4411);});});}})[_0x6e70('0x2b')](function(){if(_0x3e3ac2){return new BPromise(function(_0x153999,_0x132336){rimraf(_0x2eb49f,function(_0x5e2420){if(_0x5e2420)_0x132336(_0x5e2420);return _0x153999();});});}})[_0x6e70('0x2b')](function(){if(_0x3e3ac2){return _0x1eb2ae[_0x6e70('0xde')](_0x3dec80,_0x4e0788,function(_0x2edb4a){if(_0x2edb4a){console[_0x6e70('0xdf')](_0x6e70('0xe0'),_0x2edb4a);}else{fs['unlinkSync'](_0x3dec80);}});}else{return _0x1eb2ae[_0x6e70('0x2c')](0xc8);}})['catch'](handleError(_0x1eb2ae,null));}; \ No newline at end of file +var _0x0713=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./mailInteraction.socket','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','Users','TagIds','Tags','push','findOne','lastMsgBody','lastMsgText','trimStart','catch','MailInteraction','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','field','color','from','mail_messages','me.MailInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','user_has_mail_interactions','users','u.id\x20=\x20ui.UserId','select','mail_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','advancedFilter','parse','keys','forEach','dateStart','startOf','day','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','TagId','unreadMessages','isArray','value','tableAlias','\x20=\x20?','LIKE','ContactId','c.firstName','c.lastName','\x20LIKE\x20?','c.email','\x20<\x20?','\x20IN\x20?','\x20>\x20?','map','isNil','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','$gte','$lte','null','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','split','toString','join','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','DESC','group','i.id','Sequelize','QueryTypes','SELECT','clone','COUNT(*)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','keyBy','COUNT(me.id)','a.key','Account.key','i.createdAt','i.updatedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.to','i.ContactId','i.MailAccountId','i.UserId','Contact.email','c.phone','Contact.phone','c.mobile','Contact.fax','sequelize','ui.MailInteractionId\x20IN\x20?','MailInteractionId','enableEmailPreview','all','rows','rawAttributes','includeAll','include','merge','options','find','create','body','params','describe','addMessage','ids','omit','getMessages','MailMessage','nolimit','YYYY-MM-DD\x20HH:mm:ss','setTags','spread','Tag','emit','mailInteractionTags:save','removeTags','download','unix','server','files','root','tmp','bcc','subject','attachments','Attachment','Attachments','mkdirSync','each','headers','Bcc','existsSync','type','readFileSync','build','writeFileSync','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv'];(function(_0x3c8960,_0x58e3cf){var _0xf4dd88=function(_0x716587){while(--_0x716587){_0x3c8960['push'](_0x3c8960['shift']());}};_0xf4dd88(++_0x58e3cf);}(_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 htmlToText=require(_0x3071('0x11'));var Redis=require(_0x3071('0x12'));var authService=require(_0x3071('0x13'));var qs=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(){_0x2ce48a[_0x3071('0x1e')](0xcc)[_0x3071('0x1f')]();});}};}function handleEntityNotFound(_0x1fe727,_0x1de5fb){return function(_0x4c7130){if(!_0x4c7130){_0x1fe727[_0x3071('0x1d')](0x194);}return _0x4c7130;};}function handleError(_0x3f1e6e,_0x177138){_0x177138=_0x177138||0x1f4;return function(_0x4d5c4b){logger[_0x3071('0x2b')](_0x4d5c4b[_0x3071('0x2c')]);if(_0x4d5c4b[_0x3071('0x2d')]){delete _0x4d5c4b[_0x3071('0x2d')];}_0x3f1e6e[_0x3071('0x1e')](_0x177138)[_0x3071('0x2e')](_0x4d5c4b);};}function getInteractionUsers(_0x177b5f,_0x3921a1){return new BPromise(function(_0x32f1b4,_0x292205){try{if(_0x3921a1[_0x177b5f['id']]){_0x177b5f[_0x3071('0x2f')]=_['map'](_0x3921a1[_0x177b5f['id']],function(_0x4f1484){return{'id':_0x4f1484['id']};});}}catch(_0x9e26d1){_0x292205(_0x9e26d1);}_0x32f1b4(_0x177b5f);});}function getInteractionTags(_0x149e0d,_0x6ddf96){return new BPromise(function(_0x40be95,_0x3f6d90){try{if(_0x149e0d[_0x3071('0x30')]){_0x149e0d[_0x3071('0x31')]=[];_0x149e0d[_0x3071('0x30')]['split'](',')['forEach'](function(_0x4ab983){_0x149e0d[_0x3071('0x31')][_0x3071('0x32')](_0x6ddf96[_0x4ab983]);});}delete _0x149e0d['TagIds'];}catch(_0x17407a){_0x3f6d90(_0x17407a);}_0x40be95(_0x149e0d);});}function getLastMessageText(_0x28747d){return new BPromise(function(_0x25250e,_0x13ae2c){return db['MailInteraction'][_0x3071('0x33')]({'where':{'id':_0x28747d['id']},'attributes':[_0x3071('0x34'),_0x3071('0x35')],'raw':!![]})[_0x3071('0x2a')](function(_0x148096){if(!_0x148096[_0x3071('0x35')]){_0x28747d[_0x3071('0x35')]=_[_0x3071('0x36')](htmlToText['fromString'](_0x148096[_0x3071('0x34')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x28747d['lastMsgText']=_0x148096['lastMsgText'];}_0x25250e(_0x28747d);})[_0x3071('0x37')](function(_0xa3a7ae){_0x13ae2c(_0xa3a7ae);});});}function updateMailInteraction(_0x54d9c3,_0x2e85c8,_0x46e94e,_0x265d76){return new BPromise(function(_0x14ac42,_0xc60572){return getInteractionUsers(_0x54d9c3,_0x46e94e)[_0x3071('0x2a')](function(_0x5610ab){return getInteractionTags(_0x5610ab,_0x2e85c8);})[_0x3071('0x2a')](function(_0xd7971f){if(_0x265d76){_0x14ac42(getLastMessageText(_0xd7971f));}else{_0x14ac42(_0xd7971f);}})['catch'](function(_0x44ad05){_0xc60572(_0x44ad05);});});}exports['index']=function(_0x28f855,_0x43133a){var _0x5733e9={},_0x593c99={},_0x283074={'count':0x0,'rows':[]};var _0x185f63=db[_0x3071('0x38')]['rawAttributes'];_0x593c99[_0x3071('0x39')]=_['keys'](_0x185f63);_0x593c99[_0x3071('0x3a')]=_['keys'](_0x28f855[_0x3071('0x3a')]);_0x593c99[_0x3071('0x3b')]=_[_0x3071('0x3c')](_0x593c99[_0x3071('0x39')],_0x593c99[_0x3071('0x3a')]);_0x5733e9['attributes']=_['intersection'](_0x593c99[_0x3071('0x39')],qs[_0x3071('0x3d')](_0x28f855[_0x3071('0x3a')][_0x3071('0x3d')]));_0x5733e9['attributes']=_0x5733e9[_0x3071('0x3e')][_0x3071('0x3f')]?_0x5733e9[_0x3071('0x3e')]:_0x593c99[_0x3071('0x39')];if(!_0x28f855[_0x3071('0x3a')][_0x3071('0x40')]('nolimit')){_0x5733e9[_0x3071('0x41')]=qs['limit'](_0x28f855['query']['limit']);_0x5733e9['offset']=qs[_0x3071('0x22')](_0x28f855[_0x3071('0x3a')][_0x3071('0x22')]);}_0x5733e9[_0x3071('0x42')]=qs[_0x3071('0x43')](_0x28f855[_0x3071('0x3a')][_0x3071('0x43')]);_0x5733e9[_0x3071('0x44')]=qs['filters'](_[_0x3071('0x45')](_0x28f855[_0x3071('0x3a')],_0x593c99[_0x3071('0x3b')]));var _0x151a9c=[];var _0x93cbcc=squel['select']()['field']('id')[_0x3071('0x46')](_0x3071('0x2d'))[_0x3071('0x46')](_0x3071('0x47'))[_0x3071('0x48')]('tools_tags');var _0x9444d=squel['select']()[_0x3071('0x46')]('COUNT(*)')['from'](_0x3071('0x49'),'me')['where'](_0x3071('0x4a'))['where'](_0x3071('0x4b'))[_0x3071('0x44')](_0x3071('0x4c'));var _0x25d752=squel['select']()[_0x3071('0x46')]('u.id')[_0x3071('0x46')]('ui.MailInteractionId')[_0x3071('0x48')](_0x3071('0x4d'),'ui')['left_join'](_0x3071('0x4e'),'u',_0x3071('0x4f'));var _0x224a70=squel[_0x3071('0x50')]()[_0x3071('0x48')](_0x3071('0x51'),'i')[_0x3071('0x52')]('cm_contacts','c',_0x3071('0x53'))[_0x3071('0x52')](_0x3071('0x4e'),'o',_0x3071('0x54'))['left_join'](_0x3071('0x55'),'a',_0x3071('0x56'))[_0x3071('0x52')](_0x3071('0x49'),'me',_0x3071('0x57'));var _0x26c8e4=squel[_0x3071('0x58')]();if(_0x28f855[_0x3071('0x3a')][_0x3071('0x59')]){var _0x32b2e2=JSON[_0x3071('0x5a')](_0x28f855[_0x3071('0x3a')][_0x3071('0x59')]);_[_0x3071('0x5b')](_0x32b2e2)[_0x3071('0x5c')](function(_0x12be97){var _0x596cdd=_0x32b2e2[_0x12be97];if(_0x12be97==='createdAt'){var _0x12536d=moment(_0x596cdd['value'][_0x3071('0x5d')])[_0x3071('0x5e')](_0x3071('0x5f'))['utc']()[_0x3071('0x60')]();var _0x1ada95=moment(_0x1ada95)['utc']()['endOf'](_0x3071('0x5f'))[_0x3071('0x60')]();_0x26c8e4[_0x3071('0x61')](_0x3071('0x62'),_0x12536d,_0x1ada95);}else{if(_['isArray'](_0x596cdd[_0x3071('0x63')])){_0x596cdd[_0x3071('0x63')][_0x3071('0x5c')](function(_0x41f02a){switch(_0x596cdd[_0x3071('0x63')]['value']){case'IS':if(_0x12be97!==_0x3071('0x64')&&_0x12be97!==_0x3071('0x65')){if(_[_0x3071('0x66')](_0x596cdd[_0x3071('0x67')])&&_0x596cdd[_0x3071('0x67')][_0x3071('0x3f')]>0x1){_0x26c8e4[_0x3071('0x61')](_0x596cdd['tableAlias']+'.'+_0x12be97+'\x20IN\x20?',_0x596cdd[_0x3071('0x67')]);}else{_0x26c8e4['and'](_0x596cdd[_0x3071('0x68')]+'.'+_0x12be97+_0x3071('0x69'),_0x596cdd['value'][0x0]);}}break;case'=':_0x26c8e4[_0x3071('0x61')](_0x596cdd[_0x3071('0x68')]+'.'+_0x12be97+'\x20=\x20?',_0x596cdd[_0x3071('0x67')]);break;case _0x3071('0x6a'):if(_0x12be97===_0x3071('0x6b')){_0x26c8e4[_0x3071('0x61')](_0x3071('0x6c')+'\x20LIKE\x20?','%'+_0x596cdd[_0x3071('0x67')]+'%');_0x26c8e4['or'](_0x3071('0x6d')+_0x3071('0x6e'),'%'+_0x596cdd['value']+'%');_0x26c8e4['or'](_0x3071('0x6f')+_0x3071('0x6e'),'%'+_0x596cdd[_0x3071('0x67')]+'%');}else{_0x26c8e4[_0x3071('0x61')](_0x596cdd[_0x3071('0x68')]+'.'+_0x12be97+_0x3071('0x6e'),'%'+_0x596cdd[_0x3071('0x67')]+'%');}break;case'>':_0x26c8e4[_0x3071('0x61')](_0x596cdd[_0x3071('0x68')]+'.'+_0x12be97+'\x20>\x20?',_0x596cdd[_0x3071('0x67')]);break;case'<':_0x26c8e4[_0x3071('0x61')](_0x596cdd[_0x3071('0x68')]+'.'+_0x12be97+_0x3071('0x70'),_0x596cdd[_0x3071('0x67')]);break;}});}else{switch(_0x596cdd[_0x3071('0x63')][_0x3071('0x67')]){case'IS':if(_0x12be97!==_0x3071('0x64')&&_0x12be97!==_0x3071('0x65')){if(_[_0x3071('0x66')](_0x596cdd[_0x3071('0x67')])&&_0x596cdd['value'][_0x3071('0x3f')]>0x1){_0x26c8e4[_0x3071('0x61')](_0x596cdd[_0x3071('0x68')]+'.'+_0x12be97+_0x3071('0x71'),_0x596cdd[_0x3071('0x67')]);}else{_0x26c8e4[_0x3071('0x61')](_0x596cdd[_0x3071('0x68')]+'.'+_0x12be97+_0x3071('0x69'),_0x596cdd['value'][0x0]);}}break;case'=':_0x26c8e4[_0x3071('0x61')](_0x596cdd[_0x3071('0x68')]+'.'+_0x12be97+'\x20=\x20?',_0x596cdd['value']);break;case _0x3071('0x6a'):if(_0x12be97===_0x3071('0x6b')){_0x26c8e4[_0x3071('0x61')](_0x3071('0x6c')+'\x20LIKE\x20?','%'+_0x596cdd['value']+'%');_0x26c8e4['or'](_0x3071('0x6d')+'\x20LIKE\x20?','%'+_0x596cdd['value']+'%');_0x26c8e4['or']('c.email'+'\x20LIKE\x20?','%'+_0x596cdd[_0x3071('0x67')]+'%');}else{_0x26c8e4[_0x3071('0x61')](_0x596cdd[_0x3071('0x68')]+'.'+_0x12be97+'\x20LIKE\x20?','%'+_0x596cdd[_0x3071('0x67')]+'%');}break;case'>':_0x26c8e4[_0x3071('0x61')](_0x596cdd[_0x3071('0x68')]+'.'+_0x12be97+_0x3071('0x72'),_0x596cdd['value']);break;case'<':_0x26c8e4[_0x3071('0x61')](_0x596cdd[_0x3071('0x68')]+'.'+_0x12be97+'\x20<\x20?',_0x596cdd[_0x3071('0x67')]);break;}}}});}else{var _0x29ee70=_(Object[_0x3071('0x5b')](_0x28f855[_0x3071('0x3a')]))[_0x3071('0x73')](function(_0x11ffdd){return _0x185f63[_0x3071('0x40')](_0x11ffdd)?_0x11ffdd:undefined;})['filter'](function(_0x5dde93){return!_[_0x3071('0x74')](_0x5dde93);})[_0x3071('0x67')]();if(!_[_0x3071('0x75')](_0x29ee70)){_0x29ee70['forEach'](function(_0x53ebfe){if(_0x53ebfe===_0x3071('0x76')){_0x224a70[_0x3071('0x44')](_0x3071('0x77'),[][_0x3071('0x78')](_0x28f855[_0x3071('0x3a')][_0x53ebfe]));}else if(_0x53ebfe===_0x3071('0x79')){var _0x19bc85=JSON[_0x3071('0x5a')](_0x28f855['query'][_0x53ebfe])[_0x3071('0x7a')];var _0x5ea33f=JSON[_0x3071('0x5a')](_0x28f855[_0x3071('0x3a')][_0x53ebfe])[_0x3071('0x7b')];_0x224a70[_0x3071('0x44')](_0x3071('0x62'),_0x19bc85,_0x5ea33f);}else{if(_0x28f855[_0x3071('0x3a')][_0x53ebfe]===_0x3071('0x7c')){_0x224a70[_0x3071('0x44')]('i.'+_0x53ebfe+'\x20IS\x20NULL');}else{_0x224a70[_0x3071('0x44')]('i.'+_0x53ebfe+_0x3071('0x69'),_0x28f855[_0x3071('0x3a')][_0x53ebfe]);}}});}if(_0x28f855['query'][_0x3071('0x7d')]){var _0x22ec7b=_0x28f855[_0x3071('0x3a')]['filter']['replace']('\x5c','\x5c\x5c')[_0x3071('0x7e')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x3071('0x7f')](_0x22ec7b)){_0x26c8e4['or'](_0x3071('0x80'),_0x22ec7b+'%');}else if(qs[_0x3071('0x81')](_0x22ec7b)){_0x26c8e4['or'](_0x3071('0x82'),_0x22ec7b+'%');}else{var _0x311939=[];_0x22ec7b[_0x3071('0x83')]('\x20')[_0x3071('0x5c')](function(_0x4c67ec){_0x311939[_0x3071('0x32')]('+'+_0x4c67ec[_0x3071('0x84')]());});var _0x42d310=_0x311939[_0x3071('0x85')]('\x20');_0x26c8e4['or'](_0x3071('0x86'),_0x42d310)['or'](_0x3071('0x87'),_0x42d310);}}}_0x224a70[_0x3071('0x44')](_0x26c8e4);if(_0x5733e9[_0x3071('0x42')]){_0x5733e9['order'][_0x3071('0x5c')](function(_0x5ed436){_0x224a70[_0x3071('0x42')]('i.'+_0x5ed436[0x0],_0x5ed436[0x1]===_0x3071('0x88')?![]:!![]);});}_0x224a70[_0x3071('0x89')](_0x3071('0x8a'));var _0x33746e={'type':db[_0x3071('0x8b')][_0x3071('0x8c')][_0x3071('0x8d')],'raw':!![]};var _0x77df0=_0x224a70[_0x3071('0x8e')]()['field'](_0x3071('0x8f'))[_0x3071('0x46')]('COUNT(me.id)',_0x3071('0x65'));if(!_0x28f855[_0x3071('0x3a')][_0x3071('0x59')]){if(_0x28f855[_0x3071('0x3a')][_0x3071('0x90')]){if(_0x28f855['query']['read']==0x1){_0x77df0[_0x3071('0x91')]('`unreadMessages`\x20=\x200');_0x224a70[_0x3071('0x91')](_0x3071('0x92'));}else{_0x77df0[_0x3071('0x91')](_0x3071('0x93'));_0x224a70[_0x3071('0x91')](_0x3071('0x93'));}}if(_0x28f855['query'][_0x3071('0x94')]){var _0xa732ea=_[_0x3071('0x66')](_0x28f855[_0x3071('0x3a')]['tag'])?_0x28f855[_0x3071('0x3a')][_0x3071('0x94')]:new Array(_0x28f855['query'][_0x3071('0x94')]);var _0x2ea7e9=squel[_0x3071('0x58')]();_0xa732ea[_0x3071('0x5c')](function(_0x34e4f3){_0x2ea7e9['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x34e4f3+',%');});_0x224a70[_0x3071('0x91')](_0x2ea7e9);_0x77df0['left_join'](_0x3071('0x95'),'it',_0x3071('0x96'));_0x77df0[_0x3071('0x52')](_0x3071('0x97'),'t',_0x3071('0x98'));_0x77df0[_0x3071('0x44')](_0x3071('0x99'),_0xa732ea);}}else{var _0x32b2e2=JSON['parse'](_0x28f855[_0x3071('0x3a')][_0x3071('0x59')]);_[_0x3071('0x5b')](_0x32b2e2)['forEach'](function(_0xc62ee){var _0x5d22b0=_0x32b2e2[_0xc62ee];if(_0xc62ee===_0x3071('0x64')){var _0x5a5861=_0x5d22b0[_0x3071('0x67')];var _0x5e0cbd=squel[_0x3071('0x58')]();_0x5a5861[_0x3071('0x5c')](function(_0x3cbb6e){_0x5e0cbd['or'](_0x3071('0x9a'),'%,'+_0x3cbb6e+',%');});_0x224a70[_0x3071('0x91')](_0x5e0cbd);_0x77df0[_0x3071('0x52')](_0x3071('0x95'),'it',_0x3071('0x96'));_0x77df0[_0x3071('0x52')]('tools_tags','t',_0x3071('0x98'));_0x77df0[_0x3071('0x44')](_0x3071('0x99'),_0x5a5861);}else if(_0xc62ee==='unreadMessages'){if(_0x5d22b0['value']['length']===0x1){if(_0x5d22b0['value'][0x0]===0x1){_0x77df0['having'](_0x3071('0x92'));_0x224a70[_0x3071('0x91')]('`unreadMessages`\x20=\x200');}else{_0x77df0[_0x3071('0x91')](_0x3071('0x93'));_0x224a70[_0x3071('0x91')]('`unreadMessages`\x20>\x200');}}}});}db['sequelize'][_0x3071('0x3a')](_0x77df0[_0x3071('0x84')](),_0x33746e)[_0x3071('0x2a')](function(_0x8cdb97){_0x283074[_0x3071('0x21')]=_0x8cdb97[_0x3071('0x3f')];if(_0x283074[_0x3071('0x21')]===0x0)return[];return db['sequelize']['query'](_0x93cbcc[_0x3071('0x84')](),_0x33746e)[_0x3071('0x2a')](function(_0x3db9c8){_0x151a9c=_[_0x3071('0x9b')](_0x3db9c8,'id');_0x33746e=_['merge'](_0x33746e,{'model':db[_0x3071('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x224a70[_0x3071('0x46')](_0x3071('0x9c'),_0x3071('0x65'));_0x224a70[_0x3071('0x46')](_0x3071('0x9d'),_0x3071('0x9e'));_0x224a70[_0x3071('0x46')]('i.id');_0x224a70[_0x3071('0x46')](_0x3071('0x9f'));_0x224a70[_0x3071('0x46')](_0x3071('0xa0'));_0x224a70[_0x3071('0x46')]('i.closed');_0x224a70[_0x3071('0x46')]('i.closedAt');_0x224a70['field'](_0x3071('0xa1'));_0x224a70[_0x3071('0x46')](_0x3071('0xa2'));_0x224a70['field'](_0x3071('0xa3'));_0x224a70[_0x3071('0x46')](_0x3071('0xa4'));_0x224a70[_0x3071('0x46')](_0x3071('0xa5'));_0x224a70['field']('i.substatus');_0x224a70[_0x3071('0x46')](_0x3071('0xa6'));_0x224a70['field'](_0x3071('0xa7'));_0x224a70[_0x3071('0x46')](_0x3071('0xa8'));_0x224a70[_0x3071('0x46')](_0x3071('0xa9'));_0x224a70['field'](_0x3071('0x6c'),'Contact.firstName');_0x224a70[_0x3071('0x46')](_0x3071('0x6d'),'Contact.lastName');_0x224a70[_0x3071('0x46')]('c.email',_0x3071('0xaa'));_0x224a70[_0x3071('0x46')](_0x3071('0xab'),_0x3071('0xac'));_0x224a70['field'](_0x3071('0xad'),'Contact.mobile');_0x224a70[_0x3071('0x46')]('c.fax',_0x3071('0xae'));_0x224a70[_0x3071('0x46')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x3071('0x30'));_0x224a70[_0x3071('0x52')]('mail_interaction_has_tags','it',_0x3071('0x96'));_0x224a70[_0x3071('0x52')](_0x3071('0x97'),'t',_0x3071('0x98'));_0x224a70[_0x3071('0x41')](_0x5733e9[_0x3071('0x41')]);_0x224a70[_0x3071('0x22')](_0x5733e9[_0x3071('0x22')]);return db[_0x3071('0xaf')][_0x3071('0x3a')](_0x224a70[_0x3071('0x84')](),_0x33746e);})[_0x3071('0x2a')](function(_0x397a07){_0x25d752[_0x3071('0x44')](_0x3071('0xb0'),_['map'](_0x397a07,'id'));return db[_0x3071('0xaf')][_0x3071('0x3a')](_0x25d752[_0x3071('0x84')](),_0x33746e)[_0x3071('0x2a')](function(_0x19f63d){var _0x5910a7=_['groupBy'](_0x19f63d,_0x3071('0xb1'));var _0x2e7859=[];return db['Setting'][_0x3071('0x33')]({'attributes':[_0x3071('0xb2')],'raw':!![]})['then'](function(_0x49c3e8){var _0x2edff8=_0x49c3e8[_0x3071('0xb2')];_0x397a07[_0x3071('0x5c')](function(_0x30ed66){_0x2e7859[_0x3071('0x32')](updateMailInteraction(_0x30ed66,_0x151a9c,_0x5910a7,_0x2edff8));});return BPromise[_0x3071('0xb3')](_0x2e7859);});});});})[_0x3071('0x2a')](function(_0xbee265){_0x283074[_0x3071('0xb4')]=_0xbee265;return _0x283074;})['then'](respondWithFilteredResult(_0x43133a,_0x5733e9))[_0x3071('0x37')](handleError(_0x43133a,null));};exports['show']=function(_0x1abbff,_0x322154){var _0x46ab46={'raw':![],'where':{'id':_0x1abbff['params']['id']}},_0x3d4d6b={};_0x3d4d6b['model']=_['keys'](db[_0x3071('0x38')][_0x3071('0xb5')]);_0x3d4d6b[_0x3071('0x3a')]=_[_0x3071('0x5b')](_0x1abbff['query']);_0x3d4d6b[_0x3071('0x3b')]=_[_0x3071('0x3c')](_0x3d4d6b[_0x3071('0x39')],_0x3d4d6b['query']);_0x46ab46['attributes']=_['intersection'](_0x3d4d6b['model'],qs[_0x3071('0x3d')](_0x1abbff[_0x3071('0x3a')]['fields']));_0x46ab46[_0x3071('0x3e')]=_0x46ab46[_0x3071('0x3e')][_0x3071('0x3f')]?_0x46ab46[_0x3071('0x3e')]:_0x3d4d6b[_0x3071('0x39')];if(_0x1abbff['query'][_0x3071('0xb6')]){_0x46ab46[_0x3071('0xb7')]=[{'all':!![]}];}_0x46ab46=_[_0x3071('0xb8')]({},_0x46ab46,_0x1abbff[_0x3071('0xb9')]);return db['MailInteraction'][_0x3071('0xba')](_0x46ab46)['then'](handleEntityNotFound(_0x322154,null))[_0x3071('0x2a')](respondWithResult(_0x322154,null))[_0x3071('0x37')](handleError(_0x322154,null));};exports[_0x3071('0xbb')]=function(_0x4ec7a4,_0x100be7){return db[_0x3071('0x38')][_0x3071('0xbb')](_0x4ec7a4[_0x3071('0xbc')],{})['then'](respondWithResult(_0x100be7,0xc9))[_0x3071('0x37')](handleError(_0x100be7,null));};exports[_0x3071('0x28')]=function(_0xc326c2,_0x35bde9){if(_0xc326c2[_0x3071('0xbc')]['id']){delete _0xc326c2['body']['id'];}return db['MailInteraction'][_0x3071('0xba')]({'where':{'id':_0xc326c2[_0x3071('0xbd')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x35bde9,null))[_0x3071('0x2a')](saveUpdates(_0xc326c2['body'],null))['then'](respondWithResult(_0x35bde9,null))[_0x3071('0x37')](handleError(_0x35bde9,null));};exports[_0x3071('0x29')]=function(_0x5a18f7,_0xdd926b){return db[_0x3071('0x38')][_0x3071('0xba')]({'where':{'id':_0x5a18f7['params']['id']}})['then'](handleEntityNotFound(_0xdd926b,null))['then'](removeEntity(_0xdd926b,null))[_0x3071('0x37')](handleError(_0xdd926b,null));};exports[_0x3071('0xbe')]=function(_0x31e1,_0x4a92d8){return db['MailInteraction'][_0x3071('0xbe')]()[_0x3071('0x2a')](respondWithResult(_0x4a92d8,null))[_0x3071('0x37')](handleError(_0x4a92d8,null));};exports[_0x3071('0xbf')]=function(_0x41e6c4,_0x5d4ea9,_0x3422d8){return db['MailMessage'][_0x3071('0xba')]({'where':{'id':_0x41e6c4[_0x3071('0xbd')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x5d4ea9,null))[_0x3071('0x2a')](function(_0x1817a8){if(_0x1817a8){return _0x1817a8['addMessage'](_0x41e6c4[_0x3071('0xbc')][_0x3071('0xc0')],_[_0x3071('0xc1')](_0x41e6c4[_0x3071('0xbc')],[_0x3071('0xc0'),'id'])||{});}})[_0x3071('0x2a')](respondWithResult(_0x5d4ea9,null))[_0x3071('0x37')](handleError(_0x5d4ea9,null));};exports[_0x3071('0xc2')]=function(_0xc6bc56,_0x109d20,_0x41cc75){var _0x4ffbec={'raw':![],'where':{}};var _0x334d3a={};var _0x21d4b8={'count':0x0,'rows':[]};return db[_0x3071('0x38')][_0x3071('0x33')]({'where':{'id':_0xc6bc56['params']['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x109d20,null))['then'](function(_0x17a9f5){if(_0x17a9f5){_0x334d3a[_0x3071('0x39')]=_[_0x3071('0x5b')](db[_0x3071('0xc3')][_0x3071('0xb5')]);_0x334d3a[_0x3071('0x3a')]=_[_0x3071('0x5b')](_0xc6bc56['query']);_0x334d3a[_0x3071('0x3b')]=_['intersection'](_0x334d3a['model'],_0x334d3a[_0x3071('0x3a')]);_0x4ffbec[_0x3071('0x3e')]=_['intersection'](_0x334d3a[_0x3071('0x39')],qs['fields'](_0xc6bc56[_0x3071('0x3a')][_0x3071('0x3d')]));_0x4ffbec[_0x3071('0x3e')]=_0x4ffbec[_0x3071('0x3e')][_0x3071('0x3f')]?_0x4ffbec[_0x3071('0x3e')]:_0x334d3a[_0x3071('0x39')];if(!_0xc6bc56[_0x3071('0x3a')][_0x3071('0x40')](_0x3071('0xc4'))){_0x4ffbec[_0x3071('0x41')]=qs['limit'](_0xc6bc56[_0x3071('0x3a')][_0x3071('0x41')]);_0x4ffbec[_0x3071('0x22')]=qs['offset'](_0xc6bc56[_0x3071('0x3a')]['offset']);}_0x4ffbec[_0x3071('0x42')]=qs[_0x3071('0x43')](_0xc6bc56[_0x3071('0x3a')][_0x3071('0x43')]);_0x4ffbec['where']=qs['filters'](_['pick'](_0xc6bc56[_0x3071('0x3a')],_0x334d3a['filters']));_0x4ffbec['where'][_0x3071('0xb1')]=_0x17a9f5['id'];if(_0xc6bc56['query'][_0x3071('0x7d')]){_0x4ffbec[_0x3071('0x44')]=_[_0x3071('0xb8')](_0x4ffbec['where'],{'$or':_[_0x3071('0x73')](_0x4ffbec['attributes'],function(_0x587e6b){var _0x129567={};_0x129567[_0x587e6b]={'$like':'%'+_0xc6bc56[_0x3071('0x3a')][_0x3071('0x7d')]+'%'};return _0x129567;})});}if(_0xc6bc56[_0x3071('0x3a')][_0x3071('0x7a')]){var _0x38b2c5=_0xc6bc56[_0x3071('0x3a')]['$gte'][_0x3071('0x83')](',');var _0x76a69a={};_0x76a69a[_0x38b2c5[0x0]]={'$gte':moment(_0x38b2c5[0x1])[_0x3071('0x60')](_0x3071('0xc5'))};_0x4ffbec[_0x3071('0x44')]=_[_0x3071('0xb8')](_0x4ffbec[_0x3071('0x44')],_0x76a69a);}_0x4ffbec=_[_0x3071('0xb8')]({},_0x4ffbec,_0xc6bc56[_0x3071('0xb9')]);return db['MailMessage'][_0x3071('0x21')]({'where':_0x4ffbec[_0x3071('0x44')]})[_0x3071('0x2a')](function(_0x28e880){_0x21d4b8[_0x3071('0x21')]=_0x28e880;if(_0xc6bc56[_0x3071('0x3a')][_0x3071('0xb6')]){_0x4ffbec['include']=[{'all':!![]}];}return db[_0x3071('0xc3')]['findAll'](_0x4ffbec);})[_0x3071('0x2a')](function(_0x164f3d){_0x21d4b8[_0x3071('0xb4')]=_0x164f3d;return _0x21d4b8;});}})['then'](respondWithFilteredResult(_0x109d20,_0x4ffbec))['catch'](handleError(_0x109d20,null));};exports['addTags']=function(_0x475047,_0x2fb723,_0x22fdcc){return db['MailInteraction'][_0x3071('0xba')]({'where':{'id':_0x475047[_0x3071('0xbd')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x2fb723,null))[_0x3071('0x2a')](function(_0x3e788f){if(_0x3e788f){return _0x3e788f[_0x3071('0xc6')](_0x475047[_0x3071('0xbc')][_0x3071('0xc0')],_[_0x3071('0xc1')](_0x475047['body'],[_0x3071('0xc0'),'id'])||{})[_0x3071('0xc7')](function(){return db[_0x3071('0xc8')]['findAll']({'attributes':['id',_0x3071('0x2d'),_0x3071('0x47')],'where':{'id':_0x475047[_0x3071('0xbc')][_0x3071('0xc0')]}});})[_0x3071('0x2a')](function(_0x1cc091){socket[_0x3071('0xc9')](_0x3071('0xca'),{'id':Number(_0x475047[_0x3071('0xbd')]['id']),'tags':_0x1cc091||[]});return{'id':Number(_0x475047[_0x3071('0xbd')]['id']),'tags':_0x1cc091||[]};});}})[_0x3071('0x2a')](respondWithResult(_0x2fb723,null))[_0x3071('0x37')](handleError(_0x2fb723,null));};exports['removeTags']=function(_0x9e027c,_0x3e9573,_0x5dcd7a){return db['MailInteraction']['find']({'where':{'id':_0x9e027c['params']['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x3e9573,null))[_0x3071('0x2a')](function(_0x51a67d){if(_0x51a67d){return _0x51a67d[_0x3071('0xcb')](_0x9e027c[_0x3071('0x3a')][_0x3071('0xc0')]);}})[_0x3071('0x2a')](respondWithStatusCode(_0x3e9573,null))[_0x3071('0x37')](handleError(_0x3e9573,null));};exports[_0x3071('0xcc')]=function(_0x358227,_0x1f6e73){var _0xcdeec2=moment()[_0x3071('0xcd')]()[_0x3071('0x84')]();var _0x28c7bc=path[_0x3071('0x85')](config['root'],_0x3071('0xce'),_0x3071('0xcf'),'attachments');var _0x17e204=path[_0x3071('0x85')](config[_0x3071('0xd0')],_0x3071('0xce'),'files',_0x3071('0xd1'));var _0x363418=path[_0x3071('0x85')](_0x17e204,_0xcdeec2);var _0x2ec794=util['format']('interaction-%s.zip',_0xcdeec2);var _0x1afce9=path[_0x3071('0x85')](_0x17e204,_0x2ec794);var _0x10f664=![];return db[_0x3071('0x38')][_0x3071('0xba')]({'where':{'id':_0x358227[_0x3071('0xbd')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x1f6e73,null))[_0x3071('0x2a')](function(_0x4d2992){if(_0x4d2992){return _0x4d2992[_0x3071('0xc2')]({'attributes':['id','body','from','to','cc',_0x3071('0xd2'),_0x3071('0xd3'),'createdAt'],'where':{'secret':![]},'include':_0x358227['query'][_0x3071('0xd4')]?[{'model':db[_0x3071('0xd5')],'as':_0x3071('0xd6')}]:undefined,'order':qs[_0x3071('0x43')]('id')});}return[];})['then'](function(_0x6ad3d9){_0x10f664=_0x6ad3d9[_0x3071('0x3f')];if(_0x6ad3d9[_0x3071('0x3f')]){fs[_0x3071('0xd7')](_0x363418);return BPromise[_0x3071('0xd8')](_0x6ad3d9,function(_0x47880d,_0x2bf807){var _0x1a3fe8=_0x47880d;var _0x52b7a8={'from':_0x1a3fe8['from'],'to':_0x1a3fe8['to'],'subject':_0x1a3fe8['subject'],'html':_0x1a3fe8[_0x3071('0xbc')],'headers':{'Date':moment(_0x1a3fe8[_0x3071('0x79')])[_0x3071('0x60')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x47880d['cc']){_0x52b7a8[_0x3071('0xd9')]['Cc']=_0x47880d['cc'];}if(_0x47880d[_0x3071('0xd2')]){_0x52b7a8['headers'][_0x3071('0xda')]=_0x47880d[_0x3071('0xd2')];}return new BPromise(function(_0x33efb9,_0x15edc7){if(_0x47880d[_0x3071('0xd6')]){for(var _0x5a0462=0x0;_0x5a0462<_0x47880d['Attachments'][_0x3071('0x3f')];_0x5a0462++){var _0x20230c=_0x47880d[_0x3071('0xd6')][_0x5a0462];var _0x420132=path['join'](_0x28c7bc,_0x20230c['basename']);if(fs[_0x3071('0xdb')](_0x420132)){_0x52b7a8[_0x3071('0xd4')]['push']({'name':_0x20230c[_0x3071('0x2d')],'contentType':_0x20230c[_0x3071('0xdc')],'data':fs[_0x3071('0xdd')](_0x420132)});}}}emlformat[_0x3071('0xde')](_0x52b7a8,function(_0x4e1cfa,_0x89fa53){if(_0x4e1cfa)return _0x15edc7(_0x4e1cfa);fs[_0x3071('0xdf')](path[_0x3071('0x85')](_0x363418,util[_0x3071('0x60')]('message%d.eml',_0x2bf807)),_0x89fa53);return _0x33efb9(_0x89fa53);});});});}})[_0x3071('0x2a')](function(){if(_0x10f664){return new BPromise(function(_0x2fa596,_0x50c25d){zipdir(_0x363418,{'saveTo':_0x1afce9},function(_0x12f599,_0xaedcbd){if(_0x12f599)return _0x50c25d(_0x12f599);return _0x2fa596(_0xaedcbd);});});}})[_0x3071('0x2a')](function(){if(_0x10f664){return new BPromise(function(_0x8ab533,_0x30ca22){rimraf(_0x363418,function(_0x5069a9){if(_0x5069a9)_0x30ca22(_0x5069a9);return _0x8ab533();});});}})[_0x3071('0x2a')](function(){if(_0x10f664){return _0x1f6e73['download'](_0x1afce9,_0x2ec794,function(_0x241635){if(_0x241635){console['log'](_0x3071('0xe0'),_0x241635);}else{fs[_0x3071('0xe1')](_0x1afce9);}});}else{return _0x1f6e73[_0x3071('0x1d')](0xc8);}})[_0x3071('0x37')](handleError(_0x1f6e73,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index a335163..143ede5 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 _0x3774=['then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x3861f7,_0x995b22){var _0x50879f=function(_0x3003f1){while(--_0x3003f1){_0x3861f7['push'](_0x3861f7['shift']());}};_0x50879f(++_0x995b22);}(_0x3774,0x14e));var _0x4377=function(_0x3b4756,_0x3ee9b7){_0x3b4756=_0x3b4756-0x0;var _0x3ce1a5=_0x3774[_0x3b4756];return _0x3ce1a5;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x4377('0x0'))['db'][_0x4377('0x1')];var MailMessage=require('../../mysqldb')['db'][_0x4377('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x4377('0x3')](0x0);var events={'afterCreate':_0x4377('0x4'),'afterUpdate':_0x4377('0x5'),'afterDestroy':_0x4377('0x6')};function emitEvent(_0x195efa){return function(_0x29625e,_0x42e675,_0x4e5d9d){_0x29625e[_0x4377('0x7')]({'attributes':['id'],'raw':!![]})[_0x4377('0x8')](function(_0x2774bb){_0x29625e[_0x4377('0x9')](_0x4377('0xa'),_0x2774bb[_0x4377('0xb')](function(_0xf7e96d){return{'id':_0xf7e96d['id']};}));return MailMessage[_0x4377('0xc')]({'where':{'MailInteractionId':_0x29625e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4377('0x8')](function(_0x10e0c6){_0x29625e[_0x4377('0x9')](_0x4377('0xd'),_0x10e0c6[_0x4377('0xe')]);MailInteractionEvents[_0x4377('0xf')](_0x195efa+':'+_0x29625e['id'],_0x29625e);MailInteractionEvents[_0x4377('0xf')](_0x195efa,_0x29625e);_0x4e5d9d(null);})[_0x4377('0x10')](_0x4e5d9d(null));};}for(var e in events){if(events[_0x4377('0x11')](e)){var event=events[e];MailInteraction[_0x4377('0x12')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0xff19=['emit','hasOwnProperty','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','setDataValue','Users','map','findAll','then','unreadMessages','length'];(function(_0x48ba04,_0x3f0913){var _0x3bb908=function(_0x5b041b){while(--_0x5b041b){_0x48ba04['push'](_0x48ba04['shift']());}};_0x3bb908(++_0x3f0913);}(_0xff19,0x9c));var _0x9ff1=function(_0xd9cd6e,_0x72b63d){_0xd9cd6e=_0xd9cd6e-0x0;var _0x412c1a=_0xff19[_0xd9cd6e];return _0x412c1a;};'use strict';var EventEmitter=require(_0x9ff1('0x0'));var MailInteraction=require(_0x9ff1('0x1'))['db'][_0x9ff1('0x2')];var MailMessage=require(_0x9ff1('0x1'))['db'][_0x9ff1('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x9ff1('0x4')](0x0);var events={'afterCreate':_0x9ff1('0x5'),'afterUpdate':_0x9ff1('0x6'),'afterDestroy':'remove'};function emitEvent(_0x32ee72){return function(_0x23222a,_0x3d4e84,_0xc18d86){_0x23222a['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x2192a2){_0x23222a[_0x9ff1('0x7')](_0x9ff1('0x8'),_0x2192a2[_0x9ff1('0x9')](function(_0x29c46e){return{'id':_0x29c46e['id']};}));return MailMessage[_0x9ff1('0xa')]({'where':{'MailInteractionId':_0x23222a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9ff1('0xb')](function(_0x1785c1){_0x23222a[_0x9ff1('0x7')](_0x9ff1('0xc'),_0x1785c1[_0x9ff1('0xd')]);MailInteractionEvents['emit'](_0x32ee72+':'+_0x23222a['id'],_0x23222a);MailInteractionEvents[_0x9ff1('0xe')](_0x32ee72,_0x23222a);_0xc18d86(null);})['catch'](_0xc18d86(null));};}for(var e in events){if(events[_0x9ff1('0xf')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x9ff1('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 3f526ba..a8c2b18 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 _0x5df0=['get','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','models'];(function(_0x30db67,_0x3f67a9){var _0x439279=function(_0x3eddc1){while(--_0x3eddc1){_0x30db67['push'](_0x30db67['shift']());}};_0x439279(++_0x3f67a9);}(_0x5df0,0x79));var _0x05df=function(_0x35f674,_0x19efcd){_0x35f674=_0x35f674-0x0;var _0x295269=_0x5df0[_0x35f674];return _0x295269;};'use strict';var _=require(_0x05df('0x0'));var util=require(_0x05df('0x1'));var logger=require(_0x05df('0x2'))(_0x05df('0x3'));var moment=require(_0x05df('0x4'));var BPromise=require(_0x05df('0x5'));var rp=require(_0x05df('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x05df('0x7'));var config=require(_0x05df('0x8'));var attributes=require(_0x05df('0x9'));module[_0x05df('0xa')]=function(_0xad2ef5,_0x2702c7){return _0xad2ef5[_0x05df('0xb')](_0x05df('0xc'),attributes,{'tableName':_0x05df('0xd'),'paranoid':![],'indexes':[{'name':_0x05df('0xe'),'fields':[_0x05df('0xf'),'to'],'type':_0x05df('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2538f4,_0x368895,_0x2ca4a6){if(_0x2538f4[_0x05df('0x11')]){_0x2538f4[_0x05df('0x12')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2538f4[_0x05df('0x13')]){_0x2538f4[_0x05df('0x14')]=moment()[_0x05df('0x15')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2ca4a6(null,_0x368895);},'beforeUpdate':function(_0x5d9940,_0x17ddcd,_0x587feb){if(_0x5d9940['changed'](_0x05df('0x11'))){_0x5d9940[_0x05df('0x12')]=moment()[_0x05df('0x15')](_0x05df('0x16'));}if(_0x5d9940['changed'](_0x05df('0x13'))){_0x5d9940[_0x05df('0x14')]=moment()[_0x05df('0x15')](_0x05df('0x16'));}_0x587feb(null,_0x5d9940);},'afterUpdate':function(_0xe7e570,_0x3181eb,_0x3d68ad){var _0x4bee46=_0xad2ef5[_0x05df('0x17')];var _0x9ef756=_0xe7e570[_0x05df('0x18')]({'plain':!![]});if(_0x9ef756[_0x05df('0x13')]){return _0x4bee46['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x9ef756['id']}})[_0x05df('0x19')](function(){_0x3d68ad();})[_0x05df('0x1a')](function(_0x5a9f16){_0x3d68ad(_0x5a9f16);});}else{_0x3d68ad();}}},'charset':_0x05df('0x1b'),'collate':_0x05df('0x1c')});}; \ No newline at end of file +var _0xb950=['mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','substatusAt','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','MailInteraction'];(function(_0x4fdf98,_0x4773b6){var _0x332dc8=function(_0x6377df){while(--_0x6377df){_0x4fdf98['push'](_0x4fdf98['shift']());}};_0x332dc8(++_0x4773b6);}(_0xb950,0x7b));var _0x0b95=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xb950[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x0b95('0x0'));var util=require(_0x0b95('0x1'));var logger=require(_0x0b95('0x2'))(_0x0b95('0x3'));var moment=require(_0x0b95('0x4'));var BPromise=require(_0x0b95('0x5'));var rp=require(_0x0b95('0x6'));var fs=require('fs');var path=require(_0x0b95('0x7'));var rimraf=require('rimraf');var config=require(_0x0b95('0x8'));var attributes=require('./mailInteraction.attributes');module[_0x0b95('0x9')]=function(_0x99adb2,_0x3a3ac4){return _0x99adb2[_0x0b95('0xa')](_0x0b95('0xb'),attributes,{'tableName':_0x0b95('0xc'),'paranoid':![],'indexes':[{'name':_0x0b95('0xd'),'fields':[_0x0b95('0xe'),'to'],'type':_0x0b95('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4f2821,_0x15c969,_0x1a8cc3){if(_0x4f2821[_0x0b95('0x10')]){_0x4f2821['substatusAt']=moment()['format'](_0x0b95('0x11'));}if(_0x4f2821[_0x0b95('0x12')]){_0x4f2821[_0x0b95('0x13')]=moment()[_0x0b95('0x14')](_0x0b95('0x11'));}_0x1a8cc3(null,_0x15c969);},'beforeUpdate':function(_0x373693,_0x27699e,_0x4f3e6b){if(_0x373693[_0x0b95('0x15')](_0x0b95('0x10'))){_0x373693[_0x0b95('0x16')]=moment()['format'](_0x0b95('0x11'));}if(_0x373693[_0x0b95('0x15')](_0x0b95('0x12'))){_0x373693[_0x0b95('0x13')]=moment()['format'](_0x0b95('0x11'));}_0x4f3e6b(null,_0x373693);},'afterUpdate':function(_0x3f3b80,_0x34db61,_0x72a56){var _0x1f9e48=_0x99adb2['models'];var _0x38c042=_0x3f3b80['get']({'plain':!![]});if(_0x38c042[_0x0b95('0x12')]){return _0x1f9e48['MailMessage'][_0x0b95('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x38c042['id']}})['then'](function(){_0x72a56();})[_0x0b95('0x18')](function(_0x19eba3){_0x72a56(_0x19eba3);});}else{_0x72a56();}}},'charset':_0x0b95('0x19'),'collate':_0x0b95('0x1a')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index edea3ba..4063e49 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 _0x2178=['spread','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','update','body','options','raw','where','attributes','limit','UpdateMailInteraction','stringify','MailInteraction','find','addTags','ids','omit'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x2178,0x1b0));var _0x8217=function(_0x5534fe,_0x43c22e){_0x5534fe=_0x5534fe-0x0;var _0x3d1dc2=_0x2178[_0x5534fe];return _0x3d1dc2;};'use strict';var _=require(_0x8217('0x0'));var util=require('util');var moment=require(_0x8217('0x1'));var BPromise=require(_0x8217('0x2'));var rs=require(_0x8217('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8217('0x4'))['db'];var utils=require(_0x8217('0x5'));var logger=require('../../config/logger')(_0x8217('0x6'));var config=require(_0x8217('0x7'));var jayson=require(_0x8217('0x8'));var client=jayson[_0x8217('0x9')][_0x8217('0xa')]({'port':0x232a});config[_0x8217('0xb')]=_[_0x8217('0xc')](config[_0x8217('0xb')],{'host':_0x8217('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8217('0xe'))[_0x8217('0xf')](socket);function respondWithRpcPromise(_0xe65a16,_0x5f2121,_0xe4d46c){return new BPromise(function(_0x5e5ff3,_0x569eba){return client[_0x8217('0x10')](_0xe65a16,_0xe4d46c)[_0x8217('0x11')](function(_0x3ab032){logger[_0x8217('0x12')](_0x8217('0x13'),_0x5f2121,_0x8217('0x14'));logger[_0x8217('0x15')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x5f2121,'request\x20sent',JSON['stringify'](_0x3ab032));if(_0x3ab032[_0x8217('0x16')]){if(_0x3ab032[_0x8217('0x16')][_0x8217('0x17')]===0x1f4){logger[_0x8217('0x16')]('MailInteraction,\x20%s,\x20%s',_0x5f2121,_0x3ab032[_0x8217('0x16')][_0x8217('0x18')]);return _0x569eba(_0x3ab032[_0x8217('0x16')]['message']);}logger[_0x8217('0x16')](_0x8217('0x13'),_0x5f2121,_0x3ab032[_0x8217('0x16')][_0x8217('0x18')]);return _0x5e5ff3(_0x3ab032[_0x8217('0x16')][_0x8217('0x18')]);}else{logger[_0x8217('0x12')]('MailInteraction,\x20%s,\x20%s',_0x5f2121,_0x8217('0x14'));_0x5e5ff3(_0x3ab032[_0x8217('0x19')]['message']);}})[_0x8217('0x1a')](function(_0x16d4a9){logger['error']('MailInteraction,\x20%s,\x20%s',_0x5f2121,_0x16d4a9);_0x569eba(_0x16d4a9);});});}exports['UpdateMailInteraction']=function(_0x417105){var _0xf1ec0b=this;return new Promise(function(_0x2ed079,_0xe573c6){return db['MailInteraction'][_0x8217('0x1b')](_0x417105[_0x8217('0x1c')],{'raw':_0x417105[_0x8217('0x1d')]?_0x417105[_0x8217('0x1d')][_0x8217('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x417105[_0x8217('0x1d')]?_0x417105['options'][_0x8217('0x1f')]||null:null,'attributes':_0x417105[_0x8217('0x1d')]?_0x417105['options'][_0x8217('0x20')]||null:null,'limit':_0x417105[_0x8217('0x1d')]?_0x417105[_0x8217('0x1d')][_0x8217('0x21')]||null:null})[_0x8217('0x11')](function(_0x264aa5){logger['info']('UpdateMailInteraction',_0x417105);logger[_0x8217('0x15')](_0x8217('0x22'),_0x417105,JSON[_0x8217('0x23')](_0x264aa5));_0x2ed079(_0x264aa5);})[_0x8217('0x1a')](function(_0x55c66b){logger['error'](_0x8217('0x22'),_0x55c66b[_0x8217('0x18')],_0x417105);_0xe573c6(_0xf1ec0b[_0x8217('0x16')](0x1f4,_0x55c66b[_0x8217('0x18')]));});});};exports['AddTagsToMailInteraction']=function(_0x3b3fee){return new Promise(function(_0x48a818,_0x2ef2f1){return db[_0x8217('0x24')][_0x8217('0x25')]({'where':_0x3b3fee[_0x8217('0x1d')]?_0x3b3fee['options'][_0x8217('0x1f')]||null:null})[_0x8217('0x11')](function(_0x13a19f){if(_0x13a19f){return _0x13a19f[_0x8217('0x26')](_0x3b3fee[_0x8217('0x1c')][_0x8217('0x27')],_[_0x8217('0x28')](_0x3b3fee['body'],['ids','id'])||{});}})[_0x8217('0x29')](function(_0x42c2ca){logger[_0x8217('0x12')]('AddTags',_0x3b3fee);logger[_0x8217('0x15')](_0x8217('0x2a'),_0x3b3fee,JSON[_0x8217('0x23')](_0x42c2ca));_0x48a818(_0x42c2ca);})[_0x8217('0x1a')](function(_0x42ae12){logger[_0x8217('0x16')](_0x8217('0x2a'),_0x42ae12[_0x8217('0x18')],_0x3b3fee);_0x2ef2f1(_this[_0x8217('0x16')](0x1f4,_0x42ae12[_0x8217('0x18')]));});});}; \ No newline at end of file +var _0xf69d=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','info','catch','UpdateMailInteraction','body','options','where','attributes','AddTagsToMailInteraction','MailInteraction','find','addTags','ids','omit','spread','debug','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x23e2a1,_0x3d15cb){var _0x74c0fe=function(_0x14f7fd){while(--_0x14f7fd){_0x23e2a1['push'](_0x23e2a1['shift']());}};_0x74c0fe(++_0x3d15cb);}(_0xf69d,0xd3));var _0xdf69=function(_0x94a77f,_0x411251){_0x94a77f=_0x94a77f-0x0;var _0x167d2d=_0xf69d[_0x94a77f];return _0x167d2d;};'use strict';var _=require(_0xdf69('0x0'));var util=require(_0xdf69('0x1'));var moment=require(_0xdf69('0x2'));var BPromise=require(_0xdf69('0x3'));var rs=require(_0xdf69('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf69('0x5'))['db'];var utils=require(_0xdf69('0x6'));var logger=require(_0xdf69('0x7'))(_0xdf69('0x8'));var config=require(_0xdf69('0x9'));var jayson=require(_0xdf69('0xa'));var client=jayson[_0xdf69('0xb')][_0xdf69('0xc')]({'port':0x232a});config[_0xdf69('0xd')]=_[_0xdf69('0xe')](config[_0xdf69('0xd')],{'host':_0xdf69('0xf'),'port':0x18eb});var socket=require(_0xdf69('0x10'))(new Redis(config[_0xdf69('0xd')]));require(_0xdf69('0x11'))[_0xdf69('0x12')](socket);function respondWithRpcPromise(_0x1e0e8d,_0x4fcc93,_0x305726){return new BPromise(function(_0x420011,_0x20cc6c){return client[_0xdf69('0x13')](_0x1e0e8d,_0x305726)[_0xdf69('0x14')](function(_0x1b86d4){logger['info']('MailInteraction,\x20%s,\x20%s',_0x4fcc93,'request\x20sent');logger['debug'](_0xdf69('0x15'),_0x4fcc93,_0xdf69('0x16'),JSON[_0xdf69('0x17')](_0x1b86d4));if(_0x1b86d4[_0xdf69('0x18')]){if(_0x1b86d4[_0xdf69('0x18')][_0xdf69('0x19')]===0x1f4){logger['error'](_0xdf69('0x1a'),_0x4fcc93,_0x1b86d4[_0xdf69('0x18')][_0xdf69('0x1b')]);return _0x20cc6c(_0x1b86d4[_0xdf69('0x18')]['message']);}logger[_0xdf69('0x18')]('MailInteraction,\x20%s,\x20%s',_0x4fcc93,_0x1b86d4[_0xdf69('0x18')][_0xdf69('0x1b')]);return _0x420011(_0x1b86d4['error'][_0xdf69('0x1b')]);}else{logger[_0xdf69('0x1c')](_0xdf69('0x1a'),_0x4fcc93,_0xdf69('0x16'));_0x420011(_0x1b86d4['result']['message']);}})[_0xdf69('0x1d')](function(_0x15e73a){logger['error'](_0xdf69('0x1a'),_0x4fcc93,_0x15e73a);_0x20cc6c(_0x15e73a);});});}exports[_0xdf69('0x1e')]=function(_0x68fa80){var _0x526cbc=this;return new Promise(function(_0x4776df,_0x452cfa){return db['MailInteraction']['update'](_0x68fa80[_0xdf69('0x1f')],{'raw':_0x68fa80[_0xdf69('0x20')]?_0x68fa80[_0xdf69('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x68fa80['options']?_0x68fa80['options'][_0xdf69('0x21')]||null:null,'attributes':_0x68fa80['options']?_0x68fa80[_0xdf69('0x20')][_0xdf69('0x22')]||null:null,'limit':_0x68fa80[_0xdf69('0x20')]?_0x68fa80['options']['limit']||null:null})[_0xdf69('0x14')](function(_0x1437f6){logger[_0xdf69('0x1c')](_0xdf69('0x1e'),_0x68fa80);logger['debug'](_0xdf69('0x1e'),_0x68fa80,JSON[_0xdf69('0x17')](_0x1437f6));_0x4776df(_0x1437f6);})[_0xdf69('0x1d')](function(_0x5969cb){logger[_0xdf69('0x18')]('UpdateMailInteraction',_0x5969cb['message'],_0x68fa80);_0x452cfa(_0x526cbc['error'](0x1f4,_0x5969cb['message']));});});};exports[_0xdf69('0x23')]=function(_0xe339ac){return new Promise(function(_0x4fc007,_0x301bd2){return db[_0xdf69('0x24')][_0xdf69('0x25')]({'where':_0xe339ac[_0xdf69('0x20')]?_0xe339ac[_0xdf69('0x20')][_0xdf69('0x21')]||null:null})[_0xdf69('0x14')](function(_0x16b3ee){if(_0x16b3ee){return _0x16b3ee[_0xdf69('0x26')](_0xe339ac[_0xdf69('0x1f')][_0xdf69('0x27')],_[_0xdf69('0x28')](_0xe339ac[_0xdf69('0x1f')],[_0xdf69('0x27'),'id'])||{});}})[_0xdf69('0x29')](function(_0x31cee5){logger[_0xdf69('0x1c')]('AddTags',_0xe339ac);logger[_0xdf69('0x2a')](_0xdf69('0x2b'),_0xe339ac,JSON[_0xdf69('0x17')](_0x31cee5));_0x4fc007(_0x31cee5);})[_0xdf69('0x1d')](function(_0x1a23d1){logger['error'](_0xdf69('0x2b'),_0x1a23d1['message'],_0xe339ac);_0x301bd2(_this[_0xdf69('0x18')](0x1f4,_0x1a23d1[_0xdf69('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 64c0b79..cc90ba7 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 _0xbc9d=['./mailInteraction.events','update','emit','removeListener','register'];(function(_0x11c517,_0x157ccb){var _0x2d0ab8=function(_0x2aa458){while(--_0x2aa458){_0x11c517['push'](_0x11c517['shift']());}};_0x2d0ab8(++_0x157ccb);}(_0xbc9d,0x113));var _0xdbc9=function(_0x5191d2,_0x5d066e){_0x5191d2=_0x5191d2-0x0;var _0x1a8993=_0xbc9d[_0x5191d2];return _0x1a8993;};'use strict';var MailInteractionEvents=require(_0xdbc9('0x0'));var events=['save','remove',_0xdbc9('0x1')];function createListener(_0x274585,_0x1cf339){return function(_0x42cb3b){_0x1cf339[_0xdbc9('0x2')](_0x274585,_0x42cb3b);};}function removeListener(_0x1dfa1c,_0x5cf9db){return function(){MailInteractionEvents[_0xdbc9('0x3')](_0x1dfa1c,_0x5cf9db);};}exports[_0xdbc9('0x4')]=function(_0x4d8e5d){for(var _0x122840=0x0,_0x405038=events['length'];_0x122840<_0x405038;_0x122840++){var _0x17366e=events[_0x122840];var _0x4876d0=createListener('mailInteraction:'+_0x17366e,_0x4d8e5d);MailInteractionEvents['on'](_0x17366e,_0x4876d0);}}; \ No newline at end of file +var _0xf909=['removeListener','register','length','mailInteraction:','remove','update'];(function(_0x20b001,_0x11d454){var _0x3e1ec0=function(_0x249f11){while(--_0x249f11){_0x20b001['push'](_0x20b001['shift']());}};_0x3e1ec0(++_0x11d454);}(_0xf909,0x1a8));var _0x9f90=function(_0x136a87,_0xfcad7){_0x136a87=_0x136a87-0x0;var _0x4e6b48=_0xf909[_0x136a87];return _0x4e6b48;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save',_0x9f90('0x0'),_0x9f90('0x1')];function createListener(_0x117176,_0x4e74ea){return function(_0x342918){_0x4e74ea['emit'](_0x117176,_0x342918);};}function removeListener(_0x45b51b,_0x236936){return function(){MailInteractionEvents[_0x9f90('0x2')](_0x45b51b,_0x236936);};}exports[_0x9f90('0x3')]=function(_0x13b636){for(var _0x371984=0x0,_0x3698c2=events[_0x9f90('0x4')];_0x371984<_0x3698c2;_0x371984++){var _0xbc0807=events[_0x371984];var _0x5f4712=createListener(_0x9f90('0x5')+_0xbc0807,_0x13b636);MailInteractionEvents['on'](_0xbc0807,_0x5f4712);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 129b33d..17994ce 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 _0xda19=['update','put','/:id/accept','reject','destroy','exports','util','path','express','../../components/auth/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','download','post','tracked','mail','mailmessage:create','/:id'];(function(_0x22c694,_0x3bebe9){var _0x2f8dd8=function(_0x1a8abb){while(--_0x1a8abb){_0x22c694['push'](_0x22c694['shift']());}};_0x2f8dd8(++_0x3bebe9);}(_0xda19,0xd5));var _0x9da1=function(_0x3db083,_0x3134ca){_0x3db083=_0x3db083-0x0;var _0x300abf=_0xda19[_0x3db083];return _0x300abf;};'use strict';var multer=require('multer');var util=require(_0x9da1('0x0'));var path=require(_0x9da1('0x1'));var timeout=require('connect-timeout');var express=require(_0x9da1('0x2'));var router=express['Router']();var auth=require(_0x9da1('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9da1('0x4'));var controller=require(_0x9da1('0x5'));router[_0x9da1('0x6')]('/',auth[_0x9da1('0x7')](),controller[_0x9da1('0x8')]);router[_0x9da1('0x6')](_0x9da1('0x9'),auth[_0x9da1('0x7')](),controller[_0x9da1('0xa')]);router[_0x9da1('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x9da1('0x6')]('/:id/download',auth[_0x9da1('0x7')](),controller[_0x9da1('0xb')]);router[_0x9da1('0xc')]('/',auth[_0x9da1('0x7')](),interaction[_0x9da1('0xd')](_0x9da1('0xe'),_0x9da1('0xf')),controller['create']);router['put'](_0x9da1('0x10'),auth['isAuthenticated'](),controller[_0x9da1('0x11')]);router[_0x9da1('0x12')](_0x9da1('0x13'),auth[_0x9da1('0x7')](),controller['accept']);router[_0x9da1('0x12')]('/:id/reject',auth['isAuthenticated'](),controller[_0x9da1('0x14')]);router['delete'](_0x9da1('0x10'),auth[_0x9da1('0x7')](),controller[_0x9da1('0x15')]);module[_0x9da1('0x16')]=router; \ No newline at end of file +var _0xac9d=['show','/:id/download','download','post','tracked','mail','create','put','update','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x289323,_0x381856){var _0x40da04=function(_0x27f2da){while(--_0x27f2da){_0x289323['push'](_0x289323['shift']());}};_0x40da04(++_0x381856);}(_0xac9d,0x14d));var _0xdac9=function(_0x27c068,_0x342981){_0x27c068=_0x27c068-0x0;var _0xe5a67f=_0xac9d[_0x27c068];return _0xe5a67f;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var timeout=require(_0xdac9('0x3'));var express=require(_0xdac9('0x4'));var router=express[_0xdac9('0x5')]();var auth=require(_0xdac9('0x6'));var interaction=require(_0xdac9('0x7'));var config=require('../../config/environment');var controller=require(_0xdac9('0x8'));router['get']('/',auth[_0xdac9('0x9')](),controller[_0xdac9('0xa')]);router[_0xdac9('0xb')](_0xdac9('0xc'),auth[_0xdac9('0x9')](),controller[_0xdac9('0xd')]);router['get'](_0xdac9('0xe'),auth['isAuthenticated'](),controller[_0xdac9('0xf')]);router[_0xdac9('0xb')](_0xdac9('0x10'),auth[_0xdac9('0x9')](),controller[_0xdac9('0x11')]);router[_0xdac9('0x12')]('/',auth[_0xdac9('0x9')](),interaction[_0xdac9('0x13')](_0xdac9('0x14'),'mailmessage:create'),controller[_0xdac9('0x15')]);router[_0xdac9('0x16')]('/:id',auth[_0xdac9('0x9')](),controller[_0xdac9('0x17')]);router[_0xdac9('0x16')]('/:id/accept',auth[_0xdac9('0x9')](),controller[_0xdac9('0x18')]);router[_0xdac9('0x16')]('/:id/reject',auth['isAuthenticated'](),controller[_0xdac9('0x19')]);router[_0xdac9('0x1a')]('/:id',auth[_0xdac9('0x9')](),controller[_0xdac9('0x1b')]);module[_0xdac9('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 3dda2a6..be62d54 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 _0xfc82=['STRING','DATE','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out'];(function(_0x2d26d1,_0x277aee){var _0x534e1d=function(_0x5bd318){while(--_0x5bd318){_0x2d26d1['push'](_0x2d26d1['shift']());}};_0x534e1d(++_0x277aee);}(_0xfc82,0xe9));var _0x2fc8=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xfc82[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x2fc8('0x0'));var _=require(_0x2fc8('0x1'));module[_0x2fc8('0x2')]={'body':{'type':Sequelize[_0x2fc8('0x3')](_0x2fc8('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x2fc8('0x3')](_0x2fc8('0x5'))},'read':{'type':Sequelize[_0x2fc8('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2fc8('0x7')]('in','out'),'defaultValue':_0x2fc8('0x8'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x2fc8('0x9')]},'to':{'type':Sequelize[_0x2fc8('0x3')](_0x2fc8('0x4'))},'cc':{'type':Sequelize[_0x2fc8('0x3')](_0x2fc8('0x4'))},'bcc':{'type':Sequelize[_0x2fc8('0x3')](_0x2fc8('0x4'))},'subject':{'type':Sequelize[_0x2fc8('0x3')]},'sentAt':{'type':Sequelize[_0x2fc8('0xa')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x2fc8('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT'](_0x2fc8('0x4'))},'originCc':{'type':Sequelize[_0x2fc8('0x3')](_0x2fc8('0x4'))}}; \ No newline at end of file +var _0xf5ab=['STRING','INTEGER','BOOLEAN','DATE','sequelize','lodash','exports','TEXT','long','medium','out'];(function(_0x3644c5,_0x14b5ea){var _0x39a3bd=function(_0x1be6e2){while(--_0x1be6e2){_0x3644c5['push'](_0x3644c5['shift']());}};_0x39a3bd(++_0x14b5ea);}(_0xf5ab,0x117));var _0xbf5a=function(_0x3d4a39,_0x2bc065){_0x3d4a39=_0x3d4a39-0x0;var _0x343c32=_0xf5ab[_0x3d4a39];return _0x343c32;};'use strict';var Sequelize=require(_0xbf5a('0x0'));var _=require(_0xbf5a('0x1'));module[_0xbf5a('0x2')]={'body':{'type':Sequelize[_0xbf5a('0x3')](_0xbf5a('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbf5a('0x3')](_0xbf5a('0x5'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbf5a('0x6')),'defaultValue':_0xbf5a('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xbf5a('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xbf5a('0x3')]('long')},'cc':{'type':Sequelize['TEXT'](_0xbf5a('0x4'))},'bcc':{'type':Sequelize[_0xbf5a('0x3')](_0xbf5a('0x4'))},'subject':{'type':Sequelize[_0xbf5a('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xbf5a('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xbf5a('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xbf5a('0xa')]},'originTo':{'type':Sequelize[_0xbf5a('0x3')]('long')},'originCc':{'type':Sequelize[_0xbf5a('0x3')](_0xbf5a('0x4'))}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index a23c51c..4420a3b 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 _0x3667=['../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','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~!@#$%^&-_=+[{]}.','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','stack','name','send','index','MailMessage','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','map','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','body','create','secret','MailAccount','findOne','MailAccountId','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','basename','SendMail','sendMail','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','read','readAt','format','UserId','CmContact','Contact','get','MailInteraction','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','reject','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','download','unix','toString','files','tmp','server','message-%s.eml','from','bcc','subject','createdAt','Attachments','headers','Bcc','existsSync','push','type','build','writeFileSync','log','unlinkSync','html-pdf','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x416c3e,_0x52f6b1){var _0x591e4f=function(_0x47a117){while(--_0x47a117){_0x416c3e['push'](_0x416c3e['shift']());}};_0x591e4f(++_0x52f6b1);}(_0x3667,0x8d));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x7366('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7366('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7366('0x2'));var rp=require(_0x7366('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7366('0x4'));var util=require('util');var path=require(_0x7366('0x5'));var sox=require(_0x7366('0x6'));var csv=require(_0x7366('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7366('0x8'));var squel=require(_0x7366('0x9'));var crypto=require(_0x7366('0xa'));var jsforce=require(_0x7366('0xb'));var deskjs=require(_0x7366('0xc'));var toCsv=require(_0x7366('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7366('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x7366('0xe'));var hardwareService=require(_0x7366('0xf'));var logger=require(_0x7366('0x10'))(_0x7366('0x11'));var utils=require(_0x7366('0x12'));var config=require('../../config/environment');var db=require(_0x7366('0x13'))['db'];config[_0x7366('0x14')]=_[_0x7366('0x15')](config['redis'],{'host':_0x7366('0x16'),'port':0x18eb});var socket=require(_0x7366('0x17'))(new Redis(config['redis']));require(_0x7366('0x18'))[_0x7366('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7366('0x1a')][_0x7366('0x1b')]({'port':0x232c});var client9003=jayson[_0x7366('0x1a')]['http']({'port':0x232b});var client9002=jayson[_0x7366('0x1a')][_0x7366('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x66f716,_0x3f3f2e,_0x299de1){if(_0x299de1){var _0x1d59e4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1d59e4[_0x7366('0x1c')](_0x3f3f2e)){return _0x66f716;}else{throw new Error(_0x7366('0x1d'));}}else{return _0x66f716;}}function respondWithRpcPromise(_0x5f085f,_0x10abfe,_0x566499,_0x37511b){return new BPromise(function(_0x3d6447,_0x3e51ca){var _0x387f3b=_0x37511b||client;return _0x387f3b['request'](_0x5f085f,_0x566499)[_0x7366('0x1e')](function(_0x3f692f){logger[_0x7366('0x1f')](_0x7366('0x20'),_0x10abfe,_0x7366('0x21'));logger[_0x7366('0x22')](_0x7366('0x23'),_0x10abfe,_0x7366('0x21'),JSON[_0x7366('0x24')](_0x3f692f));if(_0x3f692f[_0x7366('0x25')]){if(_0x3f692f[_0x7366('0x25')]['code']===0x1f4){logger[_0x7366('0x25')](_0x7366('0x20'),_0x10abfe,_0x3f692f['error']['message']);return _0x3e51ca(_0x3f692f[_0x7366('0x25')][_0x7366('0x26')]);}logger['error'](_0x7366('0x20'),_0x10abfe,_0x3f692f['error'][_0x7366('0x26')]);return _0x3d6447(_0x3f692f['error']['message']);}else{logger[_0x7366('0x1f')](_0x7366('0x20'),_0x10abfe,_0x7366('0x21'));_0x3d6447(_0x3f692f[_0x7366('0x27')][_0x7366('0x26')]);}})['catch'](function(_0x442352){logger[_0x7366('0x25')](_0x7366('0x20'),_0x10abfe,_0x442352);_0x3e51ca(_0x442352);});});}function respondWithStatusCode(_0x397603,_0x220450){_0x220450=_0x220450||0xcc;return function(_0x50ff2e){if(_0x50ff2e){return _0x397603['sendStatus'](_0x220450);}return _0x397603[_0x7366('0x28')](_0x220450)[_0x7366('0x29')]();};}function respondWithResult(_0x5acebe,_0x41ec57){_0x41ec57=_0x41ec57||0xc8;return function(_0xd7c49e){if(_0xd7c49e){return _0x5acebe['status'](_0x41ec57)['json'](_0xd7c49e);}};}function respondWithFilteredResult(_0x2b59a7,_0x2e218d){return function(_0x35269c){if(_0x35269c){var _0x44dd82=_0x35269c[_0x7366('0x2a')],_0x2ac68a=_0x2e218d[_0x7366('0x2b')],_0xe5d1f4=_0x2e218d[_0x7366('0x2b')]+_0x2e218d[_0x7366('0x2c')],_0x3e4fdc;if(_0xe5d1f4>=_0x44dd82){_0xe5d1f4=_0x44dd82;_0x3e4fdc=0xc8;}else{_0x3e4fdc=0xce;}_0x2b59a7[_0x7366('0x28')](_0x3e4fdc);return _0x2b59a7[_0x7366('0x2d')](_0x7366('0x2e'),_0x2ac68a+'-'+_0xe5d1f4+'/'+_0x44dd82)[_0x7366('0x2f')](_0x35269c);}return null;};}function patchUpdates(_0x3e9681){return function(_0x36a8cb){try{jsonpatch[_0x7366('0x30')](_0x36a8cb,_0x3e9681,!![]);}catch(_0x1ede90){return BPromise['reject'](_0x1ede90);}return _0x36a8cb[_0x7366('0x31')]();};}function saveUpdates(_0x1fe2aa,_0x4f145d){return function(_0x4ad3b9){if(_0x4ad3b9){return _0x4ad3b9[_0x7366('0x32')](_0x1fe2aa)[_0x7366('0x1e')](function(_0x5d6490){return _0x5d6490;});}return null;};}function removeEntity(_0xf817c0,_0x1df992){return function(_0x3793e2){if(_0x3793e2){return _0x3793e2[_0x7366('0x33')]()[_0x7366('0x1e')](function(){_0xf817c0[_0x7366('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14911a,_0x3b4314){return function(_0x508a00){if(!_0x508a00){_0x14911a['sendStatus'](0x194);}return _0x508a00;};}function handleError(_0x373e4c,_0x2a7b51){_0x2a7b51=_0x2a7b51||0x1f4;return function(_0x218e30){logger['error'](_0x218e30[_0x7366('0x34')]);if(_0x218e30[_0x7366('0x35')]){delete _0x218e30[_0x7366('0x35')];}_0x373e4c[_0x7366('0x28')](_0x2a7b51)[_0x7366('0x36')](_0x218e30);};}exports[_0x7366('0x37')]=function(_0x5462fe,_0x565326){var _0x1ec431={},_0x55683f={},_0x1e0f84={'count':0x0,'rows':[]};var _0x10a200=db[_0x7366('0x38')]['rawAttributes'];_0x55683f[_0x7366('0x39')]=_['keys'](_0x10a200);_0x55683f[_0x7366('0x3a')]=_['keys'](_0x5462fe[_0x7366('0x3a')]);_0x55683f[_0x7366('0x3b')]=_[_0x7366('0x3c')](_0x55683f[_0x7366('0x39')],_0x55683f[_0x7366('0x3a')]);_0x1ec431[_0x7366('0x3d')]=_[_0x7366('0x3c')](_0x55683f[_0x7366('0x39')],qs['fields'](_0x5462fe[_0x7366('0x3a')][_0x7366('0x3e')]));_0x1ec431[_0x7366('0x3d')]=_0x1ec431[_0x7366('0x3d')][_0x7366('0x3f')]?_0x1ec431[_0x7366('0x3d')]:_0x55683f[_0x7366('0x39')];if(!_0x5462fe['query']['hasOwnProperty']('nolimit')){_0x1ec431[_0x7366('0x2c')]=qs[_0x7366('0x2c')](_0x5462fe['query'][_0x7366('0x2c')]);_0x1ec431['offset']=qs['offset'](_0x5462fe['query'][_0x7366('0x2b')]);}_0x1ec431[_0x7366('0x40')]=qs[_0x7366('0x41')](_0x5462fe['query'][_0x7366('0x41')]);_0x1ec431[_0x7366('0x42')]=qs[_0x7366('0x3b')](_[_0x7366('0x43')](_0x5462fe[_0x7366('0x3a')],_0x55683f[_0x7366('0x3b')]));if(_0x5462fe['query'][_0x7366('0x44')]){_0x1ec431[_0x7366('0x42')]=_[_0x7366('0x45')](_0x1ec431[_0x7366('0x42')],{'$or':_[_0x7366('0x46')](_0x10a200,function(_0x491b55){if(_0x491b55['type']['key']!==_0x7366('0x47')){var _0x595d64={};_0x595d64[_0x491b55[_0x7366('0x48')]]={'$like':'%'+_0x5462fe[_0x7366('0x3a')][_0x7366('0x44')]+'%'};return _0x595d64;}})});}_0x1ec431=_[_0x7366('0x45')]({},_0x1ec431,_0x5462fe[_0x7366('0x49')]);var _0x296bbc={'where':_0x1ec431[_0x7366('0x42')]};return db['MailMessage']['count'](_0x296bbc)[_0x7366('0x1e')](function(_0x512ea8){_0x1e0f84[_0x7366('0x2a')]=_0x512ea8;if(_0x5462fe['query'][_0x7366('0x4a')]){_0x1ec431[_0x7366('0x4b')]=[{'all':!![]}];}return db[_0x7366('0x38')][_0x7366('0x4c')](_0x1ec431);})[_0x7366('0x1e')](function(_0x578466){_0x1e0f84[_0x7366('0x4d')]=_0x578466;return _0x1e0f84;})[_0x7366('0x1e')](respondWithFilteredResult(_0x565326,_0x1ec431))[_0x7366('0x4e')](handleError(_0x565326,null));};exports[_0x7366('0x4f')]=function(_0x11d4fd,_0x12fb94){var _0x517968={'raw':!![],'where':{'id':_0x11d4fd[_0x7366('0x50')]['id']}},_0x37b0f9={};_0x37b0f9[_0x7366('0x39')]=_[_0x7366('0x51')](db['MailMessage'][_0x7366('0x52')]);_0x37b0f9[_0x7366('0x3a')]=_[_0x7366('0x51')](_0x11d4fd[_0x7366('0x3a')]);_0x37b0f9[_0x7366('0x3b')]=_[_0x7366('0x3c')](_0x37b0f9[_0x7366('0x39')],_0x37b0f9['query']);_0x517968['attributes']=_[_0x7366('0x3c')](_0x37b0f9[_0x7366('0x39')],qs[_0x7366('0x3e')](_0x11d4fd['query']['fields']));_0x517968[_0x7366('0x3d')]=_0x517968[_0x7366('0x3d')][_0x7366('0x3f')]?_0x517968[_0x7366('0x3d')]:_0x37b0f9[_0x7366('0x39')];if(_0x11d4fd['query'][_0x7366('0x4a')]){_0x517968['include']=[{'all':!![]}];}_0x517968=_['merge']({},_0x517968,_0x11d4fd[_0x7366('0x49')]);return db['MailMessage'][_0x7366('0x53')](_0x517968)[_0x7366('0x1e')](handleEntityNotFound(_0x12fb94,null))[_0x7366('0x1e')](respondWithResult(_0x12fb94,null))[_0x7366('0x4e')](handleError(_0x12fb94,null));};exports[_0x7366('0x32')]=function(_0x133b7a,_0x322c93){if(_0x133b7a[_0x7366('0x54')]['id']){delete _0x133b7a[_0x7366('0x54')]['id'];}return db['MailMessage'][_0x7366('0x53')]({'where':{'id':_0x133b7a['params']['id']}})[_0x7366('0x1e')](handleEntityNotFound(_0x322c93,null))[_0x7366('0x1e')](saveUpdates(_0x133b7a['body'],null))[_0x7366('0x1e')](respondWithResult(_0x322c93,null))[_0x7366('0x4e')](handleError(_0x322c93,null));};exports[_0x7366('0x33')]=function(_0x132d93,_0xa6230e){return db['MailMessage']['find']({'where':{'id':_0x132d93[_0x7366('0x50')]['id']}})[_0x7366('0x1e')](handleEntityNotFound(_0xa6230e,null))[_0x7366('0x1e')](removeEntity(_0xa6230e,null))['catch'](handleError(_0xa6230e,null));};exports['describe']=function(_0x42cbf2,_0x343096){return db[_0x7366('0x38')]['describe']()[_0x7366('0x1e')](respondWithResult(_0x343096,null))['catch'](handleError(_0x343096,null));};exports[_0x7366('0x55')]=function(_0x2a7e17,_0x52a20e){return db[_0x7366('0x38')][_0x7366('0x55')](_0x2a7e17[_0x7366('0x54')])[_0x7366('0x1e')](function(_0x959758){if(_0x959758){if(_0x959758['direction']==='out'&&!_0x959758[_0x7366('0x56')]){return db[_0x7366('0x57')][_0x7366('0x58')]({'where':{'id':_0x959758[_0x7366('0x59')]},'include':[{'model':db[_0x7366('0x5a')],'as':_0x7366('0x5b'),'raw':!![]}]})[_0x7366('0x1e')](function(_0x4e12a9){if(_0x4e12a9&&_0x4e12a9['Smtp']){var _0x29f4c9={'tls':{'rejectUnauthorized':![]}};if(_[_0x7366('0x5c')](_0x4e12a9[_0x7366('0x5b')][_0x7366('0x5d')])){_0x29f4c9['host']=_0x4e12a9[_0x7366('0x5b')][_0x7366('0x5e')];_0x29f4c9['port']=_0x4e12a9[_0x7366('0x5b')][_0x7366('0x5f')];_0x29f4c9['secure']=_0x4e12a9['Smtp'][_0x7366('0x60')];if(_0x4e12a9['Smtp'][_0x7366('0x61')]){_0x29f4c9[_0x7366('0x62')]={'user':_0x4e12a9[_0x7366('0x5b')][_0x7366('0x63')],'pass':_0x4e12a9[_0x7366('0x5b')][_0x7366('0x64')]};}}else{_0x29f4c9[_0x7366('0x5d')]=_0x4e12a9['Smtp'][_0x7366('0x5d')];_0x29f4c9['auth']={'user':_0x4e12a9[_0x7366('0x5b')][_0x7366('0x63')],'pass':_0x4e12a9['Smtp']['pass']};_0x29f4c9[_0x7366('0x60')]=_0x4e12a9[_0x7366('0x5b')][_0x7366('0x60')];}if(_0x2a7e17[_0x7366('0x54')]['attachments']&&_0x2a7e17[_0x7366('0x54')][_0x7366('0x65')]['length']){for(var _0x1e41e3=0x0;_0x1e41e3<_0x2a7e17[_0x7366('0x54')][_0x7366('0x65')][_0x7366('0x3f')];_0x1e41e3+=0x1){_0x2a7e17[_0x7366('0x54')][_0x7366('0x65')][_0x1e41e3]={'filename':_0x2a7e17[_0x7366('0x54')][_0x7366('0x65')][_0x1e41e3]['name'],'path':path[_0x7366('0x66')](config[_0x7366('0x67')],_0x7366('0x68'),_0x2a7e17['body'][_0x7366('0x65')][_0x1e41e3][_0x7366('0x69')])};}}return{'account':_0x29f4c9,'message':_0x2a7e17['body']};}})[_0x7366('0x1e')](function(_0x21ad66){if(_0x21ad66){return respondWithRpcPromise(_0x7366('0x6a'),_0x7366('0x6b'),_0x21ad66,client9003)['then'](function(_0x2f4957){return _0x959758[_0x7366('0x32')]({'read':!![],'messageId':_0x2f4957['messageId'],'sentAt':moment()['format'](_0x7366('0x6c'))});})[_0x7366('0x4e')](function(_0x167876){logger[_0x7366('0x25')]('%s',JSON[_0x7366('0x24')](_0x167876));return _0x959758;});}return _0x959758;});}return _0x959758;}})[_0x7366('0x1e')](respondWithResult(_0x52a20e,0xc9))['catch'](handleError(_0x52a20e,null));};var interaction_log=require('../../config/logger')(_0x7366('0x6d'));exports[_0x7366('0x6e')]=function(_0x3fcece,_0x48ba00,_0x23c54f){var _0x18d780={'channel':'mail'};if(_0x3fcece[_0x7366('0x54')]['id']){delete _0x3fcece[_0x7366('0x54')]['id'];}_0x3fcece[_0x7366('0x54')][_0x7366('0x6f')]=!![];_0x3fcece[_0x7366('0x54')][_0x7366('0x70')]=moment()[_0x7366('0x71')](_0x7366('0x6c'));_0x3fcece[_0x7366('0x54')][_0x7366('0x72')]=_0x3fcece[_0x7366('0x54')][_0x7366('0x72')]||_0x3fcece[_0x7366('0x63')]['id'];return db[_0x7366('0x38')][_0x7366('0x53')]({'where':{'id':_0x3fcece[_0x7366('0x50')]['id'],'UserId':null},'include':[{'model':db[_0x7366('0x73')],'as':_0x7366('0x74')}]})['then'](handleEntityNotFound(_0x48ba00,null))[_0x7366('0x1e')](saveUpdates(_0x3fcece[_0x7366('0x54')],null))[_0x7366('0x1e')](function(_0x116344){if(_0x116344){_0x18d780[_0x7366('0x26')]=_0x116344[_0x7366('0x75')]({'plain':!![]});return db[_0x7366('0x76')]['find']({'where':{'id':_0x116344['MailInteractionId']}});}return null;})[_0x7366('0x1e')](handleEntityNotFound(_0x48ba00,null))[_0x7366('0x1e')](function(_0x51088b){if(_0x51088b){return _0x51088b[_0x7366('0x32')]({'UserId':_0x3fcece[_0x7366('0x54')]['UserId'],'read1stAt':_['isNil'](_0x51088b[_0x7366('0x77')])?moment()['format'](_0x7366('0x6c')):undefined});}return null;})[_0x7366('0x1e')](function(_0x1119c6){if(_0x1119c6){_0x18d780[_0x7366('0x78')]=_0x1119c6['get']({'plain':!![]});interaction_log[_0x7366('0x1f')](_0x7366('0x79'),_0x3fcece[_0x7366('0x63')]['id'],_0x3fcece[_0x7366('0x63')][_0x7366('0x35')],_0x3fcece[_0x7366('0x63')][_0x7366('0x7a')],_0x18d780['interaction']['id'],_0x3fcece[_0x7366('0x54')]?JSON[_0x7366('0x24')](_0x3fcece['body']):_0x7366('0x7b'));return respondWithRpcPromise(_0x7366('0x7c'),_0x7366('0x7d'),_0x18d780);}return null;})[_0x7366('0x1e')](function(_0x26169a){if(_0x26169a){if(_0x3fcece[_0x7366('0x54')][_0x7366('0x7e')]){_0x18d780[_0x7366('0x26')][_0x7366('0x7f')]=util[_0x7366('0x71')](_0x7366('0x80'),_0x3fcece['user'][_0x7366('0x35')]);_0x18d780[_0x7366('0x26')][_0x7366('0x81')]=_0x18d780[_0x7366('0x81')];_0x18d780[_0x7366('0x26')][_0x7366('0x82')]=_0x7366('0x6e');return respondWithRpcPromise(_0x7366('0x83'),_0x7366('0x83'),{'event':_0x7366('0x84'),'message':_0x18d780[_0x7366('0x26')]},client9002)['then'](function(){return _0x18d780;});}return _0x18d780;}return null;})[_0x7366('0x1e')](respondWithResult(_0x48ba00,null))[_0x7366('0x4e')](handleError(_0x48ba00,null));};var interaction_log=require(_0x7366('0x10'))('mail-interactions');exports[_0x7366('0x85')]=function(_0x290386,_0x3d6cde,_0x2612a1){var _0x1ac29c={'agent':{},'channel':_0x7366('0x86')};if(_0x290386[_0x7366('0x54')]['id']){delete _0x290386[_0x7366('0x54')]['id'];}_0x290386[_0x7366('0x54')][_0x7366('0x72')]=_0x290386[_0x7366('0x54')]['UserId']||_0x290386[_0x7366('0x63')]['id'];_0x1ac29c['agent']['id']=_0x290386[_0x7366('0x54')][_0x7366('0x72')];return db[_0x7366('0x38')][_0x7366('0x53')]({'where':{'id':_0x290386['params']['id'],'UserId':null}})[_0x7366('0x1e')](handleEntityNotFound(_0x3d6cde,null))[_0x7366('0x1e')](function(_0x5dc654){if(_0x5dc654){_0x1ac29c['message']=_0x5dc654[_0x7366('0x75')]({'plain':!![]});return db[_0x7366('0x76')][_0x7366('0x53')]({'where':{'id':_0x5dc654['MailInteractionId']}});}return null;})[_0x7366('0x1e')](handleEntityNotFound(_0x3d6cde,null))[_0x7366('0x1e')](function(_0x3556fb){if(_0x3556fb){_0x1ac29c[_0x7366('0x78')]=_0x3556fb[_0x7366('0x75')]({'plain':!![]});interaction_log['info'](_0x7366('0x87'),_0x290386['user']['id'],_0x290386[_0x7366('0x63')][_0x7366('0x35')],_0x290386[_0x7366('0x63')]['role'],_0x1ac29c[_0x7366('0x78')]['id'],_0x290386[_0x7366('0x54')]?JSON[_0x7366('0x24')](_0x290386[_0x7366('0x54')]):_0x7366('0x7b'));return respondWithRpcPromise(_0x7366('0x88'),_0x7366('0x89'),_0x1ac29c);}return null;})['then'](function(_0x35fda1){if(_0x35fda1){_0x35fda1[_0x7366('0x26')][_0x7366('0x7f')]=util[_0x7366('0x71')](_0x7366('0x80'),_0x290386[_0x7366('0x63')][_0x7366('0x35')]);_0x35fda1[_0x7366('0x26')]['channel']=_0x1ac29c[_0x7366('0x81')];_0x35fda1['message'][_0x7366('0x82')]=_0x7366('0x85');respondWithRpcPromise('EventManager',_0x7366('0x83'),{'event':_0x7366('0x8a'),'message':_0x35fda1[_0x7366('0x26')]},client9002);return _0x1ac29c;}return null;})[_0x7366('0x1e')](respondWithResult(_0x3d6cde,null))[_0x7366('0x4e')](handleError(_0x3d6cde,null));};exports[_0x7366('0x8b')]=function(_0x2ed386,_0x279297){var _0x52b2cf=moment()[_0x7366('0x8c')]()[_0x7366('0x8d')]();var _0x2247b4=path[_0x7366('0x66')](config['root'],'server',_0x7366('0x8e'),_0x7366('0x8f'));var _0xf46354=path[_0x7366('0x66')](config[_0x7366('0x67')],_0x7366('0x90'),_0x7366('0x8e'),'attachments');var _0x477075=util[_0x7366('0x71')](_0x7366('0x91'),_0x52b2cf);return db[_0x7366('0x38')]['find']({'where':{'id':_0x2ed386[_0x7366('0x50')]['id']},'attributes':['id','body',_0x7366('0x92'),'to','cc',_0x7366('0x93'),_0x7366('0x94'),_0x7366('0x95')],'include':_0x2ed386['query'][_0x7366('0x65')]?[{'model':db['Attachment'],'as':_0x7366('0x96')}]:undefined})['then'](handleEntityNotFound(_0x279297,null))[_0x7366('0x1e')](function(_0x4fcd41){if(_0x4fcd41){var _0x2bfb2d=_0x4fcd41;var _0x5a01d3={'from':_0x2bfb2d['from'],'to':_0x2bfb2d['to'],'subject':_0x2bfb2d[_0x7366('0x94')],'html':_0x2bfb2d[_0x7366('0x54')],'headers':{'Date':moment(_0x2bfb2d[_0x7366('0x95')])[_0x7366('0x71')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x4fcd41['cc']){_0x5a01d3[_0x7366('0x97')]['Cc']=_0x4fcd41['cc'];}if(_0x4fcd41[_0x7366('0x93')]){_0x5a01d3[_0x7366('0x97')][_0x7366('0x98')]=_0x4fcd41[_0x7366('0x93')];}return new BPromise(function(_0x2dc0b3,_0x14eaf1){if(_0x4fcd41[_0x7366('0x96')]){for(var _0x19a6a7=0x0;_0x19a6a7<_0x4fcd41[_0x7366('0x96')][_0x7366('0x3f')];_0x19a6a7++){var _0x260ad1=_0x4fcd41[_0x7366('0x96')][_0x19a6a7];var _0x5efe16=path[_0x7366('0x66')](_0xf46354,_0x260ad1[_0x7366('0x69')]);if(fs[_0x7366('0x99')](_0x5efe16)){_0x5a01d3[_0x7366('0x65')][_0x7366('0x9a')]({'name':_0x260ad1[_0x7366('0x35')],'contentType':_0x260ad1[_0x7366('0x9b')],'data':fs['readFileSync'](_0x5efe16)});}}}emlformat[_0x7366('0x9c')](_0x5a01d3,function(_0x3d37b4,_0x5384db){if(_0x3d37b4)return _0x14eaf1(_0x3d37b4);fs[_0x7366('0x9d')](path[_0x7366('0x66')](_0x2247b4,_0x477075),_0x5384db);return _0x2dc0b3(_0x5384db);});});}})['then'](function(_0x3289b8){if(_0x3289b8){return _0x279297[_0x7366('0x8b')](path[_0x7366('0x66')](_0x2247b4,_0x477075),_0x477075,function(_0x1e446e){if(_0x1e446e){console[_0x7366('0x9e')]('err',_0x1e446e);}else{fs[_0x7366('0x9f')](path[_0x7366('0x66')](_0x2247b4,_0x477075));}});}})['catch'](handleError(_0x279297,null));}; \ No newline at end of file +var _0x86ef=['end','count','offset','limit','Content-Range','json','apply','reject','save','then','sendStatus','stack','send','MailMessage','rawAttributes','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','include','findAll','rows','show','params','fields','includeAll','options','find','update','body','destroy','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','attachments','name','join','root','server/files/attachments','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','mail','read','readAt','UserId','user','CmContact','Contact','get','MailInteraction','MailInteractionId','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','manual','interface','SIP/%s','channel','event','EventManager','../../config/logger','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','download','unix','toString','files','tmp','server','message-%s.eml','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','push','readFileSync','build','log','unlinkSync','html-pdf','eml-format','zip-dir','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','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','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~!@#$%^&-_=+[{]}.','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x86ef,0x79));var _0xf86e=function(_0x577e82,_0x211684){_0x577e82=_0x577e82-0x0;var _0x2ff3bb=_0x86ef[_0x577e82];return _0x2ff3bb;};'use strict';var pdf=require(_0xf86e('0x0'));var emlformat=require(_0xf86e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf86e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf86e('0x3'));var moment=require(_0xf86e('0x4'));var BPromise=require(_0xf86e('0x5'));var Mustache=require(_0xf86e('0x6'));var util=require(_0xf86e('0x7'));var path=require(_0xf86e('0x8'));var sox=require(_0xf86e('0x9'));var csv=require(_0xf86e('0xa'));var ejs=require(_0xf86e('0xb'));var fs=require('fs');var _=require(_0xf86e('0xc'));var squel=require(_0xf86e('0xd'));var crypto=require(_0xf86e('0xe'));var jsforce=require(_0xf86e('0xf'));var deskjs=require(_0xf86e('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf86e('0x11'));var Papa=require(_0xf86e('0x12'));var Redis=require('ioredis');var authService=require(_0xf86e('0x13'));var qs=require(_0xf86e('0x14'));var hardwareService=require(_0xf86e('0x15'));var logger=require('../../config/logger')(_0xf86e('0x16'));var utils=require('../../config/utils');var config=require(_0xf86e('0x17'));var db=require(_0xf86e('0x18'))['db'];config['redis']=_[_0xf86e('0x19')](config[_0xf86e('0x1a')],{'host':_0xf86e('0x1b'),'port':0x18eb});var socket=require(_0xf86e('0x1c'))(new Redis(config['redis']));require(_0xf86e('0x1d'))[_0xf86e('0x1e')](socket);var jayson=require(_0xf86e('0x1f'));var client=jayson[_0xf86e('0x20')][_0xf86e('0x21')]({'port':0x232c});var client9003=jayson['client'][_0xf86e('0x21')]({'port':0x232b});var client9002=jayson[_0xf86e('0x20')]['http']({'port':0x232a});function checkPasswordPattern(_0x4c0706,_0xb870bd,_0x387ae0){if(_0x387ae0){var _0x52c2b9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x52c2b9['test'](_0xb870bd)){return _0x4c0706;}else{throw new Error(_0xf86e('0x22'));}}else{return _0x4c0706;}}function respondWithRpcPromise(_0x3a9627,_0x5235ec,_0x156a4e,_0x11bfbd){return new BPromise(function(_0x4a5451,_0x552044){var _0x2fd7a9=_0x11bfbd||client;return _0x2fd7a9['request'](_0x3a9627,_0x156a4e)['then'](function(_0x121bb4){logger[_0xf86e('0x23')](_0xf86e('0x24'),_0x5235ec,_0xf86e('0x25'));logger['debug'](_0xf86e('0x26'),_0x5235ec,'request\x20sent',JSON[_0xf86e('0x27')](_0x121bb4));if(_0x121bb4['error']){if(_0x121bb4[_0xf86e('0x28')][_0xf86e('0x29')]===0x1f4){logger[_0xf86e('0x28')](_0xf86e('0x24'),_0x5235ec,_0x121bb4[_0xf86e('0x28')][_0xf86e('0x2a')]);return _0x552044(_0x121bb4[_0xf86e('0x28')][_0xf86e('0x2a')]);}logger[_0xf86e('0x28')](_0xf86e('0x24'),_0x5235ec,_0x121bb4['error']['message']);return _0x4a5451(_0x121bb4[_0xf86e('0x28')][_0xf86e('0x2a')]);}else{logger[_0xf86e('0x23')](_0xf86e('0x24'),_0x5235ec,_0xf86e('0x25'));_0x4a5451(_0x121bb4[_0xf86e('0x2b')][_0xf86e('0x2a')]);}})[_0xf86e('0x2c')](function(_0xa4405d){logger[_0xf86e('0x28')]('MailMessage,\x20%s,\x20%s',_0x5235ec,_0xa4405d);_0x552044(_0xa4405d);});});}function respondWithStatusCode(_0x47b597,_0x50ba06){_0x50ba06=_0x50ba06||0xcc;return function(_0x460b4c){if(_0x460b4c){return _0x47b597['sendStatus'](_0x50ba06);}return _0x47b597[_0xf86e('0x2d')](_0x50ba06)[_0xf86e('0x2e')]();};}function respondWithResult(_0x2a685d,_0x2029e0){_0x2029e0=_0x2029e0||0xc8;return function(_0x2d3c8e){if(_0x2d3c8e){return _0x2a685d[_0xf86e('0x2d')](_0x2029e0)['json'](_0x2d3c8e);}};}function respondWithFilteredResult(_0x40519b,_0x4d8241){return function(_0x46ff93){if(_0x46ff93){var _0x4d8b56=_0x46ff93[_0xf86e('0x2f')],_0x26f8d1=_0x4d8241[_0xf86e('0x30')],_0xad9a8a=_0x4d8241[_0xf86e('0x30')]+_0x4d8241[_0xf86e('0x31')],_0x131241;if(_0xad9a8a>=_0x4d8b56){_0xad9a8a=_0x4d8b56;_0x131241=0xc8;}else{_0x131241=0xce;}_0x40519b['status'](_0x131241);return _0x40519b['set'](_0xf86e('0x32'),_0x26f8d1+'-'+_0xad9a8a+'/'+_0x4d8b56)[_0xf86e('0x33')](_0x46ff93);}return null;};}function patchUpdates(_0x4513b8){return function(_0x3785da){try{jsonpatch[_0xf86e('0x34')](_0x3785da,_0x4513b8,!![]);}catch(_0x2c249b){return BPromise[_0xf86e('0x35')](_0x2c249b);}return _0x3785da[_0xf86e('0x36')]();};}function saveUpdates(_0x1f98f3,_0x31366f){return function(_0x55feee){if(_0x55feee){return _0x55feee['update'](_0x1f98f3)[_0xf86e('0x37')](function(_0x48fad2){return _0x48fad2;});}return null;};}function removeEntity(_0x31be96,_0x18f8d8){return function(_0x19035f){if(_0x19035f){return _0x19035f['destroy']()[_0xf86e('0x37')](function(){_0x31be96[_0xf86e('0x2d')](0xcc)[_0xf86e('0x2e')]();});}};}function handleEntityNotFound(_0x4100a4,_0x35eb17){return function(_0x71f156){if(!_0x71f156){_0x4100a4[_0xf86e('0x38')](0x194);}return _0x71f156;};}function handleError(_0x12b1dc,_0xe8cd1d){_0xe8cd1d=_0xe8cd1d||0x1f4;return function(_0x1c9d8c){logger['error'](_0x1c9d8c[_0xf86e('0x39')]);if(_0x1c9d8c['name']){delete _0x1c9d8c['name'];}_0x12b1dc[_0xf86e('0x2d')](_0xe8cd1d)[_0xf86e('0x3a')](_0x1c9d8c);};}exports['index']=function(_0x5dfc02,_0x43caf4){var _0x125ed7={},_0x74bde7={},_0x43e30e={'count':0x0,'rows':[]};var _0x207ca9=db[_0xf86e('0x3b')][_0xf86e('0x3c')];_0x74bde7[_0xf86e('0x3d')]=_['keys'](_0x207ca9);_0x74bde7[_0xf86e('0x3e')]=_[_0xf86e('0x3f')](_0x5dfc02[_0xf86e('0x3e')]);_0x74bde7[_0xf86e('0x40')]=_[_0xf86e('0x41')](_0x74bde7[_0xf86e('0x3d')],_0x74bde7[_0xf86e('0x3e')]);_0x125ed7[_0xf86e('0x42')]=_[_0xf86e('0x41')](_0x74bde7['model'],qs['fields'](_0x5dfc02[_0xf86e('0x3e')]['fields']));_0x125ed7[_0xf86e('0x42')]=_0x125ed7['attributes'][_0xf86e('0x43')]?_0x125ed7[_0xf86e('0x42')]:_0x74bde7[_0xf86e('0x3d')];if(!_0x5dfc02['query']['hasOwnProperty'](_0xf86e('0x44'))){_0x125ed7[_0xf86e('0x31')]=qs[_0xf86e('0x31')](_0x5dfc02[_0xf86e('0x3e')][_0xf86e('0x31')]);_0x125ed7[_0xf86e('0x30')]=qs[_0xf86e('0x30')](_0x5dfc02[_0xf86e('0x3e')][_0xf86e('0x30')]);}_0x125ed7[_0xf86e('0x45')]=qs[_0xf86e('0x46')](_0x5dfc02[_0xf86e('0x3e')]['sort']);_0x125ed7[_0xf86e('0x47')]=qs['filters'](_[_0xf86e('0x48')](_0x5dfc02[_0xf86e('0x3e')],_0x74bde7[_0xf86e('0x40')]));if(_0x5dfc02['query'][_0xf86e('0x49')]){_0x125ed7['where']=_[_0xf86e('0x4a')](_0x125ed7[_0xf86e('0x47')],{'$or':_['map'](_0x207ca9,function(_0x1348b1){if(_0x1348b1[_0xf86e('0x4b')][_0xf86e('0x4c')]!==_0xf86e('0x4d')){var _0x2ef739={};_0x2ef739[_0x1348b1[_0xf86e('0x4e')]]={'$like':'%'+_0x5dfc02[_0xf86e('0x3e')][_0xf86e('0x49')]+'%'};return _0x2ef739;}})});}_0x125ed7=_[_0xf86e('0x4a')]({},_0x125ed7,_0x5dfc02['options']);var _0x37879c={'where':_0x125ed7[_0xf86e('0x47')]};return db[_0xf86e('0x3b')]['count'](_0x37879c)[_0xf86e('0x37')](function(_0x1cff5f){_0x43e30e[_0xf86e('0x2f')]=_0x1cff5f;if(_0x5dfc02[_0xf86e('0x3e')]['includeAll']){_0x125ed7[_0xf86e('0x4f')]=[{'all':!![]}];}return db[_0xf86e('0x3b')][_0xf86e('0x50')](_0x125ed7);})['then'](function(_0x3a76b7){_0x43e30e[_0xf86e('0x51')]=_0x3a76b7;return _0x43e30e;})['then'](respondWithFilteredResult(_0x43caf4,_0x125ed7))[_0xf86e('0x2c')](handleError(_0x43caf4,null));};exports[_0xf86e('0x52')]=function(_0x33d43c,_0x4220d8){var _0x4d5bee={'raw':!![],'where':{'id':_0x33d43c[_0xf86e('0x53')]['id']}},_0x5f2fc1={};_0x5f2fc1[_0xf86e('0x3d')]=_[_0xf86e('0x3f')](db[_0xf86e('0x3b')][_0xf86e('0x3c')]);_0x5f2fc1[_0xf86e('0x3e')]=_['keys'](_0x33d43c['query']);_0x5f2fc1[_0xf86e('0x40')]=_[_0xf86e('0x41')](_0x5f2fc1[_0xf86e('0x3d')],_0x5f2fc1[_0xf86e('0x3e')]);_0x4d5bee['attributes']=_[_0xf86e('0x41')](_0x5f2fc1[_0xf86e('0x3d')],qs[_0xf86e('0x54')](_0x33d43c[_0xf86e('0x3e')]['fields']));_0x4d5bee[_0xf86e('0x42')]=_0x4d5bee[_0xf86e('0x42')][_0xf86e('0x43')]?_0x4d5bee[_0xf86e('0x42')]:_0x5f2fc1[_0xf86e('0x3d')];if(_0x33d43c[_0xf86e('0x3e')][_0xf86e('0x55')]){_0x4d5bee[_0xf86e('0x4f')]=[{'all':!![]}];}_0x4d5bee=_[_0xf86e('0x4a')]({},_0x4d5bee,_0x33d43c[_0xf86e('0x56')]);return db['MailMessage'][_0xf86e('0x57')](_0x4d5bee)['then'](handleEntityNotFound(_0x4220d8,null))[_0xf86e('0x37')](respondWithResult(_0x4220d8,null))[_0xf86e('0x2c')](handleError(_0x4220d8,null));};exports[_0xf86e('0x58')]=function(_0x2ca08e,_0x6566fe){if(_0x2ca08e[_0xf86e('0x59')]['id']){delete _0x2ca08e['body']['id'];}return db[_0xf86e('0x3b')][_0xf86e('0x57')]({'where':{'id':_0x2ca08e['params']['id']}})['then'](handleEntityNotFound(_0x6566fe,null))[_0xf86e('0x37')](saveUpdates(_0x2ca08e['body'],null))[_0xf86e('0x37')](respondWithResult(_0x6566fe,null))[_0xf86e('0x2c')](handleError(_0x6566fe,null));};exports[_0xf86e('0x5a')]=function(_0x815b1e,_0x589def){return db[_0xf86e('0x3b')][_0xf86e('0x57')]({'where':{'id':_0x815b1e[_0xf86e('0x53')]['id']}})['then'](handleEntityNotFound(_0x589def,null))[_0xf86e('0x37')](removeEntity(_0x589def,null))[_0xf86e('0x2c')](handleError(_0x589def,null));};exports['describe']=function(_0x4c6773,_0x33cf7c){return db['MailMessage'][_0xf86e('0x5b')]()[_0xf86e('0x37')](respondWithResult(_0x33cf7c,null))[_0xf86e('0x2c')](handleError(_0x33cf7c,null));};exports[_0xf86e('0x5c')]=function(_0x10a6ee,_0x5a4ec2){return db[_0xf86e('0x3b')]['create'](_0x10a6ee['body'])[_0xf86e('0x37')](function(_0x193db3){if(_0x193db3){if(_0x193db3[_0xf86e('0x5d')]===_0xf86e('0x5e')&&!_0x193db3[_0xf86e('0x5f')]){return db[_0xf86e('0x60')][_0xf86e('0x61')]({'where':{'id':_0x193db3[_0xf86e('0x62')]},'include':[{'model':db[_0xf86e('0x63')],'as':_0xf86e('0x64'),'raw':!![]}]})['then'](function(_0x342e7e){if(_0x342e7e&&_0x342e7e[_0xf86e('0x64')]){var _0x3cf4f4={'tls':{'rejectUnauthorized':![]}};if(_[_0xf86e('0x65')](_0x342e7e['Smtp'][_0xf86e('0x66')])){_0x3cf4f4[_0xf86e('0x67')]=_0x342e7e[_0xf86e('0x64')][_0xf86e('0x67')];_0x3cf4f4[_0xf86e('0x68')]=_0x342e7e[_0xf86e('0x64')][_0xf86e('0x68')];_0x3cf4f4[_0xf86e('0x69')]=_0x342e7e[_0xf86e('0x64')][_0xf86e('0x69')];if(_0x342e7e[_0xf86e('0x64')][_0xf86e('0x6a')]){_0x3cf4f4[_0xf86e('0x6b')]={'user':_0x342e7e[_0xf86e('0x64')]['user'],'pass':_0x342e7e['Smtp']['pass']};}}else{_0x3cf4f4['service']=_0x342e7e[_0xf86e('0x64')][_0xf86e('0x66')];_0x3cf4f4[_0xf86e('0x6b')]={'user':_0x342e7e[_0xf86e('0x64')]['user'],'pass':_0x342e7e['Smtp']['pass']};_0x3cf4f4[_0xf86e('0x69')]=_0x342e7e[_0xf86e('0x64')]['secure'];}if(_0x10a6ee[_0xf86e('0x59')][_0xf86e('0x6c')]&&_0x10a6ee[_0xf86e('0x59')][_0xf86e('0x6c')][_0xf86e('0x43')]){for(var _0x49379e=0x0;_0x49379e<_0x10a6ee[_0xf86e('0x59')][_0xf86e('0x6c')][_0xf86e('0x43')];_0x49379e+=0x1){_0x10a6ee[_0xf86e('0x59')][_0xf86e('0x6c')][_0x49379e]={'filename':_0x10a6ee['body'][_0xf86e('0x6c')][_0x49379e][_0xf86e('0x6d')],'path':path[_0xf86e('0x6e')](config[_0xf86e('0x6f')],_0xf86e('0x70'),_0x10a6ee[_0xf86e('0x59')][_0xf86e('0x6c')][_0x49379e]['basename'])};}}return{'account':_0x3cf4f4,'message':_0x10a6ee[_0xf86e('0x59')]};}})[_0xf86e('0x37')](function(_0x4fc7b1){if(_0x4fc7b1){return respondWithRpcPromise(_0xf86e('0x71'),_0xf86e('0x72'),_0x4fc7b1,client9003)['then'](function(_0x511829){return _0x193db3[_0xf86e('0x58')]({'read':!![],'messageId':_0x511829[_0xf86e('0x73')],'sentAt':moment()[_0xf86e('0x74')](_0xf86e('0x75'))});})['catch'](function(_0x1af11c){logger[_0xf86e('0x28')]('%s',JSON[_0xf86e('0x27')](_0x1af11c));return _0x193db3;});}return _0x193db3;});}return _0x193db3;}})[_0xf86e('0x37')](respondWithResult(_0x5a4ec2,0xc9))['catch'](handleError(_0x5a4ec2,null));};var interaction_log=require('../../config/logger')(_0xf86e('0x76'));exports[_0xf86e('0x77')]=function(_0x160921,_0x4e5528,_0x166da9){var _0x508cfb={'channel':_0xf86e('0x78')};if(_0x160921[_0xf86e('0x59')]['id']){delete _0x160921[_0xf86e('0x59')]['id'];}_0x160921[_0xf86e('0x59')][_0xf86e('0x79')]=!![];_0x160921[_0xf86e('0x59')][_0xf86e('0x7a')]=moment()[_0xf86e('0x74')](_0xf86e('0x75'));_0x160921[_0xf86e('0x59')][_0xf86e('0x7b')]=_0x160921['body']['UserId']||_0x160921[_0xf86e('0x7c')]['id'];return db[_0xf86e('0x3b')][_0xf86e('0x57')]({'where':{'id':_0x160921[_0xf86e('0x53')]['id'],'UserId':null},'include':[{'model':db[_0xf86e('0x7d')],'as':_0xf86e('0x7e')}]})['then'](handleEntityNotFound(_0x4e5528,null))[_0xf86e('0x37')](saveUpdates(_0x160921[_0xf86e('0x59')],null))[_0xf86e('0x37')](function(_0x2a5e74){if(_0x2a5e74){_0x508cfb[_0xf86e('0x2a')]=_0x2a5e74[_0xf86e('0x7f')]({'plain':!![]});return db[_0xf86e('0x80')][_0xf86e('0x57')]({'where':{'id':_0x2a5e74[_0xf86e('0x81')]}});}return null;})[_0xf86e('0x37')](handleEntityNotFound(_0x4e5528,null))[_0xf86e('0x37')](function(_0x547f47){if(_0x547f47){return _0x547f47['update']({'UserId':_0x160921['body'][_0xf86e('0x7b')],'read1stAt':_[_0xf86e('0x65')](_0x547f47[_0xf86e('0x82')])?moment()[_0xf86e('0x74')](_0xf86e('0x75')):undefined});}return null;})[_0xf86e('0x37')](function(_0x437d49){if(_0x437d49){_0x508cfb['interaction']=_0x437d49[_0xf86e('0x7f')]({'plain':!![]});interaction_log['info'](_0xf86e('0x83'),_0x160921[_0xf86e('0x7c')]['id'],_0x160921[_0xf86e('0x7c')][_0xf86e('0x6d')],_0x160921[_0xf86e('0x7c')][_0xf86e('0x84')],_0x508cfb[_0xf86e('0x85')]['id'],_0x160921[_0xf86e('0x59')]?JSON['stringify'](_0x160921[_0xf86e('0x59')]):_0xf86e('0x86'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x508cfb);}return null;})[_0xf86e('0x37')](function(_0x291ca9){if(_0x291ca9){if(_0x160921[_0xf86e('0x59')][_0xf86e('0x87')]){_0x508cfb[_0xf86e('0x2a')][_0xf86e('0x88')]=util[_0xf86e('0x74')](_0xf86e('0x89'),_0x160921[_0xf86e('0x7c')][_0xf86e('0x6d')]);_0x508cfb['message'][_0xf86e('0x8a')]=_0x508cfb[_0xf86e('0x8a')];_0x508cfb[_0xf86e('0x2a')][_0xf86e('0x8b')]=_0xf86e('0x77');return respondWithRpcPromise(_0xf86e('0x8c'),_0xf86e('0x8c'),{'event':'acceptmessage','message':_0x508cfb[_0xf86e('0x2a')]},client9002)['then'](function(){return _0x508cfb;});}return _0x508cfb;}return null;})[_0xf86e('0x37')](respondWithResult(_0x4e5528,null))[_0xf86e('0x2c')](handleError(_0x4e5528,null));};var interaction_log=require(_0xf86e('0x8d'))('mail-interactions');exports[_0xf86e('0x35')]=function(_0x20ac41,_0xd5c520,_0x2fd291){var _0x2abee4={'agent':{},'channel':_0xf86e('0x78')};if(_0x20ac41[_0xf86e('0x59')]['id']){delete _0x20ac41['body']['id'];}_0x20ac41[_0xf86e('0x59')][_0xf86e('0x7b')]=_0x20ac41[_0xf86e('0x59')]['UserId']||_0x20ac41['user']['id'];_0x2abee4[_0xf86e('0x8e')]['id']=_0x20ac41['body'][_0xf86e('0x7b')];return db['MailMessage'][_0xf86e('0x57')]({'where':{'id':_0x20ac41['params']['id'],'UserId':null}})[_0xf86e('0x37')](handleEntityNotFound(_0xd5c520,null))[_0xf86e('0x37')](function(_0x3e51c5){if(_0x3e51c5){_0x2abee4[_0xf86e('0x2a')]=_0x3e51c5[_0xf86e('0x7f')]({'plain':!![]});return db[_0xf86e('0x80')][_0xf86e('0x57')]({'where':{'id':_0x3e51c5[_0xf86e('0x81')]}});}return null;})['then'](handleEntityNotFound(_0xd5c520,null))[_0xf86e('0x37')](function(_0x14c1ce){if(_0x14c1ce){_0x2abee4[_0xf86e('0x85')]=_0x14c1ce[_0xf86e('0x7f')]({'plain':!![]});interaction_log['info'](_0xf86e('0x8f'),_0x20ac41[_0xf86e('0x7c')]['id'],_0x20ac41[_0xf86e('0x7c')][_0xf86e('0x6d')],_0x20ac41[_0xf86e('0x7c')][_0xf86e('0x84')],_0x2abee4[_0xf86e('0x85')]['id'],_0x20ac41[_0xf86e('0x59')]?JSON['stringify'](_0x20ac41[_0xf86e('0x59')]):_0xf86e('0x86'));return respondWithRpcPromise('RejectMessage',_0xf86e('0x90'),_0x2abee4);}return null;})[_0xf86e('0x37')](function(_0x3e64ee){if(_0x3e64ee){_0x3e64ee[_0xf86e('0x2a')]['interface']=util[_0xf86e('0x74')](_0xf86e('0x89'),_0x20ac41[_0xf86e('0x7c')]['name']);_0x3e64ee['message'][_0xf86e('0x8a')]=_0x2abee4[_0xf86e('0x8a')];_0x3e64ee[_0xf86e('0x2a')][_0xf86e('0x8b')]=_0xf86e('0x35');respondWithRpcPromise(_0xf86e('0x8c'),_0xf86e('0x8c'),{'event':_0xf86e('0x91'),'message':_0x3e64ee[_0xf86e('0x2a')]},client9002);return _0x2abee4;}return null;})[_0xf86e('0x37')](respondWithResult(_0xd5c520,null))[_0xf86e('0x2c')](handleError(_0xd5c520,null));};exports[_0xf86e('0x92')]=function(_0x585e98,_0x3e1141){var _0xdec66a=moment()[_0xf86e('0x93')]()[_0xf86e('0x94')]();var _0x18ad3b=path['join'](config['root'],'server',_0xf86e('0x95'),_0xf86e('0x96'));var _0x15b62e=path[_0xf86e('0x6e')](config['root'],_0xf86e('0x97'),_0xf86e('0x95'),_0xf86e('0x6c'));var _0x244fe8=util[_0xf86e('0x74')](_0xf86e('0x98'),_0xdec66a);return db[_0xf86e('0x3b')]['find']({'where':{'id':_0x585e98[_0xf86e('0x53')]['id']},'attributes':['id',_0xf86e('0x59'),'from','to','cc',_0xf86e('0x99'),_0xf86e('0x9a'),_0xf86e('0x9b')],'include':_0x585e98[_0xf86e('0x3e')][_0xf86e('0x6c')]?[{'model':db[_0xf86e('0x9c')],'as':_0xf86e('0x9d')}]:undefined})[_0xf86e('0x37')](handleEntityNotFound(_0x3e1141,null))[_0xf86e('0x37')](function(_0x8f58b2){if(_0x8f58b2){var _0x35e4ba=_0x8f58b2;var _0x3f2f2b={'from':_0x35e4ba['from'],'to':_0x35e4ba['to'],'subject':_0x35e4ba[_0xf86e('0x9a')],'html':_0x35e4ba['body'],'headers':{'Date':moment(_0x35e4ba[_0xf86e('0x9b')])['format'](_0xf86e('0x9e'))},'attachments':[]};if(_0x8f58b2['cc']){_0x3f2f2b[_0xf86e('0x9f')]['Cc']=_0x8f58b2['cc'];}if(_0x8f58b2[_0xf86e('0x99')]){_0x3f2f2b[_0xf86e('0x9f')][_0xf86e('0xa0')]=_0x8f58b2['bcc'];}return new BPromise(function(_0xb7f16a,_0x2492bf){if(_0x8f58b2[_0xf86e('0x9d')]){for(var _0x22c02b=0x0;_0x22c02b<_0x8f58b2[_0xf86e('0x9d')]['length'];_0x22c02b++){var _0x18813b=_0x8f58b2['Attachments'][_0x22c02b];var _0x43a738=path[_0xf86e('0x6e')](_0x15b62e,_0x18813b[_0xf86e('0xa1')]);if(fs['existsSync'](_0x43a738)){_0x3f2f2b['attachments'][_0xf86e('0xa2')]({'name':_0x18813b[_0xf86e('0x6d')],'contentType':_0x18813b[_0xf86e('0x4b')],'data':fs[_0xf86e('0xa3')](_0x43a738)});}}}emlformat[_0xf86e('0xa4')](_0x3f2f2b,function(_0x42144b,_0x141bee){if(_0x42144b)return _0x2492bf(_0x42144b);fs['writeFileSync'](path[_0xf86e('0x6e')](_0x18ad3b,_0x244fe8),_0x141bee);return _0xb7f16a(_0x141bee);});});}})[_0xf86e('0x37')](function(_0x30eb39){if(_0x30eb39){return _0x3e1141['download'](path['join'](_0x18ad3b,_0x244fe8),_0x244fe8,function(_0x431348){if(_0x431348){console[_0xf86e('0xa5')]('err',_0x431348);}else{fs[_0xf86e('0xa6')](path[_0xf86e('0x6e')](_0x18ad3b,_0x244fe8));}});}})['catch'](handleError(_0x3e1141,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 3a2461d..314bec3 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 _0x316d=['hasOwnProperty','hook','events','../../mysqldb','MailMessage','setMaxListeners','save','update','emit'];(function(_0xa401d8,_0x3c6ca7){var _0x4f46b0=function(_0x35bf68){while(--_0x35bf68){_0xa401d8['push'](_0xa401d8['shift']());}};_0x4f46b0(++_0x3c6ca7);}(_0x316d,0xbf));var _0xd316=function(_0x4694b7,_0x34c400){_0x4694b7=_0x4694b7-0x0;var _0x45b1a1=_0x316d[_0x4694b7];return _0x45b1a1;};'use strict';var EventEmitter=require(_0xd316('0x0'));var MailMessage=require(_0xd316('0x1'))['db'][_0xd316('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xd316('0x3')](0x0);var events={'afterCreate':_0xd316('0x4'),'afterUpdate':_0xd316('0x5'),'afterDestroy':'remove'};function emitEvent(_0x302919){return function(_0x5b63fd,_0x3d1ff0,_0x1fb4e9){MailMessageEvents[_0xd316('0x6')](_0x302919+':'+_0x5b63fd['id'],_0x5b63fd);MailMessageEvents[_0xd316('0x6')](_0x302919,_0x5b63fd);_0x1fb4e9(null);};}for(var e in events){if(events[_0xd316('0x7')](e)){var event=events[e];MailMessage[_0xd316('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0xacee=['setMaxListeners','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xacee,0x15d));var _0xeace=function(_0x178524,_0x3c435e){_0x178524=_0x178524-0x0;var _0xbc868=_0xacee[_0x178524];return _0xbc868;};'use strict';var EventEmitter=require(_0xeace('0x0'));var MailMessage=require(_0xeace('0x1'))['db'][_0xeace('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xeace('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x17b318){return function(_0x321d88,_0x3641ae,_0x40c02b){MailMessageEvents[_0xeace('0x4')](_0x17b318+':'+_0x321d88['id'],_0x321d88);MailMessageEvents[_0xeace('0x4')](_0x17b318,_0x321d88);_0x40c02b(null);};}for(var e in events){if(events[_0xeace('0x5')](e)){var event=events[e];MailMessage[_0xeace('0x6')](e,emitEvent(event));}}module[_0xeace('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 5115e24..a32d0ec 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 _0xf0f0=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','update','catch','error','utf8mb4'];(function(_0x18d1d0,_0x37068c){var _0x5a2551=function(_0x225853){while(--_0x225853){_0x18d1d0['push'](_0x18d1d0['shift']());}};_0x5a2551(++_0x37068c);}(_0xf0f0,0xb5));var _0x0f0f=function(_0x2e56f4,_0x5cfaa9){_0x2e56f4=_0x2e56f4-0x0;var _0x37bb52=_0xf0f0[_0x2e56f4];return _0x37bb52;};'use strict';var _=require(_0x0f0f('0x0'));var util=require(_0x0f0f('0x1'));var logger=require(_0x0f0f('0x2'))(_0x0f0f('0x3'));var moment=require('moment');var BPromise=require(_0x0f0f('0x4'));var rp=require(_0x0f0f('0x5'));var htmlToText=require(_0x0f0f('0x6'));var fs=require('fs');var path=require(_0x0f0f('0x7'));var rimraf=require(_0x0f0f('0x8'));var config=require(_0x0f0f('0x9'));var attributes=require('./mailMessage.attributes');module[_0x0f0f('0xa')]=function(_0x17b344,_0x23ac50){return _0x17b344[_0x0f0f('0xb')](_0x0f0f('0xc'),attributes,{'tableName':_0x0f0f('0xd'),'paranoid':![],'indexes':[{'name':_0x0f0f('0xe'),'fields':[_0x0f0f('0xe')]},{'name':_0x0f0f('0xf'),'fields':[_0x0f0f('0x10'),'subject'],'type':_0x0f0f('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5a61c3,_0x2af357,_0x4b15f4){if(_0x5a61c3[_0x0f0f('0x12')]){_0x5a61c3[_0x0f0f('0x10')]=htmlToText[_0x0f0f('0x13')](_0x5a61c3[_0x0f0f('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4b15f4(null,_0x2af357);},'afterCreate':function(_0x5b2ac8,_0x27727b,_0x246994){var _0x16be09=_0x17b344[_0x0f0f('0x14')];var _0x7afd83=_0x5b2ac8[_0x0f0f('0x15')]({'plain':!![]});if(_0x7afd83[_0x0f0f('0x16')][_0x0f0f('0x17')]()==='in'||_0x7afd83[_0x0f0f('0x16')]['toLowerCase']()===_0x0f0f('0x18')&&!_0x7afd83[_0x0f0f('0x19')]&&!_[_0x0f0f('0x1a')](_0x7afd83[_0x0f0f('0x1b')])){_0x16be09[_0x0f0f('0x1c')][_0x0f0f('0x1d')]({'where':{'id':_0x7afd83[_0x0f0f('0x1e')]}})['then'](function(_0xda723d){if(_0xda723d){_0xda723d[_0x0f0f('0x1f')]({'lastMsgAt':_0x7afd83['createdAt'],'lastMsgDirection':_0x7afd83[_0x0f0f('0x16')][_0x0f0f('0x17')](),'lastMsgBody':_0x7afd83[_0x0f0f('0x12')]});}})[_0x0f0f('0x20')](function(_0x5dc451){console[_0x0f0f('0x21')](_0x5dc451);});}_0x246994();}},'charset':_0x0f0f('0x22'),'collate':_0x0f0f('0x23')});}; \ No newline at end of file +var _0xeea9=['out','isNil','UserId','MailInteraction','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash','util','api','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase'];(function(_0x859305,_0x411ccd){var _0x161f59=function(_0x58d3b0){while(--_0x58d3b0){_0x859305['push'](_0x859305['shift']());}};_0x161f59(++_0x411ccd);}(_0xeea9,0x146));var _0x9eea=function(_0x11807a,_0xb04cc2){_0x11807a=_0x11807a-0x0;var _0x347921=_0xeea9[_0x11807a];return _0x347921;};'use strict';var _=require(_0x9eea('0x0'));var util=require(_0x9eea('0x1'));var logger=require('../../config/logger')(_0x9eea('0x2'));var moment=require('moment');var BPromise=require(_0x9eea('0x3'));var rp=require(_0x9eea('0x4'));var htmlToText=require(_0x9eea('0x5'));var fs=require('fs');var path=require(_0x9eea('0x6'));var rimraf=require(_0x9eea('0x7'));var config=require(_0x9eea('0x8'));var attributes=require(_0x9eea('0x9'));module[_0x9eea('0xa')]=function(_0x3db274,_0x1acabe){return _0x3db274[_0x9eea('0xb')](_0x9eea('0xc'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x9eea('0xd'),'fields':[_0x9eea('0xd')]},{'name':_0x9eea('0xe'),'fields':[_0x9eea('0xf'),_0x9eea('0x10')],'type':_0x9eea('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x21c9ae,_0x20cf24,_0x130b10){if(_0x21c9ae[_0x9eea('0x12')]){_0x21c9ae[_0x9eea('0xf')]=htmlToText[_0x9eea('0x13')](_0x21c9ae[_0x9eea('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x130b10(null,_0x20cf24);},'afterCreate':function(_0x23b6c7,_0x454eef,_0x3d28c1){var _0x2b8206=_0x3db274[_0x9eea('0x14')];var _0x15c128=_0x23b6c7[_0x9eea('0x15')]({'plain':!![]});if(_0x15c128[_0x9eea('0x16')][_0x9eea('0x17')]()==='in'||_0x15c128[_0x9eea('0x16')][_0x9eea('0x17')]()===_0x9eea('0x18')&&!_0x15c128['secret']&&!_[_0x9eea('0x19')](_0x15c128[_0x9eea('0x1a')])){_0x2b8206[_0x9eea('0x1b')]['findOne']({'where':{'id':_0x15c128[_0x9eea('0x1c')]}})[_0x9eea('0x1d')](function(_0x41e007){if(_0x41e007){_0x41e007[_0x9eea('0x1e')]({'lastMsgAt':_0x15c128[_0x9eea('0x1f')],'lastMsgDirection':_0x15c128[_0x9eea('0x16')][_0x9eea('0x17')](),'lastMsgBody':_0x15c128['body']});}})[_0x9eea('0x20')](function(_0x2ca084){console[_0x9eea('0x21')](_0x2ca084);});}_0x3d28c1();}},'charset':_0x9eea('0x22'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 1e3c0da..52a08bc 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 _0x383d=['stringify','error','message','result','catch','CreateMailMessage','MailMessage','body','options','raw','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x46d93f,_0x5c3c2f){var _0x253751=function(_0xc9afd7){while(--_0xc9afd7){_0x46d93f['push'](_0x46d93f['shift']());}};_0x253751(++_0x5c3c2f);}(_0x383d,0x86));var _0xd383=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x383d[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd383('0x0'));var BPromise=require(_0xd383('0x1'));var rs=require(_0xd383('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd383('0x3'))['db'];var utils=require(_0xd383('0x4'));var logger=require(_0xd383('0x5'))(_0xd383('0x6'));var config=require(_0xd383('0x7'));var jayson=require(_0xd383('0x8'));var client=jayson['client'][_0xd383('0x9')]({'port':0x232a});config[_0xd383('0xa')]=_[_0xd383('0xb')](config[_0xd383('0xa')],{'host':_0xd383('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd383('0xd'))[_0xd383('0xe')](socket);function respondWithRpcPromise(_0x59baad,_0x2abc3a,_0x64b0eb){return new BPromise(function(_0x12547b,_0x21cd31){return client[_0xd383('0xf')](_0x59baad,_0x64b0eb)[_0xd383('0x10')](function(_0x51096d){logger[_0xd383('0x11')](_0xd383('0x12'),_0x2abc3a,_0xd383('0x13'));logger[_0xd383('0x14')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x2abc3a,_0xd383('0x13'),JSON[_0xd383('0x15')](_0x51096d));if(_0x51096d[_0xd383('0x16')]){if(_0x51096d[_0xd383('0x16')]['code']===0x1f4){logger[_0xd383('0x16')]('MailMessage,\x20%s,\x20%s',_0x2abc3a,_0x51096d[_0xd383('0x16')][_0xd383('0x17')]);return _0x21cd31(_0x51096d[_0xd383('0x16')][_0xd383('0x17')]);}logger[_0xd383('0x16')](_0xd383('0x12'),_0x2abc3a,_0x51096d['error']['message']);return _0x12547b(_0x51096d[_0xd383('0x16')][_0xd383('0x17')]);}else{logger[_0xd383('0x11')](_0xd383('0x12'),_0x2abc3a,_0xd383('0x13'));_0x12547b(_0x51096d[_0xd383('0x18')][_0xd383('0x17')]);}})[_0xd383('0x19')](function(_0x59e8d1){logger[_0xd383('0x16')](_0xd383('0x12'),_0x2abc3a,_0x59e8d1);_0x21cd31(_0x59e8d1);});});}exports[_0xd383('0x1a')]=function(_0x17f140){var _0x213f72=this;return new Promise(function(_0x3618d9,_0x49799e){return db[_0xd383('0x1b')]['create'](_0x17f140[_0xd383('0x1c')],{'raw':_0x17f140['options']?_0x17f140[_0xd383('0x1d')][_0xd383('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x10c054){logger[_0xd383('0x11')](_0xd383('0x1a'),_0x17f140);logger['debug']('CreateMailMessage',_0x17f140,JSON[_0xd383('0x15')](_0x10c054));_0x3618d9(_0x10c054);})['catch'](function(_0x58bf08){logger[_0xd383('0x16')]('CreateMailMessage',_0x58bf08[_0xd383('0x17')],_0x17f140);_0x49799e(_0x213f72['error'](0x1f4,_0x58bf08['message']));});});}; \ No newline at end of file +var _0x9589=['request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','MailMessage','create','options','raw','CreateMailMessage','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s'];(function(_0xa339a9,_0x342371){var _0x125a36=function(_0x5d8c68){while(--_0x5d8c68){_0xa339a9['push'](_0xa339a9['shift']());}};_0x125a36(++_0x342371);}(_0x9589,0xbc));var _0x9958=function(_0x10051d,_0xb7a622){_0x10051d=_0x10051d-0x0;var _0x5f45c4=_0x9589[_0x10051d];return _0x5f45c4;};'use strict';var _=require(_0x9958('0x0'));var util=require(_0x9958('0x1'));var moment=require(_0x9958('0x2'));var BPromise=require(_0x9958('0x3'));var rs=require(_0x9958('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9958('0x5'))['db'];var utils=require(_0x9958('0x6'));var logger=require(_0x9958('0x7'))('rpc');var config=require(_0x9958('0x8'));var jayson=require(_0x9958('0x9'));var client=jayson[_0x9958('0xa')][_0x9958('0xb')]({'port':0x232a});config[_0x9958('0xc')]=_[_0x9958('0xd')](config['redis'],{'host':_0x9958('0xe'),'port':0x18eb});var socket=require(_0x9958('0xf'))(new Redis(config[_0x9958('0xc')]));require(_0x9958('0x10'))[_0x9958('0x11')](socket);function respondWithRpcPromise(_0x185b6b,_0x1e2647,_0x1e5c25){return new BPromise(function(_0x3369b3,_0x68907){return client[_0x9958('0x12')](_0x185b6b,_0x1e5c25)[_0x9958('0x13')](function(_0x242f1b){logger[_0x9958('0x14')](_0x9958('0x15'),_0x1e2647,_0x9958('0x16'));logger[_0x9958('0x17')](_0x9958('0x18'),_0x1e2647,'request\x20sent',JSON[_0x9958('0x19')](_0x242f1b));if(_0x242f1b['error']){if(_0x242f1b[_0x9958('0x1a')]['code']===0x1f4){logger[_0x9958('0x1a')](_0x9958('0x15'),_0x1e2647,_0x242f1b[_0x9958('0x1a')][_0x9958('0x1b')]);return _0x68907(_0x242f1b['error'][_0x9958('0x1b')]);}logger[_0x9958('0x1a')]('MailMessage,\x20%s,\x20%s',_0x1e2647,_0x242f1b['error'][_0x9958('0x1b')]);return _0x3369b3(_0x242f1b['error'][_0x9958('0x1b')]);}else{logger[_0x9958('0x14')](_0x9958('0x15'),_0x1e2647,_0x9958('0x16'));_0x3369b3(_0x242f1b[_0x9958('0x1c')][_0x9958('0x1b')]);}})['catch'](function(_0x54a10d){logger[_0x9958('0x1a')]('MailMessage,\x20%s,\x20%s',_0x1e2647,_0x54a10d);_0x68907(_0x54a10d);});});}exports['CreateMailMessage']=function(_0x2bcce1){var _0x5b8879=this;return new Promise(function(_0x5743d6,_0x4278da){return db[_0x9958('0x1d')][_0x9958('0x1e')](_0x2bcce1['body'],{'raw':_0x2bcce1[_0x9958('0x1f')]?_0x2bcce1[_0x9958('0x1f')][_0x9958('0x20')]===undefined?!![]:![]:!![]})[_0x9958('0x13')](function(_0x65d7e1){logger[_0x9958('0x14')](_0x9958('0x21'),_0x2bcce1);logger[_0x9958('0x17')](_0x9958('0x21'),_0x2bcce1,JSON[_0x9958('0x19')](_0x65d7e1));_0x5743d6(_0x65d7e1);})[_0x9958('0x22')](function(_0x20085d){logger[_0x9958('0x1a')]('CreateMailMessage',_0x20085d[_0x9958('0x1b')],_0x2bcce1);_0x4278da(_0x5b8879[_0x9958('0x1a')](0x1f4,_0x20085d[_0x9958('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 50b0f44..c7515b3 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 _0x2e20=['update','emit','removeListener','register','length','mailMessage:','./mailMessage.events','save'];(function(_0x527bdd,_0x2e6839){var _0x316d78=function(_0x2bb3fa){while(--_0x2bb3fa){_0x527bdd['push'](_0x527bdd['shift']());}};_0x316d78(++_0x2e6839);}(_0x2e20,0x1b6));var _0x02e2=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x2e20[_0x1ac595];return _0x455fff;};'use strict';var MailMessageEvents=require(_0x02e2('0x0'));var events=[_0x02e2('0x1'),'remove',_0x02e2('0x2')];function createListener(_0x3f86e1,_0x3bc410){return function(_0x1169ec){_0x3bc410[_0x02e2('0x3')](_0x3f86e1,_0x1169ec);};}function removeListener(_0x351827,_0x1c142c){return function(){MailMessageEvents[_0x02e2('0x4')](_0x351827,_0x1c142c);};}exports[_0x02e2('0x5')]=function(_0x485a2b){for(var _0x368c73=0x0,_0x3774d6=events[_0x02e2('0x6')];_0x368c73<_0x3774d6;_0x368c73++){var _0x165402=events[_0x368c73];var _0x1fd516=createListener(_0x02e2('0x7')+_0x165402,_0x485a2b);MailMessageEvents['on'](_0x165402,_0x1fd516);}}; \ No newline at end of file +var _0x5e64=['emit','removeListener','register','length','save','remove'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5e64,0x6a));var _0x45e6=function(_0x1e4b1c,_0x500e3a){_0x1e4b1c=_0x1e4b1c-0x0;var _0x400741=_0x5e64[_0x1e4b1c];return _0x400741;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x45e6('0x0'),_0x45e6('0x1'),'update'];function createListener(_0x4c6caf,_0x154a0b){return function(_0x1eb1c6){_0x154a0b[_0x45e6('0x2')](_0x4c6caf,_0x1eb1c6);};}function removeListener(_0x28e2de,_0x50780f){return function(){MailMessageEvents[_0x45e6('0x3')](_0x28e2de,_0x50780f);};}exports[_0x45e6('0x4')]=function(_0x1bdd17){for(var _0x216063=0x0,_0x521e52=events[_0x45e6('0x5')];_0x216063<_0x521e52;_0x216063++){var _0x1a560f=events[_0x216063];var _0x5906b5=createListener('mailMessage:'+_0x1a560f,_0x1bdd17);MailMessageEvents['on'](_0x1a560f,_0x5906b5);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 023615e..3f9fd1f 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 _0x4099=['removeAgents','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','isAuthenticated','index','get','/describe','describe','/:id/members','getMembers','getTeams','create','post','/:id/teams','/:id/users','put','/:id','update','delete','destroy','removeTeams'];(function(_0x28496e,_0x401ba1){var _0x16260c=function(_0x56c12c){while(--_0x56c12c){_0x28496e['push'](_0x28496e['shift']());}};_0x16260c(++_0x401ba1);}(_0x4099,0xda));var _0x9409=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0x4099[_0x5e6ea3];return _0x4048b5;};'use strict';var multer=require(_0x9409('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9409('0x1'));var router=express[_0x9409('0x2')]();var auth=require(_0x9409('0x3'));var interaction=require(_0x9409('0x4'));var config=require(_0x9409('0x5'));var controller=require(_0x9409('0x6'));router['get']('/',auth[_0x9409('0x7')](),controller[_0x9409('0x8')]);router[_0x9409('0x9')](_0x9409('0xa'),auth[_0x9409('0x7')](),controller[_0x9409('0xb')]);router[_0x9409('0x9')]('/:id',auth[_0x9409('0x7')](),controller['show']);router[_0x9409('0x9')](_0x9409('0xc'),auth[_0x9409('0x7')](),controller[_0x9409('0xd')]);router[_0x9409('0x9')]('/:id/teams',auth['isAuthenticated'](),controller[_0x9409('0xe')]);router[_0x9409('0x9')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x9409('0x7')](),controller[_0x9409('0xf')]);router[_0x9409('0x10')](_0x9409('0x11'),auth[_0x9409('0x7')](),controller['addTeams']);router[_0x9409('0x10')](_0x9409('0x12'),auth['isAuthenticated'](),controller['addAgents']);router[_0x9409('0x13')](_0x9409('0x14'),auth[_0x9409('0x7')](),controller[_0x9409('0x15')]);router[_0x9409('0x16')](_0x9409('0x14'),auth[_0x9409('0x7')](),controller[_0x9409('0x17')]);router[_0x9409('0x16')](_0x9409('0x11'),auth[_0x9409('0x7')](),controller[_0x9409('0x18')]);router[_0x9409('0x16')](_0x9409('0x12'),auth[_0x9409('0x7')](),controller[_0x9409('0x19')]);module[_0x9409('0x1a')]=router; \ No newline at end of file +var _0xb498=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','post','/:id/teams','addAgents','put'];(function(_0x104b35,_0x13f218){var _0x55584d=function(_0x2bbb71){while(--_0x2bbb71){_0x104b35['push'](_0x104b35['shift']());}};_0x55584d(++_0x13f218);}(_0xb498,0x162));var _0x8b49=function(_0x3d21cb,_0x210ced){_0x3d21cb=_0x3d21cb-0x0;var _0x1183fa=_0xb498[_0x3d21cb];return _0x1183fa;};'use strict';var multer=require(_0x8b49('0x0'));var util=require(_0x8b49('0x1'));var path=require('path');var timeout=require(_0x8b49('0x2'));var express=require(_0x8b49('0x3'));var router=express[_0x8b49('0x4')]();var auth=require(_0x8b49('0x5'));var interaction=require(_0x8b49('0x6'));var config=require(_0x8b49('0x7'));var controller=require(_0x8b49('0x8'));router[_0x8b49('0x9')]('/',auth[_0x8b49('0xa')](),controller['index']);router[_0x8b49('0x9')](_0x8b49('0xb'),auth['isAuthenticated'](),controller[_0x8b49('0xc')]);router['get'](_0x8b49('0xd'),auth['isAuthenticated'](),controller[_0x8b49('0xe')]);router[_0x8b49('0x9')](_0x8b49('0xf'),auth['isAuthenticated'](),controller[_0x8b49('0x10')]);router[_0x8b49('0x9')]('/:id/teams',auth[_0x8b49('0xa')](),controller[_0x8b49('0x11')]);router['get'](_0x8b49('0x12'),auth[_0x8b49('0xa')](),controller['getAgents']);router[_0x8b49('0x13')]('/',auth[_0x8b49('0xa')](),controller['create']);router['post'](_0x8b49('0x14'),auth[_0x8b49('0xa')](),controller['addTeams']);router[_0x8b49('0x13')](_0x8b49('0x12'),auth[_0x8b49('0xa')](),controller[_0x8b49('0x15')]);router[_0x8b49('0x16')](_0x8b49('0xd'),auth[_0x8b49('0xa')](),controller[_0x8b49('0x17')]);router[_0x8b49('0x18')](_0x8b49('0xd'),auth['isAuthenticated'](),controller[_0x8b49('0x19')]);router[_0x8b49('0x18')](_0x8b49('0x14'),auth[_0x8b49('0xa')](),controller[_0x8b49('0x1a')]);router[_0x8b49('0x18')](_0x8b49('0x12'),auth[_0x8b49('0xa')](),controller[_0x8b49('0x1b')]);module[_0x8b49('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 89df974..23381f5 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 _0x2bca=['sequelize','exports','STRING','ENUM','beepall'];(function(_0x4187fb,_0x40da24){var _0x463ec7=function(_0x3cc531){while(--_0x3cc531){_0x4187fb['push'](_0x4187fb['shift']());}};_0x463ec7(++_0x40da24);}(_0x2bca,0x177));var _0xa2bc=function(_0x21e759,_0x5d3650){_0x21e759=_0x21e759-0x0;var _0x55191e=_0x2bca[_0x21e759];return _0x55191e;};'use strict';var Sequelize=require(_0xa2bc('0x0'));module[_0xa2bc('0x1')]={'name':{'type':Sequelize[_0xa2bc('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa2bc('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa2bc('0x3')]('rrmemory',_0xa2bc('0x4'),'roundrobin')}}; \ No newline at end of file +var _0x1624=['INTEGER','ENUM','rrmemory','beepall','sequelize','exports'];(function(_0x227745,_0x171942){var _0x4c4a55=function(_0x361c82){while(--_0x361c82){_0x227745['push'](_0x227745['shift']());}};_0x4c4a55(++_0x171942);}(_0x1624,0xee));var _0x4162=function(_0x3a7a4e,_0x2cfe3c){_0x3a7a4e=_0x3a7a4e-0x0;var _0x4c6c04=_0x1624[_0x3a7a4e];return _0x4c6c04;};'use strict';var Sequelize=require(_0x4162('0x0'));module[_0x4162('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x4162('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4162('0x3')](_0x4162('0x4'),_0x4162('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 666b5ce..d87a482 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 _0x481f=['map','type','key','VIRTUAL','field','options','MailQueue','includeAll','include','findAll','catch','params','find','create','body','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','rawAttributes','order','filter','UserId','agent','mailPause','updatedAt','rows','format','%s/%s','Team','getTeams','nolimit','addTeams','teams','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','forEach','emit','userMailQueue:save','removeTeams','ids','User','select','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','union','isEmpty','removeAgents','addAgents','omit','spread','isArray','userMailQueue:remove','getAgents','html-pdf','eml-format','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/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','end','status','json','count','offset','limit','set','apply','save','then','destroy','get','MailQueues','UserProfileResource','error','name','send','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','merge'];(function(_0x1fa07e,_0x3efd05){var _0xbb22df=function(_0x338609){while(--_0x338609){_0x1fa07e['push'](_0x1fa07e['shift']());}};_0xbb22df(++_0x3efd05);}(_0x481f,0x1ea));var _0xf481=function(_0x1570ec,_0x21c9cc){_0x1570ec=_0x1570ec-0x0;var _0x549b24=_0x481f[_0x1570ec];return _0x549b24;};'use strict';var pdf=require(_0xf481('0x0'));var emlformat=require(_0xf481('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf481('0x2'));var jsonpatch=require(_0xf481('0x3'));var rp=require(_0xf481('0x4'));var moment=require(_0xf481('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf481('0x6'));var util=require(_0xf481('0x7'));var path=require(_0xf481('0x8'));var sox=require(_0xf481('0x9'));var csv=require(_0xf481('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf481('0xb'));var squel=require(_0xf481('0xc'));var crypto=require(_0xf481('0xd'));var jsforce=require(_0xf481('0xe'));var deskjs=require(_0xf481('0xf'));var toCsv=require(_0xf481('0xa'));var querystring=require(_0xf481('0x10'));var Papa=require(_0xf481('0x11'));var Redis=require(_0xf481('0x12'));var authService=require(_0xf481('0x13'));var qs=require(_0xf481('0x14'));var hardwareService=require(_0xf481('0x15'));var logger=require(_0xf481('0x16'))(_0xf481('0x17'));var utils=require(_0xf481('0x18'));var config=require(_0xf481('0x19'));var db=require(_0xf481('0x1a'))['db'];config['redis']=_[_0xf481('0x1b')](config[_0xf481('0x1c')],{'host':_0xf481('0x1d'),'port':0x18eb});var socket=require(_0xf481('0x1e'))(new Redis(config['redis']));require('./mailQueue.socket')[_0xf481('0x1f')](socket);function respondWithStatusCode(_0x316fe3,_0x470498){_0x470498=_0x470498||0xcc;return function(_0x106bd3){if(_0x106bd3){return _0x316fe3['sendStatus'](_0x470498);}return _0x316fe3['status'](_0x470498)[_0xf481('0x20')]();};}function respondWithResult(_0x2ceafd,_0x5c2ea6){_0x5c2ea6=_0x5c2ea6||0xc8;return function(_0x1ec062){if(_0x1ec062){return _0x2ceafd[_0xf481('0x21')](_0x5c2ea6)[_0xf481('0x22')](_0x1ec062);}};}function respondWithFilteredResult(_0x4032fd,_0x4e6e0d){return function(_0x59ef1b){if(_0x59ef1b){var _0x5e7f74=_0x59ef1b[_0xf481('0x23')],_0x55e0f2=_0x4e6e0d[_0xf481('0x24')],_0x51064a=_0x4e6e0d[_0xf481('0x24')]+_0x4e6e0d[_0xf481('0x25')],_0xb63183;if(_0x51064a>=_0x5e7f74){_0x51064a=_0x5e7f74;_0xb63183=0xc8;}else{_0xb63183=0xce;}_0x4032fd[_0xf481('0x21')](_0xb63183);return _0x4032fd[_0xf481('0x26')]('Content-Range',_0x55e0f2+'-'+_0x51064a+'/'+_0x5e7f74)[_0xf481('0x22')](_0x59ef1b);}return null;};}function patchUpdates(_0x4d4a22){return function(_0x259651){try{jsonpatch[_0xf481('0x27')](_0x259651,_0x4d4a22,!![]);}catch(_0x5ade48){return BPromise['reject'](_0x5ade48);}return _0x259651[_0xf481('0x28')]();};}function saveUpdates(_0x5749cb,_0x1550d5){return function(_0x3375d0){if(_0x3375d0){return _0x3375d0['update'](_0x5749cb)[_0xf481('0x29')](function(_0xfc66b0){return _0xfc66b0;});}return null;};}function removeEntity(_0x310a90,_0x45bdfb){return function(_0x42b37b){if(_0x42b37b){return _0x42b37b[_0xf481('0x2a')]()[_0xf481('0x29')](function(){var _0x4536bd=_0x42b37b[_0xf481('0x2b')]({'plain':!![]});var _0x3612c4=_0xf481('0x2c');return db[_0xf481('0x2d')][_0xf481('0x2a')]({'where':{'type':_0x3612c4,'resourceId':_0x4536bd['id']}})[_0xf481('0x29')](function(){return _0x42b37b;});})[_0xf481('0x29')](function(){_0x310a90[_0xf481('0x21')](0xcc)[_0xf481('0x20')]();});}};}function handleEntityNotFound(_0x2678e8,_0x17179e){return function(_0x2b6e74){if(!_0x2b6e74){_0x2678e8['sendStatus'](0x194);}return _0x2b6e74;};}function handleError(_0x33c51c,_0x30e547){_0x30e547=_0x30e547||0x1f4;return function(_0xb591ca){logger[_0xf481('0x2e')](_0xb591ca['stack']);if(_0xb591ca[_0xf481('0x2f')]){delete _0xb591ca[_0xf481('0x2f')];}_0x33c51c[_0xf481('0x21')](_0x30e547)[_0xf481('0x30')](_0xb591ca);};}exports['index']=function(_0x4bb3f8,_0x57ac51){var _0x3ebb20={},_0x23ff69={},_0x1a1669={'count':0x0,'rows':[]};var _0x2929e4=db['MailQueue']['rawAttributes'];_0x23ff69['model']=_[_0xf481('0x31')](_0x2929e4);_0x23ff69[_0xf481('0x32')]=_['keys'](_0x4bb3f8['query']);_0x23ff69[_0xf481('0x33')]=_[_0xf481('0x34')](_0x23ff69[_0xf481('0x35')],_0x23ff69[_0xf481('0x32')]);_0x3ebb20[_0xf481('0x36')]=_[_0xf481('0x34')](_0x23ff69[_0xf481('0x35')],qs[_0xf481('0x37')](_0x4bb3f8[_0xf481('0x32')][_0xf481('0x37')]));_0x3ebb20[_0xf481('0x36')]=_0x3ebb20[_0xf481('0x36')][_0xf481('0x38')]?_0x3ebb20[_0xf481('0x36')]:_0x23ff69[_0xf481('0x35')];if(!_0x4bb3f8[_0xf481('0x32')][_0xf481('0x39')]('nolimit')){_0x3ebb20[_0xf481('0x25')]=qs[_0xf481('0x25')](_0x4bb3f8[_0xf481('0x32')]['limit']);_0x3ebb20[_0xf481('0x24')]=qs[_0xf481('0x24')](_0x4bb3f8[_0xf481('0x32')][_0xf481('0x24')]);}_0x3ebb20['order']=qs[_0xf481('0x3a')](_0x4bb3f8['query'][_0xf481('0x3a')]);_0x3ebb20[_0xf481('0x3b')]=qs[_0xf481('0x33')](_[_0xf481('0x3c')](_0x4bb3f8[_0xf481('0x32')],_0x23ff69['filters']));if(_0x4bb3f8[_0xf481('0x32')]['filter']){_0x3ebb20[_0xf481('0x3b')]=_[_0xf481('0x3d')](_0x3ebb20[_0xf481('0x3b')],{'$or':_[_0xf481('0x3e')](_0x2929e4,function(_0x1143e8){if(_0x1143e8[_0xf481('0x3f')][_0xf481('0x40')]!==_0xf481('0x41')){var _0x2231f9={};_0x2231f9[_0x1143e8[_0xf481('0x42')]]={'$like':'%'+_0x4bb3f8['query']['filter']+'%'};return _0x2231f9;}})});}_0x3ebb20=_[_0xf481('0x3d')]({},_0x3ebb20,_0x4bb3f8[_0xf481('0x43')]);var _0xd06698={'where':_0x3ebb20[_0xf481('0x3b')]};return db[_0xf481('0x44')][_0xf481('0x23')](_0xd06698)[_0xf481('0x29')](function(_0x27e49c){_0x1a1669[_0xf481('0x23')]=_0x27e49c;if(_0x4bb3f8[_0xf481('0x32')][_0xf481('0x45')]){_0x3ebb20[_0xf481('0x46')]=[{'all':!![]}];}return db[_0xf481('0x44')][_0xf481('0x47')](_0x3ebb20);})[_0xf481('0x29')](function(_0x607170){_0x1a1669['rows']=_0x607170;return _0x1a1669;})[_0xf481('0x29')](respondWithFilteredResult(_0x57ac51,_0x3ebb20))[_0xf481('0x48')](handleError(_0x57ac51,null));};exports['show']=function(_0x359940,_0x150251){var _0x276122={'raw':!![],'where':{'id':_0x359940[_0xf481('0x49')]['id']}},_0x4d1bf0={};_0x4d1bf0[_0xf481('0x35')]=_[_0xf481('0x31')](db[_0xf481('0x44')]['rawAttributes']);_0x4d1bf0[_0xf481('0x32')]=_[_0xf481('0x31')](_0x359940[_0xf481('0x32')]);_0x4d1bf0[_0xf481('0x33')]=_['intersection'](_0x4d1bf0[_0xf481('0x35')],_0x4d1bf0[_0xf481('0x32')]);_0x276122[_0xf481('0x36')]=_[_0xf481('0x34')](_0x4d1bf0[_0xf481('0x35')],qs['fields'](_0x359940[_0xf481('0x32')][_0xf481('0x37')]));_0x276122['attributes']=_0x276122[_0xf481('0x36')][_0xf481('0x38')]?_0x276122['attributes']:_0x4d1bf0[_0xf481('0x35')];if(_0x359940[_0xf481('0x32')][_0xf481('0x45')]){_0x276122[_0xf481('0x46')]=[{'all':!![]}];}_0x276122=_['merge']({},_0x276122,_0x359940[_0xf481('0x43')]);return db[_0xf481('0x44')][_0xf481('0x4a')](_0x276122)[_0xf481('0x29')](handleEntityNotFound(_0x150251,null))[_0xf481('0x29')](respondWithResult(_0x150251,null))['catch'](handleError(_0x150251,null));};exports[_0xf481('0x4b')]=function(_0x34c2ae,_0xcecdcf){return db[_0xf481('0x44')]['create'](_0x34c2ae[_0xf481('0x4c')],{})[_0xf481('0x29')](function(_0x8ea1ff){var _0x4debef=_0x34c2ae[_0xf481('0x4d')][_0xf481('0x2b')]({'plain':!![]});if(!_0x4debef)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4debef[_0xf481('0x4e')]==='user'){var _0x19726f=_0x8ea1ff[_0xf481('0x2b')]({'plain':!![]});var _0x190786='MailQueues';return db[_0xf481('0x4f')][_0xf481('0x4a')]({'where':{'name':_0x190786,'userProfileId':_0x4debef['userProfileId']},'raw':!![]})['then'](function(_0x1c91f6){if(_0x1c91f6&&_0x1c91f6['autoAssociation']===0x0){return db[_0xf481('0x2d')][_0xf481('0x4b')]({'name':_0x19726f[_0xf481('0x2f')],'resourceId':_0x19726f['id'],'type':_0x1c91f6[_0xf481('0x2f')],'sectionId':_0x1c91f6['id']},{})[_0xf481('0x29')](function(){return _0x8ea1ff;});}else{return _0x8ea1ff;}})[_0xf481('0x48')](function(_0xb5d6a9){logger[_0xf481('0x2e')](_0xf481('0x50'),_0xb5d6a9);throw _0xb5d6a9;});}return _0x8ea1ff;})[_0xf481('0x29')](respondWithResult(_0xcecdcf,0xc9))[_0xf481('0x48')](handleError(_0xcecdcf,null));};exports['update']=function(_0x77d189,_0x264ab5){if(_0x77d189[_0xf481('0x4c')]['id']){delete _0x77d189['body']['id'];}return db['MailQueue'][_0xf481('0x4a')]({'where':{'id':_0x77d189[_0xf481('0x49')]['id']}})['then'](handleEntityNotFound(_0x264ab5,null))[_0xf481('0x29')](saveUpdates(_0x77d189[_0xf481('0x4c')],null))[_0xf481('0x29')](respondWithResult(_0x264ab5,null))['catch'](handleError(_0x264ab5,null));};exports[_0xf481('0x2a')]=function(_0x3a084f,_0x3f5c0a){return db[_0xf481('0x44')][_0xf481('0x4a')]({'where':{'id':_0x3a084f[_0xf481('0x49')]['id']}})[_0xf481('0x29')](handleEntityNotFound(_0x3f5c0a,null))[_0xf481('0x29')](removeEntity(_0x3f5c0a,null))[_0xf481('0x48')](handleError(_0x3f5c0a,null));};exports[_0xf481('0x51')]=function(_0x21fcea,_0x4e68f3){return db[_0xf481('0x44')][_0xf481('0x51')]()[_0xf481('0x29')](respondWithResult(_0x4e68f3,null))['catch'](handleError(_0x4e68f3,null));};exports[_0xf481('0x52')]=function(_0x56ec77,_0x3de8f2,_0xe8a786){var _0x3047b3={'raw':!![],'where':{}},_0x569793={},_0x47f3a4;return db[_0xf481('0x44')][_0xf481('0x53')]({'where':{'id':_0x56ec77[_0xf481('0x49')]['id']}})[_0xf481('0x29')](handleEntityNotFound(_0x3de8f2,null))[_0xf481('0x29')](function(_0xa87b50){if(_0xa87b50){_0x47f3a4=_0xa87b50[_0xf481('0x2b')]({'plain':!![]});_0x569793[_0xf481('0x35')]=_['keys'](db[_0xf481('0x54')][_0xf481('0x55')]);_0x569793[_0xf481('0x32')]=_[_0xf481('0x31')](_0x56ec77[_0xf481('0x32')]);_0x569793[_0xf481('0x33')]=_[_0xf481('0x34')](_0x569793[_0xf481('0x35')],_0x569793[_0xf481('0x32')]);_0x3047b3[_0xf481('0x36')]=_[_0xf481('0x34')](_0x569793[_0xf481('0x35')],qs[_0xf481('0x37')](_0x56ec77[_0xf481('0x32')][_0xf481('0x37')]));_0x3047b3[_0xf481('0x36')]=_0x3047b3[_0xf481('0x36')]['length']?_0x3047b3[_0xf481('0x36')]:_0x569793[_0xf481('0x35')];if(!_0x56ec77[_0xf481('0x32')]['hasOwnProperty']('nolimit')){_0x3047b3[_0xf481('0x25')]=qs[_0xf481('0x25')](_0x56ec77[_0xf481('0x32')][_0xf481('0x25')]);_0x3047b3['offset']=qs[_0xf481('0x24')](_0x56ec77['query'][_0xf481('0x24')]);}_0x3047b3[_0xf481('0x56')]=qs[_0xf481('0x3a')](_0x56ec77[_0xf481('0x32')][_0xf481('0x3a')]);_0x3047b3[_0xf481('0x3b')]=qs['filters'](_[_0xf481('0x3c')](_0x56ec77['query'],_0x569793[_0xf481('0x33')]));_0x3047b3[_0xf481('0x3b')]['MailQueueId']=_0xa87b50['id'];if(_0x56ec77['query'][_0xf481('0x57')]){_0x3047b3[_0xf481('0x3b')]=_[_0xf481('0x3d')](_0x3047b3['where'],{'$or':_[_0xf481('0x3e')](_0x3047b3['attributes'],function(_0x45ca12){var _0x2a2c2c={};_0x2a2c2c[_0x45ca12]={'$like':'%'+_0x56ec77['query'][_0xf481('0x57')]+'%'};return _0x2a2c2c;})});}_0x3047b3=_['merge']({},_0x3047b3,_0x56ec77[_0xf481('0x43')]);return db[_0xf481('0x54')]['findAll'](_0x3047b3);}})['then'](function(_0x1f03da){if(_0x1f03da){return db['User']['findAndCountAll']({'where':{'id':_[_0xf481('0x3e')](_0x1f03da,_0xf481('0x58')),'role':_0xf481('0x59')},'attributes':['id','name',_0xf481('0x5a'),_0xf481('0x5b'),'createdAt']});}})[_0xf481('0x29')](function(_0x3c1016){if(_0x3c1016){return{'count':_0x3c1016[_0xf481('0x23')],'rows':_[_0xf481('0x3e')](_0x3c1016[_0xf481('0x5c')],function(_0x4abcf4){return{'membername':_0x4abcf4[_0xf481('0x2f')],'UserId':_0x4abcf4['id'],'queue_name':_0x47f3a4['name'],'MailQueueId':_0x47f3a4['id'],'interface':util[_0xf481('0x5d')](_0xf481('0x5e'),'SIP',_0x4abcf4[_0xf481('0x2f')]),'penalty':0x0,'paused':_0x4abcf4['mailPause'],'createdAt':_0x4abcf4['createdAt'],'updatedAt':_0x4abcf4[_0xf481('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf481('0x29')](respondWithFilteredResult(_0x3de8f2,_0x3047b3))[_0xf481('0x48')](handleError(_0x3de8f2,null));};exports['getTeams']=function(_0x3c5efe,_0x1200a0,_0x388820){var _0x463cb4={};var _0x38d5ce={};var _0x9be931;var _0x13e26d;return db[_0xf481('0x44')]['findOne']({'where':{'id':_0x3c5efe[_0xf481('0x49')]['id']}})[_0xf481('0x29')](handleEntityNotFound(_0x1200a0,null))[_0xf481('0x29')](function(_0x50b192){if(_0x50b192){_0x9be931=_0x50b192;_0x38d5ce[_0xf481('0x35')]=_[_0xf481('0x31')](db[_0xf481('0x5f')][_0xf481('0x55')]);_0x38d5ce[_0xf481('0x32')]=_[_0xf481('0x31')](_0x3c5efe[_0xf481('0x32')]);_0x38d5ce[_0xf481('0x33')]=_[_0xf481('0x34')](_0x38d5ce[_0xf481('0x35')],_0x38d5ce[_0xf481('0x32')]);_0x463cb4['attributes']=_[_0xf481('0x34')](_0x38d5ce[_0xf481('0x35')],qs['fields'](_0x3c5efe[_0xf481('0x32')][_0xf481('0x37')]));_0x463cb4[_0xf481('0x36')]=_0x463cb4['attributes'][_0xf481('0x38')]?_0x463cb4[_0xf481('0x36')]:_0x38d5ce[_0xf481('0x35')];_0x463cb4[_0xf481('0x56')]=qs[_0xf481('0x3a')](_0x3c5efe['query'][_0xf481('0x3a')]);_0x463cb4[_0xf481('0x3b')]=qs['filters'](_[_0xf481('0x3c')](_0x3c5efe[_0xf481('0x32')],_0x38d5ce[_0xf481('0x33')]));if(_0x3c5efe[_0xf481('0x32')]['filter']){_0x463cb4[_0xf481('0x3b')]=_[_0xf481('0x3d')](_0x463cb4['where'],{'$or':_[_0xf481('0x3e')](_0x463cb4[_0xf481('0x36')],function(_0x485d44){var _0x3f0b06={};_0x3f0b06[_0x485d44]={'$like':'%'+_0x3c5efe[_0xf481('0x32')][_0xf481('0x57')]+'%'};return _0x3f0b06;})});}_0x463cb4=_[_0xf481('0x3d')]({},_0x463cb4,_0x3c5efe['options']);return _0x9be931[_0xf481('0x60')](_0x463cb4);}})[_0xf481('0x29')](function(_0x15706d){if(_0x15706d){_0x13e26d=_0x15706d[_0xf481('0x38')];if(!_0x3c5efe[_0xf481('0x32')][_0xf481('0x39')](_0xf481('0x61'))){_0x463cb4[_0xf481('0x25')]=qs[_0xf481('0x25')](_0x3c5efe[_0xf481('0x32')]['limit']);_0x463cb4[_0xf481('0x24')]=qs['offset'](_0x3c5efe[_0xf481('0x32')]['offset']);}return _0x9be931[_0xf481('0x60')](_0x463cb4);}})[_0xf481('0x29')](function(_0xce4f0e){if(_0xce4f0e){return _0xce4f0e?{'count':_0x13e26d,'rows':_0xce4f0e}:null;}})['then'](respondWithResult(_0x1200a0,null))['catch'](handleError(_0x1200a0,null));};exports[_0xf481('0x62')]=function(_0x31cc1e,_0x302cae,_0x728374){var _0x4bbe00=_0x31cc1e['body'][_0xf481('0x63')];return db[_0xf481('0x5f')][_0xf481('0x47')]({'where':{'id':_[_0xf481('0x3e')](_0x4bbe00,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0xf481('0x64'),_0xf481('0x65'),_0xf481('0x66')],'raw':!![]}]})[_0xf481('0x29')](function(_0x1f4273){if(_0x1f4273){var _0x3b4ce4=_[_0xf481('0x67')](_0x1f4273,function(_0x23e399){var _0x4ef2e6=_0x23e399[_0xf481('0x2b')]({'plain':!![]});return _0x4ef2e6[_0xf481('0x68')];});return db['MailQueue'][_0xf481('0x4a')]({'where':{'id':_0x31cc1e[_0xf481('0x49')]['id']}})['then'](function(_0x7ab9ed){return db[_0xf481('0x69')][_0xf481('0x6a')](function(_0x46c925){return _0x7ab9ed['addTeams'](_[_0xf481('0x3e')](_0x4bbe00,'id'),{'transaction':_0x46c925})[_0xf481('0x29')](function(){return BPromise[_0xf481('0x6b')](_0x3b4ce4,function(_0x55d7f7){return db[_0xf481('0x54')]['findOrCreate']({'where':{'UserId':_0x55d7f7['id'],'MailQueueId':_0x31cc1e['params']['id']},'transaction':_0x46c925});});})['then'](function(){_0x3b4ce4[_0xf481('0x6c')](function(_0x4f55f7){socket[_0xf481('0x6d')](_0xf481('0x6e'),{'UserId':_0x4f55f7['id'],'MailQueueId':_0x7ab9ed['id']});});});});});}})[_0xf481('0x29')](respondWithStatusCode(_0x302cae,null))[_0xf481('0x48')](handleError(_0x302cae,null));};exports[_0xf481('0x6f')]=function(_0x291230,_0x2350d1,_0x49ac0e){return db[_0xf481('0x5f')]['findAll']({'where':{'id':_0x291230['query'][_0xf481('0x70')]},'attributes':['id'],'include':[{'model':db[_0xf481('0x71')],'as':_0xf481('0x68'),'attributes':['id'],'raw':!![]}]})[_0xf481('0x29')](handleEntityNotFound(_0x2350d1,null))['then'](function(_0x3e8589){var _0x71a6b4=_[_0xf481('0x3e')](_0x3e8589,'id');var _0x5965f1=[];var _0x5c5b61=[];var _0x4cd04b=squel[_0xf481('0x72')]();_0x4cd04b[_0xf481('0x42')](_0xf481('0x73'))[_0xf481('0x74')](_0xf481('0x75'),'tq')[_0xf481('0x76')](_0xf481('0x77'),'ut',_0xf481('0x78'))['where'](_0xf481('0x79'),_0x291230['params']['id']);for(var _0xa32f29=0x0;_0xa32f29<_0x3e8589['length'];_0xa32f29+=0x1){let _0x240084=_0x3e8589[_0xa32f29];for(var _0x13d504=0x0;_0x13d504<_0x240084[_0xf481('0x68')][_0xf481('0x38')];_0x13d504+=0x1){let _0x128cce=_0x240084[_0xf481('0x68')][_0x13d504];var _0x114197=_0x4cd04b['clone']();_0x114197[_0xf481('0x3b')](_0xf481('0x7a'),_0x128cce['id']);_0x5c5b61['push'](db[_0xf481('0x69')][_0xf481('0x32')](_0x114197[_0xf481('0x7b')](),{'type':db[_0xf481('0x69')][_0xf481('0x7c')][_0xf481('0x7d')]})[_0xf481('0x29')](function(_0x4fe518){if(_0x4fe518[_0xf481('0x38')]===0x1){return _0x128cce['id'];}else{var _0x554d74=_[_0xf481('0x7e')](_['map'](_0x4fe518,_0xf481('0x7f')),function(_0x448541){return _['includes'](_0x71a6b4,_0x448541);});if(_0x554d74){return _0x128cce['id'];}}}));}}return BPromise[_0xf481('0x80')](_0x5c5b61)[_0xf481('0x29')](function(_0x49f0c4){_0x5965f1=_(_0x5965f1)[_0xf481('0x81')](_0x49f0c4)['compact']()['value']();return db[_0xf481('0x44')][_0xf481('0x4a')]({'where':{'id':_0x291230[_0xf481('0x49')]['id']}})[_0xf481('0x29')](function(_0x39a006){return db[_0xf481('0x69')][_0xf481('0x6a')](function(_0x45410f){return _0x39a006[_0xf481('0x6f')](_0x291230[_0xf481('0x32')][_0xf481('0x70')],{'transaction':_0x45410f})['then'](function(){if(!_[_0xf481('0x82')](_0x5965f1)){return _0x39a006[_0xf481('0x83')](_0x5965f1,{'transaction':_0x45410f});}})[_0xf481('0x29')](function(){_0x5965f1[_0xf481('0x6c')](function(_0x4f2da5){socket[_0xf481('0x6d')]('userMailQueue:remove',{'UserId':_0x4f2da5,'MailQueueId':_0x39a006['id']});});});});});});})[_0xf481('0x29')](respondWithStatusCode(_0x2350d1,null))[_0xf481('0x48')](handleError(_0x2350d1,null));};exports[_0xf481('0x84')]=function(_0xbd8e60,_0xe3f2a3,_0x15ecaa){return db['MailQueue'][_0xf481('0x4a')]({'where':{'id':_0xbd8e60[_0xf481('0x49')]['id']}})[_0xf481('0x29')](handleEntityNotFound(_0xe3f2a3,null))[_0xf481('0x29')](function(_0x44289a){if(_0x44289a){return _0x44289a[_0xf481('0x84')](_0xbd8e60['body']['ids'],_[_0xf481('0x85')](_0xbd8e60[_0xf481('0x4c')],['ids','id'])||{})[_0xf481('0x86')](function(_0x2764e7){for(var _0x2f6c50=0x0;_0x2f6c50<_0xbd8e60[_0xf481('0x4c')][_0xf481('0x70')][_0xf481('0x38')];_0x2f6c50+=0x1){socket[_0xf481('0x6d')](_0xf481('0x6e'),{'UserId':_0xbd8e60['body']['ids'][_0x2f6c50],'MailQueueId':_0xbd8e60[_0xf481('0x49')]['id']});}return _0x2764e7;});}})[_0xf481('0x29')](respondWithResult(_0xe3f2a3,null))[_0xf481('0x48')](handleError(_0xe3f2a3,null));};exports['removeAgents']=function(_0x59ab67,_0x2c59ce,_0x30d621){return db['MailQueue']['find']({'where':{'id':_0x59ab67['params']['id']}})['then'](handleEntityNotFound(_0x2c59ce,null))[_0xf481('0x29')](function(_0x10e043){if(_0x10e043){return _0x10e043[_0xf481('0x83')](_0x59ab67[_0xf481('0x32')]['ids'])[_0xf481('0x29')](function(){if(_[_0xf481('0x87')](_0x59ab67[_0xf481('0x32')][_0xf481('0x70')])){for(var _0x59cf7c=0x0;_0x59cf7c<_0x59ab67[_0xf481('0x32')][_0xf481('0x70')]['length'];_0x59cf7c+=0x1){socket['emit'](_0xf481('0x88'),{'UserId':Number(_0x59ab67[_0xf481('0x32')][_0xf481('0x70')][_0x59cf7c]),'MailQueueId':Number(_0x59ab67[_0xf481('0x49')]['id'])});}}else{socket[_0xf481('0x6d')](_0xf481('0x88'),{'UserId':Number(_0x59ab67['query'][_0xf481('0x70')]),'MailQueueId':Number(_0x59ab67['params']['id'])});}});}})[_0xf481('0x29')](respondWithStatusCode(_0x2c59ce,null))['catch'](handleError(_0x2c59ce,null));};exports['getAgents']=function(_0x361d1d,_0x54afc5,_0x4e4e6a){var _0x140c8c={};var _0x275a9a={};var _0x1633f3;var _0x310026;return db[_0xf481('0x44')][_0xf481('0x53')]({'where':{'id':_0x361d1d[_0xf481('0x49')]['id']}})[_0xf481('0x29')](handleEntityNotFound(_0x54afc5,null))[_0xf481('0x29')](function(_0x370aeb){if(_0x370aeb){_0x1633f3=_0x370aeb;_0x275a9a['model']=_[_0xf481('0x31')](db[_0xf481('0x71')][_0xf481('0x55')]);_0x275a9a['query']=_[_0xf481('0x31')](_0x361d1d[_0xf481('0x32')]);_0x275a9a[_0xf481('0x33')]=_[_0xf481('0x34')](_0x275a9a[_0xf481('0x35')],_0x275a9a[_0xf481('0x32')]);_0x140c8c[_0xf481('0x36')]=_['intersection'](_0x275a9a[_0xf481('0x35')],qs[_0xf481('0x37')](_0x361d1d[_0xf481('0x32')]['fields']));_0x140c8c[_0xf481('0x36')]=_0x140c8c[_0xf481('0x36')]['length']?_0x140c8c[_0xf481('0x36')]:_0x275a9a[_0xf481('0x35')];_0x140c8c[_0xf481('0x56')]=qs[_0xf481('0x3a')](_0x361d1d[_0xf481('0x32')][_0xf481('0x3a')]);_0x140c8c[_0xf481('0x3b')]=qs['filters'](_['pick'](_0x361d1d[_0xf481('0x32')],_0x275a9a[_0xf481('0x33')]));if(_0x361d1d['query'][_0xf481('0x57')]){_0x140c8c[_0xf481('0x3b')]=_['merge'](_0x140c8c[_0xf481('0x3b')],{'$or':_[_0xf481('0x3e')](_0x140c8c[_0xf481('0x36')],function(_0x30c6bd){var _0x3c37b8={};_0x3c37b8[_0x30c6bd]={'$like':'%'+_0x361d1d[_0xf481('0x32')][_0xf481('0x57')]+'%'};return _0x3c37b8;})});}_0x140c8c=_['merge']({},_0x140c8c,_0x361d1d[_0xf481('0x43')]);return _0x1633f3[_0xf481('0x89')](_0x140c8c);}})[_0xf481('0x29')](function(_0x39af2c){if(_0x39af2c){_0x310026=_0x39af2c['length'];if(!_0x361d1d[_0xf481('0x32')]['hasOwnProperty']('nolimit')){_0x140c8c[_0xf481('0x25')]=qs[_0xf481('0x25')](_0x361d1d[_0xf481('0x32')][_0xf481('0x25')]);_0x140c8c['offset']=qs[_0xf481('0x24')](_0x361d1d[_0xf481('0x32')]['offset']);}return _0x1633f3[_0xf481('0x89')](_0x140c8c);}})[_0xf481('0x29')](function(_0x5199c6){if(_0x5199c6){return _0x5199c6?{'count':_0x310026,'rows':_0x5199c6}:null;}})[_0xf481('0x29')](respondWithResult(_0x54afc5,null))[_0xf481('0x48')](handleError(_0x54afc5,null));}; \ No newline at end of file +var _0x8ab0=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','end','status','count','offset','set','json','apply','reject','save','then','get','MailQueues','UserProfileResource','sendStatus','error','stack','name','index','MailQueue','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','field','includeAll','findAll','rows','catch','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserMailQueue','pick','MailQueueId','map','UserId','agent','mailPause','updatedAt','getTeams','Team','hasOwnProperty','teams','User','online','voicePause','interface','flatMap','sequelize','addTeams','each','findOrCreate','emit','userMailQueue:save','removeTeams','Agents','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','value','transaction','ids','isEmpty','removeAgents','forEach','userMailQueue:remove','spread','isArray','getAgents','html-pdf','eml-format','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x5bec69,_0x4d4a04){var _0x5f159e=function(_0x59a705){while(--_0x59a705){_0x5bec69['push'](_0x5bec69['shift']());}};_0x5f159e(++_0x4d4a04);}(_0x8ab0,0x172));var _0x08ab=function(_0x4acfa7,_0x21db2d){_0x4acfa7=_0x4acfa7-0x0;var _0x5a6cdd=_0x8ab0[_0x4acfa7];return _0x5a6cdd;};'use strict';var pdf=require(_0x08ab('0x0'));var emlformat=require(_0x08ab('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x08ab('0x2'));var moment=require(_0x08ab('0x3'));var BPromise=require(_0x08ab('0x4'));var Mustache=require('mustache');var util=require(_0x08ab('0x5'));var path=require('path');var sox=require(_0x08ab('0x6'));var csv=require('to-csv');var ejs=require(_0x08ab('0x7'));var fs=require('fs');var _=require(_0x08ab('0x8'));var squel=require(_0x08ab('0x9'));var crypto=require('crypto');var jsforce=require(_0x08ab('0xa'));var deskjs=require(_0x08ab('0xb'));var toCsv=require('to-csv');var querystring=require(_0x08ab('0xc'));var Papa=require(_0x08ab('0xd'));var Redis=require(_0x08ab('0xe'));var authService=require(_0x08ab('0xf'));var qs=require(_0x08ab('0x10'));var hardwareService=require(_0x08ab('0x11'));var logger=require('../../config/logger')(_0x08ab('0x12'));var utils=require(_0x08ab('0x13'));var config=require('../../config/environment');var db=require(_0x08ab('0x14'))['db'];config['redis']=_[_0x08ab('0x15')](config[_0x08ab('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x08ab('0x17'))(new Redis(config[_0x08ab('0x16')]));require('./mailQueue.socket')['register'](socket);function respondWithStatusCode(_0x493bdd,_0x17cdcf){_0x17cdcf=_0x17cdcf||0xcc;return function(_0x361acd){if(_0x361acd){return _0x493bdd['sendStatus'](_0x17cdcf);}return _0x493bdd['status'](_0x17cdcf)[_0x08ab('0x18')]();};}function respondWithResult(_0x3f4109,_0xac69e3){_0xac69e3=_0xac69e3||0xc8;return function(_0x5874d0){if(_0x5874d0){return _0x3f4109[_0x08ab('0x19')](_0xac69e3)['json'](_0x5874d0);}};}function respondWithFilteredResult(_0x2d9a72,_0x188e60){return function(_0x5f0290){if(_0x5f0290){var _0x5908fd=_0x5f0290[_0x08ab('0x1a')],_0x34b163=_0x188e60[_0x08ab('0x1b')],_0x26d13f=_0x188e60[_0x08ab('0x1b')]+_0x188e60['limit'],_0x33c917;if(_0x26d13f>=_0x5908fd){_0x26d13f=_0x5908fd;_0x33c917=0xc8;}else{_0x33c917=0xce;}_0x2d9a72[_0x08ab('0x19')](_0x33c917);return _0x2d9a72[_0x08ab('0x1c')]('Content-Range',_0x34b163+'-'+_0x26d13f+'/'+_0x5908fd)[_0x08ab('0x1d')](_0x5f0290);}return null;};}function patchUpdates(_0xbf05ab){return function(_0x528e24){try{jsonpatch[_0x08ab('0x1e')](_0x528e24,_0xbf05ab,!![]);}catch(_0xfdde0c){return BPromise[_0x08ab('0x1f')](_0xfdde0c);}return _0x528e24[_0x08ab('0x20')]();};}function saveUpdates(_0x24f1fb,_0xbc5d8f){return function(_0xf8893){if(_0xf8893){return _0xf8893['update'](_0x24f1fb)[_0x08ab('0x21')](function(_0x2dd75d){return _0x2dd75d;});}return null;};}function removeEntity(_0x4d4ade,_0x4082d0){return function(_0x38daa2){if(_0x38daa2){return _0x38daa2['destroy']()[_0x08ab('0x21')](function(){var _0x29cfd9=_0x38daa2[_0x08ab('0x22')]({'plain':!![]});var _0x1789c1=_0x08ab('0x23');return db[_0x08ab('0x24')]['destroy']({'where':{'type':_0x1789c1,'resourceId':_0x29cfd9['id']}})['then'](function(){return _0x38daa2;});})[_0x08ab('0x21')](function(){_0x4d4ade[_0x08ab('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e426c,_0x99a24a){return function(_0x224e4d){if(!_0x224e4d){_0x1e426c[_0x08ab('0x25')](0x194);}return _0x224e4d;};}function handleError(_0x2c15fd,_0x53f62f){_0x53f62f=_0x53f62f||0x1f4;return function(_0x559c71){logger[_0x08ab('0x26')](_0x559c71[_0x08ab('0x27')]);if(_0x559c71[_0x08ab('0x28')]){delete _0x559c71['name'];}_0x2c15fd[_0x08ab('0x19')](_0x53f62f)['send'](_0x559c71);};}exports[_0x08ab('0x29')]=function(_0x213fd4,_0x3e30ea){var _0x3205e6={},_0x18e263={},_0x343782={'count':0x0,'rows':[]};var _0x2787b4=db[_0x08ab('0x2a')][_0x08ab('0x2b')];_0x18e263[_0x08ab('0x2c')]=_[_0x08ab('0x2d')](_0x2787b4);_0x18e263[_0x08ab('0x2e')]=_[_0x08ab('0x2d')](_0x213fd4[_0x08ab('0x2e')]);_0x18e263[_0x08ab('0x2f')]=_[_0x08ab('0x30')](_0x18e263[_0x08ab('0x2c')],_0x18e263[_0x08ab('0x2e')]);_0x3205e6[_0x08ab('0x31')]=_[_0x08ab('0x30')](_0x18e263[_0x08ab('0x2c')],qs[_0x08ab('0x32')](_0x213fd4[_0x08ab('0x2e')]['fields']));_0x3205e6[_0x08ab('0x31')]=_0x3205e6[_0x08ab('0x31')][_0x08ab('0x33')]?_0x3205e6[_0x08ab('0x31')]:_0x18e263[_0x08ab('0x2c')];if(!_0x213fd4[_0x08ab('0x2e')]['hasOwnProperty'](_0x08ab('0x34'))){_0x3205e6[_0x08ab('0x35')]=qs['limit'](_0x213fd4[_0x08ab('0x2e')][_0x08ab('0x35')]);_0x3205e6[_0x08ab('0x1b')]=qs[_0x08ab('0x1b')](_0x213fd4[_0x08ab('0x2e')]['offset']);}_0x3205e6[_0x08ab('0x36')]=qs[_0x08ab('0x37')](_0x213fd4[_0x08ab('0x2e')][_0x08ab('0x37')]);_0x3205e6[_0x08ab('0x38')]=qs['filters'](_['pick'](_0x213fd4[_0x08ab('0x2e')],_0x18e263['filters']));if(_0x213fd4[_0x08ab('0x2e')][_0x08ab('0x39')]){_0x3205e6[_0x08ab('0x38')]=_[_0x08ab('0x3a')](_0x3205e6[_0x08ab('0x38')],{'$or':_['map'](_0x2787b4,function(_0x353aa7){if(_0x353aa7[_0x08ab('0x3b')]['key']!==_0x08ab('0x3c')){var _0x37ca2f={};_0x37ca2f[_0x353aa7[_0x08ab('0x3d')]]={'$like':'%'+_0x213fd4['query']['filter']+'%'};return _0x37ca2f;}})});}_0x3205e6=_['merge']({},_0x3205e6,_0x213fd4['options']);var _0xbd2161={'where':_0x3205e6['where']};return db[_0x08ab('0x2a')][_0x08ab('0x1a')](_0xbd2161)[_0x08ab('0x21')](function(_0x2c817e){_0x343782[_0x08ab('0x1a')]=_0x2c817e;if(_0x213fd4['query'][_0x08ab('0x3e')]){_0x3205e6['include']=[{'all':!![]}];}return db[_0x08ab('0x2a')][_0x08ab('0x3f')](_0x3205e6);})[_0x08ab('0x21')](function(_0x404597){_0x343782[_0x08ab('0x40')]=_0x404597;return _0x343782;})[_0x08ab('0x21')](respondWithFilteredResult(_0x3e30ea,_0x3205e6))[_0x08ab('0x41')](handleError(_0x3e30ea,null));};exports[_0x08ab('0x42')]=function(_0x76d7fe,_0x4eda67){var _0x3d9a38={'raw':!![],'where':{'id':_0x76d7fe[_0x08ab('0x43')]['id']}},_0x14beb0={};_0x14beb0[_0x08ab('0x2c')]=_['keys'](db['MailQueue'][_0x08ab('0x2b')]);_0x14beb0[_0x08ab('0x2e')]=_[_0x08ab('0x2d')](_0x76d7fe[_0x08ab('0x2e')]);_0x14beb0[_0x08ab('0x2f')]=_[_0x08ab('0x30')](_0x14beb0[_0x08ab('0x2c')],_0x14beb0['query']);_0x3d9a38['attributes']=_[_0x08ab('0x30')](_0x14beb0[_0x08ab('0x2c')],qs[_0x08ab('0x32')](_0x76d7fe[_0x08ab('0x2e')][_0x08ab('0x32')]));_0x3d9a38[_0x08ab('0x31')]=_0x3d9a38[_0x08ab('0x31')]['length']?_0x3d9a38[_0x08ab('0x31')]:_0x14beb0['model'];if(_0x76d7fe['query']['includeAll']){_0x3d9a38['include']=[{'all':!![]}];}_0x3d9a38=_[_0x08ab('0x3a')]({},_0x3d9a38,_0x76d7fe[_0x08ab('0x44')]);return db[_0x08ab('0x2a')]['find'](_0x3d9a38)[_0x08ab('0x21')](handleEntityNotFound(_0x4eda67,null))[_0x08ab('0x21')](respondWithResult(_0x4eda67,null))['catch'](handleError(_0x4eda67,null));};exports['create']=function(_0x304518,_0x2ec0c1){return db[_0x08ab('0x2a')][_0x08ab('0x45')](_0x304518[_0x08ab('0x46')],{})['then'](function(_0xfdcde4){var _0x59ec4b=_0x304518[_0x08ab('0x47')][_0x08ab('0x22')]({'plain':!![]});if(!_0x59ec4b)throw new Error(_0x08ab('0x48'));if(_0x59ec4b[_0x08ab('0x49')]==='user'){var _0x5bd0e7=_0xfdcde4[_0x08ab('0x22')]({'plain':!![]});var _0x2e93da='MailQueues';return db[_0x08ab('0x4a')][_0x08ab('0x4b')]({'where':{'name':_0x2e93da,'userProfileId':_0x59ec4b['userProfileId']},'raw':!![]})[_0x08ab('0x21')](function(_0x5b3392){if(_0x5b3392&&_0x5b3392[_0x08ab('0x4c')]===0x0){return db[_0x08ab('0x24')][_0x08ab('0x45')]({'name':_0x5bd0e7[_0x08ab('0x28')],'resourceId':_0x5bd0e7['id'],'type':_0x5b3392[_0x08ab('0x28')],'sectionId':_0x5b3392['id']},{})[_0x08ab('0x21')](function(){return _0xfdcde4;});}else{return _0xfdcde4;}})[_0x08ab('0x41')](function(_0x347bad){logger['error'](_0x08ab('0x4d'),_0x347bad);throw _0x347bad;});}return _0xfdcde4;})['then'](respondWithResult(_0x2ec0c1,0xc9))[_0x08ab('0x41')](handleError(_0x2ec0c1,null));};exports[_0x08ab('0x4e')]=function(_0x47c9e7,_0x1469b5){if(_0x47c9e7['body']['id']){delete _0x47c9e7[_0x08ab('0x46')]['id'];}return db['MailQueue']['find']({'where':{'id':_0x47c9e7[_0x08ab('0x43')]['id']}})['then'](handleEntityNotFound(_0x1469b5,null))['then'](saveUpdates(_0x47c9e7[_0x08ab('0x46')],null))[_0x08ab('0x21')](respondWithResult(_0x1469b5,null))[_0x08ab('0x41')](handleError(_0x1469b5,null));};exports['destroy']=function(_0x43a21a,_0x264b3b){return db[_0x08ab('0x2a')][_0x08ab('0x4b')]({'where':{'id':_0x43a21a['params']['id']}})['then'](handleEntityNotFound(_0x264b3b,null))[_0x08ab('0x21')](removeEntity(_0x264b3b,null))[_0x08ab('0x41')](handleError(_0x264b3b,null));};exports[_0x08ab('0x4f')]=function(_0x1b08b1,_0x302572){return db[_0x08ab('0x2a')][_0x08ab('0x4f')]()[_0x08ab('0x21')](respondWithResult(_0x302572,null))[_0x08ab('0x41')](handleError(_0x302572,null));};exports[_0x08ab('0x50')]=function(_0x2b456e,_0x3374f7,_0x1e87da){var _0x514b51={'raw':!![],'where':{}},_0x51fcc2={},_0x5d55f0;return db['MailQueue'][_0x08ab('0x51')]({'where':{'id':_0x2b456e[_0x08ab('0x43')]['id']}})[_0x08ab('0x21')](handleEntityNotFound(_0x3374f7,null))[_0x08ab('0x21')](function(_0x31cf9f){if(_0x31cf9f){_0x5d55f0=_0x31cf9f[_0x08ab('0x22')]({'plain':!![]});_0x51fcc2[_0x08ab('0x2c')]=_[_0x08ab('0x2d')](db[_0x08ab('0x52')]['rawAttributes']);_0x51fcc2[_0x08ab('0x2e')]=_['keys'](_0x2b456e[_0x08ab('0x2e')]);_0x51fcc2['filters']=_['intersection'](_0x51fcc2['model'],_0x51fcc2['query']);_0x514b51[_0x08ab('0x31')]=_[_0x08ab('0x30')](_0x51fcc2[_0x08ab('0x2c')],qs[_0x08ab('0x32')](_0x2b456e[_0x08ab('0x2e')]['fields']));_0x514b51[_0x08ab('0x31')]=_0x514b51['attributes']['length']?_0x514b51[_0x08ab('0x31')]:_0x51fcc2[_0x08ab('0x2c')];if(!_0x2b456e[_0x08ab('0x2e')]['hasOwnProperty'](_0x08ab('0x34'))){_0x514b51[_0x08ab('0x35')]=qs[_0x08ab('0x35')](_0x2b456e[_0x08ab('0x2e')][_0x08ab('0x35')]);_0x514b51['offset']=qs[_0x08ab('0x1b')](_0x2b456e[_0x08ab('0x2e')]['offset']);}_0x514b51[_0x08ab('0x36')]=qs[_0x08ab('0x37')](_0x2b456e[_0x08ab('0x2e')][_0x08ab('0x37')]);_0x514b51[_0x08ab('0x38')]=qs['filters'](_[_0x08ab('0x53')](_0x2b456e['query'],_0x51fcc2[_0x08ab('0x2f')]));_0x514b51['where'][_0x08ab('0x54')]=_0x31cf9f['id'];if(_0x2b456e[_0x08ab('0x2e')]['filter']){_0x514b51[_0x08ab('0x38')]=_[_0x08ab('0x3a')](_0x514b51[_0x08ab('0x38')],{'$or':_[_0x08ab('0x55')](_0x514b51['attributes'],function(_0x47f16b){var _0x54c77f={};_0x54c77f[_0x47f16b]={'$like':'%'+_0x2b456e['query'][_0x08ab('0x39')]+'%'};return _0x54c77f;})});}_0x514b51=_[_0x08ab('0x3a')]({},_0x514b51,_0x2b456e['options']);return db[_0x08ab('0x52')]['findAll'](_0x514b51);}})[_0x08ab('0x21')](function(_0x15a2be){if(_0x15a2be){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x15a2be,_0x08ab('0x56')),'role':_0x08ab('0x57')},'attributes':['id',_0x08ab('0x28'),_0x08ab('0x58'),_0x08ab('0x59'),'createdAt']});}})[_0x08ab('0x21')](function(_0x546aac){if(_0x546aac){return{'count':_0x546aac[_0x08ab('0x1a')],'rows':_[_0x08ab('0x55')](_0x546aac['rows'],function(_0x1b2916){return{'membername':_0x1b2916['name'],'UserId':_0x1b2916['id'],'queue_name':_0x5d55f0[_0x08ab('0x28')],'MailQueueId':_0x5d55f0['id'],'interface':util['format']('%s/%s','SIP',_0x1b2916[_0x08ab('0x28')]),'penalty':0x0,'paused':_0x1b2916['mailPause'],'createdAt':_0x1b2916['createdAt'],'updatedAt':_0x1b2916['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3374f7,_0x514b51))[_0x08ab('0x41')](handleError(_0x3374f7,null));};exports[_0x08ab('0x5a')]=function(_0x40fb67,_0x7f8163,_0x1722d8){var _0xf1664d={};var _0x61ccc7={};var _0x2402c7;var _0x42aad6;return db['MailQueue'][_0x08ab('0x51')]({'where':{'id':_0x40fb67[_0x08ab('0x43')]['id']}})[_0x08ab('0x21')](handleEntityNotFound(_0x7f8163,null))[_0x08ab('0x21')](function(_0x33e820){if(_0x33e820){_0x2402c7=_0x33e820;_0x61ccc7[_0x08ab('0x2c')]=_[_0x08ab('0x2d')](db[_0x08ab('0x5b')]['rawAttributes']);_0x61ccc7['query']=_[_0x08ab('0x2d')](_0x40fb67[_0x08ab('0x2e')]);_0x61ccc7['filters']=_[_0x08ab('0x30')](_0x61ccc7[_0x08ab('0x2c')],_0x61ccc7[_0x08ab('0x2e')]);_0xf1664d['attributes']=_[_0x08ab('0x30')](_0x61ccc7[_0x08ab('0x2c')],qs[_0x08ab('0x32')](_0x40fb67[_0x08ab('0x2e')][_0x08ab('0x32')]));_0xf1664d[_0x08ab('0x31')]=_0xf1664d[_0x08ab('0x31')][_0x08ab('0x33')]?_0xf1664d[_0x08ab('0x31')]:_0x61ccc7[_0x08ab('0x2c')];_0xf1664d[_0x08ab('0x36')]=qs[_0x08ab('0x37')](_0x40fb67['query'][_0x08ab('0x37')]);_0xf1664d[_0x08ab('0x38')]=qs[_0x08ab('0x2f')](_[_0x08ab('0x53')](_0x40fb67['query'],_0x61ccc7['filters']));if(_0x40fb67[_0x08ab('0x2e')][_0x08ab('0x39')]){_0xf1664d['where']=_[_0x08ab('0x3a')](_0xf1664d[_0x08ab('0x38')],{'$or':_['map'](_0xf1664d['attributes'],function(_0x6cea10){var _0x1d9f5a={};_0x1d9f5a[_0x6cea10]={'$like':'%'+_0x40fb67[_0x08ab('0x2e')][_0x08ab('0x39')]+'%'};return _0x1d9f5a;})});}_0xf1664d=_[_0x08ab('0x3a')]({},_0xf1664d,_0x40fb67[_0x08ab('0x44')]);return _0x2402c7[_0x08ab('0x5a')](_0xf1664d);}})[_0x08ab('0x21')](function(_0x2b0d2c){if(_0x2b0d2c){_0x42aad6=_0x2b0d2c[_0x08ab('0x33')];if(!_0x40fb67[_0x08ab('0x2e')][_0x08ab('0x5c')](_0x08ab('0x34'))){_0xf1664d[_0x08ab('0x35')]=qs[_0x08ab('0x35')](_0x40fb67['query']['limit']);_0xf1664d[_0x08ab('0x1b')]=qs[_0x08ab('0x1b')](_0x40fb67[_0x08ab('0x2e')][_0x08ab('0x1b')]);}return _0x2402c7[_0x08ab('0x5a')](_0xf1664d);}})[_0x08ab('0x21')](function(_0x5aaf44){if(_0x5aaf44){return _0x5aaf44?{'count':_0x42aad6,'rows':_0x5aaf44}:null;}})[_0x08ab('0x21')](respondWithResult(_0x7f8163,null))['catch'](handleError(_0x7f8163,null));};exports['addTeams']=function(_0x426310,_0x52c786,_0x115cb1){var _0x2d3ea7=_0x426310[_0x08ab('0x46')][_0x08ab('0x5d')];return db[_0x08ab('0x5b')][_0x08ab('0x3f')]({'where':{'id':_['map'](_0x2d3ea7,'id')},'attributes':['id'],'include':[{'model':db[_0x08ab('0x5e')],'as':'Agents','attributes':['id','name',_0x08ab('0x5f'),_0x08ab('0x60'),_0x08ab('0x61')],'raw':!![]}]})[_0x08ab('0x21')](function(_0x45c967){if(_0x45c967){var _0x4b534c=_[_0x08ab('0x62')](_0x45c967,function(_0x7b8b){var _0x3a63e0=_0x7b8b[_0x08ab('0x22')]({'plain':!![]});return _0x3a63e0['Agents'];});return db['MailQueue']['find']({'where':{'id':_0x426310['params']['id']}})['then'](function(_0x1e5b20){return db[_0x08ab('0x63')]['transaction'](function(_0x1fc4ea){return _0x1e5b20[_0x08ab('0x64')](_[_0x08ab('0x55')](_0x2d3ea7,'id'),{'transaction':_0x1fc4ea})['then'](function(){return BPromise[_0x08ab('0x65')](_0x4b534c,function(_0xbaed6){return db['UserMailQueue'][_0x08ab('0x66')]({'where':{'UserId':_0xbaed6['id'],'MailQueueId':_0x426310[_0x08ab('0x43')]['id']},'transaction':_0x1fc4ea});});})['then'](function(){_0x4b534c['forEach'](function(_0x580e0c){socket[_0x08ab('0x67')](_0x08ab('0x68'),{'UserId':_0x580e0c['id'],'MailQueueId':_0x1e5b20['id']});});});});});}})[_0x08ab('0x21')](respondWithStatusCode(_0x52c786,null))[_0x08ab('0x41')](handleError(_0x52c786,null));};exports[_0x08ab('0x69')]=function(_0xd9c9f7,_0x54f8e3,_0x1f6eeb){return db[_0x08ab('0x5b')][_0x08ab('0x3f')]({'where':{'id':_0xd9c9f7[_0x08ab('0x2e')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x08ab('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x08ab('0x21')](handleEntityNotFound(_0x54f8e3,null))['then'](function(_0xa18161){var _0x13b104=_['map'](_0xa18161,'id');var _0x118570=[];var _0x2c941a=[];var _0x4b8b03=squel['select']();_0x4b8b03[_0x08ab('0x3d')]('tq.TeamId')['from'](_0x08ab('0x6b'),'tq')['join'](_0x08ab('0x6c'),'ut',_0x08ab('0x6d'))[_0x08ab('0x38')](_0x08ab('0x6e'),_0xd9c9f7['params']['id']);for(var _0x3a828e=0x0;_0x3a828e<_0xa18161[_0x08ab('0x33')];_0x3a828e+=0x1){let _0x17767c=_0xa18161[_0x3a828e];for(var _0x5aeb2c=0x0;_0x5aeb2c<_0x17767c['Agents'][_0x08ab('0x33')];_0x5aeb2c+=0x1){let _0x43eb98=_0x17767c[_0x08ab('0x6a')][_0x5aeb2c];var _0x269664=_0x4b8b03[_0x08ab('0x6f')]();_0x269664[_0x08ab('0x38')](_0x08ab('0x70'),_0x43eb98['id']);_0x2c941a[_0x08ab('0x71')](db[_0x08ab('0x63')][_0x08ab('0x2e')](_0x269664[_0x08ab('0x72')](),{'type':db[_0x08ab('0x63')]['QueryTypes'][_0x08ab('0x73')]})[_0x08ab('0x21')](function(_0xff6b5f){if(_0xff6b5f['length']===0x1){return _0x43eb98['id'];}else{var _0x5f0d7f=_[_0x08ab('0x74')](_[_0x08ab('0x55')](_0xff6b5f,_0x08ab('0x75')),function(_0x2913c1){return _['includes'](_0x13b104,_0x2913c1);});if(_0x5f0d7f){return _0x43eb98['id'];}}}));}}return BPromise['all'](_0x2c941a)[_0x08ab('0x21')](function(_0x36235d){_0x118570=_(_0x118570)['union'](_0x36235d)['compact']()[_0x08ab('0x76')]();return db[_0x08ab('0x2a')][_0x08ab('0x4b')]({'where':{'id':_0xd9c9f7[_0x08ab('0x43')]['id']}})[_0x08ab('0x21')](function(_0x4b858e){return db[_0x08ab('0x63')][_0x08ab('0x77')](function(_0x133b2e){return _0x4b858e[_0x08ab('0x69')](_0xd9c9f7[_0x08ab('0x2e')][_0x08ab('0x78')],{'transaction':_0x133b2e})['then'](function(){if(!_[_0x08ab('0x79')](_0x118570)){return _0x4b858e[_0x08ab('0x7a')](_0x118570,{'transaction':_0x133b2e});}})['then'](function(){_0x118570[_0x08ab('0x7b')](function(_0x4d775e){socket[_0x08ab('0x67')](_0x08ab('0x7c'),{'UserId':_0x4d775e,'MailQueueId':_0x4b858e['id']});});});});});});})['then'](respondWithStatusCode(_0x54f8e3,null))[_0x08ab('0x41')](handleError(_0x54f8e3,null));};exports['addAgents']=function(_0x87b05,_0xb80e2d,_0x4e6770){return db[_0x08ab('0x2a')][_0x08ab('0x4b')]({'where':{'id':_0x87b05[_0x08ab('0x43')]['id']}})[_0x08ab('0x21')](handleEntityNotFound(_0xb80e2d,null))[_0x08ab('0x21')](function(_0xe924fa){if(_0xe924fa){return _0xe924fa['addAgents'](_0x87b05[_0x08ab('0x46')][_0x08ab('0x78')],_['omit'](_0x87b05[_0x08ab('0x46')],[_0x08ab('0x78'),'id'])||{})[_0x08ab('0x7d')](function(_0x238f2a){for(var _0x153e5c=0x0;_0x153e5c<_0x87b05[_0x08ab('0x46')][_0x08ab('0x78')][_0x08ab('0x33')];_0x153e5c+=0x1){socket['emit'](_0x08ab('0x68'),{'UserId':_0x87b05['body'][_0x08ab('0x78')][_0x153e5c],'MailQueueId':_0x87b05[_0x08ab('0x43')]['id']});}return _0x238f2a;});}})['then'](respondWithResult(_0xb80e2d,null))[_0x08ab('0x41')](handleError(_0xb80e2d,null));};exports['removeAgents']=function(_0x5f58c2,_0x29dd51,_0x1cf10c){return db[_0x08ab('0x2a')]['find']({'where':{'id':_0x5f58c2[_0x08ab('0x43')]['id']}})[_0x08ab('0x21')](handleEntityNotFound(_0x29dd51,null))[_0x08ab('0x21')](function(_0x8c67b0){if(_0x8c67b0){return _0x8c67b0[_0x08ab('0x7a')](_0x5f58c2['query'][_0x08ab('0x78')])[_0x08ab('0x21')](function(){if(_[_0x08ab('0x7e')](_0x5f58c2[_0x08ab('0x2e')][_0x08ab('0x78')])){for(var _0x295663=0x0;_0x295663<_0x5f58c2[_0x08ab('0x2e')]['ids'][_0x08ab('0x33')];_0x295663+=0x1){socket[_0x08ab('0x67')](_0x08ab('0x7c'),{'UserId':Number(_0x5f58c2[_0x08ab('0x2e')][_0x08ab('0x78')][_0x295663]),'MailQueueId':Number(_0x5f58c2[_0x08ab('0x43')]['id'])});}}else{socket[_0x08ab('0x67')](_0x08ab('0x7c'),{'UserId':Number(_0x5f58c2['query']['ids']),'MailQueueId':Number(_0x5f58c2[_0x08ab('0x43')]['id'])});}});}})[_0x08ab('0x21')](respondWithStatusCode(_0x29dd51,null))['catch'](handleError(_0x29dd51,null));};exports[_0x08ab('0x7f')]=function(_0x571acb,_0x2a49e5,_0x405611){var _0x28b6e3={};var _0x2b7299={};var _0x4dbe60;var _0xb3fd75;return db['MailQueue'][_0x08ab('0x51')]({'where':{'id':_0x571acb[_0x08ab('0x43')]['id']}})[_0x08ab('0x21')](handleEntityNotFound(_0x2a49e5,null))[_0x08ab('0x21')](function(_0x54b38e){if(_0x54b38e){_0x4dbe60=_0x54b38e;_0x2b7299[_0x08ab('0x2c')]=_[_0x08ab('0x2d')](db['User']['rawAttributes']);_0x2b7299[_0x08ab('0x2e')]=_[_0x08ab('0x2d')](_0x571acb[_0x08ab('0x2e')]);_0x2b7299[_0x08ab('0x2f')]=_['intersection'](_0x2b7299[_0x08ab('0x2c')],_0x2b7299[_0x08ab('0x2e')]);_0x28b6e3['attributes']=_[_0x08ab('0x30')](_0x2b7299[_0x08ab('0x2c')],qs[_0x08ab('0x32')](_0x571acb[_0x08ab('0x2e')]['fields']));_0x28b6e3[_0x08ab('0x31')]=_0x28b6e3[_0x08ab('0x31')][_0x08ab('0x33')]?_0x28b6e3[_0x08ab('0x31')]:_0x2b7299[_0x08ab('0x2c')];_0x28b6e3[_0x08ab('0x36')]=qs['sort'](_0x571acb[_0x08ab('0x2e')][_0x08ab('0x37')]);_0x28b6e3[_0x08ab('0x38')]=qs[_0x08ab('0x2f')](_[_0x08ab('0x53')](_0x571acb[_0x08ab('0x2e')],_0x2b7299['filters']));if(_0x571acb[_0x08ab('0x2e')][_0x08ab('0x39')]){_0x28b6e3[_0x08ab('0x38')]=_['merge'](_0x28b6e3[_0x08ab('0x38')],{'$or':_[_0x08ab('0x55')](_0x28b6e3[_0x08ab('0x31')],function(_0xbc505){var _0x1184d2={};_0x1184d2[_0xbc505]={'$like':'%'+_0x571acb[_0x08ab('0x2e')][_0x08ab('0x39')]+'%'};return _0x1184d2;})});}_0x28b6e3=_[_0x08ab('0x3a')]({},_0x28b6e3,_0x571acb[_0x08ab('0x44')]);return _0x4dbe60[_0x08ab('0x7f')](_0x28b6e3);}})[_0x08ab('0x21')](function(_0x181994){if(_0x181994){_0xb3fd75=_0x181994['length'];if(!_0x571acb[_0x08ab('0x2e')][_0x08ab('0x5c')](_0x08ab('0x34'))){_0x28b6e3[_0x08ab('0x35')]=qs[_0x08ab('0x35')](_0x571acb[_0x08ab('0x2e')][_0x08ab('0x35')]);_0x28b6e3[_0x08ab('0x1b')]=qs[_0x08ab('0x1b')](_0x571acb[_0x08ab('0x2e')][_0x08ab('0x1b')]);}return _0x4dbe60[_0x08ab('0x7f')](_0x28b6e3);}})[_0x08ab('0x21')](function(_0x5395e3){if(_0x5395e3){return _0x5395e3?{'count':_0xb3fd75,'rows':_0x5395e3}:null;}})[_0x08ab('0x21')](respondWithResult(_0x2a49e5,null))['catch'](handleError(_0x2a49e5,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index a739ff3..c4897ff 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 _0x06d1=['update','remove','emit','hasOwnProperty','hook','exports','setMaxListeners'];(function(_0x165ece,_0x1f0a42){var _0x545fe6=function(_0x1ac8e9){while(--_0x1ac8e9){_0x165ece['push'](_0x165ece['shift']());}};_0x545fe6(++_0x1f0a42);}(_0x06d1,0x125));var _0x106d=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x06d1[_0x8c43de];return _0xa6591b;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x106d('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0x106d('0x1'),'afterDestroy':_0x106d('0x2')};function emitEvent(_0x4606ce){return function(_0x27ed28,_0x45ac95,_0x41a6ce){MailQueueEvents[_0x106d('0x3')](_0x4606ce+':'+_0x27ed28['id'],_0x27ed28);MailQueueEvents[_0x106d('0x3')](_0x4606ce,_0x27ed28);_0x41a6ce(null);};}for(var e in events){if(events[_0x106d('0x4')](e)){var event=events[e];MailQueue[_0x106d('0x5')](e,emitEvent(event));}}module[_0x106d('0x6')]=MailQueueEvents; \ No newline at end of file +var _0x656c=['exports','events','../../mysqldb','MailQueue','save','update','remove','emit','hasOwnProperty','hook'];(function(_0xb7c25f,_0x517318){var _0x350089=function(_0x54eadb){while(--_0x54eadb){_0xb7c25f['push'](_0xb7c25f['shift']());}};_0x350089(++_0x517318);}(_0x656c,0x83));var _0xc656=function(_0x584942,_0x49218b){_0x584942=_0x584942-0x0;var _0x417ff7=_0x656c[_0x584942];return _0x417ff7;};'use strict';var EventEmitter=require(_0xc656('0x0'));var MailQueue=require(_0xc656('0x1'))['db'][_0xc656('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc656('0x3'),'afterUpdate':_0xc656('0x4'),'afterDestroy':_0xc656('0x5')};function emitEvent(_0x422415){return function(_0x2dfaae,_0x31e639,_0x1d5e55){MailQueueEvents[_0xc656('0x6')](_0x422415+':'+_0x2dfaae['id'],_0x2dfaae);MailQueueEvents[_0xc656('0x6')](_0x422415,_0x2dfaae);_0x1d5e55(null);};}for(var e in events){if(events[_0xc656('0x7')](e)){var event=events[e];MailQueue[_0xc656('0x8')](e,emitEvent(event));}}module[_0xc656('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 131e9a6..738d99e 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 _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','../../config/logger','api'];(function(_0x5736fe,_0x2830ee){var _0x123756=function(_0x1107cd){while(--_0x1107cd){_0x5736fe['push'](_0x5736fe['shift']());}};_0x123756(++_0x2830ee);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['mail_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./mailQueue.attributes'];(function(_0x50f42c,_0x184ebc){var _0x1eb7ff=function(_0xd560da){while(--_0xd560da){_0x50f42c['push'](_0x50f42c['shift']());}};_0x1eb7ff(++_0x184ebc);}(_0x70e0,0x17b));var _0x070e=function(_0x12c206,_0x80cc93){_0x12c206=_0x12c206-0x0;var _0x484483=_0x70e0[_0x12c206];return _0x484483;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('MailQueue',attributes,{'tableName':_0x070e('0x8'),'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 41a60b6..e1c47d1 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 _0xc465=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailQueue','MailQueue','findAll','options','raw','limit','include','model','attributes','map','ShowMailQueue','find','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x468e71,_0x171468){var _0x2c9045=function(_0x3607c1){while(--_0x3607c1){_0x468e71['push'](_0x468e71['shift']());}};_0x2c9045(++_0x171468);}(_0xc465,0x15a));var _0x5c46=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xc465[_0x178e48];return _0x440d7e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5c46('0x0'));var BPromise=require('bluebird');var rs=require(_0x5c46('0x1'));var fs=require('fs');var Redis=require(_0x5c46('0x2'));var db=require(_0x5c46('0x3'))['db'];var utils=require(_0x5c46('0x4'));var logger=require(_0x5c46('0x5'))(_0x5c46('0x6'));var config=require(_0x5c46('0x7'));var jayson=require(_0x5c46('0x8'));var client=jayson['client'][_0x5c46('0x9')]({'port':0x232a});config[_0x5c46('0xa')]=_[_0x5c46('0xb')](config['redis'],{'host':_0x5c46('0xc'),'port':0x18eb});var socket=require(_0x5c46('0xd'))(new Redis(config['redis']));require('./mailQueue.socket')[_0x5c46('0xe')](socket);function respondWithRpcPromise(_0x33b6e8,_0x3cc325,_0x1fa3dd){return new BPromise(function(_0x1c20dc,_0x142c67){return client[_0x5c46('0xf')](_0x33b6e8,_0x1fa3dd)[_0x5c46('0x10')](function(_0x117e3e){logger[_0x5c46('0x11')](_0x5c46('0x12'),_0x3cc325,_0x5c46('0x13'));logger[_0x5c46('0x14')](_0x5c46('0x15'),_0x3cc325,_0x5c46('0x13'),JSON[_0x5c46('0x16')](_0x117e3e));if(_0x117e3e[_0x5c46('0x17')]){if(_0x117e3e[_0x5c46('0x17')][_0x5c46('0x18')]===0x1f4){logger[_0x5c46('0x17')]('MailQueue,\x20%s,\x20%s',_0x3cc325,_0x117e3e[_0x5c46('0x17')]['message']);return _0x142c67(_0x117e3e[_0x5c46('0x17')][_0x5c46('0x19')]);}logger[_0x5c46('0x17')](_0x5c46('0x12'),_0x3cc325,_0x117e3e['error'][_0x5c46('0x19')]);return _0x1c20dc(_0x117e3e[_0x5c46('0x17')][_0x5c46('0x19')]);}else{logger[_0x5c46('0x11')](_0x5c46('0x12'),_0x3cc325,_0x5c46('0x13'));_0x1c20dc(_0x117e3e['result'][_0x5c46('0x19')]);}})[_0x5c46('0x1a')](function(_0x5f3cbd){logger[_0x5c46('0x17')]('MailQueue,\x20%s,\x20%s',_0x3cc325,_0x5f3cbd);_0x142c67(_0x5f3cbd);});});}exports[_0x5c46('0x1b')]=function(_0x1dd25d){var _0x1305a8=this;return new Promise(function(_0x556e4d,_0x24cde8){return db[_0x5c46('0x1c')][_0x5c46('0x1d')]({'raw':_0x1dd25d[_0x5c46('0x1e')]?_0x1dd25d[_0x5c46('0x1e')][_0x5c46('0x1f')]===undefined?!![]:![]:!![],'where':_0x1dd25d[_0x5c46('0x1e')]?_0x1dd25d[_0x5c46('0x1e')]['where']||null:null,'attributes':_0x1dd25d[_0x5c46('0x1e')]?_0x1dd25d[_0x5c46('0x1e')]['attributes']||null:null,'limit':_0x1dd25d['options']?_0x1dd25d[_0x5c46('0x1e')][_0x5c46('0x20')]||null:null,'include':_0x1dd25d[_0x5c46('0x1e')]?_0x1dd25d['options'][_0x5c46('0x21')]?_['map'](_0x1dd25d[_0x5c46('0x1e')][_0x5c46('0x21')],function(_0xb1b145){return{'model':db[_0xb1b145[_0x5c46('0x22')]],'as':_0xb1b145['as'],'attributes':_0xb1b145[_0x5c46('0x23')],'include':_0xb1b145[_0x5c46('0x21')]?_[_0x5c46('0x24')](_0xb1b145['include'],function(_0x9b2d66){return{'model':db[_0x9b2d66[_0x5c46('0x22')]],'as':_0x9b2d66['as'],'attributes':_0x9b2d66[_0x5c46('0x23')],'include':_0x9b2d66['include']?_[_0x5c46('0x24')](_0x9b2d66[_0x5c46('0x21')],function(_0x563dd1){return{'model':db[_0x563dd1[_0x5c46('0x22')]],'as':_0x563dd1['as'],'attributes':_0x563dd1[_0x5c46('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x357822){logger['info'](_0x5c46('0x1b'),_0x1dd25d);logger[_0x5c46('0x14')](_0x5c46('0x1b'),_0x1dd25d,JSON['stringify'](_0x357822));_0x556e4d(_0x357822);})[_0x5c46('0x1a')](function(_0x461119){logger[_0x5c46('0x17')](_0x5c46('0x1b'),_0x461119[_0x5c46('0x19')],_0x1dd25d);_0x24cde8(_0x1305a8[_0x5c46('0x17')](0x1f4,_0x461119[_0x5c46('0x19')]));});});};exports[_0x5c46('0x25')]=function(_0x88627c){var _0x451a2f=this;return new Promise(function(_0x430652,_0x505859){return db[_0x5c46('0x1c')][_0x5c46('0x26')]({'raw':_0x88627c[_0x5c46('0x1e')]?_0x88627c[_0x5c46('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x88627c[_0x5c46('0x1e')]?_0x88627c['options']['where']||null:null,'attributes':_0x88627c[_0x5c46('0x1e')]?_0x88627c[_0x5c46('0x1e')][_0x5c46('0x23')]||null:null,'include':_0x88627c[_0x5c46('0x1e')]?_0x88627c[_0x5c46('0x1e')]['include']?_[_0x5c46('0x24')](_0x88627c[_0x5c46('0x1e')][_0x5c46('0x21')],function(_0x31af89){return{'model':db[_0x31af89[_0x5c46('0x22')]],'as':_0x31af89['as'],'attributes':_0x31af89[_0x5c46('0x23')],'include':_0x31af89['include']?_[_0x5c46('0x24')](_0x31af89['include'],function(_0x2e9ceb){return{'model':db[_0x2e9ceb['model']],'as':_0x2e9ceb['as'],'attributes':_0x2e9ceb[_0x5c46('0x23')],'include':_0x2e9ceb[_0x5c46('0x21')]?_[_0x5c46('0x24')](_0x2e9ceb[_0x5c46('0x21')],function(_0x2614b0){return{'model':db[_0x2614b0['model']],'as':_0x2614b0['as'],'attributes':_0x2614b0['attributes']};}):[]};}):[]};}):[]:[]})[_0x5c46('0x10')](function(_0x168eb0){logger[_0x5c46('0x11')](_0x5c46('0x25'),_0x88627c);logger[_0x5c46('0x14')](_0x5c46('0x25'),_0x88627c,JSON[_0x5c46('0x16')](_0x168eb0));_0x430652(_0x168eb0);})[_0x5c46('0x1a')](function(_0x3dc157){logger['error'](_0x5c46('0x25'),_0x3dc157[_0x5c46('0x19')],_0x88627c);_0x505859(_0x451a2f[_0x5c46('0x17')](0x1f4,_0x3dc157[_0x5c46('0x19')]));});});}; \ No newline at end of file +var _0x78c0=['include','map','model','attributes','info','GetMailQueue','debug','ShowMailQueue','find','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','MailQueue','findAll','options','raw','limit'];(function(_0x20ab32,_0x4c3da2){var _0x276bec=function(_0x50bd3e){while(--_0x50bd3e){_0x20ab32['push'](_0x20ab32['shift']());}};_0x276bec(++_0x4c3da2);}(_0x78c0,0x1b7));var _0x078c=function(_0x3451f6,_0x42c5ae){_0x3451f6=_0x3451f6-0x0;var _0x3d78db=_0x78c0[_0x3451f6];return _0x3d78db;};'use strict';var _=require(_0x078c('0x0'));var util=require(_0x078c('0x1'));var moment=require(_0x078c('0x2'));var BPromise=require(_0x078c('0x3'));var rs=require(_0x078c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x078c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x078c('0x6'))('rpc');var config=require(_0x078c('0x7'));var jayson=require(_0x078c('0x8'));var client=jayson['client'][_0x078c('0x9')]({'port':0x232a});config[_0x078c('0xa')]=_[_0x078c('0xb')](config[_0x078c('0xa')],{'host':_0x078c('0xc'),'port':0x18eb});var socket=require(_0x078c('0xd'))(new Redis(config[_0x078c('0xa')]));require('./mailQueue.socket')[_0x078c('0xe')](socket);function respondWithRpcPromise(_0x53fe80,_0x411d49,_0x22018d){return new BPromise(function(_0x547005,_0x2bd80d){return client[_0x078c('0xf')](_0x53fe80,_0x22018d)[_0x078c('0x10')](function(_0x12137a){logger['info'](_0x078c('0x11'),_0x411d49,'request\x20sent');logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x411d49,_0x078c('0x12'),JSON[_0x078c('0x13')](_0x12137a));if(_0x12137a[_0x078c('0x14')]){if(_0x12137a[_0x078c('0x14')]['code']===0x1f4){logger[_0x078c('0x14')](_0x078c('0x11'),_0x411d49,_0x12137a[_0x078c('0x14')]['message']);return _0x2bd80d(_0x12137a[_0x078c('0x14')][_0x078c('0x15')]);}logger[_0x078c('0x14')](_0x078c('0x11'),_0x411d49,_0x12137a[_0x078c('0x14')][_0x078c('0x15')]);return _0x547005(_0x12137a[_0x078c('0x14')][_0x078c('0x15')]);}else{logger['info'](_0x078c('0x11'),_0x411d49,'request\x20sent');_0x547005(_0x12137a[_0x078c('0x16')][_0x078c('0x15')]);}})[_0x078c('0x17')](function(_0x25d701){logger[_0x078c('0x14')](_0x078c('0x11'),_0x411d49,_0x25d701);_0x2bd80d(_0x25d701);});});}exports['GetMailQueue']=function(_0xfd8c0a){var _0x1739b4=this;return new Promise(function(_0x23c429,_0x2cc0d2){return db[_0x078c('0x18')][_0x078c('0x19')]({'raw':_0xfd8c0a[_0x078c('0x1a')]?_0xfd8c0a[_0x078c('0x1a')][_0x078c('0x1b')]===undefined?!![]:![]:!![],'where':_0xfd8c0a[_0x078c('0x1a')]?_0xfd8c0a[_0x078c('0x1a')]['where']||null:null,'attributes':_0xfd8c0a[_0x078c('0x1a')]?_0xfd8c0a[_0x078c('0x1a')]['attributes']||null:null,'limit':_0xfd8c0a[_0x078c('0x1a')]?_0xfd8c0a[_0x078c('0x1a')][_0x078c('0x1c')]||null:null,'include':_0xfd8c0a[_0x078c('0x1a')]?_0xfd8c0a['options'][_0x078c('0x1d')]?_[_0x078c('0x1e')](_0xfd8c0a[_0x078c('0x1a')]['include'],function(_0x172f3b){return{'model':db[_0x172f3b['model']],'as':_0x172f3b['as'],'attributes':_0x172f3b['attributes'],'include':_0x172f3b[_0x078c('0x1d')]?_['map'](_0x172f3b[_0x078c('0x1d')],function(_0x4ed9b7){return{'model':db[_0x4ed9b7[_0x078c('0x1f')]],'as':_0x4ed9b7['as'],'attributes':_0x4ed9b7[_0x078c('0x20')],'include':_0x4ed9b7[_0x078c('0x1d')]?_[_0x078c('0x1e')](_0x4ed9b7['include'],function(_0x8c25c){return{'model':db[_0x8c25c[_0x078c('0x1f')]],'as':_0x8c25c['as'],'attributes':_0x8c25c[_0x078c('0x20')]};}):[]};}):[]};}):[]:[]})[_0x078c('0x10')](function(_0x4b5b93){logger[_0x078c('0x21')](_0x078c('0x22'),_0xfd8c0a);logger[_0x078c('0x23')](_0x078c('0x22'),_0xfd8c0a,JSON['stringify'](_0x4b5b93));_0x23c429(_0x4b5b93);})[_0x078c('0x17')](function(_0x31675a){logger[_0x078c('0x14')]('GetMailQueue',_0x31675a['message'],_0xfd8c0a);_0x2cc0d2(_0x1739b4['error'](0x1f4,_0x31675a[_0x078c('0x15')]));});});};exports[_0x078c('0x24')]=function(_0x419ac9){var _0xa031af=this;return new Promise(function(_0xf0a06,_0x28f51d){return db['MailQueue'][_0x078c('0x25')]({'raw':_0x419ac9[_0x078c('0x1a')]?_0x419ac9[_0x078c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x419ac9[_0x078c('0x1a')]?_0x419ac9[_0x078c('0x1a')][_0x078c('0x26')]||null:null,'attributes':_0x419ac9[_0x078c('0x1a')]?_0x419ac9[_0x078c('0x1a')]['attributes']||null:null,'include':_0x419ac9[_0x078c('0x1a')]?_0x419ac9[_0x078c('0x1a')][_0x078c('0x1d')]?_[_0x078c('0x1e')](_0x419ac9[_0x078c('0x1a')][_0x078c('0x1d')],function(_0x5bd89e){return{'model':db[_0x5bd89e[_0x078c('0x1f')]],'as':_0x5bd89e['as'],'attributes':_0x5bd89e[_0x078c('0x20')],'include':_0x5bd89e[_0x078c('0x1d')]?_[_0x078c('0x1e')](_0x5bd89e[_0x078c('0x1d')],function(_0x3ffd3d){return{'model':db[_0x3ffd3d[_0x078c('0x1f')]],'as':_0x3ffd3d['as'],'attributes':_0x3ffd3d['attributes'],'include':_0x3ffd3d[_0x078c('0x1d')]?_['map'](_0x3ffd3d[_0x078c('0x1d')],function(_0x11b287){return{'model':db[_0x11b287[_0x078c('0x1f')]],'as':_0x11b287['as'],'attributes':_0x11b287[_0x078c('0x20')]};}):[]};}):[]};}):[]:[]})[_0x078c('0x10')](function(_0x3185c1){logger[_0x078c('0x21')](_0x078c('0x24'),_0x419ac9);logger[_0x078c('0x23')](_0x078c('0x24'),_0x419ac9,JSON[_0x078c('0x13')](_0x3185c1));_0xf0a06(_0x3185c1);})[_0x078c('0x17')](function(_0x3bfdf0){logger['error'](_0x078c('0x24'),_0x3bfdf0[_0x078c('0x15')],_0x419ac9);_0x28f51d(_0xa031af[_0x078c('0x14')](0x1f4,_0x3bfdf0[_0x078c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 77bde87..794b98c 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 _0xaf6e=['./mailQueue.events','save','remove','update','emit','register','length','mailQueue:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf6e,0xf0));var _0xeaf6=function(_0x33eaaa,_0x2ccea5){_0x33eaaa=_0x33eaaa-0x0;var _0xe148e9=_0xaf6e[_0x33eaaa];return _0xe148e9;};'use strict';var MailQueueEvents=require(_0xeaf6('0x0'));var events=[_0xeaf6('0x1'),_0xeaf6('0x2'),_0xeaf6('0x3')];function createListener(_0x1e42e8,_0x47f8bb){return function(_0x349b87){_0x47f8bb[_0xeaf6('0x4')](_0x1e42e8,_0x349b87);};}function removeListener(_0x4230b6,_0x793d81){return function(){MailQueueEvents['removeListener'](_0x4230b6,_0x793d81);};}exports[_0xeaf6('0x5')]=function(_0x4511a9){for(var _0xe3e9f8=0x0,_0x3f169f=events[_0xeaf6('0x6')];_0xe3e9f8<_0x3f169f;_0xe3e9f8++){var _0x3752d5=events[_0xe3e9f8];var _0x575c82=createListener(_0xeaf6('0x7')+_0x3752d5,_0x4511a9);MailQueueEvents['on'](_0x3752d5,_0x575c82);}}; \ No newline at end of file +var _0x8bee=['update','emit','register','mailQueue:','./mailQueue.events','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8bee,0x100));var _0xe8be=function(_0x1a12a7,_0x2a6cdf){_0x1a12a7=_0x1a12a7-0x0;var _0x52ca1c=_0x8bee[_0x1a12a7];return _0x52ca1c;};'use strict';var MailQueueEvents=require(_0xe8be('0x0'));var events=['save',_0xe8be('0x1'),_0xe8be('0x2')];function createListener(_0x5cb0af,_0x4d9283){return function(_0x45258f){_0x4d9283[_0xe8be('0x3')](_0x5cb0af,_0x45258f);};}function removeListener(_0x3f9ad9,_0x56020f){return function(){MailQueueEvents['removeListener'](_0x3f9ad9,_0x56020f);};}exports[_0xe8be('0x4')]=function(_0x1b8d45){for(var _0x4cb0cb=0x0,_0x14aabf=events['length'];_0x4cb0cb<_0x14aabf;_0x4cb0cb++){var _0x685893=events[_0x4cb0cb];var _0x541174=createListener(_0xe8be('0x5')+_0x685893,_0x1b8d45);MailQueueEvents['on'](_0x685893,_0x541174);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 638c4df..1093c2b 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 _0x626e=['get','isAuthenticated','/describe','describe','/:id','post','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3a102f,_0x3e2a93){var _0x5a50f5=function(_0x3f1445){while(--_0x3f1445){_0x3a102f['push'](_0x3a102f['shift']());}};_0x5a50f5(++_0x3e2a93);}(_0x626e,0x9a));var _0xe626=function(_0x52c29a,_0x84ee1d){_0x52c29a=_0x52c29a-0x0;var _0x213bf1=_0x626e[_0x52c29a];return _0x213bf1;};'use strict';var multer=require(_0xe626('0x0'));var util=require(_0xe626('0x1'));var path=require('path');var timeout=require(_0xe626('0x2'));var express=require(_0xe626('0x3'));var router=express[_0xe626('0x4')]();var auth=require(_0xe626('0x5'));var interaction=require(_0xe626('0x6'));var config=require(_0xe626('0x7'));var controller=require('./mailQueueReport.controller');router[_0xe626('0x8')]('/',auth[_0xe626('0x9')](),controller['index']);router[_0xe626('0x8')](_0xe626('0xa'),auth['isAuthenticated'](),controller[_0xe626('0xb')]);router[_0xe626('0x8')](_0xe626('0xc'),auth[_0xe626('0x9')](),controller['show']);router[_0xe626('0xd')]('/',auth[_0xe626('0x9')](),controller['create']);router[_0xe626('0xe')](_0xe626('0xc'),auth[_0xe626('0x9')](),controller[_0xe626('0xf')]);router['delete']('/:id',auth[_0xe626('0x9')](),controller[_0xe626('0x10')]);module[_0xe626('0x11')]=router; \ No newline at end of file +var _0xa9af=['../../config/environment','./mailQueueReport.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x6c0123,_0x4c8d3b){var _0x5a87d2=function(_0x1ff614){while(--_0x1ff614){_0x6c0123['push'](_0x6c0123['shift']());}};_0x5a87d2(++_0x4c8d3b);}(_0xa9af,0xae));var _0xfa9a=function(_0x4436c1,_0x4e15a7){_0x4436c1=_0x4436c1-0x0;var _0x2ae479=_0xa9af[_0x4436c1];return _0x2ae479;};'use strict';var multer=require(_0xfa9a('0x0'));var util=require(_0xfa9a('0x1'));var path=require(_0xfa9a('0x2'));var timeout=require(_0xfa9a('0x3'));var express=require(_0xfa9a('0x4'));var router=express[_0xfa9a('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfa9a('0x6'));var controller=require(_0xfa9a('0x7'));router['get']('/',auth[_0xfa9a('0x8')](),controller[_0xfa9a('0x9')]);router[_0xfa9a('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xfa9a('0xb'),auth['isAuthenticated'](),controller[_0xfa9a('0xc')]);router[_0xfa9a('0xd')]('/',auth[_0xfa9a('0x8')](),controller[_0xfa9a('0xe')]);router[_0xfa9a('0xf')]('/:id',auth[_0xfa9a('0x8')](),controller[_0xfa9a('0x10')]);router['delete'](_0xfa9a('0xb'),auth[_0xfa9a('0x8')](),controller[_0xfa9a('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index eff5f1b..c0e6a9c 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 _0x77a7=['sequelize','exports','DATE','STRING'];(function(_0x545b71,_0x4f44eb){var _0x26e587=function(_0x293b81){while(--_0x293b81){_0x545b71['push'](_0x545b71['shift']());}};_0x26e587(++_0x4f44eb);}(_0x77a7,0x1dc));var _0x777a=function(_0x2c0214,_0x1cf6c1){_0x2c0214=_0x2c0214-0x0;var _0x49640d=_0x77a7[_0x2c0214];return _0x49640d;};'use strict';var moment=require('moment');var Sequelize=require(_0x777a('0x0'));module[_0x777a('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x777a('0x2')]},'leaveAt':{'type':Sequelize[_0x777a('0x2')]},'acceptAt':{'type':Sequelize[_0x777a('0x2')]},'exitAt':{'type':Sequelize[_0x777a('0x2')]},'reason':{'type':Sequelize[_0x777a('0x3')]}}; \ No newline at end of file +var _0x354b=['STRING','DATE','sequelize','exports'];(function(_0x153fef,_0x3e99aa){var _0x1d97d4=function(_0x2293bb){while(--_0x2293bb){_0x153fef['push'](_0x153fef['shift']());}};_0x1d97d4(++_0x3e99aa);}(_0x354b,0x6e));var _0xb354=function(_0x1a3326,_0x26c35a){_0x1a3326=_0x1a3326-0x0;var _0x1895a3=_0x354b[_0x1a3326];return _0x1895a3;};'use strict';var moment=require('moment');var Sequelize=require(_0xb354('0x0'));module[_0xb354('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xb354('0x2')]},'joinAt':{'type':Sequelize[_0xb354('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xb354('0x3')]},'reason':{'type':Sequelize[_0xb354('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 3be395b..3893e2f 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 _0x842e=['../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','error','name','index','MailQueueReport','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','include','findAll','rows','params','includeAll','find','create','body','catch','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','api'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x842e,0x104));var _0xe842=function(_0x2bf466,_0x4929a5){_0x2bf466=_0x2bf466-0x0;var _0x856885=_0x842e[_0x2bf466];return _0x856885;};'use strict';var pdf=require(_0xe842('0x0'));var emlformat=require(_0xe842('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe842('0x2'));var jsonpatch=require(_0xe842('0x3'));var rp=require(_0xe842('0x4'));var moment=require(_0xe842('0x5'));var BPromise=require(_0xe842('0x6'));var Mustache=require(_0xe842('0x7'));var util=require('util');var path=require(_0xe842('0x8'));var sox=require(_0xe842('0x9'));var csv=require(_0xe842('0xa'));var ejs=require(_0xe842('0xb'));var fs=require('fs');var _=require(_0xe842('0xc'));var squel=require(_0xe842('0xd'));var crypto=require('crypto');var jsforce=require(_0xe842('0xe'));var deskjs=require(_0xe842('0xf'));var toCsv=require(_0xe842('0xa'));var querystring=require('querystring');var Papa=require(_0xe842('0x10'));var Redis=require(_0xe842('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe842('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe842('0x13'));var utils=require('../../config/utils');var config=require(_0xe842('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28096f,_0x53473e){_0x53473e=_0x53473e||0xcc;return function(_0x485de2){if(_0x485de2){return _0x28096f[_0xe842('0x15')](_0x53473e);}return _0x28096f[_0xe842('0x16')](_0x53473e)[_0xe842('0x17')]();};}function respondWithResult(_0x6aea5c,_0x15ab20){_0x15ab20=_0x15ab20||0xc8;return function(_0x55bbec){if(_0x55bbec){return _0x6aea5c[_0xe842('0x16')](_0x15ab20)[_0xe842('0x18')](_0x55bbec);}};}function respondWithFilteredResult(_0x16f8b2,_0x4a4cd9){return function(_0x2b1324){if(_0x2b1324){var _0x10c780=_0x2b1324[_0xe842('0x19')],_0x184832=_0x4a4cd9[_0xe842('0x1a')],_0x59d4c7=_0x4a4cd9[_0xe842('0x1a')]+_0x4a4cd9[_0xe842('0x1b')],_0x2aef88;if(_0x59d4c7>=_0x10c780){_0x59d4c7=_0x10c780;_0x2aef88=0xc8;}else{_0x2aef88=0xce;}_0x16f8b2['status'](_0x2aef88);return _0x16f8b2['set'](_0xe842('0x1c'),_0x184832+'-'+_0x59d4c7+'/'+_0x10c780)[_0xe842('0x18')](_0x2b1324);}return null;};}function patchUpdates(_0x549cbc){return function(_0x3e8f1d){try{jsonpatch[_0xe842('0x1d')](_0x3e8f1d,_0x549cbc,!![]);}catch(_0x4ad945){return BPromise['reject'](_0x4ad945);}return _0x3e8f1d[_0xe842('0x1e')]();};}function saveUpdates(_0x586bcf,_0x463f7a){return function(_0x2d8f3f){if(_0x2d8f3f){return _0x2d8f3f[_0xe842('0x1f')](_0x586bcf)[_0xe842('0x20')](function(_0xf14f87){return _0xf14f87;});}return null;};}function removeEntity(_0x163bb0,_0x2e3ab1){return function(_0x4f74b8){if(_0x4f74b8){return _0x4f74b8[_0xe842('0x21')]()['then'](function(){_0x163bb0['status'](0xcc)[_0xe842('0x17')]();});}};}function handleEntityNotFound(_0x2e2da9,_0x57c43e){return function(_0x1bc0f7){if(!_0x1bc0f7){_0x2e2da9['sendStatus'](0x194);}return _0x1bc0f7;};}function handleError(_0x11b890,_0x1b26ee){_0x1b26ee=_0x1b26ee||0x1f4;return function(_0x40353f){logger[_0xe842('0x22')](_0x40353f['stack']);if(_0x40353f[_0xe842('0x23')]){delete _0x40353f['name'];}_0x11b890[_0xe842('0x16')](_0x1b26ee)['send'](_0x40353f);};}exports[_0xe842('0x24')]=function(_0x3284d1,_0x3b55b5){var _0x1b5826={},_0x4ca79a={},_0x1195dd={'count':0x0,'rows':[]};var _0xc72364=db[_0xe842('0x25')][_0xe842('0x26')];_0x4ca79a['model']=_[_0xe842('0x27')](_0xc72364);_0x4ca79a[_0xe842('0x28')]=_[_0xe842('0x27')](_0x3284d1[_0xe842('0x28')]);_0x4ca79a[_0xe842('0x29')]=_[_0xe842('0x2a')](_0x4ca79a[_0xe842('0x2b')],_0x4ca79a[_0xe842('0x28')]);_0x1b5826[_0xe842('0x2c')]=_[_0xe842('0x2a')](_0x4ca79a[_0xe842('0x2b')],qs[_0xe842('0x2d')](_0x3284d1[_0xe842('0x28')][_0xe842('0x2d')]));_0x1b5826[_0xe842('0x2c')]=_0x1b5826[_0xe842('0x2c')][_0xe842('0x2e')]?_0x1b5826[_0xe842('0x2c')]:_0x4ca79a[_0xe842('0x2b')];if(!_0x3284d1[_0xe842('0x28')][_0xe842('0x2f')](_0xe842('0x30'))){_0x1b5826['limit']=qs[_0xe842('0x1b')](_0x3284d1[_0xe842('0x28')][_0xe842('0x1b')]);_0x1b5826[_0xe842('0x1a')]=qs[_0xe842('0x1a')](_0x3284d1[_0xe842('0x28')][_0xe842('0x1a')]);}_0x1b5826['order']=qs[_0xe842('0x31')](_0x3284d1['query']['sort']);_0x1b5826[_0xe842('0x32')]=qs['filters'](_[_0xe842('0x33')](_0x3284d1[_0xe842('0x28')],_0x4ca79a[_0xe842('0x29')]));if(_0x3284d1['query']['filter']){_0x1b5826[_0xe842('0x32')]=_[_0xe842('0x34')](_0x1b5826[_0xe842('0x32')],{'$or':_[_0xe842('0x35')](_0xc72364,function(_0x48e357){if(_0x48e357[_0xe842('0x36')][_0xe842('0x37')]!==_0xe842('0x38')){var _0x517735={};_0x517735[_0x48e357[_0xe842('0x39')]]={'$like':'%'+_0x3284d1['query'][_0xe842('0x3a')]+'%'};return _0x517735;}})});}_0x1b5826=_[_0xe842('0x34')]({},_0x1b5826,_0x3284d1[_0xe842('0x3b')]);var _0x4d4b12={'where':_0x1b5826[_0xe842('0x32')]};return db['MailQueueReport'][_0xe842('0x19')](_0x4d4b12)[_0xe842('0x20')](function(_0x2926cb){_0x1195dd[_0xe842('0x19')]=_0x2926cb;if(_0x3284d1['query']['includeAll']){_0x1b5826[_0xe842('0x3c')]=[{'all':!![]}];}return db[_0xe842('0x25')][_0xe842('0x3d')](_0x1b5826);})[_0xe842('0x20')](function(_0x1ae3f6){_0x1195dd[_0xe842('0x3e')]=_0x1ae3f6;return _0x1195dd;})['then'](respondWithFilteredResult(_0x3b55b5,_0x1b5826))['catch'](handleError(_0x3b55b5,null));};exports['show']=function(_0x41d268,_0x2785fc){var _0x3ed92a={'raw':!![],'where':{'id':_0x41d268[_0xe842('0x3f')]['id']}},_0x1d2a89={};_0x1d2a89[_0xe842('0x2b')]=_[_0xe842('0x27')](db[_0xe842('0x25')][_0xe842('0x26')]);_0x1d2a89[_0xe842('0x28')]=_[_0xe842('0x27')](_0x41d268[_0xe842('0x28')]);_0x1d2a89['filters']=_[_0xe842('0x2a')](_0x1d2a89[_0xe842('0x2b')],_0x1d2a89[_0xe842('0x28')]);_0x3ed92a[_0xe842('0x2c')]=_[_0xe842('0x2a')](_0x1d2a89['model'],qs[_0xe842('0x2d')](_0x41d268['query'][_0xe842('0x2d')]));_0x3ed92a[_0xe842('0x2c')]=_0x3ed92a[_0xe842('0x2c')][_0xe842('0x2e')]?_0x3ed92a[_0xe842('0x2c')]:_0x1d2a89[_0xe842('0x2b')];if(_0x41d268[_0xe842('0x28')][_0xe842('0x40')]){_0x3ed92a['include']=[{'all':!![]}];}_0x3ed92a=_[_0xe842('0x34')]({},_0x3ed92a,_0x41d268['options']);return db[_0xe842('0x25')][_0xe842('0x41')](_0x3ed92a)[_0xe842('0x20')](handleEntityNotFound(_0x2785fc,null))[_0xe842('0x20')](respondWithResult(_0x2785fc,null))['catch'](handleError(_0x2785fc,null));};exports[_0xe842('0x42')]=function(_0x44382b,_0x4c18c3){return db[_0xe842('0x25')][_0xe842('0x42')](_0x44382b[_0xe842('0x43')],{})[_0xe842('0x20')](respondWithResult(_0x4c18c3,0xc9))[_0xe842('0x44')](handleError(_0x4c18c3,null));};exports['update']=function(_0x4aeff2,_0x326dfc){if(_0x4aeff2['body']['id']){delete _0x4aeff2[_0xe842('0x43')]['id'];}return db[_0xe842('0x25')][_0xe842('0x41')]({'where':{'id':_0x4aeff2[_0xe842('0x3f')]['id']}})[_0xe842('0x20')](handleEntityNotFound(_0x326dfc,null))[_0xe842('0x20')](saveUpdates(_0x4aeff2[_0xe842('0x43')],null))[_0xe842('0x20')](respondWithResult(_0x326dfc,null))[_0xe842('0x44')](handleError(_0x326dfc,null));};exports['destroy']=function(_0x52c66c,_0x27ecd0){return db[_0xe842('0x25')]['find']({'where':{'id':_0x52c66c[_0xe842('0x3f')]['id']}})[_0xe842('0x20')](handleEntityNotFound(_0x27ecd0,null))['then'](removeEntity(_0x27ecd0,null))[_0xe842('0x44')](handleError(_0x27ecd0,null));};exports[_0xe842('0x45')]=function(_0x1a74c6,_0x12b5f4){return db[_0xe842('0x25')][_0xe842('0x45')]()[_0xe842('0x20')](respondWithResult(_0x12b5f4,null))[_0xe842('0x44')](handleError(_0x12b5f4,null));}; \ No newline at end of file +var _0x16cf=['limit','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','MailQueueReport','rawAttributes','keys','filters','intersection','query','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset'];(function(_0x4dd991,_0x34e3e3){var _0x174e64=function(_0x17ddee){while(--_0x17ddee){_0x4dd991['push'](_0x4dd991['shift']());}};_0x174e64(++_0x34e3e3);}(_0x16cf,0xc3));var _0xf16c=function(_0x2eb280,_0x1e2050){_0x2eb280=_0x2eb280-0x0;var _0x4751ee=_0x16cf[_0x2eb280];return _0x4751ee;};'use strict';var pdf=require(_0xf16c('0x0'));var emlformat=require(_0xf16c('0x1'));var rimraf=require(_0xf16c('0x2'));var zipdir=require(_0xf16c('0x3'));var jsonpatch=require(_0xf16c('0x4'));var rp=require(_0xf16c('0x5'));var moment=require('moment');var BPromise=require(_0xf16c('0x6'));var Mustache=require(_0xf16c('0x7'));var util=require(_0xf16c('0x8'));var path=require(_0xf16c('0x9'));var sox=require(_0xf16c('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xf16c('0xb'));var squel=require(_0xf16c('0xc'));var crypto=require(_0xf16c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf16c('0xe'));var toCsv=require(_0xf16c('0xf'));var querystring=require(_0xf16c('0x10'));var Papa=require(_0xf16c('0x11'));var Redis=require(_0xf16c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf16c('0x13'));var hardwareService=require(_0xf16c('0x14'));var logger=require('../../config/logger')(_0xf16c('0x15'));var utils=require('../../config/utils');var config=require(_0xf16c('0x16'));var db=require(_0xf16c('0x17'))['db'];function respondWithStatusCode(_0x47037f,_0x44c5f0){_0x44c5f0=_0x44c5f0||0xcc;return function(_0x32b98a){if(_0x32b98a){return _0x47037f[_0xf16c('0x18')](_0x44c5f0);}return _0x47037f[_0xf16c('0x19')](_0x44c5f0)[_0xf16c('0x1a')]();};}function respondWithResult(_0xb68d60,_0x5c9935){_0x5c9935=_0x5c9935||0xc8;return function(_0x4ace1b){if(_0x4ace1b){return _0xb68d60[_0xf16c('0x19')](_0x5c9935)[_0xf16c('0x1b')](_0x4ace1b);}};}function respondWithFilteredResult(_0x44e759,_0x556dc){return function(_0x430d19){if(_0x430d19){var _0x4c543d=_0x430d19[_0xf16c('0x1c')],_0x34721e=_0x556dc[_0xf16c('0x1d')],_0x39cb84=_0x556dc[_0xf16c('0x1d')]+_0x556dc[_0xf16c('0x1e')],_0x51eb8b;if(_0x39cb84>=_0x4c543d){_0x39cb84=_0x4c543d;_0x51eb8b=0xc8;}else{_0x51eb8b=0xce;}_0x44e759[_0xf16c('0x19')](_0x51eb8b);return _0x44e759['set'](_0xf16c('0x1f'),_0x34721e+'-'+_0x39cb84+'/'+_0x4c543d)[_0xf16c('0x1b')](_0x430d19);}return null;};}function patchUpdates(_0x5c245b){return function(_0x4fbd0a){try{jsonpatch[_0xf16c('0x20')](_0x4fbd0a,_0x5c245b,!![]);}catch(_0x14c352){return BPromise[_0xf16c('0x21')](_0x14c352);}return _0x4fbd0a[_0xf16c('0x22')]();};}function saveUpdates(_0x28fcf7,_0x5352f4){return function(_0x2d7b6a){if(_0x2d7b6a){return _0x2d7b6a['update'](_0x28fcf7)[_0xf16c('0x23')](function(_0x227d49){return _0x227d49;});}return null;};}function removeEntity(_0x147e9c,_0x3de404){return function(_0x43283d){if(_0x43283d){return _0x43283d[_0xf16c('0x24')]()['then'](function(){_0x147e9c[_0xf16c('0x19')](0xcc)[_0xf16c('0x1a')]();});}};}function handleEntityNotFound(_0x296b28,_0x3ef8c1){return function(_0x2d2402){if(!_0x2d2402){_0x296b28[_0xf16c('0x18')](0x194);}return _0x2d2402;};}function handleError(_0x5c355d,_0x344ca6){_0x344ca6=_0x344ca6||0x1f4;return function(_0x396d58){logger[_0xf16c('0x25')](_0x396d58[_0xf16c('0x26')]);if(_0x396d58[_0xf16c('0x27')]){delete _0x396d58[_0xf16c('0x27')];}_0x5c355d['status'](_0x344ca6)[_0xf16c('0x28')](_0x396d58);};}exports[_0xf16c('0x29')]=function(_0x2dc41b,_0x7f8ec3){var _0x220d0f={},_0x5666d5={},_0x26c476={'count':0x0,'rows':[]};var _0x3c5ea1=db[_0xf16c('0x2a')][_0xf16c('0x2b')];_0x5666d5['model']=_['keys'](_0x3c5ea1);_0x5666d5['query']=_[_0xf16c('0x2c')](_0x2dc41b['query']);_0x5666d5[_0xf16c('0x2d')]=_[_0xf16c('0x2e')](_0x5666d5['model'],_0x5666d5[_0xf16c('0x2f')]);_0x220d0f['attributes']=_[_0xf16c('0x2e')](_0x5666d5[_0xf16c('0x30')],qs['fields'](_0x2dc41b[_0xf16c('0x2f')][_0xf16c('0x31')]));_0x220d0f['attributes']=_0x220d0f[_0xf16c('0x32')][_0xf16c('0x33')]?_0x220d0f[_0xf16c('0x32')]:_0x5666d5[_0xf16c('0x30')];if(!_0x2dc41b[_0xf16c('0x2f')][_0xf16c('0x34')]('nolimit')){_0x220d0f[_0xf16c('0x1e')]=qs['limit'](_0x2dc41b['query'][_0xf16c('0x1e')]);_0x220d0f['offset']=qs[_0xf16c('0x1d')](_0x2dc41b['query'][_0xf16c('0x1d')]);}_0x220d0f[_0xf16c('0x35')]=qs[_0xf16c('0x36')](_0x2dc41b[_0xf16c('0x2f')][_0xf16c('0x36')]);_0x220d0f[_0xf16c('0x37')]=qs[_0xf16c('0x2d')](_[_0xf16c('0x38')](_0x2dc41b[_0xf16c('0x2f')],_0x5666d5[_0xf16c('0x2d')]));if(_0x2dc41b[_0xf16c('0x2f')][_0xf16c('0x39')]){_0x220d0f[_0xf16c('0x37')]=_[_0xf16c('0x3a')](_0x220d0f[_0xf16c('0x37')],{'$or':_[_0xf16c('0x3b')](_0x3c5ea1,function(_0x2ff509){if(_0x2ff509[_0xf16c('0x3c')]['key']!==_0xf16c('0x3d')){var _0x51f24a={};_0x51f24a[_0x2ff509['field']]={'$like':'%'+_0x2dc41b[_0xf16c('0x2f')][_0xf16c('0x39')]+'%'};return _0x51f24a;}})});}_0x220d0f=_[_0xf16c('0x3a')]({},_0x220d0f,_0x2dc41b[_0xf16c('0x3e')]);var _0x43827f={'where':_0x220d0f[_0xf16c('0x37')]};return db[_0xf16c('0x2a')]['count'](_0x43827f)[_0xf16c('0x23')](function(_0x80f859){_0x26c476[_0xf16c('0x1c')]=_0x80f859;if(_0x2dc41b[_0xf16c('0x2f')][_0xf16c('0x3f')]){_0x220d0f[_0xf16c('0x40')]=[{'all':!![]}];}return db[_0xf16c('0x2a')][_0xf16c('0x41')](_0x220d0f);})[_0xf16c('0x23')](function(_0x3ac03e){_0x26c476[_0xf16c('0x42')]=_0x3ac03e;return _0x26c476;})[_0xf16c('0x23')](respondWithFilteredResult(_0x7f8ec3,_0x220d0f))[_0xf16c('0x43')](handleError(_0x7f8ec3,null));};exports[_0xf16c('0x44')]=function(_0xac8076,_0x382ae3){var _0x106f43={'raw':!![],'where':{'id':_0xac8076[_0xf16c('0x45')]['id']}},_0x1ba31d={};_0x1ba31d[_0xf16c('0x30')]=_[_0xf16c('0x2c')](db['MailQueueReport']['rawAttributes']);_0x1ba31d[_0xf16c('0x2f')]=_[_0xf16c('0x2c')](_0xac8076[_0xf16c('0x2f')]);_0x1ba31d['filters']=_[_0xf16c('0x2e')](_0x1ba31d['model'],_0x1ba31d['query']);_0x106f43[_0xf16c('0x32')]=_[_0xf16c('0x2e')](_0x1ba31d[_0xf16c('0x30')],qs[_0xf16c('0x31')](_0xac8076[_0xf16c('0x2f')][_0xf16c('0x31')]));_0x106f43[_0xf16c('0x32')]=_0x106f43[_0xf16c('0x32')][_0xf16c('0x33')]?_0x106f43[_0xf16c('0x32')]:_0x1ba31d[_0xf16c('0x30')];if(_0xac8076[_0xf16c('0x2f')][_0xf16c('0x3f')]){_0x106f43[_0xf16c('0x40')]=[{'all':!![]}];}_0x106f43=_[_0xf16c('0x3a')]({},_0x106f43,_0xac8076[_0xf16c('0x3e')]);return db[_0xf16c('0x2a')][_0xf16c('0x46')](_0x106f43)[_0xf16c('0x23')](handleEntityNotFound(_0x382ae3,null))[_0xf16c('0x23')](respondWithResult(_0x382ae3,null))[_0xf16c('0x43')](handleError(_0x382ae3,null));};exports[_0xf16c('0x47')]=function(_0x5aa721,_0x2383f6){return db['MailQueueReport'][_0xf16c('0x47')](_0x5aa721[_0xf16c('0x48')],{})[_0xf16c('0x23')](respondWithResult(_0x2383f6,0xc9))[_0xf16c('0x43')](handleError(_0x2383f6,null));};exports[_0xf16c('0x49')]=function(_0x83d2f,_0x59e6d1){if(_0x83d2f[_0xf16c('0x48')]['id']){delete _0x83d2f[_0xf16c('0x48')]['id'];}return db['MailQueueReport'][_0xf16c('0x46')]({'where':{'id':_0x83d2f['params']['id']}})[_0xf16c('0x23')](handleEntityNotFound(_0x59e6d1,null))[_0xf16c('0x23')](saveUpdates(_0x83d2f[_0xf16c('0x48')],null))['then'](respondWithResult(_0x59e6d1,null))['catch'](handleError(_0x59e6d1,null));};exports[_0xf16c('0x24')]=function(_0x4952fd,_0x20138d){return db['MailQueueReport'][_0xf16c('0x46')]({'where':{'id':_0x4952fd[_0xf16c('0x45')]['id']}})[_0xf16c('0x23')](handleEntityNotFound(_0x20138d,null))[_0xf16c('0x23')](removeEntity(_0x20138d,null))[_0xf16c('0x43')](handleError(_0x20138d,null));};exports[_0xf16c('0x4a')]=function(_0x2011d0,_0x3a1041){return db['MailQueueReport'][_0xf16c('0x4a')]()[_0xf16c('0x23')](respondWithResult(_0x3a1041,null))[_0xf16c('0x43')](handleError(_0x3a1041,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 09f0db0..dac6765 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 _0xa062=['../../config/environment','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5d0d73,_0x303a38){var _0x17500d=function(_0xb03532){while(--_0xb03532){_0x5d0d73['push'](_0x5d0d73['shift']());}};_0x17500d(++_0x303a38);}(_0xa062,0x101));var _0x2a06=function(_0x53ac65,_0x51cfb3){_0x53ac65=_0x53ac65-0x0;var _0x4c5122=_0xa062[_0x53ac65];return _0x4c5122;};'use strict';var _=require(_0x2a06('0x0'));var util=require(_0x2a06('0x1'));var logger=require(_0x2a06('0x2'))('api');var moment=require(_0x2a06('0x3'));var BPromise=require(_0x2a06('0x4'));var rp=require(_0x2a06('0x5'));var fs=require('fs');var path=require(_0x2a06('0x6'));var rimraf=require('rimraf');var config=require(_0x2a06('0x7'));var attributes=require('./mailQueueReport.attributes');module['exports']=function(_0x1376ba,_0x1ba42f){return _0x1376ba[_0x2a06('0x8')](_0x2a06('0x9'),attributes,{'tableName':_0x2a06('0xa'),'paranoid':![],'indexes':[{'name':_0x2a06('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe1e3=['MailQueueReport','report_mail_queue','uniqueid','lodash','util','api','request-promise','rimraf','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x194abb,_0x48e606){var _0xfa4f19=function(_0x526e8d){while(--_0x526e8d){_0x194abb['push'](_0x194abb['shift']());}};_0xfa4f19(++_0x48e606);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x468fae,_0x37a993){_0x468fae=_0x468fae-0x0;var _0x6de42b=_0xe1e3[_0x468fae];return _0x6de42b;};'use strict';var _=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var logger=require('../../config/logger')(_0x3e1e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3e1e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3e1e('0x4'));var config=require(_0x3e1e('0x5'));var attributes=require(_0x3e1e('0x6'));module[_0x3e1e('0x7')]=function(_0x40d6d8,_0x25701f){return _0x40d6d8['define'](_0x3e1e('0x8'),attributes,{'tableName':_0x3e1e('0x9'),'paranoid':![],'indexes':[{'name':_0x3e1e('0xa'),'fields':[_0x3e1e('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 8245aee..5d9af30 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 _0xf2ea=['UpdateMailQueueReport','update','where','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','MailQueueReport,\x20%s,\x20%s','message','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','debug','stringify'];(function(_0x32ed89,_0x11d953){var _0x262961=function(_0x29727c){while(--_0x29727c){_0x32ed89['push'](_0x32ed89['shift']());}};_0x262961(++_0x11d953);}(_0xf2ea,0xeb));var _0xaf2e=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xf2ea[_0x42bdad];return _0x122626;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaf2e('0x0'));var BPromise=require(_0xaf2e('0x1'));var rs=require(_0xaf2e('0x2'));var fs=require('fs');var Redis=require(_0xaf2e('0x3'));var db=require(_0xaf2e('0x4'))['db'];var utils=require(_0xaf2e('0x5'));var logger=require(_0xaf2e('0x6'))('rpc');var config=require(_0xaf2e('0x7'));var jayson=require(_0xaf2e('0x8'));var client=jayson[_0xaf2e('0x9')][_0xaf2e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50a8a7,_0x559a53,_0x2e9661){return new BPromise(function(_0x168755,_0x1b269f){return client['request'](_0x50a8a7,_0x2e9661)[_0xaf2e('0xb')](function(_0x750d4d){logger[_0xaf2e('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x559a53,_0xaf2e('0xd'));logger['debug'](_0xaf2e('0xe'),_0x559a53,'request\x20sent',JSON['stringify'](_0x750d4d));if(_0x750d4d['error']){if(_0x750d4d[_0xaf2e('0xf')][_0xaf2e('0x10')]===0x1f4){logger['error'](_0xaf2e('0x11'),_0x559a53,_0x750d4d[_0xaf2e('0xf')][_0xaf2e('0x12')]);return _0x1b269f(_0x750d4d['error'][_0xaf2e('0x12')]);}logger[_0xaf2e('0xf')](_0xaf2e('0x11'),_0x559a53,_0x750d4d[_0xaf2e('0xf')]['message']);return _0x168755(_0x750d4d[_0xaf2e('0xf')][_0xaf2e('0x12')]);}else{logger[_0xaf2e('0xc')](_0xaf2e('0x11'),_0x559a53,_0xaf2e('0xd'));_0x168755(_0x750d4d[_0xaf2e('0x13')]['message']);}})[_0xaf2e('0x14')](function(_0x1d3de8){logger['error'](_0xaf2e('0x11'),_0x559a53,_0x1d3de8);_0x1b269f(_0x1d3de8);});});}exports[_0xaf2e('0x15')]=function(_0x120ea3){var _0x1e36b4=this;return new Promise(function(_0x2ce375,_0xf06f6e){return db[_0xaf2e('0x16')][_0xaf2e('0x17')](_0x120ea3[_0xaf2e('0x18')],{'raw':_0x120ea3[_0xaf2e('0x19')]?_0x120ea3[_0xaf2e('0x19')][_0xaf2e('0x1a')]===undefined?!![]:![]:!![]})[_0xaf2e('0xb')](function(_0x139d92){logger[_0xaf2e('0xc')](_0xaf2e('0x15'),_0x120ea3);logger[_0xaf2e('0x1b')](_0xaf2e('0x15'),_0x120ea3,JSON[_0xaf2e('0x1c')](_0x139d92));_0x2ce375(_0x139d92);})[_0xaf2e('0x14')](function(_0x2a7c91){logger['error']('CreateMailQueueReport',_0x2a7c91[_0xaf2e('0x12')],_0x120ea3);_0xf06f6e(_0x1e36b4['error'](0x1f4,_0x2a7c91[_0xaf2e('0x12')]));});});};exports[_0xaf2e('0x1d')]=function(_0x4498d7){var _0x4a9bd9=this;return new Promise(function(_0x3d8637,_0x3db082){return db[_0xaf2e('0x16')][_0xaf2e('0x1e')](_0x4498d7[_0xaf2e('0x18')],{'raw':_0x4498d7['options']?_0x4498d7[_0xaf2e('0x19')][_0xaf2e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4498d7[_0xaf2e('0x19')]?_0x4498d7[_0xaf2e('0x19')][_0xaf2e('0x1f')]||null:null,'attributes':_0x4498d7['options']?_0x4498d7['options']['attributes']||null:null,'limit':_0x4498d7[_0xaf2e('0x19')]?_0x4498d7['options'][_0xaf2e('0x20')]||null:null})[_0xaf2e('0xb')](function(_0x55217f){logger['info']('UpdateMailQueueReport',_0x4498d7);logger[_0xaf2e('0x1b')](_0xaf2e('0x1d'),_0x4498d7,JSON[_0xaf2e('0x1c')](_0x55217f));_0x3d8637(_0x55217f);})['catch'](function(_0x33dc34){logger[_0xaf2e('0xf')](_0xaf2e('0x1d'),_0x33dc34[_0xaf2e('0x12')],_0x4498d7);_0x3db082(_0x4a9bd9[_0xaf2e('0xf')](0x1f4,_0x33dc34[_0xaf2e('0x12')]));});});}; \ No newline at end of file +var _0xc6ec=['debug','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','MailQueueReport','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','where','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s'];(function(_0x5c5c52,_0x36d085){var _0x4229ff=function(_0x3806df){while(--_0x3806df){_0x5c5c52['push'](_0x5c5c52['shift']());}};_0x4229ff(++_0x36d085);}(_0xc6ec,0x190));var _0xcc6e=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0xc6ec[_0x2d91c6];return _0x3a8d19;};'use strict';var _=require('lodash');var util=require(_0xcc6e('0x0'));var moment=require(_0xcc6e('0x1'));var BPromise=require(_0xcc6e('0x2'));var rs=require(_0xcc6e('0x3'));var fs=require('fs');var Redis=require(_0xcc6e('0x4'));var db=require(_0xcc6e('0x5'))['db'];var utils=require(_0xcc6e('0x6'));var logger=require(_0xcc6e('0x7'))(_0xcc6e('0x8'));var config=require(_0xcc6e('0x9'));var jayson=require(_0xcc6e('0xa'));var client=jayson[_0xcc6e('0xb')][_0xcc6e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5f574f,_0x5aa226,_0x43c834){return new BPromise(function(_0x171759,_0x219c32){return client[_0xcc6e('0xd')](_0x5f574f,_0x43c834)[_0xcc6e('0xe')](function(_0x3fa908){logger['info'](_0xcc6e('0xf'),_0x5aa226,'request\x20sent');logger[_0xcc6e('0x10')](_0xcc6e('0x11'),_0x5aa226,_0xcc6e('0x12'),JSON[_0xcc6e('0x13')](_0x3fa908));if(_0x3fa908[_0xcc6e('0x14')]){if(_0x3fa908[_0xcc6e('0x14')]['code']===0x1f4){logger[_0xcc6e('0x14')](_0xcc6e('0xf'),_0x5aa226,_0x3fa908['error'][_0xcc6e('0x15')]);return _0x219c32(_0x3fa908['error'][_0xcc6e('0x15')]);}logger[_0xcc6e('0x14')](_0xcc6e('0xf'),_0x5aa226,_0x3fa908[_0xcc6e('0x14')][_0xcc6e('0x15')]);return _0x171759(_0x3fa908[_0xcc6e('0x14')][_0xcc6e('0x15')]);}else{logger[_0xcc6e('0x16')](_0xcc6e('0xf'),_0x5aa226,_0xcc6e('0x12'));_0x171759(_0x3fa908['result'][_0xcc6e('0x15')]);}})[_0xcc6e('0x17')](function(_0x3dacd8){logger[_0xcc6e('0x14')](_0xcc6e('0xf'),_0x5aa226,_0x3dacd8);_0x219c32(_0x3dacd8);});});}exports['CreateMailQueueReport']=function(_0x5d97ed){var _0x24c7ff=this;return new Promise(function(_0x4271a3,_0x3e9104){return db[_0xcc6e('0x18')]['create'](_0x5d97ed[_0xcc6e('0x19')],{'raw':_0x5d97ed[_0xcc6e('0x1a')]?_0x5d97ed[_0xcc6e('0x1a')][_0xcc6e('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x158313){logger[_0xcc6e('0x16')]('CreateMailQueueReport',_0x5d97ed);logger[_0xcc6e('0x10')](_0xcc6e('0x1c'),_0x5d97ed,JSON['stringify'](_0x158313));_0x4271a3(_0x158313);})[_0xcc6e('0x17')](function(_0x57ed0c){logger[_0xcc6e('0x14')](_0xcc6e('0x1c'),_0x57ed0c[_0xcc6e('0x15')],_0x5d97ed);_0x3e9104(_0x24c7ff['error'](0x1f4,_0x57ed0c[_0xcc6e('0x15')]));});});};exports[_0xcc6e('0x1d')]=function(_0x2a24a0){var _0x23688e=this;return new Promise(function(_0x521078,_0x130a9c){return db[_0xcc6e('0x18')]['update'](_0x2a24a0['body'],{'raw':_0x2a24a0['options']?_0x2a24a0[_0xcc6e('0x1a')][_0xcc6e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a24a0[_0xcc6e('0x1a')]?_0x2a24a0[_0xcc6e('0x1a')][_0xcc6e('0x1e')]||null:null,'attributes':_0x2a24a0['options']?_0x2a24a0[_0xcc6e('0x1a')]['attributes']||null:null,'limit':_0x2a24a0[_0xcc6e('0x1a')]?_0x2a24a0['options'][_0xcc6e('0x1f')]||null:null})[_0xcc6e('0xe')](function(_0x564e32){logger[_0xcc6e('0x16')](_0xcc6e('0x1d'),_0x2a24a0);logger['debug'](_0xcc6e('0x1d'),_0x2a24a0,JSON[_0xcc6e('0x13')](_0x564e32));_0x521078(_0x564e32);})['catch'](function(_0x19c3c2){logger['error'](_0xcc6e('0x1d'),_0x19c3c2[_0xcc6e('0x15')],_0x2a24a0);_0x130a9c(_0x23688e[_0xcc6e('0x14')](0x1f4,_0x19c3c2[_0xcc6e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 70b7d14..61d563c 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 _0x39c7=['express','Router','../../components/auth/service','../../config/environment','exports','util','path','connect-timeout'];(function(_0x4429d7,_0xbcb7dc){var _0x17ec11=function(_0x2ebff3){while(--_0x2ebff3){_0x4429d7['push'](_0x4429d7['shift']());}};_0x17ec11(++_0xbcb7dc);}(_0x39c7,0x85));var _0x739c=function(_0x48608c,_0xd27843){_0x48608c=_0x48608c-0x0;var _0x3a77be=_0x39c7[_0x48608c];return _0x3a77be;};'use strict';var multer=require('multer');var util=require(_0x739c('0x0'));var path=require(_0x739c('0x1'));var timeout=require(_0x739c('0x2'));var express=require(_0x739c('0x3'));var router=express[_0x739c('0x4')]();var auth=require(_0x739c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x739c('0x6'));module[_0x739c('0x7')]=router; \ No newline at end of file +var _0x81c6=['Router','../../components/auth/service','../../components/interaction/service','exports','util'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0x81c6,0x1d5));var _0x681c=function(_0x9ffdd8,_0x414bbd){_0x9ffdd8=_0x9ffdd8-0x0;var _0x222710=_0x81c6[_0x9ffdd8];return _0x222710;};'use strict';var multer=require('multer');var util=require(_0x681c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x681c('0x1')]();var auth=require(_0x681c('0x2'));var interaction=require(_0x681c('0x3'));var config=require('../../config/environment');module[_0x681c('0x4')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index a10a7f3..7ec3638 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 _0x5db8=['STRING','BOOLEAN','username','INBOX','INTEGER','sequelize','exports'];(function(_0x2855b9,_0x43f5c6){var _0xa4e025=function(_0x58a569){while(--_0x58a569){_0x2855b9['push'](_0x2855b9['shift']());}};_0xa4e025(++_0x43f5c6);}(_0x5db8,0xbb));var _0x85db=function(_0x2ec2bf,_0x64e983){_0x2ec2bf=_0x2ec2bf-0x0;var _0x2c279c=_0x5db8[_0x2ec2bf];return _0x2c279c;};'use strict';var Sequelize=require(_0x85db('0x0'));module[_0x85db('0x1')]={'description':{'type':Sequelize[_0x85db('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x85db('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x85db('0x2')],'unique':_0x85db('0x4')},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x85db('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x85db('0x2')],'defaultValue':_0x85db('0x5')},'connTimeout':{'type':Sequelize[_0x85db('0x6')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa45c=['username','INTEGER','INBOX','STRING','sequelize','exports','BOOLEAN'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xa45c,0x6d));var _0xca45=function(_0x5a0f74,_0xa05612){_0x5a0f74=_0x5a0f74-0x0;var _0x3f8d23=_0xa45c[_0x5a0f74];return _0x3f8d23;};'use strict';var Sequelize=require(_0xca45('0x0'));module[_0xca45('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xca45('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING'],'unique':_0xca45('0x3')},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xca45('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xca45('0x5')},'connTimeout':{'type':Sequelize[_0xca45('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xca45('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xca45('0x6')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 8adf7e9..85fda83 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 _0x2837=['MailServerIn','mail_servers_in','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./mailServerIn.attributes','define'];(function(_0x323897,_0x4cf759){var _0x25cf44=function(_0x5ac6ff){while(--_0x5ac6ff){_0x323897['push'](_0x323897['shift']());}};_0x25cf44(++_0x4cf759);}(_0x2837,0x12b));var _0x7283=function(_0x618b2c,_0x4373fd){_0x618b2c=_0x618b2c-0x0;var _0xd4ada2=_0x2837[_0x618b2c];return _0xd4ada2;};'use strict';var _=require(_0x7283('0x0'));var util=require(_0x7283('0x1'));var logger=require(_0x7283('0x2'))('api');var moment=require(_0x7283('0x3'));var BPromise=require(_0x7283('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7283('0x5'));var config=require(_0x7283('0x6'));var attributes=require(_0x7283('0x7'));module['exports']=function(_0x30e082,_0x5ee4f1){return _0x30e082[_0x7283('0x8')](_0x7283('0x9'),attributes,{'tableName':_0x7283('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5630=['define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5630,0xc3));var _0x0563=function(_0x1772c9,_0x4caa3d){_0x1772c9=_0x1772c9-0x0;var _0x3de541=_0x5630[_0x1772c9];return _0x3de541;};'use strict';var _=require(_0x0563('0x0'));var util=require(_0x0563('0x1'));var logger=require(_0x0563('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0563('0x3'));var fs=require('fs');var path=require(_0x0563('0x4'));var rimraf=require(_0x0563('0x5'));var config=require(_0x0563('0x6'));var attributes=require(_0x0563('0x7'));module[_0x0563('0x8')]=function(_0x4f1552,_0x5712df){return _0x4f1552[_0x0563('0x9')](_0x0563('0xa'),attributes,{'tableName':_0x0563('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 0e153ce..a396636 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 _0xf568=['MailServerIn','findAll','raw','options','attributes','map','include','model','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetMailServerIn'];(function(_0x35a8df,_0x1e0ff6){var _0x4948a8=function(_0x3460b8){while(--_0x3460b8){_0x35a8df['push'](_0x35a8df['shift']());}};_0x4948a8(++_0x1e0ff6);}(_0xf568,0x189));var _0x8f56=function(_0x397aa7,_0x3d728c){_0x397aa7=_0x397aa7-0x0;var _0x3de03b=_0xf568[_0x397aa7];return _0x3de03b;};'use strict';var _=require(_0x8f56('0x0'));var util=require(_0x8f56('0x1'));var moment=require(_0x8f56('0x2'));var BPromise=require(_0x8f56('0x3'));var rs=require(_0x8f56('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f56('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8f56('0x6'))(_0x8f56('0x7'));var config=require(_0x8f56('0x8'));var jayson=require(_0x8f56('0x9'));var client=jayson[_0x8f56('0xa')][_0x8f56('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21f268,_0x2d36c4,_0x36432a){return new BPromise(function(_0x4a6572,_0x25b6c0){return client[_0x8f56('0xc')](_0x21f268,_0x36432a)[_0x8f56('0xd')](function(_0x4460e4){logger[_0x8f56('0xe')](_0x8f56('0xf'),_0x2d36c4,_0x8f56('0x10'));logger[_0x8f56('0x11')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x2d36c4,_0x8f56('0x10'),JSON['stringify'](_0x4460e4));if(_0x4460e4[_0x8f56('0x12')]){if(_0x4460e4['error']['code']===0x1f4){logger[_0x8f56('0x12')](_0x8f56('0xf'),_0x2d36c4,_0x4460e4[_0x8f56('0x12')][_0x8f56('0x13')]);return _0x25b6c0(_0x4460e4[_0x8f56('0x12')][_0x8f56('0x13')]);}logger[_0x8f56('0x12')]('MailServerIn,\x20%s,\x20%s',_0x2d36c4,_0x4460e4[_0x8f56('0x12')]['message']);return _0x4a6572(_0x4460e4['error'][_0x8f56('0x13')]);}else{logger[_0x8f56('0xe')](_0x8f56('0xf'),_0x2d36c4,_0x8f56('0x10'));_0x4a6572(_0x4460e4[_0x8f56('0x14')][_0x8f56('0x13')]);}})[_0x8f56('0x15')](function(_0x906bd1){logger[_0x8f56('0x12')](_0x8f56('0xf'),_0x2d36c4,_0x906bd1);_0x25b6c0(_0x906bd1);});});}exports[_0x8f56('0x16')]=function(_0x37c00a){var _0x57e27e=this;return new Promise(function(_0x58f152,_0x5d8eed){return db[_0x8f56('0x17')][_0x8f56('0x18')]({'raw':_0x37c00a['options']?_0x37c00a['options'][_0x8f56('0x19')]===undefined?!![]:![]:!![],'where':_0x37c00a['options']?_0x37c00a['options']['where']||null:null,'attributes':_0x37c00a[_0x8f56('0x1a')]?_0x37c00a[_0x8f56('0x1a')][_0x8f56('0x1b')]||null:null,'limit':_0x37c00a['options']?_0x37c00a[_0x8f56('0x1a')]['limit']||null:null,'include':_0x37c00a['options']?_0x37c00a[_0x8f56('0x1a')]['include']?_[_0x8f56('0x1c')](_0x37c00a[_0x8f56('0x1a')][_0x8f56('0x1d')],function(_0x4257bd){return{'model':db[_0x4257bd['model']],'as':_0x4257bd['as'],'attributes':_0x4257bd[_0x8f56('0x1b')],'include':_0x4257bd[_0x8f56('0x1d')]?_[_0x8f56('0x1c')](_0x4257bd['include'],function(_0x220c2c){return{'model':db[_0x220c2c[_0x8f56('0x1e')]],'as':_0x220c2c['as'],'attributes':_0x220c2c[_0x8f56('0x1b')],'include':_0x220c2c['include']?_[_0x8f56('0x1c')](_0x220c2c[_0x8f56('0x1d')],function(_0x2f1923){return{'model':db[_0x2f1923[_0x8f56('0x1e')]],'as':_0x2f1923['as'],'attributes':_0x2f1923[_0x8f56('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29ba63){logger['info'](_0x8f56('0x16'),_0x37c00a);logger[_0x8f56('0x11')]('GetMailServerIn',_0x37c00a,JSON[_0x8f56('0x1f')](_0x29ba63));_0x58f152(_0x29ba63);})['catch'](function(_0xb9fd93){logger[_0x8f56('0x12')](_0x8f56('0x16'),_0xb9fd93['message'],_0x37c00a);_0x5d8eed(_0x57e27e[_0x8f56('0x12')](0x1f4,_0xb9fd93['message']));});});}; \ No newline at end of file +var _0x490c=['client','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailServerIn','options','raw','limit','include','map','model','attributes','then','debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x2fa1c6,_0x4a5b8d){var _0x5f3257=function(_0x195b53){while(--_0x195b53){_0x2fa1c6['push'](_0x2fa1c6['shift']());}};_0x5f3257(++_0x4a5b8d);}(_0x490c,0x92));var _0xc490=function(_0x1895b7,_0x21fbc7){_0x1895b7=_0x1895b7-0x0;var _0x1aecdc=_0x490c[_0x1895b7];return _0x1aecdc;};'use strict';var _=require(_0xc490('0x0'));var util=require(_0xc490('0x1'));var moment=require('moment');var BPromise=require(_0xc490('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc490('0x3'));var db=require(_0xc490('0x4'))['db'];var utils=require(_0xc490('0x5'));var logger=require(_0xc490('0x6'))('rpc');var config=require(_0xc490('0x7'));var jayson=require(_0xc490('0x8'));var client=jayson[_0xc490('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x224bec,_0x5c93c0,_0x47e2d4){return new BPromise(function(_0x5c939a,_0x264fa8){return client[_0xc490('0xa')](_0x224bec,_0x47e2d4)['then'](function(_0x587153){logger[_0xc490('0xb')](_0xc490('0xc'),_0x5c93c0,_0xc490('0xd'));logger['debug'](_0xc490('0xe'),_0x5c93c0,_0xc490('0xd'),JSON[_0xc490('0xf')](_0x587153));if(_0x587153[_0xc490('0x10')]){if(_0x587153[_0xc490('0x10')][_0xc490('0x11')]===0x1f4){logger['error'](_0xc490('0xc'),_0x5c93c0,_0x587153[_0xc490('0x10')][_0xc490('0x12')]);return _0x264fa8(_0x587153[_0xc490('0x10')]['message']);}logger[_0xc490('0x10')]('MailServerIn,\x20%s,\x20%s',_0x5c93c0,_0x587153[_0xc490('0x10')][_0xc490('0x12')]);return _0x5c939a(_0x587153[_0xc490('0x10')][_0xc490('0x12')]);}else{logger[_0xc490('0xb')](_0xc490('0xc'),_0x5c93c0,_0xc490('0xd'));_0x5c939a(_0x587153[_0xc490('0x13')][_0xc490('0x12')]);}})[_0xc490('0x14')](function(_0x5522b8){logger[_0xc490('0x10')](_0xc490('0xc'),_0x5c93c0,_0x5522b8);_0x264fa8(_0x5522b8);});});}exports[_0xc490('0x15')]=function(_0x1d0ee1){var _0x3d9866=this;return new Promise(function(_0x452214,_0x5ac824){return db['MailServerIn']['findAll']({'raw':_0x1d0ee1[_0xc490('0x16')]?_0x1d0ee1['options'][_0xc490('0x17')]===undefined?!![]:![]:!![],'where':_0x1d0ee1[_0xc490('0x16')]?_0x1d0ee1[_0xc490('0x16')]['where']||null:null,'attributes':_0x1d0ee1[_0xc490('0x16')]?_0x1d0ee1[_0xc490('0x16')]['attributes']||null:null,'limit':_0x1d0ee1[_0xc490('0x16')]?_0x1d0ee1[_0xc490('0x16')][_0xc490('0x18')]||null:null,'include':_0x1d0ee1[_0xc490('0x16')]?_0x1d0ee1[_0xc490('0x16')][_0xc490('0x19')]?_[_0xc490('0x1a')](_0x1d0ee1[_0xc490('0x16')][_0xc490('0x19')],function(_0x434e89){return{'model':db[_0x434e89[_0xc490('0x1b')]],'as':_0x434e89['as'],'attributes':_0x434e89[_0xc490('0x1c')],'include':_0x434e89[_0xc490('0x19')]?_['map'](_0x434e89['include'],function(_0x4b38d2){return{'model':db[_0x4b38d2['model']],'as':_0x4b38d2['as'],'attributes':_0x4b38d2[_0xc490('0x1c')],'include':_0x4b38d2[_0xc490('0x19')]?_['map'](_0x4b38d2[_0xc490('0x19')],function(_0x4e3a1d){return{'model':db[_0x4e3a1d['model']],'as':_0x4e3a1d['as'],'attributes':_0x4e3a1d[_0xc490('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc490('0x1d')](function(_0x25c056){logger['info'](_0xc490('0x15'),_0x1d0ee1);logger[_0xc490('0x1e')](_0xc490('0x15'),_0x1d0ee1,JSON[_0xc490('0xf')](_0x25c056));_0x452214(_0x25c056);})[_0xc490('0x14')](function(_0x427d11){logger['error'](_0xc490('0x15'),_0x427d11[_0xc490('0x12')],_0x1d0ee1);_0x5ac824(_0x3d9866[_0xc490('0x10')](0x1f4,_0x427d11[_0xc490('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 26c3f2b..411bb60 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 _0x009d=['express','Router','../../components/interaction/service','get','isAuthenticated','/:id','show','create','put','update','destroy','multer','path','connect-timeout'];(function(_0x33cd44,_0x421c8f){var _0x478f69=function(_0x4c0d32){while(--_0x4c0d32){_0x33cd44['push'](_0x33cd44['shift']());}};_0x478f69(++_0x421c8f);}(_0x009d,0x193));var _0xd009=function(_0x478c70,_0x37fb48){_0x478c70=_0x478c70-0x0;var _0x1cc587=_0x009d[_0x478c70];return _0x1cc587;};'use strict';var multer=require(_0xd009('0x0'));var util=require('util');var path=require(_0xd009('0x1'));var timeout=require(_0xd009('0x2'));var express=require(_0xd009('0x3'));var router=express[_0xd009('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd009('0x5'));var config=require('../../config/environment');var controller=require('./mailServerOut.controller');router[_0xd009('0x6')]('/',auth[_0xd009('0x7')](),controller['index']);router[_0xd009('0x6')](_0xd009('0x8'),auth[_0xd009('0x7')](),controller[_0xd009('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd009('0xa')]);router[_0xd009('0xb')](_0xd009('0x8'),auth['isAuthenticated'](),controller[_0xd009('0xc')]);router['delete'](_0xd009('0x8'),auth[_0xd009('0x7')](),controller[_0xd009('0xd')]);module['exports']=router; \ No newline at end of file +var _0x1fce=['post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','/:id','show'];(function(_0x539eb6,_0x3843f8){var _0x2e3478=function(_0x4d6b5d){while(--_0x4d6b5d){_0x539eb6['push'](_0x539eb6['shift']());}};_0x2e3478(++_0x3843f8);}(_0x1fce,0xd6));var _0xe1fc=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x1fce[_0x2faddb];return _0x273c05;};'use strict';var multer=require(_0xe1fc('0x0'));var util=require(_0xe1fc('0x1'));var path=require(_0xe1fc('0x2'));var timeout=require(_0xe1fc('0x3'));var express=require(_0xe1fc('0x4'));var router=express[_0xe1fc('0x5')]();var auth=require(_0xe1fc('0x6'));var interaction=require(_0xe1fc('0x7'));var config=require(_0xe1fc('0x8'));var controller=require(_0xe1fc('0x9'));router[_0xe1fc('0xa')]('/',auth[_0xe1fc('0xb')](),controller['index']);router[_0xe1fc('0xa')](_0xe1fc('0xc'),auth[_0xe1fc('0xb')](),controller[_0xe1fc('0xd')]);router[_0xe1fc('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe1fc('0xf')]('/:id',auth[_0xe1fc('0xb')](),controller[_0xe1fc('0x10')]);router[_0xe1fc('0x11')](_0xe1fc('0xc'),auth[_0xe1fc('0xb')](),controller[_0xe1fc('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 123e401..f10dbe2 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 _0xf68b=['STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x88748,_0x1fa59f){var _0x22a70c=function(_0x2dbb6b){while(--_0x2dbb6b){_0x88748['push'](_0x88748['shift']());}};_0x22a70c(++_0x1fa59f);}(_0xf68b,0x10f));var _0xbf68=function(_0x18a41e,_0x4b9875){_0x18a41e=_0x18a41e-0x0;var _0x391c58=_0xf68b[_0x18a41e];return _0x391c58;};'use strict';var Sequelize=require(_0xbf68('0x0'));module['exports']={'description':{'type':Sequelize[_0xbf68('0x1')]},'host':{'type':Sequelize[_0xbf68('0x1')]},'user':{'type':Sequelize[_0xbf68('0x1')]},'pass':{'type':Sequelize[_0xbf68('0x1')]},'port':{'type':Sequelize[_0xbf68('0x2')]},'secure':{'type':Sequelize[_0xbf68('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x6a75=['STRING','exports'];(function(_0x313317,_0xcc61f4){var _0x471589=function(_0x2f5e91){while(--_0x2f5e91){_0x313317['push'](_0x313317['shift']());}};_0x471589(++_0xcc61f4);}(_0x6a75,0x19f));var _0x56a7=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x6a75[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require('sequelize');module[_0x56a7('0x0')]={'description':{'type':Sequelize[_0x56a7('0x1')]},'host':{'type':Sequelize[_0x56a7('0x1')]},'user':{'type':Sequelize[_0x56a7('0x1')]},'pass':{'type':Sequelize[_0x56a7('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x56a7('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 8921e8b..ee844c8 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 _0x3e01=['rows','catch','show','params','rawAttributes','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','offset','set','apply','reject','save','update','then','sendStatus','error','name','send','index','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','map','type','merge','options','MailServerOut','count','includeAll','include','findAll'];(function(_0x2e53ce,_0x4af127){var _0xed80db=function(_0x46d94f){while(--_0x46d94f){_0x2e53ce['push'](_0x2e53ce['shift']());}};_0xed80db(++_0x4af127);}(_0x3e01,0x1a7));var _0x13e0=function(_0x54566e,_0x58451a){_0x54566e=_0x54566e-0x0;var _0x51efaa=_0x3e01[_0x54566e];return _0x51efaa;};'use strict';var pdf=require(_0x13e0('0x0'));var emlformat=require(_0x13e0('0x1'));var rimraf=require(_0x13e0('0x2'));var zipdir=require(_0x13e0('0x3'));var jsonpatch=require(_0x13e0('0x4'));var rp=require('request-promise');var moment=require(_0x13e0('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x13e0('0x6'));var path=require(_0x13e0('0x7'));var sox=require(_0x13e0('0x8'));var csv=require(_0x13e0('0x9'));var ejs=require(_0x13e0('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x13e0('0xb'));var crypto=require(_0x13e0('0xc'));var jsforce=require(_0x13e0('0xd'));var deskjs=require(_0x13e0('0xe'));var toCsv=require(_0x13e0('0x9'));var querystring=require('querystring');var Papa=require(_0x13e0('0xf'));var Redis=require('ioredis');var authService=require(_0x13e0('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x13e0('0x11'));var logger=require(_0x13e0('0x12'))(_0x13e0('0x13'));var utils=require(_0x13e0('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x491d53,_0x17f636){_0x17f636=_0x17f636||0xcc;return function(_0x3bc993){if(_0x3bc993){return _0x491d53['sendStatus'](_0x17f636);}return _0x491d53[_0x13e0('0x15')](_0x17f636)[_0x13e0('0x16')]();};}function respondWithResult(_0x1d701e,_0x3eea1b){_0x3eea1b=_0x3eea1b||0xc8;return function(_0x204a9f){if(_0x204a9f){return _0x1d701e[_0x13e0('0x15')](_0x3eea1b)[_0x13e0('0x17')](_0x204a9f);}};}function respondWithFilteredResult(_0x5cf5b5,_0x4042a0){return function(_0x25c0dd){if(_0x25c0dd){var _0x170c54=_0x25c0dd['count'],_0x303f35=_0x4042a0[_0x13e0('0x18')],_0x651d0e=_0x4042a0[_0x13e0('0x18')]+_0x4042a0['limit'],_0x3b4c01;if(_0x651d0e>=_0x170c54){_0x651d0e=_0x170c54;_0x3b4c01=0xc8;}else{_0x3b4c01=0xce;}_0x5cf5b5[_0x13e0('0x15')](_0x3b4c01);return _0x5cf5b5[_0x13e0('0x19')]('Content-Range',_0x303f35+'-'+_0x651d0e+'/'+_0x170c54)['json'](_0x25c0dd);}return null;};}function patchUpdates(_0x48744a){return function(_0x4bc9e4){try{jsonpatch[_0x13e0('0x1a')](_0x4bc9e4,_0x48744a,!![]);}catch(_0x3b8519){return BPromise[_0x13e0('0x1b')](_0x3b8519);}return _0x4bc9e4[_0x13e0('0x1c')]();};}function saveUpdates(_0x4bf88b,_0x28abb5){return function(_0x593693){if(_0x593693){return _0x593693[_0x13e0('0x1d')](_0x4bf88b)[_0x13e0('0x1e')](function(_0x3f48b4){return _0x3f48b4;});}return null;};}function removeEntity(_0x1c0676,_0x3063e9){return function(_0xc11b88){if(_0xc11b88){return _0xc11b88['destroy']()[_0x13e0('0x1e')](function(){_0x1c0676[_0x13e0('0x15')](0xcc)[_0x13e0('0x16')]();});}};}function handleEntityNotFound(_0x492088,_0x123710){return function(_0x433004){if(!_0x433004){_0x492088[_0x13e0('0x1f')](0x194);}return _0x433004;};}function handleError(_0x3c3ec0,_0x3c2398){_0x3c2398=_0x3c2398||0x1f4;return function(_0x463fde){logger[_0x13e0('0x20')](_0x463fde['stack']);if(_0x463fde[_0x13e0('0x21')]){delete _0x463fde['name'];}_0x3c3ec0[_0x13e0('0x15')](_0x3c2398)[_0x13e0('0x22')](_0x463fde);};}exports[_0x13e0('0x23')]=function(_0x1aa9e9,_0x298b04){var _0xe793c5={},_0x32ab9a={},_0x5e73e9={'count':0x0,'rows':[]};var _0x22e3d2=db['MailServerOut']['rawAttributes'];_0x32ab9a['model']=_[_0x13e0('0x24')](_0x22e3d2);_0x32ab9a[_0x13e0('0x25')]=_[_0x13e0('0x24')](_0x1aa9e9[_0x13e0('0x25')]);_0x32ab9a[_0x13e0('0x26')]=_['intersection'](_0x32ab9a['model'],_0x32ab9a[_0x13e0('0x25')]);_0xe793c5[_0x13e0('0x27')]=_[_0x13e0('0x28')](_0x32ab9a[_0x13e0('0x29')],qs[_0x13e0('0x2a')](_0x1aa9e9[_0x13e0('0x25')]['fields']));_0xe793c5['attributes']=_0xe793c5[_0x13e0('0x27')][_0x13e0('0x2b')]?_0xe793c5['attributes']:_0x32ab9a[_0x13e0('0x29')];if(!_0x1aa9e9[_0x13e0('0x25')][_0x13e0('0x2c')](_0x13e0('0x2d'))){_0xe793c5[_0x13e0('0x2e')]=qs['limit'](_0x1aa9e9['query']['limit']);_0xe793c5[_0x13e0('0x18')]=qs[_0x13e0('0x18')](_0x1aa9e9[_0x13e0('0x25')]['offset']);}_0xe793c5[_0x13e0('0x2f')]=qs[_0x13e0('0x30')](_0x1aa9e9['query']['sort']);_0xe793c5[_0x13e0('0x31')]=qs[_0x13e0('0x26')](_['pick'](_0x1aa9e9[_0x13e0('0x25')],_0x32ab9a[_0x13e0('0x26')]));if(_0x1aa9e9['query'][_0x13e0('0x32')]){_0xe793c5[_0x13e0('0x31')]=_['merge'](_0xe793c5[_0x13e0('0x31')],{'$or':_[_0x13e0('0x33')](_0x22e3d2,function(_0x2c2844){if(_0x2c2844[_0x13e0('0x34')]['key']!=='VIRTUAL'){var _0x4b36eb={};_0x4b36eb[_0x2c2844['field']]={'$like':'%'+_0x1aa9e9[_0x13e0('0x25')][_0x13e0('0x32')]+'%'};return _0x4b36eb;}})});}_0xe793c5=_[_0x13e0('0x35')]({},_0xe793c5,_0x1aa9e9[_0x13e0('0x36')]);var _0x2d113f={'where':_0xe793c5['where']};return db[_0x13e0('0x37')][_0x13e0('0x38')](_0x2d113f)[_0x13e0('0x1e')](function(_0x117f34){_0x5e73e9[_0x13e0('0x38')]=_0x117f34;if(_0x1aa9e9[_0x13e0('0x25')][_0x13e0('0x39')]){_0xe793c5[_0x13e0('0x3a')]=[{'all':!![]}];}return db[_0x13e0('0x37')][_0x13e0('0x3b')](_0xe793c5);})[_0x13e0('0x1e')](function(_0x3103b5){_0x5e73e9[_0x13e0('0x3c')]=_0x3103b5;return _0x5e73e9;})[_0x13e0('0x1e')](respondWithFilteredResult(_0x298b04,_0xe793c5))[_0x13e0('0x3d')](handleError(_0x298b04,null));};exports[_0x13e0('0x3e')]=function(_0x1d95b6,_0x1d4fee){var _0x2c26f6={'raw':!![],'where':{'id':_0x1d95b6[_0x13e0('0x3f')]['id']}},_0x1fa825={};_0x1fa825[_0x13e0('0x29')]=_[_0x13e0('0x24')](db[_0x13e0('0x37')][_0x13e0('0x40')]);_0x1fa825[_0x13e0('0x25')]=_[_0x13e0('0x24')](_0x1d95b6[_0x13e0('0x25')]);_0x1fa825[_0x13e0('0x26')]=_[_0x13e0('0x28')](_0x1fa825[_0x13e0('0x29')],_0x1fa825[_0x13e0('0x25')]);_0x2c26f6[_0x13e0('0x27')]=_[_0x13e0('0x28')](_0x1fa825['model'],qs[_0x13e0('0x2a')](_0x1d95b6[_0x13e0('0x25')][_0x13e0('0x2a')]));_0x2c26f6['attributes']=_0x2c26f6[_0x13e0('0x27')][_0x13e0('0x2b')]?_0x2c26f6['attributes']:_0x1fa825[_0x13e0('0x29')];if(_0x1d95b6[_0x13e0('0x25')][_0x13e0('0x39')]){_0x2c26f6['include']=[{'all':!![]}];}_0x2c26f6=_[_0x13e0('0x35')]({},_0x2c26f6,_0x1d95b6[_0x13e0('0x36')]);return db['MailServerOut'][_0x13e0('0x41')](_0x2c26f6)['then'](handleEntityNotFound(_0x1d4fee,null))[_0x13e0('0x1e')](respondWithResult(_0x1d4fee,null))[_0x13e0('0x3d')](handleError(_0x1d4fee,null));};exports[_0x13e0('0x42')]=function(_0x168f50,_0x20f2ba){return db[_0x13e0('0x37')][_0x13e0('0x42')](_0x168f50['body'],{})['then'](respondWithResult(_0x20f2ba,0xc9))['catch'](handleError(_0x20f2ba,null));};exports[_0x13e0('0x1d')]=function(_0x56bc23,_0x192db5){if(_0x56bc23['body']['id']){delete _0x56bc23[_0x13e0('0x43')]['id'];}return db[_0x13e0('0x37')][_0x13e0('0x41')]({'where':{'id':_0x56bc23[_0x13e0('0x3f')]['id']}})[_0x13e0('0x1e')](handleEntityNotFound(_0x192db5,null))['then'](saveUpdates(_0x56bc23[_0x13e0('0x43')],null))[_0x13e0('0x1e')](respondWithResult(_0x192db5,null))['catch'](handleError(_0x192db5,null));};exports[_0x13e0('0x44')]=function(_0x2dcad1,_0x4d3f65){return db[_0x13e0('0x37')][_0x13e0('0x41')]({'where':{'id':_0x2dcad1[_0x13e0('0x3f')]['id']}})[_0x13e0('0x1e')](handleEntityNotFound(_0x4d3f65,null))[_0x13e0('0x1e')](removeEntity(_0x4d3f65,null))[_0x13e0('0x3d')](handleError(_0x4d3f65,null));}; \ No newline at end of file +var _0x0302=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','stack','name','MailServerOut','model','keys','query','intersection','attributes','fields','length','nolimit','order','filters','pick','filter','where','merge','map','key','field','includeAll','include','findAll','rows','catch','options','find','create','body','update','params'];(function(_0x401b8e,_0x334bb2){var _0x533f3e=function(_0x59ed14){while(--_0x59ed14){_0x401b8e['push'](_0x401b8e['shift']());}};_0x533f3e(++_0x334bb2);}(_0x0302,0x1e3));var _0x2030=function(_0x2a0455,_0x485f1f){_0x2a0455=_0x2a0455-0x0;var _0x3fd19d=_0x0302[_0x2a0455];return _0x3fd19d;};'use strict';var pdf=require(_0x2030('0x0'));var emlformat=require(_0x2030('0x1'));var rimraf=require(_0x2030('0x2'));var zipdir=require(_0x2030('0x3'));var jsonpatch=require(_0x2030('0x4'));var rp=require(_0x2030('0x5'));var moment=require(_0x2030('0x6'));var BPromise=require(_0x2030('0x7'));var Mustache=require(_0x2030('0x8'));var util=require(_0x2030('0x9'));var path=require(_0x2030('0xa'));var sox=require(_0x2030('0xb'));var csv=require('to-csv');var ejs=require(_0x2030('0xc'));var fs=require('fs');var _=require(_0x2030('0xd'));var squel=require(_0x2030('0xe'));var crypto=require(_0x2030('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x2030('0x10'));var toCsv=require(_0x2030('0x11'));var querystring=require(_0x2030('0x12'));var Papa=require(_0x2030('0x13'));var Redis=require(_0x2030('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x2030('0x15'));var hardwareService=require(_0x2030('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x2030('0x17'));var config=require(_0x2030('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17fcbd,_0x53a337){_0x53a337=_0x53a337||0xcc;return function(_0xab8ded){if(_0xab8ded){return _0x17fcbd[_0x2030('0x19')](_0x53a337);}return _0x17fcbd[_0x2030('0x1a')](_0x53a337)[_0x2030('0x1b')]();};}function respondWithResult(_0xa7feab,_0x1f73ee){_0x1f73ee=_0x1f73ee||0xc8;return function(_0x35fc8b){if(_0x35fc8b){return _0xa7feab['status'](_0x1f73ee)[_0x2030('0x1c')](_0x35fc8b);}};}function respondWithFilteredResult(_0x5743bd,_0x385281){return function(_0x3a0f47){if(_0x3a0f47){var _0x5d83b6=_0x3a0f47[_0x2030('0x1d')],_0x36952a=_0x385281[_0x2030('0x1e')],_0x247d8f=_0x385281[_0x2030('0x1e')]+_0x385281[_0x2030('0x1f')],_0x112e5f;if(_0x247d8f>=_0x5d83b6){_0x247d8f=_0x5d83b6;_0x112e5f=0xc8;}else{_0x112e5f=0xce;}_0x5743bd[_0x2030('0x1a')](_0x112e5f);return _0x5743bd[_0x2030('0x20')]('Content-Range',_0x36952a+'-'+_0x247d8f+'/'+_0x5d83b6)[_0x2030('0x1c')](_0x3a0f47);}return null;};}function patchUpdates(_0x39fa73){return function(_0x3b9c99){try{jsonpatch[_0x2030('0x21')](_0x3b9c99,_0x39fa73,!![]);}catch(_0x464406){return BPromise[_0x2030('0x22')](_0x464406);}return _0x3b9c99[_0x2030('0x23')]();};}function saveUpdates(_0x3f3e21,_0xf83990){return function(_0xdbf5d2){if(_0xdbf5d2){return _0xdbf5d2['update'](_0x3f3e21)[_0x2030('0x24')](function(_0x464a94){return _0x464a94;});}return null;};}function removeEntity(_0x41941f,_0x5b0710){return function(_0x25f75f){if(_0x25f75f){return _0x25f75f[_0x2030('0x25')]()['then'](function(){_0x41941f['status'](0xcc)[_0x2030('0x1b')]();});}};}function handleEntityNotFound(_0xee64b7,_0x3f8639){return function(_0x5925cc){if(!_0x5925cc){_0xee64b7['sendStatus'](0x194);}return _0x5925cc;};}function handleError(_0x5dbafd,_0x523115){_0x523115=_0x523115||0x1f4;return function(_0x279efd){logger['error'](_0x279efd[_0x2030('0x26')]);if(_0x279efd[_0x2030('0x27')]){delete _0x279efd[_0x2030('0x27')];}_0x5dbafd[_0x2030('0x1a')](_0x523115)['send'](_0x279efd);};}exports['index']=function(_0x154200,_0x546af4){var _0x59dd70={},_0x31625b={},_0x24c061={'count':0x0,'rows':[]};var _0x4d52d4=db[_0x2030('0x28')]['rawAttributes'];_0x31625b[_0x2030('0x29')]=_[_0x2030('0x2a')](_0x4d52d4);_0x31625b[_0x2030('0x2b')]=_['keys'](_0x154200[_0x2030('0x2b')]);_0x31625b['filters']=_[_0x2030('0x2c')](_0x31625b[_0x2030('0x29')],_0x31625b[_0x2030('0x2b')]);_0x59dd70[_0x2030('0x2d')]=_['intersection'](_0x31625b[_0x2030('0x29')],qs['fields'](_0x154200[_0x2030('0x2b')][_0x2030('0x2e')]));_0x59dd70[_0x2030('0x2d')]=_0x59dd70['attributes'][_0x2030('0x2f')]?_0x59dd70[_0x2030('0x2d')]:_0x31625b[_0x2030('0x29')];if(!_0x154200[_0x2030('0x2b')]['hasOwnProperty'](_0x2030('0x30'))){_0x59dd70[_0x2030('0x1f')]=qs[_0x2030('0x1f')](_0x154200[_0x2030('0x2b')][_0x2030('0x1f')]);_0x59dd70[_0x2030('0x1e')]=qs[_0x2030('0x1e')](_0x154200['query'][_0x2030('0x1e')]);}_0x59dd70[_0x2030('0x31')]=qs['sort'](_0x154200[_0x2030('0x2b')]['sort']);_0x59dd70['where']=qs[_0x2030('0x32')](_[_0x2030('0x33')](_0x154200[_0x2030('0x2b')],_0x31625b[_0x2030('0x32')]));if(_0x154200[_0x2030('0x2b')][_0x2030('0x34')]){_0x59dd70[_0x2030('0x35')]=_[_0x2030('0x36')](_0x59dd70[_0x2030('0x35')],{'$or':_[_0x2030('0x37')](_0x4d52d4,function(_0x58c62b){if(_0x58c62b['type'][_0x2030('0x38')]!=='VIRTUAL'){var _0x405189={};_0x405189[_0x58c62b[_0x2030('0x39')]]={'$like':'%'+_0x154200[_0x2030('0x2b')][_0x2030('0x34')]+'%'};return _0x405189;}})});}_0x59dd70=_['merge']({},_0x59dd70,_0x154200['options']);var _0x43ba7f={'where':_0x59dd70[_0x2030('0x35')]};return db[_0x2030('0x28')]['count'](_0x43ba7f)[_0x2030('0x24')](function(_0xa0226c){_0x24c061[_0x2030('0x1d')]=_0xa0226c;if(_0x154200['query'][_0x2030('0x3a')]){_0x59dd70[_0x2030('0x3b')]=[{'all':!![]}];}return db['MailServerOut'][_0x2030('0x3c')](_0x59dd70);})['then'](function(_0x291b75){_0x24c061[_0x2030('0x3d')]=_0x291b75;return _0x24c061;})[_0x2030('0x24')](respondWithFilteredResult(_0x546af4,_0x59dd70))[_0x2030('0x3e')](handleError(_0x546af4,null));};exports['show']=function(_0x27985a,_0x5232b2){var _0x15f50b={'raw':!![],'where':{'id':_0x27985a['params']['id']}},_0xd7f6ce={};_0xd7f6ce[_0x2030('0x29')]=_['keys'](db[_0x2030('0x28')]['rawAttributes']);_0xd7f6ce[_0x2030('0x2b')]=_['keys'](_0x27985a[_0x2030('0x2b')]);_0xd7f6ce[_0x2030('0x32')]=_[_0x2030('0x2c')](_0xd7f6ce[_0x2030('0x29')],_0xd7f6ce[_0x2030('0x2b')]);_0x15f50b[_0x2030('0x2d')]=_[_0x2030('0x2c')](_0xd7f6ce[_0x2030('0x29')],qs[_0x2030('0x2e')](_0x27985a[_0x2030('0x2b')][_0x2030('0x2e')]));_0x15f50b[_0x2030('0x2d')]=_0x15f50b[_0x2030('0x2d')][_0x2030('0x2f')]?_0x15f50b[_0x2030('0x2d')]:_0xd7f6ce[_0x2030('0x29')];if(_0x27985a['query'][_0x2030('0x3a')]){_0x15f50b[_0x2030('0x3b')]=[{'all':!![]}];}_0x15f50b=_['merge']({},_0x15f50b,_0x27985a[_0x2030('0x3f')]);return db[_0x2030('0x28')][_0x2030('0x40')](_0x15f50b)[_0x2030('0x24')](handleEntityNotFound(_0x5232b2,null))[_0x2030('0x24')](respondWithResult(_0x5232b2,null))[_0x2030('0x3e')](handleError(_0x5232b2,null));};exports[_0x2030('0x41')]=function(_0xe06a14,_0x3e550e){return db[_0x2030('0x28')][_0x2030('0x41')](_0xe06a14[_0x2030('0x42')],{})[_0x2030('0x24')](respondWithResult(_0x3e550e,0xc9))[_0x2030('0x3e')](handleError(_0x3e550e,null));};exports[_0x2030('0x43')]=function(_0x3d23d1,_0x329502){if(_0x3d23d1['body']['id']){delete _0x3d23d1[_0x2030('0x42')]['id'];}return db['MailServerOut'][_0x2030('0x40')]({'where':{'id':_0x3d23d1[_0x2030('0x44')]['id']}})[_0x2030('0x24')](handleEntityNotFound(_0x329502,null))[_0x2030('0x24')](saveUpdates(_0x3d23d1['body'],null))[_0x2030('0x24')](respondWithResult(_0x329502,null))[_0x2030('0x3e')](handleError(_0x329502,null));};exports['destroy']=function(_0x532155,_0x4b9974){return db['MailServerOut']['find']({'where':{'id':_0x532155[_0x2030('0x44')]['id']}})[_0x2030('0x24')](handleEntityNotFound(_0x4b9974,null))['then'](removeEntity(_0x4b9974,null))[_0x2030('0x3e')](handleError(_0x4b9974,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 77fd1c8..12c3f85 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 _0x7916=['../../config/logger','api','bluebird','request-promise','path','rimraf','./mailServerOut.attributes','MailServerOut','lodash'];(function(_0x2c534a,_0x18a19e){var _0x3f5c99=function(_0x4c085f){while(--_0x4c085f){_0x2c534a['push'](_0x2c534a['shift']());}};_0x3f5c99(++_0x18a19e);}(_0x7916,0x128));var _0x6791=function(_0x2edb0f,_0xffe08a){_0x2edb0f=_0x2edb0f-0x0;var _0x2c3cd8=_0x7916[_0x2edb0f];return _0x2c3cd8;};'use strict';var _=require(_0x6791('0x0'));var util=require('util');var logger=require(_0x6791('0x1'))(_0x6791('0x2'));var moment=require('moment');var BPromise=require(_0x6791('0x3'));var rp=require(_0x6791('0x4'));var fs=require('fs');var path=require(_0x6791('0x5'));var rimraf=require(_0x6791('0x6'));var config=require('../../config/environment');var attributes=require(_0x6791('0x7'));module['exports']=function(_0x3ca328,_0x3277a8){return _0x3ca328['define'](_0x6791('0x8'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ffd=['MailServerOut','mail_servers_out','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./mailServerOut.attributes','define'];(function(_0x16c824,_0x363c1d){var _0x267974=function(_0x58ab1f){while(--_0x58ab1f){_0x16c824['push'](_0x16c824['shift']());}};_0x267974(++_0x363c1d);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x432254,_0x3fbbd8){_0x432254=_0x432254-0x0;var _0x840b72=_0x9ffd[_0x432254];return _0x840b72;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var logger=require(_0xd9ff('0x2'))('api');var moment=require(_0xd9ff('0x3'));var BPromise=require(_0xd9ff('0x4'));var rp=require(_0xd9ff('0x5'));var fs=require('fs');var path=require(_0xd9ff('0x6'));var rimraf=require('rimraf');var config=require(_0xd9ff('0x7'));var attributes=require(_0xd9ff('0x8'));module['exports']=function(_0x3aa26b,_0x2982c3){return _0x3aa26b[_0xd9ff('0x9')](_0xd9ff('0xa'),attributes,{'tableName':_0xd9ff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index eac2766..b7f38c7 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 _0x7dc2=['jayson/promise','http','request','then','MailServerOut,\x20%s,\x20%s','debug','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x3e4f00,_0x2c3955){var _0x54472c=function(_0x18a570){while(--_0x18a570){_0x3e4f00['push'](_0x3e4f00['shift']());}};_0x54472c(++_0x2c3955);}(_0x7dc2,0x19d));var _0x27dc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7dc2[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x27dc('0x0'));var BPromise=require(_0x27dc('0x1'));var rs=require(_0x27dc('0x2'));var fs=require('fs');var Redis=require(_0x27dc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x27dc('0x4'));var logger=require(_0x27dc('0x5'))('rpc');var config=require(_0x27dc('0x6'));var jayson=require(_0x27dc('0x7'));var client=jayson['client'][_0x27dc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d2e10,_0x95bbb6,_0x3b3eee){return new BPromise(function(_0x5181ab,_0x45aa07){return client[_0x27dc('0x9')](_0x4d2e10,_0x3b3eee)[_0x27dc('0xa')](function(_0x242997){logger['info'](_0x27dc('0xb'),_0x95bbb6,'request\x20sent');logger[_0x27dc('0xc')](_0x27dc('0xd'),_0x95bbb6,_0x27dc('0xe'),JSON['stringify'](_0x242997));if(_0x242997['error']){if(_0x242997[_0x27dc('0xf')][_0x27dc('0x10')]===0x1f4){logger[_0x27dc('0xf')](_0x27dc('0xb'),_0x95bbb6,_0x242997['error'][_0x27dc('0x11')]);return _0x45aa07(_0x242997['error'][_0x27dc('0x11')]);}logger['error'](_0x27dc('0xb'),_0x95bbb6,_0x242997[_0x27dc('0xf')][_0x27dc('0x11')]);return _0x5181ab(_0x242997[_0x27dc('0xf')]['message']);}else{logger[_0x27dc('0x12')](_0x27dc('0xb'),_0x95bbb6,_0x27dc('0xe'));_0x5181ab(_0x242997[_0x27dc('0x13')][_0x27dc('0x11')]);}})['catch'](function(_0x3ff8f8){logger[_0x27dc('0xf')](_0x27dc('0xb'),_0x95bbb6,_0x3ff8f8);_0x45aa07(_0x3ff8f8);});});} \ No newline at end of file +var _0x22ef=['catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x22ef,0x169));var _0xf22e=function(_0x1b25b9,_0x29da8c){_0x1b25b9=_0x1b25b9-0x0;var _0x582dae=_0x22ef[_0x1b25b9];return _0x582dae;};'use strict';var _=require(_0xf22e('0x0'));var util=require('util');var moment=require(_0xf22e('0x1'));var BPromise=require('bluebird');var rs=require(_0xf22e('0x2'));var fs=require('fs');var Redis=require(_0xf22e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf22e('0x4'));var logger=require(_0xf22e('0x5'))(_0xf22e('0x6'));var config=require(_0xf22e('0x7'));var jayson=require(_0xf22e('0x8'));var client=jayson[_0xf22e('0x9')][_0xf22e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xca42a2,_0x459b6c,_0x58637d){return new BPromise(function(_0x464bce,_0x3a6125){return client[_0xf22e('0xb')](_0xca42a2,_0x58637d)[_0xf22e('0xc')](function(_0x58c117){logger[_0xf22e('0xd')](_0xf22e('0xe'),_0x459b6c,_0xf22e('0xf'));logger[_0xf22e('0x10')](_0xf22e('0x11'),_0x459b6c,_0xf22e('0xf'),JSON[_0xf22e('0x12')](_0x58c117));if(_0x58c117[_0xf22e('0x13')]){if(_0x58c117[_0xf22e('0x13')][_0xf22e('0x14')]===0x1f4){logger[_0xf22e('0x13')]('MailServerOut,\x20%s,\x20%s',_0x459b6c,_0x58c117[_0xf22e('0x13')][_0xf22e('0x15')]);return _0x3a6125(_0x58c117['error'][_0xf22e('0x15')]);}logger['error'](_0xf22e('0xe'),_0x459b6c,_0x58c117[_0xf22e('0x13')][_0xf22e('0x15')]);return _0x464bce(_0x58c117[_0xf22e('0x13')][_0xf22e('0x15')]);}else{logger[_0xf22e('0xd')]('MailServerOut,\x20%s,\x20%s',_0x459b6c,'request\x20sent');_0x464bce(_0x58c117[_0xf22e('0x16')][_0xf22e('0x15')]);}})[_0xf22e('0x17')](function(_0x3cb9e9){logger[_0xf22e('0x13')](_0xf22e('0xe'),_0x459b6c,_0x3cb9e9);_0x3a6125(_0x3cb9e9);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index a68b6a5..d29eec1 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 _0x0cf8=['isAuthenticated','index','/describe','show','create','put','update','delete','/:id','destroy','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get'];(function(_0xd6da11,_0x2e1d32){var _0x1708f3=function(_0x26d5df){while(--_0x26d5df){_0xd6da11['push'](_0xd6da11['shift']());}};_0x1708f3(++_0x2e1d32);}(_0x0cf8,0x10a));var _0x80cf=function(_0x228a07,_0x5d6049){_0x228a07=_0x228a07-0x0;var _0x52aa27=_0x0cf8[_0x228a07];return _0x52aa27;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x80cf('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x80cf('0x1'));var interaction=require(_0x80cf('0x2'));var config=require(_0x80cf('0x3'));var controller=require(_0x80cf('0x4'));router[_0x80cf('0x5')]('/',auth[_0x80cf('0x6')](),controller[_0x80cf('0x7')]);router[_0x80cf('0x5')](_0x80cf('0x8'),auth[_0x80cf('0x6')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x80cf('0x9')]);router['post']('/',auth[_0x80cf('0x6')](),controller[_0x80cf('0xa')]);router[_0x80cf('0xb')]('/:id',auth[_0x80cf('0x6')](),controller[_0x80cf('0xc')]);router[_0x80cf('0xd')](_0x80cf('0xe'),auth['isAuthenticated'](),controller[_0x80cf('0xf')]);module['exports']=router; \ No newline at end of file +var _0x2b81=['show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x132084,_0x5c5a51){var _0x2e043b=function(_0x428ed6){while(--_0x428ed6){_0x132084['push'](_0x132084['shift']());}};_0x2e043b(++_0x5c5a51);}(_0x2b81,0x141));var _0x12b8=function(_0x1a9f82,_0x1305dc){_0x1a9f82=_0x1a9f82-0x0;var _0x1c397c=_0x2b81[_0x1a9f82];return _0x1c397c;};'use strict';var multer=require(_0x12b8('0x0'));var util=require(_0x12b8('0x1'));var path=require(_0x12b8('0x2'));var timeout=require(_0x12b8('0x3'));var express=require(_0x12b8('0x4'));var router=express[_0x12b8('0x5')]();var auth=require(_0x12b8('0x6'));var interaction=require(_0x12b8('0x7'));var config=require(_0x12b8('0x8'));var controller=require(_0x12b8('0x9'));router[_0x12b8('0xa')]('/',auth[_0x12b8('0xb')](),controller[_0x12b8('0xc')]);router[_0x12b8('0xa')](_0x12b8('0xd'),auth[_0x12b8('0xb')](),controller['describe']);router['get'](_0x12b8('0xe'),auth[_0x12b8('0xb')](),controller[_0x12b8('0xf')]);router['post']('/',auth[_0x12b8('0xb')](),controller[_0x12b8('0x10')]);router[_0x12b8('0x11')](_0x12b8('0xe'),auth[_0x12b8('0xb')](),controller['update']);router[_0x12b8('0x12')](_0x12b8('0xe'),auth[_0x12b8('0xb')](),controller[_0x12b8('0x13')]);module[_0x12b8('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index a0c61f5..a7871ea 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 _0xe5fb=['name','STRING','sequelize','exports'];(function(_0x4e9e88,_0x19f8e6){var _0x2d535a=function(_0x59c559){while(--_0x59c559){_0x4e9e88['push'](_0x4e9e88['shift']());}};_0x2d535a(++_0x19f8e6);}(_0xe5fb,0xce));var _0xbe5f=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xe5fb[_0x5d2803];return _0xdcad2c;};'use strict';var Sequelize=require(_0xbe5f('0x0'));module[_0xbe5f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xbe5f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbe5f('0x3')]}}; \ No newline at end of file +var _0xefe3=['STRING','sequelize'];(function(_0x3ae680,_0x1b0756){var _0x943d54=function(_0x561578){while(--_0x561578){_0x3ae680['push'](_0x3ae680['shift']());}};_0x943d54(++_0x1b0756);}(_0xefe3,0xf5));var _0x3efe=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xefe3[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x3efe('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3efe('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index c7cf4af..a2b35c9 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 _0x7264=['to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','MailSubstatus','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','key','VIRTUAL','field','filter','count','findAll','rows','catch','show','params','includeAll','include','create','body','find','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','desk.js'];(function(_0x347596,_0x136104){var _0x5d3a33=function(_0x311646){while(--_0x311646){_0x347596['push'](_0x347596['shift']());}};_0x5d3a33(++_0x136104);}(_0x7264,0x15e));var _0x4726=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x7264[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require(_0x4726('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4726('0x1'));var zipdir=require(_0x4726('0x2'));var jsonpatch=require(_0x4726('0x3'));var rp=require(_0x4726('0x4'));var moment=require(_0x4726('0x5'));var BPromise=require(_0x4726('0x6'));var Mustache=require(_0x4726('0x7'));var util=require(_0x4726('0x8'));var path=require(_0x4726('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4726('0xa'));var fs=require('fs');var _=require(_0x4726('0xb'));var squel=require(_0x4726('0xc'));var crypto=require(_0x4726('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4726('0xe'));var toCsv=require(_0x4726('0xf'));var querystring=require(_0x4726('0x10'));var Papa=require(_0x4726('0x11'));var Redis=require('ioredis');var authService=require(_0x4726('0x12'));var qs=require(_0x4726('0x13'));var hardwareService=require(_0x4726('0x14'));var logger=require(_0x4726('0x15'))(_0x4726('0x16'));var utils=require(_0x4726('0x17'));var config=require('../../config/environment');var db=require(_0x4726('0x18'))['db'];function respondWithStatusCode(_0x4ae3d5,_0x389968){_0x389968=_0x389968||0xcc;return function(_0x538816){if(_0x538816){return _0x4ae3d5['sendStatus'](_0x389968);}return _0x4ae3d5['status'](_0x389968)['end']();};}function respondWithResult(_0x379fce,_0x26b010){_0x26b010=_0x26b010||0xc8;return function(_0x41fb97){if(_0x41fb97){return _0x379fce[_0x4726('0x19')](_0x26b010)[_0x4726('0x1a')](_0x41fb97);}};}function respondWithFilteredResult(_0x425bb6,_0x4ed4db){return function(_0x5c3c00){if(_0x5c3c00){var _0x188b4b=_0x5c3c00['count'],_0x33134b=_0x4ed4db[_0x4726('0x1b')],_0xd36e0d=_0x4ed4db[_0x4726('0x1b')]+_0x4ed4db[_0x4726('0x1c')],_0x2af689;if(_0xd36e0d>=_0x188b4b){_0xd36e0d=_0x188b4b;_0x2af689=0xc8;}else{_0x2af689=0xce;}_0x425bb6[_0x4726('0x19')](_0x2af689);return _0x425bb6[_0x4726('0x1d')](_0x4726('0x1e'),_0x33134b+'-'+_0xd36e0d+'/'+_0x188b4b)['json'](_0x5c3c00);}return null;};}function patchUpdates(_0x1979a3){return function(_0x1cdd31){try{jsonpatch['apply'](_0x1cdd31,_0x1979a3,!![]);}catch(_0x23a03a){return BPromise[_0x4726('0x1f')](_0x23a03a);}return _0x1cdd31[_0x4726('0x20')]();};}function saveUpdates(_0x4b9246,_0x1795f5){return function(_0x268012){if(_0x268012){return _0x268012[_0x4726('0x21')](_0x4b9246)[_0x4726('0x22')](function(_0x2d3db9){return _0x2d3db9;});}return null;};}function removeEntity(_0x1ccf7a,_0x52e32f){return function(_0x2e5923){if(_0x2e5923){return _0x2e5923[_0x4726('0x23')]()['then'](function(){_0x1ccf7a['status'](0xcc)[_0x4726('0x24')]();});}};}function handleEntityNotFound(_0x13675f,_0x3795a1){return function(_0x351323){if(!_0x351323){_0x13675f[_0x4726('0x25')](0x194);}return _0x351323;};}function handleError(_0x1d3c86,_0x106650){_0x106650=_0x106650||0x1f4;return function(_0x5014ea){logger['error'](_0x5014ea[_0x4726('0x26')]);if(_0x5014ea[_0x4726('0x27')]){delete _0x5014ea[_0x4726('0x27')];}_0x1d3c86[_0x4726('0x19')](_0x106650)[_0x4726('0x28')](_0x5014ea);};}exports[_0x4726('0x29')]=function(_0x28109c,_0x2b8ecb){var _0x357d7a={},_0x1de865={},_0x2ef8ef={'count':0x0,'rows':[]};var _0x514881=db[_0x4726('0x2a')][_0x4726('0x2b')];_0x1de865[_0x4726('0x2c')]=_['keys'](_0x514881);_0x1de865[_0x4726('0x2d')]=_[_0x4726('0x2e')](_0x28109c['query']);_0x1de865[_0x4726('0x2f')]=_[_0x4726('0x30')](_0x1de865['model'],_0x1de865[_0x4726('0x2d')]);_0x357d7a[_0x4726('0x31')]=_[_0x4726('0x30')](_0x1de865[_0x4726('0x2c')],qs[_0x4726('0x32')](_0x28109c[_0x4726('0x2d')]['fields']));_0x357d7a['attributes']=_0x357d7a[_0x4726('0x31')][_0x4726('0x33')]?_0x357d7a[_0x4726('0x31')]:_0x1de865['model'];if(!_0x28109c[_0x4726('0x2d')][_0x4726('0x34')]('nolimit')){_0x357d7a['limit']=qs['limit'](_0x28109c[_0x4726('0x2d')][_0x4726('0x1c')]);_0x357d7a[_0x4726('0x1b')]=qs[_0x4726('0x1b')](_0x28109c[_0x4726('0x2d')]['offset']);}_0x357d7a['order']=qs[_0x4726('0x35')](_0x28109c[_0x4726('0x2d')][_0x4726('0x35')]);_0x357d7a[_0x4726('0x36')]=qs[_0x4726('0x2f')](_[_0x4726('0x37')](_0x28109c['query'],_0x1de865['filters']));if(_0x28109c[_0x4726('0x2d')]['filter']){_0x357d7a[_0x4726('0x36')]=_[_0x4726('0x38')](_0x357d7a['where'],{'$or':_['map'](_0x514881,function(_0x4e953e){if(_0x4e953e['type'][_0x4726('0x39')]!==_0x4726('0x3a')){var _0x489b3f={};_0x489b3f[_0x4e953e[_0x4726('0x3b')]]={'$like':'%'+_0x28109c[_0x4726('0x2d')][_0x4726('0x3c')]+'%'};return _0x489b3f;}})});}_0x357d7a=_[_0x4726('0x38')]({},_0x357d7a,_0x28109c['options']);var _0x5f09a3={'where':_0x357d7a[_0x4726('0x36')]};return db['MailSubstatus'][_0x4726('0x3d')](_0x5f09a3)[_0x4726('0x22')](function(_0x1cbcd7){_0x2ef8ef[_0x4726('0x3d')]=_0x1cbcd7;if(_0x28109c['query']['includeAll']){_0x357d7a['include']=[{'all':!![]}];}return db[_0x4726('0x2a')][_0x4726('0x3e')](_0x357d7a);})[_0x4726('0x22')](function(_0x3ba8d4){_0x2ef8ef[_0x4726('0x3f')]=_0x3ba8d4;return _0x2ef8ef;})['then'](respondWithFilteredResult(_0x2b8ecb,_0x357d7a))[_0x4726('0x40')](handleError(_0x2b8ecb,null));};exports[_0x4726('0x41')]=function(_0x213814,_0x36fe9a){var _0xc3b62={'raw':!![],'where':{'id':_0x213814[_0x4726('0x42')]['id']}},_0x15ecea={};_0x15ecea['model']=_['keys'](db[_0x4726('0x2a')]['rawAttributes']);_0x15ecea[_0x4726('0x2d')]=_['keys'](_0x213814[_0x4726('0x2d')]);_0x15ecea[_0x4726('0x2f')]=_['intersection'](_0x15ecea[_0x4726('0x2c')],_0x15ecea[_0x4726('0x2d')]);_0xc3b62[_0x4726('0x31')]=_[_0x4726('0x30')](_0x15ecea[_0x4726('0x2c')],qs['fields'](_0x213814[_0x4726('0x2d')][_0x4726('0x32')]));_0xc3b62[_0x4726('0x31')]=_0xc3b62[_0x4726('0x31')]['length']?_0xc3b62[_0x4726('0x31')]:_0x15ecea[_0x4726('0x2c')];if(_0x213814[_0x4726('0x2d')][_0x4726('0x43')]){_0xc3b62[_0x4726('0x44')]=[{'all':!![]}];}_0xc3b62=_['merge']({},_0xc3b62,_0x213814['options']);return db[_0x4726('0x2a')]['find'](_0xc3b62)['then'](handleEntityNotFound(_0x36fe9a,null))[_0x4726('0x22')](respondWithResult(_0x36fe9a,null))[_0x4726('0x40')](handleError(_0x36fe9a,null));};exports[_0x4726('0x45')]=function(_0x1d9686,_0x3c562f){return db[_0x4726('0x2a')][_0x4726('0x45')](_0x1d9686['body'],{})[_0x4726('0x22')](respondWithResult(_0x3c562f,0xc9))['catch'](handleError(_0x3c562f,null));};exports[_0x4726('0x21')]=function(_0x351829,_0x4f022b){if(_0x351829[_0x4726('0x46')]['id']){delete _0x351829['body']['id'];}return db[_0x4726('0x2a')][_0x4726('0x47')]({'where':{'id':_0x351829[_0x4726('0x42')]['id']}})[_0x4726('0x22')](handleEntityNotFound(_0x4f022b,null))[_0x4726('0x22')](saveUpdates(_0x351829[_0x4726('0x46')],null))[_0x4726('0x22')](respondWithResult(_0x4f022b,null))[_0x4726('0x40')](handleError(_0x4f022b,null));};exports['destroy']=function(_0x2c6372,_0xa73870){return db[_0x4726('0x2a')][_0x4726('0x47')]({'where':{'id':_0x2c6372[_0x4726('0x42')]['id']}})[_0x4726('0x22')](handleEntityNotFound(_0xa73870,null))[_0x4726('0x22')](removeEntity(_0xa73870,null))[_0x4726('0x40')](handleError(_0xa73870,null));};exports['describe']=function(_0x1d11df,_0x23fe7f){return db['MailSubstatus'][_0x4726('0x48')]()['then'](respondWithResult(_0x23fe7f,null))[_0x4726('0x40')](handleError(_0x23fe7f,null));}; \ No newline at end of file +var _0xf515=['end','status','count','offset','limit','set','apply','reject','save','update','then','error','stack','name','send','MailSubstatus','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','map','type','key','VIRTUAL','field','includeAll','findAll','rows','catch','show','params','length','include','options','create','body','find','destroy','describe','html-pdf','eml-format','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','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf515,0x11a));var _0x5f51=function(_0x123dc9,_0x221db4){_0x123dc9=_0x123dc9-0x0;var _0x31115a=_0xf515[_0x123dc9];return _0x31115a;};'use strict';var pdf=require(_0x5f51('0x0'));var emlformat=require(_0x5f51('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5f51('0x2'));var rp=require(_0x5f51('0x3'));var moment=require(_0x5f51('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5f51('0x5'));var util=require(_0x5f51('0x6'));var path=require(_0x5f51('0x7'));var sox=require(_0x5f51('0x8'));var csv=require(_0x5f51('0x9'));var ejs=require(_0x5f51('0xa'));var fs=require('fs');var _=require(_0x5f51('0xb'));var squel=require(_0x5f51('0xc'));var crypto=require(_0x5f51('0xd'));var jsforce=require(_0x5f51('0xe'));var deskjs=require(_0x5f51('0xf'));var toCsv=require(_0x5f51('0x9'));var querystring=require(_0x5f51('0x10'));var Papa=require('papaparse');var Redis=require(_0x5f51('0x11'));var authService=require(_0x5f51('0x12'));var qs=require(_0x5f51('0x13'));var hardwareService=require(_0x5f51('0x14'));var logger=require(_0x5f51('0x15'))(_0x5f51('0x16'));var utils=require('../../config/utils');var config=require(_0x5f51('0x17'));var db=require(_0x5f51('0x18'))['db'];function respondWithStatusCode(_0x581c37,_0x27ced5){_0x27ced5=_0x27ced5||0xcc;return function(_0x53a0b3){if(_0x53a0b3){return _0x581c37[_0x5f51('0x19')](_0x27ced5);}return _0x581c37['status'](_0x27ced5)[_0x5f51('0x1a')]();};}function respondWithResult(_0x2d02cf,_0x37d258){_0x37d258=_0x37d258||0xc8;return function(_0x4536d0){if(_0x4536d0){return _0x2d02cf[_0x5f51('0x1b')](_0x37d258)['json'](_0x4536d0);}};}function respondWithFilteredResult(_0x21127a,_0x4d7ffc){return function(_0x17471d){if(_0x17471d){var _0x37619b=_0x17471d[_0x5f51('0x1c')],_0x546119=_0x4d7ffc[_0x5f51('0x1d')],_0x4e40db=_0x4d7ffc['offset']+_0x4d7ffc[_0x5f51('0x1e')],_0x4493b9;if(_0x4e40db>=_0x37619b){_0x4e40db=_0x37619b;_0x4493b9=0xc8;}else{_0x4493b9=0xce;}_0x21127a[_0x5f51('0x1b')](_0x4493b9);return _0x21127a[_0x5f51('0x1f')]('Content-Range',_0x546119+'-'+_0x4e40db+'/'+_0x37619b)['json'](_0x17471d);}return null;};}function patchUpdates(_0x563e48){return function(_0x570e4c){try{jsonpatch[_0x5f51('0x20')](_0x570e4c,_0x563e48,!![]);}catch(_0x4a4b40){return BPromise[_0x5f51('0x21')](_0x4a4b40);}return _0x570e4c[_0x5f51('0x22')]();};}function saveUpdates(_0x304e69,_0x455f97){return function(_0x2c20fd){if(_0x2c20fd){return _0x2c20fd[_0x5f51('0x23')](_0x304e69)[_0x5f51('0x24')](function(_0x1d19da){return _0x1d19da;});}return null;};}function removeEntity(_0x1e573e,_0x38b2ed){return function(_0x435363){if(_0x435363){return _0x435363['destroy']()[_0x5f51('0x24')](function(){_0x1e573e['status'](0xcc)[_0x5f51('0x1a')]();});}};}function handleEntityNotFound(_0x2745af,_0x4ca9d5){return function(_0x55cec1){if(!_0x55cec1){_0x2745af[_0x5f51('0x19')](0x194);}return _0x55cec1;};}function handleError(_0x58cb99,_0x22323c){_0x22323c=_0x22323c||0x1f4;return function(_0x5d9eba){logger[_0x5f51('0x25')](_0x5d9eba[_0x5f51('0x26')]);if(_0x5d9eba[_0x5f51('0x27')]){delete _0x5d9eba[_0x5f51('0x27')];}_0x58cb99['status'](_0x22323c)[_0x5f51('0x28')](_0x5d9eba);};}exports['index']=function(_0x47d9a5,_0x3bc11d){var _0x1087d8={},_0x5372f6={},_0x3684d0={'count':0x0,'rows':[]};var _0x51d541=db[_0x5f51('0x29')][_0x5f51('0x2a')];_0x5372f6[_0x5f51('0x2b')]=_[_0x5f51('0x2c')](_0x51d541);_0x5372f6[_0x5f51('0x2d')]=_[_0x5f51('0x2c')](_0x47d9a5[_0x5f51('0x2d')]);_0x5372f6['filters']=_[_0x5f51('0x2e')](_0x5372f6[_0x5f51('0x2b')],_0x5372f6[_0x5f51('0x2d')]);_0x1087d8[_0x5f51('0x2f')]=_[_0x5f51('0x2e')](_0x5372f6[_0x5f51('0x2b')],qs[_0x5f51('0x30')](_0x47d9a5[_0x5f51('0x2d')][_0x5f51('0x30')]));_0x1087d8['attributes']=_0x1087d8['attributes']['length']?_0x1087d8[_0x5f51('0x2f')]:_0x5372f6[_0x5f51('0x2b')];if(!_0x47d9a5[_0x5f51('0x2d')][_0x5f51('0x31')](_0x5f51('0x32'))){_0x1087d8['limit']=qs[_0x5f51('0x1e')](_0x47d9a5[_0x5f51('0x2d')]['limit']);_0x1087d8[_0x5f51('0x1d')]=qs['offset'](_0x47d9a5[_0x5f51('0x2d')]['offset']);}_0x1087d8[_0x5f51('0x33')]=qs[_0x5f51('0x34')](_0x47d9a5[_0x5f51('0x2d')][_0x5f51('0x34')]);_0x1087d8['where']=qs['filters'](_[_0x5f51('0x35')](_0x47d9a5[_0x5f51('0x2d')],_0x5372f6[_0x5f51('0x36')]));if(_0x47d9a5['query'][_0x5f51('0x37')]){_0x1087d8[_0x5f51('0x38')]=_[_0x5f51('0x39')](_0x1087d8['where'],{'$or':_[_0x5f51('0x3a')](_0x51d541,function(_0x533275){if(_0x533275[_0x5f51('0x3b')][_0x5f51('0x3c')]!==_0x5f51('0x3d')){var _0x200b62={};_0x200b62[_0x533275[_0x5f51('0x3e')]]={'$like':'%'+_0x47d9a5['query'][_0x5f51('0x37')]+'%'};return _0x200b62;}})});}_0x1087d8=_[_0x5f51('0x39')]({},_0x1087d8,_0x47d9a5['options']);var _0x44683a={'where':_0x1087d8['where']};return db[_0x5f51('0x29')][_0x5f51('0x1c')](_0x44683a)[_0x5f51('0x24')](function(_0x10c439){_0x3684d0[_0x5f51('0x1c')]=_0x10c439;if(_0x47d9a5[_0x5f51('0x2d')][_0x5f51('0x3f')]){_0x1087d8['include']=[{'all':!![]}];}return db[_0x5f51('0x29')][_0x5f51('0x40')](_0x1087d8);})[_0x5f51('0x24')](function(_0x27eeaf){_0x3684d0[_0x5f51('0x41')]=_0x27eeaf;return _0x3684d0;})[_0x5f51('0x24')](respondWithFilteredResult(_0x3bc11d,_0x1087d8))[_0x5f51('0x42')](handleError(_0x3bc11d,null));};exports[_0x5f51('0x43')]=function(_0x8e1000,_0x552286){var _0x26c131={'raw':!![],'where':{'id':_0x8e1000[_0x5f51('0x44')]['id']}},_0x1cc942={};_0x1cc942['model']=_[_0x5f51('0x2c')](db[_0x5f51('0x29')]['rawAttributes']);_0x1cc942[_0x5f51('0x2d')]=_[_0x5f51('0x2c')](_0x8e1000[_0x5f51('0x2d')]);_0x1cc942['filters']=_['intersection'](_0x1cc942[_0x5f51('0x2b')],_0x1cc942[_0x5f51('0x2d')]);_0x26c131[_0x5f51('0x2f')]=_[_0x5f51('0x2e')](_0x1cc942['model'],qs['fields'](_0x8e1000[_0x5f51('0x2d')][_0x5f51('0x30')]));_0x26c131[_0x5f51('0x2f')]=_0x26c131['attributes'][_0x5f51('0x45')]?_0x26c131[_0x5f51('0x2f')]:_0x1cc942[_0x5f51('0x2b')];if(_0x8e1000[_0x5f51('0x2d')]['includeAll']){_0x26c131[_0x5f51('0x46')]=[{'all':!![]}];}_0x26c131=_[_0x5f51('0x39')]({},_0x26c131,_0x8e1000[_0x5f51('0x47')]);return db['MailSubstatus']['find'](_0x26c131)[_0x5f51('0x24')](handleEntityNotFound(_0x552286,null))[_0x5f51('0x24')](respondWithResult(_0x552286,null))[_0x5f51('0x42')](handleError(_0x552286,null));};exports[_0x5f51('0x48')]=function(_0x520355,_0x5590f8){return db['MailSubstatus'][_0x5f51('0x48')](_0x520355[_0x5f51('0x49')],{})[_0x5f51('0x24')](respondWithResult(_0x5590f8,0xc9))['catch'](handleError(_0x5590f8,null));};exports[_0x5f51('0x23')]=function(_0x1407f4,_0x40f087){if(_0x1407f4['body']['id']){delete _0x1407f4[_0x5f51('0x49')]['id'];}return db[_0x5f51('0x29')][_0x5f51('0x4a')]({'where':{'id':_0x1407f4[_0x5f51('0x44')]['id']}})['then'](handleEntityNotFound(_0x40f087,null))[_0x5f51('0x24')](saveUpdates(_0x1407f4['body'],null))[_0x5f51('0x24')](respondWithResult(_0x40f087,null))[_0x5f51('0x42')](handleError(_0x40f087,null));};exports[_0x5f51('0x4b')]=function(_0x42d2f1,_0x24f27c){return db[_0x5f51('0x29')][_0x5f51('0x4a')]({'where':{'id':_0x42d2f1['params']['id']}})['then'](handleEntityNotFound(_0x24f27c,null))[_0x5f51('0x24')](removeEntity(_0x24f27c,null))[_0x5f51('0x42')](handleError(_0x24f27c,null));};exports['describe']=function(_0x122d4e,_0x2db735){return db['MailSubstatus'][_0x5f51('0x4c')]()[_0x5f51('0x24')](respondWithResult(_0x2db735,null))['catch'](handleError(_0x2db735,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 367f2cc..d708107 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 _0x5ad1=['rimraf','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x3ac251,_0xc964a2){var _0x5ba7a7=function(_0x20132c){while(--_0x20132c){_0x3ac251['push'](_0x3ac251['shift']());}};_0x5ba7a7(++_0xc964a2);}(_0x5ad1,0x96));var _0x15ad=function(_0x17140d,_0x1fc05b){_0x17140d=_0x17140d-0x0;var _0x523991=_0x5ad1[_0x17140d];return _0x523991;};'use strict';var _=require(_0x15ad('0x0'));var util=require(_0x15ad('0x1'));var logger=require(_0x15ad('0x2'))('api');var moment=require(_0x15ad('0x3'));var BPromise=require('bluebird');var rp=require(_0x15ad('0x4'));var fs=require('fs');var path=require(_0x15ad('0x5'));var rimraf=require(_0x15ad('0x6'));var config=require('../../config/environment');var attributes=require(_0x15ad('0x7'));module[_0x15ad('0x8')]=function(_0x5056cd,_0x27ec23){return _0x5056cd[_0x15ad('0x9')](_0x15ad('0xa'),attributes,{'tableName':_0x15ad('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x88e1=['mail_substatuses','util','../../config/logger','api','request-promise','rimraf','../../config/environment','exports','define','MailSubstatus'];(function(_0x20a9dc,_0x391190){var _0x489f97=function(_0xa0abb5){while(--_0xa0abb5){_0x20a9dc['push'](_0x20a9dc['shift']());}};_0x489f97(++_0x391190);}(_0x88e1,0x14b));var _0x188e=function(_0x567ad7,_0x4f55e0){_0x567ad7=_0x567ad7-0x0;var _0x338c0e=_0x88e1[_0x567ad7];return _0x338c0e;};'use strict';var _=require('lodash');var util=require(_0x188e('0x0'));var logger=require(_0x188e('0x1'))(_0x188e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x188e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x188e('0x4'));var config=require(_0x188e('0x5'));var attributes=require('./mailSubstatus.attributes');module[_0x188e('0x6')]=function(_0x1b351f,_0x3c548b){return _0x1b351f[_0x188e('0x7')](_0x188e('0x8'),attributes,{'tableName':_0x188e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 2e21929..42d85e5 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 _0x6c11=['code','MailSubstatus,\x20%s,\x20%s','message','result','catch','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x53ed0b,_0x25e205){var _0x453628=function(_0x2b0c51){while(--_0x2b0c51){_0x53ed0b['push'](_0x53ed0b['shift']());}};_0x453628(++_0x25e205);}(_0x6c11,0x122));var _0x16c1=function(_0x56f8a4,_0x31119c){_0x56f8a4=_0x56f8a4-0x0;var _0x1f33be=_0x6c11[_0x56f8a4];return _0x1f33be;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x16c1('0x0'));var BPromise=require('bluebird');var rs=require(_0x16c1('0x1'));var fs=require('fs');var Redis=require(_0x16c1('0x2'));var db=require(_0x16c1('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x16c1('0x4'));var config=require(_0x16c1('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x16c1('0x6')][_0x16c1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5bff05,_0x3b734f,_0xf0048e){return new BPromise(function(_0x1d83c2,_0x1816e0){return client[_0x16c1('0x8')](_0x5bff05,_0xf0048e)[_0x16c1('0x9')](function(_0x4706bd){logger[_0x16c1('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x3b734f,'request\x20sent');logger['debug'](_0x16c1('0xb'),_0x3b734f,_0x16c1('0xc'),JSON['stringify'](_0x4706bd));if(_0x4706bd[_0x16c1('0xd')]){if(_0x4706bd['error'][_0x16c1('0xe')]===0x1f4){logger[_0x16c1('0xd')](_0x16c1('0xf'),_0x3b734f,_0x4706bd[_0x16c1('0xd')][_0x16c1('0x10')]);return _0x1816e0(_0x4706bd['error'][_0x16c1('0x10')]);}logger[_0x16c1('0xd')](_0x16c1('0xf'),_0x3b734f,_0x4706bd[_0x16c1('0xd')][_0x16c1('0x10')]);return _0x1d83c2(_0x4706bd[_0x16c1('0xd')][_0x16c1('0x10')]);}else{logger[_0x16c1('0xa')](_0x16c1('0xf'),_0x3b734f,_0x16c1('0xc'));_0x1d83c2(_0x4706bd[_0x16c1('0x11')][_0x16c1('0x10')]);}})[_0x16c1('0x12')](function(_0x4f2c76){logger[_0x16c1('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x3b734f,_0x4f2c76);_0x1816e0(_0x4f2c76);});});} \ No newline at end of file +var _0x00b9=['then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x2f0e82,_0x50879a){var _0x1d2d4b=function(_0x5741dc){while(--_0x5741dc){_0x2f0e82['push'](_0x2f0e82['shift']());}};_0x1d2d4b(++_0x50879a);}(_0x00b9,0x7f));var _0x900b=function(_0x1a8086,_0x18ab25){_0x1a8086=_0x1a8086-0x0;var _0x1fad6f=_0x00b9[_0x1a8086];return _0x1fad6f;};'use strict';var _=require(_0x900b('0x0'));var util=require('util');var moment=require(_0x900b('0x1'));var BPromise=require(_0x900b('0x2'));var rs=require(_0x900b('0x3'));var fs=require('fs');var Redis=require(_0x900b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x900b('0x5'));var logger=require(_0x900b('0x6'))('rpc');var config=require(_0x900b('0x7'));var jayson=require(_0x900b('0x8'));var client=jayson[_0x900b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5037c0,_0x120e54,_0x33278c){return new BPromise(function(_0x2b4f18,_0xce3e5){return client[_0x900b('0xa')](_0x5037c0,_0x33278c)[_0x900b('0xb')](function(_0x5f3455){logger[_0x900b('0xc')](_0x900b('0xd'),_0x120e54,_0x900b('0xe'));logger[_0x900b('0xf')](_0x900b('0x10'),_0x120e54,_0x900b('0xe'),JSON[_0x900b('0x11')](_0x5f3455));if(_0x5f3455['error']){if(_0x5f3455[_0x900b('0x12')][_0x900b('0x13')]===0x1f4){logger[_0x900b('0x12')](_0x900b('0xd'),_0x120e54,_0x5f3455[_0x900b('0x12')][_0x900b('0x14')]);return _0xce3e5(_0x5f3455[_0x900b('0x12')][_0x900b('0x14')]);}logger['error'](_0x900b('0xd'),_0x120e54,_0x5f3455[_0x900b('0x12')][_0x900b('0x14')]);return _0x2b4f18(_0x5f3455[_0x900b('0x12')][_0x900b('0x14')]);}else{logger['info'](_0x900b('0xd'),_0x120e54,_0x900b('0xe'));_0x2b4f18(_0x5f3455[_0x900b('0x15')][_0x900b('0x14')]);}})[_0x900b('0x16')](function(_0x2529a2){logger[_0x900b('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x120e54,_0x2529a2);_0xce3e5(_0x2529a2);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index fa38391..e1e33b2 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 _0xabce=['../../components/interaction/service','../../config/environment','./mailTransferReport.controller','index','/describe','describe','get','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1c7cac,_0x2f2b31){var _0xe8653a=function(_0x4bbb7d){while(--_0x4bbb7d){_0x1c7cac['push'](_0x1c7cac['shift']());}};_0xe8653a(++_0x2f2b31);}(_0xabce,0x103));var _0xeabc=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xabce[_0x3ce3c];return _0x55a2c9;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xeabc('0x5'));var config=require(_0xeabc('0x6'));var controller=require(_0xeabc('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xeabc('0x8')]);router['get'](_0xeabc('0x9'),auth['isAuthenticated'](),controller[_0xeabc('0xa')]);router[_0xeabc('0xb')](_0xeabc('0xc'),auth['isAuthenticated'](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')]('/',auth[_0xeabc('0xf')](),controller[_0xeabc('0x10')]);router[_0xeabc('0x11')](_0xeabc('0xc'),auth[_0xeabc('0xf')](),controller[_0xeabc('0x12')]);router[_0xeabc('0x13')](_0xeabc('0xc'),auth[_0xeabc('0xf')](),controller[_0xeabc('0x14')]);module[_0xeabc('0x15')]=router; \ No newline at end of file +var _0x8ca9=['express','Router','../../components/auth/service','./mailTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x7adf1b,_0x16758d){var _0x24ed2=function(_0x56f0b8){while(--_0x56f0b8){_0x7adf1b['push'](_0x7adf1b['shift']());}};_0x24ed2(++_0x16758d);}(_0x8ca9,0x9c));var _0x98ca=function(_0x2d6023,_0x11d50d){_0x2d6023=_0x2d6023-0x0;var _0x4b6641=_0x8ca9[_0x2d6023];return _0x4b6641;};'use strict';var multer=require(_0x98ca('0x0'));var util=require(_0x98ca('0x1'));var path=require(_0x98ca('0x2'));var timeout=require(_0x98ca('0x3'));var express=require(_0x98ca('0x4'));var router=express[_0x98ca('0x5')]();var auth=require(_0x98ca('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x98ca('0x7'));router['get']('/',auth[_0x98ca('0x8')](),controller['index']);router[_0x98ca('0x9')](_0x98ca('0xa'),auth[_0x98ca('0x8')](),controller[_0x98ca('0xb')]);router[_0x98ca('0x9')](_0x98ca('0xc'),auth[_0x98ca('0x8')](),controller[_0x98ca('0xd')]);router[_0x98ca('0xe')]('/',auth[_0x98ca('0x8')](),controller[_0x98ca('0xf')]);router[_0x98ca('0x10')](_0x98ca('0xc'),auth[_0x98ca('0x8')](),controller[_0x98ca('0x11')]);router[_0x98ca('0x12')](_0x98ca('0xc'),auth[_0x98ca('0x8')](),controller['destroy']);module[_0x98ca('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 5d7ac13..b04d49b 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 _0xda04=['queue','NOW','exports','STRING','ENUM','account','agent'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xda04,0x79));var _0x4da0=function(_0x2c16ab,_0xaa3f47){_0x2c16ab=_0x2c16ab-0x0;var _0x50d50c=_0xda04[_0x2c16ab];return _0x50d50c;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x4da0('0x0')]={'uniqueid':{'type':Sequelize[_0x4da0('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4da0('0x2')](_0x4da0('0x3'),_0x4da0('0x4'),_0x4da0('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x4da0('0x6')]}}; \ No newline at end of file +var _0x071b=['queue','moment','ENUM','agent'];(function(_0x3b711c,_0x4b22dc){var _0x2685f0=function(_0x3b5ba6){while(--_0x3b5ba6){_0x3b711c['push'](_0x3b711c['shift']());}};_0x2685f0(++_0x4b22dc);}(_0x071b,0x1b5));var _0xb071=function(_0x319ebe,_0x1a4351){_0x319ebe=_0x319ebe-0x0;var _0x459b0f=_0x071b[_0x319ebe];return _0x459b0f;};'use strict';var moment=require(_0xb071('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb071('0x1')]('account',_0xb071('0x2'),_0xb071('0x3')),'allowNull':![],'defaultValue':_0xb071('0x3')},'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 6525c51..aeab971 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 _0x96cc=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','MailTransferReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','includeAll','find','create','body','params','describe','html-pdf'];(function(_0x974893,_0x51e86c){var _0x44a3d3=function(_0x3bce5e){while(--_0x3bce5e){_0x974893['push'](_0x974893['shift']());}};_0x44a3d3(++_0x51e86c);}(_0x96cc,0x16c));var _0xc96c=function(_0x559434,_0x2f9870){_0x559434=_0x559434-0x0;var _0x252834=_0x96cc[_0x559434];return _0x252834;};'use strict';var pdf=require(_0xc96c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc96c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc96c('0x2'));var rp=require(_0xc96c('0x3'));var moment=require(_0xc96c('0x4'));var BPromise=require(_0xc96c('0x5'));var Mustache=require(_0xc96c('0x6'));var util=require(_0xc96c('0x7'));var path=require(_0xc96c('0x8'));var sox=require(_0xc96c('0x9'));var csv=require(_0xc96c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc96c('0xb'));var squel=require(_0xc96c('0xc'));var crypto=require(_0xc96c('0xd'));var jsforce=require(_0xc96c('0xe'));var deskjs=require(_0xc96c('0xf'));var toCsv=require(_0xc96c('0xa'));var querystring=require(_0xc96c('0x10'));var Papa=require('papaparse');var Redis=require(_0xc96c('0x11'));var authService=require(_0xc96c('0x12'));var qs=require(_0xc96c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc96c('0x14'))('api');var utils=require(_0xc96c('0x15'));var config=require('../../config/environment');var db=require(_0xc96c('0x16'))['db'];function respondWithStatusCode(_0x32f682,_0x3ef47a){_0x3ef47a=_0x3ef47a||0xcc;return function(_0x246a95){if(_0x246a95){return _0x32f682['sendStatus'](_0x3ef47a);}return _0x32f682[_0xc96c('0x17')](_0x3ef47a)[_0xc96c('0x18')]();};}function respondWithResult(_0x1e7742,_0x3f65fd){_0x3f65fd=_0x3f65fd||0xc8;return function(_0x48de8d){if(_0x48de8d){return _0x1e7742[_0xc96c('0x17')](_0x3f65fd)[_0xc96c('0x19')](_0x48de8d);}};}function respondWithFilteredResult(_0x399267,_0x32e640){return function(_0x377dbc){if(_0x377dbc){var _0x46455a=_0x377dbc[_0xc96c('0x1a')],_0x1765d9=_0x32e640[_0xc96c('0x1b')],_0x23e357=_0x32e640['offset']+_0x32e640['limit'],_0x174852;if(_0x23e357>=_0x46455a){_0x23e357=_0x46455a;_0x174852=0xc8;}else{_0x174852=0xce;}_0x399267[_0xc96c('0x17')](_0x174852);return _0x399267[_0xc96c('0x1c')](_0xc96c('0x1d'),_0x1765d9+'-'+_0x23e357+'/'+_0x46455a)[_0xc96c('0x19')](_0x377dbc);}return null;};}function patchUpdates(_0x4aa6a3){return function(_0x2c4c83){try{jsonpatch[_0xc96c('0x1e')](_0x2c4c83,_0x4aa6a3,!![]);}catch(_0x2a361c){return BPromise[_0xc96c('0x1f')](_0x2a361c);}return _0x2c4c83[_0xc96c('0x20')]();};}function saveUpdates(_0x335910,_0x43cc22){return function(_0x41daba){if(_0x41daba){return _0x41daba[_0xc96c('0x21')](_0x335910)[_0xc96c('0x22')](function(_0x2bb397){return _0x2bb397;});}return null;};}function removeEntity(_0x1203a1,_0x3f9603){return function(_0x45edee){if(_0x45edee){return _0x45edee[_0xc96c('0x23')]()[_0xc96c('0x22')](function(){_0x1203a1[_0xc96c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd63951,_0x4be783){return function(_0x4456bf){if(!_0x4456bf){_0xd63951[_0xc96c('0x24')](0x194);}return _0x4456bf;};}function handleError(_0x2b1df9,_0x35f480){_0x35f480=_0x35f480||0x1f4;return function(_0x40f23d){logger[_0xc96c('0x25')](_0x40f23d[_0xc96c('0x26')]);if(_0x40f23d[_0xc96c('0x27')]){delete _0x40f23d['name'];}_0x2b1df9[_0xc96c('0x17')](_0x35f480)[_0xc96c('0x28')](_0x40f23d);};}exports[_0xc96c('0x29')]=function(_0x294fee,_0x58fab3){var _0x5c00b6={},_0x39c191={},_0x12c293={'count':0x0,'rows':[]};var _0x3ef02c=db[_0xc96c('0x2a')][_0xc96c('0x2b')];_0x39c191[_0xc96c('0x2c')]=_[_0xc96c('0x2d')](_0x3ef02c);_0x39c191[_0xc96c('0x2e')]=_[_0xc96c('0x2d')](_0x294fee[_0xc96c('0x2e')]);_0x39c191[_0xc96c('0x2f')]=_[_0xc96c('0x30')](_0x39c191[_0xc96c('0x2c')],_0x39c191[_0xc96c('0x2e')]);_0x5c00b6['attributes']=_[_0xc96c('0x30')](_0x39c191['model'],qs[_0xc96c('0x31')](_0x294fee[_0xc96c('0x2e')][_0xc96c('0x31')]));_0x5c00b6['attributes']=_0x5c00b6[_0xc96c('0x32')][_0xc96c('0x33')]?_0x5c00b6[_0xc96c('0x32')]:_0x39c191[_0xc96c('0x2c')];if(!_0x294fee['query']['hasOwnProperty'](_0xc96c('0x34'))){_0x5c00b6[_0xc96c('0x35')]=qs[_0xc96c('0x35')](_0x294fee['query'][_0xc96c('0x35')]);_0x5c00b6[_0xc96c('0x1b')]=qs[_0xc96c('0x1b')](_0x294fee[_0xc96c('0x2e')]['offset']);}_0x5c00b6[_0xc96c('0x36')]=qs[_0xc96c('0x37')](_0x294fee['query'][_0xc96c('0x37')]);_0x5c00b6[_0xc96c('0x38')]=qs[_0xc96c('0x2f')](_[_0xc96c('0x39')](_0x294fee[_0xc96c('0x2e')],_0x39c191[_0xc96c('0x2f')]));if(_0x294fee['query'][_0xc96c('0x3a')]){_0x5c00b6[_0xc96c('0x38')]=_[_0xc96c('0x3b')](_0x5c00b6[_0xc96c('0x38')],{'$or':_[_0xc96c('0x3c')](_0x3ef02c,function(_0x332f55){if(_0x332f55['type']['key']!==_0xc96c('0x3d')){var _0x156d0f={};_0x156d0f[_0x332f55['field']]={'$like':'%'+_0x294fee['query'][_0xc96c('0x3a')]+'%'};return _0x156d0f;}})});}_0x5c00b6=_[_0xc96c('0x3b')]({},_0x5c00b6,_0x294fee[_0xc96c('0x3e')]);var _0x1d6054={'where':_0x5c00b6[_0xc96c('0x38')]};return db[_0xc96c('0x2a')][_0xc96c('0x1a')](_0x1d6054)[_0xc96c('0x22')](function(_0x3fc40d){_0x12c293[_0xc96c('0x1a')]=_0x3fc40d;if(_0x294fee[_0xc96c('0x2e')]['includeAll']){_0x5c00b6[_0xc96c('0x3f')]=[{'all':!![]}];}return db[_0xc96c('0x2a')][_0xc96c('0x40')](_0x5c00b6);})[_0xc96c('0x22')](function(_0x4eb180){_0x12c293[_0xc96c('0x41')]=_0x4eb180;return _0x12c293;})[_0xc96c('0x22')](respondWithFilteredResult(_0x58fab3,_0x5c00b6))[_0xc96c('0x42')](handleError(_0x58fab3,null));};exports['show']=function(_0x510252,_0x311a9e){var _0x29a772={'raw':!![],'where':{'id':_0x510252['params']['id']}},_0x2e3bc3={};_0x2e3bc3[_0xc96c('0x2c')]=_[_0xc96c('0x2d')](db[_0xc96c('0x2a')][_0xc96c('0x2b')]);_0x2e3bc3[_0xc96c('0x2e')]=_[_0xc96c('0x2d')](_0x510252[_0xc96c('0x2e')]);_0x2e3bc3[_0xc96c('0x2f')]=_[_0xc96c('0x30')](_0x2e3bc3['model'],_0x2e3bc3['query']);_0x29a772[_0xc96c('0x32')]=_[_0xc96c('0x30')](_0x2e3bc3[_0xc96c('0x2c')],qs[_0xc96c('0x31')](_0x510252['query']['fields']));_0x29a772[_0xc96c('0x32')]=_0x29a772[_0xc96c('0x32')][_0xc96c('0x33')]?_0x29a772[_0xc96c('0x32')]:_0x2e3bc3[_0xc96c('0x2c')];if(_0x510252[_0xc96c('0x2e')][_0xc96c('0x43')]){_0x29a772['include']=[{'all':!![]}];}_0x29a772=_[_0xc96c('0x3b')]({},_0x29a772,_0x510252[_0xc96c('0x3e')]);return db[_0xc96c('0x2a')][_0xc96c('0x44')](_0x29a772)['then'](handleEntityNotFound(_0x311a9e,null))['then'](respondWithResult(_0x311a9e,null))[_0xc96c('0x42')](handleError(_0x311a9e,null));};exports[_0xc96c('0x45')]=function(_0x3c654c,_0x9ea3e0){return db[_0xc96c('0x2a')][_0xc96c('0x45')](_0x3c654c[_0xc96c('0x46')],{})[_0xc96c('0x22')](respondWithResult(_0x9ea3e0,0xc9))[_0xc96c('0x42')](handleError(_0x9ea3e0,null));};exports[_0xc96c('0x21')]=function(_0x2257ab,_0x152397){if(_0x2257ab[_0xc96c('0x46')]['id']){delete _0x2257ab['body']['id'];}return db[_0xc96c('0x2a')][_0xc96c('0x44')]({'where':{'id':_0x2257ab[_0xc96c('0x47')]['id']}})[_0xc96c('0x22')](handleEntityNotFound(_0x152397,null))['then'](saveUpdates(_0x2257ab[_0xc96c('0x46')],null))['then'](respondWithResult(_0x152397,null))[_0xc96c('0x42')](handleError(_0x152397,null));};exports[_0xc96c('0x23')]=function(_0x565812,_0x2581ae){return db[_0xc96c('0x2a')][_0xc96c('0x44')]({'where':{'id':_0x565812[_0xc96c('0x47')]['id']}})[_0xc96c('0x22')](handleEntityNotFound(_0x2581ae,null))[_0xc96c('0x22')](removeEntity(_0x2581ae,null))['catch'](handleError(_0x2581ae,null));};exports['describe']=function(_0x557511,_0x1357f0){return db['MailTransferReport'][_0xc96c('0x48')]()[_0xc96c('0x22')](respondWithResult(_0x1357f0,null))[_0xc96c('0x42')](handleError(_0x1357f0,null));}; \ No newline at end of file +var _0xd8b0=['rawAttributes','keys','filters','model','attributes','intersection','length','query','hasOwnProperty','nolimit','sort','pick','where','merge','map','type','key','VIRTUAL','options','MailTransferReport','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','destroy','describe','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','stack','name','index'];(function(_0x5d4ad2,_0x209bd5){var _0x5466be=function(_0x236bf2){while(--_0x236bf2){_0x5d4ad2['push'](_0x5d4ad2['shift']());}};_0x5466be(++_0x209bd5);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var authService=require(_0x0d8b('0xf'));var qs=require(_0x0d8b('0x10'));var hardwareService=require(_0x0d8b('0x11'));var logger=require(_0x0d8b('0x12'))('api');var utils=require(_0x0d8b('0x13'));var config=require('../../config/environment');var db=require(_0x0d8b('0x14'))['db'];function respondWithStatusCode(_0xc574a3,_0x340cc4){_0x340cc4=_0x340cc4||0xcc;return function(_0x92cdd8){if(_0x92cdd8){return _0xc574a3[_0x0d8b('0x15')](_0x340cc4);}return _0xc574a3[_0x0d8b('0x16')](_0x340cc4)[_0x0d8b('0x17')]();};}function respondWithResult(_0x31a8cc,_0x1d4bbc){_0x1d4bbc=_0x1d4bbc||0xc8;return function(_0x2ce75e){if(_0x2ce75e){return _0x31a8cc[_0x0d8b('0x16')](_0x1d4bbc)[_0x0d8b('0x18')](_0x2ce75e);}};}function respondWithFilteredResult(_0x1567ce,_0x2d4e1c){return function(_0x4f6f21){if(_0x4f6f21){var _0x23eb7b=_0x4f6f21[_0x0d8b('0x19')],_0xa86349=_0x2d4e1c['offset'],_0x17f7df=_0x2d4e1c[_0x0d8b('0x1a')]+_0x2d4e1c[_0x0d8b('0x1b')],_0xe2e167;if(_0x17f7df>=_0x23eb7b){_0x17f7df=_0x23eb7b;_0xe2e167=0xc8;}else{_0xe2e167=0xce;}_0x1567ce[_0x0d8b('0x16')](_0xe2e167);return _0x1567ce[_0x0d8b('0x1c')](_0x0d8b('0x1d'),_0xa86349+'-'+_0x17f7df+'/'+_0x23eb7b)[_0x0d8b('0x18')](_0x4f6f21);}return null;};}function patchUpdates(_0x264b39){return function(_0xa3612a){try{jsonpatch['apply'](_0xa3612a,_0x264b39,!![]);}catch(_0x27512e){return BPromise[_0x0d8b('0x1e')](_0x27512e);}return _0xa3612a[_0x0d8b('0x1f')]();};}function saveUpdates(_0x143372,_0x24e8ed){return function(_0x5b709c){if(_0x5b709c){return _0x5b709c[_0x0d8b('0x20')](_0x143372)[_0x0d8b('0x21')](function(_0x50ec1e){return _0x50ec1e;});}return null;};}function removeEntity(_0x4f0a1a,_0x33fb87){return function(_0x54a9a7){if(_0x54a9a7){return _0x54a9a7['destroy']()['then'](function(){_0x4f0a1a[_0x0d8b('0x16')](0xcc)[_0x0d8b('0x17')]();});}};}function handleEntityNotFound(_0x214778,_0x38efc8){return function(_0x221071){if(!_0x221071){_0x214778[_0x0d8b('0x15')](0x194);}return _0x221071;};}function handleError(_0x30980c,_0x4562cb){_0x4562cb=_0x4562cb||0x1f4;return function(_0x27b695){logger['error'](_0x27b695[_0x0d8b('0x22')]);if(_0x27b695[_0x0d8b('0x23')]){delete _0x27b695['name'];}_0x30980c[_0x0d8b('0x16')](_0x4562cb)['send'](_0x27b695);};}exports[_0x0d8b('0x24')]=function(_0x234bdd,_0xa2af02){var _0x4fe6f9={},_0x59a905={},_0x28f639={'count':0x0,'rows':[]};var _0x3ef745=db['MailTransferReport'][_0x0d8b('0x25')];_0x59a905['model']=_[_0x0d8b('0x26')](_0x3ef745);_0x59a905['query']=_[_0x0d8b('0x26')](_0x234bdd['query']);_0x59a905[_0x0d8b('0x27')]=_['intersection'](_0x59a905[_0x0d8b('0x28')],_0x59a905['query']);_0x4fe6f9[_0x0d8b('0x29')]=_[_0x0d8b('0x2a')](_0x59a905[_0x0d8b('0x28')],qs['fields'](_0x234bdd['query']['fields']));_0x4fe6f9[_0x0d8b('0x29')]=_0x4fe6f9['attributes'][_0x0d8b('0x2b')]?_0x4fe6f9['attributes']:_0x59a905['model'];if(!_0x234bdd[_0x0d8b('0x2c')][_0x0d8b('0x2d')](_0x0d8b('0x2e'))){_0x4fe6f9[_0x0d8b('0x1b')]=qs[_0x0d8b('0x1b')](_0x234bdd[_0x0d8b('0x2c')][_0x0d8b('0x1b')]);_0x4fe6f9[_0x0d8b('0x1a')]=qs['offset'](_0x234bdd[_0x0d8b('0x2c')][_0x0d8b('0x1a')]);}_0x4fe6f9['order']=qs[_0x0d8b('0x2f')](_0x234bdd[_0x0d8b('0x2c')][_0x0d8b('0x2f')]);_0x4fe6f9['where']=qs[_0x0d8b('0x27')](_[_0x0d8b('0x30')](_0x234bdd[_0x0d8b('0x2c')],_0x59a905[_0x0d8b('0x27')]));if(_0x234bdd[_0x0d8b('0x2c')]['filter']){_0x4fe6f9[_0x0d8b('0x31')]=_[_0x0d8b('0x32')](_0x4fe6f9['where'],{'$or':_[_0x0d8b('0x33')](_0x3ef745,function(_0x3cc3ee){if(_0x3cc3ee[_0x0d8b('0x34')][_0x0d8b('0x35')]!==_0x0d8b('0x36')){var _0x519088={};_0x519088[_0x3cc3ee['field']]={'$like':'%'+_0x234bdd[_0x0d8b('0x2c')]['filter']+'%'};return _0x519088;}})});}_0x4fe6f9=_['merge']({},_0x4fe6f9,_0x234bdd[_0x0d8b('0x37')]);var _0x2e279c={'where':_0x4fe6f9[_0x0d8b('0x31')]};return db[_0x0d8b('0x38')][_0x0d8b('0x19')](_0x2e279c)[_0x0d8b('0x21')](function(_0x579324){_0x28f639[_0x0d8b('0x19')]=_0x579324;if(_0x234bdd[_0x0d8b('0x2c')][_0x0d8b('0x39')]){_0x4fe6f9[_0x0d8b('0x3a')]=[{'all':!![]}];}return db[_0x0d8b('0x38')][_0x0d8b('0x3b')](_0x4fe6f9);})[_0x0d8b('0x21')](function(_0x5c980b){_0x28f639[_0x0d8b('0x3c')]=_0x5c980b;return _0x28f639;})[_0x0d8b('0x21')](respondWithFilteredResult(_0xa2af02,_0x4fe6f9))[_0x0d8b('0x3d')](handleError(_0xa2af02,null));};exports[_0x0d8b('0x3e')]=function(_0x59d3ad,_0xe0bf42){var _0x4b4bde={'raw':!![],'where':{'id':_0x59d3ad[_0x0d8b('0x3f')]['id']}},_0x37b26c={};_0x37b26c[_0x0d8b('0x28')]=_[_0x0d8b('0x26')](db[_0x0d8b('0x38')][_0x0d8b('0x25')]);_0x37b26c[_0x0d8b('0x2c')]=_[_0x0d8b('0x26')](_0x59d3ad[_0x0d8b('0x2c')]);_0x37b26c[_0x0d8b('0x27')]=_['intersection'](_0x37b26c['model'],_0x37b26c['query']);_0x4b4bde['attributes']=_['intersection'](_0x37b26c[_0x0d8b('0x28')],qs[_0x0d8b('0x40')](_0x59d3ad[_0x0d8b('0x2c')]['fields']));_0x4b4bde['attributes']=_0x4b4bde[_0x0d8b('0x29')][_0x0d8b('0x2b')]?_0x4b4bde[_0x0d8b('0x29')]:_0x37b26c['model'];if(_0x59d3ad[_0x0d8b('0x2c')][_0x0d8b('0x39')]){_0x4b4bde['include']=[{'all':!![]}];}_0x4b4bde=_['merge']({},_0x4b4bde,_0x59d3ad[_0x0d8b('0x37')]);return db['MailTransferReport'][_0x0d8b('0x41')](_0x4b4bde)['then'](handleEntityNotFound(_0xe0bf42,null))['then'](respondWithResult(_0xe0bf42,null))[_0x0d8b('0x3d')](handleError(_0xe0bf42,null));};exports[_0x0d8b('0x42')]=function(_0x5a75c7,_0x5ebe8a){return db['MailTransferReport']['create'](_0x5a75c7[_0x0d8b('0x43')],{})[_0x0d8b('0x21')](respondWithResult(_0x5ebe8a,0xc9))[_0x0d8b('0x3d')](handleError(_0x5ebe8a,null));};exports['update']=function(_0xb0910e,_0x1afe8a){if(_0xb0910e[_0x0d8b('0x43')]['id']){delete _0xb0910e[_0x0d8b('0x43')]['id'];}return db[_0x0d8b('0x38')][_0x0d8b('0x41')]({'where':{'id':_0xb0910e[_0x0d8b('0x3f')]['id']}})[_0x0d8b('0x21')](handleEntityNotFound(_0x1afe8a,null))[_0x0d8b('0x21')](saveUpdates(_0xb0910e[_0x0d8b('0x43')],null))[_0x0d8b('0x21')](respondWithResult(_0x1afe8a,null))[_0x0d8b('0x3d')](handleError(_0x1afe8a,null));};exports[_0x0d8b('0x44')]=function(_0x3e569b,_0x570af8){return db[_0x0d8b('0x38')][_0x0d8b('0x41')]({'where':{'id':_0x3e569b[_0x0d8b('0x3f')]['id']}})[_0x0d8b('0x21')](handleEntityNotFound(_0x570af8,null))['then'](removeEntity(_0x570af8,null))[_0x0d8b('0x3d')](handleError(_0x570af8,null));};exports['describe']=function(_0x5d29ab,_0x39a31d){return db[_0x0d8b('0x38')][_0x0d8b('0x45')]()[_0x0d8b('0x21')](respondWithResult(_0x39a31d,null))['catch'](handleError(_0x39a31d,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index de9d637..4952154 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 _0x038b=['report_mail_transfer','util','../../config/logger','api','bluebird','path','rimraf','./mailTransferReport.attributes','exports','define','MailTransferReport'];(function(_0x786e9,_0x1a029){var _0x1f891b=function(_0x31ad7c){while(--_0x31ad7c){_0x786e9['push'](_0x786e9['shift']());}};_0x1f891b(++_0x1a029);}(_0x038b,0x114));var _0xb038=function(_0x11a0f4,_0x3df0ea){_0x11a0f4=_0x11a0f4-0x0;var _0x4702c8=_0x038b[_0x11a0f4];return _0x4702c8;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var logger=require(_0xb038('0x1'))(_0xb038('0x2'));var moment=require('moment');var BPromise=require(_0xb038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb038('0x4'));var rimraf=require(_0xb038('0x5'));var config=require('../../config/environment');var attributes=require(_0xb038('0x6'));module[_0xb038('0x7')]=function(_0x4fe092,_0x54e1e7){return _0x4fe092[_0xb038('0x8')](_0xb038('0x9'),attributes,{'tableName':_0xb038('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','uniqueid','../../config/logger','api'];(function(_0x15a6c3,_0x48e002){var _0x127c55=function(_0x5bccc4){while(--_0x5bccc4){_0x15a6c3['push'](_0x15a6c3['shift']());}};_0x127c55(++_0x48e002);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3b3489,_0x1da252){_0x3b3489=_0x3b3489-0x0;var _0x2a70a3=_0x7fbe[_0x3b3489];return _0x2a70a3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xe7fb('0xc'),'fields':[_0xe7fb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 631d779..0987329 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 _0x50a2=['MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x2ba59b,_0x1606cd){var _0x29473e=function(_0x3f71ee){while(--_0x3f71ee){_0x2ba59b['push'](_0x2ba59b['shift']());}};_0x29473e(++_0x1606cd);}(_0x50a2,0x134));var _0x250a=function(_0x4a1c2e,_0x1f04b1){_0x4a1c2e=_0x4a1c2e-0x0;var _0x49337f=_0x50a2[_0x4a1c2e];return _0x49337f;};'use strict';var _=require('lodash');var util=require(_0x250a('0x0'));var moment=require(_0x250a('0x1'));var BPromise=require(_0x250a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x250a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x250a('0x4'))(_0x250a('0x5'));var config=require(_0x250a('0x6'));var jayson=require(_0x250a('0x7'));var client=jayson[_0x250a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f5d4a,_0x590dda,_0x54f793){return new BPromise(function(_0x585c1c,_0x18e800){return client[_0x250a('0x9')](_0x5f5d4a,_0x54f793)[_0x250a('0xa')](function(_0x3168d6){logger[_0x250a('0xb')](_0x250a('0xc'),_0x590dda,_0x250a('0xd'));logger[_0x250a('0xe')](_0x250a('0xf'),_0x590dda,'request\x20sent',JSON['stringify'](_0x3168d6));if(_0x3168d6['error']){if(_0x3168d6[_0x250a('0x10')]['code']===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x590dda,_0x3168d6[_0x250a('0x10')][_0x250a('0x11')]);return _0x18e800(_0x3168d6['error'][_0x250a('0x11')]);}logger['error'](_0x250a('0xc'),_0x590dda,_0x3168d6[_0x250a('0x10')][_0x250a('0x11')]);return _0x585c1c(_0x3168d6[_0x250a('0x10')][_0x250a('0x11')]);}else{logger[_0x250a('0xb')](_0x250a('0xc'),_0x590dda,_0x250a('0xd'));_0x585c1c(_0x3168d6[_0x250a('0x12')][_0x250a('0x11')]);}})[_0x250a('0x13')](function(_0x5ee98e){logger[_0x250a('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x590dda,_0x5ee98e);_0x18e800(_0x5ee98e);});});} \ No newline at end of file +var _0x94aa=['../../config/environment','jayson/promise','client','request','then','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x61b149,_0x116efe){var _0x4bf72c=function(_0x4ae14c){while(--_0x4ae14c){_0x61b149['push'](_0x61b149['shift']());}};_0x4bf72c(++_0x116efe);}(_0x94aa,0x1f1));var _0xa94a=function(_0x3a1079,_0x62b870){_0x3a1079=_0x3a1079-0x0;var _0x13fd86=_0x94aa[_0x3a1079];return _0x13fd86;};'use strict';var _=require(_0xa94a('0x0'));var util=require(_0xa94a('0x1'));var moment=require(_0xa94a('0x2'));var BPromise=require(_0xa94a('0x3'));var rs=require(_0xa94a('0x4'));var fs=require('fs');var Redis=require(_0xa94a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa94a('0x6'))('rpc');var config=require(_0xa94a('0x7'));var jayson=require(_0xa94a('0x8'));var client=jayson[_0xa94a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x194888,_0x10294e,_0x31e427){return new BPromise(function(_0x1cef50,_0x4b764e){return client[_0xa94a('0xa')](_0x194888,_0x31e427)[_0xa94a('0xb')](function(_0x4e10d1){logger['info'](_0xa94a('0xc'),_0x10294e,'request\x20sent');logger[_0xa94a('0xd')](_0xa94a('0xe'),_0x10294e,_0xa94a('0xf'),JSON[_0xa94a('0x10')](_0x4e10d1));if(_0x4e10d1[_0xa94a('0x11')]){if(_0x4e10d1[_0xa94a('0x11')][_0xa94a('0x12')]===0x1f4){logger[_0xa94a('0x11')](_0xa94a('0xc'),_0x10294e,_0x4e10d1[_0xa94a('0x11')][_0xa94a('0x13')]);return _0x4b764e(_0x4e10d1[_0xa94a('0x11')]['message']);}logger[_0xa94a('0x11')](_0xa94a('0xc'),_0x10294e,_0x4e10d1[_0xa94a('0x11')][_0xa94a('0x13')]);return _0x1cef50(_0x4e10d1[_0xa94a('0x11')][_0xa94a('0x13')]);}else{logger[_0xa94a('0x14')](_0xa94a('0xc'),_0x10294e,_0xa94a('0xf'));_0x1cef50(_0x4e10d1['result'][_0xa94a('0x13')]);}})['catch'](function(_0x204fb2){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x10294e,_0x204fb2);_0x4b764e(_0x204fb2);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index b718d3f..6f8fd68 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 _0x2714=['../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index','/describe','describe','show','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x40b74c,_0x12cedb){var _0x3cbe65=function(_0x31022d){while(--_0x31022d){_0x40b74c['push'](_0x40b74c['shift']());}};_0x3cbe65(++_0x12cedb);}(_0x2714,0x8e));var _0x4271=function(_0x3f8208,_0x6d3077){_0x3f8208=_0x3f8208-0x0;var _0x12abc5=_0x2714[_0x3f8208];return _0x12abc5;};'use strict';var multer=require(_0x4271('0x0'));var util=require(_0x4271('0x1'));var path=require(_0x4271('0x2'));var timeout=require(_0x4271('0x3'));var express=require('express');var router=express[_0x4271('0x4')]();var auth=require(_0x4271('0x5'));var interaction=require(_0x4271('0x6'));var config=require('../../config/environment');var controller=require(_0x4271('0x7'));router[_0x4271('0x8')]('/',auth[_0x4271('0x9')](),controller[_0x4271('0xa')]);router[_0x4271('0x8')](_0x4271('0xb'),auth[_0x4271('0x9')](),controller[_0x4271('0xc')]);router[_0x4271('0x8')]('/:id',auth[_0x4271('0x9')](),controller[_0x4271('0xd')]);router['post']('/',auth[_0x4271('0x9')](),controller[_0x4271('0xe')]);router[_0x4271('0xf')]('/:id',auth[_0x4271('0x9')](),controller[_0x4271('0x10')]);router[_0x4271('0x11')](_0x4271('0x12'),auth[_0x4271('0x9')](),controller[_0x4271('0x13')]);module[_0x4271('0x14')]=router; \ No newline at end of file +var _0xaac4=['/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','/describe','describe'];(function(_0x4c06ac,_0x568788){var _0x2333cb=function(_0xdb5c64){while(--_0xdb5c64){_0x4c06ac['push'](_0x4c06ac['shift']());}};_0x2333cb(++_0x568788);}(_0xaac4,0x197));var _0x4aac=function(_0x5710db,_0x410db1){_0x5710db=_0x5710db-0x0;var _0xee92e=_0xaac4[_0x5710db];return _0xee92e;};'use strict';var multer=require(_0x4aac('0x0'));var util=require(_0x4aac('0x1'));var path=require(_0x4aac('0x2'));var timeout=require(_0x4aac('0x3'));var express=require(_0x4aac('0x4'));var router=express[_0x4aac('0x5')]();var auth=require(_0x4aac('0x6'));var interaction=require(_0x4aac('0x7'));var config=require('../../config/environment');var controller=require(_0x4aac('0x8'));router[_0x4aac('0x9')]('/',auth[_0x4aac('0xa')](),controller['index']);router[_0x4aac('0x9')](_0x4aac('0xb'),auth[_0x4aac('0xa')](),controller[_0x4aac('0xc')]);router[_0x4aac('0x9')](_0x4aac('0xd'),auth['isAuthenticated'](),controller[_0x4aac('0xe')]);router[_0x4aac('0xf')]('/',auth[_0x4aac('0xa')](),controller[_0x4aac('0x10')]);router[_0x4aac('0x11')](_0x4aac('0xd'),auth[_0x4aac('0xa')](),controller[_0x4aac('0x12')]);router[_0x4aac('0x13')](_0x4aac('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x4aac('0x14')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 5d954c6..6c24853 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 _0xa992=['talk:[start]','talk:[dial\x20string]','sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','seconds','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]'];(function(_0x522a9a,_0x245eda){var _0x4230d3=function(_0x2c56d0){while(--_0x2c56d0){_0x522a9a['push'](_0x522a9a['shift']());}};_0x4230d3(++_0x245eda);}(_0xa992,0xaa));var _0x2a99=function(_0x242a32,_0x5ea924){_0x242a32=_0x242a32-0x0;var _0x105e90=_0xa992[_0x242a32];return _0x105e90;};'use strict';var Sequelize=require(_0x2a99('0x0'));var moment=require(_0x2a99('0x1'));module[_0x2a99('0x2')]={'channel':{'type':Sequelize[_0x2a99('0x3')]},'membername':{'type':Sequelize[_0x2a99('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2a99('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x2a99('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x2a99('0x5')],'set':function(_0x5adc0b){var _0x65f4dc=moment(_0x5adc0b);var _0x57204e=moment(this[_0x2a99('0x6')](_0x2a99('0x7')));var _0x57aad1=_0x65f4dc['diff'](_0x57204e,_0x2a99('0x8'));this['setDataValue'](_0x2a99('0x9'),_0x5adc0b);this['setDataValue'](_0x2a99('0xa'),_0x57aad1||null);}},'data1':{'type':Sequelize[_0x2a99('0x3')],'comment':_0x2a99('0xb')},'data2':{'type':Sequelize['STRING'],'comment':_0x2a99('0xc')},'data3':{'type':Sequelize[_0x2a99('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x2a99('0x3')],'comment':_0x2a99('0xd')},'data5':{'type':Sequelize[_0x2a99('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x2a99('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x2a99('0x3')]}}; \ No newline at end of file +var _0x4ab4=['DATE','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','sequelize','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER'];(function(_0x1dfbe0,_0x5c6fec){var _0x489632=function(_0x50ee15){while(--_0x50ee15){_0x1dfbe0['push'](_0x1dfbe0['shift']());}};_0x489632(++_0x5c6fec);}(_0x4ab4,0x1ca));var _0x44ab=function(_0x5f1cda,_0x45a31a){_0x5f1cda=_0x5f1cda-0x0;var _0x522579=_0x4ab4[_0x5f1cda];return _0x522579;};'use strict';var Sequelize=require(_0x44ab('0x0'));var moment=require(_0x44ab('0x1'));module['exports']={'channel':{'type':Sequelize[_0x44ab('0x2')]},'membername':{'type':Sequelize[_0x44ab('0x2')]},'interface':{'type':Sequelize[_0x44ab('0x2')]},'type':{'type':Sequelize[_0x44ab('0x2')],'defaultValue':_0x44ab('0x3'),'comment':_0x44ab('0x4')},'duration':{'type':Sequelize[_0x44ab('0x5')]},'enterAt':{'type':Sequelize[_0x44ab('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x5f0a1e){var _0x4b3264=moment(_0x5f0a1e);var _0x3ab314=moment(this['getDataValue'](_0x44ab('0x7')));var _0xc9a531=_0x4b3264[_0x44ab('0x8')](_0x3ab314,_0x44ab('0x9'));this[_0x44ab('0xa')](_0x44ab('0xb'),_0x5f0a1e);this[_0x44ab('0xa')](_0x44ab('0xc'),_0xc9a531||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x44ab('0xd')},'data2':{'type':Sequelize[_0x44ab('0x2')],'comment':_0x44ab('0xe')},'data3':{'type':Sequelize[_0x44ab('0x2')],'comment':_0x44ab('0xf')},'data4':{'type':Sequelize[_0x44ab('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x44ab('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x44ab('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x44ab('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 61ae03b..eef30ec 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 _0xc106=['map','key','VIRTUAL','field','options','MemberReport','includeAll','include','findAll','show','params','find','create','body','catch','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','reject','update','destroy','then','error','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc106,0x17d));var _0x6c10=function(_0x450113,_0x5d787b){_0x450113=_0x450113-0x0;var _0x362966=_0xc106[_0x450113];return _0x362966;};'use strict';var pdf=require(_0x6c10('0x0'));var emlformat=require(_0x6c10('0x1'));var rimraf=require(_0x6c10('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6c10('0x3'));var rp=require(_0x6c10('0x4'));var moment=require(_0x6c10('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6c10('0x6'));var util=require(_0x6c10('0x7'));var path=require('path');var sox=require(_0x6c10('0x8'));var csv=require(_0x6c10('0x9'));var ejs=require(_0x6c10('0xa'));var fs=require('fs');var _=require(_0x6c10('0xb'));var squel=require(_0x6c10('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6c10('0xd'));var toCsv=require(_0x6c10('0x9'));var querystring=require('querystring');var Papa=require(_0x6c10('0xe'));var Redis=require(_0x6c10('0xf'));var authService=require(_0x6c10('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6c10('0x11'));var logger=require(_0x6c10('0x12'))(_0x6c10('0x13'));var utils=require(_0x6c10('0x14'));var config=require(_0x6c10('0x15'));var db=require(_0x6c10('0x16'))['db'];function respondWithStatusCode(_0x3c20af,_0x352ea5){_0x352ea5=_0x352ea5||0xcc;return function(_0x3f1dcd){if(_0x3f1dcd){return _0x3c20af[_0x6c10('0x17')](_0x352ea5);}return _0x3c20af[_0x6c10('0x18')](_0x352ea5)[_0x6c10('0x19')]();};}function respondWithResult(_0x442a85,_0x31b743){_0x31b743=_0x31b743||0xc8;return function(_0x2b18aa){if(_0x2b18aa){return _0x442a85[_0x6c10('0x18')](_0x31b743)[_0x6c10('0x1a')](_0x2b18aa);}};}function respondWithFilteredResult(_0x50dc4d,_0x31e6e0){return function(_0x3536df){if(_0x3536df){var _0x5a533d=_0x3536df[_0x6c10('0x1b')],_0xc8c098=_0x31e6e0['offset'],_0x3417d0=_0x31e6e0['offset']+_0x31e6e0[_0x6c10('0x1c')],_0x48741c;if(_0x3417d0>=_0x5a533d){_0x3417d0=_0x5a533d;_0x48741c=0xc8;}else{_0x48741c=0xce;}_0x50dc4d[_0x6c10('0x18')](_0x48741c);return _0x50dc4d[_0x6c10('0x1d')](_0x6c10('0x1e'),_0xc8c098+'-'+_0x3417d0+'/'+_0x5a533d)['json'](_0x3536df);}return null;};}function patchUpdates(_0x1f90b7){return function(_0x51ebd0){try{jsonpatch['apply'](_0x51ebd0,_0x1f90b7,!![]);}catch(_0x33bb4d){return BPromise[_0x6c10('0x1f')](_0x33bb4d);}return _0x51ebd0['save']();};}function saveUpdates(_0x54277f,_0x4c3845){return function(_0x411f9c){if(_0x411f9c){return _0x411f9c[_0x6c10('0x20')](_0x54277f)['then'](function(_0x592f21){return _0x592f21;});}return null;};}function removeEntity(_0x4ebf59,_0x486e42){return function(_0x4e37cd){if(_0x4e37cd){return _0x4e37cd[_0x6c10('0x21')]()[_0x6c10('0x22')](function(){_0x4ebf59[_0x6c10('0x18')](0xcc)[_0x6c10('0x19')]();});}};}function handleEntityNotFound(_0xf9831,_0x5b017c){return function(_0x5e0bd2){if(!_0x5e0bd2){_0xf9831[_0x6c10('0x17')](0x194);}return _0x5e0bd2;};}function handleError(_0x3b1c21,_0x54b3c5){_0x54b3c5=_0x54b3c5||0x1f4;return function(_0x18ee1a){logger[_0x6c10('0x23')](_0x18ee1a['stack']);if(_0x18ee1a[_0x6c10('0x24')]){delete _0x18ee1a[_0x6c10('0x24')];}_0x3b1c21['status'](_0x54b3c5)[_0x6c10('0x25')](_0x18ee1a);};}exports[_0x6c10('0x26')]=function(_0x325aa2,_0x2f51a3){var _0x5c545c={},_0x2922e9={},_0x469f16={'count':0x0,'rows':[]};var _0x425edc=db['MemberReport'][_0x6c10('0x27')];_0x2922e9[_0x6c10('0x28')]=_['keys'](_0x425edc);_0x2922e9[_0x6c10('0x29')]=_[_0x6c10('0x2a')](_0x325aa2[_0x6c10('0x29')]);_0x2922e9[_0x6c10('0x2b')]=_[_0x6c10('0x2c')](_0x2922e9['model'],_0x2922e9['query']);_0x5c545c[_0x6c10('0x2d')]=_[_0x6c10('0x2c')](_0x2922e9[_0x6c10('0x28')],qs[_0x6c10('0x2e')](_0x325aa2[_0x6c10('0x29')][_0x6c10('0x2e')]));_0x5c545c[_0x6c10('0x2d')]=_0x5c545c[_0x6c10('0x2d')][_0x6c10('0x2f')]?_0x5c545c[_0x6c10('0x2d')]:_0x2922e9['model'];if(!_0x325aa2[_0x6c10('0x29')][_0x6c10('0x30')](_0x6c10('0x31'))){_0x5c545c[_0x6c10('0x1c')]=qs[_0x6c10('0x1c')](_0x325aa2[_0x6c10('0x29')][_0x6c10('0x1c')]);_0x5c545c[_0x6c10('0x32')]=qs[_0x6c10('0x32')](_0x325aa2['query'][_0x6c10('0x32')]);}_0x5c545c[_0x6c10('0x33')]=qs[_0x6c10('0x34')](_0x325aa2[_0x6c10('0x29')][_0x6c10('0x34')]);_0x5c545c[_0x6c10('0x35')]=qs['filters'](_[_0x6c10('0x36')](_0x325aa2['query'],_0x2922e9[_0x6c10('0x2b')]));if(_0x325aa2['query'][_0x6c10('0x37')]){_0x5c545c[_0x6c10('0x35')]=_[_0x6c10('0x38')](_0x5c545c['where'],{'$or':_[_0x6c10('0x39')](_0x425edc,function(_0x25d7db){if(_0x25d7db['type'][_0x6c10('0x3a')]!==_0x6c10('0x3b')){var _0x4c1ef1={};_0x4c1ef1[_0x25d7db[_0x6c10('0x3c')]]={'$like':'%'+_0x325aa2[_0x6c10('0x29')][_0x6c10('0x37')]+'%'};return _0x4c1ef1;}})});}_0x5c545c=_[_0x6c10('0x38')]({},_0x5c545c,_0x325aa2[_0x6c10('0x3d')]);var _0x5dde6a={'where':_0x5c545c['where']};return db[_0x6c10('0x3e')]['count'](_0x5dde6a)[_0x6c10('0x22')](function(_0x2c713c){_0x469f16[_0x6c10('0x1b')]=_0x2c713c;if(_0x325aa2[_0x6c10('0x29')][_0x6c10('0x3f')]){_0x5c545c[_0x6c10('0x40')]=[{'all':!![]}];}return db[_0x6c10('0x3e')][_0x6c10('0x41')](_0x5c545c);})['then'](function(_0x466261){_0x469f16['rows']=_0x466261;return _0x469f16;})[_0x6c10('0x22')](respondWithFilteredResult(_0x2f51a3,_0x5c545c))['catch'](handleError(_0x2f51a3,null));};exports[_0x6c10('0x42')]=function(_0xa967f0,_0x450b10){var _0x10703e={'raw':!![],'where':{'id':_0xa967f0[_0x6c10('0x43')]['id']}},_0x154d4b={};_0x154d4b[_0x6c10('0x28')]=_['keys'](db[_0x6c10('0x3e')][_0x6c10('0x27')]);_0x154d4b['query']=_[_0x6c10('0x2a')](_0xa967f0[_0x6c10('0x29')]);_0x154d4b['filters']=_[_0x6c10('0x2c')](_0x154d4b['model'],_0x154d4b[_0x6c10('0x29')]);_0x10703e[_0x6c10('0x2d')]=_[_0x6c10('0x2c')](_0x154d4b['model'],qs['fields'](_0xa967f0[_0x6c10('0x29')][_0x6c10('0x2e')]));_0x10703e[_0x6c10('0x2d')]=_0x10703e[_0x6c10('0x2d')][_0x6c10('0x2f')]?_0x10703e[_0x6c10('0x2d')]:_0x154d4b[_0x6c10('0x28')];if(_0xa967f0['query'][_0x6c10('0x3f')]){_0x10703e[_0x6c10('0x40')]=[{'all':!![]}];}_0x10703e=_[_0x6c10('0x38')]({},_0x10703e,_0xa967f0[_0x6c10('0x3d')]);return db[_0x6c10('0x3e')][_0x6c10('0x44')](_0x10703e)[_0x6c10('0x22')](handleEntityNotFound(_0x450b10,null))[_0x6c10('0x22')](respondWithResult(_0x450b10,null))['catch'](handleError(_0x450b10,null));};exports[_0x6c10('0x45')]=function(_0xafe65e,_0x5ebde9){return db['MemberReport']['create'](_0xafe65e[_0x6c10('0x46')],{})[_0x6c10('0x22')](respondWithResult(_0x5ebde9,0xc9))[_0x6c10('0x47')](handleError(_0x5ebde9,null));};exports['update']=function(_0xae5254,_0x117b92){if(_0xae5254[_0x6c10('0x46')]['id']){delete _0xae5254['body']['id'];}return db[_0x6c10('0x3e')][_0x6c10('0x44')]({'where':{'id':_0xae5254[_0x6c10('0x43')]['id']}})[_0x6c10('0x22')](handleEntityNotFound(_0x117b92,null))[_0x6c10('0x22')](saveUpdates(_0xae5254[_0x6c10('0x46')],null))[_0x6c10('0x22')](respondWithResult(_0x117b92,null))[_0x6c10('0x47')](handleError(_0x117b92,null));};exports[_0x6c10('0x21')]=function(_0x263b6d,_0x483c2c){return db[_0x6c10('0x3e')][_0x6c10('0x44')]({'where':{'id':_0x263b6d[_0x6c10('0x43')]['id']}})[_0x6c10('0x22')](handleEntityNotFound(_0x483c2c,null))[_0x6c10('0x22')](removeEntity(_0x483c2c,null))[_0x6c10('0x47')](handleError(_0x483c2c,null));};exports[_0x6c10('0x48')]=function(_0x4903f6,_0x5682a3){return db['MemberReport']['describe']()[_0x6c10('0x22')](respondWithResult(_0x5682a3,null))['catch'](handleError(_0x5682a3,null));}; \ No newline at end of file +var _0x4815=['fields','length','hasOwnProperty','order','sort','where','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','catch','show','params','find','create','MemberReport','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','end','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes'];(function(_0x1a9faf,_0x7c140c){var _0x31d0ec=function(_0x3a5f91){while(--_0x3a5f91){_0x1a9faf['push'](_0x1a9faf['shift']());}};_0x31d0ec(++_0x7c140c);}(_0x4815,0xa9));var _0x5481=function(_0x26406d,_0x58a34c){_0x26406d=_0x26406d-0x0;var _0x2e8273=_0x4815[_0x26406d];return _0x2e8273;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x5481('0x0'));var zipdir=require(_0x5481('0x1'));var jsonpatch=require(_0x5481('0x2'));var rp=require(_0x5481('0x3'));var moment=require(_0x5481('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5481('0x5'));var util=require(_0x5481('0x6'));var path=require('path');var sox=require(_0x5481('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x5481('0x8'));var squel=require('squel');var crypto=require(_0x5481('0x9'));var jsforce=require(_0x5481('0xa'));var deskjs=require(_0x5481('0xb'));var toCsv=require(_0x5481('0xc'));var querystring=require(_0x5481('0xd'));var Papa=require(_0x5481('0xe'));var Redis=require(_0x5481('0xf'));var authService=require(_0x5481('0x10'));var qs=require(_0x5481('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5481('0x12'))(_0x5481('0x13'));var utils=require('../../config/utils');var config=require(_0x5481('0x14'));var db=require(_0x5481('0x15'))['db'];function respondWithStatusCode(_0x3c5980,_0x3bc0e1){_0x3bc0e1=_0x3bc0e1||0xcc;return function(_0x50c739){if(_0x50c739){return _0x3c5980[_0x5481('0x16')](_0x3bc0e1);}return _0x3c5980[_0x5481('0x17')](_0x3bc0e1)['end']();};}function respondWithResult(_0x5dddc1,_0x527c70){_0x527c70=_0x527c70||0xc8;return function(_0x4eb58f){if(_0x4eb58f){return _0x5dddc1['status'](_0x527c70)['json'](_0x4eb58f);}};}function respondWithFilteredResult(_0x54c5fd,_0x5e8009){return function(_0x1494cf){if(_0x1494cf){var _0x1bc8c7=_0x1494cf[_0x5481('0x18')],_0x3c4f9b=_0x5e8009[_0x5481('0x19')],_0x241d70=_0x5e8009[_0x5481('0x19')]+_0x5e8009[_0x5481('0x1a')],_0x438e40;if(_0x241d70>=_0x1bc8c7){_0x241d70=_0x1bc8c7;_0x438e40=0xc8;}else{_0x438e40=0xce;}_0x54c5fd[_0x5481('0x17')](_0x438e40);return _0x54c5fd[_0x5481('0x1b')](_0x5481('0x1c'),_0x3c4f9b+'-'+_0x241d70+'/'+_0x1bc8c7)[_0x5481('0x1d')](_0x1494cf);}return null;};}function patchUpdates(_0xc4ead7){return function(_0x2e0fa3){try{jsonpatch[_0x5481('0x1e')](_0x2e0fa3,_0xc4ead7,!![]);}catch(_0x118f75){return BPromise[_0x5481('0x1f')](_0x118f75);}return _0x2e0fa3[_0x5481('0x20')]();};}function saveUpdates(_0x25352d,_0xf21c6f){return function(_0x45810b){if(_0x45810b){return _0x45810b['update'](_0x25352d)[_0x5481('0x21')](function(_0x569f6d){return _0x569f6d;});}return null;};}function removeEntity(_0x19ffb8,_0x54a708){return function(_0x9bda7a){if(_0x9bda7a){return _0x9bda7a[_0x5481('0x22')]()['then'](function(){_0x19ffb8['status'](0xcc)[_0x5481('0x23')]();});}};}function handleEntityNotFound(_0x126f81,_0x14c1fc){return function(_0x5d3715){if(!_0x5d3715){_0x126f81[_0x5481('0x16')](0x194);}return _0x5d3715;};}function handleError(_0x51d163,_0x4e5305){_0x4e5305=_0x4e5305||0x1f4;return function(_0x59d77d){logger['error'](_0x59d77d[_0x5481('0x24')]);if(_0x59d77d['name']){delete _0x59d77d[_0x5481('0x25')];}_0x51d163[_0x5481('0x17')](_0x4e5305)[_0x5481('0x26')](_0x59d77d);};}exports[_0x5481('0x27')]=function(_0x3a1356,_0x30ab6c){var _0x401f98={},_0x16919d={},_0x1183d3={'count':0x0,'rows':[]};var _0x1a312b=db['MemberReport'][_0x5481('0x28')];_0x16919d[_0x5481('0x29')]=_[_0x5481('0x2a')](_0x1a312b);_0x16919d[_0x5481('0x2b')]=_[_0x5481('0x2a')](_0x3a1356[_0x5481('0x2b')]);_0x16919d[_0x5481('0x2c')]=_[_0x5481('0x2d')](_0x16919d[_0x5481('0x29')],_0x16919d['query']);_0x401f98[_0x5481('0x2e')]=_[_0x5481('0x2d')](_0x16919d[_0x5481('0x29')],qs[_0x5481('0x2f')](_0x3a1356[_0x5481('0x2b')]['fields']));_0x401f98['attributes']=_0x401f98[_0x5481('0x2e')][_0x5481('0x30')]?_0x401f98['attributes']:_0x16919d['model'];if(!_0x3a1356[_0x5481('0x2b')][_0x5481('0x31')]('nolimit')){_0x401f98['limit']=qs['limit'](_0x3a1356[_0x5481('0x2b')][_0x5481('0x1a')]);_0x401f98[_0x5481('0x19')]=qs[_0x5481('0x19')](_0x3a1356[_0x5481('0x2b')][_0x5481('0x19')]);}_0x401f98[_0x5481('0x32')]=qs[_0x5481('0x33')](_0x3a1356[_0x5481('0x2b')][_0x5481('0x33')]);_0x401f98[_0x5481('0x34')]=qs[_0x5481('0x2c')](_['pick'](_0x3a1356['query'],_0x16919d[_0x5481('0x2c')]));if(_0x3a1356[_0x5481('0x2b')][_0x5481('0x35')]){_0x401f98[_0x5481('0x34')]=_[_0x5481('0x36')](_0x401f98[_0x5481('0x34')],{'$or':_[_0x5481('0x37')](_0x1a312b,function(_0x42a425){if(_0x42a425[_0x5481('0x38')][_0x5481('0x39')]!=='VIRTUAL'){var _0x3a9a26={};_0x3a9a26[_0x42a425[_0x5481('0x3a')]]={'$like':'%'+_0x3a1356[_0x5481('0x2b')][_0x5481('0x35')]+'%'};return _0x3a9a26;}})});}_0x401f98=_[_0x5481('0x36')]({},_0x401f98,_0x3a1356[_0x5481('0x3b')]);var _0x58f302={'where':_0x401f98[_0x5481('0x34')]};return db['MemberReport'][_0x5481('0x18')](_0x58f302)[_0x5481('0x21')](function(_0x389377){_0x1183d3[_0x5481('0x18')]=_0x389377;if(_0x3a1356[_0x5481('0x2b')][_0x5481('0x3c')]){_0x401f98[_0x5481('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0x5481('0x3e')](_0x401f98);})[_0x5481('0x21')](function(_0x18da47){_0x1183d3[_0x5481('0x3f')]=_0x18da47;return _0x1183d3;})[_0x5481('0x21')](respondWithFilteredResult(_0x30ab6c,_0x401f98))[_0x5481('0x40')](handleError(_0x30ab6c,null));};exports[_0x5481('0x41')]=function(_0x8eff76,_0x4e552d){var _0x1612c4={'raw':!![],'where':{'id':_0x8eff76[_0x5481('0x42')]['id']}},_0x5dd0e1={};_0x5dd0e1[_0x5481('0x29')]=_[_0x5481('0x2a')](db['MemberReport']['rawAttributes']);_0x5dd0e1[_0x5481('0x2b')]=_[_0x5481('0x2a')](_0x8eff76[_0x5481('0x2b')]);_0x5dd0e1[_0x5481('0x2c')]=_[_0x5481('0x2d')](_0x5dd0e1['model'],_0x5dd0e1['query']);_0x1612c4[_0x5481('0x2e')]=_[_0x5481('0x2d')](_0x5dd0e1[_0x5481('0x29')],qs[_0x5481('0x2f')](_0x8eff76[_0x5481('0x2b')][_0x5481('0x2f')]));_0x1612c4['attributes']=_0x1612c4[_0x5481('0x2e')][_0x5481('0x30')]?_0x1612c4[_0x5481('0x2e')]:_0x5dd0e1['model'];if(_0x8eff76[_0x5481('0x2b')]['includeAll']){_0x1612c4[_0x5481('0x3d')]=[{'all':!![]}];}_0x1612c4=_[_0x5481('0x36')]({},_0x1612c4,_0x8eff76['options']);return db['MemberReport'][_0x5481('0x43')](_0x1612c4)[_0x5481('0x21')](handleEntityNotFound(_0x4e552d,null))[_0x5481('0x21')](respondWithResult(_0x4e552d,null))[_0x5481('0x40')](handleError(_0x4e552d,null));};exports[_0x5481('0x44')]=function(_0x400205,_0x274ced){return db[_0x5481('0x45')][_0x5481('0x44')](_0x400205[_0x5481('0x46')],{})[_0x5481('0x21')](respondWithResult(_0x274ced,0xc9))[_0x5481('0x40')](handleError(_0x274ced,null));};exports['update']=function(_0x155ebf,_0x1c50ba){if(_0x155ebf[_0x5481('0x46')]['id']){delete _0x155ebf[_0x5481('0x46')]['id'];}return db['MemberReport'][_0x5481('0x43')]({'where':{'id':_0x155ebf['params']['id']}})[_0x5481('0x21')](handleEntityNotFound(_0x1c50ba,null))[_0x5481('0x21')](saveUpdates(_0x155ebf['body'],null))[_0x5481('0x21')](respondWithResult(_0x1c50ba,null))[_0x5481('0x40')](handleError(_0x1c50ba,null));};exports[_0x5481('0x22')]=function(_0x4b1b3d,_0x492157){return db['MemberReport'][_0x5481('0x43')]({'where':{'id':_0x4b1b3d[_0x5481('0x42')]['id']}})['then'](handleEntityNotFound(_0x492157,null))[_0x5481('0x21')](removeEntity(_0x492157,null))['catch'](handleError(_0x492157,null));};exports[_0x5481('0x47')]=function(_0x3e6f48,_0x2af32e){return db[_0x5481('0x45')][_0x5481('0x47')]()[_0x5481('0x21')](respondWithResult(_0x2af32e,null))['catch'](handleError(_0x2af32e,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 46bb488..4ab4c0d 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 _0x9ac2=['bluebird','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','membername_interface','membername','interface','lodash','util','../../config/logger','api','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9ac2,0x1db));var _0x29ac=function(_0x4a599b,_0x1d2125){_0x4a599b=_0x4a599b-0x0;var _0x2d53d3=_0x9ac2[_0x4a599b];return _0x2d53d3;};'use strict';var _=require(_0x29ac('0x0'));var util=require(_0x29ac('0x1'));var logger=require(_0x29ac('0x2'))(_0x29ac('0x3'));var moment=require(_0x29ac('0x4'));var BPromise=require(_0x29ac('0x5'));var rp=require(_0x29ac('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x29ac('0x7'));var config=require(_0x29ac('0x8'));var attributes=require(_0x29ac('0x9'));module[_0x29ac('0xa')]=function(_0x1faf3f,_0x2b3238){return _0x1faf3f[_0x29ac('0xb')](_0x29ac('0xc'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x29ac('0xd'),'fields':[_0x29ac('0xe'),_0x29ac('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf1b4=['api','bluebird','path','rimraf','../../config/environment','./memberReport.attributes','exports','MemberReport','report_member','membername_interface','interface','lodash','util','../../config/logger'];(function(_0x281109,_0x5e9047){var _0x351919=function(_0x40995b){while(--_0x40995b){_0x281109['push'](_0x281109['shift']());}};_0x351919(++_0x5e9047);}(_0xf1b4,0xcf));var _0x4f1b=function(_0xab906d,_0x74a053){_0xab906d=_0xab906d-0x0;var _0x1b7d8e=_0xf1b4[_0xab906d];return _0x1b7d8e;};'use strict';var _=require(_0x4f1b('0x0'));var util=require(_0x4f1b('0x1'));var logger=require(_0x4f1b('0x2'))(_0x4f1b('0x3'));var moment=require('moment');var BPromise=require(_0x4f1b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f1b('0x5'));var rimraf=require(_0x4f1b('0x6'));var config=require(_0x4f1b('0x7'));var attributes=require(_0x4f1b('0x8'));module[_0x4f1b('0x9')]=function(_0x2ec4a6,_0x16ea1a){return _0x2ec4a6['define'](_0x4f1b('0xa'),attributes,{'tableName':_0x4f1b('0xb'),'paranoid':![],'indexes':[{'name':_0x4f1b('0xc'),'fields':['membername',_0x4f1b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 69b560b..fe2647c 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 _0x8f8f=['util','moment','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport','findAll','options','raw','where','attributes','limit','map','include','model','MemberReport','create','body','CreateMemberReport','UpdateMemberReport','lodash'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x8f8f,0x1d3));var _0xf8f8=function(_0x1f321c,_0x28a27f){_0x1f321c=_0x1f321c-0x0;var _0x2d6d39=_0x8f8f[_0x1f321c];return _0x2d6d39;};'use strict';var _=require(_0xf8f8('0x0'));var util=require(_0xf8f8('0x1'));var moment=require(_0xf8f8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf8f8('0x3'));var db=require(_0xf8f8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8f8('0x5'))(_0xf8f8('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf8f8('0x7')][_0xf8f8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x47ffa2,_0x265bd1,_0x5941d6){return new BPromise(function(_0x3f5f89,_0xa1471b){return client[_0xf8f8('0x9')](_0x47ffa2,_0x5941d6)[_0xf8f8('0xa')](function(_0xa7de3d){logger[_0xf8f8('0xb')]('MemberReport,\x20%s,\x20%s',_0x265bd1,_0xf8f8('0xc'));logger[_0xf8f8('0xd')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x265bd1,'request\x20sent',JSON[_0xf8f8('0xe')](_0xa7de3d));if(_0xa7de3d[_0xf8f8('0xf')]){if(_0xa7de3d[_0xf8f8('0xf')][_0xf8f8('0x10')]===0x1f4){logger['error'](_0xf8f8('0x11'),_0x265bd1,_0xa7de3d['error'][_0xf8f8('0x12')]);return _0xa1471b(_0xa7de3d[_0xf8f8('0xf')][_0xf8f8('0x12')]);}logger[_0xf8f8('0xf')](_0xf8f8('0x11'),_0x265bd1,_0xa7de3d['error'][_0xf8f8('0x12')]);return _0x3f5f89(_0xa7de3d[_0xf8f8('0xf')][_0xf8f8('0x12')]);}else{logger[_0xf8f8('0xb')](_0xf8f8('0x11'),_0x265bd1,_0xf8f8('0xc'));_0x3f5f89(_0xa7de3d[_0xf8f8('0x13')]['message']);}})[_0xf8f8('0x14')](function(_0x10ebc9){logger['error'](_0xf8f8('0x11'),_0x265bd1,_0x10ebc9);_0xa1471b(_0x10ebc9);});});}exports[_0xf8f8('0x15')]=function(_0x5ba9a6){var _0x48856a=this;return new Promise(function(_0x222d8e,_0x5edbba){return db['MemberReport'][_0xf8f8('0x16')]({'raw':_0x5ba9a6[_0xf8f8('0x17')]?_0x5ba9a6[_0xf8f8('0x17')][_0xf8f8('0x18')]===undefined?!![]:![]:!![],'where':_0x5ba9a6['options']?_0x5ba9a6['options'][_0xf8f8('0x19')]||null:null,'attributes':_0x5ba9a6['options']?_0x5ba9a6[_0xf8f8('0x17')][_0xf8f8('0x1a')]||null:null,'limit':_0x5ba9a6[_0xf8f8('0x17')]?_0x5ba9a6[_0xf8f8('0x17')][_0xf8f8('0x1b')]||null:null,'include':_0x5ba9a6['options']?_0x5ba9a6[_0xf8f8('0x17')]['include']?_[_0xf8f8('0x1c')](_0x5ba9a6[_0xf8f8('0x17')][_0xf8f8('0x1d')],function(_0x419f2e){return{'model':db[_0x419f2e['model']],'as':_0x419f2e['as'],'attributes':_0x419f2e['attributes'],'include':_0x419f2e['include']?_[_0xf8f8('0x1c')](_0x419f2e['include'],function(_0x517b03){return{'model':db[_0x517b03[_0xf8f8('0x1e')]],'as':_0x517b03['as'],'attributes':_0x517b03['attributes'],'include':_0x517b03[_0xf8f8('0x1d')]?_[_0xf8f8('0x1c')](_0x517b03[_0xf8f8('0x1d')],function(_0x53703){return{'model':db[_0x53703['model']],'as':_0x53703['as'],'attributes':_0x53703[_0xf8f8('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf8f8('0xa')](function(_0x5037b0){logger[_0xf8f8('0xb')](_0xf8f8('0x15'),_0x5ba9a6);logger[_0xf8f8('0xd')]('GetMemberReport',_0x5ba9a6,JSON[_0xf8f8('0xe')](_0x5037b0));_0x222d8e(_0x5037b0);})[_0xf8f8('0x14')](function(_0xb4752b){logger[_0xf8f8('0xf')](_0xf8f8('0x15'),_0xb4752b['message'],_0x5ba9a6);_0x5edbba(_0x48856a['error'](0x1f4,_0xb4752b['message']));});});};exports['CreateMemberReport']=function(_0x2ba1ee){var _0x3a54cc=this;return new Promise(function(_0x3eeb73,_0x5cdd02){return db[_0xf8f8('0x1f')][_0xf8f8('0x20')](_0x2ba1ee[_0xf8f8('0x21')],{'raw':_0x2ba1ee[_0xf8f8('0x17')]?_0x2ba1ee[_0xf8f8('0x17')][_0xf8f8('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x2b8eda){logger[_0xf8f8('0xb')](_0xf8f8('0x22'),_0x2ba1ee);logger[_0xf8f8('0xd')](_0xf8f8('0x22'),_0x2ba1ee,JSON['stringify'](_0x2b8eda));_0x3eeb73(_0x2b8eda);})[_0xf8f8('0x14')](function(_0x1a97f8){logger[_0xf8f8('0xf')](_0xf8f8('0x22'),_0x1a97f8['message'],_0x2ba1ee);_0x5cdd02(_0x3a54cc[_0xf8f8('0xf')](0x1f4,_0x1a97f8[_0xf8f8('0x12')]));});});};exports[_0xf8f8('0x23')]=function(_0x3edf5a){var _0x3bb9bc=this;return new Promise(function(_0x176158,_0x364f4c){return db['MemberReport']['update'](_0x3edf5a[_0xf8f8('0x21')],{'raw':_0x3edf5a[_0xf8f8('0x17')]?_0x3edf5a[_0xf8f8('0x17')][_0xf8f8('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3edf5a[_0xf8f8('0x17')]?_0x3edf5a[_0xf8f8('0x17')][_0xf8f8('0x19')]||null:null,'attributes':_0x3edf5a[_0xf8f8('0x17')]?_0x3edf5a[_0xf8f8('0x17')]['attributes']||null:null,'limit':_0x3edf5a[_0xf8f8('0x17')]?_0x3edf5a[_0xf8f8('0x17')][_0xf8f8('0x1b')]||null:null})[_0xf8f8('0xa')](function(_0xed6e74){logger['info'](_0xf8f8('0x23'),_0x3edf5a);logger[_0xf8f8('0xd')](_0xf8f8('0x23'),_0x3edf5a,JSON[_0xf8f8('0xe')](_0xed6e74));_0x176158(_0xed6e74);})[_0xf8f8('0x14')](function(_0xab6d78){logger[_0xf8f8('0xf')](_0xf8f8('0x23'),_0xab6d78[_0xf8f8('0x12')],_0x3edf5a);_0x364f4c(_0x3bb9bc['error'](0x1f4,_0xab6d78['message']));});});}; \ No newline at end of file +var _0x16f8=['map','model','attributes','create','body','CreateMemberReport','UpdateMemberReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','raw','options','where','limit','include'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x16f8,0x82));var _0x816f=function(_0x15f603,_0x19466a){_0x15f603=_0x15f603-0x0;var _0x26fd2e=_0x16f8[_0x15f603];return _0x26fd2e;};'use strict';var _=require(_0x816f('0x0'));var util=require('util');var moment=require(_0x816f('0x1'));var BPromise=require(_0x816f('0x2'));var rs=require(_0x816f('0x3'));var fs=require('fs');var Redis=require(_0x816f('0x4'));var db=require(_0x816f('0x5'))['db'];var utils=require(_0x816f('0x6'));var logger=require(_0x816f('0x7'))(_0x816f('0x8'));var config=require(_0x816f('0x9'));var jayson=require(_0x816f('0xa'));var client=jayson[_0x816f('0xb')][_0x816f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ea7e5,_0x8d6c88,_0x493f77){return new BPromise(function(_0x3fb550,_0x334005){return client[_0x816f('0xd')](_0x2ea7e5,_0x493f77)[_0x816f('0xe')](function(_0x23fed9){logger[_0x816f('0xf')](_0x816f('0x10'),_0x8d6c88,_0x816f('0x11'));logger[_0x816f('0x12')](_0x816f('0x13'),_0x8d6c88,_0x816f('0x11'),JSON[_0x816f('0x14')](_0x23fed9));if(_0x23fed9[_0x816f('0x15')]){if(_0x23fed9['error'][_0x816f('0x16')]===0x1f4){logger[_0x816f('0x15')]('MemberReport,\x20%s,\x20%s',_0x8d6c88,_0x23fed9['error'][_0x816f('0x17')]);return _0x334005(_0x23fed9[_0x816f('0x15')][_0x816f('0x17')]);}logger['error']('MemberReport,\x20%s,\x20%s',_0x8d6c88,_0x23fed9['error'][_0x816f('0x17')]);return _0x3fb550(_0x23fed9['error'][_0x816f('0x17')]);}else{logger[_0x816f('0xf')]('MemberReport,\x20%s,\x20%s',_0x8d6c88,'request\x20sent');_0x3fb550(_0x23fed9[_0x816f('0x18')]['message']);}})[_0x816f('0x19')](function(_0x4a20ee){logger[_0x816f('0x15')](_0x816f('0x10'),_0x8d6c88,_0x4a20ee);_0x334005(_0x4a20ee);});});}exports[_0x816f('0x1a')]=function(_0x43588f){var _0x2f579d=this;return new Promise(function(_0x213908,_0x5136c5){return db[_0x816f('0x1b')][_0x816f('0x1c')]({'raw':_0x43588f['options']?_0x43588f['options'][_0x816f('0x1d')]===undefined?!![]:![]:!![],'where':_0x43588f[_0x816f('0x1e')]?_0x43588f[_0x816f('0x1e')][_0x816f('0x1f')]||null:null,'attributes':_0x43588f[_0x816f('0x1e')]?_0x43588f['options']['attributes']||null:null,'limit':_0x43588f[_0x816f('0x1e')]?_0x43588f['options'][_0x816f('0x20')]||null:null,'include':_0x43588f[_0x816f('0x1e')]?_0x43588f['options'][_0x816f('0x21')]?_[_0x816f('0x22')](_0x43588f['options']['include'],function(_0x1e0725){return{'model':db[_0x1e0725[_0x816f('0x23')]],'as':_0x1e0725['as'],'attributes':_0x1e0725['attributes'],'include':_0x1e0725['include']?_[_0x816f('0x22')](_0x1e0725[_0x816f('0x21')],function(_0xd8c308){return{'model':db[_0xd8c308[_0x816f('0x23')]],'as':_0xd8c308['as'],'attributes':_0xd8c308[_0x816f('0x24')],'include':_0xd8c308[_0x816f('0x21')]?_[_0x816f('0x22')](_0xd8c308[_0x816f('0x21')],function(_0x26d6cb){return{'model':db[_0x26d6cb[_0x816f('0x23')]],'as':_0x26d6cb['as'],'attributes':_0x26d6cb[_0x816f('0x24')]};}):[]};}):[]};}):[]:[]})[_0x816f('0xe')](function(_0x5d675){logger[_0x816f('0xf')](_0x816f('0x1a'),_0x43588f);logger[_0x816f('0x12')](_0x816f('0x1a'),_0x43588f,JSON[_0x816f('0x14')](_0x5d675));_0x213908(_0x5d675);})[_0x816f('0x19')](function(_0x42d1f6){logger[_0x816f('0x15')]('GetMemberReport',_0x42d1f6[_0x816f('0x17')],_0x43588f);_0x5136c5(_0x2f579d['error'](0x1f4,_0x42d1f6['message']));});});};exports['CreateMemberReport']=function(_0x153253){var _0x1de28a=this;return new Promise(function(_0x54914f,_0x4fa89f){return db['MemberReport'][_0x816f('0x25')](_0x153253[_0x816f('0x26')],{'raw':_0x153253[_0x816f('0x1e')]?_0x153253[_0x816f('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x816f('0xe')](function(_0x23cc0d){logger['info']('CreateMemberReport',_0x153253);logger['debug']('CreateMemberReport',_0x153253,JSON[_0x816f('0x14')](_0x23cc0d));_0x54914f(_0x23cc0d);})['catch'](function(_0x34ffd6){logger['error'](_0x816f('0x27'),_0x34ffd6['message'],_0x153253);_0x4fa89f(_0x1de28a[_0x816f('0x15')](0x1f4,_0x34ffd6[_0x816f('0x17')]));});});};exports[_0x816f('0x28')]=function(_0x5a922c){var _0x10f33e=this;return new Promise(function(_0x444d38,_0x3b2530){return db[_0x816f('0x1b')]['update'](_0x5a922c[_0x816f('0x26')],{'raw':_0x5a922c[_0x816f('0x1e')]?_0x5a922c[_0x816f('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a922c[_0x816f('0x1e')]?_0x5a922c[_0x816f('0x1e')]['where']||null:null,'attributes':_0x5a922c[_0x816f('0x1e')]?_0x5a922c['options'][_0x816f('0x24')]||null:null,'limit':_0x5a922c[_0x816f('0x1e')]?_0x5a922c[_0x816f('0x1e')][_0x816f('0x20')]||null:null})[_0x816f('0xe')](function(_0x7585a6){logger['info'](_0x816f('0x28'),_0x5a922c);logger['debug'](_0x816f('0x28'),_0x5a922c,JSON[_0x816f('0x14')](_0x7585a6));_0x444d38(_0x7585a6);})[_0x816f('0x19')](function(_0x1826e0){logger[_0x816f('0x15')](_0x816f('0x28'),_0x1826e0[_0x816f('0x17')],_0x5a922c);_0x3b2530(_0x10f33e[_0x816f('0x15')](0x1f4,_0x1826e0[_0x816f('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 08b4101..0b7196d 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 _0x9218=['express','Router','./migration.controller','get','index','exports','multer','connect-timeout'];(function(_0x65ff6c,_0x4c2da3){var _0x238215=function(_0x485ddf){while(--_0x485ddf){_0x65ff6c['push'](_0x65ff6c['shift']());}};_0x238215(++_0x4c2da3);}(_0x9218,0x1d6));var _0x8921=function(_0x3fc9fc,_0x192bfb){_0x3fc9fc=_0x3fc9fc-0x0;var _0x5e3191=_0x9218[_0x3fc9fc];return _0x5e3191;};'use strict';var multer=require(_0x8921('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8921('0x1'));var express=require(_0x8921('0x2'));var router=express[_0x8921('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8921('0x4'));router[_0x8921('0x5')]('/',controller[_0x8921('0x6')]);module[_0x8921('0x7')]=router; \ No newline at end of file +var _0x589c=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','exports','multer','path','connect-timeout'];(function(_0x2d8ca8,_0x22bcb6){var _0x268164=function(_0x58d046){while(--_0x58d046){_0x2d8ca8['push'](_0x2d8ca8['shift']());}};_0x268164(++_0x22bcb6);}(_0x589c,0x18d));var _0xc589=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x589c[_0x50007c];return _0x5c1ec7;};'use strict';var multer=require(_0xc589('0x0'));var util=require('util');var path=require(_0xc589('0x1'));var timeout=require(_0xc589('0x2'));var express=require(_0xc589('0x3'));var router=express[_0xc589('0x4')]();var auth=require(_0xc589('0x5'));var interaction=require(_0xc589('0x6'));var config=require(_0xc589('0x7'));var controller=require(_0xc589('0x8'));router['get']('/',controller['index']);module[_0xc589('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 6e05eb2..3ace634 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 _0xd8f0=['STRING','version','sequelize','exports'];(function(_0x3ff7bb,_0x493a91){var _0x92e69c=function(_0x35285f){while(--_0x35285f){_0x3ff7bb['push'](_0x3ff7bb['shift']());}};_0x92e69c(++_0x493a91);}(_0xd8f0,0x14e));var _0x0d8f=function(_0x2f8140,_0x37076b){_0x2f8140=_0x2f8140-0x0;var _0x21bd12=_0xd8f0[_0x2f8140];return _0x21bd12;};'use strict';var Sequelize=require(_0x0d8f('0x0'));module[_0x0d8f('0x1')]={'version':{'type':Sequelize[_0x0d8f('0x2')],'unique':_0x0d8f('0x3')}}; \ No newline at end of file +var _0xd7c9=['exports','STRING'];(function(_0x340916,_0x2b1417){var _0x489be0=function(_0x43a51a){while(--_0x43a51a){_0x340916['push'](_0x340916['shift']());}};_0x489be0(++_0x2b1417);}(_0xd7c9,0x1f4));var _0x9d7c=function(_0x33f2fa,_0x1411d5){_0x33f2fa=_0x33f2fa-0x0;var _0xe5b3b3=_0xd7c9[_0x33f2fa];return _0xe5b3b3;};'use strict';var Sequelize=require('sequelize');module[_0x9d7c('0x0')]={'version':{'type':Sequelize[_0x9d7c('0x1')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 7a6c211..620ee88 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 _0x316c=['model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','Migration','includeAll','include','findAll','rows','catch','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','set','Content-Range','json','save','then','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection'];(function(_0x238c7f,_0x4c5800){var _0x42ae5e=function(_0x277e17){while(--_0x277e17){_0x238c7f['push'](_0x238c7f['shift']());}};_0x42ae5e(++_0x4c5800);}(_0x316c,0x113));var _0xc316=function(_0x19495c,_0x298fb7){_0x19495c=_0x19495c-0x0;var _0x3c3483=_0x316c[_0x19495c];return _0x3c3483;};'use strict';var pdf=require(_0xc316('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc316('0x1'));var zipdir=require(_0xc316('0x2'));var jsonpatch=require(_0xc316('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc316('0x4'));var Mustache=require(_0xc316('0x5'));var util=require('util');var path=require(_0xc316('0x6'));var sox=require(_0xc316('0x7'));var csv=require(_0xc316('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xc316('0x9'));var crypto=require(_0xc316('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc316('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc316('0xc'));var Redis=require(_0xc316('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc316('0xe'));var hardwareService=require(_0xc316('0xf'));var logger=require(_0xc316('0x10'))('api');var utils=require(_0xc316('0x11'));var config=require(_0xc316('0x12'));var db=require(_0xc316('0x13'))['db'];function respondWithStatusCode(_0x20e30b,_0x2f324f){_0x2f324f=_0x2f324f||0xcc;return function(_0x506abc){if(_0x506abc){return _0x20e30b[_0xc316('0x14')](_0x2f324f);}return _0x20e30b['status'](_0x2f324f)[_0xc316('0x15')]();};}function respondWithResult(_0x5ea7f5,_0x17b637){_0x17b637=_0x17b637||0xc8;return function(_0x165cbe){if(_0x165cbe){return _0x5ea7f5[_0xc316('0x16')](_0x17b637)['json'](_0x165cbe);}};}function respondWithFilteredResult(_0x45c29a,_0x374651){return function(_0x1ddad7){if(_0x1ddad7){var _0xf6592=_0x1ddad7[_0xc316('0x17')],_0x1b4597=_0x374651[_0xc316('0x18')],_0x1a8fe7=_0x374651['offset']+_0x374651['limit'],_0x5768fe;if(_0x1a8fe7>=_0xf6592){_0x1a8fe7=_0xf6592;_0x5768fe=0xc8;}else{_0x5768fe=0xce;}_0x45c29a[_0xc316('0x16')](_0x5768fe);return _0x45c29a[_0xc316('0x19')](_0xc316('0x1a'),_0x1b4597+'-'+_0x1a8fe7+'/'+_0xf6592)[_0xc316('0x1b')](_0x1ddad7);}return null;};}function patchUpdates(_0x5db7be){return function(_0x1d8c92){try{jsonpatch['apply'](_0x1d8c92,_0x5db7be,!![]);}catch(_0x539303){return BPromise['reject'](_0x539303);}return _0x1d8c92[_0xc316('0x1c')]();};}function saveUpdates(_0x2fd548,_0x2f85e3){return function(_0x5695cd){if(_0x5695cd){return _0x5695cd['update'](_0x2fd548)[_0xc316('0x1d')](function(_0x4510c0){return _0x4510c0;});}return null;};}function removeEntity(_0x231daf,_0x2e30de){return function(_0x25c1f2){if(_0x25c1f2){return _0x25c1f2['destroy']()[_0xc316('0x1d')](function(){_0x231daf['status'](0xcc)[_0xc316('0x15')]();});}};}function handleEntityNotFound(_0x2fafed,_0x470dda){return function(_0x20e4ec){if(!_0x20e4ec){_0x2fafed['sendStatus'](0x194);}return _0x20e4ec;};}function handleError(_0x467da5,_0x1d5577){_0x1d5577=_0x1d5577||0x1f4;return function(_0x36ab2d){logger[_0xc316('0x1e')](_0x36ab2d[_0xc316('0x1f')]);if(_0x36ab2d[_0xc316('0x20')]){delete _0x36ab2d[_0xc316('0x20')];}_0x467da5[_0xc316('0x16')](_0x1d5577)[_0xc316('0x21')](_0x36ab2d);};}exports[_0xc316('0x22')]=function(_0x3e49d2,_0x5c0441){var _0x3d4ab6={},_0x11a6f5={},_0x28bce1={'count':0x0,'rows':[]};var _0x4e8c24=db['Migration'][_0xc316('0x23')];_0x11a6f5['model']=_[_0xc316('0x24')](_0x4e8c24);_0x11a6f5[_0xc316('0x25')]=_[_0xc316('0x24')](_0x3e49d2['query']);_0x11a6f5[_0xc316('0x26')]=_[_0xc316('0x27')](_0x11a6f5[_0xc316('0x28')],_0x11a6f5[_0xc316('0x25')]);_0x3d4ab6[_0xc316('0x29')]=_[_0xc316('0x27')](_0x11a6f5['model'],qs[_0xc316('0x2a')](_0x3e49d2['query'][_0xc316('0x2a')]));_0x3d4ab6[_0xc316('0x29')]=_0x3d4ab6[_0xc316('0x29')][_0xc316('0x2b')]?_0x3d4ab6[_0xc316('0x29')]:_0x11a6f5[_0xc316('0x28')];if(!_0x3e49d2[_0xc316('0x25')][_0xc316('0x2c')](_0xc316('0x2d'))){_0x3d4ab6[_0xc316('0x2e')]=qs['limit'](_0x3e49d2[_0xc316('0x25')][_0xc316('0x2e')]);_0x3d4ab6['offset']=qs[_0xc316('0x18')](_0x3e49d2[_0xc316('0x25')][_0xc316('0x18')]);}_0x3d4ab6['order']=qs['sort'](_0x3e49d2[_0xc316('0x25')][_0xc316('0x2f')]);_0x3d4ab6[_0xc316('0x30')]=qs[_0xc316('0x26')](_[_0xc316('0x31')](_0x3e49d2[_0xc316('0x25')],_0x11a6f5[_0xc316('0x26')]));if(_0x3e49d2[_0xc316('0x25')][_0xc316('0x32')]){_0x3d4ab6[_0xc316('0x30')]=_[_0xc316('0x33')](_0x3d4ab6[_0xc316('0x30')],{'$or':_['map'](_0x4e8c24,function(_0x37a4bc){if(_0x37a4bc[_0xc316('0x34')][_0xc316('0x35')]!==_0xc316('0x36')){var _0x234ee6={};_0x234ee6[_0x37a4bc[_0xc316('0x37')]]={'$like':'%'+_0x3e49d2[_0xc316('0x25')][_0xc316('0x32')]+'%'};return _0x234ee6;}})});}_0x3d4ab6=_['merge']({},_0x3d4ab6,_0x3e49d2[_0xc316('0x38')]);var _0x5cd8a5={'where':_0x3d4ab6[_0xc316('0x30')]};return db[_0xc316('0x39')][_0xc316('0x17')](_0x5cd8a5)[_0xc316('0x1d')](function(_0x292704){_0x28bce1[_0xc316('0x17')]=_0x292704;if(_0x3e49d2[_0xc316('0x25')][_0xc316('0x3a')]){_0x3d4ab6[_0xc316('0x3b')]=[{'all':!![]}];}return db['Migration'][_0xc316('0x3c')](_0x3d4ab6);})[_0xc316('0x1d')](function(_0x386778){_0x28bce1[_0xc316('0x3d')]=_0x386778;return _0x28bce1;})[_0xc316('0x1d')](respondWithFilteredResult(_0x5c0441,_0x3d4ab6))[_0xc316('0x3e')](handleError(_0x5c0441,null));}; \ No newline at end of file +var _0x88de=['Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','Migration','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','map','type','VIRTUAL','field','options','count','includeAll','include','findAll','catch','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/environment','status','end','offset','set'];(function(_0x3b29cf,_0x171bc9){var _0x1dc73b=function(_0x2531e6){while(--_0x2531e6){_0x3b29cf['push'](_0x3b29cf['shift']());}};_0x1dc73b(++_0x171bc9);}(_0x88de,0x19c));var _0xe88d=function(_0x123bfd,_0x65d5b6){_0x123bfd=_0x123bfd-0x0;var _0x331bd4=_0x88de[_0x123bfd];return _0x331bd4;};'use strict';var pdf=require(_0xe88d('0x0'));var emlformat=require(_0xe88d('0x1'));var rimraf=require(_0xe88d('0x2'));var zipdir=require(_0xe88d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe88d('0x4'));var Mustache=require(_0xe88d('0x5'));var util=require('util');var path=require(_0xe88d('0x6'));var sox=require('sox');var csv=require(_0xe88d('0x7'));var ejs=require(_0xe88d('0x8'));var fs=require('fs');var _=require(_0xe88d('0x9'));var squel=require(_0xe88d('0xa'));var crypto=require(_0xe88d('0xb'));var jsforce=require(_0xe88d('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe88d('0xd'));var Papa=require(_0xe88d('0xe'));var Redis=require(_0xe88d('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe88d('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe88d('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d2e27,_0x11ee99){_0x11ee99=_0x11ee99||0xcc;return function(_0x4cda54){if(_0x4cda54){return _0x5d2e27['sendStatus'](_0x11ee99);}return _0x5d2e27[_0xe88d('0x12')](_0x11ee99)[_0xe88d('0x13')]();};}function respondWithResult(_0x3e911a,_0x566d0b){_0x566d0b=_0x566d0b||0xc8;return function(_0x3b455e){if(_0x3b455e){return _0x3e911a[_0xe88d('0x12')](_0x566d0b)['json'](_0x3b455e);}};}function respondWithFilteredResult(_0xe8d11a,_0x22f678){return function(_0x14fbea){if(_0x14fbea){var _0x5b4697=_0x14fbea['count'],_0x369107=_0x22f678['offset'],_0x5bc2f8=_0x22f678[_0xe88d('0x14')]+_0x22f678['limit'],_0x4d15df;if(_0x5bc2f8>=_0x5b4697){_0x5bc2f8=_0x5b4697;_0x4d15df=0xc8;}else{_0x4d15df=0xce;}_0xe8d11a[_0xe88d('0x12')](_0x4d15df);return _0xe8d11a[_0xe88d('0x15')](_0xe88d('0x16'),_0x369107+'-'+_0x5bc2f8+'/'+_0x5b4697)[_0xe88d('0x17')](_0x14fbea);}return null;};}function patchUpdates(_0xe62fa8){return function(_0x57dc7b){try{jsonpatch[_0xe88d('0x18')](_0x57dc7b,_0xe62fa8,!![]);}catch(_0x215661){return BPromise[_0xe88d('0x19')](_0x215661);}return _0x57dc7b[_0xe88d('0x1a')]();};}function saveUpdates(_0xdb1907,_0x5be9e0){return function(_0x4d4a04){if(_0x4d4a04){return _0x4d4a04[_0xe88d('0x1b')](_0xdb1907)[_0xe88d('0x1c')](function(_0x6042fd){return _0x6042fd;});}return null;};}function removeEntity(_0x3f6fb8,_0x476d58){return function(_0x431ea0){if(_0x431ea0){return _0x431ea0[_0xe88d('0x1d')]()['then'](function(){_0x3f6fb8['status'](0xcc)[_0xe88d('0x13')]();});}};}function handleEntityNotFound(_0x417596,_0x33fa72){return function(_0x343aeb){if(!_0x343aeb){_0x417596['sendStatus'](0x194);}return _0x343aeb;};}function handleError(_0x33bd69,_0x51fece){_0x51fece=_0x51fece||0x1f4;return function(_0x1ab655){logger[_0xe88d('0x1e')](_0x1ab655[_0xe88d('0x1f')]);if(_0x1ab655[_0xe88d('0x20')]){delete _0x1ab655[_0xe88d('0x20')];}_0x33bd69[_0xe88d('0x12')](_0x51fece)[_0xe88d('0x21')](_0x1ab655);};}exports[_0xe88d('0x22')]=function(_0x5397ee,_0x46e527){var _0x29683b={},_0x4ee733={},_0x27c5c2={'count':0x0,'rows':[]};var _0x1e3009=db[_0xe88d('0x23')][_0xe88d('0x24')];_0x4ee733[_0xe88d('0x25')]=_['keys'](_0x1e3009);_0x4ee733['query']=_[_0xe88d('0x26')](_0x5397ee[_0xe88d('0x27')]);_0x4ee733[_0xe88d('0x28')]=_[_0xe88d('0x29')](_0x4ee733[_0xe88d('0x25')],_0x4ee733[_0xe88d('0x27')]);_0x29683b['attributes']=_[_0xe88d('0x29')](_0x4ee733[_0xe88d('0x25')],qs['fields'](_0x5397ee[_0xe88d('0x27')][_0xe88d('0x2a')]));_0x29683b['attributes']=_0x29683b[_0xe88d('0x2b')][_0xe88d('0x2c')]?_0x29683b[_0xe88d('0x2b')]:_0x4ee733['model'];if(!_0x5397ee[_0xe88d('0x27')][_0xe88d('0x2d')](_0xe88d('0x2e'))){_0x29683b['limit']=qs[_0xe88d('0x2f')](_0x5397ee[_0xe88d('0x27')][_0xe88d('0x2f')]);_0x29683b[_0xe88d('0x14')]=qs[_0xe88d('0x14')](_0x5397ee[_0xe88d('0x27')][_0xe88d('0x14')]);}_0x29683b['order']=qs[_0xe88d('0x30')](_0x5397ee[_0xe88d('0x27')][_0xe88d('0x30')]);_0x29683b[_0xe88d('0x31')]=qs[_0xe88d('0x28')](_['pick'](_0x5397ee['query'],_0x4ee733['filters']));if(_0x5397ee['query'][_0xe88d('0x32')]){_0x29683b[_0xe88d('0x31')]=_[_0xe88d('0x33')](_0x29683b[_0xe88d('0x31')],{'$or':_[_0xe88d('0x34')](_0x1e3009,function(_0x1f8f86){if(_0x1f8f86[_0xe88d('0x35')]['key']!==_0xe88d('0x36')){var _0x50c6f9={};_0x50c6f9[_0x1f8f86[_0xe88d('0x37')]]={'$like':'%'+_0x5397ee[_0xe88d('0x27')][_0xe88d('0x32')]+'%'};return _0x50c6f9;}})});}_0x29683b=_['merge']({},_0x29683b,_0x5397ee[_0xe88d('0x38')]);var _0x2639c5={'where':_0x29683b[_0xe88d('0x31')]};return db[_0xe88d('0x23')][_0xe88d('0x39')](_0x2639c5)[_0xe88d('0x1c')](function(_0x149b08){_0x27c5c2[_0xe88d('0x39')]=_0x149b08;if(_0x5397ee[_0xe88d('0x27')][_0xe88d('0x3a')]){_0x29683b[_0xe88d('0x3b')]=[{'all':!![]}];}return db[_0xe88d('0x23')][_0xe88d('0x3c')](_0x29683b);})['then'](function(_0x1d52a6){_0x27c5c2['rows']=_0x1d52a6;return _0x27c5c2;})[_0xe88d('0x1c')](respondWithFilteredResult(_0x46e527,_0x29683b))[_0xe88d('0x3d')](handleError(_0x46e527,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 409a409..89bac2d 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 _0xe09d=['exports','define','migrations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./migration.attributes'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0xe09d,0x155));var _0xde09=function(_0x311c0d,_0xb44133){_0x311c0d=_0x311c0d-0x0;var _0x2be2a2=_0xe09d[_0x311c0d];return _0x2be2a2;};'use strict';var _=require(_0xde09('0x0'));var util=require(_0xde09('0x1'));var logger=require(_0xde09('0x2'))(_0xde09('0x3'));var moment=require(_0xde09('0x4'));var BPromise=require('bluebird');var rp=require(_0xde09('0x5'));var fs=require('fs');var path=require(_0xde09('0x6'));var rimraf=require(_0xde09('0x7'));var config=require(_0xde09('0x8'));var attributes=require(_0xde09('0x9'));module[_0xde09('0xa')]=function(_0x1bd951,_0x217ee9){return _0x1bd951[_0xde09('0xb')]('Migration',attributes,{'tableName':_0xde09('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc78b=['migrations','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','Migration'];(function(_0x4fbaf9,_0x3b8190){var _0x1d89a0=function(_0x3b650b){while(--_0x3b650b){_0x4fbaf9['push'](_0x4fbaf9['shift']());}};_0x1d89a0(++_0x3b8190);}(_0xc78b,0x198));var _0xbc78=function(_0x3427b7,_0x5bc5f3){_0x3427b7=_0x3427b7-0x0;var _0xea8ea2=_0xc78b[_0x3427b7];return _0xea8ea2;};'use strict';var _=require('lodash');var util=require(_0xbc78('0x0'));var logger=require(_0xbc78('0x1'))('api');var moment=require('moment');var BPromise=require(_0xbc78('0x2'));var rp=require(_0xbc78('0x3'));var fs=require('fs');var path=require(_0xbc78('0x4'));var rimraf=require(_0xbc78('0x5'));var config=require(_0xbc78('0x6'));var attributes=require(_0xbc78('0x7'));module[_0xbc78('0x8')]=function(_0x5b6afb,_0x495b10){return _0x5b6afb['define'](_0xbc78('0x9'),attributes,{'tableName':_0xbc78('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index a1c4809..5d0a2fb 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 _0x7bae=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7bae,0x13b));var _0xe7ba=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x7bae[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7ba('0x0'));var BPromise=require(_0xe7ba('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7ba('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7ba('0x3'));var logger=require(_0xe7ba('0x4'))(_0xe7ba('0x5'));var config=require(_0xe7ba('0x6'));var jayson=require(_0xe7ba('0x7'));var client=jayson[_0xe7ba('0x8')][_0xe7ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c5e59,_0x10b307,_0x34fb18){return new BPromise(function(_0x160565,_0x27b1d5){return client[_0xe7ba('0xa')](_0x3c5e59,_0x34fb18)[_0xe7ba('0xb')](function(_0x588f08){logger[_0xe7ba('0xc')](_0xe7ba('0xd'),_0x10b307,_0xe7ba('0xe'));logger[_0xe7ba('0xf')](_0xe7ba('0x10'),_0x10b307,_0xe7ba('0xe'),JSON[_0xe7ba('0x11')](_0x588f08));if(_0x588f08[_0xe7ba('0x12')]){if(_0x588f08[_0xe7ba('0x12')]['code']===0x1f4){logger[_0xe7ba('0x12')]('Migration,\x20%s,\x20%s',_0x10b307,_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);return _0x27b1d5(_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);}logger[_0xe7ba('0x12')](_0xe7ba('0xd'),_0x10b307,_0x588f08['error']['message']);return _0x160565(_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);}else{logger[_0xe7ba('0xc')]('Migration,\x20%s,\x20%s',_0x10b307,_0xe7ba('0xe'));_0x160565(_0x588f08['result']['message']);}})['catch'](function(_0x393f75){logger['error'](_0xe7ba('0xd'),_0x10b307,_0x393f75);_0x27b1d5(_0x393f75);});});} \ No newline at end of file +var _0x032e=['code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4ce88a,_0x36d8d1){var _0x4f5ad9=function(_0x49427e){while(--_0x49427e){_0x4ce88a['push'](_0x4ce88a['shift']());}};_0x4f5ad9(++_0x36d8d1);}(_0x032e,0x124));var _0xe032=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x032e[_0x433a86];return _0x23000c;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var moment=require(_0xe032('0x1'));var BPromise=require(_0xe032('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe032('0x3'))['db'];var utils=require(_0xe032('0x4'));var logger=require(_0xe032('0x5'))(_0xe032('0x6'));var config=require(_0xe032('0x7'));var jayson=require(_0xe032('0x8'));var client=jayson[_0xe032('0x9')][_0xe032('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37432f,_0x1576c8,_0x3289b0){return new BPromise(function(_0xd84027,_0xaf3907){return client[_0xe032('0xb')](_0x37432f,_0x3289b0)[_0xe032('0xc')](function(_0x2d8a14){logger[_0xe032('0xd')](_0xe032('0xe'),_0x1576c8,'request\x20sent');logger[_0xe032('0xf')](_0xe032('0x10'),_0x1576c8,_0xe032('0x11'),JSON[_0xe032('0x12')](_0x2d8a14));if(_0x2d8a14[_0xe032('0x13')]){if(_0x2d8a14[_0xe032('0x13')][_0xe032('0x14')]===0x1f4){logger['error'](_0xe032('0xe'),_0x1576c8,_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);return _0xaf3907(_0x2d8a14[_0xe032('0x13')]['message']);}logger[_0xe032('0x13')](_0xe032('0xe'),_0x1576c8,_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);return _0xd84027(_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);}else{logger[_0xe032('0xd')]('Migration,\x20%s,\x20%s',_0x1576c8,_0xe032('0x11'));_0xd84027(_0x2d8a14[_0xe032('0x16')][_0xe032('0x15')]);}})[_0xe032('0x17')](function(_0x1938c4){logger[_0xe032('0x13')]('Migration,\x20%s,\x20%s',_0x1576c8,_0x1938c4);_0xaf3907(_0x1938c4);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index f345e67..cea4e01 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 _0xf2ac=['destroy','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./network.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete'];(function(_0x3479c5,_0x3c3186){var _0x4e5bd5=function(_0x3358b1){while(--_0x3358b1){_0x3479c5['push'](_0x3479c5['shift']());}};_0x4e5bd5(++_0x3c3186);}(_0xf2ac,0x91));var _0xcf2a=function(_0x3f7206,_0x37d996){_0x3f7206=_0x3f7206-0x0;var _0x3f792f=_0xf2ac[_0x3f7206];return _0x3f792f;};'use strict';var multer=require(_0xcf2a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcf2a('0x1'));var express=require('express');var router=express[_0xcf2a('0x2')]();var auth=require(_0xcf2a('0x3'));var interaction=require(_0xcf2a('0x4'));var config=require('../../config/environment');var controller=require(_0xcf2a('0x5'));router[_0xcf2a('0x6')]('/',auth[_0xcf2a('0x7')](),controller[_0xcf2a('0x8')]);router['get'](_0xcf2a('0x9'),auth[_0xcf2a('0x7')](),controller[_0xcf2a('0xa')]);router[_0xcf2a('0xb')]('/',auth['isAuthenticated'](),controller[_0xcf2a('0xc')]);router[_0xcf2a('0xd')](_0xcf2a('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xcf2a('0xe')](_0xcf2a('0x9'),auth[_0xcf2a('0x7')](),controller[_0xcf2a('0xf')]);module['exports']=router; \ No newline at end of file +var _0x8338=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./network.controller','get','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x1bb10d,_0x1a6b59){var _0x9dd604=function(_0x47fe35){while(--_0x47fe35){_0x1bb10d['push'](_0x1bb10d['shift']());}};_0x9dd604(++_0x1a6b59);}(_0x8338,0x140));var _0x8833=function(_0x1c3da2,_0x3f9430){_0x1c3da2=_0x1c3da2-0x0;var _0x2dfd66=_0x8338[_0x1c3da2];return _0x2dfd66;};'use strict';var multer=require(_0x8833('0x0'));var util=require(_0x8833('0x1'));var path=require(_0x8833('0x2'));var timeout=require(_0x8833('0x3'));var express=require(_0x8833('0x4'));var router=express[_0x8833('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x8833('0x6'));var config=require(_0x8833('0x7'));var controller=require(_0x8833('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8833('0x9')](_0x8833('0xa'),auth[_0x8833('0xb')](),controller[_0x8833('0xc')]);router[_0x8833('0xd')]('/',auth[_0x8833('0xb')](),controller[_0x8833('0xe')]);router['put'](_0x8833('0xa'),auth['isAuthenticated'](),controller[_0x8833('0xf')]);router[_0x8833('0x10')](_0x8833('0xa'),auth['isAuthenticated'](),controller[_0x8833('0x11')]);module[_0x8833('0x12')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 4c30441..a26b536 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 _0x373c=['sequelize','ENUM','localnet','externip'];(function(_0x164b35,_0x8a6609){var _0x48a5c8=function(_0x322fd5){while(--_0x322fd5){_0x164b35['push'](_0x164b35['shift']());}};_0x48a5c8(++_0x8a6609);}(_0x373c,0xb0));var _0xc373=function(_0x52ea08,_0x15d935){_0x52ea08=_0x52ea08-0x0;var _0x28d546=_0x373c[_0x52ea08];return _0x28d546;};'use strict';var Sequelize=require(_0xc373('0x0'));module['exports']={'type':{'type':Sequelize[_0xc373('0x1')](_0xc373('0x2'),_0xc373('0x3'))},'value':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcd52=['STRING','exports','ENUM','externip'];(function(_0x17d912,_0x48711e){var _0x3e8c9f=function(_0x3b0094){while(--_0x3b0094){_0x17d912['push'](_0x17d912['shift']());}};_0x3e8c9f(++_0x48711e);}(_0xcd52,0x121));var _0x2cd5=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xcd52[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require('sequelize');module[_0x2cd5('0x0')]={'type':{'type':Sequelize[_0x2cd5('0x1')]('localnet',_0x2cd5('0x2'))},'value':{'type':Sequelize[_0x2cd5('0x3')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 9106204..c6776c5 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 _0x7a54=['jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','stringify','error','code','Network,\x20%s,\x20%s','message','info','result','catch','sendStatus','json','count','offset','limit','status','Content-Range','apply','reject','save','destroy','stack','name','index','Network','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','key','VIRTUAL','includeAll','include','findAll','rows','show','length','merge','options','create','sequelize','transaction','body','type','readFileSync','join','server/files/templates/network.ejs','utf8','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','update','find','params','render','root','writeFileSync','chan_sip.so','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x1c6856,_0x8786ba){var _0x310ca5=function(_0x5d32b6){while(--_0x5d32b6){_0x1c6856['push'](_0x1c6856['shift']());}};_0x310ca5(++_0x8786ba);}(_0x7a54,0x106));var _0x47a5=function(_0x3615f5,_0x83dac){_0x3615f5=_0x3615f5-0x0;var _0x22017e=_0x7a54[_0x3615f5];return _0x22017e;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x47a5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x47a5('0x11'));var config=require(_0x47a5('0x12'));var db=require(_0x47a5('0x13'))['db'];var jayson=require(_0x47a5('0x14'));var client=jayson[_0x47a5('0x15')][_0x47a5('0x16')]({'port':0x232a});function checkPasswordPattern(_0x1eae59,_0x5beb89,_0x44bd3e){if(_0x44bd3e){var _0x221b54=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x221b54[_0x47a5('0x17')](_0x5beb89)){return _0x1eae59;}else{throw new Error(_0x47a5('0x18'));}}else{return _0x1eae59;}}function respondWithRpcPromise(_0x139f25,_0x620ee9,_0x3c6c46,_0x190faa){return new BPromise(function(_0x4e99a8,_0x362359){var _0x11faf5=_0x190faa||client;return _0x11faf5[_0x47a5('0x19')](_0x139f25,_0x3c6c46)[_0x47a5('0x1a')](function(_0x1ef44c){logger['info']('Network,\x20%s,\x20%s',_0x620ee9,_0x47a5('0x1b'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x620ee9,_0x47a5('0x1b'),JSON[_0x47a5('0x1c')](_0x1ef44c));if(_0x1ef44c[_0x47a5('0x1d')]){if(_0x1ef44c[_0x47a5('0x1d')][_0x47a5('0x1e')]===0x1f4){logger[_0x47a5('0x1d')](_0x47a5('0x1f'),_0x620ee9,_0x1ef44c[_0x47a5('0x1d')][_0x47a5('0x20')]);return _0x362359(_0x1ef44c['error'][_0x47a5('0x20')]);}logger[_0x47a5('0x1d')]('Network,\x20%s,\x20%s',_0x620ee9,_0x1ef44c[_0x47a5('0x1d')][_0x47a5('0x20')]);return _0x4e99a8(_0x1ef44c[_0x47a5('0x1d')]['message']);}else{logger[_0x47a5('0x21')](_0x47a5('0x1f'),_0x620ee9,_0x47a5('0x1b'));_0x4e99a8(_0x1ef44c[_0x47a5('0x22')]['message']);}})[_0x47a5('0x23')](function(_0x385687){logger['error'](_0x47a5('0x1f'),_0x620ee9,_0x385687);_0x362359(_0x385687);});});}function respondWithStatusCode(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0xcc;return function(_0x129ce5){if(_0x129ce5){return _0xc4cd63[_0x47a5('0x24')](_0x4437f1);}return _0xc4cd63['status'](_0x4437f1)['end']();};}function respondWithResult(_0x136745,_0x5686db){_0x5686db=_0x5686db||0xc8;return function(_0x1ea9c8){if(_0x1ea9c8){return _0x136745['status'](_0x5686db)[_0x47a5('0x25')](_0x1ea9c8);}};}function respondWithFilteredResult(_0x378208,_0x36ad34){return function(_0x1dac65){if(_0x1dac65){var _0x21f296=_0x1dac65[_0x47a5('0x26')],_0x3ba0b7=_0x36ad34[_0x47a5('0x27')],_0x24b162=_0x36ad34[_0x47a5('0x27')]+_0x36ad34[_0x47a5('0x28')],_0x136b14;if(_0x24b162>=_0x21f296){_0x24b162=_0x21f296;_0x136b14=0xc8;}else{_0x136b14=0xce;}_0x378208[_0x47a5('0x29')](_0x136b14);return _0x378208['set'](_0x47a5('0x2a'),_0x3ba0b7+'-'+_0x24b162+'/'+_0x21f296)['json'](_0x1dac65);}return null;};}function patchUpdates(_0x2ef875){return function(_0x9ac908){try{jsonpatch[_0x47a5('0x2b')](_0x9ac908,_0x2ef875,!![]);}catch(_0x4d6b57){return BPromise[_0x47a5('0x2c')](_0x4d6b57);}return _0x9ac908[_0x47a5('0x2d')]();};}function saveUpdates(_0x39b50b,_0x1f1c68){return function(_0x51cc81){if(_0x51cc81){return _0x51cc81['update'](_0x39b50b)[_0x47a5('0x1a')](function(_0xfb5ddb){return _0xfb5ddb;});}return null;};}function removeEntity(_0x5bd7eb,_0x4e1006){return function(_0x836303){if(_0x836303){return _0x836303[_0x47a5('0x2e')]()['then'](function(){_0x5bd7eb[_0x47a5('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x122ed6,_0xd972c){return function(_0x5c5162){if(!_0x5c5162){_0x122ed6['sendStatus'](0x194);}return _0x5c5162;};}function handleError(_0x274e34,_0x5910bb){_0x5910bb=_0x5910bb||0x1f4;return function(_0x403028){logger[_0x47a5('0x1d')](_0x403028[_0x47a5('0x2f')]);if(_0x403028['name']){delete _0x403028[_0x47a5('0x30')];}_0x274e34['status'](_0x5910bb)['send'](_0x403028);};}exports[_0x47a5('0x31')]=function(_0x5a8a7c,_0x25cce0){var _0x5ef577={},_0x21ad34={},_0x3534cb={'count':0x0,'rows':[]};var _0x38c8d4=db[_0x47a5('0x32')][_0x47a5('0x33')];_0x21ad34[_0x47a5('0x34')]=_[_0x47a5('0x35')](_0x38c8d4);_0x21ad34[_0x47a5('0x36')]=_[_0x47a5('0x35')](_0x5a8a7c['query']);_0x21ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x21ad34['model'],_0x21ad34[_0x47a5('0x36')]);_0x5ef577[_0x47a5('0x39')]=_[_0x47a5('0x38')](_0x21ad34['model'],qs[_0x47a5('0x3a')](_0x5a8a7c[_0x47a5('0x36')]['fields']));_0x5ef577[_0x47a5('0x39')]=_0x5ef577[_0x47a5('0x39')]['length']?_0x5ef577['attributes']:_0x21ad34['model'];if(!_0x5a8a7c[_0x47a5('0x36')]['hasOwnProperty'](_0x47a5('0x3b'))){_0x5ef577[_0x47a5('0x28')]=qs[_0x47a5('0x28')](_0x5a8a7c[_0x47a5('0x36')][_0x47a5('0x28')]);_0x5ef577[_0x47a5('0x27')]=qs[_0x47a5('0x27')](_0x5a8a7c[_0x47a5('0x36')][_0x47a5('0x27')]);}_0x5ef577[_0x47a5('0x3c')]=qs[_0x47a5('0x3d')](_0x5a8a7c[_0x47a5('0x36')][_0x47a5('0x3d')]);_0x5ef577['where']=qs[_0x47a5('0x37')](_[_0x47a5('0x3e')](_0x5a8a7c[_0x47a5('0x36')],_0x21ad34[_0x47a5('0x37')]));if(_0x5a8a7c['query'][_0x47a5('0x3f')]){_0x5ef577['where']=_['merge'](_0x5ef577['where'],{'$or':_['map'](_0x38c8d4,function(_0x27dd5d){if(_0x27dd5d['type'][_0x47a5('0x40')]!==_0x47a5('0x41')){var _0x448610={};_0x448610[_0x27dd5d['field']]={'$like':'%'+_0x5a8a7c[_0x47a5('0x36')][_0x47a5('0x3f')]+'%'};return _0x448610;}})});}_0x5ef577=_['merge']({},_0x5ef577,_0x5a8a7c['options']);var _0xbe21d9={'where':_0x5ef577['where']};return db[_0x47a5('0x32')][_0x47a5('0x26')](_0xbe21d9)[_0x47a5('0x1a')](function(_0xd75ca3){_0x3534cb[_0x47a5('0x26')]=_0xd75ca3;if(_0x5a8a7c[_0x47a5('0x36')][_0x47a5('0x42')]){_0x5ef577[_0x47a5('0x43')]=[{'all':!![]}];}return db[_0x47a5('0x32')][_0x47a5('0x44')](_0x5ef577);})[_0x47a5('0x1a')](function(_0x3c3ebf){_0x3534cb[_0x47a5('0x45')]=_0x3c3ebf;return _0x3534cb;})[_0x47a5('0x1a')](respondWithFilteredResult(_0x25cce0,_0x5ef577))[_0x47a5('0x23')](handleError(_0x25cce0,null));};exports[_0x47a5('0x46')]=function(_0x512e65,_0x2d38de){var _0x23bb04={'raw':!![],'where':{'id':_0x512e65['params']['id']}},_0x49eab1={};_0x49eab1[_0x47a5('0x34')]=_['keys'](db[_0x47a5('0x32')][_0x47a5('0x33')]);_0x49eab1['query']=_['keys'](_0x512e65[_0x47a5('0x36')]);_0x49eab1['filters']=_[_0x47a5('0x38')](_0x49eab1[_0x47a5('0x34')],_0x49eab1[_0x47a5('0x36')]);_0x23bb04[_0x47a5('0x39')]=_[_0x47a5('0x38')](_0x49eab1[_0x47a5('0x34')],qs[_0x47a5('0x3a')](_0x512e65['query']['fields']));_0x23bb04[_0x47a5('0x39')]=_0x23bb04[_0x47a5('0x39')][_0x47a5('0x47')]?_0x23bb04[_0x47a5('0x39')]:_0x49eab1[_0x47a5('0x34')];if(_0x512e65[_0x47a5('0x36')][_0x47a5('0x42')]){_0x23bb04['include']=[{'all':!![]}];}_0x23bb04=_[_0x47a5('0x48')]({},_0x23bb04,_0x512e65[_0x47a5('0x49')]);return db[_0x47a5('0x32')]['find'](_0x23bb04)[_0x47a5('0x1a')](handleEntityNotFound(_0x2d38de,null))['then'](respondWithResult(_0x2d38de,null))[_0x47a5('0x23')](handleError(_0x2d38de,null));};exports[_0x47a5('0x4a')]=function(_0x46e90b,_0xf03bd5,_0x588551){var _0x3adf14;return db[_0x47a5('0x4b')][_0x47a5('0x4c')](function(_0x3a2de4){return db[_0x47a5('0x32')][_0x47a5('0x4a')](_0x46e90b[_0x47a5('0x4d')],{'raw':!![]})['then'](function(_0x2a0aa2){_0x3adf14=_0x2a0aa2;return db[_0x47a5('0x32')][_0x47a5('0x44')]({'where':{'type':_0x46e90b[_0x47a5('0x4d')][_0x47a5('0x4e')]},'raw':!![]});})[_0x47a5('0x1a')](function(_0x572233){var _0x1ad6a9=fs[_0x47a5('0x4f')](path[_0x47a5('0x50')](config['root'],_0x47a5('0x51')),_0x47a5('0x52'));var _0x183b3c=ejs['render'](_0x1ad6a9,{'networks':_0x572233||[]});fs['writeFileSync'](util[_0x47a5('0x53')](_0x47a5('0x54'),_0x46e90b['body']['type'][_0x47a5('0x55')]()),_0x183b3c);})['then'](function(){return respondWithRpcPromise(_0x47a5('0x56'),'create',{'module':'chan_sip.so'});})[_0x47a5('0x1a')](function(){return _0x3adf14;});})[_0x47a5('0x1a')](respondWithResult(_0xf03bd5,0xc9))['catch'](handleError(_0xf03bd5,null));};exports[_0x47a5('0x57')]=function(_0x72fe,_0x4b706a,_0x5b6127){var _0x16b4fd;return db[_0x47a5('0x4b')][_0x47a5('0x4c')](function(_0x2931e4){return db['Network'][_0x47a5('0x58')]({'where':{'id':_0x72fe[_0x47a5('0x59')]['id']}})[_0x47a5('0x1a')](handleEntityNotFound(_0x4b706a,null))['then'](saveUpdates(_0x72fe[_0x47a5('0x4d')],null))['then'](function(_0x485e3c){if(_0x485e3c){_0x16b4fd=_0x485e3c;return db[_0x47a5('0x32')][_0x47a5('0x44')]({'where':{'type':_0x16b4fd[_0x47a5('0x4e')]},'raw':!![]});}return null;})[_0x47a5('0x1a')](function(_0x4966af){if(_0x4966af){var _0x144af9=fs['readFileSync'](path['join'](config['root'],'server/files/templates/network.ejs'),_0x47a5('0x52'));var _0x6cd4ea=ejs[_0x47a5('0x5a')](_0x144af9,{'networks':_0x4966af||[]});fs['writeFileSync'](util['format'](_0x47a5('0x54'),_0x16b4fd[_0x47a5('0x4e')][_0x47a5('0x55')]()),_0x6cd4ea);return respondWithRpcPromise(_0x47a5('0x56'),_0x47a5('0x57'),{'module':'chan_sip.so'});}return null;})[_0x47a5('0x1a')](function(_0x519e9e){if(_0x519e9e){return _0x16b4fd;}return null;});})[_0x47a5('0x1a')](respondWithResult(_0x4b706a,null))[_0x47a5('0x23')](handleError(_0x4b706a,null));};exports['destroy']=function(_0x32b4de,_0x345104,_0x132854){var _0x3e8274;return db[_0x47a5('0x32')][_0x47a5('0x58')]({'where':{'id':_0x32b4de[_0x47a5('0x59')]['id']}})[_0x47a5('0x1a')](function(_0x57ed0a){_0x3e8274=_0x57ed0a;return _0x57ed0a;})[_0x47a5('0x1a')](handleEntityNotFound(_0x345104,null))[_0x47a5('0x1a')](removeEntity(_0x345104,null))[_0x47a5('0x1a')](function(){if(_0x3e8274){return db[_0x47a5('0x32')][_0x47a5('0x44')]({'where':{'type':_0x3e8274['type']},'raw':!![]});}})[_0x47a5('0x1a')](function(_0xdfcecc){if(_0xdfcecc){var _0x1224bc=fs[_0x47a5('0x4f')](path[_0x47a5('0x50')](config[_0x47a5('0x5b')],_0x47a5('0x51')),_0x47a5('0x52'));var _0x350af8=ejs[_0x47a5('0x5a')](_0x1224bc,{'networks':_0xdfcecc||[]});fs[_0x47a5('0x5c')](util[_0x47a5('0x53')](_0x47a5('0x54'),_0x3e8274[_0x47a5('0x4e')][_0x47a5('0x55')]()),_0x350af8);return respondWithRpcPromise('Reload',_0x47a5('0x2e'),{'module':_0x47a5('0x5d')});}})[_0x47a5('0x23')](handleError(_0x345104,null));}; \ No newline at end of file +var _0x0b0e=['find','catch','create','transaction','body','join','root','server/files/templates/network.ejs','utf8','render','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','sequelize','params','readFileSync','writeFileSync','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','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','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','Network,\x20%s,\x20%s','request\x20sent','code','error','message','result','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','Network','keys','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','merge','map','type','key','VIRTUAL','filter','count','then','includeAll','include','findAll','rows'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4474c2,_0x59cf02){_0x4474c2=_0x4474c2-0x0;var _0x435fbb=_0x0b0e[_0x4474c2];return _0x435fbb;};'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 hardwareService=require(_0xe0b0('0x12'));var logger=require(_0xe0b0('0x13'))('api');var utils=require(_0xe0b0('0x14'));var config=require(_0xe0b0('0x15'));var db=require(_0xe0b0('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe0b0('0x17')][_0xe0b0('0x18')]({'port':0x232a});function checkPasswordPattern(_0x3cc19a,_0x45f914,_0x34fed4){if(_0x34fed4){var _0x4d2bf7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4d2bf7[_0xe0b0('0x19')](_0x45f914)){return _0x3cc19a;}else{throw new Error(_0xe0b0('0x1a'));}}else{return _0x3cc19a;}}function respondWithRpcPromise(_0x743318,_0x24babd,_0x177c24,_0x55d884){return new BPromise(function(_0x41a7e2,_0x5adb01){var _0x35cb40=_0x55d884||client;return _0x35cb40[_0xe0b0('0x1b')](_0x743318,_0x177c24)['then'](function(_0x11fdca){logger['info'](_0xe0b0('0x1c'),_0x24babd,_0xe0b0('0x1d'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x24babd,_0xe0b0('0x1d'),JSON['stringify'](_0x11fdca));if(_0x11fdca['error']){if(_0x11fdca['error'][_0xe0b0('0x1e')]===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x24babd,_0x11fdca[_0xe0b0('0x1f')]['message']);return _0x5adb01(_0x11fdca[_0xe0b0('0x1f')]['message']);}logger[_0xe0b0('0x1f')](_0xe0b0('0x1c'),_0x24babd,_0x11fdca[_0xe0b0('0x1f')][_0xe0b0('0x20')]);return _0x41a7e2(_0x11fdca[_0xe0b0('0x1f')]['message']);}else{logger['info'](_0xe0b0('0x1c'),_0x24babd,'request\x20sent');_0x41a7e2(_0x11fdca[_0xe0b0('0x21')][_0xe0b0('0x20')]);}})['catch'](function(_0x170ad8){logger['error'](_0xe0b0('0x1c'),_0x24babd,_0x170ad8);_0x5adb01(_0x170ad8);});});}function respondWithStatusCode(_0x49a727,_0x28586d){_0x28586d=_0x28586d||0xcc;return function(_0x576352){if(_0x576352){return _0x49a727[_0xe0b0('0x22')](_0x28586d);}return _0x49a727['status'](_0x28586d)[_0xe0b0('0x23')]();};}function respondWithResult(_0x4aafbe,_0x3c221d){_0x3c221d=_0x3c221d||0xc8;return function(_0x5c5317){if(_0x5c5317){return _0x4aafbe[_0xe0b0('0x24')](_0x3c221d)[_0xe0b0('0x25')](_0x5c5317);}};}function respondWithFilteredResult(_0x1f1ebd,_0x1d91ad){return function(_0x3ec2){if(_0x3ec2){var _0x10745d=_0x3ec2['count'],_0x5200a6=_0x1d91ad[_0xe0b0('0x26')],_0x1444b9=_0x1d91ad[_0xe0b0('0x26')]+_0x1d91ad[_0xe0b0('0x27')],_0x1b8aa8;if(_0x1444b9>=_0x10745d){_0x1444b9=_0x10745d;_0x1b8aa8=0xc8;}else{_0x1b8aa8=0xce;}_0x1f1ebd[_0xe0b0('0x24')](_0x1b8aa8);return _0x1f1ebd[_0xe0b0('0x28')](_0xe0b0('0x29'),_0x5200a6+'-'+_0x1444b9+'/'+_0x10745d)[_0xe0b0('0x25')](_0x3ec2);}return null;};}function patchUpdates(_0x4fb3b7){return function(_0x1854b8){try{jsonpatch[_0xe0b0('0x2a')](_0x1854b8,_0x4fb3b7,!![]);}catch(_0x48a9b5){return BPromise['reject'](_0x48a9b5);}return _0x1854b8[_0xe0b0('0x2b')]();};}function saveUpdates(_0x33e672,_0x422575){return function(_0x3f81d5){if(_0x3f81d5){return _0x3f81d5[_0xe0b0('0x2c')](_0x33e672)['then'](function(_0x32acfe){return _0x32acfe;});}return null;};}function removeEntity(_0x3231fc,_0x7867c4){return function(_0x29d725){if(_0x29d725){return _0x29d725[_0xe0b0('0x2d')]()['then'](function(){_0x3231fc[_0xe0b0('0x24')](0xcc)[_0xe0b0('0x23')]();});}};}function handleEntityNotFound(_0xfc51d3,_0x31c6f5){return function(_0x3575bc){if(!_0x3575bc){_0xfc51d3[_0xe0b0('0x22')](0x194);}return _0x3575bc;};}function handleError(_0xf54999,_0x20908f){_0x20908f=_0x20908f||0x1f4;return function(_0x2125d5){logger[_0xe0b0('0x1f')](_0x2125d5[_0xe0b0('0x2e')]);if(_0x2125d5[_0xe0b0('0x2f')]){delete _0x2125d5[_0xe0b0('0x2f')];}_0xf54999[_0xe0b0('0x24')](_0x20908f)[_0xe0b0('0x30')](_0x2125d5);};}exports['index']=function(_0x121608,_0x135be5){var _0xace58a={},_0x1eb3f9={},_0x1a2d24={'count':0x0,'rows':[]};var _0x2c6e60=db[_0xe0b0('0x31')]['rawAttributes'];_0x1eb3f9['model']=_['keys'](_0x2c6e60);_0x1eb3f9['query']=_[_0xe0b0('0x32')](_0x121608[_0xe0b0('0x33')]);_0x1eb3f9[_0xe0b0('0x34')]=_['intersection'](_0x1eb3f9[_0xe0b0('0x35')],_0x1eb3f9[_0xe0b0('0x33')]);_0xace58a[_0xe0b0('0x36')]=_[_0xe0b0('0x37')](_0x1eb3f9['model'],qs[_0xe0b0('0x38')](_0x121608[_0xe0b0('0x33')][_0xe0b0('0x38')]));_0xace58a[_0xe0b0('0x36')]=_0xace58a[_0xe0b0('0x36')][_0xe0b0('0x39')]?_0xace58a[_0xe0b0('0x36')]:_0x1eb3f9[_0xe0b0('0x35')];if(!_0x121608[_0xe0b0('0x33')]['hasOwnProperty'](_0xe0b0('0x3a'))){_0xace58a['limit']=qs[_0xe0b0('0x27')](_0x121608[_0xe0b0('0x33')][_0xe0b0('0x27')]);_0xace58a[_0xe0b0('0x26')]=qs['offset'](_0x121608[_0xe0b0('0x33')][_0xe0b0('0x26')]);}_0xace58a[_0xe0b0('0x3b')]=qs[_0xe0b0('0x3c')](_0x121608[_0xe0b0('0x33')][_0xe0b0('0x3c')]);_0xace58a[_0xe0b0('0x3d')]=qs[_0xe0b0('0x34')](_['pick'](_0x121608[_0xe0b0('0x33')],_0x1eb3f9[_0xe0b0('0x34')]));if(_0x121608['query']['filter']){_0xace58a[_0xe0b0('0x3d')]=_[_0xe0b0('0x3e')](_0xace58a['where'],{'$or':_[_0xe0b0('0x3f')](_0x2c6e60,function(_0x285d61){if(_0x285d61[_0xe0b0('0x40')][_0xe0b0('0x41')]!==_0xe0b0('0x42')){var _0x5c31b5={};_0x5c31b5[_0x285d61['field']]={'$like':'%'+_0x121608['query'][_0xe0b0('0x43')]+'%'};return _0x5c31b5;}})});}_0xace58a=_[_0xe0b0('0x3e')]({},_0xace58a,_0x121608['options']);var _0x9f7459={'where':_0xace58a[_0xe0b0('0x3d')]};return db[_0xe0b0('0x31')][_0xe0b0('0x44')](_0x9f7459)[_0xe0b0('0x45')](function(_0x5c6f94){_0x1a2d24['count']=_0x5c6f94;if(_0x121608[_0xe0b0('0x33')][_0xe0b0('0x46')]){_0xace58a[_0xe0b0('0x47')]=[{'all':!![]}];}return db[_0xe0b0('0x31')][_0xe0b0('0x48')](_0xace58a);})['then'](function(_0x3b1474){_0x1a2d24[_0xe0b0('0x49')]=_0x3b1474;return _0x1a2d24;})['then'](respondWithFilteredResult(_0x135be5,_0xace58a))['catch'](handleError(_0x135be5,null));};exports['show']=function(_0x1b7777,_0x2184d3){var _0x2419ce={'raw':!![],'where':{'id':_0x1b7777['params']['id']}},_0x364877={};_0x364877[_0xe0b0('0x35')]=_[_0xe0b0('0x32')](db['Network']['rawAttributes']);_0x364877[_0xe0b0('0x33')]=_[_0xe0b0('0x32')](_0x1b7777['query']);_0x364877[_0xe0b0('0x34')]=_[_0xe0b0('0x37')](_0x364877['model'],_0x364877['query']);_0x2419ce[_0xe0b0('0x36')]=_['intersection'](_0x364877[_0xe0b0('0x35')],qs[_0xe0b0('0x38')](_0x1b7777[_0xe0b0('0x33')][_0xe0b0('0x38')]));_0x2419ce[_0xe0b0('0x36')]=_0x2419ce[_0xe0b0('0x36')]['length']?_0x2419ce['attributes']:_0x364877[_0xe0b0('0x35')];if(_0x1b7777['query']['includeAll']){_0x2419ce[_0xe0b0('0x47')]=[{'all':!![]}];}_0x2419ce=_[_0xe0b0('0x3e')]({},_0x2419ce,_0x1b7777['options']);return db['Network'][_0xe0b0('0x4a')](_0x2419ce)[_0xe0b0('0x45')](handleEntityNotFound(_0x2184d3,null))[_0xe0b0('0x45')](respondWithResult(_0x2184d3,null))[_0xe0b0('0x4b')](handleError(_0x2184d3,null));};exports[_0xe0b0('0x4c')]=function(_0x24115f,_0x84fabb,_0x4ebb0f){var _0x22c7bc;return db['sequelize'][_0xe0b0('0x4d')](function(_0x54106c){return db['Network'][_0xe0b0('0x4c')](_0x24115f[_0xe0b0('0x4e')],{'raw':!![]})[_0xe0b0('0x45')](function(_0x2f1712){_0x22c7bc=_0x2f1712;return db[_0xe0b0('0x31')][_0xe0b0('0x48')]({'where':{'type':_0x24115f[_0xe0b0('0x4e')][_0xe0b0('0x40')]},'raw':!![]});})[_0xe0b0('0x45')](function(_0x4e0d87){var _0x253ab0=fs['readFileSync'](path[_0xe0b0('0x4f')](config[_0xe0b0('0x50')],_0xe0b0('0x51')),_0xe0b0('0x52'));var _0x2c7fb0=ejs[_0xe0b0('0x53')](_0x253ab0,{'networks':_0x4e0d87||[]});fs['writeFileSync'](util[_0xe0b0('0x54')](_0xe0b0('0x55'),_0x24115f[_0xe0b0('0x4e')][_0xe0b0('0x40')][_0xe0b0('0x56')]()),_0x2c7fb0);})[_0xe0b0('0x45')](function(){return respondWithRpcPromise(_0xe0b0('0x57'),_0xe0b0('0x4c'),{'module':_0xe0b0('0x58')});})[_0xe0b0('0x45')](function(){return _0x22c7bc;});})[_0xe0b0('0x45')](respondWithResult(_0x84fabb,0xc9))[_0xe0b0('0x4b')](handleError(_0x84fabb,null));};exports[_0xe0b0('0x2c')]=function(_0x10eb99,_0xcdf97,_0x34c642){var _0x4c7661;return db[_0xe0b0('0x59')]['transaction'](function(_0x46627e){return db[_0xe0b0('0x31')][_0xe0b0('0x4a')]({'where':{'id':_0x10eb99[_0xe0b0('0x5a')]['id']}})[_0xe0b0('0x45')](handleEntityNotFound(_0xcdf97,null))[_0xe0b0('0x45')](saveUpdates(_0x10eb99[_0xe0b0('0x4e')],null))['then'](function(_0x47dcc4){if(_0x47dcc4){_0x4c7661=_0x47dcc4;return db[_0xe0b0('0x31')][_0xe0b0('0x48')]({'where':{'type':_0x4c7661[_0xe0b0('0x40')]},'raw':!![]});}return null;})['then'](function(_0x117d20){if(_0x117d20){var _0x13fb4b=fs[_0xe0b0('0x5b')](path[_0xe0b0('0x4f')](config[_0xe0b0('0x50')],'server/files/templates/network.ejs'),_0xe0b0('0x52'));var _0x242120=ejs[_0xe0b0('0x53')](_0x13fb4b,{'networks':_0x117d20||[]});fs['writeFileSync'](util[_0xe0b0('0x54')](_0xe0b0('0x55'),_0x4c7661['type'][_0xe0b0('0x56')]()),_0x242120);return respondWithRpcPromise('Reload','update',{'module':_0xe0b0('0x58')});}return null;})['then'](function(_0x4d75e4){if(_0x4d75e4){return _0x4c7661;}return null;});})[_0xe0b0('0x45')](respondWithResult(_0xcdf97,null))[_0xe0b0('0x4b')](handleError(_0xcdf97,null));};exports[_0xe0b0('0x2d')]=function(_0x1a4fad,_0x5a7913,_0x3679e0){var _0x2287a5;return db[_0xe0b0('0x31')][_0xe0b0('0x4a')]({'where':{'id':_0x1a4fad[_0xe0b0('0x5a')]['id']}})[_0xe0b0('0x45')](function(_0xc5e88c){_0x2287a5=_0xc5e88c;return _0xc5e88c;})[_0xe0b0('0x45')](handleEntityNotFound(_0x5a7913,null))['then'](removeEntity(_0x5a7913,null))['then'](function(){if(_0x2287a5){return db[_0xe0b0('0x31')][_0xe0b0('0x48')]({'where':{'type':_0x2287a5[_0xe0b0('0x40')]},'raw':!![]});}})['then'](function(_0x49b754){if(_0x49b754){var _0x2eb16f=fs[_0xe0b0('0x5b')](path['join'](config['root'],_0xe0b0('0x51')),_0xe0b0('0x52'));var _0x38eb8e=ejs[_0xe0b0('0x53')](_0x2eb16f,{'networks':_0x49b754||[]});fs[_0xe0b0('0x5c')](util[_0xe0b0('0x54')](_0xe0b0('0x55'),_0x2287a5[_0xe0b0('0x40')]['toLowerCase']()),_0x38eb8e);return respondWithRpcPromise(_0xe0b0('0x57'),_0xe0b0('0x2d'),{'module':_0xe0b0('0x58')});}})['catch'](handleError(_0x5a7913,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 2f852bc..bc3a453 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 _0x3c36=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','Network','network','util','../../config/logger'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0x3c36,0x1c6));var _0x63c3=function(_0x261145,_0x3b8563){_0x261145=_0x261145-0x0;var _0x3a50bb=_0x3c36[_0x261145];return _0x3a50bb;};'use strict';var _=require('lodash');var util=require(_0x63c3('0x0'));var logger=require(_0x63c3('0x1'))(_0x63c3('0x2'));var moment=require(_0x63c3('0x3'));var BPromise=require('bluebird');var rp=require(_0x63c3('0x4'));var fs=require('fs');var path=require(_0x63c3('0x5'));var rimraf=require(_0x63c3('0x6'));var config=require(_0x63c3('0x7'));var attributes=require('./network.attributes');module[_0x63c3('0x8')]=function(_0x5c5f63,_0x1c328a){return _0x5c5f63[_0x63c3('0x9')](_0x63c3('0xa'),attributes,{'tableName':_0x63c3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc96d=['network','util','../../config/logger','api','moment','request-promise','rimraf','./network.attributes','exports','define','Network'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc96d,0x90));var _0xdc96=function(_0x2e388e,_0x2d4e3){_0x2e388e=_0x2e388e-0x0;var _0x1ae63c=_0xc96d[_0x2e388e];return _0x1ae63c;};'use strict';var _=require('lodash');var util=require(_0xdc96('0x0'));var logger=require(_0xdc96('0x1'))(_0xdc96('0x2'));var moment=require(_0xdc96('0x3'));var BPromise=require('bluebird');var rp=require(_0xdc96('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc96('0x5'));var config=require('../../config/environment');var attributes=require(_0xdc96('0x6'));module[_0xdc96('0x7')]=function(_0x2cb6ca,_0x42cfd5){return _0x2cb6ca[_0xdc96('0x8')](_0xdc96('0x9'),attributes,{'tableName':_0xdc96('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index aae1a07..e705aef 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 _0x6b8f=['debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','Network,\x20%s,\x20%s','request\x20sent'];(function(_0x2deb9d,_0x3bfe22){var _0x232dc0=function(_0x1ebcfe){while(--_0x1ebcfe){_0x2deb9d['push'](_0x2deb9d['shift']());}};_0x232dc0(++_0x3bfe22);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x2d6496,_0x947a73){_0x2d6496=_0x2d6496-0x0;var _0x1ae7a7=_0x6b8f[_0x2d6496];return _0x1ae7a7;};'use strict';var _=require('lodash');var util=require(_0xf6b8('0x0'));var moment=require('moment');var BPromise=require(_0xf6b8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6b8('0x2'))['db'];var utils=require(_0xf6b8('0x3'));var logger=require('../../config/logger')(_0xf6b8('0x4'));var config=require(_0xf6b8('0x5'));var jayson=require(_0xf6b8('0x6'));var client=jayson['client'][_0xf6b8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x79c66d,_0x446336,_0x3c3430){return new BPromise(function(_0x557910,_0x5f07f4){return client[_0xf6b8('0x8')](_0x79c66d,_0x3c3430)['then'](function(_0x24458c){logger[_0xf6b8('0x9')](_0xf6b8('0xa'),_0x446336,_0xf6b8('0xb'));logger[_0xf6b8('0xc')](_0xf6b8('0xd'),_0x446336,'request\x20sent',JSON['stringify'](_0x24458c));if(_0x24458c['error']){if(_0x24458c[_0xf6b8('0xe')][_0xf6b8('0xf')]===0x1f4){logger[_0xf6b8('0xe')](_0xf6b8('0xa'),_0x446336,_0x24458c['error']['message']);return _0x5f07f4(_0x24458c[_0xf6b8('0xe')][_0xf6b8('0x10')]);}logger['error'](_0xf6b8('0xa'),_0x446336,_0x24458c[_0xf6b8('0xe')][_0xf6b8('0x10')]);return _0x557910(_0x24458c['error'][_0xf6b8('0x10')]);}else{logger['info'](_0xf6b8('0xa'),_0x446336,_0xf6b8('0xb'));_0x557910(_0x24458c[_0xf6b8('0x11')][_0xf6b8('0x10')]);}})[_0xf6b8('0x12')](function(_0x567b58){logger['error'](_0xf6b8('0xa'),_0x446336,_0x567b58);_0x5f07f4(_0x567b58);});});} \ No newline at end of file +var _0xbff5=['message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbff5,0x1bc));var _0x5bff=function(_0x49bb60,_0x178394){_0x49bb60=_0x49bb60-0x0;var _0x224c9d=_0xbff5[_0x49bb60];return _0x224c9d;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var moment=require(_0x5bff('0x2'));var BPromise=require(_0x5bff('0x3'));var rs=require(_0x5bff('0x4'));var fs=require('fs');var Redis=require(_0x5bff('0x5'));var db=require(_0x5bff('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5bff('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5bff('0x8'));var client=jayson[_0x5bff('0x9')][_0x5bff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa54c57,_0x43605a,_0xd4b9dc){return new BPromise(function(_0x1acb49,_0x139c99){return client[_0x5bff('0xb')](_0xa54c57,_0xd4b9dc)['then'](function(_0x20e26f){logger['info'](_0x5bff('0xc'),_0x43605a,_0x5bff('0xd'));logger['debug'](_0x5bff('0xe'),_0x43605a,'request\x20sent',JSON[_0x5bff('0xf')](_0x20e26f));if(_0x20e26f['error']){if(_0x20e26f[_0x5bff('0x10')][_0x5bff('0x11')]===0x1f4){logger['error'](_0x5bff('0xc'),_0x43605a,_0x20e26f['error'][_0x5bff('0x12')]);return _0x139c99(_0x20e26f[_0x5bff('0x10')]['message']);}logger[_0x5bff('0x10')](_0x5bff('0xc'),_0x43605a,_0x20e26f['error']['message']);return _0x1acb49(_0x20e26f[_0x5bff('0x10')][_0x5bff('0x12')]);}else{logger[_0x5bff('0x13')]('Network,\x20%s,\x20%s',_0x43605a,_0x5bff('0xd'));_0x1acb49(_0x20e26f[_0x5bff('0x14')][_0x5bff('0x12')]);}})['catch'](function(_0x3ffbbc){logger[_0x5bff('0x10')](_0x5bff('0xc'),_0x43605a,_0x3ffbbc);_0x139c99(_0x3ffbbc);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 2c30099..981ee74 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 _0x4ccc=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','index','get','/describe','/:id','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','connect-timeout'];(function(_0x38b23c,_0x1bcbe7){var _0x2f923f=function(_0x395581){while(--_0x395581){_0x38b23c['push'](_0x38b23c['shift']());}};_0x2f923f(++_0x1bcbe7);}(_0x4ccc,0x1de));var _0xc4cc=function(_0x1fd41d,_0x14e840){_0x1fd41d=_0x1fd41d-0x0;var _0x4bae82=_0x4ccc[_0x1fd41d];return _0x4bae82;};'use strict';var multer=require(_0xc4cc('0x0'));var util=require(_0xc4cc('0x1'));var path=require('path');var timeout=require(_0xc4cc('0x2'));var express=require('express');var router=express[_0xc4cc('0x3')]();var auth=require(_0xc4cc('0x4'));var interaction=require(_0xc4cc('0x5'));var config=require(_0xc4cc('0x6'));var controller=require(_0xc4cc('0x7'));router['get']('/',auth[_0xc4cc('0x8')](),controller[_0xc4cc('0x9')]);router[_0xc4cc('0xa')](_0xc4cc('0xb'),auth[_0xc4cc('0x8')](),controller['describe']);router[_0xc4cc('0xa')](_0xc4cc('0xc'),auth[_0xc4cc('0x8')](),controller['show']);router[_0xc4cc('0xa')]('/:id/dispositions',auth[_0xc4cc('0x8')](),controller['getDispositions']);router[_0xc4cc('0xa')](_0xc4cc('0xd'),auth[_0xc4cc('0x8')](),controller['getAnswers']);router[_0xc4cc('0xa')](_0xc4cc('0xe'),auth['isAuthenticated'](),controller[_0xc4cc('0xf')]);router['get'](_0xc4cc('0x10'),auth['isAuthenticated'](),controller[_0xc4cc('0x11')]);router['get'](_0xc4cc('0x12'),auth[_0xc4cc('0x8')](),controller[_0xc4cc('0x13')]);router['post']('/',auth[_0xc4cc('0x8')](),controller['create']);router[_0xc4cc('0x14')](_0xc4cc('0x15'),auth[_0xc4cc('0x8')](),controller[_0xc4cc('0x16')]);router[_0xc4cc('0x14')](_0xc4cc('0xd'),auth[_0xc4cc('0x8')](),controller[_0xc4cc('0x17')]);router[_0xc4cc('0x14')](_0xc4cc('0x18'),controller[_0xc4cc('0x19')]);router[_0xc4cc('0x14')](_0xc4cc('0xe'),auth[_0xc4cc('0x8')](),controller[_0xc4cc('0x1a')]);router[_0xc4cc('0x14')](_0xc4cc('0x12'),auth['isAuthenticated'](),controller[_0xc4cc('0x1b')]);router[_0xc4cc('0x14')](_0xc4cc('0x1c'),auth[_0xc4cc('0x8')](),controller[_0xc4cc('0x1d')]);router[_0xc4cc('0x1e')](_0xc4cc('0xc'),auth[_0xc4cc('0x8')](),controller[_0xc4cc('0x1f')]);router[_0xc4cc('0x20')](_0xc4cc('0xc'),auth[_0xc4cc('0x8')](),controller[_0xc4cc('0x21')]);router[_0xc4cc('0x20')](_0xc4cc('0x15'),auth[_0xc4cc('0x8')](),controller[_0xc4cc('0x22')]);router[_0xc4cc('0x20')]('/:id/canned_answers',auth[_0xc4cc('0x8')](),controller[_0xc4cc('0x23')]);router[_0xc4cc('0x20')](_0xc4cc('0x12'),auth[_0xc4cc('0x8')](),controller[_0xc4cc('0x24')]);module['exports']=router; \ No newline at end of file +var _0x110d=['getInteractions','/:id/users','getAgents','post','addAnswer','/:id/notify','notify','/:id/applications','addApplications','addAgents','/:id/send','send','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x110d,0x184));var _0xd110=function(_0x2937ea,_0x43a2a9){_0x2937ea=_0x2937ea-0x0;var _0x40b81b=_0x110d[_0x2937ea];return _0x40b81b;};'use strict';var multer=require(_0xd110('0x0'));var util=require('util');var path=require(_0xd110('0x1'));var timeout=require(_0xd110('0x2'));var express=require('express');var router=express[_0xd110('0x3')]();var auth=require(_0xd110('0x4'));var interaction=require(_0xd110('0x5'));var config=require('../../config/environment');var controller=require(_0xd110('0x6'));router[_0xd110('0x7')]('/',auth[_0xd110('0x8')](),controller[_0xd110('0x9')]);router[_0xd110('0x7')](_0xd110('0xa'),auth[_0xd110('0x8')](),controller[_0xd110('0xb')]);router[_0xd110('0x7')](_0xd110('0xc'),auth[_0xd110('0x8')](),controller[_0xd110('0xd')]);router[_0xd110('0x7')](_0xd110('0xe'),auth[_0xd110('0x8')](),controller[_0xd110('0xf')]);router['get'](_0xd110('0x10'),auth[_0xd110('0x8')](),controller[_0xd110('0x11')]);router[_0xd110('0x7')]('/:id/applications',auth[_0xd110('0x8')](),controller['getApplications']);router[_0xd110('0x7')](_0xd110('0x12'),auth['isAuthenticated'](),controller[_0xd110('0x13')]);router['get'](_0xd110('0x14'),auth[_0xd110('0x8')](),controller[_0xd110('0x15')]);router[_0xd110('0x16')]('/',auth[_0xd110('0x8')](),controller['create']);router['post'](_0xd110('0xe'),auth[_0xd110('0x8')](),controller['addDisposition']);router[_0xd110('0x16')](_0xd110('0x10'),auth['isAuthenticated'](),controller[_0xd110('0x17')]);router[_0xd110('0x16')](_0xd110('0x18'),controller[_0xd110('0x19')]);router[_0xd110('0x16')](_0xd110('0x1a'),auth[_0xd110('0x8')](),controller[_0xd110('0x1b')]);router[_0xd110('0x16')](_0xd110('0x14'),auth[_0xd110('0x8')](),controller[_0xd110('0x1c')]);router[_0xd110('0x16')](_0xd110('0x1d'),auth[_0xd110('0x8')](),controller[_0xd110('0x1e')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd110('0x1f')]);router[_0xd110('0x20')](_0xd110('0xc'),auth[_0xd110('0x8')](),controller[_0xd110('0x21')]);router[_0xd110('0x20')]('/:id/dispositions',auth[_0xd110('0x8')](),controller[_0xd110('0x22')]);router[_0xd110('0x20')](_0xd110('0x10'),auth[_0xd110('0x8')](),controller[_0xd110('0x23')]);router['delete'](_0xd110('0x14'),auth['isAuthenticated'](),controller[_0xd110('0x24')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 507910d..6b91076 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 _0x3a0c=['STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','sequelize','randomstring','exports'];(function(_0x201cac,_0x34b104){var _0x1a322e=function(_0xce9af9){while(--_0xce9af9){_0x201cac['push'](_0x201cac['shift']());}};_0x1a322e(++_0x34b104);}(_0x3a0c,0x8c));var _0xc3a0=function(_0x4d4f35,_0x19a3d8){_0x4d4f35=_0x4d4f35-0x0;var _0x5e5073=_0x3a0c[_0x4d4f35];return _0x5e5073;};'use strict';var Sequelize=require(_0xc3a0('0x0'));var rs=require(_0xc3a0('0x1'));module[_0xc3a0('0x2')]={'name':{'type':Sequelize[_0xc3a0('0x3')],'unique':_0xc3a0('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xc3a0('0x3')]},'token':{'type':Sequelize[_0xc3a0('0x3')],'defaultValue':function(){return rs[_0xc3a0('0x5')]();}},'replyUri':{'type':Sequelize[_0xc3a0('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xc3a0('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc3a0('0x6')],'defaultValue':function(){return _0xc3a0('0x7');}},'notificationSound':{'type':Sequelize[_0xc3a0('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc3a0('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc3a0('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xc3a0('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc3a0('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc3a0('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc3a0('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc3a0('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0xc3a0('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xc3a0('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2c4dd6){if(!_0x2c4dd6)this[_0xc3a0('0xb')]('mandatoryDispositionPauseId',null);this[_0xc3a0('0xb')](_0xc3a0('0xc'),_0x2c4dd6);}}}; \ No newline at end of file +var _0x0958=['mandatoryDisposition','sequelize','randomstring','exports','STRING','name','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue'];(function(_0x15b687,_0x1ecc83){var _0x1b1098=function(_0x1643ca){while(--_0x1643ca){_0x15b687['push'](_0x15b687['shift']());}};_0x1b1098(++_0x1ecc83);}(_0x0958,0x1c9));var _0x8095=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0958[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x8095('0x0'));var rs=require(_0x8095('0x1'));module[_0x8095('0x2')]={'name':{'type':Sequelize[_0x8095('0x3')],'unique':_0x8095('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x8095('0x3')]},'token':{'type':Sequelize[_0x8095('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x8095('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x8095('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8095('0x5')],'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[_0x8095('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8095('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x8095('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8095('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8095('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x8095('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x8095('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xb37bde){if(!_0xb37bde)this['setDataValue'](_0x8095('0x9'),null);this[_0x8095('0xa')](_0x8095('0xb'),_0xb37bde);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index a5e2ae0..f7584f9 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 _0x0f14=['ListId','out','Messages','dataValues','push','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','./openchannelAccount.socket','register','jayson/promise','http','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~!@#$%^&-_=+[{]}.','info','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelAccount,\x20%s,\x20%s','result','catch','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','name','send','index','Pause','rawAttributes','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','type','key','VIRTUAL','merge','options','OpenchannelAccount','include','rows','mandatoryDispositionPause','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','body','params','describe','addDisposition','OpnechannelAccountId','getDispositions','findOne','Disposition','order','map','findAll','removeDispositions','ids','addAnswer','CannedAnswer','length','OpenchannelAccountId','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','orderBy','priority','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','forcedOwnership','startRouting','Start','EventManager','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','Contact','User','Owner','Tag','Tags','color','tag','omit','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList'];(function(_0x5e8c8c,_0x2edd7e){var _0x2bed65=function(_0x35681a){while(--_0x35681a){_0x5e8c8c['push'](_0x5e8c8c['shift']());}};_0x2bed65(++_0x2edd7e);}(_0x0f14,0x179));var _0x40f1=function(_0x1329de,_0x1e7a3f){_0x1329de=_0x1329de-0x0;var _0xa3578b=_0x0f14[_0x1329de];return _0xa3578b;};'use strict';var pdf=require(_0x40f1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x40f1('0x1'));var zipdir=require(_0x40f1('0x2'));var jsonpatch=require(_0x40f1('0x3'));var rp=require('request-promise');var moment=require(_0x40f1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x40f1('0x5'));var util=require(_0x40f1('0x6'));var path=require(_0x40f1('0x7'));var sox=require(_0x40f1('0x8'));var csv=require(_0x40f1('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x40f1('0xa'));var squel=require(_0x40f1('0xb'));var crypto=require(_0x40f1('0xc'));var jsforce=require(_0x40f1('0xd'));var deskjs=require(_0x40f1('0xe'));var toCsv=require('to-csv');var querystring=require(_0x40f1('0xf'));var Papa=require(_0x40f1('0x10'));var Redis=require(_0x40f1('0x11'));var authService=require(_0x40f1('0x12'));var qs=require(_0x40f1('0x13'));var hardwareService=require(_0x40f1('0x14'));var logger=require('../../config/logger')(_0x40f1('0x15'));var utils=require(_0x40f1('0x16'));var config=require('../../config/environment');var db=require(_0x40f1('0x17'))['db'];config[_0x40f1('0x18')]=_[_0x40f1('0x19')](config[_0x40f1('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x40f1('0x18')]));require(_0x40f1('0x1a'))[_0x40f1('0x1b')](socket);var jayson=require(_0x40f1('0x1c'));var client=jayson['client'][_0x40f1('0x1d')]({'port':0x232c});var client9002=jayson[_0x40f1('0x1e')][_0x40f1('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x54b8ff,_0x442ae8,_0x41befe){if(_0x41befe){var _0x92073e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x92073e['test'](_0x442ae8)){return _0x54b8ff;}else{throw new Error(_0x40f1('0x1f'));}}else{return _0x54b8ff;}}function respondWithRpcPromise(_0x360942,_0x4ee184,_0x404cfe,_0x580a0f){return new BPromise(function(_0x160be3,_0x39be5f){var _0x1e729d=_0x580a0f||client;return _0x1e729d['request'](_0x360942,_0x404cfe)['then'](function(_0x27460e){logger[_0x40f1('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0x4ee184,_0x40f1('0x21'));logger['debug'](_0x40f1('0x22'),_0x4ee184,_0x40f1('0x21'),JSON[_0x40f1('0x23')](_0x27460e));if(_0x27460e['error']){if(_0x27460e[_0x40f1('0x24')][_0x40f1('0x25')]===0x1f4){logger[_0x40f1('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x4ee184,_0x27460e[_0x40f1('0x24')][_0x40f1('0x26')]);return _0x39be5f(_0x27460e[_0x40f1('0x24')]['message']);}logger[_0x40f1('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x4ee184,_0x27460e[_0x40f1('0x24')][_0x40f1('0x26')]);return _0x160be3(_0x27460e[_0x40f1('0x24')][_0x40f1('0x26')]);}else{logger['info'](_0x40f1('0x27'),_0x4ee184,_0x40f1('0x21'));_0x160be3(_0x27460e[_0x40f1('0x28')]['message']);}})[_0x40f1('0x29')](function(_0x2de58d){logger['error'](_0x40f1('0x27'),_0x4ee184,_0x2de58d);_0x39be5f(_0x2de58d);});});}function respondWithStatusCode(_0x1285fe,_0x103a66){_0x103a66=_0x103a66||0xcc;return function(_0x5a7330){if(_0x5a7330){return _0x1285fe['sendStatus'](_0x103a66);}return _0x1285fe['status'](_0x103a66)['end']();};}function respondWithResult(_0x5c7a13,_0xe82de1){_0xe82de1=_0xe82de1||0xc8;return function(_0x4c84db){if(_0x4c84db){return _0x5c7a13[_0x40f1('0x2a')](_0xe82de1)[_0x40f1('0x2b')](_0x4c84db);}};}function respondWithFilteredResult(_0x92c4e3,_0x3b57a0){return function(_0xede44f){if(_0xede44f){var _0x526681=_0xede44f[_0x40f1('0x2c')],_0x5ae8c9=_0x3b57a0[_0x40f1('0x2d')],_0x29bef5=_0x3b57a0['offset']+_0x3b57a0[_0x40f1('0x2e')],_0x9e0fb2;if(_0x29bef5>=_0x526681){_0x29bef5=_0x526681;_0x9e0fb2=0xc8;}else{_0x9e0fb2=0xce;}_0x92c4e3[_0x40f1('0x2a')](_0x9e0fb2);return _0x92c4e3[_0x40f1('0x2f')](_0x40f1('0x30'),_0x5ae8c9+'-'+_0x29bef5+'/'+_0x526681)[_0x40f1('0x2b')](_0xede44f);}return null;};}function patchUpdates(_0x2f021e){return function(_0x506984){try{jsonpatch[_0x40f1('0x31')](_0x506984,_0x2f021e,!![]);}catch(_0x7448a){return BPromise[_0x40f1('0x32')](_0x7448a);}return _0x506984[_0x40f1('0x33')]();};}function saveUpdates(_0xa34cd9,_0x2eb36b){return function(_0x16ebfb){if(_0x16ebfb){return _0x16ebfb[_0x40f1('0x34')](_0xa34cd9)[_0x40f1('0x35')](function(_0x532f99){return _0x532f99;});}return null;};}function removeEntity(_0xbe9cc2,_0x4c8d42){return function(_0x329c9f){if(_0x329c9f){return _0x329c9f[_0x40f1('0x36')]()[_0x40f1('0x35')](function(){var _0x3cd6be=_0x329c9f[_0x40f1('0x37')]({'plain':!![]});var _0x437ec0=_0x40f1('0x38');return db[_0x40f1('0x39')][_0x40f1('0x36')]({'where':{'type':_0x437ec0,'resourceId':_0x3cd6be['id']}})['then'](function(){return _0x329c9f;});})[_0x40f1('0x35')](function(){_0xbe9cc2[_0x40f1('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe9daf8,_0x4e1802){return function(_0x46741b){if(!_0x46741b){_0xe9daf8[_0x40f1('0x3a')](0x194);}return _0x46741b;};}function handleError(_0x31805d,_0x852bc8){_0x852bc8=_0x852bc8||0x1f4;return function(_0x491789){logger[_0x40f1('0x24')](_0x491789['stack']);if(_0x491789[_0x40f1('0x3b')]){delete _0x491789[_0x40f1('0x3b')];}_0x31805d['status'](_0x852bc8)[_0x40f1('0x3c')](_0x491789);};}exports[_0x40f1('0x3d')]=function(_0x15f42f,_0x35de02){var _0x34bdc0={'include':[{'model':db[_0x40f1('0x3e')],'as':'mandatoryDispositionPause'}]},_0x18c6ef={},_0x292392={'count':0x0,'rows':[]};var _0xab3439=db['OpenchannelAccount'][_0x40f1('0x3f')];_0x18c6ef['model']=_[_0x40f1('0x40')](_0xab3439);_0x18c6ef['query']=_[_0x40f1('0x40')](_0x15f42f[_0x40f1('0x41')]);_0x18c6ef[_0x40f1('0x42')]=_[_0x40f1('0x43')](_0x18c6ef['model'],_0x18c6ef[_0x40f1('0x41')]);_0x34bdc0['attributes']=_[_0x40f1('0x43')](_0x18c6ef[_0x40f1('0x44')],qs[_0x40f1('0x45')](_0x15f42f[_0x40f1('0x41')][_0x40f1('0x45')]));_0x34bdc0['attributes']=_0x34bdc0['attributes']['length']?_0x34bdc0[_0x40f1('0x46')]:_0x18c6ef[_0x40f1('0x44')];if(!_0x15f42f[_0x40f1('0x41')][_0x40f1('0x47')](_0x40f1('0x48'))){_0x34bdc0['limit']=qs['limit'](_0x15f42f[_0x40f1('0x41')][_0x40f1('0x2e')]);_0x34bdc0['offset']=qs[_0x40f1('0x2d')](_0x15f42f[_0x40f1('0x41')]['offset']);}_0x34bdc0['order']=qs['sort'](_0x15f42f[_0x40f1('0x41')][_0x40f1('0x49')]);_0x34bdc0[_0x40f1('0x4a')]=qs[_0x40f1('0x42')](_[_0x40f1('0x4b')](_0x15f42f[_0x40f1('0x41')],_0x18c6ef[_0x40f1('0x42')]));if(_0x15f42f[_0x40f1('0x41')][_0x40f1('0x4c')]){_0x34bdc0[_0x40f1('0x4a')]=_['merge'](_0x34bdc0[_0x40f1('0x4a')],{'$or':_['map'](_0xab3439,function(_0xd5991f){if(_0xd5991f[_0x40f1('0x4d')][_0x40f1('0x4e')]!==_0x40f1('0x4f')){var _0x2d507b={};_0x2d507b[_0xd5991f['field']]={'$like':'%'+_0x15f42f[_0x40f1('0x41')]['filter']+'%'};return _0x2d507b;}})});}_0x34bdc0=_[_0x40f1('0x50')]({},_0x34bdc0,_0x15f42f[_0x40f1('0x51')]);var _0x1a42f1={'where':_0x34bdc0[_0x40f1('0x4a')]};return db[_0x40f1('0x52')][_0x40f1('0x2c')](_0x1a42f1)[_0x40f1('0x35')](function(_0x1613ef){_0x292392[_0x40f1('0x2c')]=_0x1613ef;if(_0x15f42f['query']['includeAll']){_0x34bdc0[_0x40f1('0x53')]=[{'all':!![]}];}return db[_0x40f1('0x52')]['findAll'](_0x34bdc0);})[_0x40f1('0x35')](function(_0x210c88){_0x292392[_0x40f1('0x54')]=_0x210c88;return _0x292392;})[_0x40f1('0x35')](respondWithFilteredResult(_0x35de02,_0x34bdc0))[_0x40f1('0x29')](handleError(_0x35de02,null));};exports['show']=function(_0x5f01e7,_0x53929c){var _0xbc14d4={'raw':![],'where':{'id':_0x5f01e7['params']['id']},'include':[{'model':db[_0x40f1('0x3e')],'as':_0x40f1('0x55')}]},_0x693a86={};_0x693a86['model']=_[_0x40f1('0x40')](db[_0x40f1('0x52')][_0x40f1('0x3f')]);_0x693a86['query']=_[_0x40f1('0x40')](_0x5f01e7[_0x40f1('0x41')]);_0x693a86[_0x40f1('0x42')]=_['intersection'](_0x693a86[_0x40f1('0x44')],_0x693a86[_0x40f1('0x41')]);_0xbc14d4[_0x40f1('0x46')]=_[_0x40f1('0x43')](_0x693a86[_0x40f1('0x44')],qs[_0x40f1('0x45')](_0x5f01e7[_0x40f1('0x41')][_0x40f1('0x45')]));_0xbc14d4['attributes']=_0xbc14d4[_0x40f1('0x46')]['length']?_0xbc14d4[_0x40f1('0x46')]:_0x693a86[_0x40f1('0x44')];if(_0x5f01e7[_0x40f1('0x41')][_0x40f1('0x56')]){_0xbc14d4['include']=[{'all':!![]}];}_0xbc14d4=_['merge']({},_0xbc14d4,_0x5f01e7[_0x40f1('0x51')]);return db[_0x40f1('0x52')][_0x40f1('0x57')](_0xbc14d4)['then'](handleEntityNotFound(_0x53929c,null))[_0x40f1('0x35')](respondWithResult(_0x53929c,null))[_0x40f1('0x29')](handleError(_0x53929c,null));};exports[_0x40f1('0x58')]=function(_0x149c35,_0x4f0385){return db[_0x40f1('0x52')][_0x40f1('0x58')](_0x149c35['body'],{})[_0x40f1('0x35')](function(_0xdea1f1){var _0x19af12=_0x149c35[_0x40f1('0x59')]['get']({'plain':!![]});if(!_0x19af12)throw new Error(_0x40f1('0x5a'));if(_0x19af12[_0x40f1('0x5b')]===_0x40f1('0x59')){var _0x4b470d=_0xdea1f1[_0x40f1('0x37')]({'plain':!![]});var _0x23f471=_0x40f1('0x38');return db['UserProfileSection'][_0x40f1('0x57')]({'where':{'name':_0x23f471,'userProfileId':_0x19af12[_0x40f1('0x5c')]},'raw':!![]})[_0x40f1('0x35')](function(_0x27daf6){if(_0x27daf6&&_0x27daf6[_0x40f1('0x5d')]===0x0){return db[_0x40f1('0x39')][_0x40f1('0x58')]({'name':_0x4b470d[_0x40f1('0x3b')],'resourceId':_0x4b470d['id'],'type':_0x27daf6[_0x40f1('0x3b')],'sectionId':_0x27daf6['id']},{})[_0x40f1('0x35')](function(){return _0xdea1f1;});}else{return _0xdea1f1;}})[_0x40f1('0x29')](function(_0x48c919){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x48c919);throw _0x48c919;});}return _0xdea1f1;})[_0x40f1('0x35')](respondWithResult(_0x4f0385,0xc9))[_0x40f1('0x29')](handleError(_0x4f0385,null));};exports[_0x40f1('0x34')]=function(_0x528bde,_0x13afac){if(_0x528bde[_0x40f1('0x5e')]['id']){delete _0x528bde[_0x40f1('0x5e')]['id'];}return db[_0x40f1('0x52')][_0x40f1('0x57')]({'where':{'id':_0x528bde[_0x40f1('0x5f')]['id']},'include':[{'model':db[_0x40f1('0x3e')],'as':_0x40f1('0x55')}]})[_0x40f1('0x35')](handleEntityNotFound(_0x13afac,null))['then'](saveUpdates(_0x528bde[_0x40f1('0x5e')],null))[_0x40f1('0x35')](respondWithResult(_0x13afac,null))['catch'](handleError(_0x13afac,null));};exports[_0x40f1('0x36')]=function(_0x3bc378,_0x461495){return db['OpenchannelAccount'][_0x40f1('0x57')]({'where':{'id':_0x3bc378[_0x40f1('0x5f')]['id']}})[_0x40f1('0x35')](handleEntityNotFound(_0x461495,null))[_0x40f1('0x35')](removeEntity(_0x461495,null))[_0x40f1('0x29')](handleError(_0x461495,null));};exports[_0x40f1('0x60')]=function(_0x1e11bc,_0x538631){return db['OpenchannelAccount'][_0x40f1('0x60')]()[_0x40f1('0x35')](respondWithResult(_0x538631,null))['catch'](handleError(_0x538631,null));};exports[_0x40f1('0x61')]=function(_0x3f0b18,_0x5269fd,_0x50b801){if(_0x3f0b18['body']['id']){delete _0x3f0b18[_0x40f1('0x5e')]['id'];}return db[_0x40f1('0x52')][_0x40f1('0x57')]({'where':{'id':_0x3f0b18[_0x40f1('0x5f')]['id']}})[_0x40f1('0x35')](handleEntityNotFound(_0x5269fd,null))[_0x40f1('0x35')](function(_0x5f1d7e){if(_0x5f1d7e){_0x3f0b18[_0x40f1('0x5e')][_0x40f1('0x62')]=_0x5f1d7e['id'];return db['Disposition'][_0x40f1('0x58')](_0x3f0b18[_0x40f1('0x5e')]);}})['then'](respondWithResult(_0x5269fd,null))['catch'](handleError(_0x5269fd,null));};exports[_0x40f1('0x63')]=function(_0x2b8288,_0x2cdd08,_0x3724ec){var _0x4ad1fa={'raw':![],'where':{}};var _0x535955={};var _0x2bee23={'count':0x0,'rows':[]};return db[_0x40f1('0x52')][_0x40f1('0x64')]({'where':{'id':_0x2b8288[_0x40f1('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2cdd08,null))[_0x40f1('0x35')](function(_0x1801ff){if(_0x1801ff){_0x535955[_0x40f1('0x44')]=_[_0x40f1('0x40')](db[_0x40f1('0x65')][_0x40f1('0x3f')]);_0x535955[_0x40f1('0x41')]=_[_0x40f1('0x40')](_0x2b8288[_0x40f1('0x41')]);_0x535955[_0x40f1('0x42')]=_[_0x40f1('0x43')](_0x535955[_0x40f1('0x44')],_0x535955[_0x40f1('0x41')]);_0x4ad1fa[_0x40f1('0x46')]=_[_0x40f1('0x43')](_0x535955[_0x40f1('0x44')],qs[_0x40f1('0x45')](_0x2b8288['query'][_0x40f1('0x45')]));_0x4ad1fa[_0x40f1('0x46')]=_0x4ad1fa[_0x40f1('0x46')]['length']?_0x4ad1fa['attributes']:_0x535955[_0x40f1('0x44')];if(!_0x2b8288['query'][_0x40f1('0x47')](_0x40f1('0x48'))){_0x4ad1fa[_0x40f1('0x2e')]=qs[_0x40f1('0x2e')](_0x2b8288[_0x40f1('0x41')][_0x40f1('0x2e')]);_0x4ad1fa[_0x40f1('0x2d')]=qs[_0x40f1('0x2d')](_0x2b8288[_0x40f1('0x41')][_0x40f1('0x2d')]);}_0x4ad1fa[_0x40f1('0x66')]=qs[_0x40f1('0x49')](_0x2b8288[_0x40f1('0x41')][_0x40f1('0x49')]);_0x4ad1fa[_0x40f1('0x4a')]=qs[_0x40f1('0x42')](_[_0x40f1('0x4b')](_0x2b8288[_0x40f1('0x41')],_0x535955[_0x40f1('0x42')]));_0x4ad1fa[_0x40f1('0x4a')]['OpenchannelAccountId']=_0x1801ff['id'];if(_0x2b8288[_0x40f1('0x41')][_0x40f1('0x4c')]){_0x4ad1fa['where']=_['merge'](_0x4ad1fa[_0x40f1('0x4a')],{'$or':_[_0x40f1('0x67')](_0x4ad1fa['attributes'],function(_0x4ae5bb){var _0x468abd={};_0x468abd[_0x4ae5bb]={'$like':'%'+_0x2b8288[_0x40f1('0x41')][_0x40f1('0x4c')]+'%'};return _0x468abd;})});}_0x4ad1fa=_[_0x40f1('0x50')]({},_0x4ad1fa,_0x2b8288[_0x40f1('0x51')]);return db[_0x40f1('0x65')][_0x40f1('0x2c')]({'where':_0x4ad1fa['where']})[_0x40f1('0x35')](function(_0x51196e){_0x2bee23[_0x40f1('0x2c')]=_0x51196e;if(_0x2b8288['query'][_0x40f1('0x56')]){_0x4ad1fa['include']=[{'all':!![]}];}return db[_0x40f1('0x65')][_0x40f1('0x68')](_0x4ad1fa);})[_0x40f1('0x35')](function(_0x1160a1){_0x2bee23['rows']=_0x1160a1;return _0x2bee23;});}})[_0x40f1('0x35')](respondWithFilteredResult(_0x2cdd08,_0x4ad1fa))[_0x40f1('0x29')](handleError(_0x2cdd08,null));};exports[_0x40f1('0x69')]=function(_0x3d9596,_0x3a2a90,_0x47312a){return db['OpenchannelAccount'][_0x40f1('0x57')]({'where':{'id':_0x3d9596[_0x40f1('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3a2a90,null))[_0x40f1('0x35')](function(_0x3fbd0f){if(_0x3fbd0f){return _0x3fbd0f[_0x40f1('0x69')](_0x3d9596[_0x40f1('0x41')][_0x40f1('0x6a')]);}})['then'](respondWithStatusCode(_0x3a2a90,null))[_0x40f1('0x29')](handleError(_0x3a2a90,null));};exports[_0x40f1('0x6b')]=function(_0x480a28,_0xe9f4f9,_0x55ec77){if(_0x480a28['body']['id']){delete _0x480a28[_0x40f1('0x5e')]['id'];}return db['OpenchannelAccount'][_0x40f1('0x57')]({'where':{'id':_0x480a28[_0x40f1('0x5f')]['id']}})[_0x40f1('0x35')](handleEntityNotFound(_0xe9f4f9,null))[_0x40f1('0x35')](function(_0x42ec73){if(_0x42ec73){_0x480a28[_0x40f1('0x5e')]['OpenchannelAccountId']=_0x42ec73['id'];return db['CannedAnswer'][_0x40f1('0x58')](_0x480a28[_0x40f1('0x5e')]);}})[_0x40f1('0x35')](respondWithResult(_0xe9f4f9,null))['catch'](handleError(_0xe9f4f9,null));};exports['getAnswers']=function(_0x2d538c,_0x227bd9,_0x1fc0dd){var _0xbd20a7={'raw':![],'where':{}};var _0x64a575={};var _0x32c946={'count':0x0,'rows':[]};return db[_0x40f1('0x52')][_0x40f1('0x64')]({'where':{'id':_0x2d538c[_0x40f1('0x5f')]['id']}})['then'](handleEntityNotFound(_0x227bd9,null))[_0x40f1('0x35')](function(_0x4c9c0f){if(_0x4c9c0f){_0x64a575['model']=_[_0x40f1('0x40')](db[_0x40f1('0x6c')][_0x40f1('0x3f')]);_0x64a575[_0x40f1('0x41')]=_[_0x40f1('0x40')](_0x2d538c['query']);_0x64a575['filters']=_[_0x40f1('0x43')](_0x64a575[_0x40f1('0x44')],_0x64a575[_0x40f1('0x41')]);_0xbd20a7[_0x40f1('0x46')]=_[_0x40f1('0x43')](_0x64a575[_0x40f1('0x44')],qs['fields'](_0x2d538c[_0x40f1('0x41')][_0x40f1('0x45')]));_0xbd20a7[_0x40f1('0x46')]=_0xbd20a7[_0x40f1('0x46')][_0x40f1('0x6d')]?_0xbd20a7[_0x40f1('0x46')]:_0x64a575['model'];if(!_0x2d538c[_0x40f1('0x41')][_0x40f1('0x47')](_0x40f1('0x48'))){_0xbd20a7[_0x40f1('0x2e')]=qs[_0x40f1('0x2e')](_0x2d538c[_0x40f1('0x41')]['limit']);_0xbd20a7[_0x40f1('0x2d')]=qs[_0x40f1('0x2d')](_0x2d538c[_0x40f1('0x41')]['offset']);}_0xbd20a7[_0x40f1('0x66')]=qs[_0x40f1('0x49')](_0x2d538c[_0x40f1('0x41')][_0x40f1('0x49')]);_0xbd20a7['where']=qs[_0x40f1('0x42')](_['pick'](_0x2d538c[_0x40f1('0x41')],_0x64a575['filters']));_0xbd20a7[_0x40f1('0x4a')][_0x40f1('0x6e')]=_0x4c9c0f['id'];if(_0x2d538c[_0x40f1('0x41')]['filter']){_0xbd20a7[_0x40f1('0x4a')]=_[_0x40f1('0x50')](_0xbd20a7['where'],{'$or':_[_0x40f1('0x67')](_0xbd20a7[_0x40f1('0x46')],function(_0x12dea5){var _0x4d9dfa={};_0x4d9dfa[_0x12dea5]={'$like':'%'+_0x2d538c[_0x40f1('0x41')][_0x40f1('0x4c')]+'%'};return _0x4d9dfa;})});}_0xbd20a7=_['merge']({},_0xbd20a7,_0x2d538c[_0x40f1('0x51')]);return db[_0x40f1('0x6c')]['count']({'where':_0xbd20a7[_0x40f1('0x4a')]})[_0x40f1('0x35')](function(_0x5dded0){_0x32c946[_0x40f1('0x2c')]=_0x5dded0;if(_0x2d538c[_0x40f1('0x41')]['includeAll']){_0xbd20a7['include']=[{'all':!![]}];}return db[_0x40f1('0x6c')][_0x40f1('0x68')](_0xbd20a7);})[_0x40f1('0x35')](function(_0xe423d2){_0x32c946[_0x40f1('0x54')]=_0xe423d2;return _0x32c946;});}})['then'](respondWithFilteredResult(_0x227bd9,_0xbd20a7))[_0x40f1('0x29')](handleError(_0x227bd9,null));};exports[_0x40f1('0x6f')]=function(_0x3d8d42,_0x30e82d,_0x2d32bc){return db[_0x40f1('0x52')][_0x40f1('0x57')]({'where':{'id':_0x3d8d42['params']['id']}})['then'](handleEntityNotFound(_0x30e82d,null))[_0x40f1('0x35')](function(_0x256bab){if(_0x256bab){return _0x256bab[_0x40f1('0x6f')](_0x3d8d42[_0x40f1('0x41')][_0x40f1('0x6a')]);}})[_0x40f1('0x35')](respondWithStatusCode(_0x30e82d,null))[_0x40f1('0x29')](handleError(_0x30e82d,null));};exports[_0x40f1('0x70')]=function(_0x35bb9d,_0x1abf15,_0x1b232a){var _0x5e0046={'body':_0x35bb9d[_0x40f1('0x5e')],'channel':_0x40f1('0x71')};var _0x2579ba=[];var _0x49277c=[];var _0xfb5290={};var _0x444922=![];return db[_0x40f1('0x72')][_0x40f1('0x60')]()[_0x40f1('0x35')](function(_0x10b91d){if(!_0x10b91d){throw new db[(_0x40f1('0x73'))][(_0x40f1('0x74'))](_0x40f1('0x75'));}_0x2579ba=_[_0x40f1('0x76')](_[_0x40f1('0x40')](_0x10b91d),[_0x40f1('0x77'),_0x40f1('0x78')]);_0x49277c=_[_0x40f1('0x76')](_[_0x40f1('0x40')](_0x10b91d),[_0x40f1('0x77'),'updatedAt',_0x40f1('0x79'),'ListId']);if(_0x35bb9d[_0x40f1('0x5e')]['id']){delete _0x35bb9d[_0x40f1('0x5e')]['id'];}if(_[_0x40f1('0x7a')](_0x35bb9d['body']['from'])){throw new db[(_0x40f1('0x73'))][(_0x40f1('0x74'))](_0x40f1('0x7b'));}if(_[_0x40f1('0x7a')](_0x35bb9d[_0x40f1('0x5e')]['body'])||_0x35bb9d[_0x40f1('0x5e')]['body']===''){throw new db[(_0x40f1('0x73'))][(_0x40f1('0x74'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x35bb9d[_0x40f1('0x5e')][_0x40f1('0x7c')])){throw new db[(_0x40f1('0x73'))]['ValidationError'](_0x40f1('0x7d')+_0x49277c);}if(!_[_0x40f1('0x7e')](_0x49277c,_0x35bb9d[_0x40f1('0x5e')][_0x40f1('0x7c')])){throw new db[(_0x40f1('0x73'))][(_0x40f1('0x74'))](_0x40f1('0x7f')+_0x49277c);}_0xfb5290[_0x35bb9d[_0x40f1('0x5e')][_0x40f1('0x7c')]]=_0x35bb9d[_0x40f1('0x5e')][_0x40f1('0x80')];})[_0x40f1('0x35')](function(){return db[_0x40f1('0x52')][_0x40f1('0x57')]({'where':{'id':_0x35bb9d[_0x40f1('0x5f')]['id']},'include':[{'model':db['CmList'],'as':_0x40f1('0x81'),'include':[{'model':db[_0x40f1('0x72')],'as':_0x40f1('0x82'),'where':_0xfb5290,'limit':0x1,'order':[['updatedAt',_0x40f1('0x83')]]}]},{'model':db[_0x40f1('0x84')],'as':_0x40f1('0x85')}]});})[_0x40f1('0x35')](handleEntityNotFound(_0x1abf15,null))['then'](function(_0x523b3b){if(_0x523b3b&&_0x523b3b[_0x40f1('0x81')]){_0x5e0046[_0x40f1('0x86')]=_0x523b3b;_0x5e0046[_0x40f1('0x87')]=_0x523b3b[_0x40f1('0x85')];_0x5e0046['list']=_0x523b3b[_0x40f1('0x81')];_0x5e0046[_0x40f1('0x87')]=_[_0x40f1('0x88')](_0x5e0046['applications'],[_0x40f1('0x89')],['asc']);if(_0x5e0046[_0x40f1('0x86')]['Applications']){delete _0x5e0046[_0x40f1('0x86')][_0x40f1('0x85')];}if(_0x5e0046[_0x40f1('0x86')]['List']&&_0x5e0046[_0x40f1('0x86')][_0x40f1('0x81')][_0x40f1('0x82')][_0x40f1('0x6d')]){return _0x5e0046['account'][_0x40f1('0x81')][_0x40f1('0x82')][0x0];}var _0x263f1f=_[_0x40f1('0x19')](_0x35bb9d[_0x40f1('0x5e')],{'firstName':_0x35bb9d['body'][_0x40f1('0x80')],'ListId':_0x523b3b['ListId']});_0x263f1f[_0x35bb9d['body'][_0x40f1('0x7c')]]=_0x35bb9d['body']['from'];return db[_0x40f1('0x72')][_0x40f1('0x58')](_0x263f1f,{'fields':_0x2579ba,'raw':!![]});}})[_0x40f1('0x35')](handleEntityNotFound(_0x1abf15,null))[_0x40f1('0x35')](function(_0xc2f0a9){_0x5e0046['contact']=_0xc2f0a9;if(_0xc2f0a9){var _0x87f046={'ContactId':_0xc2f0a9['id'],'OpenchannelAccountId':_0x35bb9d['params']['id'],'from':(_0xc2f0a9[_0x40f1('0x8a')]||'')+'\x20'+(_0xc2f0a9[_0x40f1('0x8b')]||'')};var _0x9f2227={'OpenchannelAccountId':_0x35bb9d['params']['id'],'closed':![]};if(_0x35bb9d[_0x40f1('0x5e')][_0x40f1('0x8c')]){_0x9f2227[_0x40f1('0x8c')]=_0x35bb9d[_0x40f1('0x5e')][_0x40f1('0x8c')];return db[_0x40f1('0x8d')]['find']({'where':_0x9f2227})[_0x40f1('0x35')](function(_0x5470f5){if(_0x5470f5){return[_0x5470f5,![]];}_0x87f046['threadId']=_0x35bb9d['body'][_0x40f1('0x8c')];_0x87f046[_0x40f1('0x8e')]=_0x35bb9d[_0x40f1('0x5e')][_0x40f1('0x8e')];return db[_0x40f1('0x8d')][_0x40f1('0x58')](_0x87f046)[_0x40f1('0x35')](function(_0x2257fa){return[_0x2257fa,!![]];});});}else{_0x9f2227[_0x40f1('0x8c')]=null;}_0x9f2227[_0x40f1('0x8f')]=_0xc2f0a9['id'];return db['OpenchannelInteraction'][_0x40f1('0x57')]({'where':_0x9f2227})['then'](function(_0x559355){if(_0x559355){return[_0x559355,![]];}return db['OpenchannelInteraction'][_0x40f1('0x58')](_0x87f046)['then'](function(_0x5bf81d){return[_0x5bf81d,!![]];});});}})[_0x40f1('0x90')](function(_0x2a7594,_0x2c6511){if(_0x2a7594){_0x444922=_0x2c6511;if(!_0x2c6511){var _0x205e21={'from':(_0x5e0046[_0x40f1('0x91')][_0x40f1('0x8a')]||'')+'\x20'+(_0x5e0046[_0x40f1('0x91')]['lastName']||'')};if(_0x35bb9d['body'][_0x40f1('0x8c')]&&_0x35bb9d[_0x40f1('0x5e')]['messageId']&&_0x35bb9d[_0x40f1('0x5e')][_0x40f1('0x8c')]!=_0x35bb9d[_0x40f1('0x5e')]['messageId']){_0x205e21[_0x40f1('0x8c')]=_0x35bb9d[_0x40f1('0x5e')][_0x40f1('0x92')];}return _0x2a7594[_0x40f1('0x34')](_0x205e21);}else{return _0x2a7594;}}})['then'](function(_0x454517){_0x5e0046[_0x40f1('0x93')]=_0x454517[_0x40f1('0x37')]({'plain':!![]});_0x5e0046['interaction'][_0x40f1('0x94')]=_0x444922;if(_0x5e0046[_0x40f1('0x93')]['created']){if(_0x5e0046[_0x40f1('0x86')][_0x40f1('0x95')]){_0x5e0046[_0x40f1('0x87')]['push']({'id':0x0,'priority':_0x5e0046[_0x40f1('0x87')]['length']+0x1,'app':_0x40f1('0x96'),'appdata':_0x40f1('0x97'),'interval':_0x40f1('0x98')});}}return db[_0x40f1('0x99')][_0x40f1('0x58')]({'body':_0x35bb9d[_0x40f1('0x5e')][_0x40f1('0x5e')],'OpenchannelAccountId':_0x35bb9d['params']['id'],'OpenchannelInteractionId':_0x454517['id'],'direction':'in','ContactId':_0x5e0046[_0x40f1('0x91')]['id'],'AttachmentId':_0x35bb9d['body'][_0x40f1('0x9a')]});})[_0x40f1('0x35')](function(_0x1f65fd){_0x5e0046[_0x40f1('0x26')]=_0x1f65fd;if(_0x5e0046[_0x40f1('0x93')][_0x40f1('0x9b')]){return db['User'][_0x40f1('0x57')]({'attributes':['id','name'],'where':{'id':_0x5e0046[_0x40f1('0x93')]['UserId']}})['then'](function(_0x2b087d){if(_0x2b087d){_0x5e0046[_0x40f1('0x87')][_0x40f1('0x9c')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2b087d['name']+','+(_0x5e0046[_0x40f1('0x86')]['waitForTheAssignedAgent']||0xa),'interval':_0x40f1('0x98')});_0x5e0046[_0x40f1('0x9d')]=![];}return respondWithRpcPromise('Start',_0x40f1('0x9e'),_0x5e0046);});}return respondWithRpcPromise(_0x40f1('0x9f'),_0x40f1('0x9e'),_0x5e0046);})[_0x40f1('0x35')](function(_0x14137a){respondWithRpcPromise(_0x40f1('0xa0'),'EventManager',{'event':_0x40f1('0x70'),'message':_0x14137a},client9002);return _0x14137a;})[_0x40f1('0x35')](respondWithResult(_0x1abf15,null))[_0x40f1('0x29')](handleError(_0x1abf15,null));};exports[_0x40f1('0xa1')]=function(_0x3c29ac,_0x198875,_0x4ddf7a){return db[_0x40f1('0x52')]['findOne']({'where':{'id':_0x3c29ac[_0x40f1('0x5f')]['id']}})[_0x40f1('0x35')](handleEntityNotFound(_0x198875,null))[_0x40f1('0x35')](function(_0x734c04){if(_0x734c04){return db[_0x40f1('0xa2')]['transaction'](function(_0x10ec18){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x3c29ac[_0x40f1('0x5f')]['id']},'transaction':_0x10ec18})[_0x40f1('0x35')](function(_0x4947e7){var _0x976090=_[_0x40f1('0x67')](_0x3c29ac[_0x40f1('0x5e')],function(_0x29bebe){_0x29bebe[_0x40f1('0x6e')]=_0x3c29ac[_0x40f1('0x5f')]['id'];return _0x29bebe;});return db[_0x40f1('0x84')][_0x40f1('0xa3')](_0x976090,{'transaction':_0x10ec18});});})[_0x40f1('0x35')](function(){return db['OpenchannelApplication'][_0x40f1('0xa4')]({'where':{'OpenchannelAccountId':_0x3c29ac[_0x40f1('0x5f')]['id']},'order':_0x40f1('0x89')});});}})[_0x40f1('0x35')](respondWithResult(_0x198875,null))[_0x40f1('0x29')](handleError(_0x198875,null));};exports[_0x40f1('0xa5')]=function(_0x3ec163,_0x559b49,_0x1abcc3){var _0x20576a={};var _0x397827={};var _0x36cb19;var _0x43bd85;return db['OpenchannelAccount'][_0x40f1('0x64')]({'where':{'id':_0x3ec163[_0x40f1('0x5f')]['id']}})[_0x40f1('0x35')](handleEntityNotFound(_0x559b49,null))['then'](function(_0x3d6a5b){if(_0x3d6a5b){_0x36cb19=_0x3d6a5b;_0x397827[_0x40f1('0x44')]=_['keys'](db[_0x40f1('0x84')][_0x40f1('0x3f')]);_0x397827[_0x40f1('0x41')]=_['keys'](_0x3ec163['query']);_0x397827[_0x40f1('0x42')]=_['intersection'](_0x397827[_0x40f1('0x44')],_0x397827[_0x40f1('0x41')]);_0x20576a[_0x40f1('0x46')]=_[_0x40f1('0x43')](_0x397827[_0x40f1('0x44')],qs[_0x40f1('0x45')](_0x3ec163[_0x40f1('0x41')]['fields']));_0x20576a['attributes']=_0x20576a[_0x40f1('0x46')]['length']?_0x20576a['attributes']:_0x397827[_0x40f1('0x44')];_0x20576a['order']=qs[_0x40f1('0x49')](_0x3ec163[_0x40f1('0x41')][_0x40f1('0x49')]);_0x20576a[_0x40f1('0x4a')]=qs[_0x40f1('0x42')](_[_0x40f1('0x4b')](_0x3ec163[_0x40f1('0x41')],_0x397827['filters']));if(_0x3ec163[_0x40f1('0x41')][_0x40f1('0x4c')]){_0x20576a[_0x40f1('0x4a')]=_['merge'](_0x20576a[_0x40f1('0x4a')],{'$or':_[_0x40f1('0x67')](_0x20576a[_0x40f1('0x46')],function(_0x3ab304){var _0x26c221={};_0x26c221[_0x3ab304]={'$like':'%'+_0x3ec163['query']['filter']+'%'};return _0x26c221;})});}_0x20576a=_[_0x40f1('0x50')]({},_0x20576a,_0x3ec163[_0x40f1('0x51')]);return _0x36cb19[_0x40f1('0xa5')](_0x20576a);}})[_0x40f1('0x35')](function(_0xd5a00c){if(_0xd5a00c){_0x43bd85=_0xd5a00c[_0x40f1('0x6d')];if(!_0x3ec163['query'][_0x40f1('0x47')](_0x40f1('0x48'))){_0x20576a['limit']=qs[_0x40f1('0x2e')](_0x3ec163['query'][_0x40f1('0x2e')]);_0x20576a[_0x40f1('0x2d')]=qs[_0x40f1('0x2d')](_0x3ec163[_0x40f1('0x41')][_0x40f1('0x2d')]);}return _0x36cb19[_0x40f1('0xa5')](_0x20576a);}})['then'](function(_0x51db29){if(_0x51db29){return _0x51db29?{'count':_0x43bd85,'rows':_0x51db29}:null;}})[_0x40f1('0x35')](respondWithResult(_0x559b49,null))['catch'](handleError(_0x559b49,null));};exports['getInteractions']=function(_0x361d76,_0x1698cc,_0x4ad29f){var _0xb889ca={'raw':![],'where':{}};var _0x3c17bd={};var _0x18903a={'count':0x0,'rows':[]};return db[_0x40f1('0x52')][_0x40f1('0x64')]({'where':{'id':_0x361d76[_0x40f1('0x5f')]['id']}})[_0x40f1('0x35')](handleEntityNotFound(_0x1698cc,null))['then'](function(_0x3fbe1c){if(_0x3fbe1c){_0x3c17bd[_0x40f1('0x44')]=_[_0x40f1('0x40')](db[_0x40f1('0x8d')][_0x40f1('0x3f')]);_0x3c17bd['query']=_[_0x40f1('0x40')](_0x361d76['query']);_0x3c17bd[_0x40f1('0x42')]=_[_0x40f1('0x43')](_0x3c17bd[_0x40f1('0x44')],_0x3c17bd[_0x40f1('0x41')]);_0xb889ca[_0x40f1('0x46')]=_[_0x40f1('0x43')](_0x3c17bd[_0x40f1('0x44')],qs[_0x40f1('0x45')](_0x361d76[_0x40f1('0x41')][_0x40f1('0x45')]));_0xb889ca[_0x40f1('0x46')]=_0xb889ca['attributes'][_0x40f1('0x6d')]?_0xb889ca['attributes']:_0x3c17bd[_0x40f1('0x44')];if(!_0x361d76[_0x40f1('0x41')][_0x40f1('0x47')](_0x40f1('0x48'))){_0xb889ca['limit']=qs[_0x40f1('0x2e')](_0x361d76[_0x40f1('0x41')]['limit']);_0xb889ca['offset']=qs[_0x40f1('0x2d')](_0x361d76[_0x40f1('0x41')][_0x40f1('0x2d')]);}_0xb889ca['order']=qs['sort'](_0x361d76[_0x40f1('0x41')]['sort']);_0xb889ca[_0x40f1('0x4a')]=qs[_0x40f1('0x42')](_[_0x40f1('0x4b')](_0x361d76[_0x40f1('0x41')],_0x3c17bd['filters']));_0xb889ca[_0x40f1('0x4a')]['OpenchannelAccountId']=_0x3fbe1c['id'];if(_0x361d76[_0x40f1('0x41')][_0x40f1('0x4c')]){_0xb889ca[_0x40f1('0x4a')]=_[_0x40f1('0x50')](_0xb889ca[_0x40f1('0x4a')],{'$or':_[_0x40f1('0x67')](_0xb889ca[_0x40f1('0x46')],function(_0x1a4a8b){var _0x55c376={};_0x55c376[_0x1a4a8b]={'$like':'%'+_0x361d76['query'][_0x40f1('0x4c')]+'%'};return _0x55c376;})});}_0xb889ca=_[_0x40f1('0x50')]({},_0xb889ca,_0x361d76['options']);return db[_0x40f1('0x8d')][_0x40f1('0x2c')]({'where':_0xb889ca[_0x40f1('0x4a')]})[_0x40f1('0x35')](function(_0x4cbfb4){_0x18903a[_0x40f1('0x2c')]=_0x4cbfb4;if(_0x361d76[_0x40f1('0x41')][_0x40f1('0x56')]){_0xb889ca[_0x40f1('0x53')]=[{'model':db[_0x40f1('0x72')],'as':_0x40f1('0xa6'),'required':![]},{'model':db[_0x40f1('0xa7')],'as':_0x40f1('0xa8'),'attributes':['name','fullname','internal'],'required':![]},{'model':db[_0x40f1('0xa9')],'as':_0x40f1('0xaa'),'attributes':['id',_0x40f1('0x3b'),_0x40f1('0xab')],'where':_0x361d76[_0x40f1('0x41')][_0x40f1('0xac')]?{'id':_0x361d76[_0x40f1('0x41')][_0x40f1('0xac')]}:undefined,'required':_0x361d76['query'][_0x40f1('0xac')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x40f1('0x68')](_0xb889ca);})[_0x40f1('0x35')](function(_0x34700b){_0x18903a[_0x40f1('0x54')]=_0x34700b;return _0x18903a;});}})['then'](respondWithFilteredResult(_0x1698cc,_0xb889ca))['catch'](handleError(_0x1698cc,null));};exports['addAgents']=function(_0x10ca6a,_0x3a33bb,_0x1ffd70){return db[_0x40f1('0x52')]['find']({'where':{'id':_0x10ca6a[_0x40f1('0x5f')]['id']}})[_0x40f1('0x35')](handleEntityNotFound(_0x3a33bb,null))[_0x40f1('0x35')](function(_0x3ea9a0){if(_0x3ea9a0){return _0x3ea9a0['addAgents'](_0x10ca6a['body'][_0x40f1('0x6a')],_[_0x40f1('0xad')](_0x10ca6a['body'],[_0x40f1('0x6a'),'id'])||{})[_0x40f1('0x90')](function(_0xb6282a){for(var _0x476281=0x0;_0x476281<_0x10ca6a['body'][_0x40f1('0x6a')][_0x40f1('0x6d')];_0x476281+=0x1){socket[_0x40f1('0xae')](_0x40f1('0xaf'),{'UserId':_0x10ca6a['body']['ids'][_0x476281],'OpenchannelAccountId':_0x10ca6a[_0x40f1('0x5f')]['id']});}return _0xb6282a;});}})[_0x40f1('0x35')](respondWithResult(_0x3a33bb,null))[_0x40f1('0x29')](handleError(_0x3a33bb,null));};exports['removeAgents']=function(_0x2fb35d,_0x3ce24b,_0x2b6f23){return db['OpenchannelAccount'][_0x40f1('0x57')]({'where':{'id':_0x2fb35d[_0x40f1('0x5f')]['id']}})[_0x40f1('0x35')](handleEntityNotFound(_0x3ce24b,null))[_0x40f1('0x35')](function(_0x4b7d05){if(_0x4b7d05){return _0x4b7d05[_0x40f1('0xb0')](_0x2fb35d[_0x40f1('0x41')][_0x40f1('0x6a')])['then'](function(){if(_['isArray'](_0x2fb35d[_0x40f1('0x41')][_0x40f1('0x6a')])){for(var _0x3a1399=0x0;_0x3a1399<_0x2fb35d['query']['ids']['length'];_0x3a1399+=0x1){socket[_0x40f1('0xae')](_0x40f1('0xb1'),{'UserId':Number(_0x2fb35d[_0x40f1('0x41')][_0x40f1('0x6a')][_0x3a1399]),'OpenchannelAccountId':Number(_0x2fb35d['params']['id'])});}}else{socket[_0x40f1('0xae')](_0x40f1('0xb1'),{'UserId':Number(_0x2fb35d['query'][_0x40f1('0x6a')]),'OpenchannelAccountId':Number(_0x2fb35d[_0x40f1('0x5f')]['id'])});}});}})[_0x40f1('0x35')](respondWithStatusCode(_0x3ce24b,null))[_0x40f1('0x29')](handleError(_0x3ce24b,null));};exports[_0x40f1('0xb2')]=function(_0x42dfff,_0x538235,_0x74bc1d){var _0xc0870d={};var _0x438351={};var _0xdbcb76;var _0x444987;return db[_0x40f1('0x52')][_0x40f1('0x64')]({'where':{'id':_0x42dfff[_0x40f1('0x5f')]['id']}})[_0x40f1('0x35')](handleEntityNotFound(_0x538235,null))[_0x40f1('0x35')](function(_0x28a300){if(_0x28a300){_0xdbcb76=_0x28a300;_0x438351[_0x40f1('0x44')]=_[_0x40f1('0x40')](db[_0x40f1('0xa7')][_0x40f1('0x3f')]);_0x438351[_0x40f1('0x41')]=_['keys'](_0x42dfff[_0x40f1('0x41')]);_0x438351[_0x40f1('0x42')]=_[_0x40f1('0x43')](_0x438351[_0x40f1('0x44')],_0x438351[_0x40f1('0x41')]);_0xc0870d[_0x40f1('0x46')]=_[_0x40f1('0x43')](_0x438351[_0x40f1('0x44')],qs[_0x40f1('0x45')](_0x42dfff[_0x40f1('0x41')][_0x40f1('0x45')]));_0xc0870d['attributes']=_0xc0870d[_0x40f1('0x46')]['length']?_0xc0870d['attributes']:_0x438351[_0x40f1('0x44')];_0xc0870d[_0x40f1('0x66')]=qs[_0x40f1('0x49')](_0x42dfff['query'][_0x40f1('0x49')]);_0xc0870d['where']=qs[_0x40f1('0x42')](_[_0x40f1('0x4b')](_0x42dfff[_0x40f1('0x41')],_0x438351[_0x40f1('0x42')]));if(_0x42dfff[_0x40f1('0x41')][_0x40f1('0x4c')]){_0xc0870d[_0x40f1('0x4a')]=_[_0x40f1('0x50')](_0xc0870d[_0x40f1('0x4a')],{'$or':_[_0x40f1('0x67')](_0xc0870d[_0x40f1('0x46')],function(_0x3b20ea){var _0x1443ea={};_0x1443ea[_0x3b20ea]={'$like':'%'+_0x42dfff[_0x40f1('0x41')][_0x40f1('0x4c')]+'%'};return _0x1443ea;})});}_0xc0870d=_[_0x40f1('0x50')]({},_0xc0870d,_0x42dfff['options']);return _0xdbcb76[_0x40f1('0xb2')](_0xc0870d);}})['then'](function(_0x4df658){if(_0x4df658){_0x444987=_0x4df658[_0x40f1('0x6d')];if(!_0x42dfff[_0x40f1('0x41')][_0x40f1('0x47')]('nolimit')){_0xc0870d[_0x40f1('0x2e')]=qs[_0x40f1('0x2e')](_0x42dfff[_0x40f1('0x41')][_0x40f1('0x2e')]);_0xc0870d[_0x40f1('0x2d')]=qs[_0x40f1('0x2d')](_0x42dfff[_0x40f1('0x41')]['offset']);}return _0xdbcb76[_0x40f1('0xb2')](_0xc0870d);}})['then'](function(_0x4d8435){if(_0x4d8435){return _0x4d8435?{'count':_0x444987,'rows':_0x4d8435}:null;}})[_0x40f1('0x35')](respondWithResult(_0x538235,null))[_0x40f1('0x29')](handleError(_0x538235,null));};exports[_0x40f1('0x3c')]=function(_0x2ff88,_0x1522f3,_0x20e108){var _0x3a4e27,_0x37075f,_0x1520f1;if(_[_0x40f1('0x7a')](_0x2ff88[_0x40f1('0x5e')]['body'])||_0x2ff88[_0x40f1('0x5e')][_0x40f1('0x5e')]===''){throw new db[(_0x40f1('0x73'))][(_0x40f1('0x74'))](_0x40f1('0xb3'));}if(_[_0x40f1('0x7a')](_0x2ff88[_0x40f1('0x5e')]['to'])){}_0x3a4e27=_0x2ff88[_0x40f1('0x5e')]['to'];return db[_0x40f1('0x52')]['findOne']({'where':{'id':_0x2ff88['params']['id']}})[_0x40f1('0x35')](handleEntityNotFound(_0x1522f3,null))[_0x40f1('0x35')](function(_0x5bae91){if(_0x5bae91){return db['OpenchannelAccount'][_0x40f1('0x57')]({'where':{'id':_0x5bae91['id']},'include':[{'model':db[_0x40f1('0xb4')],'as':_0x40f1('0x81'),'include':[{'model':db[_0x40f1('0x72')],'as':_0x40f1('0x82'),'where':{[_0x5bae91[_0x40f1('0x7c')]]:_0x3a4e27},'limit':0x1,'order':[[_0x40f1('0x78'),_0x40f1('0x83')]]}]}]})['then'](handleEntityNotFound(_0x1522f3,null))[_0x40f1('0x35')](function(_0x1ea3c8){if(_0x1ea3c8&&_0x1ea3c8[_0x40f1('0x81')]){_0x37075f=_0x1ea3c8[_0x40f1('0x37')]({'plain':!![]});if(_0x37075f['List']&&_0x37075f[_0x40f1('0x81')][_0x40f1('0x82')][_0x40f1('0x6d')]){return _0x37075f[_0x40f1('0x81')]['Contacts'][0x0];}return db['CmContact']['create'](_['defaults'](_0x2ff88[_0x40f1('0x5e')],{'firstName':_0x3a4e27,[_0x1ea3c8[_0x40f1('0x7c')]]:_0x3a4e27,'phone':_0x3a4e27,'ListId':_0x37075f[_0x40f1('0xb5')]}));}})[_0x40f1('0x35')](handleEntityNotFound(_0x1522f3,null))[_0x40f1('0x35')](function(_0x358fe0){if(_0x358fe0){_0x1520f1=_0x358fe0;return db['OpenchannelInteraction'][_0x40f1('0x57')]({'where':{'ContactId':_0x1520f1['id'],'closed':![],'OpenchannelAccountId':_0x37075f['id']}})[_0x40f1('0x35')](function(_0x40914d){if(_0x40914d){return[_0x40914d,![]];}return db[_0x40f1('0x8d')][_0x40f1('0x58')]({'UserId':_0x2ff88[_0x40f1('0x59')]['id'],'ContactId':_0x1520f1['id'],'OpenchannelAccountId':_0x37075f['id'],'lastMsgDirection':_0x40f1('0xb6'),'Messages':[_[_0x40f1('0x50')](_0x2ff88['body'],{'read':![],'body':_0x2ff88[_0x40f1('0x5e')][_0x40f1('0x5e')],'OpenchannelAccountId':_0x37075f['id'],'UserId':_0x2ff88[_0x40f1('0x59')]['id'],'ContactId':_0x1520f1['id']})]},{'include':[{'model':db[_0x40f1('0x99')],'as':_0x40f1('0xb7')}]})[_0x40f1('0x35')](function(_0x5151b6){return[_0x5151b6,!![]];});});}})[_0x40f1('0x90')](function(_0x29d15d,_0x3b3795){if(_0x3b3795){return _0x29d15d;}return db[_0x40f1('0x99')][_0x40f1('0x58')](_[_0x40f1('0x50')](_0x2ff88[_0x40f1('0x5e')],{'read':![],'body':_0x2ff88[_0x40f1('0x5e')][_0x40f1('0x5e')],'OpenchannelAccountId':_0x37075f['id'],'OpenchannelInteractionId':_0x29d15d['id'],'UserId':_0x2ff88[_0x40f1('0x59')]['id'],'ContactId':_0x1520f1['id']}))[_0x40f1('0x35')](function(_0x2dede4){_0x29d15d['dataValues'][_0x40f1('0xb7')]=[];_0x29d15d[_0x40f1('0xb8')][_0x40f1('0xb7')][_0x40f1('0xb9')](_0x2dede4[_0x40f1('0xb8')]);return _0x29d15d;});});}})[_0x40f1('0x35')](respondWithResult(_0x1522f3,null))[_0x40f1('0x29')](handleError(_0x1522f3,null));}; \ No newline at end of file +var _0x133f=['DESC','OpenchannelApplication','List','account','applications','list','orderBy','priority','Applications','ListId','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','contact','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','findAndCountAll','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','nolimit','Messages','dataValues','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','defaults','redis','socket.io-emitter','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~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','reject','update','destroy','get','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','model','keys','query','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','show','params','intersection','find','create','user','OpenchannelAccounts','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','OpnechannelAccountId','Disposition','findOne','order','OpenchannelAccountId','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','openchannel','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','from','ValidationError','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','CmList','Contacts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x133f,0x1ad));var _0xf133=function(_0x58c459,_0x2ee065){_0x58c459=_0x58c459-0x0;var _0x232780=_0x133f[_0x58c459];return _0x232780;};'use strict';var pdf=require(_0xf133('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf133('0x1'));var zipdir=require(_0xf133('0x2'));var jsonpatch=require(_0xf133('0x3'));var rp=require('request-promise');var moment=require(_0xf133('0x4'));var BPromise=require(_0xf133('0x5'));var Mustache=require(_0xf133('0x6'));var util=require('util');var path=require(_0xf133('0x7'));var sox=require(_0xf133('0x8'));var csv=require('to-csv');var ejs=require(_0xf133('0x9'));var fs=require('fs');var _=require(_0xf133('0xa'));var squel=require(_0xf133('0xb'));var crypto=require(_0xf133('0xc'));var jsforce=require(_0xf133('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf133('0xe'));var querystring=require(_0xf133('0xf'));var Papa=require(_0xf133('0x10'));var Redis=require(_0xf133('0x11'));var authService=require(_0xf133('0x12'));var qs=require(_0xf133('0x13'));var hardwareService=require(_0xf133('0x14'));var logger=require(_0xf133('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf133('0x16'))['db'];config['redis']=_[_0xf133('0x17')](config[_0xf133('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xf133('0x19'))(new Redis(config[_0xf133('0x18')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0xf133('0x1a'));var client=jayson[_0xf133('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0xf133('0x1b')][_0xf133('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x2e3ec4,_0x39fabb,_0x33a756){if(_0x33a756){var _0x5f24c3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5f24c3['test'](_0x39fabb)){return _0x2e3ec4;}else{throw new Error(_0xf133('0x1d'));}}else{return _0x2e3ec4;}}function respondWithRpcPromise(_0x13b4b6,_0x525ef7,_0x1b1722,_0xf01ab4){return new BPromise(function(_0x2729f1,_0x58a9d7){var _0x54e85e=_0xf01ab4||client;return _0x54e85e[_0xf133('0x1e')](_0x13b4b6,_0x1b1722)[_0xf133('0x1f')](function(_0x5eb7f8){logger[_0xf133('0x20')](_0xf133('0x21'),_0x525ef7,_0xf133('0x22'));logger[_0xf133('0x23')](_0xf133('0x24'),_0x525ef7,_0xf133('0x22'),JSON[_0xf133('0x25')](_0x5eb7f8));if(_0x5eb7f8['error']){if(_0x5eb7f8['error'][_0xf133('0x26')]===0x1f4){logger[_0xf133('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x525ef7,_0x5eb7f8[_0xf133('0x27')][_0xf133('0x28')]);return _0x58a9d7(_0x5eb7f8[_0xf133('0x27')][_0xf133('0x28')]);}logger[_0xf133('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x525ef7,_0x5eb7f8[_0xf133('0x27')][_0xf133('0x28')]);return _0x2729f1(_0x5eb7f8['error']['message']);}else{logger['info'](_0xf133('0x21'),_0x525ef7,_0xf133('0x22'));_0x2729f1(_0x5eb7f8[_0xf133('0x29')][_0xf133('0x28')]);}})[_0xf133('0x2a')](function(_0x366129){logger[_0xf133('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x525ef7,_0x366129);_0x58a9d7(_0x366129);});});}function respondWithStatusCode(_0x57c723,_0x16a07d){_0x16a07d=_0x16a07d||0xcc;return function(_0x1a8758){if(_0x1a8758){return _0x57c723['sendStatus'](_0x16a07d);}return _0x57c723[_0xf133('0x2b')](_0x16a07d)[_0xf133('0x2c')]();};}function respondWithResult(_0x283956,_0x2867ce){_0x2867ce=_0x2867ce||0xc8;return function(_0x45c853){if(_0x45c853){return _0x283956[_0xf133('0x2b')](_0x2867ce)[_0xf133('0x2d')](_0x45c853);}};}function respondWithFilteredResult(_0x2ceac3,_0x40a407){return function(_0x14833b){if(_0x14833b){var _0x18076d=_0x14833b[_0xf133('0x2e')],_0x863ea0=_0x40a407[_0xf133('0x2f')],_0x1f61a5=_0x40a407[_0xf133('0x2f')]+_0x40a407[_0xf133('0x30')],_0x25aed9;if(_0x1f61a5>=_0x18076d){_0x1f61a5=_0x18076d;_0x25aed9=0xc8;}else{_0x25aed9=0xce;}_0x2ceac3[_0xf133('0x2b')](_0x25aed9);return _0x2ceac3[_0xf133('0x31')](_0xf133('0x32'),_0x863ea0+'-'+_0x1f61a5+'/'+_0x18076d)[_0xf133('0x2d')](_0x14833b);}return null;};}function patchUpdates(_0x5a246a){return function(_0x105904){try{jsonpatch['apply'](_0x105904,_0x5a246a,!![]);}catch(_0x54841e){return BPromise[_0xf133('0x33')](_0x54841e);}return _0x105904['save']();};}function saveUpdates(_0x1f8d82,_0x32ad5b){return function(_0x2f5e11){if(_0x2f5e11){return _0x2f5e11[_0xf133('0x34')](_0x1f8d82)['then'](function(_0x5749a8){return _0x5749a8;});}return null;};}function removeEntity(_0x4dae60,_0x2fe6fe){return function(_0x2eb531){if(_0x2eb531){return _0x2eb531[_0xf133('0x35')]()['then'](function(){var _0x5890b5=_0x2eb531[_0xf133('0x36')]({'plain':!![]});var _0x326aed='OpenchannelAccounts';return db['UserProfileResource'][_0xf133('0x35')]({'where':{'type':_0x326aed,'resourceId':_0x5890b5['id']}})[_0xf133('0x1f')](function(){return _0x2eb531;});})[_0xf133('0x1f')](function(){_0x4dae60[_0xf133('0x2b')](0xcc)[_0xf133('0x2c')]();});}};}function handleEntityNotFound(_0x3d6edc,_0xbefa37){return function(_0x3d758e){if(!_0x3d758e){_0x3d6edc['sendStatus'](0x194);}return _0x3d758e;};}function handleError(_0x1744c6,_0x4e9e58){_0x4e9e58=_0x4e9e58||0x1f4;return function(_0x3cfd84){logger[_0xf133('0x27')](_0x3cfd84[_0xf133('0x37')]);if(_0x3cfd84['name']){delete _0x3cfd84[_0xf133('0x38')];}_0x1744c6[_0xf133('0x2b')](_0x4e9e58)[_0xf133('0x39')](_0x3cfd84);};}exports[_0xf133('0x3a')]=function(_0x248aae,_0x3b7ab8){var _0x2f3b2f={'include':[{'model':db[_0xf133('0x3b')],'as':_0xf133('0x3c')}]},_0x184dda={},_0x3fbfed={'count':0x0,'rows':[]};var _0x5d5bf3=db[_0xf133('0x3d')][_0xf133('0x3e')];_0x184dda[_0xf133('0x3f')]=_[_0xf133('0x40')](_0x5d5bf3);_0x184dda['query']=_['keys'](_0x248aae['query']);_0x184dda['filters']=_['intersection'](_0x184dda[_0xf133('0x3f')],_0x184dda[_0xf133('0x41')]);_0x2f3b2f[_0xf133('0x42')]=_['intersection'](_0x184dda[_0xf133('0x3f')],qs[_0xf133('0x43')](_0x248aae[_0xf133('0x41')][_0xf133('0x43')]));_0x2f3b2f[_0xf133('0x42')]=_0x2f3b2f['attributes'][_0xf133('0x44')]?_0x2f3b2f[_0xf133('0x42')]:_0x184dda['model'];if(!_0x248aae[_0xf133('0x41')][_0xf133('0x45')]('nolimit')){_0x2f3b2f['limit']=qs[_0xf133('0x30')](_0x248aae[_0xf133('0x41')][_0xf133('0x30')]);_0x2f3b2f['offset']=qs[_0xf133('0x2f')](_0x248aae['query'][_0xf133('0x2f')]);}_0x2f3b2f['order']=qs['sort'](_0x248aae[_0xf133('0x41')][_0xf133('0x46')]);_0x2f3b2f[_0xf133('0x47')]=qs[_0xf133('0x48')](_[_0xf133('0x49')](_0x248aae['query'],_0x184dda[_0xf133('0x48')]));if(_0x248aae[_0xf133('0x41')][_0xf133('0x4a')]){_0x2f3b2f[_0xf133('0x47')]=_[_0xf133('0x4b')](_0x2f3b2f['where'],{'$or':_[_0xf133('0x4c')](_0x5d5bf3,function(_0x4e6445){if(_0x4e6445[_0xf133('0x4d')][_0xf133('0x4e')]!=='VIRTUAL'){var _0x361582={};_0x361582[_0x4e6445[_0xf133('0x4f')]]={'$like':'%'+_0x248aae[_0xf133('0x41')][_0xf133('0x4a')]+'%'};return _0x361582;}})});}_0x2f3b2f=_[_0xf133('0x4b')]({},_0x2f3b2f,_0x248aae[_0xf133('0x50')]);var _0x44d8be={'where':_0x2f3b2f['where']};return db[_0xf133('0x3d')][_0xf133('0x2e')](_0x44d8be)[_0xf133('0x1f')](function(_0x2c5493){_0x3fbfed[_0xf133('0x2e')]=_0x2c5493;if(_0x248aae[_0xf133('0x41')][_0xf133('0x51')]){_0x2f3b2f[_0xf133('0x52')]=[{'all':!![]}];}return db[_0xf133('0x3d')][_0xf133('0x53')](_0x2f3b2f);})[_0xf133('0x1f')](function(_0x422a71){_0x3fbfed[_0xf133('0x54')]=_0x422a71;return _0x3fbfed;})[_0xf133('0x1f')](respondWithFilteredResult(_0x3b7ab8,_0x2f3b2f))[_0xf133('0x2a')](handleError(_0x3b7ab8,null));};exports[_0xf133('0x55')]=function(_0x1bf489,_0x4931e5){var _0x33d407={'raw':![],'where':{'id':_0x1bf489[_0xf133('0x56')]['id']},'include':[{'model':db[_0xf133('0x3b')],'as':_0xf133('0x3c')}]},_0x55cd13={};_0x55cd13[_0xf133('0x3f')]=_[_0xf133('0x40')](db[_0xf133('0x3d')][_0xf133('0x3e')]);_0x55cd13[_0xf133('0x41')]=_[_0xf133('0x40')](_0x1bf489[_0xf133('0x41')]);_0x55cd13['filters']=_[_0xf133('0x57')](_0x55cd13[_0xf133('0x3f')],_0x55cd13[_0xf133('0x41')]);_0x33d407[_0xf133('0x42')]=_[_0xf133('0x57')](_0x55cd13[_0xf133('0x3f')],qs[_0xf133('0x43')](_0x1bf489[_0xf133('0x41')][_0xf133('0x43')]));_0x33d407['attributes']=_0x33d407[_0xf133('0x42')][_0xf133('0x44')]?_0x33d407[_0xf133('0x42')]:_0x55cd13[_0xf133('0x3f')];if(_0x1bf489['query']['includeAll']){_0x33d407[_0xf133('0x52')]=[{'all':!![]}];}_0x33d407=_[_0xf133('0x4b')]({},_0x33d407,_0x1bf489[_0xf133('0x50')]);return db[_0xf133('0x3d')][_0xf133('0x58')](_0x33d407)[_0xf133('0x1f')](handleEntityNotFound(_0x4931e5,null))[_0xf133('0x1f')](respondWithResult(_0x4931e5,null))[_0xf133('0x2a')](handleError(_0x4931e5,null));};exports[_0xf133('0x59')]=function(_0x58a6b2,_0x1b6b42){return db[_0xf133('0x3d')][_0xf133('0x59')](_0x58a6b2['body'],{})[_0xf133('0x1f')](function(_0x2b49b4){var _0x3edb3f=_0x58a6b2[_0xf133('0x5a')][_0xf133('0x36')]({'plain':!![]});if(!_0x3edb3f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3edb3f['role']===_0xf133('0x5a')){var _0x7fec=_0x2b49b4[_0xf133('0x36')]({'plain':!![]});var _0x436fa7=_0xf133('0x5b');return db['UserProfileSection']['find']({'where':{'name':_0x436fa7,'userProfileId':_0x3edb3f[_0xf133('0x5c')]},'raw':!![]})[_0xf133('0x1f')](function(_0x5ba42e){if(_0x5ba42e&&_0x5ba42e['autoAssociation']===0x0){return db[_0xf133('0x5d')][_0xf133('0x59')]({'name':_0x7fec[_0xf133('0x38')],'resourceId':_0x7fec['id'],'type':_0x5ba42e[_0xf133('0x38')],'sectionId':_0x5ba42e['id']},{})['then'](function(){return _0x2b49b4;});}else{return _0x2b49b4;}})[_0xf133('0x2a')](function(_0x289686){logger[_0xf133('0x27')](_0xf133('0x5e'),_0x289686);throw _0x289686;});}return _0x2b49b4;})[_0xf133('0x1f')](respondWithResult(_0x1b6b42,0xc9))[_0xf133('0x2a')](handleError(_0x1b6b42,null));};exports[_0xf133('0x34')]=function(_0x174c72,_0x193e19){if(_0x174c72['body']['id']){delete _0x174c72[_0xf133('0x5f')]['id'];}return db[_0xf133('0x3d')][_0xf133('0x58')]({'where':{'id':_0x174c72[_0xf133('0x56')]['id']},'include':[{'model':db[_0xf133('0x3b')],'as':_0xf133('0x3c')}]})[_0xf133('0x1f')](handleEntityNotFound(_0x193e19,null))[_0xf133('0x1f')](saveUpdates(_0x174c72[_0xf133('0x5f')],null))[_0xf133('0x1f')](respondWithResult(_0x193e19,null))['catch'](handleError(_0x193e19,null));};exports['destroy']=function(_0x280402,_0x367890){return db['OpenchannelAccount'][_0xf133('0x58')]({'where':{'id':_0x280402['params']['id']}})[_0xf133('0x1f')](handleEntityNotFound(_0x367890,null))[_0xf133('0x1f')](removeEntity(_0x367890,null))['catch'](handleError(_0x367890,null));};exports['describe']=function(_0x4c2407,_0xfe42de){return db[_0xf133('0x3d')][_0xf133('0x60')]()[_0xf133('0x1f')](respondWithResult(_0xfe42de,null))[_0xf133('0x2a')](handleError(_0xfe42de,null));};exports[_0xf133('0x61')]=function(_0x5d9d17,_0x449d76,_0x2e5cdf){if(_0x5d9d17[_0xf133('0x5f')]['id']){delete _0x5d9d17[_0xf133('0x5f')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x5d9d17[_0xf133('0x56')]['id']}})[_0xf133('0x1f')](handleEntityNotFound(_0x449d76,null))['then'](function(_0x4e618d){if(_0x4e618d){_0x5d9d17[_0xf133('0x5f')][_0xf133('0x62')]=_0x4e618d['id'];return db[_0xf133('0x63')][_0xf133('0x59')](_0x5d9d17[_0xf133('0x5f')]);}})[_0xf133('0x1f')](respondWithResult(_0x449d76,null))[_0xf133('0x2a')](handleError(_0x449d76,null));};exports['getDispositions']=function(_0x2654ca,_0x8bfce0,_0x3bfb30){var _0x3eb955={'raw':![],'where':{}};var _0x1d418d={};var _0x295f26={'count':0x0,'rows':[]};return db[_0xf133('0x3d')][_0xf133('0x64')]({'where':{'id':_0x2654ca['params']['id']}})[_0xf133('0x1f')](handleEntityNotFound(_0x8bfce0,null))[_0xf133('0x1f')](function(_0x275c50){if(_0x275c50){_0x1d418d[_0xf133('0x3f')]=_['keys'](db['Disposition'][_0xf133('0x3e')]);_0x1d418d['query']=_[_0xf133('0x40')](_0x2654ca[_0xf133('0x41')]);_0x1d418d[_0xf133('0x48')]=_[_0xf133('0x57')](_0x1d418d[_0xf133('0x3f')],_0x1d418d[_0xf133('0x41')]);_0x3eb955['attributes']=_[_0xf133('0x57')](_0x1d418d['model'],qs[_0xf133('0x43')](_0x2654ca[_0xf133('0x41')][_0xf133('0x43')]));_0x3eb955[_0xf133('0x42')]=_0x3eb955[_0xf133('0x42')]['length']?_0x3eb955[_0xf133('0x42')]:_0x1d418d[_0xf133('0x3f')];if(!_0x2654ca[_0xf133('0x41')]['hasOwnProperty']('nolimit')){_0x3eb955[_0xf133('0x30')]=qs[_0xf133('0x30')](_0x2654ca[_0xf133('0x41')][_0xf133('0x30')]);_0x3eb955[_0xf133('0x2f')]=qs[_0xf133('0x2f')](_0x2654ca[_0xf133('0x41')][_0xf133('0x2f')]);}_0x3eb955[_0xf133('0x65')]=qs[_0xf133('0x46')](_0x2654ca[_0xf133('0x41')][_0xf133('0x46')]);_0x3eb955['where']=qs[_0xf133('0x48')](_[_0xf133('0x49')](_0x2654ca[_0xf133('0x41')],_0x1d418d[_0xf133('0x48')]));_0x3eb955[_0xf133('0x47')][_0xf133('0x66')]=_0x275c50['id'];if(_0x2654ca[_0xf133('0x41')][_0xf133('0x4a')]){_0x3eb955[_0xf133('0x47')]=_[_0xf133('0x4b')](_0x3eb955[_0xf133('0x47')],{'$or':_['map'](_0x3eb955['attributes'],function(_0x3b712c){var _0x36cbed={};_0x36cbed[_0x3b712c]={'$like':'%'+_0x2654ca[_0xf133('0x41')]['filter']+'%'};return _0x36cbed;})});}_0x3eb955=_['merge']({},_0x3eb955,_0x2654ca[_0xf133('0x50')]);return db[_0xf133('0x63')][_0xf133('0x2e')]({'where':_0x3eb955[_0xf133('0x47')]})[_0xf133('0x1f')](function(_0xdbdf48){_0x295f26[_0xf133('0x2e')]=_0xdbdf48;if(_0x2654ca[_0xf133('0x41')][_0xf133('0x51')]){_0x3eb955[_0xf133('0x52')]=[{'all':!![]}];}return db['Disposition'][_0xf133('0x53')](_0x3eb955);})[_0xf133('0x1f')](function(_0x2e973f){_0x295f26[_0xf133('0x54')]=_0x2e973f;return _0x295f26;});}})[_0xf133('0x1f')](respondWithFilteredResult(_0x8bfce0,_0x3eb955))['catch'](handleError(_0x8bfce0,null));};exports[_0xf133('0x67')]=function(_0xc7e85a,_0x1f9787,_0x341eb8){return db['OpenchannelAccount'][_0xf133('0x58')]({'where':{'id':_0xc7e85a['params']['id']}})[_0xf133('0x1f')](handleEntityNotFound(_0x1f9787,null))[_0xf133('0x1f')](function(_0x506235){if(_0x506235){return _0x506235[_0xf133('0x67')](_0xc7e85a['query']['ids']);}})['then'](respondWithStatusCode(_0x1f9787,null))[_0xf133('0x2a')](handleError(_0x1f9787,null));};exports[_0xf133('0x68')]=function(_0xe0da9c,_0x17fd00,_0x2a4748){if(_0xe0da9c[_0xf133('0x5f')]['id']){delete _0xe0da9c[_0xf133('0x5f')]['id'];}return db[_0xf133('0x3d')][_0xf133('0x58')]({'where':{'id':_0xe0da9c[_0xf133('0x56')]['id']}})['then'](handleEntityNotFound(_0x17fd00,null))[_0xf133('0x1f')](function(_0x1e31c1){if(_0x1e31c1){_0xe0da9c[_0xf133('0x5f')][_0xf133('0x66')]=_0x1e31c1['id'];return db['CannedAnswer'][_0xf133('0x59')](_0xe0da9c[_0xf133('0x5f')]);}})[_0xf133('0x1f')](respondWithResult(_0x17fd00,null))['catch'](handleError(_0x17fd00,null));};exports[_0xf133('0x69')]=function(_0x5858e6,_0x5cc378,_0x2df084){var _0xc4cb73={'raw':![],'where':{}};var _0x238c20={};var _0x2554c1={'count':0x0,'rows':[]};return db[_0xf133('0x3d')][_0xf133('0x64')]({'where':{'id':_0x5858e6[_0xf133('0x56')]['id']}})['then'](handleEntityNotFound(_0x5cc378,null))[_0xf133('0x1f')](function(_0x5a0c62){if(_0x5a0c62){_0x238c20[_0xf133('0x3f')]=_[_0xf133('0x40')](db[_0xf133('0x6a')]['rawAttributes']);_0x238c20['query']=_[_0xf133('0x40')](_0x5858e6[_0xf133('0x41')]);_0x238c20['filters']=_[_0xf133('0x57')](_0x238c20[_0xf133('0x3f')],_0x238c20[_0xf133('0x41')]);_0xc4cb73[_0xf133('0x42')]=_[_0xf133('0x57')](_0x238c20[_0xf133('0x3f')],qs[_0xf133('0x43')](_0x5858e6[_0xf133('0x41')][_0xf133('0x43')]));_0xc4cb73['attributes']=_0xc4cb73[_0xf133('0x42')]['length']?_0xc4cb73[_0xf133('0x42')]:_0x238c20['model'];if(!_0x5858e6[_0xf133('0x41')][_0xf133('0x45')]('nolimit')){_0xc4cb73[_0xf133('0x30')]=qs[_0xf133('0x30')](_0x5858e6[_0xf133('0x41')][_0xf133('0x30')]);_0xc4cb73[_0xf133('0x2f')]=qs[_0xf133('0x2f')](_0x5858e6['query'][_0xf133('0x2f')]);}_0xc4cb73['order']=qs[_0xf133('0x46')](_0x5858e6[_0xf133('0x41')][_0xf133('0x46')]);_0xc4cb73[_0xf133('0x47')]=qs[_0xf133('0x48')](_[_0xf133('0x49')](_0x5858e6[_0xf133('0x41')],_0x238c20[_0xf133('0x48')]));_0xc4cb73[_0xf133('0x47')][_0xf133('0x66')]=_0x5a0c62['id'];if(_0x5858e6[_0xf133('0x41')][_0xf133('0x4a')]){_0xc4cb73[_0xf133('0x47')]=_[_0xf133('0x4b')](_0xc4cb73[_0xf133('0x47')],{'$or':_[_0xf133('0x4c')](_0xc4cb73[_0xf133('0x42')],function(_0x5dbcbf){var _0x130872={};_0x130872[_0x5dbcbf]={'$like':'%'+_0x5858e6[_0xf133('0x41')][_0xf133('0x4a')]+'%'};return _0x130872;})});}_0xc4cb73=_[_0xf133('0x4b')]({},_0xc4cb73,_0x5858e6['options']);return db[_0xf133('0x6a')][_0xf133('0x2e')]({'where':_0xc4cb73[_0xf133('0x47')]})[_0xf133('0x1f')](function(_0x320b15){_0x2554c1['count']=_0x320b15;if(_0x5858e6[_0xf133('0x41')]['includeAll']){_0xc4cb73[_0xf133('0x52')]=[{'all':!![]}];}return db[_0xf133('0x6a')][_0xf133('0x53')](_0xc4cb73);})['then'](function(_0x220aaa){_0x2554c1[_0xf133('0x54')]=_0x220aaa;return _0x2554c1;});}})[_0xf133('0x1f')](respondWithFilteredResult(_0x5cc378,_0xc4cb73))[_0xf133('0x2a')](handleError(_0x5cc378,null));};exports[_0xf133('0x6b')]=function(_0x511c8f,_0x526bac,_0x3d27fe){return db[_0xf133('0x3d')][_0xf133('0x58')]({'where':{'id':_0x511c8f[_0xf133('0x56')]['id']}})['then'](handleEntityNotFound(_0x526bac,null))[_0xf133('0x1f')](function(_0x6764ab){if(_0x6764ab){return _0x6764ab[_0xf133('0x6b')](_0x511c8f[_0xf133('0x41')][_0xf133('0x6c')]);}})[_0xf133('0x1f')](respondWithStatusCode(_0x526bac,null))['catch'](handleError(_0x526bac,null));};exports['notify']=function(_0x371729,_0x1198cc,_0xcb0a3a){var _0x2c6e51={'body':_0x371729[_0xf133('0x5f')],'channel':_0xf133('0x6d')};var _0x25742d=[];var _0x333fbd=[];var _0x55d9a7={};var _0x1b6de4=![];return db[_0xf133('0x6e')][_0xf133('0x60')]()[_0xf133('0x1f')](function(_0x599ca0){if(!_0x599ca0){throw new db[(_0xf133('0x6f'))]['ValidationError'](_0xf133('0x70'));}_0x25742d=_[_0xf133('0x71')](_[_0xf133('0x40')](_0x599ca0),['createdAt',_0xf133('0x72')]);_0x333fbd=_[_0xf133('0x71')](_[_0xf133('0x40')](_0x599ca0),[_0xf133('0x73'),_0xf133('0x72'),'CompanyId','ListId']);if(_0x371729['body']['id']){delete _0x371729['body']['id'];}if(_['isNil'](_0x371729[_0xf133('0x5f')][_0xf133('0x74')])){throw new db[(_0xf133('0x6f'))][(_0xf133('0x75'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x371729[_0xf133('0x5f')][_0xf133('0x5f')])||_0x371729[_0xf133('0x5f')]['body']===''){throw new db['Sequelize']['ValidationError'](_0xf133('0x76'));}if(_[_0xf133('0x77')](_0x371729['body'][_0xf133('0x78')])){throw new db['Sequelize'][(_0xf133('0x75'))](_0xf133('0x79')+_0x333fbd);}if(!_[_0xf133('0x7a')](_0x333fbd,_0x371729['body'][_0xf133('0x78')])){throw new db[(_0xf133('0x6f'))][(_0xf133('0x75'))](_0xf133('0x7b')+_0x333fbd);}_0x55d9a7[_0x371729[_0xf133('0x5f')][_0xf133('0x78')]]=_0x371729['body'][_0xf133('0x74')];})[_0xf133('0x1f')](function(){return db[_0xf133('0x3d')][_0xf133('0x58')]({'where':{'id':_0x371729[_0xf133('0x56')]['id']},'include':[{'model':db[_0xf133('0x7c')],'as':'List','include':[{'model':db[_0xf133('0x6e')],'as':_0xf133('0x7d'),'where':_0x55d9a7,'limit':0x1,'order':[[_0xf133('0x72'),_0xf133('0x7e')]]}]},{'model':db[_0xf133('0x7f')],'as':'Applications'}]});})[_0xf133('0x1f')](handleEntityNotFound(_0x1198cc,null))[_0xf133('0x1f')](function(_0x85c498){if(_0x85c498&&_0x85c498[_0xf133('0x80')]){_0x2c6e51[_0xf133('0x81')]=_0x85c498;_0x2c6e51[_0xf133('0x82')]=_0x85c498['Applications'];_0x2c6e51[_0xf133('0x83')]=_0x85c498[_0xf133('0x80')];_0x2c6e51[_0xf133('0x82')]=_[_0xf133('0x84')](_0x2c6e51[_0xf133('0x82')],[_0xf133('0x85')],['asc']);if(_0x2c6e51[_0xf133('0x81')][_0xf133('0x86')]){delete _0x2c6e51[_0xf133('0x81')]['Applications'];}if(_0x2c6e51['account']['List']&&_0x2c6e51[_0xf133('0x81')]['List'][_0xf133('0x7d')][_0xf133('0x44')]){return _0x2c6e51[_0xf133('0x81')][_0xf133('0x80')]['Contacts'][0x0];}var _0x3d5b97=_['defaults'](_0x371729[_0xf133('0x5f')],{'firstName':_0x371729[_0xf133('0x5f')][_0xf133('0x74')],'ListId':_0x85c498[_0xf133('0x87')]});_0x3d5b97[_0x371729[_0xf133('0x5f')][_0xf133('0x78')]]=_0x371729[_0xf133('0x5f')][_0xf133('0x74')];return db['CmContact'][_0xf133('0x59')](_0x3d5b97,{'fields':_0x25742d,'raw':!![]});}})['then'](handleEntityNotFound(_0x1198cc,null))[_0xf133('0x1f')](function(_0x2f9ae3){_0x2c6e51['contact']=_0x2f9ae3;if(_0x2f9ae3){var _0x32aeb3={'ContactId':_0x2f9ae3['id'],'OpenchannelAccountId':_0x371729[_0xf133('0x56')]['id'],'from':(_0x2f9ae3[_0xf133('0x88')]||'')+'\x20'+(_0x2f9ae3[_0xf133('0x89')]||'')};var _0xe1bb93={'OpenchannelAccountId':_0x371729[_0xf133('0x56')]['id'],'closed':![]};if(_0x371729[_0xf133('0x5f')][_0xf133('0x8a')]){_0xe1bb93[_0xf133('0x8a')]=_0x371729[_0xf133('0x5f')]['threadId'];return db[_0xf133('0x8b')][_0xf133('0x58')]({'where':_0xe1bb93})[_0xf133('0x1f')](function(_0x5bc2af){if(_0x5bc2af){return[_0x5bc2af,![]];}_0x32aeb3[_0xf133('0x8a')]=_0x371729[_0xf133('0x5f')][_0xf133('0x8a')];_0x32aeb3[_0xf133('0x8c')]=_0x371729['body'][_0xf133('0x8c')];return db[_0xf133('0x8b')][_0xf133('0x59')](_0x32aeb3)[_0xf133('0x1f')](function(_0x56face){return[_0x56face,!![]];});});}else{_0xe1bb93[_0xf133('0x8a')]=null;}_0xe1bb93[_0xf133('0x8d')]=_0x2f9ae3['id'];return db[_0xf133('0x8b')][_0xf133('0x58')]({'where':_0xe1bb93})[_0xf133('0x1f')](function(_0x108126){if(_0x108126){return[_0x108126,![]];}return db[_0xf133('0x8b')][_0xf133('0x59')](_0x32aeb3)[_0xf133('0x1f')](function(_0x50e04b){return[_0x50e04b,!![]];});});}})[_0xf133('0x8e')](function(_0x1a95ec,_0x7c8870){if(_0x1a95ec){_0x1b6de4=_0x7c8870;if(!_0x7c8870){var _0x5874af={'from':(_0x2c6e51['contact'][_0xf133('0x88')]||'')+'\x20'+(_0x2c6e51['contact'][_0xf133('0x89')]||'')};if(_0x371729['body']['threadId']&&_0x371729[_0xf133('0x5f')][_0xf133('0x8f')]&&_0x371729['body'][_0xf133('0x8a')]!=_0x371729[_0xf133('0x5f')][_0xf133('0x8f')]){_0x5874af['threadId']=_0x371729['body']['messageId'];}return _0x1a95ec['update'](_0x5874af);}else{return _0x1a95ec;}}})[_0xf133('0x1f')](function(_0x507420){_0x2c6e51[_0xf133('0x90')]=_0x507420[_0xf133('0x36')]({'plain':!![]});_0x2c6e51[_0xf133('0x90')][_0xf133('0x91')]=_0x1b6de4;if(_0x2c6e51[_0xf133('0x90')][_0xf133('0x91')]){if(_0x2c6e51[_0xf133('0x81')][_0xf133('0x92')]){_0x2c6e51['applications'][_0xf133('0x93')]({'id':0x0,'priority':_0x2c6e51['applications']['length']+0x1,'app':'close','appdata':_0xf133('0x94'),'interval':_0xf133('0x95')});}}return db[_0xf133('0x96')]['create']({'body':_0x371729[_0xf133('0x5f')][_0xf133('0x5f')],'OpenchannelAccountId':_0x371729[_0xf133('0x56')]['id'],'OpenchannelInteractionId':_0x507420['id'],'direction':'in','ContactId':_0x2c6e51[_0xf133('0x97')]['id'],'AttachmentId':_0x371729['body'][_0xf133('0x98')]});})[_0xf133('0x1f')](function(_0x134e7e){_0x2c6e51['message']=_0x134e7e;if(_0x2c6e51['interaction'][_0xf133('0x99')]){return db['User'][_0xf133('0x58')]({'attributes':['id','name'],'where':{'id':_0x2c6e51[_0xf133('0x90')][_0xf133('0x99')]}})['then'](function(_0x55a31d){if(_0x55a31d){_0x2c6e51['applications'][_0xf133('0x9a')]({'id':0x0,'priority':0x0,'app':_0xf133('0x9b'),'appdata':_0x55a31d[_0xf133('0x38')]+','+(_0x2c6e51[_0xf133('0x81')][_0xf133('0x9c')]||0xa),'interval':_0xf133('0x95')});_0x2c6e51[_0xf133('0x9d')]=![];}return respondWithRpcPromise(_0xf133('0x9e'),_0xf133('0x9f'),_0x2c6e51);});}return respondWithRpcPromise(_0xf133('0x9e'),_0xf133('0x9f'),_0x2c6e51);})['then'](function(_0x51b890){respondWithRpcPromise(_0xf133('0xa0'),_0xf133('0xa0'),{'event':'notify','message':_0x51b890},client9002);return _0x51b890;})[_0xf133('0x1f')](respondWithResult(_0x1198cc,null))[_0xf133('0x2a')](handleError(_0x1198cc,null));};exports[_0xf133('0xa1')]=function(_0x537c86,_0x13981e,_0xc6a7f6){return db[_0xf133('0x3d')][_0xf133('0x64')]({'where':{'id':_0x537c86[_0xf133('0x56')]['id']}})[_0xf133('0x1f')](handleEntityNotFound(_0x13981e,null))[_0xf133('0x1f')](function(_0x439968){if(_0x439968){return db[_0xf133('0xa2')][_0xf133('0xa3')](function(_0x68ed96){return db[_0xf133('0x7f')][_0xf133('0x35')]({'where':{'OpenchannelAccountId':_0x537c86[_0xf133('0x56')]['id']},'transaction':_0x68ed96})[_0xf133('0x1f')](function(_0x28b5a2){var _0x5a65cb=_[_0xf133('0x4c')](_0x537c86[_0xf133('0x5f')],function(_0x3a476a){_0x3a476a['OpenchannelAccountId']=_0x537c86[_0xf133('0x56')]['id'];return _0x3a476a;});return db[_0xf133('0x7f')]['bulkCreate'](_0x5a65cb,{'transaction':_0x68ed96});});})[_0xf133('0x1f')](function(){return db[_0xf133('0x7f')][_0xf133('0xa4')]({'where':{'OpenchannelAccountId':_0x537c86[_0xf133('0x56')]['id']},'order':_0xf133('0x85')});});}})[_0xf133('0x1f')](respondWithResult(_0x13981e,null))[_0xf133('0x2a')](handleError(_0x13981e,null));};exports[_0xf133('0xa5')]=function(_0x316b46,_0x348357,_0x9f0cd9){var _0x465104={};var _0x21f567={};var _0x179fce;var _0x78b9de;return db[_0xf133('0x3d')]['findOne']({'where':{'id':_0x316b46[_0xf133('0x56')]['id']}})['then'](handleEntityNotFound(_0x348357,null))[_0xf133('0x1f')](function(_0x2d72d0){if(_0x2d72d0){_0x179fce=_0x2d72d0;_0x21f567[_0xf133('0x3f')]=_[_0xf133('0x40')](db[_0xf133('0x7f')][_0xf133('0x3e')]);_0x21f567[_0xf133('0x41')]=_[_0xf133('0x40')](_0x316b46[_0xf133('0x41')]);_0x21f567[_0xf133('0x48')]=_[_0xf133('0x57')](_0x21f567['model'],_0x21f567['query']);_0x465104[_0xf133('0x42')]=_[_0xf133('0x57')](_0x21f567[_0xf133('0x3f')],qs[_0xf133('0x43')](_0x316b46[_0xf133('0x41')][_0xf133('0x43')]));_0x465104[_0xf133('0x42')]=_0x465104[_0xf133('0x42')][_0xf133('0x44')]?_0x465104['attributes']:_0x21f567[_0xf133('0x3f')];_0x465104[_0xf133('0x65')]=qs['sort'](_0x316b46['query'][_0xf133('0x46')]);_0x465104[_0xf133('0x47')]=qs[_0xf133('0x48')](_[_0xf133('0x49')](_0x316b46[_0xf133('0x41')],_0x21f567[_0xf133('0x48')]));if(_0x316b46[_0xf133('0x41')][_0xf133('0x4a')]){_0x465104[_0xf133('0x47')]=_['merge'](_0x465104[_0xf133('0x47')],{'$or':_[_0xf133('0x4c')](_0x465104['attributes'],function(_0x479ca1){var _0x1219b5={};_0x1219b5[_0x479ca1]={'$like':'%'+_0x316b46[_0xf133('0x41')]['filter']+'%'};return _0x1219b5;})});}_0x465104=_[_0xf133('0x4b')]({},_0x465104,_0x316b46[_0xf133('0x50')]);return _0x179fce['getApplications'](_0x465104);}})[_0xf133('0x1f')](function(_0x5e9b50){if(_0x5e9b50){_0x78b9de=_0x5e9b50['length'];if(!_0x316b46[_0xf133('0x41')]['hasOwnProperty']('nolimit')){_0x465104[_0xf133('0x30')]=qs[_0xf133('0x30')](_0x316b46[_0xf133('0x41')][_0xf133('0x30')]);_0x465104[_0xf133('0x2f')]=qs[_0xf133('0x2f')](_0x316b46[_0xf133('0x41')]['offset']);}return _0x179fce[_0xf133('0xa5')](_0x465104);}})[_0xf133('0x1f')](function(_0x3aed32){if(_0x3aed32){return _0x3aed32?{'count':_0x78b9de,'rows':_0x3aed32}:null;}})[_0xf133('0x1f')](respondWithResult(_0x348357,null))[_0xf133('0x2a')](handleError(_0x348357,null));};exports[_0xf133('0xa6')]=function(_0x36a142,_0x496d1f,_0x27e6f0){var _0x27640f={'raw':![],'where':{}};var _0x46a628={};var _0x5ac4c3={'count':0x0,'rows':[]};return db[_0xf133('0x3d')][_0xf133('0x64')]({'where':{'id':_0x36a142[_0xf133('0x56')]['id']}})[_0xf133('0x1f')](handleEntityNotFound(_0x496d1f,null))[_0xf133('0x1f')](function(_0x3c01a5){if(_0x3c01a5){_0x46a628[_0xf133('0x3f')]=_['keys'](db[_0xf133('0x8b')][_0xf133('0x3e')]);_0x46a628[_0xf133('0x41')]=_[_0xf133('0x40')](_0x36a142[_0xf133('0x41')]);_0x46a628[_0xf133('0x48')]=_[_0xf133('0x57')](_0x46a628[_0xf133('0x3f')],_0x46a628[_0xf133('0x41')]);_0x27640f[_0xf133('0x42')]=_[_0xf133('0x57')](_0x46a628[_0xf133('0x3f')],qs[_0xf133('0x43')](_0x36a142[_0xf133('0x41')][_0xf133('0x43')]));_0x27640f['attributes']=_0x27640f[_0xf133('0x42')][_0xf133('0x44')]?_0x27640f[_0xf133('0x42')]:_0x46a628[_0xf133('0x3f')];if(!_0x36a142[_0xf133('0x41')][_0xf133('0x45')]('nolimit')){_0x27640f[_0xf133('0x30')]=qs['limit'](_0x36a142[_0xf133('0x41')][_0xf133('0x30')]);_0x27640f[_0xf133('0x2f')]=qs[_0xf133('0x2f')](_0x36a142[_0xf133('0x41')][_0xf133('0x2f')]);}_0x27640f['order']=qs[_0xf133('0x46')](_0x36a142['query']['sort']);_0x27640f[_0xf133('0x47')]=qs[_0xf133('0x48')](_[_0xf133('0x49')](_0x36a142[_0xf133('0x41')],_0x46a628[_0xf133('0x48')]));_0x27640f[_0xf133('0x47')][_0xf133('0x66')]=_0x3c01a5['id'];if(_0x36a142[_0xf133('0x41')][_0xf133('0x4a')]){_0x27640f[_0xf133('0x47')]=_['merge'](_0x27640f[_0xf133('0x47')],{'$or':_[_0xf133('0x4c')](_0x27640f['attributes'],function(_0x504544){var _0x1a3f48={};_0x1a3f48[_0x504544]={'$like':'%'+_0x36a142[_0xf133('0x41')][_0xf133('0x4a')]+'%'};return _0x1a3f48;})});}_0x27640f=_[_0xf133('0x4b')]({},_0x27640f,_0x36a142[_0xf133('0x50')]);return db[_0xf133('0x8b')]['count']({'where':_0x27640f[_0xf133('0x47')]})['then'](function(_0xc0124c){_0x5ac4c3['count']=_0xc0124c;if(_0x36a142[_0xf133('0x41')][_0xf133('0x51')]){_0x27640f[_0xf133('0x52')]=[{'model':db[_0xf133('0x6e')],'as':_0xf133('0xa7'),'required':![]},{'model':db[_0xf133('0xa8')],'as':_0xf133('0xa9'),'attributes':[_0xf133('0x38'),_0xf133('0xaa'),_0xf133('0xab')],'required':![]},{'model':db[_0xf133('0xac')],'as':'Tags','attributes':['id',_0xf133('0x38'),_0xf133('0xad')],'where':_0x36a142[_0xf133('0x41')][_0xf133('0xae')]?{'id':_0x36a142[_0xf133('0x41')][_0xf133('0xae')]}:undefined,'required':_0x36a142[_0xf133('0x41')]['tag']?!![]:![]}];}return db[_0xf133('0x8b')]['findAll'](_0x27640f);})[_0xf133('0x1f')](function(_0x113426){_0x5ac4c3['rows']=_0x113426;return _0x5ac4c3;});}})[_0xf133('0x1f')](respondWithFilteredResult(_0x496d1f,_0x27640f))[_0xf133('0x2a')](handleError(_0x496d1f,null));};exports[_0xf133('0xaf')]=function(_0x4a708d,_0xa3eab,_0x500a61){return db[_0xf133('0x3d')][_0xf133('0x58')]({'where':{'id':_0x4a708d[_0xf133('0x56')]['id']}})[_0xf133('0x1f')](handleEntityNotFound(_0xa3eab,null))[_0xf133('0x1f')](function(_0x37fbc4){if(_0x37fbc4){return _0x37fbc4[_0xf133('0xaf')](_0x4a708d[_0xf133('0x5f')]['ids'],_['omit'](_0x4a708d[_0xf133('0x5f')],[_0xf133('0x6c'),'id'])||{})[_0xf133('0x8e')](function(_0x1b81f4){for(var _0x5854e7=0x0;_0x5854e7<_0x4a708d[_0xf133('0x5f')]['ids'][_0xf133('0x44')];_0x5854e7+=0x1){socket[_0xf133('0xb0')](_0xf133('0xb1'),{'UserId':_0x4a708d[_0xf133('0x5f')]['ids'][_0x5854e7],'OpenchannelAccountId':_0x4a708d[_0xf133('0x56')]['id']});}return _0x1b81f4;});}})['then'](respondWithResult(_0xa3eab,null))[_0xf133('0x2a')](handleError(_0xa3eab,null));};exports[_0xf133('0xb2')]=function(_0x556a2e,_0x1ab95c,_0x4d5b41){return db['OpenchannelAccount'][_0xf133('0x58')]({'where':{'id':_0x556a2e[_0xf133('0x56')]['id']}})[_0xf133('0x1f')](handleEntityNotFound(_0x1ab95c,null))[_0xf133('0x1f')](function(_0x2068eb){if(_0x2068eb){return _0x2068eb[_0xf133('0xb2')](_0x556a2e[_0xf133('0x41')][_0xf133('0x6c')])[_0xf133('0x1f')](function(){if(_[_0xf133('0xb3')](_0x556a2e[_0xf133('0x41')][_0xf133('0x6c')])){for(var _0x5f159c=0x0;_0x5f159c<_0x556a2e[_0xf133('0x41')][_0xf133('0x6c')][_0xf133('0x44')];_0x5f159c+=0x1){socket[_0xf133('0xb0')](_0xf133('0xb4'),{'UserId':Number(_0x556a2e['query'][_0xf133('0x6c')][_0x5f159c]),'OpenchannelAccountId':Number(_0x556a2e[_0xf133('0x56')]['id'])});}}else{socket[_0xf133('0xb0')]('userOpenchannelAccount:remove',{'UserId':Number(_0x556a2e[_0xf133('0x41')][_0xf133('0x6c')]),'OpenchannelAccountId':Number(_0x556a2e[_0xf133('0x56')]['id'])});}});}})[_0xf133('0x1f')](respondWithStatusCode(_0x1ab95c,null))[_0xf133('0x2a')](handleError(_0x1ab95c,null));};exports['getAgents']=function(_0x4299c7,_0x47b9cd,_0x2ef409){var _0xd2291={};var _0x575f01={};var _0x26c548;var _0x31d66b;return db[_0xf133('0x3d')][_0xf133('0x64')]({'where':{'id':_0x4299c7[_0xf133('0x56')]['id']}})[_0xf133('0x1f')](handleEntityNotFound(_0x47b9cd,null))[_0xf133('0x1f')](function(_0x2c2964){if(_0x2c2964){_0x26c548=_0x2c2964;_0x575f01[_0xf133('0x3f')]=_[_0xf133('0x40')](db[_0xf133('0xa8')][_0xf133('0x3e')]);_0x575f01[_0xf133('0x41')]=_['keys'](_0x4299c7[_0xf133('0x41')]);_0x575f01[_0xf133('0x48')]=_[_0xf133('0x57')](_0x575f01[_0xf133('0x3f')],_0x575f01[_0xf133('0x41')]);_0xd2291[_0xf133('0x42')]=_[_0xf133('0x57')](_0x575f01['model'],qs['fields'](_0x4299c7[_0xf133('0x41')][_0xf133('0x43')]));_0xd2291['attributes']=_0xd2291[_0xf133('0x42')][_0xf133('0x44')]?_0xd2291[_0xf133('0x42')]:_0x575f01['model'];_0xd2291[_0xf133('0x65')]=qs[_0xf133('0x46')](_0x4299c7[_0xf133('0x41')][_0xf133('0x46')]);_0xd2291[_0xf133('0x47')]=qs[_0xf133('0x48')](_[_0xf133('0x49')](_0x4299c7[_0xf133('0x41')],_0x575f01[_0xf133('0x48')]));if(_0x4299c7[_0xf133('0x41')][_0xf133('0x4a')]){_0xd2291[_0xf133('0x47')]=_[_0xf133('0x4b')](_0xd2291[_0xf133('0x47')],{'$or':_['map'](_0xd2291[_0xf133('0x42')],function(_0xe0689d){var _0x3dca4b={};_0x3dca4b[_0xe0689d]={'$like':'%'+_0x4299c7[_0xf133('0x41')]['filter']+'%'};return _0x3dca4b;})});}_0xd2291=_[_0xf133('0x4b')]({},_0xd2291,_0x4299c7['options']);return _0x26c548[_0xf133('0xb5')](_0xd2291);}})[_0xf133('0x1f')](function(_0x32142a){if(_0x32142a){_0x31d66b=_0x32142a[_0xf133('0x44')];if(!_0x4299c7[_0xf133('0x41')]['hasOwnProperty'](_0xf133('0xb6'))){_0xd2291['limit']=qs[_0xf133('0x30')](_0x4299c7[_0xf133('0x41')]['limit']);_0xd2291['offset']=qs[_0xf133('0x2f')](_0x4299c7[_0xf133('0x41')]['offset']);}return _0x26c548[_0xf133('0xb5')](_0xd2291);}})['then'](function(_0x32bc62){if(_0x32bc62){return _0x32bc62?{'count':_0x31d66b,'rows':_0x32bc62}:null;}})[_0xf133('0x1f')](respondWithResult(_0x47b9cd,null))[_0xf133('0x2a')](handleError(_0x47b9cd,null));};exports[_0xf133('0x39')]=function(_0x12f6b0,_0x2cd0ec,_0x19e1b6){var _0x3205ec,_0x2c933d,_0x36ff6f;if(_[_0xf133('0x77')](_0x12f6b0[_0xf133('0x5f')][_0xf133('0x5f')])||_0x12f6b0[_0xf133('0x5f')][_0xf133('0x5f')]===''){throw new db[(_0xf133('0x6f'))][(_0xf133('0x75'))](_0xf133('0x76'));}if(_['isNil'](_0x12f6b0[_0xf133('0x5f')]['to'])){}_0x3205ec=_0x12f6b0[_0xf133('0x5f')]['to'];return db[_0xf133('0x3d')]['findOne']({'where':{'id':_0x12f6b0[_0xf133('0x56')]['id']}})[_0xf133('0x1f')](handleEntityNotFound(_0x2cd0ec,null))['then'](function(_0x2c33c8){if(_0x2c33c8){return db[_0xf133('0x3d')][_0xf133('0x58')]({'where':{'id':_0x2c33c8['id']},'include':[{'model':db[_0xf133('0x7c')],'as':'List','include':[{'model':db[_0xf133('0x6e')],'as':'Contacts','where':{[_0x2c33c8[_0xf133('0x78')]]:_0x3205ec},'limit':0x1,'order':[[_0xf133('0x72'),_0xf133('0x7e')]]}]}]})[_0xf133('0x1f')](handleEntityNotFound(_0x2cd0ec,null))[_0xf133('0x1f')](function(_0x58717a){if(_0x58717a&&_0x58717a[_0xf133('0x80')]){_0x2c933d=_0x58717a['get']({'plain':!![]});if(_0x2c933d['List']&&_0x2c933d[_0xf133('0x80')][_0xf133('0x7d')][_0xf133('0x44')]){return _0x2c933d[_0xf133('0x80')][_0xf133('0x7d')][0x0];}return db[_0xf133('0x6e')]['create'](_[_0xf133('0x17')](_0x12f6b0[_0xf133('0x5f')],{'firstName':_0x3205ec,[_0x58717a[_0xf133('0x78')]]:_0x3205ec,'phone':_0x3205ec,'ListId':_0x2c933d[_0xf133('0x87')]}));}})[_0xf133('0x1f')](handleEntityNotFound(_0x2cd0ec,null))['then'](function(_0x14ee05){if(_0x14ee05){_0x36ff6f=_0x14ee05;return db[_0xf133('0x8b')]['find']({'where':{'ContactId':_0x36ff6f['id'],'closed':![],'OpenchannelAccountId':_0x2c933d['id']}})[_0xf133('0x1f')](function(_0x740b24){if(_0x740b24){return[_0x740b24,![]];}return db[_0xf133('0x8b')][_0xf133('0x59')]({'UserId':_0x12f6b0[_0xf133('0x5a')]['id'],'ContactId':_0x36ff6f['id'],'OpenchannelAccountId':_0x2c933d['id'],'lastMsgDirection':'out','Messages':[_[_0xf133('0x4b')](_0x12f6b0[_0xf133('0x5f')],{'read':![],'body':_0x12f6b0[_0xf133('0x5f')][_0xf133('0x5f')],'OpenchannelAccountId':_0x2c933d['id'],'UserId':_0x12f6b0[_0xf133('0x5a')]['id'],'ContactId':_0x36ff6f['id']})]},{'include':[{'model':db[_0xf133('0x96')],'as':_0xf133('0xb7')}]})['then'](function(_0x2dd129){return[_0x2dd129,!![]];});});}})['spread'](function(_0x364975,_0x3a75b5){if(_0x3a75b5){return _0x364975;}return db[_0xf133('0x96')][_0xf133('0x59')](_[_0xf133('0x4b')](_0x12f6b0['body'],{'read':![],'body':_0x12f6b0[_0xf133('0x5f')][_0xf133('0x5f')],'OpenchannelAccountId':_0x2c933d['id'],'OpenchannelInteractionId':_0x364975['id'],'UserId':_0x12f6b0[_0xf133('0x5a')]['id'],'ContactId':_0x36ff6f['id']}))['then'](function(_0x419b7a){_0x364975[_0xf133('0xb8')][_0xf133('0xb7')]=[];_0x364975['dataValues'][_0xf133('0xb7')][_0xf133('0x93')](_0x419b7a[_0xf133('0xb8')]);return _0x364975;});});}})[_0xf133('0x1f')](respondWithResult(_0x2cd0ec,null))['catch'](handleError(_0x2cd0ec,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 1652800..3f12ff7 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 _0xdb29=['events','../../mysqldb','setMaxListeners','save','update','emit','hook'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xdb29,0xee));var _0x9db2=function(_0x44bebf,_0x20d8b4){_0x44bebf=_0x44bebf-0x0;var _0x5a84ed=_0xdb29[_0x44bebf];return _0x5a84ed;};'use strict';var EventEmitter=require(_0x9db2('0x0'));var OpenchannelAccount=require(_0x9db2('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x9db2('0x2')](0x0);var events={'afterCreate':_0x9db2('0x3'),'afterUpdate':_0x9db2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x97df94){return function(_0x3859d5,_0xe83baf,_0x19289d){OpenchannelAccountEvents[_0x9db2('0x5')](_0x97df94+':'+_0x3859d5['id'],_0x3859d5);OpenchannelAccountEvents['emit'](_0x97df94,_0x3859d5);_0x19289d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x9db2('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0x7510=['setMaxListeners','save','update','hook','../../mysqldb'];(function(_0x9729d7,_0x1b79a8){var _0x3c4ac6=function(_0x401ba6){while(--_0x401ba6){_0x9729d7['push'](_0x9729d7['shift']());}};_0x3c4ac6(++_0x1b79a8);}(_0x7510,0xa9));var _0x0751=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7510[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x0751('0x0'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x0751('0x1')](0x0);var events={'afterCreate':_0x0751('0x2'),'afterUpdate':_0x0751('0x3'),'afterDestroy':'remove'};function emitEvent(_0x387016){return function(_0x2021d5,_0xb9b194,_0x5de74a){OpenchannelAccountEvents['emit'](_0x387016+':'+_0x2021d5['id'],_0x2021d5);OpenchannelAccountEvents['emit'](_0x387016,_0x2021d5);_0x5de74a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x0751('0x4')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index d801ad3..f507eb5 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 _0x741c=['../../config/logger','api','moment','bluebird','rimraf','./openchannelAccount.attributes','exports','define','OpenchannelAccount','openchannel_accounts','lodash','util'];(function(_0x5189e3,_0x5711dd){var _0x183e3c=function(_0x54cb5e){while(--_0x54cb5e){_0x5189e3['push'](_0x5189e3['shift']());}};_0x183e3c(++_0x5711dd);}(_0x741c,0x196));var _0xc741=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x741c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc741('0x0'));var util=require(_0xc741('0x1'));var logger=require(_0xc741('0x2'))(_0xc741('0x3'));var moment=require(_0xc741('0x4'));var BPromise=require(_0xc741('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc741('0x6'));var config=require('../../config/environment');var attributes=require(_0xc741('0x7'));module[_0xc741('0x8')]=function(_0x3708ae,_0x133bc4){return _0x3708ae[_0xc741('0x9')](_0xc741('0xa'),attributes,{'tableName':_0xc741('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14c2=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelAccount.attributes','exports','define','openchannel_accounts','lodash'];(function(_0x1553cd,_0x5e72c8){var _0x47eeaa=function(_0x1566dc){while(--_0x1566dc){_0x1553cd['push'](_0x1553cd['shift']());}};_0x47eeaa(++_0x5e72c8);}(_0x14c2,0x180));var _0x214c=function(_0xeccd6f,_0x5d0090){_0xeccd6f=_0xeccd6f-0x0;var _0x590758=_0x14c2[_0xeccd6f];return _0x590758;};'use strict';var _=require(_0x214c('0x0'));var util=require('util');var logger=require(_0x214c('0x1'))('api');var moment=require(_0x214c('0x2'));var BPromise=require(_0x214c('0x3'));var rp=require(_0x214c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x214c('0x5'));var config=require(_0x214c('0x6'));var attributes=require(_0x214c('0x7'));module[_0x214c('0x8')]=function(_0x18f1e6,_0x1f264e){return _0x18f1e6[_0x214c('0x9')]('OpenchannelAccount',attributes,{'tableName':_0x214c('0xa'),'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 44adab8..105d333 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 _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring'];(function(_0x594b52,_0x232e60){var _0x36b369=function(_0x5b421e){while(--_0x5b421e){_0x594b52['push'](_0x594b52['shift']());}};_0x36b369(++_0x232e60);}(_0xe14b,0x93));var _0xbe14=function(_0x1e9149,_0xef135d){_0x1e9149=_0x1e9149-0x0;var _0x506560=_0xe14b[_0x1e9149];return _0x506560;};'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});config[_0xbe14('0x9')]=_[_0xbe14('0xa')](config[_0xbe14('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbe14('0xb'))[_0xbe14('0xc')](socket);function respondWithRpcPromise(_0xd68cd7,_0x90b4f,_0x53c7ea){return new BPromise(function(_0x5b9fc6,_0x113243){return client[_0xbe14('0xd')](_0xd68cd7,_0x53c7ea)['then'](function(_0x254c3b){logger[_0xbe14('0xe')](_0xbe14('0xf'),_0x90b4f,_0xbe14('0x10'));logger[_0xbe14('0x11')](_0xbe14('0x12'),_0x90b4f,_0xbe14('0x10'),JSON[_0xbe14('0x13')](_0x254c3b));if(_0x254c3b[_0xbe14('0x14')]){if(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x15')]===0x1f4){logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x254c3b['error']['message']);return _0x113243(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x16')]);}logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x254c3b['error'][_0xbe14('0x16')]);return _0x5b9fc6(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x16')]);}else{logger[_0xbe14('0xe')](_0xbe14('0xf'),_0x90b4f,_0xbe14('0x10'));_0x5b9fc6(_0x254c3b[_0xbe14('0x17')]['message']);}})[_0xbe14('0x18')](function(_0x456ca8){logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x456ca8);_0x113243(_0x456ca8);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','lodash','util','moment'];(function(_0x251d9c,_0x580977){var _0x16ae64=function(_0x4d3b53){while(--_0x4d3b53){_0x251d9c['push'](_0x251d9c['shift']());}};_0x16ae64(++_0x580977);}(_0x2ef3,0xba));var _0x32ef=function(_0x2da1f7,_0x233c1c){_0x2da1f7=_0x2da1f7-0x0;var _0x11f0b5=_0x2ef3[_0x2da1f7];return _0x11f0b5;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 861491f..38564ff 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 _0x8a0b=['length','openchannelAccount:','./openchannelAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x2a4b6c,_0x2cac39){var _0x3daa18=function(_0xd7a988){while(--_0xd7a988){_0x2a4b6c['push'](_0x2a4b6c['shift']());}};_0x3daa18(++_0x2cac39);}(_0x8a0b,0x134));var _0xb8a0=function(_0x32f1b0,_0x520172){_0x32f1b0=_0x32f1b0-0x0;var _0x3aee8c=_0x8a0b[_0x32f1b0];return _0x3aee8c;};'use strict';var OpenchannelAccountEvents=require(_0xb8a0('0x0'));var events=[_0xb8a0('0x1'),_0xb8a0('0x2'),_0xb8a0('0x3')];function createListener(_0x43d4d3,_0x4e96e8){return function(_0x1bf4e3){_0x4e96e8[_0xb8a0('0x4')](_0x43d4d3,_0x1bf4e3);};}function removeListener(_0x4a2791,_0x3c93ec){return function(){OpenchannelAccountEvents[_0xb8a0('0x5')](_0x4a2791,_0x3c93ec);};}exports[_0xb8a0('0x6')]=function(_0x170fbe){for(var _0x2eaae2=0x0,_0x17821d=events[_0xb8a0('0x7')];_0x2eaae2<_0x17821d;_0x2eaae2++){var _0x5ac2dd=events[_0x2eaae2];var _0x2662af=createListener(_0xb8a0('0x8')+_0x5ac2dd,_0x170fbe);OpenchannelAccountEvents['on'](_0x5ac2dd,_0x2662af);}}; \ No newline at end of file +var _0x4e33=['update','emit','removeListener','register','./openchannelAccount.events','remove'];(function(_0x23c0f6,_0x298704){var _0x54f052=function(_0x284673){while(--_0x284673){_0x23c0f6['push'](_0x23c0f6['shift']());}};_0x54f052(++_0x298704);}(_0x4e33,0xe2));var _0x34e3=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x4e33[_0x2555d0];return _0x3bb486;};'use strict';var OpenchannelAccountEvents=require(_0x34e3('0x0'));var events=['save',_0x34e3('0x1'),_0x34e3('0x2')];function createListener(_0x6c7bdd,_0x4790d8){return function(_0x2af430){_0x4790d8[_0x34e3('0x3')](_0x6c7bdd,_0x2af430);};}function removeListener(_0x3a7bc8,_0x115ed6){return function(){OpenchannelAccountEvents[_0x34e3('0x4')](_0x3a7bc8,_0x115ed6);};}exports[_0x34e3('0x5')]=function(_0x40a04b){for(var _0x2a38dc=0x0,_0x1b8a1c=events['length'];_0x2a38dc<_0x1b8a1c;_0x2a38dc++){var _0x266cd9=events[_0x2a38dc];var _0x1f3696=createListener('openchannelAccount:'+_0x266cd9,_0x40a04b);OpenchannelAccountEvents['on'](_0x266cd9,_0x1f3696);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 885d894..f6ebfab 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 _0x6016=['../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','get','isAuthenticated','/:id','show','post','create','put','destroy','exports','util','path'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0x6016,0x132));var _0x6601=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0x6016[_0x4c7935];return _0x30651d;};'use strict';var multer=require('multer');var util=require(_0x6601('0x0'));var path=require(_0x6601('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x6601('0x2'));var interaction=require(_0x6601('0x3'));var config=require('../../config/environment');var controller=require(_0x6601('0x4'));router[_0x6601('0x5')]('/',auth[_0x6601('0x6')](),controller['index']);router['get'](_0x6601('0x7'),auth[_0x6601('0x6')](),controller[_0x6601('0x8')]);router[_0x6601('0x9')]('/',auth[_0x6601('0x6')](),controller[_0x6601('0xa')]);router[_0x6601('0xb')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x6601('0x7'),auth['isAuthenticated'](),controller[_0x6601('0xc')]);module[_0x6601('0xd')]=router; \ No newline at end of file +var _0xa39c=['create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x900ef5,_0x185f71){var _0x5931c4=function(_0x34d398){while(--_0x34d398){_0x900ef5['push'](_0x900ef5['shift']());}};_0x5931c4(++_0x185f71);}(_0xa39c,0xa5));var _0xca39=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xa39c[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0xca39('0x0'));var util=require(_0xca39('0x1'));var path=require(_0xca39('0x2'));var timeout=require(_0xca39('0x3'));var express=require(_0xca39('0x4'));var router=express[_0xca39('0x5')]();var auth=require(_0xca39('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xca39('0x7'));var controller=require(_0xca39('0x8'));router[_0xca39('0x9')]('/',auth[_0xca39('0xa')](),controller[_0xca39('0xb')]);router['get'](_0xca39('0xc'),auth[_0xca39('0xa')](),controller[_0xca39('0xd')]);router[_0xca39('0xe')]('/',auth[_0xca39('0xa')](),controller[_0xca39('0xf')]);router[_0xca39('0x10')](_0xca39('0xc'),auth[_0xca39('0xa')](),controller[_0xca39('0x11')]);router['delete'](_0xca39('0xc'),auth[_0xca39('0xa')](),controller[_0xca39('0x12')]);module[_0xca39('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 970dd73..d03c411 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 _0xb114=['TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x41b2ca,_0x1e7e52){var _0x2ec07c=function(_0x125c7c){while(--_0x125c7c){_0x41b2ca['push'](_0x41b2ca['shift']());}};_0x2ec07c(++_0x1e7e52);}(_0xb114,0x11f));var _0x4b11=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0xb114[_0x397cfb];return _0x15fed9;};'use strict';var Sequelize=require(_0x4b11('0x0'));module['exports']={'priority':{'type':Sequelize[_0x4b11('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x4b11('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x4b11('0x3')]()},'description':{'type':Sequelize[_0x4b11('0x2')]},'interval':{'type':Sequelize[_0x4b11('0x2')],'defaultValue':_0x4b11('0x4')}}; \ No newline at end of file +var _0x4c84=['TEXT','STRING','exports','INTEGER','noop'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x4c84,0x124));var _0x44c8=function(_0x39276b,_0x23e1bb){_0x39276b=_0x39276b-0x0;var _0x4df9ae=_0x4c84[_0x39276b];return _0x4df9ae;};'use strict';var Sequelize=require('sequelize');module[_0x44c8('0x0')]={'priority':{'type':Sequelize[_0x44c8('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x44c8('0x2')},'appdata':{'type':Sequelize[_0x44c8('0x3')]()},'description':{'type':Sequelize[_0x44c8('0x4')]},'interval':{'type':Sequelize[_0x44c8('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index de27642..4ce4ba7 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 _0xa631=['keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','type','field','filter','options','count','includeAll','rows','params','include','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','OpenchannelApplication','rawAttributes','model'];(function(_0x136930,_0x29ca79){var _0x17509e=function(_0x5264d4){while(--_0x5264d4){_0x136930['push'](_0x136930['shift']());}};_0x17509e(++_0x29ca79);}(_0xa631,0xe4));var _0x1a63=function(_0x725e86,_0x199a12){_0x725e86=_0x725e86-0x0;var _0x311d5f=_0xa631[_0x725e86];return _0x311d5f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1a63('0x0'));var rimraf=require(_0x1a63('0x1'));var zipdir=require(_0x1a63('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a63('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1a63('0x4'));var util=require(_0x1a63('0x5'));var path=require(_0x1a63('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x1a63('0x7'));var crypto=require(_0x1a63('0x8'));var jsforce=require(_0x1a63('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1a63('0xa'));var Papa=require(_0x1a63('0xb'));var Redis=require(_0x1a63('0xc'));var authService=require(_0x1a63('0xd'));var qs=require(_0x1a63('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a63('0xf'))(_0x1a63('0x10'));var utils=require(_0x1a63('0x11'));var config=require(_0x1a63('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c7e4f,_0x199c92){_0x199c92=_0x199c92||0xcc;return function(_0x32269d){if(_0x32269d){return _0x1c7e4f['sendStatus'](_0x199c92);}return _0x1c7e4f[_0x1a63('0x13')](_0x199c92)['end']();};}function respondWithResult(_0x169244,_0x4485ea){_0x4485ea=_0x4485ea||0xc8;return function(_0x44bf20){if(_0x44bf20){return _0x169244['status'](_0x4485ea)['json'](_0x44bf20);}};}function respondWithFilteredResult(_0x2bf124,_0x1cd772){return function(_0x436623){if(_0x436623){var _0x3756e2=_0x436623['count'],_0x1c1e8c=_0x1cd772[_0x1a63('0x14')],_0x4d66d4=_0x1cd772[_0x1a63('0x14')]+_0x1cd772[_0x1a63('0x15')],_0x3bf64a;if(_0x4d66d4>=_0x3756e2){_0x4d66d4=_0x3756e2;_0x3bf64a=0xc8;}else{_0x3bf64a=0xce;}_0x2bf124[_0x1a63('0x13')](_0x3bf64a);return _0x2bf124[_0x1a63('0x16')](_0x1a63('0x17'),_0x1c1e8c+'-'+_0x4d66d4+'/'+_0x3756e2)[_0x1a63('0x18')](_0x436623);}return null;};}function patchUpdates(_0x41c13e){return function(_0x3feaa5){try{jsonpatch[_0x1a63('0x19')](_0x3feaa5,_0x41c13e,!![]);}catch(_0x491c8a){return BPromise[_0x1a63('0x1a')](_0x491c8a);}return _0x3feaa5[_0x1a63('0x1b')]();};}function saveUpdates(_0x5d9c00,_0x3d6668){return function(_0x444406){if(_0x444406){return _0x444406[_0x1a63('0x1c')](_0x5d9c00)[_0x1a63('0x1d')](function(_0x24646d){return _0x24646d;});}return null;};}function removeEntity(_0x2a0a4,_0x4f8af5){return function(_0x547d78){if(_0x547d78){return _0x547d78[_0x1a63('0x1e')]()['then'](function(){_0x2a0a4[_0x1a63('0x13')](0xcc)[_0x1a63('0x1f')]();});}};}function handleEntityNotFound(_0x529be7,_0x564f9a){return function(_0x58ff2){if(!_0x58ff2){_0x529be7[_0x1a63('0x20')](0x194);}return _0x58ff2;};}function handleError(_0x6b097c,_0x1827ff){_0x1827ff=_0x1827ff||0x1f4;return function(_0x1a5a18){logger['error'](_0x1a5a18[_0x1a63('0x21')]);if(_0x1a5a18[_0x1a63('0x22')]){delete _0x1a5a18[_0x1a63('0x22')];}_0x6b097c['status'](_0x1827ff)[_0x1a63('0x23')](_0x1a5a18);};}exports[_0x1a63('0x24')]=function(_0x81548f,_0x306dd4){var _0x53867d={},_0x4a7ffc={},_0x339f0d={'count':0x0,'rows':[]};var _0x358dc8=db[_0x1a63('0x25')][_0x1a63('0x26')];_0x4a7ffc[_0x1a63('0x27')]=_[_0x1a63('0x28')](_0x358dc8);_0x4a7ffc['query']=_[_0x1a63('0x28')](_0x81548f['query']);_0x4a7ffc[_0x1a63('0x29')]=_[_0x1a63('0x2a')](_0x4a7ffc['model'],_0x4a7ffc[_0x1a63('0x2b')]);_0x53867d[_0x1a63('0x2c')]=_[_0x1a63('0x2a')](_0x4a7ffc[_0x1a63('0x27')],qs['fields'](_0x81548f['query'][_0x1a63('0x2d')]));_0x53867d[_0x1a63('0x2c')]=_0x53867d['attributes'][_0x1a63('0x2e')]?_0x53867d[_0x1a63('0x2c')]:_0x4a7ffc[_0x1a63('0x27')];if(!_0x81548f[_0x1a63('0x2b')][_0x1a63('0x2f')](_0x1a63('0x30'))){_0x53867d['limit']=qs[_0x1a63('0x15')](_0x81548f[_0x1a63('0x2b')][_0x1a63('0x15')]);_0x53867d[_0x1a63('0x14')]=qs['offset'](_0x81548f['query'][_0x1a63('0x14')]);}_0x53867d['order']=qs[_0x1a63('0x31')](_0x81548f['query'][_0x1a63('0x31')]);_0x53867d[_0x1a63('0x32')]=qs['filters'](_[_0x1a63('0x33')](_0x81548f[_0x1a63('0x2b')],_0x4a7ffc[_0x1a63('0x29')]));if(_0x81548f[_0x1a63('0x2b')]['filter']){_0x53867d[_0x1a63('0x32')]=_[_0x1a63('0x34')](_0x53867d[_0x1a63('0x32')],{'$or':_[_0x1a63('0x35')](_0x358dc8,function(_0x3954a6){if(_0x3954a6[_0x1a63('0x36')]['key']!=='VIRTUAL'){var _0x3fbafe={};_0x3fbafe[_0x3954a6[_0x1a63('0x37')]]={'$like':'%'+_0x81548f[_0x1a63('0x2b')][_0x1a63('0x38')]+'%'};return _0x3fbafe;}})});}_0x53867d=_[_0x1a63('0x34')]({},_0x53867d,_0x81548f[_0x1a63('0x39')]);var _0x5b6b56={'where':_0x53867d[_0x1a63('0x32')]};return db['OpenchannelApplication']['count'](_0x5b6b56)['then'](function(_0x49232e){_0x339f0d[_0x1a63('0x3a')]=_0x49232e;if(_0x81548f['query'][_0x1a63('0x3b')]){_0x53867d['include']=[{'all':!![]}];}return db[_0x1a63('0x25')]['findAll'](_0x53867d);})[_0x1a63('0x1d')](function(_0xe9c655){_0x339f0d[_0x1a63('0x3c')]=_0xe9c655;return _0x339f0d;})['then'](respondWithFilteredResult(_0x306dd4,_0x53867d))['catch'](handleError(_0x306dd4,null));};exports['show']=function(_0x51c72f,_0x580573){var _0x361208={'raw':!![],'where':{'id':_0x51c72f[_0x1a63('0x3d')]['id']}},_0x3ac0d9={};_0x3ac0d9['model']=_['keys'](db['OpenchannelApplication']['rawAttributes']);_0x3ac0d9['query']=_[_0x1a63('0x28')](_0x51c72f[_0x1a63('0x2b')]);_0x3ac0d9['filters']=_[_0x1a63('0x2a')](_0x3ac0d9['model'],_0x3ac0d9['query']);_0x361208[_0x1a63('0x2c')]=_[_0x1a63('0x2a')](_0x3ac0d9[_0x1a63('0x27')],qs[_0x1a63('0x2d')](_0x51c72f['query'][_0x1a63('0x2d')]));_0x361208[_0x1a63('0x2c')]=_0x361208[_0x1a63('0x2c')][_0x1a63('0x2e')]?_0x361208[_0x1a63('0x2c')]:_0x3ac0d9[_0x1a63('0x27')];if(_0x51c72f[_0x1a63('0x2b')][_0x1a63('0x3b')]){_0x361208[_0x1a63('0x3e')]=[{'all':!![]}];}_0x361208=_[_0x1a63('0x34')]({},_0x361208,_0x51c72f['options']);return db[_0x1a63('0x25')][_0x1a63('0x3f')](_0x361208)[_0x1a63('0x1d')](handleEntityNotFound(_0x580573,null))[_0x1a63('0x1d')](respondWithResult(_0x580573,null))[_0x1a63('0x40')](handleError(_0x580573,null));};exports[_0x1a63('0x41')]=function(_0x32132c,_0x47bbc5){return db[_0x1a63('0x25')][_0x1a63('0x41')](_0x32132c[_0x1a63('0x42')],{})[_0x1a63('0x1d')](respondWithResult(_0x47bbc5,0xc9))[_0x1a63('0x40')](handleError(_0x47bbc5,null));};exports[_0x1a63('0x1c')]=function(_0x1e3620,_0x39b61f){if(_0x1e3620[_0x1a63('0x42')]['id']){delete _0x1e3620[_0x1a63('0x42')]['id'];}return db[_0x1a63('0x25')][_0x1a63('0x3f')]({'where':{'id':_0x1e3620[_0x1a63('0x3d')]['id']}})[_0x1a63('0x1d')](handleEntityNotFound(_0x39b61f,null))[_0x1a63('0x1d')](saveUpdates(_0x1e3620[_0x1a63('0x42')],null))['then'](respondWithResult(_0x39b61f,null))['catch'](handleError(_0x39b61f,null));};exports['destroy']=function(_0x28dd93,_0x1d37ee){return db['OpenchannelApplication'][_0x1a63('0x3f')]({'where':{'id':_0x28dd93[_0x1a63('0x3d')]['id']}})[_0x1a63('0x1d')](handleEntityNotFound(_0x1d37ee,null))['then'](removeEntity(_0x1d37ee,null))[_0x1a63('0x40')](handleError(_0x1d37ee,null));}; \ No newline at end of file +var _0xf874=['query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','OpenchannelApplication','findAll','rows','show','params','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','send','index','rawAttributes','model','keys'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf874,0xed));var _0x4f87=function(_0x403563,_0x16b4fc){_0x403563=_0x403563-0x0;var _0x44e1c5=_0xf874[_0x403563];return _0x44e1c5;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x4f87('0x0'));var zipdir=require(_0x4f87('0x1'));var jsonpatch=require(_0x4f87('0x2'));var rp=require(_0x4f87('0x3'));var moment=require(_0x4f87('0x4'));var BPromise=require(_0x4f87('0x5'));var Mustache=require('mustache');var util=require(_0x4f87('0x6'));var path=require(_0x4f87('0x7'));var sox=require(_0x4f87('0x8'));var csv=require(_0x4f87('0x9'));var ejs=require(_0x4f87('0xa'));var fs=require('fs');var _=require(_0x4f87('0xb'));var squel=require('squel');var crypto=require(_0x4f87('0xc'));var jsforce=require(_0x4f87('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4f87('0x9'));var querystring=require(_0x4f87('0xe'));var Papa=require('papaparse');var Redis=require(_0x4f87('0xf'));var authService=require(_0x4f87('0x10'));var qs=require(_0x4f87('0x11'));var hardwareService=require(_0x4f87('0x12'));var logger=require(_0x4f87('0x13'))(_0x4f87('0x14'));var utils=require(_0x4f87('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b5c2c,_0x285481){_0x285481=_0x285481||0xcc;return function(_0x107d98){if(_0x107d98){return _0x1b5c2c['sendStatus'](_0x285481);}return _0x1b5c2c['status'](_0x285481)[_0x4f87('0x16')]();};}function respondWithResult(_0x430bc4,_0x3c4afd){_0x3c4afd=_0x3c4afd||0xc8;return function(_0x482c6e){if(_0x482c6e){return _0x430bc4[_0x4f87('0x17')](_0x3c4afd)['json'](_0x482c6e);}};}function respondWithFilteredResult(_0x3d6dcb,_0x341a16){return function(_0x4ea72f){if(_0x4ea72f){var _0x2907f6=_0x4ea72f[_0x4f87('0x18')],_0x325edc=_0x341a16[_0x4f87('0x19')],_0xa47360=_0x341a16['offset']+_0x341a16[_0x4f87('0x1a')],_0x405538;if(_0xa47360>=_0x2907f6){_0xa47360=_0x2907f6;_0x405538=0xc8;}else{_0x405538=0xce;}_0x3d6dcb['status'](_0x405538);return _0x3d6dcb[_0x4f87('0x1b')](_0x4f87('0x1c'),_0x325edc+'-'+_0xa47360+'/'+_0x2907f6)[_0x4f87('0x1d')](_0x4ea72f);}return null;};}function patchUpdates(_0x42c399){return function(_0x12fd80){try{jsonpatch[_0x4f87('0x1e')](_0x12fd80,_0x42c399,!![]);}catch(_0x36cd37){return BPromise[_0x4f87('0x1f')](_0x36cd37);}return _0x12fd80[_0x4f87('0x20')]();};}function saveUpdates(_0x207d3a,_0x25b2ba){return function(_0x2c13a0){if(_0x2c13a0){return _0x2c13a0[_0x4f87('0x21')](_0x207d3a)['then'](function(_0x47ed1e){return _0x47ed1e;});}return null;};}function removeEntity(_0x3cb630,_0x81104d){return function(_0x5bc73b){if(_0x5bc73b){return _0x5bc73b['destroy']()[_0x4f87('0x22')](function(){_0x3cb630['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x401cd6,_0x3c4450){return function(_0x2a382c){if(!_0x2a382c){_0x401cd6[_0x4f87('0x23')](0x194);}return _0x2a382c;};}function handleError(_0x17bdbd,_0x45802c){_0x45802c=_0x45802c||0x1f4;return function(_0x197f44){logger['error'](_0x197f44[_0x4f87('0x24')]);if(_0x197f44[_0x4f87('0x25')]){delete _0x197f44[_0x4f87('0x25')];}_0x17bdbd['status'](_0x45802c)[_0x4f87('0x26')](_0x197f44);};}exports[_0x4f87('0x27')]=function(_0x51b8dd,_0x19e3ba){var _0xe299f1={},_0x3eab48={},_0x41e940={'count':0x0,'rows':[]};var _0x4b4daf=db['OpenchannelApplication'][_0x4f87('0x28')];_0x3eab48[_0x4f87('0x29')]=_[_0x4f87('0x2a')](_0x4b4daf);_0x3eab48[_0x4f87('0x2b')]=_[_0x4f87('0x2a')](_0x51b8dd['query']);_0x3eab48[_0x4f87('0x2c')]=_['intersection'](_0x3eab48[_0x4f87('0x29')],_0x3eab48[_0x4f87('0x2b')]);_0xe299f1[_0x4f87('0x2d')]=_[_0x4f87('0x2e')](_0x3eab48[_0x4f87('0x29')],qs[_0x4f87('0x2f')](_0x51b8dd[_0x4f87('0x2b')]['fields']));_0xe299f1[_0x4f87('0x2d')]=_0xe299f1['attributes'][_0x4f87('0x30')]?_0xe299f1[_0x4f87('0x2d')]:_0x3eab48[_0x4f87('0x29')];if(!_0x51b8dd[_0x4f87('0x2b')][_0x4f87('0x31')](_0x4f87('0x32'))){_0xe299f1[_0x4f87('0x1a')]=qs[_0x4f87('0x1a')](_0x51b8dd[_0x4f87('0x2b')][_0x4f87('0x1a')]);_0xe299f1[_0x4f87('0x19')]=qs[_0x4f87('0x19')](_0x51b8dd['query'][_0x4f87('0x19')]);}_0xe299f1[_0x4f87('0x33')]=qs['sort'](_0x51b8dd[_0x4f87('0x2b')][_0x4f87('0x34')]);_0xe299f1[_0x4f87('0x35')]=qs['filters'](_[_0x4f87('0x36')](_0x51b8dd[_0x4f87('0x2b')],_0x3eab48['filters']));if(_0x51b8dd[_0x4f87('0x2b')]['filter']){_0xe299f1[_0x4f87('0x35')]=_[_0x4f87('0x37')](_0xe299f1[_0x4f87('0x35')],{'$or':_['map'](_0x4b4daf,function(_0x2b99fa){if(_0x2b99fa['type']['key']!==_0x4f87('0x38')){var _0x139484={};_0x139484[_0x2b99fa['field']]={'$like':'%'+_0x51b8dd[_0x4f87('0x2b')][_0x4f87('0x39')]+'%'};return _0x139484;}})});}_0xe299f1=_[_0x4f87('0x37')]({},_0xe299f1,_0x51b8dd[_0x4f87('0x3a')]);var _0x5d6ddb={'where':_0xe299f1['where']};return db['OpenchannelApplication']['count'](_0x5d6ddb)[_0x4f87('0x22')](function(_0x44a0c1){_0x41e940['count']=_0x44a0c1;if(_0x51b8dd[_0x4f87('0x2b')][_0x4f87('0x3b')]){_0xe299f1[_0x4f87('0x3c')]=[{'all':!![]}];}return db[_0x4f87('0x3d')][_0x4f87('0x3e')](_0xe299f1);})[_0x4f87('0x22')](function(_0x5cba2c){_0x41e940[_0x4f87('0x3f')]=_0x5cba2c;return _0x41e940;})[_0x4f87('0x22')](respondWithFilteredResult(_0x19e3ba,_0xe299f1))['catch'](handleError(_0x19e3ba,null));};exports[_0x4f87('0x40')]=function(_0x345091,_0x4194ac){var _0x4b1f81={'raw':!![],'where':{'id':_0x345091[_0x4f87('0x41')]['id']}},_0x1d6415={};_0x1d6415['model']=_[_0x4f87('0x2a')](db[_0x4f87('0x3d')][_0x4f87('0x28')]);_0x1d6415[_0x4f87('0x2b')]=_[_0x4f87('0x2a')](_0x345091[_0x4f87('0x2b')]);_0x1d6415['filters']=_[_0x4f87('0x2e')](_0x1d6415[_0x4f87('0x29')],_0x1d6415[_0x4f87('0x2b')]);_0x4b1f81[_0x4f87('0x2d')]=_['intersection'](_0x1d6415[_0x4f87('0x29')],qs['fields'](_0x345091[_0x4f87('0x2b')][_0x4f87('0x2f')]));_0x4b1f81[_0x4f87('0x2d')]=_0x4b1f81[_0x4f87('0x2d')]['length']?_0x4b1f81['attributes']:_0x1d6415['model'];if(_0x345091['query']['includeAll']){_0x4b1f81['include']=[{'all':!![]}];}_0x4b1f81=_[_0x4f87('0x37')]({},_0x4b1f81,_0x345091[_0x4f87('0x3a')]);return db[_0x4f87('0x3d')][_0x4f87('0x42')](_0x4b1f81)[_0x4f87('0x22')](handleEntityNotFound(_0x4194ac,null))[_0x4f87('0x22')](respondWithResult(_0x4194ac,null))[_0x4f87('0x43')](handleError(_0x4194ac,null));};exports[_0x4f87('0x44')]=function(_0x5bf598,_0x258698){return db[_0x4f87('0x3d')][_0x4f87('0x44')](_0x5bf598[_0x4f87('0x45')],{})[_0x4f87('0x22')](respondWithResult(_0x258698,0xc9))[_0x4f87('0x43')](handleError(_0x258698,null));};exports[_0x4f87('0x21')]=function(_0x263957,_0x42453e){if(_0x263957[_0x4f87('0x45')]['id']){delete _0x263957[_0x4f87('0x45')]['id'];}return db[_0x4f87('0x3d')][_0x4f87('0x42')]({'where':{'id':_0x263957[_0x4f87('0x41')]['id']}})[_0x4f87('0x22')](handleEntityNotFound(_0x42453e,null))[_0x4f87('0x22')](saveUpdates(_0x263957[_0x4f87('0x45')],null))['then'](respondWithResult(_0x42453e,null))[_0x4f87('0x43')](handleError(_0x42453e,null));};exports['destroy']=function(_0x59a7ce,_0x3e7383){return db[_0x4f87('0x3d')][_0x4f87('0x42')]({'where':{'id':_0x59a7ce[_0x4f87('0x41')]['id']}})[_0x4f87('0x22')](handleEntityNotFound(_0x3e7383,null))[_0x4f87('0x22')](removeEntity(_0x3e7383,null))[_0x4f87('0x43')](handleError(_0x3e7383,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 7ace6dc..b76b7dd 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 _0xf492=['define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x164760,_0x5874b0){var _0x8b91b2=function(_0x40d20a){while(--_0x40d20a){_0x164760['push'](_0x164760['shift']());}};_0x8b91b2(++_0x5874b0);}(_0xf492,0x67));var _0x2f49=function(_0x516e96,_0x23fdca){_0x516e96=_0x516e96-0x0;var _0x2b2529=_0xf492[_0x516e96];return _0x2b2529;};'use strict';var _=require(_0x2f49('0x0'));var util=require(_0x2f49('0x1'));var logger=require(_0x2f49('0x2'))('api');var moment=require(_0x2f49('0x3'));var BPromise=require('bluebird');var rp=require(_0x2f49('0x4'));var fs=require('fs');var path=require(_0x2f49('0x5'));var rimraf=require(_0x2f49('0x6'));var config=require(_0x2f49('0x7'));var attributes=require('./openchannelApplication.attributes');module[_0x2f49('0x8')]=function(_0x3acd43,_0x420f85){return _0x3acd43[_0x2f49('0x9')](_0x2f49('0xa'),attributes,{'tableName':_0x2f49('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2f49('0xc'),'collate':_0x2f49('0xd')});}; \ No newline at end of file +var _0x26bc=['openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./openchannelApplication.attributes','define'];(function(_0x45ed95,_0x23951c){var _0x5a3e1e=function(_0x2e04bd){while(--_0x2e04bd){_0x45ed95['push'](_0x45ed95['shift']());}};_0x5a3e1e(++_0x23951c);}(_0x26bc,0x162));var _0xc26b=function(_0x4cd614,_0x21a966){_0x4cd614=_0x4cd614-0x0;var _0x253d6d=_0x26bc[_0x4cd614];return _0x253d6d;};'use strict';var _=require(_0xc26b('0x0'));var util=require(_0xc26b('0x1'));var logger=require(_0xc26b('0x2'))(_0xc26b('0x3'));var moment=require(_0xc26b('0x4'));var BPromise=require('bluebird');var rp=require(_0xc26b('0x5'));var fs=require('fs');var path=require(_0xc26b('0x6'));var rimraf=require(_0xc26b('0x7'));var config=require('../../config/environment');var attributes=require(_0xc26b('0x8'));module['exports']=function(_0x299ad8,_0x212243){return _0x299ad8[_0xc26b('0x9')]('OpenchannelApplication',attributes,{'tableName':_0xc26b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc26b('0xb'),'collate':_0xc26b('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 076c6e9..8e9b573 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 _0x2ec8=['OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','attributes','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x20f4d5,_0x395d17){var _0x4f19a5=function(_0x1b599a){while(--_0x1b599a){_0x20f4d5['push'](_0x20f4d5['shift']());}};_0x4f19a5(++_0x395d17);}(_0x2ec8,0x6e));var _0x82ec=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2ec8[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x82ec('0x0'));var util=require(_0x82ec('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x82ec('0x2'));var fs=require('fs');var Redis=require(_0x82ec('0x3'));var db=require(_0x82ec('0x4'))['db'];var utils=require(_0x82ec('0x5'));var logger=require(_0x82ec('0x6'))(_0x82ec('0x7'));var config=require(_0x82ec('0x8'));var jayson=require(_0x82ec('0x9'));var client=jayson[_0x82ec('0xa')][_0x82ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6f8dba,_0x17c182,_0x5573c5){return new BPromise(function(_0x2828ad,_0x5519b2){return client[_0x82ec('0xc')](_0x6f8dba,_0x5573c5)[_0x82ec('0xd')](function(_0xeb25a2){logger['info'](_0x82ec('0xe'),_0x17c182,_0x82ec('0xf'));logger[_0x82ec('0x10')](_0x82ec('0x11'),_0x17c182,_0x82ec('0xf'),JSON[_0x82ec('0x12')](_0xeb25a2));if(_0xeb25a2[_0x82ec('0x13')]){if(_0xeb25a2[_0x82ec('0x13')]['code']===0x1f4){logger[_0x82ec('0x13')](_0x82ec('0xe'),_0x17c182,_0xeb25a2[_0x82ec('0x13')][_0x82ec('0x14')]);return _0x5519b2(_0xeb25a2[_0x82ec('0x13')][_0x82ec('0x14')]);}logger[_0x82ec('0x13')](_0x82ec('0xe'),_0x17c182,_0xeb25a2['error'][_0x82ec('0x14')]);return _0x2828ad(_0xeb25a2['error'][_0x82ec('0x14')]);}else{logger[_0x82ec('0x15')](_0x82ec('0xe'),_0x17c182,_0x82ec('0xf'));_0x2828ad(_0xeb25a2[_0x82ec('0x16')][_0x82ec('0x14')]);}})[_0x82ec('0x17')](function(_0x52b6e8){logger[_0x82ec('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0x17c182,_0x52b6e8);_0x5519b2(_0x52b6e8);});});}exports[_0x82ec('0x18')]=function(_0x2487a4){var _0x42cd6b=this;return new Promise(function(_0x33dbe8,_0x19f2ee){return db[_0x82ec('0x19')][_0x82ec('0x1a')](_0x2487a4[_0x82ec('0x1b')],{'raw':_0x2487a4[_0x82ec('0x1c')]?_0x2487a4[_0x82ec('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2487a4[_0x82ec('0x1c')]?_0x2487a4['options']['where']||null:null,'attributes':_0x2487a4[_0x82ec('0x1c')]?_0x2487a4[_0x82ec('0x1c')][_0x82ec('0x1d')]||null:null,'limit':_0x2487a4['options']?_0x2487a4[_0x82ec('0x1c')][_0x82ec('0x1e')]||null:null})[_0x82ec('0xd')](function(_0x28bf3c){logger[_0x82ec('0x15')](_0x82ec('0x18'),_0x2487a4);logger[_0x82ec('0x10')](_0x82ec('0x18'),_0x2487a4,JSON[_0x82ec('0x12')](_0x28bf3c));_0x33dbe8(_0x28bf3c);})['catch'](function(_0x24189d){logger[_0x82ec('0x13')](_0x82ec('0x18'),_0x24189d[_0x82ec('0x14')],_0x2487a4);_0x19f2ee(_0x42cd6b['error'](0x1f4,_0x24189d['message']));});});}; \ No newline at end of file +var _0xe440=['http','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','OpenchannelApplication','update','body','options','where','attributes','limit','UpdateOpenchannelApplication','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x172955,_0x1df62a){var _0x4faffa=function(_0x3c92b6){while(--_0x3c92b6){_0x172955['push'](_0x172955['shift']());}};_0x4faffa(++_0x1df62a);}(_0xe440,0x10d));var _0x0e44=function(_0x6c6994,_0xf01f37){_0x6c6994=_0x6c6994-0x0;var _0x2e9254=_0xe440[_0x6c6994];return _0x2e9254;};'use strict';var _=require('lodash');var util=require(_0x0e44('0x0'));var moment=require(_0x0e44('0x1'));var BPromise=require(_0x0e44('0x2'));var rs=require(_0x0e44('0x3'));var fs=require('fs');var Redis=require(_0x0e44('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0e44('0x5'));var logger=require('../../config/logger')(_0x0e44('0x6'));var config=require(_0x0e44('0x7'));var jayson=require(_0x0e44('0x8'));var client=jayson[_0x0e44('0x9')][_0x0e44('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xacf042,_0x1dc6b4,_0x564da1){return new BPromise(function(_0x211711,_0x390eb7){return client['request'](_0xacf042,_0x564da1)[_0x0e44('0xb')](function(_0x7e083){logger[_0x0e44('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x1dc6b4,_0x0e44('0xd'));logger[_0x0e44('0xe')](_0x0e44('0xf'),_0x1dc6b4,_0x0e44('0xd'),JSON[_0x0e44('0x10')](_0x7e083));if(_0x7e083[_0x0e44('0x11')]){if(_0x7e083[_0x0e44('0x11')][_0x0e44('0x12')]===0x1f4){logger['error'](_0x0e44('0x13'),_0x1dc6b4,_0x7e083[_0x0e44('0x11')][_0x0e44('0x14')]);return _0x390eb7(_0x7e083[_0x0e44('0x11')]['message']);}logger[_0x0e44('0x11')](_0x0e44('0x13'),_0x1dc6b4,_0x7e083[_0x0e44('0x11')][_0x0e44('0x14')]);return _0x211711(_0x7e083[_0x0e44('0x11')][_0x0e44('0x14')]);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x1dc6b4,'request\x20sent');_0x211711(_0x7e083[_0x0e44('0x15')][_0x0e44('0x14')]);}})[_0x0e44('0x16')](function(_0x353106){logger[_0x0e44('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x1dc6b4,_0x353106);_0x390eb7(_0x353106);});});}exports['UpdateOpenchannelApplication']=function(_0x770354){var _0x303778=this;return new Promise(function(_0x6402c8,_0x43fe29){return db[_0x0e44('0x17')][_0x0e44('0x18')](_0x770354[_0x0e44('0x19')],{'raw':_0x770354[_0x0e44('0x1a')]?_0x770354['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x770354[_0x0e44('0x1a')]?_0x770354['options'][_0x0e44('0x1b')]||null:null,'attributes':_0x770354[_0x0e44('0x1a')]?_0x770354[_0x0e44('0x1a')][_0x0e44('0x1c')]||null:null,'limit':_0x770354['options']?_0x770354[_0x0e44('0x1a')][_0x0e44('0x1d')]||null:null})['then'](function(_0x3926b6){logger[_0x0e44('0xc')]('UpdateOpenchannelApplication',_0x770354);logger[_0x0e44('0xe')](_0x0e44('0x1e'),_0x770354,JSON[_0x0e44('0x10')](_0x3926b6));_0x6402c8(_0x3926b6);})['catch'](function(_0x22c12f){logger[_0x0e44('0x11')](_0x0e44('0x1e'),_0x22c12f[_0x0e44('0x14')],_0x770354);_0x43fe29(_0x303778['error'](0x1f4,_0x22c12f[_0x0e44('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index f7bb020..9419755 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 _0xe6c0=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','util','path'];(function(_0xb6e75b,_0x39074a){var _0x46659f=function(_0x3e600c){while(--_0x3e600c){_0xb6e75b['push'](_0xb6e75b['shift']());}};_0x46659f(++_0x39074a);}(_0xe6c0,0x134));var _0x0e6c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xe6c0[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0x0e6c('0x0'));var path=require(_0x0e6c('0x1'));var timeout=require(_0x0e6c('0x2'));var express=require('express');var router=express[_0x0e6c('0x3')]();var auth=require(_0x0e6c('0x4'));var interaction=require(_0x0e6c('0x5'));var config=require(_0x0e6c('0x6'));var controller=require(_0x0e6c('0x7'));router[_0x0e6c('0x8')]('/',auth[_0x0e6c('0x9')](),controller[_0x0e6c('0xa')]);router[_0x0e6c('0x8')](_0x0e6c('0xb'),auth[_0x0e6c('0x9')](),controller['describe']);router[_0x0e6c('0x8')](_0x0e6c('0xc'),auth[_0x0e6c('0x9')](),controller[_0x0e6c('0xd')]);router[_0x0e6c('0x8')](_0x0e6c('0xe'),auth[_0x0e6c('0x9')](),controller[_0x0e6c('0xf')]);router[_0x0e6c('0x8')](_0x0e6c('0x10'),auth['isAuthenticated'](),controller[_0x0e6c('0x11')]);router['post']('/',auth[_0x0e6c('0x9')](),controller['create']);router[_0x0e6c('0x12')](_0x0e6c('0xe'),auth[_0x0e6c('0x9')](),controller[_0x0e6c('0x13')]);router['post'](_0x0e6c('0x14'),auth['isAuthenticated'](),interaction[_0x0e6c('0x15')](_0x0e6c('0x16'),_0x0e6c('0x17')),controller['addTags']);router[_0x0e6c('0x18')]('/:id',auth['isAuthenticated'](),interaction[_0x0e6c('0x15')](_0x0e6c('0x16'),'openchannelinteraction:update'),controller[_0x0e6c('0x19')]);router[_0x0e6c('0x1a')]('/:id',auth['isAuthenticated'](),interaction[_0x0e6c('0x15')](_0x0e6c('0x16'),_0x0e6c('0x1b')),controller[_0x0e6c('0x1c')]);router[_0x0e6c('0x1a')]('/:id/tags',auth[_0x0e6c('0x9')](),controller[_0x0e6c('0x1d')]);module[_0x0e6c('0x1e')]=router; \ No newline at end of file +var _0x89ea=['tracked','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','/:id/tags','removeTags','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/messages','/:id/download','download','create','post','addMessage','openchannel','addTags','put'];(function(_0x232cac,_0x391421){var _0x42b279=function(_0x219c51){while(--_0x219c51){_0x232cac['push'](_0x232cac['shift']());}};_0x42b279(++_0x391421);}(_0x89ea,0x1c9));var _0xa89e=function(_0xb0c152,_0x1d37a9){_0xb0c152=_0xb0c152-0x0;var _0x2fc458=_0x89ea[_0xb0c152];return _0x2fc458;};'use strict';var multer=require('multer');var util=require(_0xa89e('0x0'));var path=require(_0xa89e('0x1'));var timeout=require(_0xa89e('0x2'));var express=require('express');var router=express[_0xa89e('0x3')]();var auth=require(_0xa89e('0x4'));var interaction=require(_0xa89e('0x5'));var config=require(_0xa89e('0x6'));var controller=require(_0xa89e('0x7'));router['get']('/',auth[_0xa89e('0x8')](),controller['index']);router[_0xa89e('0x9')](_0xa89e('0xa'),auth[_0xa89e('0x8')](),controller[_0xa89e('0xb')]);router[_0xa89e('0x9')](_0xa89e('0xc'),auth['isAuthenticated'](),controller[_0xa89e('0xd')]);router[_0xa89e('0x9')](_0xa89e('0xe'),auth[_0xa89e('0x8')](),controller['getMessages']);router[_0xa89e('0x9')](_0xa89e('0xf'),auth[_0xa89e('0x8')](),controller[_0xa89e('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa89e('0x11')]);router[_0xa89e('0x12')](_0xa89e('0xe'),auth[_0xa89e('0x8')](),controller[_0xa89e('0x13')]);router[_0xa89e('0x12')]('/:id/tags',auth['isAuthenticated'](),interaction['tracked'](_0xa89e('0x14'),'openchannelinteraction:addtags'),controller[_0xa89e('0x15')]);router[_0xa89e('0x16')](_0xa89e('0xc'),auth[_0xa89e('0x8')](),interaction[_0xa89e('0x17')](_0xa89e('0x14'),_0xa89e('0x18')),controller[_0xa89e('0x19')]);router[_0xa89e('0x1a')](_0xa89e('0xc'),auth['isAuthenticated'](),interaction[_0xa89e('0x17')](_0xa89e('0x14'),_0xa89e('0x1b')),controller[_0xa89e('0x1c')]);router['delete'](_0xa89e('0x1d'),auth[_0xa89e('0x8')](),controller[_0xa89e('0x1e')]);module[_0xa89e('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 41ed489..32f2151 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 _0xfde9=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x26e8de,_0x36cc99){var _0x49a5ae=function(_0x342e3e){while(--_0x342e3e){_0x26e8de['push'](_0x26e8de['shift']());}};_0x49a5ae(++_0x36cc99);}(_0xfde9,0x66));var _0x9fde=function(_0x21c6b8,_0x16d6f6){_0x21c6b8=_0x21c6b8-0x0;var _0x39d474=_0xfde9[_0x21c6b8];return _0x39d474;};'use strict';var Sequelize=require(_0x9fde('0x0'));module[_0x9fde('0x1')]={'closed':{'type':Sequelize[_0x9fde('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9fde('0x3')]},'disposition':{'type':Sequelize[_0x9fde('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x9fde('0x3')]},'threadId':{'type':Sequelize[_0x9fde('0x4')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x9fde('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x9fde('0x5')]('in',_0x9fde('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x9fde('0x4')]}}; \ No newline at end of file +var _0x530e=['exports','DATE','STRING','ENUM'];(function(_0x40e54,_0x52151d){var _0x4ab7df=function(_0x2e2025){while(--_0x2e2025){_0x40e54['push'](_0x40e54['shift']());}};_0x4ab7df(++_0x52151d);}(_0x530e,0x10c));var _0xe530=function(_0x2580fc,_0x5ea3ab){_0x2580fc=_0x2580fc-0x0;var _0x1b1892=_0x530e[_0x2580fc];return _0x1b1892;};'use strict';var Sequelize=require('sequelize');module[_0xe530('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe530('0x1')]},'disposition':{'type':Sequelize[_0xe530('0x2')]},'note':{'type':Sequelize[_0xe530('0x2')]},'read1stAt':{'type':Sequelize[_0xe530('0x1')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xe530('0x2')]},'lastMsgAt':{'type':Sequelize[_0xe530('0x1')]},'lastMsgDirection':{'type':Sequelize[_0xe530('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xe530('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index d551102..04f513b 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 _0x6db0=['Contact','firstName','lastName','Attachment','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\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\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\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\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\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\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\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\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\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\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\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\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','%s\x20#%d','Openchannel','YYYY-MM-DD','mkdirSync','Account','Owner','N.A.','closed','closedAt','threadId','Public','basename','existsSync','createReadStream','createWriteStream','direction','out','System','secret','downloadInteraction.html','toFile','.pdf','err','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','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','end','count','offset','limit','status','Content-Range','json','apply','reject','update','then','error','stack','name','Users','map','Tags','TagIds','split','catch','index','OpenchannelInteraction','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','select','field','color','from','COUNT(*)','openchannel_messages','where','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','advancedFilter','parse','forEach','createdAt','value','dateStart','startOf','utc','format','day','and','isArray','condition','TagId','unreadMessages','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','\x20>\x20?','\x20<\x20?','isEmpty','OpenchannelAccountId','concat','$gte','null','\x20IS\x20NULL','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','push','toString','join','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','COUNT(me.id)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','sequelize','keyBy','a.key','Account.key','i.*','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','params','includeAll','include','merge','find','create','body','describe','addMessage','OpenchannelMessage','ids','rawAttributes','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','setTags','omit','spread','Tag','emit','openchannelInteractionTags:save','removeTags','download','unix','root','server','files','tmp','attachments','transcript-%d-%s.zip','Messages','User','fullname','CmContact'];(function(_0x1bb7d2,_0x3ea1c4){var _0x19c948=function(_0xa8e461){while(--_0xa8e461){_0x1bb7d2['push'](_0x1bb7d2['shift']());}};_0x19c948(++_0x3ea1c4);}(_0x6db0,0x10a));var _0x06db=function(_0x5534ba,_0x239fc9){_0x5534ba=_0x5534ba-0x0;var _0x3cff4d=_0x6db0[_0x5534ba];return _0x3cff4d;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x06db('0x0'));var rp=require(_0x06db('0x1'));var moment=require(_0x06db('0x2'));var BPromise=require(_0x06db('0x3'));var Mustache=require(_0x06db('0x4'));var util=require(_0x06db('0x5'));var path=require(_0x06db('0x6'));var sox=require(_0x06db('0x7'));var csv=require(_0x06db('0x8'));var ejs=require(_0x06db('0x9'));var fs=require('fs');var _=require(_0x06db('0xa'));var squel=require(_0x06db('0xb'));var crypto=require(_0x06db('0xc'));var jsforce=require(_0x06db('0xd'));var deskjs=require(_0x06db('0xe'));var toCsv=require(_0x06db('0x8'));var querystring=require(_0x06db('0xf'));var Papa=require(_0x06db('0x10'));var Redis=require(_0x06db('0x11'));var authService=require(_0x06db('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x06db('0x13'));var logger=require('../../config/logger')(_0x06db('0x14'));var utils=require(_0x06db('0x15'));var config=require(_0x06db('0x16'));var db=require(_0x06db('0x17'))['db'];config[_0x06db('0x18')]=_[_0x06db('0x19')](config['redis'],{'host':_0x06db('0x1a'),'port':0x18eb});var socket=require(_0x06db('0x1b'))(new Redis(config['redis']));require(_0x06db('0x1c'))['register'](socket);function respondWithStatusCode(_0x5c0655,_0xdd3b82){_0xdd3b82=_0xdd3b82||0xcc;return function(_0x3d70aa){if(_0x3d70aa){return _0x5c0655[_0x06db('0x1d')](_0xdd3b82);}return _0x5c0655['status'](_0xdd3b82)[_0x06db('0x1e')]();};}function respondWithResult(_0x1ae949,_0x57c121){_0x57c121=_0x57c121||0xc8;return function(_0x26cc98){if(_0x26cc98){return _0x1ae949['status'](_0x57c121)['json'](_0x26cc98);}};}function respondWithFilteredResult(_0x3fde41,_0x334ddd){return function(_0x27a94f){if(_0x27a94f){var _0x356332=_0x27a94f[_0x06db('0x1f')],_0x303eef=_0x334ddd[_0x06db('0x20')],_0x14a5d0=_0x334ddd['offset']+_0x334ddd[_0x06db('0x21')],_0x4cffbd;if(_0x14a5d0>=_0x356332){_0x14a5d0=_0x356332;_0x4cffbd=0xc8;}else{_0x4cffbd=0xce;}_0x3fde41[_0x06db('0x22')](_0x4cffbd);return _0x3fde41['set'](_0x06db('0x23'),_0x303eef+'-'+_0x14a5d0+'/'+_0x356332)[_0x06db('0x24')](_0x27a94f);}return null;};}function patchUpdates(_0xc507a9){return function(_0x3cb04b){try{jsonpatch[_0x06db('0x25')](_0x3cb04b,_0xc507a9,!![]);}catch(_0x203a4a){return BPromise[_0x06db('0x26')](_0x203a4a);}return _0x3cb04b['save']();};}function saveUpdates(_0x2d0570,_0x214074){return function(_0x555be1){if(_0x555be1){return _0x555be1[_0x06db('0x27')](_0x2d0570)[_0x06db('0x28')](function(_0x40bb7f){return _0x40bb7f;});}return null;};}function removeEntity(_0x58ea4d,_0x398cfc){return function(_0x804a41){if(_0x804a41){return _0x804a41['destroy']()['then'](function(){_0x58ea4d['status'](0xcc)[_0x06db('0x1e')]();});}};}function handleEntityNotFound(_0x42156e,_0x24f22e){return function(_0x2c6465){if(!_0x2c6465){_0x42156e[_0x06db('0x1d')](0x194);}return _0x2c6465;};}function handleError(_0x2ca037,_0x104f6b){_0x104f6b=_0x104f6b||0x1f4;return function(_0x6452ae){logger[_0x06db('0x29')](_0x6452ae[_0x06db('0x2a')]);if(_0x6452ae[_0x06db('0x2b')]){delete _0x6452ae[_0x06db('0x2b')];}_0x2ca037[_0x06db('0x22')](_0x104f6b)['send'](_0x6452ae);};}function getInteractionUsers(_0x5bd022,_0xc04c9b){return new BPromise(function(_0x7c3f4b,_0xf55493){try{if(_0xc04c9b[_0x5bd022['id']]){_0x5bd022[_0x06db('0x2c')]=_[_0x06db('0x2d')](_0xc04c9b[_0x5bd022['id']],function(_0x5772f7){return{'id':_0x5772f7['id']};});}}catch(_0x3bd303){_0xf55493(_0x3bd303);}_0x7c3f4b(_0x5bd022);});}function getInteractionTags(_0x1a5332,_0x427d45){return new BPromise(function(_0x555858,_0x2010af){try{if(_0x1a5332['TagIds']){_0x1a5332[_0x06db('0x2e')]=[];_0x1a5332[_0x06db('0x2f')][_0x06db('0x30')](',')['forEach'](function(_0x4b9402){_0x1a5332['Tags']['push'](_0x427d45[_0x4b9402]);});}delete _0x1a5332['TagIds'];}catch(_0x50a558){_0x2010af(_0x50a558);}_0x555858(_0x1a5332);});}function updateOpenchannelInteraction(_0x31f325,_0x465761,_0x54bb94){return new BPromise(function(_0x553866,_0x2a02d6){return getInteractionUsers(_0x31f325,_0x54bb94)['then'](function(_0x4d094d){return getInteractionTags(_0x4d094d,_0x465761);})[_0x06db('0x28')](function(_0x37a350){_0x553866(_0x37a350);})[_0x06db('0x31')](function(_0x1f15aa){_0x2a02d6(_0x1f15aa);});});}exports[_0x06db('0x32')]=function(_0x3c1e4e,_0x4572ac){var _0x3b7dcd={},_0x21f865={},_0x560d25={'count':0x0,'rows':[]};var _0x333987=db[_0x06db('0x33')]['rawAttributes'];_0x21f865['model']=_[_0x06db('0x34')](_0x333987);_0x21f865['query']=_[_0x06db('0x34')](_0x3c1e4e[_0x06db('0x35')]);_0x21f865[_0x06db('0x36')]=_[_0x06db('0x37')](_0x21f865[_0x06db('0x38')],_0x21f865[_0x06db('0x35')]);_0x3b7dcd[_0x06db('0x39')]=_[_0x06db('0x37')](_0x21f865[_0x06db('0x38')],qs[_0x06db('0x3a')](_0x3c1e4e[_0x06db('0x35')][_0x06db('0x3a')]));_0x3b7dcd[_0x06db('0x39')]=_0x3b7dcd[_0x06db('0x39')][_0x06db('0x3b')]?_0x3b7dcd['attributes']:_0x21f865[_0x06db('0x38')];if(!_0x3c1e4e[_0x06db('0x35')]['hasOwnProperty'](_0x06db('0x3c'))){_0x3b7dcd[_0x06db('0x21')]=qs['limit'](_0x3c1e4e[_0x06db('0x35')]['limit']);_0x3b7dcd[_0x06db('0x20')]=qs[_0x06db('0x20')](_0x3c1e4e['query'][_0x06db('0x20')]);}_0x3b7dcd[_0x06db('0x3d')]=qs[_0x06db('0x3e')](_0x3c1e4e['query'][_0x06db('0x3e')]);_0x3b7dcd['where']=qs[_0x06db('0x36')](_[_0x06db('0x3f')](_0x3c1e4e['query'],_0x21f865['filters']));var _0x5096d6=[];var _0x3b7bab=squel[_0x06db('0x40')]()[_0x06db('0x41')]('id')['field'](_0x06db('0x2b'))['field'](_0x06db('0x42'))[_0x06db('0x43')]('tools_tags');var _0x4975e6=squel[_0x06db('0x40')]()[_0x06db('0x41')](_0x06db('0x44'))[_0x06db('0x43')](_0x06db('0x45'),'me')[_0x06db('0x46')]('me.OpenchannelInteractionId\x20=\x20i.id')['where'](_0x06db('0x47'))['where'](_0x06db('0x48'));var _0x17c255=squel[_0x06db('0x40')]()['field']('u.id')[_0x06db('0x41')](_0x06db('0x49'))['from'](_0x06db('0x4a'),'ui')[_0x06db('0x4b')](_0x06db('0x4c'),'u','u.id\x20=\x20ui.UserId');var _0x952dd0=squel[_0x06db('0x40')]()[_0x06db('0x43')](_0x06db('0x4d'),'i')['left_join'](_0x06db('0x4e'),'c',_0x06db('0x4f'))[_0x06db('0x4b')](_0x06db('0x4c'),'o',_0x06db('0x50'))['left_join'](_0x06db('0x51'),'a',_0x06db('0x52'))[_0x06db('0x4b')](_0x06db('0x45'),'me',_0x06db('0x53'));var _0x2106ef=squel['expr']();if(_0x3c1e4e[_0x06db('0x35')][_0x06db('0x54')]){var _0x5351d5=JSON[_0x06db('0x55')](_0x3c1e4e['query'][_0x06db('0x54')]);_['keys'](_0x5351d5)[_0x06db('0x56')](function(_0x29c9cb){var _0x5937e0=_0x5351d5[_0x29c9cb];if(_0x29c9cb===_0x06db('0x57')){var _0x2cb9c4=moment(_0x5937e0[_0x06db('0x58')][_0x06db('0x59')])[_0x06db('0x5a')]('day')[_0x06db('0x5b')]()[_0x06db('0x5c')]();var _0x515876=moment(_0x515876)[_0x06db('0x5b')]()['endOf'](_0x06db('0x5d'))[_0x06db('0x5c')]();_0x2106ef[_0x06db('0x5e')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2cb9c4,_0x515876);}else{if(_[_0x06db('0x5f')](_0x5937e0[_0x06db('0x60')])){_0x5937e0[_0x06db('0x60')]['forEach'](function(_0x1fd1db){switch(_0x5937e0[_0x06db('0x60')][_0x06db('0x58')]){case'IS':if(_0x29c9cb!==_0x06db('0x61')&&_0x29c9cb!==_0x06db('0x62')){if(_[_0x06db('0x5f')](_0x5937e0[_0x06db('0x58')])&&_0x5937e0[_0x06db('0x58')][_0x06db('0x3b')]>0x1){_0x2106ef[_0x06db('0x5e')](_0x5937e0[_0x06db('0x63')]+'.'+_0x29c9cb+_0x06db('0x64'),_0x5937e0[_0x06db('0x58')]);}else{_0x2106ef[_0x06db('0x5e')](_0x5937e0[_0x06db('0x63')]+'.'+_0x29c9cb+_0x06db('0x65'),_0x5937e0[_0x06db('0x58')][0x0]);}}break;case'=':_0x2106ef['and'](_0x5937e0['tableAlias']+'.'+_0x29c9cb+_0x06db('0x65'),_0x5937e0[_0x06db('0x58')]);break;case _0x06db('0x66'):if(_0x29c9cb===_0x06db('0x67')){_0x2106ef['and'](_0x06db('0x68')+_0x06db('0x69'),'%'+_0x5937e0['value']+'%');_0x2106ef['or']('c.lastName'+_0x06db('0x69'),'%'+_0x5937e0['value']+'%');_0x2106ef['or']('c.email'+_0x06db('0x69'),'%'+_0x5937e0[_0x06db('0x58')]+'%');}else{_0x2106ef[_0x06db('0x5e')](_0x5937e0['tableAlias']+'.'+_0x29c9cb+_0x06db('0x69'),'%'+_0x5937e0[_0x06db('0x58')]+'%');}break;case'>':_0x2106ef[_0x06db('0x5e')](_0x5937e0[_0x06db('0x63')]+'.'+_0x29c9cb+_0x06db('0x6a'),_0x5937e0[_0x06db('0x58')]);break;case'<':_0x2106ef[_0x06db('0x5e')](_0x5937e0[_0x06db('0x63')]+'.'+_0x29c9cb+'\x20<\x20?',_0x5937e0[_0x06db('0x58')]);break;}});}else{switch(_0x5937e0[_0x06db('0x60')]['value']){case'IS':if(_0x29c9cb!==_0x06db('0x61')&&_0x29c9cb!=='unreadMessages'){if(_[_0x06db('0x5f')](_0x5937e0['value'])&&_0x5937e0[_0x06db('0x58')][_0x06db('0x3b')]>0x1){_0x2106ef[_0x06db('0x5e')](_0x5937e0[_0x06db('0x63')]+'.'+_0x29c9cb+_0x06db('0x64'),_0x5937e0['value']);}else{_0x2106ef[_0x06db('0x5e')](_0x5937e0['tableAlias']+'.'+_0x29c9cb+'\x20=\x20?',_0x5937e0[_0x06db('0x58')][0x0]);}}break;case'=':_0x2106ef[_0x06db('0x5e')](_0x5937e0[_0x06db('0x63')]+'.'+_0x29c9cb+'\x20=\x20?',_0x5937e0[_0x06db('0x58')]);break;case _0x06db('0x66'):if(_0x29c9cb===_0x06db('0x67')){_0x2106ef[_0x06db('0x5e')](_0x06db('0x68')+_0x06db('0x69'),'%'+_0x5937e0[_0x06db('0x58')]+'%');_0x2106ef['or']('c.lastName'+'\x20LIKE\x20?','%'+_0x5937e0[_0x06db('0x58')]+'%');_0x2106ef['or']('c.email'+_0x06db('0x69'),'%'+_0x5937e0[_0x06db('0x58')]+'%');}else{_0x2106ef[_0x06db('0x5e')](_0x5937e0[_0x06db('0x63')]+'.'+_0x29c9cb+_0x06db('0x69'),'%'+_0x5937e0['value']+'%');}break;case'>':_0x2106ef[_0x06db('0x5e')](_0x5937e0[_0x06db('0x63')]+'.'+_0x29c9cb+_0x06db('0x6a'),_0x5937e0[_0x06db('0x58')]);break;case'<':_0x2106ef[_0x06db('0x5e')](_0x5937e0[_0x06db('0x63')]+'.'+_0x29c9cb+_0x06db('0x6b'),_0x5937e0[_0x06db('0x58')]);break;}}}});}else{var _0x224423=_(Object[_0x06db('0x34')](_0x3c1e4e[_0x06db('0x35')]))[_0x06db('0x2d')](function(_0x30c567){return _0x333987['hasOwnProperty'](_0x30c567)?_0x30c567:undefined;})['filter'](function(_0xe3175f){return!_['isNil'](_0xe3175f);})['value']();if(!_[_0x06db('0x6c')](_0x224423)){_0x224423[_0x06db('0x56')](function(_0x4c95c5){if(_0x4c95c5===_0x06db('0x6d')){_0x952dd0[_0x06db('0x46')]('i.OpenchannelAccountId\x20IN\x20?',[][_0x06db('0x6e')](_0x3c1e4e[_0x06db('0x35')][_0x4c95c5]));}else if(_0x4c95c5===_0x06db('0x57')){var _0x5e9598=JSON[_0x06db('0x55')](_0x3c1e4e[_0x06db('0x35')][_0x4c95c5])[_0x06db('0x6f')];var _0x5eb195=JSON['parse'](_0x3c1e4e['query'][_0x4c95c5])['$lte'];_0x952dd0[_0x06db('0x46')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5e9598,_0x5eb195);}else{if(_0x3c1e4e['query'][_0x4c95c5]===_0x06db('0x70')){_0x952dd0[_0x06db('0x46')]('i.'+_0x4c95c5+_0x06db('0x71'));}else{_0x952dd0['where']('i.'+_0x4c95c5+_0x06db('0x65'),_0x3c1e4e['query'][_0x4c95c5]);}}});}if(_0x3c1e4e['query'][_0x06db('0x72')]){var _0x2e879e=_0x3c1e4e[_0x06db('0x35')][_0x06db('0x72')][_0x06db('0x73')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x06db('0x74'));if(qs['isNumeric'](_0x2e879e)){_0x2106ef['or'](_0x06db('0x75'),_0x2e879e+'%');}else{var _0x107c44=[];_0x2e879e[_0x06db('0x30')]('\x20')[_0x06db('0x56')](function(_0x564231){_0x107c44[_0x06db('0x76')]('+'+_0x564231[_0x06db('0x77')]());});var _0x2e272a=_0x107c44[_0x06db('0x78')]('\x20');_0x2106ef['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x2e272a)['or'](_0x06db('0x79'),_0x2e879e+'%')['or'](_0x06db('0x7a'),_0x2e879e+'%');}}}_0x952dd0[_0x06db('0x46')](_0x2106ef);if(_0x3b7dcd[_0x06db('0x3d')]){_0x3b7dcd['order']['forEach'](function(_0x28e3b2){_0x952dd0[_0x06db('0x3d')]('i.'+_0x28e3b2[0x0],_0x28e3b2[0x1]==='DESC'?![]:!![]);});}_0x952dd0[_0x06db('0x7b')](_0x06db('0x7c'));var _0x121d5f={'type':db[_0x06db('0x7d')][_0x06db('0x7e')][_0x06db('0x7f')],'raw':!![]};var _0x4a4dcb=_0x952dd0[_0x06db('0x80')]()['field'](_0x06db('0x44'))[_0x06db('0x41')](_0x06db('0x81'),_0x06db('0x62'));if(!_0x3c1e4e[_0x06db('0x35')][_0x06db('0x54')]){if(_0x3c1e4e[_0x06db('0x35')][_0x06db('0x82')]){if(_0x3c1e4e[_0x06db('0x35')][_0x06db('0x82')]==0x1){_0x4a4dcb[_0x06db('0x83')](_0x06db('0x84'));_0x952dd0[_0x06db('0x83')](_0x06db('0x84'));}else{_0x4a4dcb['having'](_0x06db('0x85'));_0x952dd0['having'](_0x06db('0x85'));}}if(_0x3c1e4e[_0x06db('0x35')][_0x06db('0x86')]){var _0x388779=_[_0x06db('0x5f')](_0x3c1e4e['query'][_0x06db('0x86')])?_0x3c1e4e[_0x06db('0x35')][_0x06db('0x86')]:new Array(_0x3c1e4e['query'][_0x06db('0x86')]);var _0x5790b4=squel['expr']();_0x388779[_0x06db('0x56')](function(_0x256fca){_0x5790b4['or'](_0x06db('0x87'),'%,'+_0x256fca+',%');});_0x952dd0[_0x06db('0x83')](_0x5790b4);_0x4a4dcb[_0x06db('0x4b')](_0x06db('0x88'),'it',_0x06db('0x89'));_0x4a4dcb[_0x06db('0x4b')](_0x06db('0x8a'),'t',_0x06db('0x8b'));_0x4a4dcb[_0x06db('0x46')]('t.id\x20IN\x20?',_0x388779);}}else{var _0x5351d5=JSON[_0x06db('0x55')](_0x3c1e4e[_0x06db('0x35')][_0x06db('0x54')]);_[_0x06db('0x34')](_0x5351d5)[_0x06db('0x56')](function(_0x5b33b5){var _0x3cb6f8=_0x5351d5[_0x5b33b5];if(_0x5b33b5==='TagId'){var _0x4e5695=_0x3cb6f8[_0x06db('0x58')];var _0x45769d=squel[_0x06db('0x8c')]();_0x4e5695[_0x06db('0x56')](function(_0x2337e7){_0x45769d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2337e7+',%');});_0x952dd0[_0x06db('0x83')](_0x45769d);_0x4a4dcb[_0x06db('0x4b')]('mail_interaction_has_tags','it',_0x06db('0x8d'));_0x4a4dcb[_0x06db('0x4b')]('tools_tags','t',_0x06db('0x8b'));_0x4a4dcb['where'](_0x06db('0x8e'),_0x4e5695);}else if(_0x5b33b5===_0x06db('0x62')){if(_0x3cb6f8[_0x06db('0x58')][_0x06db('0x3b')]===0x1){if(_0x3cb6f8[_0x06db('0x58')][0x0]===0x1){_0x4a4dcb['having']('`unreadMessages`\x20=\x200');_0x952dd0[_0x06db('0x83')](_0x06db('0x84'));}else{_0x4a4dcb[_0x06db('0x83')]('`unreadMessages`\x20>\x200');_0x952dd0[_0x06db('0x83')]('`unreadMessages`\x20>\x200');}}}});}db[_0x06db('0x8f')][_0x06db('0x35')](_0x4a4dcb[_0x06db('0x77')](),_0x121d5f)[_0x06db('0x28')](function(_0x52934f){_0x560d25[_0x06db('0x1f')]=_0x52934f['length'];if(_0x560d25[_0x06db('0x1f')]===0x0)return[];return db[_0x06db('0x8f')][_0x06db('0x35')](_0x3b7bab['toString'](),_0x121d5f)[_0x06db('0x28')](function(_0x383758){_0x5096d6=_[_0x06db('0x90')](_0x383758,'id');_0x121d5f=_['merge'](_0x121d5f,{'model':db[_0x06db('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x952dd0['field'](_0x06db('0x81'),_0x06db('0x62'));_0x952dd0[_0x06db('0x41')](_0x06db('0x91'),_0x06db('0x92'));_0x952dd0['field'](_0x06db('0x93'));_0x952dd0[_0x06db('0x41')](_0x06db('0x68'),'Contact.firstName');_0x952dd0['field'](_0x06db('0x94'),_0x06db('0x95'));_0x952dd0[_0x06db('0x41')](_0x06db('0x96'),_0x06db('0x97'));_0x952dd0[_0x06db('0x41')](_0x06db('0x98'),_0x06db('0x99'));_0x952dd0[_0x06db('0x41')](_0x06db('0x9a'),_0x06db('0x9b'));_0x952dd0['field'](_0x06db('0x9c'),_0x06db('0x9d'));_0x952dd0['field'](_0x06db('0x9e'),'TagIds');_0x952dd0[_0x06db('0x4b')](_0x06db('0x88'),'it','it.OpenchannelInteractionId\x20=\x20i.id');_0x952dd0[_0x06db('0x4b')]('tools_tags','t',_0x06db('0x8b'));_0x952dd0[_0x06db('0x21')](_0x3b7dcd[_0x06db('0x21')]);_0x952dd0[_0x06db('0x20')](_0x3b7dcd['offset']);return db[_0x06db('0x8f')][_0x06db('0x35')](_0x952dd0['toString'](),_0x121d5f);})[_0x06db('0x28')](function(_0x4a5211){_0x17c255['where'](_0x06db('0x9f'),_[_0x06db('0x2d')](_0x4a5211,'id'));return db[_0x06db('0x8f')][_0x06db('0x35')](_0x17c255['toString'](),_0x121d5f)['then'](function(_0x2deb64){var _0x1177d5=_[_0x06db('0xa0')](_0x2deb64,_0x06db('0xa1'));var _0x31d609=[];_0x4a5211['forEach'](function(_0x28c042){_0x31d609['push'](updateOpenchannelInteraction(_0x28c042,_0x5096d6,_0x1177d5));});return BPromise[_0x06db('0xa2')](_0x31d609);});});})[_0x06db('0x28')](function(_0x280987){_0x560d25[_0x06db('0xa3')]=_0x280987;return _0x560d25;})[_0x06db('0x28')](respondWithFilteredResult(_0x4572ac,_0x3b7dcd))[_0x06db('0x31')](handleError(_0x4572ac,null));};exports['show']=function(_0x499667,_0xd6282){var _0x5e239c={'raw':![],'where':{'id':_0x499667[_0x06db('0xa4')]['id']}},_0x5c5952={};_0x5c5952['model']=_[_0x06db('0x34')](db[_0x06db('0x33')]['rawAttributes']);_0x5c5952[_0x06db('0x35')]=_['keys'](_0x499667[_0x06db('0x35')]);_0x5c5952[_0x06db('0x36')]=_[_0x06db('0x37')](_0x5c5952[_0x06db('0x38')],_0x5c5952[_0x06db('0x35')]);_0x5e239c[_0x06db('0x39')]=_[_0x06db('0x37')](_0x5c5952[_0x06db('0x38')],qs[_0x06db('0x3a')](_0x499667[_0x06db('0x35')][_0x06db('0x3a')]));_0x5e239c[_0x06db('0x39')]=_0x5e239c['attributes'][_0x06db('0x3b')]?_0x5e239c['attributes']:_0x5c5952[_0x06db('0x38')];if(_0x499667[_0x06db('0x35')][_0x06db('0xa5')]){_0x5e239c[_0x06db('0xa6')]=[{'all':!![]}];}_0x5e239c=_[_0x06db('0xa7')]({},_0x5e239c,_0x499667['options']);return db[_0x06db('0x33')][_0x06db('0xa8')](_0x5e239c)['then'](handleEntityNotFound(_0xd6282,null))[_0x06db('0x28')](respondWithResult(_0xd6282,null))[_0x06db('0x31')](handleError(_0xd6282,null));};exports[_0x06db('0xa9')]=function(_0x283129,_0x1d2eb0){return db[_0x06db('0x33')][_0x06db('0xa9')](_0x283129[_0x06db('0xaa')],{})[_0x06db('0x28')](respondWithResult(_0x1d2eb0,0xc9))['catch'](handleError(_0x1d2eb0,null));};exports[_0x06db('0x27')]=function(_0x3220d6,_0x26fa50){if(_0x3220d6[_0x06db('0xaa')]['id']){delete _0x3220d6[_0x06db('0xaa')]['id'];}return db[_0x06db('0x33')][_0x06db('0xa8')]({'where':{'id':_0x3220d6[_0x06db('0xa4')]['id']}})[_0x06db('0x28')](handleEntityNotFound(_0x26fa50,null))['then'](saveUpdates(_0x3220d6[_0x06db('0xaa')],null))[_0x06db('0x28')](respondWithResult(_0x26fa50,null))[_0x06db('0x31')](handleError(_0x26fa50,null));};exports['destroy']=function(_0x2f1313,_0x922cce){return db['OpenchannelInteraction'][_0x06db('0xa8')]({'where':{'id':_0x2f1313[_0x06db('0xa4')]['id']}})['then'](handleEntityNotFound(_0x922cce,null))[_0x06db('0x28')](removeEntity(_0x922cce,null))[_0x06db('0x31')](handleError(_0x922cce,null));};exports[_0x06db('0xab')]=function(_0xb4b404,_0x2ea57a){return db[_0x06db('0x33')][_0x06db('0xab')]()[_0x06db('0x28')](respondWithResult(_0x2ea57a,null))[_0x06db('0x31')](handleError(_0x2ea57a,null));};exports[_0x06db('0xac')]=function(_0x39d536,_0x2c307c,_0x2c4806){return db[_0x06db('0xad')][_0x06db('0xa8')]({'where':{'id':_0x39d536['params']['id']}})[_0x06db('0x28')](handleEntityNotFound(_0x2c307c,null))[_0x06db('0x28')](function(_0x57c3bf){if(_0x57c3bf){return _0x57c3bf[_0x06db('0xac')](_0x39d536[_0x06db('0xaa')][_0x06db('0xae')],_['omit'](_0x39d536[_0x06db('0xaa')],[_0x06db('0xae'),'id'])||{});}})['then'](respondWithResult(_0x2c307c,null))[_0x06db('0x31')](handleError(_0x2c307c,null));};exports['getMessages']=function(_0x177d5c,_0xe23ecc,_0x4688e9){var _0x18dfef={'raw':![],'where':{}};var _0x35e89b={};var _0x51ab19={'count':0x0,'rows':[]};return db[_0x06db('0x33')]['findOne']({'where':{'id':_0x177d5c[_0x06db('0xa4')]['id']}})[_0x06db('0x28')](handleEntityNotFound(_0xe23ecc,null))['then'](function(_0x20e6a6){if(_0x20e6a6){_0x35e89b[_0x06db('0x38')]=_['keys'](db[_0x06db('0xad')][_0x06db('0xaf')]);_0x35e89b[_0x06db('0x35')]=_['keys'](_0x177d5c[_0x06db('0x35')]);_0x35e89b['filters']=_[_0x06db('0x37')](_0x35e89b[_0x06db('0x38')],_0x35e89b[_0x06db('0x35')]);_0x18dfef[_0x06db('0x39')]=_['intersection'](_0x35e89b[_0x06db('0x38')],qs[_0x06db('0x3a')](_0x177d5c[_0x06db('0x35')][_0x06db('0x3a')]));_0x18dfef[_0x06db('0x39')]=_0x18dfef[_0x06db('0x39')][_0x06db('0x3b')]?_0x18dfef['attributes']:_0x35e89b[_0x06db('0x38')];if(!_0x177d5c[_0x06db('0x35')][_0x06db('0xb0')](_0x06db('0x3c'))){_0x18dfef[_0x06db('0x21')]=qs['limit'](_0x177d5c[_0x06db('0x35')][_0x06db('0x21')]);_0x18dfef[_0x06db('0x20')]=qs[_0x06db('0x20')](_0x177d5c[_0x06db('0x35')]['offset']);}_0x18dfef[_0x06db('0x3d')]=qs[_0x06db('0x3e')](_0x177d5c[_0x06db('0x35')][_0x06db('0x3e')]);_0x18dfef['where']=qs[_0x06db('0x36')](_[_0x06db('0x3f')](_0x177d5c[_0x06db('0x35')],_0x35e89b['filters']));_0x18dfef[_0x06db('0x46')][_0x06db('0xa1')]=_0x20e6a6['id'];if(_0x177d5c[_0x06db('0x35')][_0x06db('0x72')]){_0x18dfef[_0x06db('0x46')]=_['merge'](_0x18dfef[_0x06db('0x46')],{'$or':_['map'](_0x18dfef['attributes'],function(_0x1fb350){var _0x1981d3={};_0x1981d3[_0x1fb350]={'$like':'%'+_0x177d5c[_0x06db('0x35')][_0x06db('0x72')]+'%'};return _0x1981d3;})});}if(_0x177d5c[_0x06db('0x35')][_0x06db('0x6f')]){var _0x456459=_0x177d5c[_0x06db('0x35')][_0x06db('0x6f')][_0x06db('0x30')](',');var _0x40f473={};_0x40f473[_0x456459[0x0]]={'$gte':moment(_0x456459[0x1])[_0x06db('0x5c')](_0x06db('0xb1'))};_0x18dfef[_0x06db('0x46')]=_[_0x06db('0xa7')](_0x18dfef['where'],_0x40f473);}_0x18dfef=_[_0x06db('0xa7')]({},_0x18dfef,_0x177d5c[_0x06db('0xb2')]);return db[_0x06db('0xad')][_0x06db('0x1f')]({'where':_0x18dfef[_0x06db('0x46')]})['then'](function(_0x570aa6){_0x51ab19[_0x06db('0x1f')]=_0x570aa6;if(_0x177d5c['query'][_0x06db('0xa5')]){_0x18dfef[_0x06db('0xa6')]=[{'all':!![]}];}return db[_0x06db('0xad')][_0x06db('0xb3')](_0x18dfef);})['then'](function(_0x14ef51){_0x51ab19[_0x06db('0xa3')]=_0x14ef51;return _0x51ab19;});}})['then'](respondWithFilteredResult(_0xe23ecc,_0x18dfef))[_0x06db('0x31')](handleError(_0xe23ecc,null));};exports[_0x06db('0xb4')]=function(_0x1fd791,_0x497179,_0x1f2b65){return db[_0x06db('0x33')][_0x06db('0xa8')]({'where':{'id':_0x1fd791['params']['id']}})[_0x06db('0x28')](handleEntityNotFound(_0x497179,null))[_0x06db('0x28')](function(_0x369739){if(_0x369739){return _0x369739[_0x06db('0xb5')](_0x1fd791[_0x06db('0xaa')][_0x06db('0xae')],_[_0x06db('0xb6')](_0x1fd791['body'],[_0x06db('0xae'),'id'])||{})[_0x06db('0xb7')](function(){return db[_0x06db('0xb8')][_0x06db('0xb3')]({'attributes':['id',_0x06db('0x2b'),_0x06db('0x42')],'where':{'id':_0x1fd791[_0x06db('0xaa')][_0x06db('0xae')]}});})[_0x06db('0x28')](function(_0x53f144){socket[_0x06db('0xb9')](_0x06db('0xba'),{'id':Number(_0x1fd791[_0x06db('0xa4')]['id']),'tags':_0x53f144||[]});return{'id':Number(_0x1fd791[_0x06db('0xa4')]['id']),'tags':_0x53f144||[]};});}})[_0x06db('0x28')](respondWithResult(_0x497179,null))[_0x06db('0x31')](handleError(_0x497179,null));};exports['removeTags']=function(_0x2a24ed,_0x3592a3,_0x341560){return db['OpenchannelInteraction'][_0x06db('0xa8')]({'where':{'id':_0x2a24ed[_0x06db('0xa4')]['id']}})['then'](handleEntityNotFound(_0x3592a3,null))[_0x06db('0x28')](function(_0x580240){if(_0x580240){return _0x580240[_0x06db('0xbb')](_0x2a24ed[_0x06db('0x35')]['ids']);}})['then'](respondWithStatusCode(_0x3592a3,null))[_0x06db('0x31')](handleError(_0x3592a3,null));};exports[_0x06db('0xbc')]=function(_0x35efff,_0x431d58){var _0x22db53=moment()[_0x06db('0xbd')]()[_0x06db('0x77')]();var _0x1399d3=path[_0x06db('0x78')](config[_0x06db('0xbe')],_0x06db('0xbf'),_0x06db('0xc0'),_0x06db('0xc1'));var _0x4a417a=path[_0x06db('0x78')](config[_0x06db('0xbe')],'server',_0x06db('0xc0'),_0x06db('0xc2'));var _0x186f16=path[_0x06db('0x78')](_0x1399d3,_0x22db53);var _0x51f478=util[_0x06db('0x5c')](_0x06db('0xc3'),_0x35efff['params']['id'],_0x22db53);var _0x4e76c6=path[_0x06db('0x78')](_0x1399d3,_0x51f478);var _0x271884=![];return db['OpenchannelInteraction']['find']({'where':{'id':_0x35efff[_0x06db('0xa4')]['id']},'include':[{'model':db['OpenchannelMessage'],'as':_0x06db('0xc4'),'attributes':['id','body',_0x06db('0x57'),'direction','secret'],'include':[{'model':db['User'],'as':_0x06db('0xc5'),'attributes':['id',_0x06db('0xc6')],'raw':!![]},{'model':db[_0x06db('0xc7')],'as':_0x06db('0xc8'),'attributes':['id',_0x06db('0xc9'),_0x06db('0xca')],'raw':!![]},{'model':db[_0x06db('0xcb')],'as':_0x06db('0xcb'),'raw':!![]}]},{'model':db['OpenchannelAccount'],'as':'Account','attributes':['id',_0x06db('0x2b')]},{'model':db[_0x06db('0xc5')],'as':'Owner','attributes':['id',_0x06db('0xc6')]}]})[_0x06db('0x28')](handleEntityNotFound(_0x431d58,null))[_0x06db('0x28')](function(_0x4e669a){if(_0x4e669a){var _0xdbadf0=_0x4e669a[_0x06db('0xcc')]({'plain':!![]});_0x271884=!![];var _0x5a5481={'format':'A4','border':_0x06db('0xcd'),'header':{'height':_0x06db('0xce'),'contents':{'first':_0x06db('0xcf')}},'footer':{'height':_0x06db('0xd0'),'contents':{'default':util[_0x06db('0x5c')](_0x06db('0xd1'),util[_0x06db('0x5c')](_0x06db('0xd2'),_0x06db('0xd3'),_0xdbadf0['id']),moment()['format'](_0x06db('0xd4'))['toString']())}}};fs[_0x06db('0xd5')](_0x186f16);var _0x52e4c7={'channel':_0x06db('0xd3'),'account':_0xdbadf0[_0x06db('0xd6')][_0x06db('0x2b')],'agent':_0xdbadf0[_0x06db('0xd7')]?_0xdbadf0[_0x06db('0xd7')]['fullname']:_0x06db('0xd8'),'createdAt':moment(_0xdbadf0['createdAt'])[_0x06db('0x5c')](_0x06db('0xb1'))[_0x06db('0x77')](),'closedAt':_0xdbadf0[_0x06db('0xd9')]?moment(_0xdbadf0[_0x06db('0xda')])[_0x06db('0x5c')](_0x06db('0xb1'))[_0x06db('0x77')]():'','disposition':_0xdbadf0['disposition'],'visibility':_0xdbadf0[_0x06db('0xdb')]?_0x06db('0xdc'):'Private','messages':_(_0xdbadf0['Messages'])[_0x06db('0x72')]({'secret':![]})['map'](function(_0x530bf6){if(_0x530bf6[_0x06db('0xcb')]){var _0x2f8e5a=path['join'](_0x4a417a,_0x530bf6[_0x06db('0xcb')][_0x06db('0xdd')]);if(fs[_0x06db('0xde')](_0x2f8e5a)){fs[_0x06db('0xdf')](_0x2f8e5a)['pipe'](fs[_0x06db('0xe0')](path[_0x06db('0x78')](_0x186f16,_0x530bf6[_0x06db('0xcb')][_0x06db('0xdd')])));}}return{'date':moment(_0x530bf6[_0x06db('0x57')])[_0x06db('0x5c')]('YYYY-MM-DD\x20HH:mm:ss')[_0x06db('0x77')](),'sender':_0x530bf6[_0x06db('0xe1')]===_0x06db('0xe2')?_0x530bf6[_0x06db('0xc5')]?_0x530bf6[_0x06db('0xc5')]['fullname']:_0x06db('0xe3'):_0x530bf6[_0x06db('0xc8')][_0x06db('0xc9')]+(_0x530bf6[_0x06db('0xc8')][_0x06db('0xca')]?'\x20'+_0x530bf6[_0x06db('0xc8')][_0x06db('0xca')]:''),'body':_0x530bf6[_0x06db('0xcb')]?_0x530bf6[_0x06db('0xcb')][_0x06db('0xdd')]:_0x530bf6[_0x06db('0xaa')],'direction':_0x530bf6[_0x06db('0xe1')]===_0x06db('0xe2')?'A':'C','secret':_0x530bf6[_0x06db('0xe4')],'attachment':_0x530bf6['Attachment']};})[_0x06db('0x58')]()};return ejs['renderFile'](path[_0x06db('0x78')](config[_0x06db('0xbe')],'server','views',_0x06db('0xe5')),{'interaction':_0x52e4c7})[_0x06db('0x28')](function(_0x53d5ef){return new BPromise(function(_0xd65534,_0x30ca95){pdf[_0x06db('0xa9')](_0x53d5ef,_0x5a5481)[_0x06db('0xe6')](path[_0x06db('0x78')](_0x186f16,'transcript-'+_0xdbadf0['id']+'-'+_0x22db53+_0x06db('0xe7')),function(_0x1663bd,_0x1855f5){if(_0x1663bd)return _0x30ca95(_0x1663bd);_0xd65534(_0x1855f5);});});});}})[_0x06db('0x28')](function(){if(_0x271884){return new BPromise(function(_0x319158,_0x557bef){zipdir(_0x186f16,{'saveTo':_0x4e76c6},function(_0x477e7b,_0x348209){if(_0x477e7b)return _0x557bef(_0x477e7b);return _0x319158(_0x348209);});})[_0x06db('0x28')](function(){return new BPromise(function(_0x17560a,_0x11414f){rimraf(_0x186f16,function(_0x2836c8){if(_0x2836c8)_0x11414f(_0x2836c8);return _0x17560a();});});})['then'](function(){return _0x431d58[_0x06db('0xbc')](_0x4e76c6,_0x51f478,function(_0x6d210d){if(_0x6d210d){console['log'](_0x06db('0xe8'),_0x6d210d);}else{fs['unlinkSync'](_0x4e76c6);}});});}else{return _0x431d58['sendStatus'](0xc8);}})[_0x06db('0x31')](handleError(_0x431d58,null));}; \ No newline at end of file +var _0xa499=['users','u.id\x20=\x20ui.UserId','openchannel_interactions','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','advancedFilter','parse','forEach','createdAt','value','startOf','day','utc','endOf','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','and','tableAlias','\x20=\x20?','LIKE','ContactId','c.firstName','c.lastName','\x20LIKE\x20?','c.email','\x20>\x20?','\x20<\x20?','\x20IN\x20?','filter','isNil','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','$gte','$lte','null','\x20IS\x20NULL','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','toString','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','group','i.id','Sequelize','QueryTypes','SELECT','clone','COUNT(*)','COUNT(me.id)','unreadMessages','read','having','`unreadMessages`\x20=\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','`unreadMessages`\x20>\x200','sequelize','Contact.firstName','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','params','includeAll','include','merge','options','create','body','find','destroy','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','format','addTags','setTags','findAll','removeTags','download','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Messages','direction','secret','User','CmContact','Contact','firstName','lastName','Attachment','OpenchannelAccount','Account','Owner','fullname','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\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\x20\x20\x20\x20\x20\x20','30px','%s\x20#%d','Openchannel','mkdirSync','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','threadId','Public','basename','out','System','renderFile','downloadInteraction.html','transcript-','.pdf','log','err','sendStatus','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','./openchannelInteraction.socket','register','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','map','TagIds','Tags','split','push','catch','index','OpenchannelInteraction','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','from','me.OpenchannelInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join'];(function(_0x306ac5,_0x6dde25){var _0x3b5795=function(_0x3ac676){while(--_0x3ac676){_0x306ac5['push'](_0x306ac5['shift']());}};_0x3b5795(++_0x6dde25);}(_0xa499,0x9a));var _0x9a49=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xa499[_0x209941];return _0x1e8729;};'use strict';var pdf=require(_0x9a49('0x0'));var emlformat=require(_0x9a49('0x1'));var rimraf=require(_0x9a49('0x2'));var zipdir=require(_0x9a49('0x3'));var jsonpatch=require(_0x9a49('0x4'));var rp=require(_0x9a49('0x5'));var moment=require('moment');var BPromise=require(_0x9a49('0x6'));var Mustache=require('mustache');var util=require(_0x9a49('0x7'));var path=require(_0x9a49('0x8'));var sox=require(_0x9a49('0x9'));var csv=require('to-csv');var ejs=require(_0x9a49('0xa'));var fs=require('fs');var _=require(_0x9a49('0xb'));var squel=require(_0x9a49('0xc'));var crypto=require(_0x9a49('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9a49('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9a49('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9a49('0x10'));var qs=require(_0x9a49('0x11'));var hardwareService=require(_0x9a49('0x12'));var logger=require(_0x9a49('0x13'))(_0x9a49('0x14'));var utils=require(_0x9a49('0x15'));var config=require(_0x9a49('0x16'));var db=require(_0x9a49('0x17'))['db'];config['redis']=_['defaults'](config[_0x9a49('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9a49('0x19'))[_0x9a49('0x1a')](socket);function respondWithStatusCode(_0xf6d956,_0x543f0b){_0x543f0b=_0x543f0b||0xcc;return function(_0x4944a5){if(_0x4944a5){return _0xf6d956['sendStatus'](_0x543f0b);}return _0xf6d956[_0x9a49('0x1b')](_0x543f0b)['end']();};}function respondWithResult(_0x56bca8,_0x445bf0){_0x445bf0=_0x445bf0||0xc8;return function(_0x68efc6){if(_0x68efc6){return _0x56bca8[_0x9a49('0x1b')](_0x445bf0)[_0x9a49('0x1c')](_0x68efc6);}};}function respondWithFilteredResult(_0x110ea1,_0x2e30ca){return function(_0x3fb7b4){if(_0x3fb7b4){var _0x5a769e=_0x3fb7b4[_0x9a49('0x1d')],_0x286061=_0x2e30ca[_0x9a49('0x1e')],_0x3a4965=_0x2e30ca[_0x9a49('0x1e')]+_0x2e30ca[_0x9a49('0x1f')],_0x1a4c93;if(_0x3a4965>=_0x5a769e){_0x3a4965=_0x5a769e;_0x1a4c93=0xc8;}else{_0x1a4c93=0xce;}_0x110ea1[_0x9a49('0x1b')](_0x1a4c93);return _0x110ea1[_0x9a49('0x20')](_0x9a49('0x21'),_0x286061+'-'+_0x3a4965+'/'+_0x5a769e)[_0x9a49('0x1c')](_0x3fb7b4);}return null;};}function patchUpdates(_0x56b836){return function(_0xb41f50){try{jsonpatch[_0x9a49('0x22')](_0xb41f50,_0x56b836,!![]);}catch(_0x45ac8a){return BPromise[_0x9a49('0x23')](_0x45ac8a);}return _0xb41f50[_0x9a49('0x24')]();};}function saveUpdates(_0x21eddc,_0xc45c9e){return function(_0x4c17b1){if(_0x4c17b1){return _0x4c17b1[_0x9a49('0x25')](_0x21eddc)[_0x9a49('0x26')](function(_0x1ecd19){return _0x1ecd19;});}return null;};}function removeEntity(_0x4b5fa5,_0x40abfe){return function(_0x5d979e){if(_0x5d979e){return _0x5d979e['destroy']()[_0x9a49('0x26')](function(){_0x4b5fa5[_0x9a49('0x1b')](0xcc)[_0x9a49('0x27')]();});}};}function handleEntityNotFound(_0x572fcc,_0x306d47){return function(_0x3dca46){if(!_0x3dca46){_0x572fcc['sendStatus'](0x194);}return _0x3dca46;};}function handleError(_0x3f4aca,_0x78c421){_0x78c421=_0x78c421||0x1f4;return function(_0x14fae7){logger['error'](_0x14fae7[_0x9a49('0x28')]);if(_0x14fae7[_0x9a49('0x29')]){delete _0x14fae7[_0x9a49('0x29')];}_0x3f4aca[_0x9a49('0x1b')](_0x78c421)[_0x9a49('0x2a')](_0x14fae7);};}function getInteractionUsers(_0x3e506f,_0x29ad6b){return new BPromise(function(_0x2ca116,_0x22b56e){try{if(_0x29ad6b[_0x3e506f['id']]){_0x3e506f['Users']=_[_0x9a49('0x2b')](_0x29ad6b[_0x3e506f['id']],function(_0x5c7c69){return{'id':_0x5c7c69['id']};});}}catch(_0x167960){_0x22b56e(_0x167960);}_0x2ca116(_0x3e506f);});}function getInteractionTags(_0xd58346,_0x1814b1){return new BPromise(function(_0x5b9b9d,_0x5f0b22){try{if(_0xd58346[_0x9a49('0x2c')]){_0xd58346[_0x9a49('0x2d')]=[];_0xd58346[_0x9a49('0x2c')][_0x9a49('0x2e')](',')['forEach'](function(_0x2e501e){_0xd58346[_0x9a49('0x2d')][_0x9a49('0x2f')](_0x1814b1[_0x2e501e]);});}delete _0xd58346[_0x9a49('0x2c')];}catch(_0x36bde9){_0x5f0b22(_0x36bde9);}_0x5b9b9d(_0xd58346);});}function updateOpenchannelInteraction(_0x2565b7,_0x1225ad,_0x371e13){return new BPromise(function(_0x1e4cd6,_0x4016ff){return getInteractionUsers(_0x2565b7,_0x371e13)[_0x9a49('0x26')](function(_0x2ddb03){return getInteractionTags(_0x2ddb03,_0x1225ad);})[_0x9a49('0x26')](function(_0x1842d3){_0x1e4cd6(_0x1842d3);})[_0x9a49('0x30')](function(_0x287cec){_0x4016ff(_0x287cec);});});}exports[_0x9a49('0x31')]=function(_0x22de5d,_0x1d583a){var _0x213cf1={},_0x1cc7ba={},_0x37958f={'count':0x0,'rows':[]};var _0xb91dff=db[_0x9a49('0x32')][_0x9a49('0x33')];_0x1cc7ba['model']=_[_0x9a49('0x34')](_0xb91dff);_0x1cc7ba['query']=_[_0x9a49('0x34')](_0x22de5d[_0x9a49('0x35')]);_0x1cc7ba[_0x9a49('0x36')]=_[_0x9a49('0x37')](_0x1cc7ba[_0x9a49('0x38')],_0x1cc7ba[_0x9a49('0x35')]);_0x213cf1[_0x9a49('0x39')]=_[_0x9a49('0x37')](_0x1cc7ba['model'],qs[_0x9a49('0x3a')](_0x22de5d['query']['fields']));_0x213cf1[_0x9a49('0x39')]=_0x213cf1[_0x9a49('0x39')][_0x9a49('0x3b')]?_0x213cf1[_0x9a49('0x39')]:_0x1cc7ba[_0x9a49('0x38')];if(!_0x22de5d[_0x9a49('0x35')][_0x9a49('0x3c')](_0x9a49('0x3d'))){_0x213cf1['limit']=qs[_0x9a49('0x1f')](_0x22de5d['query'][_0x9a49('0x1f')]);_0x213cf1[_0x9a49('0x1e')]=qs[_0x9a49('0x1e')](_0x22de5d[_0x9a49('0x35')]['offset']);}_0x213cf1[_0x9a49('0x3e')]=qs['sort'](_0x22de5d[_0x9a49('0x35')][_0x9a49('0x3f')]);_0x213cf1[_0x9a49('0x40')]=qs[_0x9a49('0x36')](_[_0x9a49('0x41')](_0x22de5d[_0x9a49('0x35')],_0x1cc7ba['filters']));var _0x196b27=[];var _0x13757a=squel[_0x9a49('0x42')]()['field']('id')[_0x9a49('0x43')]('name')[_0x9a49('0x43')](_0x9a49('0x44'))['from'](_0x9a49('0x45'));var _0x1f4522=squel['select']()[_0x9a49('0x43')]('COUNT(*)')[_0x9a49('0x46')]('openchannel_messages','me')[_0x9a49('0x40')](_0x9a49('0x47'))[_0x9a49('0x40')](_0x9a49('0x48'))[_0x9a49('0x40')](_0x9a49('0x49'));var _0x51f885=squel[_0x9a49('0x42')]()['field']('u.id')['field'](_0x9a49('0x4a'))[_0x9a49('0x46')](_0x9a49('0x4b'),'ui')[_0x9a49('0x4c')](_0x9a49('0x4d'),'u',_0x9a49('0x4e'));var _0x323178=squel[_0x9a49('0x42')]()[_0x9a49('0x46')](_0x9a49('0x4f'),'i')[_0x9a49('0x4c')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x9a49('0x4d'),'o','o.id\x20=\x20i.UserId')[_0x9a49('0x4c')](_0x9a49('0x50'),'a',_0x9a49('0x51'))['left_join'](_0x9a49('0x52'),'me',_0x9a49('0x53'));var _0x51e83d=squel[_0x9a49('0x54')]();if(_0x22de5d[_0x9a49('0x35')][_0x9a49('0x55')]){var _0x42d5d2=JSON[_0x9a49('0x56')](_0x22de5d['query'][_0x9a49('0x55')]);_[_0x9a49('0x34')](_0x42d5d2)[_0x9a49('0x57')](function(_0x5ba53b){var _0xb3a54b=_0x42d5d2[_0x5ba53b];if(_0x5ba53b===_0x9a49('0x58')){var _0x4586bb=moment(_0xb3a54b[_0x9a49('0x59')]['dateStart'])[_0x9a49('0x5a')](_0x9a49('0x5b'))[_0x9a49('0x5c')]()['format']();var _0x321738=moment(_0x321738)[_0x9a49('0x5c')]()[_0x9a49('0x5d')]('day')['format']();_0x51e83d['and'](_0x9a49('0x5e'),_0x4586bb,_0x321738);}else{if(_[_0x9a49('0x5f')](_0xb3a54b['condition'])){_0xb3a54b[_0x9a49('0x60')][_0x9a49('0x57')](function(_0x45f00a){switch(_0xb3a54b[_0x9a49('0x60')][_0x9a49('0x59')]){case'IS':if(_0x5ba53b!==_0x9a49('0x61')&&_0x5ba53b!=='unreadMessages'){if(_[_0x9a49('0x5f')](_0xb3a54b['value'])&&_0xb3a54b[_0x9a49('0x59')][_0x9a49('0x3b')]>0x1){_0x51e83d[_0x9a49('0x62')](_0xb3a54b[_0x9a49('0x63')]+'.'+_0x5ba53b+'\x20IN\x20?',_0xb3a54b['value']);}else{_0x51e83d[_0x9a49('0x62')](_0xb3a54b[_0x9a49('0x63')]+'.'+_0x5ba53b+_0x9a49('0x64'),_0xb3a54b['value'][0x0]);}}break;case'=':_0x51e83d['and'](_0xb3a54b[_0x9a49('0x63')]+'.'+_0x5ba53b+_0x9a49('0x64'),_0xb3a54b[_0x9a49('0x59')]);break;case _0x9a49('0x65'):if(_0x5ba53b===_0x9a49('0x66')){_0x51e83d['and'](_0x9a49('0x67')+'\x20LIKE\x20?','%'+_0xb3a54b[_0x9a49('0x59')]+'%');_0x51e83d['or'](_0x9a49('0x68')+_0x9a49('0x69'),'%'+_0xb3a54b[_0x9a49('0x59')]+'%');_0x51e83d['or'](_0x9a49('0x6a')+_0x9a49('0x69'),'%'+_0xb3a54b[_0x9a49('0x59')]+'%');}else{_0x51e83d[_0x9a49('0x62')](_0xb3a54b['tableAlias']+'.'+_0x5ba53b+_0x9a49('0x69'),'%'+_0xb3a54b[_0x9a49('0x59')]+'%');}break;case'>':_0x51e83d[_0x9a49('0x62')](_0xb3a54b[_0x9a49('0x63')]+'.'+_0x5ba53b+_0x9a49('0x6b'),_0xb3a54b[_0x9a49('0x59')]);break;case'<':_0x51e83d['and'](_0xb3a54b['tableAlias']+'.'+_0x5ba53b+_0x9a49('0x6c'),_0xb3a54b[_0x9a49('0x59')]);break;}});}else{switch(_0xb3a54b[_0x9a49('0x60')][_0x9a49('0x59')]){case'IS':if(_0x5ba53b!==_0x9a49('0x61')&&_0x5ba53b!=='unreadMessages'){if(_[_0x9a49('0x5f')](_0xb3a54b[_0x9a49('0x59')])&&_0xb3a54b['value'][_0x9a49('0x3b')]>0x1){_0x51e83d[_0x9a49('0x62')](_0xb3a54b[_0x9a49('0x63')]+'.'+_0x5ba53b+_0x9a49('0x6d'),_0xb3a54b['value']);}else{_0x51e83d[_0x9a49('0x62')](_0xb3a54b[_0x9a49('0x63')]+'.'+_0x5ba53b+_0x9a49('0x64'),_0xb3a54b[_0x9a49('0x59')][0x0]);}}break;case'=':_0x51e83d[_0x9a49('0x62')](_0xb3a54b[_0x9a49('0x63')]+'.'+_0x5ba53b+_0x9a49('0x64'),_0xb3a54b[_0x9a49('0x59')]);break;case'LIKE':if(_0x5ba53b===_0x9a49('0x66')){_0x51e83d[_0x9a49('0x62')]('c.firstName'+'\x20LIKE\x20?','%'+_0xb3a54b['value']+'%');_0x51e83d['or']('c.lastName'+'\x20LIKE\x20?','%'+_0xb3a54b[_0x9a49('0x59')]+'%');_0x51e83d['or'](_0x9a49('0x6a')+_0x9a49('0x69'),'%'+_0xb3a54b['value']+'%');}else{_0x51e83d[_0x9a49('0x62')](_0xb3a54b['tableAlias']+'.'+_0x5ba53b+_0x9a49('0x69'),'%'+_0xb3a54b[_0x9a49('0x59')]+'%');}break;case'>':_0x51e83d[_0x9a49('0x62')](_0xb3a54b[_0x9a49('0x63')]+'.'+_0x5ba53b+'\x20>\x20?',_0xb3a54b['value']);break;case'<':_0x51e83d[_0x9a49('0x62')](_0xb3a54b[_0x9a49('0x63')]+'.'+_0x5ba53b+_0x9a49('0x6c'),_0xb3a54b[_0x9a49('0x59')]);break;}}}});}else{var _0x4bc297=_(Object['keys'](_0x22de5d[_0x9a49('0x35')]))['map'](function(_0x236f91){return _0xb91dff[_0x9a49('0x3c')](_0x236f91)?_0x236f91:undefined;})[_0x9a49('0x6e')](function(_0x4c7e81){return!_[_0x9a49('0x6f')](_0x4c7e81);})[_0x9a49('0x59')]();if(!_[_0x9a49('0x70')](_0x4bc297)){_0x4bc297[_0x9a49('0x57')](function(_0x1b805b){if(_0x1b805b===_0x9a49('0x71')){_0x323178[_0x9a49('0x40')](_0x9a49('0x72'),[][_0x9a49('0x73')](_0x22de5d['query'][_0x1b805b]));}else if(_0x1b805b==='createdAt'){var _0x9f857c=JSON[_0x9a49('0x56')](_0x22de5d[_0x9a49('0x35')][_0x1b805b])[_0x9a49('0x74')];var _0x56b75a=JSON[_0x9a49('0x56')](_0x22de5d[_0x9a49('0x35')][_0x1b805b])[_0x9a49('0x75')];_0x323178[_0x9a49('0x40')](_0x9a49('0x5e'),_0x9f857c,_0x56b75a);}else{if(_0x22de5d[_0x9a49('0x35')][_0x1b805b]===_0x9a49('0x76')){_0x323178[_0x9a49('0x40')]('i.'+_0x1b805b+_0x9a49('0x77'));}else{_0x323178['where']('i.'+_0x1b805b+_0x9a49('0x64'),_0x22de5d[_0x9a49('0x35')][_0x1b805b]);}}});}if(_0x22de5d[_0x9a49('0x35')][_0x9a49('0x6e')]){var _0x386f4a=_0x22de5d['query'][_0x9a49('0x6e')][_0x9a49('0x78')]('\x5c','\x5c\x5c')[_0x9a49('0x78')]('\x27\x27',_0x9a49('0x79'));if(qs[_0x9a49('0x7a')](_0x386f4a)){_0x51e83d['or'](_0x9a49('0x7b'),_0x386f4a+'%');}else{var _0x40a2ad=[];_0x386f4a[_0x9a49('0x2e')]('\x20')['forEach'](function(_0x401bb5){_0x40a2ad['push']('+'+_0x401bb5[_0x9a49('0x7c')]());});var _0x3af90a=_0x40a2ad['join']('\x20');_0x51e83d['or'](_0x9a49('0x7d'),_0x3af90a)['or'](_0x9a49('0x7e'),_0x386f4a+'%')['or'](_0x9a49('0x7f'),_0x386f4a+'%');}}}_0x323178[_0x9a49('0x40')](_0x51e83d);if(_0x213cf1[_0x9a49('0x3e')]){_0x213cf1[_0x9a49('0x3e')][_0x9a49('0x57')](function(_0x309afb){_0x323178[_0x9a49('0x3e')]('i.'+_0x309afb[0x0],_0x309afb[0x1]===_0x9a49('0x80')?![]:!![]);});}_0x323178[_0x9a49('0x81')](_0x9a49('0x82'));var _0x14d798={'type':db[_0x9a49('0x83')][_0x9a49('0x84')][_0x9a49('0x85')],'raw':!![]};var _0x2f21be=_0x323178[_0x9a49('0x86')]()['field'](_0x9a49('0x87'))[_0x9a49('0x43')](_0x9a49('0x88'),_0x9a49('0x89'));if(!_0x22de5d[_0x9a49('0x35')][_0x9a49('0x55')]){if(_0x22de5d[_0x9a49('0x35')]['read']){if(_0x22de5d['query'][_0x9a49('0x8a')]==0x1){_0x2f21be[_0x9a49('0x8b')](_0x9a49('0x8c'));_0x323178[_0x9a49('0x8b')](_0x9a49('0x8c'));}else{_0x2f21be[_0x9a49('0x8b')]('`unreadMessages`\x20>\x200');_0x323178[_0x9a49('0x8b')]('`unreadMessages`\x20>\x200');}}if(_0x22de5d['query'][_0x9a49('0x8d')]){var _0x4b429f=_[_0x9a49('0x5f')](_0x22de5d[_0x9a49('0x35')][_0x9a49('0x8d')])?_0x22de5d['query'][_0x9a49('0x8d')]:new Array(_0x22de5d[_0x9a49('0x35')][_0x9a49('0x8d')]);var _0x256cc9=squel[_0x9a49('0x54')]();_0x4b429f[_0x9a49('0x57')](function(_0x1648d1){_0x256cc9['or'](_0x9a49('0x8e'),'%,'+_0x1648d1+',%');});_0x323178[_0x9a49('0x8b')](_0x256cc9);_0x2f21be[_0x9a49('0x4c')](_0x9a49('0x8f'),'it',_0x9a49('0x90'));_0x2f21be['left_join'](_0x9a49('0x45'),'t',_0x9a49('0x91'));_0x2f21be[_0x9a49('0x40')](_0x9a49('0x92'),_0x4b429f);}}else{var _0x42d5d2=JSON['parse'](_0x22de5d['query'][_0x9a49('0x55')]);_[_0x9a49('0x34')](_0x42d5d2)['forEach'](function(_0x33087f){var _0x343783=_0x42d5d2[_0x33087f];if(_0x33087f===_0x9a49('0x61')){var _0x26560e=_0x343783[_0x9a49('0x59')];var _0x57172c=squel[_0x9a49('0x54')]();_0x26560e[_0x9a49('0x57')](function(_0x470bfe){_0x57172c['or'](_0x9a49('0x8e'),'%,'+_0x470bfe+',%');});_0x323178['having'](_0x57172c);_0x2f21be['left_join'](_0x9a49('0x93'),'it',_0x9a49('0x94'));_0x2f21be['left_join']('tools_tags','t',_0x9a49('0x91'));_0x2f21be['where']('t.id\x20IN\x20?',_0x26560e);}else if(_0x33087f==='unreadMessages'){if(_0x343783['value'][_0x9a49('0x3b')]===0x1){if(_0x343783['value'][0x0]===0x1){_0x2f21be[_0x9a49('0x8b')]('`unreadMessages`\x20=\x200');_0x323178[_0x9a49('0x8b')](_0x9a49('0x8c'));}else{_0x2f21be[_0x9a49('0x8b')](_0x9a49('0x95'));_0x323178['having'](_0x9a49('0x95'));}}}});}db[_0x9a49('0x96')][_0x9a49('0x35')](_0x2f21be[_0x9a49('0x7c')](),_0x14d798)['then'](function(_0x36bca6){_0x37958f[_0x9a49('0x1d')]=_0x36bca6[_0x9a49('0x3b')];if(_0x37958f[_0x9a49('0x1d')]===0x0)return[];return db[_0x9a49('0x96')]['query'](_0x13757a[_0x9a49('0x7c')](),_0x14d798)['then'](function(_0x162743){_0x196b27=_['keyBy'](_0x162743,'id');_0x14d798=_['merge'](_0x14d798,{'model':db[_0x9a49('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x323178[_0x9a49('0x43')](_0x9a49('0x88'),_0x9a49('0x89'));_0x323178[_0x9a49('0x43')]('a.key','Account.key');_0x323178[_0x9a49('0x43')]('i.*');_0x323178[_0x9a49('0x43')](_0x9a49('0x67'),_0x9a49('0x97'));_0x323178[_0x9a49('0x43')](_0x9a49('0x68'),'Contact.lastName');_0x323178[_0x9a49('0x43')](_0x9a49('0x6a'),_0x9a49('0x98'));_0x323178['field'](_0x9a49('0x99'),'Contact.phone');_0x323178[_0x9a49('0x43')](_0x9a49('0x9a'),_0x9a49('0x9b'));_0x323178['field'](_0x9a49('0x9c'),_0x9a49('0x9d'));_0x323178['field'](_0x9a49('0x9e'),_0x9a49('0x2c'));_0x323178[_0x9a49('0x4c')]('openchannel_interaction_has_tags','it',_0x9a49('0x90'));_0x323178[_0x9a49('0x4c')](_0x9a49('0x45'),'t',_0x9a49('0x91'));_0x323178['limit'](_0x213cf1[_0x9a49('0x1f')]);_0x323178[_0x9a49('0x1e')](_0x213cf1[_0x9a49('0x1e')]);return db[_0x9a49('0x96')][_0x9a49('0x35')](_0x323178['toString'](),_0x14d798);})[_0x9a49('0x26')](function(_0x5e8de4){_0x51f885[_0x9a49('0x40')](_0x9a49('0x9f'),_[_0x9a49('0x2b')](_0x5e8de4,'id'));return db['sequelize']['query'](_0x51f885[_0x9a49('0x7c')](),_0x14d798)[_0x9a49('0x26')](function(_0x5d2a36){var _0xe183=_[_0x9a49('0xa0')](_0x5d2a36,_0x9a49('0xa1'));var _0x326817=[];_0x5e8de4[_0x9a49('0x57')](function(_0x3c62c9){_0x326817[_0x9a49('0x2f')](updateOpenchannelInteraction(_0x3c62c9,_0x196b27,_0xe183));});return BPromise[_0x9a49('0xa2')](_0x326817);});});})['then'](function(_0x55e831){_0x37958f[_0x9a49('0xa3')]=_0x55e831;return _0x37958f;})[_0x9a49('0x26')](respondWithFilteredResult(_0x1d583a,_0x213cf1))['catch'](handleError(_0x1d583a,null));};exports[_0x9a49('0xa4')]=function(_0x28bcc1,_0x29bccb){var _0x36d12b={'raw':![],'where':{'id':_0x28bcc1[_0x9a49('0xa5')]['id']}},_0x172e58={};_0x172e58[_0x9a49('0x38')]=_['keys'](db[_0x9a49('0x32')]['rawAttributes']);_0x172e58[_0x9a49('0x35')]=_[_0x9a49('0x34')](_0x28bcc1['query']);_0x172e58['filters']=_[_0x9a49('0x37')](_0x172e58['model'],_0x172e58[_0x9a49('0x35')]);_0x36d12b[_0x9a49('0x39')]=_[_0x9a49('0x37')](_0x172e58[_0x9a49('0x38')],qs['fields'](_0x28bcc1[_0x9a49('0x35')][_0x9a49('0x3a')]));_0x36d12b[_0x9a49('0x39')]=_0x36d12b[_0x9a49('0x39')]['length']?_0x36d12b[_0x9a49('0x39')]:_0x172e58[_0x9a49('0x38')];if(_0x28bcc1[_0x9a49('0x35')][_0x9a49('0xa6')]){_0x36d12b[_0x9a49('0xa7')]=[{'all':!![]}];}_0x36d12b=_[_0x9a49('0xa8')]({},_0x36d12b,_0x28bcc1[_0x9a49('0xa9')]);return db['OpenchannelInteraction']['find'](_0x36d12b)['then'](handleEntityNotFound(_0x29bccb,null))[_0x9a49('0x26')](respondWithResult(_0x29bccb,null))[_0x9a49('0x30')](handleError(_0x29bccb,null));};exports[_0x9a49('0xaa')]=function(_0x9edc09,_0xe5602){return db[_0x9a49('0x32')][_0x9a49('0xaa')](_0x9edc09[_0x9a49('0xab')],{})['then'](respondWithResult(_0xe5602,0xc9))['catch'](handleError(_0xe5602,null));};exports[_0x9a49('0x25')]=function(_0x71fb6b,_0x1687d4){if(_0x71fb6b[_0x9a49('0xab')]['id']){delete _0x71fb6b['body']['id'];}return db['OpenchannelInteraction'][_0x9a49('0xac')]({'where':{'id':_0x71fb6b['params']['id']}})[_0x9a49('0x26')](handleEntityNotFound(_0x1687d4,null))[_0x9a49('0x26')](saveUpdates(_0x71fb6b[_0x9a49('0xab')],null))[_0x9a49('0x26')](respondWithResult(_0x1687d4,null))[_0x9a49('0x30')](handleError(_0x1687d4,null));};exports[_0x9a49('0xad')]=function(_0x528336,_0x52779b){return db['OpenchannelInteraction'][_0x9a49('0xac')]({'where':{'id':_0x528336[_0x9a49('0xa5')]['id']}})['then'](handleEntityNotFound(_0x52779b,null))['then'](removeEntity(_0x52779b,null))['catch'](handleError(_0x52779b,null));};exports[_0x9a49('0xae')]=function(_0x30f88c,_0x4e8f33){return db[_0x9a49('0x32')]['describe']()['then'](respondWithResult(_0x4e8f33,null))['catch'](handleError(_0x4e8f33,null));};exports[_0x9a49('0xaf')]=function(_0xa1382d,_0x36e430,_0x2e4fca){return db[_0x9a49('0xb0')][_0x9a49('0xac')]({'where':{'id':_0xa1382d[_0x9a49('0xa5')]['id']}})['then'](handleEntityNotFound(_0x36e430,null))['then'](function(_0x300486){if(_0x300486){return _0x300486['addMessage'](_0xa1382d[_0x9a49('0xab')][_0x9a49('0xb1')],_[_0x9a49('0xb2')](_0xa1382d['body'],[_0x9a49('0xb1'),'id'])||{});}})['then'](respondWithResult(_0x36e430,null))[_0x9a49('0x30')](handleError(_0x36e430,null));};exports[_0x9a49('0xb3')]=function(_0x1bfd5c,_0x1ae23b,_0x2f9a3b){var _0x5612bc={'raw':![],'where':{}};var _0x3dcbe6={};var _0x33a471={'count':0x0,'rows':[]};return db[_0x9a49('0x32')][_0x9a49('0xb4')]({'where':{'id':_0x1bfd5c[_0x9a49('0xa5')]['id']}})[_0x9a49('0x26')](handleEntityNotFound(_0x1ae23b,null))[_0x9a49('0x26')](function(_0x238517){if(_0x238517){_0x3dcbe6[_0x9a49('0x38')]=_[_0x9a49('0x34')](db[_0x9a49('0xb0')]['rawAttributes']);_0x3dcbe6[_0x9a49('0x35')]=_[_0x9a49('0x34')](_0x1bfd5c['query']);_0x3dcbe6[_0x9a49('0x36')]=_[_0x9a49('0x37')](_0x3dcbe6[_0x9a49('0x38')],_0x3dcbe6['query']);_0x5612bc[_0x9a49('0x39')]=_[_0x9a49('0x37')](_0x3dcbe6['model'],qs[_0x9a49('0x3a')](_0x1bfd5c[_0x9a49('0x35')][_0x9a49('0x3a')]));_0x5612bc[_0x9a49('0x39')]=_0x5612bc[_0x9a49('0x39')][_0x9a49('0x3b')]?_0x5612bc[_0x9a49('0x39')]:_0x3dcbe6[_0x9a49('0x38')];if(!_0x1bfd5c[_0x9a49('0x35')]['hasOwnProperty']('nolimit')){_0x5612bc[_0x9a49('0x1f')]=qs[_0x9a49('0x1f')](_0x1bfd5c[_0x9a49('0x35')][_0x9a49('0x1f')]);_0x5612bc[_0x9a49('0x1e')]=qs[_0x9a49('0x1e')](_0x1bfd5c['query'][_0x9a49('0x1e')]);}_0x5612bc['order']=qs[_0x9a49('0x3f')](_0x1bfd5c[_0x9a49('0x35')][_0x9a49('0x3f')]);_0x5612bc[_0x9a49('0x40')]=qs[_0x9a49('0x36')](_[_0x9a49('0x41')](_0x1bfd5c['query'],_0x3dcbe6['filters']));_0x5612bc[_0x9a49('0x40')][_0x9a49('0xa1')]=_0x238517['id'];if(_0x1bfd5c[_0x9a49('0x35')][_0x9a49('0x6e')]){_0x5612bc[_0x9a49('0x40')]=_[_0x9a49('0xa8')](_0x5612bc[_0x9a49('0x40')],{'$or':_[_0x9a49('0x2b')](_0x5612bc[_0x9a49('0x39')],function(_0x516a4e){var _0x523ce2={};_0x523ce2[_0x516a4e]={'$like':'%'+_0x1bfd5c[_0x9a49('0x35')][_0x9a49('0x6e')]+'%'};return _0x523ce2;})});}if(_0x1bfd5c[_0x9a49('0x35')][_0x9a49('0x74')]){var _0x4feb93=_0x1bfd5c[_0x9a49('0x35')][_0x9a49('0x74')][_0x9a49('0x2e')](',');var _0x40f967={};_0x40f967[_0x4feb93[0x0]]={'$gte':moment(_0x4feb93[0x1])[_0x9a49('0xb5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5612bc[_0x9a49('0x40')]=_[_0x9a49('0xa8')](_0x5612bc[_0x9a49('0x40')],_0x40f967);}_0x5612bc=_[_0x9a49('0xa8')]({},_0x5612bc,_0x1bfd5c[_0x9a49('0xa9')]);return db[_0x9a49('0xb0')][_0x9a49('0x1d')]({'where':_0x5612bc[_0x9a49('0x40')]})['then'](function(_0x5ea23a){_0x33a471[_0x9a49('0x1d')]=_0x5ea23a;if(_0x1bfd5c[_0x9a49('0x35')][_0x9a49('0xa6')]){_0x5612bc[_0x9a49('0xa7')]=[{'all':!![]}];}return db[_0x9a49('0xb0')]['findAll'](_0x5612bc);})[_0x9a49('0x26')](function(_0x48d0b0){_0x33a471['rows']=_0x48d0b0;return _0x33a471;});}})[_0x9a49('0x26')](respondWithFilteredResult(_0x1ae23b,_0x5612bc))['catch'](handleError(_0x1ae23b,null));};exports[_0x9a49('0xb6')]=function(_0x35a96b,_0xd03f88,_0xad6924){return db['OpenchannelInteraction']['find']({'where':{'id':_0x35a96b[_0x9a49('0xa5')]['id']}})[_0x9a49('0x26')](handleEntityNotFound(_0xd03f88,null))[_0x9a49('0x26')](function(_0x277d42){if(_0x277d42){return _0x277d42[_0x9a49('0xb7')](_0x35a96b[_0x9a49('0xab')]['ids'],_[_0x9a49('0xb2')](_0x35a96b[_0x9a49('0xab')],[_0x9a49('0xb1'),'id'])||{})['spread'](function(){return db['Tag'][_0x9a49('0xb8')]({'attributes':['id',_0x9a49('0x29'),_0x9a49('0x44')],'where':{'id':_0x35a96b[_0x9a49('0xab')][_0x9a49('0xb1')]}});})[_0x9a49('0x26')](function(_0x5a4c21){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0x35a96b[_0x9a49('0xa5')]['id']),'tags':_0x5a4c21||[]});return{'id':Number(_0x35a96b[_0x9a49('0xa5')]['id']),'tags':_0x5a4c21||[]};});}})['then'](respondWithResult(_0xd03f88,null))['catch'](handleError(_0xd03f88,null));};exports[_0x9a49('0xb9')]=function(_0x2bbcf9,_0x4c3eee,_0xff5f1d){return db[_0x9a49('0x32')]['find']({'where':{'id':_0x2bbcf9[_0x9a49('0xa5')]['id']}})['then'](handleEntityNotFound(_0x4c3eee,null))[_0x9a49('0x26')](function(_0x2cfcb9){if(_0x2cfcb9){return _0x2cfcb9[_0x9a49('0xb9')](_0x2bbcf9[_0x9a49('0x35')][_0x9a49('0xb1')]);}})['then'](respondWithStatusCode(_0x4c3eee,null))[_0x9a49('0x30')](handleError(_0x4c3eee,null));};exports[_0x9a49('0xba')]=function(_0x5125a3,_0xf728e9){var _0x579a48=moment()['unix']()[_0x9a49('0x7c')]();var _0x1f4bca=path[_0x9a49('0xbb')](config[_0x9a49('0xbc')],_0x9a49('0xbd'),_0x9a49('0xbe'),_0x9a49('0xbf'));var _0x42bffc=path[_0x9a49('0xbb')](config[_0x9a49('0xbc')],_0x9a49('0xbd'),_0x9a49('0xbe'),_0x9a49('0xc0'));var _0x453228=path[_0x9a49('0xbb')](_0x1f4bca,_0x579a48);var _0x4c57e1=util['format'](_0x9a49('0xc1'),_0x5125a3[_0x9a49('0xa5')]['id'],_0x579a48);var _0x5c18fd=path['join'](_0x1f4bca,_0x4c57e1);var _0x12ac64=![];return db[_0x9a49('0x32')][_0x9a49('0xac')]({'where':{'id':_0x5125a3[_0x9a49('0xa5')]['id']},'include':[{'model':db[_0x9a49('0xb0')],'as':_0x9a49('0xc2'),'attributes':['id',_0x9a49('0xab'),'createdAt',_0x9a49('0xc3'),_0x9a49('0xc4')],'include':[{'model':db[_0x9a49('0xc5')],'as':_0x9a49('0xc5'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0x9a49('0xc6')],'as':_0x9a49('0xc7'),'attributes':['id',_0x9a49('0xc8'),_0x9a49('0xc9')],'raw':!![]},{'model':db[_0x9a49('0xca')],'as':_0x9a49('0xca'),'raw':!![]}]},{'model':db[_0x9a49('0xcb')],'as':_0x9a49('0xcc'),'attributes':['id','name']},{'model':db['User'],'as':_0x9a49('0xcd'),'attributes':['id',_0x9a49('0xce')]}]})[_0x9a49('0x26')](handleEntityNotFound(_0xf728e9,null))['then'](function(_0x46cebe){if(_0x46cebe){var _0x14cae9=_0x46cebe[_0x9a49('0xcf')]({'plain':!![]});_0x12ac64=!![];var _0x295d9f={'format':'A4','border':_0x9a49('0xd0'),'header':{'height':_0x9a49('0xd1'),'contents':{'first':_0x9a49('0xd2')}},'footer':{'height':_0x9a49('0xd3'),'contents':{'default':util['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\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\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\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\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\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\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\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\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\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\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',util[_0x9a49('0xb5')](_0x9a49('0xd4'),_0x9a49('0xd5'),_0x14cae9['id']),moment()[_0x9a49('0xb5')]('YYYY-MM-DD')['toString']())}}};fs[_0x9a49('0xd6')](_0x453228);var _0x423811={'channel':_0x9a49('0xd5'),'account':_0x14cae9[_0x9a49('0xcc')][_0x9a49('0x29')],'agent':_0x14cae9['Owner']?_0x14cae9[_0x9a49('0xcd')][_0x9a49('0xce')]:_0x9a49('0xd7'),'createdAt':moment(_0x14cae9[_0x9a49('0x58')])[_0x9a49('0xb5')](_0x9a49('0xd8'))[_0x9a49('0x7c')](),'closedAt':_0x14cae9['closed']?moment(_0x14cae9[_0x9a49('0xd9')])[_0x9a49('0xb5')](_0x9a49('0xd8'))[_0x9a49('0x7c')]():'','disposition':_0x14cae9[_0x9a49('0xda')],'visibility':_0x14cae9[_0x9a49('0xdb')]?_0x9a49('0xdc'):'Private','messages':_(_0x14cae9[_0x9a49('0xc2')])['filter']({'secret':![]})[_0x9a49('0x2b')](function(_0x47a7dd){if(_0x47a7dd[_0x9a49('0xca')]){var _0xa1f8a4=path[_0x9a49('0xbb')](_0x42bffc,_0x47a7dd[_0x9a49('0xca')][_0x9a49('0xdd')]);if(fs['existsSync'](_0xa1f8a4)){fs['createReadStream'](_0xa1f8a4)['pipe'](fs['createWriteStream'](path[_0x9a49('0xbb')](_0x453228,_0x47a7dd[_0x9a49('0xca')]['basename'])));}}return{'date':moment(_0x47a7dd[_0x9a49('0x58')])[_0x9a49('0xb5')](_0x9a49('0xd8'))[_0x9a49('0x7c')](),'sender':_0x47a7dd[_0x9a49('0xc3')]===_0x9a49('0xde')?_0x47a7dd['User']?_0x47a7dd['User'][_0x9a49('0xce')]:_0x9a49('0xdf'):_0x47a7dd[_0x9a49('0xc7')][_0x9a49('0xc8')]+(_0x47a7dd[_0x9a49('0xc7')]['lastName']?'\x20'+_0x47a7dd['Contact']['lastName']:''),'body':_0x47a7dd[_0x9a49('0xca')]?_0x47a7dd['Attachment'][_0x9a49('0xdd')]:_0x47a7dd[_0x9a49('0xab')],'direction':_0x47a7dd[_0x9a49('0xc3')]===_0x9a49('0xde')?'A':'C','secret':_0x47a7dd[_0x9a49('0xc4')],'attachment':_0x47a7dd[_0x9a49('0xca')]};})[_0x9a49('0x59')]()};return ejs[_0x9a49('0xe0')](path[_0x9a49('0xbb')](config[_0x9a49('0xbc')],'server','views',_0x9a49('0xe1')),{'interaction':_0x423811})[_0x9a49('0x26')](function(_0x593c6b){return new BPromise(function(_0x40786b,_0x35abfa){pdf[_0x9a49('0xaa')](_0x593c6b,_0x295d9f)['toFile'](path[_0x9a49('0xbb')](_0x453228,_0x9a49('0xe2')+_0x14cae9['id']+'-'+_0x579a48+_0x9a49('0xe3')),function(_0x5a63ef,_0x39f639){if(_0x5a63ef)return _0x35abfa(_0x5a63ef);_0x40786b(_0x39f639);});});});}})[_0x9a49('0x26')](function(){if(_0x12ac64){return new BPromise(function(_0x331909,_0x580f98){zipdir(_0x453228,{'saveTo':_0x5c18fd},function(_0x48e8a3,_0x169099){if(_0x48e8a3)return _0x580f98(_0x48e8a3);return _0x331909(_0x169099);});})[_0x9a49('0x26')](function(){return new BPromise(function(_0x226467,_0x5cba50){rimraf(_0x453228,function(_0x573db9){if(_0x573db9)_0x5cba50(_0x573db9);return _0x226467();});});})['then'](function(){return _0xf728e9[_0x9a49('0xba')](_0x5c18fd,_0x4c57e1,function(_0x4cb419){if(_0x4cb419){console[_0x9a49('0xe4')](_0x9a49('0xe5'),_0x4cb419);}else{fs['unlinkSync'](_0x5c18fd);}});});}else{return _0xf728e9[_0x9a49('0xe6')](0xc8);}})[_0x9a49('0x30')](handleError(_0xf728e9,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 7fa7b04..e78bf05 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 _0xefaa=['../../mysqldb','OpenchannelInteraction','setMaxListeners','update','remove','getUsers','then','Users','map','setDataValue','unreadMessages','emit'];(function(_0x2272b5,_0x362458){var _0x110156=function(_0x5c2e32){while(--_0x5c2e32){_0x2272b5['push'](_0x2272b5['shift']());}};_0x110156(++_0x362458);}(_0xefaa,0x138));var _0xaefa=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xefaa[_0x618414];return _0x21c19a;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xaefa('0x0'))['db'][_0xaefa('0x1')];var OpenchannelMessage=require(_0xaefa('0x0'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xaefa('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xaefa('0x3'),'afterDestroy':_0xaefa('0x4')};function emitEvent(_0x397691){return function(_0x2c3354,_0xf563b,_0xc2296c){_0x2c3354[_0xaefa('0x5')]({'attributes':['id'],'raw':!![]})[_0xaefa('0x6')](function(_0x2fcc59){_0x2c3354['setDataValue'](_0xaefa('0x7'),_0x2fcc59[_0xaefa('0x8')](function(_0x54704d){return{'id':_0x54704d['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x2c3354['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaefa('0x6')](function(_0x2245b0){_0x2c3354[_0xaefa('0x9')](_0xaefa('0xa'),_0x2245b0['length']);OpenchannelInteractionEvents[_0xaefa('0xb')](_0x397691+':'+_0x2c3354['id'],_0x2c3354);OpenchannelInteractionEvents[_0xaefa('0xb')](_0x397691,_0x2c3354);_0xc2296c(null);})['catch'](_0xc2296c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0xdc45=['update','remove','getUsers','setDataValue','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','OpenchannelInteraction','setMaxListeners'];(function(_0x596c92,_0x49c3aa){var _0x4a4707=function(_0x1e0ce4){while(--_0x1e0ce4){_0x596c92['push'](_0x596c92['shift']());}};_0x4a4707(++_0x49c3aa);}(_0xdc45,0x178));var _0x5dc4=function(_0x47bb4b,_0x38d318){_0x47bb4b=_0x47bb4b-0x0;var _0x25b71e=_0xdc45[_0x47bb4b];return _0x25b71e;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require('../../mysqldb')['db'][_0x5dc4('0x0')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x5dc4('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5dc4('0x2'),'afterDestroy':_0x5dc4('0x3')};function emitEvent(_0x3cf767){return function(_0x567a8e,_0x1d92b8,_0x5341b6){_0x567a8e[_0x5dc4('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x506d14){_0x567a8e[_0x5dc4('0x5')]('Users',_0x506d14['map'](function(_0x1d6a89){return{'id':_0x1d6a89['id']};}));return OpenchannelMessage[_0x5dc4('0x6')]({'where':{'OpenchannelInteractionId':_0x567a8e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5dc4('0x7')](function(_0x97a5dd){_0x567a8e[_0x5dc4('0x5')](_0x5dc4('0x8'),_0x97a5dd[_0x5dc4('0x9')]);OpenchannelInteractionEvents[_0x5dc4('0xa')](_0x3cf767+':'+_0x567a8e['id'],_0x567a8e);OpenchannelInteractionEvents[_0x5dc4('0xa')](_0x3cf767,_0x567a8e);_0x5341b6(null);})[_0x5dc4('0xb')](_0x5341b6(null));};}for(var e in events){if(events[_0x5dc4('0xc')](e)){var event=events[e];OpenchannelInteraction[_0x5dc4('0xd')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 7ff6099..3e4fceb 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 _0x8c32=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','changed','closed','lodash','util'];(function(_0x481ee8,_0x5aa574){var _0x5ad55f=function(_0x81c176){while(--_0x81c176){_0x481ee8['push'](_0x481ee8['shift']());}};_0x5ad55f(++_0x5aa574);}(_0x8c32,0x130));var _0x28c3=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x8c32[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0x28c3('0x0'));var util=require(_0x28c3('0x1'));var logger=require(_0x28c3('0x2'))(_0x28c3('0x3'));var moment=require(_0x28c3('0x4'));var BPromise=require(_0x28c3('0x5'));var rp=require(_0x28c3('0x6'));var fs=require('fs');var path=require(_0x28c3('0x7'));var rimraf=require(_0x28c3('0x8'));var config=require(_0x28c3('0x9'));var attributes=require(_0x28c3('0xa'));module[_0x28c3('0xb')]=function(_0x537b4f,_0x2861c9){return _0x537b4f[_0x28c3('0xc')](_0x28c3('0xd'),attributes,{'tableName':_0x28c3('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xbaee6f,_0x2fb4cb,_0x5420dc){if(_0xbaee6f[_0x28c3('0xf')](_0x28c3('0x10'))){_0xbaee6f['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x5420dc(null,_0xbaee6f);}}});}; \ No newline at end of file +var _0x3435=['../../config/logger','api','moment','bluebird','path','rimraf','exports','OpenchannelInteraction','openchannel_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x287f9b,_0x557885){var _0x5248bb=function(_0x441bb0){while(--_0x441bb0){_0x287f9b['push'](_0x287f9b['shift']());}};_0x5248bb(++_0x557885);}(_0x3435,0xfa));var _0x5343=function(_0x6e1239,_0x3562ac){_0x6e1239=_0x6e1239-0x0;var _0x418150=_0x3435[_0x6e1239];return _0x418150;};'use strict';var _=require(_0x5343('0x0'));var util=require(_0x5343('0x1'));var logger=require(_0x5343('0x2'))(_0x5343('0x3'));var moment=require(_0x5343('0x4'));var BPromise=require(_0x5343('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5343('0x6'));var rimraf=require(_0x5343('0x7'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0x5343('0x8')]=function(_0x28f0f3,_0x4d26b5){return _0x28f0f3['define'](_0x5343('0x9'),attributes,{'tableName':_0x5343('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x9ea9b6,_0x245034,_0x41673f){if(_0x9ea9b6['changed'](_0x5343('0xb'))){_0x9ea9b6['closedAt']=moment()[_0x5343('0xc')](_0x5343('0xd'));}_0x41673f(null,_0x9ea9b6);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index a5f4c8e..9db6cf2 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 _0x3435=['info','OpenchannelInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','where','attributes','limit','then','catch','AddTagsToOpenchannelInteraction','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','request'];(function(_0x142ec2,_0x5bb03d){var _0x45ef4e=function(_0x4bc513){while(--_0x4bc513){_0x142ec2['push'](_0x142ec2['shift']());}};_0x45ef4e(++_0x5bb03d);}(_0x3435,0xfa));var _0x5343=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x3435[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0x5343('0x0'));var util=require(_0x5343('0x1'));var moment=require(_0x5343('0x2'));var BPromise=require(_0x5343('0x3'));var rs=require(_0x5343('0x4'));var fs=require('fs');var Redis=require(_0x5343('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5343('0x6'));var logger=require(_0x5343('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5343('0x8'));var client=jayson[_0x5343('0x9')]['http']({'port':0x232a});config['redis']=_[_0x5343('0xa')](config[_0x5343('0xb')],{'host':_0x5343('0xc'),'port':0x18eb});var socket=require(_0x5343('0xd'))(new Redis(config[_0x5343('0xb')]));require('./openchannelInteraction.socket')[_0x5343('0xe')](socket);function respondWithRpcPromise(_0x50d857,_0x1b310a,_0x328e54){return new BPromise(function(_0x27ed68,_0x2e6df1){return client[_0x5343('0xf')](_0x50d857,_0x328e54)['then'](function(_0x42a94a){logger[_0x5343('0x10')](_0x5343('0x11'),_0x1b310a,'request\x20sent');logger[_0x5343('0x12')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x1b310a,_0x5343('0x13'),JSON[_0x5343('0x14')](_0x42a94a));if(_0x42a94a['error']){if(_0x42a94a[_0x5343('0x15')]['code']===0x1f4){logger[_0x5343('0x15')](_0x5343('0x11'),_0x1b310a,_0x42a94a[_0x5343('0x15')][_0x5343('0x16')]);return _0x2e6df1(_0x42a94a['error'][_0x5343('0x16')]);}logger[_0x5343('0x15')](_0x5343('0x11'),_0x1b310a,_0x42a94a[_0x5343('0x15')][_0x5343('0x16')]);return _0x27ed68(_0x42a94a[_0x5343('0x15')][_0x5343('0x16')]);}else{logger[_0x5343('0x10')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1b310a,_0x5343('0x13'));_0x27ed68(_0x42a94a[_0x5343('0x17')][_0x5343('0x16')]);}})['catch'](function(_0x1eb3bd){logger[_0x5343('0x15')](_0x5343('0x11'),_0x1b310a,_0x1eb3bd);_0x2e6df1(_0x1eb3bd);});});}exports[_0x5343('0x18')]=function(_0x35e68c){var _0xd93241=this;return new Promise(function(_0x132505,_0x40ba38){return db[_0x5343('0x19')]['update'](_0x35e68c[_0x5343('0x1a')],{'raw':_0x35e68c[_0x5343('0x1b')]?_0x35e68c[_0x5343('0x1b')][_0x5343('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35e68c[_0x5343('0x1b')]?_0x35e68c['options'][_0x5343('0x1d')]||null:null,'attributes':_0x35e68c[_0x5343('0x1b')]?_0x35e68c[_0x5343('0x1b')][_0x5343('0x1e')]||null:null,'limit':_0x35e68c[_0x5343('0x1b')]?_0x35e68c['options'][_0x5343('0x1f')]||null:null})[_0x5343('0x20')](function(_0x584034){logger[_0x5343('0x10')](_0x5343('0x18'),_0x35e68c);logger[_0x5343('0x12')]('UpdateOpenchannelInteraction',_0x35e68c,JSON['stringify'](_0x584034));_0x132505(_0x584034);})[_0x5343('0x21')](function(_0x5871de){logger[_0x5343('0x15')]('UpdateOpenchannelInteraction',_0x5871de[_0x5343('0x16')],_0x35e68c);_0x40ba38(_0xd93241['error'](0x1f4,_0x5871de['message']));});});};exports[_0x5343('0x22')]=function(_0x4cb858){return new Promise(function(_0x551bf4,_0x5d597e){return db[_0x5343('0x19')]['find']({'where':_0x4cb858[_0x5343('0x1b')]?_0x4cb858['options']['where']||null:null})[_0x5343('0x20')](function(_0x5b44d7){if(_0x5b44d7){return _0x5b44d7['addTags'](_0x4cb858[_0x5343('0x1a')][_0x5343('0x23')],_[_0x5343('0x24')](_0x4cb858[_0x5343('0x1a')],['ids','id'])||{});}})['spread'](function(_0x1f8ee9){logger[_0x5343('0x10')](_0x5343('0x25'),_0x4cb858);logger[_0x5343('0x12')](_0x5343('0x25'),_0x4cb858,JSON[_0x5343('0x14')](_0x1f8ee9));_0x551bf4(_0x1f8ee9);})[_0x5343('0x21')](function(_0x3e4f8f){logger[_0x5343('0x15')](_0x5343('0x25'),_0x3e4f8f[_0x5343('0x16')],_0x4cb858);_0x5d597e(_this[_0x5343('0x15')](0x1f4,_0x3e4f8f['message']));});});}; \ No newline at end of file +var _0x7046=['ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','update','body','options','where','limit','AddTagsToOpenchannelInteraction','OpenchannelInteraction'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7046,0x144));var _0x6704=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x7046[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var moment=require(_0x6704('0x2'));var BPromise=require(_0x6704('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6704('0x4'));var db=require(_0x6704('0x5'))['db'];var utils=require(_0x6704('0x6'));var logger=require('../../config/logger')(_0x6704('0x7'));var config=require(_0x6704('0x8'));var jayson=require(_0x6704('0x9'));var client=jayson[_0x6704('0xa')][_0x6704('0xb')]({'port':0x232a});config['redis']=_[_0x6704('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6704('0xd'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x6704('0xe')](socket);function respondWithRpcPromise(_0x394ef4,_0x37a1ad,_0x454bd5){return new BPromise(function(_0x356687,_0x40d57d){return client[_0x6704('0xf')](_0x394ef4,_0x454bd5)[_0x6704('0x10')](function(_0x58cc09){logger[_0x6704('0x11')](_0x6704('0x12'),_0x37a1ad,'request\x20sent');logger[_0x6704('0x13')](_0x6704('0x14'),_0x37a1ad,_0x6704('0x15'),JSON[_0x6704('0x16')](_0x58cc09));if(_0x58cc09[_0x6704('0x17')]){if(_0x58cc09[_0x6704('0x17')][_0x6704('0x18')]===0x1f4){logger[_0x6704('0x17')](_0x6704('0x12'),_0x37a1ad,_0x58cc09['error'][_0x6704('0x19')]);return _0x40d57d(_0x58cc09[_0x6704('0x17')][_0x6704('0x19')]);}logger['error'](_0x6704('0x12'),_0x37a1ad,_0x58cc09[_0x6704('0x17')][_0x6704('0x19')]);return _0x356687(_0x58cc09[_0x6704('0x17')][_0x6704('0x19')]);}else{logger['info'](_0x6704('0x12'),_0x37a1ad,_0x6704('0x15'));_0x356687(_0x58cc09[_0x6704('0x1a')][_0x6704('0x19')]);}})[_0x6704('0x1b')](function(_0x5df2df){logger[_0x6704('0x17')](_0x6704('0x12'),_0x37a1ad,_0x5df2df);_0x40d57d(_0x5df2df);});});}exports[_0x6704('0x1c')]=function(_0x156106){var _0x35eb99=this;return new Promise(function(_0x301fea,_0x42b27f){return db['OpenchannelInteraction'][_0x6704('0x1d')](_0x156106[_0x6704('0x1e')],{'raw':_0x156106[_0x6704('0x1f')]?_0x156106['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x156106[_0x6704('0x1f')]?_0x156106[_0x6704('0x1f')][_0x6704('0x20')]||null:null,'attributes':_0x156106[_0x6704('0x1f')]?_0x156106[_0x6704('0x1f')]['attributes']||null:null,'limit':_0x156106[_0x6704('0x1f')]?_0x156106[_0x6704('0x1f')][_0x6704('0x21')]||null:null})[_0x6704('0x10')](function(_0x16b6b9){logger[_0x6704('0x11')](_0x6704('0x1c'),_0x156106);logger[_0x6704('0x13')](_0x6704('0x1c'),_0x156106,JSON[_0x6704('0x16')](_0x16b6b9));_0x301fea(_0x16b6b9);})[_0x6704('0x1b')](function(_0x1bdfee){logger[_0x6704('0x17')]('UpdateOpenchannelInteraction',_0x1bdfee['message'],_0x156106);_0x42b27f(_0x35eb99[_0x6704('0x17')](0x1f4,_0x1bdfee[_0x6704('0x19')]));});});};exports[_0x6704('0x22')]=function(_0x38f9fe){return new Promise(function(_0x4a9c3e,_0x1def46){return db[_0x6704('0x23')]['find']({'where':_0x38f9fe['options']?_0x38f9fe[_0x6704('0x1f')]['where']||null:null})[_0x6704('0x10')](function(_0x5c7e10){if(_0x5c7e10){return _0x5c7e10['addTags'](_0x38f9fe[_0x6704('0x1e')][_0x6704('0x24')],_[_0x6704('0x25')](_0x38f9fe['body'],[_0x6704('0x24'),'id'])||{});}})[_0x6704('0x26')](function(_0x3c8263){logger[_0x6704('0x11')](_0x6704('0x27'),_0x38f9fe);logger[_0x6704('0x13')](_0x6704('0x27'),_0x38f9fe,JSON[_0x6704('0x16')](_0x3c8263));_0x4a9c3e(_0x3c8263);})[_0x6704('0x1b')](function(_0xa151eb){logger[_0x6704('0x17')](_0x6704('0x27'),_0xa151eb[_0x6704('0x19')],_0x38f9fe);_0x1def46(_this[_0x6704('0x17')](0x1f4,_0xa151eb[_0x6704('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 54d743d..751227a 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 _0xc55f=['update','emit','register','openchannelInteraction:','save','remove'];(function(_0xc5e8f9,_0xd44bc9){var _0x24ead4=function(_0x175595){while(--_0x175595){_0xc5e8f9['push'](_0xc5e8f9['shift']());}};_0x24ead4(++_0xd44bc9);}(_0xc55f,0x6a));var _0xfc55=function(_0x4b90cb,_0x27d753){_0x4b90cb=_0x4b90cb-0x0;var _0x1f64ba=_0xc55f[_0x4b90cb];return _0x1f64ba;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0xfc55('0x0'),_0xfc55('0x1'),_0xfc55('0x2')];function createListener(_0x35df03,_0x476bde){return function(_0x5c3ea6){_0x476bde[_0xfc55('0x3')](_0x35df03,_0x5c3ea6);};}function removeListener(_0x42c1da,_0x319803){return function(){OpenchannelInteractionEvents['removeListener'](_0x42c1da,_0x319803);};}exports[_0xfc55('0x4')]=function(_0x24e72f){for(var _0x1c1ab1=0x0,_0x3b2ab7=events['length'];_0x1c1ab1<_0x3b2ab7;_0x1c1ab1++){var _0xaa743=events[_0x1c1ab1];var _0x5e8afb=createListener(_0xfc55('0x5')+_0xaa743,_0x24e72f);OpenchannelInteractionEvents['on'](_0xaa743,_0x5e8afb);}}; \ No newline at end of file +var _0x9c79=['remove','emit','removeListener','length','openchannelInteraction:','save'];(function(_0x554a97,_0x451b7b){var _0xfecaa0=function(_0x10283a){while(--_0x10283a){_0x554a97['push'](_0x554a97['shift']());}};_0xfecaa0(++_0x451b7b);}(_0x9c79,0x125));var _0x99c7=function(_0x43e918,_0x363513){_0x43e918=_0x43e918-0x0;var _0x1694fd=_0x9c79[_0x43e918];return _0x1694fd;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x99c7('0x0'),_0x99c7('0x1'),'update'];function createListener(_0x45e0be,_0x4f2991){return function(_0x3cfad0){_0x4f2991[_0x99c7('0x2')](_0x45e0be,_0x3cfad0);};}function removeListener(_0x271dfa,_0x2c5661){return function(){OpenchannelInteractionEvents[_0x99c7('0x3')](_0x271dfa,_0x2c5661);};}exports['register']=function(_0x1e9c0e){for(var _0x4ead43=0x0,_0xa7ddc0=events[_0x99c7('0x4')];_0x4ead43<_0xa7ddc0;_0x4ead43++){var _0x427f2f=events[_0x4ead43];var _0x58fbc2=createListener(_0x99c7('0x5')+_0x427f2f,_0x1e9c0e);OpenchannelInteractionEvents['on'](_0x427f2f,_0x58fbc2);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 404a90e..128627b 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 _0xd06e=['../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','/:id/reject','reject','delete','destroy','util','connect-timeout'];(function(_0x3afe54,_0x404b30){var _0x48d0be=function(_0x5026ba){while(--_0x5026ba){_0x3afe54['push'](_0x3afe54['shift']());}};_0x48d0be(++_0x404b30);}(_0xd06e,0x129));var _0xed06=function(_0x1590bc,_0x1f7502){_0x1590bc=_0x1590bc-0x0;var _0x572365=_0xd06e[_0x1590bc];return _0x572365;};'use strict';var multer=require('multer');var util=require(_0xed06('0x0'));var path=require('path');var timeout=require(_0xed06('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xed06('0x2'));var interaction=require(_0xed06('0x3'));var config=require(_0xed06('0x4'));var controller=require('./openchannelMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xed06('0x5')]);router[_0xed06('0x6')](_0xed06('0x7'),auth[_0xed06('0x8')](),controller['describe']);router[_0xed06('0x6')](_0xed06('0x9'),auth[_0xed06('0x8')](),controller[_0xed06('0xa')]);router[_0xed06('0xb')]('/',auth[_0xed06('0x8')](),interaction[_0xed06('0xc')](_0xed06('0xd'),_0xed06('0xe')),controller[_0xed06('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xed06('0x10')]);router[_0xed06('0x11')](_0xed06('0x12'),auth['isAuthenticated'](),controller['accept']);router[_0xed06('0x11')](_0xed06('0x13'),auth[_0xed06('0x8')](),controller[_0xed06('0x14')]);router[_0xed06('0x15')](_0xed06('0x9'),auth[_0xed06('0x8')](),controller[_0xed06('0x16')]);module['exports']=router; \ No newline at end of file +var _0x6089=['./openchannelMessage.controller','get','isAuthenticated','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','/:id/accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4213f8,_0x3572a4){var _0x2e690e=function(_0x142fc1){while(--_0x142fc1){_0x4213f8['push'](_0x4213f8['shift']());}};_0x2e690e(++_0x3572a4);}(_0x6089,0x100));var _0x9608=function(_0x3af964,_0x571364){_0x3af964=_0x3af964-0x0;var _0x385e95=_0x6089[_0x3af964];return _0x385e95;};'use strict';var multer=require(_0x9608('0x0'));var util=require(_0x9608('0x1'));var path=require(_0x9608('0x2'));var timeout=require(_0x9608('0x3'));var express=require(_0x9608('0x4'));var router=express[_0x9608('0x5')]();var auth=require(_0x9608('0x6'));var interaction=require(_0x9608('0x7'));var config=require('../../config/environment');var controller=require(_0x9608('0x8'));router[_0x9608('0x9')]('/',auth[_0x9608('0xa')](),controller['index']);router[_0x9608('0x9')]('/describe',auth[_0x9608('0xa')](),controller[_0x9608('0xb')]);router[_0x9608('0x9')](_0x9608('0xc'),auth[_0x9608('0xa')](),controller[_0x9608('0xd')]);router[_0x9608('0xe')]('/',auth[_0x9608('0xa')](),interaction[_0x9608('0xf')](_0x9608('0x10'),_0x9608('0x11')),controller['create']);router[_0x9608('0x12')](_0x9608('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x9608('0x12')](_0x9608('0x13'),auth['isAuthenticated'](),controller['accept']);router[_0x9608('0x12')](_0x9608('0x14'),auth[_0x9608('0xa')](),controller['reject']);router[_0x9608('0x15')](_0x9608('0xc'),auth[_0x9608('0xa')](),controller[_0x9608('0x16')]);module[_0x9608('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index a761adb..678c7c6 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 _0x77a3=['medium','ENUM','out','DATE','exports','TEXT'];(function(_0x19e2f9,_0x2d01cf){var _0x17e37f=function(_0x17ab34){while(--_0x17ab34){_0x19e2f9['push'](_0x19e2f9['shift']());}};_0x17e37f(++_0x2d01cf);}(_0x77a3,0x12a));var _0x377a=function(_0x1aa819,_0x3a0526){_0x1aa819=_0x1aa819-0x0;var _0x25dfc2=_0x77a3[_0x1aa819];return _0x25dfc2;};'use strict';var Sequelize=require('sequelize');module[_0x377a('0x0')]={'body':{'type':Sequelize[_0x377a('0x1')](_0x377a('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x377a('0x3')]('in',_0x377a('0x4')),'defaultValue':_0x377a('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x377a('0x5')]}}; \ No newline at end of file +var _0x849e=['ENUM','out','DATE','sequelize','exports','TEXT','BOOLEAN'];(function(_0x16debf,_0x201680){var _0x28eba9=function(_0x194105){while(--_0x194105){_0x16debf['push'](_0x16debf['shift']());}};_0x28eba9(++_0x201680);}(_0x849e,0x137));var _0xe849=function(_0x2173ae,_0x1a0ead){_0x2173ae=_0x2173ae-0x0;var _0x16ffe6=_0x849e[_0x2173ae];return _0x16ffe6;};'use strict';var Sequelize=require(_0xe849('0x0'));module[_0xe849('0x1')]={'body':{'type':Sequelize[_0xe849('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xe849('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe849('0x4')]('in',_0xe849('0x5')),'defaultValue':_0xe849('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xe849('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 9f64610..355c600 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 _0x2599=['hasOwnProperty','order','sort','filter','where','merge','map','type','key','VIRTUAL','field','count','includeAll','include','findAll','show','params','find','create','body','update','describe','openchannel-interactions','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','role','stringify','null','acceptMessage','interface','SIP/%s','channel','event','EventManager','acceptmessage','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','html-pdf','zip-dir','request-promise','moment','bluebird','util','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelMessage.socket','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','reject','save','destroy','end','name','send','index','OpenchannelMessage','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length'];(function(_0x1af04c,_0x8e2f6c){var _0x59b331=function(_0x284b7d){while(--_0x284b7d){_0x1af04c['push'](_0x1af04c['shift']());}};_0x59b331(++_0x8e2f6c);}(_0x2599,0x181));var _0x9259=function(_0x677e59,_0x100cb9){_0x677e59=_0x677e59-0x0;var _0x3c5a2e=_0x2599[_0x677e59];return _0x3c5a2e;};'use strict';var pdf=require(_0x9259('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9259('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9259('0x2'));var moment=require(_0x9259('0x3'));var BPromise=require(_0x9259('0x4'));var Mustache=require('mustache');var util=require(_0x9259('0x5'));var path=require('path');var sox=require(_0x9259('0x6'));var csv=require('to-csv');var ejs=require(_0x9259('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9259('0x8'));var crypto=require('crypto');var jsforce=require(_0x9259('0x9'));var deskjs=require(_0x9259('0xa'));var toCsv=require(_0x9259('0xb'));var querystring=require(_0x9259('0xc'));var Papa=require('papaparse');var Redis=require(_0x9259('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x9259('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9259('0xf'))(_0x9259('0x10'));var utils=require(_0x9259('0x11'));var config=require(_0x9259('0x12'));var db=require(_0x9259('0x13'))['db'];config[_0x9259('0x14')]=_[_0x9259('0x15')](config['redis'],{'host':_0x9259('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9259('0x17'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x9259('0x18')][_0x9259('0x19')]({'port':0x232c});var client9002=jayson[_0x9259('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0xa42aa7,_0x56d702,_0x5c414f){if(_0x5c414f){var _0x299890=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x299890[_0x9259('0x1a')](_0x56d702)){return _0xa42aa7;}else{throw new Error(_0x9259('0x1b'));}}else{return _0xa42aa7;}}function respondWithRpcPromise(_0x4f2ef2,_0xf54781,_0x5a9193,_0x28c2e3){return new BPromise(function(_0x488311,_0xba94f4){var _0x1767d4=_0x28c2e3||client;return _0x1767d4[_0x9259('0x1c')](_0x4f2ef2,_0x5a9193)[_0x9259('0x1d')](function(_0x21184b){logger[_0x9259('0x1e')](_0x9259('0x1f'),_0xf54781,_0x9259('0x20'));logger[_0x9259('0x21')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0xf54781,_0x9259('0x20'),JSON['stringify'](_0x21184b));if(_0x21184b[_0x9259('0x22')]){if(_0x21184b[_0x9259('0x22')][_0x9259('0x23')]===0x1f4){logger[_0x9259('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0xf54781,_0x21184b[_0x9259('0x22')]['message']);return _0xba94f4(_0x21184b[_0x9259('0x22')]['message']);}logger['error'](_0x9259('0x1f'),_0xf54781,_0x21184b['error'][_0x9259('0x24')]);return _0x488311(_0x21184b['error'][_0x9259('0x24')]);}else{logger['info'](_0x9259('0x1f'),_0xf54781,'request\x20sent');_0x488311(_0x21184b[_0x9259('0x25')][_0x9259('0x24')]);}})[_0x9259('0x26')](function(_0x214450){logger[_0x9259('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0xf54781,_0x214450);_0xba94f4(_0x214450);});});}function respondWithStatusCode(_0x29e17d,_0x456fdd){_0x456fdd=_0x456fdd||0xcc;return function(_0x458759){if(_0x458759){return _0x29e17d[_0x9259('0x27')](_0x456fdd);}return _0x29e17d[_0x9259('0x28')](_0x456fdd)['end']();};}function respondWithResult(_0x2327e3,_0x257460){_0x257460=_0x257460||0xc8;return function(_0x4e85f3){if(_0x4e85f3){return _0x2327e3[_0x9259('0x28')](_0x257460)[_0x9259('0x29')](_0x4e85f3);}};}function respondWithFilteredResult(_0x488e02,_0x1f35da){return function(_0x44a563){if(_0x44a563){var _0x1b1e24=_0x44a563['count'],_0x4855ac=_0x1f35da[_0x9259('0x2a')],_0xf58e56=_0x1f35da['offset']+_0x1f35da[_0x9259('0x2b')],_0x2ff97b;if(_0xf58e56>=_0x1b1e24){_0xf58e56=_0x1b1e24;_0x2ff97b=0xc8;}else{_0x2ff97b=0xce;}_0x488e02[_0x9259('0x28')](_0x2ff97b);return _0x488e02[_0x9259('0x2c')](_0x9259('0x2d'),_0x4855ac+'-'+_0xf58e56+'/'+_0x1b1e24)[_0x9259('0x29')](_0x44a563);}return null;};}function patchUpdates(_0xdc42f4){return function(_0xd9e0bd){try{jsonpatch['apply'](_0xd9e0bd,_0xdc42f4,!![]);}catch(_0x4dde7e){return BPromise[_0x9259('0x2e')](_0x4dde7e);}return _0xd9e0bd[_0x9259('0x2f')]();};}function saveUpdates(_0x49e221,_0x2e863a){return function(_0x1177e5){if(_0x1177e5){return _0x1177e5['update'](_0x49e221)[_0x9259('0x1d')](function(_0x41e26b){return _0x41e26b;});}return null;};}function removeEntity(_0x19ba9b,_0x59feef){return function(_0xff74b7){if(_0xff74b7){return _0xff74b7[_0x9259('0x30')]()[_0x9259('0x1d')](function(){_0x19ba9b['status'](0xcc)[_0x9259('0x31')]();});}};}function handleEntityNotFound(_0x4c5418,_0x1643d1){return function(_0x26248f){if(!_0x26248f){_0x4c5418[_0x9259('0x27')](0x194);}return _0x26248f;};}function handleError(_0x48d6fd,_0x2db741){_0x2db741=_0x2db741||0x1f4;return function(_0x10d2e5){logger['error'](_0x10d2e5['stack']);if(_0x10d2e5[_0x9259('0x32')]){delete _0x10d2e5[_0x9259('0x32')];}_0x48d6fd['status'](_0x2db741)[_0x9259('0x33')](_0x10d2e5);};}exports[_0x9259('0x34')]=function(_0x2bbca5,_0x2cae5b){var _0x71236e={},_0x3ba752={},_0x2f1754={'count':0x0,'rows':[]};var _0x55c3db=db[_0x9259('0x35')][_0x9259('0x36')];_0x3ba752[_0x9259('0x37')]=_[_0x9259('0x38')](_0x55c3db);_0x3ba752['query']=_[_0x9259('0x38')](_0x2bbca5[_0x9259('0x39')]);_0x3ba752[_0x9259('0x3a')]=_[_0x9259('0x3b')](_0x3ba752[_0x9259('0x37')],_0x3ba752[_0x9259('0x39')]);_0x71236e['attributes']=_[_0x9259('0x3b')](_0x3ba752[_0x9259('0x37')],qs[_0x9259('0x3c')](_0x2bbca5['query'][_0x9259('0x3c')]));_0x71236e[_0x9259('0x3d')]=_0x71236e[_0x9259('0x3d')][_0x9259('0x3e')]?_0x71236e['attributes']:_0x3ba752['model'];if(!_0x2bbca5['query'][_0x9259('0x3f')]('nolimit')){_0x71236e[_0x9259('0x2b')]=qs['limit'](_0x2bbca5[_0x9259('0x39')]['limit']);_0x71236e[_0x9259('0x2a')]=qs[_0x9259('0x2a')](_0x2bbca5[_0x9259('0x39')]['offset']);}_0x71236e[_0x9259('0x40')]=qs[_0x9259('0x41')](_0x2bbca5[_0x9259('0x39')][_0x9259('0x41')]);_0x71236e['where']=qs[_0x9259('0x3a')](_['pick'](_0x2bbca5[_0x9259('0x39')],_0x3ba752[_0x9259('0x3a')]));if(_0x2bbca5[_0x9259('0x39')][_0x9259('0x42')]){_0x71236e[_0x9259('0x43')]=_[_0x9259('0x44')](_0x71236e[_0x9259('0x43')],{'$or':_[_0x9259('0x45')](_0x55c3db,function(_0x5c7975){if(_0x5c7975[_0x9259('0x46')][_0x9259('0x47')]!==_0x9259('0x48')){var _0x48729b={};_0x48729b[_0x5c7975[_0x9259('0x49')]]={'$like':'%'+_0x2bbca5['query'][_0x9259('0x42')]+'%'};return _0x48729b;}})});}_0x71236e=_[_0x9259('0x44')]({},_0x71236e,_0x2bbca5['options']);var _0x3fd40a={'where':_0x71236e[_0x9259('0x43')]};return db['OpenchannelMessage'][_0x9259('0x4a')](_0x3fd40a)['then'](function(_0x42d81b){_0x2f1754[_0x9259('0x4a')]=_0x42d81b;if(_0x2bbca5['query'][_0x9259('0x4b')]){_0x71236e[_0x9259('0x4c')]=[{'all':!![]}];}return db[_0x9259('0x35')][_0x9259('0x4d')](_0x71236e);})[_0x9259('0x1d')](function(_0x3ddf79){_0x2f1754['rows']=_0x3ddf79;return _0x2f1754;})[_0x9259('0x1d')](respondWithFilteredResult(_0x2cae5b,_0x71236e))['catch'](handleError(_0x2cae5b,null));};exports[_0x9259('0x4e')]=function(_0x5a0cba,_0xc4edd4){var _0x19f852={'raw':!![],'where':{'id':_0x5a0cba[_0x9259('0x4f')]['id']}},_0x2506ad={};_0x2506ad[_0x9259('0x37')]=_[_0x9259('0x38')](db['OpenchannelMessage']['rawAttributes']);_0x2506ad[_0x9259('0x39')]=_[_0x9259('0x38')](_0x5a0cba[_0x9259('0x39')]);_0x2506ad[_0x9259('0x3a')]=_[_0x9259('0x3b')](_0x2506ad[_0x9259('0x37')],_0x2506ad['query']);_0x19f852[_0x9259('0x3d')]=_[_0x9259('0x3b')](_0x2506ad[_0x9259('0x37')],qs[_0x9259('0x3c')](_0x5a0cba[_0x9259('0x39')][_0x9259('0x3c')]));_0x19f852[_0x9259('0x3d')]=_0x19f852[_0x9259('0x3d')]['length']?_0x19f852['attributes']:_0x2506ad[_0x9259('0x37')];if(_0x5a0cba[_0x9259('0x39')]['includeAll']){_0x19f852['include']=[{'all':!![]}];}_0x19f852=_['merge']({},_0x19f852,_0x5a0cba['options']);return db['OpenchannelMessage'][_0x9259('0x50')](_0x19f852)['then'](handleEntityNotFound(_0xc4edd4,null))['then'](respondWithResult(_0xc4edd4,null))[_0x9259('0x26')](handleError(_0xc4edd4,null));};exports[_0x9259('0x51')]=function(_0x4323c5,_0x7ace02){return db['OpenchannelMessage'][_0x9259('0x51')](_0x4323c5[_0x9259('0x52')],{})[_0x9259('0x1d')](respondWithResult(_0x7ace02,0xc9))['catch'](handleError(_0x7ace02,null));};exports[_0x9259('0x53')]=function(_0x5d4c58,_0x3aed5a){if(_0x5d4c58[_0x9259('0x52')]['id']){delete _0x5d4c58[_0x9259('0x52')]['id'];}return db[_0x9259('0x35')][_0x9259('0x50')]({'where':{'id':_0x5d4c58[_0x9259('0x4f')]['id']}})[_0x9259('0x1d')](handleEntityNotFound(_0x3aed5a,null))[_0x9259('0x1d')](saveUpdates(_0x5d4c58['body'],null))[_0x9259('0x1d')](respondWithResult(_0x3aed5a,null))[_0x9259('0x26')](handleError(_0x3aed5a,null));};exports[_0x9259('0x30')]=function(_0x371ab4,_0x1d54fd){return db['OpenchannelMessage'][_0x9259('0x50')]({'where':{'id':_0x371ab4['params']['id']}})['then'](handleEntityNotFound(_0x1d54fd,null))['then'](removeEntity(_0x1d54fd,null))[_0x9259('0x26')](handleError(_0x1d54fd,null));};exports['describe']=function(_0x11cffb,_0x5e0d6d){return db[_0x9259('0x35')][_0x9259('0x54')]()['then'](respondWithResult(_0x5e0d6d,null))[_0x9259('0x26')](handleError(_0x5e0d6d,null));};var interaction_log=require(_0x9259('0xf'))(_0x9259('0x55'));exports[_0x9259('0x56')]=function(_0x4672a0,_0x871385,_0x442475){var _0x19f779={'channel':_0x9259('0x57')};if(_0x4672a0[_0x9259('0x52')]['id']){delete _0x4672a0[_0x9259('0x52')]['id'];}_0x4672a0['body'][_0x9259('0x58')]=!![];_0x4672a0[_0x9259('0x52')]['readAt']=moment()[_0x9259('0x59')](_0x9259('0x5a'));_0x4672a0[_0x9259('0x52')][_0x9259('0x5b')]=_0x4672a0[_0x9259('0x52')]['UserId']||_0x4672a0[_0x9259('0x5c')]['id'];return db[_0x9259('0x35')][_0x9259('0x50')]({'where':{'id':_0x4672a0['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x9259('0x1d')](handleEntityNotFound(_0x871385,null))['then'](saveUpdates(_0x4672a0[_0x9259('0x52')],null))['then'](function(_0x3ad6f9){if(_0x3ad6f9){_0x19f779[_0x9259('0x24')]=_0x3ad6f9[_0x9259('0x5d')]({'plain':!![]});return db[_0x9259('0x5e')][_0x9259('0x50')]({'where':{'id':_0x3ad6f9[_0x9259('0x5f')]}});}return null;})[_0x9259('0x1d')](handleEntityNotFound(_0x871385,null))[_0x9259('0x1d')](function(_0x2b93d7){if(_0x2b93d7){return _0x2b93d7['update']({'UserId':_0x4672a0[_0x9259('0x52')][_0x9259('0x5b')],'read1stAt':_[_0x9259('0x60')](_0x2b93d7['read1stAt'])?moment()[_0x9259('0x59')](_0x9259('0x5a')):undefined});}return null;})[_0x9259('0x1d')](function(_0x7bffbf){if(_0x7bffbf){_0x19f779[_0x9259('0x61')]=_0x7bffbf[_0x9259('0x5d')]({'plain':!![]});interaction_log[_0x9259('0x1e')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4672a0[_0x9259('0x5c')]['id'],_0x4672a0['user'][_0x9259('0x32')],_0x4672a0['user'][_0x9259('0x62')],_0x19f779[_0x9259('0x61')]['id'],_0x4672a0[_0x9259('0x52')]?JSON[_0x9259('0x63')](_0x4672a0[_0x9259('0x52')]):_0x9259('0x64'));return respondWithRpcPromise('AcceptMessage',_0x9259('0x65'),_0x19f779);}return null;})[_0x9259('0x1d')](function(_0x41603a){if(_0x41603a){if(_0x4672a0[_0x9259('0x52')]['manual']){_0x19f779[_0x9259('0x24')][_0x9259('0x66')]=util['format'](_0x9259('0x67'),_0x4672a0[_0x9259('0x5c')]['name']);_0x19f779[_0x9259('0x24')][_0x9259('0x68')]=_0x19f779[_0x9259('0x68')];_0x19f779[_0x9259('0x24')][_0x9259('0x69')]='accept';return respondWithRpcPromise(_0x9259('0x6a'),_0x9259('0x6a'),{'event':_0x9259('0x6b'),'message':_0x19f779[_0x9259('0x24')]},client9002)[_0x9259('0x1d')](function(){return _0x19f779;});}return _0x19f779;}return null;})['then'](respondWithResult(_0x871385,null))[_0x9259('0x26')](handleError(_0x871385,null));};var interaction_log=require('../../config/logger')(_0x9259('0x55'));exports[_0x9259('0x2e')]=function(_0x5894c6,_0x3c4f43,_0x5f2c8c){var _0xfa2fe={'agent':{},'channel':'openchannel'};if(_0x5894c6['body']['id']){delete _0x5894c6[_0x9259('0x52')]['id'];}_0x5894c6['body'][_0x9259('0x5b')]=_0x5894c6[_0x9259('0x52')][_0x9259('0x5b')]||_0x5894c6[_0x9259('0x5c')]['id'];_0xfa2fe[_0x9259('0x6c')]['id']=_0x5894c6[_0x9259('0x52')]['UserId'];return db[_0x9259('0x35')]['find']({'where':{'id':_0x5894c6[_0x9259('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3c4f43,null))[_0x9259('0x1d')](function(_0x1b6c9e){if(_0x1b6c9e){_0xfa2fe[_0x9259('0x24')]=_0x1b6c9e['get']({'plain':!![]});return db[_0x9259('0x5e')]['find']({'where':{'id':_0x1b6c9e['OpenchannelInteractionId']}});}return null;})[_0x9259('0x1d')](handleEntityNotFound(_0x3c4f43,null))[_0x9259('0x1d')](function(_0x17d3e1){if(_0x17d3e1){_0xfa2fe['interaction']=_0x17d3e1['get']({'plain':!![]});interaction_log['info'](_0x9259('0x6d'),_0x5894c6['user']['id'],_0x5894c6[_0x9259('0x5c')][_0x9259('0x32')],_0x5894c6[_0x9259('0x5c')][_0x9259('0x62')],_0xfa2fe[_0x9259('0x61')]['id'],_0x5894c6[_0x9259('0x52')]?JSON[_0x9259('0x63')](_0x5894c6[_0x9259('0x52')]):_0x9259('0x64'));return respondWithRpcPromise('RejectMessage',_0x9259('0x6e'),_0xfa2fe);}return null;})[_0x9259('0x1d')](function(_0x3aaa0b){if(_0x3aaa0b){_0x3aaa0b[_0x9259('0x24')][_0x9259('0x66')]=util['format'](_0x9259('0x67'),_0x5894c6['user']['name']);_0x3aaa0b[_0x9259('0x24')][_0x9259('0x68')]=_0xfa2fe[_0x9259('0x68')];_0x3aaa0b['message'][_0x9259('0x69')]=_0x9259('0x2e');respondWithRpcPromise(_0x9259('0x6a'),'EventManager',{'event':_0x9259('0x6f'),'message':_0x3aaa0b[_0x9259('0x24')]},client9002);return _0xfa2fe;}return null;})[_0x9259('0x1d')](respondWithResult(_0x3c4f43,null))[_0x9259('0x26')](handleError(_0x3c4f43,null));}; \ No newline at end of file +var _0xa442=['rejectMessage','format','SIP/%s','rejectmessage','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','./openchannelMessage.socket','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','update','destroy','stack','name','index','OpenchannelMessage','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','where','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','show','params','rawAttributes','create','body','find','describe','openchannel-interactions','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteractionId','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','interface','channel','event','EventManager','acceptmessage','agent','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x3505e5,_0x30765){var _0x3e7b38=function(_0x47ef51){while(--_0x47ef51){_0x3505e5['push'](_0x3505e5['shift']());}};_0x3e7b38(++_0x30765);}(_0xa442,0x73));var _0x2a44=function(_0x362af7,_0x25fb84){_0x362af7=_0x362af7-0x0;var _0x2a1eb8=_0xa442[_0x362af7];return _0x2a1eb8;};'use strict';var pdf=require(_0x2a44('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2a44('0x1'));var zipdir=require(_0x2a44('0x2'));var jsonpatch=require(_0x2a44('0x3'));var rp=require(_0x2a44('0x4'));var moment=require(_0x2a44('0x5'));var BPromise=require(_0x2a44('0x6'));var Mustache=require(_0x2a44('0x7'));var util=require('util');var path=require(_0x2a44('0x8'));var sox=require('sox');var csv=require(_0x2a44('0x9'));var ejs=require(_0x2a44('0xa'));var fs=require('fs');var _=require(_0x2a44('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2a44('0xc'));var toCsv=require(_0x2a44('0x9'));var querystring=require(_0x2a44('0xd'));var Papa=require('papaparse');var Redis=require(_0x2a44('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2a44('0xf'));var hardwareService=require(_0x2a44('0x10'));var logger=require(_0x2a44('0x11'))('api');var utils=require(_0x2a44('0x12'));var config=require('../../config/environment');var db=require(_0x2a44('0x13'))['db'];config[_0x2a44('0x14')]=_[_0x2a44('0x15')](config[_0x2a44('0x14')],{'host':_0x2a44('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2a44('0x14')]));require(_0x2a44('0x17'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x2a44('0x18')][_0x2a44('0x19')]({'port':0x232c});var client9002=jayson[_0x2a44('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x595759,_0x207ba3,_0x1f735e){if(_0x1f735e){var _0x20d2ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20d2ce[_0x2a44('0x1a')](_0x207ba3)){return _0x595759;}else{throw new Error(_0x2a44('0x1b'));}}else{return _0x595759;}}function respondWithRpcPromise(_0x85c841,_0xa6b9a0,_0x2e820a,_0x4ce26a){return new BPromise(function(_0x45c505,_0x548e81){var _0x2b30f5=_0x4ce26a||client;return _0x2b30f5[_0x2a44('0x1c')](_0x85c841,_0x2e820a)[_0x2a44('0x1d')](function(_0x57c50c){logger[_0x2a44('0x1e')](_0x2a44('0x1f'),_0xa6b9a0,_0x2a44('0x20'));logger[_0x2a44('0x21')](_0x2a44('0x22'),_0xa6b9a0,_0x2a44('0x20'),JSON[_0x2a44('0x23')](_0x57c50c));if(_0x57c50c['error']){if(_0x57c50c[_0x2a44('0x24')][_0x2a44('0x25')]===0x1f4){logger[_0x2a44('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0xa6b9a0,_0x57c50c[_0x2a44('0x24')][_0x2a44('0x26')]);return _0x548e81(_0x57c50c[_0x2a44('0x24')][_0x2a44('0x26')]);}logger[_0x2a44('0x24')](_0x2a44('0x1f'),_0xa6b9a0,_0x57c50c[_0x2a44('0x24')][_0x2a44('0x26')]);return _0x45c505(_0x57c50c[_0x2a44('0x24')][_0x2a44('0x26')]);}else{logger[_0x2a44('0x1e')](_0x2a44('0x1f'),_0xa6b9a0,'request\x20sent');_0x45c505(_0x57c50c[_0x2a44('0x27')][_0x2a44('0x26')]);}})[_0x2a44('0x28')](function(_0x3d99a9){logger[_0x2a44('0x24')](_0x2a44('0x1f'),_0xa6b9a0,_0x3d99a9);_0x548e81(_0x3d99a9);});});}function respondWithStatusCode(_0xec7f7,_0x494884){_0x494884=_0x494884||0xcc;return function(_0x3e2cc2){if(_0x3e2cc2){return _0xec7f7[_0x2a44('0x29')](_0x494884);}return _0xec7f7[_0x2a44('0x2a')](_0x494884)['end']();};}function respondWithResult(_0x316192,_0x1e9936){_0x1e9936=_0x1e9936||0xc8;return function(_0x499671){if(_0x499671){return _0x316192[_0x2a44('0x2a')](_0x1e9936)[_0x2a44('0x2b')](_0x499671);}};}function respondWithFilteredResult(_0x1cdf81,_0x5401b8){return function(_0x477fae){if(_0x477fae){var _0x20df4f=_0x477fae[_0x2a44('0x2c')],_0x339710=_0x5401b8[_0x2a44('0x2d')],_0x2f36ca=_0x5401b8[_0x2a44('0x2d')]+_0x5401b8['limit'],_0x1e5a12;if(_0x2f36ca>=_0x20df4f){_0x2f36ca=_0x20df4f;_0x1e5a12=0xc8;}else{_0x1e5a12=0xce;}_0x1cdf81[_0x2a44('0x2a')](_0x1e5a12);return _0x1cdf81[_0x2a44('0x2e')](_0x2a44('0x2f'),_0x339710+'-'+_0x2f36ca+'/'+_0x20df4f)['json'](_0x477fae);}return null;};}function patchUpdates(_0x398257){return function(_0x1afdb7){try{jsonpatch[_0x2a44('0x30')](_0x1afdb7,_0x398257,!![]);}catch(_0x4dd90a){return BPromise[_0x2a44('0x31')](_0x4dd90a);}return _0x1afdb7['save']();};}function saveUpdates(_0x1817bc,_0x133ab0){return function(_0x4532e1){if(_0x4532e1){return _0x4532e1[_0x2a44('0x32')](_0x1817bc)['then'](function(_0x1c3a8f){return _0x1c3a8f;});}return null;};}function removeEntity(_0x183bed,_0x12371f){return function(_0xf68b3c){if(_0xf68b3c){return _0xf68b3c[_0x2a44('0x33')]()[_0x2a44('0x1d')](function(){_0x183bed[_0x2a44('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a31f8,_0x25b425){return function(_0x4e1689){if(!_0x4e1689){_0x4a31f8[_0x2a44('0x29')](0x194);}return _0x4e1689;};}function handleError(_0x4fd43d,_0x2718b8){_0x2718b8=_0x2718b8||0x1f4;return function(_0x330a48){logger[_0x2a44('0x24')](_0x330a48[_0x2a44('0x34')]);if(_0x330a48[_0x2a44('0x35')]){delete _0x330a48[_0x2a44('0x35')];}_0x4fd43d[_0x2a44('0x2a')](_0x2718b8)['send'](_0x330a48);};}exports[_0x2a44('0x36')]=function(_0x135b35,_0x3b1dd9){var _0x139fb1={},_0x5dc407={},_0x22fe19={'count':0x0,'rows':[]};var _0x35fa05=db[_0x2a44('0x37')]['rawAttributes'];_0x5dc407[_0x2a44('0x38')]=_['keys'](_0x35fa05);_0x5dc407[_0x2a44('0x39')]=_[_0x2a44('0x3a')](_0x135b35[_0x2a44('0x39')]);_0x5dc407[_0x2a44('0x3b')]=_[_0x2a44('0x3c')](_0x5dc407['model'],_0x5dc407[_0x2a44('0x39')]);_0x139fb1[_0x2a44('0x3d')]=_[_0x2a44('0x3c')](_0x5dc407[_0x2a44('0x38')],qs[_0x2a44('0x3e')](_0x135b35[_0x2a44('0x39')][_0x2a44('0x3e')]));_0x139fb1['attributes']=_0x139fb1[_0x2a44('0x3d')][_0x2a44('0x3f')]?_0x139fb1[_0x2a44('0x3d')]:_0x5dc407[_0x2a44('0x38')];if(!_0x135b35[_0x2a44('0x39')]['hasOwnProperty'](_0x2a44('0x40'))){_0x139fb1[_0x2a44('0x41')]=qs[_0x2a44('0x41')](_0x135b35[_0x2a44('0x39')]['limit']);_0x139fb1['offset']=qs['offset'](_0x135b35['query'][_0x2a44('0x2d')]);}_0x139fb1[_0x2a44('0x42')]=qs['sort'](_0x135b35[_0x2a44('0x39')]['sort']);_0x139fb1[_0x2a44('0x43')]=qs[_0x2a44('0x3b')](_[_0x2a44('0x44')](_0x135b35[_0x2a44('0x39')],_0x5dc407[_0x2a44('0x3b')]));if(_0x135b35[_0x2a44('0x39')][_0x2a44('0x45')]){_0x139fb1[_0x2a44('0x43')]=_[_0x2a44('0x46')](_0x139fb1[_0x2a44('0x43')],{'$or':_[_0x2a44('0x47')](_0x35fa05,function(_0x2e3875){if(_0x2e3875[_0x2a44('0x48')][_0x2a44('0x49')]!=='VIRTUAL'){var _0x2e188b={};_0x2e188b[_0x2e3875[_0x2a44('0x4a')]]={'$like':'%'+_0x135b35[_0x2a44('0x39')][_0x2a44('0x45')]+'%'};return _0x2e188b;}})});}_0x139fb1=_['merge']({},_0x139fb1,_0x135b35[_0x2a44('0x4b')]);var _0x9edbc1={'where':_0x139fb1[_0x2a44('0x43')]};return db[_0x2a44('0x37')][_0x2a44('0x2c')](_0x9edbc1)[_0x2a44('0x1d')](function(_0x543137){_0x22fe19[_0x2a44('0x2c')]=_0x543137;if(_0x135b35[_0x2a44('0x39')][_0x2a44('0x4c')]){_0x139fb1[_0x2a44('0x4d')]=[{'all':!![]}];}return db[_0x2a44('0x37')][_0x2a44('0x4e')](_0x139fb1);})[_0x2a44('0x1d')](function(_0x2b420b){_0x22fe19['rows']=_0x2b420b;return _0x22fe19;})['then'](respondWithFilteredResult(_0x3b1dd9,_0x139fb1))['catch'](handleError(_0x3b1dd9,null));};exports[_0x2a44('0x4f')]=function(_0x75ec49,_0x4cee6c){var _0x156e22={'raw':!![],'where':{'id':_0x75ec49[_0x2a44('0x50')]['id']}},_0x312330={};_0x312330[_0x2a44('0x38')]=_[_0x2a44('0x3a')](db[_0x2a44('0x37')][_0x2a44('0x51')]);_0x312330['query']=_['keys'](_0x75ec49[_0x2a44('0x39')]);_0x312330[_0x2a44('0x3b')]=_[_0x2a44('0x3c')](_0x312330[_0x2a44('0x38')],_0x312330[_0x2a44('0x39')]);_0x156e22[_0x2a44('0x3d')]=_[_0x2a44('0x3c')](_0x312330[_0x2a44('0x38')],qs[_0x2a44('0x3e')](_0x75ec49[_0x2a44('0x39')][_0x2a44('0x3e')]));_0x156e22[_0x2a44('0x3d')]=_0x156e22[_0x2a44('0x3d')][_0x2a44('0x3f')]?_0x156e22[_0x2a44('0x3d')]:_0x312330['model'];if(_0x75ec49[_0x2a44('0x39')][_0x2a44('0x4c')]){_0x156e22['include']=[{'all':!![]}];}_0x156e22=_[_0x2a44('0x46')]({},_0x156e22,_0x75ec49['options']);return db[_0x2a44('0x37')]['find'](_0x156e22)[_0x2a44('0x1d')](handleEntityNotFound(_0x4cee6c,null))[_0x2a44('0x1d')](respondWithResult(_0x4cee6c,null))[_0x2a44('0x28')](handleError(_0x4cee6c,null));};exports[_0x2a44('0x52')]=function(_0x1642b7,_0x3083ac){return db['OpenchannelMessage'][_0x2a44('0x52')](_0x1642b7[_0x2a44('0x53')],{})[_0x2a44('0x1d')](respondWithResult(_0x3083ac,0xc9))['catch'](handleError(_0x3083ac,null));};exports[_0x2a44('0x32')]=function(_0x1c668c,_0x29c989){if(_0x1c668c[_0x2a44('0x53')]['id']){delete _0x1c668c[_0x2a44('0x53')]['id'];}return db['OpenchannelMessage'][_0x2a44('0x54')]({'where':{'id':_0x1c668c[_0x2a44('0x50')]['id']}})['then'](handleEntityNotFound(_0x29c989,null))['then'](saveUpdates(_0x1c668c[_0x2a44('0x53')],null))[_0x2a44('0x1d')](respondWithResult(_0x29c989,null))[_0x2a44('0x28')](handleError(_0x29c989,null));};exports[_0x2a44('0x33')]=function(_0x1e6391,_0x197156){return db[_0x2a44('0x37')][_0x2a44('0x54')]({'where':{'id':_0x1e6391[_0x2a44('0x50')]['id']}})[_0x2a44('0x1d')](handleEntityNotFound(_0x197156,null))['then'](removeEntity(_0x197156,null))[_0x2a44('0x28')](handleError(_0x197156,null));};exports[_0x2a44('0x55')]=function(_0x2cc55b,_0x155298){return db[_0x2a44('0x37')]['describe']()[_0x2a44('0x1d')](respondWithResult(_0x155298,null))[_0x2a44('0x28')](handleError(_0x155298,null));};var interaction_log=require(_0x2a44('0x11'))(_0x2a44('0x56'));exports['accept']=function(_0x10684f,_0x2120c2,_0x492e3f){var _0x2f1a9a={'channel':'openchannel'};if(_0x10684f['body']['id']){delete _0x10684f[_0x2a44('0x53')]['id'];}_0x10684f[_0x2a44('0x53')][_0x2a44('0x57')]=!![];_0x10684f[_0x2a44('0x53')][_0x2a44('0x58')]=moment()['format'](_0x2a44('0x59'));_0x10684f[_0x2a44('0x53')][_0x2a44('0x5a')]=_0x10684f[_0x2a44('0x53')]['UserId']||_0x10684f[_0x2a44('0x5b')]['id'];return db[_0x2a44('0x37')][_0x2a44('0x54')]({'where':{'id':_0x10684f['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})['then'](handleEntityNotFound(_0x2120c2,null))[_0x2a44('0x1d')](saveUpdates(_0x10684f['body'],null))['then'](function(_0x5747ce){if(_0x5747ce){_0x2f1a9a[_0x2a44('0x26')]=_0x5747ce[_0x2a44('0x5c')]({'plain':!![]});return db['OpenchannelInteraction'][_0x2a44('0x54')]({'where':{'id':_0x5747ce[_0x2a44('0x5d')]}});}return null;})[_0x2a44('0x1d')](handleEntityNotFound(_0x2120c2,null))[_0x2a44('0x1d')](function(_0x122c8b){if(_0x122c8b){return _0x122c8b[_0x2a44('0x32')]({'UserId':_0x10684f['body']['UserId'],'read1stAt':_['isNil'](_0x122c8b[_0x2a44('0x5e')])?moment()['format'](_0x2a44('0x59')):undefined});}return null;})['then'](function(_0x2c21c4){if(_0x2c21c4){_0x2f1a9a[_0x2a44('0x5f')]=_0x2c21c4[_0x2a44('0x5c')]({'plain':!![]});interaction_log[_0x2a44('0x1e')](_0x2a44('0x60'),_0x10684f[_0x2a44('0x5b')]['id'],_0x10684f[_0x2a44('0x5b')][_0x2a44('0x35')],_0x10684f['user']['role'],_0x2f1a9a[_0x2a44('0x5f')]['id'],_0x10684f[_0x2a44('0x53')]?JSON['stringify'](_0x10684f[_0x2a44('0x53')]):_0x2a44('0x61'));return respondWithRpcPromise(_0x2a44('0x62'),'acceptMessage',_0x2f1a9a);}return null;})['then'](function(_0x60b4d3){if(_0x60b4d3){if(_0x10684f[_0x2a44('0x53')]['manual']){_0x2f1a9a['message'][_0x2a44('0x63')]=util['format']('SIP/%s',_0x10684f[_0x2a44('0x5b')][_0x2a44('0x35')]);_0x2f1a9a['message'][_0x2a44('0x64')]=_0x2f1a9a[_0x2a44('0x64')];_0x2f1a9a['message'][_0x2a44('0x65')]='accept';return respondWithRpcPromise(_0x2a44('0x66'),_0x2a44('0x66'),{'event':_0x2a44('0x67'),'message':_0x2f1a9a[_0x2a44('0x26')]},client9002)['then'](function(){return _0x2f1a9a;});}return _0x2f1a9a;}return null;})[_0x2a44('0x1d')](respondWithResult(_0x2120c2,null))[_0x2a44('0x28')](handleError(_0x2120c2,null));};var interaction_log=require(_0x2a44('0x11'))(_0x2a44('0x56'));exports[_0x2a44('0x31')]=function(_0x3ff989,_0x2a33f4,_0x3f5494){var _0x28b328={'agent':{},'channel':'openchannel'};if(_0x3ff989[_0x2a44('0x53')]['id']){delete _0x3ff989[_0x2a44('0x53')]['id'];}_0x3ff989[_0x2a44('0x53')][_0x2a44('0x5a')]=_0x3ff989[_0x2a44('0x53')][_0x2a44('0x5a')]||_0x3ff989[_0x2a44('0x5b')]['id'];_0x28b328[_0x2a44('0x68')]['id']=_0x3ff989['body']['UserId'];return db[_0x2a44('0x37')][_0x2a44('0x54')]({'where':{'id':_0x3ff989[_0x2a44('0x50')]['id'],'UserId':null}})[_0x2a44('0x1d')](handleEntityNotFound(_0x2a33f4,null))[_0x2a44('0x1d')](function(_0x43ab9b){if(_0x43ab9b){_0x28b328[_0x2a44('0x26')]=_0x43ab9b[_0x2a44('0x5c')]({'plain':!![]});return db[_0x2a44('0x69')]['find']({'where':{'id':_0x43ab9b[_0x2a44('0x5d')]}});}return null;})[_0x2a44('0x1d')](handleEntityNotFound(_0x2a33f4,null))['then'](function(_0xc8f3dd){if(_0xc8f3dd){_0x28b328[_0x2a44('0x5f')]=_0xc8f3dd['get']({'plain':!![]});interaction_log[_0x2a44('0x1e')](_0x2a44('0x6a'),_0x3ff989[_0x2a44('0x5b')]['id'],_0x3ff989['user'][_0x2a44('0x35')],_0x3ff989[_0x2a44('0x5b')]['role'],_0x28b328[_0x2a44('0x5f')]['id'],_0x3ff989[_0x2a44('0x53')]?JSON[_0x2a44('0x23')](_0x3ff989[_0x2a44('0x53')]):_0x2a44('0x61'));return respondWithRpcPromise('RejectMessage',_0x2a44('0x6b'),_0x28b328);}return null;})[_0x2a44('0x1d')](function(_0x1130d0){if(_0x1130d0){_0x1130d0[_0x2a44('0x26')][_0x2a44('0x63')]=util[_0x2a44('0x6c')](_0x2a44('0x6d'),_0x3ff989['user']['name']);_0x1130d0['message'][_0x2a44('0x64')]=_0x28b328[_0x2a44('0x64')];_0x1130d0['message'][_0x2a44('0x65')]=_0x2a44('0x31');respondWithRpcPromise(_0x2a44('0x66'),'EventManager',{'event':_0x2a44('0x6e'),'message':_0x1130d0[_0x2a44('0x26')]},client9002);return _0x28b328;}return null;})['then'](respondWithResult(_0x2a33f4,null))[_0x2a44('0x28')](handleError(_0x2a33f4,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 1c67ca2..0ef8e0f 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 _0xa784=['../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xaf4971,_0x17231b){var _0x55f8c6=function(_0x2d2b51){while(--_0x2d2b51){_0xaf4971['push'](_0xaf4971['shift']());}};_0x55f8c6(++_0x17231b);}(_0xa784,0x149));var _0x4a78=function(_0x3a367e,_0x24cd36){_0x3a367e=_0x3a367e-0x0;var _0x3f811c=_0xa784[_0x3a367e];return _0x3f811c;};'use strict';var EventEmitter=require(_0x4a78('0x0'));var OpenchannelMessage=require(_0x4a78('0x1'))['db'][_0x4a78('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x4a78('0x3')](0x0);var events={'afterCreate':_0x4a78('0x4'),'afterUpdate':_0x4a78('0x5'),'afterDestroy':_0x4a78('0x6')};function emitEvent(_0x2295a3){return function(_0x59e407,_0x144d84,_0x398bad){OpenchannelMessageEvents[_0x4a78('0x7')](_0x2295a3+':'+_0x59e407['id'],_0x59e407);OpenchannelMessageEvents['emit'](_0x2295a3,_0x59e407);_0x398bad(null);};}for(var e in events){if(events[_0x4a78('0x8')](e)){var event=events[e];OpenchannelMessage[_0x4a78('0x9')](e,emitEvent(event));}}module[_0x4a78('0xa')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x12c9=['update','remove','emit','hasOwnProperty','exports','events','OpenchannelMessage'];(function(_0x1b7fbd,_0x332bee){var _0x238889=function(_0x4d3e7a){while(--_0x4d3e7a){_0x1b7fbd['push'](_0x1b7fbd['shift']());}};_0x238889(++_0x332bee);}(_0x12c9,0xa6));var _0x912c=function(_0x480310,_0x5922e9){_0x480310=_0x480310-0x0;var _0x2d2825=_0x12c9[_0x480310];return _0x2d2825;};'use strict';var EventEmitter=require(_0x912c('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x912c('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x912c('0x2'),'afterDestroy':_0x912c('0x3')};function emitEvent(_0x204091){return function(_0xe0ac9e,_0x31cda7,_0x42d846){OpenchannelMessageEvents[_0x912c('0x4')](_0x204091+':'+_0xe0ac9e['id'],_0xe0ac9e);OpenchannelMessageEvents[_0x912c('0x4')](_0x204091,_0xe0ac9e);_0x42d846(null);};}for(var e in events){if(events[_0x912c('0x5')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x912c('0x6')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 1c6216f..f480b65 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 _0xb2bb=['exports','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','catch','error','CmContact','find','OpenchannelAccountId','Contact','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','POST','GET','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb2bb,0xf2));var _0xbb2b=function(_0x30bd4d,_0x50eb60){_0x30bd4d=_0x30bd4d-0x0;var _0x306915=_0xb2bb[_0x30bd4d];return _0x306915;};'use strict';var _=require(_0xbb2b('0x0'));var util=require('util');var logger=require(_0xbb2b('0x1'))(_0xbb2b('0x2'));var moment=require(_0xbb2b('0x3'));var BPromise=require(_0xbb2b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb2b('0x5'));var rimraf=require(_0xbb2b('0x6'));var config=require(_0xbb2b('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0xbb2b('0x8')]=function(_0x26ad0a,_0xece22d){return _0x26ad0a[_0xbb2b('0x9')]('OpenchannelMessage',attributes,{'tableName':_0xbb2b('0xa'),'paranoid':![],'indexes':[{'name':_0xbb2b('0xb'),'fields':[_0xbb2b('0xc')],'type':_0xbb2b('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2a8b01,_0x239896,_0x276448){var _0x301cdf=_0x26ad0a[_0xbb2b('0xe')];var _0x5edd1a=_0x2a8b01[_0xbb2b('0xf')]({'plain':!![]});if(_0x5edd1a[_0xbb2b('0x10')][_0xbb2b('0x11')]()==='in'||_0x5edd1a[_0xbb2b('0x10')]['toLowerCase']()===_0xbb2b('0x12')&&!_0x5edd1a[_0xbb2b('0x13')]&&!_[_0xbb2b('0x14')](_0x5edd1a[_0xbb2b('0x15')])){_0x301cdf[_0xbb2b('0x16')][_0xbb2b('0x17')]({'where':{'id':_0x5edd1a[_0xbb2b('0x18')]}})[_0xbb2b('0x19')](function(_0x2a2558){if(_0x2a2558){_0x2a2558[_0xbb2b('0x1a')]({'lastMsgAt':_0x5edd1a['createdAt'],'lastMsgDirection':_0x5edd1a[_0xbb2b('0x10')][_0xbb2b('0x11')]()});}})[_0xbb2b('0x1b')](function(_0x44175a){console[_0xbb2b('0x1c')](_0x44175a);});}if(_0x5edd1a[_0xbb2b('0x10')]===_0xbb2b('0x12')&&!_0x5edd1a['secret']){var _0x4552e4;_0x301cdf[_0xbb2b('0x1d')]['describe']()[_0xbb2b('0x19')](function(_0x3bea8e){return _0x301cdf['OpenchannelAccount'][_0xbb2b('0x1e')]({'where':{'id':_0x5edd1a[_0xbb2b('0x1f')]},'include':[{'model':_0x301cdf['OpenchannelInteraction'],'as':'Interactions','where':{'id':_0x5edd1a[_0xbb2b('0x18')]},'limit':0x1,'include':[{'model':_0x301cdf['CmContact'],'as':_0xbb2b('0x20'),'attributes':_['keys'](_0x3bea8e)}]}]});})['then'](function(_0xb63f1b){_0x4552e4=_0xb63f1b[_0xbb2b('0xf')]({'plain':!![]});if(_0x4552e4&&_0x4552e4[_0xbb2b('0x21')]){logger[_0xbb2b('0x22')](_0xbb2b('0x23'),'afterCreate',util[_0xbb2b('0x24')](_0xbb2b('0x25'),_0x5edd1a['id'],_0x4552e4['replyUri']));if(_0x4552e4[_0xbb2b('0x26')]&&_0x4552e4[_0xbb2b('0x26')][_0xbb2b('0x27')]){_0x5edd1a[_0xbb2b('0x28')]=_['omit'](_0x4552e4['Interactions'][0x0],_0xbb2b('0x20'));_0x5edd1a[_0xbb2b('0x20')]=_0x4552e4[_0xbb2b('0x26')][0x0][_0xbb2b('0x20')];}var _0x239896={'method':_0xbb2b('0x29'),'uri':encodeURI(_0x4552e4[_0xbb2b('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x239896['method']){case _0xbb2b('0x2a'):_0x239896['qs']=_0x5edd1a;break;case'POST':_0x239896[_0xbb2b('0xc')]=_0x5edd1a;break;}return rp(_0x239896)[_0xbb2b('0x19')](function(_0x27b272){logger[_0xbb2b('0x22')](_0xbb2b('0x23'),_0xbb2b('0x2b'),util[_0xbb2b('0x24')](_0xbb2b('0x2c'),_0x5edd1a['id'],_0x4552e4['replyUri']));if(_0x27b272[_0xbb2b('0xc')][_0xbb2b('0x2d')]&&_0x27b272[_0xbb2b('0xc')]['threadId']!=_0x5edd1a[_0xbb2b('0x28')]['threadId']){return _0x301cdf[_0xbb2b('0x16')]['update']({'threadId':_0x27b272[_0xbb2b('0xc')][_0xbb2b('0x2d')]},{'logging':!![],'where':{'id':_0x5edd1a[_0xbb2b('0x28')]['id']}});}else{return;}})['then'](function(){return _0x2a8b01['update']({'read':!![]});})['catch'](function(_0x53b789){logger[_0xbb2b('0x1c')](_0xbb2b('0x23'),'afterCreate',util[_0xbb2b('0x2e')](_0x53b789,{'showHidden':![],'depth':null}));_0x276448();});}else{_0x276448();}})[_0xbb2b('0x2f')](function(){_0x276448();});}else{_0x276448();}}},'charset':_0xbb2b('0x30'),'collate':_0xbb2b('0x31')});}; \ No newline at end of file +var _0x355a=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','describe','find','Interactions','keys','info','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','Contact','POST','replyUri','method','Message\x20%d\x20forwarded\x20to\x20%s','threadId','OpenchannelMessage,\x20%s,\x20%s','inspect','finally','utf8mb4','util'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x355a,0x12b));var _0xa355=function(_0x2a9ce9,_0x9695f3){_0x2a9ce9=_0x2a9ce9-0x0;var _0x5cffa5=_0x355a[_0x2a9ce9];return _0x5cffa5;};'use strict';var _=require('lodash');var util=require(_0xa355('0x0'));var logger=require(_0xa355('0x1'))(_0xa355('0x2'));var moment=require('moment');var BPromise=require(_0xa355('0x3'));var rp=require(_0xa355('0x4'));var fs=require('fs');var path=require(_0xa355('0x5'));var rimraf=require(_0xa355('0x6'));var config=require(_0xa355('0x7'));var attributes=require(_0xa355('0x8'));module[_0xa355('0x9')]=function(_0x572403,_0xbe68e6){return _0x572403[_0xa355('0xa')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0xa355('0xb')],'type':_0xa355('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a676b,_0x2b47c8,_0x16e21e){var _0x33e433=_0x572403[_0xa355('0xd')];var _0x37ebf6=_0x1a676b[_0xa355('0xe')]({'plain':!![]});if(_0x37ebf6[_0xa355('0xf')][_0xa355('0x10')]()==='in'||_0x37ebf6[_0xa355('0xf')][_0xa355('0x10')]()===_0xa355('0x11')&&!_0x37ebf6[_0xa355('0x12')]&&!_[_0xa355('0x13')](_0x37ebf6[_0xa355('0x14')])){_0x33e433[_0xa355('0x15')][_0xa355('0x16')]({'where':{'id':_0x37ebf6[_0xa355('0x17')]}})[_0xa355('0x18')](function(_0x39de87){if(_0x39de87){_0x39de87[_0xa355('0x19')]({'lastMsgAt':_0x37ebf6[_0xa355('0x1a')],'lastMsgDirection':_0x37ebf6[_0xa355('0xf')][_0xa355('0x10')]()});}})[_0xa355('0x1b')](function(_0x969757){console[_0xa355('0x1c')](_0x969757);});}if(_0x37ebf6[_0xa355('0xf')]===_0xa355('0x11')&&!_0x37ebf6['secret']){var _0x3a1fa9;_0x33e433[_0xa355('0x1d')][_0xa355('0x1e')]()[_0xa355('0x18')](function(_0x51291d){return _0x33e433['OpenchannelAccount'][_0xa355('0x1f')]({'where':{'id':_0x37ebf6['OpenchannelAccountId']},'include':[{'model':_0x33e433[_0xa355('0x15')],'as':_0xa355('0x20'),'where':{'id':_0x37ebf6[_0xa355('0x17')]},'limit':0x1,'include':[{'model':_0x33e433[_0xa355('0x1d')],'as':'Contact','attributes':_[_0xa355('0x21')](_0x51291d)}]}]});})[_0xa355('0x18')](function(_0x1b00d3){_0x3a1fa9=_0x1b00d3[_0xa355('0xe')]({'plain':!![]});if(_0x3a1fa9&&_0x3a1fa9['replyUri']){logger[_0xa355('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0xa355('0x23'),util[_0xa355('0x24')](_0xa355('0x25'),_0x37ebf6['id'],_0x3a1fa9['replyUri']));if(_0x3a1fa9[_0xa355('0x20')]&&_0x3a1fa9[_0xa355('0x20')][_0xa355('0x26')]){_0x37ebf6[_0xa355('0x27')]=_['omit'](_0x3a1fa9[_0xa355('0x20')][0x0],_0xa355('0x28'));_0x37ebf6[_0xa355('0x28')]=_0x3a1fa9[_0xa355('0x20')][0x0]['Contact'];}var _0x2b47c8={'method':_0xa355('0x29'),'uri':encodeURI(_0x3a1fa9[_0xa355('0x2a')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2b47c8[_0xa355('0x2b')]){case'GET':_0x2b47c8['qs']=_0x37ebf6;break;case _0xa355('0x29'):_0x2b47c8[_0xa355('0xb')]=_0x37ebf6;break;}return rp(_0x2b47c8)[_0xa355('0x18')](function(_0x1b4523){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0xa355('0x23'),util[_0xa355('0x24')](_0xa355('0x2c'),_0x37ebf6['id'],_0x3a1fa9[_0xa355('0x2a')]));if(_0x1b4523[_0xa355('0xb')][_0xa355('0x2d')]&&_0x1b4523['body'][_0xa355('0x2d')]!=_0x37ebf6[_0xa355('0x27')][_0xa355('0x2d')]){return _0x33e433[_0xa355('0x15')][_0xa355('0x19')]({'threadId':_0x1b4523[_0xa355('0xb')][_0xa355('0x2d')]},{'logging':!![],'where':{'id':_0x37ebf6[_0xa355('0x27')]['id']}});}else{return;}})[_0xa355('0x18')](function(){return _0x1a676b[_0xa355('0x19')]({'read':!![]});})[_0xa355('0x1b')](function(_0x37b7f4){logger[_0xa355('0x1c')](_0xa355('0x2e'),_0xa355('0x23'),util[_0xa355('0x2f')](_0x37b7f4,{'showHidden':![],'depth':null}));_0x16e21e();});}else{_0x16e21e();}})[_0xa355('0x30')](function(){_0x16e21e();});}else{_0x16e21e();}}},'charset':_0xa355('0x31'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 5c43fe7..e240fe0 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 _0x285d=['debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x3f3ec4,_0x48e9a4){var _0x58adb4=function(_0x46314d){while(--_0x46314d){_0x3f3ec4['push'](_0x3f3ec4['shift']());}};_0x58adb4(++_0x48e9a4);}(_0x285d,0x92));var _0xd285=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x285d[_0x2dea24];return _0x309d58;};'use strict';var _=require(_0xd285('0x0'));var util=require(_0xd285('0x1'));var moment=require(_0xd285('0x2'));var BPromise=require(_0xd285('0x3'));var rs=require(_0xd285('0x4'));var fs=require('fs');var Redis=require(_0xd285('0x5'));var db=require(_0xd285('0x6'))['db'];var utils=require(_0xd285('0x7'));var logger=require(_0xd285('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd285('0x9'));var client=jayson[_0xd285('0xa')]['http']({'port':0x232a});config['redis']=_[_0xd285('0xb')](config[_0xd285('0xc')],{'host':_0xd285('0xd'),'port':0x18eb});var socket=require(_0xd285('0xe'))(new Redis(config[_0xd285('0xc')]));require(_0xd285('0xf'))[_0xd285('0x10')](socket);function respondWithRpcPromise(_0x4e3101,_0x1f2705,_0x3ec23c){return new BPromise(function(_0x15570a,_0x5f5516){return client['request'](_0x4e3101,_0x3ec23c)[_0xd285('0x11')](function(_0x39c7ac){logger['info'](_0xd285('0x12'),_0x1f2705,'request\x20sent');logger[_0xd285('0x13')](_0xd285('0x14'),_0x1f2705,_0xd285('0x15'),JSON[_0xd285('0x16')](_0x39c7ac));if(_0x39c7ac['error']){if(_0x39c7ac[_0xd285('0x17')]['code']===0x1f4){logger[_0xd285('0x17')](_0xd285('0x12'),_0x1f2705,_0x39c7ac[_0xd285('0x17')][_0xd285('0x18')]);return _0x5f5516(_0x39c7ac[_0xd285('0x17')][_0xd285('0x18')]);}logger['error'](_0xd285('0x12'),_0x1f2705,_0x39c7ac[_0xd285('0x17')][_0xd285('0x18')]);return _0x15570a(_0x39c7ac[_0xd285('0x17')][_0xd285('0x18')]);}else{logger[_0xd285('0x19')]('OpenchannelMessage,\x20%s,\x20%s',_0x1f2705,_0xd285('0x15'));_0x15570a(_0x39c7ac[_0xd285('0x1a')]['message']);}})[_0xd285('0x1b')](function(_0x5a7820){logger[_0xd285('0x17')](_0xd285('0x12'),_0x1f2705,_0x5a7820);_0x5f5516(_0x5a7820);});});}exports[_0xd285('0x1c')]=function(_0x352336){var _0x51572c=this;return new Promise(function(_0x379501,_0x38cc72){return db[_0xd285('0x1d')]['create'](_0x352336[_0xd285('0x1e')],{'raw':_0x352336[_0xd285('0x1f')]?_0x352336[_0xd285('0x1f')][_0xd285('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x5f0410){logger[_0xd285('0x19')](_0xd285('0x1c'),_0x352336);logger[_0xd285('0x13')](_0xd285('0x1c'),_0x352336,JSON[_0xd285('0x16')](_0x5f0410));_0x379501(_0x5f0410);})[_0xd285('0x1b')](function(_0x266c44){logger[_0xd285('0x17')](_0xd285('0x1c'),_0x266c44[_0xd285('0x18')],_0x352336);_0x38cc72(_0x51572c[_0xd285('0x17')](0x1f4,_0x266c44[_0xd285('0x18')]));});});}; \ No newline at end of file +var _0xb167=['../../mysqldb','jayson/promise','client','redis','./openchannelMessage.socket','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateOpenchannelMessage','OpenchannelMessage','create','options','raw','lodash','util','moment','bluebird','ioredis'];(function(_0x30ee17,_0x4a2efe){var _0x344303=function(_0x209243){while(--_0x209243){_0x30ee17['push'](_0x30ee17['shift']());}};_0x344303(++_0x4a2efe);}(_0xb167,0x172));var _0x7b16=function(_0x5a18ed,_0x3dde9b){_0x5a18ed=_0x5a18ed-0x0;var _0x448bd7=_0xb167[_0x5a18ed];return _0x448bd7;};'use strict';var _=require(_0x7b16('0x0'));var util=require(_0x7b16('0x1'));var moment=require(_0x7b16('0x2'));var BPromise=require(_0x7b16('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b16('0x4'));var db=require(_0x7b16('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7b16('0x6'));var client=jayson[_0x7b16('0x7')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x7b16('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7b16('0x8')]));require(_0x7b16('0x9'))['register'](socket);function respondWithRpcPromise(_0x6644c,_0x4a4396,_0x58e743){return new BPromise(function(_0x4c2def,_0x33d6d1){return client[_0x7b16('0xa')](_0x6644c,_0x58e743)[_0x7b16('0xb')](function(_0xb3fe03){logger[_0x7b16('0xc')](_0x7b16('0xd'),_0x4a4396,_0x7b16('0xe'));logger['debug'](_0x7b16('0xf'),_0x4a4396,'request\x20sent',JSON['stringify'](_0xb3fe03));if(_0xb3fe03['error']){if(_0xb3fe03[_0x7b16('0x10')][_0x7b16('0x11')]===0x1f4){logger['error'](_0x7b16('0xd'),_0x4a4396,_0xb3fe03[_0x7b16('0x10')][_0x7b16('0x12')]);return _0x33d6d1(_0xb3fe03[_0x7b16('0x10')][_0x7b16('0x12')]);}logger[_0x7b16('0x10')](_0x7b16('0xd'),_0x4a4396,_0xb3fe03[_0x7b16('0x10')][_0x7b16('0x12')]);return _0x4c2def(_0xb3fe03[_0x7b16('0x10')][_0x7b16('0x12')]);}else{logger[_0x7b16('0xc')]('OpenchannelMessage,\x20%s,\x20%s',_0x4a4396,_0x7b16('0xe'));_0x4c2def(_0xb3fe03['result']['message']);}})[_0x7b16('0x13')](function(_0x57a994){logger[_0x7b16('0x10')](_0x7b16('0xd'),_0x4a4396,_0x57a994);_0x33d6d1(_0x57a994);});});}exports[_0x7b16('0x14')]=function(_0x565442){var _0x514b88=this;return new Promise(function(_0x36d3e5,_0x2dd52c){return db[_0x7b16('0x15')][_0x7b16('0x16')](_0x565442['body'],{'raw':_0x565442[_0x7b16('0x17')]?_0x565442[_0x7b16('0x17')][_0x7b16('0x18')]===undefined?!![]:![]:!![]})[_0x7b16('0xb')](function(_0x202b2e){logger[_0x7b16('0xc')](_0x7b16('0x14'),_0x565442);logger['debug'](_0x7b16('0x14'),_0x565442,JSON['stringify'](_0x202b2e));_0x36d3e5(_0x202b2e);})[_0x7b16('0x13')](function(_0x407aaa){logger[_0x7b16('0x10')]('CreateOpenchannelMessage',_0x407aaa['message'],_0x565442);_0x2dd52c(_0x514b88['error'](0x1f4,_0x407aaa[_0x7b16('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 7b4d41e..6a0797e 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 _0x5089=['length','openchannelMessage:','./openchannelMessage.events','save','update','emit','register'];(function(_0x5e8472,_0x513b9e){var _0x24c0dc=function(_0x1a356b){while(--_0x1a356b){_0x5e8472['push'](_0x5e8472['shift']());}};_0x24c0dc(++_0x513b9e);}(_0x5089,0x1bb));var _0x9508=function(_0x544b3f,_0x4d8b66){_0x544b3f=_0x544b3f-0x0;var _0x15787f=_0x5089[_0x544b3f];return _0x15787f;};'use strict';var OpenchannelMessageEvents=require(_0x9508('0x0'));var events=[_0x9508('0x1'),'remove',_0x9508('0x2')];function createListener(_0x35878a,_0x7dd13d){return function(_0x100d7e){_0x7dd13d[_0x9508('0x3')](_0x35878a,_0x100d7e);};}function removeListener(_0x59d3ee,_0x86540d){return function(){OpenchannelMessageEvents['removeListener'](_0x59d3ee,_0x86540d);};}exports[_0x9508('0x4')]=function(_0x4538dd){for(var _0x257318=0x0,_0x4ab3c6=events[_0x9508('0x5')];_0x257318<_0x4ab3c6;_0x257318++){var _0x42d13a=events[_0x257318];var _0x55a5de=createListener(_0x9508('0x6')+_0x42d13a,_0x4538dd);OpenchannelMessageEvents['on'](_0x42d13a,_0x55a5de);}}; \ No newline at end of file +var _0xe0ae=['update','emit','removeListener','length','openchannelMessage:','remove'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xe0ae,0xa1));var _0xee0a=function(_0x592e40,_0x2ed011){_0x592e40=_0x592e40-0x0;var _0x5d4288=_0xe0ae[_0x592e40];return _0x5d4288;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0xee0a('0x0'),_0xee0a('0x1')];function createListener(_0x49a5e2,_0x42f3f6){return function(_0x4fa2cf){_0x42f3f6[_0xee0a('0x2')](_0x49a5e2,_0x4fa2cf);};}function removeListener(_0x45bbca,_0x4cd518){return function(){OpenchannelMessageEvents[_0xee0a('0x3')](_0x45bbca,_0x4cd518);};}exports['register']=function(_0x5bef07){for(var _0x39a302=0x0,_0x1c5071=events[_0xee0a('0x4')];_0x39a302<_0x1c5071;_0x39a302++){var _0x344355=events[_0x39a302];var _0x5e6d2e=createListener(_0xee0a('0x5')+_0x344355,_0x5bef07);OpenchannelMessageEvents['on'](_0x344355,_0x5e6d2e);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 79c2b6e..5d47951 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 _0x7140=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create','post','addTeams','addAgents','put','update','delete','removeAgents','exports'];(function(_0x5e1f2d,_0x4ad1f4){var _0x58e0a0=function(_0x45ea23){while(--_0x45ea23){_0x5e1f2d['push'](_0x5e1f2d['shift']());}};_0x58e0a0(++_0x4ad1f4);}(_0x7140,0x1c0));var _0x0714=function(_0x1c7889,_0x24cd26){_0x1c7889=_0x1c7889-0x0;var _0x2f14e5=_0x7140[_0x1c7889];return _0x2f14e5;};'use strict';var multer=require('multer');var util=require(_0x0714('0x0'));var path=require(_0x0714('0x1'));var timeout=require('connect-timeout');var express=require(_0x0714('0x2'));var router=express[_0x0714('0x3')]();var auth=require(_0x0714('0x4'));var interaction=require(_0x0714('0x5'));var config=require(_0x0714('0x6'));var controller=require(_0x0714('0x7'));router[_0x0714('0x8')]('/',auth[_0x0714('0x9')](),controller[_0x0714('0xa')]);router['get']('/describe',auth[_0x0714('0x9')](),controller[_0x0714('0xb')]);router[_0x0714('0x8')](_0x0714('0xc'),auth[_0x0714('0x9')](),controller[_0x0714('0xd')]);router[_0x0714('0x8')](_0x0714('0xe'),auth[_0x0714('0x9')](),controller[_0x0714('0xf')]);router[_0x0714('0x8')](_0x0714('0x10'),auth[_0x0714('0x9')](),controller[_0x0714('0x11')]);router[_0x0714('0x8')](_0x0714('0x12'),auth[_0x0714('0x9')](),controller['getAgents']);router['post']('/',auth[_0x0714('0x9')](),controller[_0x0714('0x13')]);router[_0x0714('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x0714('0x15')]);router[_0x0714('0x14')]('/:id/users',auth['isAuthenticated'](),controller[_0x0714('0x16')]);router[_0x0714('0x17')](_0x0714('0xc'),auth['isAuthenticated'](),controller[_0x0714('0x18')]);router[_0x0714('0x19')]('/:id',auth[_0x0714('0x9')](),controller['destroy']);router['delete'](_0x0714('0x10'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x0714('0x19')](_0x0714('0x12'),auth[_0x0714('0x9')](),controller[_0x0714('0x1a')]);module[_0x0714('0x1b')]=router; \ No newline at end of file +var _0x6518=['show','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','put','delete','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','describe','/:id'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x6518,0x1ed));var _0x8651=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x6518[_0x21aec3];return _0x288bbc;};'use strict';var multer=require('multer');var util=require(_0x8651('0x0'));var path=require(_0x8651('0x1'));var timeout=require(_0x8651('0x2'));var express=require(_0x8651('0x3'));var router=express['Router']();var auth=require(_0x8651('0x4'));var interaction=require(_0x8651('0x5'));var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router['get']('/',auth[_0x8651('0x6')](),controller[_0x8651('0x7')]);router[_0x8651('0x8')]('/describe',auth[_0x8651('0x6')](),controller[_0x8651('0x9')]);router[_0x8651('0x8')](_0x8651('0xa'),auth[_0x8651('0x6')](),controller[_0x8651('0xb')]);router[_0x8651('0x8')]('/:id/members',auth[_0x8651('0x6')](),controller[_0x8651('0xc')]);router['get'](_0x8651('0xd'),auth[_0x8651('0x6')](),controller['getTeams']);router[_0x8651('0x8')](_0x8651('0xe'),auth[_0x8651('0x6')](),controller[_0x8651('0xf')]);router[_0x8651('0x10')]('/',auth[_0x8651('0x6')](),controller['create']);router['post'](_0x8651('0xd'),auth[_0x8651('0x6')](),controller[_0x8651('0x11')]);router[_0x8651('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0x8651('0x12')]);router[_0x8651('0x13')](_0x8651('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x8651('0x14')](_0x8651('0xa'),auth[_0x8651('0x6')](),controller['destroy']);router[_0x8651('0x14')](_0x8651('0xd'),auth[_0x8651('0x6')](),controller['removeTeams']);router['delete'](_0x8651('0xe'),auth[_0x8651('0x6')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 5b2e3a6..db45c78 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 _0x6949=['roundrobin','sequelize','STRING','name'];(function(_0x1087eb,_0x17fff2){var _0x594ffd=function(_0x319de7){while(--_0x319de7){_0x1087eb['push'](_0x1087eb['shift']());}};_0x594ffd(++_0x17fff2);}(_0x6949,0xfd));var _0x9694=function(_0x30cc1a,_0x162bbc){_0x30cc1a=_0x30cc1a-0x0;var _0xb3f18f=_0x6949[_0x30cc1a];return _0xb3f18f;};'use strict';var Sequelize=require(_0x9694('0x0'));module['exports']={'name':{'type':Sequelize[_0x9694('0x1')],'unique':_0x9694('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9694('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0x9694('0x3'))}}; \ No newline at end of file +var _0x9e08=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x1635fe,_0x5f1d9f){var _0x3c512a=function(_0x26b53d){while(--_0x26b53d){_0x1635fe['push'](_0x1635fe['shift']());}};_0x3c512a(++_0x5f1d9f);}(_0x9e08,0x14b));var _0x89e0=function(_0x418df4,_0x32ff0e){_0x418df4=_0x418df4-0x0;var _0x5b85d8=_0x9e08[_0x418df4];return _0x5b85d8;};'use strict';var Sequelize=require(_0x89e0('0x0'));module[_0x89e0('0x1')]={'name':{'type':Sequelize[_0x89e0('0x2')],'unique':_0x89e0('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x89e0('0x2')]},'timeout':{'type':Sequelize[_0x89e0('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x89e0('0x5'),_0x89e0('0x6'),_0x89e0('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 3b5cb29..3526609 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 _0xf089=['each','UserOpenchannelQueue','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','tq.TeamId','from','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','all','value','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','destroy','then','get','OpenchannelQueues','UserProfileResource','stack','name','send','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','field','options','includeAll','include','findAll','params','OpenchannelQueue','rawAttributes','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','hasOwnProperty','User','findAndCountAll','openchannelPause','updatedAt','createdAt','rows','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','voicePause','interface','sequelize','transaction'];(function(_0x29aad6,_0x22b4c3){var _0x355592=function(_0x42bde5){while(--_0x42bde5){_0x29aad6['push'](_0x29aad6['shift']());}};_0x355592(++_0x22b4c3);}(_0xf089,0x1a9));var _0x9f08=function(_0x3b5c18,_0x2ef1f2){_0x3b5c18=_0x3b5c18-0x0;var _0x3e396a=_0xf089[_0x3b5c18];return _0x3e396a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9f08('0x0'));var rimraf=require(_0x9f08('0x1'));var zipdir=require(_0x9f08('0x2'));var jsonpatch=require(_0x9f08('0x3'));var rp=require(_0x9f08('0x4'));var moment=require(_0x9f08('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9f08('0x6'));var util=require(_0x9f08('0x7'));var path=require(_0x9f08('0x8'));var sox=require(_0x9f08('0x9'));var csv=require(_0x9f08('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9f08('0xb'));var squel=require(_0x9f08('0xc'));var crypto=require('crypto');var jsforce=require(_0x9f08('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9f08('0xa'));var querystring=require(_0x9f08('0xe'));var Papa=require(_0x9f08('0xf'));var Redis=require(_0x9f08('0x10'));var authService=require(_0x9f08('0x11'));var qs=require(_0x9f08('0x12'));var hardwareService=require(_0x9f08('0x13'));var logger=require(_0x9f08('0x14'))(_0x9f08('0x15'));var utils=require(_0x9f08('0x16'));var config=require(_0x9f08('0x17'));var db=require(_0x9f08('0x18'))['db'];config[_0x9f08('0x19')]=_[_0x9f08('0x1a')](config[_0x9f08('0x19')],{'host':_0x9f08('0x1b'),'port':0x18eb});var socket=require(_0x9f08('0x1c'))(new Redis(config[_0x9f08('0x19')]));require(_0x9f08('0x1d'))[_0x9f08('0x1e')](socket);function respondWithStatusCode(_0x2e66eb,_0x115ebf){_0x115ebf=_0x115ebf||0xcc;return function(_0x519892){if(_0x519892){return _0x2e66eb[_0x9f08('0x1f')](_0x115ebf);}return _0x2e66eb[_0x9f08('0x20')](_0x115ebf)[_0x9f08('0x21')]();};}function respondWithResult(_0x3c10a4,_0x592b0e){_0x592b0e=_0x592b0e||0xc8;return function(_0x551e59){if(_0x551e59){return _0x3c10a4[_0x9f08('0x20')](_0x592b0e)[_0x9f08('0x22')](_0x551e59);}};}function respondWithFilteredResult(_0x21dc46,_0x162b23){return function(_0x50a995){if(_0x50a995){var _0x416d26=_0x50a995[_0x9f08('0x23')],_0x504af8=_0x162b23[_0x9f08('0x24')],_0x5c6464=_0x162b23[_0x9f08('0x24')]+_0x162b23[_0x9f08('0x25')],_0x99fef3;if(_0x5c6464>=_0x416d26){_0x5c6464=_0x416d26;_0x99fef3=0xc8;}else{_0x99fef3=0xce;}_0x21dc46[_0x9f08('0x20')](_0x99fef3);return _0x21dc46[_0x9f08('0x26')]('Content-Range',_0x504af8+'-'+_0x5c6464+'/'+_0x416d26)['json'](_0x50a995);}return null;};}function patchUpdates(_0x5781e0){return function(_0x108267){try{jsonpatch[_0x9f08('0x27')](_0x108267,_0x5781e0,!![]);}catch(_0x15dfd6){return BPromise[_0x9f08('0x28')](_0x15dfd6);}return _0x108267['save']();};}function saveUpdates(_0x1617a0,_0x52edde){return function(_0x3463ad){if(_0x3463ad){return _0x3463ad[_0x9f08('0x29')](_0x1617a0)['then'](function(_0x35c33e){return _0x35c33e;});}return null;};}function removeEntity(_0xfb8aee,_0x3472fd){return function(_0x464e49){if(_0x464e49){return _0x464e49[_0x9f08('0x2a')]()[_0x9f08('0x2b')](function(){var _0x483e95=_0x464e49[_0x9f08('0x2c')]({'plain':!![]});var _0x1e4074=_0x9f08('0x2d');return db[_0x9f08('0x2e')][_0x9f08('0x2a')]({'where':{'type':_0x1e4074,'resourceId':_0x483e95['id']}})['then'](function(){return _0x464e49;});})[_0x9f08('0x2b')](function(){_0xfb8aee[_0x9f08('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x553a3a,_0x494137){return function(_0x13d195){if(!_0x13d195){_0x553a3a[_0x9f08('0x1f')](0x194);}return _0x13d195;};}function handleError(_0x28aeae,_0x1652ca){_0x1652ca=_0x1652ca||0x1f4;return function(_0x226182){logger['error'](_0x226182[_0x9f08('0x2f')]);if(_0x226182[_0x9f08('0x30')]){delete _0x226182[_0x9f08('0x30')];}_0x28aeae[_0x9f08('0x20')](_0x1652ca)[_0x9f08('0x31')](_0x226182);};}exports['index']=function(_0x179eed,_0x5bab27){var _0x45a208={},_0x4a4d74={},_0x507a05={'count':0x0,'rows':[]};var _0x492231=db['OpenchannelQueue']['rawAttributes'];_0x4a4d74['model']=_[_0x9f08('0x32')](_0x492231);_0x4a4d74[_0x9f08('0x33')]=_[_0x9f08('0x32')](_0x179eed[_0x9f08('0x33')]);_0x4a4d74[_0x9f08('0x34')]=_[_0x9f08('0x35')](_0x4a4d74[_0x9f08('0x36')],_0x4a4d74[_0x9f08('0x33')]);_0x45a208[_0x9f08('0x37')]=_[_0x9f08('0x35')](_0x4a4d74[_0x9f08('0x36')],qs[_0x9f08('0x38')](_0x179eed[_0x9f08('0x33')][_0x9f08('0x38')]));_0x45a208[_0x9f08('0x37')]=_0x45a208[_0x9f08('0x37')][_0x9f08('0x39')]?_0x45a208[_0x9f08('0x37')]:_0x4a4d74[_0x9f08('0x36')];if(!_0x179eed[_0x9f08('0x33')]['hasOwnProperty'](_0x9f08('0x3a'))){_0x45a208[_0x9f08('0x25')]=qs[_0x9f08('0x25')](_0x179eed[_0x9f08('0x33')][_0x9f08('0x25')]);_0x45a208[_0x9f08('0x24')]=qs[_0x9f08('0x24')](_0x179eed[_0x9f08('0x33')][_0x9f08('0x24')]);}_0x45a208[_0x9f08('0x3b')]=qs[_0x9f08('0x3c')](_0x179eed[_0x9f08('0x33')][_0x9f08('0x3c')]);_0x45a208[_0x9f08('0x3d')]=qs[_0x9f08('0x34')](_[_0x9f08('0x3e')](_0x179eed[_0x9f08('0x33')],_0x4a4d74[_0x9f08('0x34')]));if(_0x179eed[_0x9f08('0x33')][_0x9f08('0x3f')]){_0x45a208[_0x9f08('0x3d')]=_[_0x9f08('0x40')](_0x45a208[_0x9f08('0x3d')],{'$or':_[_0x9f08('0x41')](_0x492231,function(_0x564abb){if(_0x564abb['type']['key']!==_0x9f08('0x42')){var _0x294c3f={};_0x294c3f[_0x564abb[_0x9f08('0x43')]]={'$like':'%'+_0x179eed[_0x9f08('0x33')][_0x9f08('0x3f')]+'%'};return _0x294c3f;}})});}_0x45a208=_['merge']({},_0x45a208,_0x179eed[_0x9f08('0x44')]);var _0x500fdc={'where':_0x45a208[_0x9f08('0x3d')]};return db['OpenchannelQueue'][_0x9f08('0x23')](_0x500fdc)[_0x9f08('0x2b')](function(_0x2fd90b){_0x507a05[_0x9f08('0x23')]=_0x2fd90b;if(_0x179eed[_0x9f08('0x33')][_0x9f08('0x45')]){_0x45a208[_0x9f08('0x46')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x9f08('0x47')](_0x45a208);})[_0x9f08('0x2b')](function(_0x4d6942){_0x507a05['rows']=_0x4d6942;return _0x507a05;})['then'](respondWithFilteredResult(_0x5bab27,_0x45a208))['catch'](handleError(_0x5bab27,null));};exports['show']=function(_0x2497e9,_0x8c0358){var _0x1247f6={'raw':!![],'where':{'id':_0x2497e9[_0x9f08('0x48')]['id']}},_0x3b09df={};_0x3b09df['model']=_[_0x9f08('0x32')](db[_0x9f08('0x49')][_0x9f08('0x4a')]);_0x3b09df['query']=_[_0x9f08('0x32')](_0x2497e9[_0x9f08('0x33')]);_0x3b09df[_0x9f08('0x34')]=_['intersection'](_0x3b09df['model'],_0x3b09df['query']);_0x1247f6['attributes']=_[_0x9f08('0x35')](_0x3b09df['model'],qs[_0x9f08('0x38')](_0x2497e9[_0x9f08('0x33')][_0x9f08('0x38')]));_0x1247f6['attributes']=_0x1247f6['attributes'][_0x9f08('0x39')]?_0x1247f6['attributes']:_0x3b09df[_0x9f08('0x36')];if(_0x2497e9[_0x9f08('0x33')]['includeAll']){_0x1247f6[_0x9f08('0x46')]=[{'all':!![]}];}_0x1247f6=_['merge']({},_0x1247f6,_0x2497e9['options']);return db['OpenchannelQueue']['find'](_0x1247f6)[_0x9f08('0x2b')](handleEntityNotFound(_0x8c0358,null))[_0x9f08('0x2b')](respondWithResult(_0x8c0358,null))[_0x9f08('0x4b')](handleError(_0x8c0358,null));};exports[_0x9f08('0x4c')]=function(_0x2bb274,_0xe1680d){return db['OpenchannelQueue'][_0x9f08('0x4c')](_0x2bb274[_0x9f08('0x4d')],{})[_0x9f08('0x2b')](function(_0x45225d){var _0x5cb9ca=_0x2bb274[_0x9f08('0x4e')][_0x9f08('0x2c')]({'plain':!![]});if(!_0x5cb9ca)throw new Error(_0x9f08('0x4f'));if(_0x5cb9ca[_0x9f08('0x50')]===_0x9f08('0x4e')){var _0xfb084f=_0x45225d[_0x9f08('0x2c')]({'plain':!![]});var _0x500ed3=_0x9f08('0x2d');return db[_0x9f08('0x51')][_0x9f08('0x52')]({'where':{'name':_0x500ed3,'userProfileId':_0x5cb9ca[_0x9f08('0x53')]},'raw':!![]})[_0x9f08('0x2b')](function(_0x279781){if(_0x279781&&_0x279781[_0x9f08('0x54')]===0x0){return db['UserProfileResource'][_0x9f08('0x4c')]({'name':_0xfb084f[_0x9f08('0x30')],'resourceId':_0xfb084f['id'],'type':_0x279781['name'],'sectionId':_0x279781['id']},{})['then'](function(){return _0x45225d;});}else{return _0x45225d;}})[_0x9f08('0x4b')](function(_0x5c350a){logger[_0x9f08('0x55')](_0x9f08('0x56'),_0x5c350a);throw _0x5c350a;});}return _0x45225d;})[_0x9f08('0x2b')](respondWithResult(_0xe1680d,0xc9))[_0x9f08('0x4b')](handleError(_0xe1680d,null));};exports[_0x9f08('0x29')]=function(_0x12ee37,_0xfc208f){if(_0x12ee37[_0x9f08('0x4d')]['id']){delete _0x12ee37['body']['id'];}return db[_0x9f08('0x49')][_0x9f08('0x52')]({'where':{'id':_0x12ee37['params']['id']}})[_0x9f08('0x2b')](handleEntityNotFound(_0xfc208f,null))[_0x9f08('0x2b')](saveUpdates(_0x12ee37[_0x9f08('0x4d')],null))[_0x9f08('0x2b')](respondWithResult(_0xfc208f,null))['catch'](handleError(_0xfc208f,null));};exports[_0x9f08('0x2a')]=function(_0x5c09ca,_0x28c6d0){return db[_0x9f08('0x49')][_0x9f08('0x52')]({'where':{'id':_0x5c09ca[_0x9f08('0x48')]['id']}})[_0x9f08('0x2b')](handleEntityNotFound(_0x28c6d0,null))[_0x9f08('0x2b')](removeEntity(_0x28c6d0,null))['catch'](handleError(_0x28c6d0,null));};exports['describe']=function(_0x4262b7,_0x2dfb28){return db[_0x9f08('0x49')]['describe']()[_0x9f08('0x2b')](respondWithResult(_0x2dfb28,null))['catch'](handleError(_0x2dfb28,null));};exports[_0x9f08('0x57')]=function(_0x138068,_0x28a9a5,_0x41502f){var _0x26a2f2={'raw':!![],'where':{}},_0x132087={},_0x20b74c;return db[_0x9f08('0x49')][_0x9f08('0x58')]({'where':{'id':_0x138068[_0x9f08('0x48')]['id']}})[_0x9f08('0x2b')](handleEntityNotFound(_0x28a9a5,null))[_0x9f08('0x2b')](function(_0x1d228c){if(_0x1d228c){_0x20b74c=_0x1d228c[_0x9f08('0x2c')]({'plain':!![]});_0x132087['model']=_[_0x9f08('0x32')](db['UserOpenchannelQueue'][_0x9f08('0x4a')]);_0x132087['query']=_[_0x9f08('0x32')](_0x138068[_0x9f08('0x33')]);_0x132087[_0x9f08('0x34')]=_[_0x9f08('0x35')](_0x132087[_0x9f08('0x36')],_0x132087[_0x9f08('0x33')]);_0x26a2f2['attributes']=_[_0x9f08('0x35')](_0x132087[_0x9f08('0x36')],qs[_0x9f08('0x38')](_0x138068['query']['fields']));_0x26a2f2[_0x9f08('0x37')]=_0x26a2f2['attributes'][_0x9f08('0x39')]?_0x26a2f2[_0x9f08('0x37')]:_0x132087[_0x9f08('0x36')];if(!_0x138068[_0x9f08('0x33')][_0x9f08('0x59')](_0x9f08('0x3a'))){_0x26a2f2[_0x9f08('0x25')]=qs[_0x9f08('0x25')](_0x138068[_0x9f08('0x33')][_0x9f08('0x25')]);_0x26a2f2['offset']=qs['offset'](_0x138068[_0x9f08('0x33')][_0x9f08('0x24')]);}_0x26a2f2['order']=qs[_0x9f08('0x3c')](_0x138068['query'][_0x9f08('0x3c')]);_0x26a2f2[_0x9f08('0x3d')]=qs['filters'](_['pick'](_0x138068[_0x9f08('0x33')],_0x132087[_0x9f08('0x34')]));_0x26a2f2[_0x9f08('0x3d')]['OpenchannelQueueId']=_0x1d228c['id'];if(_0x138068['query'][_0x9f08('0x3f')]){_0x26a2f2[_0x9f08('0x3d')]=_['merge'](_0x26a2f2['where'],{'$or':_['map'](_0x26a2f2['attributes'],function(_0x298ff5){var _0x284165={};_0x284165[_0x298ff5]={'$like':'%'+_0x138068[_0x9f08('0x33')]['filter']+'%'};return _0x284165;})});}_0x26a2f2=_[_0x9f08('0x40')]({},_0x26a2f2,_0x138068[_0x9f08('0x44')]);return db['UserOpenchannelQueue'][_0x9f08('0x47')](_0x26a2f2);}})[_0x9f08('0x2b')](function(_0x38dd27){if(_0x38dd27){return db[_0x9f08('0x5a')][_0x9f08('0x5b')]({'where':{'id':_[_0x9f08('0x41')](_0x38dd27,'UserId'),'role':'agent'},'attributes':['id',_0x9f08('0x30'),_0x9f08('0x5c'),_0x9f08('0x5d'),_0x9f08('0x5e')]});}})[_0x9f08('0x2b')](function(_0x116c38){if(_0x116c38){return{'count':_0x116c38[_0x9f08('0x23')],'rows':_[_0x9f08('0x41')](_0x116c38[_0x9f08('0x5f')],function(_0x4a577d){return{'membername':_0x4a577d[_0x9f08('0x30')],'UserId':_0x4a577d['id'],'queue_name':_0x20b74c[_0x9f08('0x30')],'OpenchannelQueueId':_0x20b74c['id'],'interface':util['format'](_0x9f08('0x60'),_0x9f08('0x61'),_0x4a577d[_0x9f08('0x30')]),'penalty':0x0,'paused':_0x4a577d[_0x9f08('0x5c')],'createdAt':_0x4a577d[_0x9f08('0x5e')],'updatedAt':_0x4a577d[_0x9f08('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9f08('0x2b')](respondWithFilteredResult(_0x28a9a5,_0x26a2f2))[_0x9f08('0x4b')](handleError(_0x28a9a5,null));};exports[_0x9f08('0x62')]=function(_0x18a000,_0x3b5ba1,_0x570b0b){var _0x4dffae={};var _0x1033b1={};var _0x333eb6;var _0x3d019c;return db[_0x9f08('0x49')]['findOne']({'where':{'id':_0x18a000['params']['id']}})[_0x9f08('0x2b')](handleEntityNotFound(_0x3b5ba1,null))['then'](function(_0x4b438f){if(_0x4b438f){_0x333eb6=_0x4b438f;_0x1033b1[_0x9f08('0x36')]=_[_0x9f08('0x32')](db[_0x9f08('0x63')][_0x9f08('0x4a')]);_0x1033b1[_0x9f08('0x33')]=_['keys'](_0x18a000[_0x9f08('0x33')]);_0x1033b1[_0x9f08('0x34')]=_['intersection'](_0x1033b1[_0x9f08('0x36')],_0x1033b1['query']);_0x4dffae[_0x9f08('0x37')]=_[_0x9f08('0x35')](_0x1033b1[_0x9f08('0x36')],qs[_0x9f08('0x38')](_0x18a000[_0x9f08('0x33')]['fields']));_0x4dffae[_0x9f08('0x37')]=_0x4dffae[_0x9f08('0x37')][_0x9f08('0x39')]?_0x4dffae[_0x9f08('0x37')]:_0x1033b1[_0x9f08('0x36')];_0x4dffae[_0x9f08('0x3b')]=qs[_0x9f08('0x3c')](_0x18a000[_0x9f08('0x33')][_0x9f08('0x3c')]);_0x4dffae['where']=qs[_0x9f08('0x34')](_[_0x9f08('0x3e')](_0x18a000['query'],_0x1033b1[_0x9f08('0x34')]));if(_0x18a000[_0x9f08('0x33')]['filter']){_0x4dffae[_0x9f08('0x3d')]=_['merge'](_0x4dffae[_0x9f08('0x3d')],{'$or':_['map'](_0x4dffae['attributes'],function(_0x62a2a4){var _0xb61260={};_0xb61260[_0x62a2a4]={'$like':'%'+_0x18a000[_0x9f08('0x33')][_0x9f08('0x3f')]+'%'};return _0xb61260;})});}_0x4dffae=_[_0x9f08('0x40')]({},_0x4dffae,_0x18a000[_0x9f08('0x44')]);return _0x333eb6['getTeams'](_0x4dffae);}})[_0x9f08('0x2b')](function(_0x45f116){if(_0x45f116){_0x3d019c=_0x45f116[_0x9f08('0x39')];if(!_0x18a000[_0x9f08('0x33')][_0x9f08('0x59')]('nolimit')){_0x4dffae[_0x9f08('0x25')]=qs['limit'](_0x18a000[_0x9f08('0x33')][_0x9f08('0x25')]);_0x4dffae[_0x9f08('0x24')]=qs[_0x9f08('0x24')](_0x18a000[_0x9f08('0x33')][_0x9f08('0x24')]);}return _0x333eb6[_0x9f08('0x62')](_0x4dffae);}})['then'](function(_0x2d134a){if(_0x2d134a){return _0x2d134a?{'count':_0x3d019c,'rows':_0x2d134a}:null;}})[_0x9f08('0x2b')](respondWithResult(_0x3b5ba1,null))[_0x9f08('0x4b')](handleError(_0x3b5ba1,null));};exports[_0x9f08('0x64')]=function(_0x3eab15,_0x387f51,_0x15d1b7){var _0x44f73c=_0x3eab15[_0x9f08('0x4d')]['teams'];return db[_0x9f08('0x63')][_0x9f08('0x47')]({'where':{'id':_[_0x9f08('0x41')](_0x44f73c,'id')},'attributes':['id'],'include':[{'model':db[_0x9f08('0x5a')],'as':_0x9f08('0x65'),'attributes':['id',_0x9f08('0x30'),_0x9f08('0x66'),_0x9f08('0x67'),_0x9f08('0x68')],'raw':!![]}]})[_0x9f08('0x2b')](function(_0x57d4fe){if(_0x57d4fe){var _0x5c5cba=_['flatMap'](_0x57d4fe,function(_0x3579c5){var _0x5f4b44=_0x3579c5[_0x9f08('0x2c')]({'plain':!![]});return _0x5f4b44[_0x9f08('0x65')];});return db[_0x9f08('0x49')][_0x9f08('0x52')]({'where':{'id':_0x3eab15[_0x9f08('0x48')]['id']}})['then'](function(_0x2db941){return db[_0x9f08('0x69')][_0x9f08('0x6a')](function(_0x540700){return _0x2db941[_0x9f08('0x64')](_[_0x9f08('0x41')](_0x44f73c,'id'),{'transaction':_0x540700})[_0x9f08('0x2b')](function(){return BPromise[_0x9f08('0x6b')](_0x5c5cba,function(_0x373fa0){return db[_0x9f08('0x6c')][_0x9f08('0x6d')]({'where':{'UserId':_0x373fa0['id'],'OpenchannelQueueId':_0x3eab15[_0x9f08('0x48')]['id']},'transaction':_0x540700});});})[_0x9f08('0x2b')](function(){_0x5c5cba[_0x9f08('0x6e')](function(_0x4e9dfe){socket[_0x9f08('0x6f')](_0x9f08('0x70'),{'UserId':_0x4e9dfe['id'],'OpenchannelQueueId':_0x2db941['id']});});});});});}})[_0x9f08('0x2b')](respondWithStatusCode(_0x387f51,null))['catch'](handleError(_0x387f51,null));};exports[_0x9f08('0x71')]=function(_0x4ef267,_0x56c465,_0x27ebf6){return db['Team'][_0x9f08('0x47')]({'where':{'id':_0x4ef267[_0x9f08('0x33')][_0x9f08('0x72')]},'attributes':['id'],'include':[{'model':db[_0x9f08('0x5a')],'as':_0x9f08('0x65'),'attributes':['id'],'raw':!![]}]})[_0x9f08('0x2b')](handleEntityNotFound(_0x56c465,null))[_0x9f08('0x2b')](function(_0x168762){var _0x3fe1b5=_[_0x9f08('0x41')](_0x168762,'id');var _0x46ad3c=[];var _0x927237=[];var _0x56802e=squel['select']();_0x56802e[_0x9f08('0x43')](_0x9f08('0x73'))[_0x9f08('0x74')]('team_has_openchannel_queues','tq')['join'](_0x9f08('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x9f08('0x3d')](_0x9f08('0x76'),_0x4ef267[_0x9f08('0x48')]['id']);for(var _0x1d8913=0x0;_0x1d8913<_0x168762[_0x9f08('0x39')];_0x1d8913+=0x1){let _0x33066f=_0x168762[_0x1d8913];for(var _0x2b3d07=0x0;_0x2b3d07<_0x33066f[_0x9f08('0x65')][_0x9f08('0x39')];_0x2b3d07+=0x1){let _0xb2a9bb=_0x33066f[_0x9f08('0x65')][_0x2b3d07];var _0x27d3ea=_0x56802e[_0x9f08('0x77')]();_0x27d3ea[_0x9f08('0x3d')](_0x9f08('0x78'),_0xb2a9bb['id']);_0x927237['push'](db[_0x9f08('0x69')][_0x9f08('0x33')](_0x27d3ea[_0x9f08('0x79')](),{'type':db[_0x9f08('0x69')][_0x9f08('0x7a')][_0x9f08('0x7b')]})[_0x9f08('0x2b')](function(_0x1306d2){if(_0x1306d2[_0x9f08('0x39')]===0x1){return _0xb2a9bb['id'];}else{var _0x513544=_['every'](_[_0x9f08('0x41')](_0x1306d2,_0x9f08('0x7c')),function(_0x259e0e){return _['includes'](_0x3fe1b5,_0x259e0e);});if(_0x513544){return _0xb2a9bb['id'];}}}));}}return BPromise[_0x9f08('0x7d')](_0x927237)[_0x9f08('0x2b')](function(_0x2d0aaf){_0x46ad3c=_(_0x46ad3c)['union'](_0x2d0aaf)['compact']()[_0x9f08('0x7e')]();return db[_0x9f08('0x49')][_0x9f08('0x52')]({'where':{'id':_0x4ef267[_0x9f08('0x48')]['id']}})[_0x9f08('0x2b')](function(_0x1f6eff){return db[_0x9f08('0x69')][_0x9f08('0x6a')](function(_0x28a009){return _0x1f6eff['removeTeams'](_0x4ef267['query'][_0x9f08('0x72')],{'transaction':_0x28a009})[_0x9f08('0x2b')](function(){if(!_['isEmpty'](_0x46ad3c)){return _0x1f6eff[_0x9f08('0x7f')](_0x46ad3c,{'transaction':_0x28a009});}})[_0x9f08('0x2b')](function(){_0x46ad3c['forEach'](function(_0x8d928c){socket[_0x9f08('0x6f')](_0x9f08('0x80'),{'UserId':_0x8d928c,'OpenchannelQueueId':_0x1f6eff['id']});});});});});});})['then'](respondWithStatusCode(_0x56c465,null))[_0x9f08('0x4b')](handleError(_0x56c465,null));};exports[_0x9f08('0x81')]=function(_0x40c953,_0x257e74,_0x4fa675){return db[_0x9f08('0x49')][_0x9f08('0x52')]({'where':{'id':_0x40c953[_0x9f08('0x48')]['id']}})['then'](handleEntityNotFound(_0x257e74,null))['then'](function(_0x12bb74){if(_0x12bb74){return _0x12bb74[_0x9f08('0x81')](_0x40c953[_0x9f08('0x4d')][_0x9f08('0x72')],_[_0x9f08('0x82')](_0x40c953[_0x9f08('0x4d')],['ids','id'])||{})[_0x9f08('0x83')](function(_0x26eeb4){for(var _0x3565e8=0x0;_0x3565e8<_0x40c953[_0x9f08('0x4d')]['ids'][_0x9f08('0x39')];_0x3565e8+=0x1){socket[_0x9f08('0x6f')](_0x9f08('0x70'),{'UserId':_0x40c953[_0x9f08('0x4d')][_0x9f08('0x72')][_0x3565e8],'OpenchannelQueueId':_0x40c953[_0x9f08('0x48')]['id']});}return _0x26eeb4;});}})['then'](respondWithResult(_0x257e74,null))['catch'](handleError(_0x257e74,null));};exports['removeAgents']=function(_0x1a2827,_0x845150,_0x2d65fa){return db['OpenchannelQueue'][_0x9f08('0x52')]({'where':{'id':_0x1a2827[_0x9f08('0x48')]['id']}})[_0x9f08('0x2b')](handleEntityNotFound(_0x845150,null))[_0x9f08('0x2b')](function(_0x3009d3){if(_0x3009d3){return _0x3009d3[_0x9f08('0x7f')](_0x1a2827[_0x9f08('0x33')][_0x9f08('0x72')])[_0x9f08('0x2b')](function(){if(_['isArray'](_0x1a2827[_0x9f08('0x33')][_0x9f08('0x72')])){for(var _0x2dc2f4=0x0;_0x2dc2f4<_0x1a2827[_0x9f08('0x33')][_0x9f08('0x72')]['length'];_0x2dc2f4+=0x1){socket[_0x9f08('0x6f')](_0x9f08('0x80'),{'UserId':Number(_0x1a2827[_0x9f08('0x33')][_0x9f08('0x72')][_0x2dc2f4]),'OpenchannelQueueId':Number(_0x1a2827[_0x9f08('0x48')]['id'])});}}else{socket[_0x9f08('0x6f')](_0x9f08('0x80'),{'UserId':Number(_0x1a2827[_0x9f08('0x33')][_0x9f08('0x72')]),'OpenchannelQueueId':Number(_0x1a2827[_0x9f08('0x48')]['id'])});}});}})[_0x9f08('0x2b')](respondWithStatusCode(_0x845150,null))['catch'](handleError(_0x845150,null));};exports[_0x9f08('0x84')]=function(_0x4d6e97,_0x466c92,_0x156147){var _0x93b99f={};var _0xe11931={};var _0xdf63b6;var _0x51bf06;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x4d6e97[_0x9f08('0x48')]['id']}})[_0x9f08('0x2b')](handleEntityNotFound(_0x466c92,null))[_0x9f08('0x2b')](function(_0x276272){if(_0x276272){_0xdf63b6=_0x276272;_0xe11931[_0x9f08('0x36')]=_['keys'](db['User']['rawAttributes']);_0xe11931[_0x9f08('0x33')]=_[_0x9f08('0x32')](_0x4d6e97[_0x9f08('0x33')]);_0xe11931['filters']=_['intersection'](_0xe11931[_0x9f08('0x36')],_0xe11931[_0x9f08('0x33')]);_0x93b99f[_0x9f08('0x37')]=_[_0x9f08('0x35')](_0xe11931[_0x9f08('0x36')],qs[_0x9f08('0x38')](_0x4d6e97[_0x9f08('0x33')]['fields']));_0x93b99f[_0x9f08('0x37')]=_0x93b99f[_0x9f08('0x37')][_0x9f08('0x39')]?_0x93b99f[_0x9f08('0x37')]:_0xe11931[_0x9f08('0x36')];_0x93b99f[_0x9f08('0x3b')]=qs[_0x9f08('0x3c')](_0x4d6e97[_0x9f08('0x33')][_0x9f08('0x3c')]);_0x93b99f[_0x9f08('0x3d')]=qs[_0x9f08('0x34')](_['pick'](_0x4d6e97['query'],_0xe11931[_0x9f08('0x34')]));if(_0x4d6e97['query'][_0x9f08('0x3f')]){_0x93b99f[_0x9f08('0x3d')]=_[_0x9f08('0x40')](_0x93b99f[_0x9f08('0x3d')],{'$or':_['map'](_0x93b99f['attributes'],function(_0x5bdb8b){var _0x3d2a49={};_0x3d2a49[_0x5bdb8b]={'$like':'%'+_0x4d6e97[_0x9f08('0x33')][_0x9f08('0x3f')]+'%'};return _0x3d2a49;})});}_0x93b99f=_[_0x9f08('0x40')]({},_0x93b99f,_0x4d6e97[_0x9f08('0x44')]);return _0xdf63b6['getAgents'](_0x93b99f);}})['then'](function(_0x197deb){if(_0x197deb){_0x51bf06=_0x197deb['length'];if(!_0x4d6e97[_0x9f08('0x33')][_0x9f08('0x59')]('nolimit')){_0x93b99f[_0x9f08('0x25')]=qs[_0x9f08('0x25')](_0x4d6e97[_0x9f08('0x33')][_0x9f08('0x25')]);_0x93b99f[_0x9f08('0x24')]=qs[_0x9f08('0x24')](_0x4d6e97['query'][_0x9f08('0x24')]);}return _0xdf63b6['getAgents'](_0x93b99f);}})[_0x9f08('0x2b')](function(_0x55c13c){if(_0x55c13c){return _0x55c13c?{'count':_0x51bf06,'rows':_0x55c13c}:null;}})[_0x9f08('0x2b')](respondWithResult(_0x466c92,null))[_0x9f08('0x4b')](handleError(_0x466c92,null));}; \ No newline at end of file +var _0xad68=['api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelQueue.socket','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','UserProfileResource','end','error','stack','name','send','index','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','key','field','options','OpenchannelQueue','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','pick','OpenchannelQueueId','User','findAndCountAll','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','teams','Team','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userOpenchannelQueue:save','ids','select','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','includes','all','union','compact','value','removeTeams','removeAgents','emit','userOpenchannelQueue:remove','addAgents','spread','getAgents','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger'];(function(_0x1539b8,_0x1ce7e6){var _0x599352=function(_0x2a7b77){while(--_0x2a7b77){_0x1539b8['push'](_0x1539b8['shift']());}};_0x599352(++_0x1ce7e6);}(_0xad68,0x100));var _0x8ad6=function(_0x36f5ae,_0x53960b){_0x36f5ae=_0x36f5ae-0x0;var _0x10c86c=_0xad68[_0x36f5ae];return _0x10c86c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x8ad6('0x0'));var zipdir=require(_0x8ad6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8ad6('0x2'));var BPromise=require(_0x8ad6('0x3'));var Mustache=require(_0x8ad6('0x4'));var util=require(_0x8ad6('0x5'));var path=require(_0x8ad6('0x6'));var sox=require(_0x8ad6('0x7'));var csv=require(_0x8ad6('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8ad6('0x9'));var squel=require(_0x8ad6('0xa'));var crypto=require(_0x8ad6('0xb'));var jsforce=require(_0x8ad6('0xc'));var deskjs=require(_0x8ad6('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8ad6('0xe'));var Redis=require(_0x8ad6('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x8ad6('0x10'));var logger=require(_0x8ad6('0x11'))(_0x8ad6('0x12'));var utils=require(_0x8ad6('0x13'));var config=require(_0x8ad6('0x14'));var db=require(_0x8ad6('0x15'))['db'];config[_0x8ad6('0x16')]=_[_0x8ad6('0x17')](config['redis'],{'host':_0x8ad6('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8ad6('0x19'))['register'](socket);function respondWithStatusCode(_0x329fca,_0x50179e){_0x50179e=_0x50179e||0xcc;return function(_0x307afc){if(_0x307afc){return _0x329fca[_0x8ad6('0x1a')](_0x50179e);}return _0x329fca[_0x8ad6('0x1b')](_0x50179e)['end']();};}function respondWithResult(_0x45e709,_0x1fed01){_0x1fed01=_0x1fed01||0xc8;return function(_0x37a7f0){if(_0x37a7f0){return _0x45e709[_0x8ad6('0x1b')](_0x1fed01)[_0x8ad6('0x1c')](_0x37a7f0);}};}function respondWithFilteredResult(_0xb7e3e2,_0x884caa){return function(_0x2e9a2e){if(_0x2e9a2e){var _0x513b8e=_0x2e9a2e[_0x8ad6('0x1d')],_0x8ca3e3=_0x884caa[_0x8ad6('0x1e')],_0x3e5f02=_0x884caa[_0x8ad6('0x1e')]+_0x884caa[_0x8ad6('0x1f')],_0x29e6a6;if(_0x3e5f02>=_0x513b8e){_0x3e5f02=_0x513b8e;_0x29e6a6=0xc8;}else{_0x29e6a6=0xce;}_0xb7e3e2['status'](_0x29e6a6);return _0xb7e3e2[_0x8ad6('0x20')](_0x8ad6('0x21'),_0x8ca3e3+'-'+_0x3e5f02+'/'+_0x513b8e)[_0x8ad6('0x1c')](_0x2e9a2e);}return null;};}function patchUpdates(_0x52f4ab){return function(_0x47086a){try{jsonpatch[_0x8ad6('0x22')](_0x47086a,_0x52f4ab,!![]);}catch(_0x3074e7){return BPromise[_0x8ad6('0x23')](_0x3074e7);}return _0x47086a[_0x8ad6('0x24')]();};}function saveUpdates(_0x46f5bf,_0x42f18b){return function(_0x5edc1){if(_0x5edc1){return _0x5edc1[_0x8ad6('0x25')](_0x46f5bf)['then'](function(_0x47af23){return _0x47af23;});}return null;};}function removeEntity(_0x2762e7,_0x351267){return function(_0x558430){if(_0x558430){return _0x558430[_0x8ad6('0x26')]()[_0x8ad6('0x27')](function(){var _0x18b3de=_0x558430['get']({'plain':!![]});var _0x54adf7='OpenchannelQueues';return db[_0x8ad6('0x28')][_0x8ad6('0x26')]({'where':{'type':_0x54adf7,'resourceId':_0x18b3de['id']}})[_0x8ad6('0x27')](function(){return _0x558430;});})[_0x8ad6('0x27')](function(){_0x2762e7[_0x8ad6('0x1b')](0xcc)[_0x8ad6('0x29')]();});}};}function handleEntityNotFound(_0xa20d8c,_0x3a6151){return function(_0x44586f){if(!_0x44586f){_0xa20d8c[_0x8ad6('0x1a')](0x194);}return _0x44586f;};}function handleError(_0x32c423,_0xe1e026){_0xe1e026=_0xe1e026||0x1f4;return function(_0x303f6a){logger[_0x8ad6('0x2a')](_0x303f6a[_0x8ad6('0x2b')]);if(_0x303f6a[_0x8ad6('0x2c')]){delete _0x303f6a[_0x8ad6('0x2c')];}_0x32c423[_0x8ad6('0x1b')](_0xe1e026)[_0x8ad6('0x2d')](_0x303f6a);};}exports[_0x8ad6('0x2e')]=function(_0x519545,_0x3dfedd){var _0x3e261c={},_0x105d07={},_0x514443={'count':0x0,'rows':[]};var _0x18bf7b=db['OpenchannelQueue']['rawAttributes'];_0x105d07['model']=_[_0x8ad6('0x2f')](_0x18bf7b);_0x105d07[_0x8ad6('0x30')]=_['keys'](_0x519545[_0x8ad6('0x30')]);_0x105d07[_0x8ad6('0x31')]=_[_0x8ad6('0x32')](_0x105d07[_0x8ad6('0x33')],_0x105d07[_0x8ad6('0x30')]);_0x3e261c['attributes']=_[_0x8ad6('0x32')](_0x105d07[_0x8ad6('0x33')],qs['fields'](_0x519545[_0x8ad6('0x30')]['fields']));_0x3e261c['attributes']=_0x3e261c[_0x8ad6('0x34')][_0x8ad6('0x35')]?_0x3e261c['attributes']:_0x105d07[_0x8ad6('0x33')];if(!_0x519545[_0x8ad6('0x30')][_0x8ad6('0x36')](_0x8ad6('0x37'))){_0x3e261c['limit']=qs[_0x8ad6('0x1f')](_0x519545[_0x8ad6('0x30')][_0x8ad6('0x1f')]);_0x3e261c[_0x8ad6('0x1e')]=qs['offset'](_0x519545['query'][_0x8ad6('0x1e')]);}_0x3e261c[_0x8ad6('0x38')]=qs[_0x8ad6('0x39')](_0x519545['query']['sort']);_0x3e261c[_0x8ad6('0x3a')]=qs[_0x8ad6('0x31')](_['pick'](_0x519545[_0x8ad6('0x30')],_0x105d07[_0x8ad6('0x31')]));if(_0x519545['query'][_0x8ad6('0x3b')]){_0x3e261c['where']=_[_0x8ad6('0x3c')](_0x3e261c['where'],{'$or':_[_0x8ad6('0x3d')](_0x18bf7b,function(_0x452e0f){if(_0x452e0f['type'][_0x8ad6('0x3e')]!=='VIRTUAL'){var _0x506053={};_0x506053[_0x452e0f[_0x8ad6('0x3f')]]={'$like':'%'+_0x519545[_0x8ad6('0x30')][_0x8ad6('0x3b')]+'%'};return _0x506053;}})});}_0x3e261c=_[_0x8ad6('0x3c')]({},_0x3e261c,_0x519545[_0x8ad6('0x40')]);var _0x5c3bd1={'where':_0x3e261c[_0x8ad6('0x3a')]};return db[_0x8ad6('0x41')]['count'](_0x5c3bd1)[_0x8ad6('0x27')](function(_0x5052c1){_0x514443[_0x8ad6('0x1d')]=_0x5052c1;if(_0x519545['query'][_0x8ad6('0x42')]){_0x3e261c[_0x8ad6('0x43')]=[{'all':!![]}];}return db[_0x8ad6('0x41')][_0x8ad6('0x44')](_0x3e261c);})['then'](function(_0x2ef6fc){_0x514443[_0x8ad6('0x45')]=_0x2ef6fc;return _0x514443;})[_0x8ad6('0x27')](respondWithFilteredResult(_0x3dfedd,_0x3e261c))[_0x8ad6('0x46')](handleError(_0x3dfedd,null));};exports[_0x8ad6('0x47')]=function(_0x5deb79,_0x4dba35){var _0x1e429d={'raw':!![],'where':{'id':_0x5deb79[_0x8ad6('0x48')]['id']}},_0x1294a0={};_0x1294a0[_0x8ad6('0x33')]=_[_0x8ad6('0x2f')](db[_0x8ad6('0x41')][_0x8ad6('0x49')]);_0x1294a0[_0x8ad6('0x30')]=_[_0x8ad6('0x2f')](_0x5deb79[_0x8ad6('0x30')]);_0x1294a0['filters']=_[_0x8ad6('0x32')](_0x1294a0[_0x8ad6('0x33')],_0x1294a0[_0x8ad6('0x30')]);_0x1e429d[_0x8ad6('0x34')]=_[_0x8ad6('0x32')](_0x1294a0[_0x8ad6('0x33')],qs[_0x8ad6('0x4a')](_0x5deb79[_0x8ad6('0x30')][_0x8ad6('0x4a')]));_0x1e429d['attributes']=_0x1e429d[_0x8ad6('0x34')][_0x8ad6('0x35')]?_0x1e429d[_0x8ad6('0x34')]:_0x1294a0['model'];if(_0x5deb79['query'][_0x8ad6('0x42')]){_0x1e429d[_0x8ad6('0x43')]=[{'all':!![]}];}_0x1e429d=_[_0x8ad6('0x3c')]({},_0x1e429d,_0x5deb79[_0x8ad6('0x40')]);return db[_0x8ad6('0x41')][_0x8ad6('0x4b')](_0x1e429d)[_0x8ad6('0x27')](handleEntityNotFound(_0x4dba35,null))['then'](respondWithResult(_0x4dba35,null))[_0x8ad6('0x46')](handleError(_0x4dba35,null));};exports[_0x8ad6('0x4c')]=function(_0x29aebe,_0x435d2f){return db[_0x8ad6('0x41')][_0x8ad6('0x4c')](_0x29aebe[_0x8ad6('0x4d')],{})[_0x8ad6('0x27')](function(_0x52c1ca){var _0x5ad49f=_0x29aebe[_0x8ad6('0x4e')][_0x8ad6('0x4f')]({'plain':!![]});if(!_0x5ad49f)throw new Error(_0x8ad6('0x50'));if(_0x5ad49f['role']==='user'){var _0x51287d=_0x52c1ca['get']({'plain':!![]});var _0x2ff9b1='OpenchannelQueues';return db[_0x8ad6('0x51')][_0x8ad6('0x4b')]({'where':{'name':_0x2ff9b1,'userProfileId':_0x5ad49f['userProfileId']},'raw':!![]})[_0x8ad6('0x27')](function(_0x32cdc3){if(_0x32cdc3&&_0x32cdc3[_0x8ad6('0x52')]===0x0){return db[_0x8ad6('0x28')]['create']({'name':_0x51287d[_0x8ad6('0x2c')],'resourceId':_0x51287d['id'],'type':_0x32cdc3['name'],'sectionId':_0x32cdc3['id']},{})[_0x8ad6('0x27')](function(){return _0x52c1ca;});}else{return _0x52c1ca;}})[_0x8ad6('0x46')](function(_0x3a678e){logger[_0x8ad6('0x2a')](_0x8ad6('0x53'),_0x3a678e);throw _0x3a678e;});}return _0x52c1ca;})[_0x8ad6('0x27')](respondWithResult(_0x435d2f,0xc9))[_0x8ad6('0x46')](handleError(_0x435d2f,null));};exports['update']=function(_0x54404b,_0x122293){if(_0x54404b[_0x8ad6('0x4d')]['id']){delete _0x54404b[_0x8ad6('0x4d')]['id'];}return db[_0x8ad6('0x41')][_0x8ad6('0x4b')]({'where':{'id':_0x54404b['params']['id']}})[_0x8ad6('0x27')](handleEntityNotFound(_0x122293,null))[_0x8ad6('0x27')](saveUpdates(_0x54404b['body'],null))[_0x8ad6('0x27')](respondWithResult(_0x122293,null))['catch'](handleError(_0x122293,null));};exports[_0x8ad6('0x26')]=function(_0x2cd9b7,_0x481c5a){return db['OpenchannelQueue'][_0x8ad6('0x4b')]({'where':{'id':_0x2cd9b7['params']['id']}})['then'](handleEntityNotFound(_0x481c5a,null))[_0x8ad6('0x27')](removeEntity(_0x481c5a,null))['catch'](handleError(_0x481c5a,null));};exports[_0x8ad6('0x54')]=function(_0x5c0a84,_0x61f655){return db[_0x8ad6('0x41')]['describe']()[_0x8ad6('0x27')](respondWithResult(_0x61f655,null))[_0x8ad6('0x46')](handleError(_0x61f655,null));};exports[_0x8ad6('0x55')]=function(_0x47ddff,_0x4c09dd,_0x29cff7){var _0x15b503={'raw':!![],'where':{}},_0x9bf72f={},_0x3056e3;return db[_0x8ad6('0x41')][_0x8ad6('0x56')]({'where':{'id':_0x47ddff[_0x8ad6('0x48')]['id']}})[_0x8ad6('0x27')](handleEntityNotFound(_0x4c09dd,null))[_0x8ad6('0x27')](function(_0x12b548){if(_0x12b548){_0x3056e3=_0x12b548[_0x8ad6('0x4f')]({'plain':!![]});_0x9bf72f[_0x8ad6('0x33')]=_[_0x8ad6('0x2f')](db[_0x8ad6('0x57')][_0x8ad6('0x49')]);_0x9bf72f['query']=_[_0x8ad6('0x2f')](_0x47ddff[_0x8ad6('0x30')]);_0x9bf72f[_0x8ad6('0x31')]=_['intersection'](_0x9bf72f[_0x8ad6('0x33')],_0x9bf72f['query']);_0x15b503[_0x8ad6('0x34')]=_[_0x8ad6('0x32')](_0x9bf72f[_0x8ad6('0x33')],qs[_0x8ad6('0x4a')](_0x47ddff['query'][_0x8ad6('0x4a')]));_0x15b503['attributes']=_0x15b503[_0x8ad6('0x34')][_0x8ad6('0x35')]?_0x15b503[_0x8ad6('0x34')]:_0x9bf72f['model'];if(!_0x47ddff[_0x8ad6('0x30')][_0x8ad6('0x36')]('nolimit')){_0x15b503['limit']=qs[_0x8ad6('0x1f')](_0x47ddff['query']['limit']);_0x15b503[_0x8ad6('0x1e')]=qs[_0x8ad6('0x1e')](_0x47ddff[_0x8ad6('0x30')][_0x8ad6('0x1e')]);}_0x15b503['order']=qs[_0x8ad6('0x39')](_0x47ddff['query']['sort']);_0x15b503['where']=qs['filters'](_[_0x8ad6('0x58')](_0x47ddff[_0x8ad6('0x30')],_0x9bf72f[_0x8ad6('0x31')]));_0x15b503['where'][_0x8ad6('0x59')]=_0x12b548['id'];if(_0x47ddff['query'][_0x8ad6('0x3b')]){_0x15b503[_0x8ad6('0x3a')]=_[_0x8ad6('0x3c')](_0x15b503[_0x8ad6('0x3a')],{'$or':_[_0x8ad6('0x3d')](_0x15b503[_0x8ad6('0x34')],function(_0x3e949f){var _0xe7cb83={};_0xe7cb83[_0x3e949f]={'$like':'%'+_0x47ddff[_0x8ad6('0x30')]['filter']+'%'};return _0xe7cb83;})});}_0x15b503=_[_0x8ad6('0x3c')]({},_0x15b503,_0x47ddff[_0x8ad6('0x40')]);return db['UserOpenchannelQueue'][_0x8ad6('0x44')](_0x15b503);}})[_0x8ad6('0x27')](function(_0x2ecd63){if(_0x2ecd63){return db[_0x8ad6('0x5a')][_0x8ad6('0x5b')]({'where':{'id':_[_0x8ad6('0x3d')](_0x2ecd63,'UserId'),'role':'agent'},'attributes':['id',_0x8ad6('0x2c'),_0x8ad6('0x5c'),_0x8ad6('0x5d'),_0x8ad6('0x5e')]});}})[_0x8ad6('0x27')](function(_0xec8375){if(_0xec8375){return{'count':_0xec8375[_0x8ad6('0x1d')],'rows':_[_0x8ad6('0x3d')](_0xec8375['rows'],function(_0x5dd2c8){return{'membername':_0x5dd2c8['name'],'UserId':_0x5dd2c8['id'],'queue_name':_0x3056e3['name'],'OpenchannelQueueId':_0x3056e3['id'],'interface':util[_0x8ad6('0x5f')](_0x8ad6('0x60'),_0x8ad6('0x61'),_0x5dd2c8[_0x8ad6('0x2c')]),'penalty':0x0,'paused':_0x5dd2c8[_0x8ad6('0x5c')],'createdAt':_0x5dd2c8[_0x8ad6('0x5e')],'updatedAt':_0x5dd2c8['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8ad6('0x27')](respondWithFilteredResult(_0x4c09dd,_0x15b503))[_0x8ad6('0x46')](handleError(_0x4c09dd,null));};exports[_0x8ad6('0x62')]=function(_0xca7e9b,_0x5ed6b4,_0x16f57a){var _0x5669e1={};var _0xa7804={};var _0x4e1c73;var _0x282f73;return db[_0x8ad6('0x41')]['findOne']({'where':{'id':_0xca7e9b[_0x8ad6('0x48')]['id']}})[_0x8ad6('0x27')](handleEntityNotFound(_0x5ed6b4,null))[_0x8ad6('0x27')](function(_0x16257a){if(_0x16257a){_0x4e1c73=_0x16257a;_0xa7804[_0x8ad6('0x33')]=_[_0x8ad6('0x2f')](db['Team'][_0x8ad6('0x49')]);_0xa7804['query']=_[_0x8ad6('0x2f')](_0xca7e9b[_0x8ad6('0x30')]);_0xa7804[_0x8ad6('0x31')]=_[_0x8ad6('0x32')](_0xa7804[_0x8ad6('0x33')],_0xa7804[_0x8ad6('0x30')]);_0x5669e1[_0x8ad6('0x34')]=_[_0x8ad6('0x32')](_0xa7804[_0x8ad6('0x33')],qs[_0x8ad6('0x4a')](_0xca7e9b['query'][_0x8ad6('0x4a')]));_0x5669e1[_0x8ad6('0x34')]=_0x5669e1[_0x8ad6('0x34')][_0x8ad6('0x35')]?_0x5669e1['attributes']:_0xa7804[_0x8ad6('0x33')];_0x5669e1[_0x8ad6('0x38')]=qs[_0x8ad6('0x39')](_0xca7e9b[_0x8ad6('0x30')]['sort']);_0x5669e1['where']=qs[_0x8ad6('0x31')](_[_0x8ad6('0x58')](_0xca7e9b[_0x8ad6('0x30')],_0xa7804['filters']));if(_0xca7e9b[_0x8ad6('0x30')][_0x8ad6('0x3b')]){_0x5669e1['where']=_[_0x8ad6('0x3c')](_0x5669e1[_0x8ad6('0x3a')],{'$or':_[_0x8ad6('0x3d')](_0x5669e1[_0x8ad6('0x34')],function(_0x572704){var _0x4ba4ac={};_0x4ba4ac[_0x572704]={'$like':'%'+_0xca7e9b[_0x8ad6('0x30')][_0x8ad6('0x3b')]+'%'};return _0x4ba4ac;})});}_0x5669e1=_[_0x8ad6('0x3c')]({},_0x5669e1,_0xca7e9b['options']);return _0x4e1c73[_0x8ad6('0x62')](_0x5669e1);}})['then'](function(_0x3205c3){if(_0x3205c3){_0x282f73=_0x3205c3['length'];if(!_0xca7e9b[_0x8ad6('0x30')][_0x8ad6('0x36')](_0x8ad6('0x37'))){_0x5669e1[_0x8ad6('0x1f')]=qs[_0x8ad6('0x1f')](_0xca7e9b[_0x8ad6('0x30')][_0x8ad6('0x1f')]);_0x5669e1[_0x8ad6('0x1e')]=qs['offset'](_0xca7e9b[_0x8ad6('0x30')]['offset']);}return _0x4e1c73[_0x8ad6('0x62')](_0x5669e1);}})[_0x8ad6('0x27')](function(_0x3034b1){if(_0x3034b1){return _0x3034b1?{'count':_0x282f73,'rows':_0x3034b1}:null;}})[_0x8ad6('0x27')](respondWithResult(_0x5ed6b4,null))[_0x8ad6('0x46')](handleError(_0x5ed6b4,null));};exports[_0x8ad6('0x63')]=function(_0x168c07,_0x518c79,_0x1c8750){var _0x53959c=_0x168c07['body'][_0x8ad6('0x64')];return db[_0x8ad6('0x65')][_0x8ad6('0x44')]({'where':{'id':_['map'](_0x53959c,'id')},'attributes':['id'],'include':[{'model':db[_0x8ad6('0x5a')],'as':_0x8ad6('0x66'),'attributes':['id',_0x8ad6('0x2c'),_0x8ad6('0x67'),'voicePause',_0x8ad6('0x68')],'raw':!![]}]})[_0x8ad6('0x27')](function(_0x182cc0){if(_0x182cc0){var _0x32a9fc=_[_0x8ad6('0x69')](_0x182cc0,function(_0x2b5be9){var _0x3fe3e9=_0x2b5be9[_0x8ad6('0x4f')]({'plain':!![]});return _0x3fe3e9['Agents'];});return db[_0x8ad6('0x41')]['find']({'where':{'id':_0x168c07[_0x8ad6('0x48')]['id']}})[_0x8ad6('0x27')](function(_0x181704){return db[_0x8ad6('0x6a')][_0x8ad6('0x6b')](function(_0x276316){return _0x181704[_0x8ad6('0x63')](_[_0x8ad6('0x3d')](_0x53959c,'id'),{'transaction':_0x276316})[_0x8ad6('0x27')](function(){return BPromise[_0x8ad6('0x6c')](_0x32a9fc,function(_0x3fddc4){return db[_0x8ad6('0x57')][_0x8ad6('0x6d')]({'where':{'UserId':_0x3fddc4['id'],'OpenchannelQueueId':_0x168c07['params']['id']},'transaction':_0x276316});});})['then'](function(){_0x32a9fc[_0x8ad6('0x6e')](function(_0x46c83f){socket['emit'](_0x8ad6('0x6f'),{'UserId':_0x46c83f['id'],'OpenchannelQueueId':_0x181704['id']});});});});});}})[_0x8ad6('0x27')](respondWithStatusCode(_0x518c79,null))[_0x8ad6('0x46')](handleError(_0x518c79,null));};exports['removeTeams']=function(_0x3207d3,_0x152d85,_0x1bc7f0){return db[_0x8ad6('0x65')][_0x8ad6('0x44')]({'where':{'id':_0x3207d3[_0x8ad6('0x30')][_0x8ad6('0x70')]},'attributes':['id'],'include':[{'model':db[_0x8ad6('0x5a')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x152d85,null))[_0x8ad6('0x27')](function(_0x273eb7){var _0x435d85=_['map'](_0x273eb7,'id');var _0xc23e34=[];var _0x2c90c5=[];var _0x493d10=squel[_0x8ad6('0x71')]();_0x493d10['field'](_0x8ad6('0x72'))[_0x8ad6('0x73')](_0x8ad6('0x74'),'tq')[_0x8ad6('0x75')](_0x8ad6('0x76'),'ut',_0x8ad6('0x77'))['where']('OpenchannelQueueId\x20=\x20?',_0x3207d3[_0x8ad6('0x48')]['id']);for(var _0x32ac40=0x0;_0x32ac40<_0x273eb7[_0x8ad6('0x35')];_0x32ac40+=0x1){let _0x2e31ce=_0x273eb7[_0x32ac40];for(var _0x27207d=0x0;_0x27207d<_0x2e31ce['Agents']['length'];_0x27207d+=0x1){let _0x33e8b6=_0x2e31ce[_0x8ad6('0x66')][_0x27207d];var _0x5e5a9f=_0x493d10[_0x8ad6('0x78')]();_0x5e5a9f['where'](_0x8ad6('0x79'),_0x33e8b6['id']);_0x2c90c5[_0x8ad6('0x7a')](db[_0x8ad6('0x6a')]['query'](_0x5e5a9f[_0x8ad6('0x7b')](),{'type':db['sequelize'][_0x8ad6('0x7c')]['SELECT']})['then'](function(_0x29de49){if(_0x29de49[_0x8ad6('0x35')]===0x1){return _0x33e8b6['id'];}else{var _0x582bf3=_['every'](_[_0x8ad6('0x3d')](_0x29de49,'TeamId'),function(_0x3c2fa3){return _[_0x8ad6('0x7d')](_0x435d85,_0x3c2fa3);});if(_0x582bf3){return _0x33e8b6['id'];}}}));}}return BPromise[_0x8ad6('0x7e')](_0x2c90c5)[_0x8ad6('0x27')](function(_0x519609){_0xc23e34=_(_0xc23e34)[_0x8ad6('0x7f')](_0x519609)[_0x8ad6('0x80')]()[_0x8ad6('0x81')]();return db[_0x8ad6('0x41')][_0x8ad6('0x4b')]({'where':{'id':_0x3207d3[_0x8ad6('0x48')]['id']}})[_0x8ad6('0x27')](function(_0x4a5858){return db['sequelize']['transaction'](function(_0x1c75cb){return _0x4a5858[_0x8ad6('0x82')](_0x3207d3[_0x8ad6('0x30')]['ids'],{'transaction':_0x1c75cb})[_0x8ad6('0x27')](function(){if(!_['isEmpty'](_0xc23e34)){return _0x4a5858[_0x8ad6('0x83')](_0xc23e34,{'transaction':_0x1c75cb});}})[_0x8ad6('0x27')](function(){_0xc23e34[_0x8ad6('0x6e')](function(_0x2af758){socket[_0x8ad6('0x84')](_0x8ad6('0x85'),{'UserId':_0x2af758,'OpenchannelQueueId':_0x4a5858['id']});});});});});});})['then'](respondWithStatusCode(_0x152d85,null))[_0x8ad6('0x46')](handleError(_0x152d85,null));};exports[_0x8ad6('0x86')]=function(_0x43a5f8,_0xb4f303,_0x1da853){return db[_0x8ad6('0x41')][_0x8ad6('0x4b')]({'where':{'id':_0x43a5f8[_0x8ad6('0x48')]['id']}})[_0x8ad6('0x27')](handleEntityNotFound(_0xb4f303,null))[_0x8ad6('0x27')](function(_0x2d52c2){if(_0x2d52c2){return _0x2d52c2['addAgents'](_0x43a5f8['body'][_0x8ad6('0x70')],_['omit'](_0x43a5f8[_0x8ad6('0x4d')],[_0x8ad6('0x70'),'id'])||{})[_0x8ad6('0x87')](function(_0x52d516){for(var _0x14cbe4=0x0;_0x14cbe4<_0x43a5f8['body'][_0x8ad6('0x70')][_0x8ad6('0x35')];_0x14cbe4+=0x1){socket['emit'](_0x8ad6('0x6f'),{'UserId':_0x43a5f8[_0x8ad6('0x4d')][_0x8ad6('0x70')][_0x14cbe4],'OpenchannelQueueId':_0x43a5f8[_0x8ad6('0x48')]['id']});}return _0x52d516;});}})[_0x8ad6('0x27')](respondWithResult(_0xb4f303,null))[_0x8ad6('0x46')](handleError(_0xb4f303,null));};exports['removeAgents']=function(_0x2dd8f1,_0x4dcb14,_0x146056){return db['OpenchannelQueue'][_0x8ad6('0x4b')]({'where':{'id':_0x2dd8f1['params']['id']}})[_0x8ad6('0x27')](handleEntityNotFound(_0x4dcb14,null))['then'](function(_0x3ea80a){if(_0x3ea80a){return _0x3ea80a['removeAgents'](_0x2dd8f1[_0x8ad6('0x30')][_0x8ad6('0x70')])[_0x8ad6('0x27')](function(){if(_['isArray'](_0x2dd8f1[_0x8ad6('0x30')]['ids'])){for(var _0x4e2943=0x0;_0x4e2943<_0x2dd8f1[_0x8ad6('0x30')][_0x8ad6('0x70')][_0x8ad6('0x35')];_0x4e2943+=0x1){socket['emit'](_0x8ad6('0x85'),{'UserId':Number(_0x2dd8f1[_0x8ad6('0x30')][_0x8ad6('0x70')][_0x4e2943]),'OpenchannelQueueId':Number(_0x2dd8f1[_0x8ad6('0x48')]['id'])});}}else{socket[_0x8ad6('0x84')](_0x8ad6('0x85'),{'UserId':Number(_0x2dd8f1['query'][_0x8ad6('0x70')]),'OpenchannelQueueId':Number(_0x2dd8f1[_0x8ad6('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x4dcb14,null))['catch'](handleError(_0x4dcb14,null));};exports[_0x8ad6('0x88')]=function(_0x4836f2,_0x1d3f48,_0x1259d2){var _0x4a24cb={};var _0x1503c4={};var _0x21f828;var _0x2b73db;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x4836f2[_0x8ad6('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d3f48,null))[_0x8ad6('0x27')](function(_0x1478b4){if(_0x1478b4){_0x21f828=_0x1478b4;_0x1503c4['model']=_[_0x8ad6('0x2f')](db['User'][_0x8ad6('0x49')]);_0x1503c4[_0x8ad6('0x30')]=_['keys'](_0x4836f2[_0x8ad6('0x30')]);_0x1503c4[_0x8ad6('0x31')]=_[_0x8ad6('0x32')](_0x1503c4[_0x8ad6('0x33')],_0x1503c4['query']);_0x4a24cb[_0x8ad6('0x34')]=_[_0x8ad6('0x32')](_0x1503c4['model'],qs[_0x8ad6('0x4a')](_0x4836f2[_0x8ad6('0x30')][_0x8ad6('0x4a')]));_0x4a24cb[_0x8ad6('0x34')]=_0x4a24cb[_0x8ad6('0x34')]['length']?_0x4a24cb[_0x8ad6('0x34')]:_0x1503c4[_0x8ad6('0x33')];_0x4a24cb[_0x8ad6('0x38')]=qs['sort'](_0x4836f2[_0x8ad6('0x30')][_0x8ad6('0x39')]);_0x4a24cb['where']=qs[_0x8ad6('0x31')](_[_0x8ad6('0x58')](_0x4836f2[_0x8ad6('0x30')],_0x1503c4['filters']));if(_0x4836f2['query'][_0x8ad6('0x3b')]){_0x4a24cb['where']=_[_0x8ad6('0x3c')](_0x4a24cb[_0x8ad6('0x3a')],{'$or':_[_0x8ad6('0x3d')](_0x4a24cb[_0x8ad6('0x34')],function(_0x59e2ee){var _0x54ed19={};_0x54ed19[_0x59e2ee]={'$like':'%'+_0x4836f2[_0x8ad6('0x30')][_0x8ad6('0x3b')]+'%'};return _0x54ed19;})});}_0x4a24cb=_[_0x8ad6('0x3c')]({},_0x4a24cb,_0x4836f2[_0x8ad6('0x40')]);return _0x21f828[_0x8ad6('0x88')](_0x4a24cb);}})[_0x8ad6('0x27')](function(_0x2ae9b6){if(_0x2ae9b6){_0x2b73db=_0x2ae9b6[_0x8ad6('0x35')];if(!_0x4836f2['query']['hasOwnProperty'](_0x8ad6('0x37'))){_0x4a24cb[_0x8ad6('0x1f')]=qs[_0x8ad6('0x1f')](_0x4836f2[_0x8ad6('0x30')]['limit']);_0x4a24cb['offset']=qs[_0x8ad6('0x1e')](_0x4836f2[_0x8ad6('0x30')]['offset']);}return _0x21f828[_0x8ad6('0x88')](_0x4a24cb);}})[_0x8ad6('0x27')](function(_0xfbd120){if(_0xfbd120){return _0xfbd120?{'count':_0x2b73db,'rows':_0xfbd120}:null;}})[_0x8ad6('0x27')](respondWithResult(_0x1d3f48,null))[_0x8ad6('0x46')](handleError(_0x1d3f48,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index fbb453e..9899bba 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 _0xc9ae=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x28a184,_0x2524b3){var _0x157ee3=function(_0x167d3e){while(--_0x167d3e){_0x28a184['push'](_0x28a184['shift']());}};_0x157ee3(++_0x2524b3);}(_0xc9ae,0x180));var _0xec9a=function(_0x43f84c,_0x5d5ea6){_0x43f84c=_0x43f84c-0x0;var _0x3d5f09=_0xc9ae[_0x43f84c];return _0x3d5f09;};'use strict';var EventEmitter=require(_0xec9a('0x0'));var OpenchannelQueue=require(_0xec9a('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xec9a('0x2')](0x0);var events={'afterCreate':_0xec9a('0x3'),'afterUpdate':'update','afterDestroy':_0xec9a('0x4')};function emitEvent(_0x39581e){return function(_0x967dd5,_0x58330d,_0x5a116){OpenchannelQueueEvents[_0xec9a('0x5')](_0x39581e+':'+_0x967dd5['id'],_0x967dd5);OpenchannelQueueEvents[_0xec9a('0x5')](_0x39581e,_0x967dd5);_0x5a116(null);};}for(var e in events){if(events[_0xec9a('0x6')](e)){var event=events[e];OpenchannelQueue[_0xec9a('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x3838=['hasOwnProperty','exports','events','../../mysqldb','OpenchannelQueue','update','remove','emit'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0x3838,0xca));var _0x8383=function(_0x381bee,_0x4e5362){_0x381bee=_0x381bee-0x0;var _0x110335=_0x3838[_0x381bee];return _0x110335;};'use strict';var EventEmitter=require(_0x8383('0x0'));var OpenchannelQueue=require(_0x8383('0x1'))['db'][_0x8383('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8383('0x3'),'afterDestroy':_0x8383('0x4')};function emitEvent(_0x223353){return function(_0x3ff404,_0x41461a,_0x81e8f1){OpenchannelQueueEvents[_0x8383('0x5')](_0x223353+':'+_0x3ff404['id'],_0x3ff404);OpenchannelQueueEvents[_0x8383('0x5')](_0x223353,_0x3ff404);_0x81e8f1(null);};}for(var e in events){if(events[_0x8383('0x6')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x8383('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 6c739e0..4fba53b 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 _0x1d0c=['exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','bluebird','rimraf','./openchannelQueue.attributes'];(function(_0x52666e,_0x5b3776){var _0x515330=function(_0x29cd4f){while(--_0x29cd4f){_0x52666e['push'](_0x52666e['shift']());}};_0x515330(++_0x5b3776);}(_0x1d0c,0x138));var _0xc1d0=function(_0xeddb03,_0x595b01){_0xeddb03=_0xeddb03-0x0;var _0x1633ef=_0x1d0c[_0xeddb03];return _0x1633ef;};'use strict';var _=require(_0xc1d0('0x0'));var util=require(_0xc1d0('0x1'));var logger=require(_0xc1d0('0x2'))(_0xc1d0('0x3'));var moment=require('moment');var BPromise=require(_0xc1d0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc1d0('0x5'));var config=require('../../config/environment');var attributes=require(_0xc1d0('0x6'));module[_0xc1d0('0x7')]=function(_0x37d260,_0x2d63b7){return _0x37d260[_0xc1d0('0x8')](_0xc1d0('0x9'),attributes,{'tableName':_0xc1d0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7591=['OpenchannelQueue','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define'];(function(_0x2aa31a,_0x244f45){var _0x519a9d=function(_0x501550){while(--_0x501550){_0x2aa31a['push'](_0x2aa31a['shift']());}};_0x519a9d(++_0x244f45);}(_0x7591,0x105));var _0x1759=function(_0x39d442,_0x5d0160){_0x39d442=_0x39d442-0x0;var _0x25c993=_0x7591[_0x39d442];return _0x25c993;};'use strict';var _=require(_0x1759('0x0'));var util=require('util');var logger=require(_0x1759('0x1'))(_0x1759('0x2'));var moment=require(_0x1759('0x3'));var BPromise=require(_0x1759('0x4'));var rp=require(_0x1759('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1759('0x6'));var config=require(_0x1759('0x7'));var attributes=require('./openchannelQueue.attributes');module['exports']=function(_0x507284,_0x1a3718){return _0x507284[_0x1759('0x8')](_0x1759('0x9'),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 fcb5dac..079755a 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 _0x5c12=['raw','then','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','OpenchannelQueue,\x20%s,\x20%s','message','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','where','attributes','limit','include','map','model','stringify','ShowOpenchannelQueue'];(function(_0x47041d,_0x42153f){var _0x5022bd=function(_0x1dbb9a){while(--_0x1dbb9a){_0x47041d['push'](_0x47041d['shift']());}};_0x5022bd(++_0x42153f);}(_0x5c12,0x188));var _0x25c1=function(_0x562faf,_0x102bcc){_0x562faf=_0x562faf-0x0;var _0x22c1f6=_0x5c12[_0x562faf];return _0x22c1f6;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var moment=require(_0x25c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x25c1('0x2'));var fs=require('fs');var Redis=require(_0x25c1('0x3'));var db=require(_0x25c1('0x4'))['db'];var utils=require(_0x25c1('0x5'));var logger=require(_0x25c1('0x6'))(_0x25c1('0x7'));var config=require(_0x25c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x25c1('0x9')][_0x25c1('0xa')]({'port':0x232a});config[_0x25c1('0xb')]=_['defaults'](config['redis'],{'host':_0x25c1('0xc'),'port':0x18eb});var socket=require(_0x25c1('0xd'))(new Redis(config[_0x25c1('0xb')]));require(_0x25c1('0xe'))[_0x25c1('0xf')](socket);function respondWithRpcPromise(_0x588f30,_0x3e062e,_0x41c89d){return new BPromise(function(_0x11a223,_0x81f0f4){return client[_0x25c1('0x10')](_0x588f30,_0x41c89d)['then'](function(_0x196e2f){logger[_0x25c1('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x3e062e,_0x25c1('0x12'));logger[_0x25c1('0x13')](_0x25c1('0x14'),_0x3e062e,_0x25c1('0x12'),JSON['stringify'](_0x196e2f));if(_0x196e2f['error']){if(_0x196e2f['error']['code']===0x1f4){logger[_0x25c1('0x15')](_0x25c1('0x16'),_0x3e062e,_0x196e2f[_0x25c1('0x15')][_0x25c1('0x17')]);return _0x81f0f4(_0x196e2f[_0x25c1('0x15')]['message']);}logger[_0x25c1('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x3e062e,_0x196e2f['error']['message']);return _0x11a223(_0x196e2f[_0x25c1('0x15')][_0x25c1('0x17')]);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x3e062e,_0x25c1('0x12'));_0x11a223(_0x196e2f['result'][_0x25c1('0x17')]);}})[_0x25c1('0x18')](function(_0x5c3c5d){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x3e062e,_0x5c3c5d);_0x81f0f4(_0x5c3c5d);});});}exports[_0x25c1('0x19')]=function(_0x3d3149){var _0x22a36e=this;return new Promise(function(_0x1bf95d,_0x481c12){return db[_0x25c1('0x1a')][_0x25c1('0x1b')]({'raw':_0x3d3149[_0x25c1('0x1c')]?_0x3d3149[_0x25c1('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3d3149['options']?_0x3d3149[_0x25c1('0x1c')][_0x25c1('0x1d')]||null:null,'attributes':_0x3d3149[_0x25c1('0x1c')]?_0x3d3149[_0x25c1('0x1c')][_0x25c1('0x1e')]||null:null,'limit':_0x3d3149[_0x25c1('0x1c')]?_0x3d3149[_0x25c1('0x1c')][_0x25c1('0x1f')]||null:null,'include':_0x3d3149[_0x25c1('0x1c')]?_0x3d3149[_0x25c1('0x1c')][_0x25c1('0x20')]?_[_0x25c1('0x21')](_0x3d3149[_0x25c1('0x1c')]['include'],function(_0x2dadae){return{'model':db[_0x2dadae[_0x25c1('0x22')]],'as':_0x2dadae['as'],'attributes':_0x2dadae[_0x25c1('0x1e')],'include':_0x2dadae[_0x25c1('0x20')]?_[_0x25c1('0x21')](_0x2dadae[_0x25c1('0x20')],function(_0x5ad776){return{'model':db[_0x5ad776[_0x25c1('0x22')]],'as':_0x5ad776['as'],'attributes':_0x5ad776[_0x25c1('0x1e')],'include':_0x5ad776[_0x25c1('0x20')]?_[_0x25c1('0x21')](_0x5ad776[_0x25c1('0x20')],function(_0x193a68){return{'model':db[_0x193a68['model']],'as':_0x193a68['as'],'attributes':_0x193a68[_0x25c1('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x76b360){logger[_0x25c1('0x11')](_0x25c1('0x19'),_0x3d3149);logger[_0x25c1('0x13')](_0x25c1('0x19'),_0x3d3149,JSON[_0x25c1('0x23')](_0x76b360));_0x1bf95d(_0x76b360);})[_0x25c1('0x18')](function(_0x23f2f6){logger[_0x25c1('0x15')]('GetOpenchannelQueue',_0x23f2f6[_0x25c1('0x17')],_0x3d3149);_0x481c12(_0x22a36e['error'](0x1f4,_0x23f2f6['message']));});});};exports[_0x25c1('0x24')]=function(_0x1dc3a7){var _0x4ef790=this;return new Promise(function(_0x173f3e,_0x5a5a32){return db[_0x25c1('0x1a')]['find']({'raw':_0x1dc3a7[_0x25c1('0x1c')]?_0x1dc3a7[_0x25c1('0x1c')][_0x25c1('0x25')]===undefined?!![]:![]:!![],'where':_0x1dc3a7[_0x25c1('0x1c')]?_0x1dc3a7[_0x25c1('0x1c')][_0x25c1('0x1d')]||null:null,'attributes':_0x1dc3a7[_0x25c1('0x1c')]?_0x1dc3a7[_0x25c1('0x1c')]['attributes']||null:null,'include':_0x1dc3a7[_0x25c1('0x1c')]?_0x1dc3a7['options'][_0x25c1('0x20')]?_['map'](_0x1dc3a7[_0x25c1('0x1c')][_0x25c1('0x20')],function(_0x18f10c){return{'model':db[_0x18f10c[_0x25c1('0x22')]],'as':_0x18f10c['as'],'attributes':_0x18f10c[_0x25c1('0x1e')],'include':_0x18f10c[_0x25c1('0x20')]?_[_0x25c1('0x21')](_0x18f10c[_0x25c1('0x20')],function(_0x3fced1){return{'model':db[_0x3fced1[_0x25c1('0x22')]],'as':_0x3fced1['as'],'attributes':_0x3fced1[_0x25c1('0x1e')],'include':_0x3fced1[_0x25c1('0x20')]?_[_0x25c1('0x21')](_0x3fced1[_0x25c1('0x20')],function(_0x266f3b){return{'model':db[_0x266f3b[_0x25c1('0x22')]],'as':_0x266f3b['as'],'attributes':_0x266f3b[_0x25c1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x25c1('0x26')](function(_0x12cdee){logger[_0x25c1('0x11')]('ShowOpenchannelQueue',_0x1dc3a7);logger[_0x25c1('0x13')](_0x25c1('0x24'),_0x1dc3a7,JSON['stringify'](_0x12cdee));_0x173f3e(_0x12cdee);})[_0x25c1('0x18')](function(_0x5eca99){logger[_0x25c1('0x15')]('ShowOpenchannelQueue',_0x5eca99[_0x25c1('0x17')],_0x1dc3a7);_0x5a5a32(_0x4ef790[_0x25c1('0x15')](0x1f4,_0x5eca99[_0x25c1('0x17')]));});});}; \ No newline at end of file +var _0x04d0=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','redis','defaults','localhost','./openchannelQueue.socket','register','then','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetOpenchannelQueue','find','ShowOpenchannelQueue'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x04d0,0x10a));var _0x004d=function(_0x1dbfaf,_0x264f1d){_0x1dbfaf=_0x1dbfaf-0x0;var _0x158c7d=_0x04d0[_0x1dbfaf];return _0x158c7d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x004d('0x0'));var BPromise=require(_0x004d('0x1'));var rs=require(_0x004d('0x2'));var fs=require('fs');var Redis=require(_0x004d('0x3'));var db=require(_0x004d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x004d('0x5'));var config=require('../../config/environment');var jayson=require(_0x004d('0x6'));var client=jayson[_0x004d('0x7')]['http']({'port':0x232a});config[_0x004d('0x8')]=_[_0x004d('0x9')](config['redis'],{'host':_0x004d('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x004d('0x8')]));require(_0x004d('0xb'))[_0x004d('0xc')](socket);function respondWithRpcPromise(_0x4c0b02,_0x230f6c,_0x21949b){return new BPromise(function(_0x582cc0,_0x3062b3){return client['request'](_0x4c0b02,_0x21949b)[_0x004d('0xd')](function(_0xd09c35){logger['info'](_0x004d('0xe'),_0x230f6c,'request\x20sent');logger[_0x004d('0xf')](_0x004d('0x10'),_0x230f6c,_0x004d('0x11'),JSON[_0x004d('0x12')](_0xd09c35));if(_0xd09c35[_0x004d('0x13')]){if(_0xd09c35[_0x004d('0x13')][_0x004d('0x14')]===0x1f4){logger[_0x004d('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x230f6c,_0xd09c35[_0x004d('0x13')][_0x004d('0x15')]);return _0x3062b3(_0xd09c35[_0x004d('0x13')][_0x004d('0x15')]);}logger[_0x004d('0x13')](_0x004d('0xe'),_0x230f6c,_0xd09c35[_0x004d('0x13')][_0x004d('0x15')]);return _0x582cc0(_0xd09c35['error'][_0x004d('0x15')]);}else{logger[_0x004d('0x16')](_0x004d('0xe'),_0x230f6c,'request\x20sent');_0x582cc0(_0xd09c35[_0x004d('0x17')]['message']);}})[_0x004d('0x18')](function(_0x3739ce){logger[_0x004d('0x13')](_0x004d('0xe'),_0x230f6c,_0x3739ce);_0x3062b3(_0x3739ce);});});}exports['GetOpenchannelQueue']=function(_0x1c184c){var _0x30aae7=this;return new Promise(function(_0x518ee8,_0x31ac5c){return db[_0x004d('0x19')][_0x004d('0x1a')]({'raw':_0x1c184c[_0x004d('0x1b')]?_0x1c184c['options'][_0x004d('0x1c')]===undefined?!![]:![]:!![],'where':_0x1c184c[_0x004d('0x1b')]?_0x1c184c[_0x004d('0x1b')][_0x004d('0x1d')]||null:null,'attributes':_0x1c184c[_0x004d('0x1b')]?_0x1c184c[_0x004d('0x1b')][_0x004d('0x1e')]||null:null,'limit':_0x1c184c[_0x004d('0x1b')]?_0x1c184c[_0x004d('0x1b')][_0x004d('0x1f')]||null:null,'include':_0x1c184c[_0x004d('0x1b')]?_0x1c184c[_0x004d('0x1b')]['include']?_['map'](_0x1c184c[_0x004d('0x1b')][_0x004d('0x20')],function(_0x4a4fe1){return{'model':db[_0x4a4fe1[_0x004d('0x21')]],'as':_0x4a4fe1['as'],'attributes':_0x4a4fe1[_0x004d('0x1e')],'include':_0x4a4fe1[_0x004d('0x20')]?_[_0x004d('0x22')](_0x4a4fe1[_0x004d('0x20')],function(_0x1ccb0e){return{'model':db[_0x1ccb0e[_0x004d('0x21')]],'as':_0x1ccb0e['as'],'attributes':_0x1ccb0e['attributes'],'include':_0x1ccb0e[_0x004d('0x20')]?_['map'](_0x1ccb0e['include'],function(_0x2e7763){return{'model':db[_0x2e7763[_0x004d('0x21')]],'as':_0x2e7763['as'],'attributes':_0x2e7763[_0x004d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x004d('0xd')](function(_0x58015b){logger[_0x004d('0x16')](_0x004d('0x23'),_0x1c184c);logger[_0x004d('0xf')](_0x004d('0x23'),_0x1c184c,JSON[_0x004d('0x12')](_0x58015b));_0x518ee8(_0x58015b);})[_0x004d('0x18')](function(_0x56fa5b){logger[_0x004d('0x13')](_0x004d('0x23'),_0x56fa5b[_0x004d('0x15')],_0x1c184c);_0x31ac5c(_0x30aae7[_0x004d('0x13')](0x1f4,_0x56fa5b['message']));});});};exports['ShowOpenchannelQueue']=function(_0x457385){var _0x4d06d8=this;return new Promise(function(_0x3aa5f3,_0xdfd119){return db[_0x004d('0x19')][_0x004d('0x24')]({'raw':_0x457385[_0x004d('0x1b')]?_0x457385[_0x004d('0x1b')][_0x004d('0x1c')]===undefined?!![]:![]:!![],'where':_0x457385[_0x004d('0x1b')]?_0x457385[_0x004d('0x1b')][_0x004d('0x1d')]||null:null,'attributes':_0x457385['options']?_0x457385[_0x004d('0x1b')][_0x004d('0x1e')]||null:null,'include':_0x457385[_0x004d('0x1b')]?_0x457385[_0x004d('0x1b')]['include']?_[_0x004d('0x22')](_0x457385[_0x004d('0x1b')]['include'],function(_0x2a96e6){return{'model':db[_0x2a96e6[_0x004d('0x21')]],'as':_0x2a96e6['as'],'attributes':_0x2a96e6[_0x004d('0x1e')],'include':_0x2a96e6[_0x004d('0x20')]?_[_0x004d('0x22')](_0x2a96e6['include'],function(_0x2ef5cf){return{'model':db[_0x2ef5cf[_0x004d('0x21')]],'as':_0x2ef5cf['as'],'attributes':_0x2ef5cf[_0x004d('0x1e')],'include':_0x2ef5cf[_0x004d('0x20')]?_[_0x004d('0x22')](_0x2ef5cf[_0x004d('0x20')],function(_0x28bb5f){return{'model':db[_0x28bb5f[_0x004d('0x21')]],'as':_0x28bb5f['as'],'attributes':_0x28bb5f['attributes']};}):[]};}):[]};}):[]:[]})[_0x004d('0xd')](function(_0x5b7746){logger[_0x004d('0x16')](_0x004d('0x25'),_0x457385);logger[_0x004d('0xf')]('ShowOpenchannelQueue',_0x457385,JSON[_0x004d('0x12')](_0x5b7746));_0x3aa5f3(_0x5b7746);})[_0x004d('0x18')](function(_0x15782b){logger['error'](_0x004d('0x25'),_0x15782b['message'],_0x457385);_0xdfd119(_0x4d06d8[_0x004d('0x13')](0x1f4,_0x15782b[_0x004d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 8aa0f56..38c2c83 100644 --- a/server/api/openchannelQueue/openchannelQueue.socket.js +++ b/server/api/openchannelQueue/openchannelQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var OpenchannelQueueEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){OpenchannelQueueEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var OpenchannelQueueEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){OpenchannelQueueEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 3b36241..96d908d 100644 --- a/server/api/openchannelQueueReport/index.js +++ b/server/api/openchannelQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0xed5f9c,_0x5a25cd){var _0x3a1c43=function(_0x251202){while(--_0x251202){_0xed5f9c['push'](_0xed5f9c['shift']());}};_0x3a1c43(++_0x5a25cd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 _0xb10b=['../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0xf0c02d,_0x409c69){var _0x124e61=function(_0x3e8f69){while(--_0x3e8f69){_0xf0c02d['push'](_0xf0c02d['shift']());}};_0x124e61(++_0x409c69);}(_0xb10b,0x12a));var _0xbb10=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0xb10b[_0x166742];return _0xb7814a;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0xe')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router['put']('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router[_0xbb10('0x11')]('/:id',auth[_0xbb10('0x9')](),controller['destroy']);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 3b4f5e7..858e4b0 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 _0xbdf8=['sequelize','STRING','DATE'];(function(_0x2d8fb9,_0x197fad){var _0x53cb5f=function(_0xb478d4){while(--_0xb478d4){_0x2d8fb9['push'](_0x2d8fb9['shift']());}};_0x53cb5f(++_0x197fad);}(_0xbdf8,0x1e3));var _0x8bdf=function(_0x98cb08,_0x3212b4){_0x98cb08=_0x98cb08-0x0;var _0x23473c=_0xbdf8[_0x98cb08];return _0x23473c;};'use strict';var moment=require('moment');var Sequelize=require(_0x8bdf('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x8bdf('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x8bdf('0x2')]},'leaveAt':{'type':Sequelize[_0x8bdf('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x8bdf('0x2')]},'reason':{'type':Sequelize[_0x8bdf('0x1')]}}; \ No newline at end of file +var _0xb7d7=['exports','STRING','DATE'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xb7d7,0x132));var _0x7b7d=function(_0x292b9a,_0x359768){_0x292b9a=_0x292b9a-0x0;var _0x20c325=_0xb7d7[_0x292b9a];return _0x20c325;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x7b7d('0x0')]={'uniqueid':{'type':Sequelize[_0x7b7d('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x7b7d('0x1')]},'joinAt':{'type':Sequelize[_0x7b7d('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x7b7d('0x2')]},'exitAt':{'type':Sequelize[_0x7b7d('0x2')]},'reason':{'type':Sequelize[_0x7b7d('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 43199dc..bbd1324 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 _0x18f4=['stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','include','OpenchannelQueueReport','findAll','show','params','includeAll','catch','create','body','find','describe','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error'];(function(_0x45aea9,_0x3ccc21){var _0x50f3e5=function(_0x383421){while(--_0x383421){_0x45aea9['push'](_0x45aea9['shift']());}};_0x50f3e5(++_0x3ccc21);}(_0x18f4,0x70));var _0x418f=function(_0x8a5093,_0xcc50b0){_0x8a5093=_0x8a5093-0x0;var _0x307bb0=_0x18f4[_0x8a5093];return _0x307bb0;};'use strict';var pdf=require(_0x418f('0x0'));var emlformat=require(_0x418f('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x418f('0x2'));var rp=require(_0x418f('0x3'));var moment=require('moment');var BPromise=require(_0x418f('0x4'));var Mustache=require(_0x418f('0x5'));var util=require('util');var path=require('path');var sox=require(_0x418f('0x6'));var csv=require(_0x418f('0x7'));var ejs=require(_0x418f('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x418f('0x9'));var jsforce=require(_0x418f('0xa'));var deskjs=require(_0x418f('0xb'));var toCsv=require(_0x418f('0x7'));var querystring=require('querystring');var Papa=require(_0x418f('0xc'));var Redis=require('ioredis');var authService=require(_0x418f('0xd'));var qs=require(_0x418f('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x418f('0xf'))(_0x418f('0x10'));var utils=require(_0x418f('0x11'));var config=require('../../config/environment');var db=require(_0x418f('0x12'))['db'];function respondWithStatusCode(_0x2a9dd5,_0x410864){_0x410864=_0x410864||0xcc;return function(_0x2fdfda){if(_0x2fdfda){return _0x2a9dd5[_0x418f('0x13')](_0x410864);}return _0x2a9dd5[_0x418f('0x14')](_0x410864)[_0x418f('0x15')]();};}function respondWithResult(_0x421a07,_0x1249d3){_0x1249d3=_0x1249d3||0xc8;return function(_0x223f0c){if(_0x223f0c){return _0x421a07[_0x418f('0x14')](_0x1249d3)[_0x418f('0x16')](_0x223f0c);}};}function respondWithFilteredResult(_0x5822cc,_0x564743){return function(_0x904b5d){if(_0x904b5d){var _0x5d6fb2=_0x904b5d['count'],_0x2fd0e5=_0x564743[_0x418f('0x17')],_0xb3ad8=_0x564743[_0x418f('0x17')]+_0x564743[_0x418f('0x18')],_0x4e34fb;if(_0xb3ad8>=_0x5d6fb2){_0xb3ad8=_0x5d6fb2;_0x4e34fb=0xc8;}else{_0x4e34fb=0xce;}_0x5822cc['status'](_0x4e34fb);return _0x5822cc[_0x418f('0x19')](_0x418f('0x1a'),_0x2fd0e5+'-'+_0xb3ad8+'/'+_0x5d6fb2)[_0x418f('0x16')](_0x904b5d);}return null;};}function patchUpdates(_0x342767){return function(_0x27dd10){try{jsonpatch[_0x418f('0x1b')](_0x27dd10,_0x342767,!![]);}catch(_0x14f67b){return BPromise[_0x418f('0x1c')](_0x14f67b);}return _0x27dd10[_0x418f('0x1d')]();};}function saveUpdates(_0x267eb6,_0x3c3227){return function(_0x2f971f){if(_0x2f971f){return _0x2f971f[_0x418f('0x1e')](_0x267eb6)[_0x418f('0x1f')](function(_0x117774){return _0x117774;});}return null;};}function removeEntity(_0x2766ca,_0x3bc1e4){return function(_0x2f3216){if(_0x2f3216){return _0x2f3216[_0x418f('0x20')]()[_0x418f('0x1f')](function(){_0x2766ca[_0x418f('0x14')](0xcc)[_0x418f('0x15')]();});}};}function handleEntityNotFound(_0xf1bba7,_0x3cba81){return function(_0x30342e){if(!_0x30342e){_0xf1bba7[_0x418f('0x13')](0x194);}return _0x30342e;};}function handleError(_0x367597,_0x52a9f3){_0x52a9f3=_0x52a9f3||0x1f4;return function(_0x1d578d){logger[_0x418f('0x21')](_0x1d578d[_0x418f('0x22')]);if(_0x1d578d[_0x418f('0x23')]){delete _0x1d578d[_0x418f('0x23')];}_0x367597[_0x418f('0x14')](_0x52a9f3)[_0x418f('0x24')](_0x1d578d);};}exports[_0x418f('0x25')]=function(_0x3a07ac,_0x1f9b1c){var _0x2a09be={},_0x5392df={},_0x3048ac={'count':0x0,'rows':[]};var _0x2e8d95=db['OpenchannelQueueReport'][_0x418f('0x26')];_0x5392df[_0x418f('0x27')]=_[_0x418f('0x28')](_0x2e8d95);_0x5392df[_0x418f('0x29')]=_['keys'](_0x3a07ac[_0x418f('0x29')]);_0x5392df[_0x418f('0x2a')]=_[_0x418f('0x2b')](_0x5392df['model'],_0x5392df['query']);_0x2a09be['attributes']=_[_0x418f('0x2b')](_0x5392df['model'],qs[_0x418f('0x2c')](_0x3a07ac['query'][_0x418f('0x2c')]));_0x2a09be[_0x418f('0x2d')]=_0x2a09be['attributes'][_0x418f('0x2e')]?_0x2a09be[_0x418f('0x2d')]:_0x5392df[_0x418f('0x27')];if(!_0x3a07ac[_0x418f('0x29')][_0x418f('0x2f')](_0x418f('0x30'))){_0x2a09be[_0x418f('0x18')]=qs[_0x418f('0x18')](_0x3a07ac['query'][_0x418f('0x18')]);_0x2a09be[_0x418f('0x17')]=qs[_0x418f('0x17')](_0x3a07ac[_0x418f('0x29')]['offset']);}_0x2a09be[_0x418f('0x31')]=qs[_0x418f('0x32')](_0x3a07ac[_0x418f('0x29')][_0x418f('0x32')]);_0x2a09be[_0x418f('0x33')]=qs[_0x418f('0x2a')](_[_0x418f('0x34')](_0x3a07ac[_0x418f('0x29')],_0x5392df[_0x418f('0x2a')]));if(_0x3a07ac[_0x418f('0x29')][_0x418f('0x35')]){_0x2a09be[_0x418f('0x33')]=_[_0x418f('0x36')](_0x2a09be[_0x418f('0x33')],{'$or':_[_0x418f('0x37')](_0x2e8d95,function(_0x366cf6){if(_0x366cf6[_0x418f('0x38')][_0x418f('0x39')]!==_0x418f('0x3a')){var _0x297d5a={};_0x297d5a[_0x366cf6[_0x418f('0x3b')]]={'$like':'%'+_0x3a07ac[_0x418f('0x29')][_0x418f('0x35')]+'%'};return _0x297d5a;}})});}_0x2a09be=_['merge']({},_0x2a09be,_0x3a07ac[_0x418f('0x3c')]);var _0x3ffbb9={'where':_0x2a09be[_0x418f('0x33')]};return db['OpenchannelQueueReport']['count'](_0x3ffbb9)[_0x418f('0x1f')](function(_0x257277){_0x3048ac[_0x418f('0x3d')]=_0x257277;if(_0x3a07ac['query']['includeAll']){_0x2a09be[_0x418f('0x3e')]=[{'all':!![]}];}return db[_0x418f('0x3f')][_0x418f('0x40')](_0x2a09be);})[_0x418f('0x1f')](function(_0x3fa527){_0x3048ac['rows']=_0x3fa527;return _0x3048ac;})[_0x418f('0x1f')](respondWithFilteredResult(_0x1f9b1c,_0x2a09be))['catch'](handleError(_0x1f9b1c,null));};exports[_0x418f('0x41')]=function(_0x566e81,_0x220323){var _0x258984={'raw':!![],'where':{'id':_0x566e81[_0x418f('0x42')]['id']}},_0x5b3656={};_0x5b3656['model']=_[_0x418f('0x28')](db['OpenchannelQueueReport']['rawAttributes']);_0x5b3656['query']=_[_0x418f('0x28')](_0x566e81['query']);_0x5b3656[_0x418f('0x2a')]=_[_0x418f('0x2b')](_0x5b3656[_0x418f('0x27')],_0x5b3656[_0x418f('0x29')]);_0x258984[_0x418f('0x2d')]=_[_0x418f('0x2b')](_0x5b3656[_0x418f('0x27')],qs[_0x418f('0x2c')](_0x566e81[_0x418f('0x29')]['fields']));_0x258984[_0x418f('0x2d')]=_0x258984[_0x418f('0x2d')][_0x418f('0x2e')]?_0x258984[_0x418f('0x2d')]:_0x5b3656[_0x418f('0x27')];if(_0x566e81[_0x418f('0x29')][_0x418f('0x43')]){_0x258984[_0x418f('0x3e')]=[{'all':!![]}];}_0x258984=_[_0x418f('0x36')]({},_0x258984,_0x566e81[_0x418f('0x3c')]);return db['OpenchannelQueueReport']['find'](_0x258984)['then'](handleEntityNotFound(_0x220323,null))[_0x418f('0x1f')](respondWithResult(_0x220323,null))[_0x418f('0x44')](handleError(_0x220323,null));};exports[_0x418f('0x45')]=function(_0x253508,_0x510aed){return db[_0x418f('0x3f')][_0x418f('0x45')](_0x253508[_0x418f('0x46')],{})[_0x418f('0x1f')](respondWithResult(_0x510aed,0xc9))[_0x418f('0x44')](handleError(_0x510aed,null));};exports[_0x418f('0x1e')]=function(_0x47c83d,_0x3c4022){if(_0x47c83d[_0x418f('0x46')]['id']){delete _0x47c83d[_0x418f('0x46')]['id'];}return db[_0x418f('0x3f')][_0x418f('0x47')]({'where':{'id':_0x47c83d[_0x418f('0x42')]['id']}})[_0x418f('0x1f')](handleEntityNotFound(_0x3c4022,null))[_0x418f('0x1f')](saveUpdates(_0x47c83d[_0x418f('0x46')],null))['then'](respondWithResult(_0x3c4022,null))[_0x418f('0x44')](handleError(_0x3c4022,null));};exports[_0x418f('0x20')]=function(_0x53738b,_0x255f30){return db[_0x418f('0x3f')][_0x418f('0x47')]({'where':{'id':_0x53738b[_0x418f('0x42')]['id']}})[_0x418f('0x1f')](handleEntityNotFound(_0x255f30,null))[_0x418f('0x1f')](removeEntity(_0x255f30,null))['catch'](handleError(_0x255f30,null));};exports[_0x418f('0x48')]=function(_0xf6ad2c,_0x21030b){return db[_0x418f('0x3f')][_0x418f('0x48')]()[_0x418f('0x1f')](respondWithResult(_0x21030b,null))[_0x418f('0x44')](handleError(_0x21030b,null));}; \ No newline at end of file +var _0xe034=['keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','OpenchannelQueueReport','include','findAll','rows','catch','show','params','find','create','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','rawAttributes','model'];(function(_0x54f915,_0x1cfef0){var _0x3a40d5=function(_0x414c5a){while(--_0x414c5a){_0x54f915['push'](_0x54f915['shift']());}};_0x3a40d5(++_0x1cfef0);}(_0xe034,0xa9));var _0x4e03=function(_0x519cbc,_0x59a8e9){_0x519cbc=_0x519cbc-0x0;var _0x2bdca5=_0xe034[_0x519cbc];return _0x2bdca5;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x4e03('0x0'));var zipdir=require(_0x4e03('0x1'));var jsonpatch=require(_0x4e03('0x2'));var rp=require(_0x4e03('0x3'));var moment=require(_0x4e03('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4e03('0x5'));var util=require(_0x4e03('0x6'));var path=require(_0x4e03('0x7'));var sox=require(_0x4e03('0x8'));var csv=require(_0x4e03('0x9'));var ejs=require(_0x4e03('0xa'));var fs=require('fs');var _=require(_0x4e03('0xb'));var squel=require(_0x4e03('0xc'));var crypto=require(_0x4e03('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4e03('0x9'));var querystring=require(_0x4e03('0xe'));var Papa=require(_0x4e03('0xf'));var Redis=require(_0x4e03('0x10'));var authService=require(_0x4e03('0x11'));var qs=require(_0x4e03('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4e03('0x13'))('api');var utils=require(_0x4e03('0x14'));var config=require('../../config/environment');var db=require(_0x4e03('0x15'))['db'];function respondWithStatusCode(_0x8ef4eb,_0x103cdd){_0x103cdd=_0x103cdd||0xcc;return function(_0x7efe5){if(_0x7efe5){return _0x8ef4eb['sendStatus'](_0x103cdd);}return _0x8ef4eb[_0x4e03('0x16')](_0x103cdd)['end']();};}function respondWithResult(_0x321464,_0x474c98){_0x474c98=_0x474c98||0xc8;return function(_0x462b59){if(_0x462b59){return _0x321464['status'](_0x474c98)[_0x4e03('0x17')](_0x462b59);}};}function respondWithFilteredResult(_0x96b69a,_0x2e1925){return function(_0x4c76db){if(_0x4c76db){var _0x24db8a=_0x4c76db[_0x4e03('0x18')],_0x3a46e2=_0x2e1925[_0x4e03('0x19')],_0x2b0d20=_0x2e1925[_0x4e03('0x19')]+_0x2e1925[_0x4e03('0x1a')],_0x3a0d1e;if(_0x2b0d20>=_0x24db8a){_0x2b0d20=_0x24db8a;_0x3a0d1e=0xc8;}else{_0x3a0d1e=0xce;}_0x96b69a['status'](_0x3a0d1e);return _0x96b69a['set'](_0x4e03('0x1b'),_0x3a46e2+'-'+_0x2b0d20+'/'+_0x24db8a)[_0x4e03('0x17')](_0x4c76db);}return null;};}function patchUpdates(_0x5b3f4b){return function(_0x382bef){try{jsonpatch[_0x4e03('0x1c')](_0x382bef,_0x5b3f4b,!![]);}catch(_0x345e39){return BPromise[_0x4e03('0x1d')](_0x345e39);}return _0x382bef[_0x4e03('0x1e')]();};}function saveUpdates(_0x434f73,_0x36bf23){return function(_0xf9898f){if(_0xf9898f){return _0xf9898f[_0x4e03('0x1f')](_0x434f73)[_0x4e03('0x20')](function(_0x40cd28){return _0x40cd28;});}return null;};}function removeEntity(_0x55dc1b,_0x47bf91){return function(_0x573bfe){if(_0x573bfe){return _0x573bfe[_0x4e03('0x21')]()['then'](function(){_0x55dc1b[_0x4e03('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4849c4,_0x118e6f){return function(_0xe40bf){if(!_0xe40bf){_0x4849c4[_0x4e03('0x22')](0x194);}return _0xe40bf;};}function handleError(_0x53a501,_0x16fae2){_0x16fae2=_0x16fae2||0x1f4;return function(_0x30ab8c){logger[_0x4e03('0x23')](_0x30ab8c[_0x4e03('0x24')]);if(_0x30ab8c[_0x4e03('0x25')]){delete _0x30ab8c[_0x4e03('0x25')];}_0x53a501[_0x4e03('0x16')](_0x16fae2)[_0x4e03('0x26')](_0x30ab8c);};}exports['index']=function(_0x302a25,_0x253cca){var _0x33ab05={},_0x564796={},_0x210d97={'count':0x0,'rows':[]};var _0x259790=db['OpenchannelQueueReport'][_0x4e03('0x27')];_0x564796[_0x4e03('0x28')]=_[_0x4e03('0x29')](_0x259790);_0x564796['query']=_[_0x4e03('0x29')](_0x302a25[_0x4e03('0x2a')]);_0x564796[_0x4e03('0x2b')]=_[_0x4e03('0x2c')](_0x564796[_0x4e03('0x28')],_0x564796[_0x4e03('0x2a')]);_0x33ab05[_0x4e03('0x2d')]=_['intersection'](_0x564796[_0x4e03('0x28')],qs[_0x4e03('0x2e')](_0x302a25[_0x4e03('0x2a')]['fields']));_0x33ab05['attributes']=_0x33ab05['attributes'][_0x4e03('0x2f')]?_0x33ab05[_0x4e03('0x2d')]:_0x564796[_0x4e03('0x28')];if(!_0x302a25[_0x4e03('0x2a')][_0x4e03('0x30')]('nolimit')){_0x33ab05[_0x4e03('0x1a')]=qs[_0x4e03('0x1a')](_0x302a25[_0x4e03('0x2a')]['limit']);_0x33ab05[_0x4e03('0x19')]=qs[_0x4e03('0x19')](_0x302a25[_0x4e03('0x2a')][_0x4e03('0x19')]);}_0x33ab05[_0x4e03('0x31')]=qs[_0x4e03('0x32')](_0x302a25[_0x4e03('0x2a')][_0x4e03('0x32')]);_0x33ab05[_0x4e03('0x33')]=qs[_0x4e03('0x2b')](_[_0x4e03('0x34')](_0x302a25[_0x4e03('0x2a')],_0x564796[_0x4e03('0x2b')]));if(_0x302a25[_0x4e03('0x2a')][_0x4e03('0x35')]){_0x33ab05[_0x4e03('0x33')]=_[_0x4e03('0x36')](_0x33ab05[_0x4e03('0x33')],{'$or':_[_0x4e03('0x37')](_0x259790,function(_0x388bb1){if(_0x388bb1[_0x4e03('0x38')]['key']!==_0x4e03('0x39')){var _0x36306e={};_0x36306e[_0x388bb1[_0x4e03('0x3a')]]={'$like':'%'+_0x302a25[_0x4e03('0x2a')]['filter']+'%'};return _0x36306e;}})});}_0x33ab05=_[_0x4e03('0x36')]({},_0x33ab05,_0x302a25[_0x4e03('0x3b')]);var _0x585b03={'where':_0x33ab05['where']};return db[_0x4e03('0x3c')]['count'](_0x585b03)['then'](function(_0x15a043){_0x210d97[_0x4e03('0x18')]=_0x15a043;if(_0x302a25[_0x4e03('0x2a')]['includeAll']){_0x33ab05[_0x4e03('0x3d')]=[{'all':!![]}];}return db[_0x4e03('0x3c')][_0x4e03('0x3e')](_0x33ab05);})[_0x4e03('0x20')](function(_0x77f78a){_0x210d97[_0x4e03('0x3f')]=_0x77f78a;return _0x210d97;})[_0x4e03('0x20')](respondWithFilteredResult(_0x253cca,_0x33ab05))[_0x4e03('0x40')](handleError(_0x253cca,null));};exports[_0x4e03('0x41')]=function(_0x3b0cc6,_0x951b54){var _0x4517d5={'raw':!![],'where':{'id':_0x3b0cc6[_0x4e03('0x42')]['id']}},_0x59c116={};_0x59c116[_0x4e03('0x28')]=_[_0x4e03('0x29')](db['OpenchannelQueueReport'][_0x4e03('0x27')]);_0x59c116[_0x4e03('0x2a')]=_[_0x4e03('0x29')](_0x3b0cc6[_0x4e03('0x2a')]);_0x59c116['filters']=_['intersection'](_0x59c116[_0x4e03('0x28')],_0x59c116[_0x4e03('0x2a')]);_0x4517d5[_0x4e03('0x2d')]=_[_0x4e03('0x2c')](_0x59c116[_0x4e03('0x28')],qs[_0x4e03('0x2e')](_0x3b0cc6[_0x4e03('0x2a')]['fields']));_0x4517d5[_0x4e03('0x2d')]=_0x4517d5[_0x4e03('0x2d')]['length']?_0x4517d5[_0x4e03('0x2d')]:_0x59c116[_0x4e03('0x28')];if(_0x3b0cc6['query']['includeAll']){_0x4517d5[_0x4e03('0x3d')]=[{'all':!![]}];}_0x4517d5=_[_0x4e03('0x36')]({},_0x4517d5,_0x3b0cc6['options']);return db[_0x4e03('0x3c')][_0x4e03('0x43')](_0x4517d5)[_0x4e03('0x20')](handleEntityNotFound(_0x951b54,null))[_0x4e03('0x20')](respondWithResult(_0x951b54,null))[_0x4e03('0x40')](handleError(_0x951b54,null));};exports[_0x4e03('0x44')]=function(_0xe00588,_0x28ec1b){return db[_0x4e03('0x3c')]['create'](_0xe00588['body'],{})[_0x4e03('0x20')](respondWithResult(_0x28ec1b,0xc9))[_0x4e03('0x40')](handleError(_0x28ec1b,null));};exports[_0x4e03('0x1f')]=function(_0x1cacb1,_0x63bb){if(_0x1cacb1['body']['id']){delete _0x1cacb1['body']['id'];}return db[_0x4e03('0x3c')]['find']({'where':{'id':_0x1cacb1[_0x4e03('0x42')]['id']}})[_0x4e03('0x20')](handleEntityNotFound(_0x63bb,null))[_0x4e03('0x20')](saveUpdates(_0x1cacb1['body'],null))[_0x4e03('0x20')](respondWithResult(_0x63bb,null))[_0x4e03('0x40')](handleError(_0x63bb,null));};exports[_0x4e03('0x21')]=function(_0x2e6aad,_0x25b59c){return db[_0x4e03('0x3c')][_0x4e03('0x43')]({'where':{'id':_0x2e6aad['params']['id']}})[_0x4e03('0x20')](handleEntityNotFound(_0x25b59c,null))[_0x4e03('0x20')](removeEntity(_0x25b59c,null))['catch'](handleError(_0x25b59c,null));};exports[_0x4e03('0x45')]=function(_0x24cdee,_0x4cf0c9){return db['OpenchannelQueueReport']['describe']()[_0x4e03('0x20')](respondWithResult(_0x4cf0c9,null))[_0x4e03('0x40')](handleError(_0x4cf0c9,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 4a88530..44b8f4b 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 _0x1cc7=['path','rimraf','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','request-promise'];(function(_0x9309,_0xbfb791){var _0x3940d5=function(_0x237faa){while(--_0x237faa){_0x9309['push'](_0x9309['shift']());}};_0x3940d5(++_0xbfb791);}(_0x1cc7,0x15a));var _0x71cc=function(_0x8f3f,_0x1698bc){_0x8f3f=_0x8f3f-0x0;var _0x5c058f=_0x1cc7[_0x8f3f];return _0x5c058f;};'use strict';var _=require(_0x71cc('0x0'));var util=require(_0x71cc('0x1'));var logger=require(_0x71cc('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x71cc('0x3'));var fs=require('fs');var path=require(_0x71cc('0x4'));var rimraf=require(_0x71cc('0x5'));var config=require('../../config/environment');var attributes=require('./openchannelQueueReport.attributes');module['exports']=function(_0x27a175,_0x4ecf81){return _0x27a175[_0x71cc('0x6')](_0x71cc('0x7'),attributes,{'tableName':_0x71cc('0x8'),'paranoid':![],'indexes':[{'name':_0x71cc('0x9'),'fields':[_0x71cc('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7bae=['OpenchannelQueueReport','report_openchannel_queue','uniqueid','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define'];(function(_0x54efdb,_0x149d69){var _0x2661ab=function(_0x54dfba){while(--_0x54dfba){_0x54efdb['push'](_0x54efdb['shift']());}};_0x2661ab(++_0x149d69);}(_0x7bae,0x13b));var _0xe7ba=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x7bae[_0x13b02f];return _0x12e9a6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7ba('0x0'))(_0xe7ba('0x1'));var moment=require('moment');var BPromise=require(_0xe7ba('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe7ba('0x3'));var rimraf=require(_0xe7ba('0x4'));var config=require(_0xe7ba('0x5'));var attributes=require(_0xe7ba('0x6'));module[_0xe7ba('0x7')]=function(_0xfd3a22,_0x2d31df){return _0xfd3a22[_0xe7ba('0x8')](_0xe7ba('0x9'),attributes,{'tableName':_0xe7ba('0xa'),'paranoid':![],'indexes':[{'name':_0xe7ba('0xb'),'fields':[_0xe7ba('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 5b83fff..746d17d 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 _0x8b18=['OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelQueueReport','create','body','options','CreateOpenchannelQueueReport','raw','where','attributes','limit','UpdateOpenchannelQueueReport','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5e2751,_0x518a55){var _0x139a39=function(_0x4802db){while(--_0x4802db){_0x5e2751['push'](_0x5e2751['shift']());}};_0x139a39(++_0x518a55);}(_0x8b18,0x191));var _0x88b1=function(_0x3f5087,_0x2c6e2a){_0x3f5087=_0x3f5087-0x0;var _0x5185f5=_0x8b18[_0x3f5087];return _0x5185f5;};'use strict';var _=require(_0x88b1('0x0'));var util=require(_0x88b1('0x1'));var moment=require(_0x88b1('0x2'));var BPromise=require(_0x88b1('0x3'));var rs=require(_0x88b1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x88b1('0x5'));var logger=require(_0x88b1('0x6'))('rpc');var config=require(_0x88b1('0x7'));var jayson=require(_0x88b1('0x8'));var client=jayson['client'][_0x88b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e7bd8,_0xe385ea,_0x2e1c72){return new BPromise(function(_0x53a501,_0x134851){return client['request'](_0x2e7bd8,_0x2e1c72)[_0x88b1('0xa')](function(_0x3ac606){logger[_0x88b1('0xb')](_0x88b1('0xc'),_0xe385ea,_0x88b1('0xd'));logger[_0x88b1('0xe')](_0x88b1('0xf'),_0xe385ea,_0x88b1('0xd'),JSON[_0x88b1('0x10')](_0x3ac606));if(_0x3ac606[_0x88b1('0x11')]){if(_0x3ac606[_0x88b1('0x11')][_0x88b1('0x12')]===0x1f4){logger[_0x88b1('0x11')](_0x88b1('0xc'),_0xe385ea,_0x3ac606[_0x88b1('0x11')]['message']);return _0x134851(_0x3ac606[_0x88b1('0x11')][_0x88b1('0x13')]);}logger[_0x88b1('0x11')](_0x88b1('0xc'),_0xe385ea,_0x3ac606[_0x88b1('0x11')][_0x88b1('0x13')]);return _0x53a501(_0x3ac606[_0x88b1('0x11')][_0x88b1('0x13')]);}else{logger[_0x88b1('0xb')](_0x88b1('0xc'),_0xe385ea,'request\x20sent');_0x53a501(_0x3ac606[_0x88b1('0x14')][_0x88b1('0x13')]);}})[_0x88b1('0x15')](function(_0x35ffab){logger[_0x88b1('0x11')](_0x88b1('0xc'),_0xe385ea,_0x35ffab);_0x134851(_0x35ffab);});});}exports['CreateOpenchannelQueueReport']=function(_0x5067d1){var _0x3d5dbd=this;return new Promise(function(_0x5588ae,_0x21d13a){return db[_0x88b1('0x16')][_0x88b1('0x17')](_0x5067d1[_0x88b1('0x18')],{'raw':_0x5067d1[_0x88b1('0x19')]?_0x5067d1[_0x88b1('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4a7151){logger[_0x88b1('0xb')](_0x88b1('0x1a'),_0x5067d1);logger[_0x88b1('0xe')](_0x88b1('0x1a'),_0x5067d1,JSON[_0x88b1('0x10')](_0x4a7151));_0x5588ae(_0x4a7151);})[_0x88b1('0x15')](function(_0x26291b){logger[_0x88b1('0x11')]('CreateOpenchannelQueueReport',_0x26291b[_0x88b1('0x13')],_0x5067d1);_0x21d13a(_0x3d5dbd['error'](0x1f4,_0x26291b[_0x88b1('0x13')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x24e3c7){var _0x3d6d1f=this;return new Promise(function(_0x96d9cf,_0x200a6f){return db['OpenchannelQueueReport']['update'](_0x24e3c7[_0x88b1('0x18')],{'raw':_0x24e3c7[_0x88b1('0x19')]?_0x24e3c7['options'][_0x88b1('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24e3c7['options']?_0x24e3c7[_0x88b1('0x19')][_0x88b1('0x1c')]||null:null,'attributes':_0x24e3c7[_0x88b1('0x19')]?_0x24e3c7[_0x88b1('0x19')][_0x88b1('0x1d')]||null:null,'limit':_0x24e3c7['options']?_0x24e3c7[_0x88b1('0x19')][_0x88b1('0x1e')]||null:null})[_0x88b1('0xa')](function(_0x1795f2){logger[_0x88b1('0xb')](_0x88b1('0x1f'),_0x24e3c7);logger[_0x88b1('0xe')]('UpdateOpenchannelQueueReport',_0x24e3c7,JSON[_0x88b1('0x10')](_0x1795f2));_0x96d9cf(_0x1795f2);})[_0x88b1('0x15')](function(_0x10719b){logger[_0x88b1('0x11')](_0x88b1('0x1f'),_0x10719b['message'],_0x24e3c7);_0x200a6f(_0x3d6d1f['error'](0x1f4,_0x10719b[_0x88b1('0x13')]));});});}; \ No newline at end of file +var _0xc5a5=['OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x1c7369,_0x514bcc){var _0x178ac5=function(_0x177e9c){while(--_0x177e9c){_0x1c7369['push'](_0x1c7369['shift']());}};_0x178ac5(++_0x514bcc);}(_0xc5a5,0x1c5));var _0x5c5a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc5a5[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5c5a('0x0'));var util=require('util');var moment=require(_0x5c5a('0x1'));var BPromise=require(_0x5c5a('0x2'));var rs=require(_0x5c5a('0x3'));var fs=require('fs');var Redis=require(_0x5c5a('0x4'));var db=require(_0x5c5a('0x5'))['db'];var utils=require(_0x5c5a('0x6'));var logger=require(_0x5c5a('0x7'))(_0x5c5a('0x8'));var config=require('../../config/environment');var jayson=require(_0x5c5a('0x9'));var client=jayson[_0x5c5a('0xa')][_0x5c5a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c8c91,_0x28f61a,_0x3c7c15){return new BPromise(function(_0x3668cf,_0x38731){return client[_0x5c5a('0xc')](_0x3c8c91,_0x3c7c15)[_0x5c5a('0xd')](function(_0x31a00a){logger[_0x5c5a('0xe')](_0x5c5a('0xf'),_0x28f61a,_0x5c5a('0x10'));logger[_0x5c5a('0x11')](_0x5c5a('0x12'),_0x28f61a,'request\x20sent',JSON[_0x5c5a('0x13')](_0x31a00a));if(_0x31a00a[_0x5c5a('0x14')]){if(_0x31a00a[_0x5c5a('0x14')][_0x5c5a('0x15')]===0x1f4){logger[_0x5c5a('0x14')](_0x5c5a('0xf'),_0x28f61a,_0x31a00a[_0x5c5a('0x14')][_0x5c5a('0x16')]);return _0x38731(_0x31a00a[_0x5c5a('0x14')][_0x5c5a('0x16')]);}logger[_0x5c5a('0x14')](_0x5c5a('0xf'),_0x28f61a,_0x31a00a['error']['message']);return _0x3668cf(_0x31a00a[_0x5c5a('0x14')][_0x5c5a('0x16')]);}else{logger[_0x5c5a('0xe')](_0x5c5a('0xf'),_0x28f61a,_0x5c5a('0x10'));_0x3668cf(_0x31a00a[_0x5c5a('0x17')][_0x5c5a('0x16')]);}})[_0x5c5a('0x18')](function(_0x3cc95f){logger[_0x5c5a('0x14')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x28f61a,_0x3cc95f);_0x38731(_0x3cc95f);});});}exports[_0x5c5a('0x19')]=function(_0x42e168){var _0x2337ec=this;return new Promise(function(_0x197974,_0x2121e1){return db[_0x5c5a('0x1a')][_0x5c5a('0x1b')](_0x42e168[_0x5c5a('0x1c')],{'raw':_0x42e168[_0x5c5a('0x1d')]?_0x42e168[_0x5c5a('0x1d')][_0x5c5a('0x1e')]===undefined?!![]:![]:!![]})[_0x5c5a('0xd')](function(_0x5352bc){logger[_0x5c5a('0xe')](_0x5c5a('0x19'),_0x42e168);logger[_0x5c5a('0x11')]('CreateOpenchannelQueueReport',_0x42e168,JSON['stringify'](_0x5352bc));_0x197974(_0x5352bc);})['catch'](function(_0x184724){logger['error'](_0x5c5a('0x19'),_0x184724[_0x5c5a('0x16')],_0x42e168);_0x2121e1(_0x2337ec[_0x5c5a('0x14')](0x1f4,_0x184724[_0x5c5a('0x16')]));});});};exports[_0x5c5a('0x1f')]=function(_0x18c125){var _0x3a653f=this;return new Promise(function(_0x3d9ccd,_0x401e42){return db['OpenchannelQueueReport'][_0x5c5a('0x20')](_0x18c125[_0x5c5a('0x1c')],{'raw':_0x18c125[_0x5c5a('0x1d')]?_0x18c125[_0x5c5a('0x1d')][_0x5c5a('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18c125[_0x5c5a('0x1d')]?_0x18c125['options'][_0x5c5a('0x21')]||null:null,'attributes':_0x18c125[_0x5c5a('0x1d')]?_0x18c125[_0x5c5a('0x1d')][_0x5c5a('0x22')]||null:null,'limit':_0x18c125['options']?_0x18c125[_0x5c5a('0x1d')][_0x5c5a('0x23')]||null:null})[_0x5c5a('0xd')](function(_0xc6da27){logger[_0x5c5a('0xe')](_0x5c5a('0x1f'),_0x18c125);logger[_0x5c5a('0x11')](_0x5c5a('0x1f'),_0x18c125,JSON[_0x5c5a('0x13')](_0xc6da27));_0x3d9ccd(_0xc6da27);})['catch'](function(_0x5aec7c){logger[_0x5c5a('0x14')]('UpdateOpenchannelQueueReport',_0x5aec7c[_0x5c5a('0x16')],_0x18c125);_0x401e42(_0x3a653f['error'](0x1f4,_0x5aec7c[_0x5c5a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 75ba1bd..14ff85d 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 _0x4316=['../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','index','get','/describe','isAuthenticated','/:id','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x15f603,_0x19466a){var _0x26fd2e=function(_0x57f840){while(--_0x57f840){_0x15f603['push'](_0x15f603['shift']());}};_0x26fd2e(++_0x19466a);}(_0x4316,0x1ee));var _0x6431=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4316[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x6431('0x0'));var util=require(_0x6431('0x1'));var path=require(_0x6431('0x2'));var timeout=require(_0x6431('0x3'));var express=require(_0x6431('0x4'));var router=express[_0x6431('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x6431('0x6'));var config=require(_0x6431('0x7'));var controller=require(_0x6431('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6431('0x9')]);router[_0x6431('0xa')](_0x6431('0xb'),auth[_0x6431('0xc')](),controller['describe']);router[_0x6431('0xa')](_0x6431('0xd'),auth[_0x6431('0xc')](),controller['show']);router[_0x6431('0xe')]('/',auth[_0x6431('0xc')](),controller[_0x6431('0xf')]);router['put'](_0x6431('0xd'),auth[_0x6431('0xc')](),controller[_0x6431('0x10')]);router[_0x6431('0x11')](_0x6431('0xd'),auth[_0x6431('0xc')](),controller[_0x6431('0x12')]);module[_0x6431('0x13')]=router; \ No newline at end of file +var _0x822f=['./openchannelTransferReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x376eb7,_0x1a6cf2){var _0x4f2c80=function(_0x476c09){while(--_0x476c09){_0x376eb7['push'](_0x376eb7['shift']());}};_0x4f2c80(++_0x1a6cf2);}(_0x822f,0x150));var _0xf822=function(_0x209787,_0x58616a){_0x209787=_0x209787-0x0;var _0x26d73e=_0x822f[_0x209787];return _0x26d73e;};'use strict';var multer=require(_0xf822('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf822('0x1'));var express=require(_0xf822('0x2'));var router=express[_0xf822('0x3')]();var auth=require(_0xf822('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf822('0x5'));var controller=require(_0xf822('0x6'));router[_0xf822('0x7')]('/',auth[_0xf822('0x8')](),controller['index']);router['get']('/describe',auth[_0xf822('0x8')](),controller[_0xf822('0x9')]);router['get'](_0xf822('0xa'),auth[_0xf822('0x8')](),controller[_0xf822('0xb')]);router[_0xf822('0xc')]('/',auth[_0xf822('0x8')](),controller[_0xf822('0xd')]);router[_0xf822('0xe')](_0xf822('0xa'),auth['isAuthenticated'](),controller[_0xf822('0xf')]);router['delete'](_0xf822('0xa'),auth['isAuthenticated'](),controller[_0xf822('0x10')]);module[_0xf822('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index addb771..963aa40 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 _0x4efe=['moment','STRING','ENUM','agent','queue','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4efe,0x180));var _0xe4ef=function(_0x552fce,_0x3f24bc){_0x552fce=_0x552fce-0x0;var _0x3e27a2=_0x4efe[_0x552fce];return _0x3e27a2;};'use strict';var moment=require(_0xe4ef('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xe4ef('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe4ef('0x2')]('account',_0xe4ef('0x3'),_0xe4ef('0x4')),'allowNull':![],'defaultValue':_0xe4ef('0x4')},'transferredAt':{'type':Sequelize[_0xe4ef('0x5')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x3995=['queue','NOW','moment','ENUM','account','agent'];(function(_0x5d1c77,_0x1d7366){var _0x3581ee=function(_0x4180d5){while(--_0x4180d5){_0x5d1c77['push'](_0x5d1c77['shift']());}};_0x3581ee(++_0x1d7366);}(_0x3995,0x158));var _0x5399=function(_0x8a0140,_0x4a1b16){_0x8a0140=_0x8a0140-0x0;var _0x1be8a8=_0x3995[_0x8a0140];return _0x1be8a8;};'use strict';var moment=require(_0x5399('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x5399('0x1')](_0x5399('0x2'),_0x5399('0x3'),'queue'),'allowNull':![],'defaultValue':_0x5399('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x5399('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index b4ba8d4..0d0a0fe 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 _0xaf1d=['set','Content-Range','apply','reject','save','update','then','error','stack','name','OpenchannelTransferReport','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','type','key','field','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','api','../../config/utils','../../config/environment','sendStatus','end','json','count','offset','status'];(function(_0x155e04,_0x28cd61){var _0x4590d0=function(_0x3f685b){while(--_0x3f685b){_0x155e04['push'](_0x155e04['shift']());}};_0x4590d0(++_0x28cd61);}(_0xaf1d,0x1cf));var _0xdaf1=function(_0x13a4dd,_0x30d7e6){_0x13a4dd=_0x13a4dd-0x0;var _0x3e0c89=_0xaf1d[_0x13a4dd];return _0x3e0c89;};'use strict';var pdf=require(_0xdaf1('0x0'));var emlformat=require(_0xdaf1('0x1'));var rimraf=require(_0xdaf1('0x2'));var zipdir=require(_0xdaf1('0x3'));var jsonpatch=require(_0xdaf1('0x4'));var rp=require(_0xdaf1('0x5'));var moment=require(_0xdaf1('0x6'));var BPromise=require(_0xdaf1('0x7'));var Mustache=require(_0xdaf1('0x8'));var util=require(_0xdaf1('0x9'));var path=require('path');var sox=require(_0xdaf1('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xdaf1('0xb'));var squel=require(_0xdaf1('0xc'));var crypto=require(_0xdaf1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdaf1('0xe'));var toCsv=require(_0xdaf1('0xf'));var querystring=require('querystring');var Papa=require(_0xdaf1('0x10'));var Redis=require('ioredis');var authService=require(_0xdaf1('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdaf1('0x12'));var utils=require(_0xdaf1('0x13'));var config=require(_0xdaf1('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1edcf7,_0x26c2c2){_0x26c2c2=_0x26c2c2||0xcc;return function(_0x438fdd){if(_0x438fdd){return _0x1edcf7[_0xdaf1('0x15')](_0x26c2c2);}return _0x1edcf7['status'](_0x26c2c2)[_0xdaf1('0x16')]();};}function respondWithResult(_0x43db26,_0x295e17){_0x295e17=_0x295e17||0xc8;return function(_0x717989){if(_0x717989){return _0x43db26['status'](_0x295e17)[_0xdaf1('0x17')](_0x717989);}};}function respondWithFilteredResult(_0x190dcd,_0x1019aa){return function(_0x496322){if(_0x496322){var _0x56fb5f=_0x496322[_0xdaf1('0x18')],_0xee159f=_0x1019aa[_0xdaf1('0x19')],_0xccf126=_0x1019aa[_0xdaf1('0x19')]+_0x1019aa['limit'],_0x223bdd;if(_0xccf126>=_0x56fb5f){_0xccf126=_0x56fb5f;_0x223bdd=0xc8;}else{_0x223bdd=0xce;}_0x190dcd[_0xdaf1('0x1a')](_0x223bdd);return _0x190dcd[_0xdaf1('0x1b')](_0xdaf1('0x1c'),_0xee159f+'-'+_0xccf126+'/'+_0x56fb5f)[_0xdaf1('0x17')](_0x496322);}return null;};}function patchUpdates(_0x108bb2){return function(_0x16b5e5){try{jsonpatch[_0xdaf1('0x1d')](_0x16b5e5,_0x108bb2,!![]);}catch(_0x547c2e){return BPromise[_0xdaf1('0x1e')](_0x547c2e);}return _0x16b5e5[_0xdaf1('0x1f')]();};}function saveUpdates(_0x5742b6,_0x10e818){return function(_0x510e0a){if(_0x510e0a){return _0x510e0a[_0xdaf1('0x20')](_0x5742b6)[_0xdaf1('0x21')](function(_0x3771c0){return _0x3771c0;});}return null;};}function removeEntity(_0x3aa5a5,_0x5176b9){return function(_0x80b581){if(_0x80b581){return _0x80b581['destroy']()[_0xdaf1('0x21')](function(){_0x3aa5a5[_0xdaf1('0x1a')](0xcc)[_0xdaf1('0x16')]();});}};}function handleEntityNotFound(_0x4a219a,_0x420c67){return function(_0x523b2b){if(!_0x523b2b){_0x4a219a['sendStatus'](0x194);}return _0x523b2b;};}function handleError(_0x490e2a,_0x23f9c3){_0x23f9c3=_0x23f9c3||0x1f4;return function(_0x271137){logger[_0xdaf1('0x22')](_0x271137[_0xdaf1('0x23')]);if(_0x271137[_0xdaf1('0x24')]){delete _0x271137[_0xdaf1('0x24')];}_0x490e2a[_0xdaf1('0x1a')](_0x23f9c3)['send'](_0x271137);};}exports['index']=function(_0x374ad6,_0x28128d){var _0x3c85ea={},_0xc62299={},_0x55bdbd={'count':0x0,'rows':[]};var _0x49af94=db[_0xdaf1('0x25')]['rawAttributes'];_0xc62299[_0xdaf1('0x26')]=_[_0xdaf1('0x27')](_0x49af94);_0xc62299[_0xdaf1('0x28')]=_[_0xdaf1('0x27')](_0x374ad6[_0xdaf1('0x28')]);_0xc62299['filters']=_['intersection'](_0xc62299[_0xdaf1('0x26')],_0xc62299[_0xdaf1('0x28')]);_0x3c85ea[_0xdaf1('0x29')]=_[_0xdaf1('0x2a')](_0xc62299[_0xdaf1('0x26')],qs[_0xdaf1('0x2b')](_0x374ad6['query']['fields']));_0x3c85ea[_0xdaf1('0x29')]=_0x3c85ea[_0xdaf1('0x29')]['length']?_0x3c85ea[_0xdaf1('0x29')]:_0xc62299[_0xdaf1('0x26')];if(!_0x374ad6[_0xdaf1('0x28')][_0xdaf1('0x2c')](_0xdaf1('0x2d'))){_0x3c85ea[_0xdaf1('0x2e')]=qs[_0xdaf1('0x2e')](_0x374ad6[_0xdaf1('0x28')]['limit']);_0x3c85ea[_0xdaf1('0x19')]=qs['offset'](_0x374ad6[_0xdaf1('0x28')][_0xdaf1('0x19')]);}_0x3c85ea[_0xdaf1('0x2f')]=qs[_0xdaf1('0x30')](_0x374ad6[_0xdaf1('0x28')][_0xdaf1('0x30')]);_0x3c85ea[_0xdaf1('0x31')]=qs[_0xdaf1('0x32')](_[_0xdaf1('0x33')](_0x374ad6[_0xdaf1('0x28')],_0xc62299[_0xdaf1('0x32')]));if(_0x374ad6[_0xdaf1('0x28')]['filter']){_0x3c85ea[_0xdaf1('0x31')]=_['merge'](_0x3c85ea[_0xdaf1('0x31')],{'$or':_['map'](_0x49af94,function(_0x425b75){if(_0x425b75[_0xdaf1('0x34')][_0xdaf1('0x35')]!=='VIRTUAL'){var _0x5b94ea={};_0x5b94ea[_0x425b75[_0xdaf1('0x36')]]={'$like':'%'+_0x374ad6[_0xdaf1('0x28')][_0xdaf1('0x37')]+'%'};return _0x5b94ea;}})});}_0x3c85ea=_[_0xdaf1('0x38')]({},_0x3c85ea,_0x374ad6[_0xdaf1('0x39')]);var _0x1a4657={'where':_0x3c85ea['where']};return db['OpenchannelTransferReport'][_0xdaf1('0x18')](_0x1a4657)[_0xdaf1('0x21')](function(_0x61b5b6){_0x55bdbd[_0xdaf1('0x18')]=_0x61b5b6;if(_0x374ad6['query'][_0xdaf1('0x3a')]){_0x3c85ea[_0xdaf1('0x3b')]=[{'all':!![]}];}return db[_0xdaf1('0x25')][_0xdaf1('0x3c')](_0x3c85ea);})[_0xdaf1('0x21')](function(_0x4ffaa6){_0x55bdbd[_0xdaf1('0x3d')]=_0x4ffaa6;return _0x55bdbd;})[_0xdaf1('0x21')](respondWithFilteredResult(_0x28128d,_0x3c85ea))[_0xdaf1('0x3e')](handleError(_0x28128d,null));};exports[_0xdaf1('0x3f')]=function(_0x38e203,_0x153f54){var _0x2f0296={'raw':!![],'where':{'id':_0x38e203[_0xdaf1('0x40')]['id']}},_0xe2f1e2={};_0xe2f1e2[_0xdaf1('0x26')]=_['keys'](db[_0xdaf1('0x25')]['rawAttributes']);_0xe2f1e2[_0xdaf1('0x28')]=_['keys'](_0x38e203['query']);_0xe2f1e2[_0xdaf1('0x32')]=_[_0xdaf1('0x2a')](_0xe2f1e2[_0xdaf1('0x26')],_0xe2f1e2[_0xdaf1('0x28')]);_0x2f0296['attributes']=_[_0xdaf1('0x2a')](_0xe2f1e2['model'],qs[_0xdaf1('0x2b')](_0x38e203['query'][_0xdaf1('0x2b')]));_0x2f0296[_0xdaf1('0x29')]=_0x2f0296[_0xdaf1('0x29')][_0xdaf1('0x41')]?_0x2f0296[_0xdaf1('0x29')]:_0xe2f1e2[_0xdaf1('0x26')];if(_0x38e203[_0xdaf1('0x28')][_0xdaf1('0x3a')]){_0x2f0296[_0xdaf1('0x3b')]=[{'all':!![]}];}_0x2f0296=_['merge']({},_0x2f0296,_0x38e203[_0xdaf1('0x39')]);return db[_0xdaf1('0x25')][_0xdaf1('0x42')](_0x2f0296)['then'](handleEntityNotFound(_0x153f54,null))['then'](respondWithResult(_0x153f54,null))[_0xdaf1('0x3e')](handleError(_0x153f54,null));};exports[_0xdaf1('0x43')]=function(_0x3472e8,_0x5d1e0e){return db[_0xdaf1('0x25')]['create'](_0x3472e8[_0xdaf1('0x44')],{})[_0xdaf1('0x21')](respondWithResult(_0x5d1e0e,0xc9))[_0xdaf1('0x3e')](handleError(_0x5d1e0e,null));};exports[_0xdaf1('0x20')]=function(_0x249d71,_0x3c8719){if(_0x249d71[_0xdaf1('0x44')]['id']){delete _0x249d71[_0xdaf1('0x44')]['id'];}return db[_0xdaf1('0x25')][_0xdaf1('0x42')]({'where':{'id':_0x249d71[_0xdaf1('0x40')]['id']}})[_0xdaf1('0x21')](handleEntityNotFound(_0x3c8719,null))[_0xdaf1('0x21')](saveUpdates(_0x249d71['body'],null))[_0xdaf1('0x21')](respondWithResult(_0x3c8719,null))[_0xdaf1('0x3e')](handleError(_0x3c8719,null));};exports['destroy']=function(_0x8934aa,_0x2510a5){return db[_0xdaf1('0x25')]['find']({'where':{'id':_0x8934aa[_0xdaf1('0x40')]['id']}})['then'](handleEntityNotFound(_0x2510a5,null))[_0xdaf1('0x21')](removeEntity(_0x2510a5,null))[_0xdaf1('0x3e')](handleError(_0x2510a5,null));};exports[_0xdaf1('0x45')]=function(_0x5e99d0,_0x5998bc){return db[_0xdaf1('0x25')][_0xdaf1('0x45')]()[_0xdaf1('0x21')](respondWithResult(_0x5998bc,null))[_0xdaf1('0x3e')](handleError(_0x5998bc,null));}; \ No newline at end of file +var _0x2356=['create','body','update','describe','eml-format','rimraf','moment','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','then','destroy','error','stack','index','OpenchannelTransferReport','rawAttributes','model','keys','query','filters','attributes','fields','length','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','intersection','include','find'];(function(_0x40ba3e,_0x3230db){var _0x13f246=function(_0x9c63a6){while(--_0x9c63a6){_0x40ba3e['push'](_0x40ba3e['shift']());}};_0x13f246(++_0x3230db);}(_0x2356,0x196));var _0x6235=function(_0x4fca8e,_0x4c2162){_0x4fca8e=_0x4fca8e-0x0;var _0x23f51d=_0x2356[_0x4fca8e];return _0x23f51d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6235('0x0'));var rimraf=require(_0x6235('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6235('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6235('0x3'));var path=require(_0x6235('0x4'));var sox=require('sox');var csv=require(_0x6235('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6235('0x6'));var squel=require(_0x6235('0x7'));var crypto=require(_0x6235('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x6235('0x9'));var toCsv=require(_0x6235('0x5'));var querystring=require(_0x6235('0xa'));var Papa=require('papaparse');var Redis=require(_0x6235('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x6235('0xc'));var hardwareService=require(_0x6235('0xd'));var logger=require(_0x6235('0xe'))(_0x6235('0xf'));var utils=require(_0x6235('0x10'));var config=require(_0x6235('0x11'));var db=require(_0x6235('0x12'))['db'];function respondWithStatusCode(_0x1fec2b,_0x22e6a9){_0x22e6a9=_0x22e6a9||0xcc;return function(_0x23b769){if(_0x23b769){return _0x1fec2b[_0x6235('0x13')](_0x22e6a9);}return _0x1fec2b[_0x6235('0x14')](_0x22e6a9)[_0x6235('0x15')]();};}function respondWithResult(_0x2456d5,_0x56496b){_0x56496b=_0x56496b||0xc8;return function(_0x55f713){if(_0x55f713){return _0x2456d5[_0x6235('0x14')](_0x56496b)['json'](_0x55f713);}};}function respondWithFilteredResult(_0xd48807,_0x126029){return function(_0x11d721){if(_0x11d721){var _0x49d154=_0x11d721[_0x6235('0x16')],_0xcefcb3=_0x126029[_0x6235('0x17')],_0x55312d=_0x126029[_0x6235('0x17')]+_0x126029[_0x6235('0x18')],_0x5b27f4;if(_0x55312d>=_0x49d154){_0x55312d=_0x49d154;_0x5b27f4=0xc8;}else{_0x5b27f4=0xce;}_0xd48807[_0x6235('0x14')](_0x5b27f4);return _0xd48807[_0x6235('0x19')](_0x6235('0x1a'),_0xcefcb3+'-'+_0x55312d+'/'+_0x49d154)[_0x6235('0x1b')](_0x11d721);}return null;};}function patchUpdates(_0x3b0002){return function(_0x401d79){try{jsonpatch[_0x6235('0x1c')](_0x401d79,_0x3b0002,!![]);}catch(_0x458d11){return BPromise[_0x6235('0x1d')](_0x458d11);}return _0x401d79['save']();};}function saveUpdates(_0x19bdeb,_0x17d078){return function(_0x2f8a7c){if(_0x2f8a7c){return _0x2f8a7c['update'](_0x19bdeb)[_0x6235('0x1e')](function(_0x106364){return _0x106364;});}return null;};}function removeEntity(_0x24eb46,_0x26b5a8){return function(_0x57d181){if(_0x57d181){return _0x57d181[_0x6235('0x1f')]()[_0x6235('0x1e')](function(){_0x24eb46[_0x6235('0x14')](0xcc)[_0x6235('0x15')]();});}};}function handleEntityNotFound(_0x164612,_0x43e965){return function(_0x34dee5){if(!_0x34dee5){_0x164612[_0x6235('0x13')](0x194);}return _0x34dee5;};}function handleError(_0x576292,_0x837a0){_0x837a0=_0x837a0||0x1f4;return function(_0x5091c9){logger[_0x6235('0x20')](_0x5091c9[_0x6235('0x21')]);if(_0x5091c9['name']){delete _0x5091c9['name'];}_0x576292[_0x6235('0x14')](_0x837a0)['send'](_0x5091c9);};}exports[_0x6235('0x22')]=function(_0x53bc8a,_0x1ebbe5){var _0x515c14={},_0x1feb95={},_0x441e5b={'count':0x0,'rows':[]};var _0x1986e4=db[_0x6235('0x23')][_0x6235('0x24')];_0x1feb95[_0x6235('0x25')]=_[_0x6235('0x26')](_0x1986e4);_0x1feb95['query']=_[_0x6235('0x26')](_0x53bc8a[_0x6235('0x27')]);_0x1feb95[_0x6235('0x28')]=_['intersection'](_0x1feb95[_0x6235('0x25')],_0x1feb95[_0x6235('0x27')]);_0x515c14[_0x6235('0x29')]=_['intersection'](_0x1feb95['model'],qs[_0x6235('0x2a')](_0x53bc8a[_0x6235('0x27')][_0x6235('0x2a')]));_0x515c14[_0x6235('0x29')]=_0x515c14[_0x6235('0x29')][_0x6235('0x2b')]?_0x515c14['attributes']:_0x1feb95['model'];if(!_0x53bc8a['query']['hasOwnProperty']('nolimit')){_0x515c14[_0x6235('0x18')]=qs['limit'](_0x53bc8a['query'][_0x6235('0x18')]);_0x515c14[_0x6235('0x17')]=qs['offset'](_0x53bc8a['query'][_0x6235('0x17')]);}_0x515c14[_0x6235('0x2c')]=qs[_0x6235('0x2d')](_0x53bc8a['query'][_0x6235('0x2d')]);_0x515c14[_0x6235('0x2e')]=qs[_0x6235('0x28')](_[_0x6235('0x2f')](_0x53bc8a[_0x6235('0x27')],_0x1feb95['filters']));if(_0x53bc8a[_0x6235('0x27')][_0x6235('0x30')]){_0x515c14['where']=_[_0x6235('0x31')](_0x515c14[_0x6235('0x2e')],{'$or':_['map'](_0x1986e4,function(_0x21f95e){if(_0x21f95e[_0x6235('0x32')][_0x6235('0x33')]!==_0x6235('0x34')){var _0x1c403d={};_0x1c403d[_0x21f95e['field']]={'$like':'%'+_0x53bc8a['query'][_0x6235('0x30')]+'%'};return _0x1c403d;}})});}_0x515c14=_[_0x6235('0x31')]({},_0x515c14,_0x53bc8a[_0x6235('0x35')]);var _0x305ba2={'where':_0x515c14['where']};return db[_0x6235('0x23')][_0x6235('0x16')](_0x305ba2)['then'](function(_0xc47ed4){_0x441e5b[_0x6235('0x16')]=_0xc47ed4;if(_0x53bc8a[_0x6235('0x27')][_0x6235('0x36')]){_0x515c14['include']=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x6235('0x37')](_0x515c14);})[_0x6235('0x1e')](function(_0xe7e865){_0x441e5b[_0x6235('0x38')]=_0xe7e865;return _0x441e5b;})[_0x6235('0x1e')](respondWithFilteredResult(_0x1ebbe5,_0x515c14))[_0x6235('0x39')](handleError(_0x1ebbe5,null));};exports[_0x6235('0x3a')]=function(_0x3e43ac,_0x115b39){var _0x11b7a9={'raw':!![],'where':{'id':_0x3e43ac[_0x6235('0x3b')]['id']}},_0x5c9922={};_0x5c9922[_0x6235('0x25')]=_[_0x6235('0x26')](db['OpenchannelTransferReport'][_0x6235('0x24')]);_0x5c9922[_0x6235('0x27')]=_[_0x6235('0x26')](_0x3e43ac['query']);_0x5c9922[_0x6235('0x28')]=_[_0x6235('0x3c')](_0x5c9922['model'],_0x5c9922[_0x6235('0x27')]);_0x11b7a9[_0x6235('0x29')]=_[_0x6235('0x3c')](_0x5c9922['model'],qs[_0x6235('0x2a')](_0x3e43ac[_0x6235('0x27')][_0x6235('0x2a')]));_0x11b7a9[_0x6235('0x29')]=_0x11b7a9[_0x6235('0x29')][_0x6235('0x2b')]?_0x11b7a9[_0x6235('0x29')]:_0x5c9922[_0x6235('0x25')];if(_0x3e43ac['query'][_0x6235('0x36')]){_0x11b7a9[_0x6235('0x3d')]=[{'all':!![]}];}_0x11b7a9=_[_0x6235('0x31')]({},_0x11b7a9,_0x3e43ac[_0x6235('0x35')]);return db[_0x6235('0x23')][_0x6235('0x3e')](_0x11b7a9)['then'](handleEntityNotFound(_0x115b39,null))[_0x6235('0x1e')](respondWithResult(_0x115b39,null))[_0x6235('0x39')](handleError(_0x115b39,null));};exports[_0x6235('0x3f')]=function(_0x2e8202,_0x277235){return db['OpenchannelTransferReport'][_0x6235('0x3f')](_0x2e8202[_0x6235('0x40')],{})[_0x6235('0x1e')](respondWithResult(_0x277235,0xc9))['catch'](handleError(_0x277235,null));};exports[_0x6235('0x41')]=function(_0x441696,_0x3c3591){if(_0x441696[_0x6235('0x40')]['id']){delete _0x441696[_0x6235('0x40')]['id'];}return db['OpenchannelTransferReport'][_0x6235('0x3e')]({'where':{'id':_0x441696['params']['id']}})[_0x6235('0x1e')](handleEntityNotFound(_0x3c3591,null))['then'](saveUpdates(_0x441696[_0x6235('0x40')],null))[_0x6235('0x1e')](respondWithResult(_0x3c3591,null))['catch'](handleError(_0x3c3591,null));};exports[_0x6235('0x1f')]=function(_0x2dd82e,_0x278d56){return db[_0x6235('0x23')][_0x6235('0x3e')]({'where':{'id':_0x2dd82e['params']['id']}})[_0x6235('0x1e')](handleEntityNotFound(_0x278d56,null))[_0x6235('0x1e')](removeEntity(_0x278d56,null))[_0x6235('0x39')](handleError(_0x278d56,null));};exports[_0x6235('0x42')]=function(_0x455cc3,_0x5f562a){return db[_0x6235('0x23')][_0x6235('0x42')]()['then'](respondWithResult(_0x5f562a,null))['catch'](handleError(_0x5f562a,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 6cb0572..9328c06 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 _0xaac0=['rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','uniqueid','util','api','moment','path'];(function(_0x14286a,_0x54bf72){var _0x26d207=function(_0x34d375){while(--_0x34d375){_0x14286a['push'](_0x14286a['shift']());}};_0x26d207(++_0x54bf72);}(_0xaac0,0xb7));var _0x0aac=function(_0x5b2414,_0x16d22f){_0x5b2414=_0x5b2414-0x0;var _0x30a395=_0xaac0[_0x5b2414];return _0x30a395;};'use strict';var _=require('lodash');var util=require(_0x0aac('0x0'));var logger=require('../../config/logger')(_0x0aac('0x1'));var moment=require(_0x0aac('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0aac('0x3'));var rimraf=require(_0x0aac('0x4'));var config=require(_0x0aac('0x5'));var attributes=require(_0x0aac('0x6'));module[_0x0aac('0x7')]=function(_0x100585,_0xdc0ea6){return _0x100585[_0x0aac('0x8')]('OpenchannelTransferReport',attributes,{'tableName':_0x0aac('0x9'),'paranoid':![],'indexes':[{'name':_0x0aac('0xa'),'fields':[_0x0aac('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9ce7=['lodash','util','../../config/logger','api','moment','request-promise','path','exports','define','report_openchannel_transfer','uniqueid'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x9ce7,0x1b8));var _0x79ce=function(_0x1e29af,_0x51a99a){_0x1e29af=_0x1e29af-0x0;var _0x5a5af5=_0x9ce7[_0x1e29af];return _0x5a5af5;};'use strict';var _=require(_0x79ce('0x0'));var util=require(_0x79ce('0x1'));var logger=require(_0x79ce('0x2'))(_0x79ce('0x3'));var moment=require(_0x79ce('0x4'));var BPromise=require('bluebird');var rp=require(_0x79ce('0x5'));var fs=require('fs');var path=require(_0x79ce('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module[_0x79ce('0x7')]=function(_0xbf2617,_0x4c9cea){return _0xbf2617[_0x79ce('0x8')]('OpenchannelTransferReport',attributes,{'tableName':_0x79ce('0x9'),'paranoid':![],'indexes':[{'name':_0x79ce('0xa'),'fields':[_0x79ce('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index c2481e3..0a0f2bb 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 _0x50b9=['catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x5c56dd,_0x5625eb){var _0xfdf212=function(_0x571c74){while(--_0x571c74){_0x5c56dd['push'](_0x5c56dd['shift']());}};_0xfdf212(++_0x5625eb);}(_0x50b9,0x171));var _0x950b=function(_0x4c8a8f,_0x997ef){_0x4c8a8f=_0x4c8a8f-0x0;var _0x404500=_0x50b9[_0x4c8a8f];return _0x404500;};'use strict';var _=require(_0x950b('0x0'));var util=require('util');var moment=require(_0x950b('0x1'));var BPromise=require('bluebird');var rs=require(_0x950b('0x2'));var fs=require('fs');var Redis=require(_0x950b('0x3'));var db=require(_0x950b('0x4'))['db'];var utils=require(_0x950b('0x5'));var logger=require(_0x950b('0x6'))(_0x950b('0x7'));var config=require(_0x950b('0x8'));var jayson=require(_0x950b('0x9'));var client=jayson[_0x950b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26ff96,_0x34133e,_0x9258eb){return new BPromise(function(_0x585413,_0x4b7a6a){return client['request'](_0x26ff96,_0x9258eb)[_0x950b('0xb')](function(_0x26b30f){logger[_0x950b('0xc')](_0x950b('0xd'),_0x34133e,_0x950b('0xe'));logger[_0x950b('0xf')](_0x950b('0x10'),_0x34133e,'request\x20sent',JSON[_0x950b('0x11')](_0x26b30f));if(_0x26b30f[_0x950b('0x12')]){if(_0x26b30f['error'][_0x950b('0x13')]===0x1f4){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x34133e,_0x26b30f[_0x950b('0x12')][_0x950b('0x14')]);return _0x4b7a6a(_0x26b30f[_0x950b('0x12')][_0x950b('0x14')]);}logger[_0x950b('0x12')](_0x950b('0xd'),_0x34133e,_0x26b30f[_0x950b('0x12')][_0x950b('0x14')]);return _0x585413(_0x26b30f[_0x950b('0x12')][_0x950b('0x14')]);}else{logger[_0x950b('0xc')](_0x950b('0xd'),_0x34133e,_0x950b('0xe'));_0x585413(_0x26b30f[_0x950b('0x15')][_0x950b('0x14')]);}})[_0x950b('0x16')](function(_0x14cb6b){logger[_0x950b('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x34133e,_0x14cb6b);_0x4b7a6a(_0x14cb6b);});});} \ No newline at end of file +var _0x0298=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0x0298,0x95));var _0x8029=function(_0x4a456e,_0x5318dd){_0x4a456e=_0x4a456e-0x0;var _0x7428f5=_0x0298[_0x4a456e];return _0x7428f5;};'use strict';var _=require(_0x8029('0x0'));var util=require('util');var moment=require(_0x8029('0x1'));var BPromise=require(_0x8029('0x2'));var rs=require(_0x8029('0x3'));var fs=require('fs');var Redis=require(_0x8029('0x4'));var db=require(_0x8029('0x5'))['db'];var utils=require(_0x8029('0x6'));var logger=require(_0x8029('0x7'))(_0x8029('0x8'));var config=require(_0x8029('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8029('0xa')][_0x8029('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49e3e4,_0x517ae4,_0x275b38){return new BPromise(function(_0x1b3573,_0xe53462){return client[_0x8029('0xc')](_0x49e3e4,_0x275b38)['then'](function(_0x509d08){logger[_0x8029('0xd')](_0x8029('0xe'),_0x517ae4,_0x8029('0xf'));logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x517ae4,_0x8029('0xf'),JSON[_0x8029('0x10')](_0x509d08));if(_0x509d08['error']){if(_0x509d08[_0x8029('0x11')]['code']===0x1f4){logger[_0x8029('0x11')](_0x8029('0xe'),_0x517ae4,_0x509d08[_0x8029('0x11')][_0x8029('0x12')]);return _0xe53462(_0x509d08[_0x8029('0x11')][_0x8029('0x12')]);}logger['error'](_0x8029('0xe'),_0x517ae4,_0x509d08[_0x8029('0x11')][_0x8029('0x12')]);return _0x1b3573(_0x509d08[_0x8029('0x11')]['message']);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x517ae4,_0x8029('0xf'));_0x1b3573(_0x509d08[_0x8029('0x13')][_0x8029('0x12')]);}})[_0x8029('0x14')](function(_0x14ad14){logger[_0x8029('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x517ae4,_0x14ad14);_0xe53462(_0x14ad14);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 1b983ce..8203df4 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 _0xf996=['express','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1cef2c,_0xef920b){var _0x498194=function(_0x53198d){while(--_0x53198d){_0x1cef2c['push'](_0x1cef2c['shift']());}};_0x498194(++_0xef920b);}(_0xf996,0x74));var _0x6f99=function(_0x139c24,_0x562ba1){_0x139c24=_0x139c24-0x0;var _0xed1b28=_0xf996[_0x139c24];return _0xed1b28;};'use strict';var multer=require(_0x6f99('0x0'));var util=require(_0x6f99('0x1'));var path=require(_0x6f99('0x2'));var timeout=require('connect-timeout');var express=require(_0x6f99('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x6f99('0x4'));var config=require(_0x6f99('0x5'));var controller=require(_0x6f99('0x6'));router[_0x6f99('0x7')]('/',auth[_0x6f99('0x8')](),controller[_0x6f99('0x9')]);router[_0x6f99('0x7')](_0x6f99('0xa'),auth[_0x6f99('0x8')](),controller[_0x6f99('0xb')]);router['post']('/',auth[_0x6f99('0x8')](),controller['create']);router[_0x6f99('0xc')](_0x6f99('0xa'),auth[_0x6f99('0x8')](),controller[_0x6f99('0xd')]);router[_0x6f99('0xe')](_0x6f99('0xa'),auth[_0x6f99('0x8')](),controller[_0x6f99('0xf')]);module[_0x6f99('0x10')]=router; \ No newline at end of file +var _0x7035=['./pause.controller','isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5bdce6,_0x4f7316){var _0x568c90=function(_0x403993){while(--_0x403993){_0x5bdce6['push'](_0x5bdce6['shift']());}};_0x568c90(++_0x4f7316);}(_0x7035,0x15e));var _0x5703=function(_0x3a5b0b,_0x314e98){_0x3a5b0b=_0x3a5b0b-0x0;var _0x28a5d3=_0x7035[_0x3a5b0b];return _0x28a5d3;};'use strict';var multer=require(_0x5703('0x0'));var util=require('util');var path=require(_0x5703('0x1'));var timeout=require(_0x5703('0x2'));var express=require('express');var router=express[_0x5703('0x3')]();var auth=require(_0x5703('0x4'));var interaction=require(_0x5703('0x5'));var config=require(_0x5703('0x6'));var controller=require(_0x5703('0x7'));router['get']('/',auth[_0x5703('0x8')](),controller[_0x5703('0x9')]);router['get'](_0x5703('0xa'),auth[_0x5703('0x8')](),controller[_0x5703('0xb')]);router[_0x5703('0xc')]('/',auth[_0x5703('0x8')](),controller[_0x5703('0xd')]);router['put']('/:id',auth[_0x5703('0x8')](),controller['update']);router[_0x5703('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x5703('0xf')]);module[_0x5703('0x10')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 71d45b8..08c525c 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 _0xb0f3=['exports','STRING','name','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb0f3,0xc3));var _0x3b0f=function(_0x2e8a70,_0x43d2b0){_0x2e8a70=_0x2e8a70-0x0;var _0x1ffcdf=_0xb0f3[_0x2e8a70];return _0x1ffcdf;};'use strict';var Sequelize=require(_0x3b0f('0x0'));module[_0x3b0f('0x1')]={'name':{'type':Sequelize[_0x3b0f('0x2')],'unique':_0x3b0f('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x3b0f('0x2')]}}; \ No newline at end of file +var _0x0d42=['name','STRING'];(function(_0x506f64,_0x395f5a){var _0x389fdb=function(_0x3cf504){while(--_0x3cf504){_0x506f64['push'](_0x506f64['shift']());}};_0x389fdb(++_0x395f5a);}(_0x0d42,0x76));var _0x20d4=function(_0x299eb8,_0x2a3c76){_0x299eb8=_0x299eb8-0x0;var _0x59ee49=_0x0d42[_0x299eb8];return _0x59ee49;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x20d4('0x0'),'allowNull':![]},'description':{'type':Sequelize[_0x20d4('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 1e685d3..3bdea71 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 _0xa9e0=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','type','key','VIRTUAL','field','options','includeAll','include','Pause','rows','catch','show','params','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','body','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js'];(function(_0x177910,_0x90ad03){var _0x89831c=function(_0x566216){while(--_0x566216){_0x177910['push'](_0x177910['shift']());}};_0x89831c(++_0x90ad03);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){var _0x432e56=_0x5a09ef[_0x0a9e('0x20')]({'plain':!![]});var _0x30bae6='Pauses';return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'type':_0x30bae6,'resourceId':_0x432e56['id']}})[_0x0a9e('0x1f')](function(){return _0x5a09ef;});})[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x13')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x23')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x24')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x25')](_0x33161b);};}exports[_0x0a9e('0x26')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=db['Pause'][_0x0a9e('0x27')];_0x1538a4[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](_0x14de77);_0x1538a4[_0x0a9e('0x2a')]=_['keys'](_0x25fba9[_0x0a9e('0x2a')]);_0x1538a4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],_0x1538a4[_0x0a9e('0x2a')]);_0x140511[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x25fba9['query'][_0x0a9e('0x2e')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x140511[_0x0a9e('0x2d')]:_0x1538a4[_0x0a9e('0x28')];if(!_0x25fba9[_0x0a9e('0x2a')]['hasOwnProperty'](_0x0a9e('0x30'))){_0x140511[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x140511[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x25fba9[_0x0a9e('0x2a')]['offset']);}_0x140511[_0x0a9e('0x31')]=qs['sort'](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x140511[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_['pick'](_0x25fba9[_0x0a9e('0x2a')],_0x1538a4[_0x0a9e('0x2b')]));if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x140511['where']=_['merge'](_0x140511[_0x0a9e('0x33')],{'$or':_['map'](_0x14de77,function(_0x24936a){if(_0x24936a[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4f41ae={};_0x4f41ae[_0x24936a[_0x0a9e('0x38')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x4f41ae;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x39')]);var _0x1a180b={'where':_0x140511[_0x0a9e('0x33')]};return db['Pause']['count'](_0x1a180b)[_0x0a9e('0x1f')](function(_0x40d766){_0x11c3b6['count']=_0x40d766;if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x140511[_0x0a9e('0x3b')]=[{'all':!![]}];}return db[_0x0a9e('0x3c')]['findAll'](_0x140511);})['then'](function(_0x15e37d){_0x11c3b6[_0x0a9e('0x3d')]=_0x15e37d;return _0x11c3b6;})['then'](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x3e')](handleError(_0x14433c,null));};exports[_0x0a9e('0x3f')]=function(_0x1459bb,_0x5b4f5e){var _0x316c8f={'raw':!![],'where':{'id':_0x1459bb[_0x0a9e('0x40')]['id']}},_0x2cfea9={};_0x2cfea9[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x3c')][_0x0a9e('0x27')]);_0x2cfea9[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1459bb[_0x0a9e('0x2a')]);_0x2cfea9[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x2cfea9[_0x0a9e('0x28')],_0x2cfea9[_0x0a9e('0x2a')]);_0x316c8f[_0x0a9e('0x2d')]=_['intersection'](_0x2cfea9['model'],qs[_0x0a9e('0x2e')](_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x316c8f[_0x0a9e('0x2d')]=_0x316c8f[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x316c8f[_0x0a9e('0x2d')]:_0x2cfea9[_0x0a9e('0x28')];if(_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x316c8f[_0x0a9e('0x3b')]=[{'all':!![]}];}_0x316c8f=_[_0x0a9e('0x41')]({},_0x316c8f,_0x1459bb['options']);return db[_0x0a9e('0x3c')][_0x0a9e('0x42')](_0x316c8f)[_0x0a9e('0x1f')](handleEntityNotFound(_0x5b4f5e,null))[_0x0a9e('0x1f')](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0x3e')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x43')]=function(_0x21eb86,_0x44dd99){return db['Pause'][_0x0a9e('0x43')](_0x21eb86['body'],{})[_0x0a9e('0x1f')](function(_0x476688){var _0x8d6dd1=_0x21eb86['user'][_0x0a9e('0x20')]({'plain':!![]});if(!_0x8d6dd1)throw new Error(_0x0a9e('0x44'));if(_0x8d6dd1[_0x0a9e('0x45')]===_0x0a9e('0x46')){var _0x45c845=_0x476688[_0x0a9e('0x20')]({'plain':!![]});var _0x45bf7f='Pauses';return db[_0x0a9e('0x47')][_0x0a9e('0x42')]({'where':{'name':_0x45bf7f,'userProfileId':_0x8d6dd1[_0x0a9e('0x48')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x409789){if(_0x409789&&_0x409789[_0x0a9e('0x49')]===0x0){return db[_0x0a9e('0x21')][_0x0a9e('0x43')]({'name':_0x45c845[_0x0a9e('0x24')],'resourceId':_0x45c845['id'],'type':_0x409789['name'],'sectionId':_0x409789['id']},{})[_0x0a9e('0x1f')](function(){return _0x476688;});}else{return _0x476688;}})[_0x0a9e('0x3e')](function(_0x4f7240){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f7240);throw _0x4f7240;});}return _0x476688;})[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,0xc9))[_0x0a9e('0x3e')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x4a')]=function(_0x11545a,_0x61bb17){if(_0x11545a[_0x0a9e('0x4b')]['id']){delete _0x11545a[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')]['find']({'where':{'id':_0x11545a['params']['id']}})['then'](handleEntityNotFound(_0x61bb17,null))[_0x0a9e('0x1f')](saveUpdates(_0x11545a[_0x0a9e('0x4b')],null))[_0x0a9e('0x1f')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};exports[_0x0a9e('0x22')]=function(_0x161aa7,_0x53d113){return db['Pause'][_0x0a9e('0x42')]({'where':{'id':_0x161aa7['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x53d113,null))['then'](removeEntity(_0x53d113,null))[_0x0a9e('0x3e')](handleError(_0x53d113,null));}; \ No newline at end of file +var _0xa9e0=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','type','key','VIRTUAL','field','options','includeAll','include','Pause','rows','catch','show','params','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','body','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js'];(function(_0x2cd326,_0x15e463){var _0x5785e3=function(_0x5f08ca){while(--_0x5f08ca){_0x2cd326['push'](_0x2cd326['shift']());}};_0x5785e3(++_0x15e463);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){var _0x432e56=_0x5a09ef[_0x0a9e('0x20')]({'plain':!![]});var _0x30bae6='Pauses';return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'type':_0x30bae6,'resourceId':_0x432e56['id']}})[_0x0a9e('0x1f')](function(){return _0x5a09ef;});})[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x13')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x23')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x24')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x25')](_0x33161b);};}exports[_0x0a9e('0x26')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=db['Pause'][_0x0a9e('0x27')];_0x1538a4[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](_0x14de77);_0x1538a4[_0x0a9e('0x2a')]=_['keys'](_0x25fba9[_0x0a9e('0x2a')]);_0x1538a4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],_0x1538a4[_0x0a9e('0x2a')]);_0x140511[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x25fba9['query'][_0x0a9e('0x2e')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x140511[_0x0a9e('0x2d')]:_0x1538a4[_0x0a9e('0x28')];if(!_0x25fba9[_0x0a9e('0x2a')]['hasOwnProperty'](_0x0a9e('0x30'))){_0x140511[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x140511[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x25fba9[_0x0a9e('0x2a')]['offset']);}_0x140511[_0x0a9e('0x31')]=qs['sort'](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x140511[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_['pick'](_0x25fba9[_0x0a9e('0x2a')],_0x1538a4[_0x0a9e('0x2b')]));if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x140511['where']=_['merge'](_0x140511[_0x0a9e('0x33')],{'$or':_['map'](_0x14de77,function(_0x24936a){if(_0x24936a[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4f41ae={};_0x4f41ae[_0x24936a[_0x0a9e('0x38')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x4f41ae;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x39')]);var _0x1a180b={'where':_0x140511[_0x0a9e('0x33')]};return db['Pause']['count'](_0x1a180b)[_0x0a9e('0x1f')](function(_0x40d766){_0x11c3b6['count']=_0x40d766;if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x140511[_0x0a9e('0x3b')]=[{'all':!![]}];}return db[_0x0a9e('0x3c')]['findAll'](_0x140511);})['then'](function(_0x15e37d){_0x11c3b6[_0x0a9e('0x3d')]=_0x15e37d;return _0x11c3b6;})['then'](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x3e')](handleError(_0x14433c,null));};exports[_0x0a9e('0x3f')]=function(_0x1459bb,_0x5b4f5e){var _0x316c8f={'raw':!![],'where':{'id':_0x1459bb[_0x0a9e('0x40')]['id']}},_0x2cfea9={};_0x2cfea9[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x3c')][_0x0a9e('0x27')]);_0x2cfea9[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1459bb[_0x0a9e('0x2a')]);_0x2cfea9[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x2cfea9[_0x0a9e('0x28')],_0x2cfea9[_0x0a9e('0x2a')]);_0x316c8f[_0x0a9e('0x2d')]=_['intersection'](_0x2cfea9['model'],qs[_0x0a9e('0x2e')](_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x316c8f[_0x0a9e('0x2d')]=_0x316c8f[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x316c8f[_0x0a9e('0x2d')]:_0x2cfea9[_0x0a9e('0x28')];if(_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x316c8f[_0x0a9e('0x3b')]=[{'all':!![]}];}_0x316c8f=_[_0x0a9e('0x41')]({},_0x316c8f,_0x1459bb['options']);return db[_0x0a9e('0x3c')][_0x0a9e('0x42')](_0x316c8f)[_0x0a9e('0x1f')](handleEntityNotFound(_0x5b4f5e,null))[_0x0a9e('0x1f')](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0x3e')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x43')]=function(_0x21eb86,_0x44dd99){return db['Pause'][_0x0a9e('0x43')](_0x21eb86['body'],{})[_0x0a9e('0x1f')](function(_0x476688){var _0x8d6dd1=_0x21eb86['user'][_0x0a9e('0x20')]({'plain':!![]});if(!_0x8d6dd1)throw new Error(_0x0a9e('0x44'));if(_0x8d6dd1[_0x0a9e('0x45')]===_0x0a9e('0x46')){var _0x45c845=_0x476688[_0x0a9e('0x20')]({'plain':!![]});var _0x45bf7f='Pauses';return db[_0x0a9e('0x47')][_0x0a9e('0x42')]({'where':{'name':_0x45bf7f,'userProfileId':_0x8d6dd1[_0x0a9e('0x48')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x409789){if(_0x409789&&_0x409789[_0x0a9e('0x49')]===0x0){return db[_0x0a9e('0x21')][_0x0a9e('0x43')]({'name':_0x45c845[_0x0a9e('0x24')],'resourceId':_0x45c845['id'],'type':_0x409789['name'],'sectionId':_0x409789['id']},{})[_0x0a9e('0x1f')](function(){return _0x476688;});}else{return _0x476688;}})[_0x0a9e('0x3e')](function(_0x4f7240){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f7240);throw _0x4f7240;});}return _0x476688;})[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,0xc9))[_0x0a9e('0x3e')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x4a')]=function(_0x11545a,_0x61bb17){if(_0x11545a[_0x0a9e('0x4b')]['id']){delete _0x11545a[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')]['find']({'where':{'id':_0x11545a['params']['id']}})['then'](handleEntityNotFound(_0x61bb17,null))[_0x0a9e('0x1f')](saveUpdates(_0x11545a[_0x0a9e('0x4b')],null))[_0x0a9e('0x1f')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};exports[_0x0a9e('0x22')]=function(_0x161aa7,_0x53d113){return db['Pause'][_0x0a9e('0x42')]({'where':{'id':_0x161aa7['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x53d113,null))['then'](removeEntity(_0x53d113,null))[_0x0a9e('0x3e')](handleError(_0x53d113,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index d2d6829..af2bc24 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 _0x87bf=['define','Pause','util','../../config/logger','moment','bluebird','path','rimraf','./pause.attributes'];(function(_0x35443c,_0x43e1c1){var _0x16540d=function(_0x471299){while(--_0x471299){_0x35443c['push'](_0x35443c['shift']());}};_0x16540d(++_0x43e1c1);}(_0x87bf,0xb6));var _0xf87b=function(_0x3a023f,_0x3a0789){_0x3a023f=_0x3a023f-0x0;var _0x1de363=_0x87bf[_0x3a023f];return _0x1de363;};'use strict';var _=require('lodash');var util=require(_0xf87b('0x0'));var logger=require(_0xf87b('0x1'))('api');var moment=require(_0xf87b('0x2'));var BPromise=require(_0xf87b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf87b('0x4'));var rimraf=require(_0xf87b('0x5'));var config=require('../../config/environment');var attributes=require(_0xf87b('0x6'));module['exports']=function(_0x19c8c7,_0xd441c4){return _0x19c8c7[_0xf87b('0x7')](_0xf87b('0x8'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x300a=['api','moment','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger'];(function(_0x3a3c17,_0x5b7b7e){var _0xd07f21=function(_0xeaad44){while(--_0xeaad44){_0x3a3c17['push'](_0x3a3c17['shift']());}};_0xd07f21(++_0x5b7b7e);}(_0x300a,0x1d9));var _0xa300=function(_0x9cc1d7,_0x126bd4){_0x9cc1d7=_0x9cc1d7-0x0;var _0x294e87=_0x300a[_0x9cc1d7];return _0x294e87;};'use strict';var _=require(_0xa300('0x0'));var util=require(_0xa300('0x1'));var logger=require(_0xa300('0x2'))(_0xa300('0x3'));var moment=require(_0xa300('0x4'));var BPromise=require('bluebird');var rp=require(_0xa300('0x5'));var fs=require('fs');var path=require(_0xa300('0x6'));var rimraf=require(_0xa300('0x7'));var config=require(_0xa300('0x8'));var attributes=require(_0xa300('0x9'));module[_0xa300('0xa')]=function(_0xb57b7f,_0x251d4b){return _0xb57b7f[_0xa300('0xb')](_0xa300('0xc'),attributes,{'tableName':_0xa300('0xd'),'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 c1f62da..7de222a 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 _0xfaa4=['Pause,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','Pause','find','options','raw','map','include','model','attributes','ShowPause','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Pause,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3cf5a3,_0x5a4492){var _0x39ba2d=function(_0x3ed989){while(--_0x3ed989){_0x3cf5a3['push'](_0x3cf5a3['shift']());}};_0x39ba2d(++_0x5a4492);}(_0xfaa4,0x1a8));var _0x4faa=function(_0x377d0e,_0x53f2c4){_0x377d0e=_0x377d0e-0x0;var _0x1642a5=_0xfaa4[_0x377d0e];return _0x1642a5;};'use strict';var _=require(_0x4faa('0x0'));var util=require(_0x4faa('0x1'));var moment=require(_0x4faa('0x2'));var BPromise=require(_0x4faa('0x3'));var rs=require(_0x4faa('0x4'));var fs=require('fs');var Redis=require(_0x4faa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4faa('0x6'));var logger=require(_0x4faa('0x7'))(_0x4faa('0x8'));var config=require(_0x4faa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4faa('0xa')][_0x4faa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa46a7d,_0x504f83,_0x528871){return new BPromise(function(_0x5d476f,_0x159843){return client[_0x4faa('0xc')](_0xa46a7d,_0x528871)[_0x4faa('0xd')](function(_0x4dd4d4){logger[_0x4faa('0xe')](_0x4faa('0xf'),_0x504f83,_0x4faa('0x10'));logger[_0x4faa('0x11')](_0x4faa('0x12'),_0x504f83,'request\x20sent',JSON['stringify'](_0x4dd4d4));if(_0x4dd4d4[_0x4faa('0x13')]){if(_0x4dd4d4[_0x4faa('0x13')][_0x4faa('0x14')]===0x1f4){logger[_0x4faa('0x13')](_0x4faa('0xf'),_0x504f83,_0x4dd4d4[_0x4faa('0x13')][_0x4faa('0x15')]);return _0x159843(_0x4dd4d4[_0x4faa('0x13')][_0x4faa('0x15')]);}logger[_0x4faa('0x13')](_0x4faa('0xf'),_0x504f83,_0x4dd4d4[_0x4faa('0x13')][_0x4faa('0x15')]);return _0x5d476f(_0x4dd4d4['error'][_0x4faa('0x15')]);}else{logger[_0x4faa('0xe')](_0x4faa('0xf'),_0x504f83,'request\x20sent');_0x5d476f(_0x4dd4d4[_0x4faa('0x16')][_0x4faa('0x15')]);}})[_0x4faa('0x17')](function(_0x536a2b){logger[_0x4faa('0x13')](_0x4faa('0xf'),_0x504f83,_0x536a2b);_0x159843(_0x536a2b);});});}exports['ShowPause']=function(_0x5d8c8a){var _0x5444d9=this;return new Promise(function(_0x33592d,_0x361cdc){return db[_0x4faa('0x18')][_0x4faa('0x19')]({'raw':_0x5d8c8a['options']?_0x5d8c8a[_0x4faa('0x1a')][_0x4faa('0x1b')]===undefined?!![]:![]:!![],'where':_0x5d8c8a[_0x4faa('0x1a')]?_0x5d8c8a[_0x4faa('0x1a')]['where']||null:null,'attributes':_0x5d8c8a[_0x4faa('0x1a')]?_0x5d8c8a['options']['attributes']||null:null,'include':_0x5d8c8a[_0x4faa('0x1a')]?_0x5d8c8a['options']['include']?_[_0x4faa('0x1c')](_0x5d8c8a[_0x4faa('0x1a')][_0x4faa('0x1d')],function(_0x183aa8){return{'model':db[_0x183aa8[_0x4faa('0x1e')]],'as':_0x183aa8['as'],'attributes':_0x183aa8[_0x4faa('0x1f')],'include':_0x183aa8[_0x4faa('0x1d')]?_[_0x4faa('0x1c')](_0x183aa8['include'],function(_0x1049a6){return{'model':db[_0x1049a6[_0x4faa('0x1e')]],'as':_0x1049a6['as'],'attributes':_0x1049a6['attributes'],'include':_0x1049a6[_0x4faa('0x1d')]?_[_0x4faa('0x1c')](_0x1049a6[_0x4faa('0x1d')],function(_0x40c17d){return{'model':db[_0x40c17d['model']],'as':_0x40c17d['as'],'attributes':_0x40c17d[_0x4faa('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e4306){logger[_0x4faa('0xe')](_0x4faa('0x20'),_0x5d8c8a);logger[_0x4faa('0x11')](_0x4faa('0x20'),_0x5d8c8a,JSON[_0x4faa('0x21')](_0x2e4306));_0x33592d(_0x2e4306);})['catch'](function(_0x6a4ce8){logger[_0x4faa('0x13')](_0x4faa('0x20'),_0x6a4ce8[_0x4faa('0x15')],_0x5d8c8a);_0x361cdc(_0x5444d9['error'](0x1f4,_0x6a4ce8['message']));});});}; \ No newline at end of file +var _0x3c57=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','Pause,\x20%s,\x20%s','message','info','result','catch','ShowPause','Pause','find','raw','options','where','include','map','attributes','model'];(function(_0x17fea7,_0x102927){var _0x3150c3=function(_0x1d6bd0){while(--_0x1d6bd0){_0x17fea7['push'](_0x17fea7['shift']());}};_0x3150c3(++_0x102927);}(_0x3c57,0x8c));var _0x73c5=function(_0x4c5246,_0x44a274){_0x4c5246=_0x4c5246-0x0;var _0x46c79e=_0x3c57[_0x4c5246];return _0x46c79e;};'use strict';var _=require(_0x73c5('0x0'));var util=require(_0x73c5('0x1'));var moment=require(_0x73c5('0x2'));var BPromise=require(_0x73c5('0x3'));var rs=require(_0x73c5('0x4'));var fs=require('fs');var Redis=require(_0x73c5('0x5'));var db=require(_0x73c5('0x6'))['db'];var utils=require(_0x73c5('0x7'));var logger=require(_0x73c5('0x8'))(_0x73c5('0x9'));var config=require(_0x73c5('0xa'));var jayson=require(_0x73c5('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5193ab,_0x3ebdd8,_0x1810a5){return new BPromise(function(_0x589a50,_0x3f4021){return client[_0x73c5('0xc')](_0x5193ab,_0x1810a5)[_0x73c5('0xd')](function(_0x11f163){logger['info']('Pause,\x20%s,\x20%s',_0x3ebdd8,_0x73c5('0xe'));logger[_0x73c5('0xf')](_0x73c5('0x10'),_0x3ebdd8,_0x73c5('0xe'),JSON[_0x73c5('0x11')](_0x11f163));if(_0x11f163[_0x73c5('0x12')]){if(_0x11f163[_0x73c5('0x12')][_0x73c5('0x13')]===0x1f4){logger[_0x73c5('0x12')](_0x73c5('0x14'),_0x3ebdd8,_0x11f163[_0x73c5('0x12')][_0x73c5('0x15')]);return _0x3f4021(_0x11f163[_0x73c5('0x12')]['message']);}logger[_0x73c5('0x12')]('Pause,\x20%s,\x20%s',_0x3ebdd8,_0x11f163[_0x73c5('0x12')][_0x73c5('0x15')]);return _0x589a50(_0x11f163[_0x73c5('0x12')]['message']);}else{logger[_0x73c5('0x16')](_0x73c5('0x14'),_0x3ebdd8,'request\x20sent');_0x589a50(_0x11f163[_0x73c5('0x17')][_0x73c5('0x15')]);}})[_0x73c5('0x18')](function(_0x101523){logger['error'](_0x73c5('0x14'),_0x3ebdd8,_0x101523);_0x3f4021(_0x101523);});});}exports[_0x73c5('0x19')]=function(_0x4194d8){var _0x4cc4ad=this;return new Promise(function(_0x49a5f9,_0x200dfd){return db[_0x73c5('0x1a')][_0x73c5('0x1b')]({'raw':_0x4194d8['options']?_0x4194d8['options'][_0x73c5('0x1c')]===undefined?!![]:![]:!![],'where':_0x4194d8['options']?_0x4194d8[_0x73c5('0x1d')][_0x73c5('0x1e')]||null:null,'attributes':_0x4194d8[_0x73c5('0x1d')]?_0x4194d8[_0x73c5('0x1d')]['attributes']||null:null,'include':_0x4194d8[_0x73c5('0x1d')]?_0x4194d8['options'][_0x73c5('0x1f')]?_[_0x73c5('0x20')](_0x4194d8[_0x73c5('0x1d')][_0x73c5('0x1f')],function(_0x4f5edf){return{'model':db[_0x4f5edf['model']],'as':_0x4f5edf['as'],'attributes':_0x4f5edf[_0x73c5('0x21')],'include':_0x4f5edf[_0x73c5('0x1f')]?_[_0x73c5('0x20')](_0x4f5edf['include'],function(_0x236526){return{'model':db[_0x236526['model']],'as':_0x236526['as'],'attributes':_0x236526[_0x73c5('0x21')],'include':_0x236526['include']?_[_0x73c5('0x20')](_0x236526['include'],function(_0x59fb53){return{'model':db[_0x59fb53[_0x73c5('0x22')]],'as':_0x59fb53['as'],'attributes':_0x59fb53['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e46cb){logger['info'](_0x73c5('0x19'),_0x4194d8);logger[_0x73c5('0xf')](_0x73c5('0x19'),_0x4194d8,JSON['stringify'](_0x1e46cb));_0x49a5f9(_0x1e46cb);})[_0x73c5('0x18')](function(_0x2f1dc9){logger['error'](_0x73c5('0x19'),_0x2f1dc9[_0x73c5('0x15')],_0x4194d8);_0x200dfd(_0x4cc4ad[_0x73c5('0x12')](0x1f4,_0x2f1dc9[_0x73c5('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index f85f5f7..de63cf1 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 _0x2541=['single','file','upload','webhookPost','put','update','delete','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/webhook','/:id','show','join','root','server/files/plugins','originalname','%s-%s%s','basename','extname','post'];(function(_0x559a28,_0x422eab){var _0x40f180=function(_0x311820){while(--_0x311820){_0x559a28['push'](_0x559a28['shift']());}};_0x40f180(++_0x422eab);}(_0x2541,0x14b));var _0x1254=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2541[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x1254('0x0'));var util=require(_0x1254('0x1'));var path=require(_0x1254('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x1254('0x3'));var interaction=require(_0x1254('0x4'));var config=require(_0x1254('0x5'));var controller=require('./plugin.controller');router[_0x1254('0x6')]('/',auth[_0x1254('0x7')](),controller[_0x1254('0x8')]);router[_0x1254('0x6')](_0x1254('0x9'),controller['webhookGet']);router[_0x1254('0x6')](_0x1254('0xa'),auth[_0x1254('0x7')](),controller[_0x1254('0xb')]);router[_0x1254('0x6')]('/:id/download',auth[_0x1254('0x7')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x35aab6,_0x42b2b8,_0x1989da){_0x1989da(null,path[_0x1254('0xc')](config[_0x1254('0xd')],_0x1254('0xe')));},'filename':function(_0x66f575,_0x3fd211,_0x1c72ec){_0x3fd211[_0x1254('0xf')]=_0x3fd211[_0x1254('0xf')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1c72ec(null,util['format'](_0x1254('0x10'),path[_0x1254('0x11')](_0x3fd211['originalname'],path[_0x1254('0x12')](_0x3fd211[_0x1254('0xf')])),Date['now'](),path[_0x1254('0x12')](_0x3fd211[_0x1254('0xf')])));}})});router[_0x1254('0x13')]('/',upload[_0x1254('0x14')](_0x1254('0x15')),controller[_0x1254('0x16')]);router[_0x1254('0x13')](_0x1254('0x9'),controller[_0x1254('0x17')]);router[_0x1254('0x18')](_0x1254('0xa'),auth[_0x1254('0x7')](),controller[_0x1254('0x19')]);router[_0x1254('0x1a')](_0x1254('0xa'),auth[_0x1254('0x7')](),controller[_0x1254('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xac48=['upload','/webhook','put','delete','exports','multer','util','path','connect-timeout','Router','./plugin.controller','isAuthenticated','index','get','webhookGet','download','diskStorage','root','server/files/plugins','originalname','extname','now','post','single','file'];(function(_0x27d3e5,_0x2f899b){var _0x5ae363=function(_0x3fae1d){while(--_0x3fae1d){_0x27d3e5['push'](_0x27d3e5['shift']());}};_0x5ae363(++_0x2f899b);}(_0xac48,0x69));var _0x8ac4=function(_0x1d8877,_0x4340e1){_0x1d8877=_0x1d8877-0x0;var _0x424514=_0xac48[_0x1d8877];return _0x424514;};'use strict';var multer=require(_0x8ac4('0x0'));var util=require(_0x8ac4('0x1'));var path=require(_0x8ac4('0x2'));var timeout=require(_0x8ac4('0x3'));var express=require('express');var router=express[_0x8ac4('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8ac4('0x5'));router['get']('/',auth[_0x8ac4('0x6')](),controller[_0x8ac4('0x7')]);router[_0x8ac4('0x8')]('/webhook',controller[_0x8ac4('0x9')]);router[_0x8ac4('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/download',auth[_0x8ac4('0x6')](),controller[_0x8ac4('0xa')]);var upload=multer({'storage':multer[_0x8ac4('0xb')]({'destination':function(_0xf76461,_0x4cf8f6,_0x5c962e){_0x5c962e(null,path['join'](config[_0x8ac4('0xc')],_0x8ac4('0xd')));},'filename':function(_0x5deb1c,_0x14f68f,_0x27fe87){_0x14f68f[_0x8ac4('0xe')]=_0x14f68f[_0x8ac4('0xe')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x27fe87(null,util['format']('%s-%s%s',path['basename'](_0x14f68f[_0x8ac4('0xe')],path[_0x8ac4('0xf')](_0x14f68f[_0x8ac4('0xe')])),Date[_0x8ac4('0x10')](),path[_0x8ac4('0xf')](_0x14f68f[_0x8ac4('0xe')])));}})});router[_0x8ac4('0x11')]('/',upload[_0x8ac4('0x12')](_0x8ac4('0x13')),controller[_0x8ac4('0x14')]);router[_0x8ac4('0x11')](_0x8ac4('0x15'),controller['webhookPost']);router[_0x8ac4('0x16')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8ac4('0x6')](),controller[_0x8ac4('0x17')]);module[_0x8ac4('0x18')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 7869d99..aae6198 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 _0x3119=['BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','ENUM','script','TEXT'];(function(_0x15ae09,_0x583ec8){var _0x225da9=function(_0x27ce4d){while(--_0x27ce4d){_0x15ae09['push'](_0x15ae09['shift']());}};_0x225da9(++_0x583ec8);}(_0x3119,0x14b));var _0x9311=function(_0x34aec4,_0x3801da){_0x34aec4=_0x34aec4-0x0;var _0x51e1a7=_0x3119[_0x34aec4];return _0x51e1a7;};'use strict';var Sequelize=require(_0x9311('0x0'));module['exports']={'name':{'type':Sequelize[_0x9311('0x1')]},'type':{'type':Sequelize[_0x9311('0x2')]('html',_0x9311('0x3'))},'description':{'type':Sequelize[_0x9311('0x4')]},'version':{'type':Sequelize[_0x9311('0x4')]},'path':{'type':Sequelize[_0x9311('0x1')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x9311('0x5')],'defaultValue':0x0,'comment':_0x9311('0x6')},'sidebar':{'type':Sequelize[_0x9311('0x2')](_0x9311('0x7'),_0x9311('0x8'),_0x9311('0x9'),_0x9311('0xa')),'defaultValue':'always','comment':_0x9311('0xb')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x9311('0x1')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9023=['ENUM','adminOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN'];(function(_0x1a2c77,_0x285eae){var _0x3c12cb=function(_0x57b575){while(--_0x57b575){_0x1a2c77['push'](_0x1a2c77['shift']());}};_0x3c12cb(++_0x285eae);}(_0x9023,0x1f3));var _0x3902=function(_0xbad3d0,_0x182f3e){_0xbad3d0=_0xbad3d0-0x0;var _0x3d1c41=_0x9023[_0xbad3d0];return _0x3d1c41;};'use strict';var Sequelize=require(_0x3902('0x0'));module[_0x3902('0x1')]={'name':{'type':Sequelize[_0x3902('0x2')]},'type':{'type':Sequelize['ENUM'](_0x3902('0x3'),_0x3902('0x4'))},'description':{'type':Sequelize[_0x3902('0x5')]},'version':{'type':Sequelize[_0x3902('0x5')]},'path':{'type':Sequelize['STRING'],'comment':_0x3902('0x6')},'active':{'type':Sequelize[_0x3902('0x7')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x3902('0x8')](_0x3902('0x9'),'agentOnly',_0x3902('0xa'),_0x3902('0xb')),'defaultValue':_0x3902('0xa'),'comment':_0x3902('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x3902('0x2')]},'agentUrl':{'type':Sequelize[_0x3902('0x2')]},'scriptName':{'type':Sequelize[_0x3902('0x2')]},'scriptPath':{'type':Sequelize[_0x3902('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 0eada06..18a52ac 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 _0xf4d2=['0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','encoding','method','%s%s','headers','content-length','endsWith','statusCode','send','webhookPost','resolve','http://localhost:','content-type','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','extract-zip','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./plugin.socket','register','sendStatus','end','status','json','offset','limit','set','apply','save','update','then','destroy','get','Plugins','error','stack','name','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','options','Plugin','count','findAll','rows','show','params','download','find','join','server/files/plugins','format','%s.zip','createWriteStream','zip','warning','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','**/*','root','dirname','basename','node_modules/**/*','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','unlinkSync','info','Temporary\x20file\x20removed','catch','upload','filename','file','Plugin\x20upload\x20destination:\x20%s'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xf4d2,0xec));var _0x2f4d=function(_0x1e3eef,_0x5b8865){_0x1e3eef=_0x1e3eef-0x0;var _0x585aaa=_0xf4d2[_0x1e3eef];return _0x585aaa;};'use strict';var pdf=require(_0x2f4d('0x0'));var emlformat=require(_0x2f4d('0x1'));var rimraf=require(_0x2f4d('0x2'));var zipdir=require(_0x2f4d('0x3'));var jsonpatch=require(_0x2f4d('0x4'));var rp=require(_0x2f4d('0x5'));var moment=require(_0x2f4d('0x6'));var BPromise=require(_0x2f4d('0x7'));var Mustache=require(_0x2f4d('0x8'));var util=require(_0x2f4d('0x9'));var path=require(_0x2f4d('0xa'));var sox=require(_0x2f4d('0xb'));var csv=require(_0x2f4d('0xc'));var ejs=require(_0x2f4d('0xd'));var fs=require('fs');var _=require(_0x2f4d('0xe'));var squel=require(_0x2f4d('0xf'));var crypto=require('crypto');var jsforce=require(_0x2f4d('0x10'));var deskjs=require(_0x2f4d('0x11'));var toCsv=require(_0x2f4d('0xc'));var querystring=require(_0x2f4d('0x12'));var Papa=require('papaparse');var extract=require(_0x2f4d('0x13'));var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require(_0x2f4d('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x2f4d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f4d('0x16'))(_0x2f4d('0x17'));var utils=require(_0x2f4d('0x18'));var config=require(_0x2f4d('0x19'));var db=require(_0x2f4d('0x1a'))['db'];config[_0x2f4d('0x1b')]=_[_0x2f4d('0x1c')](config[_0x2f4d('0x1b')],{'host':_0x2f4d('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2f4d('0x1b')]));require(_0x2f4d('0x1e'))[_0x2f4d('0x1f')](socket);function respondWithStatusCode(_0x2dd12d,_0x5ad120){_0x5ad120=_0x5ad120||0xcc;return function(_0x1b2eec){if(_0x1b2eec){return _0x2dd12d[_0x2f4d('0x20')](_0x5ad120);}return _0x2dd12d['status'](_0x5ad120)[_0x2f4d('0x21')]();};}function respondWithResult(_0x5a8dfd,_0x4e89d4){_0x4e89d4=_0x4e89d4||0xc8;return function(_0x4f1261){if(_0x4f1261){return _0x5a8dfd[_0x2f4d('0x22')](_0x4e89d4)[_0x2f4d('0x23')](_0x4f1261);}};}function respondWithFilteredResult(_0x56c139,_0x3f16dd){return function(_0x1f0ee7){if(_0x1f0ee7){var _0x5a0b2b=_0x1f0ee7['count'],_0xf88845=_0x3f16dd[_0x2f4d('0x24')],_0xdb0cd3=_0x3f16dd[_0x2f4d('0x24')]+_0x3f16dd[_0x2f4d('0x25')],_0x379a27;if(_0xdb0cd3>=_0x5a0b2b){_0xdb0cd3=_0x5a0b2b;_0x379a27=0xc8;}else{_0x379a27=0xce;}_0x56c139[_0x2f4d('0x22')](_0x379a27);return _0x56c139[_0x2f4d('0x26')]('Content-Range',_0xf88845+'-'+_0xdb0cd3+'/'+_0x5a0b2b)[_0x2f4d('0x23')](_0x1f0ee7);}return null;};}function patchUpdates(_0x4289ef){return function(_0x38d78a){try{jsonpatch[_0x2f4d('0x27')](_0x38d78a,_0x4289ef,!![]);}catch(_0x1ee857){return BPromise['reject'](_0x1ee857);}return _0x38d78a[_0x2f4d('0x28')]();};}function saveUpdates(_0x1a030d,_0x106fc0){return function(_0x192b68){if(_0x192b68){return _0x192b68[_0x2f4d('0x29')](_0x1a030d)[_0x2f4d('0x2a')](function(_0x449f9d){return _0x449f9d;});}return null;};}function removeEntity(_0x5115ad,_0x3062e3){return function(_0x150d96){if(_0x150d96){return _0x150d96[_0x2f4d('0x2b')]()[_0x2f4d('0x2a')](function(){var _0x53a7b7=_0x150d96[_0x2f4d('0x2c')]({'plain':!![]});var _0x50c190=_0x2f4d('0x2d');return db['UserProfileResource'][_0x2f4d('0x2b')]({'where':{'type':_0x50c190,'resourceId':_0x53a7b7['id']}})[_0x2f4d('0x2a')](function(){return _0x150d96;});})['then'](function(){_0x5115ad[_0x2f4d('0x22')](0xcc)[_0x2f4d('0x21')]();});}};}function handleEntityNotFound(_0x1742d8,_0x26b95a){return function(_0x55568b){if(!_0x55568b){_0x1742d8[_0x2f4d('0x20')](0x194);}return _0x55568b;};}function handleError(_0x8098cf,_0x1e6bdd){_0x1e6bdd=_0x1e6bdd||0x1f4;return function(_0x45b001){logger[_0x2f4d('0x2e')](_0x45b001[_0x2f4d('0x2f')]);if(_0x45b001[_0x2f4d('0x30')]){delete _0x45b001[_0x2f4d('0x30')];}_0x8098cf[_0x2f4d('0x22')](_0x1e6bdd)['send'](_0x45b001);};}exports[_0x2f4d('0x31')]=function(_0x49b88d,_0x452c64){var _0x281186={},_0x5da44c={},_0x5602d5={'count':0x0,'rows':[]};var _0x30b981=db['Plugin'][_0x2f4d('0x32')];_0x5da44c['model']=_[_0x2f4d('0x33')](_0x30b981);_0x5da44c[_0x2f4d('0x34')]=_['keys'](_0x49b88d[_0x2f4d('0x34')]);_0x5da44c[_0x2f4d('0x35')]=_[_0x2f4d('0x36')](_0x5da44c[_0x2f4d('0x37')],_0x5da44c[_0x2f4d('0x34')]);_0x281186[_0x2f4d('0x38')]=_[_0x2f4d('0x36')](_0x5da44c['model'],qs[_0x2f4d('0x39')](_0x49b88d[_0x2f4d('0x34')][_0x2f4d('0x39')]));_0x281186[_0x2f4d('0x38')]=_0x281186[_0x2f4d('0x38')][_0x2f4d('0x3a')]?_0x281186[_0x2f4d('0x38')]:_0x5da44c[_0x2f4d('0x37')];if(!_0x49b88d['query'][_0x2f4d('0x3b')](_0x2f4d('0x3c'))){_0x281186['limit']=qs[_0x2f4d('0x25')](_0x49b88d[_0x2f4d('0x34')][_0x2f4d('0x25')]);_0x281186[_0x2f4d('0x24')]=qs['offset'](_0x49b88d[_0x2f4d('0x34')]['offset']);}_0x281186[_0x2f4d('0x3d')]=qs[_0x2f4d('0x3e')](_0x49b88d[_0x2f4d('0x34')][_0x2f4d('0x3e')]);_0x281186[_0x2f4d('0x3f')]=qs['filters'](_[_0x2f4d('0x40')](_0x49b88d[_0x2f4d('0x34')],_0x5da44c['filters']));if(_0x49b88d[_0x2f4d('0x34')][_0x2f4d('0x41')]){_0x281186[_0x2f4d('0x3f')]=_[_0x2f4d('0x42')](_0x281186[_0x2f4d('0x3f')],{'$or':_[_0x2f4d('0x43')](_0x30b981,function(_0x4aa7e4){if(_0x4aa7e4[_0x2f4d('0x44')][_0x2f4d('0x45')]!=='VIRTUAL'){var _0x4a8944={};_0x4a8944[_0x4aa7e4[_0x2f4d('0x46')]]={'$like':'%'+_0x49b88d[_0x2f4d('0x34')][_0x2f4d('0x41')]+'%'};return _0x4a8944;}})});}_0x281186=_['merge']({},_0x281186,_0x49b88d[_0x2f4d('0x47')]);var _0x2d2d34={'where':_0x281186[_0x2f4d('0x3f')]};return db[_0x2f4d('0x48')][_0x2f4d('0x49')](_0x2d2d34)['then'](function(_0x24bd26){_0x5602d5[_0x2f4d('0x49')]=_0x24bd26;if(_0x49b88d[_0x2f4d('0x34')]['includeAll']){_0x281186['include']=[{'all':!![]}];}return db[_0x2f4d('0x48')][_0x2f4d('0x4a')](_0x281186);})[_0x2f4d('0x2a')](function(_0x44e4fb){_0x5602d5[_0x2f4d('0x4b')]=_0x44e4fb;return _0x5602d5;})['then'](respondWithFilteredResult(_0x452c64,_0x281186))['catch'](handleError(_0x452c64,null));};exports[_0x2f4d('0x4c')]=function(_0x3b6c2e,_0x4dd712){var _0x60eefe={'raw':!![],'where':{'id':_0x3b6c2e[_0x2f4d('0x4d')]['id']}},_0x227988={};_0x227988['model']=_[_0x2f4d('0x33')](db[_0x2f4d('0x48')][_0x2f4d('0x32')]);_0x227988[_0x2f4d('0x34')]=_[_0x2f4d('0x33')](_0x3b6c2e[_0x2f4d('0x34')]);_0x227988['filters']=_[_0x2f4d('0x36')](_0x227988[_0x2f4d('0x37')],_0x227988['query']);_0x60eefe[_0x2f4d('0x38')]=_[_0x2f4d('0x36')](_0x227988[_0x2f4d('0x37')],qs['fields'](_0x3b6c2e[_0x2f4d('0x34')][_0x2f4d('0x39')]));_0x60eefe[_0x2f4d('0x38')]=_0x60eefe[_0x2f4d('0x38')][_0x2f4d('0x3a')]?_0x60eefe[_0x2f4d('0x38')]:_0x227988['model'];if(_0x3b6c2e[_0x2f4d('0x34')]['includeAll']){_0x60eefe['include']=[{'all':!![]}];}_0x60eefe=_[_0x2f4d('0x42')]({},_0x60eefe,_0x3b6c2e['options']);return db[_0x2f4d('0x48')]['find'](_0x60eefe)[_0x2f4d('0x2a')](handleEntityNotFound(_0x4dd712,null))[_0x2f4d('0x2a')](respondWithResult(_0x4dd712,null))['catch'](handleError(_0x4dd712,null));};exports[_0x2f4d('0x4e')]=function(_0x1da042,_0xb1d8b3,_0x501456){return db[_0x2f4d('0x48')][_0x2f4d('0x4f')]({'where':{'id':_0x1da042[_0x2f4d('0x4d')]['id']},'attributes':[_0x2f4d('0x30'),_0x2f4d('0xa')],'raw':!![]})[_0x2f4d('0x2a')](handleEntityNotFound(_0xb1d8b3,null))[_0x2f4d('0x2a')](function(_0x3b47ea){if(_0x3b47ea){var _0x255a66=path[_0x2f4d('0x50')](config['root'],_0x2f4d('0x51'),util[_0x2f4d('0x52')](_0x2f4d('0x53'),path['basename'](_0x3b47ea[_0x2f4d('0xa')])));var _0x521b58=fs[_0x2f4d('0x54')](_0x255a66);var _0x7a4e45=archiver(_0x2f4d('0x55'),{'zlib':{'level':0x9}});_0x7a4e45['on'](_0x2f4d('0x56'),function(_0x3ce463){if(_0x3ce463['code']===_0x2f4d('0x57')){logger['error'](_0x3ce463);}else{throw new db['Sequelize'][(_0x2f4d('0x58'))](_0x2f4d('0x59'));}});_0x7a4e45['on'](_0x2f4d('0x2e'),function(_0x38c68f){throw new db[(_0x2f4d('0x5a'))][(_0x2f4d('0x58'))](_0x2f4d('0x59'));});_0x7a4e45[_0x2f4d('0x5b')](_0x521b58);_0x7a4e45[_0x2f4d('0x5c')](_0x2f4d('0x5d'),{'cwd':path['join'](config[_0x2f4d('0x5e')],_0x2f4d('0x51'),path[_0x2f4d('0x5f')](_0x3b47ea[_0x2f4d('0xa')])),'ignore':[path[_0x2f4d('0x50')](path[_0x2f4d('0x60')](_0x3b47ea['path']),_0x2f4d('0x61')),path[_0x2f4d('0x50')](path[_0x2f4d('0x60')](_0x3b47ea['path']),_0x2f4d('0x62'))],'nodir':!![]})[_0x2f4d('0x63')]();_0x521b58['on']('close',function(){if(!fs[_0x2f4d('0x64')](_0x255a66)){throw new db[(_0x2f4d('0x5a'))]['Error'](_0x2f4d('0x65'));}return _0xb1d8b3[_0x2f4d('0x4e')](_0x255a66,util[_0x2f4d('0x52')](_0x2f4d('0x53'),path[_0x2f4d('0x60')](_0x3b47ea[_0x2f4d('0xa')])),function(_0x60d812){if(_0x60d812){throw new db[(_0x2f4d('0x5a'))][(_0x2f4d('0x58'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x2f4d('0x66')](_0x255a66);logger[_0x2f4d('0x67')]('Download\x20completed');logger[_0x2f4d('0x67')](_0x2f4d('0x68'));});});}return null;})[_0x2f4d('0x69')](handleError(_0xb1d8b3,null));};exports[_0x2f4d('0x6a')]=function(_0x3d4a58,_0x159b10,_0xe5466c){var _0x51d1a5=path[_0x2f4d('0x60')](_0x3d4a58['file'][_0x2f4d('0x6b')],path['extname'](_0x3d4a58[_0x2f4d('0x6c')][_0x2f4d('0x6b')]));var _0x1b1584=path[_0x2f4d('0x50')](config[_0x2f4d('0x5e')],_0x2f4d('0x51'),_0x3d4a58[_0x2f4d('0x6c')]['filename']);var _0x202ff1=path[_0x2f4d('0x50')](config[_0x2f4d('0x5e')],_0x2f4d('0x51'),_0x51d1a5);logger[_0x2f4d('0x67')]('Plugin\x20upload\x20filepath:\x20%s',_0x1b1584);logger[_0x2f4d('0x67')](_0x2f4d('0x6d'),_0x202ff1);try{fs['chmodSync'](_0x1b1584,parseInt(_0x2f4d('0x6e'),0x8));extract(_0x1b1584,{'dir':_0x202ff1},function(_0x36bd4b){if(_0x36bd4b){logger[_0x2f4d('0x2e')](_0x36bd4b);handleError(_0x36bd4b,!![]);};var _0x13208f=fs[_0x2f4d('0x6f')](_0x202ff1);if(_0x13208f[_0x2f4d('0x3a')]>0x1){removeReferences(_0x1b1584,_0x202ff1);logger['error'](_0x2f4d('0x70'));return _0xe5466c(new Error('Invalid\x20plugin\x20structure'));}var _0x29951c=fs[_0x2f4d('0x71')](path[_0x2f4d('0x50')](_0x202ff1,_0x13208f[0x0]));if(_0x29951c[_0x2f4d('0x72')]()){removeReferences(_0x1b1584,_0x202ff1);logger[_0x2f4d('0x2e')](_0x2f4d('0x70'));return _0xe5466c(new Error(_0x2f4d('0x70')));}if(_0x29951c[_0x2f4d('0x73')]()){var _0x1fffc6=fs[_0x2f4d('0x6f')](path[_0x2f4d('0x50')](_0x202ff1,_0x13208f[0x0]));if(_0x1fffc6[_0x2f4d('0x3a')]===0x0){removeReferences(_0x1b1584,_0x202ff1);logger['error'](_0x2f4d('0x70'));return _0xe5466c(new Error(_0x2f4d('0x70')));}var _0x522104=_0x1fffc6[_0x2f4d('0x74')](function(_0x303fcf){return _0x303fcf===_0x2f4d('0x75');});if(!_0x522104){return _0xe5466c(new Error(_0x2f4d('0x76')));}var _0x4c03d1=fs[_0x2f4d('0x77')](path[_0x2f4d('0x50')](_0x202ff1,_0x13208f[0x0],_0x2f4d('0x75')));var _0x542b18=JSON[_0x2f4d('0x78')](_0x4c03d1);if(_0x2f4d('0x79')==typeof _0x542b18[_0x2f4d('0x30')]){return _0xe5466c(new Error(_0x2f4d('0x7a')));}if(_0x2f4d('0x79')==typeof _0x542b18['type']){return _0xe5466c(new Error(_0x2f4d('0x7b')));}if(_0x2f4d('0x79')==typeof _0x542b18['version']){return _0xe5466c(new Error(_0x2f4d('0x7c')));}if(_0x2f4d('0x79')==typeof _0x542b18[_0x2f4d('0x7d')]){return _0xe5466c(new Error(_0x2f4d('0x7e')));}if(_0x542b18['type']===_0x2f4d('0x7f')){if('undefined'==typeof _0x542b18[_0x2f4d('0x7d')][_0x2f4d('0x80')]){return _0xe5466c(new Error(_0x2f4d('0x81')));}if(_0x2f4d('0x79')==typeof _0x542b18[_0x2f4d('0x7d')][_0x2f4d('0x80')][_0x2f4d('0x82')]&&_0x2f4d('0x79')==typeof _0x542b18['parameters'][_0x2f4d('0x80')]['agent']){return _0xe5466c(new Error(_0x2f4d('0x83')));}}else if(_0x542b18[_0x2f4d('0x44')]===_0x2f4d('0x84')){if('undefined'==typeof _0x542b18[_0x2f4d('0x7d')]['scriptName']){return _0xe5466c(new Error(_0x2f4d('0x85')));}if(_0x2f4d('0x79')==typeof _0x542b18[_0x2f4d('0x7d')][_0x2f4d('0x86')]){return _0xe5466c(new Error(_0x2f4d('0x87')));}}else{return _0xe5466c(new Error(_0x2f4d('0x88')));}var _0x2fe1ca=_0x542b18[_0x2f4d('0x30')];var _0x1cde49=_0x542b18[_0x2f4d('0x89')];var _0x18efd7=_0x542b18['type'];var _0x1d9377=_0x542b18[_0x2f4d('0x8a')]?_0x542b18['sidebar']:_0x2f4d('0x8b');var _0xb80c68=_0x542b18[_0x2f4d('0x8c')]?_0x542b18[_0x2f4d('0x8c')]:'icon-apps';var _0x2ef6e5='';var _0xe11a7a='';var _0x3ee75f='';var _0x2b3a9c='';var _0x13a537=_0x542b18['version'];if(_0x18efd7===_0x2f4d('0x7f')){if(_0x2f4d('0x79')!=typeof _0x542b18[_0x2f4d('0x7d')][_0x2f4d('0x80')][_0x2f4d('0x82')]){var _0x3de0dd=_0x542b18[_0x2f4d('0x7d')][_0x2f4d('0x80')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x2f4d('0x8d')](_0x3de0dd)){_0x2ef6e5=path[_0x2f4d('0x50')](_0x2f4d('0x8e'),_0x51d1a5,_0x13208f[0x0],_0x3de0dd);}else{_0x2ef6e5=_0x3de0dd;}}else{logger['info'](_0x2f4d('0x8f'));}if(_0x2f4d('0x79')!=typeof _0x542b18[_0x2f4d('0x7d')]['views'][_0x2f4d('0x90')]){var _0x4ca090=_0x542b18[_0x2f4d('0x7d')][_0x2f4d('0x80')][_0x2f4d('0x90')];if(!/^(f|ht)tps?:\/\//i[_0x2f4d('0x8d')](_0x4ca090)){_0xe11a7a=path['join'](_0x2f4d('0x8e'),_0x51d1a5,_0x13208f[0x0],_0x4ca090);}else{_0xe11a7a=_0x4ca090;}}else{logger[_0x2f4d('0x67')](_0x2f4d('0x91'));}}else if(_0x18efd7===_0x2f4d('0x84')){_0x3ee75f=_0x542b18['parameters']['scriptName'];_0x2b3a9c=_0x542b18[_0x2f4d('0x7d')][_0x2f4d('0x86')];if(_0x2f4d('0x79')!=typeof _0x542b18[_0x2f4d('0x7d')][_0x2f4d('0x80')]){if(_0x2f4d('0x79')!=typeof _0x542b18[_0x2f4d('0x7d')]['views']['admin']){var _0x3de0dd=_0x542b18[_0x2f4d('0x7d')][_0x2f4d('0x80')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x2f4d('0x8d')](_0x3de0dd)){_0x2ef6e5=path['join'](_0x2f4d('0x8e'),_0x51d1a5,_0x13208f[0x0],_0x3de0dd);}else{_0x2ef6e5=_0x3de0dd;}}if(_0x2f4d('0x79')!=typeof _0x542b18['parameters'][_0x2f4d('0x80')][_0x2f4d('0x90')]){var _0x4ca090=_0x542b18[_0x2f4d('0x7d')]['views'][_0x2f4d('0x90')];if(!/^(f|ht)tps?:\/\//i[_0x2f4d('0x8d')](_0x4ca090)){_0xe11a7a=path[_0x2f4d('0x50')](_0x2f4d('0x8e'),_0x51d1a5,_0x13208f[0x0],_0x4ca090);}else{_0xe11a7a=_0x4ca090;}}}}var _0x8bcfee={'name':_0x2fe1ca,'description':_0x1cde49,'path':path[_0x2f4d('0x50')](_0x51d1a5,_0x13208f[0x0]),'type':_0x18efd7,'sidebar':_0x1d9377,'icon':_0xb80c68,'adminUrl':_0x2ef6e5,'agentUrl':_0xe11a7a,'scriptName':_0x3ee75f,'scriptPath':_0x2b3a9c,'version':_0x13a537};removeReferences(_0x1b1584,null);return db[_0x2f4d('0x48')]['create'](_0x8bcfee)[_0x2f4d('0x2a')](function(_0x49556e){var _0x3f32f7={'role':_0x3d4a58[_0x2f4d('0x92')][_0x2f4d('0x93')],'userProfileId':_0x3d4a58['body'][_0x2f4d('0x94')]};if(!_0x3f32f7)throw new Error(_0x2f4d('0x95'));if(_0x3f32f7[_0x2f4d('0x93')]===_0x2f4d('0x96')){var _0x3fc19b=_0x49556e[_0x2f4d('0x2c')]({'plain':!![]});return db['UserProfileSection'][_0x2f4d('0x4f')]({'where':{'name':_0x2f4d('0x2d'),'userProfileId':_0x3f32f7[_0x2f4d('0x94')]},'raw':!![]})[_0x2f4d('0x2a')](function(_0x3cd644){if(_0x3cd644&&_0x3cd644[_0x2f4d('0x97')]===0x0){return db[_0x2f4d('0x98')][_0x2f4d('0x99')]({'name':_0x3fc19b['name'],'resourceId':_0x3fc19b['id'],'type':_0x3cd644['name'],'sectionId':_0x3cd644['id']},{})[_0x2f4d('0x2a')](function(){return _0x49556e;});}else{return _0x49556e;}})[_0x2f4d('0x69')](function(_0x582b8b){logger[_0x2f4d('0x2e')](_0x2f4d('0x9a'),_0x582b8b);throw _0x582b8b;});}return _0x49556e;})[_0x2f4d('0x2a')](respondWithResult(_0x159b10,null))[_0x2f4d('0x69')](handleError(_0x159b10,null));}});}catch(_0xd3b2a6){_0x159b10[_0x2f4d('0x22')](0x1f4)['send'](_0xd3b2a6);}};function removeReferences(_0x5c43e5,_0x4a9727){try{if(_0x5c43e5){fs[_0x2f4d('0x66')](_0x5c43e5);logger[_0x2f4d('0x67')]('Zip\x20archive\x20removed');}if(_0x4a9727){rimraf(_0x4a9727,function(){});logger[_0x2f4d('0x67')](_0x2f4d('0x9b'));}}catch(_0x19595a){logger[_0x2f4d('0x2e')](_0x19595a);}}exports[_0x2f4d('0x29')]=function(_0x27892d,_0x25f02d,_0x2a2740){return db[_0x2f4d('0x48')]['find']({'where':{'id':_0x27892d['params']['id']}})[_0x2f4d('0x2a')](handleEntityNotFound(_0x25f02d,null))[_0x2f4d('0x2a')](saveUpdates(_0x27892d[_0x2f4d('0x92')],null))['then'](respondWithResult(_0x25f02d,null))[_0x2f4d('0x69')](handleError(_0x25f02d,null));};exports[_0x2f4d('0x9c')]=function(_0xf23383,_0x3729d8,_0x1e627e){return db[_0x2f4d('0x48')]['find']({'where':{'id':_0xf23383[_0x2f4d('0x4d')]['id']}})[_0x2f4d('0x2a')](function(_0x2df0bf){if(_0x2df0bf){return _0x2df0bf[_0x2f4d('0x2b')]();}})['then'](function(_0x445b85){rimraf(path[_0x2f4d('0x50')](config[_0x2f4d('0x5e')],_0x2f4d('0x51'),path[_0x2f4d('0x5f')](_0x445b85['path'])),function(){});return _0x445b85;})[_0x2f4d('0x2a')](handleEntityNotFound(_0x3729d8,null))['then'](respondWithStatusCode(_0x3729d8,null))['catch'](handleError(_0x3729d8,null));};exports[_0x2f4d('0x9d')]=function(_0x53fdcf,_0xc5472a,_0x46189c){return BPromise['resolve']()[_0x2f4d('0x2a')](function(){if(!_0x53fdcf['query']['path']){throw new Error(_0x2f4d('0x9e'));}if(!_0x53fdcf['query'][_0x2f4d('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x45a5a7=_0x53fdcf['query'][_0x2f4d('0xa0')]?_0x53fdcf[_0x2f4d('0x34')][_0x2f4d('0xa0')]+':'+_0x53fdcf['query']['port']:'http://localhost:'+_0x53fdcf[_0x2f4d('0x34')]['port'];var _0x1426a1=_0x53fdcf[_0x2f4d('0x34')][_0x2f4d('0x23')]?_0x53fdcf['query'][_0x2f4d('0x23')]:!![];var _0x11099c=_0x53fdcf[_0x2f4d('0x34')][_0x2f4d('0xa1')]?_0x53fdcf[_0x2f4d('0x34')][_0x2f4d('0xa1')]:null;var _0xc5596c={'method':_0x53fdcf[_0x2f4d('0xa2')],'uri':util[_0x2f4d('0x52')](_0x2f4d('0xa3'),_0x45a5a7,_0x53fdcf[_0x2f4d('0x34')]['path']),'json':_0x1426a1,'resolveWithFullResponse':!![],'encoding':_0x11099c,'qs':_0x53fdcf[_0x2f4d('0x34')]};if(_0x53fdcf[_0x2f4d('0xa4')]){_0xc5596c[_0x2f4d('0xa4')]=_0x53fdcf[_0x2f4d('0xa4')];if(_0xc5596c[_0x2f4d('0xa4')][_0x2f4d('0xa5')]){delete _0xc5596c[_0x2f4d('0xa4')]['content-length'];}}if(_0xc5596c[_0x2f4d('0xa4')]['content-type']){delete _0xc5596c['headers']['content-type'];}return rp(_0xc5596c);})[_0x2f4d('0x2a')](function(_0x44216a){if(_0x44216a){_0xc5472a[_0x2f4d('0x26')](_0x44216a[_0x2f4d('0xa4')]);logger[_0x2f4d('0x67')](_0x44216a[_0x2f4d('0x92')]);if(_[_0x2f4d('0xa6')](_0x53fdcf[_0x2f4d('0x34')][_0x2f4d('0xa')],_0x2f4d('0x4e'))&&_0x44216a[_0x2f4d('0xa7')]==0x1f4){return _0xc5472a[_0x2f4d('0x20')](_0x44216a['statusCode']);}else{return _0xc5472a[_0x2f4d('0x22')](_0x44216a[_0x2f4d('0xa7')])[_0x2f4d('0xa8')](_0x44216a['body']);}}else{return _0xc5472a[_0x2f4d('0x20')](0xc8);}})[_0x2f4d('0x69')](handleError(_0xc5472a,null));};exports[_0x2f4d('0xa9')]=function(_0x41b311,_0x3bc23c,_0x3ca32c){return BPromise[_0x2f4d('0xaa')]()['then'](function(){if(!_0x41b311['query'][_0x2f4d('0xa')]){throw new Error(_0x2f4d('0x9e'));}if(!_0x41b311[_0x2f4d('0x34')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x19da0d=_0x41b311[_0x2f4d('0x34')][_0x2f4d('0xa0')]?_0x41b311[_0x2f4d('0x34')][_0x2f4d('0xa0')]+':'+_0x41b311['query'][_0x2f4d('0x9f')]:_0x2f4d('0xab')+_0x41b311[_0x2f4d('0x34')][_0x2f4d('0x9f')];var _0x472fec=_0x41b311[_0x2f4d('0x34')][_0x2f4d('0x23')]?_0x41b311[_0x2f4d('0x34')][_0x2f4d('0x23')]:!![];var _0x3c04eb=_0x41b311[_0x2f4d('0x34')][_0x2f4d('0xa1')]?_0x41b311[_0x2f4d('0x34')]['encoding']:null;var _0x3f1a25={'method':_0x41b311[_0x2f4d('0xa2')],'uri':util[_0x2f4d('0x52')](_0x2f4d('0xa3'),_0x19da0d,_0x41b311[_0x2f4d('0x34')][_0x2f4d('0xa')]),'json':_0x472fec,'resolveWithFullResponse':!![],'encoding':_0x3c04eb,'body':_0x41b311[_0x2f4d('0x92')]};if(_0x41b311[_0x2f4d('0xa4')]){_0x3f1a25[_0x2f4d('0xa4')]=_0x41b311[_0x2f4d('0xa4')];if(_0x3f1a25[_0x2f4d('0xa4')][_0x2f4d('0xa5')]){delete _0x3f1a25[_0x2f4d('0xa4')]['content-length'];}}if(_0x3f1a25[_0x2f4d('0xa4')][_0x2f4d('0xac')]){delete _0x3f1a25[_0x2f4d('0xa4')][_0x2f4d('0xac')];}return rp(_0x3f1a25);})[_0x2f4d('0x2a')](function(_0x31d967){if(_0x31d967){_0x3bc23c[_0x2f4d('0x26')](_0x31d967[_0x2f4d('0xa4')]);logger[_0x2f4d('0x67')](_0x31d967[_0x2f4d('0x92')]);return _0x3bc23c[_0x2f4d('0x22')](_0x31d967[_0x2f4d('0xa7')])[_0x2f4d('0xa8')](_0x31d967[_0x2f4d('0x92')]);}else{return _0x3bc23c[_0x2f4d('0x20')](0xc8);}})[_0x2f4d('0x69')](handleError(_0x3bc23c,null));}; \ No newline at end of file +var _0x5fb1=['some','manifest.json','Plugin\x20manifest\x20missing','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','find','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','endsWith','statusCode','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','extract-zip','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','./plugin.socket','register','sendStatus','end','status','json','count','offset','set','Content-Range','apply','update','then','get','UserProfileResource','destroy','stack','name','send','index','Plugin','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','map','type','key','filter','options','includeAll','include','findAll','rows','catch','show','params','download','join','root','server/files/plugins','format','createWriteStream','warning','ENOENT','error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Error','Error\x20while\x20downloading\x20the\x20plugin','Download\x20completed','Temporary\x20file\x20removed','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','info','Plugin\x20upload\x20destination:\x20%s','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync'];(function(_0x491830,_0x271639){var _0x41e4da=function(_0x383b70){while(--_0x383b70){_0x491830['push'](_0x491830['shift']());}};_0x41e4da(++_0x271639);}(_0x5fb1,0x198));var _0x15fb=function(_0x1ac120,_0x3e7e45){_0x1ac120=_0x1ac120-0x0;var _0x19b703=_0x5fb1[_0x1ac120];return _0x19b703;};'use strict';var pdf=require(_0x15fb('0x0'));var emlformat=require(_0x15fb('0x1'));var rimraf=require(_0x15fb('0x2'));var zipdir=require(_0x15fb('0x3'));var jsonpatch=require(_0x15fb('0x4'));var rp=require(_0x15fb('0x5'));var moment=require(_0x15fb('0x6'));var BPromise=require(_0x15fb('0x7'));var Mustache=require(_0x15fb('0x8'));var util=require('util');var path=require(_0x15fb('0x9'));var sox=require('sox');var csv=require(_0x15fb('0xa'));var ejs=require(_0x15fb('0xb'));var fs=require('fs');var _=require(_0x15fb('0xc'));var squel=require(_0x15fb('0xd'));var crypto=require(_0x15fb('0xe'));var jsforce=require(_0x15fb('0xf'));var deskjs=require(_0x15fb('0x10'));var toCsv=require(_0x15fb('0xa'));var querystring=require(_0x15fb('0x11'));var Papa=require(_0x15fb('0x12'));var extract=require(_0x15fb('0x13'));var rimraf=require(_0x15fb('0x2'));var archiver=require('archiver');var Redis=require(_0x15fb('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x15fb('0x15'));var hardwareService=require(_0x15fb('0x16'));var logger=require(_0x15fb('0x17'))('api');var utils=require(_0x15fb('0x18'));var config=require('../../config/environment');var db=require(_0x15fb('0x19'))['db'];config[_0x15fb('0x1a')]=_[_0x15fb('0x1b')](config[_0x15fb('0x1a')],{'host':_0x15fb('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x15fb('0x1a')]));require(_0x15fb('0x1d'))[_0x15fb('0x1e')](socket);function respondWithStatusCode(_0x194725,_0x65bc4a){_0x65bc4a=_0x65bc4a||0xcc;return function(_0x3309f9){if(_0x3309f9){return _0x194725[_0x15fb('0x1f')](_0x65bc4a);}return _0x194725['status'](_0x65bc4a)[_0x15fb('0x20')]();};}function respondWithResult(_0x1f7b88,_0x36fcd1){_0x36fcd1=_0x36fcd1||0xc8;return function(_0x290e37){if(_0x290e37){return _0x1f7b88[_0x15fb('0x21')](_0x36fcd1)[_0x15fb('0x22')](_0x290e37);}};}function respondWithFilteredResult(_0x3f0f9e,_0x49f1b7){return function(_0x55289c){if(_0x55289c){var _0x5b7556=_0x55289c[_0x15fb('0x23')],_0x1ac479=_0x49f1b7[_0x15fb('0x24')],_0x54dc31=_0x49f1b7[_0x15fb('0x24')]+_0x49f1b7['limit'],_0xb62cca;if(_0x54dc31>=_0x5b7556){_0x54dc31=_0x5b7556;_0xb62cca=0xc8;}else{_0xb62cca=0xce;}_0x3f0f9e[_0x15fb('0x21')](_0xb62cca);return _0x3f0f9e[_0x15fb('0x25')](_0x15fb('0x26'),_0x1ac479+'-'+_0x54dc31+'/'+_0x5b7556)['json'](_0x55289c);}return null;};}function patchUpdates(_0x272ca6){return function(_0x397e9c){try{jsonpatch[_0x15fb('0x27')](_0x397e9c,_0x272ca6,!![]);}catch(_0x2776fd){return BPromise['reject'](_0x2776fd);}return _0x397e9c['save']();};}function saveUpdates(_0x4ae471,_0x48a4ad){return function(_0x263b33){if(_0x263b33){return _0x263b33[_0x15fb('0x28')](_0x4ae471)[_0x15fb('0x29')](function(_0xe73f79){return _0xe73f79;});}return null;};}function removeEntity(_0x448964,_0xd4c154){return function(_0xf6cef8){if(_0xf6cef8){return _0xf6cef8['destroy']()[_0x15fb('0x29')](function(){var _0x117b2c=_0xf6cef8[_0x15fb('0x2a')]({'plain':!![]});var _0x2dc9cd='Plugins';return db[_0x15fb('0x2b')][_0x15fb('0x2c')]({'where':{'type':_0x2dc9cd,'resourceId':_0x117b2c['id']}})[_0x15fb('0x29')](function(){return _0xf6cef8;});})[_0x15fb('0x29')](function(){_0x448964[_0x15fb('0x21')](0xcc)[_0x15fb('0x20')]();});}};}function handleEntityNotFound(_0x481689,_0x4f8e35){return function(_0x4c3617){if(!_0x4c3617){_0x481689[_0x15fb('0x1f')](0x194);}return _0x4c3617;};}function handleError(_0x119338,_0x16cd06){_0x16cd06=_0x16cd06||0x1f4;return function(_0x44ac07){logger['error'](_0x44ac07[_0x15fb('0x2d')]);if(_0x44ac07[_0x15fb('0x2e')]){delete _0x44ac07[_0x15fb('0x2e')];}_0x119338[_0x15fb('0x21')](_0x16cd06)[_0x15fb('0x2f')](_0x44ac07);};}exports[_0x15fb('0x30')]=function(_0x4c9839,_0x102e50){var _0x16b0ce={},_0x370deb={},_0x942644={'count':0x0,'rows':[]};var _0x29f94f=db[_0x15fb('0x31')][_0x15fb('0x32')];_0x370deb[_0x15fb('0x33')]=_[_0x15fb('0x34')](_0x29f94f);_0x370deb[_0x15fb('0x35')]=_['keys'](_0x4c9839[_0x15fb('0x35')]);_0x370deb[_0x15fb('0x36')]=_[_0x15fb('0x37')](_0x370deb[_0x15fb('0x33')],_0x370deb[_0x15fb('0x35')]);_0x16b0ce[_0x15fb('0x38')]=_[_0x15fb('0x37')](_0x370deb[_0x15fb('0x33')],qs['fields'](_0x4c9839[_0x15fb('0x35')][_0x15fb('0x39')]));_0x16b0ce[_0x15fb('0x38')]=_0x16b0ce[_0x15fb('0x38')][_0x15fb('0x3a')]?_0x16b0ce['attributes']:_0x370deb['model'];if(!_0x4c9839[_0x15fb('0x35')][_0x15fb('0x3b')](_0x15fb('0x3c'))){_0x16b0ce[_0x15fb('0x3d')]=qs[_0x15fb('0x3d')](_0x4c9839[_0x15fb('0x35')][_0x15fb('0x3d')]);_0x16b0ce[_0x15fb('0x24')]=qs[_0x15fb('0x24')](_0x4c9839['query'][_0x15fb('0x24')]);}_0x16b0ce[_0x15fb('0x3e')]=qs[_0x15fb('0x3f')](_0x4c9839[_0x15fb('0x35')][_0x15fb('0x3f')]);_0x16b0ce['where']=qs[_0x15fb('0x36')](_[_0x15fb('0x40')](_0x4c9839[_0x15fb('0x35')],_0x370deb['filters']));if(_0x4c9839[_0x15fb('0x35')]['filter']){_0x16b0ce[_0x15fb('0x41')]=_[_0x15fb('0x42')](_0x16b0ce[_0x15fb('0x41')],{'$or':_[_0x15fb('0x43')](_0x29f94f,function(_0x4eb5fa){if(_0x4eb5fa[_0x15fb('0x44')][_0x15fb('0x45')]!=='VIRTUAL'){var _0x31cf70={};_0x31cf70[_0x4eb5fa['field']]={'$like':'%'+_0x4c9839[_0x15fb('0x35')][_0x15fb('0x46')]+'%'};return _0x31cf70;}})});}_0x16b0ce=_[_0x15fb('0x42')]({},_0x16b0ce,_0x4c9839[_0x15fb('0x47')]);var _0x2f796d={'where':_0x16b0ce[_0x15fb('0x41')]};return db['Plugin']['count'](_0x2f796d)[_0x15fb('0x29')](function(_0x144344){_0x942644[_0x15fb('0x23')]=_0x144344;if(_0x4c9839[_0x15fb('0x35')][_0x15fb('0x48')]){_0x16b0ce[_0x15fb('0x49')]=[{'all':!![]}];}return db['Plugin'][_0x15fb('0x4a')](_0x16b0ce);})['then'](function(_0x51d958){_0x942644[_0x15fb('0x4b')]=_0x51d958;return _0x942644;})['then'](respondWithFilteredResult(_0x102e50,_0x16b0ce))[_0x15fb('0x4c')](handleError(_0x102e50,null));};exports[_0x15fb('0x4d')]=function(_0x2f7f74,_0x45c836){var _0x1c44ad={'raw':!![],'where':{'id':_0x2f7f74[_0x15fb('0x4e')]['id']}},_0x4aeb5b={};_0x4aeb5b[_0x15fb('0x33')]=_['keys'](db[_0x15fb('0x31')][_0x15fb('0x32')]);_0x4aeb5b[_0x15fb('0x35')]=_[_0x15fb('0x34')](_0x2f7f74[_0x15fb('0x35')]);_0x4aeb5b[_0x15fb('0x36')]=_[_0x15fb('0x37')](_0x4aeb5b[_0x15fb('0x33')],_0x4aeb5b[_0x15fb('0x35')]);_0x1c44ad[_0x15fb('0x38')]=_[_0x15fb('0x37')](_0x4aeb5b['model'],qs['fields'](_0x2f7f74[_0x15fb('0x35')][_0x15fb('0x39')]));_0x1c44ad['attributes']=_0x1c44ad[_0x15fb('0x38')][_0x15fb('0x3a')]?_0x1c44ad[_0x15fb('0x38')]:_0x4aeb5b[_0x15fb('0x33')];if(_0x2f7f74['query'][_0x15fb('0x48')]){_0x1c44ad[_0x15fb('0x49')]=[{'all':!![]}];}_0x1c44ad=_[_0x15fb('0x42')]({},_0x1c44ad,_0x2f7f74[_0x15fb('0x47')]);return db[_0x15fb('0x31')]['find'](_0x1c44ad)[_0x15fb('0x29')](handleEntityNotFound(_0x45c836,null))[_0x15fb('0x29')](respondWithResult(_0x45c836,null))[_0x15fb('0x4c')](handleError(_0x45c836,null));};exports[_0x15fb('0x4f')]=function(_0x294461,_0x35439a,_0xd0a737){return db[_0x15fb('0x31')]['find']({'where':{'id':_0x294461[_0x15fb('0x4e')]['id']},'attributes':[_0x15fb('0x2e'),_0x15fb('0x9')],'raw':!![]})[_0x15fb('0x29')](handleEntityNotFound(_0x35439a,null))['then'](function(_0x38981b){if(_0x38981b){var _0x850331=path[_0x15fb('0x50')](config[_0x15fb('0x51')],_0x15fb('0x52'),util[_0x15fb('0x53')]('%s.zip',path['basename'](_0x38981b[_0x15fb('0x9')])));var _0x1bb68c=fs[_0x15fb('0x54')](_0x850331);var _0x25745b=archiver('zip',{'zlib':{'level':0x9}});_0x25745b['on'](_0x15fb('0x55'),function(_0x24e056){if(_0x24e056['code']===_0x15fb('0x56')){logger[_0x15fb('0x57')](_0x24e056);}else{throw new db[(_0x15fb('0x58'))]['Error'](_0x15fb('0x59'));}});_0x25745b['on'](_0x15fb('0x57'),function(_0x15547e){throw new db['Sequelize']['Error'](_0x15fb('0x59'));});_0x25745b['pipe'](_0x1bb68c);_0x25745b[_0x15fb('0x5a')](_0x15fb('0x5b'),{'cwd':path[_0x15fb('0x50')](config[_0x15fb('0x51')],_0x15fb('0x52'),path[_0x15fb('0x5c')](_0x38981b['path'])),'ignore':[path[_0x15fb('0x50')](path[_0x15fb('0x5d')](_0x38981b['path']),_0x15fb('0x5e')),path[_0x15fb('0x50')](path[_0x15fb('0x5d')](_0x38981b['path']),_0x15fb('0x5f'))],'nodir':!![]})[_0x15fb('0x60')]();_0x1bb68c['on'](_0x15fb('0x61'),function(){if(!fs[_0x15fb('0x62')](_0x850331)){throw new db[(_0x15fb('0x58'))]['Error']('Plugin\x20not\x20found');}return _0x35439a[_0x15fb('0x4f')](_0x850331,util[_0x15fb('0x53')]('%s.zip',path['basename'](_0x38981b['path'])),function(_0xa9a5ad){if(_0xa9a5ad){throw new db[(_0x15fb('0x58'))][(_0x15fb('0x63'))](_0x15fb('0x64'));}fs['unlinkSync'](_0x850331);logger['info'](_0x15fb('0x65'));logger['info'](_0x15fb('0x66'));});});}return null;})['catch'](handleError(_0x35439a,null));};exports['upload']=function(_0x1c8a47,_0x3e6ce9,_0x25b1f2){var _0x66d871=path[_0x15fb('0x5d')](_0x1c8a47['file'][_0x15fb('0x67')],path[_0x15fb('0x68')](_0x1c8a47[_0x15fb('0x69')]['filename']));var _0x1c576b=path['join'](config['root'],'server/files/plugins',_0x1c8a47[_0x15fb('0x69')][_0x15fb('0x67')]);var _0x17b432=path['join'](config[_0x15fb('0x51')],'server/files/plugins',_0x66d871);logger['info'](_0x15fb('0x6a'),_0x1c576b);logger[_0x15fb('0x6b')](_0x15fb('0x6c'),_0x17b432);try{fs['chmodSync'](_0x1c576b,parseInt('0777',0x8));extract(_0x1c576b,{'dir':_0x17b432},function(_0xc3b1c8){if(_0xc3b1c8){logger[_0x15fb('0x57')](_0xc3b1c8);handleError(_0xc3b1c8,!![]);};var _0x186bea=fs['readdirSync'](_0x17b432);if(_0x186bea[_0x15fb('0x3a')]>0x1){removeReferences(_0x1c576b,_0x17b432);logger['error'](_0x15fb('0x6d'));return _0x25b1f2(new Error(_0x15fb('0x6d')));}var _0x112afc=fs[_0x15fb('0x6e')](path[_0x15fb('0x50')](_0x17b432,_0x186bea[0x0]));if(_0x112afc[_0x15fb('0x6f')]()){removeReferences(_0x1c576b,_0x17b432);logger[_0x15fb('0x57')](_0x15fb('0x6d'));return _0x25b1f2(new Error('Invalid\x20plugin\x20structure'));}if(_0x112afc[_0x15fb('0x70')]()){var _0x21d389=fs[_0x15fb('0x71')](path[_0x15fb('0x50')](_0x17b432,_0x186bea[0x0]));if(_0x21d389[_0x15fb('0x3a')]===0x0){removeReferences(_0x1c576b,_0x17b432);logger[_0x15fb('0x57')](_0x15fb('0x6d'));return _0x25b1f2(new Error(_0x15fb('0x6d')));}var _0x1215d2=_0x21d389[_0x15fb('0x72')](function(_0x12df3a){return _0x12df3a===_0x15fb('0x73');});if(!_0x1215d2){return _0x25b1f2(new Error(_0x15fb('0x74')));}var _0x469870=fs['readFileSync'](path[_0x15fb('0x50')](_0x17b432,_0x186bea[0x0],_0x15fb('0x73')));var _0x4b28de=JSON[_0x15fb('0x75')](_0x469870);if(_0x15fb('0x76')==typeof _0x4b28de[_0x15fb('0x2e')]){return _0x25b1f2(new Error(_0x15fb('0x77')));}if(_0x15fb('0x76')==typeof _0x4b28de[_0x15fb('0x44')]){return _0x25b1f2(new Error(_0x15fb('0x78')));}if(_0x15fb('0x76')==typeof _0x4b28de[_0x15fb('0x79')]){return _0x25b1f2(new Error(_0x15fb('0x7a')));}if(_0x15fb('0x76')==typeof _0x4b28de[_0x15fb('0x7b')]){return _0x25b1f2(new Error(_0x15fb('0x7c')));}if(_0x4b28de[_0x15fb('0x44')]===_0x15fb('0x7d')){if('undefined'==typeof _0x4b28de[_0x15fb('0x7b')][_0x15fb('0x7e')]){return _0x25b1f2(new Error(_0x15fb('0x7f')));}if(_0x15fb('0x76')==typeof _0x4b28de[_0x15fb('0x7b')][_0x15fb('0x7e')][_0x15fb('0x80')]&&_0x15fb('0x76')==typeof _0x4b28de[_0x15fb('0x7b')][_0x15fb('0x7e')]['agent']){return _0x25b1f2(new Error(_0x15fb('0x81')));}}else if(_0x4b28de[_0x15fb('0x44')]===_0x15fb('0x82')){if(_0x15fb('0x76')==typeof _0x4b28de[_0x15fb('0x7b')][_0x15fb('0x83')]){return _0x25b1f2(new Error(_0x15fb('0x84')));}if(_0x15fb('0x76')==typeof _0x4b28de[_0x15fb('0x7b')][_0x15fb('0x85')]){return _0x25b1f2(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x25b1f2(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x19b9e7=_0x4b28de[_0x15fb('0x2e')];var _0x461919=_0x4b28de[_0x15fb('0x86')];var _0xfd113d=_0x4b28de['type'];var _0x557f1e=_0x4b28de[_0x15fb('0x87')]?_0x4b28de['sidebar']:_0x15fb('0x88');var _0x55c656=_0x4b28de[_0x15fb('0x89')]?_0x4b28de[_0x15fb('0x89')]:_0x15fb('0x8a');var _0x41113f='';var _0x395e08='';var _0x52a7d4='';var _0x14aa19='';var _0x566db6=_0x4b28de[_0x15fb('0x79')];if(_0xfd113d===_0x15fb('0x7d')){if('undefined'!=typeof _0x4b28de[_0x15fb('0x7b')][_0x15fb('0x7e')]['admin']){var _0x3f4285=_0x4b28de[_0x15fb('0x7b')][_0x15fb('0x7e')][_0x15fb('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x15fb('0x8b')](_0x3f4285)){_0x41113f=path[_0x15fb('0x50')](_0x15fb('0x8c'),_0x66d871,_0x186bea[0x0],_0x3f4285);}else{_0x41113f=_0x3f4285;}}else{logger[_0x15fb('0x6b')](_0x15fb('0x8d'));}if(_0x15fb('0x76')!=typeof _0x4b28de[_0x15fb('0x7b')][_0x15fb('0x7e')][_0x15fb('0x8e')]){var _0xcc2cfb=_0x4b28de[_0x15fb('0x7b')]['views'][_0x15fb('0x8e')];if(!/^(f|ht)tps?:\/\//i[_0x15fb('0x8b')](_0xcc2cfb)){_0x395e08=path[_0x15fb('0x50')](_0x15fb('0x8c'),_0x66d871,_0x186bea[0x0],_0xcc2cfb);}else{_0x395e08=_0xcc2cfb;}}else{logger[_0x15fb('0x6b')](_0x15fb('0x8f'));}}else if(_0xfd113d===_0x15fb('0x82')){_0x52a7d4=_0x4b28de[_0x15fb('0x7b')][_0x15fb('0x83')];_0x14aa19=_0x4b28de[_0x15fb('0x7b')][_0x15fb('0x85')];if(_0x15fb('0x76')!=typeof _0x4b28de[_0x15fb('0x7b')]['views']){if(_0x15fb('0x76')!=typeof _0x4b28de['parameters']['views'][_0x15fb('0x80')]){var _0x3f4285=_0x4b28de['parameters'][_0x15fb('0x7e')][_0x15fb('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x15fb('0x8b')](_0x3f4285)){_0x41113f=path[_0x15fb('0x50')](_0x15fb('0x8c'),_0x66d871,_0x186bea[0x0],_0x3f4285);}else{_0x41113f=_0x3f4285;}}if(_0x15fb('0x76')!=typeof _0x4b28de[_0x15fb('0x7b')][_0x15fb('0x7e')][_0x15fb('0x8e')]){var _0xcc2cfb=_0x4b28de['parameters'][_0x15fb('0x7e')][_0x15fb('0x8e')];if(!/^(f|ht)tps?:\/\//i[_0x15fb('0x8b')](_0xcc2cfb)){_0x395e08=path[_0x15fb('0x50')](_0x15fb('0x8c'),_0x66d871,_0x186bea[0x0],_0xcc2cfb);}else{_0x395e08=_0xcc2cfb;}}}}var _0x4f87e9={'name':_0x19b9e7,'description':_0x461919,'path':path['join'](_0x66d871,_0x186bea[0x0]),'type':_0xfd113d,'sidebar':_0x557f1e,'icon':_0x55c656,'adminUrl':_0x41113f,'agentUrl':_0x395e08,'scriptName':_0x52a7d4,'scriptPath':_0x14aa19,'version':_0x566db6};removeReferences(_0x1c576b,null);return db[_0x15fb('0x31')][_0x15fb('0x90')](_0x4f87e9)[_0x15fb('0x29')](function(_0x74ff9e){var _0x343b86={'role':_0x1c8a47[_0x15fb('0x91')][_0x15fb('0x92')],'userProfileId':_0x1c8a47['body']['userProfileId']};if(!_0x343b86)throw new Error(_0x15fb('0x93'));if(_0x343b86[_0x15fb('0x92')]===_0x15fb('0x94')){var _0xaecb9c=_0x74ff9e['get']({'plain':!![]});return db[_0x15fb('0x95')]['find']({'where':{'name':_0x15fb('0x96'),'userProfileId':_0x343b86[_0x15fb('0x97')]},'raw':!![]})[_0x15fb('0x29')](function(_0x51c500){if(_0x51c500&&_0x51c500[_0x15fb('0x98')]===0x0){return db[_0x15fb('0x2b')][_0x15fb('0x90')]({'name':_0xaecb9c[_0x15fb('0x2e')],'resourceId':_0xaecb9c['id'],'type':_0x51c500[_0x15fb('0x2e')],'sectionId':_0x51c500['id']},{})[_0x15fb('0x29')](function(){return _0x74ff9e;});}else{return _0x74ff9e;}})[_0x15fb('0x4c')](function(_0x3b5798){logger[_0x15fb('0x57')](_0x15fb('0x99'),_0x3b5798);throw _0x3b5798;});}return _0x74ff9e;})[_0x15fb('0x29')](respondWithResult(_0x3e6ce9,null))['catch'](handleError(_0x3e6ce9,null));}});}catch(_0x1477d5){_0x3e6ce9[_0x15fb('0x21')](0x1f4)['send'](_0x1477d5);}};function removeReferences(_0x41321d,_0x476a78){try{if(_0x41321d){fs[_0x15fb('0x9a')](_0x41321d);logger['info'](_0x15fb('0x9b'));}if(_0x476a78){rimraf(_0x476a78,function(){});logger[_0x15fb('0x6b')](_0x15fb('0x9c'));}}catch(_0x55f0da){logger[_0x15fb('0x57')](_0x55f0da);}}exports['update']=function(_0x25122e,_0x2399d8,_0x5d70bb){return db[_0x15fb('0x31')][_0x15fb('0x9d')]({'where':{'id':_0x25122e[_0x15fb('0x4e')]['id']}})[_0x15fb('0x29')](handleEntityNotFound(_0x2399d8,null))['then'](saveUpdates(_0x25122e[_0x15fb('0x91')],null))[_0x15fb('0x29')](respondWithResult(_0x2399d8,null))[_0x15fb('0x4c')](handleError(_0x2399d8,null));};exports[_0x15fb('0x9e')]=function(_0x5a84eb,_0x2beaca,_0x589353){return db[_0x15fb('0x31')][_0x15fb('0x9d')]({'where':{'id':_0x5a84eb[_0x15fb('0x4e')]['id']}})[_0x15fb('0x29')](function(_0x310e11){if(_0x310e11){return _0x310e11[_0x15fb('0x2c')]();}})[_0x15fb('0x29')](function(_0x381218){rimraf(path[_0x15fb('0x50')](config[_0x15fb('0x51')],_0x15fb('0x52'),path[_0x15fb('0x5c')](_0x381218[_0x15fb('0x9')])),function(){});return _0x381218;})[_0x15fb('0x29')](handleEntityNotFound(_0x2beaca,null))['then'](respondWithStatusCode(_0x2beaca,null))[_0x15fb('0x4c')](handleError(_0x2beaca,null));};exports[_0x15fb('0x9f')]=function(_0x37ab78,_0x5e6130,_0x29f8b1){return BPromise[_0x15fb('0xa0')]()[_0x15fb('0x29')](function(){if(!_0x37ab78[_0x15fb('0x35')]['path']){throw new Error(_0x15fb('0xa1'));}if(!_0x37ab78[_0x15fb('0x35')][_0x15fb('0xa2')]){throw new Error(_0x15fb('0xa3'));}var _0x3782fc=_0x37ab78[_0x15fb('0x35')][_0x15fb('0xa4')]?_0x37ab78[_0x15fb('0x35')]['hostname']+':'+_0x37ab78[_0x15fb('0x35')][_0x15fb('0xa2')]:_0x15fb('0xa5')+_0x37ab78[_0x15fb('0x35')][_0x15fb('0xa2')];var _0x55cca6=_0x37ab78[_0x15fb('0x35')]['json']?_0x37ab78[_0x15fb('0x35')][_0x15fb('0x22')]:!![];var _0x1ffc3d=_0x37ab78['query'][_0x15fb('0xa6')]?_0x37ab78[_0x15fb('0x35')][_0x15fb('0xa6')]:null;var _0x5a80df={'method':_0x37ab78[_0x15fb('0xa7')],'uri':util[_0x15fb('0x53')](_0x15fb('0xa8'),_0x3782fc,_0x37ab78[_0x15fb('0x35')][_0x15fb('0x9')]),'json':_0x55cca6,'resolveWithFullResponse':!![],'encoding':_0x1ffc3d,'qs':_0x37ab78['query']};if(_0x37ab78[_0x15fb('0xa9')]){_0x5a80df[_0x15fb('0xa9')]=_0x37ab78[_0x15fb('0xa9')];if(_0x5a80df[_0x15fb('0xa9')][_0x15fb('0xaa')]){delete _0x5a80df[_0x15fb('0xa9')][_0x15fb('0xaa')];}}if(_0x5a80df[_0x15fb('0xa9')][_0x15fb('0xab')]){delete _0x5a80df['headers'][_0x15fb('0xab')];}return rp(_0x5a80df);})[_0x15fb('0x29')](function(_0x1b87c7){if(_0x1b87c7){_0x5e6130['set'](_0x1b87c7[_0x15fb('0xa9')]);logger['info'](_0x1b87c7[_0x15fb('0x91')]);if(_[_0x15fb('0xac')](_0x37ab78['query'][_0x15fb('0x9')],'download')&&_0x1b87c7['statusCode']==0x1f4){return _0x5e6130[_0x15fb('0x1f')](_0x1b87c7[_0x15fb('0xad')]);}else{return _0x5e6130[_0x15fb('0x21')](_0x1b87c7[_0x15fb('0xad')])[_0x15fb('0x2f')](_0x1b87c7[_0x15fb('0x91')]);}}else{return _0x5e6130[_0x15fb('0x1f')](0xc8);}})[_0x15fb('0x4c')](handleError(_0x5e6130,null));};exports['webhookPost']=function(_0x1af662,_0x131871,_0x245bfd){return BPromise[_0x15fb('0xa0')]()[_0x15fb('0x29')](function(){if(!_0x1af662['query'][_0x15fb('0x9')]){throw new Error(_0x15fb('0xa1'));}if(!_0x1af662[_0x15fb('0x35')][_0x15fb('0xa2')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x19448a=_0x1af662[_0x15fb('0x35')][_0x15fb('0xa4')]?_0x1af662[_0x15fb('0x35')][_0x15fb('0xa4')]+':'+_0x1af662[_0x15fb('0x35')][_0x15fb('0xa2')]:_0x15fb('0xa5')+_0x1af662['query'][_0x15fb('0xa2')];var _0x48d4d2=_0x1af662['query'][_0x15fb('0x22')]?_0x1af662[_0x15fb('0x35')]['json']:!![];var _0x134ab8=_0x1af662[_0x15fb('0x35')][_0x15fb('0xa6')]?_0x1af662['query'][_0x15fb('0xa6')]:null;var _0x4f1cbe={'method':_0x1af662[_0x15fb('0xa7')],'uri':util[_0x15fb('0x53')]('%s%s',_0x19448a,_0x1af662[_0x15fb('0x35')][_0x15fb('0x9')]),'json':_0x48d4d2,'resolveWithFullResponse':!![],'encoding':_0x134ab8,'body':_0x1af662[_0x15fb('0x91')]};if(_0x1af662[_0x15fb('0xa9')]){_0x4f1cbe[_0x15fb('0xa9')]=_0x1af662[_0x15fb('0xa9')];if(_0x4f1cbe[_0x15fb('0xa9')]['content-length']){delete _0x4f1cbe[_0x15fb('0xa9')]['content-length'];}}if(_0x4f1cbe[_0x15fb('0xa9')][_0x15fb('0xab')]){delete _0x4f1cbe[_0x15fb('0xa9')][_0x15fb('0xab')];}return rp(_0x4f1cbe);})['then'](function(_0x1ed674){if(_0x1ed674){_0x131871[_0x15fb('0x25')](_0x1ed674[_0x15fb('0xa9')]);logger[_0x15fb('0x6b')](_0x1ed674[_0x15fb('0x91')]);return _0x131871[_0x15fb('0x21')](_0x1ed674[_0x15fb('0xad')])[_0x15fb('0x2f')](_0x1ed674[_0x15fb('0x91')]);}else{return _0x131871['sendStatus'](0xc8);}})[_0x15fb('0x4c')](handleError(_0x131871,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index f5c7485..1e17d4a 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 _0xc0a7=['exports','events','../../mysqldb','Plugin','setMaxListeners','save','update','emit','hook'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xc0a7,0x1ba));var _0x7c0a=function(_0x22c477,_0x120b08){_0x22c477=_0x22c477-0x0;var _0x2879fa=_0xc0a7[_0x22c477];return _0x2879fa;};'use strict';var EventEmitter=require(_0x7c0a('0x0'));var Plugin=require(_0x7c0a('0x1'))['db'][_0x7c0a('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x7c0a('0x3')](0x0);var events={'afterCreate':_0x7c0a('0x4'),'afterUpdate':_0x7c0a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x465178){return function(_0x415d83,_0x32c84d,_0x222d22){PluginEvents[_0x7c0a('0x6')](_0x465178+':'+_0x415d83['id'],_0x415d83);PluginEvents[_0x7c0a('0x6')](_0x465178,_0x415d83);_0x222d22(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x7c0a('0x7')](e,emitEvent(event));}}module[_0x7c0a('0x8')]=PluginEvents; \ No newline at end of file +var _0xb22a=['hook','exports','../../mysqldb','Plugin','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xb22a,0x80));var _0xab22=function(_0x402731,_0x43c115){_0x402731=_0x402731-0x0;var _0x111736=_0xb22a[_0x402731];return _0x111736;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xab22('0x0'))['db'][_0xab22('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xab22('0x2')](0x0);var events={'afterCreate':_0xab22('0x3'),'afterUpdate':_0xab22('0x4'),'afterDestroy':_0xab22('0x5')};function emitEvent(_0x32754f){return function(_0x2ffa63,_0x25490a,_0x38b986){PluginEvents['emit'](_0x32754f+':'+_0x2ffa63['id'],_0x2ffa63);PluginEvents['emit'](_0x32754f,_0x2ffa63);_0x38b986(null);};}for(var e in events){if(events[_0xab22('0x6')](e)){var event=events[e];Plugin[_0xab22('0x7')](e,emitEvent(event));}}module[_0xab22('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index e20ac46..900f1ae 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 _0xcebb=['bluebird','path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','lodash','util','moment'];(function(_0x1f24d7,_0x7feeeb){var _0x3ff5b4=function(_0x552010){while(--_0x552010){_0x1f24d7['push'](_0x1f24d7['shift']());}};_0x3ff5b4(++_0x7feeeb);}(_0xcebb,0x8c));var _0xbceb=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xcebb[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require(_0xbceb('0x0'));var util=require(_0xbceb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbceb('0x2'));var BPromise=require(_0xbceb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbceb('0x4'));var rimraf=require(_0xbceb('0x5'));var config=require(_0xbceb('0x6'));var attributes=require(_0xbceb('0x7'));module[_0xbceb('0x8')]=function(_0xd89ca1,_0x3a7731){return _0xd89ca1[_0xbceb('0x9')](_0xbceb('0xa'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d64=['exports','define','Plugin','plugins','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./plugin.attributes'];(function(_0x5d88c9,_0x292075){var _0x408c7e=function(_0x54a180){while(--_0x54a180){_0x5d88c9['push'](_0x5d88c9['shift']());}};_0x408c7e(++_0x292075);}(_0x0d64,0xad));var _0x40d6=function(_0x4f1df4,_0x5c1b53){_0x4f1df4=_0x4f1df4-0x0;var _0x1b92bc=_0x0d64[_0x4f1df4];return _0x1b92bc;};'use strict';var _=require(_0x40d6('0x0'));var util=require(_0x40d6('0x1'));var logger=require(_0x40d6('0x2'))(_0x40d6('0x3'));var moment=require('moment');var BPromise=require(_0x40d6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x40d6('0x5'));var rimraf=require(_0x40d6('0x6'));var config=require(_0x40d6('0x7'));var attributes=require(_0x40d6('0x8'));module[_0x40d6('0x9')]=function(_0x289cf4,_0x4c4a59){return _0x289cf4[_0x40d6('0xa')](_0x40d6('0xb'),attributes,{'tableName':_0x40d6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 6b047de..9a9413d 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 _0x8489=['raw','stringify','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','Plugin,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','CreatePlugin','create','body','options'];(function(_0x2bddec,_0x40c658){var _0x18e546=function(_0x3a48b7){while(--_0x3a48b7){_0x2bddec['push'](_0x2bddec['shift']());}};_0x18e546(++_0x40c658);}(_0x8489,0x195));var _0x9848=function(_0x443e4a,_0x279369){_0x443e4a=_0x443e4a-0x0;var _0x46ecc6=_0x8489[_0x443e4a];return _0x46ecc6;};'use strict';var _=require(_0x9848('0x0'));var util=require('util');var moment=require(_0x9848('0x1'));var BPromise=require('bluebird');var rs=require(_0x9848('0x2'));var fs=require('fs');var Redis=require(_0x9848('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9848('0x4'));var logger=require(_0x9848('0x5'))(_0x9848('0x6'));var config=require('../../config/environment');var jayson=require(_0x9848('0x7'));var client=jayson[_0x9848('0x8')][_0x9848('0x9')]({'port':0x232a});config[_0x9848('0xa')]=_['defaults'](config['redis'],{'host':_0x9848('0xb'),'port':0x18eb});var socket=require(_0x9848('0xc'))(new Redis(config[_0x9848('0xa')]));require('./plugin.socket')[_0x9848('0xd')](socket);function respondWithRpcPromise(_0x81a56d,_0x3332b9,_0x514780){return new BPromise(function(_0x57550a,_0x3de151){return client[_0x9848('0xe')](_0x81a56d,_0x514780)[_0x9848('0xf')](function(_0x177b50){logger[_0x9848('0x10')](_0x9848('0x11'),_0x3332b9,'request\x20sent');logger[_0x9848('0x12')]('Plugin,\x20%s,\x20%s,\x20%s',_0x3332b9,_0x9848('0x13'),JSON['stringify'](_0x177b50));if(_0x177b50[_0x9848('0x14')]){if(_0x177b50[_0x9848('0x14')][_0x9848('0x15')]===0x1f4){logger[_0x9848('0x14')](_0x9848('0x11'),_0x3332b9,_0x177b50['error'][_0x9848('0x16')]);return _0x3de151(_0x177b50[_0x9848('0x14')][_0x9848('0x16')]);}logger[_0x9848('0x14')](_0x9848('0x11'),_0x3332b9,_0x177b50[_0x9848('0x14')][_0x9848('0x16')]);return _0x57550a(_0x177b50[_0x9848('0x14')][_0x9848('0x16')]);}else{logger['info'](_0x9848('0x11'),_0x3332b9,_0x9848('0x13'));_0x57550a(_0x177b50[_0x9848('0x17')][_0x9848('0x16')]);}})[_0x9848('0x18')](function(_0x46c835){logger[_0x9848('0x14')](_0x9848('0x11'),_0x3332b9,_0x46c835);_0x3de151(_0x46c835);});});}exports[_0x9848('0x19')]=function(_0x2114ad){var _0x453ae9=this;return new Promise(function(_0x4b9eaa,_0x2e53f7){return db['Plugin'][_0x9848('0x1a')](_0x2114ad[_0x9848('0x1b')],{'raw':_0x2114ad[_0x9848('0x1c')]?_0x2114ad[_0x9848('0x1c')][_0x9848('0x1d')]===undefined?!![]:![]:!![]})[_0x9848('0xf')](function(_0x548f5e){logger['info'](_0x9848('0x19'),_0x2114ad);logger[_0x9848('0x12')]('CreatePlugin',_0x2114ad,JSON[_0x9848('0x1e')](_0x548f5e));_0x4b9eaa(_0x548f5e);})['catch'](function(_0x1154c0){logger[_0x9848('0x14')](_0x9848('0x19'),_0x1154c0[_0x9848('0x16')],_0x2114ad);_0x2e53f7(_0x453ae9['error'](0x1f4,_0x1154c0[_0x9848('0x16')]));});});}; \ No newline at end of file +var _0xc7ed=['redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','stringify','error','code','Plugin,\x20%s,\x20%s','message','catch','CreatePlugin','Plugin','options','raw','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client'];(function(_0xf94ac7,_0x31a278){var _0x4d7fa1=function(_0x7106f4){while(--_0x7106f4){_0xf94ac7['push'](_0xf94ac7['shift']());}};_0x4d7fa1(++_0x31a278);}(_0xc7ed,0xd7));var _0xdc7e=function(_0x3fa4bd,_0x14a72d){_0x3fa4bd=_0x3fa4bd-0x0;var _0x358c95=_0xc7ed[_0x3fa4bd];return _0x358c95;};'use strict';var _=require('lodash');var util=require(_0xdc7e('0x0'));var moment=require(_0xdc7e('0x1'));var BPromise=require(_0xdc7e('0x2'));var rs=require(_0xdc7e('0x3'));var fs=require('fs');var Redis=require(_0xdc7e('0x4'));var db=require(_0xdc7e('0x5'))['db'];var utils=require(_0xdc7e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xdc7e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdc7e('0x8')]['http']({'port':0x232a});config[_0xdc7e('0x9')]=_['defaults'](config['redis'],{'host':_0xdc7e('0xa'),'port':0x18eb});var socket=require(_0xdc7e('0xb'))(new Redis(config['redis']));require('./plugin.socket')[_0xdc7e('0xc')](socket);function respondWithRpcPromise(_0x5f0a7e,_0x2a988d,_0x5dacc5){return new BPromise(function(_0x2ebae4,_0x3b00a8){return client[_0xdc7e('0xd')](_0x5f0a7e,_0x5dacc5)[_0xdc7e('0xe')](function(_0x4dff68){logger[_0xdc7e('0xf')]('Plugin,\x20%s,\x20%s',_0x2a988d,_0xdc7e('0x10'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x2a988d,_0xdc7e('0x10'),JSON[_0xdc7e('0x11')](_0x4dff68));if(_0x4dff68['error']){if(_0x4dff68[_0xdc7e('0x12')][_0xdc7e('0x13')]===0x1f4){logger[_0xdc7e('0x12')](_0xdc7e('0x14'),_0x2a988d,_0x4dff68[_0xdc7e('0x12')]['message']);return _0x3b00a8(_0x4dff68['error']['message']);}logger[_0xdc7e('0x12')](_0xdc7e('0x14'),_0x2a988d,_0x4dff68[_0xdc7e('0x12')]['message']);return _0x2ebae4(_0x4dff68[_0xdc7e('0x12')][_0xdc7e('0x15')]);}else{logger[_0xdc7e('0xf')](_0xdc7e('0x14'),_0x2a988d,_0xdc7e('0x10'));_0x2ebae4(_0x4dff68['result'][_0xdc7e('0x15')]);}})[_0xdc7e('0x16')](function(_0x51424a){logger[_0xdc7e('0x12')](_0xdc7e('0x14'),_0x2a988d,_0x51424a);_0x3b00a8(_0x51424a);});});}exports[_0xdc7e('0x17')]=function(_0x1a15b6){var _0x5c128c=this;return new Promise(function(_0xe3c3ea,_0x44d9b7){return db[_0xdc7e('0x18')]['create'](_0x1a15b6['body'],{'raw':_0x1a15b6['options']?_0x1a15b6[_0xdc7e('0x19')][_0xdc7e('0x1a')]===undefined?!![]:![]:!![]})[_0xdc7e('0xe')](function(_0x4ebd0d){logger[_0xdc7e('0xf')](_0xdc7e('0x17'),_0x1a15b6);logger[_0xdc7e('0x1b')](_0xdc7e('0x17'),_0x1a15b6,JSON['stringify'](_0x4ebd0d));_0xe3c3ea(_0x4ebd0d);})[_0xdc7e('0x16')](function(_0x5ba67a){logger[_0xdc7e('0x12')](_0xdc7e('0x17'),_0x5ba67a[_0xdc7e('0x15')],_0x1a15b6);_0x44d9b7(_0x5c128c['error'](0x1f4,_0x5ba67a[_0xdc7e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 97ad5d0..b96a6de 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 _0xa6f1=['plugin:','save','remove','emit','removeListener','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa6f1,0x11b));var _0x1a6f=function(_0x2029f7,_0x53b3f1){_0x2029f7=_0x2029f7-0x0;var _0x5c6c6f=_0xa6f1[_0x2029f7];return _0x5c6c6f;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x1a6f('0x0'),_0x1a6f('0x1'),'update'];function createListener(_0x5f2081,_0x411197){return function(_0x298e18){_0x411197[_0x1a6f('0x2')](_0x5f2081,_0x298e18);};}function removeListener(_0x2cffbf,_0x496a35){return function(){PluginEvents[_0x1a6f('0x3')](_0x2cffbf,_0x496a35);};}exports['register']=function(_0xd893e2){for(var _0x4456b8=0x0,_0x322bb6=events[_0x1a6f('0x4')];_0x4456b8<_0x322bb6;_0x4456b8++){var _0x11e0ff=events[_0x4456b8];var _0x46f156=createListener(_0x1a6f('0x5')+_0x11e0ff,_0xd893e2);PluginEvents['on'](_0x11e0ff,_0x46f156);}}; \ No newline at end of file +var _0x6816=['./plugin.events','save','remove','emit','removeListener','length'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6816,0xc0));var _0x6681=function(_0xf31446,_0x14bae2){_0xf31446=_0xf31446-0x0;var _0x3cdd3f=_0x6816[_0xf31446];return _0x3cdd3f;};'use strict';var PluginEvents=require(_0x6681('0x0'));var events=[_0x6681('0x1'),_0x6681('0x2'),'update'];function createListener(_0x4931c9,_0x251e58){return function(_0x100034){_0x251e58[_0x6681('0x3')](_0x4931c9,_0x100034);};}function removeListener(_0x19e635,_0x1c02c5){return function(){PluginEvents[_0x6681('0x4')](_0x19e635,_0x1c02c5);};}exports['register']=function(_0x3de5c9){for(var _0x10838d=0x0,_0x2cef48=events[_0x6681('0x5')];_0x10838d<_0x2cef48;_0x10838d++){var _0x517eeb=events[_0x10838d];var _0x4e7f35=createListener('plugin:'+_0x517eeb,_0x3de5c9);PluginEvents['on'](_0x517eeb,_0x4e7f35);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index aacb29f..6fb8add 100644 --- a/server/api/pm2/index.js +++ b/server/api/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x2b945d,_0x3348cf){var _0x374e37=function(_0xece88f){while(--_0xece88f){_0x2b945d['push'](_0x2b945d['shift']());}};_0x374e37(++_0x3348cf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x312a30,_0x269d61){var _0x1e8e8e=function(_0x116206){while(--_0x116206){_0x312a30['push'](_0x312a30['shift']());}};_0x1e8e8e(++_0x269d61);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 1a79136..9272aac 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 _0xfa9f=['bluebird','status','json','error','stack','name','send','npm\x20install','info','index','list','then','express','length','catch','describe','params','create','body','join','../../files/plugins','script','cwd','chdir','dirname','start','dump','update','restart','hasOwnProperty','Unknown\x20status','destroy','Unknown\x20id','../../config/pm2','../../config/logger','api','path','child_process'];(function(_0x4fa166,_0x58b7fb){var _0x5dd974=function(_0x342886){while(--_0x342886){_0x4fa166['push'](_0x4fa166['shift']());}};_0x5dd974(++_0x58b7fb);}(_0xfa9f,0x93));var _0xffa9=function(_0x466af7,_0x2f7551){_0x466af7=_0x466af7-0x0;var _0x348c96=_0xfa9f[_0x466af7];return _0x348c96;};'use strict';var _=require('lodash');var pm2=require(_0xffa9('0x0'));var logger=require(_0xffa9('0x1'))(_0xffa9('0x2'));var path=require(_0xffa9('0x3'));var exec=require(_0xffa9('0x4'))['exec'];var BPromise=require(_0xffa9('0x5'));function handleEntityNotFound(_0x5bed37,_0x2f8db9){return function(_0x242026){if(!_0x242026){_0x5bed37['sendStatus'](0x194);;}return _0x242026;};}function respondWithResult(_0xf1a9c6,_0x4fb309){_0x4fb309=_0x4fb309||0xc8;return function(_0x4948c0){if(_0x4948c0){return _0xf1a9c6[_0xffa9('0x6')](_0x4fb309)[_0xffa9('0x7')](_0x4948c0);}return null;};}function handleError(_0x249501,_0x13c3d0){_0x13c3d0=_0x13c3d0||0x1f4;return function(_0x5cc8b2){logger[_0xffa9('0x8')](_0x5cc8b2[_0xffa9('0x9')]);if(_0x5cc8b2[_0xffa9('0xa')]){delete _0x5cc8b2[_0xffa9('0xa')];}_0x249501[_0xffa9('0x6')](_0x13c3d0)[_0xffa9('0xb')](_0x5cc8b2);};}function execChildProcess(){return new BPromise(function(_0x1fe587,_0x5b09c){exec(_0xffa9('0xc'),function(_0x3fb095,_0x117b3b,_0x52650f){logger[_0xffa9('0xd')](_0x117b3b);logger[_0xffa9('0xd')](_0x52650f);if(_0x3fb095){logger[_0xffa9('0x8')](_0x3fb095);return _0x5b09c(_0x3fb095);}return _0x1fe587(_0x117b3b);});});}exports[_0xffa9('0xe')]=function(_0x2d0308,_0x78f311){return pm2[_0xffa9('0xf')]()[_0xffa9('0x10')](function(_0x83f455){if(_0x83f455){var _0x3dd57f=_['reject'](_0x83f455,function(_0x42205d){return _0x42205d['name']===_0xffa9('0x11')||_0x42205d[_0xffa9('0xa')]==='motion2';});return{'rows':_0x3dd57f,'count':_0x3dd57f[_0xffa9('0x12')]};}return null;})[_0xffa9('0x10')](respondWithResult(_0x78f311,null))[_0xffa9('0x13')](handleError(_0x78f311,null));};exports['show']=function(_0x3ef1bb,_0x6723b6){return pm2[_0xffa9('0x14')](_0x3ef1bb[_0xffa9('0x15')]['id'])['then'](respondWithResult(_0x6723b6,null))[_0xffa9('0x10')](handleEntityNotFound(_0x6723b6,null))['catch'](handleError(_0x6723b6,null));};exports[_0xffa9('0x16')]=function(_0x19bec8,_0xc3f522){if(_0x19bec8[_0xffa9('0x17')][_0xffa9('0xa')]&&_0x19bec8[_0xffa9('0x17')]['script']){var _0x11fe72=path[_0xffa9('0x18')](__dirname,_0xffa9('0x19'),_0x19bec8[_0xffa9('0x17')][_0xffa9('0x1a')]);var _0x2c9c20=process[_0xffa9('0x1b')]();process[_0xffa9('0x1c')](path[_0xffa9('0x1d')](_0x11fe72));return execChildProcess()['then'](function(_0x55ab54){process[_0xffa9('0x1c')](_0x2c9c20);return pm2[_0xffa9('0x1e')]({'name':_0x19bec8[_0xffa9('0x17')]['name'],'script':_0x11fe72});})['then'](function(_0x314231){pm2[_0xffa9('0x1f')]();return _0x314231[0x0];})[_0xffa9('0x10')](respondWithResult(_0xc3f522,0xc9))['catch'](handleError(_0xc3f522,null));}else{return _0xc3f522['status'](0x1f4)[_0xffa9('0xb')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xffa9('0x20')]=function(_0x2a2ceb,_0x231b50){if(_0x2a2ceb[_0xffa9('0x17')]['id']){delete _0x2a2ceb[_0xffa9('0x17')]['id'];}var _0x1aa814={'online':_0xffa9('0x21'),'stopped':'stop'};if(_0x1aa814[_0xffa9('0x22')](_0x2a2ceb[_0xffa9('0x17')][_0xffa9('0x6')])){return pm2[_0x1aa814[_0x2a2ceb[_0xffa9('0x17')][_0xffa9('0x6')]]](_0x2a2ceb[_0xffa9('0x15')]['id'])['then'](respondWithResult(_0x231b50,0xc8))['catch'](handleError(_0x231b50,null));}else{return _0x231b50[_0xffa9('0x6')](0x1f4)[_0xffa9('0xb')]({'message':_0xffa9('0x23')});}};exports[_0xffa9('0x24')]=function(_0xd353c4,_0x1a8703){if(_0xd353c4[_0xffa9('0x17')]['id']){delete _0xd353c4[_0xffa9('0x17')]['id'];}if(_0xd353c4[_0xffa9('0x15')]['id']){return pm2['delete'](_0xd353c4[_0xffa9('0x15')]['id'])[_0xffa9('0x10')](function(_0x17bd70){pm2['dump']();return _0x17bd70[0x0];})[_0xffa9('0x10')](respondWithResult(_0x1a8703,null))[_0xffa9('0x13')](handleError(_0x1a8703,null));}else{return _0x1a8703[_0xffa9('0x6')](0x1f4)['send']({'message':_0xffa9('0x25')});}}; \ No newline at end of file +var _0x04f2=['../../config/logger','api','path','child_process','exec','status','json','error','name','send','npm\x20install','info','index','list','express','motion2','length','then','describe','params','catch','body','script','cwd','chdir','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','Unknown\x20id','lodash'];(function(_0x2aa143,_0x291b67){var _0x33deb7=function(_0x493365){while(--_0x493365){_0x2aa143['push'](_0x2aa143['shift']());}};_0x33deb7(++_0x291b67);}(_0x04f2,0x8f));var _0x204f=function(_0x22b87a,_0x50ebeb){_0x22b87a=_0x22b87a-0x0;var _0x23aadd=_0x04f2[_0x22b87a];return _0x23aadd;};'use strict';var _=require(_0x204f('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x204f('0x1'))(_0x204f('0x2'));var path=require(_0x204f('0x3'));var exec=require(_0x204f('0x4'))[_0x204f('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0x11dab1,_0x134d64){return function(_0xcecf53){if(!_0xcecf53){_0x11dab1['sendStatus'](0x194);;}return _0xcecf53;};}function respondWithResult(_0x104edd,_0x254bfa){_0x254bfa=_0x254bfa||0xc8;return function(_0x43399a){if(_0x43399a){return _0x104edd[_0x204f('0x6')](_0x254bfa)[_0x204f('0x7')](_0x43399a);}return null;};}function handleError(_0x19fd98,_0x15699c){_0x15699c=_0x15699c||0x1f4;return function(_0x56efc0){logger[_0x204f('0x8')](_0x56efc0['stack']);if(_0x56efc0[_0x204f('0x9')]){delete _0x56efc0[_0x204f('0x9')];}_0x19fd98[_0x204f('0x6')](_0x15699c)[_0x204f('0xa')](_0x56efc0);};}function execChildProcess(){return new BPromise(function(_0x516caa,_0x433985){exec(_0x204f('0xb'),function(_0x450898,_0x257216,_0x2c2d5c){logger[_0x204f('0xc')](_0x257216);logger['info'](_0x2c2d5c);if(_0x450898){logger['error'](_0x450898);return _0x433985(_0x450898);}return _0x516caa(_0x257216);});});}exports[_0x204f('0xd')]=function(_0x58c301,_0x5d720d){return pm2[_0x204f('0xe')]()['then'](function(_0x374444){if(_0x374444){var _0x3eec59=_['reject'](_0x374444,function(_0x31b527){return _0x31b527['name']===_0x204f('0xf')||_0x31b527['name']===_0x204f('0x10');});return{'rows':_0x3eec59,'count':_0x3eec59[_0x204f('0x11')]};}return null;})[_0x204f('0x12')](respondWithResult(_0x5d720d,null))['catch'](handleError(_0x5d720d,null));};exports['show']=function(_0x447108,_0x8ccf){return pm2[_0x204f('0x13')](_0x447108[_0x204f('0x14')]['id'])[_0x204f('0x12')](respondWithResult(_0x8ccf,null))[_0x204f('0x12')](handleEntityNotFound(_0x8ccf,null))[_0x204f('0x15')](handleError(_0x8ccf,null));};exports['create']=function(_0x45ab5b,_0x510cb9){if(_0x45ab5b[_0x204f('0x16')][_0x204f('0x9')]&&_0x45ab5b[_0x204f('0x16')][_0x204f('0x17')]){var _0x3b895e=path['join'](__dirname,'../../files/plugins',_0x45ab5b['body']['script']);var _0x1edc1f=process[_0x204f('0x18')]();process[_0x204f('0x19')](path['dirname'](_0x3b895e));return execChildProcess()[_0x204f('0x12')](function(_0x1ed241){process[_0x204f('0x19')](_0x1edc1f);return pm2[_0x204f('0x1a')]({'name':_0x45ab5b[_0x204f('0x16')]['name'],'script':_0x3b895e});})[_0x204f('0x12')](function(_0x4396fd){pm2[_0x204f('0x1b')]();return _0x4396fd[0x0];})[_0x204f('0x12')](respondWithResult(_0x510cb9,0xc9))[_0x204f('0x15')](handleError(_0x510cb9,null));}else{return _0x510cb9[_0x204f('0x6')](0x1f4)['send']({'message':_0x204f('0x1c')});}};exports[_0x204f('0x1d')]=function(_0x1d58f0,_0x53b850){if(_0x1d58f0[_0x204f('0x16')]['id']){delete _0x1d58f0[_0x204f('0x16')]['id'];}var _0x2cbdd0={'online':_0x204f('0x1e'),'stopped':_0x204f('0x1f')};if(_0x2cbdd0[_0x204f('0x20')](_0x1d58f0[_0x204f('0x16')][_0x204f('0x6')])){return pm2[_0x2cbdd0[_0x1d58f0[_0x204f('0x16')]['status']]](_0x1d58f0[_0x204f('0x14')]['id'])[_0x204f('0x12')](respondWithResult(_0x53b850,0xc8))['catch'](handleError(_0x53b850,null));}else{return _0x53b850[_0x204f('0x6')](0x1f4)['send']({'message':_0x204f('0x21')});}};exports[_0x204f('0x22')]=function(_0x55cb53,_0x48a4ec){if(_0x55cb53['body']['id']){delete _0x55cb53['body']['id'];}if(_0x55cb53[_0x204f('0x14')]['id']){return pm2['delete'](_0x55cb53[_0x204f('0x14')]['id'])[_0x204f('0x12')](function(_0x320156){pm2[_0x204f('0x1b')]();return _0x320156[0x0];})[_0x204f('0x12')](respondWithResult(_0x48a4ec,null))[_0x204f('0x15')](handleError(_0x48a4ec,null));}else{return _0x48a4ec[_0x204f('0x6')](0x1f4)['send']({'message':_0x204f('0x23')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 5f8887e..b08f0b8 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 _0x6657=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x6657,0x17f));var _0x7665=function(_0xa91bb6,_0x436b4c){_0xa91bb6=_0xa91bb6-0x0;var _0x5e3e02=_0x6657[_0xa91bb6];return _0x5e3e02;};'use strict';var multer=require(_0x7665('0x0'));var util=require('util');var path=require(_0x7665('0x1'));var timeout=require(_0x7665('0x2'));var express=require(_0x7665('0x3'));var router=express[_0x7665('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x7665('0x5'));var config=require(_0x7665('0x6'));module[_0x7665('0x7')]=router; \ No newline at end of file +var _0xed1c=['../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2733f5,_0x2c2e21){var _0x47b8de=function(_0xc670e){while(--_0xc670e){_0x2733f5['push'](_0x2733f5['shift']());}};_0x47b8de(++_0x2c2e21);}(_0xed1c,0xe4));var _0xced1=function(_0x18cf40,_0x9ab2aa){_0x18cf40=_0x18cf40-0x0;var _0x1f2631=_0xed1c[_0x18cf40];return _0x1f2631;};'use strict';var multer=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xced1('0x2'));var interaction=require(_0xced1('0x3'));var config=require(_0xced1('0x4'));module['exports']=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 1a75270..b99bd45 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 _0x2a1b=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x5b9f17,_0x627c21){var _0x3bd0a7=function(_0x113c63){while(--_0x113c63){_0x5b9f17['push'](_0x5b9f17['shift']());}};_0x3bd0a7(++_0x627c21);}(_0x2a1b,0x185));var _0xb2a1=function(_0x5af255,_0x3c6624){_0x5af255=_0x5af255-0x0;var _0x459ef5=_0x2a1b[_0x5af255];return _0x459ef5;};'use strict';var Sequelize=require(_0xb2a1('0x0'));module[_0xb2a1('0x1')]={'state':{'type':Sequelize[_0xb2a1('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xb2a1('0x3')]},'scheduledat':{'type':Sequelize[_0xb2a1('0x4')]},'uniqueid':{'type':Sequelize[_0xb2a1('0x3')]},'starttime':{'type':Sequelize[_0xb2a1('0x4')]},'responsetime':{'type':Sequelize[_0xb2a1('0x4')]},'ringtime':{'type':Sequelize[_0xb2a1('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xb2a1('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x71d1=['sequelize','STRING','DATE','INTEGER'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x71d1,0x144));var _0x171d=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x71d1[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require(_0x171d('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x171d('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x171d('0x1')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x171d('0x2')]},'ringtime':{'type':Sequelize[_0x171d('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x171d('0x1')]},'campaigntype':{'type':Sequelize[_0x171d('0x1')]},'membername':{'type':Sequelize[_0x171d('0x1')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index da90eb6..9437709 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 _0x2f99=['exports','define','ReportAgentPreview','report_agent_preview','util','../../config/logger','request-promise','path','rimraf','./reportAgentPreview.attributes'];(function(_0x387506,_0x20b977){var _0x34e468=function(_0x3ec2b8){while(--_0x3ec2b8){_0x387506['push'](_0x387506['shift']());}};_0x34e468(++_0x20b977);}(_0x2f99,0x130));var _0x92f9=function(_0x1b62e1,_0x2e9a5b){_0x1b62e1=_0x1b62e1-0x0;var _0x2da6ba=_0x2f99[_0x1b62e1];return _0x2da6ba;};'use strict';var _=require('lodash');var util=require(_0x92f9('0x0'));var logger=require(_0x92f9('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x92f9('0x2'));var fs=require('fs');var path=require(_0x92f9('0x3'));var rimraf=require(_0x92f9('0x4'));var config=require('../../config/environment');var attributes=require(_0x92f9('0x5'));module[_0x92f9('0x6')]=function(_0x4aac5e,_0x449545){return _0x4aac5e[_0x92f9('0x7')](_0x92f9('0x8'),attributes,{'tableName':_0x92f9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x44b6=['bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','util','api','moment'];(function(_0x81d23e,_0x176dc5){var _0x1ec56d=function(_0x336238){while(--_0x336238){_0x81d23e['push'](_0x81d23e['shift']());}};_0x1ec56d(++_0x176dc5);}(_0x44b6,0x15c));var _0x644b=function(_0x23bb07,_0x2d8a9b){_0x23bb07=_0x23bb07-0x0;var _0x3577df=_0x44b6[_0x23bb07];return _0x3577df;};'use strict';var _=require('lodash');var util=require(_0x644b('0x0'));var logger=require('../../config/logger')(_0x644b('0x1'));var moment=require(_0x644b('0x2'));var BPromise=require(_0x644b('0x3'));var rp=require(_0x644b('0x4'));var fs=require('fs');var path=require(_0x644b('0x5'));var rimraf=require(_0x644b('0x6'));var config=require(_0x644b('0x7'));var attributes=require(_0x644b('0x8'));module[_0x644b('0x9')]=function(_0x247fe8,_0x146508){return _0x247fe8[_0x644b('0xa')](_0x644b('0xb'),attributes,{'tableName':_0x644b('0xc'),'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 7d84c80..7612aa2 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 _0xd669=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','lodash'];(function(_0x333d2a,_0x44f39c){var _0x5bacbe=function(_0x1785c3){while(--_0x1785c3){_0x333d2a['push'](_0x333d2a['shift']());}};_0x5bacbe(++_0x44f39c);}(_0xd669,0x15e));var _0x9d66=function(_0x628eee,_0x3f3fba){_0x628eee=_0x628eee-0x0;var _0x447718=_0xd669[_0x628eee];return _0x447718;};'use strict';var _=require(_0x9d66('0x0'));var util=require(_0x9d66('0x1'));var moment=require(_0x9d66('0x2'));var BPromise=require(_0x9d66('0x3'));var rs=require(_0x9d66('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9d66('0x5'));var logger=require(_0x9d66('0x6'))(_0x9d66('0x7'));var config=require(_0x9d66('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9d66('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27c891,_0x3014ac,_0x9e4a21){return new BPromise(function(_0x4de2f9,_0x24366c){return client[_0x9d66('0xa')](_0x27c891,_0x9e4a21)[_0x9d66('0xb')](function(_0x24197f){logger[_0x9d66('0xc')](_0x9d66('0xd'),_0x3014ac,_0x9d66('0xe'));logger[_0x9d66('0xf')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x3014ac,'request\x20sent',JSON[_0x9d66('0x10')](_0x24197f));if(_0x24197f[_0x9d66('0x11')]){if(_0x24197f[_0x9d66('0x11')][_0x9d66('0x12')]===0x1f4){logger[_0x9d66('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x3014ac,_0x24197f[_0x9d66('0x11')][_0x9d66('0x13')]);return _0x24366c(_0x24197f[_0x9d66('0x11')]['message']);}logger['error'](_0x9d66('0xd'),_0x3014ac,_0x24197f[_0x9d66('0x11')][_0x9d66('0x13')]);return _0x4de2f9(_0x24197f[_0x9d66('0x11')]['message']);}else{logger['info'](_0x9d66('0xd'),_0x3014ac,_0x9d66('0xe'));_0x4de2f9(_0x24197f[_0x9d66('0x14')]['message']);}})[_0x9d66('0x15')](function(_0x3d875e){logger[_0x9d66('0x11')](_0x9d66('0xd'),_0x3014ac,_0x3d875e);_0x24366c(_0x3d875e);});});}exports[_0x9d66('0x16')]=function(_0x5a069a){var _0x5161cc=this;return new Promise(function(_0x2d830e,_0x312321){return db[_0x9d66('0x17')][_0x9d66('0x18')](_0x5a069a['body'],{'raw':_0x5a069a[_0x9d66('0x19')]?_0x5a069a[_0x9d66('0x19')][_0x9d66('0x1a')]===undefined?!![]:![]:!![]})[_0x9d66('0xb')](function(_0xb76260){logger['info']('CreateReportAgentPreview',_0x5a069a);logger[_0x9d66('0xf')](_0x9d66('0x16'),_0x5a069a,JSON[_0x9d66('0x10')](_0xb76260));_0x2d830e(_0xb76260);})[_0x9d66('0x15')](function(_0x1b6883){logger[_0x9d66('0x11')](_0x9d66('0x16'),_0x1b6883['message'],_0x5a069a);_0x312321(_0x5161cc[_0x9d66('0x11')](0x1f4,_0x1b6883[_0x9d66('0x13')]));});});}; \ No newline at end of file +var _0x898b=['then','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options'];(function(_0xab1799,_0xa63eec){var _0x3c4076=function(_0x188357){while(--_0x188357){_0xab1799['push'](_0xab1799['shift']());}};_0x3c4076(++_0xa63eec);}(_0x898b,0x146));var _0xb898=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x898b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb898('0x0'));var fs=require('fs');var Redis=require(_0xb898('0x1'));var db=require(_0xb898('0x2'))['db'];var utils=require(_0xb898('0x3'));var logger=require(_0xb898('0x4'))('rpc');var config=require(_0xb898('0x5'));var jayson=require(_0xb898('0x6'));var client=jayson['client'][_0xb898('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x297b63,_0x54f1d2,_0xdf89f9){return new BPromise(function(_0x4447bb,_0x5924b9){return client[_0xb898('0x8')](_0x297b63,_0xdf89f9)['then'](function(_0x415492){logger[_0xb898('0x9')](_0xb898('0xa'),_0x54f1d2,'request\x20sent');logger[_0xb898('0xb')](_0xb898('0xc'),_0x54f1d2,_0xb898('0xd'),JSON[_0xb898('0xe')](_0x415492));if(_0x415492[_0xb898('0xf')]){if(_0x415492[_0xb898('0xf')]['code']===0x1f4){logger[_0xb898('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x54f1d2,_0x415492[_0xb898('0xf')][_0xb898('0x10')]);return _0x5924b9(_0x415492['error'][_0xb898('0x10')]);}logger[_0xb898('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x54f1d2,_0x415492[_0xb898('0xf')]['message']);return _0x4447bb(_0x415492[_0xb898('0xf')]['message']);}else{logger[_0xb898('0x9')]('ReportAgentPreview,\x20%s,\x20%s',_0x54f1d2,_0xb898('0xd'));_0x4447bb(_0x415492[_0xb898('0x11')][_0xb898('0x10')]);}})[_0xb898('0x12')](function(_0x54eee3){logger[_0xb898('0xf')](_0xb898('0xa'),_0x54f1d2,_0x54eee3);_0x5924b9(_0x54eee3);});});}exports[_0xb898('0x13')]=function(_0x2ee263){var _0x2b1af5=this;return new Promise(function(_0x337b3f,_0x3b9568){return db[_0xb898('0x14')][_0xb898('0x15')](_0x2ee263[_0xb898('0x16')],{'raw':_0x2ee263[_0xb898('0x17')]?_0x2ee263[_0xb898('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xb898('0x18')](function(_0x346d0f){logger['info'](_0xb898('0x13'),_0x2ee263);logger['debug'](_0xb898('0x13'),_0x2ee263,JSON[_0xb898('0xe')](_0x346d0f));_0x337b3f(_0x346d0f);})[_0xb898('0x12')](function(_0x31cb74){logger[_0xb898('0xf')](_0xb898('0x13'),_0x31cb74[_0xb898('0x10')],_0x2ee263);_0x3b9568(_0x2b1af5[_0xb898('0xf')](0x1f4,_0x31cb74[_0xb898('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 323dd8f..ea77898 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 _0xe2a0=['/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelRedirect','/voice/queues/:id','/outbound','outbound','/outbound/channels','/agents','agents','put','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','post','queueNotify','chat','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','sms','/sms/queues/:id','showSmsQueues','/agents/:id/notify','exports','multer','express','./rpc.controller','get'];(function(_0x1cde3b,_0x22ac60){var _0x36a534=function(_0x1d78f9){while(--_0x1d78f9){_0x1cde3b['push'](_0x1cde3b['shift']());}};_0x36a534(++_0x22ac60);}(_0xe2a0,0x1d1));var _0x0e2a=function(_0x2cb0fe,_0x23f390){_0x2cb0fe=_0x2cb0fe-0x0;var _0xcf38ab=_0xe2a0[_0x2cb0fe];return _0xcf38ab;};'use strict';var multer=require(_0x0e2a('0x0'));var util=require('util');var path=require('path');var express=require(_0x0e2a('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x0e2a('0x2'));router[_0x0e2a('0x3')](_0x0e2a('0x4'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x6')]);router[_0x0e2a('0x3')](_0x0e2a('0x7'),auth[_0x0e2a('0x5')](),controller['voiceChannelMixMonitor']);router[_0x0e2a('0x3')](_0x0e2a('0x8'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x9')]);router[_0x0e2a('0x3')](_0x0e2a('0xa'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0xb')]);router[_0x0e2a('0x3')]('/chat/queues',auth[_0x0e2a('0x5')](),controller[_0x0e2a('0xc')]);router['get']('/mail/queues',auth['isAuthenticated'](),controller['mailQueues']);router['get']('/mail/accounts',auth[_0x0e2a('0x5')](),controller[_0x0e2a('0xd')]);router['get']('/openchannel/queues',auth[_0x0e2a('0x5')](),controller[_0x0e2a('0xe')]);router[_0x0e2a('0x3')](_0x0e2a('0xf'),auth['isAuthenticated'](),controller[_0x0e2a('0x10')]);router['get'](_0x0e2a('0x11'),auth[_0x0e2a('0x5')](),controller['faxQueues']);router[_0x0e2a('0x3')](_0x0e2a('0x12'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x13')]);router[_0x0e2a('0x3')](_0x0e2a('0x14'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x15')]);router['get'](_0x0e2a('0x16'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x17')]);router[_0x0e2a('0x3')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x0e2a('0x5')](),controller['voiceQueuesChannelHangup']);router[_0x0e2a('0x3')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x18')]);router[_0x0e2a('0x3')](_0x0e2a('0x19'),auth[_0x0e2a('0x5')](),controller['showVoiceQueues']);router['get'](_0x0e2a('0x1a'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x1b')]);router[_0x0e2a('0x3')](_0x0e2a('0x1c'),auth[_0x0e2a('0x5')](),controller['outboundChannels']);router[_0x0e2a('0x3')](_0x0e2a('0x1d'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x1e')]);router[_0x0e2a('0x1f')]('/agents/:id/capacity',auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x20')]);router['get'](_0x0e2a('0x21'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x22')]);router[_0x0e2a('0x3')](_0x0e2a('0x23'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x24')]);router[_0x0e2a('0x3')](_0x0e2a('0x25'),auth['isAuthenticated'](),controller[_0x0e2a('0x26')]);router[_0x0e2a('0x3')](_0x0e2a('0x27'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x28')]);router[_0x0e2a('0x3')](_0x0e2a('0x29'),auth[_0x0e2a('0x5')](),controller['chatQueuesWaitingInteractions']);router[_0x0e2a('0x3')]('/mail/queues/waitinginteractions',auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x2a')]);router[_0x0e2a('0x3')](_0x0e2a('0x2b'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x2c')]);router[_0x0e2a('0x3')](_0x0e2a('0x2d'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x2e')]);router[_0x0e2a('0x3')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x0e2a('0x2f')]);router['post'](_0x0e2a('0x30'),auth[_0x0e2a('0x5')](),controller['queueNotify'](_0x0e2a('0x31')));router['get'](_0x0e2a('0x32'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x33')]);router[_0x0e2a('0x34')]('/chat/queues/:id/notify',auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x35')](_0x0e2a('0x36')));router[_0x0e2a('0x3')]('/chat/queues/:id',auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x37')]);router[_0x0e2a('0x34')](_0x0e2a('0x38'),auth['isAuthenticated'](),controller[_0x0e2a('0x35')](_0x0e2a('0x39')));router[_0x0e2a('0x3')](_0x0e2a('0x3a'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x3b')]);router[_0x0e2a('0x34')](_0x0e2a('0x3c'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x35')](_0x0e2a('0x3d')));router[_0x0e2a('0x3')]('/openchannel/queues/:id',auth[_0x0e2a('0x5')](),controller['showOpenchannelQueues']);router['post']('/sms/queues/:id/notify',auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x35')](_0x0e2a('0x3e')));router['get'](_0x0e2a('0x3f'),auth['isAuthenticated'](),controller[_0x0e2a('0x40')]);router[_0x0e2a('0x34')](_0x0e2a('0x41'),auth[_0x0e2a('0x5')](),controller['agentNotify']);module[_0x0e2a('0x42')]=router; \ No newline at end of file +var _0x3f1f=['openchannel','/openchannel/queues/:id','/agents/:id/notify','agentNotify','exports','multer','util','path','/voice/channels','isAuthenticated','get','/voice/channels/:uniqueid/stopmixmonitor','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','/sms/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','/outbound/channels','outboundChannels','put','agentCapacity','/telephones','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify'];(function(_0x59c82d,_0x4b6440){var _0x53f0f0=function(_0xe1ab6b){while(--_0xe1ab6b){_0x59c82d['push'](_0x59c82d['shift']());}};_0x53f0f0(++_0x4b6440);}(_0x3f1f,0x109));var _0xf3f1=function(_0xa949c7,_0x4807ef){_0xa949c7=_0xa949c7-0x0;var _0x51da5c=_0x3f1f[_0xa949c7];return _0x51da5c;};'use strict';var multer=require(_0xf3f1('0x0'));var util=require(_0xf3f1('0x1'));var path=require(_0xf3f1('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router['get'](_0xf3f1('0x3'),auth[_0xf3f1('0x4')](),controller['voiceChannels']);router[_0xf3f1('0x5')]('/voice/channels/:uniqueid/mixmonitor',auth[_0xf3f1('0x4')](),controller['voiceChannelMixMonitor']);router['get'](_0xf3f1('0x6'),auth[_0xf3f1('0x4')](),controller['voiceChannelStopMixMonitor']);router[_0xf3f1('0x5')]('/voice/queues',auth[_0xf3f1('0x4')](),controller[_0xf3f1('0x7')]);router[_0xf3f1('0x5')](_0xf3f1('0x8'),auth[_0xf3f1('0x4')](),controller[_0xf3f1('0x9')]);router[_0xf3f1('0x5')]('/mail/queues',auth['isAuthenticated'](),controller[_0xf3f1('0xa')]);router['get'](_0xf3f1('0xb'),auth[_0xf3f1('0x4')](),controller['mailAccounts']);router[_0xf3f1('0x5')]('/openchannel/queues',auth[_0xf3f1('0x4')](),controller['openchannelQueues']);router[_0xf3f1('0x5')](_0xf3f1('0xc'),auth[_0xf3f1('0x4')](),controller['smsQueues']);router[_0xf3f1('0x5')](_0xf3f1('0xd'),auth['isAuthenticated'](),controller[_0xf3f1('0xe')]);router[_0xf3f1('0x5')](_0xf3f1('0xf'),auth[_0xf3f1('0x4')](),controller[_0xf3f1('0x10')]);router[_0xf3f1('0x5')](_0xf3f1('0x11'),auth[_0xf3f1('0x4')](),controller['voiceQueuesChannels']);router['get'](_0xf3f1('0x12'),auth[_0xf3f1('0x4')](),controller[_0xf3f1('0x13')]);router['get'](_0xf3f1('0x14'),auth['isAuthenticated'](),controller[_0xf3f1('0x15')]);router[_0xf3f1('0x5')](_0xf3f1('0x16'),auth[_0xf3f1('0x4')](),controller[_0xf3f1('0x17')]);router['get'](_0xf3f1('0x18'),auth['isAuthenticated'](),controller[_0xf3f1('0x19')]);router['get'](_0xf3f1('0x1a'),auth[_0xf3f1('0x4')](),controller[_0xf3f1('0x1b')]);router[_0xf3f1('0x5')](_0xf3f1('0x1c'),auth[_0xf3f1('0x4')](),controller[_0xf3f1('0x1d')]);router[_0xf3f1('0x5')]('/agents',auth['isAuthenticated'](),controller['agents']);router[_0xf3f1('0x1e')]('/agents/:id/capacity',auth[_0xf3f1('0x4')](),controller[_0xf3f1('0x1f')]);router[_0xf3f1('0x5')](_0xf3f1('0x20'),auth[_0xf3f1('0x4')](),controller[_0xf3f1('0x21')]);router[_0xf3f1('0x5')](_0xf3f1('0x22'),auth[_0xf3f1('0x4')](),controller[_0xf3f1('0x23')]);router[_0xf3f1('0x5')]('/campaigns',auth['isAuthenticated'](),controller[_0xf3f1('0x24')]);router[_0xf3f1('0x5')](_0xf3f1('0x25'),auth[_0xf3f1('0x4')](),controller[_0xf3f1('0x26')]);router[_0xf3f1('0x5')](_0xf3f1('0x27'),auth[_0xf3f1('0x4')](),controller[_0xf3f1('0x28')]);router[_0xf3f1('0x5')](_0xf3f1('0x29'),auth[_0xf3f1('0x4')](),controller['mailQueuesWaitingInteractions']);router[_0xf3f1('0x5')](_0xf3f1('0x2a'),auth[_0xf3f1('0x4')](),controller[_0xf3f1('0x2b')]);router[_0xf3f1('0x5')]('/sms/queues/waitinginteractions',auth[_0xf3f1('0x4')](),controller['smsQueuesWaitingInteractions']);router['get'](_0xf3f1('0x2c'),auth[_0xf3f1('0x4')](),controller[_0xf3f1('0x2d')]);router[_0xf3f1('0x2e')](_0xf3f1('0x2f'),auth[_0xf3f1('0x4')](),controller[_0xf3f1('0x30')](_0xf3f1('0x31')));router['get'](_0xf3f1('0x32'),auth[_0xf3f1('0x4')](),controller[_0xf3f1('0x33')]);router[_0xf3f1('0x2e')](_0xf3f1('0x34'),auth[_0xf3f1('0x4')](),controller[_0xf3f1('0x30')](_0xf3f1('0x35')));router[_0xf3f1('0x5')](_0xf3f1('0x36'),auth[_0xf3f1('0x4')](),controller[_0xf3f1('0x37')]);router[_0xf3f1('0x2e')]('/fax/queues/:id/notify',auth[_0xf3f1('0x4')](),controller[_0xf3f1('0x30')](_0xf3f1('0x38')));router['get'](_0xf3f1('0x39'),auth[_0xf3f1('0x4')](),controller[_0xf3f1('0x3a')]);router[_0xf3f1('0x2e')](_0xf3f1('0x3b'),auth[_0xf3f1('0x4')](),controller[_0xf3f1('0x30')](_0xf3f1('0x3c')));router[_0xf3f1('0x5')](_0xf3f1('0x3d'),auth[_0xf3f1('0x4')](),controller['showOpenchannelQueues']);router[_0xf3f1('0x2e')]('/sms/queues/:id/notify',auth[_0xf3f1('0x4')](),controller[_0xf3f1('0x30')]('sms'));router[_0xf3f1('0x5')]('/sms/queues/:id',auth['isAuthenticated'](),controller['showSmsQueues']);router[_0xf3f1('0x2e')](_0xf3f1('0x3e'),auth['isAuthenticated'](),controller[_0xf3f1('0x3f')]);module[_0xf3f1('0x40')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 05e4b56..ccff33a 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 _0xfb99=['chatQueues','ChatQueues','showChatQueues','showMailQueues','MailQueues','mailAccounts','showOpenchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','Message','findOne','messageId','Interaction','Account','update','queue','InteractionId','From','QueueId','TransferReport','queueTransferTimeout','*,*,*,*','Channel\x20field\x20is\x20mandatory','channel','User','Agent\x20not\x20found','\x20Message\x20not\x20found','MessageId','Start','bluebird','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','then','error','message','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','MemberReport','length','format','YYYY-MM-DD\x20HH:mm:ss','INTERACTION','SIP/%s','interface','agent','internal','AgentCapacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns'];(function(_0x1df172,_0x2b1236){var _0x221797=function(_0x3b5a72){while(--_0x3b5a72){_0x1df172['push'](_0x1df172['shift']());}};_0x221797(++_0x2b1236);}(_0xfb99,0xa3));var _0x9fb9=function(_0x49524d,_0x5ae7a9){_0x49524d=_0x49524d-0x0;var _0x221976=_0xfb99[_0x49524d];return _0x221976;};'use strict';var BPromise=require(_0x9fb9('0x0'));var moment=require('moment');var _=require(_0x9fb9('0x1'));var util=require('util');var db=require(_0x9fb9('0x2'))['db'];var logger=require(_0x9fb9('0x3'))(_0x9fb9('0x4'));var jayson=require(_0x9fb9('0x5'));var amiClient=jayson[_0x9fb9('0x6')][_0x9fb9('0x7')]({'port':0x232a});var mailClient=jayson[_0x9fb9('0x6')][_0x9fb9('0x7')]({'port':0x232b});var routingClient=jayson[_0x9fb9('0x6')][_0x9fb9('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x819882,_0x89311c,_0x19373b){return new BPromise(function(_0x4691f9,_0x35f271){var _0xc568fc=_0x19373b?_0x19373b:amiClient;return _0xc568fc['request'](_0x819882,_0x89311c)[_0x9fb9('0x8')](function(_0xca8dd0){if(_0xca8dd0[_0x9fb9('0x9')]){if(_0xca8dd0['error']['code']===0x1f4){return _0x35f271(_0xca8dd0[_0x9fb9('0x9')][_0x9fb9('0xa')]);}return _0x4691f9(_0xca8dd0['error'][_0x9fb9('0xa')]);}else{_0x4691f9(_0xca8dd0[_0x9fb9('0xb')]);}})[_0x9fb9('0xc')](function(_0x8b6240){_0x35f271(_0x8b6240);});});}function respondWithResult(_0x1e0c46,_0x3ddc7f){_0x3ddc7f=_0x3ddc7f||0xc8;return function(_0x1eb533){if(_0x1eb533){return _0x1e0c46[_0x9fb9('0xd')](_0x3ddc7f)[_0x9fb9('0xe')](_0x1eb533);}return _0x1e0c46[_0x9fb9('0xf')](0x194);};}function handleError(_0x36854c,_0x1328c7){_0x1328c7=_0x1328c7||0x1f4;return function(_0x11a053){logger['error'](_0x11a053[_0x9fb9('0x10')]);if(_0x11a053[_0x9fb9('0x11')]){delete _0x11a053[_0x9fb9('0x11')];}_0x36854c[_0x9fb9('0xd')](_0x1328c7)[_0x9fb9('0x12')](_0x11a053);};}function findById(_0x35f5c0){return function(_0x543d80){if(!_[_0x9fb9('0x13')](_0x35f5c0)&&!_[_0x9fb9('0x13')](_0x543d80)&&!_[_0x9fb9('0x13')](_0x543d80[_0x9fb9('0x14')])){return _[_0x9fb9('0x15')](_0x543d80[_0x9fb9('0x14')],function(_0x2455dc){return _0x2455dc['id']==_0x35f5c0;});}return null;};}exports[_0x9fb9('0x16')]=function(_0x19c711,_0x2977b7){return respondWithRpcPromise('VoiceChannels',_0x19c711['query'])[_0x9fb9('0x8')](respondWithResult(_0x2977b7,null))['catch'](handleError(_0x2977b7,null));};exports[_0x9fb9('0x17')]=function(_0x3833b3,_0x4e1321){return respondWithRpcPromise(_0x9fb9('0x18'),_[_0x9fb9('0x19')](_0x3833b3[_0x9fb9('0x1a')],_0x3833b3[_0x9fb9('0x1b')]))['then'](respondWithResult(_0x4e1321,null))[_0x9fb9('0xc')](handleError(_0x4e1321,null));};exports[_0x9fb9('0x1c')]=function(_0x296205,_0x566fee){return respondWithRpcPromise(_0x9fb9('0x1d'),_[_0x9fb9('0x19')](_0x296205[_0x9fb9('0x1a')],_0x296205[_0x9fb9('0x1b')]))['then'](respondWithResult(_0x566fee,null))[_0x9fb9('0xc')](handleError(_0x566fee,null));};exports[_0x9fb9('0x1e')]=function(_0x23599c,_0x4e4ba5){return respondWithRpcPromise(_0x9fb9('0x1f'),_0x23599c[_0x9fb9('0x1a')])[_0x9fb9('0x8')](respondWithResult(_0x4e4ba5,null))['catch'](handleError(_0x4e4ba5,null));};exports['showVoiceQueues']=function(_0x34adda,_0x14e3bf){return respondWithRpcPromise('VoiceQueues',_0x34adda[_0x9fb9('0x1a')])['then'](findById(_0x34adda['params']['id']))[_0x9fb9('0x8')](respondWithResult(_0x14e3bf,null))['catch'](handleError(_0x14e3bf,null));};exports[_0x9fb9('0x20')]=function(_0x2e3d28,_0x4d1be6){return respondWithRpcPromise(_0x9fb9('0x21'),_[_0x9fb9('0x19')](_0x2e3d28[_0x9fb9('0x1a')],_0x2e3d28['params']))[_0x9fb9('0x8')](respondWithResult(_0x4d1be6,null))['catch'](handleError(_0x4d1be6,null));};exports[_0x9fb9('0x22')]=function(_0x1f6aa6,_0x4c6ba2){return respondWithRpcPromise(_0x9fb9('0x23'),_0x1f6aa6[_0x9fb9('0x1a')])['then'](respondWithResult(_0x4c6ba2,null))[_0x9fb9('0xc')](handleError(_0x4c6ba2,null));};exports['voiceQueuesChannel']=function(_0x5b8ab3,_0x23f3f6){return respondWithRpcPromise(_0x9fb9('0x24'),_[_0x9fb9('0x19')](_0x5b8ab3['query'],_0x5b8ab3[_0x9fb9('0x1b')]))['then'](respondWithResult(_0x23f3f6,null))['catch'](handleError(_0x23f3f6,null));};exports[_0x9fb9('0x25')]=function(_0x5d70f3,_0x1ac887){return respondWithRpcPromise(_0x9fb9('0x26'),_[_0x9fb9('0x19')](_0x5d70f3[_0x9fb9('0x1a')],_0x5d70f3[_0x9fb9('0x1b')]))['then'](respondWithResult(_0x1ac887,null))['catch'](handleError(_0x1ac887,null));};exports[_0x9fb9('0x27')]=function(_0x3a2c41,_0x203aef){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x9fb9('0x19')](_0x3a2c41['query'],_0x3a2c41['params']))[_0x9fb9('0x8')](respondWithResult(_0x203aef,null))[_0x9fb9('0xc')](handleError(_0x203aef,null));};exports[_0x9fb9('0x28')]=function(_0xfd092c,_0x3a5e29){return respondWithRpcPromise(_0x9fb9('0x29'),_0xfd092c['query'])[_0x9fb9('0x8')](respondWithResult(_0x3a5e29,null))[_0x9fb9('0xc')](handleError(_0x3a5e29,null));};exports['outboundChannels']=function(_0x4ccf1f,_0x1b3a80){return respondWithRpcPromise(_0x9fb9('0x2a'),_0x4ccf1f[_0x9fb9('0x1a')])[_0x9fb9('0x8')](respondWithResult(_0x1b3a80,null))['catch'](handleError(_0x1b3a80,null));};exports[_0x9fb9('0x2b')]=function(_0x26bb55,_0x54140e){var _0x92bb0d;return respondWithRpcPromise(_0x9fb9('0x2c'),_0x26bb55[_0x9fb9('0x1a')])[_0x9fb9('0x8')](function(_0x2ddf21){_0x92bb0d=_0x2ddf21;return respondWithRpcPromise('Agents',_0x26bb55[_0x9fb9('0x1a')],routingClient);})[_0x9fb9('0x8')](function(_0x27435a){return _[_0x9fb9('0x19')]({},_0x27435a,_0x92bb0d);})[_0x9fb9('0x8')](respondWithResult(_0x54140e,null))['catch'](handleError(_0x54140e,null));};exports[_0x9fb9('0x2d')]=function(_0x149704,_0x15f803){if(_0x149704[_0x9fb9('0x2e')]&&_0x149704[_0x9fb9('0x2e')][_0x9fb9('0x2f')]&&_0x149704[_0x9fb9('0x30')]&&_0x149704[_0x9fb9('0x30')]['name']){for(var _0xac2d1 in _0x149704[_0x9fb9('0x2e')][_0x9fb9('0x2f')]){if(_0x149704['body']['interaction']['hasOwnProperty'](_0xac2d1)){db[_0x9fb9('0x31')]['findAll']({'where':{'channel':_0xac2d1,'membername':_0x149704[_0x9fb9('0x30')][_0x9fb9('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x149704[_0x9fb9('0x2e')][_0x9fb9('0x2f')][_0xac2d1]&&_0x149704[_0x9fb9('0x2e')][_0x9fb9('0x2f')][_0xac2d1][_0x9fb9('0x32')]?{'$notIn':_0x149704[_0x9fb9('0x2e')][_0x9fb9('0x2f')][_0xac2d1]}:{'$ne':null}}})['then'](function(_0x1625bc){var _0x5e44b6=moment()[_0x9fb9('0x33')](_0x9fb9('0x34'));for(var _0x4efeba=0x0,_0x1b996c=_0x1625bc['length'];_0x4efeba<_0x1b996c;_0x4efeba+=0x1){_0x1625bc[_0x4efeba]['updateAttributes']({'exitAt':_0x5e44b6});}});for(var _0x22b2e3=0x0;_0x22b2e3<_0x149704[_0x9fb9('0x2e')][_0x9fb9('0x2f')][_0xac2d1][_0x9fb9('0x32')];_0x22b2e3+=0x1){db[_0x9fb9('0x31')]['findOrCreate']({'where':{'channel':_0xac2d1,'membername':_0x149704[_0x9fb9('0x30')][_0x9fb9('0x11')],'type':_0x9fb9('0x35'),'uniqueid':_0x149704[_0x9fb9('0x2e')][_0x9fb9('0x2f')][_0xac2d1][_0x22b2e3],'exitAt':null},'defaults':{'channel':_0xac2d1,'membername':_0x149704[_0x9fb9('0x30')]['name'],'interface':_['isNil'](_0x149704[_0x9fb9('0x30')]['interface'])?util[_0x9fb9('0x33')](_0x9fb9('0x36'),_0x149704[_0x9fb9('0x30')][_0x9fb9('0x11')]):_0x149704[_0x9fb9('0x30')][_0x9fb9('0x37')],'type':_0x9fb9('0x35'),'enterAt':moment()[_0x9fb9('0x33')](_0x9fb9('0x34')),'role':_0x9fb9('0x38'),'internal':_0x149704[_0x9fb9('0x30')][_0x9fb9('0x39')],'uniqueid':_0x149704[_0x9fb9('0x2e')][_0x9fb9('0x2f')][_0xac2d1][_0x22b2e3]}});}}}}return respondWithRpcPromise(_0x9fb9('0x3a'),{'id':_0x149704[_0x9fb9('0x1b')]['id'],'capacity':_0x149704[_0x9fb9('0x2e')]['capacity']},routingClient)[_0x9fb9('0x8')](respondWithResult(_0x15f803,null))[_0x9fb9('0xc')](handleError(_0x15f803,null));};exports[_0x9fb9('0x3b')]=function(_0x37a1cb,_0x27adef){return respondWithRpcPromise(_0x9fb9('0x3c'),_0x37a1cb['query'])['then'](respondWithResult(_0x27adef,null))[_0x9fb9('0xc')](handleError(_0x27adef,null));};exports[_0x9fb9('0x3d')]=function(_0x365f43,_0x54f740){return respondWithRpcPromise(_0x9fb9('0x3e'),_0x365f43['query'])[_0x9fb9('0x8')](respondWithResult(_0x54f740,null))['catch'](handleError(_0x54f740,null));};exports[_0x9fb9('0x3f')]=function(_0x57818c,_0x336f99){return respondWithRpcPromise(_0x9fb9('0x40'),_0x57818c[_0x9fb9('0x1a')])[_0x9fb9('0x8')](respondWithResult(_0x336f99,null))[_0x9fb9('0xc')](handleError(_0x336f99,null));};exports[_0x9fb9('0x41')]=function(_0x372508,_0x3c46d3){return respondWithRpcPromise(_0x9fb9('0x42'),_0x372508['query'],routingClient)[_0x9fb9('0x8')](respondWithResult(_0x3c46d3,null))['catch'](handleError(_0x3c46d3,null));};exports[_0x9fb9('0x43')]=function(_0x44cc05,_0x3adfdd){return respondWithRpcPromise(_0x9fb9('0x42'),_0x44cc05['query'],routingClient)[_0x9fb9('0x8')](findById(_0x44cc05[_0x9fb9('0x1b')]['id']))[_0x9fb9('0x8')](respondWithResult(_0x3adfdd,null))[_0x9fb9('0xc')](handleError(_0x3adfdd,null));};exports['mailQueues']=function(_0x2521eb,_0x319aaf){return respondWithRpcPromise('MailQueues',_0x2521eb[_0x9fb9('0x1a')],routingClient)['then'](respondWithResult(_0x319aaf,null))[_0x9fb9('0xc')](handleError(_0x319aaf,null));};exports[_0x9fb9('0x44')]=function(_0x6444ab,_0x1bbc24){return respondWithRpcPromise(_0x9fb9('0x45'),_0x6444ab['query'],routingClient)['then'](findById(_0x6444ab['params']['id']))[_0x9fb9('0x8')](respondWithResult(_0x1bbc24,null))[_0x9fb9('0xc')](handleError(_0x1bbc24,null));};exports[_0x9fb9('0x46')]=function(_0x192203,_0x59c692){return respondWithRpcPromise('MailAccounts',_0x192203[_0x9fb9('0x1a')],mailClient)[_0x9fb9('0x8')](respondWithResult(_0x59c692,null))[_0x9fb9('0xc')](handleError(_0x59c692,null));};exports['openchannelQueues']=function(_0x23dc8b,_0x12b27a){return respondWithRpcPromise('OpenchannelQueues',_0x23dc8b[_0x9fb9('0x1a')],routingClient)['then'](respondWithResult(_0x12b27a,null))[_0x9fb9('0xc')](handleError(_0x12b27a,null));};exports[_0x9fb9('0x47')]=function(_0x55a0ef,_0x6d838a){return respondWithRpcPromise(_0x9fb9('0x48'),_0x55a0ef[_0x9fb9('0x1a')],routingClient)['then'](findById(_0x55a0ef['params']['id']))[_0x9fb9('0x8')](respondWithResult(_0x6d838a,null))['catch'](handleError(_0x6d838a,null));};exports[_0x9fb9('0x49')]=function(_0xd9a25,_0x4b4ebf){return respondWithRpcPromise(_0x9fb9('0x4a'),_0xd9a25[_0x9fb9('0x1a')],routingClient)[_0x9fb9('0x8')](respondWithResult(_0x4b4ebf,null))[_0x9fb9('0xc')](handleError(_0x4b4ebf,null));};exports['showSmsQueues']=function(_0x5445b1,_0x30cc67){return respondWithRpcPromise(_0x9fb9('0x4a'),_0x5445b1[_0x9fb9('0x1a')],routingClient)['then'](findById(_0x5445b1[_0x9fb9('0x1b')]['id']))[_0x9fb9('0x8')](respondWithResult(_0x30cc67,null))['catch'](handleError(_0x30cc67,null));};exports[_0x9fb9('0x4b')]=function(_0x3b7630,_0x1b83e2){return respondWithRpcPromise(_0x9fb9('0x4c'),_0x3b7630[_0x9fb9('0x1a')],routingClient)['then'](respondWithResult(_0x1b83e2,null))[_0x9fb9('0xc')](handleError(_0x1b83e2,null));};exports[_0x9fb9('0x4d')]=function(_0x2d843f,_0xe1a96a){return respondWithRpcPromise(_0x9fb9('0x4c'),_0x2d843f[_0x9fb9('0x1a')],routingClient)[_0x9fb9('0x8')](findById(_0x2d843f['params']['id']))[_0x9fb9('0x8')](respondWithResult(_0xe1a96a,null))[_0x9fb9('0xc')](handleError(_0xe1a96a,null));};exports[_0x9fb9('0x4e')]=function(_0x11d0a6,_0x571298){return respondWithRpcPromise(_0x9fb9('0x4f'),_0x11d0a6[_0x9fb9('0x1a')])[_0x9fb9('0x8')](respondWithResult(_0x571298,null))['catch'](handleError(_0x571298,null));};exports[_0x9fb9('0x50')]=function(_0x4720a5,_0x2394ff){return respondWithRpcPromise(_0x9fb9('0x51'),_0x4720a5['query'],routingClient)[_0x9fb9('0x8')](respondWithResult(_0x2394ff,null))[_0x9fb9('0xc')](handleError(_0x2394ff,null));};exports['mailQueuesWaitingInteractions']=function(_0x4ccd23,_0x2de527){return respondWithRpcPromise(_0x9fb9('0x52'),_0x4ccd23[_0x9fb9('0x1a')],routingClient)['then'](respondWithResult(_0x2de527,null))[_0x9fb9('0xc')](handleError(_0x2de527,null));};exports[_0x9fb9('0x53')]=function(_0x5a924a,_0x4bd1a9){return respondWithRpcPromise(_0x9fb9('0x54'),_0x5a924a[_0x9fb9('0x1a')],routingClient)[_0x9fb9('0x8')](respondWithResult(_0x4bd1a9,null))[_0x9fb9('0xc')](handleError(_0x4bd1a9,null));};exports[_0x9fb9('0x55')]=function(_0x1c2869,_0x11f2bc){return respondWithRpcPromise(_0x9fb9('0x56'),_0x1c2869[_0x9fb9('0x1a')],routingClient)[_0x9fb9('0x8')](respondWithResult(_0x11f2bc,null))[_0x9fb9('0xc')](handleError(_0x11f2bc,null));};exports[_0x9fb9('0x57')]=function(_0x329333,_0x15fb2c){return respondWithRpcPromise(_0x9fb9('0x58'),_0x329333['query'],routingClient)[_0x9fb9('0x8')](respondWithResult(_0x15fb2c,null))['catch'](handleError(_0x15fb2c,null));};exports[_0x9fb9('0x59')]=function(_0x47afda){return function(_0x5eda55,_0xb4aa26){var _0x3c581d,_0x5e9a5d;var _0x45355b=_[_0x9fb9('0x5a')](_0x47afda);var _0x42cb4e=_0x47afda===_0x9fb9('0x5b')?_0x9fb9('0x5c'):'Account';return db[_0x45355b+_0x9fb9('0x5d')]['findOne']({'raw':!![],'where':{'id':_0x5eda55[_0x9fb9('0x1b')]['id']}})['then'](function(_0x4d2b13){if(_[_0x9fb9('0x13')](_0x4d2b13)){throw new Error(_0x45355b+'\x20Queue\x20not\x20found');}_0x3c581d=_0x4d2b13;return db[_0x45355b+_0x9fb9('0x5e')][_0x9fb9('0x5f')]({'where':{'id':_0x5eda55[_0x9fb9('0x2e')][_0x9fb9('0x60')]},'include':[{'model':db[_0x45355b+_0x9fb9('0x61')],'as':_0x9fb9('0x61')},{'model':db[_0x45355b+_0x42cb4e],'as':_0x9fb9('0x62')}]});})['then'](function(_0x4f17de){if(_[_0x9fb9('0x13')](_0x4f17de)){throw new Error(_0x45355b+'\x20Message\x20not\x20found');}_0x5e9a5d=_0x4f17de;return _0x4f17de[_0x9fb9('0x63')]({'read':0x0,'readAt':null,'UserId':null});})[_0x9fb9('0x8')](function(){var _0x2b3bf9={'uniqueid':_0x47afda+'.'+_0x5e9a5d['id']+'.'+_0x5e9a5d[_0x9fb9('0x61')]['id'],'FromUserId':_0x5eda55['user']['id'],'type':_0x9fb9('0x64')};_0x2b3bf9[_0x45355b+'MessageId']=_0x5e9a5d['id'];_0x2b3bf9[_0x45355b+_0x9fb9('0x65')]=_0x5e9a5d['Interaction']['id'];_0x2b3bf9[_0x9fb9('0x66')+_0x45355b+_0x42cb4e+'Id']=_0x5e9a5d[_0x9fb9('0x62')]['id'];_0x2b3bf9['To'+_0x45355b+_0x9fb9('0x67')]=_0x3c581d['id'];return db[_0x45355b+_0x9fb9('0x68')]['create'](_0x2b3bf9);})[_0x9fb9('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x47afda,'interaction':_0x5e9a5d[_0x9fb9('0x61')],'message':_0x5e9a5d,'account':_0x5e9a5d[_0x9fb9('0x62')],'applications':[{'id':0x0,'priority':0x1,'app':_0x9fb9('0x64'),'appdata':_0x3c581d[_0x9fb9('0x11')]+','+(_0x5e9a5d[_0x9fb9('0x62')][_0x9fb9('0x69')]||0x12c),'interval':_0x9fb9('0x6a')}]},routingClient);})[_0x9fb9('0x8')](respondWithResult(_0xb4aa26,null))['catch'](handleError(_0xb4aa26,null));};};exports['agentNotify']=function(_0x5e206f,_0x2cab97){var _0x3e071f,_0x5a903d;if(_['isNil'](_0x5e206f[_0x9fb9('0x2e')]['channel'])){throw new Error(_0x9fb9('0x6b'));}var _0x2eb457=_0x5e206f['body'][_0x9fb9('0x6c')];var _0x4b3d7c=_[_0x9fb9('0x5a')](_0x2eb457);var _0x13f1eb=_0x2eb457===_0x9fb9('0x5b')?_0x9fb9('0x5c'):_0x9fb9('0x62');return db[_0x9fb9('0x6d')][_0x9fb9('0x5f')]({'raw':!![],'where':{'id':_0x5e206f[_0x9fb9('0x1b')]['id'],'role':_0x9fb9('0x38')}})['then'](function(_0xd860b0){if(_[_0x9fb9('0x13')](_0xd860b0)){throw new Error(_0x9fb9('0x6e'));}_0x3e071f=_0xd860b0;return db[_0x4b3d7c+_0x9fb9('0x5e')][_0x9fb9('0x5f')]({'where':{'id':_0x5e206f[_0x9fb9('0x2e')][_0x9fb9('0x60')]},'include':[{'model':db[_0x4b3d7c+_0x9fb9('0x61')],'as':_0x9fb9('0x61')},{'model':db[_0x4b3d7c+_0x13f1eb],'as':_0x9fb9('0x62')}]});})[_0x9fb9('0x8')](function(_0xe24861){if(_['isNil'](_0xe24861)){throw new Error(_0x4b3d7c+_0x9fb9('0x6f'));}_0x5a903d=_0xe24861;return _0xe24861['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x56c1e0={'uniqueid':_0x2eb457+'.'+_0x5a903d['id']+'.'+_0x5a903d['Interaction']['id'],'FromUserId':_0x5e206f[_0x9fb9('0x30')]['id'],'type':_0x9fb9('0x64'),'ToUserId':_0x3e071f['id']};_0x56c1e0[_0x4b3d7c+_0x9fb9('0x70')]=_0x5a903d['id'];_0x56c1e0[_0x4b3d7c+_0x9fb9('0x65')]=_0x5a903d['Interaction']['id'];_0x56c1e0['From'+_0x4b3d7c+_0x13f1eb+'Id']=_0x5a903d[_0x9fb9('0x62')]['id'];return db[_0x4b3d7c+'TransferReport']['create'](_0x56c1e0);})[_0x9fb9('0x8')](function(){return respondWithRpcPromise(_0x9fb9('0x71'),{'channel':_0x2eb457,'interaction':_0x5a903d[_0x9fb9('0x61')],'message':_0x5a903d,'account':_0x5a903d[_0x9fb9('0x62')],'applications':[{'id':0x0,'priority':0x1,'app':_0x9fb9('0x38'),'appdata':_0x3e071f[_0x9fb9('0x11')]+','+(_0x5a903d['Account']['agentTransferTimeout']||0x12c),'interval':_0x9fb9('0x6a')}]},routingClient);})[_0x9fb9('0x8')](respondWithResult(_0x2cab97,null))[_0x9fb9('0xc')](handleError(_0x2cab97,null));}; \ No newline at end of file +var _0xba0e=['VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','body','user','interaction','MemberReport','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','interface','agent','AgentCapacity','telephones','Telephones','trunks','Trunks','Campaigns','chatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Queue','\x20Queue\x20not\x20found','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','InteractionId','From','Account','TransferReport','create','Start','channel','Channel\x20field\x20is\x20mandatory','Website','Agent\x20not\x20found','Message','MessageId','agentTransferTimeout','*,*,*,*','bluebird','lodash','util','../../mysqldb','../../config/logger','client','http','then','error','message','result','status','json','sendStatus','name','send','isNil','rows','find','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect'];(function(_0x406214,_0xfe8489){var _0x5855ea=function(_0x4e6927){while(--_0x4e6927){_0x406214['push'](_0x406214['shift']());}};_0x5855ea(++_0xfe8489);}(_0xba0e,0x129));var _0xeba0=function(_0x2ed0e3,_0x27c8ab){_0x2ed0e3=_0x2ed0e3-0x0;var _0x1ac688=_0xba0e[_0x2ed0e3];return _0x1ac688;};'use strict';var BPromise=require(_0xeba0('0x0'));var moment=require('moment');var _=require(_0xeba0('0x1'));var util=require(_0xeba0('0x2'));var db=require(_0xeba0('0x3'))['db'];var logger=require(_0xeba0('0x4'))('api');var jayson=require('jayson/promise');var amiClient=jayson[_0xeba0('0x5')][_0xeba0('0x6')]({'port':0x232a});var mailClient=jayson[_0xeba0('0x5')][_0xeba0('0x6')]({'port':0x232b});var routingClient=jayson[_0xeba0('0x5')][_0xeba0('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x3f8e71,_0x556e93,_0x10b9d0){return new BPromise(function(_0x4a845c,_0x3473cc){var _0x40ba4b=_0x10b9d0?_0x10b9d0:amiClient;return _0x40ba4b['request'](_0x3f8e71,_0x556e93)[_0xeba0('0x7')](function(_0x13e271){if(_0x13e271[_0xeba0('0x8')]){if(_0x13e271[_0xeba0('0x8')]['code']===0x1f4){return _0x3473cc(_0x13e271['error'][_0xeba0('0x9')]);}return _0x4a845c(_0x13e271['error'][_0xeba0('0x9')]);}else{_0x4a845c(_0x13e271[_0xeba0('0xa')]);}})['catch'](function(_0x3d5775){_0x3473cc(_0x3d5775);});});}function respondWithResult(_0x5c8060,_0x3d6a12){_0x3d6a12=_0x3d6a12||0xc8;return function(_0x51e4bf){if(_0x51e4bf){return _0x5c8060[_0xeba0('0xb')](_0x3d6a12)[_0xeba0('0xc')](_0x51e4bf);}return _0x5c8060[_0xeba0('0xd')](0x194);};}function handleError(_0x12ff69,_0x588a08){_0x588a08=_0x588a08||0x1f4;return function(_0x3c1e2c){logger[_0xeba0('0x8')](_0x3c1e2c['stack']);if(_0x3c1e2c[_0xeba0('0xe')]){delete _0x3c1e2c[_0xeba0('0xe')];}_0x12ff69[_0xeba0('0xb')](_0x588a08)[_0xeba0('0xf')](_0x3c1e2c);};}function findById(_0x354b6b){return function(_0x434584){if(!_['isNil'](_0x354b6b)&&!_[_0xeba0('0x10')](_0x434584)&&!_[_0xeba0('0x10')](_0x434584[_0xeba0('0x11')])){return _[_0xeba0('0x12')](_0x434584[_0xeba0('0x11')],function(_0x6f0e39){return _0x6f0e39['id']==_0x354b6b;});}return null;};}exports['voiceChannels']=function(_0x3f515b,_0x28fed9){return respondWithRpcPromise(_0xeba0('0x13'),_0x3f515b[_0xeba0('0x14')])[_0xeba0('0x7')](respondWithResult(_0x28fed9,null))[_0xeba0('0x15')](handleError(_0x28fed9,null));};exports[_0xeba0('0x16')]=function(_0x278ed,_0x26e86b){return respondWithRpcPromise(_0xeba0('0x17'),_[_0xeba0('0x18')](_0x278ed['query'],_0x278ed[_0xeba0('0x19')]))[_0xeba0('0x7')](respondWithResult(_0x26e86b,null))[_0xeba0('0x15')](handleError(_0x26e86b,null));};exports[_0xeba0('0x1a')]=function(_0xa8689c,_0xa6b2f3){return respondWithRpcPromise(_0xeba0('0x1b'),_[_0xeba0('0x18')](_0xa8689c[_0xeba0('0x14')],_0xa8689c[_0xeba0('0x19')]))[_0xeba0('0x7')](respondWithResult(_0xa6b2f3,null))['catch'](handleError(_0xa6b2f3,null));};exports[_0xeba0('0x1c')]=function(_0x5e51cd,_0x5280a8){return respondWithRpcPromise(_0xeba0('0x1d'),_0x5e51cd[_0xeba0('0x14')])[_0xeba0('0x7')](respondWithResult(_0x5280a8,null))['catch'](handleError(_0x5280a8,null));};exports[_0xeba0('0x1e')]=function(_0x46237e,_0x1d4aaf){return respondWithRpcPromise('VoiceQueues',_0x46237e['query'])[_0xeba0('0x7')](findById(_0x46237e[_0xeba0('0x19')]['id']))[_0xeba0('0x7')](respondWithResult(_0x1d4aaf,null))['catch'](handleError(_0x1d4aaf,null));};exports['voiceQueuesPreview']=function(_0x2c13bb,_0x4fc3c8){return respondWithRpcPromise(_0xeba0('0x1f'),_[_0xeba0('0x18')](_0x2c13bb[_0xeba0('0x14')],_0x2c13bb[_0xeba0('0x19')]))[_0xeba0('0x7')](respondWithResult(_0x4fc3c8,null))[_0xeba0('0x15')](handleError(_0x4fc3c8,null));};exports[_0xeba0('0x20')]=function(_0x9eb986,_0x530a13){return respondWithRpcPromise(_0xeba0('0x21'),_0x9eb986[_0xeba0('0x14')])[_0xeba0('0x7')](respondWithResult(_0x530a13,null))[_0xeba0('0x15')](handleError(_0x530a13,null));};exports[_0xeba0('0x22')]=function(_0x19dbd5,_0x245a8c){return respondWithRpcPromise(_0xeba0('0x23'),_[_0xeba0('0x18')](_0x19dbd5[_0xeba0('0x14')],_0x19dbd5[_0xeba0('0x19')]))[_0xeba0('0x7')](respondWithResult(_0x245a8c,null))[_0xeba0('0x15')](handleError(_0x245a8c,null));};exports[_0xeba0('0x24')]=function(_0x518f6b,_0x4ab5c3){return respondWithRpcPromise(_0xeba0('0x25'),_[_0xeba0('0x18')](_0x518f6b[_0xeba0('0x14')],_0x518f6b['params']))[_0xeba0('0x7')](respondWithResult(_0x4ab5c3,null))[_0xeba0('0x15')](handleError(_0x4ab5c3,null));};exports[_0xeba0('0x26')]=function(_0x299ca2,_0x7edd69){return respondWithRpcPromise(_0xeba0('0x27'),_[_0xeba0('0x18')](_0x299ca2[_0xeba0('0x14')],_0x299ca2[_0xeba0('0x19')]))[_0xeba0('0x7')](respondWithResult(_0x7edd69,null))[_0xeba0('0x15')](handleError(_0x7edd69,null));};exports[_0xeba0('0x28')]=function(_0x8c251a,_0x25725c){return respondWithRpcPromise(_0xeba0('0x29'),_0x8c251a[_0xeba0('0x14')])[_0xeba0('0x7')](respondWithResult(_0x25725c,null))[_0xeba0('0x15')](handleError(_0x25725c,null));};exports[_0xeba0('0x2a')]=function(_0x17b6d9,_0x243aaf){return respondWithRpcPromise(_0xeba0('0x2b'),_0x17b6d9[_0xeba0('0x14')])[_0xeba0('0x7')](respondWithResult(_0x243aaf,null))['catch'](handleError(_0x243aaf,null));};exports['agents']=function(_0x478925,_0x5f507d){var _0x28e6d6;return respondWithRpcPromise('Agents',_0x478925[_0xeba0('0x14')])['then'](function(_0x250461){_0x28e6d6=_0x250461;return respondWithRpcPromise(_0xeba0('0x2c'),_0x478925[_0xeba0('0x14')],routingClient);})[_0xeba0('0x7')](function(_0x46f85f){return _[_0xeba0('0x18')]({},_0x46f85f,_0x28e6d6);})[_0xeba0('0x7')](respondWithResult(_0x5f507d,null))[_0xeba0('0x15')](handleError(_0x5f507d,null));};exports[_0xeba0('0x2d')]=function(_0x3efe04,_0x4fff4b){if(_0x3efe04[_0xeba0('0x2e')]&&_0x3efe04[_0xeba0('0x2e')]['interaction']&&_0x3efe04['user']&&_0x3efe04[_0xeba0('0x2f')][_0xeba0('0xe')]){for(var _0x5a5027 in _0x3efe04['body'][_0xeba0('0x30')]){if(_0x3efe04[_0xeba0('0x2e')]['interaction']['hasOwnProperty'](_0x5a5027)){db[_0xeba0('0x31')][_0xeba0('0x32')]({'where':{'channel':_0x5a5027,'membername':_0x3efe04[_0xeba0('0x2f')][_0xeba0('0xe')],'type':_0xeba0('0x33'),'exitAt':null,'uniqueid':_0x3efe04[_0xeba0('0x2e')][_0xeba0('0x30')][_0x5a5027]&&_0x3efe04[_0xeba0('0x2e')][_0xeba0('0x30')][_0x5a5027]['length']?{'$notIn':_0x3efe04['body']['interaction'][_0x5a5027]}:{'$ne':null}}})[_0xeba0('0x7')](function(_0x41f4ca){var _0x4d7c6b=moment()[_0xeba0('0x34')](_0xeba0('0x35'));for(var _0x43bf1d=0x0,_0xf18e50=_0x41f4ca[_0xeba0('0x36')];_0x43bf1d<_0xf18e50;_0x43bf1d+=0x1){_0x41f4ca[_0x43bf1d][_0xeba0('0x37')]({'exitAt':_0x4d7c6b});}});for(var _0x1dc657=0x0;_0x1dc657<_0x3efe04['body'][_0xeba0('0x30')][_0x5a5027][_0xeba0('0x36')];_0x1dc657+=0x1){db[_0xeba0('0x31')][_0xeba0('0x38')]({'where':{'channel':_0x5a5027,'membername':_0x3efe04['user'][_0xeba0('0xe')],'type':_0xeba0('0x33'),'uniqueid':_0x3efe04[_0xeba0('0x2e')][_0xeba0('0x30')][_0x5a5027][_0x1dc657],'exitAt':null},'defaults':{'channel':_0x5a5027,'membername':_0x3efe04['user'][_0xeba0('0xe')],'interface':_[_0xeba0('0x10')](_0x3efe04[_0xeba0('0x2f')][_0xeba0('0x39')])?util[_0xeba0('0x34')]('SIP/%s',_0x3efe04[_0xeba0('0x2f')][_0xeba0('0xe')]):_0x3efe04[_0xeba0('0x2f')]['interface'],'type':_0xeba0('0x33'),'enterAt':moment()[_0xeba0('0x34')](_0xeba0('0x35')),'role':_0xeba0('0x3a'),'internal':_0x3efe04[_0xeba0('0x2f')]['internal'],'uniqueid':_0x3efe04[_0xeba0('0x2e')][_0xeba0('0x30')][_0x5a5027][_0x1dc657]}});}}}}return respondWithRpcPromise(_0xeba0('0x3b'),{'id':_0x3efe04[_0xeba0('0x19')]['id'],'capacity':_0x3efe04['body']['capacity']},routingClient)[_0xeba0('0x7')](respondWithResult(_0x4fff4b,null))[_0xeba0('0x15')](handleError(_0x4fff4b,null));};exports[_0xeba0('0x3c')]=function(_0x3a35a7,_0x39df4a){return respondWithRpcPromise(_0xeba0('0x3d'),_0x3a35a7['query'])['then'](respondWithResult(_0x39df4a,null))['catch'](handleError(_0x39df4a,null));};exports[_0xeba0('0x3e')]=function(_0x280ba5,_0x2b3123){return respondWithRpcPromise(_0xeba0('0x3f'),_0x280ba5[_0xeba0('0x14')])['then'](respondWithResult(_0x2b3123,null))[_0xeba0('0x15')](handleError(_0x2b3123,null));};exports['campaigns']=function(_0x255d46,_0x1da64e){return respondWithRpcPromise(_0xeba0('0x40'),_0x255d46[_0xeba0('0x14')])[_0xeba0('0x7')](respondWithResult(_0x1da64e,null))[_0xeba0('0x15')](handleError(_0x1da64e,null));};exports[_0xeba0('0x41')]=function(_0x153fdd,_0x4a9c17){return respondWithRpcPromise('ChatQueues',_0x153fdd['query'],routingClient)[_0xeba0('0x7')](respondWithResult(_0x4a9c17,null))['catch'](handleError(_0x4a9c17,null));};exports['showChatQueues']=function(_0x1d282e,_0x38df5a){return respondWithRpcPromise(_0xeba0('0x42'),_0x1d282e['query'],routingClient)['then'](findById(_0x1d282e[_0xeba0('0x19')]['id']))[_0xeba0('0x7')](respondWithResult(_0x38df5a,null))[_0xeba0('0x15')](handleError(_0x38df5a,null));};exports['mailQueues']=function(_0x3025d3,_0x597cab){return respondWithRpcPromise(_0xeba0('0x43'),_0x3025d3[_0xeba0('0x14')],routingClient)['then'](respondWithResult(_0x597cab,null))['catch'](handleError(_0x597cab,null));};exports[_0xeba0('0x44')]=function(_0x20bf5f,_0x54aa98){return respondWithRpcPromise(_0xeba0('0x43'),_0x20bf5f[_0xeba0('0x14')],routingClient)['then'](findById(_0x20bf5f['params']['id']))[_0xeba0('0x7')](respondWithResult(_0x54aa98,null))[_0xeba0('0x15')](handleError(_0x54aa98,null));};exports[_0xeba0('0x45')]=function(_0x3b56f3,_0x37e547){return respondWithRpcPromise(_0xeba0('0x46'),_0x3b56f3[_0xeba0('0x14')],mailClient)['then'](respondWithResult(_0x37e547,null))[_0xeba0('0x15')](handleError(_0x37e547,null));};exports[_0xeba0('0x47')]=function(_0x57b99f,_0x295af5){return respondWithRpcPromise(_0xeba0('0x48'),_0x57b99f[_0xeba0('0x14')],routingClient)['then'](respondWithResult(_0x295af5,null))[_0xeba0('0x15')](handleError(_0x295af5,null));};exports[_0xeba0('0x49')]=function(_0x51041a,_0x5490c6){return respondWithRpcPromise(_0xeba0('0x48'),_0x51041a['query'],routingClient)[_0xeba0('0x7')](findById(_0x51041a[_0xeba0('0x19')]['id']))[_0xeba0('0x7')](respondWithResult(_0x5490c6,null))[_0xeba0('0x15')](handleError(_0x5490c6,null));};exports['smsQueues']=function(_0x3fe0a7,_0x39109c){return respondWithRpcPromise(_0xeba0('0x4a'),_0x3fe0a7[_0xeba0('0x14')],routingClient)[_0xeba0('0x7')](respondWithResult(_0x39109c,null))[_0xeba0('0x15')](handleError(_0x39109c,null));};exports[_0xeba0('0x4b')]=function(_0x665235,_0x571a59){return respondWithRpcPromise(_0xeba0('0x4a'),_0x665235[_0xeba0('0x14')],routingClient)['then'](findById(_0x665235[_0xeba0('0x19')]['id']))[_0xeba0('0x7')](respondWithResult(_0x571a59,null))[_0xeba0('0x15')](handleError(_0x571a59,null));};exports[_0xeba0('0x4c')]=function(_0x52bfce,_0x32fae8){return respondWithRpcPromise(_0xeba0('0x4d'),_0x52bfce[_0xeba0('0x14')],routingClient)[_0xeba0('0x7')](respondWithResult(_0x32fae8,null))['catch'](handleError(_0x32fae8,null));};exports[_0xeba0('0x4e')]=function(_0x2d50c2,_0x4a687b){return respondWithRpcPromise(_0xeba0('0x4d'),_0x2d50c2[_0xeba0('0x14')],routingClient)[_0xeba0('0x7')](findById(_0x2d50c2[_0xeba0('0x19')]['id']))[_0xeba0('0x7')](respondWithResult(_0x4a687b,null))[_0xeba0('0x15')](handleError(_0x4a687b,null));};exports[_0xeba0('0x4f')]=function(_0x16be5b,_0x2626d9){return respondWithRpcPromise(_0xeba0('0x50'),_0x16be5b['query'])[_0xeba0('0x7')](respondWithResult(_0x2626d9,null))['catch'](handleError(_0x2626d9,null));};exports[_0xeba0('0x51')]=function(_0x59d18f,_0xeddeac){return respondWithRpcPromise(_0xeba0('0x52'),_0x59d18f[_0xeba0('0x14')],routingClient)[_0xeba0('0x7')](respondWithResult(_0xeddeac,null))['catch'](handleError(_0xeddeac,null));};exports[_0xeba0('0x53')]=function(_0x3534fe,_0xb45a0a){return respondWithRpcPromise(_0xeba0('0x54'),_0x3534fe['query'],routingClient)[_0xeba0('0x7')](respondWithResult(_0xb45a0a,null))[_0xeba0('0x15')](handleError(_0xb45a0a,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x35be97,_0x48d1cc){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x35be97[_0xeba0('0x14')],routingClient)['then'](respondWithResult(_0x48d1cc,null))[_0xeba0('0x15')](handleError(_0x48d1cc,null));};exports['smsQueuesWaitingInteractions']=function(_0x613774,_0x3dfc12){return respondWithRpcPromise(_0xeba0('0x55'),_0x613774[_0xeba0('0x14')],routingClient)[_0xeba0('0x7')](respondWithResult(_0x3dfc12,null))[_0xeba0('0x15')](handleError(_0x3dfc12,null));};exports[_0xeba0('0x56')]=function(_0x17cd06,_0x3cfb68){return respondWithRpcPromise(_0xeba0('0x57'),_0x17cd06['query'],routingClient)[_0xeba0('0x7')](respondWithResult(_0x3cfb68,null))[_0xeba0('0x15')](handleError(_0x3cfb68,null));};exports['queueNotify']=function(_0x3af743){return function(_0x448eae,_0x19713f){var _0x5e324f,_0x5ac451;var _0x125642=_[_0xeba0('0x58')](_0x3af743);var _0x2a825f=_0x3af743===_0xeba0('0x59')?'Website':'Account';return db[_0x125642+_0xeba0('0x5a')]['findOne']({'raw':!![],'where':{'id':_0x448eae[_0xeba0('0x19')]['id']}})['then'](function(_0x4384f9){if(_[_0xeba0('0x10')](_0x4384f9)){throw new Error(_0x125642+_0xeba0('0x5b'));}_0x5e324f=_0x4384f9;return db[_0x125642+'Message'][_0xeba0('0x5c')]({'where':{'id':_0x448eae[_0xeba0('0x2e')][_0xeba0('0x5d')]},'include':[{'model':db[_0x125642+_0xeba0('0x5e')],'as':_0xeba0('0x5e')},{'model':db[_0x125642+_0x2a825f],'as':'Account'}]});})['then'](function(_0x159393){if(_[_0xeba0('0x10')](_0x159393)){throw new Error(_0x125642+_0xeba0('0x5f'));}_0x5ac451=_0x159393;return _0x159393[_0xeba0('0x60')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x3a922e={'uniqueid':_0x3af743+'.'+_0x5ac451['id']+'.'+_0x5ac451['Interaction']['id'],'FromUserId':_0x448eae[_0xeba0('0x2f')]['id'],'type':_0xeba0('0x61')};_0x3a922e[_0x125642+'MessageId']=_0x5ac451['id'];_0x3a922e[_0x125642+_0xeba0('0x62')]=_0x5ac451['Interaction']['id'];_0x3a922e[_0xeba0('0x63')+_0x125642+_0x2a825f+'Id']=_0x5ac451[_0xeba0('0x64')]['id'];_0x3a922e['To'+_0x125642+'QueueId']=_0x5e324f['id'];return db[_0x125642+_0xeba0('0x65')][_0xeba0('0x66')](_0x3a922e);})[_0xeba0('0x7')](function(){return respondWithRpcPromise(_0xeba0('0x67'),{'channel':_0x3af743,'interaction':_0x5ac451[_0xeba0('0x5e')],'message':_0x5ac451,'account':_0x5ac451[_0xeba0('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xeba0('0x61'),'appdata':_0x5e324f['name']+','+(_0x5ac451[_0xeba0('0x64')]['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xeba0('0x7')](respondWithResult(_0x19713f,null))[_0xeba0('0x15')](handleError(_0x19713f,null));};};exports['agentNotify']=function(_0x393b49,_0x5799d3){var _0x5d4f13,_0x3fc030;if(_[_0xeba0('0x10')](_0x393b49[_0xeba0('0x2e')][_0xeba0('0x68')])){throw new Error(_0xeba0('0x69'));}var _0x3bb1e4=_0x393b49[_0xeba0('0x2e')][_0xeba0('0x68')];var _0x4dc2f4=_[_0xeba0('0x58')](_0x3bb1e4);var _0x23d43d=_0x3bb1e4===_0xeba0('0x59')?_0xeba0('0x6a'):'Account';return db['User'][_0xeba0('0x5c')]({'raw':!![],'where':{'id':_0x393b49[_0xeba0('0x19')]['id'],'role':'agent'}})[_0xeba0('0x7')](function(_0x4dd1ba){if(_[_0xeba0('0x10')](_0x4dd1ba)){throw new Error(_0xeba0('0x6b'));}_0x5d4f13=_0x4dd1ba;return db[_0x4dc2f4+_0xeba0('0x6c')]['findOne']({'where':{'id':_0x393b49['body'][_0xeba0('0x5d')]},'include':[{'model':db[_0x4dc2f4+_0xeba0('0x5e')],'as':'Interaction'},{'model':db[_0x4dc2f4+_0x23d43d],'as':_0xeba0('0x64')}]});})[_0xeba0('0x7')](function(_0x37479c){if(_[_0xeba0('0x10')](_0x37479c)){throw new Error(_0x4dc2f4+_0xeba0('0x5f'));}_0x3fc030=_0x37479c;return _0x37479c['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xeba0('0x7')](function(){var _0x15b011={'uniqueid':_0x3bb1e4+'.'+_0x3fc030['id']+'.'+_0x3fc030['Interaction']['id'],'FromUserId':_0x393b49[_0xeba0('0x2f')]['id'],'type':_0xeba0('0x61'),'ToUserId':_0x5d4f13['id']};_0x15b011[_0x4dc2f4+_0xeba0('0x6d')]=_0x3fc030['id'];_0x15b011[_0x4dc2f4+_0xeba0('0x62')]=_0x3fc030[_0xeba0('0x5e')]['id'];_0x15b011[_0xeba0('0x63')+_0x4dc2f4+_0x23d43d+'Id']=_0x3fc030[_0xeba0('0x64')]['id'];return db[_0x4dc2f4+_0xeba0('0x65')][_0xeba0('0x66')](_0x15b011);})[_0xeba0('0x7')](function(){return respondWithRpcPromise('Start',{'channel':_0x3bb1e4,'interaction':_0x3fc030[_0xeba0('0x5e')],'message':_0x3fc030,'account':_0x3fc030[_0xeba0('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xeba0('0x3a'),'appdata':_0x5d4f13[_0xeba0('0xe')]+','+(_0x3fc030['Account'][_0xeba0('0x6e')]||0x12c),'interval':_0xeba0('0x6f')}]},routingClient);})['then'](respondWithResult(_0x5799d3,null))['catch'](handleError(_0x5799d3,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 5f4455e..c0f6f17 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 _0x3892=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','index','/:id','show','isAuthenticated','run','post','create','put','update','delete','exports','multer'];(function(_0x2c581e,_0x29de9a){var _0x196675=function(_0x570fea){while(--_0x570fea){_0x2c581e['push'](_0x2c581e['shift']());}};_0x196675(++_0x29de9a);}(_0x3892,0xa7));var _0x2389=function(_0x39158d,_0x597792){_0x39158d=_0x39158d-0x0;var _0xb70a5=_0x3892[_0x39158d];return _0xb70a5;};'use strict';var multer=require(_0x2389('0x0'));var util=require('util');var path=require(_0x2389('0x1'));var timeout=require(_0x2389('0x2'));var express=require(_0x2389('0x3'));var router=express[_0x2389('0x4')]();var auth=require(_0x2389('0x5'));var interaction=require(_0x2389('0x6'));var config=require(_0x2389('0x7'));var controller=require(_0x2389('0x8'));router[_0x2389('0x9')]('/',auth['isAuthenticated'](),controller[_0x2389('0xa')]);router[_0x2389('0x9')](_0x2389('0xb'),auth['isAuthenticated'](),controller[_0x2389('0xc')]);router['get']('/:id/run',auth[_0x2389('0xd')](),controller[_0x2389('0xe')]);router[_0x2389('0xf')]('/',auth[_0x2389('0xd')](),controller[_0x2389('0x10')]);router[_0x2389('0x11')](_0x2389('0xb'),auth[_0x2389('0xd')](),controller[_0x2389('0x12')]);router[_0x2389('0x13')](_0x2389('0xb'),auth[_0x2389('0xd')](),controller['destroy']);module[_0x2389('0x14')]=router; \ No newline at end of file +var _0xa95f=['isAuthenticated','show','run','put','/:id','delete','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','index'];(function(_0x50c9e1,_0x225291){var _0x34f180=function(_0x5517a9){while(--_0x5517a9){_0x50c9e1['push'](_0x50c9e1['shift']());}};_0x34f180(++_0x225291);}(_0xa95f,0x7e));var _0xfa95=function(_0x2900bd,_0xb0bb0e){_0x2900bd=_0x2900bd-0x0;var _0x38077e=_0xa95f[_0x2900bd];return _0x38077e;};'use strict';var multer=require(_0xfa95('0x0'));var util=require('util');var path=require(_0xfa95('0x1'));var timeout=require(_0xfa95('0x2'));var express=require(_0xfa95('0x3'));var router=express['Router']();var auth=require(_0xfa95('0x4'));var interaction=require(_0xfa95('0x5'));var config=require(_0xfa95('0x6'));var controller=require(_0xfa95('0x7'));router[_0xfa95('0x8')]('/',auth['isAuthenticated'](),controller[_0xfa95('0x9')]);router[_0xfa95('0x8')]('/:id',auth[_0xfa95('0xa')](),controller[_0xfa95('0xb')]);router['get']('/:id/run',auth[_0xfa95('0xa')](),controller[_0xfa95('0xc')]);router['post']('/',auth[_0xfa95('0xa')](),controller['create']);router[_0xfa95('0xd')](_0xfa95('0xe'),auth[_0xfa95('0xa')](),controller['update']);router[_0xfa95('0xf')](_0xfa95('0xe'),auth['isAuthenticated'](),controller[_0xfa95('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 811831e..bb9ca4d 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 _0x530e=['weeks','days','csv','pdf','custom','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months'];(function(_0x2a77d0,_0x3cf699){var _0x18e708=function(_0x48e268){while(--_0x48e268){_0x2a77d0['push'](_0x2a77d0['shift']());}};_0x18e708(++_0x3cf699);}(_0x530e,0x1f3));var _0xe530=function(_0x1822a0,_0x3be0ea){_0x1822a0=_0x1822a0-0x0;var _0x3dcdfe=_0x530e[_0x1822a0];return _0x3dcdfe;};'use strict';var Sequelize=require(_0xe530('0x0'));module[_0xe530('0x1')]={'name':{'type':Sequelize[_0xe530('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe530('0x2')]},'active':{'type':Sequelize[_0xe530('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xe530('0x2')],'allowNull':![],'defaultValue':_0xe530('0x4')},'startAt':{'type':Sequelize[_0xe530('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xe530('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xe530('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xe530('0x7')](_0xe530('0x8'),_0xe530('0x9'),_0xe530('0xa'),_0xe530('0xb'),_0xe530('0xc'),'hours','minutes'),'allowNull':![],'defaultValue':_0xe530('0xc')},'output':{'type':Sequelize[_0xe530('0x7')](_0xe530('0xd'),_0xe530('0xe'),'xlsx'),'allowNull':![],'defaultValue':_0xe530('0xd')},'type':{'type':Sequelize[_0xe530('0x7')]('custom','default'),'allowNull':![],'defaultValue':_0xe530('0xf')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xe530('0x2')]},'cc':{'type':Sequelize[_0xe530('0x10')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0xe530('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb7ea=['exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','months','weeks','days','hours','minutes','ENUM','csv','pdf','xlsx','custom','default','TEXT','sequelize'];(function(_0x32824c,_0x1df2af){var _0x1184f5=function(_0x576e9a){while(--_0x576e9a){_0x32824c['push'](_0x32824c['shift']());}};_0x1184f5(++_0x1df2af);}(_0xb7ea,0x1ed));var _0xab7e=function(_0x23d7c5,_0x2a7547){_0x23d7c5=_0x23d7c5-0x0;var _0x350950=_0xb7ea[_0x23d7c5];return _0x350950;};'use strict';var Sequelize=require(_0xab7e('0x0'));module[_0xab7e('0x1')]={'name':{'type':Sequelize[_0xab7e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xab7e('0x2')]},'active':{'type':Sequelize[_0xab7e('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xab7e('0x2')],'allowNull':![],'defaultValue':_0xab7e('0x4')},'startAt':{'type':Sequelize[_0xab7e('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xab7e('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xab7e('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years','quarters',_0xab7e('0x7'),_0xab7e('0x8'),_0xab7e('0x9'),_0xab7e('0xa'),_0xab7e('0xb')),'allowNull':![],'defaultValue':_0xab7e('0x9')},'output':{'type':Sequelize[_0xab7e('0xc')](_0xab7e('0xd'),_0xab7e('0xe'),_0xab7e('0xf')),'allowNull':![],'defaultValue':_0xab7e('0xd')},'type':{'type':Sequelize[_0xab7e('0xc')](_0xab7e('0x10'),_0xab7e('0x11')),'allowNull':![],'defaultValue':_0xab7e('0x10')},'sendMail':{'type':Sequelize[_0xab7e('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xab7e('0x12')]},'sendIfEmpty':{'type':Sequelize[_0xab7e('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 2e05420..fa32e5c 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 _0x9d01=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','count','limit','status','set','apply','update','then','UserProfileResource','destroy','error','stack','name','index','Schedule','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','sort','pick','filter','merge','where','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler'];(function(_0x272c47,_0x18ce00){var _0x2d9c4d=function(_0x4e20fd){while(--_0x4e20fd){_0x272c47['push'](_0x272c47['shift']());}};_0x2d9c4d(++_0x18ce00);}(_0x9d01,0x13a));var _0x19d0=function(_0x14028c,_0x552167){_0x14028c=_0x14028c-0x0;var _0x19f7f0=_0x9d01[_0x14028c];return _0x19f7f0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x19d0('0x0'));var rimraf=require(_0x19d0('0x1'));var zipdir=require(_0x19d0('0x2'));var jsonpatch=require(_0x19d0('0x3'));var rp=require(_0x19d0('0x4'));var moment=require('moment');var BPromise=require(_0x19d0('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x19d0('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x19d0('0x7'));var squel=require(_0x19d0('0x8'));var crypto=require('crypto');var jsforce=require(_0x19d0('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x19d0('0xa'));var Papa=require('papaparse');var Redis=require(_0x19d0('0xb'));var authService=require(_0x19d0('0xc'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x19d0('0xd'));var logger=require(_0x19d0('0xe'))(_0x19d0('0xf'));var utils=require(_0x19d0('0x10'));var config=require(_0x19d0('0x11'));var db=require(_0x19d0('0x12'))['db'];function respondWithStatusCode(_0x32dd15,_0x193ed3){_0x193ed3=_0x193ed3||0xcc;return function(_0xa01dfe){if(_0xa01dfe){return _0x32dd15[_0x19d0('0x13')](_0x193ed3);}return _0x32dd15['status'](_0x193ed3)['end']();};}function respondWithResult(_0x3fda36,_0x3717ee){_0x3717ee=_0x3717ee||0xc8;return function(_0x4f0d36){if(_0x4f0d36){return _0x3fda36['status'](_0x3717ee)[_0x19d0('0x14')](_0x4f0d36);}};}function respondWithFilteredResult(_0x362708,_0x52c0ed){return function(_0x494f66){if(_0x494f66){var _0x3d869a=_0x494f66[_0x19d0('0x15')],_0x43bb59=_0x52c0ed['offset'],_0x19163f=_0x52c0ed['offset']+_0x52c0ed[_0x19d0('0x16')],_0x5c591e;if(_0x19163f>=_0x3d869a){_0x19163f=_0x3d869a;_0x5c591e=0xc8;}else{_0x5c591e=0xce;}_0x362708[_0x19d0('0x17')](_0x5c591e);return _0x362708[_0x19d0('0x18')]('Content-Range',_0x43bb59+'-'+_0x19163f+'/'+_0x3d869a)[_0x19d0('0x14')](_0x494f66);}return null;};}function patchUpdates(_0x21bb68){return function(_0x2721ad){try{jsonpatch[_0x19d0('0x19')](_0x2721ad,_0x21bb68,!![]);}catch(_0xe8a45a){return BPromise['reject'](_0xe8a45a);}return _0x2721ad['save']();};}function saveUpdates(_0x5f6716,_0x2e85e4){return function(_0x51881b){if(_0x51881b){return _0x51881b[_0x19d0('0x1a')](_0x5f6716)[_0x19d0('0x1b')](function(_0x2aa91f){return _0x2aa91f;});}return null;};}function removeEntity(_0x157605,_0x2bd53d){return function(_0x5b5deb){if(_0x5b5deb){return _0x5b5deb['destroy']()[_0x19d0('0x1b')](function(){var _0x4b1c55=_0x5b5deb['get']({'plain':!![]});var _0x4913a1='Scheduler';return db[_0x19d0('0x1c')][_0x19d0('0x1d')]({'where':{'type':_0x4913a1,'resourceId':_0x4b1c55['id']}})[_0x19d0('0x1b')](function(){return _0x5b5deb;});})[_0x19d0('0x1b')](function(){_0x157605[_0x19d0('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ec199,_0x307246){return function(_0x5ec884){if(!_0x5ec884){_0x5ec199['sendStatus'](0x194);}return _0x5ec884;};}function handleError(_0x385b87,_0x1dc0ff){_0x1dc0ff=_0x1dc0ff||0x1f4;return function(_0x5f58d4){logger[_0x19d0('0x1e')](_0x5f58d4[_0x19d0('0x1f')]);if(_0x5f58d4['name']){delete _0x5f58d4[_0x19d0('0x20')];}_0x385b87[_0x19d0('0x17')](_0x1dc0ff)['send'](_0x5f58d4);};}exports[_0x19d0('0x21')]=function(_0x589f5a,_0xc201c8){var _0x2548aa={},_0x13e6d2={},_0x34abda={'count':0x0,'rows':[]};var _0x2c8aca=db[_0x19d0('0x22')]['rawAttributes'];_0x13e6d2['model']=_[_0x19d0('0x23')](_0x2c8aca);_0x13e6d2[_0x19d0('0x24')]=_[_0x19d0('0x23')](_0x589f5a['query']);_0x13e6d2[_0x19d0('0x25')]=_[_0x19d0('0x26')](_0x13e6d2[_0x19d0('0x27')],_0x13e6d2[_0x19d0('0x24')]);_0x2548aa[_0x19d0('0x28')]=_[_0x19d0('0x26')](_0x13e6d2[_0x19d0('0x27')],qs[_0x19d0('0x29')](_0x589f5a[_0x19d0('0x24')]['fields']));_0x2548aa[_0x19d0('0x28')]=_0x2548aa[_0x19d0('0x28')]['length']?_0x2548aa[_0x19d0('0x28')]:_0x13e6d2['model'];if(!_0x589f5a[_0x19d0('0x24')][_0x19d0('0x2a')](_0x19d0('0x2b'))){_0x2548aa[_0x19d0('0x16')]=qs[_0x19d0('0x16')](_0x589f5a[_0x19d0('0x24')][_0x19d0('0x16')]);_0x2548aa[_0x19d0('0x2c')]=qs['offset'](_0x589f5a[_0x19d0('0x24')][_0x19d0('0x2c')]);}_0x2548aa['order']=qs['sort'](_0x589f5a[_0x19d0('0x24')][_0x19d0('0x2d')]);_0x2548aa['where']=qs['filters'](_[_0x19d0('0x2e')](_0x589f5a[_0x19d0('0x24')],_0x13e6d2[_0x19d0('0x25')]));if(_0x589f5a[_0x19d0('0x24')][_0x19d0('0x2f')]){_0x2548aa['where']=_[_0x19d0('0x30')](_0x2548aa[_0x19d0('0x31')],{'$or':_[_0x19d0('0x32')](_0x2c8aca,function(_0x60de24){if(_0x60de24[_0x19d0('0x33')][_0x19d0('0x34')]!==_0x19d0('0x35')){var _0x16583c={};_0x16583c[_0x60de24[_0x19d0('0x36')]]={'$like':'%'+_0x589f5a[_0x19d0('0x24')][_0x19d0('0x2f')]+'%'};return _0x16583c;}})});}_0x2548aa=_['merge']({},_0x2548aa,_0x589f5a[_0x19d0('0x37')]);var _0x27ad22={'where':_0x2548aa[_0x19d0('0x31')]};return db['Schedule'][_0x19d0('0x15')](_0x27ad22)[_0x19d0('0x1b')](function(_0xefdf73){_0x34abda['count']=_0xefdf73;if(_0x589f5a[_0x19d0('0x24')][_0x19d0('0x38')]){_0x2548aa[_0x19d0('0x39')]=[{'all':!![]}];}return db['Schedule'][_0x19d0('0x3a')](_0x2548aa);})[_0x19d0('0x1b')](function(_0x387004){_0x34abda[_0x19d0('0x3b')]=_0x387004;return _0x34abda;})[_0x19d0('0x1b')](respondWithFilteredResult(_0xc201c8,_0x2548aa))[_0x19d0('0x3c')](handleError(_0xc201c8,null));};exports[_0x19d0('0x3d')]=function(_0x4caad1,_0x49af62){var _0x10f66a={'raw':![],'where':{'id':_0x4caad1['params']['id']}},_0x5711b5={};_0x5711b5[_0x19d0('0x27')]=_[_0x19d0('0x23')](db[_0x19d0('0x22')][_0x19d0('0x3e')]);_0x5711b5[_0x19d0('0x24')]=_[_0x19d0('0x23')](_0x4caad1[_0x19d0('0x24')]);_0x5711b5[_0x19d0('0x25')]=_[_0x19d0('0x26')](_0x5711b5[_0x19d0('0x27')],_0x5711b5['query']);_0x10f66a[_0x19d0('0x28')]=_['intersection'](_0x5711b5[_0x19d0('0x27')],qs[_0x19d0('0x29')](_0x4caad1[_0x19d0('0x24')][_0x19d0('0x29')]));_0x10f66a[_0x19d0('0x28')]=_0x10f66a[_0x19d0('0x28')]['length']?_0x10f66a[_0x19d0('0x28')]:_0x5711b5[_0x19d0('0x27')];if(_0x4caad1[_0x19d0('0x24')][_0x19d0('0x38')]){_0x10f66a[_0x19d0('0x39')]=[{'all':!![]}];}_0x10f66a=_['merge']({},_0x10f66a,_0x4caad1[_0x19d0('0x37')]);return db[_0x19d0('0x22')][_0x19d0('0x3f')](_0x10f66a)[_0x19d0('0x1b')](handleEntityNotFound(_0x49af62,null))[_0x19d0('0x1b')](respondWithResult(_0x49af62,null))[_0x19d0('0x3c')](handleError(_0x49af62,null));};exports[_0x19d0('0x40')]=function(_0x216356,_0x26daec){return db[_0x19d0('0x22')]['create'](_0x216356[_0x19d0('0x41')],{})[_0x19d0('0x1b')](function(_0x169766){var _0x5263b2=_0x216356[_0x19d0('0x42')][_0x19d0('0x43')]({'plain':!![]});if(!_0x5263b2)throw new Error(_0x19d0('0x44'));if(_0x5263b2[_0x19d0('0x45')]===_0x19d0('0x42')){var _0x5dce8f=_0x169766['get']({'plain':!![]});var _0x4feb13=_0x19d0('0x46');return db[_0x19d0('0x47')]['find']({'where':{'name':_0x4feb13,'userProfileId':_0x5263b2[_0x19d0('0x48')]},'raw':!![]})['then'](function(_0x205615){if(_0x205615&&_0x205615[_0x19d0('0x49')]===0x0){return db['UserProfileResource'][_0x19d0('0x40')]({'name':_0x5dce8f[_0x19d0('0x20')],'resourceId':_0x5dce8f['id'],'type':_0x205615['name'],'sectionId':_0x205615['id']},{})['then'](function(){return _0x169766;});}else{return _0x169766;}})[_0x19d0('0x3c')](function(_0x16c680){logger[_0x19d0('0x1e')](_0x19d0('0x4a'),_0x16c680);throw _0x16c680;});}return _0x169766;})[_0x19d0('0x1b')](respondWithResult(_0x26daec,0xc9))[_0x19d0('0x3c')](handleError(_0x26daec,null));};exports[_0x19d0('0x1a')]=function(_0x56f3be,_0x5d1816){if(_0x56f3be[_0x19d0('0x41')]['id']){delete _0x56f3be[_0x19d0('0x41')]['id'];}return db['Schedule'][_0x19d0('0x3f')]({'where':{'id':_0x56f3be['params']['id']}})[_0x19d0('0x1b')](handleEntityNotFound(_0x5d1816,null))[_0x19d0('0x1b')](saveUpdates(_0x56f3be['body'],null))[_0x19d0('0x1b')](respondWithResult(_0x5d1816,null))[_0x19d0('0x3c')](handleError(_0x5d1816,null));};exports[_0x19d0('0x1d')]=function(_0x560eb3,_0x22be2f){return db[_0x19d0('0x22')]['find']({'where':{'id':_0x560eb3[_0x19d0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x22be2f,null))[_0x19d0('0x1b')](removeEntity(_0x22be2f,null))['catch'](handleError(_0x22be2f,null));};exports['run']=function(_0x4ad342,_0x5076e8,_0x1dc0d1){var _0x483b15=require(_0x19d0('0x4c'));return db['Schedule'][_0x19d0('0x3f')]({'where':{'id':_0x4ad342[_0x19d0('0x4b')]['id']},'raw':!![]})[_0x19d0('0x1b')](handleEntityNotFound(_0x5076e8,null))[_0x19d0('0x1b')](function(){_0x483b15['run'](_0x4ad342['params']['id']);})[_0x19d0('0x1b')](respondWithStatusCode(_0x5076e8,null))[_0x19d0('0x3c')](handleError(_0x5076e8,null));}; \ No newline at end of file +var _0xcc93=['error','stack','name','index','Schedule','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','key','VIRTUAL','field','filter','options','includeAll','include','rows','show','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','catch','body','params','run','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','end','count','offset','limit','status','set','Content-Range','json','apply','reject','save','update','then','destroy','Scheduler','UserProfileResource'];(function(_0x553778,_0x3749b8){var _0x9f9f5e=function(_0x165ebf){while(--_0x165ebf){_0x553778['push'](_0x553778['shift']());}};_0x9f9f5e(++_0x3749b8);}(_0xcc93,0xc3));var _0x3cc9=function(_0x58e33e,_0x21b8cd){_0x58e33e=_0x58e33e-0x0;var _0x409f53=_0xcc93[_0x58e33e];return _0x409f53;};'use strict';var pdf=require(_0x3cc9('0x0'));var emlformat=require(_0x3cc9('0x1'));var rimraf=require(_0x3cc9('0x2'));var zipdir=require(_0x3cc9('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3cc9('0x4'));var moment=require(_0x3cc9('0x5'));var BPromise=require(_0x3cc9('0x6'));var Mustache=require(_0x3cc9('0x7'));var util=require(_0x3cc9('0x8'));var path=require('path');var sox=require(_0x3cc9('0x9'));var csv=require(_0x3cc9('0xa'));var ejs=require(_0x3cc9('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3cc9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3cc9('0xa'));var querystring=require('querystring');var Papa=require(_0x3cc9('0xd'));var Redis=require('ioredis');var authService=require(_0x3cc9('0xe'));var qs=require(_0x3cc9('0xf'));var hardwareService=require(_0x3cc9('0x10'));var logger=require(_0x3cc9('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x3cc9('0x12'))['db'];function respondWithStatusCode(_0x52ab0a,_0xf03f70){_0xf03f70=_0xf03f70||0xcc;return function(_0x2c7ca0){if(_0x2c7ca0){return _0x52ab0a[_0x3cc9('0x13')](_0xf03f70);}return _0x52ab0a['status'](_0xf03f70)[_0x3cc9('0x14')]();};}function respondWithResult(_0x4b39d6,_0x47d412){_0x47d412=_0x47d412||0xc8;return function(_0x367a78){if(_0x367a78){return _0x4b39d6['status'](_0x47d412)['json'](_0x367a78);}};}function respondWithFilteredResult(_0x1c16d4,_0x167066){return function(_0x5b0ce0){if(_0x5b0ce0){var _0xfe66d6=_0x5b0ce0[_0x3cc9('0x15')],_0x1bae94=_0x167066[_0x3cc9('0x16')],_0x591c30=_0x167066['offset']+_0x167066[_0x3cc9('0x17')],_0xcb2e49;if(_0x591c30>=_0xfe66d6){_0x591c30=_0xfe66d6;_0xcb2e49=0xc8;}else{_0xcb2e49=0xce;}_0x1c16d4[_0x3cc9('0x18')](_0xcb2e49);return _0x1c16d4[_0x3cc9('0x19')](_0x3cc9('0x1a'),_0x1bae94+'-'+_0x591c30+'/'+_0xfe66d6)[_0x3cc9('0x1b')](_0x5b0ce0);}return null;};}function patchUpdates(_0xc2f883){return function(_0x509cf6){try{jsonpatch[_0x3cc9('0x1c')](_0x509cf6,_0xc2f883,!![]);}catch(_0x451844){return BPromise[_0x3cc9('0x1d')](_0x451844);}return _0x509cf6[_0x3cc9('0x1e')]();};}function saveUpdates(_0x3028ca,_0x56efd4){return function(_0x1465c7){if(_0x1465c7){return _0x1465c7[_0x3cc9('0x1f')](_0x3028ca)[_0x3cc9('0x20')](function(_0xd4a9be){return _0xd4a9be;});}return null;};}function removeEntity(_0x567ed7,_0xe2b10f){return function(_0x45e687){if(_0x45e687){return _0x45e687[_0x3cc9('0x21')]()[_0x3cc9('0x20')](function(){var _0x579f1f=_0x45e687['get']({'plain':!![]});var _0x4b5d42=_0x3cc9('0x22');return db[_0x3cc9('0x23')]['destroy']({'where':{'type':_0x4b5d42,'resourceId':_0x579f1f['id']}})[_0x3cc9('0x20')](function(){return _0x45e687;});})[_0x3cc9('0x20')](function(){_0x567ed7['status'](0xcc)[_0x3cc9('0x14')]();});}};}function handleEntityNotFound(_0x3a8997,_0x379a9f){return function(_0x318e93){if(!_0x318e93){_0x3a8997[_0x3cc9('0x13')](0x194);}return _0x318e93;};}function handleError(_0x28bd19,_0x72e83f){_0x72e83f=_0x72e83f||0x1f4;return function(_0x18c585){logger[_0x3cc9('0x24')](_0x18c585[_0x3cc9('0x25')]);if(_0x18c585[_0x3cc9('0x26')]){delete _0x18c585[_0x3cc9('0x26')];}_0x28bd19[_0x3cc9('0x18')](_0x72e83f)['send'](_0x18c585);};}exports[_0x3cc9('0x27')]=function(_0x468b6e,_0x5e8f74){var _0x26a49d={},_0x1c3553={},_0x578965={'count':0x0,'rows':[]};var _0x70721=db[_0x3cc9('0x28')]['rawAttributes'];_0x1c3553[_0x3cc9('0x29')]=_['keys'](_0x70721);_0x1c3553['query']=_[_0x3cc9('0x2a')](_0x468b6e[_0x3cc9('0x2b')]);_0x1c3553[_0x3cc9('0x2c')]=_[_0x3cc9('0x2d')](_0x1c3553[_0x3cc9('0x29')],_0x1c3553[_0x3cc9('0x2b')]);_0x26a49d[_0x3cc9('0x2e')]=_[_0x3cc9('0x2d')](_0x1c3553[_0x3cc9('0x29')],qs[_0x3cc9('0x2f')](_0x468b6e[_0x3cc9('0x2b')]['fields']));_0x26a49d[_0x3cc9('0x2e')]=_0x26a49d[_0x3cc9('0x2e')][_0x3cc9('0x30')]?_0x26a49d[_0x3cc9('0x2e')]:_0x1c3553['model'];if(!_0x468b6e[_0x3cc9('0x2b')][_0x3cc9('0x31')](_0x3cc9('0x32'))){_0x26a49d['limit']=qs[_0x3cc9('0x17')](_0x468b6e[_0x3cc9('0x2b')][_0x3cc9('0x17')]);_0x26a49d[_0x3cc9('0x16')]=qs['offset'](_0x468b6e[_0x3cc9('0x2b')][_0x3cc9('0x16')]);}_0x26a49d['order']=qs[_0x3cc9('0x33')](_0x468b6e['query'][_0x3cc9('0x33')]);_0x26a49d[_0x3cc9('0x34')]=qs[_0x3cc9('0x2c')](_[_0x3cc9('0x35')](_0x468b6e[_0x3cc9('0x2b')],_0x1c3553[_0x3cc9('0x2c')]));if(_0x468b6e[_0x3cc9('0x2b')]['filter']){_0x26a49d[_0x3cc9('0x34')]=_[_0x3cc9('0x36')](_0x26a49d[_0x3cc9('0x34')],{'$or':_[_0x3cc9('0x37')](_0x70721,function(_0x7c0aa0){if(_0x7c0aa0['type'][_0x3cc9('0x38')]!==_0x3cc9('0x39')){var _0x362a0f={};_0x362a0f[_0x7c0aa0[_0x3cc9('0x3a')]]={'$like':'%'+_0x468b6e[_0x3cc9('0x2b')][_0x3cc9('0x3b')]+'%'};return _0x362a0f;}})});}_0x26a49d=_['merge']({},_0x26a49d,_0x468b6e[_0x3cc9('0x3c')]);var _0x510422={'where':_0x26a49d['where']};return db[_0x3cc9('0x28')][_0x3cc9('0x15')](_0x510422)['then'](function(_0x2d2769){_0x578965[_0x3cc9('0x15')]=_0x2d2769;if(_0x468b6e['query'][_0x3cc9('0x3d')]){_0x26a49d[_0x3cc9('0x3e')]=[{'all':!![]}];}return db[_0x3cc9('0x28')]['findAll'](_0x26a49d);})['then'](function(_0x3052f3){_0x578965[_0x3cc9('0x3f')]=_0x3052f3;return _0x578965;})['then'](respondWithFilteredResult(_0x5e8f74,_0x26a49d))['catch'](handleError(_0x5e8f74,null));};exports[_0x3cc9('0x40')]=function(_0x10fc35,_0x567e7d){var _0x54e825={'raw':![],'where':{'id':_0x10fc35['params']['id']}},_0x359c1b={};_0x359c1b[_0x3cc9('0x29')]=_[_0x3cc9('0x2a')](db[_0x3cc9('0x28')]['rawAttributes']);_0x359c1b['query']=_[_0x3cc9('0x2a')](_0x10fc35[_0x3cc9('0x2b')]);_0x359c1b[_0x3cc9('0x2c')]=_['intersection'](_0x359c1b[_0x3cc9('0x29')],_0x359c1b[_0x3cc9('0x2b')]);_0x54e825[_0x3cc9('0x2e')]=_[_0x3cc9('0x2d')](_0x359c1b[_0x3cc9('0x29')],qs[_0x3cc9('0x2f')](_0x10fc35[_0x3cc9('0x2b')][_0x3cc9('0x2f')]));_0x54e825[_0x3cc9('0x2e')]=_0x54e825[_0x3cc9('0x2e')][_0x3cc9('0x30')]?_0x54e825[_0x3cc9('0x2e')]:_0x359c1b['model'];if(_0x10fc35[_0x3cc9('0x2b')][_0x3cc9('0x3d')]){_0x54e825[_0x3cc9('0x3e')]=[{'all':!![]}];}_0x54e825=_['merge']({},_0x54e825,_0x10fc35[_0x3cc9('0x3c')]);return db['Schedule'][_0x3cc9('0x41')](_0x54e825)[_0x3cc9('0x20')](handleEntityNotFound(_0x567e7d,null))[_0x3cc9('0x20')](respondWithResult(_0x567e7d,null))['catch'](handleError(_0x567e7d,null));};exports[_0x3cc9('0x42')]=function(_0x492b06,_0x55fbbc){return db[_0x3cc9('0x28')]['create'](_0x492b06['body'],{})[_0x3cc9('0x20')](function(_0x360165){var _0x172475=_0x492b06[_0x3cc9('0x43')][_0x3cc9('0x44')]({'plain':!![]});if(!_0x172475)throw new Error(_0x3cc9('0x45'));if(_0x172475[_0x3cc9('0x46')]===_0x3cc9('0x43')){var _0x5c146a=_0x360165[_0x3cc9('0x44')]({'plain':!![]});var _0x2e5060='Scheduler';return db['UserProfileSection']['find']({'where':{'name':_0x2e5060,'userProfileId':_0x172475[_0x3cc9('0x47')]},'raw':!![]})[_0x3cc9('0x20')](function(_0x37687e){if(_0x37687e&&_0x37687e[_0x3cc9('0x48')]===0x0){return db[_0x3cc9('0x23')][_0x3cc9('0x42')]({'name':_0x5c146a[_0x3cc9('0x26')],'resourceId':_0x5c146a['id'],'type':_0x37687e[_0x3cc9('0x26')],'sectionId':_0x37687e['id']},{})[_0x3cc9('0x20')](function(){return _0x360165;});}else{return _0x360165;}})[_0x3cc9('0x49')](function(_0x2ecb66){logger[_0x3cc9('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ecb66);throw _0x2ecb66;});}return _0x360165;})['then'](respondWithResult(_0x55fbbc,0xc9))[_0x3cc9('0x49')](handleError(_0x55fbbc,null));};exports[_0x3cc9('0x1f')]=function(_0x167aca,_0x406b4e){if(_0x167aca[_0x3cc9('0x4a')]['id']){delete _0x167aca[_0x3cc9('0x4a')]['id'];}return db[_0x3cc9('0x28')][_0x3cc9('0x41')]({'where':{'id':_0x167aca[_0x3cc9('0x4b')]['id']}})[_0x3cc9('0x20')](handleEntityNotFound(_0x406b4e,null))[_0x3cc9('0x20')](saveUpdates(_0x167aca[_0x3cc9('0x4a')],null))[_0x3cc9('0x20')](respondWithResult(_0x406b4e,null))[_0x3cc9('0x49')](handleError(_0x406b4e,null));};exports['destroy']=function(_0x3c9108,_0xabea8e){return db['Schedule']['find']({'where':{'id':_0x3c9108[_0x3cc9('0x4b')]['id']}})['then'](handleEntityNotFound(_0xabea8e,null))[_0x3cc9('0x20')](removeEntity(_0xabea8e,null))[_0x3cc9('0x49')](handleError(_0xabea8e,null));};exports[_0x3cc9('0x4c')]=function(_0x49a6b7,_0x7b3dce,_0x46dc29){var _0x5dd16f=require('../../config/schedule');return db['Schedule']['find']({'where':{'id':_0x49a6b7[_0x3cc9('0x4b')]['id']},'raw':!![]})[_0x3cc9('0x20')](handleEntityNotFound(_0x7b3dce,null))[_0x3cc9('0x20')](function(){_0x5dd16f[_0x3cc9('0x4c')](_0x49a6b7[_0x3cc9('0x4b')]['id']);})[_0x3cc9('0x20')](respondWithStatusCode(_0x7b3dce,null))['catch'](handleError(_0x7b3dce,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 1eb4a1a..905d238 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 _0xec90=['define','Schedule','lodash','../../config/logger','bluebird','request-promise','path','rimraf','./schedule.attributes'];(function(_0x150dbd,_0x3029b8){var _0x4407cb=function(_0x250d69){while(--_0x250d69){_0x150dbd['push'](_0x150dbd['shift']());}};_0x4407cb(++_0x3029b8);}(_0xec90,0x146));var _0x0ec9=function(_0x22577f,_0x495538){_0x22577f=_0x22577f-0x0;var _0x35c955=_0xec90[_0x22577f];return _0x35c955;};'use strict';var _=require(_0x0ec9('0x0'));var util=require('util');var logger=require(_0x0ec9('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0ec9('0x2'));var rp=require(_0x0ec9('0x3'));var fs=require('fs');var path=require(_0x0ec9('0x4'));var rimraf=require(_0x0ec9('0x5'));var config=require('../../config/environment');var attributes=require(_0x0ec9('0x6'));module['exports']=function(_0x2934e9,_0x37bc83){return _0x2934e9[_0x0ec9('0x7')](_0x0ec9('0x8'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa1f9=['exports','define','Schedule','tools_schedules','lodash','api','moment','bluebird','path','./schedule.attributes'];(function(_0x6b373d,_0xb1d90f){var _0x170ccc=function(_0x2d3a0f){while(--_0x2d3a0f){_0x6b373d['push'](_0x6b373d['shift']());}};_0x170ccc(++_0xb1d90f);}(_0xa1f9,0x19e));var _0x9a1f=function(_0x2a4416,_0x510012){_0x2a4416=_0x2a4416-0x0;var _0x53bdd1=_0xa1f9[_0x2a4416];return _0x53bdd1;};'use strict';var _=require(_0x9a1f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9a1f('0x1'));var moment=require(_0x9a1f('0x2'));var BPromise=require(_0x9a1f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9a1f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9a1f('0x5'));module[_0x9a1f('0x6')]=function(_0x2eab56,_0x79a64e){return _0x2eab56[_0x9a1f('0x7')](_0x9a1f('0x8'),attributes,{'tableName':_0x9a1f('0x9'),'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 4ec394f..3d79b0b 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 _0x6f15=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','error','Schedule,\x20%s,\x20%s','message'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x6f15,0xb4));var _0x56f1=function(_0x12931e,_0x1cfd1a){_0x12931e=_0x12931e-0x0;var _0x20d44c=_0x6f15[_0x12931e];return _0x20d44c;};'use strict';var _=require('lodash');var util=require(_0x56f1('0x0'));var moment=require(_0x56f1('0x1'));var BPromise=require(_0x56f1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x56f1('0x3'));var db=require(_0x56f1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x56f1('0x5'))(_0x56f1('0x6'));var config=require(_0x56f1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x56f1('0x8')][_0x56f1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1798dc,_0x3238a2,_0x1a505f){return new BPromise(function(_0xd4d69,_0x124922){return client[_0x56f1('0xa')](_0x1798dc,_0x1a505f)[_0x56f1('0xb')](function(_0x18fa20){logger[_0x56f1('0xc')]('Schedule,\x20%s,\x20%s',_0x3238a2,_0x56f1('0xd'));logger['debug'](_0x56f1('0xe'),_0x3238a2,'request\x20sent',JSON['stringify'](_0x18fa20));if(_0x18fa20[_0x56f1('0xf')]){if(_0x18fa20[_0x56f1('0xf')]['code']===0x1f4){logger[_0x56f1('0xf')](_0x56f1('0x10'),_0x3238a2,_0x18fa20['error'][_0x56f1('0x11')]);return _0x124922(_0x18fa20[_0x56f1('0xf')][_0x56f1('0x11')]);}logger[_0x56f1('0xf')](_0x56f1('0x10'),_0x3238a2,_0x18fa20['error'][_0x56f1('0x11')]);return _0xd4d69(_0x18fa20['error'][_0x56f1('0x11')]);}else{logger[_0x56f1('0xc')](_0x56f1('0x10'),_0x3238a2,_0x56f1('0xd'));_0xd4d69(_0x18fa20['result'][_0x56f1('0x11')]);}})['catch'](function(_0x4c0704){logger[_0x56f1('0xf')](_0x56f1('0x10'),_0x3238a2,_0x4c0704);_0x124922(_0x4c0704);});});} \ No newline at end of file +var _0x87df=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s'];(function(_0xcc545b,_0x302c60){var _0x4cc389=function(_0x5b6011){while(--_0x5b6011){_0xcc545b['push'](_0xcc545b['shift']());}};_0x4cc389(++_0x302c60);}(_0x87df,0x1d3));var _0xf87d=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x87df[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0xf87d('0x0'));var util=require(_0xf87d('0x1'));var moment=require(_0xf87d('0x2'));var BPromise=require(_0xf87d('0x3'));var rs=require(_0xf87d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf87d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf87d('0x6'))('rpc');var config=require(_0xf87d('0x7'));var jayson=require(_0xf87d('0x8'));var client=jayson['client'][_0xf87d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45f5ce,_0x1f22a0,_0x414659){return new BPromise(function(_0x1ca98d,_0x308b1e){return client['request'](_0x45f5ce,_0x414659)[_0xf87d('0xa')](function(_0x3d6a2f){logger[_0xf87d('0xb')](_0xf87d('0xc'),_0x1f22a0,_0xf87d('0xd'));logger[_0xf87d('0xe')](_0xf87d('0xf'),_0x1f22a0,'request\x20sent',JSON['stringify'](_0x3d6a2f));if(_0x3d6a2f['error']){if(_0x3d6a2f[_0xf87d('0x10')][_0xf87d('0x11')]===0x1f4){logger[_0xf87d('0x10')]('Schedule,\x20%s,\x20%s',_0x1f22a0,_0x3d6a2f[_0xf87d('0x10')][_0xf87d('0x12')]);return _0x308b1e(_0x3d6a2f['error']['message']);}logger[_0xf87d('0x10')](_0xf87d('0xc'),_0x1f22a0,_0x3d6a2f[_0xf87d('0x10')][_0xf87d('0x12')]);return _0x1ca98d(_0x3d6a2f[_0xf87d('0x10')][_0xf87d('0x12')]);}else{logger[_0xf87d('0xb')]('Schedule,\x20%s,\x20%s',_0x1f22a0,_0xf87d('0xd'));_0x1ca98d(_0x3d6a2f[_0xf87d('0x13')]['message']);}})[_0xf87d('0x14')](function(_0x4625ef){logger[_0xf87d('0x10')]('Schedule,\x20%s,\x20%s',_0x1f22a0,_0x4625ef);_0x308b1e(_0x4625ef);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 5ed3da3..847c7c1 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 _0x9085=['util','path','connect-timeout','express','Router','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','create','delete','destroy','exports','multer'];(function(_0x292bea,_0x549f84){var _0x5df7a1=function(_0x158490){while(--_0x158490){_0x292bea['push'](_0x292bea['shift']());}};_0x5df7a1(++_0x549f84);}(_0x9085,0xaf));var _0x5908=function(_0x372047,_0x7f5c2b){_0x372047=_0x372047-0x0;var _0x44f282=_0x9085[_0x372047];return _0x44f282;};'use strict';var multer=require(_0x5908('0x0'));var util=require(_0x5908('0x1'));var path=require(_0x5908('0x2'));var timeout=require(_0x5908('0x3'));var express=require(_0x5908('0x4'));var router=express[_0x5908('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x5908('0x6'));var config=require('../../config/environment');var controller=require(_0x5908('0x7'));router[_0x5908('0x8')]('/',auth[_0x5908('0x9')](),controller[_0x5908('0xa')]);router['get'](_0x5908('0xb'),auth[_0x5908('0x9')](),controller[_0x5908('0xc')]);router[_0x5908('0x8')](_0x5908('0xd'),auth['isAuthenticated'](),controller[_0x5908('0xe')]);router[_0x5908('0x8')](_0x5908('0xf'),auth[_0x5908('0x9')](),controller[_0x5908('0x10')]);router[_0x5908('0x11')]('/',auth[_0x5908('0x9')](),controller[_0x5908('0x12')]);router['put']('/:id',auth[_0x5908('0x9')](),controller['update']);router[_0x5908('0x13')](_0x5908('0xd'),auth[_0x5908('0x9')](),controller[_0x5908('0x14')]);module[_0x5908('0x15')]=router; \ No newline at end of file +var _0xed5e=['download','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','/:id/download'];(function(_0x2ab28b,_0xe27a65){var _0x1f3b8d=function(_0xe71282){while(--_0xe71282){_0x2ab28b['push'](_0x2ab28b['shift']());}};_0x1f3b8d(++_0xe27a65);}(_0xed5e,0xff));var _0xeed5=function(_0x50b451,_0xdbd3b2){_0x50b451=_0x50b451-0x0;var _0x3db018=_0xed5e[_0x50b451];return _0x3db018;};'use strict';var multer=require(_0xeed5('0x0'));var util=require('util');var path=require(_0xeed5('0x1'));var timeout=require(_0xeed5('0x2'));var express=require(_0xeed5('0x3'));var router=express['Router']();var auth=require(_0xeed5('0x4'));var interaction=require(_0xeed5('0x5'));var config=require('../../config/environment');var controller=require('./screenRecording.controller');router['get']('/',auth[_0xeed5('0x6')](),controller[_0xeed5('0x7')]);router[_0xeed5('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xeed5('0x8')](_0xeed5('0x9'),auth[_0xeed5('0x6')](),controller['show']);router[_0xeed5('0x8')](_0xeed5('0xa'),auth[_0xeed5('0x6')](),controller[_0xeed5('0xb')]);router[_0xeed5('0xc')]('/',auth[_0xeed5('0x6')](),controller[_0xeed5('0xd')]);router[_0xeed5('0xe')](_0xeed5('0x9'),auth[_0xeed5('0x6')](),controller[_0xeed5('0xf')]);router[_0xeed5('0x10')](_0xeed5('0x9'),auth[_0xeed5('0x6')](),controller[_0xeed5('0x11')]);module[_0xeed5('0x12')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index e601739..b4657e8 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 _0x77f4=['../../config/environment','exports','VIRTUAL','getDataValue','value','STRING','replace','setDataValue','INTEGER','startedAt','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path'];(function(_0xd11ce7,_0x294a62){var _0x5f7040=function(_0xce0d3){while(--_0xce0d3){_0xd11ce7['push'](_0xd11ce7['shift']());}};_0x5f7040(++_0x294a62);}(_0x77f4,0x1a1));var _0x477f=function(_0x2da20e,_0x4595da){_0x2da20e=_0x2da20e-0x0;var _0x451690=_0x77f4[_0x2da20e];return _0x451690;};'use strict';var Sequelize=require(_0x477f('0x0'));var moment=require(_0x477f('0x1'));var path=require(_0x477f('0x2'));var config=require(_0x477f('0x3'));module[_0x477f('0x4')]={'format':{'type':Sequelize[_0x477f('0x5')],'get':function(){return this[_0x477f('0x6')](_0x477f('0x7'))?path['extname'](this[_0x477f('0x6')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x477f('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x16eb7d){var _0x56912c=_0x16eb7d[_0x477f('0x9')](/\\/g,'/');this[_0x477f('0xa')](_0x477f('0x7'),_0x56912c);}},'rating':{'type':Sequelize[_0x477f('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x4f60ca){this[_0x477f('0xa')](_0x477f('0xc'),moment()['subtract'](_0x4f60ca,'ms'));this[_0x477f('0xa')](_0x477f('0xd'),moment());this[_0x477f('0xa')](_0x477f('0xe'),_0x4f60ca);}},'startedAt':{'type':Sequelize[_0x477f('0xf')],'get':function(){return moment(this[_0x477f('0x6')]('startedAt'))[_0x477f('0x10')](_0x477f('0x11'))['toString']();}},'closedAt':{'type':Sequelize[_0x477f('0xf')],'get':function(){return moment(this['getDataValue']('closedAt'))[_0x477f('0x10')](_0x477f('0x11'))[_0x477f('0x12')]();}},'createdAt':{'type':Sequelize[_0x477f('0xf')],'get':function(){return moment(this[_0x477f('0x6')](_0x477f('0x13')))['format'](_0x477f('0x11'))[_0x477f('0x12')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x477f('0x6')](_0x477f('0x14')))[_0x477f('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x477f('0x12')]();}}}; \ No newline at end of file +var _0x2aa2=['duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','value','extname','getDataValue','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt'];(function(_0x49d892,_0x1d0a59){var _0x2a6b89=function(_0x54a868){while(--_0x54a868){_0x49d892['push'](_0x49d892['shift']());}};_0x2a6b89(++_0x1d0a59);}(_0x2aa2,0x75));var _0x22aa=function(_0x3f2899,_0x11cfa4){_0x3f2899=_0x3f2899-0x0;var _0x3dc551=_0x2aa2[_0x3f2899];return _0x3dc551;};'use strict';var Sequelize=require(_0x22aa('0x0'));var moment=require(_0x22aa('0x1'));var path=require(_0x22aa('0x2'));var config=require(_0x22aa('0x3'));module[_0x22aa('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x22aa('0x5'))?path[_0x22aa('0x6')](this[_0x22aa('0x7')]('value')):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x22aa('0x8')]},'value':{'type':Sequelize[_0x22aa('0x8')],'set':function(_0x50de35){var _0xe03ced=_0x50de35[_0x22aa('0x9')](/\\/g,'/');this[_0x22aa('0xa')](_0x22aa('0x5'),_0xe03ced);}},'rating':{'type':Sequelize[_0x22aa('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x167899){this[_0x22aa('0xa')](_0x22aa('0xc'),moment()[_0x22aa('0xd')](_0x167899,'ms'));this[_0x22aa('0xa')](_0x22aa('0xe'),moment());this[_0x22aa('0xa')](_0x22aa('0xf'),_0x167899);}},'startedAt':{'type':Sequelize[_0x22aa('0x10')],'get':function(){return moment(this[_0x22aa('0x7')](_0x22aa('0xc')))[_0x22aa('0x11')](_0x22aa('0x12'))[_0x22aa('0x13')]();}},'closedAt':{'type':Sequelize[_0x22aa('0x10')],'get':function(){return moment(this[_0x22aa('0x7')]('closedAt'))[_0x22aa('0x11')](_0x22aa('0x12'))['toString']();}},'createdAt':{'type':Sequelize[_0x22aa('0x10')],'get':function(){return moment(this['getDataValue'](_0x22aa('0x14')))[_0x22aa('0x11')](_0x22aa('0x12'))['toString']();}},'updatedAt':{'type':Sequelize[_0x22aa('0x10')],'get':function(){return moment(this[_0x22aa('0x7')](_0x22aa('0x15')))['format']('MM-DD-YYYY\x20HH:mm')[_0x22aa('0x13')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index ced63d4..1b4fa32 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 _0x7afe=['status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','send','ScreenRecording','rawAttributes','model','differenceBy','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','show','params','find','catch','create','body','duration','createdAt','closedAt','value','describe','download','../../components/encryptor','type','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x44339d,_0xcb4a61){var _0x48d9c1=function(_0x27f899){while(--_0x27f899){_0x44339d['push'](_0x44339d['shift']());}};_0x48d9c1(++_0xcb4a61);}(_0x7afe,0x15e));var _0xe7af=function(_0x4286ee,_0x2f1d8e){_0x4286ee=_0x4286ee-0x0;var _0x2da14a=_0x7afe[_0x4286ee];return _0x2da14a;};'use strict';var pdf=require(_0xe7af('0x0'));var emlformat=require(_0xe7af('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe7af('0x2'));var jsonpatch=require(_0xe7af('0x3'));var rp=require(_0xe7af('0x4'));var moment=require(_0xe7af('0x5'));var BPromise=require(_0xe7af('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe7af('0x7'));var sox=require('sox');var csv=require(_0xe7af('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xe7af('0x9'));var crypto=require('crypto');var jsforce=require(_0xe7af('0xa'));var deskjs=require(_0xe7af('0xb'));var toCsv=require(_0xe7af('0x8'));var querystring=require('querystring');var Papa=require(_0xe7af('0xc'));var Redis=require('ioredis');var authService=require(_0xe7af('0xd'));var qs=require(_0xe7af('0xe'));var hardwareService=require(_0xe7af('0xf'));var logger=require(_0xe7af('0x10'))(_0xe7af('0x11'));var utils=require(_0xe7af('0x12'));var config=require(_0xe7af('0x13'));var db=require(_0xe7af('0x14'))['db'];function respondWithStatusCode(_0x5c1d02,_0x5e5009){_0x5e5009=_0x5e5009||0xcc;return function(_0x2b69c6){if(_0x2b69c6){return _0x5c1d02[_0xe7af('0x15')](_0x5e5009);}return _0x5c1d02[_0xe7af('0x16')](_0x5e5009)[_0xe7af('0x17')]();};}function respondWithResult(_0x9af615,_0x4afefe){_0x4afefe=_0x4afefe||0xc8;return function(_0xc0a847){if(_0xc0a847){return _0x9af615['status'](_0x4afefe)[_0xe7af('0x18')](_0xc0a847);}};}function respondWithFilteredResult(_0x3eb359,_0x9539aa){return function(_0x4b9cea){if(_0x4b9cea){var _0x982c5e=_0x4b9cea[_0xe7af('0x19')],_0x12e8a5=_0x9539aa[_0xe7af('0x1a')],_0x42e292=_0x9539aa[_0xe7af('0x1a')]+_0x9539aa[_0xe7af('0x1b')],_0x381874;if(_0x42e292>=_0x982c5e){_0x42e292=_0x982c5e;_0x381874=0xc8;}else{_0x381874=0xce;}_0x3eb359[_0xe7af('0x16')](_0x381874);return _0x3eb359[_0xe7af('0x1c')]('Content-Range',_0x12e8a5+'-'+_0x42e292+'/'+_0x982c5e)[_0xe7af('0x18')](_0x4b9cea);}return null;};}function patchUpdates(_0x44a4f1){return function(_0x5d3243){try{jsonpatch[_0xe7af('0x1d')](_0x5d3243,_0x44a4f1,!![]);}catch(_0x20d4a6){return BPromise[_0xe7af('0x1e')](_0x20d4a6);}return _0x5d3243[_0xe7af('0x1f')]();};}function saveUpdates(_0x2391a0,_0x5daa1d){return function(_0x335dbf){if(_0x335dbf){return _0x335dbf[_0xe7af('0x20')](_0x2391a0)[_0xe7af('0x21')](function(_0xbe57f4){return _0xbe57f4;});}return null;};}function removeEntity(_0x28efdf,_0x11408c){return function(_0x4bcc16){if(_0x4bcc16){return _0x4bcc16[_0xe7af('0x22')]()['then'](function(){_0x28efdf['status'](0xcc)[_0xe7af('0x17')]();});}};}function handleEntityNotFound(_0x2d6d7f,_0x9541d5){return function(_0x10fb41){if(!_0x10fb41){_0x2d6d7f[_0xe7af('0x15')](0x194);}return _0x10fb41;};}function handleError(_0x56ea88,_0x3f4c74){_0x3f4c74=_0x3f4c74||0x1f4;return function(_0x148ac8){logger['error'](_0x148ac8[_0xe7af('0x23')]);if(_0x148ac8[_0xe7af('0x24')]){delete _0x148ac8[_0xe7af('0x24')];}_0x56ea88['status'](_0x3f4c74)[_0xe7af('0x25')](_0x148ac8);};}exports['index']=function(_0x26f1d0,_0x4aa862){var _0x2bf8b1={},_0x301a91={},_0x4aecfa={'count':0x0,'rows':[]};var _0x1c3b32=db[_0xe7af('0x26')][_0xe7af('0x27')];_0x301a91[_0xe7af('0x28')]=_[_0xe7af('0x29')](_[_0xe7af('0x2a')](_0x1c3b32),['format']);_0x301a91['query']=_[_0xe7af('0x2a')](_0x26f1d0[_0xe7af('0x2b')]);_0x301a91[_0xe7af('0x2c')]=_['intersection'](_0x301a91[_0xe7af('0x28')],_0x301a91['query']);_0x2bf8b1['attributes']=_[_0xe7af('0x2d')](_0x301a91[_0xe7af('0x28')],qs[_0xe7af('0x2e')](_0x26f1d0[_0xe7af('0x2b')][_0xe7af('0x2e')]));_0x2bf8b1['attributes']=_0x2bf8b1[_0xe7af('0x2f')][_0xe7af('0x30')]?_0x2bf8b1['attributes']:_0x301a91[_0xe7af('0x28')];if(!_0x26f1d0[_0xe7af('0x2b')][_0xe7af('0x31')](_0xe7af('0x32'))){_0x2bf8b1[_0xe7af('0x1b')]=qs[_0xe7af('0x1b')](_0x26f1d0[_0xe7af('0x2b')][_0xe7af('0x1b')]);_0x2bf8b1[_0xe7af('0x1a')]=qs[_0xe7af('0x1a')](_0x26f1d0[_0xe7af('0x2b')]['offset']);}_0x2bf8b1['order']=qs[_0xe7af('0x33')](_0x26f1d0[_0xe7af('0x2b')][_0xe7af('0x33')]);_0x2bf8b1[_0xe7af('0x34')]=qs[_0xe7af('0x2c')](_['pick'](_0x26f1d0['query'],_0x301a91['filters']));if(_0x26f1d0[_0xe7af('0x2b')][_0xe7af('0x35')]){_0x2bf8b1[_0xe7af('0x34')]=_[_0xe7af('0x36')](_0x2bf8b1[_0xe7af('0x34')],{'$or':_[_0xe7af('0x37')](_0x1c3b32,function(_0xd17745){if(_0xd17745['type'][_0xe7af('0x38')]!==_0xe7af('0x39')){var _0x4cc063={};_0x4cc063[_0xd17745[_0xe7af('0x3a')]]={'$like':'%'+_0x26f1d0[_0xe7af('0x2b')]['filter']+'%'};return _0x4cc063;}})});}_0x2bf8b1=_[_0xe7af('0x36')]({},_0x2bf8b1,_0x26f1d0[_0xe7af('0x3b')]);var _0x325729={'where':_0x2bf8b1[_0xe7af('0x34')]};return db[_0xe7af('0x26')]['count'](_0x325729)[_0xe7af('0x21')](function(_0x127663){_0x4aecfa[_0xe7af('0x19')]=_0x127663;if(_0x26f1d0[_0xe7af('0x2b')][_0xe7af('0x3c')]){_0x2bf8b1[_0xe7af('0x3d')]=[{'all':!![]}];}return db['ScreenRecording'][_0xe7af('0x3e')](_0x2bf8b1);})['then'](function(_0x2e1989){_0x4aecfa['rows']=_0x2e1989;return _0x4aecfa;})[_0xe7af('0x21')](respondWithFilteredResult(_0x4aa862,_0x2bf8b1))['catch'](handleError(_0x4aa862,null));};exports[_0xe7af('0x3f')]=function(_0x2d3e7c,_0x4c59e2){var _0x32db5d={'raw':![],'where':{'id':_0x2d3e7c[_0xe7af('0x40')]['id']}},_0x3fa569={};_0x3fa569[_0xe7af('0x28')]=_[_0xe7af('0x2a')](db[_0xe7af('0x26')][_0xe7af('0x27')]);_0x3fa569[_0xe7af('0x2b')]=_['keys'](_0x2d3e7c['query']);_0x3fa569['filters']=_[_0xe7af('0x2d')](_0x3fa569['model'],_0x3fa569[_0xe7af('0x2b')]);_0x32db5d[_0xe7af('0x2f')]=_[_0xe7af('0x2d')](_0x3fa569['model'],qs[_0xe7af('0x2e')](_0x2d3e7c[_0xe7af('0x2b')]['fields']));_0x32db5d['attributes']=_0x32db5d['attributes'][_0xe7af('0x30')]?_0x32db5d[_0xe7af('0x2f')]:_0x3fa569[_0xe7af('0x28')];if(_0x2d3e7c[_0xe7af('0x2b')][_0xe7af('0x3c')]){_0x32db5d[_0xe7af('0x3d')]=[{'all':!![]}];}_0x32db5d=_['merge']({},_0x32db5d,_0x2d3e7c['options']);return db['ScreenRecording'][_0xe7af('0x41')](_0x32db5d)['then'](handleEntityNotFound(_0x4c59e2,null))[_0xe7af('0x21')](respondWithResult(_0x4c59e2,null))[_0xe7af('0x42')](handleError(_0x4c59e2,null));};exports[_0xe7af('0x43')]=function(_0x5941cb,_0xab86f1){return db[_0xe7af('0x26')][_0xe7af('0x43')](_0x5941cb[_0xe7af('0x44')],{})[_0xe7af('0x21')](respondWithResult(_0xab86f1,0xc9))[_0xe7af('0x42')](handleError(_0xab86f1,null));};exports[_0xe7af('0x20')]=function(_0x30117d,_0x35c1b9){if(_0x30117d[_0xe7af('0x44')]['id']){delete _0x30117d[_0xe7af('0x44')]['id'];}delete _0x30117d[_0xe7af('0x44')][_0xe7af('0x45')];delete _0x30117d['body'][_0xe7af('0x46')];delete _0x30117d[_0xe7af('0x44')][_0xe7af('0x47')];delete _0x30117d[_0xe7af('0x44')][_0xe7af('0x48')];return db[_0xe7af('0x26')][_0xe7af('0x41')]({'where':{'id':_0x30117d[_0xe7af('0x40')]['id']}})[_0xe7af('0x21')](handleEntityNotFound(_0x35c1b9,null))['then'](saveUpdates(_0x30117d['body'],null))[_0xe7af('0x21')](respondWithResult(_0x35c1b9,null))['catch'](handleError(_0x35c1b9,null));};exports[_0xe7af('0x22')]=function(_0xa43f0,_0x225503){return db['ScreenRecording']['find']({'where':{'id':_0xa43f0[_0xe7af('0x40')]['id']}})[_0xe7af('0x21')](handleEntityNotFound(_0x225503,null))[_0xe7af('0x21')](removeEntity(_0x225503,null))[_0xe7af('0x42')](handleError(_0x225503,null));};exports[_0xe7af('0x49')]=function(_0x56cd33,_0x3e356f){return db[_0xe7af('0x26')][_0xe7af('0x49')]()[_0xe7af('0x21')](respondWithResult(_0x3e356f,null))[_0xe7af('0x42')](handleError(_0x3e356f,null));};exports[_0xe7af('0x4a')]=function(_0x300b1f,_0x37b108,_0x43e9f5){var _0x70eef1=require(_0xe7af('0x4b'));var _0x17f7bc=![];var _0x4d8c31={};if(_0x300b1f[_0xe7af('0x2b')][_0xe7af('0x4c')]&&_0x300b1f['query'][_0xe7af('0x4c')]===_0xe7af('0x4d')){_0x4d8c31['uniqueid']=_0x300b1f['params']['id'];}else{_0x4d8c31['id']=_0x300b1f[_0xe7af('0x40')]['id'];}return db['ScreenRecording']['find']({'where':_0x4d8c31,'attributes':['id',_0xe7af('0x48')],'raw':!![]})[_0xe7af('0x21')](handleEntityNotFound(_0x37b108,null))[_0xe7af('0x21')](function(_0x68593e){if(_0x68593e){var _0x538a1a=path[_0xe7af('0x4e')](config[_0xe7af('0x4f')],_0xe7af('0x50'),_0x68593e['value']);var _0x1d67ee=util['format'](_0xe7af('0x51'),_0x538a1a);if(fs[_0xe7af('0x52')](_0x1d67ee)){_0x17f7bc=!![];return _0x70eef1[_0xe7af('0x53')](_0x1d67ee,_0x538a1a,config[_0xe7af('0x54')][_0xe7af('0x55')])[_0xe7af('0x21')](function(){return _0x68593e;});}return _0x68593e;}})['then'](function(_0x682ead){if(_0x682ead){var _0x38a965=path[_0xe7af('0x4e')](config[_0xe7af('0x4f')],_0xe7af('0x50'),_0x682ead[_0xe7af('0x48')]);if(!fs[_0xe7af('0x52')](_0x38a965)){throw new db[(_0xe7af('0x56'))][(_0xe7af('0x57'))](_0xe7af('0x58'));}if(_0x682ead[_0xe7af('0x59')]){return _0x37b108[_0xe7af('0x4a')](_0x38a965,_0x682ead[_0xe7af('0x59')]+path[_0xe7af('0x5a')](_0x38a965),function(){if(_0x17f7bc){fs[_0xe7af('0x5b')](_0x38a965);}});}else{return _0x37b108[_0xe7af('0x4a')](_0x38a965,function(_0x1ee650){if(_0x17f7bc){fs['unlink'](_0x38a965);}});}}})[_0xe7af('0x42')](function(_0xe81b25){if(_0xe81b25[_0xe7af('0x5c')]===_0xe7af('0x58')){_0x37b108[_0xe7af('0x16')](0x194)[_0xe7af('0x25')]('Not\x20found');}else{return handleError(_0x37b108,null);}});}; \ No newline at end of file +var _0xdf34=['uniqueid','value','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','Not\x20found','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','ScreenRecording','rawAttributes','model','format','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','map','type','key','field','filter','options','count','include','findAll','rows','catch','show','includeAll','find','body','update','createdAt','closedAt','params','describe','download'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf34,0x123));var _0x4df3=function(_0x2b59da,_0x5f57b9){_0x2b59da=_0x2b59da-0x0;var _0x447237=_0xdf34[_0x2b59da];return _0x447237;};'use strict';var pdf=require(_0x4df3('0x0'));var emlformat=require(_0x4df3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4df3('0x2'));var jsonpatch=require(_0x4df3('0x3'));var rp=require(_0x4df3('0x4'));var moment=require(_0x4df3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4df3('0x6'));var util=require(_0x4df3('0x7'));var path=require(_0x4df3('0x8'));var sox=require(_0x4df3('0x9'));var csv=require('to-csv');var ejs=require(_0x4df3('0xa'));var fs=require('fs');var _=require(_0x4df3('0xb'));var squel=require(_0x4df3('0xc'));var crypto=require(_0x4df3('0xd'));var jsforce=require(_0x4df3('0xe'));var deskjs=require(_0x4df3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4df3('0x10'));var Papa=require(_0x4df3('0x11'));var Redis=require('ioredis');var authService=require(_0x4df3('0x12'));var qs=require(_0x4df3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4df3('0x14'))('api');var utils=require(_0x4df3('0x15'));var config=require(_0x4df3('0x16'));var db=require(_0x4df3('0x17'))['db'];function respondWithStatusCode(_0x49861c,_0x4d1f4d){_0x4d1f4d=_0x4d1f4d||0xcc;return function(_0x1b499d){if(_0x1b499d){return _0x49861c[_0x4df3('0x18')](_0x4d1f4d);}return _0x49861c[_0x4df3('0x19')](_0x4d1f4d)['end']();};}function respondWithResult(_0x11aa15,_0x2ce494){_0x2ce494=_0x2ce494||0xc8;return function(_0x4d790f){if(_0x4d790f){return _0x11aa15[_0x4df3('0x19')](_0x2ce494)[_0x4df3('0x1a')](_0x4d790f);}};}function respondWithFilteredResult(_0x304a0a,_0x17aa5f){return function(_0x511be0){if(_0x511be0){var _0x31ce5d=_0x511be0['count'],_0x27809d=_0x17aa5f[_0x4df3('0x1b')],_0x5e7fc3=_0x17aa5f[_0x4df3('0x1b')]+_0x17aa5f[_0x4df3('0x1c')],_0x611356;if(_0x5e7fc3>=_0x31ce5d){_0x5e7fc3=_0x31ce5d;_0x611356=0xc8;}else{_0x611356=0xce;}_0x304a0a[_0x4df3('0x19')](_0x611356);return _0x304a0a['set'](_0x4df3('0x1d'),_0x27809d+'-'+_0x5e7fc3+'/'+_0x31ce5d)['json'](_0x511be0);}return null;};}function patchUpdates(_0x782916){return function(_0x27fc69){try{jsonpatch[_0x4df3('0x1e')](_0x27fc69,_0x782916,!![]);}catch(_0x1c4f19){return BPromise[_0x4df3('0x1f')](_0x1c4f19);}return _0x27fc69[_0x4df3('0x20')]();};}function saveUpdates(_0xf513c1,_0x54acc4){return function(_0x574998){if(_0x574998){return _0x574998['update'](_0xf513c1)[_0x4df3('0x21')](function(_0xae3243){return _0xae3243;});}return null;};}function removeEntity(_0x4c5929,_0x594f8c){return function(_0x15f41d){if(_0x15f41d){return _0x15f41d[_0x4df3('0x22')]()[_0x4df3('0x21')](function(){_0x4c5929[_0x4df3('0x19')](0xcc)[_0x4df3('0x23')]();});}};}function handleEntityNotFound(_0x1d77a2,_0x2c2fcb){return function(_0x9eee7c){if(!_0x9eee7c){_0x1d77a2['sendStatus'](0x194);}return _0x9eee7c;};}function handleError(_0x17659e,_0x4a65f8){_0x4a65f8=_0x4a65f8||0x1f4;return function(_0x1ff782){logger['error'](_0x1ff782[_0x4df3('0x24')]);if(_0x1ff782['name']){delete _0x1ff782[_0x4df3('0x25')];}_0x17659e[_0x4df3('0x19')](_0x4a65f8)[_0x4df3('0x26')](_0x1ff782);};}exports['index']=function(_0x5f16e0,_0x3e5f3b){var _0x53ec94={},_0x1ef395={},_0x1d9a51={'count':0x0,'rows':[]};var _0x520870=db[_0x4df3('0x27')][_0x4df3('0x28')];_0x1ef395[_0x4df3('0x29')]=_['differenceBy'](_['keys'](_0x520870),[_0x4df3('0x2a')]);_0x1ef395[_0x4df3('0x2b')]=_[_0x4df3('0x2c')](_0x5f16e0[_0x4df3('0x2b')]);_0x1ef395[_0x4df3('0x2d')]=_[_0x4df3('0x2e')](_0x1ef395[_0x4df3('0x29')],_0x1ef395[_0x4df3('0x2b')]);_0x53ec94['attributes']=_[_0x4df3('0x2e')](_0x1ef395[_0x4df3('0x29')],qs[_0x4df3('0x2f')](_0x5f16e0[_0x4df3('0x2b')][_0x4df3('0x2f')]));_0x53ec94[_0x4df3('0x30')]=_0x53ec94[_0x4df3('0x30')][_0x4df3('0x31')]?_0x53ec94[_0x4df3('0x30')]:_0x1ef395['model'];if(!_0x5f16e0['query']['hasOwnProperty'](_0x4df3('0x32'))){_0x53ec94[_0x4df3('0x1c')]=qs['limit'](_0x5f16e0[_0x4df3('0x2b')][_0x4df3('0x1c')]);_0x53ec94[_0x4df3('0x1b')]=qs[_0x4df3('0x1b')](_0x5f16e0[_0x4df3('0x2b')]['offset']);}_0x53ec94[_0x4df3('0x33')]=qs[_0x4df3('0x34')](_0x5f16e0[_0x4df3('0x2b')][_0x4df3('0x34')]);_0x53ec94[_0x4df3('0x35')]=qs[_0x4df3('0x2d')](_[_0x4df3('0x36')](_0x5f16e0[_0x4df3('0x2b')],_0x1ef395['filters']));if(_0x5f16e0['query']['filter']){_0x53ec94['where']=_[_0x4df3('0x37')](_0x53ec94[_0x4df3('0x35')],{'$or':_[_0x4df3('0x38')](_0x520870,function(_0x42c4cb){if(_0x42c4cb[_0x4df3('0x39')][_0x4df3('0x3a')]!=='VIRTUAL'){var _0x458238={};_0x458238[_0x42c4cb[_0x4df3('0x3b')]]={'$like':'%'+_0x5f16e0['query'][_0x4df3('0x3c')]+'%'};return _0x458238;}})});}_0x53ec94=_[_0x4df3('0x37')]({},_0x53ec94,_0x5f16e0[_0x4df3('0x3d')]);var _0x2628e8={'where':_0x53ec94['where']};return db['ScreenRecording'][_0x4df3('0x3e')](_0x2628e8)[_0x4df3('0x21')](function(_0x1e1d1d){_0x1d9a51[_0x4df3('0x3e')]=_0x1e1d1d;if(_0x5f16e0[_0x4df3('0x2b')]['includeAll']){_0x53ec94[_0x4df3('0x3f')]=[{'all':!![]}];}return db[_0x4df3('0x27')][_0x4df3('0x40')](_0x53ec94);})[_0x4df3('0x21')](function(_0x3f622e){_0x1d9a51[_0x4df3('0x41')]=_0x3f622e;return _0x1d9a51;})[_0x4df3('0x21')](respondWithFilteredResult(_0x3e5f3b,_0x53ec94))[_0x4df3('0x42')](handleError(_0x3e5f3b,null));};exports[_0x4df3('0x43')]=function(_0x12e661,_0xb8f087){var _0x3774d8={'raw':![],'where':{'id':_0x12e661['params']['id']}},_0x6c9afd={};_0x6c9afd[_0x4df3('0x29')]=_[_0x4df3('0x2c')](db[_0x4df3('0x27')][_0x4df3('0x28')]);_0x6c9afd[_0x4df3('0x2b')]=_['keys'](_0x12e661['query']);_0x6c9afd[_0x4df3('0x2d')]=_['intersection'](_0x6c9afd[_0x4df3('0x29')],_0x6c9afd['query']);_0x3774d8[_0x4df3('0x30')]=_[_0x4df3('0x2e')](_0x6c9afd[_0x4df3('0x29')],qs['fields'](_0x12e661[_0x4df3('0x2b')][_0x4df3('0x2f')]));_0x3774d8['attributes']=_0x3774d8[_0x4df3('0x30')][_0x4df3('0x31')]?_0x3774d8['attributes']:_0x6c9afd['model'];if(_0x12e661[_0x4df3('0x2b')][_0x4df3('0x44')]){_0x3774d8['include']=[{'all':!![]}];}_0x3774d8=_['merge']({},_0x3774d8,_0x12e661[_0x4df3('0x3d')]);return db['ScreenRecording'][_0x4df3('0x45')](_0x3774d8)['then'](handleEntityNotFound(_0xb8f087,null))[_0x4df3('0x21')](respondWithResult(_0xb8f087,null))[_0x4df3('0x42')](handleError(_0xb8f087,null));};exports['create']=function(_0x1cd0d3,_0x29cacf){return db[_0x4df3('0x27')]['create'](_0x1cd0d3[_0x4df3('0x46')],{})[_0x4df3('0x21')](respondWithResult(_0x29cacf,0xc9))[_0x4df3('0x42')](handleError(_0x29cacf,null));};exports[_0x4df3('0x47')]=function(_0x461607,_0x25f85f){if(_0x461607[_0x4df3('0x46')]['id']){delete _0x461607[_0x4df3('0x46')]['id'];}delete _0x461607[_0x4df3('0x46')]['duration'];delete _0x461607[_0x4df3('0x46')][_0x4df3('0x48')];delete _0x461607['body'][_0x4df3('0x49')];delete _0x461607[_0x4df3('0x46')]['value'];return db[_0x4df3('0x27')][_0x4df3('0x45')]({'where':{'id':_0x461607['params']['id']}})[_0x4df3('0x21')](handleEntityNotFound(_0x25f85f,null))['then'](saveUpdates(_0x461607['body'],null))['then'](respondWithResult(_0x25f85f,null))[_0x4df3('0x42')](handleError(_0x25f85f,null));};exports[_0x4df3('0x22')]=function(_0x5e1ad7,_0x16b1fc){return db['ScreenRecording'][_0x4df3('0x45')]({'where':{'id':_0x5e1ad7[_0x4df3('0x4a')]['id']}})[_0x4df3('0x21')](handleEntityNotFound(_0x16b1fc,null))[_0x4df3('0x21')](removeEntity(_0x16b1fc,null))[_0x4df3('0x42')](handleError(_0x16b1fc,null));};exports[_0x4df3('0x4b')]=function(_0x5b74a9,_0x55e9f3){return db[_0x4df3('0x27')][_0x4df3('0x4b')]()[_0x4df3('0x21')](respondWithResult(_0x55e9f3,null))[_0x4df3('0x42')](handleError(_0x55e9f3,null));};exports[_0x4df3('0x4c')]=function(_0x2e303a,_0x5aa687,_0x888f88){var _0x2809ac=require('../../components/encryptor');var _0xa245da=![];var _0x3a9372={};if(_0x2e303a[_0x4df3('0x2b')][_0x4df3('0x39')]&&_0x2e303a[_0x4df3('0x2b')]['type']===_0x4df3('0x4d')){_0x3a9372['uniqueid']=_0x2e303a[_0x4df3('0x4a')]['id'];}else{_0x3a9372['id']=_0x2e303a[_0x4df3('0x4a')]['id'];}return db[_0x4df3('0x27')]['find']({'where':_0x3a9372,'attributes':['id',_0x4df3('0x4e')],'raw':!![]})[_0x4df3('0x21')](handleEntityNotFound(_0x5aa687,null))['then'](function(_0x2a72ae){if(_0x2a72ae){var _0x1b9666=path['join'](config[_0x4df3('0x4f')],_0x4df3('0x50'),_0x2a72ae['value']);var _0x3935cf=util[_0x4df3('0x2a')](_0x4df3('0x51'),_0x1b9666);if(fs[_0x4df3('0x52')](_0x3935cf)){_0xa245da=!![];return _0x2809ac[_0x4df3('0x53')](_0x3935cf,_0x1b9666,config[_0x4df3('0x54')][_0x4df3('0x55')])[_0x4df3('0x21')](function(){return _0x2a72ae;});}return _0x2a72ae;}})['then'](function(_0x1b98ce){if(_0x1b98ce){var _0x535465=path['join'](config['root'],'server/files/screen_recordings',_0x1b98ce[_0x4df3('0x4e')]);if(!fs[_0x4df3('0x52')](_0x535465)){throw new db[(_0x4df3('0x56'))][(_0x4df3('0x57'))](_0x4df3('0x58'));}if(_0x1b98ce[_0x4df3('0x59')]){return _0x5aa687['download'](_0x535465,_0x1b98ce[_0x4df3('0x59')]+path['extname'](_0x535465),function(){if(_0xa245da){fs[_0x4df3('0x5a')](_0x535465);}});}else{return _0x5aa687[_0x4df3('0x4c')](_0x535465,function(_0x5088d7){if(_0xa245da){fs[_0x4df3('0x5a')](_0x535465);}});}}})[_0x4df3('0x42')](function(_0x2e7ca2){if(_0x2e7ca2['message']==='ScreenRecording\x20not\x20found'){_0x5aa687[_0x4df3('0x19')](0x194)[_0x4df3('0x26')](_0x4df3('0x5b'));}else{return handleError(_0x5aa687,null);}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index d754b72..5b17c43 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 _0xf119=['rimraf','../../config/environment','./screenRecording.attributes','define','screen_recordings','interactionid','value','join','root','files','existsSync','resolve','finally','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x53ad5f,_0x58d125){var _0xa455d1=function(_0x335682){while(--_0x335682){_0x53ad5f['push'](_0x53ad5f['shift']());}};_0xa455d1(++_0x58d125);}(_0xf119,0x117));var _0x9f11=function(_0x4f4c14,_0x4462dc){_0x4f4c14=_0x4f4c14-0x0;var _0xa5fed5=_0xf119[_0x4f4c14];return _0xa5fed5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9f11('0x0'))(_0x9f11('0x1'));var moment=require(_0x9f11('0x2'));var BPromise=require(_0x9f11('0x3'));var rp=require(_0x9f11('0x4'));var fs=require('fs');var path=require(_0x9f11('0x5'));var rimraf=require(_0x9f11('0x6'));var config=require(_0x9f11('0x7'));var attributes=require(_0x9f11('0x8'));module['exports']=function(_0x4eba95,_0x120f25){return _0x4eba95[_0x9f11('0x9')]('ScreenRecording',attributes,{'tableName':_0x9f11('0xa'),'paranoid':![],'indexes':[{'name':_0x9f11('0xb'),'fields':['interactionid']}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x12826c,_0x27e260,_0x501a67){return new BPromise(function(_0x3205b2,_0xec3925){if(!_['isNil'](_0x12826c[_0x9f11('0xc')])){var _0x3d7b39=path[_0x9f11('0xd')](config[_0x9f11('0xe')],'server',_0x9f11('0xf'),_0x9f11('0xa'),_0x12826c[_0x9f11('0xc')]);if(fs[_0x9f11('0x10')](_0x3d7b39)){rimraf(_0x3d7b39,function(_0x3c4e6d){if(_0x3c4e6d){console['log'](_0x3c4e6d);}});}}_0x3205b2();})['catch'](function(_0x5acdc3){BPromise[_0x9f11('0x11')]();})[_0x9f11('0x12')](function(){_0x501a67();});}}});}; \ No newline at end of file +var _0xac0f=['../../config/logger','api','moment','request-promise','path','../../config/environment','./screenRecording.attributes','define','screen_recordings','interactionid','isNil','value','join','server','files','existsSync','log','catch','resolve','finally','lodash'];(function(_0x550b93,_0x46c892){var _0x201d68=function(_0xb159a4){while(--_0xb159a4){_0x550b93['push'](_0x550b93['shift']());}};_0x201d68(++_0x46c892);}(_0xac0f,0xd1));var _0xfac0=function(_0x248dd4,_0x341c98){_0x248dd4=_0x248dd4-0x0;var _0xcdd8db=_0xac0f[_0x248dd4];return _0xcdd8db;};'use strict';var _=require(_0xfac0('0x0'));var util=require('util');var logger=require(_0xfac0('0x1'))(_0xfac0('0x2'));var moment=require(_0xfac0('0x3'));var BPromise=require('bluebird');var rp=require(_0xfac0('0x4'));var fs=require('fs');var path=require(_0xfac0('0x5'));var rimraf=require('rimraf');var config=require(_0xfac0('0x6'));var attributes=require(_0xfac0('0x7'));module['exports']=function(_0xe47e02,_0x276e1f){return _0xe47e02[_0xfac0('0x8')]('ScreenRecording',attributes,{'tableName':_0xfac0('0x9'),'paranoid':![],'indexes':[{'name':_0xfac0('0xa'),'fields':[_0xfac0('0xa')]}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x3def70,_0x350e32,_0x164fa1){return new BPromise(function(_0x58da10,_0x1fc609){if(!_[_0xfac0('0xb')](_0x3def70[_0xfac0('0xc')])){var _0x2e25e9=path[_0xfac0('0xd')](config['root'],_0xfac0('0xe'),_0xfac0('0xf'),_0xfac0('0x9'),_0x3def70[_0xfac0('0xc')]);if(fs[_0xfac0('0x10')](_0x2e25e9)){rimraf(_0x2e25e9,function(_0xa85519){if(_0xa85519){console[_0xfac0('0x11')](_0xa85519);}});}}_0x58da10();})[_0xfac0('0x12')](function(_0xd1f175){BPromise[_0xfac0('0x13')]();})[_0xfac0('0x14')](function(){_0x164fa1();});}}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index b5ff95c..7ac2775 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 _0xc978=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8c97('0x0'));var util=require(_0x8c97('0x1'));var moment=require(_0x8c97('0x2'));var BPromise=require(_0x8c97('0x3'));var rs=require(_0x8c97('0x4'));var fs=require('fs');var Redis=require(_0x8c97('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8c97('0x6'));var logger=require(_0x8c97('0x7'))(_0x8c97('0x8'));var config=require(_0x8c97('0x9'));var jayson=require(_0x8c97('0xa'));var client=jayson[_0x8c97('0xb')][_0x8c97('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x524196,_0x41a511,_0x1b5864){return new BPromise(function(_0x332cd1,_0x26ff40){return client[_0x8c97('0xd')](_0x524196,_0x1b5864)[_0x8c97('0xe')](function(_0x17aef0){logger['info'](_0x8c97('0xf'),_0x41a511,_0x8c97('0x10'));logger[_0x8c97('0x11')](_0x8c97('0x12'),_0x41a511,_0x8c97('0x10'),JSON[_0x8c97('0x13')](_0x17aef0));if(_0x17aef0[_0x8c97('0x14')]){if(_0x17aef0[_0x8c97('0x14')][_0x8c97('0x15')]===0x1f4){logger['error'](_0x8c97('0xf'),_0x41a511,_0x17aef0[_0x8c97('0x14')]['message']);return _0x26ff40(_0x17aef0[_0x8c97('0x14')][_0x8c97('0x16')]);}logger['error'](_0x8c97('0xf'),_0x41a511,_0x17aef0['error']['message']);return _0x332cd1(_0x17aef0['error'][_0x8c97('0x16')]);}else{logger[_0x8c97('0x17')](_0x8c97('0xf'),_0x41a511,_0x8c97('0x10'));_0x332cd1(_0x17aef0[_0x8c97('0x18')][_0x8c97('0x16')]);}})[_0x8c97('0x19')](function(_0xe3be1){logger[_0x8c97('0x14')]('ScreenRecording,\x20%s,\x20%s',_0x41a511,_0xe3be1);_0x26ff40(_0xe3be1);});});} \ No newline at end of file +var _0x3435=['request','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x565130,_0x27cfde){var _0x38de76=function(_0x344725){while(--_0x344725){_0x565130['push'](_0x565130['shift']());}};_0x38de76(++_0x27cfde);}(_0x3435,0xfa));var _0x5343=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x3435[_0x209941];return _0x1e8729;};'use strict';var _=require(_0x5343('0x0'));var util=require(_0x5343('0x1'));var moment=require(_0x5343('0x2'));var BPromise=require(_0x5343('0x3'));var rs=require(_0x5343('0x4'));var fs=require('fs');var Redis=require(_0x5343('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5343('0x6'));var logger=require(_0x5343('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5343('0x8'));var client=jayson[_0x5343('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x544b29,_0x13641f,_0x1e1911){return new BPromise(function(_0x9ea9b6,_0x245034){return client[_0x5343('0xa')](_0x544b29,_0x1e1911)['then'](function(_0x44421c){logger['info'](_0x5343('0xb'),_0x13641f,_0x5343('0xc'));logger[_0x5343('0xd')](_0x5343('0xe'),_0x13641f,_0x5343('0xc'),JSON['stringify'](_0x44421c));if(_0x44421c[_0x5343('0xf')]){if(_0x44421c[_0x5343('0xf')][_0x5343('0x10')]===0x1f4){logger['error'](_0x5343('0xb'),_0x13641f,_0x44421c['error'][_0x5343('0x11')]);return _0x245034(_0x44421c[_0x5343('0xf')]['message']);}logger[_0x5343('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x13641f,_0x44421c[_0x5343('0xf')][_0x5343('0x11')]);return _0x9ea9b6(_0x44421c[_0x5343('0xf')][_0x5343('0x11')]);}else{logger['info'](_0x5343('0xb'),_0x13641f,_0x5343('0xc'));_0x9ea9b6(_0x44421c[_0x5343('0x12')][_0x5343('0x11')]);}})[_0x5343('0x13')](function(_0x2913e8){logger[_0x5343('0xf')](_0x5343('0xb'),_0x13641f,_0x2913e8);_0x245034(_0x2913e8);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index dbc4158..508cb72 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 _0xb750=['addLogo','join','logologin','addLogoLogin','preferred','/:id/preferred','single','addPreferred','put','isAuthenticated','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','index','get','/:id','show','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','getPreferred','diskStorage','root','server/files/images/logos/','format','logo','extname','originalname','post','/:id/logo','file'];(function(_0xd2c718,_0x385d65){var _0x58942e=function(_0x7c5890){while(--_0x7c5890){_0xd2c718['push'](_0xd2c718['shift']());}};_0x58942e(++_0x385d65);}(_0xb750,0x133));var _0x0b75=function(_0x2763f0,_0x5f4d85){_0x2763f0=_0x2763f0-0x0;var _0x3f8b15=_0xb750[_0x2763f0];return _0x3f8b15;};'use strict';var multer=require(_0x0b75('0x0'));var util=require(_0x0b75('0x1'));var path=require('path');var timeout=require(_0x0b75('0x2'));var express=require(_0x0b75('0x3'));var router=express[_0x0b75('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0b75('0x5'));var config=require(_0x0b75('0x6'));var controller=require('./setting.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0b75('0x7')]);router[_0x0b75('0x8')](_0x0b75('0x9'),controller[_0x0b75('0xa')]);router[_0x0b75('0x8')]('/:id/logo',controller['getLogo']);router['get'](_0x0b75('0xb'),controller[_0x0b75('0xc')]);router['get'](_0x0b75('0xd'),controller[_0x0b75('0xe')]);router['get']('/:id/preferred',controller[_0x0b75('0xf')]);var upload=multer({'storage':multer[_0x0b75('0x10')]({'destination':function(_0x388181,_0x561875,_0x137000){_0x137000(null,path['join'](config[_0x0b75('0x11')],_0x0b75('0x12')));},'filename':function(_0x345e94,_0x4300cd,_0x14812d){_0x14812d(null,util[_0x0b75('0x13')]('%s%s',_0x0b75('0x14'),path[_0x0b75('0x15')](_0x4300cd[_0x0b75('0x16')])));}})});router[_0x0b75('0x17')](_0x0b75('0x18'),upload['single'](_0x0b75('0x19')),controller[_0x0b75('0x1a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x221bae,_0x246129,_0x3578f9){_0x3578f9(null,path[_0x0b75('0x1b')](config[_0x0b75('0x11')],_0x0b75('0x12')));},'filename':function(_0x84460e,_0x105e36,_0x2aa7a5){_0x2aa7a5(null,util[_0x0b75('0x13')]('%s%s',_0x0b75('0x1c'),path[_0x0b75('0x15')](_0x105e36[_0x0b75('0x16')])));}})});router['post']('/:id/logo_login',upload['single'](_0x0b75('0x19')),controller[_0x0b75('0x1d')]);var upload=multer({'storage':multer[_0x0b75('0x10')]({'destination':function(_0x27ab4c,_0x7b331d,_0x125e49){_0x125e49(null,path['join'](config['root'],_0x0b75('0x12')));},'filename':function(_0x420879,_0x2085fc,_0x5e08dc){_0x5e08dc(null,util[_0x0b75('0x13')]('%s%s',_0x0b75('0x1e'),path[_0x0b75('0x15')](_0x2085fc[_0x0b75('0x16')])));}})});router['post'](_0x0b75('0x1f'),upload[_0x0b75('0x20')]('file'),controller[_0x0b75('0x21')]);router[_0x0b75('0x22')](_0x0b75('0x9'),auth[_0x0b75('0x23')](),controller['update']);module[_0x0b75('0x24')]=router; \ No newline at end of file +var _0x8bec=['get','index','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','join','format','%s%s','logo','extname','originalname','post','single','file','diskStorage','logologin','addLogoLogin','root','server/files/images/logos/','preferred','addPreferred','put','isAuthenticated','update','util','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller'];(function(_0x4358f5,_0x5b1ac6){var _0x4d8104=function(_0x1d4aee){while(--_0x1d4aee){_0x4358f5['push'](_0x4358f5['shift']());}};_0x4d8104(++_0x5b1ac6);}(_0x8bec,0x67));var _0xc8be=function(_0x31ade5,_0x2035a6){_0x31ade5=_0x31ade5-0x0;var _0x396454=_0x8bec[_0x31ade5];return _0x396454;};'use strict';var multer=require('multer');var util=require(_0xc8be('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xc8be('0x1'));var interaction=require(_0xc8be('0x2'));var config=require(_0xc8be('0x3'));var controller=require(_0xc8be('0x4'));router[_0xc8be('0x5')]('/',auth['isAuthenticated'](),controller[_0xc8be('0x6')]);router['get'](_0xc8be('0x7'),controller[_0xc8be('0x8')]);router['get'](_0xc8be('0x9'),controller[_0xc8be('0xa')]);router['get'](_0xc8be('0xb'),controller[_0xc8be('0xc')]);router[_0xc8be('0x5')](_0xc8be('0xd'),controller[_0xc8be('0xe')]);router['get'](_0xc8be('0xf'),controller[_0xc8be('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5ddce2,_0xc2553,_0x33cf60){_0x33cf60(null,path[_0xc8be('0x11')](config['root'],'server/files/images/logos/'));},'filename':function(_0x5be822,_0x535081,_0x240b1d){_0x240b1d(null,util[_0xc8be('0x12')](_0xc8be('0x13'),_0xc8be('0x14'),path[_0xc8be('0x15')](_0x535081[_0xc8be('0x16')])));}})});router[_0xc8be('0x17')](_0xc8be('0x9'),upload[_0xc8be('0x18')](_0xc8be('0x19')),controller['addLogo']);var upload=multer({'storage':multer[_0xc8be('0x1a')]({'destination':function(_0x747e4f,_0x24c19e,_0x24ba70){_0x24ba70(null,path[_0xc8be('0x11')](config['root'],'server/files/images/logos/'));},'filename':function(_0xcd70c3,_0x3f013c,_0x5acc14){_0x5acc14(null,util[_0xc8be('0x12')](_0xc8be('0x13'),_0xc8be('0x1b'),path[_0xc8be('0x15')](_0x3f013c[_0xc8be('0x16')])));}})});router[_0xc8be('0x17')](_0xc8be('0xb'),upload[_0xc8be('0x18')](_0xc8be('0x19')),controller[_0xc8be('0x1c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x37611b,_0x27a123,_0x7de656){_0x7de656(null,path[_0xc8be('0x11')](config[_0xc8be('0x1d')],_0xc8be('0x1e')));},'filename':function(_0x169262,_0x2577fd,_0x3f89eb){_0x3f89eb(null,util[_0xc8be('0x12')](_0xc8be('0x13'),_0xc8be('0x1f'),path['extname'](_0x2577fd[_0xc8be('0x16')])));}})});router[_0xc8be('0x17')](_0xc8be('0xf'),upload[_0xc8be('0x18')](_0xc8be('0x19')),controller[_0xc8be('0x20')]);router[_0xc8be('0x21')](_0xc8be('0x7'),auth[_0xc8be('0x22')](),controller[_0xc8be('0x23')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index d3634d8..1964f1e 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 _0x063c=['min_mailbox','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','STRING','exports','INTEGER','min_internal'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x063c,0xba));var _0xc063=function(_0x338e6d,_0x4d3bc7){_0x338e6d=_0x338e6d-0x0;var _0x15099b=_0x063c[_0x338e6d];return _0x15099b;};'use strict';var Sequelize=require('sequelize');module[_0xc063('0x0')]={'min_internal':{'type':Sequelize[_0xc063('0x1')](0xb),'unique':_0xc063('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xc063('0x1')](0xb),'unique':_0xc063('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xc063('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0xc063('0x4')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0xc063('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xc063('0x6')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xc063('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xc063('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xc063('0x6')]},'turnaddr':{'type':Sequelize[_0xc063('0x6')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0xc063('0x6')]},'pageTitle':{'type':Sequelize[_0xc063('0x6')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xc063('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xc063('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xc063('0x6')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xc063('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xc063('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xc063('0x6')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0xc063('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xc063('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xc063('0x6')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xc063('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xc063('0x6')]},'allowedLoginAttempts':{'type':Sequelize[_0xc063('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xc063('0x1')],'defaultValue':0xa}}; \ No newline at end of file +var _0xe0c0=['INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','sequelize'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0xe0c0,0xa7));var _0x0e0c=function(_0x169295,_0x2fe770){_0x169295=_0x169295-0x0;var _0x51fc4d=_0xe0c0[_0x169295];return _0x51fc4d;};'use strict';var Sequelize=require(_0x0e0c('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0x0e0c('0x1')](0xb),'unique':_0x0e0c('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x0e0c('0x1')](0xb),'unique':_0x0e0c('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0e0c('0x4')],'defaultValue':_0x0e0c('0x5')},'logo':{'type':Sequelize[_0x0e0c('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0e0c('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x0e0c('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0e0c('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0e0c('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x0e0c('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x0e0c('0x4')]},'turnaddr':{'type':Sequelize[_0x0e0c('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x0e0c('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0e0c('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0e0c('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0e0c('0x4')],'defaultValue':_0x0e0c('0x7')},'enableEmailPreview':{'type':Sequelize[_0x0e0c('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x0e0c('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x0e0c('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0e0c('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0e0c('0x4')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0e0c('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x0e0c('0x4')]},'defaultPreferred':{'type':Sequelize[_0x0e0c('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0e0c('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0e0c('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0e0c('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 424cb61..da20119 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 _0xa9e0=['find','params','body','readFileSync','join','server/files/templates/stun.ejs','utf8','root','render','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','Reload','res_rtp_asterisk.so','addLogo','file','logo','filename','catch','addLogoLogin','loginLogo','getLogo','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','toLower','default_logo.png','upperFirst','custom','Sequelize','ValidationError','Logo\x20not\x20found','download','../../config/license/util','getLogoLogin','server/files/images/logos','default_loginLogo.png','default','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','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','../../config/license/hardware','../../config/logger','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','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','sendStatus','status','count','offset','limit','Content-Range','json','reject','save','update','then','destroy','end','stack','name','index','Setting','rawAttributes','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','show','keys','length'];(function(_0x24014d,_0x5e5e12){var _0x533b72=function(_0xa5611f){while(--_0xa5611f){_0x24014d['push'](_0x24014d['shift']());}};_0x533b72(++_0x5e5e12);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x0a9e('0x13'));var client=jayson[_0x0a9e('0x14')][_0x0a9e('0x15')]({'port':0x232a});function checkPasswordPattern(_0x26d672,_0x32d742,_0x69aeb7){if(_0x69aeb7){var _0x5db4b0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5db4b0[_0x0a9e('0x16')](_0x32d742)){return _0x26d672;}else{throw new Error(_0x0a9e('0x17'));}}else{return _0x26d672;}}function respondWithRpcPromise(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){return new BPromise(function(_0x52a03d,_0x22dccb){var _0x5d0880=_0x4d5611||client;return _0x5d0880[_0x0a9e('0x18')](_0x2b4227,_0x44dcfd)['then'](function(_0x16033c){logger[_0x0a9e('0x19')]('Setting,\x20%s,\x20%s',_0x281129,_0x0a9e('0x1a'));logger['debug'](_0x0a9e('0x1b'),_0x281129,_0x0a9e('0x1a'),JSON[_0x0a9e('0x1c')](_0x16033c));if(_0x16033c[_0x0a9e('0x1d')]){if(_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x1e')]===0x1f4){logger[_0x0a9e('0x1d')](_0x0a9e('0x1f'),_0x281129,_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x20')]);return _0x22dccb(_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x20')]);}logger['error'](_0x0a9e('0x1f'),_0x281129,_0x16033c[_0x0a9e('0x1d')]['message']);return _0x52a03d(_0x16033c[_0x0a9e('0x1d')]['message']);}else{logger['info'](_0x0a9e('0x1f'),_0x281129,_0x0a9e('0x1a'));_0x52a03d(_0x16033c[_0x0a9e('0x21')][_0x0a9e('0x20')]);}})['catch'](function(_0xfb6e48){logger[_0x0a9e('0x1d')](_0x0a9e('0x1f'),_0x281129,_0xfb6e48);_0x22dccb(_0xfb6e48);});});}function respondWithStatusCode(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0xcc;return function(_0x42ac8f){if(_0x42ac8f){return _0x4d00e6[_0x0a9e('0x22')](_0x370d86);}return _0x4d00e6['status'](_0x370d86)['end']();};}function respondWithResult(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xc8;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x23')](_0x3a8e58)['json'](_0x40c424);}};}function respondWithFilteredResult(_0x384319,_0x479bc4){return function(_0x45a1e7){if(_0x45a1e7){var _0x5bfb33=_0x45a1e7[_0x0a9e('0x24')],_0x1dc186=_0x479bc4[_0x0a9e('0x25')],_0x34dc65=_0x479bc4[_0x0a9e('0x25')]+_0x479bc4[_0x0a9e('0x26')],_0x25fba9;if(_0x34dc65>=_0x5bfb33){_0x34dc65=_0x5bfb33;_0x25fba9=0xc8;}else{_0x25fba9=0xce;}_0x384319[_0x0a9e('0x23')](_0x25fba9);return _0x384319['set'](_0x0a9e('0x27'),_0x1dc186+'-'+_0x34dc65+'/'+_0x5bfb33)[_0x0a9e('0x28')](_0x45a1e7);}return null;};}function patchUpdates(_0x2b1f27){return function(_0x2ec755){try{jsonpatch['apply'](_0x2ec755,_0x2b1f27,!![]);}catch(_0x15b200){return BPromise[_0x0a9e('0x29')](_0x15b200);}return _0x2ec755[_0x0a9e('0x2a')]();};}function saveUpdates(_0x824a4f,_0x58b06f){return function(_0x563b45){if(_0x563b45){return _0x563b45[_0x0a9e('0x2b')](_0x824a4f)[_0x0a9e('0x2c')](function(_0x1dbde2){return _0x1dbde2;});}return null;};}function removeEntity(_0x540530,_0x426950){return function(_0x5d1e0e){if(_0x5d1e0e){return _0x5d1e0e[_0x0a9e('0x2d')]()[_0x0a9e('0x2c')](function(){_0x540530[_0x0a9e('0x23')](0xcc)[_0x0a9e('0x2e')]();});}};}function handleEntityNotFound(_0x25ce3a,_0x5180f1){return function(_0x66c1d2){if(!_0x66c1d2){_0x25ce3a[_0x0a9e('0x22')](0x194);}return _0x66c1d2;};}function handleError(_0x40cb85,_0x2da5c0){_0x2da5c0=_0x2da5c0||0x1f4;return function(_0x2b45ea){logger[_0x0a9e('0x1d')](_0x2b45ea[_0x0a9e('0x2f')]);if(_0x2b45ea[_0x0a9e('0x30')]){delete _0x2b45ea['name'];}_0x40cb85[_0x0a9e('0x23')](_0x2da5c0)['send'](_0x2b45ea);};}exports[_0x0a9e('0x31')]=function(_0x14b13f,_0x2b7e7f){var _0x3f3d41={},_0x567193={},_0x191e91={'count':0x0,'rows':[]};var _0xd1836d=db[_0x0a9e('0x32')][_0x0a9e('0x33')];_0x567193['model']=_['keys'](_0xd1836d);_0x567193[_0x0a9e('0x34')]=_['keys'](_0x14b13f[_0x0a9e('0x34')]);_0x567193[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x567193[_0x0a9e('0x37')],_0x567193['query']);_0x3f3d41[_0x0a9e('0x38')]=_[_0x0a9e('0x36')](_0x567193[_0x0a9e('0x37')],qs['fields'](_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x3f3d41[_0x0a9e('0x38')]=_0x3f3d41['attributes']['length']?_0x3f3d41[_0x0a9e('0x38')]:_0x567193[_0x0a9e('0x37')];if(!_0x14b13f['query'][_0x0a9e('0x3a')](_0x0a9e('0x3b'))){_0x3f3d41[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x14b13f['query']['limit']);_0x3f3d41[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x14b13f['query'][_0x0a9e('0x25')]);}_0x3f3d41[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x14b13f['query'][_0x0a9e('0x3d')]);_0x3f3d41[_0x0a9e('0x3e')]=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3f')](_0x14b13f[_0x0a9e('0x34')],_0x567193[_0x0a9e('0x35')]));if(_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x40')]){_0x3f3d41[_0x0a9e('0x3e')]=_[_0x0a9e('0x41')](_0x3f3d41[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x42')](_0xd1836d,function(_0x1a7bce){if(_0x1a7bce[_0x0a9e('0x43')][_0x0a9e('0x44')]!=='VIRTUAL'){var _0x52628e={};_0x52628e[_0x1a7bce[_0x0a9e('0x45')]]={'$like':'%'+_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x40')]+'%'};return _0x52628e;}})});}_0x3f3d41=_[_0x0a9e('0x41')]({},_0x3f3d41,_0x14b13f[_0x0a9e('0x46')]);var _0xc9a702={'where':_0x3f3d41[_0x0a9e('0x3e')]};return db[_0x0a9e('0x32')][_0x0a9e('0x24')](_0xc9a702)[_0x0a9e('0x2c')](function(_0x2c2cb0){_0x191e91[_0x0a9e('0x24')]=_0x2c2cb0;if(_0x14b13f['query'][_0x0a9e('0x47')]){_0x3f3d41[_0x0a9e('0x48')]=[{'all':!![]}];}return db[_0x0a9e('0x32')][_0x0a9e('0x49')](_0x3f3d41);})[_0x0a9e('0x2c')](function(_0xbe9d19){_0x191e91[_0x0a9e('0x4a')]=_0xbe9d19;return _0x191e91;})[_0x0a9e('0x2c')](respondWithFilteredResult(_0x2b7e7f,_0x3f3d41))['catch'](handleError(_0x2b7e7f,null));};exports[_0x0a9e('0x4b')]=function(_0x48fd45,_0x473dc8){var _0x476688={'raw':![],'where':{'id':_0x48fd45['params']['id']}},_0x8d6dd1={};_0x8d6dd1[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x32')][_0x0a9e('0x33')]);_0x8d6dd1[_0x0a9e('0x34')]=_[_0x0a9e('0x4c')](_0x48fd45[_0x0a9e('0x34')]);_0x8d6dd1['filters']=_[_0x0a9e('0x36')](_0x8d6dd1[_0x0a9e('0x37')],_0x8d6dd1[_0x0a9e('0x34')]);_0x476688[_0x0a9e('0x38')]=_[_0x0a9e('0x36')](_0x8d6dd1[_0x0a9e('0x37')],qs[_0x0a9e('0x39')](_0x48fd45[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x476688['attributes']=_0x476688[_0x0a9e('0x38')][_0x0a9e('0x4d')]?_0x476688['attributes']:_0x8d6dd1['model'];if(_0x48fd45['query'][_0x0a9e('0x47')]){_0x476688[_0x0a9e('0x48')]=[{'all':!![]}];}_0x476688=_[_0x0a9e('0x41')]({},_0x476688,_0x48fd45[_0x0a9e('0x46')]);return db[_0x0a9e('0x32')][_0x0a9e('0x4e')](_0x476688)[_0x0a9e('0x2c')](handleEntityNotFound(_0x473dc8,null))[_0x0a9e('0x2c')](respondWithResult(_0x473dc8,null))['catch'](handleError(_0x473dc8,null));};exports['update']=function(_0x53975a,_0x39d77d,_0x204173){var _0x14d602;return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x53975a[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x39d77d,null))['then'](saveUpdates(_0x53975a[_0x0a9e('0x50')],null))['then'](function(_0x443e72){if(_0x443e72){_0x14d602=_0x443e72['get']({'plain':!![]});var _0x2e5e62=fs[_0x0a9e('0x51')](path[_0x0a9e('0x52')](config['root'],_0x0a9e('0x53')),_0x0a9e('0x54'));var _0x508b47=ejs['render'](_0x2e5e62,_0x14d602);var _0x128aa6=fs[_0x0a9e('0x51')](path['join'](config[_0x0a9e('0x55')],'server/files/templates/turn.ejs'),_0x0a9e('0x54'));var _0x523cd2=ejs[_0x0a9e('0x56')](_0x128aa6,_0x14d602);fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x508b47);fs['writeFileSync'](_0x0a9e('0x57'),_0x523cd2);return respondWithRpcPromise('Reload',_0x0a9e('0x2b'),{'module':_0x0a9e('0x58')});}})[_0x0a9e('0x2c')](function(){return respondWithRpcPromise(_0x0a9e('0x59'),_0x0a9e('0x2b'),{'module':_0x0a9e('0x5a')});})[_0x0a9e('0x2c')](function(){return _0x14d602||null;})[_0x0a9e('0x2c')](respondWithResult(_0x39d77d,null))['catch'](handleError(_0x39d77d,null));};exports[_0x0a9e('0x5b')]=function(_0x121cef,_0x2642bb,_0x30c491){if(_0x121cef[_0x0a9e('0x5c')]&&_0x121cef[_0x0a9e('0x5c')]['filename']){_0x121cef[_0x0a9e('0x50')][_0x0a9e('0x5d')]=_0x121cef['file'][_0x0a9e('0x5e')];}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x121cef['params']['id']}})['then'](handleEntityNotFound(_0x2642bb,null))['then'](saveUpdates(_0x121cef[_0x0a9e('0x50')],null))['then'](respondWithResult(_0x2642bb,null))[_0x0a9e('0x5f')](handleError(_0x2642bb,null));};exports[_0x0a9e('0x60')]=function(_0x261adb,_0x7be420,_0x1cca9f){if(_0x261adb[_0x0a9e('0x5c')]&&_0x261adb['file'][_0x0a9e('0x5e')]){_0x261adb['body'][_0x0a9e('0x61')]=_0x261adb[_0x0a9e('0x5c')][_0x0a9e('0x5e')];}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x261adb[_0x0a9e('0x4f')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x7be420,null))[_0x0a9e('0x2c')](saveUpdates(_0x261adb['body'],null))[_0x0a9e('0x2c')](respondWithResult(_0x7be420,null))[_0x0a9e('0x5f')](handleError(_0x7be420,null));};var utilLicense=require('../../config/license/util');exports[_0x0a9e('0x62')]=function(_0x17e88c,_0x88dcbf,_0x409b29){var _0x401837='server/files/images/logos';var _0x176840={'custom':![]};return utilLicense[_0x0a9e('0x63')]()[_0x0a9e('0x2c')](function(_0x47bb43){if(_0x47bb43){_0x176840=_0x47bb43;}return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x17e88c['params']['id']},'attributes':[_0x0a9e('0x5d'),_0x0a9e('0x61'),_0x0a9e('0x64'),_0x0a9e('0x65'),_0x0a9e('0x66'),_0x0a9e('0x67')],'raw':!![]});})[_0x0a9e('0x2c')](handleEntityNotFound(_0x88dcbf,null))[_0x0a9e('0x2c')](function(_0x2d7205){if(_0x2d7205){var _0x1cc4f3=_0x2d7205[_0x0a9e('0x5d')]&&fs[_0x0a9e('0x68')](path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_[_0x0a9e('0x69')](_0x2d7205[_0x0a9e('0x5d')])))?path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_['toLower'](_0x2d7205[_0x0a9e('0x5d')])):path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_['toLower'](_0x0a9e('0x6a')));var _0x30944e='default'+_[_0x0a9e('0x6b')](_0x0a9e('0x5d'));if(_0x2d7205[_0x30944e]||!_0x176840[_0x0a9e('0x6c')]){_0x1cc4f3=path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_['toLower']('default_logo.png'));}if(!fs['existsSync'](_0x1cc4f3)){throw new db[(_0x0a9e('0x6d'))][(_0x0a9e('0x6e'))](_0x0a9e('0x6f'));}return _0x88dcbf[_0x0a9e('0x70')](_0x1cc4f3);}})[_0x0a9e('0x5f')](handleError(_0x88dcbf,null));};var utilLicense=require(_0x0a9e('0x71'));exports[_0x0a9e('0x72')]=function(_0x1a0677,_0x5512d1,_0x235f8f){var _0xcbc8b2=_0x0a9e('0x73');var _0x4a4fc7={'custom':![]};return utilLicense[_0x0a9e('0x63')]()['then'](function(_0x4437ff){if(_0x4437ff){_0x4a4fc7=_0x4437ff;}return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x1a0677[_0x0a9e('0x4f')]['id']},'attributes':[_0x0a9e('0x5d'),_0x0a9e('0x61'),_0x0a9e('0x64'),'defaultLogo',_0x0a9e('0x66'),_0x0a9e('0x67')],'raw':!![]});})[_0x0a9e('0x2c')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x2c')](function(_0x5b7fc3){if(_0x5b7fc3){var _0x109ccb=_0x5b7fc3[_0x0a9e('0x61')]&&fs[_0x0a9e('0x68')](path[_0x0a9e('0x52')](config['root'],_0xcbc8b2,_[_0x0a9e('0x69')](_0x5b7fc3[_0x0a9e('0x61')])))?path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0xcbc8b2,_[_0x0a9e('0x69')](_0x5b7fc3[_0x0a9e('0x61')])):path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0xcbc8b2,_[_0x0a9e('0x69')](_0x0a9e('0x74')));var _0xc4c230=_0x0a9e('0x75')+_[_0x0a9e('0x6b')](_0x0a9e('0x61'));if(_0x5b7fc3[_0xc4c230]||!_0x4a4fc7['custom']){_0x109ccb=path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0xcbc8b2,_[_0x0a9e('0x69')]('default_loginLogo.png'));}if(!fs[_0x0a9e('0x68')](_0x109ccb)){throw new db[(_0x0a9e('0x6d'))][(_0x0a9e('0x6e'))](_0x0a9e('0x6f'));}return _0x5512d1['download'](_0x109ccb);}})['catch'](handleError(_0x5512d1,null));};exports[_0x0a9e('0x76')]=function(_0x2bbdb5,_0x4c54fa){return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x2bbdb5[_0x0a9e('0x4f')]['id']},'attributes':[_0x0a9e('0x77')]})['then'](respondWithResult(_0x4c54fa,null))[_0x0a9e('0x5f')](handleError(_0x4c54fa,null));};exports[_0x0a9e('0x78')]=function(_0x2d2286,_0x42b959,_0x3755fe){if(_0x2d2286[_0x0a9e('0x5c')]&&_0x2d2286[_0x0a9e('0x5c')]['filename']){_0x2d2286[_0x0a9e('0x50')][_0x0a9e('0x64')]=_0x2d2286[_0x0a9e('0x5c')][_0x0a9e('0x5e')];}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x2d2286[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x42b959,null))[_0x0a9e('0x2c')](saveUpdates(_0x2d2286['body'],null))[_0x0a9e('0x2c')](respondWithResult(_0x42b959,null))[_0x0a9e('0x5f')](handleError(_0x42b959,null));};var utilLicense=require(_0x0a9e('0x71'));exports[_0x0a9e('0x79')]=function(_0x5af453,_0x51ccd7,_0x353384){var _0x2b9c01=_0x0a9e('0x73');var _0x5ac73d={'custom':![]};return utilLicense[_0x0a9e('0x63')]()[_0x0a9e('0x2c')](function(_0x524e38){if(_0x524e38){_0x5ac73d=_0x524e38;}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x5af453['params']['id']},'attributes':['logo','loginLogo',_0x0a9e('0x64'),_0x0a9e('0x65'),_0x0a9e('0x66'),_0x0a9e('0x67')],'raw':!![]});})[_0x0a9e('0x2c')](handleEntityNotFound(_0x51ccd7,null))[_0x0a9e('0x2c')](function(_0x5a8854){if(_0x5a8854){var _0x5fd5db=_0x5a8854['preferred']&&fs[_0x0a9e('0x68')](path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x2b9c01,_[_0x0a9e('0x69')](_0x5a8854['preferred'])))?path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x2b9c01,_[_0x0a9e('0x69')](_0x5a8854['preferred'])):path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x2b9c01,_[_0x0a9e('0x69')](_0x0a9e('0x7a')));var _0x255e49=_0x0a9e('0x75')+_[_0x0a9e('0x6b')](_0x0a9e('0x64'));if(_0x5a8854[_0x255e49]||!_0x5ac73d['custom']||!_0x5ac73d[_0x0a9e('0x64')]){_0x5fd5db=path[_0x0a9e('0x52')](config['root'],_0x2b9c01,_[_0x0a9e('0x69')](_0x0a9e('0x7a')));}if(!fs[_0x0a9e('0x68')](_0x5fd5db)){throw new db['Sequelize'][(_0x0a9e('0x6e'))]('Logo\x20not\x20found');}return _0x51ccd7[_0x0a9e('0x70')](_0x5fd5db);}})[_0x0a9e('0x5f')](handleError(_0x51ccd7,null));}; \ No newline at end of file +var _0xa9e0=['find','params','body','readFileSync','join','server/files/templates/stun.ejs','utf8','root','render','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','Reload','res_rtp_asterisk.so','addLogo','file','logo','filename','catch','addLogoLogin','loginLogo','getLogo','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','toLower','default_logo.png','upperFirst','custom','Sequelize','ValidationError','Logo\x20not\x20found','download','../../config/license/util','getLogoLogin','server/files/images/logos','default_loginLogo.png','default','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','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','../../config/license/hardware','../../config/logger','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','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','sendStatus','status','count','offset','limit','Content-Range','json','reject','save','update','then','destroy','end','stack','name','index','Setting','rawAttributes','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','show','keys','length'];(function(_0x23bc95,_0x40d35a){var _0x34001b=function(_0x2c0e22){while(--_0x2c0e22){_0x23bc95['push'](_0x23bc95['shift']());}};_0x34001b(++_0x40d35a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x0a9e('0x13'));var client=jayson[_0x0a9e('0x14')][_0x0a9e('0x15')]({'port':0x232a});function checkPasswordPattern(_0x26d672,_0x32d742,_0x69aeb7){if(_0x69aeb7){var _0x5db4b0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5db4b0[_0x0a9e('0x16')](_0x32d742)){return _0x26d672;}else{throw new Error(_0x0a9e('0x17'));}}else{return _0x26d672;}}function respondWithRpcPromise(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){return new BPromise(function(_0x52a03d,_0x22dccb){var _0x5d0880=_0x4d5611||client;return _0x5d0880[_0x0a9e('0x18')](_0x2b4227,_0x44dcfd)['then'](function(_0x16033c){logger[_0x0a9e('0x19')]('Setting,\x20%s,\x20%s',_0x281129,_0x0a9e('0x1a'));logger['debug'](_0x0a9e('0x1b'),_0x281129,_0x0a9e('0x1a'),JSON[_0x0a9e('0x1c')](_0x16033c));if(_0x16033c[_0x0a9e('0x1d')]){if(_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x1e')]===0x1f4){logger[_0x0a9e('0x1d')](_0x0a9e('0x1f'),_0x281129,_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x20')]);return _0x22dccb(_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x20')]);}logger['error'](_0x0a9e('0x1f'),_0x281129,_0x16033c[_0x0a9e('0x1d')]['message']);return _0x52a03d(_0x16033c[_0x0a9e('0x1d')]['message']);}else{logger['info'](_0x0a9e('0x1f'),_0x281129,_0x0a9e('0x1a'));_0x52a03d(_0x16033c[_0x0a9e('0x21')][_0x0a9e('0x20')]);}})['catch'](function(_0xfb6e48){logger[_0x0a9e('0x1d')](_0x0a9e('0x1f'),_0x281129,_0xfb6e48);_0x22dccb(_0xfb6e48);});});}function respondWithStatusCode(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0xcc;return function(_0x42ac8f){if(_0x42ac8f){return _0x4d00e6[_0x0a9e('0x22')](_0x370d86);}return _0x4d00e6['status'](_0x370d86)['end']();};}function respondWithResult(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xc8;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x23')](_0x3a8e58)['json'](_0x40c424);}};}function respondWithFilteredResult(_0x384319,_0x479bc4){return function(_0x45a1e7){if(_0x45a1e7){var _0x5bfb33=_0x45a1e7[_0x0a9e('0x24')],_0x1dc186=_0x479bc4[_0x0a9e('0x25')],_0x34dc65=_0x479bc4[_0x0a9e('0x25')]+_0x479bc4[_0x0a9e('0x26')],_0x25fba9;if(_0x34dc65>=_0x5bfb33){_0x34dc65=_0x5bfb33;_0x25fba9=0xc8;}else{_0x25fba9=0xce;}_0x384319[_0x0a9e('0x23')](_0x25fba9);return _0x384319['set'](_0x0a9e('0x27'),_0x1dc186+'-'+_0x34dc65+'/'+_0x5bfb33)[_0x0a9e('0x28')](_0x45a1e7);}return null;};}function patchUpdates(_0x2b1f27){return function(_0x2ec755){try{jsonpatch['apply'](_0x2ec755,_0x2b1f27,!![]);}catch(_0x15b200){return BPromise[_0x0a9e('0x29')](_0x15b200);}return _0x2ec755[_0x0a9e('0x2a')]();};}function saveUpdates(_0x824a4f,_0x58b06f){return function(_0x563b45){if(_0x563b45){return _0x563b45[_0x0a9e('0x2b')](_0x824a4f)[_0x0a9e('0x2c')](function(_0x1dbde2){return _0x1dbde2;});}return null;};}function removeEntity(_0x540530,_0x426950){return function(_0x5d1e0e){if(_0x5d1e0e){return _0x5d1e0e[_0x0a9e('0x2d')]()[_0x0a9e('0x2c')](function(){_0x540530[_0x0a9e('0x23')](0xcc)[_0x0a9e('0x2e')]();});}};}function handleEntityNotFound(_0x25ce3a,_0x5180f1){return function(_0x66c1d2){if(!_0x66c1d2){_0x25ce3a[_0x0a9e('0x22')](0x194);}return _0x66c1d2;};}function handleError(_0x40cb85,_0x2da5c0){_0x2da5c0=_0x2da5c0||0x1f4;return function(_0x2b45ea){logger[_0x0a9e('0x1d')](_0x2b45ea[_0x0a9e('0x2f')]);if(_0x2b45ea[_0x0a9e('0x30')]){delete _0x2b45ea['name'];}_0x40cb85[_0x0a9e('0x23')](_0x2da5c0)['send'](_0x2b45ea);};}exports[_0x0a9e('0x31')]=function(_0x14b13f,_0x2b7e7f){var _0x3f3d41={},_0x567193={},_0x191e91={'count':0x0,'rows':[]};var _0xd1836d=db[_0x0a9e('0x32')][_0x0a9e('0x33')];_0x567193['model']=_['keys'](_0xd1836d);_0x567193[_0x0a9e('0x34')]=_['keys'](_0x14b13f[_0x0a9e('0x34')]);_0x567193[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x567193[_0x0a9e('0x37')],_0x567193['query']);_0x3f3d41[_0x0a9e('0x38')]=_[_0x0a9e('0x36')](_0x567193[_0x0a9e('0x37')],qs['fields'](_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x3f3d41[_0x0a9e('0x38')]=_0x3f3d41['attributes']['length']?_0x3f3d41[_0x0a9e('0x38')]:_0x567193[_0x0a9e('0x37')];if(!_0x14b13f['query'][_0x0a9e('0x3a')](_0x0a9e('0x3b'))){_0x3f3d41[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x14b13f['query']['limit']);_0x3f3d41[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x14b13f['query'][_0x0a9e('0x25')]);}_0x3f3d41[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x14b13f['query'][_0x0a9e('0x3d')]);_0x3f3d41[_0x0a9e('0x3e')]=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3f')](_0x14b13f[_0x0a9e('0x34')],_0x567193[_0x0a9e('0x35')]));if(_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x40')]){_0x3f3d41[_0x0a9e('0x3e')]=_[_0x0a9e('0x41')](_0x3f3d41[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x42')](_0xd1836d,function(_0x1a7bce){if(_0x1a7bce[_0x0a9e('0x43')][_0x0a9e('0x44')]!=='VIRTUAL'){var _0x52628e={};_0x52628e[_0x1a7bce[_0x0a9e('0x45')]]={'$like':'%'+_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x40')]+'%'};return _0x52628e;}})});}_0x3f3d41=_[_0x0a9e('0x41')]({},_0x3f3d41,_0x14b13f[_0x0a9e('0x46')]);var _0xc9a702={'where':_0x3f3d41[_0x0a9e('0x3e')]};return db[_0x0a9e('0x32')][_0x0a9e('0x24')](_0xc9a702)[_0x0a9e('0x2c')](function(_0x2c2cb0){_0x191e91[_0x0a9e('0x24')]=_0x2c2cb0;if(_0x14b13f['query'][_0x0a9e('0x47')]){_0x3f3d41[_0x0a9e('0x48')]=[{'all':!![]}];}return db[_0x0a9e('0x32')][_0x0a9e('0x49')](_0x3f3d41);})[_0x0a9e('0x2c')](function(_0xbe9d19){_0x191e91[_0x0a9e('0x4a')]=_0xbe9d19;return _0x191e91;})[_0x0a9e('0x2c')](respondWithFilteredResult(_0x2b7e7f,_0x3f3d41))['catch'](handleError(_0x2b7e7f,null));};exports[_0x0a9e('0x4b')]=function(_0x48fd45,_0x473dc8){var _0x476688={'raw':![],'where':{'id':_0x48fd45['params']['id']}},_0x8d6dd1={};_0x8d6dd1[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x32')][_0x0a9e('0x33')]);_0x8d6dd1[_0x0a9e('0x34')]=_[_0x0a9e('0x4c')](_0x48fd45[_0x0a9e('0x34')]);_0x8d6dd1['filters']=_[_0x0a9e('0x36')](_0x8d6dd1[_0x0a9e('0x37')],_0x8d6dd1[_0x0a9e('0x34')]);_0x476688[_0x0a9e('0x38')]=_[_0x0a9e('0x36')](_0x8d6dd1[_0x0a9e('0x37')],qs[_0x0a9e('0x39')](_0x48fd45[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x476688['attributes']=_0x476688[_0x0a9e('0x38')][_0x0a9e('0x4d')]?_0x476688['attributes']:_0x8d6dd1['model'];if(_0x48fd45['query'][_0x0a9e('0x47')]){_0x476688[_0x0a9e('0x48')]=[{'all':!![]}];}_0x476688=_[_0x0a9e('0x41')]({},_0x476688,_0x48fd45[_0x0a9e('0x46')]);return db[_0x0a9e('0x32')][_0x0a9e('0x4e')](_0x476688)[_0x0a9e('0x2c')](handleEntityNotFound(_0x473dc8,null))[_0x0a9e('0x2c')](respondWithResult(_0x473dc8,null))['catch'](handleError(_0x473dc8,null));};exports['update']=function(_0x53975a,_0x39d77d,_0x204173){var _0x14d602;return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x53975a[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x39d77d,null))['then'](saveUpdates(_0x53975a[_0x0a9e('0x50')],null))['then'](function(_0x443e72){if(_0x443e72){_0x14d602=_0x443e72['get']({'plain':!![]});var _0x2e5e62=fs[_0x0a9e('0x51')](path[_0x0a9e('0x52')](config['root'],_0x0a9e('0x53')),_0x0a9e('0x54'));var _0x508b47=ejs['render'](_0x2e5e62,_0x14d602);var _0x128aa6=fs[_0x0a9e('0x51')](path['join'](config[_0x0a9e('0x55')],'server/files/templates/turn.ejs'),_0x0a9e('0x54'));var _0x523cd2=ejs[_0x0a9e('0x56')](_0x128aa6,_0x14d602);fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x508b47);fs['writeFileSync'](_0x0a9e('0x57'),_0x523cd2);return respondWithRpcPromise('Reload',_0x0a9e('0x2b'),{'module':_0x0a9e('0x58')});}})[_0x0a9e('0x2c')](function(){return respondWithRpcPromise(_0x0a9e('0x59'),_0x0a9e('0x2b'),{'module':_0x0a9e('0x5a')});})[_0x0a9e('0x2c')](function(){return _0x14d602||null;})[_0x0a9e('0x2c')](respondWithResult(_0x39d77d,null))['catch'](handleError(_0x39d77d,null));};exports[_0x0a9e('0x5b')]=function(_0x121cef,_0x2642bb,_0x30c491){if(_0x121cef[_0x0a9e('0x5c')]&&_0x121cef[_0x0a9e('0x5c')]['filename']){_0x121cef[_0x0a9e('0x50')][_0x0a9e('0x5d')]=_0x121cef['file'][_0x0a9e('0x5e')];}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x121cef['params']['id']}})['then'](handleEntityNotFound(_0x2642bb,null))['then'](saveUpdates(_0x121cef[_0x0a9e('0x50')],null))['then'](respondWithResult(_0x2642bb,null))[_0x0a9e('0x5f')](handleError(_0x2642bb,null));};exports[_0x0a9e('0x60')]=function(_0x261adb,_0x7be420,_0x1cca9f){if(_0x261adb[_0x0a9e('0x5c')]&&_0x261adb['file'][_0x0a9e('0x5e')]){_0x261adb['body'][_0x0a9e('0x61')]=_0x261adb[_0x0a9e('0x5c')][_0x0a9e('0x5e')];}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x261adb[_0x0a9e('0x4f')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x7be420,null))[_0x0a9e('0x2c')](saveUpdates(_0x261adb['body'],null))[_0x0a9e('0x2c')](respondWithResult(_0x7be420,null))[_0x0a9e('0x5f')](handleError(_0x7be420,null));};var utilLicense=require('../../config/license/util');exports[_0x0a9e('0x62')]=function(_0x17e88c,_0x88dcbf,_0x409b29){var _0x401837='server/files/images/logos';var _0x176840={'custom':![]};return utilLicense[_0x0a9e('0x63')]()[_0x0a9e('0x2c')](function(_0x47bb43){if(_0x47bb43){_0x176840=_0x47bb43;}return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x17e88c['params']['id']},'attributes':[_0x0a9e('0x5d'),_0x0a9e('0x61'),_0x0a9e('0x64'),_0x0a9e('0x65'),_0x0a9e('0x66'),_0x0a9e('0x67')],'raw':!![]});})[_0x0a9e('0x2c')](handleEntityNotFound(_0x88dcbf,null))[_0x0a9e('0x2c')](function(_0x2d7205){if(_0x2d7205){var _0x1cc4f3=_0x2d7205[_0x0a9e('0x5d')]&&fs[_0x0a9e('0x68')](path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_[_0x0a9e('0x69')](_0x2d7205[_0x0a9e('0x5d')])))?path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_['toLower'](_0x2d7205[_0x0a9e('0x5d')])):path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_['toLower'](_0x0a9e('0x6a')));var _0x30944e='default'+_[_0x0a9e('0x6b')](_0x0a9e('0x5d'));if(_0x2d7205[_0x30944e]||!_0x176840[_0x0a9e('0x6c')]){_0x1cc4f3=path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_['toLower']('default_logo.png'));}if(!fs['existsSync'](_0x1cc4f3)){throw new db[(_0x0a9e('0x6d'))][(_0x0a9e('0x6e'))](_0x0a9e('0x6f'));}return _0x88dcbf[_0x0a9e('0x70')](_0x1cc4f3);}})[_0x0a9e('0x5f')](handleError(_0x88dcbf,null));};var utilLicense=require(_0x0a9e('0x71'));exports[_0x0a9e('0x72')]=function(_0x1a0677,_0x5512d1,_0x235f8f){var _0xcbc8b2=_0x0a9e('0x73');var _0x4a4fc7={'custom':![]};return utilLicense[_0x0a9e('0x63')]()['then'](function(_0x4437ff){if(_0x4437ff){_0x4a4fc7=_0x4437ff;}return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x1a0677[_0x0a9e('0x4f')]['id']},'attributes':[_0x0a9e('0x5d'),_0x0a9e('0x61'),_0x0a9e('0x64'),'defaultLogo',_0x0a9e('0x66'),_0x0a9e('0x67')],'raw':!![]});})[_0x0a9e('0x2c')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x2c')](function(_0x5b7fc3){if(_0x5b7fc3){var _0x109ccb=_0x5b7fc3[_0x0a9e('0x61')]&&fs[_0x0a9e('0x68')](path[_0x0a9e('0x52')](config['root'],_0xcbc8b2,_[_0x0a9e('0x69')](_0x5b7fc3[_0x0a9e('0x61')])))?path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0xcbc8b2,_[_0x0a9e('0x69')](_0x5b7fc3[_0x0a9e('0x61')])):path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0xcbc8b2,_[_0x0a9e('0x69')](_0x0a9e('0x74')));var _0xc4c230=_0x0a9e('0x75')+_[_0x0a9e('0x6b')](_0x0a9e('0x61'));if(_0x5b7fc3[_0xc4c230]||!_0x4a4fc7['custom']){_0x109ccb=path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0xcbc8b2,_[_0x0a9e('0x69')]('default_loginLogo.png'));}if(!fs[_0x0a9e('0x68')](_0x109ccb)){throw new db[(_0x0a9e('0x6d'))][(_0x0a9e('0x6e'))](_0x0a9e('0x6f'));}return _0x5512d1['download'](_0x109ccb);}})['catch'](handleError(_0x5512d1,null));};exports[_0x0a9e('0x76')]=function(_0x2bbdb5,_0x4c54fa){return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x2bbdb5[_0x0a9e('0x4f')]['id']},'attributes':[_0x0a9e('0x77')]})['then'](respondWithResult(_0x4c54fa,null))[_0x0a9e('0x5f')](handleError(_0x4c54fa,null));};exports[_0x0a9e('0x78')]=function(_0x2d2286,_0x42b959,_0x3755fe){if(_0x2d2286[_0x0a9e('0x5c')]&&_0x2d2286[_0x0a9e('0x5c')]['filename']){_0x2d2286[_0x0a9e('0x50')][_0x0a9e('0x64')]=_0x2d2286[_0x0a9e('0x5c')][_0x0a9e('0x5e')];}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x2d2286[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x42b959,null))[_0x0a9e('0x2c')](saveUpdates(_0x2d2286['body'],null))[_0x0a9e('0x2c')](respondWithResult(_0x42b959,null))[_0x0a9e('0x5f')](handleError(_0x42b959,null));};var utilLicense=require(_0x0a9e('0x71'));exports[_0x0a9e('0x79')]=function(_0x5af453,_0x51ccd7,_0x353384){var _0x2b9c01=_0x0a9e('0x73');var _0x5ac73d={'custom':![]};return utilLicense[_0x0a9e('0x63')]()[_0x0a9e('0x2c')](function(_0x524e38){if(_0x524e38){_0x5ac73d=_0x524e38;}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x5af453['params']['id']},'attributes':['logo','loginLogo',_0x0a9e('0x64'),_0x0a9e('0x65'),_0x0a9e('0x66'),_0x0a9e('0x67')],'raw':!![]});})[_0x0a9e('0x2c')](handleEntityNotFound(_0x51ccd7,null))[_0x0a9e('0x2c')](function(_0x5a8854){if(_0x5a8854){var _0x5fd5db=_0x5a8854['preferred']&&fs[_0x0a9e('0x68')](path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x2b9c01,_[_0x0a9e('0x69')](_0x5a8854['preferred'])))?path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x2b9c01,_[_0x0a9e('0x69')](_0x5a8854['preferred'])):path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x2b9c01,_[_0x0a9e('0x69')](_0x0a9e('0x7a')));var _0x255e49=_0x0a9e('0x75')+_[_0x0a9e('0x6b')](_0x0a9e('0x64'));if(_0x5a8854[_0x255e49]||!_0x5ac73d['custom']||!_0x5ac73d[_0x0a9e('0x64')]){_0x5fd5db=path[_0x0a9e('0x52')](config['root'],_0x2b9c01,_[_0x0a9e('0x69')](_0x0a9e('0x7a')));}if(!fs[_0x0a9e('0x68')](_0x5fd5db)){throw new db['Sequelize'][(_0x0a9e('0x6e'))]('Logo\x20not\x20found');}return _0x51ccd7[_0x0a9e('0x70')](_0x5fd5db);}})[_0x0a9e('0x5f')](handleError(_0x51ccd7,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index d70705b..0c71435 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 _0x4168=['../../config/logger','bluebird','request-promise','./setting.attributes','exports','Setting','settings','util'];(function(_0x2edd9b,_0x4fedbe){var _0x5959d7=function(_0x59fd9d){while(--_0x59fd9d){_0x2edd9b['push'](_0x2edd9b['shift']());}};_0x5959d7(++_0x4fedbe);}(_0x4168,0x1ef));var _0x8416=function(_0x2d302e,_0x57274a){_0x2d302e=_0x2d302e-0x0;var _0x11c65c=_0x4168[_0x2d302e];return _0x11c65c;};'use strict';var _=require('lodash');var util=require(_0x8416('0x0'));var logger=require(_0x8416('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8416('0x2'));var rp=require(_0x8416('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8416('0x4'));module[_0x8416('0x5')]=function(_0x18fc0c,_0x464deb){return _0x18fc0c['define'](_0x8416('0x6'),attributes,{'tableName':_0x8416('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2bd0=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Setting','lodash'];(function(_0x5bff0,_0x20716d){var _0x3ead2e=function(_0x14f592){while(--_0x14f592){_0x5bff0['push'](_0x5bff0['shift']());}};_0x3ead2e(++_0x20716d);}(_0x2bd0,0x103));var _0x02bd=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x2bd0[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x02bd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x02bd('0x1'));var moment=require('moment');var BPromise=require(_0x02bd('0x2'));var rp=require(_0x02bd('0x3'));var fs=require('fs');var path=require(_0x02bd('0x4'));var rimraf=require(_0x02bd('0x5'));var config=require(_0x02bd('0x6'));var attributes=require('./setting.attributes');module[_0x02bd('0x7')]=function(_0x327987,_0x3b7586){return _0x327987[_0x02bd('0x8')](_0x02bd('0x9'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index a7b9be0..7063386 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 _0x68fb=['request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s'];(function(_0x4f84fe,_0x4e1447){var _0x5a4239=function(_0x4dadb0){while(--_0x4dadb0){_0x4f84fe['push'](_0x4f84fe['shift']());}};_0x5a4239(++_0x4e1447);}(_0x68fb,0xd9));var _0xb68f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x68fb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb68f('0x0'));var util=require(_0xb68f('0x1'));var moment=require(_0xb68f('0x2'));var BPromise=require(_0xb68f('0x3'));var rs=require(_0xb68f('0x4'));var fs=require('fs');var Redis=require(_0xb68f('0x5'));var db=require(_0xb68f('0x6'))['db'];var utils=require(_0xb68f('0x7'));var logger=require(_0xb68f('0x8'))(_0xb68f('0x9'));var config=require('../../config/environment');var jayson=require(_0xb68f('0xa'));var client=jayson[_0xb68f('0xb')][_0xb68f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x404329,_0x3e06b1,_0x156dfb){return new BPromise(function(_0x34290f,_0x2d6de8){return client[_0xb68f('0xd')](_0x404329,_0x156dfb)[_0xb68f('0xe')](function(_0xef68){logger[_0xb68f('0xf')](_0xb68f('0x10'),_0x3e06b1,_0xb68f('0x11'));logger[_0xb68f('0x12')](_0xb68f('0x13'),_0x3e06b1,_0xb68f('0x11'),JSON[_0xb68f('0x14')](_0xef68));if(_0xef68[_0xb68f('0x15')]){if(_0xef68[_0xb68f('0x15')][_0xb68f('0x16')]===0x1f4){logger[_0xb68f('0x15')]('Setting,\x20%s,\x20%s',_0x3e06b1,_0xef68['error']['message']);return _0x2d6de8(_0xef68[_0xb68f('0x15')][_0xb68f('0x17')]);}logger[_0xb68f('0x15')](_0xb68f('0x10'),_0x3e06b1,_0xef68[_0xb68f('0x15')][_0xb68f('0x17')]);return _0x34290f(_0xef68[_0xb68f('0x15')]['message']);}else{logger[_0xb68f('0xf')]('Setting,\x20%s,\x20%s',_0x3e06b1,_0xb68f('0x11'));_0x34290f(_0xef68[_0xb68f('0x18')][_0xb68f('0x17')]);}})[_0xb68f('0x19')](function(_0x331d78){logger[_0xb68f('0x15')](_0xb68f('0x10'),_0x3e06b1,_0x331d78);_0x2d6de8(_0x331d78);});});} \ No newline at end of file +var _0x3426=['request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s'];(function(_0x26a692,_0xc41b70){var _0x2a4c18=function(_0x270099){while(--_0x270099){_0x26a692['push'](_0x26a692['shift']());}};_0x2a4c18(++_0xc41b70);}(_0x3426,0x187));var _0x6342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3426[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6342('0x0'));var util=require(_0x6342('0x1'));var moment=require(_0x6342('0x2'));var BPromise=require(_0x6342('0x3'));var rs=require(_0x6342('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6342('0x5'))['db'];var utils=require(_0x6342('0x6'));var logger=require(_0x6342('0x7'))(_0x6342('0x8'));var config=require(_0x6342('0x9'));var jayson=require(_0x6342('0xa'));var client=jayson[_0x6342('0xb')][_0x6342('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x20c2a9,_0x437ff6,_0x51dfd9){return new BPromise(function(_0x5a0177,_0xbd5045){return client[_0x6342('0xd')](_0x20c2a9,_0x51dfd9)[_0x6342('0xe')](function(_0xafd0f8){logger[_0x6342('0xf')](_0x6342('0x10'),_0x437ff6,_0x6342('0x11'));logger[_0x6342('0x12')]('Setting,\x20%s,\x20%s,\x20%s',_0x437ff6,_0x6342('0x11'),JSON[_0x6342('0x13')](_0xafd0f8));if(_0xafd0f8[_0x6342('0x14')]){if(_0xafd0f8[_0x6342('0x14')][_0x6342('0x15')]===0x1f4){logger['error'](_0x6342('0x10'),_0x437ff6,_0xafd0f8[_0x6342('0x14')][_0x6342('0x16')]);return _0xbd5045(_0xafd0f8['error'][_0x6342('0x16')]);}logger[_0x6342('0x14')](_0x6342('0x10'),_0x437ff6,_0xafd0f8['error'][_0x6342('0x16')]);return _0x5a0177(_0xafd0f8[_0x6342('0x14')][_0x6342('0x16')]);}else{logger[_0x6342('0xf')](_0x6342('0x10'),_0x437ff6,_0x6342('0x11'));_0x5a0177(_0xafd0f8[_0x6342('0x17')][_0x6342('0x16')]);}})['catch'](function(_0x118800){logger[_0x6342('0x14')](_0x6342('0x10'),_0x437ff6,_0x118800);_0xbd5045(_0x118800);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index ebcc8de..8686475 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 _0xe989=['getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','post','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','/describe','/:id/dispositions'];(function(_0x2c901a,_0xfcb98c){var _0x336b91=function(_0x273a93){while(--_0x273a93){_0x2c901a['push'](_0x2c901a['shift']());}};_0x336b91(++_0xfcb98c);}(_0xe989,0x124));var _0x9e98=function(_0xfee47a,_0x448287){_0xfee47a=_0xfee47a-0x0;var _0x9820c=_0xe989[_0xfee47a];return _0x9820c;};'use strict';var multer=require('multer');var util=require(_0x9e98('0x0'));var path=require(_0x9e98('0x1'));var timeout=require(_0x9e98('0x2'));var express=require(_0x9e98('0x3'));var router=express[_0x9e98('0x4')]();var auth=require(_0x9e98('0x5'));var interaction=require(_0x9e98('0x6'));var config=require('../../config/environment');var controller=require(_0x9e98('0x7'));router[_0x9e98('0x8')]('/',auth[_0x9e98('0x9')](),controller['index']);router[_0x9e98('0x8')](_0x9e98('0xa'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x9e98('0x8')](_0x9e98('0xb'),auth[_0x9e98('0x9')](),controller[_0x9e98('0xc')]);router[_0x9e98('0x8')]('/:id/canned_answers',auth[_0x9e98('0x9')](),controller[_0x9e98('0xd')]);router[_0x9e98('0x8')](_0x9e98('0xe'),auth['isAuthenticated'](),controller[_0x9e98('0xf')]);router[_0x9e98('0x8')](_0x9e98('0x10'),auth[_0x9e98('0x9')](),controller['getInteractions']);router['get'](_0x9e98('0x11'),controller[_0x9e98('0x12')]);router[_0x9e98('0x8')](_0x9e98('0x13'),auth[_0x9e98('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x9e98('0x14')](_0x9e98('0xb'),auth[_0x9e98('0x9')](),controller[_0x9e98('0x15')]);router[_0x9e98('0x14')](_0x9e98('0x16'),auth['isAuthenticated'](),controller[_0x9e98('0x17')]);router[_0x9e98('0x14')](_0x9e98('0x18'),controller[_0x9e98('0x19')]);router[_0x9e98('0x14')](_0x9e98('0xe'),auth[_0x9e98('0x9')](),controller[_0x9e98('0x1a')]);router['post'](_0x9e98('0x1b'),auth[_0x9e98('0x9')](),controller[_0x9e98('0x1c')]);router[_0x9e98('0x14')](_0x9e98('0x11'),controller['status']);router[_0x9e98('0x14')](_0x9e98('0x13'),auth[_0x9e98('0x9')](),controller['addAgents']);router[_0x9e98('0x1d')](_0x9e98('0x1e'),auth[_0x9e98('0x9')](),controller[_0x9e98('0x1f')]);router[_0x9e98('0x20')]('/:id',auth[_0x9e98('0x9')](),controller[_0x9e98('0x21')]);router[_0x9e98('0x20')](_0x9e98('0xb'),auth[_0x9e98('0x9')](),controller[_0x9e98('0x22')]);router[_0x9e98('0x20')](_0x9e98('0x16'),auth[_0x9e98('0x9')](),controller[_0x9e98('0x23')]);router[_0x9e98('0x20')](_0x9e98('0x13'),auth[_0x9e98('0x9')](),controller[_0x9e98('0x24')]);module[_0x9e98('0x25')]=router; \ No newline at end of file +var _0x0cfe=['getInteractions','/:id/status','statusGet','getAgents','create','post','addDisposition','addAnswer','notify','addApplications','/:id/send','send','status','/:id/users','addAgents','put','update','delete','removeAnswers','removeAgents','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','isAuthenticated','get','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x51ca1a,_0x43899f){var _0x5a02ce=function(_0xf1aa0c){while(--_0xf1aa0c){_0x51ca1a['push'](_0x51ca1a['shift']());}};_0x5a02ce(++_0x43899f);}(_0x0cfe,0x1c1));var _0xe0cf=function(_0x4ad11f,_0x3edb6a){_0x4ad11f=_0x4ad11f-0x0;var _0x165d84=_0x0cfe[_0x4ad11f];return _0x165d84;};'use strict';var multer=require('multer');var util=require(_0xe0cf('0x0'));var path=require(_0xe0cf('0x1'));var timeout=require(_0xe0cf('0x2'));var express=require('express');var router=express[_0xe0cf('0x3')]();var auth=require(_0xe0cf('0x4'));var interaction=require(_0xe0cf('0x5'));var config=require(_0xe0cf('0x6'));var controller=require(_0xe0cf('0x7'));router['get']('/',auth[_0xe0cf('0x8')](),controller['index']);router[_0xe0cf('0x9')](_0xe0cf('0xa'),auth[_0xe0cf('0x8')](),controller[_0xe0cf('0xb')]);router[_0xe0cf('0x9')](_0xe0cf('0xc'),auth[_0xe0cf('0x8')](),controller['show']);router[_0xe0cf('0x9')](_0xe0cf('0xd'),auth[_0xe0cf('0x8')](),controller['getDispositions']);router[_0xe0cf('0x9')](_0xe0cf('0xe'),auth[_0xe0cf('0x8')](),controller[_0xe0cf('0xf')]);router['get'](_0xe0cf('0x10'),auth['isAuthenticated'](),controller[_0xe0cf('0x11')]);router[_0xe0cf('0x9')](_0xe0cf('0x12'),auth[_0xe0cf('0x8')](),controller[_0xe0cf('0x13')]);router[_0xe0cf('0x9')](_0xe0cf('0x14'),controller[_0xe0cf('0x15')]);router[_0xe0cf('0x9')]('/:id/users',auth[_0xe0cf('0x8')](),controller[_0xe0cf('0x16')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe0cf('0x17')]);router[_0xe0cf('0x18')](_0xe0cf('0xd'),auth[_0xe0cf('0x8')](),controller[_0xe0cf('0x19')]);router[_0xe0cf('0x18')]('/:id/canned_answers',auth[_0xe0cf('0x8')](),controller[_0xe0cf('0x1a')]);router['post']('/:id/notify',controller[_0xe0cf('0x1b')]);router['post'](_0xe0cf('0x10'),auth[_0xe0cf('0x8')](),controller[_0xe0cf('0x1c')]);router[_0xe0cf('0x18')](_0xe0cf('0x1d'),auth[_0xe0cf('0x8')](),controller[_0xe0cf('0x1e')]);router[_0xe0cf('0x18')]('/:id/status',controller[_0xe0cf('0x1f')]);router[_0xe0cf('0x18')](_0xe0cf('0x20'),auth[_0xe0cf('0x8')](),controller[_0xe0cf('0x21')]);router[_0xe0cf('0x22')](_0xe0cf('0xc'),auth[_0xe0cf('0x8')](),controller[_0xe0cf('0x23')]);router[_0xe0cf('0x24')]('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xe0cf('0xd'),auth[_0xe0cf('0x8')](),controller['removeDispositions']);router[_0xe0cf('0x24')](_0xe0cf('0xe'),auth[_0xe0cf('0x8')](),controller[_0xe0cf('0x25')]);router[_0xe0cf('0x24')](_0xe0cf('0x20'),auth['isAuthenticated'](),controller[_0xe0cf('0x26')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 05a2df6..6762939 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 _0xfafe=['connectel','plivo','clickatell','csc','infobip','intelepeer','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','randomstring','exports','STRING','name','generate','twilio','skebby'];(function(_0x7ec1ba,_0x245b55){var _0x6caab7=function(_0x11ecfb){while(--_0x11ecfb){_0x7ec1ba['push'](_0x7ec1ba['shift']());}};_0x6caab7(++_0x245b55);}(_0xfafe,0xbe));var _0xefaf=function(_0x508a63,_0x5e0276){_0x508a63=_0x508a63-0x0;var _0x5d53f1=_0xfafe[_0x508a63];return _0x5d53f1;};'use strict';var Sequelize=require(_0xefaf('0x0'));var rs=require(_0xefaf('0x1'));module[_0xefaf('0x2')]={'name':{'type':Sequelize[_0xefaf('0x3')],'unique':_0xefaf('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xefaf('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xefaf('0x3')],'defaultValue':function(){return rs[_0xefaf('0x5')]();}},'phone':{'type':Sequelize[_0xefaf('0x3')]},'type':{'type':Sequelize['ENUM'](_0xefaf('0x6'),_0xefaf('0x7'),_0xefaf('0x8'),'clicksend',_0xefaf('0x9'),_0xefaf('0xa'),_0xefaf('0xb'),_0xefaf('0xc'),_0xefaf('0xd'))},'accountSid':{'type':Sequelize[_0xefaf('0x3')]},'authId':{'type':Sequelize[_0xefaf('0x3')]},'authToken':{'type':Sequelize[_0xefaf('0x3')]},'smsMethod':{'type':Sequelize[_0xefaf('0xe')]('SI','TI','GP')},'username':{'type':Sequelize[_0xefaf('0x3')]},'password':{'type':Sequelize[_0xefaf('0x3')]},'apiKey':{'type':Sequelize[_0xefaf('0x3')]},'senderString':{'type':Sequelize[_0xefaf('0x3')]},'deliveryReport':{'type':Sequelize[_0xefaf('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0xefaf('0x3')]},'notificationTemplate':{'type':Sequelize[_0xefaf('0x10')],'defaultValue':function(){return _0xefaf('0x11');}},'notificationSound':{'type':Sequelize[_0xefaf('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xefaf('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xefaf('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xefaf('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xefaf('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xefaf('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xefaf('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xefaf('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xefaf('0x12')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xefaf('0xf')],'defaultValue':![],'comment':_0xefaf('0x13'),'set':function(_0x596f9b){if(!_0x596f9b)this['setDataValue'](_0xefaf('0x14'),null);this[_0xefaf('0x15')]('mandatoryDisposition',_0x596f9b);}}}; \ No newline at end of file +var _0x258b=['twilio','skebby','connectel','clicksend','plivo','clickatell','csc','intelepeer','ENUM','TEXT','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','randomstring','STRING','name','generate'];(function(_0x1b7ac6,_0x4c78f8){var _0x15c49c=function(_0x4a8c03){while(--_0x4a8c03){_0x1b7ac6['push'](_0x1b7ac6['shift']());}};_0x15c49c(++_0x4c78f8);}(_0x258b,0x1f4));var _0xb258=function(_0x3551d3,_0x52bf16){_0x3551d3=_0x3551d3-0x0;var _0x1408b1=_0x258b[_0x3551d3];return _0x1408b1;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xb258('0x0'));module['exports']={'name':{'type':Sequelize[_0xb258('0x1')],'unique':_0xb258('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xb258('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0xb258('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0xb258('0x1')],'defaultValue':function(){return rs[_0xb258('0x3')]();}},'phone':{'type':Sequelize[_0xb258('0x1')]},'type':{'type':Sequelize['ENUM'](_0xb258('0x4'),_0xb258('0x5'),_0xb258('0x6'),_0xb258('0x7'),_0xb258('0x8'),_0xb258('0x9'),_0xb258('0xa'),'infobip',_0xb258('0xb'))},'accountSid':{'type':Sequelize[_0xb258('0x1')]},'authId':{'type':Sequelize[_0xb258('0x1')]},'authToken':{'type':Sequelize[_0xb258('0x1')]},'smsMethod':{'type':Sequelize[_0xb258('0xc')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xb258('0x1')]},'apiKey':{'type':Sequelize[_0xb258('0x1')]},'senderString':{'type':Sequelize[_0xb258('0x1')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xb258('0xd')],'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['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb258('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xb258('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb258('0xe')],'defaultValue':![],'comment':_0xb258('0xf'),'set':function(_0x5c0abd){if(!_0x5c0abd)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xb258('0x10')](_0xb258('0x11'),_0x5c0abd);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 842e4f4..e0c9ed6 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 _0x3b10=['role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','SmsAccountId','getDispositions','findOne','rawAttributes','Disposition','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','notify','SmsApplication','Applications','account','orderBy','priority','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','clicksend','plivo','Text','MessageUUID','results','csc','originatingAddress','fromNumber','intelepeer','refid','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','SmsInteraction','spread','interaction','created','applications','*,*,*,*','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','startRouting','Start','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','send','\x0a','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','User','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','List','defaults','SmsMessage','Messages','dataValues','log','inspect','skebby_dispatch_id','statusInt','requestid','message_id','status_code','infobip','DELIVERED','groupName','clickatell','redif','connectel','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','removeAgents','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./smsAccount.socket','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~!@#$%^&-_=+[{]}.','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','destroy','get','SmsAccounts','stack','name','index','Pause','mandatoryDispositionPause','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','type','key','VIRTUAL','field','options','SmsAccount','count','include','findAll','rows','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x2559d2,_0x3b35d1){var _0x192e06=function(_0x2016a7){while(--_0x2016a7){_0x2559d2['push'](_0x2559d2['shift']());}};_0x192e06(++_0x3b35d1);}(_0x3b10,0x7b));var _0x03b1=function(_0x5aaf20,_0x38dc01){_0x5aaf20=_0x5aaf20-0x0;var _0x5a8c39=_0x3b10[_0x5aaf20];return _0x5a8c39;};'use strict';var pdf=require(_0x03b1('0x0'));var emlformat=require(_0x03b1('0x1'));var rimraf=require(_0x03b1('0x2'));var zipdir=require(_0x03b1('0x3'));var jsonpatch=require(_0x03b1('0x4'));var rp=require(_0x03b1('0x5'));var moment=require(_0x03b1('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x03b1('0x7'));var util=require(_0x03b1('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x03b1('0x9'));var fs=require('fs');var _=require(_0x03b1('0xa'));var squel=require(_0x03b1('0xb'));var crypto=require('crypto');var jsforce=require(_0x03b1('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x03b1('0xd'));var Papa=require(_0x03b1('0xe'));var Redis=require(_0x03b1('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x03b1('0x10'));var logger=require(_0x03b1('0x11'))(_0x03b1('0x12'));var utils=require(_0x03b1('0x13'));var config=require('../../config/environment');var db=require(_0x03b1('0x14'))['db'];config['redis']=_['defaults'](config[_0x03b1('0x15')],{'host':_0x03b1('0x16'),'port':0x18eb});var socket=require(_0x03b1('0x17'))(new Redis(config[_0x03b1('0x15')]));require(_0x03b1('0x18'))['register'](socket);var jayson=require(_0x03b1('0x19'));var client=jayson[_0x03b1('0x1a')][_0x03b1('0x1b')]({'port':0x232c});function checkPasswordPattern(_0x3fd34c,_0x44aa84,_0x455af8){if(_0x455af8){var _0x443579=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x443579['test'](_0x44aa84)){return _0x3fd34c;}else{throw new Error(_0x03b1('0x1c'));}}else{return _0x3fd34c;}}function respondWithRpcPromise(_0x834b76,_0x4d0062,_0x1f76c2,_0x2dcede){return new BPromise(function(_0x45af50,_0x4455cc){var _0x421388=_0x2dcede||client;return _0x421388[_0x03b1('0x1d')](_0x834b76,_0x1f76c2)[_0x03b1('0x1e')](function(_0x1b6a6a){logger[_0x03b1('0x1f')](_0x03b1('0x20'),_0x4d0062,'request\x20sent');logger[_0x03b1('0x21')](_0x03b1('0x22'),_0x4d0062,_0x03b1('0x23'),JSON[_0x03b1('0x24')](_0x1b6a6a));if(_0x1b6a6a['error']){if(_0x1b6a6a['error'][_0x03b1('0x25')]===0x1f4){logger[_0x03b1('0x26')](_0x03b1('0x20'),_0x4d0062,_0x1b6a6a[_0x03b1('0x26')][_0x03b1('0x27')]);return _0x4455cc(_0x1b6a6a[_0x03b1('0x26')]['message']);}logger[_0x03b1('0x26')](_0x03b1('0x20'),_0x4d0062,_0x1b6a6a[_0x03b1('0x26')][_0x03b1('0x27')]);return _0x45af50(_0x1b6a6a['error'][_0x03b1('0x27')]);}else{logger[_0x03b1('0x1f')](_0x03b1('0x20'),_0x4d0062,_0x03b1('0x23'));_0x45af50(_0x1b6a6a[_0x03b1('0x28')]['message']);}})[_0x03b1('0x29')](function(_0x20c389){logger[_0x03b1('0x26')](_0x03b1('0x20'),_0x4d0062,_0x20c389);_0x4455cc(_0x20c389);});});}function respondWithStatusCode(_0x52e742,_0x288010){_0x288010=_0x288010||0xcc;return function(_0x3f421e){if(_0x3f421e){return _0x52e742[_0x03b1('0x2a')](_0x288010);}return _0x52e742[_0x03b1('0x2b')](_0x288010)[_0x03b1('0x2c')]();};}function respondWithResult(_0x46684a,_0x355a99){_0x355a99=_0x355a99||0xc8;return function(_0x9a8251){if(_0x9a8251){return _0x46684a[_0x03b1('0x2b')](_0x355a99)[_0x03b1('0x2d')](_0x9a8251);}};}function respondWithFilteredResult(_0x4e441c,_0x90ff00){return function(_0x421ab8){if(_0x421ab8){var _0x15f5da=_0x421ab8['count'],_0x348c77=_0x90ff00[_0x03b1('0x2e')],_0x32ad53=_0x90ff00[_0x03b1('0x2e')]+_0x90ff00[_0x03b1('0x2f')],_0x4463ee;if(_0x32ad53>=_0x15f5da){_0x32ad53=_0x15f5da;_0x4463ee=0xc8;}else{_0x4463ee=0xce;}_0x4e441c[_0x03b1('0x2b')](_0x4463ee);return _0x4e441c[_0x03b1('0x30')]('Content-Range',_0x348c77+'-'+_0x32ad53+'/'+_0x15f5da)[_0x03b1('0x2d')](_0x421ab8);}return null;};}function patchUpdates(_0x58da6e){return function(_0x55b4f6){try{jsonpatch[_0x03b1('0x31')](_0x55b4f6,_0x58da6e,!![]);}catch(_0x300a4f){return BPromise[_0x03b1('0x32')](_0x300a4f);}return _0x55b4f6[_0x03b1('0x33')]();};}function saveUpdates(_0x1cc834,_0x33690c){return function(_0x232648){if(_0x232648){return _0x232648[_0x03b1('0x34')](_0x1cc834)[_0x03b1('0x1e')](function(_0x16d21b){return _0x16d21b;});}return null;};}function removeEntity(_0x443174,_0x1fe482){return function(_0x507745){if(_0x507745){return _0x507745[_0x03b1('0x35')]()['then'](function(){var _0x4bcb02=_0x507745[_0x03b1('0x36')]({'plain':!![]});var _0x39a66d=_0x03b1('0x37');return db['UserProfileResource'][_0x03b1('0x35')]({'where':{'type':_0x39a66d,'resourceId':_0x4bcb02['id']}})['then'](function(){return _0x507745;});})[_0x03b1('0x1e')](function(){_0x443174[_0x03b1('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x392547,_0x35f068){return function(_0x406640){if(!_0x406640){_0x392547['sendStatus'](0x194);}return _0x406640;};}function handleError(_0x1b5cc0,_0x33e4c5){_0x33e4c5=_0x33e4c5||0x1f4;return function(_0x4bbcd3){logger[_0x03b1('0x26')](_0x4bbcd3[_0x03b1('0x38')]);if(_0x4bbcd3[_0x03b1('0x39')]){delete _0x4bbcd3[_0x03b1('0x39')];}_0x1b5cc0['status'](_0x33e4c5)['send'](_0x4bbcd3);};}exports[_0x03b1('0x3a')]=function(_0x2b31f3,_0x71ec82){var _0x19572e={'include':[{'model':db[_0x03b1('0x3b')],'as':_0x03b1('0x3c')}]},_0x5a779c={},_0x3f2f4c={'count':0x0,'rows':[]};var _0x1d771e=db['SmsAccount']['rawAttributes'];_0x5a779c[_0x03b1('0x3d')]=_['keys'](_0x1d771e);_0x5a779c[_0x03b1('0x3e')]=_[_0x03b1('0x3f')](_0x2b31f3[_0x03b1('0x3e')]);_0x5a779c['filters']=_[_0x03b1('0x40')](_0x5a779c[_0x03b1('0x3d')],_0x5a779c['query']);_0x19572e[_0x03b1('0x41')]=_[_0x03b1('0x40')](_0x5a779c[_0x03b1('0x3d')],qs[_0x03b1('0x42')](_0x2b31f3['query'][_0x03b1('0x42')]));_0x19572e['attributes']=_0x19572e[_0x03b1('0x41')][_0x03b1('0x43')]?_0x19572e['attributes']:_0x5a779c[_0x03b1('0x3d')];if(!_0x2b31f3['query'][_0x03b1('0x44')](_0x03b1('0x45'))){_0x19572e['limit']=qs[_0x03b1('0x2f')](_0x2b31f3[_0x03b1('0x3e')][_0x03b1('0x2f')]);_0x19572e[_0x03b1('0x2e')]=qs['offset'](_0x2b31f3['query'][_0x03b1('0x2e')]);}_0x19572e[_0x03b1('0x46')]=qs['sort'](_0x2b31f3[_0x03b1('0x3e')][_0x03b1('0x47')]);_0x19572e[_0x03b1('0x48')]=qs['filters'](_[_0x03b1('0x49')](_0x2b31f3[_0x03b1('0x3e')],_0x5a779c[_0x03b1('0x4a')]));if(_0x2b31f3['query'][_0x03b1('0x4b')]){_0x19572e[_0x03b1('0x48')]=_[_0x03b1('0x4c')](_0x19572e['where'],{'$or':_[_0x03b1('0x4d')](_0x1d771e,function(_0x26140e){if(_0x26140e[_0x03b1('0x4e')][_0x03b1('0x4f')]!==_0x03b1('0x50')){var _0x268c35={};_0x268c35[_0x26140e[_0x03b1('0x51')]]={'$like':'%'+_0x2b31f3[_0x03b1('0x3e')]['filter']+'%'};return _0x268c35;}})});}_0x19572e=_[_0x03b1('0x4c')]({},_0x19572e,_0x2b31f3[_0x03b1('0x52')]);var _0x3a653d={'where':_0x19572e['where']};return db[_0x03b1('0x53')][_0x03b1('0x54')](_0x3a653d)['then'](function(_0x311fe8){_0x3f2f4c[_0x03b1('0x54')]=_0x311fe8;if(_0x2b31f3[_0x03b1('0x3e')]['includeAll']){_0x19572e[_0x03b1('0x55')]=[{'all':!![]}];}return db[_0x03b1('0x53')][_0x03b1('0x56')](_0x19572e);})[_0x03b1('0x1e')](function(_0x4ad2dd){_0x3f2f4c[_0x03b1('0x57')]=_0x4ad2dd;return _0x3f2f4c;})[_0x03b1('0x1e')](respondWithFilteredResult(_0x71ec82,_0x19572e))[_0x03b1('0x29')](handleError(_0x71ec82,null));};exports['show']=function(_0x1f1740,_0x507d0){var _0x142ef8={'raw':![],'where':{'id':_0x1f1740[_0x03b1('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x03b1('0x3c')}]},_0x4c1ae2={};_0x4c1ae2[_0x03b1('0x3d')]=_['keys'](db[_0x03b1('0x53')]['rawAttributes']);_0x4c1ae2[_0x03b1('0x3e')]=_[_0x03b1('0x3f')](_0x1f1740[_0x03b1('0x3e')]);_0x4c1ae2['filters']=_[_0x03b1('0x40')](_0x4c1ae2[_0x03b1('0x3d')],_0x4c1ae2[_0x03b1('0x3e')]);_0x142ef8[_0x03b1('0x41')]=_['intersection'](_0x4c1ae2[_0x03b1('0x3d')],qs[_0x03b1('0x42')](_0x1f1740[_0x03b1('0x3e')][_0x03b1('0x42')]));_0x142ef8[_0x03b1('0x41')]=_0x142ef8[_0x03b1('0x41')][_0x03b1('0x43')]?_0x142ef8['attributes']:_0x4c1ae2[_0x03b1('0x3d')];if(_0x1f1740[_0x03b1('0x3e')][_0x03b1('0x59')]){_0x142ef8[_0x03b1('0x55')]=[{'all':!![]}];}_0x142ef8=_[_0x03b1('0x4c')]({},_0x142ef8,_0x1f1740['options']);return db[_0x03b1('0x53')]['find'](_0x142ef8)['then'](handleEntityNotFound(_0x507d0,null))[_0x03b1('0x1e')](respondWithResult(_0x507d0,null))['catch'](handleError(_0x507d0,null));};exports[_0x03b1('0x5a')]=function(_0x326c9e,_0x44fe1f){return db[_0x03b1('0x53')][_0x03b1('0x5a')](_0x326c9e[_0x03b1('0x5b')],{})[_0x03b1('0x1e')](function(_0x45f148){var _0x535c52=_0x326c9e[_0x03b1('0x5c')]['get']({'plain':!![]});if(!_0x535c52)throw new Error(_0x03b1('0x5d'));if(_0x535c52[_0x03b1('0x5e')]===_0x03b1('0x5c')){var _0x5532c7=_0x45f148[_0x03b1('0x36')]({'plain':!![]});var _0x5bc02f='SmsAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x5bc02f,'userProfileId':_0x535c52[_0x03b1('0x5f')]},'raw':!![]})[_0x03b1('0x1e')](function(_0x11f6a0){if(_0x11f6a0&&_0x11f6a0['autoAssociation']===0x0){return db[_0x03b1('0x60')]['create']({'name':_0x5532c7[_0x03b1('0x39')],'resourceId':_0x5532c7['id'],'type':_0x11f6a0['name'],'sectionId':_0x11f6a0['id']},{})['then'](function(){return _0x45f148;});}else{return _0x45f148;}})[_0x03b1('0x29')](function(_0x27d7d7){logger[_0x03b1('0x26')](_0x03b1('0x61'),_0x27d7d7);throw _0x27d7d7;});}return _0x45f148;})[_0x03b1('0x1e')](respondWithResult(_0x44fe1f,0xc9))['catch'](handleError(_0x44fe1f,null));};exports[_0x03b1('0x34')]=function(_0xf5a70e,_0x5d0824){if(_0xf5a70e[_0x03b1('0x5b')]['id']){delete _0xf5a70e[_0x03b1('0x5b')]['id'];}return db[_0x03b1('0x53')]['find']({'where':{'id':_0xf5a70e[_0x03b1('0x58')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x03b1('0x1e')](handleEntityNotFound(_0x5d0824,null))[_0x03b1('0x1e')](saveUpdates(_0xf5a70e[_0x03b1('0x5b')],null))[_0x03b1('0x1e')](respondWithResult(_0x5d0824,null))[_0x03b1('0x29')](handleError(_0x5d0824,null));};exports[_0x03b1('0x35')]=function(_0x1d3fbd,_0x4c458d){return db[_0x03b1('0x53')][_0x03b1('0x62')]({'where':{'id':_0x1d3fbd['params']['id']}})[_0x03b1('0x1e')](handleEntityNotFound(_0x4c458d,null))['then'](removeEntity(_0x4c458d,null))[_0x03b1('0x29')](handleError(_0x4c458d,null));};exports['describe']=function(_0x5abcf4,_0x34974c){return db[_0x03b1('0x53')][_0x03b1('0x63')]()['then'](respondWithResult(_0x34974c,null))[_0x03b1('0x29')](handleError(_0x34974c,null));};exports['addDisposition']=function(_0x1bbacb,_0x2834cf,_0x2ea8d5){if(_0x1bbacb[_0x03b1('0x5b')]['id']){delete _0x1bbacb[_0x03b1('0x5b')]['id'];}return db['SmsAccount'][_0x03b1('0x62')]({'where':{'id':_0x1bbacb[_0x03b1('0x58')]['id']}})[_0x03b1('0x1e')](handleEntityNotFound(_0x2834cf,null))[_0x03b1('0x1e')](function(_0x4575b9){if(_0x4575b9){_0x1bbacb[_0x03b1('0x5b')][_0x03b1('0x64')]=_0x4575b9['id'];return db['Disposition'][_0x03b1('0x5a')](_0x1bbacb[_0x03b1('0x5b')]);}})[_0x03b1('0x1e')](respondWithResult(_0x2834cf,null))[_0x03b1('0x29')](handleError(_0x2834cf,null));};exports[_0x03b1('0x65')]=function(_0x305025,_0x29b0b5,_0x171c59){var _0x4e39fd={'raw':![],'where':{}};var _0x59a173={};var _0x4ad1df={'count':0x0,'rows':[]};return db[_0x03b1('0x53')][_0x03b1('0x66')]({'where':{'id':_0x305025['params']['id']}})['then'](handleEntityNotFound(_0x29b0b5,null))[_0x03b1('0x1e')](function(_0x4d8a84){if(_0x4d8a84){_0x59a173[_0x03b1('0x3d')]=_[_0x03b1('0x3f')](db['Disposition'][_0x03b1('0x67')]);_0x59a173[_0x03b1('0x3e')]=_[_0x03b1('0x3f')](_0x305025[_0x03b1('0x3e')]);_0x59a173[_0x03b1('0x4a')]=_[_0x03b1('0x40')](_0x59a173['model'],_0x59a173['query']);_0x4e39fd['attributes']=_[_0x03b1('0x40')](_0x59a173['model'],qs[_0x03b1('0x42')](_0x305025[_0x03b1('0x3e')][_0x03b1('0x42')]));_0x4e39fd[_0x03b1('0x41')]=_0x4e39fd['attributes'][_0x03b1('0x43')]?_0x4e39fd[_0x03b1('0x41')]:_0x59a173[_0x03b1('0x3d')];if(!_0x305025[_0x03b1('0x3e')]['hasOwnProperty'](_0x03b1('0x45'))){_0x4e39fd[_0x03b1('0x2f')]=qs[_0x03b1('0x2f')](_0x305025[_0x03b1('0x3e')][_0x03b1('0x2f')]);_0x4e39fd[_0x03b1('0x2e')]=qs[_0x03b1('0x2e')](_0x305025['query']['offset']);}_0x4e39fd[_0x03b1('0x46')]=qs[_0x03b1('0x47')](_0x305025['query'][_0x03b1('0x47')]);_0x4e39fd[_0x03b1('0x48')]=qs[_0x03b1('0x4a')](_[_0x03b1('0x49')](_0x305025[_0x03b1('0x3e')],_0x59a173[_0x03b1('0x4a')]));_0x4e39fd[_0x03b1('0x48')][_0x03b1('0x64')]=_0x4d8a84['id'];if(_0x305025[_0x03b1('0x3e')][_0x03b1('0x4b')]){_0x4e39fd[_0x03b1('0x48')]=_[_0x03b1('0x4c')](_0x4e39fd[_0x03b1('0x48')],{'$or':_[_0x03b1('0x4d')](_0x4e39fd[_0x03b1('0x41')],function(_0xd8ebb1){var _0x5de532={};_0x5de532[_0xd8ebb1]={'$like':'%'+_0x305025['query'][_0x03b1('0x4b')]+'%'};return _0x5de532;})});}_0x4e39fd=_['merge']({},_0x4e39fd,_0x305025['options']);return db[_0x03b1('0x68')][_0x03b1('0x54')]({'where':_0x4e39fd[_0x03b1('0x48')]})[_0x03b1('0x1e')](function(_0x3b0ac7){_0x4ad1df['count']=_0x3b0ac7;if(_0x305025[_0x03b1('0x3e')][_0x03b1('0x59')]){_0x4e39fd[_0x03b1('0x55')]=[{'all':!![]}];}return db['Disposition'][_0x03b1('0x56')](_0x4e39fd);})[_0x03b1('0x1e')](function(_0x47d5b6){_0x4ad1df[_0x03b1('0x57')]=_0x47d5b6;return _0x4ad1df;});}})[_0x03b1('0x1e')](respondWithFilteredResult(_0x29b0b5,_0x4e39fd))['catch'](handleError(_0x29b0b5,null));};exports[_0x03b1('0x69')]=function(_0x4e0fee,_0x272440,_0x19b524){return db[_0x03b1('0x53')][_0x03b1('0x62')]({'where':{'id':_0x4e0fee[_0x03b1('0x58')]['id']}})['then'](handleEntityNotFound(_0x272440,null))['then'](function(_0x1e1ff2){if(_0x1e1ff2){return _0x1e1ff2[_0x03b1('0x69')](_0x4e0fee[_0x03b1('0x3e')]['ids']);}})[_0x03b1('0x1e')](respondWithStatusCode(_0x272440,null))[_0x03b1('0x29')](handleError(_0x272440,null));};exports[_0x03b1('0x6a')]=function(_0x5c78a6,_0x14fba3,_0x55ebca){if(_0x5c78a6['body']['id']){delete _0x5c78a6[_0x03b1('0x5b')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x5c78a6[_0x03b1('0x58')]['id']}})[_0x03b1('0x1e')](handleEntityNotFound(_0x14fba3,null))['then'](function(_0xef2b0a){if(_0xef2b0a){_0x5c78a6[_0x03b1('0x5b')]['SmsAccountId']=_0xef2b0a['id'];return db[_0x03b1('0x6b')]['create'](_0x5c78a6[_0x03b1('0x5b')]);}})['then'](respondWithResult(_0x14fba3,null))[_0x03b1('0x29')](handleError(_0x14fba3,null));};exports['getAnswers']=function(_0x1802f2,_0x1ed300,_0x1f19b6){var _0x1cd8d0={'raw':![],'where':{}};var _0x496bac={};var _0x427052={'count':0x0,'rows':[]};return db[_0x03b1('0x53')][_0x03b1('0x66')]({'where':{'id':_0x1802f2['params']['id']}})[_0x03b1('0x1e')](handleEntityNotFound(_0x1ed300,null))['then'](function(_0x1be193){if(_0x1be193){_0x496bac[_0x03b1('0x3d')]=_[_0x03b1('0x3f')](db['CannedAnswer'][_0x03b1('0x67')]);_0x496bac[_0x03b1('0x3e')]=_['keys'](_0x1802f2[_0x03b1('0x3e')]);_0x496bac[_0x03b1('0x4a')]=_[_0x03b1('0x40')](_0x496bac['model'],_0x496bac[_0x03b1('0x3e')]);_0x1cd8d0[_0x03b1('0x41')]=_[_0x03b1('0x40')](_0x496bac['model'],qs[_0x03b1('0x42')](_0x1802f2[_0x03b1('0x3e')]['fields']));_0x1cd8d0[_0x03b1('0x41')]=_0x1cd8d0[_0x03b1('0x41')]['length']?_0x1cd8d0[_0x03b1('0x41')]:_0x496bac[_0x03b1('0x3d')];if(!_0x1802f2[_0x03b1('0x3e')][_0x03b1('0x44')](_0x03b1('0x45'))){_0x1cd8d0[_0x03b1('0x2f')]=qs[_0x03b1('0x2f')](_0x1802f2[_0x03b1('0x3e')]['limit']);_0x1cd8d0['offset']=qs[_0x03b1('0x2e')](_0x1802f2[_0x03b1('0x3e')]['offset']);}_0x1cd8d0[_0x03b1('0x46')]=qs[_0x03b1('0x47')](_0x1802f2[_0x03b1('0x3e')]['sort']);_0x1cd8d0[_0x03b1('0x48')]=qs[_0x03b1('0x4a')](_[_0x03b1('0x49')](_0x1802f2[_0x03b1('0x3e')],_0x496bac[_0x03b1('0x4a')]));_0x1cd8d0['where'][_0x03b1('0x64')]=_0x1be193['id'];if(_0x1802f2[_0x03b1('0x3e')][_0x03b1('0x4b')]){_0x1cd8d0[_0x03b1('0x48')]=_[_0x03b1('0x4c')](_0x1cd8d0['where'],{'$or':_[_0x03b1('0x4d')](_0x1cd8d0[_0x03b1('0x41')],function(_0x52263d){var _0x2058f4={};_0x2058f4[_0x52263d]={'$like':'%'+_0x1802f2[_0x03b1('0x3e')][_0x03b1('0x4b')]+'%'};return _0x2058f4;})});}_0x1cd8d0=_[_0x03b1('0x4c')]({},_0x1cd8d0,_0x1802f2['options']);return db[_0x03b1('0x6b')]['count']({'where':_0x1cd8d0[_0x03b1('0x48')]})[_0x03b1('0x1e')](function(_0x4031d2){_0x427052[_0x03b1('0x54')]=_0x4031d2;if(_0x1802f2['query'][_0x03b1('0x59')]){_0x1cd8d0[_0x03b1('0x55')]=[{'all':!![]}];}return db[_0x03b1('0x6b')][_0x03b1('0x56')](_0x1cd8d0);})[_0x03b1('0x1e')](function(_0x7d37d7){_0x427052[_0x03b1('0x57')]=_0x7d37d7;return _0x427052;});}})['then'](respondWithFilteredResult(_0x1ed300,_0x1cd8d0))[_0x03b1('0x29')](handleError(_0x1ed300,null));};exports[_0x03b1('0x6c')]=function(_0x363c23,_0x3734fe,_0x160f33){return db['SmsAccount']['find']({'where':{'id':_0x363c23['params']['id']}})[_0x03b1('0x1e')](handleEntityNotFound(_0x3734fe,null))['then'](function(_0x837f6d){if(_0x837f6d){return _0x837f6d[_0x03b1('0x6c')](_0x363c23[_0x03b1('0x3e')][_0x03b1('0x6d')]);}})[_0x03b1('0x1e')](respondWithStatusCode(_0x3734fe,null))[_0x03b1('0x29')](handleError(_0x3734fe,null));};exports[_0x03b1('0x6e')]=function(_0x2f2fe8,_0x2b94b3,_0xb9548d){var _0x5a76c3={'channel':'sms'};var _0x4993e4=[];var _0x3b9ffa=[];var _0x5b1157={};return db[_0x03b1('0x53')][_0x03b1('0x62')]({'where':{'id':_0x2f2fe8[_0x03b1('0x58')]['id']},'include':[{'model':db[_0x03b1('0x6f')],'as':_0x03b1('0x70')}]})[_0x03b1('0x1e')](handleEntityNotFound(_0x2b94b3,null))[_0x03b1('0x1e')](function(_0x3e5550){_0x5a76c3[_0x03b1('0x71')]=_0x3e5550;_0x5a76c3['applications']=_[_0x03b1('0x72')](_0x3e5550[_0x03b1('0x70')],[_0x03b1('0x73')],[_0x03b1('0x74')]);if(_0x5a76c3[_0x03b1('0x71')][_0x03b1('0x70')]){delete _0x5a76c3[_0x03b1('0x71')][_0x03b1('0x70')];}return db[_0x03b1('0x75')][_0x03b1('0x63')]();})[_0x03b1('0x1e')](function(_0x21e1dc){if(!_0x21e1dc){throw new db[(_0x03b1('0x76'))]['ValidationError'](_0x03b1('0x77'));}_0x4993e4=_[_0x03b1('0x78')](_[_0x03b1('0x3f')](_0x21e1dc),[_0x03b1('0x79'),_0x03b1('0x7a')]);_0x3b9ffa=_[_0x03b1('0x78')](_[_0x03b1('0x3f')](_0x21e1dc),[_0x03b1('0x79'),_0x03b1('0x7a'),'CompanyId',_0x03b1('0x7b')]);_0x5a76c3[_0x03b1('0x5b')]={'mapKey':_0x03b1('0x7c')};if(_0x5a76c3['account'][_0x03b1('0x4e')]){switch(_0x5a76c3[_0x03b1('0x71')][_0x03b1('0x4e')]){case _0x03b1('0x7d'):_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0x7e')]=_0x2f2fe8[_0x03b1('0x5b')][_0x03b1('0x7f')];_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0x5b')]=_0x2f2fe8[_0x03b1('0x5b')][_0x03b1('0x80')];_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0x81')]=_0x2f2fe8[_0x03b1('0x5b')][_0x03b1('0x82')];break;case _0x03b1('0x83'):_0x5a76c3[_0x03b1('0x5b')]['from']='+'+_0x2f2fe8[_0x03b1('0x5b')][_0x03b1('0x84')];_0x5a76c3['body'][_0x03b1('0x5b')]=_0x2f2fe8[_0x03b1('0x5b')][_0x03b1('0x85')];break;case'connectel':_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0x7e')]=_0x2f2fe8[_0x03b1('0x5b')][_0x03b1('0x7e')];_0x5a76c3[_0x03b1('0x5b')]['body']=_0x2f2fe8['body'][_0x03b1('0x27')];break;case _0x03b1('0x86'):_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0x7e')]=_0x2f2fe8['body'][_0x03b1('0x7e')];_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0x5b')]=_0x2f2fe8['body'][_0x03b1('0x5b')];_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0x81')]=_0x2f2fe8['body']['message_id'];break;case _0x03b1('0x87'):_0x5a76c3['body'][_0x03b1('0x7e')]=_0x2f2fe8[_0x03b1('0x5b')]['From'];_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0x5b')]=_0x2f2fe8['body'][_0x03b1('0x88')];_0x5a76c3[_0x03b1('0x5b')]['messageId']=_0x2f2fe8[_0x03b1('0x5b')][_0x03b1('0x89')];break;case'infobip':_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0x7e')]='+'+_0x2f2fe8[_0x03b1('0x5b')][_0x03b1('0x8a')][0x0]['from'];_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0x5b')]=_0x2f2fe8['body'][_0x03b1('0x8a')][0x0]['text'];_0x5a76c3['body'][_0x03b1('0x81')]=_0x2f2fe8['body'][_0x03b1('0x8a')][0x0][_0x03b1('0x81')];break;case _0x03b1('0x8b'):_0x5a76c3['body'][_0x03b1('0x7e')]=_0x2f2fe8[_0x03b1('0x5b')][_0x03b1('0x8c')];_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0x5b')]=_0x2f2fe8[_0x03b1('0x5b')]['segmentedMessage']['message'];break;case'clickatell':_0x5a76c3[_0x03b1('0x5b')]['from']=_0x2f2fe8[_0x03b1('0x5b')][_0x03b1('0x8d')];_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0x5b')]=_0x2f2fe8[_0x03b1('0x5b')]['text'];_0x5a76c3['body']['messageId']=_0x2f2fe8[_0x03b1('0x5b')]['replyMessageId'];break;case _0x03b1('0x8e'):_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0x7e')]=_0x2f2fe8[_0x03b1('0x5b')][_0x03b1('0x7e')];_0x5a76c3[_0x03b1('0x5b')]['body']=_0x2f2fe8['body'][_0x03b1('0x27')];_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0x81')]=_0x2f2fe8[_0x03b1('0x5b')][_0x03b1('0x8f')];break;}}if(_0x5a76c3['body']['id']){delete _0x5a76c3[_0x03b1('0x5b')]['id'];}if(_[_0x03b1('0x90')](_0x5a76c3['body']['from'])){throw new db[(_0x03b1('0x76'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x03b1('0x90')](_0x5a76c3[_0x03b1('0x5b')]['body'])||_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0x5b')]===''){throw new db['Sequelize'][(_0x03b1('0x91'))](_0x03b1('0x92'));}if(_['isNil'](_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0x93')])){throw new db[(_0x03b1('0x76'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3b9ffa);}if(!_['includes'](_0x3b9ffa,_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0x93')])){throw new db[(_0x03b1('0x76'))][(_0x03b1('0x91'))](_0x03b1('0x94')+_0x3b9ffa);}_0x5b1157[_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0x93')]]=_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0x7e')];return db[_0x03b1('0x95')][_0x03b1('0x62')]({'where':{'id':_0x5a76c3[_0x03b1('0x71')][_0x03b1('0x7b')]},'include':[{'model':db[_0x03b1('0x75')],'as':_0x03b1('0x96'),'where':_0x5b1157,'limit':0x1,'order':[[_0x03b1('0x7a'),_0x03b1('0x97')]]}]});})[_0x03b1('0x1e')](handleEntityNotFound(_0x2b94b3,null))['then'](function(_0x289a52){if(_0x289a52){_0x5a76c3[_0x03b1('0x98')]=_[_0x03b1('0x99')](_0x289a52,['Contacts']);if(_0x289a52['Contacts']['length']){return _0x289a52[_0x03b1('0x96')][0x0];}var _0x3c39c0=_['defaults'](_0x5a76c3['body'],{'firstName':_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0x7e')],'ListId':_0x289a52['id']});_0x3c39c0[_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0x93')]]=_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0x7e')];return db[_0x03b1('0x75')][_0x03b1('0x5a')](_0x3c39c0,{'fields':_0x4993e4,'raw':!![]});}})[_0x03b1('0x1e')](handleEntityNotFound(_0x2b94b3,null))[_0x03b1('0x1e')](function(_0x4f73c6){if(_0x4f73c6){_0x5a76c3['contact']=_0x4f73c6;var _0x2d9a97={'ContactId':_0x4f73c6['id'],'phone':_0x5a76c3['body']['from'],'SmsAccountId':_0x2f2fe8[_0x03b1('0x58')]['id']};var _0x9c04a0={'ContactId':_0x4f73c6['id'],'SmsAccountId':_0x2f2fe8[_0x03b1('0x58')]['id'],'closed':![]};return db[_0x03b1('0x9a')]['find']({'where':_0x9c04a0})[_0x03b1('0x1e')](function(_0x5d9a23){if(_0x5d9a23){return[_0x5d9a23,![]];}return db[_0x03b1('0x9a')][_0x03b1('0x5a')](_0x2d9a97)[_0x03b1('0x1e')](function(_0x55a481){return[_0x55a481,!![]];});});}})[_0x03b1('0x9b')](function(_0x2a48db,_0x4d0618){_0x5a76c3[_0x03b1('0x9c')]=_0x2a48db[_0x03b1('0x36')]({'plain':!![]});_0x5a76c3[_0x03b1('0x9c')][_0x03b1('0x9d')]=![];if(_0x4d0618){if(_0x5a76c3[_0x03b1('0x71')]['autoclose']){_0x5a76c3[_0x03b1('0x9e')]['push']({'id':0x0,'priority':_0x5a76c3[_0x03b1('0x9e')][_0x03b1('0x43')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x03b1('0x9f')});}_0x5a76c3['interaction']['created']=!![];}return db['SmsMessage'][_0x03b1('0x5a')]({'phone':_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0x7e')],'messageId':_0x5a76c3['body'][_0x03b1('0x81')],'body':_0x5a76c3['body'][_0x03b1('0x5b')],'SmsAccountId':_0x2f2fe8['params']['id'],'SmsInteractionId':_0x2a48db['id'],'direction':'in','ContactId':_0x2a48db[_0x03b1('0xa0')],'AttachmentId':_0x5a76c3[_0x03b1('0x5b')][_0x03b1('0xa1')]});})[_0x03b1('0x1e')](function(_0x2e6173){_0x5a76c3[_0x03b1('0x27')]=_0x2e6173;if(_0x5a76c3[_0x03b1('0x9c')][_0x03b1('0xa2')]){return db['User'][_0x03b1('0x62')]({'attributes':['id',_0x03b1('0x39')],'where':{'id':_0x5a76c3[_0x03b1('0x9c')][_0x03b1('0xa2')]}})['then'](function(_0x2f3de9){if(_0x2f3de9){_0x5a76c3[_0x03b1('0x9e')][_0x03b1('0xa3')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2f3de9[_0x03b1('0x39')]+','+(_0x5a76c3[_0x03b1('0x71')][_0x03b1('0xa4')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x03b1('0xa5'),_0x5a76c3);});}return respondWithRpcPromise(_0x03b1('0xa6'),_0x03b1('0xa5'),_0x5a76c3);})[_0x03b1('0x1e')](function(_0xa7f722){if(_0xa7f722){var _0x384906=0xc8;var _0x505d1a=_0x03b1('0xa7');logger[_0x03b1('0x1f')](_0x03b1('0x22'),_0x505d1a,_0x384906,'entity\x20found');logger[_0x03b1('0x21')](_0x03b1('0xa8'),_0x505d1a,_0x384906,'entity\x20found',JSON['stringify'](_0xa7f722));if(_0x5a76c3[_0x03b1('0x71')]['type']===_0x03b1('0x7d')){return _0x2b94b3['status'](_0x384906)[_0x03b1('0x30')](_0x03b1('0xa9'),_0x03b1('0xaa'))[_0x03b1('0xab')](_0x03b1('0xac'));}else{return _0x2b94b3[_0x03b1('0x2b')](_0x384906)['json'](_0xa7f722);}}})[_0x03b1('0x29')](handleError(_0x2b94b3,null));};exports[_0x03b1('0xad')]=function(_0x525056,_0x3fc796,_0x357555){return db[_0x03b1('0x53')][_0x03b1('0x66')]({'where':{'id':_0x525056[_0x03b1('0x58')]['id']}})[_0x03b1('0x1e')](handleEntityNotFound(_0x3fc796,null))[_0x03b1('0x1e')](function(_0x246916){if(_0x246916){return db[_0x03b1('0xae')][_0x03b1('0xaf')](function(_0x5de4b0){return db[_0x03b1('0x6f')]['destroy']({'where':{'SmsAccountId':_0x525056[_0x03b1('0x58')]['id']},'transaction':_0x5de4b0})[_0x03b1('0x1e')](function(_0x519556){var _0x3aed7b=_[_0x03b1('0x4d')](_0x525056[_0x03b1('0x5b')],function(_0x1dfd90){_0x1dfd90[_0x03b1('0x64')]=_0x525056[_0x03b1('0x58')]['id'];return _0x1dfd90;});return db[_0x03b1('0x6f')][_0x03b1('0xb0')](_0x3aed7b,{'transaction':_0x5de4b0});});})[_0x03b1('0x1e')](function(){return db[_0x03b1('0x6f')][_0x03b1('0xb1')]({'where':{'SmsAccountId':_0x525056['params']['id']},'order':'priority'});});}})[_0x03b1('0x1e')](respondWithResult(_0x3fc796,null))['catch'](handleError(_0x3fc796,null));};exports[_0x03b1('0xb2')]=function(_0x531057,_0x5427c9,_0x4ea449){var _0x26d24a={};var _0x4fd362={};var _0x2cc11e;var _0x6fb784;return db['SmsAccount']['findOne']({'where':{'id':_0x531057[_0x03b1('0x58')]['id']}})['then'](handleEntityNotFound(_0x5427c9,null))['then'](function(_0x3e320c){if(_0x3e320c){_0x2cc11e=_0x3e320c;_0x4fd362[_0x03b1('0x3d')]=_[_0x03b1('0x3f')](db[_0x03b1('0x6f')][_0x03b1('0x67')]);_0x4fd362['query']=_[_0x03b1('0x3f')](_0x531057[_0x03b1('0x3e')]);_0x4fd362[_0x03b1('0x4a')]=_[_0x03b1('0x40')](_0x4fd362[_0x03b1('0x3d')],_0x4fd362[_0x03b1('0x3e')]);_0x26d24a[_0x03b1('0x41')]=_['intersection'](_0x4fd362['model'],qs[_0x03b1('0x42')](_0x531057[_0x03b1('0x3e')]['fields']));_0x26d24a[_0x03b1('0x41')]=_0x26d24a[_0x03b1('0x41')][_0x03b1('0x43')]?_0x26d24a[_0x03b1('0x41')]:_0x4fd362['model'];_0x26d24a[_0x03b1('0x46')]=qs['sort'](_0x531057[_0x03b1('0x3e')][_0x03b1('0x47')]);_0x26d24a[_0x03b1('0x48')]=qs[_0x03b1('0x4a')](_['pick'](_0x531057[_0x03b1('0x3e')],_0x4fd362[_0x03b1('0x4a')]));if(_0x531057[_0x03b1('0x3e')][_0x03b1('0x4b')]){_0x26d24a[_0x03b1('0x48')]=_[_0x03b1('0x4c')](_0x26d24a[_0x03b1('0x48')],{'$or':_[_0x03b1('0x4d')](_0x26d24a['attributes'],function(_0xf57292){var _0x1d65aa={};_0x1d65aa[_0xf57292]={'$like':'%'+_0x531057[_0x03b1('0x3e')][_0x03b1('0x4b')]+'%'};return _0x1d65aa;})});}_0x26d24a=_['merge']({},_0x26d24a,_0x531057[_0x03b1('0x52')]);return _0x2cc11e[_0x03b1('0xb2')](_0x26d24a);}})[_0x03b1('0x1e')](function(_0x58998d){if(_0x58998d){_0x6fb784=_0x58998d[_0x03b1('0x43')];if(!_0x531057['query'][_0x03b1('0x44')](_0x03b1('0x45'))){_0x26d24a[_0x03b1('0x2f')]=qs[_0x03b1('0x2f')](_0x531057[_0x03b1('0x3e')]['limit']);_0x26d24a[_0x03b1('0x2e')]=qs[_0x03b1('0x2e')](_0x531057[_0x03b1('0x3e')][_0x03b1('0x2e')]);}return _0x2cc11e[_0x03b1('0xb2')](_0x26d24a);}})[_0x03b1('0x1e')](function(_0x457653){if(_0x457653){return _0x457653?{'count':_0x6fb784,'rows':_0x457653}:null;}})['then'](respondWithResult(_0x5427c9,null))[_0x03b1('0x29')](handleError(_0x5427c9,null));};exports[_0x03b1('0xb3')]=function(_0x34d7e3,_0x53300c,_0x30e898){var _0xba0498={'raw':![],'where':{}};var _0xd9e5b5={};var _0x19e133={'count':0x0,'rows':[]};return db['SmsAccount'][_0x03b1('0x66')]({'where':{'id':_0x34d7e3[_0x03b1('0x58')]['id']}})['then'](handleEntityNotFound(_0x53300c,null))[_0x03b1('0x1e')](function(_0x384557){if(_0x384557){_0xd9e5b5[_0x03b1('0x3d')]=_[_0x03b1('0x3f')](db[_0x03b1('0x9a')][_0x03b1('0x67')]);_0xd9e5b5[_0x03b1('0x3e')]=_[_0x03b1('0x3f')](_0x34d7e3[_0x03b1('0x3e')]);_0xd9e5b5[_0x03b1('0x4a')]=_['intersection'](_0xd9e5b5[_0x03b1('0x3d')],_0xd9e5b5[_0x03b1('0x3e')]);_0xba0498['attributes']=_[_0x03b1('0x40')](_0xd9e5b5[_0x03b1('0x3d')],qs[_0x03b1('0x42')](_0x34d7e3[_0x03b1('0x3e')][_0x03b1('0x42')]));_0xba0498[_0x03b1('0x41')]=_0xba0498[_0x03b1('0x41')][_0x03b1('0x43')]?_0xba0498[_0x03b1('0x41')]:_0xd9e5b5[_0x03b1('0x3d')];if(!_0x34d7e3['query']['hasOwnProperty']('nolimit')){_0xba0498[_0x03b1('0x2f')]=qs[_0x03b1('0x2f')](_0x34d7e3[_0x03b1('0x3e')][_0x03b1('0x2f')]);_0xba0498[_0x03b1('0x2e')]=qs[_0x03b1('0x2e')](_0x34d7e3[_0x03b1('0x3e')][_0x03b1('0x2e')]);}_0xba0498[_0x03b1('0x46')]=qs[_0x03b1('0x47')](_0x34d7e3[_0x03b1('0x3e')][_0x03b1('0x47')]);_0xba0498['where']=qs[_0x03b1('0x4a')](_[_0x03b1('0x49')](_0x34d7e3[_0x03b1('0x3e')],_0xd9e5b5['filters']));_0xba0498[_0x03b1('0x48')][_0x03b1('0x64')]=_0x384557['id'];if(_0x34d7e3['query'][_0x03b1('0x4b')]){_0xba0498[_0x03b1('0x48')]=_['merge'](_0xba0498[_0x03b1('0x48')],{'$or':_['map'](_0xba0498[_0x03b1('0x41')],function(_0x48ab73){var _0xd6f22d={};_0xd6f22d[_0x48ab73]={'$like':'%'+_0x34d7e3[_0x03b1('0x3e')]['filter']+'%'};return _0xd6f22d;})});}_0xba0498=_['merge']({},_0xba0498,_0x34d7e3['options']);return db['SmsInteraction']['count']({'where':_0xba0498[_0x03b1('0x48')]})[_0x03b1('0x1e')](function(_0x45d311){_0x19e133[_0x03b1('0x54')]=_0x45d311;if(_0x34d7e3[_0x03b1('0x3e')]['includeAll']){_0xba0498[_0x03b1('0x55')]=[{'model':db[_0x03b1('0x75')],'as':'Contact','required':![]},{'model':db[_0x03b1('0xb4')],'as':'Owner','attributes':[_0x03b1('0x39'),_0x03b1('0xb5'),_0x03b1('0xb6')],'required':![]},{'model':db[_0x03b1('0xb7')],'as':'Tags','attributes':['id','name',_0x03b1('0xb8')],'where':_0x34d7e3[_0x03b1('0x3e')]['tag']?{'id':_0x34d7e3[_0x03b1('0x3e')][_0x03b1('0xb9')]}:undefined,'required':_0x34d7e3[_0x03b1('0x3e')][_0x03b1('0xb9')]?!![]:![]}];}return db[_0x03b1('0x9a')][_0x03b1('0x56')](_0xba0498);})[_0x03b1('0x1e')](function(_0x6efc8e){_0x19e133[_0x03b1('0x57')]=_0x6efc8e;return _0x19e133;});}})[_0x03b1('0x1e')](respondWithFilteredResult(_0x53300c,_0xba0498))[_0x03b1('0x29')](handleError(_0x53300c,null));};exports[_0x03b1('0xab')]=function(_0x2f67c6,_0x44569e,_0x2d176e){var _0x4f0221,_0x19a0d2,_0x2650ae;if(_[_0x03b1('0x90')](_0x2f67c6[_0x03b1('0x5b')][_0x03b1('0x5b')])||_0x2f67c6[_0x03b1('0x5b')]['body']===''){throw new db[(_0x03b1('0x76'))][(_0x03b1('0x91'))](_0x03b1('0x92'));}if(_['isNil'](_0x2f67c6[_0x03b1('0x5b')]['to'])){throw new db[(_0x03b1('0x76'))][(_0x03b1('0x91'))](_0x03b1('0xba'));}_0x4f0221=_0x2f67c6[_0x03b1('0x5b')]['to'];return db[_0x03b1('0x53')][_0x03b1('0x62')]({'where':{'id':_0x2f67c6[_0x03b1('0x58')]['id']},'include':[{'model':db[_0x03b1('0x95')],'as':_0x03b1('0xbb'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x4f0221},'limit':0x1,'order':[['updatedAt',_0x03b1('0x97')]]}]}]})[_0x03b1('0x1e')](handleEntityNotFound(_0x44569e,null))[_0x03b1('0x1e')](function(_0x2965c3){if(_0x2965c3&&_0x2965c3[_0x03b1('0xbb')]){_0x19a0d2=_0x2965c3[_0x03b1('0x36')]({'plain':!![]});if(_0x19a0d2[_0x03b1('0xbb')]&&_0x19a0d2[_0x03b1('0xbb')]['Contacts'][_0x03b1('0x43')]){return _0x19a0d2['List'][_0x03b1('0x96')][0x0];}return db['CmContact'][_0x03b1('0x5a')](_[_0x03b1('0xbc')](_0x2f67c6[_0x03b1('0x5b')],{'firstName':_0x4f0221,'mobile':_0x4f0221,'phone':_0x4f0221,'ListId':_0x19a0d2[_0x03b1('0x7b')]}));}})[_0x03b1('0x1e')](handleEntityNotFound(_0x44569e,null))['then'](function(_0xfc14cf){if(_0xfc14cf){_0x2650ae=_0xfc14cf;return db[_0x03b1('0x9a')][_0x03b1('0x62')]({'where':{'ContactId':_0x2650ae['id'],'closed':![],'SmsAccountId':_0x19a0d2['id']}})['then'](function(_0x43d32a){if(_0x43d32a){return[_0x43d32a,![]];}return db[_0x03b1('0x9a')]['create']({'UserId':_0x2f67c6[_0x03b1('0x5c')]['id'],'ContactId':_0x2650ae['id'],'SmsAccountId':_0x19a0d2['id'],'phone':_0x4f0221,'firstMsgDirection':'out','Messages':[_['merge'](_0x2f67c6[_0x03b1('0x5b')],{'read':![],'body':_0x2f67c6['body'][_0x03b1('0x5b')],'phone':_0x4f0221,'SmsAccountId':_0x19a0d2['id'],'UserId':_0x2f67c6[_0x03b1('0x5c')]['id'],'ContactId':_0x2650ae['id']})]},{'include':[{'model':db[_0x03b1('0xbd')],'as':_0x03b1('0xbe')}]})[_0x03b1('0x1e')](function(_0x3e2aa1){return[_0x3e2aa1,!![]];});});}})[_0x03b1('0x9b')](function(_0x32e3ed,_0xea7898){if(_0xea7898){return _0x32e3ed;}return db[_0x03b1('0xbd')][_0x03b1('0x5a')](_[_0x03b1('0x4c')](_0x2f67c6[_0x03b1('0x5b')],{'read':![],'body':_0x2f67c6['body'][_0x03b1('0x5b')],'phone':_0x4f0221,'SmsAccountId':_0x19a0d2['id'],'SmsInteractionId':_0x32e3ed['id'],'UserId':_0x2f67c6[_0x03b1('0x5c')]['id'],'ContactId':_0x2650ae['id']}))[_0x03b1('0x1e')](function(_0x5acca2){_0x32e3ed[_0x03b1('0xbf')][_0x03b1('0xbe')]=[];_0x32e3ed[_0x03b1('0xbf')][_0x03b1('0xbe')]['push'](_0x5acca2[_0x03b1('0xbf')]);return _0x32e3ed;});})[_0x03b1('0x1e')](respondWithResult(_0x44569e,null))['catch'](handleError(_0x44569e,null));};exports[_0x03b1('0x2b')]=function(_0x69dae1,_0x30f09c,_0x5e9b1e){if(_0x69dae1[_0x03b1('0x5b')]['id']){delete _0x69dae1['body']['id'];}console[_0x03b1('0xc0')]('endpoint\x20/status\x20POST\x20/',_0x69dae1[_0x03b1('0x5b')]);var _0x4c378b,_0x84f50d,_0x5b02b1;return db[_0x03b1('0x53')][_0x03b1('0x62')]({'where':{'id':_0x69dae1[_0x03b1('0x58')]['id']}})[_0x03b1('0x1e')](handleEntityNotFound(_0x30f09c,null))[_0x03b1('0x1e')](function(_0x215cc1){if(_0x215cc1){_0x5b02b1=_0x215cc1;logger[_0x03b1('0x21')](_0x03b1('0x22'),'status','received\x20delivery\x20report\x20from',_0x215cc1[_0x03b1('0x4e')],util[_0x03b1('0xc1')](_0x69dae1['body'],{'showHidden':![],'depth':null}));switch(_0x215cc1['type']){case _0x03b1('0x83'):if(_0x69dae1['body'][_0x03b1('0xc2')]&&_0x69dae1[_0x03b1('0x5b')][_0x03b1('0x2b')]){_0x84f50d=_0x69dae1[_0x03b1('0x5b')]['status'];return db['SmsMessage']['find']({'where':{'messageId':_0x69dae1[_0x03b1('0x5b')][_0x03b1('0xc2')]}});}break;case'connectel':if(_0x69dae1[_0x03b1('0x5b')]['requestid']&&_0x69dae1[_0x03b1('0x5b')][_0x03b1('0xc3')]){_0x84f50d=_0x69dae1[_0x03b1('0x5b')][_0x03b1('0xc3')];return db[_0x03b1('0xbd')][_0x03b1('0x62')]({'where':{'messageId':_0x69dae1['body'][_0x03b1('0xc4')]}});}break;case _0x03b1('0x86'):if(_0x69dae1[_0x03b1('0x5b')][_0x03b1('0xc5')]&&_0x69dae1[_0x03b1('0x5b')]['status_code']){_0x84f50d=_0x69dae1[_0x03b1('0x5b')][_0x03b1('0xc6')];return db[_0x03b1('0xbd')][_0x03b1('0x62')]({'where':{'messageId':_0x69dae1['body'][_0x03b1('0xc5')]}});}break;case _0x03b1('0xc7'):var _0x1bc212=_0x69dae1[_0x03b1('0x5b')][_0x03b1('0x8a')][0x0];if(_0x1bc212['messageId']&&_0x1bc212[_0x03b1('0x2b')]['groupName']===_0x03b1('0xc8')){_0x84f50d=_0x1bc212[_0x03b1('0x2b')][_0x03b1('0xc9')];return db[_0x03b1('0xbd')][_0x03b1('0x62')]({'where':{'messageId':_0x1bc212[_0x03b1('0x81')]}});}break;case _0x03b1('0xca'):if(_0x69dae1[_0x03b1('0x5b')]['messageId']&&_0x69dae1['body']['status']){_0x84f50d=_0x69dae1['body'][_0x03b1('0x2b')];return db[_0x03b1('0xbd')][_0x03b1('0x62')]({'where':{'messageId':_0x69dae1[_0x03b1('0x5b')][_0x03b1('0x81')]}});}break;case _0x03b1('0x8e'):if(_0x69dae1[_0x03b1('0x5b')][_0x03b1('0xcb')]&&_0x69dae1[_0x03b1('0x5b')]['status']){_0x84f50d=_0x69dae1[_0x03b1('0x5b')][_0x03b1('0x2b')];return db['SmsMessage'][_0x03b1('0x62')]({'where':{'messageId':_0x69dae1[_0x03b1('0x5b')][_0x03b1('0xcb')]}});}break;}}})[_0x03b1('0x1e')](handleEntityNotFound(_0x30f09c,null))['then'](function(_0x557b6c){if(_0x557b6c){_0x4c378b=_0x557b6c;switch(_0x5b02b1[_0x03b1('0x4e')]){case _0x03b1('0x83'):if(_0x84f50d==='DELIVERED'){return _0x4c378b[_0x03b1('0x34')]({'read':!![]});}else{logger[_0x03b1('0x26')](_0x03b1('0x22'),_0x03b1('0x2b'),_0x03b1('0x83'),util[_0x03b1('0xc1')](_0x69dae1[_0x03b1('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x03b1('0xcc'):if(_0x84f50d==='1'){return _0x4c378b[_0x03b1('0x34')]({'read':!![]});}else{logger['error'](_0x03b1('0x22'),_0x03b1('0x2b'),_0x03b1('0x83'),util[_0x03b1('0xc1')](_0x69dae1['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x69dae1[_0x03b1('0x5b')]['error_code']&&_0x84f50d>=0xc8&&_0x84f50d<=0xce){return _0x4c378b['update']({'read':!![]});}else{logger[_0x03b1('0x26')](_0x03b1('0x22'),_0x03b1('0x2b'),_0x03b1('0x86'),util[_0x03b1('0xc1')](_0x69dae1[_0x03b1('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x03b1('0xc7'):var _0x4e6037=_0x69dae1['body'][_0x03b1('0x8a')][0x0];if(_0x4e6037[_0x03b1('0x2b')][_0x03b1('0xc9')]==='DELIVERED'){return _0x4c378b[_0x03b1('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x03b1('0x2b'),_0x03b1('0xc7'),util[_0x03b1('0xc1')](_0x69dae1[_0x03b1('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x03b1('0xca'):if(_0x84f50d==_0x03b1('0xcd')||_0x84f50d==_0x03b1('0xce')){return _0x4c378b[_0x03b1('0x34')]({'read':!![]});}else{logger['error'](_0x03b1('0x22'),_0x03b1('0x2b'),_0x03b1('0xca'),util[_0x03b1('0xc1')](_0x69dae1['body'],{'showHidden':![],'depth':null}));}break;case _0x03b1('0x8e'):if(_0x84f50d===_0x03b1('0xcf')||_0x84f50d===_0x03b1('0xd0')){return _0x4c378b[_0x03b1('0x34')]({'read':!![]});}else{logger[_0x03b1('0x26')](_0x03b1('0x22'),_0x03b1('0x2b'),_0x03b1('0x8e'),util[_0x03b1('0xc1')](_0x69dae1['body'],{'showHidden':![],'depth':null}));}break;}return _0x4c378b;}})[_0x03b1('0x1e')](respondWithResult(_0x30f09c,null))[_0x03b1('0x29')](handleError(_0x30f09c,null));};exports[_0x03b1('0xd1')]=function(_0x22ca35,_0x1207cf,_0x44bfe1){var _0x31cd95,_0x37bb81,_0x39b45f;return db[_0x03b1('0x53')][_0x03b1('0x62')]({'where':{'id':_0x22ca35[_0x03b1('0x58')]['id']}})[_0x03b1('0x1e')](handleEntityNotFound(_0x1207cf,null))['then'](function(_0x5acd9f){if(_0x5acd9f){_0x39b45f=_0x5acd9f;logger[_0x03b1('0x21')](_0x03b1('0x22'),'status','received\x20delivery\x20report\x20from',_0x5acd9f['type'],util[_0x03b1('0xc1')](_0x22ca35[_0x03b1('0x3e')],{'showHidden':![],'depth':null}));switch(_0x5acd9f['type']){case _0x03b1('0x8b'):if(_0x22ca35[_0x03b1('0x3e')][_0x03b1('0xd2')]&&_0x22ca35[_0x03b1('0x3e')][_0x03b1('0xd3')]){_0x37bb81=_0x22ca35['query'][_0x03b1('0xd3')];return db['SmsMessage'][_0x03b1('0x62')]({'where':{'messageId':_0x22ca35['query']['message-id']}});}break;}}})[_0x03b1('0x1e')](handleEntityNotFound(_0x1207cf,null))['then'](function(_0x2c917b){if(_0x2c917b){_0x31cd95=_0x2c917b;switch(_0x39b45f[_0x03b1('0x4e')]){case _0x03b1('0x8b'):if(_0x37bb81==='2'||_0x37bb81==='6'){return _0x31cd95[_0x03b1('0x34')]({'read':!![]});}else{logger[_0x03b1('0x26')](_0x03b1('0x22'),_0x03b1('0x2b'),'csc',util[_0x03b1('0xc1')](_0x22ca35['query'],{'showHidden':![],'depth':null}));};break;}return _0x31cd95;}})[_0x03b1('0x1e')](respondWithResult(_0x1207cf,null))[_0x03b1('0x29')](handleError(_0x1207cf,null));};exports['addAgents']=function(_0x41002a,_0x4d2460,_0x5da576){return db[_0x03b1('0x53')][_0x03b1('0x62')]({'where':{'id':_0x41002a[_0x03b1('0x58')]['id']}})[_0x03b1('0x1e')](handleEntityNotFound(_0x4d2460,null))['then'](function(_0x2a6ad7){if(_0x2a6ad7){return _0x2a6ad7[_0x03b1('0xd4')](_0x41002a[_0x03b1('0x5b')][_0x03b1('0x6d')],_[_0x03b1('0x99')](_0x41002a[_0x03b1('0x5b')],[_0x03b1('0x6d'),'id'])||{})[_0x03b1('0x9b')](function(_0xb55e14){for(var _0x594f2d=0x0;_0x594f2d<_0x41002a[_0x03b1('0x5b')]['ids'][_0x03b1('0x43')];_0x594f2d+=0x1){socket[_0x03b1('0xd5')]('userSmsAccount:save',{'UserId':_0x41002a['body'][_0x03b1('0x6d')][_0x594f2d],'SmsAccountId':_0x41002a[_0x03b1('0x58')]['id']});}return _0xb55e14;});}})[_0x03b1('0x1e')](respondWithResult(_0x4d2460,null))[_0x03b1('0x29')](handleError(_0x4d2460,null));};exports[_0x03b1('0xd6')]=function(_0x28c366,_0x3b3a5c,_0x4eea92){return db[_0x03b1('0x53')]['find']({'where':{'id':_0x28c366[_0x03b1('0x58')]['id']}})[_0x03b1('0x1e')](handleEntityNotFound(_0x3b3a5c,null))[_0x03b1('0x1e')](function(_0x2e1188){if(_0x2e1188){return _0x2e1188[_0x03b1('0xd6')](_0x28c366[_0x03b1('0x3e')]['ids'])[_0x03b1('0x1e')](function(){if(_['isArray'](_0x28c366[_0x03b1('0x3e')]['ids'])){for(var _0x2d8b3f=0x0;_0x2d8b3f<_0x28c366['query'][_0x03b1('0x6d')][_0x03b1('0x43')];_0x2d8b3f+=0x1){socket[_0x03b1('0xd5')](_0x03b1('0xd7'),{'UserId':Number(_0x28c366[_0x03b1('0x3e')]['ids'][_0x2d8b3f]),'SmsAccountId':Number(_0x28c366[_0x03b1('0x58')]['id'])});}}else{socket['emit'](_0x03b1('0xd7'),{'UserId':Number(_0x28c366[_0x03b1('0x3e')][_0x03b1('0x6d')]),'SmsAccountId':Number(_0x28c366[_0x03b1('0x58')]['id'])});}});}})[_0x03b1('0x1e')](respondWithStatusCode(_0x3b3a5c,null))['catch'](handleError(_0x3b3a5c,null));};exports[_0x03b1('0xd8')]=function(_0xc95fda,_0x4a28ad,_0xc04032){var _0x1c4264={};var _0xeb6ad5={};var _0x33c225;var _0x3ab71c;return db[_0x03b1('0x53')][_0x03b1('0x66')]({'where':{'id':_0xc95fda[_0x03b1('0x58')]['id']}})[_0x03b1('0x1e')](handleEntityNotFound(_0x4a28ad,null))[_0x03b1('0x1e')](function(_0x4ec277){if(_0x4ec277){_0x33c225=_0x4ec277;_0xeb6ad5['model']=_[_0x03b1('0x3f')](db[_0x03b1('0xb4')]['rawAttributes']);_0xeb6ad5[_0x03b1('0x3e')]=_[_0x03b1('0x3f')](_0xc95fda['query']);_0xeb6ad5[_0x03b1('0x4a')]=_['intersection'](_0xeb6ad5[_0x03b1('0x3d')],_0xeb6ad5[_0x03b1('0x3e')]);_0x1c4264[_0x03b1('0x41')]=_[_0x03b1('0x40')](_0xeb6ad5[_0x03b1('0x3d')],qs[_0x03b1('0x42')](_0xc95fda[_0x03b1('0x3e')]['fields']));_0x1c4264[_0x03b1('0x41')]=_0x1c4264[_0x03b1('0x41')][_0x03b1('0x43')]?_0x1c4264[_0x03b1('0x41')]:_0xeb6ad5['model'];_0x1c4264[_0x03b1('0x46')]=qs[_0x03b1('0x47')](_0xc95fda['query']['sort']);_0x1c4264[_0x03b1('0x48')]=qs[_0x03b1('0x4a')](_[_0x03b1('0x49')](_0xc95fda[_0x03b1('0x3e')],_0xeb6ad5['filters']));if(_0xc95fda[_0x03b1('0x3e')][_0x03b1('0x4b')]){_0x1c4264[_0x03b1('0x48')]=_[_0x03b1('0x4c')](_0x1c4264[_0x03b1('0x48')],{'$or':_[_0x03b1('0x4d')](_0x1c4264[_0x03b1('0x41')],function(_0x138cf8){var _0x5520ae={};_0x5520ae[_0x138cf8]={'$like':'%'+_0xc95fda[_0x03b1('0x3e')][_0x03b1('0x4b')]+'%'};return _0x5520ae;})});}_0x1c4264=_[_0x03b1('0x4c')]({},_0x1c4264,_0xc95fda[_0x03b1('0x52')]);return _0x33c225[_0x03b1('0xd8')](_0x1c4264);}})[_0x03b1('0x1e')](function(_0x5023a1){if(_0x5023a1){_0x3ab71c=_0x5023a1[_0x03b1('0x43')];if(!_0xc95fda['query']['hasOwnProperty'](_0x03b1('0x45'))){_0x1c4264['limit']=qs[_0x03b1('0x2f')](_0xc95fda[_0x03b1('0x3e')][_0x03b1('0x2f')]);_0x1c4264[_0x03b1('0x2e')]=qs[_0x03b1('0x2e')](_0xc95fda[_0x03b1('0x3e')][_0x03b1('0x2e')]);}return _0x33c225[_0x03b1('0xd8')](_0x1c4264);}})[_0x03b1('0x1e')](function(_0x4bea23){if(_0x4bea23){return _0x4bea23?{'count':_0x3ab71c,'rows':_0x4bea23}:null;}})[_0x03b1('0x1e')](respondWithResult(_0x4a28ad,null))['catch'](handleError(_0x4a28ad,null));}; \ No newline at end of file +var _0xf39d=['out','Messages','log','endpoint\x20/status\x20POST\x20/','inspect','skebby','skebby_dispatch_id','connectel','statusInt','requestid','status_code','groupName','DELIVERED','clickatell','redif','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','intelepeer','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','offset','limit','set','Content-Range','reject','destroy','get','stack','name','send','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','map','type','key','VIRTUAL','field','merge','options','where','count','rows','show','params','includeAll','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsAccounts','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','update','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','nolimit','include','findAll','removeDispositions','ids','CannedAnswer','order','removeAnswers','notify','sms','SmsApplication','Applications','account','orderBy','CmContact','Sequelize','difference','createdAt','updatedAt','ListId','mobile','from','From','Body','MessageSid','text','clicksend','message_id','plivo','Text','messageId','MessageUUID','infobip','results','csc','fromNumber','replyMessageId','refid','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','contact','SmsInteraction','spread','interaction','created','autoclose','applications','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','twilio','Content-Type','json','addApplications','sequelize','bulkCreate','priority','getApplications','getInteractions','Contact','User','internal','Tag','color','tag','List','user'];(function(_0x106867,_0xfe203c){var _0x53c527=function(_0x4aae8b){while(--_0x4aae8b){_0x106867['push'](_0x106867['shift']());}};_0x53c527(++_0xfe203c);}(_0xf39d,0x1d5));var _0xdf39=function(_0xbc346f,_0x3db5c0){_0xbc346f=_0xbc346f-0x0;var _0x9f9260=_0xf39d[_0xbc346f];return _0x9f9260;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdf39('0x0'));var rimraf=require(_0xdf39('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf39('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdf39('0x3'));var Mustache=require(_0xdf39('0x4'));var util=require(_0xdf39('0x5'));var path=require('path');var sox=require(_0xdf39('0x6'));var csv=require(_0xdf39('0x7'));var ejs=require(_0xdf39('0x8'));var fs=require('fs');var _=require(_0xdf39('0x9'));var squel=require(_0xdf39('0xa'));var crypto=require(_0xdf39('0xb'));var jsforce=require(_0xdf39('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdf39('0xd'));var Papa=require('papaparse');var Redis=require(_0xdf39('0xe'));var authService=require(_0xdf39('0xf'));var qs=require(_0xdf39('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdf39('0x11'))('api');var utils=require(_0xdf39('0x12'));var config=require(_0xdf39('0x13'));var db=require(_0xdf39('0x14'))['db'];config[_0xdf39('0x15')]=_[_0xdf39('0x16')](config[_0xdf39('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdf39('0x15')]));require('./smsAccount.socket')[_0xdf39('0x17')](socket);var jayson=require(_0xdf39('0x18'));var client=jayson[_0xdf39('0x19')][_0xdf39('0x1a')]({'port':0x232c});function checkPasswordPattern(_0x838151,_0x4822e6,_0x15cf1e){if(_0x15cf1e){var _0x402849=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x402849[_0xdf39('0x1b')](_0x4822e6)){return _0x838151;}else{throw new Error(_0xdf39('0x1c'));}}else{return _0x838151;}}function respondWithRpcPromise(_0x33f2f1,_0x59d3b9,_0x51d97f,_0x4b8949){return new BPromise(function(_0x3ac26b,_0x2ac4e1){var _0x3b4da5=_0x4b8949||client;return _0x3b4da5[_0xdf39('0x1d')](_0x33f2f1,_0x51d97f)[_0xdf39('0x1e')](function(_0x3c648a){logger[_0xdf39('0x1f')](_0xdf39('0x20'),_0x59d3b9,_0xdf39('0x21'));logger[_0xdf39('0x22')](_0xdf39('0x23'),_0x59d3b9,_0xdf39('0x21'),JSON['stringify'](_0x3c648a));if(_0x3c648a[_0xdf39('0x24')]){if(_0x3c648a['error'][_0xdf39('0x25')]===0x1f4){logger[_0xdf39('0x24')]('SmsAccount,\x20%s,\x20%s',_0x59d3b9,_0x3c648a[_0xdf39('0x24')][_0xdf39('0x26')]);return _0x2ac4e1(_0x3c648a[_0xdf39('0x24')][_0xdf39('0x26')]);}logger[_0xdf39('0x24')]('SmsAccount,\x20%s,\x20%s',_0x59d3b9,_0x3c648a[_0xdf39('0x24')][_0xdf39('0x26')]);return _0x3ac26b(_0x3c648a[_0xdf39('0x24')][_0xdf39('0x26')]);}else{logger[_0xdf39('0x1f')](_0xdf39('0x20'),_0x59d3b9,_0xdf39('0x21'));_0x3ac26b(_0x3c648a['result'][_0xdf39('0x26')]);}})['catch'](function(_0x17e0a1){logger[_0xdf39('0x24')](_0xdf39('0x20'),_0x59d3b9,_0x17e0a1);_0x2ac4e1(_0x17e0a1);});});}function respondWithStatusCode(_0x1c5d72,_0x163ed7){_0x163ed7=_0x163ed7||0xcc;return function(_0x3cad5b){if(_0x3cad5b){return _0x1c5d72[_0xdf39('0x27')](_0x163ed7);}return _0x1c5d72[_0xdf39('0x28')](_0x163ed7)[_0xdf39('0x29')]();};}function respondWithResult(_0x53bbba,_0x14f687){_0x14f687=_0x14f687||0xc8;return function(_0x1be1be){if(_0x1be1be){return _0x53bbba[_0xdf39('0x28')](_0x14f687)['json'](_0x1be1be);}};}function respondWithFilteredResult(_0x535692,_0xadb04){return function(_0x145065){if(_0x145065){var _0x266e5d=_0x145065['count'],_0x1a89a4=_0xadb04[_0xdf39('0x2a')],_0x1c14bb=_0xadb04[_0xdf39('0x2a')]+_0xadb04[_0xdf39('0x2b')],_0x3c0f7d;if(_0x1c14bb>=_0x266e5d){_0x1c14bb=_0x266e5d;_0x3c0f7d=0xc8;}else{_0x3c0f7d=0xce;}_0x535692['status'](_0x3c0f7d);return _0x535692[_0xdf39('0x2c')](_0xdf39('0x2d'),_0x1a89a4+'-'+_0x1c14bb+'/'+_0x266e5d)['json'](_0x145065);}return null;};}function patchUpdates(_0x29c8d5){return function(_0x3a56ea){try{jsonpatch['apply'](_0x3a56ea,_0x29c8d5,!![]);}catch(_0x45c4dd){return BPromise[_0xdf39('0x2e')](_0x45c4dd);}return _0x3a56ea['save']();};}function saveUpdates(_0x498908,_0x4407ba){return function(_0x461aa3){if(_0x461aa3){return _0x461aa3['update'](_0x498908)[_0xdf39('0x1e')](function(_0x34d229){return _0x34d229;});}return null;};}function removeEntity(_0x2c0aed,_0x5e4d2b){return function(_0x1c9ed0){if(_0x1c9ed0){return _0x1c9ed0[_0xdf39('0x2f')]()[_0xdf39('0x1e')](function(){var _0x14867c=_0x1c9ed0[_0xdf39('0x30')]({'plain':!![]});var _0x13a031='SmsAccounts';return db['UserProfileResource'][_0xdf39('0x2f')]({'where':{'type':_0x13a031,'resourceId':_0x14867c['id']}})['then'](function(){return _0x1c9ed0;});})[_0xdf39('0x1e')](function(){_0x2c0aed[_0xdf39('0x28')](0xcc)[_0xdf39('0x29')]();});}};}function handleEntityNotFound(_0x5c920a,_0xa8d38a){return function(_0x27c6e3){if(!_0x27c6e3){_0x5c920a[_0xdf39('0x27')](0x194);}return _0x27c6e3;};}function handleError(_0x485372,_0x119509){_0x119509=_0x119509||0x1f4;return function(_0x1433cf){logger[_0xdf39('0x24')](_0x1433cf[_0xdf39('0x31')]);if(_0x1433cf[_0xdf39('0x32')]){delete _0x1433cf['name'];}_0x485372[_0xdf39('0x28')](_0x119509)[_0xdf39('0x33')](_0x1433cf);};}exports[_0xdf39('0x34')]=function(_0x35f395,_0xa37aab){var _0x304402={'include':[{'model':db[_0xdf39('0x35')],'as':_0xdf39('0x36')}]},_0x3c5fb3={},_0x494ddf={'count':0x0,'rows':[]};var _0x130ea6=db[_0xdf39('0x37')][_0xdf39('0x38')];_0x3c5fb3[_0xdf39('0x39')]=_[_0xdf39('0x3a')](_0x130ea6);_0x3c5fb3[_0xdf39('0x3b')]=_[_0xdf39('0x3a')](_0x35f395[_0xdf39('0x3b')]);_0x3c5fb3[_0xdf39('0x3c')]=_[_0xdf39('0x3d')](_0x3c5fb3['model'],_0x3c5fb3[_0xdf39('0x3b')]);_0x304402['attributes']=_[_0xdf39('0x3d')](_0x3c5fb3[_0xdf39('0x39')],qs[_0xdf39('0x3e')](_0x35f395[_0xdf39('0x3b')][_0xdf39('0x3e')]));_0x304402[_0xdf39('0x3f')]=_0x304402['attributes'][_0xdf39('0x40')]?_0x304402[_0xdf39('0x3f')]:_0x3c5fb3[_0xdf39('0x39')];if(!_0x35f395[_0xdf39('0x3b')][_0xdf39('0x41')]('nolimit')){_0x304402['limit']=qs[_0xdf39('0x2b')](_0x35f395['query'][_0xdf39('0x2b')]);_0x304402['offset']=qs[_0xdf39('0x2a')](_0x35f395['query']['offset']);}_0x304402['order']=qs['sort'](_0x35f395['query'][_0xdf39('0x42')]);_0x304402['where']=qs[_0xdf39('0x3c')](_[_0xdf39('0x43')](_0x35f395[_0xdf39('0x3b')],_0x3c5fb3['filters']));if(_0x35f395[_0xdf39('0x3b')][_0xdf39('0x44')]){_0x304402['where']=_['merge'](_0x304402['where'],{'$or':_[_0xdf39('0x45')](_0x130ea6,function(_0x2a681d){if(_0x2a681d[_0xdf39('0x46')][_0xdf39('0x47')]!==_0xdf39('0x48')){var _0x20f31d={};_0x20f31d[_0x2a681d[_0xdf39('0x49')]]={'$like':'%'+_0x35f395[_0xdf39('0x3b')][_0xdf39('0x44')]+'%'};return _0x20f31d;}})});}_0x304402=_[_0xdf39('0x4a')]({},_0x304402,_0x35f395[_0xdf39('0x4b')]);var _0x37f65d={'where':_0x304402[_0xdf39('0x4c')]};return db['SmsAccount']['count'](_0x37f65d)[_0xdf39('0x1e')](function(_0x1b6c16){_0x494ddf[_0xdf39('0x4d')]=_0x1b6c16;if(_0x35f395[_0xdf39('0x3b')]['includeAll']){_0x304402['include']=[{'all':!![]}];}return db[_0xdf39('0x37')]['findAll'](_0x304402);})['then'](function(_0x46781b){_0x494ddf[_0xdf39('0x4e')]=_0x46781b;return _0x494ddf;})[_0xdf39('0x1e')](respondWithFilteredResult(_0xa37aab,_0x304402))['catch'](handleError(_0xa37aab,null));};exports[_0xdf39('0x4f')]=function(_0x3cc7fd,_0x315357){var _0x53796b={'raw':![],'where':{'id':_0x3cc7fd[_0xdf39('0x50')]['id']},'include':[{'model':db[_0xdf39('0x35')],'as':_0xdf39('0x36')}]},_0x33ccb7={};_0x33ccb7[_0xdf39('0x39')]=_['keys'](db[_0xdf39('0x37')][_0xdf39('0x38')]);_0x33ccb7[_0xdf39('0x3b')]=_[_0xdf39('0x3a')](_0x3cc7fd[_0xdf39('0x3b')]);_0x33ccb7['filters']=_[_0xdf39('0x3d')](_0x33ccb7[_0xdf39('0x39')],_0x33ccb7[_0xdf39('0x3b')]);_0x53796b[_0xdf39('0x3f')]=_['intersection'](_0x33ccb7[_0xdf39('0x39')],qs[_0xdf39('0x3e')](_0x3cc7fd[_0xdf39('0x3b')][_0xdf39('0x3e')]));_0x53796b['attributes']=_0x53796b[_0xdf39('0x3f')][_0xdf39('0x40')]?_0x53796b['attributes']:_0x33ccb7[_0xdf39('0x39')];if(_0x3cc7fd[_0xdf39('0x3b')][_0xdf39('0x51')]){_0x53796b['include']=[{'all':!![]}];}_0x53796b=_[_0xdf39('0x4a')]({},_0x53796b,_0x3cc7fd[_0xdf39('0x4b')]);return db[_0xdf39('0x37')]['find'](_0x53796b)[_0xdf39('0x1e')](handleEntityNotFound(_0x315357,null))[_0xdf39('0x1e')](respondWithResult(_0x315357,null))[_0xdf39('0x52')](handleError(_0x315357,null));};exports[_0xdf39('0x53')]=function(_0x6d5486,_0x543d18){return db[_0xdf39('0x37')][_0xdf39('0x53')](_0x6d5486['body'],{})[_0xdf39('0x1e')](function(_0x3d0799){var _0x222109=_0x6d5486['user'][_0xdf39('0x30')]({'plain':!![]});if(!_0x222109)throw new Error(_0xdf39('0x54'));if(_0x222109['role']==='user'){var _0x490f9c=_0x3d0799['get']({'plain':!![]});var _0x3f63de=_0xdf39('0x55');return db[_0xdf39('0x56')][_0xdf39('0x57')]({'where':{'name':_0x3f63de,'userProfileId':_0x222109[_0xdf39('0x58')]},'raw':!![]})['then'](function(_0x410f2f){if(_0x410f2f&&_0x410f2f[_0xdf39('0x59')]===0x0){return db[_0xdf39('0x5a')][_0xdf39('0x53')]({'name':_0x490f9c[_0xdf39('0x32')],'resourceId':_0x490f9c['id'],'type':_0x410f2f[_0xdf39('0x32')],'sectionId':_0x410f2f['id']},{})[_0xdf39('0x1e')](function(){return _0x3d0799;});}else{return _0x3d0799;}})['catch'](function(_0x1f11ef){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f11ef);throw _0x1f11ef;});}return _0x3d0799;})[_0xdf39('0x1e')](respondWithResult(_0x543d18,0xc9))[_0xdf39('0x52')](handleError(_0x543d18,null));};exports[_0xdf39('0x5b')]=function(_0x3b063b,_0x516010){if(_0x3b063b[_0xdf39('0x5c')]['id']){delete _0x3b063b['body']['id'];}return db['SmsAccount'][_0xdf39('0x57')]({'where':{'id':_0x3b063b[_0xdf39('0x50')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xdf39('0x1e')](handleEntityNotFound(_0x516010,null))['then'](saveUpdates(_0x3b063b[_0xdf39('0x5c')],null))['then'](respondWithResult(_0x516010,null))[_0xdf39('0x52')](handleError(_0x516010,null));};exports[_0xdf39('0x2f')]=function(_0x139c6d,_0x411609){return db['SmsAccount']['find']({'where':{'id':_0x139c6d['params']['id']}})['then'](handleEntityNotFound(_0x411609,null))[_0xdf39('0x1e')](removeEntity(_0x411609,null))[_0xdf39('0x52')](handleError(_0x411609,null));};exports['describe']=function(_0x31ca5d,_0x31592f){return db['SmsAccount'][_0xdf39('0x5d')]()[_0xdf39('0x1e')](respondWithResult(_0x31592f,null))[_0xdf39('0x52')](handleError(_0x31592f,null));};exports[_0xdf39('0x5e')]=function(_0x4ac13d,_0x531aa1,_0x5a83f9){if(_0x4ac13d[_0xdf39('0x5c')]['id']){delete _0x4ac13d['body']['id'];}return db['SmsAccount'][_0xdf39('0x57')]({'where':{'id':_0x4ac13d['params']['id']}})[_0xdf39('0x1e')](handleEntityNotFound(_0x531aa1,null))[_0xdf39('0x1e')](function(_0x377f69){if(_0x377f69){_0x4ac13d[_0xdf39('0x5c')][_0xdf39('0x5f')]=_0x377f69['id'];return db[_0xdf39('0x60')][_0xdf39('0x53')](_0x4ac13d[_0xdf39('0x5c')]);}})[_0xdf39('0x1e')](respondWithResult(_0x531aa1,null))[_0xdf39('0x52')](handleError(_0x531aa1,null));};exports[_0xdf39('0x61')]=function(_0x3401a1,_0x352255,_0x302248){var _0x13da10={'raw':![],'where':{}};var _0x42ffe5={};var _0x2a2b8f={'count':0x0,'rows':[]};return db[_0xdf39('0x37')][_0xdf39('0x62')]({'where':{'id':_0x3401a1[_0xdf39('0x50')]['id']}})[_0xdf39('0x1e')](handleEntityNotFound(_0x352255,null))[_0xdf39('0x1e')](function(_0x4f1002){if(_0x4f1002){_0x42ffe5[_0xdf39('0x39')]=_['keys'](db[_0xdf39('0x60')][_0xdf39('0x38')]);_0x42ffe5['query']=_[_0xdf39('0x3a')](_0x3401a1['query']);_0x42ffe5[_0xdf39('0x3c')]=_[_0xdf39('0x3d')](_0x42ffe5[_0xdf39('0x39')],_0x42ffe5['query']);_0x13da10[_0xdf39('0x3f')]=_[_0xdf39('0x3d')](_0x42ffe5[_0xdf39('0x39')],qs[_0xdf39('0x3e')](_0x3401a1[_0xdf39('0x3b')][_0xdf39('0x3e')]));_0x13da10[_0xdf39('0x3f')]=_0x13da10[_0xdf39('0x3f')]['length']?_0x13da10['attributes']:_0x42ffe5[_0xdf39('0x39')];if(!_0x3401a1[_0xdf39('0x3b')][_0xdf39('0x41')](_0xdf39('0x63'))){_0x13da10['limit']=qs[_0xdf39('0x2b')](_0x3401a1[_0xdf39('0x3b')][_0xdf39('0x2b')]);_0x13da10['offset']=qs['offset'](_0x3401a1[_0xdf39('0x3b')][_0xdf39('0x2a')]);}_0x13da10['order']=qs[_0xdf39('0x42')](_0x3401a1[_0xdf39('0x3b')][_0xdf39('0x42')]);_0x13da10['where']=qs[_0xdf39('0x3c')](_[_0xdf39('0x43')](_0x3401a1[_0xdf39('0x3b')],_0x42ffe5[_0xdf39('0x3c')]));_0x13da10[_0xdf39('0x4c')][_0xdf39('0x5f')]=_0x4f1002['id'];if(_0x3401a1[_0xdf39('0x3b')][_0xdf39('0x44')]){_0x13da10[_0xdf39('0x4c')]=_[_0xdf39('0x4a')](_0x13da10['where'],{'$or':_[_0xdf39('0x45')](_0x13da10[_0xdf39('0x3f')],function(_0x4d4e85){var _0x4c496a={};_0x4c496a[_0x4d4e85]={'$like':'%'+_0x3401a1[_0xdf39('0x3b')][_0xdf39('0x44')]+'%'};return _0x4c496a;})});}_0x13da10=_[_0xdf39('0x4a')]({},_0x13da10,_0x3401a1['options']);return db[_0xdf39('0x60')][_0xdf39('0x4d')]({'where':_0x13da10['where']})[_0xdf39('0x1e')](function(_0x2f3be9){_0x2a2b8f[_0xdf39('0x4d')]=_0x2f3be9;if(_0x3401a1[_0xdf39('0x3b')][_0xdf39('0x51')]){_0x13da10[_0xdf39('0x64')]=[{'all':!![]}];}return db['Disposition'][_0xdf39('0x65')](_0x13da10);})[_0xdf39('0x1e')](function(_0x4d7931){_0x2a2b8f[_0xdf39('0x4e')]=_0x4d7931;return _0x2a2b8f;});}})[_0xdf39('0x1e')](respondWithFilteredResult(_0x352255,_0x13da10))[_0xdf39('0x52')](handleError(_0x352255,null));};exports[_0xdf39('0x66')]=function(_0xcc557d,_0x4f4f30,_0x3fad67){return db['SmsAccount'][_0xdf39('0x57')]({'where':{'id':_0xcc557d['params']['id']}})[_0xdf39('0x1e')](handleEntityNotFound(_0x4f4f30,null))['then'](function(_0x60534a){if(_0x60534a){return _0x60534a['removeDispositions'](_0xcc557d[_0xdf39('0x3b')][_0xdf39('0x67')]);}})['then'](respondWithStatusCode(_0x4f4f30,null))[_0xdf39('0x52')](handleError(_0x4f4f30,null));};exports['addAnswer']=function(_0x26f5f3,_0x44e1f8,_0x28c41a){if(_0x26f5f3[_0xdf39('0x5c')]['id']){delete _0x26f5f3['body']['id'];}return db[_0xdf39('0x37')][_0xdf39('0x57')]({'where':{'id':_0x26f5f3['params']['id']}})[_0xdf39('0x1e')](handleEntityNotFound(_0x44e1f8,null))[_0xdf39('0x1e')](function(_0x3a1784){if(_0x3a1784){_0x26f5f3['body'][_0xdf39('0x5f')]=_0x3a1784['id'];return db[_0xdf39('0x68')][_0xdf39('0x53')](_0x26f5f3['body']);}})['then'](respondWithResult(_0x44e1f8,null))['catch'](handleError(_0x44e1f8,null));};exports['getAnswers']=function(_0x28ff48,_0x3be218,_0x1d564a){var _0x21099={'raw':![],'where':{}};var _0xd38874={};var _0x340be3={'count':0x0,'rows':[]};return db[_0xdf39('0x37')]['findOne']({'where':{'id':_0x28ff48[_0xdf39('0x50')]['id']}})[_0xdf39('0x1e')](handleEntityNotFound(_0x3be218,null))['then'](function(_0x13dc5f){if(_0x13dc5f){_0xd38874['model']=_[_0xdf39('0x3a')](db[_0xdf39('0x68')][_0xdf39('0x38')]);_0xd38874[_0xdf39('0x3b')]=_[_0xdf39('0x3a')](_0x28ff48[_0xdf39('0x3b')]);_0xd38874['filters']=_['intersection'](_0xd38874[_0xdf39('0x39')],_0xd38874['query']);_0x21099['attributes']=_[_0xdf39('0x3d')](_0xd38874[_0xdf39('0x39')],qs['fields'](_0x28ff48['query'][_0xdf39('0x3e')]));_0x21099['attributes']=_0x21099[_0xdf39('0x3f')]['length']?_0x21099[_0xdf39('0x3f')]:_0xd38874['model'];if(!_0x28ff48[_0xdf39('0x3b')]['hasOwnProperty'](_0xdf39('0x63'))){_0x21099['limit']=qs[_0xdf39('0x2b')](_0x28ff48[_0xdf39('0x3b')][_0xdf39('0x2b')]);_0x21099['offset']=qs[_0xdf39('0x2a')](_0x28ff48[_0xdf39('0x3b')][_0xdf39('0x2a')]);}_0x21099[_0xdf39('0x69')]=qs[_0xdf39('0x42')](_0x28ff48['query'][_0xdf39('0x42')]);_0x21099['where']=qs[_0xdf39('0x3c')](_[_0xdf39('0x43')](_0x28ff48[_0xdf39('0x3b')],_0xd38874[_0xdf39('0x3c')]));_0x21099[_0xdf39('0x4c')]['SmsAccountId']=_0x13dc5f['id'];if(_0x28ff48[_0xdf39('0x3b')][_0xdf39('0x44')]){_0x21099[_0xdf39('0x4c')]=_[_0xdf39('0x4a')](_0x21099[_0xdf39('0x4c')],{'$or':_['map'](_0x21099[_0xdf39('0x3f')],function(_0x14748e){var _0x2c4eb4={};_0x2c4eb4[_0x14748e]={'$like':'%'+_0x28ff48[_0xdf39('0x3b')][_0xdf39('0x44')]+'%'};return _0x2c4eb4;})});}_0x21099=_[_0xdf39('0x4a')]({},_0x21099,_0x28ff48[_0xdf39('0x4b')]);return db['CannedAnswer'][_0xdf39('0x4d')]({'where':_0x21099[_0xdf39('0x4c')]})[_0xdf39('0x1e')](function(_0x59fb6e){_0x340be3[_0xdf39('0x4d')]=_0x59fb6e;if(_0x28ff48[_0xdf39('0x3b')][_0xdf39('0x51')]){_0x21099[_0xdf39('0x64')]=[{'all':!![]}];}return db[_0xdf39('0x68')][_0xdf39('0x65')](_0x21099);})[_0xdf39('0x1e')](function(_0xa925f1){_0x340be3[_0xdf39('0x4e')]=_0xa925f1;return _0x340be3;});}})[_0xdf39('0x1e')](respondWithFilteredResult(_0x3be218,_0x21099))[_0xdf39('0x52')](handleError(_0x3be218,null));};exports[_0xdf39('0x6a')]=function(_0x537740,_0x582e4f,_0x3138c7){return db[_0xdf39('0x37')]['find']({'where':{'id':_0x537740[_0xdf39('0x50')]['id']}})['then'](handleEntityNotFound(_0x582e4f,null))[_0xdf39('0x1e')](function(_0x7bc3bd){if(_0x7bc3bd){return _0x7bc3bd[_0xdf39('0x6a')](_0x537740['query']['ids']);}})[_0xdf39('0x1e')](respondWithStatusCode(_0x582e4f,null))[_0xdf39('0x52')](handleError(_0x582e4f,null));};exports[_0xdf39('0x6b')]=function(_0x304942,_0x173f66,_0x21d4b6){var _0x5a53d7={'channel':_0xdf39('0x6c')};var _0x8bdff3=[];var _0x59cd0f=[];var _0x1d1060={};return db[_0xdf39('0x37')][_0xdf39('0x57')]({'where':{'id':_0x304942[_0xdf39('0x50')]['id']},'include':[{'model':db[_0xdf39('0x6d')],'as':_0xdf39('0x6e')}]})['then'](handleEntityNotFound(_0x173f66,null))[_0xdf39('0x1e')](function(_0x1ca06a){_0x5a53d7[_0xdf39('0x6f')]=_0x1ca06a;_0x5a53d7['applications']=_[_0xdf39('0x70')](_0x1ca06a[_0xdf39('0x6e')],['priority'],['asc']);if(_0x5a53d7['account'][_0xdf39('0x6e')]){delete _0x5a53d7[_0xdf39('0x6f')][_0xdf39('0x6e')];}return db[_0xdf39('0x71')][_0xdf39('0x5d')]();})[_0xdf39('0x1e')](function(_0x250cc4){if(!_0x250cc4){throw new db[(_0xdf39('0x72'))]['ValidationError']('no\x20available\x20attributes');}_0x8bdff3=_[_0xdf39('0x73')](_[_0xdf39('0x3a')](_0x250cc4),[_0xdf39('0x74'),'updatedAt']);_0x59cd0f=_[_0xdf39('0x73')](_[_0xdf39('0x3a')](_0x250cc4),['createdAt',_0xdf39('0x75'),'CompanyId',_0xdf39('0x76')]);_0x5a53d7[_0xdf39('0x5c')]={'mapKey':_0xdf39('0x77')};if(_0x5a53d7[_0xdf39('0x6f')][_0xdf39('0x46')]){switch(_0x5a53d7[_0xdf39('0x6f')][_0xdf39('0x46')]){case'twilio':_0x5a53d7[_0xdf39('0x5c')][_0xdf39('0x78')]=_0x304942[_0xdf39('0x5c')][_0xdf39('0x79')];_0x5a53d7['body']['body']=_0x304942[_0xdf39('0x5c')][_0xdf39('0x7a')];_0x5a53d7['body']['messageId']=_0x304942[_0xdf39('0x5c')][_0xdf39('0x7b')];break;case'skebby':_0x5a53d7[_0xdf39('0x5c')]['from']='+'+_0x304942[_0xdf39('0x5c')]['sender'];_0x5a53d7[_0xdf39('0x5c')][_0xdf39('0x5c')]=_0x304942[_0xdf39('0x5c')][_0xdf39('0x7c')];break;case'connectel':_0x5a53d7[_0xdf39('0x5c')][_0xdf39('0x78')]=_0x304942['body']['from'];_0x5a53d7[_0xdf39('0x5c')]['body']=_0x304942[_0xdf39('0x5c')]['message'];break;case _0xdf39('0x7d'):_0x5a53d7[_0xdf39('0x5c')][_0xdf39('0x78')]=_0x304942[_0xdf39('0x5c')]['from'];_0x5a53d7[_0xdf39('0x5c')][_0xdf39('0x5c')]=_0x304942['body'][_0xdf39('0x5c')];_0x5a53d7[_0xdf39('0x5c')]['messageId']=_0x304942[_0xdf39('0x5c')][_0xdf39('0x7e')];break;case _0xdf39('0x7f'):_0x5a53d7[_0xdf39('0x5c')]['from']=_0x304942[_0xdf39('0x5c')][_0xdf39('0x79')];_0x5a53d7[_0xdf39('0x5c')]['body']=_0x304942[_0xdf39('0x5c')][_0xdf39('0x80')];_0x5a53d7[_0xdf39('0x5c')][_0xdf39('0x81')]=_0x304942[_0xdf39('0x5c')][_0xdf39('0x82')];break;case _0xdf39('0x83'):_0x5a53d7[_0xdf39('0x5c')][_0xdf39('0x78')]='+'+_0x304942[_0xdf39('0x5c')][_0xdf39('0x84')][0x0][_0xdf39('0x78')];_0x5a53d7['body'][_0xdf39('0x5c')]=_0x304942['body'][_0xdf39('0x84')][0x0]['text'];_0x5a53d7[_0xdf39('0x5c')][_0xdf39('0x81')]=_0x304942['body']['results'][0x0][_0xdf39('0x81')];break;case _0xdf39('0x85'):_0x5a53d7['body']['from']=_0x304942[_0xdf39('0x5c')]['originatingAddress'];_0x5a53d7[_0xdf39('0x5c')][_0xdf39('0x5c')]=_0x304942[_0xdf39('0x5c')]['segmentedMessage'][_0xdf39('0x26')];break;case'clickatell':_0x5a53d7['body'][_0xdf39('0x78')]=_0x304942[_0xdf39('0x5c')][_0xdf39('0x86')];_0x5a53d7['body']['body']=_0x304942[_0xdf39('0x5c')][_0xdf39('0x7c')];_0x5a53d7[_0xdf39('0x5c')][_0xdf39('0x81')]=_0x304942[_0xdf39('0x5c')][_0xdf39('0x87')];break;case'intelepeer':_0x5a53d7[_0xdf39('0x5c')][_0xdf39('0x78')]=_0x304942[_0xdf39('0x5c')][_0xdf39('0x78')];_0x5a53d7[_0xdf39('0x5c')][_0xdf39('0x5c')]=_0x304942['body'][_0xdf39('0x26')];_0x5a53d7['body'][_0xdf39('0x81')]=_0x304942['body'][_0xdf39('0x88')];break;}}if(_0x5a53d7[_0xdf39('0x5c')]['id']){delete _0x5a53d7[_0xdf39('0x5c')]['id'];}if(_[_0xdf39('0x89')](_0x5a53d7[_0xdf39('0x5c')][_0xdf39('0x78')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x5a53d7['body']['body'])||_0x5a53d7[_0xdf39('0x5c')]['body']===''){throw new db[(_0xdf39('0x72'))][(_0xdf39('0x8a'))](_0xdf39('0x8b'));}if(_[_0xdf39('0x89')](_0x5a53d7[_0xdf39('0x5c')]['mapKey'])){throw new db[(_0xdf39('0x72'))][(_0xdf39('0x8a'))](_0xdf39('0x8c')+_0x59cd0f);}if(!_[_0xdf39('0x8d')](_0x59cd0f,_0x5a53d7[_0xdf39('0x5c')][_0xdf39('0x8e')])){throw new db[(_0xdf39('0x72'))][(_0xdf39('0x8a'))](_0xdf39('0x8f')+_0x59cd0f);}_0x1d1060[_0x5a53d7['body'][_0xdf39('0x8e')]]=_0x5a53d7[_0xdf39('0x5c')][_0xdf39('0x78')];return db[_0xdf39('0x90')]['find']({'where':{'id':_0x5a53d7[_0xdf39('0x6f')][_0xdf39('0x76')]},'include':[{'model':db[_0xdf39('0x71')],'as':_0xdf39('0x91'),'where':_0x1d1060,'limit':0x1,'order':[[_0xdf39('0x75'),_0xdf39('0x92')]]}]});})[_0xdf39('0x1e')](handleEntityNotFound(_0x173f66,null))[_0xdf39('0x1e')](function(_0x1551cf){if(_0x1551cf){_0x5a53d7['list']=_['omit'](_0x1551cf,['Contacts']);if(_0x1551cf[_0xdf39('0x91')][_0xdf39('0x40')]){return _0x1551cf[_0xdf39('0x91')][0x0];}var _0xd3a76e=_[_0xdf39('0x16')](_0x5a53d7[_0xdf39('0x5c')],{'firstName':_0x5a53d7[_0xdf39('0x5c')][_0xdf39('0x78')],'ListId':_0x1551cf['id']});_0xd3a76e[_0x5a53d7[_0xdf39('0x5c')][_0xdf39('0x8e')]]=_0x5a53d7[_0xdf39('0x5c')][_0xdf39('0x78')];return db['CmContact'][_0xdf39('0x53')](_0xd3a76e,{'fields':_0x8bdff3,'raw':!![]});}})['then'](handleEntityNotFound(_0x173f66,null))[_0xdf39('0x1e')](function(_0x2c848e){if(_0x2c848e){_0x5a53d7[_0xdf39('0x93')]=_0x2c848e;var _0x1f73b8={'ContactId':_0x2c848e['id'],'phone':_0x5a53d7[_0xdf39('0x5c')][_0xdf39('0x78')],'SmsAccountId':_0x304942[_0xdf39('0x50')]['id']};var _0x5874bd={'ContactId':_0x2c848e['id'],'SmsAccountId':_0x304942['params']['id'],'closed':![]};return db[_0xdf39('0x94')]['find']({'where':_0x5874bd})[_0xdf39('0x1e')](function(_0x16cf80){if(_0x16cf80){return[_0x16cf80,![]];}return db[_0xdf39('0x94')][_0xdf39('0x53')](_0x1f73b8)[_0xdf39('0x1e')](function(_0x16c28c){return[_0x16c28c,!![]];});});}})[_0xdf39('0x95')](function(_0x5075b3,_0x506b3d){_0x5a53d7[_0xdf39('0x96')]=_0x5075b3[_0xdf39('0x30')]({'plain':!![]});_0x5a53d7['interaction'][_0xdf39('0x97')]=![];if(_0x506b3d){if(_0x5a53d7[_0xdf39('0x6f')][_0xdf39('0x98')]){_0x5a53d7[_0xdf39('0x99')][_0xdf39('0x9a')]({'id':0x0,'priority':_0x5a53d7[_0xdf39('0x99')][_0xdf39('0x40')]+0x1,'app':_0xdf39('0x9b'),'appdata':_0xdf39('0x9c'),'interval':_0xdf39('0x9d')});}_0x5a53d7[_0xdf39('0x96')][_0xdf39('0x97')]=!![];}return db[_0xdf39('0x9e')]['create']({'phone':_0x5a53d7['body'][_0xdf39('0x78')],'messageId':_0x5a53d7[_0xdf39('0x5c')][_0xdf39('0x81')],'body':_0x5a53d7[_0xdf39('0x5c')][_0xdf39('0x5c')],'SmsAccountId':_0x304942[_0xdf39('0x50')]['id'],'SmsInteractionId':_0x5075b3['id'],'direction':'in','ContactId':_0x5075b3[_0xdf39('0x9f')],'AttachmentId':_0x5a53d7[_0xdf39('0x5c')][_0xdf39('0xa0')]});})['then'](function(_0x18a3a9){_0x5a53d7[_0xdf39('0x26')]=_0x18a3a9;if(_0x5a53d7[_0xdf39('0x96')][_0xdf39('0xa1')]){return db['User'][_0xdf39('0x57')]({'attributes':['id',_0xdf39('0x32')],'where':{'id':_0x5a53d7[_0xdf39('0x96')][_0xdf39('0xa1')]}})[_0xdf39('0x1e')](function(_0x2c9c28){if(_0x2c9c28){_0x5a53d7['applications'][_0xdf39('0xa2')]({'id':0x0,'priority':0x0,'app':_0xdf39('0xa3'),'appdata':_0x2c9c28[_0xdf39('0x32')]+','+(_0x5a53d7[_0xdf39('0x6f')][_0xdf39('0xa4')]||0xa),'interval':_0xdf39('0x9d')});}return respondWithRpcPromise(_0xdf39('0xa5'),'startRouting',_0x5a53d7);});}return respondWithRpcPromise(_0xdf39('0xa5'),_0xdf39('0xa6'),_0x5a53d7);})[_0xdf39('0x1e')](function(_0x24a25){if(_0x24a25){var _0x3f8006=0xc8;var _0x295812=_0xdf39('0xa7');logger[_0xdf39('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x295812,_0x3f8006,_0xdf39('0xa8'));logger[_0xdf39('0x22')](_0xdf39('0xa9'),_0x295812,_0x3f8006,'entity\x20found',JSON[_0xdf39('0xaa')](_0x24a25));if(_0x5a53d7[_0xdf39('0x6f')]['type']===_0xdf39('0xab')){return _0x173f66[_0xdf39('0x28')](_0x3f8006)['set'](_0xdf39('0xac'),'text/xml')['send']('\x0a');}else{return _0x173f66[_0xdf39('0x28')](_0x3f8006)[_0xdf39('0xad')](_0x24a25);}}})['catch'](handleError(_0x173f66,null));};exports[_0xdf39('0xae')]=function(_0x278e66,_0x1af1c7,_0x4f10e7){return db[_0xdf39('0x37')]['findOne']({'where':{'id':_0x278e66[_0xdf39('0x50')]['id']}})[_0xdf39('0x1e')](handleEntityNotFound(_0x1af1c7,null))[_0xdf39('0x1e')](function(_0x551ffa){if(_0x551ffa){return db[_0xdf39('0xaf')]['transaction'](function(_0x4b9738){return db['SmsApplication'][_0xdf39('0x2f')]({'where':{'SmsAccountId':_0x278e66[_0xdf39('0x50')]['id']},'transaction':_0x4b9738})[_0xdf39('0x1e')](function(_0x3a484f){var _0x24fba9=_['map'](_0x278e66[_0xdf39('0x5c')],function(_0x107f01){_0x107f01[_0xdf39('0x5f')]=_0x278e66['params']['id'];return _0x107f01;});return db['SmsApplication'][_0xdf39('0xb0')](_0x24fba9,{'transaction':_0x4b9738});});})[_0xdf39('0x1e')](function(){return db[_0xdf39('0x6d')]['findAndCountAll']({'where':{'SmsAccountId':_0x278e66[_0xdf39('0x50')]['id']},'order':_0xdf39('0xb1')});});}})['then'](respondWithResult(_0x1af1c7,null))[_0xdf39('0x52')](handleError(_0x1af1c7,null));};exports[_0xdf39('0xb2')]=function(_0xb99bf9,_0x5cf4d1,_0x2b232f){var _0x4c4c0f={};var _0x5873f5={};var _0x28e9e5;var _0x14a7de;return db[_0xdf39('0x37')][_0xdf39('0x62')]({'where':{'id':_0xb99bf9[_0xdf39('0x50')]['id']}})[_0xdf39('0x1e')](handleEntityNotFound(_0x5cf4d1,null))[_0xdf39('0x1e')](function(_0x4c4ef4){if(_0x4c4ef4){_0x28e9e5=_0x4c4ef4;_0x5873f5[_0xdf39('0x39')]=_[_0xdf39('0x3a')](db[_0xdf39('0x6d')]['rawAttributes']);_0x5873f5[_0xdf39('0x3b')]=_[_0xdf39('0x3a')](_0xb99bf9[_0xdf39('0x3b')]);_0x5873f5['filters']=_[_0xdf39('0x3d')](_0x5873f5[_0xdf39('0x39')],_0x5873f5['query']);_0x4c4c0f[_0xdf39('0x3f')]=_[_0xdf39('0x3d')](_0x5873f5[_0xdf39('0x39')],qs[_0xdf39('0x3e')](_0xb99bf9[_0xdf39('0x3b')][_0xdf39('0x3e')]));_0x4c4c0f[_0xdf39('0x3f')]=_0x4c4c0f[_0xdf39('0x3f')]['length']?_0x4c4c0f[_0xdf39('0x3f')]:_0x5873f5[_0xdf39('0x39')];_0x4c4c0f[_0xdf39('0x69')]=qs[_0xdf39('0x42')](_0xb99bf9[_0xdf39('0x3b')][_0xdf39('0x42')]);_0x4c4c0f[_0xdf39('0x4c')]=qs[_0xdf39('0x3c')](_['pick'](_0xb99bf9[_0xdf39('0x3b')],_0x5873f5[_0xdf39('0x3c')]));if(_0xb99bf9[_0xdf39('0x3b')][_0xdf39('0x44')]){_0x4c4c0f[_0xdf39('0x4c')]=_['merge'](_0x4c4c0f[_0xdf39('0x4c')],{'$or':_[_0xdf39('0x45')](_0x4c4c0f['attributes'],function(_0x542f71){var _0x38c6e0={};_0x38c6e0[_0x542f71]={'$like':'%'+_0xb99bf9[_0xdf39('0x3b')][_0xdf39('0x44')]+'%'};return _0x38c6e0;})});}_0x4c4c0f=_[_0xdf39('0x4a')]({},_0x4c4c0f,_0xb99bf9[_0xdf39('0x4b')]);return _0x28e9e5['getApplications'](_0x4c4c0f);}})['then'](function(_0x24f4cb){if(_0x24f4cb){_0x14a7de=_0x24f4cb[_0xdf39('0x40')];if(!_0xb99bf9['query']['hasOwnProperty'](_0xdf39('0x63'))){_0x4c4c0f['limit']=qs[_0xdf39('0x2b')](_0xb99bf9['query'][_0xdf39('0x2b')]);_0x4c4c0f[_0xdf39('0x2a')]=qs[_0xdf39('0x2a')](_0xb99bf9[_0xdf39('0x3b')][_0xdf39('0x2a')]);}return _0x28e9e5[_0xdf39('0xb2')](_0x4c4c0f);}})[_0xdf39('0x1e')](function(_0xe3ddd2){if(_0xe3ddd2){return _0xe3ddd2?{'count':_0x14a7de,'rows':_0xe3ddd2}:null;}})[_0xdf39('0x1e')](respondWithResult(_0x5cf4d1,null))[_0xdf39('0x52')](handleError(_0x5cf4d1,null));};exports[_0xdf39('0xb3')]=function(_0x2ad34f,_0x22558f,_0x268225){var _0x33c3f8={'raw':![],'where':{}};var _0x305ff2={};var _0x5affc3={'count':0x0,'rows':[]};return db[_0xdf39('0x37')]['findOne']({'where':{'id':_0x2ad34f[_0xdf39('0x50')]['id']}})[_0xdf39('0x1e')](handleEntityNotFound(_0x22558f,null))['then'](function(_0x52f165){if(_0x52f165){_0x305ff2[_0xdf39('0x39')]=_[_0xdf39('0x3a')](db[_0xdf39('0x94')]['rawAttributes']);_0x305ff2[_0xdf39('0x3b')]=_['keys'](_0x2ad34f[_0xdf39('0x3b')]);_0x305ff2[_0xdf39('0x3c')]=_[_0xdf39('0x3d')](_0x305ff2[_0xdf39('0x39')],_0x305ff2[_0xdf39('0x3b')]);_0x33c3f8[_0xdf39('0x3f')]=_[_0xdf39('0x3d')](_0x305ff2[_0xdf39('0x39')],qs[_0xdf39('0x3e')](_0x2ad34f['query'][_0xdf39('0x3e')]));_0x33c3f8[_0xdf39('0x3f')]=_0x33c3f8[_0xdf39('0x3f')][_0xdf39('0x40')]?_0x33c3f8[_0xdf39('0x3f')]:_0x305ff2['model'];if(!_0x2ad34f[_0xdf39('0x3b')][_0xdf39('0x41')]('nolimit')){_0x33c3f8[_0xdf39('0x2b')]=qs[_0xdf39('0x2b')](_0x2ad34f[_0xdf39('0x3b')][_0xdf39('0x2b')]);_0x33c3f8['offset']=qs[_0xdf39('0x2a')](_0x2ad34f['query'][_0xdf39('0x2a')]);}_0x33c3f8[_0xdf39('0x69')]=qs['sort'](_0x2ad34f[_0xdf39('0x3b')][_0xdf39('0x42')]);_0x33c3f8[_0xdf39('0x4c')]=qs[_0xdf39('0x3c')](_[_0xdf39('0x43')](_0x2ad34f[_0xdf39('0x3b')],_0x305ff2[_0xdf39('0x3c')]));_0x33c3f8[_0xdf39('0x4c')][_0xdf39('0x5f')]=_0x52f165['id'];if(_0x2ad34f[_0xdf39('0x3b')][_0xdf39('0x44')]){_0x33c3f8[_0xdf39('0x4c')]=_[_0xdf39('0x4a')](_0x33c3f8[_0xdf39('0x4c')],{'$or':_[_0xdf39('0x45')](_0x33c3f8[_0xdf39('0x3f')],function(_0x41fce2){var _0x538116={};_0x538116[_0x41fce2]={'$like':'%'+_0x2ad34f[_0xdf39('0x3b')][_0xdf39('0x44')]+'%'};return _0x538116;})});}_0x33c3f8=_[_0xdf39('0x4a')]({},_0x33c3f8,_0x2ad34f['options']);return db[_0xdf39('0x94')][_0xdf39('0x4d')]({'where':_0x33c3f8[_0xdf39('0x4c')]})[_0xdf39('0x1e')](function(_0x52db67){_0x5affc3['count']=_0x52db67;if(_0x2ad34f[_0xdf39('0x3b')][_0xdf39('0x51')]){_0x33c3f8[_0xdf39('0x64')]=[{'model':db[_0xdf39('0x71')],'as':_0xdf39('0xb4'),'required':![]},{'model':db[_0xdf39('0xb5')],'as':'Owner','attributes':[_0xdf39('0x32'),'fullname',_0xdf39('0xb6')],'required':![]},{'model':db[_0xdf39('0xb7')],'as':'Tags','attributes':['id',_0xdf39('0x32'),_0xdf39('0xb8')],'where':_0x2ad34f['query'][_0xdf39('0xb9')]?{'id':_0x2ad34f[_0xdf39('0x3b')]['tag']}:undefined,'required':_0x2ad34f[_0xdf39('0x3b')][_0xdf39('0xb9')]?!![]:![]}];}return db['SmsInteraction'][_0xdf39('0x65')](_0x33c3f8);})[_0xdf39('0x1e')](function(_0x4301fc){_0x5affc3['rows']=_0x4301fc;return _0x5affc3;});}})['then'](respondWithFilteredResult(_0x22558f,_0x33c3f8))[_0xdf39('0x52')](handleError(_0x22558f,null));};exports[_0xdf39('0x33')]=function(_0x1416f5,_0x175fb7,_0x35d6f5){var _0x6012c9,_0x3a3aca,_0x211cb9;if(_[_0xdf39('0x89')](_0x1416f5[_0xdf39('0x5c')][_0xdf39('0x5c')])||_0x1416f5[_0xdf39('0x5c')][_0xdf39('0x5c')]===''){throw new db[(_0xdf39('0x72'))][(_0xdf39('0x8a'))](_0xdf39('0x8b'));}if(_[_0xdf39('0x89')](_0x1416f5[_0xdf39('0x5c')]['to'])){throw new db['Sequelize']['ValidationError']('to\x20is\x20mandatory');}_0x6012c9=_0x1416f5[_0xdf39('0x5c')]['to'];return db[_0xdf39('0x37')]['find']({'where':{'id':_0x1416f5[_0xdf39('0x50')]['id']},'include':[{'model':db[_0xdf39('0x90')],'as':'List','include':[{'model':db[_0xdf39('0x71')],'as':_0xdf39('0x91'),'where':{'mobile':_0x6012c9},'limit':0x1,'order':[['updatedAt',_0xdf39('0x92')]]}]}]})[_0xdf39('0x1e')](handleEntityNotFound(_0x175fb7,null))[_0xdf39('0x1e')](function(_0x2a86c3){if(_0x2a86c3&&_0x2a86c3['List']){_0x3a3aca=_0x2a86c3['get']({'plain':!![]});if(_0x3a3aca['List']&&_0x3a3aca[_0xdf39('0xba')][_0xdf39('0x91')]['length']){return _0x3a3aca['List'][_0xdf39('0x91')][0x0];}return db['CmContact'][_0xdf39('0x53')](_['defaults'](_0x1416f5[_0xdf39('0x5c')],{'firstName':_0x6012c9,'mobile':_0x6012c9,'phone':_0x6012c9,'ListId':_0x3a3aca['ListId']}));}})[_0xdf39('0x1e')](handleEntityNotFound(_0x175fb7,null))[_0xdf39('0x1e')](function(_0x35e4e2){if(_0x35e4e2){_0x211cb9=_0x35e4e2;return db[_0xdf39('0x94')][_0xdf39('0x57')]({'where':{'ContactId':_0x211cb9['id'],'closed':![],'SmsAccountId':_0x3a3aca['id']}})[_0xdf39('0x1e')](function(_0x105c45){if(_0x105c45){return[_0x105c45,![]];}return db[_0xdf39('0x94')][_0xdf39('0x53')]({'UserId':_0x1416f5[_0xdf39('0xbb')]['id'],'ContactId':_0x211cb9['id'],'SmsAccountId':_0x3a3aca['id'],'phone':_0x6012c9,'firstMsgDirection':_0xdf39('0xbc'),'Messages':[_['merge'](_0x1416f5[_0xdf39('0x5c')],{'read':![],'body':_0x1416f5[_0xdf39('0x5c')][_0xdf39('0x5c')],'phone':_0x6012c9,'SmsAccountId':_0x3a3aca['id'],'UserId':_0x1416f5[_0xdf39('0xbb')]['id'],'ContactId':_0x211cb9['id']})]},{'include':[{'model':db[_0xdf39('0x9e')],'as':_0xdf39('0xbd')}]})['then'](function(_0x51520a){return[_0x51520a,!![]];});});}})[_0xdf39('0x95')](function(_0x483416,_0x4c2419){if(_0x4c2419){return _0x483416;}return db[_0xdf39('0x9e')][_0xdf39('0x53')](_[_0xdf39('0x4a')](_0x1416f5[_0xdf39('0x5c')],{'read':![],'body':_0x1416f5[_0xdf39('0x5c')][_0xdf39('0x5c')],'phone':_0x6012c9,'SmsAccountId':_0x3a3aca['id'],'SmsInteractionId':_0x483416['id'],'UserId':_0x1416f5[_0xdf39('0xbb')]['id'],'ContactId':_0x211cb9['id']}))['then'](function(_0x483759){_0x483416['dataValues'][_0xdf39('0xbd')]=[];_0x483416['dataValues']['Messages'][_0xdf39('0x9a')](_0x483759['dataValues']);return _0x483416;});})['then'](respondWithResult(_0x175fb7,null))[_0xdf39('0x52')](handleError(_0x175fb7,null));};exports[_0xdf39('0x28')]=function(_0x5a7812,_0x58866d,_0x4c93cc){if(_0x5a7812[_0xdf39('0x5c')]['id']){delete _0x5a7812[_0xdf39('0x5c')]['id'];}console[_0xdf39('0xbe')](_0xdf39('0xbf'),_0x5a7812[_0xdf39('0x5c')]);var _0x5dd0ef,_0x93084b,_0x1a6e22;return db[_0xdf39('0x37')][_0xdf39('0x57')]({'where':{'id':_0x5a7812[_0xdf39('0x50')]['id']}})['then'](handleEntityNotFound(_0x58866d,null))[_0xdf39('0x1e')](function(_0x4e943e){if(_0x4e943e){_0x1a6e22=_0x4e943e;logger[_0xdf39('0x22')](_0xdf39('0x23'),'status','received\x20delivery\x20report\x20from',_0x4e943e[_0xdf39('0x46')],util[_0xdf39('0xc0')](_0x5a7812[_0xdf39('0x5c')],{'showHidden':![],'depth':null}));switch(_0x4e943e[_0xdf39('0x46')]){case _0xdf39('0xc1'):if(_0x5a7812['body']['skebby_dispatch_id']&&_0x5a7812[_0xdf39('0x5c')]['status']){_0x93084b=_0x5a7812[_0xdf39('0x5c')][_0xdf39('0x28')];return db['SmsMessage'][_0xdf39('0x57')]({'where':{'messageId':_0x5a7812['body'][_0xdf39('0xc2')]}});}break;case _0xdf39('0xc3'):if(_0x5a7812[_0xdf39('0x5c')]['requestid']&&_0x5a7812[_0xdf39('0x5c')][_0xdf39('0xc4')]){_0x93084b=_0x5a7812['body']['statusInt'];return db[_0xdf39('0x9e')][_0xdf39('0x57')]({'where':{'messageId':_0x5a7812[_0xdf39('0x5c')][_0xdf39('0xc5')]}});}break;case _0xdf39('0x7d'):if(_0x5a7812['body']['message_id']&&_0x5a7812[_0xdf39('0x5c')][_0xdf39('0xc6')]){_0x93084b=_0x5a7812['body'][_0xdf39('0xc6')];return db['SmsMessage']['find']({'where':{'messageId':_0x5a7812[_0xdf39('0x5c')][_0xdf39('0x7e')]}});}break;case'infobip':var _0x235b51=_0x5a7812[_0xdf39('0x5c')][_0xdf39('0x84')][0x0];if(_0x235b51[_0xdf39('0x81')]&&_0x235b51[_0xdf39('0x28')][_0xdf39('0xc7')]===_0xdf39('0xc8')){_0x93084b=_0x235b51[_0xdf39('0x28')]['groupName'];return db['SmsMessage'][_0xdf39('0x57')]({'where':{'messageId':_0x235b51[_0xdf39('0x81')]}});}break;case _0xdf39('0xc9'):if(_0x5a7812[_0xdf39('0x5c')][_0xdf39('0x81')]&&_0x5a7812[_0xdf39('0x5c')][_0xdf39('0x28')]){_0x93084b=_0x5a7812[_0xdf39('0x5c')]['status'];return db[_0xdf39('0x9e')][_0xdf39('0x57')]({'where':{'messageId':_0x5a7812['body']['messageId']}});}break;case'intelepeer':if(_0x5a7812['body'][_0xdf39('0xca')]&&_0x5a7812[_0xdf39('0x5c')][_0xdf39('0x28')]){_0x93084b=_0x5a7812[_0xdf39('0x5c')][_0xdf39('0x28')];return db[_0xdf39('0x9e')]['find']({'where':{'messageId':_0x5a7812[_0xdf39('0x5c')][_0xdf39('0xca')]}});}break;}}})[_0xdf39('0x1e')](handleEntityNotFound(_0x58866d,null))[_0xdf39('0x1e')](function(_0x9647b5){if(_0x9647b5){_0x5dd0ef=_0x9647b5;switch(_0x1a6e22[_0xdf39('0x46')]){case'skebby':if(_0x93084b===_0xdf39('0xc8')){return _0x5dd0ef[_0xdf39('0x5b')]({'read':!![]});}else{logger[_0xdf39('0x24')](_0xdf39('0x23'),_0xdf39('0x28'),_0xdf39('0xc1'),util[_0xdf39('0xc0')](_0x5a7812['body'],{'showHidden':![],'depth':null}));}break;case _0xdf39('0xc3'):if(_0x93084b==='1'){return _0x5dd0ef[_0xdf39('0x5b')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xdf39('0x28'),_0xdf39('0xc1'),util[_0xdf39('0xc0')](_0x5a7812[_0xdf39('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xdf39('0x7d'):if(!_0x5a7812[_0xdf39('0x5c')]['error_code']&&_0x93084b>=0xc8&&_0x93084b<=0xce){return _0x5dd0ef[_0xdf39('0x5b')]({'read':!![]});}else{logger['error'](_0xdf39('0x23'),'status',_0xdf39('0x7d'),util[_0xdf39('0xc0')](_0x5a7812[_0xdf39('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xdf39('0x83'):var _0xd1736f=_0x5a7812[_0xdf39('0x5c')][_0xdf39('0x84')][0x0];if(_0xd1736f['status'][_0xdf39('0xc7')]===_0xdf39('0xc8')){return _0x5dd0ef[_0xdf39('0x5b')]({'read':!![]});}else{logger['error'](_0xdf39('0x23'),_0xdf39('0x28'),_0xdf39('0x83'),util[_0xdf39('0xc0')](_0x5a7812['body'],{'showHidden':![],'depth':null}));}break;case _0xdf39('0xc9'):if(_0x93084b==_0xdf39('0xcb')||_0x93084b==_0xdf39('0xcc')){return _0x5dd0ef[_0xdf39('0x5b')]({'read':!![]});}else{logger[_0xdf39('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xdf39('0x28'),_0xdf39('0xc9'),util[_0xdf39('0xc0')](_0x5a7812['body'],{'showHidden':![],'depth':null}));}break;case _0xdf39('0xcd'):if(_0x93084b==='DELIVRD'||_0x93084b===_0xdf39('0xce')){return _0x5dd0ef['update']({'read':!![]});}else{logger[_0xdf39('0x24')](_0xdf39('0x23'),_0xdf39('0x28'),_0xdf39('0xcd'),util[_0xdf39('0xc0')](_0x5a7812[_0xdf39('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x5dd0ef;}})[_0xdf39('0x1e')](respondWithResult(_0x58866d,null))[_0xdf39('0x52')](handleError(_0x58866d,null));};exports[_0xdf39('0xcf')]=function(_0x3a8a41,_0x5efae0,_0x900c3b){var _0x1c2dea,_0x31f1a3,_0x3b640d;return db[_0xdf39('0x37')]['find']({'where':{'id':_0x3a8a41['params']['id']}})['then'](handleEntityNotFound(_0x5efae0,null))[_0xdf39('0x1e')](function(_0x1c7b7f){if(_0x1c7b7f){_0x3b640d=_0x1c7b7f;logger[_0xdf39('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xdf39('0x28'),_0xdf39('0xd0'),_0x1c7b7f[_0xdf39('0x46')],util['inspect'](_0x3a8a41[_0xdf39('0x3b')],{'showHidden':![],'depth':null}));switch(_0x1c7b7f[_0xdf39('0x46')]){case _0xdf39('0x85'):if(_0x3a8a41[_0xdf39('0x3b')][_0xdf39('0xd1')]&&_0x3a8a41['query']['state']){_0x31f1a3=_0x3a8a41[_0xdf39('0x3b')][_0xdf39('0xd2')];return db[_0xdf39('0x9e')][_0xdf39('0x57')]({'where':{'messageId':_0x3a8a41['query'][_0xdf39('0xd1')]}});}break;}}})[_0xdf39('0x1e')](handleEntityNotFound(_0x5efae0,null))['then'](function(_0x297b31){if(_0x297b31){_0x1c2dea=_0x297b31;switch(_0x3b640d['type']){case _0xdf39('0x85'):if(_0x31f1a3==='2'||_0x31f1a3==='6'){return _0x1c2dea[_0xdf39('0x5b')]({'read':!![]});}else{logger[_0xdf39('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xdf39('0x85'),util[_0xdf39('0xc0')](_0x3a8a41['query'],{'showHidden':![],'depth':null}));};break;}return _0x1c2dea;}})[_0xdf39('0x1e')](respondWithResult(_0x5efae0,null))[_0xdf39('0x52')](handleError(_0x5efae0,null));};exports[_0xdf39('0xd3')]=function(_0x39557,_0x116ef3,_0x7fba48){return db[_0xdf39('0x37')]['find']({'where':{'id':_0x39557['params']['id']}})[_0xdf39('0x1e')](handleEntityNotFound(_0x116ef3,null))[_0xdf39('0x1e')](function(_0xfb8f29){if(_0xfb8f29){return _0xfb8f29[_0xdf39('0xd3')](_0x39557[_0xdf39('0x5c')][_0xdf39('0x67')],_[_0xdf39('0xd4')](_0x39557[_0xdf39('0x5c')],[_0xdf39('0x67'),'id'])||{})[_0xdf39('0x95')](function(_0x3ddbbf){for(var _0x4583a2=0x0;_0x4583a2<_0x39557[_0xdf39('0x5c')][_0xdf39('0x67')][_0xdf39('0x40')];_0x4583a2+=0x1){socket[_0xdf39('0xd5')](_0xdf39('0xd6'),{'UserId':_0x39557['body'][_0xdf39('0x67')][_0x4583a2],'SmsAccountId':_0x39557[_0xdf39('0x50')]['id']});}return _0x3ddbbf;});}})['then'](respondWithResult(_0x116ef3,null))[_0xdf39('0x52')](handleError(_0x116ef3,null));};exports[_0xdf39('0xd7')]=function(_0x7f3e96,_0x5a9f05,_0x81e9ec){return db[_0xdf39('0x37')][_0xdf39('0x57')]({'where':{'id':_0x7f3e96[_0xdf39('0x50')]['id']}})[_0xdf39('0x1e')](handleEntityNotFound(_0x5a9f05,null))[_0xdf39('0x1e')](function(_0x36c13d){if(_0x36c13d){return _0x36c13d['removeAgents'](_0x7f3e96['query'][_0xdf39('0x67')])['then'](function(){if(_[_0xdf39('0xd8')](_0x7f3e96[_0xdf39('0x3b')][_0xdf39('0x67')])){for(var _0x4cad2f=0x0;_0x4cad2f<_0x7f3e96['query'][_0xdf39('0x67')][_0xdf39('0x40')];_0x4cad2f+=0x1){socket['emit'](_0xdf39('0xd9'),{'UserId':Number(_0x7f3e96[_0xdf39('0x3b')][_0xdf39('0x67')][_0x4cad2f]),'SmsAccountId':Number(_0x7f3e96[_0xdf39('0x50')]['id'])});}}else{socket[_0xdf39('0xd5')]('userSmsAccount:remove',{'UserId':Number(_0x7f3e96[_0xdf39('0x3b')]['ids']),'SmsAccountId':Number(_0x7f3e96['params']['id'])});}});}})[_0xdf39('0x1e')](respondWithStatusCode(_0x5a9f05,null))[_0xdf39('0x52')](handleError(_0x5a9f05,null));};exports[_0xdf39('0xda')]=function(_0x32ea19,_0x536019,_0x14048f){var _0x18da7d={};var _0x889866={};var _0x6ee1b9;var _0x35f84b;return db[_0xdf39('0x37')][_0xdf39('0x62')]({'where':{'id':_0x32ea19[_0xdf39('0x50')]['id']}})[_0xdf39('0x1e')](handleEntityNotFound(_0x536019,null))['then'](function(_0x4d5da){if(_0x4d5da){_0x6ee1b9=_0x4d5da;_0x889866[_0xdf39('0x39')]=_[_0xdf39('0x3a')](db['User'][_0xdf39('0x38')]);_0x889866[_0xdf39('0x3b')]=_[_0xdf39('0x3a')](_0x32ea19['query']);_0x889866[_0xdf39('0x3c')]=_['intersection'](_0x889866[_0xdf39('0x39')],_0x889866[_0xdf39('0x3b')]);_0x18da7d[_0xdf39('0x3f')]=_[_0xdf39('0x3d')](_0x889866[_0xdf39('0x39')],qs[_0xdf39('0x3e')](_0x32ea19[_0xdf39('0x3b')][_0xdf39('0x3e')]));_0x18da7d[_0xdf39('0x3f')]=_0x18da7d['attributes'][_0xdf39('0x40')]?_0x18da7d[_0xdf39('0x3f')]:_0x889866[_0xdf39('0x39')];_0x18da7d[_0xdf39('0x69')]=qs[_0xdf39('0x42')](_0x32ea19['query'][_0xdf39('0x42')]);_0x18da7d[_0xdf39('0x4c')]=qs[_0xdf39('0x3c')](_['pick'](_0x32ea19[_0xdf39('0x3b')],_0x889866[_0xdf39('0x3c')]));if(_0x32ea19[_0xdf39('0x3b')][_0xdf39('0x44')]){_0x18da7d[_0xdf39('0x4c')]=_[_0xdf39('0x4a')](_0x18da7d[_0xdf39('0x4c')],{'$or':_['map'](_0x18da7d[_0xdf39('0x3f')],function(_0x208d26){var _0x320a34={};_0x320a34[_0x208d26]={'$like':'%'+_0x32ea19[_0xdf39('0x3b')][_0xdf39('0x44')]+'%'};return _0x320a34;})});}_0x18da7d=_[_0xdf39('0x4a')]({},_0x18da7d,_0x32ea19[_0xdf39('0x4b')]);return _0x6ee1b9[_0xdf39('0xda')](_0x18da7d);}})[_0xdf39('0x1e')](function(_0x547ed6){if(_0x547ed6){_0x35f84b=_0x547ed6['length'];if(!_0x32ea19[_0xdf39('0x3b')]['hasOwnProperty'](_0xdf39('0x63'))){_0x18da7d[_0xdf39('0x2b')]=qs[_0xdf39('0x2b')](_0x32ea19['query'][_0xdf39('0x2b')]);_0x18da7d['offset']=qs[_0xdf39('0x2a')](_0x32ea19[_0xdf39('0x3b')]['offset']);}return _0x6ee1b9[_0xdf39('0xda')](_0x18da7d);}})[_0xdf39('0x1e')](function(_0x471b7d){if(_0x471b7d){return _0x471b7d?{'count':_0x35f84b,'rows':_0x471b7d}:null;}})[_0xdf39('0x1e')](respondWithResult(_0x536019,null))['catch'](handleError(_0x536019,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index df72b88..a452e5a 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 _0x7250=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x7250,0x1b1));var _0x0725=function(_0x59adc5,_0x4727f0){_0x59adc5=_0x59adc5-0x0;var _0x1978d7=_0x7250[_0x59adc5];return _0x1978d7;};'use strict';var EventEmitter=require(_0x0725('0x0'));var SmsAccount=require(_0x0725('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x0725('0x2')](0x0);var events={'afterCreate':_0x0725('0x3'),'afterUpdate':_0x0725('0x4'),'afterDestroy':_0x0725('0x5')};function emitEvent(_0x425376){return function(_0x4724ef,_0x53cc59,_0x34a7d5){SmsAccountEvents['emit'](_0x425376+':'+_0x4724ef['id'],_0x4724ef);SmsAccountEvents['emit'](_0x425376,_0x4724ef);_0x34a7d5(null);};}for(var e in events){if(events[_0x0725('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x0725('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0x74f3=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','save'];(function(_0x415604,_0x2d1113){var _0x2410e4=function(_0x4e48ec){while(--_0x4e48ec){_0x415604['push'](_0x415604['shift']());}};_0x2410e4(++_0x2d1113);}(_0x74f3,0x164));var _0x374f=function(_0xa8b2e0,_0x473bd6){_0xa8b2e0=_0xa8b2e0-0x0;var _0x5a1a3c=_0x74f3[_0xa8b2e0];return _0x5a1a3c;};'use strict';var EventEmitter=require(_0x374f('0x0'));var SmsAccount=require(_0x374f('0x1'))['db'][_0x374f('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x374f('0x3'),'afterUpdate':_0x374f('0x4'),'afterDestroy':_0x374f('0x5')};function emitEvent(_0x251324){return function(_0x4a3be7,_0x3db0a,_0xc045e2){SmsAccountEvents['emit'](_0x251324+':'+_0x4a3be7['id'],_0x4a3be7);SmsAccountEvents[_0x374f('0x6')](_0x251324,_0x4a3be7);_0xc045e2(null);};}for(var e in events){if(events[_0x374f('0x7')](e)){var event=events[e];SmsAccount[_0x374f('0x8')](e,emitEvent(event));}}module[_0x374f('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 10d4137..850c1c9 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 _0x657d=['define','SmsAccount','sms_accounts','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4430cc,_0x3383d3){var _0x5c5fc3=function(_0x1643d6){while(--_0x1643d6){_0x4430cc['push'](_0x4430cc['shift']());}};_0x5c5fc3(++_0x3383d3);}(_0x657d,0x92));var _0xd657=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x657d[_0x40a825];return _0x273a54;};'use strict';var _=require(_0xd657('0x0'));var util=require('util');var logger=require(_0xd657('0x1'))(_0xd657('0x2'));var moment=require('moment');var BPromise=require(_0xd657('0x3'));var rp=require(_0xd657('0x4'));var fs=require('fs');var path=require(_0xd657('0x5'));var rimraf=require(_0xd657('0x6'));var config=require(_0xd657('0x7'));var attributes=require('./smsAccount.attributes');module['exports']=function(_0x28c811,_0x1cbb83){return _0x28c811[_0xd657('0x8')](_0xd657('0x9'),attributes,{'tableName':_0xd657('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3e7=['moment','bluebird','request-promise','path','../../config/environment','./smsAccount.attributes','define','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf3e7,0x1ca));var _0x7f3e=function(_0x5e2931,_0x35830){_0x5e2931=_0x5e2931-0x0;var _0x14ed67=_0xf3e7[_0x5e2931];return _0x14ed67;};'use strict';var _=require(_0x7f3e('0x0'));var util=require(_0x7f3e('0x1'));var logger=require(_0x7f3e('0x2'))(_0x7f3e('0x3'));var moment=require(_0x7f3e('0x4'));var BPromise=require(_0x7f3e('0x5'));var rp=require(_0x7f3e('0x6'));var fs=require('fs');var path=require(_0x7f3e('0x7'));var rimraf=require('rimraf');var config=require(_0x7f3e('0x8'));var attributes=require(_0x7f3e('0x9'));module['exports']=function(_0x3aaad4,_0x6b7360){return _0x3aaad4[_0x7f3e('0xa')]('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 e4caec8..77e55af 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 _0xeb7f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsAccount,\x20%s,\x20%s','result','catch','SmsAccount','options','raw','where','attributes','include','map','model','ShowSmsAccount','lodash','util','moment','bluebird'];(function(_0x3d27ba,_0x2671a3){var _0xf01885=function(_0x311f5c){while(--_0x311f5c){_0x3d27ba['push'](_0x3d27ba['shift']());}};_0xf01885(++_0x2671a3);}(_0xeb7f,0x77));var _0xfeb7=function(_0x42b789,_0x46d8d4){_0x42b789=_0x42b789-0x0;var _0x3dee14=_0xeb7f[_0x42b789];return _0x3dee14;};'use strict';var _=require(_0xfeb7('0x0'));var util=require(_0xfeb7('0x1'));var moment=require(_0xfeb7('0x2'));var BPromise=require(_0xfeb7('0x3'));var rs=require(_0xfeb7('0x4'));var fs=require('fs');var Redis=require(_0xfeb7('0x5'));var db=require(_0xfeb7('0x6'))['db'];var utils=require(_0xfeb7('0x7'));var logger=require(_0xfeb7('0x8'))(_0xfeb7('0x9'));var config=require('../../config/environment');var jayson=require(_0xfeb7('0xa'));var client=jayson[_0xfeb7('0xb')][_0xfeb7('0xc')]({'port':0x232a});config[_0xfeb7('0xd')]=_[_0xfeb7('0xe')](config[_0xfeb7('0xd')],{'host':_0xfeb7('0xf'),'port':0x18eb});var socket=require(_0xfeb7('0x10'))(new Redis(config[_0xfeb7('0xd')]));require(_0xfeb7('0x11'))[_0xfeb7('0x12')](socket);function respondWithRpcPromise(_0x583843,_0x5d4a0e,_0x2bf69d){return new BPromise(function(_0x17f20a,_0x1343ee){return client[_0xfeb7('0x13')](_0x583843,_0x2bf69d)[_0xfeb7('0x14')](function(_0x684310){logger[_0xfeb7('0x15')]('SmsAccount,\x20%s,\x20%s',_0x5d4a0e,_0xfeb7('0x16'));logger[_0xfeb7('0x17')](_0xfeb7('0x18'),_0x5d4a0e,_0xfeb7('0x16'),JSON[_0xfeb7('0x19')](_0x684310));if(_0x684310[_0xfeb7('0x1a')]){if(_0x684310[_0xfeb7('0x1a')][_0xfeb7('0x1b')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x5d4a0e,_0x684310[_0xfeb7('0x1a')][_0xfeb7('0x1c')]);return _0x1343ee(_0x684310[_0xfeb7('0x1a')][_0xfeb7('0x1c')]);}logger['error'](_0xfeb7('0x1d'),_0x5d4a0e,_0x684310[_0xfeb7('0x1a')][_0xfeb7('0x1c')]);return _0x17f20a(_0x684310[_0xfeb7('0x1a')][_0xfeb7('0x1c')]);}else{logger['info'](_0xfeb7('0x1d'),_0x5d4a0e,_0xfeb7('0x16'));_0x17f20a(_0x684310[_0xfeb7('0x1e')][_0xfeb7('0x1c')]);}})[_0xfeb7('0x1f')](function(_0x520387){logger[_0xfeb7('0x1a')](_0xfeb7('0x1d'),_0x5d4a0e,_0x520387);_0x1343ee(_0x520387);});});}exports['ShowSmsAccount']=function(_0x2420b8){var _0x426e44=this;return new Promise(function(_0x4cf796,_0x155666){return db[_0xfeb7('0x20')]['find']({'raw':_0x2420b8[_0xfeb7('0x21')]?_0x2420b8[_0xfeb7('0x21')][_0xfeb7('0x22')]===undefined?!![]:![]:!![],'where':_0x2420b8[_0xfeb7('0x21')]?_0x2420b8['options'][_0xfeb7('0x23')]||null:null,'attributes':_0x2420b8[_0xfeb7('0x21')]?_0x2420b8[_0xfeb7('0x21')][_0xfeb7('0x24')]||null:null,'include':_0x2420b8[_0xfeb7('0x21')]?_0x2420b8['options'][_0xfeb7('0x25')]?_[_0xfeb7('0x26')](_0x2420b8[_0xfeb7('0x21')][_0xfeb7('0x25')],function(_0x4a3eb0){return{'model':db[_0x4a3eb0[_0xfeb7('0x27')]],'as':_0x4a3eb0['as'],'attributes':_0x4a3eb0['attributes'],'include':_0x4a3eb0[_0xfeb7('0x25')]?_[_0xfeb7('0x26')](_0x4a3eb0['include'],function(_0x321711){return{'model':db[_0x321711[_0xfeb7('0x27')]],'as':_0x321711['as'],'attributes':_0x321711[_0xfeb7('0x24')],'include':_0x321711[_0xfeb7('0x25')]?_['map'](_0x321711['include'],function(_0x262d12){return{'model':db[_0x262d12['model']],'as':_0x262d12['as'],'attributes':_0x262d12[_0xfeb7('0x24')]};}):[]};}):[]};}):[]:[]})[_0xfeb7('0x14')](function(_0x9dc69d){logger[_0xfeb7('0x15')](_0xfeb7('0x28'),_0x2420b8);logger[_0xfeb7('0x17')](_0xfeb7('0x28'),_0x2420b8,JSON['stringify'](_0x9dc69d));_0x4cf796(_0x9dc69d);})['catch'](function(_0x181878){logger[_0xfeb7('0x1a')](_0xfeb7('0x28'),_0x181878[_0xfeb7('0x1c')],_0x2420b8);_0x155666(_0x426e44[_0xfeb7('0x1a')](0x1f4,_0x181878[_0xfeb7('0x1c')]));});});}; \ No newline at end of file +var _0x1fb9=['request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','ShowSmsAccount','SmsAccount','options','raw','where','map','include','model','attributes','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./smsAccount.socket','register'];(function(_0xc2122e,_0x6a189b){var _0x302ce5=function(_0x39482a){while(--_0x39482a){_0xc2122e['push'](_0xc2122e['shift']());}};_0x302ce5(++_0x6a189b);}(_0x1fb9,0x106));var _0x91fb=function(_0x5d83c0,_0x133c60){_0x5d83c0=_0x5d83c0-0x0;var _0x2979d8=_0x1fb9[_0x5d83c0];return _0x2979d8;};'use strict';var _=require(_0x91fb('0x0'));var util=require(_0x91fb('0x1'));var moment=require(_0x91fb('0x2'));var BPromise=require(_0x91fb('0x3'));var rs=require(_0x91fb('0x4'));var fs=require('fs');var Redis=require(_0x91fb('0x5'));var db=require(_0x91fb('0x6'))['db'];var utils=require(_0x91fb('0x7'));var logger=require(_0x91fb('0x8'))(_0x91fb('0x9'));var config=require(_0x91fb('0xa'));var jayson=require(_0x91fb('0xb'));var client=jayson['client'][_0x91fb('0xc')]({'port':0x232a});config[_0x91fb('0xd')]=_[_0x91fb('0xe')](config[_0x91fb('0xd')],{'host':_0x91fb('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x91fb('0xd')]));require(_0x91fb('0x10'))[_0x91fb('0x11')](socket);function respondWithRpcPromise(_0xebf0a7,_0x20810f,_0x4131c9){return new BPromise(function(_0x4b62c9,_0x5b7c71){return client[_0x91fb('0x12')](_0xebf0a7,_0x4131c9)[_0x91fb('0x13')](function(_0x5b685f){logger['info'](_0x91fb('0x14'),_0x20810f,_0x91fb('0x15'));logger['debug'](_0x91fb('0x16'),_0x20810f,_0x91fb('0x15'),JSON[_0x91fb('0x17')](_0x5b685f));if(_0x5b685f[_0x91fb('0x18')]){if(_0x5b685f[_0x91fb('0x18')][_0x91fb('0x19')]===0x1f4){logger[_0x91fb('0x18')](_0x91fb('0x14'),_0x20810f,_0x5b685f['error'][_0x91fb('0x1a')]);return _0x5b7c71(_0x5b685f[_0x91fb('0x18')][_0x91fb('0x1a')]);}logger[_0x91fb('0x18')](_0x91fb('0x14'),_0x20810f,_0x5b685f['error']['message']);return _0x4b62c9(_0x5b685f['error'][_0x91fb('0x1a')]);}else{logger[_0x91fb('0x1b')](_0x91fb('0x14'),_0x20810f,'request\x20sent');_0x4b62c9(_0x5b685f[_0x91fb('0x1c')][_0x91fb('0x1a')]);}})['catch'](function(_0x4c6061){logger[_0x91fb('0x18')](_0x91fb('0x14'),_0x20810f,_0x4c6061);_0x5b7c71(_0x4c6061);});});}exports[_0x91fb('0x1d')]=function(_0x15199a){var _0x42f44c=this;return new Promise(function(_0x46f5a3,_0x24f7f8){return db[_0x91fb('0x1e')]['find']({'raw':_0x15199a[_0x91fb('0x1f')]?_0x15199a[_0x91fb('0x1f')][_0x91fb('0x20')]===undefined?!![]:![]:!![],'where':_0x15199a['options']?_0x15199a[_0x91fb('0x1f')][_0x91fb('0x21')]||null:null,'attributes':_0x15199a[_0x91fb('0x1f')]?_0x15199a[_0x91fb('0x1f')]['attributes']||null:null,'include':_0x15199a[_0x91fb('0x1f')]?_0x15199a[_0x91fb('0x1f')]['include']?_[_0x91fb('0x22')](_0x15199a['options'][_0x91fb('0x23')],function(_0x196247){return{'model':db[_0x196247[_0x91fb('0x24')]],'as':_0x196247['as'],'attributes':_0x196247['attributes'],'include':_0x196247[_0x91fb('0x23')]?_['map'](_0x196247[_0x91fb('0x23')],function(_0x297cc9){return{'model':db[_0x297cc9[_0x91fb('0x24')]],'as':_0x297cc9['as'],'attributes':_0x297cc9[_0x91fb('0x25')],'include':_0x297cc9[_0x91fb('0x23')]?_[_0x91fb('0x22')](_0x297cc9[_0x91fb('0x23')],function(_0x533308){return{'model':db[_0x533308['model']],'as':_0x533308['as'],'attributes':_0x533308['attributes']};}):[]};}):[]};}):[]:[]})[_0x91fb('0x13')](function(_0x5a1f73){logger[_0x91fb('0x1b')](_0x91fb('0x1d'),_0x15199a);logger[_0x91fb('0x26')]('ShowSmsAccount',_0x15199a,JSON[_0x91fb('0x17')](_0x5a1f73));_0x46f5a3(_0x5a1f73);})[_0x91fb('0x27')](function(_0x24816a){logger[_0x91fb('0x18')]('ShowSmsAccount',_0x24816a[_0x91fb('0x1a')],_0x15199a);_0x24f7f8(_0x42f44c['error'](0x1f4,_0x24816a['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index c660520..bbfeed0 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 _0x434f=['save','remove','emit','removeListener','length','smsAccount:','./smsAccount.events'];(function(_0x39fd11,_0x5d7883){var _0x302799=function(_0x4a0615){while(--_0x4a0615){_0x39fd11['push'](_0x39fd11['shift']());}};_0x302799(++_0x5d7883);}(_0x434f,0xc3));var _0xf434=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x434f[_0x3dd15e];return _0x231fd0;};'use strict';var SmsAccountEvents=require(_0xf434('0x0'));var events=[_0xf434('0x1'),_0xf434('0x2'),'update'];function createListener(_0x554c04,_0x17885a){return function(_0x13b431){_0x17885a[_0xf434('0x3')](_0x554c04,_0x13b431);};}function removeListener(_0x19a210,_0x1d9d94){return function(){SmsAccountEvents[_0xf434('0x4')](_0x19a210,_0x1d9d94);};}exports['register']=function(_0x2fc84b){for(var _0x28c289=0x0,_0x44f529=events[_0xf434('0x5')];_0x28c289<_0x44f529;_0x28c289++){var _0x1ba39f=events[_0x28c289];var _0x2b4039=createListener(_0xf434('0x6')+_0x1ba39f,_0x2fc84b);SmsAccountEvents['on'](_0x1ba39f,_0x2b4039);}}; \ No newline at end of file +var _0x7f85=['emit','removeListener','register','length','smsAccount:','./smsAccount.events','save','remove','update'];(function(_0x132399,_0x1c4b0f){var _0x2a27e9=function(_0x4eac3b){while(--_0x4eac3b){_0x132399['push'](_0x132399['shift']());}};_0x2a27e9(++_0x1c4b0f);}(_0x7f85,0x1eb));var _0x57f8=function(_0x3db94a,_0x117062){_0x3db94a=_0x3db94a-0x0;var _0x5df368=_0x7f85[_0x3db94a];return _0x5df368;};'use strict';var SmsAccountEvents=require(_0x57f8('0x0'));var events=[_0x57f8('0x1'),_0x57f8('0x2'),_0x57f8('0x3')];function createListener(_0x140d18,_0x2bdd5f){return function(_0x2280fd){_0x2bdd5f[_0x57f8('0x4')](_0x140d18,_0x2280fd);};}function removeListener(_0x36d5db,_0x324444){return function(){SmsAccountEvents[_0x57f8('0x5')](_0x36d5db,_0x324444);};}exports[_0x57f8('0x6')]=function(_0x8ff199){for(var _0x222aef=0x0,_0x49d5ba=events[_0x57f8('0x7')];_0x222aef<_0x49d5ba;_0x222aef++){var _0x2a3ef2=events[_0x222aef];var _0x3eb0f7=createListener(_0x57f8('0x8')+_0x2a3ef2,_0x8ff199);SmsAccountEvents['on'](_0x2a3ef2,_0x3eb0f7);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 3819f79..20d5277 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 _0x7434=['multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x102f37,_0x26185f){var _0x114a5e=function(_0x3d2933){while(--_0x3d2933){_0x102f37['push'](_0x102f37['shift']());}};_0x114a5e(++_0x26185f);}(_0x7434,0x66));var _0x4743=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7434[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x4743('0x0'));var util=require(_0x4743('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4743('0x2'));var router=express['Router']();var auth=require(_0x4743('0x3'));var interaction=require(_0x4743('0x4'));var config=require(_0x4743('0x5'));var controller=require('./smsApplication.controller');router[_0x4743('0x6')]('/',auth[_0x4743('0x7')](),controller['index']);router['get'](_0x4743('0x8'),auth[_0x4743('0x7')](),controller[_0x4743('0x9')]);router[_0x4743('0xa')]('/',auth[_0x4743('0x7')](),controller[_0x4743('0xb')]);router[_0x4743('0xc')](_0x4743('0x8'),auth[_0x4743('0x7')](),controller[_0x4743('0xd')]);router[_0x4743('0xe')](_0x4743('0x8'),auth[_0x4743('0x7')](),controller[_0x4743('0xf')]);module[_0x4743('0x10')]=router; \ No newline at end of file +var _0x93ed=['/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0x93ed,0xdf));var _0xd93e=function(_0x5925b5,_0x35005c){_0x5925b5=_0x5925b5-0x0;var _0x5b2ac2=_0x93ed[_0x5925b5];return _0x5b2ac2;};'use strict';var multer=require(_0xd93e('0x0'));var util=require(_0xd93e('0x1'));var path=require(_0xd93e('0x2'));var timeout=require(_0xd93e('0x3'));var express=require('express');var router=express[_0xd93e('0x4')]();var auth=require(_0xd93e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd93e('0x6'));var controller=require(_0xd93e('0x7'));router[_0xd93e('0x8')]('/',auth[_0xd93e('0x9')](),controller[_0xd93e('0xa')]);router['get'](_0xd93e('0xb'),auth[_0xd93e('0x9')](),controller[_0xd93e('0xc')]);router[_0xd93e('0xd')]('/',auth[_0xd93e('0x9')](),controller[_0xd93e('0xe')]);router[_0xd93e('0xf')](_0xd93e('0xb'),auth['isAuthenticated'](),controller[_0xd93e('0x10')]);router['delete'](_0xd93e('0xb'),auth[_0xd93e('0x9')](),controller['destroy']);module[_0xd93e('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 0d7c9a4..cf26b69 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 _0x7ebf=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x26baba,_0x15b482){var _0x3951b0=function(_0x4c653){while(--_0x4c653){_0x26baba['push'](_0x26baba['shift']());}};_0x3951b0(++_0x15b482);}(_0x7ebf,0x153));var _0xf7eb=function(_0xc1186b,_0x524be8){_0xc1186b=_0xc1186b-0x0;var _0x26e45b=_0x7ebf[_0xc1186b];return _0x26e45b;};'use strict';var Sequelize=require(_0xf7eb('0x0'));module[_0xf7eb('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xf7eb('0x2')],'allowNull':![],'defaultValue':_0xf7eb('0x3')},'appdata':{'type':Sequelize[_0xf7eb('0x4')]()},'description':{'type':Sequelize[_0xf7eb('0x2')]},'interval':{'type':Sequelize[_0xf7eb('0x2')],'defaultValue':_0xf7eb('0x5')}}; \ No newline at end of file +var _0xbd3a=['sequelize','exports','INTEGER','STRING','TEXT'];(function(_0x58a430,_0x5f26be){var _0x680036=function(_0x1f530a){while(--_0x1f530a){_0x58a430['push'](_0x58a430['shift']());}};_0x680036(++_0x5f26be);}(_0xbd3a,0xb9));var _0xabd3=function(_0x174728,_0x205bb4){_0x174728=_0x174728-0x0;var _0x53e467=_0xbd3a[_0x174728];return _0x53e467;};'use strict';var Sequelize=require(_0xabd3('0x0'));module[_0xabd3('0x1')]={'priority':{'type':Sequelize[_0xabd3('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xabd3('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xabd3('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xabd3('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 0c8a8b1..37d5c66 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 _0x1578=['../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','sendStatus','error','name','send','index','SmsApplication','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','map','key','VIRTUAL','filter','findAll','rows','show','params','includeAll','options','find','create','body','catch','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x46aabc,_0x1b0b24){var _0x10c273=function(_0x341129){while(--_0x341129){_0x46aabc['push'](_0x46aabc['shift']());}};_0x10c273(++_0x1b0b24);}(_0x1578,0x147));var _0x8157=function(_0x1bbd76,_0x18dce9){_0x1bbd76=_0x1bbd76-0x0;var _0x47a329=_0x1578[_0x1bbd76];return _0x47a329;};'use strict';var pdf=require(_0x8157('0x0'));var emlformat=require(_0x8157('0x1'));var rimraf=require(_0x8157('0x2'));var zipdir=require(_0x8157('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8157('0x4'));var moment=require('moment');var BPromise=require(_0x8157('0x5'));var Mustache=require(_0x8157('0x6'));var util=require(_0x8157('0x7'));var path=require('path');var sox=require(_0x8157('0x8'));var csv=require(_0x8157('0x9'));var ejs=require(_0x8157('0xa'));var fs=require('fs');var _=require(_0x8157('0xb'));var squel=require(_0x8157('0xc'));var crypto=require(_0x8157('0xd'));var jsforce=require(_0x8157('0xe'));var deskjs=require(_0x8157('0xf'));var toCsv=require(_0x8157('0x9'));var querystring=require(_0x8157('0x10'));var Papa=require('papaparse');var Redis=require(_0x8157('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8157('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8157('0x13'))(_0x8157('0x14'));var utils=require('../../config/utils');var config=require(_0x8157('0x15'));var db=require(_0x8157('0x16'))['db'];function respondWithStatusCode(_0x1b5f43,_0x3f5274){_0x3f5274=_0x3f5274||0xcc;return function(_0x2b6260){if(_0x2b6260){return _0x1b5f43['sendStatus'](_0x3f5274);}return _0x1b5f43[_0x8157('0x17')](_0x3f5274)[_0x8157('0x18')]();};}function respondWithResult(_0x365bf7,_0x57d75f){_0x57d75f=_0x57d75f||0xc8;return function(_0x16af54){if(_0x16af54){return _0x365bf7[_0x8157('0x17')](_0x57d75f)[_0x8157('0x19')](_0x16af54);}};}function respondWithFilteredResult(_0x56a2fb,_0x91793){return function(_0x5682e3){if(_0x5682e3){var _0x26b0af=_0x5682e3[_0x8157('0x1a')],_0xf6abdf=_0x91793[_0x8157('0x1b')],_0x583d1e=_0x91793[_0x8157('0x1b')]+_0x91793[_0x8157('0x1c')],_0x47c0dd;if(_0x583d1e>=_0x26b0af){_0x583d1e=_0x26b0af;_0x47c0dd=0xc8;}else{_0x47c0dd=0xce;}_0x56a2fb[_0x8157('0x17')](_0x47c0dd);return _0x56a2fb[_0x8157('0x1d')](_0x8157('0x1e'),_0xf6abdf+'-'+_0x583d1e+'/'+_0x26b0af)[_0x8157('0x19')](_0x5682e3);}return null;};}function patchUpdates(_0x1a207c){return function(_0x2dd83d){try{jsonpatch[_0x8157('0x1f')](_0x2dd83d,_0x1a207c,!![]);}catch(_0x140a11){return BPromise['reject'](_0x140a11);}return _0x2dd83d['save']();};}function saveUpdates(_0x2b3f12,_0x219703){return function(_0x5b0e38){if(_0x5b0e38){return _0x5b0e38[_0x8157('0x20')](_0x2b3f12)[_0x8157('0x21')](function(_0x51da63){return _0x51da63;});}return null;};}function removeEntity(_0x4250b3,_0x2e7f48){return function(_0x2647ae){if(_0x2647ae){return _0x2647ae[_0x8157('0x22')]()[_0x8157('0x21')](function(){_0x4250b3[_0x8157('0x17')](0xcc)[_0x8157('0x18')]();});}};}function handleEntityNotFound(_0xa184cd,_0x186e58){return function(_0xeaa544){if(!_0xeaa544){_0xa184cd[_0x8157('0x23')](0x194);}return _0xeaa544;};}function handleError(_0x36ee5e,_0x4a0c26){_0x4a0c26=_0x4a0c26||0x1f4;return function(_0x5e7ade){logger[_0x8157('0x24')](_0x5e7ade['stack']);if(_0x5e7ade[_0x8157('0x25')]){delete _0x5e7ade['name'];}_0x36ee5e[_0x8157('0x17')](_0x4a0c26)[_0x8157('0x26')](_0x5e7ade);};}exports[_0x8157('0x27')]=function(_0x3322ce,_0x115295){var _0x4ad62a={},_0x19c3a7={},_0x55d4c9={'count':0x0,'rows':[]};var _0x531d32=db[_0x8157('0x28')][_0x8157('0x29')];_0x19c3a7[_0x8157('0x2a')]=_[_0x8157('0x2b')](_0x531d32);_0x19c3a7['query']=_[_0x8157('0x2b')](_0x3322ce[_0x8157('0x2c')]);_0x19c3a7[_0x8157('0x2d')]=_[_0x8157('0x2e')](_0x19c3a7[_0x8157('0x2a')],_0x19c3a7[_0x8157('0x2c')]);_0x4ad62a[_0x8157('0x2f')]=_[_0x8157('0x2e')](_0x19c3a7[_0x8157('0x2a')],qs[_0x8157('0x30')](_0x3322ce[_0x8157('0x2c')]['fields']));_0x4ad62a[_0x8157('0x2f')]=_0x4ad62a['attributes'][_0x8157('0x31')]?_0x4ad62a[_0x8157('0x2f')]:_0x19c3a7['model'];if(!_0x3322ce[_0x8157('0x2c')]['hasOwnProperty'](_0x8157('0x32'))){_0x4ad62a['limit']=qs[_0x8157('0x1c')](_0x3322ce[_0x8157('0x2c')][_0x8157('0x1c')]);_0x4ad62a[_0x8157('0x1b')]=qs[_0x8157('0x1b')](_0x3322ce[_0x8157('0x2c')][_0x8157('0x1b')]);}_0x4ad62a[_0x8157('0x33')]=qs['sort'](_0x3322ce[_0x8157('0x2c')][_0x8157('0x34')]);_0x4ad62a['where']=qs[_0x8157('0x2d')](_['pick'](_0x3322ce[_0x8157('0x2c')],_0x19c3a7['filters']));if(_0x3322ce[_0x8157('0x2c')]['filter']){_0x4ad62a[_0x8157('0x35')]=_[_0x8157('0x36')](_0x4ad62a[_0x8157('0x35')],{'$or':_[_0x8157('0x37')](_0x531d32,function(_0x3b8790){if(_0x3b8790['type'][_0x8157('0x38')]!==_0x8157('0x39')){var _0x25bf73={};_0x25bf73[_0x3b8790['field']]={'$like':'%'+_0x3322ce[_0x8157('0x2c')][_0x8157('0x3a')]+'%'};return _0x25bf73;}})});}_0x4ad62a=_[_0x8157('0x36')]({},_0x4ad62a,_0x3322ce['options']);var _0x1455cb={'where':_0x4ad62a['where']};return db[_0x8157('0x28')]['count'](_0x1455cb)[_0x8157('0x21')](function(_0x52554b){_0x55d4c9[_0x8157('0x1a')]=_0x52554b;if(_0x3322ce['query']['includeAll']){_0x4ad62a['include']=[{'all':!![]}];}return db[_0x8157('0x28')][_0x8157('0x3b')](_0x4ad62a);})['then'](function(_0x52821b){_0x55d4c9[_0x8157('0x3c')]=_0x52821b;return _0x55d4c9;})['then'](respondWithFilteredResult(_0x115295,_0x4ad62a))['catch'](handleError(_0x115295,null));};exports[_0x8157('0x3d')]=function(_0x5d16ed,_0xf34d12){var _0x2d1a29={'raw':!![],'where':{'id':_0x5d16ed[_0x8157('0x3e')]['id']}},_0x2597aa={};_0x2597aa[_0x8157('0x2a')]=_[_0x8157('0x2b')](db[_0x8157('0x28')][_0x8157('0x29')]);_0x2597aa[_0x8157('0x2c')]=_[_0x8157('0x2b')](_0x5d16ed[_0x8157('0x2c')]);_0x2597aa[_0x8157('0x2d')]=_['intersection'](_0x2597aa[_0x8157('0x2a')],_0x2597aa[_0x8157('0x2c')]);_0x2d1a29[_0x8157('0x2f')]=_['intersection'](_0x2597aa[_0x8157('0x2a')],qs[_0x8157('0x30')](_0x5d16ed['query'][_0x8157('0x30')]));_0x2d1a29['attributes']=_0x2d1a29[_0x8157('0x2f')][_0x8157('0x31')]?_0x2d1a29['attributes']:_0x2597aa[_0x8157('0x2a')];if(_0x5d16ed[_0x8157('0x2c')][_0x8157('0x3f')]){_0x2d1a29['include']=[{'all':!![]}];}_0x2d1a29=_[_0x8157('0x36')]({},_0x2d1a29,_0x5d16ed[_0x8157('0x40')]);return db[_0x8157('0x28')][_0x8157('0x41')](_0x2d1a29)[_0x8157('0x21')](handleEntityNotFound(_0xf34d12,null))[_0x8157('0x21')](respondWithResult(_0xf34d12,null))['catch'](handleError(_0xf34d12,null));};exports[_0x8157('0x42')]=function(_0x1731b7,_0x42d26b){return db['SmsApplication'][_0x8157('0x42')](_0x1731b7[_0x8157('0x43')],{})[_0x8157('0x21')](respondWithResult(_0x42d26b,0xc9))[_0x8157('0x44')](handleError(_0x42d26b,null));};exports[_0x8157('0x20')]=function(_0x1c5eda,_0x17e54f){if(_0x1c5eda[_0x8157('0x43')]['id']){delete _0x1c5eda[_0x8157('0x43')]['id'];}return db['SmsApplication'][_0x8157('0x41')]({'where':{'id':_0x1c5eda[_0x8157('0x3e')]['id']}})[_0x8157('0x21')](handleEntityNotFound(_0x17e54f,null))['then'](saveUpdates(_0x1c5eda[_0x8157('0x43')],null))['then'](respondWithResult(_0x17e54f,null))['catch'](handleError(_0x17e54f,null));};exports[_0x8157('0x22')]=function(_0x3ead9e,_0x54346a){return db['SmsApplication'][_0x8157('0x41')]({'where':{'id':_0x3ead9e[_0x8157('0x3e')]['id']}})[_0x8157('0x21')](handleEntityNotFound(_0x54346a,null))[_0x8157('0x21')](removeEntity(_0x54346a,null))[_0x8157('0x44')](handleError(_0x54346a,null));}; \ No newline at end of file +var _0xa49d=['../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','name','send','index','SmsApplication','rawAttributes','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','map','type','key','field','options','where','includeAll','include','findAll','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api'];(function(_0x2d54a3,_0x551ca2){var _0x2771cd=function(_0x5d9ccf){while(--_0x5d9ccf){_0x2d54a3['push'](_0x2d54a3['shift']());}};_0x2771cd(++_0x551ca2);}(_0xa49d,0x1a0));var _0xda49=function(_0x13bce3,_0xa0cf8f){_0x13bce3=_0x13bce3-0x0;var _0xb535c5=_0xa49d[_0x13bce3];return _0xb535c5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xda49('0x0'));var rimraf=require(_0xda49('0x1'));var zipdir=require(_0xda49('0x2'));var jsonpatch=require(_0xda49('0x3'));var rp=require(_0xda49('0x4'));var moment=require(_0xda49('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xda49('0x6'));var path=require(_0xda49('0x7'));var sox=require(_0xda49('0x8'));var csv=require(_0xda49('0x9'));var ejs=require(_0xda49('0xa'));var fs=require('fs');var _=require(_0xda49('0xb'));var squel=require(_0xda49('0xc'));var crypto=require(_0xda49('0xd'));var jsforce=require(_0xda49('0xe'));var deskjs=require(_0xda49('0xf'));var toCsv=require('to-csv');var querystring=require(_0xda49('0x10'));var Papa=require(_0xda49('0x11'));var Redis=require(_0xda49('0x12'));var authService=require(_0xda49('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xda49('0x14'))(_0xda49('0x15'));var utils=require(_0xda49('0x16'));var config=require('../../config/environment');var db=require(_0xda49('0x17'))['db'];function respondWithStatusCode(_0x3238a8,_0x356d8d){_0x356d8d=_0x356d8d||0xcc;return function(_0x5eaf32){if(_0x5eaf32){return _0x3238a8[_0xda49('0x18')](_0x356d8d);}return _0x3238a8[_0xda49('0x19')](_0x356d8d)['end']();};}function respondWithResult(_0x3a9a8e,_0x15ad6c){_0x15ad6c=_0x15ad6c||0xc8;return function(_0x3d6f8b){if(_0x3d6f8b){return _0x3a9a8e[_0xda49('0x19')](_0x15ad6c)[_0xda49('0x1a')](_0x3d6f8b);}};}function respondWithFilteredResult(_0x4de65c,_0x31aed8){return function(_0x2b7c3e){if(_0x2b7c3e){var _0x3a4930=_0x2b7c3e[_0xda49('0x1b')],_0x864bf8=_0x31aed8[_0xda49('0x1c')],_0x5add61=_0x31aed8[_0xda49('0x1c')]+_0x31aed8['limit'],_0x23501d;if(_0x5add61>=_0x3a4930){_0x5add61=_0x3a4930;_0x23501d=0xc8;}else{_0x23501d=0xce;}_0x4de65c[_0xda49('0x19')](_0x23501d);return _0x4de65c['set'](_0xda49('0x1d'),_0x864bf8+'-'+_0x5add61+'/'+_0x3a4930)[_0xda49('0x1a')](_0x2b7c3e);}return null;};}function patchUpdates(_0x80506d){return function(_0x4273d0){try{jsonpatch[_0xda49('0x1e')](_0x4273d0,_0x80506d,!![]);}catch(_0x21871b){return BPromise[_0xda49('0x1f')](_0x21871b);}return _0x4273d0[_0xda49('0x20')]();};}function saveUpdates(_0x992498,_0x1d986a){return function(_0x18da92){if(_0x18da92){return _0x18da92[_0xda49('0x21')](_0x992498)[_0xda49('0x22')](function(_0x254388){return _0x254388;});}return null;};}function removeEntity(_0x1ae223,_0x18fc4b){return function(_0x54ccb5){if(_0x54ccb5){return _0x54ccb5[_0xda49('0x23')]()[_0xda49('0x22')](function(){_0x1ae223[_0xda49('0x19')](0xcc)[_0xda49('0x24')]();});}};}function handleEntityNotFound(_0x87022b,_0x116d25){return function(_0x2b54e2){if(!_0x2b54e2){_0x87022b['sendStatus'](0x194);}return _0x2b54e2;};}function handleError(_0x1db059,_0x1fcf31){_0x1fcf31=_0x1fcf31||0x1f4;return function(_0x49feb2){logger['error'](_0x49feb2['stack']);if(_0x49feb2[_0xda49('0x25')]){delete _0x49feb2[_0xda49('0x25')];}_0x1db059[_0xda49('0x19')](_0x1fcf31)[_0xda49('0x26')](_0x49feb2);};}exports[_0xda49('0x27')]=function(_0x8d99cc,_0x27c3ba){var _0x522a1f={},_0x404a94={},_0x16354f={'count':0x0,'rows':[]};var _0x7a7193=db[_0xda49('0x28')][_0xda49('0x29')];_0x404a94['model']=_[_0xda49('0x2a')](_0x7a7193);_0x404a94[_0xda49('0x2b')]=_[_0xda49('0x2a')](_0x8d99cc['query']);_0x404a94[_0xda49('0x2c')]=_[_0xda49('0x2d')](_0x404a94['model'],_0x404a94['query']);_0x522a1f['attributes']=_[_0xda49('0x2d')](_0x404a94[_0xda49('0x2e')],qs[_0xda49('0x2f')](_0x8d99cc[_0xda49('0x2b')]['fields']));_0x522a1f[_0xda49('0x30')]=_0x522a1f['attributes']['length']?_0x522a1f[_0xda49('0x30')]:_0x404a94[_0xda49('0x2e')];if(!_0x8d99cc['query'][_0xda49('0x31')](_0xda49('0x32'))){_0x522a1f['limit']=qs[_0xda49('0x33')](_0x8d99cc[_0xda49('0x2b')][_0xda49('0x33')]);_0x522a1f['offset']=qs[_0xda49('0x1c')](_0x8d99cc['query'][_0xda49('0x1c')]);}_0x522a1f[_0xda49('0x34')]=qs[_0xda49('0x35')](_0x8d99cc[_0xda49('0x2b')][_0xda49('0x35')]);_0x522a1f['where']=qs['filters'](_[_0xda49('0x36')](_0x8d99cc[_0xda49('0x2b')],_0x404a94[_0xda49('0x2c')]));if(_0x8d99cc[_0xda49('0x2b')][_0xda49('0x37')]){_0x522a1f['where']=_[_0xda49('0x38')](_0x522a1f['where'],{'$or':_[_0xda49('0x39')](_0x7a7193,function(_0x12d6da){if(_0x12d6da[_0xda49('0x3a')][_0xda49('0x3b')]!=='VIRTUAL'){var _0x2c8c8b={};_0x2c8c8b[_0x12d6da[_0xda49('0x3c')]]={'$like':'%'+_0x8d99cc[_0xda49('0x2b')][_0xda49('0x37')]+'%'};return _0x2c8c8b;}})});}_0x522a1f=_[_0xda49('0x38')]({},_0x522a1f,_0x8d99cc[_0xda49('0x3d')]);var _0x3fb1fa={'where':_0x522a1f[_0xda49('0x3e')]};return db[_0xda49('0x28')][_0xda49('0x1b')](_0x3fb1fa)[_0xda49('0x22')](function(_0x4dbe24){_0x16354f[_0xda49('0x1b')]=_0x4dbe24;if(_0x8d99cc['query'][_0xda49('0x3f')]){_0x522a1f[_0xda49('0x40')]=[{'all':!![]}];}return db[_0xda49('0x28')][_0xda49('0x41')](_0x522a1f);})['then'](function(_0x539713){_0x16354f['rows']=_0x539713;return _0x16354f;})['then'](respondWithFilteredResult(_0x27c3ba,_0x522a1f))[_0xda49('0x42')](handleError(_0x27c3ba,null));};exports[_0xda49('0x43')]=function(_0x10e0d6,_0x59c3ee){var _0x3fcb0b={'raw':!![],'where':{'id':_0x10e0d6[_0xda49('0x44')]['id']}},_0x31cfd0={};_0x31cfd0['model']=_[_0xda49('0x2a')](db['SmsApplication'][_0xda49('0x29')]);_0x31cfd0['query']=_[_0xda49('0x2a')](_0x10e0d6['query']);_0x31cfd0['filters']=_[_0xda49('0x2d')](_0x31cfd0[_0xda49('0x2e')],_0x31cfd0['query']);_0x3fcb0b[_0xda49('0x30')]=_[_0xda49('0x2d')](_0x31cfd0[_0xda49('0x2e')],qs[_0xda49('0x2f')](_0x10e0d6[_0xda49('0x2b')][_0xda49('0x2f')]));_0x3fcb0b[_0xda49('0x30')]=_0x3fcb0b['attributes'][_0xda49('0x45')]?_0x3fcb0b['attributes']:_0x31cfd0[_0xda49('0x2e')];if(_0x10e0d6['query'][_0xda49('0x3f')]){_0x3fcb0b[_0xda49('0x40')]=[{'all':!![]}];}_0x3fcb0b=_[_0xda49('0x38')]({},_0x3fcb0b,_0x10e0d6['options']);return db[_0xda49('0x28')][_0xda49('0x46')](_0x3fcb0b)[_0xda49('0x22')](handleEntityNotFound(_0x59c3ee,null))[_0xda49('0x22')](respondWithResult(_0x59c3ee,null))[_0xda49('0x42')](handleError(_0x59c3ee,null));};exports[_0xda49('0x47')]=function(_0x493340,_0x46b2c7){return db[_0xda49('0x28')][_0xda49('0x47')](_0x493340[_0xda49('0x48')],{})[_0xda49('0x22')](respondWithResult(_0x46b2c7,0xc9))[_0xda49('0x42')](handleError(_0x46b2c7,null));};exports['update']=function(_0x36a416,_0x46035b){if(_0x36a416[_0xda49('0x48')]['id']){delete _0x36a416[_0xda49('0x48')]['id'];}return db[_0xda49('0x28')]['find']({'where':{'id':_0x36a416[_0xda49('0x44')]['id']}})[_0xda49('0x22')](handleEntityNotFound(_0x46035b,null))[_0xda49('0x22')](saveUpdates(_0x36a416[_0xda49('0x48')],null))[_0xda49('0x22')](respondWithResult(_0x46035b,null))[_0xda49('0x42')](handleError(_0x46035b,null));};exports[_0xda49('0x23')]=function(_0x549bfa,_0x231ee0){return db[_0xda49('0x28')][_0xda49('0x46')]({'where':{'id':_0x549bfa[_0xda49('0x44')]['id']}})[_0xda49('0x22')](handleEntityNotFound(_0x231ee0,null))[_0xda49('0x22')](removeEntity(_0x231ee0,null))[_0xda49('0x42')](handleError(_0x231ee0,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index f6cabc7..b9a5714 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 _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','lodash'];(function(_0x4dae7f,_0x3db01e){var _0x33da0c=function(_0x345358){while(--_0x345358){_0x4dae7f['push'](_0x4dae7f['shift']());}};_0x33da0c(++_0x3db01e);}(_0x326f,0xd1));var _0xf326=function(_0xc48b0f,_0x224ed0){_0xc48b0f=_0xc48b0f-0x0;var _0x53dd9f=_0x326f[_0xc48b0f];return _0x53dd9f;};'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':!![],'charset':_0xf326('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1261=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','define','sms_applications'];(function(_0x1310c2,_0x4cc16c){var _0x1ef9db=function(_0x5eedf7){while(--_0x5eedf7){_0x1310c2['push'](_0x1310c2['shift']());}};_0x1ef9db(++_0x4cc16c);}(_0x1261,0x144));var _0x1126=function(_0x193ddf,_0x6f30bb){_0x193ddf=_0x193ddf-0x0;var _0x5bc6df=_0x1261[_0x193ddf];return _0x5bc6df;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('SmsApplication',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1126('0xc'),'collate':_0x1126('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 4363e9c..080855d 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 _0xbc8b=['message','info','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x36fae5,_0x26afed){var _0x433d0f=function(_0x45f726){while(--_0x45f726){_0x36fae5['push'](_0x36fae5['shift']());}};_0x433d0f(++_0x26afed);}(_0xbc8b,0x68));var _0xbbc8=function(_0x368e09,_0x2c1517){_0x368e09=_0x368e09-0x0;var _0x14b7df=_0xbc8b[_0x368e09];return _0x14b7df;};'use strict';var _=require(_0xbbc8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbbc8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbbc8('0x2'));var db=require(_0xbbc8('0x3'))['db'];var utils=require(_0xbbc8('0x4'));var logger=require(_0xbbc8('0x5'))(_0xbbc8('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbbc8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6c059b,_0x5332d6,_0x540eb7){return new BPromise(function(_0xbbfbe4,_0x5a8c4a){return client[_0xbbc8('0x8')](_0x6c059b,_0x540eb7)['then'](function(_0x45dccc){logger['info'](_0xbbc8('0x9'),_0x5332d6,'request\x20sent');logger[_0xbbc8('0xa')](_0xbbc8('0xb'),_0x5332d6,_0xbbc8('0xc'),JSON[_0xbbc8('0xd')](_0x45dccc));if(_0x45dccc[_0xbbc8('0xe')]){if(_0x45dccc[_0xbbc8('0xe')][_0xbbc8('0xf')]===0x1f4){logger[_0xbbc8('0xe')](_0xbbc8('0x9'),_0x5332d6,_0x45dccc[_0xbbc8('0xe')][_0xbbc8('0x10')]);return _0x5a8c4a(_0x45dccc['error'][_0xbbc8('0x10')]);}logger[_0xbbc8('0xe')](_0xbbc8('0x9'),_0x5332d6,_0x45dccc[_0xbbc8('0xe')][_0xbbc8('0x10')]);return _0xbbfbe4(_0x45dccc[_0xbbc8('0xe')]['message']);}else{logger[_0xbbc8('0x11')](_0xbbc8('0x9'),_0x5332d6,_0xbbc8('0xc'));_0xbbfbe4(_0x45dccc[_0xbbc8('0x12')]['message']);}})[_0xbbc8('0x13')](function(_0x52e08d){logger[_0xbbc8('0xe')](_0xbbc8('0x9'),_0x5332d6,_0x52e08d);_0x5a8c4a(_0x52e08d);});});} \ No newline at end of file +var _0x907f=['request\x20sent','debug','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s'];(function(_0x3e7b07,_0x19364a){var _0x33c396=function(_0x3aa3e3){while(--_0x3aa3e3){_0x3e7b07['push'](_0x3e7b07['shift']());}};_0x33c396(++_0x19364a);}(_0x907f,0x1cf));var _0xf907=function(_0xaf439c,_0x57c4f6){_0xaf439c=_0xaf439c-0x0;var _0x2903f5=_0x907f[_0xaf439c];return _0x2903f5;};'use strict';var _=require(_0xf907('0x0'));var util=require('util');var moment=require(_0xf907('0x1'));var BPromise=require(_0xf907('0x2'));var rs=require(_0xf907('0x3'));var fs=require('fs');var Redis=require(_0xf907('0x4'));var db=require(_0xf907('0x5'))['db'];var utils=require(_0xf907('0x6'));var logger=require(_0xf907('0x7'))(_0xf907('0x8'));var config=require(_0xf907('0x9'));var jayson=require(_0xf907('0xa'));var client=jayson[_0xf907('0xb')][_0xf907('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xa41f35,_0x4dd38a,_0x3e3e93){return new BPromise(function(_0x3fa23d,_0x4a33ed){return client[_0xf907('0xd')](_0xa41f35,_0x3e3e93)[_0xf907('0xe')](function(_0x30bffa){logger[_0xf907('0xf')](_0xf907('0x10'),_0x4dd38a,_0xf907('0x11'));logger[_0xf907('0x12')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x4dd38a,_0xf907('0x11'),JSON['stringify'](_0x30bffa));if(_0x30bffa[_0xf907('0x13')]){if(_0x30bffa[_0xf907('0x13')][_0xf907('0x14')]===0x1f4){logger[_0xf907('0x13')](_0xf907('0x10'),_0x4dd38a,_0x30bffa['error'][_0xf907('0x15')]);return _0x4a33ed(_0x30bffa[_0xf907('0x13')][_0xf907('0x15')]);}logger['error'](_0xf907('0x10'),_0x4dd38a,_0x30bffa[_0xf907('0x13')]['message']);return _0x3fa23d(_0x30bffa[_0xf907('0x13')]['message']);}else{logger[_0xf907('0xf')](_0xf907('0x10'),_0x4dd38a,_0xf907('0x11'));_0x3fa23d(_0x30bffa[_0xf907('0x16')]['message']);}})[_0xf907('0x17')](function(_0x340f6d){logger[_0xf907('0x13')](_0xf907('0x10'),_0x4dd38a,_0x340f6d);_0x4a33ed(_0x340f6d);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 0c6fd4f..e0cb6e5 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 _0x6ee2=['create','post','addMessage','/:id/tags','tracked','smsinteraction:addtags','addTags','put','sms','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','/:id/download'];(function(_0x5a3a6c,_0x594318){var _0x1b2d27=function(_0x231b8e){while(--_0x231b8e){_0x5a3a6c['push'](_0x5a3a6c['shift']());}};_0x1b2d27(++_0x594318);}(_0x6ee2,0x8f));var _0x26ee=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x6ee2[_0xc4001c];return _0x49f7bc;};'use strict';var multer=require(_0x26ee('0x0'));var util=require(_0x26ee('0x1'));var path=require(_0x26ee('0x2'));var timeout=require(_0x26ee('0x3'));var express=require(_0x26ee('0x4'));var router=express[_0x26ee('0x5')]();var auth=require(_0x26ee('0x6'));var interaction=require(_0x26ee('0x7'));var config=require('../../config/environment');var controller=require(_0x26ee('0x8'));router[_0x26ee('0x9')]('/',auth[_0x26ee('0xa')](),controller[_0x26ee('0xb')]);router['get'](_0x26ee('0xc'),auth[_0x26ee('0xa')](),controller[_0x26ee('0xd')]);router[_0x26ee('0x9')](_0x26ee('0xe'),auth[_0x26ee('0xa')](),controller['show']);router[_0x26ee('0x9')](_0x26ee('0xf'),auth[_0x26ee('0xa')](),controller['getMessages']);router[_0x26ee('0x9')](_0x26ee('0x10'),auth[_0x26ee('0xa')](),controller['download']);router['post']('/',auth[_0x26ee('0xa')](),controller[_0x26ee('0x11')]);router[_0x26ee('0x12')]('/:id/messages',auth[_0x26ee('0xa')](),controller[_0x26ee('0x13')]);router['post'](_0x26ee('0x14'),auth[_0x26ee('0xa')](),interaction[_0x26ee('0x15')]('sms',_0x26ee('0x16')),controller[_0x26ee('0x17')]);router[_0x26ee('0x18')](_0x26ee('0xe'),auth[_0x26ee('0xa')](),interaction[_0x26ee('0x15')](_0x26ee('0x19'),'smsinteraction:update'),controller[_0x26ee('0x1a')]);router[_0x26ee('0x1b')](_0x26ee('0xe'),auth[_0x26ee('0xa')](),interaction[_0x26ee('0x15')](_0x26ee('0x19'),_0x26ee('0x1c')),controller[_0x26ee('0x1d')]);router[_0x26ee('0x1b')](_0x26ee('0x14'),auth[_0x26ee('0xa')](),controller[_0x26ee('0x1e')]);module[_0x26ee('0x1f')]=router; \ No newline at end of file +var _0x4653=['../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','tracked','sms','smsinteraction:addtags','put','/:id','smsinteraction:update','update','smsinteraction:destroy','destroy','delete','removeTags','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xb0469e,_0x57edb5){var _0x3a8da5=function(_0x5b3f5d){while(--_0x5b3f5d){_0xb0469e['push'](_0xb0469e['shift']());}};_0x3a8da5(++_0x57edb5);}(_0x4653,0x110));var _0x3465=function(_0xcfa5ff,_0x4f6496){_0xcfa5ff=_0xcfa5ff-0x0;var _0x1522a7=_0x4653[_0xcfa5ff];return _0x1522a7;};'use strict';var multer=require(_0x3465('0x0'));var util=require(_0x3465('0x1'));var path=require(_0x3465('0x2'));var timeout=require('connect-timeout');var express=require(_0x3465('0x3'));var router=express[_0x3465('0x4')]();var auth=require(_0x3465('0x5'));var interaction=require(_0x3465('0x6'));var config=require(_0x3465('0x7'));var controller=require(_0x3465('0x8'));router[_0x3465('0x9')]('/',auth[_0x3465('0xa')](),controller[_0x3465('0xb')]);router[_0x3465('0x9')](_0x3465('0xc'),auth[_0x3465('0xa')](),controller[_0x3465('0xd')]);router['get']('/:id',auth[_0x3465('0xa')](),controller[_0x3465('0xe')]);router[_0x3465('0x9')](_0x3465('0xf'),auth[_0x3465('0xa')](),controller[_0x3465('0x10')]);router[_0x3465('0x9')](_0x3465('0x11'),auth[_0x3465('0xa')](),controller[_0x3465('0x12')]);router[_0x3465('0x13')]('/',auth[_0x3465('0xa')](),controller['create']);router[_0x3465('0x13')](_0x3465('0xf'),auth[_0x3465('0xa')](),controller['addMessage']);router[_0x3465('0x13')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x3465('0x14')](_0x3465('0x15'),_0x3465('0x16')),controller['addTags']);router[_0x3465('0x17')](_0x3465('0x18'),auth[_0x3465('0xa')](),interaction[_0x3465('0x14')](_0x3465('0x15'),_0x3465('0x19')),controller[_0x3465('0x1a')]);router['delete'](_0x3465('0x18'),auth['isAuthenticated'](),interaction[_0x3465('0x14')](_0x3465('0x15'),_0x3465('0x1b')),controller[_0x3465('0x1c')]);router[_0x3465('0x1d')]('/:id/tags',auth['isAuthenticated'](),controller[_0x3465('0x1e')]);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 423485a..c3d507c 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 _0xd4b3=['sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x5e27e6,_0x19ea3e){var _0x3b2618=function(_0x124d47){while(--_0x124d47){_0x5e27e6['push'](_0x5e27e6['shift']());}};_0x3b2618(++_0x19ea3e);}(_0xd4b3,0x188));var _0x3d4b=function(_0x5ac141,_0x3d111a){_0x5ac141=_0x5ac141-0x0;var _0x19b35b=_0xd4b3[_0x5ac141];return _0x19b35b;};'use strict';var Sequelize=require(_0x3d4b('0x0'));var moment=require(_0x3d4b('0x1'));module[_0x3d4b('0x2')]={'closed':{'type':Sequelize[_0x3d4b('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3d4b('0x4')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3d4b('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x3d4b('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3d4b('0x7')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xf1bf=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0x14a862,_0x2b559d){var _0x245eb5=function(_0x6e014c){while(--_0x6e014c){_0x14a862['push'](_0x14a862['shift']());}};_0x245eb5(++_0x2b559d);}(_0xf1bf,0xad));var _0xff1b=function(_0x55dc3f,_0x22c96f){_0x55dc3f=_0x55dc3f-0x0;var _0x33bded=_0xf1bf[_0x55dc3f];return _0x33bded;};'use strict';var Sequelize=require(_0xff1b('0x0'));var moment=require(_0xff1b('0x1'));module['exports']={'closed':{'type':Sequelize[_0xff1b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xff1b('0x3')]},'disposition':{'type':Sequelize[_0xff1b('0x4')]},'note':{'type':Sequelize[_0xff1b('0x4')]},'phone':{'type':Sequelize[_0xff1b('0x4')]},'read1stAt':{'type':Sequelize[_0xff1b('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xff1b('0x5')]('in',_0xff1b('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xff1b('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xff1b('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index f2d27b7..322a623 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 _0x6e9b=['\x0a\x20\x20\x20\x20\x20\x20\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\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\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\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\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\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\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\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\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\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','Sms','YYYY-MM-DD','closed','disposition','Messages','direction','out','System','lastName','renderFile','views','downloadInteraction.html','toFile','.pdf','log','err','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Users','TagIds','Tags','split','forEach','catch','index','SmsInteraction','rawAttributes','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','COUNT(*)','me.SmsInteractionId\x20=\x20i.id','me.read\x20=\x20false','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','expr','advancedFilter','createdAt','value','dateStart','day','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','unreadMessages','length','tableAlias','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','\x20IN\x20?','map','isNil','isEmpty','i.SmsAccountId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20IS\x20NULL','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','group','i.id','QueryTypes','SELECT','clone','COUNT(me.id)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','t.id\x20=\x20it.TagId','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','t.id\x20IN\x20?','sequelize','keyBy','merge','Account.key','Contact.firstName','Contact.lastName','c.phone','c.fax','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','SmsInteractionId','all','rows','show','params','includeAll','include','options','find','create','body','describe','addMessage','ids','omit','getMessages','findOne','SmsMessage','YYYY-MM-DD\x20HH:mm:ss','addTags','spread','Tag','emit','smsInteractionTags:save','removeTags','download','unix','root','server','files','attachments','transcript-%d-%s.zip','secret','User','fullname','CmContact','Contact','firstName','SmsAccount','Account','Owner','get','10px','40px'];(function(_0x522fd2,_0x4c48dd){var _0x4ccea8=function(_0x29b52b){while(--_0x29b52b){_0x522fd2['push'](_0x522fd2['shift']());}};_0x4ccea8(++_0x4c48dd);}(_0x6e9b,0xea));var _0xb6e9=function(_0x889c2b,_0x16eca5){_0x889c2b=_0x889c2b-0x0;var _0x160701=_0x6e9b[_0x889c2b];return _0x160701;};'use strict';var pdf=require(_0xb6e9('0x0'));var emlformat=require(_0xb6e9('0x1'));var rimraf=require(_0xb6e9('0x2'));var zipdir=require(_0xb6e9('0x3'));var jsonpatch=require(_0xb6e9('0x4'));var rp=require('request-promise');var moment=require(_0xb6e9('0x5'));var BPromise=require(_0xb6e9('0x6'));var Mustache=require(_0xb6e9('0x7'));var util=require('util');var path=require(_0xb6e9('0x8'));var sox=require(_0xb6e9('0x9'));var csv=require(_0xb6e9('0xa'));var ejs=require(_0xb6e9('0xb'));var fs=require('fs');var _=require(_0xb6e9('0xc'));var squel=require(_0xb6e9('0xd'));var crypto=require(_0xb6e9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb6e9('0xf'));var toCsv=require(_0xb6e9('0xa'));var querystring=require(_0xb6e9('0x10'));var Papa=require(_0xb6e9('0x11'));var Redis=require(_0xb6e9('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb6e9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb6e9('0x14'));var config=require(_0xb6e9('0x15'));var db=require('../../mysqldb')['db'];config[_0xb6e9('0x16')]=_['defaults'](config[_0xb6e9('0x16')],{'host':_0xb6e9('0x17'),'port':0x18eb});var socket=require(_0xb6e9('0x18'))(new Redis(config[_0xb6e9('0x16')]));require('./smsInteraction.socket')[_0xb6e9('0x19')](socket);function respondWithStatusCode(_0x4e0abc,_0x92e54c){_0x92e54c=_0x92e54c||0xcc;return function(_0xb14b72){if(_0xb14b72){return _0x4e0abc[_0xb6e9('0x1a')](_0x92e54c);}return _0x4e0abc[_0xb6e9('0x1b')](_0x92e54c)[_0xb6e9('0x1c')]();};}function respondWithResult(_0x348be6,_0x1cf84d){_0x1cf84d=_0x1cf84d||0xc8;return function(_0x2777b8){if(_0x2777b8){return _0x348be6[_0xb6e9('0x1b')](_0x1cf84d)[_0xb6e9('0x1d')](_0x2777b8);}};}function respondWithFilteredResult(_0x3e6a34,_0x1c3b50){return function(_0x2c1f07){if(_0x2c1f07){var _0x5ceecf=_0x2c1f07[_0xb6e9('0x1e')],_0xca2aaa=_0x1c3b50[_0xb6e9('0x1f')],_0x30b16c=_0x1c3b50['offset']+_0x1c3b50[_0xb6e9('0x20')],_0xc4c632;if(_0x30b16c>=_0x5ceecf){_0x30b16c=_0x5ceecf;_0xc4c632=0xc8;}else{_0xc4c632=0xce;}_0x3e6a34['status'](_0xc4c632);return _0x3e6a34['set'](_0xb6e9('0x21'),_0xca2aaa+'-'+_0x30b16c+'/'+_0x5ceecf)[_0xb6e9('0x1d')](_0x2c1f07);}return null;};}function patchUpdates(_0x4ba58e){return function(_0x4b35e7){try{jsonpatch[_0xb6e9('0x22')](_0x4b35e7,_0x4ba58e,!![]);}catch(_0x32736f){return BPromise[_0xb6e9('0x23')](_0x32736f);}return _0x4b35e7[_0xb6e9('0x24')]();};}function saveUpdates(_0x2888d7,_0x4f1252){return function(_0x449567){if(_0x449567){return _0x449567[_0xb6e9('0x25')](_0x2888d7)[_0xb6e9('0x26')](function(_0x2f28e0){return _0x2f28e0;});}return null;};}function removeEntity(_0x4e0c16,_0x494914){return function(_0x535531){if(_0x535531){return _0x535531[_0xb6e9('0x27')]()[_0xb6e9('0x26')](function(){_0x4e0c16[_0xb6e9('0x1b')](0xcc)[_0xb6e9('0x1c')]();});}};}function handleEntityNotFound(_0x63f7b9,_0x39bdf0){return function(_0x1d3e56){if(!_0x1d3e56){_0x63f7b9[_0xb6e9('0x1a')](0x194);}return _0x1d3e56;};}function handleError(_0x5083df,_0x3b0cc){_0x3b0cc=_0x3b0cc||0x1f4;return function(_0x4d20f9){logger[_0xb6e9('0x28')](_0x4d20f9[_0xb6e9('0x29')]);if(_0x4d20f9[_0xb6e9('0x2a')]){delete _0x4d20f9['name'];}_0x5083df['status'](_0x3b0cc)[_0xb6e9('0x2b')](_0x4d20f9);};}function getInteractionUsers(_0x1823df,_0x343af5){return new BPromise(function(_0x4b054d,_0x9da66c){try{if(_0x343af5[_0x1823df['id']]){_0x1823df[_0xb6e9('0x2c')]=_['map'](_0x343af5[_0x1823df['id']],function(_0x311d30){return{'id':_0x311d30['id']};});}}catch(_0x197a9d){_0x9da66c(_0x197a9d);}_0x4b054d(_0x1823df);});}function getInteractionTags(_0x1ad27c,_0x2442fb){return new BPromise(function(_0x5dd6a2,_0x48ae38){try{if(_0x1ad27c[_0xb6e9('0x2d')]){_0x1ad27c[_0xb6e9('0x2e')]=[];_0x1ad27c[_0xb6e9('0x2d')][_0xb6e9('0x2f')](',')[_0xb6e9('0x30')](function(_0x3f934a){_0x1ad27c[_0xb6e9('0x2e')]['push'](_0x2442fb[_0x3f934a]);});}delete _0x1ad27c[_0xb6e9('0x2d')];}catch(_0xfc8b7d){_0x48ae38(_0xfc8b7d);}_0x5dd6a2(_0x1ad27c);});}function updateSmsInteraction(_0x5e7b94,_0x35ca7d,_0x99804d){return new BPromise(function(_0x5eb56c,_0x3bdb2c){return getInteractionUsers(_0x5e7b94,_0x99804d)['then'](function(_0x39abb7){return getInteractionTags(_0x39abb7,_0x35ca7d);})[_0xb6e9('0x26')](function(_0x10ee22){_0x5eb56c(_0x10ee22);})[_0xb6e9('0x31')](function(_0xc18cbb){_0x3bdb2c(_0xc18cbb);});});}exports[_0xb6e9('0x32')]=function(_0xeec1ad,_0x1f8b8d){var _0x35bd76={},_0x70f154={},_0x20d944={'count':0x0,'rows':[]};var _0x19c3a5=db[_0xb6e9('0x33')][_0xb6e9('0x34')];_0x70f154['model']=_[_0xb6e9('0x35')](_0x19c3a5);_0x70f154[_0xb6e9('0x36')]=_[_0xb6e9('0x35')](_0xeec1ad[_0xb6e9('0x36')]);_0x70f154[_0xb6e9('0x37')]=_[_0xb6e9('0x38')](_0x70f154[_0xb6e9('0x39')],_0x70f154[_0xb6e9('0x36')]);_0x35bd76['attributes']=_['intersection'](_0x70f154['model'],qs['fields'](_0xeec1ad[_0xb6e9('0x36')][_0xb6e9('0x3a')]));_0x35bd76['attributes']=_0x35bd76[_0xb6e9('0x3b')]['length']?_0x35bd76[_0xb6e9('0x3b')]:_0x70f154['model'];if(!_0xeec1ad['query'][_0xb6e9('0x3c')](_0xb6e9('0x3d'))){_0x35bd76[_0xb6e9('0x20')]=qs[_0xb6e9('0x20')](_0xeec1ad[_0xb6e9('0x36')][_0xb6e9('0x20')]);_0x35bd76[_0xb6e9('0x1f')]=qs[_0xb6e9('0x1f')](_0xeec1ad[_0xb6e9('0x36')][_0xb6e9('0x1f')]);}_0x35bd76['order']=qs['sort'](_0xeec1ad[_0xb6e9('0x36')][_0xb6e9('0x3e')]);_0x35bd76[_0xb6e9('0x3f')]=qs[_0xb6e9('0x37')](_[_0xb6e9('0x40')](_0xeec1ad[_0xb6e9('0x36')],_0x70f154[_0xb6e9('0x37')]));var _0x3da0b2=[];var _0x453edf=squel[_0xb6e9('0x41')]()[_0xb6e9('0x42')]('id')['field'](_0xb6e9('0x2a'))[_0xb6e9('0x42')](_0xb6e9('0x43'))[_0xb6e9('0x44')](_0xb6e9('0x45'));var _0x4f138e=squel[_0xb6e9('0x41')]()[_0xb6e9('0x42')](_0xb6e9('0x46'))[_0xb6e9('0x44')]('sms_messages','me')[_0xb6e9('0x3f')](_0xb6e9('0x47'))[_0xb6e9('0x3f')]('me.direction\x20=\x20\x27in\x27')[_0xb6e9('0x3f')](_0xb6e9('0x48'));var _0x5a32e1=squel['select']()['field']('u.id')[_0xb6e9('0x42')]('ui.SmsInteractionId')[_0xb6e9('0x44')](_0xb6e9('0x49'),'ui')[_0xb6e9('0x4a')]('users','u',_0xb6e9('0x4b'));var _0x517bd4=squel['select']()[_0xb6e9('0x44')](_0xb6e9('0x4c'),'i')['left_join'](_0xb6e9('0x4d'),'c',_0xb6e9('0x4e'))[_0xb6e9('0x4a')](_0xb6e9('0x4f'),'o',_0xb6e9('0x50'))[_0xb6e9('0x4a')](_0xb6e9('0x51'),'a',_0xb6e9('0x52'))[_0xb6e9('0x4a')](_0xb6e9('0x53'),'me','me.SmsInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false');var _0x10e7e3=squel[_0xb6e9('0x54')]();if(_0xeec1ad[_0xb6e9('0x36')][_0xb6e9('0x55')]){var _0x4ee803=JSON['parse'](_0xeec1ad['query']['advancedFilter']);_[_0xb6e9('0x35')](_0x4ee803)[_0xb6e9('0x30')](function(_0x42c763){var _0x8b0cef=_0x4ee803[_0x42c763];if(_0x42c763===_0xb6e9('0x56')){var _0x30c253=moment(_0x8b0cef[_0xb6e9('0x57')][_0xb6e9('0x58')])['startOf'](_0xb6e9('0x59'))['utc']()[_0xb6e9('0x5a')]();var _0x238bce=moment(_0x238bce)['utc']()[_0xb6e9('0x5b')]('day')[_0xb6e9('0x5a')]();_0x10e7e3[_0xb6e9('0x5c')](_0xb6e9('0x5d'),_0x30c253,_0x238bce);}else{if(_[_0xb6e9('0x5e')](_0x8b0cef[_0xb6e9('0x5f')])){_0x8b0cef[_0xb6e9('0x5f')][_0xb6e9('0x30')](function(_0x25c1a4){switch(_0x8b0cef[_0xb6e9('0x5f')][_0xb6e9('0x57')]){case'IS':if(_0x42c763!=='TagId'&&_0x42c763!==_0xb6e9('0x60')){if(_[_0xb6e9('0x5e')](_0x8b0cef[_0xb6e9('0x57')])&&_0x8b0cef[_0xb6e9('0x57')][_0xb6e9('0x61')]>0x1){_0x10e7e3[_0xb6e9('0x5c')](_0x8b0cef[_0xb6e9('0x62')]+'.'+_0x42c763+'\x20IN\x20?',_0x8b0cef[_0xb6e9('0x57')]);}else{_0x10e7e3['and'](_0x8b0cef[_0xb6e9('0x62')]+'.'+_0x42c763+_0xb6e9('0x63'),_0x8b0cef[_0xb6e9('0x57')][0x0]);}}break;case'=':_0x10e7e3['and'](_0x8b0cef[_0xb6e9('0x62')]+'.'+_0x42c763+'\x20=\x20?',_0x8b0cef[_0xb6e9('0x57')]);break;case _0xb6e9('0x64'):if(_0x42c763===_0xb6e9('0x65')){_0x10e7e3['and'](_0xb6e9('0x66')+_0xb6e9('0x67'),'%'+_0x8b0cef['value']+'%');_0x10e7e3['or'](_0xb6e9('0x68')+_0xb6e9('0x67'),'%'+_0x8b0cef[_0xb6e9('0x57')]+'%');_0x10e7e3['or'](_0xb6e9('0x69')+'\x20LIKE\x20?','%'+_0x8b0cef[_0xb6e9('0x57')]+'%');}else{_0x10e7e3['and'](_0x8b0cef[_0xb6e9('0x62')]+'.'+_0x42c763+'\x20LIKE\x20?','%'+_0x8b0cef['value']+'%');}break;case'>':_0x10e7e3[_0xb6e9('0x5c')](_0x8b0cef[_0xb6e9('0x62')]+'.'+_0x42c763+_0xb6e9('0x6a'),_0x8b0cef[_0xb6e9('0x57')]);break;case'<':_0x10e7e3[_0xb6e9('0x5c')](_0x8b0cef[_0xb6e9('0x62')]+'.'+_0x42c763+_0xb6e9('0x6b'),_0x8b0cef['value']);break;}});}else{switch(_0x8b0cef[_0xb6e9('0x5f')][_0xb6e9('0x57')]){case'IS':if(_0x42c763!=='TagId'&&_0x42c763!=='unreadMessages'){if(_[_0xb6e9('0x5e')](_0x8b0cef[_0xb6e9('0x57')])&&_0x8b0cef[_0xb6e9('0x57')][_0xb6e9('0x61')]>0x1){_0x10e7e3['and'](_0x8b0cef[_0xb6e9('0x62')]+'.'+_0x42c763+_0xb6e9('0x6c'),_0x8b0cef[_0xb6e9('0x57')]);}else{_0x10e7e3[_0xb6e9('0x5c')](_0x8b0cef['tableAlias']+'.'+_0x42c763+'\x20=\x20?',_0x8b0cef['value'][0x0]);}}break;case'=':_0x10e7e3[_0xb6e9('0x5c')](_0x8b0cef['tableAlias']+'.'+_0x42c763+_0xb6e9('0x63'),_0x8b0cef['value']);break;case'LIKE':if(_0x42c763==='ContactId'){_0x10e7e3['and'](_0xb6e9('0x66')+_0xb6e9('0x67'),'%'+_0x8b0cef[_0xb6e9('0x57')]+'%');_0x10e7e3['or'](_0xb6e9('0x68')+_0xb6e9('0x67'),'%'+_0x8b0cef['value']+'%');_0x10e7e3['or'](_0xb6e9('0x69')+_0xb6e9('0x67'),'%'+_0x8b0cef['value']+'%');}else{_0x10e7e3['and'](_0x8b0cef['tableAlias']+'.'+_0x42c763+_0xb6e9('0x67'),'%'+_0x8b0cef[_0xb6e9('0x57')]+'%');}break;case'>':_0x10e7e3[_0xb6e9('0x5c')](_0x8b0cef[_0xb6e9('0x62')]+'.'+_0x42c763+'\x20>\x20?',_0x8b0cef[_0xb6e9('0x57')]);break;case'<':_0x10e7e3[_0xb6e9('0x5c')](_0x8b0cef[_0xb6e9('0x62')]+'.'+_0x42c763+_0xb6e9('0x6b'),_0x8b0cef['value']);break;}}}});}else{var _0x18ae89=_(Object[_0xb6e9('0x35')](_0xeec1ad[_0xb6e9('0x36')]))[_0xb6e9('0x6d')](function(_0x603098){return _0x19c3a5[_0xb6e9('0x3c')](_0x603098)?_0x603098:undefined;})['filter'](function(_0x446ff1){return!_[_0xb6e9('0x6e')](_0x446ff1);})[_0xb6e9('0x57')]();if(!_[_0xb6e9('0x6f')](_0x18ae89)){_0x18ae89[_0xb6e9('0x30')](function(_0x3fba5e){if(_0x3fba5e==='SmsAccountId'){_0x517bd4[_0xb6e9('0x3f')](_0xb6e9('0x70'),[][_0xb6e9('0x71')](_0xeec1ad[_0xb6e9('0x36')][_0x3fba5e]));}else if(_0x3fba5e==='createdAt'){var _0x21b99d=JSON[_0xb6e9('0x72')](_0xeec1ad[_0xb6e9('0x36')][_0x3fba5e])[_0xb6e9('0x73')];var _0x5e9e5d=JSON['parse'](_0xeec1ad[_0xb6e9('0x36')][_0x3fba5e])[_0xb6e9('0x74')];_0x517bd4[_0xb6e9('0x3f')](_0xb6e9('0x5d'),_0x21b99d,_0x5e9e5d);}else{if(_0xeec1ad['query'][_0x3fba5e]===_0xb6e9('0x75')){_0x517bd4[_0xb6e9('0x3f')]('i.'+_0x3fba5e+_0xb6e9('0x76'));}else{_0x517bd4[_0xb6e9('0x3f')]('i.'+_0x3fba5e+'\x20=\x20?',_0xeec1ad['query'][_0x3fba5e]);}}});}if(_0xeec1ad[_0xb6e9('0x36')][_0xb6e9('0x77')]){var _0x2a2db1=_0xeec1ad[_0xb6e9('0x36')][_0xb6e9('0x77')][_0xb6e9('0x78')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xb6e9('0x79'));if(qs[_0xb6e9('0x7a')](_0x2a2db1)){_0x10e7e3['or'](_0xb6e9('0x7b'),_0x2a2db1+'%')['or'](_0xb6e9('0x7c'),_0x2a2db1+'%');}else{var _0x1be28c=[];_0x2a2db1[_0xb6e9('0x2f')]('\x20')[_0xb6e9('0x30')](function(_0x33dd33){_0x1be28c['push']('+'+_0x33dd33[_0xb6e9('0x7d')]());});var _0x58456c=_0x1be28c[_0xb6e9('0x7e')]('\x20');_0x10e7e3['or'](_0xb6e9('0x7f'),_0x58456c)['or'](_0xb6e9('0x80'),_0x2a2db1+'%');}}}_0x517bd4[_0xb6e9('0x3f')](_0x10e7e3);if(_0x35bd76['order']){_0x35bd76[_0xb6e9('0x81')][_0xb6e9('0x30')](function(_0x1fa262){_0x517bd4[_0xb6e9('0x81')]('i.'+_0x1fa262[0x0],_0x1fa262[0x1]===_0xb6e9('0x82')?![]:!![]);});}_0x517bd4[_0xb6e9('0x83')](_0xb6e9('0x84'));var _0x239d10={'type':db['Sequelize'][_0xb6e9('0x85')][_0xb6e9('0x86')],'raw':!![]};var _0x574282=_0x517bd4[_0xb6e9('0x87')]()[_0xb6e9('0x42')]('COUNT(*)')[_0xb6e9('0x42')](_0xb6e9('0x88'),_0xb6e9('0x60'));if(!_0xeec1ad[_0xb6e9('0x36')][_0xb6e9('0x55')]){if(_0xeec1ad[_0xb6e9('0x36')]['read']){if(_0xeec1ad[_0xb6e9('0x36')][_0xb6e9('0x89')]==0x1){_0x574282[_0xb6e9('0x8a')](_0xb6e9('0x8b'));_0x517bd4[_0xb6e9('0x8a')]('`unreadMessages`\x20=\x200');}else{_0x574282['having'](_0xb6e9('0x8c'));_0x517bd4[_0xb6e9('0x8a')]('`unreadMessages`\x20>\x200');}}if(_0xeec1ad[_0xb6e9('0x36')][_0xb6e9('0x8d')]){var _0x584b7c=_[_0xb6e9('0x5e')](_0xeec1ad['query'][_0xb6e9('0x8d')])?_0xeec1ad[_0xb6e9('0x36')]['tag']:new Array(_0xeec1ad[_0xb6e9('0x36')][_0xb6e9('0x8d')]);var _0x51896c=squel['expr']();_0x584b7c['forEach'](function(_0xc2ef33){_0x51896c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xc2ef33+',%');});_0x517bd4[_0xb6e9('0x8a')](_0x51896c);_0x574282[_0xb6e9('0x4a')]('sms_interaction_has_tags','it','it.SmsInteractionId\x20=\x20i.id');_0x574282[_0xb6e9('0x4a')](_0xb6e9('0x45'),'t',_0xb6e9('0x8e'));_0x574282[_0xb6e9('0x3f')]('t.id\x20IN\x20?',_0x584b7c);}}else{var _0x4ee803=JSON[_0xb6e9('0x72')](_0xeec1ad['query']['advancedFilter']);_[_0xb6e9('0x35')](_0x4ee803)['forEach'](function(_0x1695fb){var _0xfc4846=_0x4ee803[_0x1695fb];if(_0x1695fb==='TagId'){var _0x34241d=_0xfc4846['value'];var _0x157b6d=squel[_0xb6e9('0x54')]();_0x34241d['forEach'](function(_0x1d207e){_0x157b6d['or'](_0xb6e9('0x8f'),'%,'+_0x1d207e+',%');});_0x517bd4[_0xb6e9('0x8a')](_0x157b6d);_0x574282['left_join'](_0xb6e9('0x90'),'it','it.MailInteractionId\x20=\x20i.id');_0x574282[_0xb6e9('0x4a')]('tools_tags','t',_0xb6e9('0x8e'));_0x574282['where'](_0xb6e9('0x91'),_0x34241d);}else if(_0x1695fb===_0xb6e9('0x60')){if(_0xfc4846['value'][_0xb6e9('0x61')]===0x1){if(_0xfc4846[_0xb6e9('0x57')][0x0]===0x1){_0x574282[_0xb6e9('0x8a')](_0xb6e9('0x8b'));_0x517bd4[_0xb6e9('0x8a')](_0xb6e9('0x8b'));}else{_0x574282[_0xb6e9('0x8a')](_0xb6e9('0x8c'));_0x517bd4['having'](_0xb6e9('0x8c'));}}}});}db[_0xb6e9('0x92')][_0xb6e9('0x36')](_0x574282['toString'](),_0x239d10)[_0xb6e9('0x26')](function(_0x1410b2){_0x20d944['count']=_0x1410b2[_0xb6e9('0x61')];if(_0x20d944[_0xb6e9('0x1e')]===0x0)return[];return db[_0xb6e9('0x92')]['query'](_0x453edf['toString'](),_0x239d10)[_0xb6e9('0x26')](function(_0x3f4f32){_0x3da0b2=_[_0xb6e9('0x93')](_0x3f4f32,'id');_0x239d10=_[_0xb6e9('0x94')](_0x239d10,{'model':db[_0xb6e9('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x517bd4[_0xb6e9('0x42')](_0xb6e9('0x88'),_0xb6e9('0x60'));_0x517bd4[_0xb6e9('0x42')]('a.key',_0xb6e9('0x95'));_0x517bd4['field']('i.*');_0x517bd4[_0xb6e9('0x42')]('c.firstName',_0xb6e9('0x96'));_0x517bd4[_0xb6e9('0x42')](_0xb6e9('0x68'),_0xb6e9('0x97'));_0x517bd4[_0xb6e9('0x42')](_0xb6e9('0x69'),'Contact.email');_0x517bd4[_0xb6e9('0x42')](_0xb6e9('0x98'),'Contact.phone');_0x517bd4[_0xb6e9('0x42')]('c.mobile','Contact.mobile');_0x517bd4[_0xb6e9('0x42')](_0xb6e9('0x99'),'Contact.fax');_0x517bd4[_0xb6e9('0x42')](_0xb6e9('0x9a'),'TagIds');_0x517bd4['left_join']('sms_interaction_has_tags','it','it.SmsInteractionId\x20=\x20i.id');_0x517bd4[_0xb6e9('0x4a')](_0xb6e9('0x45'),'t',_0xb6e9('0x8e'));_0x517bd4[_0xb6e9('0x20')](_0x35bd76[_0xb6e9('0x20')]);_0x517bd4['offset'](_0x35bd76[_0xb6e9('0x1f')]);return db[_0xb6e9('0x92')][_0xb6e9('0x36')](_0x517bd4[_0xb6e9('0x7d')](),_0x239d10);})[_0xb6e9('0x26')](function(_0x498db6){_0x5a32e1[_0xb6e9('0x3f')]('ui.SmsInteractionId\x20IN\x20?',_[_0xb6e9('0x6d')](_0x498db6,'id'));return db[_0xb6e9('0x92')][_0xb6e9('0x36')](_0x5a32e1[_0xb6e9('0x7d')](),_0x239d10)[_0xb6e9('0x26')](function(_0x1a3182){var _0x56c408=_[_0xb6e9('0x9b')](_0x1a3182,_0xb6e9('0x9c'));var _0xda702b=[];_0x498db6[_0xb6e9('0x30')](function(_0x53cc65){_0xda702b['push'](updateSmsInteraction(_0x53cc65,_0x3da0b2,_0x56c408));});return BPromise[_0xb6e9('0x9d')](_0xda702b);});});})['then'](function(_0xb5882e){_0x20d944[_0xb6e9('0x9e')]=_0xb5882e;return _0x20d944;})[_0xb6e9('0x26')](respondWithFilteredResult(_0x1f8b8d,_0x35bd76))['catch'](handleError(_0x1f8b8d,null));};exports[_0xb6e9('0x9f')]=function(_0x408120,_0x2f441a){var _0x2d813f={'raw':![],'where':{'id':_0x408120[_0xb6e9('0xa0')]['id']}},_0x3039a6={};_0x3039a6['model']=_[_0xb6e9('0x35')](db[_0xb6e9('0x33')][_0xb6e9('0x34')]);_0x3039a6[_0xb6e9('0x36')]=_['keys'](_0x408120[_0xb6e9('0x36')]);_0x3039a6[_0xb6e9('0x37')]=_[_0xb6e9('0x38')](_0x3039a6[_0xb6e9('0x39')],_0x3039a6[_0xb6e9('0x36')]);_0x2d813f[_0xb6e9('0x3b')]=_[_0xb6e9('0x38')](_0x3039a6[_0xb6e9('0x39')],qs[_0xb6e9('0x3a')](_0x408120[_0xb6e9('0x36')][_0xb6e9('0x3a')]));_0x2d813f['attributes']=_0x2d813f[_0xb6e9('0x3b')][_0xb6e9('0x61')]?_0x2d813f['attributes']:_0x3039a6[_0xb6e9('0x39')];if(_0x408120[_0xb6e9('0x36')][_0xb6e9('0xa1')]){_0x2d813f[_0xb6e9('0xa2')]=[{'all':!![]}];}_0x2d813f=_['merge']({},_0x2d813f,_0x408120[_0xb6e9('0xa3')]);return db[_0xb6e9('0x33')][_0xb6e9('0xa4')](_0x2d813f)[_0xb6e9('0x26')](handleEntityNotFound(_0x2f441a,null))[_0xb6e9('0x26')](respondWithResult(_0x2f441a,null))[_0xb6e9('0x31')](handleError(_0x2f441a,null));};exports[_0xb6e9('0xa5')]=function(_0x4cfd9c,_0x486724){return db[_0xb6e9('0x33')][_0xb6e9('0xa5')](_0x4cfd9c['body'],{})[_0xb6e9('0x26')](respondWithResult(_0x486724,0xc9))[_0xb6e9('0x31')](handleError(_0x486724,null));};exports[_0xb6e9('0x25')]=function(_0x4401d1,_0x2b3cec){if(_0x4401d1[_0xb6e9('0xa6')]['id']){delete _0x4401d1[_0xb6e9('0xa6')]['id'];}return db['SmsInteraction'][_0xb6e9('0xa4')]({'where':{'id':_0x4401d1[_0xb6e9('0xa0')]['id']}})['then'](handleEntityNotFound(_0x2b3cec,null))[_0xb6e9('0x26')](saveUpdates(_0x4401d1[_0xb6e9('0xa6')],null))[_0xb6e9('0x26')](respondWithResult(_0x2b3cec,null))[_0xb6e9('0x31')](handleError(_0x2b3cec,null));};exports[_0xb6e9('0x27')]=function(_0x35a55c,_0x11d66e){return db[_0xb6e9('0x33')]['find']({'where':{'id':_0x35a55c['params']['id']}})['then'](handleEntityNotFound(_0x11d66e,null))['then'](removeEntity(_0x11d66e,null))[_0xb6e9('0x31')](handleError(_0x11d66e,null));};exports[_0xb6e9('0xa7')]=function(_0xebf38b,_0x3f5681){return db[_0xb6e9('0x33')][_0xb6e9('0xa7')]()['then'](respondWithResult(_0x3f5681,null))[_0xb6e9('0x31')](handleError(_0x3f5681,null));};exports['addMessage']=function(_0xc383c3,_0x4343b7,_0x1c42bd){return db['SmsMessage'][_0xb6e9('0xa4')]({'where':{'id':_0xc383c3[_0xb6e9('0xa0')]['id']}})[_0xb6e9('0x26')](handleEntityNotFound(_0x4343b7,null))[_0xb6e9('0x26')](function(_0xd8e87){if(_0xd8e87){return _0xd8e87[_0xb6e9('0xa8')](_0xc383c3[_0xb6e9('0xa6')][_0xb6e9('0xa9')],_[_0xb6e9('0xaa')](_0xc383c3[_0xb6e9('0xa6')],[_0xb6e9('0xa9'),'id'])||{});}})[_0xb6e9('0x26')](respondWithResult(_0x4343b7,null))[_0xb6e9('0x31')](handleError(_0x4343b7,null));};exports[_0xb6e9('0xab')]=function(_0x4dcaed,_0x237e73,_0x485c6d){var _0x3b2e62={'raw':![],'where':{}};var _0x52fb79={};var _0x55b262={'count':0x0,'rows':[]};return db[_0xb6e9('0x33')][_0xb6e9('0xac')]({'where':{'id':_0x4dcaed[_0xb6e9('0xa0')]['id']}})[_0xb6e9('0x26')](handleEntityNotFound(_0x237e73,null))[_0xb6e9('0x26')](function(_0x5f1446){if(_0x5f1446){_0x52fb79['model']=_[_0xb6e9('0x35')](db[_0xb6e9('0xad')]['rawAttributes']);_0x52fb79[_0xb6e9('0x36')]=_[_0xb6e9('0x35')](_0x4dcaed[_0xb6e9('0x36')]);_0x52fb79[_0xb6e9('0x37')]=_[_0xb6e9('0x38')](_0x52fb79[_0xb6e9('0x39')],_0x52fb79[_0xb6e9('0x36')]);_0x3b2e62[_0xb6e9('0x3b')]=_[_0xb6e9('0x38')](_0x52fb79[_0xb6e9('0x39')],qs[_0xb6e9('0x3a')](_0x4dcaed[_0xb6e9('0x36')][_0xb6e9('0x3a')]));_0x3b2e62['attributes']=_0x3b2e62['attributes'][_0xb6e9('0x61')]?_0x3b2e62[_0xb6e9('0x3b')]:_0x52fb79['model'];if(!_0x4dcaed[_0xb6e9('0x36')][_0xb6e9('0x3c')](_0xb6e9('0x3d'))){_0x3b2e62[_0xb6e9('0x20')]=qs[_0xb6e9('0x20')](_0x4dcaed[_0xb6e9('0x36')][_0xb6e9('0x20')]);_0x3b2e62[_0xb6e9('0x1f')]=qs[_0xb6e9('0x1f')](_0x4dcaed[_0xb6e9('0x36')][_0xb6e9('0x1f')]);}_0x3b2e62[_0xb6e9('0x81')]=qs[_0xb6e9('0x3e')](_0x4dcaed[_0xb6e9('0x36')][_0xb6e9('0x3e')]);_0x3b2e62['where']=qs[_0xb6e9('0x37')](_[_0xb6e9('0x40')](_0x4dcaed[_0xb6e9('0x36')],_0x52fb79[_0xb6e9('0x37')]));_0x3b2e62[_0xb6e9('0x3f')][_0xb6e9('0x9c')]=_0x5f1446['id'];if(_0x4dcaed[_0xb6e9('0x36')]['filter']){_0x3b2e62[_0xb6e9('0x3f')]=_[_0xb6e9('0x94')](_0x3b2e62[_0xb6e9('0x3f')],{'$or':_['map'](_0x3b2e62[_0xb6e9('0x3b')],function(_0x300617){var _0x1c5de2={};_0x1c5de2[_0x300617]={'$like':'%'+_0x4dcaed['query']['filter']+'%'};return _0x1c5de2;})});}if(_0x4dcaed[_0xb6e9('0x36')]['$gte']){var _0x52f109=_0x4dcaed[_0xb6e9('0x36')]['$gte']['split'](',');var _0x3431d5={};_0x3431d5[_0x52f109[0x0]]={'$gte':moment(_0x52f109[0x1])['format'](_0xb6e9('0xae'))};_0x3b2e62['where']=_[_0xb6e9('0x94')](_0x3b2e62[_0xb6e9('0x3f')],_0x3431d5);}_0x3b2e62=_[_0xb6e9('0x94')]({},_0x3b2e62,_0x4dcaed[_0xb6e9('0xa3')]);return db[_0xb6e9('0xad')][_0xb6e9('0x1e')]({'where':_0x3b2e62['where']})[_0xb6e9('0x26')](function(_0x4d1543){_0x55b262[_0xb6e9('0x1e')]=_0x4d1543;if(_0x4dcaed['query'][_0xb6e9('0xa1')]){_0x3b2e62['include']=[{'all':!![]}];}return db[_0xb6e9('0xad')]['findAll'](_0x3b2e62);})['then'](function(_0x1843cd){_0x55b262['rows']=_0x1843cd;return _0x55b262;});}})[_0xb6e9('0x26')](respondWithFilteredResult(_0x237e73,_0x3b2e62))[_0xb6e9('0x31')](handleError(_0x237e73,null));};exports[_0xb6e9('0xaf')]=function(_0x4b856f,_0x13d4c2,_0x288b96){return db[_0xb6e9('0x33')][_0xb6e9('0xa4')]({'where':{'id':_0x4b856f[_0xb6e9('0xa0')]['id']}})['then'](handleEntityNotFound(_0x13d4c2,null))['then'](function(_0x2dc309){if(_0x2dc309){return _0x2dc309['setTags'](_0x4b856f[_0xb6e9('0xa6')][_0xb6e9('0xa9')],_['omit'](_0x4b856f[_0xb6e9('0xa6')],[_0xb6e9('0xa9'),'id'])||{})[_0xb6e9('0xb0')](function(){return db[_0xb6e9('0xb1')]['findAll']({'attributes':['id',_0xb6e9('0x2a'),_0xb6e9('0x43')],'where':{'id':_0x4b856f[_0xb6e9('0xa6')][_0xb6e9('0xa9')]}});})[_0xb6e9('0x26')](function(_0x57348b){socket[_0xb6e9('0xb2')](_0xb6e9('0xb3'),{'id':Number(_0x4b856f[_0xb6e9('0xa0')]['id']),'tags':_0x57348b||[]});return{'id':Number(_0x4b856f[_0xb6e9('0xa0')]['id']),'tags':_0x57348b||[]};});}})[_0xb6e9('0x26')](respondWithResult(_0x13d4c2,null))['catch'](handleError(_0x13d4c2,null));};exports[_0xb6e9('0xb4')]=function(_0x4a9508,_0x1016d7,_0x33511d){return db[_0xb6e9('0x33')][_0xb6e9('0xa4')]({'where':{'id':_0x4a9508[_0xb6e9('0xa0')]['id']}})[_0xb6e9('0x26')](handleEntityNotFound(_0x1016d7,null))[_0xb6e9('0x26')](function(_0x235590){if(_0x235590){return _0x235590[_0xb6e9('0xb4')](_0x4a9508[_0xb6e9('0x36')]['ids']);}})[_0xb6e9('0x26')](respondWithStatusCode(_0x1016d7,null))['catch'](handleError(_0x1016d7,null));};exports[_0xb6e9('0xb5')]=function(_0x5e676c,_0x55b18b){var _0x4c81f2=moment()[_0xb6e9('0xb6')]()['toString']();var _0x14bfb7=path[_0xb6e9('0x7e')](config[_0xb6e9('0xb7')],_0xb6e9('0xb8'),_0xb6e9('0xb9'),'tmp');var _0x2da5d6=path['join'](config[_0xb6e9('0xb7')],'server',_0xb6e9('0xb9'),_0xb6e9('0xba'));var _0x5c1c24=path[_0xb6e9('0x7e')](_0x14bfb7,_0x4c81f2);var _0x4a5dc3=util['format'](_0xb6e9('0xbb'),_0x5e676c['params']['id'],_0x4c81f2);var _0x639496=path['join'](_0x14bfb7,_0x4a5dc3);var _0x3693c6=![];return db[_0xb6e9('0x33')][_0xb6e9('0xa4')]({'where':{'id':_0x5e676c[_0xb6e9('0xa0')]['id']},'include':[{'model':db['SmsMessage'],'as':'Messages','attributes':['id','body',_0xb6e9('0x56'),'direction',_0xb6e9('0xbc')],'include':[{'model':db['User'],'as':_0xb6e9('0xbd'),'attributes':['id',_0xb6e9('0xbe')],'raw':!![]},{'model':db[_0xb6e9('0xbf')],'as':_0xb6e9('0xc0'),'attributes':['id',_0xb6e9('0xc1'),'lastName'],'raw':!![]}]},{'model':db[_0xb6e9('0xc2')],'as':_0xb6e9('0xc3'),'attributes':['id','name']},{'model':db[_0xb6e9('0xbd')],'as':_0xb6e9('0xc4'),'attributes':['id','fullname']}]})[_0xb6e9('0x26')](handleEntityNotFound(_0x55b18b,null))['then'](function(_0x420019){if(_0x420019){var _0x142c42=_0x420019[_0xb6e9('0xc5')]({'plain':!![]});_0x3693c6=!![];var _0x38fc31={'format':'A4','border':_0xb6e9('0xc6'),'header':{'height':_0xb6e9('0xc7'),'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\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\x20\x20\x20\x20\x20\x20'}},'footer':{'height':'30px','contents':{'default':util[_0xb6e9('0x5a')](_0xb6e9('0xc8'),util[_0xb6e9('0x5a')]('%s\x20#%d',_0xb6e9('0xc9'),_0x142c42['id']),moment()[_0xb6e9('0x5a')](_0xb6e9('0xca'))[_0xb6e9('0x7d')]())}}};fs['mkdirSync'](_0x5c1c24);var _0x13b0db={'channel':_0xb6e9('0xc9'),'account':_0x142c42['Account']['name'],'agent':_0x142c42[_0xb6e9('0xc4')]?_0x142c42[_0xb6e9('0xc4')][_0xb6e9('0xbe')]:'N.A.','createdAt':moment(_0x142c42[_0xb6e9('0x56')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x142c42[_0xb6e9('0xcb')]?moment(_0x142c42['closedAt'])[_0xb6e9('0x5a')](_0xb6e9('0xae'))['toString']():'','disposition':_0x142c42[_0xb6e9('0xcc')],'messages':_(_0x142c42[_0xb6e9('0xcd')])[_0xb6e9('0x77')]({'secret':![]})['map'](function(_0x570258){return{'date':moment(_0x570258['createdAt'])[_0xb6e9('0x5a')](_0xb6e9('0xae'))[_0xb6e9('0x7d')](),'sender':_0x570258[_0xb6e9('0xce')]===_0xb6e9('0xcf')?_0x570258['User']?_0x570258[_0xb6e9('0xbd')]['fullname']:_0xb6e9('0xd0'):_0x570258[_0xb6e9('0xc0')]['firstName']+(_0x570258[_0xb6e9('0xc0')][_0xb6e9('0xd1')]?'\x20'+_0x570258[_0xb6e9('0xc0')]['lastName']:''),'body':_0x570258[_0xb6e9('0xa6')],'direction':_0x570258[_0xb6e9('0xce')]===_0xb6e9('0xcf')?'A':'C','secret':_0x570258[_0xb6e9('0xbc')]};})[_0xb6e9('0x57')]()};return ejs[_0xb6e9('0xd2')](path[_0xb6e9('0x7e')](config[_0xb6e9('0xb7')],'server',_0xb6e9('0xd3'),_0xb6e9('0xd4')),{'interaction':_0x13b0db})[_0xb6e9('0x26')](function(_0x145fdb){return new BPromise(function(_0x384c0f,_0x24128d){pdf[_0xb6e9('0xa5')](_0x145fdb,_0x38fc31)[_0xb6e9('0xd5')](path[_0xb6e9('0x7e')](_0x5c1c24,'transcript-'+_0x142c42['id']+'-'+_0x4c81f2+_0xb6e9('0xd6')),function(_0x27343d,_0x45d83a){if(_0x27343d)return _0x24128d(_0x27343d);_0x384c0f(_0x45d83a);});});});}})[_0xb6e9('0x26')](function(){if(_0x3693c6){return new BPromise(function(_0x224de5,_0x29c56b){zipdir(_0x5c1c24,{'saveTo':_0x639496},function(_0x474986,_0x7578e5){if(_0x474986)return _0x29c56b(_0x474986);return _0x224de5(_0x7578e5);});})['then'](function(){return new BPromise(function(_0xe1cb44,_0x3ff1ac){rimraf(_0x5c1c24,function(_0x4d4743){if(_0x4d4743)_0x3ff1ac(_0x4d4743);return _0xe1cb44();});});})['then'](function(){return _0x55b18b[_0xb6e9('0xb5')](_0x639496,_0x4a5dc3,function(_0x286bc4){if(_0x286bc4){console[_0xb6e9('0xd7')](_0xb6e9('0xd8'),_0x286bc4);}else{fs['unlinkSync'](_0x639496);}});});}else{return _0x55b18b[_0xb6e9('0x1a')](0xc8);}})[_0xb6e9('0x31')](handleError(_0x55b18b,null));}; \ No newline at end of file +var _0x3868=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./smsInteraction.socket','register','sendStatus','end','status','json','count','offset','limit','set','reject','then','destroy','error','stack','name','Users','map','TagIds','Tags','forEach','push','catch','index','SmsInteraction','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','field','color','from','tools_tags','select','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','user_has_sms_interactions','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','sms_messages','expr','advancedFilter','value','dateStart','startOf','day','utc','format','and','isArray','condition','TagId','tableAlias','\x20IN\x20?','\x20=\x20?','c.firstName','\x20LIKE\x20?','c.email','\x20>\x20?','\x20<\x20?','LIKE','ContactId','c.lastName','filter','isNil','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','toString','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','order','DESC','i.id','Sequelize','QueryTypes','SELECT','clone','COUNT(*)','COUNT(me.id)','unreadMessages','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','sequelize','keyBy','a.key','i.*','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','rows','show','params','includeAll','include','merge','options','find','create','body','update','describe','addMessage','SmsMessage','ids','omit','findOne','rawAttributes','split','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','Tag','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','Messages','direction','secret','User','fullname','CmContact','Contact','lastName','SmsAccount','Account','Owner','get','10px','40px','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\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\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\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\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\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\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\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\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\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','%s\x20#%d','Sms','closedAt','disposition','out','System','firstName','renderFile','downloadInteraction.html','toFile','.pdf','log','err','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring'];(function(_0xcd4120,_0x1ecf6e){var _0x1afe82=function(_0x17903e){while(--_0x17903e){_0xcd4120['push'](_0xcd4120['shift']());}};_0x1afe82(++_0x1ecf6e);}(_0x3868,0xcf));var _0x8386=function(_0x7ca79b,_0x1ddef5){_0x7ca79b=_0x7ca79b-0x0;var _0x3813b2=_0x3868[_0x7ca79b];return _0x3813b2;};'use strict';var pdf=require(_0x8386('0x0'));var emlformat=require(_0x8386('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8386('0x2'));var jsonpatch=require(_0x8386('0x3'));var rp=require(_0x8386('0x4'));var moment=require(_0x8386('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8386('0x6'));var util=require(_0x8386('0x7'));var path=require(_0x8386('0x8'));var sox=require(_0x8386('0x9'));var csv=require(_0x8386('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8386('0xb'));var squel=require(_0x8386('0xc'));var crypto=require(_0x8386('0xd'));var jsforce=require(_0x8386('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8386('0xa'));var querystring=require(_0x8386('0xf'));var Papa=require(_0x8386('0x10'));var Redis=require(_0x8386('0x11'));var authService=require(_0x8386('0x12'));var qs=require(_0x8386('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8386('0x14'))(_0x8386('0x15'));var utils=require(_0x8386('0x16'));var config=require('../../config/environment');var db=require(_0x8386('0x17'))['db'];config[_0x8386('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8386('0x19'))(new Redis(config['redis']));require(_0x8386('0x1a'))[_0x8386('0x1b')](socket);function respondWithStatusCode(_0x7a5d65,_0x49b512){_0x49b512=_0x49b512||0xcc;return function(_0x3ce6fe){if(_0x3ce6fe){return _0x7a5d65[_0x8386('0x1c')](_0x49b512);}return _0x7a5d65['status'](_0x49b512)[_0x8386('0x1d')]();};}function respondWithResult(_0x45eb60,_0x36ee2a){_0x36ee2a=_0x36ee2a||0xc8;return function(_0x1863c6){if(_0x1863c6){return _0x45eb60[_0x8386('0x1e')](_0x36ee2a)[_0x8386('0x1f')](_0x1863c6);}};}function respondWithFilteredResult(_0x4b566a,_0x577242){return function(_0x4ffcf4){if(_0x4ffcf4){var _0x480988=_0x4ffcf4[_0x8386('0x20')],_0x1f1bc1=_0x577242[_0x8386('0x21')],_0x57f07d=_0x577242[_0x8386('0x21')]+_0x577242[_0x8386('0x22')],_0x25eb16;if(_0x57f07d>=_0x480988){_0x57f07d=_0x480988;_0x25eb16=0xc8;}else{_0x25eb16=0xce;}_0x4b566a[_0x8386('0x1e')](_0x25eb16);return _0x4b566a[_0x8386('0x23')]('Content-Range',_0x1f1bc1+'-'+_0x57f07d+'/'+_0x480988)[_0x8386('0x1f')](_0x4ffcf4);}return null;};}function patchUpdates(_0x14106d){return function(_0x5a13c4){try{jsonpatch['apply'](_0x5a13c4,_0x14106d,!![]);}catch(_0x3443e3){return BPromise[_0x8386('0x24')](_0x3443e3);}return _0x5a13c4['save']();};}function saveUpdates(_0x5f3231,_0x44f0bd){return function(_0x5ee818){if(_0x5ee818){return _0x5ee818['update'](_0x5f3231)[_0x8386('0x25')](function(_0x53efe4){return _0x53efe4;});}return null;};}function removeEntity(_0x343c1c,_0x5b0668){return function(_0x1e2d09){if(_0x1e2d09){return _0x1e2d09[_0x8386('0x26')]()[_0x8386('0x25')](function(){_0x343c1c[_0x8386('0x1e')](0xcc)[_0x8386('0x1d')]();});}};}function handleEntityNotFound(_0xa8784b,_0x3f4b97){return function(_0x58d34e){if(!_0x58d34e){_0xa8784b['sendStatus'](0x194);}return _0x58d34e;};}function handleError(_0xaeff7d,_0x449d4c){_0x449d4c=_0x449d4c||0x1f4;return function(_0x5b0963){logger[_0x8386('0x27')](_0x5b0963[_0x8386('0x28')]);if(_0x5b0963[_0x8386('0x29')]){delete _0x5b0963[_0x8386('0x29')];}_0xaeff7d[_0x8386('0x1e')](_0x449d4c)['send'](_0x5b0963);};}function getInteractionUsers(_0x4587f5,_0x413ff8){return new BPromise(function(_0x4ef792,_0x4ae957){try{if(_0x413ff8[_0x4587f5['id']]){_0x4587f5[_0x8386('0x2a')]=_[_0x8386('0x2b')](_0x413ff8[_0x4587f5['id']],function(_0xd12779){return{'id':_0xd12779['id']};});}}catch(_0x108d47){_0x4ae957(_0x108d47);}_0x4ef792(_0x4587f5);});}function getInteractionTags(_0x39b321,_0x2aae82){return new BPromise(function(_0x40d175,_0x3d960e){try{if(_0x39b321[_0x8386('0x2c')]){_0x39b321[_0x8386('0x2d')]=[];_0x39b321[_0x8386('0x2c')]['split'](',')[_0x8386('0x2e')](function(_0x1fc284){_0x39b321[_0x8386('0x2d')][_0x8386('0x2f')](_0x2aae82[_0x1fc284]);});}delete _0x39b321['TagIds'];}catch(_0x31138d){_0x3d960e(_0x31138d);}_0x40d175(_0x39b321);});}function updateSmsInteraction(_0x3aa6a6,_0x3413ab,_0x243d30){return new BPromise(function(_0x3cb780,_0x293185){return getInteractionUsers(_0x3aa6a6,_0x243d30)['then'](function(_0x746652){return getInteractionTags(_0x746652,_0x3413ab);})[_0x8386('0x25')](function(_0x3f146e){_0x3cb780(_0x3f146e);})[_0x8386('0x30')](function(_0x4ef995){_0x293185(_0x4ef995);});});}exports[_0x8386('0x31')]=function(_0x400420,_0x1cc912){var _0x5b21df={},_0x4eb31f={},_0x3eb7ea={'count':0x0,'rows':[]};var _0x3e4c52=db[_0x8386('0x32')]['rawAttributes'];_0x4eb31f[_0x8386('0x33')]=_[_0x8386('0x34')](_0x3e4c52);_0x4eb31f[_0x8386('0x35')]=_[_0x8386('0x34')](_0x400420[_0x8386('0x35')]);_0x4eb31f[_0x8386('0x36')]=_['intersection'](_0x4eb31f[_0x8386('0x33')],_0x4eb31f[_0x8386('0x35')]);_0x5b21df[_0x8386('0x37')]=_[_0x8386('0x38')](_0x4eb31f['model'],qs['fields'](_0x400420[_0x8386('0x35')][_0x8386('0x39')]));_0x5b21df['attributes']=_0x5b21df['attributes'][_0x8386('0x3a')]?_0x5b21df[_0x8386('0x37')]:_0x4eb31f[_0x8386('0x33')];if(!_0x400420[_0x8386('0x35')][_0x8386('0x3b')](_0x8386('0x3c'))){_0x5b21df[_0x8386('0x22')]=qs[_0x8386('0x22')](_0x400420[_0x8386('0x35')][_0x8386('0x22')]);_0x5b21df[_0x8386('0x21')]=qs['offset'](_0x400420[_0x8386('0x35')][_0x8386('0x21')]);}_0x5b21df['order']=qs[_0x8386('0x3d')](_0x400420[_0x8386('0x35')]['sort']);_0x5b21df[_0x8386('0x3e')]=qs[_0x8386('0x36')](_[_0x8386('0x3f')](_0x400420[_0x8386('0x35')],_0x4eb31f[_0x8386('0x36')]));var _0x5cd32d=[];var _0x5f4e7f=squel['select']()[_0x8386('0x40')]('id')[_0x8386('0x40')]('name')[_0x8386('0x40')](_0x8386('0x41'))[_0x8386('0x42')](_0x8386('0x43'));var _0x56b330=squel[_0x8386('0x44')]()['field']('COUNT(*)')[_0x8386('0x42')]('sms_messages','me')[_0x8386('0x3e')]('me.SmsInteractionId\x20=\x20i.id')[_0x8386('0x3e')](_0x8386('0x45'))[_0x8386('0x3e')](_0x8386('0x46'));var _0x2c5c63=squel['select']()[_0x8386('0x40')](_0x8386('0x47'))[_0x8386('0x40')]('ui.SmsInteractionId')[_0x8386('0x42')](_0x8386('0x48'),'ui')[_0x8386('0x49')](_0x8386('0x4a'),'u','u.id\x20=\x20ui.UserId');var _0x5ccdae=squel['select']()[_0x8386('0x42')]('sms_interactions','i')['left_join'](_0x8386('0x4b'),'c',_0x8386('0x4c'))[_0x8386('0x49')](_0x8386('0x4a'),'o',_0x8386('0x4d'))[_0x8386('0x49')]('sms_accounts','a',_0x8386('0x4e'))[_0x8386('0x49')](_0x8386('0x4f'),'me','me.SmsInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false');var _0x46c325=squel[_0x8386('0x50')]();if(_0x400420[_0x8386('0x35')][_0x8386('0x51')]){var _0x4ecf29=JSON['parse'](_0x400420[_0x8386('0x35')]['advancedFilter']);_[_0x8386('0x34')](_0x4ecf29)[_0x8386('0x2e')](function(_0x24e5aa){var _0x39ac80=_0x4ecf29[_0x24e5aa];if(_0x24e5aa==='createdAt'){var _0x1f4194=moment(_0x39ac80[_0x8386('0x52')][_0x8386('0x53')])[_0x8386('0x54')](_0x8386('0x55'))[_0x8386('0x56')]()[_0x8386('0x57')]();var _0xd36a04=moment(_0xd36a04)[_0x8386('0x56')]()['endOf']('day')['format']();_0x46c325[_0x8386('0x58')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1f4194,_0xd36a04);}else{if(_[_0x8386('0x59')](_0x39ac80[_0x8386('0x5a')])){_0x39ac80[_0x8386('0x5a')][_0x8386('0x2e')](function(_0x2ef54e){switch(_0x39ac80[_0x8386('0x5a')][_0x8386('0x52')]){case'IS':if(_0x24e5aa!==_0x8386('0x5b')&&_0x24e5aa!=='unreadMessages'){if(_[_0x8386('0x59')](_0x39ac80[_0x8386('0x52')])&&_0x39ac80['value'][_0x8386('0x3a')]>0x1){_0x46c325[_0x8386('0x58')](_0x39ac80[_0x8386('0x5c')]+'.'+_0x24e5aa+_0x8386('0x5d'),_0x39ac80[_0x8386('0x52')]);}else{_0x46c325[_0x8386('0x58')](_0x39ac80[_0x8386('0x5c')]+'.'+_0x24e5aa+_0x8386('0x5e'),_0x39ac80[_0x8386('0x52')][0x0]);}}break;case'=':_0x46c325['and'](_0x39ac80[_0x8386('0x5c')]+'.'+_0x24e5aa+_0x8386('0x5e'),_0x39ac80[_0x8386('0x52')]);break;case'LIKE':if(_0x24e5aa==='ContactId'){_0x46c325['and'](_0x8386('0x5f')+_0x8386('0x60'),'%'+_0x39ac80[_0x8386('0x52')]+'%');_0x46c325['or']('c.lastName'+'\x20LIKE\x20?','%'+_0x39ac80[_0x8386('0x52')]+'%');_0x46c325['or'](_0x8386('0x61')+'\x20LIKE\x20?','%'+_0x39ac80['value']+'%');}else{_0x46c325[_0x8386('0x58')](_0x39ac80[_0x8386('0x5c')]+'.'+_0x24e5aa+'\x20LIKE\x20?','%'+_0x39ac80[_0x8386('0x52')]+'%');}break;case'>':_0x46c325['and'](_0x39ac80[_0x8386('0x5c')]+'.'+_0x24e5aa+_0x8386('0x62'),_0x39ac80[_0x8386('0x52')]);break;case'<':_0x46c325['and'](_0x39ac80[_0x8386('0x5c')]+'.'+_0x24e5aa+_0x8386('0x63'),_0x39ac80[_0x8386('0x52')]);break;}});}else{switch(_0x39ac80[_0x8386('0x5a')][_0x8386('0x52')]){case'IS':if(_0x24e5aa!==_0x8386('0x5b')&&_0x24e5aa!=='unreadMessages'){if(_['isArray'](_0x39ac80[_0x8386('0x52')])&&_0x39ac80[_0x8386('0x52')]['length']>0x1){_0x46c325['and'](_0x39ac80['tableAlias']+'.'+_0x24e5aa+_0x8386('0x5d'),_0x39ac80[_0x8386('0x52')]);}else{_0x46c325[_0x8386('0x58')](_0x39ac80[_0x8386('0x5c')]+'.'+_0x24e5aa+_0x8386('0x5e'),_0x39ac80['value'][0x0]);}}break;case'=':_0x46c325['and'](_0x39ac80[_0x8386('0x5c')]+'.'+_0x24e5aa+_0x8386('0x5e'),_0x39ac80['value']);break;case _0x8386('0x64'):if(_0x24e5aa===_0x8386('0x65')){_0x46c325[_0x8386('0x58')]('c.firstName'+'\x20LIKE\x20?','%'+_0x39ac80[_0x8386('0x52')]+'%');_0x46c325['or'](_0x8386('0x66')+'\x20LIKE\x20?','%'+_0x39ac80[_0x8386('0x52')]+'%');_0x46c325['or']('c.email'+_0x8386('0x60'),'%'+_0x39ac80[_0x8386('0x52')]+'%');}else{_0x46c325['and'](_0x39ac80[_0x8386('0x5c')]+'.'+_0x24e5aa+_0x8386('0x60'),'%'+_0x39ac80[_0x8386('0x52')]+'%');}break;case'>':_0x46c325[_0x8386('0x58')](_0x39ac80[_0x8386('0x5c')]+'.'+_0x24e5aa+'\x20>\x20?',_0x39ac80['value']);break;case'<':_0x46c325[_0x8386('0x58')](_0x39ac80[_0x8386('0x5c')]+'.'+_0x24e5aa+_0x8386('0x63'),_0x39ac80['value']);break;}}}});}else{var _0x359065=_(Object[_0x8386('0x34')](_0x400420['query']))['map'](function(_0x510171){return _0x3e4c52[_0x8386('0x3b')](_0x510171)?_0x510171:undefined;})[_0x8386('0x67')](function(_0x42a108){return!_[_0x8386('0x68')](_0x42a108);})[_0x8386('0x52')]();if(!_[_0x8386('0x69')](_0x359065)){_0x359065['forEach'](function(_0x218e29){if(_0x218e29===_0x8386('0x6a')){_0x5ccdae['where'](_0x8386('0x6b'),[][_0x8386('0x6c')](_0x400420[_0x8386('0x35')][_0x218e29]));}else if(_0x218e29===_0x8386('0x6d')){var _0x381d06=JSON['parse'](_0x400420['query'][_0x218e29])[_0x8386('0x6e')];var _0x2a12f2=JSON[_0x8386('0x6f')](_0x400420[_0x8386('0x35')][_0x218e29])['$lte'];_0x5ccdae[_0x8386('0x3e')](_0x8386('0x70'),_0x381d06,_0x2a12f2);}else{if(_0x400420[_0x8386('0x35')][_0x218e29]===_0x8386('0x71')){_0x5ccdae['where']('i.'+_0x218e29+_0x8386('0x72'));}else{_0x5ccdae[_0x8386('0x3e')]('i.'+_0x218e29+_0x8386('0x5e'),_0x400420['query'][_0x218e29]);}}});}if(_0x400420[_0x8386('0x35')][_0x8386('0x67')]){var _0x362bcd=_0x400420['query'][_0x8386('0x67')]['replace']('\x5c','\x5c\x5c')[_0x8386('0x73')]('\x27\x27',_0x8386('0x74'));if(qs[_0x8386('0x75')](_0x362bcd)){_0x46c325['or'](_0x8386('0x76'),_0x362bcd+'%')['or'](_0x8386('0x77'),_0x362bcd+'%');}else{var _0x5ecb9f=[];_0x362bcd['split']('\x20')[_0x8386('0x2e')](function(_0x3d50f2){_0x5ecb9f['push']('+'+_0x3d50f2[_0x8386('0x78')]());});var _0xb80427=_0x5ecb9f['join']('\x20');_0x46c325['or'](_0x8386('0x79'),_0xb80427)['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x362bcd+'%');}}}_0x5ccdae[_0x8386('0x3e')](_0x46c325);if(_0x5b21df['order']){_0x5b21df[_0x8386('0x7a')][_0x8386('0x2e')](function(_0x165249){_0x5ccdae[_0x8386('0x7a')]('i.'+_0x165249[0x0],_0x165249[0x1]===_0x8386('0x7b')?![]:!![]);});}_0x5ccdae['group'](_0x8386('0x7c'));var _0x5eff5d={'type':db[_0x8386('0x7d')][_0x8386('0x7e')][_0x8386('0x7f')],'raw':!![]};var _0x2f2260=_0x5ccdae[_0x8386('0x80')]()[_0x8386('0x40')](_0x8386('0x81'))[_0x8386('0x40')](_0x8386('0x82'),_0x8386('0x83'));if(!_0x400420[_0x8386('0x35')][_0x8386('0x51')]){if(_0x400420[_0x8386('0x35')][_0x8386('0x84')]){if(_0x400420[_0x8386('0x35')][_0x8386('0x84')]==0x1){_0x2f2260[_0x8386('0x85')]('`unreadMessages`\x20=\x200');_0x5ccdae[_0x8386('0x85')](_0x8386('0x86'));}else{_0x2f2260[_0x8386('0x85')](_0x8386('0x87'));_0x5ccdae[_0x8386('0x85')](_0x8386('0x87'));}}if(_0x400420[_0x8386('0x35')][_0x8386('0x88')]){var _0x15c74e=_[_0x8386('0x59')](_0x400420[_0x8386('0x35')]['tag'])?_0x400420[_0x8386('0x35')][_0x8386('0x88')]:new Array(_0x400420['query'][_0x8386('0x88')]);var _0x3b80c5=squel[_0x8386('0x50')]();_0x15c74e[_0x8386('0x2e')](function(_0x599a27){_0x3b80c5['or'](_0x8386('0x89'),'%,'+_0x599a27+',%');});_0x5ccdae['having'](_0x3b80c5);_0x2f2260[_0x8386('0x49')](_0x8386('0x8a'),'it',_0x8386('0x8b'));_0x2f2260[_0x8386('0x49')](_0x8386('0x43'),'t',_0x8386('0x8c'));_0x2f2260['where'](_0x8386('0x8d'),_0x15c74e);}}else{var _0x4ecf29=JSON[_0x8386('0x6f')](_0x400420[_0x8386('0x35')]['advancedFilter']);_[_0x8386('0x34')](_0x4ecf29)[_0x8386('0x2e')](function(_0xa908f2){var _0x135617=_0x4ecf29[_0xa908f2];if(_0xa908f2===_0x8386('0x5b')){var _0x357052=_0x135617[_0x8386('0x52')];var _0x5e29d5=squel[_0x8386('0x50')]();_0x357052['forEach'](function(_0x597695){_0x5e29d5['or'](_0x8386('0x89'),'%,'+_0x597695+',%');});_0x5ccdae[_0x8386('0x85')](_0x5e29d5);_0x2f2260[_0x8386('0x49')](_0x8386('0x8e'),'it','it.MailInteractionId\x20=\x20i.id');_0x2f2260[_0x8386('0x49')]('tools_tags','t',_0x8386('0x8c'));_0x2f2260[_0x8386('0x3e')](_0x8386('0x8d'),_0x357052);}else if(_0xa908f2==='unreadMessages'){if(_0x135617[_0x8386('0x52')][_0x8386('0x3a')]===0x1){if(_0x135617[_0x8386('0x52')][0x0]===0x1){_0x2f2260[_0x8386('0x85')](_0x8386('0x86'));_0x5ccdae[_0x8386('0x85')](_0x8386('0x86'));}else{_0x2f2260[_0x8386('0x85')](_0x8386('0x87'));_0x5ccdae[_0x8386('0x85')]('`unreadMessages`\x20>\x200');}}}});}db[_0x8386('0x8f')][_0x8386('0x35')](_0x2f2260[_0x8386('0x78')](),_0x5eff5d)[_0x8386('0x25')](function(_0x21eced){_0x3eb7ea[_0x8386('0x20')]=_0x21eced['length'];if(_0x3eb7ea[_0x8386('0x20')]===0x0)return[];return db['sequelize'][_0x8386('0x35')](_0x5f4e7f[_0x8386('0x78')](),_0x5eff5d)['then'](function(_0x4146ba){_0x5cd32d=_[_0x8386('0x90')](_0x4146ba,'id');_0x5eff5d=_['merge'](_0x5eff5d,{'model':db[_0x8386('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x5ccdae[_0x8386('0x40')]('COUNT(me.id)',_0x8386('0x83'));_0x5ccdae['field'](_0x8386('0x91'),'Account.key');_0x5ccdae[_0x8386('0x40')](_0x8386('0x92'));_0x5ccdae[_0x8386('0x40')]('c.firstName',_0x8386('0x93'));_0x5ccdae[_0x8386('0x40')](_0x8386('0x66'),_0x8386('0x94'));_0x5ccdae[_0x8386('0x40')](_0x8386('0x61'),_0x8386('0x95'));_0x5ccdae[_0x8386('0x40')](_0x8386('0x96'),_0x8386('0x97'));_0x5ccdae[_0x8386('0x40')](_0x8386('0x98'),'Contact.mobile');_0x5ccdae[_0x8386('0x40')](_0x8386('0x99'),_0x8386('0x9a'));_0x5ccdae[_0x8386('0x40')](_0x8386('0x9b'),_0x8386('0x2c'));_0x5ccdae[_0x8386('0x49')](_0x8386('0x8a'),'it','it.SmsInteractionId\x20=\x20i.id');_0x5ccdae['left_join'](_0x8386('0x43'),'t',_0x8386('0x8c'));_0x5ccdae[_0x8386('0x22')](_0x5b21df[_0x8386('0x22')]);_0x5ccdae[_0x8386('0x21')](_0x5b21df[_0x8386('0x21')]);return db[_0x8386('0x8f')][_0x8386('0x35')](_0x5ccdae[_0x8386('0x78')](),_0x5eff5d);})[_0x8386('0x25')](function(_0x441e0a){_0x2c5c63['where'](_0x8386('0x9c'),_['map'](_0x441e0a,'id'));return db['sequelize'][_0x8386('0x35')](_0x2c5c63[_0x8386('0x78')](),_0x5eff5d)[_0x8386('0x25')](function(_0x49353f){var _0x52a99e=_[_0x8386('0x9d')](_0x49353f,_0x8386('0x9e'));var _0x1146e9=[];_0x441e0a['forEach'](function(_0x5871a3){_0x1146e9[_0x8386('0x2f')](updateSmsInteraction(_0x5871a3,_0x5cd32d,_0x52a99e));});return BPromise['all'](_0x1146e9);});});})[_0x8386('0x25')](function(_0x568b4c){_0x3eb7ea[_0x8386('0x9f')]=_0x568b4c;return _0x3eb7ea;})['then'](respondWithFilteredResult(_0x1cc912,_0x5b21df))[_0x8386('0x30')](handleError(_0x1cc912,null));};exports[_0x8386('0xa0')]=function(_0x313577,_0x1f6ca2){var _0xcc7088={'raw':![],'where':{'id':_0x313577[_0x8386('0xa1')]['id']}},_0x235f56={};_0x235f56['model']=_[_0x8386('0x34')](db[_0x8386('0x32')]['rawAttributes']);_0x235f56['query']=_[_0x8386('0x34')](_0x313577[_0x8386('0x35')]);_0x235f56[_0x8386('0x36')]=_[_0x8386('0x38')](_0x235f56['model'],_0x235f56[_0x8386('0x35')]);_0xcc7088[_0x8386('0x37')]=_['intersection'](_0x235f56[_0x8386('0x33')],qs[_0x8386('0x39')](_0x313577[_0x8386('0x35')][_0x8386('0x39')]));_0xcc7088[_0x8386('0x37')]=_0xcc7088[_0x8386('0x37')][_0x8386('0x3a')]?_0xcc7088[_0x8386('0x37')]:_0x235f56[_0x8386('0x33')];if(_0x313577[_0x8386('0x35')][_0x8386('0xa2')]){_0xcc7088[_0x8386('0xa3')]=[{'all':!![]}];}_0xcc7088=_[_0x8386('0xa4')]({},_0xcc7088,_0x313577[_0x8386('0xa5')]);return db[_0x8386('0x32')][_0x8386('0xa6')](_0xcc7088)[_0x8386('0x25')](handleEntityNotFound(_0x1f6ca2,null))['then'](respondWithResult(_0x1f6ca2,null))[_0x8386('0x30')](handleError(_0x1f6ca2,null));};exports[_0x8386('0xa7')]=function(_0x69c323,_0x83381b){return db[_0x8386('0x32')][_0x8386('0xa7')](_0x69c323[_0x8386('0xa8')],{})[_0x8386('0x25')](respondWithResult(_0x83381b,0xc9))[_0x8386('0x30')](handleError(_0x83381b,null));};exports[_0x8386('0xa9')]=function(_0x2c641b,_0x2ae75d){if(_0x2c641b['body']['id']){delete _0x2c641b[_0x8386('0xa8')]['id'];}return db[_0x8386('0x32')][_0x8386('0xa6')]({'where':{'id':_0x2c641b[_0x8386('0xa1')]['id']}})[_0x8386('0x25')](handleEntityNotFound(_0x2ae75d,null))['then'](saveUpdates(_0x2c641b[_0x8386('0xa8')],null))['then'](respondWithResult(_0x2ae75d,null))[_0x8386('0x30')](handleError(_0x2ae75d,null));};exports[_0x8386('0x26')]=function(_0x2ff99e,_0x1e139d){return db['SmsInteraction']['find']({'where':{'id':_0x2ff99e[_0x8386('0xa1')]['id']}})[_0x8386('0x25')](handleEntityNotFound(_0x1e139d,null))[_0x8386('0x25')](removeEntity(_0x1e139d,null))['catch'](handleError(_0x1e139d,null));};exports[_0x8386('0xaa')]=function(_0x24ee8b,_0x5aee69){return db[_0x8386('0x32')][_0x8386('0xaa')]()['then'](respondWithResult(_0x5aee69,null))[_0x8386('0x30')](handleError(_0x5aee69,null));};exports[_0x8386('0xab')]=function(_0x41d78d,_0x261e34,_0x485952){return db[_0x8386('0xac')][_0x8386('0xa6')]({'where':{'id':_0x41d78d[_0x8386('0xa1')]['id']}})[_0x8386('0x25')](handleEntityNotFound(_0x261e34,null))[_0x8386('0x25')](function(_0x5ca22e){if(_0x5ca22e){return _0x5ca22e[_0x8386('0xab')](_0x41d78d[_0x8386('0xa8')][_0x8386('0xad')],_[_0x8386('0xae')](_0x41d78d[_0x8386('0xa8')],[_0x8386('0xad'),'id'])||{});}})[_0x8386('0x25')](respondWithResult(_0x261e34,null))['catch'](handleError(_0x261e34,null));};exports['getMessages']=function(_0x392a0b,_0x372927,_0x10c06f){var _0x2a214b={'raw':![],'where':{}};var _0x325e05={};var _0x44309b={'count':0x0,'rows':[]};return db[_0x8386('0x32')][_0x8386('0xaf')]({'where':{'id':_0x392a0b[_0x8386('0xa1')]['id']}})[_0x8386('0x25')](handleEntityNotFound(_0x372927,null))[_0x8386('0x25')](function(_0x26d88e){if(_0x26d88e){_0x325e05[_0x8386('0x33')]=_[_0x8386('0x34')](db[_0x8386('0xac')][_0x8386('0xb0')]);_0x325e05[_0x8386('0x35')]=_[_0x8386('0x34')](_0x392a0b[_0x8386('0x35')]);_0x325e05[_0x8386('0x36')]=_['intersection'](_0x325e05['model'],_0x325e05[_0x8386('0x35')]);_0x2a214b[_0x8386('0x37')]=_['intersection'](_0x325e05['model'],qs[_0x8386('0x39')](_0x392a0b['query'][_0x8386('0x39')]));_0x2a214b[_0x8386('0x37')]=_0x2a214b[_0x8386('0x37')][_0x8386('0x3a')]?_0x2a214b[_0x8386('0x37')]:_0x325e05[_0x8386('0x33')];if(!_0x392a0b[_0x8386('0x35')][_0x8386('0x3b')]('nolimit')){_0x2a214b[_0x8386('0x22')]=qs[_0x8386('0x22')](_0x392a0b[_0x8386('0x35')][_0x8386('0x22')]);_0x2a214b[_0x8386('0x21')]=qs[_0x8386('0x21')](_0x392a0b[_0x8386('0x35')]['offset']);}_0x2a214b['order']=qs[_0x8386('0x3d')](_0x392a0b['query'][_0x8386('0x3d')]);_0x2a214b[_0x8386('0x3e')]=qs[_0x8386('0x36')](_[_0x8386('0x3f')](_0x392a0b['query'],_0x325e05['filters']));_0x2a214b[_0x8386('0x3e')][_0x8386('0x9e')]=_0x26d88e['id'];if(_0x392a0b[_0x8386('0x35')][_0x8386('0x67')]){_0x2a214b[_0x8386('0x3e')]=_['merge'](_0x2a214b[_0x8386('0x3e')],{'$or':_['map'](_0x2a214b['attributes'],function(_0x317dca){var _0x4d7ce9={};_0x4d7ce9[_0x317dca]={'$like':'%'+_0x392a0b['query']['filter']+'%'};return _0x4d7ce9;})});}if(_0x392a0b[_0x8386('0x35')][_0x8386('0x6e')]){var _0x17a929=_0x392a0b[_0x8386('0x35')][_0x8386('0x6e')][_0x8386('0xb1')](',');var _0x58ec83={};_0x58ec83[_0x17a929[0x0]]={'$gte':moment(_0x17a929[0x1])['format'](_0x8386('0xb2'))};_0x2a214b[_0x8386('0x3e')]=_['merge'](_0x2a214b[_0x8386('0x3e')],_0x58ec83);}_0x2a214b=_[_0x8386('0xa4')]({},_0x2a214b,_0x392a0b['options']);return db['SmsMessage'][_0x8386('0x20')]({'where':_0x2a214b[_0x8386('0x3e')]})[_0x8386('0x25')](function(_0x15efc9){_0x44309b[_0x8386('0x20')]=_0x15efc9;if(_0x392a0b['query']['includeAll']){_0x2a214b[_0x8386('0xa3')]=[{'all':!![]}];}return db[_0x8386('0xac')][_0x8386('0xb3')](_0x2a214b);})[_0x8386('0x25')](function(_0x2d9b24){_0x44309b[_0x8386('0x9f')]=_0x2d9b24;return _0x44309b;});}})[_0x8386('0x25')](respondWithFilteredResult(_0x372927,_0x2a214b))['catch'](handleError(_0x372927,null));};exports[_0x8386('0xb4')]=function(_0x2ee45a,_0x3e0ae2,_0x630aa4){return db['SmsInteraction']['find']({'where':{'id':_0x2ee45a['params']['id']}})[_0x8386('0x25')](handleEntityNotFound(_0x3e0ae2,null))[_0x8386('0x25')](function(_0x53335c){if(_0x53335c){return _0x53335c[_0x8386('0xb5')](_0x2ee45a[_0x8386('0xa8')]['ids'],_[_0x8386('0xae')](_0x2ee45a[_0x8386('0xa8')],['ids','id'])||{})[_0x8386('0xb6')](function(){return db[_0x8386('0xb7')]['findAll']({'attributes':['id',_0x8386('0x29'),_0x8386('0x41')],'where':{'id':_0x2ee45a[_0x8386('0xa8')][_0x8386('0xad')]}});})[_0x8386('0x25')](function(_0x585225){socket['emit'](_0x8386('0xb8'),{'id':Number(_0x2ee45a[_0x8386('0xa1')]['id']),'tags':_0x585225||[]});return{'id':Number(_0x2ee45a[_0x8386('0xa1')]['id']),'tags':_0x585225||[]};});}})['then'](respondWithResult(_0x3e0ae2,null))[_0x8386('0x30')](handleError(_0x3e0ae2,null));};exports[_0x8386('0xb9')]=function(_0x3b8ea6,_0x4fa99d,_0x5cc4fb){return db[_0x8386('0x32')][_0x8386('0xa6')]({'where':{'id':_0x3b8ea6['params']['id']}})[_0x8386('0x25')](handleEntityNotFound(_0x4fa99d,null))[_0x8386('0x25')](function(_0x179be8){if(_0x179be8){return _0x179be8[_0x8386('0xb9')](_0x3b8ea6['query'][_0x8386('0xad')]);}})['then'](respondWithStatusCode(_0x4fa99d,null))[_0x8386('0x30')](handleError(_0x4fa99d,null));};exports[_0x8386('0xba')]=function(_0x367042,_0x5becd5){var _0xa9548d=moment()[_0x8386('0xbb')]()[_0x8386('0x78')]();var _0x5fee4d=path[_0x8386('0xbc')](config[_0x8386('0xbd')],_0x8386('0xbe'),_0x8386('0xbf'),_0x8386('0xc0'));var _0x451256=path[_0x8386('0xbc')](config[_0x8386('0xbd')],_0x8386('0xbe'),'files',_0x8386('0xc1'));var _0xac03a0=path[_0x8386('0xbc')](_0x5fee4d,_0xa9548d);var _0x574ce8=util[_0x8386('0x57')]('transcript-%d-%s.zip',_0x367042[_0x8386('0xa1')]['id'],_0xa9548d);var _0x358b99=path['join'](_0x5fee4d,_0x574ce8);var _0xe37969=![];return db[_0x8386('0x32')][_0x8386('0xa6')]({'where':{'id':_0x367042[_0x8386('0xa1')]['id']},'include':[{'model':db[_0x8386('0xac')],'as':_0x8386('0xc2'),'attributes':['id',_0x8386('0xa8'),'createdAt',_0x8386('0xc3'),_0x8386('0xc4')],'include':[{'model':db[_0x8386('0xc5')],'as':_0x8386('0xc5'),'attributes':['id',_0x8386('0xc6')],'raw':!![]},{'model':db[_0x8386('0xc7')],'as':_0x8386('0xc8'),'attributes':['id','firstName',_0x8386('0xc9')],'raw':!![]}]},{'model':db[_0x8386('0xca')],'as':_0x8386('0xcb'),'attributes':['id',_0x8386('0x29')]},{'model':db[_0x8386('0xc5')],'as':_0x8386('0xcc'),'attributes':['id','fullname']}]})[_0x8386('0x25')](handleEntityNotFound(_0x5becd5,null))[_0x8386('0x25')](function(_0x3f7233){if(_0x3f7233){var _0x38d2b0=_0x3f7233[_0x8386('0xcd')]({'plain':!![]});_0xe37969=!![];var _0x2e55e4={'format':'A4','border':_0x8386('0xce'),'header':{'height':_0x8386('0xcf'),'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\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\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0x8386('0xd0'),'contents':{'default':util[_0x8386('0x57')](_0x8386('0xd1'),util[_0x8386('0x57')](_0x8386('0xd2'),_0x8386('0xd3'),_0x38d2b0['id']),moment()[_0x8386('0x57')]('YYYY-MM-DD')[_0x8386('0x78')]())}}};fs['mkdirSync'](_0xac03a0);var _0x5243ab={'channel':_0x8386('0xd3'),'account':_0x38d2b0[_0x8386('0xcb')][_0x8386('0x29')],'agent':_0x38d2b0['Owner']?_0x38d2b0[_0x8386('0xcc')][_0x8386('0xc6')]:'N.A.','createdAt':moment(_0x38d2b0[_0x8386('0x6d')])[_0x8386('0x57')](_0x8386('0xb2'))[_0x8386('0x78')](),'closedAt':_0x38d2b0['closed']?moment(_0x38d2b0[_0x8386('0xd4')])[_0x8386('0x57')](_0x8386('0xb2'))[_0x8386('0x78')]():'','disposition':_0x38d2b0[_0x8386('0xd5')],'messages':_(_0x38d2b0['Messages'])[_0x8386('0x67')]({'secret':![]})[_0x8386('0x2b')](function(_0x33241a){return{'date':moment(_0x33241a[_0x8386('0x6d')])[_0x8386('0x57')](_0x8386('0xb2'))[_0x8386('0x78')](),'sender':_0x33241a[_0x8386('0xc3')]===_0x8386('0xd6')?_0x33241a['User']?_0x33241a[_0x8386('0xc5')]['fullname']:_0x8386('0xd7'):_0x33241a[_0x8386('0xc8')][_0x8386('0xd8')]+(_0x33241a[_0x8386('0xc8')][_0x8386('0xc9')]?'\x20'+_0x33241a['Contact'][_0x8386('0xc9')]:''),'body':_0x33241a[_0x8386('0xa8')],'direction':_0x33241a[_0x8386('0xc3')]===_0x8386('0xd6')?'A':'C','secret':_0x33241a['secret']};})[_0x8386('0x52')]()};return ejs[_0x8386('0xd9')](path[_0x8386('0xbc')](config[_0x8386('0xbd')],_0x8386('0xbe'),'views',_0x8386('0xda')),{'interaction':_0x5243ab})[_0x8386('0x25')](function(_0x179663){return new BPromise(function(_0x84482b,_0x1974e1){pdf['create'](_0x179663,_0x2e55e4)[_0x8386('0xdb')](path['join'](_0xac03a0,'transcript-'+_0x38d2b0['id']+'-'+_0xa9548d+_0x8386('0xdc')),function(_0x155493,_0x598f1f){if(_0x155493)return _0x1974e1(_0x155493);_0x84482b(_0x598f1f);});});});}})[_0x8386('0x25')](function(){if(_0xe37969){return new BPromise(function(_0x10e486,_0x131c9d){zipdir(_0xac03a0,{'saveTo':_0x358b99},function(_0x452279,_0x1a21b6){if(_0x452279)return _0x131c9d(_0x452279);return _0x10e486(_0x1a21b6);});})[_0x8386('0x25')](function(){return new BPromise(function(_0x3bb4d1,_0x852624){rimraf(_0xac03a0,function(_0x22f3b8){if(_0x22f3b8)_0x852624(_0x22f3b8);return _0x3bb4d1();});});})['then'](function(){return _0x5becd5[_0x8386('0xba')](_0x358b99,_0x574ce8,function(_0x25f1f2){if(_0x25f1f2){console[_0x8386('0xdd')](_0x8386('0xde'),_0x25f1f2);}else{fs['unlinkSync'](_0x358b99);}});});}else{return _0x5becd5[_0x8386('0x1c')](0xc8);}})[_0x8386('0x30')](handleError(_0x5becd5,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 4326fb3..d3b11f0 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 _0xc50c=['SmsMessage','setMaxListeners','save','update','getUsers','then','setDataValue','findAll','unreadMessages','length','emit','exports','events','../../mysqldb'];(function(_0xe24841,_0x2c0f66){var _0x2e41b3=function(_0xd50fbe){while(--_0xd50fbe){_0xe24841['push'](_0xe24841['shift']());}};_0x2e41b3(++_0x2c0f66);}(_0xc50c,0x1b0));var _0xcc50=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xc50c[_0x178e48];return _0x440d7e;};'use strict';var EventEmitter=require(_0xcc50('0x0'));var SmsInteraction=require(_0xcc50('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0xcc50('0x1'))['db'][_0xcc50('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xcc50('0x3')](0x0);var events={'afterCreate':_0xcc50('0x4'),'afterUpdate':_0xcc50('0x5'),'afterDestroy':'remove'};function emitEvent(_0x24a5f5){return function(_0x469fd0,_0x3e9f6a,_0x1570fb){_0x469fd0[_0xcc50('0x6')]({'attributes':['id'],'raw':!![]})[_0xcc50('0x7')](function(_0x2fb4ac){_0x469fd0[_0xcc50('0x8')]('Users',_0x2fb4ac['map'](function(_0x47922b){return{'id':_0x47922b['id']};}));return SmsMessage[_0xcc50('0x9')]({'where':{'SmsInteractionId':_0x469fd0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcc50('0x7')](function(_0xc5384f){_0x469fd0[_0xcc50('0x8')](_0xcc50('0xa'),_0xc5384f[_0xcc50('0xb')]);SmsInteractionEvents['emit'](_0x24a5f5+':'+_0x469fd0['id'],_0x469fd0);SmsInteractionEvents[_0xcc50('0xc')](_0x24a5f5,_0x469fd0);_0x1570fb(null);})['catch'](_0x1570fb(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xcc50('0xd')]=SmsInteractionEvents; \ No newline at end of file +var _0x5063=['Users','then','emit','catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','SmsMessage','save','update','remove','getUsers','setDataValue'];(function(_0x1fc80e,_0x2f709){var _0x1b0f02=function(_0x158567){while(--_0x158567){_0x1fc80e['push'](_0x1fc80e['shift']());}};_0x1b0f02(++_0x2f709);}(_0x5063,0x1e6));var _0x3506=function(_0x1126f3,_0x268bf4){_0x1126f3=_0x1126f3-0x0;var _0x432ccc=_0x5063[_0x1126f3];return _0x432ccc;};'use strict';var EventEmitter=require(_0x3506('0x0'));var SmsInteraction=require(_0x3506('0x1'))['db'][_0x3506('0x2')];var SmsMessage=require(_0x3506('0x1'))['db'][_0x3506('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3506('0x4'),'afterUpdate':_0x3506('0x5'),'afterDestroy':_0x3506('0x6')};function emitEvent(_0x16ff21){return function(_0x581c14,_0xc9f538,_0x278c17){_0x581c14[_0x3506('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1d007a){_0x581c14[_0x3506('0x8')](_0x3506('0x9'),_0x1d007a['map'](function(_0x29c945){return{'id':_0x29c945['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x581c14['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3506('0xa')](function(_0x18d8ef){_0x581c14[_0x3506('0x8')]('unreadMessages',_0x18d8ef['length']);SmsInteractionEvents[_0x3506('0xb')](_0x16ff21+':'+_0x581c14['id'],_0x581c14);SmsInteractionEvents[_0x3506('0xb')](_0x16ff21,_0x581c14);_0x278c17(null);})[_0x3506('0xc')](_0x278c17(null));};}for(var e in events){if(events[_0x3506('0xd')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x3506('0xe')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 3e165dd..9874cd2 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 _0xa244=['changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa244,0x114));var _0x4a24=function(_0x21b9e0,_0x4357ba){_0x21b9e0=_0x21b9e0-0x0;var _0x15c344=_0xa244[_0x21b9e0];return _0x15c344;};'use strict';var _=require(_0x4a24('0x0'));var util=require('util');var logger=require(_0x4a24('0x1'))('api');var moment=require(_0x4a24('0x2'));var BPromise=require(_0x4a24('0x3'));var rp=require(_0x4a24('0x4'));var fs=require('fs');var path=require(_0x4a24('0x5'));var rimraf=require(_0x4a24('0x6'));var config=require(_0x4a24('0x7'));var attributes=require(_0x4a24('0x8'));module['exports']=function(_0x284957,_0x413499){return _0x284957[_0x4a24('0x9')]('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3eebde,_0x57228f,_0x3b9dc7){if(_0x3eebde[_0x4a24('0xa')]('closed')){_0x3eebde[_0x4a24('0xb')]=moment()['format'](_0x4a24('0xc'));}_0x3b9dc7(null,_0x3eebde);}}});}; \ No newline at end of file +var _0xc0b0=['changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','sms_interactions'];(function(_0x56a0b6,_0x345f2c){var _0x1e0bf8=function(_0x394ab8){while(--_0x394ab8){_0x56a0b6['push'](_0x56a0b6['shift']());}};_0x1e0bf8(++_0x345f2c);}(_0xc0b0,0x117));var _0x0c0b=function(_0x371888,_0xd0953f){_0x371888=_0x371888-0x0;var _0x136a86=_0xc0b0[_0x371888];return _0x136a86;};'use strict';var _=require(_0x0c0b('0x0'));var util=require('util');var logger=require(_0x0c0b('0x1'))(_0x0c0b('0x2'));var moment=require(_0x0c0b('0x3'));var BPromise=require(_0x0c0b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0c0b('0x5'));var config=require(_0x0c0b('0x6'));var attributes=require('./smsInteraction.attributes');module[_0x0c0b('0x7')]=function(_0x2fb7c4,_0x2c8c82){return _0x2fb7c4['define']('SmsInteraction',attributes,{'tableName':_0x0c0b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x15039f,_0x5a19c1,_0x162a59){if(_0x15039f[_0x0c0b('0x9')](_0x0c0b('0xa'))){_0x15039f['closedAt']=moment()['format'](_0x0c0b('0xb'));}_0x162a59(null,_0x15039f);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 51f3df1..79879b5 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 _0xf7af=['code','message','request\x20sent','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','where','attributes','then','AddTagsToSmsInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','../../mysqldb','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','register','request','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1f4dfc,_0x14b1fa){var _0x5a6b97=function(_0x502150){while(--_0x502150){_0x1f4dfc['push'](_0x1f4dfc['shift']());}};_0x5a6b97(++_0x14b1fa);}(_0xf7af,0xd1));var _0xff7a=function(_0x519e33,_0x174633){_0x519e33=_0x519e33-0x0;var _0x2988ff=_0xf7af[_0x519e33];return _0x2988ff;};'use strict';var _=require(_0xff7a('0x0'));var util=require(_0xff7a('0x1'));var moment=require(_0xff7a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff7a('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xff7a('0x4'));var config=require('../../config/environment');var jayson=require(_0xff7a('0x5'));var client=jayson['client'][_0xff7a('0x6')]({'port':0x232a});config['redis']=_[_0xff7a('0x7')](config[_0xff7a('0x8')],{'host':_0xff7a('0x9'),'port':0x18eb});var socket=require(_0xff7a('0xa'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0xff7a('0xb')](socket);function respondWithRpcPromise(_0x58f718,_0x5c9375,_0x16d189){return new BPromise(function(_0x3cf2ea,_0x7632d1){return client[_0xff7a('0xc')](_0x58f718,_0x16d189)['then'](function(_0x545dd3){logger[_0xff7a('0xd')](_0xff7a('0xe'),_0x5c9375,'request\x20sent');logger[_0xff7a('0xf')](_0xff7a('0x10'),_0x5c9375,'request\x20sent',JSON[_0xff7a('0x11')](_0x545dd3));if(_0x545dd3[_0xff7a('0x12')]){if(_0x545dd3[_0xff7a('0x12')][_0xff7a('0x13')]===0x1f4){logger[_0xff7a('0x12')](_0xff7a('0xe'),_0x5c9375,_0x545dd3['error']['message']);return _0x7632d1(_0x545dd3['error']['message']);}logger['error'](_0xff7a('0xe'),_0x5c9375,_0x545dd3[_0xff7a('0x12')][_0xff7a('0x14')]);return _0x3cf2ea(_0x545dd3['error'][_0xff7a('0x14')]);}else{logger['info'](_0xff7a('0xe'),_0x5c9375,_0xff7a('0x15'));_0x3cf2ea(_0x545dd3[_0xff7a('0x16')][_0xff7a('0x14')]);}})[_0xff7a('0x17')](function(_0x1be98f){logger['error'](_0xff7a('0xe'),_0x5c9375,_0x1be98f);_0x7632d1(_0x1be98f);});});}exports[_0xff7a('0x18')]=function(_0x3eb0cf){var _0x3fb8b4=this;return new Promise(function(_0x524e96,_0x549573){return db[_0xff7a('0x19')][_0xff7a('0x1a')](_0x3eb0cf[_0xff7a('0x1b')],{'raw':_0x3eb0cf['options']?_0x3eb0cf[_0xff7a('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3eb0cf[_0xff7a('0x1c')]?_0x3eb0cf[_0xff7a('0x1c')][_0xff7a('0x1d')]||null:null,'attributes':_0x3eb0cf['options']?_0x3eb0cf[_0xff7a('0x1c')][_0xff7a('0x1e')]||null:null,'limit':_0x3eb0cf[_0xff7a('0x1c')]?_0x3eb0cf[_0xff7a('0x1c')]['limit']||null:null})[_0xff7a('0x1f')](function(_0x260a77){logger[_0xff7a('0xd')](_0xff7a('0x18'),_0x3eb0cf);logger[_0xff7a('0xf')]('UpdateSmsInteraction',_0x3eb0cf,JSON[_0xff7a('0x11')](_0x260a77));_0x524e96(_0x260a77);})[_0xff7a('0x17')](function(_0x284aaa){logger[_0xff7a('0x12')](_0xff7a('0x18'),_0x284aaa[_0xff7a('0x14')],_0x3eb0cf);_0x549573(_0x3fb8b4[_0xff7a('0x12')](0x1f4,_0x284aaa['message']));});});};exports[_0xff7a('0x20')]=function(_0x2c3bab){return new Promise(function(_0x81ed93,_0x58642f){return db[_0xff7a('0x19')][_0xff7a('0x21')]({'where':_0x2c3bab[_0xff7a('0x1c')]?_0x2c3bab['options'][_0xff7a('0x1d')]||null:null})[_0xff7a('0x1f')](function(_0x5cfa20){if(_0x5cfa20){return _0x5cfa20[_0xff7a('0x22')](_0x2c3bab[_0xff7a('0x1b')][_0xff7a('0x23')],_[_0xff7a('0x24')](_0x2c3bab[_0xff7a('0x1b')],['ids','id'])||{});}})['spread'](function(_0x2ce03e){logger[_0xff7a('0xd')](_0xff7a('0x25'),_0x2c3bab);logger[_0xff7a('0xf')](_0xff7a('0x25'),_0x2c3bab,JSON[_0xff7a('0x11')](_0x2ce03e));_0x81ed93(_0x2ce03e);})['catch'](function(_0x5d996c){logger['error'](_0xff7a('0x25'),_0x5d996c[_0xff7a('0x14')],_0x2c3bab);_0x58642f(_this['error'](0x1f4,_0x5d996c[_0xff7a('0x14')]));});});}; \ No newline at end of file +var _0xc06b=['info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','limit','AddTagsToSmsInteraction','omit','ids','AddTags','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','then'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xc06b,0x172));var _0xbc06=function(_0x4032e3,_0x6d6449){_0x4032e3=_0x4032e3-0x0;var _0x34f51a=_0xc06b[_0x4032e3];return _0x34f51a;};'use strict';var _=require(_0xbc06('0x0'));var util=require('util');var moment=require(_0xbc06('0x1'));var BPromise=require(_0xbc06('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc06('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbc06('0x4'));var logger=require(_0xbc06('0x5'))('rpc');var config=require(_0xbc06('0x6'));var jayson=require(_0xbc06('0x7'));var client=jayson[_0xbc06('0x8')][_0xbc06('0x9')]({'port':0x232a});config[_0xbc06('0xa')]=_['defaults'](config['redis'],{'host':_0xbc06('0xb'),'port':0x18eb});var socket=require(_0xbc06('0xc'))(new Redis(config[_0xbc06('0xa')]));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x146d54,_0x51ecd9,_0x189e6b){return new BPromise(function(_0x14dbb3,_0x378c0c){return client[_0xbc06('0xd')](_0x146d54,_0x189e6b)[_0xbc06('0xe')](function(_0x2156fe){logger[_0xbc06('0xf')](_0xbc06('0x10'),_0x51ecd9,_0xbc06('0x11'));logger[_0xbc06('0x12')](_0xbc06('0x13'),_0x51ecd9,_0xbc06('0x11'),JSON[_0xbc06('0x14')](_0x2156fe));if(_0x2156fe[_0xbc06('0x15')]){if(_0x2156fe[_0xbc06('0x15')]['code']===0x1f4){logger[_0xbc06('0x15')](_0xbc06('0x10'),_0x51ecd9,_0x2156fe[_0xbc06('0x15')][_0xbc06('0x16')]);return _0x378c0c(_0x2156fe['error'][_0xbc06('0x16')]);}logger['error'](_0xbc06('0x10'),_0x51ecd9,_0x2156fe[_0xbc06('0x15')][_0xbc06('0x16')]);return _0x14dbb3(_0x2156fe[_0xbc06('0x15')][_0xbc06('0x16')]);}else{logger[_0xbc06('0xf')](_0xbc06('0x10'),_0x51ecd9,_0xbc06('0x11'));_0x14dbb3(_0x2156fe[_0xbc06('0x17')][_0xbc06('0x16')]);}})[_0xbc06('0x18')](function(_0x1435f0){logger['error'](_0xbc06('0x10'),_0x51ecd9,_0x1435f0);_0x378c0c(_0x1435f0);});});}exports[_0xbc06('0x19')]=function(_0x3a65ed){var _0x3d6f8e=this;return new Promise(function(_0x3c7d81,_0x24d6ed){return db[_0xbc06('0x1a')][_0xbc06('0x1b')](_0x3a65ed[_0xbc06('0x1c')],{'raw':_0x3a65ed[_0xbc06('0x1d')]?_0x3a65ed[_0xbc06('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a65ed[_0xbc06('0x1d')]?_0x3a65ed[_0xbc06('0x1d')]['where']||null:null,'attributes':_0x3a65ed[_0xbc06('0x1d')]?_0x3a65ed[_0xbc06('0x1d')]['attributes']||null:null,'limit':_0x3a65ed[_0xbc06('0x1d')]?_0x3a65ed['options'][_0xbc06('0x1e')]||null:null})[_0xbc06('0xe')](function(_0x3b669a){logger[_0xbc06('0xf')]('UpdateSmsInteraction',_0x3a65ed);logger[_0xbc06('0x12')](_0xbc06('0x19'),_0x3a65ed,JSON[_0xbc06('0x14')](_0x3b669a));_0x3c7d81(_0x3b669a);})['catch'](function(_0xa3c82a){logger[_0xbc06('0x15')]('UpdateSmsInteraction',_0xa3c82a[_0xbc06('0x16')],_0x3a65ed);_0x24d6ed(_0x3d6f8e[_0xbc06('0x15')](0x1f4,_0xa3c82a[_0xbc06('0x16')]));});});};exports[_0xbc06('0x1f')]=function(_0x170b5e){return new Promise(function(_0x115b0c,_0x1daab4){return db[_0xbc06('0x1a')]['find']({'where':_0x170b5e[_0xbc06('0x1d')]?_0x170b5e['options']['where']||null:null})[_0xbc06('0xe')](function(_0x3153dd){if(_0x3153dd){return _0x3153dd['addTags'](_0x170b5e[_0xbc06('0x1c')]['ids'],_[_0xbc06('0x20')](_0x170b5e[_0xbc06('0x1c')],[_0xbc06('0x21'),'id'])||{});}})['spread'](function(_0x12c085){logger[_0xbc06('0xf')](_0xbc06('0x22'),_0x170b5e);logger['debug'](_0xbc06('0x22'),_0x170b5e,JSON[_0xbc06('0x14')](_0x12c085));_0x115b0c(_0x12c085);})[_0xbc06('0x18')](function(_0x17bedc){logger[_0xbc06('0x15')](_0xbc06('0x22'),_0x17bedc[_0xbc06('0x16')],_0x170b5e);_0x1daab4(_this[_0xbc06('0x15')](0x1f4,_0x17bedc[_0xbc06('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 058fbca..65e692a 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 _0x98f8=['./smsInteraction.events','save','update','emit','removeListener','register','smsInteraction:'];(function(_0x5be104,_0xf32325){var _0x2efc1f=function(_0x29a54b){while(--_0x29a54b){_0x5be104['push'](_0x5be104['shift']());}};_0x2efc1f(++_0xf32325);}(_0x98f8,0xe0));var _0x898f=function(_0x2c79cc,_0x320fe7){_0x2c79cc=_0x2c79cc-0x0;var _0x435348=_0x98f8[_0x2c79cc];return _0x435348;};'use strict';var SmsInteractionEvents=require(_0x898f('0x0'));var events=[_0x898f('0x1'),'remove',_0x898f('0x2')];function createListener(_0x10cb3d,_0x1748c1){return function(_0x39bab5){_0x1748c1[_0x898f('0x3')](_0x10cb3d,_0x39bab5);};}function removeListener(_0x36581d,_0x4199cd){return function(){SmsInteractionEvents[_0x898f('0x4')](_0x36581d,_0x4199cd);};}exports[_0x898f('0x5')]=function(_0x23549f){for(var _0x82bfbe=0x0,_0x4b57a1=events['length'];_0x82bfbe<_0x4b57a1;_0x82bfbe++){var _0xfbefcd=events[_0x82bfbe];var _0x3cd3a4=createListener(_0x898f('0x6')+_0xfbefcd,_0x23549f);SmsInteractionEvents['on'](_0xfbefcd,_0x3cd3a4);}}; \ No newline at end of file +var _0x750d=['register','length','./smsInteraction.events','remove','emit','removeListener'];(function(_0x1ce68e,_0x5a1400){var _0x1d5871=function(_0x5d8298){while(--_0x5d8298){_0x1ce68e['push'](_0x1ce68e['shift']());}};_0x1d5871(++_0x5a1400);}(_0x750d,0x158));var _0xd750=function(_0x59850c,_0x27031c){_0x59850c=_0x59850c-0x0;var _0x20884d=_0x750d[_0x59850c];return _0x20884d;};'use strict';var SmsInteractionEvents=require(_0xd750('0x0'));var events=['save',_0xd750('0x1'),'update'];function createListener(_0x530d2a,_0x4d5b07){return function(_0x576087){_0x4d5b07[_0xd750('0x2')](_0x530d2a,_0x576087);};}function removeListener(_0x528b5e,_0x366dfa){return function(){SmsInteractionEvents[_0xd750('0x3')](_0x528b5e,_0x366dfa);};}exports[_0xd750('0x4')]=function(_0x533963){for(var _0x55aae8=0x0,_0xb49734=events[_0xd750('0x5')];_0x55aae8<_0xb49734;_0x55aae8++){var _0x474562=events[_0x55aae8];var _0x8c3b1e=createListener('smsInteraction:'+_0x474562,_0x533963);SmsInteractionEvents['on'](_0x474562,_0x8c3b1e);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 46307ac..ed71728 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 _0x8532=['smsmessage:create','create','status','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','sms'];(function(_0x418f27,_0x49de3f){var _0x568c07=function(_0x34e79){while(--_0x34e79){_0x418f27['push'](_0x418f27['shift']());}};_0x568c07(++_0x49de3f);}(_0x8532,0xcf));var _0x2853=function(_0x1aed01,_0x3b59f3){_0x1aed01=_0x1aed01-0x0;var _0x34ccb8=_0x8532[_0x1aed01];return _0x34ccb8;};'use strict';var multer=require(_0x2853('0x0'));var util=require(_0x2853('0x1'));var path=require(_0x2853('0x2'));var timeout=require(_0x2853('0x3'));var express=require(_0x2853('0x4'));var router=express[_0x2853('0x5')]();var auth=require(_0x2853('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsMessage.controller');router[_0x2853('0x7')]('/',auth[_0x2853('0x8')](),controller[_0x2853('0x9')]);router['get'](_0x2853('0xa'),auth[_0x2853('0x8')](),controller[_0x2853('0xb')]);router['get'](_0x2853('0xc'),auth[_0x2853('0x8')](),controller[_0x2853('0xd')]);router[_0x2853('0xe')]('/',auth[_0x2853('0x8')](),interaction[_0x2853('0xf')](_0x2853('0x10'),_0x2853('0x11')),controller[_0x2853('0x12')]);router[_0x2853('0xe')]('/:id/status',controller[_0x2853('0x13')]);router[_0x2853('0x14')](_0x2853('0xc'),auth[_0x2853('0x8')](),controller[_0x2853('0x15')]);router[_0x2853('0x14')](_0x2853('0x16'),auth[_0x2853('0x8')](),controller['accept']);router['put'](_0x2853('0x17'),auth[_0x2853('0x8')](),controller[_0x2853('0x18')]);router[_0x2853('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x2853('0x1a')]);module[_0x2853('0x1b')]=router; \ No newline at end of file +var _0xdb19=['/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','index','describe','isAuthenticated','tracked','sms','smsmessage:create','create','post','status','put','/:id','update','accept'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xdb19,0x139));var _0x9db1=function(_0x1713e9,_0x1afcd5){_0x1713e9=_0x1713e9-0x0;var _0x219271=_0xdb19[_0x1713e9];return _0x219271;};'use strict';var multer=require(_0x9db1('0x0'));var util=require(_0x9db1('0x1'));var path=require(_0x9db1('0x2'));var timeout=require(_0x9db1('0x3'));var express=require(_0x9db1('0x4'));var router=express[_0x9db1('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x9db1('0x6'));var config=require(_0x9db1('0x7'));var controller=require(_0x9db1('0x8'));router[_0x9db1('0x9')]('/',auth['isAuthenticated'](),controller[_0x9db1('0xa')]);router[_0x9db1('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x9db1('0xb')]);router[_0x9db1('0x9')]('/:id',auth[_0x9db1('0xc')](),controller['show']);router['post']('/',auth[_0x9db1('0xc')](),interaction[_0x9db1('0xd')](_0x9db1('0xe'),_0x9db1('0xf')),controller[_0x9db1('0x10')]);router[_0x9db1('0x11')]('/:id/status',controller[_0x9db1('0x12')]);router[_0x9db1('0x13')](_0x9db1('0x14'),auth['isAuthenticated'](),controller[_0x9db1('0x15')]);router[_0x9db1('0x13')]('/:id/accept',auth[_0x9db1('0xc')](),controller[_0x9db1('0x16')]);router[_0x9db1('0x13')](_0x9db1('0x17'),auth['isAuthenticated'](),controller[_0x9db1('0x18')]);router[_0x9db1('0x19')]('/:id',auth[_0x9db1('0xc')](),controller[_0x9db1('0x1a')]);module[_0x9db1('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 042c2b5..7777884 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 _0x4cff=['DATE','BOOLEAN','sequelize','exports','medium','ENUM','out','STRING'];(function(_0x1a2f0c,_0x54ecf9){var _0x4dbf57=function(_0x7895aa){while(--_0x7895aa){_0x1a2f0c['push'](_0x1a2f0c['shift']());}};_0x4dbf57(++_0x54ecf9);}(_0x4cff,0x14a));var _0xf4cf=function(_0x2c5ae6,_0x3c70a5){_0x2c5ae6=_0x2c5ae6-0x0;var _0x13d3ad=_0x4cff[_0x2c5ae6];return _0x13d3ad;};'use strict';var Sequelize=require(_0xf4cf('0x0'));module[_0xf4cf('0x1')]={'body':{'type':Sequelize['TEXT'](_0xf4cf('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xf4cf('0x3')]('in',_0xf4cf('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xf4cf('0x5')](0xbe)},'phone':{'type':Sequelize[_0xf4cf('0x5')]},'readAt':{'type':Sequelize[_0xf4cf('0x6')]},'secret':{'type':Sequelize[_0xf4cf('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x8110=['ENUM','out','STRING','DATE','BOOLEAN','exports'];(function(_0x185332,_0x322790){var _0x17d7af=function(_0x39a6b5){while(--_0x39a6b5){_0x185332['push'](_0x185332['shift']());}};_0x17d7af(++_0x322790);}(_0x8110,0x185));var _0x0811=function(_0x3fde2b,_0x2aa527){_0x3fde2b=_0x3fde2b-0x0;var _0x205f7d=_0x8110[_0x3fde2b];return _0x205f7d;};'use strict';var Sequelize=require('sequelize');module[_0x0811('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0811('0x1')]('in','out'),'defaultValue':_0x0811('0x2'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0811('0x3')](0xbe)},'phone':{'type':Sequelize[_0x0811('0x3')]},'readAt':{'type':Sequelize[_0x0811('0x4')]},'secret':{'type':Sequelize[_0x0811('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 944a310..928ffc4 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 _0xd187=['status','end','json','count','offset','Content-Range','reject','update','destroy','stack','name','send','index','SmsMessage','rawAttributes','model','keys','query','filters','attributes','intersection','hasOwnProperty','nolimit','limit','order','sort','where','filter','map','type','key','field','merge','options','includeAll','include','findAll','rows','show','params','fields','length','find','create','body','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','SmsInteractionId','isNil','interaction','get','info','role','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event','EventManager','acceptmessage','sms-interactions','sms','agent','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','indexOf','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','DELIVERED','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','test','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus'];(function(_0x15193d,_0x13ba1f){var _0xfa2c0=function(_0x273c18){while(--_0x273c18){_0x15193d['push'](_0x15193d['shift']());}};_0xfa2c0(++_0x13ba1f);}(_0xd187,0x16b));var _0x7d18=function(_0x5ba549,_0x425afd){_0x5ba549=_0x5ba549-0x0;var _0x36e3a1=_0xd187[_0x5ba549];return _0x36e3a1;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x7d18('0x0'));var zipdir=require(_0x7d18('0x1'));var jsonpatch=require(_0x7d18('0x2'));var rp=require(_0x7d18('0x3'));var moment=require('moment');var BPromise=require(_0x7d18('0x4'));var Mustache=require(_0x7d18('0x5'));var util=require(_0x7d18('0x6'));var path=require('path');var sox=require(_0x7d18('0x7'));var csv=require(_0x7d18('0x8'));var ejs=require(_0x7d18('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7d18('0xa'));var crypto=require('crypto');var jsforce=require(_0x7d18('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7d18('0xc'));var Papa=require(_0x7d18('0xd'));var Redis=require(_0x7d18('0xe'));var authService=require(_0x7d18('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7d18('0x10'));var logger=require(_0x7d18('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x7d18('0x12'));var db=require(_0x7d18('0x13'))['db'];config[_0x7d18('0x14')]=_[_0x7d18('0x15')](config['redis'],{'host':_0x7d18('0x16'),'port':0x18eb});var socket=require(_0x7d18('0x17'))(new Redis(config[_0x7d18('0x14')]));require(_0x7d18('0x18'))[_0x7d18('0x19')](socket);var jayson=require(_0x7d18('0x1a'));var client=jayson[_0x7d18('0x1b')][_0x7d18('0x1c')]({'port':0x232c});var client9002=jayson[_0x7d18('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x3f2c41,_0x40c840,_0x4e4266){if(_0x4e4266){var _0x1bdacd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1bdacd[_0x7d18('0x1d')](_0x40c840)){return _0x3f2c41;}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 _0x3f2c41;}}function respondWithRpcPromise(_0x27382f,_0xf0c28e,_0xad4772,_0x4e89cb){return new BPromise(function(_0x1b195b,_0x4313fe){var _0x2702c6=_0x4e89cb||client;return _0x2702c6[_0x7d18('0x1e')](_0x27382f,_0xad4772)[_0x7d18('0x1f')](function(_0x165bfc){logger['info'](_0x7d18('0x20'),_0xf0c28e,_0x7d18('0x21'));logger[_0x7d18('0x22')](_0x7d18('0x23'),_0xf0c28e,'request\x20sent',JSON[_0x7d18('0x24')](_0x165bfc));if(_0x165bfc['error']){if(_0x165bfc[_0x7d18('0x25')]['code']===0x1f4){logger[_0x7d18('0x25')](_0x7d18('0x20'),_0xf0c28e,_0x165bfc[_0x7d18('0x25')][_0x7d18('0x26')]);return _0x4313fe(_0x165bfc['error'][_0x7d18('0x26')]);}logger[_0x7d18('0x25')]('SmsMessage,\x20%s,\x20%s',_0xf0c28e,_0x165bfc['error'][_0x7d18('0x26')]);return _0x1b195b(_0x165bfc[_0x7d18('0x25')][_0x7d18('0x26')]);}else{logger['info'](_0x7d18('0x20'),_0xf0c28e,_0x7d18('0x21'));_0x1b195b(_0x165bfc[_0x7d18('0x27')][_0x7d18('0x26')]);}})[_0x7d18('0x28')](function(_0x37be54){logger['error'](_0x7d18('0x20'),_0xf0c28e,_0x37be54);_0x4313fe(_0x37be54);});});}function respondWithStatusCode(_0x38f221,_0x8a5b01){_0x8a5b01=_0x8a5b01||0xcc;return function(_0x7bb7d9){if(_0x7bb7d9){return _0x38f221[_0x7d18('0x29')](_0x8a5b01);}return _0x38f221[_0x7d18('0x2a')](_0x8a5b01)[_0x7d18('0x2b')]();};}function respondWithResult(_0x4f36b7,_0x4bd959){_0x4bd959=_0x4bd959||0xc8;return function(_0x5bb1c0){if(_0x5bb1c0){return _0x4f36b7[_0x7d18('0x2a')](_0x4bd959)[_0x7d18('0x2c')](_0x5bb1c0);}};}function respondWithFilteredResult(_0x43dd09,_0x8e150c){return function(_0x602ad4){if(_0x602ad4){var _0x19f1c0=_0x602ad4[_0x7d18('0x2d')],_0x1d2800=_0x8e150c[_0x7d18('0x2e')],_0x1c097e=_0x8e150c[_0x7d18('0x2e')]+_0x8e150c['limit'],_0x4eca45;if(_0x1c097e>=_0x19f1c0){_0x1c097e=_0x19f1c0;_0x4eca45=0xc8;}else{_0x4eca45=0xce;}_0x43dd09[_0x7d18('0x2a')](_0x4eca45);return _0x43dd09['set'](_0x7d18('0x2f'),_0x1d2800+'-'+_0x1c097e+'/'+_0x19f1c0)[_0x7d18('0x2c')](_0x602ad4);}return null;};}function patchUpdates(_0x5934da){return function(_0x57e150){try{jsonpatch['apply'](_0x57e150,_0x5934da,!![]);}catch(_0x2cbf25){return BPromise[_0x7d18('0x30')](_0x2cbf25);}return _0x57e150['save']();};}function saveUpdates(_0x52b071,_0x1c7dd6){return function(_0x3a0cbc){if(_0x3a0cbc){return _0x3a0cbc[_0x7d18('0x31')](_0x52b071)[_0x7d18('0x1f')](function(_0x44267d){return _0x44267d;});}return null;};}function removeEntity(_0x3bdd45,_0x3380f1){return function(_0x5696fa){if(_0x5696fa){return _0x5696fa[_0x7d18('0x32')]()[_0x7d18('0x1f')](function(){_0x3bdd45['status'](0xcc)[_0x7d18('0x2b')]();});}};}function handleEntityNotFound(_0x1fcd7f,_0x2587ef){return function(_0x3a372a){if(!_0x3a372a){_0x1fcd7f['sendStatus'](0x194);}return _0x3a372a;};}function handleError(_0x2f0b1e,_0x4da1ff){_0x4da1ff=_0x4da1ff||0x1f4;return function(_0x24d557){logger[_0x7d18('0x25')](_0x24d557[_0x7d18('0x33')]);if(_0x24d557[_0x7d18('0x34')]){delete _0x24d557[_0x7d18('0x34')];}_0x2f0b1e[_0x7d18('0x2a')](_0x4da1ff)[_0x7d18('0x35')](_0x24d557);};}exports[_0x7d18('0x36')]=function(_0x2296c3,_0x206bd3){var _0x1538bc={},_0x345264={},_0x14d3b4={'count':0x0,'rows':[]};var _0x1d69a9=db[_0x7d18('0x37')][_0x7d18('0x38')];_0x345264[_0x7d18('0x39')]=_['keys'](_0x1d69a9);_0x345264['query']=_[_0x7d18('0x3a')](_0x2296c3[_0x7d18('0x3b')]);_0x345264[_0x7d18('0x3c')]=_['intersection'](_0x345264[_0x7d18('0x39')],_0x345264[_0x7d18('0x3b')]);_0x1538bc[_0x7d18('0x3d')]=_[_0x7d18('0x3e')](_0x345264[_0x7d18('0x39')],qs['fields'](_0x2296c3['query']['fields']));_0x1538bc['attributes']=_0x1538bc[_0x7d18('0x3d')]['length']?_0x1538bc[_0x7d18('0x3d')]:_0x345264['model'];if(!_0x2296c3['query'][_0x7d18('0x3f')](_0x7d18('0x40'))){_0x1538bc['limit']=qs['limit'](_0x2296c3[_0x7d18('0x3b')][_0x7d18('0x41')]);_0x1538bc['offset']=qs['offset'](_0x2296c3[_0x7d18('0x3b')][_0x7d18('0x2e')]);}_0x1538bc[_0x7d18('0x42')]=qs[_0x7d18('0x43')](_0x2296c3[_0x7d18('0x3b')][_0x7d18('0x43')]);_0x1538bc[_0x7d18('0x44')]=qs['filters'](_['pick'](_0x2296c3[_0x7d18('0x3b')],_0x345264[_0x7d18('0x3c')]));if(_0x2296c3[_0x7d18('0x3b')][_0x7d18('0x45')]){_0x1538bc[_0x7d18('0x44')]=_['merge'](_0x1538bc[_0x7d18('0x44')],{'$or':_[_0x7d18('0x46')](_0x1d69a9,function(_0x66cb82){if(_0x66cb82[_0x7d18('0x47')][_0x7d18('0x48')]!=='VIRTUAL'){var _0x257049={};_0x257049[_0x66cb82[_0x7d18('0x49')]]={'$like':'%'+_0x2296c3[_0x7d18('0x3b')][_0x7d18('0x45')]+'%'};return _0x257049;}})});}_0x1538bc=_[_0x7d18('0x4a')]({},_0x1538bc,_0x2296c3[_0x7d18('0x4b')]);var _0x437af7={'where':_0x1538bc[_0x7d18('0x44')]};return db['SmsMessage']['count'](_0x437af7)['then'](function(_0x8d01b6){_0x14d3b4['count']=_0x8d01b6;if(_0x2296c3[_0x7d18('0x3b')][_0x7d18('0x4c')]){_0x1538bc[_0x7d18('0x4d')]=[{'all':!![]}];}return db[_0x7d18('0x37')][_0x7d18('0x4e')](_0x1538bc);})[_0x7d18('0x1f')](function(_0x52b1e5){_0x14d3b4[_0x7d18('0x4f')]=_0x52b1e5;return _0x14d3b4;})['then'](respondWithFilteredResult(_0x206bd3,_0x1538bc))['catch'](handleError(_0x206bd3,null));};exports[_0x7d18('0x50')]=function(_0x18d334,_0xde027){var _0x3eaa01={'raw':!![],'where':{'id':_0x18d334[_0x7d18('0x51')]['id']}},_0x21987d={};_0x21987d[_0x7d18('0x39')]=_[_0x7d18('0x3a')](db[_0x7d18('0x37')][_0x7d18('0x38')]);_0x21987d[_0x7d18('0x3b')]=_[_0x7d18('0x3a')](_0x18d334['query']);_0x21987d[_0x7d18('0x3c')]=_[_0x7d18('0x3e')](_0x21987d[_0x7d18('0x39')],_0x21987d[_0x7d18('0x3b')]);_0x3eaa01[_0x7d18('0x3d')]=_[_0x7d18('0x3e')](_0x21987d['model'],qs['fields'](_0x18d334['query'][_0x7d18('0x52')]));_0x3eaa01[_0x7d18('0x3d')]=_0x3eaa01['attributes'][_0x7d18('0x53')]?_0x3eaa01[_0x7d18('0x3d')]:_0x21987d[_0x7d18('0x39')];if(_0x18d334['query']['includeAll']){_0x3eaa01[_0x7d18('0x4d')]=[{'all':!![]}];}_0x3eaa01=_[_0x7d18('0x4a')]({},_0x3eaa01,_0x18d334[_0x7d18('0x4b')]);return db[_0x7d18('0x37')][_0x7d18('0x54')](_0x3eaa01)[_0x7d18('0x1f')](handleEntityNotFound(_0xde027,null))['then'](respondWithResult(_0xde027,null))['catch'](handleError(_0xde027,null));};exports['create']=function(_0x43095f,_0x63b216){return db[_0x7d18('0x37')][_0x7d18('0x55')](_0x43095f[_0x7d18('0x56')],{})['then'](respondWithResult(_0x63b216,0xc9))[_0x7d18('0x28')](handleError(_0x63b216,null));};exports['update']=function(_0x464fcb,_0x4b1468){if(_0x464fcb[_0x7d18('0x56')]['id']){delete _0x464fcb[_0x7d18('0x56')]['id'];}return db[_0x7d18('0x37')][_0x7d18('0x54')]({'where':{'id':_0x464fcb[_0x7d18('0x51')]['id']}})[_0x7d18('0x1f')](handleEntityNotFound(_0x4b1468,null))[_0x7d18('0x1f')](saveUpdates(_0x464fcb[_0x7d18('0x56')],null))[_0x7d18('0x1f')](respondWithResult(_0x4b1468,null))[_0x7d18('0x28')](handleError(_0x4b1468,null));};exports['destroy']=function(_0x2b855f,_0x1d62c4){return db['SmsMessage'][_0x7d18('0x54')]({'where':{'id':_0x2b855f[_0x7d18('0x51')]['id']}})['then'](handleEntityNotFound(_0x1d62c4,null))[_0x7d18('0x1f')](removeEntity(_0x1d62c4,null))[_0x7d18('0x28')](handleError(_0x1d62c4,null));};exports[_0x7d18('0x57')]=function(_0x3c76a2,_0x358192){return db[_0x7d18('0x37')]['describe']()['then'](respondWithResult(_0x358192,null))['catch'](handleError(_0x358192,null));};var interaction_log=require(_0x7d18('0x11'))('sms-interactions');exports[_0x7d18('0x58')]=function(_0x1fb4fc,_0x3ce2ef,_0x33572d){var _0x388ed4={'channel':'sms'};if(_0x1fb4fc[_0x7d18('0x56')]['id']){delete _0x1fb4fc[_0x7d18('0x56')]['id'];}_0x1fb4fc[_0x7d18('0x56')][_0x7d18('0x59')]=!![];_0x1fb4fc['body'][_0x7d18('0x5a')]=moment()[_0x7d18('0x5b')](_0x7d18('0x5c'));_0x1fb4fc[_0x7d18('0x56')][_0x7d18('0x5d')]=_0x1fb4fc[_0x7d18('0x56')][_0x7d18('0x5d')]||_0x1fb4fc[_0x7d18('0x5e')]['id'];return db[_0x7d18('0x37')][_0x7d18('0x54')]({'where':{'id':_0x1fb4fc[_0x7d18('0x51')]['id'],'UserId':null},'include':[{'model':db[_0x7d18('0x5f')],'as':_0x7d18('0x60')}]})['then'](handleEntityNotFound(_0x3ce2ef,null))[_0x7d18('0x1f')](saveUpdates(_0x1fb4fc['body'],null))[_0x7d18('0x1f')](function(_0x1e09b3){if(_0x1e09b3){_0x388ed4['message']=_0x1e09b3['get']({'plain':!![]});return db['SmsInteraction'][_0x7d18('0x54')]({'where':{'id':_0x1e09b3[_0x7d18('0x61')]}});}return null;})[_0x7d18('0x1f')](handleEntityNotFound(_0x3ce2ef,null))['then'](function(_0x5c6a92){if(_0x5c6a92){return _0x5c6a92['update']({'UserId':_0x1fb4fc[_0x7d18('0x56')][_0x7d18('0x5d')],'read1stAt':_[_0x7d18('0x62')](_0x5c6a92['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x7d18('0x1f')](function(_0x47416d){if(_0x47416d){_0x388ed4[_0x7d18('0x63')]=_0x47416d[_0x7d18('0x64')]({'plain':!![]});interaction_log[_0x7d18('0x65')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1fb4fc[_0x7d18('0x5e')]['id'],_0x1fb4fc['user'][_0x7d18('0x34')],_0x1fb4fc[_0x7d18('0x5e')][_0x7d18('0x66')],_0x388ed4[_0x7d18('0x63')]['id'],_0x1fb4fc[_0x7d18('0x56')]?JSON[_0x7d18('0x24')](_0x1fb4fc['body']):_0x7d18('0x67'));return respondWithRpcPromise(_0x7d18('0x68'),_0x7d18('0x69'),_0x388ed4);}return null;})['then'](function(_0x298c8d){if(_0x298c8d){if(_0x1fb4fc[_0x7d18('0x56')][_0x7d18('0x6a')]){_0x388ed4[_0x7d18('0x26')]['interface']=util[_0x7d18('0x5b')](_0x7d18('0x6b'),_0x1fb4fc['user']['name']);_0x388ed4['message'][_0x7d18('0x6c')]=_0x388ed4[_0x7d18('0x6c')];_0x388ed4[_0x7d18('0x26')][_0x7d18('0x6d')]=_0x7d18('0x58');return respondWithRpcPromise('EventManager',_0x7d18('0x6e'),{'event':_0x7d18('0x6f'),'message':_0x388ed4[_0x7d18('0x26')]},client9002)[_0x7d18('0x1f')](function(){return _0x388ed4;});}return _0x388ed4;}return null;})['then'](respondWithResult(_0x3ce2ef,null))[_0x7d18('0x28')](handleError(_0x3ce2ef,null));};var interaction_log=require(_0x7d18('0x11'))(_0x7d18('0x70'));exports[_0x7d18('0x30')]=function(_0x1f03f4,_0x56599d,_0x2413cb){var _0x40ce36={'agent':{},'channel':_0x7d18('0x71')};if(_0x1f03f4[_0x7d18('0x56')]['id']){delete _0x1f03f4[_0x7d18('0x56')]['id'];}_0x1f03f4[_0x7d18('0x56')][_0x7d18('0x5d')]=_0x1f03f4[_0x7d18('0x56')][_0x7d18('0x5d')]||_0x1f03f4[_0x7d18('0x5e')]['id'];_0x40ce36[_0x7d18('0x72')]['id']=_0x1f03f4[_0x7d18('0x56')][_0x7d18('0x5d')];return db[_0x7d18('0x37')][_0x7d18('0x54')]({'where':{'id':_0x1f03f4[_0x7d18('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x56599d,null))[_0x7d18('0x1f')](function(_0x18569f){if(_0x18569f){_0x40ce36[_0x7d18('0x26')]=_0x18569f['get']({'plain':!![]});return db[_0x7d18('0x73')][_0x7d18('0x54')]({'where':{'id':_0x18569f[_0x7d18('0x61')]}});}return null;})[_0x7d18('0x1f')](handleEntityNotFound(_0x56599d,null))[_0x7d18('0x1f')](function(_0x11e024){if(_0x11e024){_0x40ce36[_0x7d18('0x63')]=_0x11e024[_0x7d18('0x64')]({'plain':!![]});interaction_log['info'](_0x7d18('0x74'),_0x1f03f4[_0x7d18('0x5e')]['id'],_0x1f03f4[_0x7d18('0x5e')]['name'],_0x1f03f4[_0x7d18('0x5e')]['role'],_0x40ce36[_0x7d18('0x63')]['id'],_0x1f03f4[_0x7d18('0x56')]?JSON[_0x7d18('0x24')](_0x1f03f4['body']):'null');return respondWithRpcPromise(_0x7d18('0x75'),_0x7d18('0x76'),_0x40ce36);}return null;})['then'](function(_0x3b921b){if(_0x3b921b){_0x3b921b[_0x7d18('0x26')]['interface']=util[_0x7d18('0x5b')](_0x7d18('0x6b'),_0x1f03f4[_0x7d18('0x5e')][_0x7d18('0x34')]);_0x3b921b['message']['channel']=_0x40ce36[_0x7d18('0x6c')];_0x3b921b[_0x7d18('0x26')][_0x7d18('0x6d')]=_0x7d18('0x30');respondWithRpcPromise('EventManager',_0x7d18('0x6e'),{'event':_0x7d18('0x77'),'message':_0x3b921b[_0x7d18('0x26')]},client9002);return _0x40ce36;}return null;})['then'](respondWithResult(_0x56599d,null))[_0x7d18('0x28')](handleError(_0x56599d,null));};exports['status']=function(_0x2433c5,_0x131d4b,_0x2d9083){if(_0x2433c5[_0x7d18('0x56')]['id']){delete _0x2433c5[_0x7d18('0x56')]['id'];}var _0x3f33b9;return db['SmsMessage']['find']({'where':{'id':_0x2433c5['params']['id']}})[_0x7d18('0x1f')](handleEntityNotFound(_0x131d4b,null))[_0x7d18('0x1f')](function(_0xc741d8){if(_0xc741d8){_0x3f33b9=_0xc741d8;return db['SmsAccount'][_0x7d18('0x54')]({'where':{'id':_0xc741d8['SmsAccountId']}});}})[_0x7d18('0x1f')](handleEntityNotFound(_0x131d4b,null))['then'](function(_0x169a95){if(_0x169a95){logger[_0x7d18('0x22')](_0x7d18('0x23'),_0x7d18('0x2a'),'received\x20delivery\x20report\x20from',_0x169a95[_0x7d18('0x47')],util[_0x7d18('0x78')](_0x2433c5[_0x7d18('0x56')],{'showHidden':![],'depth':null}));switch(_0x169a95[_0x7d18('0x47')]){case _0x7d18('0x79'):if(_0x2433c5[_0x7d18('0x56')][_0x7d18('0x7a')]&&_0x2433c5[_0x7d18('0x56')]['MessageSid']===_0x3f33b9[_0x7d18('0x7b')]){return _0x3f33b9[_0x7d18('0x31')]({'read':!![]});}else{logger[_0x7d18('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7d18('0x2a'),'twilio',util[_0x7d18('0x78')](_0x2433c5[_0x7d18('0x56')],{'showHidden':![],'depth':null}));}break;case _0x7d18('0x7c'):if(_0x2433c5['body'][_0x7d18('0x7d')]&&_0x2433c5[_0x7d18('0x56')][_0x7d18('0x7d')]===_0x3f33b9[_0x7d18('0x7b')]&&_[_0x7d18('0x7e')]([_0x7d18('0x7f'),_0x7d18('0x80')],_0x2433c5[_0x7d18('0x56')][_0x7d18('0x81')])>=0x0){return _0x3f33b9[_0x7d18('0x31')]({'read':!![]});}else{logger[_0x7d18('0x25')](_0x7d18('0x82'),'status',_0x7d18('0x83'),util[_0x7d18('0x78')](_0x2433c5[_0x7d18('0x56')],{'showHidden':![],'depth':null}));}break;case _0x7d18('0x84'):var _0x20665a=_0x2433c5[_0x7d18('0x56')][_0x7d18('0x85')][0x0];if(_0x20665a[_0x7d18('0x2a')]['groupName']===_0x7d18('0x86')){return _0x3f33b9['update']({'read':!![]});}else{logger[_0x7d18('0x25')](_0x7d18('0x82'),_0x7d18('0x2a'),_0x7d18('0x84'),util['inspect'](_0x2433c5[_0x7d18('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x3f33b9;}})[_0x7d18('0x1f')](respondWithResult(_0x131d4b,null))[_0x7d18('0x28')](handleError(_0x131d4b,null));}; \ No newline at end of file +var _0x7f5b=['papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','error','code','message','SmsMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','stack','name','send','index','SmsMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','field','includeAll','include','findAll','show','params','length','find','create','body','describe','sms-interactions','accept','sms','readAt','UserId','Contact','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','user','role','interaction','null','AcceptMessage','acceptMessage','manual','channel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','SIP/%s','rejectmessage','SmsAccount','SmsAccountId','debug','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x150533,_0x4d1976){var _0xe51556=function(_0x4ed204){while(--_0x4ed204){_0x150533['push'](_0x150533['shift']());}};_0xe51556(++_0x4d1976);}(_0x7f5b,0x102));var _0xb7f5=function(_0x25875c,_0xc144a9){_0x25875c=_0x25875c-0x0;var _0x48a9e6=_0x7f5b[_0x25875c];return _0x48a9e6;};'use strict';var pdf=require(_0xb7f5('0x0'));var emlformat=require(_0xb7f5('0x1'));var rimraf=require(_0xb7f5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb7f5('0x3'));var rp=require('request-promise');var moment=require(_0xb7f5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb7f5('0x5'));var util=require(_0xb7f5('0x6'));var path=require(_0xb7f5('0x7'));var sox=require(_0xb7f5('0x8'));var csv=require(_0xb7f5('0x9'));var ejs=require(_0xb7f5('0xa'));var fs=require('fs');var _=require(_0xb7f5('0xb'));var squel=require('squel');var crypto=require(_0xb7f5('0xc'));var jsforce=require(_0xb7f5('0xd'));var deskjs=require(_0xb7f5('0xe'));var toCsv=require(_0xb7f5('0x9'));var querystring=require(_0xb7f5('0xf'));var Papa=require(_0xb7f5('0x10'));var Redis=require(_0xb7f5('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb7f5('0x12'));var logger=require(_0xb7f5('0x13'))(_0xb7f5('0x14'));var utils=require(_0xb7f5('0x15'));var config=require(_0xb7f5('0x16'));var db=require(_0xb7f5('0x17'))['db'];config[_0xb7f5('0x18')]=_[_0xb7f5('0x19')](config[_0xb7f5('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xb7f5('0x1a'))(new Redis(config[_0xb7f5('0x18')]));require('./smsMessage.socket')['register'](socket);var jayson=require(_0xb7f5('0x1b'));var client=jayson['client'][_0xb7f5('0x1c')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x5305b2,_0x5d0f90,_0x5a5e1f){if(_0x5a5e1f){var _0x37cc71=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x37cc71['test'](_0x5d0f90)){return _0x5305b2;}else{throw new Error(_0xb7f5('0x1d'));}}else{return _0x5305b2;}}function respondWithRpcPromise(_0x298741,_0x5e40e5,_0x5cdd57,_0x522d2b){return new BPromise(function(_0x222cb4,_0x19e3ce){var _0x48dc52=_0x522d2b||client;return _0x48dc52[_0xb7f5('0x1e')](_0x298741,_0x5cdd57)[_0xb7f5('0x1f')](function(_0x32418d){logger[_0xb7f5('0x20')]('SmsMessage,\x20%s,\x20%s',_0x5e40e5,_0xb7f5('0x21'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5e40e5,'request\x20sent',JSON['stringify'](_0x32418d));if(_0x32418d[_0xb7f5('0x22')]){if(_0x32418d['error'][_0xb7f5('0x23')]===0x1f4){logger[_0xb7f5('0x22')]('SmsMessage,\x20%s,\x20%s',_0x5e40e5,_0x32418d['error'][_0xb7f5('0x24')]);return _0x19e3ce(_0x32418d['error']['message']);}logger[_0xb7f5('0x22')](_0xb7f5('0x25'),_0x5e40e5,_0x32418d[_0xb7f5('0x22')]['message']);return _0x222cb4(_0x32418d[_0xb7f5('0x22')][_0xb7f5('0x24')]);}else{logger[_0xb7f5('0x20')](_0xb7f5('0x25'),_0x5e40e5,_0xb7f5('0x21'));_0x222cb4(_0x32418d[_0xb7f5('0x26')]['message']);}})[_0xb7f5('0x27')](function(_0x445741){logger[_0xb7f5('0x22')](_0xb7f5('0x25'),_0x5e40e5,_0x445741);_0x19e3ce(_0x445741);});});}function respondWithStatusCode(_0x54ecf4,_0x31e3ca){_0x31e3ca=_0x31e3ca||0xcc;return function(_0x251c20){if(_0x251c20){return _0x54ecf4[_0xb7f5('0x28')](_0x31e3ca);}return _0x54ecf4[_0xb7f5('0x29')](_0x31e3ca)[_0xb7f5('0x2a')]();};}function respondWithResult(_0x3286bf,_0x5448e4){_0x5448e4=_0x5448e4||0xc8;return function(_0x43d9d6){if(_0x43d9d6){return _0x3286bf[_0xb7f5('0x29')](_0x5448e4)[_0xb7f5('0x2b')](_0x43d9d6);}};}function respondWithFilteredResult(_0x5858e8,_0x16c3c8){return function(_0x17f789){if(_0x17f789){var _0x1fc98b=_0x17f789[_0xb7f5('0x2c')],_0x3250fe=_0x16c3c8[_0xb7f5('0x2d')],_0xefa47c=_0x16c3c8[_0xb7f5('0x2d')]+_0x16c3c8[_0xb7f5('0x2e')],_0x390bd0;if(_0xefa47c>=_0x1fc98b){_0xefa47c=_0x1fc98b;_0x390bd0=0xc8;}else{_0x390bd0=0xce;}_0x5858e8['status'](_0x390bd0);return _0x5858e8[_0xb7f5('0x2f')]('Content-Range',_0x3250fe+'-'+_0xefa47c+'/'+_0x1fc98b)[_0xb7f5('0x2b')](_0x17f789);}return null;};}function patchUpdates(_0x439b1a){return function(_0x4abea4){try{jsonpatch[_0xb7f5('0x30')](_0x4abea4,_0x439b1a,!![]);}catch(_0x2dce29){return BPromise[_0xb7f5('0x31')](_0x2dce29);}return _0x4abea4[_0xb7f5('0x32')]();};}function saveUpdates(_0x1add89,_0x34624c){return function(_0x469ac9){if(_0x469ac9){return _0x469ac9[_0xb7f5('0x33')](_0x1add89)[_0xb7f5('0x1f')](function(_0x476e42){return _0x476e42;});}return null;};}function removeEntity(_0x4168a8,_0x2647a5){return function(_0x2349f0){if(_0x2349f0){return _0x2349f0['destroy']()[_0xb7f5('0x1f')](function(){_0x4168a8[_0xb7f5('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x563501,_0x3cb084){return function(_0x23ab98){if(!_0x23ab98){_0x563501['sendStatus'](0x194);}return _0x23ab98;};}function handleError(_0x1ce20b,_0x3a98ea){_0x3a98ea=_0x3a98ea||0x1f4;return function(_0xe11ed3){logger[_0xb7f5('0x22')](_0xe11ed3[_0xb7f5('0x34')]);if(_0xe11ed3['name']){delete _0xe11ed3[_0xb7f5('0x35')];}_0x1ce20b[_0xb7f5('0x29')](_0x3a98ea)[_0xb7f5('0x36')](_0xe11ed3);};}exports[_0xb7f5('0x37')]=function(_0x23c358,_0x33fcaf){var _0x5edf4b={},_0x131f4d={},_0x297a96={'count':0x0,'rows':[]};var _0x617d46=db[_0xb7f5('0x38')][_0xb7f5('0x39')];_0x131f4d[_0xb7f5('0x3a')]=_[_0xb7f5('0x3b')](_0x617d46);_0x131f4d[_0xb7f5('0x3c')]=_[_0xb7f5('0x3b')](_0x23c358['query']);_0x131f4d[_0xb7f5('0x3d')]=_[_0xb7f5('0x3e')](_0x131f4d[_0xb7f5('0x3a')],_0x131f4d[_0xb7f5('0x3c')]);_0x5edf4b[_0xb7f5('0x3f')]=_[_0xb7f5('0x3e')](_0x131f4d[_0xb7f5('0x3a')],qs['fields'](_0x23c358['query'][_0xb7f5('0x40')]));_0x5edf4b[_0xb7f5('0x3f')]=_0x5edf4b[_0xb7f5('0x3f')]['length']?_0x5edf4b[_0xb7f5('0x3f')]:_0x131f4d[_0xb7f5('0x3a')];if(!_0x23c358[_0xb7f5('0x3c')][_0xb7f5('0x41')](_0xb7f5('0x42'))){_0x5edf4b['limit']=qs[_0xb7f5('0x2e')](_0x23c358['query']['limit']);_0x5edf4b['offset']=qs['offset'](_0x23c358[_0xb7f5('0x3c')][_0xb7f5('0x2d')]);}_0x5edf4b[_0xb7f5('0x43')]=qs['sort'](_0x23c358[_0xb7f5('0x3c')][_0xb7f5('0x44')]);_0x5edf4b['where']=qs[_0xb7f5('0x3d')](_[_0xb7f5('0x45')](_0x23c358['query'],_0x131f4d[_0xb7f5('0x3d')]));if(_0x23c358[_0xb7f5('0x3c')][_0xb7f5('0x46')]){_0x5edf4b[_0xb7f5('0x47')]=_[_0xb7f5('0x48')](_0x5edf4b[_0xb7f5('0x47')],{'$or':_[_0xb7f5('0x49')](_0x617d46,function(_0x4adc21){if(_0x4adc21[_0xb7f5('0x4a')][_0xb7f5('0x4b')]!=='VIRTUAL'){var _0x43a8b6={};_0x43a8b6[_0x4adc21[_0xb7f5('0x4c')]]={'$like':'%'+_0x23c358[_0xb7f5('0x3c')][_0xb7f5('0x46')]+'%'};return _0x43a8b6;}})});}_0x5edf4b=_[_0xb7f5('0x48')]({},_0x5edf4b,_0x23c358['options']);var _0x1fb746={'where':_0x5edf4b['where']};return db[_0xb7f5('0x38')]['count'](_0x1fb746)[_0xb7f5('0x1f')](function(_0x407e1f){_0x297a96[_0xb7f5('0x2c')]=_0x407e1f;if(_0x23c358[_0xb7f5('0x3c')][_0xb7f5('0x4d')]){_0x5edf4b[_0xb7f5('0x4e')]=[{'all':!![]}];}return db[_0xb7f5('0x38')][_0xb7f5('0x4f')](_0x5edf4b);})['then'](function(_0x56ece5){_0x297a96['rows']=_0x56ece5;return _0x297a96;})[_0xb7f5('0x1f')](respondWithFilteredResult(_0x33fcaf,_0x5edf4b))[_0xb7f5('0x27')](handleError(_0x33fcaf,null));};exports[_0xb7f5('0x50')]=function(_0x540bdf,_0xbb54b){var _0x229195={'raw':!![],'where':{'id':_0x540bdf[_0xb7f5('0x51')]['id']}},_0x1578e6={};_0x1578e6['model']=_[_0xb7f5('0x3b')](db[_0xb7f5('0x38')]['rawAttributes']);_0x1578e6['query']=_[_0xb7f5('0x3b')](_0x540bdf[_0xb7f5('0x3c')]);_0x1578e6['filters']=_[_0xb7f5('0x3e')](_0x1578e6[_0xb7f5('0x3a')],_0x1578e6[_0xb7f5('0x3c')]);_0x229195['attributes']=_['intersection'](_0x1578e6[_0xb7f5('0x3a')],qs[_0xb7f5('0x40')](_0x540bdf[_0xb7f5('0x3c')][_0xb7f5('0x40')]));_0x229195[_0xb7f5('0x3f')]=_0x229195[_0xb7f5('0x3f')][_0xb7f5('0x52')]?_0x229195['attributes']:_0x1578e6[_0xb7f5('0x3a')];if(_0x540bdf[_0xb7f5('0x3c')][_0xb7f5('0x4d')]){_0x229195['include']=[{'all':!![]}];}_0x229195=_[_0xb7f5('0x48')]({},_0x229195,_0x540bdf['options']);return db[_0xb7f5('0x38')][_0xb7f5('0x53')](_0x229195)[_0xb7f5('0x1f')](handleEntityNotFound(_0xbb54b,null))['then'](respondWithResult(_0xbb54b,null))[_0xb7f5('0x27')](handleError(_0xbb54b,null));};exports[_0xb7f5('0x54')]=function(_0x29fa95,_0x554b1a){return db[_0xb7f5('0x38')][_0xb7f5('0x54')](_0x29fa95[_0xb7f5('0x55')],{})[_0xb7f5('0x1f')](respondWithResult(_0x554b1a,0xc9))[_0xb7f5('0x27')](handleError(_0x554b1a,null));};exports[_0xb7f5('0x33')]=function(_0x340bf3,_0x2d5ed5){if(_0x340bf3[_0xb7f5('0x55')]['id']){delete _0x340bf3[_0xb7f5('0x55')]['id'];}return db['SmsMessage']['find']({'where':{'id':_0x340bf3[_0xb7f5('0x51')]['id']}})[_0xb7f5('0x1f')](handleEntityNotFound(_0x2d5ed5,null))[_0xb7f5('0x1f')](saveUpdates(_0x340bf3[_0xb7f5('0x55')],null))[_0xb7f5('0x1f')](respondWithResult(_0x2d5ed5,null))['catch'](handleError(_0x2d5ed5,null));};exports['destroy']=function(_0x2d05cc,_0x3d5d89){return db[_0xb7f5('0x38')][_0xb7f5('0x53')]({'where':{'id':_0x2d05cc[_0xb7f5('0x51')]['id']}})[_0xb7f5('0x1f')](handleEntityNotFound(_0x3d5d89,null))[_0xb7f5('0x1f')](removeEntity(_0x3d5d89,null))[_0xb7f5('0x27')](handleError(_0x3d5d89,null));};exports[_0xb7f5('0x56')]=function(_0x1a3a09,_0x3249aa){return db[_0xb7f5('0x38')]['describe']()[_0xb7f5('0x1f')](respondWithResult(_0x3249aa,null))[_0xb7f5('0x27')](handleError(_0x3249aa,null));};var interaction_log=require(_0xb7f5('0x13'))(_0xb7f5('0x57'));exports[_0xb7f5('0x58')]=function(_0x4590cd,_0x5ee5b7,_0x2dadd8){var _0x550e23={'channel':_0xb7f5('0x59')};if(_0x4590cd[_0xb7f5('0x55')]['id']){delete _0x4590cd[_0xb7f5('0x55')]['id'];}_0x4590cd[_0xb7f5('0x55')]['read']=!![];_0x4590cd[_0xb7f5('0x55')][_0xb7f5('0x5a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4590cd[_0xb7f5('0x55')][_0xb7f5('0x5b')]=_0x4590cd[_0xb7f5('0x55')][_0xb7f5('0x5b')]||_0x4590cd['user']['id'];return db[_0xb7f5('0x38')][_0xb7f5('0x53')]({'where':{'id':_0x4590cd['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xb7f5('0x5c')}]})[_0xb7f5('0x1f')](handleEntityNotFound(_0x5ee5b7,null))[_0xb7f5('0x1f')](saveUpdates(_0x4590cd[_0xb7f5('0x55')],null))[_0xb7f5('0x1f')](function(_0x264db3){if(_0x264db3){_0x550e23['message']=_0x264db3[_0xb7f5('0x5d')]({'plain':!![]});return db[_0xb7f5('0x5e')][_0xb7f5('0x53')]({'where':{'id':_0x264db3[_0xb7f5('0x5f')]}});}return null;})[_0xb7f5('0x1f')](handleEntityNotFound(_0x5ee5b7,null))[_0xb7f5('0x1f')](function(_0x3dc021){if(_0x3dc021){return _0x3dc021[_0xb7f5('0x33')]({'UserId':_0x4590cd[_0xb7f5('0x55')][_0xb7f5('0x5b')],'read1stAt':_[_0xb7f5('0x60')](_0x3dc021[_0xb7f5('0x61')])?moment()[_0xb7f5('0x62')](_0xb7f5('0x63')):undefined});}return null;})['then'](function(_0x105bb8){if(_0x105bb8){_0x550e23['interaction']=_0x105bb8['get']({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4590cd[_0xb7f5('0x64')]['id'],_0x4590cd[_0xb7f5('0x64')]['name'],_0x4590cd[_0xb7f5('0x64')][_0xb7f5('0x65')],_0x550e23[_0xb7f5('0x66')]['id'],_0x4590cd[_0xb7f5('0x55')]?JSON['stringify'](_0x4590cd[_0xb7f5('0x55')]):_0xb7f5('0x67'));return respondWithRpcPromise(_0xb7f5('0x68'),_0xb7f5('0x69'),_0x550e23);}return null;})[_0xb7f5('0x1f')](function(_0x43ea98){if(_0x43ea98){if(_0x4590cd[_0xb7f5('0x55')][_0xb7f5('0x6a')]){_0x550e23[_0xb7f5('0x24')]['interface']=util[_0xb7f5('0x62')]('SIP/%s',_0x4590cd[_0xb7f5('0x64')]['name']);_0x550e23[_0xb7f5('0x24')][_0xb7f5('0x6b')]=_0x550e23[_0xb7f5('0x6b')];_0x550e23[_0xb7f5('0x24')][_0xb7f5('0x6c')]='accept';return respondWithRpcPromise(_0xb7f5('0x6d'),'EventManager',{'event':_0xb7f5('0x6e'),'message':_0x550e23[_0xb7f5('0x24')]},client9002)[_0xb7f5('0x1f')](function(){return _0x550e23;});}return _0x550e23;}return null;})['then'](respondWithResult(_0x5ee5b7,null))[_0xb7f5('0x27')](handleError(_0x5ee5b7,null));};var interaction_log=require(_0xb7f5('0x13'))(_0xb7f5('0x57'));exports[_0xb7f5('0x31')]=function(_0x3a3fe4,_0x5ee665,_0x35a934){var _0x2ec532={'agent':{},'channel':_0xb7f5('0x59')};if(_0x3a3fe4[_0xb7f5('0x55')]['id']){delete _0x3a3fe4['body']['id'];}_0x3a3fe4['body'][_0xb7f5('0x5b')]=_0x3a3fe4[_0xb7f5('0x55')][_0xb7f5('0x5b')]||_0x3a3fe4[_0xb7f5('0x64')]['id'];_0x2ec532['agent']['id']=_0x3a3fe4[_0xb7f5('0x55')][_0xb7f5('0x5b')];return db[_0xb7f5('0x38')][_0xb7f5('0x53')]({'where':{'id':_0x3a3fe4[_0xb7f5('0x51')]['id'],'UserId':null}})[_0xb7f5('0x1f')](handleEntityNotFound(_0x5ee665,null))['then'](function(_0x25f719){if(_0x25f719){_0x2ec532[_0xb7f5('0x24')]=_0x25f719[_0xb7f5('0x5d')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x25f719['SmsInteractionId']}});}return null;})[_0xb7f5('0x1f')](handleEntityNotFound(_0x5ee665,null))[_0xb7f5('0x1f')](function(_0x48c184){if(_0x48c184){_0x2ec532[_0xb7f5('0x66')]=_0x48c184[_0xb7f5('0x5d')]({'plain':!![]});interaction_log[_0xb7f5('0x20')](_0xb7f5('0x6f'),_0x3a3fe4[_0xb7f5('0x64')]['id'],_0x3a3fe4[_0xb7f5('0x64')]['name'],_0x3a3fe4['user'][_0xb7f5('0x65')],_0x2ec532[_0xb7f5('0x66')]['id'],_0x3a3fe4[_0xb7f5('0x55')]?JSON[_0xb7f5('0x70')](_0x3a3fe4['body']):'null');return respondWithRpcPromise(_0xb7f5('0x71'),_0xb7f5('0x72'),_0x2ec532);}return null;})['then'](function(_0x3abcd0){if(_0x3abcd0){_0x3abcd0[_0xb7f5('0x24')]['interface']=util[_0xb7f5('0x62')](_0xb7f5('0x73'),_0x3a3fe4[_0xb7f5('0x64')][_0xb7f5('0x35')]);_0x3abcd0['message'][_0xb7f5('0x6b')]=_0x2ec532[_0xb7f5('0x6b')];_0x3abcd0['message'][_0xb7f5('0x6c')]=_0xb7f5('0x31');respondWithRpcPromise(_0xb7f5('0x6d'),_0xb7f5('0x6d'),{'event':_0xb7f5('0x74'),'message':_0x3abcd0['message']},client9002);return _0x2ec532;}return null;})[_0xb7f5('0x1f')](respondWithResult(_0x5ee665,null))[_0xb7f5('0x27')](handleError(_0x5ee665,null));};exports['status']=function(_0xa41d52,_0x2fd8a0,_0x2b5dbb){if(_0xa41d52[_0xb7f5('0x55')]['id']){delete _0xa41d52[_0xb7f5('0x55')]['id'];}var _0x16e1c6;return db[_0xb7f5('0x38')]['find']({'where':{'id':_0xa41d52[_0xb7f5('0x51')]['id']}})[_0xb7f5('0x1f')](handleEntityNotFound(_0x2fd8a0,null))[_0xb7f5('0x1f')](function(_0x212eae){if(_0x212eae){_0x16e1c6=_0x212eae;return db[_0xb7f5('0x75')]['find']({'where':{'id':_0x212eae[_0xb7f5('0x76')]}});}})[_0xb7f5('0x1f')](handleEntityNotFound(_0x2fd8a0,null))['then'](function(_0xa635bc){if(_0xa635bc){logger[_0xb7f5('0x77')]('SmsMessage,\x20%s,\x20%s,\x20%s','status',_0xb7f5('0x78'),_0xa635bc[_0xb7f5('0x4a')],util[_0xb7f5('0x79')](_0xa41d52[_0xb7f5('0x55')],{'showHidden':![],'depth':null}));switch(_0xa635bc[_0xb7f5('0x4a')]){case _0xb7f5('0x7a'):if(_0xa41d52[_0xb7f5('0x55')][_0xb7f5('0x7b')]&&_0xa41d52[_0xb7f5('0x55')][_0xb7f5('0x7b')]===_0x16e1c6[_0xb7f5('0x7c')]){return _0x16e1c6[_0xb7f5('0x33')]({'read':!![]});}else{logger[_0xb7f5('0x22')](_0xb7f5('0x7d'),'status',_0xb7f5('0x7a'),util[_0xb7f5('0x79')](_0xa41d52[_0xb7f5('0x55')],{'showHidden':![],'depth':null}));}break;case _0xb7f5('0x7e'):if(_0xa41d52[_0xb7f5('0x55')]['MessageUUID']&&_0xa41d52[_0xb7f5('0x55')][_0xb7f5('0x7f')]===_0x16e1c6[_0xb7f5('0x7c')]&&_[_0xb7f5('0x80')]([_0xb7f5('0x81'),_0xb7f5('0x82')],_0xa41d52[_0xb7f5('0x55')][_0xb7f5('0x83')])>=0x0){return _0x16e1c6[_0xb7f5('0x33')]({'read':!![]});}else{logger[_0xb7f5('0x22')](_0xb7f5('0x7d'),_0xb7f5('0x29'),_0xb7f5('0x84'),util[_0xb7f5('0x79')](_0xa41d52[_0xb7f5('0x55')],{'showHidden':![],'depth':null}));}break;case _0xb7f5('0x85'):var _0x2df92c=_0xa41d52['body'][_0xb7f5('0x86')][0x0];if(_0x2df92c[_0xb7f5('0x29')][_0xb7f5('0x87')]===_0xb7f5('0x88')){return _0x16e1c6[_0xb7f5('0x33')]({'read':!![]});}else{logger[_0xb7f5('0x22')](_0xb7f5('0x7d'),_0xb7f5('0x29'),'infobip',util[_0xb7f5('0x79')](_0xa41d52[_0xb7f5('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x16e1c6;}})[_0xb7f5('0x1f')](respondWithResult(_0x2fd8a0,null))[_0xb7f5('0x27')](handleError(_0x2fd8a0,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index c9acaff..5ac21ef 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 _0x1752=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsMessage','setMaxListeners','save','update'];(function(_0x3156e1,_0x5ed421){var _0xe03cae=function(_0x421d08){while(--_0x421d08){_0x3156e1['push'](_0x3156e1['shift']());}};_0xe03cae(++_0x5ed421);}(_0x1752,0xa5));var _0x2175=function(_0x4eeb04,_0x36530d){_0x4eeb04=_0x4eeb04-0x0;var _0x3989e5=_0x1752[_0x4eeb04];return _0x3989e5;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x2175('0x0'))['db'][_0x2175('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x2175('0x2')](0x0);var events={'afterCreate':_0x2175('0x3'),'afterUpdate':_0x2175('0x4'),'afterDestroy':_0x2175('0x5')};function emitEvent(_0x56c315){return function(_0x1ee277,_0x22c167,_0x12b8d9){SmsMessageEvents[_0x2175('0x6')](_0x56c315+':'+_0x1ee277['id'],_0x1ee277);SmsMessageEvents[_0x2175('0x6')](_0x56c315,_0x1ee277);_0x12b8d9(null);};}for(var e in events){if(events[_0x2175('0x7')](e)){var event=events[e];SmsMessage[_0x2175('0x8')](e,emitEvent(event));}}module[_0x2175('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0x4213=['../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x52f5b7,_0x3b37fc){var _0x974160=function(_0x3c318d){while(--_0x3c318d){_0x52f5b7['push'](_0x52f5b7['shift']());}};_0x974160(++_0x3b37fc);}(_0x4213,0x77));var _0x3421=function(_0x1acc4a,_0x31db27){_0x1acc4a=_0x1acc4a-0x0;var _0x50eda2=_0x4213[_0x1acc4a];return _0x50eda2;};'use strict';var EventEmitter=require(_0x3421('0x0'));var SmsMessage=require(_0x3421('0x1'))['db'][_0x3421('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x3421('0x3')](0x0);var events={'afterCreate':_0x3421('0x4'),'afterUpdate':_0x3421('0x5'),'afterDestroy':_0x3421('0x6')};function emitEvent(_0x5a303d){return function(_0xdbd54e,_0x5c3719,_0x459c5e){SmsMessageEvents[_0x3421('0x7')](_0x5a303d+':'+_0xdbd54e['id'],_0xdbd54e);SmsMessageEvents[_0x3421('0x7')](_0x5a303d,_0xdbd54e);_0x459c5e(null);};}for(var e in events){if(events[_0x3421('0x8')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x3421('0x9')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 115be1a..232fb79 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 _0x7f4d=['remote','/api/sms/messages/','then','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','smsMethod','sender','login?username=','&password=','password','GET','session_key','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','POST','https://smsapi.connectel.se/api/send/','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','messages','message_id','clickSend','plivo','authId','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','toString','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','token','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','text','timestamp','keys','sort','length','md5','hex','https://sms.csc.lv/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','apiMessageId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','./smsMessage.attributes','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','direction','secret','isNil','SmsInteraction','findOne','SmsInteractionId','update','catch','error','out','SmsAccount','find','type','twilio','accountSid','authToken','phone','create'];(function(_0x20a15a,_0x391124){var _0x438916=function(_0x2ac85a){while(--_0x2ac85a){_0x20a15a['push'](_0x20a15a['shift']());}};_0x438916(++_0x391124);}(_0x7f4d,0xba));var _0xd7f4=function(_0x79764b,_0x5140aa){_0x79764b=_0x79764b-0x0;var _0x4230cc=_0x7f4d[_0x79764b];return _0x4230cc;};'use strict';var _=require(_0xd7f4('0x0'));var util=require(_0xd7f4('0x1'));var logger=require('../../config/logger')(_0xd7f4('0x2'));var moment=require(_0xd7f4('0x3'));var BPromise=require(_0xd7f4('0x4'));var rp=require(_0xd7f4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd7f4('0x6'));module['exports']=function(_0xc9a1e1,_0x26fe8d){return _0xc9a1e1['define']('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xd7f4('0x7'),'fields':['messageId']},{'name':_0xd7f4('0x8'),'fields':[_0xd7f4('0x9')],'type':_0xd7f4('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f8b6c,_0x148ddb,_0x1a4f25){var _0xbc6e4b=_0xc9a1e1[_0xd7f4('0xb')];var _0x38d7e6=_0x3f8b6c[_0xd7f4('0xc')]({'plain':!![]});if(_0x38d7e6['direction'][_0xd7f4('0xd')]()==='in'||_0x38d7e6[_0xd7f4('0xe')][_0xd7f4('0xd')]()==='out'&&!_0x38d7e6[_0xd7f4('0xf')]&&!_[_0xd7f4('0x10')](_0x38d7e6['UserId'])){_0xbc6e4b[_0xd7f4('0x11')][_0xd7f4('0x12')]({'where':{'id':_0x38d7e6[_0xd7f4('0x13')]}})['then'](function(_0x149e81){if(_0x149e81){_0x149e81[_0xd7f4('0x14')]({'lastMsgAt':_0x38d7e6['createdAt'],'lastMsgDirection':_0x38d7e6['direction']['toLowerCase']()});}})[_0xd7f4('0x15')](function(_0x17c48a){console[_0xd7f4('0x16')](_0x17c48a);});}if(_0x38d7e6[_0xd7f4('0xe')]===_0xd7f4('0x17')&&!_0x38d7e6[_0xd7f4('0xf')]){var _0xa641ec;_0xbc6e4b[_0xd7f4('0x18')][_0xd7f4('0x19')]({'where':{'id':_0x38d7e6['SmsAccountId']},'raw':!![]})['then'](function(_0x31eca1){_0xa641ec=_0x31eca1;if(_0xa641ec&&_0xa641ec[_0xd7f4('0x1a')]){switch(_0xa641ec['type']){case'twilio':var _0x37509f=require(_0xd7f4('0x1b'));if(_0xa641ec[_0xd7f4('0x1c')]&&_0xa641ec[_0xd7f4('0x1d')]&&_0xa641ec[_0xd7f4('0x1e')]){var _0x203ec9=new _0x37509f(_0xa641ec['accountSid'],_0xa641ec[_0xd7f4('0x1d')]);_0x203ec9['messages'][_0xd7f4('0x1f')]({'body':_0x38d7e6[_0xd7f4('0x9')],'to':_0x38d7e6['phone'],'from':_0xa641ec[_0xd7f4('0x1e')],'statusCallback':_0xa641ec[_0xd7f4('0x20')]+_0xd7f4('0x21')+_0x38d7e6['id']+'/status?token='+_0xa641ec['token']})[_0xd7f4('0x22')](function(_0x1d774f){if(_0x1d774f['sid']){return _0x3f8b6c[_0xd7f4('0x14')]({'messageId':_0x1d774f[_0xd7f4('0x23')]});}})['catch'](function(_0x3ec0da){logger[_0xd7f4('0x16')](_0xd7f4('0x24'),_0xd7f4('0x25'),'twilio',util['inspect'](_0x3ec0da,{'showHidden':![],'depth':null}));});}else{logger[_0xd7f4('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio',_0xd7f4('0x26'));}break;case _0xd7f4('0x27'):var _0x2498f2='https://api.skebby.it/API/v1.0/REST/';if(_0xa641ec[_0xd7f4('0x28')]&&_0xa641ec['password']){var _0x1467eb={'recipient':[_0x38d7e6['phone']],'message':_0x38d7e6[_0xd7f4('0x9')],'message_type':_0xa641ec[_0xd7f4('0x29')]};if(_0xa641ec[_0xd7f4('0x29')]&&_0xa641ec[_0xd7f4('0x29')]!=='SI'){_0x1467eb[_0xd7f4('0x2a')]=_0xa641ec[_0xd7f4('0x1e')];}var _0x5aa9c6={'url':_0x2498f2+_0xd7f4('0x2b')+_0xa641ec[_0xd7f4('0x28')]+_0xd7f4('0x2c')+_0xa641ec[_0xd7f4('0x2d')],'method':_0xd7f4('0x2e')};rp(_0x5aa9c6)[_0xd7f4('0x22')](function(_0x6eac46){var _0x58b23b=_0x6eac46['split'](';');var _0x349067={'user_key':_0x58b23b[0x0],'session_key':_0x58b23b[0x1]};_0x5aa9c6={'url':_0x2498f2+'sms','method':'POST','headers':{'user_key':_0x349067['user_key'],'Session_key':_0x349067[_0xd7f4('0x2f')]},'json':!![],'body':_0x1467eb};return rp(_0x5aa9c6);})['then'](function(_0x29358d){if(_0x29358d['total_sent']>=0x1){var _0x2f61a5={'messageId':_0x29358d['internal_order_id']};if(_0xa641ec[_0xd7f4('0x29')]!=='GP'||!_0xa641ec[_0xd7f4('0x30')]){_0x2f61a5[_0xd7f4('0x31')]=!![];}return _0x3f8b6c[_0xd7f4('0x14')](_0x2f61a5);}else{return logger[_0xd7f4('0x16')](_0xd7f4('0x24'),_0xd7f4('0x25'),_0xd7f4('0x27'),util[_0xd7f4('0x32')](_0x29358d,{'showHidden':![],'depth':null}));}})[_0xd7f4('0x15')](function(_0x232025){return logger[_0xd7f4('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd7f4('0x25'),'skebby',util[_0xd7f4('0x32')](_0x232025,{'showHidden':![],'depth':null}));});}else{logger[_0xd7f4('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd7f4('0x25'),_0xd7f4('0x27'),_0xd7f4('0x33'));}break;case _0xd7f4('0x34'):if(_0xa641ec[_0xd7f4('0x1d')]){var _0x4e6c38={'recipient':_0x38d7e6[_0xd7f4('0x1e')],'message':_0x38d7e6[_0xd7f4('0x9')],'sender':_0xa641ec[_0xd7f4('0x35')]||_0xa641ec[_0xd7f4('0x1e')],'authorization':_0xa641ec[_0xd7f4('0x1d')]};var _0x148ddb={'method':_0xd7f4('0x36'),'uri':_0xd7f4('0x37'),'body':_0x4e6c38,'json':!![]};rp(_0x148ddb)[_0xd7f4('0x22')](function(_0x3202b5){var _0x16c6f1={'messageId':_0x3202b5['requestid']};if(!_0xa641ec[_0xd7f4('0x30')]){_0x16c6f1['read']=!![];}return _0x3f8b6c[_0xd7f4('0x14')](_0x16c6f1);})[_0xd7f4('0x15')](function(_0x1d03f5){logger[_0xd7f4('0x16')](_0xd7f4('0x24'),'afterCreate','connectel',util['inspect'](_0x1d03f5,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd7f4('0x24'),_0xd7f4('0x25'),_0xd7f4('0x34'),_0xd7f4('0x38'));}break;case _0xd7f4('0x39'):if(_0xa641ec[_0xd7f4('0x28')]&&_0xa641ec[_0xd7f4('0x2d')]){var _0x4e6c38={'messages':[{'source':'xCALLY\x20Motion','to':_0x38d7e6[_0xd7f4('0x1e')],'body':_0x38d7e6[_0xd7f4('0x9')],'from':_0xa641ec[_0xd7f4('0x35')]||_0xa641ec['phone']}]};var _0x2ff730=util[_0xd7f4('0x3a')](_0xd7f4('0x3b'),_0xa641ec[_0xd7f4('0x28')],_0xa641ec[_0xd7f4('0x2d')]);var _0x148ddb={'method':'POST','uri':_0xd7f4('0x3c'),'body':_0x4e6c38,'headers':{'Authorization':util[_0xd7f4('0x3a')](_0xd7f4('0x3d'),new Buffer(_0x2ff730)['toString'](_0xd7f4('0x3e')))},'json':!![]};rp(_0x148ddb)[_0xd7f4('0x22')](function(_0x22bba0){if(_0x22bba0[_0xd7f4('0x3f')]>=0xc8&&_0x22bba0['http_code']<=0xce){if(_0x22bba0[_0xd7f4('0x40')]&&_0x22bba0['data'][_0xd7f4('0x41')]>0x0){var _0x2f91d3=_['head'](_0x22bba0[_0xd7f4('0x40')][_0xd7f4('0x42')]);var _0x2ccc12={'messageId':_0x2f91d3[_0xd7f4('0x43')]};if(!_0xa641ec[_0xd7f4('0x30')]){_0x2ccc12[_0xd7f4('0x31')]=!![];}return _0x3f8b6c['update'](_0x2ccc12);}else{logger[_0xd7f4('0x16')](_0xd7f4('0x24'),_0xd7f4('0x25'),_0xd7f4('0x44'),util[_0xd7f4('0x32')](_0x22bba0,{'showHidden':![],'depth':null}));}}else{logger[_0xd7f4('0x16')](_0xd7f4('0x24'),_0xd7f4('0x25'),'clickSend',util[_0xd7f4('0x32')](_0x22bba0,{'showHidden':![],'depth':null}));}})[_0xd7f4('0x15')](function(_0x4d57a1){logger[_0xd7f4('0x16')](_0xd7f4('0x24'),_0xd7f4('0x25'),_0xd7f4('0x44'),util[_0xd7f4('0x32')](_0x4d57a1,{'showHidden':![],'depth':null}));});}else{logger[_0xd7f4('0x16')](_0xd7f4('0x24'),'afterCreate',_0xd7f4('0x44'),_0xd7f4('0x33'));}break;case _0xd7f4('0x45'):if(_0xa641ec[_0xd7f4('0x46')]&&_0xa641ec[_0xd7f4('0x1d')]){var _0x4e6c38={'dst':_0x38d7e6['phone'],'text':_0x38d7e6[_0xd7f4('0x9')],'src':_0xa641ec['senderString']||_0xa641ec[_0xd7f4('0x1e')],'url':_0xa641ec[_0xd7f4('0x20')]+'/api/sms/messages/'+_0x38d7e6['id']+_0xd7f4('0x47')+_0xa641ec['token']};var _0x2ff730=util['format']('%s:%s',_0xa641ec[_0xd7f4('0x46')],_0xa641ec[_0xd7f4('0x1d')]);var _0x148ddb={'method':_0xd7f4('0x36'),'uri':util[_0xd7f4('0x3a')](_0xd7f4('0x48'),_0xa641ec['authId']),'body':_0x4e6c38,'headers':{'Authorization':util[_0xd7f4('0x3a')](_0xd7f4('0x3d'),new Buffer(_0x2ff730)[_0xd7f4('0x49')](_0xd7f4('0x3e')))},'json':!![]};rp(_0x148ddb)[_0xd7f4('0x22')](function(_0x1819d0){var _0x3ceb8f={'messageId':_0x1819d0['message_uuid'][0x0]};return _0x3f8b6c[_0xd7f4('0x14')](_0x3ceb8f);})[_0xd7f4('0x15')](function(_0x7cd33b){logger[_0xd7f4('0x16')](_0xd7f4('0x24'),_0xd7f4('0x25'),_0xd7f4('0x45'),util[_0xd7f4('0x32')](_0x7cd33b,{'showHidden':![],'depth':null}));});}else{logger[_0xd7f4('0x16')](_0xd7f4('0x24'),_0xd7f4('0x25'),_0xd7f4('0x45'),_0xd7f4('0x4a'));}break;case _0xd7f4('0x4b'):if(_0xa641ec[_0xd7f4('0x28')]&&_0xa641ec['password']){if(_0xa641ec[_0xd7f4('0x4c')]){var _0x4967e1={'method':_0xd7f4('0x36'),'uri':_0xa641ec['baseUrl']+_0xd7f4('0x4d'),'body':{'username':_0xa641ec[_0xd7f4('0x28')],'password':_0xa641ec['password']},'json':!![]};return rp(_0x4967e1)['then'](function(_0x506a8d){var _0x1389ef={'method':'POST','uri':_0xa641ec[_0xd7f4('0x4c')]+_0xd7f4('0x4e'),'body':{'messages':[{'from':_0xa641ec[_0xd7f4('0x1e')],'destinations':[{'to':_0x38d7e6[_0xd7f4('0x1e')]}],'text':_0x38d7e6['body'],'notifyUrl':_0xa641ec[_0xd7f4('0x20')]+_0xd7f4('0x21')+_0x38d7e6['id']+_0xd7f4('0x47')+_0xa641ec[_0xd7f4('0x4f')],'notifyContentType':_0xd7f4('0x50'),'callbackData':_0xa641ec[_0xd7f4('0x1e')]+';'+_0x38d7e6['body']}]},'headers':{'Authorization':_0xd7f4('0x51')+_0x506a8d[_0xd7f4('0x4f')]},'json':!![]};return rp(_0x1389ef)['then'](function(_0x29b913){if(_0x29b913['messages']){var _0x1bc500={'messageId':_0x29b913[_0xd7f4('0x42')][0x0][_0xd7f4('0x7')]};if(!_0xa641ec[_0xd7f4('0x30')]){_0x1bc500[_0xd7f4('0x31')]=!![];}return _0x3f8b6c[_0xd7f4('0x14')](_0x1bc500);}else{return logger[_0xd7f4('0x16')](_0xd7f4('0x24'),'afterCreate','infobip',util['inspect'](_0x29b913,{'showHidden':![],'depth':null}));}});})[_0xd7f4('0x15')](function(_0x2e16b0){return logger[_0xd7f4('0x16')](_0xd7f4('0x24'),'afterCreate',_0xd7f4('0x4b'),util[_0xd7f4('0x32')](_0x2e16b0,{'showHidden':![],'depth':null}));});}else{logger[_0xd7f4('0x16')](_0xd7f4('0x24'),_0xd7f4('0x25'),_0xd7f4('0x4b'),_0xd7f4('0x52'));}}else{logger[_0xd7f4('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd7f4('0x25'),_0xd7f4('0x4b'),_0xd7f4('0x33'));}break;case _0xd7f4('0x53'):var _0xe12d54=require(_0xd7f4('0x54'));if(_0xa641ec[_0xd7f4('0x55')]){var _0x3b9009={};_0x3b9009['login']=_0xa641ec[_0xd7f4('0x28')];_0x3b9009[_0xd7f4('0x1e')]=_0x38d7e6[_0xd7f4('0x1e')];_0x3b9009[_0xd7f4('0x2a')]=_0xa641ec['phone'];_0x3b9009[_0xd7f4('0x56')]=_0x38d7e6['body'];_0x3b9009[_0xd7f4('0x57')]=+new Date();var _0x55092f='';var _0x2eaf93='';var _0x2cfa2e=Object[_0xd7f4('0x58')](_0x3b9009);_0x2cfa2e[_0xd7f4('0x59')]();for(var _0x31d08e=0x0;_0x31d08e<_0x2cfa2e[_0xd7f4('0x5a')];_0x31d08e++){if(_0x55092f!=''){_0x55092f+='&';}_0x55092f+=_0x2cfa2e[_0x31d08e]+'='+encodeURIComponent(_0x3b9009[_0x2cfa2e[_0x31d08e]]);_0x2eaf93+=_0x3b9009[_0x2cfa2e[_0x31d08e]];}_0x2eaf93+=_0xa641ec['apiKey'];_0x2eaf93=_0xe12d54['createHash'](_0xd7f4('0x5b'))[_0xd7f4('0x14')](_0x2eaf93)['digest'](_0xd7f4('0x5c'));if(_0x55092f!==''){_0x55092f+='&';}_0x55092f+='signature='+_0x2eaf93;var _0x5aa9c6={'method':_0xd7f4('0x2e'),'uri':_0xd7f4('0x5d')+_0x55092f,'json':!![]};return rp(_0x5aa9c6)[_0xd7f4('0x22')](function(_0x483662){var _0x3567b2=Object[_0xd7f4('0x58')](_0x483662);if(_0x483662[_0x3567b2[0x0]][_0xd7f4('0x16')]&&parseInt(_0x483662[_0x3567b2[0x0]]['error'])===0x0){var _0x107e2b={'messageId':_0x483662[_0x3567b2[0x0]][_0xd7f4('0x5e')]};if(!_0xa641ec['deliveryReport']){_0x107e2b[_0xd7f4('0x31')]=!![];}return _0x3f8b6c[_0xd7f4('0x14')](_0x107e2b);}else{return logger[_0xd7f4('0x16')](_0xd7f4('0x24'),'afterCreate','csc',util[_0xd7f4('0x32')](_0x483662[_0xd7f4('0x16')],{'showHidden':![],'depth':null}));}})[_0xd7f4('0x15')](function(_0x31e1e2){return logger[_0xd7f4('0x16')](_0xd7f4('0x24'),_0xd7f4('0x25'),_0xd7f4('0x53'),util[_0xd7f4('0x32')](_0x31e1e2,{'showHidden':![],'depth':null}));});}else{logger[_0xd7f4('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',_0xd7f4('0x5f'));}break;case _0xd7f4('0x60'):if(_0xa641ec[_0xd7f4('0x55')]){var _0x355cd0={'method':_0xd7f4('0x36'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0xa641ec[_0xd7f4('0x55')]},'body':{'content':_0x38d7e6[_0xd7f4('0x9')],'to':[_0x38d7e6[_0xd7f4('0x1e')]],'from':_0xa641ec[_0xd7f4('0x1e')],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0x355cd0)[_0xd7f4('0x22')](function(_0x414b85){if(!_0x414b85[_0xd7f4('0x16')]){var _0x5529af={'messageId':_0x414b85[_0xd7f4('0x42')][0x0][_0xd7f4('0x61')]};if(!_0xa641ec[_0xd7f4('0x30')]){_0x5529af[_0xd7f4('0x31')]=!![];}return _0x3f8b6c[_0xd7f4('0x14')](_0x5529af);}else{return logger[_0xd7f4('0x16')](_0xd7f4('0x24'),_0xd7f4('0x25'),_0xd7f4('0x60'),util[_0xd7f4('0x32')](_0x414b85[_0xd7f4('0x16')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x4ffa7e){return logger[_0xd7f4('0x16')](_0xd7f4('0x24'),_0xd7f4('0x25'),_0xd7f4('0x60'),util[_0xd7f4('0x32')](_0x4ffa7e,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd7f4('0x24'),'afterCreate','clickatell','Missing\x20parameters:\x20apiKey');}break;case _0xd7f4('0x62'):if(_0xa641ec[_0xd7f4('0x55')]){var _0x2ea90e={};var _0x5aa9c6={'method':_0xd7f4('0x36'),'uri':_0xd7f4('0x63'),'headers':{'Authorization':_0xd7f4('0x64')+_0xa641ec[_0xd7f4('0x55')],'Content-Type':_0xd7f4('0x50')},'body':{'from':_0xa641ec[_0xd7f4('0x1e')],'to':_0x38d7e6[_0xd7f4('0x1e')],'text':_0x38d7e6[_0xd7f4('0x9')]},'json':!![]};return rp(_0x5aa9c6)['then'](function(_0x1fc280){if(_0x1fc280[_0xd7f4('0x65')]==0xca){_0x2ea90e[_0xd7f4('0x66')]=_0x1fc280;var _0x3688b3={'method':_0xd7f4('0x36'),'uri':_0xd7f4('0x67'),'headers':{'Authorization':_0xd7f4('0x64')+_0xa641ec[_0xd7f4('0x55')],'Content-Type':_0xd7f4('0x50')},'body':{'refid':_0x2ea90e[_0xd7f4('0x66')][_0xd7f4('0x68')]},'json':!![]};return rp(_0x3688b3)[_0xd7f4('0x22')](function(_0x3d2ee1){_0x2ea90e['status']=_0x3d2ee1;var _0x49cbb8={'messageId':_0x2ea90e[_0xd7f4('0x66')][_0xd7f4('0x68')],'read':!![]};return _0x3f8b6c[_0xd7f4('0x14')](_0x49cbb8);});}else{return logger['error'](_0xd7f4('0x24'),_0xd7f4('0x25'),'intelepeer',util[_0xd7f4('0x32')](_0x1fc280,{'showHidden':![],'depth':null}));}})[_0xd7f4('0x15')](function(_0x3d121e){return logger[_0xd7f4('0x16')](_0xd7f4('0x24'),_0xd7f4('0x25'),_0xd7f4('0x62'),util[_0xd7f4('0x32')](_0x3d121e,{'showHidden':![],'depth':null}));});}else{return logger[_0xd7f4('0x16')](_0xd7f4('0x24'),_0xd7f4('0x25'),_0xd7f4('0x62'),_0xd7f4('0x69'));}break;}}})[_0xd7f4('0x6a')](function(){_0x1a4f25();});}else{_0x1a4f25();}}},'charset':_0xd7f4('0x6b'),'collate':_0xd7f4('0x6c')});}; \ No newline at end of file +var _0xfa82=['secret','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','remote','/api/sms/messages/','/status?token=','token','sid','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','&password=','GET','split','sms','user_key','session_key','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','POST','https://smsapi.connectel.se/api/send/','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','Basic\x20%s','toString','http_code','data','queued_count','head','clickSend','plivo','authId','format','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','sort','length','createHash','md5','digest','hex','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','refid','Token\x20not\x20received','finally','utf8mb4','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','SmsInteraction','findOne','then','update','catch','error'];(function(_0x59ea2e,_0x10a0af){var _0x364d17=function(_0x192824){while(--_0x192824){_0x59ea2e['push'](_0x59ea2e['shift']());}};_0x364d17(++_0x10a0af);}(_0xfa82,0xca));var _0x2fa8=function(_0x245501,_0x5a9b05){_0x245501=_0x245501-0x0;var _0x373ef4=_0xfa82[_0x245501];return _0x373ef4;};'use strict';var _=require(_0x2fa8('0x0'));var util=require(_0x2fa8('0x1'));var logger=require('../../config/logger')(_0x2fa8('0x2'));var moment=require(_0x2fa8('0x3'));var BPromise=require('bluebird');var rp=require(_0x2fa8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2fa8('0x5'));var config=require(_0x2fa8('0x6'));var attributes=require(_0x2fa8('0x7'));module[_0x2fa8('0x8')]=function(_0x4f5aaf,_0xfa458c){return _0x4f5aaf[_0x2fa8('0x9')]('SmsMessage',attributes,{'tableName':_0x2fa8('0xa'),'paranoid':![],'indexes':[{'name':_0x2fa8('0xb'),'fields':[_0x2fa8('0xb')]},{'name':_0x2fa8('0xc'),'fields':[_0x2fa8('0xd')],'type':_0x2fa8('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x170743,_0xd31ffd,_0x29a404){var _0x179edf=_0x4f5aaf[_0x2fa8('0xf')];var _0x192fe0=_0x170743[_0x2fa8('0x10')]({'plain':!![]});if(_0x192fe0[_0x2fa8('0x11')][_0x2fa8('0x12')]()==='in'||_0x192fe0[_0x2fa8('0x11')][_0x2fa8('0x12')]()===_0x2fa8('0x13')&&!_0x192fe0['secret']&&!_[_0x2fa8('0x14')](_0x192fe0[_0x2fa8('0x15')])){_0x179edf[_0x2fa8('0x16')][_0x2fa8('0x17')]({'where':{'id':_0x192fe0['SmsInteractionId']}})[_0x2fa8('0x18')](function(_0x56c4a7){if(_0x56c4a7){_0x56c4a7[_0x2fa8('0x19')]({'lastMsgAt':_0x192fe0['createdAt'],'lastMsgDirection':_0x192fe0[_0x2fa8('0x11')]['toLowerCase']()});}})[_0x2fa8('0x1a')](function(_0x373bd9){console[_0x2fa8('0x1b')](_0x373bd9);});}if(_0x192fe0[_0x2fa8('0x11')]===_0x2fa8('0x13')&&!_0x192fe0[_0x2fa8('0x1c')]){var _0x379ba6;_0x179edf['SmsAccount']['find']({'where':{'id':_0x192fe0[_0x2fa8('0x1d')]},'raw':!![]})[_0x2fa8('0x18')](function(_0x4950a3){_0x379ba6=_0x4950a3;if(_0x379ba6&&_0x379ba6[_0x2fa8('0x1e')]){switch(_0x379ba6[_0x2fa8('0x1e')]){case'twilio':var _0x53e5b7=require(_0x2fa8('0x1f'));if(_0x379ba6[_0x2fa8('0x20')]&&_0x379ba6[_0x2fa8('0x21')]&&_0x379ba6[_0x2fa8('0x22')]){var _0x3c262d=new _0x53e5b7(_0x379ba6[_0x2fa8('0x20')],_0x379ba6['authToken']);_0x3c262d[_0x2fa8('0x23')]['create']({'body':_0x192fe0['body'],'to':_0x192fe0[_0x2fa8('0x22')],'from':_0x379ba6[_0x2fa8('0x22')],'statusCallback':_0x379ba6[_0x2fa8('0x24')]+_0x2fa8('0x25')+_0x192fe0['id']+_0x2fa8('0x26')+_0x379ba6[_0x2fa8('0x27')]})['then'](function(_0x3ef1a1){if(_0x3ef1a1[_0x2fa8('0x28')]){return _0x170743['update']({'messageId':_0x3ef1a1[_0x2fa8('0x28')]});}})['catch'](function(_0x232562){logger[_0x2fa8('0x1b')](_0x2fa8('0x29'),_0x2fa8('0x2a'),_0x2fa8('0x1f'),util[_0x2fa8('0x2b')](_0x232562,{'showHidden':![],'depth':null}));});}else{logger[_0x2fa8('0x1b')](_0x2fa8('0x29'),_0x2fa8('0x2a'),_0x2fa8('0x1f'),_0x2fa8('0x2c'));}break;case _0x2fa8('0x2d'):var _0x4f6325=_0x2fa8('0x2e');if(_0x379ba6['username']&&_0x379ba6[_0x2fa8('0x2f')]){var _0x10d932={'recipient':[_0x192fe0[_0x2fa8('0x22')]],'message':_0x192fe0[_0x2fa8('0xd')],'message_type':_0x379ba6[_0x2fa8('0x30')]};if(_0x379ba6[_0x2fa8('0x30')]&&_0x379ba6[_0x2fa8('0x30')]!=='SI'){_0x10d932[_0x2fa8('0x31')]=_0x379ba6[_0x2fa8('0x22')];}var _0x3fe179={'url':_0x4f6325+_0x2fa8('0x32')+_0x379ba6[_0x2fa8('0x33')]+_0x2fa8('0x34')+_0x379ba6['password'],'method':_0x2fa8('0x35')};rp(_0x3fe179)[_0x2fa8('0x18')](function(_0x3518b0){var _0x4ca904=_0x3518b0[_0x2fa8('0x36')](';');var _0x23e3db={'user_key':_0x4ca904[0x0],'session_key':_0x4ca904[0x1]};_0x3fe179={'url':_0x4f6325+_0x2fa8('0x37'),'method':'POST','headers':{'user_key':_0x23e3db[_0x2fa8('0x38')],'Session_key':_0x23e3db[_0x2fa8('0x39')]},'json':!![],'body':_0x10d932};return rp(_0x3fe179);})[_0x2fa8('0x18')](function(_0x46e4e7){if(_0x46e4e7['total_sent']>=0x1){var _0x10c6c2={'messageId':_0x46e4e7[_0x2fa8('0x3a')]};if(_0x379ba6[_0x2fa8('0x30')]!=='GP'||!_0x379ba6[_0x2fa8('0x3b')]){_0x10c6c2[_0x2fa8('0x3c')]=!![];}return _0x170743[_0x2fa8('0x19')](_0x10c6c2);}else{return logger[_0x2fa8('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2fa8('0x2a'),_0x2fa8('0x2d'),util[_0x2fa8('0x2b')](_0x46e4e7,{'showHidden':![],'depth':null}));}})['catch'](function(_0xc44393){return logger[_0x2fa8('0x1b')](_0x2fa8('0x29'),_0x2fa8('0x2a'),_0x2fa8('0x2d'),util[_0x2fa8('0x2b')](_0xc44393,{'showHidden':![],'depth':null}));});}else{logger[_0x2fa8('0x1b')](_0x2fa8('0x29'),'afterCreate',_0x2fa8('0x2d'),_0x2fa8('0x3d'));}break;case _0x2fa8('0x3e'):if(_0x379ba6[_0x2fa8('0x21')]){var _0x87fa75={'recipient':_0x192fe0[_0x2fa8('0x22')],'message':_0x192fe0['body'],'sender':_0x379ba6[_0x2fa8('0x3f')]||_0x379ba6['phone'],'authorization':_0x379ba6['authToken']};var _0xd31ffd={'method':_0x2fa8('0x40'),'uri':_0x2fa8('0x41'),'body':_0x87fa75,'json':!![]};rp(_0xd31ffd)['then'](function(_0x1b44a4){var _0x15dd17={'messageId':_0x1b44a4['requestid']};if(!_0x379ba6[_0x2fa8('0x3b')]){_0x15dd17[_0x2fa8('0x3c')]=!![];}return _0x170743[_0x2fa8('0x19')](_0x15dd17);})['catch'](function(_0x1a20fb){logger[_0x2fa8('0x1b')](_0x2fa8('0x29'),_0x2fa8('0x2a'),_0x2fa8('0x3e'),util[_0x2fa8('0x2b')](_0x1a20fb,{'showHidden':![],'depth':null}));});}else{logger[_0x2fa8('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2fa8('0x2a'),_0x2fa8('0x3e'),_0x2fa8('0x42'));}break;case _0x2fa8('0x43'):if(_0x379ba6['username']&&_0x379ba6['password']){var _0x87fa75={'messages':[{'source':_0x2fa8('0x44'),'to':_0x192fe0[_0x2fa8('0x22')],'body':_0x192fe0[_0x2fa8('0xd')],'from':_0x379ba6['senderString']||_0x379ba6['phone']}]};var _0x5b2edc=util['format']('%s:%s',_0x379ba6[_0x2fa8('0x33')],_0x379ba6[_0x2fa8('0x2f')]);var _0xd31ffd={'method':_0x2fa8('0x40'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x87fa75,'headers':{'Authorization':util['format'](_0x2fa8('0x45'),new Buffer(_0x5b2edc)[_0x2fa8('0x46')]('base64'))},'json':!![]};rp(_0xd31ffd)[_0x2fa8('0x18')](function(_0xba1260){if(_0xba1260[_0x2fa8('0x47')]>=0xc8&&_0xba1260[_0x2fa8('0x47')]<=0xce){if(_0xba1260['data']&&_0xba1260[_0x2fa8('0x48')][_0x2fa8('0x49')]>0x0){var _0x28aba7=_[_0x2fa8('0x4a')](_0xba1260[_0x2fa8('0x48')]['messages']);var _0x42cfd2={'messageId':_0x28aba7['message_id']};if(!_0x379ba6[_0x2fa8('0x3b')]){_0x42cfd2['read']=!![];}return _0x170743[_0x2fa8('0x19')](_0x42cfd2);}else{logger[_0x2fa8('0x1b')](_0x2fa8('0x29'),_0x2fa8('0x2a'),_0x2fa8('0x4b'),util['inspect'](_0xba1260,{'showHidden':![],'depth':null}));}}else{logger[_0x2fa8('0x1b')](_0x2fa8('0x29'),_0x2fa8('0x2a'),'clickSend',util[_0x2fa8('0x2b')](_0xba1260,{'showHidden':![],'depth':null}));}})[_0x2fa8('0x1a')](function(_0x5879d3){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x2fa8('0x4b'),util[_0x2fa8('0x2b')](_0x5879d3,{'showHidden':![],'depth':null}));});}else{logger[_0x2fa8('0x1b')](_0x2fa8('0x29'),_0x2fa8('0x2a'),_0x2fa8('0x4b'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x2fa8('0x4c'):if(_0x379ba6[_0x2fa8('0x4d')]&&_0x379ba6[_0x2fa8('0x21')]){var _0x87fa75={'dst':_0x192fe0['phone'],'text':_0x192fe0[_0x2fa8('0xd')],'src':_0x379ba6[_0x2fa8('0x3f')]||_0x379ba6[_0x2fa8('0x22')],'url':_0x379ba6[_0x2fa8('0x24')]+_0x2fa8('0x25')+_0x192fe0['id']+_0x2fa8('0x26')+_0x379ba6[_0x2fa8('0x27')]};var _0x5b2edc=util[_0x2fa8('0x4e')]('%s:%s',_0x379ba6[_0x2fa8('0x4d')],_0x379ba6['authToken']);var _0xd31ffd={'method':_0x2fa8('0x40'),'uri':util[_0x2fa8('0x4e')](_0x2fa8('0x4f'),_0x379ba6[_0x2fa8('0x4d')]),'body':_0x87fa75,'headers':{'Authorization':util['format'](_0x2fa8('0x45'),new Buffer(_0x5b2edc)[_0x2fa8('0x46')](_0x2fa8('0x50')))},'json':!![]};rp(_0xd31ffd)[_0x2fa8('0x18')](function(_0x5a0564){var _0x4cedee={'messageId':_0x5a0564[_0x2fa8('0x51')][0x0]};return _0x170743[_0x2fa8('0x19')](_0x4cedee);})[_0x2fa8('0x1a')](function(_0x4b7c42){logger[_0x2fa8('0x1b')](_0x2fa8('0x29'),_0x2fa8('0x2a'),_0x2fa8('0x4c'),util[_0x2fa8('0x2b')](_0x4b7c42,{'showHidden':![],'depth':null}));});}else{logger[_0x2fa8('0x1b')](_0x2fa8('0x29'),_0x2fa8('0x2a'),_0x2fa8('0x4c'),_0x2fa8('0x52'));}break;case _0x2fa8('0x53'):if(_0x379ba6[_0x2fa8('0x33')]&&_0x379ba6['password']){if(_0x379ba6[_0x2fa8('0x54')]){var _0x712901={'method':_0x2fa8('0x40'),'uri':_0x379ba6[_0x2fa8('0x54')]+'/auth/1/session','body':{'username':_0x379ba6['username'],'password':_0x379ba6[_0x2fa8('0x2f')]},'json':!![]};return rp(_0x712901)['then'](function(_0xc01f7e){var _0x1b3819={'method':_0x2fa8('0x40'),'uri':_0x379ba6[_0x2fa8('0x54')]+_0x2fa8('0x55'),'body':{'messages':[{'from':_0x379ba6['phone'],'destinations':[{'to':_0x192fe0[_0x2fa8('0x22')]}],'text':_0x192fe0[_0x2fa8('0xd')],'notifyUrl':_0x379ba6['remote']+_0x2fa8('0x25')+_0x192fe0['id']+'/status?token='+_0x379ba6['token'],'notifyContentType':_0x2fa8('0x56'),'callbackData':_0x379ba6['phone']+';'+_0x192fe0['body']}]},'headers':{'Authorization':_0x2fa8('0x57')+_0xc01f7e[_0x2fa8('0x27')]},'json':!![]};return rp(_0x1b3819)['then'](function(_0xcbcf19){if(_0xcbcf19[_0x2fa8('0x23')]){var _0x39eac6={'messageId':_0xcbcf19['messages'][0x0][_0x2fa8('0xb')]};if(!_0x379ba6[_0x2fa8('0x3b')]){_0x39eac6[_0x2fa8('0x3c')]=!![];}return _0x170743[_0x2fa8('0x19')](_0x39eac6);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2fa8('0x2a'),_0x2fa8('0x53'),util['inspect'](_0xcbcf19,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x3ca50b){return logger[_0x2fa8('0x1b')](_0x2fa8('0x29'),_0x2fa8('0x2a'),_0x2fa8('0x53'),util[_0x2fa8('0x2b')](_0x3ca50b,{'showHidden':![],'depth':null}));});}else{logger[_0x2fa8('0x1b')](_0x2fa8('0x29'),_0x2fa8('0x2a'),'infobip',_0x2fa8('0x58'));}}else{logger['error'](_0x2fa8('0x29'),'afterCreate',_0x2fa8('0x53'),_0x2fa8('0x3d'));}break;case _0x2fa8('0x59'):var _0x173dc5=require(_0x2fa8('0x5a'));if(_0x379ba6[_0x2fa8('0x5b')]){var _0x22f988={};_0x22f988[_0x2fa8('0x5c')]=_0x379ba6[_0x2fa8('0x33')];_0x22f988['phone']=_0x192fe0['phone'];_0x22f988[_0x2fa8('0x31')]=_0x379ba6[_0x2fa8('0x22')];_0x22f988[_0x2fa8('0x5d')]=_0x192fe0['body'];_0x22f988[_0x2fa8('0x5e')]=+new Date();var _0x1c66dc='';var _0x56260c='';var _0x93fb62=Object['keys'](_0x22f988);_0x93fb62[_0x2fa8('0x5f')]();for(var _0x3ba2c4=0x0;_0x3ba2c4<_0x93fb62[_0x2fa8('0x60')];_0x3ba2c4++){if(_0x1c66dc!=''){_0x1c66dc+='&';}_0x1c66dc+=_0x93fb62[_0x3ba2c4]+'='+encodeURIComponent(_0x22f988[_0x93fb62[_0x3ba2c4]]);_0x56260c+=_0x22f988[_0x93fb62[_0x3ba2c4]];}_0x56260c+=_0x379ba6[_0x2fa8('0x5b')];_0x56260c=_0x173dc5[_0x2fa8('0x61')](_0x2fa8('0x62'))['update'](_0x56260c)[_0x2fa8('0x63')](_0x2fa8('0x64'));if(_0x1c66dc!==''){_0x1c66dc+='&';}_0x1c66dc+='signature='+_0x56260c;var _0x3fe179={'method':_0x2fa8('0x35'),'uri':'https://sms.csc.lv/external/get/send.php?'+_0x1c66dc,'json':!![]};return rp(_0x3fe179)[_0x2fa8('0x18')](function(_0x3d68d4){var _0x152540=Object['keys'](_0x3d68d4);if(_0x3d68d4[_0x152540[0x0]][_0x2fa8('0x1b')]&&parseInt(_0x3d68d4[_0x152540[0x0]][_0x2fa8('0x1b')])===0x0){var _0x382490={'messageId':_0x3d68d4[_0x152540[0x0]][_0x2fa8('0x65')]};if(!_0x379ba6[_0x2fa8('0x3b')]){_0x382490[_0x2fa8('0x3c')]=!![];}return _0x170743[_0x2fa8('0x19')](_0x382490);}else{return logger[_0x2fa8('0x1b')](_0x2fa8('0x29'),_0x2fa8('0x2a'),_0x2fa8('0x59'),util[_0x2fa8('0x2b')](_0x3d68d4['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x5bc7cb){return logger[_0x2fa8('0x1b')](_0x2fa8('0x29'),_0x2fa8('0x2a'),_0x2fa8('0x59'),util[_0x2fa8('0x2b')](_0x5bc7cb,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2fa8('0x29'),_0x2fa8('0x2a'),'csc',_0x2fa8('0x66'));}break;case _0x2fa8('0x67'):if(_0x379ba6['apiKey']){var _0x204b31={'method':'POST','uri':_0x2fa8('0x68'),'headers':{'Authorization':_0x379ba6['apiKey']},'body':{'content':_0x192fe0['body'],'to':[_0x192fe0['phone']],'from':_0x379ba6[_0x2fa8('0x22')],'binary':![],'clientMessageId':_0x2fa8('0x69'),'charset':_0x2fa8('0x6a')},'json':!![]};rp(_0x204b31)['then'](function(_0xef0afe){if(!_0xef0afe[_0x2fa8('0x1b')]){var _0x5bb3a4={'messageId':_0xef0afe['messages'][0x0]['apiMessageId']};if(!_0x379ba6[_0x2fa8('0x3b')]){_0x5bb3a4[_0x2fa8('0x3c')]=!![];}return _0x170743['update'](_0x5bb3a4);}else{return logger[_0x2fa8('0x1b')](_0x2fa8('0x29'),'afterCreate',_0x2fa8('0x67'),util[_0x2fa8('0x2b')](_0xef0afe['error'],{'showHidden':![],'depth':null}));}})[_0x2fa8('0x1a')](function(_0x2e7fd8){return logger[_0x2fa8('0x1b')](_0x2fa8('0x29'),'afterCreate',_0x2fa8('0x67'),util[_0x2fa8('0x2b')](_0x2e7fd8,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2fa8('0x29'),_0x2fa8('0x2a'),_0x2fa8('0x67'),_0x2fa8('0x66'));}break;case _0x2fa8('0x6b'):if(_0x379ba6[_0x2fa8('0x5b')]){var _0x1a7fd2={};var _0x3fe179={'method':'POST','uri':_0x2fa8('0x6c'),'headers':{'Authorization':'Bearer\x20'+_0x379ba6[_0x2fa8('0x5b')],'Content-Type':_0x2fa8('0x56')},'body':{'from':_0x379ba6[_0x2fa8('0x22')],'to':_0x192fe0[_0x2fa8('0x22')],'text':_0x192fe0['body']},'json':!![]};return rp(_0x3fe179)['then'](function(_0x59c5bb){if(_0x59c5bb[_0x2fa8('0x6d')]==0xca){_0x1a7fd2[_0x2fa8('0x6e')]=_0x59c5bb;var _0x2ce30d={'method':_0x2fa8('0x40'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':'Bearer\x20'+_0x379ba6[_0x2fa8('0x5b')],'Content-Type':_0x2fa8('0x56')},'body':{'refid':_0x1a7fd2[_0x2fa8('0x6e')][_0x2fa8('0x6f')]},'json':!![]};return rp(_0x2ce30d)['then'](function(_0x2d85e6){_0x1a7fd2['status']=_0x2d85e6;var _0x1f00cb={'messageId':_0x1a7fd2['message'][_0x2fa8('0x6f')],'read':!![]};return _0x170743[_0x2fa8('0x19')](_0x1f00cb);});}else{return logger[_0x2fa8('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2fa8('0x2a'),_0x2fa8('0x6b'),util[_0x2fa8('0x2b')](_0x59c5bb,{'showHidden':![],'depth':null}));}})[_0x2fa8('0x1a')](function(_0x2ae804){return logger[_0x2fa8('0x1b')](_0x2fa8('0x29'),_0x2fa8('0x2a'),_0x2fa8('0x6b'),util[_0x2fa8('0x2b')](_0x2ae804,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2fa8('0x2a'),_0x2fa8('0x6b'),_0x2fa8('0x70'));}break;}}})[_0x2fa8('0x71')](function(){_0x29a404();});}else{_0x29a404();}}},'charset':_0x2fa8('0x72'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index a31abf6..d8b451c 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 _0xe639=['then','debug','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','socket.io-emitter','./smsMessage.socket','register','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','info','result','catch','CreateSmsMessage','SmsMessage','create','options','raw'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0xe639,0x93));var _0x9e63=function(_0x298b97,_0x3b66cb){_0x298b97=_0x298b97-0x0;var _0x558065=_0xe639[_0x298b97];return _0x558065;};'use strict';var _=require(_0x9e63('0x0'));var util=require('util');var moment=require(_0x9e63('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e63('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e63('0x3'));var logger=require(_0x9e63('0x4'))(_0x9e63('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9e63('0x6')][_0x9e63('0x7')]({'port':0x232a});config[_0x9e63('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9e63('0x9'))(new Redis(config[_0x9e63('0x8')]));require(_0x9e63('0xa'))[_0x9e63('0xb')](socket);function respondWithRpcPromise(_0x1e10d0,_0x17dcb1,_0x27c81b){return new BPromise(function(_0x1b75e9,_0x241563){return client['request'](_0x1e10d0,_0x27c81b)['then'](function(_0x8994c3){logger['info']('SmsMessage,\x20%s,\x20%s',_0x17dcb1,_0x9e63('0xc'));logger['debug'](_0x9e63('0xd'),_0x17dcb1,_0x9e63('0xc'),JSON[_0x9e63('0xe')](_0x8994c3));if(_0x8994c3[_0x9e63('0xf')]){if(_0x8994c3[_0x9e63('0xf')][_0x9e63('0x10')]===0x1f4){logger[_0x9e63('0xf')](_0x9e63('0x11'),_0x17dcb1,_0x8994c3[_0x9e63('0xf')][_0x9e63('0x12')]);return _0x241563(_0x8994c3[_0x9e63('0xf')]['message']);}logger['error'](_0x9e63('0x11'),_0x17dcb1,_0x8994c3['error']['message']);return _0x1b75e9(_0x8994c3['error'][_0x9e63('0x12')]);}else{logger[_0x9e63('0x13')](_0x9e63('0x11'),_0x17dcb1,_0x9e63('0xc'));_0x1b75e9(_0x8994c3[_0x9e63('0x14')][_0x9e63('0x12')]);}})[_0x9e63('0x15')](function(_0x16cb44){logger[_0x9e63('0xf')](_0x9e63('0x11'),_0x17dcb1,_0x16cb44);_0x241563(_0x16cb44);});});}exports[_0x9e63('0x16')]=function(_0x386709){var _0x237152=this;return new Promise(function(_0x2fe496,_0x10f19a){return db[_0x9e63('0x17')][_0x9e63('0x18')](_0x386709['body'],{'raw':_0x386709[_0x9e63('0x19')]?_0x386709['options'][_0x9e63('0x1a')]===undefined?!![]:![]:!![]})[_0x9e63('0x1b')](function(_0x28d557){logger[_0x9e63('0x13')]('CreateSmsMessage',_0x386709);logger[_0x9e63('0x1c')](_0x9e63('0x16'),_0x386709,JSON[_0x9e63('0xe')](_0x28d557));_0x2fe496(_0x28d557);})[_0x9e63('0x15')](function(_0x1b6b82){logger['error'](_0x9e63('0x16'),_0x1b6b82[_0x9e63('0x12')],_0x386709);_0x10f19a(_0x237152[_0x9e63('0xf')](0x1f4,_0x1b6b82[_0x9e63('0x12')]));});});}; \ No newline at end of file +var _0x5904=['error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s'];(function(_0x186885,_0x468915){var _0x45fae3=function(_0x54c891){while(--_0x54c891){_0x186885['push'](_0x186885['shift']());}};_0x45fae3(++_0x468915);}(_0x5904,0x176));var _0x4590=function(_0x3033c2,_0x3cb8f6){_0x3033c2=_0x3033c2-0x0;var _0x1e01be=_0x5904[_0x3033c2];return _0x1e01be;};'use strict';var _=require(_0x4590('0x0'));var util=require(_0x4590('0x1'));var moment=require(_0x4590('0x2'));var BPromise=require(_0x4590('0x3'));var rs=require(_0x4590('0x4'));var fs=require('fs');var Redis=require(_0x4590('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4590('0x6'));var logger=require('../../config/logger')(_0x4590('0x7'));var config=require(_0x4590('0x8'));var jayson=require(_0x4590('0x9'));var client=jayson['client'][_0x4590('0xa')]({'port':0x232a});config[_0x4590('0xb')]=_[_0x4590('0xc')](config['redis'],{'host':_0x4590('0xd'),'port':0x18eb});var socket=require(_0x4590('0xe'))(new Redis(config['redis']));require(_0x4590('0xf'))['register'](socket);function respondWithRpcPromise(_0x1cc2be,_0x562026,_0x58114e){return new BPromise(function(_0x25576a,_0x1a17ab){return client['request'](_0x1cc2be,_0x58114e)[_0x4590('0x10')](function(_0x136bd6){logger[_0x4590('0x11')](_0x4590('0x12'),_0x562026,_0x4590('0x13'));logger[_0x4590('0x14')](_0x4590('0x15'),_0x562026,_0x4590('0x13'),JSON['stringify'](_0x136bd6));if(_0x136bd6['error']){if(_0x136bd6[_0x4590('0x16')][_0x4590('0x17')]===0x1f4){logger[_0x4590('0x16')](_0x4590('0x12'),_0x562026,_0x136bd6[_0x4590('0x16')][_0x4590('0x18')]);return _0x1a17ab(_0x136bd6[_0x4590('0x16')][_0x4590('0x18')]);}logger['error'](_0x4590('0x12'),_0x562026,_0x136bd6['error'][_0x4590('0x18')]);return _0x25576a(_0x136bd6[_0x4590('0x16')][_0x4590('0x18')]);}else{logger['info'](_0x4590('0x12'),_0x562026,'request\x20sent');_0x25576a(_0x136bd6[_0x4590('0x19')][_0x4590('0x18')]);}})[_0x4590('0x1a')](function(_0x3e9581){logger[_0x4590('0x16')](_0x4590('0x12'),_0x562026,_0x3e9581);_0x1a17ab(_0x3e9581);});});}exports[_0x4590('0x1b')]=function(_0x393b4f){var _0x1b19cf=this;return new Promise(function(_0x1e1b36,_0x448f06){return db[_0x4590('0x1c')][_0x4590('0x1d')](_0x393b4f[_0x4590('0x1e')],{'raw':_0x393b4f['options']?_0x393b4f['options'][_0x4590('0x1f')]===undefined?!![]:![]:!![]})[_0x4590('0x10')](function(_0x2d5208){logger[_0x4590('0x11')](_0x4590('0x1b'),_0x393b4f);logger[_0x4590('0x14')](_0x4590('0x1b'),_0x393b4f,JSON[_0x4590('0x20')](_0x2d5208));_0x1e1b36(_0x2d5208);})[_0x4590('0x1a')](function(_0xc3d507){logger[_0x4590('0x16')]('CreateSmsMessage',_0xc3d507[_0x4590('0x18')],_0x393b4f);_0x448f06(_0x1b19cf[_0x4590('0x16')](0x1f4,_0xc3d507[_0x4590('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index c162b79..9d12816 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 _0xc9d7=['smsMessage:','./smsMessage.events','length'];(function(_0x2943af,_0x72f03b){var _0x3861d2=function(_0x27997c){while(--_0x27997c){_0x2943af['push'](_0x2943af['shift']());}};_0x3861d2(++_0x72f03b);}(_0xc9d7,0xa3));var _0x7c9d=function(_0x4d8666,_0x2ff19d){_0x4d8666=_0x4d8666-0x0;var _0x37175b=_0xc9d7[_0x4d8666];return _0x37175b;};'use strict';var SmsMessageEvents=require(_0x7c9d('0x0'));var events=['save','remove','update'];function createListener(_0x3097c2,_0x348171){return function(_0x4ea6a5){_0x348171['emit'](_0x3097c2,_0x4ea6a5);};}function removeListener(_0x2699e8,_0x1064d9){return function(){SmsMessageEvents['removeListener'](_0x2699e8,_0x1064d9);};}exports['register']=function(_0x30739a){for(var _0x2ecb89=0x0,_0x32ea6b=events[_0x7c9d('0x1')];_0x2ecb89<_0x32ea6b;_0x2ecb89++){var _0x3e3882=events[_0x2ecb89];var _0x226793=createListener(_0x7c9d('0x2')+_0x3e3882,_0x30739a);SmsMessageEvents['on'](_0x3e3882,_0x226793);}}; \ No newline at end of file +var _0x7a8a=['./smsMessage.events','save','remove','update','emit','removeListener','register','length','smsMessage:'];(function(_0x104362,_0x2d3771){var _0x5365da=function(_0x428c20){while(--_0x428c20){_0x104362['push'](_0x104362['shift']());}};_0x5365da(++_0x2d3771);}(_0x7a8a,0x15f));var _0xa7a8=function(_0x597ffd,_0x58b90c){_0x597ffd=_0x597ffd-0x0;var _0x159e8c=_0x7a8a[_0x597ffd];return _0x159e8c;};'use strict';var SmsMessageEvents=require(_0xa7a8('0x0'));var events=[_0xa7a8('0x1'),_0xa7a8('0x2'),_0xa7a8('0x3')];function createListener(_0x5dcda7,_0x5347c8){return function(_0x270ba1){_0x5347c8[_0xa7a8('0x4')](_0x5dcda7,_0x270ba1);};}function removeListener(_0x26c604,_0x51b514){return function(){SmsMessageEvents[_0xa7a8('0x5')](_0x26c604,_0x51b514);};}exports[_0xa7a8('0x6')]=function(_0x13ad7f){for(var _0x302104=0x0,_0x350d4c=events[_0xa7a8('0x7')];_0x302104<_0x350d4c;_0x302104++){var _0x43d526=events[_0x302104];var _0x299f4d=createListener(_0xa7a8('0x8')+_0x43d526,_0x13ad7f);SmsMessageEvents['on'](_0x43d526,_0x299f4d);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 47d0712..39055e8 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 _0xe54b=['/:id/members','getMembers','/:id/teams','/:id/users','post','create','addTeams','addAgents','put','/:id','update','destroy','delete','removeTeams','removeAgents','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x2f2e2f,_0x2f1334){var _0x2ea743=function(_0x20950a){while(--_0x20950a){_0x2f2e2f['push'](_0x2f2e2f['shift']());}};_0x2ea743(++_0x2f1334);}(_0xe54b,0xd3));var _0xbe54=function(_0x30fd52,_0x329d95){_0x30fd52=_0x30fd52-0x0;var _0x258e1a=_0xe54b[_0x30fd52];return _0x258e1a;};'use strict';var multer=require('multer');var util=require(_0xbe54('0x0'));var path=require(_0xbe54('0x1'));var timeout=require(_0xbe54('0x2'));var express=require(_0xbe54('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xbe54('0x4'));var config=require(_0xbe54('0x5'));var controller=require(_0xbe54('0x6'));router[_0xbe54('0x7')]('/',auth[_0xbe54('0x8')](),controller[_0xbe54('0x9')]);router['get'](_0xbe54('0xa'),auth[_0xbe54('0x8')](),controller[_0xbe54('0xb')]);router[_0xbe54('0x7')]('/:id',auth[_0xbe54('0x8')](),controller[_0xbe54('0xc')]);router[_0xbe54('0x7')](_0xbe54('0xd'),auth[_0xbe54('0x8')](),controller[_0xbe54('0xe')]);router[_0xbe54('0x7')](_0xbe54('0xf'),auth[_0xbe54('0x8')](),controller['getTeams']);router['get'](_0xbe54('0x10'),auth[_0xbe54('0x8')](),controller['getAgents']);router[_0xbe54('0x11')]('/',auth[_0xbe54('0x8')](),controller[_0xbe54('0x12')]);router[_0xbe54('0x11')](_0xbe54('0xf'),auth['isAuthenticated'](),controller[_0xbe54('0x13')]);router[_0xbe54('0x11')](_0xbe54('0x10'),auth[_0xbe54('0x8')](),controller[_0xbe54('0x14')]);router[_0xbe54('0x15')](_0xbe54('0x16'),auth[_0xbe54('0x8')](),controller[_0xbe54('0x17')]);router['delete'](_0xbe54('0x16'),auth['isAuthenticated'](),controller[_0xbe54('0x18')]);router[_0xbe54('0x19')](_0xbe54('0xf'),auth[_0xbe54('0x8')](),controller[_0xbe54('0x1a')]);router[_0xbe54('0x19')](_0xbe54('0x10'),auth[_0xbe54('0x8')](),controller[_0xbe54('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x02a8=['index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','destroy','delete','removeTeams','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated'];(function(_0x2cb7a3,_0x58c0e1){var _0x49df09=function(_0x15b914){while(--_0x15b914){_0x2cb7a3['push'](_0x2cb7a3['shift']());}};_0x49df09(++_0x58c0e1);}(_0x02a8,0xc2));var _0x802a=function(_0x576d2a,_0x573988){_0x576d2a=_0x576d2a-0x0;var _0x32a2f4=_0x02a8[_0x576d2a];return _0x32a2f4;};'use strict';var multer=require(_0x802a('0x0'));var util=require(_0x802a('0x1'));var path=require(_0x802a('0x2'));var timeout=require(_0x802a('0x3'));var express=require(_0x802a('0x4'));var router=express[_0x802a('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x802a('0x6'));var config=require('../../config/environment');var controller=require('./smsQueue.controller');router[_0x802a('0x7')]('/',auth[_0x802a('0x8')](),controller[_0x802a('0x9')]);router[_0x802a('0x7')](_0x802a('0xa'),auth['isAuthenticated'](),controller[_0x802a('0xb')]);router[_0x802a('0x7')](_0x802a('0xc'),auth[_0x802a('0x8')](),controller[_0x802a('0xd')]);router[_0x802a('0x7')]('/:id/members',auth['isAuthenticated'](),controller[_0x802a('0xe')]);router[_0x802a('0x7')](_0x802a('0xf'),auth[_0x802a('0x8')](),controller[_0x802a('0x10')]);router[_0x802a('0x7')](_0x802a('0x11'),auth[_0x802a('0x8')](),controller[_0x802a('0x12')]);router[_0x802a('0x13')]('/',auth[_0x802a('0x8')](),controller[_0x802a('0x14')]);router[_0x802a('0x13')](_0x802a('0xf'),auth['isAuthenticated'](),controller[_0x802a('0x15')]);router[_0x802a('0x13')](_0x802a('0x11'),auth['isAuthenticated'](),controller[_0x802a('0x16')]);router[_0x802a('0x17')](_0x802a('0xc'),auth[_0x802a('0x8')](),controller[_0x802a('0x18')]);router['delete'](_0x802a('0xc'),auth[_0x802a('0x8')](),controller[_0x802a('0x19')]);router[_0x802a('0x1a')](_0x802a('0xf'),auth['isAuthenticated'](),controller[_0x802a('0x1b')]);router['delete'](_0x802a('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x802a('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 821c84c..ad04015 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 _0x64f1=['INTEGER','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x2badaf,_0x393c6c){var _0x19a4fb=function(_0x4d6cb3){while(--_0x4d6cb3){_0x2badaf['push'](_0x2badaf['shift']());}};_0x19a4fb(++_0x393c6c);}(_0x64f1,0x153));var _0x164f=function(_0x365be9,_0x3c88b9){_0x365be9=_0x365be9-0x0;var _0x185c12=_0x64f1[_0x365be9];return _0x185c12;};'use strict';var Sequelize=require(_0x164f('0x0'));module[_0x164f('0x1')]={'name':{'type':Sequelize[_0x164f('0x2')],'unique':_0x164f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x164f('0x2')]},'timeout':{'type':Sequelize[_0x164f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x164f('0x5'),_0x164f('0x6'))}}; \ No newline at end of file +var _0xe59d=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0xe6d8c8,_0x40af61){var _0xb3a7e8=function(_0x2ab83d){while(--_0x2ab83d){_0xe6d8c8['push'](_0xe6d8c8['shift']());}};_0xb3a7e8(++_0x40af61);}(_0xe59d,0x16a));var _0xde59=function(_0x47afba,_0x290a9d){_0x47afba=_0x47afba-0x0;var _0x55d7b4=_0xe59d[_0x47afba];return _0x55d7b4;};'use strict';var Sequelize=require(_0xde59('0x0'));module[_0xde59('0x1')]={'name':{'type':Sequelize[_0xde59('0x2')],'unique':_0xde59('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xde59('0x2')]},'timeout':{'type':Sequelize[_0xde59('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xde59('0x5')](_0xde59('0x6'),_0xde59('0x7'),_0xde59('0x8'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index eac8cbc..32d0e15 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 _0xb0cf=['../../config/license/hardware','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','SmsQueues','name','send','SmsQueue','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','key','field','options','count','includeAll','include','rows','catch','show','params','keys','rawAttributes','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','User','UserId','smsPause','updatedAt','createdAt','%s/%s','Team','getTeams','addTeams','teams','online','voicePause','interface','Agents','sequelize','transaction','findOrCreate','forEach','emit','ids','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','push','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','userSmsQueue:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x1fc582,_0x4919f2){var _0x191148=function(_0x4e6bda){while(--_0x4e6bda){_0x1fc582['push'](_0x1fc582['shift']());}};_0x191148(++_0x4919f2);}(_0xb0cf,0xf0));var _0xfb0c=function(_0x209735,_0x2a1c65){_0x209735=_0x209735-0x0;var _0x44ee3f=_0xb0cf[_0x209735];return _0x44ee3f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xfb0c('0x0'));var zipdir=require(_0xfb0c('0x1'));var jsonpatch=require(_0xfb0c('0x2'));var rp=require(_0xfb0c('0x3'));var moment=require(_0xfb0c('0x4'));var BPromise=require(_0xfb0c('0x5'));var Mustache=require(_0xfb0c('0x6'));var util=require(_0xfb0c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xfb0c('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xfb0c('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xfb0c('0xa'));var toCsv=require(_0xfb0c('0x8'));var querystring=require(_0xfb0c('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfb0c('0xc'));var qs=require(_0xfb0c('0xd'));var hardwareService=require(_0xfb0c('0xe'));var logger=require('../../config/logger')('api');var utils=require(_0xfb0c('0xf'));var config=require('../../config/environment');var db=require(_0xfb0c('0x10'))['db'];config[_0xfb0c('0x11')]=_['defaults'](config[_0xfb0c('0x11')],{'host':_0xfb0c('0x12'),'port':0x18eb});var socket=require(_0xfb0c('0x13'))(new Redis(config[_0xfb0c('0x11')]));require(_0xfb0c('0x14'))[_0xfb0c('0x15')](socket);function respondWithStatusCode(_0x2755b4,_0x283e32){_0x283e32=_0x283e32||0xcc;return function(_0x2d9993){if(_0x2d9993){return _0x2755b4[_0xfb0c('0x16')](_0x283e32);}return _0x2755b4[_0xfb0c('0x17')](_0x283e32)[_0xfb0c('0x18')]();};}function respondWithResult(_0x2f11df,_0x33c820){_0x33c820=_0x33c820||0xc8;return function(_0x146ffb){if(_0x146ffb){return _0x2f11df['status'](_0x33c820)['json'](_0x146ffb);}};}function respondWithFilteredResult(_0x5269c8,_0x4a6f6d){return function(_0xbd7d95){if(_0xbd7d95){var _0x296698=_0xbd7d95['count'],_0x274862=_0x4a6f6d[_0xfb0c('0x19')],_0x3d4d0c=_0x4a6f6d[_0xfb0c('0x19')]+_0x4a6f6d[_0xfb0c('0x1a')],_0x17e140;if(_0x3d4d0c>=_0x296698){_0x3d4d0c=_0x296698;_0x17e140=0xc8;}else{_0x17e140=0xce;}_0x5269c8[_0xfb0c('0x17')](_0x17e140);return _0x5269c8[_0xfb0c('0x1b')](_0xfb0c('0x1c'),_0x274862+'-'+_0x3d4d0c+'/'+_0x296698)[_0xfb0c('0x1d')](_0xbd7d95);}return null;};}function patchUpdates(_0x3fb7b9){return function(_0x4b036b){try{jsonpatch[_0xfb0c('0x1e')](_0x4b036b,_0x3fb7b9,!![]);}catch(_0x4dff3f){return BPromise[_0xfb0c('0x1f')](_0x4dff3f);}return _0x4b036b[_0xfb0c('0x20')]();};}function saveUpdates(_0x2583c1,_0x2f2c40){return function(_0x581e39){if(_0x581e39){return _0x581e39[_0xfb0c('0x21')](_0x2583c1)['then'](function(_0x2c8c27){return _0x2c8c27;});}return null;};}function removeEntity(_0x3a38be,_0x5cf97c){return function(_0x36faf9){if(_0x36faf9){return _0x36faf9[_0xfb0c('0x22')]()[_0xfb0c('0x23')](function(){var _0x457db2=_0x36faf9['get']({'plain':!![]});var _0x397fa5=_0xfb0c('0x24');return db['UserProfileResource'][_0xfb0c('0x22')]({'where':{'type':_0x397fa5,'resourceId':_0x457db2['id']}})[_0xfb0c('0x23')](function(){return _0x36faf9;});})['then'](function(){_0x3a38be[_0xfb0c('0x17')](0xcc)[_0xfb0c('0x18')]();});}};}function handleEntityNotFound(_0x188a61,_0x18c972){return function(_0x591984){if(!_0x591984){_0x188a61[_0xfb0c('0x16')](0x194);}return _0x591984;};}function handleError(_0x559d0e,_0x43ec06){_0x43ec06=_0x43ec06||0x1f4;return function(_0x37fbed){logger['error'](_0x37fbed['stack']);if(_0x37fbed[_0xfb0c('0x25')]){delete _0x37fbed[_0xfb0c('0x25')];}_0x559d0e['status'](_0x43ec06)[_0xfb0c('0x26')](_0x37fbed);};}exports['index']=function(_0x41e181,_0x3bf5a7){var _0x35de4c={},_0x3d3749={},_0x1e8066={'count':0x0,'rows':[]};var _0x5661eb=db[_0xfb0c('0x27')]['rawAttributes'];_0x3d3749[_0xfb0c('0x28')]=_['keys'](_0x5661eb);_0x3d3749[_0xfb0c('0x29')]=_['keys'](_0x41e181[_0xfb0c('0x29')]);_0x3d3749[_0xfb0c('0x2a')]=_[_0xfb0c('0x2b')](_0x3d3749['model'],_0x3d3749[_0xfb0c('0x29')]);_0x35de4c[_0xfb0c('0x2c')]=_[_0xfb0c('0x2b')](_0x3d3749[_0xfb0c('0x28')],qs['fields'](_0x41e181['query'][_0xfb0c('0x2d')]));_0x35de4c[_0xfb0c('0x2c')]=_0x35de4c[_0xfb0c('0x2c')][_0xfb0c('0x2e')]?_0x35de4c[_0xfb0c('0x2c')]:_0x3d3749[_0xfb0c('0x28')];if(!_0x41e181[_0xfb0c('0x29')][_0xfb0c('0x2f')](_0xfb0c('0x30'))){_0x35de4c[_0xfb0c('0x1a')]=qs[_0xfb0c('0x1a')](_0x41e181['query'][_0xfb0c('0x1a')]);_0x35de4c[_0xfb0c('0x19')]=qs[_0xfb0c('0x19')](_0x41e181[_0xfb0c('0x29')][_0xfb0c('0x19')]);}_0x35de4c[_0xfb0c('0x31')]=qs[_0xfb0c('0x32')](_0x41e181[_0xfb0c('0x29')]['sort']);_0x35de4c[_0xfb0c('0x33')]=qs[_0xfb0c('0x2a')](_[_0xfb0c('0x34')](_0x41e181[_0xfb0c('0x29')],_0x3d3749[_0xfb0c('0x2a')]));if(_0x41e181['query'][_0xfb0c('0x35')]){_0x35de4c['where']=_['merge'](_0x35de4c[_0xfb0c('0x33')],{'$or':_[_0xfb0c('0x36')](_0x5661eb,function(_0x3cb5cc){if(_0x3cb5cc['type'][_0xfb0c('0x37')]!=='VIRTUAL'){var _0x3d8ce1={};_0x3d8ce1[_0x3cb5cc[_0xfb0c('0x38')]]={'$like':'%'+_0x41e181[_0xfb0c('0x29')]['filter']+'%'};return _0x3d8ce1;}})});}_0x35de4c=_['merge']({},_0x35de4c,_0x41e181[_0xfb0c('0x39')]);var _0x173ca8={'where':_0x35de4c[_0xfb0c('0x33')]};return db[_0xfb0c('0x27')][_0xfb0c('0x3a')](_0x173ca8)[_0xfb0c('0x23')](function(_0x472600){_0x1e8066[_0xfb0c('0x3a')]=_0x472600;if(_0x41e181[_0xfb0c('0x29')][_0xfb0c('0x3b')]){_0x35de4c[_0xfb0c('0x3c')]=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0x35de4c);})['then'](function(_0x1f5ff4){_0x1e8066[_0xfb0c('0x3d')]=_0x1f5ff4;return _0x1e8066;})[_0xfb0c('0x23')](respondWithFilteredResult(_0x3bf5a7,_0x35de4c))[_0xfb0c('0x3e')](handleError(_0x3bf5a7,null));};exports[_0xfb0c('0x3f')]=function(_0x21f00c,_0xa255b5){var _0x4951c5={'raw':!![],'where':{'id':_0x21f00c[_0xfb0c('0x40')]['id']}},_0x491526={};_0x491526[_0xfb0c('0x28')]=_[_0xfb0c('0x41')](db[_0xfb0c('0x27')][_0xfb0c('0x42')]);_0x491526[_0xfb0c('0x29')]=_['keys'](_0x21f00c[_0xfb0c('0x29')]);_0x491526[_0xfb0c('0x2a')]=_['intersection'](_0x491526[_0xfb0c('0x28')],_0x491526[_0xfb0c('0x29')]);_0x4951c5['attributes']=_[_0xfb0c('0x2b')](_0x491526[_0xfb0c('0x28')],qs['fields'](_0x21f00c[_0xfb0c('0x29')]['fields']));_0x4951c5[_0xfb0c('0x2c')]=_0x4951c5[_0xfb0c('0x2c')]['length']?_0x4951c5['attributes']:_0x491526['model'];if(_0x21f00c[_0xfb0c('0x29')][_0xfb0c('0x3b')]){_0x4951c5[_0xfb0c('0x3c')]=[{'all':!![]}];}_0x4951c5=_[_0xfb0c('0x43')]({},_0x4951c5,_0x21f00c['options']);return db['SmsQueue'][_0xfb0c('0x44')](_0x4951c5)[_0xfb0c('0x23')](handleEntityNotFound(_0xa255b5,null))[_0xfb0c('0x23')](respondWithResult(_0xa255b5,null))[_0xfb0c('0x3e')](handleError(_0xa255b5,null));};exports[_0xfb0c('0x45')]=function(_0x179b6f,_0x44b212){return db['SmsQueue'][_0xfb0c('0x45')](_0x179b6f[_0xfb0c('0x46')],{})[_0xfb0c('0x23')](function(_0x33b392){var _0x2ef03f=_0x179b6f[_0xfb0c('0x47')]['get']({'plain':!![]});if(!_0x2ef03f)throw new Error(_0xfb0c('0x48'));if(_0x2ef03f[_0xfb0c('0x49')]===_0xfb0c('0x47')){var _0x375fc4=_0x33b392[_0xfb0c('0x4a')]({'plain':!![]});var _0x409f82='SmsQueues';return db[_0xfb0c('0x4b')][_0xfb0c('0x44')]({'where':{'name':_0x409f82,'userProfileId':_0x2ef03f[_0xfb0c('0x4c')]},'raw':!![]})[_0xfb0c('0x23')](function(_0x58fa5e){if(_0x58fa5e&&_0x58fa5e[_0xfb0c('0x4d')]===0x0){return db[_0xfb0c('0x4e')][_0xfb0c('0x45')]({'name':_0x375fc4[_0xfb0c('0x25')],'resourceId':_0x375fc4['id'],'type':_0x58fa5e[_0xfb0c('0x25')],'sectionId':_0x58fa5e['id']},{})[_0xfb0c('0x23')](function(){return _0x33b392;});}else{return _0x33b392;}})[_0xfb0c('0x3e')](function(_0x311e57){logger[_0xfb0c('0x4f')](_0xfb0c('0x50'),_0x311e57);throw _0x311e57;});}return _0x33b392;})[_0xfb0c('0x23')](respondWithResult(_0x44b212,0xc9))[_0xfb0c('0x3e')](handleError(_0x44b212,null));};exports[_0xfb0c('0x21')]=function(_0x310e4f,_0xd6ce83){if(_0x310e4f[_0xfb0c('0x46')]['id']){delete _0x310e4f['body']['id'];}return db['SmsQueue']['find']({'where':{'id':_0x310e4f[_0xfb0c('0x40')]['id']}})['then'](handleEntityNotFound(_0xd6ce83,null))[_0xfb0c('0x23')](saveUpdates(_0x310e4f['body'],null))['then'](respondWithResult(_0xd6ce83,null))[_0xfb0c('0x3e')](handleError(_0xd6ce83,null));};exports[_0xfb0c('0x22')]=function(_0x3f250d,_0x770609){return db[_0xfb0c('0x27')][_0xfb0c('0x44')]({'where':{'id':_0x3f250d[_0xfb0c('0x40')]['id']}})[_0xfb0c('0x23')](handleEntityNotFound(_0x770609,null))[_0xfb0c('0x23')](removeEntity(_0x770609,null))[_0xfb0c('0x3e')](handleError(_0x770609,null));};exports[_0xfb0c('0x51')]=function(_0xfddd7e,_0x752303){return db['SmsQueue'][_0xfb0c('0x51')]()[_0xfb0c('0x23')](respondWithResult(_0x752303,null))[_0xfb0c('0x3e')](handleError(_0x752303,null));};exports[_0xfb0c('0x52')]=function(_0x1e3d3f,_0x413c3f,_0x5a1f50){var _0x187338={'raw':!![],'where':{}},_0x58895c={},_0x86fcfd;return db['SmsQueue'][_0xfb0c('0x53')]({'where':{'id':_0x1e3d3f[_0xfb0c('0x40')]['id']}})[_0xfb0c('0x23')](handleEntityNotFound(_0x413c3f,null))[_0xfb0c('0x23')](function(_0x4f004c){if(_0x4f004c){_0x86fcfd=_0x4f004c[_0xfb0c('0x4a')]({'plain':!![]});_0x58895c[_0xfb0c('0x28')]=_[_0xfb0c('0x41')](db[_0xfb0c('0x54')][_0xfb0c('0x42')]);_0x58895c[_0xfb0c('0x29')]=_['keys'](_0x1e3d3f[_0xfb0c('0x29')]);_0x58895c[_0xfb0c('0x2a')]=_[_0xfb0c('0x2b')](_0x58895c[_0xfb0c('0x28')],_0x58895c['query']);_0x187338[_0xfb0c('0x2c')]=_['intersection'](_0x58895c[_0xfb0c('0x28')],qs[_0xfb0c('0x2d')](_0x1e3d3f[_0xfb0c('0x29')][_0xfb0c('0x2d')]));_0x187338[_0xfb0c('0x2c')]=_0x187338[_0xfb0c('0x2c')]['length']?_0x187338[_0xfb0c('0x2c')]:_0x58895c['model'];if(!_0x1e3d3f[_0xfb0c('0x29')][_0xfb0c('0x2f')]('nolimit')){_0x187338[_0xfb0c('0x1a')]=qs[_0xfb0c('0x1a')](_0x1e3d3f[_0xfb0c('0x29')][_0xfb0c('0x1a')]);_0x187338[_0xfb0c('0x19')]=qs['offset'](_0x1e3d3f[_0xfb0c('0x29')][_0xfb0c('0x19')]);}_0x187338[_0xfb0c('0x31')]=qs['sort'](_0x1e3d3f[_0xfb0c('0x29')][_0xfb0c('0x32')]);_0x187338['where']=qs[_0xfb0c('0x2a')](_[_0xfb0c('0x34')](_0x1e3d3f['query'],_0x58895c[_0xfb0c('0x2a')]));_0x187338['where']['SmsQueueId']=_0x4f004c['id'];if(_0x1e3d3f['query'][_0xfb0c('0x35')]){_0x187338[_0xfb0c('0x33')]=_['merge'](_0x187338[_0xfb0c('0x33')],{'$or':_[_0xfb0c('0x36')](_0x187338['attributes'],function(_0x33080d){var _0xee7385={};_0xee7385[_0x33080d]={'$like':'%'+_0x1e3d3f[_0xfb0c('0x29')][_0xfb0c('0x35')]+'%'};return _0xee7385;})});}_0x187338=_[_0xfb0c('0x43')]({},_0x187338,_0x1e3d3f[_0xfb0c('0x39')]);return db['UserSmsQueue']['findAll'](_0x187338);}})[_0xfb0c('0x23')](function(_0x172e41){if(_0x172e41){return db[_0xfb0c('0x55')]['findAndCountAll']({'where':{'id':_[_0xfb0c('0x36')](_0x172e41,_0xfb0c('0x56')),'role':'agent'},'attributes':['id',_0xfb0c('0x25'),_0xfb0c('0x57'),_0xfb0c('0x58'),_0xfb0c('0x59')]});}})[_0xfb0c('0x23')](function(_0x4addd8){if(_0x4addd8){return{'count':_0x4addd8[_0xfb0c('0x3a')],'rows':_['map'](_0x4addd8[_0xfb0c('0x3d')],function(_0x5b794e){return{'membername':_0x5b794e['name'],'UserId':_0x5b794e['id'],'queue_name':_0x86fcfd[_0xfb0c('0x25')],'SmsQueueId':_0x86fcfd['id'],'interface':util['format'](_0xfb0c('0x5a'),'SIP',_0x5b794e[_0xfb0c('0x25')]),'penalty':0x0,'paused':_0x5b794e[_0xfb0c('0x57')],'createdAt':_0x5b794e[_0xfb0c('0x59')],'updatedAt':_0x5b794e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x413c3f,_0x187338))[_0xfb0c('0x3e')](handleError(_0x413c3f,null));};exports['getTeams']=function(_0x15b276,_0x1b55bf,_0x4d1df0){var _0x2a4a65={};var _0x38e57c={};var _0x2effc0;var _0x191f9f;return db[_0xfb0c('0x27')][_0xfb0c('0x53')]({'where':{'id':_0x15b276[_0xfb0c('0x40')]['id']}})[_0xfb0c('0x23')](handleEntityNotFound(_0x1b55bf,null))[_0xfb0c('0x23')](function(_0x219384){if(_0x219384){_0x2effc0=_0x219384;_0x38e57c['model']=_[_0xfb0c('0x41')](db[_0xfb0c('0x5b')][_0xfb0c('0x42')]);_0x38e57c[_0xfb0c('0x29')]=_[_0xfb0c('0x41')](_0x15b276[_0xfb0c('0x29')]);_0x38e57c[_0xfb0c('0x2a')]=_[_0xfb0c('0x2b')](_0x38e57c['model'],_0x38e57c['query']);_0x2a4a65[_0xfb0c('0x2c')]=_[_0xfb0c('0x2b')](_0x38e57c['model'],qs[_0xfb0c('0x2d')](_0x15b276['query']['fields']));_0x2a4a65[_0xfb0c('0x2c')]=_0x2a4a65['attributes'][_0xfb0c('0x2e')]?_0x2a4a65[_0xfb0c('0x2c')]:_0x38e57c[_0xfb0c('0x28')];_0x2a4a65[_0xfb0c('0x31')]=qs[_0xfb0c('0x32')](_0x15b276[_0xfb0c('0x29')][_0xfb0c('0x32')]);_0x2a4a65[_0xfb0c('0x33')]=qs['filters'](_[_0xfb0c('0x34')](_0x15b276[_0xfb0c('0x29')],_0x38e57c[_0xfb0c('0x2a')]));if(_0x15b276[_0xfb0c('0x29')][_0xfb0c('0x35')]){_0x2a4a65[_0xfb0c('0x33')]=_[_0xfb0c('0x43')](_0x2a4a65['where'],{'$or':_[_0xfb0c('0x36')](_0x2a4a65[_0xfb0c('0x2c')],function(_0x5bb630){var _0x3db2d0={};_0x3db2d0[_0x5bb630]={'$like':'%'+_0x15b276[_0xfb0c('0x29')][_0xfb0c('0x35')]+'%'};return _0x3db2d0;})});}_0x2a4a65=_[_0xfb0c('0x43')]({},_0x2a4a65,_0x15b276[_0xfb0c('0x39')]);return _0x2effc0[_0xfb0c('0x5c')](_0x2a4a65);}})[_0xfb0c('0x23')](function(_0x565142){if(_0x565142){_0x191f9f=_0x565142[_0xfb0c('0x2e')];if(!_0x15b276[_0xfb0c('0x29')]['hasOwnProperty'](_0xfb0c('0x30'))){_0x2a4a65[_0xfb0c('0x1a')]=qs['limit'](_0x15b276['query'][_0xfb0c('0x1a')]);_0x2a4a65[_0xfb0c('0x19')]=qs['offset'](_0x15b276[_0xfb0c('0x29')][_0xfb0c('0x19')]);}return _0x2effc0['getTeams'](_0x2a4a65);}})[_0xfb0c('0x23')](function(_0x4aa599){if(_0x4aa599){return _0x4aa599?{'count':_0x191f9f,'rows':_0x4aa599}:null;}})['then'](respondWithResult(_0x1b55bf,null))['catch'](handleError(_0x1b55bf,null));};exports[_0xfb0c('0x5d')]=function(_0x22a745,_0x4106d5,_0x81a722){var _0x463af7=_0x22a745['body'][_0xfb0c('0x5e')];return db['Team']['findAll']({'where':{'id':_['map'](_0x463af7,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0xfb0c('0x5f'),_0xfb0c('0x60'),_0xfb0c('0x61')],'raw':!![]}]})[_0xfb0c('0x23')](function(_0x148c96){if(_0x148c96){var _0x22c75d=_['flatMap'](_0x148c96,function(_0x3713a4){var _0x155e5f=_0x3713a4[_0xfb0c('0x4a')]({'plain':!![]});return _0x155e5f[_0xfb0c('0x62')];});return db['SmsQueue'][_0xfb0c('0x44')]({'where':{'id':_0x22a745['params']['id']}})['then'](function(_0x5556f5){return db[_0xfb0c('0x63')][_0xfb0c('0x64')](function(_0x9bef4f){return _0x5556f5['addTeams'](_[_0xfb0c('0x36')](_0x463af7,'id'),{'transaction':_0x9bef4f})['then'](function(){return BPromise['each'](_0x22c75d,function(_0x37bbb2){return db['UserSmsQueue'][_0xfb0c('0x65')]({'where':{'UserId':_0x37bbb2['id'],'SmsQueueId':_0x22a745['params']['id']},'transaction':_0x9bef4f});});})[_0xfb0c('0x23')](function(){_0x22c75d[_0xfb0c('0x66')](function(_0x2466c0){socket[_0xfb0c('0x67')]('userSmsQueue:save',{'UserId':_0x2466c0['id'],'SmsQueueId':_0x5556f5['id']});});});});});}})['then'](respondWithStatusCode(_0x4106d5,null))[_0xfb0c('0x3e')](handleError(_0x4106d5,null));};exports['removeTeams']=function(_0x17d1fb,_0xfc5d3a,_0x13eae8){return db[_0xfb0c('0x5b')]['findAll']({'where':{'id':_0x17d1fb[_0xfb0c('0x29')][_0xfb0c('0x68')]},'attributes':['id'],'include':[{'model':db[_0xfb0c('0x55')],'as':_0xfb0c('0x62'),'attributes':['id'],'raw':!![]}]})[_0xfb0c('0x23')](handleEntityNotFound(_0xfc5d3a,null))['then'](function(_0x1eaeb6){var _0x1ab451=_['map'](_0x1eaeb6,'id');var _0x5df659=[];var _0x5dd6d4=[];var _0x55509c=squel['select']();_0x55509c['field'](_0xfb0c('0x69'))[_0xfb0c('0x6a')](_0xfb0c('0x6b'),'tq')[_0xfb0c('0x6c')](_0xfb0c('0x6d'),'ut',_0xfb0c('0x6e'))[_0xfb0c('0x33')](_0xfb0c('0x6f'),_0x17d1fb[_0xfb0c('0x40')]['id']);for(var _0x1c2314=0x0;_0x1c2314<_0x1eaeb6[_0xfb0c('0x2e')];_0x1c2314+=0x1){let _0x57f56e=_0x1eaeb6[_0x1c2314];for(var _0x53699a=0x0;_0x53699a<_0x57f56e[_0xfb0c('0x62')][_0xfb0c('0x2e')];_0x53699a+=0x1){let _0x5441c8=_0x57f56e[_0xfb0c('0x62')][_0x53699a];var _0x59f185=_0x55509c['clone']();_0x59f185[_0xfb0c('0x33')]('ut.UserId\x20=\x20?',_0x5441c8['id']);_0x5dd6d4[_0xfb0c('0x70')](db[_0xfb0c('0x63')][_0xfb0c('0x29')](_0x59f185['toString'](),{'type':db[_0xfb0c('0x63')]['QueryTypes'][_0xfb0c('0x71')]})['then'](function(_0x3ff468){if(_0x3ff468[_0xfb0c('0x2e')]===0x1){return _0x5441c8['id'];}else{var _0x3024ee=_[_0xfb0c('0x72')](_['map'](_0x3ff468,_0xfb0c('0x73')),function(_0x5b9563){return _[_0xfb0c('0x74')](_0x1ab451,_0x5b9563);});if(_0x3024ee){return _0x5441c8['id'];}}}));}}return BPromise['all'](_0x5dd6d4)[_0xfb0c('0x23')](function(_0x2901d9){_0x5df659=_(_0x5df659)[_0xfb0c('0x75')](_0x2901d9)[_0xfb0c('0x76')]()[_0xfb0c('0x77')]();return db['SmsQueue'][_0xfb0c('0x44')]({'where':{'id':_0x17d1fb[_0xfb0c('0x40')]['id']}})[_0xfb0c('0x23')](function(_0x59da06){return db[_0xfb0c('0x63')][_0xfb0c('0x64')](function(_0xae6d18){return _0x59da06['removeTeams'](_0x17d1fb[_0xfb0c('0x29')][_0xfb0c('0x68')],{'transaction':_0xae6d18})[_0xfb0c('0x23')](function(){if(!_[_0xfb0c('0x78')](_0x5df659)){return _0x59da06[_0xfb0c('0x79')](_0x5df659,{'transaction':_0xae6d18});}})[_0xfb0c('0x23')](function(){_0x5df659[_0xfb0c('0x66')](function(_0x1c280f){socket['emit'](_0xfb0c('0x7a'),{'UserId':_0x1c280f,'SmsQueueId':_0x59da06['id']});});});});});});})[_0xfb0c('0x23')](respondWithStatusCode(_0xfc5d3a,null))[_0xfb0c('0x3e')](handleError(_0xfc5d3a,null));};exports[_0xfb0c('0x7b')]=function(_0x376221,_0x497131,_0xecf9dc){return db['SmsQueue'][_0xfb0c('0x44')]({'where':{'id':_0x376221[_0xfb0c('0x40')]['id']}})[_0xfb0c('0x23')](handleEntityNotFound(_0x497131,null))[_0xfb0c('0x23')](function(_0x1f4b83){if(_0x1f4b83){return _0x1f4b83[_0xfb0c('0x7b')](_0x376221[_0xfb0c('0x46')][_0xfb0c('0x68')],_['omit'](_0x376221['body'],['ids','id'])||{})['spread'](function(_0x2e6abb){for(var _0x539ebd=0x0;_0x539ebd<_0x376221['body']['ids'][_0xfb0c('0x2e')];_0x539ebd+=0x1){socket[_0xfb0c('0x67')](_0xfb0c('0x7c'),{'UserId':_0x376221[_0xfb0c('0x46')][_0xfb0c('0x68')][_0x539ebd],'SmsQueueId':_0x376221['params']['id']});}return _0x2e6abb;});}})['then'](respondWithResult(_0x497131,null))[_0xfb0c('0x3e')](handleError(_0x497131,null));};exports[_0xfb0c('0x79')]=function(_0x4c5a59,_0x12aecd,_0x151d4a){return db[_0xfb0c('0x27')][_0xfb0c('0x44')]({'where':{'id':_0x4c5a59[_0xfb0c('0x40')]['id']}})[_0xfb0c('0x23')](handleEntityNotFound(_0x12aecd,null))['then'](function(_0x18bd75){if(_0x18bd75){return _0x18bd75['removeAgents'](_0x4c5a59['query'][_0xfb0c('0x68')])[_0xfb0c('0x23')](function(){if(_[_0xfb0c('0x7d')](_0x4c5a59[_0xfb0c('0x29')][_0xfb0c('0x68')])){for(var _0x880887=0x0;_0x880887<_0x4c5a59[_0xfb0c('0x29')][_0xfb0c('0x68')][_0xfb0c('0x2e')];_0x880887+=0x1){socket[_0xfb0c('0x67')](_0xfb0c('0x7a'),{'UserId':Number(_0x4c5a59[_0xfb0c('0x29')][_0xfb0c('0x68')][_0x880887]),'SmsQueueId':Number(_0x4c5a59['params']['id'])});}}else{socket['emit'](_0xfb0c('0x7a'),{'UserId':Number(_0x4c5a59[_0xfb0c('0x29')][_0xfb0c('0x68')]),'SmsQueueId':Number(_0x4c5a59[_0xfb0c('0x40')]['id'])});}});}})[_0xfb0c('0x23')](respondWithStatusCode(_0x12aecd,null))[_0xfb0c('0x3e')](handleError(_0x12aecd,null));};exports[_0xfb0c('0x7e')]=function(_0x5b9e33,_0x10d8f3,_0x34bea9){var _0x4f4293={};var _0x3ccc9e={};var _0x7a03b3;var _0x409212;return db['SmsQueue'][_0xfb0c('0x53')]({'where':{'id':_0x5b9e33[_0xfb0c('0x40')]['id']}})[_0xfb0c('0x23')](handleEntityNotFound(_0x10d8f3,null))[_0xfb0c('0x23')](function(_0x401251){if(_0x401251){_0x7a03b3=_0x401251;_0x3ccc9e[_0xfb0c('0x28')]=_['keys'](db['User'][_0xfb0c('0x42')]);_0x3ccc9e[_0xfb0c('0x29')]=_[_0xfb0c('0x41')](_0x5b9e33[_0xfb0c('0x29')]);_0x3ccc9e[_0xfb0c('0x2a')]=_[_0xfb0c('0x2b')](_0x3ccc9e[_0xfb0c('0x28')],_0x3ccc9e[_0xfb0c('0x29')]);_0x4f4293[_0xfb0c('0x2c')]=_[_0xfb0c('0x2b')](_0x3ccc9e[_0xfb0c('0x28')],qs[_0xfb0c('0x2d')](_0x5b9e33[_0xfb0c('0x29')][_0xfb0c('0x2d')]));_0x4f4293['attributes']=_0x4f4293['attributes'][_0xfb0c('0x2e')]?_0x4f4293['attributes']:_0x3ccc9e[_0xfb0c('0x28')];_0x4f4293[_0xfb0c('0x31')]=qs[_0xfb0c('0x32')](_0x5b9e33[_0xfb0c('0x29')][_0xfb0c('0x32')]);_0x4f4293[_0xfb0c('0x33')]=qs[_0xfb0c('0x2a')](_[_0xfb0c('0x34')](_0x5b9e33[_0xfb0c('0x29')],_0x3ccc9e[_0xfb0c('0x2a')]));if(_0x5b9e33[_0xfb0c('0x29')][_0xfb0c('0x35')]){_0x4f4293['where']=_['merge'](_0x4f4293[_0xfb0c('0x33')],{'$or':_[_0xfb0c('0x36')](_0x4f4293['attributes'],function(_0x918501){var _0x2975b1={};_0x2975b1[_0x918501]={'$like':'%'+_0x5b9e33['query'][_0xfb0c('0x35')]+'%'};return _0x2975b1;})});}_0x4f4293=_['merge']({},_0x4f4293,_0x5b9e33[_0xfb0c('0x39')]);return _0x7a03b3[_0xfb0c('0x7e')](_0x4f4293);}})['then'](function(_0x4f0232){if(_0x4f0232){_0x409212=_0x4f0232['length'];if(!_0x5b9e33[_0xfb0c('0x29')][_0xfb0c('0x2f')]('nolimit')){_0x4f4293[_0xfb0c('0x1a')]=qs['limit'](_0x5b9e33[_0xfb0c('0x29')][_0xfb0c('0x1a')]);_0x4f4293[_0xfb0c('0x19')]=qs['offset'](_0x5b9e33[_0xfb0c('0x29')][_0xfb0c('0x19')]);}return _0x7a03b3[_0xfb0c('0x7e')](_0x4f4293);}})['then'](function(_0x4549e2){if(_0x4549e2){return _0x4549e2?{'count':_0x409212,'rows':_0x4549e2}:null;}})[_0xfb0c('0x23')](respondWithResult(_0x10d8f3,null))[_0xfb0c('0x3e')](handleError(_0x10d8f3,null));}; \ No newline at end of file +var _0x3cf6=['json','apply','save','update','then','destroy','SmsQueues','end','error','stack','name','send','SmsQueue','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','map','key','field','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','create','catch','describe','getMembers','findOne','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','format','SIP','createdAt','getTeams','Team','Agents','online','voicePause','interface','flatMap','addTeams','findOrCreate','forEach','userSmsQueue:save','removeTeams','ids','select','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','union','compact','transaction','removeAgents','emit','addAgents','omit','spread','isArray','userSmsQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','./smsQueue.socket','register','sendStatus','status','count','offset','set','Content-Range'];(function(_0x397638,_0x25cdaf){var _0x33adca=function(_0x268995){while(--_0x268995){_0x397638['push'](_0x397638['shift']());}};_0x33adca(++_0x25cdaf);}(_0x3cf6,0x67));var _0x63cf=function(_0x184da3,_0xa8b8e3){_0x184da3=_0x184da3-0x0;var _0x3d529b=_0x3cf6[_0x184da3];return _0x3d529b;};'use strict';var pdf=require(_0x63cf('0x0'));var emlformat=require(_0x63cf('0x1'));var rimraf=require(_0x63cf('0x2'));var zipdir=require(_0x63cf('0x3'));var jsonpatch=require(_0x63cf('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x63cf('0x5'));var path=require(_0x63cf('0x6'));var sox=require('sox');var csv=require(_0x63cf('0x7'));var ejs=require(_0x63cf('0x8'));var fs=require('fs');var _=require(_0x63cf('0x9'));var squel=require(_0x63cf('0xa'));var crypto=require(_0x63cf('0xb'));var jsforce=require(_0x63cf('0xc'));var deskjs=require(_0x63cf('0xd'));var toCsv=require('to-csv');var querystring=require(_0x63cf('0xe'));var Papa=require(_0x63cf('0xf'));var Redis=require(_0x63cf('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x63cf('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x63cf('0x12'))(_0x63cf('0x13'));var utils=require('../../config/utils');var config=require(_0x63cf('0x14'));var db=require(_0x63cf('0x15'))['db'];config['redis']=_[_0x63cf('0x16')](config[_0x63cf('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x63cf('0x17')]));require(_0x63cf('0x18'))[_0x63cf('0x19')](socket);function respondWithStatusCode(_0x59b3f3,_0x18547d){_0x18547d=_0x18547d||0xcc;return function(_0x1ae10b){if(_0x1ae10b){return _0x59b3f3[_0x63cf('0x1a')](_0x18547d);}return _0x59b3f3[_0x63cf('0x1b')](_0x18547d)['end']();};}function respondWithResult(_0x56439c,_0x1d3905){_0x1d3905=_0x1d3905||0xc8;return function(_0x365d19){if(_0x365d19){return _0x56439c['status'](_0x1d3905)['json'](_0x365d19);}};}function respondWithFilteredResult(_0x7f058a,_0x2a5132){return function(_0x1abea0){if(_0x1abea0){var _0x57234d=_0x1abea0[_0x63cf('0x1c')],_0x1e5260=_0x2a5132[_0x63cf('0x1d')],_0x23c1ab=_0x2a5132['offset']+_0x2a5132['limit'],_0x56709f;if(_0x23c1ab>=_0x57234d){_0x23c1ab=_0x57234d;_0x56709f=0xc8;}else{_0x56709f=0xce;}_0x7f058a['status'](_0x56709f);return _0x7f058a[_0x63cf('0x1e')](_0x63cf('0x1f'),_0x1e5260+'-'+_0x23c1ab+'/'+_0x57234d)[_0x63cf('0x20')](_0x1abea0);}return null;};}function patchUpdates(_0x1fce35){return function(_0x57811e){try{jsonpatch[_0x63cf('0x21')](_0x57811e,_0x1fce35,!![]);}catch(_0x4a7a46){return BPromise['reject'](_0x4a7a46);}return _0x57811e[_0x63cf('0x22')]();};}function saveUpdates(_0x413291,_0x14e650){return function(_0x3711a6){if(_0x3711a6){return _0x3711a6[_0x63cf('0x23')](_0x413291)[_0x63cf('0x24')](function(_0x357b0d){return _0x357b0d;});}return null;};}function removeEntity(_0x1db3ee,_0x3927ce){return function(_0x385eff){if(_0x385eff){return _0x385eff[_0x63cf('0x25')]()['then'](function(){var _0x549101=_0x385eff['get']({'plain':!![]});var _0x5c4e90=_0x63cf('0x26');return db['UserProfileResource'][_0x63cf('0x25')]({'where':{'type':_0x5c4e90,'resourceId':_0x549101['id']}})[_0x63cf('0x24')](function(){return _0x385eff;});})['then'](function(){_0x1db3ee['status'](0xcc)[_0x63cf('0x27')]();});}};}function handleEntityNotFound(_0x283522,_0x3115ce){return function(_0x575274){if(!_0x575274){_0x283522[_0x63cf('0x1a')](0x194);}return _0x575274;};}function handleError(_0x36fe6a,_0x47c6b1){_0x47c6b1=_0x47c6b1||0x1f4;return function(_0x1548f2){logger[_0x63cf('0x28')](_0x1548f2[_0x63cf('0x29')]);if(_0x1548f2[_0x63cf('0x2a')]){delete _0x1548f2['name'];}_0x36fe6a[_0x63cf('0x1b')](_0x47c6b1)[_0x63cf('0x2b')](_0x1548f2);};}exports['index']=function(_0x38655b,_0x2b4d7c){var _0x358c07={},_0x387924={},_0x72cfaa={'count':0x0,'rows':[]};var _0x29e42d=db[_0x63cf('0x2c')]['rawAttributes'];_0x387924[_0x63cf('0x2d')]=_['keys'](_0x29e42d);_0x387924[_0x63cf('0x2e')]=_[_0x63cf('0x2f')](_0x38655b[_0x63cf('0x2e')]);_0x387924['filters']=_[_0x63cf('0x30')](_0x387924[_0x63cf('0x2d')],_0x387924[_0x63cf('0x2e')]);_0x358c07[_0x63cf('0x31')]=_[_0x63cf('0x30')](_0x387924[_0x63cf('0x2d')],qs[_0x63cf('0x32')](_0x38655b[_0x63cf('0x2e')][_0x63cf('0x32')]));_0x358c07[_0x63cf('0x31')]=_0x358c07[_0x63cf('0x31')][_0x63cf('0x33')]?_0x358c07[_0x63cf('0x31')]:_0x387924[_0x63cf('0x2d')];if(!_0x38655b[_0x63cf('0x2e')][_0x63cf('0x34')](_0x63cf('0x35'))){_0x358c07[_0x63cf('0x36')]=qs[_0x63cf('0x36')](_0x38655b[_0x63cf('0x2e')][_0x63cf('0x36')]);_0x358c07['offset']=qs['offset'](_0x38655b[_0x63cf('0x2e')]['offset']);}_0x358c07[_0x63cf('0x37')]=qs['sort'](_0x38655b[_0x63cf('0x2e')][_0x63cf('0x38')]);_0x358c07[_0x63cf('0x39')]=qs[_0x63cf('0x3a')](_[_0x63cf('0x3b')](_0x38655b[_0x63cf('0x2e')],_0x387924[_0x63cf('0x3a')]));if(_0x38655b['query']['filter']){_0x358c07[_0x63cf('0x39')]=_[_0x63cf('0x3c')](_0x358c07[_0x63cf('0x39')],{'$or':_[_0x63cf('0x3d')](_0x29e42d,function(_0x38d886){if(_0x38d886['type'][_0x63cf('0x3e')]!=='VIRTUAL'){var _0x228248={};_0x228248[_0x38d886[_0x63cf('0x3f')]]={'$like':'%'+_0x38655b[_0x63cf('0x2e')][_0x63cf('0x40')]+'%'};return _0x228248;}})});}_0x358c07=_[_0x63cf('0x3c')]({},_0x358c07,_0x38655b[_0x63cf('0x41')]);var _0x598445={'where':_0x358c07['where']};return db[_0x63cf('0x2c')][_0x63cf('0x1c')](_0x598445)[_0x63cf('0x24')](function(_0x3da45e){_0x72cfaa[_0x63cf('0x1c')]=_0x3da45e;if(_0x38655b[_0x63cf('0x2e')][_0x63cf('0x42')]){_0x358c07[_0x63cf('0x43')]=[{'all':!![]}];}return db[_0x63cf('0x2c')][_0x63cf('0x44')](_0x358c07);})[_0x63cf('0x24')](function(_0x4c77a0){_0x72cfaa[_0x63cf('0x45')]=_0x4c77a0;return _0x72cfaa;})[_0x63cf('0x24')](respondWithFilteredResult(_0x2b4d7c,_0x358c07))['catch'](handleError(_0x2b4d7c,null));};exports[_0x63cf('0x46')]=function(_0x51a36f,_0x2bc157){var _0xbb3b1b={'raw':!![],'where':{'id':_0x51a36f[_0x63cf('0x47')]['id']}},_0x5f0489={};_0x5f0489[_0x63cf('0x2d')]=_[_0x63cf('0x2f')](db['SmsQueue'][_0x63cf('0x48')]);_0x5f0489[_0x63cf('0x2e')]=_[_0x63cf('0x2f')](_0x51a36f[_0x63cf('0x2e')]);_0x5f0489[_0x63cf('0x3a')]=_[_0x63cf('0x30')](_0x5f0489[_0x63cf('0x2d')],_0x5f0489[_0x63cf('0x2e')]);_0xbb3b1b[_0x63cf('0x31')]=_[_0x63cf('0x30')](_0x5f0489[_0x63cf('0x2d')],qs['fields'](_0x51a36f[_0x63cf('0x2e')]['fields']));_0xbb3b1b[_0x63cf('0x31')]=_0xbb3b1b['attributes'][_0x63cf('0x33')]?_0xbb3b1b[_0x63cf('0x31')]:_0x5f0489[_0x63cf('0x2d')];if(_0x51a36f[_0x63cf('0x2e')][_0x63cf('0x42')]){_0xbb3b1b['include']=[{'all':!![]}];}_0xbb3b1b=_[_0x63cf('0x3c')]({},_0xbb3b1b,_0x51a36f['options']);return db['SmsQueue'][_0x63cf('0x49')](_0xbb3b1b)['then'](handleEntityNotFound(_0x2bc157,null))[_0x63cf('0x24')](respondWithResult(_0x2bc157,null))['catch'](handleError(_0x2bc157,null));};exports['create']=function(_0xe40d19,_0x3505a1){return db[_0x63cf('0x2c')]['create'](_0xe40d19[_0x63cf('0x4a')],{})['then'](function(_0x1397df){var _0x1d6214=_0xe40d19[_0x63cf('0x4b')][_0x63cf('0x4c')]({'plain':!![]});if(!_0x1d6214)throw new Error(_0x63cf('0x4d'));if(_0x1d6214[_0x63cf('0x4e')]===_0x63cf('0x4b')){var _0xcd7f45=_0x1397df['get']({'plain':!![]});var _0x1a33d2=_0x63cf('0x26');return db[_0x63cf('0x4f')][_0x63cf('0x49')]({'where':{'name':_0x1a33d2,'userProfileId':_0x1d6214['userProfileId']},'raw':!![]})['then'](function(_0x56579e){if(_0x56579e&&_0x56579e[_0x63cf('0x50')]===0x0){return db[_0x63cf('0x51')][_0x63cf('0x52')]({'name':_0xcd7f45[_0x63cf('0x2a')],'resourceId':_0xcd7f45['id'],'type':_0x56579e['name'],'sectionId':_0x56579e['id']},{})[_0x63cf('0x24')](function(){return _0x1397df;});}else{return _0x1397df;}})['catch'](function(_0x31567d){logger[_0x63cf('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31567d);throw _0x31567d;});}return _0x1397df;})[_0x63cf('0x24')](respondWithResult(_0x3505a1,0xc9))[_0x63cf('0x53')](handleError(_0x3505a1,null));};exports['update']=function(_0x2c0a4b,_0x42bbaa){if(_0x2c0a4b[_0x63cf('0x4a')]['id']){delete _0x2c0a4b['body']['id'];}return db['SmsQueue'][_0x63cf('0x49')]({'where':{'id':_0x2c0a4b[_0x63cf('0x47')]['id']}})['then'](handleEntityNotFound(_0x42bbaa,null))[_0x63cf('0x24')](saveUpdates(_0x2c0a4b[_0x63cf('0x4a')],null))[_0x63cf('0x24')](respondWithResult(_0x42bbaa,null))['catch'](handleError(_0x42bbaa,null));};exports[_0x63cf('0x25')]=function(_0x4e4c53,_0x30020c){return db['SmsQueue']['find']({'where':{'id':_0x4e4c53['params']['id']}})['then'](handleEntityNotFound(_0x30020c,null))[_0x63cf('0x24')](removeEntity(_0x30020c,null))['catch'](handleError(_0x30020c,null));};exports[_0x63cf('0x54')]=function(_0x478924,_0x26842e){return db[_0x63cf('0x2c')][_0x63cf('0x54')]()[_0x63cf('0x24')](respondWithResult(_0x26842e,null))[_0x63cf('0x53')](handleError(_0x26842e,null));};exports[_0x63cf('0x55')]=function(_0xe6d0da,_0x524a4c,_0x2b8ed3){var _0x4d7e15={'raw':!![],'where':{}},_0x13ed45={},_0x52e135;return db['SmsQueue'][_0x63cf('0x56')]({'where':{'id':_0xe6d0da[_0x63cf('0x47')]['id']}})['then'](handleEntityNotFound(_0x524a4c,null))[_0x63cf('0x24')](function(_0x355bdc){if(_0x355bdc){_0x52e135=_0x355bdc[_0x63cf('0x4c')]({'plain':!![]});_0x13ed45[_0x63cf('0x2d')]=_['keys'](db[_0x63cf('0x57')][_0x63cf('0x48')]);_0x13ed45[_0x63cf('0x2e')]=_[_0x63cf('0x2f')](_0xe6d0da[_0x63cf('0x2e')]);_0x13ed45['filters']=_['intersection'](_0x13ed45['model'],_0x13ed45[_0x63cf('0x2e')]);_0x4d7e15[_0x63cf('0x31')]=_['intersection'](_0x13ed45[_0x63cf('0x2d')],qs[_0x63cf('0x32')](_0xe6d0da[_0x63cf('0x2e')][_0x63cf('0x32')]));_0x4d7e15[_0x63cf('0x31')]=_0x4d7e15['attributes'][_0x63cf('0x33')]?_0x4d7e15[_0x63cf('0x31')]:_0x13ed45[_0x63cf('0x2d')];if(!_0xe6d0da['query'][_0x63cf('0x34')](_0x63cf('0x35'))){_0x4d7e15[_0x63cf('0x36')]=qs['limit'](_0xe6d0da['query']['limit']);_0x4d7e15['offset']=qs[_0x63cf('0x1d')](_0xe6d0da[_0x63cf('0x2e')][_0x63cf('0x1d')]);}_0x4d7e15[_0x63cf('0x37')]=qs['sort'](_0xe6d0da['query'][_0x63cf('0x38')]);_0x4d7e15[_0x63cf('0x39')]=qs[_0x63cf('0x3a')](_[_0x63cf('0x3b')](_0xe6d0da[_0x63cf('0x2e')],_0x13ed45[_0x63cf('0x3a')]));_0x4d7e15[_0x63cf('0x39')]['SmsQueueId']=_0x355bdc['id'];if(_0xe6d0da[_0x63cf('0x2e')]['filter']){_0x4d7e15[_0x63cf('0x39')]=_['merge'](_0x4d7e15[_0x63cf('0x39')],{'$or':_[_0x63cf('0x3d')](_0x4d7e15[_0x63cf('0x31')],function(_0x3e2d24){var _0xa60677={};_0xa60677[_0x3e2d24]={'$like':'%'+_0xe6d0da[_0x63cf('0x2e')][_0x63cf('0x40')]+'%'};return _0xa60677;})});}_0x4d7e15=_[_0x63cf('0x3c')]({},_0x4d7e15,_0xe6d0da[_0x63cf('0x41')]);return db[_0x63cf('0x57')][_0x63cf('0x44')](_0x4d7e15);}})['then'](function(_0x715cf5){if(_0x715cf5){return db[_0x63cf('0x58')][_0x63cf('0x59')]({'where':{'id':_['map'](_0x715cf5,_0x63cf('0x5a')),'role':_0x63cf('0x5b')},'attributes':['id',_0x63cf('0x2a'),_0x63cf('0x5c'),_0x63cf('0x5d'),'createdAt']});}})[_0x63cf('0x24')](function(_0x4e8118){if(_0x4e8118){return{'count':_0x4e8118['count'],'rows':_[_0x63cf('0x3d')](_0x4e8118[_0x63cf('0x45')],function(_0x232d9b){return{'membername':_0x232d9b[_0x63cf('0x2a')],'UserId':_0x232d9b['id'],'queue_name':_0x52e135[_0x63cf('0x2a')],'SmsQueueId':_0x52e135['id'],'interface':util[_0x63cf('0x5e')]('%s/%s',_0x63cf('0x5f'),_0x232d9b[_0x63cf('0x2a')]),'penalty':0x0,'paused':_0x232d9b['smsPause'],'createdAt':_0x232d9b[_0x63cf('0x60')],'updatedAt':_0x232d9b[_0x63cf('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x63cf('0x24')](respondWithFilteredResult(_0x524a4c,_0x4d7e15))[_0x63cf('0x53')](handleError(_0x524a4c,null));};exports[_0x63cf('0x61')]=function(_0x83ebc,_0x49dfda,_0x542e73){var _0x4ca3c2={};var _0x21e14c={};var _0x279ba6;var _0x24242c;return db[_0x63cf('0x2c')][_0x63cf('0x56')]({'where':{'id':_0x83ebc['params']['id']}})[_0x63cf('0x24')](handleEntityNotFound(_0x49dfda,null))[_0x63cf('0x24')](function(_0x35763c){if(_0x35763c){_0x279ba6=_0x35763c;_0x21e14c[_0x63cf('0x2d')]=_[_0x63cf('0x2f')](db[_0x63cf('0x62')][_0x63cf('0x48')]);_0x21e14c[_0x63cf('0x2e')]=_[_0x63cf('0x2f')](_0x83ebc[_0x63cf('0x2e')]);_0x21e14c['filters']=_[_0x63cf('0x30')](_0x21e14c[_0x63cf('0x2d')],_0x21e14c['query']);_0x4ca3c2[_0x63cf('0x31')]=_[_0x63cf('0x30')](_0x21e14c['model'],qs[_0x63cf('0x32')](_0x83ebc[_0x63cf('0x2e')][_0x63cf('0x32')]));_0x4ca3c2['attributes']=_0x4ca3c2[_0x63cf('0x31')][_0x63cf('0x33')]?_0x4ca3c2[_0x63cf('0x31')]:_0x21e14c[_0x63cf('0x2d')];_0x4ca3c2[_0x63cf('0x37')]=qs[_0x63cf('0x38')](_0x83ebc[_0x63cf('0x2e')]['sort']);_0x4ca3c2[_0x63cf('0x39')]=qs[_0x63cf('0x3a')](_[_0x63cf('0x3b')](_0x83ebc[_0x63cf('0x2e')],_0x21e14c[_0x63cf('0x3a')]));if(_0x83ebc[_0x63cf('0x2e')][_0x63cf('0x40')]){_0x4ca3c2[_0x63cf('0x39')]=_[_0x63cf('0x3c')](_0x4ca3c2[_0x63cf('0x39')],{'$or':_[_0x63cf('0x3d')](_0x4ca3c2['attributes'],function(_0x5a8613){var _0x1e09c7={};_0x1e09c7[_0x5a8613]={'$like':'%'+_0x83ebc[_0x63cf('0x2e')][_0x63cf('0x40')]+'%'};return _0x1e09c7;})});}_0x4ca3c2=_[_0x63cf('0x3c')]({},_0x4ca3c2,_0x83ebc[_0x63cf('0x41')]);return _0x279ba6[_0x63cf('0x61')](_0x4ca3c2);}})[_0x63cf('0x24')](function(_0x151681){if(_0x151681){_0x24242c=_0x151681['length'];if(!_0x83ebc[_0x63cf('0x2e')]['hasOwnProperty']('nolimit')){_0x4ca3c2[_0x63cf('0x36')]=qs[_0x63cf('0x36')](_0x83ebc[_0x63cf('0x2e')]['limit']);_0x4ca3c2[_0x63cf('0x1d')]=qs[_0x63cf('0x1d')](_0x83ebc['query']['offset']);}return _0x279ba6['getTeams'](_0x4ca3c2);}})[_0x63cf('0x24')](function(_0x2b8200){if(_0x2b8200){return _0x2b8200?{'count':_0x24242c,'rows':_0x2b8200}:null;}})[_0x63cf('0x24')](respondWithResult(_0x49dfda,null))[_0x63cf('0x53')](handleError(_0x49dfda,null));};exports['addTeams']=function(_0x57d9e7,_0xabca56,_0x2daedf){var _0xd63b2f=_0x57d9e7[_0x63cf('0x4a')]['teams'];return db[_0x63cf('0x62')][_0x63cf('0x44')]({'where':{'id':_['map'](_0xd63b2f,'id')},'attributes':['id'],'include':[{'model':db[_0x63cf('0x58')],'as':_0x63cf('0x63'),'attributes':['id','name',_0x63cf('0x64'),_0x63cf('0x65'),_0x63cf('0x66')],'raw':!![]}]})[_0x63cf('0x24')](function(_0x291f12){if(_0x291f12){var _0x45d527=_[_0x63cf('0x67')](_0x291f12,function(_0x45498c){var _0x157e6d=_0x45498c[_0x63cf('0x4c')]({'plain':!![]});return _0x157e6d[_0x63cf('0x63')];});return db[_0x63cf('0x2c')][_0x63cf('0x49')]({'where':{'id':_0x57d9e7[_0x63cf('0x47')]['id']}})['then'](function(_0x34560e){return db['sequelize']['transaction'](function(_0xde12){return _0x34560e[_0x63cf('0x68')](_[_0x63cf('0x3d')](_0xd63b2f,'id'),{'transaction':_0xde12})[_0x63cf('0x24')](function(){return BPromise['each'](_0x45d527,function(_0x254487){return db[_0x63cf('0x57')][_0x63cf('0x69')]({'where':{'UserId':_0x254487['id'],'SmsQueueId':_0x57d9e7['params']['id']},'transaction':_0xde12});});})[_0x63cf('0x24')](function(){_0x45d527[_0x63cf('0x6a')](function(_0x4b3644){socket['emit'](_0x63cf('0x6b'),{'UserId':_0x4b3644['id'],'SmsQueueId':_0x34560e['id']});});});});});}})[_0x63cf('0x24')](respondWithStatusCode(_0xabca56,null))[_0x63cf('0x53')](handleError(_0xabca56,null));};exports[_0x63cf('0x6c')]=function(_0x1f223f,_0x32923e,_0x14f846){return db['Team'][_0x63cf('0x44')]({'where':{'id':_0x1f223f[_0x63cf('0x2e')][_0x63cf('0x6d')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x63cf('0x63'),'attributes':['id'],'raw':!![]}]})[_0x63cf('0x24')](handleEntityNotFound(_0x32923e,null))[_0x63cf('0x24')](function(_0x34069f){var _0x3b5397=_[_0x63cf('0x3d')](_0x34069f,'id');var _0xe802c2=[];var _0x3a4239=[];var _0x2bbdfe=squel[_0x63cf('0x6e')]();_0x2bbdfe[_0x63cf('0x3f')]('tq.TeamId')[_0x63cf('0x6f')](_0x63cf('0x70'),'tq')['join'](_0x63cf('0x71'),'ut',_0x63cf('0x72'))[_0x63cf('0x39')](_0x63cf('0x73'),_0x1f223f[_0x63cf('0x47')]['id']);for(var _0x5c51a7=0x0;_0x5c51a7<_0x34069f[_0x63cf('0x33')];_0x5c51a7+=0x1){let _0x33afee=_0x34069f[_0x5c51a7];for(var _0x5e7fd2=0x0;_0x5e7fd2<_0x33afee[_0x63cf('0x63')][_0x63cf('0x33')];_0x5e7fd2+=0x1){let _0x3eeedf=_0x33afee[_0x63cf('0x63')][_0x5e7fd2];var _0x56d352=_0x2bbdfe[_0x63cf('0x74')]();_0x56d352[_0x63cf('0x39')](_0x63cf('0x75'),_0x3eeedf['id']);_0x3a4239[_0x63cf('0x76')](db[_0x63cf('0x77')][_0x63cf('0x2e')](_0x56d352[_0x63cf('0x78')](),{'type':db['sequelize'][_0x63cf('0x79')]['SELECT']})[_0x63cf('0x24')](function(_0x155c3c){if(_0x155c3c[_0x63cf('0x33')]===0x1){return _0x3eeedf['id'];}else{var _0x1ac4af=_[_0x63cf('0x7a')](_[_0x63cf('0x3d')](_0x155c3c,_0x63cf('0x7b')),function(_0x178f7b){return _['includes'](_0x3b5397,_0x178f7b);});if(_0x1ac4af){return _0x3eeedf['id'];}}}));}}return BPromise['all'](_0x3a4239)[_0x63cf('0x24')](function(_0x5b0344){_0xe802c2=_(_0xe802c2)[_0x63cf('0x7c')](_0x5b0344)[_0x63cf('0x7d')]()['value']();return db[_0x63cf('0x2c')][_0x63cf('0x49')]({'where':{'id':_0x1f223f['params']['id']}})['then'](function(_0x5a7189){return db[_0x63cf('0x77')][_0x63cf('0x7e')](function(_0x1453ce){return _0x5a7189[_0x63cf('0x6c')](_0x1f223f['query'][_0x63cf('0x6d')],{'transaction':_0x1453ce})['then'](function(){if(!_['isEmpty'](_0xe802c2)){return _0x5a7189[_0x63cf('0x7f')](_0xe802c2,{'transaction':_0x1453ce});}})[_0x63cf('0x24')](function(){_0xe802c2[_0x63cf('0x6a')](function(_0x563554){socket[_0x63cf('0x80')]('userSmsQueue:remove',{'UserId':_0x563554,'SmsQueueId':_0x5a7189['id']});});});});});});})[_0x63cf('0x24')](respondWithStatusCode(_0x32923e,null))[_0x63cf('0x53')](handleError(_0x32923e,null));};exports[_0x63cf('0x81')]=function(_0x230bc8,_0x324e59,_0x4a3a18){return db[_0x63cf('0x2c')]['find']({'where':{'id':_0x230bc8['params']['id']}})[_0x63cf('0x24')](handleEntityNotFound(_0x324e59,null))[_0x63cf('0x24')](function(_0x53f7b0){if(_0x53f7b0){return _0x53f7b0[_0x63cf('0x81')](_0x230bc8[_0x63cf('0x4a')][_0x63cf('0x6d')],_[_0x63cf('0x82')](_0x230bc8[_0x63cf('0x4a')],[_0x63cf('0x6d'),'id'])||{})[_0x63cf('0x83')](function(_0x396594){for(var _0x5b37d9=0x0;_0x5b37d9<_0x230bc8[_0x63cf('0x4a')][_0x63cf('0x6d')][_0x63cf('0x33')];_0x5b37d9+=0x1){socket[_0x63cf('0x80')](_0x63cf('0x6b'),{'UserId':_0x230bc8[_0x63cf('0x4a')][_0x63cf('0x6d')][_0x5b37d9],'SmsQueueId':_0x230bc8[_0x63cf('0x47')]['id']});}return _0x396594;});}})['then'](respondWithResult(_0x324e59,null))['catch'](handleError(_0x324e59,null));};exports['removeAgents']=function(_0x15b53b,_0x42bb69,_0x1f1b0d){return db[_0x63cf('0x2c')]['find']({'where':{'id':_0x15b53b[_0x63cf('0x47')]['id']}})['then'](handleEntityNotFound(_0x42bb69,null))[_0x63cf('0x24')](function(_0x1ee217){if(_0x1ee217){return _0x1ee217[_0x63cf('0x7f')](_0x15b53b['query'][_0x63cf('0x6d')])[_0x63cf('0x24')](function(){if(_[_0x63cf('0x84')](_0x15b53b[_0x63cf('0x2e')][_0x63cf('0x6d')])){for(var _0x2f08b8=0x0;_0x2f08b8<_0x15b53b[_0x63cf('0x2e')]['ids'][_0x63cf('0x33')];_0x2f08b8+=0x1){socket[_0x63cf('0x80')]('userSmsQueue:remove',{'UserId':Number(_0x15b53b['query'][_0x63cf('0x6d')][_0x2f08b8]),'SmsQueueId':Number(_0x15b53b[_0x63cf('0x47')]['id'])});}}else{socket[_0x63cf('0x80')](_0x63cf('0x85'),{'UserId':Number(_0x15b53b[_0x63cf('0x2e')][_0x63cf('0x6d')]),'SmsQueueId':Number(_0x15b53b['params']['id'])});}});}})[_0x63cf('0x24')](respondWithStatusCode(_0x42bb69,null))[_0x63cf('0x53')](handleError(_0x42bb69,null));};exports['getAgents']=function(_0xbde5e9,_0x185418,_0x5ace16){var _0x5501bd={};var _0x44df9f={};var _0x12a6b8;var _0x196db0;return db[_0x63cf('0x2c')]['findOne']({'where':{'id':_0xbde5e9[_0x63cf('0x47')]['id']}})[_0x63cf('0x24')](handleEntityNotFound(_0x185418,null))[_0x63cf('0x24')](function(_0x50090a){if(_0x50090a){_0x12a6b8=_0x50090a;_0x44df9f['model']=_[_0x63cf('0x2f')](db[_0x63cf('0x58')][_0x63cf('0x48')]);_0x44df9f['query']=_[_0x63cf('0x2f')](_0xbde5e9[_0x63cf('0x2e')]);_0x44df9f[_0x63cf('0x3a')]=_['intersection'](_0x44df9f['model'],_0x44df9f[_0x63cf('0x2e')]);_0x5501bd[_0x63cf('0x31')]=_[_0x63cf('0x30')](_0x44df9f[_0x63cf('0x2d')],qs['fields'](_0xbde5e9[_0x63cf('0x2e')][_0x63cf('0x32')]));_0x5501bd[_0x63cf('0x31')]=_0x5501bd[_0x63cf('0x31')][_0x63cf('0x33')]?_0x5501bd[_0x63cf('0x31')]:_0x44df9f['model'];_0x5501bd['order']=qs[_0x63cf('0x38')](_0xbde5e9[_0x63cf('0x2e')]['sort']);_0x5501bd[_0x63cf('0x39')]=qs[_0x63cf('0x3a')](_['pick'](_0xbde5e9[_0x63cf('0x2e')],_0x44df9f[_0x63cf('0x3a')]));if(_0xbde5e9['query']['filter']){_0x5501bd['where']=_['merge'](_0x5501bd[_0x63cf('0x39')],{'$or':_[_0x63cf('0x3d')](_0x5501bd[_0x63cf('0x31')],function(_0x1f997a){var _0xa0a049={};_0xa0a049[_0x1f997a]={'$like':'%'+_0xbde5e9[_0x63cf('0x2e')]['filter']+'%'};return _0xa0a049;})});}_0x5501bd=_[_0x63cf('0x3c')]({},_0x5501bd,_0xbde5e9['options']);return _0x12a6b8[_0x63cf('0x86')](_0x5501bd);}})[_0x63cf('0x24')](function(_0x320dfc){if(_0x320dfc){_0x196db0=_0x320dfc[_0x63cf('0x33')];if(!_0xbde5e9['query'][_0x63cf('0x34')](_0x63cf('0x35'))){_0x5501bd[_0x63cf('0x36')]=qs[_0x63cf('0x36')](_0xbde5e9[_0x63cf('0x2e')][_0x63cf('0x36')]);_0x5501bd['offset']=qs[_0x63cf('0x1d')](_0xbde5e9[_0x63cf('0x2e')][_0x63cf('0x1d')]);}return _0x12a6b8[_0x63cf('0x86')](_0x5501bd);}})[_0x63cf('0x24')](function(_0x459689){if(_0x459689){return _0x459689?{'count':_0x196db0,'rows':_0x459689}:null;}})['then'](respondWithResult(_0x185418,null))['catch'](handleError(_0x185418,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 88bbd24..d6dc55f 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 _0xbe55=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsQueue'];(function(_0x50da65,_0x1af472){var _0x21d57e=function(_0x5e62a0){while(--_0x5e62a0){_0x50da65['push'](_0x50da65['shift']());}};_0x21d57e(++_0x1af472);}(_0xbe55,0x6a));var _0x5be5=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xbe55[_0x397e5f];return _0x5302b8;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x5be5('0x0'))['db'][_0x5be5('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x5be5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5be5('0x3'),'afterDestroy':_0x5be5('0x4')};function emitEvent(_0x574bab){return function(_0x1afe08,_0x186f9b,_0x13c35e){SmsQueueEvents['emit'](_0x574bab+':'+_0x1afe08['id'],_0x1afe08);SmsQueueEvents[_0x5be5('0x5')](_0x574bab,_0x1afe08);_0x13c35e(null);};}for(var e in events){if(events[_0x5be5('0x6')](e)){var event=events[e];SmsQueue[_0x5be5('0x7')](e,emitEvent(event));}}module[_0x5be5('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x337e=['SmsQueue','setMaxListeners','save','remove','emit','hook','events','../../mysqldb'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x337e,0xc6));var _0xe337=function(_0x16033a,_0x244a3e){_0x16033a=_0x16033a-0x0;var _0x43a163=_0x337e[_0x16033a];return _0x43a163;};'use strict';var EventEmitter=require(_0xe337('0x0'));var SmsQueue=require(_0xe337('0x1'))['db'][_0xe337('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xe337('0x3')](0x0);var events={'afterCreate':_0xe337('0x4'),'afterUpdate':'update','afterDestroy':_0xe337('0x5')};function emitEvent(_0x1ef290){return function(_0x14d70f,_0x4b7789,_0x43d596){SmsQueueEvents[_0xe337('0x6')](_0x1ef290+':'+_0x14d70f['id'],_0x14d70f);SmsQueueEvents['emit'](_0x1ef290,_0x14d70f);_0x43d596(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xe337('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 f98541b..29b7f08 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 _0x1dcc=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','define','sms_queues'];(function(_0x8761f,_0x32dc89){var _0x3b373c=function(_0x17f95e){while(--_0x17f95e){_0x8761f['push'](_0x8761f['shift']());}};_0x3b373c(++_0x32dc89);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x14bba8,_0x5c2d47){_0x14bba8=_0x14bba8-0x0;var _0x22aaa0=_0x1dcc[_0x14bba8];return _0x22aaa0;};'use strict';var _=require(_0xc1dc('0x0'));var util=require(_0xc1dc('0x1'));var logger=require(_0xc1dc('0x2'))(_0xc1dc('0x3'));var moment=require('moment');var BPromise=require(_0xc1dc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc1dc('0x5'));var rimraf=require(_0xc1dc('0x6'));var config=require(_0xc1dc('0x7'));var attributes=require('./smsQueue.attributes');module['exports']=function(_0x1e57ba,_0x381ab6){return _0x1e57ba[_0xc1dc('0x8')]('SmsQueue',attributes,{'tableName':_0xc1dc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4c7=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','define','sms_queues','lodash','util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x80c735,_0x2e9fd4){_0x80c735=_0x80c735-0x0;var _0xd5b200=_0xb4c7[_0x80c735];return _0xd5b200;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var logger=require(_0x7b4c('0x2'))(_0x7b4c('0x3'));var moment=require(_0x7b4c('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b4c('0x5'));var fs=require('fs');var path=require(_0x7b4c('0x6'));var rimraf=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var attributes=require(_0x7b4c('0x9'));module['exports']=function(_0x1b0f57,_0x10e197){return _0x1b0f57[_0x7b4c('0xa')]('SmsQueue',attributes,{'tableName':_0x7b4c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 7650a09..7dd3128 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 _0x957f=['stringify','error','code','message','request\x20sent','result','catch','GetSmsQueue','options','where','attributes','limit','map','model','include','then','SmsQueue','find','raw','ShowSmsQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','debug'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x957f,0x1ed));var _0xf957=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0x957f[_0x251d9c];return _0x16ae64;};'use strict';var _=require(_0xf957('0x0'));var util=require('util');var moment=require(_0xf957('0x1'));var BPromise=require(_0xf957('0x2'));var rs=require(_0xf957('0x3'));var fs=require('fs');var Redis=require(_0xf957('0x4'));var db=require(_0xf957('0x5'))['db'];var utils=require(_0xf957('0x6'));var logger=require(_0xf957('0x7'))(_0xf957('0x8'));var config=require(_0xf957('0x9'));var jayson=require(_0xf957('0xa'));var client=jayson[_0xf957('0xb')][_0xf957('0xc')]({'port':0x232a});config[_0xf957('0xd')]=_[_0xf957('0xe')](config['redis'],{'host':_0xf957('0xf'),'port':0x18eb});var socket=require(_0xf957('0x10'))(new Redis(config[_0xf957('0xd')]));require(_0xf957('0x11'))[_0xf957('0x12')](socket);function respondWithRpcPromise(_0x1715db,_0x40c732,_0x5d9719){return new BPromise(function(_0x50f6bc,_0x288a79){return client[_0xf957('0x13')](_0x1715db,_0x5d9719)['then'](function(_0x3aedad){logger[_0xf957('0x14')](_0xf957('0x15'),_0x40c732,'request\x20sent');logger[_0xf957('0x16')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x40c732,'request\x20sent',JSON[_0xf957('0x17')](_0x3aedad));if(_0x3aedad['error']){if(_0x3aedad[_0xf957('0x18')][_0xf957('0x19')]===0x1f4){logger[_0xf957('0x18')]('SmsQueue,\x20%s,\x20%s',_0x40c732,_0x3aedad['error']['message']);return _0x288a79(_0x3aedad[_0xf957('0x18')][_0xf957('0x1a')]);}logger[_0xf957('0x18')](_0xf957('0x15'),_0x40c732,_0x3aedad['error']['message']);return _0x50f6bc(_0x3aedad[_0xf957('0x18')][_0xf957('0x1a')]);}else{logger['info']('SmsQueue,\x20%s,\x20%s',_0x40c732,_0xf957('0x1b'));_0x50f6bc(_0x3aedad[_0xf957('0x1c')][_0xf957('0x1a')]);}})[_0xf957('0x1d')](function(_0x35920e){logger[_0xf957('0x18')](_0xf957('0x15'),_0x40c732,_0x35920e);_0x288a79(_0x35920e);});});}exports[_0xf957('0x1e')]=function(_0x7ce950){var _0x2e074e=this;return new Promise(function(_0x4081aa,_0x4ce3eb){return db['SmsQueue']['findAll']({'raw':_0x7ce950['options']?_0x7ce950[_0xf957('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x7ce950[_0xf957('0x1f')]?_0x7ce950[_0xf957('0x1f')][_0xf957('0x20')]||null:null,'attributes':_0x7ce950[_0xf957('0x1f')]?_0x7ce950[_0xf957('0x1f')][_0xf957('0x21')]||null:null,'limit':_0x7ce950[_0xf957('0x1f')]?_0x7ce950[_0xf957('0x1f')][_0xf957('0x22')]||null:null,'include':_0x7ce950['options']?_0x7ce950[_0xf957('0x1f')]['include']?_[_0xf957('0x23')](_0x7ce950[_0xf957('0x1f')]['include'],function(_0x149b8c){return{'model':db[_0x149b8c[_0xf957('0x24')]],'as':_0x149b8c['as'],'attributes':_0x149b8c[_0xf957('0x21')],'include':_0x149b8c[_0xf957('0x25')]?_[_0xf957('0x23')](_0x149b8c[_0xf957('0x25')],function(_0x4adbf5){return{'model':db[_0x4adbf5[_0xf957('0x24')]],'as':_0x4adbf5['as'],'attributes':_0x4adbf5[_0xf957('0x21')],'include':_0x4adbf5['include']?_[_0xf957('0x23')](_0x4adbf5[_0xf957('0x25')],function(_0x37942e){return{'model':db[_0x37942e[_0xf957('0x24')]],'as':_0x37942e['as'],'attributes':_0x37942e[_0xf957('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf957('0x26')](function(_0xf14419){logger[_0xf957('0x14')](_0xf957('0x1e'),_0x7ce950);logger['debug'](_0xf957('0x1e'),_0x7ce950,JSON[_0xf957('0x17')](_0xf14419));_0x4081aa(_0xf14419);})[_0xf957('0x1d')](function(_0x24e5dc){logger[_0xf957('0x18')](_0xf957('0x1e'),_0x24e5dc['message'],_0x7ce950);_0x4ce3eb(_0x2e074e[_0xf957('0x18')](0x1f4,_0x24e5dc['message']));});});};exports['ShowSmsQueue']=function(_0x50701b){var _0x4b86ab=this;return new Promise(function(_0x5f1657,_0x565672){return db[_0xf957('0x27')][_0xf957('0x28')]({'raw':_0x50701b['options']?_0x50701b[_0xf957('0x1f')][_0xf957('0x29')]===undefined?!![]:![]:!![],'where':_0x50701b[_0xf957('0x1f')]?_0x50701b[_0xf957('0x1f')][_0xf957('0x20')]||null:null,'attributes':_0x50701b[_0xf957('0x1f')]?_0x50701b['options'][_0xf957('0x21')]||null:null,'include':_0x50701b['options']?_0x50701b['options']['include']?_[_0xf957('0x23')](_0x50701b['options']['include'],function(_0x1fe1d9){return{'model':db[_0x1fe1d9[_0xf957('0x24')]],'as':_0x1fe1d9['as'],'attributes':_0x1fe1d9['attributes'],'include':_0x1fe1d9['include']?_[_0xf957('0x23')](_0x1fe1d9[_0xf957('0x25')],function(_0x572bbb){return{'model':db[_0x572bbb[_0xf957('0x24')]],'as':_0x572bbb['as'],'attributes':_0x572bbb[_0xf957('0x21')],'include':_0x572bbb[_0xf957('0x25')]?_[_0xf957('0x23')](_0x572bbb['include'],function(_0x130b49){return{'model':db[_0x130b49[_0xf957('0x24')]],'as':_0x130b49['as'],'attributes':_0x130b49[_0xf957('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf957('0x26')](function(_0x3e8cdf){logger['info'](_0xf957('0x2a'),_0x50701b);logger[_0xf957('0x16')](_0xf957('0x2a'),_0x50701b,JSON['stringify'](_0x3e8cdf));_0x5f1657(_0x3e8cdf);})[_0xf957('0x1d')](function(_0x2b8097){logger[_0xf957('0x18')]('ShowSmsQueue',_0x2b8097[_0xf957('0x1a')],_0x50701b);_0x565672(_0x4b86ab[_0xf957('0x18')](0x1f4,_0x2b8097[_0xf957('0x1a')]));});});}; \ No newline at end of file +var _0xf7df=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetSmsQueue','SmsQueue','options','raw','where','attributes','limit','include','map','model','debug','stringify','catch','find','ShowSmsQueue','lodash','moment','bluebird'];(function(_0x11ca63,_0xea9f9c){var _0x41f1f6=function(_0xb80b69){while(--_0xb80b69){_0x11ca63['push'](_0x11ca63['shift']());}};_0x41f1f6(++_0xea9f9c);}(_0xf7df,0x10e));var _0xff7d=function(_0x2d8b71,_0x4c4b1a){_0x2d8b71=_0x2d8b71-0x0;var _0x244661=_0xf7df[_0x2d8b71];return _0x244661;};'use strict';var _=require(_0xff7d('0x0'));var util=require('util');var moment=require(_0xff7d('0x1'));var BPromise=require(_0xff7d('0x2'));var rs=require(_0xff7d('0x3'));var fs=require('fs');var Redis=require(_0xff7d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xff7d('0x5'));var logger=require('../../config/logger')(_0xff7d('0x6'));var config=require(_0xff7d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xff7d('0x8')]['http']({'port':0x232a});config['redis']=_[_0xff7d('0x9')](config[_0xff7d('0xa')],{'host':_0xff7d('0xb'),'port':0x18eb});var socket=require(_0xff7d('0xc'))(new Redis(config[_0xff7d('0xa')]));require(_0xff7d('0xd'))['register'](socket);function respondWithRpcPromise(_0x2193f7,_0x111c0f,_0x43df23){return new BPromise(function(_0x38208a,_0x209099){return client[_0xff7d('0xe')](_0x2193f7,_0x43df23)[_0xff7d('0xf')](function(_0x43faa8){logger[_0xff7d('0x10')](_0xff7d('0x11'),_0x111c0f,_0xff7d('0x12'));logger['debug'](_0xff7d('0x13'),_0x111c0f,_0xff7d('0x12'),JSON['stringify'](_0x43faa8));if(_0x43faa8[_0xff7d('0x14')]){if(_0x43faa8[_0xff7d('0x14')][_0xff7d('0x15')]===0x1f4){logger[_0xff7d('0x14')](_0xff7d('0x11'),_0x111c0f,_0x43faa8[_0xff7d('0x14')]['message']);return _0x209099(_0x43faa8[_0xff7d('0x14')][_0xff7d('0x16')]);}logger[_0xff7d('0x14')](_0xff7d('0x11'),_0x111c0f,_0x43faa8[_0xff7d('0x14')][_0xff7d('0x16')]);return _0x38208a(_0x43faa8[_0xff7d('0x14')][_0xff7d('0x16')]);}else{logger[_0xff7d('0x10')]('SmsQueue,\x20%s,\x20%s',_0x111c0f,_0xff7d('0x12'));_0x38208a(_0x43faa8[_0xff7d('0x17')][_0xff7d('0x16')]);}})['catch'](function(_0xc918e5){logger[_0xff7d('0x14')](_0xff7d('0x11'),_0x111c0f,_0xc918e5);_0x209099(_0xc918e5);});});}exports[_0xff7d('0x18')]=function(_0x46333b){var _0x266581=this;return new Promise(function(_0x2952c0,_0x17f3e5){return db[_0xff7d('0x19')]['findAll']({'raw':_0x46333b[_0xff7d('0x1a')]?_0x46333b[_0xff7d('0x1a')][_0xff7d('0x1b')]===undefined?!![]:![]:!![],'where':_0x46333b['options']?_0x46333b[_0xff7d('0x1a')][_0xff7d('0x1c')]||null:null,'attributes':_0x46333b[_0xff7d('0x1a')]?_0x46333b['options'][_0xff7d('0x1d')]||null:null,'limit':_0x46333b[_0xff7d('0x1a')]?_0x46333b[_0xff7d('0x1a')][_0xff7d('0x1e')]||null:null,'include':_0x46333b[_0xff7d('0x1a')]?_0x46333b[_0xff7d('0x1a')][_0xff7d('0x1f')]?_[_0xff7d('0x20')](_0x46333b['options'][_0xff7d('0x1f')],function(_0x2e08d5){return{'model':db[_0x2e08d5[_0xff7d('0x21')]],'as':_0x2e08d5['as'],'attributes':_0x2e08d5['attributes'],'include':_0x2e08d5['include']?_['map'](_0x2e08d5[_0xff7d('0x1f')],function(_0x57eaf9){return{'model':db[_0x57eaf9['model']],'as':_0x57eaf9['as'],'attributes':_0x57eaf9['attributes'],'include':_0x57eaf9[_0xff7d('0x1f')]?_[_0xff7d('0x20')](_0x57eaf9[_0xff7d('0x1f')],function(_0x479184){return{'model':db[_0x479184['model']],'as':_0x479184['as'],'attributes':_0x479184[_0xff7d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xff7d('0xf')](function(_0x4a46db){logger['info']('GetSmsQueue',_0x46333b);logger[_0xff7d('0x22')](_0xff7d('0x18'),_0x46333b,JSON[_0xff7d('0x23')](_0x4a46db));_0x2952c0(_0x4a46db);})[_0xff7d('0x24')](function(_0x39ccde){logger[_0xff7d('0x14')](_0xff7d('0x18'),_0x39ccde[_0xff7d('0x16')],_0x46333b);_0x17f3e5(_0x266581['error'](0x1f4,_0x39ccde[_0xff7d('0x16')]));});});};exports['ShowSmsQueue']=function(_0xb1dd88){var _0x279866=this;return new Promise(function(_0xbb6765,_0x549d1e){return db['SmsQueue'][_0xff7d('0x25')]({'raw':_0xb1dd88[_0xff7d('0x1a')]?_0xb1dd88[_0xff7d('0x1a')][_0xff7d('0x1b')]===undefined?!![]:![]:!![],'where':_0xb1dd88[_0xff7d('0x1a')]?_0xb1dd88[_0xff7d('0x1a')][_0xff7d('0x1c')]||null:null,'attributes':_0xb1dd88[_0xff7d('0x1a')]?_0xb1dd88[_0xff7d('0x1a')][_0xff7d('0x1d')]||null:null,'include':_0xb1dd88['options']?_0xb1dd88[_0xff7d('0x1a')][_0xff7d('0x1f')]?_[_0xff7d('0x20')](_0xb1dd88['options'][_0xff7d('0x1f')],function(_0x24752b){return{'model':db[_0x24752b['model']],'as':_0x24752b['as'],'attributes':_0x24752b[_0xff7d('0x1d')],'include':_0x24752b[_0xff7d('0x1f')]?_['map'](_0x24752b[_0xff7d('0x1f')],function(_0x114508){return{'model':db[_0x114508[_0xff7d('0x21')]],'as':_0x114508['as'],'attributes':_0x114508['attributes'],'include':_0x114508['include']?_[_0xff7d('0x20')](_0x114508[_0xff7d('0x1f')],function(_0x272bcb){return{'model':db[_0x272bcb[_0xff7d('0x21')]],'as':_0x272bcb['as'],'attributes':_0x272bcb[_0xff7d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xff7d('0xf')](function(_0xb8f3e){logger[_0xff7d('0x10')](_0xff7d('0x26'),_0xb1dd88);logger['debug'](_0xff7d('0x26'),_0xb1dd88,JSON[_0xff7d('0x23')](_0xb8f3e));_0xbb6765(_0xb8f3e);})[_0xff7d('0x24')](function(_0x1c6660){logger['error'](_0xff7d('0x26'),_0x1c6660[_0xff7d('0x16')],_0xb1dd88);_0x549d1e(_0x279866[_0xff7d('0x14')](0x1f4,_0x1c6660[_0xff7d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 49641bd..da642c1 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 _0xf3a7=['remove','update','emit','removeListener','length','smsQueue:','save'];(function(_0x1d4597,_0x413ae1){var _0x15c416=function(_0xc43698){while(--_0xc43698){_0x1d4597['push'](_0x1d4597['shift']());}};_0x15c416(++_0x413ae1);}(_0xf3a7,0x99));var _0x7f3a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf3a7[_0x321bb2];return _0x9c12ed;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x7f3a('0x0'),_0x7f3a('0x1'),_0x7f3a('0x2')];function createListener(_0x39a84c,_0x18148c){return function(_0x8ff33d){_0x18148c[_0x7f3a('0x3')](_0x39a84c,_0x8ff33d);};}function removeListener(_0x332a7a,_0x25cdee){return function(){SmsQueueEvents[_0x7f3a('0x4')](_0x332a7a,_0x25cdee);};}exports['register']=function(_0x44f952){for(var _0x2d86c1=0x0,_0x2a7d66=events[_0x7f3a('0x5')];_0x2d86c1<_0x2a7d66;_0x2d86c1++){var _0x1dd804=events[_0x2d86c1];var _0x36beee=createListener(_0x7f3a('0x6')+_0x1dd804,_0x44f952);SmsQueueEvents['on'](_0x1dd804,_0x36beee);}}; \ No newline at end of file +var _0x6e6f=['emit','removeListener','length','smsQueue:','save','remove'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x6e6f,0x76));var _0xf6e6=function(_0x24563c,_0x49d7cd){_0x24563c=_0x24563c-0x0;var _0x14796e=_0x6e6f[_0x24563c];return _0x14796e;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xf6e6('0x0'),_0xf6e6('0x1'),'update'];function createListener(_0x4497c3,_0x1f7b00){return function(_0x32f236){_0x1f7b00[_0xf6e6('0x2')](_0x4497c3,_0x32f236);};}function removeListener(_0x445201,_0x3deccf){return function(){SmsQueueEvents[_0xf6e6('0x3')](_0x445201,_0x3deccf);};}exports['register']=function(_0x3c9820){for(var _0x3ca8a7=0x0,_0x3af742=events[_0xf6e6('0x4')];_0x3ca8a7<_0x3af742;_0x3ca8a7++){var _0x1a3561=events[_0x3ca8a7];var _0x172fd4=createListener(_0xf6e6('0x5')+_0x1a3561,_0x3c9820);SmsQueueEvents['on'](_0x1a3561,_0x172fd4);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index df44472..1709574 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 _0x8f9d=['../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','put','update','delete','exports','multer','path','express','Router','../../components/auth/service'];(function(_0x1d3577,_0x17a32e){var _0x277d9a=function(_0x4b4144){while(--_0x4b4144){_0x1d3577['push'](_0x1d3577['shift']());}};_0x277d9a(++_0x17a32e);}(_0x8f9d,0x93));var _0xd8f9=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8f9d[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xd8f9('0x0'));var util=require('util');var path=require(_0xd8f9('0x1'));var timeout=require('connect-timeout');var express=require(_0xd8f9('0x2'));var router=express[_0xd8f9('0x3')]();var auth=require(_0xd8f9('0x4'));var interaction=require(_0xd8f9('0x5'));var config=require(_0xd8f9('0x6'));var controller=require(_0xd8f9('0x7'));router[_0xd8f9('0x8')]('/',auth['isAuthenticated'](),controller[_0xd8f9('0x9')]);router[_0xd8f9('0x8')](_0xd8f9('0xa'),auth[_0xd8f9('0xb')](),controller[_0xd8f9('0xc')]);router['get'](_0xd8f9('0xd'),auth[_0xd8f9('0xb')](),controller['show']);router[_0xd8f9('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd8f9('0xf')](_0xd8f9('0xd'),auth[_0xd8f9('0xb')](),controller[_0xd8f9('0x10')]);router[_0xd8f9('0x11')](_0xd8f9('0xd'),auth[_0xd8f9('0xb')](),controller['destroy']);module[_0xd8f9('0x12')]=router; \ No newline at end of file +var _0x292c=['/:id','show','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe'];(function(_0xc55d64,_0x133f2d){var _0x4194f6=function(_0x4a38c9){while(--_0x4a38c9){_0xc55d64['push'](_0xc55d64['shift']());}};_0x4194f6(++_0x133f2d);}(_0x292c,0x66));var _0xc292=function(_0x4e170e,_0x207e58){_0x4e170e=_0x4e170e-0x0;var _0x338291=_0x292c[_0x4e170e];return _0x338291;};'use strict';var multer=require(_0xc292('0x0'));var util=require('util');var path=require(_0xc292('0x1'));var timeout=require(_0xc292('0x2'));var express=require(_0xc292('0x3'));var router=express[_0xc292('0x4')]();var auth=require(_0xc292('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc292('0x6'));var controller=require('./smsQueueReport.controller');router['get']('/',auth[_0xc292('0x7')](),controller[_0xc292('0x8')]);router[_0xc292('0x9')](_0xc292('0xa'),auth[_0xc292('0x7')](),controller[_0xc292('0xb')]);router[_0xc292('0x9')](_0xc292('0xc'),auth[_0xc292('0x7')](),controller[_0xc292('0xd')]);router['post']('/',auth[_0xc292('0x7')](),controller[_0xc292('0xe')]);router[_0xc292('0xf')](_0xc292('0xc'),auth[_0xc292('0x7')](),controller['update']);router[_0xc292('0x10')](_0xc292('0xc'),auth[_0xc292('0x7')](),controller[_0xc292('0x11')]);module[_0xc292('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index cfdce5a..22afc2b 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 _0xd508=['moment','sequelize','STRING','DATE'];(function(_0xb152c,_0x2413a6){var _0x13be06=function(_0x40e893){while(--_0x40e893){_0xb152c['push'](_0xb152c['shift']());}};_0x13be06(++_0x2413a6);}(_0xd508,0xdc));var _0x8d50=function(_0x4953dc,_0x383cde){_0x4953dc=_0x4953dc-0x0;var _0x4caa29=_0xd508[_0x4953dc];return _0x4caa29;};'use strict';var moment=require(_0x8d50('0x0'));var Sequelize=require(_0x8d50('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x8d50('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x8d50('0x3')]},'reason':{'type':Sequelize[_0x8d50('0x2')]}}; \ No newline at end of file +var _0x81f4=['DATE','moment','sequelize','STRING'];(function(_0x551783,_0xc1e908){var _0x39083a=function(_0x1e8814){while(--_0x1e8814){_0x551783['push'](_0x551783['shift']());}};_0x39083a(++_0xc1e908);}(_0x81f4,0x19d));var _0x481f=function(_0x79a141,_0x404aab){_0x79a141=_0x79a141-0x0;var _0x238e40=_0x81f4[_0x79a141];return _0x238e40;};'use strict';var moment=require(_0x481f('0x0'));var Sequelize=require(_0x481f('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x481f('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x481f('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x481f('0x3')]},'acceptAt':{'type':Sequelize[_0x481f('0x3')]},'exitAt':{'type':Sequelize[_0x481f('0x3')]},'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 4988ae6..7af5d3e 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 _0xa5d0=['nolimit','limit','order','sort','where','pick','merge','map','type','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','update','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','status','offset','set','Content-Range','json','apply','then','destroy','end','sendStatus','error','stack','send','index','SmsQueueReport','rawAttributes','query','filters','model','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x516881,_0x4971a7){var _0x31c1fa=function(_0x5008f8){while(--_0x5008f8){_0x516881['push'](_0x516881['shift']());}};_0x31c1fa(++_0x4971a7);}(_0xa5d0,0x1ca));var _0x0a5d=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa5d0[_0x311c35];return _0x5cc50c;};'use strict';var pdf=require(_0x0a5d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0a5d('0x1'));var zipdir=require(_0x0a5d('0x2'));var jsonpatch=require(_0x0a5d('0x3'));var rp=require(_0x0a5d('0x4'));var moment=require(_0x0a5d('0x5'));var BPromise=require(_0x0a5d('0x6'));var Mustache=require(_0x0a5d('0x7'));var util=require(_0x0a5d('0x8'));var path=require(_0x0a5d('0x9'));var sox=require('sox');var csv=require(_0x0a5d('0xa'));var ejs=require(_0x0a5d('0xb'));var fs=require('fs');var _=require(_0x0a5d('0xc'));var squel=require(_0x0a5d('0xd'));var crypto=require(_0x0a5d('0xe'));var jsforce=require(_0x0a5d('0xf'));var deskjs=require(_0x0a5d('0x10'));var toCsv=require(_0x0a5d('0xa'));var querystring=require('querystring');var Papa=require(_0x0a5d('0x11'));var Redis=require('ioredis');var authService=require(_0x0a5d('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x0a5d('0x13'));var logger=require('../../config/logger')(_0x0a5d('0x14'));var utils=require(_0x0a5d('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5460b0,_0xea5445){_0xea5445=_0xea5445||0xcc;return function(_0x1c840b){if(_0x1c840b){return _0x5460b0['sendStatus'](_0xea5445);}return _0x5460b0['status'](_0xea5445)['end']();};}function respondWithResult(_0x505ac2,_0x5a6af5){_0x5a6af5=_0x5a6af5||0xc8;return function(_0x53ed12){if(_0x53ed12){return _0x505ac2[_0x0a5d('0x16')](_0x5a6af5)['json'](_0x53ed12);}};}function respondWithFilteredResult(_0x15811c,_0x4c81fe){return function(_0x19170d){if(_0x19170d){var _0x256f7c=_0x19170d['count'],_0x57ec14=_0x4c81fe[_0x0a5d('0x17')],_0x28e494=_0x4c81fe[_0x0a5d('0x17')]+_0x4c81fe['limit'],_0x6d754c;if(_0x28e494>=_0x256f7c){_0x28e494=_0x256f7c;_0x6d754c=0xc8;}else{_0x6d754c=0xce;}_0x15811c['status'](_0x6d754c);return _0x15811c[_0x0a5d('0x18')](_0x0a5d('0x19'),_0x57ec14+'-'+_0x28e494+'/'+_0x256f7c)[_0x0a5d('0x1a')](_0x19170d);}return null;};}function patchUpdates(_0x160be3){return function(_0x3e6d19){try{jsonpatch[_0x0a5d('0x1b')](_0x3e6d19,_0x160be3,!![]);}catch(_0xa97717){return BPromise['reject'](_0xa97717);}return _0x3e6d19['save']();};}function saveUpdates(_0x441066,_0x343788){return function(_0x47ff65){if(_0x47ff65){return _0x47ff65['update'](_0x441066)[_0x0a5d('0x1c')](function(_0x27da34){return _0x27da34;});}return null;};}function removeEntity(_0x20839f,_0x36c480){return function(_0x2e16a8){if(_0x2e16a8){return _0x2e16a8[_0x0a5d('0x1d')]()['then'](function(){_0x20839f['status'](0xcc)[_0x0a5d('0x1e')]();});}};}function handleEntityNotFound(_0x465ce5,_0x36451b){return function(_0xb22070){if(!_0xb22070){_0x465ce5[_0x0a5d('0x1f')](0x194);}return _0xb22070;};}function handleError(_0x5ef02a,_0x279f32){_0x279f32=_0x279f32||0x1f4;return function(_0x2120f8){logger[_0x0a5d('0x20')](_0x2120f8[_0x0a5d('0x21')]);if(_0x2120f8['name']){delete _0x2120f8['name'];}_0x5ef02a[_0x0a5d('0x16')](_0x279f32)[_0x0a5d('0x22')](_0x2120f8);};}exports[_0x0a5d('0x23')]=function(_0x55b612,_0xd444ee){var _0x2f754b={},_0x51634c={},_0x5a4ea0={'count':0x0,'rows':[]};var _0x150601=db[_0x0a5d('0x24')][_0x0a5d('0x25')];_0x51634c['model']=_['keys'](_0x150601);_0x51634c[_0x0a5d('0x26')]=_['keys'](_0x55b612[_0x0a5d('0x26')]);_0x51634c[_0x0a5d('0x27')]=_['intersection'](_0x51634c[_0x0a5d('0x28')],_0x51634c[_0x0a5d('0x26')]);_0x2f754b[_0x0a5d('0x29')]=_[_0x0a5d('0x2a')](_0x51634c[_0x0a5d('0x28')],qs[_0x0a5d('0x2b')](_0x55b612[_0x0a5d('0x26')][_0x0a5d('0x2b')]));_0x2f754b['attributes']=_0x2f754b['attributes'][_0x0a5d('0x2c')]?_0x2f754b[_0x0a5d('0x29')]:_0x51634c[_0x0a5d('0x28')];if(!_0x55b612['query'][_0x0a5d('0x2d')](_0x0a5d('0x2e'))){_0x2f754b['limit']=qs[_0x0a5d('0x2f')](_0x55b612[_0x0a5d('0x26')][_0x0a5d('0x2f')]);_0x2f754b['offset']=qs[_0x0a5d('0x17')](_0x55b612[_0x0a5d('0x26')][_0x0a5d('0x17')]);}_0x2f754b[_0x0a5d('0x30')]=qs[_0x0a5d('0x31')](_0x55b612[_0x0a5d('0x26')][_0x0a5d('0x31')]);_0x2f754b[_0x0a5d('0x32')]=qs['filters'](_[_0x0a5d('0x33')](_0x55b612['query'],_0x51634c[_0x0a5d('0x27')]));if(_0x55b612[_0x0a5d('0x26')]['filter']){_0x2f754b['where']=_[_0x0a5d('0x34')](_0x2f754b['where'],{'$or':_[_0x0a5d('0x35')](_0x150601,function(_0x5067c1){if(_0x5067c1[_0x0a5d('0x36')]['key']!==_0x0a5d('0x37')){var _0x56ab38={};_0x56ab38[_0x5067c1['field']]={'$like':'%'+_0x55b612[_0x0a5d('0x26')][_0x0a5d('0x38')]+'%'};return _0x56ab38;}})});}_0x2f754b=_[_0x0a5d('0x34')]({},_0x2f754b,_0x55b612[_0x0a5d('0x39')]);var _0x509e0d={'where':_0x2f754b[_0x0a5d('0x32')]};return db[_0x0a5d('0x24')][_0x0a5d('0x3a')](_0x509e0d)[_0x0a5d('0x1c')](function(_0x5e2d24){_0x5a4ea0[_0x0a5d('0x3a')]=_0x5e2d24;if(_0x55b612[_0x0a5d('0x26')][_0x0a5d('0x3b')]){_0x2f754b[_0x0a5d('0x3c')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x0a5d('0x3d')](_0x2f754b);})['then'](function(_0x259b16){_0x5a4ea0[_0x0a5d('0x3e')]=_0x259b16;return _0x5a4ea0;})[_0x0a5d('0x1c')](respondWithFilteredResult(_0xd444ee,_0x2f754b))['catch'](handleError(_0xd444ee,null));};exports[_0x0a5d('0x3f')]=function(_0x19eda6,_0x5c4657){var _0xd62f1={'raw':!![],'where':{'id':_0x19eda6[_0x0a5d('0x40')]['id']}},_0x5ace7a={};_0x5ace7a[_0x0a5d('0x28')]=_[_0x0a5d('0x41')](db[_0x0a5d('0x24')][_0x0a5d('0x25')]);_0x5ace7a['query']=_[_0x0a5d('0x41')](_0x19eda6[_0x0a5d('0x26')]);_0x5ace7a[_0x0a5d('0x27')]=_[_0x0a5d('0x2a')](_0x5ace7a['model'],_0x5ace7a[_0x0a5d('0x26')]);_0xd62f1['attributes']=_[_0x0a5d('0x2a')](_0x5ace7a[_0x0a5d('0x28')],qs['fields'](_0x19eda6['query'][_0x0a5d('0x2b')]));_0xd62f1['attributes']=_0xd62f1[_0x0a5d('0x29')][_0x0a5d('0x2c')]?_0xd62f1[_0x0a5d('0x29')]:_0x5ace7a['model'];if(_0x19eda6[_0x0a5d('0x26')]['includeAll']){_0xd62f1[_0x0a5d('0x3c')]=[{'all':!![]}];}_0xd62f1=_[_0x0a5d('0x34')]({},_0xd62f1,_0x19eda6[_0x0a5d('0x39')]);return db[_0x0a5d('0x24')][_0x0a5d('0x42')](_0xd62f1)[_0x0a5d('0x1c')](handleEntityNotFound(_0x5c4657,null))[_0x0a5d('0x1c')](respondWithResult(_0x5c4657,null))['catch'](handleError(_0x5c4657,null));};exports[_0x0a5d('0x43')]=function(_0xb1680a,_0x26d9e7){return db[_0x0a5d('0x24')][_0x0a5d('0x43')](_0xb1680a[_0x0a5d('0x44')],{})[_0x0a5d('0x1c')](respondWithResult(_0x26d9e7,0xc9))[_0x0a5d('0x45')](handleError(_0x26d9e7,null));};exports[_0x0a5d('0x46')]=function(_0x18048f,_0x2cddc4){if(_0x18048f[_0x0a5d('0x44')]['id']){delete _0x18048f[_0x0a5d('0x44')]['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0x18048f[_0x0a5d('0x40')]['id']}})[_0x0a5d('0x1c')](handleEntityNotFound(_0x2cddc4,null))[_0x0a5d('0x1c')](saveUpdates(_0x18048f[_0x0a5d('0x44')],null))[_0x0a5d('0x1c')](respondWithResult(_0x2cddc4,null))[_0x0a5d('0x45')](handleError(_0x2cddc4,null));};exports[_0x0a5d('0x1d')]=function(_0x38b4ea,_0x2f8145){return db['SmsQueueReport']['find']({'where':{'id':_0x38b4ea[_0x0a5d('0x40')]['id']}})['then'](handleEntityNotFound(_0x2f8145,null))[_0x0a5d('0x1c')](removeEntity(_0x2f8145,null))[_0x0a5d('0x45')](handleError(_0x2f8145,null));};exports['describe']=function(_0x2300ed,_0x552198){return db['SmsQueueReport'][_0x0a5d('0x47')]()[_0x0a5d('0x1c')](respondWithResult(_0x552198,null))['catch'](handleError(_0x552198,null));}; \ No newline at end of file +var _0xfd67=['model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','SmsQueueReport','includeAll','include','catch','show','params','rawAttributes','options','create','body','find','describe','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index'];(function(_0x35b590,_0x10c345){var _0x32d2be=function(_0x50fd90){while(--_0x50fd90){_0x35b590['push'](_0x35b590['shift']());}};_0x32d2be(++_0x10c345);}(_0xfd67,0xf0));var _0x7fd6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfd67[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0x7fd6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7fd6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7fd6('0x2'));var rp=require('request-promise');var moment=require(_0x7fd6('0x3'));var BPromise=require(_0x7fd6('0x4'));var Mustache=require(_0x7fd6('0x5'));var util=require(_0x7fd6('0x6'));var path=require(_0x7fd6('0x7'));var sox=require('sox');var csv=require(_0x7fd6('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7fd6('0x9'));var squel=require(_0x7fd6('0xa'));var crypto=require(_0x7fd6('0xb'));var jsforce=require(_0x7fd6('0xc'));var deskjs=require(_0x7fd6('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7fd6('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7fd6('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7fd6('0x10'));var logger=require('../../config/logger')(_0x7fd6('0x11'));var utils=require(_0x7fd6('0x12'));var config=require(_0x7fd6('0x13'));var db=require(_0x7fd6('0x14'))['db'];function respondWithStatusCode(_0x3c9079,_0x24cda6){_0x24cda6=_0x24cda6||0xcc;return function(_0x77ee4d){if(_0x77ee4d){return _0x3c9079[_0x7fd6('0x15')](_0x24cda6);}return _0x3c9079[_0x7fd6('0x16')](_0x24cda6)[_0x7fd6('0x17')]();};}function respondWithResult(_0x4db645,_0x494bc3){_0x494bc3=_0x494bc3||0xc8;return function(_0x2a6470){if(_0x2a6470){return _0x4db645[_0x7fd6('0x16')](_0x494bc3)[_0x7fd6('0x18')](_0x2a6470);}};}function respondWithFilteredResult(_0x535ae6,_0x4891eb){return function(_0x519024){if(_0x519024){var _0x4c0bea=_0x519024[_0x7fd6('0x19')],_0x32a96d=_0x4891eb[_0x7fd6('0x1a')],_0x42ddee=_0x4891eb['offset']+_0x4891eb[_0x7fd6('0x1b')],_0xd928ed;if(_0x42ddee>=_0x4c0bea){_0x42ddee=_0x4c0bea;_0xd928ed=0xc8;}else{_0xd928ed=0xce;}_0x535ae6['status'](_0xd928ed);return _0x535ae6[_0x7fd6('0x1c')](_0x7fd6('0x1d'),_0x32a96d+'-'+_0x42ddee+'/'+_0x4c0bea)[_0x7fd6('0x18')](_0x519024);}return null;};}function patchUpdates(_0x3beae0){return function(_0x3be304){try{jsonpatch[_0x7fd6('0x1e')](_0x3be304,_0x3beae0,!![]);}catch(_0x4a42d4){return BPromise['reject'](_0x4a42d4);}return _0x3be304[_0x7fd6('0x1f')]();};}function saveUpdates(_0x405076,_0x110939){return function(_0x5b3e3a){if(_0x5b3e3a){return _0x5b3e3a[_0x7fd6('0x20')](_0x405076)[_0x7fd6('0x21')](function(_0x10cbcc){return _0x10cbcc;});}return null;};}function removeEntity(_0x64b85f,_0x1c6649){return function(_0x3ed93c){if(_0x3ed93c){return _0x3ed93c[_0x7fd6('0x22')]()[_0x7fd6('0x21')](function(){_0x64b85f['status'](0xcc)[_0x7fd6('0x17')]();});}};}function handleEntityNotFound(_0x2c3955,_0x5b7fd2){return function(_0x12dbf9){if(!_0x12dbf9){_0x2c3955[_0x7fd6('0x15')](0x194);}return _0x12dbf9;};}function handleError(_0x579e20,_0x4bafe0){_0x4bafe0=_0x4bafe0||0x1f4;return function(_0x25dd48){logger[_0x7fd6('0x23')](_0x25dd48[_0x7fd6('0x24')]);if(_0x25dd48[_0x7fd6('0x25')]){delete _0x25dd48[_0x7fd6('0x25')];}_0x579e20[_0x7fd6('0x16')](_0x4bafe0)[_0x7fd6('0x26')](_0x25dd48);};}exports[_0x7fd6('0x27')]=function(_0x795c2f,_0x450741){var _0x21470f={},_0x52ca1c={},_0x205751={'count':0x0,'rows':[]};var _0x510b6e=db['SmsQueueReport']['rawAttributes'];_0x52ca1c[_0x7fd6('0x28')]=_['keys'](_0x510b6e);_0x52ca1c[_0x7fd6('0x29')]=_[_0x7fd6('0x2a')](_0x795c2f[_0x7fd6('0x29')]);_0x52ca1c[_0x7fd6('0x2b')]=_['intersection'](_0x52ca1c['model'],_0x52ca1c[_0x7fd6('0x29')]);_0x21470f['attributes']=_[_0x7fd6('0x2c')](_0x52ca1c[_0x7fd6('0x28')],qs['fields'](_0x795c2f['query'][_0x7fd6('0x2d')]));_0x21470f[_0x7fd6('0x2e')]=_0x21470f[_0x7fd6('0x2e')][_0x7fd6('0x2f')]?_0x21470f[_0x7fd6('0x2e')]:_0x52ca1c[_0x7fd6('0x28')];if(!_0x795c2f['query'][_0x7fd6('0x30')](_0x7fd6('0x31'))){_0x21470f[_0x7fd6('0x1b')]=qs['limit'](_0x795c2f['query'][_0x7fd6('0x1b')]);_0x21470f[_0x7fd6('0x1a')]=qs[_0x7fd6('0x1a')](_0x795c2f['query'][_0x7fd6('0x1a')]);}_0x21470f[_0x7fd6('0x32')]=qs[_0x7fd6('0x33')](_0x795c2f[_0x7fd6('0x29')][_0x7fd6('0x33')]);_0x21470f[_0x7fd6('0x34')]=qs[_0x7fd6('0x2b')](_[_0x7fd6('0x35')](_0x795c2f[_0x7fd6('0x29')],_0x52ca1c[_0x7fd6('0x2b')]));if(_0x795c2f[_0x7fd6('0x29')][_0x7fd6('0x36')]){_0x21470f[_0x7fd6('0x34')]=_[_0x7fd6('0x37')](_0x21470f['where'],{'$or':_['map'](_0x510b6e,function(_0x508c21){if(_0x508c21[_0x7fd6('0x38')][_0x7fd6('0x39')]!=='VIRTUAL'){var _0x374447={};_0x374447[_0x508c21['field']]={'$like':'%'+_0x795c2f[_0x7fd6('0x29')][_0x7fd6('0x36')]+'%'};return _0x374447;}})});}_0x21470f=_[_0x7fd6('0x37')]({},_0x21470f,_0x795c2f['options']);var _0x4a9045={'where':_0x21470f[_0x7fd6('0x34')]};return db[_0x7fd6('0x3a')][_0x7fd6('0x19')](_0x4a9045)[_0x7fd6('0x21')](function(_0x450185){_0x205751[_0x7fd6('0x19')]=_0x450185;if(_0x795c2f[_0x7fd6('0x29')][_0x7fd6('0x3b')]){_0x21470f[_0x7fd6('0x3c')]=[{'all':!![]}];}return db[_0x7fd6('0x3a')]['findAll'](_0x21470f);})[_0x7fd6('0x21')](function(_0x3dab67){_0x205751['rows']=_0x3dab67;return _0x205751;})[_0x7fd6('0x21')](respondWithFilteredResult(_0x450741,_0x21470f))[_0x7fd6('0x3d')](handleError(_0x450741,null));};exports[_0x7fd6('0x3e')]=function(_0x43afe9,_0x3ad533){var _0x2bd17a={'raw':!![],'where':{'id':_0x43afe9[_0x7fd6('0x3f')]['id']}},_0xfb4d30={};_0xfb4d30[_0x7fd6('0x28')]=_[_0x7fd6('0x2a')](db['SmsQueueReport'][_0x7fd6('0x40')]);_0xfb4d30[_0x7fd6('0x29')]=_[_0x7fd6('0x2a')](_0x43afe9[_0x7fd6('0x29')]);_0xfb4d30[_0x7fd6('0x2b')]=_['intersection'](_0xfb4d30[_0x7fd6('0x28')],_0xfb4d30[_0x7fd6('0x29')]);_0x2bd17a[_0x7fd6('0x2e')]=_[_0x7fd6('0x2c')](_0xfb4d30['model'],qs[_0x7fd6('0x2d')](_0x43afe9[_0x7fd6('0x29')][_0x7fd6('0x2d')]));_0x2bd17a[_0x7fd6('0x2e')]=_0x2bd17a[_0x7fd6('0x2e')][_0x7fd6('0x2f')]?_0x2bd17a[_0x7fd6('0x2e')]:_0xfb4d30['model'];if(_0x43afe9[_0x7fd6('0x29')][_0x7fd6('0x3b')]){_0x2bd17a[_0x7fd6('0x3c')]=[{'all':!![]}];}_0x2bd17a=_[_0x7fd6('0x37')]({},_0x2bd17a,_0x43afe9[_0x7fd6('0x41')]);return db[_0x7fd6('0x3a')]['find'](_0x2bd17a)[_0x7fd6('0x21')](handleEntityNotFound(_0x3ad533,null))['then'](respondWithResult(_0x3ad533,null))[_0x7fd6('0x3d')](handleError(_0x3ad533,null));};exports['create']=function(_0x36377b,_0x39fc7f){return db[_0x7fd6('0x3a')][_0x7fd6('0x42')](_0x36377b['body'],{})[_0x7fd6('0x21')](respondWithResult(_0x39fc7f,0xc9))['catch'](handleError(_0x39fc7f,null));};exports[_0x7fd6('0x20')]=function(_0x28d782,_0x5e24e3){if(_0x28d782[_0x7fd6('0x43')]['id']){delete _0x28d782['body']['id'];}return db[_0x7fd6('0x3a')][_0x7fd6('0x44')]({'where':{'id':_0x28d782[_0x7fd6('0x3f')]['id']}})[_0x7fd6('0x21')](handleEntityNotFound(_0x5e24e3,null))[_0x7fd6('0x21')](saveUpdates(_0x28d782['body'],null))[_0x7fd6('0x21')](respondWithResult(_0x5e24e3,null))[_0x7fd6('0x3d')](handleError(_0x5e24e3,null));};exports[_0x7fd6('0x22')]=function(_0x383219,_0x9c97c1){return db[_0x7fd6('0x3a')][_0x7fd6('0x44')]({'where':{'id':_0x383219['params']['id']}})[_0x7fd6('0x21')](handleEntityNotFound(_0x9c97c1,null))['then'](removeEntity(_0x9c97c1,null))['catch'](handleError(_0x9c97c1,null));};exports['describe']=function(_0x2a5bd8,_0xbf882b){return db[_0x7fd6('0x3a')][_0x7fd6('0x45')]()[_0x7fd6('0x21')](respondWithResult(_0xbf882b,null))['catch'](handleError(_0xbf882b,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 16b59b6..083c8fa 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 _0x0612=['rimraf','../../config/environment','./smsQueueReport.attributes','exports','SmsQueueReport','report_sms_queue','uniqueid','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x0612,0x1b9));var _0x2061=function(_0x5ac976,_0x19defd){_0x5ac976=_0x5ac976-0x0;var _0x35665d=_0x0612[_0x5ac976];return _0x35665d;};'use strict';var _=require(_0x2061('0x0'));var util=require(_0x2061('0x1'));var logger=require('../../config/logger')(_0x2061('0x2'));var moment=require(_0x2061('0x3'));var BPromise=require(_0x2061('0x4'));var rp=require(_0x2061('0x5'));var fs=require('fs');var path=require(_0x2061('0x6'));var rimraf=require(_0x2061('0x7'));var config=require(_0x2061('0x8'));var attributes=require(_0x2061('0x9'));module[_0x2061('0xa')]=function(_0x4523aa,_0x45d001){return _0x4523aa['define'](_0x2061('0xb'),attributes,{'tableName':_0x2061('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2061('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc1f8=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue'];(function(_0x49539,_0x57a28c){var _0x24783b=function(_0x500355){while(--_0x500355){_0x49539['push'](_0x49539['shift']());}};_0x24783b(++_0x57a28c);}(_0xc1f8,0x196));var _0x8c1f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc1f8[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8c1f('0x0'));var util=require(_0x8c1f('0x1'));var logger=require(_0x8c1f('0x2'))(_0x8c1f('0x3'));var moment=require(_0x8c1f('0x4'));var BPromise=require(_0x8c1f('0x5'));var rp=require(_0x8c1f('0x6'));var fs=require('fs');var path=require(_0x8c1f('0x7'));var rimraf=require('rimraf');var config=require(_0x8c1f('0x8'));var attributes=require(_0x8c1f('0x9'));module[_0x8c1f('0xa')]=function(_0x47ed2e,_0x1c01f7){return _0x47ed2e[_0x8c1f('0xb')](_0x8c1f('0xc'),attributes,{'tableName':_0x8c1f('0xd'),'paranoid':![],'indexes':[{'name':_0x8c1f('0xe'),'fields':[_0x8c1f('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 171da20..8245574 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 _0x0314=['where','attributes','UpdateSmsQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','options','raw','update','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0314,0xc9));var _0x4031=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0314[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4031('0x0'));var moment=require('moment');var BPromise=require(_0x4031('0x1'));var rs=require(_0x4031('0x2'));var fs=require('fs');var Redis=require(_0x4031('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4031('0x4'));var logger=require(_0x4031('0x5'))(_0x4031('0x6'));var config=require(_0x4031('0x7'));var jayson=require(_0x4031('0x8'));var client=jayson[_0x4031('0x9')][_0x4031('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x165968,_0x5318c2,_0x5a20fe){return new BPromise(function(_0x31a82e,_0x563557){return client[_0x4031('0xb')](_0x165968,_0x5a20fe)[_0x4031('0xc')](function(_0xc3461a){logger[_0x4031('0xd')](_0x4031('0xe'),_0x5318c2,_0x4031('0xf'));logger[_0x4031('0x10')](_0x4031('0x11'),_0x5318c2,'request\x20sent',JSON[_0x4031('0x12')](_0xc3461a));if(_0xc3461a[_0x4031('0x13')]){if(_0xc3461a['error'][_0x4031('0x14')]===0x1f4){logger[_0x4031('0x13')](_0x4031('0xe'),_0x5318c2,_0xc3461a['error']['message']);return _0x563557(_0xc3461a['error'][_0x4031('0x15')]);}logger[_0x4031('0x13')](_0x4031('0xe'),_0x5318c2,_0xc3461a[_0x4031('0x13')][_0x4031('0x15')]);return _0x31a82e(_0xc3461a[_0x4031('0x13')][_0x4031('0x15')]);}else{logger[_0x4031('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x5318c2,'request\x20sent');_0x31a82e(_0xc3461a[_0x4031('0x16')][_0x4031('0x15')]);}})[_0x4031('0x17')](function(_0x2e20f0){logger[_0x4031('0x13')](_0x4031('0xe'),_0x5318c2,_0x2e20f0);_0x563557(_0x2e20f0);});});}exports[_0x4031('0x18')]=function(_0x9932e){var _0x3b9a6d=this;return new Promise(function(_0x2bd726,_0x26e14b){return db[_0x4031('0x19')]['create'](_0x9932e['body'],{'raw':_0x9932e[_0x4031('0x1a')]?_0x9932e[_0x4031('0x1a')][_0x4031('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x51c7b4){logger[_0x4031('0xd')](_0x4031('0x18'),_0x9932e);logger[_0x4031('0x10')](_0x4031('0x18'),_0x9932e,JSON['stringify'](_0x51c7b4));_0x2bd726(_0x51c7b4);})[_0x4031('0x17')](function(_0x4ac185){logger[_0x4031('0x13')](_0x4031('0x18'),_0x4ac185[_0x4031('0x15')],_0x9932e);_0x26e14b(_0x3b9a6d[_0x4031('0x13')](0x1f4,_0x4ac185[_0x4031('0x15')]));});});};exports['UpdateSmsQueueReport']=function(_0xe87a7e){var _0xb96d1c=this;return new Promise(function(_0x4686b5,_0x4acff2){return db[_0x4031('0x19')][_0x4031('0x1c')](_0xe87a7e[_0x4031('0x1d')],{'raw':_0xe87a7e[_0x4031('0x1a')]?_0xe87a7e[_0x4031('0x1a')][_0x4031('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe87a7e[_0x4031('0x1a')]?_0xe87a7e['options'][_0x4031('0x1e')]||null:null,'attributes':_0xe87a7e[_0x4031('0x1a')]?_0xe87a7e[_0x4031('0x1a')][_0x4031('0x1f')]||null:null,'limit':_0xe87a7e[_0x4031('0x1a')]?_0xe87a7e['options']['limit']||null:null})[_0x4031('0xc')](function(_0x26362b){logger[_0x4031('0xd')](_0x4031('0x20'),_0xe87a7e);logger['debug'](_0x4031('0x20'),_0xe87a7e,JSON[_0x4031('0x12')](_0x26362b));_0x4686b5(_0x26362b);})[_0x4031('0x17')](function(_0x26a847){logger[_0x4031('0x13')]('UpdateSmsQueueReport',_0x26a847[_0x4031('0x15')],_0xe87a7e);_0x4acff2(_0xb96d1c[_0x4031('0x13')](0x1f4,_0x26a847['message']));});});}; \ No newline at end of file +var _0xbe2d=['UpdateSmsQueueReport','SmsQueueReport','update','where','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSmsQueueReport','create','body','options','raw','stringify'];(function(_0x34b87f,_0x28aef2){var _0x449805=function(_0x3735b7){while(--_0x3735b7){_0x34b87f['push'](_0x34b87f['shift']());}};_0x449805(++_0x28aef2);}(_0xbe2d,0xd7));var _0xdbe2=function(_0x37a7b1,_0x55e2c7){_0x37a7b1=_0x37a7b1-0x0;var _0x5aafd5=_0xbe2d[_0x37a7b1];return _0x5aafd5;};'use strict';var _=require(_0xdbe2('0x0'));var util=require('util');var moment=require(_0xdbe2('0x1'));var BPromise=require(_0xdbe2('0x2'));var rs=require(_0xdbe2('0x3'));var fs=require('fs');var Redis=require(_0xdbe2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdbe2('0x5'));var logger=require(_0xdbe2('0x6'))(_0xdbe2('0x7'));var config=require(_0xdbe2('0x8'));var jayson=require(_0xdbe2('0x9'));var client=jayson[_0xdbe2('0xa')][_0xdbe2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e33d6,_0x5e5d04,_0x1e82a4){return new BPromise(function(_0x28e0b0,_0x40e36b){return client[_0xdbe2('0xc')](_0x4e33d6,_0x1e82a4)[_0xdbe2('0xd')](function(_0x354c78){logger[_0xdbe2('0xe')](_0xdbe2('0xf'),_0x5e5d04,_0xdbe2('0x10'));logger[_0xdbe2('0x11')](_0xdbe2('0x12'),_0x5e5d04,_0xdbe2('0x10'),JSON['stringify'](_0x354c78));if(_0x354c78['error']){if(_0x354c78[_0xdbe2('0x13')][_0xdbe2('0x14')]===0x1f4){logger[_0xdbe2('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x5e5d04,_0x354c78[_0xdbe2('0x13')][_0xdbe2('0x15')]);return _0x40e36b(_0x354c78[_0xdbe2('0x13')]['message']);}logger[_0xdbe2('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x5e5d04,_0x354c78[_0xdbe2('0x13')][_0xdbe2('0x15')]);return _0x28e0b0(_0x354c78[_0xdbe2('0x13')][_0xdbe2('0x15')]);}else{logger[_0xdbe2('0xe')](_0xdbe2('0xf'),_0x5e5d04,'request\x20sent');_0x28e0b0(_0x354c78[_0xdbe2('0x16')][_0xdbe2('0x15')]);}})[_0xdbe2('0x17')](function(_0x43f073){logger[_0xdbe2('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x5e5d04,_0x43f073);_0x40e36b(_0x43f073);});});}exports[_0xdbe2('0x18')]=function(_0x34fa3c){var _0x143bff=this;return new Promise(function(_0x26105f,_0x420750){return db['SmsQueueReport'][_0xdbe2('0x19')](_0x34fa3c[_0xdbe2('0x1a')],{'raw':_0x34fa3c[_0xdbe2('0x1b')]?_0x34fa3c[_0xdbe2('0x1b')][_0xdbe2('0x1c')]===undefined?!![]:![]:!![]})[_0xdbe2('0xd')](function(_0x4c1aab){logger[_0xdbe2('0xe')](_0xdbe2('0x18'),_0x34fa3c);logger[_0xdbe2('0x11')](_0xdbe2('0x18'),_0x34fa3c,JSON[_0xdbe2('0x1d')](_0x4c1aab));_0x26105f(_0x4c1aab);})[_0xdbe2('0x17')](function(_0x33007){logger[_0xdbe2('0x13')](_0xdbe2('0x18'),_0x33007[_0xdbe2('0x15')],_0x34fa3c);_0x420750(_0x143bff[_0xdbe2('0x13')](0x1f4,_0x33007[_0xdbe2('0x15')]));});});};exports[_0xdbe2('0x1e')]=function(_0x1ae6fd){var _0x34a190=this;return new Promise(function(_0x3a37bd,_0x5567e7){return db[_0xdbe2('0x1f')][_0xdbe2('0x20')](_0x1ae6fd[_0xdbe2('0x1a')],{'raw':_0x1ae6fd[_0xdbe2('0x1b')]?_0x1ae6fd[_0xdbe2('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ae6fd[_0xdbe2('0x1b')]?_0x1ae6fd[_0xdbe2('0x1b')][_0xdbe2('0x21')]||null:null,'attributes':_0x1ae6fd[_0xdbe2('0x1b')]?_0x1ae6fd[_0xdbe2('0x1b')]['attributes']||null:null,'limit':_0x1ae6fd[_0xdbe2('0x1b')]?_0x1ae6fd[_0xdbe2('0x1b')][_0xdbe2('0x22')]||null:null})[_0xdbe2('0xd')](function(_0x8345e7){logger[_0xdbe2('0xe')](_0xdbe2('0x1e'),_0x1ae6fd);logger[_0xdbe2('0x11')](_0xdbe2('0x1e'),_0x1ae6fd,JSON[_0xdbe2('0x1d')](_0x8345e7));_0x3a37bd(_0x8345e7);})['catch'](function(_0x14fb5d){logger[_0xdbe2('0x13')](_0xdbe2('0x1e'),_0x14fb5d['message'],_0x1ae6fd);_0x5567e7(_0x34a190[_0xdbe2('0x13')](0x1f4,_0x14fb5d[_0xdbe2('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 5320104..b659794 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 _0x2670=['get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller'];(function(_0x2409cb,_0x26b709){var _0xe25c7=function(_0x3cd84a){while(--_0x3cd84a){_0x2409cb['push'](_0x2409cb['shift']());}};_0xe25c7(++_0x26b709);}(_0x2670,0x183));var _0x0267=function(_0x147938,_0xb5671c){_0x147938=_0x147938-0x0;var _0x5ca424=_0x2670[_0x147938];return _0x5ca424;};'use strict';var multer=require(_0x0267('0x0'));var util=require(_0x0267('0x1'));var path=require(_0x0267('0x2'));var timeout=require(_0x0267('0x3'));var express=require(_0x0267('0x4'));var router=express[_0x0267('0x5')]();var auth=require(_0x0267('0x6'));var interaction=require(_0x0267('0x7'));var config=require('../../config/environment');var controller=require(_0x0267('0x8'));router[_0x0267('0x9')]('/',auth[_0x0267('0xa')](),controller[_0x0267('0xb')]);router[_0x0267('0x9')](_0x0267('0xc'),auth[_0x0267('0xa')](),controller[_0x0267('0xd')]);router[_0x0267('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x0267('0xe')]);router['post']('/',auth[_0x0267('0xa')](),controller[_0x0267('0xf')]);router[_0x0267('0x10')](_0x0267('0x11'),auth['isAuthenticated'](),controller[_0x0267('0x12')]);router[_0x0267('0x13')](_0x0267('0x11'),auth[_0x0267('0xa')](),controller[_0x0267('0x14')]);module[_0x0267('0x15')]=router; \ No newline at end of file +var _0x6bc0=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x396b35,_0x5cadf8){var _0x3983c6=function(_0x5280a2){while(--_0x5280a2){_0x396b35['push'](_0x396b35['shift']());}};_0x3983c6(++_0x5cadf8);}(_0x6bc0,0x6d));var _0x06bc=function(_0x14aef8,_0x2ee578){_0x14aef8=_0x14aef8-0x0;var _0x12a8af=_0x6bc0[_0x14aef8];return _0x12a8af;};'use strict';var multer=require(_0x06bc('0x0'));var util=require(_0x06bc('0x1'));var path=require(_0x06bc('0x2'));var timeout=require(_0x06bc('0x3'));var express=require('express');var router=express[_0x06bc('0x4')]();var auth=require(_0x06bc('0x5'));var interaction=require(_0x06bc('0x6'));var config=require(_0x06bc('0x7'));var controller=require(_0x06bc('0x8'));router[_0x06bc('0x9')]('/',auth[_0x06bc('0xa')](),controller['index']);router[_0x06bc('0x9')](_0x06bc('0xb'),auth[_0x06bc('0xa')](),controller[_0x06bc('0xc')]);router[_0x06bc('0x9')](_0x06bc('0xd'),auth[_0x06bc('0xa')](),controller[_0x06bc('0xe')]);router[_0x06bc('0xf')]('/',auth[_0x06bc('0xa')](),controller[_0x06bc('0x10')]);router[_0x06bc('0x11')](_0x06bc('0xd'),auth[_0x06bc('0xa')](),controller[_0x06bc('0x12')]);router[_0x06bc('0x13')](_0x06bc('0xd'),auth['isAuthenticated'](),controller[_0x06bc('0x14')]);module[_0x06bc('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 4a98dc3..0aef053 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 _0x0b6f=['exports','STRING','ENUM','agent','queue','DATE','NOW','moment','sequelize'];(function(_0x31b5a5,_0x44376a){var _0x364cc9=function(_0x4e5f95){while(--_0x4e5f95){_0x31b5a5['push'](_0x31b5a5['shift']());}};_0x364cc9(++_0x44376a);}(_0x0b6f,0xfa));var _0xf0b6=function(_0x263a2f,_0x1e81e3){_0x263a2f=_0x263a2f-0x0;var _0x8020e8=_0x0b6f[_0x263a2f];return _0x8020e8;};'use strict';var moment=require(_0xf0b6('0x0'));var Sequelize=require(_0xf0b6('0x1'));module[_0xf0b6('0x2')]={'uniqueid':{'type':Sequelize[_0xf0b6('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xf0b6('0x4')]('account',_0xf0b6('0x5'),'queue'),'allowNull':![],'defaultValue':_0xf0b6('0x6')},'transferredAt':{'type':Sequelize[_0xf0b6('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf0b6('0x8')]}}; \ No newline at end of file +var _0x1a7b=['exports','STRING','ENUM','account','agent','queue','DATE','NOW','moment','sequelize'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x1a7b,0xc6));var _0xb1a7=function(_0x94cd8,_0x80691a){_0x94cd8=_0x94cd8-0x0;var _0x5572f4=_0x1a7b[_0x94cd8];return _0x5572f4;};'use strict';var moment=require(_0xb1a7('0x0'));var Sequelize=require(_0xb1a7('0x1'));module[_0xb1a7('0x2')]={'uniqueid':{'type':Sequelize[_0xb1a7('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xb1a7('0x4')](_0xb1a7('0x5'),_0xb1a7('0x6'),_0xb1a7('0x7')),'allowNull':![],'defaultValue':_0xb1a7('0x7')},'transferredAt':{'type':Sequelize[_0xb1a7('0x8')],'allowNull':![],'defaultValue':Sequelize[_0xb1a7('0x9')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 6ab3d0b..71270c0 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 _0xf494=['include','findAll','rows','catch','show','params','create','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','name','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','SmsTransferReport','includeAll'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xf494,0x1c6));var _0x4f49=function(_0x497f45,_0x4f552e){_0x497f45=_0x497f45-0x0;var _0x538cf1=_0xf494[_0x497f45];return _0x538cf1;};'use strict';var pdf=require(_0x4f49('0x0'));var emlformat=require(_0x4f49('0x1'));var rimraf=require(_0x4f49('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f49('0x3'));var rp=require(_0x4f49('0x4'));var moment=require(_0x4f49('0x5'));var BPromise=require(_0x4f49('0x6'));var Mustache=require(_0x4f49('0x7'));var util=require(_0x4f49('0x8'));var path=require(_0x4f49('0x9'));var sox=require(_0x4f49('0xa'));var csv=require(_0x4f49('0xb'));var ejs=require(_0x4f49('0xc'));var fs=require('fs');var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xb'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4f49('0x15'))(_0x4f49('0x16'));var utils=require('../../config/utils');var config=require(_0x4f49('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x496293,_0x4b9cd3){_0x4b9cd3=_0x4b9cd3||0xcc;return function(_0x12527d){if(_0x12527d){return _0x496293['sendStatus'](_0x4b9cd3);}return _0x496293[_0x4f49('0x18')](_0x4b9cd3)[_0x4f49('0x19')]();};}function respondWithResult(_0x1b9145,_0x2efe49){_0x2efe49=_0x2efe49||0xc8;return function(_0x1a0f1e){if(_0x1a0f1e){return _0x1b9145[_0x4f49('0x18')](_0x2efe49)[_0x4f49('0x1a')](_0x1a0f1e);}};}function respondWithFilteredResult(_0x5c373e,_0x515ace){return function(_0x1f2d0d){if(_0x1f2d0d){var _0x415e83=_0x1f2d0d[_0x4f49('0x1b')],_0x5878f4=_0x515ace[_0x4f49('0x1c')],_0x5bdfaf=_0x515ace['offset']+_0x515ace[_0x4f49('0x1d')],_0x2f0a0d;if(_0x5bdfaf>=_0x415e83){_0x5bdfaf=_0x415e83;_0x2f0a0d=0xc8;}else{_0x2f0a0d=0xce;}_0x5c373e[_0x4f49('0x18')](_0x2f0a0d);return _0x5c373e[_0x4f49('0x1e')]('Content-Range',_0x5878f4+'-'+_0x5bdfaf+'/'+_0x415e83)['json'](_0x1f2d0d);}return null;};}function patchUpdates(_0x560592){return function(_0x47f1e8){try{jsonpatch[_0x4f49('0x1f')](_0x47f1e8,_0x560592,!![]);}catch(_0x1834f4){return BPromise[_0x4f49('0x20')](_0x1834f4);}return _0x47f1e8[_0x4f49('0x21')]();};}function saveUpdates(_0x5793ac,_0x416893){return function(_0x2aed27){if(_0x2aed27){return _0x2aed27[_0x4f49('0x22')](_0x5793ac)[_0x4f49('0x23')](function(_0xea82f8){return _0xea82f8;});}return null;};}function removeEntity(_0x509f7c,_0x3e7e28){return function(_0x357446){if(_0x357446){return _0x357446[_0x4f49('0x24')]()['then'](function(){_0x509f7c[_0x4f49('0x18')](0xcc)[_0x4f49('0x19')]();});}};}function handleEntityNotFound(_0x32ca7b,_0x43c458){return function(_0x9d30aa){if(!_0x9d30aa){_0x32ca7b[_0x4f49('0x25')](0x194);}return _0x9d30aa;};}function handleError(_0x559d98,_0x4e9041){_0x4e9041=_0x4e9041||0x1f4;return function(_0x3a947b){logger[_0x4f49('0x26')](_0x3a947b['stack']);if(_0x3a947b[_0x4f49('0x27')]){delete _0x3a947b[_0x4f49('0x27')];}_0x559d98[_0x4f49('0x18')](_0x4e9041)['send'](_0x3a947b);};}exports[_0x4f49('0x28')]=function(_0x2eed1c,_0x298785){var _0x148153={},_0xfefbab={},_0x122404={'count':0x0,'rows':[]};var _0x4915af=db['SmsTransferReport'][_0x4f49('0x29')];_0xfefbab[_0x4f49('0x2a')]=_[_0x4f49('0x2b')](_0x4915af);_0xfefbab['query']=_[_0x4f49('0x2b')](_0x2eed1c[_0x4f49('0x2c')]);_0xfefbab[_0x4f49('0x2d')]=_['intersection'](_0xfefbab['model'],_0xfefbab[_0x4f49('0x2c')]);_0x148153[_0x4f49('0x2e')]=_[_0x4f49('0x2f')](_0xfefbab['model'],qs[_0x4f49('0x30')](_0x2eed1c[_0x4f49('0x2c')][_0x4f49('0x30')]));_0x148153[_0x4f49('0x2e')]=_0x148153[_0x4f49('0x2e')][_0x4f49('0x31')]?_0x148153[_0x4f49('0x2e')]:_0xfefbab[_0x4f49('0x2a')];if(!_0x2eed1c[_0x4f49('0x2c')][_0x4f49('0x32')](_0x4f49('0x33'))){_0x148153[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x2eed1c[_0x4f49('0x2c')][_0x4f49('0x1d')]);_0x148153[_0x4f49('0x1c')]=qs[_0x4f49('0x1c')](_0x2eed1c[_0x4f49('0x2c')][_0x4f49('0x1c')]);}_0x148153['order']=qs[_0x4f49('0x34')](_0x2eed1c[_0x4f49('0x2c')][_0x4f49('0x34')]);_0x148153[_0x4f49('0x35')]=qs[_0x4f49('0x2d')](_[_0x4f49('0x36')](_0x2eed1c[_0x4f49('0x2c')],_0xfefbab[_0x4f49('0x2d')]));if(_0x2eed1c[_0x4f49('0x2c')][_0x4f49('0x37')]){_0x148153[_0x4f49('0x35')]=_[_0x4f49('0x38')](_0x148153[_0x4f49('0x35')],{'$or':_['map'](_0x4915af,function(_0x371282){if(_0x371282[_0x4f49('0x39')][_0x4f49('0x3a')]!==_0x4f49('0x3b')){var _0x1c1e9b={};_0x1c1e9b[_0x371282[_0x4f49('0x3c')]]={'$like':'%'+_0x2eed1c[_0x4f49('0x2c')][_0x4f49('0x37')]+'%'};return _0x1c1e9b;}})});}_0x148153=_[_0x4f49('0x38')]({},_0x148153,_0x2eed1c[_0x4f49('0x3d')]);var _0x173b6e={'where':_0x148153[_0x4f49('0x35')]};return db[_0x4f49('0x3e')][_0x4f49('0x1b')](_0x173b6e)['then'](function(_0x802f20){_0x122404[_0x4f49('0x1b')]=_0x802f20;if(_0x2eed1c['query'][_0x4f49('0x3f')]){_0x148153[_0x4f49('0x40')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x4f49('0x41')](_0x148153);})[_0x4f49('0x23')](function(_0x2548ad){_0x122404[_0x4f49('0x42')]=_0x2548ad;return _0x122404;})[_0x4f49('0x23')](respondWithFilteredResult(_0x298785,_0x148153))[_0x4f49('0x43')](handleError(_0x298785,null));};exports[_0x4f49('0x44')]=function(_0x5d464e,_0x5e1461){var _0x55960a={'raw':!![],'where':{'id':_0x5d464e[_0x4f49('0x45')]['id']}},_0x15e4b3={};_0x15e4b3[_0x4f49('0x2a')]=_[_0x4f49('0x2b')](db[_0x4f49('0x3e')][_0x4f49('0x29')]);_0x15e4b3[_0x4f49('0x2c')]=_[_0x4f49('0x2b')](_0x5d464e[_0x4f49('0x2c')]);_0x15e4b3['filters']=_['intersection'](_0x15e4b3[_0x4f49('0x2a')],_0x15e4b3[_0x4f49('0x2c')]);_0x55960a[_0x4f49('0x2e')]=_['intersection'](_0x15e4b3[_0x4f49('0x2a')],qs['fields'](_0x5d464e['query'][_0x4f49('0x30')]));_0x55960a[_0x4f49('0x2e')]=_0x55960a[_0x4f49('0x2e')]['length']?_0x55960a[_0x4f49('0x2e')]:_0x15e4b3[_0x4f49('0x2a')];if(_0x5d464e['query'][_0x4f49('0x3f')]){_0x55960a['include']=[{'all':!![]}];}_0x55960a=_[_0x4f49('0x38')]({},_0x55960a,_0x5d464e[_0x4f49('0x3d')]);return db[_0x4f49('0x3e')]['find'](_0x55960a)[_0x4f49('0x23')](handleEntityNotFound(_0x5e1461,null))[_0x4f49('0x23')](respondWithResult(_0x5e1461,null))[_0x4f49('0x43')](handleError(_0x5e1461,null));};exports[_0x4f49('0x46')]=function(_0x29dfdb,_0x1c41e4){return db[_0x4f49('0x3e')][_0x4f49('0x46')](_0x29dfdb[_0x4f49('0x47')],{})[_0x4f49('0x23')](respondWithResult(_0x1c41e4,0xc9))['catch'](handleError(_0x1c41e4,null));};exports[_0x4f49('0x22')]=function(_0x44bf1d,_0x59997c){if(_0x44bf1d[_0x4f49('0x47')]['id']){delete _0x44bf1d['body']['id'];}return db[_0x4f49('0x3e')][_0x4f49('0x48')]({'where':{'id':_0x44bf1d[_0x4f49('0x45')]['id']}})[_0x4f49('0x23')](handleEntityNotFound(_0x59997c,null))['then'](saveUpdates(_0x44bf1d[_0x4f49('0x47')],null))[_0x4f49('0x23')](respondWithResult(_0x59997c,null))[_0x4f49('0x43')](handleError(_0x59997c,null));};exports[_0x4f49('0x24')]=function(_0x3ec266,_0x72ea05){return db[_0x4f49('0x3e')][_0x4f49('0x48')]({'where':{'id':_0x3ec266[_0x4f49('0x45')]['id']}})[_0x4f49('0x23')](handleEntityNotFound(_0x72ea05,null))[_0x4f49('0x23')](removeEntity(_0x72ea05,null))[_0x4f49('0x43')](handleError(_0x72ea05,null));};exports[_0x4f49('0x49')]=function(_0x2104d0,_0x26464c){return db[_0x4f49('0x3e')]['describe']()['then'](respondWithResult(_0x26464c,null))[_0x4f49('0x43')](handleError(_0x26464c,null));}; \ No newline at end of file +var _0xcca7=['util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','model','query','keys','attributes','intersection','fields','length','nolimit','sort','filters','pick','filter','where','map','type','VIRTUAL','field','options','SmsTransferReport','count','findAll','rows','catch','show','include','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','moment','mustache'];(function(_0x45f2e1,_0x48b816){var _0x461542=function(_0x3ec96e){while(--_0x3ec96e){_0x45f2e1['push'](_0x45f2e1['shift']());}};_0x461542(++_0x48b816);}(_0xcca7,0x1aa));var _0x7cca=function(_0x10e897,_0x15bc4d){_0x10e897=_0x10e897-0x0;var _0x2e8759=_0xcca7[_0x10e897];return _0x2e8759;};'use strict';var pdf=require(_0x7cca('0x0'));var emlformat=require(_0x7cca('0x1'));var rimraf=require(_0x7cca('0x2'));var zipdir=require(_0x7cca('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7cca('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7cca('0x5'));var util=require(_0x7cca('0x6'));var path=require(_0x7cca('0x7'));var sox=require(_0x7cca('0x8'));var csv=require(_0x7cca('0x9'));var ejs=require(_0x7cca('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7cca('0xb'));var jsforce=require(_0x7cca('0xc'));var deskjs=require(_0x7cca('0xd'));var toCsv=require(_0x7cca('0x9'));var querystring=require(_0x7cca('0xe'));var Papa=require(_0x7cca('0xf'));var Redis=require(_0x7cca('0x10'));var authService=require(_0x7cca('0x11'));var qs=require(_0x7cca('0x12'));var hardwareService=require(_0x7cca('0x13'));var logger=require('../../config/logger')(_0x7cca('0x14'));var utils=require(_0x7cca('0x15'));var config=require(_0x7cca('0x16'));var db=require(_0x7cca('0x17'))['db'];function respondWithStatusCode(_0x25a65a,_0x4b7b66){_0x4b7b66=_0x4b7b66||0xcc;return function(_0x2a14cc){if(_0x2a14cc){return _0x25a65a[_0x7cca('0x18')](_0x4b7b66);}return _0x25a65a[_0x7cca('0x19')](_0x4b7b66)['end']();};}function respondWithResult(_0x54e492,_0x8ea157){_0x8ea157=_0x8ea157||0xc8;return function(_0x20c1b2){if(_0x20c1b2){return _0x54e492[_0x7cca('0x19')](_0x8ea157)[_0x7cca('0x1a')](_0x20c1b2);}};}function respondWithFilteredResult(_0x444465,_0x3d3141){return function(_0x45143d){if(_0x45143d){var _0x5a357d=_0x45143d['count'],_0x216d4b=_0x3d3141[_0x7cca('0x1b')],_0x533608=_0x3d3141[_0x7cca('0x1b')]+_0x3d3141[_0x7cca('0x1c')],_0x5cd551;if(_0x533608>=_0x5a357d){_0x533608=_0x5a357d;_0x5cd551=0xc8;}else{_0x5cd551=0xce;}_0x444465[_0x7cca('0x19')](_0x5cd551);return _0x444465[_0x7cca('0x1d')]('Content-Range',_0x216d4b+'-'+_0x533608+'/'+_0x5a357d)[_0x7cca('0x1a')](_0x45143d);}return null;};}function patchUpdates(_0x4fba9e){return function(_0x5d47f8){try{jsonpatch['apply'](_0x5d47f8,_0x4fba9e,!![]);}catch(_0x370469){return BPromise[_0x7cca('0x1e')](_0x370469);}return _0x5d47f8[_0x7cca('0x1f')]();};}function saveUpdates(_0x1a20be,_0x36ba41){return function(_0x45db2f){if(_0x45db2f){return _0x45db2f[_0x7cca('0x20')](_0x1a20be)[_0x7cca('0x21')](function(_0x4d7804){return _0x4d7804;});}return null;};}function removeEntity(_0x31baf4,_0x3154b0){return function(_0x165d13){if(_0x165d13){return _0x165d13[_0x7cca('0x22')]()['then'](function(){_0x31baf4[_0x7cca('0x19')](0xcc)[_0x7cca('0x23')]();});}};}function handleEntityNotFound(_0x4367f9,_0x119d76){return function(_0x823d7d){if(!_0x823d7d){_0x4367f9[_0x7cca('0x18')](0x194);}return _0x823d7d;};}function handleError(_0x1bf169,_0xaf9264){_0xaf9264=_0xaf9264||0x1f4;return function(_0x4b99b6){logger[_0x7cca('0x24')](_0x4b99b6[_0x7cca('0x25')]);if(_0x4b99b6[_0x7cca('0x26')]){delete _0x4b99b6[_0x7cca('0x26')];}_0x1bf169[_0x7cca('0x19')](_0xaf9264)[_0x7cca('0x27')](_0x4b99b6);};}exports[_0x7cca('0x28')]=function(_0x40ac86,_0x583846){var _0x2cafe1={},_0x5c8410={},_0xc86c1b={'count':0x0,'rows':[]};var _0x201fbb=db['SmsTransferReport'][_0x7cca('0x29')];_0x5c8410[_0x7cca('0x2a')]=_['keys'](_0x201fbb);_0x5c8410[_0x7cca('0x2b')]=_[_0x7cca('0x2c')](_0x40ac86[_0x7cca('0x2b')]);_0x5c8410['filters']=_['intersection'](_0x5c8410[_0x7cca('0x2a')],_0x5c8410[_0x7cca('0x2b')]);_0x2cafe1[_0x7cca('0x2d')]=_[_0x7cca('0x2e')](_0x5c8410[_0x7cca('0x2a')],qs[_0x7cca('0x2f')](_0x40ac86[_0x7cca('0x2b')]['fields']));_0x2cafe1['attributes']=_0x2cafe1[_0x7cca('0x2d')][_0x7cca('0x30')]?_0x2cafe1[_0x7cca('0x2d')]:_0x5c8410['model'];if(!_0x40ac86[_0x7cca('0x2b')]['hasOwnProperty'](_0x7cca('0x31'))){_0x2cafe1[_0x7cca('0x1c')]=qs[_0x7cca('0x1c')](_0x40ac86[_0x7cca('0x2b')]['limit']);_0x2cafe1[_0x7cca('0x1b')]=qs[_0x7cca('0x1b')](_0x40ac86[_0x7cca('0x2b')]['offset']);}_0x2cafe1['order']=qs['sort'](_0x40ac86[_0x7cca('0x2b')][_0x7cca('0x32')]);_0x2cafe1['where']=qs[_0x7cca('0x33')](_[_0x7cca('0x34')](_0x40ac86[_0x7cca('0x2b')],_0x5c8410[_0x7cca('0x33')]));if(_0x40ac86[_0x7cca('0x2b')][_0x7cca('0x35')]){_0x2cafe1[_0x7cca('0x36')]=_['merge'](_0x2cafe1[_0x7cca('0x36')],{'$or':_[_0x7cca('0x37')](_0x201fbb,function(_0x4128e5){if(_0x4128e5[_0x7cca('0x38')]['key']!==_0x7cca('0x39')){var _0x387287={};_0x387287[_0x4128e5[_0x7cca('0x3a')]]={'$like':'%'+_0x40ac86['query'][_0x7cca('0x35')]+'%'};return _0x387287;}})});}_0x2cafe1=_['merge']({},_0x2cafe1,_0x40ac86[_0x7cca('0x3b')]);var _0x2d8884={'where':_0x2cafe1[_0x7cca('0x36')]};return db[_0x7cca('0x3c')][_0x7cca('0x3d')](_0x2d8884)[_0x7cca('0x21')](function(_0x18076e){_0xc86c1b[_0x7cca('0x3d')]=_0x18076e;if(_0x40ac86[_0x7cca('0x2b')]['includeAll']){_0x2cafe1['include']=[{'all':!![]}];}return db[_0x7cca('0x3c')][_0x7cca('0x3e')](_0x2cafe1);})['then'](function(_0x48d87f){_0xc86c1b[_0x7cca('0x3f')]=_0x48d87f;return _0xc86c1b;})[_0x7cca('0x21')](respondWithFilteredResult(_0x583846,_0x2cafe1))[_0x7cca('0x40')](handleError(_0x583846,null));};exports[_0x7cca('0x41')]=function(_0x371c67,_0x4cd159){var _0x117bd7={'raw':!![],'where':{'id':_0x371c67['params']['id']}},_0x5ee9e7={};_0x5ee9e7[_0x7cca('0x2a')]=_[_0x7cca('0x2c')](db['SmsTransferReport'][_0x7cca('0x29')]);_0x5ee9e7['query']=_[_0x7cca('0x2c')](_0x371c67[_0x7cca('0x2b')]);_0x5ee9e7[_0x7cca('0x33')]=_['intersection'](_0x5ee9e7[_0x7cca('0x2a')],_0x5ee9e7[_0x7cca('0x2b')]);_0x117bd7[_0x7cca('0x2d')]=_[_0x7cca('0x2e')](_0x5ee9e7['model'],qs[_0x7cca('0x2f')](_0x371c67[_0x7cca('0x2b')][_0x7cca('0x2f')]));_0x117bd7[_0x7cca('0x2d')]=_0x117bd7[_0x7cca('0x2d')][_0x7cca('0x30')]?_0x117bd7['attributes']:_0x5ee9e7['model'];if(_0x371c67['query']['includeAll']){_0x117bd7[_0x7cca('0x42')]=[{'all':!![]}];}_0x117bd7=_['merge']({},_0x117bd7,_0x371c67['options']);return db[_0x7cca('0x3c')][_0x7cca('0x43')](_0x117bd7)[_0x7cca('0x21')](handleEntityNotFound(_0x4cd159,null))[_0x7cca('0x21')](respondWithResult(_0x4cd159,null))[_0x7cca('0x40')](handleError(_0x4cd159,null));};exports['create']=function(_0x2439b1,_0x345182){return db[_0x7cca('0x3c')][_0x7cca('0x44')](_0x2439b1[_0x7cca('0x45')],{})[_0x7cca('0x21')](respondWithResult(_0x345182,0xc9))[_0x7cca('0x40')](handleError(_0x345182,null));};exports[_0x7cca('0x20')]=function(_0x20458d,_0x1e9a9a){if(_0x20458d[_0x7cca('0x45')]['id']){delete _0x20458d['body']['id'];}return db['SmsTransferReport'][_0x7cca('0x43')]({'where':{'id':_0x20458d[_0x7cca('0x46')]['id']}})[_0x7cca('0x21')](handleEntityNotFound(_0x1e9a9a,null))[_0x7cca('0x21')](saveUpdates(_0x20458d[_0x7cca('0x45')],null))[_0x7cca('0x21')](respondWithResult(_0x1e9a9a,null))[_0x7cca('0x40')](handleError(_0x1e9a9a,null));};exports[_0x7cca('0x22')]=function(_0x184b56,_0xe0059e){return db[_0x7cca('0x3c')][_0x7cca('0x43')]({'where':{'id':_0x184b56['params']['id']}})[_0x7cca('0x21')](handleEntityNotFound(_0xe0059e,null))[_0x7cca('0x21')](removeEntity(_0xe0059e,null))[_0x7cca('0x40')](handleError(_0xe0059e,null));};exports[_0x7cca('0x47')]=function(_0x182ee5,_0x41b932){return db[_0x7cca('0x3c')][_0x7cca('0x47')]()[_0x7cca('0x21')](respondWithResult(_0x41b932,null))[_0x7cca('0x40')](handleError(_0x41b932,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index cfc7070..90b9ccb 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 _0xfa11=['request-promise','path','rimraf','../../config/environment','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2b48d0,_0x52f44a){var _0x589882=function(_0x48dbe2){while(--_0x48dbe2){_0x2b48d0['push'](_0x2b48d0['shift']());}};_0x589882(++_0x52f44a);}(_0xfa11,0x15a));var _0x1fa1=function(_0x27b7dc,_0x283c3a){_0x27b7dc=_0x27b7dc-0x0;var _0x3c0e62=_0xfa11[_0x27b7dc];return _0x3c0e62;};'use strict';var _=require(_0x1fa1('0x0'));var util=require(_0x1fa1('0x1'));var logger=require(_0x1fa1('0x2'))(_0x1fa1('0x3'));var moment=require(_0x1fa1('0x4'));var BPromise=require(_0x1fa1('0x5'));var rp=require(_0x1fa1('0x6'));var fs=require('fs');var path=require(_0x1fa1('0x7'));var rimraf=require(_0x1fa1('0x8'));var config=require(_0x1fa1('0x9'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x55b28b,_0x3bef4f){return _0x55b28b['define']('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1fa1('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x262e=['path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','SmsTransferReport','report_sms_transfer','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x4611a0,_0x16bfd0){var _0xedbcb=function(_0x11a48b){while(--_0x11a48b){_0x4611a0['push'](_0x4611a0['shift']());}};_0xedbcb(++_0x16bfd0);}(_0x262e,0xb0));var _0xe262=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x262e[_0x173441];return _0x2423a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe262('0x0'))(_0xe262('0x1'));var moment=require(_0xe262('0x2'));var BPromise=require(_0xe262('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe262('0x4'));var rimraf=require(_0xe262('0x5'));var config=require(_0xe262('0x6'));var attributes=require(_0xe262('0x7'));module[_0xe262('0x8')]=function(_0x9e50ed,_0xaf50f9){return _0x9e50ed['define'](_0xe262('0x9'),attributes,{'tableName':_0xe262('0xa'),'paranoid':![],'indexes':[{'name':_0xe262('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 72f24ab..cc5dad0 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 _0x44fe=['debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x44fe,0x16f));var _0xe44f=function(_0x58323a,_0x3abb85){_0x58323a=_0x58323a-0x0;var _0x49e909=_0x44fe[_0x58323a];return _0x49e909;};'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('jayson/promise');var client=jayson['client'][_0xe44f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18320f,_0x5c5234,_0x1a4e3b){return new BPromise(function(_0x34e4d5,_0x110de4){return client[_0xe44f('0xc')](_0x18320f,_0x1a4e3b)[_0xe44f('0xd')](function(_0x481156){logger[_0xe44f('0xe')](_0xe44f('0xf'),_0x5c5234,_0xe44f('0x10'));logger[_0xe44f('0x11')](_0xe44f('0x12'),_0x5c5234,_0xe44f('0x10'),JSON[_0xe44f('0x13')](_0x481156));if(_0x481156[_0xe44f('0x14')]){if(_0x481156[_0xe44f('0x14')]['code']===0x1f4){logger[_0xe44f('0x14')](_0xe44f('0xf'),_0x5c5234,_0x481156['error'][_0xe44f('0x15')]);return _0x110de4(_0x481156[_0xe44f('0x14')][_0xe44f('0x15')]);}logger[_0xe44f('0x14')](_0xe44f('0xf'),_0x5c5234,_0x481156[_0xe44f('0x14')][_0xe44f('0x15')]);return _0x34e4d5(_0x481156[_0xe44f('0x14')]['message']);}else{logger[_0xe44f('0xe')](_0xe44f('0xf'),_0x5c5234,_0xe44f('0x10'));_0x34e4d5(_0x481156[_0xe44f('0x16')][_0xe44f('0x15')]);}})[_0xe44f('0x17')](function(_0x3ee3f9){logger[_0xe44f('0x14')](_0xe44f('0xf'),_0x5c5234,_0x3ee3f9);_0x110de4(_0x3ee3f9);});});} \ No newline at end of file +var _0xbc36=['info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0xe09704,_0x72987b){var _0x402de0=function(_0xe7e90f){while(--_0xe7e90f){_0xe09704['push'](_0xe09704['shift']());}};_0x402de0(++_0x72987b);}(_0xbc36,0x169));var _0x6bc3=function(_0x4a81ac,_0x278ea2){_0x4a81ac=_0x4a81ac-0x0;var _0x105f67=_0xbc36[_0x4a81ac];return _0x105f67;};'use strict';var _=require(_0x6bc3('0x0'));var util=require('util');var moment=require(_0x6bc3('0x1'));var BPromise=require(_0x6bc3('0x2'));var rs=require(_0x6bc3('0x3'));var fs=require('fs');var Redis=require(_0x6bc3('0x4'));var db=require(_0x6bc3('0x5'))['db'];var utils=require(_0x6bc3('0x6'));var logger=require(_0x6bc3('0x7'))(_0x6bc3('0x8'));var config=require(_0x6bc3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6bc3('0xa')][_0x6bc3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5584a5,_0x33e11c,_0x1f894a){return new BPromise(function(_0xf07594,_0x4de32d){return client[_0x6bc3('0xc')](_0x5584a5,_0x1f894a)[_0x6bc3('0xd')](function(_0x33e8e0){logger[_0x6bc3('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x33e11c,_0x6bc3('0xf'));logger[_0x6bc3('0x10')](_0x6bc3('0x11'),_0x33e11c,_0x6bc3('0xf'),JSON[_0x6bc3('0x12')](_0x33e8e0));if(_0x33e8e0[_0x6bc3('0x13')]){if(_0x33e8e0[_0x6bc3('0x13')][_0x6bc3('0x14')]===0x1f4){logger[_0x6bc3('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0x33e11c,_0x33e8e0[_0x6bc3('0x13')]['message']);return _0x4de32d(_0x33e8e0[_0x6bc3('0x13')]['message']);}logger[_0x6bc3('0x13')](_0x6bc3('0x15'),_0x33e11c,_0x33e8e0['error'][_0x6bc3('0x16')]);return _0xf07594(_0x33e8e0['error']['message']);}else{logger[_0x6bc3('0xe')](_0x6bc3('0x15'),_0x33e11c,_0x6bc3('0xf'));_0xf07594(_0x33e8e0[_0x6bc3('0x17')][_0x6bc3('0x16')]);}})[_0x6bc3('0x18')](function(_0xa1782){logger['error'](_0x6bc3('0x15'),_0x33e11c,_0xa1782);_0x4de32d(_0xa1782);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 5efb93a..d98498a 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 _0x2f48=['/:id','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','download','diskStorage','server/files/sounds/original/','originalname','format','basename','now','extname','post','single','file','create','put','delete'];(function(_0xb6afe,_0x38671f){var _0x335218=function(_0x325284){while(--_0x325284){_0xb6afe['push'](_0xb6afe['shift']());}};_0x335218(++_0x38671f);}(_0x2f48,0x1bb));var _0x82f4=function(_0x4ec993,_0x4d9dc0){_0x4ec993=_0x4ec993-0x0;var _0x1d3d33=_0x2f48[_0x4ec993];return _0x1d3d33;};'use strict';var multer=require(_0x82f4('0x0'));var util=require(_0x82f4('0x1'));var path=require(_0x82f4('0x2'));var timeout=require(_0x82f4('0x3'));var express=require(_0x82f4('0x4'));var router=express[_0x82f4('0x5')]();var auth=require(_0x82f4('0x6'));var interaction=require(_0x82f4('0x7'));var config=require('../../config/environment');var controller=require('./sound.controller');router['get']('/',auth[_0x82f4('0x8')](),controller[_0x82f4('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x82f4('0xa')]('/:id/download',auth[_0x82f4('0x8')](),controller[_0x82f4('0xb')]);var upload=multer({'storage':multer[_0x82f4('0xc')]({'destination':function(_0x26486,_0x5a3334,_0x171bf3){_0x171bf3(null,path['join'](config['root'],_0x82f4('0xd')));},'filename':function(_0x2007d1,_0x4246b2,_0x2966){_0x4246b2[_0x82f4('0xe')]=_0x4246b2[_0x82f4('0xe')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2966(null,util[_0x82f4('0xf')]('%s-%s%s',path[_0x82f4('0x10')](_0x4246b2[_0x82f4('0xe')],path['extname'](_0x4246b2[_0x82f4('0xe')])),Date[_0x82f4('0x11')](),path[_0x82f4('0x12')](_0x4246b2['originalname'])));}})});router[_0x82f4('0x13')]('/',upload[_0x82f4('0x14')](_0x82f4('0x15')),controller[_0x82f4('0x16')]);router[_0x82f4('0x17')]('/:id',auth[_0x82f4('0x8')](),controller['update']);router[_0x82f4('0x18')](_0x82f4('0x19'),auth['isAuthenticated'](),controller[_0x82f4('0x18')]);module['exports']=router; \ No newline at end of file +var _0x56f0=['get','isAuthenticated','index','show','/:id/download','download','diskStorage','join','originalname','replace','%s-%s%s','now','post','single','file','create','put','/:id','update','exports','multer','util','express','../../config/environment'];(function(_0x4eb58e,_0x34054c){var _0x465d5b=function(_0x347563){while(--_0x347563){_0x4eb58e['push'](_0x4eb58e['shift']());}};_0x465d5b(++_0x34054c);}(_0x56f0,0x74));var _0x056f=function(_0x193ab8,_0x38bd82){_0x193ab8=_0x193ab8-0x0;var _0xdfe5a3=_0x56f0[_0x193ab8];return _0xdfe5a3;};'use strict';var multer=require(_0x056f('0x0'));var util=require(_0x056f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x056f('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x056f('0x3'));var controller=require('./sound.controller');router[_0x056f('0x4')]('/',auth[_0x056f('0x5')](),controller[_0x056f('0x6')]);router[_0x056f('0x4')]('/:id',auth[_0x056f('0x5')](),controller[_0x056f('0x7')]);router[_0x056f('0x4')](_0x056f('0x8'),auth[_0x056f('0x5')](),controller[_0x056f('0x9')]);var upload=multer({'storage':multer[_0x056f('0xa')]({'destination':function(_0x41b7b5,_0x4b5b4e,_0x3dc067){_0x3dc067(null,path[_0x056f('0xb')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x645e35,_0x32b592,_0x5b3f59){_0x32b592['originalname']=_0x32b592[_0x056f('0xc')][_0x056f('0xd')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5b3f59(null,util['format'](_0x056f('0xe'),path['basename'](_0x32b592[_0x056f('0xc')],path['extname'](_0x32b592[_0x056f('0xc')])),Date[_0x056f('0xf')](),path['extname'](_0x32b592[_0x056f('0xc')])));}})});router[_0x056f('0x10')]('/',upload[_0x056f('0x11')](_0x056f('0x12')),controller[_0x056f('0x13')]);router[_0x056f('0x14')](_0x056f('0x15'),auth[_0x056f('0x5')](),controller[_0x056f('0x16')]);router['delete'](_0x056f('0x15'),auth[_0x056f('0x5')](),controller['delete']);module[_0x056f('0x17')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index b692583..c3ccf61 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 _0x4b7d=['FLOAT','sequelize','exports','STRING','name','BIGINT','INTEGER'];(function(_0x57e50b,_0x16e856){var _0x4a1016=function(_0x3db554){while(--_0x3db554){_0x57e50b['push'](_0x57e50b['shift']());}};_0x4a1016(++_0x16e856);}(_0x4b7d,0x182));var _0xd4b7=function(_0x485f7a,_0x27d4e4){_0x485f7a=_0x485f7a-0x0;var _0x438d88=_0x4b7d[_0x485f7a];return _0x438d88;};'use strict';var Sequelize=require(_0xd4b7('0x0'));module[_0xd4b7('0x1')]={'name':{'type':Sequelize[_0xd4b7('0x2')],'unique':_0xd4b7('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xd4b7('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xd4b7('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xd4b7('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xd4b7('0x5')]},'converted_format':{'type':Sequelize[_0xd4b7('0x2')]},'converted_duration':{'type':Sequelize[_0xd4b7('0x6')]},'converted_sampleCount':{'type':Sequelize[_0xd4b7('0x4')]},'converted_channelCount':{'type':Sequelize[_0xd4b7('0x5')]},'converted_bitRate':{'type':Sequelize[_0xd4b7('0x4')]},'converted_sampleRate':{'type':Sequelize[_0xd4b7('0x5')]}}; \ No newline at end of file +var _0x4308=['FLOAT','BIGINT','INTEGER','sequelize','exports','name','STRING'];(function(_0x11eb2a,_0x41c739){var _0x2ef973=function(_0x402ad5){while(--_0x402ad5){_0x11eb2a['push'](_0x11eb2a['shift']());}};_0x2ef973(++_0x41c739);}(_0x4308,0x145));var _0x8430=function(_0x25f1d6,_0x5d114d){_0x25f1d6=_0x25f1d6-0x0;var _0x463fc0=_0x4308[_0x25f1d6];return _0x463fc0;};'use strict';var Sequelize=require(_0x8430('0x0'));module[_0x8430('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8430('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x8430('0x3')]},'display_name':{'type':Sequelize[_0x8430('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0x8430('0x3')]},'original_format':{'type':Sequelize[_0x8430('0x3')]},'original_duration':{'type':Sequelize[_0x8430('0x4')]},'original_sampleCount':{'type':Sequelize[_0x8430('0x5')]},'original_channelCount':{'type':Sequelize[_0x8430('0x6')]},'original_bitRate':{'type':Sequelize[_0x8430('0x5')]},'original_sampleRate':{'type':Sequelize[_0x8430('0x6')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x8430('0x5')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x8430('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x8430('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index ec596b5..f5f1daa 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 _0xa3bb=['converted_format','existsSync','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','join','format','%s.%s','create','basename','file','originalname','filename','extname','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','error','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_sampleRate','body','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','send','delete','original_format','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','Content-Range','apply','reject','update','then','destroy','get','Sounds','UserProfileResource','sendStatus','stack','name','index','Sound','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','filter','merge','where','map','key','VIRTUAL','field','options','count','includeAll','findAll','catch','show','params','include','find','download','save_name'];(function(_0xb15db6,_0x388d94){var _0x1db34d=function(_0x309006){while(--_0x309006){_0xb15db6['push'](_0xb15db6['shift']());}};_0x1db34d(++_0x388d94);}(_0xa3bb,0xae));var _0xba3b=function(_0x44c71a,_0x3cb720){_0x44c71a=_0x44c71a-0x0;var _0x5e9b43=_0xa3bb[_0x44c71a];return _0x5e9b43;};'use strict';var pdf=require(_0xba3b('0x0'));var emlformat=require(_0xba3b('0x1'));var rimraf=require(_0xba3b('0x2'));var zipdir=require(_0xba3b('0x3'));var jsonpatch=require(_0xba3b('0x4'));var rp=require(_0xba3b('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xba3b('0x6'));var util=require(_0xba3b('0x7'));var path=require(_0xba3b('0x8'));var sox=require('sox');var csv=require(_0xba3b('0x9'));var ejs=require(_0xba3b('0xa'));var fs=require('fs');var _=require(_0xba3b('0xb'));var squel=require(_0xba3b('0xc'));var crypto=require(_0xba3b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xba3b('0xe'));var toCsv=require('to-csv');var querystring=require(_0xba3b('0xf'));var Papa=require('papaparse');var Redis=require(_0xba3b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xba3b('0x11'))('api');var utils=require(_0xba3b('0x12'));var config=require(_0xba3b('0x13'));var db=require(_0xba3b('0x14'))['db'];function respondWithStatusCode(_0x150ac5,_0xfc0b40){_0xfc0b40=_0xfc0b40||0xcc;return function(_0x398fb9){if(_0x398fb9){return _0x150ac5['sendStatus'](_0xfc0b40);}return _0x150ac5[_0xba3b('0x15')](_0xfc0b40)[_0xba3b('0x16')]();};}function respondWithResult(_0x22099b,_0x3d5a7a){_0x3d5a7a=_0x3d5a7a||0xc8;return function(_0x4567a1){if(_0x4567a1){return _0x22099b[_0xba3b('0x15')](_0x3d5a7a)[_0xba3b('0x17')](_0x4567a1);}};}function respondWithFilteredResult(_0x454c17,_0x5e0142){return function(_0x393ba4){if(_0x393ba4){var _0x3585a2=_0x393ba4['count'],_0x53b44c=_0x5e0142['offset'],_0x152eb6=_0x5e0142['offset']+_0x5e0142[_0xba3b('0x18')],_0x535ca1;if(_0x152eb6>=_0x3585a2){_0x152eb6=_0x3585a2;_0x535ca1=0xc8;}else{_0x535ca1=0xce;}_0x454c17['status'](_0x535ca1);return _0x454c17['set'](_0xba3b('0x19'),_0x53b44c+'-'+_0x152eb6+'/'+_0x3585a2)['json'](_0x393ba4);}return null;};}function patchUpdates(_0x4f5e31){return function(_0x182f45){try{jsonpatch[_0xba3b('0x1a')](_0x182f45,_0x4f5e31,!![]);}catch(_0x406c2b){return BPromise[_0xba3b('0x1b')](_0x406c2b);}return _0x182f45['save']();};}function saveUpdates(_0x30d3ba,_0x54ba75){return function(_0x28b4e4){if(_0x28b4e4){return _0x28b4e4[_0xba3b('0x1c')](_0x30d3ba)[_0xba3b('0x1d')](function(_0x1fd2f5){return _0x1fd2f5;});}return null;};}function removeEntity(_0x1f0fce,_0x2b8ef3){return function(_0x4bbc1b){if(_0x4bbc1b){return _0x4bbc1b[_0xba3b('0x1e')]()[_0xba3b('0x1d')](function(){var _0x3215e9=_0x4bbc1b[_0xba3b('0x1f')]({'plain':!![]});var _0x54e0e2=_0xba3b('0x20');return db[_0xba3b('0x21')][_0xba3b('0x1e')]({'where':{'type':_0x54e0e2,'resourceId':_0x3215e9['id']}})['then'](function(){return _0x4bbc1b;});})['then'](function(){_0x1f0fce[_0xba3b('0x15')](0xcc)[_0xba3b('0x16')]();});}};}function handleEntityNotFound(_0x91e5f7,_0x304137){return function(_0x55adb9){if(!_0x55adb9){_0x91e5f7[_0xba3b('0x22')](0x194);}return _0x55adb9;};}function handleError(_0x3ea053,_0x21815d){_0x21815d=_0x21815d||0x1f4;return function(_0x147472){logger['error'](_0x147472[_0xba3b('0x23')]);if(_0x147472[_0xba3b('0x24')]){delete _0x147472[_0xba3b('0x24')];}_0x3ea053[_0xba3b('0x15')](_0x21815d)['send'](_0x147472);};}exports[_0xba3b('0x25')]=function(_0xfac064,_0x28374d){var _0x64325d={},_0x219633={},_0x2d9812={'count':0x0,'rows':[]};var _0x33ef11=db[_0xba3b('0x26')][_0xba3b('0x27')];_0x219633[_0xba3b('0x28')]=_[_0xba3b('0x29')](_0x33ef11);_0x219633[_0xba3b('0x2a')]=_[_0xba3b('0x29')](_0xfac064[_0xba3b('0x2a')]);_0x219633[_0xba3b('0x2b')]=_[_0xba3b('0x2c')](_0x219633['model'],_0x219633[_0xba3b('0x2a')]);_0x64325d[_0xba3b('0x2d')]=_[_0xba3b('0x2c')](_0x219633[_0xba3b('0x28')],qs[_0xba3b('0x2e')](_0xfac064[_0xba3b('0x2a')][_0xba3b('0x2e')]));_0x64325d[_0xba3b('0x2d')]=_0x64325d['attributes'][_0xba3b('0x2f')]?_0x64325d['attributes']:_0x219633[_0xba3b('0x28')];if(!_0xfac064[_0xba3b('0x2a')][_0xba3b('0x30')](_0xba3b('0x31'))){_0x64325d['limit']=qs['limit'](_0xfac064['query'][_0xba3b('0x18')]);_0x64325d[_0xba3b('0x32')]=qs[_0xba3b('0x32')](_0xfac064['query'][_0xba3b('0x32')]);}_0x64325d['order']=qs[_0xba3b('0x33')](_0xfac064[_0xba3b('0x2a')]['sort']);_0x64325d['where']=qs[_0xba3b('0x2b')](_['pick'](_0xfac064[_0xba3b('0x2a')],_0x219633['filters']));if(_0xfac064[_0xba3b('0x2a')][_0xba3b('0x34')]){_0x64325d['where']=_[_0xba3b('0x35')](_0x64325d[_0xba3b('0x36')],{'$or':_[_0xba3b('0x37')](_0x33ef11,function(_0x208c6e){if(_0x208c6e['type'][_0xba3b('0x38')]!==_0xba3b('0x39')){var _0x7f3aac={};_0x7f3aac[_0x208c6e[_0xba3b('0x3a')]]={'$like':'%'+_0xfac064[_0xba3b('0x2a')]['filter']+'%'};return _0x7f3aac;}})});}_0x64325d=_[_0xba3b('0x35')]({},_0x64325d,_0xfac064[_0xba3b('0x3b')]);var _0x53acf4={'where':_0x64325d[_0xba3b('0x36')]};return db[_0xba3b('0x26')]['count'](_0x53acf4)[_0xba3b('0x1d')](function(_0x774367){_0x2d9812[_0xba3b('0x3c')]=_0x774367;if(_0xfac064['query'][_0xba3b('0x3d')]){_0x64325d['include']=[{'all':!![]}];}return db['Sound'][_0xba3b('0x3e')](_0x64325d);})[_0xba3b('0x1d')](function(_0x3e6a9c){_0x2d9812['rows']=_0x3e6a9c;return _0x2d9812;})['then'](respondWithFilteredResult(_0x28374d,_0x64325d))[_0xba3b('0x3f')](handleError(_0x28374d,null));};exports[_0xba3b('0x40')]=function(_0x203c8b,_0x23c235){var _0x3e5140={'raw':!![],'where':{'id':_0x203c8b[_0xba3b('0x41')]['id']}},_0x19aa6d={};_0x19aa6d[_0xba3b('0x28')]=_[_0xba3b('0x29')](db[_0xba3b('0x26')][_0xba3b('0x27')]);_0x19aa6d[_0xba3b('0x2a')]=_[_0xba3b('0x29')](_0x203c8b['query']);_0x19aa6d[_0xba3b('0x2b')]=_[_0xba3b('0x2c')](_0x19aa6d['model'],_0x19aa6d[_0xba3b('0x2a')]);_0x3e5140[_0xba3b('0x2d')]=_[_0xba3b('0x2c')](_0x19aa6d[_0xba3b('0x28')],qs['fields'](_0x203c8b[_0xba3b('0x2a')][_0xba3b('0x2e')]));_0x3e5140['attributes']=_0x3e5140[_0xba3b('0x2d')][_0xba3b('0x2f')]?_0x3e5140[_0xba3b('0x2d')]:_0x19aa6d[_0xba3b('0x28')];if(_0x203c8b[_0xba3b('0x2a')][_0xba3b('0x3d')]){_0x3e5140[_0xba3b('0x42')]=[{'all':!![]}];}_0x3e5140=_[_0xba3b('0x35')]({},_0x3e5140,_0x203c8b['options']);return db[_0xba3b('0x26')][_0xba3b('0x43')](_0x3e5140)[_0xba3b('0x1d')](handleEntityNotFound(_0x23c235,null))['then'](respondWithResult(_0x23c235,null))[_0xba3b('0x3f')](handleError(_0x23c235,null));};exports[_0xba3b('0x44')]=function(_0x4ca184,_0x12a0bd,_0x5ba5df){return db[_0xba3b('0x26')]['find']({'where':{'id':_0x4ca184['params']['id']},'attributes':[_0xba3b('0x24'),_0xba3b('0x45'),_0xba3b('0x46')],'raw':!![]})[_0xba3b('0x1d')](handleEntityNotFound(_0x12a0bd,null))[_0xba3b('0x1d')](function(_0x573e36){if(_0x573e36){if(!fs[_0xba3b('0x47')](path['join'](config[_0xba3b('0x48')],_0xba3b('0x49'),_0x573e36['save_name']+'.'+_0x573e36[_0xba3b('0x46')]))){throw new db[(_0xba3b('0x4a'))][(_0xba3b('0x4b'))](_0xba3b('0x4c'));}return _0x12a0bd[_0xba3b('0x44')](path[_0xba3b('0x4d')](config[_0xba3b('0x48')],_0xba3b('0x49'),util[_0xba3b('0x4e')](_0xba3b('0x4f'),_0x573e36[_0xba3b('0x45')],_0x573e36[_0xba3b('0x46')])),util[_0xba3b('0x4e')](_0xba3b('0x4f'),_0x573e36[_0xba3b('0x24')],_0x573e36[_0xba3b('0x46')]));}return null;})[_0xba3b('0x3f')](handleError(_0x12a0bd,null));};exports[_0xba3b('0x50')]=function(_0x274176,_0x531327,_0x315035){var _0x388554={'name':path[_0xba3b('0x51')](_0x274176[_0xba3b('0x52')][_0xba3b('0x53')],path['extname'](_0x274176[_0xba3b('0x52')]['originalname'])),'save_name':path[_0xba3b('0x51')](_0x274176[_0xba3b('0x52')][_0xba3b('0x54')],path[_0xba3b('0x55')](_0x274176[_0xba3b('0x52')][_0xba3b('0x54')])),'original_format':path[_0xba3b('0x55')](_0x274176[_0xba3b('0x52')]['originalname'])[_0xba3b('0x56')](0x1),'converted_format':_0xba3b('0x57')};var _0x90709b=path[_0xba3b('0x4d')](config[_0xba3b('0x48')],_0xba3b('0x58'),_0x274176[_0xba3b('0x52')][_0xba3b('0x54')]);var _0xaff873=path[_0xba3b('0x4d')](config[_0xba3b('0x48')],'server/files/sounds/converted',util[_0xba3b('0x4e')](_0xba3b('0x4f'),path[_0xba3b('0x51')](_0x274176[_0xba3b('0x52')][_0xba3b('0x54')],path[_0xba3b('0x55')](_0x274176['file'][_0xba3b('0x54')])),_0x388554['converted_format']));logger[_0xba3b('0x59')](_0xba3b('0x5a'),_0x90709b);logger['info'](_0xba3b('0x5b'),_0xaff873);try{fs[_0xba3b('0x5c')](_0x90709b,parseInt(_0xba3b('0x5d'),0x8));var _0x4b383c=sox[_0xba3b('0x5e')](_0x90709b,_0xaff873,{'sampleRate':0x1f40,'format':_0xba3b('0x57'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4b383c['on'](_0xba3b('0x5f'),function(_0x34fa07){fs[_0xba3b('0x60')](_0x90709b);_0x531327[_0xba3b('0x15')](0x1f4)['send'](_0x34fa07);});_0x4b383c['on'](_0xba3b('0x61'),function(_0x4027f4){_0x388554[_0xba3b('0x62')]=isNaN(_0x4027f4[_0xba3b('0x63')])?null:_0x4027f4['duration']*0x3e8;_0x388554[_0xba3b('0x64')]=isNaN(_0x4027f4[_0xba3b('0x65')])?null:_0x4027f4[_0xba3b('0x65')];_0x388554[_0xba3b('0x66')]=isNaN(_0x4027f4[_0xba3b('0x67')])?null:_0x4027f4[_0xba3b('0x67')];_0x388554[_0xba3b('0x68')]=isNaN(_0x4027f4[_0xba3b('0x69')])?null:_0x4027f4['bitRate'];_0x388554[_0xba3b('0x6a')]=isNaN(_0x4027f4['sampleRate'])?null:_0x4027f4[_0xba3b('0x6b')];});_0x4b383c['on'](_0xba3b('0x6c'),function(_0x23f1a3){_0x388554[_0xba3b('0x6d')]=isNaN(_0x23f1a3[_0xba3b('0x63')])?null:_0x23f1a3['duration']*0x3e8;_0x388554['converted_sampleCount']=isNaN(_0x23f1a3['sampleCount'])?null:_0x23f1a3[_0xba3b('0x65')];_0x388554[_0xba3b('0x6e')]=isNaN(_0x23f1a3[_0xba3b('0x67')])?null:_0x23f1a3[_0xba3b('0x67')];_0x388554['converted_bitRate']=isNaN(_0x23f1a3[_0xba3b('0x69')])?null:_0x23f1a3[_0xba3b('0x69')];_0x388554[_0xba3b('0x6f')]=isNaN(_0x23f1a3[_0xba3b('0x6b')])?null:_0x23f1a3[_0xba3b('0x6b')];});_0x4b383c['on']('end',function(){fs[_0xba3b('0x5c')](_0xaff873,parseInt(_0xba3b('0x5d'),0x8));return db[_0xba3b('0x26')]['create'](_0x388554)[_0xba3b('0x1d')](function(_0x464795){var _0x514430={'role':_0x274176[_0xba3b('0x70')][_0xba3b('0x71')],'userProfileId':_0x274176[_0xba3b('0x70')]['userProfileId']};if(!_0x514430)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x514430[_0xba3b('0x71')]==='user'){var _0x140d7a=_0x464795[_0xba3b('0x1f')]({'plain':!![]});return db[_0xba3b('0x72')]['find']({'where':{'name':'Sounds','userProfileId':_0x514430[_0xba3b('0x73')]},'raw':!![]})['then'](function(_0x5065ae){if(_0x5065ae&&_0x5065ae[_0xba3b('0x74')]===0x0){return db[_0xba3b('0x21')][_0xba3b('0x50')]({'name':_0x140d7a[_0xba3b('0x24')],'resourceId':_0x140d7a['id'],'type':_0x5065ae[_0xba3b('0x24')],'sectionId':_0x5065ae['id']},{})[_0xba3b('0x1d')](function(){return _0x464795;});}else{return _0x464795;}})[_0xba3b('0x3f')](function(_0xc14f38){logger['error'](_0xba3b('0x75'),_0xc14f38);throw _0xc14f38;});}return _0x464795;})[_0xba3b('0x1d')](respondWithResult(_0x531327,null))[_0xba3b('0x3f')](handleError(_0x531327,null));});_0x4b383c[_0xba3b('0x76')]();}catch(_0x193bb8){_0x531327['status'](0x1f4)[_0xba3b('0x77')](_0x193bb8);}};exports['update']=function(_0x640daa,_0x43dd85,_0x2ec299){return db[_0xba3b('0x26')]['find']({'where':{'id':_0x640daa['params']['id']}})[_0xba3b('0x1d')](handleEntityNotFound(_0x43dd85,null))[_0xba3b('0x1d')](saveUpdates(_['pick'](_0x640daa[_0xba3b('0x70')],[_0xba3b('0x24'),'description']),null))['then'](respondWithResult(_0x43dd85,null))[_0xba3b('0x3f')](handleError(_0x43dd85,null));};exports[_0xba3b('0x78')]=function(_0x494524,_0x37b65b,_0x1ce121){return db[_0xba3b('0x26')][_0xba3b('0x43')]({'where':{'id':_0x494524[_0xba3b('0x41')]['id']}})[_0xba3b('0x1d')](function(_0x877bc7){if(_0x877bc7){return _0x877bc7[_0xba3b('0x1e')]();}})['then'](function(_0x359d35){var _0x39736e=path[_0xba3b('0x4d')](config[_0xba3b('0x48')],_0xba3b('0x58'),util[_0xba3b('0x4e')](_0xba3b('0x4f'),_0x359d35['save_name'],_0x359d35[_0xba3b('0x79')]));var _0x58500c=path[_0xba3b('0x4d')](config[_0xba3b('0x48')],_0xba3b('0x49'),util[_0xba3b('0x4e')]('%s.%s',_0x359d35[_0xba3b('0x45')],_0x359d35[_0xba3b('0x46')]));fs[_0xba3b('0x60')](_0x39736e);fs[_0xba3b('0x60')](_0x58500c);return _0x359d35;})['then'](function(_0x42fb00){if(_0x42fb00){return _0x37b65b[_0xba3b('0x15')](0xcc)['end']();}})[_0xba3b('0x1d')](handleEntityNotFound(_0x37b65b,null))[_0xba3b('0x3f')](handleError(_0x37b65b,null));}; \ No newline at end of file +var _0xe2fd=['error','stack','name','send','index','Sound','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','nolimit','limit','offset','sort','where','pick','filter','merge','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','find','download','save_name','existsSync','join','root','server/files/sounds/converted','converted_format','Sequelize','format','%s.%s','catch','create','basename','file','originalname','filename','extname','wav','server/files/sounds/original','info','0777','transcode','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleRate','chmodSync','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','html-pdf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','json','reject','update','then','destroy','Sounds'];(function(_0x491154,_0x451261){var _0x1c1001=function(_0x25dc62){while(--_0x25dc62){_0x491154['push'](_0x491154['shift']());}};_0x1c1001(++_0x451261);}(_0xe2fd,0x1b6));var _0xde2f=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xe2fd[_0xbd08b4];return _0x314f1e;};'use strict';var pdf=require(_0xde2f('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xde2f('0x1'));var rp=require(_0xde2f('0x2'));var moment=require(_0xde2f('0x3'));var BPromise=require(_0xde2f('0x4'));var Mustache=require('mustache');var util=require(_0xde2f('0x5'));var path=require(_0xde2f('0x6'));var sox=require(_0xde2f('0x7'));var csv=require('to-csv');var ejs=require(_0xde2f('0x8'));var fs=require('fs');var _=require(_0xde2f('0x9'));var squel=require(_0xde2f('0xa'));var crypto=require(_0xde2f('0xb'));var jsforce=require(_0xde2f('0xc'));var deskjs=require(_0xde2f('0xd'));var toCsv=require(_0xde2f('0xe'));var querystring=require(_0xde2f('0xf'));var Papa=require('papaparse');var Redis=require(_0xde2f('0x10'));var authService=require(_0xde2f('0x11'));var qs=require(_0xde2f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xde2f('0x13'))(_0xde2f('0x14'));var utils=require(_0xde2f('0x15'));var config=require(_0xde2f('0x16'));var db=require(_0xde2f('0x17'))['db'];function respondWithStatusCode(_0x555ca1,_0x29d64e){_0x29d64e=_0x29d64e||0xcc;return function(_0x31256d){if(_0x31256d){return _0x555ca1[_0xde2f('0x18')](_0x29d64e);}return _0x555ca1[_0xde2f('0x19')](_0x29d64e)[_0xde2f('0x1a')]();};}function respondWithResult(_0x199c27,_0x34e488){_0x34e488=_0x34e488||0xc8;return function(_0x5d3ecf){if(_0x5d3ecf){return _0x199c27['status'](_0x34e488)['json'](_0x5d3ecf);}};}function respondWithFilteredResult(_0x32d52e,_0x21fbb0){return function(_0xfb9ce2){if(_0xfb9ce2){var _0x35e6f9=_0xfb9ce2[_0xde2f('0x1b')],_0x2cb0f1=_0x21fbb0['offset'],_0x19666b=_0x21fbb0['offset']+_0x21fbb0['limit'],_0x58fc33;if(_0x19666b>=_0x35e6f9){_0x19666b=_0x35e6f9;_0x58fc33=0xc8;}else{_0x58fc33=0xce;}_0x32d52e[_0xde2f('0x19')](_0x58fc33);return _0x32d52e['set']('Content-Range',_0x2cb0f1+'-'+_0x19666b+'/'+_0x35e6f9)[_0xde2f('0x1c')](_0xfb9ce2);}return null;};}function patchUpdates(_0x194933){return function(_0x111cd2){try{jsonpatch['apply'](_0x111cd2,_0x194933,!![]);}catch(_0x2fcadf){return BPromise[_0xde2f('0x1d')](_0x2fcadf);}return _0x111cd2['save']();};}function saveUpdates(_0x3cfbdd,_0x3ef1eb){return function(_0x34b16e){if(_0x34b16e){return _0x34b16e[_0xde2f('0x1e')](_0x3cfbdd)[_0xde2f('0x1f')](function(_0x37b6cb){return _0x37b6cb;});}return null;};}function removeEntity(_0x11a273,_0x400c60){return function(_0x2b381f){if(_0x2b381f){return _0x2b381f[_0xde2f('0x20')]()[_0xde2f('0x1f')](function(){var _0x170c71=_0x2b381f['get']({'plain':!![]});var _0x1c468c=_0xde2f('0x21');return db['UserProfileResource'][_0xde2f('0x20')]({'where':{'type':_0x1c468c,'resourceId':_0x170c71['id']}})['then'](function(){return _0x2b381f;});})[_0xde2f('0x1f')](function(){_0x11a273[_0xde2f('0x19')](0xcc)[_0xde2f('0x1a')]();});}};}function handleEntityNotFound(_0x1478f5,_0x6839a5){return function(_0x53cba3){if(!_0x53cba3){_0x1478f5[_0xde2f('0x18')](0x194);}return _0x53cba3;};}function handleError(_0x26aa7a,_0x26662f){_0x26662f=_0x26662f||0x1f4;return function(_0x7ebd95){logger[_0xde2f('0x22')](_0x7ebd95[_0xde2f('0x23')]);if(_0x7ebd95[_0xde2f('0x24')]){delete _0x7ebd95[_0xde2f('0x24')];}_0x26aa7a[_0xde2f('0x19')](_0x26662f)[_0xde2f('0x25')](_0x7ebd95);};}exports[_0xde2f('0x26')]=function(_0x309208,_0xdecc4){var _0x256d63={},_0x4b1def={},_0x4a5c72={'count':0x0,'rows':[]};var _0x27dc03=db[_0xde2f('0x27')][_0xde2f('0x28')];_0x4b1def[_0xde2f('0x29')]=_[_0xde2f('0x2a')](_0x27dc03);_0x4b1def['query']=_[_0xde2f('0x2a')](_0x309208['query']);_0x4b1def[_0xde2f('0x2b')]=_[_0xde2f('0x2c')](_0x4b1def[_0xde2f('0x29')],_0x4b1def[_0xde2f('0x2d')]);_0x256d63[_0xde2f('0x2e')]=_[_0xde2f('0x2c')](_0x4b1def[_0xde2f('0x29')],qs[_0xde2f('0x2f')](_0x309208[_0xde2f('0x2d')]['fields']));_0x256d63['attributes']=_0x256d63[_0xde2f('0x2e')][_0xde2f('0x30')]?_0x256d63[_0xde2f('0x2e')]:_0x4b1def[_0xde2f('0x29')];if(!_0x309208[_0xde2f('0x2d')]['hasOwnProperty'](_0xde2f('0x31'))){_0x256d63[_0xde2f('0x32')]=qs[_0xde2f('0x32')](_0x309208[_0xde2f('0x2d')]['limit']);_0x256d63[_0xde2f('0x33')]=qs['offset'](_0x309208['query'][_0xde2f('0x33')]);}_0x256d63['order']=qs[_0xde2f('0x34')](_0x309208[_0xde2f('0x2d')][_0xde2f('0x34')]);_0x256d63[_0xde2f('0x35')]=qs['filters'](_[_0xde2f('0x36')](_0x309208[_0xde2f('0x2d')],_0x4b1def[_0xde2f('0x2b')]));if(_0x309208[_0xde2f('0x2d')][_0xde2f('0x37')]){_0x256d63[_0xde2f('0x35')]=_[_0xde2f('0x38')](_0x256d63[_0xde2f('0x35')],{'$or':_['map'](_0x27dc03,function(_0x420e42){if(_0x420e42['type'][_0xde2f('0x39')]!==_0xde2f('0x3a')){var _0xb5c0be={};_0xb5c0be[_0x420e42[_0xde2f('0x3b')]]={'$like':'%'+_0x309208[_0xde2f('0x2d')]['filter']+'%'};return _0xb5c0be;}})});}_0x256d63=_[_0xde2f('0x38')]({},_0x256d63,_0x309208[_0xde2f('0x3c')]);var _0x128c79={'where':_0x256d63[_0xde2f('0x35')]};return db[_0xde2f('0x27')][_0xde2f('0x1b')](_0x128c79)[_0xde2f('0x1f')](function(_0xc2e6f7){_0x4a5c72[_0xde2f('0x1b')]=_0xc2e6f7;if(_0x309208['query'][_0xde2f('0x3d')]){_0x256d63[_0xde2f('0x3e')]=[{'all':!![]}];}return db['Sound'][_0xde2f('0x3f')](_0x256d63);})['then'](function(_0x2782a7){_0x4a5c72[_0xde2f('0x40')]=_0x2782a7;return _0x4a5c72;})[_0xde2f('0x1f')](respondWithFilteredResult(_0xdecc4,_0x256d63))['catch'](handleError(_0xdecc4,null));};exports[_0xde2f('0x41')]=function(_0x3c4c27,_0x12124d){var _0x389f3d={'raw':!![],'where':{'id':_0x3c4c27[_0xde2f('0x42')]['id']}},_0x35d371={};_0x35d371['model']=_['keys'](db[_0xde2f('0x27')][_0xde2f('0x28')]);_0x35d371['query']=_[_0xde2f('0x2a')](_0x3c4c27[_0xde2f('0x2d')]);_0x35d371[_0xde2f('0x2b')]=_[_0xde2f('0x2c')](_0x35d371[_0xde2f('0x29')],_0x35d371[_0xde2f('0x2d')]);_0x389f3d['attributes']=_[_0xde2f('0x2c')](_0x35d371[_0xde2f('0x29')],qs[_0xde2f('0x2f')](_0x3c4c27[_0xde2f('0x2d')][_0xde2f('0x2f')]));_0x389f3d[_0xde2f('0x2e')]=_0x389f3d[_0xde2f('0x2e')][_0xde2f('0x30')]?_0x389f3d['attributes']:_0x35d371['model'];if(_0x3c4c27[_0xde2f('0x2d')][_0xde2f('0x3d')]){_0x389f3d[_0xde2f('0x3e')]=[{'all':!![]}];}_0x389f3d=_['merge']({},_0x389f3d,_0x3c4c27['options']);return db['Sound'][_0xde2f('0x43')](_0x389f3d)['then'](handleEntityNotFound(_0x12124d,null))['then'](respondWithResult(_0x12124d,null))['catch'](handleError(_0x12124d,null));};exports[_0xde2f('0x44')]=function(_0x1eea26,_0x1cdfc2,_0xb87476){return db[_0xde2f('0x27')][_0xde2f('0x43')]({'where':{'id':_0x1eea26[_0xde2f('0x42')]['id']},'attributes':[_0xde2f('0x24'),_0xde2f('0x45'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x1cdfc2,null))[_0xde2f('0x1f')](function(_0x365129){if(_0x365129){if(!fs[_0xde2f('0x46')](path[_0xde2f('0x47')](config[_0xde2f('0x48')],_0xde2f('0x49'),_0x365129[_0xde2f('0x45')]+'.'+_0x365129[_0xde2f('0x4a')]))){throw new db[(_0xde2f('0x4b'))]['ValidationError']('Sound\x20not\x20found');}return _0x1cdfc2['download'](path['join'](config['root'],_0xde2f('0x49'),util[_0xde2f('0x4c')](_0xde2f('0x4d'),_0x365129['save_name'],_0x365129[_0xde2f('0x4a')])),util['format'](_0xde2f('0x4d'),_0x365129[_0xde2f('0x24')],_0x365129[_0xde2f('0x4a')]));}return null;})[_0xde2f('0x4e')](handleError(_0x1cdfc2,null));};exports[_0xde2f('0x4f')]=function(_0x5ebe7e,_0x2ae429,_0x48ed99){var _0x23fd01={'name':path[_0xde2f('0x50')](_0x5ebe7e[_0xde2f('0x51')][_0xde2f('0x52')],path['extname'](_0x5ebe7e[_0xde2f('0x51')][_0xde2f('0x52')])),'save_name':path['basename'](_0x5ebe7e[_0xde2f('0x51')][_0xde2f('0x53')],path[_0xde2f('0x54')](_0x5ebe7e[_0xde2f('0x51')][_0xde2f('0x53')])),'original_format':path[_0xde2f('0x54')](_0x5ebe7e['file'][_0xde2f('0x52')])['substring'](0x1),'converted_format':_0xde2f('0x55')};var _0x26a396=path[_0xde2f('0x47')](config['root'],_0xde2f('0x56'),_0x5ebe7e[_0xde2f('0x51')][_0xde2f('0x53')]);var _0x531181=path['join'](config[_0xde2f('0x48')],_0xde2f('0x49'),util[_0xde2f('0x4c')](_0xde2f('0x4d'),path[_0xde2f('0x50')](_0x5ebe7e[_0xde2f('0x51')][_0xde2f('0x53')],path[_0xde2f('0x54')](_0x5ebe7e[_0xde2f('0x51')][_0xde2f('0x53')])),_0x23fd01[_0xde2f('0x4a')]));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x26a396);logger[_0xde2f('0x57')]('Sound\x20upload\x20destination:\x20%s',_0x531181);try{fs['chmodSync'](_0x26a396,parseInt(_0xde2f('0x58'),0x8));var _0xcefdfa=sox[_0xde2f('0x59')](_0x26a396,_0x531181,{'sampleRate':0x1f40,'format':_0xde2f('0x55'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xcefdfa['on'](_0xde2f('0x22'),function(_0xc9834){fs[_0xde2f('0x5a')](_0x26a396);_0x2ae429[_0xde2f('0x19')](0x1f4)[_0xde2f('0x25')](_0xc9834);});_0xcefdfa['on'](_0xde2f('0x5b'),function(_0x4c8a49){_0x23fd01['original_duration']=isNaN(_0x4c8a49[_0xde2f('0x5c')])?null:_0x4c8a49[_0xde2f('0x5c')]*0x3e8;_0x23fd01[_0xde2f('0x5d')]=isNaN(_0x4c8a49[_0xde2f('0x5e')])?null:_0x4c8a49['sampleCount'];_0x23fd01[_0xde2f('0x5f')]=isNaN(_0x4c8a49[_0xde2f('0x60')])?null:_0x4c8a49['channelCount'];_0x23fd01[_0xde2f('0x61')]=isNaN(_0x4c8a49[_0xde2f('0x62')])?null:_0x4c8a49[_0xde2f('0x62')];_0x23fd01[_0xde2f('0x63')]=isNaN(_0x4c8a49[_0xde2f('0x64')])?null:_0x4c8a49['sampleRate'];});_0xcefdfa['on'](_0xde2f('0x65'),function(_0x1265d0){_0x23fd01['converted_duration']=isNaN(_0x1265d0[_0xde2f('0x5c')])?null:_0x1265d0[_0xde2f('0x5c')]*0x3e8;_0x23fd01['converted_sampleCount']=isNaN(_0x1265d0[_0xde2f('0x5e')])?null:_0x1265d0[_0xde2f('0x5e')];_0x23fd01['converted_channelCount']=isNaN(_0x1265d0[_0xde2f('0x60')])?null:_0x1265d0[_0xde2f('0x60')];_0x23fd01['converted_bitRate']=isNaN(_0x1265d0[_0xde2f('0x62')])?null:_0x1265d0[_0xde2f('0x62')];_0x23fd01[_0xde2f('0x66')]=isNaN(_0x1265d0[_0xde2f('0x64')])?null:_0x1265d0['sampleRate'];});_0xcefdfa['on'](_0xde2f('0x1a'),function(){fs[_0xde2f('0x67')](_0x531181,parseInt(_0xde2f('0x58'),0x8));return db[_0xde2f('0x27')][_0xde2f('0x4f')](_0x23fd01)[_0xde2f('0x1f')](function(_0x5b6a65){var _0xa32aef={'role':_0x5ebe7e[_0xde2f('0x68')][_0xde2f('0x69')],'userProfileId':_0x5ebe7e[_0xde2f('0x68')][_0xde2f('0x6a')]};if(!_0xa32aef)throw new Error(_0xde2f('0x6b'));if(_0xa32aef[_0xde2f('0x69')]===_0xde2f('0x6c')){var _0x30db1e=_0x5b6a65[_0xde2f('0x6d')]({'plain':!![]});return db[_0xde2f('0x6e')][_0xde2f('0x43')]({'where':{'name':_0xde2f('0x21'),'userProfileId':_0xa32aef[_0xde2f('0x6a')]},'raw':!![]})['then'](function(_0x113f7e){if(_0x113f7e&&_0x113f7e[_0xde2f('0x6f')]===0x0){return db[_0xde2f('0x70')][_0xde2f('0x4f')]({'name':_0x30db1e[_0xde2f('0x24')],'resourceId':_0x30db1e['id'],'type':_0x113f7e[_0xde2f('0x24')],'sectionId':_0x113f7e['id']},{})['then'](function(){return _0x5b6a65;});}else{return _0x5b6a65;}})[_0xde2f('0x4e')](function(_0xbd4c59){logger[_0xde2f('0x22')](_0xde2f('0x71'),_0xbd4c59);throw _0xbd4c59;});}return _0x5b6a65;})[_0xde2f('0x1f')](respondWithResult(_0x2ae429,null))[_0xde2f('0x4e')](handleError(_0x2ae429,null));});_0xcefdfa[_0xde2f('0x72')]();}catch(_0x5204bf){_0x2ae429[_0xde2f('0x19')](0x1f4)['send'](_0x5204bf);}};exports[_0xde2f('0x1e')]=function(_0x27d7b3,_0x5ca398,_0x4131fb){return db[_0xde2f('0x27')]['find']({'where':{'id':_0x27d7b3[_0xde2f('0x42')]['id']}})[_0xde2f('0x1f')](handleEntityNotFound(_0x5ca398,null))['then'](saveUpdates(_[_0xde2f('0x36')](_0x27d7b3[_0xde2f('0x68')],[_0xde2f('0x24'),_0xde2f('0x73')]),null))[_0xde2f('0x1f')](respondWithResult(_0x5ca398,null))[_0xde2f('0x4e')](handleError(_0x5ca398,null));};exports[_0xde2f('0x74')]=function(_0x45eb12,_0x3262ac,_0x574e59){return db[_0xde2f('0x27')][_0xde2f('0x43')]({'where':{'id':_0x45eb12['params']['id']}})['then'](function(_0x1e0326){if(_0x1e0326){return _0x1e0326['destroy']();}})['then'](function(_0x45f374){var _0x32744d=path['join'](config[_0xde2f('0x48')],_0xde2f('0x56'),util[_0xde2f('0x4c')](_0xde2f('0x4d'),_0x45f374[_0xde2f('0x45')],_0x45f374[_0xde2f('0x75')]));var _0x21d9f5=path[_0xde2f('0x47')](config[_0xde2f('0x48')],_0xde2f('0x49'),util[_0xde2f('0x4c')](_0xde2f('0x4d'),_0x45f374['save_name'],_0x45f374[_0xde2f('0x4a')]));fs[_0xde2f('0x5a')](_0x32744d);fs[_0xde2f('0x5a')](_0x21d9f5);return _0x45f374;})[_0xde2f('0x1f')](function(_0x18936f){if(_0x18936f){return _0x3262ac[_0xde2f('0x19')](0xcc)[_0xde2f('0x1a')]();}})[_0xde2f('0x1f')](handleEntityNotFound(_0x3262ac,null))['catch'](handleError(_0x3262ac,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index a578fd2..630f493 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 _0xaab0=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','util','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xaab0,0x80));var _0x0aab=function(_0x56e32e,_0x9eb2f6){_0x56e32e=_0x56e32e-0x0;var _0x2a757b=_0xaab0[_0x56e32e];return _0x2a757b;};'use strict';var _=require('lodash');var util=require(_0x0aab('0x0'));var logger=require('../../config/logger')(_0x0aab('0x1'));var moment=require(_0x0aab('0x2'));var BPromise=require(_0x0aab('0x3'));var rp=require(_0x0aab('0x4'));var fs=require('fs');var path=require(_0x0aab('0x5'));var rimraf=require(_0x0aab('0x6'));var config=require(_0x0aab('0x7'));var attributes=require(_0x0aab('0x8'));module[_0x0aab('0x9')]=function(_0x4c5e54,_0x352d23){return _0x4c5e54[_0x0aab('0xa')](_0x0aab('0xb'),attributes,{'tableName':_0x0aab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7715=['rimraf','exports','Sound','tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2601b4,_0x315e78){var _0x3e3661=function(_0x13b45b){while(--_0x13b45b){_0x2601b4['push'](_0x2601b4['shift']());}};_0x3e3661(++_0x315e78);}(_0x7715,0x64));var _0x5771=function(_0x4458c7,_0x152a1d){_0x4458c7=_0x4458c7-0x0;var _0x319655=_0x7715[_0x4458c7];return _0x319655;};'use strict';var _=require(_0x5771('0x0'));var util=require(_0x5771('0x1'));var logger=require(_0x5771('0x2'))(_0x5771('0x3'));var moment=require(_0x5771('0x4'));var BPromise=require(_0x5771('0x5'));var rp=require(_0x5771('0x6'));var fs=require('fs');var path=require(_0x5771('0x7'));var rimraf=require(_0x5771('0x8'));var config=require('../../config/environment');var attributes=require('./sound.attributes');module[_0x5771('0x9')]=function(_0x5d861d,_0x1b1d74){return _0x5d861d['define'](_0x5771('0xa'),attributes,{'tableName':_0x5771('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 6e5cbda..e266a80 100644 --- a/server/api/sound/sound.rpc.js +++ b/server/api/sound/sound.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','options','raw','where','include','model','attributes','map','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Sound,\x20%s,\x20%s'];(function(_0x5644e5,_0x367ca4){var _0x36dd76=function(_0x243630){while(--_0x243630){_0x5644e5['push'](_0x5644e5['shift']());}};_0x36dd76(++_0x367ca4);}(_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')]['find']({'raw':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x19')]===undefined?!![]:![]:!![],'where':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')]['attributes']||null:null,'include':_0x5fecbd['options']?_0x5fecbd[_0x0d8b('0x18')]['include']?_['map'](_0x5fecbd['options'][_0x0d8b('0x1b')],function(_0x2b924f){return{'model':db[_0x2b924f[_0x0d8b('0x1c')]],'as':_0x2b924f['as'],'attributes':_0x2b924f[_0x0d8b('0x1d')],'include':_0x2b924f[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x2b924f[_0x0d8b('0x1b')],function(_0x4562cb){return{'model':db[_0x4562cb[_0x0d8b('0x1c')]],'as':_0x4562cb['as'],'attributes':_0x4562cb['attributes'],'include':_0x4562cb[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x4562cb['include'],function(_0xe1ef20){return{'model':db[_0xe1ef20['model']],'as':_0xe1ef20['as'],'attributes':_0xe1ef20[_0x0d8b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0d8b('0xa')](function(_0xa2af02){logger['info']('ShowSound',_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON['stringify'](_0xa2af02));_0x18dd2d(_0xa2af02);})[_0x0d8b('0x15')](function(_0x59aa83){logger[_0x0d8b('0x11')]('ShowSound',_0x59aa83[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674['error'](0x1f4,_0x59aa83[_0x0d8b('0x13')]));});});}; \ No newline at end of file +var _0xd8b0=['request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','options','raw','where','include','model','attributes','map','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Sound,\x20%s,\x20%s'];(function(_0x4bc06e,_0x435bf2){var _0x54bb92=function(_0x5a4f40){while(--_0x5a4f40){_0x4bc06e['push'](_0x4bc06e['shift']());}};_0x54bb92(++_0x435bf2);}(_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')]['find']({'raw':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x19')]===undefined?!![]:![]:!![],'where':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')]['attributes']||null:null,'include':_0x5fecbd['options']?_0x5fecbd[_0x0d8b('0x18')]['include']?_['map'](_0x5fecbd['options'][_0x0d8b('0x1b')],function(_0x2b924f){return{'model':db[_0x2b924f[_0x0d8b('0x1c')]],'as':_0x2b924f['as'],'attributes':_0x2b924f[_0x0d8b('0x1d')],'include':_0x2b924f[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x2b924f[_0x0d8b('0x1b')],function(_0x4562cb){return{'model':db[_0x4562cb[_0x0d8b('0x1c')]],'as':_0x4562cb['as'],'attributes':_0x4562cb['attributes'],'include':_0x4562cb[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x4562cb['include'],function(_0xe1ef20){return{'model':db[_0xe1ef20['model']],'as':_0xe1ef20['as'],'attributes':_0xe1ef20[_0x0d8b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0d8b('0xa')](function(_0xa2af02){logger['info']('ShowSound',_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON['stringify'](_0xa2af02));_0x18dd2d(_0xa2af02);})[_0x0d8b('0x15')](function(_0x59aa83){logger[_0x0d8b('0x11')]('ShowSound',_0x59aa83[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674['error'](0x1f4,_0x59aa83[_0x0d8b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index f28b461..bc3d77c 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 _0x25e1=['index','/:id','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x25e1,0x1d0));var _0x125e=function(_0x2fe804,_0x498c54){_0x2fe804=_0x2fe804-0x0;var _0x49a74a=_0x25e1[_0x2fe804];return _0x49a74a;};'use strict';var multer=require(_0x125e('0x0'));var util=require('util');var path=require(_0x125e('0x1'));var timeout=require(_0x125e('0x2'));var express=require(_0x125e('0x3'));var router=express[_0x125e('0x4')]();var auth=require(_0x125e('0x5'));var interaction=require(_0x125e('0x6'));var config=require(_0x125e('0x7'));var controller=require(_0x125e('0x8'));router[_0x125e('0x9')]('/',auth[_0x125e('0xa')](),controller[_0x125e('0xb')]);router[_0x125e('0x9')](_0x125e('0xc'),auth[_0x125e('0xa')](),controller['show']);router[_0x125e('0xd')]('/',auth[_0x125e('0xa')](),controller[_0x125e('0xe')]);router[_0x125e('0xf')]('/:id',auth[_0x125e('0xa')](),controller['update']);router[_0x125e('0x10')](_0x125e('0xc'),auth[_0x125e('0xa')](),controller[_0x125e('0x11')]);module[_0x125e('0x12')]=router; \ No newline at end of file +var _0x81fa=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','create','update','destroy'];(function(_0x1daf98,_0xf666ba){var _0x1db54f=function(_0x135182){while(--_0x135182){_0x1daf98['push'](_0x1daf98['shift']());}};_0x1db54f(++_0xf666ba);}(_0x81fa,0xdd));var _0xa81f=function(_0x1d5759,_0x417e09){_0x1d5759=_0x1d5759-0x0;var _0x51ddcd=_0x81fa[_0x1d5759];return _0x51ddcd;};'use strict';var multer=require(_0xa81f('0x0'));var util=require(_0xa81f('0x1'));var path=require('path');var timeout=require(_0xa81f('0x2'));var express=require(_0xa81f('0x3'));var router=express[_0xa81f('0x4')]();var auth=require(_0xa81f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa81f('0x6'));var controller=require(_0xa81f('0x7'));router[_0xa81f('0x8')]('/',auth[_0xa81f('0x9')](),controller[_0xa81f('0xa')]);router[_0xa81f('0x8')](_0xa81f('0xb'),auth[_0xa81f('0x9')](),controller[_0xa81f('0xc')]);router[_0xa81f('0xd')]('/',auth[_0xa81f('0x9')](),controller[_0xa81f('0xe')]);router['put']('/:id',auth[_0xa81f('0x9')](),controller[_0xa81f('0xf')]);router['delete'](_0xa81f('0xb'),auth['isAuthenticated'](),controller[_0xa81f('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 5675c1d..8f6d656 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 _0x60f0=['TEXT','medium','ENUM','out'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x60f0,0x1e8));var _0x060f=function(_0x27e59e,_0x25a388){_0x27e59e=_0x27e59e-0x0;var _0x1225c7=_0x60f0[_0x27e59e];return _0x1225c7;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x060f('0x0')](_0x060f('0x1')),'allowNull':![]},'direction':{'type':Sequelize[_0x060f('0x2')]('in',_0x060f('0x3')),'defaultValue':_0x060f('0x3'),'allowNull':![]}}; \ No newline at end of file +var _0x6b41=['ENUM','out','sequelize','exports','STRING','TEXT','medium'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6b41,0xb1));var _0x16b4=function(_0x180772,_0x2275e9){_0x180772=_0x180772-0x0;var _0x4a3ddd=_0x6b41[_0x180772];return _0x4a3ddd;};'use strict';var Sequelize=require(_0x16b4('0x0'));module[_0x16b4('0x1')]={'uniqueid':{'type':Sequelize[_0x16b4('0x2')]},'body':{'type':Sequelize[_0x16b4('0x3')](_0x16b4('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x16b4('0x5')]('in','out'),'defaultValue':_0x16b4('0x6'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index b01d5ce..d6e742c 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 _0x8fa7=['nolimit','order','where','pick','merge','map','type','field','filter','options','includeAll','include','params','find','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','SquareMessage','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x411f36,_0x4d19e8){var _0x598cef=function(_0x4b0ca3){while(--_0x4b0ca3){_0x411f36['push'](_0x411f36['shift']());}};_0x598cef(++_0x4d19e8);}(_0x8fa7,0xcd));var _0x78fa=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x8fa7[_0x20c9b2];return _0x2c6030;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x78fa('0x0'));var rimraf=require(_0x78fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x78fa('0x2'));var rp=require(_0x78fa('0x3'));var moment=require(_0x78fa('0x4'));var BPromise=require(_0x78fa('0x5'));var Mustache=require(_0x78fa('0x6'));var util=require('util');var path=require(_0x78fa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x78fa('0x8'));var squel=require(_0x78fa('0x9'));var crypto=require('crypto');var jsforce=require(_0x78fa('0xa'));var deskjs=require(_0x78fa('0xb'));var toCsv=require(_0x78fa('0xc'));var querystring=require(_0x78fa('0xd'));var Papa=require('papaparse');var Redis=require(_0x78fa('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x78fa('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x78fa('0x10'));var utils=require(_0x78fa('0x11'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa85d4b,_0x1359e6){_0x1359e6=_0x1359e6||0xcc;return function(_0x21537c){if(_0x21537c){return _0xa85d4b['sendStatus'](_0x1359e6);}return _0xa85d4b[_0x78fa('0x12')](_0x1359e6)[_0x78fa('0x13')]();};}function respondWithResult(_0x4b35e1,_0x13a2fb){_0x13a2fb=_0x13a2fb||0xc8;return function(_0x325bcc){if(_0x325bcc){return _0x4b35e1[_0x78fa('0x12')](_0x13a2fb)[_0x78fa('0x14')](_0x325bcc);}};}function respondWithFilteredResult(_0x252ec,_0x5f2cef){return function(_0x1d7699){if(_0x1d7699){var _0x328d27=_0x1d7699[_0x78fa('0x15')],_0x53e10a=_0x5f2cef[_0x78fa('0x16')],_0x3fef66=_0x5f2cef[_0x78fa('0x16')]+_0x5f2cef[_0x78fa('0x17')],_0x25a853;if(_0x3fef66>=_0x328d27){_0x3fef66=_0x328d27;_0x25a853=0xc8;}else{_0x25a853=0xce;}_0x252ec[_0x78fa('0x12')](_0x25a853);return _0x252ec[_0x78fa('0x18')](_0x78fa('0x19'),_0x53e10a+'-'+_0x3fef66+'/'+_0x328d27)[_0x78fa('0x14')](_0x1d7699);}return null;};}function patchUpdates(_0x20aeae){return function(_0x12901d){try{jsonpatch['apply'](_0x12901d,_0x20aeae,!![]);}catch(_0x1b02da){return BPromise[_0x78fa('0x1a')](_0x1b02da);}return _0x12901d[_0x78fa('0x1b')]();};}function saveUpdates(_0x35dc5c,_0x15888f){return function(_0x5e6f25){if(_0x5e6f25){return _0x5e6f25[_0x78fa('0x1c')](_0x35dc5c)[_0x78fa('0x1d')](function(_0x27c80b){return _0x27c80b;});}return null;};}function removeEntity(_0x5c80d3,_0x100755){return function(_0x5ed8fe){if(_0x5ed8fe){return _0x5ed8fe[_0x78fa('0x1e')]()['then'](function(){_0x5c80d3[_0x78fa('0x12')](0xcc)[_0x78fa('0x13')]();});}};}function handleEntityNotFound(_0x28edd3,_0x5d4b04){return function(_0x24d791){if(!_0x24d791){_0x28edd3[_0x78fa('0x1f')](0x194);}return _0x24d791;};}function handleError(_0x29926b,_0x57c421){_0x57c421=_0x57c421||0x1f4;return function(_0x91aec6){logger[_0x78fa('0x20')](_0x91aec6[_0x78fa('0x21')]);if(_0x91aec6[_0x78fa('0x22')]){delete _0x91aec6[_0x78fa('0x22')];}_0x29926b[_0x78fa('0x12')](_0x57c421)[_0x78fa('0x23')](_0x91aec6);};}exports['index']=function(_0x3573d8,_0x44217e){var _0x2b7e08={},_0x3aefa9={},_0x2b60c2={'count':0x0,'rows':[]};var _0x2de724=db[_0x78fa('0x24')][_0x78fa('0x25')];_0x3aefa9[_0x78fa('0x26')]=_[_0x78fa('0x27')](_0x2de724);_0x3aefa9[_0x78fa('0x28')]=_[_0x78fa('0x27')](_0x3573d8[_0x78fa('0x28')]);_0x3aefa9[_0x78fa('0x29')]=_['intersection'](_0x3aefa9['model'],_0x3aefa9[_0x78fa('0x28')]);_0x2b7e08[_0x78fa('0x2a')]=_[_0x78fa('0x2b')](_0x3aefa9[_0x78fa('0x26')],qs['fields'](_0x3573d8[_0x78fa('0x28')][_0x78fa('0x2c')]));_0x2b7e08[_0x78fa('0x2a')]=_0x2b7e08[_0x78fa('0x2a')][_0x78fa('0x2d')]?_0x2b7e08['attributes']:_0x3aefa9[_0x78fa('0x26')];if(!_0x3573d8['query'][_0x78fa('0x2e')](_0x78fa('0x2f'))){_0x2b7e08['limit']=qs[_0x78fa('0x17')](_0x3573d8[_0x78fa('0x28')][_0x78fa('0x17')]);_0x2b7e08[_0x78fa('0x16')]=qs['offset'](_0x3573d8[_0x78fa('0x28')][_0x78fa('0x16')]);}_0x2b7e08[_0x78fa('0x30')]=qs['sort'](_0x3573d8[_0x78fa('0x28')]['sort']);_0x2b7e08[_0x78fa('0x31')]=qs[_0x78fa('0x29')](_[_0x78fa('0x32')](_0x3573d8['query'],_0x3aefa9[_0x78fa('0x29')]));if(_0x3573d8['query']['filter']){_0x2b7e08['where']=_[_0x78fa('0x33')](_0x2b7e08[_0x78fa('0x31')],{'$or':_[_0x78fa('0x34')](_0x2de724,function(_0x5a50fb){if(_0x5a50fb[_0x78fa('0x35')]['key']!=='VIRTUAL'){var _0x1e46e8={};_0x1e46e8[_0x5a50fb[_0x78fa('0x36')]]={'$like':'%'+_0x3573d8[_0x78fa('0x28')][_0x78fa('0x37')]+'%'};return _0x1e46e8;}})});}_0x2b7e08=_[_0x78fa('0x33')]({},_0x2b7e08,_0x3573d8[_0x78fa('0x38')]);var _0x5da18e={'where':_0x2b7e08[_0x78fa('0x31')]};return db[_0x78fa('0x24')][_0x78fa('0x15')](_0x5da18e)[_0x78fa('0x1d')](function(_0x54eb26){_0x2b60c2['count']=_0x54eb26;if(_0x3573d8['query'][_0x78fa('0x39')]){_0x2b7e08[_0x78fa('0x3a')]=[{'all':!![]}];}return db[_0x78fa('0x24')]['findAll'](_0x2b7e08);})[_0x78fa('0x1d')](function(_0x5dbeba){_0x2b60c2['rows']=_0x5dbeba;return _0x2b60c2;})[_0x78fa('0x1d')](respondWithFilteredResult(_0x44217e,_0x2b7e08))['catch'](handleError(_0x44217e,null));};exports['show']=function(_0x5ab284,_0x32162c){var _0x1277f4={'raw':!![],'where':{'id':_0x5ab284[_0x78fa('0x3b')]['id']}},_0x5e6af8={};_0x5e6af8[_0x78fa('0x26')]=_['keys'](db[_0x78fa('0x24')]['rawAttributes']);_0x5e6af8[_0x78fa('0x28')]=_[_0x78fa('0x27')](_0x5ab284['query']);_0x5e6af8[_0x78fa('0x29')]=_[_0x78fa('0x2b')](_0x5e6af8[_0x78fa('0x26')],_0x5e6af8[_0x78fa('0x28')]);_0x1277f4['attributes']=_[_0x78fa('0x2b')](_0x5e6af8[_0x78fa('0x26')],qs[_0x78fa('0x2c')](_0x5ab284[_0x78fa('0x28')]['fields']));_0x1277f4[_0x78fa('0x2a')]=_0x1277f4[_0x78fa('0x2a')][_0x78fa('0x2d')]?_0x1277f4[_0x78fa('0x2a')]:_0x5e6af8[_0x78fa('0x26')];if(_0x5ab284[_0x78fa('0x28')][_0x78fa('0x39')]){_0x1277f4[_0x78fa('0x3a')]=[{'all':!![]}];}_0x1277f4=_[_0x78fa('0x33')]({},_0x1277f4,_0x5ab284['options']);return db[_0x78fa('0x24')][_0x78fa('0x3c')](_0x1277f4)[_0x78fa('0x1d')](handleEntityNotFound(_0x32162c,null))['then'](respondWithResult(_0x32162c,null))[_0x78fa('0x3d')](handleError(_0x32162c,null));};exports['create']=function(_0x41cf69,_0x29d204){return db[_0x78fa('0x24')]['create'](_0x41cf69[_0x78fa('0x3e')],{})[_0x78fa('0x1d')](respondWithResult(_0x29d204,0xc9))['catch'](handleError(_0x29d204,null));};exports[_0x78fa('0x1c')]=function(_0x4d3119,_0x4aa2e3){if(_0x4d3119['body']['id']){delete _0x4d3119['body']['id'];}return db['SquareMessage']['find']({'where':{'id':_0x4d3119['params']['id']}})['then'](handleEntityNotFound(_0x4aa2e3,null))[_0x78fa('0x1d')](saveUpdates(_0x4d3119['body'],null))[_0x78fa('0x1d')](respondWithResult(_0x4aa2e3,null))[_0x78fa('0x3d')](handleError(_0x4aa2e3,null));};exports[_0x78fa('0x1e')]=function(_0x547390,_0x42d0ba){return db[_0x78fa('0x24')][_0x78fa('0x3c')]({'where':{'id':_0x547390[_0x78fa('0x3b')]['id']}})['then'](handleEntityNotFound(_0x42d0ba,null))[_0x78fa('0x1d')](removeEntity(_0x42d0ba,null))[_0x78fa('0x3d')](handleError(_0x42d0ba,null));}; \ No newline at end of file +var _0x8cff=['catch','show','include','options','find','create','body','params','html-pdf','eml-format','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','SquareMessage','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','key','field','includeAll','findAll','rows'];(function(_0x3bd2c8,_0x395b96){var _0x25374f=function(_0x5ee528){while(--_0x5ee528){_0x3bd2c8['push'](_0x3bd2c8['shift']());}};_0x25374f(++_0x395b96);}(_0x8cff,0x114));var _0xf8cf=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x8cff[_0x167cc1];return _0x10bc4b;};'use strict';var pdf=require(_0xf8cf('0x0'));var emlformat=require(_0xf8cf('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf8cf('0x2'));var moment=require('moment');var BPromise=require(_0xf8cf('0x3'));var Mustache=require(_0xf8cf('0x4'));var util=require(_0xf8cf('0x5'));var path=require(_0xf8cf('0x6'));var sox=require(_0xf8cf('0x7'));var csv=require(_0xf8cf('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf8cf('0x9'));var squel=require(_0xf8cf('0xa'));var crypto=require(_0xf8cf('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf8cf('0x8'));var querystring=require(_0xf8cf('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf8cf('0xd'));var qs=require(_0xf8cf('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf8cf('0xf'));var db=require(_0xf8cf('0x10'))['db'];function respondWithStatusCode(_0x1ec5fc,_0x517495){_0x517495=_0x517495||0xcc;return function(_0xbefb55){if(_0xbefb55){return _0x1ec5fc[_0xf8cf('0x11')](_0x517495);}return _0x1ec5fc[_0xf8cf('0x12')](_0x517495)['end']();};}function respondWithResult(_0x590e5d,_0x30cb9c){_0x30cb9c=_0x30cb9c||0xc8;return function(_0x12fbdd){if(_0x12fbdd){return _0x590e5d[_0xf8cf('0x12')](_0x30cb9c)[_0xf8cf('0x13')](_0x12fbdd);}};}function respondWithFilteredResult(_0x5336af,_0x483111){return function(_0x49f72f){if(_0x49f72f){var _0x4ef2fb=_0x49f72f[_0xf8cf('0x14')],_0x5dd0d8=_0x483111[_0xf8cf('0x15')],_0x17b5fc=_0x483111[_0xf8cf('0x15')]+_0x483111['limit'],_0x23fdad;if(_0x17b5fc>=_0x4ef2fb){_0x17b5fc=_0x4ef2fb;_0x23fdad=0xc8;}else{_0x23fdad=0xce;}_0x5336af[_0xf8cf('0x12')](_0x23fdad);return _0x5336af[_0xf8cf('0x16')](_0xf8cf('0x17'),_0x5dd0d8+'-'+_0x17b5fc+'/'+_0x4ef2fb)[_0xf8cf('0x13')](_0x49f72f);}return null;};}function patchUpdates(_0x52e2c4){return function(_0x85deaf){try{jsonpatch[_0xf8cf('0x18')](_0x85deaf,_0x52e2c4,!![]);}catch(_0xf5bca3){return BPromise[_0xf8cf('0x19')](_0xf5bca3);}return _0x85deaf['save']();};}function saveUpdates(_0x415b27,_0x24c814){return function(_0x3a5398){if(_0x3a5398){return _0x3a5398[_0xf8cf('0x1a')](_0x415b27)[_0xf8cf('0x1b')](function(_0x5557a1){return _0x5557a1;});}return null;};}function removeEntity(_0x1e6a43,_0x4972c4){return function(_0x1fd66e){if(_0x1fd66e){return _0x1fd66e[_0xf8cf('0x1c')]()[_0xf8cf('0x1b')](function(){_0x1e6a43['status'](0xcc)[_0xf8cf('0x1d')]();});}};}function handleEntityNotFound(_0xcde6ed,_0x1113fd){return function(_0x2609d7){if(!_0x2609d7){_0xcde6ed[_0xf8cf('0x11')](0x194);}return _0x2609d7;};}function handleError(_0x475bf3,_0x472002){_0x472002=_0x472002||0x1f4;return function(_0x177bf7){logger[_0xf8cf('0x1e')](_0x177bf7[_0xf8cf('0x1f')]);if(_0x177bf7[_0xf8cf('0x20')]){delete _0x177bf7['name'];}_0x475bf3['status'](_0x472002)[_0xf8cf('0x21')](_0x177bf7);};}exports[_0xf8cf('0x22')]=function(_0xe8df22,_0x148fad){var _0xad89ae={},_0x3c2b77={},_0x23aba4={'count':0x0,'rows':[]};var _0x5ca3e2=db[_0xf8cf('0x23')][_0xf8cf('0x24')];_0x3c2b77[_0xf8cf('0x25')]=_['keys'](_0x5ca3e2);_0x3c2b77[_0xf8cf('0x26')]=_[_0xf8cf('0x27')](_0xe8df22[_0xf8cf('0x26')]);_0x3c2b77[_0xf8cf('0x28')]=_[_0xf8cf('0x29')](_0x3c2b77[_0xf8cf('0x25')],_0x3c2b77['query']);_0xad89ae[_0xf8cf('0x2a')]=_[_0xf8cf('0x29')](_0x3c2b77[_0xf8cf('0x25')],qs['fields'](_0xe8df22[_0xf8cf('0x26')][_0xf8cf('0x2b')]));_0xad89ae['attributes']=_0xad89ae[_0xf8cf('0x2a')][_0xf8cf('0x2c')]?_0xad89ae[_0xf8cf('0x2a')]:_0x3c2b77[_0xf8cf('0x25')];if(!_0xe8df22[_0xf8cf('0x26')]['hasOwnProperty'](_0xf8cf('0x2d'))){_0xad89ae[_0xf8cf('0x2e')]=qs[_0xf8cf('0x2e')](_0xe8df22[_0xf8cf('0x26')][_0xf8cf('0x2e')]);_0xad89ae[_0xf8cf('0x15')]=qs[_0xf8cf('0x15')](_0xe8df22[_0xf8cf('0x26')][_0xf8cf('0x15')]);}_0xad89ae[_0xf8cf('0x2f')]=qs[_0xf8cf('0x30')](_0xe8df22[_0xf8cf('0x26')][_0xf8cf('0x30')]);_0xad89ae[_0xf8cf('0x31')]=qs['filters'](_[_0xf8cf('0x32')](_0xe8df22[_0xf8cf('0x26')],_0x3c2b77[_0xf8cf('0x28')]));if(_0xe8df22[_0xf8cf('0x26')][_0xf8cf('0x33')]){_0xad89ae[_0xf8cf('0x31')]=_[_0xf8cf('0x34')](_0xad89ae['where'],{'$or':_['map'](_0x5ca3e2,function(_0x34f140){if(_0x34f140[_0xf8cf('0x35')][_0xf8cf('0x36')]!=='VIRTUAL'){var _0x136dc7={};_0x136dc7[_0x34f140[_0xf8cf('0x37')]]={'$like':'%'+_0xe8df22[_0xf8cf('0x26')]['filter']+'%'};return _0x136dc7;}})});}_0xad89ae=_[_0xf8cf('0x34')]({},_0xad89ae,_0xe8df22['options']);var _0x532fd1={'where':_0xad89ae['where']};return db[_0xf8cf('0x23')]['count'](_0x532fd1)['then'](function(_0x199843){_0x23aba4[_0xf8cf('0x14')]=_0x199843;if(_0xe8df22['query'][_0xf8cf('0x38')]){_0xad89ae['include']=[{'all':!![]}];}return db['SquareMessage'][_0xf8cf('0x39')](_0xad89ae);})[_0xf8cf('0x1b')](function(_0x475d97){_0x23aba4[_0xf8cf('0x3a')]=_0x475d97;return _0x23aba4;})[_0xf8cf('0x1b')](respondWithFilteredResult(_0x148fad,_0xad89ae))[_0xf8cf('0x3b')](handleError(_0x148fad,null));};exports[_0xf8cf('0x3c')]=function(_0x39edd7,_0x50f55e){var _0x57e009={'raw':!![],'where':{'id':_0x39edd7['params']['id']}},_0x24553e={};_0x24553e[_0xf8cf('0x25')]=_[_0xf8cf('0x27')](db[_0xf8cf('0x23')][_0xf8cf('0x24')]);_0x24553e[_0xf8cf('0x26')]=_['keys'](_0x39edd7[_0xf8cf('0x26')]);_0x24553e[_0xf8cf('0x28')]=_[_0xf8cf('0x29')](_0x24553e[_0xf8cf('0x25')],_0x24553e[_0xf8cf('0x26')]);_0x57e009[_0xf8cf('0x2a')]=_[_0xf8cf('0x29')](_0x24553e[_0xf8cf('0x25')],qs['fields'](_0x39edd7[_0xf8cf('0x26')][_0xf8cf('0x2b')]));_0x57e009[_0xf8cf('0x2a')]=_0x57e009['attributes'][_0xf8cf('0x2c')]?_0x57e009[_0xf8cf('0x2a')]:_0x24553e['model'];if(_0x39edd7[_0xf8cf('0x26')][_0xf8cf('0x38')]){_0x57e009[_0xf8cf('0x3d')]=[{'all':!![]}];}_0x57e009=_[_0xf8cf('0x34')]({},_0x57e009,_0x39edd7[_0xf8cf('0x3e')]);return db['SquareMessage'][_0xf8cf('0x3f')](_0x57e009)['then'](handleEntityNotFound(_0x50f55e,null))[_0xf8cf('0x1b')](respondWithResult(_0x50f55e,null))[_0xf8cf('0x3b')](handleError(_0x50f55e,null));};exports[_0xf8cf('0x40')]=function(_0x56cef3,_0xe96da9){return db[_0xf8cf('0x23')][_0xf8cf('0x40')](_0x56cef3[_0xf8cf('0x41')],{})[_0xf8cf('0x1b')](respondWithResult(_0xe96da9,0xc9))[_0xf8cf('0x3b')](handleError(_0xe96da9,null));};exports[_0xf8cf('0x1a')]=function(_0x215aab,_0x3ab8a1){if(_0x215aab['body']['id']){delete _0x215aab[_0xf8cf('0x41')]['id'];}return db[_0xf8cf('0x23')][_0xf8cf('0x3f')]({'where':{'id':_0x215aab[_0xf8cf('0x42')]['id']}})['then'](handleEntityNotFound(_0x3ab8a1,null))[_0xf8cf('0x1b')](saveUpdates(_0x215aab[_0xf8cf('0x41')],null))[_0xf8cf('0x1b')](respondWithResult(_0x3ab8a1,null))[_0xf8cf('0x3b')](handleError(_0x3ab8a1,null));};exports['destroy']=function(_0x3303a9,_0x54c475){return db[_0xf8cf('0x23')][_0xf8cf('0x3f')]({'where':{'id':_0x3303a9[_0xf8cf('0x42')]['id']}})['then'](handleEntityNotFound(_0x54c475,null))[_0xf8cf('0x1b')](removeEntity(_0x54c475,null))[_0xf8cf('0x3b')](handleError(_0x54c475,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 194d64a..126047b 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 _0x2efe=['./squareMessage.attributes','exports','define','square_messages','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x165f1e,_0x2683cb){var _0x52aa5e=function(_0x3e8029){while(--_0x3e8029){_0x165f1e['push'](_0x165f1e['shift']());}};_0x52aa5e(++_0x2683cb);}(_0x2efe,0x13a));var _0xe2ef=function(_0x2b4a3a,_0x345889){_0x2b4a3a=_0x2b4a3a-0x0;var _0x5d6ce4=_0x2efe[_0x2b4a3a];return _0x5d6ce4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe2ef('0x0'))(_0xe2ef('0x1'));var moment=require(_0xe2ef('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe2ef('0x3'));var rimraf=require(_0xe2ef('0x4'));var config=require(_0xe2ef('0x5'));var attributes=require(_0xe2ef('0x6'));module[_0xe2ef('0x7')]=function(_0x358084,_0x1631a5){return _0x358084[_0xe2ef('0x8')]('SquareMessage',attributes,{'tableName':_0xe2ef('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe4ad=['define','SquareMessage','square_messages','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./squareMessage.attributes','exports'];(function(_0x21155b,_0x16cca1){var _0x423b3e=function(_0x36cb8e){while(--_0x36cb8e){_0x21155b['push'](_0x21155b['shift']());}};_0x423b3e(++_0x16cca1);}(_0xe4ad,0x153));var _0xde4a=function(_0x46306e,_0x4119ee){_0x46306e=_0x46306e-0x0;var _0x449ba4=_0xe4ad[_0x46306e];return _0x449ba4;};'use strict';var _=require(_0xde4a('0x0'));var util=require(_0xde4a('0x1'));var logger=require(_0xde4a('0x2'))('api');var moment=require('moment');var BPromise=require(_0xde4a('0x3'));var rp=require(_0xde4a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde4a('0x5'));var config=require(_0xde4a('0x6'));var attributes=require(_0xde4a('0x7'));module[_0xde4a('0x8')]=function(_0x5a5dd2,_0x5d93b3){return _0x5a5dd2[_0xde4a('0x9')](_0xde4a('0xa'),attributes,{'tableName':_0xde4a('0xb'),'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 f15a99e..7d8ff27 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 _0x5a10=['error','code','message','info','result','catch','create','body','options','CreateSquareMessage','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x212bf5,_0x165cbd){var _0xfcad21=function(_0x4a4e6e){while(--_0x4a4e6e){_0x212bf5['push'](_0x212bf5['shift']());}};_0xfcad21(++_0x165cbd);}(_0x5a10,0x104));var _0x05a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a10[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x05a1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x05a1('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05a1('0x2'))['db'];var utils=require(_0x05a1('0x3'));var logger=require(_0x05a1('0x4'))('rpc');var config=require(_0x05a1('0x5'));var jayson=require(_0x05a1('0x6'));var client=jayson[_0x05a1('0x7')][_0x05a1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39278c,_0x110994,_0x13e575){return new BPromise(function(_0x2504f3,_0x5a2698){return client[_0x05a1('0x9')](_0x39278c,_0x13e575)['then'](function(_0x3fc3b8){logger['info'](_0x05a1('0xa'),_0x110994,_0x05a1('0xb'));logger[_0x05a1('0xc')](_0x05a1('0xd'),_0x110994,_0x05a1('0xb'),JSON[_0x05a1('0xe')](_0x3fc3b8));if(_0x3fc3b8[_0x05a1('0xf')]){if(_0x3fc3b8['error'][_0x05a1('0x10')]===0x1f4){logger['error']('SquareMessage,\x20%s,\x20%s',_0x110994,_0x3fc3b8[_0x05a1('0xf')]['message']);return _0x5a2698(_0x3fc3b8['error'][_0x05a1('0x11')]);}logger['error'](_0x05a1('0xa'),_0x110994,_0x3fc3b8['error']['message']);return _0x2504f3(_0x3fc3b8[_0x05a1('0xf')][_0x05a1('0x11')]);}else{logger[_0x05a1('0x12')](_0x05a1('0xa'),_0x110994,_0x05a1('0xb'));_0x2504f3(_0x3fc3b8[_0x05a1('0x13')]['message']);}})[_0x05a1('0x14')](function(_0x159347){logger['error'](_0x05a1('0xa'),_0x110994,_0x159347);_0x5a2698(_0x159347);});});}exports['CreateSquareMessage']=function(_0x2ba283){var _0x43906f=this;return new Promise(function(_0xb09bf7,_0x29432f){return db['SquareMessage'][_0x05a1('0x15')](_0x2ba283[_0x05a1('0x16')],{'raw':_0x2ba283['options']?_0x2ba283[_0x05a1('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x131483){logger['info'](_0x05a1('0x18'),_0x2ba283);logger[_0x05a1('0xc')](_0x05a1('0x18'),_0x2ba283,JSON[_0x05a1('0xe')](_0x131483));_0xb09bf7(_0x131483);})[_0x05a1('0x14')](function(_0x157fd5){logger[_0x05a1('0xf')](_0x05a1('0x18'),_0x157fd5[_0x05a1('0x11')],_0x2ba283);_0x29432f(_0x43906f[_0x05a1('0xf')](0x1f4,_0x157fd5[_0x05a1('0x11')]));});});}; \ No newline at end of file +var _0x8f56=['info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','CreateSquareMessage','SquareMessage','options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','then'];(function(_0x49923f,_0x568e43){var _0xc1237f=function(_0x2578ea){while(--_0x2578ea){_0x49923f['push'](_0x49923f['shift']());}};_0xc1237f(++_0x568e43);}(_0x8f56,0x6d));var _0x68f5=function(_0x529134,_0x5e6cd5){_0x529134=_0x529134-0x0;var _0x5d8fae=_0x8f56[_0x529134];return _0x5d8fae;};'use strict';var _=require(_0x68f5('0x0'));var util=require(_0x68f5('0x1'));var moment=require(_0x68f5('0x2'));var BPromise=require('bluebird');var rs=require(_0x68f5('0x3'));var fs=require('fs');var Redis=require(_0x68f5('0x4'));var db=require(_0x68f5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x68f5('0x6'))(_0x68f5('0x7'));var config=require('../../config/environment');var jayson=require(_0x68f5('0x8'));var client=jayson[_0x68f5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a0335,_0x5263f3,_0x48778d){return new BPromise(function(_0x18ec9e,_0x33c472){return client['request'](_0x4a0335,_0x48778d)[_0x68f5('0xa')](function(_0x2b6d45){logger[_0x68f5('0xb')]('SquareMessage,\x20%s,\x20%s',_0x5263f3,_0x68f5('0xc'));logger[_0x68f5('0xd')](_0x68f5('0xe'),_0x5263f3,_0x68f5('0xc'),JSON[_0x68f5('0xf')](_0x2b6d45));if(_0x2b6d45[_0x68f5('0x10')]){if(_0x2b6d45['error'][_0x68f5('0x11')]===0x1f4){logger['error'](_0x68f5('0x12'),_0x5263f3,_0x2b6d45[_0x68f5('0x10')][_0x68f5('0x13')]);return _0x33c472(_0x2b6d45[_0x68f5('0x10')]['message']);}logger[_0x68f5('0x10')]('SquareMessage,\x20%s,\x20%s',_0x5263f3,_0x2b6d45['error'][_0x68f5('0x13')]);return _0x18ec9e(_0x2b6d45[_0x68f5('0x10')][_0x68f5('0x13')]);}else{logger[_0x68f5('0xb')]('SquareMessage,\x20%s,\x20%s',_0x5263f3,_0x68f5('0xc'));_0x18ec9e(_0x2b6d45['result']['message']);}})['catch'](function(_0x2f3c5e){logger['error'](_0x68f5('0x12'),_0x5263f3,_0x2f3c5e);_0x33c472(_0x2f3c5e);});});}exports[_0x68f5('0x14')]=function(_0x3e9fde){var _0x9e46e8=this;return new Promise(function(_0x76134e,_0x54c6cd){return db[_0x68f5('0x15')]['create'](_0x3e9fde['body'],{'raw':_0x3e9fde['options']?_0x3e9fde[_0x68f5('0x16')][_0x68f5('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x2aa42e){logger[_0x68f5('0xb')](_0x68f5('0x14'),_0x3e9fde);logger[_0x68f5('0xd')](_0x68f5('0x14'),_0x3e9fde,JSON['stringify'](_0x2aa42e));_0x76134e(_0x2aa42e);})['catch'](function(_0x56d692){logger['error']('CreateSquareMessage',_0x56d692[_0x68f5('0x13')],_0x3e9fde);_0x54c6cd(_0x9e46e8['error'](0x1f4,_0x56d692[_0x68f5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index c1ed839..52d6550 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 _0x79d8=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','index','/:id','isAuthenticated','/:id/test','15s','test','update'];(function(_0x473b41,_0x1c320f){var _0x4e521d=function(_0x19a745){while(--_0x19a745){_0x473b41['push'](_0x473b41['shift']());}};_0x4e521d(++_0x1c320f);}(_0x79d8,0x67));var _0x879d=function(_0x17ba36,_0x22826e){_0x17ba36=_0x17ba36-0x0;var _0x24fe44=_0x79d8[_0x17ba36];return _0x24fe44;};'use strict';var multer=require(_0x879d('0x0'));var util=require(_0x879d('0x1'));var path=require(_0x879d('0x2'));var timeout=require(_0x879d('0x3'));var express=require('express');var router=express[_0x879d('0x4')]();var auth=require(_0x879d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x879d('0x6'));var controller=require(_0x879d('0x7'));router[_0x879d('0x8')]('/',auth['isAuthenticated'](),controller[_0x879d('0x9')]);router[_0x879d('0x8')](_0x879d('0xa'),auth[_0x879d('0xb')](),controller['show']);router[_0x879d('0x8')](_0x879d('0xc'),auth[_0x879d('0xb')](),timeout(_0x879d('0xd')),controller[_0x879d('0xe')]);router['post']('/',auth[_0x879d('0xb')](),controller['create']);router['put'](_0x879d('0xa'),auth[_0x879d('0xb')](),controller[_0x879d('0xf')]);router['delete'](_0x879d('0xa'),auth[_0x879d('0xb')](),controller['destroy']);module[_0x879d('0x10')]=router; \ No newline at end of file +var _0xcf1c=['express','Router','../../components/auth/service','get','index','/:id','isAuthenticated','show','/:id/test','15s','test','post','create','put','update','destroy','exports','multer','util','connect-timeout'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xcf1c,0x18d));var _0xccf1=function(_0x3cb872,_0x4b26e2){_0x3cb872=_0x3cb872-0x0;var _0x288d59=_0xcf1c[_0x3cb872];return _0x288d59;};'use strict';var multer=require(_0xccf1('0x0'));var util=require(_0xccf1('0x1'));var path=require('path');var timeout=require(_0xccf1('0x2'));var express=require(_0xccf1('0x3'));var router=express[_0xccf1('0x4')]();var auth=require(_0xccf1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router[_0xccf1('0x6')]('/',auth['isAuthenticated'](),controller[_0xccf1('0x7')]);router[_0xccf1('0x6')](_0xccf1('0x8'),auth[_0xccf1('0x9')](),controller[_0xccf1('0xa')]);router[_0xccf1('0x6')](_0xccf1('0xb'),auth[_0xccf1('0x9')](),timeout(_0xccf1('0xc')),controller[_0xccf1('0xd')]);router[_0xccf1('0xe')]('/',auth[_0xccf1('0x9')](),controller[_0xccf1('0xf')]);router[_0xccf1('0x10')](_0xccf1('0x8'),auth[_0xccf1('0x9')](),controller[_0xccf1('0x11')]);router['delete']('/:id',auth[_0xccf1('0x9')](),controller[_0xccf1('0x12')]);module[_0xccf1('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index b800813..6c9a977 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 _0xd811=['sequelize','exports','STRING'];(function(_0xf8c5c0,_0x54bff4){var _0x57b926=function(_0x31dfa9){while(--_0x31dfa9){_0xf8c5c0['push'](_0xf8c5c0['shift']());}};_0x57b926(++_0x54bff4);}(_0xd811,0x1ad));var _0x1d81=function(_0x159779,_0x39d008){_0x159779=_0x159779-0x0;var _0x6c937f=_0xd811[_0x159779];return _0x6c937f;};'use strict';var Sequelize=require(_0x1d81('0x0'));module[_0x1d81('0x1')]={'name':{'type':Sequelize[_0x1d81('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x1d81('0x2')]},'description':{'type':Sequelize[_0x1d81('0x2')]}}; \ No newline at end of file +var _0xbbf8=['sequelize','STRING','name'];(function(_0x1cf9f1,_0x37d1a3){var _0x4ca8ad=function(_0x469e20){while(--_0x469e20){_0x1cf9f1['push'](_0x1cf9f1['shift']());}};_0x4ca8ad(++_0x37d1a3);}(_0xbbf8,0x9c));var _0x8bbf=function(_0x100e0c,_0x5523b8){_0x100e0c=_0x100e0c-0x0;var _0x4db1aa=_0xbbf8[_0x100e0c];return _0x4db1aa;};'use strict';var Sequelize=require(_0x8bbf('0x0'));module['exports']={'name':{'type':Sequelize[_0x8bbf('0x1')],'unique':_0x8bbf('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x8bbf('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index c64ab5a..b6bd396 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 _0x0ebc=['closeSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','update','then','get','ODBC','UserProfileResource','destroy','stack','name','send','rawAttributes','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','limit','order','sort','where','merge','type','key','VIRTUAL','field','SquareOdbc','includeAll','include','findAll','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','openSync'];(function(_0x4f6024,_0x23dc50){var _0x339f43=function(_0x1ab5c3){while(--_0x1ab5c3){_0x4f6024['push'](_0x4f6024['shift']());}};_0x339f43(++_0x23dc50);}(_0x0ebc,0xf7));var _0xc0eb=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0ebc[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0xc0eb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc0eb('0x1'));var zipdir=require(_0xc0eb('0x2'));var jsonpatch=require(_0xc0eb('0x3'));var rp=require(_0xc0eb('0x4'));var moment=require(_0xc0eb('0x5'));var BPromise=require(_0xc0eb('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc0eb('0x7'));var sox=require(_0xc0eb('0x8'));var csv=require(_0xc0eb('0x9'));var ejs=require(_0xc0eb('0xa'));var fs=require('fs');var _=require(_0xc0eb('0xb'));var squel=require('squel');var crypto=require(_0xc0eb('0xc'));var jsforce=require(_0xc0eb('0xd'));var deskjs=require(_0xc0eb('0xe'));var toCsv=require(_0xc0eb('0x9'));var querystring=require(_0xc0eb('0xf'));var Papa=require(_0xc0eb('0x10'));var Redis=require(_0xc0eb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc0eb('0x12'));var hardwareService=require(_0xc0eb('0x13'));var logger=require(_0xc0eb('0x14'))(_0xc0eb('0x15'));var utils=require('../../config/utils');var config=require(_0xc0eb('0x16'));var db=require(_0xc0eb('0x17'))['db'];function respondWithStatusCode(_0x1461b5,_0x5d2468){_0x5d2468=_0x5d2468||0xcc;return function(_0x15a188){if(_0x15a188){return _0x1461b5[_0xc0eb('0x18')](_0x5d2468);}return _0x1461b5[_0xc0eb('0x19')](_0x5d2468)[_0xc0eb('0x1a')]();};}function respondWithResult(_0x4e49c4,_0x12a101){_0x12a101=_0x12a101||0xc8;return function(_0x3208d7){if(_0x3208d7){return _0x4e49c4[_0xc0eb('0x19')](_0x12a101)['json'](_0x3208d7);}};}function respondWithFilteredResult(_0xcba25d,_0x209b1c){return function(_0x115066){if(_0x115066){var _0x2befe7=_0x115066[_0xc0eb('0x1b')],_0x2341aa=_0x209b1c[_0xc0eb('0x1c')],_0x34edf9=_0x209b1c[_0xc0eb('0x1c')]+_0x209b1c['limit'],_0x1e3eb1;if(_0x34edf9>=_0x2befe7){_0x34edf9=_0x2befe7;_0x1e3eb1=0xc8;}else{_0x1e3eb1=0xce;}_0xcba25d[_0xc0eb('0x19')](_0x1e3eb1);return _0xcba25d[_0xc0eb('0x1d')](_0xc0eb('0x1e'),_0x2341aa+'-'+_0x34edf9+'/'+_0x2befe7)[_0xc0eb('0x1f')](_0x115066);}return null;};}function patchUpdates(_0x11b848){return function(_0x36405d){try{jsonpatch[_0xc0eb('0x20')](_0x36405d,_0x11b848,!![]);}catch(_0x18216e){return BPromise[_0xc0eb('0x21')](_0x18216e);}return _0x36405d['save']();};}function saveUpdates(_0x49ffc8,_0x29bd58){return function(_0x49a85a){if(_0x49a85a){return _0x49a85a[_0xc0eb('0x22')](_0x49ffc8)[_0xc0eb('0x23')](function(_0x3eefa5){return _0x3eefa5;});}return null;};}function removeEntity(_0x2712e3,_0x5a3ae0){return function(_0x266922){if(_0x266922){return _0x266922['destroy']()['then'](function(){var _0x4dd7e6=_0x266922[_0xc0eb('0x24')]({'plain':!![]});var _0xb2cdb7=_0xc0eb('0x25');return db[_0xc0eb('0x26')][_0xc0eb('0x27')]({'where':{'type':_0xb2cdb7,'resourceId':_0x4dd7e6['id']}})[_0xc0eb('0x23')](function(){return _0x266922;});})[_0xc0eb('0x23')](function(){_0x2712e3[_0xc0eb('0x19')](0xcc)[_0xc0eb('0x1a')]();});}};}function handleEntityNotFound(_0x1060ac,_0x22c573){return function(_0x49e3d2){if(!_0x49e3d2){_0x1060ac[_0xc0eb('0x18')](0x194);}return _0x49e3d2;};}function handleError(_0x357a89,_0xa90987){_0xa90987=_0xa90987||0x1f4;return function(_0x135635){logger['error'](_0x135635[_0xc0eb('0x28')]);if(_0x135635[_0xc0eb('0x29')]){delete _0x135635[_0xc0eb('0x29')];}_0x357a89[_0xc0eb('0x19')](_0xa90987)[_0xc0eb('0x2a')](_0x135635);};}exports['index']=function(_0x4e98a8,_0x4d2cd7){var _0x49d02f={},_0x282b6c={},_0x42d932={'count':0x0,'rows':[]};var _0x3622ec=db['SquareOdbc'][_0xc0eb('0x2b')];_0x282b6c['model']=_[_0xc0eb('0x2c')](_0x3622ec);_0x282b6c[_0xc0eb('0x2d')]=_[_0xc0eb('0x2c')](_0x4e98a8[_0xc0eb('0x2d')]);_0x282b6c[_0xc0eb('0x2e')]=_[_0xc0eb('0x2f')](_0x282b6c['model'],_0x282b6c['query']);_0x49d02f[_0xc0eb('0x30')]=_[_0xc0eb('0x2f')](_0x282b6c[_0xc0eb('0x31')],qs[_0xc0eb('0x32')](_0x4e98a8[_0xc0eb('0x2d')][_0xc0eb('0x32')]));_0x49d02f[_0xc0eb('0x30')]=_0x49d02f[_0xc0eb('0x30')]['length']?_0x49d02f['attributes']:_0x282b6c[_0xc0eb('0x31')];if(!_0x4e98a8[_0xc0eb('0x2d')][_0xc0eb('0x33')](_0xc0eb('0x34'))){_0x49d02f[_0xc0eb('0x35')]=qs[_0xc0eb('0x35')](_0x4e98a8['query'][_0xc0eb('0x35')]);_0x49d02f['offset']=qs[_0xc0eb('0x1c')](_0x4e98a8[_0xc0eb('0x2d')][_0xc0eb('0x1c')]);}_0x49d02f[_0xc0eb('0x36')]=qs[_0xc0eb('0x37')](_0x4e98a8[_0xc0eb('0x2d')][_0xc0eb('0x37')]);_0x49d02f['where']=qs[_0xc0eb('0x2e')](_['pick'](_0x4e98a8[_0xc0eb('0x2d')],_0x282b6c[_0xc0eb('0x2e')]));if(_0x4e98a8[_0xc0eb('0x2d')]['filter']){_0x49d02f[_0xc0eb('0x38')]=_[_0xc0eb('0x39')](_0x49d02f['where'],{'$or':_['map'](_0x3622ec,function(_0x3ff5fc){if(_0x3ff5fc[_0xc0eb('0x3a')][_0xc0eb('0x3b')]!==_0xc0eb('0x3c')){var _0x461223={};_0x461223[_0x3ff5fc[_0xc0eb('0x3d')]]={'$like':'%'+_0x4e98a8[_0xc0eb('0x2d')]['filter']+'%'};return _0x461223;}})});}_0x49d02f=_[_0xc0eb('0x39')]({},_0x49d02f,_0x4e98a8['options']);var _0x4cef16={'where':_0x49d02f['where']};return db[_0xc0eb('0x3e')]['count'](_0x4cef16)[_0xc0eb('0x23')](function(_0x126b7d){_0x42d932[_0xc0eb('0x1b')]=_0x126b7d;if(_0x4e98a8['query'][_0xc0eb('0x3f')]){_0x49d02f[_0xc0eb('0x40')]=[{'all':!![]}];}return db[_0xc0eb('0x3e')][_0xc0eb('0x41')](_0x49d02f);})[_0xc0eb('0x23')](function(_0x44de6a){_0x42d932['rows']=_0x44de6a;return _0x42d932;})[_0xc0eb('0x23')](respondWithFilteredResult(_0x4d2cd7,_0x49d02f))[_0xc0eb('0x42')](handleError(_0x4d2cd7,null));};exports[_0xc0eb('0x43')]=function(_0x1f7c7a,_0x9e68c0){var _0x51d461={'raw':!![],'where':{'id':_0x1f7c7a[_0xc0eb('0x44')]['id']}},_0x59eeac={};_0x59eeac[_0xc0eb('0x31')]=_['keys'](db[_0xc0eb('0x3e')]['rawAttributes']);_0x59eeac[_0xc0eb('0x2d')]=_[_0xc0eb('0x2c')](_0x1f7c7a[_0xc0eb('0x2d')]);_0x59eeac[_0xc0eb('0x2e')]=_[_0xc0eb('0x2f')](_0x59eeac[_0xc0eb('0x31')],_0x59eeac[_0xc0eb('0x2d')]);_0x51d461[_0xc0eb('0x30')]=_['intersection'](_0x59eeac[_0xc0eb('0x31')],qs['fields'](_0x1f7c7a[_0xc0eb('0x2d')]['fields']));_0x51d461['attributes']=_0x51d461[_0xc0eb('0x30')]['length']?_0x51d461['attributes']:_0x59eeac[_0xc0eb('0x31')];if(_0x1f7c7a[_0xc0eb('0x2d')][_0xc0eb('0x3f')]){_0x51d461[_0xc0eb('0x40')]=[{'all':!![]}];}_0x51d461=_[_0xc0eb('0x39')]({},_0x51d461,_0x1f7c7a['options']);return db[_0xc0eb('0x3e')]['find'](_0x51d461)[_0xc0eb('0x23')](handleEntityNotFound(_0x9e68c0,null))[_0xc0eb('0x23')](respondWithResult(_0x9e68c0,null))[_0xc0eb('0x42')](handleError(_0x9e68c0,null));};exports[_0xc0eb('0x45')]=function(_0x4a962e,_0x1a393d){return db['SquareOdbc'][_0xc0eb('0x45')](_0x4a962e[_0xc0eb('0x46')],{})[_0xc0eb('0x23')](function(_0x54246f){var _0xc4f7a=_0x4a962e[_0xc0eb('0x47')][_0xc0eb('0x24')]({'plain':!![]});if(!_0xc4f7a)throw new Error(_0xc0eb('0x48'));if(_0xc4f7a['role']===_0xc0eb('0x47')){var _0x42b010=_0x54246f[_0xc0eb('0x24')]({'plain':!![]});var _0x5f4d22='ODBC';return db[_0xc0eb('0x49')][_0xc0eb('0x4a')]({'where':{'name':_0x5f4d22,'userProfileId':_0xc4f7a['userProfileId']},'raw':!![]})[_0xc0eb('0x23')](function(_0x27c142){if(_0x27c142&&_0x27c142[_0xc0eb('0x4b')]===0x0){return db['UserProfileResource'][_0xc0eb('0x45')]({'name':_0x42b010[_0xc0eb('0x29')],'resourceId':_0x42b010['id'],'type':_0x27c142[_0xc0eb('0x29')],'sectionId':_0x27c142['id']},{})[_0xc0eb('0x23')](function(){return _0x54246f;});}else{return _0x54246f;}})[_0xc0eb('0x42')](function(_0x188cb9){logger[_0xc0eb('0x4c')](_0xc0eb('0x4d'),_0x188cb9);throw _0x188cb9;});}return _0x54246f;})[_0xc0eb('0x23')](respondWithResult(_0x1a393d,0xc9))[_0xc0eb('0x42')](handleError(_0x1a393d,null));};exports[_0xc0eb('0x22')]=function(_0x2ce627,_0x162f01){if(_0x2ce627[_0xc0eb('0x46')]['id']){delete _0x2ce627[_0xc0eb('0x46')]['id'];}return db[_0xc0eb('0x3e')][_0xc0eb('0x4a')]({'where':{'id':_0x2ce627[_0xc0eb('0x44')]['id']}})['then'](handleEntityNotFound(_0x162f01,null))['then'](saveUpdates(_0x2ce627[_0xc0eb('0x46')],null))[_0xc0eb('0x23')](respondWithResult(_0x162f01,null))[_0xc0eb('0x42')](handleError(_0x162f01,null));};exports['destroy']=function(_0x583487,_0x2dd722){return db[_0xc0eb('0x3e')][_0xc0eb('0x4a')]({'where':{'id':_0x583487['params']['id']}})[_0xc0eb('0x23')](handleEntityNotFound(_0x2dd722,null))[_0xc0eb('0x23')](removeEntity(_0x2dd722,null))[_0xc0eb('0x42')](handleError(_0x2dd722,null));};exports[_0xc0eb('0x4e')]=function(_0xfd05c3,_0x55a9d7,_0x514b7a){var _0x39fc46;return db[_0xc0eb('0x3e')][_0xc0eb('0x4a')]({'where':{'id':_0xfd05c3[_0xc0eb('0x44')]['id']},'attributes':['id',_0xc0eb('0x4f')]})[_0xc0eb('0x23')](handleEntityNotFound(_0x55a9d7,null))['then'](function(_0x2cdbc6){if(_0x2cdbc6){var _0x506ffe=require('odbc')();_0x506ffe[_0xc0eb('0x50')](_0x2cdbc6['dsn']);_0x506ffe[_0xc0eb('0x51')]();return _0x2cdbc6;}})[_0xc0eb('0x23')](respondWithResult(_0x55a9d7,null))['catch'](handleError(_0x55a9d7,null));}; \ No newline at end of file +var _0x6ea0=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ODBC','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','params','dsn','openSync','closeSync','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','save','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','SquareOdbc','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','map','type','VIRTUAL','field','merge','options','includeAll','include','rows','catch','show','find','create','body'];(function(_0x4bb208,_0x509f16){var _0x346fbc=function(_0x5e37f9){while(--_0x5e37f9){_0x4bb208['push'](_0x4bb208['shift']());}};_0x346fbc(++_0x509f16);}(_0x6ea0,0xaf));var _0x06ea=function(_0x2f7f89,_0x11fe51){_0x2f7f89=_0x2f7f89-0x0;var _0x2b0a66=_0x6ea0[_0x2f7f89];return _0x2b0a66;};'use strict';var pdf=require(_0x06ea('0x0'));var emlformat=require(_0x06ea('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x06ea('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x06ea('0x3'));var moment=require(_0x06ea('0x4'));var BPromise=require(_0x06ea('0x5'));var Mustache=require(_0x06ea('0x6'));var util=require(_0x06ea('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x06ea('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x06ea('0x9'));var jsforce=require(_0x06ea('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x06ea('0xb'));var Papa=require(_0x06ea('0xc'));var Redis=require(_0x06ea('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x06ea('0xe'));var hardwareService=require(_0x06ea('0xf'));var logger=require('../../config/logger')(_0x06ea('0x10'));var utils=require('../../config/utils');var config=require(_0x06ea('0x11'));var db=require(_0x06ea('0x12'))['db'];function respondWithStatusCode(_0x46697b,_0x2ad616){_0x2ad616=_0x2ad616||0xcc;return function(_0xa25607){if(_0xa25607){return _0x46697b[_0x06ea('0x13')](_0x2ad616);}return _0x46697b[_0x06ea('0x14')](_0x2ad616)['end']();};}function respondWithResult(_0x146b0f,_0x55031e){_0x55031e=_0x55031e||0xc8;return function(_0x5a77fc){if(_0x5a77fc){return _0x146b0f[_0x06ea('0x14')](_0x55031e)[_0x06ea('0x15')](_0x5a77fc);}};}function respondWithFilteredResult(_0x202c06,_0x1f1e31){return function(_0x69c0d0){if(_0x69c0d0){var _0x5f0fbc=_0x69c0d0[_0x06ea('0x16')],_0x53b9e0=_0x1f1e31['offset'],_0x108b4b=_0x1f1e31[_0x06ea('0x17')]+_0x1f1e31[_0x06ea('0x18')],_0x3b75e7;if(_0x108b4b>=_0x5f0fbc){_0x108b4b=_0x5f0fbc;_0x3b75e7=0xc8;}else{_0x3b75e7=0xce;}_0x202c06[_0x06ea('0x14')](_0x3b75e7);return _0x202c06[_0x06ea('0x19')](_0x06ea('0x1a'),_0x53b9e0+'-'+_0x108b4b+'/'+_0x5f0fbc)[_0x06ea('0x15')](_0x69c0d0);}return null;};}function patchUpdates(_0x549bcb){return function(_0x58f894){try{jsonpatch['apply'](_0x58f894,_0x549bcb,!![]);}catch(_0x9aa499){return BPromise['reject'](_0x9aa499);}return _0x58f894[_0x06ea('0x1b')]();};}function saveUpdates(_0xcf6b20,_0x563b8f){return function(_0x294e28){if(_0x294e28){return _0x294e28['update'](_0xcf6b20)[_0x06ea('0x1c')](function(_0x3edb7a){return _0x3edb7a;});}return null;};}function removeEntity(_0x40b87b,_0x2ed1d0){return function(_0x3eb736){if(_0x3eb736){return _0x3eb736['destroy']()[_0x06ea('0x1c')](function(){var _0x233785=_0x3eb736[_0x06ea('0x1d')]({'plain':!![]});var _0x431a3d='ODBC';return db[_0x06ea('0x1e')][_0x06ea('0x1f')]({'where':{'type':_0x431a3d,'resourceId':_0x233785['id']}})[_0x06ea('0x1c')](function(){return _0x3eb736;});})[_0x06ea('0x1c')](function(){_0x40b87b['status'](0xcc)[_0x06ea('0x20')]();});}};}function handleEntityNotFound(_0x4f6746,_0x2e0d8a){return function(_0x21a1b2){if(!_0x21a1b2){_0x4f6746[_0x06ea('0x13')](0x194);}return _0x21a1b2;};}function handleError(_0x517e77,_0x3c3cb6){_0x3c3cb6=_0x3c3cb6||0x1f4;return function(_0x5cc5b0){logger[_0x06ea('0x21')](_0x5cc5b0[_0x06ea('0x22')]);if(_0x5cc5b0[_0x06ea('0x23')]){delete _0x5cc5b0[_0x06ea('0x23')];}_0x517e77[_0x06ea('0x14')](_0x3c3cb6)[_0x06ea('0x24')](_0x5cc5b0);};}exports[_0x06ea('0x25')]=function(_0x15455a,_0x1978a1){var _0x40da14={},_0x3127a5={},_0x327b1b={'count':0x0,'rows':[]};var _0x495bb9=db[_0x06ea('0x26')][_0x06ea('0x27')];_0x3127a5[_0x06ea('0x28')]=_[_0x06ea('0x29')](_0x495bb9);_0x3127a5[_0x06ea('0x2a')]=_[_0x06ea('0x29')](_0x15455a['query']);_0x3127a5[_0x06ea('0x2b')]=_['intersection'](_0x3127a5['model'],_0x3127a5[_0x06ea('0x2a')]);_0x40da14[_0x06ea('0x2c')]=_[_0x06ea('0x2d')](_0x3127a5['model'],qs[_0x06ea('0x2e')](_0x15455a[_0x06ea('0x2a')][_0x06ea('0x2e')]));_0x40da14['attributes']=_0x40da14['attributes'][_0x06ea('0x2f')]?_0x40da14[_0x06ea('0x2c')]:_0x3127a5['model'];if(!_0x15455a[_0x06ea('0x2a')][_0x06ea('0x30')](_0x06ea('0x31'))){_0x40da14[_0x06ea('0x18')]=qs[_0x06ea('0x18')](_0x15455a[_0x06ea('0x2a')][_0x06ea('0x18')]);_0x40da14['offset']=qs[_0x06ea('0x17')](_0x15455a[_0x06ea('0x2a')]['offset']);}_0x40da14[_0x06ea('0x32')]=qs[_0x06ea('0x33')](_0x15455a['query'][_0x06ea('0x33')]);_0x40da14['where']=qs[_0x06ea('0x2b')](_['pick'](_0x15455a[_0x06ea('0x2a')],_0x3127a5[_0x06ea('0x2b')]));if(_0x15455a[_0x06ea('0x2a')][_0x06ea('0x34')]){_0x40da14['where']=_['merge'](_0x40da14[_0x06ea('0x35')],{'$or':_[_0x06ea('0x36')](_0x495bb9,function(_0x1fb4ac){if(_0x1fb4ac[_0x06ea('0x37')]['key']!==_0x06ea('0x38')){var _0x44a79d={};_0x44a79d[_0x1fb4ac[_0x06ea('0x39')]]={'$like':'%'+_0x15455a[_0x06ea('0x2a')][_0x06ea('0x34')]+'%'};return _0x44a79d;}})});}_0x40da14=_[_0x06ea('0x3a')]({},_0x40da14,_0x15455a[_0x06ea('0x3b')]);var _0x15af90={'where':_0x40da14[_0x06ea('0x35')]};return db['SquareOdbc']['count'](_0x15af90)['then'](function(_0x2b9779){_0x327b1b[_0x06ea('0x16')]=_0x2b9779;if(_0x15455a[_0x06ea('0x2a')][_0x06ea('0x3c')]){_0x40da14[_0x06ea('0x3d')]=[{'all':!![]}];}return db[_0x06ea('0x26')]['findAll'](_0x40da14);})[_0x06ea('0x1c')](function(_0xf2de02){_0x327b1b[_0x06ea('0x3e')]=_0xf2de02;return _0x327b1b;})['then'](respondWithFilteredResult(_0x1978a1,_0x40da14))[_0x06ea('0x3f')](handleError(_0x1978a1,null));};exports[_0x06ea('0x40')]=function(_0x5bd8a2,_0x548c2f){var _0x4ab5b7={'raw':!![],'where':{'id':_0x5bd8a2['params']['id']}},_0x1c9808={};_0x1c9808[_0x06ea('0x28')]=_[_0x06ea('0x29')](db[_0x06ea('0x26')][_0x06ea('0x27')]);_0x1c9808[_0x06ea('0x2a')]=_['keys'](_0x5bd8a2[_0x06ea('0x2a')]);_0x1c9808[_0x06ea('0x2b')]=_[_0x06ea('0x2d')](_0x1c9808['model'],_0x1c9808[_0x06ea('0x2a')]);_0x4ab5b7[_0x06ea('0x2c')]=_[_0x06ea('0x2d')](_0x1c9808['model'],qs['fields'](_0x5bd8a2[_0x06ea('0x2a')]['fields']));_0x4ab5b7['attributes']=_0x4ab5b7[_0x06ea('0x2c')][_0x06ea('0x2f')]?_0x4ab5b7[_0x06ea('0x2c')]:_0x1c9808['model'];if(_0x5bd8a2[_0x06ea('0x2a')][_0x06ea('0x3c')]){_0x4ab5b7[_0x06ea('0x3d')]=[{'all':!![]}];}_0x4ab5b7=_['merge']({},_0x4ab5b7,_0x5bd8a2['options']);return db[_0x06ea('0x26')][_0x06ea('0x41')](_0x4ab5b7)[_0x06ea('0x1c')](handleEntityNotFound(_0x548c2f,null))[_0x06ea('0x1c')](respondWithResult(_0x548c2f,null))[_0x06ea('0x3f')](handleError(_0x548c2f,null));};exports[_0x06ea('0x42')]=function(_0x4b3647,_0x597dee){return db[_0x06ea('0x26')][_0x06ea('0x42')](_0x4b3647[_0x06ea('0x43')],{})[_0x06ea('0x1c')](function(_0x2dd201){var _0x1f907a=_0x4b3647['user']['get']({'plain':!![]});if(!_0x1f907a)throw new Error(_0x06ea('0x44'));if(_0x1f907a[_0x06ea('0x45')]===_0x06ea('0x46')){var _0x500f63=_0x2dd201[_0x06ea('0x1d')]({'plain':!![]});var _0x4960e3=_0x06ea('0x47');return db[_0x06ea('0x48')]['find']({'where':{'name':_0x4960e3,'userProfileId':_0x1f907a[_0x06ea('0x49')]},'raw':!![]})[_0x06ea('0x1c')](function(_0x414d77){if(_0x414d77&&_0x414d77['autoAssociation']===0x0){return db[_0x06ea('0x1e')][_0x06ea('0x42')]({'name':_0x500f63[_0x06ea('0x23')],'resourceId':_0x500f63['id'],'type':_0x414d77[_0x06ea('0x23')],'sectionId':_0x414d77['id']},{})['then'](function(){return _0x2dd201;});}else{return _0x2dd201;}})[_0x06ea('0x3f')](function(_0xfe6c99){logger[_0x06ea('0x21')](_0x06ea('0x4a'),_0xfe6c99);throw _0xfe6c99;});}return _0x2dd201;})[_0x06ea('0x1c')](respondWithResult(_0x597dee,0xc9))[_0x06ea('0x3f')](handleError(_0x597dee,null));};exports[_0x06ea('0x4b')]=function(_0x59e2bd,_0x560cae){if(_0x59e2bd[_0x06ea('0x43')]['id']){delete _0x59e2bd[_0x06ea('0x43')]['id'];}return db[_0x06ea('0x26')][_0x06ea('0x41')]({'where':{'id':_0x59e2bd['params']['id']}})[_0x06ea('0x1c')](handleEntityNotFound(_0x560cae,null))[_0x06ea('0x1c')](saveUpdates(_0x59e2bd[_0x06ea('0x43')],null))[_0x06ea('0x1c')](respondWithResult(_0x560cae,null))[_0x06ea('0x3f')](handleError(_0x560cae,null));};exports[_0x06ea('0x1f')]=function(_0x8a2ce0,_0x5cf3e7){return db[_0x06ea('0x26')]['find']({'where':{'id':_0x8a2ce0['params']['id']}})[_0x06ea('0x1c')](handleEntityNotFound(_0x5cf3e7,null))[_0x06ea('0x1c')](removeEntity(_0x5cf3e7,null))['catch'](handleError(_0x5cf3e7,null));};exports[_0x06ea('0x4c')]=function(_0x159ab2,_0x3d9757,_0x389744){var _0x35f9e4;return db[_0x06ea('0x26')][_0x06ea('0x41')]({'where':{'id':_0x159ab2[_0x06ea('0x4d')]['id']},'attributes':['id',_0x06ea('0x4e')]})[_0x06ea('0x1c')](handleEntityNotFound(_0x3d9757,null))[_0x06ea('0x1c')](function(_0x1aae93){if(_0x1aae93){var _0x3a75e4=require('odbc')();_0x3a75e4[_0x06ea('0x4f')](_0x1aae93[_0x06ea('0x4e')]);_0x3a75e4[_0x06ea('0x50')]();return _0x1aae93;}})[_0x06ea('0x1c')](respondWithResult(_0x3d9757,null))[_0x06ea('0x3f')](handleError(_0x3d9757,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index a484e71..089405c 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 _0xb777=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc'];(function(_0x4a4ce1,_0x32a72d){var _0x21be14=function(_0x39a470){while(--_0x39a470){_0x4a4ce1['push'](_0x4a4ce1['shift']());}};_0x21be14(++_0x32a72d);}(_0xb777,0x1b8));var _0x7b77=function(_0x1b87fb,_0x3e6870){_0x1b87fb=_0x1b87fb-0x0;var _0xc7de31=_0xb777[_0x1b87fb];return _0xc7de31;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7b77('0x0'))('api');var moment=require('moment');var BPromise=require(_0x7b77('0x1'));var rp=require(_0x7b77('0x2'));var fs=require('fs');var path=require(_0x7b77('0x3'));var rimraf=require(_0x7b77('0x4'));var config=require(_0x7b77('0x5'));var attributes=require(_0x7b77('0x6'));module[_0x7b77('0x7')]=function(_0x463f08,_0x1b6462){return _0x463f08[_0x7b77('0x8')](_0x7b77('0x9'),attributes,{'tableName':_0x7b77('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe0c7=['square_odbc','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xe0c7,0x85));var _0x7e0c=function(_0x4c76ac,_0x4d92ba){_0x4c76ac=_0x4c76ac-0x0;var _0x1f032a=_0xe0c7[_0x4c76ac];return _0x1f032a;};'use strict';var _=require(_0x7e0c('0x0'));var util=require('util');var logger=require(_0x7e0c('0x1'))(_0x7e0c('0x2'));var moment=require('moment');var BPromise=require(_0x7e0c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7e0c('0x4'));var rimraf=require(_0x7e0c('0x5'));var config=require(_0x7e0c('0x6'));var attributes=require(_0x7e0c('0x7'));module[_0x7e0c('0x8')]=function(_0x606721,_0x35a513){return _0x606721[_0x7e0c('0x9')](_0x7e0c('0xa'),attributes,{'tableName':_0x7e0c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 4fd5560..9b0b95c 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 _0x859a=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','ShowSquareOdbc','SquareOdbc','options','raw','attributes','include','model','map','util','moment'];(function(_0x7ea1fb,_0x2f0b74){var _0x478241=function(_0xd06b3a){while(--_0xd06b3a){_0x7ea1fb['push'](_0x7ea1fb['shift']());}};_0x478241(++_0x2f0b74);}(_0x859a,0x1cf));var _0xa859=function(_0x18fb22,_0x552042){_0x18fb22=_0x18fb22-0x0;var _0x10e5ff=_0x859a[_0x18fb22];return _0x10e5ff;};'use strict';var _=require('lodash');var util=require(_0xa859('0x0'));var moment=require(_0xa859('0x1'));var BPromise=require(_0xa859('0x2'));var rs=require(_0xa859('0x3'));var fs=require('fs');var Redis=require(_0xa859('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa859('0x5'));var logger=require(_0xa859('0x6'))(_0xa859('0x7'));var config=require(_0xa859('0x8'));var jayson=require(_0xa859('0x9'));var client=jayson[_0xa859('0xa')][_0xa859('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a77d4,_0x345f9d,_0x2cd488){return new BPromise(function(_0x37c170,_0x5307fa){return client[_0xa859('0xc')](_0x3a77d4,_0x2cd488)[_0xa859('0xd')](function(_0x5953f9){logger['info'](_0xa859('0xe'),_0x345f9d,'request\x20sent');logger[_0xa859('0xf')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x345f9d,_0xa859('0x10'),JSON[_0xa859('0x11')](_0x5953f9));if(_0x5953f9[_0xa859('0x12')]){if(_0x5953f9[_0xa859('0x12')][_0xa859('0x13')]===0x1f4){logger[_0xa859('0x12')](_0xa859('0xe'),_0x345f9d,_0x5953f9[_0xa859('0x12')]['message']);return _0x5307fa(_0x5953f9['error'][_0xa859('0x14')]);}logger['error'](_0xa859('0xe'),_0x345f9d,_0x5953f9[_0xa859('0x12')][_0xa859('0x14')]);return _0x37c170(_0x5953f9['error'][_0xa859('0x14')]);}else{logger[_0xa859('0x15')]('SquareOdbc,\x20%s,\x20%s',_0x345f9d,_0xa859('0x10'));_0x37c170(_0x5953f9[_0xa859('0x16')][_0xa859('0x14')]);}})['catch'](function(_0xec88ee){logger[_0xa859('0x12')](_0xa859('0xe'),_0x345f9d,_0xec88ee);_0x5307fa(_0xec88ee);});});}exports[_0xa859('0x17')]=function(_0x5ecdca){var _0x425ab6=this;return new Promise(function(_0x2debf7,_0x687080){return db[_0xa859('0x18')]['find']({'raw':_0x5ecdca['options']?_0x5ecdca[_0xa859('0x19')][_0xa859('0x1a')]===undefined?!![]:![]:!![],'where':_0x5ecdca[_0xa859('0x19')]?_0x5ecdca[_0xa859('0x19')]['where']||null:null,'attributes':_0x5ecdca[_0xa859('0x19')]?_0x5ecdca[_0xa859('0x19')][_0xa859('0x1b')]||null:null,'include':_0x5ecdca[_0xa859('0x19')]?_0x5ecdca[_0xa859('0x19')][_0xa859('0x1c')]?_['map'](_0x5ecdca[_0xa859('0x19')]['include'],function(_0x4975b3){return{'model':db[_0x4975b3[_0xa859('0x1d')]],'as':_0x4975b3['as'],'attributes':_0x4975b3['attributes'],'include':_0x4975b3[_0xa859('0x1c')]?_[_0xa859('0x1e')](_0x4975b3[_0xa859('0x1c')],function(_0x5efac4){return{'model':db[_0x5efac4['model']],'as':_0x5efac4['as'],'attributes':_0x5efac4['attributes'],'include':_0x5efac4['include']?_[_0xa859('0x1e')](_0x5efac4[_0xa859('0x1c')],function(_0x513383){return{'model':db[_0x513383['model']],'as':_0x513383['as'],'attributes':_0x513383[_0xa859('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa859('0xd')](function(_0x3f73cf){logger[_0xa859('0x15')](_0xa859('0x17'),_0x5ecdca);logger[_0xa859('0xf')](_0xa859('0x17'),_0x5ecdca,JSON['stringify'](_0x3f73cf));_0x2debf7(_0x3f73cf);})['catch'](function(_0x4d2490){logger[_0xa859('0x12')](_0xa859('0x17'),_0x4d2490[_0xa859('0x14')],_0x5ecdca);_0x687080(_0x425ab6[_0xa859('0x12')](0x1f4,_0x4d2490[_0xa859('0x14')]));});});}; \ No newline at end of file +var _0x7dc4=['model','attributes','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ShowSquareOdbc','find','options','raw','where','include','map'];(function(_0x35e0a3,_0x1810cc){var _0x5c0e51=function(_0x9113b1){while(--_0x9113b1){_0x35e0a3['push'](_0x35e0a3['shift']());}};_0x5c0e51(++_0x1810cc);}(_0x7dc4,0x177));var _0x47dc=function(_0x244df9,_0x378d43){_0x244df9=_0x244df9-0x0;var _0x53575f=_0x7dc4[_0x244df9];return _0x53575f;};'use strict';var _=require('lodash');var util=require(_0x47dc('0x0'));var moment=require(_0x47dc('0x1'));var BPromise=require(_0x47dc('0x2'));var rs=require(_0x47dc('0x3'));var fs=require('fs');var Redis=require(_0x47dc('0x4'));var db=require(_0x47dc('0x5'))['db'];var utils=require(_0x47dc('0x6'));var logger=require(_0x47dc('0x7'))(_0x47dc('0x8'));var config=require('../../config/environment');var jayson=require(_0x47dc('0x9'));var client=jayson[_0x47dc('0xa')][_0x47dc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a6c7c,_0x317216,_0x117e90){return new BPromise(function(_0x4e7f2b,_0x172938){return client['request'](_0x2a6c7c,_0x117e90)['then'](function(_0x41496a){logger[_0x47dc('0xc')](_0x47dc('0xd'),_0x317216,_0x47dc('0xe'));logger[_0x47dc('0xf')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x317216,_0x47dc('0xe'),JSON['stringify'](_0x41496a));if(_0x41496a['error']){if(_0x41496a[_0x47dc('0x10')][_0x47dc('0x11')]===0x1f4){logger[_0x47dc('0x10')](_0x47dc('0xd'),_0x317216,_0x41496a[_0x47dc('0x10')]['message']);return _0x172938(_0x41496a['error'][_0x47dc('0x12')]);}logger[_0x47dc('0x10')](_0x47dc('0xd'),_0x317216,_0x41496a[_0x47dc('0x10')][_0x47dc('0x12')]);return _0x4e7f2b(_0x41496a[_0x47dc('0x10')]['message']);}else{logger[_0x47dc('0xc')](_0x47dc('0xd'),_0x317216,'request\x20sent');_0x4e7f2b(_0x41496a[_0x47dc('0x13')][_0x47dc('0x12')]);}})[_0x47dc('0x14')](function(_0x5ce562){logger[_0x47dc('0x10')](_0x47dc('0xd'),_0x317216,_0x5ce562);_0x172938(_0x5ce562);});});}exports[_0x47dc('0x15')]=function(_0x5443c4){var _0x12dd81=this;return new Promise(function(_0x2c3037,_0x2d9e3d){return db['SquareOdbc'][_0x47dc('0x16')]({'raw':_0x5443c4[_0x47dc('0x17')]?_0x5443c4['options'][_0x47dc('0x18')]===undefined?!![]:![]:!![],'where':_0x5443c4['options']?_0x5443c4[_0x47dc('0x17')][_0x47dc('0x19')]||null:null,'attributes':_0x5443c4[_0x47dc('0x17')]?_0x5443c4['options']['attributes']||null:null,'include':_0x5443c4[_0x47dc('0x17')]?_0x5443c4['options'][_0x47dc('0x1a')]?_[_0x47dc('0x1b')](_0x5443c4[_0x47dc('0x17')][_0x47dc('0x1a')],function(_0x10ba82){return{'model':db[_0x10ba82[_0x47dc('0x1c')]],'as':_0x10ba82['as'],'attributes':_0x10ba82[_0x47dc('0x1d')],'include':_0x10ba82[_0x47dc('0x1a')]?_['map'](_0x10ba82[_0x47dc('0x1a')],function(_0x1e4cf6){return{'model':db[_0x1e4cf6[_0x47dc('0x1c')]],'as':_0x1e4cf6['as'],'attributes':_0x1e4cf6[_0x47dc('0x1d')],'include':_0x1e4cf6[_0x47dc('0x1a')]?_['map'](_0x1e4cf6[_0x47dc('0x1a')],function(_0xe41e51){return{'model':db[_0xe41e51[_0x47dc('0x1c')]],'as':_0xe41e51['as'],'attributes':_0xe41e51[_0x47dc('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x47dc('0x1e')](function(_0x2d8973){logger[_0x47dc('0xc')](_0x47dc('0x15'),_0x5443c4);logger[_0x47dc('0xf')](_0x47dc('0x15'),_0x5443c4,JSON['stringify'](_0x2d8973));_0x2c3037(_0x2d8973);})['catch'](function(_0x1cc556){logger[_0x47dc('0x10')](_0x47dc('0x15'),_0x1cc556['message'],_0x5443c4);_0x2d9e3d(_0x12dd81[_0x47dc('0x10')](0x1f4,_0x1cc556[_0x47dc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 9941fc2..5e189c5 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 _0xe89b=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/users','post','addUsers','put','/:id','update','delete','destroy','removeUsers','multer','util','connect-timeout'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xe89b,0x19f));var _0xbe89=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xe89b[_0x160c73];return _0xd9302;};'use strict';var multer=require(_0xbe89('0x0'));var util=require(_0xbe89('0x1'));var path=require('path');var timeout=require(_0xbe89('0x2'));var express=require(_0xbe89('0x3'));var router=express[_0xbe89('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xbe89('0x5'));var config=require(_0xbe89('0x6'));var controller=require('./squareProject.controller');router[_0xbe89('0x7')]('/',auth[_0xbe89('0x8')](),controller['index']);router[_0xbe89('0x7')]('/:id',auth[_0xbe89('0x8')](),controller[_0xbe89('0x9')]);router['get'](_0xbe89('0xa'),auth['isAuthenticated'](),controller['getUsers']);router['post']('/',auth[_0xbe89('0x8')](),controller['create']);router[_0xbe89('0xb')]('/:id/users',auth[_0xbe89('0x8')](),controller[_0xbe89('0xc')]);router[_0xbe89('0xd')](_0xbe89('0xe'),auth[_0xbe89('0x8')](),controller[_0xbe89('0xf')]);router[_0xbe89('0x10')](_0xbe89('0xe'),auth['isAuthenticated'](),controller[_0xbe89('0x11')]);router['delete']('/:id/users',auth[_0xbe89('0x8')](),controller[_0xbe89('0x12')]);module['exports']=router; \ No newline at end of file +var _0xa245=['removeUsers','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareProject.controller','get','index','/:id','isAuthenticated','show','/:id/users','post','create','addUsers','update','destroy','delete'];(function(_0x8d0526,_0x2a7105){var _0x48f127=function(_0x5780f6){while(--_0x5780f6){_0x8d0526['push'](_0x8d0526['shift']());}};_0x48f127(++_0x2a7105);}(_0xa245,0x136));var _0x5a24=function(_0x60204a,_0x2f3f34){_0x60204a=_0x60204a-0x0;var _0x55da21=_0xa245[_0x60204a];return _0x55da21;};'use strict';var multer=require(_0x5a24('0x0'));var util=require('util');var path=require(_0x5a24('0x1'));var timeout=require(_0x5a24('0x2'));var express=require(_0x5a24('0x3'));var router=express[_0x5a24('0x4')]();var auth=require(_0x5a24('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5a24('0x6'));var controller=require(_0x5a24('0x7'));router[_0x5a24('0x8')]('/',auth['isAuthenticated'](),controller[_0x5a24('0x9')]);router[_0x5a24('0x8')](_0x5a24('0xa'),auth[_0x5a24('0xb')](),controller[_0x5a24('0xc')]);router['get'](_0x5a24('0xd'),auth[_0x5a24('0xb')](),controller['getUsers']);router[_0x5a24('0xe')]('/',auth[_0x5a24('0xb')](),controller[_0x5a24('0xf')]);router[_0x5a24('0xe')]('/:id/users',auth[_0x5a24('0xb')](),controller[_0x5a24('0x10')]);router['put'](_0x5a24('0xa'),auth['isAuthenticated'](),controller[_0x5a24('0x11')]);router['delete'](_0x5a24('0xa'),auth['isAuthenticated'](),controller[_0x5a24('0x12')]);router[_0x5a24('0x13')](_0x5a24('0xd'),auth[_0x5a24('0xb')](),controller[_0x5a24('0x14')]);module[_0x5a24('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 7beed6d..15e86ac 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 _0x49df=['toString','utf8','production','STRING','name','TEXT','BLOB','long','getDataValue','preproduction'];(function(_0x12a193,_0xff5e4a){var _0x87291a=function(_0x54f675){while(--_0x54f675){_0x12a193['push'](_0x12a193['shift']());}};_0x87291a(++_0xff5e4a);}(_0x49df,0xad));var _0xf49d=function(_0x130079,_0x41274e){_0x130079=_0x130079-0x0;var _0x3b21fc=_0x49df[_0x130079];return _0x3b21fc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf49d('0x0')],'unique':_0xf49d('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xf49d('0x0')]},'notes':{'type':Sequelize[_0xf49d('0x2')]},'preproduction':{'type':Sequelize[_0xf49d('0x3')](_0xf49d('0x4')),'get':function(){if(this[_0xf49d('0x5')]('preproduction')){return this[_0xf49d('0x5')](_0xf49d('0x6'))[_0xf49d('0x7')](_0xf49d('0x8'));}}},'production':{'type':Sequelize[_0xf49d('0x3')](_0xf49d('0x4')),'get':function(){if(this['getDataValue'](_0xf49d('0x9'))){return this[_0xf49d('0x5')](_0xf49d('0x9'))['toString']('utf8');}}}}; \ No newline at end of file +var _0x27a8=['TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','STRING','name'];(function(_0x3f5989,_0xb38dd2){var _0x3007da=function(_0x469d78){while(--_0x469d78){_0x3f5989['push'](_0x3f5989['shift']());}};_0x3007da(++_0xb38dd2);}(_0x27a8,0x170));var _0x827a=function(_0x50396d,_0x3c9586){_0x50396d=_0x50396d-0x0;var _0x5ce515=_0x27a8[_0x50396d];return _0x5ce515;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x827a('0x0')],'unique':_0x827a('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x827a('0x0')]},'notes':{'type':Sequelize[_0x827a('0x2')]},'preproduction':{'type':Sequelize[_0x827a('0x3')](_0x827a('0x4')),'get':function(){if(this[_0x827a('0x5')](_0x827a('0x6'))){return this[_0x827a('0x5')](_0x827a('0x6'))[_0x827a('0x7')](_0x827a('0x8'));}}},'production':{'type':Sequelize[_0x827a('0x3')](_0x827a('0x4')),'get':function(){if(this[_0x827a('0x5')](_0x827a('0x9'))){return this[_0x827a('0x5')](_0x827a('0x9'))[_0x827a('0x7')](_0x827a('0x8'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 936be6c..b91b1c9 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 _0x2ef3=['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/logger','api','../../config/utils','../../config/environment','redis','socket.io-emitter','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','SquareProjects','UserProfileResource','destroy','then','error','name','send','SquareProject','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','rows','catch','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addUsers','omit','ids','removeUsers','isArray','emit','getUsers','User','order','hasOwnProperty','nolimit','html-pdf','eml-format'];(function(_0x39eb48,_0x5da47c){var _0x10f0b9=function(_0x2c1631){while(--_0x2c1631){_0x39eb48['push'](_0x39eb48['shift']());}};_0x10f0b9(++_0x5da47c);}(_0x2ef3,0xba));var _0x32ef=function(_0x2ee65d,_0x2a9d2e){_0x2ee65d=_0x2ee65d-0x0;var _0xe733a5=_0x2ef3[_0x2ee65d];return _0xe733a5;};'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 hardwareService=require('../../config/license/hardware');var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];config[_0x32ef('0x18')]=_['defaults'](config[_0x32ef('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x32ef('0x19'))(new Redis(config[_0x32ef('0x18')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xcc;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x1a')](_0x4d8009);}return _0x19ce1[_0x32ef('0x1b')](_0x4d8009)[_0x32ef('0x1c')]();};}function respondWithResult(_0x57aff1,_0x55bf0b){_0x55bf0b=_0x55bf0b||0xc8;return function(_0x531e30){if(_0x531e30){return _0x57aff1[_0x32ef('0x1b')](_0x55bf0b)[_0x32ef('0x1d')](_0x531e30);}};}function respondWithFilteredResult(_0xb5aed2,_0x53a5ca){return function(_0x5d559b){if(_0x5d559b){var _0x1eb468=_0x5d559b[_0x32ef('0x1e')],_0x1a9476=_0x53a5ca[_0x32ef('0x1f')],_0x286bfb=_0x53a5ca['offset']+_0x53a5ca[_0x32ef('0x20')],_0x57863c;if(_0x286bfb>=_0x1eb468){_0x286bfb=_0x1eb468;_0x57863c=0xc8;}else{_0x57863c=0xce;}_0xb5aed2[_0x32ef('0x1b')](_0x57863c);return _0xb5aed2[_0x32ef('0x21')](_0x32ef('0x22'),_0x1a9476+'-'+_0x286bfb+'/'+_0x1eb468)[_0x32ef('0x1d')](_0x5d559b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x23')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x24')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x25')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x26')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){var _0x19ea6=_0x225feb['get']({'plain':!![]});var _0x51a412=_0x32ef('0x27');return db[_0x32ef('0x28')][_0x32ef('0x29')]({'where':{'type':_0x51a412,'resourceId':_0x19ea6['id']}})[_0x32ef('0x2a')](function(){return _0x225feb;});})[_0x32ef('0x2a')](function(){_0x22f2d7[_0x32ef('0x1b')](0xcc)[_0x32ef('0x1c')]();});}};}function handleEntityNotFound(_0x38aed5,_0x338f19){return function(_0x2f52d7){if(!_0x2f52d7){_0x38aed5[_0x32ef('0x1a')](0x194);}return _0x2f52d7;};}function handleError(_0xba4b3f,_0x5a88a5){_0x5a88a5=_0x5a88a5||0x1f4;return function(_0xd65fde){logger[_0x32ef('0x2b')](_0xd65fde['stack']);if(_0xd65fde[_0x32ef('0x2c')]){delete _0xd65fde[_0x32ef('0x2c')];}_0xba4b3f[_0x32ef('0x1b')](_0x5a88a5)[_0x32ef('0x2d')](_0xd65fde);};}exports['index']=function(_0x10e38c,_0x22bf86){var _0x31dbc3={},_0x2ac686={},_0x1b668a={'count':0x0,'rows':[]};var _0x1a6ed2=db[_0x32ef('0x2e')]['rawAttributes'];_0x2ac686[_0x32ef('0x2f')]=_['keys'](_0x1a6ed2);_0x2ac686[_0x32ef('0x30')]=_[_0x32ef('0x31')](_0x10e38c['query']);_0x2ac686[_0x32ef('0x32')]=_[_0x32ef('0x33')](_0x2ac686[_0x32ef('0x2f')],_0x2ac686[_0x32ef('0x30')]);_0x31dbc3[_0x32ef('0x34')]=_['intersection'](_0x2ac686['model'],qs[_0x32ef('0x35')](_0x10e38c['query'][_0x32ef('0x35')]));_0x31dbc3[_0x32ef('0x34')]=_0x31dbc3[_0x32ef('0x34')][_0x32ef('0x36')]?_0x31dbc3[_0x32ef('0x34')]:_0x2ac686[_0x32ef('0x2f')];if(!_0x10e38c['query']['hasOwnProperty']('nolimit')){_0x31dbc3[_0x32ef('0x20')]=qs[_0x32ef('0x20')](_0x10e38c[_0x32ef('0x30')]['limit']);_0x31dbc3['offset']=qs[_0x32ef('0x1f')](_0x10e38c[_0x32ef('0x30')][_0x32ef('0x1f')]);}_0x31dbc3['order']=qs['sort'](_0x10e38c[_0x32ef('0x30')][_0x32ef('0x37')]);_0x31dbc3[_0x32ef('0x38')]=qs[_0x32ef('0x32')](_[_0x32ef('0x39')](_0x10e38c[_0x32ef('0x30')],_0x2ac686[_0x32ef('0x32')]));if(_0x10e38c[_0x32ef('0x30')][_0x32ef('0x3a')]){_0x31dbc3['where']=_[_0x32ef('0x3b')](_0x31dbc3[_0x32ef('0x38')],{'$or':_[_0x32ef('0x3c')](_0x1a6ed2,function(_0x4b97dc){if(_0x4b97dc[_0x32ef('0x3d')][_0x32ef('0x3e')]!==_0x32ef('0x3f')){var _0x393a89={};_0x393a89[_0x4b97dc[_0x32ef('0x40')]]={'$like':'%'+_0x10e38c[_0x32ef('0x30')][_0x32ef('0x3a')]+'%'};return _0x393a89;}})});}_0x31dbc3=_[_0x32ef('0x3b')]({},_0x31dbc3,_0x10e38c[_0x32ef('0x41')]);var _0x57a3c0={'where':_0x31dbc3[_0x32ef('0x38')]};return db[_0x32ef('0x2e')]['count'](_0x57a3c0)[_0x32ef('0x2a')](function(_0xc3a6d3){_0x1b668a[_0x32ef('0x1e')]=_0xc3a6d3;if(_0x10e38c[_0x32ef('0x30')][_0x32ef('0x42')]){_0x31dbc3[_0x32ef('0x43')]=[{'all':!![]}];}return db[_0x32ef('0x2e')]['findAll'](_0x31dbc3);})['then'](function(_0x399caa){_0x1b668a[_0x32ef('0x44')]=_0x399caa;return _0x1b668a;})[_0x32ef('0x2a')](respondWithFilteredResult(_0x22bf86,_0x31dbc3))[_0x32ef('0x45')](handleError(_0x22bf86,null));};exports['show']=function(_0x2901a1,_0x1f323a){var _0x5d2f06={'raw':![],'where':{'id':_0x2901a1['params']['id']}},_0x4744ba={};_0x4744ba[_0x32ef('0x2f')]=_[_0x32ef('0x31')](db[_0x32ef('0x2e')][_0x32ef('0x46')]);_0x4744ba[_0x32ef('0x30')]=_[_0x32ef('0x31')](_0x2901a1[_0x32ef('0x30')]);_0x4744ba[_0x32ef('0x32')]=_[_0x32ef('0x33')](_0x4744ba[_0x32ef('0x2f')],_0x4744ba['query']);_0x5d2f06[_0x32ef('0x34')]=_['intersection'](_0x4744ba[_0x32ef('0x2f')],qs[_0x32ef('0x35')](_0x2901a1[_0x32ef('0x30')]['fields']));_0x5d2f06[_0x32ef('0x34')]=_0x5d2f06[_0x32ef('0x34')][_0x32ef('0x36')]?_0x5d2f06[_0x32ef('0x34')]:_0x4744ba[_0x32ef('0x2f')];if(_0x2901a1[_0x32ef('0x30')][_0x32ef('0x42')]){_0x5d2f06['include']=[{'all':!![]}];}_0x5d2f06=_['merge']({},_0x5d2f06,_0x2901a1[_0x32ef('0x41')]);return db[_0x32ef('0x2e')][_0x32ef('0x47')](_0x5d2f06)[_0x32ef('0x2a')](handleEntityNotFound(_0x1f323a,null))[_0x32ef('0x2a')](respondWithResult(_0x1f323a,null))[_0x32ef('0x45')](handleError(_0x1f323a,null));};exports[_0x32ef('0x48')]=function(_0x115fa3,_0xc10e7){return db[_0x32ef('0x2e')][_0x32ef('0x48')](_0x115fa3[_0x32ef('0x49')],{})[_0x32ef('0x2a')](function(_0x4c2534){var _0x420f00=_0x115fa3[_0x32ef('0x4a')][_0x32ef('0x4b')]({'plain':!![]});if(!_0x420f00)throw new Error(_0x32ef('0x4c'));if(_0x420f00[_0x32ef('0x4d')]===_0x32ef('0x4a')){var _0x278696=_0x4c2534[_0x32ef('0x4b')]({'plain':!![]});var _0x24d8b4=_0x32ef('0x27');return db[_0x32ef('0x4e')][_0x32ef('0x47')]({'where':{'name':_0x24d8b4,'userProfileId':_0x420f00[_0x32ef('0x4f')]},'raw':!![]})[_0x32ef('0x2a')](function(_0x307ac8){if(_0x307ac8&&_0x307ac8[_0x32ef('0x50')]===0x0){return db[_0x32ef('0x28')][_0x32ef('0x48')]({'name':_0x278696['name'],'resourceId':_0x278696['id'],'type':_0x307ac8['name'],'sectionId':_0x307ac8['id']},{})[_0x32ef('0x2a')](function(){return _0x4c2534;});}else{return _0x4c2534;}})[_0x32ef('0x45')](function(_0xa9bf19){logger[_0x32ef('0x2b')](_0x32ef('0x51'),_0xa9bf19);throw _0xa9bf19;});}return _0x4c2534;})[_0x32ef('0x2a')](respondWithResult(_0xc10e7,0xc9))[_0x32ef('0x45')](handleError(_0xc10e7,null));};exports[_0x32ef('0x26')]=function(_0x15b640,_0x368bf1){if(_0x15b640[_0x32ef('0x49')]['id']){delete _0x15b640['body']['id'];}return db[_0x32ef('0x2e')][_0x32ef('0x47')]({'where':{'id':_0x15b640[_0x32ef('0x52')]['id']}})[_0x32ef('0x2a')](handleEntityNotFound(_0x368bf1,null))[_0x32ef('0x2a')](saveUpdates(_0x15b640[_0x32ef('0x49')],null))['then'](respondWithResult(_0x368bf1,null))[_0x32ef('0x45')](handleError(_0x368bf1,null));};exports[_0x32ef('0x29')]=function(_0x31d5d8,_0x56b7ce){return db[_0x32ef('0x2e')]['find']({'where':{'id':_0x31d5d8[_0x32ef('0x52')]['id']}})[_0x32ef('0x2a')](handleEntityNotFound(_0x56b7ce,null))['then'](removeEntity(_0x56b7ce,null))[_0x32ef('0x45')](handleError(_0x56b7ce,null));};exports['addUsers']=function(_0x13f5db,_0x1d974c,_0x2bff39){return db[_0x32ef('0x2e')][_0x32ef('0x47')]({'where':{'id':_0x13f5db[_0x32ef('0x52')]['id']}})[_0x32ef('0x2a')](handleEntityNotFound(_0x1d974c,null))['then'](function(_0x56cc75){if(_0x56cc75){return _0x56cc75[_0x32ef('0x53')](_0x13f5db['body']['ids'],_[_0x32ef('0x54')](_0x13f5db[_0x32ef('0x49')],[_0x32ef('0x55'),'id'])||{});}})[_0x32ef('0x2a')](respondWithResult(_0x1d974c,null))[_0x32ef('0x45')](handleError(_0x1d974c,null));};exports[_0x32ef('0x56')]=function(_0x316547,_0x4249c3,_0x2b2cd4){return db[_0x32ef('0x2e')]['find']({'where':{'id':_0x316547['params']['id']}})[_0x32ef('0x2a')](handleEntityNotFound(_0x4249c3,null))[_0x32ef('0x2a')](function(_0x5549b4){if(_0x5549b4){return _0x5549b4[_0x32ef('0x56')](_0x316547[_0x32ef('0x30')][_0x32ef('0x55')])['then'](function(){if(_[_0x32ef('0x57')](_0x316547[_0x32ef('0x30')][_0x32ef('0x55')])){for(var _0x52dfe0=0x0;_0x52dfe0<_0x316547['query'][_0x32ef('0x55')]['length'];_0x52dfe0+=0x1){socket[_0x32ef('0x58')]('userSquareProject:remove',{'UserId':Number(_0x316547['query'][_0x32ef('0x55')][_0x52dfe0]),'SquareProjectId':Number(_0x316547[_0x32ef('0x52')]['id'])});}}else{socket[_0x32ef('0x58')]('userSquareProject:remove',{'UserId':Number(_0x316547[_0x32ef('0x30')][_0x32ef('0x55')]),'SquareProjectId':Number(_0x316547[_0x32ef('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x4249c3,null))[_0x32ef('0x45')](handleError(_0x4249c3,null));};exports[_0x32ef('0x59')]=function(_0x4c3bab,_0x4a4eaa,_0x2e20dc){var _0x3a6697={};var _0x2518a0={};var _0x339625;var _0x4c4df8;return db[_0x32ef('0x2e')]['findOne']({'where':{'id':_0x4c3bab[_0x32ef('0x52')]['id']}})[_0x32ef('0x2a')](handleEntityNotFound(_0x4a4eaa,null))[_0x32ef('0x2a')](function(_0x36ed97){if(_0x36ed97){_0x339625=_0x36ed97;_0x2518a0[_0x32ef('0x2f')]=_[_0x32ef('0x31')](db[_0x32ef('0x5a')][_0x32ef('0x46')]);_0x2518a0[_0x32ef('0x30')]=_['keys'](_0x4c3bab[_0x32ef('0x30')]);_0x2518a0[_0x32ef('0x32')]=_[_0x32ef('0x33')](_0x2518a0[_0x32ef('0x2f')],_0x2518a0[_0x32ef('0x30')]);_0x3a6697['attributes']=_['intersection'](_0x2518a0[_0x32ef('0x2f')],qs[_0x32ef('0x35')](_0x4c3bab[_0x32ef('0x30')][_0x32ef('0x35')]));_0x3a6697[_0x32ef('0x34')]=_0x3a6697['attributes'][_0x32ef('0x36')]?_0x3a6697['attributes']:_0x2518a0[_0x32ef('0x2f')];_0x3a6697[_0x32ef('0x5b')]=qs['sort'](_0x4c3bab['query'][_0x32ef('0x37')]);_0x3a6697[_0x32ef('0x38')]=qs[_0x32ef('0x32')](_['pick'](_0x4c3bab['query'],_0x2518a0[_0x32ef('0x32')]));if(_0x4c3bab[_0x32ef('0x30')][_0x32ef('0x3a')]){_0x3a6697[_0x32ef('0x38')]=_['merge'](_0x3a6697[_0x32ef('0x38')],{'$or':_[_0x32ef('0x3c')](_0x3a6697[_0x32ef('0x34')],function(_0xd7a78){var _0x9df27c={};_0x9df27c[_0xd7a78]={'$like':'%'+_0x4c3bab[_0x32ef('0x30')][_0x32ef('0x3a')]+'%'};return _0x9df27c;})});}_0x3a6697=_[_0x32ef('0x3b')]({},_0x3a6697,_0x4c3bab[_0x32ef('0x41')]);return _0x339625[_0x32ef('0x59')](_0x3a6697);}})[_0x32ef('0x2a')](function(_0x3978cb){if(_0x3978cb){_0x4c4df8=_0x3978cb['length'];if(!_0x4c3bab['query'][_0x32ef('0x5c')](_0x32ef('0x5d'))){_0x3a6697['limit']=qs[_0x32ef('0x20')](_0x4c3bab['query'][_0x32ef('0x20')]);_0x3a6697[_0x32ef('0x1f')]=qs[_0x32ef('0x1f')](_0x4c3bab['query'][_0x32ef('0x1f')]);}return _0x339625['getUsers'](_0x3a6697);}})[_0x32ef('0x2a')](function(_0x29b826){if(_0x29b826){return _0x29b826?{'count':_0x4c4df8,'rows':_0x29b826}:null;}})['then'](respondWithResult(_0x4a4eaa,null))['catch'](handleError(_0x4a4eaa,null));}; \ No newline at end of file +var _0x5f2f=['params','rawAttributes','find','catch','create','role','UserProfileSection','error','update','body','addUsers','ids','omit','removeUsers','isArray','userSquareProject:remove','getUsers','findOne','User','pick','map','hasOwnProperty','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','../../config/license/hardware','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','SquareProjects','UserProfileResource','destroy','stack','name','index','SquareProject','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','show'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x23898c,_0x25d8a2){_0x23898c=_0x23898c-0x0;var _0xcf58ac=_0x5f2f[_0x23898c];return _0xcf58ac;};'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 hardwareService=require(_0xf5f2('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf5f2('0x14'));var config=require(_0xf5f2('0x15'));var db=require('../../mysqldb')['db'];config[_0xf5f2('0x16')]=_[_0xf5f2('0x17')](config[_0xf5f2('0x16')],{'host':_0xf5f2('0x18'),'port':0x18eb});var socket=require(_0xf5f2('0x19'))(new Redis(config[_0xf5f2('0x16')]));require('./squareProject.socket')[_0xf5f2('0x1a')](socket);function respondWithStatusCode(_0xea612c,_0x269909){_0x269909=_0x269909||0xcc;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1b')](_0x269909);}return _0xea612c['status'](_0x269909)[_0xf5f2('0x1c')]();};}function respondWithResult(_0x286197,_0x17d656){_0x17d656=_0x17d656||0xc8;return function(_0x1b6dd2){if(_0x1b6dd2){return _0x286197[_0xf5f2('0x1d')](_0x17d656)[_0xf5f2('0x1e')](_0x1b6dd2);}};}function respondWithFilteredResult(_0xdb61b3,_0x395a5a){return function(_0x11f702){if(_0x11f702){var _0x228ace=_0x11f702[_0xf5f2('0x1f')],_0x20fccd=_0x395a5a[_0xf5f2('0x20')],_0x28e097=_0x395a5a[_0xf5f2('0x20')]+_0x395a5a[_0xf5f2('0x21')],_0x4ff59b;if(_0x28e097>=_0x228ace){_0x28e097=_0x228ace;_0x4ff59b=0xc8;}else{_0x4ff59b=0xce;}_0xdb61b3['status'](_0x4ff59b);return _0xdb61b3[_0xf5f2('0x22')](_0xf5f2('0x23'),_0x20fccd+'-'+_0x28e097+'/'+_0x228ace)['json'](_0x11f702);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x24')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x25')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x26')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x27')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){var _0x5f1124=_0x287ad5[_0xf5f2('0x28')]({'plain':!![]});var _0x13da6f=_0xf5f2('0x29');return db[_0xf5f2('0x2a')][_0xf5f2('0x2b')]({'where':{'type':_0x13da6f,'resourceId':_0x5f1124['id']}})[_0xf5f2('0x27')](function(){return _0x287ad5;});})[_0xf5f2('0x27')](function(){_0x4e8bda[_0xf5f2('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xaa2602,_0x102449){return function(_0x375ca8){if(!_0x375ca8){_0xaa2602[_0xf5f2('0x1b')](0x194);}return _0x375ca8;};}function handleError(_0x198c73,_0x477604){_0x477604=_0x477604||0x1f4;return function(_0x5b6672){logger['error'](_0x5b6672[_0xf5f2('0x2c')]);if(_0x5b6672[_0xf5f2('0x2d')]){delete _0x5b6672[_0xf5f2('0x2d')];}_0x198c73['status'](_0x477604)['send'](_0x5b6672);};}exports[_0xf5f2('0x2e')]=function(_0x50b8a2,_0x17394a){var _0x153924={},_0x1b381e={},_0x54c0c8={'count':0x0,'rows':[]};var _0x52e959=db[_0xf5f2('0x2f')]['rawAttributes'];_0x1b381e[_0xf5f2('0x30')]=_['keys'](_0x52e959);_0x1b381e[_0xf5f2('0x31')]=_[_0xf5f2('0x32')](_0x50b8a2[_0xf5f2('0x31')]);_0x1b381e[_0xf5f2('0x33')]=_[_0xf5f2('0x34')](_0x1b381e[_0xf5f2('0x30')],_0x1b381e[_0xf5f2('0x31')]);_0x153924[_0xf5f2('0x35')]=_['intersection'](_0x1b381e[_0xf5f2('0x30')],qs[_0xf5f2('0x36')](_0x50b8a2[_0xf5f2('0x31')][_0xf5f2('0x36')]));_0x153924[_0xf5f2('0x35')]=_0x153924[_0xf5f2('0x35')][_0xf5f2('0x37')]?_0x153924['attributes']:_0x1b381e[_0xf5f2('0x30')];if(!_0x50b8a2[_0xf5f2('0x31')]['hasOwnProperty'](_0xf5f2('0x38'))){_0x153924['limit']=qs[_0xf5f2('0x21')](_0x50b8a2[_0xf5f2('0x31')][_0xf5f2('0x21')]);_0x153924[_0xf5f2('0x20')]=qs['offset'](_0x50b8a2['query'][_0xf5f2('0x20')]);}_0x153924[_0xf5f2('0x39')]=qs[_0xf5f2('0x3a')](_0x50b8a2['query'][_0xf5f2('0x3a')]);_0x153924['where']=qs[_0xf5f2('0x33')](_['pick'](_0x50b8a2[_0xf5f2('0x31')],_0x1b381e[_0xf5f2('0x33')]));if(_0x50b8a2['query'][_0xf5f2('0x3b')]){_0x153924[_0xf5f2('0x3c')]=_[_0xf5f2('0x3d')](_0x153924[_0xf5f2('0x3c')],{'$or':_['map'](_0x52e959,function(_0x5d2d82){if(_0x5d2d82[_0xf5f2('0x3e')][_0xf5f2('0x3f')]!==_0xf5f2('0x40')){var _0x2d4400={};_0x2d4400[_0x5d2d82[_0xf5f2('0x41')]]={'$like':'%'+_0x50b8a2[_0xf5f2('0x31')][_0xf5f2('0x3b')]+'%'};return _0x2d4400;}})});}_0x153924=_['merge']({},_0x153924,_0x50b8a2[_0xf5f2('0x42')]);var _0x3b4ea6={'where':_0x153924['where']};return db[_0xf5f2('0x2f')][_0xf5f2('0x1f')](_0x3b4ea6)[_0xf5f2('0x27')](function(_0x85b6d0){_0x54c0c8[_0xf5f2('0x1f')]=_0x85b6d0;if(_0x50b8a2[_0xf5f2('0x31')][_0xf5f2('0x43')]){_0x153924[_0xf5f2('0x44')]=[{'all':!![]}];}return db['SquareProject'][_0xf5f2('0x45')](_0x153924);})[_0xf5f2('0x27')](function(_0x17a78e){_0x54c0c8['rows']=_0x17a78e;return _0x54c0c8;})['then'](respondWithFilteredResult(_0x17394a,_0x153924))['catch'](handleError(_0x17394a,null));};exports[_0xf5f2('0x46')]=function(_0x2ad13c,_0x4c8d8e){var _0x106272={'raw':![],'where':{'id':_0x2ad13c[_0xf5f2('0x47')]['id']}},_0xeed03d={};_0xeed03d[_0xf5f2('0x30')]=_[_0xf5f2('0x32')](db[_0xf5f2('0x2f')][_0xf5f2('0x48')]);_0xeed03d[_0xf5f2('0x31')]=_[_0xf5f2('0x32')](_0x2ad13c[_0xf5f2('0x31')]);_0xeed03d[_0xf5f2('0x33')]=_[_0xf5f2('0x34')](_0xeed03d[_0xf5f2('0x30')],_0xeed03d[_0xf5f2('0x31')]);_0x106272['attributes']=_[_0xf5f2('0x34')](_0xeed03d['model'],qs[_0xf5f2('0x36')](_0x2ad13c[_0xf5f2('0x31')][_0xf5f2('0x36')]));_0x106272[_0xf5f2('0x35')]=_0x106272[_0xf5f2('0x35')][_0xf5f2('0x37')]?_0x106272['attributes']:_0xeed03d[_0xf5f2('0x30')];if(_0x2ad13c[_0xf5f2('0x31')][_0xf5f2('0x43')]){_0x106272[_0xf5f2('0x44')]=[{'all':!![]}];}_0x106272=_[_0xf5f2('0x3d')]({},_0x106272,_0x2ad13c[_0xf5f2('0x42')]);return db[_0xf5f2('0x2f')][_0xf5f2('0x49')](_0x106272)['then'](handleEntityNotFound(_0x4c8d8e,null))[_0xf5f2('0x27')](respondWithResult(_0x4c8d8e,null))[_0xf5f2('0x4a')](handleError(_0x4c8d8e,null));};exports[_0xf5f2('0x4b')]=function(_0x492eea,_0x1177ba){return db[_0xf5f2('0x2f')][_0xf5f2('0x4b')](_0x492eea['body'],{})['then'](function(_0x7bb942){var _0x27c472=_0x492eea['user'][_0xf5f2('0x28')]({'plain':!![]});if(!_0x27c472)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x27c472[_0xf5f2('0x4c')]==='user'){var _0x2cbd9d=_0x7bb942['get']({'plain':!![]});var _0x2d9017=_0xf5f2('0x29');return db[_0xf5f2('0x4d')][_0xf5f2('0x49')]({'where':{'name':_0x2d9017,'userProfileId':_0x27c472['userProfileId']},'raw':!![]})[_0xf5f2('0x27')](function(_0x2b782f){if(_0x2b782f&&_0x2b782f['autoAssociation']===0x0){return db['UserProfileResource'][_0xf5f2('0x4b')]({'name':_0x2cbd9d[_0xf5f2('0x2d')],'resourceId':_0x2cbd9d['id'],'type':_0x2b782f['name'],'sectionId':_0x2b782f['id']},{})[_0xf5f2('0x27')](function(){return _0x7bb942;});}else{return _0x7bb942;}})[_0xf5f2('0x4a')](function(_0x29c9b6){logger[_0xf5f2('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29c9b6);throw _0x29c9b6;});}return _0x7bb942;})['then'](respondWithResult(_0x1177ba,0xc9))[_0xf5f2('0x4a')](handleError(_0x1177ba,null));};exports[_0xf5f2('0x4f')]=function(_0x4b62fc,_0x40eef){if(_0x4b62fc[_0xf5f2('0x50')]['id']){delete _0x4b62fc[_0xf5f2('0x50')]['id'];}return db[_0xf5f2('0x2f')][_0xf5f2('0x49')]({'where':{'id':_0x4b62fc[_0xf5f2('0x47')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x40eef,null))['then'](saveUpdates(_0x4b62fc['body'],null))[_0xf5f2('0x27')](respondWithResult(_0x40eef,null))[_0xf5f2('0x4a')](handleError(_0x40eef,null));};exports[_0xf5f2('0x2b')]=function(_0x46a905,_0x21b0d3){return db['SquareProject'][_0xf5f2('0x49')]({'where':{'id':_0x46a905[_0xf5f2('0x47')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x21b0d3,null))['then'](removeEntity(_0x21b0d3,null))[_0xf5f2('0x4a')](handleError(_0x21b0d3,null));};exports['addUsers']=function(_0x78f1d2,_0x1a8d33,_0x28cce5){return db[_0xf5f2('0x2f')]['find']({'where':{'id':_0x78f1d2['params']['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x1a8d33,null))['then'](function(_0xa39c65){if(_0xa39c65){return _0xa39c65[_0xf5f2('0x51')](_0x78f1d2['body'][_0xf5f2('0x52')],_[_0xf5f2('0x53')](_0x78f1d2[_0xf5f2('0x50')],['ids','id'])||{});}})[_0xf5f2('0x27')](respondWithResult(_0x1a8d33,null))[_0xf5f2('0x4a')](handleError(_0x1a8d33,null));};exports[_0xf5f2('0x54')]=function(_0x4579f4,_0x51fa7e,_0x421692){return db['SquareProject'][_0xf5f2('0x49')]({'where':{'id':_0x4579f4[_0xf5f2('0x47')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x51fa7e,null))[_0xf5f2('0x27')](function(_0x9f210e){if(_0x9f210e){return _0x9f210e['removeUsers'](_0x4579f4[_0xf5f2('0x31')][_0xf5f2('0x52')])[_0xf5f2('0x27')](function(){if(_[_0xf5f2('0x55')](_0x4579f4[_0xf5f2('0x31')]['ids'])){for(var _0x31e16b=0x0;_0x31e16b<_0x4579f4['query']['ids'][_0xf5f2('0x37')];_0x31e16b+=0x1){socket['emit'](_0xf5f2('0x56'),{'UserId':Number(_0x4579f4[_0xf5f2('0x31')][_0xf5f2('0x52')][_0x31e16b]),'SquareProjectId':Number(_0x4579f4[_0xf5f2('0x47')]['id'])});}}else{socket['emit'](_0xf5f2('0x56'),{'UserId':Number(_0x4579f4[_0xf5f2('0x31')][_0xf5f2('0x52')]),'SquareProjectId':Number(_0x4579f4[_0xf5f2('0x47')]['id'])});}});}})[_0xf5f2('0x27')](respondWithStatusCode(_0x51fa7e,null))[_0xf5f2('0x4a')](handleError(_0x51fa7e,null));};exports[_0xf5f2('0x57')]=function(_0x4a7be9,_0x1f55af,_0x2d171d){var _0xb39a6e={};var _0x45c7c1={};var _0x5a5b2b;var _0x1de396;return db['SquareProject'][_0xf5f2('0x58')]({'where':{'id':_0x4a7be9[_0xf5f2('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f55af,null))[_0xf5f2('0x27')](function(_0x975bd8){if(_0x975bd8){_0x5a5b2b=_0x975bd8;_0x45c7c1[_0xf5f2('0x30')]=_[_0xf5f2('0x32')](db[_0xf5f2('0x59')]['rawAttributes']);_0x45c7c1[_0xf5f2('0x31')]=_[_0xf5f2('0x32')](_0x4a7be9[_0xf5f2('0x31')]);_0x45c7c1[_0xf5f2('0x33')]=_[_0xf5f2('0x34')](_0x45c7c1[_0xf5f2('0x30')],_0x45c7c1['query']);_0xb39a6e[_0xf5f2('0x35')]=_[_0xf5f2('0x34')](_0x45c7c1['model'],qs[_0xf5f2('0x36')](_0x4a7be9[_0xf5f2('0x31')][_0xf5f2('0x36')]));_0xb39a6e['attributes']=_0xb39a6e['attributes']['length']?_0xb39a6e[_0xf5f2('0x35')]:_0x45c7c1[_0xf5f2('0x30')];_0xb39a6e[_0xf5f2('0x39')]=qs[_0xf5f2('0x3a')](_0x4a7be9[_0xf5f2('0x31')]['sort']);_0xb39a6e[_0xf5f2('0x3c')]=qs[_0xf5f2('0x33')](_[_0xf5f2('0x5a')](_0x4a7be9[_0xf5f2('0x31')],_0x45c7c1[_0xf5f2('0x33')]));if(_0x4a7be9[_0xf5f2('0x31')][_0xf5f2('0x3b')]){_0xb39a6e[_0xf5f2('0x3c')]=_[_0xf5f2('0x3d')](_0xb39a6e[_0xf5f2('0x3c')],{'$or':_[_0xf5f2('0x5b')](_0xb39a6e['attributes'],function(_0x5e4e07){var _0x5a143f={};_0x5a143f[_0x5e4e07]={'$like':'%'+_0x4a7be9[_0xf5f2('0x31')][_0xf5f2('0x3b')]+'%'};return _0x5a143f;})});}_0xb39a6e=_[_0xf5f2('0x3d')]({},_0xb39a6e,_0x4a7be9[_0xf5f2('0x42')]);return _0x5a5b2b[_0xf5f2('0x57')](_0xb39a6e);}})['then'](function(_0x9d943f){if(_0x9d943f){_0x1de396=_0x9d943f[_0xf5f2('0x37')];if(!_0x4a7be9[_0xf5f2('0x31')][_0xf5f2('0x5c')](_0xf5f2('0x38'))){_0xb39a6e['limit']=qs[_0xf5f2('0x21')](_0x4a7be9[_0xf5f2('0x31')]['limit']);_0xb39a6e[_0xf5f2('0x20')]=qs[_0xf5f2('0x20')](_0x4a7be9[_0xf5f2('0x31')][_0xf5f2('0x20')]);}return _0x5a5b2b['getUsers'](_0xb39a6e);}})[_0xf5f2('0x27')](function(_0xead8){if(_0xead8){return _0xead8?{'count':_0x1de396,'rows':_0xead8}:null;}})[_0xf5f2('0x27')](respondWithResult(_0x1f55af,null))[_0xf5f2('0x4a')](handleError(_0x1f55af,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 4b032cc..fb66d5a 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 _0x4d33=['../../mysqldb','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x4d33,0x1e5));var _0x34d3=function(_0x55e1d1,_0x3c9376){_0x55e1d1=_0x55e1d1-0x0;var _0x1165db=_0x4d33[_0x55e1d1];return _0x1165db;};'use strict';var EventEmitter=require(_0x34d3('0x0'));var SquareProject=require(_0x34d3('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x34d3('0x2')](0x0);var events={'afterCreate':_0x34d3('0x3'),'afterUpdate':_0x34d3('0x4'),'afterDestroy':_0x34d3('0x5')};function emitEvent(_0x22ec34){return function(_0x47b4d2,_0x410d2e,_0x113110){SquareProjectEvents[_0x34d3('0x6')](_0x22ec34+':'+_0x47b4d2['id'],_0x47b4d2);SquareProjectEvents[_0x34d3('0x6')](_0x22ec34,_0x47b4d2);_0x113110(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x34d3('0x7')](e,emitEvent(event));}}module[_0x34d3('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x6e82=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','SquareProject','setMaxListeners','save','update'];(function(_0x3cd2dd,_0x42399f){var _0x52579d=function(_0x68570a){while(--_0x68570a){_0x3cd2dd['push'](_0x3cd2dd['shift']());}};_0x52579d(++_0x42399f);}(_0x6e82,0x13a));var _0x26e8=function(_0x3926d1,_0x334d28){_0x3926d1=_0x3926d1-0x0;var _0x359dc3=_0x6e82[_0x3926d1];return _0x359dc3;};'use strict';var EventEmitter=require(_0x26e8('0x0'));var SquareProject=require(_0x26e8('0x1'))['db'][_0x26e8('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x26e8('0x3')](0x0);var events={'afterCreate':_0x26e8('0x4'),'afterUpdate':_0x26e8('0x5'),'afterDestroy':_0x26e8('0x6')};function emitEvent(_0x3f0d56){return function(_0x55cc70,_0x50766f,_0x78a8dd){SquareProjectEvents[_0x26e8('0x7')](_0x3f0d56+':'+_0x55cc70['id'],_0x55cc70);SquareProjectEvents[_0x26e8('0x7')](_0x3f0d56,_0x55cc70);_0x78a8dd(null);};}for(var e in events){if(events[_0x26e8('0x8')](e)){var event=events[e];SquareProject[_0x26e8('0x9')](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 ed6fb7d..2e120f7 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 _0x63c5=['path','rimraf','../../config/environment','./squareProject.attributes','exports','define','lodash','util','../../config/logger','api','bluebird'];(function(_0x487f51,_0x268f8f){var _0xaf1452=function(_0x228ab7){while(--_0x228ab7){_0x487f51['push'](_0x487f51['shift']());}};_0xaf1452(++_0x268f8f);}(_0x63c5,0x166));var _0x563c=function(_0x18b5e8,_0x51e875){_0x18b5e8=_0x18b5e8-0x0;var _0x25baed=_0x63c5[_0x18b5e8];return _0x25baed;};'use strict';var _=require(_0x563c('0x0'));var util=require(_0x563c('0x1'));var logger=require(_0x563c('0x2'))(_0x563c('0x3'));var moment=require('moment');var BPromise=require(_0x563c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x563c('0x5'));var rimraf=require(_0x563c('0x6'));var config=require(_0x563c('0x7'));var attributes=require(_0x563c('0x8'));module[_0x563c('0x9')]=function(_0x2d75aa,_0x293992){return _0x2d75aa[_0x563c('0xa')]('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02d6=['request-promise','path','../../config/environment','exports','define','util','../../config/logger','api','moment','bluebird'];(function(_0x44320d,_0x1640aa){var _0xb49291=function(_0xa4b6cf){while(--_0xa4b6cf){_0x44320d['push'](_0x44320d['shift']());}};_0xb49291(++_0x1640aa);}(_0x02d6,0x16d));var _0x602d=function(_0x3e3d3c,_0x18a556){_0x3e3d3c=_0x3e3d3c-0x0;var _0x580889=_0x02d6[_0x3e3d3c];return _0x580889;};'use strict';var _=require('lodash');var util=require(_0x602d('0x0'));var logger=require(_0x602d('0x1'))(_0x602d('0x2'));var moment=require(_0x602d('0x3'));var BPromise=require(_0x602d('0x4'));var rp=require(_0x602d('0x5'));var fs=require('fs');var path=require(_0x602d('0x6'));var rimraf=require('rimraf');var config=require(_0x602d('0x7'));var attributes=require('./squareProject.attributes');module[_0x602d('0x8')]=function(_0x5a89cc,_0x2095ff){return _0x5a89cc[_0x602d('0x9')]('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 470ebd1..b6466b0 100644 --- a/server/api/squareProject/squareProject.rpc.js +++ b/server/api/squareProject/squareProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x19e277,_0x18e743){var _0x4e315a=function(_0xa10cbd){while(--_0xa10cbd){_0x19e277['push'](_0x19e277['shift']());}};_0x4e315a(++_0x18e743);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./squareProject.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('SquareProject,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['SquareProject'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')],function(_0x42ac8f){return{'model':db[_0x42ac8f[_0x0a9e('0x21')]],'as':_0x42ac8f['as'],'attributes':_0x42ac8f['attributes'],'include':_0x42ac8f['include']?_[_0x0a9e('0x20')](_0x42ac8f[_0x0a9e('0x1f')],function(_0x40c424){return{'model':db[_0x40c424[_0x0a9e('0x21')]],'as':_0x40c424['as'],'attributes':_0x40c424['attributes'],'include':_0x40c424[_0x0a9e('0x1f')]?_['map'](_0x40c424[_0x0a9e('0x1f')],function(_0x5bfb33){return{'model':db[_0x5bfb33[_0x0a9e('0x21')]],'as':_0x5bfb33['as'],'attributes':_0x5bfb33[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x22')](function(_0x14433c){logger[_0x0a9e('0x16')](_0x0a9e('0x19'),_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON['stringify'](_0x14433c));_0x1c696a(_0x14433c);})[_0x0a9e('0x18')](function(_0x468813){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x468813['message'],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x468813[_0x0a9e('0x15')]));});});}; \ No newline at end of file +var _0xa9e0=['catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x64ce14,_0x355d73){var _0x21a54d=function(_0x1982ce){while(--_0x1982ce){_0x64ce14['push'](_0x64ce14['shift']());}};_0x21a54d(++_0x355d73);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./squareProject.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('SquareProject,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['SquareProject'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')],function(_0x42ac8f){return{'model':db[_0x42ac8f[_0x0a9e('0x21')]],'as':_0x42ac8f['as'],'attributes':_0x42ac8f['attributes'],'include':_0x42ac8f['include']?_[_0x0a9e('0x20')](_0x42ac8f[_0x0a9e('0x1f')],function(_0x40c424){return{'model':db[_0x40c424[_0x0a9e('0x21')]],'as':_0x40c424['as'],'attributes':_0x40c424['attributes'],'include':_0x40c424[_0x0a9e('0x1f')]?_['map'](_0x40c424[_0x0a9e('0x1f')],function(_0x5bfb33){return{'model':db[_0x5bfb33[_0x0a9e('0x21')]],'as':_0x5bfb33['as'],'attributes':_0x5bfb33[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x22')](function(_0x14433c){logger[_0x0a9e('0x16')](_0x0a9e('0x19'),_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON['stringify'](_0x14433c));_0x1c696a(_0x14433c);})[_0x0a9e('0x18')](function(_0x468813){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x468813['message'],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x468813[_0x0a9e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 24967e6..3cdf338 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 _0x54f3=['save','remove','update','removeListener','length','squareProject:'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x54f3,0x120));var _0x354f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x54f3[_0x57b54c];return _0x59cc19;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x354f('0x0'),_0x354f('0x1'),_0x354f('0x2')];function createListener(_0x1cb51f,_0x2cd824){return function(_0x517a53){_0x2cd824['emit'](_0x1cb51f,_0x517a53);};}function removeListener(_0xe4efe,_0x86b73e){return function(){SquareProjectEvents[_0x354f('0x3')](_0xe4efe,_0x86b73e);};}exports['register']=function(_0x5618ac){for(var _0x234ac6=0x0,_0x51cd16=events[_0x354f('0x4')];_0x234ac6<_0x51cd16;_0x234ac6++){var _0x4311ad=events[_0x234ac6];var _0x2f111a=createListener(_0x354f('0x5')+_0x4311ad,_0x5618ac);SquareProjectEvents['on'](_0x4311ad,_0x2f111a);}}; \ No newline at end of file +var _0xb2ff=['register','length','squareProject:','./squareProject.events','save','update','emit','removeListener'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0xb2ff,0x123));var _0xfb2f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb2ff[_0x2641f9];return _0x585741;};'use strict';var SquareProjectEvents=require(_0xfb2f('0x0'));var events=[_0xfb2f('0x1'),'remove',_0xfb2f('0x2')];function createListener(_0x54e80d,_0x584330){return function(_0x51e1fe){_0x584330[_0xfb2f('0x3')](_0x54e80d,_0x51e1fe);};}function removeListener(_0x484368,_0x145e77){return function(){SquareProjectEvents[_0xfb2f('0x4')](_0x484368,_0x145e77);};}exports[_0xfb2f('0x5')]=function(_0x1d3416){for(var _0x542ce7=0x0,_0x4a0fd7=events[_0xfb2f('0x6')];_0x542ce7<_0x4a0fd7;_0x542ce7++){var _0x4ff2df=events[_0x542ce7];var _0x34c04e=createListener(_0xfb2f('0x7')+_0x4ff2df,_0x1d3416);SquareProjectEvents['on'](_0x4ff2df,_0x34c04e);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 4a26d34..3db4eb4 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 _0xc5dd=['/:id/download','download','post','create','put','update','delete','destroy','multer','util','Router','../../components/auth/service','./squareRecording.controller','isAuthenticated','index','get','/:id','show'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0xc5dd,0x170));var _0xdc5d=function(_0x4be5ab,_0x364090){_0x4be5ab=_0x4be5ab-0x0;var _0x5f38e4=_0xc5dd[_0x4be5ab];return _0x5f38e4;};'use strict';var multer=require(_0xdc5d('0x0'));var util=require(_0xdc5d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdc5d('0x2')]();var auth=require(_0xdc5d('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdc5d('0x4'));router['get']('/',auth[_0xdc5d('0x5')](),controller[_0xdc5d('0x6')]);router[_0xdc5d('0x7')](_0xdc5d('0x8'),auth[_0xdc5d('0x5')](),controller[_0xdc5d('0x9')]);router[_0xdc5d('0x7')](_0xdc5d('0xa'),auth[_0xdc5d('0x5')](),controller[_0xdc5d('0xb')]);router[_0xdc5d('0xc')]('/',auth[_0xdc5d('0x5')](),controller[_0xdc5d('0xd')]);router[_0xdc5d('0xe')](_0xdc5d('0x8'),auth[_0xdc5d('0x5')](),controller[_0xdc5d('0xf')]);router[_0xdc5d('0x10')]('/:id',auth[_0xdc5d('0x5')](),controller[_0xdc5d('0x11')]);module['exports']=router; \ No newline at end of file +var _0x94cf=['../../config/environment','./squareRecording.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','/:id','update','delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x94cf,0xc2));var _0xf94c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x94cf[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xf94c('0x0'));var path=require(_0xf94c('0x1'));var timeout=require(_0xf94c('0x2'));var express=require('express');var router=express[_0xf94c('0x3')]();var auth=require(_0xf94c('0x4'));var interaction=require(_0xf94c('0x5'));var config=require(_0xf94c('0x6'));var controller=require(_0xf94c('0x7'));router[_0xf94c('0x8')]('/',auth[_0xf94c('0x9')](),controller[_0xf94c('0xa')]);router[_0xf94c('0x8')]('/:id',auth[_0xf94c('0x9')](),controller[_0xf94c('0xb')]);router['get'](_0xf94c('0xc'),auth[_0xf94c('0x9')](),controller[_0xf94c('0xd')]);router[_0xf94c('0xe')]('/',auth['isAuthenticated'](),controller[_0xf94c('0xf')]);router['put'](_0xf94c('0x10'),auth[_0xf94c('0x9')](),controller[_0xf94c('0x11')]);router[_0xf94c('0x12')](_0xf94c('0x10'),auth[_0xf94c('0x9')](),controller[_0xf94c('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 030aea7..7f2191a 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 _0x9067=['STRING','sequelize','exports'];(function(_0x239b31,_0x44a64d){var _0x41c8be=function(_0x27f031){while(--_0x27f031){_0x239b31['push'](_0x239b31['shift']());}};_0x41c8be(++_0x44a64d);}(_0x9067,0x9a));var _0x7906=function(_0x261ece,_0xa159bf){_0x261ece=_0x261ece-0x0;var _0x14eef6=_0x9067[_0x261ece];return _0x14eef6;};'use strict';var Sequelize=require(_0x7906('0x0'));module[_0x7906('0x1')]={'uniqueid':{'type':Sequelize[_0x7906('0x2')]},'callerid':{'type':Sequelize[_0x7906('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x7906('0x2')]},'extension':{'type':Sequelize[_0x7906('0x2')]},'priority':{'type':Sequelize[_0x7906('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x7906('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x7906('0x2')]},'filename':{'type':Sequelize[_0x7906('0x2')]},'savePath':{'type':Sequelize[_0x7906('0x2')]}}; \ No newline at end of file +var _0x3ea0=['STRING','sequelize'];(function(_0x7ed4ff,_0x2cc36c){var _0x1e2e8c=function(_0x1e80ab){while(--_0x1e80ab){_0x7ed4ff['push'](_0x7ed4ff['shift']());}};_0x1e2e8c(++_0x2cc36c);}(_0x3ea0,0xf1));var _0x03ea=function(_0x3a9707,_0x3d19c8){_0x3a9707=_0x3a9707-0x0;var _0x2fb6aa=_0x3ea0[_0x3a9707];return _0x2fb6aa;};'use strict';var Sequelize=require(_0x03ea('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x03ea('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x03ea('0x1')]},'context':{'type':Sequelize[_0x03ea('0x1')]},'extension':{'type':Sequelize[_0x03ea('0x1')]},'priority':{'type':Sequelize[_0x03ea('0x1')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x03ea('0x1')]},'projectName':{'type':Sequelize[_0x03ea('0x1')]},'saveName':{'type':Sequelize[_0x03ea('0x1')]},'filename':{'type':Sequelize[_0x03ea('0x1')]},'savePath':{'type':Sequelize[_0x03ea('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index ea8fb25..944d4d8 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 _0x9ac7=['merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','end','error','stack','name','send','index','SquareRecording','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter'];(function(_0x5b6623,_0x1bad3b){var _0x16f645=function(_0x596591){while(--_0x596591){_0x5b6623['push'](_0x5b6623['shift']());}};_0x16f645(++_0x1bad3b);}(_0x9ac7,0xdd));var _0x79ac=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x9ac7[_0x3d42d8];return _0x27fc41;};'use strict';var pdf=require(_0x79ac('0x0'));var emlformat=require(_0x79ac('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x79ac('0x2'));var rp=require(_0x79ac('0x3'));var moment=require(_0x79ac('0x4'));var BPromise=require(_0x79ac('0x5'));var Mustache=require(_0x79ac('0x6'));var util=require(_0x79ac('0x7'));var path=require('path');var sox=require(_0x79ac('0x8'));var csv=require(_0x79ac('0x9'));var ejs=require(_0x79ac('0xa'));var fs=require('fs');var _=require(_0x79ac('0xb'));var squel=require(_0x79ac('0xc'));var crypto=require(_0x79ac('0xd'));var jsforce=require(_0x79ac('0xe'));var deskjs=require(_0x79ac('0xf'));var toCsv=require(_0x79ac('0x9'));var querystring=require('querystring');var Papa=require(_0x79ac('0x10'));var Redis=require('ioredis');var authService=require(_0x79ac('0x11'));var qs=require(_0x79ac('0x12'));var hardwareService=require(_0x79ac('0x13'));var logger=require(_0x79ac('0x14'))(_0x79ac('0x15'));var utils=require(_0x79ac('0x16'));var config=require(_0x79ac('0x17'));var db=require(_0x79ac('0x18'))['db'];function respondWithStatusCode(_0x3380d9,_0x4ed9df){_0x4ed9df=_0x4ed9df||0xcc;return function(_0x49470f){if(_0x49470f){return _0x3380d9[_0x79ac('0x19')](_0x4ed9df);}return _0x3380d9['status'](_0x4ed9df)['end']();};}function respondWithResult(_0x59816d,_0x3afbd3){_0x3afbd3=_0x3afbd3||0xc8;return function(_0x39a262){if(_0x39a262){return _0x59816d[_0x79ac('0x1a')](_0x3afbd3)[_0x79ac('0x1b')](_0x39a262);}};}function respondWithFilteredResult(_0x2bd6c1,_0x297f89){return function(_0x302caf){if(_0x302caf){var _0x17d882=_0x302caf[_0x79ac('0x1c')],_0x3a06bc=_0x297f89[_0x79ac('0x1d')],_0x324b66=_0x297f89[_0x79ac('0x1d')]+_0x297f89[_0x79ac('0x1e')],_0x2c1eda;if(_0x324b66>=_0x17d882){_0x324b66=_0x17d882;_0x2c1eda=0xc8;}else{_0x2c1eda=0xce;}_0x2bd6c1['status'](_0x2c1eda);return _0x2bd6c1[_0x79ac('0x1f')](_0x79ac('0x20'),_0x3a06bc+'-'+_0x324b66+'/'+_0x17d882)[_0x79ac('0x1b')](_0x302caf);}return null;};}function patchUpdates(_0x376aca){return function(_0x24127c){try{jsonpatch[_0x79ac('0x21')](_0x24127c,_0x376aca,!![]);}catch(_0x3a72ff){return BPromise['reject'](_0x3a72ff);}return _0x24127c['save']();};}function saveUpdates(_0x1e977c,_0x2e79b1){return function(_0x2268a5){if(_0x2268a5){return _0x2268a5[_0x79ac('0x22')](_0x1e977c)[_0x79ac('0x23')](function(_0x51c6e5){return _0x51c6e5;});}return null;};}function removeEntity(_0x31fc05,_0x3472d2){return function(_0x2b9398){if(_0x2b9398){return _0x2b9398[_0x79ac('0x24')]()[_0x79ac('0x23')](function(){_0x31fc05[_0x79ac('0x1a')](0xcc)[_0x79ac('0x25')]();});}};}function handleEntityNotFound(_0x29d5c2,_0x5b9ad6){return function(_0x1e9577){if(!_0x1e9577){_0x29d5c2[_0x79ac('0x19')](0x194);}return _0x1e9577;};}function handleError(_0x329586,_0xec5df9){_0xec5df9=_0xec5df9||0x1f4;return function(_0x452f95){logger[_0x79ac('0x26')](_0x452f95[_0x79ac('0x27')]);if(_0x452f95['name']){delete _0x452f95[_0x79ac('0x28')];}_0x329586[_0x79ac('0x1a')](_0xec5df9)[_0x79ac('0x29')](_0x452f95);};}exports[_0x79ac('0x2a')]=function(_0x1337eb,_0x32bc2e){var _0x54d7d3={},_0x42b37d={},_0x54f611={'count':0x0,'rows':[]};var _0x4e3225=db[_0x79ac('0x2b')][_0x79ac('0x2c')];_0x42b37d[_0x79ac('0x2d')]=_[_0x79ac('0x2e')](_0x4e3225);_0x42b37d[_0x79ac('0x2f')]=_[_0x79ac('0x2e')](_0x1337eb[_0x79ac('0x2f')]);_0x42b37d['filters']=_[_0x79ac('0x30')](_0x42b37d['model'],_0x42b37d['query']);_0x54d7d3[_0x79ac('0x31')]=_[_0x79ac('0x30')](_0x42b37d[_0x79ac('0x2d')],qs[_0x79ac('0x32')](_0x1337eb[_0x79ac('0x2f')]['fields']));_0x54d7d3[_0x79ac('0x31')]=_0x54d7d3[_0x79ac('0x31')]['length']?_0x54d7d3[_0x79ac('0x31')]:_0x42b37d[_0x79ac('0x2d')];if(!_0x1337eb[_0x79ac('0x2f')][_0x79ac('0x33')](_0x79ac('0x34'))){_0x54d7d3[_0x79ac('0x1e')]=qs['limit'](_0x1337eb[_0x79ac('0x2f')]['limit']);_0x54d7d3[_0x79ac('0x1d')]=qs['offset'](_0x1337eb['query'][_0x79ac('0x1d')]);}_0x54d7d3[_0x79ac('0x35')]=qs[_0x79ac('0x36')](_0x1337eb[_0x79ac('0x2f')]['sort']);_0x54d7d3[_0x79ac('0x37')]=qs[_0x79ac('0x38')](_['pick'](_0x1337eb[_0x79ac('0x2f')],_0x42b37d[_0x79ac('0x38')]));if(_0x1337eb[_0x79ac('0x2f')][_0x79ac('0x39')]){_0x54d7d3[_0x79ac('0x37')]=_[_0x79ac('0x3a')](_0x54d7d3[_0x79ac('0x37')],{'$or':_[_0x79ac('0x3b')](_0x4e3225,function(_0x3a6fc1){if(_0x3a6fc1[_0x79ac('0x3c')][_0x79ac('0x3d')]!==_0x79ac('0x3e')){var _0x3e3d03={};_0x3e3d03[_0x3a6fc1[_0x79ac('0x3f')]]={'$like':'%'+_0x1337eb['query']['filter']+'%'};return _0x3e3d03;}})});}_0x54d7d3=_[_0x79ac('0x3a')]({},_0x54d7d3,_0x1337eb[_0x79ac('0x40')]);var _0x5e7cb6={'where':_0x54d7d3['where']};return db[_0x79ac('0x2b')][_0x79ac('0x1c')](_0x5e7cb6)[_0x79ac('0x23')](function(_0x2efbaa){_0x54f611[_0x79ac('0x1c')]=_0x2efbaa;if(_0x1337eb[_0x79ac('0x2f')][_0x79ac('0x41')]){_0x54d7d3[_0x79ac('0x42')]=[{'all':!![]}];}return db[_0x79ac('0x2b')][_0x79ac('0x43')](_0x54d7d3);})[_0x79ac('0x23')](function(_0x5c3ae8){_0x54f611[_0x79ac('0x44')]=_0x5c3ae8;return _0x54f611;})[_0x79ac('0x23')](respondWithFilteredResult(_0x32bc2e,_0x54d7d3))[_0x79ac('0x45')](handleError(_0x32bc2e,null));};exports[_0x79ac('0x46')]=function(_0x386c27,_0x47c621){var _0x27a4fd={'raw':!![],'where':{'id':_0x386c27[_0x79ac('0x47')]['id']}},_0x715c8d={};_0x715c8d[_0x79ac('0x2d')]=_['keys'](db[_0x79ac('0x2b')][_0x79ac('0x2c')]);_0x715c8d[_0x79ac('0x2f')]=_['keys'](_0x386c27['query']);_0x715c8d[_0x79ac('0x38')]=_['intersection'](_0x715c8d['model'],_0x715c8d[_0x79ac('0x2f')]);_0x27a4fd[_0x79ac('0x31')]=_[_0x79ac('0x30')](_0x715c8d[_0x79ac('0x2d')],qs[_0x79ac('0x32')](_0x386c27[_0x79ac('0x2f')][_0x79ac('0x32')]));_0x27a4fd['attributes']=_0x27a4fd[_0x79ac('0x31')][_0x79ac('0x48')]?_0x27a4fd['attributes']:_0x715c8d['model'];if(_0x386c27[_0x79ac('0x2f')][_0x79ac('0x41')]){_0x27a4fd['include']=[{'all':!![]}];}_0x27a4fd=_[_0x79ac('0x3a')]({},_0x27a4fd,_0x386c27['options']);return db[_0x79ac('0x2b')][_0x79ac('0x49')](_0x27a4fd)[_0x79ac('0x23')](handleEntityNotFound(_0x47c621,null))[_0x79ac('0x23')](respondWithResult(_0x47c621,null))[_0x79ac('0x45')](handleError(_0x47c621,null));};exports[_0x79ac('0x4a')]=function(_0x57c9b9,_0x51d587){return db['SquareRecording'][_0x79ac('0x4a')](_0x57c9b9[_0x79ac('0x4b')],{})[_0x79ac('0x23')](respondWithResult(_0x51d587,0xc9))[_0x79ac('0x45')](handleError(_0x51d587,null));};exports[_0x79ac('0x22')]=function(_0x1807e6,_0x5f2047){if(_0x1807e6[_0x79ac('0x4b')]['id']){delete _0x1807e6['body']['id'];}return db[_0x79ac('0x2b')][_0x79ac('0x49')]({'where':{'id':_0x1807e6['params']['id']}})[_0x79ac('0x23')](handleEntityNotFound(_0x5f2047,null))[_0x79ac('0x23')](saveUpdates(_0x1807e6[_0x79ac('0x4b')],null))[_0x79ac('0x23')](respondWithResult(_0x5f2047,null))[_0x79ac('0x45')](handleError(_0x5f2047,null));};exports[_0x79ac('0x24')]=function(_0x1ffd8a,_0x202646){return db['SquareRecording'][_0x79ac('0x49')]({'where':{'id':_0x1ffd8a[_0x79ac('0x47')]['id']}})[_0x79ac('0x23')](handleEntityNotFound(_0x202646,null))[_0x79ac('0x23')](removeEntity(_0x202646,null))[_0x79ac('0x45')](handleError(_0x202646,null));};exports[_0x79ac('0x4c')]=function(_0x47a12b,_0x5653a2,_0x3c6f09){var _0x4ac747=require(_0x79ac('0x4d'));var _0x562261=![];var _0x322a40={};if(_0x47a12b['query'][_0x79ac('0x3c')]&&_0x47a12b[_0x79ac('0x2f')]['type']==='uniqueid'){_0x322a40[_0x79ac('0x4e')]=_0x47a12b[_0x79ac('0x47')]['id'];}else{_0x322a40['id']=_0x47a12b['params']['id'];}return db['SquareRecording'][_0x79ac('0x49')]({'where':_0x322a40,'attributes':['id',_0x79ac('0x4f'),_0x79ac('0x50')],'raw':!![]})[_0x79ac('0x23')](handleEntityNotFound(_0x5653a2,null))[_0x79ac('0x23')](function(_0x173390){if(_0x173390){var _0x566bf6=_0x173390[_0x79ac('0x4f')];var _0x399e60=util[_0x79ac('0x51')](_0x79ac('0x52'),_0x566bf6);if(fs[_0x79ac('0x53')](_0x399e60)){_0x562261=!![];return _0x4ac747['decryptFile'](_0x399e60,_0x566bf6,config[_0x79ac('0x54')][_0x79ac('0x55')])[_0x79ac('0x23')](function(){return _0x173390;});}return _0x173390;}})['then'](function(_0x47f0a6){if(_0x47f0a6){var _0x40887c=_0x47f0a6[_0x79ac('0x4f')];if(!fs['existsSync'](_0x40887c)){throw new db[(_0x79ac('0x56'))][(_0x79ac('0x57'))](_0x79ac('0x58'));}if(_0x47f0a6[_0x79ac('0x50')]){return _0x5653a2['download'](_0x40887c,_0x47f0a6[_0x79ac('0x50')]+path[_0x79ac('0x59')](_0x40887c),function(){if(_0x562261){fs[_0x79ac('0x5a')](_0x40887c);}});}else{return _0x5653a2[_0x79ac('0x4c')](_0x40887c,function(_0x618923){if(_0x562261){fs['unlink'](_0x40887c);}});}}})[_0x79ac('0x45')](function(_0xda73ab){if(_0xda73ab[_0x79ac('0x5b')]===_0x79ac('0x58')){_0x5653a2[_0x79ac('0x1a')](0x194)['send'](_0x79ac('0x5c'));}else{return handleError(_0x5653a2,null);}});}; \ No newline at end of file +var _0x0630=['keys','query','filters','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','options','SquareRecording','includeAll','include','findAll','rows','show','params','intersection','find','create','catch','body','../../components/encryptor','uniqueid','savePath','filename','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','SquareRecording\x20not\x20found','download','extname','unlink','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','then','end','error','name','send','index','rawAttributes'];(function(_0x33f85b,_0x3a7317){var _0x26a983=function(_0xc43106){while(--_0xc43106){_0x33f85b['push'](_0x33f85b['shift']());}};_0x26a983(++_0x3a7317);}(_0x0630,0x1e0));var _0x0063=function(_0x46fdc2,_0x6dfbaf){_0x46fdc2=_0x46fdc2-0x0;var _0x1e997f=_0x0630[_0x46fdc2];return _0x1e997f;};'use strict';var pdf=require(_0x0063('0x0'));var emlformat=require(_0x0063('0x1'));var rimraf=require(_0x0063('0x2'));var zipdir=require(_0x0063('0x3'));var jsonpatch=require(_0x0063('0x4'));var rp=require('request-promise');var moment=require(_0x0063('0x5'));var BPromise=require(_0x0063('0x6'));var Mustache=require(_0x0063('0x7'));var util=require(_0x0063('0x8'));var path=require(_0x0063('0x9'));var sox=require('sox');var csv=require(_0x0063('0xa'));var ejs=require(_0x0063('0xb'));var fs=require('fs');var _=require(_0x0063('0xc'));var squel=require(_0x0063('0xd'));var crypto=require(_0x0063('0xe'));var jsforce=require(_0x0063('0xf'));var deskjs=require(_0x0063('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0063('0x11'));var Papa=require('papaparse');var Redis=require(_0x0063('0x12'));var authService=require(_0x0063('0x13'));var qs=require(_0x0063('0x14'));var hardwareService=require(_0x0063('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0063('0x16'))['db'];function respondWithStatusCode(_0x118e8d,_0x1de582){_0x1de582=_0x1de582||0xcc;return function(_0x1f90d3){if(_0x1f90d3){return _0x118e8d[_0x0063('0x17')](_0x1de582);}return _0x118e8d[_0x0063('0x18')](_0x1de582)['end']();};}function respondWithResult(_0xeb5fb0,_0x1134b7){_0x1134b7=_0x1134b7||0xc8;return function(_0x231e39){if(_0x231e39){return _0xeb5fb0['status'](_0x1134b7)['json'](_0x231e39);}};}function respondWithFilteredResult(_0x1171ca,_0xacdf97){return function(_0x33c8d6){if(_0x33c8d6){var _0x428c5e=_0x33c8d6[_0x0063('0x19')],_0x1c9241=_0xacdf97[_0x0063('0x1a')],_0x34cefb=_0xacdf97[_0x0063('0x1a')]+_0xacdf97[_0x0063('0x1b')],_0x461225;if(_0x34cefb>=_0x428c5e){_0x34cefb=_0x428c5e;_0x461225=0xc8;}else{_0x461225=0xce;}_0x1171ca[_0x0063('0x18')](_0x461225);return _0x1171ca[_0x0063('0x1c')](_0x0063('0x1d'),_0x1c9241+'-'+_0x34cefb+'/'+_0x428c5e)[_0x0063('0x1e')](_0x33c8d6);}return null;};}function patchUpdates(_0x4cac65){return function(_0x328c59){try{jsonpatch[_0x0063('0x1f')](_0x328c59,_0x4cac65,!![]);}catch(_0x45a6ea){return BPromise['reject'](_0x45a6ea);}return _0x328c59[_0x0063('0x20')]();};}function saveUpdates(_0x596b8e,_0x35e747){return function(_0x1b69fa){if(_0x1b69fa){return _0x1b69fa[_0x0063('0x21')](_0x596b8e)['then'](function(_0x1c8d9f){return _0x1c8d9f;});}return null;};}function removeEntity(_0xd18955,_0x267cbf){return function(_0x41132f){if(_0x41132f){return _0x41132f[_0x0063('0x22')]()[_0x0063('0x23')](function(){_0xd18955[_0x0063('0x18')](0xcc)[_0x0063('0x24')]();});}};}function handleEntityNotFound(_0x28e6b0,_0x58ceb){return function(_0x1eb733){if(!_0x1eb733){_0x28e6b0[_0x0063('0x17')](0x194);}return _0x1eb733;};}function handleError(_0x5d0d71,_0x7fe057){_0x7fe057=_0x7fe057||0x1f4;return function(_0x3705f2){logger[_0x0063('0x25')](_0x3705f2['stack']);if(_0x3705f2[_0x0063('0x26')]){delete _0x3705f2[_0x0063('0x26')];}_0x5d0d71[_0x0063('0x18')](_0x7fe057)[_0x0063('0x27')](_0x3705f2);};}exports[_0x0063('0x28')]=function(_0x3fc002,_0xdc57ef){var _0xd38152={},_0x1eaa1b={},_0x208a95={'count':0x0,'rows':[]};var _0x2a266b=db['SquareRecording'][_0x0063('0x29')];_0x1eaa1b['model']=_['keys'](_0x2a266b);_0x1eaa1b['query']=_[_0x0063('0x2a')](_0x3fc002[_0x0063('0x2b')]);_0x1eaa1b[_0x0063('0x2c')]=_['intersection'](_0x1eaa1b[_0x0063('0x2d')],_0x1eaa1b['query']);_0xd38152[_0x0063('0x2e')]=_['intersection'](_0x1eaa1b[_0x0063('0x2d')],qs[_0x0063('0x2f')](_0x3fc002[_0x0063('0x2b')]['fields']));_0xd38152['attributes']=_0xd38152['attributes'][_0x0063('0x30')]?_0xd38152['attributes']:_0x1eaa1b['model'];if(!_0x3fc002[_0x0063('0x2b')][_0x0063('0x31')]('nolimit')){_0xd38152[_0x0063('0x1b')]=qs[_0x0063('0x1b')](_0x3fc002['query'][_0x0063('0x1b')]);_0xd38152[_0x0063('0x1a')]=qs[_0x0063('0x1a')](_0x3fc002['query'][_0x0063('0x1a')]);}_0xd38152[_0x0063('0x32')]=qs[_0x0063('0x33')](_0x3fc002['query'][_0x0063('0x33')]);_0xd38152['where']=qs[_0x0063('0x2c')](_[_0x0063('0x34')](_0x3fc002[_0x0063('0x2b')],_0x1eaa1b[_0x0063('0x2c')]));if(_0x3fc002[_0x0063('0x2b')][_0x0063('0x35')]){_0xd38152[_0x0063('0x36')]=_[_0x0063('0x37')](_0xd38152[_0x0063('0x36')],{'$or':_[_0x0063('0x38')](_0x2a266b,function(_0x2dc844){if(_0x2dc844[_0x0063('0x39')][_0x0063('0x3a')]!==_0x0063('0x3b')){var _0x5b2f05={};_0x5b2f05[_0x2dc844['field']]={'$like':'%'+_0x3fc002[_0x0063('0x2b')][_0x0063('0x35')]+'%'};return _0x5b2f05;}})});}_0xd38152=_['merge']({},_0xd38152,_0x3fc002[_0x0063('0x3c')]);var _0x1ffd66={'where':_0xd38152[_0x0063('0x36')]};return db[_0x0063('0x3d')][_0x0063('0x19')](_0x1ffd66)['then'](function(_0x422339){_0x208a95[_0x0063('0x19')]=_0x422339;if(_0x3fc002[_0x0063('0x2b')][_0x0063('0x3e')]){_0xd38152[_0x0063('0x3f')]=[{'all':!![]}];}return db[_0x0063('0x3d')][_0x0063('0x40')](_0xd38152);})[_0x0063('0x23')](function(_0x376e87){_0x208a95[_0x0063('0x41')]=_0x376e87;return _0x208a95;})['then'](respondWithFilteredResult(_0xdc57ef,_0xd38152))['catch'](handleError(_0xdc57ef,null));};exports[_0x0063('0x42')]=function(_0x4d84c4,_0x4e067d){var _0x21e827={'raw':!![],'where':{'id':_0x4d84c4[_0x0063('0x43')]['id']}},_0x27b7dd={};_0x27b7dd[_0x0063('0x2d')]=_[_0x0063('0x2a')](db[_0x0063('0x3d')][_0x0063('0x29')]);_0x27b7dd['query']=_[_0x0063('0x2a')](_0x4d84c4['query']);_0x27b7dd[_0x0063('0x2c')]=_['intersection'](_0x27b7dd['model'],_0x27b7dd['query']);_0x21e827[_0x0063('0x2e')]=_[_0x0063('0x44')](_0x27b7dd[_0x0063('0x2d')],qs[_0x0063('0x2f')](_0x4d84c4[_0x0063('0x2b')][_0x0063('0x2f')]));_0x21e827[_0x0063('0x2e')]=_0x21e827[_0x0063('0x2e')][_0x0063('0x30')]?_0x21e827['attributes']:_0x27b7dd[_0x0063('0x2d')];if(_0x4d84c4['query']['includeAll']){_0x21e827[_0x0063('0x3f')]=[{'all':!![]}];}_0x21e827=_[_0x0063('0x37')]({},_0x21e827,_0x4d84c4[_0x0063('0x3c')]);return db['SquareRecording'][_0x0063('0x45')](_0x21e827)[_0x0063('0x23')](handleEntityNotFound(_0x4e067d,null))[_0x0063('0x23')](respondWithResult(_0x4e067d,null))['catch'](handleError(_0x4e067d,null));};exports[_0x0063('0x46')]=function(_0x2cba72,_0x136c5d){return db['SquareRecording'][_0x0063('0x46')](_0x2cba72['body'],{})['then'](respondWithResult(_0x136c5d,0xc9))[_0x0063('0x47')](handleError(_0x136c5d,null));};exports[_0x0063('0x21')]=function(_0x36a54e,_0x4eb7cc){if(_0x36a54e[_0x0063('0x48')]['id']){delete _0x36a54e[_0x0063('0x48')]['id'];}return db[_0x0063('0x3d')][_0x0063('0x45')]({'where':{'id':_0x36a54e[_0x0063('0x43')]['id']}})[_0x0063('0x23')](handleEntityNotFound(_0x4eb7cc,null))[_0x0063('0x23')](saveUpdates(_0x36a54e[_0x0063('0x48')],null))[_0x0063('0x23')](respondWithResult(_0x4eb7cc,null))[_0x0063('0x47')](handleError(_0x4eb7cc,null));};exports[_0x0063('0x22')]=function(_0x301404,_0x8d9383){return db[_0x0063('0x3d')]['find']({'where':{'id':_0x301404[_0x0063('0x43')]['id']}})[_0x0063('0x23')](handleEntityNotFound(_0x8d9383,null))[_0x0063('0x23')](removeEntity(_0x8d9383,null))['catch'](handleError(_0x8d9383,null));};exports['download']=function(_0x1762ec,_0x493897,_0x301cb6){var _0x4c178b=require(_0x0063('0x49'));var _0x386c2b=![];var _0x57ea92={};if(_0x1762ec['query']['type']&&_0x1762ec[_0x0063('0x2b')][_0x0063('0x39')]===_0x0063('0x4a')){_0x57ea92[_0x0063('0x4a')]=_0x1762ec['params']['id'];}else{_0x57ea92['id']=_0x1762ec[_0x0063('0x43')]['id'];}return db['SquareRecording']['find']({'where':_0x57ea92,'attributes':['id',_0x0063('0x4b'),_0x0063('0x4c')],'raw':!![]})[_0x0063('0x23')](handleEntityNotFound(_0x493897,null))[_0x0063('0x23')](function(_0x480685){if(_0x480685){var _0x51bf84=_0x480685['savePath'];var _0x35ee2b=util['format'](_0x0063('0x4d'),_0x51bf84);if(fs['existsSync'](_0x35ee2b)){_0x386c2b=!![];return _0x4c178b[_0x0063('0x4e')](_0x35ee2b,_0x51bf84,config[_0x0063('0x4f')][_0x0063('0x50')])[_0x0063('0x23')](function(){return _0x480685;});}return _0x480685;}})[_0x0063('0x23')](function(_0x131341){if(_0x131341){var _0x529dbc=_0x131341['savePath'];if(!fs[_0x0063('0x51')](_0x529dbc)){throw new db[(_0x0063('0x52'))]['ValidationError'](_0x0063('0x53'));}if(_0x131341[_0x0063('0x4c')]){return _0x493897[_0x0063('0x54')](_0x529dbc,_0x131341[_0x0063('0x4c')]+path[_0x0063('0x55')](_0x529dbc),function(){if(_0x386c2b){fs[_0x0063('0x56')](_0x529dbc);}});}else{return _0x493897[_0x0063('0x54')](_0x529dbc,function(_0x40cc11){if(_0x386c2b){fs[_0x0063('0x56')](_0x529dbc);}});}}})[_0x0063('0x47')](function(_0x11656c){if(_0x11656c['message']===_0x0063('0x53')){_0x493897[_0x0063('0x18')](0x194)[_0x0063('0x27')]('Not\x20found');}else{return handleError(_0x493897,null);}});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index a195bf5..4bea129 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 _0x4f8c=['SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define'];(function(_0x5f159a,_0x22553f){var _0x38945c=function(_0x3b3e3a){while(--_0x3b3e3a){_0x5f159a['push'](_0x5f159a['shift']());}};_0x38945c(++_0x22553f);}(_0x4f8c,0x110));var _0xc4f8=function(_0x437fd4,_0xe1bd8c){_0x437fd4=_0x437fd4-0x0;var _0xe71d86=_0x4f8c[_0x437fd4];return _0xe71d86;};'use strict';var _=require(_0xc4f8('0x0'));var util=require(_0xc4f8('0x1'));var logger=require(_0xc4f8('0x2'))(_0xc4f8('0x3'));var moment=require(_0xc4f8('0x4'));var BPromise=require(_0xc4f8('0x5'));var rp=require(_0xc4f8('0x6'));var fs=require('fs');var path=require(_0xc4f8('0x7'));var rimraf=require(_0xc4f8('0x8'));var config=require(_0xc4f8('0x9'));var attributes=require(_0xc4f8('0xa'));module[_0xc4f8('0xb')]=function(_0x31fd3a,_0x5bebd5){return _0x31fd3a[_0xc4f8('0xc')](_0xc4f8('0xd'),attributes,{'tableName':_0xc4f8('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc847=['../../config/environment','./squareRecording.attributes','define','square_recordings','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xc847,0x190));var _0x7c84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc847[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7c84('0x0'));var util=require(_0x7c84('0x1'));var logger=require(_0x7c84('0x2'))(_0x7c84('0x3'));var moment=require('moment');var BPromise=require(_0x7c84('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c84('0x5'));var rimraf=require(_0x7c84('0x6'));var config=require(_0x7c84('0x7'));var attributes=require(_0x7c84('0x8'));module['exports']=function(_0x158261,_0x4bb4c0){return _0x158261[_0x7c84('0x9')]('SquareRecording',attributes,{'tableName':_0x7c84('0xa'),'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 6b742c4..af24c0d 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 _0x689e=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','message','result','CreateSquareRecording','SquareRecording','create','body','options','raw','stringify','catch','util','moment','randomstring','ioredis'];(function(_0x2fe0ac,_0xe8ad2a){var _0x5e3977=function(_0xbe8ba5){while(--_0xbe8ba5){_0x2fe0ac['push'](_0x2fe0ac['shift']());}};_0x5e3977(++_0xe8ad2a);}(_0x689e,0x168));var _0xe689=function(_0x164d16,_0x2f39a9){_0x164d16=_0x164d16-0x0;var _0x2cff6b=_0x689e[_0x164d16];return _0x2cff6b;};'use strict';var _=require('lodash');var util=require(_0xe689('0x0'));var moment=require(_0xe689('0x1'));var BPromise=require('bluebird');var rs=require(_0xe689('0x2'));var fs=require('fs');var Redis=require(_0xe689('0x3'));var db=require(_0xe689('0x4'))['db'];var utils=require(_0xe689('0x5'));var logger=require(_0xe689('0x6'))(_0xe689('0x7'));var config=require(_0xe689('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe689('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19a1b7,_0x5d76fe,_0xebe15b){return new BPromise(function(_0x54c1f6,_0x9a6028){return client[_0xe689('0xa')](_0x19a1b7,_0xebe15b)[_0xe689('0xb')](function(_0xf5c787){logger[_0xe689('0xc')](_0xe689('0xd'),_0x5d76fe,_0xe689('0xe'));logger[_0xe689('0xf')](_0xe689('0x10'),_0x5d76fe,'request\x20sent',JSON['stringify'](_0xf5c787));if(_0xf5c787[_0xe689('0x11')]){if(_0xf5c787[_0xe689('0x11')]['code']===0x1f4){logger[_0xe689('0x11')](_0xe689('0xd'),_0x5d76fe,_0xf5c787[_0xe689('0x11')][_0xe689('0x12')]);return _0x9a6028(_0xf5c787[_0xe689('0x11')][_0xe689('0x12')]);}logger[_0xe689('0x11')]('SquareRecording,\x20%s,\x20%s',_0x5d76fe,_0xf5c787[_0xe689('0x11')]['message']);return _0x54c1f6(_0xf5c787[_0xe689('0x11')]['message']);}else{logger[_0xe689('0xc')](_0xe689('0xd'),_0x5d76fe,'request\x20sent');_0x54c1f6(_0xf5c787[_0xe689('0x13')][_0xe689('0x12')]);}})['catch'](function(_0x171352){logger['error']('SquareRecording,\x20%s,\x20%s',_0x5d76fe,_0x171352);_0x9a6028(_0x171352);});});}exports[_0xe689('0x14')]=function(_0x5b9b49){var _0x80534f=this;return new Promise(function(_0x574f43,_0x40152c){return db[_0xe689('0x15')][_0xe689('0x16')](_0x5b9b49[_0xe689('0x17')],{'raw':_0x5b9b49[_0xe689('0x18')]?_0x5b9b49['options'][_0xe689('0x19')]===undefined?!![]:![]:!![]})[_0xe689('0xb')](function(_0x308207){logger[_0xe689('0xc')](_0xe689('0x14'),_0x5b9b49);logger[_0xe689('0xf')](_0xe689('0x14'),_0x5b9b49,JSON[_0xe689('0x1a')](_0x308207));_0x574f43(_0x308207);})[_0xe689('0x1b')](function(_0x20e579){logger[_0xe689('0x11')](_0xe689('0x14'),_0x20e579[_0xe689('0x12')],_0x5b9b49);_0x40152c(_0x80534f['error'](0x1f4,_0x20e579['message']));});});}; \ No newline at end of file +var _0xeed6=['SquareRecording','create','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareRecording'];(function(_0x15797a,_0x16274f){var _0x3e2618=function(_0x2b6e99){while(--_0x2b6e99){_0x15797a['push'](_0x15797a['shift']());}};_0x3e2618(++_0x16274f);}(_0xeed6,0xcf));var _0x6eed=function(_0x5e6304,_0x493578){_0x5e6304=_0x5e6304-0x0;var _0x506e57=_0xeed6[_0x5e6304];return _0x506e57;};'use strict';var _=require(_0x6eed('0x0'));var util=require(_0x6eed('0x1'));var moment=require(_0x6eed('0x2'));var BPromise=require(_0x6eed('0x3'));var rs=require(_0x6eed('0x4'));var fs=require('fs');var Redis=require(_0x6eed('0x5'));var db=require(_0x6eed('0x6'))['db'];var utils=require(_0x6eed('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6eed('0x8'));var client=jayson[_0x6eed('0x9')][_0x6eed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4df74d,_0x4efe87,_0x62126a){return new BPromise(function(_0x1fa7c8,_0x21099c){return client[_0x6eed('0xb')](_0x4df74d,_0x62126a)[_0x6eed('0xc')](function(_0x4b6803){logger['info'](_0x6eed('0xd'),_0x4efe87,_0x6eed('0xe'));logger[_0x6eed('0xf')](_0x6eed('0x10'),_0x4efe87,_0x6eed('0xe'),JSON[_0x6eed('0x11')](_0x4b6803));if(_0x4b6803['error']){if(_0x4b6803[_0x6eed('0x12')][_0x6eed('0x13')]===0x1f4){logger['error'](_0x6eed('0xd'),_0x4efe87,_0x4b6803[_0x6eed('0x12')][_0x6eed('0x14')]);return _0x21099c(_0x4b6803[_0x6eed('0x12')][_0x6eed('0x14')]);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x4efe87,_0x4b6803[_0x6eed('0x12')][_0x6eed('0x14')]);return _0x1fa7c8(_0x4b6803[_0x6eed('0x12')][_0x6eed('0x14')]);}else{logger[_0x6eed('0x15')](_0x6eed('0xd'),_0x4efe87,_0x6eed('0xe'));_0x1fa7c8(_0x4b6803[_0x6eed('0x16')][_0x6eed('0x14')]);}})[_0x6eed('0x17')](function(_0x55a3fe){logger[_0x6eed('0x12')]('SquareRecording,\x20%s,\x20%s',_0x4efe87,_0x55a3fe);_0x21099c(_0x55a3fe);});});}exports[_0x6eed('0x18')]=function(_0x3e3969){var _0x4d5dbd=this;return new Promise(function(_0x5eecad,_0x28fc7f){return db[_0x6eed('0x19')][_0x6eed('0x1a')](_0x3e3969['body'],{'raw':_0x3e3969[_0x6eed('0x1b')]?_0x3e3969['options'][_0x6eed('0x1c')]===undefined?!![]:![]:!![]})[_0x6eed('0xc')](function(_0x1244b1){logger[_0x6eed('0x15')](_0x6eed('0x18'),_0x3e3969);logger[_0x6eed('0xf')](_0x6eed('0x18'),_0x3e3969,JSON[_0x6eed('0x11')](_0x1244b1));_0x5eecad(_0x1244b1);})[_0x6eed('0x17')](function(_0x344e80){logger['error'](_0x6eed('0x18'),_0x344e80[_0x6eed('0x14')],_0x3e3969);_0x28fc7f(_0x4d5dbd[_0x6eed('0x12')](0x1f4,_0x344e80[_0x6eed('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 4e8e9bf..aa3c760 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 _0x8866=['exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','/describe','show','post','create','/:id','update','delete'];(function(_0x2f1908,_0x5d837d){var _0x357795=function(_0x5bf606){while(--_0x5bf606){_0x2f1908['push'](_0x2f1908['shift']());}};_0x357795(++_0x5d837d);}(_0x8866,0x78));var _0x6886=function(_0x5799d5,_0xcd0bde){_0x5799d5=_0x5799d5-0x0;var _0x149a03=_0x8866[_0x5799d5];return _0x149a03;};'use strict';var multer=require(_0x6886('0x0'));var util=require('util');var path=require(_0x6886('0x1'));var timeout=require('connect-timeout');var express=require(_0x6886('0x2'));var router=express[_0x6886('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x6886('0x4'));var config=require(_0x6886('0x5'));var controller=require(_0x6886('0x6'));router[_0x6886('0x7')]('/',auth[_0x6886('0x8')](),controller['index']);router['get'](_0x6886('0x9'),auth[_0x6886('0x8')](),controller['describe']);router[_0x6886('0x7')]('/:id',auth[_0x6886('0x8')](),controller[_0x6886('0xa')]);router[_0x6886('0xb')]('/',auth[_0x6886('0x8')](),controller[_0x6886('0xc')]);router['put'](_0x6886('0xd'),auth['isAuthenticated'](),controller[_0x6886('0xe')]);router[_0x6886('0xf')]('/:id',auth[_0x6886('0x8')](),controller['destroy']);module[_0x6886('0x10')]=router; \ No newline at end of file +var _0x7082=['get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x7082,0xc1));var _0x2708=function(_0x27a9cc,_0x1b1b55){_0x27a9cc=_0x27a9cc-0x0;var _0x412f06=_0x7082[_0x27a9cc];return _0x412f06;};'use strict';var multer=require('multer');var util=require(_0x2708('0x0'));var path=require(_0x2708('0x1'));var timeout=require(_0x2708('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x2708('0x3'));var interaction=require(_0x2708('0x4'));var config=require(_0x2708('0x5'));var controller=require(_0x2708('0x6'));router[_0x2708('0x7')]('/',auth[_0x2708('0x8')](),controller[_0x2708('0x9')]);router[_0x2708('0x7')](_0x2708('0xa'),auth[_0x2708('0x8')](),controller[_0x2708('0xb')]);router['get'](_0x2708('0xc'),auth[_0x2708('0x8')](),controller[_0x2708('0xd')]);router['post']('/',auth[_0x2708('0x8')](),controller[_0x2708('0xe')]);router[_0x2708('0xf')](_0x2708('0xc'),auth[_0x2708('0x8')](),controller[_0x2708('0x10')]);router[_0x2708('0x11')](_0x2708('0xc'),auth[_0x2708('0x8')](),controller[_0x2708('0x12')]);module[_0x2708('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index ac167d7..629fe7b 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 _0x7914=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x4dcdae,_0x25b5d4){var _0xa6acc3=function(_0x1d2110){while(--_0x1d2110){_0x4dcdae['push'](_0x4dcdae['shift']());}};_0xa6acc3(++_0x25b5d4);}(_0x7914,0x107));var _0x4791=function(_0x479e,_0x2268bf){_0x479e=_0x479e-0x0;var _0x4906c1=_0x7914[_0x479e];return _0x4906c1;};'use strict';var Sequelize=require(_0x4791('0x0'));module[_0x4791('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x4791('0x2')]},'request':{'type':Sequelize[_0x4791('0x2')]},'channel':{'type':Sequelize[_0x4791('0x2')]},'language':{'type':Sequelize[_0x4791('0x2')]},'type':{'type':Sequelize[_0x4791('0x2')]},'uniqueid':{'type':Sequelize[_0x4791('0x2')]},'version':{'type':Sequelize[_0x4791('0x2')]},'callerid':{'type':Sequelize[_0x4791('0x2')]},'calleridname':{'type':Sequelize[_0x4791('0x2')]},'callingpres':{'type':Sequelize[_0x4791('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x4791('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x4791('0x2')]},'rdnis':{'type':Sequelize[_0x4791('0x2')]},'context':{'type':Sequelize[_0x4791('0x2')]},'extension':{'type':Sequelize[_0x4791('0x2')]},'priority':{'type':Sequelize[_0x4791('0x2')]},'enhanced':{'type':Sequelize[_0x4791('0x2')]},'accountcode':{'type':Sequelize[_0x4791('0x2')]},'threadid':{'type':Sequelize[_0x4791('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x4791('0x3')]},'leaveAt':{'type':Sequelize[_0x4791('0x3')]},'bot':{'type':Sequelize[_0x4791('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x8bdf=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x2c53a2,_0x1aec86){var _0x493f31=function(_0x478e35){while(--_0x478e35){_0x2c53a2['push'](_0x2c53a2['shift']());}};_0x493f31(++_0x1aec86);}(_0x8bdf,0x1a7));var _0xf8bd=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x8bdf[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0xf8bd('0x0'));module[_0xf8bd('0x1')]={'network':{'type':Sequelize[_0xf8bd('0x2')]},'network_script':{'type':Sequelize[_0xf8bd('0x2')]},'request':{'type':Sequelize[_0xf8bd('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xf8bd('0x2')]},'type':{'type':Sequelize[_0xf8bd('0x2')]},'uniqueid':{'type':Sequelize[_0xf8bd('0x2')]},'version':{'type':Sequelize[_0xf8bd('0x2')]},'callerid':{'type':Sequelize[_0xf8bd('0x2')]},'calleridname':{'type':Sequelize[_0xf8bd('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xf8bd('0x2')]},'dnid':{'type':Sequelize[_0xf8bd('0x2')]},'rdnis':{'type':Sequelize[_0xf8bd('0x2')]},'context':{'type':Sequelize[_0xf8bd('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xf8bd('0x2')]},'enhanced':{'type':Sequelize[_0xf8bd('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xf8bd('0x2')]},'project_name':{'type':Sequelize[_0xf8bd('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xf8bd('0x3')]},'bot':{'type':Sequelize[_0xf8bd('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 eabb37d..96a77ed 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 _0x22ff=['../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','SquareReport','then','includeAll','include','findAll','rows','catch','params','length','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','moment','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x22ff,0xc3));var _0xf22f=function(_0x337651,_0x2af690){_0x337651=_0x337651-0x0;var _0x20893c=_0x22ff[_0x337651];return _0x20893c;};'use strict';var pdf=require(_0xf22f('0x0'));var emlformat=require(_0xf22f('0x1'));var rimraf=require(_0xf22f('0x2'));var zipdir=require(_0xf22f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf22f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf22f('0x5'));var util=require('util');var path=require(_0xf22f('0x6'));var sox=require(_0xf22f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xf22f('0x8'));var squel=require(_0xf22f('0x9'));var crypto=require(_0xf22f('0xa'));var jsforce=require(_0xf22f('0xb'));var deskjs=require(_0xf22f('0xc'));var toCsv=require(_0xf22f('0xd'));var querystring=require('querystring');var Papa=require(_0xf22f('0xe'));var Redis=require(_0xf22f('0xf'));var authService=require(_0xf22f('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf22f('0x11'));var logger=require(_0xf22f('0x12'))(_0xf22f('0x13'));var utils=require(_0xf22f('0x14'));var config=require('../../config/environment');var db=require(_0xf22f('0x15'))['db'];function respondWithStatusCode(_0x2e85f9,_0x3b7195){_0x3b7195=_0x3b7195||0xcc;return function(_0x32208){if(_0x32208){return _0x2e85f9[_0xf22f('0x16')](_0x3b7195);}return _0x2e85f9[_0xf22f('0x17')](_0x3b7195)['end']();};}function respondWithResult(_0x2b4252,_0x8e4d69){_0x8e4d69=_0x8e4d69||0xc8;return function(_0x56e7d2){if(_0x56e7d2){return _0x2b4252[_0xf22f('0x17')](_0x8e4d69)[_0xf22f('0x18')](_0x56e7d2);}};}function respondWithFilteredResult(_0x144c02,_0x42a836){return function(_0x20e161){if(_0x20e161){var _0x5c7a99=_0x20e161[_0xf22f('0x19')],_0x576ee4=_0x42a836[_0xf22f('0x1a')],_0x4c3d3e=_0x42a836['offset']+_0x42a836[_0xf22f('0x1b')],_0xe22e98;if(_0x4c3d3e>=_0x5c7a99){_0x4c3d3e=_0x5c7a99;_0xe22e98=0xc8;}else{_0xe22e98=0xce;}_0x144c02[_0xf22f('0x17')](_0xe22e98);return _0x144c02['set'](_0xf22f('0x1c'),_0x576ee4+'-'+_0x4c3d3e+'/'+_0x5c7a99)[_0xf22f('0x18')](_0x20e161);}return null;};}function patchUpdates(_0x1e03cc){return function(_0xe90d3d){try{jsonpatch[_0xf22f('0x1d')](_0xe90d3d,_0x1e03cc,!![]);}catch(_0x27c8aa){return BPromise[_0xf22f('0x1e')](_0x27c8aa);}return _0xe90d3d[_0xf22f('0x1f')]();};}function saveUpdates(_0x3ac410,_0x229f99){return function(_0x34ec38){if(_0x34ec38){return _0x34ec38[_0xf22f('0x20')](_0x3ac410)['then'](function(_0x390a50){return _0x390a50;});}return null;};}function removeEntity(_0x3d6899,_0x425657){return function(_0x466436){if(_0x466436){return _0x466436[_0xf22f('0x21')]()['then'](function(){_0x3d6899[_0xf22f('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23a6fa,_0x343ab2){return function(_0x2f01bd){if(!_0x2f01bd){_0x23a6fa['sendStatus'](0x194);}return _0x2f01bd;};}function handleError(_0x68de15,_0x36d9f9){_0x36d9f9=_0x36d9f9||0x1f4;return function(_0x1405e8){logger[_0xf22f('0x22')](_0x1405e8[_0xf22f('0x23')]);if(_0x1405e8[_0xf22f('0x24')]){delete _0x1405e8[_0xf22f('0x24')];}_0x68de15[_0xf22f('0x17')](_0x36d9f9)[_0xf22f('0x25')](_0x1405e8);};}exports['index']=function(_0x4607ea,_0x2ef415){var _0x35caf2={},_0x2e1fa6={},_0x33ed7c={'count':0x0,'rows':[]};var _0x3e1a8a=db['SquareReport'][_0xf22f('0x26')];_0x2e1fa6[_0xf22f('0x27')]=_['keys'](_0x3e1a8a);_0x2e1fa6[_0xf22f('0x28')]=_[_0xf22f('0x29')](_0x4607ea[_0xf22f('0x28')]);_0x2e1fa6[_0xf22f('0x2a')]=_[_0xf22f('0x2b')](_0x2e1fa6[_0xf22f('0x27')],_0x2e1fa6['query']);_0x35caf2[_0xf22f('0x2c')]=_[_0xf22f('0x2b')](_0x2e1fa6[_0xf22f('0x27')],qs[_0xf22f('0x2d')](_0x4607ea[_0xf22f('0x28')][_0xf22f('0x2d')]));_0x35caf2[_0xf22f('0x2c')]=_0x35caf2[_0xf22f('0x2c')]['length']?_0x35caf2['attributes']:_0x2e1fa6[_0xf22f('0x27')];if(!_0x4607ea[_0xf22f('0x28')][_0xf22f('0x2e')](_0xf22f('0x2f'))){_0x35caf2[_0xf22f('0x1b')]=qs['limit'](_0x4607ea['query']['limit']);_0x35caf2[_0xf22f('0x1a')]=qs[_0xf22f('0x1a')](_0x4607ea[_0xf22f('0x28')]['offset']);}_0x35caf2['order']=qs[_0xf22f('0x30')](_0x4607ea[_0xf22f('0x28')][_0xf22f('0x30')]);_0x35caf2[_0xf22f('0x31')]=qs[_0xf22f('0x2a')](_[_0xf22f('0x32')](_0x4607ea[_0xf22f('0x28')],_0x2e1fa6[_0xf22f('0x2a')]));if(_0x4607ea[_0xf22f('0x28')][_0xf22f('0x33')]){_0x35caf2[_0xf22f('0x31')]=_['merge'](_0x35caf2[_0xf22f('0x31')],{'$or':_[_0xf22f('0x34')](_0x3e1a8a,function(_0x445ac8){if(_0x445ac8[_0xf22f('0x35')][_0xf22f('0x36')]!==_0xf22f('0x37')){var _0x35e5cd={};_0x35e5cd[_0x445ac8[_0xf22f('0x38')]]={'$like':'%'+_0x4607ea[_0xf22f('0x28')]['filter']+'%'};return _0x35e5cd;}})});}_0x35caf2=_[_0xf22f('0x39')]({},_0x35caf2,_0x4607ea[_0xf22f('0x3a')]);var _0x37db47={'where':_0x35caf2[_0xf22f('0x31')]};return db[_0xf22f('0x3b')][_0xf22f('0x19')](_0x37db47)[_0xf22f('0x3c')](function(_0x98d890){_0x33ed7c['count']=_0x98d890;if(_0x4607ea['query'][_0xf22f('0x3d')]){_0x35caf2[_0xf22f('0x3e')]=[{'all':!![]}];}return db[_0xf22f('0x3b')][_0xf22f('0x3f')](_0x35caf2);})[_0xf22f('0x3c')](function(_0x107a4f){_0x33ed7c[_0xf22f('0x40')]=_0x107a4f;return _0x33ed7c;})[_0xf22f('0x3c')](respondWithFilteredResult(_0x2ef415,_0x35caf2))[_0xf22f('0x41')](handleError(_0x2ef415,null));};exports['show']=function(_0x3a0e78,_0x5398cb){var _0x4089ce={'raw':!![],'where':{'id':_0x3a0e78[_0xf22f('0x42')]['id']}},_0x5bc6a8={};_0x5bc6a8['model']=_[_0xf22f('0x29')](db['SquareReport'][_0xf22f('0x26')]);_0x5bc6a8[_0xf22f('0x28')]=_[_0xf22f('0x29')](_0x3a0e78[_0xf22f('0x28')]);_0x5bc6a8[_0xf22f('0x2a')]=_[_0xf22f('0x2b')](_0x5bc6a8[_0xf22f('0x27')],_0x5bc6a8[_0xf22f('0x28')]);_0x4089ce['attributes']=_[_0xf22f('0x2b')](_0x5bc6a8[_0xf22f('0x27')],qs[_0xf22f('0x2d')](_0x3a0e78[_0xf22f('0x28')][_0xf22f('0x2d')]));_0x4089ce[_0xf22f('0x2c')]=_0x4089ce[_0xf22f('0x2c')][_0xf22f('0x43')]?_0x4089ce[_0xf22f('0x2c')]:_0x5bc6a8[_0xf22f('0x27')];if(_0x3a0e78[_0xf22f('0x28')]['includeAll']){_0x4089ce[_0xf22f('0x3e')]=[{'all':!![]}];}_0x4089ce=_[_0xf22f('0x39')]({},_0x4089ce,_0x3a0e78[_0xf22f('0x3a')]);return db[_0xf22f('0x3b')][_0xf22f('0x44')](_0x4089ce)[_0xf22f('0x3c')](handleEntityNotFound(_0x5398cb,null))[_0xf22f('0x3c')](respondWithResult(_0x5398cb,null))[_0xf22f('0x41')](handleError(_0x5398cb,null));};exports[_0xf22f('0x45')]=function(_0x3e7a72,_0x3738f0){return db[_0xf22f('0x3b')][_0xf22f('0x45')](_0x3e7a72[_0xf22f('0x46')],{})['then'](respondWithResult(_0x3738f0,0xc9))['catch'](handleError(_0x3738f0,null));};exports[_0xf22f('0x20')]=function(_0x380631,_0x161dae){if(_0x380631[_0xf22f('0x46')]['id']){delete _0x380631['body']['id'];}return db[_0xf22f('0x3b')][_0xf22f('0x44')]({'where':{'id':_0x380631[_0xf22f('0x42')]['id']}})['then'](handleEntityNotFound(_0x161dae,null))[_0xf22f('0x3c')](saveUpdates(_0x380631['body'],null))['then'](respondWithResult(_0x161dae,null))[_0xf22f('0x41')](handleError(_0x161dae,null));};exports[_0xf22f('0x21')]=function(_0x24cb48,_0x5f0ed1){return db[_0xf22f('0x3b')][_0xf22f('0x44')]({'where':{'id':_0x24cb48['params']['id']}})[_0xf22f('0x3c')](handleEntityNotFound(_0x5f0ed1,null))['then'](removeEntity(_0x5f0ed1,null))['catch'](handleError(_0x5f0ed1,null));};exports[_0xf22f('0x47')]=function(_0x36022f,_0x55549b){return db['SquareReport']['describe']()['then'](respondWithResult(_0x55549b,null))['catch'](handleError(_0x55549b,null));}; \ No newline at end of file +var _0xefec=['rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','SquareReport'];(function(_0x1cd674,_0x8d3638){var _0x27928f=function(_0x5e3c70){while(--_0x5e3c70){_0x1cd674['push'](_0x1cd674['shift']());}};_0x27928f(++_0x8d3638);}(_0xefec,0xb6));var _0xcefe=function(_0x56db82,_0x55a985){_0x56db82=_0x56db82-0x0;var _0x5eadbd=_0xefec[_0x56db82];return _0x5eadbd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcefe('0x0'));var rimraf=require(_0xcefe('0x1'));var zipdir=require(_0xcefe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcefe('0x3'));var moment=require(_0xcefe('0x4'));var BPromise=require(_0xcefe('0x5'));var Mustache=require(_0xcefe('0x6'));var util=require(_0xcefe('0x7'));var path=require(_0xcefe('0x8'));var sox=require(_0xcefe('0x9'));var csv=require(_0xcefe('0xa'));var ejs=require(_0xcefe('0xb'));var fs=require('fs');var _=require(_0xcefe('0xc'));var squel=require('squel');var crypto=require(_0xcefe('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xcefe('0xe'));var toCsv=require(_0xcefe('0xa'));var querystring=require(_0xcefe('0xf'));var Papa=require(_0xcefe('0x10'));var Redis=require(_0xcefe('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcefe('0x12'));var hardwareService=require(_0xcefe('0x13'));var logger=require(_0xcefe('0x14'))(_0xcefe('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xcefe('0x16'))['db'];function respondWithStatusCode(_0x52bd26,_0x3a1d5f){_0x3a1d5f=_0x3a1d5f||0xcc;return function(_0xa5a335){if(_0xa5a335){return _0x52bd26['sendStatus'](_0x3a1d5f);}return _0x52bd26['status'](_0x3a1d5f)[_0xcefe('0x17')]();};}function respondWithResult(_0x374fe7,_0x2d3b8e){_0x2d3b8e=_0x2d3b8e||0xc8;return function(_0xb0f433){if(_0xb0f433){return _0x374fe7[_0xcefe('0x18')](_0x2d3b8e)[_0xcefe('0x19')](_0xb0f433);}};}function respondWithFilteredResult(_0x1550c1,_0x3b0f0d){return function(_0x1298e6){if(_0x1298e6){var _0x509416=_0x1298e6[_0xcefe('0x1a')],_0xfa8125=_0x3b0f0d[_0xcefe('0x1b')],_0x46d334=_0x3b0f0d[_0xcefe('0x1b')]+_0x3b0f0d[_0xcefe('0x1c')],_0x55d8e0;if(_0x46d334>=_0x509416){_0x46d334=_0x509416;_0x55d8e0=0xc8;}else{_0x55d8e0=0xce;}_0x1550c1['status'](_0x55d8e0);return _0x1550c1[_0xcefe('0x1d')](_0xcefe('0x1e'),_0xfa8125+'-'+_0x46d334+'/'+_0x509416)['json'](_0x1298e6);}return null;};}function patchUpdates(_0x28610d){return function(_0x241a79){try{jsonpatch[_0xcefe('0x1f')](_0x241a79,_0x28610d,!![]);}catch(_0x182ee2){return BPromise[_0xcefe('0x20')](_0x182ee2);}return _0x241a79[_0xcefe('0x21')]();};}function saveUpdates(_0x4caf31,_0x18faa2){return function(_0x515002){if(_0x515002){return _0x515002[_0xcefe('0x22')](_0x4caf31)['then'](function(_0x5c5578){return _0x5c5578;});}return null;};}function removeEntity(_0x29def1,_0x494982){return function(_0x3ac8a1){if(_0x3ac8a1){return _0x3ac8a1['destroy']()[_0xcefe('0x23')](function(){_0x29def1[_0xcefe('0x18')](0xcc)[_0xcefe('0x17')]();});}};}function handleEntityNotFound(_0x1bec3f,_0x1079e3){return function(_0x37c2fa){if(!_0x37c2fa){_0x1bec3f[_0xcefe('0x24')](0x194);}return _0x37c2fa;};}function handleError(_0x220e7f,_0x282d66){_0x282d66=_0x282d66||0x1f4;return function(_0x1eb5c){logger[_0xcefe('0x25')](_0x1eb5c[_0xcefe('0x26')]);if(_0x1eb5c[_0xcefe('0x27')]){delete _0x1eb5c[_0xcefe('0x27')];}_0x220e7f['status'](_0x282d66)[_0xcefe('0x28')](_0x1eb5c);};}exports[_0xcefe('0x29')]=function(_0x4d3c84,_0x1e308d){var _0x2cd3a2={},_0x48363={},_0x5680a8={'count':0x0,'rows':[]};var _0x2405e9=db[_0xcefe('0x2a')][_0xcefe('0x2b')];_0x48363[_0xcefe('0x2c')]=_[_0xcefe('0x2d')](_0x2405e9);_0x48363[_0xcefe('0x2e')]=_['keys'](_0x4d3c84['query']);_0x48363['filters']=_[_0xcefe('0x2f')](_0x48363[_0xcefe('0x2c')],_0x48363['query']);_0x2cd3a2['attributes']=_[_0xcefe('0x2f')](_0x48363[_0xcefe('0x2c')],qs['fields'](_0x4d3c84[_0xcefe('0x2e')][_0xcefe('0x30')]));_0x2cd3a2[_0xcefe('0x31')]=_0x2cd3a2[_0xcefe('0x31')][_0xcefe('0x32')]?_0x2cd3a2[_0xcefe('0x31')]:_0x48363[_0xcefe('0x2c')];if(!_0x4d3c84[_0xcefe('0x2e')][_0xcefe('0x33')]('nolimit')){_0x2cd3a2[_0xcefe('0x1c')]=qs[_0xcefe('0x1c')](_0x4d3c84['query'][_0xcefe('0x1c')]);_0x2cd3a2[_0xcefe('0x1b')]=qs[_0xcefe('0x1b')](_0x4d3c84[_0xcefe('0x2e')]['offset']);}_0x2cd3a2[_0xcefe('0x34')]=qs['sort'](_0x4d3c84['query'][_0xcefe('0x35')]);_0x2cd3a2[_0xcefe('0x36')]=qs['filters'](_[_0xcefe('0x37')](_0x4d3c84[_0xcefe('0x2e')],_0x48363['filters']));if(_0x4d3c84[_0xcefe('0x2e')][_0xcefe('0x38')]){_0x2cd3a2[_0xcefe('0x36')]=_[_0xcefe('0x39')](_0x2cd3a2[_0xcefe('0x36')],{'$or':_[_0xcefe('0x3a')](_0x2405e9,function(_0x797645){if(_0x797645['type'][_0xcefe('0x3b')]!==_0xcefe('0x3c')){var _0x9c6bb={};_0x9c6bb[_0x797645[_0xcefe('0x3d')]]={'$like':'%'+_0x4d3c84[_0xcefe('0x2e')]['filter']+'%'};return _0x9c6bb;}})});}_0x2cd3a2=_['merge']({},_0x2cd3a2,_0x4d3c84['options']);var _0x283449={'where':_0x2cd3a2[_0xcefe('0x36')]};return db['SquareReport'][_0xcefe('0x1a')](_0x283449)[_0xcefe('0x23')](function(_0x2c52b4){_0x5680a8[_0xcefe('0x1a')]=_0x2c52b4;if(_0x4d3c84[_0xcefe('0x2e')]['includeAll']){_0x2cd3a2[_0xcefe('0x3e')]=[{'all':!![]}];}return db[_0xcefe('0x2a')][_0xcefe('0x3f')](_0x2cd3a2);})[_0xcefe('0x23')](function(_0x4b1255){_0x5680a8[_0xcefe('0x40')]=_0x4b1255;return _0x5680a8;})[_0xcefe('0x23')](respondWithFilteredResult(_0x1e308d,_0x2cd3a2))[_0xcefe('0x41')](handleError(_0x1e308d,null));};exports[_0xcefe('0x42')]=function(_0xc16a0b,_0x4eb468){var _0x353670={'raw':!![],'where':{'id':_0xc16a0b[_0xcefe('0x43')]['id']}},_0x58e407={};_0x58e407[_0xcefe('0x2c')]=_['keys'](db[_0xcefe('0x2a')]['rawAttributes']);_0x58e407[_0xcefe('0x2e')]=_['keys'](_0xc16a0b['query']);_0x58e407['filters']=_[_0xcefe('0x2f')](_0x58e407[_0xcefe('0x2c')],_0x58e407[_0xcefe('0x2e')]);_0x353670[_0xcefe('0x31')]=_['intersection'](_0x58e407[_0xcefe('0x2c')],qs[_0xcefe('0x30')](_0xc16a0b[_0xcefe('0x2e')][_0xcefe('0x30')]));_0x353670['attributes']=_0x353670[_0xcefe('0x31')][_0xcefe('0x32')]?_0x353670[_0xcefe('0x31')]:_0x58e407[_0xcefe('0x2c')];if(_0xc16a0b[_0xcefe('0x2e')][_0xcefe('0x44')]){_0x353670[_0xcefe('0x3e')]=[{'all':!![]}];}_0x353670=_[_0xcefe('0x39')]({},_0x353670,_0xc16a0b[_0xcefe('0x45')]);return db[_0xcefe('0x2a')][_0xcefe('0x46')](_0x353670)[_0xcefe('0x23')](handleEntityNotFound(_0x4eb468,null))['then'](respondWithResult(_0x4eb468,null))[_0xcefe('0x41')](handleError(_0x4eb468,null));};exports[_0xcefe('0x47')]=function(_0x3665a6,_0x32ad7f){return db[_0xcefe('0x2a')][_0xcefe('0x47')](_0x3665a6[_0xcefe('0x48')],{})['then'](respondWithResult(_0x32ad7f,0xc9))['catch'](handleError(_0x32ad7f,null));};exports[_0xcefe('0x22')]=function(_0x5e2c82,_0x38cbe1){if(_0x5e2c82[_0xcefe('0x48')]['id']){delete _0x5e2c82['body']['id'];}return db[_0xcefe('0x2a')][_0xcefe('0x46')]({'where':{'id':_0x5e2c82[_0xcefe('0x43')]['id']}})[_0xcefe('0x23')](handleEntityNotFound(_0x38cbe1,null))[_0xcefe('0x23')](saveUpdates(_0x5e2c82[_0xcefe('0x48')],null))[_0xcefe('0x23')](respondWithResult(_0x38cbe1,null))[_0xcefe('0x41')](handleError(_0x38cbe1,null));};exports[_0xcefe('0x49')]=function(_0x47ff27,_0x339029){return db[_0xcefe('0x2a')]['find']({'where':{'id':_0x47ff27[_0xcefe('0x43')]['id']}})['then'](handleEntityNotFound(_0x339029,null))[_0xcefe('0x23')](removeEntity(_0x339029,null))['catch'](handleError(_0x339029,null));};exports[_0xcefe('0x4a')]=function(_0x58787e,_0x8c2dc1){return db[_0xcefe('0x2a')][_0xcefe('0x4a')]()[_0xcefe('0x23')](respondWithResult(_0x8c2dc1,null))[_0xcefe('0x41')](handleError(_0x8c2dc1,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 964d6bc..fffd89d 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 _0x9957=['api','bluebird','request-promise','path','rimraf','./squareReport.attributes','exports','define','SquareReport','uid_pname','uniqueid','leaveAt','lodash','util','../../config/logger'];(function(_0x1a1cb8,_0xaab1ba){var _0x3aebc8=function(_0x582d90){while(--_0x582d90){_0x1a1cb8['push'](_0x1a1cb8['shift']());}};_0x3aebc8(++_0xaab1ba);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xd'),'project_name']},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['exports','define','SquareReport','uniqueid','leaveAt','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./squareReport.attributes'];(function(_0x1928fe,_0x3f7a42){var _0x2bcda0=function(_0x4ba353){while(--_0x4ba353){_0x1928fe['push'](_0x1928fe['shift']());}};_0x2bcda0(++_0x3f7a42);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x0a9e('0xb'),'project_name']},{'name':'leaveAt','fields':[_0x0a9e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index bab9fe3..de2a239 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 _0xa039=['ioredis','../../config/utils','../../config/logger','client','http','then','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','CreateSquareReport','create','body','raw','SquareReport','options','where','attributes','limit','UpdateSquareReport','lodash','util','bluebird'];(function(_0xbc1612,_0x539773){var _0x4181a3=function(_0xd8e00c){while(--_0xd8e00c){_0xbc1612['push'](_0xbc1612['shift']());}};_0x4181a3(++_0x539773);}(_0xa039,0x102));var _0x9a03=function(_0x5e562a,_0x1a312c){_0x5e562a=_0x5e562a-0x0;var _0x235920=_0xa039[_0x5e562a];return _0x235920;};'use strict';var _=require(_0x9a03('0x0'));var util=require(_0x9a03('0x1'));var moment=require('moment');var BPromise=require(_0x9a03('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a03('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9a03('0x4'));var logger=require(_0x9a03('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9a03('0x6')][_0x9a03('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x304b59,_0x28be23,_0x280943){return new BPromise(function(_0x338469,_0x59d253){return client['request'](_0x304b59,_0x280943)[_0x9a03('0x8')](function(_0x229c93){logger['info'](_0x9a03('0x9'),_0x28be23,'request\x20sent');logger[_0x9a03('0xa')](_0x9a03('0xb'),_0x28be23,_0x9a03('0xc'),JSON[_0x9a03('0xd')](_0x229c93));if(_0x229c93[_0x9a03('0xe')]){if(_0x229c93[_0x9a03('0xe')][_0x9a03('0xf')]===0x1f4){logger[_0x9a03('0xe')](_0x9a03('0x9'),_0x28be23,_0x229c93[_0x9a03('0xe')][_0x9a03('0x10')]);return _0x59d253(_0x229c93['error']['message']);}logger[_0x9a03('0xe')](_0x9a03('0x9'),_0x28be23,_0x229c93[_0x9a03('0xe')]['message']);return _0x338469(_0x229c93[_0x9a03('0xe')][_0x9a03('0x10')]);}else{logger[_0x9a03('0x11')]('SquareReport,\x20%s,\x20%s',_0x28be23,_0x9a03('0xc'));_0x338469(_0x229c93['result'][_0x9a03('0x10')]);}})[_0x9a03('0x12')](function(_0x406732){logger['error']('SquareReport,\x20%s,\x20%s',_0x28be23,_0x406732);_0x59d253(_0x406732);});});}exports[_0x9a03('0x13')]=function(_0x22681f){var _0x468cb6=this;return new Promise(function(_0x201cc8,_0x3115e0){return db['SquareReport'][_0x9a03('0x14')](_0x22681f[_0x9a03('0x15')],{'raw':_0x22681f['options']?_0x22681f['options'][_0x9a03('0x16')]===undefined?!![]:![]:!![]})[_0x9a03('0x8')](function(_0x438e42){logger[_0x9a03('0x11')]('CreateSquareReport',_0x22681f);logger[_0x9a03('0xa')](_0x9a03('0x13'),_0x22681f,JSON[_0x9a03('0xd')](_0x438e42));_0x201cc8(_0x438e42);})[_0x9a03('0x12')](function(_0x4cf4f2){logger[_0x9a03('0xe')](_0x9a03('0x13'),_0x4cf4f2[_0x9a03('0x10')],_0x22681f);_0x3115e0(_0x468cb6['error'](0x1f4,_0x4cf4f2[_0x9a03('0x10')]));});});};exports['UpdateSquareReport']=function(_0x1e0325){var _0x3cba0d=this;return new Promise(function(_0x239ee7,_0x18e6ea){return db[_0x9a03('0x17')]['update'](_0x1e0325[_0x9a03('0x15')],{'raw':_0x1e0325[_0x9a03('0x18')]?_0x1e0325['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e0325[_0x9a03('0x18')]?_0x1e0325[_0x9a03('0x18')][_0x9a03('0x19')]||null:null,'attributes':_0x1e0325['options']?_0x1e0325[_0x9a03('0x18')][_0x9a03('0x1a')]||null:null,'limit':_0x1e0325[_0x9a03('0x18')]?_0x1e0325['options'][_0x9a03('0x1b')]||null:null})[_0x9a03('0x8')](function(_0x2722a3){logger[_0x9a03('0x11')](_0x9a03('0x1c'),_0x1e0325);logger['debug'](_0x9a03('0x1c'),_0x1e0325,JSON[_0x9a03('0xd')](_0x2722a3));_0x239ee7(_0x2722a3);})[_0x9a03('0x12')](function(_0xb3a647){logger[_0x9a03('0xe')]('UpdateSquareReport',_0xb3a647[_0x9a03('0x10')],_0x1e0325);_0x18e6ea(_0x3cba0d[_0x9a03('0xe')](0x1f4,_0xb3a647[_0x9a03('0x10')]));});});}; \ No newline at end of file +var _0x5853=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','create','body','options','debug','update','raw','attributes','limit','UpdateSquareReport','lodash','util','moment','bluebird','randomstring'];(function(_0x23710a,_0x2a5257){var _0xb876d9=function(_0x65f41c){while(--_0x65f41c){_0x23710a['push'](_0x23710a['shift']());}};_0xb876d9(++_0x2a5257);}(_0x5853,0x113));var _0x3585=function(_0x506d2f,_0x5ab76e){_0x506d2f=_0x506d2f-0x0;var _0x101255=_0x5853[_0x506d2f];return _0x101255;};'use strict';var _=require(_0x3585('0x0'));var util=require(_0x3585('0x1'));var moment=require(_0x3585('0x2'));var BPromise=require(_0x3585('0x3'));var rs=require(_0x3585('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3585('0x5'))['db'];var utils=require(_0x3585('0x6'));var logger=require(_0x3585('0x7'))(_0x3585('0x8'));var config=require(_0x3585('0x9'));var jayson=require(_0x3585('0xa'));var client=jayson['client'][_0x3585('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48b3ff,_0x5d8c2d,_0x1a97fd){return new BPromise(function(_0x5e78f3,_0x5910ab){return client[_0x3585('0xc')](_0x48b3ff,_0x1a97fd)[_0x3585('0xd')](function(_0x2febe8){logger[_0x3585('0xe')](_0x3585('0xf'),_0x5d8c2d,_0x3585('0x10'));logger['debug'](_0x3585('0x11'),_0x5d8c2d,_0x3585('0x10'),JSON[_0x3585('0x12')](_0x2febe8));if(_0x2febe8[_0x3585('0x13')]){if(_0x2febe8[_0x3585('0x13')][_0x3585('0x14')]===0x1f4){logger[_0x3585('0x13')]('SquareReport,\x20%s,\x20%s',_0x5d8c2d,_0x2febe8[_0x3585('0x13')]['message']);return _0x5910ab(_0x2febe8['error']['message']);}logger['error'](_0x3585('0xf'),_0x5d8c2d,_0x2febe8['error'][_0x3585('0x15')]);return _0x5e78f3(_0x2febe8[_0x3585('0x13')]['message']);}else{logger[_0x3585('0xe')](_0x3585('0xf'),_0x5d8c2d,'request\x20sent');_0x5e78f3(_0x2febe8[_0x3585('0x16')][_0x3585('0x15')]);}})[_0x3585('0x17')](function(_0x2beae5){logger[_0x3585('0x13')]('SquareReport,\x20%s,\x20%s',_0x5d8c2d,_0x2beae5);_0x5910ab(_0x2beae5);});});}exports[_0x3585('0x18')]=function(_0x48c1db){var _0x22cfec=this;return new Promise(function(_0x4493e5,_0x3206d6){return db[_0x3585('0x19')][_0x3585('0x1a')](_0x48c1db[_0x3585('0x1b')],{'raw':_0x48c1db[_0x3585('0x1c')]?_0x48c1db['options']['raw']===undefined?!![]:![]:!![]})[_0x3585('0xd')](function(_0x473dc9){logger[_0x3585('0xe')](_0x3585('0x18'),_0x48c1db);logger[_0x3585('0x1d')]('CreateSquareReport',_0x48c1db,JSON[_0x3585('0x12')](_0x473dc9));_0x4493e5(_0x473dc9);})[_0x3585('0x17')](function(_0x35975c){logger[_0x3585('0x13')](_0x3585('0x18'),_0x35975c['message'],_0x48c1db);_0x3206d6(_0x22cfec['error'](0x1f4,_0x35975c['message']));});});};exports['UpdateSquareReport']=function(_0x568937){var _0x4d0cf6=this;return new Promise(function(_0x349571,_0x3e8e00){return db[_0x3585('0x19')][_0x3585('0x1e')](_0x568937[_0x3585('0x1b')],{'raw':_0x568937['options']?_0x568937[_0x3585('0x1c')][_0x3585('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x568937['options']?_0x568937[_0x3585('0x1c')]['where']||null:null,'attributes':_0x568937[_0x3585('0x1c')]?_0x568937[_0x3585('0x1c')][_0x3585('0x20')]||null:null,'limit':_0x568937[_0x3585('0x1c')]?_0x568937[_0x3585('0x1c')][_0x3585('0x21')]||null:null})[_0x3585('0xd')](function(_0x149c99){logger[_0x3585('0xe')](_0x3585('0x22'),_0x568937);logger[_0x3585('0x1d')](_0x3585('0x22'),_0x568937,JSON['stringify'](_0x149c99));_0x349571(_0x149c99);})[_0x3585('0x17')](function(_0x8e57b3){logger[_0x3585('0x13')](_0x3585('0x22'),_0x8e57b3[_0x3585('0x15')],_0x568937);_0x3e8e00(_0x4d0cf6[_0x3585('0x13')](0x1f4,_0x8e57b3['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index fb81063..70aa5e5 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 _0x6f2e=['get','index','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareReportDetail.controller'];(function(_0x5f409e,_0x14c1b2){var _0x44ef41=function(_0xe30069){while(--_0xe30069){_0x5f409e['push'](_0x5f409e['shift']());}};_0x44ef41(++_0x14c1b2);}(_0x6f2e,0xac));var _0xe6f2=function(_0x5f6a7,_0x589076){_0x5f6a7=_0x5f6a7-0x0;var _0x285a69=_0x6f2e[_0x5f6a7];return _0x285a69;};'use strict';var multer=require('multer');var util=require(_0xe6f2('0x0'));var path=require(_0xe6f2('0x1'));var timeout=require(_0xe6f2('0x2'));var express=require(_0xe6f2('0x3'));var router=express[_0xe6f2('0x4')]();var auth=require(_0xe6f2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe6f2('0x6'));var controller=require(_0xe6f2('0x7'));router[_0xe6f2('0x8')]('/',auth['isAuthenticated'](),controller[_0xe6f2('0x9')]);router[_0xe6f2('0x8')]('/describe',auth[_0xe6f2('0xa')](),controller['describe']);router['get'](_0xe6f2('0xb'),auth['isAuthenticated'](),controller[_0xe6f2('0xc')]);router[_0xe6f2('0xd')]('/',auth['isAuthenticated'](),controller[_0xe6f2('0xe')]);router[_0xe6f2('0xf')](_0xe6f2('0xb'),auth[_0xe6f2('0xa')](),controller[_0xe6f2('0x10')]);router[_0xe6f2('0x11')](_0xe6f2('0xb'),auth[_0xe6f2('0xa')](),controller[_0xe6f2('0x12')]);module[_0xe6f2('0x13')]=router; \ No newline at end of file +var _0x39f9=['connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','put','destroy','multer','util'];(function(_0x31c65f,_0x2c7278){var _0x116f5f=function(_0x20c139){while(--_0x20c139){_0x31c65f['push'](_0x31c65f['shift']());}};_0x116f5f(++_0x2c7278);}(_0x39f9,0x186));var _0x939f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x39f9[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x939f('0x0'));var util=require(_0x939f('0x1'));var path=require('path');var timeout=require(_0x939f('0x2'));var express=require(_0x939f('0x3'));var router=express['Router']();var auth=require(_0x939f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x939f('0x5'));var controller=require('./squareReportDetail.controller');router[_0x939f('0x6')]('/',auth[_0x939f('0x7')](),controller[_0x939f('0x8')]);router[_0x939f('0x6')]('/describe',auth[_0x939f('0x7')](),controller[_0x939f('0x9')]);router[_0x939f('0x6')](_0x939f('0xa'),auth[_0x939f('0x7')](),controller[_0x939f('0xb')]);router['post']('/',auth[_0x939f('0x7')](),controller['create']);router[_0x939f('0xc')](_0x939f('0xa'),auth[_0x939f('0x7')](),controller['update']);router['delete'](_0x939f('0xa'),auth['isAuthenticated'](),controller[_0x939f('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index e7f84ed..058d21a 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 _0x5bbb=['STRING','TEXT','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5bbb,0x72));var _0xb5bb=function(_0x4c6f13,_0xbd6db8){_0x4c6f13=_0x4c6f13-0x0;var _0x3b5f8d=_0x5bbb[_0x4c6f13];return _0x3b5f8d;};'use strict';var Sequelize=require(_0xb5bb('0x0'));module[_0xb5bb('0x1')]={'uniqueid':{'type':Sequelize[_0xb5bb('0x2')]},'node':{'type':Sequelize[_0xb5bb('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xb5bb('0x3')]},'project_name':{'type':Sequelize[_0xb5bb('0x2')]},'callerid':{'type':Sequelize[_0xb5bb('0x2')]}}; \ No newline at end of file +var _0xc949=['sequelize','exports','STRING','TEXT'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xc949,0xf4));var _0x9c94=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xc949[_0xf0bcac];return _0x4e4c65;};'use strict';var Sequelize=require(_0x9c94('0x0'));module[_0x9c94('0x1')]={'uniqueid':{'type':Sequelize[_0x9c94('0x2')]},'node':{'type':Sequelize[_0x9c94('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x9c94('0x3')]},'project_name':{'type':Sequelize[_0x9c94('0x2')]},'callerid':{'type':Sequelize[_0x9c94('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index b7b3b78..c6d666e 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 _0x411c=['keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','map','VIRTUAL','merge','include','findAll','catch','includeAll','options','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','SquareDetailsReport','rawAttributes','model'];(function(_0x454e93,_0x212c28){var _0x4ea83f=function(_0xd38114){while(--_0xd38114){_0x454e93['push'](_0x454e93['shift']());}};_0x4ea83f(++_0x212c28);}(_0x411c,0xae));var _0xc411=function(_0x3ff37f,_0x71be79){_0x3ff37f=_0x3ff37f-0x0;var _0x987576=_0x411c[_0x3ff37f];return _0x987576;};'use strict';var pdf=require(_0xc411('0x0'));var emlformat=require(_0xc411('0x1'));var rimraf=require(_0xc411('0x2'));var zipdir=require(_0xc411('0x3'));var jsonpatch=require(_0xc411('0x4'));var rp=require(_0xc411('0x5'));var moment=require(_0xc411('0x6'));var BPromise=require(_0xc411('0x7'));var Mustache=require(_0xc411('0x8'));var util=require('util');var path=require('path');var sox=require(_0xc411('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xc411('0xa'));var squel=require(_0xc411('0xb'));var crypto=require(_0xc411('0xc'));var jsforce=require(_0xc411('0xd'));var deskjs=require(_0xc411('0xe'));var toCsv=require(_0xc411('0xf'));var querystring=require(_0xc411('0x10'));var Papa=require('papaparse');var Redis=require(_0xc411('0x11'));var authService=require(_0xc411('0x12'));var qs=require(_0xc411('0x13'));var hardwareService=require(_0xc411('0x14'));var logger=require('../../config/logger')(_0xc411('0x15'));var utils=require(_0xc411('0x16'));var config=require(_0xc411('0x17'));var db=require(_0xc411('0x18'))['db'];function respondWithStatusCode(_0x449222,_0x4d8744){_0x4d8744=_0x4d8744||0xcc;return function(_0x51c06a){if(_0x51c06a){return _0x449222[_0xc411('0x19')](_0x4d8744);}return _0x449222['status'](_0x4d8744)[_0xc411('0x1a')]();};}function respondWithResult(_0x327743,_0x1f6633){_0x1f6633=_0x1f6633||0xc8;return function(_0x3495d0){if(_0x3495d0){return _0x327743[_0xc411('0x1b')](_0x1f6633)[_0xc411('0x1c')](_0x3495d0);}};}function respondWithFilteredResult(_0x2a39c0,_0x4e7368){return function(_0x26ceae){if(_0x26ceae){var _0x35f323=_0x26ceae[_0xc411('0x1d')],_0x21e1e8=_0x4e7368[_0xc411('0x1e')],_0x30cf57=_0x4e7368[_0xc411('0x1e')]+_0x4e7368['limit'],_0x3f5733;if(_0x30cf57>=_0x35f323){_0x30cf57=_0x35f323;_0x3f5733=0xc8;}else{_0x3f5733=0xce;}_0x2a39c0['status'](_0x3f5733);return _0x2a39c0[_0xc411('0x1f')](_0xc411('0x20'),_0x21e1e8+'-'+_0x30cf57+'/'+_0x35f323)[_0xc411('0x1c')](_0x26ceae);}return null;};}function patchUpdates(_0x50d931){return function(_0x5f4f2c){try{jsonpatch['apply'](_0x5f4f2c,_0x50d931,!![]);}catch(_0x96e4f5){return BPromise[_0xc411('0x21')](_0x96e4f5);}return _0x5f4f2c[_0xc411('0x22')]();};}function saveUpdates(_0x51331b,_0x1e5b11){return function(_0x2a285c){if(_0x2a285c){return _0x2a285c[_0xc411('0x23')](_0x51331b)[_0xc411('0x24')](function(_0x19a095){return _0x19a095;});}return null;};}function removeEntity(_0x38bc7d,_0x1703ee){return function(_0x881bae){if(_0x881bae){return _0x881bae[_0xc411('0x25')]()[_0xc411('0x24')](function(){_0x38bc7d[_0xc411('0x1b')](0xcc)[_0xc411('0x1a')]();});}};}function handleEntityNotFound(_0x1fba78,_0x33f44b){return function(_0x33abbb){if(!_0x33abbb){_0x1fba78[_0xc411('0x19')](0x194);}return _0x33abbb;};}function handleError(_0x30f897,_0x5256ba){_0x5256ba=_0x5256ba||0x1f4;return function(_0x330101){logger[_0xc411('0x26')](_0x330101[_0xc411('0x27')]);if(_0x330101[_0xc411('0x28')]){delete _0x330101[_0xc411('0x28')];}_0x30f897[_0xc411('0x1b')](_0x5256ba)[_0xc411('0x29')](_0x330101);};}exports['index']=function(_0x1eb370,_0x1d2555){var _0x12965e={},_0x4ce744={},_0x31c7d5={'count':0x0,'rows':[]};var _0x7ab8bd=db[_0xc411('0x2a')][_0xc411('0x2b')];_0x4ce744[_0xc411('0x2c')]=_[_0xc411('0x2d')](_0x7ab8bd);_0x4ce744[_0xc411('0x2e')]=_[_0xc411('0x2d')](_0x1eb370[_0xc411('0x2e')]);_0x4ce744[_0xc411('0x2f')]=_[_0xc411('0x30')](_0x4ce744[_0xc411('0x2c')],_0x4ce744[_0xc411('0x2e')]);_0x12965e[_0xc411('0x31')]=_[_0xc411('0x30')](_0x4ce744['model'],qs[_0xc411('0x32')](_0x1eb370['query'][_0xc411('0x32')]));_0x12965e[_0xc411('0x31')]=_0x12965e['attributes'][_0xc411('0x33')]?_0x12965e['attributes']:_0x4ce744[_0xc411('0x2c')];if(!_0x1eb370[_0xc411('0x2e')][_0xc411('0x34')](_0xc411('0x35'))){_0x12965e['limit']=qs[_0xc411('0x36')](_0x1eb370[_0xc411('0x2e')][_0xc411('0x36')]);_0x12965e[_0xc411('0x1e')]=qs['offset'](_0x1eb370[_0xc411('0x2e')][_0xc411('0x1e')]);}_0x12965e[_0xc411('0x37')]=qs[_0xc411('0x38')](_0x1eb370[_0xc411('0x2e')][_0xc411('0x38')]);_0x12965e[_0xc411('0x39')]=qs[_0xc411('0x2f')](_[_0xc411('0x3a')](_0x1eb370[_0xc411('0x2e')],_0x4ce744[_0xc411('0x2f')]));if(_0x1eb370[_0xc411('0x2e')][_0xc411('0x3b')]){_0x12965e[_0xc411('0x39')]=_['merge'](_0x12965e['where'],{'$or':_[_0xc411('0x3c')](_0x7ab8bd,function(_0x4349b5){if(_0x4349b5['type']['key']!==_0xc411('0x3d')){var _0x8410e3={};_0x8410e3[_0x4349b5['field']]={'$like':'%'+_0x1eb370[_0xc411('0x2e')][_0xc411('0x3b')]+'%'};return _0x8410e3;}})});}_0x12965e=_[_0xc411('0x3e')]({},_0x12965e,_0x1eb370['options']);var _0xde4642={'where':_0x12965e[_0xc411('0x39')]};return db[_0xc411('0x2a')][_0xc411('0x1d')](_0xde4642)[_0xc411('0x24')](function(_0x557305){_0x31c7d5['count']=_0x557305;if(_0x1eb370[_0xc411('0x2e')]['includeAll']){_0x12965e[_0xc411('0x3f')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0xc411('0x40')](_0x12965e);})[_0xc411('0x24')](function(_0x44870a){_0x31c7d5['rows']=_0x44870a;return _0x31c7d5;})[_0xc411('0x24')](respondWithFilteredResult(_0x1d2555,_0x12965e))[_0xc411('0x41')](handleError(_0x1d2555,null));};exports['show']=function(_0x1804ac,_0x3042be){var _0x26b41f={'raw':!![],'where':{'id':_0x1804ac['params']['id']}},_0xa151aa={};_0xa151aa[_0xc411('0x2c')]=_[_0xc411('0x2d')](db[_0xc411('0x2a')][_0xc411('0x2b')]);_0xa151aa['query']=_[_0xc411('0x2d')](_0x1804ac[_0xc411('0x2e')]);_0xa151aa[_0xc411('0x2f')]=_[_0xc411('0x30')](_0xa151aa[_0xc411('0x2c')],_0xa151aa[_0xc411('0x2e')]);_0x26b41f['attributes']=_[_0xc411('0x30')](_0xa151aa[_0xc411('0x2c')],qs['fields'](_0x1804ac[_0xc411('0x2e')]['fields']));_0x26b41f['attributes']=_0x26b41f[_0xc411('0x31')][_0xc411('0x33')]?_0x26b41f[_0xc411('0x31')]:_0xa151aa[_0xc411('0x2c')];if(_0x1804ac['query'][_0xc411('0x42')]){_0x26b41f['include']=[{'all':!![]}];}_0x26b41f=_[_0xc411('0x3e')]({},_0x26b41f,_0x1804ac[_0xc411('0x43')]);return db[_0xc411('0x2a')][_0xc411('0x44')](_0x26b41f)[_0xc411('0x24')](handleEntityNotFound(_0x3042be,null))['then'](respondWithResult(_0x3042be,null))[_0xc411('0x41')](handleError(_0x3042be,null));};exports[_0xc411('0x45')]=function(_0x4c3ea9,_0x4e78b4){return db[_0xc411('0x2a')][_0xc411('0x45')](_0x4c3ea9['body'],{})[_0xc411('0x24')](respondWithResult(_0x4e78b4,0xc9))[_0xc411('0x41')](handleError(_0x4e78b4,null));};exports[_0xc411('0x23')]=function(_0x234904,_0x1be93d){if(_0x234904[_0xc411('0x46')]['id']){delete _0x234904[_0xc411('0x46')]['id'];}return db[_0xc411('0x2a')][_0xc411('0x44')]({'where':{'id':_0x234904[_0xc411('0x47')]['id']}})[_0xc411('0x24')](handleEntityNotFound(_0x1be93d,null))['then'](saveUpdates(_0x234904[_0xc411('0x46')],null))[_0xc411('0x24')](respondWithResult(_0x1be93d,null))[_0xc411('0x41')](handleError(_0x1be93d,null));};exports[_0xc411('0x25')]=function(_0x11dce4,_0x4bea2b){return db[_0xc411('0x2a')]['find']({'where':{'id':_0x11dce4[_0xc411('0x47')]['id']}})[_0xc411('0x24')](handleEntityNotFound(_0x4bea2b,null))[_0xc411('0x24')](removeEntity(_0x4bea2b,null))['catch'](handleError(_0x4bea2b,null));};exports[_0xc411('0x48')]=function(_0x720bfd,_0x22f757){return db['SquareDetailsReport'][_0xc411('0x48')]()['then'](respondWithResult(_0x22f757,null))[_0xc411('0x41')](handleError(_0x22f757,null));}; \ No newline at end of file +var _0x59cc=['path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','sendStatus','error','name','send','index','SquareDetailsReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','map','type','key','field','filter','options','where','then','includeAll','include','findAll','catch','show','find','create','body','destroy','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x5c9b55,_0x5befc4){var _0x113969=function(_0x5a404d){while(--_0x5a404d){_0x5c9b55['push'](_0x5c9b55['shift']());}};_0x113969(++_0x5befc4);}(_0x59cc,0x1a9));var _0xc59c=function(_0x2bba00,_0x50d3ea){_0x2bba00=_0x2bba00-0x0;var _0x4032e3=_0x59cc[_0x2bba00];return _0x4032e3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc59c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc59c('0x1'));var jsonpatch=require(_0xc59c('0x2'));var rp=require(_0xc59c('0x3'));var moment=require(_0xc59c('0x4'));var BPromise=require(_0xc59c('0x5'));var Mustache=require(_0xc59c('0x6'));var util=require('util');var path=require(_0xc59c('0x7'));var sox=require('sox');var csv=require(_0xc59c('0x8'));var ejs=require(_0xc59c('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc59c('0xa'));var crypto=require(_0xc59c('0xb'));var jsforce=require(_0xc59c('0xc'));var deskjs=require(_0xc59c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc59c('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc59c('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc59c('0x10'))(_0xc59c('0x11'));var utils=require(_0xc59c('0x12'));var config=require(_0xc59c('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42ebaa,_0x1d8d10){_0x1d8d10=_0x1d8d10||0xcc;return function(_0xc0c874){if(_0xc0c874){return _0x42ebaa['sendStatus'](_0x1d8d10);}return _0x42ebaa['status'](_0x1d8d10)[_0xc59c('0x14')]();};}function respondWithResult(_0x132f84,_0x435390){_0x435390=_0x435390||0xc8;return function(_0x1900a0){if(_0x1900a0){return _0x132f84[_0xc59c('0x15')](_0x435390)[_0xc59c('0x16')](_0x1900a0);}};}function respondWithFilteredResult(_0x3af42b,_0x3f1469){return function(_0x35a90a){if(_0x35a90a){var _0x51451e=_0x35a90a[_0xc59c('0x17')],_0x3c9f60=_0x3f1469[_0xc59c('0x18')],_0x57a3f6=_0x3f1469[_0xc59c('0x18')]+_0x3f1469[_0xc59c('0x19')],_0x3d8d47;if(_0x57a3f6>=_0x51451e){_0x57a3f6=_0x51451e;_0x3d8d47=0xc8;}else{_0x3d8d47=0xce;}_0x3af42b['status'](_0x3d8d47);return _0x3af42b[_0xc59c('0x1a')](_0xc59c('0x1b'),_0x3c9f60+'-'+_0x57a3f6+'/'+_0x51451e)[_0xc59c('0x16')](_0x35a90a);}return null;};}function patchUpdates(_0x2e718d){return function(_0x7288bf){try{jsonpatch[_0xc59c('0x1c')](_0x7288bf,_0x2e718d,!![]);}catch(_0x5add64){return BPromise[_0xc59c('0x1d')](_0x5add64);}return _0x7288bf[_0xc59c('0x1e')]();};}function saveUpdates(_0x1527b7,_0x5c17b0){return function(_0x728475){if(_0x728475){return _0x728475[_0xc59c('0x1f')](_0x1527b7)['then'](function(_0x5423f2){return _0x5423f2;});}return null;};}function removeEntity(_0x3f543c,_0x4f90a9){return function(_0x36eb9b){if(_0x36eb9b){return _0x36eb9b['destroy']()['then'](function(){_0x3f543c[_0xc59c('0x15')](0xcc)[_0xc59c('0x14')]();});}};}function handleEntityNotFound(_0x10f6a9,_0x4d9219){return function(_0x177914){if(!_0x177914){_0x10f6a9[_0xc59c('0x20')](0x194);}return _0x177914;};}function handleError(_0x3df2a7,_0x529d4c){_0x529d4c=_0x529d4c||0x1f4;return function(_0x15e0b8){logger[_0xc59c('0x21')](_0x15e0b8['stack']);if(_0x15e0b8[_0xc59c('0x22')]){delete _0x15e0b8[_0xc59c('0x22')];}_0x3df2a7[_0xc59c('0x15')](_0x529d4c)[_0xc59c('0x23')](_0x15e0b8);};}exports[_0xc59c('0x24')]=function(_0x420431,_0x5baeb8){var _0x44a68b={},_0x45f57f={},_0x2e55ce={'count':0x0,'rows':[]};var _0x20c2b4=db[_0xc59c('0x25')][_0xc59c('0x26')];_0x45f57f[_0xc59c('0x27')]=_['keys'](_0x20c2b4);_0x45f57f['query']=_[_0xc59c('0x28')](_0x420431[_0xc59c('0x29')]);_0x45f57f[_0xc59c('0x2a')]=_[_0xc59c('0x2b')](_0x45f57f[_0xc59c('0x27')],_0x45f57f[_0xc59c('0x29')]);_0x44a68b[_0xc59c('0x2c')]=_['intersection'](_0x45f57f[_0xc59c('0x27')],qs['fields'](_0x420431[_0xc59c('0x29')][_0xc59c('0x2d')]));_0x44a68b[_0xc59c('0x2c')]=_0x44a68b[_0xc59c('0x2c')][_0xc59c('0x2e')]?_0x44a68b[_0xc59c('0x2c')]:_0x45f57f[_0xc59c('0x27')];if(!_0x420431[_0xc59c('0x29')][_0xc59c('0x2f')](_0xc59c('0x30'))){_0x44a68b[_0xc59c('0x19')]=qs[_0xc59c('0x19')](_0x420431[_0xc59c('0x29')][_0xc59c('0x19')]);_0x44a68b[_0xc59c('0x18')]=qs[_0xc59c('0x18')](_0x420431[_0xc59c('0x29')][_0xc59c('0x18')]);}_0x44a68b[_0xc59c('0x31')]=qs[_0xc59c('0x32')](_0x420431['query']['sort']);_0x44a68b['where']=qs[_0xc59c('0x2a')](_[_0xc59c('0x33')](_0x420431[_0xc59c('0x29')],_0x45f57f[_0xc59c('0x2a')]));if(_0x420431[_0xc59c('0x29')]['filter']){_0x44a68b['where']=_[_0xc59c('0x34')](_0x44a68b['where'],{'$or':_[_0xc59c('0x35')](_0x20c2b4,function(_0x45b3c4){if(_0x45b3c4[_0xc59c('0x36')][_0xc59c('0x37')]!=='VIRTUAL'){var _0x3054c0={};_0x3054c0[_0x45b3c4[_0xc59c('0x38')]]={'$like':'%'+_0x420431[_0xc59c('0x29')][_0xc59c('0x39')]+'%'};return _0x3054c0;}})});}_0x44a68b=_['merge']({},_0x44a68b,_0x420431[_0xc59c('0x3a')]);var _0x4e530c={'where':_0x44a68b[_0xc59c('0x3b')]};return db[_0xc59c('0x25')][_0xc59c('0x17')](_0x4e530c)[_0xc59c('0x3c')](function(_0x2cac87){_0x2e55ce[_0xc59c('0x17')]=_0x2cac87;if(_0x420431[_0xc59c('0x29')][_0xc59c('0x3d')]){_0x44a68b[_0xc59c('0x3e')]=[{'all':!![]}];}return db[_0xc59c('0x25')][_0xc59c('0x3f')](_0x44a68b);})[_0xc59c('0x3c')](function(_0x5595e7){_0x2e55ce['rows']=_0x5595e7;return _0x2e55ce;})['then'](respondWithFilteredResult(_0x5baeb8,_0x44a68b))[_0xc59c('0x40')](handleError(_0x5baeb8,null));};exports[_0xc59c('0x41')]=function(_0x56b32b,_0x40d094){var _0x477f48={'raw':!![],'where':{'id':_0x56b32b['params']['id']}},_0xa2938f={};_0xa2938f['model']=_[_0xc59c('0x28')](db['SquareDetailsReport']['rawAttributes']);_0xa2938f[_0xc59c('0x29')]=_[_0xc59c('0x28')](_0x56b32b['query']);_0xa2938f['filters']=_[_0xc59c('0x2b')](_0xa2938f[_0xc59c('0x27')],_0xa2938f[_0xc59c('0x29')]);_0x477f48['attributes']=_[_0xc59c('0x2b')](_0xa2938f[_0xc59c('0x27')],qs[_0xc59c('0x2d')](_0x56b32b[_0xc59c('0x29')]['fields']));_0x477f48[_0xc59c('0x2c')]=_0x477f48[_0xc59c('0x2c')]['length']?_0x477f48['attributes']:_0xa2938f[_0xc59c('0x27')];if(_0x56b32b[_0xc59c('0x29')][_0xc59c('0x3d')]){_0x477f48[_0xc59c('0x3e')]=[{'all':!![]}];}_0x477f48=_[_0xc59c('0x34')]({},_0x477f48,_0x56b32b[_0xc59c('0x3a')]);return db[_0xc59c('0x25')][_0xc59c('0x42')](_0x477f48)[_0xc59c('0x3c')](handleEntityNotFound(_0x40d094,null))[_0xc59c('0x3c')](respondWithResult(_0x40d094,null))[_0xc59c('0x40')](handleError(_0x40d094,null));};exports[_0xc59c('0x43')]=function(_0x990c97,_0x31f264){return db['SquareDetailsReport'][_0xc59c('0x43')](_0x990c97[_0xc59c('0x44')],{})[_0xc59c('0x3c')](respondWithResult(_0x31f264,0xc9))[_0xc59c('0x40')](handleError(_0x31f264,null));};exports[_0xc59c('0x1f')]=function(_0x521463,_0x18ffa1){if(_0x521463[_0xc59c('0x44')]['id']){delete _0x521463[_0xc59c('0x44')]['id'];}return db['SquareDetailsReport'][_0xc59c('0x42')]({'where':{'id':_0x521463['params']['id']}})[_0xc59c('0x3c')](handleEntityNotFound(_0x18ffa1,null))[_0xc59c('0x3c')](saveUpdates(_0x521463[_0xc59c('0x44')],null))[_0xc59c('0x3c')](respondWithResult(_0x18ffa1,null))[_0xc59c('0x40')](handleError(_0x18ffa1,null));};exports[_0xc59c('0x45')]=function(_0x1d4cac,_0x2a3225){return db[_0xc59c('0x25')][_0xc59c('0x42')]({'where':{'id':_0x1d4cac[_0xc59c('0x46')]['id']}})[_0xc59c('0x3c')](handleEntityNotFound(_0x2a3225,null))[_0xc59c('0x3c')](removeEntity(_0x2a3225,null))[_0xc59c('0x40')](handleError(_0x2a3225,null));};exports[_0xc59c('0x47')]=function(_0x2da29f,_0x4776a3){return db[_0xc59c('0x25')]['describe']()[_0xc59c('0x3c')](respondWithResult(_0x4776a3,null))['catch'](handleError(_0x4776a3,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index ef40957..2967253 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 _0xb7ae=['exports','define','report_square_details','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./squareReportDetail.attributes'];(function(_0x1d08fd,_0x1d682d){var _0x1c3467=function(_0x4d0179){while(--_0x4d0179){_0x1d08fd['push'](_0x1d08fd['shift']());}};_0x1c3467(++_0x1d682d);}(_0xb7ae,0xf3));var _0xeb7a=function(_0x219fee,_0x9a3629){_0x219fee=_0x219fee-0x0;var _0x2a6145=_0xb7ae[_0x219fee];return _0x2a6145;};'use strict';var _=require(_0xeb7a('0x0'));var util=require(_0xeb7a('0x1'));var logger=require(_0xeb7a('0x2'))(_0xeb7a('0x3'));var moment=require(_0xeb7a('0x4'));var BPromise=require('bluebird');var rp=require(_0xeb7a('0x5'));var fs=require('fs');var path=require(_0xeb7a('0x6'));var rimraf=require(_0xeb7a('0x7'));var config=require('../../config/environment');var attributes=require(_0xeb7a('0x8'));module[_0xeb7a('0x9')]=function(_0x33c928,_0x2564ab){return _0x33c928[_0xeb7a('0xa')]('SquareDetailsReport',attributes,{'tableName':_0xeb7a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea1c=['define','SquareDetailsReport','report_square_details','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports'];(function(_0x4f8a93,_0x403f1b){var _0x5e3855=function(_0x444b24){while(--_0x444b24){_0x4f8a93['push'](_0x4f8a93['shift']());}};_0x5e3855(++_0x403f1b);}(_0xea1c,0x117));var _0xcea1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea1c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcea1('0x0'))(_0xcea1('0x1'));var moment=require(_0xcea1('0x2'));var BPromise=require(_0xcea1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcea1('0x4'));var rimraf=require(_0xcea1('0x5'));var config=require(_0xcea1('0x6'));var attributes=require(_0xcea1('0x7'));module[_0xcea1('0x8')]=function(_0x1ff8bf,_0x29732f){return _0x1ff8bf[_0xcea1('0x9')](_0xcea1('0xa'),attributes,{'tableName':_0xcea1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index cb1db20..0515352 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 _0x8ca9=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateSquareDetailsReport','SquareDetailsReport','create','body','options'];(function(_0x43d028,_0x139ab1){var _0x492b19=function(_0x5c960f){while(--_0x5c960f){_0x43d028['push'](_0x43d028['shift']());}};_0x492b19(++_0x139ab1);}(_0x8ca9,0x9c));var _0x98ca=function(_0x4e8043,_0x4daaf7){_0x4e8043=_0x4e8043-0x0;var _0x13921c=_0x8ca9[_0x4e8043];return _0x13921c;};'use strict';var _=require(_0x98ca('0x0'));var util=require(_0x98ca('0x1'));var moment=require(_0x98ca('0x2'));var BPromise=require(_0x98ca('0x3'));var rs=require(_0x98ca('0x4'));var fs=require('fs');var Redis=require(_0x98ca('0x5'));var db=require(_0x98ca('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x98ca('0x7'));var config=require('../../config/environment');var jayson=require(_0x98ca('0x8'));var client=jayson['client'][_0x98ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xca4097,_0x18c349,_0x2852a0){return new BPromise(function(_0x323c95,_0x28a37a){return client[_0x98ca('0xa')](_0xca4097,_0x2852a0)[_0x98ca('0xb')](function(_0x277c29){logger[_0x98ca('0xc')](_0x98ca('0xd'),_0x18c349,_0x98ca('0xe'));logger[_0x98ca('0xf')](_0x98ca('0x10'),_0x18c349,_0x98ca('0xe'),JSON[_0x98ca('0x11')](_0x277c29));if(_0x277c29[_0x98ca('0x12')]){if(_0x277c29[_0x98ca('0x12')]['code']===0x1f4){logger[_0x98ca('0x12')](_0x98ca('0xd'),_0x18c349,_0x277c29[_0x98ca('0x12')][_0x98ca('0x13')]);return _0x28a37a(_0x277c29['error'][_0x98ca('0x13')]);}logger[_0x98ca('0x12')](_0x98ca('0xd'),_0x18c349,_0x277c29[_0x98ca('0x12')][_0x98ca('0x13')]);return _0x323c95(_0x277c29[_0x98ca('0x12')][_0x98ca('0x13')]);}else{logger['info'](_0x98ca('0xd'),_0x18c349,_0x98ca('0xe'));_0x323c95(_0x277c29[_0x98ca('0x14')][_0x98ca('0x13')]);}})['catch'](function(_0x238c1a){logger[_0x98ca('0x12')](_0x98ca('0xd'),_0x18c349,_0x238c1a);_0x28a37a(_0x238c1a);});});}exports[_0x98ca('0x15')]=function(_0x4523bb){var _0x3ca209=this;return new Promise(function(_0x28c8a6,_0x3dc670){return db[_0x98ca('0x16')][_0x98ca('0x17')](_0x4523bb[_0x98ca('0x18')],{'raw':_0x4523bb['options']?_0x4523bb[_0x98ca('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x98ca('0xb')](function(_0x2fe568){logger['info']('CreateSquareDetailsReport',_0x4523bb);logger[_0x98ca('0xf')](_0x98ca('0x15'),_0x4523bb,JSON[_0x98ca('0x11')](_0x2fe568));_0x28c8a6(_0x2fe568);})['catch'](function(_0x2f7742){logger[_0x98ca('0x12')]('CreateSquareDetailsReport',_0x2f7742[_0x98ca('0x13')],_0x4523bb);_0x3dc670(_0x3ca209['error'](0x1f4,_0x2f7742[_0x98ca('0x13')]));});});}; \ No newline at end of file +var _0x5c91=['catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','then','debug','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result'];(function(_0x5cf2a9,_0x593332){var _0x3d72cf=function(_0x16bbf2){while(--_0x16bbf2){_0x5cf2a9['push'](_0x5cf2a9['shift']());}};_0x3d72cf(++_0x593332);}(_0x5c91,0x1e9));var _0x15c9=function(_0x29a87a,_0x4cd165){_0x29a87a=_0x29a87a-0x0;var _0x2ea66d=_0x5c91[_0x29a87a];return _0x2ea66d;};'use strict';var _=require(_0x15c9('0x0'));var util=require(_0x15c9('0x1'));var moment=require(_0x15c9('0x2'));var BPromise=require('bluebird');var rs=require(_0x15c9('0x3'));var fs=require('fs');var Redis=require(_0x15c9('0x4'));var db=require(_0x15c9('0x5'))['db'];var utils=require(_0x15c9('0x6'));var logger=require(_0x15c9('0x7'))(_0x15c9('0x8'));var config=require('../../config/environment');var jayson=require(_0x15c9('0x9'));var client=jayson[_0x15c9('0xa')][_0x15c9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42bcb6,_0x2c213e,_0x51a779){return new BPromise(function(_0x191695,_0x114775){return client[_0x15c9('0xc')](_0x42bcb6,_0x51a779)['then'](function(_0x23adaf){logger[_0x15c9('0xd')](_0x15c9('0xe'),_0x2c213e,'request\x20sent');logger['debug'](_0x15c9('0xf'),_0x2c213e,_0x15c9('0x10'),JSON['stringify'](_0x23adaf));if(_0x23adaf['error']){if(_0x23adaf['error'][_0x15c9('0x11')]===0x1f4){logger[_0x15c9('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x2c213e,_0x23adaf[_0x15c9('0x12')][_0x15c9('0x13')]);return _0x114775(_0x23adaf[_0x15c9('0x12')]['message']);}logger['error'](_0x15c9('0xe'),_0x2c213e,_0x23adaf[_0x15c9('0x12')]['message']);return _0x191695(_0x23adaf[_0x15c9('0x12')]['message']);}else{logger[_0x15c9('0xd')](_0x15c9('0xe'),_0x2c213e,_0x15c9('0x10'));_0x191695(_0x23adaf[_0x15c9('0x14')][_0x15c9('0x13')]);}})[_0x15c9('0x15')](function(_0x5eb50e){logger[_0x15c9('0x12')](_0x15c9('0xe'),_0x2c213e,_0x5eb50e);_0x114775(_0x5eb50e);});});}exports[_0x15c9('0x16')]=function(_0x449f20){var _0x2390a4=this;return new Promise(function(_0x2d36e5,_0x1c4b1a){return db[_0x15c9('0x17')]['create'](_0x449f20[_0x15c9('0x18')],{'raw':_0x449f20[_0x15c9('0x19')]?_0x449f20[_0x15c9('0x19')][_0x15c9('0x1a')]===undefined?!![]:![]:!![]})[_0x15c9('0x1b')](function(_0x4539c0){logger[_0x15c9('0xd')]('CreateSquareDetailsReport',_0x449f20);logger[_0x15c9('0x1c')](_0x15c9('0x16'),_0x449f20,JSON[_0x15c9('0x1d')](_0x4539c0));_0x2d36e5(_0x4539c0);})[_0x15c9('0x15')](function(_0xd0bf39){logger[_0x15c9('0x12')](_0x15c9('0x16'),_0xd0bf39[_0x15c9('0x13')],_0x449f20);_0x1c4b1a(_0x2390a4[_0x15c9('0x12')](0x1f4,_0xd0bf39[_0x15c9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index baa83f4..47c3ba9 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 _0xcded=['./system.controller','isAuthenticated','get','exports','express','Router','../../components/auth/service'];(function(_0x18b4ff,_0xa53b2f){var _0x5ccb0a=function(_0x5be8b0){while(--_0x5be8b0){_0x18b4ff['push'](_0x18b4ff['shift']());}};_0x5ccb0a(++_0xa53b2f);}(_0xcded,0x66));var _0xdcde=function(_0x49d19d,_0x245cf5){_0x49d19d=_0x49d19d-0x0;var _0x4ebef1=_0xcded[_0x49d19d];return _0x4ebef1;};'use strict';var express=require(_0xdcde('0x0'));var router=express[_0xdcde('0x1')]();var auth=require(_0xdcde('0x2'));var controller=require(_0xdcde('0x3'));router['get']('/',auth[_0xdcde('0x4')](),controller['index']);router[_0xdcde('0x5')]('/process/:pid/kill',auth[_0xdcde('0x4')](),controller['killProcess']);module[_0xdcde('0x6')]=router; \ No newline at end of file +var _0x57d1=['Router','../../components/auth/service','get','isAuthenticated','/process/:pid/kill','killProcess','exports','express'];(function(_0x79b649,_0x2115b3){var _0x1af9b1=function(_0x153c9f){while(--_0x153c9f){_0x79b649['push'](_0x79b649['shift']());}};_0x1af9b1(++_0x2115b3);}(_0x57d1,0x13f));var _0x157d=function(_0x15411f,_0x42bef8){_0x15411f=_0x15411f-0x0;var _0x555650=_0x57d1[_0x15411f];return _0x555650;};'use strict';var express=require(_0x157d('0x0'));var router=express[_0x157d('0x1')]();var auth=require(_0x157d('0x2'));var controller=require('./system.controller');router[_0x157d('0x3')]('/',auth[_0x157d('0x4')](),controller['index']);router[_0x157d('0x3')](_0x157d('0x5'),auth[_0x157d('0x4')](),controller[_0x157d('0x6')]);module[_0x157d('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index da4c2e6..9bb084d 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 _0xdddd=['then','catch','status','json','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','../../config/logger','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','index'];(function(_0xf61129,_0x523668){var _0xefa38a=function(_0x3c965f){while(--_0x3c965f){_0xf61129['push'](_0xf61129['shift']());}};_0xefa38a(++_0x523668);}(_0xdddd,0xe8));var _0xdddd=function(_0x2f87cd,_0xcaf299){_0x2f87cd=_0x2f87cd-0x0;var _0x5d7eda=_0xdddd[_0x2f87cd];return _0x5d7eda;};'use strict';var info=require(_0xdddd('0x0'));var exec=require(_0xdddd('0x1'))['exec'];var logger=require(_0xdddd('0x2'))('api');var util=require(_0xdddd('0x3'));var BPromise=require(_0xdddd('0x4'));var _=require(_0xdddd('0x5'));function handleError(_0x4954b2,_0x3b9f2c,_0x4db1bf){_0x3b9f2c=_0x3b9f2c||0x1f4;return function(_0x2ea5d6){logger[_0xdddd('0x6')](_0xdddd('0x7'),_0x4db1bf,_0x3b9f2c,util[_0xdddd('0x8')](_0x2ea5d6,{'showHidden':![],'depth':null}));delete _0x2ea5d6[_0xdddd('0x9')];_0x4954b2['status'](_0x3b9f2c)['send'](_0x2ea5d6);};}exports[_0xdddd('0xa')]=function(_0x384b7a,_0xe6bb83){return info['getAllData']()[_0xdddd('0xb')](function(_0x21ae11){return _0xe6bb83['status'](0xc8)['json'](_0x21ae11);})[_0xdddd('0xc')](function(_0x3e94c3){return _0xe6bb83[_0xdddd('0xd')](0x1f4)[_0xdddd('0xe')](_0x3e94c3);});};exports['killProcess']=function(_0x417cbc,_0x112a79){var _0x53c389=[_0xdddd('0xf')];return new BPromise(function(_0x5809f3,_0x4fe5a4){return exec(util[_0xdddd('0x10')](_0xdddd('0x11'),_0x417cbc[_0xdddd('0x12')][_0xdddd('0x13')]),function(_0x4b44af,_0x412e18,_0x24915e){if(_0x4b44af){return _0x4fe5a4(_0x4b44af);}return _0x5809f3(_0x412e18);});})[_0xdddd('0xb')](function(_0x4602e2){var _0x26558d=![];var _0x5e2071=_0x4602e2[_0xdddd('0x14')](/\n/);for(var _0x321499=0x0,_0x403f2b=_0x53c389[_0xdddd('0x15')];_0x321499<_0x403f2b,_0x26558d===![];_0x321499+=0x1){if(_0x4602e2[_0xdddd('0x16')](_0x53c389[_0x321499])>=0x0){_0x26558d=!![];}}if(!_0x26558d){throw new Error(util[_0xdddd('0x10')](_0xdddd('0x17'),_0x417cbc[_0xdddd('0x12')]['pid']));}process[_0xdddd('0x18')](_0x417cbc[_0xdddd('0x12')]['pid'],'SIGINT');return _0x112a79['status'](0xc8)['json']({'message':util[_0xdddd('0x10')](_0xdddd('0x19'),_0x417cbc[_0xdddd('0x12')][_0xdddd('0x13')])});})[_0xdddd('0xc')](handleError(_0x112a79,null,_0xdddd('0x1a')));}; \ No newline at end of file +var _0xad0c=['format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','then','indexOf','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','../../config/logger','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','json','catch','killProcess','components/import/cm'];(function(_0x3e06cd,_0x1115d7){var _0x19826e=function(_0x2b2c89){while(--_0x2b2c89){_0x3e06cd['push'](_0x3e06cd['shift']());}};_0x19826e(++_0x1115d7);}(_0xad0c,0x85));var _0xcad0=function(_0xafc449,_0x5e8c2b){_0xafc449=_0xafc449-0x0;var _0x2226d1=_0xad0c[_0xafc449];return _0x2226d1;};'use strict';var info=require(_0xcad0('0x0'));var exec=require('child_process')[_0xcad0('0x1')];var logger=require(_0xcad0('0x2'))('api');var util=require(_0xcad0('0x3'));var BPromise=require('bluebird');var _=require(_0xcad0('0x4'));function handleError(_0x530408,_0x4de44b,_0x55648e){_0x4de44b=_0x4de44b||0x1f4;return function(_0x2f1624){logger[_0xcad0('0x5')](_0xcad0('0x6'),_0x55648e,_0x4de44b,util[_0xcad0('0x7')](_0x2f1624,{'showHidden':![],'depth':null}));delete _0x2f1624[_0xcad0('0x8')];_0x530408[_0xcad0('0x9')](_0x4de44b)[_0xcad0('0xa')](_0x2f1624);};}exports[_0xcad0('0xb')]=function(_0x5be8b1,_0x15b8f5){return info[_0xcad0('0xc')]()['then'](function(_0x4b8276){return _0x15b8f5['status'](0xc8)[_0xcad0('0xd')](_0x4b8276);})[_0xcad0('0xe')](function(_0x511237){return _0x15b8f5['status'](0x1f4)[_0xcad0('0xd')](_0x511237);});};exports[_0xcad0('0xf')]=function(_0x2b8c7d,_0x54b711){var _0x4c4170=[_0xcad0('0x10')];return new BPromise(function(_0x1550d6,_0x2e5cd2){return exec(util[_0xcad0('0x11')](_0xcad0('0x12'),_0x2b8c7d[_0xcad0('0x13')]['pid']),function(_0x4539b8,_0x1f158c,_0x3b5cff){if(_0x4539b8){return _0x2e5cd2(_0x4539b8);}return _0x1550d6(_0x1f158c);});})[_0xcad0('0x14')](function(_0x55f097){var _0x369f49=![];var _0x17fa40=_0x55f097['split'](/\n/);for(var _0x532da0=0x0,_0x2e2fa2=_0x4c4170['length'];_0x532da0<_0x2e2fa2,_0x369f49===![];_0x532da0+=0x1){if(_0x55f097[_0xcad0('0x15')](_0x4c4170[_0x532da0])>=0x0){_0x369f49=!![];}}if(!_0x369f49){throw new Error(util[_0xcad0('0x11')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x2b8c7d[_0xcad0('0x13')][_0xcad0('0x16')]));}process['kill'](_0x2b8c7d['params']['pid'],_0xcad0('0x17'));return _0x54b711[_0xcad0('0x9')](0xc8)[_0xcad0('0xd')]({'message':util[_0xcad0('0x11')](_0xcad0('0x18'),_0x2b8c7d[_0xcad0('0x13')][_0xcad0('0x16')])});})[_0xcad0('0xe')](handleError(_0x54b711,null,_0xcad0('0xf')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 9bcbb7f..8fe0fcd 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 _0x1a85=['express','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','get','show','/:id','update','delete','destroy','exports','path','connect-timeout'];(function(_0x2e9922,_0x2ea1f8){var _0xde21f0=function(_0x29efc3){while(--_0x29efc3){_0x2e9922['push'](_0x2e9922['shift']());}};_0xde21f0(++_0x2ea1f8);}(_0x1a85,0x178));var _0x51a8=function(_0x1ea3b9,_0x3c6b2c){_0x1ea3b9=_0x1ea3b9-0x0;var _0x206d41=_0x1a85[_0x1ea3b9];return _0x206d41;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x51a8('0x0'));var timeout=require(_0x51a8('0x1'));var express=require(_0x51a8('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x51a8('0x3'));var config=require(_0x51a8('0x4'));var controller=require(_0x51a8('0x5'));router['get']('/',auth[_0x51a8('0x6')](),controller['index']);router[_0x51a8('0x7')]('/:id',auth[_0x51a8('0x6')](),controller[_0x51a8('0x8')]);router['post']('/',auth[_0x51a8('0x6')](),controller['create']);router['put'](_0x51a8('0x9'),auth[_0x51a8('0x6')](),controller[_0x51a8('0xa')]);router[_0x51a8('0xb')](_0x51a8('0x9'),auth[_0x51a8('0x6')](),controller[_0x51a8('0xc')]);module[_0x51a8('0xd')]=router; \ No newline at end of file +var _0x0b0e=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','post','create','put','update','exports'];(function(_0x9ec8dd,_0x222146){var _0x54a46d=function(_0x47d258){while(--_0x47d258){_0x9ec8dd['push'](_0x9ec8dd['shift']());}};_0x54a46d(++_0x222146);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1979d8,_0x10d8f2){_0x1979d8=_0x1979d8-0x0;var _0x1d5bb3=_0x0b0e[_0x1979d8];return _0x1d5bb3;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var auth=require(_0xe0b0('0x4'));var interaction=require(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var controller=require(_0xe0b0('0x7'));router[_0xe0b0('0x8')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xa')]);router[_0xe0b0('0x8')](_0xe0b0('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe0b0('0xc')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xd')]);router[_0xe0b0('0xe')]('/:id',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xf')]);router['delete'](_0xe0b0('0xb'),auth[_0xe0b0('0x9')](),controller['destroy']);module[_0xe0b0('0x10')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 07c2d9a..d3845e0 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 _0x6af7=['name','exports','STRING'];(function(_0x3a3a6a,_0x5eb6a9){var _0xa89294=function(_0x55d78c){while(--_0x55d78c){_0x3a3a6a['push'](_0x3a3a6a['shift']());}};_0xa89294(++_0x5eb6a9);}(_0x6af7,0xc7));var _0x76af=function(_0x451f49,_0x16e620){_0x451f49=_0x451f49-0x0;var _0x241e94=_0x6af7[_0x451f49];return _0x241e94;};'use strict';var Sequelize=require('sequelize');module[_0x76af('0x0')]={'name':{'type':Sequelize[_0x76af('0x1')],'unique':_0x76af('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x76af('0x1')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x76af('0x1')]}}; \ No newline at end of file +var _0x625b=['STRING','name','#0091EA','sequelize','exports'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x625b,0x193));var _0xb625=function(_0x1da3bf,_0x3c48b6){_0x1da3bf=_0x1da3bf-0x0;var _0x14d289=_0x625b[_0x1da3bf];return _0x14d289;};'use strict';var Sequelize=require(_0xb625('0x0'));module[_0xb625('0x1')]={'name':{'type':Sequelize[_0xb625('0x2')],'unique':_0xb625('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0xb625('0x4')},'description':{'type':Sequelize[_0xb625('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 4b4c1c7..6ce40fb 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 _0x4991=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','Tags','UserProfileResource','error','stack','name','Tag','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','key','VIRTUAL','field','options','count','include','findAll','rows','catch','show','params','includeAll','merge','find','create'];(function(_0x1daafa,_0x5562d5){var _0x421f30=function(_0x348eea){while(--_0x348eea){_0x1daafa['push'](_0x1daafa['shift']());}};_0x421f30(++_0x5562d5);}(_0x4991,0xf7));var _0x1499=function(_0x45b676,_0x202b85){_0x45b676=_0x45b676-0x0;var _0x458776=_0x4991[_0x45b676];return _0x458776;};'use strict';var pdf=require(_0x1499('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1499('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1499('0x2'));var rp=require(_0x1499('0x3'));var moment=require(_0x1499('0x4'));var BPromise=require(_0x1499('0x5'));var Mustache=require(_0x1499('0x6'));var util=require(_0x1499('0x7'));var path=require(_0x1499('0x8'));var sox=require(_0x1499('0x9'));var csv=require('to-csv');var ejs=require(_0x1499('0xa'));var fs=require('fs');var _=require(_0x1499('0xb'));var squel=require(_0x1499('0xc'));var crypto=require(_0x1499('0xd'));var jsforce=require(_0x1499('0xe'));var deskjs=require(_0x1499('0xf'));var toCsv=require(_0x1499('0x10'));var querystring=require(_0x1499('0x11'));var Papa=require('papaparse');var Redis=require(_0x1499('0x12'));var authService=require(_0x1499('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x1499('0x14'));var logger=require(_0x1499('0x15'))('api');var utils=require(_0x1499('0x16'));var config=require(_0x1499('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ab173,_0x4dd594){_0x4dd594=_0x4dd594||0xcc;return function(_0x3039ce){if(_0x3039ce){return _0x4ab173[_0x1499('0x18')](_0x4dd594);}return _0x4ab173[_0x1499('0x19')](_0x4dd594)[_0x1499('0x1a')]();};}function respondWithResult(_0x2b95a5,_0x57a0a2){_0x57a0a2=_0x57a0a2||0xc8;return function(_0x5f34f2){if(_0x5f34f2){return _0x2b95a5[_0x1499('0x19')](_0x57a0a2)['json'](_0x5f34f2);}};}function respondWithFilteredResult(_0x37d99e,_0x12cde0){return function(_0x308318){if(_0x308318){var _0x3ab605=_0x308318['count'],_0x48f654=_0x12cde0[_0x1499('0x1b')],_0x1ed43b=_0x12cde0[_0x1499('0x1b')]+_0x12cde0[_0x1499('0x1c')],_0x373f57;if(_0x1ed43b>=_0x3ab605){_0x1ed43b=_0x3ab605;_0x373f57=0xc8;}else{_0x373f57=0xce;}_0x37d99e[_0x1499('0x19')](_0x373f57);return _0x37d99e[_0x1499('0x1d')](_0x1499('0x1e'),_0x48f654+'-'+_0x1ed43b+'/'+_0x3ab605)['json'](_0x308318);}return null;};}function patchUpdates(_0x541477){return function(_0x5bcb5f){try{jsonpatch[_0x1499('0x1f')](_0x5bcb5f,_0x541477,!![]);}catch(_0xad534b){return BPromise['reject'](_0xad534b);}return _0x5bcb5f[_0x1499('0x20')]();};}function saveUpdates(_0x3c13a1,_0x28dff3){return function(_0x18e4a6){if(_0x18e4a6){return _0x18e4a6[_0x1499('0x21')](_0x3c13a1)[_0x1499('0x22')](function(_0x2b0458){return _0x2b0458;});}return null;};}function removeEntity(_0x253439,_0xf8003e){return function(_0x15bcd4){if(_0x15bcd4){return _0x15bcd4[_0x1499('0x23')]()[_0x1499('0x22')](function(){var _0x223f4c=_0x15bcd4[_0x1499('0x24')]({'plain':!![]});var _0x4ec57a=_0x1499('0x25');return db[_0x1499('0x26')]['destroy']({'where':{'type':_0x4ec57a,'resourceId':_0x223f4c['id']}})[_0x1499('0x22')](function(){return _0x15bcd4;});})[_0x1499('0x22')](function(){_0x253439[_0x1499('0x19')](0xcc)[_0x1499('0x1a')]();});}};}function handleEntityNotFound(_0x3968e0,_0x16d036){return function(_0x54f3c2){if(!_0x54f3c2){_0x3968e0['sendStatus'](0x194);}return _0x54f3c2;};}function handleError(_0x12739b,_0x3c9aca){_0x3c9aca=_0x3c9aca||0x1f4;return function(_0x3b9259){logger[_0x1499('0x27')](_0x3b9259[_0x1499('0x28')]);if(_0x3b9259['name']){delete _0x3b9259[_0x1499('0x29')];}_0x12739b['status'](_0x3c9aca)['send'](_0x3b9259);};}exports['index']=function(_0x21d204,_0x103efa){var _0x40932a={},_0x1b460b={},_0x3dad86={'count':0x0,'rows':[]};var _0x388513=db[_0x1499('0x2a')]['rawAttributes'];_0x1b460b[_0x1499('0x2b')]=_[_0x1499('0x2c')](_0x388513);_0x1b460b[_0x1499('0x2d')]=_['keys'](_0x21d204[_0x1499('0x2d')]);_0x1b460b[_0x1499('0x2e')]=_['intersection'](_0x1b460b[_0x1499('0x2b')],_0x1b460b[_0x1499('0x2d')]);_0x40932a['attributes']=_[_0x1499('0x2f')](_0x1b460b[_0x1499('0x2b')],qs[_0x1499('0x30')](_0x21d204[_0x1499('0x2d')][_0x1499('0x30')]));_0x40932a[_0x1499('0x31')]=_0x40932a[_0x1499('0x31')][_0x1499('0x32')]?_0x40932a[_0x1499('0x31')]:_0x1b460b[_0x1499('0x2b')];if(!_0x21d204[_0x1499('0x2d')][_0x1499('0x33')](_0x1499('0x34'))){_0x40932a[_0x1499('0x1c')]=qs[_0x1499('0x1c')](_0x21d204[_0x1499('0x2d')][_0x1499('0x1c')]);_0x40932a[_0x1499('0x1b')]=qs[_0x1499('0x1b')](_0x21d204[_0x1499('0x2d')]['offset']);}_0x40932a[_0x1499('0x35')]=qs[_0x1499('0x36')](_0x21d204[_0x1499('0x2d')][_0x1499('0x36')]);_0x40932a[_0x1499('0x37')]=qs[_0x1499('0x2e')](_[_0x1499('0x38')](_0x21d204[_0x1499('0x2d')],_0x1b460b[_0x1499('0x2e')]));if(_0x21d204[_0x1499('0x2d')][_0x1499('0x39')]){_0x40932a['where']=_['merge'](_0x40932a[_0x1499('0x37')],{'$or':_['map'](_0x388513,function(_0x29bb8f){if(_0x29bb8f['type'][_0x1499('0x3a')]!==_0x1499('0x3b')){var _0x13ae73={};_0x13ae73[_0x29bb8f[_0x1499('0x3c')]]={'$like':'%'+_0x21d204['query'][_0x1499('0x39')]+'%'};return _0x13ae73;}})});}_0x40932a=_['merge']({},_0x40932a,_0x21d204[_0x1499('0x3d')]);var _0x3d518d={'where':_0x40932a[_0x1499('0x37')]};return db[_0x1499('0x2a')]['count'](_0x3d518d)[_0x1499('0x22')](function(_0x815a99){_0x3dad86[_0x1499('0x3e')]=_0x815a99;if(_0x21d204[_0x1499('0x2d')]['includeAll']){_0x40932a[_0x1499('0x3f')]=[{'all':!![]}];}return db['Tag'][_0x1499('0x40')](_0x40932a);})[_0x1499('0x22')](function(_0x2a2441){_0x3dad86[_0x1499('0x41')]=_0x2a2441;return _0x3dad86;})[_0x1499('0x22')](respondWithFilteredResult(_0x103efa,_0x40932a))[_0x1499('0x42')](handleError(_0x103efa,null));};exports[_0x1499('0x43')]=function(_0xcb85eb,_0x410210){var _0x1c1a02={'raw':!![],'where':{'id':_0xcb85eb[_0x1499('0x44')]['id']}},_0x5ab521={};_0x5ab521['model']=_[_0x1499('0x2c')](db[_0x1499('0x2a')]['rawAttributes']);_0x5ab521[_0x1499('0x2d')]=_[_0x1499('0x2c')](_0xcb85eb[_0x1499('0x2d')]);_0x5ab521[_0x1499('0x2e')]=_[_0x1499('0x2f')](_0x5ab521['model'],_0x5ab521['query']);_0x1c1a02[_0x1499('0x31')]=_[_0x1499('0x2f')](_0x5ab521['model'],qs[_0x1499('0x30')](_0xcb85eb[_0x1499('0x2d')]['fields']));_0x1c1a02['attributes']=_0x1c1a02[_0x1499('0x31')][_0x1499('0x32')]?_0x1c1a02[_0x1499('0x31')]:_0x5ab521['model'];if(_0xcb85eb[_0x1499('0x2d')][_0x1499('0x45')]){_0x1c1a02[_0x1499('0x3f')]=[{'all':!![]}];}_0x1c1a02=_[_0x1499('0x46')]({},_0x1c1a02,_0xcb85eb['options']);return db[_0x1499('0x2a')][_0x1499('0x47')](_0x1c1a02)[_0x1499('0x22')](handleEntityNotFound(_0x410210,null))[_0x1499('0x22')](respondWithResult(_0x410210,null))['catch'](handleError(_0x410210,null));};exports[_0x1499('0x48')]=function(_0x123a1d,_0x6ad8be){return db['Tag']['create'](_0x123a1d[_0x1499('0x49')],{})['then'](function(_0x7fa101){var _0x34f35c=_0x123a1d[_0x1499('0x4a')][_0x1499('0x24')]({'plain':!![]});if(!_0x34f35c)throw new Error(_0x1499('0x4b'));if(_0x34f35c[_0x1499('0x4c')]===_0x1499('0x4a')){var _0x591aa8=_0x7fa101[_0x1499('0x24')]({'plain':!![]});var _0x4c81db=_0x1499('0x25');return db[_0x1499('0x4d')]['find']({'where':{'name':_0x4c81db,'userProfileId':_0x34f35c[_0x1499('0x4e')]},'raw':!![]})[_0x1499('0x22')](function(_0x3de674){if(_0x3de674&&_0x3de674['autoAssociation']===0x0){return db[_0x1499('0x26')][_0x1499('0x48')]({'name':_0x591aa8[_0x1499('0x29')],'resourceId':_0x591aa8['id'],'type':_0x3de674[_0x1499('0x29')],'sectionId':_0x3de674['id']},{})[_0x1499('0x22')](function(){return _0x7fa101;});}else{return _0x7fa101;}})[_0x1499('0x42')](function(_0x2cc47f){logger[_0x1499('0x27')](_0x1499('0x4f'),_0x2cc47f);throw _0x2cc47f;});}return _0x7fa101;})[_0x1499('0x22')](respondWithResult(_0x6ad8be,0xc9))['catch'](handleError(_0x6ad8be,null));};exports[_0x1499('0x21')]=function(_0x9f0520,_0x278178){if(_0x9f0520['body']['id']){delete _0x9f0520[_0x1499('0x49')]['id'];}return db[_0x1499('0x2a')]['find']({'where':{'id':_0x9f0520[_0x1499('0x44')]['id']}})[_0x1499('0x22')](handleEntityNotFound(_0x278178,null))['then'](saveUpdates(_0x9f0520[_0x1499('0x49')],null))[_0x1499('0x22')](respondWithResult(_0x278178,null))[_0x1499('0x42')](handleError(_0x278178,null));};exports[_0x1499('0x23')]=function(_0xa870e,_0x16d97c){return db[_0x1499('0x2a')]['find']({'where':{'id':_0xa870e[_0x1499('0x44')]['id']}})[_0x1499('0x22')](handleEntityNotFound(_0x16d97c,null))[_0x1499('0x22')](removeEntity(_0x16d97c,null))[_0x1499('0x42')](handleError(_0x16d97c,null));}; \ No newline at end of file +var _0x1623=['includeAll','findAll','catch','show','params','length','include','options','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','Tags','end','sendStatus','error','name','send','index','Tag','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','key','VIRTUAL'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x1623,0xab));var _0x3162=function(_0x3010ba,_0x59a8e6){_0x3010ba=_0x3010ba-0x0;var _0x4c06e0=_0x1623[_0x3010ba];return _0x4c06e0;};'use strict';var pdf=require(_0x3162('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3162('0x1'));var jsonpatch=require(_0x3162('0x2'));var rp=require(_0x3162('0x3'));var moment=require(_0x3162('0x4'));var BPromise=require(_0x3162('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3162('0x6'));var sox=require('sox');var csv=require(_0x3162('0x7'));var ejs=require(_0x3162('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3162('0x9'));var crypto=require(_0x3162('0xa'));var jsforce=require(_0x3162('0xb'));var deskjs=require(_0x3162('0xc'));var toCsv=require(_0x3162('0x7'));var querystring=require(_0x3162('0xd'));var Papa=require(_0x3162('0xe'));var Redis=require(_0x3162('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x3162('0x10'));var logger=require(_0x3162('0x11'))(_0x3162('0x12'));var utils=require(_0x3162('0x13'));var config=require(_0x3162('0x14'));var db=require(_0x3162('0x15'))['db'];function respondWithStatusCode(_0x458a05,_0x38da60){_0x38da60=_0x38da60||0xcc;return function(_0x157ab8){if(_0x157ab8){return _0x458a05['sendStatus'](_0x38da60);}return _0x458a05[_0x3162('0x16')](_0x38da60)['end']();};}function respondWithResult(_0x3b9faf,_0x143c5a){_0x143c5a=_0x143c5a||0xc8;return function(_0x49d1ad){if(_0x49d1ad){return _0x3b9faf['status'](_0x143c5a)[_0x3162('0x17')](_0x49d1ad);}};}function respondWithFilteredResult(_0x2bb738,_0x1eea65){return function(_0x4b8a3b){if(_0x4b8a3b){var _0x15e348=_0x4b8a3b[_0x3162('0x18')],_0x3d0bea=_0x1eea65[_0x3162('0x19')],_0x2705d1=_0x1eea65[_0x3162('0x19')]+_0x1eea65[_0x3162('0x1a')],_0x490371;if(_0x2705d1>=_0x15e348){_0x2705d1=_0x15e348;_0x490371=0xc8;}else{_0x490371=0xce;}_0x2bb738[_0x3162('0x16')](_0x490371);return _0x2bb738[_0x3162('0x1b')](_0x3162('0x1c'),_0x3d0bea+'-'+_0x2705d1+'/'+_0x15e348)['json'](_0x4b8a3b);}return null;};}function patchUpdates(_0x42f283){return function(_0x1e3d75){try{jsonpatch[_0x3162('0x1d')](_0x1e3d75,_0x42f283,!![]);}catch(_0x36ca97){return BPromise['reject'](_0x36ca97);}return _0x1e3d75[_0x3162('0x1e')]();};}function saveUpdates(_0x5a5141,_0x4ab3e8){return function(_0xa5c62b){if(_0xa5c62b){return _0xa5c62b[_0x3162('0x1f')](_0x5a5141)[_0x3162('0x20')](function(_0x523fab){return _0x523fab;});}return null;};}function removeEntity(_0x47eeae,_0x27133e){return function(_0x396372){if(_0x396372){return _0x396372[_0x3162('0x21')]()[_0x3162('0x20')](function(){var _0x31b27b=_0x396372[_0x3162('0x22')]({'plain':!![]});var _0x52ae25=_0x3162('0x23');return db['UserProfileResource'][_0x3162('0x21')]({'where':{'type':_0x52ae25,'resourceId':_0x31b27b['id']}})[_0x3162('0x20')](function(){return _0x396372;});})[_0x3162('0x20')](function(){_0x47eeae[_0x3162('0x16')](0xcc)[_0x3162('0x24')]();});}};}function handleEntityNotFound(_0x3c543e,_0x30552f){return function(_0x5f8f7){if(!_0x5f8f7){_0x3c543e[_0x3162('0x25')](0x194);}return _0x5f8f7;};}function handleError(_0x356c5d,_0x8fa09f){_0x8fa09f=_0x8fa09f||0x1f4;return function(_0x2f62d7){logger[_0x3162('0x26')](_0x2f62d7['stack']);if(_0x2f62d7[_0x3162('0x27')]){delete _0x2f62d7['name'];}_0x356c5d[_0x3162('0x16')](_0x8fa09f)[_0x3162('0x28')](_0x2f62d7);};}exports[_0x3162('0x29')]=function(_0x57f567,_0x4903e7){var _0xda0389={},_0xaa1f35={},_0x14df16={'count':0x0,'rows':[]};var _0x399148=db[_0x3162('0x2a')]['rawAttributes'];_0xaa1f35[_0x3162('0x2b')]=_['keys'](_0x399148);_0xaa1f35[_0x3162('0x2c')]=_[_0x3162('0x2d')](_0x57f567[_0x3162('0x2c')]);_0xaa1f35[_0x3162('0x2e')]=_[_0x3162('0x2f')](_0xaa1f35[_0x3162('0x2b')],_0xaa1f35[_0x3162('0x2c')]);_0xda0389[_0x3162('0x30')]=_['intersection'](_0xaa1f35[_0x3162('0x2b')],qs[_0x3162('0x31')](_0x57f567['query'][_0x3162('0x31')]));_0xda0389[_0x3162('0x30')]=_0xda0389['attributes']['length']?_0xda0389[_0x3162('0x30')]:_0xaa1f35['model'];if(!_0x57f567[_0x3162('0x2c')][_0x3162('0x32')](_0x3162('0x33'))){_0xda0389['limit']=qs['limit'](_0x57f567[_0x3162('0x2c')][_0x3162('0x1a')]);_0xda0389['offset']=qs[_0x3162('0x19')](_0x57f567['query'][_0x3162('0x19')]);}_0xda0389[_0x3162('0x34')]=qs[_0x3162('0x35')](_0x57f567[_0x3162('0x2c')][_0x3162('0x35')]);_0xda0389[_0x3162('0x36')]=qs[_0x3162('0x2e')](_[_0x3162('0x37')](_0x57f567[_0x3162('0x2c')],_0xaa1f35[_0x3162('0x2e')]));if(_0x57f567[_0x3162('0x2c')]['filter']){_0xda0389[_0x3162('0x36')]=_[_0x3162('0x38')](_0xda0389[_0x3162('0x36')],{'$or':_['map'](_0x399148,function(_0x59759d){if(_0x59759d[_0x3162('0x39')][_0x3162('0x3a')]!==_0x3162('0x3b')){var _0xdc2bef={};_0xdc2bef[_0x59759d['field']]={'$like':'%'+_0x57f567[_0x3162('0x2c')]['filter']+'%'};return _0xdc2bef;}})});}_0xda0389=_['merge']({},_0xda0389,_0x57f567['options']);var _0x298ed7={'where':_0xda0389[_0x3162('0x36')]};return db[_0x3162('0x2a')]['count'](_0x298ed7)[_0x3162('0x20')](function(_0x2ce9c6){_0x14df16[_0x3162('0x18')]=_0x2ce9c6;if(_0x57f567[_0x3162('0x2c')][_0x3162('0x3c')]){_0xda0389['include']=[{'all':!![]}];}return db['Tag'][_0x3162('0x3d')](_0xda0389);})[_0x3162('0x20')](function(_0x5ae385){_0x14df16['rows']=_0x5ae385;return _0x14df16;})[_0x3162('0x20')](respondWithFilteredResult(_0x4903e7,_0xda0389))[_0x3162('0x3e')](handleError(_0x4903e7,null));};exports[_0x3162('0x3f')]=function(_0x4883ac,_0x3502ba){var _0x3efd0d={'raw':!![],'where':{'id':_0x4883ac[_0x3162('0x40')]['id']}},_0x1831f5={};_0x1831f5['model']=_[_0x3162('0x2d')](db[_0x3162('0x2a')]['rawAttributes']);_0x1831f5[_0x3162('0x2c')]=_[_0x3162('0x2d')](_0x4883ac['query']);_0x1831f5[_0x3162('0x2e')]=_[_0x3162('0x2f')](_0x1831f5['model'],_0x1831f5[_0x3162('0x2c')]);_0x3efd0d['attributes']=_[_0x3162('0x2f')](_0x1831f5[_0x3162('0x2b')],qs[_0x3162('0x31')](_0x4883ac[_0x3162('0x2c')][_0x3162('0x31')]));_0x3efd0d[_0x3162('0x30')]=_0x3efd0d['attributes'][_0x3162('0x41')]?_0x3efd0d[_0x3162('0x30')]:_0x1831f5[_0x3162('0x2b')];if(_0x4883ac['query'][_0x3162('0x3c')]){_0x3efd0d[_0x3162('0x42')]=[{'all':!![]}];}_0x3efd0d=_['merge']({},_0x3efd0d,_0x4883ac[_0x3162('0x43')]);return db['Tag']['find'](_0x3efd0d)['then'](handleEntityNotFound(_0x3502ba,null))[_0x3162('0x20')](respondWithResult(_0x3502ba,null))[_0x3162('0x3e')](handleError(_0x3502ba,null));};exports[_0x3162('0x44')]=function(_0x2dfc2e,_0x1cfde8){return db[_0x3162('0x2a')][_0x3162('0x44')](_0x2dfc2e[_0x3162('0x45')],{})[_0x3162('0x20')](function(_0x28865c){var _0x1c81b5=_0x2dfc2e[_0x3162('0x46')][_0x3162('0x22')]({'plain':!![]});if(!_0x1c81b5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c81b5[_0x3162('0x47')]==='user'){var _0x4f1dde=_0x28865c[_0x3162('0x22')]({'plain':!![]});var _0x19f641=_0x3162('0x23');return db[_0x3162('0x48')]['find']({'where':{'name':_0x19f641,'userProfileId':_0x1c81b5[_0x3162('0x49')]},'raw':!![]})['then'](function(_0xa11c6e){if(_0xa11c6e&&_0xa11c6e[_0x3162('0x4a')]===0x0){return db['UserProfileResource'][_0x3162('0x44')]({'name':_0x4f1dde['name'],'resourceId':_0x4f1dde['id'],'type':_0xa11c6e['name'],'sectionId':_0xa11c6e['id']},{})[_0x3162('0x20')](function(){return _0x28865c;});}else{return _0x28865c;}})[_0x3162('0x3e')](function(_0x160364){logger[_0x3162('0x26')](_0x3162('0x4b'),_0x160364);throw _0x160364;});}return _0x28865c;})[_0x3162('0x20')](respondWithResult(_0x1cfde8,0xc9))[_0x3162('0x3e')](handleError(_0x1cfde8,null));};exports[_0x3162('0x1f')]=function(_0x554a03,_0x48b81d){if(_0x554a03['body']['id']){delete _0x554a03[_0x3162('0x45')]['id'];}return db[_0x3162('0x2a')][_0x3162('0x4c')]({'where':{'id':_0x554a03[_0x3162('0x40')]['id']}})[_0x3162('0x20')](handleEntityNotFound(_0x48b81d,null))[_0x3162('0x20')](saveUpdates(_0x554a03[_0x3162('0x45')],null))['then'](respondWithResult(_0x48b81d,null))[_0x3162('0x3e')](handleError(_0x48b81d,null));};exports['destroy']=function(_0x3c85e6,_0x4971d1){return db[_0x3162('0x2a')]['find']({'where':{'id':_0x3c85e6[_0x3162('0x40')]['id']}})[_0x3162('0x20')](handleEntityNotFound(_0x4971d1,null))['then'](removeEntity(_0x4971d1,null))['catch'](handleError(_0x4971d1,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index a691ae3..c6813f8 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 _0x88d7=['moment','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','util','api'];(function(_0x5093e9,_0x5154d0){var _0x4c9a22=function(_0x15176d){while(--_0x15176d){_0x5093e9['push'](_0x5093e9['shift']());}};_0x4c9a22(++_0x5154d0);}(_0x88d7,0xf4));var _0x788d=function(_0x210c87,_0x30ee10){_0x210c87=_0x210c87-0x0;var _0x374258=_0x88d7[_0x210c87];return _0x374258;};'use strict';var _=require(_0x788d('0x0'));var util=require(_0x788d('0x1'));var logger=require('../../config/logger')(_0x788d('0x2'));var moment=require(_0x788d('0x3'));var BPromise=require('bluebird');var rp=require(_0x788d('0x4'));var fs=require('fs');var path=require(_0x788d('0x5'));var rimraf=require(_0x788d('0x6'));var config=require(_0x788d('0x7'));var attributes=require(_0x788d('0x8'));module[_0x788d('0x9')]=function(_0x5c6a92,_0x1485f0){return _0x5c6a92[_0x788d('0xa')](_0x788d('0xb'),attributes,{'tableName':_0x788d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb0da=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./tag.attributes','exports','define','tools_tags'];(function(_0x3c6baa,_0x2521c6){var _0x4d8869=function(_0x3778e9){while(--_0x3778e9){_0x3c6baa['push'](_0x3c6baa['shift']());}};_0x4d8869(++_0x2521c6);}(_0xb0da,0x180));var _0xab0d=function(_0x76ccf2,_0x148c37){_0x76ccf2=_0x76ccf2-0x0;var _0x3eb228=_0xb0da[_0x76ccf2];return _0x3eb228;};'use strict';var _=require(_0xab0d('0x0'));var util=require(_0xab0d('0x1'));var logger=require(_0xab0d('0x2'))(_0xab0d('0x3'));var moment=require(_0xab0d('0x4'));var BPromise=require(_0xab0d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xab0d('0x6'));var rimraf=require('rimraf');var config=require(_0xab0d('0x7'));var attributes=require(_0xab0d('0x8'));module[_0xab0d('0x9')]=function(_0x5adb7b,_0x542517){return _0x5adb7b[_0xab0d('0xa')]('Tag',attributes,{'tableName':_0xab0d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index d82e5e1..af5720c 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 _0x1d57=['lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','Tag,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x4ad0f7,_0x1920b0){var _0x30f5c8=function(_0x2aa6b6){while(--_0x2aa6b6){_0x4ad0f7['push'](_0x4ad0f7['shift']());}};_0x30f5c8(++_0x1920b0);}(_0x1d57,0x140));var _0x71d5=function(_0xbad322,_0x3e6b0b){_0xbad322=_0xbad322-0x0;var _0x2101cb=_0x1d57[_0xbad322];return _0x2101cb;};'use strict';var _=require(_0x71d5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x71d5('0x1'));var rs=require(_0x71d5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x71d5('0x3'))['db'];var utils=require(_0x71d5('0x4'));var logger=require('../../config/logger')(_0x71d5('0x5'));var config=require('../../config/environment');var jayson=require(_0x71d5('0x6'));var client=jayson['client'][_0x71d5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x178cfa,_0x20f519,_0x4d77d2){return new BPromise(function(_0x838f12,_0x1a63e3){return client[_0x71d5('0x8')](_0x178cfa,_0x4d77d2)[_0x71d5('0x9')](function(_0x5cc3f4){logger[_0x71d5('0xa')](_0x71d5('0xb'),_0x20f519,'request\x20sent');logger[_0x71d5('0xc')]('Tag,\x20%s,\x20%s,\x20%s',_0x20f519,_0x71d5('0xd'),JSON[_0x71d5('0xe')](_0x5cc3f4));if(_0x5cc3f4['error']){if(_0x5cc3f4[_0x71d5('0xf')][_0x71d5('0x10')]===0x1f4){logger[_0x71d5('0xf')](_0x71d5('0xb'),_0x20f519,_0x5cc3f4[_0x71d5('0xf')][_0x71d5('0x11')]);return _0x1a63e3(_0x5cc3f4[_0x71d5('0xf')][_0x71d5('0x11')]);}logger[_0x71d5('0xf')](_0x71d5('0xb'),_0x20f519,_0x5cc3f4[_0x71d5('0xf')][_0x71d5('0x11')]);return _0x838f12(_0x5cc3f4[_0x71d5('0xf')][_0x71d5('0x11')]);}else{logger['info'](_0x71d5('0xb'),_0x20f519,_0x71d5('0xd'));_0x838f12(_0x5cc3f4[_0x71d5('0x12')]['message']);}})[_0x71d5('0x13')](function(_0x182d7c){logger[_0x71d5('0xf')](_0x71d5('0xb'),_0x20f519,_0x182d7c);_0x1a63e3(_0x182d7c);});});} \ No newline at end of file +var _0xab5f=['Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info'];(function(_0x1d60d0,_0x2cfa88){var _0x1a0917=function(_0x24dc91){while(--_0x24dc91){_0x1d60d0['push'](_0x1d60d0['shift']());}};_0x1a0917(++_0x2cfa88);}(_0xab5f,0x180));var _0xfab5=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xab5f[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0xfab5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfab5('0x1'));var rs=require(_0xfab5('0x2'));var fs=require('fs');var Redis=require(_0xfab5('0x3'));var db=require(_0xfab5('0x4'))['db'];var utils=require(_0xfab5('0x5'));var logger=require(_0xfab5('0x6'))(_0xfab5('0x7'));var config=require(_0xfab5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfab5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2652d8,_0x33200c,_0x50383a){return new BPromise(function(_0x102f55,_0x286dc7){return client[_0xfab5('0xa')](_0x2652d8,_0x50383a)['then'](function(_0x28eff2){logger[_0xfab5('0xb')](_0xfab5('0xc'),_0x33200c,_0xfab5('0xd'));logger['debug'](_0xfab5('0xe'),_0x33200c,'request\x20sent',JSON[_0xfab5('0xf')](_0x28eff2));if(_0x28eff2[_0xfab5('0x10')]){if(_0x28eff2['error']['code']===0x1f4){logger[_0xfab5('0x10')](_0xfab5('0xc'),_0x33200c,_0x28eff2[_0xfab5('0x10')][_0xfab5('0x11')]);return _0x286dc7(_0x28eff2[_0xfab5('0x10')][_0xfab5('0x11')]);}logger[_0xfab5('0x10')](_0xfab5('0xc'),_0x33200c,_0x28eff2['error']['message']);return _0x102f55(_0x28eff2[_0xfab5('0x10')][_0xfab5('0x11')]);}else{logger[_0xfab5('0xb')](_0xfab5('0xc'),_0x33200c,'request\x20sent');_0x102f55(_0x28eff2['result'][_0xfab5('0x11')]);}})['catch'](function(_0x5edb92){logger[_0xfab5('0x10')](_0xfab5('0xc'),_0x33200c,_0x5edb92);_0x286dc7(_0x5edb92);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index e4ca0b4..410ed46 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 _0x6283=['getAgents','post','addQueues','put','delete','removeQueues','removeAgents','multer','util','path','connect-timeout','express','../../components/auth/service','./team.controller','get','index','/:id','isAuthenticated','show','/:id/queues','getQueues','/:id/users'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6283,0x193));var _0x3628=function(_0x352136,_0x33c84e){_0x352136=_0x352136-0x0;var _0x513255=_0x6283[_0x352136];return _0x513255;};'use strict';var multer=require(_0x3628('0x0'));var util=require(_0x3628('0x1'));var path=require(_0x3628('0x2'));var timeout=require(_0x3628('0x3'));var express=require(_0x3628('0x4'));var router=express['Router']();var auth=require(_0x3628('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3628('0x6'));router[_0x3628('0x7')]('/',auth['isAuthenticated'](),controller[_0x3628('0x8')]);router[_0x3628('0x7')](_0x3628('0x9'),auth[_0x3628('0xa')](),controller[_0x3628('0xb')]);router[_0x3628('0x7')](_0x3628('0xc'),auth[_0x3628('0xa')](),controller[_0x3628('0xd')]);router[_0x3628('0x7')](_0x3628('0xe'),auth[_0x3628('0xa')](),controller[_0x3628('0xf')]);router[_0x3628('0x10')]('/',auth[_0x3628('0xa')](),controller['create']);router[_0x3628('0x10')](_0x3628('0xc'),auth[_0x3628('0xa')](),controller[_0x3628('0x11')]);router[_0x3628('0x10')](_0x3628('0xe'),auth['isAuthenticated'](),controller['addAgents']);router[_0x3628('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x3628('0x13')]('/:id',auth[_0x3628('0xa')](),controller['destroy']);router[_0x3628('0x13')]('/:id/queues',auth[_0x3628('0xa')](),controller[_0x3628('0x14')]);router['delete'](_0x3628('0xe'),auth[_0x3628('0xa')](),controller[_0x3628('0x15')]);module['exports']=router; \ No newline at end of file +var _0x3277=['getAgents','create','post','addQueues','addAgents','put','delete','removeQueues','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./team.controller','get','isAuthenticated','index','/:id','show','/:id/queues','getQueues','/:id/users'];(function(_0x3f0fdd,_0x25be26){var _0x5a8ea2=function(_0x2f4605){while(--_0x2f4605){_0x3f0fdd['push'](_0x3f0fdd['shift']());}};_0x5a8ea2(++_0x25be26);}(_0x3277,0xd2));var _0x7327=function(_0x2203c3,_0x4ca988){_0x2203c3=_0x2203c3-0x0;var _0x27a361=_0x3277[_0x2203c3];return _0x27a361;};'use strict';var multer=require(_0x7327('0x0'));var util=require(_0x7327('0x1'));var path=require('path');var timeout=require(_0x7327('0x2'));var express=require(_0x7327('0x3'));var router=express[_0x7327('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x7327('0x5'));var config=require('../../config/environment');var controller=require(_0x7327('0x6'));router[_0x7327('0x7')]('/',auth[_0x7327('0x8')](),controller[_0x7327('0x9')]);router['get'](_0x7327('0xa'),auth['isAuthenticated'](),controller[_0x7327('0xb')]);router[_0x7327('0x7')](_0x7327('0xc'),auth['isAuthenticated'](),controller[_0x7327('0xd')]);router[_0x7327('0x7')](_0x7327('0xe'),auth[_0x7327('0x8')](),controller[_0x7327('0xf')]);router['post']('/',auth[_0x7327('0x8')](),controller[_0x7327('0x10')]);router[_0x7327('0x11')](_0x7327('0xc'),auth[_0x7327('0x8')](),controller[_0x7327('0x12')]);router[_0x7327('0x11')](_0x7327('0xe'),auth['isAuthenticated'](),controller[_0x7327('0x13')]);router[_0x7327('0x14')](_0x7327('0xa'),auth[_0x7327('0x8')](),controller['update']);router[_0x7327('0x15')](_0x7327('0xa'),auth[_0x7327('0x8')](),controller['destroy']);router[_0x7327('0x15')](_0x7327('0xc'),auth[_0x7327('0x8')](),controller[_0x7327('0x16')]);router['delete'](_0x7327('0xe'),auth[_0x7327('0x8')](),controller[_0x7327('0x17')]);module[_0x7327('0x18')]=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 74c4393..3a61c80 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 _0x0ef9=['STRING','name','sequelize','exports'];(function(_0x2ab5b6,_0x3c0e22){var _0x1cfc63=function(_0x51307d){while(--_0x51307d){_0x2ab5b6['push'](_0x2ab5b6['shift']());}};_0x1cfc63(++_0x3c0e22);}(_0x0ef9,0x8a));var _0x90ef=function(_0x41aa4d,_0x51e45f){_0x41aa4d=_0x41aa4d-0x0;var _0x3fb7d6=_0x0ef9[_0x41aa4d];return _0x3fb7d6;};'use strict';var Sequelize=require(_0x90ef('0x0'));module[_0x90ef('0x1')]={'name':{'type':Sequelize[_0x90ef('0x2')],'allowNull':![],'unique':_0x90ef('0x3')},'description':{'type':Sequelize[_0x90ef('0x2')]}}; \ No newline at end of file +var _0xba38=['sequelize','exports','STRING','name'];(function(_0x715140,_0x25554b){var _0x26add9=function(_0x40db67){while(--_0x40db67){_0x715140['push'](_0x715140['shift']());}};_0x26add9(++_0x25554b);}(_0xba38,0xf4));var _0x8ba3=function(_0x5319a0,_0x2a51ea){_0x5319a0=_0x5319a0-0x0;var _0x5e5153=_0xba38[_0x5319a0];return _0x5e5153;};'use strict';var Sequelize=require(_0x8ba3('0x0'));module[_0x8ba3('0x1')]={'name':{'type':Sequelize[_0x8ba3('0x2')],'allowNull':![],'unique':_0x8ba3('0x3')},'description':{'type':Sequelize[_0x8ba3('0x2')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 23bdd59..1ae47c0 100644 --- a/server/api/team/team.controller.js +++ b/server/api/team/team.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['addQueues','findOne','add','ids','removeQueues','remove','Voice','Chat','Mail','Sms','Fax','Openchannel','each','addAgents','User','findAll','online','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format','omit','spread','userTeam:save','voice','chat','mail','sms','openchannel','removeAgents','isArray','emit','userTeam:remove','getAgents','nolimit','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','../../config/license/hardware','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','index','Team','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','isValidChannel','channel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','Queues'];(function(_0x514c8f,_0x687151){var _0xf4b515=function(_0x5b5a45){while(--_0x5b5a45){_0x514c8f['push'](_0x514c8f['shift']());}};_0xf4b515(++_0x687151);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./team.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='Teams';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['Team'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x46')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')](_0x562fb4[_0x0a9e('0x47')],{})[_0x0a9e('0x23')](function(_0x37be73){var _0x45bf7f=_0x562fb4['user'][_0x0a9e('0x25')]({'plain':!![]});if(!_0x45bf7f)throw new Error(_0x0a9e('0x48'));if(_0x45bf7f[_0x0a9e('0x49')]===_0x0a9e('0x4a')){var _0x409789=_0x37be73[_0x0a9e('0x25')]({'plain':!![]});var _0x6054ee=_0x0a9e('0x4b');return db[_0x0a9e('0x4c')]['find']({'where':{'name':_0x6054ee,'userProfileId':_0x45bf7f[_0x0a9e('0x4d')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x4f7240){if(_0x4f7240&&_0x4f7240['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x46')]({'name':_0x409789[_0x0a9e('0x28')],'resourceId':_0x409789['id'],'type':_0x4f7240[_0x0a9e('0x28')],'sectionId':_0x4f7240['id']},{})[_0x0a9e('0x23')](function(){return _0x37be73;});}else{return _0x37be73;}})[_0x0a9e('0x42')](function(_0x30decb){logger[_0x0a9e('0x26')](_0x0a9e('0x4e'),_0x30decb);throw _0x30decb;});}return _0x37be73;})['then'](respondWithResult(_0x14bec2,0xc9))['catch'](handleError(_0x14bec2,null));};exports['update']=function(_0x39d77d,_0x204173){if(_0x39d77d[_0x0a9e('0x47')]['id']){delete _0x39d77d['body']['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x39d77d['params']['id']}})['then'](handleEntityNotFound(_0x204173,null))[_0x0a9e('0x23')](saveUpdates(_0x39d77d['body'],null))[_0x0a9e('0x23')](respondWithResult(_0x204173,null))['catch'](handleError(_0x204173,null));};exports[_0x0a9e('0x24')]=function(_0x3c20b2,_0x439340){return db['Team'][_0x0a9e('0x45')]({'where':{'id':_0x3c20b2[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x439340,null))['then'](removeEntity(_0x439340,null))[_0x0a9e('0x42')](handleError(_0x439340,null));};exports[_0x0a9e('0x4f')]=function(_0x49c095,_0x145931,_0x5ce9ac){return db[_0x0a9e('0x2a')]['findOne']({'where':{'id':_0x49c095[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x145931,null))['then'](function(_0x5df0ad){if(!_0x49c095[_0x0a9e('0x2e')]['channel']||!utils[_0x0a9e('0x50')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}var _0xd10662={};var _0x28d814={};_0x28d814['model']=_[_0x0a9e('0x2d')](db[_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+_0x0a9e('0x57')]['rawAttributes']);_0x28d814[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x49c095['query']);_0x28d814[_0x0a9e('0x36')]=_['intersection'](_0x28d814[_0x0a9e('0x2c')],_0x28d814['query']);_0xd10662['attributes']=_['intersection'](_0x28d814[_0x0a9e('0x2c')],qs['fields'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0xd10662[_0x0a9e('0x30')]=_0xd10662[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0xd10662[_0x0a9e('0x30')]:_0x28d814['model'];_0xd10662[_0x0a9e('0x1d')]=qs['limit'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0xd10662[_0x0a9e('0x1c')]=qs['offset'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);_0xd10662[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x49c095['query'][_0x0a9e('0x35')]);_0xd10662[_0x0a9e('0x39')]=qs['filters'](_[_0x0a9e('0x58')](_0x49c095[_0x0a9e('0x2e')],_0x28d814[_0x0a9e('0x36')]));_0xd10662=_[_0x0a9e('0x38')]({},_0xd10662,_0x49c095[_0x0a9e('0x3e')]);return _0x5df0ad['get'+_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')]['toLowerCase']())+_0x0a9e('0x59')](_0xd10662);})['then'](respondWithResult(_0x145931,null))['catch'](handleError(_0x145931,null));};exports[_0x0a9e('0x5a')]=function(_0x4556c5,_0x9375fb,_0x19c995){return db[_0x0a9e('0x2a')][_0x0a9e('0x5b')]({'where':{'id':_0x4556c5[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x2d7205){if(_0x2d7205){if(!_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x2d7205[_0x0a9e('0x5c')+_['capitalize'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+'Queues'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x5d')]);}return null;})['then'](handleEntityNotFound(_0x9375fb,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x9375fb,null))[_0x0a9e('0x42')](handleError(_0x9375fb,null));};exports[_0x0a9e('0x5e')]=function(_0x427946,_0x13b5c0,_0x4a43a8){return db['Team']['findOne']({'where':{'id':_0x427946[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x1104ad){if(_0x1104ad){if(!_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db['Sequelize'][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x1104ad[_0x0a9e('0x5f')+_['capitalize'](_0x427946[_0x0a9e('0x2e')]['channel'][_0x0a9e('0x56')]())+_0x0a9e('0x59')](_0x427946['query'][_0x0a9e('0x5d')]);}return null;})[_0x0a9e('0x23')](handleEntityNotFound(_0x13b5c0,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x13b5c0,null))[_0x0a9e('0x42')](handleError(_0x13b5c0,null));};exports['addAgents']=function(_0x1d442c,_0x2e9552,_0x371533){return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x1d442c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x2e9552,null))[_0x0a9e('0x23')](function(_0x361b21){if(_0x361b21){var _0x4abc8f=[_0x0a9e('0x60'),_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),_0x0a9e('0x65')];return BPromise[_0x0a9e('0x66')](_0x4abc8f,function(_0x3df0e3){return _0x361b21[_0x0a9e('0x25')+_0x3df0e3+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x25744a){return BPromise[_0x0a9e('0x66')](_0x25744a,function(_0x5b35db){return _0x5b35db[_0x0a9e('0x67')](_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')])['then'](function(){if(_0x3df0e3===_0x0a9e('0x60')){return db[_0x0a9e('0x68')][_0x0a9e('0x69')]({'where':{'id':_0x1d442c[_0x0a9e('0x47')]['ids']},'attributes':['id','name',_0x0a9e('0x6a'),_0x0a9e('0x6b'),'interface'],'raw':!![]})[_0x0a9e('0x23')](function(_0x53a6a1){return BPromise[_0x0a9e('0x66')](_[_0x0a9e('0x37')](_0x53a6a1,{'online':0x1}),function(_0x5637a1){return db[_0x0a9e('0x6c')][_0x0a9e('0x6d')]({'membername':_0x5637a1[_0x0a9e('0x28')],'UserId':_0x5637a1['id'],'queue_name':_0x5b35db[_0x0a9e('0x28')],'VoiceQueueId':_0x5b35db['id'],'interface':_[_0x0a9e('0x6e')](_0x5637a1[_0x0a9e('0x6f')])?util[_0x0a9e('0x70')]('SIP/%s',_0x5637a1[_0x0a9e('0x28')]):_0x5637a1[_0x0a9e('0x6f')],'paused':_0x5637a1[_0x0a9e('0x6b')]||![],'penalty':0x0});});});}});});})[_0x0a9e('0x23')](function(){return _0x361b21;});})['then'](function(){return _0x361b21;});}})[_0x0a9e('0x23')](function(_0xf0db1){if(_0xf0db1){return _0xf0db1['addAgents'](_0x1d442c[_0x0a9e('0x47')]['ids'],_[_0x0a9e('0x71')](_0x1d442c[_0x0a9e('0x47')],[_0x0a9e('0x5d'),'id'])||{})[_0x0a9e('0x72')](function(_0x5af453){for(var _0x51ccd7=0x0;_0x51ccd7<_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x51ccd7+=0x1){socket['emit'](_0x0a9e('0x73'),{'UserId':_0x1d442c[_0x0a9e('0x47')]['ids'][_0x51ccd7],'TeamId':_0x1d442c['params']['id']});}return _0x5af453;});}})[_0x0a9e('0x23')](respondWithResult(_0x2e9552,null))['catch'](handleError(_0x2e9552,null));};exports['removeAgents']=function(_0x4dc6b3,_0x81d748,_0xf3601c){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4dc6b3[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x81d748,null))['then'](function(_0x5fd5db){if(_0x5fd5db){return BPromise['each']([_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),'fax',_0x0a9e('0x78')],function(_0x32f761){return _0x5fd5db[_0x0a9e('0x25')+_['capitalize'](_0x32f761)+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x22063c){return BPromise[_0x0a9e('0x66')](_0x22063c,function(_0x1910bf){return _0x1910bf[_0x0a9e('0x79')](_0x4dc6b3[_0x0a9e('0x2e')]['ids'])[_0x0a9e('0x23')](function(){if(_0x32f761===_0x0a9e('0x74')){return db['UserVoiceQueueRt'][_0x0a9e('0x24')]({'where':{'VoiceQueueId':_0x1910bf['id'],'UserId':_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')]}});}});});})['then'](function(){return _0x5fd5db;});})[_0x0a9e('0x23')](function(){return _0x5fd5db;});}})['then'](function(_0x8c8fbe){if(_0x8c8fbe){return _0x8c8fbe[_0x0a9e('0x79')](_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')])[_0x0a9e('0x23')](function(){if(_[_0x0a9e('0x7a')](_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')])){for(var _0x501050=0x0;_0x501050<_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x501050+=0x1){socket[_0x0a9e('0x7b')](_0x0a9e('0x7c'),{'UserId':Number(_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x501050]),'TeamId':Number(_0x4dc6b3[_0x0a9e('0x44')]['id'])});}}else{socket[_0x0a9e('0x7b')](_0x0a9e('0x7c'),{'UserId':Number(_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')]),'TeamId':Number(_0x4dc6b3[_0x0a9e('0x44')]['id'])});}});}})['then'](respondWithStatusCode(_0x81d748,null))[_0x0a9e('0x42')](handleError(_0x81d748,null));};exports[_0x0a9e('0x7d')]=function(_0x12843d,_0x2ed526,_0xb0599a){var _0x5d9ddb={};var _0x3afc8c={};var _0x1756c7;var _0x5ce99d;return db[_0x0a9e('0x2a')]['findOne']({'where':{'id':_0x12843d[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x2ed526,null))[_0x0a9e('0x23')](function(_0xf8c6c4){if(_0xf8c6c4){_0x1756c7=_0xf8c6c4;_0x3afc8c['model']=_[_0x0a9e('0x2d')](db['User'][_0x0a9e('0x2b')]);_0x3afc8c[_0x0a9e('0x2e')]=_['keys'](_0x12843d[_0x0a9e('0x2e')]);_0x3afc8c[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3afc8c['model'],_0x3afc8c['query']);_0x5d9ddb[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3afc8c[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x5d9ddb[_0x0a9e('0x30')]=_0x5d9ddb[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x5d9ddb['attributes']:_0x3afc8c[_0x0a9e('0x2c')];_0x5d9ddb['order']=qs[_0x0a9e('0x35')](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x35')]);_0x5d9ddb[_0x0a9e('0x39')]=qs[_0x0a9e('0x36')](_['pick'](_0x12843d[_0x0a9e('0x2e')],_0x3afc8c[_0x0a9e('0x36')]));if(_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x5d9ddb[_0x0a9e('0x39')]=_['merge'](_0x5d9ddb['where'],{'$or':_[_0x0a9e('0x3a')](_0x5d9ddb['attributes'],function(_0x25eae0){var _0x4658df={};_0x4658df[_0x25eae0]={'$like':'%'+_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4658df;})});}_0x5d9ddb=_[_0x0a9e('0x38')]({},_0x5d9ddb,_0x12843d[_0x0a9e('0x3e')]);return _0x1756c7['getAgents'](_0x5d9ddb);}})['then'](function(_0x1889ed){if(_0x1889ed){_0x5ce99d=_0x1889ed['length'];if(!_0x12843d[_0x0a9e('0x2e')]['hasOwnProperty'](_0x0a9e('0x7e'))){_0x5d9ddb['limit']=qs['limit'](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x5d9ddb['offset']=qs[_0x0a9e('0x1c')](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}return _0x1756c7[_0x0a9e('0x7d')](_0x5d9ddb);}})[_0x0a9e('0x23')](function(_0x5ab0bc){if(_0x5ab0bc){return _0x5ab0bc?{'count':_0x5ce99d,'rows':_0x5ab0bc}:null;}})['then'](respondWithResult(_0x2ed526,null))[_0x0a9e('0x42')](handleError(_0x2ed526,null));}; \ No newline at end of file +var _0xa9e0=['addQueues','findOne','add','ids','removeQueues','remove','Voice','Chat','Mail','Sms','Fax','Openchannel','each','addAgents','User','findAll','online','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format','omit','spread','userTeam:save','voice','chat','mail','sms','openchannel','removeAgents','isArray','emit','userTeam:remove','getAgents','nolimit','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','../../config/license/hardware','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','index','Team','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','isValidChannel','channel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','Queues'];(function(_0x45ea78,_0x31678e){var _0xd722b7=function(_0x25710a){while(--_0x25710a){_0x45ea78['push'](_0x45ea78['shift']());}};_0xd722b7(++_0x31678e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./team.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='Teams';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['Team'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x46')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')](_0x562fb4[_0x0a9e('0x47')],{})[_0x0a9e('0x23')](function(_0x37be73){var _0x45bf7f=_0x562fb4['user'][_0x0a9e('0x25')]({'plain':!![]});if(!_0x45bf7f)throw new Error(_0x0a9e('0x48'));if(_0x45bf7f[_0x0a9e('0x49')]===_0x0a9e('0x4a')){var _0x409789=_0x37be73[_0x0a9e('0x25')]({'plain':!![]});var _0x6054ee=_0x0a9e('0x4b');return db[_0x0a9e('0x4c')]['find']({'where':{'name':_0x6054ee,'userProfileId':_0x45bf7f[_0x0a9e('0x4d')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x4f7240){if(_0x4f7240&&_0x4f7240['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x46')]({'name':_0x409789[_0x0a9e('0x28')],'resourceId':_0x409789['id'],'type':_0x4f7240[_0x0a9e('0x28')],'sectionId':_0x4f7240['id']},{})[_0x0a9e('0x23')](function(){return _0x37be73;});}else{return _0x37be73;}})[_0x0a9e('0x42')](function(_0x30decb){logger[_0x0a9e('0x26')](_0x0a9e('0x4e'),_0x30decb);throw _0x30decb;});}return _0x37be73;})['then'](respondWithResult(_0x14bec2,0xc9))['catch'](handleError(_0x14bec2,null));};exports['update']=function(_0x39d77d,_0x204173){if(_0x39d77d[_0x0a9e('0x47')]['id']){delete _0x39d77d['body']['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x39d77d['params']['id']}})['then'](handleEntityNotFound(_0x204173,null))[_0x0a9e('0x23')](saveUpdates(_0x39d77d['body'],null))[_0x0a9e('0x23')](respondWithResult(_0x204173,null))['catch'](handleError(_0x204173,null));};exports[_0x0a9e('0x24')]=function(_0x3c20b2,_0x439340){return db['Team'][_0x0a9e('0x45')]({'where':{'id':_0x3c20b2[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x439340,null))['then'](removeEntity(_0x439340,null))[_0x0a9e('0x42')](handleError(_0x439340,null));};exports[_0x0a9e('0x4f')]=function(_0x49c095,_0x145931,_0x5ce9ac){return db[_0x0a9e('0x2a')]['findOne']({'where':{'id':_0x49c095[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x145931,null))['then'](function(_0x5df0ad){if(!_0x49c095[_0x0a9e('0x2e')]['channel']||!utils[_0x0a9e('0x50')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}var _0xd10662={};var _0x28d814={};_0x28d814['model']=_[_0x0a9e('0x2d')](db[_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+_0x0a9e('0x57')]['rawAttributes']);_0x28d814[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x49c095['query']);_0x28d814[_0x0a9e('0x36')]=_['intersection'](_0x28d814[_0x0a9e('0x2c')],_0x28d814['query']);_0xd10662['attributes']=_['intersection'](_0x28d814[_0x0a9e('0x2c')],qs['fields'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0xd10662[_0x0a9e('0x30')]=_0xd10662[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0xd10662[_0x0a9e('0x30')]:_0x28d814['model'];_0xd10662[_0x0a9e('0x1d')]=qs['limit'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0xd10662[_0x0a9e('0x1c')]=qs['offset'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);_0xd10662[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x49c095['query'][_0x0a9e('0x35')]);_0xd10662[_0x0a9e('0x39')]=qs['filters'](_[_0x0a9e('0x58')](_0x49c095[_0x0a9e('0x2e')],_0x28d814[_0x0a9e('0x36')]));_0xd10662=_[_0x0a9e('0x38')]({},_0xd10662,_0x49c095[_0x0a9e('0x3e')]);return _0x5df0ad['get'+_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')]['toLowerCase']())+_0x0a9e('0x59')](_0xd10662);})['then'](respondWithResult(_0x145931,null))['catch'](handleError(_0x145931,null));};exports[_0x0a9e('0x5a')]=function(_0x4556c5,_0x9375fb,_0x19c995){return db[_0x0a9e('0x2a')][_0x0a9e('0x5b')]({'where':{'id':_0x4556c5[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x2d7205){if(_0x2d7205){if(!_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x2d7205[_0x0a9e('0x5c')+_['capitalize'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+'Queues'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x5d')]);}return null;})['then'](handleEntityNotFound(_0x9375fb,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x9375fb,null))[_0x0a9e('0x42')](handleError(_0x9375fb,null));};exports[_0x0a9e('0x5e')]=function(_0x427946,_0x13b5c0,_0x4a43a8){return db['Team']['findOne']({'where':{'id':_0x427946[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x1104ad){if(_0x1104ad){if(!_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db['Sequelize'][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x1104ad[_0x0a9e('0x5f')+_['capitalize'](_0x427946[_0x0a9e('0x2e')]['channel'][_0x0a9e('0x56')]())+_0x0a9e('0x59')](_0x427946['query'][_0x0a9e('0x5d')]);}return null;})[_0x0a9e('0x23')](handleEntityNotFound(_0x13b5c0,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x13b5c0,null))[_0x0a9e('0x42')](handleError(_0x13b5c0,null));};exports['addAgents']=function(_0x1d442c,_0x2e9552,_0x371533){return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x1d442c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x2e9552,null))[_0x0a9e('0x23')](function(_0x361b21){if(_0x361b21){var _0x4abc8f=[_0x0a9e('0x60'),_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),_0x0a9e('0x65')];return BPromise[_0x0a9e('0x66')](_0x4abc8f,function(_0x3df0e3){return _0x361b21[_0x0a9e('0x25')+_0x3df0e3+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x25744a){return BPromise[_0x0a9e('0x66')](_0x25744a,function(_0x5b35db){return _0x5b35db[_0x0a9e('0x67')](_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')])['then'](function(){if(_0x3df0e3===_0x0a9e('0x60')){return db[_0x0a9e('0x68')][_0x0a9e('0x69')]({'where':{'id':_0x1d442c[_0x0a9e('0x47')]['ids']},'attributes':['id','name',_0x0a9e('0x6a'),_0x0a9e('0x6b'),'interface'],'raw':!![]})[_0x0a9e('0x23')](function(_0x53a6a1){return BPromise[_0x0a9e('0x66')](_[_0x0a9e('0x37')](_0x53a6a1,{'online':0x1}),function(_0x5637a1){return db[_0x0a9e('0x6c')][_0x0a9e('0x6d')]({'membername':_0x5637a1[_0x0a9e('0x28')],'UserId':_0x5637a1['id'],'queue_name':_0x5b35db[_0x0a9e('0x28')],'VoiceQueueId':_0x5b35db['id'],'interface':_[_0x0a9e('0x6e')](_0x5637a1[_0x0a9e('0x6f')])?util[_0x0a9e('0x70')]('SIP/%s',_0x5637a1[_0x0a9e('0x28')]):_0x5637a1[_0x0a9e('0x6f')],'paused':_0x5637a1[_0x0a9e('0x6b')]||![],'penalty':0x0});});});}});});})[_0x0a9e('0x23')](function(){return _0x361b21;});})['then'](function(){return _0x361b21;});}})[_0x0a9e('0x23')](function(_0xf0db1){if(_0xf0db1){return _0xf0db1['addAgents'](_0x1d442c[_0x0a9e('0x47')]['ids'],_[_0x0a9e('0x71')](_0x1d442c[_0x0a9e('0x47')],[_0x0a9e('0x5d'),'id'])||{})[_0x0a9e('0x72')](function(_0x5af453){for(var _0x51ccd7=0x0;_0x51ccd7<_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x51ccd7+=0x1){socket['emit'](_0x0a9e('0x73'),{'UserId':_0x1d442c[_0x0a9e('0x47')]['ids'][_0x51ccd7],'TeamId':_0x1d442c['params']['id']});}return _0x5af453;});}})[_0x0a9e('0x23')](respondWithResult(_0x2e9552,null))['catch'](handleError(_0x2e9552,null));};exports['removeAgents']=function(_0x4dc6b3,_0x81d748,_0xf3601c){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4dc6b3[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x81d748,null))['then'](function(_0x5fd5db){if(_0x5fd5db){return BPromise['each']([_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),'fax',_0x0a9e('0x78')],function(_0x32f761){return _0x5fd5db[_0x0a9e('0x25')+_['capitalize'](_0x32f761)+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x22063c){return BPromise[_0x0a9e('0x66')](_0x22063c,function(_0x1910bf){return _0x1910bf[_0x0a9e('0x79')](_0x4dc6b3[_0x0a9e('0x2e')]['ids'])[_0x0a9e('0x23')](function(){if(_0x32f761===_0x0a9e('0x74')){return db['UserVoiceQueueRt'][_0x0a9e('0x24')]({'where':{'VoiceQueueId':_0x1910bf['id'],'UserId':_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')]}});}});});})['then'](function(){return _0x5fd5db;});})[_0x0a9e('0x23')](function(){return _0x5fd5db;});}})['then'](function(_0x8c8fbe){if(_0x8c8fbe){return _0x8c8fbe[_0x0a9e('0x79')](_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')])[_0x0a9e('0x23')](function(){if(_[_0x0a9e('0x7a')](_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')])){for(var _0x501050=0x0;_0x501050<_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x501050+=0x1){socket[_0x0a9e('0x7b')](_0x0a9e('0x7c'),{'UserId':Number(_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x501050]),'TeamId':Number(_0x4dc6b3[_0x0a9e('0x44')]['id'])});}}else{socket[_0x0a9e('0x7b')](_0x0a9e('0x7c'),{'UserId':Number(_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')]),'TeamId':Number(_0x4dc6b3[_0x0a9e('0x44')]['id'])});}});}})['then'](respondWithStatusCode(_0x81d748,null))[_0x0a9e('0x42')](handleError(_0x81d748,null));};exports[_0x0a9e('0x7d')]=function(_0x12843d,_0x2ed526,_0xb0599a){var _0x5d9ddb={};var _0x3afc8c={};var _0x1756c7;var _0x5ce99d;return db[_0x0a9e('0x2a')]['findOne']({'where':{'id':_0x12843d[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x2ed526,null))[_0x0a9e('0x23')](function(_0xf8c6c4){if(_0xf8c6c4){_0x1756c7=_0xf8c6c4;_0x3afc8c['model']=_[_0x0a9e('0x2d')](db['User'][_0x0a9e('0x2b')]);_0x3afc8c[_0x0a9e('0x2e')]=_['keys'](_0x12843d[_0x0a9e('0x2e')]);_0x3afc8c[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3afc8c['model'],_0x3afc8c['query']);_0x5d9ddb[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3afc8c[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x5d9ddb[_0x0a9e('0x30')]=_0x5d9ddb[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x5d9ddb['attributes']:_0x3afc8c[_0x0a9e('0x2c')];_0x5d9ddb['order']=qs[_0x0a9e('0x35')](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x35')]);_0x5d9ddb[_0x0a9e('0x39')]=qs[_0x0a9e('0x36')](_['pick'](_0x12843d[_0x0a9e('0x2e')],_0x3afc8c[_0x0a9e('0x36')]));if(_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x5d9ddb[_0x0a9e('0x39')]=_['merge'](_0x5d9ddb['where'],{'$or':_[_0x0a9e('0x3a')](_0x5d9ddb['attributes'],function(_0x25eae0){var _0x4658df={};_0x4658df[_0x25eae0]={'$like':'%'+_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4658df;})});}_0x5d9ddb=_[_0x0a9e('0x38')]({},_0x5d9ddb,_0x12843d[_0x0a9e('0x3e')]);return _0x1756c7['getAgents'](_0x5d9ddb);}})['then'](function(_0x1889ed){if(_0x1889ed){_0x5ce99d=_0x1889ed['length'];if(!_0x12843d[_0x0a9e('0x2e')]['hasOwnProperty'](_0x0a9e('0x7e'))){_0x5d9ddb['limit']=qs['limit'](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x5d9ddb['offset']=qs[_0x0a9e('0x1c')](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}return _0x1756c7[_0x0a9e('0x7d')](_0x5d9ddb);}})[_0x0a9e('0x23')](function(_0x5ab0bc){if(_0x5ab0bc){return _0x5ab0bc?{'count':_0x5ce99d,'rows':_0x5ab0bc}:null;}})['then'](respondWithResult(_0x2ed526,null))[_0x0a9e('0x42')](handleError(_0x2ed526,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index dfc0f5f..28e5f88 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 _0x199c=['remove','emit','exports','Team','setMaxListeners','save','update'];(function(_0x4df85c,_0x248dfb){var _0x4e2a61=function(_0x4e2c8e){while(--_0x4e2c8e){_0x4df85c['push'](_0x4df85c['shift']());}};_0x4e2a61(++_0x248dfb);}(_0x199c,0x1d8));var _0xc199=function(_0x5adec9,_0x18a838){_0x5adec9=_0x5adec9-0x0;var _0x17f65f=_0x199c[_0x5adec9];return _0x17f65f;};'use strict';var EventEmitter=require('events');var Team=require('../../mysqldb')['db'][_0xc199('0x0')];var TeamEvents=new EventEmitter();TeamEvents[_0xc199('0x1')](0x0);var events={'afterCreate':_0xc199('0x2'),'afterUpdate':_0xc199('0x3'),'afterDestroy':_0xc199('0x4')};function emitEvent(_0x2f63ce){return function(_0x3f06cc,_0x1eecc2,_0x4b4a7b){TeamEvents[_0xc199('0x5')](_0x2f63ce+':'+_0x3f06cc['id'],_0x3f06cc);TeamEvents[_0xc199('0x5')](_0x2f63ce,_0x3f06cc);_0x4b4a7b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xc199('0x6')]=TeamEvents; \ No newline at end of file +var _0x49c1=['Team','setMaxListeners','save','remove','emit','hook','exports','events'];(function(_0xcb6d2b,_0x1a56ac){var _0x2c3687=function(_0x1b6ed0){while(--_0x1b6ed0){_0xcb6d2b['push'](_0xcb6d2b['shift']());}};_0x2c3687(++_0x1a56ac);}(_0x49c1,0xef));var _0x149c=function(_0x1392f4,_0x11c0a7){_0x1392f4=_0x1392f4-0x0;var _0x10223c=_0x49c1[_0x1392f4];return _0x10223c;};'use strict';var EventEmitter=require(_0x149c('0x0'));var Team=require('../../mysqldb')['db'][_0x149c('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x149c('0x2')](0x0);var events={'afterCreate':_0x149c('0x3'),'afterUpdate':'update','afterDestroy':_0x149c('0x4')};function emitEvent(_0x2297bf){return function(_0x4c3294,_0xdb4fdf,_0x8c3ab2){TeamEvents['emit'](_0x2297bf+':'+_0x4c3294['id'],_0x4c3294);TeamEvents[_0x149c('0x5')](_0x2297bf,_0x4c3294);_0x8c3ab2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x149c('0x6')](e,emitEvent(event));}}module[_0x149c('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index ee5c3ac..8837db0 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 _0xdbff=['exports','teams','util','moment','bluebird','request-promise','path'];(function(_0x5b48e3,_0x34e29c){var _0x4e33f4=function(_0x49d07b){while(--_0x49d07b){_0x5b48e3['push'](_0x5b48e3['shift']());}};_0x4e33f4(++_0x34e29c);}(_0xdbff,0x95));var _0xfdbf=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xdbff[_0x3b0731];return _0x4204d7;};'use strict';var _=require('lodash');var util=require(_0xfdbf('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xfdbf('0x1'));var BPromise=require(_0xfdbf('0x2'));var rp=require(_0xfdbf('0x3'));var fs=require('fs');var path=require(_0xfdbf('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./team.attributes');module[_0xfdbf('0x5')]=function(_0x215b34,_0x79925e){return _0x215b34['define']('Team',attributes,{'tableName':_0xfdbf('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe68a=['request-promise','path','rimraf','../../config/environment','exports','Team','teams','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3fcc5,_0x5771ad){var _0x3977fc=function(_0x5a0d89){while(--_0x5a0d89){_0x3fcc5['push'](_0x3fcc5['shift']());}};_0x3977fc(++_0x5771ad);}(_0xe68a,0x125));var _0xae68=function(_0x544391,_0x1e996c){_0x544391=_0x544391-0x0;var _0x506b00=_0xe68a[_0x544391];return _0x506b00;};'use strict';var _=require(_0xae68('0x0'));var util=require(_0xae68('0x1'));var logger=require(_0xae68('0x2'))(_0xae68('0x3'));var moment=require(_0xae68('0x4'));var BPromise=require(_0xae68('0x5'));var rp=require(_0xae68('0x6'));var fs=require('fs');var path=require(_0xae68('0x7'));var rimraf=require(_0xae68('0x8'));var config=require(_0xae68('0x9'));var attributes=require('./team.attributes');module[_0xae68('0xa')]=function(_0x5b93d4,_0x3f4f27){return _0x5b93d4['define'](_0xae68('0xb'),attributes,{'tableName':_0xae68('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 742d17f..794d7b9 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 _0x184a=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','Team,\x20%s,\x20%s','message','info','catch','lodash'];(function(_0x40bdb3,_0x5a81f2){var _0xeac086=function(_0x199fba){while(--_0x199fba){_0x40bdb3['push'](_0x40bdb3['shift']());}};_0xeac086(++_0x5a81f2);}(_0x184a,0x14f));var _0xa184=function(_0x19d470,_0x3c95ce){_0x19d470=_0x19d470-0x0;var _0xc5d40f=_0x184a[_0x19d470];return _0xc5d40f;};'use strict';var _=require(_0xa184('0x0'));var util=require(_0xa184('0x1'));var moment=require(_0xa184('0x2'));var BPromise=require(_0xa184('0x3'));var rs=require(_0xa184('0x4'));var fs=require('fs');var Redis=require(_0xa184('0x5'));var db=require(_0xa184('0x6'))['db'];var utils=require(_0xa184('0x7'));var logger=require(_0xa184('0x8'))(_0xa184('0x9'));var config=require('../../config/environment');var jayson=require(_0xa184('0xa'));var client=jayson[_0xa184('0xb')][_0xa184('0xc')]({'port':0x232a});config[_0xa184('0xd')]=_[_0xa184('0xe')](config[_0xa184('0xd')],{'host':_0xa184('0xf'),'port':0x18eb});var socket=require(_0xa184('0x10'))(new Redis(config[_0xa184('0xd')]));require('./team.socket')[_0xa184('0x11')](socket);function respondWithRpcPromise(_0x2d6537,_0x123a78,_0x33c995){return new BPromise(function(_0x5b5c0e,_0x2c9ccf){return client[_0xa184('0x12')](_0x2d6537,_0x33c995)['then'](function(_0x33e81f){logger['info']('Team,\x20%s,\x20%s',_0x123a78,_0xa184('0x13'));logger[_0xa184('0x14')](_0xa184('0x15'),_0x123a78,_0xa184('0x13'),JSON[_0xa184('0x16')](_0x33e81f));if(_0x33e81f[_0xa184('0x17')]){if(_0x33e81f[_0xa184('0x17')]['code']===0x1f4){logger[_0xa184('0x17')](_0xa184('0x18'),_0x123a78,_0x33e81f['error'][_0xa184('0x19')]);return _0x2c9ccf(_0x33e81f[_0xa184('0x17')][_0xa184('0x19')]);}logger[_0xa184('0x17')](_0xa184('0x18'),_0x123a78,_0x33e81f['error'][_0xa184('0x19')]);return _0x5b5c0e(_0x33e81f['error'][_0xa184('0x19')]);}else{logger[_0xa184('0x1a')](_0xa184('0x18'),_0x123a78,_0xa184('0x13'));_0x5b5c0e(_0x33e81f['result'][_0xa184('0x19')]);}})[_0xa184('0x1b')](function(_0x5a4408){logger[_0xa184('0x17')]('Team,\x20%s,\x20%s',_0x123a78,_0x5a4408);_0x2c9ccf(_0x5a4408);});});} \ No newline at end of file +var _0xfa8c=['info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./team.socket','register','request','then','Team,\x20%s,\x20%s','request\x20sent','stringify','code','error','message'];(function(_0x5eebf0,_0x43c359){var _0x400eee=function(_0x26c7a0){while(--_0x26c7a0){_0x5eebf0['push'](_0x5eebf0['shift']());}};_0x400eee(++_0x43c359);}(_0xfa8c,0x146));var _0xcfa8=function(_0x40c938,_0x10318b){_0x40c938=_0x40c938-0x0;var _0xf9669f=_0xfa8c[_0x40c938];return _0xf9669f;};'use strict';var _=require(_0xcfa8('0x0'));var util=require(_0xcfa8('0x1'));var moment=require('moment');var BPromise=require(_0xcfa8('0x2'));var rs=require(_0xcfa8('0x3'));var fs=require('fs');var Redis=require(_0xcfa8('0x4'));var db=require(_0xcfa8('0x5'))['db'];var utils=require(_0xcfa8('0x6'));var logger=require(_0xcfa8('0x7'))('rpc');var config=require(_0xcfa8('0x8'));var jayson=require(_0xcfa8('0x9'));var client=jayson[_0xcfa8('0xa')]['http']({'port':0x232a});config['redis']=_[_0xcfa8('0xb')](config[_0xcfa8('0xc')],{'host':_0xcfa8('0xd'),'port':0x18eb});var socket=require(_0xcfa8('0xe'))(new Redis(config[_0xcfa8('0xc')]));require(_0xcfa8('0xf'))[_0xcfa8('0x10')](socket);function respondWithRpcPromise(_0x427dce,_0x31547c,_0x2ef917){return new BPromise(function(_0x18e737,_0x3837c9){return client[_0xcfa8('0x11')](_0x427dce,_0x2ef917)[_0xcfa8('0x12')](function(_0x476481){logger['info'](_0xcfa8('0x13'),_0x31547c,_0xcfa8('0x14'));logger['debug']('Team,\x20%s,\x20%s,\x20%s',_0x31547c,'request\x20sent',JSON[_0xcfa8('0x15')](_0x476481));if(_0x476481['error']){if(_0x476481['error'][_0xcfa8('0x16')]===0x1f4){logger['error'](_0xcfa8('0x13'),_0x31547c,_0x476481['error']['message']);return _0x3837c9(_0x476481[_0xcfa8('0x17')][_0xcfa8('0x18')]);}logger[_0xcfa8('0x17')]('Team,\x20%s,\x20%s',_0x31547c,_0x476481[_0xcfa8('0x17')]['message']);return _0x18e737(_0x476481['error'][_0xcfa8('0x18')]);}else{logger[_0xcfa8('0x19')](_0xcfa8('0x13'),_0x31547c,_0xcfa8('0x14'));_0x18e737(_0x476481['result'][_0xcfa8('0x18')]);}})[_0xcfa8('0x1a')](function(_0x334479){logger[_0xcfa8('0x17')](_0xcfa8('0x13'),_0x31547c,_0x334479);_0x3837c9(_0x334479);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index b7d8249..cbfcfca 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 _0x59e1=['register','team:','./team.events','save','removeListener'];(function(_0x2634ed,_0x24596e){var _0x6d9201=function(_0x434ac2){while(--_0x434ac2){_0x2634ed['push'](_0x2634ed['shift']());}};_0x6d9201(++_0x24596e);}(_0x59e1,0x89));var _0x159e=function(_0x37e619,_0x53a0e3){_0x37e619=_0x37e619-0x0;var _0x58e0df=_0x59e1[_0x37e619];return _0x58e0df;};'use strict';var TeamEvents=require(_0x159e('0x0'));var events=[_0x159e('0x1'),'remove','update'];function createListener(_0xd62d22,_0x5636e7){return function(_0xf06a9){_0x5636e7['emit'](_0xd62d22,_0xf06a9);};}function removeListener(_0x39a7b4,_0x28fd12){return function(){TeamEvents[_0x159e('0x2')](_0x39a7b4,_0x28fd12);};}exports[_0x159e('0x3')]=function(_0x15cd87){for(var _0x363b0a=0x0,_0x315634=events['length'];_0x363b0a<_0x315634;_0x363b0a++){var _0x3c40e8=events[_0x363b0a];var _0x52f4d7=createListener(_0x159e('0x4')+_0x3c40e8,_0x15cd87);TeamEvents['on'](_0x3c40e8,_0x52f4d7);}}; \ No newline at end of file +var _0xa117=['update','removeListener','length','team:','remove'];(function(_0x4f6f9b,_0x2d4b78){var _0x3c1302=function(_0x1d6705){while(--_0x1d6705){_0x4f6f9b['push'](_0x4f6f9b['shift']());}};_0x3c1302(++_0x2d4b78);}(_0xa117,0x12b));var _0x7a11=function(_0x3ccd0a,_0x4aee1c){_0x3ccd0a=_0x3ccd0a-0x0;var _0x23caaf=_0xa117[_0x3ccd0a];return _0x23caaf;};'use strict';var TeamEvents=require('./team.events');var events=['save',_0x7a11('0x0'),_0x7a11('0x1')];function createListener(_0x1f6f85,_0xaa013){return function(_0x497023){_0xaa013['emit'](_0x1f6f85,_0x497023);};}function removeListener(_0x78c4b8,_0x4568f0){return function(){TeamEvents[_0x7a11('0x2')](_0x78c4b8,_0x4568f0);};}exports['register']=function(_0x1bd312){for(var _0x5c89cc=0x0,_0x58e998=events[_0x7a11('0x3')];_0x5c89cc<_0x58e998;_0x5c89cc++){var _0x3e206c=events[_0x5c89cc];var _0x1b6e4a=createListener(_0x7a11('0x4')+_0x3e206c,_0x1bd312);TeamEvents['on'](_0x3e206c,_0x1b6e4a);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 9db934a..8f1145f 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 _0x000c=['put','update','/:id','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','show','post','create'];(function(_0x261ec5,_0x12d251){var _0x216953=function(_0x1c61f3){while(--_0x1c61f3){_0x261ec5['push'](_0x261ec5['shift']());}};_0x216953(++_0x12d251);}(_0x000c,0xd5));var _0xc000=function(_0x29518a,_0x299281){_0x29518a=_0x29518a-0x0;var _0x38e228=_0x000c[_0x29518a];return _0x38e228;};'use strict';var multer=require(_0xc000('0x0'));var util=require(_0xc000('0x1'));var path=require(_0xc000('0x2'));var timeout=require(_0xc000('0x3'));var express=require(_0xc000('0x4'));var router=express[_0xc000('0x5')]();var auth=require(_0xc000('0x6'));var interaction=require(_0xc000('0x7'));var config=require(_0xc000('0x8'));var controller=require(_0xc000('0x9'));router[_0xc000('0xa')]('/',auth[_0xc000('0xb')](),controller['index']);router[_0xc000('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc000('0xc')]);router[_0xc000('0xd')]('/',auth[_0xc000('0xb')](),controller[_0xc000('0xe')]);router[_0xc000('0xf')]('/:id',auth[_0xc000('0xb')](),controller[_0xc000('0x10')]);router['delete'](_0xc000('0x11'),auth['isAuthenticated'](),controller[_0xc000('0x12')]);module['exports']=router; \ No newline at end of file +var _0x227f=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4f2930,_0x40ad4b){var _0x397db7=function(_0x2d9204){while(--_0x2d9204){_0x4f2930['push'](_0x4f2930['shift']());}};_0x397db7(++_0x40ad4b);}(_0x227f,0x73));var _0xf227=function(_0x4084d7,_0x4273fc){_0x4084d7=_0x4084d7-0x0;var _0x107a83=_0x227f[_0x4084d7];return _0x107a83;};'use strict';var multer=require(_0xf227('0x0'));var util=require(_0xf227('0x1'));var path=require(_0xf227('0x2'));var timeout=require(_0xf227('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xf227('0x4'));var interaction=require(_0xf227('0x5'));var config=require(_0xf227('0x6'));var controller=require('./template.controller');router[_0xf227('0x7')]('/',auth[_0xf227('0x8')](),controller['index']);router[_0xf227('0x7')]('/:id',auth[_0xf227('0x8')](),controller[_0xf227('0x9')]);router['post']('/',auth[_0xf227('0x8')](),controller[_0xf227('0xa')]);router[_0xf227('0xb')](_0xf227('0xc'),auth[_0xf227('0x8')](),controller[_0xf227('0xd')]);router[_0xf227('0xe')]('/:id',auth[_0xf227('0x8')](),controller[_0xf227('0xf')]);module[_0xf227('0x10')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 87f497b..4257111 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 _0x819f=['sequelize','STRING','TEXT'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x819f,0x123));var _0xf819=function(_0x1840b1,_0x2d021e){_0x1840b1=_0x1840b1-0x0;var _0x54ee73=_0x819f[_0x1840b1];return _0x54ee73;};'use strict';var Sequelize=require(_0xf819('0x0'));module['exports']={'name':{'type':Sequelize[_0xf819('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xf819('0x2')]}}; \ No newline at end of file +var _0xa357=['exports','STRING','TEXT'];(function(_0x199a37,_0x5f545d){var _0x48d080=function(_0x21ae7a){while(--_0x21ae7a){_0x199a37['push'](_0x199a37['shift']());}};_0x48d080(++_0x5f545d);}(_0xa357,0x19b));var _0x7a35=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0xa357[_0x15c421];return _0x5e5ed5;};'use strict';var Sequelize=require('sequelize');module[_0x7a35('0x0')]={'name':{'type':Sequelize[_0x7a35('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x7a35('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 42a4327..68ab253 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 _0xd7b4=['../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','update','then','destroy','get','end','stack','name','index','Template','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','key','VIRTUAL','field','filter','options','count','includeAll','include','findAll','catch','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware'];(function(_0xe3a46,_0x4f9273){var _0x5bb333=function(_0x2eedc5){while(--_0x2eedc5){_0xe3a46['push'](_0xe3a46['shift']());}};_0x5bb333(++_0x4f9273);}(_0xd7b4,0x8c));var _0x4d7b=function(_0x69062,_0x231f82){_0x69062=_0x69062-0x0;var _0x3dabab=_0xd7b4[_0x69062];return _0x3dabab;};'use strict';var pdf=require(_0x4d7b('0x0'));var emlformat=require(_0x4d7b('0x1'));var rimraf=require(_0x4d7b('0x2'));var zipdir=require(_0x4d7b('0x3'));var jsonpatch=require(_0x4d7b('0x4'));var rp=require(_0x4d7b('0x5'));var moment=require(_0x4d7b('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x4d7b('0x7'));var util=require(_0x4d7b('0x8'));var path=require(_0x4d7b('0x9'));var sox=require(_0x4d7b('0xa'));var csv=require(_0x4d7b('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x4d7b('0xc'));var crypto=require(_0x4d7b('0xd'));var jsforce=require(_0x4d7b('0xe'));var deskjs=require(_0x4d7b('0xf'));var toCsv=require(_0x4d7b('0xb'));var querystring=require(_0x4d7b('0x10'));var Papa=require(_0x4d7b('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4d7b('0x12'));var hardwareService=require(_0x4d7b('0x13'));var logger=require(_0x4d7b('0x14'))(_0x4d7b('0x15'));var utils=require(_0x4d7b('0x16'));var config=require('../../config/environment');var db=require(_0x4d7b('0x17'))['db'];function respondWithStatusCode(_0x180c26,_0x54ef1e){_0x54ef1e=_0x54ef1e||0xcc;return function(_0x5e1d4b){if(_0x5e1d4b){return _0x180c26[_0x4d7b('0x18')](_0x54ef1e);}return _0x180c26[_0x4d7b('0x19')](_0x54ef1e)['end']();};}function respondWithResult(_0x226e8e,_0x14fe1c){_0x14fe1c=_0x14fe1c||0xc8;return function(_0x27b0ba){if(_0x27b0ba){return _0x226e8e[_0x4d7b('0x19')](_0x14fe1c)[_0x4d7b('0x1a')](_0x27b0ba);}};}function respondWithFilteredResult(_0x139f42,_0x152125){return function(_0x5ab265){if(_0x5ab265){var _0x428ea2=_0x5ab265['count'],_0x1cc987=_0x152125['offset'],_0x479d99=_0x152125[_0x4d7b('0x1b')]+_0x152125[_0x4d7b('0x1c')],_0x196b31;if(_0x479d99>=_0x428ea2){_0x479d99=_0x428ea2;_0x196b31=0xc8;}else{_0x196b31=0xce;}_0x139f42['status'](_0x196b31);return _0x139f42[_0x4d7b('0x1d')](_0x4d7b('0x1e'),_0x1cc987+'-'+_0x479d99+'/'+_0x428ea2)[_0x4d7b('0x1a')](_0x5ab265);}return null;};}function patchUpdates(_0x539c4d){return function(_0xac1874){try{jsonpatch[_0x4d7b('0x1f')](_0xac1874,_0x539c4d,!![]);}catch(_0x308659){return BPromise['reject'](_0x308659);}return _0xac1874['save']();};}function saveUpdates(_0x262b2f,_0x17a7c7){return function(_0x4bc1ef){if(_0x4bc1ef){return _0x4bc1ef[_0x4d7b('0x20')](_0x262b2f)[_0x4d7b('0x21')](function(_0x38cba5){return _0x38cba5;});}return null;};}function removeEntity(_0x15d94f,_0x26ff29){return function(_0x2bf72f){if(_0x2bf72f){return _0x2bf72f[_0x4d7b('0x22')]()[_0x4d7b('0x21')](function(){var _0x88567e=_0x2bf72f[_0x4d7b('0x23')]({'plain':!![]});var _0x596834='Templates';return db['UserProfileResource']['destroy']({'where':{'type':_0x596834,'resourceId':_0x88567e['id']}})['then'](function(){return _0x2bf72f;});})[_0x4d7b('0x21')](function(){_0x15d94f[_0x4d7b('0x19')](0xcc)[_0x4d7b('0x24')]();});}};}function handleEntityNotFound(_0x542b14,_0x2a9a54){return function(_0x57dbab){if(!_0x57dbab){_0x542b14[_0x4d7b('0x18')](0x194);}return _0x57dbab;};}function handleError(_0x122aec,_0x54aac2){_0x54aac2=_0x54aac2||0x1f4;return function(_0x1112a6){logger['error'](_0x1112a6[_0x4d7b('0x25')]);if(_0x1112a6['name']){delete _0x1112a6[_0x4d7b('0x26')];}_0x122aec[_0x4d7b('0x19')](_0x54aac2)['send'](_0x1112a6);};}exports[_0x4d7b('0x27')]=function(_0x2223ba,_0x158891){var _0x5809b1={},_0x5c7a61={},_0x2e98d8={'count':0x0,'rows':[]};var _0x484cf3=db[_0x4d7b('0x28')]['rawAttributes'];_0x5c7a61[_0x4d7b('0x29')]=_['keys'](_0x484cf3);_0x5c7a61['query']=_['keys'](_0x2223ba[_0x4d7b('0x2a')]);_0x5c7a61[_0x4d7b('0x2b')]=_[_0x4d7b('0x2c')](_0x5c7a61['model'],_0x5c7a61[_0x4d7b('0x2a')]);_0x5809b1[_0x4d7b('0x2d')]=_[_0x4d7b('0x2c')](_0x5c7a61[_0x4d7b('0x29')],qs[_0x4d7b('0x2e')](_0x2223ba[_0x4d7b('0x2a')][_0x4d7b('0x2e')]));_0x5809b1[_0x4d7b('0x2d')]=_0x5809b1['attributes'][_0x4d7b('0x2f')]?_0x5809b1['attributes']:_0x5c7a61[_0x4d7b('0x29')];if(!_0x2223ba[_0x4d7b('0x2a')][_0x4d7b('0x30')](_0x4d7b('0x31'))){_0x5809b1[_0x4d7b('0x1c')]=qs[_0x4d7b('0x1c')](_0x2223ba[_0x4d7b('0x2a')][_0x4d7b('0x1c')]);_0x5809b1['offset']=qs[_0x4d7b('0x1b')](_0x2223ba[_0x4d7b('0x2a')]['offset']);}_0x5809b1[_0x4d7b('0x32')]=qs['sort'](_0x2223ba[_0x4d7b('0x2a')][_0x4d7b('0x33')]);_0x5809b1[_0x4d7b('0x34')]=qs['filters'](_[_0x4d7b('0x35')](_0x2223ba[_0x4d7b('0x2a')],_0x5c7a61[_0x4d7b('0x2b')]));if(_0x2223ba[_0x4d7b('0x2a')]['filter']){_0x5809b1[_0x4d7b('0x34')]=_[_0x4d7b('0x36')](_0x5809b1[_0x4d7b('0x34')],{'$or':_['map'](_0x484cf3,function(_0x163f97){if(_0x163f97[_0x4d7b('0x37')][_0x4d7b('0x38')]!==_0x4d7b('0x39')){var _0x56e065={};_0x56e065[_0x163f97[_0x4d7b('0x3a')]]={'$like':'%'+_0x2223ba[_0x4d7b('0x2a')][_0x4d7b('0x3b')]+'%'};return _0x56e065;}})});}_0x5809b1=_[_0x4d7b('0x36')]({},_0x5809b1,_0x2223ba[_0x4d7b('0x3c')]);var _0x45a413={'where':_0x5809b1['where']};return db[_0x4d7b('0x28')][_0x4d7b('0x3d')](_0x45a413)[_0x4d7b('0x21')](function(_0x40848e){_0x2e98d8[_0x4d7b('0x3d')]=_0x40848e;if(_0x2223ba[_0x4d7b('0x2a')][_0x4d7b('0x3e')]){_0x5809b1[_0x4d7b('0x3f')]=[{'all':!![]}];}return db[_0x4d7b('0x28')][_0x4d7b('0x40')](_0x5809b1);})[_0x4d7b('0x21')](function(_0x1595ca){_0x2e98d8['rows']=_0x1595ca;return _0x2e98d8;})[_0x4d7b('0x21')](respondWithFilteredResult(_0x158891,_0x5809b1))[_0x4d7b('0x41')](handleError(_0x158891,null));};exports['show']=function(_0x49d435,_0x491d2f){var _0x25a306={'raw':!![],'where':{'id':_0x49d435['params']['id']}},_0x53deb0={};_0x53deb0[_0x4d7b('0x29')]=_[_0x4d7b('0x42')](db[_0x4d7b('0x28')]['rawAttributes']);_0x53deb0['query']=_[_0x4d7b('0x42')](_0x49d435['query']);_0x53deb0[_0x4d7b('0x2b')]=_[_0x4d7b('0x2c')](_0x53deb0[_0x4d7b('0x29')],_0x53deb0[_0x4d7b('0x2a')]);_0x25a306[_0x4d7b('0x2d')]=_['intersection'](_0x53deb0['model'],qs[_0x4d7b('0x2e')](_0x49d435[_0x4d7b('0x2a')]['fields']));_0x25a306[_0x4d7b('0x2d')]=_0x25a306[_0x4d7b('0x2d')]['length']?_0x25a306['attributes']:_0x53deb0['model'];if(_0x49d435['query'][_0x4d7b('0x3e')]){_0x25a306[_0x4d7b('0x3f')]=[{'all':!![]}];}_0x25a306=_['merge']({},_0x25a306,_0x49d435['options']);return db[_0x4d7b('0x28')][_0x4d7b('0x43')](_0x25a306)[_0x4d7b('0x21')](handleEntityNotFound(_0x491d2f,null))[_0x4d7b('0x21')](respondWithResult(_0x491d2f,null))[_0x4d7b('0x41')](handleError(_0x491d2f,null));};exports[_0x4d7b('0x44')]=function(_0xf80011,_0x26260a){return db['Template'][_0x4d7b('0x44')](_0xf80011[_0x4d7b('0x45')],{})[_0x4d7b('0x21')](function(_0x4d1acc){var _0xab0572=_0xf80011[_0x4d7b('0x46')][_0x4d7b('0x23')]({'plain':!![]});if(!_0xab0572)throw new Error(_0x4d7b('0x47'));if(_0xab0572[_0x4d7b('0x48')]===_0x4d7b('0x46')){var _0x2e0ff0=_0x4d1acc[_0x4d7b('0x23')]({'plain':!![]});var _0x9ad030=_0x4d7b('0x49');return db[_0x4d7b('0x4a')][_0x4d7b('0x43')]({'where':{'name':_0x9ad030,'userProfileId':_0xab0572[_0x4d7b('0x4b')]},'raw':!![]})['then'](function(_0x5d4fe2){if(_0x5d4fe2&&_0x5d4fe2[_0x4d7b('0x4c')]===0x0){return db['UserProfileResource'][_0x4d7b('0x44')]({'name':_0x2e0ff0[_0x4d7b('0x26')],'resourceId':_0x2e0ff0['id'],'type':_0x5d4fe2['name'],'sectionId':_0x5d4fe2['id']},{})['then'](function(){return _0x4d1acc;});}else{return _0x4d1acc;}})['catch'](function(_0x59ec6d){logger[_0x4d7b('0x4d')](_0x4d7b('0x4e'),_0x59ec6d);throw _0x59ec6d;});}return _0x4d1acc;})[_0x4d7b('0x21')](respondWithResult(_0x26260a,0xc9))[_0x4d7b('0x41')](handleError(_0x26260a,null));};exports[_0x4d7b('0x20')]=function(_0x10710c,_0x214a81){if(_0x10710c[_0x4d7b('0x45')]['id']){delete _0x10710c[_0x4d7b('0x45')]['id'];}return db['Template'][_0x4d7b('0x43')]({'where':{'id':_0x10710c[_0x4d7b('0x4f')]['id']}})[_0x4d7b('0x21')](handleEntityNotFound(_0x214a81,null))[_0x4d7b('0x21')](saveUpdates(_0x10710c[_0x4d7b('0x45')],null))[_0x4d7b('0x21')](respondWithResult(_0x214a81,null))[_0x4d7b('0x41')](handleError(_0x214a81,null));};exports[_0x4d7b('0x22')]=function(_0x43d420,_0x303b05){return db[_0x4d7b('0x28')][_0x4d7b('0x43')]({'where':{'id':_0x43d420[_0x4d7b('0x4f')]['id']}})[_0x4d7b('0x21')](handleEntityNotFound(_0x303b05,null))[_0x4d7b('0x21')](removeEntity(_0x303b05,null))[_0x4d7b('0x41')](handleError(_0x303b05,null));}; \ No newline at end of file +var _0xeefc=['nolimit','order','sort','pick','filter','where','merge','type','key','VIRTUAL','field','Template','includeAll','include','findAll','rows','catch','params','options','find','create','user','role','get','Templates','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','count','offset','limit','status','set','Content-Range','json','reject','save','update','then','destroy','UserProfileResource','end','error','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x1a7fb4,_0x4d8b3c){var _0x1015f4=function(_0x1b899c){while(--_0x1b899c){_0x1a7fb4['push'](_0x1a7fb4['shift']());}};_0x1015f4(++_0x4d8b3c);}(_0xeefc,0x117));var _0xceef=function(_0x5f198c,_0x13491f){_0x5f198c=_0x5f198c-0x0;var _0x45fc65=_0xeefc[_0x5f198c];return _0x45fc65;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xceef('0x0'));var zipdir=require(_0xceef('0x1'));var jsonpatch=require(_0xceef('0x2'));var rp=require(_0xceef('0x3'));var moment=require(_0xceef('0x4'));var BPromise=require(_0xceef('0x5'));var Mustache=require(_0xceef('0x6'));var util=require(_0xceef('0x7'));var path=require('path');var sox=require(_0xceef('0x8'));var csv=require(_0xceef('0x9'));var ejs=require(_0xceef('0xa'));var fs=require('fs');var _=require(_0xceef('0xb'));var squel=require(_0xceef('0xc'));var crypto=require(_0xceef('0xd'));var jsforce=require(_0xceef('0xe'));var deskjs=require(_0xceef('0xf'));var toCsv=require(_0xceef('0x9'));var querystring=require(_0xceef('0x10'));var Papa=require('papaparse');var Redis=require(_0xceef('0x11'));var authService=require(_0xceef('0x12'));var qs=require(_0xceef('0x13'));var hardwareService=require(_0xceef('0x14'));var logger=require('../../config/logger')(_0xceef('0x15'));var utils=require(_0xceef('0x16'));var config=require(_0xceef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d03db,_0x181a39){_0x181a39=_0x181a39||0xcc;return function(_0x336965){if(_0x336965){return _0x2d03db[_0xceef('0x18')](_0x181a39);}return _0x2d03db['status'](_0x181a39)['end']();};}function respondWithResult(_0x2adb1b,_0x2e48d0){_0x2e48d0=_0x2e48d0||0xc8;return function(_0x50adbe){if(_0x50adbe){return _0x2adb1b['status'](_0x2e48d0)['json'](_0x50adbe);}};}function respondWithFilteredResult(_0x526989,_0x555c58){return function(_0x1ce710){if(_0x1ce710){var _0x126b28=_0x1ce710[_0xceef('0x19')],_0x55839e=_0x555c58[_0xceef('0x1a')],_0x1bb627=_0x555c58['offset']+_0x555c58[_0xceef('0x1b')],_0x46e28d;if(_0x1bb627>=_0x126b28){_0x1bb627=_0x126b28;_0x46e28d=0xc8;}else{_0x46e28d=0xce;}_0x526989[_0xceef('0x1c')](_0x46e28d);return _0x526989[_0xceef('0x1d')](_0xceef('0x1e'),_0x55839e+'-'+_0x1bb627+'/'+_0x126b28)[_0xceef('0x1f')](_0x1ce710);}return null;};}function patchUpdates(_0x5dad12){return function(_0x80e5a1){try{jsonpatch['apply'](_0x80e5a1,_0x5dad12,!![]);}catch(_0x25bd92){return BPromise[_0xceef('0x20')](_0x25bd92);}return _0x80e5a1[_0xceef('0x21')]();};}function saveUpdates(_0x59b94,_0x2ae6c1){return function(_0x2125f8){if(_0x2125f8){return _0x2125f8[_0xceef('0x22')](_0x59b94)[_0xceef('0x23')](function(_0x426511){return _0x426511;});}return null;};}function removeEntity(_0x58c3e8,_0x26c126){return function(_0x57a9c0){if(_0x57a9c0){return _0x57a9c0[_0xceef('0x24')]()[_0xceef('0x23')](function(){var _0xb467b8=_0x57a9c0['get']({'plain':!![]});var _0x3b2122='Templates';return db[_0xceef('0x25')]['destroy']({'where':{'type':_0x3b2122,'resourceId':_0xb467b8['id']}})[_0xceef('0x23')](function(){return _0x57a9c0;});})[_0xceef('0x23')](function(){_0x58c3e8[_0xceef('0x1c')](0xcc)[_0xceef('0x26')]();});}};}function handleEntityNotFound(_0x1d33d9,_0x562e67){return function(_0x187377){if(!_0x187377){_0x1d33d9[_0xceef('0x18')](0x194);}return _0x187377;};}function handleError(_0x138b9c,_0x57375d){_0x57375d=_0x57375d||0x1f4;return function(_0xb39bc8){logger[_0xceef('0x27')](_0xb39bc8['stack']);if(_0xb39bc8['name']){delete _0xb39bc8[_0xceef('0x28')];}_0x138b9c[_0xceef('0x1c')](_0x57375d)[_0xceef('0x29')](_0xb39bc8);};}exports[_0xceef('0x2a')]=function(_0xf696f6,_0xf41954){var _0x2a3557={},_0x18d72c={},_0x438a00={'count':0x0,'rows':[]};var _0x111295=db['Template'][_0xceef('0x2b')];_0x18d72c[_0xceef('0x2c')]=_[_0xceef('0x2d')](_0x111295);_0x18d72c[_0xceef('0x2e')]=_[_0xceef('0x2d')](_0xf696f6['query']);_0x18d72c[_0xceef('0x2f')]=_[_0xceef('0x30')](_0x18d72c[_0xceef('0x2c')],_0x18d72c['query']);_0x2a3557[_0xceef('0x31')]=_[_0xceef('0x30')](_0x18d72c[_0xceef('0x2c')],qs[_0xceef('0x32')](_0xf696f6[_0xceef('0x2e')]['fields']));_0x2a3557[_0xceef('0x31')]=_0x2a3557[_0xceef('0x31')][_0xceef('0x33')]?_0x2a3557['attributes']:_0x18d72c[_0xceef('0x2c')];if(!_0xf696f6['query'][_0xceef('0x34')](_0xceef('0x35'))){_0x2a3557[_0xceef('0x1b')]=qs[_0xceef('0x1b')](_0xf696f6[_0xceef('0x2e')][_0xceef('0x1b')]);_0x2a3557['offset']=qs[_0xceef('0x1a')](_0xf696f6[_0xceef('0x2e')][_0xceef('0x1a')]);}_0x2a3557[_0xceef('0x36')]=qs[_0xceef('0x37')](_0xf696f6[_0xceef('0x2e')][_0xceef('0x37')]);_0x2a3557['where']=qs[_0xceef('0x2f')](_[_0xceef('0x38')](_0xf696f6['query'],_0x18d72c[_0xceef('0x2f')]));if(_0xf696f6['query'][_0xceef('0x39')]){_0x2a3557[_0xceef('0x3a')]=_[_0xceef('0x3b')](_0x2a3557[_0xceef('0x3a')],{'$or':_['map'](_0x111295,function(_0x53bd8a){if(_0x53bd8a[_0xceef('0x3c')][_0xceef('0x3d')]!==_0xceef('0x3e')){var _0x12f7e7={};_0x12f7e7[_0x53bd8a[_0xceef('0x3f')]]={'$like':'%'+_0xf696f6[_0xceef('0x2e')][_0xceef('0x39')]+'%'};return _0x12f7e7;}})});}_0x2a3557=_[_0xceef('0x3b')]({},_0x2a3557,_0xf696f6['options']);var _0x536951={'where':_0x2a3557[_0xceef('0x3a')]};return db[_0xceef('0x40')][_0xceef('0x19')](_0x536951)[_0xceef('0x23')](function(_0x4f5a54){_0x438a00['count']=_0x4f5a54;if(_0xf696f6[_0xceef('0x2e')][_0xceef('0x41')]){_0x2a3557[_0xceef('0x42')]=[{'all':!![]}];}return db[_0xceef('0x40')][_0xceef('0x43')](_0x2a3557);})['then'](function(_0x1771d5){_0x438a00[_0xceef('0x44')]=_0x1771d5;return _0x438a00;})[_0xceef('0x23')](respondWithFilteredResult(_0xf41954,_0x2a3557))[_0xceef('0x45')](handleError(_0xf41954,null));};exports['show']=function(_0x2907cf,_0xe6901e){var _0x2e1708={'raw':!![],'where':{'id':_0x2907cf[_0xceef('0x46')]['id']}},_0x5f5794={};_0x5f5794[_0xceef('0x2c')]=_[_0xceef('0x2d')](db[_0xceef('0x40')][_0xceef('0x2b')]);_0x5f5794['query']=_[_0xceef('0x2d')](_0x2907cf['query']);_0x5f5794[_0xceef('0x2f')]=_['intersection'](_0x5f5794['model'],_0x5f5794[_0xceef('0x2e')]);_0x2e1708['attributes']=_['intersection'](_0x5f5794[_0xceef('0x2c')],qs[_0xceef('0x32')](_0x2907cf[_0xceef('0x2e')]['fields']));_0x2e1708['attributes']=_0x2e1708[_0xceef('0x31')][_0xceef('0x33')]?_0x2e1708['attributes']:_0x5f5794['model'];if(_0x2907cf['query']['includeAll']){_0x2e1708[_0xceef('0x42')]=[{'all':!![]}];}_0x2e1708=_['merge']({},_0x2e1708,_0x2907cf[_0xceef('0x47')]);return db[_0xceef('0x40')][_0xceef('0x48')](_0x2e1708)[_0xceef('0x23')](handleEntityNotFound(_0xe6901e,null))[_0xceef('0x23')](respondWithResult(_0xe6901e,null))['catch'](handleError(_0xe6901e,null));};exports[_0xceef('0x49')]=function(_0x13d3c6,_0x2a9f70){return db[_0xceef('0x40')][_0xceef('0x49')](_0x13d3c6['body'],{})['then'](function(_0x418c2a){var _0x7dcaaa=_0x13d3c6[_0xceef('0x4a')]['get']({'plain':!![]});if(!_0x7dcaaa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7dcaaa[_0xceef('0x4b')]===_0xceef('0x4a')){var _0x47a4c8=_0x418c2a[_0xceef('0x4c')]({'plain':!![]});var _0x19f3f0=_0xceef('0x4d');return db[_0xceef('0x4e')][_0xceef('0x48')]({'where':{'name':_0x19f3f0,'userProfileId':_0x7dcaaa[_0xceef('0x4f')]},'raw':!![]})['then'](function(_0x211337){if(_0x211337&&_0x211337[_0xceef('0x50')]===0x0){return db[_0xceef('0x25')][_0xceef('0x49')]({'name':_0x47a4c8[_0xceef('0x28')],'resourceId':_0x47a4c8['id'],'type':_0x211337[_0xceef('0x28')],'sectionId':_0x211337['id']},{})[_0xceef('0x23')](function(){return _0x418c2a;});}else{return _0x418c2a;}})[_0xceef('0x45')](function(_0x708d9){logger[_0xceef('0x27')](_0xceef('0x51'),_0x708d9);throw _0x708d9;});}return _0x418c2a;})[_0xceef('0x23')](respondWithResult(_0x2a9f70,0xc9))[_0xceef('0x45')](handleError(_0x2a9f70,null));};exports[_0xceef('0x22')]=function(_0x80d19b,_0x27c6d7){if(_0x80d19b[_0xceef('0x52')]['id']){delete _0x80d19b[_0xceef('0x52')]['id'];}return db[_0xceef('0x40')][_0xceef('0x48')]({'where':{'id':_0x80d19b['params']['id']}})['then'](handleEntityNotFound(_0x27c6d7,null))[_0xceef('0x23')](saveUpdates(_0x80d19b[_0xceef('0x52')],null))[_0xceef('0x23')](respondWithResult(_0x27c6d7,null))['catch'](handleError(_0x27c6d7,null));};exports[_0xceef('0x24')]=function(_0x541c06,_0x48d136){return db[_0xceef('0x40')]['find']({'where':{'id':_0x541c06[_0xceef('0x46')]['id']}})[_0xceef('0x23')](handleEntityNotFound(_0x48d136,null))[_0xceef('0x23')](removeEntity(_0x48d136,null))['catch'](handleError(_0x48d136,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 3eefa49..759af84 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 _0x0b0e=['path','rimraf','../../config/environment','./template.attributes','exports','define','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x18a105,_0x497a22){var _0x3e40a9=function(_0x1ad4ea){while(--_0x1ad4ea){_0x18a105['push'](_0x18a105['shift']());}};_0x3e40a9(++_0x497a22);}(_0x0b0e,0x187));var _0xe0b0=function(_0x547e20,_0x284545){_0x547e20=_0x547e20-0x0;var _0x359171=_0x0b0e[_0x547e20];return _0x359171;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var logger=require(_0xe0b0('0x1'))('api');var moment=require(_0xe0b0('0x2'));var BPromise=require(_0xe0b0('0x3'));var rp=require(_0xe0b0('0x4'));var fs=require('fs');var path=require(_0xe0b0('0x5'));var rimraf=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var attributes=require(_0xe0b0('0x8'));module[_0xe0b0('0x9')]=function(_0x30e20d,_0x28e40f){return _0x30e20d[_0xe0b0('0xa')]('Template',attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa571=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','Template','tools_templates','lodash'];(function(_0x5432c3,_0x2bf766){var _0x2fd00c=function(_0x5a4bf3){while(--_0x5a4bf3){_0x5432c3['push'](_0x5432c3['shift']());}};_0x2fd00c(++_0x2bf766);}(_0xa571,0x107));var _0x1a57=function(_0x1ddd51,_0x1d68f9){_0x1ddd51=_0x1ddd51-0x0;var _0x3c5dc7=_0xa571[_0x1ddd51];return _0x3c5dc7;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var logger=require(_0x1a57('0x2'))(_0x1a57('0x3'));var moment=require('moment');var BPromise=require(_0x1a57('0x4'));var rp=require(_0x1a57('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1a57('0x6'));var attributes=require('./template.attributes');module[_0x1a57('0x7')]=function(_0xd97a33,_0x22ca20){return _0xd97a33[_0x1a57('0x8')](_0x1a57('0x9'),attributes,{'tableName':_0x1a57('0xa'),'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 93e8041..fa3034e 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 _0x8004=['error','code','message','result','GetTemplate','Template','raw','options','attributes','map','include','model','stringify','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','Template,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0x8004,0x176));var _0x4800=function(_0x2dc2e6,_0x53376e){_0x2dc2e6=_0x2dc2e6-0x0;var _0x2facf3=_0x8004[_0x2dc2e6];return _0x2facf3;};'use strict';var _=require(_0x4800('0x0'));var util=require(_0x4800('0x1'));var moment=require('moment');var BPromise=require(_0x4800('0x2'));var rs=require(_0x4800('0x3'));var fs=require('fs');var Redis=require(_0x4800('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4800('0x5'));var logger=require(_0x4800('0x6'))(_0x4800('0x7'));var config=require('../../config/environment');var jayson=require(_0x4800('0x8'));var client=jayson[_0x4800('0x9')][_0x4800('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1def6d,_0x345764,_0x373c47){return new BPromise(function(_0x134631,_0x3f9ecf){return client['request'](_0x1def6d,_0x373c47)[_0x4800('0xb')](function(_0x205a46){logger[_0x4800('0xc')](_0x4800('0xd'),_0x345764,_0x4800('0xe'));logger[_0x4800('0xf')]('Template,\x20%s,\x20%s,\x20%s',_0x345764,_0x4800('0xe'),JSON['stringify'](_0x205a46));if(_0x205a46['error']){if(_0x205a46[_0x4800('0x10')][_0x4800('0x11')]===0x1f4){logger[_0x4800('0x10')](_0x4800('0xd'),_0x345764,_0x205a46[_0x4800('0x10')][_0x4800('0x12')]);return _0x3f9ecf(_0x205a46[_0x4800('0x10')][_0x4800('0x12')]);}logger[_0x4800('0x10')](_0x4800('0xd'),_0x345764,_0x205a46[_0x4800('0x10')][_0x4800('0x12')]);return _0x134631(_0x205a46[_0x4800('0x10')][_0x4800('0x12')]);}else{logger[_0x4800('0xc')]('Template,\x20%s,\x20%s',_0x345764,_0x4800('0xe'));_0x134631(_0x205a46[_0x4800('0x13')][_0x4800('0x12')]);}})['catch'](function(_0x54f072){logger[_0x4800('0x10')](_0x4800('0xd'),_0x345764,_0x54f072);_0x3f9ecf(_0x54f072);});});}exports[_0x4800('0x14')]=function(_0x416962){var _0x1d2baa=this;return new Promise(function(_0x14a029,_0xc0d84e){return db[_0x4800('0x15')]['findAll']({'raw':_0x416962['options']?_0x416962['options'][_0x4800('0x16')]===undefined?!![]:![]:!![],'where':_0x416962[_0x4800('0x17')]?_0x416962['options']['where']||null:null,'attributes':_0x416962['options']?_0x416962[_0x4800('0x17')][_0x4800('0x18')]||null:null,'limit':_0x416962[_0x4800('0x17')]?_0x416962[_0x4800('0x17')]['limit']||null:null,'include':_0x416962[_0x4800('0x17')]?_0x416962['options']['include']?_[_0x4800('0x19')](_0x416962['options'][_0x4800('0x1a')],function(_0x22f7af){return{'model':db[_0x22f7af[_0x4800('0x1b')]],'as':_0x22f7af['as'],'attributes':_0x22f7af[_0x4800('0x18')],'include':_0x22f7af[_0x4800('0x1a')]?_[_0x4800('0x19')](_0x22f7af[_0x4800('0x1a')],function(_0x43820e){return{'model':db[_0x43820e[_0x4800('0x1b')]],'as':_0x43820e['as'],'attributes':_0x43820e[_0x4800('0x18')],'include':_0x43820e[_0x4800('0x1a')]?_[_0x4800('0x19')](_0x43820e[_0x4800('0x1a')],function(_0x2767bb){return{'model':db[_0x2767bb['model']],'as':_0x2767bb['as'],'attributes':_0x2767bb[_0x4800('0x18')]};}):[]};}):[]};}):[]:[]})[_0x4800('0xb')](function(_0x4e518b){logger[_0x4800('0xc')]('GetTemplate',_0x416962);logger['debug']('GetTemplate',_0x416962,JSON[_0x4800('0x1c')](_0x4e518b));_0x14a029(_0x4e518b);})[_0x4800('0x1d')](function(_0xbdd431){logger[_0x4800('0x10')](_0x4800('0x14'),_0xbdd431[_0x4800('0x12')],_0x416962);_0xc0d84e(_0x1d2baa['error'](0x1f4,_0xbdd431[_0x4800('0x12')]));});});}; \ No newline at end of file +var _0xd14e=['http','request','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','Template,\x20%s,\x20%s','message','result','catch','GetTemplate','Template','findAll','options','raw','where','limit','include','attributes','model','map','then','info','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd14e,0xc8));var _0xed14=function(_0x40d8a7,_0x463476){_0x40d8a7=_0x40d8a7-0x0;var _0x3feb17=_0xd14e[_0x40d8a7];return _0x3feb17;};'use strict';var _=require(_0xed14('0x0'));var util=require(_0xed14('0x1'));var moment=require(_0xed14('0x2'));var BPromise=require(_0xed14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed14('0x4'));var db=require(_0xed14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xed14('0x6'))(_0xed14('0x7'));var config=require(_0xed14('0x8'));var jayson=require(_0xed14('0x9'));var client=jayson['client'][_0xed14('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a91a6,_0x4d5e06,_0x135647){return new BPromise(function(_0x124470,_0x25b737){return client[_0xed14('0xb')](_0x2a91a6,_0x135647)['then'](function(_0x5ee823){logger['info']('Template,\x20%s,\x20%s',_0x4d5e06,_0xed14('0xc'));logger['debug'](_0xed14('0xd'),_0x4d5e06,_0xed14('0xc'),JSON[_0xed14('0xe')](_0x5ee823));if(_0x5ee823[_0xed14('0xf')]){if(_0x5ee823[_0xed14('0xf')][_0xed14('0x10')]===0x1f4){logger['error'](_0xed14('0x11'),_0x4d5e06,_0x5ee823[_0xed14('0xf')][_0xed14('0x12')]);return _0x25b737(_0x5ee823['error'][_0xed14('0x12')]);}logger[_0xed14('0xf')]('Template,\x20%s,\x20%s',_0x4d5e06,_0x5ee823[_0xed14('0xf')][_0xed14('0x12')]);return _0x124470(_0x5ee823[_0xed14('0xf')][_0xed14('0x12')]);}else{logger['info'](_0xed14('0x11'),_0x4d5e06,_0xed14('0xc'));_0x124470(_0x5ee823[_0xed14('0x13')][_0xed14('0x12')]);}})[_0xed14('0x14')](function(_0x33ca0f){logger[_0xed14('0xf')](_0xed14('0x11'),_0x4d5e06,_0x33ca0f);_0x25b737(_0x33ca0f);});});}exports[_0xed14('0x15')]=function(_0x5b465a){var _0x51e33d=this;return new Promise(function(_0x3c9f11,_0x3aa938){return db[_0xed14('0x16')][_0xed14('0x17')]({'raw':_0x5b465a['options']?_0x5b465a[_0xed14('0x18')][_0xed14('0x19')]===undefined?!![]:![]:!![],'where':_0x5b465a[_0xed14('0x18')]?_0x5b465a['options'][_0xed14('0x1a')]||null:null,'attributes':_0x5b465a[_0xed14('0x18')]?_0x5b465a[_0xed14('0x18')]['attributes']||null:null,'limit':_0x5b465a[_0xed14('0x18')]?_0x5b465a[_0xed14('0x18')][_0xed14('0x1b')]||null:null,'include':_0x5b465a[_0xed14('0x18')]?_0x5b465a['options'][_0xed14('0x1c')]?_['map'](_0x5b465a[_0xed14('0x18')][_0xed14('0x1c')],function(_0x1c37d9){return{'model':db[_0x1c37d9['model']],'as':_0x1c37d9['as'],'attributes':_0x1c37d9[_0xed14('0x1d')],'include':_0x1c37d9['include']?_['map'](_0x1c37d9[_0xed14('0x1c')],function(_0x1e983f){return{'model':db[_0x1e983f[_0xed14('0x1e')]],'as':_0x1e983f['as'],'attributes':_0x1e983f['attributes'],'include':_0x1e983f[_0xed14('0x1c')]?_[_0xed14('0x1f')](_0x1e983f[_0xed14('0x1c')],function(_0x112dbd){return{'model':db[_0x112dbd[_0xed14('0x1e')]],'as':_0x112dbd['as'],'attributes':_0x112dbd['attributes']};}):[]};}):[]};}):[]:[]})[_0xed14('0x20')](function(_0x355537){logger[_0xed14('0x21')](_0xed14('0x15'),_0x5b465a);logger[_0xed14('0x22')](_0xed14('0x15'),_0x5b465a,JSON[_0xed14('0xe')](_0x355537));_0x3c9f11(_0x355537);})['catch'](function(_0x13592e){logger[_0xed14('0xf')](_0xed14('0x15'),_0x13592e[_0xed14('0x12')],_0x5b465a);_0x3aa938(_0x51e33d[_0xed14('0xf')](0x1f4,_0x13592e[_0xed14('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 6cb6a9d..fb1a960 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 _0xa9e0=['Router','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','addAllCondition','addAnyCondition','addAction','update','exports','multer','util','path'];(function(_0x298efa,_0x59583d){var _0x449278=function(_0x2a1aa6){while(--_0x2a1aa6){_0x298efa['push'](_0x298efa['shift']());}};_0x449278(++_0x59583d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')]('/:id/any_conditions',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0xf')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);router['put'](_0x0a9e('0x9'),auth['isAuthenticated'](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','addAllCondition','addAnyCondition','addAction','update','exports','multer','util','path'];(function(_0x535128,_0x391f42){var _0x49c1d9=function(_0xa22aff){while(--_0xa22aff){_0x535128['push'](_0x535128['shift']());}};_0x49c1d9(++_0x391f42);}(_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['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')]('/:id/any_conditions',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0xf')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);router['put'](_0x0a9e('0x9'),auth['isAuthenticated'](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index c2ede31..d16b0b6 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 _0xe766=['exports','STRING','sequelize'];(function(_0x2cb99a,_0x2616e7){var _0x458f3a=function(_0x1cef4f){while(--_0x1cef4f){_0x2cb99a['push'](_0x2cb99a['shift']());}};_0x458f3a(++_0x2616e7);}(_0xe766,0x1c1));var _0x6e76=function(_0x1f0714,_0xde0530){_0x1f0714=_0x1f0714-0x0;var _0x33669d=_0xe766[_0x1f0714];return _0x33669d;};'use strict';var Sequelize=require(_0x6e76('0x0'));module[_0x6e76('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x6e76('0x2')]},'description':{'type':Sequelize[_0x6e76('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x1d70=['sequelize','exports','STRING','BOOLEAN'];(function(_0x390713,_0x4d59a0){var _0x3f8a6e=function(_0x10344d){while(--_0x10344d){_0x390713['push'](_0x390713['shift']());}};_0x3f8a6e(++_0x4d59a0);}(_0x1d70,0x170));var _0x01d7=function(_0x42165a,_0x4ff3d9){_0x42165a=_0x42165a-0x0;var _0x18cc18=_0x1d70[_0x42165a];return _0x18cc18;};'use strict';var Sequelize=require(_0x01d7('0x0'));module[_0x01d7('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x01d7('0x2')]},'description':{'type':Sequelize[_0x01d7('0x2')]},'status':{'type':Sequelize[_0x01d7('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 b55eeaa..c327f98 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 _0x93e6=['where','pick','filter','map','type','key','VIRTUAL','field','options','include','findAll','rows','catch','show','rawAttributes','merge','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','params','TriggerAllId','Condition','addAnyCondition','getAllConditions','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','html-pdf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../mysqldb','status','end','json','count','offset','limit','reject','save','update','then','Triggers','destroy','sendStatus','error','stack','name','send','Trigger','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3a4ded,_0x411b49){var _0x447e42=function(_0x3906ac){while(--_0x3906ac){_0x3a4ded['push'](_0x3a4ded['shift']());}};_0x447e42(++_0x411b49);}(_0x93e6,0x11e));var _0x693e=function(_0xfedc72,_0x292f02){_0xfedc72=_0xfedc72-0x0;var _0x2c7c78=_0x93e6[_0xfedc72];return _0x2c7c78;};'use strict';var pdf=require(_0x693e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x693e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x693e('0x2'));var moment=require('moment');var BPromise=require(_0x693e('0x3'));var Mustache=require(_0x693e('0x4'));var util=require(_0x693e('0x5'));var path=require('path');var sox=require(_0x693e('0x6'));var csv=require(_0x693e('0x7'));var ejs=require(_0x693e('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x693e('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x693e('0x7'));var querystring=require(_0x693e('0xa'));var Papa=require(_0x693e('0xb'));var Redis=require('ioredis');var authService=require(_0x693e('0xc'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x693e('0xd'));var logger=require('../../config/logger')(_0x693e('0xe'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x693e('0xf'))['db'];function respondWithStatusCode(_0x3aa887,_0x121fb9){_0x121fb9=_0x121fb9||0xcc;return function(_0x2d894b){if(_0x2d894b){return _0x3aa887['sendStatus'](_0x121fb9);}return _0x3aa887[_0x693e('0x10')](_0x121fb9)[_0x693e('0x11')]();};}function respondWithResult(_0x25c4a7,_0x43ac1a){_0x43ac1a=_0x43ac1a||0xc8;return function(_0x3f5b16){if(_0x3f5b16){return _0x25c4a7[_0x693e('0x10')](_0x43ac1a)[_0x693e('0x12')](_0x3f5b16);}};}function respondWithFilteredResult(_0x4a7626,_0x3a696c){return function(_0x1a47c3){if(_0x1a47c3){var _0xb91404=_0x1a47c3[_0x693e('0x13')],_0x54d946=_0x3a696c[_0x693e('0x14')],_0x18b748=_0x3a696c[_0x693e('0x14')]+_0x3a696c[_0x693e('0x15')],_0x7103b1;if(_0x18b748>=_0xb91404){_0x18b748=_0xb91404;_0x7103b1=0xc8;}else{_0x7103b1=0xce;}_0x4a7626[_0x693e('0x10')](_0x7103b1);return _0x4a7626['set']('Content-Range',_0x54d946+'-'+_0x18b748+'/'+_0xb91404)['json'](_0x1a47c3);}return null;};}function patchUpdates(_0x149325){return function(_0x11407a){try{jsonpatch['apply'](_0x11407a,_0x149325,!![]);}catch(_0x48e04e){return BPromise[_0x693e('0x16')](_0x48e04e);}return _0x11407a[_0x693e('0x17')]();};}function saveUpdates(_0x8b1149,_0x16ca6f){return function(_0x49614c){if(_0x49614c){return _0x49614c[_0x693e('0x18')](_0x8b1149)[_0x693e('0x19')](function(_0x3ce473){return _0x3ce473;});}return null;};}function removeEntity(_0x48f7c2,_0x37d69c){return function(_0x35d033){if(_0x35d033){return _0x35d033['destroy']()[_0x693e('0x19')](function(){var _0x1e5c04=_0x35d033['get']({'plain':!![]});var _0x270bb5=_0x693e('0x1a');return db['UserProfileResource'][_0x693e('0x1b')]({'where':{'type':_0x270bb5,'resourceId':_0x1e5c04['id']}})[_0x693e('0x19')](function(){return _0x35d033;});})[_0x693e('0x19')](function(){_0x48f7c2[_0x693e('0x10')](0xcc)[_0x693e('0x11')]();});}};}function handleEntityNotFound(_0x322924,_0x24b9bf){return function(_0x13fcb9){if(!_0x13fcb9){_0x322924[_0x693e('0x1c')](0x194);}return _0x13fcb9;};}function handleError(_0xafd062,_0x761568){_0x761568=_0x761568||0x1f4;return function(_0x17cbb6){logger[_0x693e('0x1d')](_0x17cbb6[_0x693e('0x1e')]);if(_0x17cbb6[_0x693e('0x1f')]){delete _0x17cbb6[_0x693e('0x1f')];}_0xafd062[_0x693e('0x10')](_0x761568)[_0x693e('0x20')](_0x17cbb6);};}exports['index']=function(_0x3b6156,_0x1c002d){var _0x1ea8e1={},_0x3d350b={},_0x26b9c4={'count':0x0,'rows':[]};var _0x5f3b88=db[_0x693e('0x21')]['rawAttributes'];_0x3d350b[_0x693e('0x22')]=_['keys'](_0x5f3b88);_0x3d350b[_0x693e('0x23')]=_[_0x693e('0x24')](_0x3b6156['query']);_0x3d350b[_0x693e('0x25')]=_[_0x693e('0x26')](_0x3d350b['model'],_0x3d350b[_0x693e('0x23')]);_0x1ea8e1[_0x693e('0x27')]=_[_0x693e('0x26')](_0x3d350b[_0x693e('0x22')],qs[_0x693e('0x28')](_0x3b6156[_0x693e('0x23')][_0x693e('0x28')]));_0x1ea8e1[_0x693e('0x27')]=_0x1ea8e1[_0x693e('0x27')][_0x693e('0x29')]?_0x1ea8e1[_0x693e('0x27')]:_0x3d350b[_0x693e('0x22')];if(!_0x3b6156[_0x693e('0x23')][_0x693e('0x2a')](_0x693e('0x2b'))){_0x1ea8e1[_0x693e('0x15')]=qs[_0x693e('0x15')](_0x3b6156[_0x693e('0x23')][_0x693e('0x15')]);_0x1ea8e1['offset']=qs[_0x693e('0x14')](_0x3b6156[_0x693e('0x23')]['offset']);}_0x1ea8e1[_0x693e('0x2c')]=qs[_0x693e('0x2d')](_0x3b6156['query']['sort']);_0x1ea8e1[_0x693e('0x2e')]=qs[_0x693e('0x25')](_[_0x693e('0x2f')](_0x3b6156[_0x693e('0x23')],_0x3d350b[_0x693e('0x25')]));if(_0x3b6156[_0x693e('0x23')][_0x693e('0x30')]){_0x1ea8e1[_0x693e('0x2e')]=_['merge'](_0x1ea8e1[_0x693e('0x2e')],{'$or':_[_0x693e('0x31')](_0x5f3b88,function(_0x4d8fc1){if(_0x4d8fc1[_0x693e('0x32')][_0x693e('0x33')]!==_0x693e('0x34')){var _0x462e6a={};_0x462e6a[_0x4d8fc1[_0x693e('0x35')]]={'$like':'%'+_0x3b6156[_0x693e('0x23')][_0x693e('0x30')]+'%'};return _0x462e6a;}})});}_0x1ea8e1=_['merge']({},_0x1ea8e1,_0x3b6156[_0x693e('0x36')]);var _0x1c93c6={'where':_0x1ea8e1[_0x693e('0x2e')]};return db['Trigger'][_0x693e('0x13')](_0x1c93c6)['then'](function(_0x89534b){_0x26b9c4[_0x693e('0x13')]=_0x89534b;if(_0x3b6156['query']['includeAll']){_0x1ea8e1[_0x693e('0x37')]=[{'all':!![]}];}return db[_0x693e('0x21')][_0x693e('0x38')](_0x1ea8e1);})[_0x693e('0x19')](function(_0x3bc71f){_0x26b9c4[_0x693e('0x39')]=_0x3bc71f;return _0x26b9c4;})[_0x693e('0x19')](respondWithFilteredResult(_0x1c002d,_0x1ea8e1))[_0x693e('0x3a')](handleError(_0x1c002d,null));};exports[_0x693e('0x3b')]=function(_0x18026e,_0x45a329){var _0x3cec0b={'raw':![],'where':{'id':_0x18026e['params']['id']}},_0x56a4da={};_0x56a4da[_0x693e('0x22')]=_[_0x693e('0x24')](db[_0x693e('0x21')][_0x693e('0x3c')]);_0x56a4da[_0x693e('0x23')]=_['keys'](_0x18026e[_0x693e('0x23')]);_0x56a4da[_0x693e('0x25')]=_[_0x693e('0x26')](_0x56a4da[_0x693e('0x22')],_0x56a4da[_0x693e('0x23')]);_0x3cec0b[_0x693e('0x27')]=_[_0x693e('0x26')](_0x56a4da[_0x693e('0x22')],qs['fields'](_0x18026e[_0x693e('0x23')]['fields']));_0x3cec0b[_0x693e('0x27')]=_0x3cec0b[_0x693e('0x27')]['length']?_0x3cec0b[_0x693e('0x27')]:_0x56a4da[_0x693e('0x22')];if(_0x18026e[_0x693e('0x23')]['includeAll']){_0x3cec0b[_0x693e('0x37')]=[{'all':!![]}];}_0x3cec0b=_[_0x693e('0x3d')]({},_0x3cec0b,_0x18026e[_0x693e('0x36')]);return db[_0x693e('0x21')][_0x693e('0x3e')](_0x3cec0b)[_0x693e('0x19')](handleEntityNotFound(_0x45a329,null))[_0x693e('0x19')](respondWithResult(_0x45a329,null))[_0x693e('0x3a')](handleError(_0x45a329,null));};exports[_0x693e('0x3f')]=function(_0x1817eb,_0x53cb87){return db['Trigger'][_0x693e('0x3f')](_0x1817eb[_0x693e('0x40')],{})[_0x693e('0x19')](function(_0x419be2){var _0x83e206=_0x1817eb['user'][_0x693e('0x41')]({'plain':!![]});if(!_0x83e206)throw new Error(_0x693e('0x42'));if(_0x83e206[_0x693e('0x43')]===_0x693e('0x44')){var _0x1fbcd8=_0x419be2[_0x693e('0x41')]({'plain':!![]});var _0x511c69=_0x693e('0x1a');return db[_0x693e('0x45')][_0x693e('0x3e')]({'where':{'name':_0x511c69,'userProfileId':_0x83e206[_0x693e('0x46')]},'raw':!![]})['then'](function(_0x7fd9a4){if(_0x7fd9a4&&_0x7fd9a4['autoAssociation']===0x0){return db[_0x693e('0x47')][_0x693e('0x3f')]({'name':_0x1fbcd8[_0x693e('0x1f')],'resourceId':_0x1fbcd8['id'],'type':_0x7fd9a4[_0x693e('0x1f')],'sectionId':_0x7fd9a4['id']},{})[_0x693e('0x19')](function(){return _0x419be2;});}else{return _0x419be2;}})[_0x693e('0x3a')](function(_0x3106b3){logger[_0x693e('0x1d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3106b3);throw _0x3106b3;});}return _0x419be2;})['then'](respondWithResult(_0x53cb87,0xc9))[_0x693e('0x3a')](handleError(_0x53cb87,null));};exports[_0x693e('0x18')]=function(_0x2babac,_0x1fc19f){if(_0x2babac[_0x693e('0x40')]['id']){delete _0x2babac['body']['id'];}return db[_0x693e('0x21')][_0x693e('0x3e')]({'where':{'id':_0x2babac['params']['id']}})[_0x693e('0x19')](handleEntityNotFound(_0x1fc19f,null))[_0x693e('0x19')](saveUpdates(_0x2babac[_0x693e('0x40')],null))[_0x693e('0x19')](respondWithResult(_0x1fc19f,null))[_0x693e('0x3a')](handleError(_0x1fc19f,null));};exports[_0x693e('0x1b')]=function(_0x1b9a0f,_0x201475){return db[_0x693e('0x21')][_0x693e('0x3e')]({'where':{'id':_0x1b9a0f[_0x693e('0x48')]['id']}})[_0x693e('0x19')](handleEntityNotFound(_0x201475,null))[_0x693e('0x19')](removeEntity(_0x201475,null))['catch'](handleError(_0x201475,null));};exports['addAllCondition']=function(_0x480702,_0x1fd8f5,_0x3ca444){if(_0x480702[_0x693e('0x40')]['id']){delete _0x480702[_0x693e('0x40')]['id'];}return db[_0x693e('0x21')]['find']({'where':{'id':_0x480702['params']['id']}})[_0x693e('0x19')](handleEntityNotFound(_0x1fd8f5,null))[_0x693e('0x19')](function(_0x247efb){if(_0x247efb){_0x480702[_0x693e('0x40')][_0x693e('0x49')]=_0x247efb['id'];return db[_0x693e('0x4a')]['create'](_0x480702[_0x693e('0x40')]);}})[_0x693e('0x19')](respondWithResult(_0x1fd8f5,null))[_0x693e('0x3a')](handleError(_0x1fd8f5,null));};exports[_0x693e('0x4b')]=function(_0x5e2f3b,_0x480096,_0x22c3c6){if(_0x5e2f3b[_0x693e('0x40')]['id']){delete _0x5e2f3b['body']['id'];}return db[_0x693e('0x21')][_0x693e('0x3e')]({'where':{'id':_0x5e2f3b[_0x693e('0x48')]['id']}})[_0x693e('0x19')](handleEntityNotFound(_0x480096,null))[_0x693e('0x19')](function(_0x3e998f){if(_0x3e998f){_0x5e2f3b['body']['TriggerAnyId']=_0x3e998f['id'];return db[_0x693e('0x4a')][_0x693e('0x3f')](_0x5e2f3b['body']);}})['then'](respondWithResult(_0x480096,null))[_0x693e('0x3a')](handleError(_0x480096,null));};exports[_0x693e('0x4c')]=function(_0x1d2882,_0x3c8731,_0x432418){var _0x45aa55={};var _0x40e941={};var _0x5900c1;var _0xa8ef55;return db[_0x693e('0x21')]['findOne']({'where':{'id':_0x1d2882['params']['id']}})[_0x693e('0x19')](handleEntityNotFound(_0x3c8731,null))[_0x693e('0x19')](function(_0x525641){if(_0x525641){_0x5900c1=_0x525641;_0x40e941[_0x693e('0x22')]=_[_0x693e('0x24')](db['Condition'][_0x693e('0x3c')]);_0x40e941[_0x693e('0x23')]=_[_0x693e('0x24')](_0x1d2882[_0x693e('0x23')]);_0x40e941[_0x693e('0x25')]=_[_0x693e('0x26')](_0x40e941[_0x693e('0x22')],_0x40e941[_0x693e('0x23')]);_0x45aa55[_0x693e('0x27')]=_[_0x693e('0x26')](_0x40e941[_0x693e('0x22')],qs[_0x693e('0x28')](_0x1d2882[_0x693e('0x23')][_0x693e('0x28')]));_0x45aa55[_0x693e('0x27')]=_0x45aa55[_0x693e('0x27')][_0x693e('0x29')]?_0x45aa55[_0x693e('0x27')]:_0x40e941[_0x693e('0x22')];_0x45aa55[_0x693e('0x2c')]=qs['sort'](_0x1d2882['query'][_0x693e('0x2d')]);_0x45aa55[_0x693e('0x2e')]=qs[_0x693e('0x25')](_[_0x693e('0x2f')](_0x1d2882['query'],_0x40e941[_0x693e('0x25')]));if(_0x1d2882[_0x693e('0x23')][_0x693e('0x30')]){_0x45aa55[_0x693e('0x2e')]=_[_0x693e('0x3d')](_0x45aa55[_0x693e('0x2e')],{'$or':_[_0x693e('0x31')](_0x45aa55[_0x693e('0x27')],function(_0x338e93){var _0x4d91a8={};_0x4d91a8[_0x338e93]={'$like':'%'+_0x1d2882[_0x693e('0x23')][_0x693e('0x30')]+'%'};return _0x4d91a8;})});}_0x45aa55=_[_0x693e('0x3d')]({},_0x45aa55,_0x1d2882[_0x693e('0x36')]);return _0x5900c1[_0x693e('0x4c')](_0x45aa55);}})[_0x693e('0x19')](function(_0x2efb85){if(_0x2efb85){_0xa8ef55=_0x2efb85[_0x693e('0x29')];if(!_0x1d2882['query'][_0x693e('0x2a')](_0x693e('0x2b'))){_0x45aa55['limit']=qs[_0x693e('0x15')](_0x1d2882[_0x693e('0x23')]['limit']);_0x45aa55['offset']=qs['offset'](_0x1d2882[_0x693e('0x23')]['offset']);}return _0x5900c1[_0x693e('0x4c')](_0x45aa55);}})[_0x693e('0x19')](function(_0x59c1f5){if(_0x59c1f5){return _0x59c1f5?{'count':_0xa8ef55,'rows':_0x59c1f5}:null;}})[_0x693e('0x19')](respondWithResult(_0x3c8731,null))[_0x693e('0x3a')](handleError(_0x3c8731,null));};exports[_0x693e('0x4d')]=function(_0x4760b7,_0x229579,_0x10fc8c){var _0x4cd4cf={};var _0x134b33={};var _0x38e823;var _0x141392;return db[_0x693e('0x21')][_0x693e('0x4e')]({'where':{'id':_0x4760b7[_0x693e('0x48')]['id']}})['then'](handleEntityNotFound(_0x229579,null))['then'](function(_0x450046){if(_0x450046){_0x38e823=_0x450046;_0x134b33['model']=_[_0x693e('0x24')](db[_0x693e('0x4a')][_0x693e('0x3c')]);_0x134b33['query']=_[_0x693e('0x24')](_0x4760b7['query']);_0x134b33[_0x693e('0x25')]=_[_0x693e('0x26')](_0x134b33['model'],_0x134b33[_0x693e('0x23')]);_0x4cd4cf[_0x693e('0x27')]=_[_0x693e('0x26')](_0x134b33[_0x693e('0x22')],qs[_0x693e('0x28')](_0x4760b7[_0x693e('0x23')][_0x693e('0x28')]));_0x4cd4cf[_0x693e('0x27')]=_0x4cd4cf['attributes'][_0x693e('0x29')]?_0x4cd4cf['attributes']:_0x134b33[_0x693e('0x22')];_0x4cd4cf[_0x693e('0x2c')]=qs['sort'](_0x4760b7['query'][_0x693e('0x2d')]);_0x4cd4cf[_0x693e('0x2e')]=qs[_0x693e('0x25')](_['pick'](_0x4760b7[_0x693e('0x23')],_0x134b33[_0x693e('0x25')]));if(_0x4760b7[_0x693e('0x23')][_0x693e('0x30')]){_0x4cd4cf[_0x693e('0x2e')]=_[_0x693e('0x3d')](_0x4cd4cf[_0x693e('0x2e')],{'$or':_[_0x693e('0x31')](_0x4cd4cf[_0x693e('0x27')],function(_0x290634){var _0x5cb253={};_0x5cb253[_0x290634]={'$like':'%'+_0x4760b7[_0x693e('0x23')][_0x693e('0x30')]+'%'};return _0x5cb253;})});}_0x4cd4cf=_[_0x693e('0x3d')]({},_0x4cd4cf,_0x4760b7[_0x693e('0x36')]);return _0x38e823[_0x693e('0x4d')](_0x4cd4cf);}})[_0x693e('0x19')](function(_0x27693e){if(_0x27693e){_0x141392=_0x27693e[_0x693e('0x29')];if(!_0x4760b7[_0x693e('0x23')][_0x693e('0x2a')](_0x693e('0x2b'))){_0x4cd4cf['limit']=qs[_0x693e('0x15')](_0x4760b7[_0x693e('0x23')][_0x693e('0x15')]);_0x4cd4cf[_0x693e('0x14')]=qs[_0x693e('0x14')](_0x4760b7[_0x693e('0x23')][_0x693e('0x14')]);}return _0x38e823[_0x693e('0x4d')](_0x4cd4cf);}})[_0x693e('0x19')](function(_0xda6005){if(_0xda6005){return _0xda6005?{'count':_0x141392,'rows':_0xda6005}:null;}})[_0x693e('0x19')](respondWithResult(_0x229579,null))['catch'](handleError(_0x229579,null));};exports[_0x693e('0x4f')]=function(_0x1c60f3,_0x26d270,_0x82aac1){if(_0x1c60f3[_0x693e('0x40')]['id']){delete _0x1c60f3[_0x693e('0x40')]['id'];}return db[_0x693e('0x21')]['find']({'where':{'id':_0x1c60f3[_0x693e('0x48')]['id']}})[_0x693e('0x19')](handleEntityNotFound(_0x26d270,null))[_0x693e('0x19')](function(_0xccfb20){if(_0xccfb20){_0x1c60f3[_0x693e('0x40')][_0x693e('0x50')]=_0xccfb20['id'];return db[_0x693e('0x51')][_0x693e('0x3f')](_0x1c60f3[_0x693e('0x40')]);}})[_0x693e('0x19')](respondWithResult(_0x26d270,null))[_0x693e('0x3a')](handleError(_0x26d270,null));};exports[_0x693e('0x52')]=function(_0x386059,_0x4f2595,_0x8eeee4){var _0x5eb267={};var _0x4e1a55={};var _0x32d49e;var _0x52e8b2;return db['Trigger']['findOne']({'where':{'id':_0x386059[_0x693e('0x48')]['id']}})['then'](handleEntityNotFound(_0x4f2595,null))['then'](function(_0x4d0ec7){if(_0x4d0ec7){_0x32d49e=_0x4d0ec7;_0x4e1a55['model']=_['keys'](db[_0x693e('0x51')][_0x693e('0x3c')]);_0x4e1a55[_0x693e('0x23')]=_['keys'](_0x386059[_0x693e('0x23')]);_0x4e1a55[_0x693e('0x25')]=_[_0x693e('0x26')](_0x4e1a55[_0x693e('0x22')],_0x4e1a55[_0x693e('0x23')]);_0x5eb267[_0x693e('0x27')]=_[_0x693e('0x26')](_0x4e1a55[_0x693e('0x22')],qs['fields'](_0x386059[_0x693e('0x23')][_0x693e('0x28')]));_0x5eb267[_0x693e('0x27')]=_0x5eb267[_0x693e('0x27')][_0x693e('0x29')]?_0x5eb267['attributes']:_0x4e1a55[_0x693e('0x22')];_0x5eb267['order']=qs[_0x693e('0x2d')](_0x386059[_0x693e('0x23')][_0x693e('0x2d')]);_0x5eb267[_0x693e('0x2e')]=qs[_0x693e('0x25')](_['pick'](_0x386059[_0x693e('0x23')],_0x4e1a55['filters']));if(_0x386059['query'][_0x693e('0x30')]){_0x5eb267[_0x693e('0x2e')]=_[_0x693e('0x3d')](_0x5eb267[_0x693e('0x2e')],{'$or':_['map'](_0x5eb267[_0x693e('0x27')],function(_0x119221){var _0x1f93fc={};_0x1f93fc[_0x119221]={'$like':'%'+_0x386059['query'][_0x693e('0x30')]+'%'};return _0x1f93fc;})});}_0x5eb267=_['merge']({},_0x5eb267,_0x386059['options']);return _0x32d49e[_0x693e('0x52')](_0x5eb267);}})[_0x693e('0x19')](function(_0x1e241a){if(_0x1e241a){_0x52e8b2=_0x1e241a[_0x693e('0x29')];if(!_0x386059[_0x693e('0x23')][_0x693e('0x2a')](_0x693e('0x2b'))){_0x5eb267[_0x693e('0x15')]=qs[_0x693e('0x15')](_0x386059['query'][_0x693e('0x15')]);_0x5eb267['offset']=qs['offset'](_0x386059[_0x693e('0x23')][_0x693e('0x14')]);}return _0x32d49e[_0x693e('0x52')](_0x5eb267);}})[_0x693e('0x19')](function(_0x4d24d6){if(_0x4d24d6){return _0x4d24d6?{'count':_0x52e8b2,'rows':_0x4d24d6}:null;}})[_0x693e('0x19')](respondWithResult(_0x4f2595,null))[_0x693e('0x3a')](handleError(_0x4f2595,null));}; \ No newline at end of file +var _0x96cc=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','Triggers','UserProfileResource','sendStatus','name','send','index','Trigger','rawAttributes','model','query','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','findAll','catch','show','params','keys','length','include','find','create','body','get','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','getAllConditions','nolimit','getAnyConditions','addAction','getActions','Action','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash'];(function(_0x7feda5,_0x5cc303){var _0x3f92bc=function(_0x321173){while(--_0x321173){_0x7feda5['push'](_0x7feda5['shift']());}};_0x3f92bc(++_0x5cc303);}(_0x96cc,0x16c));var _0xc96c=function(_0x46accd,_0x43fbd4){_0x46accd=_0x46accd-0x0;var _0x2191e3=_0x96cc[_0x46accd];return _0x2191e3;};'use strict';var pdf=require(_0xc96c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc96c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc96c('0x2'));var rp=require(_0xc96c('0x3'));var moment=require(_0xc96c('0x4'));var BPromise=require(_0xc96c('0x5'));var Mustache=require(_0xc96c('0x6'));var util=require(_0xc96c('0x7'));var path=require(_0xc96c('0x8'));var sox=require(_0xc96c('0x9'));var csv=require(_0xc96c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc96c('0xb'));var squel=require(_0xc96c('0xc'));var crypto=require(_0xc96c('0xd'));var jsforce=require(_0xc96c('0xe'));var deskjs=require(_0xc96c('0xf'));var toCsv=require(_0xc96c('0xa'));var querystring=require(_0xc96c('0x10'));var Papa=require('papaparse');var Redis=require(_0xc96c('0x11'));var authService=require(_0xc96c('0x12'));var qs=require(_0xc96c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc96c('0x14'))('api');var utils=require(_0xc96c('0x15'));var config=require('../../config/environment');var db=require(_0xc96c('0x16'))['db'];function respondWithStatusCode(_0x32f682,_0x3ef47a){_0x3ef47a=_0x3ef47a||0xcc;return function(_0x246a95){if(_0x246a95){return _0x32f682['sendStatus'](_0x3ef47a);}return _0x32f682[_0xc96c('0x17')](_0x3ef47a)[_0xc96c('0x18')]();};}function respondWithResult(_0x1e7742,_0x3f65fd){_0x3f65fd=_0x3f65fd||0xc8;return function(_0x48de8d){if(_0x48de8d){return _0x1e7742[_0xc96c('0x17')](_0x3f65fd)[_0xc96c('0x19')](_0x48de8d);}};}function respondWithFilteredResult(_0x399267,_0x32e640){return function(_0x377dbc){if(_0x377dbc){var _0x46455a=_0x377dbc[_0xc96c('0x1a')],_0x1765d9=_0x32e640[_0xc96c('0x1b')],_0x23e357=_0x32e640['offset']+_0x32e640['limit'],_0x174852;if(_0x23e357>=_0x46455a){_0x23e357=_0x46455a;_0x174852=0xc8;}else{_0x174852=0xce;}_0x399267[_0xc96c('0x17')](_0x174852);return _0x399267[_0xc96c('0x1c')](_0xc96c('0x1d'),_0x1765d9+'-'+_0x23e357+'/'+_0x46455a)[_0xc96c('0x19')](_0x377dbc);}return null;};}function patchUpdates(_0x4aa6a3){return function(_0x2c4c83){try{jsonpatch[_0xc96c('0x1e')](_0x2c4c83,_0x4aa6a3,!![]);}catch(_0x2a361c){return BPromise[_0xc96c('0x1f')](_0x2a361c);}return _0x2c4c83[_0xc96c('0x20')]();};}function saveUpdates(_0x335910,_0x43cc22){return function(_0x41daba){if(_0x41daba){return _0x41daba[_0xc96c('0x21')](_0x335910)[_0xc96c('0x22')](function(_0x2bb397){return _0x2bb397;});}return null;};}function removeEntity(_0x1203a1,_0x3f9603){return function(_0x45edee){if(_0x45edee){return _0x45edee[_0xc96c('0x23')]()[_0xc96c('0x22')](function(){var _0x3e2615=_0x45edee['get']({'plain':!![]});var _0xd63951=_0xc96c('0x24');return db[_0xc96c('0x25')][_0xc96c('0x23')]({'where':{'type':_0xd63951,'resourceId':_0x3e2615['id']}})[_0xc96c('0x22')](function(){return _0x45edee;});})[_0xc96c('0x22')](function(){_0x1203a1[_0xc96c('0x17')](0xcc)[_0xc96c('0x18')]();});}};}function handleEntityNotFound(_0x1a77df,_0x14f171){return function(_0x50fc07){if(!_0x50fc07){_0x1a77df[_0xc96c('0x26')](0x194);}return _0x50fc07;};}function handleError(_0x117f17,_0x3f87cc){_0x3f87cc=_0x3f87cc||0x1f4;return function(_0x294fee){logger['error'](_0x294fee['stack']);if(_0x294fee[_0xc96c('0x27')]){delete _0x294fee[_0xc96c('0x27')];}_0x117f17[_0xc96c('0x17')](_0x3f87cc)[_0xc96c('0x28')](_0x294fee);};}exports[_0xc96c('0x29')]=function(_0x5e1727,_0x427cb2){var _0x1c911b={},_0xa0efbc={},_0x27925f={'count':0x0,'rows':[]};var _0x325cda=db[_0xc96c('0x2a')][_0xc96c('0x2b')];_0xa0efbc[_0xc96c('0x2c')]=_['keys'](_0x325cda);_0xa0efbc[_0xc96c('0x2d')]=_['keys'](_0x5e1727[_0xc96c('0x2d')]);_0xa0efbc[_0xc96c('0x2e')]=_[_0xc96c('0x2f')](_0xa0efbc['model'],_0xa0efbc[_0xc96c('0x2d')]);_0x1c911b[_0xc96c('0x30')]=_[_0xc96c('0x2f')](_0xa0efbc[_0xc96c('0x2c')],qs['fields'](_0x5e1727['query'][_0xc96c('0x31')]));_0x1c911b[_0xc96c('0x30')]=_0x1c911b[_0xc96c('0x30')]['length']?_0x1c911b[_0xc96c('0x30')]:_0xa0efbc[_0xc96c('0x2c')];if(!_0x5e1727[_0xc96c('0x2d')][_0xc96c('0x32')]('nolimit')){_0x1c911b[_0xc96c('0x33')]=qs[_0xc96c('0x33')](_0x5e1727['query'][_0xc96c('0x33')]);_0x1c911b[_0xc96c('0x1b')]=qs[_0xc96c('0x1b')](_0x5e1727[_0xc96c('0x2d')][_0xc96c('0x1b')]);}_0x1c911b[_0xc96c('0x34')]=qs['sort'](_0x5e1727[_0xc96c('0x2d')][_0xc96c('0x35')]);_0x1c911b[_0xc96c('0x36')]=qs[_0xc96c('0x2e')](_[_0xc96c('0x37')](_0x5e1727[_0xc96c('0x2d')],_0xa0efbc['filters']));if(_0x5e1727['query'][_0xc96c('0x38')]){_0x1c911b[_0xc96c('0x36')]=_['merge'](_0x1c911b['where'],{'$or':_[_0xc96c('0x39')](_0x325cda,function(_0x1df393){if(_0x1df393[_0xc96c('0x3a')][_0xc96c('0x3b')]!==_0xc96c('0x3c')){var _0x298331={};_0x298331[_0x1df393[_0xc96c('0x3d')]]={'$like':'%'+_0x5e1727[_0xc96c('0x2d')][_0xc96c('0x38')]+'%'};return _0x298331;}})});}_0x1c911b=_[_0xc96c('0x3e')]({},_0x1c911b,_0x5e1727[_0xc96c('0x3f')]);var _0x5ed343={'where':_0x1c911b[_0xc96c('0x36')]};return db[_0xc96c('0x2a')][_0xc96c('0x1a')](_0x5ed343)[_0xc96c('0x22')](function(_0x4eb180){_0x27925f[_0xc96c('0x1a')]=_0x4eb180;if(_0x5e1727[_0xc96c('0x2d')][_0xc96c('0x40')]){_0x1c911b['include']=[{'all':!![]}];}return db['Trigger'][_0xc96c('0x41')](_0x1c911b);})[_0xc96c('0x22')](function(_0x2e3bc3){_0x27925f['rows']=_0x2e3bc3;return _0x27925f;})[_0xc96c('0x22')](respondWithFilteredResult(_0x427cb2,_0x1c911b))[_0xc96c('0x42')](handleError(_0x427cb2,null));};exports[_0xc96c('0x43')]=function(_0x2a8ea7,_0x1790a8){var _0x8a0009={'raw':![],'where':{'id':_0x2a8ea7[_0xc96c('0x44')]['id']}},_0x21aec1={};_0x21aec1[_0xc96c('0x2c')]=_['keys'](db['Trigger'][_0xc96c('0x2b')]);_0x21aec1[_0xc96c('0x2d')]=_[_0xc96c('0x45')](_0x2a8ea7[_0xc96c('0x2d')]);_0x21aec1['filters']=_['intersection'](_0x21aec1[_0xc96c('0x2c')],_0x21aec1[_0xc96c('0x2d')]);_0x8a0009[_0xc96c('0x30')]=_[_0xc96c('0x2f')](_0x21aec1[_0xc96c('0x2c')],qs[_0xc96c('0x31')](_0x2a8ea7[_0xc96c('0x2d')]['fields']));_0x8a0009[_0xc96c('0x30')]=_0x8a0009[_0xc96c('0x30')][_0xc96c('0x46')]?_0x8a0009[_0xc96c('0x30')]:_0x21aec1['model'];if(_0x2a8ea7['query'][_0xc96c('0x40')]){_0x8a0009[_0xc96c('0x47')]=[{'all':!![]}];}_0x8a0009=_[_0xc96c('0x3e')]({},_0x8a0009,_0x2a8ea7[_0xc96c('0x3f')]);return db[_0xc96c('0x2a')][_0xc96c('0x48')](_0x8a0009)[_0xc96c('0x22')](handleEntityNotFound(_0x1790a8,null))[_0xc96c('0x22')](respondWithResult(_0x1790a8,null))[_0xc96c('0x42')](handleError(_0x1790a8,null));};exports[_0xc96c('0x49')]=function(_0x2257ab,_0x152397){return db[_0xc96c('0x2a')]['create'](_0x2257ab[_0xc96c('0x4a')],{})[_0xc96c('0x22')](function(_0x307d58){var _0x305ebd=_0x2257ab['user'][_0xc96c('0x4b')]({'plain':!![]});if(!_0x305ebd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x305ebd[_0xc96c('0x4c')]===_0xc96c('0x4d')){var _0x565812=_0x307d58[_0xc96c('0x4b')]({'plain':!![]});var _0x400fe6=_0xc96c('0x24');return db[_0xc96c('0x4e')][_0xc96c('0x48')]({'where':{'name':_0x400fe6,'userProfileId':_0x305ebd[_0xc96c('0x4f')]},'raw':!![]})['then'](function(_0x5a1989){if(_0x5a1989&&_0x5a1989['autoAssociation']===0x0){return db[_0xc96c('0x25')]['create']({'name':_0x565812[_0xc96c('0x27')],'resourceId':_0x565812['id'],'type':_0x5a1989[_0xc96c('0x27')],'sectionId':_0x5a1989['id']},{})[_0xc96c('0x22')](function(){return _0x307d58;});}else{return _0x307d58;}})[_0xc96c('0x42')](function(_0x467528){logger[_0xc96c('0x50')](_0xc96c('0x51'),_0x467528);throw _0x467528;});}return _0x307d58;})[_0xc96c('0x22')](respondWithResult(_0x152397,0xc9))[_0xc96c('0x42')](handleError(_0x152397,null));};exports[_0xc96c('0x21')]=function(_0x573177,_0x3adefb){if(_0x573177[_0xc96c('0x4a')]['id']){delete _0x573177[_0xc96c('0x4a')]['id'];}return db[_0xc96c('0x2a')][_0xc96c('0x48')]({'where':{'id':_0x573177[_0xc96c('0x44')]['id']}})[_0xc96c('0x22')](handleEntityNotFound(_0x3adefb,null))[_0xc96c('0x22')](saveUpdates(_0x573177['body'],null))['then'](respondWithResult(_0x3adefb,null))['catch'](handleError(_0x3adefb,null));};exports['destroy']=function(_0x356ef3,_0x46c6fb){return db[_0xc96c('0x2a')][_0xc96c('0x48')]({'where':{'id':_0x356ef3[_0xc96c('0x44')]['id']}})[_0xc96c('0x22')](handleEntityNotFound(_0x46c6fb,null))[_0xc96c('0x22')](removeEntity(_0x46c6fb,null))['catch'](handleError(_0x46c6fb,null));};exports[_0xc96c('0x52')]=function(_0x48dc98,_0x3c4b60,_0x103e90){if(_0x48dc98[_0xc96c('0x4a')]['id']){delete _0x48dc98[_0xc96c('0x4a')]['id'];}return db[_0xc96c('0x2a')]['find']({'where':{'id':_0x48dc98[_0xc96c('0x44')]['id']}})[_0xc96c('0x22')](handleEntityNotFound(_0x3c4b60,null))[_0xc96c('0x22')](function(_0x1312db){if(_0x1312db){_0x48dc98[_0xc96c('0x4a')][_0xc96c('0x53')]=_0x1312db['id'];return db[_0xc96c('0x54')][_0xc96c('0x49')](_0x48dc98[_0xc96c('0x4a')]);}})[_0xc96c('0x22')](respondWithResult(_0x3c4b60,null))[_0xc96c('0x42')](handleError(_0x3c4b60,null));};exports[_0xc96c('0x55')]=function(_0x33ee7b,_0x177a4b,_0x5a6e3e){if(_0x33ee7b[_0xc96c('0x4a')]['id']){delete _0x33ee7b[_0xc96c('0x4a')]['id'];}return db[_0xc96c('0x2a')][_0xc96c('0x48')]({'where':{'id':_0x33ee7b[_0xc96c('0x44')]['id']}})['then'](handleEntityNotFound(_0x177a4b,null))[_0xc96c('0x22')](function(_0x3f4ab5){if(_0x3f4ab5){_0x33ee7b[_0xc96c('0x4a')][_0xc96c('0x56')]=_0x3f4ab5['id'];return db['Condition'][_0xc96c('0x49')](_0x33ee7b[_0xc96c('0x4a')]);}})['then'](respondWithResult(_0x177a4b,null))['catch'](handleError(_0x177a4b,null));};exports['getAllConditions']=function(_0x46de63,_0x190d99,_0x34dd78){var _0x40ecd4={};var _0x958716={};var _0x532580;var _0x58e3c1;return db[_0xc96c('0x2a')][_0xc96c('0x57')]({'where':{'id':_0x46de63[_0xc96c('0x44')]['id']}})[_0xc96c('0x22')](handleEntityNotFound(_0x190d99,null))[_0xc96c('0x22')](function(_0x550da0){if(_0x550da0){_0x532580=_0x550da0;_0x958716[_0xc96c('0x2c')]=_[_0xc96c('0x45')](db[_0xc96c('0x54')][_0xc96c('0x2b')]);_0x958716['query']=_['keys'](_0x46de63[_0xc96c('0x2d')]);_0x958716[_0xc96c('0x2e')]=_['intersection'](_0x958716[_0xc96c('0x2c')],_0x958716['query']);_0x40ecd4[_0xc96c('0x30')]=_[_0xc96c('0x2f')](_0x958716[_0xc96c('0x2c')],qs[_0xc96c('0x31')](_0x46de63[_0xc96c('0x2d')][_0xc96c('0x31')]));_0x40ecd4[_0xc96c('0x30')]=_0x40ecd4[_0xc96c('0x30')][_0xc96c('0x46')]?_0x40ecd4[_0xc96c('0x30')]:_0x958716['model'];_0x40ecd4[_0xc96c('0x34')]=qs['sort'](_0x46de63[_0xc96c('0x2d')][_0xc96c('0x35')]);_0x40ecd4['where']=qs[_0xc96c('0x2e')](_['pick'](_0x46de63[_0xc96c('0x2d')],_0x958716[_0xc96c('0x2e')]));if(_0x46de63[_0xc96c('0x2d')][_0xc96c('0x38')]){_0x40ecd4[_0xc96c('0x36')]=_[_0xc96c('0x3e')](_0x40ecd4[_0xc96c('0x36')],{'$or':_[_0xc96c('0x39')](_0x40ecd4[_0xc96c('0x30')],function(_0x541f73){var _0x373361={};_0x373361[_0x541f73]={'$like':'%'+_0x46de63[_0xc96c('0x2d')][_0xc96c('0x38')]+'%'};return _0x373361;})});}_0x40ecd4=_[_0xc96c('0x3e')]({},_0x40ecd4,_0x46de63['options']);return _0x532580[_0xc96c('0x58')](_0x40ecd4);}})[_0xc96c('0x22')](function(_0x54f3fe){if(_0x54f3fe){_0x58e3c1=_0x54f3fe['length'];if(!_0x46de63[_0xc96c('0x2d')]['hasOwnProperty'](_0xc96c('0x59'))){_0x40ecd4[_0xc96c('0x33')]=qs[_0xc96c('0x33')](_0x46de63[_0xc96c('0x2d')][_0xc96c('0x33')]);_0x40ecd4[_0xc96c('0x1b')]=qs[_0xc96c('0x1b')](_0x46de63[_0xc96c('0x2d')][_0xc96c('0x1b')]);}return _0x532580['getAllConditions'](_0x40ecd4);}})[_0xc96c('0x22')](function(_0x18cf04){if(_0x18cf04){return _0x18cf04?{'count':_0x58e3c1,'rows':_0x18cf04}:null;}})[_0xc96c('0x22')](respondWithResult(_0x190d99,null))['catch'](handleError(_0x190d99,null));};exports['getAnyConditions']=function(_0x1f32b3,_0x3ec5b8,_0x2d9862){var _0x333656={};var _0x1efa88={};var _0x43c26c;var _0x158f70;return db['Trigger'][_0xc96c('0x57')]({'where':{'id':_0x1f32b3[_0xc96c('0x44')]['id']}})['then'](handleEntityNotFound(_0x3ec5b8,null))[_0xc96c('0x22')](function(_0x4b80d1){if(_0x4b80d1){_0x43c26c=_0x4b80d1;_0x1efa88[_0xc96c('0x2c')]=_[_0xc96c('0x45')](db[_0xc96c('0x54')][_0xc96c('0x2b')]);_0x1efa88[_0xc96c('0x2d')]=_[_0xc96c('0x45')](_0x1f32b3[_0xc96c('0x2d')]);_0x1efa88[_0xc96c('0x2e')]=_[_0xc96c('0x2f')](_0x1efa88['model'],_0x1efa88[_0xc96c('0x2d')]);_0x333656[_0xc96c('0x30')]=_['intersection'](_0x1efa88[_0xc96c('0x2c')],qs['fields'](_0x1f32b3[_0xc96c('0x2d')][_0xc96c('0x31')]));_0x333656[_0xc96c('0x30')]=_0x333656['attributes'][_0xc96c('0x46')]?_0x333656[_0xc96c('0x30')]:_0x1efa88['model'];_0x333656[_0xc96c('0x34')]=qs[_0xc96c('0x35')](_0x1f32b3[_0xc96c('0x2d')]['sort']);_0x333656[_0xc96c('0x36')]=qs[_0xc96c('0x2e')](_[_0xc96c('0x37')](_0x1f32b3[_0xc96c('0x2d')],_0x1efa88[_0xc96c('0x2e')]));if(_0x1f32b3[_0xc96c('0x2d')][_0xc96c('0x38')]){_0x333656[_0xc96c('0x36')]=_[_0xc96c('0x3e')](_0x333656[_0xc96c('0x36')],{'$or':_[_0xc96c('0x39')](_0x333656[_0xc96c('0x30')],function(_0xb1b1fc){var _0x81ca97={};_0x81ca97[_0xb1b1fc]={'$like':'%'+_0x1f32b3[_0xc96c('0x2d')]['filter']+'%'};return _0x81ca97;})});}_0x333656=_[_0xc96c('0x3e')]({},_0x333656,_0x1f32b3[_0xc96c('0x3f')]);return _0x43c26c[_0xc96c('0x5a')](_0x333656);}})[_0xc96c('0x22')](function(_0x447a32){if(_0x447a32){_0x158f70=_0x447a32['length'];if(!_0x1f32b3[_0xc96c('0x2d')][_0xc96c('0x32')](_0xc96c('0x59'))){_0x333656[_0xc96c('0x33')]=qs[_0xc96c('0x33')](_0x1f32b3['query']['limit']);_0x333656[_0xc96c('0x1b')]=qs[_0xc96c('0x1b')](_0x1f32b3['query'][_0xc96c('0x1b')]);}return _0x43c26c[_0xc96c('0x5a')](_0x333656);}})['then'](function(_0xea2e29){if(_0xea2e29){return _0xea2e29?{'count':_0x158f70,'rows':_0xea2e29}:null;}})[_0xc96c('0x22')](respondWithResult(_0x3ec5b8,null))['catch'](handleError(_0x3ec5b8,null));};exports[_0xc96c('0x5b')]=function(_0x40fa0e,_0x20497e,_0x865123){if(_0x40fa0e['body']['id']){delete _0x40fa0e[_0xc96c('0x4a')]['id'];}return db[_0xc96c('0x2a')]['find']({'where':{'id':_0x40fa0e['params']['id']}})[_0xc96c('0x22')](handleEntityNotFound(_0x20497e,null))['then'](function(_0x1b2d11){if(_0x1b2d11){_0x40fa0e[_0xc96c('0x4a')]['TriggerId']=_0x1b2d11['id'];return db['Action'][_0xc96c('0x49')](_0x40fa0e[_0xc96c('0x4a')]);}})['then'](respondWithResult(_0x20497e,null))[_0xc96c('0x42')](handleError(_0x20497e,null));};exports[_0xc96c('0x5c')]=function(_0x2471b1,_0x379a6e,_0xc1301d){var _0x1fd2db={};var _0x2a7109={};var _0x200580;var _0x3170e5;return db[_0xc96c('0x2a')][_0xc96c('0x57')]({'where':{'id':_0x2471b1[_0xc96c('0x44')]['id']}})[_0xc96c('0x22')](handleEntityNotFound(_0x379a6e,null))[_0xc96c('0x22')](function(_0x36a176){if(_0x36a176){_0x200580=_0x36a176;_0x2a7109[_0xc96c('0x2c')]=_['keys'](db[_0xc96c('0x5d')][_0xc96c('0x2b')]);_0x2a7109[_0xc96c('0x2d')]=_[_0xc96c('0x45')](_0x2471b1['query']);_0x2a7109[_0xc96c('0x2e')]=_[_0xc96c('0x2f')](_0x2a7109[_0xc96c('0x2c')],_0x2a7109[_0xc96c('0x2d')]);_0x1fd2db[_0xc96c('0x30')]=_[_0xc96c('0x2f')](_0x2a7109['model'],qs[_0xc96c('0x31')](_0x2471b1['query']['fields']));_0x1fd2db['attributes']=_0x1fd2db['attributes']['length']?_0x1fd2db[_0xc96c('0x30')]:_0x2a7109[_0xc96c('0x2c')];_0x1fd2db['order']=qs['sort'](_0x2471b1[_0xc96c('0x2d')][_0xc96c('0x35')]);_0x1fd2db[_0xc96c('0x36')]=qs[_0xc96c('0x2e')](_[_0xc96c('0x37')](_0x2471b1[_0xc96c('0x2d')],_0x2a7109[_0xc96c('0x2e')]));if(_0x2471b1[_0xc96c('0x2d')][_0xc96c('0x38')]){_0x1fd2db[_0xc96c('0x36')]=_[_0xc96c('0x3e')](_0x1fd2db[_0xc96c('0x36')],{'$or':_[_0xc96c('0x39')](_0x1fd2db[_0xc96c('0x30')],function(_0x3bb791){var _0x45dcc1={};_0x45dcc1[_0x3bb791]={'$like':'%'+_0x2471b1['query'][_0xc96c('0x38')]+'%'};return _0x45dcc1;})});}_0x1fd2db=_[_0xc96c('0x3e')]({},_0x1fd2db,_0x2471b1['options']);return _0x200580[_0xc96c('0x5c')](_0x1fd2db);}})[_0xc96c('0x22')](function(_0x1b7d0f){if(_0x1b7d0f){_0x3170e5=_0x1b7d0f[_0xc96c('0x46')];if(!_0x2471b1[_0xc96c('0x2d')][_0xc96c('0x32')](_0xc96c('0x59'))){_0x1fd2db[_0xc96c('0x33')]=qs[_0xc96c('0x33')](_0x2471b1[_0xc96c('0x2d')][_0xc96c('0x33')]);_0x1fd2db[_0xc96c('0x1b')]=qs[_0xc96c('0x1b')](_0x2471b1[_0xc96c('0x2d')][_0xc96c('0x1b')]);}return _0x200580[_0xc96c('0x5c')](_0x1fd2db);}})[_0xc96c('0x22')](function(_0x575fc3){if(_0x575fc3){return _0x575fc3?{'count':_0x3170e5,'rows':_0x575fc3}:null;}})[_0xc96c('0x22')](respondWithResult(_0x379a6e,null))[_0xc96c('0x42')](handleError(_0x379a6e,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 952373e..a8192d8 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 _0xaa88=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','Trigger','tools_triggers','lodash'];(function(_0x217e1f,_0x434202){var _0x3234e3=function(_0x16c8db){while(--_0x16c8db){_0x217e1f['push'](_0x217e1f['shift']());}};_0x3234e3(++_0x434202);}(_0xaa88,0x137));var _0x8aa8=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0xaa88[_0x2ff238];return _0x204a56;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var moment=require('moment');var BPromise=require(_0x8aa8('0x4'));var rp=require(_0x8aa8('0x5'));var fs=require('fs');var path=require(_0x8aa8('0x6'));var rimraf=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var attributes=require(_0x8aa8('0x9'));module['exports']=function(_0x5bda0d,_0x460042){return _0x5bda0d['define'](_0x8aa8('0xa'),attributes,{'tableName':_0x8aa8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','util'];(function(_0x2612a5,_0x230f56){var _0x3b54ad=function(_0x31254d){while(--_0x31254d){_0x2612a5['push'](_0x2612a5['shift']());}};_0x3b54ad(++_0x230f56);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'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/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 37b9557..31b1f6e 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 _0xfaea=['Trigger,\x20%s,\x20%s,\x20%s','error','code','message','result','GetTrigger','Trigger','findAll','options','where','limit','include','map','model','attributes','then','debug','catch','ShowTrigger','raw','stringify','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent'];(function(_0x40168a,_0x37798a){var _0x46a9cc=function(_0x311e7c){while(--_0x311e7c){_0x40168a['push'](_0x40168a['shift']());}};_0x46a9cc(++_0x37798a);}(_0xfaea,0x150));var _0xafae=function(_0x5a558e,_0x2c0473){_0x5a558e=_0x5a558e-0x0;var _0x44eb26=_0xfaea[_0x5a558e];return _0x44eb26;};'use strict';var _=require('lodash');var util=require(_0xafae('0x0'));var moment=require(_0xafae('0x1'));var BPromise=require(_0xafae('0x2'));var rs=require(_0xafae('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xafae('0x4'));var logger=require(_0xafae('0x5'))('rpc');var config=require(_0xafae('0x6'));var jayson=require(_0xafae('0x7'));var client=jayson[_0xafae('0x8')][_0xafae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5910cb,_0x574ff2,_0xa2a2e6){return new BPromise(function(_0x530d01,_0x1213c2){return client[_0xafae('0xa')](_0x5910cb,_0xa2a2e6)['then'](function(_0x2dd51f){logger[_0xafae('0xb')](_0xafae('0xc'),_0x574ff2,_0xafae('0xd'));logger['debug'](_0xafae('0xe'),_0x574ff2,_0xafae('0xd'),JSON['stringify'](_0x2dd51f));if(_0x2dd51f[_0xafae('0xf')]){if(_0x2dd51f['error'][_0xafae('0x10')]===0x1f4){logger['error'](_0xafae('0xc'),_0x574ff2,_0x2dd51f[_0xafae('0xf')][_0xafae('0x11')]);return _0x1213c2(_0x2dd51f[_0xafae('0xf')][_0xafae('0x11')]);}logger['error']('Trigger,\x20%s,\x20%s',_0x574ff2,_0x2dd51f['error'][_0xafae('0x11')]);return _0x530d01(_0x2dd51f[_0xafae('0xf')]['message']);}else{logger[_0xafae('0xb')](_0xafae('0xc'),_0x574ff2,_0xafae('0xd'));_0x530d01(_0x2dd51f[_0xafae('0x12')][_0xafae('0x11')]);}})['catch'](function(_0x574986){logger[_0xafae('0xf')](_0xafae('0xc'),_0x574ff2,_0x574986);_0x1213c2(_0x574986);});});}exports[_0xafae('0x13')]=function(_0x1e6e59){var _0x5708c6=this;return new Promise(function(_0x345cd5,_0x3e0f14){return db[_0xafae('0x14')][_0xafae('0x15')]({'raw':_0x1e6e59['options']?_0x1e6e59['options']['raw']===undefined?!![]:![]:!![],'where':_0x1e6e59[_0xafae('0x16')]?_0x1e6e59['options'][_0xafae('0x17')]||null:null,'attributes':_0x1e6e59['options']?_0x1e6e59['options']['attributes']||null:null,'limit':_0x1e6e59['options']?_0x1e6e59[_0xafae('0x16')][_0xafae('0x18')]||null:null,'include':_0x1e6e59[_0xafae('0x16')]?_0x1e6e59[_0xafae('0x16')][_0xafae('0x19')]?_[_0xafae('0x1a')](_0x1e6e59[_0xafae('0x16')]['include'],function(_0x115691){return{'model':db[_0x115691[_0xafae('0x1b')]],'as':_0x115691['as'],'attributes':_0x115691[_0xafae('0x1c')],'include':_0x115691[_0xafae('0x19')]?_[_0xafae('0x1a')](_0x115691['include'],function(_0x5b20b9){return{'model':db[_0x5b20b9['model']],'as':_0x5b20b9['as'],'attributes':_0x5b20b9[_0xafae('0x1c')],'include':_0x5b20b9[_0xafae('0x19')]?_[_0xafae('0x1a')](_0x5b20b9[_0xafae('0x19')],function(_0x41ad88){return{'model':db[_0x41ad88[_0xafae('0x1b')]],'as':_0x41ad88['as'],'attributes':_0x41ad88[_0xafae('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xafae('0x1d')](function(_0x176530){logger[_0xafae('0xb')](_0xafae('0x13'),_0x1e6e59);logger[_0xafae('0x1e')](_0xafae('0x13'),_0x1e6e59,JSON['stringify'](_0x176530));_0x345cd5(_0x176530);})[_0xafae('0x1f')](function(_0x4035eb){logger[_0xafae('0xf')](_0xafae('0x13'),_0x4035eb[_0xafae('0x11')],_0x1e6e59);_0x3e0f14(_0x5708c6['error'](0x1f4,_0x4035eb[_0xafae('0x11')]));});});};exports[_0xafae('0x20')]=function(_0x13eb6e){var _0x347bf7=this;return new Promise(function(_0x270dfa,_0x5cd19c){return db[_0xafae('0x14')]['find']({'raw':_0x13eb6e['options']?_0x13eb6e['options'][_0xafae('0x21')]===undefined?!![]:![]:!![],'where':_0x13eb6e[_0xafae('0x16')]?_0x13eb6e['options'][_0xafae('0x17')]||null:null,'attributes':_0x13eb6e[_0xafae('0x16')]?_0x13eb6e[_0xafae('0x16')][_0xafae('0x1c')]||null:null,'include':_0x13eb6e[_0xafae('0x16')]?_0x13eb6e[_0xafae('0x16')][_0xafae('0x19')]?_[_0xafae('0x1a')](_0x13eb6e[_0xafae('0x16')][_0xafae('0x19')],function(_0x5afaec){return{'model':db[_0x5afaec[_0xafae('0x1b')]],'as':_0x5afaec['as'],'attributes':_0x5afaec[_0xafae('0x1c')],'include':_0x5afaec['include']?_[_0xafae('0x1a')](_0x5afaec['include'],function(_0x38930f){return{'model':db[_0x38930f[_0xafae('0x1b')]],'as':_0x38930f['as'],'attributes':_0x38930f[_0xafae('0x1c')],'include':_0x38930f[_0xafae('0x19')]?_[_0xafae('0x1a')](_0x38930f['include'],function(_0x10b306){return{'model':db[_0x10b306[_0xafae('0x1b')]],'as':_0x10b306['as'],'attributes':_0x10b306[_0xafae('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xafae('0x1d')](function(_0x1a4386){logger['info'](_0xafae('0x20'),_0x13eb6e);logger['debug']('ShowTrigger',_0x13eb6e,JSON[_0xafae('0x22')](_0x1a4386));_0x270dfa(_0x1a4386);})[_0xafae('0x1f')](function(_0x3845c0){logger['error'](_0xafae('0x20'),_0x3845c0[_0xafae('0x11')],_0x13eb6e);_0x5cd19c(_0x347bf7[_0xafae('0xf')](0x1f4,_0x3845c0[_0xafae('0x11')]));});});}; \ No newline at end of file +var _0x98b6=['then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','model','map','find','ShowTrigger','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x1761f8,_0x32d6c5){var _0x54141d=function(_0x31c300){while(--_0x31c300){_0x1761f8['push'](_0x1761f8['shift']());}};_0x54141d(++_0x32d6c5);}(_0x98b6,0x176));var _0x698b=function(_0x50c951,_0x4774b5){_0x50c951=_0x50c951-0x0;var _0x4800c8=_0x98b6[_0x50c951];return _0x4800c8;};'use strict';var _=require('lodash');var util=require(_0x698b('0x0'));var moment=require('moment');var BPromise=require(_0x698b('0x1'));var rs=require(_0x698b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x698b('0x3'))['db'];var utils=require(_0x698b('0x4'));var logger=require(_0x698b('0x5'))(_0x698b('0x6'));var config=require(_0x698b('0x7'));var jayson=require(_0x698b('0x8'));var client=jayson[_0x698b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6096e5,_0x4cc8ef,_0x4ac143){return new BPromise(function(_0xe04ad8,_0x5788dd){return client[_0x698b('0xa')](_0x6096e5,_0x4ac143)[_0x698b('0xb')](function(_0x1eb397){logger[_0x698b('0xc')](_0x698b('0xd'),_0x4cc8ef,_0x698b('0xe'));logger[_0x698b('0xf')](_0x698b('0x10'),_0x4cc8ef,_0x698b('0xe'),JSON[_0x698b('0x11')](_0x1eb397));if(_0x1eb397['error']){if(_0x1eb397['error'][_0x698b('0x12')]===0x1f4){logger[_0x698b('0x13')](_0x698b('0xd'),_0x4cc8ef,_0x1eb397[_0x698b('0x13')][_0x698b('0x14')]);return _0x5788dd(_0x1eb397[_0x698b('0x13')][_0x698b('0x14')]);}logger[_0x698b('0x13')]('Trigger,\x20%s,\x20%s',_0x4cc8ef,_0x1eb397[_0x698b('0x13')][_0x698b('0x14')]);return _0xe04ad8(_0x1eb397[_0x698b('0x13')][_0x698b('0x14')]);}else{logger[_0x698b('0xc')](_0x698b('0xd'),_0x4cc8ef,_0x698b('0xe'));_0xe04ad8(_0x1eb397['result'][_0x698b('0x14')]);}})[_0x698b('0x15')](function(_0x56209d){logger['error'](_0x698b('0xd'),_0x4cc8ef,_0x56209d);_0x5788dd(_0x56209d);});});}exports[_0x698b('0x16')]=function(_0x24bd7f){var _0x2bd350=this;return new Promise(function(_0x142549,_0x10e598){return db[_0x698b('0x17')][_0x698b('0x18')]({'raw':_0x24bd7f[_0x698b('0x19')]?_0x24bd7f[_0x698b('0x19')][_0x698b('0x1a')]===undefined?!![]:![]:!![],'where':_0x24bd7f[_0x698b('0x19')]?_0x24bd7f[_0x698b('0x19')][_0x698b('0x1b')]||null:null,'attributes':_0x24bd7f['options']?_0x24bd7f['options'][_0x698b('0x1c')]||null:null,'limit':_0x24bd7f[_0x698b('0x19')]?_0x24bd7f['options'][_0x698b('0x1d')]||null:null,'include':_0x24bd7f[_0x698b('0x19')]?_0x24bd7f[_0x698b('0x19')][_0x698b('0x1e')]?_['map'](_0x24bd7f[_0x698b('0x19')][_0x698b('0x1e')],function(_0x3112e1){return{'model':db[_0x3112e1[_0x698b('0x1f')]],'as':_0x3112e1['as'],'attributes':_0x3112e1[_0x698b('0x1c')],'include':_0x3112e1['include']?_[_0x698b('0x20')](_0x3112e1[_0x698b('0x1e')],function(_0x1b9d21){return{'model':db[_0x1b9d21[_0x698b('0x1f')]],'as':_0x1b9d21['as'],'attributes':_0x1b9d21[_0x698b('0x1c')],'include':_0x1b9d21[_0x698b('0x1e')]?_[_0x698b('0x20')](_0x1b9d21['include'],function(_0x11ee3c){return{'model':db[_0x11ee3c[_0x698b('0x1f')]],'as':_0x11ee3c['as'],'attributes':_0x11ee3c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5295f3){logger['info'](_0x698b('0x16'),_0x24bd7f);logger['debug']('GetTrigger',_0x24bd7f,JSON[_0x698b('0x11')](_0x5295f3));_0x142549(_0x5295f3);})[_0x698b('0x15')](function(_0x5ef0d5){logger[_0x698b('0x13')]('GetTrigger',_0x5ef0d5[_0x698b('0x14')],_0x24bd7f);_0x10e598(_0x2bd350['error'](0x1f4,_0x5ef0d5[_0x698b('0x14')]));});});};exports['ShowTrigger']=function(_0x2ac3e4){var _0x227379=this;return new Promise(function(_0x1454a0,_0x5b1656){return db[_0x698b('0x17')][_0x698b('0x21')]({'raw':_0x2ac3e4[_0x698b('0x19')]?_0x2ac3e4[_0x698b('0x19')][_0x698b('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ac3e4[_0x698b('0x19')]?_0x2ac3e4[_0x698b('0x19')][_0x698b('0x1b')]||null:null,'attributes':_0x2ac3e4['options']?_0x2ac3e4[_0x698b('0x19')]['attributes']||null:null,'include':_0x2ac3e4['options']?_0x2ac3e4[_0x698b('0x19')][_0x698b('0x1e')]?_[_0x698b('0x20')](_0x2ac3e4['options'][_0x698b('0x1e')],function(_0x2c5887){return{'model':db[_0x2c5887['model']],'as':_0x2c5887['as'],'attributes':_0x2c5887['attributes'],'include':_0x2c5887['include']?_[_0x698b('0x20')](_0x2c5887[_0x698b('0x1e')],function(_0x31dc76){return{'model':db[_0x31dc76['model']],'as':_0x31dc76['as'],'attributes':_0x31dc76[_0x698b('0x1c')],'include':_0x31dc76[_0x698b('0x1e')]?_[_0x698b('0x20')](_0x31dc76[_0x698b('0x1e')],function(_0x2273a2){return{'model':db[_0x2273a2[_0x698b('0x1f')]],'as':_0x2273a2['as'],'attributes':_0x2273a2[_0x698b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x698b('0xb')](function(_0x435850){logger[_0x698b('0xc')]('ShowTrigger',_0x2ac3e4);logger[_0x698b('0xf')]('ShowTrigger',_0x2ac3e4,JSON[_0x698b('0x11')](_0x435850));_0x1454a0(_0x435850);})[_0x698b('0x15')](function(_0x2e830c){logger[_0x698b('0x13')](_0x698b('0x22'),_0x2e830c[_0x698b('0x14')],_0x2ac3e4);_0x5b1656(_0x227379[_0x698b('0x13')](0x1f4,_0x2e830c[_0x698b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index e353551..756d058 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 _0xe932=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','show','/:id/clone','clone','put','update','delete','exports','multer','util'];(function(_0x3175f9,_0x3ba698){var _0x108a3c=function(_0x438eed){while(--_0x438eed){_0x3175f9['push'](_0x3175f9['shift']());}};_0x108a3c(++_0x3ba698);}(_0xe932,0x152));var _0x2e93=function(_0x2dd6a7,_0xdbff53){_0x2dd6a7=_0x2dd6a7-0x0;var _0x4a97a4=_0xe932[_0x2dd6a7];return _0x4a97a4;};'use strict';var multer=require(_0x2e93('0x0'));var util=require(_0x2e93('0x1'));var path=require(_0x2e93('0x2'));var timeout=require(_0x2e93('0x3'));var express=require(_0x2e93('0x4'));var router=express[_0x2e93('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x2e93('0x6'));var config=require(_0x2e93('0x7'));var controller=require(_0x2e93('0x8'));router['get']('/',auth[_0x2e93('0x9')](),controller[_0x2e93('0xa')]);router[_0x2e93('0xb')](_0x2e93('0xc'),auth['isAuthenticated'](),controller[_0x2e93('0xd')]);router['post'](_0x2e93('0xe'),auth[_0x2e93('0x9')](),controller[_0x2e93('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2e93('0x10')](_0x2e93('0xc'),auth[_0x2e93('0x9')](),controller[_0x2e93('0x11')]);router[_0x2e93('0x12')](_0x2e93('0xc'),auth[_0x2e93('0x9')](),controller['destroy']);module[_0x2e93('0x13')]=router; \ No newline at end of file +var _0x453e=['update','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','show','post','create','put','/:id'];(function(_0x3a28c1,_0xa24958){var _0x4c405c=function(_0x28f86e){while(--_0x28f86e){_0x3a28c1['push'](_0x3a28c1['shift']());}};_0x4c405c(++_0xa24958);}(_0x453e,0x180));var _0xe453=function(_0x492221,_0x9e2521){_0x492221=_0x492221-0x0;var _0x398bf9=_0x453e[_0x492221];return _0x398bf9;};'use strict';var multer=require('multer');var util=require(_0xe453('0x0'));var path=require('path');var timeout=require(_0xe453('0x1'));var express=require('express');var router=express[_0xe453('0x2')]();var auth=require(_0xe453('0x3'));var interaction=require(_0xe453('0x4'));var config=require(_0xe453('0x5'));var controller=require(_0xe453('0x6'));router[_0xe453('0x7')]('/',auth[_0xe453('0x8')](),controller[_0xe453('0x9')]);router['get']('/:id',auth[_0xe453('0x8')](),controller[_0xe453('0xa')]);router[_0xe453('0xb')]('/:id/clone',auth[_0xe453('0x8')](),controller['clone']);router[_0xe453('0xb')]('/',auth[_0xe453('0x8')](),controller[_0xe453('0xc')]);router[_0xe453('0xd')](_0xe453('0xe'),auth[_0xe453('0x8')](),controller[_0xe453('0xf')]);router[_0xe453('0x10')]('/:id',auth[_0xe453('0x8')](),controller[_0xe453('0x11')]);module[_0xe453('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index f8f981e..9c71246 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 _0x757a=['always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','exports','STRING','user','peer','friend','from-voip-provider','ENUM','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','nat','join','getDataValue','split','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>'];(function(_0x36768b,_0x52a502){var _0x3b23ff=function(_0x1f4ba5){while(--_0x1f4ba5){_0x36768b['push'](_0x36768b['shift']());}};_0x3b23ff(++_0x52a502);}(_0x757a,0xde));var _0xa757=function(_0x26e40c,_0x32be46){_0x26e40c=_0x26e40c-0x0;var _0x4960fc=_0x757a[_0x26e40c];return _0x4960fc;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend',_0xa757('0x2'),_0xa757('0x3')),'allowNull':![],'defaultValue':_0xa757('0x4')},'context':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'defaultValue':_0xa757('0x5')},'callingpres':{'type':Sequelize[_0xa757('0x6')]('ALLOWED_NOT_SCREENED',_0xa757('0x7'),_0xa757('0x8'),'ALLOWED',_0xa757('0x9'),_0xa757('0xa'),_0xa757('0xb'),_0xa757('0xc'))},'deny':{'type':Sequelize[_0xa757('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xa757('0x1')]},'md5secret':{'type':Sequelize[_0xa757('0x1')]},'remotesecret':{'type':Sequelize[_0xa757('0x1')]},'transport':{'type':Sequelize[_0xa757('0x1')],'defaultValue':_0xa757('0xd'),'set':function(_0x188ad5){this[_0xa757('0xe')]('transport',_0x188ad5?_0x188ad5['join'](','):null);},'get':function(){return this['getDataValue']('transport')?this['getDataValue'](_0xa757('0xf'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xa757('0x6')]('rfc2833','info',_0xa757('0x10'),_0xa757('0x11'),_0xa757('0x12')),'defaultValue':_0xa757('0x13')},'directmedia':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no',_0xa757('0x15'),_0xa757('0x16'),_0xa757('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xa757('0x6')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xa757('0x1')]},'directmediadeny':{'type':Sequelize[_0xa757('0x1')]},'nat':{'type':Sequelize[_0xa757('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x54b305){this[_0xa757('0xe')](_0xa757('0x18'),_0x54b305?_0x54b305[_0xa757('0x19')](','):null);},'get':function(){return this[_0xa757('0x1a')](_0xa757('0x18'))?this[_0xa757('0x1a')]('nat')[_0xa757('0x1b')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xa757('0x1')]},'namedcallgroup':{'type':Sequelize[_0xa757('0x1')]},'pickupgroup':{'type':Sequelize[_0xa757('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xa757('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0xa757('0x1')],'defaultValue':_0xa757('0x1c')},'allow':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'defaultValue':_0xa757('0x1d'),'set':function(_0x1d6e2){this[_0xa757('0xe')](_0xa757('0x1e'),_0x1d6e2?_0x1d6e2[_0xa757('0x19')](';'):_0xa757('0x1d'));},'get':function(){return this['getDataValue'](_0xa757('0x1e'))?this['getDataValue'](_0xa757('0x1e'))['split'](';'):null;},'comment':_0xa757('0x1f')},'autoframing':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xa757('0x20'),'set':function(_0xcd98bd){this[_0xa757('0xe')](_0xa757('0x21'),_0xcd98bd?_0xcd98bd['join'](','):null);},'get':function(){return this[_0xa757('0x1a')]('insecure')?this['getDataValue']('insecure')['split'](','):null;},'comment':_0xa757('0x22')},'trustrpid':{'type':Sequelize['ENUM'](_0xa757('0x14'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xa757('0x6')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xa757('0x6')]('yes','no',_0xa757('0x23'))},'promiscredir':{'type':Sequelize[_0xa757('0x6')]('yes','no')},'useclientcode':{'type':Sequelize[_0xa757('0x6')]('yes','no')},'accountcode':{'type':Sequelize[_0xa757('0x24')](0xb)},'setvar':{'type':Sequelize[_0xa757('0x1')]},'callerid':{'type':Sequelize[_0xa757('0x1')],'defaultValue':_0xa757('0x25')},'amaflags':{'type':Sequelize[_0xa757('0x1')]},'callcounter':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no'),'defaultValue':_0xa757('0x14')},'busylevel':{'type':Sequelize[_0xa757('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no')},'allowsubscribe':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no')},'allowtransfer':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no')},'ignoresdpversion':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no')},'subscribecontext':{'type':Sequelize[_0xa757('0x1')]},'template':{'type':Sequelize[_0xa757('0x1')]},'videosupport':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no',_0xa757('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xa757('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xa757('0x6')]('yes','no')},'mailbox':{'type':Sequelize[_0xa757('0x1')]},'session_timers':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x27'),_0xa757('0x28'),_0xa757('0x29'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xa757('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x2a'),_0xa757('0x2b')),'defaultValue':_0xa757('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0xa757('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0xa757('0x1')]},'fromuser':{'type':Sequelize[_0xa757('0x1')]},'port':{'type':Sequelize[_0xa757('0x24')](0x5)},'qualify':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no'),'defaultValue':_0xa757('0x14')},'keepalive':{'type':Sequelize[_0xa757('0x24')](0xb)},'defaultip':{'type':Sequelize[_0xa757('0x1')]},'defaultuser':{'type':Sequelize[_0xa757('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xa757('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xa757('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no',_0xa757('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa757('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xa757('0x24')](0xb)},'timerb':{'type':Sequelize[_0xa757('0x24')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xa757('0x1')]},'contactacl':{'type':Sequelize[_0xa757('0x1')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xa757('0x24')](0xb)},'encryption':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xa757('0x14'),'no')},'force_avp':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no')},'icesupport':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xa757('0x14'),'no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0xa757('0x2d'),_0xa757('0x2e'))},'dtlsrekey':{'type':Sequelize[_0xa757('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0xa757('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xa757('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0xa757('0x1')]},'dtlssetup':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x2f'),_0xa757('0x30'),_0xa757('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xa757('0x1')]},'usereqphone':{'type':Sequelize['ENUM'](_0xa757('0x14'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xa757('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xa757('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xa757('0x14'),'no')},'subscribemwi':{'type':Sequelize[_0xa757('0x6')]('yes','no')},'vmexten':{'type':Sequelize[_0xa757('0x1')]},'mohinterpret':{'type':Sequelize[_0xa757('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xa757('0x1')]},'description':{'type':Sequelize[_0xa757('0x1')]},'host':{'type':Sequelize[_0xa757('0x1')],'defaultValue':_0xa757('0x32')},'canreinvite':{'type':Sequelize['ENUM'](_0xa757('0x14'),'no',_0xa757('0x15'),_0xa757('0x16'),_0xa757('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xa757('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0xb10b=['udp','setDataValue','join','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','uac','uas','fingerprint','active','actpass','dynamic','update,nonat','BOOLEAN','sequelize','STRING','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB'];(function(_0x34619f,_0x39ae69){var _0xb5eaf0=function(_0x5ed73f){while(--_0x5ed73f){_0x34619f['push'](_0x34619f['shift']());}};_0xb5eaf0(++_0x39ae69);}(_0xb10b,0x12a));var _0xbb10=function(_0x2dd25a,_0x473907){_0x2dd25a=_0x2dd25a-0x0;var _0x59f26c=_0xb10b[_0x2dd25a];return _0x59f26c;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xbb10('0x3')]('friend',_0xbb10('0x4'),_0xbb10('0x5')),'allowNull':![],'defaultValue':_0xbb10('0x6')},'context':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'defaultValue':_0xbb10('0x7')},'callingpres':{'type':Sequelize[_0xbb10('0x3')]('ALLOWED_NOT_SCREENED',_0xbb10('0x8'),_0xbb10('0x9'),'ALLOWED',_0xbb10('0xa'),_0xbb10('0xb'),_0xbb10('0xc'),_0xbb10('0xd'))},'deny':{'type':Sequelize[_0xbb10('0x1')]},'permit':{'type':Sequelize[_0xbb10('0x1')]},'secret':{'type':Sequelize[_0xbb10('0x1')]},'md5secret':{'type':Sequelize[_0xbb10('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0xe'),'set':function(_0x118a74){this[_0xbb10('0xf')]('transport',_0x118a74?_0x118a74[_0xbb10('0x10')](','):null);},'get':function(){return this['getDataValue'](_0xbb10('0x11'))?this[_0xbb10('0x12')](_0xbb10('0x11'))[_0xbb10('0x13')](','):null;},'comment':_0xbb10('0x14')},'dtmfmode':{'type':Sequelize[_0xbb10('0x3')]('rfc2833',_0xbb10('0x15'),_0xbb10('0x16'),_0xbb10('0x17'),_0xbb10('0x18')),'defaultValue':_0xbb10('0x19')},'directmedia':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no',_0xbb10('0x1b'),_0xbb10('0x1c'),_0xbb10('0x1d')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xbb10('0x1')]},'directmediadeny':{'type':Sequelize[_0xbb10('0x1')]},'nat':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':_0xbb10('0x1e'),'set':function(_0x1682a4){this[_0xbb10('0xf')](_0xbb10('0x1f'),_0x1682a4?_0x1682a4[_0xbb10('0x10')](','):null);},'get':function(){return this[_0xbb10('0x12')]('nat')?this[_0xbb10('0x12')](_0xbb10('0x1f'))[_0xbb10('0x13')](','):null;},'comment':_0xbb10('0x20')},'callgroup':{'type':Sequelize[_0xbb10('0x1')]},'namedcallgroup':{'type':Sequelize[_0xbb10('0x1')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xbb10('0x1')]},'language':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0x21')},'allow':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'defaultValue':_0xbb10('0x22'),'set':function(_0x317da4){this[_0xbb10('0xf')](_0xbb10('0x23'),_0x317da4?_0x317da4[_0xbb10('0x10')](';'):_0xbb10('0x22'));},'get':function(){return this[_0xbb10('0x12')](_0xbb10('0x23'))?this[_0xbb10('0x12')](_0xbb10('0x23'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'insecure':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':_0xbb10('0x24'),'set':function(_0x4e25ff){this[_0xbb10('0xf')](_0xbb10('0x25'),_0x4e25ff?_0x4e25ff[_0xbb10('0x10')](','):null);},'get':function(){return this[_0xbb10('0x12')](_0xbb10('0x25'))?this[_0xbb10('0x12')](_0xbb10('0x25'))['split'](','):null;},'comment':_0xbb10('0x26')},'trustrpid':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xbb10('0x3')]('yes','no',_0xbb10('0x27'))},'promiscredir':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'accountcode':{'type':Sequelize[_0xbb10('0x28')](0xb)},'setvar':{'type':Sequelize[_0xbb10('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xbb10('0x1')]},'callcounter':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':_0xbb10('0x1a')},'busylevel':{'type':Sequelize[_0xbb10('0x28')](0xb)},'allowoverlap':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0xbb10('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0xbb10('0x1')]},'template':{'type':Sequelize[_0xbb10('0x1')]},'videosupport':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no',_0xbb10('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xbb10('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xbb10('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0xbb10('0x1')]},'session_timers':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x2a'),_0xbb10('0x2b'),'originate')},'session_expires':{'type':Sequelize[_0xbb10('0x28')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xbb10('0x2c'),_0xbb10('0x2d')),'defaultValue':_0xbb10('0x2d')},'t38pt_usertpsource':{'type':Sequelize[_0xbb10('0x1')]},'regexten':{'type':Sequelize[_0xbb10('0x1')]},'fromdomain':{'type':Sequelize[_0xbb10('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xbb10('0x28')](0x5)},'qualify':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xbb10('0x1')]},'defaultuser':{'type':Sequelize[_0xbb10('0x1')]},'rtptimeout':{'type':Sequelize[_0xbb10('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xbb10('0x28')](0xb)},'sendrpid':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xbb10('0x1')]},'callbackextension':{'type':Sequelize[_0xbb10('0x1')]},'timert1':{'type':Sequelize[_0xbb10('0x28')](0xb)},'timerb':{'type':Sequelize[_0xbb10('0x28')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xbb10('0x1')]},'contactdeny':{'type':Sequelize[_0xbb10('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xbb10('0x1')]},'use_q850_reason':{'type':Sequelize[_0xbb10('0x1')]},'maxforwards':{'type':Sequelize[_0xbb10('0x28')](0xb)},'encryption':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xbb10('0x3')]('yes','no')},'force_avp':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'icesupport':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no',_0xbb10('0x2e'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xbb10('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0xbb10('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xbb10('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x2f'),'passive',_0xbb10('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xbb10('0x1')]},'usereqphone':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xbb10('0x1')]},'recordofffeature':{'type':Sequelize[_0xbb10('0x1')]},'call_limit':{'type':Sequelize[_0xbb10('0x28')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'vmexten':{'type':Sequelize[_0xbb10('0x1')]},'mohinterpret':{'type':Sequelize[_0xbb10('0x1')]},'mohsuggest':{'type':Sequelize[_0xbb10('0x1')]},'parkinglot':{'type':Sequelize[_0xbb10('0x1')]},'description':{'type':Sequelize[_0xbb10('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0x31')},'canreinvite':{'type':Sequelize[_0xbb10('0x3')]('yes','no',_0xbb10('0x1b'),_0xbb10('0x1c'),_0xbb10('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xbb10('0x1')]},'otherFields':{'type':Sequelize[_0xbb10('0x1')]},'active':{'type':Sequelize[_0xbb10('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 0a17474..8d86ea4 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 _0xfd2e=['end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','Trunks','UserProfileResource','stack','name','send','Trunk','rawAttributes','model','keys','query','filters','intersection','attributes','fields','order','sort','where','filter','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','length','merge','find','clone','omit','createdAt','body','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status'];(function(_0x1876b2,_0x5d0225){var _0x9fb1e0=function(_0x29b099){while(--_0x29b099){_0x1876b2['push'](_0x1876b2['shift']());}};_0x9fb1e0(++_0x5d0225);}(_0xfd2e,0x1a3));var _0xefd2=function(_0x38ec73,_0xd4f146){_0x38ec73=_0x38ec73-0x0;var _0x371be9=_0xfd2e[_0x38ec73];return _0x371be9;};'use strict';var pdf=require(_0xefd2('0x0'));var emlformat=require(_0xefd2('0x1'));var rimraf=require(_0xefd2('0x2'));var zipdir=require(_0xefd2('0x3'));var jsonpatch=require(_0xefd2('0x4'));var rp=require(_0xefd2('0x5'));var moment=require(_0xefd2('0x6'));var BPromise=require(_0xefd2('0x7'));var Mustache=require(_0xefd2('0x8'));var util=require('util');var path=require(_0xefd2('0x9'));var sox=require(_0xefd2('0xa'));var csv=require(_0xefd2('0xb'));var ejs=require(_0xefd2('0xc'));var fs=require('fs');var _=require(_0xefd2('0xd'));var squel=require(_0xefd2('0xe'));var crypto=require('crypto');var jsforce=require(_0xefd2('0xf'));var deskjs=require(_0xefd2('0x10'));var toCsv=require(_0xefd2('0xb'));var querystring=require('querystring');var Papa=require(_0xefd2('0x11'));var Redis=require(_0xefd2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xefd2('0x13'));var hardwareService=require(_0xefd2('0x14'));var logger=require(_0xefd2('0x15'))(_0xefd2('0x16'));var utils=require(_0xefd2('0x17'));var config=require(_0xefd2('0x18'));var db=require(_0xefd2('0x19'))['db'];var jayson=require(_0xefd2('0x1a'));var client=jayson['client'][_0xefd2('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x38ab11,_0x719e5f,_0x4948f3){if(_0x4948f3){var _0x4a284d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a284d[_0xefd2('0x1c')](_0x719e5f)){return _0x38ab11;}else{throw new Error(_0xefd2('0x1d'));}}else{return _0x38ab11;}}function respondWithRpcPromise(_0x8d97e,_0x36273a,_0x6ff6a8,_0x2d7742){return new BPromise(function(_0x3447fe,_0x38dc15){var _0x4b179e=_0x2d7742||client;return _0x4b179e[_0xefd2('0x1e')](_0x8d97e,_0x6ff6a8)[_0xefd2('0x1f')](function(_0x412a15){logger[_0xefd2('0x20')]('Trunk,\x20%s,\x20%s',_0x36273a,_0xefd2('0x21'));logger[_0xefd2('0x22')](_0xefd2('0x23'),_0x36273a,'request\x20sent',JSON[_0xefd2('0x24')](_0x412a15));if(_0x412a15[_0xefd2('0x25')]){if(_0x412a15[_0xefd2('0x25')][_0xefd2('0x26')]===0x1f4){logger['error'](_0xefd2('0x27'),_0x36273a,_0x412a15[_0xefd2('0x25')][_0xefd2('0x28')]);return _0x38dc15(_0x412a15[_0xefd2('0x25')][_0xefd2('0x28')]);}logger[_0xefd2('0x25')](_0xefd2('0x27'),_0x36273a,_0x412a15[_0xefd2('0x25')][_0xefd2('0x28')]);return _0x3447fe(_0x412a15['error'][_0xefd2('0x28')]);}else{logger[_0xefd2('0x20')](_0xefd2('0x27'),_0x36273a,_0xefd2('0x21'));_0x3447fe(_0x412a15[_0xefd2('0x29')][_0xefd2('0x28')]);}})[_0xefd2('0x2a')](function(_0x5243a7){logger[_0xefd2('0x25')](_0xefd2('0x27'),_0x36273a,_0x5243a7);_0x38dc15(_0x5243a7);});});}function respondWithStatusCode(_0x1e7e13,_0x22eb57){_0x22eb57=_0x22eb57||0xcc;return function(_0x4b188d){if(_0x4b188d){return _0x1e7e13[_0xefd2('0x2b')](_0x22eb57);}return _0x1e7e13[_0xefd2('0x2c')](_0x22eb57)[_0xefd2('0x2d')]();};}function respondWithResult(_0x37cfaa,_0x1586e7){_0x1586e7=_0x1586e7||0xc8;return function(_0x7631d7){if(_0x7631d7){return _0x37cfaa[_0xefd2('0x2c')](_0x1586e7)[_0xefd2('0x2e')](_0x7631d7);}};}function respondWithFilteredResult(_0x2b1a43,_0xedc39b){return function(_0x50172a){if(_0x50172a){var _0x425fa1=_0x50172a[_0xefd2('0x2f')],_0x54d82a=_0xedc39b[_0xefd2('0x30')],_0x3b51bf=_0xedc39b[_0xefd2('0x30')]+_0xedc39b[_0xefd2('0x31')],_0x1e7b65;if(_0x3b51bf>=_0x425fa1){_0x3b51bf=_0x425fa1;_0x1e7b65=0xc8;}else{_0x1e7b65=0xce;}_0x2b1a43[_0xefd2('0x2c')](_0x1e7b65);return _0x2b1a43[_0xefd2('0x32')](_0xefd2('0x33'),_0x54d82a+'-'+_0x3b51bf+'/'+_0x425fa1)['json'](_0x50172a);}return null;};}function patchUpdates(_0x54b949){return function(_0x49b6ca){try{jsonpatch[_0xefd2('0x34')](_0x49b6ca,_0x54b949,!![]);}catch(_0x4f1d90){return BPromise[_0xefd2('0x35')](_0x4f1d90);}return _0x49b6ca[_0xefd2('0x36')]();};}function saveUpdates(_0x44d312,_0x407c00){return function(_0x39c577){if(_0x39c577){return _0x39c577[_0xefd2('0x37')](_0x44d312)[_0xefd2('0x1f')](function(_0xa4f7aa){return _0xa4f7aa;});}return null;};}function removeEntity(_0x220641,_0x3c67a0){return function(_0xc3a50e){if(_0xc3a50e){return _0xc3a50e[_0xefd2('0x38')]()[_0xefd2('0x1f')](function(){var _0x3e8486=_0xc3a50e[_0xefd2('0x39')]({'plain':!![]});var _0x5e7e14=_0xefd2('0x3a');return db[_0xefd2('0x3b')][_0xefd2('0x38')]({'where':{'type':_0x5e7e14,'resourceId':_0x3e8486['id']}})[_0xefd2('0x1f')](function(){return _0xc3a50e;});})[_0xefd2('0x1f')](function(){_0x220641[_0xefd2('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b9f77,_0x439737){return function(_0x1c2f69){if(!_0x1c2f69){_0x4b9f77['sendStatus'](0x194);}return _0x1c2f69;};}function handleError(_0x2d0fd7,_0x47c94d){_0x47c94d=_0x47c94d||0x1f4;return function(_0x5b718e){logger[_0xefd2('0x25')](_0x5b718e[_0xefd2('0x3c')]);if(_0x5b718e[_0xefd2('0x3d')]){delete _0x5b718e[_0xefd2('0x3d')];}_0x2d0fd7['status'](_0x47c94d)[_0xefd2('0x3e')](_0x5b718e);};}exports['index']=function(_0x22a9da,_0x3d2281){var _0x5651ae={},_0x1e4f06={},_0x9083b7={'count':0x0,'rows':[]};var _0x4ea5b5=db[_0xefd2('0x3f')][_0xefd2('0x40')];_0x1e4f06[_0xefd2('0x41')]=_[_0xefd2('0x42')](_0x4ea5b5);_0x1e4f06[_0xefd2('0x43')]=_[_0xefd2('0x42')](_0x22a9da['query']);_0x1e4f06[_0xefd2('0x44')]=_[_0xefd2('0x45')](_0x1e4f06[_0xefd2('0x41')],_0x1e4f06[_0xefd2('0x43')]);_0x5651ae[_0xefd2('0x46')]=_[_0xefd2('0x45')](_0x1e4f06[_0xefd2('0x41')],qs[_0xefd2('0x47')](_0x22a9da[_0xefd2('0x43')][_0xefd2('0x47')]));_0x5651ae[_0xefd2('0x46')]=_0x5651ae[_0xefd2('0x46')]['length']?_0x5651ae[_0xefd2('0x46')]:_0x1e4f06[_0xefd2('0x41')];if(!_0x22a9da[_0xefd2('0x43')]['hasOwnProperty']('nolimit')){_0x5651ae[_0xefd2('0x31')]=qs[_0xefd2('0x31')](_0x22a9da['query'][_0xefd2('0x31')]);_0x5651ae[_0xefd2('0x30')]=qs[_0xefd2('0x30')](_0x22a9da['query'][_0xefd2('0x30')]);}_0x5651ae[_0xefd2('0x48')]=qs[_0xefd2('0x49')](_0x22a9da['query']['sort']);_0x5651ae[_0xefd2('0x4a')]=qs[_0xefd2('0x44')](_['pick'](_0x22a9da[_0xefd2('0x43')],_0x1e4f06['filters']));if(_0x22a9da[_0xefd2('0x43')][_0xefd2('0x4b')]){_0x5651ae[_0xefd2('0x4a')]=_['merge'](_0x5651ae[_0xefd2('0x4a')],{'$or':_[_0xefd2('0x4c')](_0x4ea5b5,function(_0xea41fb){if(_0xea41fb['type'][_0xefd2('0x4d')]!==_0xefd2('0x4e')){var _0x2ad819={};_0x2ad819[_0xea41fb[_0xefd2('0x4f')]]={'$like':'%'+_0x22a9da[_0xefd2('0x43')][_0xefd2('0x4b')]+'%'};return _0x2ad819;}})});}_0x5651ae=_['merge']({},_0x5651ae,_0x22a9da[_0xefd2('0x50')]);var _0x22a70e={'where':_0x5651ae['where']};return db[_0xefd2('0x3f')][_0xefd2('0x2f')](_0x22a70e)[_0xefd2('0x1f')](function(_0x13231a){_0x9083b7[_0xefd2('0x2f')]=_0x13231a;if(_0x22a9da[_0xefd2('0x43')][_0xefd2('0x51')]){_0x5651ae[_0xefd2('0x52')]=[{'all':!![]}];}return db[_0xefd2('0x3f')][_0xefd2('0x53')](_0x5651ae);})[_0xefd2('0x1f')](function(_0x5d0b3d){_0x9083b7[_0xefd2('0x54')]=_0x5d0b3d;return _0x9083b7;})['then'](respondWithFilteredResult(_0x3d2281,_0x5651ae))['catch'](handleError(_0x3d2281,null));};exports[_0xefd2('0x55')]=function(_0x343542,_0x48f5e4){var _0x231c92={'raw':![],'where':{'id':_0x343542[_0xefd2('0x56')]['id']}},_0x3e523d={};_0x3e523d['model']=_['keys'](db[_0xefd2('0x3f')][_0xefd2('0x40')]);_0x3e523d['query']=_[_0xefd2('0x42')](_0x343542['query']);_0x3e523d[_0xefd2('0x44')]=_[_0xefd2('0x45')](_0x3e523d[_0xefd2('0x41')],_0x3e523d[_0xefd2('0x43')]);_0x231c92[_0xefd2('0x46')]=_['intersection'](_0x3e523d[_0xefd2('0x41')],qs[_0xefd2('0x47')](_0x343542['query']['fields']));_0x231c92[_0xefd2('0x46')]=_0x231c92[_0xefd2('0x46')][_0xefd2('0x57')]?_0x231c92[_0xefd2('0x46')]:_0x3e523d[_0xefd2('0x41')];if(_0x343542[_0xefd2('0x43')][_0xefd2('0x51')]){_0x231c92[_0xefd2('0x52')]=[{'all':!![]}];}_0x231c92=_[_0xefd2('0x58')]({},_0x231c92,_0x343542[_0xefd2('0x50')]);return db[_0xefd2('0x3f')][_0xefd2('0x59')](_0x231c92)['then'](handleEntityNotFound(_0x48f5e4,null))[_0xefd2('0x1f')](respondWithResult(_0x48f5e4,null))[_0xefd2('0x2a')](handleError(_0x48f5e4,null));};exports[_0xefd2('0x5a')]=function(_0x2d77c9,_0xcb447a){var _0x5a5673={'raw':![],'where':{'id':_0x2d77c9[_0xefd2('0x56')]['id']}},_0x5d30c2={};_0x5d30c2[_0xefd2('0x41')]=_[_0xefd2('0x42')](db[_0xefd2('0x3f')]['rawAttributes']);_0x5a5673[_0xefd2('0x46')]=_['intersection'](_0x5d30c2['model'],qs[_0xefd2('0x47')](_0x2d77c9[_0xefd2('0x43')][_0xefd2('0x47')]));_0x5a5673[_0xefd2('0x46')]=_0x5a5673[_0xefd2('0x46')]['length']?_0x5a5673[_0xefd2('0x46')]:_0x5d30c2[_0xefd2('0x41')];if(_0x2d77c9[_0xefd2('0x43')][_0xefd2('0x51')]){_0x5a5673[_0xefd2('0x52')]=[{'all':!![]}];}_0x5a5673=_[_0xefd2('0x58')]({},_0x5a5673,_0x2d77c9[_0xefd2('0x50')]);return db[_0xefd2('0x3f')][_0xefd2('0x59')](_0x5a5673)[_0xefd2('0x1f')](handleEntityNotFound(_0xcb447a,null))['then'](function(_0x17c2b0){if(_0x17c2b0){var _0x256476=_0x17c2b0[_0xefd2('0x39')]({'plain':!![]});_0x256476=qs[_0xefd2('0x5b')](_0x256476,['id',_0xefd2('0x5c'),'updatedAt']);_0x2d77c9[_0xefd2('0x5d')]=_[_0xefd2('0x5b')](_0x2d77c9['body'],['id',_0xefd2('0x5c'),_0xefd2('0x5e')]);return db[_0xefd2('0x3f')][_0xefd2('0x5f')](_[_0xefd2('0x58')](_0x256476,_0x2d77c9[_0xefd2('0x5d')]),{'include':_0x2d77c9[_0xefd2('0x43')][_0xefd2('0x51')]?[{'all':!![]}]:undefined})[_0xefd2('0x1f')](function(_0x583860){var _0x35ade4=_0x2d77c9[_0xefd2('0x60')][_0xefd2('0x39')]({'plain':!![]});if(!_0x35ade4)throw new Error(_0xefd2('0x61'));if(_0x35ade4[_0xefd2('0x62')]==='user'){var _0x1e6d7d=_0x583860[_0xefd2('0x39')]({'plain':!![]});var _0x85236a=_0xefd2('0x3a');return db[_0xefd2('0x63')][_0xefd2('0x59')]({'where':{'name':_0x85236a,'userProfileId':_0x35ade4[_0xefd2('0x64')]},'raw':!![]})[_0xefd2('0x1f')](function(_0x20ce08){if(_0x20ce08&&_0x20ce08[_0xefd2('0x65')]===0x0){return db[_0xefd2('0x3b')][_0xefd2('0x5f')]({'name':_0x1e6d7d['name'],'resourceId':_0x1e6d7d['id'],'type':_0x20ce08[_0xefd2('0x3d')],'sectionId':_0x20ce08['id']},{})[_0xefd2('0x1f')](function(){return _0x583860;});}else{return _0x583860;}})['catch'](function(_0x10f3dc){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10f3dc);throw _0x10f3dc;});}return _0x583860;});}})[_0xefd2('0x1f')](respondWithResult(_0xcb447a,0xc9))['catch'](handleError(_0xcb447a,null));};exports[_0xefd2('0x5f')]=function(_0x320cde,_0x50da52,_0x2d459d){var _0x3f78d6;return db[_0xefd2('0x3f')][_0xefd2('0x5f')](_0x320cde[_0xefd2('0x5d')],{'raw':!![]})['then'](function(_0xa9c556){_0x3f78d6=_0xa9c556;return db['Trunk'][_0xefd2('0x53')]({'raw':!![]});})[_0xefd2('0x1f')](function(_0x2291e0){var _0x41577f=fs[_0xefd2('0x66')](path[_0xefd2('0x67')](config[_0xefd2('0x68')],_0xefd2('0x69')),_0xefd2('0x6a'));var _0xf7abfa=fs[_0xefd2('0x66')](path['join'](config['root'],_0xefd2('0x6b')),_0xefd2('0x6a'));var _0x3d399b=ejs[_0xefd2('0x6c')](_0x41577f,{'trunks':_0x2291e0||[]});fs[_0xefd2('0x6d')](_0xefd2('0x6e'),_0x3d399b);if(_0x3f78d6[_0xefd2('0x6f')]){var _0x4ffda7=ejs[_0xefd2('0x6c')](_0xf7abfa,{'trunks':_0x2291e0||[]});fs[_0xefd2('0x6d')](_0xefd2('0x70'),_0x4ffda7);}})[_0xefd2('0x1f')](function(){return respondWithRpcPromise(_0xefd2('0x71'),_0xefd2('0x5f'),{'module':_0xefd2('0x72')});})[_0xefd2('0x1f')](function(){var _0x4d5a45=_0x320cde[_0xefd2('0x60')][_0xefd2('0x39')]({'plain':!![]});if(!_0x4d5a45)throw new Error(_0xefd2('0x61'));if(_0x4d5a45[_0xefd2('0x62')]===_0xefd2('0x60')){var _0x1f0d10=_0x3f78d6['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xefd2('0x3a'),'userProfileId':_0x4d5a45['userProfileId']},'raw':!![]})[_0xefd2('0x1f')](function(_0x113131){if(_0x113131&&_0x113131[_0xefd2('0x65')]===0x0){return db[_0xefd2('0x3b')][_0xefd2('0x5f')]({'name':_0x1f0d10[_0xefd2('0x3d')],'resourceId':_0x1f0d10['id'],'type':_0x113131['name'],'sectionId':_0x113131['id']},{})[_0xefd2('0x1f')](function(){return _0x3f78d6;});}else{return _0x3f78d6;}})[_0xefd2('0x2a')](function(_0x274009){logger[_0xefd2('0x25')](_0xefd2('0x73'),_0x274009);throw _0x274009;});}return _0x3f78d6;})['then'](respondWithResult(_0x50da52,0xc9))[_0xefd2('0x2a')](handleError(_0x50da52,null));};exports['update']=function(_0x299497,_0x3b26f1,_0x2a749b){var _0x111c33;return db[_0xefd2('0x3f')]['find']({'where':{'id':_0x299497[_0xefd2('0x56')]['id']}})[_0xefd2('0x1f')](handleEntityNotFound(_0x3b26f1,null))[_0xefd2('0x1f')](saveUpdates(_0x299497['body'],null))[_0xefd2('0x1f')](function(_0x32b6f6){if(_0x32b6f6){_0x111c33=_0x32b6f6;return db[_0xefd2('0x3f')]['findAll']({'raw':!![]});}})[_0xefd2('0x1f')](function(_0x389623){if(_0x389623){var _0x30303b=fs[_0xefd2('0x66')](path[_0xefd2('0x67')](config[_0xefd2('0x68')],'server/files/templates/trunk.ejs'),_0xefd2('0x6a'));var _0x52044c=fs[_0xefd2('0x66')](path[_0xefd2('0x67')](config[_0xefd2('0x68')],_0xefd2('0x6b')),_0xefd2('0x6a'));var _0xd65098=ejs[_0xefd2('0x6c')](_0x30303b,{'trunks':_0x389623||[]});fs[_0xefd2('0x6d')](_0xefd2('0x6e'),_0xd65098);var _0x195e26=ejs[_0xefd2('0x6c')](_0x52044c,{'trunks':_0x389623||[]});fs[_0xefd2('0x6d')](_0xefd2('0x70'),_0x195e26);return respondWithRpcPromise('Reload',_0xefd2('0x37'),{'module':_0xefd2('0x72')});}return null;})[_0xefd2('0x1f')](function(_0x556c6d){if(_0x556c6d){return _0x111c33;}})[_0xefd2('0x1f')](respondWithResult(_0x3b26f1,null))[_0xefd2('0x2a')](handleError(_0x3b26f1,null));};exports['destroy']=function(_0x229346,_0x16d8b6,_0x321b0f){var _0x538c6d;return db[_0xefd2('0x3f')]['find']({'where':{'id':_0x229346[_0xefd2('0x56')]['id']}})['then'](handleEntityNotFound(_0x16d8b6,null))[_0xefd2('0x1f')](removeEntity(_0x16d8b6,null))[_0xefd2('0x1f')](function(){return db[_0xefd2('0x3f')][_0xefd2('0x53')]({'raw':!![]});})['then'](function(_0x40601a){var _0x140e4c=fs[_0xefd2('0x66')](path[_0xefd2('0x67')](config[_0xefd2('0x68')],_0xefd2('0x69')),_0xefd2('0x6a'));var _0x285fa7=fs[_0xefd2('0x66')](path[_0xefd2('0x67')](config[_0xefd2('0x68')],_0xefd2('0x6b')),_0xefd2('0x6a'));var _0x44c59c=ejs[_0xefd2('0x6c')](_0x140e4c,{'trunks':_0x40601a});var _0x1a1962=ejs['render'](_0x285fa7,{'trunks':_0x40601a});fs[_0xefd2('0x6d')](_0xefd2('0x6e'),_0x44c59c);fs[_0xefd2('0x6d')](_0xefd2('0x70'),_0x1a1962);return respondWithRpcPromise(_0xefd2('0x71'),_0xefd2('0x38'),{'module':'chan_sip.so'});})[_0xefd2('0x2a')](handleError(_0x16d8b6,null));}; \ No newline at end of file +var _0xf759=['/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','/etc/asterisk/sip_xcally_registers.conf','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','json','count','limit','set','Content-Range','apply','update','destroy','get','Trunks','end','stack','name','send','index','Trunk','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','findAll','rows','show','fields','include','find','clone','params','omit','updatedAt','body','createdAt','create','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','writeFileSync'];(function(_0x949757,_0x4b454f){var _0x38f215=function(_0x28ff32){while(--_0x28ff32){_0x949757['push'](_0x949757['shift']());}};_0x38f215(++_0x4b454f);}(_0xf759,0x154));var _0x9f75=function(_0x22ab2b,_0x4c6d3a){_0x22ab2b=_0x22ab2b-0x0;var _0x40fced=_0xf759[_0x22ab2b];return _0x40fced;};'use strict';var pdf=require(_0x9f75('0x0'));var emlformat=require(_0x9f75('0x1'));var rimraf=require(_0x9f75('0x2'));var zipdir=require(_0x9f75('0x3'));var jsonpatch=require(_0x9f75('0x4'));var rp=require(_0x9f75('0x5'));var moment=require(_0x9f75('0x6'));var BPromise=require(_0x9f75('0x7'));var Mustache=require(_0x9f75('0x8'));var util=require(_0x9f75('0x9'));var path=require(_0x9f75('0xa'));var sox=require('sox');var csv=require(_0x9f75('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9f75('0xc'));var squel=require('squel');var crypto=require(_0x9f75('0xd'));var jsforce=require(_0x9f75('0xe'));var deskjs=require(_0x9f75('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9f75('0x10'));var Papa=require(_0x9f75('0x11'));var Redis=require(_0x9f75('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9f75('0x13'))('api');var utils=require(_0x9f75('0x14'));var config=require(_0x9f75('0x15'));var db=require(_0x9f75('0x16'))['db'];var jayson=require(_0x9f75('0x17'));var client=jayson[_0x9f75('0x18')][_0x9f75('0x19')]({'port':0x232a});function checkPasswordPattern(_0x5a1331,_0x4777df,_0x3928e4){if(_0x3928e4){var _0x3e3967=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3e3967[_0x9f75('0x1a')](_0x4777df)){return _0x5a1331;}else{throw new Error(_0x9f75('0x1b'));}}else{return _0x5a1331;}}function respondWithRpcPromise(_0x4e9e5b,_0x422b03,_0x2bdaa7,_0x37c2d8){return new BPromise(function(_0x2c4916,_0xe63ae1){var _0x3d945e=_0x37c2d8||client;return _0x3d945e['request'](_0x4e9e5b,_0x2bdaa7)[_0x9f75('0x1c')](function(_0x9fd9f3){logger[_0x9f75('0x1d')](_0x9f75('0x1e'),_0x422b03,'request\x20sent');logger['debug'](_0x9f75('0x1f'),_0x422b03,_0x9f75('0x20'),JSON[_0x9f75('0x21')](_0x9fd9f3));if(_0x9fd9f3[_0x9f75('0x22')]){if(_0x9fd9f3[_0x9f75('0x22')]['code']===0x1f4){logger[_0x9f75('0x22')](_0x9f75('0x1e'),_0x422b03,_0x9fd9f3['error'][_0x9f75('0x23')]);return _0xe63ae1(_0x9fd9f3[_0x9f75('0x22')][_0x9f75('0x23')]);}logger[_0x9f75('0x22')](_0x9f75('0x1e'),_0x422b03,_0x9fd9f3[_0x9f75('0x22')][_0x9f75('0x23')]);return _0x2c4916(_0x9fd9f3[_0x9f75('0x22')][_0x9f75('0x23')]);}else{logger['info'](_0x9f75('0x1e'),_0x422b03,'request\x20sent');_0x2c4916(_0x9fd9f3['result'][_0x9f75('0x23')]);}})[_0x9f75('0x24')](function(_0x3b4f03){logger[_0x9f75('0x22')]('Trunk,\x20%s,\x20%s',_0x422b03,_0x3b4f03);_0xe63ae1(_0x3b4f03);});});}function respondWithStatusCode(_0x312cf4,_0x13770d){_0x13770d=_0x13770d||0xcc;return function(_0x517c00){if(_0x517c00){return _0x312cf4[_0x9f75('0x25')](_0x13770d);}return _0x312cf4['status'](_0x13770d)['end']();};}function respondWithResult(_0x59bb31,_0x3740ba){_0x3740ba=_0x3740ba||0xc8;return function(_0xb9b60c){if(_0xb9b60c){return _0x59bb31[_0x9f75('0x26')](_0x3740ba)[_0x9f75('0x27')](_0xb9b60c);}};}function respondWithFilteredResult(_0x566c0b,_0x2e0306){return function(_0x5ad92e){if(_0x5ad92e){var _0x21333c=_0x5ad92e[_0x9f75('0x28')],_0x890832=_0x2e0306['offset'],_0x3fbc5f=_0x2e0306['offset']+_0x2e0306[_0x9f75('0x29')],_0x1191af;if(_0x3fbc5f>=_0x21333c){_0x3fbc5f=_0x21333c;_0x1191af=0xc8;}else{_0x1191af=0xce;}_0x566c0b[_0x9f75('0x26')](_0x1191af);return _0x566c0b[_0x9f75('0x2a')](_0x9f75('0x2b'),_0x890832+'-'+_0x3fbc5f+'/'+_0x21333c)[_0x9f75('0x27')](_0x5ad92e);}return null;};}function patchUpdates(_0x2fabdd){return function(_0x31b23a){try{jsonpatch[_0x9f75('0x2c')](_0x31b23a,_0x2fabdd,!![]);}catch(_0x1b84f4){return BPromise['reject'](_0x1b84f4);}return _0x31b23a['save']();};}function saveUpdates(_0x260ab1,_0x3d1cb2){return function(_0x2533ad){if(_0x2533ad){return _0x2533ad[_0x9f75('0x2d')](_0x260ab1)[_0x9f75('0x1c')](function(_0x53d3b6){return _0x53d3b6;});}return null;};}function removeEntity(_0xe9baf9,_0x1fbd9b){return function(_0x2a1951){if(_0x2a1951){return _0x2a1951[_0x9f75('0x2e')]()['then'](function(){var _0x26635b=_0x2a1951[_0x9f75('0x2f')]({'plain':!![]});var _0x543b99=_0x9f75('0x30');return db['UserProfileResource'][_0x9f75('0x2e')]({'where':{'type':_0x543b99,'resourceId':_0x26635b['id']}})[_0x9f75('0x1c')](function(){return _0x2a1951;});})[_0x9f75('0x1c')](function(){_0xe9baf9[_0x9f75('0x26')](0xcc)[_0x9f75('0x31')]();});}};}function handleEntityNotFound(_0x4acff8,_0x57ec98){return function(_0x304aa0){if(!_0x304aa0){_0x4acff8[_0x9f75('0x25')](0x194);}return _0x304aa0;};}function handleError(_0xa9e78e,_0x1c387f){_0x1c387f=_0x1c387f||0x1f4;return function(_0x434543){logger[_0x9f75('0x22')](_0x434543[_0x9f75('0x32')]);if(_0x434543[_0x9f75('0x33')]){delete _0x434543[_0x9f75('0x33')];}_0xa9e78e[_0x9f75('0x26')](_0x1c387f)[_0x9f75('0x34')](_0x434543);};}exports[_0x9f75('0x35')]=function(_0x23cde3,_0x43a5a3){var _0x5ea26f={},_0x5e40a9={},_0x3e2f51={'count':0x0,'rows':[]};var _0x166ad8=db[_0x9f75('0x36')][_0x9f75('0x37')];_0x5e40a9[_0x9f75('0x38')]=_[_0x9f75('0x39')](_0x166ad8);_0x5e40a9[_0x9f75('0x3a')]=_['keys'](_0x23cde3[_0x9f75('0x3a')]);_0x5e40a9[_0x9f75('0x3b')]=_[_0x9f75('0x3c')](_0x5e40a9[_0x9f75('0x38')],_0x5e40a9[_0x9f75('0x3a')]);_0x5ea26f[_0x9f75('0x3d')]=_['intersection'](_0x5e40a9[_0x9f75('0x38')],qs['fields'](_0x23cde3[_0x9f75('0x3a')]['fields']));_0x5ea26f[_0x9f75('0x3d')]=_0x5ea26f[_0x9f75('0x3d')][_0x9f75('0x3e')]?_0x5ea26f['attributes']:_0x5e40a9[_0x9f75('0x38')];if(!_0x23cde3[_0x9f75('0x3a')][_0x9f75('0x3f')](_0x9f75('0x40'))){_0x5ea26f[_0x9f75('0x29')]=qs[_0x9f75('0x29')](_0x23cde3[_0x9f75('0x3a')][_0x9f75('0x29')]);_0x5ea26f[_0x9f75('0x41')]=qs[_0x9f75('0x41')](_0x23cde3['query'][_0x9f75('0x41')]);}_0x5ea26f[_0x9f75('0x42')]=qs[_0x9f75('0x43')](_0x23cde3[_0x9f75('0x3a')][_0x9f75('0x43')]);_0x5ea26f[_0x9f75('0x44')]=qs['filters'](_[_0x9f75('0x45')](_0x23cde3[_0x9f75('0x3a')],_0x5e40a9[_0x9f75('0x3b')]));if(_0x23cde3[_0x9f75('0x3a')][_0x9f75('0x46')]){_0x5ea26f['where']=_[_0x9f75('0x47')](_0x5ea26f[_0x9f75('0x44')],{'$or':_[_0x9f75('0x48')](_0x166ad8,function(_0x88ce29){if(_0x88ce29[_0x9f75('0x49')][_0x9f75('0x4a')]!==_0x9f75('0x4b')){var _0x38bc85={};_0x38bc85[_0x88ce29['field']]={'$like':'%'+_0x23cde3[_0x9f75('0x3a')][_0x9f75('0x46')]+'%'};return _0x38bc85;}})});}_0x5ea26f=_[_0x9f75('0x47')]({},_0x5ea26f,_0x23cde3[_0x9f75('0x4c')]);var _0xc832={'where':_0x5ea26f[_0x9f75('0x44')]};return db[_0x9f75('0x36')][_0x9f75('0x28')](_0xc832)[_0x9f75('0x1c')](function(_0x54072c){_0x3e2f51[_0x9f75('0x28')]=_0x54072c;if(_0x23cde3[_0x9f75('0x3a')][_0x9f75('0x4d')]){_0x5ea26f['include']=[{'all':!![]}];}return db[_0x9f75('0x36')][_0x9f75('0x4e')](_0x5ea26f);})[_0x9f75('0x1c')](function(_0x19fb92){_0x3e2f51[_0x9f75('0x4f')]=_0x19fb92;return _0x3e2f51;})[_0x9f75('0x1c')](respondWithFilteredResult(_0x43a5a3,_0x5ea26f))[_0x9f75('0x24')](handleError(_0x43a5a3,null));};exports[_0x9f75('0x50')]=function(_0x5babb1,_0x4a6dc5){var _0x47a217={'raw':![],'where':{'id':_0x5babb1['params']['id']}},_0x5b579={};_0x5b579[_0x9f75('0x38')]=_[_0x9f75('0x39')](db[_0x9f75('0x36')]['rawAttributes']);_0x5b579['query']=_[_0x9f75('0x39')](_0x5babb1[_0x9f75('0x3a')]);_0x5b579[_0x9f75('0x3b')]=_[_0x9f75('0x3c')](_0x5b579[_0x9f75('0x38')],_0x5b579[_0x9f75('0x3a')]);_0x47a217[_0x9f75('0x3d')]=_['intersection'](_0x5b579[_0x9f75('0x38')],qs[_0x9f75('0x51')](_0x5babb1[_0x9f75('0x3a')][_0x9f75('0x51')]));_0x47a217[_0x9f75('0x3d')]=_0x47a217['attributes']['length']?_0x47a217['attributes']:_0x5b579[_0x9f75('0x38')];if(_0x5babb1[_0x9f75('0x3a')]['includeAll']){_0x47a217[_0x9f75('0x52')]=[{'all':!![]}];}_0x47a217=_['merge']({},_0x47a217,_0x5babb1[_0x9f75('0x4c')]);return db[_0x9f75('0x36')][_0x9f75('0x53')](_0x47a217)[_0x9f75('0x1c')](handleEntityNotFound(_0x4a6dc5,null))[_0x9f75('0x1c')](respondWithResult(_0x4a6dc5,null))['catch'](handleError(_0x4a6dc5,null));};exports[_0x9f75('0x54')]=function(_0x46a94e,_0x55368a){var _0x43041f={'raw':![],'where':{'id':_0x46a94e[_0x9f75('0x55')]['id']}},_0x5c6d9d={};_0x5c6d9d[_0x9f75('0x38')]=_[_0x9f75('0x39')](db[_0x9f75('0x36')][_0x9f75('0x37')]);_0x43041f[_0x9f75('0x3d')]=_[_0x9f75('0x3c')](_0x5c6d9d['model'],qs['fields'](_0x46a94e[_0x9f75('0x3a')][_0x9f75('0x51')]));_0x43041f[_0x9f75('0x3d')]=_0x43041f[_0x9f75('0x3d')][_0x9f75('0x3e')]?_0x43041f['attributes']:_0x5c6d9d[_0x9f75('0x38')];if(_0x46a94e[_0x9f75('0x3a')][_0x9f75('0x4d')]){_0x43041f[_0x9f75('0x52')]=[{'all':!![]}];}_0x43041f=_[_0x9f75('0x47')]({},_0x43041f,_0x46a94e[_0x9f75('0x4c')]);return db[_0x9f75('0x36')]['find'](_0x43041f)['then'](handleEntityNotFound(_0x55368a,null))[_0x9f75('0x1c')](function(_0x21b213){if(_0x21b213){var _0x3d632e=_0x21b213[_0x9f75('0x2f')]({'plain':!![]});_0x3d632e=qs[_0x9f75('0x56')](_0x3d632e,['id','createdAt',_0x9f75('0x57')]);_0x46a94e[_0x9f75('0x58')]=_[_0x9f75('0x56')](_0x46a94e[_0x9f75('0x58')],['id',_0x9f75('0x59'),_0x9f75('0x57')]);return db[_0x9f75('0x36')][_0x9f75('0x5a')](_['merge'](_0x3d632e,_0x46a94e[_0x9f75('0x58')]),{'include':_0x46a94e[_0x9f75('0x3a')][_0x9f75('0x4d')]?[{'all':!![]}]:undefined})[_0x9f75('0x1c')](function(_0x307e25){var _0x41d090=_0x46a94e[_0x9f75('0x5b')][_0x9f75('0x2f')]({'plain':!![]});if(!_0x41d090)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41d090['role']==='user'){var _0x68b895=_0x307e25[_0x9f75('0x2f')]({'plain':!![]});var _0x1c333f=_0x9f75('0x30');return db[_0x9f75('0x5c')]['find']({'where':{'name':_0x1c333f,'userProfileId':_0x41d090[_0x9f75('0x5d')]},'raw':!![]})['then'](function(_0x4a892a){if(_0x4a892a&&_0x4a892a[_0x9f75('0x5e')]===0x0){return db[_0x9f75('0x5f')][_0x9f75('0x5a')]({'name':_0x68b895[_0x9f75('0x33')],'resourceId':_0x68b895['id'],'type':_0x4a892a[_0x9f75('0x33')],'sectionId':_0x4a892a['id']},{})[_0x9f75('0x1c')](function(){return _0x307e25;});}else{return _0x307e25;}})[_0x9f75('0x24')](function(_0x40c521){logger[_0x9f75('0x22')](_0x9f75('0x60'),_0x40c521);throw _0x40c521;});}return _0x307e25;});}})['then'](respondWithResult(_0x55368a,0xc9))[_0x9f75('0x24')](handleError(_0x55368a,null));};exports[_0x9f75('0x5a')]=function(_0x1a69b8,_0x495152,_0x398e1b){var _0x419b01;return db[_0x9f75('0x36')][_0x9f75('0x5a')](_0x1a69b8[_0x9f75('0x58')],{'raw':!![]})[_0x9f75('0x1c')](function(_0x286472){_0x419b01=_0x286472;return db[_0x9f75('0x36')][_0x9f75('0x4e')]({'raw':!![]});})[_0x9f75('0x1c')](function(_0x61ba4){var _0x3247fe=fs[_0x9f75('0x61')](path[_0x9f75('0x62')](config[_0x9f75('0x63')],_0x9f75('0x64')),_0x9f75('0x65'));var _0x2d2b3d=fs[_0x9f75('0x61')](path[_0x9f75('0x62')](config[_0x9f75('0x63')],'server/files/templates/registry.ejs'),'utf8');var _0x31a7f2=ejs[_0x9f75('0x66')](_0x3247fe,{'trunks':_0x61ba4||[]});fs[_0x9f75('0x67')](_0x9f75('0x68'),_0x31a7f2);if(_0x419b01[_0x9f75('0x69')]){var _0x43cee2=ejs[_0x9f75('0x66')](_0x2d2b3d,{'trunks':_0x61ba4||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x43cee2);}})[_0x9f75('0x1c')](function(){return respondWithRpcPromise(_0x9f75('0x6a'),_0x9f75('0x5a'),{'module':_0x9f75('0x6b')});})[_0x9f75('0x1c')](function(){var _0x1d3af2=_0x1a69b8[_0x9f75('0x5b')][_0x9f75('0x2f')]({'plain':!![]});if(!_0x1d3af2)throw new Error(_0x9f75('0x6c'));if(_0x1d3af2[_0x9f75('0x6d')]===_0x9f75('0x5b')){var _0x23074c=_0x419b01['get']({'plain':!![]});return db[_0x9f75('0x5c')][_0x9f75('0x53')]({'where':{'name':'Trunks','userProfileId':_0x1d3af2[_0x9f75('0x5d')]},'raw':!![]})[_0x9f75('0x1c')](function(_0x25e7ce){if(_0x25e7ce&&_0x25e7ce[_0x9f75('0x5e')]===0x0){return db[_0x9f75('0x5f')][_0x9f75('0x5a')]({'name':_0x23074c['name'],'resourceId':_0x23074c['id'],'type':_0x25e7ce['name'],'sectionId':_0x25e7ce['id']},{})['then'](function(){return _0x419b01;});}else{return _0x419b01;}})[_0x9f75('0x24')](function(_0x5ac9c8){logger['error'](_0x9f75('0x60'),_0x5ac9c8);throw _0x5ac9c8;});}return _0x419b01;})['then'](respondWithResult(_0x495152,0xc9))[_0x9f75('0x24')](handleError(_0x495152,null));};exports[_0x9f75('0x2d')]=function(_0x4121c2,_0x18c299,_0x331656){var _0x58957c;return db['Trunk'][_0x9f75('0x53')]({'where':{'id':_0x4121c2[_0x9f75('0x55')]['id']}})['then'](handleEntityNotFound(_0x18c299,null))[_0x9f75('0x1c')](saveUpdates(_0x4121c2[_0x9f75('0x58')],null))['then'](function(_0x136fec){if(_0x136fec){_0x58957c=_0x136fec;return db['Trunk'][_0x9f75('0x4e')]({'raw':!![]});}})[_0x9f75('0x1c')](function(_0x159f4a){if(_0x159f4a){var _0x538241=fs['readFileSync'](path['join'](config['root'],'server/files/templates/trunk.ejs'),_0x9f75('0x65'));var _0x50daea=fs[_0x9f75('0x61')](path[_0x9f75('0x62')](config[_0x9f75('0x63')],'server/files/templates/registry.ejs'),_0x9f75('0x65'));var _0x2316fe=ejs[_0x9f75('0x66')](_0x538241,{'trunks':_0x159f4a||[]});fs['writeFileSync'](_0x9f75('0x68'),_0x2316fe);var _0x20a2ca=ejs[_0x9f75('0x66')](_0x50daea,{'trunks':_0x159f4a||[]});fs[_0x9f75('0x67')](_0x9f75('0x6e'),_0x20a2ca);return respondWithRpcPromise(_0x9f75('0x6a'),_0x9f75('0x2d'),{'module':_0x9f75('0x6b')});}return null;})[_0x9f75('0x1c')](function(_0x5cfa05){if(_0x5cfa05){return _0x58957c;}})[_0x9f75('0x1c')](respondWithResult(_0x18c299,null))[_0x9f75('0x24')](handleError(_0x18c299,null));};exports[_0x9f75('0x2e')]=function(_0x79b8b8,_0x227b5e,_0x4f9876){var _0x27be4d;return db[_0x9f75('0x36')][_0x9f75('0x53')]({'where':{'id':_0x79b8b8[_0x9f75('0x55')]['id']}})[_0x9f75('0x1c')](handleEntityNotFound(_0x227b5e,null))[_0x9f75('0x1c')](removeEntity(_0x227b5e,null))[_0x9f75('0x1c')](function(){return db[_0x9f75('0x36')][_0x9f75('0x4e')]({'raw':!![]});})[_0x9f75('0x1c')](function(_0x38b17e){var _0x1360ac=fs['readFileSync'](path['join'](config[_0x9f75('0x63')],_0x9f75('0x64')),_0x9f75('0x65'));var _0x4f6b36=fs[_0x9f75('0x61')](path['join'](config['root'],'server/files/templates/registry.ejs'),_0x9f75('0x65'));var _0x37be54=ejs['render'](_0x1360ac,{'trunks':_0x38b17e});var _0x5e8f0d=ejs[_0x9f75('0x66')](_0x4f6b36,{'trunks':_0x38b17e});fs[_0x9f75('0x67')](_0x9f75('0x68'),_0x37be54);fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x5e8f0d);return respondWithRpcPromise('Reload',_0x9f75('0x2e'),{'module':_0x9f75('0x6b')});})[_0x9f75('0x24')](handleError(_0x227b5e,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 66364cf..9c4a7a2 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 _0xd6ce=['../../config/logger','api','moment','bluebird','request-promise','path','./trunk.attributes','exports','tools_trunks','lodash','util'];(function(_0x1f98cd,_0x292a8c){var _0x3de9e9=function(_0xe848c1){while(--_0xe848c1){_0x1f98cd['push'](_0x1f98cd['shift']());}};_0x3de9e9(++_0x292a8c);}(_0xd6ce,0x127));var _0xed6c=function(_0x4fb906,_0x158d3d){_0x4fb906=_0x4fb906-0x0;var _0xd621cd=_0xd6ce[_0x4fb906];return _0xd621cd;};'use strict';var _=require(_0xed6c('0x0'));var util=require(_0xed6c('0x1'));var logger=require(_0xed6c('0x2'))(_0xed6c('0x3'));var moment=require(_0xed6c('0x4'));var BPromise=require(_0xed6c('0x5'));var rp=require(_0xed6c('0x6'));var fs=require('fs');var path=require(_0xed6c('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xed6c('0x8'));module[_0xed6c('0x9')]=function(_0x1a6d96,_0x1d0912){return _0x1a6d96['define']('Trunk',attributes,{'tableName':_0xed6c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf776=['Trunk','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./trunk.attributes','define'];(function(_0x2a7c0c,_0x4083a2){var _0x3f6f47=function(_0x4fd836){while(--_0x4fd836){_0x2a7c0c['push'](_0x2a7c0c['shift']());}};_0x3f6f47(++_0x4083a2);}(_0xf776,0x169));var _0x6f77=function(_0x5df4ae,_0x177e06){_0x5df4ae=_0x5df4ae-0x0;var _0x53714b=_0xf776[_0x5df4ae];return _0x53714b;};'use strict';var _=require(_0x6f77('0x0'));var util=require('util');var logger=require(_0x6f77('0x1'))(_0x6f77('0x2'));var moment=require('moment');var BPromise=require(_0x6f77('0x3'));var rp=require(_0x6f77('0x4'));var fs=require('fs');var path=require(_0x6f77('0x5'));var rimraf=require(_0x6f77('0x6'));var config=require('../../config/environment');var attributes=require(_0x6f77('0x7'));module['exports']=function(_0xf62e3e,_0x21909a){return _0xf62e3e[_0x6f77('0x8')](_0x6f77('0x9'),attributes,{'tableName':'tools_trunks','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 78f787f..5c3523a 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 _0x6f9b=['request\x20sent','catch','Trunk','findAll','options','where','limit','include','map','model','attributes','debug','GetTrunk','stringify','find','raw','ShowTrunk','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x5d5fa8,_0x121d30){var _0x147f58=function(_0x20204d){while(--_0x20204d){_0x5d5fa8['push'](_0x5d5fa8['shift']());}};_0x147f58(++_0x121d30);}(_0x6f9b,0x1d1));var _0xb6f9=function(_0x42ac99,_0x57151){_0x42ac99=_0x42ac99-0x0;var _0x2b6eeb=_0x6f9b[_0x42ac99];return _0x2b6eeb;};'use strict';var _=require(_0xb6f9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb6f9('0x1'));var fs=require('fs');var Redis=require(_0xb6f9('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb6f9('0x3'));var logger=require(_0xb6f9('0x4'))(_0xb6f9('0x5'));var config=require(_0xb6f9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb6f9('0x7')][_0xb6f9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x136519,_0x484ece,_0x2566d3){return new BPromise(function(_0x275a4e,_0x3f714d){return client[_0xb6f9('0x9')](_0x136519,_0x2566d3)[_0xb6f9('0xa')](function(_0x21bad1){logger['info'](_0xb6f9('0xb'),_0x484ece,'request\x20sent');logger['debug'](_0xb6f9('0xc'),_0x484ece,'request\x20sent',JSON['stringify'](_0x21bad1));if(_0x21bad1['error']){if(_0x21bad1[_0xb6f9('0xd')]['code']===0x1f4){logger['error'](_0xb6f9('0xb'),_0x484ece,_0x21bad1[_0xb6f9('0xd')][_0xb6f9('0xe')]);return _0x3f714d(_0x21bad1[_0xb6f9('0xd')]['message']);}logger[_0xb6f9('0xd')](_0xb6f9('0xb'),_0x484ece,_0x21bad1[_0xb6f9('0xd')][_0xb6f9('0xe')]);return _0x275a4e(_0x21bad1[_0xb6f9('0xd')]['message']);}else{logger['info'](_0xb6f9('0xb'),_0x484ece,_0xb6f9('0xf'));_0x275a4e(_0x21bad1['result'][_0xb6f9('0xe')]);}})[_0xb6f9('0x10')](function(_0x5d94a1){logger[_0xb6f9('0xd')](_0xb6f9('0xb'),_0x484ece,_0x5d94a1);_0x3f714d(_0x5d94a1);});});}exports['GetTrunk']=function(_0xd3f10){var _0x56577a=this;return new Promise(function(_0x5d8046,_0x41e456){return db[_0xb6f9('0x11')][_0xb6f9('0x12')]({'raw':_0xd3f10[_0xb6f9('0x13')]?_0xd3f10['options']['raw']===undefined?!![]:![]:!![],'where':_0xd3f10[_0xb6f9('0x13')]?_0xd3f10['options'][_0xb6f9('0x14')]||null:null,'attributes':_0xd3f10[_0xb6f9('0x13')]?_0xd3f10[_0xb6f9('0x13')]['attributes']||null:null,'limit':_0xd3f10[_0xb6f9('0x13')]?_0xd3f10[_0xb6f9('0x13')][_0xb6f9('0x15')]||null:null,'include':_0xd3f10['options']?_0xd3f10[_0xb6f9('0x13')][_0xb6f9('0x16')]?_[_0xb6f9('0x17')](_0xd3f10[_0xb6f9('0x13')]['include'],function(_0x353121){return{'model':db[_0x353121[_0xb6f9('0x18')]],'as':_0x353121['as'],'attributes':_0x353121[_0xb6f9('0x19')],'include':_0x353121[_0xb6f9('0x16')]?_[_0xb6f9('0x17')](_0x353121['include'],function(_0x10a015){return{'model':db[_0x10a015['model']],'as':_0x10a015['as'],'attributes':_0x10a015['attributes'],'include':_0x10a015[_0xb6f9('0x16')]?_['map'](_0x10a015[_0xb6f9('0x16')],function(_0x4f0939){return{'model':db[_0x4f0939['model']],'as':_0x4f0939['as'],'attributes':_0x4f0939[_0xb6f9('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb6f9('0xa')](function(_0x4e5d97){logger['info']('GetTrunk',_0xd3f10);logger[_0xb6f9('0x1a')](_0xb6f9('0x1b'),_0xd3f10,JSON[_0xb6f9('0x1c')](_0x4e5d97));_0x5d8046(_0x4e5d97);})[_0xb6f9('0x10')](function(_0x22681a){logger[_0xb6f9('0xd')](_0xb6f9('0x1b'),_0x22681a[_0xb6f9('0xe')],_0xd3f10);_0x41e456(_0x56577a[_0xb6f9('0xd')](0x1f4,_0x22681a[_0xb6f9('0xe')]));});});};exports['ShowTrunk']=function(_0x2e9d66){var _0x425a2e=this;return new Promise(function(_0x29b42c,_0x2ff00d){return db[_0xb6f9('0x11')][_0xb6f9('0x1d')]({'raw':_0x2e9d66[_0xb6f9('0x13')]?_0x2e9d66[_0xb6f9('0x13')][_0xb6f9('0x1e')]===undefined?!![]:![]:!![],'where':_0x2e9d66[_0xb6f9('0x13')]?_0x2e9d66[_0xb6f9('0x13')][_0xb6f9('0x14')]||null:null,'attributes':_0x2e9d66[_0xb6f9('0x13')]?_0x2e9d66['options'][_0xb6f9('0x19')]||null:null,'include':_0x2e9d66['options']?_0x2e9d66[_0xb6f9('0x13')][_0xb6f9('0x16')]?_[_0xb6f9('0x17')](_0x2e9d66[_0xb6f9('0x13')][_0xb6f9('0x16')],function(_0x3ea2e3){return{'model':db[_0x3ea2e3['model']],'as':_0x3ea2e3['as'],'attributes':_0x3ea2e3['attributes'],'include':_0x3ea2e3[_0xb6f9('0x16')]?_['map'](_0x3ea2e3['include'],function(_0x397b6a){return{'model':db[_0x397b6a[_0xb6f9('0x18')]],'as':_0x397b6a['as'],'attributes':_0x397b6a['attributes'],'include':_0x397b6a[_0xb6f9('0x16')]?_[_0xb6f9('0x17')](_0x397b6a['include'],function(_0x68d1f9){return{'model':db[_0x68d1f9[_0xb6f9('0x18')]],'as':_0x68d1f9['as'],'attributes':_0x68d1f9['attributes']};}):[]};}):[]};}):[]:[]})[_0xb6f9('0xa')](function(_0x5dd928){logger['info']('ShowTrunk',_0x2e9d66);logger[_0xb6f9('0x1a')](_0xb6f9('0x1f'),_0x2e9d66,JSON[_0xb6f9('0x1c')](_0x5dd928));_0x29b42c(_0x5dd928);})[_0xb6f9('0x10')](function(_0x44d1ef){logger[_0xb6f9('0xd')]('ShowTrunk',_0x44d1ef[_0xb6f9('0xe')],_0x2e9d66);_0x2ff00d(_0x425a2e[_0xb6f9('0xd')](0x1f4,_0x44d1ef[_0xb6f9('0xe')]));});});}; \ No newline at end of file +var _0x7354=['limit','include','map','model','GetTrunk','ShowTrunk','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','Trunk','findAll','options','raw','attributes'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x7354,0x19e));var _0x4735=function(_0x2a2799,_0x5e25a8){_0x2a2799=_0x2a2799-0x0;var _0x17f761=_0x7354[_0x2a2799];return _0x17f761;};'use strict';var _=require(_0x4735('0x0'));var util=require(_0x4735('0x1'));var moment=require('moment');var BPromise=require(_0x4735('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4735('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4735('0x4'));var logger=require(_0x4735('0x5'))(_0x4735('0x6'));var config=require(_0x4735('0x7'));var jayson=require(_0x4735('0x8'));var client=jayson[_0x4735('0x9')][_0x4735('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23a4b9,_0x4543c3,_0x38cbac){return new BPromise(function(_0x4c786b,_0x586ee2){return client[_0x4735('0xb')](_0x23a4b9,_0x38cbac)[_0x4735('0xc')](function(_0x4db808){logger['info'](_0x4735('0xd'),_0x4543c3,_0x4735('0xe'));logger[_0x4735('0xf')](_0x4735('0x10'),_0x4543c3,_0x4735('0xe'),JSON[_0x4735('0x11')](_0x4db808));if(_0x4db808[_0x4735('0x12')]){if(_0x4db808[_0x4735('0x12')]['code']===0x1f4){logger[_0x4735('0x12')](_0x4735('0xd'),_0x4543c3,_0x4db808['error'][_0x4735('0x13')]);return _0x586ee2(_0x4db808[_0x4735('0x12')][_0x4735('0x13')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x4543c3,_0x4db808[_0x4735('0x12')][_0x4735('0x13')]);return _0x4c786b(_0x4db808['error'][_0x4735('0x13')]);}else{logger[_0x4735('0x14')]('Trunk,\x20%s,\x20%s',_0x4543c3,_0x4735('0xe'));_0x4c786b(_0x4db808[_0x4735('0x15')]['message']);}})[_0x4735('0x16')](function(_0x47e29b){logger['error'](_0x4735('0xd'),_0x4543c3,_0x47e29b);_0x586ee2(_0x47e29b);});});}exports['GetTrunk']=function(_0x5aeb83){var _0x222b4c=this;return new Promise(function(_0x4b5b88,_0x554c4e){return db[_0x4735('0x17')][_0x4735('0x18')]({'raw':_0x5aeb83[_0x4735('0x19')]?_0x5aeb83['options'][_0x4735('0x1a')]===undefined?!![]:![]:!![],'where':_0x5aeb83[_0x4735('0x19')]?_0x5aeb83[_0x4735('0x19')]['where']||null:null,'attributes':_0x5aeb83[_0x4735('0x19')]?_0x5aeb83[_0x4735('0x19')][_0x4735('0x1b')]||null:null,'limit':_0x5aeb83[_0x4735('0x19')]?_0x5aeb83[_0x4735('0x19')][_0x4735('0x1c')]||null:null,'include':_0x5aeb83['options']?_0x5aeb83['options'][_0x4735('0x1d')]?_[_0x4735('0x1e')](_0x5aeb83[_0x4735('0x19')][_0x4735('0x1d')],function(_0x50bc67){return{'model':db[_0x50bc67[_0x4735('0x1f')]],'as':_0x50bc67['as'],'attributes':_0x50bc67[_0x4735('0x1b')],'include':_0x50bc67[_0x4735('0x1d')]?_[_0x4735('0x1e')](_0x50bc67[_0x4735('0x1d')],function(_0x1a2493){return{'model':db[_0x1a2493[_0x4735('0x1f')]],'as':_0x1a2493['as'],'attributes':_0x1a2493[_0x4735('0x1b')],'include':_0x1a2493[_0x4735('0x1d')]?_[_0x4735('0x1e')](_0x1a2493[_0x4735('0x1d')],function(_0x12e143){return{'model':db[_0x12e143[_0x4735('0x1f')]],'as':_0x12e143['as'],'attributes':_0x12e143[_0x4735('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4735('0xc')](function(_0x274688){logger[_0x4735('0x14')](_0x4735('0x20'),_0x5aeb83);logger[_0x4735('0xf')](_0x4735('0x20'),_0x5aeb83,JSON[_0x4735('0x11')](_0x274688));_0x4b5b88(_0x274688);})[_0x4735('0x16')](function(_0x1a7f08){logger['error'](_0x4735('0x20'),_0x1a7f08[_0x4735('0x13')],_0x5aeb83);_0x554c4e(_0x222b4c[_0x4735('0x12')](0x1f4,_0x1a7f08[_0x4735('0x13')]));});});};exports[_0x4735('0x21')]=function(_0x62fc6a){var _0x54ffc1=this;return new Promise(function(_0x17c85,_0x107bd0){return db['Trunk']['find']({'raw':_0x62fc6a[_0x4735('0x19')]?_0x62fc6a[_0x4735('0x19')][_0x4735('0x1a')]===undefined?!![]:![]:!![],'where':_0x62fc6a[_0x4735('0x19')]?_0x62fc6a[_0x4735('0x19')]['where']||null:null,'attributes':_0x62fc6a['options']?_0x62fc6a[_0x4735('0x19')][_0x4735('0x1b')]||null:null,'include':_0x62fc6a['options']?_0x62fc6a['options']['include']?_['map'](_0x62fc6a[_0x4735('0x19')][_0x4735('0x1d')],function(_0x222692){return{'model':db[_0x222692['model']],'as':_0x222692['as'],'attributes':_0x222692[_0x4735('0x1b')],'include':_0x222692[_0x4735('0x1d')]?_[_0x4735('0x1e')](_0x222692['include'],function(_0x2dbeee){return{'model':db[_0x2dbeee['model']],'as':_0x2dbeee['as'],'attributes':_0x2dbeee[_0x4735('0x1b')],'include':_0x2dbeee['include']?_[_0x4735('0x1e')](_0x2dbeee[_0x4735('0x1d')],function(_0x5e1ce6){return{'model':db[_0x5e1ce6['model']],'as':_0x5e1ce6['as'],'attributes':_0x5e1ce6['attributes']};}):[]};}):[]};}):[]:[]})[_0x4735('0xc')](function(_0xd01774){logger[_0x4735('0x14')]('ShowTrunk',_0x62fc6a);logger[_0x4735('0xf')](_0x4735('0x21'),_0x62fc6a,JSON[_0x4735('0x11')](_0xd01774));_0x17c85(_0xd01774);})[_0x4735('0x16')](function(_0x5f617b){logger['error'](_0x4735('0x21'),_0x5f617b[_0x4735('0x13')],_0x62fc6a);_0x107bd0(_0x54ffc1[_0x4735('0x12')](0x1f4,_0x5f617b[_0x4735('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index df5ff1c..ecc56ad 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 _0xb01a=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','/:id','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','getApiKey','post','/create_many','bulkCreate','addContacts','create','join','root','server/files/images/','format','%s-%s','now','originalname','/:id/avatar','single','/:id/login','login','/:id/logout','logout','pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','addSmsAccounts','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','destroy','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeChatWebsites','removeSquareProjects','removeApiKey'];(function(_0x5edb0e,_0x30e1fa){var _0x551e43=function(_0x241ce0){while(--_0x241ce0){_0x5edb0e['push'](_0x5edb0e['shift']());}};_0x551e43(++_0x30e1fa);}(_0xb01a,0x1a1));var _0xab01=function(_0x5b34c0,_0x3ad403){_0x5b34c0=_0x5b34c0-0x0;var _0x242bd3=_0xb01a[_0x5b34c0];return _0x242bd3;};'use strict';var multer=require(_0xab01('0x0'));var util=require(_0xab01('0x1'));var path=require(_0xab01('0x2'));var timeout=require(_0xab01('0x3'));var express=require(_0xab01('0x4'));var router=express[_0xab01('0x5')]();var auth=require(_0xab01('0x6'));var interaction=require(_0xab01('0x7'));var config=require(_0xab01('0x8'));var controller=require(_0xab01('0x9'));router[_0xab01('0xa')]('/',auth[_0xab01('0xb')](),controller[_0xab01('0xc')]);router['get'](_0xab01('0xd'),auth[_0xab01('0xb')](),controller['describe']);router['get'](_0xab01('0xe'),auth[_0xab01('0xb')](),controller['show']);router[_0xab01('0xa')]('/:id/avatar',controller['getAvatar']);router[_0xab01('0xa')]('/:id/contacts',auth[_0xab01('0xb')](),controller[_0xab01('0xf')]);router['get'](_0xab01('0x10'),auth['isAuthenticated'](),controller['getQueues']);router[_0xab01('0xa')](_0xab01('0x11'),auth[_0xab01('0xb')](),controller[_0xab01('0x12')]);router[_0xab01('0xa')](_0xab01('0x13'),auth[_0xab01('0xb')](),controller[_0xab01('0x14')]);router['get']('/:id/recordings',auth['isAuthenticated'](),controller['getRecordings']);router[_0xab01('0xa')]('/:id/screen_recordings',auth[_0xab01('0xb')](),controller[_0xab01('0x15')]);router[_0xab01('0xa')](_0xab01('0x16'),auth['isAuthenticated'](),controller[_0xab01('0x17')]);router['get'](_0xab01('0x18'),auth[_0xab01('0xb')](),controller['getOpenchannelInteractions']);router['get'](_0xab01('0x19'),auth[_0xab01('0xb')](),controller[_0xab01('0x1a')]);router[_0xab01('0xa')](_0xab01('0x1b'),auth[_0xab01('0xb')](),controller[_0xab01('0x1c')]);router[_0xab01('0xa')](_0xab01('0x1d'),auth[_0xab01('0xb')](),controller['getFaxInteractions']);router[_0xab01('0xa')](_0xab01('0x1e'),auth[_0xab01('0xb')](),controller[_0xab01('0x1f')]);router[_0xab01('0xa')](_0xab01('0x20'),auth[_0xab01('0xb')](),controller[_0xab01('0x21')]);router['get'](_0xab01('0x22'),auth[_0xab01('0xb')](),controller[_0xab01('0x23')]);router[_0xab01('0xa')](_0xab01('0x24'),auth[_0xab01('0xb')](),controller[_0xab01('0x25')]);router['get'](_0xab01('0x26'),auth[_0xab01('0xb')](),controller[_0xab01('0x27')]);router[_0xab01('0xa')](_0xab01('0x28'),auth[_0xab01('0xb')](),controller[_0xab01('0x29')]);router['get'](_0xab01('0x2a'),auth[_0xab01('0xb')](),controller[_0xab01('0x2b')]);router[_0xab01('0xa')](_0xab01('0x2c'),auth[_0xab01('0xb')](),controller['getSmsAccounts']);router[_0xab01('0xa')](_0xab01('0x2d'),auth['isAuthenticated'](),controller[_0xab01('0x2e')]);router[_0xab01('0xa')](_0xab01('0x2f'),auth[_0xab01('0xb')](),controller[_0xab01('0x30')]);router[_0xab01('0xa')](_0xab01('0x31'),auth[_0xab01('0xb')](),controller['getScheduledCalls']);router[_0xab01('0xa')](_0xab01('0x32'),auth['isAuthenticated'](),controller[_0xab01('0x33')]);router[_0xab01('0x34')](_0xab01('0x35'),auth[_0xab01('0xb')](),controller[_0xab01('0x36')]);router[_0xab01('0x34')]('/:id/contacts',auth[_0xab01('0xb')](),controller[_0xab01('0x37')]);router[_0xab01('0x34')]('/',auth[_0xab01('0xb')](),controller[_0xab01('0x38')]);router[_0xab01('0x34')](_0xab01('0x10'),auth['isAuthenticated'](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x43594c,_0x3ba15e,_0x19f6de){_0x19f6de(null,path[_0xab01('0x39')](config[_0xab01('0x3a')],_0xab01('0x3b')));},'filename':function(_0x210249,_0x308d09,_0x4150cc){_0x4150cc(null,util[_0xab01('0x3c')](_0xab01('0x3d'),Date[_0xab01('0x3e')](),_0x308d09[_0xab01('0x3f')]));}})});router[_0xab01('0x34')](_0xab01('0x40'),upload[_0xab01('0x41')]('file'),controller['addAvatar']);router[_0xab01('0x34')](_0xab01('0x42'),auth['isAuthenticated'](),controller[_0xab01('0x43')]);router[_0xab01('0x34')](_0xab01('0x44'),auth['isAuthenticated'](),controller[_0xab01('0x45')]);router['post']('/:id/pause',auth[_0xab01('0xb')](),controller[_0xab01('0x46')]);router['post'](_0xab01('0x47'),auth[_0xab01('0xb')](),controller['unpause']);router[_0xab01('0x34')](_0xab01('0x1e'),auth[_0xab01('0xb')](),controller[_0xab01('0x48')]);router[_0xab01('0x34')](_0xab01('0x49'),auth['isAuthenticated'](),controller[_0xab01('0x4a')]);router[_0xab01('0x34')](_0xab01('0x4b'),auth[_0xab01('0xb')](),controller[_0xab01('0x4c')]);router['post']('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0xab01('0x4d')]);router[_0xab01('0x34')]('/:id/sms_interactions',auth[_0xab01('0xb')](),controller[_0xab01('0x4e')]);router[_0xab01('0x34')](_0xab01('0x4f'),auth[_0xab01('0xb')](),controller[_0xab01('0x50')]);router[_0xab01('0x34')](_0xab01('0x26'),auth[_0xab01('0xb')](),controller[_0xab01('0x51')]);router[_0xab01('0x34')](_0xab01('0x28'),auth[_0xab01('0xb')](),controller[_0xab01('0x52')]);router[_0xab01('0x34')](_0xab01('0x2a'),auth[_0xab01('0xb')](),controller['addOpenchannelAccounts']);router['post'](_0xab01('0x2c'),auth[_0xab01('0xb')](),controller[_0xab01('0x53')]);router[_0xab01('0x34')](_0xab01('0x2d'),auth[_0xab01('0xb')](),controller['addChatWebsites']);router[_0xab01('0x34')](_0xab01('0x2f'),auth['isAuthenticated'](),controller[_0xab01('0x54')]);router[_0xab01('0x34')](_0xab01('0x32'),auth['isAuthenticated'](),controller[_0xab01('0x55')]);router[_0xab01('0x56')](_0xab01('0xe'),auth[_0xab01('0xb')](),controller[_0xab01('0x57')]);router['put'](_0xab01('0x58'),auth['isAuthenticated'](),controller[_0xab01('0x59')]);router[_0xab01('0x5a')](_0xab01('0x10'),auth['isAuthenticated'](),controller[_0xab01('0x5b')]);router[_0xab01('0x5a')](_0xab01('0x1e'),auth[_0xab01('0xb')](),controller['removeTeams']);router[_0xab01('0x5a')](_0xab01('0xe'),auth[_0xab01('0xb')](),controller[_0xab01('0x5c')]);router[_0xab01('0x5a')]('/:id/chat_interactions',auth[_0xab01('0xb')](),controller[_0xab01('0x5d')]);router['delete'](_0xab01('0x4b'),auth[_0xab01('0xb')](),controller[_0xab01('0x5e')]);router[_0xab01('0x5a')](_0xab01('0x5f'),auth[_0xab01('0xb')](),controller[_0xab01('0x60')]);router['delete']('/:id/sms_interactions',auth[_0xab01('0xb')](),controller[_0xab01('0x61')]);router[_0xab01('0x5a')](_0xab01('0x4f'),auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router[_0xab01('0x5a')](_0xab01('0x26'),auth[_0xab01('0xb')](),controller[_0xab01('0x62')]);router[_0xab01('0x5a')](_0xab01('0x28'),auth[_0xab01('0xb')](),controller['removeMailAccounts']);router['delete'](_0xab01('0x2a'),auth[_0xab01('0xb')](),controller[_0xab01('0x63')]);router[_0xab01('0x5a')](_0xab01('0x2c'),auth['isAuthenticated'](),controller['removeSmsAccounts']);router['delete'](_0xab01('0x2d'),auth[_0xab01('0xb')](),controller[_0xab01('0x64')]);router[_0xab01('0x5a')](_0xab01('0x2f'),auth[_0xab01('0xb')](),controller[_0xab01('0x65')]);router[_0xab01('0x5a')]('/:id/api_key',auth[_0xab01('0xb')](),controller[_0xab01('0x66')]);module[_0xab01('0x67')]=router; \ No newline at end of file +var _0xd732=['/:id/password','delete','removeQueues','destroy','/:id/mail_interactions','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','multer','path','Router','../../components/auth/service','./user.controller','isAuthenticated','index','get','/:id','show','/:id/avatar','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/screen_recordings','getScreenRecordings','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','getSmsAccounts','getChatWebsites','/:id/square_projects','/:id/scheduled_calls','/:id/api_key','getApiKey','post','/create_many','bulkCreate','addContacts','create','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','addAvatar','login','logout','/:id/pause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','put','update'];(function(_0x520752,_0x1a1f47){var _0x32ee7d=function(_0x84d834){while(--_0x84d834){_0x520752['push'](_0x520752['shift']());}};_0x32ee7d(++_0x1a1f47);}(_0xd732,0x18e));var _0x2d73=function(_0x2c9898,_0x40f723){_0x2c9898=_0x2c9898-0x0;var _0x33318d=_0xd732[_0x2c9898];return _0x33318d;};'use strict';var multer=require(_0x2d73('0x0'));var util=require('util');var path=require(_0x2d73('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2d73('0x2')]();var auth=require(_0x2d73('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2d73('0x4'));router['get']('/',auth[_0x2d73('0x5')](),controller[_0x2d73('0x6')]);router['get']('/describe',auth[_0x2d73('0x5')](),controller['describe']);router[_0x2d73('0x7')](_0x2d73('0x8'),auth[_0x2d73('0x5')](),controller[_0x2d73('0x9')]);router['get'](_0x2d73('0xa'),controller[_0x2d73('0xb')]);router[_0x2d73('0x7')](_0x2d73('0xc'),auth['isAuthenticated'](),controller[_0x2d73('0xd')]);router[_0x2d73('0x7')](_0x2d73('0xe'),auth[_0x2d73('0x5')](),controller[_0x2d73('0xf')]);router[_0x2d73('0x7')](_0x2d73('0x10'),auth[_0x2d73('0x5')](),controller[_0x2d73('0x11')]);router[_0x2d73('0x7')](_0x2d73('0x12'),auth[_0x2d73('0x5')](),controller['getGroups']);router[_0x2d73('0x7')]('/:id/recordings',auth[_0x2d73('0x5')](),controller['getRecordings']);router[_0x2d73('0x7')](_0x2d73('0x13'),auth[_0x2d73('0x5')](),controller[_0x2d73('0x14')]);router[_0x2d73('0x7')]('/:id/chat/interactions',auth['isAuthenticated'](),controller['getChatInteractions']);router[_0x2d73('0x7')](_0x2d73('0x15'),auth[_0x2d73('0x5')](),controller['getOpenchannelInteractions']);router[_0x2d73('0x7')](_0x2d73('0x16'),auth[_0x2d73('0x5')](),controller[_0x2d73('0x17')]);router['get']('/:id/sms/interactions',auth[_0x2d73('0x5')](),controller[_0x2d73('0x18')]);router[_0x2d73('0x7')](_0x2d73('0x19'),auth[_0x2d73('0x5')](),controller[_0x2d73('0x1a')]);router[_0x2d73('0x7')](_0x2d73('0x1b'),auth['isAuthenticated'](),controller[_0x2d73('0x1c')]);router[_0x2d73('0x7')](_0x2d73('0x1d'),auth[_0x2d73('0x5')](),controller['getLists']);router[_0x2d73('0x7')](_0x2d73('0x1e'),auth[_0x2d73('0x5')](),controller[_0x2d73('0x1f')]);router[_0x2d73('0x7')](_0x2d73('0x20'),auth[_0x2d73('0x5')](),controller[_0x2d73('0x21')]);router[_0x2d73('0x7')](_0x2d73('0x22'),auth[_0x2d73('0x5')](),controller[_0x2d73('0x23')]);router[_0x2d73('0x7')](_0x2d73('0x24'),auth[_0x2d73('0x5')](),controller[_0x2d73('0x25')]);router[_0x2d73('0x7')]('/:id/openchannel_accounts',auth[_0x2d73('0x5')](),controller[_0x2d73('0x26')]);router[_0x2d73('0x7')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x2d73('0x27')]);router[_0x2d73('0x7')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x2d73('0x28')]);router[_0x2d73('0x7')](_0x2d73('0x29'),auth['isAuthenticated'](),controller['getSquareProjects']);router[_0x2d73('0x7')](_0x2d73('0x2a'),auth[_0x2d73('0x5')](),controller['getScheduledCalls']);router['get'](_0x2d73('0x2b'),auth['isAuthenticated'](),controller[_0x2d73('0x2c')]);router[_0x2d73('0x2d')](_0x2d73('0x2e'),auth[_0x2d73('0x5')](),controller[_0x2d73('0x2f')]);router[_0x2d73('0x2d')](_0x2d73('0xc'),auth[_0x2d73('0x5')](),controller[_0x2d73('0x30')]);router[_0x2d73('0x2d')]('/',auth['isAuthenticated'](),controller[_0x2d73('0x31')]);router['post'](_0x2d73('0xe'),auth['isAuthenticated'](),controller[_0x2d73('0x32')]);var upload=multer({'storage':multer[_0x2d73('0x33')]({'destination':function(_0x26a003,_0x2a5622,_0x81caeb){_0x81caeb(null,path[_0x2d73('0x34')](config[_0x2d73('0x35')],_0x2d73('0x36')));},'filename':function(_0x4a3980,_0x350dc6,_0x545509){_0x545509(null,util[_0x2d73('0x37')](_0x2d73('0x38'),Date[_0x2d73('0x39')](),_0x350dc6[_0x2d73('0x3a')]));}})});router[_0x2d73('0x2d')](_0x2d73('0xa'),upload['single']('file'),controller[_0x2d73('0x3b')]);router[_0x2d73('0x2d')]('/:id/login',auth[_0x2d73('0x5')](),controller[_0x2d73('0x3c')]);router[_0x2d73('0x2d')]('/:id/logout',auth[_0x2d73('0x5')](),controller[_0x2d73('0x3d')]);router['post'](_0x2d73('0x3e'),auth[_0x2d73('0x5')](),controller['pause']);router[_0x2d73('0x2d')]('/:id/unpause',auth[_0x2d73('0x5')](),controller[_0x2d73('0x3f')]);router[_0x2d73('0x2d')](_0x2d73('0x1b'),auth[_0x2d73('0x5')](),controller[_0x2d73('0x40')]);router[_0x2d73('0x2d')](_0x2d73('0x41'),auth[_0x2d73('0x5')](),controller[_0x2d73('0x42')]);router['post']('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x2d73('0x43')]);router[_0x2d73('0x2d')](_0x2d73('0x44'),auth['isAuthenticated'](),controller[_0x2d73('0x45')]);router[_0x2d73('0x2d')](_0x2d73('0x46'),auth[_0x2d73('0x5')](),controller[_0x2d73('0x47')]);router['post'](_0x2d73('0x48'),auth[_0x2d73('0x5')](),controller[_0x2d73('0x49')]);router[_0x2d73('0x2d')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x2d73('0x4a')]);router[_0x2d73('0x2d')](_0x2d73('0x24'),auth[_0x2d73('0x5')](),controller['addMailAccounts']);router[_0x2d73('0x2d')](_0x2d73('0x4b'),auth[_0x2d73('0x5')](),controller[_0x2d73('0x4c')]);router['post'](_0x2d73('0x4d'),auth[_0x2d73('0x5')](),controller[_0x2d73('0x4e')]);router[_0x2d73('0x2d')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x2d73('0x4f')]);router[_0x2d73('0x2d')](_0x2d73('0x29'),auth[_0x2d73('0x5')](),controller['addSquareProjects']);router[_0x2d73('0x2d')](_0x2d73('0x2b'),auth[_0x2d73('0x5')](),controller['createApiKey']);router[_0x2d73('0x50')](_0x2d73('0x8'),auth['isAuthenticated'](),controller[_0x2d73('0x51')]);router[_0x2d73('0x50')](_0x2d73('0x52'),auth[_0x2d73('0x5')](),controller['changePassword']);router[_0x2d73('0x53')](_0x2d73('0xe'),auth[_0x2d73('0x5')](),controller[_0x2d73('0x54')]);router[_0x2d73('0x53')]('/:id/teams',auth[_0x2d73('0x5')](),controller['removeTeams']);router['delete'](_0x2d73('0x8'),auth[_0x2d73('0x5')](),controller[_0x2d73('0x55')]);router['delete'](_0x2d73('0x41'),auth['isAuthenticated'](),controller['removeChatInteractions']);router[_0x2d73('0x53')](_0x2d73('0x56'),auth[_0x2d73('0x5')](),controller[_0x2d73('0x57')]);router['delete'](_0x2d73('0x44'),auth[_0x2d73('0x5')](),controller['removeFaxInteractions']);router[_0x2d73('0x53')]('/:id/sms_interactions',auth[_0x2d73('0x5')](),controller[_0x2d73('0x58')]);router[_0x2d73('0x53')](_0x2d73('0x48'),auth['isAuthenticated'](),controller[_0x2d73('0x59')]);router['delete'](_0x2d73('0x22'),auth['isAuthenticated'](),controller[_0x2d73('0x5a')]);router[_0x2d73('0x53')](_0x2d73('0x24'),auth['isAuthenticated'](),controller[_0x2d73('0x5b')]);router[_0x2d73('0x53')](_0x2d73('0x4b'),auth[_0x2d73('0x5')](),controller['removeOpenchannelAccounts']);router[_0x2d73('0x53')]('/:id/sms_accounts',auth[_0x2d73('0x5')](),controller['removeSmsAccounts']);router[_0x2d73('0x53')]('/:id/chat_websites',auth[_0x2d73('0x5')](),controller[_0x2d73('0x5c')]);router[_0x2d73('0x53')](_0x2d73('0x29'),auth[_0x2d73('0x5')](),controller[_0x2d73('0x5d')]);router[_0x2d73('0x53')](_0x2d73('0x2b'),auth[_0x2d73('0x5')](),controller[_0x2d73('0x5e')]);module[_0x2d73('0x5f')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index ef22ab9..2c266b7 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 _0xe706=['ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','nonat','get','isArray','wss','avpf','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','force_avp','icesupport','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM','admin','user','agent','telephone','local','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe706,0xa3));var _0x6e70=function(_0x2ee790,_0x5a8661){_0x2ee790=_0x2ee790-0x0;var _0x5a54a5=_0xe706[_0x2ee790];return _0x5a54a5;};'use strict';var Sequelize=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var util=require(_0x6e70('0x2'));var _=require('lodash');module[_0x6e70('0x3')]={'name':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'unique':_0x6e70('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x7dfbc3){this[_0x6e70('0x6')](_0x6e70('0x5'),_0x7dfbc3);this[_0x6e70('0x6')](_0x6e70('0x7'),_0x7dfbc3);},'comment':_0x6e70('0x8')},'fullname':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'set':function(_0x36357b){this[_0x6e70('0x6')](_0x6e70('0x9'),_0x36357b);this[_0x6e70('0x6')](_0x6e70('0xa'),util[_0x6e70('0xb')](_0x6e70('0xc'),_0x36357b,this[_0x6e70('0xd')](_0x6e70('0xe'))));}},'alias':{'type':Sequelize[_0x6e70('0x4')]},'email':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'unique':_0x6e70('0xf'),'validate':{'isEmail':!![]},'set':function(_0x37b3e0){if(_0x37b3e0){this[_0x6e70('0x6')]('email',_0x37b3e0['toLowerCase']());}}},'role':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x11'),_0x6e70('0x12'),_0x6e70('0x13'),_0x6e70('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':_0x6e70('0x15')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':'internal','set':function(_0x48bc72){this[_0x6e70('0x6')]('internal',_0x48bc72);this['setDataValue'](_0x6e70('0x16'),_0x48bc72);this[_0x6e70('0x6')]('callerid',util[_0x6e70('0xb')]('\x22%s\x22\x20<%s>',this[_0x6e70('0xd')](_0x6e70('0x9')),_0x48bc72));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x6e70('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x6e70('0x4')]},'userpic':{'type':Sequelize[_0x6e70('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x6e70('0x18')]},'voicePause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':_0x6e70('0x19')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x6e70('0x1a')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x6e70('0x1a')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x6e70('0x1a')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x6e70('0x1a')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x6e70('0x1a')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x1b')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x6e70('0x1a')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x6e70('0x1a')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x6e70('0x1a')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x1c'),_0x6e70('0x12'),_0x6e70('0x1d')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x1e')},'callingpres':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x1f'),_0x6e70('0x20'),_0x6e70('0x21'),_0x6e70('0x22'),_0x6e70('0x23'),_0x6e70('0x24'),_0x6e70('0x25'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x26'),'set':function(_0x56f6f7){this[_0x6e70('0x6')](_0x6e70('0x27'),_0x56f6f7?_0x56f6f7['join'](','):null);},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x27'))?this['getDataValue'](_0x6e70('0x27'))[_0x6e70('0x28')](','):null;},'comment':_0x6e70('0x29')},'dtmfmode':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2a'),_0x6e70('0x2b'),_0x6e70('0x2c'),_0x6e70('0x2d'),_0x6e70('0x2e')),'allowNull':!![],'defaultValue':_0x6e70('0x2a')},'directmedia':{'type':Sequelize['ENUM'](_0x6e70('0x2f'),'no','nonat',_0x6e70('0x30'),_0x6e70('0x31')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x32'),'set':function(_0x80bebb){this[_0x6e70('0x6')](_0x6e70('0x33'),_0x80bebb?_0x80bebb[_0x6e70('0x34')](','):null);},'get':function(){return this[_0x6e70('0xd')]('nat')?this['getDataValue']('nat')[_0x6e70('0x28')](','):null;},'comment':_0x6e70('0x35')},'callgroup':{'type':Sequelize[_0x6e70('0x4')]},'namedcallgroup':{'type':Sequelize[_0x6e70('0x4')]},'pickupgroup':{'type':Sequelize[_0x6e70('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x6e70('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x6e70('0x4')]},'disallow':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'defaultValue':_0x6e70('0x36')},'allow':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'defaultValue':_0x6e70('0x37'),'set':function(_0x37bf46){this[_0x6e70('0x6')](_0x6e70('0x38'),_0x37bf46?_0x37bf46['join'](';'):_0x6e70('0x37'));},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x38'))?this[_0x6e70('0xd')](_0x6e70('0x38'))[_0x6e70('0x28')](';'):null;},'comment':_0x6e70('0x39')},'autoframing':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x154e0c){this[_0x6e70('0x6')](_0x6e70('0x3a'),_0x154e0c?_0x154e0c[_0x6e70('0x34')](','):null);},'get':function(){return this[_0x6e70('0xd')]('insecure')?this[_0x6e70('0xd')](_0x6e70('0x3a'))[_0x6e70('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2f'),'no',_0x6e70('0x3b')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x6e70('0x1a')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x3c')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x6e70('0x2f')},'busylevel':{'type':Sequelize[_0x6e70('0x1a')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2f'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2f'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2f'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x6e70('0x10')]('yes','no',_0x6e70('0x3d')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2f'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x6e70('0x3e'),_0x6e70('0x3f'),_0x6e70('0x40')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x41'),_0x6e70('0x42')),'allowNull':!![],'defaultValue':_0x6e70('0x42')},'t38pt_usertpsource':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x6e70('0x2f')},'keepalive':{'type':Sequelize[_0x6e70('0x1a')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x6e70('0x1a')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x6e70('0x1a')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x6e70('0x1a')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x6e70('0x1a')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x6e70('0x1a')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x6e70('0x1a')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x6e70('0x1a')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x6e70('0x2f'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2f'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x6e70('0x2f'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2f'),'no',_0x6e70('0x43'),_0x6e70('0x44')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x45'),_0x6e70('0x46'),_0x6e70('0x47')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x6e70('0x1a')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2f'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2f'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2f'),'no',_0x6e70('0x48'),_0x6e70('0x30'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x6e70('0x4')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'showWebBar':{'type':Sequelize[_0x6e70('0x1a')],'defaultValue':0x0,'set':function(_0x692205){this[_0x6e70('0x6')]('showWebBar',_0x692205);var _0x51f268=this[_0x6e70('0x49')]({'plain':!![]});switch(_0x692205){case 0x0:case 0x1:var _0xd6bccd=_0x51f268[_0x6e70('0x27')]?_[_0x6e70('0x4a')](_0x51f268[_0x6e70('0x27')])?_0x51f268[_0x6e70('0x27')][_0x6e70('0x34')]():_0x51f268['transport']:'udp';if(_0xd6bccd===_0x6e70('0x4b')){_0xd6bccd=_0x6e70('0x26');}this[_0x6e70('0x6')](_0x6e70('0x27'),_0xd6bccd);this['setDataValue']('encryption','no');this[_0x6e70('0x6')](_0x6e70('0x4c'),null);this['setDataValue']('force_avp',null);this[_0x6e70('0x6')]('icesupport',null);this[_0x6e70('0x6')](_0x6e70('0x4d'),null);this[_0x6e70('0x6')](_0x6e70('0x4e'),null);this[_0x6e70('0x6')](_0x6e70('0x4f'),null);this[_0x6e70('0x6')](_0x6e70('0x50'),null);this['setDataValue'](_0x6e70('0x51'),null);this[_0x6e70('0x6')](_0x6e70('0x52'),'no');break;case 0x2:this[_0x6e70('0x6')](_0x6e70('0x27'),'wss');this['setDataValue']('encryption',_0x6e70('0x2f'));this[_0x6e70('0x6')](_0x6e70('0x4c'),'yes');this['setDataValue'](_0x6e70('0x53'),_0x6e70('0x2f'));this[_0x6e70('0x6')](_0x6e70('0x54'),_0x6e70('0x2f'));this[_0x6e70('0x6')]('dtlsenable',_0x6e70('0x2f'));this[_0x6e70('0x6')](_0x6e70('0x4e'),'no');this[_0x6e70('0x6')]('dtlssetup',_0x6e70('0x47'));this['setDataValue']('dtlscertfile',_0x51f268[_0x6e70('0x50')]||_0x6e70('0x55'));this[_0x6e70('0x6')](_0x6e70('0x51'),_0x51f268[_0x6e70('0x51')]||_0x6e70('0x56'));this['setDataValue'](_0x6e70('0x52'),_0x6e70('0x2f'));break;default:}}},'permissions':{'type':Sequelize[_0x6e70('0x57')],'set':function(_0x18e64c){this[_0x6e70('0x6')](_0x6e70('0x58'),_0x18e64c?_0x18e64c[_0x6e70('0x34')](','):[]);},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x58'))?_[_0x6e70('0x59')](this['getDataValue'](_0x6e70('0x58'))[_0x6e70('0x28')](','),function(_0x577c3b){return parseInt(_0x577c3b,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x6e70('0x1a')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2f'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x6e70('0x4')]},'passwordResetAt':{'type':Sequelize[_0x6e70('0x18')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x6e70('0x5a')],'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x5b'))?this[_0x6e70('0xd')](_0x6e70('0x5b')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x5b5471){if(typeof _0x5b5471===_0x6e70('0x5c')){var _0x48e04b=_0x5b5471==='1'?!![]:_0x5b5471==='0'?![]:_0x5b5471==='true'?!![]:_0x5b5471===_0x6e70('0x5d')?![]:![];this[_0x6e70('0x6')](_0x6e70('0x5e'),_0x48e04b);}else{this['setDataValue']('screenrecording',_0x5b5471);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3e7be7){this['setDataValue'](_0x6e70('0x5f'),_0x3e7be7);if(_0x3e7be7===!![]){this[_0x6e70('0x6')](_0x6e70('0x60'),moment());this[_0x6e70('0x6')](_0x6e70('0x61'),0x0);}else{this[_0x6e70('0x6')](_0x6e70('0x60'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x6e70('0x1a')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]}}; \ No newline at end of file +var _0xbaf0=['wss','encryption','avpf','icesupport','dtlsenable','rtcp_mux','force_avp','dtlsverify','dtlssetup','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','agent','telephone','INTEGER','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','user','peer','friend','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','nonat','update,nonat','showWebBar','get'];(function(_0x3ba115,_0xa84dee){var _0x4e7753=function(_0x3730d0){while(--_0x3730d0){_0x3ba115['push'](_0x3ba115['shift']());}};_0x4e7753(++_0xa84dee);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0baf('0x0'));var util=require(_0x0baf('0x1'));var _=require(_0x0baf('0x2'));module[_0x0baf('0x3')]={'name':{'type':Sequelize[_0x0baf('0x4')],'allowNull':![],'unique':_0x0baf('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5a3e42){this[_0x0baf('0x6')](_0x0baf('0x5'),_0x5a3e42);this[_0x0baf('0x6')](_0x0baf('0x7'),_0x5a3e42);},'comment':_0x0baf('0x8')},'fullname':{'type':Sequelize[_0x0baf('0x4')],'allowNull':![],'set':function(_0x1a10b1){this[_0x0baf('0x6')](_0x0baf('0x9'),_0x1a10b1);this['setDataValue'](_0x0baf('0xa'),util['format'](_0x0baf('0xb'),_0x1a10b1,this[_0x0baf('0xc')](_0x0baf('0xd'))));}},'alias':{'type':Sequelize[_0x0baf('0x4')]},'email':{'type':Sequelize[_0x0baf('0x4')],'allowNull':![],'unique':_0x0baf('0xe'),'validate':{'isEmail':!![]},'set':function(_0x41cead){if(_0x41cead){this[_0x0baf('0x6')](_0x0baf('0xe'),_0x41cead[_0x0baf('0xf')]());}}},'role':{'type':Sequelize[_0x0baf('0x10')]('admin','user',_0x0baf('0x11'),_0x0baf('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x0baf('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0baf('0x4')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':![],'unique':'internal','set':function(_0x1c76a8){this[_0x0baf('0x6')](_0x0baf('0xd'),_0x1c76a8);this[_0x0baf('0x6')](_0x0baf('0x14'),_0x1c76a8);this[_0x0baf('0x6')]('callerid',util['format'](_0x0baf('0xb'),this[_0x0baf('0xc')](_0x0baf('0x9')),_0x1c76a8));}},'salt':{'type':Sequelize[_0x0baf('0x4')]},'phone':{'type':Sequelize[_0x0baf('0x4')]},'mobile':{'type':Sequelize[_0x0baf('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x0baf('0x4')]},'userpic':{'type':Sequelize[_0x0baf('0x4')]},'city':{'type':Sequelize[_0x0baf('0x4')]},'country':{'type':Sequelize[_0x0baf('0x4')]},'online':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0baf('0x16')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0baf('0x4')],'defaultValue':_0x0baf('0x17')},'lastPauseAt':{'type':Sequelize[_0x0baf('0x16')]},'chatCapacity':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![],'defaultValue':_0x0baf('0x18')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x0baf('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0baf('0x10')]('friend',_0x0baf('0x19'),_0x0baf('0x1a')),'allowNull':!![],'defaultValue':_0x0baf('0x1b')},'context':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x1c'),'ALLOWED_PASSED_SCREEN',_0x0baf('0x1d'),_0x0baf('0x1e'),_0x0baf('0x1f'),_0x0baf('0x20'),_0x0baf('0x21'),_0x0baf('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![],'defaultValue':_0x0baf('0x23'),'set':function(_0x275ea1){this[_0x0baf('0x6')](_0x0baf('0x24'),_0x275ea1?_0x275ea1[_0x0baf('0x25')](','):null);},'get':function(){return this[_0x0baf('0xc')](_0x0baf('0x24'))?this[_0x0baf('0xc')](_0x0baf('0x24'))[_0x0baf('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x0baf('0x10')]('rfc2833',_0x0baf('0x27'),_0x0baf('0x28'),_0x0baf('0x29'),_0x0baf('0x2a')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no','nonat',_0x0baf('0x2c'),_0x0baf('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![],'defaultValue':_0x0baf('0x2e'),'set':function(_0x4aa6ed){this[_0x0baf('0x6')](_0x0baf('0x2f'),_0x4aa6ed?_0x4aa6ed['join'](','):null);},'get':function(){return this[_0x0baf('0xc')]('nat')?this['getDataValue'](_0x0baf('0x2f'))[_0x0baf('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x0baf('0x4')]},'pickupgroup':{'type':Sequelize[_0x0baf('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x0baf('0x4')]},'language':{'type':Sequelize[_0x0baf('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0baf('0x4')]},'disallow':{'type':Sequelize[_0x0baf('0x4')],'allowNull':![],'defaultValue':_0x0baf('0x30')},'allow':{'type':Sequelize[_0x0baf('0x4')],'allowNull':![],'defaultValue':_0x0baf('0x31'),'set':function(_0x36c6d2){this[_0x0baf('0x6')](_0x0baf('0x32'),_0x36c6d2?_0x36c6d2[_0x0baf('0x25')](';'):_0x0baf('0x31'));},'get':function(){return this['getDataValue'](_0x0baf('0x32'))?this[_0x0baf('0xc')]('allow')[_0x0baf('0x26')](';'):null;},'comment':_0x0baf('0x33')},'autoframing':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![],'set':function(_0x456d0b){this['setDataValue'](_0x0baf('0x34'),_0x456d0b?_0x456d0b[_0x0baf('0x25')](','):null);},'get':function(){return this['getDataValue'](_0x0baf('0x34'))?this[_0x0baf('0xc')](_0x0baf('0x34'))[_0x0baf('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no',_0x0baf('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0baf('0x10')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![],'defaultValue':_0x0baf('0x36')},'amaflags':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x0baf('0x2b'),'no'),'allowNull':!![],'defaultValue':_0x0baf('0x2b')},'busylevel':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0baf('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x0baf('0x2b'),'no',_0x0baf('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x0baf('0x2b'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x38'),_0x0baf('0x39'),_0x0baf('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x3b'),_0x0baf('0x3c')),'allowNull':!![],'defaultValue':_0x0baf('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![],'defaultValue':_0x0baf('0x2b')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0baf('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0baf('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0baf('0x10')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0baf('0x10')]('yes','no',_0x0baf('0x3d'),_0x0baf('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x3f'),_0x0baf('0x40'),_0x0baf('0x41')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x0baf('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no',_0x0baf('0x42'),_0x0baf('0x2c'),_0x0baf('0x43')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0baf('0x4')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'showWebBar':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0,'set':function(_0x27f580){this[_0x0baf('0x6')](_0x0baf('0x44'),_0x27f580);var _0x1c7d88=this[_0x0baf('0x45')]({'plain':!![]});switch(_0x27f580){case 0x0:case 0x1:var _0x14e6d0=_0x1c7d88[_0x0baf('0x24')]?_['isArray'](_0x1c7d88[_0x0baf('0x24')])?_0x1c7d88['transport'][_0x0baf('0x25')]():_0x1c7d88['transport']:'udp';if(_0x14e6d0===_0x0baf('0x46')){_0x14e6d0='udp';}this[_0x0baf('0x6')](_0x0baf('0x24'),_0x14e6d0);this['setDataValue'](_0x0baf('0x47'),'no');this[_0x0baf('0x6')](_0x0baf('0x48'),null);this['setDataValue']('force_avp',null);this[_0x0baf('0x6')](_0x0baf('0x49'),null);this[_0x0baf('0x6')](_0x0baf('0x4a'),null);this[_0x0baf('0x6')]('dtlsverify',null);this[_0x0baf('0x6')]('dtlssetup',null);this['setDataValue']('dtlscertfile',null);this[_0x0baf('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x0baf('0x4b'),'no');break;case 0x2:this[_0x0baf('0x6')](_0x0baf('0x24'),_0x0baf('0x46'));this[_0x0baf('0x6')](_0x0baf('0x47'),'yes');this[_0x0baf('0x6')](_0x0baf('0x48'),_0x0baf('0x2b'));this[_0x0baf('0x6')](_0x0baf('0x4c'),_0x0baf('0x2b'));this['setDataValue'](_0x0baf('0x49'),_0x0baf('0x2b'));this[_0x0baf('0x6')]('dtlsenable',_0x0baf('0x2b'));this[_0x0baf('0x6')](_0x0baf('0x4d'),'no');this[_0x0baf('0x6')](_0x0baf('0x4e'),_0x0baf('0x41'));this[_0x0baf('0x6')]('dtlscertfile',_0x1c7d88['dtlscertfile']||'/etc/pki/tls/certs/motion.crt');this[_0x0baf('0x6')](_0x0baf('0x4f'),_0x1c7d88[_0x0baf('0x4f')]||_0x0baf('0x50'));this[_0x0baf('0x6')](_0x0baf('0x4b'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x34c1f4){this['setDataValue'](_0x0baf('0x51'),_0x34c1f4?_0x34c1f4[_0x0baf('0x25')](','):[]);},'get':function(){return this['getDataValue'](_0x0baf('0x51'))?_[_0x0baf('0x52')](this[_0x0baf('0xc')](_0x0baf('0x51'))[_0x0baf('0x26')](','),function(_0x33a5af){return parseInt(_0x33a5af,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0baf('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0baf('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0baf('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0baf('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x0baf('0x2b'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x0baf('0x53')],'get':function(){return this[_0x0baf('0xc')](_0x0baf('0x54'))?this[_0x0baf('0xc')](_0x0baf('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0baf('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x97d385){if(typeof _0x97d385===_0x0baf('0x55')){var _0x421ca0=_0x97d385==='1'?!![]:_0x97d385==='0'?![]:_0x97d385===_0x0baf('0x56')?!![]:_0x97d385===_0x0baf('0x57')?![]:![];this['setDataValue']('screenrecording',_0x421ca0);}else{this[_0x0baf('0x6')](_0x0baf('0x58'),_0x97d385);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x28bc1c){this[_0x0baf('0x6')](_0x0baf('0x59'),_0x28bc1c);if(_0x28bc1c===!![]){this['setDataValue'](_0x0baf('0x5a'),moment());this[_0x0baf('0x6')](_0x0baf('0x5b'),0x0);}else{this['setDataValue'](_0x0baf('0x5a'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index b4ed275..9ffeb85 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 _0x0374=['generateApiKey','apiKeyNonce','apiKeyIat','removeApiKey','API\x20key\x20not\x20available','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','redis','defaults','socket.io-emitter','./user.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Users','user','Agents','agent','Telephones','telephone','ignore','value','includes','role','name','UserProfileResource','stack','index','User','model','salt','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','sequelize','lower','col','field','merge','options','includeAll','include','findAll','rows','params','differenceBy','password','find','bulkCreate','body','describe','addContacts','ids','admin','getLicense','users','isNil','License\x20limit\x20reached','format','count\x20%s:\x20%s','create','internal','findById','securePassword','min_internal','max','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','110','104','105','106','107','108','109','111','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Unauthorized','Setting','findOne','addQueues','channel','online','loginInPause','voicePause','interface','Unknown\x20channel','capitalize','toLowerCase','Queues','penalty','spread','QueueId','emit','Queue:save','voice','VoiceQueue','push','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','isValidChannel','Queue:remove','addAvatar','userpic','file','filename','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getContacts','CmContact','rawAttributes','CmList','List','Tag','Tags','color','tag','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','UserId','VoiceRecording','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','getFaxInteractions','login','phone','mobile','intrf','user:forcelogout','x-forwarded-for','remoteAddress','socket','connection','getVoiceQueues','UserVoiceQueue.penalty','each','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','all','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','resolve','logout','pause','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','pauseType','QueuePause','manual','mail','chat','fax','openchannel','%s%s','Team','getTeams','addTeams','omit','removeTeams','getLists','getAgents','send','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','addSmsInteractions','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','concat','$and','$or','$gte','$lt','$lte','$eq','$not','$between','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','CmHopper','firstName','lastName','Contact','dialActive','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privelages\x20to\x20access\x20this\x20resource.','createApiKey'];(function(_0x467bde,_0x11b155){var _0x5edf65=function(_0x3c9642){while(--_0x3c9642){_0x467bde['push'](_0x467bde['shift']());}};_0x5edf65(++_0x11b155);}(_0x0374,0x15a));var _0x4037=function(_0x3730ed,_0x234521){_0x3730ed=_0x3730ed-0x0;var _0x1599bf=_0x0374[_0x3730ed];return _0x1599bf;};'use strict';var pdf=require(_0x4037('0x0'));var emlformat=require(_0x4037('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4037('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4037('0x3'));var moment=require(_0x4037('0x4'));var BPromise=require(_0x4037('0x5'));var Mustache=require(_0x4037('0x6'));var util=require(_0x4037('0x7'));var path=require('path');var sox=require(_0x4037('0x8'));var csv=require(_0x4037('0x9'));var ejs=require(_0x4037('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4037('0xb'));var jsforce=require(_0x4037('0xc'));var deskjs=require(_0x4037('0xd'));var toCsv=require(_0x4037('0x9'));var querystring=require(_0x4037('0xe'));var Papa=require(_0x4037('0xf'));var Redis=require(_0x4037('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4037('0x11'));var hardwareService=require(_0x4037('0x12'));var logger=require(_0x4037('0x13'))(_0x4037('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x4037('0x15')]=_[_0x4037('0x16')](config[_0x4037('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x4037('0x17'))(new Redis(config['redis']));require(_0x4037('0x18'))[_0x4037('0x19')](socket);var jayson=require(_0x4037('0x1a'));var client=jayson[_0x4037('0x1b')][_0x4037('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x2df96c,_0x1d9286,_0x51eefa){if(_0x51eefa){var _0x3f20b4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3f20b4[_0x4037('0x1d')](_0x1d9286)){return _0x2df96c;}else{throw new Error(_0x4037('0x1e'));}}else{return _0x2df96c;}}function respondWithRpcPromise(_0x4fb690,_0x4cf186,_0x35648a,_0x21e5c5){return new BPromise(function(_0x4ac381,_0x3ae242){var _0x337711=_0x21e5c5||client;return _0x337711[_0x4037('0x1f')](_0x4fb690,_0x35648a)['then'](function(_0x555b38){logger[_0x4037('0x20')](_0x4037('0x21'),_0x4cf186,_0x4037('0x22'));logger[_0x4037('0x23')](_0x4037('0x24'),_0x4cf186,_0x4037('0x22'),JSON['stringify'](_0x555b38));if(_0x555b38['error']){if(_0x555b38['error'][_0x4037('0x25')]===0x1f4){logger[_0x4037('0x26')](_0x4037('0x21'),_0x4cf186,_0x555b38[_0x4037('0x26')][_0x4037('0x27')]);return _0x3ae242(_0x555b38[_0x4037('0x26')][_0x4037('0x27')]);}logger[_0x4037('0x26')](_0x4037('0x21'),_0x4cf186,_0x555b38['error']['message']);return _0x4ac381(_0x555b38[_0x4037('0x26')]['message']);}else{logger[_0x4037('0x20')]('User,\x20%s,\x20%s',_0x4cf186,'request\x20sent');_0x4ac381(_0x555b38[_0x4037('0x28')][_0x4037('0x27')]);}})[_0x4037('0x29')](function(_0x5e92fe){logger[_0x4037('0x26')](_0x4037('0x21'),_0x4cf186,_0x5e92fe);_0x3ae242(_0x5e92fe);});});}function respondWithStatusCode(_0x306924,_0x48eef3){_0x48eef3=_0x48eef3||0xcc;return function(_0x4cc692){if(_0x4cc692){return _0x306924[_0x4037('0x2a')](_0x48eef3);}return _0x306924[_0x4037('0x2b')](_0x48eef3)[_0x4037('0x2c')]();};}function respondWithResult(_0x3e25ac,_0x136b3e){_0x136b3e=_0x136b3e||0xc8;return function(_0x23413a){if(_0x23413a){return _0x3e25ac['status'](_0x136b3e)[_0x4037('0x2d')](_0x23413a);}};}function respondWithFilteredResult(_0xd45c6c,_0x5c0809){return function(_0x4b164c){if(_0x4b164c){var _0x5cbf3c=_0x4b164c[_0x4037('0x2e')],_0x5386cf=_0x5c0809[_0x4037('0x2f')],_0x215323=_0x5c0809['offset']+_0x5c0809[_0x4037('0x30')],_0x43b866;if(_0x215323>=_0x5cbf3c){_0x215323=_0x5cbf3c;_0x43b866=0xc8;}else{_0x43b866=0xce;}_0xd45c6c['status'](_0x43b866);return _0xd45c6c[_0x4037('0x31')](_0x4037('0x32'),_0x5386cf+'-'+_0x215323+'/'+_0x5cbf3c)[_0x4037('0x2d')](_0x4b164c);}return null;};}function patchUpdates(_0x1858bd){return function(_0x4c7c07){try{jsonpatch[_0x4037('0x33')](_0x4c7c07,_0x1858bd,!![]);}catch(_0x339c5e){return BPromise[_0x4037('0x34')](_0x339c5e);}return _0x4c7c07[_0x4037('0x35')]();};}function saveUpdates(_0x37418b,_0x56ab31){return function(_0x23f1a3){if(_0x23f1a3){return _0x23f1a3[_0x4037('0x36')](_0x37418b)[_0x4037('0x37')](function(_0x2fa93c){return _0x2fa93c;});}return null;};}function removeEntity(_0x2a3af2,_0x48d9e2){return function(_0x55d3b3){if(_0x55d3b3){return _0x55d3b3[_0x4037('0x38')]()[_0x4037('0x37')](function(){var _0x1010ef=_0x55d3b3[_0x4037('0x39')]({'plain':!![]});var _0x2ba042=[{'name':_0x4037('0x3a'),'value':_0x4037('0x3b'),'ignore':!![]},{'name':_0x4037('0x3c'),'value':_0x4037('0x3d'),'ignore':![]},{'name':_0x4037('0x3e'),'value':_0x4037('0x3f'),'ignore':![]}];var _0x56a236=_(_0x2ba042)['filter'](_0x4037('0x40'))['map'](_0x4037('0x41'))[_0x4037('0x41')]();if(_[_0x4037('0x42')](_0x56a236,_0x1010ef[_0x4037('0x43')])){return;}var _0xfb996e=_['find'](_0x2ba042,[_0x4037('0x41'),_0x1010ef[_0x4037('0x43')]])[_0x4037('0x44')];return db[_0x4037('0x45')][_0x4037('0x38')]({'where':{'type':_0xfb996e,'resourceId':_0x1010ef['id']}})['then'](function(){return _0x55d3b3;});})[_0x4037('0x37')](function(){_0x2a3af2[_0x4037('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11ce01,_0x585d70){return function(_0x1a0dce){if(!_0x1a0dce){_0x11ce01[_0x4037('0x2a')](0x194);}return _0x1a0dce;};}function handleError(_0x1f223f,_0x13c65c){_0x13c65c=_0x13c65c||0x1f4;return function(_0x4688e6){logger[_0x4037('0x26')](_0x4688e6[_0x4037('0x46')]);if(_0x4688e6[_0x4037('0x44')]){delete _0x4688e6[_0x4037('0x44')];}_0x1f223f['status'](_0x13c65c)['send'](_0x4688e6);};}exports[_0x4037('0x47')]=function(_0x7c9545,_0x323bd2){var _0xa7dc2b={},_0x2eb7d3={},_0xb07b9f={'count':0x0,'rows':[]};var _0x2af283=db[_0x4037('0x48')]['rawAttributes'];_0x2eb7d3[_0x4037('0x49')]=_['differenceBy'](_['keys'](_0x2af283),['password',_0x4037('0x4a')]);_0x2eb7d3[_0x4037('0x4b')]=_[_0x4037('0x4c')](_0x7c9545[_0x4037('0x4b')]);_0x2eb7d3[_0x4037('0x4d')]=_[_0x4037('0x4e')](_0x2eb7d3[_0x4037('0x49')],_0x2eb7d3[_0x4037('0x4b')]);_0xa7dc2b[_0x4037('0x4f')]=_[_0x4037('0x4e')](_0x2eb7d3['model'],qs['fields'](_0x7c9545[_0x4037('0x4b')][_0x4037('0x50')]));_0xa7dc2b[_0x4037('0x4f')]=_0xa7dc2b[_0x4037('0x4f')][_0x4037('0x51')]?_0xa7dc2b[_0x4037('0x4f')]:_0x2eb7d3[_0x4037('0x49')];if(!_0x7c9545['query'][_0x4037('0x52')](_0x4037('0x53'))){_0xa7dc2b[_0x4037('0x30')]=qs[_0x4037('0x30')](_0x7c9545[_0x4037('0x4b')][_0x4037('0x30')]);_0xa7dc2b[_0x4037('0x2f')]=qs[_0x4037('0x2f')](_0x7c9545[_0x4037('0x4b')]['offset']);}_0xa7dc2b[_0x4037('0x54')]=qs[_0x4037('0x55')](_0x7c9545[_0x4037('0x4b')][_0x4037('0x55')]);_0xa7dc2b[_0x4037('0x56')]=qs[_0x4037('0x4d')](_[_0x4037('0x57')](_0x7c9545[_0x4037('0x4b')],_0x2eb7d3['filters']));if(_0x7c9545[_0x4037('0x4b')][_0x4037('0x58')]){_0xa7dc2b[_0x4037('0x56')]=_['merge'](_0xa7dc2b[_0x4037('0x56')],{'$or':_[_0x4037('0x59')](_0x2af283,function(_0x3d9ffb){if(_0x3d9ffb[_0x4037('0x5a')][_0x4037('0x5b')]!==_0x4037('0x5c')){return db[_0x4037('0x5d')][_0x4037('0x56')](db['sequelize']['fn'](_0x4037('0x5e'),db[_0x4037('0x5d')][_0x4037('0x5f')](_0x3d9ffb[_0x4037('0x60')])),{'$like':db[_0x4037('0x5d')]['fn'](_0x4037('0x5e'),'%'+_0x7c9545[_0x4037('0x4b')][_0x4037('0x58')]+'%')});}})});}_0xa7dc2b=_[_0x4037('0x61')]({},_0xa7dc2b,_0x7c9545[_0x4037('0x62')]);var _0x118343={'where':_0xa7dc2b[_0x4037('0x56')]};return db[_0x4037('0x48')][_0x4037('0x2e')](_0x118343)[_0x4037('0x37')](function(_0x13300b){_0xb07b9f[_0x4037('0x2e')]=_0x13300b;if(_0x7c9545[_0x4037('0x4b')][_0x4037('0x63')]){_0xa7dc2b[_0x4037('0x64')]=[{'all':!![]}];}return db[_0x4037('0x48')][_0x4037('0x65')](_0xa7dc2b);})[_0x4037('0x37')](function(_0x11b658){_0xb07b9f[_0x4037('0x66')]=_0x11b658;return _0xb07b9f;})[_0x4037('0x37')](respondWithFilteredResult(_0x323bd2,_0xa7dc2b))[_0x4037('0x29')](handleError(_0x323bd2,null));};exports['show']=function(_0x3a4a07,_0x41bcf7){var _0x5e2cab={'raw':![],'where':{'id':_0x3a4a07[_0x4037('0x67')]['id']}},_0x4e1c51={};_0x4e1c51[_0x4037('0x49')]=_[_0x4037('0x68')](_[_0x4037('0x4c')](db[_0x4037('0x48')]['rawAttributes']),[_0x4037('0x69'),_0x4037('0x4a')]);_0x4e1c51[_0x4037('0x4b')]=_[_0x4037('0x4c')](_0x3a4a07[_0x4037('0x4b')]);_0x4e1c51[_0x4037('0x4d')]=_[_0x4037('0x4e')](_0x4e1c51[_0x4037('0x49')],_0x4e1c51[_0x4037('0x4b')]);_0x5e2cab[_0x4037('0x4f')]=_[_0x4037('0x4e')](_0x4e1c51[_0x4037('0x49')],qs['fields'](_0x3a4a07[_0x4037('0x4b')][_0x4037('0x50')]));_0x5e2cab[_0x4037('0x4f')]=_0x5e2cab['attributes']['length']?_0x5e2cab[_0x4037('0x4f')]:_0x4e1c51['model'];if(_0x3a4a07[_0x4037('0x4b')]['includeAll']){_0x5e2cab['include']=[{'all':!![]}];}_0x5e2cab=_[_0x4037('0x61')]({},_0x5e2cab,_0x3a4a07[_0x4037('0x62')]);return db[_0x4037('0x48')][_0x4037('0x6a')](_0x5e2cab)[_0x4037('0x37')](handleEntityNotFound(_0x41bcf7,null))[_0x4037('0x37')](respondWithResult(_0x41bcf7,null))[_0x4037('0x29')](handleError(_0x41bcf7,null));};exports[_0x4037('0x6b')]=function(_0x54c1a8,_0x5e1d5f){return db['User']['bulkCreate'](_0x54c1a8[_0x4037('0x6c')],{'raw':![],'individualHooks':!![]})[_0x4037('0x37')](respondWithResult(_0x5e1d5f,0xc9))[_0x4037('0x29')](handleError(_0x5e1d5f,null));};exports[_0x4037('0x36')]=function(_0x15e8f1,_0x5146da){if(_0x15e8f1['body']['id']){delete _0x15e8f1[_0x4037('0x6c')]['id'];}delete _0x15e8f1[_0x4037('0x6c')][_0x4037('0x43')];return db[_0x4037('0x48')][_0x4037('0x6a')]({'where':{'id':_0x15e8f1[_0x4037('0x67')]['id']}})[_0x4037('0x37')](handleEntityNotFound(_0x5146da,null))[_0x4037('0x37')](saveUpdates(_0x15e8f1[_0x4037('0x6c')],null))[_0x4037('0x37')](respondWithResult(_0x5146da,null))['catch'](handleError(_0x5146da,null));};exports[_0x4037('0x6d')]=function(_0x2b5126,_0x2ac272){return db[_0x4037('0x48')]['describe']()[_0x4037('0x37')](respondWithResult(_0x2ac272,null))['catch'](handleError(_0x2ac272,null));};exports[_0x4037('0x6e')]=function(_0x10c140,_0x4fd624,_0x20cdd4){return db[_0x4037('0x48')]['find']({'where':{'id':_0x10c140[_0x4037('0x67')]['id']}})[_0x4037('0x37')](handleEntityNotFound(_0x4fd624,null))[_0x4037('0x37')](function(_0x5f37a5){if(_0x5f37a5){return _0x5f37a5[_0x4037('0x6e')](_0x10c140[_0x4037('0x6c')][_0x4037('0x6f')],_['omit'](_0x10c140[_0x4037('0x6c')],[_0x4037('0x6f'),'id'])||{});}})[_0x4037('0x37')](respondWithResult(_0x4fd624,null))[_0x4037('0x29')](handleError(_0x4fd624,null));};var getLicense=function(_0x4efc00){return new BPromise(function(_0x1a2671,_0x3e0d40){var _0x487b8e=0x0;_0x4efc00[_0x4037('0x6c')][_0x4037('0x43')]===_0x4037('0x3d')&&_0x1a2671('agent\x20role');return db['User']['count']({'where':{'$or':[{'role':_0x4efc00[_0x4037('0x6c')][_0x4037('0x43')]==='telephone'?'telephone':[_0x4037('0x70'),_0x4037('0x3b')]}]}})['then'](function(_0x42a2bf){_0x487b8e=_0x42a2bf;return require('../../config/license/util')[_0x4037('0x71')]();})[_0x4037('0x37')](function(_0x3862bc){var _0x4e2ec5=_0x4efc00[_0x4037('0x6c')]['role']===_0x4037('0x3f')?'telephones':_0x4037('0x72');if(!_[_0x4037('0x73')](_0x3862bc[_0x4e2ec5])&&_0x487b8e>=_0x3862bc[_0x4e2ec5]){return _0x3e0d40({'message':_0x4037('0x74')});}return _0x1a2671(util[_0x4037('0x75')](_0x4037('0x76'),_0x4e2ec5,_0x487b8e));})[_0x4037('0x29')](function(_0x2b7af7){return _0x3e0d40(_0x2b7af7);});});};exports[_0x4037('0x77')]=function(_0x524117,_0x50d737){return getLicense(_0x524117)[_0x4037('0x37')](function(_0x5a913e){if(!_0x524117[_0x4037('0x6c')][_0x4037('0x78')]){var _0x593679;return db['Setting'][_0x4037('0x79')](0x1)[_0x4037('0x37')](function(_0x4cb1eb){_0x4cb1eb['securePassword']=!![];return checkPasswordPattern(_0x4cb1eb,_0x524117[_0x4037('0x6c')][_0x4037('0x69')],_0x4cb1eb[_0x4037('0x7a')]);})[_0x4037('0x37')](function(_0x4ce9e1){_0x593679=_0x4ce9e1[_0x4037('0x7b')];return db[_0x4037('0x48')][_0x4037('0x7c')]('internal');})[_0x4037('0x37')](function(_0x3b70b2){if(_['isNil'](_0x3b70b2)){if(_0x593679){_0x524117[_0x4037('0x6c')]['internal']=_0x593679;}else{_0x524117[_0x4037('0x6c')]['internal']=0x1;}}else{if(_[_0x4037('0x73')](_0x593679)||_0x593679==_0x3b70b2){_0x524117[_0x4037('0x6c')]['internal']=_0x3b70b2+0x1;}else if(_0x593679>_0x3b70b2){_0x524117[_0x4037('0x6c')][_0x4037('0x78')]=_0x593679;}else{return db[_0x4037('0x5d')][_0x4037('0x4b')](_0x4037('0x7d'),{'type':db[_0x4037('0x5d')][_0x4037('0x7e')][_0x4037('0x7f')]})['then'](function(_0x379b57){if(_0x379b57&&_0x379b57[_0x4037('0x51')]){for(var _0x5949e1=0x0,_0x559c1e=_0x379b57[_0x4037('0x51')];_0x5949e1<_0x559c1e&&_[_0x4037('0x73')](_0x524117[_0x4037('0x6c')]['internal']);_0x5949e1++){if(_0x593679<=_0x379b57[_0x5949e1][_0x4037('0x80')]){_0x524117[_0x4037('0x6c')][_0x4037('0x78')]=_0x379b57[_0x5949e1][_0x4037('0x80')];}else if(_0x593679>_0x379b57[_0x5949e1][_0x4037('0x80')]&&_0x593679<=_0x379b57[_0x5949e1]['to']){_0x524117[_0x4037('0x6c')]['internal']=_0x593679;}}}if(_['isNil'](_0x524117[_0x4037('0x6c')][_0x4037('0x78')])){_0x524117[_0x4037('0x6c')]['internal']=_0x3b70b2+0x1;}});}}});}})[_0x4037('0x37')](function(){if(_0x524117['body'][_0x4037('0x81')]){_0x524117[_0x4037('0x6c')][_0x4037('0x82')]=_0x524117[_0x4037('0x6c')]['internal'];_0x524117[_0x4037('0x6c')][_0x4037('0x83')]={'mailbox':_0x524117['body'][_0x4037('0x78')],'password':_0x524117[_0x4037('0x6c')]['password'],'fullname':_0x524117[_0x4037('0x6c')][_0x4037('0x84')],'email':_0x524117[_0x4037('0x6c')][_0x4037('0x85')]};}if(_0x524117[_0x4037('0x6c')]&&_0x524117[_0x4037('0x6c')][_0x4037('0x43')]===_0x4037('0x3d')){_0x524117[_0x4037('0x6c')][_0x4037('0x86')]=[_0x4037('0x87'),'102','103',_0x4037('0x88'),_0x4037('0x89'),_0x4037('0x8a'),_0x4037('0x8b'),_0x4037('0x8c'),_0x4037('0x8d'),_0x4037('0x8e'),'100',_0x4037('0x8f')];}return db['User'][_0x4037('0x77')](_0x524117[_0x4037('0x6c')],{'include':[{'model':db[_0x4037('0x83')],'as':'VoiceMail'}]});})[_0x4037('0x37')](function(_0x14a215){if(_0x524117[_0x4037('0x6c')][_0x4037('0x43')]===_0x4037('0x3b'))return _0x14a215;var _0x3d9a61=_0x524117['user'][_0x4037('0x39')]({'plain':!![]});if(!_0x3d9a61)throw new Error(_0x4037('0x90'));if(_0x3d9a61['role']===_0x4037('0x3b')){var _0x53a94f=_0x14a215[_0x4037('0x39')]({'plain':!![]});var _0x2059a2=[{'name':_0x4037('0x3c'),'value':_0x4037('0x3d')},{'name':'Telephones','value':_0x4037('0x3f')}];var _0xab6f81=_[_0x4037('0x6a')](_0x2059a2,[_0x4037('0x41'),_0x53a94f['role']])['name'];return db[_0x4037('0x91')][_0x4037('0x6a')]({'where':{'name':_0xab6f81,'userProfileId':_0x3d9a61['userProfileId']},'raw':!![]})[_0x4037('0x37')](function(_0x1aa0f1){if(_0x1aa0f1&&_0x1aa0f1[_0x4037('0x92')]===0x0){return db[_0x4037('0x45')][_0x4037('0x77')]({'name':_0x53a94f['name'],'resourceId':_0x53a94f['id'],'type':_0x1aa0f1[_0x4037('0x44')],'sectionId':_0x1aa0f1['id']},{})[_0x4037('0x37')](function(){return _0x14a215;});}else{return _0x14a215;}})['catch'](function(_0x148e53){logger['error'](_0x4037('0x93'),_0x148e53);throw _0x148e53;});}return _0x14a215;})[_0x4037('0x37')](respondWithResult(_0x50d737,0xc9))[_0x4037('0x29')](handleError(_0x50d737,null));};exports['changePassword']=function(_0x1a49c6,_0x1149ae,_0x82c963){var _0x4a5ffa=![];if(_0x1a49c6[_0x4037('0x6c')]['id']){delete _0x1a49c6[_0x4037('0x6c')]['id'];}if(!_[_0x4037('0x73')](_0x1a49c6[_0x4037('0x6c')]['oldPassword'])){if(_0x1a49c6[_0x4037('0x6c')][_0x4037('0x94')]===_0x1a49c6[_0x4037('0x6c')][_0x4037('0x95')]){throw new Error('New\x20password\x20must\x20be\x20different\x20from\x20old\x20one');}}return db[_0x4037('0x48')]['find']({'where':{'id':_0x1a49c6[_0x4037('0x67')]['id']}})[_0x4037('0x37')](function(_0x1b863c){if(_0x1b863c){if(_0x1b863c['id']==_0x1a49c6[_0x4037('0x3b')]['id']){if(!_0x1a49c6[_0x4037('0x6c')][_0x4037('0x94')]||!_0x1a49c6[_0x4037('0x6c')]['newPassword']){throw new db[(_0x4037('0x96'))][(_0x4037('0x97'))](_0x4037('0x98'));}if(!_0x1b863c[_0x4037('0x99')](_0x1a49c6['body'][_0x4037('0x94')])){throw new db[(_0x4037('0x96'))][(_0x4037('0x97'))]('Wrong\x20credentials');}if(_0x1a49c6[_0x4037('0x6c')]['oldPassword']==_0x1a49c6['body'][_0x4037('0x95')]){throw new db[(_0x4037('0x96'))][(_0x4037('0x97'))](_0x4037('0x9a'));}return _0x1b863c;}else if(_0x1a49c6[_0x4037('0x3b')][_0x4037('0x43')]=='admin'){if(!_0x1a49c6[_0x4037('0x6c')]['newPassword']){throw new db[(_0x4037('0x96'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x1b863c;}else if(_0x1a49c6[_0x4037('0x3b')]['role']==_0x4037('0x3b')){if(!_0x1a49c6[_0x4037('0x6c')][_0x4037('0x95')]){throw new db['Sequelize'][(_0x4037('0x97'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x1b863c['role']!=_0x4037('0x3d')){throw new db['Sequelize']['ValidationError']('Unauthorized');}return _0x1b863c;}else{throw new db[(_0x4037('0x96'))][(_0x4037('0x97'))](_0x4037('0x9b'));}}return null;})[_0x4037('0x37')](handleEntityNotFound(_0x1149ae,null))[_0x4037('0x37')](function(_0x778828){return db[_0x4037('0x9c')][_0x4037('0x9d')]({'attributes':['id',_0x4037('0x7a')]})[_0x4037('0x37')](function(_0x545c7b){_0x4a5ffa=_0x545c7b[_0x4037('0x7a')];return checkPasswordPattern(_0x778828,_0x1a49c6[_0x4037('0x6c')][_0x4037('0x95')],_0x4a5ffa);});})[_0x4037('0x37')](saveUpdates({'password':_0x1a49c6[_0x4037('0x6c')]['newPassword'],'passwordResetAt':_0x1a49c6['user']['id']==_0x1a49c6[_0x4037('0x67')]['id']?moment():null},null))[_0x4037('0x37')](respondWithResult(_0x1149ae,null))[_0x4037('0x29')](handleError(_0x1149ae,null));};exports[_0x4037('0x9e')]=function(_0x121af5,_0x141fce,_0xd9875f){var _0x37bf50=_0x121af5[_0x4037('0x6c')][_0x4037('0x9f')];return db[_0x4037('0x48')][_0x4037('0x6a')]({'where':{'id':_0x121af5[_0x4037('0x67')]['id']},'attributes':['id','name',_0x4037('0x43'),_0x4037('0xa0'),_0x4037('0xa1'),_0x4037('0xa2'),_0x4037('0xa3')]})[_0x4037('0x37')](handleEntityNotFound(_0x141fce,null))['then'](function(_0x91a50c){if(_0x91a50c){if(!utils['isValidChannel'](_0x37bf50)){throw new db[(_0x4037('0x96'))][(_0x4037('0x97'))](_0x4037('0xa4'));}return _0x91a50c['add'+_[_0x4037('0xa5')](_0x37bf50[_0x4037('0xa6')]())+_0x4037('0xa7')](_0x121af5[_0x4037('0x6c')][_0x4037('0x6f')],{'penalty':_0x121af5[_0x4037('0x6c')][_0x4037('0xa8')]||0x0})[_0x4037('0xa9')](function(_0x298176){for(var _0x1205bc=0x0;_0x1205bc<_0x121af5[_0x4037('0x6c')][_0x4037('0x6f')]['length'];_0x1205bc+=0x1){var _0x58bb23={'UserId':_0x121af5[_0x4037('0x67')]['id']};_0x58bb23[_[_0x4037('0xa5')](_0x37bf50['toLowerCase']())+_0x4037('0xaa')]=_0x121af5[_0x4037('0x6c')]['ids'][_0x1205bc];socket[_0x4037('0xab')](_0x4037('0x3b')+_[_0x4037('0xa5')](_0x37bf50[_0x4037('0xa6')]())+_0x4037('0xac'),_0x58bb23);}return _0x298176;})['then'](function(){if(_0x37bf50===_0x4037('0xad')){return db[_0x4037('0xae')][_0x4037('0x65')]({'where':{'id':_0x121af5[_0x4037('0x6c')][_0x4037('0x6f')]||[]},'raw':!![],'attributes':['id',_0x4037('0x44')]});}})['then'](function(_0x4a4109){var _0x183c45=_0x91a50c[_0x4037('0x39')]({'plain':!![]});var _0x1746b4=[];if(_0x37bf50===_0x4037('0xad')&&_0x183c45[_0x4037('0x43')]===_0x4037('0x3d')&&_0x183c45['online']){for(var _0x10c435=0x0;_0x10c435<_0x4a4109['length'];_0x10c435+=0x1){_0x1746b4[_0x4037('0xaf')]({'membername':_0x183c45[_0x4037('0x44')],'UserId':_0x183c45['id'],'queue_name':_0x4a4109[_0x10c435]['name'],'VoiceQueueId':_0x4a4109[_0x10c435]['id'],'interface':_[_0x4037('0x73')](_0x183c45[_0x4037('0xa3')])?util[_0x4037('0x75')](_0x4037('0xb0'),_0x183c45[_0x4037('0x44')]):_0x183c45['interface'],'paused':_0x183c45[_0x4037('0xa2')]||![],'penalty':_0x121af5[_0x4037('0x6c')][_0x4037('0xa8')]||0x0});}return BPromise['each'](_0x1746b4,function(_0x25ba45){return db[_0x4037('0xb1')][_0x4037('0xb2')](_0x25ba45);});}return _0x91a50c;});}})[_0x4037('0x37')](respondWithStatusCode(_0x141fce,null))[_0x4037('0x29')](handleError(_0x141fce,null));};exports[_0x4037('0xb3')]=function(_0x46c61d,_0x219e01,_0x487d5e){var _0x2eee7a;return db[_0x4037('0x48')][_0x4037('0x6a')]({'where':{'id':_0x46c61d[_0x4037('0x67')]['id']},'attributes':['id',_0x4037('0x44'),_0x4037('0x43')]})[_0x4037('0x37')](handleEntityNotFound(_0x219e01,null))[_0x4037('0x37')](function(_0x3a7565){if(_0x3a7565){_0x2eee7a=_0x3a7565;if(!_0x46c61d[_0x4037('0x4b')][_0x4037('0x9f')]||!utils[_0x4037('0xb4')](_0x46c61d[_0x4037('0x4b')][_0x4037('0x9f')])){throw new db['Sequelize'][(_0x4037('0x97'))]('Unknown\x20channel');}return _0x3a7565['remove'+_[_0x4037('0xa5')](_0x46c61d[_0x4037('0x4b')][_0x4037('0x9f')][_0x4037('0xa6')]())+'Queues'](_0x46c61d[_0x4037('0x4b')][_0x4037('0x6f')]);}})[_0x4037('0x37')](function(_0x2f8552){for(var _0x546e60=0x0;_0x546e60<_0x46c61d['query'][_0x4037('0x6f')]['length'];_0x546e60+=0x1){var _0x31d8cc={'UserId':_0x46c61d[_0x4037('0x67')]['id']};_0x31d8cc[_[_0x4037('0xa5')](_0x46c61d['query'][_0x4037('0x9f')][_0x4037('0xa6')]())+'QueueId']=_0x46c61d[_0x4037('0x4b')][_0x4037('0x6f')][_0x546e60];socket['emit'](_0x4037('0x3b')+_[_0x4037('0xa5')](_0x46c61d[_0x4037('0x4b')][_0x4037('0x9f')][_0x4037('0xa6')]())+_0x4037('0xb5'),_0x31d8cc);}return _0x2f8552;})['then'](function(){if(_0x46c61d[_0x4037('0x4b')][_0x4037('0x9f')]===_0x4037('0xad')){return db[_0x4037('0xb1')][_0x4037('0x38')]({'where':{'UserId':_0x46c61d[_0x4037('0x67')]['id'],'VoiceQueueId':_0x46c61d[_0x4037('0x4b')][_0x4037('0x6f')]},'individualHooks':!![]})[_0x4037('0x37')](function(){return _0x2eee7a;});}return _0x2eee7a;})[_0x4037('0x37')](respondWithStatusCode(_0x219e01,null))[_0x4037('0x29')](handleError(_0x219e01,null));};exports[_0x4037('0xb6')]=function(_0x318f6b,_0x297345,_0x27de9f){_0x318f6b[_0x4037('0x6c')][_0x4037('0xb7')]=_0x318f6b[_0x4037('0xb8')][_0x4037('0xb9')];return db[_0x4037('0x48')]['find']({'where':{'id':_0x318f6b[_0x4037('0x67')]['id']}})[_0x4037('0x37')](handleEntityNotFound(_0x297345,null))['then'](saveUpdates(_0x318f6b[_0x4037('0x6c')],null))['then'](respondWithResult(_0x297345,null))[_0x4037('0x29')](handleError(_0x297345,null));};exports['getAvatar']=function(_0x4ed5ba,_0x225e27,_0x541f11){var _0x3b5a02=path[_0x4037('0xba')](config[_0x4037('0xbb')],_0x4037('0xbc'));return db[_0x4037('0x48')][_0x4037('0x6a')]({'where':{'id':_0x4ed5ba[_0x4037('0x67')]['id']},'attributes':['id',_0x4037('0xb7')],'raw':!![]})['then'](handleEntityNotFound(_0x225e27,null))['then'](function(_0x16df7c){if(_0x16df7c){if(_[_0x4037('0x73')](_0x16df7c['userpic'])){return _0x225e27[_0x4037('0xbd')](_0x3b5a02);}else{if(!fs[_0x4037('0xbe')](path['join'](config['root'],'server/files/images/',_0x16df7c[_0x4037('0xb7')]))){return _0x225e27[_0x4037('0xbd')](_0x3b5a02);}return _0x225e27[_0x4037('0xbd')](path[_0x4037('0xba')](config[_0x4037('0xbb')],_0x4037('0xbf'),_0x16df7c[_0x4037('0xb7')]));}}})[_0x4037('0x29')](handleError(_0x225e27,null));};exports[_0x4037('0xc0')]=function(_0x552b9e,_0x1256ef,_0x23d231){var _0x4b42d2={};var _0x51f66d={};var _0x4edf18;var _0x53d5b2;return db[_0x4037('0x48')][_0x4037('0x9d')]({'where':{'id':_0x552b9e[_0x4037('0x67')]['id']}})[_0x4037('0x37')](handleEntityNotFound(_0x1256ef,null))['then'](function(_0x4685a6){if(_0x4685a6){_0x4edf18=_0x4685a6;_0x51f66d[_0x4037('0x49')]=_['keys'](db[_0x4037('0xc1')][_0x4037('0xc2')]);_0x51f66d[_0x4037('0x4b')]=_[_0x4037('0x4c')](_0x552b9e[_0x4037('0x4b')]);_0x51f66d['filters']=_[_0x4037('0x4e')](_0x51f66d[_0x4037('0x49')],_0x51f66d['query']);_0x4b42d2[_0x4037('0x4f')]=_['intersection'](_0x51f66d[_0x4037('0x49')],qs[_0x4037('0x50')](_0x552b9e[_0x4037('0x4b')][_0x4037('0x50')]));_0x4b42d2[_0x4037('0x4f')]=_0x4b42d2[_0x4037('0x4f')]['length']?_0x4b42d2[_0x4037('0x4f')]:_0x51f66d[_0x4037('0x49')];_0x4b42d2[_0x4037('0x54')]=qs[_0x4037('0x55')](_0x552b9e[_0x4037('0x4b')][_0x4037('0x55')]);_0x4b42d2['where']=qs[_0x4037('0x4d')](_['pick'](_0x552b9e[_0x4037('0x4b')],_0x51f66d['filters']));if(_0x552b9e[_0x4037('0x4b')][_0x4037('0x58')]){_0x4b42d2[_0x4037('0x56')]=_[_0x4037('0x61')](_0x4b42d2['where'],{'$or':_[_0x4037('0x59')](_0x4b42d2[_0x4037('0x4f')],function(_0x1a7d51){var _0x155b35={};_0x155b35[_0x1a7d51]={'$like':'%'+_0x552b9e[_0x4037('0x4b')][_0x4037('0x58')]+'%'};return _0x155b35;})});}_0x4b42d2=_['merge']({},_0x4b42d2,_0x552b9e[_0x4037('0x62')]);return _0x4edf18[_0x4037('0xc0')](_0x4b42d2);}})[_0x4037('0x37')](function(_0x82408f){if(_0x82408f){_0x53d5b2=_0x82408f[_0x4037('0x51')];if(_0x552b9e[_0x4037('0x4b')]['hasOwnProperty']('includeAll')){_0x4b42d2['include']=[{'model':db[_0x4037('0xc3')],'as':_0x4037('0xc4'),'required':![]},{'model':db[_0x4037('0xc5')],'as':_0x4037('0xc6'),'attributes':['id',_0x4037('0x44'),_0x4037('0xc7')],'where':_0x552b9e[_0x4037('0x4b')][_0x4037('0xc8')]?{'id':_0x552b9e[_0x4037('0x4b')][_0x4037('0xc8')]}:undefined,'required':_0x552b9e[_0x4037('0x4b')][_0x4037('0xc8')]?!![]:![]}];}if(!_0x552b9e['query']['hasOwnProperty'](_0x4037('0x53'))){_0x4b42d2['limit']=qs['limit'](_0x552b9e[_0x4037('0x4b')][_0x4037('0x30')]);_0x4b42d2[_0x4037('0x2f')]=qs[_0x4037('0x2f')](_0x552b9e[_0x4037('0x4b')][_0x4037('0x2f')]);}return _0x4edf18[_0x4037('0xc0')](_0x4b42d2);}})[_0x4037('0x37')](function(_0x151f6c){if(_0x151f6c){return _0x151f6c?{'count':_0x53d5b2,'rows':_0x151f6c}:null;}})[_0x4037('0x37')](respondWithResult(_0x1256ef,null))[_0x4037('0x29')](handleError(_0x1256ef,null));};exports[_0x4037('0xc9')]=function(_0x2290a2,_0x1cddb2,_0x464c91){var _0x8d92bf;var _0x48417d;var _0x511c47={};var _0x4ea461;return db[_0x4037('0x48')][_0x4037('0x9d')]({'where':{'id':_0x2290a2[_0x4037('0x67')]['id']},'attributes':['id',_0x4037('0x44'),_0x4037('0x43')]})[_0x4037('0x37')](handleEntityNotFound(_0x1cddb2,null))[_0x4037('0x37')](function(_0x5031b5){if(!utils['isValidChannel'](_0x2290a2['query'][_0x4037('0x9f')])){throw new db[(_0x4037('0x96'))][(_0x4037('0x97'))](_0x4037('0xa4'));}_0x8d92bf=_0x5031b5;var _0x348883={};_0x348883[_0x4037('0x49')]=_['keys'](db[_[_0x4037('0xa5')](_0x2290a2['query']['channel'])+_0x4037('0xca')][_0x4037('0xc2')]);_0x348883[_0x4037('0x4b')]=_[_0x4037('0x4c')](_0x2290a2[_0x4037('0x4b')]);_0x348883[_0x4037('0x4d')]=_['intersection'](_0x348883[_0x4037('0x49')],_0x348883[_0x4037('0x4b')]);_0x511c47[_0x4037('0x4f')]=_[_0x4037('0x4e')](_0x348883[_0x4037('0x49')],qs[_0x4037('0x50')](_0x2290a2['query'][_0x4037('0x50')]));_0x511c47[_0x4037('0x4f')]=_0x511c47[_0x4037('0x4f')][_0x4037('0x51')]?_0x511c47['attributes']:_0x348883[_0x4037('0x49')];_0x511c47[_0x4037('0x54')]=qs[_0x4037('0x55')](_0x2290a2[_0x4037('0x4b')][_0x4037('0x55')]);_0x511c47[_0x4037('0x56')]=qs['filters'](_['pick'](_0x2290a2[_0x4037('0x4b')],_0x348883[_0x4037('0x4d')]));if(_0x2290a2[_0x4037('0x4b')][_0x4037('0x58')]){_0x511c47[_0x4037('0x56')]=_['merge'](_0x511c47[_0x4037('0x56')],{'$or':_[_0x4037('0x59')](_0x511c47[_0x4037('0x4f')],function(_0x34cf8c){var _0x805ee3={};_0x805ee3[_0x34cf8c]={'$like':'%'+_0x2290a2[_0x4037('0x4b')][_0x4037('0x58')]+'%'};return _0x805ee3;})});}_0x511c47=_[_0x4037('0x61')]({},_0x511c47,_0x2290a2['options']);switch(_0x8d92bf[_0x4037('0x43')]){case _0x4037('0x70'):return db[_[_0x4037('0xa5')](_0x2290a2[_0x4037('0x4b')]['channel'])+'Queue'][_0x4037('0x65')](_0x511c47);case'user':case _0x4037('0x3d'):return _0x8d92bf[_0x4037('0x39')+_[_0x4037('0xa5')](_0x2290a2[_0x4037('0x4b')]['channel'])+_0x4037('0xa7')](_0x511c47);default:throw new db['Sequelize'][(_0x4037('0x97'))](_0x4037('0xcb'));}})['then'](function(_0x438bfd){_0x4ea461=_0x438bfd['length'];if(!_0x2290a2['query'][_0x4037('0x52')](_0x4037('0x53'))){_0x511c47['limit']=qs['limit'](_0x2290a2['query'][_0x4037('0x30')]);_0x511c47['offset']=qs[_0x4037('0x2f')](_0x2290a2['query'][_0x4037('0x2f')]);}switch(_0x8d92bf[_0x4037('0x43')]){case _0x4037('0x70'):return db[_[_0x4037('0xa5')](_0x2290a2[_0x4037('0x4b')]['channel'])+_0x4037('0xca')][_0x4037('0x65')](_0x511c47);case _0x4037('0x3b'):case _0x4037('0x3d'):return _0x8d92bf[_0x4037('0x39')+_[_0x4037('0xa5')](_0x2290a2[_0x4037('0x4b')][_0x4037('0x9f')])+_0x4037('0xa7')](_0x511c47);}})['then'](function(_0x28189e){return{'count':_0x4ea461,'rows':_0x28189e};})['then'](respondWithResult(_0x1cddb2,null))[_0x4037('0x29')](handleError(_0x1cddb2,null));};exports[_0x4037('0xcc')]=function(_0x426d04,_0x2cdf29,_0x2b5494){var _0x207945={};var _0x4b220b={};var _0x4031c6;var _0x5a4714;return db['User'][_0x4037('0x9d')]({'where':{'id':_0x426d04['params']['id']}})[_0x4037('0x37')](handleEntityNotFound(_0x2cdf29,null))['then'](function(_0x217218){if(_0x217218){_0x4031c6=_0x217218;_0x4b220b['model']=_['keys'](db['UserVoiceQueueRt'][_0x4037('0xc2')]);_0x4b220b[_0x4037('0x4b')]=_[_0x4037('0x4c')](_0x426d04['query']);_0x4b220b[_0x4037('0x4d')]=_[_0x4037('0x4e')](_0x4b220b[_0x4037('0x49')],_0x4b220b[_0x4037('0x4b')]);_0x207945[_0x4037('0x4f')]=_['intersection'](_0x4b220b[_0x4037('0x49')],qs[_0x4037('0x50')](_0x426d04['query'][_0x4037('0x50')]));_0x207945[_0x4037('0x4f')]=_0x207945[_0x4037('0x4f')][_0x4037('0x51')]?_0x207945['attributes']:_0x4b220b[_0x4037('0x49')];_0x207945[_0x4037('0x54')]=qs['sort'](_0x426d04['query'][_0x4037('0x55')]);_0x207945[_0x4037('0x56')]=qs[_0x4037('0x4d')](_[_0x4037('0x57')](_0x426d04[_0x4037('0x4b')],_0x4b220b[_0x4037('0x4d')]));if(_0x426d04['query'][_0x4037('0x58')]){_0x207945[_0x4037('0x56')]=_[_0x4037('0x61')](_0x207945[_0x4037('0x56')],{'$or':_[_0x4037('0x59')](_0x207945[_0x4037('0x4f')],function(_0x5b2843){var _0x5ec1ff={};_0x5ec1ff[_0x5b2843]={'$like':'%'+_0x426d04['query']['filter']+'%'};return _0x5ec1ff;})});}_0x207945=_[_0x4037('0x61')]({},_0x207945,_0x426d04[_0x4037('0x62')]);return _0x4031c6[_0x4037('0xcc')](_0x207945);}})['then'](function(_0x3cce2e){if(_0x3cce2e){_0x5a4714=_0x3cce2e[_0x4037('0x51')];if(!_0x426d04[_0x4037('0x4b')][_0x4037('0x52')](_0x4037('0x53'))){_0x207945[_0x4037('0x30')]=qs[_0x4037('0x30')](_0x426d04['query']['limit']);_0x207945[_0x4037('0x2f')]=qs[_0x4037('0x2f')](_0x426d04[_0x4037('0x4b')][_0x4037('0x2f')]);}return _0x4031c6['getVoiceQueuesRt'](_0x207945);}})[_0x4037('0x37')](function(_0x358035){if(_0x358035){return _0x358035?{'count':_0x5a4714,'rows':_0x358035}:null;}})[_0x4037('0x37')](respondWithResult(_0x2cdf29,null))['catch'](handleError(_0x2cdf29,null));};exports[_0x4037('0xcd')]=function(_0x21c232,_0x5e1905,_0x4b9131){var _0x42d086={};var _0x50857c={};var _0x16a993;var _0xa61e0f;return db[_0x4037('0x48')]['findOne']({'where':{'id':_0x21c232['params']['id']}})['then'](handleEntityNotFound(_0x5e1905,null))[_0x4037('0x37')](function(_0x53be21){if(_0x53be21){_0x16a993=_0x53be21;_0x50857c['model']=_['keys'](db[_0x4037('0xce')][_0x4037('0xc2')]);_0x50857c[_0x4037('0x4b')]=_[_0x4037('0x4c')](_0x21c232[_0x4037('0x4b')]);_0x50857c[_0x4037('0x4d')]=_[_0x4037('0x4e')](_0x50857c[_0x4037('0x49')],_0x50857c[_0x4037('0x4b')]);_0x42d086[_0x4037('0x4f')]=_[_0x4037('0x4e')](_0x50857c[_0x4037('0x49')],qs[_0x4037('0x50')](_0x21c232[_0x4037('0x4b')][_0x4037('0x50')]));_0x42d086[_0x4037('0x4f')]=_0x42d086['attributes'][_0x4037('0x51')]?_0x42d086['attributes']:_0x50857c[_0x4037('0x49')];_0x42d086['order']=qs['sort'](_0x21c232[_0x4037('0x4b')][_0x4037('0x55')]);_0x42d086['where']=qs[_0x4037('0x4d')](_[_0x4037('0x57')](_0x21c232['query'],_0x50857c[_0x4037('0x4d')]));if(_0x21c232[_0x4037('0x4b')][_0x4037('0x58')]){_0x42d086['where']=_[_0x4037('0x61')](_0x42d086[_0x4037('0x56')],{'$or':_[_0x4037('0x59')](_0x42d086[_0x4037('0x4f')],function(_0x413619){var _0x468734={};_0x468734[_0x413619]={'$like':'%'+_0x21c232[_0x4037('0x4b')]['filter']+'%'};return _0x468734;})});}_0x42d086=_[_0x4037('0x61')]({},_0x42d086,_0x21c232[_0x4037('0x62')]);return _0x16a993['getGroups'](_0x42d086);}})[_0x4037('0x37')](function(_0x35b197){if(_0x35b197){_0xa61e0f=_0x35b197[_0x4037('0x51')];if(!_0x21c232[_0x4037('0x4b')]['hasOwnProperty']('nolimit')){_0x42d086[_0x4037('0x30')]=qs['limit'](_0x21c232[_0x4037('0x4b')][_0x4037('0x30')]);_0x42d086['offset']=qs[_0x4037('0x2f')](_0x21c232['query'][_0x4037('0x2f')]);}return _0x16a993['getGroups'](_0x42d086);}})[_0x4037('0x37')](function(_0x36f362){if(_0x36f362){return _0x36f362?{'count':_0xa61e0f,'rows':_0x36f362}:null;}})[_0x4037('0x37')](respondWithResult(_0x5e1905,null))[_0x4037('0x29')](handleError(_0x5e1905,null));};exports['getRecordings']=function(_0x403a1e,_0x504643,_0x37b3b3){var _0x375206={'raw':!![],'where':{}};var _0x2f091c={};var _0x187458={'count':0x0,'rows':[]};return db[_0x4037('0x48')]['findOne']({'where':{'id':_0x403a1e[_0x4037('0x67')]['id']}})['then'](handleEntityNotFound(_0x504643,null))[_0x4037('0x37')](function(_0x3f5e15){if(_0x3f5e15){_0x2f091c[_0x4037('0x49')]=_[_0x4037('0x4c')](db['VoiceRecording'][_0x4037('0xc2')]);_0x2f091c[_0x4037('0x4b')]=_[_0x4037('0x4c')](_0x403a1e[_0x4037('0x4b')]);_0x2f091c[_0x4037('0x4d')]=_[_0x4037('0x4e')](_0x2f091c[_0x4037('0x49')],_0x2f091c[_0x4037('0x4b')]);_0x375206[_0x4037('0x4f')]=_[_0x4037('0x4e')](_0x2f091c[_0x4037('0x49')],qs[_0x4037('0x50')](_0x403a1e[_0x4037('0x4b')][_0x4037('0x50')]));_0x375206[_0x4037('0x4f')]=_0x375206[_0x4037('0x4f')]['length']?_0x375206[_0x4037('0x4f')]:_0x2f091c[_0x4037('0x49')];if(!_0x403a1e[_0x4037('0x4b')][_0x4037('0x52')](_0x4037('0x53'))){_0x375206[_0x4037('0x30')]=qs[_0x4037('0x30')](_0x403a1e[_0x4037('0x4b')][_0x4037('0x30')]);_0x375206[_0x4037('0x2f')]=qs['offset'](_0x403a1e['query'][_0x4037('0x2f')]);}_0x375206[_0x4037('0x54')]=qs['sort'](_0x403a1e[_0x4037('0x4b')][_0x4037('0x55')]);_0x375206[_0x4037('0x56')]=qs[_0x4037('0x4d')](_['pick'](_0x403a1e[_0x4037('0x4b')],_0x2f091c[_0x4037('0x4d')]));_0x375206[_0x4037('0x56')][_0x4037('0xcf')]=_0x3f5e15['id'];if(_0x403a1e[_0x4037('0x4b')][_0x4037('0x58')]){_0x375206[_0x4037('0x56')]=_[_0x4037('0x61')](_0x375206[_0x4037('0x56')],{'$or':_[_0x4037('0x59')](_0x375206[_0x4037('0x4f')],function(_0x4ea889){var _0x3d9d6f={};_0x3d9d6f[_0x4ea889]={'$like':'%'+_0x403a1e[_0x4037('0x4b')]['filter']+'%'};return _0x3d9d6f;})});}_0x375206=_[_0x4037('0x61')]({},_0x375206,_0x403a1e[_0x4037('0x62')]);return db['VoiceRecording'][_0x4037('0x2e')]({'where':_0x375206['where']})[_0x4037('0x37')](function(_0x5f3fbb){_0x187458[_0x4037('0x2e')]=_0x5f3fbb;if(_0x403a1e['query'][_0x4037('0x63')]){_0x375206[_0x4037('0x64')]=[{'all':!![]}];}return db[_0x4037('0xd0')][_0x4037('0x65')](_0x375206);})[_0x4037('0x37')](function(_0x301927){_0x187458[_0x4037('0x66')]=_0x301927;return _0x187458;});}})[_0x4037('0x37')](respondWithFilteredResult(_0x504643,_0x375206))[_0x4037('0x29')](handleError(_0x504643,null));};exports['getScreenRecordings']=function(_0x40a30d,_0x11ac8f,_0x286bc5){var _0x9d739d={'raw':!![],'where':{}};var _0x156360={};var _0x1ccab9={'count':0x0,'rows':[]};return db[_0x4037('0x48')]['findOne']({'where':{'id':_0x40a30d[_0x4037('0x67')]['id']}})[_0x4037('0x37')](handleEntityNotFound(_0x11ac8f,null))['then'](function(_0x3b10f4){if(_0x3b10f4){_0x156360[_0x4037('0x49')]=_[_0x4037('0x4c')](db[_0x4037('0xd1')]['rawAttributes']);_0x156360[_0x4037('0x4b')]=_[_0x4037('0x4c')](_0x40a30d[_0x4037('0x4b')]);_0x156360['filters']=_['intersection'](_0x156360['model'],_0x156360[_0x4037('0x4b')]);_0x9d739d[_0x4037('0x4f')]=_[_0x4037('0x4e')](_0x156360[_0x4037('0x49')],qs[_0x4037('0x50')](_0x40a30d[_0x4037('0x4b')]['fields']));_0x9d739d[_0x4037('0x4f')]=_0x9d739d[_0x4037('0x4f')][_0x4037('0x51')]?_0x9d739d['attributes']:_0x156360[_0x4037('0x49')];if(!_0x40a30d[_0x4037('0x4b')][_0x4037('0x52')]('nolimit')){_0x9d739d[_0x4037('0x30')]=qs[_0x4037('0x30')](_0x40a30d[_0x4037('0x4b')][_0x4037('0x30')]);_0x9d739d[_0x4037('0x2f')]=qs[_0x4037('0x2f')](_0x40a30d[_0x4037('0x4b')][_0x4037('0x2f')]);}_0x9d739d['order']=qs['sort'](_0x40a30d[_0x4037('0x4b')][_0x4037('0x55')]);_0x9d739d['where']=qs[_0x4037('0x4d')](_[_0x4037('0x57')](_0x40a30d['query'],_0x156360['filters']));_0x9d739d[_0x4037('0x56')]['UserId']=_0x3b10f4['id'];if(_0x40a30d[_0x4037('0x4b')]['filter']){_0x9d739d['where']=_[_0x4037('0x61')](_0x9d739d['where'],{'$or':_[_0x4037('0x59')](_0x9d739d[_0x4037('0x4f')],function(_0x2fbdfe){var _0xcd2764={};_0xcd2764[_0x2fbdfe]={'$like':'%'+_0x40a30d[_0x4037('0x4b')][_0x4037('0x58')]+'%'};return _0xcd2764;})});}_0x9d739d=_['merge']({},_0x9d739d,_0x40a30d[_0x4037('0x62')]);return db[_0x4037('0xd1')][_0x4037('0x2e')]({'where':_0x9d739d[_0x4037('0x56')]})[_0x4037('0x37')](function(_0x15231e){_0x1ccab9[_0x4037('0x2e')]=_0x15231e;if(_0x40a30d[_0x4037('0x4b')][_0x4037('0x63')]){_0x9d739d[_0x4037('0x64')]=[{'all':!![]}];}return db[_0x4037('0xd1')][_0x4037('0x65')](_0x9d739d);})['then'](function(_0xd3aa85){_0x1ccab9[_0x4037('0x66')]=_0xd3aa85;return _0x1ccab9;});}})[_0x4037('0x37')](respondWithFilteredResult(_0x11ac8f,_0x9d739d))['catch'](handleError(_0x11ac8f,null));};exports[_0x4037('0xd2')]=function(_0x5c567c,_0x1ba77d,_0x255086){var _0x2c0e99={};var _0x10477c={};var _0x131c61;var _0x5ea805;return db['User']['findOne']({'where':{'id':_0x5c567c[_0x4037('0x67')]['id']}})[_0x4037('0x37')](handleEntityNotFound(_0x1ba77d,null))[_0x4037('0x37')](function(_0x558ded){if(_0x558ded){_0x131c61=_0x558ded;_0x10477c[_0x4037('0x49')]=_[_0x4037('0x4c')](db[_0x4037('0xd3')][_0x4037('0xc2')]);_0x10477c[_0x4037('0x4b')]=_[_0x4037('0x4c')](_0x5c567c[_0x4037('0x4b')]);_0x10477c['filters']=_[_0x4037('0x4e')](_0x10477c[_0x4037('0x49')],_0x10477c[_0x4037('0x4b')]);_0x2c0e99[_0x4037('0x4f')]=_['intersection'](_0x10477c['model'],qs[_0x4037('0x50')](_0x5c567c[_0x4037('0x4b')][_0x4037('0x50')]));_0x2c0e99[_0x4037('0x4f')]=_0x2c0e99[_0x4037('0x4f')][_0x4037('0x51')]?_0x2c0e99[_0x4037('0x4f')]:_0x10477c['model'];_0x2c0e99[_0x4037('0x54')]=qs['sort'](_0x5c567c['query'][_0x4037('0x55')]);_0x2c0e99[_0x4037('0x56')]=qs[_0x4037('0x4d')](_['pick'](_0x5c567c[_0x4037('0x4b')],_0x10477c['filters']));if(_0x5c567c['query'][_0x4037('0x58')]){_0x2c0e99['where']=_['merge'](_0x2c0e99[_0x4037('0x56')],{'$or':_[_0x4037('0x59')](_0x2c0e99['attributes'],function(_0x14388f){var _0x40e687={};_0x40e687[_0x14388f]={'$like':'%'+_0x5c567c[_0x4037('0x4b')]['filter']+'%'};return _0x40e687;})});}_0x2c0e99=_[_0x4037('0x61')]({},_0x2c0e99,_0x5c567c[_0x4037('0x62')]);return _0x131c61[_0x4037('0xd2')](_0x2c0e99);}})[_0x4037('0x37')](function(_0x20cf7c){if(_0x20cf7c){_0x5ea805=_0x20cf7c[_0x4037('0x51')];if(!_0x5c567c[_0x4037('0x4b')]['hasOwnProperty']('nolimit')){_0x2c0e99[_0x4037('0x30')]=qs[_0x4037('0x30')](_0x5c567c[_0x4037('0x4b')]['limit']);_0x2c0e99[_0x4037('0x2f')]=qs['offset'](_0x5c567c[_0x4037('0x4b')][_0x4037('0x2f')]);}return _0x131c61[_0x4037('0xd2')](_0x2c0e99);}})['then'](function(_0x243e14){if(_0x243e14){return _0x243e14?{'count':_0x5ea805,'rows':_0x243e14}:null;}})[_0x4037('0x37')](respondWithResult(_0x1ba77d,null))[_0x4037('0x29')](handleError(_0x1ba77d,null));};exports[_0x4037('0xd4')]=function(_0x2bf90c,_0x5a1de7,_0xb644fb){var _0x2f2e08={};var _0x1548f8={};var _0x389943;var _0x4440db;return db[_0x4037('0x48')][_0x4037('0x9d')]({'where':{'id':_0x2bf90c[_0x4037('0x67')]['id']}})[_0x4037('0x37')](handleEntityNotFound(_0x5a1de7,null))[_0x4037('0x37')](function(_0x53cabd){if(_0x53cabd){_0x389943=_0x53cabd;_0x1548f8[_0x4037('0x49')]=_[_0x4037('0x4c')](db[_0x4037('0xd5')][_0x4037('0xc2')]);_0x1548f8[_0x4037('0x4b')]=_[_0x4037('0x4c')](_0x2bf90c['query']);_0x1548f8[_0x4037('0x4d')]=_[_0x4037('0x4e')](_0x1548f8[_0x4037('0x49')],_0x1548f8[_0x4037('0x4b')]);_0x2f2e08[_0x4037('0x4f')]=_[_0x4037('0x4e')](_0x1548f8[_0x4037('0x49')],qs[_0x4037('0x50')](_0x2bf90c['query'][_0x4037('0x50')]));_0x2f2e08[_0x4037('0x4f')]=_0x2f2e08[_0x4037('0x4f')][_0x4037('0x51')]?_0x2f2e08[_0x4037('0x4f')]:_0x1548f8[_0x4037('0x49')];_0x2f2e08[_0x4037('0x54')]=qs['sort'](_0x2bf90c[_0x4037('0x4b')]['sort']);_0x2f2e08['where']=qs['filters'](_['pick'](_0x2bf90c[_0x4037('0x4b')],_0x1548f8[_0x4037('0x4d')]));if(_0x2bf90c['query'][_0x4037('0x58')]){_0x2f2e08[_0x4037('0x56')]=_[_0x4037('0x61')](_0x2f2e08[_0x4037('0x56')],{'$or':_[_0x4037('0x59')](_0x2f2e08[_0x4037('0x4f')],function(_0x2def2e){var _0x2cbb6a={};_0x2cbb6a[_0x2def2e]={'$like':'%'+_0x2bf90c[_0x4037('0x4b')][_0x4037('0x58')]+'%'};return _0x2cbb6a;})});}_0x2f2e08=_[_0x4037('0x61')]({},_0x2f2e08,_0x2bf90c[_0x4037('0x62')]);return _0x389943['getOpenchannelInteractions'](_0x2f2e08);}})[_0x4037('0x37')](function(_0x18aa02){if(_0x18aa02){_0x4440db=_0x18aa02[_0x4037('0x51')];if(!_0x2bf90c['query'][_0x4037('0x52')](_0x4037('0x53'))){_0x2f2e08['limit']=qs[_0x4037('0x30')](_0x2bf90c[_0x4037('0x4b')][_0x4037('0x30')]);_0x2f2e08[_0x4037('0x2f')]=qs[_0x4037('0x2f')](_0x2bf90c[_0x4037('0x4b')][_0x4037('0x2f')]);}return _0x389943[_0x4037('0xd4')](_0x2f2e08);}})['then'](function(_0x340cf9){if(_0x340cf9){return _0x340cf9?{'count':_0x4440db,'rows':_0x340cf9}:null;}})['then'](respondWithResult(_0x5a1de7,null))['catch'](handleError(_0x5a1de7,null));};exports['getMailInteractions']=function(_0x3b4c5c,_0x2a60cf,_0x2d3482){var _0x3d77ae={'raw':!![],'where':{}};var _0x203e01={};var _0x50096a={'count':0x0,'rows':[]};return db[_0x4037('0x48')]['findOne']({'where':{'id':_0x3b4c5c['params']['id']}})[_0x4037('0x37')](handleEntityNotFound(_0x2a60cf,null))[_0x4037('0x37')](function(_0xb9d060){if(_0xb9d060){_0x203e01[_0x4037('0x49')]=_[_0x4037('0x4c')](db[_0x4037('0xd6')][_0x4037('0xc2')]);_0x203e01['query']=_[_0x4037('0x4c')](_0x3b4c5c[_0x4037('0x4b')]);_0x203e01[_0x4037('0x4d')]=_['intersection'](_0x203e01[_0x4037('0x49')],_0x203e01[_0x4037('0x4b')]);_0x3d77ae['attributes']=_[_0x4037('0x4e')](_0x203e01[_0x4037('0x49')],qs['fields'](_0x3b4c5c[_0x4037('0x4b')][_0x4037('0x50')]));_0x3d77ae[_0x4037('0x4f')]=_0x3d77ae['attributes'][_0x4037('0x51')]?_0x3d77ae[_0x4037('0x4f')]:_0x203e01[_0x4037('0x49')];if(!_0x3b4c5c[_0x4037('0x4b')][_0x4037('0x52')](_0x4037('0x53'))){_0x3d77ae[_0x4037('0x30')]=qs[_0x4037('0x30')](_0x3b4c5c[_0x4037('0x4b')]['limit']);_0x3d77ae['offset']=qs[_0x4037('0x2f')](_0x3b4c5c[_0x4037('0x4b')][_0x4037('0x2f')]);}_0x3d77ae[_0x4037('0x54')]=qs[_0x4037('0x55')](_0x3b4c5c[_0x4037('0x4b')][_0x4037('0x55')]);_0x3d77ae[_0x4037('0x56')]=qs[_0x4037('0x4d')](_['pick'](_0x3b4c5c[_0x4037('0x4b')],_0x203e01[_0x4037('0x4d')]));_0x3d77ae[_0x4037('0x56')]['UserId']=_0xb9d060['id'];if(_0x3b4c5c[_0x4037('0x4b')][_0x4037('0x58')]){_0x3d77ae[_0x4037('0x56')]=_[_0x4037('0x61')](_0x3d77ae[_0x4037('0x56')],{'$or':_[_0x4037('0x59')](_0x3d77ae['attributes'],function(_0x4415a5){var _0x16fe5d={};_0x16fe5d[_0x4415a5]={'$like':'%'+_0x3b4c5c[_0x4037('0x4b')][_0x4037('0x58')]+'%'};return _0x16fe5d;})});}_0x3d77ae=_[_0x4037('0x61')]({},_0x3d77ae,_0x3b4c5c[_0x4037('0x62')]);return db[_0x4037('0xd6')][_0x4037('0x2e')]({'where':_0x3d77ae[_0x4037('0x56')]})[_0x4037('0x37')](function(_0xbbf4a0){_0x50096a[_0x4037('0x2e')]=_0xbbf4a0;if(_0x3b4c5c['query'][_0x4037('0x63')]){_0x3d77ae[_0x4037('0x64')]=[{'all':!![]}];}return db[_0x4037('0xd6')][_0x4037('0x65')](_0x3d77ae);})[_0x4037('0x37')](function(_0x5d25aa){_0x50096a[_0x4037('0x66')]=_0x5d25aa;return _0x50096a;});}})[_0x4037('0x37')](respondWithFilteredResult(_0x2a60cf,_0x3d77ae))[_0x4037('0x29')](handleError(_0x2a60cf,null));};exports[_0x4037('0xd7')]=function(_0x24e2d4,_0x291385,_0x1df5f4){var _0x5c70f8={};var _0x2df41f={};var _0xadd6e4;var _0x49f3b4;return db['User'][_0x4037('0x9d')]({'where':{'id':_0x24e2d4[_0x4037('0x67')]['id']}})[_0x4037('0x37')](handleEntityNotFound(_0x291385,null))[_0x4037('0x37')](function(_0x3fc5e4){if(_0x3fc5e4){_0xadd6e4=_0x3fc5e4;_0x2df41f[_0x4037('0x49')]=_[_0x4037('0x4c')](db['SmsInteraction'][_0x4037('0xc2')]);_0x2df41f['query']=_[_0x4037('0x4c')](_0x24e2d4[_0x4037('0x4b')]);_0x2df41f[_0x4037('0x4d')]=_[_0x4037('0x4e')](_0x2df41f[_0x4037('0x49')],_0x2df41f[_0x4037('0x4b')]);_0x5c70f8[_0x4037('0x4f')]=_['intersection'](_0x2df41f['model'],qs['fields'](_0x24e2d4[_0x4037('0x4b')][_0x4037('0x50')]));_0x5c70f8[_0x4037('0x4f')]=_0x5c70f8[_0x4037('0x4f')][_0x4037('0x51')]?_0x5c70f8[_0x4037('0x4f')]:_0x2df41f[_0x4037('0x49')];_0x5c70f8[_0x4037('0x54')]=qs['sort'](_0x24e2d4[_0x4037('0x4b')][_0x4037('0x55')]);_0x5c70f8['where']=qs[_0x4037('0x4d')](_[_0x4037('0x57')](_0x24e2d4[_0x4037('0x4b')],_0x2df41f['filters']));if(_0x24e2d4['query'][_0x4037('0x58')]){_0x5c70f8[_0x4037('0x56')]=_['merge'](_0x5c70f8[_0x4037('0x56')],{'$or':_[_0x4037('0x59')](_0x5c70f8['attributes'],function(_0x50b50c){var _0x380453={};_0x380453[_0x50b50c]={'$like':'%'+_0x24e2d4[_0x4037('0x4b')][_0x4037('0x58')]+'%'};return _0x380453;})});}_0x5c70f8=_[_0x4037('0x61')]({},_0x5c70f8,_0x24e2d4[_0x4037('0x62')]);return _0xadd6e4['getSmsInteractions'](_0x5c70f8);}})[_0x4037('0x37')](function(_0x2010eb){if(_0x2010eb){_0x49f3b4=_0x2010eb[_0x4037('0x51')];if(!_0x24e2d4[_0x4037('0x4b')][_0x4037('0x52')](_0x4037('0x53'))){_0x5c70f8[_0x4037('0x30')]=qs[_0x4037('0x30')](_0x24e2d4[_0x4037('0x4b')][_0x4037('0x30')]);_0x5c70f8['offset']=qs['offset'](_0x24e2d4[_0x4037('0x4b')]['offset']);}return _0xadd6e4['getSmsInteractions'](_0x5c70f8);}})[_0x4037('0x37')](function(_0x4dd738){if(_0x4dd738){return _0x4dd738?{'count':_0x49f3b4,'rows':_0x4dd738}:null;}})[_0x4037('0x37')](respondWithResult(_0x291385,null))[_0x4037('0x29')](handleError(_0x291385,null));};exports[_0x4037('0xd8')]=function(_0x3780f4,_0xb38e6e,_0x179670){var _0x42fdab={};var _0x877627={};var _0x36249b;var _0x2c4f89;return db['User'][_0x4037('0x9d')]({'where':{'id':_0x3780f4[_0x4037('0x67')]['id']}})[_0x4037('0x37')](handleEntityNotFound(_0xb38e6e,null))[_0x4037('0x37')](function(_0xff52ca){if(_0xff52ca){_0x36249b=_0xff52ca;_0x877627[_0x4037('0x49')]=_[_0x4037('0x4c')](db['FaxInteraction'][_0x4037('0xc2')]);_0x877627[_0x4037('0x4b')]=_[_0x4037('0x4c')](_0x3780f4[_0x4037('0x4b')]);_0x877627[_0x4037('0x4d')]=_[_0x4037('0x4e')](_0x877627['model'],_0x877627[_0x4037('0x4b')]);_0x42fdab[_0x4037('0x4f')]=_[_0x4037('0x4e')](_0x877627[_0x4037('0x49')],qs['fields'](_0x3780f4[_0x4037('0x4b')][_0x4037('0x50')]));_0x42fdab[_0x4037('0x4f')]=_0x42fdab[_0x4037('0x4f')][_0x4037('0x51')]?_0x42fdab['attributes']:_0x877627[_0x4037('0x49')];_0x42fdab[_0x4037('0x54')]=qs['sort'](_0x3780f4['query'][_0x4037('0x55')]);_0x42fdab[_0x4037('0x56')]=qs['filters'](_[_0x4037('0x57')](_0x3780f4[_0x4037('0x4b')],_0x877627[_0x4037('0x4d')]));if(_0x3780f4[_0x4037('0x4b')][_0x4037('0x58')]){_0x42fdab[_0x4037('0x56')]=_[_0x4037('0x61')](_0x42fdab[_0x4037('0x56')],{'$or':_['map'](_0x42fdab[_0x4037('0x4f')],function(_0x263f71){var _0x409395={};_0x409395[_0x263f71]={'$like':'%'+_0x3780f4[_0x4037('0x4b')]['filter']+'%'};return _0x409395;})});}_0x42fdab=_[_0x4037('0x61')]({},_0x42fdab,_0x3780f4['options']);return _0x36249b[_0x4037('0xd8')](_0x42fdab);}})['then'](function(_0x182556){if(_0x182556){_0x2c4f89=_0x182556[_0x4037('0x51')];if(!_0x3780f4['query'][_0x4037('0x52')](_0x4037('0x53'))){_0x42fdab[_0x4037('0x30')]=qs[_0x4037('0x30')](_0x3780f4['query'][_0x4037('0x30')]);_0x42fdab[_0x4037('0x2f')]=qs[_0x4037('0x2f')](_0x3780f4[_0x4037('0x4b')][_0x4037('0x2f')]);}return _0x36249b['getFaxInteractions'](_0x42fdab);}})[_0x4037('0x37')](function(_0x2e8c47){if(_0x2e8c47){return _0x2e8c47?{'count':_0x2c4f89,'rows':_0x2e8c47}:null;}})[_0x4037('0x37')](respondWithResult(_0xb38e6e,null))[_0x4037('0x29')](handleError(_0xb38e6e,null));};exports[_0x4037('0xd9')]=function(_0x207b2b,_0x513124,_0x28b2c7){var _0x21d0d5;var _0x1651b9;var _0x2c1ef4;var _0x33d08e=!_[_0x4037('0x73')](_0x207b2b['params']['id'])?_0x207b2b[_0x4037('0x67')]['id']:!_[_0x4037('0x73')](_0x207b2b[_0x4037('0x3b')]['id'])?_0x207b2b['user']['id']:null;return db[_0x4037('0x48')]['find']({'where':{'id':_0x33d08e,'role':_0x4037('0x3d')},'attributes':['id',_0x4037('0x44'),_0x4037('0xda'),_0x4037('0xdb'),_0x4037('0x43'),_0x4037('0x78'),_0x4037('0xa1')]})[_0x4037('0x37')](handleEntityNotFound(_0x513124,null))[_0x4037('0x37')](function(_0x13a789){if(_0x13a789){_0x21d0d5=_0x13a789;if(_0x207b2b[_0x4037('0x6c')]['interface']){_0x2c1ef4=util[_0x4037('0x75')]('LOCAL/%s@from-sip/n',_0x21d0d5[_0x207b2b['body'][_0x4037('0xa3')]]);}else if(_0x207b2b[_0x4037('0x6c')][_0x4037('0xdc')]){_0x2c1ef4=util[_0x4037('0x75')](_0x4037('0xb0'),_0x207b2b[_0x4037('0x6c')][_0x4037('0xdc')]);}else{_0x2c1ef4=util[_0x4037('0x75')]('SIP/%s',_0x21d0d5['name']);}socket['to'](util[_0x4037('0x75')]('user:%s',_0x21d0d5[_0x4037('0x44')]))[_0x4037('0xab')](_0x4037('0xdd'),{'ip':_0x207b2b['headers'][_0x4037('0xde')]||_0x207b2b['connection'][_0x4037('0xdf')]||_0x207b2b[_0x4037('0xe0')][_0x4037('0xdf')]||_0x207b2b[_0x4037('0xe1')][_0x4037('0xe0')][_0x4037('0xdf')]});return db[_0x4037('0xb1')][_0x4037('0x38')]({'where':{'membername':_0x21d0d5[_0x4037('0x44')]},'individualHooks':!![]});}})['then'](function(_0x305ae4){if(_0x21d0d5){return _0x21d0d5[_0x4037('0xe2')]({'raw':!![]});}})[_0x4037('0x37')](function(_0x1c69dc){var _0x27993f=[];if(_0x1c69dc){_0x1651b9=_0x1c69dc;if(_0x1651b9[_0x4037('0x51')]){for(var _0x2d5db8=0x0;_0x2d5db8<_0x1651b9['length'];_0x2d5db8++){_0x27993f[_0x4037('0xaf')]({'membername':_0x21d0d5['name'],'UserId':_0x21d0d5['id'],'queue_name':_0x1651b9[_0x2d5db8][_0x4037('0x44')],'VoiceQueueId':_0x1651b9[_0x2d5db8]['id'],'interface':_0x2c1ef4,'paused':_0x21d0d5[_0x4037('0xa1')]||![],'penalty':_0x1651b9[_0x2d5db8][_0x4037('0xe3')]||0x0});}return BPromise[_0x4037('0xe4')](_0x27993f,function(_0x436840){return db[_0x4037('0xb1')][_0x4037('0xb2')](_0x436840);});}}})[_0x4037('0x37')](function(){return db[_0x4037('0xe5')][_0x4037('0x65')]({'where':{'membername':_0x21d0d5['name'],'exitAt':null}});})['then'](function(_0x18f66c){var _0x21df0b=[];_0x18f66c[_0x4037('0xe6')](function(_0x4e00d2){_0x21df0b[_0x4037('0xaf')](_0x4e00d2[_0x4037('0x36')]({'exitAt':moment()[_0x4037('0x75')](_0x4037('0xe7'))}));});return BPromise[_0x4037('0xe8')](_0x21df0b);})[_0x4037('0x37')](function(){var _0x7b8c0b=[];var _0x5be119=[];var _0x22f735=utils[_0x4037('0xe9')]();var _0x55bc8c={'membername':_0x21d0d5[_0x4037('0x44')],'interface':_0x2c1ef4,'enterAt':moment()['format'](_0x4037('0xe7')),'role':_0x21d0d5['role'],'internal':_0x21d0d5[_0x4037('0x78')]};_0x22f735[_0x4037('0xe6')](function(_0xcfa332){_0x7b8c0b[_0x4037('0xaf')](_['merge']({'channel':_0xcfa332,'type':_0x4037('0xea'),'data1':_0x207b2b[_0x4037('0x6c')][_0x4037('0xeb')],'data2':_0x2c1ef4},_0x55bc8c));if(_0x21d0d5[_0x4037('0xa1')]){_0x5be119[_0x4037('0xaf')](_['merge']({'channel':_0xcfa332,'type':_0x4037('0xec'),'data1':_0x4037('0xed')},_0x55bc8c));}});return db[_0x4037('0xe5')][_0x4037('0x6b')](_0x7b8c0b['concat'](_0x5be119),{'individualHooks':!![]});})[_0x4037('0x37')](function(){return _0x21d0d5[_0x4037('0x36')]({'online':!![],'lastLoginAt':moment()[_0x4037('0x75')](_0x4037('0xe7')),'voicePause':_0x21d0d5[_0x4037('0xa1')]||![],'mailPause':_0x21d0d5[_0x4037('0xa1')]||![],'chatPause':_0x21d0d5[_0x4037('0xa1')]||![],'faxPause':_0x21d0d5[_0x4037('0xa1')]||![],'smsPause':_0x21d0d5['loginInPause']||![],'openchannelPause':_0x21d0d5[_0x4037('0xa1')]||![],'pauseType':_0x21d0d5[_0x4037('0xa1')]?'LOGININPAUSE':null,'interface':_0x2c1ef4,'lastPauseAt':moment()[_0x4037('0x75')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x4037('0x37')](function(_0x2ecc7f){if(_0x207b2b[_0x4037('0xee')]){return _0x28b2c7();}else{return BPromise[_0x4037('0xef')](_0x2ecc7f)['then'](respondWithResult(_0x513124,null));}})[_0x4037('0x29')](handleError(_0x513124,null));};exports[_0x4037('0xf0')]=function(_0x54a72d,_0x15fda1,_0x4bcb62){var _0x49ad9a;return db[_0x4037('0x48')]['find']({'where':{'id':_0x54a72d[_0x4037('0x67')]['id'],'role':'agent'},'attributes':['id','name','role']})[_0x4037('0x37')](handleEntityNotFound(_0x15fda1,null))[_0x4037('0x37')](function(_0x12e154){if(_0x12e154){_0x49ad9a=_0x12e154;return db['UserVoiceQueueRt'][_0x4037('0x38')]({'where':{'membername':_0x49ad9a[_0x4037('0x44')]},'individualHooks':!![]});}})['then'](function(){return db['MemberReport'][_0x4037('0x65')]({'where':{'membername':_0x49ad9a[_0x4037('0x44')],'exitAt':null}});})[_0x4037('0x37')](function(_0x31422f){var _0x2eeb2b=[];_0x31422f[_0x4037('0xe6')](function(_0x49ffb0){_0x2eeb2b['push'](_0x49ffb0[_0x4037('0x36')]({'exitAt':moment()['format'](_0x4037('0xe7'))}));});return BPromise['all'](_0x2eeb2b);})['then'](function(){return _0x49ad9a[_0x4037('0x36')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})['then'](respondWithResult(_0x15fda1,null))[_0x4037('0x29')](handleError(_0x15fda1,null));};exports[_0x4037('0xf1')]=function(_0x32e226,_0x45cf64,_0x132b1b){var _0x5cac49;return db[_0x4037('0xb1')]['update']({'paused':0x1},{'where':{'UserId':_0x32e226[_0x4037('0x67')]['id']},'individualHooks':!![]})[_0x4037('0x37')](function(){return db['User'][_0x4037('0x6a')]({'where':{'id':_0x32e226[_0x4037('0x67')]['id'],'role':_0x4037('0x3d')},'attributes':['id','name',_0x4037('0x43'),_0x4037('0x78'),_0x4037('0xa3')]});})[_0x4037('0x37')](handleEntityNotFound(_0x45cf64,null))[_0x4037('0x37')](function(_0x581e93){if(_0x581e93){_0x5cac49=_0x581e93;return respondWithRpcPromise('QueuePause',_0x4037('0xf1'),{'id':_0x5cac49['id'],'name':_0x5cac49[_0x4037('0x44')],'pause':!![]});}})[_0x4037('0x37')](function(){if(_0x5cac49){return db[_0x4037('0xe5')]['findAll']({'where':{'membername':_0x5cac49['name'],'type':_0x4037('0xec'),'exitAt':null}});}})[_0x4037('0x37')](function(_0x5676e5){if(_0x5676e5[_0x4037('0x51')]){var _0x591a1c=moment()['format'](_0x4037('0xe7'));for(var _0x527e85=0x0,_0x3baf2d=_0x5676e5[_0x4037('0x51')];_0x527e85<_0x3baf2d;_0x527e85++){_0x5676e5[_0x527e85]['updateAttributes']({'exitAt':_0x591a1c});}}})[_0x4037('0x37')](function(){var _0x104a04=[];var _0xee4af2=utils[_0x4037('0xe9')]();_0xee4af2['forEach'](function(_0x282ca1){_0x104a04[_0x4037('0xaf')]({'channel':_0x282ca1,'membername':_0x5cac49['name'],'interface':_[_0x4037('0x73')](_0x5cac49[_0x4037('0xa3')])?util[_0x4037('0x75')](_0x4037('0xb0'),_0x5cac49[_0x4037('0x44')]):_0x5cac49['interface'],'type':_0x4037('0xec'),'enterAt':moment()['format'](_0x4037('0xe7')),'data1':_0x32e226[_0x4037('0x6c')][_0x4037('0x5a')]||_0x4037('0xf2'),'role':_0x5cac49[_0x4037('0x43')],'internal':_0x5cac49[_0x4037('0x78')]});});return db[_0x4037('0xe5')][_0x4037('0x6b')](_0x104a04,{'individualHooks':!![]});})['then'](function(){return _0x5cac49[_0x4037('0x36')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x32e226[_0x4037('0x6c')]['type']||_0x4037('0xf2'),'lastPauseAt':moment()[_0x4037('0x75')](_0x4037('0xe7'))});})[_0x4037('0x37')](respondWithResult(_0x45cf64,null))[_0x4037('0x29')](handleError(_0x45cf64,null));};exports[_0x4037('0xf3')]=function(_0x1c7645,_0x5c405a,_0x43d35e){var _0x4d5869;return db[_0x4037('0x48')]['find']({'where':{'id':_0x1c7645['params']['id']},'attributes':['id','name',_0x4037('0x43'),_0x4037('0xa2'),_0x4037('0xf4'),_0x4037('0xf5'),_0x4037('0xf6'),_0x4037('0xf7'),_0x4037('0xf8'),_0x4037('0xf9'),'lastPauseAt']})[_0x4037('0x37')](handleEntityNotFound(_0x5c405a,null))[_0x4037('0x37')](function(_0x5b60c5){if(_0x5b60c5){_0x4d5869=_0x5b60c5;if(_0x1c7645[_0x4037('0x6c')]['channel']&&!utils['isValidChannel'](_0x1c7645['body'][_0x4037('0x9f')])){throw new db['Sequelize'][(_0x4037('0x97'))](_0x4037('0xa4'));}switch(_0x1c7645['body'][_0x4037('0x9f')]){case _0x4037('0xad'):return respondWithRpcPromise(_0x4037('0xfa'),'unpause',{'id':_0x4d5869['id'],'name':_0x4d5869[_0x4037('0x44')],'pause':![]})[_0x4037('0x37')](function(){return db[_0x4037('0xb1')][_0x4037('0x36')]({'paused':0x0},{'where':{'UserId':_0x4d5869['id']},'individualHooks':!![]});})['then'](function(){return db[_0x4037('0xe5')][_0x4037('0x6a')]({'where':{'channel':_0x1c7645[_0x4037('0x6c')]['channel'],'membername':_0x4d5869[_0x4037('0x44')],'type':_0x4037('0xec'),'exitAt':null}});})[_0x4037('0x37')](function(_0x25d808){if(_0x25d808){return _0x25d808[_0x4037('0x36')]({'exitAt':moment()[_0x4037('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x4037('0xfb')},{'individualHooks':!![]});}return null;})[_0x4037('0x37')](function(){return _0x4d5869[_0x4037('0x36')]({'voicePause':![]});});case _0x4037('0xfc'):case _0x4037('0xfd'):case _0x4037('0xfe'):case'sms':case _0x4037('0xff'):return db[_0x4037('0xe5')][_0x4037('0x6a')]({'where':{'channel':_0x1c7645[_0x4037('0x6c')][_0x4037('0x9f')],'membername':_0x4d5869[_0x4037('0x44')],'type':_0x4037('0xec'),'exitAt':null}})['then'](function(_0x1be499){if(_0x1be499){return _0x1be499[_0x4037('0x36')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x4037('0xfb')},{'individualHooks':!![]});}return null;})[_0x4037('0x37')](function(){var _0x2f39fd={};_['set'](_0x2f39fd,util[_0x4037('0x75')](_0x4037('0x100'),_0x1c7645[_0x4037('0x6c')][_0x4037('0x9f')],'Pause'),![]);return _0x4d5869['update'](_0x2f39fd);});default:return respondWithRpcPromise(_0x4037('0xfa'),'unpause',{'id':_0x4d5869['id'],'name':_0x4d5869[_0x4037('0x44')],'pause':![]})[_0x4037('0x37')](function(){return db['UserVoiceQueueRt'][_0x4037('0x36')]({'paused':0x0},{'where':{'UserId':_0x4d5869['id']}});})['then'](function(){return db[_0x4037('0xe5')]['findAll']({'where':{'membername':_0x4d5869['name'],'type':'PAUSE','exitAt':null}});})['then'](function(_0x17a8cc){var _0x3325a4=[];_0x17a8cc[_0x4037('0xe6')](function(_0x3b3fe7){_0x3325a4['push'](_0x3b3fe7['update']({'exitAt':moment()[_0x4037('0x75')](_0x4037('0xe7')),'data2':_0x4037('0xfb')}));});return BPromise[_0x4037('0xe8')](_0x3325a4);})[_0x4037('0x37')](function(){return _0x4d5869[_0x4037('0x36')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x4037('0x37')](respondWithResult(_0x5c405a,null))[_0x4037('0x29')](handleError(_0x5c405a,null));};exports['getTeams']=function(_0x369a8f,_0x1eba73,_0x5b0d93){var _0x109c06={};var _0x322b1b={};var _0x4fdd8e;var _0x5be707;return db[_0x4037('0x48')][_0x4037('0x9d')]({'where':{'id':_0x369a8f[_0x4037('0x67')]['id']}})[_0x4037('0x37')](handleEntityNotFound(_0x1eba73,null))['then'](function(_0x24136c){if(_0x24136c){_0x4fdd8e=_0x24136c;_0x322b1b[_0x4037('0x49')]=_['keys'](db[_0x4037('0x101')][_0x4037('0xc2')]);_0x322b1b[_0x4037('0x4b')]=_[_0x4037('0x4c')](_0x369a8f[_0x4037('0x4b')]);_0x322b1b[_0x4037('0x4d')]=_['intersection'](_0x322b1b[_0x4037('0x49')],_0x322b1b[_0x4037('0x4b')]);_0x109c06[_0x4037('0x4f')]=_[_0x4037('0x4e')](_0x322b1b[_0x4037('0x49')],qs[_0x4037('0x50')](_0x369a8f[_0x4037('0x4b')]['fields']));_0x109c06[_0x4037('0x4f')]=_0x109c06[_0x4037('0x4f')][_0x4037('0x51')]?_0x109c06[_0x4037('0x4f')]:_0x322b1b[_0x4037('0x49')];_0x109c06['order']=qs[_0x4037('0x55')](_0x369a8f[_0x4037('0x4b')]['sort']);_0x109c06['where']=qs[_0x4037('0x4d')](_[_0x4037('0x57')](_0x369a8f[_0x4037('0x4b')],_0x322b1b[_0x4037('0x4d')]));if(_0x369a8f[_0x4037('0x4b')][_0x4037('0x58')]){_0x109c06[_0x4037('0x56')]=_[_0x4037('0x61')](_0x109c06[_0x4037('0x56')],{'$or':_[_0x4037('0x59')](_0x109c06[_0x4037('0x4f')],function(_0x20a861){var _0x51c52e={};_0x51c52e[_0x20a861]={'$like':'%'+_0x369a8f[_0x4037('0x4b')][_0x4037('0x58')]+'%'};return _0x51c52e;})});}_0x109c06=_[_0x4037('0x61')]({},_0x109c06,_0x369a8f['options']);return _0x4fdd8e[_0x4037('0x102')](_0x109c06);}})[_0x4037('0x37')](function(_0x37db9a){if(_0x37db9a){_0x5be707=_0x37db9a['length'];if(!_0x369a8f[_0x4037('0x4b')][_0x4037('0x52')](_0x4037('0x53'))){_0x109c06[_0x4037('0x30')]=qs[_0x4037('0x30')](_0x369a8f['query'][_0x4037('0x30')]);_0x109c06['offset']=qs[_0x4037('0x2f')](_0x369a8f['query'][_0x4037('0x2f')]);}return _0x4fdd8e[_0x4037('0x102')](_0x109c06);}})[_0x4037('0x37')](function(_0x5c50de){if(_0x5c50de){return _0x5c50de?{'count':_0x5be707,'rows':_0x5c50de}:null;}})['then'](respondWithResult(_0x1eba73,null))[_0x4037('0x29')](handleError(_0x1eba73,null));};exports['addTeams']=function(_0xab90f,_0x903ae9,_0x548bf3){return db[_0x4037('0x48')][_0x4037('0x6a')]({'where':{'id':_0xab90f['params']['id']}})[_0x4037('0x37')](handleEntityNotFound(_0x903ae9,null))[_0x4037('0x37')](function(_0x49c2fa){if(_0x49c2fa){return _0x49c2fa[_0x4037('0x103')](_0xab90f[_0x4037('0x6c')]['ids'],_[_0x4037('0x104')](_0xab90f[_0x4037('0x6c')],[_0x4037('0x6f'),'id'])||{});}})[_0x4037('0x37')](respondWithResult(_0x903ae9,null))[_0x4037('0x29')](handleError(_0x903ae9,null));};exports['removeTeams']=function(_0x1a96f4,_0x59f4c6,_0x4670d2){return db[_0x4037('0x48')]['find']({'where':{'id':_0x1a96f4[_0x4037('0x67')]['id']}})[_0x4037('0x37')](handleEntityNotFound(_0x59f4c6,null))[_0x4037('0x37')](function(_0x3f916c){if(_0x3f916c){return _0x3f916c[_0x4037('0x105')](_0x1a96f4[_0x4037('0x4b')][_0x4037('0x6f')]);}})[_0x4037('0x37')](respondWithStatusCode(_0x59f4c6,null))[_0x4037('0x29')](handleError(_0x59f4c6,null));};exports[_0x4037('0x106')]=function(_0x557da4,_0x1f6ebe,_0x211783){var _0x4c24d0={};var _0x83309f={};var _0x643d51;var _0xb57866;return db['User'][_0x4037('0x9d')]({'where':{'id':_0x557da4[_0x4037('0x67')]['id']}})[_0x4037('0x37')](handleEntityNotFound(_0x1f6ebe,null))[_0x4037('0x37')](function(_0x207771){if(_0x207771){_0x643d51=_0x207771;_0x83309f[_0x4037('0x49')]=_['keys'](db[_0x4037('0xc3')][_0x4037('0xc2')]);_0x83309f[_0x4037('0x4b')]=_[_0x4037('0x4c')](_0x557da4[_0x4037('0x4b')]);_0x83309f[_0x4037('0x4d')]=_[_0x4037('0x4e')](_0x83309f[_0x4037('0x49')],_0x83309f[_0x4037('0x4b')]);_0x4c24d0[_0x4037('0x4f')]=_['intersection'](_0x83309f['model'],qs['fields'](_0x557da4[_0x4037('0x4b')][_0x4037('0x50')]));_0x4c24d0[_0x4037('0x4f')]=_0x4c24d0[_0x4037('0x4f')][_0x4037('0x51')]?_0x4c24d0[_0x4037('0x4f')]:_0x83309f[_0x4037('0x49')];_0x4c24d0['order']=qs['sort'](_0x557da4[_0x4037('0x4b')]['sort']);_0x4c24d0[_0x4037('0x56')]=qs['filters'](_[_0x4037('0x57')](_0x557da4[_0x4037('0x4b')],_0x83309f[_0x4037('0x4d')]));if(_0x557da4[_0x4037('0x4b')][_0x4037('0x58')]){_0x4c24d0[_0x4037('0x56')]=_[_0x4037('0x61')](_0x4c24d0[_0x4037('0x56')],{'$or':_[_0x4037('0x59')](_0x4c24d0[_0x4037('0x4f')],function(_0x27e846){var _0x4b2c56={};_0x4b2c56[_0x27e846]={'$like':'%'+_0x557da4[_0x4037('0x4b')]['filter']+'%'};return _0x4b2c56;})});}_0x4c24d0=_[_0x4037('0x61')]({},_0x4c24d0,_0x557da4[_0x4037('0x62')]);return _0x643d51['getLists'](_0x4c24d0);}})[_0x4037('0x37')](function(_0xf1ce03){if(_0xf1ce03){_0xb57866=_0xf1ce03[_0x4037('0x51')];if(!_0x557da4['query'][_0x4037('0x52')](_0x4037('0x53'))){_0x4c24d0[_0x4037('0x30')]=qs[_0x4037('0x30')](_0x557da4[_0x4037('0x4b')][_0x4037('0x30')]);_0x4c24d0[_0x4037('0x2f')]=qs['offset'](_0x557da4['query'][_0x4037('0x2f')]);}return _0x643d51['getLists'](_0x4c24d0);}})[_0x4037('0x37')](function(_0x54e651){if(_0x54e651){return _0x54e651?{'count':_0xb57866,'rows':_0x54e651}:null;}})[_0x4037('0x37')](respondWithResult(_0x1f6ebe,null))[_0x4037('0x29')](handleError(_0x1f6ebe,null));};exports[_0x4037('0x107')]=function(_0x112fcd,_0x11dc88,_0x500172){var _0x274845={};var _0x1b2d2d={};var _0x5468d4;var _0x364a5f;return db[_0x4037('0x48')][_0x4037('0x9d')]({'where':{'id':_0x112fcd['params']['id']}})['then'](handleEntityNotFound(_0x11dc88,null))[_0x4037('0x37')](function(_0x22fe6d){if(_0x22fe6d){_0x5468d4=_0x22fe6d;_0x1b2d2d[_0x4037('0x49')]=_[_0x4037('0x4c')](db['User'][_0x4037('0xc2')]);_0x1b2d2d[_0x4037('0x4b')]=_['keys'](_0x112fcd[_0x4037('0x4b')]);_0x1b2d2d[_0x4037('0x4d')]=_['intersection'](_0x1b2d2d[_0x4037('0x49')],_0x1b2d2d[_0x4037('0x4b')]);_0x274845[_0x4037('0x4f')]=_['intersection'](_0x1b2d2d[_0x4037('0x49')],qs[_0x4037('0x50')](_0x112fcd[_0x4037('0x4b')][_0x4037('0x50')]));_0x274845[_0x4037('0x4f')]=_0x274845[_0x4037('0x4f')][_0x4037('0x51')]?_0x274845[_0x4037('0x4f')]:_0x1b2d2d['model'];_0x274845[_0x4037('0x54')]=qs[_0x4037('0x55')](_0x112fcd[_0x4037('0x4b')][_0x4037('0x55')]);_0x274845['where']=qs[_0x4037('0x4d')](_[_0x4037('0x57')](_0x112fcd[_0x4037('0x4b')],_0x1b2d2d[_0x4037('0x4d')]));if(_0x112fcd['query'][_0x4037('0x58')]){_0x274845[_0x4037('0x56')]=_[_0x4037('0x61')](_0x274845[_0x4037('0x56')],{'$or':_['map'](_0x274845[_0x4037('0x4f')],function(_0x599f81){var _0x31a5c0={};_0x31a5c0[_0x599f81]={'$like':'%'+_0x112fcd[_0x4037('0x4b')][_0x4037('0x58')]+'%'};return _0x31a5c0;})});}_0x274845[_0x4037('0x49')]=db['User'];_0x274845['as']=_0x4037('0x3c');_0x274845=_['merge']({},_0x274845,_0x112fcd[_0x4037('0x62')]);return _0x5468d4[_0x4037('0xe2')]({'include':[_0x274845]});}})['then'](function(_0x149565){if(_0x149565){var _0x150bd7={},_0x484030=[],_0x3dfd55=0x0;for(var _0x2295d6=0x0;_0x2295d6<_0x149565[_0x4037('0x51')];_0x2295d6+=0x1){for(var _0xf777ee=0x0,_0x2a7b84;_0xf777ee<_0x149565[_0x2295d6][_0x4037('0x3c')][_0x4037('0x51')];_0xf777ee+=0x1){_0x2a7b84=_0x149565[_0x2295d6][_0x4037('0x3c')][_0xf777ee][_0x4037('0x39')]({'plain':!![]});_0x150bd7[_0x2a7b84['id']]=_0x2a7b84;}}_0x150bd7=_['values'](_0x150bd7);for(var _0x500b78=qs[_0x4037('0x2f')](_0x112fcd[_0x4037('0x4b')][_0x4037('0x2f')]);_0x500b78<_0x150bd7[_0x4037('0x51')]&&_0x484030[_0x4037('0x51')]=_0x225c6c){_0x131da7=_0x225c6c;_0x884216=0xc8;}else{_0x884216=0xce;}_0xc5f5b[_0x3b70('0x2b')](_0x884216);return _0xc5f5b['set'](_0x3b70('0x30'),_0x591756+'-'+_0x131da7+'/'+_0x225c6c)[_0x3b70('0x2d')](_0x2eb447);}return null;};}function patchUpdates(_0x101b12){return function(_0x4187d2){try{jsonpatch['apply'](_0x4187d2,_0x101b12,!![]);}catch(_0xe11225){return BPromise[_0x3b70('0x31')](_0xe11225);}return _0x4187d2[_0x3b70('0x32')]();};}function saveUpdates(_0x2fbff0,_0x5152c2){return function(_0xf16473){if(_0xf16473){return _0xf16473[_0x3b70('0x33')](_0x2fbff0)[_0x3b70('0x34')](function(_0xb8ce58){return _0xb8ce58;});}return null;};}function removeEntity(_0x153c9a,_0x3b6dad){return function(_0x36af13){if(_0x36af13){return _0x36af13['destroy']()[_0x3b70('0x34')](function(){var _0x2954f0=_0x36af13[_0x3b70('0x35')]({'plain':!![]});var _0x21bfaf=[{'name':_0x3b70('0x36'),'value':_0x3b70('0x37'),'ignore':!![]},{'name':_0x3b70('0x38'),'value':_0x3b70('0x39'),'ignore':![]},{'name':_0x3b70('0x3a'),'value':_0x3b70('0x3b'),'ignore':![]}];var _0x5723a5=_(_0x21bfaf)[_0x3b70('0x3c')](_0x3b70('0x3d'))[_0x3b70('0x3e')](_0x3b70('0x3f'))[_0x3b70('0x3f')]();if(_[_0x3b70('0x40')](_0x5723a5,_0x2954f0[_0x3b70('0x41')])){return;}var _0x5e7643=_[_0x3b70('0x42')](_0x21bfaf,[_0x3b70('0x3f'),_0x2954f0[_0x3b70('0x41')]])['name'];return db[_0x3b70('0x43')][_0x3b70('0x44')]({'where':{'type':_0x5e7643,'resourceId':_0x2954f0['id']}})[_0x3b70('0x34')](function(){return _0x36af13;});})[_0x3b70('0x34')](function(){_0x153c9a[_0x3b70('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b04ee,_0x92fcc8){return function(_0x2f39f4){if(!_0x2f39f4){_0x3b04ee[_0x3b70('0x2a')](0x194);}return _0x2f39f4;};}function handleError(_0x2213ba,_0x5c9358){_0x5c9358=_0x5c9358||0x1f4;return function(_0x483555){logger[_0x3b70('0x27')](_0x483555[_0x3b70('0x45')]);if(_0x483555[_0x3b70('0x46')]){delete _0x483555[_0x3b70('0x46')];}_0x2213ba[_0x3b70('0x2b')](_0x5c9358)[_0x3b70('0x47')](_0x483555);};}exports[_0x3b70('0x48')]=function(_0x2b8a3f,_0x5e234c){var _0x4322b1={},_0x1a51bd={},_0x843ba0={'count':0x0,'rows':[]};var _0xc7566d=db[_0x3b70('0x49')][_0x3b70('0x4a')];_0x1a51bd[_0x3b70('0x4b')]=_['differenceBy'](_[_0x3b70('0x4c')](_0xc7566d),[_0x3b70('0x4d'),_0x3b70('0x4e')]);_0x1a51bd['query']=_[_0x3b70('0x4c')](_0x2b8a3f[_0x3b70('0x4f')]);_0x1a51bd[_0x3b70('0x50')]=_[_0x3b70('0x51')](_0x1a51bd['model'],_0x1a51bd[_0x3b70('0x4f')]);_0x4322b1[_0x3b70('0x52')]=_[_0x3b70('0x51')](_0x1a51bd[_0x3b70('0x4b')],qs[_0x3b70('0x53')](_0x2b8a3f[_0x3b70('0x4f')][_0x3b70('0x53')]));_0x4322b1['attributes']=_0x4322b1[_0x3b70('0x52')][_0x3b70('0x54')]?_0x4322b1['attributes']:_0x1a51bd[_0x3b70('0x4b')];if(!_0x2b8a3f[_0x3b70('0x4f')][_0x3b70('0x55')](_0x3b70('0x56'))){_0x4322b1[_0x3b70('0x57')]=qs[_0x3b70('0x57')](_0x2b8a3f[_0x3b70('0x4f')]['limit']);_0x4322b1[_0x3b70('0x2f')]=qs['offset'](_0x2b8a3f['query']['offset']);}_0x4322b1[_0x3b70('0x58')]=qs[_0x3b70('0x59')](_0x2b8a3f['query'][_0x3b70('0x59')]);_0x4322b1['where']=qs[_0x3b70('0x50')](_[_0x3b70('0x5a')](_0x2b8a3f[_0x3b70('0x4f')],_0x1a51bd['filters']));if(_0x2b8a3f[_0x3b70('0x4f')][_0x3b70('0x3c')]){_0x4322b1['where']=_[_0x3b70('0x5b')](_0x4322b1['where'],{'$or':_[_0x3b70('0x3e')](_0xc7566d,function(_0x204380){if(_0x204380['type']['key']!==_0x3b70('0x5c')){return db[_0x3b70('0x5d')][_0x3b70('0x5e')](db['sequelize']['fn'](_0x3b70('0x5f'),db[_0x3b70('0x5d')][_0x3b70('0x60')](_0x204380[_0x3b70('0x61')])),{'$like':db[_0x3b70('0x5d')]['fn'](_0x3b70('0x5f'),'%'+_0x2b8a3f[_0x3b70('0x4f')][_0x3b70('0x3c')]+'%')});}})});}_0x4322b1=_['merge']({},_0x4322b1,_0x2b8a3f[_0x3b70('0x62')]);var _0x17bba0={'where':_0x4322b1[_0x3b70('0x5e')]};return db[_0x3b70('0x49')]['count'](_0x17bba0)[_0x3b70('0x34')](function(_0x4cdd6e){_0x843ba0[_0x3b70('0x2e')]=_0x4cdd6e;if(_0x2b8a3f['query'][_0x3b70('0x63')]){_0x4322b1[_0x3b70('0x64')]=[{'all':!![]}];}return db[_0x3b70('0x49')][_0x3b70('0x65')](_0x4322b1);})['then'](function(_0x3412c5){_0x843ba0[_0x3b70('0x66')]=_0x3412c5;return _0x843ba0;})[_0x3b70('0x34')](respondWithFilteredResult(_0x5e234c,_0x4322b1))[_0x3b70('0x29')](handleError(_0x5e234c,null));};exports[_0x3b70('0x67')]=function(_0x15b5c4,_0x5cbe6d){var _0x549cd6={'raw':![],'where':{'id':_0x15b5c4['params']['id']}},_0x5497c8={};_0x5497c8[_0x3b70('0x4b')]=_[_0x3b70('0x68')](_[_0x3b70('0x4c')](db[_0x3b70('0x49')][_0x3b70('0x4a')]),[_0x3b70('0x4d'),_0x3b70('0x4e')]);_0x5497c8[_0x3b70('0x4f')]=_[_0x3b70('0x4c')](_0x15b5c4[_0x3b70('0x4f')]);_0x5497c8[_0x3b70('0x50')]=_[_0x3b70('0x51')](_0x5497c8[_0x3b70('0x4b')],_0x5497c8['query']);_0x549cd6[_0x3b70('0x52')]=_['intersection'](_0x5497c8['model'],qs['fields'](_0x15b5c4[_0x3b70('0x4f')]['fields']));_0x549cd6['attributes']=_0x549cd6[_0x3b70('0x52')]['length']?_0x549cd6[_0x3b70('0x52')]:_0x5497c8['model'];if(_0x15b5c4['query'][_0x3b70('0x63')]){_0x549cd6[_0x3b70('0x64')]=[{'all':!![]}];}_0x549cd6=_[_0x3b70('0x5b')]({},_0x549cd6,_0x15b5c4[_0x3b70('0x62')]);return db[_0x3b70('0x49')][_0x3b70('0x42')](_0x549cd6)[_0x3b70('0x34')](handleEntityNotFound(_0x5cbe6d,null))[_0x3b70('0x34')](respondWithResult(_0x5cbe6d,null))[_0x3b70('0x29')](handleError(_0x5cbe6d,null));};exports['bulkCreate']=function(_0x5d31f4,_0x552819){return db[_0x3b70('0x49')][_0x3b70('0x69')](_0x5d31f4['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x552819,0xc9))[_0x3b70('0x29')](handleError(_0x552819,null));};exports['update']=function(_0x462035,_0x58f464){if(_0x462035[_0x3b70('0x6a')]['id']){delete _0x462035[_0x3b70('0x6a')]['id'];}delete _0x462035[_0x3b70('0x6a')][_0x3b70('0x41')];return db[_0x3b70('0x49')]['find']({'where':{'id':_0x462035[_0x3b70('0x6b')]['id']}})[_0x3b70('0x34')](handleEntityNotFound(_0x58f464,null))['then'](saveUpdates(_0x462035['body'],null))['then'](respondWithResult(_0x58f464,null))[_0x3b70('0x29')](handleError(_0x58f464,null));};exports[_0x3b70('0x6c')]=function(_0x5c3d02,_0x15e5bf){return db[_0x3b70('0x49')]['describe']()[_0x3b70('0x34')](respondWithResult(_0x15e5bf,null))[_0x3b70('0x29')](handleError(_0x15e5bf,null));};exports[_0x3b70('0x6d')]=function(_0x1ed165,_0x3eb86c,_0x18b525){return db[_0x3b70('0x49')][_0x3b70('0x42')]({'where':{'id':_0x1ed165[_0x3b70('0x6b')]['id']}})[_0x3b70('0x34')](handleEntityNotFound(_0x3eb86c,null))['then'](function(_0x4ed9c){if(_0x4ed9c){return _0x4ed9c['addContacts'](_0x1ed165[_0x3b70('0x6a')][_0x3b70('0x6e')],_[_0x3b70('0x6f')](_0x1ed165[_0x3b70('0x6a')],[_0x3b70('0x6e'),'id'])||{});}})[_0x3b70('0x34')](respondWithResult(_0x3eb86c,null))['catch'](handleError(_0x3eb86c,null));};var getLicense=function(_0x4b3189){return new BPromise(function(_0x480c17,_0x5091c0){var _0x2513ba=0x0;_0x4b3189['body'][_0x3b70('0x41')]===_0x3b70('0x39')&&_0x480c17(_0x3b70('0x70'));return db[_0x3b70('0x49')][_0x3b70('0x2e')]({'where':{'$or':[{'role':_0x4b3189[_0x3b70('0x6a')][_0x3b70('0x41')]===_0x3b70('0x3b')?_0x3b70('0x3b'):[_0x3b70('0x71'),_0x3b70('0x37')]}]}})['then'](function(_0x37b420){_0x2513ba=_0x37b420;return require(_0x3b70('0x72'))[_0x3b70('0x73')]();})[_0x3b70('0x34')](function(_0x426e57){var _0x5dfb57=_0x4b3189[_0x3b70('0x6a')][_0x3b70('0x41')]===_0x3b70('0x3b')?_0x3b70('0x74'):_0x3b70('0x75');if(!_[_0x3b70('0x76')](_0x426e57[_0x5dfb57])&&_0x2513ba>=_0x426e57[_0x5dfb57]){return _0x5091c0({'message':'License\x20limit\x20reached'});}return _0x480c17(util['format'](_0x3b70('0x77'),_0x5dfb57,_0x2513ba));})['catch'](function(_0x2c2471){return _0x5091c0(_0x2c2471);});});};exports['create']=function(_0x598417,_0x964573){return getLicense(_0x598417)[_0x3b70('0x34')](function(_0x96b189){if(!_0x598417[_0x3b70('0x6a')][_0x3b70('0x78')]){var _0xb87608;return db['Setting'][_0x3b70('0x79')](0x1)['then'](function(_0x1fd52a){_0x1fd52a[_0x3b70('0x7a')]=!![];return checkPasswordPattern(_0x1fd52a,_0x598417[_0x3b70('0x6a')]['password'],_0x1fd52a[_0x3b70('0x7a')]);})['then'](function(_0x4c3432){_0xb87608=_0x4c3432[_0x3b70('0x7b')];return db[_0x3b70('0x49')][_0x3b70('0x7c')](_0x3b70('0x78'));})[_0x3b70('0x34')](function(_0x32f6a5){if(_['isNil'](_0x32f6a5)){if(_0xb87608){_0x598417[_0x3b70('0x6a')][_0x3b70('0x78')]=_0xb87608;}else{_0x598417[_0x3b70('0x6a')][_0x3b70('0x78')]=0x1;}}else{if(_[_0x3b70('0x76')](_0xb87608)||_0xb87608==_0x32f6a5){_0x598417[_0x3b70('0x6a')][_0x3b70('0x78')]=_0x32f6a5+0x1;}else if(_0xb87608>_0x32f6a5){_0x598417[_0x3b70('0x6a')][_0x3b70('0x78')]=_0xb87608;}else{return db[_0x3b70('0x5d')]['query'](_0x3b70('0x7d'),{'type':db[_0x3b70('0x5d')][_0x3b70('0x7e')][_0x3b70('0x7f')]})[_0x3b70('0x34')](function(_0x350ca1){if(_0x350ca1&&_0x350ca1['length']){for(var _0x810ee0=0x0,_0x34def0=_0x350ca1[_0x3b70('0x54')];_0x810ee0<_0x34def0&&_['isNil'](_0x598417[_0x3b70('0x6a')][_0x3b70('0x78')]);_0x810ee0++){if(_0xb87608<=_0x350ca1[_0x810ee0][_0x3b70('0x80')]){_0x598417[_0x3b70('0x6a')]['internal']=_0x350ca1[_0x810ee0][_0x3b70('0x80')];}else if(_0xb87608>_0x350ca1[_0x810ee0][_0x3b70('0x80')]&&_0xb87608<=_0x350ca1[_0x810ee0]['to']){_0x598417['body'][_0x3b70('0x78')]=_0xb87608;}}}if(_['isNil'](_0x598417[_0x3b70('0x6a')]['internal'])){_0x598417['body'][_0x3b70('0x78')]=_0x32f6a5+0x1;}});}}});}})[_0x3b70('0x34')](function(){if(_0x598417['body'][_0x3b70('0x81')]){_0x598417[_0x3b70('0x6a')][_0x3b70('0x82')]=_0x598417[_0x3b70('0x6a')][_0x3b70('0x78')];_0x598417['body']['VoiceMail']={'mailbox':_0x598417[_0x3b70('0x6a')][_0x3b70('0x78')],'password':_0x598417['body']['password'],'fullname':_0x598417[_0x3b70('0x6a')]['fullname'],'email':_0x598417[_0x3b70('0x6a')]['email']};}if(_0x598417[_0x3b70('0x6a')]&&_0x598417['body']['role']===_0x3b70('0x39')){_0x598417['body']['permissions']=['101',_0x3b70('0x83'),_0x3b70('0x84'),_0x3b70('0x85'),_0x3b70('0x86'),_0x3b70('0x87'),'106',_0x3b70('0x88'),_0x3b70('0x89'),_0x3b70('0x8a'),_0x3b70('0x8b'),_0x3b70('0x8c')];}return db[_0x3b70('0x49')][_0x3b70('0x8d')](_0x598417[_0x3b70('0x6a')],{'include':[{'model':db['VoiceMail'],'as':_0x3b70('0x8e')}]});})['then'](function(_0x200243){if(_0x598417[_0x3b70('0x6a')][_0x3b70('0x41')]==='user')return _0x200243;var _0x250728=_0x598417[_0x3b70('0x37')][_0x3b70('0x35')]({'plain':!![]});if(!_0x250728)throw new Error(_0x3b70('0x8f'));if(_0x250728[_0x3b70('0x41')]===_0x3b70('0x37')){var _0x5ea124=_0x200243[_0x3b70('0x35')]({'plain':!![]});var _0x4963c3=[{'name':'Agents','value':_0x3b70('0x39')},{'name':_0x3b70('0x3a'),'value':'telephone'}];var _0x396530=_[_0x3b70('0x42')](_0x4963c3,['value',_0x5ea124['role']])[_0x3b70('0x46')];return db[_0x3b70('0x90')][_0x3b70('0x42')]({'where':{'name':_0x396530,'userProfileId':_0x250728[_0x3b70('0x91')]},'raw':!![]})['then'](function(_0xd7afaf){if(_0xd7afaf&&_0xd7afaf[_0x3b70('0x92')]===0x0){return db[_0x3b70('0x43')][_0x3b70('0x8d')]({'name':_0x5ea124[_0x3b70('0x46')],'resourceId':_0x5ea124['id'],'type':_0xd7afaf[_0x3b70('0x46')],'sectionId':_0xd7afaf['id']},{})[_0x3b70('0x34')](function(){return _0x200243;});}else{return _0x200243;}})[_0x3b70('0x29')](function(_0x32623f){logger[_0x3b70('0x27')](_0x3b70('0x93'),_0x32623f);throw _0x32623f;});}return _0x200243;})[_0x3b70('0x34')](respondWithResult(_0x964573,0xc9))['catch'](handleError(_0x964573,null));};exports[_0x3b70('0x94')]=function(_0x4b5b51,_0x527e5e,_0xb75b9b){var _0x444cd1=![];if(_0x4b5b51[_0x3b70('0x6a')]['id']){delete _0x4b5b51[_0x3b70('0x6a')]['id'];}if(!_['isNil'](_0x4b5b51[_0x3b70('0x6a')]['oldPassword'])){if(_0x4b5b51[_0x3b70('0x6a')][_0x3b70('0x95')]===_0x4b5b51[_0x3b70('0x6a')][_0x3b70('0x96')]){throw new Error(_0x3b70('0x97'));}}return db[_0x3b70('0x49')][_0x3b70('0x42')]({'where':{'id':_0x4b5b51[_0x3b70('0x6b')]['id']}})['then'](function(_0x2c3f02){if(_0x2c3f02){if(_0x2c3f02['id']==_0x4b5b51[_0x3b70('0x37')]['id']){if(!_0x4b5b51[_0x3b70('0x6a')][_0x3b70('0x95')]||!_0x4b5b51[_0x3b70('0x6a')][_0x3b70('0x96')]){throw new db[(_0x3b70('0x98'))][(_0x3b70('0x99'))]('Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword');}if(!_0x2c3f02[_0x3b70('0x9a')](_0x4b5b51['body'][_0x3b70('0x95')])){throw new db['Sequelize']['ValidationError']('Wrong\x20credentials');}if(_0x4b5b51[_0x3b70('0x6a')][_0x3b70('0x95')]==_0x4b5b51[_0x3b70('0x6a')][_0x3b70('0x96')]){throw new db['Sequelize'][(_0x3b70('0x99'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}return _0x2c3f02;}else if(_0x4b5b51[_0x3b70('0x37')]['role']==_0x3b70('0x71')){if(!_0x4b5b51[_0x3b70('0x6a')]['newPassword']){throw new db['Sequelize'][(_0x3b70('0x99'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x2c3f02;}else if(_0x4b5b51[_0x3b70('0x37')]['role']==_0x3b70('0x37')){if(!_0x4b5b51[_0x3b70('0x6a')]['newPassword']){throw new db[(_0x3b70('0x98'))][(_0x3b70('0x99'))](_0x3b70('0x9b'));}if(_0x2c3f02['role']!=_0x3b70('0x39')){throw new db['Sequelize'][(_0x3b70('0x99'))](_0x3b70('0x9c'));}return _0x2c3f02;}else{throw new db['Sequelize'][(_0x3b70('0x99'))]('Unauthorized');}}return null;})['then'](handleEntityNotFound(_0x527e5e,null))[_0x3b70('0x34')](function(_0x4b7d87){return db[_0x3b70('0x9d')]['findOne']({'attributes':['id',_0x3b70('0x7a')]})[_0x3b70('0x34')](function(_0x367f36){_0x444cd1=_0x367f36[_0x3b70('0x7a')];return checkPasswordPattern(_0x4b7d87,_0x4b5b51['body'][_0x3b70('0x96')],_0x444cd1);});})[_0x3b70('0x34')](saveUpdates({'password':_0x4b5b51['body']['newPassword'],'passwordResetAt':_0x4b5b51[_0x3b70('0x37')]['id']==_0x4b5b51[_0x3b70('0x6b')]['id']?moment():null},null))[_0x3b70('0x34')](respondWithResult(_0x527e5e,null))['catch'](handleError(_0x527e5e,null));};exports[_0x3b70('0x9e')]=function(_0x3efed7,_0x38908d,_0x117929){var _0x3e4ac7=_0x3efed7[_0x3b70('0x6a')][_0x3b70('0x9f')];return db[_0x3b70('0x49')]['find']({'where':{'id':_0x3efed7['params']['id']},'attributes':['id',_0x3b70('0x46'),'role','online',_0x3b70('0xa0'),_0x3b70('0xa1'),_0x3b70('0xa2')]})[_0x3b70('0x34')](handleEntityNotFound(_0x38908d,null))[_0x3b70('0x34')](function(_0x143a0a){if(_0x143a0a){if(!utils['isValidChannel'](_0x3e4ac7)){throw new db['Sequelize'][(_0x3b70('0x99'))](_0x3b70('0xa3'));}return _0x143a0a['add'+_['capitalize'](_0x3e4ac7['toLowerCase']())+_0x3b70('0xa4')](_0x3efed7[_0x3b70('0x6a')][_0x3b70('0x6e')],{'penalty':_0x3efed7['body'][_0x3b70('0xa5')]||0x0})['spread'](function(_0x238a2e){for(var _0x10a812=0x0;_0x10a812<_0x3efed7['body'][_0x3b70('0x6e')][_0x3b70('0x54')];_0x10a812+=0x1){var _0x4b1c16={'UserId':_0x3efed7['params']['id']};_0x4b1c16[_[_0x3b70('0xa6')](_0x3e4ac7[_0x3b70('0xa7')]())+'QueueId']=_0x3efed7[_0x3b70('0x6a')][_0x3b70('0x6e')][_0x10a812];socket[_0x3b70('0xa8')]('user'+_[_0x3b70('0xa6')](_0x3e4ac7['toLowerCase']())+_0x3b70('0xa9'),_0x4b1c16);}return _0x238a2e;})[_0x3b70('0x34')](function(){if(_0x3e4ac7===_0x3b70('0xaa')){return db['VoiceQueue'][_0x3b70('0x65')]({'where':{'id':_0x3efed7[_0x3b70('0x6a')]['ids']||[]},'raw':!![],'attributes':['id',_0x3b70('0x46')]});}})[_0x3b70('0x34')](function(_0x38ac90){var _0x527482=_0x143a0a[_0x3b70('0x35')]({'plain':!![]});var _0x2ea550=[];if(_0x3e4ac7===_0x3b70('0xaa')&&_0x527482[_0x3b70('0x41')]===_0x3b70('0x39')&&_0x527482[_0x3b70('0xab')]){for(var _0x401140=0x0;_0x401140<_0x38ac90[_0x3b70('0x54')];_0x401140+=0x1){_0x2ea550['push']({'membername':_0x527482[_0x3b70('0x46')],'UserId':_0x527482['id'],'queue_name':_0x38ac90[_0x401140][_0x3b70('0x46')],'VoiceQueueId':_0x38ac90[_0x401140]['id'],'interface':_[_0x3b70('0x76')](_0x527482[_0x3b70('0xa2')])?util[_0x3b70('0xac')](_0x3b70('0xad'),_0x527482[_0x3b70('0x46')]):_0x527482[_0x3b70('0xa2')],'paused':_0x527482[_0x3b70('0xa1')]||![],'penalty':_0x3efed7['body'][_0x3b70('0xa5')]||0x0});}return BPromise['each'](_0x2ea550,function(_0x17e8a2){return db[_0x3b70('0xae')][_0x3b70('0xaf')](_0x17e8a2);});}return _0x143a0a;});}})[_0x3b70('0x34')](respondWithStatusCode(_0x38908d,null))[_0x3b70('0x29')](handleError(_0x38908d,null));};exports[_0x3b70('0xb0')]=function(_0x46ed3a,_0x572ebb,_0xb5975f){var _0x1e31ea;return db[_0x3b70('0x49')][_0x3b70('0x42')]({'where':{'id':_0x46ed3a[_0x3b70('0x6b')]['id']},'attributes':['id','name',_0x3b70('0x41')]})['then'](handleEntityNotFound(_0x572ebb,null))[_0x3b70('0x34')](function(_0x5d9601){if(_0x5d9601){_0x1e31ea=_0x5d9601;if(!_0x46ed3a[_0x3b70('0x4f')][_0x3b70('0x9f')]||!utils[_0x3b70('0xb1')](_0x46ed3a['query'][_0x3b70('0x9f')])){throw new db[(_0x3b70('0x98'))][(_0x3b70('0x99'))]('Unknown\x20channel');}return _0x5d9601[_0x3b70('0xb2')+_[_0x3b70('0xa6')](_0x46ed3a[_0x3b70('0x4f')][_0x3b70('0x9f')][_0x3b70('0xa7')]())+_0x3b70('0xa4')](_0x46ed3a[_0x3b70('0x4f')]['ids']);}})[_0x3b70('0x34')](function(_0x2bbf74){for(var _0x55c173=0x0;_0x55c173<_0x46ed3a[_0x3b70('0x4f')][_0x3b70('0x6e')][_0x3b70('0x54')];_0x55c173+=0x1){var _0x442e3b={'UserId':_0x46ed3a[_0x3b70('0x6b')]['id']};_0x442e3b[_[_0x3b70('0xa6')](_0x46ed3a['query']['channel'][_0x3b70('0xa7')]())+_0x3b70('0xb3')]=_0x46ed3a[_0x3b70('0x4f')][_0x3b70('0x6e')][_0x55c173];socket[_0x3b70('0xa8')](_0x3b70('0x37')+_[_0x3b70('0xa6')](_0x46ed3a[_0x3b70('0x4f')][_0x3b70('0x9f')]['toLowerCase']())+_0x3b70('0xb4'),_0x442e3b);}return _0x2bbf74;})['then'](function(){if(_0x46ed3a[_0x3b70('0x4f')][_0x3b70('0x9f')]===_0x3b70('0xaa')){return db[_0x3b70('0xae')][_0x3b70('0x44')]({'where':{'UserId':_0x46ed3a[_0x3b70('0x6b')]['id'],'VoiceQueueId':_0x46ed3a[_0x3b70('0x4f')][_0x3b70('0x6e')]},'individualHooks':!![]})['then'](function(){return _0x1e31ea;});}return _0x1e31ea;})['then'](respondWithStatusCode(_0x572ebb,null))[_0x3b70('0x29')](handleError(_0x572ebb,null));};exports[_0x3b70('0xb5')]=function(_0x1e757f,_0x2589e2,_0x7211a4){_0x1e757f['body'][_0x3b70('0xb6')]=_0x1e757f[_0x3b70('0xb7')][_0x3b70('0xb8')];return db[_0x3b70('0x49')][_0x3b70('0x42')]({'where':{'id':_0x1e757f[_0x3b70('0x6b')]['id']}})[_0x3b70('0x34')](handleEntityNotFound(_0x2589e2,null))[_0x3b70('0x34')](saveUpdates(_0x1e757f[_0x3b70('0x6a')],null))['then'](respondWithResult(_0x2589e2,null))[_0x3b70('0x29')](handleError(_0x2589e2,null));};exports['getAvatar']=function(_0x4fca83,_0x655569,_0x535a05){var _0x34af87=path['join'](config[_0x3b70('0xb9')],'server/files/images/logos/default_profile.png');return db[_0x3b70('0x49')]['find']({'where':{'id':_0x4fca83[_0x3b70('0x6b')]['id']},'attributes':['id',_0x3b70('0xb6')],'raw':!![]})[_0x3b70('0x34')](handleEntityNotFound(_0x655569,null))[_0x3b70('0x34')](function(_0x30588c){if(_0x30588c){if(_[_0x3b70('0x76')](_0x30588c[_0x3b70('0xb6')])){return _0x655569[_0x3b70('0xba')](_0x34af87);}else{if(!fs[_0x3b70('0xbb')](path[_0x3b70('0xbc')](config[_0x3b70('0xb9')],_0x3b70('0xbd'),_0x30588c[_0x3b70('0xb6')]))){return _0x655569[_0x3b70('0xba')](_0x34af87);}return _0x655569[_0x3b70('0xba')](path['join'](config[_0x3b70('0xb9')],_0x3b70('0xbd'),_0x30588c['userpic']));}}})['catch'](handleError(_0x655569,null));};exports[_0x3b70('0xbe')]=function(_0x3fa3cb,_0x42df7c,_0x1b9534){var _0x1482b3={};var _0x30d83d={};var _0x6f344c;var _0x1901ba;return db['User'][_0x3b70('0xbf')]({'where':{'id':_0x3fa3cb[_0x3b70('0x6b')]['id']}})[_0x3b70('0x34')](handleEntityNotFound(_0x42df7c,null))[_0x3b70('0x34')](function(_0x3c80bf){if(_0x3c80bf){_0x6f344c=_0x3c80bf;_0x30d83d[_0x3b70('0x4b')]=_[_0x3b70('0x4c')](db[_0x3b70('0xc0')][_0x3b70('0x4a')]);_0x30d83d[_0x3b70('0x4f')]=_[_0x3b70('0x4c')](_0x3fa3cb[_0x3b70('0x4f')]);_0x30d83d[_0x3b70('0x50')]=_[_0x3b70('0x51')](_0x30d83d[_0x3b70('0x4b')],_0x30d83d['query']);_0x1482b3[_0x3b70('0x52')]=_[_0x3b70('0x51')](_0x30d83d[_0x3b70('0x4b')],qs[_0x3b70('0x53')](_0x3fa3cb[_0x3b70('0x4f')]['fields']));_0x1482b3[_0x3b70('0x52')]=_0x1482b3[_0x3b70('0x52')]['length']?_0x1482b3[_0x3b70('0x52')]:_0x30d83d[_0x3b70('0x4b')];_0x1482b3[_0x3b70('0x58')]=qs[_0x3b70('0x59')](_0x3fa3cb[_0x3b70('0x4f')][_0x3b70('0x59')]);_0x1482b3[_0x3b70('0x5e')]=qs[_0x3b70('0x50')](_[_0x3b70('0x5a')](_0x3fa3cb[_0x3b70('0x4f')],_0x30d83d[_0x3b70('0x50')]));if(_0x3fa3cb[_0x3b70('0x4f')][_0x3b70('0x3c')]){_0x1482b3[_0x3b70('0x5e')]=_[_0x3b70('0x5b')](_0x1482b3[_0x3b70('0x5e')],{'$or':_['map'](_0x1482b3[_0x3b70('0x52')],function(_0x3cd830){var _0x3bd1ae={};_0x3bd1ae[_0x3cd830]={'$like':'%'+_0x3fa3cb[_0x3b70('0x4f')][_0x3b70('0x3c')]+'%'};return _0x3bd1ae;})});}_0x1482b3=_[_0x3b70('0x5b')]({},_0x1482b3,_0x3fa3cb[_0x3b70('0x62')]);return _0x6f344c[_0x3b70('0xbe')](_0x1482b3);}})['then'](function(_0x8c266a){if(_0x8c266a){_0x1901ba=_0x8c266a[_0x3b70('0x54')];if(_0x3fa3cb[_0x3b70('0x4f')][_0x3b70('0x55')](_0x3b70('0x63'))){_0x1482b3['include']=[{'model':db[_0x3b70('0xc1')],'as':_0x3b70('0xc2'),'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x3b70('0x46'),_0x3b70('0xc3')],'where':_0x3fa3cb['query'][_0x3b70('0xc4')]?{'id':_0x3fa3cb[_0x3b70('0x4f')]['tag']}:undefined,'required':_0x3fa3cb[_0x3b70('0x4f')][_0x3b70('0xc4')]?!![]:![]}];}if(!_0x3fa3cb['query']['hasOwnProperty'](_0x3b70('0x56'))){_0x1482b3[_0x3b70('0x57')]=qs['limit'](_0x3fa3cb[_0x3b70('0x4f')][_0x3b70('0x57')]);_0x1482b3[_0x3b70('0x2f')]=qs['offset'](_0x3fa3cb['query']['offset']);}return _0x6f344c[_0x3b70('0xbe')](_0x1482b3);}})[_0x3b70('0x34')](function(_0x5d16aa){if(_0x5d16aa){return _0x5d16aa?{'count':_0x1901ba,'rows':_0x5d16aa}:null;}})[_0x3b70('0x34')](respondWithResult(_0x42df7c,null))[_0x3b70('0x29')](handleError(_0x42df7c,null));};exports[_0x3b70('0xc5')]=function(_0x30e8a2,_0x57c00a,_0x3f9155){var _0x58873b;var _0x8c81fd;var _0x40058c={};var _0x4985cd;return db[_0x3b70('0x49')][_0x3b70('0xbf')]({'where':{'id':_0x30e8a2['params']['id']},'attributes':['id','name',_0x3b70('0x41')]})[_0x3b70('0x34')](handleEntityNotFound(_0x57c00a,null))[_0x3b70('0x34')](function(_0x5d32f4){if(!utils['isValidChannel'](_0x30e8a2[_0x3b70('0x4f')]['channel'])){throw new db['Sequelize'][(_0x3b70('0x99'))](_0x3b70('0xa3'));}_0x58873b=_0x5d32f4;var _0x4ad32d={};_0x4ad32d[_0x3b70('0x4b')]=_[_0x3b70('0x4c')](db[_[_0x3b70('0xa6')](_0x30e8a2[_0x3b70('0x4f')][_0x3b70('0x9f')])+_0x3b70('0xc6')][_0x3b70('0x4a')]);_0x4ad32d[_0x3b70('0x4f')]=_['keys'](_0x30e8a2[_0x3b70('0x4f')]);_0x4ad32d['filters']=_[_0x3b70('0x51')](_0x4ad32d[_0x3b70('0x4b')],_0x4ad32d[_0x3b70('0x4f')]);_0x40058c[_0x3b70('0x52')]=_[_0x3b70('0x51')](_0x4ad32d[_0x3b70('0x4b')],qs['fields'](_0x30e8a2[_0x3b70('0x4f')]['fields']));_0x40058c[_0x3b70('0x52')]=_0x40058c['attributes']['length']?_0x40058c[_0x3b70('0x52')]:_0x4ad32d['model'];_0x40058c[_0x3b70('0x58')]=qs[_0x3b70('0x59')](_0x30e8a2[_0x3b70('0x4f')][_0x3b70('0x59')]);_0x40058c[_0x3b70('0x5e')]=qs['filters'](_[_0x3b70('0x5a')](_0x30e8a2[_0x3b70('0x4f')],_0x4ad32d['filters']));if(_0x30e8a2[_0x3b70('0x4f')][_0x3b70('0x3c')]){_0x40058c[_0x3b70('0x5e')]=_[_0x3b70('0x5b')](_0x40058c[_0x3b70('0x5e')],{'$or':_[_0x3b70('0x3e')](_0x40058c[_0x3b70('0x52')],function(_0x1aab85){var _0x2b9b5a={};_0x2b9b5a[_0x1aab85]={'$like':'%'+_0x30e8a2[_0x3b70('0x4f')][_0x3b70('0x3c')]+'%'};return _0x2b9b5a;})});}_0x40058c=_[_0x3b70('0x5b')]({},_0x40058c,_0x30e8a2[_0x3b70('0x62')]);switch(_0x58873b[_0x3b70('0x41')]){case _0x3b70('0x71'):return db[_[_0x3b70('0xa6')](_0x30e8a2[_0x3b70('0x4f')][_0x3b70('0x9f')])+_0x3b70('0xc6')][_0x3b70('0x65')](_0x40058c);case'user':case _0x3b70('0x39'):return _0x58873b[_0x3b70('0x35')+_[_0x3b70('0xa6')](_0x30e8a2[_0x3b70('0x4f')][_0x3b70('0x9f')])+_0x3b70('0xa4')](_0x40058c);default:throw new db[(_0x3b70('0x98'))][(_0x3b70('0x99'))](_0x3b70('0xc7'));}})[_0x3b70('0x34')](function(_0xfbfff6){_0x4985cd=_0xfbfff6[_0x3b70('0x54')];if(!_0x30e8a2['query'][_0x3b70('0x55')](_0x3b70('0x56'))){_0x40058c[_0x3b70('0x57')]=qs['limit'](_0x30e8a2['query'][_0x3b70('0x57')]);_0x40058c[_0x3b70('0x2f')]=qs[_0x3b70('0x2f')](_0x30e8a2[_0x3b70('0x4f')][_0x3b70('0x2f')]);}switch(_0x58873b[_0x3b70('0x41')]){case'admin':return db[_[_0x3b70('0xa6')](_0x30e8a2[_0x3b70('0x4f')][_0x3b70('0x9f')])+_0x3b70('0xc6')]['findAll'](_0x40058c);case _0x3b70('0x37'):case'agent':return _0x58873b[_0x3b70('0x35')+_[_0x3b70('0xa6')](_0x30e8a2[_0x3b70('0x4f')][_0x3b70('0x9f')])+_0x3b70('0xa4')](_0x40058c);}})['then'](function(_0x3d860f){return{'count':_0x4985cd,'rows':_0x3d860f};})[_0x3b70('0x34')](respondWithResult(_0x57c00a,null))['catch'](handleError(_0x57c00a,null));};exports['getVoiceQueuesRt']=function(_0x2cea85,_0x330175,_0x31d185){var _0x4c3a3e={};var _0x4d4686={};var _0x62fafa;var _0x37e5c4;return db[_0x3b70('0x49')][_0x3b70('0xbf')]({'where':{'id':_0x2cea85[_0x3b70('0x6b')]['id']}})[_0x3b70('0x34')](handleEntityNotFound(_0x330175,null))[_0x3b70('0x34')](function(_0x5a4a50){if(_0x5a4a50){_0x62fafa=_0x5a4a50;_0x4d4686[_0x3b70('0x4b')]=_[_0x3b70('0x4c')](db[_0x3b70('0xae')][_0x3b70('0x4a')]);_0x4d4686['query']=_[_0x3b70('0x4c')](_0x2cea85[_0x3b70('0x4f')]);_0x4d4686[_0x3b70('0x50')]=_[_0x3b70('0x51')](_0x4d4686[_0x3b70('0x4b')],_0x4d4686[_0x3b70('0x4f')]);_0x4c3a3e[_0x3b70('0x52')]=_[_0x3b70('0x51')](_0x4d4686[_0x3b70('0x4b')],qs['fields'](_0x2cea85[_0x3b70('0x4f')][_0x3b70('0x53')]));_0x4c3a3e[_0x3b70('0x52')]=_0x4c3a3e['attributes'][_0x3b70('0x54')]?_0x4c3a3e[_0x3b70('0x52')]:_0x4d4686[_0x3b70('0x4b')];_0x4c3a3e[_0x3b70('0x58')]=qs[_0x3b70('0x59')](_0x2cea85[_0x3b70('0x4f')]['sort']);_0x4c3a3e['where']=qs['filters'](_[_0x3b70('0x5a')](_0x2cea85[_0x3b70('0x4f')],_0x4d4686[_0x3b70('0x50')]));if(_0x2cea85[_0x3b70('0x4f')]['filter']){_0x4c3a3e[_0x3b70('0x5e')]=_[_0x3b70('0x5b')](_0x4c3a3e[_0x3b70('0x5e')],{'$or':_[_0x3b70('0x3e')](_0x4c3a3e[_0x3b70('0x52')],function(_0x488931){var _0x4a1787={};_0x4a1787[_0x488931]={'$like':'%'+_0x2cea85['query'][_0x3b70('0x3c')]+'%'};return _0x4a1787;})});}_0x4c3a3e=_['merge']({},_0x4c3a3e,_0x2cea85[_0x3b70('0x62')]);return _0x62fafa['getVoiceQueuesRt'](_0x4c3a3e);}})[_0x3b70('0x34')](function(_0x53332b){if(_0x53332b){_0x37e5c4=_0x53332b['length'];if(!_0x2cea85[_0x3b70('0x4f')][_0x3b70('0x55')]('nolimit')){_0x4c3a3e['limit']=qs['limit'](_0x2cea85[_0x3b70('0x4f')][_0x3b70('0x57')]);_0x4c3a3e[_0x3b70('0x2f')]=qs[_0x3b70('0x2f')](_0x2cea85[_0x3b70('0x4f')]['offset']);}return _0x62fafa[_0x3b70('0xc8')](_0x4c3a3e);}})[_0x3b70('0x34')](function(_0x3fc52d){if(_0x3fc52d){return _0x3fc52d?{'count':_0x37e5c4,'rows':_0x3fc52d}:null;}})[_0x3b70('0x34')](respondWithResult(_0x330175,null))[_0x3b70('0x29')](handleError(_0x330175,null));};exports[_0x3b70('0xc9')]=function(_0x3d06ed,_0x26226a,_0x3ac653){var _0x1dd48c={};var _0x38f4d6={};var _0x1265fd;var _0x34ddb7;return db[_0x3b70('0x49')][_0x3b70('0xbf')]({'where':{'id':_0x3d06ed[_0x3b70('0x6b')]['id']}})[_0x3b70('0x34')](handleEntityNotFound(_0x26226a,null))[_0x3b70('0x34')](function(_0xbf1131){if(_0xbf1131){_0x1265fd=_0xbf1131;_0x38f4d6[_0x3b70('0x4b')]=_[_0x3b70('0x4c')](db[_0x3b70('0xca')][_0x3b70('0x4a')]);_0x38f4d6[_0x3b70('0x4f')]=_['keys'](_0x3d06ed[_0x3b70('0x4f')]);_0x38f4d6[_0x3b70('0x50')]=_[_0x3b70('0x51')](_0x38f4d6['model'],_0x38f4d6['query']);_0x1dd48c['attributes']=_[_0x3b70('0x51')](_0x38f4d6[_0x3b70('0x4b')],qs[_0x3b70('0x53')](_0x3d06ed[_0x3b70('0x4f')]['fields']));_0x1dd48c['attributes']=_0x1dd48c['attributes'][_0x3b70('0x54')]?_0x1dd48c['attributes']:_0x38f4d6[_0x3b70('0x4b')];_0x1dd48c[_0x3b70('0x58')]=qs[_0x3b70('0x59')](_0x3d06ed['query'][_0x3b70('0x59')]);_0x1dd48c['where']=qs['filters'](_[_0x3b70('0x5a')](_0x3d06ed[_0x3b70('0x4f')],_0x38f4d6[_0x3b70('0x50')]));if(_0x3d06ed[_0x3b70('0x4f')]['filter']){_0x1dd48c[_0x3b70('0x5e')]=_['merge'](_0x1dd48c[_0x3b70('0x5e')],{'$or':_[_0x3b70('0x3e')](_0x1dd48c[_0x3b70('0x52')],function(_0x516119){var _0x36214e={};_0x36214e[_0x516119]={'$like':'%'+_0x3d06ed['query'][_0x3b70('0x3c')]+'%'};return _0x36214e;})});}_0x1dd48c=_['merge']({},_0x1dd48c,_0x3d06ed[_0x3b70('0x62')]);return _0x1265fd[_0x3b70('0xc9')](_0x1dd48c);}})['then'](function(_0x4ca4c7){if(_0x4ca4c7){_0x34ddb7=_0x4ca4c7[_0x3b70('0x54')];if(!_0x3d06ed[_0x3b70('0x4f')][_0x3b70('0x55')](_0x3b70('0x56'))){_0x1dd48c[_0x3b70('0x57')]=qs[_0x3b70('0x57')](_0x3d06ed['query'][_0x3b70('0x57')]);_0x1dd48c[_0x3b70('0x2f')]=qs[_0x3b70('0x2f')](_0x3d06ed[_0x3b70('0x4f')][_0x3b70('0x2f')]);}return _0x1265fd[_0x3b70('0xc9')](_0x1dd48c);}})[_0x3b70('0x34')](function(_0xda168d){if(_0xda168d){return _0xda168d?{'count':_0x34ddb7,'rows':_0xda168d}:null;}})['then'](respondWithResult(_0x26226a,null))[_0x3b70('0x29')](handleError(_0x26226a,null));};exports[_0x3b70('0xcb')]=function(_0x4dbd10,_0x378710,_0x51d1a5){var _0x52fb9a={'raw':!![],'where':{}};var _0x2eca70={};var _0x5ab2c0={'count':0x0,'rows':[]};return db[_0x3b70('0x49')][_0x3b70('0xbf')]({'where':{'id':_0x4dbd10[_0x3b70('0x6b')]['id']}})[_0x3b70('0x34')](handleEntityNotFound(_0x378710,null))[_0x3b70('0x34')](function(_0x52d7c2){if(_0x52d7c2){_0x2eca70[_0x3b70('0x4b')]=_[_0x3b70('0x4c')](db[_0x3b70('0xcc')][_0x3b70('0x4a')]);_0x2eca70[_0x3b70('0x4f')]=_[_0x3b70('0x4c')](_0x4dbd10['query']);_0x2eca70[_0x3b70('0x50')]=_[_0x3b70('0x51')](_0x2eca70[_0x3b70('0x4b')],_0x2eca70[_0x3b70('0x4f')]);_0x52fb9a[_0x3b70('0x52')]=_[_0x3b70('0x51')](_0x2eca70[_0x3b70('0x4b')],qs[_0x3b70('0x53')](_0x4dbd10[_0x3b70('0x4f')][_0x3b70('0x53')]));_0x52fb9a[_0x3b70('0x52')]=_0x52fb9a[_0x3b70('0x52')]['length']?_0x52fb9a[_0x3b70('0x52')]:_0x2eca70['model'];if(!_0x4dbd10[_0x3b70('0x4f')]['hasOwnProperty']('nolimit')){_0x52fb9a['limit']=qs[_0x3b70('0x57')](_0x4dbd10['query']['limit']);_0x52fb9a[_0x3b70('0x2f')]=qs[_0x3b70('0x2f')](_0x4dbd10['query'][_0x3b70('0x2f')]);}_0x52fb9a[_0x3b70('0x58')]=qs['sort'](_0x4dbd10[_0x3b70('0x4f')][_0x3b70('0x59')]);_0x52fb9a[_0x3b70('0x5e')]=qs[_0x3b70('0x50')](_[_0x3b70('0x5a')](_0x4dbd10['query'],_0x2eca70['filters']));_0x52fb9a[_0x3b70('0x5e')][_0x3b70('0xcd')]=_0x52d7c2['id'];if(_0x4dbd10[_0x3b70('0x4f')][_0x3b70('0x3c')]){_0x52fb9a[_0x3b70('0x5e')]=_['merge'](_0x52fb9a[_0x3b70('0x5e')],{'$or':_['map'](_0x52fb9a[_0x3b70('0x52')],function(_0x358ae3){var _0x44e22f={};_0x44e22f[_0x358ae3]={'$like':'%'+_0x4dbd10['query'][_0x3b70('0x3c')]+'%'};return _0x44e22f;})});}_0x52fb9a=_['merge']({},_0x52fb9a,_0x4dbd10['options']);return db[_0x3b70('0xcc')][_0x3b70('0x2e')]({'where':_0x52fb9a[_0x3b70('0x5e')]})[_0x3b70('0x34')](function(_0x53d43c){_0x5ab2c0[_0x3b70('0x2e')]=_0x53d43c;if(_0x4dbd10[_0x3b70('0x4f')][_0x3b70('0x63')]){_0x52fb9a[_0x3b70('0x64')]=[{'all':!![]}];}return db[_0x3b70('0xcc')][_0x3b70('0x65')](_0x52fb9a);})[_0x3b70('0x34')](function(_0x5d4cd5){_0x5ab2c0[_0x3b70('0x66')]=_0x5d4cd5;return _0x5ab2c0;});}})[_0x3b70('0x34')](respondWithFilteredResult(_0x378710,_0x52fb9a))[_0x3b70('0x29')](handleError(_0x378710,null));};exports[_0x3b70('0xce')]=function(_0xeaf1a,_0x467ada,_0x5dc054){var _0x2ed897={'raw':!![],'where':{}};var _0x564b0c={};var _0x1b304f={'count':0x0,'rows':[]};return db['User'][_0x3b70('0xbf')]({'where':{'id':_0xeaf1a['params']['id']}})[_0x3b70('0x34')](handleEntityNotFound(_0x467ada,null))['then'](function(_0x386cd0){if(_0x386cd0){_0x564b0c['model']=_['keys'](db[_0x3b70('0xcf')]['rawAttributes']);_0x564b0c[_0x3b70('0x4f')]=_['keys'](_0xeaf1a[_0x3b70('0x4f')]);_0x564b0c[_0x3b70('0x50')]=_[_0x3b70('0x51')](_0x564b0c[_0x3b70('0x4b')],_0x564b0c[_0x3b70('0x4f')]);_0x2ed897[_0x3b70('0x52')]=_[_0x3b70('0x51')](_0x564b0c['model'],qs[_0x3b70('0x53')](_0xeaf1a[_0x3b70('0x4f')][_0x3b70('0x53')]));_0x2ed897[_0x3b70('0x52')]=_0x2ed897['attributes']['length']?_0x2ed897[_0x3b70('0x52')]:_0x564b0c[_0x3b70('0x4b')];if(!_0xeaf1a[_0x3b70('0x4f')][_0x3b70('0x55')](_0x3b70('0x56'))){_0x2ed897['limit']=qs[_0x3b70('0x57')](_0xeaf1a[_0x3b70('0x4f')]['limit']);_0x2ed897[_0x3b70('0x2f')]=qs[_0x3b70('0x2f')](_0xeaf1a[_0x3b70('0x4f')][_0x3b70('0x2f')]);}_0x2ed897[_0x3b70('0x58')]=qs['sort'](_0xeaf1a[_0x3b70('0x4f')][_0x3b70('0x59')]);_0x2ed897[_0x3b70('0x5e')]=qs[_0x3b70('0x50')](_[_0x3b70('0x5a')](_0xeaf1a[_0x3b70('0x4f')],_0x564b0c[_0x3b70('0x50')]));_0x2ed897[_0x3b70('0x5e')][_0x3b70('0xcd')]=_0x386cd0['id'];if(_0xeaf1a[_0x3b70('0x4f')][_0x3b70('0x3c')]){_0x2ed897['where']=_[_0x3b70('0x5b')](_0x2ed897[_0x3b70('0x5e')],{'$or':_[_0x3b70('0x3e')](_0x2ed897['attributes'],function(_0x2d1665){var _0x1455db={};_0x1455db[_0x2d1665]={'$like':'%'+_0xeaf1a[_0x3b70('0x4f')][_0x3b70('0x3c')]+'%'};return _0x1455db;})});}_0x2ed897=_[_0x3b70('0x5b')]({},_0x2ed897,_0xeaf1a['options']);return db[_0x3b70('0xcf')][_0x3b70('0x2e')]({'where':_0x2ed897[_0x3b70('0x5e')]})[_0x3b70('0x34')](function(_0x7d404e){_0x1b304f['count']=_0x7d404e;if(_0xeaf1a['query'][_0x3b70('0x63')]){_0x2ed897[_0x3b70('0x64')]=[{'all':!![]}];}return db[_0x3b70('0xcf')][_0x3b70('0x65')](_0x2ed897);})[_0x3b70('0x34')](function(_0x1ad2e8){_0x1b304f[_0x3b70('0x66')]=_0x1ad2e8;return _0x1b304f;});}})[_0x3b70('0x34')](respondWithFilteredResult(_0x467ada,_0x2ed897))[_0x3b70('0x29')](handleError(_0x467ada,null));};exports[_0x3b70('0xd0')]=function(_0x55c4c4,_0x516c9b,_0x53b556){var _0x4d28ba={};var _0x1cfb1c={};var _0x509c2b;var _0x126d5f;return db[_0x3b70('0x49')][_0x3b70('0xbf')]({'where':{'id':_0x55c4c4[_0x3b70('0x6b')]['id']}})[_0x3b70('0x34')](handleEntityNotFound(_0x516c9b,null))[_0x3b70('0x34')](function(_0x5ed31a){if(_0x5ed31a){_0x509c2b=_0x5ed31a;_0x1cfb1c[_0x3b70('0x4b')]=_[_0x3b70('0x4c')](db[_0x3b70('0xd1')][_0x3b70('0x4a')]);_0x1cfb1c[_0x3b70('0x4f')]=_[_0x3b70('0x4c')](_0x55c4c4[_0x3b70('0x4f')]);_0x1cfb1c['filters']=_['intersection'](_0x1cfb1c[_0x3b70('0x4b')],_0x1cfb1c[_0x3b70('0x4f')]);_0x4d28ba['attributes']=_[_0x3b70('0x51')](_0x1cfb1c[_0x3b70('0x4b')],qs[_0x3b70('0x53')](_0x55c4c4[_0x3b70('0x4f')]['fields']));_0x4d28ba[_0x3b70('0x52')]=_0x4d28ba[_0x3b70('0x52')][_0x3b70('0x54')]?_0x4d28ba[_0x3b70('0x52')]:_0x1cfb1c[_0x3b70('0x4b')];_0x4d28ba[_0x3b70('0x58')]=qs[_0x3b70('0x59')](_0x55c4c4[_0x3b70('0x4f')]['sort']);_0x4d28ba[_0x3b70('0x5e')]=qs[_0x3b70('0x50')](_[_0x3b70('0x5a')](_0x55c4c4[_0x3b70('0x4f')],_0x1cfb1c['filters']));if(_0x55c4c4[_0x3b70('0x4f')][_0x3b70('0x3c')]){_0x4d28ba[_0x3b70('0x5e')]=_['merge'](_0x4d28ba[_0x3b70('0x5e')],{'$or':_['map'](_0x4d28ba['attributes'],function(_0x3077e2){var _0x21dabd={};_0x21dabd[_0x3077e2]={'$like':'%'+_0x55c4c4[_0x3b70('0x4f')][_0x3b70('0x3c')]+'%'};return _0x21dabd;})});}_0x4d28ba=_[_0x3b70('0x5b')]({},_0x4d28ba,_0x55c4c4['options']);return _0x509c2b[_0x3b70('0xd0')](_0x4d28ba);}})['then'](function(_0x5ff75d){if(_0x5ff75d){_0x126d5f=_0x5ff75d[_0x3b70('0x54')];if(!_0x55c4c4[_0x3b70('0x4f')]['hasOwnProperty']('nolimit')){_0x4d28ba[_0x3b70('0x57')]=qs['limit'](_0x55c4c4[_0x3b70('0x4f')]['limit']);_0x4d28ba[_0x3b70('0x2f')]=qs['offset'](_0x55c4c4[_0x3b70('0x4f')]['offset']);}return _0x509c2b['getChatInteractions'](_0x4d28ba);}})[_0x3b70('0x34')](function(_0x2add8d){if(_0x2add8d){return _0x2add8d?{'count':_0x126d5f,'rows':_0x2add8d}:null;}})[_0x3b70('0x34')](respondWithResult(_0x516c9b,null))[_0x3b70('0x29')](handleError(_0x516c9b,null));};exports[_0x3b70('0xd2')]=function(_0x45dc9b,_0x48cfe3,_0x483246){var _0x546023={};var _0x2025f7={};var _0x39772c;var _0x4ff2ed;return db['User'][_0x3b70('0xbf')]({'where':{'id':_0x45dc9b['params']['id']}})['then'](handleEntityNotFound(_0x48cfe3,null))[_0x3b70('0x34')](function(_0x25c8d9){if(_0x25c8d9){_0x39772c=_0x25c8d9;_0x2025f7['model']=_[_0x3b70('0x4c')](db[_0x3b70('0xd3')][_0x3b70('0x4a')]);_0x2025f7[_0x3b70('0x4f')]=_['keys'](_0x45dc9b[_0x3b70('0x4f')]);_0x2025f7[_0x3b70('0x50')]=_[_0x3b70('0x51')](_0x2025f7[_0x3b70('0x4b')],_0x2025f7['query']);_0x546023[_0x3b70('0x52')]=_[_0x3b70('0x51')](_0x2025f7[_0x3b70('0x4b')],qs[_0x3b70('0x53')](_0x45dc9b[_0x3b70('0x4f')]['fields']));_0x546023[_0x3b70('0x52')]=_0x546023['attributes']['length']?_0x546023['attributes']:_0x2025f7[_0x3b70('0x4b')];_0x546023[_0x3b70('0x58')]=qs[_0x3b70('0x59')](_0x45dc9b[_0x3b70('0x4f')]['sort']);_0x546023['where']=qs[_0x3b70('0x50')](_['pick'](_0x45dc9b[_0x3b70('0x4f')],_0x2025f7[_0x3b70('0x50')]));if(_0x45dc9b[_0x3b70('0x4f')][_0x3b70('0x3c')]){_0x546023[_0x3b70('0x5e')]=_['merge'](_0x546023[_0x3b70('0x5e')],{'$or':_[_0x3b70('0x3e')](_0x546023[_0x3b70('0x52')],function(_0x4d780f){var _0x466b7f={};_0x466b7f[_0x4d780f]={'$like':'%'+_0x45dc9b['query']['filter']+'%'};return _0x466b7f;})});}_0x546023=_[_0x3b70('0x5b')]({},_0x546023,_0x45dc9b[_0x3b70('0x62')]);return _0x39772c[_0x3b70('0xd2')](_0x546023);}})[_0x3b70('0x34')](function(_0x2c4497){if(_0x2c4497){_0x4ff2ed=_0x2c4497[_0x3b70('0x54')];if(!_0x45dc9b[_0x3b70('0x4f')][_0x3b70('0x55')]('nolimit')){_0x546023['limit']=qs[_0x3b70('0x57')](_0x45dc9b['query'][_0x3b70('0x57')]);_0x546023[_0x3b70('0x2f')]=qs[_0x3b70('0x2f')](_0x45dc9b['query'][_0x3b70('0x2f')]);}return _0x39772c[_0x3b70('0xd2')](_0x546023);}})[_0x3b70('0x34')](function(_0x372030){if(_0x372030){return _0x372030?{'count':_0x4ff2ed,'rows':_0x372030}:null;}})[_0x3b70('0x34')](respondWithResult(_0x48cfe3,null))[_0x3b70('0x29')](handleError(_0x48cfe3,null));};exports[_0x3b70('0xd4')]=function(_0x199e9f,_0x328290,_0x5aab76){var _0xa5e04c={'raw':!![],'where':{}};var _0x423596={};var _0x4dca58={'count':0x0,'rows':[]};return db[_0x3b70('0x49')][_0x3b70('0xbf')]({'where':{'id':_0x199e9f['params']['id']}})[_0x3b70('0x34')](handleEntityNotFound(_0x328290,null))[_0x3b70('0x34')](function(_0x17e28d){if(_0x17e28d){_0x423596[_0x3b70('0x4b')]=_[_0x3b70('0x4c')](db['MailInteraction'][_0x3b70('0x4a')]);_0x423596[_0x3b70('0x4f')]=_[_0x3b70('0x4c')](_0x199e9f['query']);_0x423596[_0x3b70('0x50')]=_[_0x3b70('0x51')](_0x423596[_0x3b70('0x4b')],_0x423596[_0x3b70('0x4f')]);_0xa5e04c[_0x3b70('0x52')]=_[_0x3b70('0x51')](_0x423596[_0x3b70('0x4b')],qs[_0x3b70('0x53')](_0x199e9f[_0x3b70('0x4f')][_0x3b70('0x53')]));_0xa5e04c[_0x3b70('0x52')]=_0xa5e04c[_0x3b70('0x52')]['length']?_0xa5e04c[_0x3b70('0x52')]:_0x423596[_0x3b70('0x4b')];if(!_0x199e9f['query'][_0x3b70('0x55')](_0x3b70('0x56'))){_0xa5e04c[_0x3b70('0x57')]=qs[_0x3b70('0x57')](_0x199e9f['query'][_0x3b70('0x57')]);_0xa5e04c['offset']=qs[_0x3b70('0x2f')](_0x199e9f[_0x3b70('0x4f')]['offset']);}_0xa5e04c[_0x3b70('0x58')]=qs[_0x3b70('0x59')](_0x199e9f[_0x3b70('0x4f')][_0x3b70('0x59')]);_0xa5e04c[_0x3b70('0x5e')]=qs[_0x3b70('0x50')](_[_0x3b70('0x5a')](_0x199e9f[_0x3b70('0x4f')],_0x423596[_0x3b70('0x50')]));_0xa5e04c[_0x3b70('0x5e')][_0x3b70('0xcd')]=_0x17e28d['id'];if(_0x199e9f[_0x3b70('0x4f')][_0x3b70('0x3c')]){_0xa5e04c[_0x3b70('0x5e')]=_[_0x3b70('0x5b')](_0xa5e04c[_0x3b70('0x5e')],{'$or':_[_0x3b70('0x3e')](_0xa5e04c[_0x3b70('0x52')],function(_0x32bd26){var _0xa0d5c0={};_0xa0d5c0[_0x32bd26]={'$like':'%'+_0x199e9f['query'][_0x3b70('0x3c')]+'%'};return _0xa0d5c0;})});}_0xa5e04c=_[_0x3b70('0x5b')]({},_0xa5e04c,_0x199e9f[_0x3b70('0x62')]);return db[_0x3b70('0xd5')]['count']({'where':_0xa5e04c['where']})[_0x3b70('0x34')](function(_0x1aa256){_0x4dca58['count']=_0x1aa256;if(_0x199e9f[_0x3b70('0x4f')]['includeAll']){_0xa5e04c[_0x3b70('0x64')]=[{'all':!![]}];}return db[_0x3b70('0xd5')][_0x3b70('0x65')](_0xa5e04c);})[_0x3b70('0x34')](function(_0x5db38e){_0x4dca58['rows']=_0x5db38e;return _0x4dca58;});}})[_0x3b70('0x34')](respondWithFilteredResult(_0x328290,_0xa5e04c))['catch'](handleError(_0x328290,null));};exports[_0x3b70('0xd6')]=function(_0x8a3da8,_0x12c956,_0x78c245){var _0x3de526={};var _0x96b485={};var _0x4bd789;var _0x985822;return db[_0x3b70('0x49')][_0x3b70('0xbf')]({'where':{'id':_0x8a3da8[_0x3b70('0x6b')]['id']}})['then'](handleEntityNotFound(_0x12c956,null))['then'](function(_0x1c1e3f){if(_0x1c1e3f){_0x4bd789=_0x1c1e3f;_0x96b485['model']=_[_0x3b70('0x4c')](db[_0x3b70('0xd7')][_0x3b70('0x4a')]);_0x96b485[_0x3b70('0x4f')]=_[_0x3b70('0x4c')](_0x8a3da8[_0x3b70('0x4f')]);_0x96b485[_0x3b70('0x50')]=_['intersection'](_0x96b485['model'],_0x96b485['query']);_0x3de526[_0x3b70('0x52')]=_[_0x3b70('0x51')](_0x96b485['model'],qs[_0x3b70('0x53')](_0x8a3da8[_0x3b70('0x4f')]['fields']));_0x3de526['attributes']=_0x3de526[_0x3b70('0x52')]['length']?_0x3de526[_0x3b70('0x52')]:_0x96b485['model'];_0x3de526['order']=qs[_0x3b70('0x59')](_0x8a3da8[_0x3b70('0x4f')]['sort']);_0x3de526[_0x3b70('0x5e')]=qs['filters'](_[_0x3b70('0x5a')](_0x8a3da8[_0x3b70('0x4f')],_0x96b485[_0x3b70('0x50')]));if(_0x8a3da8['query']['filter']){_0x3de526[_0x3b70('0x5e')]=_['merge'](_0x3de526[_0x3b70('0x5e')],{'$or':_[_0x3b70('0x3e')](_0x3de526[_0x3b70('0x52')],function(_0x1c1895){var _0x288505={};_0x288505[_0x1c1895]={'$like':'%'+_0x8a3da8['query'][_0x3b70('0x3c')]+'%'};return _0x288505;})});}_0x3de526=_[_0x3b70('0x5b')]({},_0x3de526,_0x8a3da8[_0x3b70('0x62')]);return _0x4bd789[_0x3b70('0xd6')](_0x3de526);}})['then'](function(_0x35e8d0){if(_0x35e8d0){_0x985822=_0x35e8d0[_0x3b70('0x54')];if(!_0x8a3da8[_0x3b70('0x4f')][_0x3b70('0x55')](_0x3b70('0x56'))){_0x3de526[_0x3b70('0x57')]=qs[_0x3b70('0x57')](_0x8a3da8[_0x3b70('0x4f')][_0x3b70('0x57')]);_0x3de526[_0x3b70('0x2f')]=qs[_0x3b70('0x2f')](_0x8a3da8[_0x3b70('0x4f')]['offset']);}return _0x4bd789['getSmsInteractions'](_0x3de526);}})[_0x3b70('0x34')](function(_0x35e9ab){if(_0x35e9ab){return _0x35e9ab?{'count':_0x985822,'rows':_0x35e9ab}:null;}})[_0x3b70('0x34')](respondWithResult(_0x12c956,null))['catch'](handleError(_0x12c956,null));};exports[_0x3b70('0xd8')]=function(_0x5b3dc6,_0x14ae7e,_0x523bec){var _0x32f196={};var _0x1acd6d={};var _0x28c03c;var _0x5663d2;return db[_0x3b70('0x49')][_0x3b70('0xbf')]({'where':{'id':_0x5b3dc6['params']['id']}})[_0x3b70('0x34')](handleEntityNotFound(_0x14ae7e,null))[_0x3b70('0x34')](function(_0x310739){if(_0x310739){_0x28c03c=_0x310739;_0x1acd6d[_0x3b70('0x4b')]=_[_0x3b70('0x4c')](db[_0x3b70('0xd9')]['rawAttributes']);_0x1acd6d[_0x3b70('0x4f')]=_[_0x3b70('0x4c')](_0x5b3dc6[_0x3b70('0x4f')]);_0x1acd6d[_0x3b70('0x50')]=_[_0x3b70('0x51')](_0x1acd6d[_0x3b70('0x4b')],_0x1acd6d[_0x3b70('0x4f')]);_0x32f196[_0x3b70('0x52')]=_['intersection'](_0x1acd6d[_0x3b70('0x4b')],qs[_0x3b70('0x53')](_0x5b3dc6[_0x3b70('0x4f')][_0x3b70('0x53')]));_0x32f196[_0x3b70('0x52')]=_0x32f196[_0x3b70('0x52')][_0x3b70('0x54')]?_0x32f196[_0x3b70('0x52')]:_0x1acd6d['model'];_0x32f196[_0x3b70('0x58')]=qs[_0x3b70('0x59')](_0x5b3dc6['query']['sort']);_0x32f196[_0x3b70('0x5e')]=qs['filters'](_[_0x3b70('0x5a')](_0x5b3dc6[_0x3b70('0x4f')],_0x1acd6d[_0x3b70('0x50')]));if(_0x5b3dc6[_0x3b70('0x4f')]['filter']){_0x32f196[_0x3b70('0x5e')]=_[_0x3b70('0x5b')](_0x32f196[_0x3b70('0x5e')],{'$or':_[_0x3b70('0x3e')](_0x32f196[_0x3b70('0x52')],function(_0x1fb66b){var _0x49bb34={};_0x49bb34[_0x1fb66b]={'$like':'%'+_0x5b3dc6[_0x3b70('0x4f')][_0x3b70('0x3c')]+'%'};return _0x49bb34;})});}_0x32f196=_[_0x3b70('0x5b')]({},_0x32f196,_0x5b3dc6[_0x3b70('0x62')]);return _0x28c03c[_0x3b70('0xd8')](_0x32f196);}})[_0x3b70('0x34')](function(_0x5b7382){if(_0x5b7382){_0x5663d2=_0x5b7382['length'];if(!_0x5b3dc6['query'][_0x3b70('0x55')]('nolimit')){_0x32f196['limit']=qs[_0x3b70('0x57')](_0x5b3dc6['query'][_0x3b70('0x57')]);_0x32f196[_0x3b70('0x2f')]=qs[_0x3b70('0x2f')](_0x5b3dc6[_0x3b70('0x4f')][_0x3b70('0x2f')]);}return _0x28c03c[_0x3b70('0xd8')](_0x32f196);}})[_0x3b70('0x34')](function(_0x411d4a){if(_0x411d4a){return _0x411d4a?{'count':_0x5663d2,'rows':_0x411d4a}:null;}})[_0x3b70('0x34')](respondWithResult(_0x14ae7e,null))[_0x3b70('0x29')](handleError(_0x14ae7e,null));};exports['login']=function(_0x567ef6,_0x3a920f,_0x468799){var _0xee237b;var _0x194da7;var _0x570b8d;var _0xc3c71c=!_[_0x3b70('0x76')](_0x567ef6[_0x3b70('0x6b')]['id'])?_0x567ef6[_0x3b70('0x6b')]['id']:!_[_0x3b70('0x76')](_0x567ef6[_0x3b70('0x37')]['id'])?_0x567ef6[_0x3b70('0x37')]['id']:null;return db[_0x3b70('0x49')]['find']({'where':{'id':_0xc3c71c,'role':'agent'},'attributes':['id',_0x3b70('0x46'),_0x3b70('0xda'),_0x3b70('0xdb'),_0x3b70('0x41'),_0x3b70('0x78'),_0x3b70('0xa0')]})[_0x3b70('0x34')](handleEntityNotFound(_0x3a920f,null))[_0x3b70('0x34')](function(_0x5c7d5b){if(_0x5c7d5b){_0xee237b=_0x5c7d5b;if(_0x567ef6[_0x3b70('0x6a')][_0x3b70('0xa2')]){_0x570b8d=util[_0x3b70('0xac')](_0x3b70('0xdc'),_0xee237b[_0x567ef6[_0x3b70('0x6a')]['interface']]);}else if(_0x567ef6['body'][_0x3b70('0xdd')]){_0x570b8d=util[_0x3b70('0xac')](_0x3b70('0xad'),_0x567ef6['body']['intrf']);}else{_0x570b8d=util[_0x3b70('0xac')](_0x3b70('0xad'),_0xee237b[_0x3b70('0x46')]);}socket['to'](util[_0x3b70('0xac')](_0x3b70('0xde'),_0xee237b[_0x3b70('0x46')]))['emit'](_0x3b70('0xdf'),{'ip':_0x567ef6['headers']['x-forwarded-for']||_0x567ef6[_0x3b70('0xe0')][_0x3b70('0xe1')]||_0x567ef6[_0x3b70('0xe2')][_0x3b70('0xe1')]||_0x567ef6[_0x3b70('0xe0')][_0x3b70('0xe2')]['remoteAddress']});return db[_0x3b70('0xae')][_0x3b70('0x44')]({'where':{'membername':_0xee237b[_0x3b70('0x46')]},'individualHooks':!![]});}})[_0x3b70('0x34')](function(_0x4fb346){if(_0xee237b){return _0xee237b[_0x3b70('0xe3')]({'raw':!![]});}})[_0x3b70('0x34')](function(_0x68ff5e){var _0x197c2b=[];if(_0x68ff5e){_0x194da7=_0x68ff5e;if(_0x194da7[_0x3b70('0x54')]){for(var _0x441038=0x0;_0x441038<_0x194da7[_0x3b70('0x54')];_0x441038++){_0x197c2b[_0x3b70('0xe4')]({'membername':_0xee237b['name'],'UserId':_0xee237b['id'],'queue_name':_0x194da7[_0x441038][_0x3b70('0x46')],'VoiceQueueId':_0x194da7[_0x441038]['id'],'interface':_0x570b8d,'paused':_0xee237b['loginInPause']||![],'penalty':_0x194da7[_0x441038][_0x3b70('0xe5')]||0x0});}return BPromise['each'](_0x197c2b,function(_0x4ef0c8){return db[_0x3b70('0xae')][_0x3b70('0xaf')](_0x4ef0c8);});}}})[_0x3b70('0x34')](function(){return db[_0x3b70('0xe6')]['findAll']({'where':{'membername':_0xee237b[_0x3b70('0x46')],'exitAt':null}});})[_0x3b70('0x34')](function(_0x31120c){var _0x47b6b9=[];_0x31120c[_0x3b70('0xe7')](function(_0x421429){_0x47b6b9['push'](_0x421429['update']({'exitAt':moment()[_0x3b70('0xac')](_0x3b70('0xe8'))}));});return BPromise[_0x3b70('0xe9')](_0x47b6b9);})[_0x3b70('0x34')](function(){var _0x252318=[];var _0x1764c1=[];var _0x42a2b3=utils[_0x3b70('0xea')]();var _0x583199={'membername':_0xee237b['name'],'interface':_0x570b8d,'enterAt':moment()[_0x3b70('0xac')](_0x3b70('0xe8')),'role':_0xee237b[_0x3b70('0x41')],'internal':_0xee237b['internal']};_0x42a2b3[_0x3b70('0xe7')](function(_0xee0063){_0x252318[_0x3b70('0xe4')](_[_0x3b70('0x5b')]({'channel':_0xee0063,'type':'LOGIN','data1':_0x567ef6['body'][_0x3b70('0xeb')],'data2':_0x570b8d},_0x583199));if(_0xee237b[_0x3b70('0xa0')]){_0x1764c1[_0x3b70('0xe4')](_['merge']({'channel':_0xee0063,'type':'PAUSE','data1':_0x3b70('0xec')},_0x583199));}});return db[_0x3b70('0xe6')][_0x3b70('0x69')](_0x252318[_0x3b70('0xed')](_0x1764c1),{'individualHooks':!![]});})[_0x3b70('0x34')](function(){return _0xee237b[_0x3b70('0x33')]({'online':!![],'lastLoginAt':moment()[_0x3b70('0xac')](_0x3b70('0xe8')),'voicePause':_0xee237b['loginInPause']||![],'mailPause':_0xee237b['loginInPause']||![],'chatPause':_0xee237b[_0x3b70('0xa0')]||![],'faxPause':_0xee237b[_0x3b70('0xa0')]||![],'smsPause':_0xee237b[_0x3b70('0xa0')]||![],'openchannelPause':_0xee237b[_0x3b70('0xa0')]||![],'pauseType':_0xee237b[_0x3b70('0xa0')]?_0x3b70('0xec'):null,'interface':_0x570b8d,'lastPauseAt':moment()[_0x3b70('0xac')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x3b70('0x34')](function(_0x46814e){if(_0x567ef6[_0x3b70('0xee')]){return _0x468799();}else{return BPromise[_0x3b70('0xef')](_0x46814e)[_0x3b70('0x34')](respondWithResult(_0x3a920f,null));}})['catch'](handleError(_0x3a920f,null));};exports[_0x3b70('0xf0')]=function(_0x48a50d,_0xc48507,_0x49a1c8){var _0x110218;return db['User']['find']({'where':{'id':_0x48a50d['params']['id'],'role':_0x3b70('0x39')},'attributes':['id','name',_0x3b70('0x41')]})[_0x3b70('0x34')](handleEntityNotFound(_0xc48507,null))['then'](function(_0x4eca21){if(_0x4eca21){_0x110218=_0x4eca21;return db[_0x3b70('0xae')]['destroy']({'where':{'membername':_0x110218['name']},'individualHooks':!![]});}})[_0x3b70('0x34')](function(){return db['MemberReport'][_0x3b70('0x65')]({'where':{'membername':_0x110218[_0x3b70('0x46')],'exitAt':null}});})[_0x3b70('0x34')](function(_0x3bba3d){var _0x38b8aa=[];_0x3bba3d[_0x3b70('0xe7')](function(_0x4b7e53){_0x38b8aa[_0x3b70('0xe4')](_0x4b7e53[_0x3b70('0x33')]({'exitAt':moment()['format'](_0x3b70('0xe8'))}));});return BPromise[_0x3b70('0xe9')](_0x38b8aa);})[_0x3b70('0x34')](function(){return _0x110218[_0x3b70('0x33')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})['then'](respondWithResult(_0xc48507,null))[_0x3b70('0x29')](handleError(_0xc48507,null));};exports[_0x3b70('0xf1')]=function(_0x1e7aa6,_0x36a45e,_0xf0a133){var _0x43163d;return db['UserVoiceQueueRt'][_0x3b70('0x33')]({'paused':0x1},{'where':{'UserId':_0x1e7aa6['params']['id']},'individualHooks':!![]})['then'](function(){return db['User'][_0x3b70('0x42')]({'where':{'id':_0x1e7aa6[_0x3b70('0x6b')]['id'],'role':_0x3b70('0x39')},'attributes':['id',_0x3b70('0x46'),_0x3b70('0x41'),_0x3b70('0x78'),_0x3b70('0xa2')]});})[_0x3b70('0x34')](handleEntityNotFound(_0x36a45e,null))[_0x3b70('0x34')](function(_0x4eda12){if(_0x4eda12){_0x43163d=_0x4eda12;return respondWithRpcPromise('QueuePause',_0x3b70('0xf1'),{'id':_0x43163d['id'],'name':_0x43163d[_0x3b70('0x46')],'pause':!![]});}})[_0x3b70('0x34')](function(){if(_0x43163d){return db[_0x3b70('0xe6')][_0x3b70('0x65')]({'where':{'membername':_0x43163d[_0x3b70('0x46')],'type':_0x3b70('0xf2'),'exitAt':null}});}})[_0x3b70('0x34')](function(_0x10712a){if(_0x10712a[_0x3b70('0x54')]){var _0x173745=moment()[_0x3b70('0xac')](_0x3b70('0xe8'));for(var _0x1ee831=0x0,_0x11179f=_0x10712a[_0x3b70('0x54')];_0x1ee831<_0x11179f;_0x1ee831++){_0x10712a[_0x1ee831][_0x3b70('0xf3')]({'exitAt':_0x173745});}}})[_0x3b70('0x34')](function(){var _0x52321c=[];var _0x52dc69=utils[_0x3b70('0xea')]();_0x52dc69[_0x3b70('0xe7')](function(_0x185179){_0x52321c[_0x3b70('0xe4')]({'channel':_0x185179,'membername':_0x43163d[_0x3b70('0x46')],'interface':_[_0x3b70('0x76')](_0x43163d[_0x3b70('0xa2')])?util[_0x3b70('0xac')]('SIP/%s',_0x43163d[_0x3b70('0x46')]):_0x43163d['interface'],'type':'PAUSE','enterAt':moment()[_0x3b70('0xac')](_0x3b70('0xe8')),'data1':_0x1e7aa6[_0x3b70('0x6a')][_0x3b70('0xf4')]||_0x3b70('0xf5'),'role':_0x43163d[_0x3b70('0x41')],'internal':_0x43163d[_0x3b70('0x78')]});});return db['MemberReport'][_0x3b70('0x69')](_0x52321c,{'individualHooks':!![]});})[_0x3b70('0x34')](function(){return _0x43163d['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x1e7aa6['body'][_0x3b70('0xf4')]||_0x3b70('0xf5'),'lastPauseAt':moment()[_0x3b70('0xac')](_0x3b70('0xe8'))});})[_0x3b70('0x34')](respondWithResult(_0x36a45e,null))[_0x3b70('0x29')](handleError(_0x36a45e,null));};exports['unpause']=function(_0x1a1f1e,_0x215b63,_0x1201f0){var _0x234777;return db[_0x3b70('0x49')][_0x3b70('0x42')]({'where':{'id':_0x1a1f1e[_0x3b70('0x6b')]['id']},'attributes':['id',_0x3b70('0x46'),_0x3b70('0x41'),_0x3b70('0xa1'),_0x3b70('0xf6'),_0x3b70('0xf7'),'faxPause',_0x3b70('0xf8'),_0x3b70('0xf9'),'pauseType',_0x3b70('0xfa')]})[_0x3b70('0x34')](handleEntityNotFound(_0x215b63,null))[_0x3b70('0x34')](function(_0x2ca985){if(_0x2ca985){_0x234777=_0x2ca985;if(_0x1a1f1e['body'][_0x3b70('0x9f')]&&!utils[_0x3b70('0xb1')](_0x1a1f1e[_0x3b70('0x6a')][_0x3b70('0x9f')])){throw new db[(_0x3b70('0x98'))][(_0x3b70('0x99'))]('Unknown\x20channel');}switch(_0x1a1f1e[_0x3b70('0x6a')][_0x3b70('0x9f')]){case _0x3b70('0xaa'):return respondWithRpcPromise(_0x3b70('0xfb'),_0x3b70('0xfc'),{'id':_0x234777['id'],'name':_0x234777[_0x3b70('0x46')],'pause':![]})[_0x3b70('0x34')](function(){return db[_0x3b70('0xae')]['update']({'paused':0x0},{'where':{'UserId':_0x234777['id']},'individualHooks':!![]});})[_0x3b70('0x34')](function(){return db[_0x3b70('0xe6')]['find']({'where':{'channel':_0x1a1f1e[_0x3b70('0x6a')][_0x3b70('0x9f')],'membername':_0x234777[_0x3b70('0x46')],'type':_0x3b70('0xf2'),'exitAt':null}});})[_0x3b70('0x34')](function(_0x537e04){if(_0x537e04){return _0x537e04[_0x3b70('0x33')]({'exitAt':moment()[_0x3b70('0xac')](_0x3b70('0xe8')),'data2':_0x3b70('0xfd')},{'individualHooks':!![]});}return null;})[_0x3b70('0x34')](function(){return _0x234777[_0x3b70('0x33')]({'voicePause':![]});});case _0x3b70('0xfe'):case _0x3b70('0xff'):case _0x3b70('0x100'):case _0x3b70('0x101'):case'openchannel':return db[_0x3b70('0xe6')][_0x3b70('0x42')]({'where':{'channel':_0x1a1f1e[_0x3b70('0x6a')][_0x3b70('0x9f')],'membername':_0x234777[_0x3b70('0x46')],'type':'PAUSE','exitAt':null}})[_0x3b70('0x34')](function(_0x11e37d){if(_0x11e37d){return _0x11e37d[_0x3b70('0x33')]({'exitAt':moment()[_0x3b70('0xac')](_0x3b70('0xe8')),'data2':_0x3b70('0xfd')},{'individualHooks':!![]});}return null;})[_0x3b70('0x34')](function(){var _0x5cfdc3={};_[_0x3b70('0x102')](_0x5cfdc3,util[_0x3b70('0xac')]('%s%s',_0x1a1f1e[_0x3b70('0x6a')]['channel'],_0x3b70('0x103')),![]);return _0x234777['update'](_0x5cfdc3);});default:return respondWithRpcPromise(_0x3b70('0xfb'),_0x3b70('0xfc'),{'id':_0x234777['id'],'name':_0x234777[_0x3b70('0x46')],'pause':![]})['then'](function(){return db[_0x3b70('0xae')]['update']({'paused':0x0},{'where':{'UserId':_0x234777['id']}});})[_0x3b70('0x34')](function(){return db[_0x3b70('0xe6')]['findAll']({'where':{'membername':_0x234777[_0x3b70('0x46')],'type':'PAUSE','exitAt':null}});})[_0x3b70('0x34')](function(_0x3290f){var _0x463d6f=[];_0x3290f[_0x3b70('0xe7')](function(_0x5c3efe){_0x463d6f[_0x3b70('0xe4')](_0x5c3efe[_0x3b70('0x33')]({'exitAt':moment()[_0x3b70('0xac')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x3b70('0xfd')}));});return BPromise[_0x3b70('0xe9')](_0x463d6f);})[_0x3b70('0x34')](function(){return _0x234777['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x3b70('0x34')](respondWithResult(_0x215b63,null))[_0x3b70('0x29')](handleError(_0x215b63,null));};exports[_0x3b70('0x104')]=function(_0x3469cd,_0x29daa3,_0x263bae){var _0x4670b6={};var _0x565831={};var _0x1d3480;var _0x274e72;return db[_0x3b70('0x49')][_0x3b70('0xbf')]({'where':{'id':_0x3469cd[_0x3b70('0x6b')]['id']}})[_0x3b70('0x34')](handleEntityNotFound(_0x29daa3,null))[_0x3b70('0x34')](function(_0x211e01){if(_0x211e01){_0x1d3480=_0x211e01;_0x565831[_0x3b70('0x4b')]=_['keys'](db[_0x3b70('0x105')][_0x3b70('0x4a')]);_0x565831[_0x3b70('0x4f')]=_[_0x3b70('0x4c')](_0x3469cd['query']);_0x565831[_0x3b70('0x50')]=_[_0x3b70('0x51')](_0x565831[_0x3b70('0x4b')],_0x565831[_0x3b70('0x4f')]);_0x4670b6[_0x3b70('0x52')]=_['intersection'](_0x565831['model'],qs['fields'](_0x3469cd[_0x3b70('0x4f')][_0x3b70('0x53')]));_0x4670b6['attributes']=_0x4670b6[_0x3b70('0x52')][_0x3b70('0x54')]?_0x4670b6[_0x3b70('0x52')]:_0x565831[_0x3b70('0x4b')];_0x4670b6[_0x3b70('0x58')]=qs[_0x3b70('0x59')](_0x3469cd['query']['sort']);_0x4670b6['where']=qs[_0x3b70('0x50')](_[_0x3b70('0x5a')](_0x3469cd['query'],_0x565831[_0x3b70('0x50')]));if(_0x3469cd[_0x3b70('0x4f')][_0x3b70('0x3c')]){_0x4670b6[_0x3b70('0x5e')]=_[_0x3b70('0x5b')](_0x4670b6['where'],{'$or':_[_0x3b70('0x3e')](_0x4670b6[_0x3b70('0x52')],function(_0x5f36d1){var _0x188b74={};_0x188b74[_0x5f36d1]={'$like':'%'+_0x3469cd[_0x3b70('0x4f')][_0x3b70('0x3c')]+'%'};return _0x188b74;})});}_0x4670b6=_['merge']({},_0x4670b6,_0x3469cd[_0x3b70('0x62')]);return _0x1d3480[_0x3b70('0x104')](_0x4670b6);}})[_0x3b70('0x34')](function(_0x2455ec){if(_0x2455ec){_0x274e72=_0x2455ec[_0x3b70('0x54')];if(!_0x3469cd[_0x3b70('0x4f')]['hasOwnProperty'](_0x3b70('0x56'))){_0x4670b6['limit']=qs[_0x3b70('0x57')](_0x3469cd[_0x3b70('0x4f')][_0x3b70('0x57')]);_0x4670b6[_0x3b70('0x2f')]=qs[_0x3b70('0x2f')](_0x3469cd[_0x3b70('0x4f')]['offset']);}return _0x1d3480['getTeams'](_0x4670b6);}})['then'](function(_0x7275b6){if(_0x7275b6){return _0x7275b6?{'count':_0x274e72,'rows':_0x7275b6}:null;}})['then'](respondWithResult(_0x29daa3,null))[_0x3b70('0x29')](handleError(_0x29daa3,null));};exports[_0x3b70('0x106')]=function(_0x5db775,_0x201ddf,_0x2f466f){return db[_0x3b70('0x49')][_0x3b70('0x42')]({'where':{'id':_0x5db775[_0x3b70('0x6b')]['id']}})[_0x3b70('0x34')](handleEntityNotFound(_0x201ddf,null))[_0x3b70('0x34')](function(_0x229491){if(_0x229491){return _0x229491['addTeams'](_0x5db775[_0x3b70('0x6a')][_0x3b70('0x6e')],_[_0x3b70('0x6f')](_0x5db775[_0x3b70('0x6a')],['ids','id'])||{});}})['then'](respondWithResult(_0x201ddf,null))[_0x3b70('0x29')](handleError(_0x201ddf,null));};exports[_0x3b70('0x107')]=function(_0x2966d8,_0x5c99be,_0x419e1c){return db[_0x3b70('0x49')][_0x3b70('0x42')]({'where':{'id':_0x2966d8[_0x3b70('0x6b')]['id']}})[_0x3b70('0x34')](handleEntityNotFound(_0x5c99be,null))[_0x3b70('0x34')](function(_0x9747ce){if(_0x9747ce){return _0x9747ce[_0x3b70('0x107')](_0x2966d8[_0x3b70('0x4f')]['ids']);}})[_0x3b70('0x34')](respondWithStatusCode(_0x5c99be,null))[_0x3b70('0x29')](handleError(_0x5c99be,null));};exports[_0x3b70('0x108')]=function(_0xd00cc6,_0x279caa,_0x5e22d4){var _0x394702={};var _0x4bb2a8={};var _0x17c985;var _0x243c7a;return db[_0x3b70('0x49')][_0x3b70('0xbf')]({'where':{'id':_0xd00cc6[_0x3b70('0x6b')]['id']}})['then'](handleEntityNotFound(_0x279caa,null))[_0x3b70('0x34')](function(_0x16f9a4){if(_0x16f9a4){_0x17c985=_0x16f9a4;_0x4bb2a8['model']=_['keys'](db[_0x3b70('0xc1')][_0x3b70('0x4a')]);_0x4bb2a8[_0x3b70('0x4f')]=_[_0x3b70('0x4c')](_0xd00cc6[_0x3b70('0x4f')]);_0x4bb2a8['filters']=_['intersection'](_0x4bb2a8[_0x3b70('0x4b')],_0x4bb2a8[_0x3b70('0x4f')]);_0x394702[_0x3b70('0x52')]=_['intersection'](_0x4bb2a8['model'],qs['fields'](_0xd00cc6['query'][_0x3b70('0x53')]));_0x394702[_0x3b70('0x52')]=_0x394702[_0x3b70('0x52')]['length']?_0x394702[_0x3b70('0x52')]:_0x4bb2a8[_0x3b70('0x4b')];_0x394702['order']=qs['sort'](_0xd00cc6[_0x3b70('0x4f')][_0x3b70('0x59')]);_0x394702[_0x3b70('0x5e')]=qs['filters'](_[_0x3b70('0x5a')](_0xd00cc6[_0x3b70('0x4f')],_0x4bb2a8[_0x3b70('0x50')]));if(_0xd00cc6['query'][_0x3b70('0x3c')]){_0x394702['where']=_['merge'](_0x394702[_0x3b70('0x5e')],{'$or':_[_0x3b70('0x3e')](_0x394702['attributes'],function(_0x95e7b3){var _0x3925d8={};_0x3925d8[_0x95e7b3]={'$like':'%'+_0xd00cc6[_0x3b70('0x4f')]['filter']+'%'};return _0x3925d8;})});}_0x394702=_['merge']({},_0x394702,_0xd00cc6[_0x3b70('0x62')]);return _0x17c985[_0x3b70('0x108')](_0x394702);}})[_0x3b70('0x34')](function(_0x5cd5b5){if(_0x5cd5b5){_0x243c7a=_0x5cd5b5[_0x3b70('0x54')];if(!_0xd00cc6['query'][_0x3b70('0x55')](_0x3b70('0x56'))){_0x394702[_0x3b70('0x57')]=qs['limit'](_0xd00cc6[_0x3b70('0x4f')][_0x3b70('0x57')]);_0x394702[_0x3b70('0x2f')]=qs[_0x3b70('0x2f')](_0xd00cc6[_0x3b70('0x4f')]['offset']);}return _0x17c985[_0x3b70('0x108')](_0x394702);}})[_0x3b70('0x34')](function(_0x3d11af){if(_0x3d11af){return _0x3d11af?{'count':_0x243c7a,'rows':_0x3d11af}:null;}})[_0x3b70('0x34')](respondWithResult(_0x279caa,null))[_0x3b70('0x29')](handleError(_0x279caa,null));};exports[_0x3b70('0x109')]=function(_0x3fc95b,_0x201ad6,_0x25c4d7){var _0x316605={};var _0x1cb016={};var _0x5f0930;var _0x31d024;return db['User']['findOne']({'where':{'id':_0x3fc95b[_0x3b70('0x6b')]['id']}})[_0x3b70('0x34')](handleEntityNotFound(_0x201ad6,null))['then'](function(_0x1569a8){if(_0x1569a8){_0x5f0930=_0x1569a8;_0x1cb016[_0x3b70('0x4b')]=_['keys'](db['User'][_0x3b70('0x4a')]);_0x1cb016[_0x3b70('0x4f')]=_[_0x3b70('0x4c')](_0x3fc95b[_0x3b70('0x4f')]);_0x1cb016[_0x3b70('0x50')]=_[_0x3b70('0x51')](_0x1cb016[_0x3b70('0x4b')],_0x1cb016[_0x3b70('0x4f')]);_0x316605[_0x3b70('0x52')]=_['intersection'](_0x1cb016[_0x3b70('0x4b')],qs['fields'](_0x3fc95b['query'][_0x3b70('0x53')]));_0x316605[_0x3b70('0x52')]=_0x316605[_0x3b70('0x52')][_0x3b70('0x54')]?_0x316605[_0x3b70('0x52')]:_0x1cb016['model'];_0x316605[_0x3b70('0x58')]=qs[_0x3b70('0x59')](_0x3fc95b['query'][_0x3b70('0x59')]);_0x316605[_0x3b70('0x5e')]=qs[_0x3b70('0x50')](_[_0x3b70('0x5a')](_0x3fc95b[_0x3b70('0x4f')],_0x1cb016[_0x3b70('0x50')]));if(_0x3fc95b['query'][_0x3b70('0x3c')]){_0x316605['where']=_[_0x3b70('0x5b')](_0x316605['where'],{'$or':_[_0x3b70('0x3e')](_0x316605[_0x3b70('0x52')],function(_0x1d8d2a){var _0x512d28={};_0x512d28[_0x1d8d2a]={'$like':'%'+_0x3fc95b[_0x3b70('0x4f')]['filter']+'%'};return _0x512d28;})});}_0x316605[_0x3b70('0x4b')]=db[_0x3b70('0x49')];_0x316605['as']='Agents';_0x316605=_[_0x3b70('0x5b')]({},_0x316605,_0x3fc95b[_0x3b70('0x62')]);return _0x5f0930[_0x3b70('0xe3')]({'include':[_0x316605]});}})[_0x3b70('0x34')](function(_0x5a77a5){if(_0x5a77a5){var _0x4e1bac={},_0x2f4ea6=[],_0x50fc94=0x0;for(var _0x3fea3b=0x0;_0x3fea3b<_0x5a77a5[_0x3b70('0x54')];_0x3fea3b+=0x1){for(var _0x54ee30=0x0,_0xadbf18;_0x54ee30<_0x5a77a5[_0x3fea3b][_0x3b70('0x38')][_0x3b70('0x54')];_0x54ee30+=0x1){_0xadbf18=_0x5a77a5[_0x3fea3b][_0x3b70('0x38')][_0x54ee30][_0x3b70('0x35')]({'plain':!![]});_0x4e1bac[_0xadbf18['id']]=_0xadbf18;}}_0x4e1bac=_[_0x3b70('0x10a')](_0x4e1bac);for(var _0x39bb10=qs['offset'](_0x3fc95b['query'][_0x3b70('0x2f')]);_0x39bb10<_0x4e1bac[_0x3b70('0x54')]&&_0x2f4ea6[_0x3b70('0x54')]=_0x165fe9[_0xbb10('0x55')]){throw new Error(_0xbb10('0x56'));}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db['UserVoiceQueueRt'][_0xbb10('0x4e')]({'where':{'membername':_0xd9e743[_0xbb10('0x2a')]},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743[_0xbb10('0x57')]({'raw':!![]});}})[_0xbb10('0x11')](function(_0x27f42f){if(_0xd9e743){if(_0x27f42f){var _0x174395=[];_0x3a9677=_0x27f42f;if(_0x3a9677['length']){for(var _0x387b10=0x0;_0x387b10<_0x3a9677[_0xbb10('0x4f')];_0x387b10++){_0x174395[_0xbb10('0x34')](db[_0xbb10('0x2d')][_0xbb10('0x58')]({'membername':_0xd9e743[_0xbb10('0x2a')],'UserId':_0xd9e743['id'],'queue_name':_0x3a9677[_0x387b10][_0xbb10('0x2a')],'VoiceQueueId':_0x3a9677[_0x387b10]['id'],'interface':_0x1ad2ed,'paused':_0xd9e743[_0xbb10('0x51')]||![],'penalty':_0x3a9677[_0x387b10]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xbb10('0x4c')](_0x174395);}}}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db[_0xbb10('0x2e')]['findAll']({'where':{'membername':_0xd9e743['name'],'exitAt':null}});}})['then'](function(_0x23286d){if(_0xd9e743){if(_0x23286d&&_0x23286d['length']){var _0x4e3d6a=[];_0x23286d[_0xbb10('0x33')](function(_0x3ee56b){_0x4e3d6a[_0xbb10('0x34')](_0x3ee56b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x4e3d6a);}}})[_0xbb10('0x11')](function(_0x188b97){if(_0xd9e743){var _0x5206e1=[];var _0x318a14=[];var _0x1351eb=utils[_0xbb10('0x32')]();var _0x35b811={'membername':_0xd9e743['name'],'interface':_0x1ad2ed,'enterAt':moment()['format'](_0xbb10('0x38')),'role':_0xd9e743[_0xbb10('0x2b')],'internal':_0xd9e743[_0xbb10('0x3b')]};_0x1351eb[_0xbb10('0x33')](function(_0x5ee705){_0x5206e1[_0xbb10('0x34')](_[_0xbb10('0x59')]({'channel':_0x5ee705,'type':_0xbb10('0x5a'),'data1':_0xbb10('0x5b'),'data2':_0x1ad2ed},_0x35b811));if(_0xd9e743[_0xbb10('0x51')]){_0x318a14['push'](_['merge']({'channel':_0x5ee705,'type':_0xbb10('0x37'),'data1':_0xbb10('0x5c')},_0x35b811));}});return db[_0xbb10('0x2e')]['bulkCreate'](_0x5206e1[_0xbb10('0x5d')](_0x318a14),{'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743['update']({'online':!![],'lastLoginAt':moment()['format'](_0xbb10('0x38')),'voicePause':_0xd9e743[_0xbb10('0x51')]||![],'mailPause':_0xd9e743[_0xbb10('0x51')]||![],'chatPause':_0xd9e743['loginInPause']||![],'faxPause':_0xd9e743[_0xbb10('0x51')]||![],'smsPause':_0xd9e743[_0xbb10('0x51')]||![],'openchannelPause':_0xd9e743[_0xbb10('0x51')]||![],'pauseType':_0xd9e743[_0xbb10('0x51')]?_0xbb10('0x5c'):null,'lastPauseAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'interface':_0x1ad2ed});}})[_0xbb10('0x11')](function(_0x3e6246){_0x46f462(_0x3e6246);})['catch'](function(_0x3367d4){_0x1b11c0(_0x5cd089[_0xbb10('0x17')](0x1f4,_0x3367d4[_0xbb10('0x1a')]));});});}; \ No newline at end of file +var _0x5f2f=['set','%s%s','Pause','all','LogoutUser','findOne','destroy','LoginUser','mobile','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','loginInPause','UserVoiceQueue.penalty','LOGIN','callysquare','merge','LOGININPAUSE','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','User','findAll','options','raw','where','attributes','limit','include','map','model','GetUser','find','ShowUser','PauseUser','name','role','internal','interface','UserVoiceQueueRt','update','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','body','type','DEFAULT\x20PAUSE','MemberReport','bulkCreate','isValidChannel','channel','Unknown\x20channel','voice','system','mail','chat','fax','openchannel'];(function(_0x717bcf,_0xdce5f6){var _0x1cbd25=function(_0x25a310){while(--_0x25a310){_0x717bcf['push'](_0x717bcf['shift']());}};_0x1cbd25(++_0xdce5f6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x43a803,_0x5b1925){_0x43a803=_0x43a803-0x0;var _0x2ffba4=_0x5f2f[_0x43a803];return _0x2ffba4;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./user.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['GetUser']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')]({'raw':_0x34706d['options']?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![],'where':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x21')]||null:null,'attributes':_0x34706d['options']?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x22')]||null:null,'limit':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x23')]||null:null,'include':_0x34706d['options']?_0x34706d['options'][_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x24')],function(_0xf6c58d){return{'model':db[_0xf6c58d[_0xf5f2('0x26')]],'as':_0xf6c58d['as'],'attributes':_0xf6c58d[_0xf5f2('0x22')],'include':_0xf6c58d[_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0xf6c58d['include'],function(_0xaa2602){return{'model':db[_0xaa2602[_0xf5f2('0x26')]],'as':_0xaa2602['as'],'attributes':_0xaa2602[_0xf5f2('0x22')],'include':_0xaa2602[_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0xaa2602[_0xf5f2('0x24')],function(_0x5b6672){return{'model':db[_0x5b6672['model']],'as':_0x5b6672['as'],'attributes':_0x5b6672[_0xf5f2('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x11')](function(_0x11c771){logger['info']('GetUser',_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x27'),_0x34706d,JSON[_0xf5f2('0x16')](_0x11c771));_0x49dac2(_0x11c771);})[_0xf5f2('0x1c')](function(_0x1b381e){logger['error']('GetUser',_0x1b381e[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e['error'](0x1f4,_0x1b381e[_0xf5f2('0x19')]));});});};exports['ShowUser']=function(_0x45b643){var _0x31087c=this;return new Promise(function(_0x7b6817,_0x428770){return db[_0xf5f2('0x1d')][_0xf5f2('0x28')]({'raw':_0x45b643[_0xf5f2('0x1f')]?_0x45b643[_0xf5f2('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x45b643[_0xf5f2('0x1f')]?_0x45b643[_0xf5f2('0x1f')][_0xf5f2('0x21')]||null:null,'attributes':_0x45b643[_0xf5f2('0x1f')]?_0x45b643[_0xf5f2('0x1f')][_0xf5f2('0x22')]||null:null,'include':_0x45b643[_0xf5f2('0x1f')]?_0x45b643['options'][_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0x45b643['options'][_0xf5f2('0x24')],function(_0x4b8c42){return{'model':db[_0x4b8c42[_0xf5f2('0x26')]],'as':_0x4b8c42['as'],'attributes':_0x4b8c42[_0xf5f2('0x22')],'include':_0x4b8c42[_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0x4b8c42['include'],function(_0x5a98d7){return{'model':db[_0x5a98d7[_0xf5f2('0x26')]],'as':_0x5a98d7['as'],'attributes':_0x5a98d7[_0xf5f2('0x22')],'include':_0x5a98d7[_0xf5f2('0x24')]?_['map'](_0x5a98d7[_0xf5f2('0x24')],function(_0x4f7f80){return{'model':db[_0x4f7f80[_0xf5f2('0x26')]],'as':_0x4f7f80['as'],'attributes':_0x4f7f80['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x11')](function(_0x456764){logger['info'](_0xf5f2('0x29'),_0x45b643);logger[_0xf5f2('0x14')](_0xf5f2('0x29'),_0x45b643,JSON[_0xf5f2('0x16')](_0x456764));_0x7b6817(_0x456764);})['catch'](function(_0x5d2d82){logger[_0xf5f2('0x17')](_0xf5f2('0x29'),_0x5d2d82[_0xf5f2('0x19')],_0x45b643);_0x428770(_0x31087c[_0xf5f2('0x17')](0x1f4,_0x5d2d82[_0xf5f2('0x19')]));});});};exports[_0xf5f2('0x2a')]=function(_0x2bc20e){var _0x4c0ac7=this;return new Promise(function(_0x110fe5,_0x3b4ea6){var _0x536501;return db[_0xf5f2('0x1d')][_0xf5f2('0x28')]({'where':_0x2bc20e[_0xf5f2('0x1f')][_0xf5f2('0x21')]||{},'attributes':['id',_0xf5f2('0x2b'),_0xf5f2('0x2c'),_0xf5f2('0x2d'),_0xf5f2('0x2e')]})['then'](function(_0x31c3c){if(_0x31c3c){_0x536501=_0x31c3c;return db[_0xf5f2('0x2f')][_0xf5f2('0x30')]({'paused':0x1},{'where':{'UserId':_0x536501['id']},'individualHooks':!![]});}})['then'](function(){if(_0x536501){return db['MemberReport']['findAll']({'where':{'membername':_0x536501[_0xf5f2('0x2b')],'type':_0xf5f2('0x31'),'exitAt':null}});}})['then'](function(_0x106272){if(_0x536501){if(_0x106272&&_0x106272[_0xf5f2('0x32')]){var _0x28e33f=moment()[_0xf5f2('0x33')](_0xf5f2('0x34'));for(var _0x2b3b1c=0x0,_0x1a6ec1=_0x106272[_0xf5f2('0x32')];_0x2b3b1c<_0x1a6ec1;_0x2b3b1c++){_0x106272[_0x2b3b1c][_0xf5f2('0x35')]({'exitAt':_0x28e33f});}}}})[_0xf5f2('0x11')](function(){if(_0x536501){var _0x444317=[];var _0x4773cd=utils[_0xf5f2('0x36')]();_0x4773cd[_0xf5f2('0x37')](function(_0x4faeed){_0x444317[_0xf5f2('0x38')]({'channel':_0x4faeed,'membername':_0x536501['name'],'interface':_[_0xf5f2('0x39')](_0x536501[_0xf5f2('0x2e')])?util[_0xf5f2('0x33')](_0xf5f2('0x3a'),_0x536501[_0xf5f2('0x2b')]):_0x536501[_0xf5f2('0x2e')],'type':'PAUSE','enterAt':moment()[_0xf5f2('0x33')](_0xf5f2('0x34')),'data1':_0x2bc20e[_0xf5f2('0x3b')][_0xf5f2('0x3c')]||_0xf5f2('0x3d'),'role':_0x536501[_0xf5f2('0x2c')],'internal':_0x536501[_0xf5f2('0x2d')],'uniqueid':_0x2bc20e[_0xf5f2('0x3b')]['uniqueid']||null});});return db[_0xf5f2('0x3e')][_0xf5f2('0x3f')](_0x444317,{'individualHooks':!![]});}})[_0xf5f2('0x11')](function(){if(_0x536501){return _0x536501['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x2bc20e[_0xf5f2('0x3b')][_0xf5f2('0x3c')]||_0xf5f2('0x3d'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xf5f2('0x11')](function(_0x27c472){_0x110fe5(_0x27c472);})['catch'](function(_0x14aa81){_0x3b4ea6(_0x4c0ac7['error'](0x1f4,_0x14aa81[_0xf5f2('0x19')]));});});};exports['UnpauseUser']=function(_0x2cbd9d){var _0x5d9120=this;return new Promise(function(_0x2d9017,_0xb8ea3a){var _0xbb658c;return db[_0xf5f2('0x1d')]['findOne']({'where':_0x2cbd9d[_0xf5f2('0x1f')][_0xf5f2('0x21')]||{},'attributes':['id','name']})['then'](function(_0xc3d4f){if(_0xc3d4f){_0xbb658c=_0xc3d4f;if(_0x2cbd9d[_0xf5f2('0x3b')]['channel']&&!utils[_0xf5f2('0x40')](_0x2cbd9d[_0xf5f2('0x3b')][_0xf5f2('0x41')])){throw new Error(_0xf5f2('0x42'));}switch(_0x2cbd9d['body']['channel']){case _0xf5f2('0x43'):return db[_0xf5f2('0x2f')]['update']({'paused':0x0},{'where':{'UserId':_0xbb658c['id']}})[_0xf5f2('0x11')](function(){return db[_0xf5f2('0x3e')][_0xf5f2('0x28')]({'where':{'channel':_0x2cbd9d[_0xf5f2('0x3b')][_0xf5f2('0x41')],'membername':_0xbb658c[_0xf5f2('0x2b')],'type':_0xf5f2('0x31'),'exitAt':null}});})['then'](function(_0x59e8ef){if(_0x59e8ef){return _0x59e8ef[_0xf5f2('0x30')]({'exitAt':moment()[_0xf5f2('0x33')](_0xf5f2('0x34')),'data2':_0xf5f2('0x44')},{'individualHooks':!![]});}return null;})[_0xf5f2('0x11')](function(){return _0xbb658c['update']({'voicePause':![]});});case _0xf5f2('0x45'):case _0xf5f2('0x46'):case _0xf5f2('0x47'):case'sms':case _0xf5f2('0x48'):return db['MemberReport'][_0xf5f2('0x28')]({'where':{'channel':_0x2cbd9d[_0xf5f2('0x3b')][_0xf5f2('0x41')],'membername':_0xbb658c[_0xf5f2('0x2b')],'type':'PAUSE','exitAt':null}})['then'](function(_0x756f1f){return _0x756f1f['update']({'exitAt':moment()[_0xf5f2('0x33')](_0xf5f2('0x34')),'data2':'system'},{'individualHooks':!![]});})[_0xf5f2('0x11')](function(){var _0xa4c0be={};_[_0xf5f2('0x49')](_0xa4c0be,util['format'](_0xf5f2('0x4a'),_0x2cbd9d[_0xf5f2('0x3b')][_0xf5f2('0x41')],_0xf5f2('0x4b')),![]);return _0xbb658c['update'](_0xa4c0be);});default:return db[_0xf5f2('0x2f')]['update']({'paused':0x0},{'where':{'UserId':_0xbb658c['id']}})[_0xf5f2('0x11')](function(){return db[_0xf5f2('0x3e')][_0xf5f2('0x1e')]({'where':{'membername':_0xbb658c[_0xf5f2('0x2b')],'type':_0xf5f2('0x31'),'exitAt':null}});})['then'](function(_0xda8dda){var _0xacd80=[];_0xda8dda[_0xf5f2('0x37')](function(_0x212639){_0xacd80[_0xf5f2('0x38')](_0x212639['update']({'exitAt':moment()[_0xf5f2('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'}));});return BPromise[_0xf5f2('0x4c')](_0xacd80);})['then'](function(){return _0xbb658c[_0xf5f2('0x30')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xf5f2('0x11')](function(_0x420784){_0x2d9017(_0x420784);})[_0xf5f2('0x1c')](function(_0x5767fc){_0xb8ea3a(_0x5d9120[_0xf5f2('0x17')](0x1f4,_0x5767fc[_0xf5f2('0x19')]));});});};exports[_0xf5f2('0x4d')]=function(_0x18c41f){var _0x15b680=this;return new Promise(function(_0x35d868,_0x158768){var _0x4a7be9;return db[_0xf5f2('0x1d')][_0xf5f2('0x4e')]({'where':_0x18c41f[_0xf5f2('0x1f')][_0xf5f2('0x21')]||{},'attributes':['id','name']})[_0xf5f2('0x11')](function(_0x4cce08){if(_0x4cce08){_0x4a7be9=_0x4cce08;return db[_0xf5f2('0x2f')][_0xf5f2('0x4f')]({'where':{'membername':_0x4a7be9['name']},'individualHooks':!![]});}})[_0xf5f2('0x11')](function(){if(_0x4a7be9){return db[_0xf5f2('0x3e')][_0xf5f2('0x1e')]({'where':{'membername':_0x4a7be9[_0xf5f2('0x2b')],'exitAt':null}});}})[_0xf5f2('0x11')](function(_0x4bd113){if(_0x4a7be9){if(_0x4bd113&&_0x4bd113[_0xf5f2('0x32')]){var _0x21c107=[];_0x4bd113[_0xf5f2('0x37')](function(_0xbf9f55){_0x21c107[_0xf5f2('0x38')](_0xbf9f55[_0xf5f2('0x30')]({'exitAt':moment()['format'](_0xf5f2('0x34'))}));});return BPromise[_0xf5f2('0x4c')](_0x21c107);}}})['then'](function(){if(_0x4a7be9){return _0x4a7be9[_0xf5f2('0x30')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xf5f2('0x11')](function(_0x377aad){_0x35d868(_0x377aad);})['catch'](function(_0x551cc9){_0x158768(_0x15b680['error'](0x1f4,_0x551cc9[_0xf5f2('0x19')]));});});};exports[_0xf5f2('0x50')]=function(_0x35f6a2){var _0x450691=this;return new Promise(function(_0x55da4d,_0x4d878e){var _0x278b76;var _0x3a98b4;var _0xc10cf3;var _0xe8a9b7;return db[_0xf5f2('0x1d')][_0xf5f2('0x4e')]({'where':_0x35f6a2[_0xf5f2('0x1f')][_0xf5f2('0x21')]||{},'attributes':['id',_0xf5f2('0x2b'),_0xf5f2('0x2c'),_0xf5f2('0x51'),'phone','internal','loginInPause',_0xf5f2('0x2e')]})[_0xf5f2('0x11')](function(_0x3d3181){if(_0x3d3181){_0x278b76=_0x3d3181;_0xe8a9b7=_0x35f6a2[_0xf5f2('0x3b')][_0xf5f2('0x2e')]?_0x35f6a2['body'][_0xf5f2('0x2e')]:util[_0xf5f2('0x33')](_0xf5f2('0x3a'),_0x278b76[_0xf5f2('0x2b')]);return db[_0xf5f2('0x1d')]['count']({'where':{'role':_0xf5f2('0x52'),'online':!![],'id':{'$ne':_0x278b76['id']}}});}})[_0xf5f2('0x11')](function(_0x517c15){if(_0x517c15){_0xc10cf3=_0x517c15;return require(_0xf5f2('0x53'))[_0xf5f2('0x54')]();}})[_0xf5f2('0x11')](function(_0x30ac41){if(_0x30ac41&&_0x30ac41['agents']&&_0xc10cf3>=_0x30ac41[_0xf5f2('0x55')]){throw new Error(_0xf5f2('0x56'));}})[_0xf5f2('0x11')](function(){if(_0x278b76){return db[_0xf5f2('0x2f')][_0xf5f2('0x4f')]({'where':{'membername':_0x278b76['name']},'individualHooks':!![]});}})['then'](function(){if(_0x278b76){return _0x278b76[_0xf5f2('0x57')]({'raw':!![]});}})[_0xf5f2('0x11')](function(_0x17eb69){if(_0x278b76){if(_0x17eb69){var _0xe3ea1e=[];_0x3a98b4=_0x17eb69;if(_0x3a98b4['length']){for(var _0x5a2f9f=0x0;_0x5a2f9f<_0x3a98b4[_0xf5f2('0x32')];_0x5a2f9f++){_0xe3ea1e['push'](db['UserVoiceQueueRt']['upsert']({'membername':_0x278b76['name'],'UserId':_0x278b76['id'],'queue_name':_0x3a98b4[_0x5a2f9f][_0xf5f2('0x2b')],'VoiceQueueId':_0x3a98b4[_0x5a2f9f]['id'],'interface':_0xe8a9b7,'paused':_0x278b76[_0xf5f2('0x58')]||![],'penalty':_0x3a98b4[_0x5a2f9f][_0xf5f2('0x59')]||0x0}));}return BPromise[_0xf5f2('0x4c')](_0xe3ea1e);}}}})[_0xf5f2('0x11')](function(){if(_0x278b76){return db[_0xf5f2('0x3e')][_0xf5f2('0x1e')]({'where':{'membername':_0x278b76[_0xf5f2('0x2b')],'exitAt':null}});}})[_0xf5f2('0x11')](function(_0x26b251){if(_0x278b76){if(_0x26b251&&_0x26b251[_0xf5f2('0x32')]){var _0x2afeac=[];_0x26b251[_0xf5f2('0x37')](function(_0x1680a6){_0x2afeac[_0xf5f2('0x38')](_0x1680a6[_0xf5f2('0x30')]({'exitAt':moment()[_0xf5f2('0x33')](_0xf5f2('0x34'))}));});return BPromise['all'](_0x2afeac);}}})[_0xf5f2('0x11')](function(_0x35299d){if(_0x278b76){var _0x21043b=[];var _0x2811ad=[];var _0x18c353=utils[_0xf5f2('0x36')]();var _0x16491c={'membername':_0x278b76[_0xf5f2('0x2b')],'interface':_0xe8a9b7,'enterAt':moment()['format'](_0xf5f2('0x34')),'role':_0x278b76['role'],'internal':_0x278b76['internal']};_0x18c353['forEach'](function(_0x53449e){_0x21043b['push'](_['merge']({'channel':_0x53449e,'type':_0xf5f2('0x5a'),'data1':_0xf5f2('0x5b'),'data2':_0xe8a9b7},_0x16491c));if(_0x278b76[_0xf5f2('0x58')]){_0x2811ad[_0xf5f2('0x38')](_[_0xf5f2('0x5c')]({'channel':_0x53449e,'type':_0xf5f2('0x31'),'data1':'LOGININPAUSE'},_0x16491c));}});return db['MemberReport'][_0xf5f2('0x3f')](_0x21043b['concat'](_0x2811ad),{'individualHooks':!![]});}})[_0xf5f2('0x11')](function(){if(_0x278b76){return _0x278b76[_0xf5f2('0x30')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x278b76[_0xf5f2('0x58')]||![],'mailPause':_0x278b76[_0xf5f2('0x58')]||![],'chatPause':_0x278b76['loginInPause']||![],'faxPause':_0x278b76[_0xf5f2('0x58')]||![],'smsPause':_0x278b76[_0xf5f2('0x58')]||![],'openchannelPause':_0x278b76['loginInPause']||![],'pauseType':_0x278b76[_0xf5f2('0x58')]?_0xf5f2('0x5d'):null,'lastPauseAt':moment()[_0xf5f2('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0xe8a9b7});}})[_0xf5f2('0x11')](function(_0xc28adc){_0x55da4d(_0xc28adc);})[_0xf5f2('0x1c')](function(_0x3247c4){_0x4d878e(_0x450691[_0xf5f2('0x17')](0x1f4,_0x3247c4[_0xf5f2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index ebf4da1..f69326c 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 _0x831f=['removeListener','register','length','user:','save','remove','update','emit'];(function(_0x1ac6e5,_0x40f47f){var _0x5877dc=function(_0x99caea){while(--_0x99caea){_0x1ac6e5['push'](_0x1ac6e5['shift']());}};_0x5877dc(++_0x40f47f);}(_0x831f,0x18c));var _0xf831=function(_0x2211b2,_0x3c32a7){_0x2211b2=_0x2211b2-0x0;var _0x1ff209=_0x831f[_0x2211b2];return _0x1ff209;};'use strict';var UserEvents=require('./user.events');var events=[_0xf831('0x0'),_0xf831('0x1'),_0xf831('0x2')];function createListener(_0x582f1b,_0x3ab6b0){return function(_0x2c0fc6){_0x3ab6b0[_0xf831('0x3')](_0x582f1b,_0x2c0fc6);};}function removeListener(_0x223167,_0x535894){return function(){UserEvents[_0xf831('0x4')](_0x223167,_0x535894);};}exports[_0xf831('0x5')]=function(_0x46b324){for(var _0x21df28=0x0,_0x1d4a58=events[_0xf831('0x6')];_0x21df28<_0x1d4a58;_0x21df28++){var _0x5918e4=events[_0x21df28];var _0x50aca1=createListener(_0xf831('0x7')+_0x5918e4,_0x46b324);UserEvents['on'](_0x5918e4,_0x50aca1);}}; \ No newline at end of file +var _0x4645=['length','user:','save','remove','update','emit','removeListener'];(function(_0x296159,_0x625c88){var _0x4b9067=function(_0x43027f){while(--_0x43027f){_0x296159['push'](_0x296159['shift']());}};_0x4b9067(++_0x625c88);}(_0x4645,0x183));var _0x5464=function(_0x266f97,_0x155bca){_0x266f97=_0x266f97-0x0;var _0x281f6c=_0x4645[_0x266f97];return _0x281f6c;};'use strict';var UserEvents=require('./user.events');var events=[_0x5464('0x0'),_0x5464('0x1'),_0x5464('0x2')];function createListener(_0x937ba8,_0x4ccea5){return function(_0x561841){_0x4ccea5[_0x5464('0x3')](_0x937ba8,_0x561841);};}function removeListener(_0x5d31ef,_0x1d8b66){return function(){UserEvents[_0x5464('0x4')](_0x5d31ef,_0x1d8b66);};}exports['register']=function(_0x125469){for(var _0x4a8dd4=0x0,_0x324fac=events[_0x5464('0x5')];_0x4a8dd4<_0x324fac;_0x4a8dd4++){var _0x20015d=events[_0x4a8dd4];var _0x2ffae7=createListener(_0x5464('0x6')+_0x20015d,_0x125469);UserEvents['on'](_0x20015d,_0x2ffae7);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 199d8ea..125fdc9 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 _0x2f74=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','path','connect-timeout'];(function(_0x463f82,_0x3b4cf6){var _0x5e1e16=function(_0x1cb241){while(--_0x1cb241){_0x463f82['push'](_0x463f82['shift']());}};_0x5e1e16(++_0x3b4cf6);}(_0x2f74,0x7b));var _0x42f7=function(_0x5768b0,_0x4ffb64){_0x5768b0=_0x5768b0-0x0;var _0x44d203=_0x2f74[_0x5768b0];return _0x44d203;};'use strict';var multer=require(_0x42f7('0x0'));var util=require('util');var path=require(_0x42f7('0x1'));var timeout=require(_0x42f7('0x2'));var express=require(_0x42f7('0x3'));var router=express[_0x42f7('0x4')]();var auth=require(_0x42f7('0x5'));var interaction=require(_0x42f7('0x6'));var config=require(_0x42f7('0x7'));module[_0x42f7('0x8')]=router; \ No newline at end of file +var _0x8f9d=['../../components/interaction/service','../../config/environment','exports','multer','path','express','Router','../../components/auth/service'];(function(_0x17682e,_0x6c0e13){var _0x49e77f=function(_0x2a78ad){while(--_0x2a78ad){_0x17682e['push'](_0x17682e['shift']());}};_0x49e77f(++_0x6c0e13);}(_0x8f9d,0x93));var _0xd8f9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8f9d[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xd8f9('0x0'));var util=require('util');var path=require(_0xd8f9('0x1'));var timeout=require('connect-timeout');var express=require(_0xd8f9('0x2'));var router=express[_0xd8f9('0x3')]();var auth=require(_0xd8f9('0x4'));var interaction=require(_0xd8f9('0x5'));var config=require(_0xd8f9('0x6'));module[_0xd8f9('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index ecdec73..c5ea2d1 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 _0x9029=['sequelize'];(function(_0x5bb4e8,_0x44b756){var _0x2a86f2=function(_0x279ab2){while(--_0x279ab2){_0x5bb4e8['push'](_0x5bb4e8['shift']());}};_0x2a86f2(++_0x44b756);}(_0x9029,0x177));var _0x9902=function(_0x4f8860,_0xa371eb){_0x4f8860=_0x4f8860-0x0;var _0x4d8657=_0x9029[_0x4f8860];return _0x4d8657;};'use strict';var Sequelize=require(_0x9902('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x8c95=['sequelize','exports','INTEGER'];(function(_0x30dc64,_0x358ffa){var _0x43ce66=function(_0x1859e6){while(--_0x1859e6){_0x30dc64['push'](_0x30dc64['shift']());}};_0x43ce66(++_0x358ffa);}(_0x8c95,0xe4));var _0x58c9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8c95[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x58c9('0x0'));module[_0x58c9('0x1')]={'penalty':{'type':Sequelize[_0x58c9('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 f96ceac..a298da2 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 _0x731c=['moment','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api'];(function(_0xef9952,_0x14050e){var _0x4fceb9=function(_0x146880){while(--_0x146880){_0xef9952['push'](_0xef9952['shift']());}};_0x4fceb9(++_0x14050e);}(_0x731c,0x184));var _0xc731=function(_0x288ecc,_0x504c62){_0x288ecc=_0x288ecc-0x0;var _0x4e90b7=_0x731c[_0x288ecc];return _0x4e90b7;};'use strict';var _=require(_0xc731('0x0'));var util=require(_0xc731('0x1'));var logger=require(_0xc731('0x2'))(_0xc731('0x3'));var moment=require(_0xc731('0x4'));var BPromise=require('bluebird');var rp=require(_0xc731('0x5'));var fs=require('fs');var path=require(_0xc731('0x6'));var rimraf=require(_0xc731('0x7'));var config=require(_0xc731('0x8'));var attributes=require(_0xc731('0x9'));module[_0xc731('0xa')]=function(_0xd756db,_0x6b4e85){return _0xd756db[_0xc731('0xb')](_0xc731('0xc'),attributes,{'tableName':_0xc731('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x58b1=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','UserChatQueue','lodash','util','../../config/logger'];(function(_0x2064f6,_0x5cea48){var _0x233985=function(_0x4e16c8){while(--_0x4e16c8){_0x2064f6['push'](_0x2064f6['shift']());}};_0x233985(++_0x5cea48);}(_0x58b1,0xb1));var _0x158b=function(_0x37ded3,_0x371ebb){_0x37ded3=_0x37ded3-0x0;var _0x51e49e=_0x58b1[_0x37ded3];return _0x51e49e;};'use strict';var _=require(_0x158b('0x0'));var util=require(_0x158b('0x1'));var logger=require(_0x158b('0x2'))(_0x158b('0x3'));var moment=require(_0x158b('0x4'));var BPromise=require(_0x158b('0x5'));var rp=require(_0x158b('0x6'));var fs=require('fs');var path=require(_0x158b('0x7'));var rimraf=require(_0x158b('0x8'));var config=require(_0x158b('0x9'));var attributes=require('./userChatQueue.attributes');module[_0x158b('0xa')]=function(_0x217903,_0x209008){return _0x217903['define'](_0x158b('0xb'),attributes,{'tableName':'user_has_chat_queues','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 ca54e7c..a2acf3a 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 _0x3aa1=['info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','UserChatQueue,\x20%s,\x20%s','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x192099,_0x38a593){var _0x3d6ccc=function(_0x541fff){while(--_0x541fff){_0x192099['push'](_0x192099['shift']());}};_0x3d6ccc(++_0x38a593);}(_0x3aa1,0xdb));var _0x13aa=function(_0x3795f9,_0x51e7d2){_0x3795f9=_0x3795f9-0x0;var _0x536bef=_0x3aa1[_0x3795f9];return _0x536bef;};'use strict';var _=require('lodash');var util=require(_0x13aa('0x0'));var moment=require(_0x13aa('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13aa('0x2'));var db=require(_0x13aa('0x3'))['db'];var utils=require(_0x13aa('0x4'));var logger=require(_0x13aa('0x5'))(_0x13aa('0x6'));var config=require('../../config/environment');var jayson=require(_0x13aa('0x7'));var client=jayson['client'][_0x13aa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9700a8,_0x208b7e,_0x5c15d8){return new BPromise(function(_0x201b72,_0x2dc717){return client['request'](_0x9700a8,_0x5c15d8)['then'](function(_0x2f75ed){logger[_0x13aa('0x9')]('UserChatQueue,\x20%s,\x20%s',_0x208b7e,_0x13aa('0xa'));logger[_0x13aa('0xb')](_0x13aa('0xc'),_0x208b7e,_0x13aa('0xa'),JSON['stringify'](_0x2f75ed));if(_0x2f75ed[_0x13aa('0xd')]){if(_0x2f75ed['error'][_0x13aa('0xe')]===0x1f4){logger[_0x13aa('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x208b7e,_0x2f75ed[_0x13aa('0xd')][_0x13aa('0xf')]);return _0x2dc717(_0x2f75ed[_0x13aa('0xd')][_0x13aa('0xf')]);}logger[_0x13aa('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x208b7e,_0x2f75ed[_0x13aa('0xd')][_0x13aa('0xf')]);return _0x201b72(_0x2f75ed[_0x13aa('0xd')][_0x13aa('0xf')]);}else{logger[_0x13aa('0x9')](_0x13aa('0x10'),_0x208b7e,_0x13aa('0xa'));_0x201b72(_0x2f75ed[_0x13aa('0x11')][_0x13aa('0xf')]);}})[_0x13aa('0x12')](function(_0x4571dd){logger['error'](_0x13aa('0x10'),_0x208b7e,_0x4571dd);_0x2dc717(_0x4571dd);});});} \ No newline at end of file +var _0x3c9d=['request','then','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x4041f7,_0x58791c){var _0x545d9b=function(_0x20bb7f){while(--_0x20bb7f){_0x4041f7['push'](_0x4041f7['shift']());}};_0x545d9b(++_0x58791c);}(_0x3c9d,0x170));var _0xd3c9=function(_0x597106,_0x44de51){_0x597106=_0x597106-0x0;var _0x3ca6b5=_0x3c9d[_0x597106];return _0x3ca6b5;};'use strict';var _=require(_0xd3c9('0x0'));var util=require(_0xd3c9('0x1'));var moment=require(_0xd3c9('0x2'));var BPromise=require(_0xd3c9('0x3'));var rs=require(_0xd3c9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd3c9('0x5'))['db'];var utils=require(_0xd3c9('0x6'));var logger=require(_0xd3c9('0x7'))(_0xd3c9('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd3c9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b6ced,_0x325fb4,_0x4eeb2c){return new BPromise(function(_0x55b550,_0x52a474){return client[_0xd3c9('0xa')](_0x5b6ced,_0x4eeb2c)[_0xd3c9('0xb')](function(_0x8b7061){logger['info'](_0xd3c9('0xc'),_0x325fb4,'request\x20sent');logger[_0xd3c9('0xd')](_0xd3c9('0xe'),_0x325fb4,_0xd3c9('0xf'),JSON[_0xd3c9('0x10')](_0x8b7061));if(_0x8b7061['error']){if(_0x8b7061[_0xd3c9('0x11')][_0xd3c9('0x12')]===0x1f4){logger['error'](_0xd3c9('0xc'),_0x325fb4,_0x8b7061[_0xd3c9('0x11')][_0xd3c9('0x13')]);return _0x52a474(_0x8b7061[_0xd3c9('0x11')]['message']);}logger['error'](_0xd3c9('0xc'),_0x325fb4,_0x8b7061['error'][_0xd3c9('0x13')]);return _0x55b550(_0x8b7061[_0xd3c9('0x11')][_0xd3c9('0x13')]);}else{logger[_0xd3c9('0x14')](_0xd3c9('0xc'),_0x325fb4,_0xd3c9('0xf'));_0x55b550(_0x8b7061['result']['message']);}})['catch'](function(_0x4c9ba9){logger[_0xd3c9('0x11')](_0xd3c9('0xc'),_0x325fb4,_0x4c9ba9);_0x52a474(_0x4c9ba9);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index c90ab7d..142e123 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 _0x565e=['exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x5340ca,_0x22da03){var _0x14ef10=function(_0x1cad10){while(--_0x1cad10){_0x5340ca['push'](_0x5340ca['shift']());}};_0x14ef10(++_0x22da03);}(_0x565e,0x7f));var _0xe565=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x565e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe565('0x0'));var util=require('util');var path=require(_0xe565('0x1'));var timeout=require(_0xe565('0x2'));var express=require(_0xe565('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe565('0x4'));var config=require(_0xe565('0x5'));module[_0xe565('0x6')]=router; \ No newline at end of file +var _0xdded=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','exports'];(function(_0x5ab05f,_0x212a1e){var _0x41f878=function(_0x2d3127){while(--_0x2d3127){_0x5ab05f['push'](_0x5ab05f['shift']());}};_0x41f878(++_0x212a1e);}(_0xdded,0x17a));var _0xddde=function(_0x33f157,_0x4651be){_0x33f157=_0x33f157-0x0;var _0x1b55b6=_0xdded[_0x33f157];return _0x1b55b6;};'use strict';var multer=require(_0xddde('0x0'));var util=require(_0xddde('0x1'));var path=require(_0xddde('0x2'));var timeout=require(_0xddde('0x3'));var express=require(_0xddde('0x4'));var router=express[_0xddde('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xddde('0x6'));var config=require(_0xddde('0x7'));module[_0xddde('0x8')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 5f92e37..561342e 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 _0xaa22=['sequelize','exports','INTEGER'];(function(_0x238bce,_0x1fa37a){var _0x127fc9=function(_0x5dbfbb){while(--_0x5dbfbb){_0x238bce['push'](_0x238bce['shift']());}};_0x127fc9(++_0x1fa37a);}(_0xaa22,0x180));var _0x2aa2=function(_0x2df4e8,_0x22ec30){_0x2df4e8=_0x2df4e8-0x0;var _0x52bec9=_0xaa22[_0x2df4e8];return _0x52bec9;};'use strict';var Sequelize=require(_0x2aa2('0x0'));module[_0x2aa2('0x1')]={'penalty':{'type':Sequelize[_0x2aa2('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2aa2('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5a96=['exports'];(function(_0x4f860e,_0x525b39){var _0x53f654=function(_0x3634eb){while(--_0x3634eb){_0x4f860e['push'](_0x4f860e['shift']());}};_0x53f654(++_0x525b39);}(_0x5a96,0x13d));var _0x65a9=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0x5a96[_0x2de0a7];return _0x429437;};'use strict';var Sequelize=require('sequelize');module[_0x65a9('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 70aab8e..4232379 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 _0x81e3=['request-promise','path','rimraf','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','util','moment','bluebird'];(function(_0x3a9f4b,_0x2d5e91){var _0x47bf37=function(_0x2eb19d){while(--_0x2eb19d){_0x3a9f4b['push'](_0x3a9f4b['shift']());}};_0x47bf37(++_0x2d5e91);}(_0x81e3,0x133));var _0x381e=function(_0x44c37d,_0x19119f){_0x44c37d=_0x44c37d-0x0;var _0x29e087=_0x81e3[_0x44c37d];return _0x29e087;};'use strict';var _=require('lodash');var util=require(_0x381e('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x381e('0x1'));var BPromise=require(_0x381e('0x2'));var rp=require(_0x381e('0x3'));var fs=require('fs');var path=require(_0x381e('0x4'));var rimraf=require(_0x381e('0x5'));var config=require('../../config/environment');var attributes=require(_0x381e('0x6'));module[_0x381e('0x7')]=function(_0x113921,_0xd57574){return _0x113921['define'](_0x381e('0x8'),attributes,{'tableName':_0x381e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcde5=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue'];(function(_0x3d1c0b,_0x8d68d){var _0x326a29=function(_0x3b1a57){while(--_0x3b1a57){_0x3d1c0b['push'](_0x3d1c0b['shift']());}};_0x326a29(++_0x8d68d);}(_0xcde5,0x111));var _0x5cde=function(_0x3d1ddb,_0x43eaa4){_0x3d1ddb=_0x3d1ddb-0x0;var _0x5a8a30=_0xcde5[_0x3d1ddb];return _0x5a8a30;};'use strict';var _=require(_0x5cde('0x0'));var util=require(_0x5cde('0x1'));var logger=require(_0x5cde('0x2'))(_0x5cde('0x3'));var moment=require(_0x5cde('0x4'));var BPromise=require('bluebird');var rp=require(_0x5cde('0x5'));var fs=require('fs');var path=require(_0x5cde('0x6'));var rimraf=require(_0x5cde('0x7'));var config=require(_0x5cde('0x8'));var attributes=require(_0x5cde('0x9'));module[_0x5cde('0xa')]=function(_0x11b1fe,_0x166eba){return _0x11b1fe[_0x5cde('0xb')](_0x5cde('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 533e216..cc61da3 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 _0x9072=['../../config/logger','rpc','client','http','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','ioredis','../../config/utils'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0x9072,0x73));var _0x2907=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9072[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2907('0x0'));var util=require(_0x2907('0x1'));var moment=require(_0x2907('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2907('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2907('0x4'));var logger=require(_0x2907('0x5'))(_0x2907('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2907('0x7')][_0x2907('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e12b7,_0x5eb2d6,_0x341423){return new BPromise(function(_0x1502a8,_0x28371c){return client[_0x2907('0x9')](_0x5e12b7,_0x341423)['then'](function(_0x366774){logger[_0x2907('0xa')](_0x2907('0xb'),_0x5eb2d6,_0x2907('0xc'));logger[_0x2907('0xd')](_0x2907('0xe'),_0x5eb2d6,_0x2907('0xc'),JSON[_0x2907('0xf')](_0x366774));if(_0x366774[_0x2907('0x10')]){if(_0x366774[_0x2907('0x10')][_0x2907('0x11')]===0x1f4){logger[_0x2907('0x10')](_0x2907('0xb'),_0x5eb2d6,_0x366774['error'][_0x2907('0x12')]);return _0x28371c(_0x366774[_0x2907('0x10')][_0x2907('0x12')]);}logger[_0x2907('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x5eb2d6,_0x366774[_0x2907('0x10')][_0x2907('0x12')]);return _0x1502a8(_0x366774[_0x2907('0x10')][_0x2907('0x12')]);}else{logger[_0x2907('0xa')](_0x2907('0xb'),_0x5eb2d6,_0x2907('0xc'));_0x1502a8(_0x366774[_0x2907('0x13')]['message']);}})['catch'](function(_0x56a4d0){logger['error'](_0x2907('0xb'),_0x5eb2d6,_0x56a4d0);_0x28371c(_0x56a4d0);});});} \ No newline at end of file +var _0x6d06=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','error','code','message','result','catch','UserFaxQueue,\x20%s,\x20%s','util','moment','randomstring'];(function(_0x46ad9e,_0x203184){var _0x5727cb=function(_0x32a93e){while(--_0x32a93e){_0x46ad9e['push'](_0x46ad9e['shift']());}};_0x5727cb(++_0x203184);}(_0x6d06,0xb1));var _0x66d0=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x6d06[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require('lodash');var util=require(_0x66d0('0x0'));var moment=require(_0x66d0('0x1'));var BPromise=require('bluebird');var rs=require(_0x66d0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x66d0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x66d0('0x4'))(_0x66d0('0x5'));var config=require(_0x66d0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x66d0('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47b8a6,_0xe77bfa,_0x1e9d1f){return new BPromise(function(_0x4ec5a2,_0x5cb13a){return client[_0x66d0('0x8')](_0x47b8a6,_0x1e9d1f)[_0x66d0('0x9')](function(_0x27d920){logger[_0x66d0('0xa')]('UserFaxQueue,\x20%s,\x20%s',_0xe77bfa,_0x66d0('0xb'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0xe77bfa,_0x66d0('0xb'),JSON['stringify'](_0x27d920));if(_0x27d920['error']){if(_0x27d920[_0x66d0('0xc')][_0x66d0('0xd')]===0x1f4){logger[_0x66d0('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0xe77bfa,_0x27d920[_0x66d0('0xc')][_0x66d0('0xe')]);return _0x5cb13a(_0x27d920['error']['message']);}logger[_0x66d0('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0xe77bfa,_0x27d920[_0x66d0('0xc')][_0x66d0('0xe')]);return _0x4ec5a2(_0x27d920[_0x66d0('0xc')]['message']);}else{logger['info']('UserFaxQueue,\x20%s,\x20%s',_0xe77bfa,'request\x20sent');_0x4ec5a2(_0x27d920[_0x66d0('0xf')]['message']);}})[_0x66d0('0x10')](function(_0x13e731){logger[_0x66d0('0xc')](_0x66d0('0x11'),_0xe77bfa,_0x13e731);_0x5cb13a(_0x13e731);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index c499d1b..fc6bb92 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 _0x0f80=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','exports'];(function(_0x57cc16,_0x444378){var _0x5421e5=function(_0xbcb1d3){while(--_0xbcb1d3){_0x57cc16['push'](_0x57cc16['shift']());}};_0x5421e5(++_0x444378);}(_0x0f80,0x108));var _0x00f8=function(_0x4859c2,_0x48471c){_0x4859c2=_0x4859c2-0x0;var _0x36f742=_0x0f80[_0x4859c2];return _0x36f742;};'use strict';var multer=require('multer');var util=require(_0x00f8('0x0'));var path=require(_0x00f8('0x1'));var timeout=require(_0x00f8('0x2'));var express=require(_0x00f8('0x3'));var router=express[_0x00f8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x00f8('0x5'));var config=require(_0x00f8('0x6'));module[_0x00f8('0x7')]=router; \ No newline at end of file +var _0xcf98=['exports','util','path','connect-timeout','express','Router','../../config/environment'];(function(_0x54ba70,_0x4b2263){var _0xe61097=function(_0x4b950a){while(--_0x4b950a){_0x54ba70['push'](_0x54ba70['shift']());}};_0xe61097(++_0x4b2263);}(_0xcf98,0x8d));var _0x8cf9=function(_0x24dba3,_0x4b9ce5){_0x24dba3=_0x24dba3-0x0;var _0x1d7a1f=_0xcf98[_0x24dba3];return _0x1d7a1f;};'use strict';var multer=require('multer');var util=require(_0x8cf9('0x0'));var path=require(_0x8cf9('0x1'));var timeout=require(_0x8cf9('0x2'));var express=require(_0x8cf9('0x3'));var router=express[_0x8cf9('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8cf9('0x5'));module[_0x8cf9('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 1b35979..e9b51b3 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 _0x5757=['exports','INTEGER'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x5757,0x140));var _0x7575=function(_0x570d81,_0x623ca4){_0x570d81=_0x570d81-0x0;var _0x41686b=_0x5757[_0x570d81];return _0x41686b;};'use strict';var Sequelize=require('sequelize');module[_0x7575('0x0')]={'penalty':{'type':Sequelize[_0x7575('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa551=['INTEGER','sequelize','exports'];(function(_0x56b8e1,_0x579817){var _0x29e667=function(_0x4e7b1c){while(--_0x4e7b1c){_0x56b8e1['push'](_0x56b8e1['shift']());}};_0x29e667(++_0x579817);}(_0xa551,0x88));var _0x1a55=function(_0x23c189,_0x1d0a08){_0x23c189=_0x23c189-0x0;var _0x54c79b=_0xa551[_0x23c189];return _0x54c79b;};'use strict';var Sequelize=require(_0x1a55('0x0'));module[_0x1a55('0x1')]={'penalty':{'type':Sequelize[_0x1a55('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 0467eb4..eb4fa06 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 _0x1a37=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserMailQueue','user_has_mail_queues','lodash','util'];(function(_0x1c9089,_0x1a6409){var _0x2fc27a=function(_0x588dfa){while(--_0x588dfa){_0x1c9089['push'](_0x1c9089['shift']());}};_0x2fc27a(++_0x1a6409);}(_0x1a37,0xb4));var _0x71a3=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x1a37[_0x4bb66f];return _0xf2772f;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var logger=require(_0x71a3('0x2'))(_0x71a3('0x3'));var moment=require(_0x71a3('0x4'));var BPromise=require(_0x71a3('0x5'));var rp=require(_0x71a3('0x6'));var fs=require('fs');var path=require(_0x71a3('0x7'));var rimraf=require(_0x71a3('0x8'));var config=require(_0x71a3('0x9'));var attributes=require('./userMailQueue.attributes');module[_0x71a3('0xa')]=function(_0x4f6b7a,_0xd09f7){return _0x4f6b7a[_0x71a3('0xb')](_0x71a3('0xc'),attributes,{'tableName':_0x71a3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9536=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues'];(function(_0x455882,_0x3961b0){var _0x59859a=function(_0x4d5b50){while(--_0x4d5b50){_0x455882['push'](_0x455882['shift']());}};_0x59859a(++_0x3961b0);}(_0x9536,0x179));var _0x6953=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x9536[_0x381589];return _0x2a075d;};'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':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 2648d07..c274b69 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 _0x6c20=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x5360cf,_0x221c85){var _0x49aa0c=function(_0x46473b){while(--_0x46473b){_0x5360cf['push'](_0x5360cf['shift']());}};_0x49aa0c(++_0x221c85);}(_0x6c20,0x70));var _0x06c2=function(_0x22e571,_0x443a32){_0x22e571=_0x22e571-0x0;var _0x5b3f1c=_0x6c20[_0x22e571];return _0x5b3f1c;};'use strict';var _=require(_0x06c2('0x0'));var util=require(_0x06c2('0x1'));var moment=require('moment');var BPromise=require(_0x06c2('0x2'));var rs=require(_0x06c2('0x3'));var fs=require('fs');var Redis=require(_0x06c2('0x4'));var db=require(_0x06c2('0x5'))['db'];var utils=require(_0x06c2('0x6'));var logger=require(_0x06c2('0x7'))(_0x06c2('0x8'));var config=require('../../config/environment');var jayson=require(_0x06c2('0x9'));var client=jayson['client'][_0x06c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4945aa,_0x2a718c,_0x35f0b3){return new BPromise(function(_0xa1dde8,_0x2b6220){return client[_0x06c2('0xb')](_0x4945aa,_0x35f0b3)[_0x06c2('0xc')](function(_0x51c4b9){logger['info'](_0x06c2('0xd'),_0x2a718c,_0x06c2('0xe'));logger[_0x06c2('0xf')](_0x06c2('0x10'),_0x2a718c,'request\x20sent',JSON['stringify'](_0x51c4b9));if(_0x51c4b9[_0x06c2('0x11')]){if(_0x51c4b9['error'][_0x06c2('0x12')]===0x1f4){logger[_0x06c2('0x11')](_0x06c2('0xd'),_0x2a718c,_0x51c4b9[_0x06c2('0x11')]['message']);return _0x2b6220(_0x51c4b9[_0x06c2('0x11')]['message']);}logger[_0x06c2('0x11')](_0x06c2('0xd'),_0x2a718c,_0x51c4b9[_0x06c2('0x11')][_0x06c2('0x13')]);return _0xa1dde8(_0x51c4b9[_0x06c2('0x11')][_0x06c2('0x13')]);}else{logger['info'](_0x06c2('0xd'),_0x2a718c,_0x06c2('0xe'));_0xa1dde8(_0x51c4b9[_0x06c2('0x14')][_0x06c2('0x13')]);}})[_0x06c2('0x15')](function(_0x3f6b44){logger['error']('UserMailQueue,\x20%s,\x20%s',_0x2a718c,_0x3f6b44);_0x2b6220(_0x3f6b44);});});} \ No newline at end of file +var _0x4ffc=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','randomstring'];(function(_0xe84805,_0x2702d9){var _0x398efd=function(_0x37cfad){while(--_0x37cfad){_0xe84805['push'](_0xe84805['shift']());}};_0x398efd(++_0x2702d9);}(_0x4ffc,0x1de));var _0xc4ff=function(_0xa72255,_0x492f72){_0xa72255=_0xa72255-0x0;var _0x1bdd96=_0x4ffc[_0xa72255];return _0x1bdd96;};'use strict';var _=require(_0xc4ff('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc4ff('0x1'));var fs=require('fs');var Redis=require(_0xc4ff('0x2'));var db=require(_0xc4ff('0x3'))['db'];var utils=require(_0xc4ff('0x4'));var logger=require(_0xc4ff('0x5'))(_0xc4ff('0x6'));var config=require(_0xc4ff('0x7'));var jayson=require(_0xc4ff('0x8'));var client=jayson[_0xc4ff('0x9')][_0xc4ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1cb94a,_0x73dca3,_0x5a54b0){return new BPromise(function(_0x5076a9,_0x3155db){return client[_0xc4ff('0xb')](_0x1cb94a,_0x5a54b0)['then'](function(_0x21bf28){logger['info'](_0xc4ff('0xc'),_0x73dca3,_0xc4ff('0xd'));logger[_0xc4ff('0xe')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x73dca3,'request\x20sent',JSON['stringify'](_0x21bf28));if(_0x21bf28[_0xc4ff('0xf')]){if(_0x21bf28[_0xc4ff('0xf')][_0xc4ff('0x10')]===0x1f4){logger['error']('UserMailQueue,\x20%s,\x20%s',_0x73dca3,_0x21bf28[_0xc4ff('0xf')]['message']);return _0x3155db(_0x21bf28[_0xc4ff('0xf')]['message']);}logger[_0xc4ff('0xf')](_0xc4ff('0xc'),_0x73dca3,_0x21bf28[_0xc4ff('0xf')][_0xc4ff('0x11')]);return _0x5076a9(_0x21bf28[_0xc4ff('0xf')][_0xc4ff('0x11')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x73dca3,'request\x20sent');_0x5076a9(_0x21bf28[_0xc4ff('0x12')][_0xc4ff('0x11')]);}})[_0xc4ff('0x13')](function(_0x2307fe){logger[_0xc4ff('0xf')](_0xc4ff('0xc'),_0x73dca3,_0x2307fe);_0x3155db(_0x2307fe);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index f607a71..6d2a1bb 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 _0xa786=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','path','connect-timeout','express'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa786,0x1d2));var _0x6a78=function(_0x4d4645,_0x5788a4){_0x4d4645=_0x4d4645-0x0;var _0x421226=_0xa786[_0x4d4645];return _0x421226;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6a78('0x0'));var timeout=require(_0x6a78('0x1'));var express=require(_0x6a78('0x2'));var router=express[_0x6a78('0x3')]();var auth=require(_0x6a78('0x4'));var interaction=require(_0x6a78('0x5'));var config=require(_0x6a78('0x6'));module['exports']=router; \ No newline at end of file +var _0x326f=['exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1e7d8b,_0x9a5f2d){var _0x23d5b8=function(_0x27574d){while(--_0x27574d){_0x1e7d8b['push'](_0x1e7d8b['shift']());}};_0x23d5b8(++_0x9a5f2d);}(_0x326f,0xd1));var _0xf326=function(_0x1bcd6e,_0x7f2f6a){_0x1bcd6e=_0x1bcd6e-0x0;var _0x4cdb01=_0x326f[_0x1bcd6e];return _0x4cdb01;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var auth=require(_0xf326('0x4'));var interaction=require(_0xf326('0x5'));var config=require(_0xf326('0x6'));module[_0xf326('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 61a3806..cc6442b 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 _0x27ac=['sequelize','exports','INTEGER'];(function(_0x40b9b5,_0x149980){var _0x126c24=function(_0x415cc5){while(--_0x415cc5){_0x40b9b5['push'](_0x40b9b5['shift']());}};_0x126c24(++_0x149980);}(_0x27ac,0xc3));var _0xc27a=function(_0x26c02f,_0xe7303e){_0x26c02f=_0x26c02f-0x0;var _0x44bd50=_0x27ac[_0x26c02f];return _0x44bd50;};'use strict';var Sequelize=require(_0xc27a('0x0'));module[_0xc27a('0x1')]={'penalty':{'type':Sequelize[_0xc27a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x89f5=['exports','INTEGER'];(function(_0x135793,_0x1ce79e){var _0x2f469b=function(_0x408728){while(--_0x408728){_0x135793['push'](_0x135793['shift']());}};_0x2f469b(++_0x1ce79e);}(_0x89f5,0x80));var _0x589f=function(_0x2cae2d,_0x1bae3e){_0x2cae2d=_0x2cae2d-0x0;var _0x195c1e=_0x89f5[_0x2cae2d];return _0x195c1e;};'use strict';var Sequelize=require('sequelize');module[_0x589f('0x0')]={'penalty':{'type':Sequelize[_0x589f('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index dfbdc86..89834b3 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 _0xf52f=['request-promise','path','../../config/environment','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment'];(function(_0xaa8c61,_0x4e5ba6){var _0x4c26af=function(_0x228fd3){while(--_0x228fd3){_0xaa8c61['push'](_0xaa8c61['shift']());}};_0x4c26af(++_0x4e5ba6);}(_0xf52f,0x103));var _0xff52=function(_0x1a9f8b,_0x53ac1b){_0x1a9f8b=_0x1a9f8b-0x0;var _0x12a2c1=_0xf52f[_0x1a9f8b];return _0x12a2c1;};'use strict';var _=require(_0xff52('0x0'));var util=require(_0xff52('0x1'));var logger=require(_0xff52('0x2'))(_0xff52('0x3'));var moment=require(_0xff52('0x4'));var BPromise=require('bluebird');var rp=require(_0xff52('0x5'));var fs=require('fs');var path=require(_0xff52('0x6'));var rimraf=require('rimraf');var config=require(_0xff52('0x7'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xff52('0x8')]=function(_0x21a6db,_0x28a749){return _0x21a6db[_0xff52('0x9')](_0xff52('0xa'),attributes,{'tableName':_0xff52('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c7f=['bluebird','request-promise','path','rimraf','./userOpenchannelQueue.attributes','define','user_has_openchannel_queues','lodash','../../config/logger','api','moment'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0x7c7f,0x125));var _0xf7c7=function(_0x44d9ab,_0x76bc69){_0x44d9ab=_0x44d9ab-0x0;var _0x31485e=_0x7c7f[_0x44d9ab];return _0x31485e;};'use strict';var _=require(_0xf7c7('0x0'));var util=require('util');var logger=require(_0xf7c7('0x1'))(_0xf7c7('0x2'));var moment=require(_0xf7c7('0x3'));var BPromise=require(_0xf7c7('0x4'));var rp=require(_0xf7c7('0x5'));var fs=require('fs');var path=require(_0xf7c7('0x6'));var rimraf=require(_0xf7c7('0x7'));var config=require('../../config/environment');var attributes=require(_0xf7c7('0x8'));module['exports']=function(_0x5401e7,_0x5d2977){return _0x5401e7[_0xf7c7('0x9')]('UserOpenchannelQueue',attributes,{'tableName':_0xf7c7('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 c006d2f..70b6240 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 _0xe654=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0xd8816c,_0xe08ec3){var _0x233181=function(_0x25b6de){while(--_0x25b6de){_0xd8816c['push'](_0xd8816c['shift']());}};_0x233181(++_0xe08ec3);}(_0xe654,0x1b2));var _0x4e65=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe654[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4e65('0x0'));var util=require(_0x4e65('0x1'));var moment=require('moment');var BPromise=require(_0x4e65('0x2'));var rs=require(_0x4e65('0x3'));var fs=require('fs');var Redis=require(_0x4e65('0x4'));var db=require(_0x4e65('0x5'))['db'];var utils=require(_0x4e65('0x6'));var logger=require('../../config/logger')(_0x4e65('0x7'));var config=require('../../config/environment');var jayson=require(_0x4e65('0x8'));var client=jayson[_0x4e65('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1020ea,_0x23f631,_0x1585ae){return new BPromise(function(_0x4b60de,_0x51ed6b){return client[_0x4e65('0xa')](_0x1020ea,_0x1585ae)[_0x4e65('0xb')](function(_0x4cae97){logger[_0x4e65('0xc')](_0x4e65('0xd'),_0x23f631,_0x4e65('0xe'));logger[_0x4e65('0xf')](_0x4e65('0x10'),_0x23f631,_0x4e65('0xe'),JSON[_0x4e65('0x11')](_0x4cae97));if(_0x4cae97[_0x4e65('0x12')]){if(_0x4cae97[_0x4e65('0x12')][_0x4e65('0x13')]===0x1f4){logger['error'](_0x4e65('0xd'),_0x23f631,_0x4cae97[_0x4e65('0x12')][_0x4e65('0x14')]);return _0x51ed6b(_0x4cae97[_0x4e65('0x12')][_0x4e65('0x14')]);}logger[_0x4e65('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x23f631,_0x4cae97[_0x4e65('0x12')][_0x4e65('0x14')]);return _0x4b60de(_0x4cae97[_0x4e65('0x12')][_0x4e65('0x14')]);}else{logger[_0x4e65('0xc')](_0x4e65('0xd'),_0x23f631,_0x4e65('0xe'));_0x4b60de(_0x4cae97[_0x4e65('0x15')]['message']);}})[_0x4e65('0x16')](function(_0xf79112){logger[_0x4e65('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x23f631,_0xf79112);_0x51ed6b(_0xf79112);});});} \ No newline at end of file +var _0xc346=['../../config/utils','client','request','then','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','info','result','catch','moment','bluebird','ioredis','../../mysqldb'];(function(_0x4e7b37,_0x33b1fa){var _0x20b707=function(_0x1fb9ff){while(--_0x1fb9ff){_0x4e7b37['push'](_0x4e7b37['shift']());}};_0x20b707(++_0x33b1fa);}(_0xc346,0xc8));var _0x6c34=function(_0x3bcbf6,_0x3e5a46){_0x3bcbf6=_0x3bcbf6-0x0;var _0x11b078=_0xc346[_0x3bcbf6];return _0x11b078;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6c34('0x0'));var BPromise=require(_0x6c34('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c34('0x2'));var db=require(_0x6c34('0x3'))['db'];var utils=require(_0x6c34('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6c34('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41901e,_0xdfcb09,_0x3dc553){return new BPromise(function(_0x1a4091,_0x4c654c){return client[_0x6c34('0x6')](_0x41901e,_0x3dc553)[_0x6c34('0x7')](function(_0x28bd7b){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0xdfcb09,_0x6c34('0x8'));logger['debug'](_0x6c34('0x9'),_0xdfcb09,_0x6c34('0x8'),JSON['stringify'](_0x28bd7b));if(_0x28bd7b[_0x6c34('0xa')]){if(_0x28bd7b[_0x6c34('0xa')][_0x6c34('0xb')]===0x1f4){logger[_0x6c34('0xa')](_0x6c34('0xc'),_0xdfcb09,_0x28bd7b[_0x6c34('0xa')][_0x6c34('0xd')]);return _0x4c654c(_0x28bd7b[_0x6c34('0xa')][_0x6c34('0xd')]);}logger[_0x6c34('0xa')](_0x6c34('0xc'),_0xdfcb09,_0x28bd7b['error'][_0x6c34('0xd')]);return _0x1a4091(_0x28bd7b[_0x6c34('0xa')][_0x6c34('0xd')]);}else{logger[_0x6c34('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xdfcb09,'request\x20sent');_0x1a4091(_0x28bd7b[_0x6c34('0xf')][_0x6c34('0xd')]);}})[_0x6c34('0x10')](function(_0x16c13c){logger[_0x6c34('0xa')](_0x6c34('0xc'),_0xdfcb09,_0x16c13c);_0x4c654c(_0x16c13c);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 40d7c87..bc56685 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 _0xe8c1=['show','getResources','post','/:id/clone','clone','/:id/sections','addSections','/:id/resources','addResources','/:id','update','destroy','delete','removeResources','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./userProfile.controller','get','index','/describe','describe','isAuthenticated'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xe8c1,0x9b));var _0x1e8c=function(_0x16a223,_0x31b6e8){_0x16a223=_0x16a223-0x0;var _0x5ded66=_0xe8c1[_0x16a223];return _0x5ded66;};'use strict';var multer=require(_0x1e8c('0x0'));var util=require(_0x1e8c('0x1'));var path=require(_0x1e8c('0x2'));var timeout=require(_0x1e8c('0x3'));var express=require(_0x1e8c('0x4'));var router=express[_0x1e8c('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1e8c('0x6'));var controller=require(_0x1e8c('0x7'));router[_0x1e8c('0x8')]('/',auth['isAuthenticated'](),controller[_0x1e8c('0x9')]);router[_0x1e8c('0x8')](_0x1e8c('0xa'),auth['isAuthenticated'](),controller[_0x1e8c('0xb')]);router[_0x1e8c('0x8')]('/:id',auth[_0x1e8c('0xc')](),controller[_0x1e8c('0xd')]);router[_0x1e8c('0x8')]('/:id/resources',auth[_0x1e8c('0xc')](),controller[_0x1e8c('0xe')]);router[_0x1e8c('0xf')]('/',auth[_0x1e8c('0xc')](),controller['create']);router[_0x1e8c('0xf')](_0x1e8c('0x10'),auth[_0x1e8c('0xc')](),controller[_0x1e8c('0x11')]);router[_0x1e8c('0xf')](_0x1e8c('0x12'),auth[_0x1e8c('0xc')](),controller[_0x1e8c('0x13')]);router[_0x1e8c('0xf')](_0x1e8c('0x14'),auth[_0x1e8c('0xc')](),controller[_0x1e8c('0x15')]);router['put'](_0x1e8c('0x16'),auth[_0x1e8c('0xc')](),controller[_0x1e8c('0x17')]);router['delete']('/:id',auth[_0x1e8c('0xc')](),controller[_0x1e8c('0x18')]);router['delete']('/:id/sections',auth[_0x1e8c('0xc')](),controller['removeSections']);router[_0x1e8c('0x19')](_0x1e8c('0x14'),auth[_0x1e8c('0xc')](),controller[_0x1e8c('0x1a')]);module[_0x1e8c('0x1b')]=router; \ No newline at end of file +var _0x68b6=['Router','../../components/interaction/service','../../config/environment','./userProfile.controller','isAuthenticated','get','/describe','describe','show','/:id/resources','post','/:id/clone','clone','/:id/sections','addSections','addResources','update','delete','/:id','destroy','removeSections','removeResources','exports','multer','path','connect-timeout','express'];(function(_0x1d1a2a,_0x4ad8f8){var _0xff1db7=function(_0x5adc66){while(--_0x5adc66){_0x1d1a2a['push'](_0x1d1a2a['shift']());}};_0xff1db7(++_0x4ad8f8);}(_0x68b6,0x1e2));var _0x668b=function(_0x48335a,_0x1efdde){_0x48335a=_0x48335a-0x0;var _0x3158ac=_0x68b6[_0x48335a];return _0x3158ac;};'use strict';var multer=require(_0x668b('0x0'));var util=require('util');var path=require(_0x668b('0x1'));var timeout=require(_0x668b('0x2'));var express=require(_0x668b('0x3'));var router=express[_0x668b('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x668b('0x5'));var config=require(_0x668b('0x6'));var controller=require(_0x668b('0x7'));router['get']('/',auth[_0x668b('0x8')](),controller['index']);router[_0x668b('0x9')](_0x668b('0xa'),auth['isAuthenticated'](),controller[_0x668b('0xb')]);router[_0x668b('0x9')]('/:id',auth[_0x668b('0x8')](),controller[_0x668b('0xc')]);router['get'](_0x668b('0xd'),auth[_0x668b('0x8')](),controller['getResources']);router[_0x668b('0xe')]('/',auth[_0x668b('0x8')](),controller['create']);router[_0x668b('0xe')](_0x668b('0xf'),auth[_0x668b('0x8')](),controller[_0x668b('0x10')]);router[_0x668b('0xe')](_0x668b('0x11'),auth['isAuthenticated'](),controller[_0x668b('0x12')]);router[_0x668b('0xe')](_0x668b('0xd'),auth[_0x668b('0x8')](),controller[_0x668b('0x13')]);router['put']('/:id',auth[_0x668b('0x8')](),controller[_0x668b('0x14')]);router[_0x668b('0x15')](_0x668b('0x16'),auth[_0x668b('0x8')](),controller[_0x668b('0x17')]);router[_0x668b('0x15')]('/:id/sections',auth[_0x668b('0x8')](),controller[_0x668b('0x18')]);router[_0x668b('0x15')](_0x668b('0xd'),auth[_0x668b('0x8')](),controller[_0x668b('0x19')]);module[_0x668b('0x1a')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index a201c14..ca23650 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 _0x0ce3=['join','getDataValue','crudPermissions','sequelize','exports','STRING','setDataValue'];(function(_0x2532e9,_0x3fc11b){var _0x1c5540=function(_0x9e17a1){while(--_0x9e17a1){_0x2532e9['push'](_0x2532e9['shift']());}};_0x1c5540(++_0x3fc11b);}(_0x0ce3,0xce));var _0x30ce=function(_0x8b6c1d,_0x4fa89a){_0x8b6c1d=_0x8b6c1d-0x0;var _0x245ac9=_0x0ce3[_0x8b6c1d];return _0x245ac9;};'use strict';var Sequelize=require(_0x30ce('0x0'));module[_0x30ce('0x1')]={'name':{'type':Sequelize[_0x30ce('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x30ce('0x2')],'set':function(_0x1da731){this[_0x30ce('0x3')]('crudPermissions',_0x1da731?_0x1da731[_0x30ce('0x4')](''):[]);},'get':function(){return this[_0x30ce('0x5')](_0x30ce('0x6'))?this[_0x30ce('0x5')](_0x30ce('0x6'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x30ce('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xeba2=['join','getDataValue','split','sequelize','exports','STRING','name','crudPermissions'];(function(_0x234ab7,_0x4e8666){var _0x1093ff=function(_0x122db8){while(--_0x122db8){_0x234ab7['push'](_0x234ab7['shift']());}};_0x1093ff(++_0x4e8666);}(_0xeba2,0x73));var _0x2eba=function(_0x19cb1a,_0x4ce1b2){_0x19cb1a=_0x19cb1a-0x0;var _0x399650=_0xeba2[_0x19cb1a];return _0x399650;};'use strict';var Sequelize=require(_0x2eba('0x0'));module[_0x2eba('0x1')]={'name':{'type':Sequelize[_0x2eba('0x2')],'allowNull':![],'unique':_0x2eba('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x4248c5){this['setDataValue'](_0x2eba('0x4'),_0x4248c5?_0x4248c5[_0x2eba('0x5')](''):[]);},'get':function(){return this[_0x2eba('0x6')](_0x2eba('0x4'))?this[_0x2eba('0x6')](_0x2eba('0x4'))[_0x2eba('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x2eba('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 1461f37..a512fe4 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 _0xb2d1=['OpenchannelQueue','OpenchannelAccount','SmsQueue','smsaccounts','SmsAccount','teams','Team','users','agents','telephones','admin','user','zendeskaccounts','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','customdashboards','Dashboard','Pause','scheduler','Schedule','Sound','tags','Template','Trigger','variables','Variable','plugins','Plugin','Reports','metrics','AnalyticMetric','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','redis','socket.io-emitter','./userProfile.socket','register','status','end','offset','limit','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','index','UserProfile','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filter','merge','type','key','VIRTUAL','count','includeAll','findAll','catch','show','params','length','options','find','create','get','omit','createdAt','updatedAt','crudPermissions','body','sequelize','UserProfileSection','each','autoAssociation','UserProfileResource','map','sectionId','userProfileId','Resources','destroy','describe','addSections','transaction','removeSections','ids','bulkCreate','removeResources','getResources','section','undefined','Sequelize','ValidationError','mergeResources','childModel','Invalid\x20section\x20\x27','isEmpty','parentSections','findOne','push','all','ignore','union','nolimit','order','field','associatedResources','foreignKey','forEach','AnalyticExtractedReport','include','reportType','default','reportId','DefaultReports','custom','rows','CmContact','Tag','Tags','color','tag','ThroughTags','value','resourceId','toLowerCase','squareprojects','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','ListId','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceMail','VoiceRecording','Agents','User','role','Telephones','membername','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','mailqueues','MailAccount','openchannelqueues'];(function(_0x43d8b4,_0x45a986){var _0xf9ac36=function(_0x5c0769){while(--_0x5c0769){_0x43d8b4['push'](_0x43d8b4['shift']());}};_0xf9ac36(++_0x45a986);}(_0xb2d1,0x104));var _0x1b2d=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0xb2d1[_0x4a7631];return _0x1a5a6f;};'use strict';var pdf=require(_0x1b2d('0x0'));var emlformat=require(_0x1b2d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1b2d('0x2'));var jsonpatch=require(_0x1b2d('0x3'));var rp=require(_0x1b2d('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1b2d('0x5'));var util=require(_0x1b2d('0x6'));var path=require(_0x1b2d('0x7'));var sox=require(_0x1b2d('0x8'));var csv=require('to-csv');var ejs=require(_0x1b2d('0x9'));var fs=require('fs');var _=require(_0x1b2d('0xa'));var squel=require(_0x1b2d('0xb'));var crypto=require(_0x1b2d('0xc'));var jsforce=require(_0x1b2d('0xd'));var deskjs=require(_0x1b2d('0xe'));var toCsv=require(_0x1b2d('0xf'));var querystring=require(_0x1b2d('0x10'));var Papa=require(_0x1b2d('0x11'));var Redis=require(_0x1b2d('0x12'));var authService=require(_0x1b2d('0x13'));var qs=require(_0x1b2d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1b2d('0x15'))('api');var utils=require(_0x1b2d('0x16'));var config=require(_0x1b2d('0x17'));var db=require('../../mysqldb')['db'];config[_0x1b2d('0x18')]=_['defaults'](config[_0x1b2d('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x1b2d('0x19'))(new Redis(config['redis']));require(_0x1b2d('0x1a'))[_0x1b2d('0x1b')](socket);function respondWithStatusCode(_0x3c9b37,_0x3c0c87){_0x3c0c87=_0x3c0c87||0xcc;return function(_0x176bb2){if(_0x176bb2){return _0x3c9b37['sendStatus'](_0x3c0c87);}return _0x3c9b37[_0x1b2d('0x1c')](_0x3c0c87)[_0x1b2d('0x1d')]();};}function respondWithResult(_0x1c5422,_0xdfa69b){_0xdfa69b=_0xdfa69b||0xc8;return function(_0x5a8342){if(_0x5a8342){return _0x1c5422[_0x1b2d('0x1c')](_0xdfa69b)['json'](_0x5a8342);}};}function respondWithFilteredResult(_0x3bdcd0,_0x1f277d){return function(_0x7f6c27){if(_0x7f6c27){var _0x2fd8c4=_0x7f6c27['count'],_0x2cda6f=_0x1f277d[_0x1b2d('0x1e')],_0x5998ce=_0x1f277d[_0x1b2d('0x1e')]+_0x1f277d[_0x1b2d('0x1f')],_0x32533c;if(_0x5998ce>=_0x2fd8c4){_0x5998ce=_0x2fd8c4;_0x32533c=0xc8;}else{_0x32533c=0xce;}_0x3bdcd0['status'](_0x32533c);return _0x3bdcd0['set'](_0x1b2d('0x20'),_0x2cda6f+'-'+_0x5998ce+'/'+_0x2fd8c4)[_0x1b2d('0x21')](_0x7f6c27);}return null;};}function patchUpdates(_0x4922c0){return function(_0x5f42ff){try{jsonpatch[_0x1b2d('0x22')](_0x5f42ff,_0x4922c0,!![]);}catch(_0x30720b){return BPromise[_0x1b2d('0x23')](_0x30720b);}return _0x5f42ff[_0x1b2d('0x24')]();};}function saveUpdates(_0x1dffc9,_0x85754c){return function(_0x18177f){if(_0x18177f){return _0x18177f[_0x1b2d('0x25')](_0x1dffc9)[_0x1b2d('0x26')](function(_0x5ad3ac){return _0x5ad3ac;});}return null;};}function removeEntity(_0xa11f30,_0x5700e6){return function(_0x5848c1){if(_0x5848c1){return _0x5848c1['destroy']()[_0x1b2d('0x26')](function(){_0xa11f30['status'](0xcc)[_0x1b2d('0x1d')]();});}};}function handleEntityNotFound(_0x7cc580,_0x38e0ee){return function(_0x76dfc7){if(!_0x76dfc7){_0x7cc580[_0x1b2d('0x27')](0x194);}return _0x76dfc7;};}function handleError(_0x54ab05,_0x4d7c38){_0x4d7c38=_0x4d7c38||0x1f4;return function(_0x58a2bb){logger['error'](_0x58a2bb[_0x1b2d('0x28')]);if(_0x58a2bb[_0x1b2d('0x29')]){delete _0x58a2bb['name'];}_0x54ab05[_0x1b2d('0x1c')](_0x4d7c38)['send'](_0x58a2bb);};}exports[_0x1b2d('0x2a')]=function(_0x23c9c5,_0x32feed){var _0x4d339b={},_0x5f1a4e={},_0x58da1e={'count':0x0,'rows':[]};var _0x5b0586=db[_0x1b2d('0x2b')][_0x1b2d('0x2c')];_0x5f1a4e[_0x1b2d('0x2d')]=_[_0x1b2d('0x2e')](_0x5b0586);_0x5f1a4e['query']=_['keys'](_0x23c9c5[_0x1b2d('0x2f')]);_0x5f1a4e[_0x1b2d('0x30')]=_['intersection'](_0x5f1a4e['model'],_0x5f1a4e[_0x1b2d('0x2f')]);_0x4d339b[_0x1b2d('0x31')]=_[_0x1b2d('0x32')](_0x5f1a4e[_0x1b2d('0x2d')],qs[_0x1b2d('0x33')](_0x23c9c5[_0x1b2d('0x2f')][_0x1b2d('0x33')]));_0x4d339b['attributes']=_0x4d339b[_0x1b2d('0x31')]['length']?_0x4d339b[_0x1b2d('0x31')]:_0x5f1a4e[_0x1b2d('0x2d')];if(!_0x23c9c5[_0x1b2d('0x2f')][_0x1b2d('0x34')]('nolimit')){_0x4d339b[_0x1b2d('0x1f')]=qs['limit'](_0x23c9c5[_0x1b2d('0x2f')]['limit']);_0x4d339b['offset']=qs[_0x1b2d('0x1e')](_0x23c9c5[_0x1b2d('0x2f')][_0x1b2d('0x1e')]);}_0x4d339b['order']=qs[_0x1b2d('0x35')](_0x23c9c5[_0x1b2d('0x2f')][_0x1b2d('0x35')]);_0x4d339b[_0x1b2d('0x36')]=qs['filters'](_[_0x1b2d('0x37')](_0x23c9c5['query'],_0x5f1a4e[_0x1b2d('0x30')]));if(_0x23c9c5[_0x1b2d('0x2f')][_0x1b2d('0x38')]){_0x4d339b[_0x1b2d('0x36')]=_[_0x1b2d('0x39')](_0x4d339b[_0x1b2d('0x36')],{'$or':_['map'](_0x5b0586,function(_0xb796ae){if(_0xb796ae[_0x1b2d('0x3a')][_0x1b2d('0x3b')]!==_0x1b2d('0x3c')){var _0x23d4c4={};_0x23d4c4[_0xb796ae['field']]={'$like':'%'+_0x23c9c5[_0x1b2d('0x2f')][_0x1b2d('0x38')]+'%'};return _0x23d4c4;}})});}_0x4d339b=_['merge']({},_0x4d339b,_0x23c9c5['options']);var _0x59b41a={'where':_0x4d339b[_0x1b2d('0x36')]};return db['UserProfile'][_0x1b2d('0x3d')](_0x59b41a)[_0x1b2d('0x26')](function(_0x2d3b33){_0x58da1e['count']=_0x2d3b33;if(_0x23c9c5[_0x1b2d('0x2f')][_0x1b2d('0x3e')]){_0x4d339b['include']=[{'all':!![]}];}return db[_0x1b2d('0x2b')][_0x1b2d('0x3f')](_0x4d339b);})[_0x1b2d('0x26')](function(_0xd20035){_0x58da1e['rows']=_0xd20035;return _0x58da1e;})['then'](respondWithFilteredResult(_0x32feed,_0x4d339b))[_0x1b2d('0x40')](handleError(_0x32feed,null));};exports[_0x1b2d('0x41')]=function(_0x293cc7,_0xe21221){var _0xa7b2f7={'raw':![],'where':{'id':_0x293cc7[_0x1b2d('0x42')]['id']}},_0x118934={};_0x118934[_0x1b2d('0x2d')]=_[_0x1b2d('0x2e')](db['UserProfile']['rawAttributes']);_0x118934[_0x1b2d('0x2f')]=_['keys'](_0x293cc7[_0x1b2d('0x2f')]);_0x118934[_0x1b2d('0x30')]=_[_0x1b2d('0x32')](_0x118934[_0x1b2d('0x2d')],_0x118934['query']);_0xa7b2f7[_0x1b2d('0x31')]=_['intersection'](_0x118934[_0x1b2d('0x2d')],qs[_0x1b2d('0x33')](_0x293cc7[_0x1b2d('0x2f')][_0x1b2d('0x33')]));_0xa7b2f7['attributes']=_0xa7b2f7[_0x1b2d('0x31')][_0x1b2d('0x43')]?_0xa7b2f7['attributes']:_0x118934['model'];if(_0x293cc7['query'][_0x1b2d('0x3e')]){_0xa7b2f7['include']=[{'all':!![]}];}_0xa7b2f7=_[_0x1b2d('0x39')]({},_0xa7b2f7,_0x293cc7[_0x1b2d('0x44')]);return db[_0x1b2d('0x2b')][_0x1b2d('0x45')](_0xa7b2f7)[_0x1b2d('0x26')](handleEntityNotFound(_0xe21221,null))['then'](respondWithResult(_0xe21221,null))['catch'](handleError(_0xe21221,null));};exports[_0x1b2d('0x46')]=function(_0x2d2a06,_0xa3dedd){return db['UserProfile']['create'](_0x2d2a06['body'],{})[_0x1b2d('0x26')](respondWithResult(_0xa3dedd,0xc9))[_0x1b2d('0x40')](handleError(_0xa3dedd,null));};exports['clone']=function(_0x481ec4,_0x6f320b){var _0x5d4fc1={'raw':![],'where':{'id':_0x481ec4[_0x1b2d('0x42')]['id']}},_0x13eed0={};_0x13eed0[_0x1b2d('0x2d')]=_[_0x1b2d('0x2e')](db[_0x1b2d('0x2b')][_0x1b2d('0x2c')]);_0x5d4fc1[_0x1b2d('0x31')]=_[_0x1b2d('0x32')](_0x13eed0[_0x1b2d('0x2d')],qs['fields'](_0x481ec4['query']['fields']));_0x5d4fc1[_0x1b2d('0x31')]=_0x5d4fc1['attributes'][_0x1b2d('0x43')]?_0x5d4fc1['attributes']:_0x13eed0[_0x1b2d('0x2d')];if(_0x481ec4[_0x1b2d('0x2f')]['includeAll']){_0x5d4fc1['include']=[{'all':!![]}];}_0x5d4fc1=_[_0x1b2d('0x39')]({},_0x5d4fc1,_0x481ec4['options']);return db[_0x1b2d('0x2b')][_0x1b2d('0x45')](_0x5d4fc1)[_0x1b2d('0x26')](handleEntityNotFound(_0x6f320b,null))['then'](function(_0x46f4e9){if(_0x46f4e9){var _0x1066c1=_0x46f4e9[_0x1b2d('0x47')]({'plain':!![]});_0x1066c1=qs[_0x1b2d('0x48')](_0x1066c1,['id',_0x1b2d('0x49'),_0x1b2d('0x4a'),_0x1b2d('0x4b')]);_0x481ec4[_0x1b2d('0x4c')]=_[_0x1b2d('0x48')](_0x481ec4[_0x1b2d('0x4c')],['id',_0x1b2d('0x49'),_0x1b2d('0x4a')]);return db[_0x1b2d('0x4d')]['transaction'](function(_0x19e683){return db[_0x1b2d('0x2b')][_0x1b2d('0x46')](_[_0x1b2d('0x39')](_0x1066c1,_0x481ec4[_0x1b2d('0x4c')]),{'include':_0x481ec4['query'][_0x1b2d('0x3e')]?[{'all':!![]}]:undefined,'transaction':_0x19e683})['then'](function(_0x400bc5){var _0x3bf582=_0x400bc5['get']({'plain':!![]});return db[_0x1b2d('0x4e')][_0x1b2d('0x3f')]({'where':{'userProfileId':_0x481ec4[_0x1b2d('0x42')]['id']},'raw':!![]})[_0x1b2d('0x26')](function(_0x129fdb){if(_0x129fdb){return BPromise[_0x1b2d('0x4f')](_0x129fdb,function(_0x35e5a7){return new BPromise(function(_0x120cb2,_0x52d0cd){if(_0x35e5a7[_0x1b2d('0x50')]===null||_0x35e5a7[_0x1b2d('0x50')]===0x1)_0x120cb2(null);return db[_0x1b2d('0x51')][_0x1b2d('0x3f')]({'where':{'sectionId':_0x35e5a7['id']},'raw':!![]})[_0x1b2d('0x26')](function(_0x1e6f58){var _0x1a6ad8=_[_0x1b2d('0x52')](_0x1e6f58,function(_0x1f33f4){return qs[_0x1b2d('0x48')](_0x1f33f4,['id',_0x1b2d('0x49'),_0x1b2d('0x4a'),_0x1b2d('0x53')]);});_0x120cb2(_0x1a6ad8);})[_0x1b2d('0x40')](function(_0x34039d){_0x52d0cd(_0x34039d);});})[_0x1b2d('0x26')](function(_0x1872c4){var _0x4d92c2=qs[_0x1b2d('0x48')](_0x35e5a7,['id','createdAt',_0x1b2d('0x4a')]);_0x4d92c2[_0x1b2d('0x54')]=_0x3bf582['id'];if(_0x1872c4)_0x4d92c2[_0x1b2d('0x55')]=_0x1872c4;return _0x4d92c2;})[_0x1b2d('0x26')](function(_0x4dfda5){return db[_0x1b2d('0x4e')][_0x1b2d('0x46')](_0x4dfda5,{'include':[{'model':db[_0x1b2d('0x51')],'as':_0x1b2d('0x55')}],'raw':!![],'transaction':_0x19e683});});})[_0x1b2d('0x26')](function(){return _0x3bf582;});}});});});}})[_0x1b2d('0x26')](respondWithResult(_0x6f320b,0xc9))[_0x1b2d('0x40')](handleError(_0x6f320b,null));};exports[_0x1b2d('0x25')]=function(_0x3229b1,_0x459bad){if(_0x3229b1[_0x1b2d('0x4c')]['id']){delete _0x3229b1['body']['id'];}return db[_0x1b2d('0x2b')][_0x1b2d('0x45')]({'where':{'id':_0x3229b1[_0x1b2d('0x42')]['id']}})[_0x1b2d('0x26')](handleEntityNotFound(_0x459bad,null))[_0x1b2d('0x26')](saveUpdates(_0x3229b1[_0x1b2d('0x4c')],null))[_0x1b2d('0x26')](respondWithResult(_0x459bad,null))['catch'](handleError(_0x459bad,null));};exports[_0x1b2d('0x56')]=function(_0x409dae,_0x2dd579){return db[_0x1b2d('0x2b')]['find']({'where':{'id':_0x409dae[_0x1b2d('0x42')]['id']}})[_0x1b2d('0x26')](handleEntityNotFound(_0x2dd579,null))[_0x1b2d('0x26')](removeEntity(_0x2dd579,null))[_0x1b2d('0x40')](handleError(_0x2dd579,null));};exports[_0x1b2d('0x57')]=function(_0x6408cd,_0x135d6c){return db[_0x1b2d('0x2b')][_0x1b2d('0x57')]()[_0x1b2d('0x26')](respondWithResult(_0x135d6c,null))[_0x1b2d('0x40')](handleError(_0x135d6c,null));};exports[_0x1b2d('0x58')]=function(_0x48adef,_0x254c01){var _0x314c35=_0x48adef['body'];return db['UserProfile']['find']({'where':{'id':_0x48adef[_0x1b2d('0x42')]['id']}})[_0x1b2d('0x26')](handleEntityNotFound(_0x254c01,null))[_0x1b2d('0x26')](function(_0xe6d17){if(_0xe6d17){return db[_0x1b2d('0x4d')][_0x1b2d('0x59')](function(_0x155c15){return db[_0x1b2d('0x4e')][_0x1b2d('0x56')]({'where':{'userProfileId':_0x48adef[_0x1b2d('0x42')]['id'],'sectionId':_[_0x1b2d('0x52')](_0x314c35,function(_0x5bdc7c){return _0x5bdc7c['sectionId'];})},'transaction':_0x155c15})['then'](function(){var _0xbb688=_['map'](_0x314c35,function(_0x5e308b){_0x5e308b[_0x1b2d('0x54')]=_0x48adef[_0x1b2d('0x42')]['id'];return _0x5e308b;});var _0x200a3e=[];return BPromise[_0x1b2d('0x4f')](_0xbb688,function(_0x1d7d02){return db[_0x1b2d('0x4e')][_0x1b2d('0x46')](_0x1d7d02,{'include':[{'model':db[_0x1b2d('0x51')],'as':_0x1b2d('0x55')}],'raw':!![],'transaction':_0x155c15})['then'](function(_0x2037ef){_0x200a3e['push'](_0x2037ef['get']({'plain':!![]}));});})[_0x1b2d('0x26')](function(){return _0x200a3e;});});});}})[_0x1b2d('0x26')](function(_0x3974b7){return _0x3974b7;})[_0x1b2d('0x26')](respondWithResult(_0x254c01,null))[_0x1b2d('0x40')](handleError(_0x254c01,null));};exports[_0x1b2d('0x5a')]=function(_0x53d232,_0x233f18){var _0x5876d4;return db[_0x1b2d('0x2b')][_0x1b2d('0x45')]({'where':{'id':_0x53d232['params']['id']},'attributes':['id',_0x1b2d('0x29')]})['then'](handleEntityNotFound(_0x233f18,null))[_0x1b2d('0x26')](function(_0x55bf73){if(_0x55bf73){_0x5876d4=_0x55bf73;return db[_0x1b2d('0x4e')]['destroy']({'where':{'userProfileId':_0x53d232[_0x1b2d('0x42')]['id'],'sectionId':_0x53d232[_0x1b2d('0x2f')][_0x1b2d('0x5b')]}});}})[_0x1b2d('0x26')](function(){return _0x5876d4;})[_0x1b2d('0x26')](respondWithStatusCode(_0x233f18,null))[_0x1b2d('0x40')](handleError(_0x233f18,null));};exports['addResources']=function(_0x38dc89,_0x57d65b){return db[_0x1b2d('0x2b')]['find']({'where':{'id':_0x38dc89[_0x1b2d('0x42')]['id']}})[_0x1b2d('0x26')](handleEntityNotFound(_0x57d65b,null))['then'](function(_0x5b0a67){if(_0x5b0a67){return db[_0x1b2d('0x4d')][_0x1b2d('0x59')](function(_0x3d2856){return db[_0x1b2d('0x4e')]['findAll']({'where':{'userProfileId':_0x38dc89[_0x1b2d('0x42')]['id']},'attributes':['id'],'raw':!![]})[_0x1b2d('0x26')](function(_0x308252){if(_0x308252){return db[_0x1b2d('0x4e')]['destroy']({'where':{'userProfileId':_0x38dc89['params']['id'],'id':_[_0x1b2d('0x52')](_0x308252,function(_0x159ee8){return _0x159ee8['id'];})},'transaction':_0x3d2856});}})['then'](function(_0x17c14d){var _0x4efb55=_[_0x1b2d('0x52')](_0x38dc89[_0x1b2d('0x4c')],function(_0x3433e4){_0x3433e4['userProfileId']=_0x38dc89['params']['id'];return _0x3433e4;});return db[_0x1b2d('0x4e')][_0x1b2d('0x5c')](_0x4efb55,{'raw':!![],'transaction':_0x3d2856});})['then'](function(_0x212815){var _0xdb86f7=_[_0x1b2d('0x38')](_['map'](_0x212815,function(_0x49ce46){return _0x49ce46[_0x1b2d('0x47')]({'plain':!![]});}),{'includeAll':![]});if(_0xdb86f7){return db[_0x1b2d('0x4e')][_0x1b2d('0x3f')]({'where':{'userProfileId':_0x38dc89[_0x1b2d('0x42')]['id'],'sectionId':_[_0x1b2d('0x52')](_0xdb86f7,function(_0x485837){return _0x485837[_0x1b2d('0x53')];})},'attributes':['id',_0x1b2d('0x53')],'raw':!![]})['then'](function(_0x370b27){var _0x375bb1=_['map'](_0x38dc89['body'],function(_0x4dffae){_0x4dffae[_0x1b2d('0x54')]=_0x38dc89[_0x1b2d('0x42')]['id'];return _0x4dffae;});return db[_0x1b2d('0x51')][_0x1b2d('0x5c')](_0x375bb1,{'raw':!![],'transaction':_0x3d2856});});}})[_0x1b2d('0x40')](handleError(_0x57d65b,null));});}})[_0x1b2d('0x26')](function(_0x12e55b){var _0x51ea7a=_['map'](_0x12e55b,function(_0x296cc2){return _0x296cc2[_0x1b2d('0x47')]({'plain':!![]});});})[_0x1b2d('0x26')](respondWithResult(_0x57d65b,null))[_0x1b2d('0x40')](handleError(_0x57d65b,null));};exports['removeResources']=function(_0x567f87,_0x3914fc,_0x50f1f3){return db['UserProfile'][_0x1b2d('0x45')]({'where':{'id':_0x567f87[_0x1b2d('0x42')]['id']}})[_0x1b2d('0x26')](handleEntityNotFound(_0x3914fc,null))['then'](function(_0x1d9025){if(_0x1d9025){return _0x1d9025[_0x1b2d('0x5d')](_0x567f87[_0x1b2d('0x2f')][_0x1b2d('0x5b')]);}})[_0x1b2d('0x26')](respondWithStatusCode(_0x3914fc,null))[_0x1b2d('0x40')](handleError(_0x3914fc,null));};exports[_0x1b2d('0x5e')]=function(_0x49d5f3,_0x96feb6){var _0xc6faeb={'raw':![],'where':{}};var _0x435955={};var _0x2ff769={'count':0x0,'rows':[]};var _0x284065=_0x49d5f3[_0x1b2d('0x2f')][_0x1b2d('0x5f')];if(typeof _0x284065===_0x1b2d('0x60')){throw new db[(_0x1b2d('0x61'))][(_0x1b2d('0x62'))]('Unknown\x20section');}var _0x548076=_0x49d5f3[_0x1b2d('0x2f')][_0x1b2d('0x63')]||![];var _0x4feb46=getQueryModels(_0x284065,_0x548076);if(typeof _0x4feb46[_0x1b2d('0x64')]===_0x1b2d('0x60')){throw new db[(_0x1b2d('0x61'))]['ValidationError'](_0x1b2d('0x65')+_0x284065+'\x27');}var _0x3b8be7=[];if(!_[_0x1b2d('0x66')](_0x4feb46['parentSections'])){_0x3b8be7=_0x4feb46[_0x1b2d('0x67')];}else{_0x3b8be7=[{'name':_0x284065}];}return db[_0x1b2d('0x2b')][_0x1b2d('0x68')]({'where':{'id':_0x49d5f3[_0x1b2d('0x42')]['id']}})[_0x1b2d('0x26')](handleEntityNotFound(_0x96feb6,null))[_0x1b2d('0x26')](function(_0x3aa47a){if(_0x3aa47a){var _0x3d2132=[];for(var _0x2ddc3c=0x0;_0x2ddc3c<_0x3b8be7['length'];_0x2ddc3c++){_0x3d2132[_0x1b2d('0x69')](db[_0x1b2d('0x4e')]['findOne']({'where':{'userProfileId':_0x3aa47a['id'],'name':_0x3b8be7[_0x2ddc3c][_0x1b2d('0x29')]},'raw':!![]}));}return BPromise[_0x1b2d('0x6a')](_0x3d2132);}})['then'](function(_0x15b256){var _0x10b295=_['filter'](_0x15b256,function(_0x44dfb5){return _0x44dfb5?_0x44dfb5:undefined;});var _0x25d6c6=_[_0x1b2d('0x38')](_0x3b8be7,[_0x1b2d('0x6b'),!![]]);var _0x4c8c8d=_[_0x1b2d('0x66')](_0x10b295)&&_[_0x1b2d('0x66')](_0x25d6c6)?null:_[_0x1b2d('0x6c')](_0x25d6c6,_0x10b295);if(_0x4c8c8d){var _0x308847=[];for(var _0x5cb8ff=0x0;_0x5cb8ff<_0x4c8c8d[_0x1b2d('0x43')];_0x5cb8ff++){var _0x3792e4=_[_0x1b2d('0x45')](_0x3b8be7,function(_0x5e4a4f){return _0x4c8c8d[_0x5cb8ff]?_0x5e4a4f[_0x1b2d('0x29')]===_0x4c8c8d[_0x5cb8ff][_0x1b2d('0x29')]:null;});if(_0x3792e4){if(_0x4c8c8d[_0x5cb8ff][_0x1b2d('0x6b')]){_0x308847[_0x1b2d('0x69')](getAllResources(_0x4feb46[_0x1b2d('0x64')],_0x4c8c8d[_0x5cb8ff]));}else{if(!_0x4c8c8d[_0x5cb8ff]['autoAssociation']){_0x308847[_0x1b2d('0x69')](getAllowedResources(_0x3792e4,_0x4c8c8d[_0x5cb8ff],_0x4feb46[_0x1b2d('0x64')]));}else{if(_0x3792e4['model']){_0x308847[_0x1b2d('0x69')](getAllFilteredResources(_0x3792e4,_0x4c8c8d[_0x5cb8ff]));}}}}}return BPromise[_0x1b2d('0x6a')](_0x308847);}else{return null;}})[_0x1b2d('0x26')](function(_0x4aa5ac){var _0x47d73d=_0x4aa5ac;var _0x2b5c62=null;if(_0x47d73d){_0x2b5c62=_0x47d73d[_0x1b2d('0x43')]===0x1?_0x47d73d[0x0]:null;}if(_0x2b5c62||_0x47d73d){var _0x345148=db[_0x4feb46['childModel']][_0x1b2d('0x2c')];_0x435955[_0x1b2d('0x2d')]=_[_0x1b2d('0x2e')](_0x345148);_0x435955[_0x1b2d('0x2f')]=_['keys'](_0x49d5f3[_0x1b2d('0x2f')]);_0x435955[_0x1b2d('0x30')]=_[_0x1b2d('0x32')](_0x435955[_0x1b2d('0x2d')],_0x435955['query']);_0xc6faeb[_0x1b2d('0x31')]=_['intersection'](_0x435955['model'],qs['fields'](_0x49d5f3[_0x1b2d('0x2f')][_0x1b2d('0x33')]));_0xc6faeb['attributes']=_0xc6faeb[_0x1b2d('0x31')][_0x1b2d('0x43')]?_0xc6faeb['attributes']:_0x435955[_0x1b2d('0x2d')];if(!_0x49d5f3[_0x1b2d('0x2f')][_0x1b2d('0x34')](_0x1b2d('0x6d'))){_0xc6faeb[_0x1b2d('0x1f')]=qs[_0x1b2d('0x1f')](_0x49d5f3[_0x1b2d('0x2f')][_0x1b2d('0x1f')]);_0xc6faeb[_0x1b2d('0x1e')]=qs['offset'](_0x49d5f3['query']['offset']);}_0xc6faeb[_0x1b2d('0x6e')]=qs[_0x1b2d('0x35')](_0x49d5f3[_0x1b2d('0x2f')][_0x1b2d('0x35')]);_0xc6faeb[_0x1b2d('0x36')]=qs[_0x1b2d('0x30')](_['pick'](_0x49d5f3['query'],_0x435955[_0x1b2d('0x30')]));if(_0x49d5f3[_0x1b2d('0x2f')][_0x1b2d('0x38')]){_0xc6faeb[_0x1b2d('0x36')]=_['merge'](_0xc6faeb['where'],{'$or':_[_0x1b2d('0x52')](_0x345148,function(_0x4f31ad){if(_0x4f31ad[_0x1b2d('0x3a')][_0x1b2d('0x3b')]!=='VIRTUAL'){var _0x2d5506={};_0x2d5506[_0x4f31ad[_0x1b2d('0x6f')]]={'$like':'%'+_0x49d5f3[_0x1b2d('0x2f')][_0x1b2d('0x38')]+'%'};return _0x2d5506;}})});}var _0xe9d8b9=[];if(_0x2b5c62){var _0x424313=_[_0x1b2d('0x45')](_0x3b8be7,['name',_0x2b5c62[_0x1b2d('0x29')]]);if(_0x424313['field']){var _0x5de5d9={};if(_0x4feb46[_0x1b2d('0x64')]==='AnalyticExtractedReport'){_0x5de5d9[_0x424313['foreignKey']]=_[_0x1b2d('0x52')](_0x2b5c62[_0x1b2d('0x70')],'id');}else{_0x5de5d9[_0x424313['foreignKey']]=_0x2b5c62[_0x1b2d('0x70')];}_0xe9d8b9[_0x1b2d('0x69')](_0x5de5d9);}else{_0xc6faeb[_0x1b2d('0x36')]['id']=_0x2b5c62[_0x1b2d('0x70')];}}else{for(var _0x2aee86=0x0;_0x2aee86<_0x47d73d[_0x1b2d('0x43')];_0x2aee86++){var _0x424313=_[_0x1b2d('0x45')](_0x3b8be7,['name',_0x47d73d[_0x2aee86][_0x1b2d('0x29')]]);if(_0x424313['field']){var _0x5de5d9={};_0x5de5d9[_0x424313[_0x1b2d('0x71')]]=_0x47d73d[_0x2aee86][_0x1b2d('0x70')];_0xe9d8b9[_0x1b2d('0x69')](_0x5de5d9);}else{if(!_0xc6faeb[_0x1b2d('0x36')]['id'])_0xc6faeb[_0x1b2d('0x36')]['id']=[];_0x47d73d[_0x2aee86][_0x1b2d('0x70')][_0x1b2d('0x72')](function(_0x47c979){_0xc6faeb[_0x1b2d('0x36')]['id'][_0x1b2d('0x69')](_0x47c979);});}}}if(!_[_0x1b2d('0x66')](_0xe9d8b9)){_0xc6faeb[_0x1b2d('0x36')]=_[_0x1b2d('0x39')](_0xc6faeb[_0x1b2d('0x36')],{'$and':{'$or':_0xe9d8b9}});}_0xc6faeb=_[_0x1b2d('0x39')]({},_0xc6faeb,_0x49d5f3[_0x1b2d('0x44')]);if(_0x2b5c62&&!_0x2b5c62[_0x1b2d('0x50')]&&_0x4feb46[_0x1b2d('0x64')]===_0x1b2d('0x73')){if(_0x49d5f3[_0x1b2d('0x2f')]['includeAll']){_0xc6faeb[_0x1b2d('0x74')]=[{'all':!![]}];}return db[_0x4feb46[_0x1b2d('0x64')]][_0x1b2d('0x3f')](_0xc6faeb)[_0x1b2d('0x26')](function(_0x273d6a){var _0x3cd870=[];_0x273d6a[_0x1b2d('0x72')](function(_0x22aef3){var _0x1df008;switch(_0x22aef3[_0x1b2d('0x75')]){case _0x1b2d('0x76'):_0x1df008=_[_0x1b2d('0x45')](_0x2b5c62[_0x1b2d('0x70')],function(_0x1f4b37){return _0x1f4b37['id']===_0x22aef3[_0x1b2d('0x77')]&&_0x1f4b37[_0x1b2d('0x3a')]===_0x1b2d('0x78');});break;case _0x1b2d('0x79'):_0x1df008=_['find'](_0x2b5c62[_0x1b2d('0x70')],function(_0x382b80){return _0x382b80['id']===_0x22aef3[_0x1b2d('0x77')]&&_0x382b80[_0x1b2d('0x3a')]==='CustomReports';});break;}if(_0x1df008)_0x3cd870['push'](_0x22aef3);});_0x2ff769[_0x1b2d('0x3d')]=_0x3cd870[_0x1b2d('0x43')];_0x2ff769[_0x1b2d('0x7a')]=_0x3cd870;return _0x2ff769;});}else{return db[_0x4feb46[_0x1b2d('0x64')]][_0x1b2d('0x3d')]({'where':_0xc6faeb[_0x1b2d('0x36')]})[_0x1b2d('0x26')](function(_0xa0e6a9){_0x2ff769[_0x1b2d('0x3d')]=_0xa0e6a9;if(_0x49d5f3[_0x1b2d('0x2f')]['includeAll']){if(_0x4feb46['childModel']===_0x1b2d('0x7b')){_0xc6faeb[_0x1b2d('0x74')]=[{'model':db[_0x1b2d('0x7c')],'as':_0x1b2d('0x7d'),'attributes':['id',_0x1b2d('0x29'),_0x1b2d('0x7e')],'required':_0x49d5f3[_0x1b2d('0x2f')][_0x1b2d('0x7f')]?!![]:![]},{'model':db[_0x1b2d('0x7c')],'as':_0x1b2d('0x80'),'attributes':['id','name','color'],'through':_0x49d5f3[_0x1b2d('0x2f')][_0x1b2d('0x7f')]?{'attributes':[],'where':{'TagId':_0x49d5f3[_0x1b2d('0x2f')]['tag']||undefined}}:{},'required':_0x49d5f3[_0x1b2d('0x2f')][_0x1b2d('0x7f')]?!![]:![]}];}else{_0xc6faeb[_0x1b2d('0x74')]=[{'all':!![]}];}}return db[_0x4feb46['childModel']][_0x1b2d('0x3f')](_0xc6faeb);})['then'](function(_0x2775a0){_0x2ff769['rows']=_0x2775a0;return _0x2ff769;});}}else{return _0x2ff769;}})[_0x1b2d('0x26')](respondWithFilteredResult(_0x96feb6,_0xc6faeb))[_0x1b2d('0x40')](handleError(_0x96feb6,null));};function getAllResources(_0x301a40,_0xae6add){return new BPromise(function(_0x4c7107,_0x4e136f){if(_0xae6add){var _0x5cbfde=_0xae6add[_0x1b2d('0x38')]?{[_0xae6add[_0x1b2d('0x38')]['field']]:_0xae6add[_0x1b2d('0x38')][_0x1b2d('0x81')]}:undefined;return db[_0x301a40][_0x1b2d('0x3f')]({'where':_0x5cbfde,'raw':!![]})[_0x1b2d('0x26')](function(_0x48794a){_0xae6add[_0x1b2d('0x70')]=_[_0x1b2d('0x52')](_0x48794a,'id');_0x4c7107(_0xae6add);})[_0x1b2d('0x40')](function(_0x38b691){_0x4e136f(_0x38b691);});}else{_0x4c7107(null);}});}function getAllFilteredResources(_0x101b2d,_0x3dca87){return new BPromise(function(_0x2ec3fd,_0x27bb03){var _0x33c64d=_0x101b2d['filter']?{[_0x101b2d[_0x1b2d('0x38')][_0x1b2d('0x6f')]]:_0x101b2d[_0x1b2d('0x38')]['value']}:undefined;return db[_0x101b2d[_0x1b2d('0x2d')]]['findAll']({'where':_0x33c64d,'raw':!![]})[_0x1b2d('0x26')](function(_0x11765f){_0x3dca87[_0x1b2d('0x70')]=_['map'](_0x11765f,function(_0x50afab){return _0x50afab['name'];});_0x2ec3fd(_0x3dca87);})['catch'](function(_0x537634){_0x27bb03(_0x537634);});});}function getAllowedResources(_0x347fb0,_0x19afd6,_0xfa6171){return new BPromise(function(_0x4c996a,_0x129011){if(_0x19afd6){return db[_0x1b2d('0x51')]['findAll']({'where':{'sectionId':_0x19afd6['id']},'raw':!![]})[_0x1b2d('0x26')](function(_0x41a9d9){if(_0x347fb0['field']&&_0x347fb0[_0x1b2d('0x6f')]!=='id'){_0x19afd6['associatedResources']=_[_0x1b2d('0x52')](_0x41a9d9,function(_0x47cfe0){return _0x47cfe0[_0x347fb0['field']];});}else{if(_0xfa6171===_0x1b2d('0x73')){_0x19afd6['associatedResources']=_[_0x1b2d('0x52')](_0x41a9d9,function(_0x3d03ce){return{'id':_0x3d03ce[_0x1b2d('0x82')],'type':_0x3d03ce[_0x1b2d('0x3a')]};});}else{_0x19afd6['associatedResources']=_[_0x1b2d('0x52')](_0x41a9d9,function(_0x13496c){return _0x13496c['resourceId'];});}}_0x4c996a(_0x19afd6);})[_0x1b2d('0x40')](function(_0x41734c){_0x129011(_0x41734c);});}else{_0x4c996a(null);}});}function getQueryModels(_0x395bb0,_0x3da11b){var _0x5c9054=_0x395bb0[_0x1b2d('0x83')]();var _0x517ec6={'childModel':undefined,'parentSections':[]};switch(_0x5c9054){case _0x1b2d('0x84'):_0x517ec6[_0x1b2d('0x64')]='SquareProject';break;case _0x1b2d('0x85'):_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0x86');break;case _0x1b2d('0x87'):_0x517ec6['childModel']=_0x1b2d('0x88');_0x517ec6[_0x1b2d('0x67')]=[{'name':_0x1b2d('0x89'),'field':_0x1b2d('0x29'),'foreignKey':_0x1b2d('0x8a')}];break;case _0x1b2d('0x8b'):_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0x8c');break;case _0x1b2d('0x8d'):_0x517ec6[_0x1b2d('0x64')]='CmContact';_0x517ec6[_0x1b2d('0x67')]=[{'name':_0x1b2d('0x8e'),'field':'id','foreignKey':_0x1b2d('0x8f')}];break;case'lists':_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0x90');break;case _0x1b2d('0x91'):_0x517ec6[_0x1b2d('0x64')]='CmCompany';break;case _0x1b2d('0x92'):_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0x93');break;case _0x1b2d('0x94'):_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0x95');break;case'chatwebsites':_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0x96');break;case'faxqueues':_0x517ec6['childModel']=_0x1b2d('0x97');break;case _0x1b2d('0x98'):_0x517ec6['childModel']=_0x1b2d('0x99');break;case _0x1b2d('0x9a'):case _0x1b2d('0x9b'):case _0x1b2d('0x9c'):_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0x9d');break;case _0x1b2d('0x9e'):_0x517ec6[_0x1b2d('0x64')]='VoiceContext';break;case'voicemails':_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0x9f');break;case'voicerecordings':_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0xa0');_0x517ec6[_0x1b2d('0x67')]=[{'name':_0x1b2d('0xa1'),'field':'name','foreignKey':'membername','model':_0x1b2d('0xa2'),'filter':{'field':_0x1b2d('0xa3'),'value':['agent']}},{'name':_0x1b2d('0xa4'),'field':'name','foreignKey':_0x1b2d('0xa5'),'model':_0x1b2d('0xa2'),'filter':{'field':_0x1b2d('0xa3'),'value':[_0x1b2d('0xa6')]}},{'name':_0x1b2d('0xa7'),'field':_0x1b2d('0x29'),'foreignKey':_0x1b2d('0xa8'),'model':_0x1b2d('0xa9'),'filter':{'field':'type','value':[_0x1b2d('0xaa')]}},{'name':_0x1b2d('0xab'),'field':_0x1b2d('0x29'),'foreignKey':_0x1b2d('0xa8'),'model':'VoiceQueue','filter':{'field':_0x1b2d('0x3a'),'value':['outbound']}}];break;case'musiconholds':_0x517ec6['childModel']='VoiceMusicOnHold';break;case _0x1b2d('0xac'):_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0xad');break;case _0x1b2d('0xae'):_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0xaf');break;case _0x1b2d('0xb0'):_0x517ec6[_0x1b2d('0x64')]='Campaign';break;case _0x1b2d('0xb1'):_0x517ec6[_0x1b2d('0x64')]='MailQueue';break;case'mailaccounts':_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0xb2');break;case'mailsubstatuses':_0x517ec6[_0x1b2d('0x64')]='MailSubstatus';break;case _0x1b2d('0xb3'):_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0xb4');break;case'openchannelaccounts':_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0xb5');break;case'smsqueues':_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0xb6');break;case _0x1b2d('0xb7'):_0x517ec6['childModel']=_0x1b2d('0xb8');break;case _0x1b2d('0xb9'):_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0xba');break;case'voicequeues':case'queuecampaigns':_0x517ec6['childModel']=_0x1b2d('0xa9');if(_0x3da11b){_0x517ec6[_0x1b2d('0x67')]=[{'name':'VoiceQueues'},{'name':_0x1b2d('0xab')}];}break;case _0x1b2d('0xbb'):case _0x1b2d('0xbc'):case _0x1b2d('0xbd'):_0x517ec6['childModel']=_0x1b2d('0xa2');if(_0x3da11b){_0x517ec6['parentSections']=[{'name':'Users','filter':{'field':'role','value':[_0x1b2d('0xbe'),_0x1b2d('0xbf')]},'ignore':!![]},{'name':_0x1b2d('0xa1')},{'name':_0x1b2d('0xa4')}];}break;case _0x1b2d('0xc0'):_0x517ec6['childModel']='ZendeskAccount';break;case _0x1b2d('0xc1'):_0x517ec6['childModel']='SalesforceAccount';break;case _0x1b2d('0xc2'):_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0xc3');break;case _0x1b2d('0xc4'):_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0xc5');break;case _0x1b2d('0xc6'):_0x517ec6['childModel']=_0x1b2d('0xc7');break;case'zohoaccounts':_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0xc8');break;case _0x1b2d('0xc9'):_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0xa2');break;case'cannedanswers':_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0xca');break;case _0x1b2d('0xcb'):_0x517ec6[_0x1b2d('0x64')]='Disposition';break;case _0x1b2d('0xcc'):_0x517ec6['childModel']=_0x1b2d('0xcd');break;case'intervals':_0x517ec6[_0x1b2d('0x64')]='Interval';break;case'pauses':_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0xce');break;case _0x1b2d('0xcf'):_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0xd0');break;case'sounds':_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0xd1');break;case _0x1b2d('0xd2'):_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0x7c');break;case'templates':_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0xd3');break;case'triggers':_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0xd4');break;case'trunks':_0x517ec6[_0x1b2d('0x64')]='Trunk';break;case _0x1b2d('0xd5'):_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0xd6');break;case _0x1b2d('0xd7'):_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0xd8');break;case'extractedreports':_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0x73');_0x517ec6[_0x1b2d('0x67')]=[{'name':_0x1b2d('0xd9'),'field':'id','foreignKey':'reportId'}];break;case _0x1b2d('0xda'):_0x517ec6[_0x1b2d('0x64')]=_0x1b2d('0xdb');break;default:return _0x517ec6;}return _0x517ec6;} \ No newline at end of file +var _0xbec5=['include','findAll','catch','show','create','body','params','find','get','createdAt','crudPermissions','omit','updatedAt','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','removeSections','ids','addResources','bulkCreate','removeResources','getResources','section','Sequelize','ValidationError','Unknown\x20section','childModel','isEmpty','parentSections','push','findOne','all','ignore','union','foreignKey','associatedResources','forEach','AnalyticExtractedReport','reportType','reportId','custom','CustomReports','rows','CmContact','Tag','Tags','color','tag','ThroughTags','value','resourceId','squareprojects','SquareProject','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','agent','Telephones','role','queue','VoiceQueue','inbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','teams','Team','queuecampaigns','VoiceQueues','users','agents','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Interval','Pause','sounds','Sound','tags','templates','Template','Trigger','Trunk','variables','plugins','extractedreports','Reports','AnalyticMetric','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','UserProfile','includeAll'];(function(_0x32b41b,_0x27dbd2){var _0x1a4ce5=function(_0x404346){while(--_0x404346){_0x32b41b['push'](_0x32b41b['shift']());}};_0x1a4ce5(++_0x27dbd2);}(_0xbec5,0x9d));var _0x5bec=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0xbec5[_0x2d91c6];return _0x3a8d19;};'use strict';var pdf=require(_0x5bec('0x0'));var emlformat=require(_0x5bec('0x1'));var rimraf=require(_0x5bec('0x2'));var zipdir=require(_0x5bec('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5bec('0x4'));var BPromise=require(_0x5bec('0x5'));var Mustache=require(_0x5bec('0x6'));var util=require('util');var path=require(_0x5bec('0x7'));var sox=require(_0x5bec('0x8'));var csv=require('to-csv');var ejs=require(_0x5bec('0x9'));var fs=require('fs');var _=require(_0x5bec('0xa'));var squel=require(_0x5bec('0xb'));var crypto=require('crypto');var jsforce=require(_0x5bec('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5bec('0xd'))('api');var utils=require(_0x5bec('0xe'));var config=require('../../config/environment');var db=require(_0x5bec('0xf'))['db'];config[_0x5bec('0x10')]=_[_0x5bec('0x11')](config[_0x5bec('0x10')],{'host':'localhost','port':0x18eb});var socket=require(_0x5bec('0x12'))(new Redis(config['redis']));require('./userProfile.socket')[_0x5bec('0x13')](socket);function respondWithStatusCode(_0x86be33,_0x3f8825){_0x3f8825=_0x3f8825||0xcc;return function(_0x329812){if(_0x329812){return _0x86be33[_0x5bec('0x14')](_0x3f8825);}return _0x86be33['status'](_0x3f8825)[_0x5bec('0x15')]();};}function respondWithResult(_0x286276,_0x3e2e06){_0x3e2e06=_0x3e2e06||0xc8;return function(_0x3300ba){if(_0x3300ba){return _0x286276[_0x5bec('0x16')](_0x3e2e06)[_0x5bec('0x17')](_0x3300ba);}};}function respondWithFilteredResult(_0x1ff1e1,_0x9eac4b){return function(_0x5f0aa9){if(_0x5f0aa9){var _0x2e2fea=_0x5f0aa9[_0x5bec('0x18')],_0x2cf61d=_0x9eac4b[_0x5bec('0x19')],_0x341d8b=_0x9eac4b[_0x5bec('0x19')]+_0x9eac4b[_0x5bec('0x1a')],_0x40013f;if(_0x341d8b>=_0x2e2fea){_0x341d8b=_0x2e2fea;_0x40013f=0xc8;}else{_0x40013f=0xce;}_0x1ff1e1['status'](_0x40013f);return _0x1ff1e1[_0x5bec('0x1b')](_0x5bec('0x1c'),_0x2cf61d+'-'+_0x341d8b+'/'+_0x2e2fea)[_0x5bec('0x17')](_0x5f0aa9);}return null;};}function patchUpdates(_0x3c2600){return function(_0x4bf5a5){try{jsonpatch[_0x5bec('0x1d')](_0x4bf5a5,_0x3c2600,!![]);}catch(_0x156b38){return BPromise[_0x5bec('0x1e')](_0x156b38);}return _0x4bf5a5[_0x5bec('0x1f')]();};}function saveUpdates(_0x5e3420,_0x109ea8){return function(_0x5e768a){if(_0x5e768a){return _0x5e768a[_0x5bec('0x20')](_0x5e3420)[_0x5bec('0x21')](function(_0x43acaf){return _0x43acaf;});}return null;};}function removeEntity(_0x3f410d,_0x5f3785){return function(_0x32c980){if(_0x32c980){return _0x32c980[_0x5bec('0x22')]()[_0x5bec('0x21')](function(){_0x3f410d[_0x5bec('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x182fc8,_0x524450){return function(_0x1361de){if(!_0x1361de){_0x182fc8['sendStatus'](0x194);}return _0x1361de;};}function handleError(_0x4275f5,_0x443d3d){_0x443d3d=_0x443d3d||0x1f4;return function(_0x1dde78){logger[_0x5bec('0x23')](_0x1dde78[_0x5bec('0x24')]);if(_0x1dde78[_0x5bec('0x25')]){delete _0x1dde78['name'];}_0x4275f5['status'](_0x443d3d)[_0x5bec('0x26')](_0x1dde78);};}exports['index']=function(_0x793e96,_0x506a87){var _0x353cca={},_0x4a2e29={},_0x197377={'count':0x0,'rows':[]};var _0x2c0074=db['UserProfile'][_0x5bec('0x27')];_0x4a2e29[_0x5bec('0x28')]=_['keys'](_0x2c0074);_0x4a2e29['query']=_[_0x5bec('0x29')](_0x793e96['query']);_0x4a2e29[_0x5bec('0x2a')]=_[_0x5bec('0x2b')](_0x4a2e29[_0x5bec('0x28')],_0x4a2e29[_0x5bec('0x2c')]);_0x353cca[_0x5bec('0x2d')]=_['intersection'](_0x4a2e29[_0x5bec('0x28')],qs[_0x5bec('0x2e')](_0x793e96[_0x5bec('0x2c')][_0x5bec('0x2e')]));_0x353cca['attributes']=_0x353cca[_0x5bec('0x2d')][_0x5bec('0x2f')]?_0x353cca[_0x5bec('0x2d')]:_0x4a2e29[_0x5bec('0x28')];if(!_0x793e96[_0x5bec('0x2c')][_0x5bec('0x30')](_0x5bec('0x31'))){_0x353cca[_0x5bec('0x1a')]=qs[_0x5bec('0x1a')](_0x793e96['query'][_0x5bec('0x1a')]);_0x353cca[_0x5bec('0x19')]=qs['offset'](_0x793e96['query'][_0x5bec('0x19')]);}_0x353cca[_0x5bec('0x32')]=qs[_0x5bec('0x33')](_0x793e96[_0x5bec('0x2c')][_0x5bec('0x33')]);_0x353cca[_0x5bec('0x34')]=qs[_0x5bec('0x2a')](_['pick'](_0x793e96[_0x5bec('0x2c')],_0x4a2e29[_0x5bec('0x2a')]));if(_0x793e96['query'][_0x5bec('0x35')]){_0x353cca[_0x5bec('0x34')]=_[_0x5bec('0x36')](_0x353cca[_0x5bec('0x34')],{'$or':_[_0x5bec('0x37')](_0x2c0074,function(_0x40d8a5){if(_0x40d8a5[_0x5bec('0x38')][_0x5bec('0x39')]!==_0x5bec('0x3a')){var _0x44d89c={};_0x44d89c[_0x40d8a5[_0x5bec('0x3b')]]={'$like':'%'+_0x793e96[_0x5bec('0x2c')][_0x5bec('0x35')]+'%'};return _0x44d89c;}})});}_0x353cca=_[_0x5bec('0x36')]({},_0x353cca,_0x793e96[_0x5bec('0x3c')]);var _0x151c2c={'where':_0x353cca[_0x5bec('0x34')]};return db[_0x5bec('0x3d')][_0x5bec('0x18')](_0x151c2c)[_0x5bec('0x21')](function(_0x5d2b8b){_0x197377[_0x5bec('0x18')]=_0x5d2b8b;if(_0x793e96['query'][_0x5bec('0x3e')]){_0x353cca[_0x5bec('0x3f')]=[{'all':!![]}];}return db[_0x5bec('0x3d')][_0x5bec('0x40')](_0x353cca);})[_0x5bec('0x21')](function(_0x102cbf){_0x197377['rows']=_0x102cbf;return _0x197377;})[_0x5bec('0x21')](respondWithFilteredResult(_0x506a87,_0x353cca))[_0x5bec('0x41')](handleError(_0x506a87,null));};exports[_0x5bec('0x42')]=function(_0x176f8a,_0x112a51){var _0x295554={'raw':![],'where':{'id':_0x176f8a['params']['id']}},_0x314157={};_0x314157[_0x5bec('0x28')]=_[_0x5bec('0x29')](db[_0x5bec('0x3d')][_0x5bec('0x27')]);_0x314157[_0x5bec('0x2c')]=_[_0x5bec('0x29')](_0x176f8a[_0x5bec('0x2c')]);_0x314157[_0x5bec('0x2a')]=_[_0x5bec('0x2b')](_0x314157[_0x5bec('0x28')],_0x314157[_0x5bec('0x2c')]);_0x295554['attributes']=_[_0x5bec('0x2b')](_0x314157[_0x5bec('0x28')],qs[_0x5bec('0x2e')](_0x176f8a[_0x5bec('0x2c')][_0x5bec('0x2e')]));_0x295554[_0x5bec('0x2d')]=_0x295554[_0x5bec('0x2d')]['length']?_0x295554[_0x5bec('0x2d')]:_0x314157[_0x5bec('0x28')];if(_0x176f8a[_0x5bec('0x2c')][_0x5bec('0x3e')]){_0x295554[_0x5bec('0x3f')]=[{'all':!![]}];}_0x295554=_['merge']({},_0x295554,_0x176f8a[_0x5bec('0x3c')]);return db[_0x5bec('0x3d')]['find'](_0x295554)[_0x5bec('0x21')](handleEntityNotFound(_0x112a51,null))[_0x5bec('0x21')](respondWithResult(_0x112a51,null))[_0x5bec('0x41')](handleError(_0x112a51,null));};exports[_0x5bec('0x43')]=function(_0x766267,_0x1d082f){return db[_0x5bec('0x3d')][_0x5bec('0x43')](_0x766267[_0x5bec('0x44')],{})[_0x5bec('0x21')](respondWithResult(_0x1d082f,0xc9))[_0x5bec('0x41')](handleError(_0x1d082f,null));};exports['clone']=function(_0x1a99dd,_0x466b86){var _0x57a05d={'raw':![],'where':{'id':_0x1a99dd[_0x5bec('0x45')]['id']}},_0x1d6688={};_0x1d6688[_0x5bec('0x28')]=_[_0x5bec('0x29')](db['UserProfile'][_0x5bec('0x27')]);_0x57a05d[_0x5bec('0x2d')]=_['intersection'](_0x1d6688['model'],qs[_0x5bec('0x2e')](_0x1a99dd[_0x5bec('0x2c')][_0x5bec('0x2e')]));_0x57a05d[_0x5bec('0x2d')]=_0x57a05d[_0x5bec('0x2d')][_0x5bec('0x2f')]?_0x57a05d['attributes']:_0x1d6688['model'];if(_0x1a99dd[_0x5bec('0x2c')][_0x5bec('0x3e')]){_0x57a05d[_0x5bec('0x3f')]=[{'all':!![]}];}_0x57a05d=_['merge']({},_0x57a05d,_0x1a99dd['options']);return db['UserProfile'][_0x5bec('0x46')](_0x57a05d)[_0x5bec('0x21')](handleEntityNotFound(_0x466b86,null))['then'](function(_0x15aa22){if(_0x15aa22){var _0x55ceb7=_0x15aa22[_0x5bec('0x47')]({'plain':!![]});_0x55ceb7=qs['omit'](_0x55ceb7,['id',_0x5bec('0x48'),'updatedAt',_0x5bec('0x49')]);_0x1a99dd[_0x5bec('0x44')]=_[_0x5bec('0x4a')](_0x1a99dd[_0x5bec('0x44')],['id','createdAt',_0x5bec('0x4b')]);return db[_0x5bec('0x4c')][_0x5bec('0x4d')](function(_0x492408){return db['UserProfile'][_0x5bec('0x43')](_[_0x5bec('0x36')](_0x55ceb7,_0x1a99dd[_0x5bec('0x44')]),{'include':_0x1a99dd[_0x5bec('0x2c')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x492408})['then'](function(_0x1f8187){var _0x5db86f=_0x1f8187[_0x5bec('0x47')]({'plain':!![]});return db[_0x5bec('0x4e')]['findAll']({'where':{'userProfileId':_0x1a99dd[_0x5bec('0x45')]['id']},'raw':!![]})[_0x5bec('0x21')](function(_0x3acc3c){if(_0x3acc3c){return BPromise[_0x5bec('0x4f')](_0x3acc3c,function(_0x427434){return new BPromise(function(_0x409a60,_0x40a527){if(_0x427434[_0x5bec('0x50')]===null||_0x427434[_0x5bec('0x50')]===0x1)_0x409a60(null);return db[_0x5bec('0x51')]['findAll']({'where':{'sectionId':_0x427434['id']},'raw':!![]})[_0x5bec('0x21')](function(_0x11e3b6){var _0x4ce213=_[_0x5bec('0x37')](_0x11e3b6,function(_0x6f4a8d){return qs[_0x5bec('0x4a')](_0x6f4a8d,['id',_0x5bec('0x48'),_0x5bec('0x4b'),_0x5bec('0x52')]);});_0x409a60(_0x4ce213);})['catch'](function(_0x51226d){_0x40a527(_0x51226d);});})[_0x5bec('0x21')](function(_0x410487){var _0x557a72=qs[_0x5bec('0x4a')](_0x427434,['id',_0x5bec('0x48'),_0x5bec('0x4b')]);_0x557a72[_0x5bec('0x53')]=_0x5db86f['id'];if(_0x410487)_0x557a72[_0x5bec('0x54')]=_0x410487;return _0x557a72;})[_0x5bec('0x21')](function(_0x346c94){return db[_0x5bec('0x4e')][_0x5bec('0x43')](_0x346c94,{'include':[{'model':db[_0x5bec('0x51')],'as':_0x5bec('0x54')}],'raw':!![],'transaction':_0x492408});});})[_0x5bec('0x21')](function(){return _0x5db86f;});}});});});}})[_0x5bec('0x21')](respondWithResult(_0x466b86,0xc9))['catch'](handleError(_0x466b86,null));};exports[_0x5bec('0x20')]=function(_0x43681d,_0x296414){if(_0x43681d[_0x5bec('0x44')]['id']){delete _0x43681d['body']['id'];}return db[_0x5bec('0x3d')][_0x5bec('0x46')]({'where':{'id':_0x43681d[_0x5bec('0x45')]['id']}})[_0x5bec('0x21')](handleEntityNotFound(_0x296414,null))[_0x5bec('0x21')](saveUpdates(_0x43681d[_0x5bec('0x44')],null))['then'](respondWithResult(_0x296414,null))[_0x5bec('0x41')](handleError(_0x296414,null));};exports[_0x5bec('0x22')]=function(_0x27b7d4,_0xbe337e){return db[_0x5bec('0x3d')][_0x5bec('0x46')]({'where':{'id':_0x27b7d4[_0x5bec('0x45')]['id']}})['then'](handleEntityNotFound(_0xbe337e,null))[_0x5bec('0x21')](removeEntity(_0xbe337e,null))[_0x5bec('0x41')](handleError(_0xbe337e,null));};exports[_0x5bec('0x55')]=function(_0x248963,_0x57a4ef){return db[_0x5bec('0x3d')][_0x5bec('0x55')]()[_0x5bec('0x21')](respondWithResult(_0x57a4ef,null))[_0x5bec('0x41')](handleError(_0x57a4ef,null));};exports[_0x5bec('0x56')]=function(_0x11c4bf,_0x53c905){var _0x557e72=_0x11c4bf[_0x5bec('0x44')];return db[_0x5bec('0x3d')][_0x5bec('0x46')]({'where':{'id':_0x11c4bf[_0x5bec('0x45')]['id']}})[_0x5bec('0x21')](handleEntityNotFound(_0x53c905,null))['then'](function(_0x1fd28e){if(_0x1fd28e){return db[_0x5bec('0x4c')][_0x5bec('0x4d')](function(_0x4df45e){return db['UserProfileSection'][_0x5bec('0x22')]({'where':{'userProfileId':_0x11c4bf[_0x5bec('0x45')]['id'],'sectionId':_[_0x5bec('0x37')](_0x557e72,function(_0x2c33e5){return _0x2c33e5[_0x5bec('0x52')];})},'transaction':_0x4df45e})['then'](function(){var _0x363367=_[_0x5bec('0x37')](_0x557e72,function(_0xaa31c8){_0xaa31c8[_0x5bec('0x53')]=_0x11c4bf[_0x5bec('0x45')]['id'];return _0xaa31c8;});var _0x503e24=[];return BPromise[_0x5bec('0x4f')](_0x363367,function(_0x29d9b5){return db[_0x5bec('0x4e')]['create'](_0x29d9b5,{'include':[{'model':db[_0x5bec('0x51')],'as':_0x5bec('0x54')}],'raw':!![],'transaction':_0x4df45e})[_0x5bec('0x21')](function(_0xa99243){_0x503e24['push'](_0xa99243[_0x5bec('0x47')]({'plain':!![]}));});})[_0x5bec('0x21')](function(){return _0x503e24;});});});}})[_0x5bec('0x21')](function(_0x82f183){return _0x82f183;})['then'](respondWithResult(_0x53c905,null))[_0x5bec('0x41')](handleError(_0x53c905,null));};exports[_0x5bec('0x57')]=function(_0x395779,_0x5ec26f){var _0x2c75f7;return db[_0x5bec('0x3d')][_0x5bec('0x46')]({'where':{'id':_0x395779[_0x5bec('0x45')]['id']},'attributes':['id',_0x5bec('0x25')]})[_0x5bec('0x21')](handleEntityNotFound(_0x5ec26f,null))[_0x5bec('0x21')](function(_0x490508){if(_0x490508){_0x2c75f7=_0x490508;return db[_0x5bec('0x4e')]['destroy']({'where':{'userProfileId':_0x395779[_0x5bec('0x45')]['id'],'sectionId':_0x395779['query'][_0x5bec('0x58')]}});}})[_0x5bec('0x21')](function(){return _0x2c75f7;})['then'](respondWithStatusCode(_0x5ec26f,null))[_0x5bec('0x41')](handleError(_0x5ec26f,null));};exports[_0x5bec('0x59')]=function(_0x1a6bad,_0x5f1a3e){return db[_0x5bec('0x3d')][_0x5bec('0x46')]({'where':{'id':_0x1a6bad['params']['id']}})[_0x5bec('0x21')](handleEntityNotFound(_0x5f1a3e,null))['then'](function(_0x2d4c14){if(_0x2d4c14){return db[_0x5bec('0x4c')][_0x5bec('0x4d')](function(_0x34a1dc){return db[_0x5bec('0x4e')][_0x5bec('0x40')]({'where':{'userProfileId':_0x1a6bad['params']['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x832134){if(_0x832134){return db[_0x5bec('0x4e')]['destroy']({'where':{'userProfileId':_0x1a6bad[_0x5bec('0x45')]['id'],'id':_[_0x5bec('0x37')](_0x832134,function(_0x40be50){return _0x40be50['id'];})},'transaction':_0x34a1dc});}})[_0x5bec('0x21')](function(_0x10dd78){var _0x482ee8=_[_0x5bec('0x37')](_0x1a6bad[_0x5bec('0x44')],function(_0x1dce8b){_0x1dce8b[_0x5bec('0x53')]=_0x1a6bad[_0x5bec('0x45')]['id'];return _0x1dce8b;});return db['UserProfileSection']['bulkCreate'](_0x482ee8,{'raw':!![],'transaction':_0x34a1dc});})[_0x5bec('0x21')](function(_0x1055b4){var _0x167e0d=_[_0x5bec('0x35')](_[_0x5bec('0x37')](_0x1055b4,function(_0x1a7b1b){return _0x1a7b1b[_0x5bec('0x47')]({'plain':!![]});}),{'includeAll':![]});if(_0x167e0d){return db[_0x5bec('0x4e')][_0x5bec('0x40')]({'where':{'userProfileId':_0x1a6bad[_0x5bec('0x45')]['id'],'sectionId':_['map'](_0x167e0d,function(_0x571b6f){return _0x571b6f[_0x5bec('0x52')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x5bec('0x21')](function(_0x34879b){var _0x24dd00=_[_0x5bec('0x37')](_0x1a6bad[_0x5bec('0x44')],function(_0x34f4f6){_0x34f4f6['userProfileId']=_0x1a6bad[_0x5bec('0x45')]['id'];return _0x34f4f6;});return db[_0x5bec('0x51')][_0x5bec('0x5a')](_0x24dd00,{'raw':!![],'transaction':_0x34a1dc});});}})[_0x5bec('0x41')](handleError(_0x5f1a3e,null));});}})['then'](function(_0x3c273f){var _0x37a220=_[_0x5bec('0x37')](_0x3c273f,function(_0x2e4b55){return _0x2e4b55['get']({'plain':!![]});});})[_0x5bec('0x21')](respondWithResult(_0x5f1a3e,null))[_0x5bec('0x41')](handleError(_0x5f1a3e,null));};exports['removeResources']=function(_0x3a4f92,_0x44de01,_0x4838e6){return db[_0x5bec('0x3d')][_0x5bec('0x46')]({'where':{'id':_0x3a4f92[_0x5bec('0x45')]['id']}})[_0x5bec('0x21')](handleEntityNotFound(_0x44de01,null))['then'](function(_0x9564e3){if(_0x9564e3){return _0x9564e3[_0x5bec('0x5b')](_0x3a4f92['query'][_0x5bec('0x58')]);}})[_0x5bec('0x21')](respondWithStatusCode(_0x44de01,null))['catch'](handleError(_0x44de01,null));};exports[_0x5bec('0x5c')]=function(_0x41d257,_0x57d412){var _0x280a30={'raw':![],'where':{}};var _0x4be4c3={};var _0x162027={'count':0x0,'rows':[]};var _0x5015c5=_0x41d257[_0x5bec('0x2c')][_0x5bec('0x5d')];if(typeof _0x5015c5==='undefined'){throw new db[(_0x5bec('0x5e'))][(_0x5bec('0x5f'))](_0x5bec('0x60'));}var _0x2992ca=_0x41d257[_0x5bec('0x2c')]['mergeResources']||![];var _0x244aab=getQueryModels(_0x5015c5,_0x2992ca);if(typeof _0x244aab[_0x5bec('0x61')]==='undefined'){throw new db[(_0x5bec('0x5e'))][(_0x5bec('0x5f'))]('Invalid\x20section\x20\x27'+_0x5015c5+'\x27');}var _0x863246=[];if(!_[_0x5bec('0x62')](_0x244aab[_0x5bec('0x63')])){_0x863246=_0x244aab['parentSections'];}else{_0x863246=[{'name':_0x5015c5}];}return db[_0x5bec('0x3d')]['findOne']({'where':{'id':_0x41d257['params']['id']}})[_0x5bec('0x21')](handleEntityNotFound(_0x57d412,null))[_0x5bec('0x21')](function(_0x57b22d){if(_0x57b22d){var _0x432d7d=[];for(var _0x391533=0x0;_0x391533<_0x863246['length'];_0x391533++){_0x432d7d[_0x5bec('0x64')](db[_0x5bec('0x4e')][_0x5bec('0x65')]({'where':{'userProfileId':_0x57b22d['id'],'name':_0x863246[_0x391533][_0x5bec('0x25')]},'raw':!![]}));}return BPromise[_0x5bec('0x66')](_0x432d7d);}})[_0x5bec('0x21')](function(_0x46cc77){var _0x2f6292=_[_0x5bec('0x35')](_0x46cc77,function(_0x373831){return _0x373831?_0x373831:undefined;});var _0x5c2a6b=_[_0x5bec('0x35')](_0x863246,[_0x5bec('0x67'),!![]]);var _0x3ba27c=_[_0x5bec('0x62')](_0x2f6292)&&_['isEmpty'](_0x5c2a6b)?null:_[_0x5bec('0x68')](_0x5c2a6b,_0x2f6292);if(_0x3ba27c){var _0x4f178f=[];for(var _0x44ccc3=0x0;_0x44ccc3<_0x3ba27c[_0x5bec('0x2f')];_0x44ccc3++){var _0x36dfe4=_[_0x5bec('0x46')](_0x863246,function(_0x2cb65e){return _0x3ba27c[_0x44ccc3]?_0x2cb65e[_0x5bec('0x25')]===_0x3ba27c[_0x44ccc3]['name']:null;});if(_0x36dfe4){if(_0x3ba27c[_0x44ccc3][_0x5bec('0x67')]){_0x4f178f[_0x5bec('0x64')](getAllResources(_0x244aab[_0x5bec('0x61')],_0x3ba27c[_0x44ccc3]));}else{if(!_0x3ba27c[_0x44ccc3][_0x5bec('0x50')]){_0x4f178f[_0x5bec('0x64')](getAllowedResources(_0x36dfe4,_0x3ba27c[_0x44ccc3],_0x244aab['childModel']));}else{if(_0x36dfe4[_0x5bec('0x28')]){_0x4f178f[_0x5bec('0x64')](getAllFilteredResources(_0x36dfe4,_0x3ba27c[_0x44ccc3]));}}}}}return BPromise['all'](_0x4f178f);}else{return null;}})[_0x5bec('0x21')](function(_0x2297ed){var _0x2d4613=_0x2297ed;var _0x27978f=null;if(_0x2d4613){_0x27978f=_0x2d4613[_0x5bec('0x2f')]===0x1?_0x2d4613[0x0]:null;}if(_0x27978f||_0x2d4613){var _0x4b5633=db[_0x244aab['childModel']][_0x5bec('0x27')];_0x4be4c3[_0x5bec('0x28')]=_[_0x5bec('0x29')](_0x4b5633);_0x4be4c3[_0x5bec('0x2c')]=_[_0x5bec('0x29')](_0x41d257[_0x5bec('0x2c')]);_0x4be4c3[_0x5bec('0x2a')]=_[_0x5bec('0x2b')](_0x4be4c3[_0x5bec('0x28')],_0x4be4c3[_0x5bec('0x2c')]);_0x280a30['attributes']=_[_0x5bec('0x2b')](_0x4be4c3[_0x5bec('0x28')],qs[_0x5bec('0x2e')](_0x41d257[_0x5bec('0x2c')][_0x5bec('0x2e')]));_0x280a30[_0x5bec('0x2d')]=_0x280a30[_0x5bec('0x2d')][_0x5bec('0x2f')]?_0x280a30['attributes']:_0x4be4c3[_0x5bec('0x28')];if(!_0x41d257[_0x5bec('0x2c')]['hasOwnProperty'](_0x5bec('0x31'))){_0x280a30[_0x5bec('0x1a')]=qs[_0x5bec('0x1a')](_0x41d257['query'][_0x5bec('0x1a')]);_0x280a30[_0x5bec('0x19')]=qs[_0x5bec('0x19')](_0x41d257['query']['offset']);}_0x280a30['order']=qs[_0x5bec('0x33')](_0x41d257[_0x5bec('0x2c')][_0x5bec('0x33')]);_0x280a30[_0x5bec('0x34')]=qs[_0x5bec('0x2a')](_['pick'](_0x41d257[_0x5bec('0x2c')],_0x4be4c3[_0x5bec('0x2a')]));if(_0x41d257[_0x5bec('0x2c')][_0x5bec('0x35')]){_0x280a30[_0x5bec('0x34')]=_[_0x5bec('0x36')](_0x280a30[_0x5bec('0x34')],{'$or':_[_0x5bec('0x37')](_0x4b5633,function(_0x1ac886){if(_0x1ac886[_0x5bec('0x38')][_0x5bec('0x39')]!==_0x5bec('0x3a')){var _0x351910={};_0x351910[_0x1ac886[_0x5bec('0x3b')]]={'$like':'%'+_0x41d257[_0x5bec('0x2c')][_0x5bec('0x35')]+'%'};return _0x351910;}})});}var _0x48ad6a=[];if(_0x27978f){var _0x2176c0=_[_0x5bec('0x46')](_0x863246,[_0x5bec('0x25'),_0x27978f['name']]);if(_0x2176c0['field']){var _0x55525d={};if(_0x244aab[_0x5bec('0x61')]==='AnalyticExtractedReport'){_0x55525d[_0x2176c0[_0x5bec('0x69')]]=_['map'](_0x27978f[_0x5bec('0x6a')],'id');}else{_0x55525d[_0x2176c0[_0x5bec('0x69')]]=_0x27978f[_0x5bec('0x6a')];}_0x48ad6a[_0x5bec('0x64')](_0x55525d);}else{_0x280a30[_0x5bec('0x34')]['id']=_0x27978f[_0x5bec('0x6a')];}}else{for(var _0x4cecd3=0x0;_0x4cecd3<_0x2d4613[_0x5bec('0x2f')];_0x4cecd3++){var _0x2176c0=_[_0x5bec('0x46')](_0x863246,[_0x5bec('0x25'),_0x2d4613[_0x4cecd3][_0x5bec('0x25')]]);if(_0x2176c0['field']){var _0x55525d={};_0x55525d[_0x2176c0[_0x5bec('0x69')]]=_0x2d4613[_0x4cecd3]['associatedResources'];_0x48ad6a[_0x5bec('0x64')](_0x55525d);}else{if(!_0x280a30[_0x5bec('0x34')]['id'])_0x280a30[_0x5bec('0x34')]['id']=[];_0x2d4613[_0x4cecd3][_0x5bec('0x6a')][_0x5bec('0x6b')](function(_0x50f47e){_0x280a30['where']['id'][_0x5bec('0x64')](_0x50f47e);});}}}if(!_[_0x5bec('0x62')](_0x48ad6a)){_0x280a30[_0x5bec('0x34')]=_[_0x5bec('0x36')](_0x280a30[_0x5bec('0x34')],{'$and':{'$or':_0x48ad6a}});}_0x280a30=_['merge']({},_0x280a30,_0x41d257[_0x5bec('0x3c')]);if(_0x27978f&&!_0x27978f['autoAssociation']&&_0x244aab[_0x5bec('0x61')]===_0x5bec('0x6c')){if(_0x41d257['query'][_0x5bec('0x3e')]){_0x280a30[_0x5bec('0x3f')]=[{'all':!![]}];}return db[_0x244aab[_0x5bec('0x61')]][_0x5bec('0x40')](_0x280a30)[_0x5bec('0x21')](function(_0x591449){var _0x2f4807=[];_0x591449[_0x5bec('0x6b')](function(_0x2b7fc9){var _0x39032e;switch(_0x2b7fc9[_0x5bec('0x6d')]){case'default':_0x39032e=_[_0x5bec('0x46')](_0x27978f[_0x5bec('0x6a')],function(_0x234636){return _0x234636['id']===_0x2b7fc9[_0x5bec('0x6e')]&&_0x234636['type']==='DefaultReports';});break;case _0x5bec('0x6f'):_0x39032e=_[_0x5bec('0x46')](_0x27978f[_0x5bec('0x6a')],function(_0x346cb4){return _0x346cb4['id']===_0x2b7fc9['reportId']&&_0x346cb4[_0x5bec('0x38')]===_0x5bec('0x70');});break;}if(_0x39032e)_0x2f4807[_0x5bec('0x64')](_0x2b7fc9);});_0x162027[_0x5bec('0x18')]=_0x2f4807['length'];_0x162027[_0x5bec('0x71')]=_0x2f4807;return _0x162027;});}else{return db[_0x244aab[_0x5bec('0x61')]][_0x5bec('0x18')]({'where':_0x280a30['where']})[_0x5bec('0x21')](function(_0x3ea00d){_0x162027[_0x5bec('0x18')]=_0x3ea00d;if(_0x41d257[_0x5bec('0x2c')]['includeAll']){if(_0x244aab[_0x5bec('0x61')]===_0x5bec('0x72')){_0x280a30[_0x5bec('0x3f')]=[{'model':db[_0x5bec('0x73')],'as':_0x5bec('0x74'),'attributes':['id',_0x5bec('0x25'),_0x5bec('0x75')],'required':_0x41d257[_0x5bec('0x2c')][_0x5bec('0x76')]?!![]:![]},{'model':db[_0x5bec('0x73')],'as':_0x5bec('0x77'),'attributes':['id',_0x5bec('0x25'),_0x5bec('0x75')],'through':_0x41d257[_0x5bec('0x2c')][_0x5bec('0x76')]?{'attributes':[],'where':{'TagId':_0x41d257['query'][_0x5bec('0x76')]||undefined}}:{},'required':_0x41d257[_0x5bec('0x2c')][_0x5bec('0x76')]?!![]:![]}];}else{_0x280a30[_0x5bec('0x3f')]=[{'all':!![]}];}}return db[_0x244aab[_0x5bec('0x61')]][_0x5bec('0x40')](_0x280a30);})['then'](function(_0x51ebd5){_0x162027[_0x5bec('0x71')]=_0x51ebd5;return _0x162027;});}}else{return _0x162027;}})[_0x5bec('0x21')](respondWithFilteredResult(_0x57d412,_0x280a30))[_0x5bec('0x41')](handleError(_0x57d412,null));};function getAllResources(_0x5e6da6,_0x4e59e0){return new BPromise(function(_0x120373,_0x3fd7da){if(_0x4e59e0){var _0x21bf94=_0x4e59e0['filter']?{[_0x4e59e0[_0x5bec('0x35')][_0x5bec('0x3b')]]:_0x4e59e0[_0x5bec('0x35')][_0x5bec('0x78')]}:undefined;return db[_0x5e6da6][_0x5bec('0x40')]({'where':_0x21bf94,'raw':!![]})[_0x5bec('0x21')](function(_0x38aa3f){_0x4e59e0[_0x5bec('0x6a')]=_[_0x5bec('0x37')](_0x38aa3f,'id');_0x120373(_0x4e59e0);})[_0x5bec('0x41')](function(_0x49ab19){_0x3fd7da(_0x49ab19);});}else{_0x120373(null);}});}function getAllFilteredResources(_0x4890d0,_0x565a4b){return new BPromise(function(_0x458e20,_0x138f22){var _0x314b79=_0x4890d0[_0x5bec('0x35')]?{[_0x4890d0['filter'][_0x5bec('0x3b')]]:_0x4890d0['filter'][_0x5bec('0x78')]}:undefined;return db[_0x4890d0[_0x5bec('0x28')]][_0x5bec('0x40')]({'where':_0x314b79,'raw':!![]})[_0x5bec('0x21')](function(_0x120b7d){_0x565a4b[_0x5bec('0x6a')]=_[_0x5bec('0x37')](_0x120b7d,function(_0x232916){return _0x232916['name'];});_0x458e20(_0x565a4b);})[_0x5bec('0x41')](function(_0x58cc43){_0x138f22(_0x58cc43);});});}function getAllowedResources(_0x20bb3d,_0x535107,_0x448cb3){return new BPromise(function(_0x5a73f8,_0x4a4206){if(_0x535107){return db[_0x5bec('0x51')][_0x5bec('0x40')]({'where':{'sectionId':_0x535107['id']},'raw':!![]})['then'](function(_0x4029b9){if(_0x20bb3d[_0x5bec('0x3b')]&&_0x20bb3d[_0x5bec('0x3b')]!=='id'){_0x535107['associatedResources']=_[_0x5bec('0x37')](_0x4029b9,function(_0x439216){return _0x439216[_0x20bb3d[_0x5bec('0x3b')]];});}else{if(_0x448cb3===_0x5bec('0x6c')){_0x535107[_0x5bec('0x6a')]=_[_0x5bec('0x37')](_0x4029b9,function(_0x31f094){return{'id':_0x31f094['resourceId'],'type':_0x31f094[_0x5bec('0x38')]};});}else{_0x535107[_0x5bec('0x6a')]=_['map'](_0x4029b9,function(_0x44214b){return _0x44214b[_0x5bec('0x79')];});}}_0x5a73f8(_0x535107);})[_0x5bec('0x41')](function(_0x504bd5){_0x4a4206(_0x504bd5);});}else{_0x5a73f8(null);}});}function getQueryModels(_0x336ce8,_0x13abc0){var _0x465081=_0x336ce8['toLowerCase']();var _0x290398={'childModel':undefined,'parentSections':[]};switch(_0x465081){case _0x5bec('0x7a'):_0x290398[_0x5bec('0x61')]=_0x5bec('0x7b');break;case'odbc':_0x290398[_0x5bec('0x61')]=_0x5bec('0x7c');break;case _0x5bec('0x7d'):_0x290398['childModel']=_0x5bec('0x7e');_0x290398[_0x5bec('0x63')]=[{'name':_0x5bec('0x7f'),'field':_0x5bec('0x25'),'foreignKey':_0x5bec('0x80')}];break;case _0x5bec('0x81'):_0x290398['childModel']=_0x5bec('0x82');break;case _0x5bec('0x83'):_0x290398[_0x5bec('0x61')]=_0x5bec('0x72');_0x290398[_0x5bec('0x63')]=[{'name':_0x5bec('0x84'),'field':'id','foreignKey':'ListId'}];break;case _0x5bec('0x85'):_0x290398[_0x5bec('0x61')]=_0x5bec('0x86');break;case _0x5bec('0x87'):_0x290398[_0x5bec('0x61')]=_0x5bec('0x88');break;case _0x5bec('0x89'):_0x290398['childModel']=_0x5bec('0x8a');break;case _0x5bec('0x8b'):_0x290398[_0x5bec('0x61')]='ChatQueue';break;case _0x5bec('0x8c'):_0x290398[_0x5bec('0x61')]=_0x5bec('0x8d');break;case _0x5bec('0x8e'):_0x290398[_0x5bec('0x61')]=_0x5bec('0x8f');break;case _0x5bec('0x90'):_0x290398[_0x5bec('0x61')]=_0x5bec('0x91');break;case _0x5bec('0x92'):case _0x5bec('0x93'):case _0x5bec('0x94'):_0x290398[_0x5bec('0x61')]=_0x5bec('0x95');break;case _0x5bec('0x96'):_0x290398[_0x5bec('0x61')]=_0x5bec('0x97');break;case _0x5bec('0x98'):_0x290398[_0x5bec('0x61')]=_0x5bec('0x99');break;case _0x5bec('0x9a'):_0x290398[_0x5bec('0x61')]=_0x5bec('0x9b');_0x290398[_0x5bec('0x63')]=[{'name':_0x5bec('0x9c'),'field':_0x5bec('0x25'),'foreignKey':_0x5bec('0x9d'),'model':_0x5bec('0x9e'),'filter':{'field':'role','value':[_0x5bec('0x9f')]}},{'name':_0x5bec('0xa0'),'field':_0x5bec('0x25'),'foreignKey':_0x5bec('0x9d'),'model':'User','filter':{'field':_0x5bec('0xa1'),'value':['telephone']}},{'name':'VoiceQueues','field':'name','foreignKey':_0x5bec('0xa2'),'model':_0x5bec('0xa3'),'filter':{'field':_0x5bec('0x38'),'value':[_0x5bec('0xa4')]}},{'name':'QueueCampaigns','field':_0x5bec('0x25'),'foreignKey':_0x5bec('0xa2'),'model':_0x5bec('0xa3'),'filter':{'field':_0x5bec('0x38'),'value':['outbound']}}];break;case _0x5bec('0xa5'):_0x290398['childModel']=_0x5bec('0xa6');break;case _0x5bec('0xa7'):_0x290398[_0x5bec('0x61')]=_0x5bec('0xa8');break;case _0x5bec('0xa9'):_0x290398['childModel']=_0x5bec('0xaa');break;case'ivrcampaigns':_0x290398[_0x5bec('0x61')]=_0x5bec('0xab');break;case _0x5bec('0xac'):_0x290398[_0x5bec('0x61')]='MailQueue';break;case _0x5bec('0xad'):_0x290398[_0x5bec('0x61')]=_0x5bec('0xae');break;case _0x5bec('0xaf'):_0x290398[_0x5bec('0x61')]='MailSubstatus';break;case _0x5bec('0xb0'):_0x290398['childModel']=_0x5bec('0xb1');break;case'openchannelaccounts':_0x290398[_0x5bec('0x61')]=_0x5bec('0xb2');break;case _0x5bec('0xb3'):_0x290398[_0x5bec('0x61')]='SmsQueue';break;case _0x5bec('0xb4'):_0x290398[_0x5bec('0x61')]=_0x5bec('0xb5');break;case _0x5bec('0xb6'):_0x290398[_0x5bec('0x61')]=_0x5bec('0xb7');break;case'voicequeues':case _0x5bec('0xb8'):_0x290398[_0x5bec('0x61')]=_0x5bec('0xa3');if(_0x13abc0){_0x290398[_0x5bec('0x63')]=[{'name':_0x5bec('0xb9')},{'name':'QueueCampaigns'}];}break;case _0x5bec('0xba'):case _0x5bec('0xbb'):case'telephones':_0x290398['childModel']=_0x5bec('0x9e');if(_0x13abc0){_0x290398[_0x5bec('0x63')]=[{'name':'Users','filter':{'field':'role','value':[_0x5bec('0xbc'),_0x5bec('0xbd')]},'ignore':!![]},{'name':_0x5bec('0x9c')},{'name':_0x5bec('0xa0')}];}break;case _0x5bec('0xbe'):_0x290398[_0x5bec('0x61')]=_0x5bec('0xbf');break;case _0x5bec('0xc0'):_0x290398[_0x5bec('0x61')]=_0x5bec('0xc1');break;case _0x5bec('0xc2'):_0x290398[_0x5bec('0x61')]=_0x5bec('0xc3');break;case _0x5bec('0xc4'):_0x290398[_0x5bec('0x61')]=_0x5bec('0xc5');break;case _0x5bec('0xc6'):_0x290398[_0x5bec('0x61')]=_0x5bec('0xc7');break;case _0x5bec('0xc8'):_0x290398['childModel']='ZohoAccount';break;case'vtigeraccounts':_0x290398[_0x5bec('0x61')]=_0x5bec('0x9e');break;case _0x5bec('0xc9'):_0x290398[_0x5bec('0x61')]=_0x5bec('0xca');break;case _0x5bec('0xcb'):_0x290398[_0x5bec('0x61')]=_0x5bec('0xcc');break;case _0x5bec('0xcd'):_0x290398['childModel']='Dashboard';break;case'intervals':_0x290398[_0x5bec('0x61')]=_0x5bec('0xce');break;case'pauses':_0x290398['childModel']=_0x5bec('0xcf');break;case'scheduler':_0x290398[_0x5bec('0x61')]='Schedule';break;case _0x5bec('0xd0'):_0x290398[_0x5bec('0x61')]=_0x5bec('0xd1');break;case _0x5bec('0xd2'):_0x290398[_0x5bec('0x61')]=_0x5bec('0x73');break;case _0x5bec('0xd3'):_0x290398['childModel']=_0x5bec('0xd4');break;case'triggers':_0x290398[_0x5bec('0x61')]=_0x5bec('0xd5');break;case'trunks':_0x290398['childModel']=_0x5bec('0xd6');break;case _0x5bec('0xd7'):_0x290398[_0x5bec('0x61')]='Variable';break;case _0x5bec('0xd8'):_0x290398['childModel']='Plugin';break;case _0x5bec('0xd9'):_0x290398[_0x5bec('0x61')]=_0x5bec('0x6c');_0x290398[_0x5bec('0x63')]=[{'name':_0x5bec('0xda'),'field':'id','foreignKey':_0x5bec('0x6e')}];break;case'metrics':_0x290398[_0x5bec('0x61')]=_0x5bec('0xdb');break;default:return _0x290398;}return _0x290398;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 8c6cb49..47dd2b9 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 _0x1fbc=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','save','update','remove'];(function(_0x453954,_0x750b33){var _0x5e7cbe=function(_0xc69bf6){while(--_0xc69bf6){_0x453954['push'](_0x453954['shift']());}};_0x5e7cbe(++_0x750b33);}(_0x1fbc,0x18a));var _0xc1fb=function(_0x5a4246,_0x5d02de){_0x5a4246=_0x5a4246-0x0;var _0x33b020=_0x1fbc[_0x5a4246];return _0x33b020;};'use strict';var EventEmitter=require(_0xc1fb('0x0'));var UserProfile=require(_0xc1fb('0x1'))['db'][_0xc1fb('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc1fb('0x3'),'afterUpdate':_0xc1fb('0x4'),'afterDestroy':_0xc1fb('0x5')};function emitEvent(_0x267660){return function(_0xa524f9,_0x30b8bc,_0x11ffc0){UserProfileEvents['emit'](_0x267660+':'+_0xa524f9['id'],_0xa524f9);UserProfileEvents[_0xc1fb('0x6')](_0x267660,_0xa524f9);_0x11ffc0(null);};}for(var e in events){if(events[_0xc1fb('0x7')](e)){var event=events[e];UserProfile[_0xc1fb('0x8')](e,emitEvent(event));}}module[_0xc1fb('0x9')]=UserProfileEvents; \ No newline at end of file +var _0x86c4=['emit','hasOwnProperty','events','UserProfile','setMaxListeners','save','update'];(function(_0x2b98b7,_0x3681bd){var _0x25731b=function(_0x7d02ea){while(--_0x7d02ea){_0x2b98b7['push'](_0x2b98b7['shift']());}};_0x25731b(++_0x3681bd);}(_0x86c4,0x64));var _0x486c=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x86c4[_0x4565bf];return _0x5610ba;};'use strict';var EventEmitter=require(_0x486c('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x486c('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x486c('0x2')](0x0);var events={'afterCreate':_0x486c('0x3'),'afterUpdate':_0x486c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x49dba6){return function(_0x28ab56,_0x10bce3,_0x1caa48){UserProfileEvents[_0x486c('0x5')](_0x49dba6+':'+_0x28ab56['id'],_0x28ab56);UserProfileEvents['emit'](_0x49dba6,_0x28ab56);_0x1caa48(null);};}for(var e in events){if(events[_0x486c('0x6')](e)){var event=events[e];UserProfile['hook'](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 8651908..f03815f 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 _0x7106=['./userProfile.attributes','UserProfile','user_profiles','util','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7106,0x198));var _0x6710=function(_0x3e4ad0,_0x2dfbf0){_0x3e4ad0=_0x3e4ad0-0x0;var _0x1aef07=_0x7106[_0x3e4ad0];return _0x1aef07;};'use strict';var _=require('lodash');var util=require(_0x6710('0x0'));var logger=require('../../config/logger')(_0x6710('0x1'));var moment=require(_0x6710('0x2'));var BPromise=require(_0x6710('0x3'));var rp=require(_0x6710('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6710('0x5'));var attributes=require(_0x6710('0x6'));module['exports']=function(_0x49d91e,_0x579e55){return _0x49d91e['define'](_0x6710('0x7'),attributes,{'tableName':_0x6710('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac61=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./userProfile.attributes','exports','define','UserProfile'];(function(_0x4ed488,_0x215463){var _0x524840=function(_0x383852){while(--_0x383852){_0x4ed488['push'](_0x4ed488['shift']());}};_0x524840(++_0x215463);}(_0xac61,0x6c));var _0x1ac6=function(_0x27ae20,_0x5d1673){_0x27ae20=_0x27ae20-0x0;var _0x1daf30=_0xac61[_0x27ae20];return _0x1daf30;};'use strict';var _=require(_0x1ac6('0x0'));var util=require(_0x1ac6('0x1'));var logger=require(_0x1ac6('0x2'))('api');var moment=require(_0x1ac6('0x3'));var BPromise=require(_0x1ac6('0x4'));var rp=require(_0x1ac6('0x5'));var fs=require('fs');var path=require(_0x1ac6('0x6'));var rimraf=require('rimraf');var config=require(_0x1ac6('0x7'));var attributes=require(_0x1ac6('0x8'));module[_0x1ac6('0x9')]=function(_0x17c294,_0x37aa8e){return _0x17c294[_0x1ac6('0xa')](_0x1ac6('0xb'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 74dfe77..c42f85d 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 _0xa48c=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','bluebird'];(function(_0x5600f9,_0x44e82c){var _0x3de413=function(_0x273ce4){while(--_0x273ce4){_0x5600f9['push'](_0x5600f9['shift']());}};_0x3de413(++_0x44e82c);}(_0xa48c,0xf0));var _0xca48=function(_0x19dd32,_0x5b5417){_0x19dd32=_0x19dd32-0x0;var _0x501852=_0xa48c[_0x19dd32];return _0x501852;};'use strict';var _=require(_0xca48('0x0'));var util=require(_0xca48('0x1'));var moment=require('moment');var BPromise=require(_0xca48('0x2'));var rs=require(_0xca48('0x3'));var fs=require('fs');var Redis=require(_0xca48('0x4'));var db=require(_0xca48('0x5'))['db'];var utils=require(_0xca48('0x6'));var logger=require(_0xca48('0x7'))(_0xca48('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xca48('0x9')]({'port':0x232a});config['redis']=_[_0xca48('0xa')](config[_0xca48('0xb')],{'host':_0xca48('0xc'),'port':0x18eb});var socket=require(_0xca48('0xd'))(new Redis(config[_0xca48('0xb')]));require(_0xca48('0xe'))['register'](socket);function respondWithRpcPromise(_0x267201,_0x41d80a,_0xa66378){return new BPromise(function(_0x411406,_0x11ea74){return client[_0xca48('0xf')](_0x267201,_0xa66378)[_0xca48('0x10')](function(_0x479efd){logger['info'](_0xca48('0x11'),_0x41d80a,_0xca48('0x12'));logger[_0xca48('0x13')](_0xca48('0x14'),_0x41d80a,_0xca48('0x12'),JSON[_0xca48('0x15')](_0x479efd));if(_0x479efd['error']){if(_0x479efd[_0xca48('0x16')]['code']===0x1f4){logger[_0xca48('0x16')](_0xca48('0x11'),_0x41d80a,_0x479efd[_0xca48('0x16')][_0xca48('0x17')]);return _0x11ea74(_0x479efd[_0xca48('0x16')][_0xca48('0x17')]);}logger[_0xca48('0x16')](_0xca48('0x11'),_0x41d80a,_0x479efd[_0xca48('0x16')][_0xca48('0x17')]);return _0x411406(_0x479efd['error']['message']);}else{logger[_0xca48('0x18')](_0xca48('0x11'),_0x41d80a,_0xca48('0x12'));_0x411406(_0x479efd[_0xca48('0x19')][_0xca48('0x17')]);}})[_0xca48('0x1a')](function(_0x451ec3){logger[_0xca48('0x16')](_0xca48('0x11'),_0x41d80a,_0x451ec3);_0x11ea74(_0x451ec3);});});} \ No newline at end of file +var _0x1913=['randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./userProfile.socket','register','then','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','lodash','util','moment','bluebird'];(function(_0x4541e9,_0x3cf4a1){var _0x4f8fe1=function(_0x988f07){while(--_0x988f07){_0x4541e9['push'](_0x4541e9['shift']());}};_0x4f8fe1(++_0x3cf4a1);}(_0x1913,0x141));var _0x3191=function(_0x4d6232,_0x27d8c7){_0x4d6232=_0x4d6232-0x0;var _0x49a849=_0x1913[_0x4d6232];return _0x49a849;};'use strict';var _=require(_0x3191('0x0'));var util=require(_0x3191('0x1'));var moment=require(_0x3191('0x2'));var BPromise=require(_0x3191('0x3'));var rs=require(_0x3191('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3191('0x5'));var logger=require('../../config/logger')(_0x3191('0x6'));var config=require(_0x3191('0x7'));var jayson=require(_0x3191('0x8'));var client=jayson[_0x3191('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x3191('0xa')],{'host':_0x3191('0xb'),'port':0x18eb});var socket=require(_0x3191('0xc'))(new Redis(config[_0x3191('0xa')]));require(_0x3191('0xd'))[_0x3191('0xe')](socket);function respondWithRpcPromise(_0x3a5e2e,_0x14d10b,_0x5068e3){return new BPromise(function(_0x3dd9d1,_0x2c75cd){return client['request'](_0x3a5e2e,_0x5068e3)[_0x3191('0xf')](function(_0x58824b){logger['info'](_0x3191('0x10'),_0x14d10b,'request\x20sent');logger[_0x3191('0x11')](_0x3191('0x12'),_0x14d10b,'request\x20sent',JSON[_0x3191('0x13')](_0x58824b));if(_0x58824b[_0x3191('0x14')]){if(_0x58824b['error']['code']===0x1f4){logger[_0x3191('0x14')]('UserProfile,\x20%s,\x20%s',_0x14d10b,_0x58824b[_0x3191('0x14')][_0x3191('0x15')]);return _0x2c75cd(_0x58824b['error'][_0x3191('0x15')]);}logger['error'](_0x3191('0x10'),_0x14d10b,_0x58824b['error'][_0x3191('0x15')]);return _0x3dd9d1(_0x58824b['error']['message']);}else{logger[_0x3191('0x16')](_0x3191('0x10'),_0x14d10b,_0x3191('0x17'));_0x3dd9d1(_0x58824b[_0x3191('0x18')]['message']);}})['catch'](function(_0x420c54){logger['error'](_0x3191('0x10'),_0x14d10b,_0x420c54);_0x2c75cd(_0x420c54);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 2d2f7b5..d2df6f9 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 _0x0738=['update','emit','removeListener','register','length','userProfile:','./userProfile.events','remove'];(function(_0x1fabc7,_0x408123){var _0xd96b67=function(_0xe929c8){while(--_0xe929c8){_0x1fabc7['push'](_0x1fabc7['shift']());}};_0xd96b67(++_0x408123);}(_0x0738,0x6e));var _0x8073=function(_0x1fc1f9,_0x454fb2){_0x1fc1f9=_0x1fc1f9-0x0;var _0x4987ca=_0x0738[_0x1fc1f9];return _0x4987ca;};'use strict';var UserProfileEvents=require(_0x8073('0x0'));var events=['save',_0x8073('0x1'),_0x8073('0x2')];function createListener(_0x46b716,_0xf6179e){return function(_0x8e2e35){_0xf6179e[_0x8073('0x3')](_0x46b716,_0x8e2e35);};}function removeListener(_0x176f52,_0x38b47d){return function(){UserProfileEvents[_0x8073('0x4')](_0x176f52,_0x38b47d);};}exports[_0x8073('0x5')]=function(_0x2f90b9){for(var _0x588057=0x0,_0x1aad61=events[_0x8073('0x6')];_0x588057<_0x1aad61;_0x588057++){var _0x2899ce=events[_0x588057];var _0x310f3a=createListener(_0x8073('0x7')+_0x2899ce,_0x2f90b9);UserProfileEvents['on'](_0x2899ce,_0x310f3a);}}; \ No newline at end of file +var _0x10dc=['emit','removeListener','register','userProfile:','./userProfile.events','save','update'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x10dc,0x107));var _0xc10d=function(_0x5c4d27,_0x5b0822){_0x5c4d27=_0x5c4d27-0x0;var _0x1dda1a=_0x10dc[_0x5c4d27];return _0x1dda1a;};'use strict';var UserProfileEvents=require(_0xc10d('0x0'));var events=[_0xc10d('0x1'),'remove',_0xc10d('0x2')];function createListener(_0x5d70d3,_0x412754){return function(_0x10ff44){_0x412754[_0xc10d('0x3')](_0x5d70d3,_0x10ff44);};}function removeListener(_0x396299,_0x21a1b8){return function(){UserProfileEvents[_0xc10d('0x4')](_0x396299,_0x21a1b8);};}exports[_0xc10d('0x5')]=function(_0x25e10c){for(var _0x48baac=0x0,_0x266240=events['length'];_0x48baac<_0x266240;_0x48baac++){var _0x591e4d=events[_0x48baac];var _0x315fff=createListener(_0xc10d('0x6')+_0x591e4d,_0x25e10c);UserProfileEvents['on'](_0x591e4d,_0x315fff);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 85ba84b..bb57478 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 _0x7041=['../../components/auth/service','../../components/interaction/service','index','get','/describe','isAuthenticated','show','post','/:id','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x323783,_0x23a8fc){var _0x284dd3=function(_0x1e382b){while(--_0x1e382b){_0x323783['push'](_0x323783['shift']());}};_0x284dd3(++_0x23a8fc);}(_0x7041,0xdd));var _0x1704=function(_0x4344f8,_0x19e74d){_0x4344f8=_0x4344f8-0x0;var _0x46aba7=_0x7041[_0x4344f8];return _0x46aba7;};'use strict';var multer=require(_0x1704('0x0'));var util=require('util');var path=require(_0x1704('0x1'));var timeout=require(_0x1704('0x2'));var express=require('express');var router=express[_0x1704('0x3')]();var auth=require(_0x1704('0x4'));var interaction=require(_0x1704('0x5'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1704('0x6')]);router[_0x1704('0x7')](_0x1704('0x8'),auth[_0x1704('0x9')](),controller['describe']);router['get']('/:id',auth[_0x1704('0x9')](),controller[_0x1704('0xa')]);router[_0x1704('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x1704('0xc'),auth[_0x1704('0x9')](),controller['update']);router['delete']('/:id',auth[_0x1704('0x9')](),controller[_0x1704('0xd')]);module[_0x1704('0xe')]=router; \ No newline at end of file +var _0x9ccd=['exports','multer','path','connect-timeout','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ccd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd9cc('0x0'));var util=require('util');var path=require(_0xd9cc('0x1'));var timeout=require(_0xd9cc('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xd9cc('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd9cc('0x4'));var controller=require(_0xd9cc('0x5'));router[_0xd9cc('0x6')]('/',auth[_0xd9cc('0x7')](),controller[_0xd9cc('0x8')]);router[_0xd9cc('0x6')](_0xd9cc('0x9'),auth[_0xd9cc('0x7')](),controller[_0xd9cc('0xa')]);router[_0xd9cc('0x6')](_0xd9cc('0xb'),auth[_0xd9cc('0x7')](),controller[_0xd9cc('0xc')]);router[_0xd9cc('0xd')]('/',auth[_0xd9cc('0x7')](),controller[_0xd9cc('0xe')]);router['put'](_0xd9cc('0xb'),auth[_0xd9cc('0x7')](),controller[_0xd9cc('0xf')]);router[_0xd9cc('0x10')](_0xd9cc('0xb'),auth[_0xd9cc('0x7')](),controller[_0xd9cc('0x11')]);module[_0xd9cc('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 483eb44..87fddde 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 _0x1130=['exports','INTEGER','STRING','sequelize'];(function(_0x15c501,_0x20eb4e){var _0x9f460e=function(_0x56c8d4){while(--_0x56c8d4){_0x15c501['push'](_0x15c501['shift']());}};_0x9f460e(++_0x20eb4e);}(_0x1130,0x9b));var _0x0113=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1130[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x0113('0x0'));module[_0x0113('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x0113('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0113('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x11ed=['sequelize','exports','STRING','INTEGER'];(function(_0xfcd299,_0x4adcc0){var _0x3e5c4d=function(_0x2a7fb7){while(--_0x2a7fb7){_0xfcd299['push'](_0xfcd299['shift']());}};_0x3e5c4d(++_0x4adcc0);}(_0x11ed,0xa0));var _0xd11e=function(_0x61975d,_0x325cad){_0x61975d=_0x61975d-0x0;var _0x2e24a4=_0x11ed[_0x61975d];return _0x2e24a4;};'use strict';var Sequelize=require(_0xd11e('0x0'));module[_0xd11e('0x1')]={'name':{'type':Sequelize[_0xd11e('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xd11e('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 461b0fb..e5fcc50 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 _0x008c=['fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','apply','destroy','then','end','error','send','index','UserProfileResource','rawAttributes','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','intersection','options','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x008c,0x188));var _0xc008=function(_0x5e9d1f,_0x37c578){_0x5e9d1f=_0x5e9d1f-0x0;var _0x895bea=_0x008c[_0x5e9d1f];return _0x895bea;};'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 hardwareService=require('../../config/license/hardware');var logger=require(_0xc008('0x12'))(_0xc008('0x13'));var utils=require('../../config/utils');var config=require(_0xc008('0x14'));var db=require(_0xc008('0x15'))['db'];function respondWithStatusCode(_0x2ea200,_0x2a5b4e){_0x2a5b4e=_0x2a5b4e||0xcc;return function(_0x9ffa93){if(_0x9ffa93){return _0x2ea200[_0xc008('0x16')](_0x2a5b4e);}return _0x2ea200[_0xc008('0x17')](_0x2a5b4e)['end']();};}function respondWithResult(_0x560e28,_0x33f44c){_0x33f44c=_0x33f44c||0xc8;return function(_0x50c1ab){if(_0x50c1ab){return _0x560e28[_0xc008('0x17')](_0x33f44c)[_0xc008('0x18')](_0x50c1ab);}};}function respondWithFilteredResult(_0x2073ef,_0x339ffc){return function(_0x3f0ecf){if(_0x3f0ecf){var _0x5ee00b=_0x3f0ecf[_0xc008('0x19')],_0x5e894e=_0x339ffc[_0xc008('0x1a')],_0x4bd0f4=_0x339ffc[_0xc008('0x1a')]+_0x339ffc['limit'],_0x11ef38;if(_0x4bd0f4>=_0x5ee00b){_0x4bd0f4=_0x5ee00b;_0x11ef38=0xc8;}else{_0x11ef38=0xce;}_0x2073ef['status'](_0x11ef38);return _0x2073ef['set']('Content-Range',_0x5e894e+'-'+_0x4bd0f4+'/'+_0x5ee00b)[_0xc008('0x18')](_0x3f0ecf);}return null;};}function patchUpdates(_0x462af5){return function(_0x501137){try{jsonpatch[_0xc008('0x1b')](_0x501137,_0x462af5,!![]);}catch(_0x5906e6){return BPromise['reject'](_0x5906e6);}return _0x501137['save']();};}function saveUpdates(_0x50261c,_0x5754a0){return function(_0x4b9726){if(_0x4b9726){return _0x4b9726['update'](_0x50261c)['then'](function(_0x4a582d){return _0x4a582d;});}return null;};}function removeEntity(_0x5a58bd,_0x13a263){return function(_0x4777a6){if(_0x4777a6){return _0x4777a6[_0xc008('0x1c')]()[_0xc008('0x1d')](function(){_0x5a58bd[_0xc008('0x17')](0xcc)[_0xc008('0x1e')]();});}};}function handleEntityNotFound(_0x4f43e2,_0x459fd9){return function(_0x5c85f2){if(!_0x5c85f2){_0x4f43e2['sendStatus'](0x194);}return _0x5c85f2;};}function handleError(_0x218599,_0x36f358){_0x36f358=_0x36f358||0x1f4;return function(_0x2e3cfb){logger[_0xc008('0x1f')](_0x2e3cfb['stack']);if(_0x2e3cfb['name']){delete _0x2e3cfb['name'];}_0x218599[_0xc008('0x17')](_0x36f358)[_0xc008('0x20')](_0x2e3cfb);};}exports[_0xc008('0x21')]=function(_0x2e31c2,_0x5bebd9){var _0x5e2aca={},_0x4fce9c={},_0x4adbab={'count':0x0,'rows':[]};var _0x4caaf4=db[_0xc008('0x22')][_0xc008('0x23')];_0x4fce9c[_0xc008('0x24')]=_['keys'](_0x4caaf4);_0x4fce9c[_0xc008('0x25')]=_[_0xc008('0x26')](_0x2e31c2[_0xc008('0x25')]);_0x4fce9c[_0xc008('0x27')]=_['intersection'](_0x4fce9c[_0xc008('0x24')],_0x4fce9c[_0xc008('0x25')]);_0x5e2aca['attributes']=_['intersection'](_0x4fce9c['model'],qs[_0xc008('0x28')](_0x2e31c2[_0xc008('0x25')][_0xc008('0x28')]));_0x5e2aca[_0xc008('0x29')]=_0x5e2aca[_0xc008('0x29')][_0xc008('0x2a')]?_0x5e2aca[_0xc008('0x29')]:_0x4fce9c[_0xc008('0x24')];if(!_0x2e31c2[_0xc008('0x25')][_0xc008('0x2b')](_0xc008('0x2c'))){_0x5e2aca[_0xc008('0x2d')]=qs['limit'](_0x2e31c2[_0xc008('0x25')][_0xc008('0x2d')]);_0x5e2aca['offset']=qs[_0xc008('0x1a')](_0x2e31c2[_0xc008('0x25')][_0xc008('0x1a')]);}_0x5e2aca[_0xc008('0x2e')]=qs[_0xc008('0x2f')](_0x2e31c2[_0xc008('0x25')][_0xc008('0x2f')]);_0x5e2aca[_0xc008('0x30')]=qs[_0xc008('0x27')](_['pick'](_0x2e31c2[_0xc008('0x25')],_0x4fce9c[_0xc008('0x27')]));if(_0x2e31c2[_0xc008('0x25')][_0xc008('0x31')]){_0x5e2aca[_0xc008('0x30')]=_[_0xc008('0x32')](_0x5e2aca[_0xc008('0x30')],{'$or':_['map'](_0x4caaf4,function(_0x35f360){if(_0x35f360[_0xc008('0x33')]['key']!==_0xc008('0x34')){var _0x15453c={};_0x15453c[_0x35f360['field']]={'$like':'%'+_0x2e31c2[_0xc008('0x25')][_0xc008('0x31')]+'%'};return _0x15453c;}})});}_0x5e2aca=_[_0xc008('0x32')]({},_0x5e2aca,_0x2e31c2['options']);var _0x53b353={'where':_0x5e2aca['where']};return db[_0xc008('0x22')]['count'](_0x53b353)[_0xc008('0x1d')](function(_0x3884dd){_0x4adbab[_0xc008('0x19')]=_0x3884dd;if(_0x2e31c2[_0xc008('0x25')][_0xc008('0x35')]){_0x5e2aca[_0xc008('0x36')]=[{'all':!![]}];}return db[_0xc008('0x22')][_0xc008('0x37')](_0x5e2aca);})[_0xc008('0x1d')](function(_0x387dfd){_0x4adbab[_0xc008('0x38')]=_0x387dfd;return _0x4adbab;})[_0xc008('0x1d')](respondWithFilteredResult(_0x5bebd9,_0x5e2aca))[_0xc008('0x39')](handleError(_0x5bebd9,null));};exports[_0xc008('0x3a')]=function(_0x4cace5,_0x3238b4){var _0x23c4db={'raw':![],'where':{'id':_0x4cace5[_0xc008('0x3b')]['id']}},_0x30b7df={};_0x30b7df['model']=_[_0xc008('0x26')](db[_0xc008('0x22')][_0xc008('0x23')]);_0x30b7df[_0xc008('0x25')]=_[_0xc008('0x26')](_0x4cace5['query']);_0x30b7df[_0xc008('0x27')]=_[_0xc008('0x3c')](_0x30b7df[_0xc008('0x24')],_0x30b7df[_0xc008('0x25')]);_0x23c4db[_0xc008('0x29')]=_['intersection'](_0x30b7df[_0xc008('0x24')],qs[_0xc008('0x28')](_0x4cace5[_0xc008('0x25')][_0xc008('0x28')]));_0x23c4db['attributes']=_0x23c4db[_0xc008('0x29')][_0xc008('0x2a')]?_0x23c4db[_0xc008('0x29')]:_0x30b7df['model'];if(_0x4cace5[_0xc008('0x25')]['includeAll']){_0x23c4db[_0xc008('0x36')]=[{'all':!![]}];}_0x23c4db=_['merge']({},_0x23c4db,_0x4cace5[_0xc008('0x3d')]);return db[_0xc008('0x22')]['find'](_0x23c4db)[_0xc008('0x1d')](handleEntityNotFound(_0x3238b4,null))[_0xc008('0x1d')](respondWithResult(_0x3238b4,null))[_0xc008('0x39')](handleError(_0x3238b4,null));};exports['create']=function(_0x1cec64,_0x2a9b5c){return db[_0xc008('0x22')][_0xc008('0x3e')](_0x1cec64[_0xc008('0x3f')],{})[_0xc008('0x1d')](respondWithResult(_0x2a9b5c,0xc9))['catch'](handleError(_0x2a9b5c,null));};exports['update']=function(_0x5283a8,_0x4552ed){if(_0x5283a8[_0xc008('0x3f')]['id']){delete _0x5283a8[_0xc008('0x3f')]['id'];}return db[_0xc008('0x22')][_0xc008('0x40')]({'where':{'id':_0x5283a8[_0xc008('0x3b')]['id']}})[_0xc008('0x1d')](handleEntityNotFound(_0x4552ed,null))[_0xc008('0x1d')](saveUpdates(_0x5283a8['body'],null))['then'](respondWithResult(_0x4552ed,null))['catch'](handleError(_0x4552ed,null));};exports[_0xc008('0x1c')]=function(_0x2651cf,_0x158eae){return db['UserProfileResource'][_0xc008('0x40')]({'where':{'id':_0x2651cf[_0xc008('0x3b')]['id']}})[_0xc008('0x1d')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x1d')](removeEntity(_0x158eae,null))[_0xc008('0x39')](handleError(_0x158eae,null));};exports[_0xc008('0x41')]=function(_0x17ec90,_0x405e87){return db[_0xc008('0x22')][_0xc008('0x41')]()['then'](respondWithResult(_0x405e87,null))['catch'](handleError(_0x405e87,null));}; \ No newline at end of file +var _0x9c44=['papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','sendStatus','status','json','count','offset','limit','save','update','then','error','stack','name','send','index','UserProfileResource','rawAttributes','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','key','field','options','includeAll','include','findAll','catch','show','params','fields','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring'];(function(_0x5795bd,_0x2e7735){var _0x154245=function(_0x3c6ec3){while(--_0x3c6ec3){_0x5795bd['push'](_0x5795bd['shift']());}};_0x154245(++_0x2e7735);}(_0x9c44,0x178));var _0x49c4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x9c44[_0xb0f7c3];return _0x28ea68;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x49c4('0x0'));var zipdir=require(_0x49c4('0x1'));var jsonpatch=require(_0x49c4('0x2'));var rp=require(_0x49c4('0x3'));var moment=require(_0x49c4('0x4'));var BPromise=require(_0x49c4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x49c4('0x6'));var sox=require('sox');var csv=require(_0x49c4('0x7'));var ejs=require(_0x49c4('0x8'));var fs=require('fs');var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0x7'));var querystring=require(_0x49c4('0xd'));var Papa=require(_0x49c4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0xf'));var hardwareService=require(_0x49c4('0x10'));var logger=require('../../config/logger')(_0x49c4('0x11'));var utils=require(_0x49c4('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d19bf,_0x6d1b08){_0x6d1b08=_0x6d1b08||0xcc;return function(_0x5487cd){if(_0x5487cd){return _0x1d19bf[_0x49c4('0x13')](_0x6d1b08);}return _0x1d19bf[_0x49c4('0x14')](_0x6d1b08)['end']();};}function respondWithResult(_0x1909fe,_0x280996){_0x280996=_0x280996||0xc8;return function(_0x21f15a){if(_0x21f15a){return _0x1909fe[_0x49c4('0x14')](_0x280996)[_0x49c4('0x15')](_0x21f15a);}};}function respondWithFilteredResult(_0x18211c,_0x75ea8){return function(_0x3de397){if(_0x3de397){var _0x58d177=_0x3de397[_0x49c4('0x16')],_0x3acd06=_0x75ea8[_0x49c4('0x17')],_0x141003=_0x75ea8['offset']+_0x75ea8[_0x49c4('0x18')],_0x13a2db;if(_0x141003>=_0x58d177){_0x141003=_0x58d177;_0x13a2db=0xc8;}else{_0x13a2db=0xce;}_0x18211c[_0x49c4('0x14')](_0x13a2db);return _0x18211c['set']('Content-Range',_0x3acd06+'-'+_0x141003+'/'+_0x58d177)[_0x49c4('0x15')](_0x3de397);}return null;};}function patchUpdates(_0x2f82d5){return function(_0x3addb2){try{jsonpatch['apply'](_0x3addb2,_0x2f82d5,!![]);}catch(_0x24856d){return BPromise['reject'](_0x24856d);}return _0x3addb2[_0x49c4('0x19')]();};}function saveUpdates(_0x1806c2,_0xe31fcc){return function(_0x291526){if(_0x291526){return _0x291526[_0x49c4('0x1a')](_0x1806c2)[_0x49c4('0x1b')](function(_0x280893){return _0x280893;});}return null;};}function removeEntity(_0x46e475,_0x2197d2){return function(_0x578447){if(_0x578447){return _0x578447['destroy']()['then'](function(){_0x46e475[_0x49c4('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x592bb8,_0x2263ae){return function(_0x15581b){if(!_0x15581b){_0x592bb8[_0x49c4('0x13')](0x194);}return _0x15581b;};}function handleError(_0xd335e4,_0x4811c4){_0x4811c4=_0x4811c4||0x1f4;return function(_0x5850f2){logger[_0x49c4('0x1c')](_0x5850f2[_0x49c4('0x1d')]);if(_0x5850f2['name']){delete _0x5850f2[_0x49c4('0x1e')];}_0xd335e4[_0x49c4('0x14')](_0x4811c4)[_0x49c4('0x1f')](_0x5850f2);};}exports[_0x49c4('0x20')]=function(_0x531d92,_0x543ea2){var _0x449960={},_0x53c199={},_0x3800b7={'count':0x0,'rows':[]};var _0x3852b2=db[_0x49c4('0x21')][_0x49c4('0x22')];_0x53c199['model']=_[_0x49c4('0x23')](_0x3852b2);_0x53c199[_0x49c4('0x24')]=_[_0x49c4('0x23')](_0x531d92[_0x49c4('0x24')]);_0x53c199[_0x49c4('0x25')]=_[_0x49c4('0x26')](_0x53c199[_0x49c4('0x27')],_0x53c199[_0x49c4('0x24')]);_0x449960[_0x49c4('0x28')]=_[_0x49c4('0x26')](_0x53c199[_0x49c4('0x27')],qs['fields'](_0x531d92['query']['fields']));_0x449960[_0x49c4('0x28')]=_0x449960[_0x49c4('0x28')][_0x49c4('0x29')]?_0x449960[_0x49c4('0x28')]:_0x53c199[_0x49c4('0x27')];if(!_0x531d92['query'][_0x49c4('0x2a')](_0x49c4('0x2b'))){_0x449960[_0x49c4('0x18')]=qs[_0x49c4('0x18')](_0x531d92['query']['limit']);_0x449960[_0x49c4('0x17')]=qs[_0x49c4('0x17')](_0x531d92[_0x49c4('0x24')][_0x49c4('0x17')]);}_0x449960[_0x49c4('0x2c')]=qs['sort'](_0x531d92[_0x49c4('0x24')][_0x49c4('0x2d')]);_0x449960[_0x49c4('0x2e')]=qs['filters'](_['pick'](_0x531d92[_0x49c4('0x24')],_0x53c199[_0x49c4('0x25')]));if(_0x531d92[_0x49c4('0x24')][_0x49c4('0x2f')]){_0x449960[_0x49c4('0x2e')]=_[_0x49c4('0x30')](_0x449960[_0x49c4('0x2e')],{'$or':_[_0x49c4('0x31')](_0x3852b2,function(_0x3209cd){if(_0x3209cd['type'][_0x49c4('0x32')]!=='VIRTUAL'){var _0xdda586={};_0xdda586[_0x3209cd[_0x49c4('0x33')]]={'$like':'%'+_0x531d92[_0x49c4('0x24')][_0x49c4('0x2f')]+'%'};return _0xdda586;}})});}_0x449960=_['merge']({},_0x449960,_0x531d92[_0x49c4('0x34')]);var _0x31f3ff={'where':_0x449960[_0x49c4('0x2e')]};return db['UserProfileResource'][_0x49c4('0x16')](_0x31f3ff)[_0x49c4('0x1b')](function(_0x178987){_0x3800b7[_0x49c4('0x16')]=_0x178987;if(_0x531d92[_0x49c4('0x24')][_0x49c4('0x35')]){_0x449960[_0x49c4('0x36')]=[{'all':!![]}];}return db[_0x49c4('0x21')][_0x49c4('0x37')](_0x449960);})[_0x49c4('0x1b')](function(_0x1e506a){_0x3800b7['rows']=_0x1e506a;return _0x3800b7;})[_0x49c4('0x1b')](respondWithFilteredResult(_0x543ea2,_0x449960))[_0x49c4('0x38')](handleError(_0x543ea2,null));};exports[_0x49c4('0x39')]=function(_0x23aa32,_0x41ad28){var _0x29dd5d={'raw':![],'where':{'id':_0x23aa32[_0x49c4('0x3a')]['id']}},_0x1be62d={};_0x1be62d[_0x49c4('0x27')]=_[_0x49c4('0x23')](db[_0x49c4('0x21')][_0x49c4('0x22')]);_0x1be62d[_0x49c4('0x24')]=_['keys'](_0x23aa32[_0x49c4('0x24')]);_0x1be62d['filters']=_[_0x49c4('0x26')](_0x1be62d[_0x49c4('0x27')],_0x1be62d[_0x49c4('0x24')]);_0x29dd5d[_0x49c4('0x28')]=_[_0x49c4('0x26')](_0x1be62d[_0x49c4('0x27')],qs['fields'](_0x23aa32['query'][_0x49c4('0x3b')]));_0x29dd5d[_0x49c4('0x28')]=_0x29dd5d[_0x49c4('0x28')][_0x49c4('0x29')]?_0x29dd5d['attributes']:_0x1be62d[_0x49c4('0x27')];if(_0x23aa32[_0x49c4('0x24')][_0x49c4('0x35')]){_0x29dd5d[_0x49c4('0x36')]=[{'all':!![]}];}_0x29dd5d=_[_0x49c4('0x30')]({},_0x29dd5d,_0x23aa32[_0x49c4('0x34')]);return db[_0x49c4('0x21')][_0x49c4('0x3c')](_0x29dd5d)[_0x49c4('0x1b')](handleEntityNotFound(_0x41ad28,null))['then'](respondWithResult(_0x41ad28,null))[_0x49c4('0x38')](handleError(_0x41ad28,null));};exports['create']=function(_0x33696e,_0x628423){return db[_0x49c4('0x21')][_0x49c4('0x3d')](_0x33696e[_0x49c4('0x3e')],{})['then'](respondWithResult(_0x628423,0xc9))[_0x49c4('0x38')](handleError(_0x628423,null));};exports[_0x49c4('0x1a')]=function(_0x384862,_0x254d07){if(_0x384862[_0x49c4('0x3e')]['id']){delete _0x384862[_0x49c4('0x3e')]['id'];}return db[_0x49c4('0x21')]['find']({'where':{'id':_0x384862[_0x49c4('0x3a')]['id']}})['then'](handleEntityNotFound(_0x254d07,null))[_0x49c4('0x1b')](saveUpdates(_0x384862[_0x49c4('0x3e')],null))[_0x49c4('0x1b')](respondWithResult(_0x254d07,null))[_0x49c4('0x38')](handleError(_0x254d07,null));};exports[_0x49c4('0x3f')]=function(_0x30bea5,_0x2c6be1){return db['UserProfileResource'][_0x49c4('0x3c')]({'where':{'id':_0x30bea5[_0x49c4('0x3a')]['id']}})['then'](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x1b')](removeEntity(_0x2c6be1,null))[_0x49c4('0x38')](handleError(_0x2c6be1,null));};exports[_0x49c4('0x40')]=function(_0x242afc,_0x52a8f7){return db['UserProfileResource'][_0x49c4('0x40')]()['then'](respondWithResult(_0x52a8f7,null))[_0x49c4('0x38')](handleError(_0x52a8f7,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 67f6935..5185d80 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 _0xd4ee=['path','./userProfileResource.attributes','exports','UserProfileResource','compositeIndex','resourceId','lodash','util','../../config/logger','api','request-promise'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xd4ee,0x8a));var _0xed4e=function(_0xa668e4,_0x56fd16){_0xa668e4=_0xa668e4-0x0;var _0x59e3dd=_0xd4ee[_0xa668e4];return _0x59e3dd;};'use strict';var _=require(_0xed4e('0x0'));var util=require(_0xed4e('0x1'));var logger=require(_0xed4e('0x2'))(_0xed4e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xed4e('0x4'));var fs=require('fs');var path=require(_0xed4e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xed4e('0x6'));module[_0xed4e('0x7')]=function(_0x4d868f,_0x4fb996){return _0x4d868f['define'](_0xed4e('0x8'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xed4e('0x9'),'fields':[_0xed4e('0xa'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd2e1=['../../config/environment','./userProfileResource.attributes','exports','define','user_profile_has_resources','compositeIndex','resourceId','sectionId','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd2e1,0x1a8));var _0x1d2e=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xd2e1[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1d2e('0x0'))('api');var moment=require(_0x1d2e('0x1'));var BPromise=require('bluebird');var rp=require(_0x1d2e('0x2'));var fs=require('fs');var path=require(_0x1d2e('0x3'));var rimraf=require(_0x1d2e('0x4'));var config=require(_0x1d2e('0x5'));var attributes=require(_0x1d2e('0x6'));module[_0x1d2e('0x7')]=function(_0x1ad738,_0x83b909){return _0x1ad738[_0x1d2e('0x8')]('UserProfileResource',attributes,{'tableName':_0x1d2e('0x9'),'paranoid':![],'indexes':[{'name':_0x1d2e('0xa'),'fields':[_0x1d2e('0xb'),_0x1d2e('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 2dfb869..a42684b 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 _0x2a07=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x1cadff,_0x431e66){var _0x48228c=function(_0x34c1bd){while(--_0x34c1bd){_0x1cadff['push'](_0x1cadff['shift']());}};_0x48228c(++_0x431e66);}(_0x2a07,0x74));var _0x72a0=function(_0x55fa03,_0xcb96c2){_0x55fa03=_0x55fa03-0x0;var _0x2cd7cd=_0x2a07[_0x55fa03];return _0x2cd7cd;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var moment=require(_0x72a0('0x2'));var BPromise=require(_0x72a0('0x3'));var rs=require(_0x72a0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72a0('0x5'))['db'];var utils=require(_0x72a0('0x6'));var logger=require(_0x72a0('0x7'))(_0x72a0('0x8'));var config=require(_0x72a0('0x9'));var jayson=require(_0x72a0('0xa'));var client=jayson[_0x72a0('0xb')][_0x72a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x193e3b,_0x287b06,_0x21c819){return new BPromise(function(_0x2c04eb,_0x22270e){return client[_0x72a0('0xd')](_0x193e3b,_0x21c819)[_0x72a0('0xe')](function(_0x2bc45b){logger['info'](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));logger['debug'](_0x72a0('0x11'),_0x287b06,_0x72a0('0x10'),JSON[_0x72a0('0x12')](_0x2bc45b));if(_0x2bc45b[_0x72a0('0x13')]){if(_0x2bc45b[_0x72a0('0x13')]['code']===0x1f4){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);return _0x22270e(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}logger[_0x72a0('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x287b06,_0x2bc45b['error'][_0x72a0('0x14')]);return _0x2c04eb(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}else{logger[_0x72a0('0x15')](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));_0x2c04eb(_0x2bc45b['result'][_0x72a0('0x14')]);}})[_0x72a0('0x16')](function(_0x16ac70){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x16ac70);_0x22270e(_0x16ac70);});});} \ No newline at end of file +var _0x1967=['then','info','UserProfileResource,\x20%s,\x20%s','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x1e4150,_0x55b02a){var _0x1ce3ee=function(_0x59324e){while(--_0x59324e){_0x1e4150['push'](_0x1e4150['shift']());}};_0x1ce3ee(++_0x55b02a);}(_0x1967,0x173));var _0x7196=function(_0x3150e3,_0x3dc248){_0x3150e3=_0x3150e3-0x0;var _0x5c3a13=_0x1967[_0x3150e3];return _0x5c3a13;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index f1040bd..a325f92 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 _0x362f=['destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x5a570d,_0x43a46c){var _0x30a8ab=function(_0x2f9cc2){while(--_0x2f9cc2){_0x5a570d['push'](_0x5a570d['shift']());}};_0x30a8ab(++_0x43a46c);}(_0x362f,0x8e));var _0xf362=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x362f[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf362('0x0'));var timeout=require(_0xf362('0x1'));var express=require(_0xf362('0x2'));var router=express[_0xf362('0x3')]();var auth=require(_0xf362('0x4'));var interaction=require(_0xf362('0x5'));var config=require(_0xf362('0x6'));var controller=require(_0xf362('0x7'));router[_0xf362('0x8')]('/',auth[_0xf362('0x9')](),controller[_0xf362('0xa')]);router['get'](_0xf362('0xb'),auth['isAuthenticated'](),controller[_0xf362('0xc')]);router[_0xf362('0x8')](_0xf362('0xd'),auth['isAuthenticated'](),controller[_0xf362('0xe')]);router[_0xf362('0xf')]('/',auth[_0xf362('0x9')](),controller[_0xf362('0x10')]);router[_0xf362('0x11')]('/:id',auth[_0xf362('0x9')](),controller['update']);router['delete'](_0xf362('0xd'),auth[_0xf362('0x9')](),controller[_0xf362('0x12')]);module[_0xf362('0x13')]=router; \ No newline at end of file +var _0xbbc5=['get','isAuthenticated','/describe','describe','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller'];(function(_0x4caedd,_0x7a6888){var _0x1402f1=function(_0x548cf7){while(--_0x548cf7){_0x4caedd['push'](_0x4caedd['shift']());}};_0x1402f1(++_0x7a6888);}(_0xbbc5,0x1ee));var _0x5bbc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbbc5[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x5bbc('0x0'));var util=require(_0x5bbc('0x1'));var path=require(_0x5bbc('0x2'));var timeout=require(_0x5bbc('0x3'));var express=require(_0x5bbc('0x4'));var router=express[_0x5bbc('0x5')]();var auth=require(_0x5bbc('0x6'));var interaction=require(_0x5bbc('0x7'));var config=require(_0x5bbc('0x8'));var controller=require(_0x5bbc('0x9'));router[_0x5bbc('0xa')]('/',auth[_0x5bbc('0xb')](),controller['index']);router[_0x5bbc('0xa')](_0x5bbc('0xc'),auth[_0x5bbc('0xb')](),controller[_0x5bbc('0xd')]);router[_0x5bbc('0xa')](_0x5bbc('0xe'),auth[_0x5bbc('0xb')](),controller['show']);router[_0x5bbc('0xf')]('/',auth['isAuthenticated'](),controller[_0x5bbc('0x10')]);router[_0x5bbc('0x11')](_0x5bbc('0xe'),auth[_0x5bbc('0xb')](),controller[_0x5bbc('0x12')]);router[_0x5bbc('0x13')](_0x5bbc('0xe'),auth['isAuthenticated'](),controller[_0x5bbc('0x14')]);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 38526e4..4f9d879 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 _0xedd9=['exports','STRING','INTEGER','BOOLEAN','crudPermissions','join','getDataValue'];(function(_0x150206,_0xcecec9){var _0x3ec9f2=function(_0x4d677a){while(--_0x4d677a){_0x150206['push'](_0x150206['shift']());}};_0x3ec9f2(++_0xcecec9);}(_0xedd9,0xfc));var _0x9edd=function(_0x4701e4,_0x58011f){_0x4701e4=_0x4701e4-0x0;var _0x2ce1a1=_0xedd9[_0x4701e4];return _0x2ce1a1;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'name':{'type':Sequelize[_0x9edd('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x9edd('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x9edd('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x9edd('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x9edd('0x1')],'set':function(_0x36b53f){this['setDataValue'](_0x9edd('0x4'),_0x36b53f?_0x36b53f[_0x9edd('0x5')](''):[]);},'get':function(){return this[_0x9edd('0x6')](_0x9edd('0x4'))?this['getDataValue'](_0x9edd('0x4'))['split'](''):[];}}}; \ No newline at end of file +var _0xa9e0=['crudPermissions','join','getDataValue','sequelize','exports','STRING','BOOLEAN','setDataValue'];(function(_0x26502e,_0xa2a00f){var _0x2d8c27=function(_0x55a1d5){while(--_0x55a1d5){_0x26502e['push'](_0x26502e['shift']());}};_0x2d8c27(++_0xa2a00f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x0a9e('0x2')],'set':function(_0x432180){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x432180?_0x432180[_0x0a9e('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x0a9e('0x5'))?this[_0x0a9e('0x7')](_0x0a9e('0x5'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 49681c6..9063b6f 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 _0x015e=['findAll','rows','params','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','field','options','UserProfileSection','includeAll','include'];(function(_0x3203a1,_0x46c498){var _0x24215e=function(_0x4ffab0){while(--_0x4ffab0){_0x3203a1['push'](_0x3203a1['shift']());}};_0x24215e(++_0x46c498);}(_0x015e,0x138));var _0xe015=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x015e[_0x1762b4];return _0x29beda;};'use strict';var pdf=require(_0xe015('0x0'));var emlformat=require(_0xe015('0x1'));var rimraf=require(_0xe015('0x2'));var zipdir=require(_0xe015('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe015('0x4'));var moment=require(_0xe015('0x5'));var BPromise=require(_0xe015('0x6'));var Mustache=require(_0xe015('0x7'));var util=require(_0xe015('0x8'));var path=require(_0xe015('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe015('0xa'));var fs=require('fs');var _=require(_0xe015('0xb'));var squel=require(_0xe015('0xc'));var crypto=require(_0xe015('0xd'));var jsforce=require(_0xe015('0xe'));var deskjs=require(_0xe015('0xf'));var toCsv=require(_0xe015('0x10'));var querystring=require(_0xe015('0x11'));var Papa=require(_0xe015('0x12'));var Redis=require(_0xe015('0x13'));var authService=require(_0xe015('0x14'));var qs=require(_0xe015('0x15'));var hardwareService=require(_0xe015('0x16'));var logger=require('../../config/logger')(_0xe015('0x17'));var utils=require(_0xe015('0x18'));var config=require(_0xe015('0x19'));var db=require(_0xe015('0x1a'))['db'];function respondWithStatusCode(_0x7f5832,_0x4538b7){_0x4538b7=_0x4538b7||0xcc;return function(_0x24df8e){if(_0x24df8e){return _0x7f5832[_0xe015('0x1b')](_0x4538b7);}return _0x7f5832[_0xe015('0x1c')](_0x4538b7)[_0xe015('0x1d')]();};}function respondWithResult(_0x52cddf,_0x15651a){_0x15651a=_0x15651a||0xc8;return function(_0x5763bf){if(_0x5763bf){return _0x52cddf[_0xe015('0x1c')](_0x15651a)[_0xe015('0x1e')](_0x5763bf);}};}function respondWithFilteredResult(_0x29342f,_0x44b5fc){return function(_0x496fbe){if(_0x496fbe){var _0x1372db=_0x496fbe[_0xe015('0x1f')],_0x372337=_0x44b5fc[_0xe015('0x20')],_0xdbcfe=_0x44b5fc[_0xe015('0x20')]+_0x44b5fc[_0xe015('0x21')],_0xe5cedc;if(_0xdbcfe>=_0x1372db){_0xdbcfe=_0x1372db;_0xe5cedc=0xc8;}else{_0xe5cedc=0xce;}_0x29342f[_0xe015('0x1c')](_0xe5cedc);return _0x29342f[_0xe015('0x22')](_0xe015('0x23'),_0x372337+'-'+_0xdbcfe+'/'+_0x1372db)[_0xe015('0x1e')](_0x496fbe);}return null;};}function patchUpdates(_0x25676f){return function(_0x179118){try{jsonpatch[_0xe015('0x24')](_0x179118,_0x25676f,!![]);}catch(_0x46fc00){return BPromise[_0xe015('0x25')](_0x46fc00);}return _0x179118[_0xe015('0x26')]();};}function saveUpdates(_0x59e675,_0x4e83fd){return function(_0x537ee0){if(_0x537ee0){return _0x537ee0[_0xe015('0x27')](_0x59e675)[_0xe015('0x28')](function(_0x4c8350){return _0x4c8350;});}return null;};}function removeEntity(_0x475700,_0x344b48){return function(_0x532a24){if(_0x532a24){return _0x532a24[_0xe015('0x29')]()[_0xe015('0x28')](function(){_0x475700['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x431d15,_0x3055bc){return function(_0x265867){if(!_0x265867){_0x431d15['sendStatus'](0x194);}return _0x265867;};}function handleError(_0x194eac,_0x1bf080){_0x1bf080=_0x1bf080||0x1f4;return function(_0xea72a9){logger[_0xe015('0x2a')](_0xea72a9[_0xe015('0x2b')]);if(_0xea72a9[_0xe015('0x2c')]){delete _0xea72a9[_0xe015('0x2c')];}_0x194eac[_0xe015('0x1c')](_0x1bf080)[_0xe015('0x2d')](_0xea72a9);};}exports[_0xe015('0x2e')]=function(_0x42b67e,_0x2e0c50){var _0x18051d={},_0x36178d={},_0x18cf9e={'count':0x0,'rows':[]};var _0x54e0df=db['UserProfileSection'][_0xe015('0x2f')];_0x36178d['model']=_[_0xe015('0x30')](_0x54e0df);_0x36178d[_0xe015('0x31')]=_[_0xe015('0x30')](_0x42b67e[_0xe015('0x31')]);_0x36178d[_0xe015('0x32')]=_[_0xe015('0x33')](_0x36178d['model'],_0x36178d[_0xe015('0x31')]);_0x18051d[_0xe015('0x34')]=_[_0xe015('0x33')](_0x36178d[_0xe015('0x35')],qs[_0xe015('0x36')](_0x42b67e[_0xe015('0x31')][_0xe015('0x36')]));_0x18051d[_0xe015('0x34')]=_0x18051d[_0xe015('0x34')][_0xe015('0x37')]?_0x18051d[_0xe015('0x34')]:_0x36178d[_0xe015('0x35')];if(!_0x42b67e[_0xe015('0x31')][_0xe015('0x38')]('nolimit')){_0x18051d[_0xe015('0x21')]=qs['limit'](_0x42b67e['query'][_0xe015('0x21')]);_0x18051d[_0xe015('0x20')]=qs[_0xe015('0x20')](_0x42b67e[_0xe015('0x31')][_0xe015('0x20')]);}_0x18051d[_0xe015('0x39')]=qs[_0xe015('0x3a')](_0x42b67e[_0xe015('0x31')][_0xe015('0x3a')]);_0x18051d[_0xe015('0x3b')]=qs[_0xe015('0x32')](_['pick'](_0x42b67e[_0xe015('0x31')],_0x36178d[_0xe015('0x32')]));if(_0x42b67e['query'][_0xe015('0x3c')]){_0x18051d[_0xe015('0x3b')]=_[_0xe015('0x3d')](_0x18051d['where'],{'$or':_['map'](_0x54e0df,function(_0x4a4166){if(_0x4a4166[_0xe015('0x3e')]['key']!=='VIRTUAL'){var _0x2e2930={};_0x2e2930[_0x4a4166[_0xe015('0x3f')]]={'$like':'%'+_0x42b67e[_0xe015('0x31')][_0xe015('0x3c')]+'%'};return _0x2e2930;}})});}_0x18051d=_['merge']({},_0x18051d,_0x42b67e[_0xe015('0x40')]);var _0x4380d5={'where':_0x18051d['where']};return db[_0xe015('0x41')][_0xe015('0x1f')](_0x4380d5)[_0xe015('0x28')](function(_0x902c3a){_0x18cf9e[_0xe015('0x1f')]=_0x902c3a;if(_0x42b67e[_0xe015('0x31')][_0xe015('0x42')]){_0x18051d[_0xe015('0x43')]=[{'all':!![]}];}return db[_0xe015('0x41')][_0xe015('0x44')](_0x18051d);})[_0xe015('0x28')](function(_0x56cb68){_0x18cf9e[_0xe015('0x45')]=_0x56cb68;return _0x18cf9e;})['then'](respondWithFilteredResult(_0x2e0c50,_0x18051d))['catch'](handleError(_0x2e0c50,null));};exports['show']=function(_0x15ee8c,_0x4ec992){var _0x11c430={'raw':![],'where':{'id':_0x15ee8c[_0xe015('0x46')]['id']}},_0x15dba9={};_0x15dba9[_0xe015('0x35')]=_[_0xe015('0x30')](db[_0xe015('0x41')][_0xe015('0x2f')]);_0x15dba9['query']=_[_0xe015('0x30')](_0x15ee8c[_0xe015('0x31')]);_0x15dba9[_0xe015('0x32')]=_['intersection'](_0x15dba9[_0xe015('0x35')],_0x15dba9[_0xe015('0x31')]);_0x11c430[_0xe015('0x34')]=_[_0xe015('0x33')](_0x15dba9['model'],qs[_0xe015('0x36')](_0x15ee8c[_0xe015('0x31')][_0xe015('0x36')]));_0x11c430[_0xe015('0x34')]=_0x11c430[_0xe015('0x34')][_0xe015('0x37')]?_0x11c430[_0xe015('0x34')]:_0x15dba9[_0xe015('0x35')];if(_0x15ee8c['query'][_0xe015('0x42')]){_0x11c430[_0xe015('0x43')]=[{'all':!![]}];}_0x11c430=_[_0xe015('0x3d')]({},_0x11c430,_0x15ee8c[_0xe015('0x40')]);return db[_0xe015('0x41')][_0xe015('0x47')](_0x11c430)[_0xe015('0x28')](handleEntityNotFound(_0x4ec992,null))['then'](respondWithResult(_0x4ec992,null))[_0xe015('0x48')](handleError(_0x4ec992,null));};exports[_0xe015('0x49')]=function(_0x360d6a,_0x187779){return db['UserProfileSection']['create'](_0x360d6a[_0xe015('0x4a')],{})[_0xe015('0x28')](respondWithResult(_0x187779,0xc9))['catch'](handleError(_0x187779,null));};exports[_0xe015('0x27')]=function(_0x10a7de,_0x4e097a){if(_0x10a7de['body']['id']){delete _0x10a7de[_0xe015('0x4a')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x10a7de[_0xe015('0x46')]['id']}})['then'](handleEntityNotFound(_0x4e097a,null))[_0xe015('0x28')](saveUpdates(_0x10a7de[_0xe015('0x4a')],null))['then'](respondWithResult(_0x4e097a,null))[_0xe015('0x48')](handleError(_0x4e097a,null));};exports[_0xe015('0x29')]=function(_0x215adc,_0x19a5ae){return db[_0xe015('0x41')][_0xe015('0x47')]({'where':{'id':_0x215adc[_0xe015('0x46')]['id']}})['then'](handleEntityNotFound(_0x19a5ae,null))[_0xe015('0x28')](removeEntity(_0x19a5ae,null))[_0xe015('0x48')](handleError(_0x19a5ae,null));};exports[_0xe015('0x4b')]=function(_0x51ddb7,_0xb3574d){return db[_0xe015('0x41')][_0xe015('0x4b')]()[_0xe015('0x28')](respondWithResult(_0xb3574d,null))['catch'](handleError(_0xb3574d,null));}; \ No newline at end of file +var _0x52ac=['show','params','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','map','key','VIRTUAL','filter','merge','options','UserProfileSection','includeAll','include','findAll','rows','catch'];(function(_0x43df4c,_0x51a1f8){var _0x9611f1=function(_0x568ef0){while(--_0x568ef0){_0x43df4c['push'](_0x43df4c['shift']());}};_0x9611f1(++_0x51a1f8);}(_0x52ac,0x12e));var _0xc52a=function(_0x1d69e5,_0x2a29af){_0x1d69e5=_0x1d69e5-0x0;var _0x17da11=_0x52ac[_0x1d69e5];return _0x17da11;};'use strict';var pdf=require(_0xc52a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc52a('0x1'));var zipdir=require(_0xc52a('0x2'));var jsonpatch=require(_0xc52a('0x3'));var rp=require(_0xc52a('0x4'));var moment=require('moment');var BPromise=require(_0xc52a('0x5'));var Mustache=require('mustache');var util=require(_0xc52a('0x6'));var path=require(_0xc52a('0x7'));var sox=require(_0xc52a('0x8'));var csv=require(_0xc52a('0x9'));var ejs=require(_0xc52a('0xa'));var fs=require('fs');var _=require(_0xc52a('0xb'));var squel=require(_0xc52a('0xc'));var crypto=require('crypto');var jsforce=require(_0xc52a('0xd'));var deskjs=require(_0xc52a('0xe'));var toCsv=require(_0xc52a('0x9'));var querystring=require(_0xc52a('0xf'));var Papa=require('papaparse');var Redis=require(_0xc52a('0x10'));var authService=require(_0xc52a('0x11'));var qs=require(_0xc52a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc52a('0x13'))(_0xc52a('0x14'));var utils=require(_0xc52a('0x15'));var config=require(_0xc52a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2eeb34,_0x46cb98){_0x46cb98=_0x46cb98||0xcc;return function(_0x43b173){if(_0x43b173){return _0x2eeb34[_0xc52a('0x17')](_0x46cb98);}return _0x2eeb34[_0xc52a('0x18')](_0x46cb98)[_0xc52a('0x19')]();};}function respondWithResult(_0x140cd3,_0x2e885e){_0x2e885e=_0x2e885e||0xc8;return function(_0x319998){if(_0x319998){return _0x140cd3[_0xc52a('0x18')](_0x2e885e)[_0xc52a('0x1a')](_0x319998);}};}function respondWithFilteredResult(_0xfa4180,_0x5bef8b){return function(_0x6517a9){if(_0x6517a9){var _0x495a41=_0x6517a9[_0xc52a('0x1b')],_0x12fef7=_0x5bef8b[_0xc52a('0x1c')],_0x2f1366=_0x5bef8b[_0xc52a('0x1c')]+_0x5bef8b[_0xc52a('0x1d')],_0x49f487;if(_0x2f1366>=_0x495a41){_0x2f1366=_0x495a41;_0x49f487=0xc8;}else{_0x49f487=0xce;}_0xfa4180[_0xc52a('0x18')](_0x49f487);return _0xfa4180[_0xc52a('0x1e')](_0xc52a('0x1f'),_0x12fef7+'-'+_0x2f1366+'/'+_0x495a41)[_0xc52a('0x1a')](_0x6517a9);}return null;};}function patchUpdates(_0x29bfdf){return function(_0x7ddc0c){try{jsonpatch['apply'](_0x7ddc0c,_0x29bfdf,!![]);}catch(_0x531956){return BPromise[_0xc52a('0x20')](_0x531956);}return _0x7ddc0c[_0xc52a('0x21')]();};}function saveUpdates(_0xea0e42,_0x208854){return function(_0x347fcb){if(_0x347fcb){return _0x347fcb[_0xc52a('0x22')](_0xea0e42)['then'](function(_0x39f6f1){return _0x39f6f1;});}return null;};}function removeEntity(_0x512acd,_0x358d9f){return function(_0x452df7){if(_0x452df7){return _0x452df7[_0xc52a('0x23')]()[_0xc52a('0x24')](function(){_0x512acd[_0xc52a('0x18')](0xcc)[_0xc52a('0x19')]();});}};}function handleEntityNotFound(_0x3e61d7,_0x556188){return function(_0x48e93b){if(!_0x48e93b){_0x3e61d7[_0xc52a('0x17')](0x194);}return _0x48e93b;};}function handleError(_0x5d9815,_0x446a97){_0x446a97=_0x446a97||0x1f4;return function(_0x595c5c){logger[_0xc52a('0x25')](_0x595c5c[_0xc52a('0x26')]);if(_0x595c5c[_0xc52a('0x27')]){delete _0x595c5c[_0xc52a('0x27')];}_0x5d9815[_0xc52a('0x18')](_0x446a97)[_0xc52a('0x28')](_0x595c5c);};}exports[_0xc52a('0x29')]=function(_0x3d2068,_0x1f91d0){var _0x2be0dd={},_0x3f391a={},_0x344fad={'count':0x0,'rows':[]};var _0x1dfd0a=db['UserProfileSection'][_0xc52a('0x2a')];_0x3f391a[_0xc52a('0x2b')]=_[_0xc52a('0x2c')](_0x1dfd0a);_0x3f391a['query']=_[_0xc52a('0x2c')](_0x3d2068[_0xc52a('0x2d')]);_0x3f391a[_0xc52a('0x2e')]=_[_0xc52a('0x2f')](_0x3f391a[_0xc52a('0x2b')],_0x3f391a[_0xc52a('0x2d')]);_0x2be0dd[_0xc52a('0x30')]=_[_0xc52a('0x2f')](_0x3f391a[_0xc52a('0x2b')],qs[_0xc52a('0x31')](_0x3d2068[_0xc52a('0x2d')]['fields']));_0x2be0dd[_0xc52a('0x30')]=_0x2be0dd[_0xc52a('0x30')][_0xc52a('0x32')]?_0x2be0dd[_0xc52a('0x30')]:_0x3f391a['model'];if(!_0x3d2068[_0xc52a('0x2d')]['hasOwnProperty'](_0xc52a('0x33'))){_0x2be0dd['limit']=qs['limit'](_0x3d2068[_0xc52a('0x2d')][_0xc52a('0x1d')]);_0x2be0dd[_0xc52a('0x1c')]=qs['offset'](_0x3d2068['query'][_0xc52a('0x1c')]);}_0x2be0dd[_0xc52a('0x34')]=qs[_0xc52a('0x35')](_0x3d2068[_0xc52a('0x2d')][_0xc52a('0x35')]);_0x2be0dd[_0xc52a('0x36')]=qs[_0xc52a('0x2e')](_[_0xc52a('0x37')](_0x3d2068[_0xc52a('0x2d')],_0x3f391a['filters']));if(_0x3d2068['query']['filter']){_0x2be0dd[_0xc52a('0x36')]=_['merge'](_0x2be0dd[_0xc52a('0x36')],{'$or':_[_0xc52a('0x38')](_0x1dfd0a,function(_0xd46506){if(_0xd46506['type'][_0xc52a('0x39')]!==_0xc52a('0x3a')){var _0x35256c={};_0x35256c[_0xd46506['field']]={'$like':'%'+_0x3d2068['query'][_0xc52a('0x3b')]+'%'};return _0x35256c;}})});}_0x2be0dd=_[_0xc52a('0x3c')]({},_0x2be0dd,_0x3d2068[_0xc52a('0x3d')]);var _0x13fb28={'where':_0x2be0dd[_0xc52a('0x36')]};return db[_0xc52a('0x3e')][_0xc52a('0x1b')](_0x13fb28)[_0xc52a('0x24')](function(_0x51a0bc){_0x344fad[_0xc52a('0x1b')]=_0x51a0bc;if(_0x3d2068[_0xc52a('0x2d')][_0xc52a('0x3f')]){_0x2be0dd[_0xc52a('0x40')]=[{'all':!![]}];}return db['UserProfileSection'][_0xc52a('0x41')](_0x2be0dd);})[_0xc52a('0x24')](function(_0x2f44d5){_0x344fad[_0xc52a('0x42')]=_0x2f44d5;return _0x344fad;})[_0xc52a('0x24')](respondWithFilteredResult(_0x1f91d0,_0x2be0dd))[_0xc52a('0x43')](handleError(_0x1f91d0,null));};exports[_0xc52a('0x44')]=function(_0x17db19,_0x475f41){var _0x2dad50={'raw':![],'where':{'id':_0x17db19[_0xc52a('0x45')]['id']}},_0x490cc2={};_0x490cc2[_0xc52a('0x2b')]=_[_0xc52a('0x2c')](db[_0xc52a('0x3e')][_0xc52a('0x2a')]);_0x490cc2['query']=_[_0xc52a('0x2c')](_0x17db19[_0xc52a('0x2d')]);_0x490cc2[_0xc52a('0x2e')]=_['intersection'](_0x490cc2[_0xc52a('0x2b')],_0x490cc2['query']);_0x2dad50['attributes']=_['intersection'](_0x490cc2[_0xc52a('0x2b')],qs[_0xc52a('0x31')](_0x17db19[_0xc52a('0x2d')][_0xc52a('0x31')]));_0x2dad50['attributes']=_0x2dad50[_0xc52a('0x30')]['length']?_0x2dad50[_0xc52a('0x30')]:_0x490cc2[_0xc52a('0x2b')];if(_0x17db19['query'][_0xc52a('0x3f')]){_0x2dad50[_0xc52a('0x40')]=[{'all':!![]}];}_0x2dad50=_[_0xc52a('0x3c')]({},_0x2dad50,_0x17db19[_0xc52a('0x3d')]);return db[_0xc52a('0x3e')][_0xc52a('0x46')](_0x2dad50)[_0xc52a('0x24')](handleEntityNotFound(_0x475f41,null))[_0xc52a('0x24')](respondWithResult(_0x475f41,null))[_0xc52a('0x43')](handleError(_0x475f41,null));};exports[_0xc52a('0x47')]=function(_0x336e0f,_0x37f9fa){return db[_0xc52a('0x3e')][_0xc52a('0x47')](_0x336e0f[_0xc52a('0x48')],{})['then'](respondWithResult(_0x37f9fa,0xc9))[_0xc52a('0x43')](handleError(_0x37f9fa,null));};exports['update']=function(_0x5c7fb4,_0x491711){if(_0x5c7fb4[_0xc52a('0x48')]['id']){delete _0x5c7fb4[_0xc52a('0x48')]['id'];}return db[_0xc52a('0x3e')][_0xc52a('0x46')]({'where':{'id':_0x5c7fb4[_0xc52a('0x45')]['id']}})[_0xc52a('0x24')](handleEntityNotFound(_0x491711,null))['then'](saveUpdates(_0x5c7fb4[_0xc52a('0x48')],null))['then'](respondWithResult(_0x491711,null))['catch'](handleError(_0x491711,null));};exports[_0xc52a('0x23')]=function(_0x2b4737,_0xc7ad7){return db[_0xc52a('0x3e')]['find']({'where':{'id':_0x2b4737['params']['id']}})[_0xc52a('0x24')](handleEntityNotFound(_0xc7ad7,null))['then'](removeEntity(_0xc7ad7,null))[_0xc52a('0x43')](handleError(_0xc7ad7,null));};exports[_0xc52a('0x49')]=function(_0x350d5c,_0x154f92){return db[_0xc52a('0x3e')]['describe']()[_0xc52a('0x24')](respondWithResult(_0x154f92,null))[_0xc52a('0x43')](handleError(_0x154f92,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index b9c3c28..7a1e53b 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 _0x656f=['define','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports'];(function(_0xc3011c,_0x274ed7){var _0x1c04c0=function(_0x28a165){while(--_0x28a165){_0xc3011c['push'](_0xc3011c['shift']());}};_0x1c04c0(++_0x274ed7);}(_0x656f,0xc4));var _0xf656=function(_0x4398ef,_0x224634){_0x4398ef=_0x4398ef-0x0;var _0xcd93c5=_0x656f[_0x4398ef];return _0xcd93c5;};'use strict';var _=require(_0xf656('0x0'));var util=require(_0xf656('0x1'));var logger=require(_0xf656('0x2'))(_0xf656('0x3'));var moment=require(_0xf656('0x4'));var BPromise=require(_0xf656('0x5'));var rp=require(_0xf656('0x6'));var fs=require('fs');var path=require(_0xf656('0x7'));var rimraf=require(_0xf656('0x8'));var config=require(_0xf656('0x9'));var attributes=require(_0xf656('0xa'));module[_0xf656('0xb')]=function(_0x1ff65e,_0x30bde4){return _0x1ff65e[_0xf656('0xc')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0xf656('0xd'),'fields':[_0xf656('0xe'),_0xf656('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3792=['rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2c9427,_0x331c7b){var _0x1b6dc8=function(_0x2b6bb0){while(--_0x2b6bb0){_0x2c9427['push'](_0x2c9427['shift']());}};_0x1b6dc8(++_0x331c7b);}(_0x3792,0x9f));var _0x2379=function(_0x355ffa,_0x3f656c){_0x355ffa=_0x355ffa-0x0;var _0x1ceb6c=_0x3792[_0x355ffa];return _0x1ceb6c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2379('0x0'))(_0x2379('0x1'));var moment=require(_0x2379('0x2'));var BPromise=require(_0x2379('0x3'));var rp=require(_0x2379('0x4'));var fs=require('fs');var path=require(_0x2379('0x5'));var rimraf=require(_0x2379('0x6'));var config=require(_0x2379('0x7'));var attributes=require(_0x2379('0x8'));module[_0x2379('0x9')]=function(_0x46f846,_0x1c600c){return _0x46f846[_0x2379('0xa')](_0x2379('0xb'),attributes,{'tableName':_0x2379('0xc'),'paranoid':![],'indexes':[{'name':_0x2379('0xd'),'fields':[_0x2379('0xe'),'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 146df3d..1b0ecf1 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 _0xf3b8=['code','UserProfileSection,\x20%s,\x20%s','message','info','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x28f32c,_0x4cc342){var _0x355402=function(_0xdb5032){while(--_0xdb5032){_0x28f32c['push'](_0x28f32c['shift']());}};_0x355402(++_0x4cc342);}(_0xf3b8,0x8f));var _0x8f3b=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0xf3b8[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require(_0x8f3b('0x0'));var util=require(_0x8f3b('0x1'));var moment=require(_0x8f3b('0x2'));var BPromise=require('bluebird');var rs=require(_0x8f3b('0x3'));var fs=require('fs');var Redis=require(_0x8f3b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8f3b('0x5'));var logger=require('../../config/logger')(_0x8f3b('0x6'));var config=require(_0x8f3b('0x7'));var jayson=require(_0x8f3b('0x8'));var client=jayson[_0x8f3b('0x9')][_0x8f3b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25c3fd,_0x483104,_0x574d81){return new BPromise(function(_0x384e80,_0x2b3d89){return client[_0x8f3b('0xb')](_0x25c3fd,_0x574d81)[_0x8f3b('0xc')](function(_0x2b0c8b){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x483104,'request\x20sent');logger[_0x8f3b('0xd')](_0x8f3b('0xe'),_0x483104,_0x8f3b('0xf'),JSON[_0x8f3b('0x10')](_0x2b0c8b));if(_0x2b0c8b[_0x8f3b('0x11')]){if(_0x2b0c8b['error'][_0x8f3b('0x12')]===0x1f4){logger[_0x8f3b('0x11')](_0x8f3b('0x13'),_0x483104,_0x2b0c8b[_0x8f3b('0x11')][_0x8f3b('0x14')]);return _0x2b3d89(_0x2b0c8b[_0x8f3b('0x11')]['message']);}logger[_0x8f3b('0x11')](_0x8f3b('0x13'),_0x483104,_0x2b0c8b[_0x8f3b('0x11')][_0x8f3b('0x14')]);return _0x384e80(_0x2b0c8b[_0x8f3b('0x11')][_0x8f3b('0x14')]);}else{logger[_0x8f3b('0x15')](_0x8f3b('0x13'),_0x483104,_0x8f3b('0xf'));_0x384e80(_0x2b0c8b['result'][_0x8f3b('0x14')]);}})[_0x8f3b('0x16')](function(_0x5adbb2){logger[_0x8f3b('0x11')](_0x8f3b('0x13'),_0x483104,_0x5adbb2);_0x2b3d89(_0x5adbb2);});});} \ No newline at end of file +var _0x4b34=['stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../config/logger','rpc','client','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x4b34,0xd7));var _0x44b3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x4b34[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x44b3('0x0'));var BPromise=require('bluebird');var rs=require(_0x44b3('0x1'));var fs=require('fs');var Redis=require(_0x44b3('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x44b3('0x3'))(_0x44b3('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x44b3('0x5')][_0x44b3('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5cd47a,_0x285d7b,_0x249856){return new BPromise(function(_0x382916,_0xfccef3){return client['request'](_0x5cd47a,_0x249856)[_0x44b3('0x7')](function(_0x4eec6d){logger[_0x44b3('0x8')](_0x44b3('0x9'),_0x285d7b,_0x44b3('0xa'));logger[_0x44b3('0xb')](_0x44b3('0xc'),_0x285d7b,_0x44b3('0xa'),JSON[_0x44b3('0xd')](_0x4eec6d));if(_0x4eec6d[_0x44b3('0xe')]){if(_0x4eec6d[_0x44b3('0xe')][_0x44b3('0xf')]===0x1f4){logger[_0x44b3('0xe')](_0x44b3('0x9'),_0x285d7b,_0x4eec6d[_0x44b3('0xe')]['message']);return _0xfccef3(_0x4eec6d[_0x44b3('0xe')][_0x44b3('0x10')]);}logger[_0x44b3('0xe')](_0x44b3('0x9'),_0x285d7b,_0x4eec6d['error']['message']);return _0x382916(_0x4eec6d[_0x44b3('0xe')][_0x44b3('0x10')]);}else{logger[_0x44b3('0x8')]('UserProfileSection,\x20%s,\x20%s',_0x285d7b,_0x44b3('0xa'));_0x382916(_0x4eec6d[_0x44b3('0x11')][_0x44b3('0x10')]);}})[_0x44b3('0x12')](function(_0x5c914f){logger[_0x44b3('0xe')](_0x44b3('0x9'),_0x285d7b,_0x5c914f);_0xfccef3(_0x5c914f);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 2f804f4..4214156 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 _0xf981=['express','Router','../../components/auth/service','../../components/interaction/service','exports','multer','util','path','connect-timeout'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0xf981,0xe6));var _0x1f98=function(_0x48ce78,_0x22343e){_0x48ce78=_0x48ce78-0x0;var _0x45f698=_0xf981[_0x48ce78];return _0x45f698;};'use strict';var multer=require(_0x1f98('0x0'));var util=require(_0x1f98('0x1'));var path=require(_0x1f98('0x2'));var timeout=require(_0x1f98('0x3'));var express=require(_0x1f98('0x4'));var router=express[_0x1f98('0x5')]();var auth=require(_0x1f98('0x6'));var interaction=require(_0x1f98('0x7'));var config=require('../../config/environment');module[_0x1f98('0x8')]=router; \ No newline at end of file +var _0x6455=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','exports','multer'];(function(_0x8497f8,_0x5a7733){var _0x597046=function(_0x4be6cd){while(--_0x4be6cd){_0x8497f8['push'](_0x8497f8['shift']());}};_0x597046(++_0x5a7733);}(_0x6455,0x97));var _0x5645=function(_0x34001a,_0x4b30ec){_0x34001a=_0x34001a-0x0;var _0x4285c9=_0x6455[_0x34001a];return _0x4285c9;};'use strict';var multer=require(_0x5645('0x0'));var util=require('util');var path=require(_0x5645('0x1'));var timeout=require(_0x5645('0x2'));var express=require(_0x5645('0x3'));var router=express[_0x5645('0x4')]();var auth=require(_0x5645('0x5'));var interaction=require(_0x5645('0x6'));var config=require('../../config/environment');module[_0x5645('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 5912a02..0539509 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 _0x7fec=['INTEGER','sequelize','exports'];(function(_0x4acef5,_0x56618f){var _0x5dc8a2=function(_0x40b1ba){while(--_0x40b1ba){_0x4acef5['push'](_0x4acef5['shift']());}};_0x5dc8a2(++_0x56618f);}(_0x7fec,0x1c0));var _0xc7fe=function(_0x163440,_0x524d62){_0x163440=_0x163440-0x0;var _0x4fe3e1=_0x7fec[_0x163440];return _0x4fe3e1;};'use strict';var Sequelize=require(_0xc7fe('0x0'));module[_0xc7fe('0x1')]={'penalty':{'type':Sequelize[_0xc7fe('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x947a=['exports'];(function(_0x419d15,_0x40f894){var _0x132306=function(_0x51060f){while(--_0x51060f){_0x419d15['push'](_0x419d15['shift']());}};_0x132306(++_0x40f894);}(_0x947a,0xbc));var _0xa947=function(_0x19df8e,_0xc8482){_0x19df8e=_0x19df8e-0x0;var _0x378598=_0x947a[_0x19df8e];return _0x378598;};'use strict';var Sequelize=require('sequelize');module[_0xa947('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'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 9b7288f..0f55415 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 _0xe714=['path','../../config/environment','./userSmsQueue.attributes','exports','define','user_has_sms_queues','lodash','../../config/logger','api','moment','bluebird'];(function(_0x299600,_0x2a8eda){var _0x1ca8e6=function(_0x1c2780){while(--_0x1c2780){_0x299600['push'](_0x299600['shift']());}};_0x1ca8e6(++_0x2a8eda);}(_0xe714,0xe2));var _0x4e71=function(_0xfa34aa,_0x1aa9b2){_0xfa34aa=_0xfa34aa-0x0;var _0x469987=_0xe714[_0xfa34aa];return _0x469987;};'use strict';var _=require(_0x4e71('0x0'));var util=require('util');var logger=require(_0x4e71('0x1'))(_0x4e71('0x2'));var moment=require(_0x4e71('0x3'));var BPromise=require(_0x4e71('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e71('0x5'));var rimraf=require('rimraf');var config=require(_0x4e71('0x6'));var attributes=require(_0x4e71('0x7'));module[_0x4e71('0x8')]=function(_0x204a19,_0xfe1559){return _0x204a19[_0x4e71('0x9')]('UserSmsQueue',attributes,{'tableName':_0x4e71('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef3f=['exports','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x5d9394,_0x4f9a7c){var _0xca67ba=function(_0x196795){while(--_0x196795){_0x5d9394['push'](_0x5d9394['shift']());}};_0xca67ba(++_0x4f9a7c);}(_0xef3f,0xe2));var _0xfef3=function(_0x18c690,_0x294f61){_0x18c690=_0x18c690-0x0;var _0x595d87=_0xef3f[_0x18c690];return _0x595d87;};'use strict';var _=require(_0xfef3('0x0'));var util=require(_0xfef3('0x1'));var logger=require('../../config/logger')(_0xfef3('0x2'));var moment=require(_0xfef3('0x3'));var BPromise=require('bluebird');var rp=require(_0xfef3('0x4'));var fs=require('fs');var path=require(_0xfef3('0x5'));var rimraf=require(_0xfef3('0x6'));var config=require(_0xfef3('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0xfef3('0x8')]=function(_0x306fe7,_0x5aebfd){return _0x306fe7['define']('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','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 43e330b..6b7933e 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 _0x2ae6=['debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x3cdf05,_0x3920b9){var _0xb7cc25=function(_0x103beb){while(--_0x103beb){_0x3cdf05['push'](_0x3cdf05['shift']());}};_0xb7cc25(++_0x3920b9);}(_0x2ae6,0xe4));var _0x62ae=function(_0x5ac84c,_0x287781){_0x5ac84c=_0x5ac84c-0x0;var _0x3c53d2=_0x2ae6[_0x5ac84c];return _0x3c53d2;};'use strict';var _=require('lodash');var util=require(_0x62ae('0x0'));var moment=require(_0x62ae('0x1'));var BPromise=require(_0x62ae('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x62ae('0x3'));var db=require(_0x62ae('0x4'))['db'];var utils=require(_0x62ae('0x5'));var logger=require(_0x62ae('0x6'))(_0x62ae('0x7'));var config=require('../../config/environment');var jayson=require(_0x62ae('0x8'));var client=jayson[_0x62ae('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d1a96,_0x20188c,_0x3df736){return new BPromise(function(_0x149c5a,_0x479303){return client[_0x62ae('0xa')](_0x3d1a96,_0x3df736)[_0x62ae('0xb')](function(_0x4bda55){logger['info'](_0x62ae('0xc'),_0x20188c,_0x62ae('0xd'));logger[_0x62ae('0xe')](_0x62ae('0xf'),_0x20188c,'request\x20sent',JSON[_0x62ae('0x10')](_0x4bda55));if(_0x4bda55[_0x62ae('0x11')]){if(_0x4bda55[_0x62ae('0x11')]['code']===0x1f4){logger['error'](_0x62ae('0xc'),_0x20188c,_0x4bda55[_0x62ae('0x11')][_0x62ae('0x12')]);return _0x479303(_0x4bda55['error'][_0x62ae('0x12')]);}logger[_0x62ae('0x11')](_0x62ae('0xc'),_0x20188c,_0x4bda55['error'][_0x62ae('0x12')]);return _0x149c5a(_0x4bda55['error'][_0x62ae('0x12')]);}else{logger[_0x62ae('0x13')](_0x62ae('0xc'),_0x20188c,'request\x20sent');_0x149c5a(_0x4bda55[_0x62ae('0x14')][_0x62ae('0x12')]);}})[_0x62ae('0x15')](function(_0x2a9fdf){logger['error'](_0x62ae('0xc'),_0x20188c,_0x2a9fdf);_0x479303(_0x2a9fdf);});});} \ No newline at end of file +var _0x5a21=['catch','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x28c2f1,_0x1401c3){var _0x5a11b3=function(_0x179a86){while(--_0x179a86){_0x28c2f1['push'](_0x28c2f1['shift']());}};_0x5a11b3(++_0x1401c3);}(_0x5a21,0x79));var _0x15a2=function(_0x40c402,_0x42ee7d){_0x40c402=_0x40c402-0x0;var _0x4e7680=_0x5a21[_0x40c402];return _0x4e7680;};'use strict';var _=require('lodash');var util=require(_0x15a2('0x0'));var moment=require(_0x15a2('0x1'));var BPromise=require('bluebird');var rs=require(_0x15a2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x15a2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x15a2('0x4'))(_0x15a2('0x5'));var config=require(_0x15a2('0x6'));var jayson=require(_0x15a2('0x7'));var client=jayson[_0x15a2('0x8')][_0x15a2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3038c6,_0x290705,_0x5084fa){return new BPromise(function(_0x5bbddd,_0x35bde3){return client[_0x15a2('0xa')](_0x3038c6,_0x5084fa)[_0x15a2('0xb')](function(_0x30f0ce){logger[_0x15a2('0xc')](_0x15a2('0xd'),_0x290705,_0x15a2('0xe'));logger[_0x15a2('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x290705,_0x15a2('0xe'),JSON[_0x15a2('0x10')](_0x30f0ce));if(_0x30f0ce[_0x15a2('0x11')]){if(_0x30f0ce[_0x15a2('0x11')]['code']===0x1f4){logger[_0x15a2('0x11')](_0x15a2('0xd'),_0x290705,_0x30f0ce['error'][_0x15a2('0x12')]);return _0x35bde3(_0x30f0ce[_0x15a2('0x11')][_0x15a2('0x12')]);}logger['error'](_0x15a2('0xd'),_0x290705,_0x30f0ce[_0x15a2('0x11')][_0x15a2('0x12')]);return _0x5bbddd(_0x30f0ce[_0x15a2('0x11')][_0x15a2('0x12')]);}else{logger[_0x15a2('0xc')]('UserSmsQueue,\x20%s,\x20%s',_0x290705,'request\x20sent');_0x5bbddd(_0x30f0ce['result']['message']);}})[_0x15a2('0x13')](function(_0x286151){logger[_0x15a2('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x290705,_0x286151);_0x35bde3(_0x286151);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 20a855a..813b18a 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 _0x6931=['../../components/interaction/service','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x46c58f,_0x36af1a){var _0x3e57c4=function(_0x23c2b1){while(--_0x23c2b1){_0x46c58f['push'](_0x46c58f['shift']());}};_0x3e57c4(++_0x36af1a);}(_0x6931,0x1a9));var _0x1693=function(_0x3953db,_0x10f8f1){_0x3953db=_0x3953db-0x0;var _0x21ea84=_0x6931[_0x3953db];return _0x21ea84;};'use strict';var multer=require(_0x1693('0x0'));var util=require(_0x1693('0x1'));var path=require(_0x1693('0x2'));var timeout=require(_0x1693('0x3'));var express=require(_0x1693('0x4'));var router=express[_0x1693('0x5')]();var auth=require(_0x1693('0x6'));var interaction=require(_0x1693('0x7'));var config=require('../../config/environment');module[_0x1693('0x8')]=router; \ No newline at end of file +var _0xdb2a=['../../config/environment','multer','util','path','Router','../../components/auth/service'];(function(_0x309990,_0x1bf2ce){var _0xc4332c=function(_0x34dc8b){while(--_0x34dc8b){_0x309990['push'](_0x309990['shift']());}};_0xc4332c(++_0x1bf2ce);}(_0xdb2a,0x16f));var _0xadb2=function(_0x36f88d,_0x5a0899){_0x36f88d=_0x36f88d-0x0;var _0x83a2a6=_0xdb2a[_0x36f88d];return _0x83a2a6;};'use strict';var multer=require(_0xadb2('0x0'));var util=require(_0xadb2('0x1'));var path=require(_0xadb2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xadb2('0x3')]();var auth=require(_0xadb2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xadb2('0x5'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 063444e..0e4dfcf 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 _0xaf4d=['exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf4d,0x154));var _0xdaf4=function(_0xd5e88b,_0x10c7d1){_0xd5e88b=_0xd5e88b-0x0;var _0xf79c00=_0xaf4d[_0xd5e88b];return _0xf79c00;};'use strict';var Sequelize=require('sequelize');module[_0xdaf4('0x0')]={'penalty':{'type':Sequelize[_0xdaf4('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe239=['sequelize','exports'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xe239,0x11c));var _0x9e23=function(_0x3cf815,_0x10735d){_0x3cf815=_0x3cf815-0x0;var _0x171f20=_0xe239[_0x3cf815];return _0x171f20;};'use strict';var Sequelize=require(_0x9e23('0x0'));module[_0x9e23('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 98e23f7..d04ed68 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 _0x1506=['user_has_voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','define','UserVoiceQueue'];(function(_0x24198f,_0x58879f){var _0x5f1e58=function(_0x37923a){while(--_0x37923a){_0x24198f['push'](_0x24198f['shift']());}};_0x5f1e58(++_0x58879f);}(_0x1506,0x9d));var _0x6150=function(_0x55a0bf,_0x3f1235){_0x55a0bf=_0x55a0bf-0x0;var _0x20dfec=_0x1506[_0x55a0bf];return _0x20dfec;};'use strict';var _=require(_0x6150('0x0'));var util=require(_0x6150('0x1'));var logger=require(_0x6150('0x2'))(_0x6150('0x3'));var moment=require('moment');var BPromise=require(_0x6150('0x4'));var rp=require(_0x6150('0x5'));var fs=require('fs');var path=require(_0x6150('0x6'));var rimraf=require(_0x6150('0x7'));var config=require('../../config/environment');var attributes=require('./userVoiceQueue.attributes');module[_0x6150('0x8')]=function(_0x5297f4,_0x4f3c2b){return _0x5297f4[_0x6150('0x9')](_0x6150('0xa'),attributes,{'tableName':_0x6150('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x797f=['../../config/logger','api','moment','bluebird','request-promise','path','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x797f,0x150));var _0xf797=function(_0x1a7e51,_0x227046){_0x1a7e51=_0x1a7e51-0x0;var _0x5add9a=_0x797f[_0x1a7e51];return _0x5add9a;};'use strict';var _=require(_0xf797('0x0'));var util=require(_0xf797('0x1'));var logger=require(_0xf797('0x2'))(_0xf797('0x3'));var moment=require(_0xf797('0x4'));var BPromise=require(_0xf797('0x5'));var rp=require(_0xf797('0x6'));var fs=require('fs');var path=require(_0xf797('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf797('0x8'));module[_0xf797('0x9')]=function(_0x2c02b5,_0x3b7ad0){return _0x2c02b5[_0xf797('0xa')](_0xf797('0xb'),attributes,{'tableName':_0xf797('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 598876e..79ca921 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 _0xbe37=['../../config/environment','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x316000,_0x3de6f9){var _0x2ba22e=function(_0x5b0ad4){while(--_0x5b0ad4){_0x316000['push'](_0x316000['shift']());}};_0x2ba22e(++_0x3de6f9);}(_0xbe37,0xc7));var _0x7be3=function(_0xcfd3a7,_0x89e21){_0xcfd3a7=_0xcfd3a7-0x0;var _0x92d349=_0xbe37[_0xcfd3a7];return _0x92d349;};'use strict';var _=require('lodash');var util=require(_0x7be3('0x0'));var moment=require(_0x7be3('0x1'));var BPromise=require(_0x7be3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7be3('0x3'));var db=require(_0x7be3('0x4'))['db'];var utils=require(_0x7be3('0x5'));var logger=require(_0x7be3('0x6'))(_0x7be3('0x7'));var config=require(_0x7be3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7be3('0x9')][_0x7be3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a5dff,_0x583008,_0x488bad){return new BPromise(function(_0x2982dc,_0x3a6971){return client[_0x7be3('0xb')](_0x5a5dff,_0x488bad)[_0x7be3('0xc')](function(_0x2e4c36){logger['info'](_0x7be3('0xd'),_0x583008,_0x7be3('0xe'));logger['debug'](_0x7be3('0xf'),_0x583008,_0x7be3('0xe'),JSON[_0x7be3('0x10')](_0x2e4c36));if(_0x2e4c36[_0x7be3('0x11')]){if(_0x2e4c36[_0x7be3('0x11')][_0x7be3('0x12')]===0x1f4){logger['error'](_0x7be3('0xd'),_0x583008,_0x2e4c36['error'][_0x7be3('0x13')]);return _0x3a6971(_0x2e4c36['error'][_0x7be3('0x13')]);}logger[_0x7be3('0x11')](_0x7be3('0xd'),_0x583008,_0x2e4c36[_0x7be3('0x11')][_0x7be3('0x13')]);return _0x2982dc(_0x2e4c36[_0x7be3('0x11')][_0x7be3('0x13')]);}else{logger[_0x7be3('0x14')]('UserVoiceQueue,\x20%s,\x20%s',_0x583008,_0x7be3('0xe'));_0x2982dc(_0x2e4c36[_0x7be3('0x15')][_0x7be3('0x13')]);}})[_0x7be3('0x16')](function(_0x4235b3){logger[_0x7be3('0x11')](_0x7be3('0xd'),_0x583008,_0x4235b3);_0x3a6971(_0x4235b3);});});} \ No newline at end of file +var _0xc929=['util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash'];(function(_0x186bc2,_0x364f23){var _0x16b0e5=function(_0x474144){while(--_0x474144){_0x186bc2['push'](_0x186bc2['shift']());}};_0x16b0e5(++_0x364f23);}(_0xc929,0x1e3));var _0x9c92=function(_0xfb0cfa,_0x24d82c){_0xfb0cfa=_0xfb0cfa-0x0;var _0xac5cbe=_0xc929[_0xfb0cfa];return _0xac5cbe;};'use strict';var _=require(_0x9c92('0x0'));var util=require(_0x9c92('0x1'));var moment=require(_0x9c92('0x2'));var BPromise=require(_0x9c92('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9c92('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c92('0x5'));var logger=require('../../config/logger')(_0x9c92('0x6'));var config=require(_0x9c92('0x7'));var jayson=require(_0x9c92('0x8'));var client=jayson[_0x9c92('0x9')][_0x9c92('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34aeb5,_0x327163,_0xd954d2){return new BPromise(function(_0xecd015,_0x50c9ed){return client[_0x9c92('0xb')](_0x34aeb5,_0xd954d2)[_0x9c92('0xc')](function(_0x502113){logger[_0x9c92('0xd')](_0x9c92('0xe'),_0x327163,_0x9c92('0xf'));logger[_0x9c92('0x10')](_0x9c92('0x11'),_0x327163,'request\x20sent',JSON['stringify'](_0x502113));if(_0x502113['error']){if(_0x502113[_0x9c92('0x12')]['code']===0x1f4){logger[_0x9c92('0x12')](_0x9c92('0xe'),_0x327163,_0x502113[_0x9c92('0x12')][_0x9c92('0x13')]);return _0x50c9ed(_0x502113[_0x9c92('0x12')]['message']);}logger[_0x9c92('0x12')](_0x9c92('0xe'),_0x327163,_0x502113[_0x9c92('0x12')][_0x9c92('0x13')]);return _0xecd015(_0x502113[_0x9c92('0x12')]['message']);}else{logger[_0x9c92('0xd')](_0x9c92('0xe'),_0x327163,'request\x20sent');_0xecd015(_0x502113[_0x9c92('0x14')][_0x9c92('0x13')]);}})[_0x9c92('0x15')](function(_0x58c77c){logger[_0x9c92('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x327163,_0x58c77c);_0x50c9ed(_0x58c77c);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 2c253dc..80785d5 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 _0x44ff=['exports','util','path','connect-timeout','../../config/environment'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x44ff,0x1c3));var _0xf44f=function(_0x486271,_0x54803c){_0x486271=_0x486271-0x0;var _0xda6d33=_0x44ff[_0x486271];return _0xda6d33;};'use strict';var multer=require('multer');var util=require(_0xf44f('0x0'));var path=require(_0xf44f('0x1'));var timeout=require(_0xf44f('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf44f('0x3'));module[_0xf44f('0x4')]=router; \ No newline at end of file +var _0x9b09=['express','../../components/auth/service','../../config/environment','multer','util','connect-timeout'];(function(_0x960fed,_0x138865){var _0x2d2657=function(_0x4fa249){while(--_0x4fa249){_0x960fed['push'](_0x960fed['shift']());}};_0x2d2657(++_0x138865);}(_0x9b09,0x1ad));var _0x99b0=function(_0x69a451,_0x49fd37){_0x69a451=_0x69a451-0x0;var _0x3d6ef5=_0x9b09[_0x69a451];return _0x3d6ef5;};'use strict';var multer=require(_0x99b0('0x0'));var util=require(_0x99b0('0x1'));var path=require('path');var timeout=require(_0x99b0('0x2'));var express=require(_0x99b0('0x3'));var router=express['Router']();var auth=require(_0x99b0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x99b0('0x5'));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 5847b1d..3a18fe1 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 _0xbac3=['STRING','queue_interface','sequelize','INTEGER','Required\x20by\x20Asterisk'];(function(_0x4b4a5d,_0x60421f){var _0x54ac88=function(_0x57b53e){while(--_0x57b53e){_0x4b4a5d['push'](_0x4b4a5d['shift']());}};_0x54ac88(++_0x60421f);}(_0xbac3,0x70));var _0x3bac=function(_0x45f6e2,_0xe72d77){_0x45f6e2=_0x45f6e2-0x0;var _0x573b09=_0xbac3[_0x45f6e2];return _0x573b09;};'use strict';var Sequelize=require(_0x3bac('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x3bac('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x3bac('0x2')},'membername':{'type':Sequelize[_0x3bac('0x3')],'allowNull':![],'comment':_0x3bac('0x2')},'UserId':{'type':Sequelize[_0x3bac('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3bac('0x4'),'comment':_0x3bac('0x2')},'VoiceQueueId':{'type':Sequelize[_0x3bac('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x3bac('0x3')],'allowNull':![],'unique':_0x3bac('0x4'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x3bac('0x1')](0xb),'defaultValue':0x0,'comment':_0x3bac('0x2')},'paused':{'type':Sequelize[_0x3bac('0x1')](0xb),'defaultValue':0x0,'comment':_0x3bac('0x2')}}; \ No newline at end of file +var _0x0a6b=['sequelize','exports','Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface'];(function(_0x305fc8,_0x16e31e){var _0x427cea=function(_0x524995){while(--_0x524995){_0x305fc8['push'](_0x305fc8['shift']());}};_0x427cea(++_0x16e31e);}(_0x0a6b,0x9c));var _0xb0a6=function(_0x5384ae,_0x32e603){_0x5384ae=_0x5384ae-0x0;var _0x4bcf2d=_0x0a6b[_0x5384ae];return _0x4bcf2d;};'use strict';var Sequelize=require(_0xb0a6('0x0'));module[_0xb0a6('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xb0a6('0x2')},'membername':{'type':Sequelize[_0xb0a6('0x3')],'allowNull':![],'comment':_0xb0a6('0x2')},'UserId':{'type':Sequelize[_0xb0a6('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xb0a6('0x3')],'allowNull':![],'unique':_0xb0a6('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb0a6('0x5'),'comment':_0xb0a6('0x2')},'penalty':{'type':Sequelize[_0xb0a6('0x4')](0xb),'defaultValue':0x0,'comment':_0xb0a6('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xb0a6('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 66f0cbb..606078e 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 _0xb10b=['hasOwnProperty','hook','events','UserVoiceQueueRt','setMaxListeners','save','remove','emit'];(function(_0x188bc2,_0x48d956){var _0x197d20=function(_0x38806d){while(--_0x38806d){_0x188bc2['push'](_0x188bc2['shift']());}};_0x197d20(++_0x48d956);}(_0xb10b,0x12a));var _0xbb10=function(_0x7ff9e4,_0x19e358){_0x7ff9e4=_0x7ff9e4-0x0;var _0x468415=_0xb10b[_0x7ff9e4];return _0x468415;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xbb10('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){UserVoiceQueueRtEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);UserVoiceQueueRtEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xda2d=['save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda2d,0x102));var _0xdda2=function(_0x2ca6a3,_0x12c895){_0x2ca6a3=_0x2ca6a3-0x0;var _0x4fd0c8=_0xda2d[_0x2ca6a3];return _0x4fd0c8;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xdda2('0x0'))['db'][_0xdda2('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xdda2('0x2')](0x0);var events={'afterCreate':_0xdda2('0x3'),'afterUpdate':_0xdda2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5ef049){return function(_0x5a5f9f,_0x357e97,_0x319129){UserVoiceQueueRtEvents[_0xdda2('0x5')](_0x5ef049+':'+_0x5a5f9f['id'],_0x5a5f9f);UserVoiceQueueRtEvents[_0xdda2('0x5')](_0x5ef049,_0x5a5f9f);_0x319129(null);};}for(var e in events){if(events[_0xdda2('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0xdda2('0x7')](e,emitEvent(event));}}module[_0xdda2('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 2d31927..4e8fe66 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 _0x0cf5=['api','moment','bluebird','request-promise','path','rimraf','./userVoiceQueueRt.attributes','exports','define','user_has_voice_queues_rt','lodash','../../config/logger'];(function(_0x19baae,_0x1e1c69){var _0x473c1c=function(_0x322380){while(--_0x322380){_0x19baae['push'](_0x19baae['shift']());}};_0x473c1c(++_0x1e1c69);}(_0x0cf5,0x1c6));var _0x50cf=function(_0x3a4931,_0x27f568){_0x3a4931=_0x3a4931-0x0;var _0x1fbc37=_0x0cf5[_0x3a4931];return _0x1fbc37;};'use strict';var _=require(_0x50cf('0x0'));var util=require('util');var logger=require(_0x50cf('0x1'))(_0x50cf('0x2'));var moment=require(_0x50cf('0x3'));var BPromise=require(_0x50cf('0x4'));var rp=require(_0x50cf('0x5'));var fs=require('fs');var path=require(_0x50cf('0x6'));var rimraf=require(_0x50cf('0x7'));var config=require('../../config/environment');var attributes=require(_0x50cf('0x8'));module[_0x50cf('0x9')]=function(_0x192b87,_0x35b607){return _0x192b87[_0x50cf('0xa')]('UserVoiceQueueRt',attributes,{'tableName':_0x50cf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe90f=['./userVoiceQueueRt.attributes','define','user_has_voice_queues_rt','lodash','util','api','moment','bluebird','path','../../config/environment'];(function(_0x1606b3,_0x435513){var _0x48c903=function(_0x64d52d){while(--_0x64d52d){_0x1606b3['push'](_0x1606b3['shift']());}};_0x48c903(++_0x435513);}(_0xe90f,0x189));var _0xfe90=function(_0x448a56,_0x3cd4d1){_0x448a56=_0x448a56-0x0;var _0x1ba466=_0xe90f[_0x448a56];return _0x1ba466;};'use strict';var _=require(_0xfe90('0x0'));var util=require(_0xfe90('0x1'));var logger=require('../../config/logger')(_0xfe90('0x2'));var moment=require(_0xfe90('0x3'));var BPromise=require(_0xfe90('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe90('0x5'));var rimraf=require('rimraf');var config=require(_0xfe90('0x6'));var attributes=require(_0xfe90('0x7'));module['exports']=function(_0x2f6e10,_0x51148b){return _0x2f6e10[_0xfe90('0x8')]('UserVoiceQueueRt',attributes,{'tableName':_0xfe90('0x9'),'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 2827b47..4c92a39 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 _0x5596=['code','message','result','catch','GetVoiceQueueRtPauses','options','where','sequelize','COUNT','literal','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./userVoiceQueueRt.socket','register','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5596,0x180));var _0x6559=function(_0x53c2b8,_0x5b8037){_0x53c2b8=_0x53c2b8-0x0;var _0x37503f=_0x5596[_0x53c2b8];return _0x37503f;};'use strict';var _=require(_0x6559('0x0'));var util=require(_0x6559('0x1'));var moment=require(_0x6559('0x2'));var BPromise=require(_0x6559('0x3'));var rs=require(_0x6559('0x4'));var fs=require('fs');var Redis=require(_0x6559('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6559('0x6'));var logger=require(_0x6559('0x7'))(_0x6559('0x8'));var config=require(_0x6559('0x9'));var jayson=require(_0x6559('0xa'));var client=jayson[_0x6559('0xb')]['http']({'port':0x232a});config[_0x6559('0xc')]=_[_0x6559('0xd')](config[_0x6559('0xc')],{'host':_0x6559('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6559('0xc')]));require(_0x6559('0xf'))[_0x6559('0x10')](socket);function respondWithRpcPromise(_0x363f21,_0x22a518,_0x36d0f7){return new BPromise(function(_0x3c3e3c,_0x4e898d){return client['request'](_0x363f21,_0x36d0f7)['then'](function(_0x5e41d9){logger[_0x6559('0x11')](_0x6559('0x12'),_0x22a518,_0x6559('0x13'));logger[_0x6559('0x14')](_0x6559('0x15'),_0x22a518,_0x6559('0x13'),JSON[_0x6559('0x16')](_0x5e41d9));if(_0x5e41d9[_0x6559('0x17')]){if(_0x5e41d9['error'][_0x6559('0x18')]===0x1f4){logger[_0x6559('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x22a518,_0x5e41d9[_0x6559('0x17')][_0x6559('0x19')]);return _0x4e898d(_0x5e41d9['error'][_0x6559('0x19')]);}logger[_0x6559('0x17')](_0x6559('0x12'),_0x22a518,_0x5e41d9[_0x6559('0x17')][_0x6559('0x19')]);return _0x3c3e3c(_0x5e41d9['error'][_0x6559('0x19')]);}else{logger[_0x6559('0x11')](_0x6559('0x12'),_0x22a518,'request\x20sent');_0x3c3e3c(_0x5e41d9[_0x6559('0x1a')][_0x6559('0x19')]);}})[_0x6559('0x1b')](function(_0x23860b){logger[_0x6559('0x17')](_0x6559('0x12'),_0x22a518,_0x23860b);_0x4e898d(_0x23860b);});});}exports[_0x6559('0x1c')]=function(_0x45175f){var _0x53a196=this;return new Promise(function(_0x443e20,_0x462051){return db['UserVoiceQueueRt']['findAll']({'raw':_0x45175f[_0x6559('0x1d')]?_0x45175f[_0x6559('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x45175f['options']?_0x45175f[_0x6559('0x1d')][_0x6559('0x1e')]||null:null,'attributes':[[db[_0x6559('0x1f')]['fn'](_0x6559('0x20'),db['sequelize']['fn']('IF',db[_0x6559('0x1f')][_0x6559('0x21')]('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})['then'](function(_0xa79df6){logger[_0x6559('0x11')](_0x6559('0x1c'),_0x45175f);logger['debug'](_0x6559('0x1c'),_0x45175f,JSON[_0x6559('0x16')](_0xa79df6));_0x443e20(_0xa79df6);})[_0x6559('0x1b')](function(_0x356afb){logger[_0x6559('0x17')]('GetVoiceQueueRtPauses',_0x356afb[_0x6559('0x19')],_0x45175f);_0x462051(_0x53a196['error'](0x1f4,_0x356afb[_0x6559('0x19')]));});});}; \ No newline at end of file +var _0x301f=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UserVoiceQueueRt','findAll','options','raw','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','GetVoiceQueueRtPauses','lodash'];(function(_0x193c09,_0x122f14){var _0x30c745=function(_0x2816bd){while(--_0x2816bd){_0x193c09['push'](_0x193c09['shift']());}};_0x30c745(++_0x122f14);}(_0x301f,0xb8));var _0xf301=function(_0x1aa6ab,_0x5c8bcb){_0x1aa6ab=_0x1aa6ab-0x0;var _0xcca6b6=_0x301f[_0x1aa6ab];return _0xcca6b6;};'use strict';var _=require(_0xf301('0x0'));var util=require(_0xf301('0x1'));var moment=require(_0xf301('0x2'));var BPromise=require(_0xf301('0x3'));var rs=require(_0xf301('0x4'));var fs=require('fs');var Redis=require(_0xf301('0x5'));var db=require(_0xf301('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf301('0x7'));var config=require(_0xf301('0x8'));var jayson=require(_0xf301('0x9'));var client=jayson[_0xf301('0xa')][_0xf301('0xb')]({'port':0x232a});config[_0xf301('0xc')]=_[_0xf301('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf301('0xe'))(new Redis(config[_0xf301('0xc')]));require(_0xf301('0xf'))['register'](socket);function respondWithRpcPromise(_0x2a68a6,_0x504190,_0x2ef07c){return new BPromise(function(_0x55cefd,_0x589045){return client['request'](_0x2a68a6,_0x2ef07c)[_0xf301('0x10')](function(_0x4e76b1){logger[_0xf301('0x11')](_0xf301('0x12'),_0x504190,_0xf301('0x13'));logger[_0xf301('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x504190,_0xf301('0x13'),JSON[_0xf301('0x15')](_0x4e76b1));if(_0x4e76b1[_0xf301('0x16')]){if(_0x4e76b1[_0xf301('0x16')][_0xf301('0x17')]===0x1f4){logger['error'](_0xf301('0x12'),_0x504190,_0x4e76b1['error'][_0xf301('0x18')]);return _0x589045(_0x4e76b1['error'][_0xf301('0x18')]);}logger[_0xf301('0x16')](_0xf301('0x12'),_0x504190,_0x4e76b1[_0xf301('0x16')][_0xf301('0x18')]);return _0x55cefd(_0x4e76b1['error']['message']);}else{logger['info'](_0xf301('0x12'),_0x504190,_0xf301('0x13'));_0x55cefd(_0x4e76b1[_0xf301('0x19')]['message']);}})[_0xf301('0x1a')](function(_0x20cb6c){logger[_0xf301('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x504190,_0x20cb6c);_0x589045(_0x20cb6c);});});}exports['GetVoiceQueueRtPauses']=function(_0x240a2d){var _0x2045aa=this;return new Promise(function(_0x2fba86,_0x16c61c){return db[_0xf301('0x1b')][_0xf301('0x1c')]({'raw':_0x240a2d[_0xf301('0x1d')]?_0x240a2d[_0xf301('0x1d')][_0xf301('0x1e')]===undefined?!![]:![]:!![],'where':_0x240a2d[_0xf301('0x1d')]?_0x240a2d['options'][_0xf301('0x1f')]||null:null,'attributes':[[db['sequelize']['fn'](_0xf301('0x20'),db[_0xf301('0x21')]['fn']('IF',db[_0xf301('0x21')][_0xf301('0x22')](_0xf301('0x23')))),'outboundQueuePauses']]})[_0xf301('0x10')](function(_0x41d48a){logger[_0xf301('0x11')](_0xf301('0x24'),_0x240a2d);logger[_0xf301('0x14')](_0xf301('0x24'),_0x240a2d,JSON[_0xf301('0x15')](_0x41d48a));_0x2fba86(_0x41d48a);})['catch'](function(_0x4fa3dd){logger[_0xf301('0x16')](_0xf301('0x24'),_0x4fa3dd[_0xf301('0x18')],_0x240a2d);_0x16c61c(_0x2045aa[_0xf301('0x16')](0x1f4,_0x4fa3dd[_0xf301('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 4c44ca5..a972431 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 _0xe015=['emit','removeListener','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove'];(function(_0x523d54,_0x31be64){var _0x1cb52e=function(_0x1d1e3c){while(--_0x1d1e3c){_0x523d54['push'](_0x523d54['shift']());}};_0x1cb52e(++_0x31be64);}(_0xe015,0x13b));var _0x5e01=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xe015[_0x2be8c2];return _0x97f531;};'use strict';var UserVoiceQueueRtEvents=require(_0x5e01('0x0'));var events=[_0x5e01('0x1'),_0x5e01('0x2'),'update'];function createListener(_0x51f689,_0x46ed0d){return function(_0x4e3569){_0x46ed0d[_0x5e01('0x3')](_0x51f689,_0x4e3569);};}function removeListener(_0x420f00,_0x7ce4b9){return function(){UserVoiceQueueRtEvents[_0x5e01('0x4')](_0x420f00,_0x7ce4b9);};}exports['register']=function(_0x1814cb){for(var _0x3d2da2=0x0,_0x4de678=events['length'];_0x3d2da2<_0x4de678;_0x3d2da2++){var _0x414f73=events[_0x3d2da2];var _0x3aeaef=createListener(_0x5e01('0x5')+_0x414f73,_0x1814cb);UserVoiceQueueRtEvents['on'](_0x414f73,_0x3aeaef);}}; \ No newline at end of file +var _0x3c6c=['update','emit','register','./userVoiceQueueRt.events','remove'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x51a4ff,_0x4c2fba){_0x51a4ff=_0x51a4ff-0x0;var _0x4f3b97=_0x3c6c[_0x51a4ff];return _0x4f3b97;};'use strict';var UserVoiceQueueRtEvents=require(_0xc3c6('0x0'));var events=['save',_0xc3c6('0x1'),_0xc3c6('0x2')];function createListener(_0x274dda,_0x3d2b3f){return function(_0x16a464){_0x3d2b3f[_0xc3c6('0x3')](_0x274dda,_0x16a464);};}function removeListener(_0x65a78,_0x34db2e){return function(){UserVoiceQueueRtEvents['removeListener'](_0x65a78,_0x34db2e);};}exports[_0xc3c6('0x4')]=function(_0x4a2ca1){for(var _0xe7731e=0x0,_0x4d7ae6=events['length'];_0xe7731e<_0x4d7ae6;_0xe7731e++){var _0x4aed87=events[_0xe7731e];var _0x5185c3=createListener('userVoiceQueueRt:'+_0x4aed87,_0x4a2ca1);UserVoiceQueueRtEvents['on'](_0x4aed87,_0x5185c3);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 5ab8d64..59ad6ec 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 _0x1be1=['get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x387a30,_0x35575d){var _0x4f2eb4=function(_0x294ad3){while(--_0x294ad3){_0x387a30['push'](_0x387a30['shift']());}};_0x4f2eb4(++_0x35575d);}(_0x1be1,0x192));var _0x11be=function(_0x35f6c1,_0x2d89b2){_0x35f6c1=_0x35f6c1-0x0;var _0x5c8268=_0x1be1[_0x35f6c1];return _0x5c8268;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x11be('0x0'));var timeout=require(_0x11be('0x1'));var express=require('express');var router=express[_0x11be('0x2')]();var auth=require(_0x11be('0x3'));var interaction=require(_0x11be('0x4'));var config=require(_0x11be('0x5'));var controller=require('./variable.controller');router[_0x11be('0x6')]('/',auth[_0x11be('0x7')](),controller[_0x11be('0x8')]);router['get'](_0x11be('0x9'),auth['isAuthenticated'](),controller[_0x11be('0xa')]);router[_0x11be('0xb')]('/',auth[_0x11be('0x7')](),controller[_0x11be('0xc')]);router[_0x11be('0xd')]('/:id',auth[_0x11be('0x7')](),controller[_0x11be('0xe')]);router['delete'](_0x11be('0x9'),auth[_0x11be('0x7')](),controller[_0x11be('0xf')]);module[_0x11be('0x10')]=router; \ No newline at end of file +var _0x55e0=['util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55e0,0xdc));var _0x055e=function(_0x4c2757,_0xee6578){_0x4c2757=_0x4c2757-0x0;var _0x2ce48e=_0x55e0[_0x4c2757];return _0x2ce48e;};'use strict';var multer=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var path=require(_0x055e('0x2'));var timeout=require(_0x055e('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x055e('0x4'));var interaction=require(_0x055e('0x5'));var config=require(_0x055e('0x6'));var controller=require(_0x055e('0x7'));router[_0x055e('0x8')]('/',auth[_0x055e('0x9')](),controller['index']);router['get'](_0x055e('0xa'),auth['isAuthenticated'](),controller[_0x055e('0xb')]);router[_0x055e('0xc')]('/',auth[_0x055e('0x9')](),controller[_0x055e('0xd')]);router[_0x055e('0xe')]('/:id',auth[_0x055e('0x9')](),controller[_0x055e('0xf')]);router[_0x055e('0x10')](_0x055e('0xa'),auth[_0x055e('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 670979e..9a34925 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 _0x266a=['sequelize','exports','STRING','name'];(function(_0x46ddc3,_0x4a4956){var _0x581094=function(_0x3c9706){while(--_0x3c9706){_0x46ddc3['push'](_0x46ddc3['shift']());}};_0x581094(++_0x4a4956);}(_0x266a,0x144));var _0xa266=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x266a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa266('0x0'));module[_0xa266('0x1')]={'name':{'type':Sequelize[_0xa266('0x2')],'unique':_0xa266('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa266('0x2')]}}; \ No newline at end of file +var _0xcea1=['name','exports','STRING'];(function(_0x3b0e89,_0x1660ef){var _0x352791=function(_0x1fc9ff){while(--_0x1fc9ff){_0x3b0e89['push'](_0x3b0e89['shift']());}};_0x352791(++_0x1660ef);}(_0xcea1,0x1b1));var _0x1cea=function(_0xf6dc14,_0x113164){_0xf6dc14=_0xf6dc14-0x0;var _0x2643c0=_0xcea1[_0xf6dc14];return _0x2643c0;};'use strict';var Sequelize=require('sequelize');module[_0x1cea('0x0')]={'name':{'type':Sequelize[_0x1cea('0x1')],'unique':_0x1cea('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1cea('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index a3d0e60..0032701 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 _0xbd8d=['send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','map','type','key','VIRTUAL','field','merge','options','Variable','findAll','rows','catch','params','includeAll','include','find','create','body','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','mustache','sox','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','get','Variables','UserProfileResource','error','stack','name'];(function(_0x13a663,_0x3c447e){var _0x55b2b9=function(_0x409753){while(--_0x409753){_0x13a663['push'](_0x13a663['shift']());}};_0x55b2b9(++_0x3c447e);}(_0xbd8d,0x71));var _0xdbd8=function(_0x351767,_0x22d043){_0x351767=_0x351767-0x0;var _0x45969d=_0xbd8d[_0x351767];return _0x45969d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdbd8('0x0'));var rimraf=require(_0xdbd8('0x1'));var zipdir=require(_0xdbd8('0x2'));var jsonpatch=require(_0xdbd8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdbd8('0x4'));var util=require('util');var path=require('path');var sox=require(_0xdbd8('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xdbd8('0x6'));var squel=require(_0xdbd8('0x7'));var crypto=require(_0xdbd8('0x8'));var jsforce=require(_0xdbd8('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xdbd8('0xa'));var querystring=require(_0xdbd8('0xb'));var Papa=require('papaparse');var Redis=require(_0xdbd8('0xc'));var authService=require(_0xdbd8('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xdbd8('0xe'));var logger=require(_0xdbd8('0xf'))(_0xdbd8('0x10'));var utils=require(_0xdbd8('0x11'));var config=require(_0xdbd8('0x12'));var db=require(_0xdbd8('0x13'))['db'];function respondWithStatusCode(_0x1d3ee0,_0x9649f2){_0x9649f2=_0x9649f2||0xcc;return function(_0x481f18){if(_0x481f18){return _0x1d3ee0[_0xdbd8('0x14')](_0x9649f2);}return _0x1d3ee0['status'](_0x9649f2)[_0xdbd8('0x15')]();};}function respondWithResult(_0x411643,_0x55dc23){_0x55dc23=_0x55dc23||0xc8;return function(_0x14d10b){if(_0x14d10b){return _0x411643[_0xdbd8('0x16')](_0x55dc23)[_0xdbd8('0x17')](_0x14d10b);}};}function respondWithFilteredResult(_0x269cc4,_0x366f0c){return function(_0x1a9d98){if(_0x1a9d98){var _0x278d2b=_0x1a9d98[_0xdbd8('0x18')],_0x17e5d5=_0x366f0c[_0xdbd8('0x19')],_0x2188fd=_0x366f0c[_0xdbd8('0x19')]+_0x366f0c[_0xdbd8('0x1a')],_0x5146c7;if(_0x2188fd>=_0x278d2b){_0x2188fd=_0x278d2b;_0x5146c7=0xc8;}else{_0x5146c7=0xce;}_0x269cc4[_0xdbd8('0x16')](_0x5146c7);return _0x269cc4[_0xdbd8('0x1b')](_0xdbd8('0x1c'),_0x17e5d5+'-'+_0x2188fd+'/'+_0x278d2b)[_0xdbd8('0x17')](_0x1a9d98);}return null;};}function patchUpdates(_0x53e72b){return function(_0xd6fb86){try{jsonpatch['apply'](_0xd6fb86,_0x53e72b,!![]);}catch(_0x56295f){return BPromise[_0xdbd8('0x1d')](_0x56295f);}return _0xd6fb86[_0xdbd8('0x1e')]();};}function saveUpdates(_0x4447a3,_0x4cc68c){return function(_0x2f13f2){if(_0x2f13f2){return _0x2f13f2['update'](_0x4447a3)[_0xdbd8('0x1f')](function(_0x2b0b2f){return _0x2b0b2f;});}return null;};}function removeEntity(_0x5f0f64,_0x7d94d6){return function(_0x4bf8d6){if(_0x4bf8d6){return _0x4bf8d6[_0xdbd8('0x20')]()[_0xdbd8('0x1f')](function(){var _0x40567d=_0x4bf8d6[_0xdbd8('0x21')]({'plain':!![]});var _0x3719c7=_0xdbd8('0x22');return db[_0xdbd8('0x23')][_0xdbd8('0x20')]({'where':{'type':_0x3719c7,'resourceId':_0x40567d['id']}})[_0xdbd8('0x1f')](function(){return _0x4bf8d6;});})[_0xdbd8('0x1f')](function(){_0x5f0f64[_0xdbd8('0x16')](0xcc)[_0xdbd8('0x15')]();});}};}function handleEntityNotFound(_0x10be39,_0x5897ec){return function(_0x17e0f2){if(!_0x17e0f2){_0x10be39[_0xdbd8('0x14')](0x194);}return _0x17e0f2;};}function handleError(_0x1785a8,_0x429b10){_0x429b10=_0x429b10||0x1f4;return function(_0x555394){logger[_0xdbd8('0x24')](_0x555394[_0xdbd8('0x25')]);if(_0x555394[_0xdbd8('0x26')]){delete _0x555394['name'];}_0x1785a8[_0xdbd8('0x16')](_0x429b10)[_0xdbd8('0x27')](_0x555394);};}exports[_0xdbd8('0x28')]=function(_0x1eba55,_0x2c855a){var _0x55c9f5={},_0x273403={},_0x112694={'count':0x0,'rows':[]};var _0x47153b=db['Variable'][_0xdbd8('0x29')];_0x273403[_0xdbd8('0x2a')]=_[_0xdbd8('0x2b')](_0x47153b);_0x273403[_0xdbd8('0x2c')]=_[_0xdbd8('0x2b')](_0x1eba55[_0xdbd8('0x2c')]);_0x273403[_0xdbd8('0x2d')]=_[_0xdbd8('0x2e')](_0x273403[_0xdbd8('0x2a')],_0x273403[_0xdbd8('0x2c')]);_0x55c9f5[_0xdbd8('0x2f')]=_[_0xdbd8('0x2e')](_0x273403['model'],qs[_0xdbd8('0x30')](_0x1eba55[_0xdbd8('0x2c')]['fields']));_0x55c9f5[_0xdbd8('0x2f')]=_0x55c9f5[_0xdbd8('0x2f')][_0xdbd8('0x31')]?_0x55c9f5['attributes']:_0x273403['model'];if(!_0x1eba55[_0xdbd8('0x2c')][_0xdbd8('0x32')](_0xdbd8('0x33'))){_0x55c9f5[_0xdbd8('0x1a')]=qs[_0xdbd8('0x1a')](_0x1eba55[_0xdbd8('0x2c')]['limit']);_0x55c9f5[_0xdbd8('0x19')]=qs[_0xdbd8('0x19')](_0x1eba55[_0xdbd8('0x2c')]['offset']);}_0x55c9f5['order']=qs[_0xdbd8('0x34')](_0x1eba55[_0xdbd8('0x2c')]['sort']);_0x55c9f5[_0xdbd8('0x35')]=qs[_0xdbd8('0x2d')](_['pick'](_0x1eba55[_0xdbd8('0x2c')],_0x273403[_0xdbd8('0x2d')]));if(_0x1eba55[_0xdbd8('0x2c')][_0xdbd8('0x36')]){_0x55c9f5['where']=_['merge'](_0x55c9f5[_0xdbd8('0x35')],{'$or':_[_0xdbd8('0x37')](_0x47153b,function(_0xde568){if(_0xde568[_0xdbd8('0x38')][_0xdbd8('0x39')]!==_0xdbd8('0x3a')){var _0x58df8c={};_0x58df8c[_0xde568[_0xdbd8('0x3b')]]={'$like':'%'+_0x1eba55['query'][_0xdbd8('0x36')]+'%'};return _0x58df8c;}})});}_0x55c9f5=_[_0xdbd8('0x3c')]({},_0x55c9f5,_0x1eba55[_0xdbd8('0x3d')]);var _0xcde76e={'where':_0x55c9f5[_0xdbd8('0x35')]};return db[_0xdbd8('0x3e')]['count'](_0xcde76e)['then'](function(_0x544227){_0x112694[_0xdbd8('0x18')]=_0x544227;if(_0x1eba55[_0xdbd8('0x2c')]['includeAll']){_0x55c9f5['include']=[{'all':!![]}];}return db[_0xdbd8('0x3e')][_0xdbd8('0x3f')](_0x55c9f5);})[_0xdbd8('0x1f')](function(_0x3866e4){_0x112694[_0xdbd8('0x40')]=_0x3866e4;return _0x112694;})['then'](respondWithFilteredResult(_0x2c855a,_0x55c9f5))[_0xdbd8('0x41')](handleError(_0x2c855a,null));};exports['show']=function(_0x2fefec,_0x15dcce){var _0x11c945={'raw':!![],'where':{'id':_0x2fefec[_0xdbd8('0x42')]['id']}},_0x4a1ba9={};_0x4a1ba9[_0xdbd8('0x2a')]=_[_0xdbd8('0x2b')](db['Variable'][_0xdbd8('0x29')]);_0x4a1ba9['query']=_[_0xdbd8('0x2b')](_0x2fefec[_0xdbd8('0x2c')]);_0x4a1ba9[_0xdbd8('0x2d')]=_[_0xdbd8('0x2e')](_0x4a1ba9[_0xdbd8('0x2a')],_0x4a1ba9[_0xdbd8('0x2c')]);_0x11c945[_0xdbd8('0x2f')]=_['intersection'](_0x4a1ba9[_0xdbd8('0x2a')],qs[_0xdbd8('0x30')](_0x2fefec[_0xdbd8('0x2c')]['fields']));_0x11c945[_0xdbd8('0x2f')]=_0x11c945[_0xdbd8('0x2f')]['length']?_0x11c945['attributes']:_0x4a1ba9['model'];if(_0x2fefec[_0xdbd8('0x2c')][_0xdbd8('0x43')]){_0x11c945[_0xdbd8('0x44')]=[{'all':!![]}];}_0x11c945=_[_0xdbd8('0x3c')]({},_0x11c945,_0x2fefec[_0xdbd8('0x3d')]);return db['Variable'][_0xdbd8('0x45')](_0x11c945)[_0xdbd8('0x1f')](handleEntityNotFound(_0x15dcce,null))[_0xdbd8('0x1f')](respondWithResult(_0x15dcce,null))[_0xdbd8('0x41')](handleError(_0x15dcce,null));};exports[_0xdbd8('0x46')]=function(_0x1ecbdc,_0x3ea9db){return db[_0xdbd8('0x3e')]['create'](_0x1ecbdc[_0xdbd8('0x47')],{})[_0xdbd8('0x1f')](function(_0x33fbe9){var _0x7ab279=_0x1ecbdc['user'][_0xdbd8('0x21')]({'plain':!![]});if(!_0x7ab279)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7ab279['role']===_0xdbd8('0x48')){var _0x3fa652=_0x33fbe9[_0xdbd8('0x21')]({'plain':!![]});var _0x1285a4=_0xdbd8('0x22');return db[_0xdbd8('0x49')][_0xdbd8('0x45')]({'where':{'name':_0x1285a4,'userProfileId':_0x7ab279['userProfileId']},'raw':!![]})[_0xdbd8('0x1f')](function(_0x2e1e83){if(_0x2e1e83&&_0x2e1e83['autoAssociation']===0x0){return db[_0xdbd8('0x23')]['create']({'name':_0x3fa652[_0xdbd8('0x26')],'resourceId':_0x3fa652['id'],'type':_0x2e1e83[_0xdbd8('0x26')],'sectionId':_0x2e1e83['id']},{})[_0xdbd8('0x1f')](function(){return _0x33fbe9;});}else{return _0x33fbe9;}})[_0xdbd8('0x41')](function(_0x54a9ed){logger['error'](_0xdbd8('0x4a'),_0x54a9ed);throw _0x54a9ed;});}return _0x33fbe9;})[_0xdbd8('0x1f')](respondWithResult(_0x3ea9db,0xc9))['catch'](handleError(_0x3ea9db,null));};exports[_0xdbd8('0x4b')]=function(_0x23a40c,_0x31c99b){if(_0x23a40c[_0xdbd8('0x47')]['id']){delete _0x23a40c[_0xdbd8('0x47')]['id'];}return db[_0xdbd8('0x3e')][_0xdbd8('0x45')]({'where':{'id':_0x23a40c[_0xdbd8('0x42')]['id']}})['then'](handleEntityNotFound(_0x31c99b,null))[_0xdbd8('0x1f')](saveUpdates(_0x23a40c[_0xdbd8('0x47')],null))[_0xdbd8('0x1f')](respondWithResult(_0x31c99b,null))['catch'](handleError(_0x31c99b,null));};exports['destroy']=function(_0x13f2ba,_0x3f1562){return db[_0xdbd8('0x3e')][_0xdbd8('0x45')]({'where':{'id':_0x13f2ba[_0xdbd8('0x42')]['id']}})['then'](handleEntityNotFound(_0x3f1562,null))[_0xdbd8('0x1f')](removeEntity(_0x3f1562,null))[_0xdbd8('0x41')](handleError(_0x3f1562,null));}; \ No newline at end of file +var _0x5973=['pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','params','keys','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','to-csv','ejs','lodash','squel','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','set','json','apply','save','update','then','Variables','destroy','error','stack','name','index','Variable','rawAttributes','model','query','filters','intersection','fields','attributes','length','nolimit','sort','where'];(function(_0x3747ae,_0x408e61){var _0x339035=function(_0x83be87){while(--_0x83be87){_0x3747ae['push'](_0x3747ae['shift']());}};_0x339035(++_0x408e61);}(_0x5973,0x14c));var _0x3597=function(_0x42e75c,_0x136223){_0x42e75c=_0x42e75c-0x0;var _0x42b0b8=_0x5973[_0x42e75c];return _0x42b0b8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3597('0x0'));var rimraf=require(_0x3597('0x1'));var zipdir=require(_0x3597('0x2'));var jsonpatch=require(_0x3597('0x3'));var rp=require(_0x3597('0x4'));var moment=require('moment');var BPromise=require(_0x3597('0x5'));var Mustache=require(_0x3597('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3597('0x7'));var ejs=require(_0x3597('0x8'));var fs=require('fs');var _=require(_0x3597('0x9'));var squel=require(_0x3597('0xa'));var crypto=require('crypto');var jsforce=require(_0x3597('0xb'));var deskjs=require(_0x3597('0xc'));var toCsv=require(_0x3597('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3597('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x3597('0xe'));var logger=require(_0x3597('0xf'))(_0x3597('0x10'));var utils=require(_0x3597('0x11'));var config=require('../../config/environment');var db=require(_0x3597('0x12'))['db'];function respondWithStatusCode(_0xb00b90,_0x4ca7e9){_0x4ca7e9=_0x4ca7e9||0xcc;return function(_0x5cadb1){if(_0x5cadb1){return _0xb00b90[_0x3597('0x13')](_0x4ca7e9);}return _0xb00b90[_0x3597('0x14')](_0x4ca7e9)[_0x3597('0x15')]();};}function respondWithResult(_0x529bee,_0x4ec20d){_0x4ec20d=_0x4ec20d||0xc8;return function(_0x5495ab){if(_0x5495ab){return _0x529bee[_0x3597('0x14')](_0x4ec20d)['json'](_0x5495ab);}};}function respondWithFilteredResult(_0x47972f,_0x6cfa0d){return function(_0x2c264a){if(_0x2c264a){var _0x12a60a=_0x2c264a['count'],_0x482aa9=_0x6cfa0d['offset'],_0x13efea=_0x6cfa0d[_0x3597('0x16')]+_0x6cfa0d[_0x3597('0x17')],_0x44d3f2;if(_0x13efea>=_0x12a60a){_0x13efea=_0x12a60a;_0x44d3f2=0xc8;}else{_0x44d3f2=0xce;}_0x47972f[_0x3597('0x14')](_0x44d3f2);return _0x47972f[_0x3597('0x18')]('Content-Range',_0x482aa9+'-'+_0x13efea+'/'+_0x12a60a)[_0x3597('0x19')](_0x2c264a);}return null;};}function patchUpdates(_0x3a3bd1){return function(_0x18f22e){try{jsonpatch[_0x3597('0x1a')](_0x18f22e,_0x3a3bd1,!![]);}catch(_0x5e6366){return BPromise['reject'](_0x5e6366);}return _0x18f22e[_0x3597('0x1b')]();};}function saveUpdates(_0x2725a9,_0x27b67f){return function(_0x4f3778){if(_0x4f3778){return _0x4f3778[_0x3597('0x1c')](_0x2725a9)[_0x3597('0x1d')](function(_0x47df7a){return _0x47df7a;});}return null;};}function removeEntity(_0x580b58,_0x35e7ce){return function(_0x5c22cf){if(_0x5c22cf){return _0x5c22cf['destroy']()[_0x3597('0x1d')](function(){var _0x3837a9=_0x5c22cf['get']({'plain':!![]});var _0x1de460=_0x3597('0x1e');return db['UserProfileResource'][_0x3597('0x1f')]({'where':{'type':_0x1de460,'resourceId':_0x3837a9['id']}})[_0x3597('0x1d')](function(){return _0x5c22cf;});})[_0x3597('0x1d')](function(){_0x580b58[_0x3597('0x14')](0xcc)[_0x3597('0x15')]();});}};}function handleEntityNotFound(_0x5d6f7a,_0x5af21c){return function(_0x476ddf){if(!_0x476ddf){_0x5d6f7a[_0x3597('0x13')](0x194);}return _0x476ddf;};}function handleError(_0x5933eb,_0x2e058d){_0x2e058d=_0x2e058d||0x1f4;return function(_0x482e82){logger[_0x3597('0x20')](_0x482e82[_0x3597('0x21')]);if(_0x482e82[_0x3597('0x22')]){delete _0x482e82[_0x3597('0x22')];}_0x5933eb['status'](_0x2e058d)['send'](_0x482e82);};}exports[_0x3597('0x23')]=function(_0x128b18,_0x3954b3){var _0x278a8f={},_0x53458e={},_0x3c52d7={'count':0x0,'rows':[]};var _0x82d2bb=db[_0x3597('0x24')][_0x3597('0x25')];_0x53458e[_0x3597('0x26')]=_['keys'](_0x82d2bb);_0x53458e[_0x3597('0x27')]=_['keys'](_0x128b18[_0x3597('0x27')]);_0x53458e[_0x3597('0x28')]=_[_0x3597('0x29')](_0x53458e['model'],_0x53458e['query']);_0x278a8f['attributes']=_['intersection'](_0x53458e[_0x3597('0x26')],qs[_0x3597('0x2a')](_0x128b18['query'][_0x3597('0x2a')]));_0x278a8f[_0x3597('0x2b')]=_0x278a8f['attributes'][_0x3597('0x2c')]?_0x278a8f[_0x3597('0x2b')]:_0x53458e['model'];if(!_0x128b18[_0x3597('0x27')]['hasOwnProperty'](_0x3597('0x2d'))){_0x278a8f[_0x3597('0x17')]=qs['limit'](_0x128b18[_0x3597('0x27')][_0x3597('0x17')]);_0x278a8f[_0x3597('0x16')]=qs[_0x3597('0x16')](_0x128b18[_0x3597('0x27')][_0x3597('0x16')]);}_0x278a8f['order']=qs[_0x3597('0x2e')](_0x128b18[_0x3597('0x27')][_0x3597('0x2e')]);_0x278a8f[_0x3597('0x2f')]=qs[_0x3597('0x28')](_[_0x3597('0x30')](_0x128b18[_0x3597('0x27')],_0x53458e[_0x3597('0x28')]));if(_0x128b18[_0x3597('0x27')][_0x3597('0x31')]){_0x278a8f[_0x3597('0x2f')]=_[_0x3597('0x32')](_0x278a8f[_0x3597('0x2f')],{'$or':_[_0x3597('0x33')](_0x82d2bb,function(_0x7ccd85){if(_0x7ccd85[_0x3597('0x34')][_0x3597('0x35')]!==_0x3597('0x36')){var _0x2c7165={};_0x2c7165[_0x7ccd85[_0x3597('0x37')]]={'$like':'%'+_0x128b18['query'][_0x3597('0x31')]+'%'};return _0x2c7165;}})});}_0x278a8f=_[_0x3597('0x32')]({},_0x278a8f,_0x128b18[_0x3597('0x38')]);var _0x3ea8b4={'where':_0x278a8f[_0x3597('0x2f')]};return db[_0x3597('0x24')]['count'](_0x3ea8b4)[_0x3597('0x1d')](function(_0x5bb887){_0x3c52d7[_0x3597('0x39')]=_0x5bb887;if(_0x128b18[_0x3597('0x27')][_0x3597('0x3a')]){_0x278a8f[_0x3597('0x3b')]=[{'all':!![]}];}return db[_0x3597('0x24')][_0x3597('0x3c')](_0x278a8f);})['then'](function(_0x559030){_0x3c52d7[_0x3597('0x3d')]=_0x559030;return _0x3c52d7;})['then'](respondWithFilteredResult(_0x3954b3,_0x278a8f))[_0x3597('0x3e')](handleError(_0x3954b3,null));};exports['show']=function(_0x44c671,_0x12af4e){var _0x39f02e={'raw':!![],'where':{'id':_0x44c671[_0x3597('0x3f')]['id']}},_0x33cea0={};_0x33cea0[_0x3597('0x26')]=_[_0x3597('0x40')](db[_0x3597('0x24')]['rawAttributes']);_0x33cea0[_0x3597('0x27')]=_[_0x3597('0x40')](_0x44c671[_0x3597('0x27')]);_0x33cea0['filters']=_[_0x3597('0x29')](_0x33cea0['model'],_0x33cea0['query']);_0x39f02e[_0x3597('0x2b')]=_['intersection'](_0x33cea0[_0x3597('0x26')],qs[_0x3597('0x2a')](_0x44c671[_0x3597('0x27')][_0x3597('0x2a')]));_0x39f02e[_0x3597('0x2b')]=_0x39f02e['attributes'][_0x3597('0x2c')]?_0x39f02e[_0x3597('0x2b')]:_0x33cea0[_0x3597('0x26')];if(_0x44c671[_0x3597('0x27')][_0x3597('0x3a')]){_0x39f02e[_0x3597('0x3b')]=[{'all':!![]}];}_0x39f02e=_[_0x3597('0x32')]({},_0x39f02e,_0x44c671[_0x3597('0x38')]);return db['Variable']['find'](_0x39f02e)[_0x3597('0x1d')](handleEntityNotFound(_0x12af4e,null))[_0x3597('0x1d')](respondWithResult(_0x12af4e,null))[_0x3597('0x3e')](handleError(_0x12af4e,null));};exports[_0x3597('0x41')]=function(_0x520f80,_0x254548){return db['Variable'][_0x3597('0x41')](_0x520f80[_0x3597('0x42')],{})[_0x3597('0x1d')](function(_0x55d68f){var _0x3ddacb=_0x520f80[_0x3597('0x43')][_0x3597('0x44')]({'plain':!![]});if(!_0x3ddacb)throw new Error(_0x3597('0x45'));if(_0x3ddacb[_0x3597('0x46')]===_0x3597('0x43')){var _0xe97ca4=_0x55d68f[_0x3597('0x44')]({'plain':!![]});var _0x3ae1d4=_0x3597('0x1e');return db[_0x3597('0x47')][_0x3597('0x48')]({'where':{'name':_0x3ae1d4,'userProfileId':_0x3ddacb[_0x3597('0x49')]},'raw':!![]})[_0x3597('0x1d')](function(_0x52cad8){if(_0x52cad8&&_0x52cad8[_0x3597('0x4a')]===0x0){return db[_0x3597('0x4b')]['create']({'name':_0xe97ca4[_0x3597('0x22')],'resourceId':_0xe97ca4['id'],'type':_0x52cad8['name'],'sectionId':_0x52cad8['id']},{})[_0x3597('0x1d')](function(){return _0x55d68f;});}else{return _0x55d68f;}})['catch'](function(_0x2991fa){logger[_0x3597('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2991fa);throw _0x2991fa;});}return _0x55d68f;})[_0x3597('0x1d')](respondWithResult(_0x254548,0xc9))[_0x3597('0x3e')](handleError(_0x254548,null));};exports['update']=function(_0x15eb77,_0x9d6cd2){if(_0x15eb77[_0x3597('0x42')]['id']){delete _0x15eb77[_0x3597('0x42')]['id'];}return db[_0x3597('0x24')][_0x3597('0x48')]({'where':{'id':_0x15eb77[_0x3597('0x3f')]['id']}})['then'](handleEntityNotFound(_0x9d6cd2,null))[_0x3597('0x1d')](saveUpdates(_0x15eb77[_0x3597('0x42')],null))[_0x3597('0x1d')](respondWithResult(_0x9d6cd2,null))[_0x3597('0x3e')](handleError(_0x9d6cd2,null));};exports['destroy']=function(_0x6d1979,_0x12653b){return db['Variable']['find']({'where':{'id':_0x6d1979[_0x3597('0x3f')]['id']}})[_0x3597('0x1d')](handleEntityNotFound(_0x12653b,null))[_0x3597('0x1d')](removeEntity(_0x12653b,null))[_0x3597('0x3e')](handleError(_0x12653b,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 0a7c5b7..2280d29 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 _0xf567=['rimraf','../../config/environment','./variable.attributes','define','tools_variables','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x1cfd42,_0x3b2c5f){var _0x39002c=function(_0x35fc22){while(--_0x35fc22){_0x1cfd42['push'](_0x1cfd42['shift']());}};_0x39002c(++_0x3b2c5f);}(_0xf567,0x118));var _0x7f56=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf567[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x7f56('0x0'));var util=require(_0x7f56('0x1'));var logger=require(_0x7f56('0x2'))('api');var moment=require(_0x7f56('0x3'));var BPromise=require(_0x7f56('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f56('0x5'));var rimraf=require(_0x7f56('0x6'));var config=require(_0x7f56('0x7'));var attributes=require(_0x7f56('0x8'));module['exports']=function(_0x444b66,_0x215ff1){return _0x444b66[_0x7f56('0x9')]('Variable',attributes,{'tableName':_0x7f56('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71ab=['exports','define','Variable','tools_variables','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes'];(function(_0x2d07f0,_0x2a7a8b){var _0xff865a=function(_0x1b6199){while(--_0x1b6199){_0x2d07f0['push'](_0x2d07f0['shift']());}};_0xff865a(++_0x2a7a8b);}(_0x71ab,0x64));var _0xb71a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x71ab[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));module[_0xb71a('0x8')]=function(_0x38d931,_0x22c072){return _0x38d931[_0xb71a('0x9')](_0xb71a('0xa'),attributes,{'tableName':_0xb71a('0xb'),'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 656eadf..d094213 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 _0xecd1=['message','result','catch','Variable','find','raw','options','where','include','map','model','attributes','ShowVariable','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','Variable,\x20%s,\x20%s'];(function(_0x1a21e7,_0x529f2c){var _0x3e5d4b=function(_0x6a9de5){while(--_0x6a9de5){_0x1a21e7['push'](_0x1a21e7['shift']());}};_0x3e5d4b(++_0x529f2c);}(_0xecd1,0x1e9));var _0x1ecd=function(_0x1b8b0d,_0x2fa81a){_0x1b8b0d=_0x1b8b0d-0x0;var _0x540f8b=_0xecd1[_0x1b8b0d];return _0x540f8b;};'use strict';var _=require(_0x1ecd('0x0'));var util=require(_0x1ecd('0x1'));var moment=require('moment');var BPromise=require(_0x1ecd('0x2'));var rs=require(_0x1ecd('0x3'));var fs=require('fs');var Redis=require(_0x1ecd('0x4'));var db=require(_0x1ecd('0x5'))['db'];var utils=require(_0x1ecd('0x6'));var logger=require(_0x1ecd('0x7'))(_0x1ecd('0x8'));var config=require('../../config/environment');var jayson=require(_0x1ecd('0x9'));var client=jayson[_0x1ecd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f05c0,_0x15f2d7,_0x548a5b){return new BPromise(function(_0x25d413,_0x54816a){return client[_0x1ecd('0xb')](_0x1f05c0,_0x548a5b)[_0x1ecd('0xc')](function(_0x1b4f52){logger[_0x1ecd('0xd')]('Variable,\x20%s,\x20%s',_0x15f2d7,_0x1ecd('0xe'));logger[_0x1ecd('0xf')](_0x1ecd('0x10'),_0x15f2d7,_0x1ecd('0xe'),JSON[_0x1ecd('0x11')](_0x1b4f52));if(_0x1b4f52[_0x1ecd('0x12')]){if(_0x1b4f52[_0x1ecd('0x12')][_0x1ecd('0x13')]===0x1f4){logger[_0x1ecd('0x12')](_0x1ecd('0x14'),_0x15f2d7,_0x1b4f52['error'][_0x1ecd('0x15')]);return _0x54816a(_0x1b4f52[_0x1ecd('0x12')]['message']);}logger[_0x1ecd('0x12')]('Variable,\x20%s,\x20%s',_0x15f2d7,_0x1b4f52[_0x1ecd('0x12')][_0x1ecd('0x15')]);return _0x25d413(_0x1b4f52[_0x1ecd('0x12')][_0x1ecd('0x15')]);}else{logger['info'](_0x1ecd('0x14'),_0x15f2d7,'request\x20sent');_0x25d413(_0x1b4f52[_0x1ecd('0x16')][_0x1ecd('0x15')]);}})[_0x1ecd('0x17')](function(_0x2d0af1){logger[_0x1ecd('0x12')]('Variable,\x20%s,\x20%s',_0x15f2d7,_0x2d0af1);_0x54816a(_0x2d0af1);});});}exports['ShowVariable']=function(_0x599cf9){var _0x1e1ba5=this;return new Promise(function(_0x1e13af,_0x18036a){return db[_0x1ecd('0x18')][_0x1ecd('0x19')]({'raw':_0x599cf9['options']?_0x599cf9['options'][_0x1ecd('0x1a')]===undefined?!![]:![]:!![],'where':_0x599cf9[_0x1ecd('0x1b')]?_0x599cf9[_0x1ecd('0x1b')][_0x1ecd('0x1c')]||null:null,'attributes':_0x599cf9['options']?_0x599cf9[_0x1ecd('0x1b')]['attributes']||null:null,'include':_0x599cf9[_0x1ecd('0x1b')]?_0x599cf9[_0x1ecd('0x1b')][_0x1ecd('0x1d')]?_[_0x1ecd('0x1e')](_0x599cf9[_0x1ecd('0x1b')][_0x1ecd('0x1d')],function(_0x319b00){return{'model':db[_0x319b00[_0x1ecd('0x1f')]],'as':_0x319b00['as'],'attributes':_0x319b00['attributes'],'include':_0x319b00['include']?_[_0x1ecd('0x1e')](_0x319b00['include'],function(_0x84ed12){return{'model':db[_0x84ed12[_0x1ecd('0x1f')]],'as':_0x84ed12['as'],'attributes':_0x84ed12[_0x1ecd('0x20')],'include':_0x84ed12[_0x1ecd('0x1d')]?_[_0x1ecd('0x1e')](_0x84ed12[_0x1ecd('0x1d')],function(_0x2b4324){return{'model':db[_0x2b4324[_0x1ecd('0x1f')]],'as':_0x2b4324['as'],'attributes':_0x2b4324[_0x1ecd('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1ecd('0xc')](function(_0x57d551){logger[_0x1ecd('0xd')](_0x1ecd('0x21'),_0x599cf9);logger['debug'](_0x1ecd('0x21'),_0x599cf9,JSON['stringify'](_0x57d551));_0x1e13af(_0x57d551);})[_0x1ecd('0x17')](function(_0x32b2ea){logger['error']('ShowVariable',_0x32b2ea[_0x1ecd('0x15')],_0x599cf9);_0x18036a(_0x1e1ba5['error'](0x1f4,_0x32b2ea[_0x1ecd('0x15')]));});});}; \ No newline at end of file +var _0x27fd=['model','map','then','debug','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','ShowVariable','Variable','find','options','raw','where','attributes','include'];(function(_0xac999,_0x2a2758){var _0x1b3a17=function(_0x34daaf){while(--_0x34daaf){_0xac999['push'](_0xac999['shift']());}};_0x1b3a17(++_0x2a2758);}(_0x27fd,0x67));var _0xd27f=function(_0x1d6cb8,_0x31a3f3){_0x1d6cb8=_0x1d6cb8-0x0;var _0x38a43f=_0x27fd[_0x1d6cb8];return _0x38a43f;};'use strict';var _=require(_0xd27f('0x0'));var util=require('util');var moment=require(_0xd27f('0x1'));var BPromise=require(_0xd27f('0x2'));var rs=require(_0xd27f('0x3'));var fs=require('fs');var Redis=require(_0xd27f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd27f('0x5'));var logger=require(_0xd27f('0x6'))(_0xd27f('0x7'));var config=require(_0xd27f('0x8'));var jayson=require(_0xd27f('0x9'));var client=jayson[_0xd27f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3513dc,_0x4af2d9,_0x5398ed){return new BPromise(function(_0x2e75ac,_0xde5ba0){return client[_0xd27f('0xb')](_0x3513dc,_0x5398ed)['then'](function(_0x197a73){logger['info'](_0xd27f('0xc'),_0x4af2d9,_0xd27f('0xd'));logger['debug'](_0xd27f('0xe'),_0x4af2d9,_0xd27f('0xd'),JSON[_0xd27f('0xf')](_0x197a73));if(_0x197a73[_0xd27f('0x10')]){if(_0x197a73[_0xd27f('0x10')][_0xd27f('0x11')]===0x1f4){logger['error'](_0xd27f('0xc'),_0x4af2d9,_0x197a73['error'][_0xd27f('0x12')]);return _0xde5ba0(_0x197a73[_0xd27f('0x10')][_0xd27f('0x12')]);}logger[_0xd27f('0x10')](_0xd27f('0xc'),_0x4af2d9,_0x197a73[_0xd27f('0x10')][_0xd27f('0x12')]);return _0x2e75ac(_0x197a73[_0xd27f('0x10')][_0xd27f('0x12')]);}else{logger[_0xd27f('0x13')](_0xd27f('0xc'),_0x4af2d9,_0xd27f('0xd'));_0x2e75ac(_0x197a73[_0xd27f('0x14')]['message']);}})['catch'](function(_0x5efbd4){logger['error'](_0xd27f('0xc'),_0x4af2d9,_0x5efbd4);_0xde5ba0(_0x5efbd4);});});}exports[_0xd27f('0x15')]=function(_0x4e61d4){var _0x51fde2=this;return new Promise(function(_0x988c07,_0x3730e3){return db[_0xd27f('0x16')][_0xd27f('0x17')]({'raw':_0x4e61d4['options']?_0x4e61d4[_0xd27f('0x18')][_0xd27f('0x19')]===undefined?!![]:![]:!![],'where':_0x4e61d4[_0xd27f('0x18')]?_0x4e61d4[_0xd27f('0x18')][_0xd27f('0x1a')]||null:null,'attributes':_0x4e61d4[_0xd27f('0x18')]?_0x4e61d4[_0xd27f('0x18')][_0xd27f('0x1b')]||null:null,'include':_0x4e61d4[_0xd27f('0x18')]?_0x4e61d4[_0xd27f('0x18')][_0xd27f('0x1c')]?_['map'](_0x4e61d4[_0xd27f('0x18')][_0xd27f('0x1c')],function(_0x4dc918){return{'model':db[_0x4dc918[_0xd27f('0x1d')]],'as':_0x4dc918['as'],'attributes':_0x4dc918['attributes'],'include':_0x4dc918[_0xd27f('0x1c')]?_[_0xd27f('0x1e')](_0x4dc918[_0xd27f('0x1c')],function(_0x22198e){return{'model':db[_0x22198e[_0xd27f('0x1d')]],'as':_0x22198e['as'],'attributes':_0x22198e[_0xd27f('0x1b')],'include':_0x22198e[_0xd27f('0x1c')]?_['map'](_0x22198e['include'],function(_0x5f12db){return{'model':db[_0x5f12db[_0xd27f('0x1d')]],'as':_0x5f12db['as'],'attributes':_0x5f12db[_0xd27f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd27f('0x1f')](function(_0x31b2eb){logger['info'](_0xd27f('0x15'),_0x4e61d4);logger[_0xd27f('0x20')](_0xd27f('0x15'),_0x4e61d4,JSON[_0xd27f('0xf')](_0x31b2eb));_0x988c07(_0x31b2eb);})['catch'](function(_0x3701f1){logger['error'](_0xd27f('0x15'),_0x3701f1[_0xd27f('0x12')],_0x4e61d4);_0x3730e3(_0x51fde2[_0xd27f('0x10')](0x1f4,_0x3701f1[_0xd27f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 3810839..aea5205 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 _0xe7b1=['migrations','express','Router','../../components/auth/service','index','get','isAuthenticated','canUpdate','fetch','reset','/pull','pull','restart','/migrations'];(function(_0x13bfdb,_0x398535){var _0x41b6d2=function(_0x3bccbd){while(--_0x3bccbd){_0x13bfdb['push'](_0x13bfdb['shift']());}};_0x41b6d2(++_0x398535);}(_0xe7b1,0x1a5));var _0x1e7b=function(_0x26f5a1,_0x5df3fa){_0x26f5a1=_0x26f5a1-0x0;var _0x539b91=_0xe7b1[_0x26f5a1];return _0x539b91;};'use strict';var express=require(_0x1e7b('0x0'));var router=express[_0x1e7b('0x1')]();var auth=require(_0x1e7b('0x2'));var controller=require('./version.controller');router['get']('/',controller[_0x1e7b('0x3')]);router[_0x1e7b('0x4')]('/fetch',auth[_0x1e7b('0x5')](),auth[_0x1e7b('0x6')](),controller[_0x1e7b('0x7')]);router[_0x1e7b('0x4')]('/reset',auth['isAuthenticated'](),auth[_0x1e7b('0x6')](),controller[_0x1e7b('0x8')]);router[_0x1e7b('0x4')](_0x1e7b('0x9'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x1e7b('0xa')]);router[_0x1e7b('0x4')]('/restart',auth[_0x1e7b('0x5')](),controller[_0x1e7b('0xb')]);router[_0x1e7b('0x4')](_0x1e7b('0xc'),controller[_0x1e7b('0xd')]);module['exports']=router; \ No newline at end of file +var _0x0009=['fetch','/reset','/pull','pull','/restart','restart','migrations','exports','express','Router','./version.controller','get','index','/fetch','isAuthenticated','canUpdate'];(function(_0x37e94a,_0x306870){var _0x39948e=function(_0x39bccb){while(--_0x39bccb){_0x37e94a['push'](_0x37e94a['shift']());}};_0x39948e(++_0x306870);}(_0x0009,0x108));var _0x9000=function(_0x232d32,_0x3ccf6d){_0x232d32=_0x232d32-0x0;var _0x163cf2=_0x0009[_0x232d32];return _0x163cf2;};'use strict';var express=require(_0x9000('0x0'));var router=express[_0x9000('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x9000('0x2'));router[_0x9000('0x3')]('/',controller[_0x9000('0x4')]);router[_0x9000('0x3')](_0x9000('0x5'),auth[_0x9000('0x6')](),auth[_0x9000('0x7')](),controller[_0x9000('0x8')]);router['get'](_0x9000('0x9'),auth[_0x9000('0x6')](),auth[_0x9000('0x7')](),controller['reset']);router[_0x9000('0x3')](_0x9000('0xa'),auth[_0x9000('0x6')](),auth[_0x9000('0x7')](),controller[_0x9000('0xb')]);router[_0x9000('0x3')](_0x9000('0xc'),auth['isAuthenticated'](),controller[_0x9000('0xd')]);router[_0x9000('0x3')]('/migrations',controller[_0x9000('0xe')]);module[_0x9000('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 c8deef9..3ed9703 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 _0xfe1a=['Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','length','replace','.js','Migration','sequelize','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','version','query','fetch','latest','exports','2.0.0','status','json','origin','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'];(function(_0x599b68,_0x3ed63d){var _0x2dd80d=function(_0x3e36ea){while(--_0x3e36ea){_0x599b68['push'](_0x599b68['shift']());}};_0x2dd80d(++_0x3ed63d);}(_0xfe1a,0xe6));var _0xafe1=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xfe1a[_0x56482c];return _0x5aae7a;};'use strict';var Umzug=require(_0xafe1('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xafe1('0x1'));var pkginfo=require('pkginfo')(module,'version');var compareVersions=require('compare-versions');var exec=require(_0xafe1('0x2'))[_0xafe1('0x3')];var db=require(_0xafe1('0x4'))['db'];var config=require(_0xafe1('0x5'));var pm2=require(_0xafe1('0x6'));var logger=require(_0xafe1('0x7'))(_0xafe1('0x8'));var git=require(_0xafe1('0x9'))(config[_0xafe1('0xa')]);exports[_0xafe1('0xb')]=function(_0x303947,_0xcaae30){var _0xd651d0={'current':module['exports'][_0xafe1('0xc')],'phonebar':0x2};if(_0x303947[_0xafe1('0xd')]&&_0x303947[_0xafe1('0xd')]['latest']){return git[_0xafe1('0xe')]()['tags'](function(_0x452180,_0x5f1f2b){_0xd651d0[_0xafe1('0xf')]=(_0x452180?module[_0xafe1('0x10')]['version']:_0x5f1f2b[_0xafe1('0xf')])||_0xafe1('0x11');return _0xcaae30[_0xafe1('0x12')](0xc8)['json'](_0xd651d0);});}else{return _0xcaae30[_0xafe1('0x12')](0xc8)[_0xafe1('0x13')](_0xd651d0);}};exports['fetch']=function(_0x354a88,_0x5bd5a9){return git[_0xafe1('0xe')]([_0xafe1('0x14'),_0xafe1('0x15')],function(_0x523d0a){if(_0x523d0a){logger[_0xafe1('0x16')](_0x523d0a);return _0x5bd5a9[_0xafe1('0x12')](0x1f4)['json'](_0x523d0a);}logger[_0xafe1('0x17')](_0xafe1('0x18'));return _0x5bd5a9[_0xafe1('0x12')](0xc8)['json']({'output':_0xafe1('0x19')});});};exports[_0xafe1('0x1a')]=function(_0x466364,_0x446ae0){return git[_0xafe1('0x1a')](['--hard',_0xafe1('0x1b')],function(_0x7a126e){if(_0x7a126e){logger['error'](_0x7a126e);return _0x446ae0[_0xafe1('0x12')](0x1f4)[_0xafe1('0x13')](_0x7a126e);}logger[_0xafe1('0x17')](_0xafe1('0x1c'));return _0x446ae0[_0xafe1('0x12')](0xc8)[_0xafe1('0x13')]({'output':_0xafe1('0x1d')});});};exports['pull']=function(_0x8aa093,_0x3c5e0b){exec(_0xafe1('0x1e'),function(_0x2b0b45,_0x42e9a2,_0x343927){logger['info'](_0x42e9a2);logger[_0xafe1('0x17')](_0x343927);if(_0x2b0b45){logger[_0xafe1('0x16')](_0x2b0b45);return _0x3c5e0b['status'](0x1f4)[_0xafe1('0x13')](_0x2b0b45);}return _0x3c5e0b[_0xafe1('0x12')](0xc8)[_0xafe1('0x13')]({'output':_0x42e9a2});});};exports[_0xafe1('0x1f')]=function(_0x3743f6,_0x27e538){return pm2[_0xafe1('0x1f')](_0xafe1('0x20'))[_0xafe1('0x21')](function(_0x4b616b){logger['info'](_0xafe1('0x22'),_0x4b616b);return _0x27e538[_0xafe1('0x12')](0xc8)[_0xafe1('0x13')]({'output':_0xafe1('0x23')});})[_0xafe1('0x24')](function(_0x429f90){logger['error'](_0x429f90);return _0x27e538[_0xafe1('0x12')](0x1f4)[_0xafe1('0x13')](_0x429f90);});};exports[_0xafe1('0x25')]=function(_0x3b051e,_0x29556d){var _0x530c69=fs[_0xafe1('0x26')](path['join'](config[_0xafe1('0xa')],'server',_0xafe1('0x25')));var _0x372b8d=[];for(var _0x586662=0x0;_0x586662<_0x530c69[_0xafe1('0x27')];_0x586662++){var _0x1d358c=_0x530c69[_0x586662][_0xafe1('0x28')](_0xafe1('0x29'),'');if(compareVersions(module[_0xafe1('0x10')][_0xafe1('0xc')],_0x1d358c)===-0x1){_0x372b8d['push'](_0x1d358c);}}if(_0x372b8d[_0xafe1('0x27')]){var _0x375d46=_0x372b8d['sort'](compareVersions);var _0xc40558=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xafe1('0x2a')],'modelName':'Migration','columnName':_0xafe1('0xc')},'migrations':{'params':[db[_0xafe1('0x2b')][_0xafe1('0x2c')](),db[_0xafe1('0x2b')]['constructor'],function(){throw new Error(_0xafe1('0x2d'));}],'path':path[_0xafe1('0x2e')](config['root'],'server',_0xafe1('0x25')),'pattern':/\.js$/}});_0xc40558['up']({'migrations':_[_0xafe1('0x2f')](_0x375d46,function(_0x2bd713){return _0x2bd713+'.js';})})['then'](function(){return _0x29556d[_0xafe1('0x12')](0xc8)[_0xafe1('0x13')]({'output':_0xafe1('0x30')+module[_0xafe1('0x10')]['version']+_0xafe1('0x31')+_[_0xafe1('0x32')](_0x375d46),'migrations':_[_0xafe1('0x2e')](_0x375d46)});})[_0xafe1('0x24')](function(_0x2d3309){if(_0x2d3309 instanceof db[_0xafe1('0x2b')][_0xafe1('0x33')]){return _0x29556d[_0xafe1('0x12')](0xc8)[_0xafe1('0x13')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x29556d[_0xafe1('0x12')](0x1f4)[_0xafe1('0x13')](_0x2d3309);}});}else{return _0x29556d[_0xafe1('0x12')](0xc8)[_0xafe1('0x13')]({'output':_0xafe1('0x34')});}}; \ No newline at end of file +var _0x0e9f=['.js','version','push','sort','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','exports','query','fetch','latest','2.0.0','master','status','json','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','error','git\x20reset\x20--hard\x20FETCH_HEAD','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','length','replace'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x0e9f,0x7a));var _0xf0e9=function(_0x452898,_0x163c12){_0x452898=_0x452898-0x0;var _0x3284bd=_0x0e9f[_0x452898];return _0x3284bd;};'use strict';var Umzug=require('umzug');var path=require(_0xf0e9('0x0'));var fs=require('fs');var _=require(_0xf0e9('0x1'));var pkginfo=require('pkginfo')(module,'version');var compareVersions=require('compare-versions');var exec=require(_0xf0e9('0x2'))[_0xf0e9('0x3')];var db=require(_0xf0e9('0x4'))['db'];var config=require(_0xf0e9('0x5'));var pm2=require(_0xf0e9('0x6'));var logger=require(_0xf0e9('0x7'))(_0xf0e9('0x8'));var git=require(_0xf0e9('0x9'))(config[_0xf0e9('0xa')]);exports['index']=function(_0x5178ff,_0x1b05b8){var _0x171cbf={'current':module[_0xf0e9('0xb')]['version'],'phonebar':0x2};if(_0x5178ff[_0xf0e9('0xc')]&&_0x5178ff[_0xf0e9('0xc')]['latest']){return git[_0xf0e9('0xd')]()['tags'](function(_0x15eacd,_0x592c4a){_0x171cbf[_0xf0e9('0xe')]=(_0x15eacd?module[_0xf0e9('0xb')]['version']:_0x592c4a[_0xf0e9('0xe')])||_0xf0e9('0xf');return _0x1b05b8['status'](0xc8)['json'](_0x171cbf);});}else{return _0x1b05b8['status'](0xc8)['json'](_0x171cbf);}};exports[_0xf0e9('0xd')]=function(_0xfb2288,_0x391643){return git[_0xf0e9('0xd')](['origin',_0xf0e9('0x10')],function(_0x277a32){if(_0x277a32){logger['error'](_0x277a32);return _0x391643[_0xf0e9('0x11')](0x1f4)[_0xf0e9('0x12')](_0x277a32);}logger[_0xf0e9('0x13')]('git\x20fetch');return _0x391643['status'](0xc8)[_0xf0e9('0x12')]({'output':_0xf0e9('0x14')});});};exports[_0xf0e9('0x15')]=function(_0x1767d7,_0x2fba67){return git[_0xf0e9('0x15')]([_0xf0e9('0x16'),_0xf0e9('0x17')],function(_0x45e340){if(_0x45e340){logger[_0xf0e9('0x18')](_0x45e340);return _0x2fba67[_0xf0e9('0x11')](0x1f4)[_0xf0e9('0x12')](_0x45e340);}logger[_0xf0e9('0x13')](_0xf0e9('0x19'));return _0x2fba67[_0xf0e9('0x11')](0xc8)[_0xf0e9('0x12')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x43ca0f,_0x3d9f0e){exec('npm\x20install\x20--production',function(_0x5e885d,_0x4440e7,_0x3d793d){logger[_0xf0e9('0x13')](_0x4440e7);logger[_0xf0e9('0x13')](_0x3d793d);if(_0x5e885d){logger['error'](_0x5e885d);return _0x3d9f0e['status'](0x1f4)[_0xf0e9('0x12')](_0x5e885d);}return _0x3d9f0e[_0xf0e9('0x11')](0xc8)['json']({'output':_0x4440e7});});};exports[_0xf0e9('0x1a')]=function(_0x4884af,_0x103b4f){return pm2[_0xf0e9('0x1a')](_0xf0e9('0x1b'))[_0xf0e9('0x1c')](function(_0x318aff){logger[_0xf0e9('0x13')](_0xf0e9('0x1d'),_0x318aff);return _0x103b4f[_0xf0e9('0x11')](0xc8)[_0xf0e9('0x12')]({'output':_0xf0e9('0x1e')});})[_0xf0e9('0x1f')](function(_0x50e63f){logger[_0xf0e9('0x18')](_0x50e63f);return _0x103b4f['status'](0x1f4)[_0xf0e9('0x12')](_0x50e63f);});};exports[_0xf0e9('0x20')]=function(_0x1d160c,_0xaa1c6f){var _0x264fe5=fs[_0xf0e9('0x21')](path[_0xf0e9('0x22')](config[_0xf0e9('0xa')],'server','migrations'));var _0x1a7feb=[];for(var _0x45d5fc=0x0;_0x45d5fc<_0x264fe5[_0xf0e9('0x23')];_0x45d5fc++){var _0xf04ed0=_0x264fe5[_0x45d5fc][_0xf0e9('0x24')](_0xf0e9('0x25'),'');if(compareVersions(module[_0xf0e9('0xb')][_0xf0e9('0x26')],_0xf04ed0)===-0x1){_0x1a7feb[_0xf0e9('0x27')](_0xf04ed0);}}if(_0x1a7feb[_0xf0e9('0x23')]){var _0x373ffc=_0x1a7feb[_0xf0e9('0x28')](compareVersions);var _0x29ccb2=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xf0e9('0x29')],'modelName':_0xf0e9('0x29'),'columnName':_0xf0e9('0x26')},'migrations':{'params':[db[_0xf0e9('0x2a')][_0xf0e9('0x2b')](),db[_0xf0e9('0x2a')][_0xf0e9('0x2c')],function(){throw new Error(_0xf0e9('0x2d'));}],'path':path[_0xf0e9('0x22')](config[_0xf0e9('0xa')],_0xf0e9('0x2e'),_0xf0e9('0x20')),'pattern':/\.js$/}});_0x29ccb2['up']({'migrations':_[_0xf0e9('0x2f')](_0x373ffc,function(_0x41e428){return _0x41e428+'.js';})})[_0xf0e9('0x1c')](function(){return _0xaa1c6f[_0xf0e9('0x11')](0xc8)[_0xf0e9('0x12')]({'output':_0xf0e9('0x30')+module[_0xf0e9('0xb')]['version']+_0xf0e9('0x31')+_[_0xf0e9('0x32')](_0x373ffc),'migrations':_[_0xf0e9('0x22')](_0x373ffc)});})[_0xf0e9('0x1f')](function(_0x321aeb){if(_0x321aeb instanceof db[_0xf0e9('0x2a')][_0xf0e9('0x33')]){return _0xaa1c6f[_0xf0e9('0x11')](0xc8)[_0xf0e9('0x12')]({'output':'Database\x20already\x20up-to-date'});}else{return _0xaa1c6f[_0xf0e9('0x11')](0x1f4)[_0xf0e9('0x12')](_0x321aeb);}});}else{return _0xaa1c6f[_0xf0e9('0x11')](0xc8)[_0xf0e9('0x12')]({'output':_0xf0e9('0x34')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index b1f8c36..13e39ae 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 _0xa46e=['./voiceAgentReport.controller','isAuthenticated','get','/describe','describe','/:id','show','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa46e,0x8a));var _0xea46=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xa46e[_0x543084];return _0x306a57;};'use strict';var multer=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var path=require('path');var timeout=require(_0xea46('0x2'));var express=require(_0xea46('0x3'));var router=express[_0xea46('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xea46('0x5'));var config=require('../../config/environment');var controller=require(_0xea46('0x6'));router['get']('/',auth[_0xea46('0x7')](),controller['index']);router[_0xea46('0x8')](_0xea46('0x9'),auth['isAuthenticated'](),controller[_0xea46('0xa')]);router[_0xea46('0x8')](_0xea46('0xb'),auth[_0xea46('0x7')](),controller[_0xea46('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xea46('0xd')](_0xea46('0xb'),auth['isAuthenticated'](),controller[_0xea46('0xe')]);router[_0xea46('0xf')](_0xea46('0xb'),auth['isAuthenticated'](),controller[_0xea46('0x10')]);module[_0xea46('0x11')]=router; \ No newline at end of file +var _0xf072=['update','delete','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x43b178,_0x362a41){var _0x5eb1bd=function(_0x243351){while(--_0x243351){_0x43b178['push'](_0x43b178['shift']());}};_0x5eb1bd(++_0x362a41);}(_0xf072,0x1cf));var _0x2f07=function(_0x290306,_0x4312e5){_0x290306=_0x290306-0x0;var _0x79d07e=_0xf072[_0x290306];return _0x79d07e;};'use strict';var multer=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var path=require(_0x2f07('0x2'));var timeout=require('connect-timeout');var express=require(_0x2f07('0x3'));var router=express['Router']();var auth=require(_0x2f07('0x4'));var interaction=require(_0x2f07('0x5'));var config=require(_0x2f07('0x6'));var controller=require('./voiceAgentReport.controller');router[_0x2f07('0x7')]('/',auth[_0x2f07('0x8')](),controller[_0x2f07('0x9')]);router[_0x2f07('0x7')](_0x2f07('0xa'),auth[_0x2f07('0x8')](),controller[_0x2f07('0xb')]);router[_0x2f07('0x7')](_0x2f07('0xc'),auth[_0x2f07('0x8')](),controller[_0x2f07('0xd')]);router[_0x2f07('0xe')]('/',auth[_0x2f07('0x8')](),controller[_0x2f07('0xf')]);router[_0x2f07('0x10')]('/:id',auth[_0x2f07('0x8')](),controller[_0x2f07('0x11')]);router[_0x2f07('0x12')](_0x2f07('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x2f07('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 032c4ee..f780f38 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 _0xd35b=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x2519d7,_0x13c5ef){var _0x579eda=function(_0x14a8b2){while(--_0x14a8b2){_0x2519d7['push'](_0x2519d7['shift']());}};_0x579eda(++_0x13c5ef);}(_0xd35b,0x1cf));var _0xbd35=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xd35b[_0x134c2e];return _0x2825db;};'use strict';var Sequelize=require(_0xbd35('0x0'));module[_0xbd35('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xbd35('0x2')]},'calleridnum':{'type':Sequelize[_0xbd35('0x2')]},'calleridname':{'type':Sequelize[_0xbd35('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xbd35('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xbd35('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xbd35('0x3')]},'holdtime':{'type':Sequelize[_0xbd35('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xbd35('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xbd35('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xbd35('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xbd35('0x4')]},'reason':{'type':Sequelize[_0xbd35('0x2')]},'lastevent':{'type':Sequelize[_0xbd35('0x2')]},'channel':{'type':Sequelize[_0xbd35('0x2')]},'channelstate':{'type':Sequelize[_0xbd35('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xbd35('0x2')]},'language':{'type':Sequelize[_0xbd35('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xbd35('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xbd35('0x2')]},'destchannel':{'type':Sequelize[_0xbd35('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xbd35('0x2')]},'destcalleridname':{'type':Sequelize[_0xbd35('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xbd35('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xbd35('0x2')]},'destlanguage':{'type':Sequelize[_0xbd35('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xbd35('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xbd35('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xbd35('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xbd35('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xbd35('0x2')],'comment':_0xbd35('0x6')},'transferexten':{'type':Sequelize[_0xbd35('0x2')]},'transferuniqueid':{'type':Sequelize[_0xbd35('0x2')]},'agententerreason':{'type':Sequelize[_0xbd35('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb656=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','INTEGER'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb656,0xec));var _0x6b65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb656[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x6b65('0x0')]={'type':{'type':Sequelize[_0x6b65('0x1')]},'uniqueid':{'type':Sequelize[_0x6b65('0x1')]},'calleridnum':{'type':Sequelize[_0x6b65('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x6b65('0x1')]},'interface':{'type':Sequelize[_0x6b65('0x1')]},'membername':{'type':Sequelize[_0x6b65('0x1')]},'agentcalledAt':{'type':Sequelize[_0x6b65('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x6b65('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x6b65('0x2')]},'holdtime':{'type':Sequelize[_0x6b65('0x3')]},'agentcomplete':{'type':Sequelize[_0x6b65('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x6b65('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x6b65('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x6b65('0x3')]},'agentacw':{'type':Sequelize[_0x6b65('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x6b65('0x1')]},'lastevent':{'type':Sequelize[_0x6b65('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x6b65('0x3')]},'channelstatedesc':{'type':Sequelize[_0x6b65('0x1')]},'connectedlinenum':{'type':Sequelize[_0x6b65('0x1')]},'connectedlinename':{'type':Sequelize[_0x6b65('0x1')]},'language':{'type':Sequelize[_0x6b65('0x1')]},'accountcode':{'type':Sequelize[_0x6b65('0x1')]},'context':{'type':Sequelize[_0x6b65('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x6b65('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x6b65('0x1')]},'destcalleridname':{'type':Sequelize[_0x6b65('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x6b65('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x6b65('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x6b65('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x6b65('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x6b65('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x6b65('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x6b65('0x5')},'transferexten':{'type':Sequelize[_0x6b65('0x1')]},'transferuniqueid':{'type':Sequelize[_0x6b65('0x1')]},'agententerreason':{'type':Sequelize[_0x6b65('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 9c01e1c..f781e56 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 _0x22f4=['fast-json-patch','request-promise','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','apply','reject','update','then','destroy','error','stack','name','send','index','VoiceAgentReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','params','length','merge','options','find','create','body','describe','eml-format','zip-dir'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x22f4,0x8c));var _0x422f=function(_0x389832,_0x10a4a9){_0x389832=_0x389832-0x0;var _0x59429e=_0x22f4[_0x389832];return _0x59429e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x422f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x422f('0x1'));var jsonpatch=require(_0x422f('0x2'));var rp=require(_0x422f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x422f('0x4'));var sox=require('sox');var csv=require(_0x422f('0x5'));var ejs=require(_0x422f('0x6'));var fs=require('fs');var _=require(_0x422f('0x7'));var squel=require('squel');var crypto=require(_0x422f('0x8'));var jsforce=require(_0x422f('0x9'));var deskjs=require(_0x422f('0xa'));var toCsv=require('to-csv');var querystring=require(_0x422f('0xb'));var Papa=require(_0x422f('0xc'));var Redis=require(_0x422f('0xd'));var authService=require(_0x422f('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x422f('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x422f('0x10'));var config=require(_0x422f('0x11'));var db=require(_0x422f('0x12'))['db'];function respondWithStatusCode(_0x1c0b79,_0x1580b1){_0x1580b1=_0x1580b1||0xcc;return function(_0x546ae2){if(_0x546ae2){return _0x1c0b79[_0x422f('0x13')](_0x1580b1);}return _0x1c0b79['status'](_0x1580b1)[_0x422f('0x14')]();};}function respondWithResult(_0x3e1e60,_0x40dec0){_0x40dec0=_0x40dec0||0xc8;return function(_0x15cfd5){if(_0x15cfd5){return _0x3e1e60['status'](_0x40dec0)[_0x422f('0x15')](_0x15cfd5);}};}function respondWithFilteredResult(_0xf0af79,_0x403087){return function(_0x3c1268){if(_0x3c1268){var _0x4a6007=_0x3c1268[_0x422f('0x16')],_0x49b071=_0x403087[_0x422f('0x17')],_0x86756b=_0x403087[_0x422f('0x17')]+_0x403087[_0x422f('0x18')],_0x2668b6;if(_0x86756b>=_0x4a6007){_0x86756b=_0x4a6007;_0x2668b6=0xc8;}else{_0x2668b6=0xce;}_0xf0af79[_0x422f('0x19')](_0x2668b6);return _0xf0af79[_0x422f('0x1a')]('Content-Range',_0x49b071+'-'+_0x86756b+'/'+_0x4a6007)[_0x422f('0x15')](_0x3c1268);}return null;};}function patchUpdates(_0x5d2243){return function(_0x2369a3){try{jsonpatch[_0x422f('0x1b')](_0x2369a3,_0x5d2243,!![]);}catch(_0x2b6a87){return BPromise[_0x422f('0x1c')](_0x2b6a87);}return _0x2369a3['save']();};}function saveUpdates(_0x4692b1,_0x57cf81){return function(_0x47002a){if(_0x47002a){return _0x47002a[_0x422f('0x1d')](_0x4692b1)[_0x422f('0x1e')](function(_0x5e2d6d){return _0x5e2d6d;});}return null;};}function removeEntity(_0x847ffc,_0x4de5b7){return function(_0x564df3){if(_0x564df3){return _0x564df3[_0x422f('0x1f')]()[_0x422f('0x1e')](function(){_0x847ffc['status'](0xcc)[_0x422f('0x14')]();});}};}function handleEntityNotFound(_0x2a00d8,_0x1e5230){return function(_0xe7e9a4){if(!_0xe7e9a4){_0x2a00d8[_0x422f('0x13')](0x194);}return _0xe7e9a4;};}function handleError(_0x2af64e,_0x27f5f9){_0x27f5f9=_0x27f5f9||0x1f4;return function(_0x4763ef){logger[_0x422f('0x20')](_0x4763ef[_0x422f('0x21')]);if(_0x4763ef[_0x422f('0x22')]){delete _0x4763ef[_0x422f('0x22')];}_0x2af64e['status'](_0x27f5f9)[_0x422f('0x23')](_0x4763ef);};}exports[_0x422f('0x24')]=function(_0x4db8e4,_0x1f0549){var _0x1a6a3e={},_0x5e0420={},_0x57736d={'count':0x0,'rows':[]};var _0xf68d0f=db[_0x422f('0x25')][_0x422f('0x26')];_0x5e0420[_0x422f('0x27')]=_[_0x422f('0x28')](_0xf68d0f);_0x5e0420[_0x422f('0x29')]=_[_0x422f('0x28')](_0x4db8e4[_0x422f('0x29')]);_0x5e0420[_0x422f('0x2a')]=_[_0x422f('0x2b')](_0x5e0420[_0x422f('0x27')],_0x5e0420['query']);_0x1a6a3e[_0x422f('0x2c')]=_[_0x422f('0x2b')](_0x5e0420[_0x422f('0x27')],qs[_0x422f('0x2d')](_0x4db8e4[_0x422f('0x29')][_0x422f('0x2d')]));_0x1a6a3e[_0x422f('0x2c')]=_0x1a6a3e[_0x422f('0x2c')]['length']?_0x1a6a3e['attributes']:_0x5e0420[_0x422f('0x27')];if(!_0x4db8e4[_0x422f('0x29')][_0x422f('0x2e')](_0x422f('0x2f'))){_0x1a6a3e[_0x422f('0x18')]=qs[_0x422f('0x18')](_0x4db8e4['query']['limit']);_0x1a6a3e[_0x422f('0x17')]=qs[_0x422f('0x17')](_0x4db8e4[_0x422f('0x29')][_0x422f('0x17')]);}_0x1a6a3e[_0x422f('0x30')]=qs['sort'](_0x4db8e4['query'][_0x422f('0x31')]);_0x1a6a3e['where']=qs[_0x422f('0x2a')](_[_0x422f('0x32')](_0x4db8e4[_0x422f('0x29')],_0x5e0420[_0x422f('0x2a')]));if(_0x4db8e4['query']['filter']){_0x1a6a3e['where']=_['merge'](_0x1a6a3e[_0x422f('0x33')],{'$or':_[_0x422f('0x34')](_0xf68d0f,function(_0x530ffb){if(_0x530ffb[_0x422f('0x35')][_0x422f('0x36')]!==_0x422f('0x37')){var _0x3ef3da={};_0x3ef3da[_0x530ffb[_0x422f('0x38')]]={'$like':'%'+_0x4db8e4[_0x422f('0x29')]['filter']+'%'};return _0x3ef3da;}})});}_0x1a6a3e=_['merge']({},_0x1a6a3e,_0x4db8e4['options']);var _0x551da5={'where':_0x1a6a3e[_0x422f('0x33')]};return db[_0x422f('0x25')]['count'](_0x551da5)[_0x422f('0x1e')](function(_0x3a271b){_0x57736d[_0x422f('0x16')]=_0x3a271b;if(_0x4db8e4['query'][_0x422f('0x39')]){_0x1a6a3e[_0x422f('0x3a')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x422f('0x3b')](_0x1a6a3e);})[_0x422f('0x1e')](function(_0x3e31d1){_0x57736d[_0x422f('0x3c')]=_0x3e31d1;return _0x57736d;})[_0x422f('0x1e')](respondWithFilteredResult(_0x1f0549,_0x1a6a3e))[_0x422f('0x3d')](handleError(_0x1f0549,null));};exports[_0x422f('0x3e')]=function(_0x4a6253,_0x13a09d){var _0x200cdc={'raw':![],'where':{'id':_0x4a6253[_0x422f('0x3f')]['id']}},_0x349740={};_0x349740[_0x422f('0x27')]=_[_0x422f('0x28')](db[_0x422f('0x25')]['rawAttributes']);_0x349740[_0x422f('0x29')]=_[_0x422f('0x28')](_0x4a6253['query']);_0x349740[_0x422f('0x2a')]=_['intersection'](_0x349740[_0x422f('0x27')],_0x349740[_0x422f('0x29')]);_0x200cdc['attributes']=_[_0x422f('0x2b')](_0x349740[_0x422f('0x27')],qs['fields'](_0x4a6253[_0x422f('0x29')]['fields']));_0x200cdc['attributes']=_0x200cdc['attributes'][_0x422f('0x40')]?_0x200cdc['attributes']:_0x349740[_0x422f('0x27')];if(_0x4a6253[_0x422f('0x29')]['includeAll']){_0x200cdc[_0x422f('0x3a')]=[{'all':!![]}];}_0x200cdc=_[_0x422f('0x41')]({},_0x200cdc,_0x4a6253[_0x422f('0x42')]);return db[_0x422f('0x25')][_0x422f('0x43')](_0x200cdc)[_0x422f('0x1e')](handleEntityNotFound(_0x13a09d,null))['then'](respondWithResult(_0x13a09d,null))[_0x422f('0x3d')](handleError(_0x13a09d,null));};exports['create']=function(_0x216f6a,_0x4148a1){return db[_0x422f('0x25')][_0x422f('0x44')](_0x216f6a[_0x422f('0x45')],{})[_0x422f('0x1e')](respondWithResult(_0x4148a1,0xc9))[_0x422f('0x3d')](handleError(_0x4148a1,null));};exports[_0x422f('0x1d')]=function(_0x12189c,_0x57c8dd){if(_0x12189c[_0x422f('0x45')]['id']){delete _0x12189c['body']['id'];}return db[_0x422f('0x25')][_0x422f('0x43')]({'where':{'id':_0x12189c[_0x422f('0x3f')]['id']}})[_0x422f('0x1e')](handleEntityNotFound(_0x57c8dd,null))[_0x422f('0x1e')](saveUpdates(_0x12189c[_0x422f('0x45')],null))['then'](respondWithResult(_0x57c8dd,null))[_0x422f('0x3d')](handleError(_0x57c8dd,null));};exports[_0x422f('0x1f')]=function(_0x4f97cb,_0x13adce){return db['VoiceAgentReport'][_0x422f('0x43')]({'where':{'id':_0x4f97cb[_0x422f('0x3f')]['id']}})[_0x422f('0x1e')](handleEntityNotFound(_0x13adce,null))['then'](removeEntity(_0x13adce,null))[_0x422f('0x3d')](handleError(_0x13adce,null));};exports[_0x422f('0x46')]=function(_0x3ec24f,_0x21dc5d){return db['VoiceAgentReport']['describe']()[_0x422f('0x1e')](respondWithResult(_0x21dc5d,null))[_0x422f('0x3d')](handleError(_0x21dc5d,null));}; \ No newline at end of file +var _0x451f=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','Content-Range','json','apply','reject','update','then','error','stack','name','send','index','VoiceAgentReport','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','merge','map','type','field','filter','options','includeAll','include','rows','catch','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv'];(function(_0x3c0a09,_0x3db8d7){var _0x463015=function(_0xcfc191){while(--_0xcfc191){_0x3c0a09['push'](_0x3c0a09['shift']());}};_0x463015(++_0x3db8d7);}(_0x451f,0x1b6));var _0xf451=function(_0x4fc6f3,_0x48a70c){_0x4fc6f3=_0x4fc6f3-0x0;var _0x1d1480=_0x451f[_0x4fc6f3];return _0x1d1480;};'use strict';var pdf=require(_0xf451('0x0'));var emlformat=require(_0xf451('0x1'));var rimraf=require(_0xf451('0x2'));var zipdir=require(_0xf451('0x3'));var jsonpatch=require(_0xf451('0x4'));var rp=require(_0xf451('0x5'));var moment=require(_0xf451('0x6'));var BPromise=require(_0xf451('0x7'));var Mustache=require(_0xf451('0x8'));var util=require(_0xf451('0x9'));var path=require('path');var sox=require(_0xf451('0xa'));var csv=require(_0xf451('0xb'));var ejs=require(_0xf451('0xc'));var fs=require('fs');var _=require(_0xf451('0xd'));var squel=require(_0xf451('0xe'));var crypto=require(_0xf451('0xf'));var jsforce=require(_0xf451('0x10'));var deskjs=require(_0xf451('0x11'));var toCsv=require('to-csv');var querystring=require(_0xf451('0x12'));var Papa=require(_0xf451('0x13'));var Redis=require(_0xf451('0x14'));var authService=require(_0xf451('0x15'));var qs=require(_0xf451('0x16'));var hardwareService=require(_0xf451('0x17'));var logger=require(_0xf451('0x18'))(_0xf451('0x19'));var utils=require(_0xf451('0x1a'));var config=require('../../config/environment');var db=require(_0xf451('0x1b'))['db'];function respondWithStatusCode(_0x3e45e2,_0x46d72a){_0x46d72a=_0x46d72a||0xcc;return function(_0x486cab){if(_0x486cab){return _0x3e45e2[_0xf451('0x1c')](_0x46d72a);}return _0x3e45e2[_0xf451('0x1d')](_0x46d72a)[_0xf451('0x1e')]();};}function respondWithResult(_0x64060c,_0x8a59d0){_0x8a59d0=_0x8a59d0||0xc8;return function(_0x589525){if(_0x589525){return _0x64060c[_0xf451('0x1d')](_0x8a59d0)['json'](_0x589525);}};}function respondWithFilteredResult(_0x568e58,_0x21fde3){return function(_0x20c17a){if(_0x20c17a){var _0x489cb5=_0x20c17a[_0xf451('0x1f')],_0x47b22f=_0x21fde3['offset'],_0x23c603=_0x21fde3['offset']+_0x21fde3['limit'],_0x101c50;if(_0x23c603>=_0x489cb5){_0x23c603=_0x489cb5;_0x101c50=0xc8;}else{_0x101c50=0xce;}_0x568e58[_0xf451('0x1d')](_0x101c50);return _0x568e58['set'](_0xf451('0x20'),_0x47b22f+'-'+_0x23c603+'/'+_0x489cb5)[_0xf451('0x21')](_0x20c17a);}return null;};}function patchUpdates(_0x4fe357){return function(_0x2b4cf5){try{jsonpatch[_0xf451('0x22')](_0x2b4cf5,_0x4fe357,!![]);}catch(_0x35d233){return BPromise[_0xf451('0x23')](_0x35d233);}return _0x2b4cf5['save']();};}function saveUpdates(_0x278a6e,_0x57ecc6){return function(_0x54df5c){if(_0x54df5c){return _0x54df5c[_0xf451('0x24')](_0x278a6e)[_0xf451('0x25')](function(_0xb55b2e){return _0xb55b2e;});}return null;};}function removeEntity(_0x5e00e2,_0x5ec19e){return function(_0x86890d){if(_0x86890d){return _0x86890d['destroy']()[_0xf451('0x25')](function(){_0x5e00e2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2045b1,_0x35306e){return function(_0x37464c){if(!_0x37464c){_0x2045b1[_0xf451('0x1c')](0x194);}return _0x37464c;};}function handleError(_0x3f33ae,_0x1a7842){_0x1a7842=_0x1a7842||0x1f4;return function(_0x2f875f){logger[_0xf451('0x26')](_0x2f875f[_0xf451('0x27')]);if(_0x2f875f[_0xf451('0x28')]){delete _0x2f875f[_0xf451('0x28')];}_0x3f33ae[_0xf451('0x1d')](_0x1a7842)[_0xf451('0x29')](_0x2f875f);};}exports[_0xf451('0x2a')]=function(_0x1444e1,_0x190016){var _0x150f32={},_0x1f4e21={},_0x1cb194={'count':0x0,'rows':[]};var _0x2162a5=db[_0xf451('0x2b')][_0xf451('0x2c')];_0x1f4e21['model']=_['keys'](_0x2162a5);_0x1f4e21[_0xf451('0x2d')]=_[_0xf451('0x2e')](_0x1444e1['query']);_0x1f4e21[_0xf451('0x2f')]=_[_0xf451('0x30')](_0x1f4e21[_0xf451('0x31')],_0x1f4e21[_0xf451('0x2d')]);_0x150f32[_0xf451('0x32')]=_['intersection'](_0x1f4e21['model'],qs['fields'](_0x1444e1[_0xf451('0x2d')][_0xf451('0x33')]));_0x150f32[_0xf451('0x32')]=_0x150f32[_0xf451('0x32')][_0xf451('0x34')]?_0x150f32['attributes']:_0x1f4e21[_0xf451('0x31')];if(!_0x1444e1['query'][_0xf451('0x35')](_0xf451('0x36'))){_0x150f32[_0xf451('0x37')]=qs[_0xf451('0x37')](_0x1444e1['query'][_0xf451('0x37')]);_0x150f32[_0xf451('0x38')]=qs[_0xf451('0x38')](_0x1444e1[_0xf451('0x2d')][_0xf451('0x38')]);}_0x150f32[_0xf451('0x39')]=qs[_0xf451('0x3a')](_0x1444e1[_0xf451('0x2d')][_0xf451('0x3a')]);_0x150f32[_0xf451('0x3b')]=qs[_0xf451('0x2f')](_['pick'](_0x1444e1[_0xf451('0x2d')],_0x1f4e21[_0xf451('0x2f')]));if(_0x1444e1[_0xf451('0x2d')]['filter']){_0x150f32[_0xf451('0x3b')]=_[_0xf451('0x3c')](_0x150f32[_0xf451('0x3b')],{'$or':_[_0xf451('0x3d')](_0x2162a5,function(_0x4c2f76){if(_0x4c2f76[_0xf451('0x3e')]['key']!=='VIRTUAL'){var _0x38f313={};_0x38f313[_0x4c2f76[_0xf451('0x3f')]]={'$like':'%'+_0x1444e1[_0xf451('0x2d')][_0xf451('0x40')]+'%'};return _0x38f313;}})});}_0x150f32=_[_0xf451('0x3c')]({},_0x150f32,_0x1444e1[_0xf451('0x41')]);var _0x7e585b={'where':_0x150f32[_0xf451('0x3b')]};return db[_0xf451('0x2b')][_0xf451('0x1f')](_0x7e585b)[_0xf451('0x25')](function(_0x472c59){_0x1cb194[_0xf451('0x1f')]=_0x472c59;if(_0x1444e1['query'][_0xf451('0x42')]){_0x150f32[_0xf451('0x43')]=[{'all':!![]}];}return db[_0xf451('0x2b')]['findAll'](_0x150f32);})[_0xf451('0x25')](function(_0x79315){_0x1cb194[_0xf451('0x44')]=_0x79315;return _0x1cb194;})[_0xf451('0x25')](respondWithFilteredResult(_0x190016,_0x150f32))[_0xf451('0x45')](handleError(_0x190016,null));};exports['show']=function(_0x41416e,_0x59b0fa){var _0x57bc24={'raw':![],'where':{'id':_0x41416e[_0xf451('0x46')]['id']}},_0x8e4e13={};_0x8e4e13['model']=_['keys'](db[_0xf451('0x2b')][_0xf451('0x2c')]);_0x8e4e13[_0xf451('0x2d')]=_[_0xf451('0x2e')](_0x41416e[_0xf451('0x2d')]);_0x8e4e13['filters']=_['intersection'](_0x8e4e13[_0xf451('0x31')],_0x8e4e13['query']);_0x57bc24['attributes']=_[_0xf451('0x30')](_0x8e4e13[_0xf451('0x31')],qs['fields'](_0x41416e[_0xf451('0x2d')][_0xf451('0x33')]));_0x57bc24[_0xf451('0x32')]=_0x57bc24[_0xf451('0x32')]['length']?_0x57bc24['attributes']:_0x8e4e13[_0xf451('0x31')];if(_0x41416e['query']['includeAll']){_0x57bc24[_0xf451('0x43')]=[{'all':!![]}];}_0x57bc24=_['merge']({},_0x57bc24,_0x41416e[_0xf451('0x41')]);return db['VoiceAgentReport'][_0xf451('0x47')](_0x57bc24)[_0xf451('0x25')](handleEntityNotFound(_0x59b0fa,null))['then'](respondWithResult(_0x59b0fa,null))[_0xf451('0x45')](handleError(_0x59b0fa,null));};exports[_0xf451('0x48')]=function(_0x27519c,_0xe96401){return db[_0xf451('0x2b')][_0xf451('0x48')](_0x27519c[_0xf451('0x49')],{})[_0xf451('0x25')](respondWithResult(_0xe96401,0xc9))[_0xf451('0x45')](handleError(_0xe96401,null));};exports[_0xf451('0x24')]=function(_0x175b6a,_0xb4a579){if(_0x175b6a[_0xf451('0x49')]['id']){delete _0x175b6a[_0xf451('0x49')]['id'];}return db[_0xf451('0x2b')][_0xf451('0x47')]({'where':{'id':_0x175b6a[_0xf451('0x46')]['id']}})['then'](handleEntityNotFound(_0xb4a579,null))[_0xf451('0x25')](saveUpdates(_0x175b6a[_0xf451('0x49')],null))['then'](respondWithResult(_0xb4a579,null))['catch'](handleError(_0xb4a579,null));};exports['destroy']=function(_0x509518,_0x5bcbad){return db[_0xf451('0x2b')][_0xf451('0x47')]({'where':{'id':_0x509518[_0xf451('0x46')]['id']}})[_0xf451('0x25')](handleEntityNotFound(_0x5bcbad,null))[_0xf451('0x25')](removeEntity(_0x5bcbad,null))[_0xf451('0x45')](handleError(_0x5bcbad,null));};exports[_0xf451('0x4a')]=function(_0x57265d,_0x48cc76){return db[_0xf451('0x2b')][_0xf451('0x4a')]()[_0xf451('0x25')](respondWithResult(_0x48cc76,null))[_0xf451('0x45')](handleError(_0x48cc76,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 0a8ea69..d9ab5c2 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 _0x6554=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger'];(function(_0x940f6c,_0x4d5610){var _0x41ca7c=function(_0x1970ce){while(--_0x1970ce){_0x940f6c['push'](_0x940f6c['shift']());}};_0x41ca7c(++_0x4d5610);}(_0x6554,0xed));var _0x4655=function(_0x323c7e,_0x3d16ec){_0x323c7e=_0x323c7e-0x0;var _0x2b0f72=_0x6554[_0x323c7e];return _0x2b0f72;};'use strict';var _=require(_0x4655('0x0'));var util=require(_0x4655('0x1'));var logger=require(_0x4655('0x2'))(_0x4655('0x3'));var moment=require(_0x4655('0x4'));var BPromise=require(_0x4655('0x5'));var rp=require(_0x4655('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4655('0x7'));var config=require(_0x4655('0x8'));var attributes=require(_0x4655('0x9'));module[_0x4655('0xa')]=function(_0x2b273c,_0x271a3c){return _0x2b273c['define'](_0x4655('0xb'),attributes,{'tableName':_0x4655('0xc'),'paranoid':![],'indexes':[{'fields':[_0x4655('0xd'),_0x4655('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x45f0=['VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x45f0,0x1c6));var _0x045f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x45f0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x045f('0x0'));var util=require(_0x045f('0x1'));var logger=require(_0x045f('0x2'))(_0x045f('0x3'));var moment=require(_0x045f('0x4'));var BPromise=require(_0x045f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x045f('0x6'));var rimraf=require(_0x045f('0x7'));var config=require(_0x045f('0x8'));var attributes=require('./voiceAgentReport.attributes');module[_0x045f('0x9')]=function(_0xe2692f,_0x6d5862){return _0xe2692f[_0x045f('0xa')](_0x045f('0xb'),attributes,{'tableName':_0x045f('0xc'),'paranoid':![],'indexes':[{'fields':[_0x045f('0xd'),_0x045f('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 7014ee3..662bdca 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 _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceAgentReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','VoiceAgentReport','create','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','limit','then','lodash','util'];(function(_0x59d2a4,_0x181d3b){var _0x52c4a6=function(_0x215a10){while(--_0x215a10){_0x59d2a4['push'](_0x59d2a4['shift']());}};_0x52c4a6(++_0x181d3b);}(_0x7a54,0x106));var _0x47a5=function(_0x1030c5,_0x2f3a5a){_0x1030c5=_0x1030c5-0x0;var _0x22fa0a=_0x7a54[_0x1030c5];return _0x22fa0a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateVoiceAgentReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateVoiceAgentReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x814b=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceAgentReport','body','raw','stringify','VoiceAgentReport','update','options','where','attributes','limit','UpdateVoiceAgentReport','lodash','util'];(function(_0x1aec02,_0x3a7f22){var _0x10a837=function(_0x42641b){while(--_0x42641b){_0x1aec02['push'](_0x1aec02['shift']());}};_0x10a837(++_0x3a7f22);}(_0x814b,0x1a2));var _0xb814=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x814b[_0x4a3898];return _0x25ceb0;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['VoiceAgentReport']['create'](_0x55ba16[_0xb814('0x19')],{'raw':_0x55ba16['options']?_0x55ba16['options'][_0xb814('0x1a')]===undefined?!![]:![]:!![]})[_0xb814('0xd')](function(_0x25b6b6){logger['info'](_0xb814('0x18'),_0x55ba16);logger['debug'](_0xb814('0x18'),_0x55ba16,JSON[_0xb814('0x1b')](_0x25b6b6));_0xfac75b(_0x25b6b6);})[_0xb814('0x17')](function(_0x470e81){logger[_0xb814('0x13')](_0xb814('0x18'),_0x470e81[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x470e81[_0xb814('0x15')]));});});};exports['UpdateVoiceAgentReport']=function(_0x3f81d0){var _0x457dac=this;return new Promise(function(_0x31c7ec,_0x208927){return db[_0xb814('0x1c')][_0xb814('0x1d')](_0x3f81d0[_0xb814('0x19')],{'raw':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1f')]||null:null,'attributes':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x20')]||null:null,'limit':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x21')]||null:null})['then'](function(_0x9008b2){logger[_0xb814('0xe')](_0xb814('0x22'),_0x3f81d0);logger['debug'](_0xb814('0x22'),_0x3f81d0,JSON[_0xb814('0x1b')](_0x9008b2));_0x31c7ec(_0x9008b2);})['catch'](function(_0x338a28){logger['error'](_0xb814('0x22'),_0x338a28['message'],_0x3f81d0);_0x208927(_0x457dac['error'](0x1f4,_0x338a28[_0xb814('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 54b3e24..b5221f1 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 _0x5902=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','post','create','put','update','delete','destroy','exports','util'];(function(_0x362930,_0x2dd223){var _0xbe099e=function(_0x552723){while(--_0x552723){_0x362930['push'](_0x362930['shift']());}};_0xbe099e(++_0x2dd223);}(_0x5902,0x6b));var _0x2590=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5902[_0x42cae2];return _0x5f256f;};'use strict';var multer=require('multer');var util=require(_0x2590('0x0'));var path=require(_0x2590('0x1'));var timeout=require(_0x2590('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x2590('0x3'));var interaction=require(_0x2590('0x4'));var config=require(_0x2590('0x5'));var controller=require('./voiceCallReport.controller');router['get']('/',auth[_0x2590('0x6')](),controller[_0x2590('0x7')]);router[_0x2590('0x8')](_0x2590('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x2590('0x8')](_0x2590('0xa'),auth[_0x2590('0x6')](),controller['show']);router[_0x2590('0xb')]('/',auth['isAuthenticated'](),controller[_0x2590('0xc')]);router[_0x2590('0xd')](_0x2590('0xa'),auth[_0x2590('0x6')](),controller[_0x2590('0xe')]);router[_0x2590('0xf')](_0x2590('0xa'),auth['isAuthenticated'](),controller[_0x2590('0x10')]);module[_0x2590('0x11')]=router; \ No newline at end of file +var _0xfa7e=['destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','isAuthenticated','index','get','/describe','/:id','post','put','update','delete'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xfa7e,0x17c));var _0xefa7=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0xfa7e[_0xb833b1];return _0x1ab87a;};'use strict';var multer=require('multer');var util=require(_0xefa7('0x0'));var path=require(_0xefa7('0x1'));var timeout=require(_0xefa7('0x2'));var express=require(_0xefa7('0x3'));var router=express['Router']();var auth=require(_0xefa7('0x4'));var interaction=require(_0xefa7('0x5'));var config=require('../../config/environment');var controller=require(_0xefa7('0x6'));router['get']('/',auth[_0xefa7('0x7')](),controller[_0xefa7('0x8')]);router[_0xefa7('0x9')](_0xefa7('0xa'),auth[_0xefa7('0x7')](),controller['describe']);router[_0xefa7('0x9')](_0xefa7('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xefa7('0xc')]('/',auth[_0xefa7('0x7')](),controller['create']);router[_0xefa7('0xd')](_0xefa7('0xb'),auth['isAuthenticated'](),controller[_0xefa7('0xe')]);router[_0xefa7('0xf')]('/:id',auth[_0xefa7('0x7')](),controller[_0xefa7('0x10')]);module[_0xefa7('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index cff8dbf..60be057 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 _0x85c7=['dialer','STRING','TEXT','DATE','INTEGER','ENUM','inbound','outbound','outbound-fax'];(function(_0x25acfb,_0x56f61f){var _0x388a6b=function(_0x114065){while(--_0x114065){_0x25acfb['push'](_0x25acfb['shift']());}};_0x388a6b(++_0x56f61f);}(_0x85c7,0x1d9));var _0x785c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x85c7[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x785c('0x0')](_0x785c('0x1'),'internal',_0x785c('0x2'),'inbound-fax',_0x785c('0x3'),_0x785c('0x4'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x785c('0x5')]},'source':{'type':Sequelize[_0x785c('0x5')]},'destination':{'type':Sequelize[_0x785c('0x5')]},'destinationcontext':{'type':Sequelize[_0x785c('0x5')]},'callerid':{'type':Sequelize[_0x785c('0x5')]},'channel':{'type':Sequelize[_0x785c('0x5')]},'destinationchannel':{'type':Sequelize[_0x785c('0x5')]},'lastapplication':{'type':Sequelize[_0x785c('0x5')]},'lastdata':{'type':Sequelize[_0x785c('0x6')]},'starttime':{'type':Sequelize[_0x785c('0x7')]},'systemanswertime':{'type':Sequelize[_0x785c('0x7')]},'answertime':{'type':Sequelize[_0x785c('0x7')]},'endtime':{'type':Sequelize[_0x785c('0x7')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x785c('0x8')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x785c('0x5')]},'amaflags':{'type':Sequelize[_0x785c('0x5')]},'userfield':{'type':Sequelize[_0x785c('0x5')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x785c('0x5')]},'prefix':{'type':Sequelize[_0x785c('0x5')]},'routeid':{'type':Sequelize[_0x785c('0x8')]},'sipcallid':{'type':Sequelize[_0x785c('0x5')]}}; \ No newline at end of file +var _0x2ec8=['INTEGER','sequelize','exports','ENUM','inbound','internal','outbound','outbound-fax','dialer','STRING','TEXT','DATE'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x2ec8,0xd9));var _0x82ec=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x2ec8[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x82ec('0x0'));module[_0x82ec('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x82ec('0x2')](_0x82ec('0x3'),_0x82ec('0x4'),_0x82ec('0x5'),'inbound-fax',_0x82ec('0x6'),_0x82ec('0x7'))},'tag':{'type':Sequelize[_0x82ec('0x8')]},'accountcode':{'type':Sequelize[_0x82ec('0x8')]},'source':{'type':Sequelize[_0x82ec('0x8')]},'destination':{'type':Sequelize[_0x82ec('0x8')]},'destinationcontext':{'type':Sequelize[_0x82ec('0x8')]},'callerid':{'type':Sequelize[_0x82ec('0x8')]},'channel':{'type':Sequelize[_0x82ec('0x8')]},'destinationchannel':{'type':Sequelize[_0x82ec('0x8')]},'lastapplication':{'type':Sequelize[_0x82ec('0x8')]},'lastdata':{'type':Sequelize[_0x82ec('0x9')]},'starttime':{'type':Sequelize[_0x82ec('0xa')]},'systemanswertime':{'type':Sequelize[_0x82ec('0xa')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x82ec('0xb')]},'billableseconds':{'type':Sequelize[_0x82ec('0xb')]},'mohtime':{'type':Sequelize[_0x82ec('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x82ec('0x8')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x82ec('0x8')]},'userDisposition':{'type':Sequelize[_0x82ec('0x8')]},'note':{'type':Sequelize[_0x82ec('0x8')]},'prefix':{'type':Sequelize[_0x82ec('0x8')]},'routeid':{'type':Sequelize[_0x82ec('0xb')]},'sipcallid':{'type':Sequelize[_0x82ec('0x8')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 0587825..7362b2f 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 _0xa9e0=['find','create','body','params','describe','update','uniqueid','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','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','VoiceCallReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','alias','User','findAll','catch','show'];(function(_0x6d6110,_0x24352b){var _0x5acd6b=function(_0x3c9c0a){while(--_0x3c9c0a){_0x6d6110['push'](_0x6d6110['shift']());}};_0x5acd6b(++_0x24352b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['VoiceCallReport'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'attributes':['id','name','fullname',_0x0a9e('0x3b')],'model':db[_0x0a9e('0x3c')],'as':'User'}];}return db[_0x0a9e('0x24')][_0x0a9e('0x3d')](_0x384319);})[_0x0a9e('0x1f')](function(_0x148f55){_0x45a1e7['rows']=_0x148f55;return _0x45a1e7;})['then'](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3e')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3f')]=function(_0x53f3ee,_0x183991){var _0x1dec2e={'raw':!![],'where':{'id':_0x53f3ee['params']['id']}},_0x1459bb={};_0x1459bb[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x1459bb[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x53f3ee[_0x0a9e('0x28')]);_0x1459bb[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x1459bb[_0x0a9e('0x26')],_0x1459bb[_0x0a9e('0x28')]);_0x1dec2e[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x1459bb[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x53f3ee['query']['fields']));_0x1dec2e[_0x0a9e('0x2a')]=_0x1dec2e[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x1dec2e[_0x0a9e('0x2a')]:_0x1459bb[_0x0a9e('0x26')];if(_0x53f3ee[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x1dec2e[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x1dec2e=_[_0x0a9e('0x34')]({},_0x1dec2e,_0x53f3ee[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x40')](_0x1dec2e)['then'](handleEntityNotFound(_0x183991,null))[_0x0a9e('0x1f')](respondWithResult(_0x183991,null))[_0x0a9e('0x3e')](handleError(_0x183991,null));};exports[_0x0a9e('0x41')]=function(_0xfbd5ad,_0x2e8caf){return db[_0x0a9e('0x24')][_0x0a9e('0x41')](_0xfbd5ad[_0x0a9e('0x42')],{})['then'](respondWithResult(_0x2e8caf,0xc9))[_0x0a9e('0x3e')](handleError(_0x2e8caf,null));};exports['destroy']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x473dc8[_0x0a9e('0x43')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x476688,null))[_0x0a9e('0x1f')](removeEntity(_0x476688,null))[_0x0a9e('0x3e')](handleError(_0x476688,null));};exports[_0x0a9e('0x44')]=function(_0x37be73,_0x45bf7f){return db['VoiceCallReport'][_0x0a9e('0x44')]()[_0x0a9e('0x1f')](respondWithResult(_0x45bf7f,null))[_0x0a9e('0x3e')](handleError(_0x45bf7f,null));};exports[_0x0a9e('0x45')]=function(_0x409789,_0x992c77){if(_0x409789[_0x0a9e('0x42')][_0x0a9e('0x46')]){delete _0x409789[_0x0a9e('0x42')]['uniqueid'];}return db[_0x0a9e('0x24')][_0x0a9e('0x40')]({'where':{'uniqueid':_0x409789['params']['id'],'UserId':{'$or':[null,_0x409789['user']['id']]}}})['then'](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1f')](saveUpdates(_0x409789[_0x0a9e('0x42')],null))[_0x0a9e('0x1f')](respondWithResult(_0x992c77,null))[_0x0a9e('0x3e')](handleError(_0x992c77,null));}; \ No newline at end of file +var _0xa9e0=['find','create','body','params','describe','update','uniqueid','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','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','VoiceCallReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','alias','User','findAll','catch','show'];(function(_0x179185,_0x3994bb){var _0x2bcd43=function(_0x55e14b){while(--_0x55e14b){_0x179185['push'](_0x179185['shift']());}};_0x2bcd43(++_0x3994bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['VoiceCallReport'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'attributes':['id','name','fullname',_0x0a9e('0x3b')],'model':db[_0x0a9e('0x3c')],'as':'User'}];}return db[_0x0a9e('0x24')][_0x0a9e('0x3d')](_0x384319);})[_0x0a9e('0x1f')](function(_0x148f55){_0x45a1e7['rows']=_0x148f55;return _0x45a1e7;})['then'](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3e')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3f')]=function(_0x53f3ee,_0x183991){var _0x1dec2e={'raw':!![],'where':{'id':_0x53f3ee['params']['id']}},_0x1459bb={};_0x1459bb[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x1459bb[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x53f3ee[_0x0a9e('0x28')]);_0x1459bb[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x1459bb[_0x0a9e('0x26')],_0x1459bb[_0x0a9e('0x28')]);_0x1dec2e[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x1459bb[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x53f3ee['query']['fields']));_0x1dec2e[_0x0a9e('0x2a')]=_0x1dec2e[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x1dec2e[_0x0a9e('0x2a')]:_0x1459bb[_0x0a9e('0x26')];if(_0x53f3ee[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x1dec2e[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x1dec2e=_[_0x0a9e('0x34')]({},_0x1dec2e,_0x53f3ee[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x40')](_0x1dec2e)['then'](handleEntityNotFound(_0x183991,null))[_0x0a9e('0x1f')](respondWithResult(_0x183991,null))[_0x0a9e('0x3e')](handleError(_0x183991,null));};exports[_0x0a9e('0x41')]=function(_0xfbd5ad,_0x2e8caf){return db[_0x0a9e('0x24')][_0x0a9e('0x41')](_0xfbd5ad[_0x0a9e('0x42')],{})['then'](respondWithResult(_0x2e8caf,0xc9))[_0x0a9e('0x3e')](handleError(_0x2e8caf,null));};exports['destroy']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x473dc8[_0x0a9e('0x43')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x476688,null))[_0x0a9e('0x1f')](removeEntity(_0x476688,null))[_0x0a9e('0x3e')](handleError(_0x476688,null));};exports[_0x0a9e('0x44')]=function(_0x37be73,_0x45bf7f){return db['VoiceCallReport'][_0x0a9e('0x44')]()[_0x0a9e('0x1f')](respondWithResult(_0x45bf7f,null))[_0x0a9e('0x3e')](handleError(_0x45bf7f,null));};exports[_0x0a9e('0x45')]=function(_0x409789,_0x992c77){if(_0x409789[_0x0a9e('0x42')][_0x0a9e('0x46')]){delete _0x409789[_0x0a9e('0x42')]['uniqueid'];}return db[_0x0a9e('0x24')][_0x0a9e('0x40')]({'where':{'uniqueid':_0x409789['params']['id'],'UserId':{'$or':[null,_0x409789['user']['id']]}}})['then'](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1f')](saveUpdates(_0x409789[_0x0a9e('0x42')],null))[_0x0a9e('0x1f')](respondWithResult(_0x992c77,null))[_0x0a9e('0x3e')](handleError(_0x992c77,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 015cbae..00b4187 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 _0x86fe=['moment','bluebird','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','report_call','lodash','util','../../config/logger','api'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x86fe,0xf8));var _0xe86f=function(_0x1090b6,_0x1c5987){_0x1090b6=_0x1090b6-0x0;var _0xe29f2b=_0x86fe[_0x1090b6];return _0xe29f2b;};'use strict';var _=require(_0xe86f('0x0'));var util=require(_0xe86f('0x1'));var logger=require(_0xe86f('0x2'))(_0xe86f('0x3'));var moment=require(_0xe86f('0x4'));var BPromise=require(_0xe86f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe86f('0x6'));var rimraf=require(_0xe86f('0x7'));var config=require(_0xe86f('0x8'));var attributes=require(_0xe86f('0x9'));module[_0xe86f('0xa')]=function(_0x4bf055,_0x477c11){return _0x4bf055['define']('VoiceCallReport',attributes,{'tableName':_0xe86f('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8dd8=['bluebird','path','./voiceCallReport.attributes','exports','VoiceCallReport','lodash','../../config/logger','api','moment'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x8dd8,0x101));var _0x88dd=function(_0x4966c5,_0xb3b67f){_0x4966c5=_0x4966c5-0x0;var _0x5665f3=_0x8dd8[_0x4966c5];return _0x5665f3;};'use strict';var _=require(_0x88dd('0x0'));var util=require('util');var logger=require(_0x88dd('0x1'))(_0x88dd('0x2'));var moment=require(_0x88dd('0x3'));var BPromise=require(_0x88dd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x88dd('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x88dd('0x6'));module[_0x88dd('0x7')]=function(_0x154ac4,_0x1e228c){return _0x154ac4['define'](_0x88dd('0x8'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index bde14b3..3be4a71 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 _0x9a1d=['VoiceCallReport','findAll','options','attributes','limit','include','map','model','then','catch','CreateVoiceCallReport','create','body','raw','update','where','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetVoiceCallReport'];(function(_0xf5cbe2,_0x408e60){var _0x5454de=function(_0x1257fc){while(--_0x1257fc){_0xf5cbe2['push'](_0xf5cbe2['shift']());}};_0x5454de(++_0x408e60);}(_0x9a1d,0xde));var _0xd9a1=function(_0x1555c9,_0x53ccd0){_0x1555c9=_0x1555c9-0x0;var _0x401e54=_0x9a1d[_0x1555c9];return _0x401e54;};'use strict';var _=require(_0xd9a1('0x0'));var util=require(_0xd9a1('0x1'));var moment=require(_0xd9a1('0x2'));var BPromise=require(_0xd9a1('0x3'));var rs=require(_0xd9a1('0x4'));var fs=require('fs');var Redis=require(_0xd9a1('0x5'));var db=require(_0xd9a1('0x6'))['db'];var utils=require(_0xd9a1('0x7'));var logger=require('../../config/logger')(_0xd9a1('0x8'));var config=require(_0xd9a1('0x9'));var jayson=require(_0xd9a1('0xa'));var client=jayson[_0xd9a1('0xb')][_0xd9a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x342b22,_0x4f64d5,_0x1f397c){return new BPromise(function(_0x1b1898,_0x144b8d){return client[_0xd9a1('0xd')](_0x342b22,_0x1f397c)['then'](function(_0x43b9ed){logger[_0xd9a1('0xe')](_0xd9a1('0xf'),_0x4f64d5,_0xd9a1('0x10'));logger[_0xd9a1('0x11')](_0xd9a1('0x12'),_0x4f64d5,_0xd9a1('0x10'),JSON[_0xd9a1('0x13')](_0x43b9ed));if(_0x43b9ed[_0xd9a1('0x14')]){if(_0x43b9ed['error']['code']===0x1f4){logger[_0xd9a1('0x14')](_0xd9a1('0xf'),_0x4f64d5,_0x43b9ed[_0xd9a1('0x14')]['message']);return _0x144b8d(_0x43b9ed['error'][_0xd9a1('0x15')]);}logger['error'](_0xd9a1('0xf'),_0x4f64d5,_0x43b9ed[_0xd9a1('0x14')]['message']);return _0x1b1898(_0x43b9ed[_0xd9a1('0x14')][_0xd9a1('0x15')]);}else{logger['info'](_0xd9a1('0xf'),_0x4f64d5,_0xd9a1('0x10'));_0x1b1898(_0x43b9ed[_0xd9a1('0x16')][_0xd9a1('0x15')]);}})['catch'](function(_0x2a543f){logger[_0xd9a1('0x14')]('VoiceCallReport,\x20%s,\x20%s',_0x4f64d5,_0x2a543f);_0x144b8d(_0x2a543f);});});}exports[_0xd9a1('0x17')]=function(_0x416b49){var _0x286758=this;return new Promise(function(_0x5ed8c9,_0x20810f){return db[_0xd9a1('0x18')][_0xd9a1('0x19')]({'raw':_0x416b49[_0xd9a1('0x1a')]?_0x416b49[_0xd9a1('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x416b49[_0xd9a1('0x1a')]?_0x416b49[_0xd9a1('0x1a')]['where']||null:null,'attributes':_0x416b49[_0xd9a1('0x1a')]?_0x416b49[_0xd9a1('0x1a')][_0xd9a1('0x1b')]||null:null,'limit':_0x416b49[_0xd9a1('0x1a')]?_0x416b49[_0xd9a1('0x1a')][_0xd9a1('0x1c')]||null:null,'include':_0x416b49[_0xd9a1('0x1a')]?_0x416b49['options'][_0xd9a1('0x1d')]?_[_0xd9a1('0x1e')](_0x416b49[_0xd9a1('0x1a')][_0xd9a1('0x1d')],function(_0x1545eb){return{'model':db[_0x1545eb[_0xd9a1('0x1f')]],'as':_0x1545eb['as'],'attributes':_0x1545eb['attributes'],'include':_0x1545eb[_0xd9a1('0x1d')]?_['map'](_0x1545eb[_0xd9a1('0x1d')],function(_0x183710){return{'model':db[_0x183710[_0xd9a1('0x1f')]],'as':_0x183710['as'],'attributes':_0x183710[_0xd9a1('0x1b')],'include':_0x183710[_0xd9a1('0x1d')]?_[_0xd9a1('0x1e')](_0x183710[_0xd9a1('0x1d')],function(_0x3dada0){return{'model':db[_0x3dada0[_0xd9a1('0x1f')]],'as':_0x3dada0['as'],'attributes':_0x3dada0[_0xd9a1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd9a1('0x20')](function(_0x344254){logger['info']('GetVoiceCallReport',_0x416b49);logger[_0xd9a1('0x11')](_0xd9a1('0x17'),_0x416b49,JSON['stringify'](_0x344254));_0x5ed8c9(_0x344254);})[_0xd9a1('0x21')](function(_0x2df25b){logger[_0xd9a1('0x14')](_0xd9a1('0x17'),_0x2df25b['message'],_0x416b49);_0x20810f(_0x286758['error'](0x1f4,_0x2df25b['message']));});});};exports[_0xd9a1('0x22')]=function(_0x1044d6){var _0x3eb8d5=this;return new Promise(function(_0x48014c,_0x182586){return db[_0xd9a1('0x18')][_0xd9a1('0x23')](_0x1044d6[_0xd9a1('0x24')],{'raw':_0x1044d6['options']?_0x1044d6[_0xd9a1('0x1a')][_0xd9a1('0x25')]===undefined?!![]:![]:!![]})[_0xd9a1('0x20')](function(_0x55d168){logger['info'](_0xd9a1('0x22'),_0x1044d6);logger['debug'](_0xd9a1('0x22'),_0x1044d6,JSON[_0xd9a1('0x13')](_0x55d168));_0x48014c(_0x55d168);})[_0xd9a1('0x21')](function(_0x59ad1d){logger['error'](_0xd9a1('0x22'),_0x59ad1d[_0xd9a1('0x15')],_0x1044d6);_0x182586(_0x3eb8d5[_0xd9a1('0x14')](0x1f4,_0x59ad1d[_0xd9a1('0x15')]));});});};exports['UpdateVoiceCallReport']=function(_0x4ae0c5){var _0x209501=this;return new Promise(function(_0x194493,_0x24df2d){return db[_0xd9a1('0x18')][_0xd9a1('0x26')](_0x4ae0c5['body'],{'raw':_0x4ae0c5[_0xd9a1('0x1a')]?_0x4ae0c5['options'][_0xd9a1('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ae0c5[_0xd9a1('0x1a')]?_0x4ae0c5[_0xd9a1('0x1a')][_0xd9a1('0x27')]||null:null,'attributes':_0x4ae0c5[_0xd9a1('0x1a')]?_0x4ae0c5[_0xd9a1('0x1a')][_0xd9a1('0x1b')]||null:null,'limit':_0x4ae0c5['options']?_0x4ae0c5['options'][_0xd9a1('0x1c')]||null:null})[_0xd9a1('0x20')](function(_0x11761a){logger['info'](_0xd9a1('0x28'),_0x4ae0c5);logger[_0xd9a1('0x11')]('UpdateVoiceCallReport',_0x4ae0c5,JSON[_0xd9a1('0x13')](_0x11761a));_0x194493(_0x11761a);})[_0xd9a1('0x21')](function(_0x2ce235){logger[_0xd9a1('0x14')](_0xd9a1('0x28'),_0x2ce235[_0xd9a1('0x15')],_0x4ae0c5);_0x24df2d(_0x209501[_0xd9a1('0x14')](0x1f4,_0x2ce235['message']));});});}; \ No newline at end of file +var _0x73cb=['include','model','map','stringify','CreateVoiceCallReport','body','raw','UpdateVoiceCallReport','update','where','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','VoiceCallReport,\x20%s,\x20%s','message','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','attributes','limit'];(function(_0x51bc84,_0x519320){var _0x3a953e=function(_0x568464){while(--_0x568464){_0x51bc84['push'](_0x51bc84['shift']());}};_0x3a953e(++_0x519320);}(_0x73cb,0xc3));var _0xb73c=function(_0x5d3edf,_0x17ec80){_0x5d3edf=_0x5d3edf-0x0;var _0x47291b=_0x73cb[_0x5d3edf];return _0x47291b;};'use strict';var _=require(_0xb73c('0x0'));var util=require(_0xb73c('0x1'));var moment=require('moment');var BPromise=require(_0xb73c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb73c('0x3'));var db=require(_0xb73c('0x4'))['db'];var utils=require(_0xb73c('0x5'));var logger=require(_0xb73c('0x6'))(_0xb73c('0x7'));var config=require(_0xb73c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb73c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ceaaf,_0x1a9343,_0x4aeddf){return new BPromise(function(_0x209039,_0x261fe1){return client[_0xb73c('0xa')](_0x2ceaaf,_0x4aeddf)[_0xb73c('0xb')](function(_0x1bd4f2){logger[_0xb73c('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x1a9343,_0xb73c('0xd'));logger[_0xb73c('0xe')](_0xb73c('0xf'),_0x1a9343,_0xb73c('0xd'),JSON['stringify'](_0x1bd4f2));if(_0x1bd4f2[_0xb73c('0x10')]){if(_0x1bd4f2['error'][_0xb73c('0x11')]===0x1f4){logger[_0xb73c('0x10')](_0xb73c('0x12'),_0x1a9343,_0x1bd4f2[_0xb73c('0x10')][_0xb73c('0x13')]);return _0x261fe1(_0x1bd4f2[_0xb73c('0x10')]['message']);}logger[_0xb73c('0x10')](_0xb73c('0x12'),_0x1a9343,_0x1bd4f2['error']['message']);return _0x209039(_0x1bd4f2[_0xb73c('0x10')]['message']);}else{logger['info'](_0xb73c('0x12'),_0x1a9343,_0xb73c('0xd'));_0x209039(_0x1bd4f2['result'][_0xb73c('0x13')]);}})[_0xb73c('0x14')](function(_0xf770d6){logger[_0xb73c('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x1a9343,_0xf770d6);_0x261fe1(_0xf770d6);});});}exports[_0xb73c('0x15')]=function(_0x2b3598){var _0x428784=this;return new Promise(function(_0x555612,_0x12bc63){return db[_0xb73c('0x16')][_0xb73c('0x17')]({'raw':_0x2b3598['options']?_0x2b3598[_0xb73c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2b3598['options']?_0x2b3598[_0xb73c('0x18')]['where']||null:null,'attributes':_0x2b3598[_0xb73c('0x18')]?_0x2b3598['options'][_0xb73c('0x19')]||null:null,'limit':_0x2b3598[_0xb73c('0x18')]?_0x2b3598[_0xb73c('0x18')][_0xb73c('0x1a')]||null:null,'include':_0x2b3598[_0xb73c('0x18')]?_0x2b3598[_0xb73c('0x18')][_0xb73c('0x1b')]?_['map'](_0x2b3598[_0xb73c('0x18')][_0xb73c('0x1b')],function(_0x19dcc9){return{'model':db[_0x19dcc9[_0xb73c('0x1c')]],'as':_0x19dcc9['as'],'attributes':_0x19dcc9[_0xb73c('0x19')],'include':_0x19dcc9[_0xb73c('0x1b')]?_[_0xb73c('0x1d')](_0x19dcc9[_0xb73c('0x1b')],function(_0xe8b598){return{'model':db[_0xe8b598['model']],'as':_0xe8b598['as'],'attributes':_0xe8b598[_0xb73c('0x19')],'include':_0xe8b598[_0xb73c('0x1b')]?_[_0xb73c('0x1d')](_0xe8b598['include'],function(_0x922283){return{'model':db[_0x922283[_0xb73c('0x1c')]],'as':_0x922283['as'],'attributes':_0x922283['attributes']};}):[]};}):[]};}):[]:[]})[_0xb73c('0xb')](function(_0x5e1b63){logger[_0xb73c('0xc')](_0xb73c('0x15'),_0x2b3598);logger[_0xb73c('0xe')](_0xb73c('0x15'),_0x2b3598,JSON[_0xb73c('0x1e')](_0x5e1b63));_0x555612(_0x5e1b63);})[_0xb73c('0x14')](function(_0x5b79d1){logger[_0xb73c('0x10')](_0xb73c('0x15'),_0x5b79d1[_0xb73c('0x13')],_0x2b3598);_0x12bc63(_0x428784[_0xb73c('0x10')](0x1f4,_0x5b79d1[_0xb73c('0x13')]));});});};exports[_0xb73c('0x1f')]=function(_0x1c74e8){var _0x5191d4=this;return new Promise(function(_0x3c93e2,_0x31f733){return db[_0xb73c('0x16')]['create'](_0x1c74e8[_0xb73c('0x20')],{'raw':_0x1c74e8['options']?_0x1c74e8[_0xb73c('0x18')][_0xb73c('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x3343b3){logger[_0xb73c('0xc')](_0xb73c('0x1f'),_0x1c74e8);logger[_0xb73c('0xe')]('CreateVoiceCallReport',_0x1c74e8,JSON[_0xb73c('0x1e')](_0x3343b3));_0x3c93e2(_0x3343b3);})[_0xb73c('0x14')](function(_0x2c12c8){logger['error'](_0xb73c('0x1f'),_0x2c12c8['message'],_0x1c74e8);_0x31f733(_0x5191d4[_0xb73c('0x10')](0x1f4,_0x2c12c8[_0xb73c('0x13')]));});});};exports[_0xb73c('0x22')]=function(_0x26d241){var _0x5be26d=this;return new Promise(function(_0xc81b06,_0x150e7f){return db['VoiceCallReport'][_0xb73c('0x23')](_0x26d241['body'],{'raw':_0x26d241[_0xb73c('0x18')]?_0x26d241[_0xb73c('0x18')][_0xb73c('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26d241[_0xb73c('0x18')]?_0x26d241['options'][_0xb73c('0x24')]||null:null,'attributes':_0x26d241[_0xb73c('0x18')]?_0x26d241[_0xb73c('0x18')][_0xb73c('0x19')]||null:null,'limit':_0x26d241[_0xb73c('0x18')]?_0x26d241[_0xb73c('0x18')][_0xb73c('0x1a')]||null:null})[_0xb73c('0xb')](function(_0x375842){logger['info'](_0xb73c('0x22'),_0x26d241);logger[_0xb73c('0xe')](_0xb73c('0x22'),_0x26d241,JSON['stringify'](_0x375842));_0xc81b06(_0x375842);})[_0xb73c('0x14')](function(_0x1b35fd){logger[_0xb73c('0x10')]('UpdateVoiceCallReport',_0x1b35fd['message'],_0x26d241);_0x150e7f(_0x5be26d[_0xb73c('0x10')](0x1f4,_0x1b35fd[_0xb73c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index e5556af..4ed8b6c 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 _0x66ba=['get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../config/environment','./voiceChanSpy.controller'];(function(_0x400971,_0x5a1a9d){var _0x3ebb43=function(_0x21c4f7){while(--_0x21c4f7){_0x400971['push'](_0x400971['shift']());}};_0x3ebb43(++_0x5a1a9d);}(_0x66ba,0x1bc));var _0xa66b=function(_0x564242,_0x4159f7){_0x564242=_0x564242-0x0;var _0x2906fb=_0x66ba[_0x564242];return _0x2906fb;};'use strict';var multer=require(_0xa66b('0x0'));var util=require('util');var path=require(_0xa66b('0x1'));var timeout=require(_0xa66b('0x2'));var express=require(_0xa66b('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa66b('0x4'));var controller=require(_0xa66b('0x5'));router[_0xa66b('0x6')]('/',auth['isAuthenticated'](),controller[_0xa66b('0x7')]);router[_0xa66b('0x6')](_0xa66b('0x8'),auth[_0xa66b('0x9')](),controller[_0xa66b('0xa')]);router[_0xa66b('0xb')]('/',auth[_0xa66b('0x9')](),controller[_0xa66b('0xc')]);router[_0xa66b('0xd')](_0xa66b('0x8'),auth[_0xa66b('0x9')](),controller[_0xa66b('0xe')]);router[_0xa66b('0xf')](_0xa66b('0x8'),auth[_0xa66b('0x9')](),controller[_0xa66b('0x10')]);module[_0xa66b('0x11')]=router; \ No newline at end of file +var _0x7f6a=['update','destroy','multer','util','connect-timeout','Router','../../components/auth/service','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x258b93,_0x188ccc){var _0x35484b=function(_0x2563ea){while(--_0x2563ea){_0x258b93['push'](_0x258b93['shift']());}};_0x35484b(++_0x188ccc);}(_0x7f6a,0x197));var _0xa7f6=function(_0x5122f6,_0xaa1758){_0x5122f6=_0x5122f6-0x0;var _0x1bcb9b=_0x7f6a[_0x5122f6];return _0x1bcb9b;};'use strict';var multer=require(_0xa7f6('0x0'));var util=require(_0xa7f6('0x1'));var path=require('path');var timeout=require(_0xa7f6('0x2'));var express=require('express');var router=express[_0xa7f6('0x3')]();var auth=require(_0xa7f6('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router[_0xa7f6('0x5')]('/',auth[_0xa7f6('0x6')](),controller[_0xa7f6('0x7')]);router['get'](_0xa7f6('0x8'),auth[_0xa7f6('0x6')](),controller[_0xa7f6('0x9')]);router[_0xa7f6('0xa')]('/',auth[_0xa7f6('0x6')](),controller[_0xa7f6('0xb')]);router[_0xa7f6('0xc')]('/:id',auth[_0xa7f6('0x6')](),controller[_0xa7f6('0xd')]);router['delete'](_0xa7f6('0x8'),auth[_0xa7f6('0x6')](),controller[_0xa7f6('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index ddfd17d..43ce316 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 _0xec32=['name','setDataValue','options','join','getDataValue','split','BOOLEAN','exports','STRING'];(function(_0x1260e9,_0x5602ab){var _0xe7631c=function(_0x226e2c){while(--_0x226e2c){_0x1260e9['push'](_0x1260e9['shift']());}};_0xe7631c(++_0x5602ab);}(_0xec32,0x73));var _0x2ec3=function(_0x1f3631,_0x2fde07){_0x1f3631=_0x1f3631-0x0;var _0x57a83e=_0xec32[_0x1f3631];return _0x57a83e;};'use strict';var Sequelize=require('sequelize');module[_0x2ec3('0x0')]={'name':{'type':Sequelize[_0x2ec3('0x1')]},'prefix':{'type':Sequelize[_0x2ec3('0x1')],'unique':_0x2ec3('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x2ec3('0x1')],'set':function(_0x539215){this[_0x2ec3('0x3')](_0x2ec3('0x4'),_0x539215?_0x539215[_0x2ec3('0x5')](''):[]);},'get':function(){return this[_0x2ec3('0x6')](_0x2ec3('0x4'))?this[_0x2ec3('0x6')](_0x2ec3('0x4'))[_0x2ec3('0x7')](''):[];}},'auth':{'type':Sequelize[_0x2ec3('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x2ec3('0x1')]},'record':{'type':Sequelize[_0x2ec3('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x2ec3('0x1')]},'description':{'type':Sequelize[_0x2ec3('0x1')]}}; \ No newline at end of file +var _0xd0ba=['STRING','getDataValue','options','split','BOOLEAN'];(function(_0x192740,_0x56142c){var _0x393031=function(_0x1f5371){while(--_0x1f5371){_0x192740['push'](_0x192740['shift']());}};_0x393031(++_0x56142c);}(_0xd0ba,0xaa));var _0xad0b=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xd0ba[_0x18ab2a];return _0x16dcee;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xad0b('0x0')]},'prefix':{'type':Sequelize[_0xad0b('0x0')],'unique':'name','allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x2ae5ef){this['setDataValue']('options',_0x2ae5ef?_0x2ae5ef['join'](''):[]);},'get':function(){return this[_0xad0b('0x1')](_0xad0b('0x2'))?this['getDataValue']('options')[_0xad0b('0x3')](''):[];}},'auth':{'type':Sequelize[_0xad0b('0x4')],'defaultValue':![]},'password':{'type':Sequelize[_0xad0b('0x0')]},'record':{'type':Sequelize[_0xad0b('0x4')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xad0b('0x0')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 3a865b0..07f592c 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 _0xdfd9=['attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','status','json','count','offset','limit','set','apply','reject','save','update','destroy','then','ChanSpies','UserProfileResource','end','sendStatus','stack','name','send','index','VoiceChanSpy','rawAttributes','keys','filters','query'];(function(_0x960665,_0x46ec5e){var _0x5a8956=function(_0x59f2c5){while(--_0x59f2c5){_0x960665['push'](_0x960665['shift']());}};_0x5a8956(++_0x46ec5e);}(_0xdfd9,0x15f));var _0x9dfd=function(_0x4667a9,_0x33cc84){_0x4667a9=_0x4667a9-0x0;var _0x1f2265=_0xdfd9[_0x4667a9];return _0x1f2265;};'use strict';var pdf=require(_0x9dfd('0x0'));var emlformat=require(_0x9dfd('0x1'));var rimraf=require(_0x9dfd('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9dfd('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9dfd('0x4'));var Mustache=require('mustache');var util=require(_0x9dfd('0x5'));var path=require('path');var sox=require(_0x9dfd('0x6'));var csv=require(_0x9dfd('0x7'));var ejs=require(_0x9dfd('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9dfd('0x9'));var crypto=require('crypto');var jsforce=require(_0x9dfd('0xa'));var deskjs=require(_0x9dfd('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9dfd('0xc'));var Papa=require(_0x9dfd('0xd'));var Redis=require(_0x9dfd('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9dfd('0xf'));var hardwareService=require(_0x9dfd('0x10'));var logger=require('../../config/logger')(_0x9dfd('0x11'));var utils=require('../../config/utils');var config=require(_0x9dfd('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfc90e6,_0x19dcec){_0x19dcec=_0x19dcec||0xcc;return function(_0x1d5fe8){if(_0x1d5fe8){return _0xfc90e6['sendStatus'](_0x19dcec);}return _0xfc90e6[_0x9dfd('0x13')](_0x19dcec)['end']();};}function respondWithResult(_0x543c9f,_0x40de4e){_0x40de4e=_0x40de4e||0xc8;return function(_0x10ce1c){if(_0x10ce1c){return _0x543c9f[_0x9dfd('0x13')](_0x40de4e)[_0x9dfd('0x14')](_0x10ce1c);}};}function respondWithFilteredResult(_0x35d19c,_0x30f381){return function(_0x278c4a){if(_0x278c4a){var _0x116f99=_0x278c4a[_0x9dfd('0x15')],_0x11b5a1=_0x30f381[_0x9dfd('0x16')],_0x58aefb=_0x30f381[_0x9dfd('0x16')]+_0x30f381[_0x9dfd('0x17')],_0x250c15;if(_0x58aefb>=_0x116f99){_0x58aefb=_0x116f99;_0x250c15=0xc8;}else{_0x250c15=0xce;}_0x35d19c[_0x9dfd('0x13')](_0x250c15);return _0x35d19c[_0x9dfd('0x18')]('Content-Range',_0x11b5a1+'-'+_0x58aefb+'/'+_0x116f99)[_0x9dfd('0x14')](_0x278c4a);}return null;};}function patchUpdates(_0x2d3a5a){return function(_0x6bc3d9){try{jsonpatch[_0x9dfd('0x19')](_0x6bc3d9,_0x2d3a5a,!![]);}catch(_0x3940b5){return BPromise[_0x9dfd('0x1a')](_0x3940b5);}return _0x6bc3d9[_0x9dfd('0x1b')]();};}function saveUpdates(_0x64219f,_0x47a389){return function(_0x1ca937){if(_0x1ca937){return _0x1ca937[_0x9dfd('0x1c')](_0x64219f)['then'](function(_0x49bba6){return _0x49bba6;});}return null;};}function removeEntity(_0x4698a2,_0x18fcbe){return function(_0x17d8be){if(_0x17d8be){return _0x17d8be[_0x9dfd('0x1d')]()[_0x9dfd('0x1e')](function(){var _0x34bad6=_0x17d8be['get']({'plain':!![]});var _0x3af853=_0x9dfd('0x1f');return db[_0x9dfd('0x20')][_0x9dfd('0x1d')]({'where':{'type':_0x3af853,'resourceId':_0x34bad6['id']}})['then'](function(){return _0x17d8be;});})[_0x9dfd('0x1e')](function(){_0x4698a2['status'](0xcc)[_0x9dfd('0x21')]();});}};}function handleEntityNotFound(_0x3637e5,_0x4cbf19){return function(_0x32cba0){if(!_0x32cba0){_0x3637e5[_0x9dfd('0x22')](0x194);}return _0x32cba0;};}function handleError(_0x11cab4,_0x522544){_0x522544=_0x522544||0x1f4;return function(_0x55ff30){logger['error'](_0x55ff30[_0x9dfd('0x23')]);if(_0x55ff30['name']){delete _0x55ff30[_0x9dfd('0x24')];}_0x11cab4[_0x9dfd('0x13')](_0x522544)[_0x9dfd('0x25')](_0x55ff30);};}exports[_0x9dfd('0x26')]=function(_0x1fc1d4,_0x4f7ea9){var _0x52ebb8={},_0x3c75f5={},_0x19fea7={'count':0x0,'rows':[]};var _0x5bd876=db[_0x9dfd('0x27')][_0x9dfd('0x28')];_0x3c75f5['model']=_[_0x9dfd('0x29')](_0x5bd876);_0x3c75f5['query']=_[_0x9dfd('0x29')](_0x1fc1d4['query']);_0x3c75f5[_0x9dfd('0x2a')]=_['intersection'](_0x3c75f5['model'],_0x3c75f5[_0x9dfd('0x2b')]);_0x52ebb8[_0x9dfd('0x2c')]=_['intersection'](_0x3c75f5[_0x9dfd('0x2d')],qs[_0x9dfd('0x2e')](_0x1fc1d4[_0x9dfd('0x2b')][_0x9dfd('0x2e')]));_0x52ebb8[_0x9dfd('0x2c')]=_0x52ebb8[_0x9dfd('0x2c')][_0x9dfd('0x2f')]?_0x52ebb8['attributes']:_0x3c75f5['model'];if(!_0x1fc1d4[_0x9dfd('0x2b')][_0x9dfd('0x30')](_0x9dfd('0x31'))){_0x52ebb8[_0x9dfd('0x17')]=qs['limit'](_0x1fc1d4[_0x9dfd('0x2b')]['limit']);_0x52ebb8[_0x9dfd('0x16')]=qs[_0x9dfd('0x16')](_0x1fc1d4[_0x9dfd('0x2b')][_0x9dfd('0x16')]);}_0x52ebb8[_0x9dfd('0x32')]=qs[_0x9dfd('0x33')](_0x1fc1d4[_0x9dfd('0x2b')]['sort']);_0x52ebb8[_0x9dfd('0x34')]=qs['filters'](_[_0x9dfd('0x35')](_0x1fc1d4[_0x9dfd('0x2b')],_0x3c75f5[_0x9dfd('0x2a')]));if(_0x1fc1d4[_0x9dfd('0x2b')][_0x9dfd('0x36')]){_0x52ebb8[_0x9dfd('0x34')]=_[_0x9dfd('0x37')](_0x52ebb8[_0x9dfd('0x34')],{'$or':_[_0x9dfd('0x38')](_0x5bd876,function(_0x55fc12){if(_0x55fc12[_0x9dfd('0x39')][_0x9dfd('0x3a')]!==_0x9dfd('0x3b')){var _0x1c61d9={};_0x1c61d9[_0x55fc12[_0x9dfd('0x3c')]]={'$like':'%'+_0x1fc1d4[_0x9dfd('0x2b')]['filter']+'%'};return _0x1c61d9;}})});}_0x52ebb8=_[_0x9dfd('0x37')]({},_0x52ebb8,_0x1fc1d4[_0x9dfd('0x3d')]);var _0x3994a6={'where':_0x52ebb8['where']};return db[_0x9dfd('0x27')][_0x9dfd('0x15')](_0x3994a6)[_0x9dfd('0x1e')](function(_0x390581){_0x19fea7[_0x9dfd('0x15')]=_0x390581;if(_0x1fc1d4[_0x9dfd('0x2b')][_0x9dfd('0x3e')]){_0x52ebb8[_0x9dfd('0x3f')]=[{'all':!![]}];}return db[_0x9dfd('0x27')][_0x9dfd('0x40')](_0x52ebb8);})[_0x9dfd('0x1e')](function(_0x19f3bc){_0x19fea7[_0x9dfd('0x41')]=_0x19f3bc;return _0x19fea7;})[_0x9dfd('0x1e')](respondWithFilteredResult(_0x4f7ea9,_0x52ebb8))[_0x9dfd('0x42')](handleError(_0x4f7ea9,null));};exports[_0x9dfd('0x43')]=function(_0x3b5862,_0x898411){var _0x118c4d={'raw':![],'where':{'id':_0x3b5862[_0x9dfd('0x44')]['id']}},_0x5f3833={};_0x5f3833[_0x9dfd('0x2d')]=_['keys'](db[_0x9dfd('0x27')][_0x9dfd('0x28')]);_0x5f3833['query']=_['keys'](_0x3b5862['query']);_0x5f3833['filters']=_['intersection'](_0x5f3833[_0x9dfd('0x2d')],_0x5f3833[_0x9dfd('0x2b')]);_0x118c4d['attributes']=_[_0x9dfd('0x45')](_0x5f3833['model'],qs['fields'](_0x3b5862[_0x9dfd('0x2b')][_0x9dfd('0x2e')]));_0x118c4d['attributes']=_0x118c4d[_0x9dfd('0x2c')][_0x9dfd('0x2f')]?_0x118c4d[_0x9dfd('0x2c')]:_0x5f3833[_0x9dfd('0x2d')];if(_0x3b5862[_0x9dfd('0x2b')]['includeAll']){_0x118c4d[_0x9dfd('0x3f')]=[{'all':!![]}];}_0x118c4d=_[_0x9dfd('0x37')]({},_0x118c4d,_0x3b5862[_0x9dfd('0x3d')]);return db[_0x9dfd('0x27')][_0x9dfd('0x46')](_0x118c4d)['then'](handleEntityNotFound(_0x898411,null))[_0x9dfd('0x1e')](respondWithResult(_0x898411,null))[_0x9dfd('0x42')](handleError(_0x898411,null));};exports['create']=function(_0xeae77b,_0x1c328d){return db['VoiceChanSpy'][_0x9dfd('0x47')](_0xeae77b['body'],{})['then'](function(_0x50000a){var _0x124d51=_0xeae77b[_0x9dfd('0x48')][_0x9dfd('0x49')]({'plain':!![]});if(!_0x124d51)throw new Error(_0x9dfd('0x4a'));if(_0x124d51['role']===_0x9dfd('0x48')){var _0x4f5db1=_0x50000a['get']({'plain':!![]});var _0x46f7fe='ChanSpies';return db['UserProfileSection']['find']({'where':{'name':_0x46f7fe,'userProfileId':_0x124d51[_0x9dfd('0x4b')]},'raw':!![]})[_0x9dfd('0x1e')](function(_0xe7604b){if(_0xe7604b&&_0xe7604b['autoAssociation']===0x0){return db['UserProfileResource'][_0x9dfd('0x47')]({'name':_0x4f5db1[_0x9dfd('0x24')],'resourceId':_0x4f5db1['id'],'type':_0xe7604b[_0x9dfd('0x24')],'sectionId':_0xe7604b['id']},{})[_0x9dfd('0x1e')](function(){return _0x50000a;});}else{return _0x50000a;}})[_0x9dfd('0x42')](function(_0x5ca4d6){logger[_0x9dfd('0x4c')](_0x9dfd('0x4d'),_0x5ca4d6);throw _0x5ca4d6;});}return _0x50000a;})[_0x9dfd('0x1e')](respondWithResult(_0x1c328d,0xc9))[_0x9dfd('0x42')](handleError(_0x1c328d,null));};exports[_0x9dfd('0x1c')]=function(_0x5de3ec,_0x26f7e5){if(_0x5de3ec[_0x9dfd('0x4e')]['id']){delete _0x5de3ec[_0x9dfd('0x4e')]['id'];}return db[_0x9dfd('0x27')]['find']({'where':{'id':_0x5de3ec[_0x9dfd('0x44')]['id']}})[_0x9dfd('0x1e')](handleEntityNotFound(_0x26f7e5,null))[_0x9dfd('0x1e')](saveUpdates(_0x5de3ec['body'],null))[_0x9dfd('0x1e')](respondWithResult(_0x26f7e5,null))[_0x9dfd('0x42')](handleError(_0x26f7e5,null));};exports[_0x9dfd('0x1d')]=function(_0x54e5aa,_0x56f140){return db[_0x9dfd('0x27')]['find']({'where':{'id':_0x54e5aa[_0x9dfd('0x44')]['id']}})[_0x9dfd('0x1e')](handleEntityNotFound(_0x56f140,null))[_0x9dfd('0x1e')](removeEntity(_0x56f140,null))[_0x9dfd('0x42')](handleError(_0x56f140,null));}; \ No newline at end of file +var _0xf900=['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','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','index','VoiceChanSpy','rawAttributes','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','intersection','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation'];(function(_0x513d29,_0x375093){var _0x5ce2e2=function(_0x55ccd5){while(--_0x55ccd5){_0x513d29['push'](_0x513d29['shift']());}};_0x5ce2e2(++_0x375093);}(_0xf900,0x106));var _0x0f90=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf900[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0x0f90('0x0'));var emlformat=require(_0x0f90('0x1'));var rimraf=require(_0x0f90('0x2'));var zipdir=require(_0x0f90('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f90('0x4'));var moment=require(_0x0f90('0x5'));var BPromise=require(_0x0f90('0x6'));var Mustache=require(_0x0f90('0x7'));var util=require('util');var path=require(_0x0f90('0x8'));var sox=require(_0x0f90('0x9'));var csv=require('to-csv');var ejs=require(_0x0f90('0xa'));var fs=require('fs');var _=require(_0x0f90('0xb'));var squel=require(_0x0f90('0xc'));var crypto=require(_0x0f90('0xd'));var jsforce=require(_0x0f90('0xe'));var deskjs=require(_0x0f90('0xf'));var toCsv=require(_0x0f90('0x10'));var querystring=require(_0x0f90('0x11'));var Papa=require('papaparse');var Redis=require(_0x0f90('0x12'));var authService=require(_0x0f90('0x13'));var qs=require(_0x0f90('0x14'));var hardwareService=require(_0x0f90('0x15'));var logger=require(_0x0f90('0x16'))(_0x0f90('0x17'));var utils=require('../../config/utils');var config=require(_0x0f90('0x18'));var db=require(_0x0f90('0x19'))['db'];function respondWithStatusCode(_0x1b1a8c,_0x37f079){_0x37f079=_0x37f079||0xcc;return function(_0x11d2ce){if(_0x11d2ce){return _0x1b1a8c[_0x0f90('0x1a')](_0x37f079);}return _0x1b1a8c[_0x0f90('0x1b')](_0x37f079)[_0x0f90('0x1c')]();};}function respondWithResult(_0x1f3106,_0x569ca3){_0x569ca3=_0x569ca3||0xc8;return function(_0x5a922d){if(_0x5a922d){return _0x1f3106[_0x0f90('0x1b')](_0x569ca3)[_0x0f90('0x1d')](_0x5a922d);}};}function respondWithFilteredResult(_0x3d2122,_0x4e1056){return function(_0x4d36d1){if(_0x4d36d1){var _0xb1288d=_0x4d36d1[_0x0f90('0x1e')],_0x359eda=_0x4e1056[_0x0f90('0x1f')],_0x33d71d=_0x4e1056['offset']+_0x4e1056['limit'],_0x48c493;if(_0x33d71d>=_0xb1288d){_0x33d71d=_0xb1288d;_0x48c493=0xc8;}else{_0x48c493=0xce;}_0x3d2122['status'](_0x48c493);return _0x3d2122['set']('Content-Range',_0x359eda+'-'+_0x33d71d+'/'+_0xb1288d)['json'](_0x4d36d1);}return null;};}function patchUpdates(_0x493042){return function(_0x18b798){try{jsonpatch[_0x0f90('0x20')](_0x18b798,_0x493042,!![]);}catch(_0x2c5a52){return BPromise[_0x0f90('0x21')](_0x2c5a52);}return _0x18b798[_0x0f90('0x22')]();};}function saveUpdates(_0x261a3c,_0x4dcf99){return function(_0x535e19){if(_0x535e19){return _0x535e19[_0x0f90('0x23')](_0x261a3c)[_0x0f90('0x24')](function(_0x19b59d){return _0x19b59d;});}return null;};}function removeEntity(_0xf713a5,_0x10279){return function(_0x465896){if(_0x465896){return _0x465896[_0x0f90('0x25')]()['then'](function(){var _0x3581b0=_0x465896[_0x0f90('0x26')]({'plain':!![]});var _0x10b692=_0x0f90('0x27');return db[_0x0f90('0x28')]['destroy']({'where':{'type':_0x10b692,'resourceId':_0x3581b0['id']}})[_0x0f90('0x24')](function(){return _0x465896;});})[_0x0f90('0x24')](function(){_0xf713a5['status'](0xcc)[_0x0f90('0x1c')]();});}};}function handleEntityNotFound(_0x524c9a,_0x40d2f5){return function(_0x460497){if(!_0x460497){_0x524c9a[_0x0f90('0x1a')](0x194);}return _0x460497;};}function handleError(_0x3dfd08,_0x4ec4d2){_0x4ec4d2=_0x4ec4d2||0x1f4;return function(_0x16c6ac){logger[_0x0f90('0x29')](_0x16c6ac[_0x0f90('0x2a')]);if(_0x16c6ac[_0x0f90('0x2b')]){delete _0x16c6ac[_0x0f90('0x2b')];}_0x3dfd08['status'](_0x4ec4d2)[_0x0f90('0x2c')](_0x16c6ac);};}exports[_0x0f90('0x2d')]=function(_0x2d0fc3,_0x1075f2){var _0x4675a7={},_0x553da0={},_0x14c4d6={'count':0x0,'rows':[]};var _0x1d09cc=db[_0x0f90('0x2e')][_0x0f90('0x2f')];_0x553da0[_0x0f90('0x30')]=_[_0x0f90('0x31')](_0x1d09cc);_0x553da0[_0x0f90('0x32')]=_['keys'](_0x2d0fc3[_0x0f90('0x32')]);_0x553da0[_0x0f90('0x33')]=_['intersection'](_0x553da0[_0x0f90('0x30')],_0x553da0[_0x0f90('0x32')]);_0x4675a7[_0x0f90('0x34')]=_['intersection'](_0x553da0[_0x0f90('0x30')],qs[_0x0f90('0x35')](_0x2d0fc3[_0x0f90('0x32')][_0x0f90('0x35')]));_0x4675a7[_0x0f90('0x34')]=_0x4675a7[_0x0f90('0x34')]['length']?_0x4675a7[_0x0f90('0x34')]:_0x553da0['model'];if(!_0x2d0fc3[_0x0f90('0x32')][_0x0f90('0x36')](_0x0f90('0x37'))){_0x4675a7['limit']=qs[_0x0f90('0x38')](_0x2d0fc3[_0x0f90('0x32')][_0x0f90('0x38')]);_0x4675a7[_0x0f90('0x1f')]=qs['offset'](_0x2d0fc3[_0x0f90('0x32')][_0x0f90('0x1f')]);}_0x4675a7[_0x0f90('0x39')]=qs['sort'](_0x2d0fc3[_0x0f90('0x32')][_0x0f90('0x3a')]);_0x4675a7[_0x0f90('0x3b')]=qs['filters'](_[_0x0f90('0x3c')](_0x2d0fc3['query'],_0x553da0[_0x0f90('0x33')]));if(_0x2d0fc3[_0x0f90('0x32')][_0x0f90('0x3d')]){_0x4675a7['where']=_[_0x0f90('0x3e')](_0x4675a7['where'],{'$or':_['map'](_0x1d09cc,function(_0x4d5b26){if(_0x4d5b26[_0x0f90('0x3f')][_0x0f90('0x40')]!==_0x0f90('0x41')){var _0x1e3498={};_0x1e3498[_0x4d5b26[_0x0f90('0x42')]]={'$like':'%'+_0x2d0fc3[_0x0f90('0x32')][_0x0f90('0x3d')]+'%'};return _0x1e3498;}})});}_0x4675a7=_[_0x0f90('0x3e')]({},_0x4675a7,_0x2d0fc3[_0x0f90('0x43')]);var _0x187c69={'where':_0x4675a7['where']};return db['VoiceChanSpy'][_0x0f90('0x1e')](_0x187c69)[_0x0f90('0x24')](function(_0x1da64c){_0x14c4d6['count']=_0x1da64c;if(_0x2d0fc3[_0x0f90('0x32')][_0x0f90('0x44')]){_0x4675a7[_0x0f90('0x45')]=[{'all':!![]}];}return db[_0x0f90('0x2e')][_0x0f90('0x46')](_0x4675a7);})['then'](function(_0x4e7e49){_0x14c4d6[_0x0f90('0x47')]=_0x4e7e49;return _0x14c4d6;})[_0x0f90('0x24')](respondWithFilteredResult(_0x1075f2,_0x4675a7))[_0x0f90('0x48')](handleError(_0x1075f2,null));};exports[_0x0f90('0x49')]=function(_0x4ced13,_0x27453e){var _0x560a02={'raw':![],'where':{'id':_0x4ced13[_0x0f90('0x4a')]['id']}},_0x7c960f={};_0x7c960f[_0x0f90('0x30')]=_[_0x0f90('0x31')](db[_0x0f90('0x2e')][_0x0f90('0x2f')]);_0x7c960f[_0x0f90('0x32')]=_[_0x0f90('0x31')](_0x4ced13[_0x0f90('0x32')]);_0x7c960f[_0x0f90('0x33')]=_[_0x0f90('0x4b')](_0x7c960f[_0x0f90('0x30')],_0x7c960f[_0x0f90('0x32')]);_0x560a02['attributes']=_[_0x0f90('0x4b')](_0x7c960f[_0x0f90('0x30')],qs[_0x0f90('0x35')](_0x4ced13[_0x0f90('0x32')][_0x0f90('0x35')]));_0x560a02[_0x0f90('0x34')]=_0x560a02[_0x0f90('0x34')][_0x0f90('0x4c')]?_0x560a02[_0x0f90('0x34')]:_0x7c960f['model'];if(_0x4ced13['query'][_0x0f90('0x44')]){_0x560a02[_0x0f90('0x45')]=[{'all':!![]}];}_0x560a02=_[_0x0f90('0x3e')]({},_0x560a02,_0x4ced13[_0x0f90('0x43')]);return db[_0x0f90('0x2e')][_0x0f90('0x4d')](_0x560a02)[_0x0f90('0x24')](handleEntityNotFound(_0x27453e,null))[_0x0f90('0x24')](respondWithResult(_0x27453e,null))[_0x0f90('0x48')](handleError(_0x27453e,null));};exports[_0x0f90('0x4e')]=function(_0x240b82,_0x37f675){return db[_0x0f90('0x2e')][_0x0f90('0x4e')](_0x240b82[_0x0f90('0x4f')],{})[_0x0f90('0x24')](function(_0x4f7a81){var _0x102c10=_0x240b82['user'][_0x0f90('0x26')]({'plain':!![]});if(!_0x102c10)throw new Error(_0x0f90('0x50'));if(_0x102c10[_0x0f90('0x51')]===_0x0f90('0x52')){var _0x9269b4=_0x4f7a81[_0x0f90('0x26')]({'plain':!![]});var _0x5b20df=_0x0f90('0x27');return db[_0x0f90('0x53')][_0x0f90('0x4d')]({'where':{'name':_0x5b20df,'userProfileId':_0x102c10[_0x0f90('0x54')]},'raw':!![]})[_0x0f90('0x24')](function(_0x4ee381){if(_0x4ee381&&_0x4ee381[_0x0f90('0x55')]===0x0){return db[_0x0f90('0x28')][_0x0f90('0x4e')]({'name':_0x9269b4[_0x0f90('0x2b')],'resourceId':_0x9269b4['id'],'type':_0x4ee381['name'],'sectionId':_0x4ee381['id']},{})[_0x0f90('0x24')](function(){return _0x4f7a81;});}else{return _0x4f7a81;}})['catch'](function(_0x10e282){logger['error'](_0x0f90('0x56'),_0x10e282);throw _0x10e282;});}return _0x4f7a81;})['then'](respondWithResult(_0x37f675,0xc9))[_0x0f90('0x48')](handleError(_0x37f675,null));};exports[_0x0f90('0x23')]=function(_0x23f751,_0x854294){if(_0x23f751[_0x0f90('0x4f')]['id']){delete _0x23f751[_0x0f90('0x4f')]['id'];}return db[_0x0f90('0x2e')][_0x0f90('0x4d')]({'where':{'id':_0x23f751[_0x0f90('0x4a')]['id']}})[_0x0f90('0x24')](handleEntityNotFound(_0x854294,null))[_0x0f90('0x24')](saveUpdates(_0x23f751[_0x0f90('0x4f')],null))['then'](respondWithResult(_0x854294,null))['catch'](handleError(_0x854294,null));};exports[_0x0f90('0x25')]=function(_0x2e639b,_0x56ecda){return db[_0x0f90('0x2e')]['find']({'where':{'id':_0x2e639b['params']['id']}})[_0x0f90('0x24')](handleEntityNotFound(_0x56ecda,null))['then'](removeEntity(_0x56ecda,null))[_0x0f90('0x48')](handleError(_0x56ecda,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 95ab61d..d6c3560 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 _0x94b6=['findAll','agent','then','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','catch','destroy','lodash','util','./voiceChanSpy.attributes','from-sip','format','%s%s','prefix','system','push','Set','chanspy','record','merge','MixMonitor','${UNIQUEID}.%s,ab','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User'];(function(_0x4d934b,_0x52f8e9){var _0xc0338b=function(_0x1a356c){while(--_0x1a356c){_0x4d934b['push'](_0x4d934b['shift']());}};_0xc0338b(++_0x52f8e9);}(_0x94b6,0x143));var _0x694b=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x94b6[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x694b('0x0'));var util=require(_0x694b('0x1'));var BPromise=require('bluebird');var attributes=require(_0x694b('0x2'));var getUserApplications=function(_0x29bdbb,_0x22f97c,_0x9ef8ac){var _0x30724c=0x1;var _0x62dfe7=[];var _0x22126c={'context':_0x22f97c['context']||_0x694b('0x3'),'exten':util[_0x694b('0x4')](_0x694b('0x5'),_0x29bdbb[_0x694b('0x6')],_0x9ef8ac),'type':_0x694b('0x7'),'isApp':![],'ChanSpyId':_0x29bdbb['id'],'UserId':_0x22f97c['id']};_0x62dfe7[_0x694b('0x8')](_['merge']({'app':_0x694b('0x9'),'appdata':util['format']('CDR(type)=%s',_0x694b('0xa')),'priority':_0x30724c++},_0x22126c));if(_0x29bdbb[_0x694b('0xb')]){_0x62dfe7[_0x694b('0x8')](_[_0x694b('0xc')]({'app':_0x694b('0xd'),'appdata':util[_0x694b('0x4')](_0x694b('0xe'),_0x29bdbb['recordingFormat']),'priority':_0x30724c++},_0x22126c));}if(_0x29bdbb[_0x694b('0xf')]){_0x62dfe7[_0x694b('0x8')](_[_0x694b('0xc')]({'app':_0x694b('0x10'),'appdata':_0x29bdbb[_0x694b('0x11')],'priority':_0x30724c++},_0x22126c));}_0x62dfe7['push'](_[_0x694b('0xc')]({'app':_0x694b('0x12'),'appdata':util[_0x694b('0x4')](_0x694b('0x13'),_0x22f97c[_0x694b('0x14')],_0x29bdbb[_0x694b('0x15')]?_0x29bdbb[_0x694b('0x15')][_0x694b('0x16')](''):''),'priority':_0x30724c++},_0x22126c));if(_0x29bdbb[_0x694b('0xb')]){_0x62dfe7[_0x694b('0x8')](_[_0x694b('0xc')]({'app':_0x694b('0x17'),'priority':_0x30724c++},_0x22126c));}return _0x62dfe7;};var getChanSpyApplications=function(_0x199b16,_0x569d10){var _0x4994f1=[];for(var _0x42915c=0x0,_0x45643c=0x1;_0x42915c<_0x569d10[_0x694b('0x18')];_0x42915c++,_0x45643c=0x1){_0x4994f1=_0x4994f1[_0x694b('0x19')](getUserApplications(_0x199b16,_0x569d10[_0x42915c],_0x569d10[_0x42915c][_0x694b('0x1a')]));if(_0x569d10[_0x42915c][_0x694b('0x1a')]!=_0x569d10[_0x42915c][_0x694b('0x14')]){_0x4994f1=_0x4994f1['concat'](getUserApplications(_0x199b16,_0x569d10[_0x42915c],_0x569d10[_0x42915c][_0x694b('0x14')]));}}return _0x4994f1;};var getChanSpyPromise=function(_0x4a122c,_0x3121da){return new BPromise(function(_0xb76ced,_0x599bb2){return _0x4a122c[_0x694b('0x1b')][_0x694b('0x1c')]({'attributes':['id','name','internal'],'where':{'role':_0x694b('0x1d'),'chanspy':!![]},'raw':!![]})[_0x694b('0x1e')](function(_0x39d434){if(_0x39d434){return _0xb76ced(getChanSpyApplications(_0x3121da,_0x39d434));}return _0xb76ced([]);})['catch'](function(_0x332362){_0x599bb2(_0x332362);});});};module['exports']=function(_0x17b9d0,_0x4dc9fc){var _0x21b2e2=_0x17b9d0[_0x694b('0x1f')];return _0x17b9d0[_0x694b('0x20')](_0x694b('0x21'),attributes,{'tableName':_0x694b('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a66f5,_0x4f7dc0,_0x53cb01){return getChanSpyPromise(_0x21b2e2,_0x1a66f5)[_0x694b('0x1e')](function(_0x414c20){if(_0x414c20&&_0x414c20[_0x694b('0x18')]){return _0x21b2e2[_0x694b('0x23')][_0x694b('0x24')](_0x414c20);}})[_0x694b('0x1e')](function(){_0x53cb01();})[_0x694b('0x25')](function(_0x31e2cd){_0x53cb01(_0x31e2cd);});},'afterUpdate':function(_0x33d296,_0x49a0c4,_0x1dd3cf){return _0x21b2e2[_0x694b('0x23')][_0x694b('0x26')]({'where':{'ChanSpyId':_0x33d296['id']}})['then'](function(){return getChanSpyPromise(_0x21b2e2,_0x33d296);})['then'](function(_0x1b127c){if(_0x1b127c&&_0x1b127c[_0x694b('0x18')]){return _0x21b2e2[_0x694b('0x23')]['bulkCreate'](_0x1b127c);}})[_0x694b('0x1e')](function(){_0x1dd3cf();})[_0x694b('0x25')](function(_0x177e93){_0x1dd3cf(_0x177e93);});},'afterDestroy':function(_0x5439ef,_0x2a138a,_0x246f86){return _0x21b2e2[_0x694b('0x23')]['destroy']({'where':{'ChanSpyId':_0x5439ef['id']}})[_0x694b('0x1e')](function(){_0x246f86();})[_0x694b('0x25')](function(_0x3ed148){_0x246f86(_0x3ed148);});}}});}; \ No newline at end of file +var _0x4de5=['internal','User','agent','then','exports','models','define','VoiceChanSpy','VoiceExtension','catch','destroy','bulkCreate','util','./voiceChanSpy.attributes','context','from-sip','%s%s','system','push','merge','Set','format','CDR(type)=%s','chanspy','record','MixMonitor','recordingFormat','auth','ChanSpy','SIP/%s,%s','name','options','join','length','concat'];(function(_0x44852a,_0xcbca83){var _0x4fd4a0=function(_0xdc8e6e){while(--_0xdc8e6e){_0x44852a['push'](_0x44852a['shift']());}};_0x4fd4a0(++_0xcbca83);}(_0x4de5,0xbb));var _0x54de=function(_0x4cd1d5,_0x52ffa0){_0x4cd1d5=_0x4cd1d5-0x0;var _0x48958b=_0x4de5[_0x4cd1d5];return _0x48958b;};'use strict';var _=require('lodash');var util=require(_0x54de('0x0'));var BPromise=require('bluebird');var attributes=require(_0x54de('0x1'));var getUserApplications=function(_0x2a88a2,_0x3231e5,_0x17be80){var _0xb2afaf=0x1;var _0x37d37e=[];var _0x356ff6={'context':_0x3231e5[_0x54de('0x2')]||_0x54de('0x3'),'exten':util['format'](_0x54de('0x4'),_0x2a88a2['prefix'],_0x17be80),'type':_0x54de('0x5'),'isApp':![],'ChanSpyId':_0x2a88a2['id'],'UserId':_0x3231e5['id']};_0x37d37e[_0x54de('0x6')](_[_0x54de('0x7')]({'app':_0x54de('0x8'),'appdata':util[_0x54de('0x9')](_0x54de('0xa'),_0x54de('0xb')),'priority':_0xb2afaf++},_0x356ff6));if(_0x2a88a2[_0x54de('0xc')]){_0x37d37e[_0x54de('0x6')](_[_0x54de('0x7')]({'app':_0x54de('0xd'),'appdata':util[_0x54de('0x9')]('${UNIQUEID}.%s,ab',_0x2a88a2[_0x54de('0xe')]),'priority':_0xb2afaf++},_0x356ff6));}if(_0x2a88a2[_0x54de('0xf')]){_0x37d37e[_0x54de('0x6')](_[_0x54de('0x7')]({'app':'Authenticate','appdata':_0x2a88a2['password'],'priority':_0xb2afaf++},_0x356ff6));}_0x37d37e['push'](_[_0x54de('0x7')]({'app':_0x54de('0x10'),'appdata':util[_0x54de('0x9')](_0x54de('0x11'),_0x3231e5[_0x54de('0x12')],_0x2a88a2['options']?_0x2a88a2[_0x54de('0x13')][_0x54de('0x14')](''):''),'priority':_0xb2afaf++},_0x356ff6));if(_0x2a88a2[_0x54de('0xc')]){_0x37d37e[_0x54de('0x6')](_['merge']({'app':'StopMixMonitor','priority':_0xb2afaf++},_0x356ff6));}return _0x37d37e;};var getChanSpyApplications=function(_0x13884c,_0x4e1d23){var _0x3be6df=[];for(var _0x4f7c7d=0x0,_0x307fc9=0x1;_0x4f7c7d<_0x4e1d23[_0x54de('0x15')];_0x4f7c7d++,_0x307fc9=0x1){_0x3be6df=_0x3be6df[_0x54de('0x16')](getUserApplications(_0x13884c,_0x4e1d23[_0x4f7c7d],_0x4e1d23[_0x4f7c7d][_0x54de('0x17')]));if(_0x4e1d23[_0x4f7c7d]['internal']!=_0x4e1d23[_0x4f7c7d][_0x54de('0x12')]){_0x3be6df=_0x3be6df[_0x54de('0x16')](getUserApplications(_0x13884c,_0x4e1d23[_0x4f7c7d],_0x4e1d23[_0x4f7c7d][_0x54de('0x12')]));}}return _0x3be6df;};var getChanSpyPromise=function(_0x526572,_0x31d7e8){return new BPromise(function(_0x3fadd7,_0x47f051){return _0x526572[_0x54de('0x18')]['findAll']({'attributes':['id','name',_0x54de('0x17')],'where':{'role':_0x54de('0x19'),'chanspy':!![]},'raw':!![]})[_0x54de('0x1a')](function(_0x50f628){if(_0x50f628){return _0x3fadd7(getChanSpyApplications(_0x31d7e8,_0x50f628));}return _0x3fadd7([]);})['catch'](function(_0x5af2e3){_0x47f051(_0x5af2e3);});});};module[_0x54de('0x1b')]=function(_0x2b02e6,_0x4cf489){var _0xa9defe=_0x2b02e6[_0x54de('0x1c')];return _0x2b02e6[_0x54de('0x1d')](_0x54de('0x1e'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4275a9,_0x5ed452,_0x295a8f){return getChanSpyPromise(_0xa9defe,_0x4275a9)[_0x54de('0x1a')](function(_0x1bfeb8){if(_0x1bfeb8&&_0x1bfeb8[_0x54de('0x15')]){return _0xa9defe[_0x54de('0x1f')]['bulkCreate'](_0x1bfeb8);}})['then'](function(){_0x295a8f();})[_0x54de('0x20')](function(_0x369a10){_0x295a8f(_0x369a10);});},'afterUpdate':function(_0x3715ce,_0x4f3790,_0x49d1fc){return _0xa9defe[_0x54de('0x1f')][_0x54de('0x21')]({'where':{'ChanSpyId':_0x3715ce['id']}})[_0x54de('0x1a')](function(){return getChanSpyPromise(_0xa9defe,_0x3715ce);})[_0x54de('0x1a')](function(_0x195f50){if(_0x195f50&&_0x195f50[_0x54de('0x15')]){return _0xa9defe['VoiceExtension'][_0x54de('0x22')](_0x195f50);}})['then'](function(){_0x49d1fc();})[_0x54de('0x20')](function(_0x3fd1b0){_0x49d1fc(_0x3fd1b0);});},'afterDestroy':function(_0x3cc323,_0x3e12d2,_0xa5f640){return _0xa9defe['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x3cc323['id']}})['then'](function(){_0xa5f640();})[_0x54de('0x20')](function(_0x1224d2){_0xa5f640(_0x1224d2);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index f014061..43a5433 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 _0xd561=['catch','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message'];(function(_0x33517b,_0x11c5f0){var _0x5ad09c=function(_0x644e9c){while(--_0x644e9c){_0x33517b['push'](_0x33517b['shift']());}};_0x5ad09c(++_0x11c5f0);}(_0xd561,0xc7));var _0x1d56=function(_0x18b926,_0x448a61){_0x18b926=_0x18b926-0x0;var _0xa877ec=_0xd561[_0x18b926];return _0xa877ec;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1d56('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d56('0x1'))['db'];var utils=require(_0x1d56('0x2'));var logger=require(_0x1d56('0x3'))('rpc');var config=require(_0x1d56('0x4'));var jayson=require(_0x1d56('0x5'));var client=jayson['client'][_0x1d56('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x33d591,_0x424e82,_0xafe63c){return new BPromise(function(_0x107b98,_0x5524f9){return client[_0x1d56('0x7')](_0x33d591,_0xafe63c)[_0x1d56('0x8')](function(_0x4c10b3){logger[_0x1d56('0x9')]('VoiceChanSpy,\x20%s,\x20%s',_0x424e82,_0x1d56('0xa'));logger['debug'](_0x1d56('0xb'),_0x424e82,_0x1d56('0xa'),JSON[_0x1d56('0xc')](_0x4c10b3));if(_0x4c10b3['error']){if(_0x4c10b3[_0x1d56('0xd')][_0x1d56('0xe')]===0x1f4){logger[_0x1d56('0xd')](_0x1d56('0xf'),_0x424e82,_0x4c10b3[_0x1d56('0xd')][_0x1d56('0x10')]);return _0x5524f9(_0x4c10b3[_0x1d56('0xd')][_0x1d56('0x10')]);}logger[_0x1d56('0xd')](_0x1d56('0xf'),_0x424e82,_0x4c10b3[_0x1d56('0xd')][_0x1d56('0x10')]);return _0x107b98(_0x4c10b3[_0x1d56('0xd')][_0x1d56('0x10')]);}else{logger[_0x1d56('0x9')]('VoiceChanSpy,\x20%s,\x20%s',_0x424e82,_0x1d56('0xa'));_0x107b98(_0x4c10b3['result']['message']);}})[_0x1d56('0x11')](function(_0x3cec3d){logger[_0x1d56('0xd')](_0x1d56('0xf'),_0x424e82,_0x3cec3d);_0x5524f9(_0x3cec3d);});});} \ No newline at end of file +var _0x8453=['../../config/environment','jayson/promise','http','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x8453,0x1f1));var _0x3845=function(_0x2ee179,_0x14cc43){_0x2ee179=_0x2ee179-0x0;var _0x4f8c67=_0x8453[_0x2ee179];return _0x4f8c67;};'use strict';var _=require(_0x3845('0x0'));var util=require(_0x3845('0x1'));var moment=require('moment');var BPromise=require(_0x3845('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3845('0x3'))['db'];var utils=require(_0x3845('0x4'));var logger=require(_0x3845('0x5'))(_0x3845('0x6'));var config=require(_0x3845('0x7'));var jayson=require(_0x3845('0x8'));var client=jayson['client'][_0x3845('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x506118,_0x32d96e,_0x5371e3){return new BPromise(function(_0x13e4e7,_0x1675d5){return client['request'](_0x506118,_0x5371e3)['then'](function(_0xf10cb3){logger[_0x3845('0xa')](_0x3845('0xb'),_0x32d96e,_0x3845('0xc'));logger[_0x3845('0xd')](_0x3845('0xe'),_0x32d96e,_0x3845('0xc'),JSON[_0x3845('0xf')](_0xf10cb3));if(_0xf10cb3[_0x3845('0x10')]){if(_0xf10cb3[_0x3845('0x10')][_0x3845('0x11')]===0x1f4){logger[_0x3845('0x10')](_0x3845('0xb'),_0x32d96e,_0xf10cb3[_0x3845('0x10')]['message']);return _0x1675d5(_0xf10cb3[_0x3845('0x10')][_0x3845('0x12')]);}logger[_0x3845('0x10')](_0x3845('0xb'),_0x32d96e,_0xf10cb3[_0x3845('0x10')][_0x3845('0x12')]);return _0x13e4e7(_0xf10cb3[_0x3845('0x10')]['message']);}else{logger[_0x3845('0xa')](_0x3845('0xb'),_0x32d96e,_0x3845('0xc'));_0x13e4e7(_0xf10cb3[_0x3845('0x13')][_0x3845('0x12')]);}})[_0x3845('0x14')](function(_0x5808dd){logger[_0x3845('0x10')](_0x3845('0xb'),_0x32d96e,_0x5808dd);_0x1675d5(_0x5808dd);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 4686ea6..5f71606 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 _0xb44a=['update','exports','path','express','../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x15d07f,_0x20b99a){var _0x41613f=function(_0xc19fd1){while(--_0xc19fd1){_0x15d07f['push'](_0x15d07f['shift']());}};_0x41613f(++_0x20b99a);}(_0xb44a,0x1c2));var _0xab44=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0xb44a[_0x291f8b];return _0x275171;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xab44('0x0'));var timeout=require('connect-timeout');var express=require(_0xab44('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xab44('0x2'));var config=require('../../config/environment');var controller=require(_0xab44('0x3'));router[_0xab44('0x4')]('/',auth[_0xab44('0x5')](),controller[_0xab44('0x6')]);router[_0xab44('0x4')](_0xab44('0x7'),auth[_0xab44('0x5')](),controller[_0xab44('0x8')]);router[_0xab44('0x9')]('/',auth[_0xab44('0x5')](),controller[_0xab44('0xa')]);router[_0xab44('0xb')](_0xab44('0x7'),auth['isAuthenticated'](),controller[_0xab44('0xc')]);router['delete'](_0xab44('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0xab44('0xd')]=router; \ No newline at end of file +var _0x9d5b=['index','show','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','./voiceContext.controller','get','isAuthenticated'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x432703,_0xbfbd68){_0x432703=_0x432703-0x0;var _0x1b8524=_0x9d5b[_0x432703];return _0x1b8524;};'use strict';var multer=require('multer');var util=require(_0xb9d5('0x0'));var path=require(_0xb9d5('0x1'));var timeout=require(_0xb9d5('0x2'));var express=require(_0xb9d5('0x3'));var router=express[_0xb9d5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb9d5('0x5'));var config=require('../../config/environment');var controller=require(_0xb9d5('0x6'));router[_0xb9d5('0x7')]('/',auth[_0xb9d5('0x8')](),controller[_0xb9d5('0x9')]);router[_0xb9d5('0x7')]('/:id',auth[_0xb9d5('0x8')](),controller[_0xb9d5('0xa')]);router['post']('/',auth[_0xb9d5('0x8')](),controller[_0xb9d5('0xb')]);router[_0xb9d5('0xc')](_0xb9d5('0xd'),auth['isAuthenticated'](),controller[_0xb9d5('0xe')]);router[_0xb9d5('0xf')]('/:id',auth[_0xb9d5('0x8')](),controller[_0xb9d5('0x10')]);module[_0xb9d5('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 790c0a6..f55cbe3 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 _0xe59e=['STRING','name','BOOLEAN','sequelize','exports'];(function(_0x315843,_0x208c05){var _0x54fe1a=function(_0x41febb){while(--_0x41febb){_0x315843['push'](_0x315843['shift']());}};_0x54fe1a(++_0x208c05);}(_0xe59e,0x1a7));var _0xee59=function(_0x15f5bd,_0x1d5d5e){_0x15f5bd=_0x15f5bd-0x0;var _0x245099=_0xe59e[_0x15f5bd];return _0x245099;};'use strict';var Sequelize=require(_0xee59('0x0'));module[_0xee59('0x1')]={'name':{'type':Sequelize[_0xee59('0x2')],'unique':_0xee59('0x3')},'description':{'type':Sequelize[_0xee59('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xee59('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2df6=['BOOLEAN','sequelize','exports','STRING','name'];(function(_0x4c7432,_0x1c4558){var _0x5c433f=function(_0xa77f76){while(--_0xa77f76){_0x4c7432['push'](_0x4c7432['shift']());}};_0x5c433f(++_0x1c4558);}(_0x2df6,0x187));var _0x62df=function(_0x520236,_0x5c8564){_0x520236=_0x520236-0x0;var _0x4d6664=_0x2df6[_0x520236];return _0x4d6664;};'use strict';var Sequelize=require(_0x62df('0x0'));module[_0x62df('0x1')]={'name':{'type':Sequelize[_0x62df('0x2')],'unique':_0x62df('0x3')},'description':{'type':Sequelize[_0x62df('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x62df('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 fed787e..6fd2712 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 _0x4211=['type','field','filter','include','findAll','show','params','options','find','create','body','readFileSync','join','root','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','role','UserProfileSection','userProfileId','autoAssociation','server/files/templates/context.ejs','writeFileSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../config/logger','api','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~!@#$%^&-_=+[{]}.','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','name','send','index','VoiceContext','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge'];(function(_0x1a547e,_0x5917d3){var _0x5ebdaf=function(_0x158b24){while(--_0x158b24){_0x1a547e['push'](_0x1a547e['shift']());}};_0x5ebdaf(++_0x5917d3);}(_0x4211,0x1f0));var _0x1421=function(_0x332d44,_0x4fa512){_0x332d44=_0x332d44-0x0;var _0x201715=_0x4211[_0x332d44];return _0x201715;};'use strict';var pdf=require(_0x1421('0x0'));var emlformat=require(_0x1421('0x1'));var rimraf=require(_0x1421('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1421('0x3'));var rp=require(_0x1421('0x4'));var moment=require('moment');var BPromise=require(_0x1421('0x5'));var Mustache=require(_0x1421('0x6'));var util=require(_0x1421('0x7'));var path=require('path');var sox=require(_0x1421('0x8'));var csv=require(_0x1421('0x9'));var ejs=require(_0x1421('0xa'));var fs=require('fs');var _=require(_0x1421('0xb'));var squel=require('squel');var crypto=require(_0x1421('0xc'));var jsforce=require(_0x1421('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1421('0x9'));var querystring=require(_0x1421('0xe'));var Papa=require(_0x1421('0xf'));var Redis=require(_0x1421('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1421('0x11'))(_0x1421('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x1421('0x13'));var client=jayson[_0x1421('0x14')][_0x1421('0x15')]({'port':0x232a});function checkPasswordPattern(_0x1568ac,_0x3d3230,_0x118781){if(_0x118781){var _0x104748=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x104748['test'](_0x3d3230)){return _0x1568ac;}else{throw new Error(_0x1421('0x16'));}}else{return _0x1568ac;}}function respondWithRpcPromise(_0x376ca4,_0x1dd0f4,_0xc74873,_0x371e90){return new BPromise(function(_0x3c3d45,_0xf139cd){var _0x1f58f6=_0x371e90||client;return _0x1f58f6[_0x1421('0x17')](_0x376ca4,_0xc74873)[_0x1421('0x18')](function(_0xef4950){logger[_0x1421('0x19')](_0x1421('0x1a'),_0x1dd0f4,_0x1421('0x1b'));logger[_0x1421('0x1c')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x1dd0f4,_0x1421('0x1b'),JSON[_0x1421('0x1d')](_0xef4950));if(_0xef4950[_0x1421('0x1e')]){if(_0xef4950[_0x1421('0x1e')]['code']===0x1f4){logger[_0x1421('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x1dd0f4,_0xef4950[_0x1421('0x1e')][_0x1421('0x1f')]);return _0xf139cd(_0xef4950['error'][_0x1421('0x1f')]);}logger['error'](_0x1421('0x1a'),_0x1dd0f4,_0xef4950[_0x1421('0x1e')][_0x1421('0x1f')]);return _0x3c3d45(_0xef4950[_0x1421('0x1e')]['message']);}else{logger[_0x1421('0x19')](_0x1421('0x1a'),_0x1dd0f4,_0x1421('0x1b'));_0x3c3d45(_0xef4950[_0x1421('0x20')][_0x1421('0x1f')]);}})[_0x1421('0x21')](function(_0xdb5ee){logger[_0x1421('0x1e')](_0x1421('0x1a'),_0x1dd0f4,_0xdb5ee);_0xf139cd(_0xdb5ee);});});}function respondWithStatusCode(_0x5a37da,_0x3fc361){_0x3fc361=_0x3fc361||0xcc;return function(_0x2828c7){if(_0x2828c7){return _0x5a37da[_0x1421('0x22')](_0x3fc361);}return _0x5a37da[_0x1421('0x23')](_0x3fc361)[_0x1421('0x24')]();};}function respondWithResult(_0x37caba,_0x134092){_0x134092=_0x134092||0xc8;return function(_0x125180){if(_0x125180){return _0x37caba[_0x1421('0x23')](_0x134092)['json'](_0x125180);}};}function respondWithFilteredResult(_0x156fab,_0x20aed7){return function(_0x431ade){if(_0x431ade){var _0x337aa6=_0x431ade[_0x1421('0x25')],_0x293f0=_0x20aed7[_0x1421('0x26')],_0x33e04a=_0x20aed7[_0x1421('0x26')]+_0x20aed7[_0x1421('0x27')],_0x3854bf;if(_0x33e04a>=_0x337aa6){_0x33e04a=_0x337aa6;_0x3854bf=0xc8;}else{_0x3854bf=0xce;}_0x156fab[_0x1421('0x23')](_0x3854bf);return _0x156fab[_0x1421('0x28')]('Content-Range',_0x293f0+'-'+_0x33e04a+'/'+_0x337aa6)[_0x1421('0x29')](_0x431ade);}return null;};}function patchUpdates(_0x1fc94b){return function(_0x3e33e2){try{jsonpatch[_0x1421('0x2a')](_0x3e33e2,_0x1fc94b,!![]);}catch(_0x5c20d3){return BPromise[_0x1421('0x2b')](_0x5c20d3);}return _0x3e33e2[_0x1421('0x2c')]();};}function saveUpdates(_0xa89453,_0x19eb0d){return function(_0x1f922a){if(_0x1f922a){return _0x1f922a[_0x1421('0x2d')](_0xa89453)['then'](function(_0x4271d9){return _0x4271d9;});}return null;};}function removeEntity(_0x5aa7bd,_0x2247a1){return function(_0x4a11ab){if(_0x4a11ab){return _0x4a11ab[_0x1421('0x2e')]()['then'](function(){var _0x45675b=_0x4a11ab[_0x1421('0x2f')]({'plain':!![]});var _0x5659a6=_0x1421('0x30');return db[_0x1421('0x31')]['destroy']({'where':{'type':_0x5659a6,'resourceId':_0x45675b['id']}})[_0x1421('0x18')](function(){return _0x4a11ab;});})[_0x1421('0x18')](function(){_0x5aa7bd[_0x1421('0x23')](0xcc)[_0x1421('0x24')]();});}};}function handleEntityNotFound(_0x20e9fa,_0x329fb6){return function(_0x1cbd91){if(!_0x1cbd91){_0x20e9fa[_0x1421('0x22')](0x194);}return _0x1cbd91;};}function handleError(_0x362e76,_0x412e17){_0x412e17=_0x412e17||0x1f4;return function(_0x2cb9d6){logger[_0x1421('0x1e')](_0x2cb9d6['stack']);if(_0x2cb9d6[_0x1421('0x32')]){delete _0x2cb9d6[_0x1421('0x32')];}_0x362e76[_0x1421('0x23')](_0x412e17)[_0x1421('0x33')](_0x2cb9d6);};}exports[_0x1421('0x34')]=function(_0x56c6af,_0x528610){var _0x493b92={},_0x286b21={},_0x47c40e={'count':0x0,'rows':[]};var _0x5db9f4=db[_0x1421('0x35')][_0x1421('0x36')];_0x286b21[_0x1421('0x37')]=_[_0x1421('0x38')](_0x5db9f4);_0x286b21['query']=_[_0x1421('0x38')](_0x56c6af[_0x1421('0x39')]);_0x286b21[_0x1421('0x3a')]=_[_0x1421('0x3b')](_0x286b21[_0x1421('0x37')],_0x286b21[_0x1421('0x39')]);_0x493b92[_0x1421('0x3c')]=_[_0x1421('0x3b')](_0x286b21['model'],qs[_0x1421('0x3d')](_0x56c6af['query'][_0x1421('0x3d')]));_0x493b92['attributes']=_0x493b92['attributes'][_0x1421('0x3e')]?_0x493b92['attributes']:_0x286b21[_0x1421('0x37')];if(!_0x56c6af[_0x1421('0x39')]['hasOwnProperty'](_0x1421('0x3f'))){_0x493b92[_0x1421('0x27')]=qs[_0x1421('0x27')](_0x56c6af[_0x1421('0x39')][_0x1421('0x27')]);_0x493b92['offset']=qs[_0x1421('0x26')](_0x56c6af['query'][_0x1421('0x26')]);}_0x493b92[_0x1421('0x40')]=qs[_0x1421('0x41')](_0x56c6af[_0x1421('0x39')][_0x1421('0x41')]);_0x493b92['where']=qs[_0x1421('0x3a')](_['pick'](_0x56c6af[_0x1421('0x39')],_0x286b21[_0x1421('0x3a')]));if(_0x56c6af[_0x1421('0x39')]['filter']){_0x493b92[_0x1421('0x42')]=_[_0x1421('0x43')](_0x493b92[_0x1421('0x42')],{'$or':_['map'](_0x5db9f4,function(_0x341195){if(_0x341195[_0x1421('0x44')]['key']!=='VIRTUAL'){var _0x48ded8={};_0x48ded8[_0x341195[_0x1421('0x45')]]={'$like':'%'+_0x56c6af[_0x1421('0x39')][_0x1421('0x46')]+'%'};return _0x48ded8;}})});}_0x493b92=_[_0x1421('0x43')]({},_0x493b92,_0x56c6af['options']);var _0x2bacc4={'where':_0x493b92[_0x1421('0x42')]};return db[_0x1421('0x35')]['count'](_0x2bacc4)[_0x1421('0x18')](function(_0x2b4160){_0x47c40e[_0x1421('0x25')]=_0x2b4160;if(_0x56c6af[_0x1421('0x39')]['includeAll']){_0x493b92[_0x1421('0x47')]=[{'all':!![]}];}return db['VoiceContext'][_0x1421('0x48')](_0x493b92);})['then'](function(_0x2185bf){_0x47c40e['rows']=_0x2185bf;return _0x47c40e;})[_0x1421('0x18')](respondWithFilteredResult(_0x528610,_0x493b92))[_0x1421('0x21')](handleError(_0x528610,null));};exports[_0x1421('0x49')]=function(_0x299839,_0x126cfb){var _0x4a6df0={'raw':![],'where':{'id':_0x299839[_0x1421('0x4a')]['id']}},_0x3ef396={};_0x3ef396['model']=_[_0x1421('0x38')](db[_0x1421('0x35')][_0x1421('0x36')]);_0x3ef396[_0x1421('0x39')]=_['keys'](_0x299839[_0x1421('0x39')]);_0x3ef396[_0x1421('0x3a')]=_[_0x1421('0x3b')](_0x3ef396[_0x1421('0x37')],_0x3ef396[_0x1421('0x39')]);_0x4a6df0[_0x1421('0x3c')]=_['intersection'](_0x3ef396['model'],qs[_0x1421('0x3d')](_0x299839[_0x1421('0x39')][_0x1421('0x3d')]));_0x4a6df0['attributes']=_0x4a6df0[_0x1421('0x3c')][_0x1421('0x3e')]?_0x4a6df0[_0x1421('0x3c')]:_0x3ef396[_0x1421('0x37')];if(_0x299839[_0x1421('0x39')]['includeAll']){_0x4a6df0[_0x1421('0x47')]=[{'all':!![]}];}_0x4a6df0=_['merge']({},_0x4a6df0,_0x299839[_0x1421('0x4b')]);return db['VoiceContext'][_0x1421('0x4c')](_0x4a6df0)[_0x1421('0x18')](handleEntityNotFound(_0x126cfb,null))[_0x1421('0x18')](respondWithResult(_0x126cfb,null))[_0x1421('0x21')](handleError(_0x126cfb,null));};exports[_0x1421('0x4d')]=function(_0x1e016f,_0x4d0f6b,_0x34d226){var _0x579292;return db[_0x1421('0x35')][_0x1421('0x4d')](_0x1e016f[_0x1421('0x4e')],{'raw':!![]})[_0x1421('0x18')](function(_0x589aa5){_0x579292=_0x589aa5;return db[_0x1421('0x35')][_0x1421('0x48')]({'raw':!![]});})[_0x1421('0x18')](function(_0x212633){var _0x340b8e=fs[_0x1421('0x4f')](path[_0x1421('0x50')](config[_0x1421('0x51')],'server/files/templates/context.ejs'),_0x1421('0x52'));var _0x5d0469=ejs[_0x1421('0x53')](_0x340b8e,{'contexts':_0x212633||[]});fs['writeFileSync'](_0x1421('0x54'),_0x5d0469);})['then'](function(){return respondWithRpcPromise(_0x1421('0x55'),_0x1421('0x4d'),{'module':_0x1421('0x56')});})[_0x1421('0x18')](function(){var _0x56f105=_0x1e016f[_0x1421('0x57')][_0x1421('0x2f')]({'plain':!![]});if(!_0x56f105)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56f105[_0x1421('0x58')]===_0x1421('0x57')){var _0x26f446=_0x579292[_0x1421('0x2f')]({'plain':!![]});return db[_0x1421('0x59')][_0x1421('0x4c')]({'where':{'name':_0x1421('0x30'),'userProfileId':_0x56f105[_0x1421('0x5a')]},'raw':!![]})['then'](function(_0xb26af2){if(_0xb26af2&&_0xb26af2[_0x1421('0x5b')]===0x0){return db[_0x1421('0x31')][_0x1421('0x4d')]({'name':_0x26f446[_0x1421('0x32')],'resourceId':_0x26f446['id'],'type':_0xb26af2[_0x1421('0x32')],'sectionId':_0xb26af2['id']},{})['then'](function(){return _0x579292;});}else{return _0x579292;}})[_0x1421('0x21')](function(_0x59868){logger[_0x1421('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59868);throw _0x59868;});}return _0x579292;})[_0x1421('0x18')](respondWithResult(_0x4d0f6b,0xc9))[_0x1421('0x21')](handleError(_0x4d0f6b,null));};exports['update']=function(_0x25320c,_0x3a6861,_0x5ea025){var _0x4e1897;return db['VoiceContext'][_0x1421('0x4c')]({'where':{'id':_0x25320c[_0x1421('0x4a')]['id']}})[_0x1421('0x18')](handleEntityNotFound(_0x3a6861,null))['then'](saveUpdates(_0x25320c[_0x1421('0x4e')],null))[_0x1421('0x18')](function(_0x4d756c){if(_0x4d756c){_0x4e1897=_0x4d756c;return db[_0x1421('0x35')][_0x1421('0x48')]({'raw':!![]});}})['then'](function(_0x3b4601){var _0x2a33a1=fs[_0x1421('0x4f')](path[_0x1421('0x50')](config[_0x1421('0x51')],_0x1421('0x5c')),_0x1421('0x52'));var _0x3facbb=ejs[_0x1421('0x53')](_0x2a33a1,{'contexts':_0x3b4601||[]});fs[_0x1421('0x5d')](_0x1421('0x54'),_0x3facbb);})[_0x1421('0x18')](function(){return respondWithRpcPromise(_0x1421('0x55'),_0x1421('0x2d'),{'module':_0x1421('0x56')});})[_0x1421('0x18')](function(){return _0x4e1897;})['then'](respondWithResult(_0x3a6861,null))[_0x1421('0x21')](handleError(_0x3a6861,null));};exports[_0x1421('0x2e')]=function(_0x78549a,_0x3b8f0e,_0x4fb2a1){var _0x357574;return db[_0x1421('0x35')]['find']({'where':{'id':_0x78549a['params']['id']}})['then'](handleEntityNotFound(_0x3b8f0e,null))[_0x1421('0x18')](removeEntity(_0x3b8f0e,null))['then'](function(){return db['VoiceContext'][_0x1421('0x48')]({'raw':!![]});})[_0x1421('0x18')](function(_0x5def9f){var _0x5a9ef7=fs[_0x1421('0x4f')](path['join'](config[_0x1421('0x51')],_0x1421('0x5c')),_0x1421('0x52'));var _0x4f207b=ejs[_0x1421('0x53')](_0x5a9ef7,{'contexts':_0x5def9f});fs['writeFileSync'](_0x1421('0x54'),_0x4f207b);return respondWithRpcPromise(_0x1421('0x55'),_0x1421('0x2e'),{'module':_0x1421('0x56')});})[_0x1421('0x21')](handleError(_0x3b8f0e,null));}; \ No newline at end of file +var _0xe323=['include','findAll','params','includeAll','options','create','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','body','chan_sip.so','readFileSync','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceContext,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','name','send','index','VoiceContext','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe323,0x7e));var _0x3e32=function(_0x32c7b9,_0x11d3ac){_0x32c7b9=_0x32c7b9-0x0;var _0x1dc7ed=_0xe323[_0x32c7b9];return _0x1dc7ed;};'use strict';var pdf=require(_0x3e32('0x0'));var emlformat=require(_0x3e32('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3e32('0x2'));var jsonpatch=require(_0x3e32('0x3'));var rp=require(_0x3e32('0x4'));var moment=require(_0x3e32('0x5'));var BPromise=require(_0x3e32('0x6'));var Mustache=require(_0x3e32('0x7'));var util=require(_0x3e32('0x8'));var path=require(_0x3e32('0x9'));var sox=require(_0x3e32('0xa'));var csv=require('to-csv');var ejs=require(_0x3e32('0xb'));var fs=require('fs');var _=require(_0x3e32('0xc'));var squel=require(_0x3e32('0xd'));var crypto=require(_0x3e32('0xe'));var jsforce=require(_0x3e32('0xf'));var deskjs=require(_0x3e32('0x10'));var toCsv=require(_0x3e32('0x11'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e32('0x12'));var authService=require(_0x3e32('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x3e32('0x14'));var logger=require('../../config/logger')(_0x3e32('0x15'));var utils=require(_0x3e32('0x16'));var config=require(_0x3e32('0x17'));var db=require(_0x3e32('0x18'))['db'];var jayson=require(_0x3e32('0x19'));var client=jayson[_0x3e32('0x1a')][_0x3e32('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x98ae75,_0x5b5002,_0x525887){if(_0x525887){var _0x563c96=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x563c96['test'](_0x5b5002)){return _0x98ae75;}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 _0x98ae75;}}function respondWithRpcPromise(_0xaafc98,_0x19c43f,_0x17cbff,_0xa458d5){return new BPromise(function(_0xcb818a,_0x3817b1){var _0x2d4ecd=_0xa458d5||client;return _0x2d4ecd[_0x3e32('0x1c')](_0xaafc98,_0x17cbff)[_0x3e32('0x1d')](function(_0x3e8f6e){logger[_0x3e32('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x19c43f,_0x3e32('0x1f'));logger['debug'](_0x3e32('0x20'),_0x19c43f,_0x3e32('0x1f'),JSON[_0x3e32('0x21')](_0x3e8f6e));if(_0x3e8f6e[_0x3e32('0x22')]){if(_0x3e8f6e['error'][_0x3e32('0x23')]===0x1f4){logger[_0x3e32('0x22')]('VoiceContext,\x20%s,\x20%s',_0x19c43f,_0x3e8f6e['error']['message']);return _0x3817b1(_0x3e8f6e[_0x3e32('0x22')][_0x3e32('0x24')]);}logger[_0x3e32('0x22')]('VoiceContext,\x20%s,\x20%s',_0x19c43f,_0x3e8f6e[_0x3e32('0x22')][_0x3e32('0x24')]);return _0xcb818a(_0x3e8f6e[_0x3e32('0x22')][_0x3e32('0x24')]);}else{logger[_0x3e32('0x1e')](_0x3e32('0x25'),_0x19c43f,_0x3e32('0x1f'));_0xcb818a(_0x3e8f6e[_0x3e32('0x26')][_0x3e32('0x24')]);}})[_0x3e32('0x27')](function(_0x1687f6){logger[_0x3e32('0x22')]('VoiceContext,\x20%s,\x20%s',_0x19c43f,_0x1687f6);_0x3817b1(_0x1687f6);});});}function respondWithStatusCode(_0x1f0773,_0x474de1){_0x474de1=_0x474de1||0xcc;return function(_0xd48c2f){if(_0xd48c2f){return _0x1f0773[_0x3e32('0x28')](_0x474de1);}return _0x1f0773[_0x3e32('0x29')](_0x474de1)[_0x3e32('0x2a')]();};}function respondWithResult(_0x2174a,_0x4fcaa8){_0x4fcaa8=_0x4fcaa8||0xc8;return function(_0x443c90){if(_0x443c90){return _0x2174a['status'](_0x4fcaa8)[_0x3e32('0x2b')](_0x443c90);}};}function respondWithFilteredResult(_0x21809c,_0x155461){return function(_0x353e15){if(_0x353e15){var _0x53efb7=_0x353e15[_0x3e32('0x2c')],_0x465001=_0x155461['offset'],_0x4bbe4e=_0x155461[_0x3e32('0x2d')]+_0x155461[_0x3e32('0x2e')],_0x3a1bd0;if(_0x4bbe4e>=_0x53efb7){_0x4bbe4e=_0x53efb7;_0x3a1bd0=0xc8;}else{_0x3a1bd0=0xce;}_0x21809c[_0x3e32('0x29')](_0x3a1bd0);return _0x21809c[_0x3e32('0x2f')](_0x3e32('0x30'),_0x465001+'-'+_0x4bbe4e+'/'+_0x53efb7)[_0x3e32('0x2b')](_0x353e15);}return null;};}function patchUpdates(_0x2116b4){return function(_0x32e4b5){try{jsonpatch[_0x3e32('0x31')](_0x32e4b5,_0x2116b4,!![]);}catch(_0x149f5f){return BPromise[_0x3e32('0x32')](_0x149f5f);}return _0x32e4b5[_0x3e32('0x33')]();};}function saveUpdates(_0x3253e0,_0x5a6c8e){return function(_0x465481){if(_0x465481){return _0x465481[_0x3e32('0x34')](_0x3253e0)['then'](function(_0x45c02a){return _0x45c02a;});}return null;};}function removeEntity(_0x5e2e23,_0x426d0f){return function(_0x5cc1c9){if(_0x5cc1c9){return _0x5cc1c9[_0x3e32('0x35')]()[_0x3e32('0x1d')](function(){var _0x4455f7=_0x5cc1c9[_0x3e32('0x36')]({'plain':!![]});var _0x5aa8ee=_0x3e32('0x37');return db[_0x3e32('0x38')][_0x3e32('0x35')]({'where':{'type':_0x5aa8ee,'resourceId':_0x4455f7['id']}})[_0x3e32('0x1d')](function(){return _0x5cc1c9;});})[_0x3e32('0x1d')](function(){_0x5e2e23['status'](0xcc)[_0x3e32('0x2a')]();});}};}function handleEntityNotFound(_0x26c413,_0x241881){return function(_0x215e81){if(!_0x215e81){_0x26c413[_0x3e32('0x28')](0x194);}return _0x215e81;};}function handleError(_0x1bba0c,_0x1695e6){_0x1695e6=_0x1695e6||0x1f4;return function(_0x347b8a){logger[_0x3e32('0x22')](_0x347b8a['stack']);if(_0x347b8a[_0x3e32('0x39')]){delete _0x347b8a[_0x3e32('0x39')];}_0x1bba0c[_0x3e32('0x29')](_0x1695e6)[_0x3e32('0x3a')](_0x347b8a);};}exports[_0x3e32('0x3b')]=function(_0x4460b9,_0x10c75e){var _0x14ec1a={},_0x23b77c={},_0x4cf81d={'count':0x0,'rows':[]};var _0x54e91d=db[_0x3e32('0x3c')][_0x3e32('0x3d')];_0x23b77c[_0x3e32('0x3e')]=_[_0x3e32('0x3f')](_0x54e91d);_0x23b77c[_0x3e32('0x40')]=_[_0x3e32('0x3f')](_0x4460b9['query']);_0x23b77c['filters']=_[_0x3e32('0x41')](_0x23b77c['model'],_0x23b77c['query']);_0x14ec1a[_0x3e32('0x42')]=_[_0x3e32('0x41')](_0x23b77c['model'],qs[_0x3e32('0x43')](_0x4460b9['query'][_0x3e32('0x43')]));_0x14ec1a[_0x3e32('0x42')]=_0x14ec1a[_0x3e32('0x42')][_0x3e32('0x44')]?_0x14ec1a['attributes']:_0x23b77c[_0x3e32('0x3e')];if(!_0x4460b9[_0x3e32('0x40')][_0x3e32('0x45')](_0x3e32('0x46'))){_0x14ec1a[_0x3e32('0x2e')]=qs[_0x3e32('0x2e')](_0x4460b9[_0x3e32('0x40')][_0x3e32('0x2e')]);_0x14ec1a['offset']=qs[_0x3e32('0x2d')](_0x4460b9[_0x3e32('0x40')]['offset']);}_0x14ec1a['order']=qs[_0x3e32('0x47')](_0x4460b9[_0x3e32('0x40')]['sort']);_0x14ec1a[_0x3e32('0x48')]=qs[_0x3e32('0x49')](_[_0x3e32('0x4a')](_0x4460b9[_0x3e32('0x40')],_0x23b77c['filters']));if(_0x4460b9[_0x3e32('0x40')][_0x3e32('0x4b')]){_0x14ec1a[_0x3e32('0x48')]=_[_0x3e32('0x4c')](_0x14ec1a['where'],{'$or':_[_0x3e32('0x4d')](_0x54e91d,function(_0x206fe6){if(_0x206fe6[_0x3e32('0x4e')][_0x3e32('0x4f')]!==_0x3e32('0x50')){var _0x556a27={};_0x556a27[_0x206fe6[_0x3e32('0x51')]]={'$like':'%'+_0x4460b9[_0x3e32('0x40')]['filter']+'%'};return _0x556a27;}})});}_0x14ec1a=_[_0x3e32('0x4c')]({},_0x14ec1a,_0x4460b9['options']);var _0xab0b7f={'where':_0x14ec1a[_0x3e32('0x48')]};return db[_0x3e32('0x3c')]['count'](_0xab0b7f)[_0x3e32('0x1d')](function(_0x48f235){_0x4cf81d[_0x3e32('0x2c')]=_0x48f235;if(_0x4460b9[_0x3e32('0x40')]['includeAll']){_0x14ec1a[_0x3e32('0x52')]=[{'all':!![]}];}return db[_0x3e32('0x3c')][_0x3e32('0x53')](_0x14ec1a);})[_0x3e32('0x1d')](function(_0x40811c){_0x4cf81d['rows']=_0x40811c;return _0x4cf81d;})[_0x3e32('0x1d')](respondWithFilteredResult(_0x10c75e,_0x14ec1a))[_0x3e32('0x27')](handleError(_0x10c75e,null));};exports['show']=function(_0x3a217c,_0x2c689b){var _0x7f011={'raw':![],'where':{'id':_0x3a217c[_0x3e32('0x54')]['id']}},_0x282378={};_0x282378['model']=_['keys'](db['VoiceContext'][_0x3e32('0x3d')]);_0x282378[_0x3e32('0x40')]=_[_0x3e32('0x3f')](_0x3a217c[_0x3e32('0x40')]);_0x282378['filters']=_[_0x3e32('0x41')](_0x282378['model'],_0x282378['query']);_0x7f011[_0x3e32('0x42')]=_[_0x3e32('0x41')](_0x282378[_0x3e32('0x3e')],qs['fields'](_0x3a217c[_0x3e32('0x40')][_0x3e32('0x43')]));_0x7f011[_0x3e32('0x42')]=_0x7f011['attributes'][_0x3e32('0x44')]?_0x7f011[_0x3e32('0x42')]:_0x282378[_0x3e32('0x3e')];if(_0x3a217c[_0x3e32('0x40')][_0x3e32('0x55')]){_0x7f011['include']=[{'all':!![]}];}_0x7f011=_[_0x3e32('0x4c')]({},_0x7f011,_0x3a217c[_0x3e32('0x56')]);return db[_0x3e32('0x3c')]['find'](_0x7f011)[_0x3e32('0x1d')](handleEntityNotFound(_0x2c689b,null))[_0x3e32('0x1d')](respondWithResult(_0x2c689b,null))['catch'](handleError(_0x2c689b,null));};exports['create']=function(_0x402d6e,_0x1759f0,_0x2ed116){var _0x21aec3;return db[_0x3e32('0x3c')][_0x3e32('0x57')](_0x402d6e['body'],{'raw':!![]})[_0x3e32('0x1d')](function(_0x2b9868){_0x21aec3=_0x2b9868;return db[_0x3e32('0x3c')][_0x3e32('0x53')]({'raw':!![]});})['then'](function(_0x38e4a8){var _0x5cb237=fs['readFileSync'](path[_0x3e32('0x58')](config[_0x3e32('0x59')],_0x3e32('0x5a')),_0x3e32('0x5b'));var _0x13feb8=ejs[_0x3e32('0x5c')](_0x5cb237,{'contexts':_0x38e4a8||[]});fs[_0x3e32('0x5d')](_0x3e32('0x5e'),_0x13feb8);})[_0x3e32('0x1d')](function(){return respondWithRpcPromise(_0x3e32('0x5f'),'create',{'module':'chan_sip.so'});})[_0x3e32('0x1d')](function(){var _0x2f7302=_0x402d6e[_0x3e32('0x60')][_0x3e32('0x36')]({'plain':!![]});if(!_0x2f7302)throw new Error(_0x3e32('0x61'));if(_0x2f7302['role']===_0x3e32('0x60')){var _0xe9d54=_0x21aec3['get']({'plain':!![]});return db[_0x3e32('0x62')][_0x3e32('0x63')]({'where':{'name':_0x3e32('0x37'),'userProfileId':_0x2f7302[_0x3e32('0x64')]},'raw':!![]})[_0x3e32('0x1d')](function(_0x712a43){if(_0x712a43&&_0x712a43['autoAssociation']===0x0){return db['UserProfileResource'][_0x3e32('0x57')]({'name':_0xe9d54[_0x3e32('0x39')],'resourceId':_0xe9d54['id'],'type':_0x712a43['name'],'sectionId':_0x712a43['id']},{})['then'](function(){return _0x21aec3;});}else{return _0x21aec3;}})[_0x3e32('0x27')](function(_0x3cde88){logger[_0x3e32('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3cde88);throw _0x3cde88;});}return _0x21aec3;})[_0x3e32('0x1d')](respondWithResult(_0x1759f0,0xc9))[_0x3e32('0x27')](handleError(_0x1759f0,null));};exports[_0x3e32('0x34')]=function(_0x49e6b4,_0x580790,_0x15e2cf){var _0x158e75;return db[_0x3e32('0x3c')][_0x3e32('0x63')]({'where':{'id':_0x49e6b4[_0x3e32('0x54')]['id']}})['then'](handleEntityNotFound(_0x580790,null))[_0x3e32('0x1d')](saveUpdates(_0x49e6b4[_0x3e32('0x65')],null))[_0x3e32('0x1d')](function(_0x2cdaab){if(_0x2cdaab){_0x158e75=_0x2cdaab;return db[_0x3e32('0x3c')][_0x3e32('0x53')]({'raw':!![]});}})[_0x3e32('0x1d')](function(_0x561324){var _0x2bd48c=fs['readFileSync'](path[_0x3e32('0x58')](config[_0x3e32('0x59')],'server/files/templates/context.ejs'),_0x3e32('0x5b'));var _0x665066=ejs[_0x3e32('0x5c')](_0x2bd48c,{'contexts':_0x561324||[]});fs[_0x3e32('0x5d')](_0x3e32('0x5e'),_0x665066);})[_0x3e32('0x1d')](function(){return respondWithRpcPromise(_0x3e32('0x5f'),_0x3e32('0x34'),{'module':_0x3e32('0x66')});})['then'](function(){return _0x158e75;})[_0x3e32('0x1d')](respondWithResult(_0x580790,null))[_0x3e32('0x27')](handleError(_0x580790,null));};exports[_0x3e32('0x35')]=function(_0x1d3c6c,_0x3fbc06,_0x59d824){var _0x1f9e04;return db['VoiceContext'][_0x3e32('0x63')]({'where':{'id':_0x1d3c6c[_0x3e32('0x54')]['id']}})['then'](handleEntityNotFound(_0x3fbc06,null))[_0x3e32('0x1d')](removeEntity(_0x3fbc06,null))['then'](function(){return db[_0x3e32('0x3c')][_0x3e32('0x53')]({'raw':!![]});})['then'](function(_0x4f535b){var _0x5149d9=fs[_0x3e32('0x67')](path[_0x3e32('0x58')](config[_0x3e32('0x59')],_0x3e32('0x5a')),'utf8');var _0x4e76c5=ejs[_0x3e32('0x5c')](_0x5149d9,{'contexts':_0x4f535b});fs[_0x3e32('0x5d')](_0x3e32('0x5e'),_0x4e76c5);return respondWithRpcPromise(_0x3e32('0x5f'),_0x3e32('0x35'),{'module':_0x3e32('0x66')});})[_0x3e32('0x27')](handleError(_0x3fbc06,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index cfb2108..65ee3cd 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 _0x2fa5=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util'];(function(_0xccb95,_0x300783){var _0x382f46=function(_0x18519f){while(--_0x18519f){_0xccb95['push'](_0xccb95['shift']());}};_0x382f46(++_0x300783);}(_0x2fa5,0xf5));var _0x52fa=function(_0x1475e0,_0x16f54a){_0x1475e0=_0x1475e0-0x0;var _0x4bf083=_0x2fa5[_0x1475e0];return _0x4bf083;};'use strict';var _=require(_0x52fa('0x0'));var util=require(_0x52fa('0x1'));var logger=require(_0x52fa('0x2'))('api');var moment=require(_0x52fa('0x3'));var BPromise=require(_0x52fa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x52fa('0x5'));var rimraf=require(_0x52fa('0x6'));var config=require(_0x52fa('0x7'));var attributes=require(_0x52fa('0x8'));module[_0x52fa('0x9')]=function(_0x5a038d,_0x1f8183){return _0x5a038d[_0x52fa('0xa')](_0x52fa('0xb'),attributes,{'tableName':_0x52fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a61=['define','VoiceContext','voice_contexts','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes'];(function(_0x2e4e3e,_0x75ae94){var _0x51476b=function(_0x53afdc){while(--_0x53afdc){_0x2e4e3e['push'](_0x2e4e3e['shift']());}};_0x51476b(++_0x75ae94);}(_0x2a61,0xc3));var _0x12a6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x2a61[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x12a6('0x0'));var logger=require('../../config/logger')(_0x12a6('0x1'));var moment=require(_0x12a6('0x2'));var BPromise=require(_0x12a6('0x3'));var rp=require(_0x12a6('0x4'));var fs=require('fs');var path=require(_0x12a6('0x5'));var rimraf=require(_0x12a6('0x6'));var config=require(_0x12a6('0x7'));var attributes=require(_0x12a6('0x8'));module['exports']=function(_0x561dea,_0x27126f){return _0x561dea[_0x12a6('0x9')](_0x12a6('0xa'),attributes,{'tableName':_0x12a6('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 c65879b..2f7db09 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 _0x01bc=['stringify','error','message','info','result','catch','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','client','http','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s'];(function(_0x29a29f,_0x155ce7){var _0x443ea3=function(_0xe0dd24){while(--_0xe0dd24){_0x29a29f['push'](_0x29a29f['shift']());}};_0x443ea3(++_0x155ce7);}(_0x01bc,0x15c));var _0xc01b=function(_0xb4ea52,_0x2829d4){_0xb4ea52=_0xb4ea52-0x0;var _0x11525f=_0x01bc[_0xb4ea52];return _0x11525f;};'use strict';var _=require(_0xc01b('0x0'));var util=require(_0xc01b('0x1'));var moment=require(_0xc01b('0x2'));var BPromise=require(_0xc01b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc01b('0x4'));var logger=require('../../config/logger')(_0xc01b('0x5'));var config=require(_0xc01b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc01b('0x7')][_0xc01b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x41eba5,_0x4322ed,_0x8db902){return new BPromise(function(_0x48120f,_0x5ebd17){return client['request'](_0x41eba5,_0x8db902)['then'](function(_0x2694d7){logger['info'](_0xc01b('0x9'),_0x4322ed,_0xc01b('0xa'));logger[_0xc01b('0xb')](_0xc01b('0xc'),_0x4322ed,_0xc01b('0xa'),JSON[_0xc01b('0xd')](_0x2694d7));if(_0x2694d7[_0xc01b('0xe')]){if(_0x2694d7[_0xc01b('0xe')]['code']===0x1f4){logger[_0xc01b('0xe')]('VoiceContext,\x20%s,\x20%s',_0x4322ed,_0x2694d7[_0xc01b('0xe')][_0xc01b('0xf')]);return _0x5ebd17(_0x2694d7[_0xc01b('0xe')][_0xc01b('0xf')]);}logger['error'](_0xc01b('0x9'),_0x4322ed,_0x2694d7[_0xc01b('0xe')][_0xc01b('0xf')]);return _0x48120f(_0x2694d7['error'][_0xc01b('0xf')]);}else{logger[_0xc01b('0x10')](_0xc01b('0x9'),_0x4322ed,_0xc01b('0xa'));_0x48120f(_0x2694d7[_0xc01b('0x11')]['message']);}})[_0xc01b('0x12')](function(_0x5e21e9){logger[_0xc01b('0xe')]('VoiceContext,\x20%s,\x20%s',_0x4322ed,_0x5e21e9);_0x5ebd17(_0x5e21e9);});});} \ No newline at end of file +var _0xe914=['error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','stringify'];(function(_0x132ef4,_0x3670ce){var _0x1cb540=function(_0x55b6c5){while(--_0x55b6c5){_0x132ef4['push'](_0x132ef4['shift']());}};_0x1cb540(++_0x3670ce);}(_0xe914,0xb6));var _0x4e91=function(_0x7978a5,_0x5a4e10){_0x7978a5=_0x7978a5-0x0;var _0x5a7ad3=_0xe914[_0x7978a5];return _0x5a7ad3;};'use strict';var _=require(_0x4e91('0x0'));var util=require(_0x4e91('0x1'));var moment=require(_0x4e91('0x2'));var BPromise=require('bluebird');var rs=require(_0x4e91('0x3'));var fs=require('fs');var Redis=require(_0x4e91('0x4'));var db=require(_0x4e91('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4e91('0x6'))(_0x4e91('0x7'));var config=require('../../config/environment');var jayson=require(_0x4e91('0x8'));var client=jayson[_0x4e91('0x9')][_0x4e91('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x97387b,_0x26f58c,_0x187afa){return new BPromise(function(_0xcb513e,_0x2fe11f){return client[_0x4e91('0xb')](_0x97387b,_0x187afa)[_0x4e91('0xc')](function(_0x51b535){logger['info']('VoiceContext,\x20%s,\x20%s',_0x26f58c,_0x4e91('0xd'));logger[_0x4e91('0xe')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x26f58c,_0x4e91('0xd'),JSON[_0x4e91('0xf')](_0x51b535));if(_0x51b535[_0x4e91('0x10')]){if(_0x51b535[_0x4e91('0x10')][_0x4e91('0x11')]===0x1f4){logger[_0x4e91('0x10')](_0x4e91('0x12'),_0x26f58c,_0x51b535['error'][_0x4e91('0x13')]);return _0x2fe11f(_0x51b535['error']['message']);}logger[_0x4e91('0x10')]('VoiceContext,\x20%s,\x20%s',_0x26f58c,_0x51b535[_0x4e91('0x10')][_0x4e91('0x13')]);return _0xcb513e(_0x51b535[_0x4e91('0x10')][_0x4e91('0x13')]);}else{logger['info'](_0x4e91('0x12'),_0x26f58c,_0x4e91('0xd'));_0xcb513e(_0x51b535[_0x4e91('0x14')][_0x4e91('0x13')]);}})[_0x4e91('0x15')](function(_0x4a0ae7){logger[_0x4e91('0x10')](_0x4e91('0x12'),_0x26f58c,_0x4a0ae7);_0x2fe11f(_0x4a0ae7);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index cf2e7b7..c979e72 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 _0xe379=['post','create','put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','index','/describe','isAuthenticated','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe379,0x99));var _0x9e37=function(_0x1e2728,_0xabb826){_0x1e2728=_0x1e2728-0x0;var _0x3c03ec=_0xe379[_0x1e2728];return _0x3c03ec;};'use strict';var multer=require(_0x9e37('0x0'));var util=require(_0x9e37('0x1'));var path=require(_0x9e37('0x2'));var timeout=require('connect-timeout');var express=require(_0x9e37('0x3'));var router=express[_0x9e37('0x4')]();var auth=require(_0x9e37('0x5'));var interaction=require(_0x9e37('0x6'));var config=require(_0x9e37('0x7'));var controller=require(_0x9e37('0x8'));router[_0x9e37('0x9')]('/',auth['isAuthenticated'](),controller[_0x9e37('0xa')]);router[_0x9e37('0x9')](_0x9e37('0xb'),auth[_0x9e37('0xc')](),controller['describe']);router['get'](_0x9e37('0xd'),auth[_0x9e37('0xc')](),controller[_0x9e37('0xe')]);router[_0x9e37('0xf')]('/',auth['isAuthenticated'](),controller[_0x9e37('0x10')]);router[_0x9e37('0x11')]('/:id',auth[_0x9e37('0xc')](),controller[_0x9e37('0x12')]);router[_0x9e37('0x13')](_0x9e37('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x9e37('0x14')]=router; \ No newline at end of file +var _0x616f=['util','path','express','../../components/auth/service','./voiceDialReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update','delete','exports','multer'];(function(_0x7ee493,_0x2cc2cb){var _0x1f2c25=function(_0x243745){while(--_0x243745){_0x7ee493['push'](_0x7ee493['shift']());}};_0x1f2c25(++_0x2cc2cb);}(_0x616f,0x7d));var _0xf616=function(_0x1f23b1,_0x57c83f){_0x1f23b1=_0x1f23b1-0x0;var _0x3c9197=_0x616f[_0x1f23b1];return _0x3c9197;};'use strict';var multer=require(_0xf616('0x0'));var util=require(_0xf616('0x1'));var path=require(_0xf616('0x2'));var timeout=require('connect-timeout');var express=require(_0xf616('0x3'));var router=express['Router']();var auth=require(_0xf616('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf616('0x5'));router['get']('/',auth[_0xf616('0x6')](),controller[_0xf616('0x7')]);router[_0xf616('0x8')](_0xf616('0x9'),auth[_0xf616('0x6')](),controller[_0xf616('0xa')]);router[_0xf616('0x8')](_0xf616('0xb'),auth[_0xf616('0x6')](),controller[_0xf616('0xc')]);router['post']('/',auth[_0xf616('0x6')](),controller[_0xf616('0xd')]);router[_0xf616('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xf616('0xf')]);router[_0xf616('0x10')]('/:id',auth[_0xf616('0x6')](),controller['destroy']);module[_0xf616('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index d04933d..abd67c5 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 _0x62b0=['STRING','DATE','called,connect,complete','sequelize','exports','INTEGER'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x62b0,0x17d));var _0x062b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x62b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x062b('0x0'));module[_0x062b('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x062b('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x062b('0x3')]},'calleridname':{'type':Sequelize[_0x062b('0x3')]},'connectedlinenum':{'type':Sequelize[_0x062b('0x3')]},'connectedlinename':{'type':Sequelize[_0x062b('0x3')]},'language':{'type':Sequelize[_0x062b('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x062b('0x3')]},'exten':{'type':Sequelize[_0x062b('0x3')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x062b('0x3')]},'destchannelstate':{'type':Sequelize[_0x062b('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x062b('0x3')]},'destcalleridnum':{'type':Sequelize[_0x062b('0x3')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x062b('0x3')]},'destconnectedlinename':{'type':Sequelize[_0x062b('0x3')]},'destlanguage':{'type':Sequelize[_0x062b('0x3')]},'destaccountcode':{'type':Sequelize[_0x062b('0x3')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x062b('0x3')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x062b('0x3')]},'dialstring':{'type':Sequelize[_0x062b('0x3')]},'dialstatus':{'type':Sequelize[_0x062b('0x3')]},'starttime':{'type':Sequelize[_0x062b('0x4')]},'answertime':{'type':Sequelize[_0x062b('0x4')]},'endtime':{'type':Sequelize[_0x062b('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x062b('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x062b('0x2')]},'holdtime':{'type':Sequelize[_0x062b('0x2')]},'billableseconds':{'type':Sequelize[_0x062b('0x2')]}}; \ No newline at end of file +var _0x3d33=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x108f7e,_0x832e20){var _0x4494a5=function(_0x49c745){while(--_0x49c745){_0x108f7e['push'](_0x108f7e['shift']());}};_0x4494a5(++_0x832e20);}(_0x3d33,0x1b6));var _0x33d3=function(_0x590dbb,_0x1d8dd4){_0x590dbb=_0x590dbb-0x0;var _0x53375e=_0x3d33[_0x590dbb];return _0x53375e;};'use strict';var Sequelize=require(_0x33d3('0x0'));module[_0x33d3('0x1')]={'privilege':{'type':Sequelize[_0x33d3('0x2')]},'channel':{'type':Sequelize[_0x33d3('0x2')]},'channelstate':{'type':Sequelize[_0x33d3('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x33d3('0x2')]},'calleridname':{'type':Sequelize[_0x33d3('0x2')]},'connectedlinenum':{'type':Sequelize[_0x33d3('0x2')]},'connectedlinename':{'type':Sequelize[_0x33d3('0x2')]},'language':{'type':Sequelize[_0x33d3('0x2')]},'accountcode':{'type':Sequelize[_0x33d3('0x2')]},'context':{'type':Sequelize[_0x33d3('0x2')]},'exten':{'type':Sequelize[_0x33d3('0x2')]},'priority':{'type':Sequelize[_0x33d3('0x3')]},'uniqueid':{'type':Sequelize[_0x33d3('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x33d3('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x33d3('0x2')]},'destcalleridname':{'type':Sequelize[_0x33d3('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x33d3('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x33d3('0x2')]},'destlanguage':{'type':Sequelize[_0x33d3('0x2')]},'destaccountcode':{'type':Sequelize[_0x33d3('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x33d3('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x33d3('0x2')]},'destlinkedid':{'type':Sequelize[_0x33d3('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x33d3('0x4')]},'answertime':{'type':Sequelize[_0x33d3('0x4')]},'endtime':{'type':Sequelize[_0x33d3('0x4')]},'lastevent':{'type':Sequelize[_0x33d3('0x2')],'comment':_0x33d3('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x33d3('0x3')]},'holdtime':{'type':Sequelize[_0x33d3('0x3')]},'billableseconds':{'type':Sequelize[_0x33d3('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 7d0e659..1766028 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 _0x4f6f=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','count','offset','limit','status','Content-Range','apply','reject','save','update','then','end','stack','name','index','VoiceDialReport','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','rawAttributes','create','body','find','destroy','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','crypto'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x4f6f,0x157));var _0xf4f6=function(_0x1678c8,_0x1c32f4){_0x1678c8=_0x1678c8-0x0;var _0x387aa9=_0x4f6f[_0x1678c8];return _0x387aa9;};'use strict';var pdf=require(_0xf4f6('0x0'));var emlformat=require(_0xf4f6('0x1'));var rimraf=require(_0xf4f6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf4f6('0x3'));var rp=require('request-promise');var moment=require(_0xf4f6('0x4'));var BPromise=require(_0xf4f6('0x5'));var Mustache=require('mustache');var util=require(_0xf4f6('0x6'));var path=require(_0xf4f6('0x7'));var sox=require('sox');var csv=require(_0xf4f6('0x8'));var ejs=require(_0xf4f6('0x9'));var fs=require('fs');var _=require(_0xf4f6('0xa'));var squel=require('squel');var crypto=require(_0xf4f6('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf4f6('0x8'));var querystring=require(_0xf4f6('0xc'));var Papa=require(_0xf4f6('0xd'));var Redis=require(_0xf4f6('0xe'));var authService=require(_0xf4f6('0xf'));var qs=require(_0xf4f6('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf4f6('0x11'))(_0xf4f6('0x12'));var utils=require(_0xf4f6('0x13'));var config=require(_0xf4f6('0x14'));var db=require(_0xf4f6('0x15'))['db'];function respondWithStatusCode(_0x9275e3,_0x4ba77d){_0x4ba77d=_0x4ba77d||0xcc;return function(_0x5ea38b){if(_0x5ea38b){return _0x9275e3[_0xf4f6('0x16')](_0x4ba77d);}return _0x9275e3['status'](_0x4ba77d)['end']();};}function respondWithResult(_0x352629,_0x3cdd06){_0x3cdd06=_0x3cdd06||0xc8;return function(_0x33492d){if(_0x33492d){return _0x352629['status'](_0x3cdd06)[_0xf4f6('0x17')](_0x33492d);}};}function respondWithFilteredResult(_0x15feca,_0x3c3cad){return function(_0x51c4c3){if(_0x51c4c3){var _0xfdf7ae=_0x51c4c3[_0xf4f6('0x18')],_0x5ba4c4=_0x3c3cad['offset'],_0x1f06b6=_0x3c3cad[_0xf4f6('0x19')]+_0x3c3cad[_0xf4f6('0x1a')],_0x1e18c9;if(_0x1f06b6>=_0xfdf7ae){_0x1f06b6=_0xfdf7ae;_0x1e18c9=0xc8;}else{_0x1e18c9=0xce;}_0x15feca[_0xf4f6('0x1b')](_0x1e18c9);return _0x15feca['set'](_0xf4f6('0x1c'),_0x5ba4c4+'-'+_0x1f06b6+'/'+_0xfdf7ae)['json'](_0x51c4c3);}return null;};}function patchUpdates(_0x109095){return function(_0xb7adff){try{jsonpatch[_0xf4f6('0x1d')](_0xb7adff,_0x109095,!![]);}catch(_0x4f0d14){return BPromise[_0xf4f6('0x1e')](_0x4f0d14);}return _0xb7adff[_0xf4f6('0x1f')]();};}function saveUpdates(_0x1dacff,_0x391e03){return function(_0x112918){if(_0x112918){return _0x112918[_0xf4f6('0x20')](_0x1dacff)[_0xf4f6('0x21')](function(_0x30917b){return _0x30917b;});}return null;};}function removeEntity(_0x132df7,_0x20e82f){return function(_0x3a5e24){if(_0x3a5e24){return _0x3a5e24['destroy']()[_0xf4f6('0x21')](function(){_0x132df7[_0xf4f6('0x1b')](0xcc)[_0xf4f6('0x22')]();});}};}function handleEntityNotFound(_0x55ac8c,_0x1324f3){return function(_0x45b5fb){if(!_0x45b5fb){_0x55ac8c['sendStatus'](0x194);}return _0x45b5fb;};}function handleError(_0x39f21f,_0xa11674){_0xa11674=_0xa11674||0x1f4;return function(_0x2a1842){logger['error'](_0x2a1842[_0xf4f6('0x23')]);if(_0x2a1842[_0xf4f6('0x24')]){delete _0x2a1842[_0xf4f6('0x24')];}_0x39f21f[_0xf4f6('0x1b')](_0xa11674)['send'](_0x2a1842);};}exports[_0xf4f6('0x25')]=function(_0x330ec1,_0x3d9c4b){var _0x2344fb={},_0x27bf3e={},_0x2edc23={'count':0x0,'rows':[]};var _0x38f38c=db[_0xf4f6('0x26')]['rawAttributes'];_0x27bf3e[_0xf4f6('0x27')]=_[_0xf4f6('0x28')](_0x38f38c);_0x27bf3e[_0xf4f6('0x29')]=_['keys'](_0x330ec1[_0xf4f6('0x29')]);_0x27bf3e[_0xf4f6('0x2a')]=_[_0xf4f6('0x2b')](_0x27bf3e[_0xf4f6('0x27')],_0x27bf3e[_0xf4f6('0x29')]);_0x2344fb[_0xf4f6('0x2c')]=_[_0xf4f6('0x2b')](_0x27bf3e[_0xf4f6('0x27')],qs[_0xf4f6('0x2d')](_0x330ec1['query']['fields']));_0x2344fb[_0xf4f6('0x2c')]=_0x2344fb[_0xf4f6('0x2c')][_0xf4f6('0x2e')]?_0x2344fb[_0xf4f6('0x2c')]:_0x27bf3e[_0xf4f6('0x27')];if(!_0x330ec1[_0xf4f6('0x29')][_0xf4f6('0x2f')](_0xf4f6('0x30'))){_0x2344fb[_0xf4f6('0x1a')]=qs['limit'](_0x330ec1[_0xf4f6('0x29')][_0xf4f6('0x1a')]);_0x2344fb[_0xf4f6('0x19')]=qs['offset'](_0x330ec1[_0xf4f6('0x29')][_0xf4f6('0x19')]);}_0x2344fb[_0xf4f6('0x31')]=qs[_0xf4f6('0x32')](_0x330ec1[_0xf4f6('0x29')]['sort']);_0x2344fb[_0xf4f6('0x33')]=qs[_0xf4f6('0x2a')](_['pick'](_0x330ec1[_0xf4f6('0x29')],_0x27bf3e[_0xf4f6('0x2a')]));if(_0x330ec1[_0xf4f6('0x29')][_0xf4f6('0x34')]){_0x2344fb['where']=_[_0xf4f6('0x35')](_0x2344fb['where'],{'$or':_[_0xf4f6('0x36')](_0x38f38c,function(_0x3d1dbc){if(_0x3d1dbc[_0xf4f6('0x37')]['key']!==_0xf4f6('0x38')){var _0x3c2ebd={};_0x3c2ebd[_0x3d1dbc[_0xf4f6('0x39')]]={'$like':'%'+_0x330ec1[_0xf4f6('0x29')]['filter']+'%'};return _0x3c2ebd;}})});}_0x2344fb=_[_0xf4f6('0x35')]({},_0x2344fb,_0x330ec1[_0xf4f6('0x3a')]);var _0x11882d={'where':_0x2344fb['where']};return db[_0xf4f6('0x26')]['count'](_0x11882d)[_0xf4f6('0x21')](function(_0x24029c){_0x2edc23[_0xf4f6('0x18')]=_0x24029c;if(_0x330ec1['query'][_0xf4f6('0x3b')]){_0x2344fb[_0xf4f6('0x3c')]=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x2344fb);})[_0xf4f6('0x21')](function(_0x205fcb){_0x2edc23[_0xf4f6('0x3d')]=_0x205fcb;return _0x2edc23;})[_0xf4f6('0x21')](respondWithFilteredResult(_0x3d9c4b,_0x2344fb))[_0xf4f6('0x3e')](handleError(_0x3d9c4b,null));};exports[_0xf4f6('0x3f')]=function(_0xaed0b9,_0x4770cc){var _0x5b8cb5={'raw':!![],'where':{'id':_0xaed0b9[_0xf4f6('0x40')]['id']}},_0x1c5910={};_0x1c5910[_0xf4f6('0x27')]=_['keys'](db[_0xf4f6('0x26')][_0xf4f6('0x41')]);_0x1c5910[_0xf4f6('0x29')]=_['keys'](_0xaed0b9[_0xf4f6('0x29')]);_0x1c5910[_0xf4f6('0x2a')]=_['intersection'](_0x1c5910[_0xf4f6('0x27')],_0x1c5910['query']);_0x5b8cb5[_0xf4f6('0x2c')]=_['intersection'](_0x1c5910[_0xf4f6('0x27')],qs[_0xf4f6('0x2d')](_0xaed0b9[_0xf4f6('0x29')][_0xf4f6('0x2d')]));_0x5b8cb5[_0xf4f6('0x2c')]=_0x5b8cb5[_0xf4f6('0x2c')][_0xf4f6('0x2e')]?_0x5b8cb5[_0xf4f6('0x2c')]:_0x1c5910[_0xf4f6('0x27')];if(_0xaed0b9[_0xf4f6('0x29')][_0xf4f6('0x3b')]){_0x5b8cb5[_0xf4f6('0x3c')]=[{'all':!![]}];}_0x5b8cb5=_[_0xf4f6('0x35')]({},_0x5b8cb5,_0xaed0b9[_0xf4f6('0x3a')]);return db['VoiceDialReport']['find'](_0x5b8cb5)['then'](handleEntityNotFound(_0x4770cc,null))[_0xf4f6('0x21')](respondWithResult(_0x4770cc,null))[_0xf4f6('0x3e')](handleError(_0x4770cc,null));};exports['create']=function(_0x1c39a5,_0x5bc0e2){return db[_0xf4f6('0x26')][_0xf4f6('0x42')](_0x1c39a5[_0xf4f6('0x43')],{})[_0xf4f6('0x21')](respondWithResult(_0x5bc0e2,0xc9))[_0xf4f6('0x3e')](handleError(_0x5bc0e2,null));};exports['update']=function(_0x3e79fa,_0x5b0345){if(_0x3e79fa[_0xf4f6('0x43')]['id']){delete _0x3e79fa[_0xf4f6('0x43')]['id'];}return db['VoiceDialReport'][_0xf4f6('0x44')]({'where':{'id':_0x3e79fa[_0xf4f6('0x40')]['id']}})[_0xf4f6('0x21')](handleEntityNotFound(_0x5b0345,null))[_0xf4f6('0x21')](saveUpdates(_0x3e79fa['body'],null))[_0xf4f6('0x21')](respondWithResult(_0x5b0345,null))['catch'](handleError(_0x5b0345,null));};exports[_0xf4f6('0x45')]=function(_0x1c7fb2,_0x23124a){return db['VoiceDialReport']['find']({'where':{'id':_0x1c7fb2[_0xf4f6('0x40')]['id']}})[_0xf4f6('0x21')](handleEntityNotFound(_0x23124a,null))['then'](removeEntity(_0x23124a,null))[_0xf4f6('0x3e')](handleError(_0x23124a,null));};exports['describe']=function(_0x235393,_0x3be762){return db[_0xf4f6('0x26')][_0xf4f6('0x46')]()[_0xf4f6('0x21')](respondWithResult(_0x3be762,null))[_0xf4f6('0x3e')](handleError(_0x3be762,null));}; \ No newline at end of file +var _0xa3e6=['../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','set','Content-Range','json','apply','reject','then','error','stack','name','VoiceDialReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','merge','type','key','field','options','count','includeAll','rows','catch','show','params','find','create','update','body','destroy','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x3d2073,_0x565a14){_0x3d2073=_0x3d2073-0x0;var _0x35b5ca=_0xa3e6[_0x3d2073];return _0x35b5ca;};'use strict';var pdf=require(_0x6a3e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6a3e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6a3e('0x2'));var rp=require(_0x6a3e('0x3'));var moment=require(_0x6a3e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6a3e('0x5'));var util=require('util');var path=require(_0x6a3e('0x6'));var sox=require(_0x6a3e('0x7'));var csv=require(_0x6a3e('0x8'));var ejs=require(_0x6a3e('0x9'));var fs=require('fs');var _=require(_0x6a3e('0xa'));var squel=require('squel');var crypto=require(_0x6a3e('0xb'));var jsforce=require(_0x6a3e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6a3e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6a3e('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6a3e('0xf'));var logger=require('../../config/logger')(_0x6a3e('0x10'));var utils=require(_0x6a3e('0x11'));var config=require(_0x6a3e('0x12'));var db=require(_0x6a3e('0x13'))['db'];function respondWithStatusCode(_0x412b70,_0x2de3cd){_0x2de3cd=_0x2de3cd||0xcc;return function(_0x4a3a97){if(_0x4a3a97){return _0x412b70[_0x6a3e('0x14')](_0x2de3cd);}return _0x412b70[_0x6a3e('0x15')](_0x2de3cd)[_0x6a3e('0x16')]();};}function respondWithResult(_0x336c5d,_0x1364be){_0x1364be=_0x1364be||0xc8;return function(_0x31aefa){if(_0x31aefa){return _0x336c5d[_0x6a3e('0x15')](_0x1364be)['json'](_0x31aefa);}};}function respondWithFilteredResult(_0x2e911b,_0x13b172){return function(_0x8ed74b){if(_0x8ed74b){var _0x2a62a8=_0x8ed74b['count'],_0x500ccd=_0x13b172['offset'],_0x462b8d=_0x13b172['offset']+_0x13b172['limit'],_0x24666d;if(_0x462b8d>=_0x2a62a8){_0x462b8d=_0x2a62a8;_0x24666d=0xc8;}else{_0x24666d=0xce;}_0x2e911b['status'](_0x24666d);return _0x2e911b[_0x6a3e('0x17')](_0x6a3e('0x18'),_0x500ccd+'-'+_0x462b8d+'/'+_0x2a62a8)[_0x6a3e('0x19')](_0x8ed74b);}return null;};}function patchUpdates(_0x701d04){return function(_0x17fde0){try{jsonpatch[_0x6a3e('0x1a')](_0x17fde0,_0x701d04,!![]);}catch(_0x1d6ccc){return BPromise[_0x6a3e('0x1b')](_0x1d6ccc);}return _0x17fde0['save']();};}function saveUpdates(_0x3d1e03,_0x58b7b9){return function(_0xc0452f){if(_0xc0452f){return _0xc0452f['update'](_0x3d1e03)[_0x6a3e('0x1c')](function(_0x131d80){return _0x131d80;});}return null;};}function removeEntity(_0x6fd39a,_0x350b66){return function(_0x58721c){if(_0x58721c){return _0x58721c['destroy']()[_0x6a3e('0x1c')](function(){_0x6fd39a[_0x6a3e('0x15')](0xcc)[_0x6a3e('0x16')]();});}};}function handleEntityNotFound(_0x4687d0,_0x4e5a25){return function(_0x1ae966){if(!_0x1ae966){_0x4687d0[_0x6a3e('0x14')](0x194);}return _0x1ae966;};}function handleError(_0x4436ac,_0x2f95e2){_0x2f95e2=_0x2f95e2||0x1f4;return function(_0x42a70e){logger[_0x6a3e('0x1d')](_0x42a70e[_0x6a3e('0x1e')]);if(_0x42a70e[_0x6a3e('0x1f')]){delete _0x42a70e[_0x6a3e('0x1f')];}_0x4436ac[_0x6a3e('0x15')](_0x2f95e2)['send'](_0x42a70e);};}exports['index']=function(_0x150992,_0x6cc7c4){var _0x13bdc3={},_0x410d4b={},_0x254a0e={'count':0x0,'rows':[]};var _0x2d0ec1=db[_0x6a3e('0x20')][_0x6a3e('0x21')];_0x410d4b[_0x6a3e('0x22')]=_[_0x6a3e('0x23')](_0x2d0ec1);_0x410d4b[_0x6a3e('0x24')]=_['keys'](_0x150992['query']);_0x410d4b[_0x6a3e('0x25')]=_['intersection'](_0x410d4b[_0x6a3e('0x22')],_0x410d4b['query']);_0x13bdc3['attributes']=_[_0x6a3e('0x26')](_0x410d4b[_0x6a3e('0x22')],qs['fields'](_0x150992['query'][_0x6a3e('0x27')]));_0x13bdc3[_0x6a3e('0x28')]=_0x13bdc3[_0x6a3e('0x28')][_0x6a3e('0x29')]?_0x13bdc3['attributes']:_0x410d4b['model'];if(!_0x150992[_0x6a3e('0x24')][_0x6a3e('0x2a')](_0x6a3e('0x2b'))){_0x13bdc3[_0x6a3e('0x2c')]=qs['limit'](_0x150992[_0x6a3e('0x24')][_0x6a3e('0x2c')]);_0x13bdc3['offset']=qs['offset'](_0x150992['query'][_0x6a3e('0x2d')]);}_0x13bdc3[_0x6a3e('0x2e')]=qs[_0x6a3e('0x2f')](_0x150992[_0x6a3e('0x24')][_0x6a3e('0x2f')]);_0x13bdc3[_0x6a3e('0x30')]=qs[_0x6a3e('0x25')](_[_0x6a3e('0x31')](_0x150992[_0x6a3e('0x24')],_0x410d4b[_0x6a3e('0x25')]));if(_0x150992[_0x6a3e('0x24')][_0x6a3e('0x32')]){_0x13bdc3[_0x6a3e('0x30')]=_[_0x6a3e('0x33')](_0x13bdc3[_0x6a3e('0x30')],{'$or':_['map'](_0x2d0ec1,function(_0x19d873){if(_0x19d873[_0x6a3e('0x34')][_0x6a3e('0x35')]!=='VIRTUAL'){var _0x43491f={};_0x43491f[_0x19d873[_0x6a3e('0x36')]]={'$like':'%'+_0x150992['query'][_0x6a3e('0x32')]+'%'};return _0x43491f;}})});}_0x13bdc3=_[_0x6a3e('0x33')]({},_0x13bdc3,_0x150992[_0x6a3e('0x37')]);var _0x52494f={'where':_0x13bdc3[_0x6a3e('0x30')]};return db[_0x6a3e('0x20')][_0x6a3e('0x38')](_0x52494f)[_0x6a3e('0x1c')](function(_0x18a50f){_0x254a0e[_0x6a3e('0x38')]=_0x18a50f;if(_0x150992['query'][_0x6a3e('0x39')]){_0x13bdc3['include']=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x13bdc3);})[_0x6a3e('0x1c')](function(_0x4bb1ba){_0x254a0e[_0x6a3e('0x3a')]=_0x4bb1ba;return _0x254a0e;})[_0x6a3e('0x1c')](respondWithFilteredResult(_0x6cc7c4,_0x13bdc3))[_0x6a3e('0x3b')](handleError(_0x6cc7c4,null));};exports[_0x6a3e('0x3c')]=function(_0xca83d2,_0x36944d){var _0x480981={'raw':!![],'where':{'id':_0xca83d2[_0x6a3e('0x3d')]['id']}},_0x59c48a={};_0x59c48a[_0x6a3e('0x22')]=_[_0x6a3e('0x23')](db[_0x6a3e('0x20')][_0x6a3e('0x21')]);_0x59c48a['query']=_[_0x6a3e('0x23')](_0xca83d2[_0x6a3e('0x24')]);_0x59c48a['filters']=_[_0x6a3e('0x26')](_0x59c48a[_0x6a3e('0x22')],_0x59c48a[_0x6a3e('0x24')]);_0x480981['attributes']=_[_0x6a3e('0x26')](_0x59c48a[_0x6a3e('0x22')],qs[_0x6a3e('0x27')](_0xca83d2[_0x6a3e('0x24')][_0x6a3e('0x27')]));_0x480981[_0x6a3e('0x28')]=_0x480981['attributes'][_0x6a3e('0x29')]?_0x480981[_0x6a3e('0x28')]:_0x59c48a[_0x6a3e('0x22')];if(_0xca83d2['query'][_0x6a3e('0x39')]){_0x480981['include']=[{'all':!![]}];}_0x480981=_['merge']({},_0x480981,_0xca83d2[_0x6a3e('0x37')]);return db[_0x6a3e('0x20')][_0x6a3e('0x3e')](_0x480981)['then'](handleEntityNotFound(_0x36944d,null))['then'](respondWithResult(_0x36944d,null))[_0x6a3e('0x3b')](handleError(_0x36944d,null));};exports[_0x6a3e('0x3f')]=function(_0x42ece3,_0x320530){return db[_0x6a3e('0x20')][_0x6a3e('0x3f')](_0x42ece3['body'],{})[_0x6a3e('0x1c')](respondWithResult(_0x320530,0xc9))[_0x6a3e('0x3b')](handleError(_0x320530,null));};exports[_0x6a3e('0x40')]=function(_0x1a8068,_0x307c89){if(_0x1a8068[_0x6a3e('0x41')]['id']){delete _0x1a8068[_0x6a3e('0x41')]['id'];}return db[_0x6a3e('0x20')][_0x6a3e('0x3e')]({'where':{'id':_0x1a8068['params']['id']}})[_0x6a3e('0x1c')](handleEntityNotFound(_0x307c89,null))[_0x6a3e('0x1c')](saveUpdates(_0x1a8068['body'],null))[_0x6a3e('0x1c')](respondWithResult(_0x307c89,null))['catch'](handleError(_0x307c89,null));};exports[_0x6a3e('0x42')]=function(_0x10cd8e,_0x28a3e9){return db['VoiceDialReport'][_0x6a3e('0x3e')]({'where':{'id':_0x10cd8e[_0x6a3e('0x3d')]['id']}})['then'](handleEntityNotFound(_0x28a3e9,null))['then'](removeEntity(_0x28a3e9,null))['catch'](handleError(_0x28a3e9,null));};exports[_0x6a3e('0x43')]=function(_0x17d05a,_0x32fb36){return db[_0x6a3e('0x20')][_0x6a3e('0x43')]()[_0x6a3e('0x1c')](respondWithResult(_0x32fb36,null))[_0x6a3e('0x3b')](handleError(_0x32fb36,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 65b445a..1193d1b 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 _0xbefe=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','define','report_dial','uniqueid'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0xbefe,0x168));var _0xebef=function(_0x367284,_0x26688c){_0x367284=_0x367284-0x0;var _0xe5c015=_0xbefe[_0x367284];return _0xe5c015;};'use strict';var _=require('lodash');var util=require(_0xebef('0x0'));var logger=require('../../config/logger')(_0xebef('0x1'));var moment=require(_0xebef('0x2'));var BPromise=require(_0xebef('0x3'));var rp=require(_0xebef('0x4'));var fs=require('fs');var path=require(_0xebef('0x5'));var rimraf=require(_0xebef('0x6'));var config=require(_0xebef('0x7'));var attributes=require(_0xebef('0x8'));module['exports']=function(_0x3fe404,_0x39de80){return _0x3fe404[_0xebef('0x9')]('VoiceDialReport',attributes,{'tableName':_0xebef('0xa'),'paranoid':![],'indexes':[{'fields':[_0xebef('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4977=['moment','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api'];(function(_0x1ac3a7,_0x69a6a9){var _0x408ee2=function(_0x38d477){while(--_0x38d477){_0x1ac3a7['push'](_0x1ac3a7['shift']());}};_0x408ee2(++_0x69a6a9);}(_0x4977,0x1cd));var _0x7497=function(_0x7b5d2,_0x45b5cb){_0x7b5d2=_0x7b5d2-0x0;var _0x5345a5=_0x4977[_0x7b5d2];return _0x5345a5;};'use strict';var _=require(_0x7497('0x0'));var util=require(_0x7497('0x1'));var logger=require(_0x7497('0x2'))(_0x7497('0x3'));var moment=require(_0x7497('0x4'));var BPromise=require('bluebird');var rp=require(_0x7497('0x5'));var fs=require('fs');var path=require(_0x7497('0x6'));var rimraf=require(_0x7497('0x7'));var config=require(_0x7497('0x8'));var attributes=require(_0x7497('0x9'));module[_0x7497('0xa')]=function(_0x50f563,_0x170987){return _0x50f563[_0x7497('0xb')](_0x7497('0xc'),attributes,{'tableName':_0x7497('0xd'),'paranoid':![],'indexes':[{'fields':[_0x7497('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 6f0bf33..4239d7b 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 _0x4c6d=['info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','then','UpdateVoiceDialReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x18ad2d,_0x3b26bb){var _0x40bddc=function(_0x5792d){while(--_0x5792d){_0x18ad2d['push'](_0x18ad2d['shift']());}};_0x40bddc(++_0x3b26bb);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x5b0ae7,_0x2b8eae){_0x5b0ae7=_0x5b0ae7-0x0;var _0x3b8e4e=_0x4c6d[_0x5b0ae7];return _0x3b8e4e;};'use strict';var _=require(_0xd4c6('0x0'));var util=require(_0xd4c6('0x1'));var moment=require(_0xd4c6('0x2'));var BPromise=require(_0xd4c6('0x3'));var rs=require(_0xd4c6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4c6('0x5'))['db'];var utils=require(_0xd4c6('0x6'));var logger=require(_0xd4c6('0x7'))('rpc');var config=require(_0xd4c6('0x8'));var jayson=require(_0xd4c6('0x9'));var client=jayson['client'][_0xd4c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x316314,_0x4329e3,_0x5d4fce){return new BPromise(function(_0x440ee3,_0x19ce1c){return client[_0xd4c6('0xb')](_0x316314,_0x5d4fce)['then'](function(_0xe2f90b){logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,'request\x20sent');logger[_0xd4c6('0xe')](_0xd4c6('0xf'),_0x4329e3,_0xd4c6('0x10'),JSON[_0xd4c6('0x11')](_0xe2f90b));if(_0xe2f90b[_0xd4c6('0x12')]){if(_0xe2f90b[_0xd4c6('0x12')]['code']===0x1f4){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b['error'][_0xd4c6('0x13')]);return _0x19ce1c(_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);}logger[_0xd4c6('0x12')](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);return _0x440ee3(_0xe2f90b['error']['message']);}else{logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,_0xd4c6('0x10'));_0x440ee3(_0xe2f90b[_0xd4c6('0x14')][_0xd4c6('0x13')]);}})[_0xd4c6('0x15')](function(_0xe52075){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe52075);_0x19ce1c(_0xe52075);});});}exports[_0xd4c6('0x16')]=function(_0x23a16f){var _0x2c97b=this;return new Promise(function(_0x31f328,_0x54e0a5){return db[_0xd4c6('0x17')][_0xd4c6('0x18')](_0x23a16f[_0xd4c6('0x19')],{'raw':_0x23a16f['options']?_0x23a16f[_0xd4c6('0x1a')][_0xd4c6('0x1b')]===undefined?!![]:![]:!![]})[_0xd4c6('0x1c')](function(_0x3b1658){logger['info'](_0xd4c6('0x16'),_0x23a16f);logger['debug'](_0xd4c6('0x16'),_0x23a16f,JSON[_0xd4c6('0x11')](_0x3b1658));_0x31f328(_0x3b1658);})[_0xd4c6('0x15')](function(_0x222813){logger[_0xd4c6('0x12')](_0xd4c6('0x16'),_0x222813[_0xd4c6('0x13')],_0x23a16f);_0x54e0a5(_0x2c97b[_0xd4c6('0x12')](0x1f4,_0x222813[_0xd4c6('0x13')]));});});};exports[_0xd4c6('0x1d')]=function(_0x1ebb17){var _0x1c4e19=this;return new Promise(function(_0x4e4b76,_0x582326){return db[_0xd4c6('0x17')][_0xd4c6('0x1e')](_0x1ebb17['body'],{'raw':_0x1ebb17[_0xd4c6('0x1a')]?_0x1ebb17[_0xd4c6('0x1a')][_0xd4c6('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ebb17['options']?_0x1ebb17[_0xd4c6('0x1a')][_0xd4c6('0x1f')]||null:null,'attributes':_0x1ebb17['options']?_0x1ebb17[_0xd4c6('0x1a')][_0xd4c6('0x20')]||null:null,'limit':_0x1ebb17[_0xd4c6('0x1a')]?_0x1ebb17['options'][_0xd4c6('0x21')]||null:null})[_0xd4c6('0x1c')](function(_0x255630){logger[_0xd4c6('0xc')](_0xd4c6('0x1d'),_0x1ebb17);logger[_0xd4c6('0xe')](_0xd4c6('0x1d'),_0x1ebb17,JSON[_0xd4c6('0x11')](_0x255630));_0x4e4b76(_0x255630);})[_0xd4c6('0x15')](function(_0x1de7ae){logger[_0xd4c6('0x12')](_0xd4c6('0x1d'),_0x1de7ae[_0xd4c6('0x13')],_0x1ebb17);_0x582326(_0x1c4e19[_0xd4c6('0x12')](0x1f4,_0x1de7ae['message']));});});}; \ No newline at end of file +var _0xfc1e=['http','request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateVoiceDialReport','create','body','options','catch','UpdateVoiceDialReport','update','raw','attributes','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x623f3d,_0x4fdfae){var _0x2d171e=function(_0x4d6a38){while(--_0x4d6a38){_0x623f3d['push'](_0x623f3d['shift']());}};_0x2d171e(++_0x4fdfae);}(_0xfc1e,0x1c9));var _0xefc1=function(_0x237f8b,_0xc5eddb){_0x237f8b=_0x237f8b-0x0;var _0x423f94=_0xfc1e[_0x237f8b];return _0x423f94;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xefc1('0x0'));var rs=require(_0xefc1('0x1'));var fs=require('fs');var Redis=require(_0xefc1('0x2'));var db=require(_0xefc1('0x3'))['db'];var utils=require(_0xefc1('0x4'));var logger=require('../../config/logger')(_0xefc1('0x5'));var config=require(_0xefc1('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xefc1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x38927c,_0x44d15b,_0x3ff4a7){return new BPromise(function(_0x45bec4,_0x77f637){return client[_0xefc1('0x8')](_0x38927c,_0x3ff4a7)[_0xefc1('0x9')](function(_0x244927){logger[_0xefc1('0xa')](_0xefc1('0xb'),_0x44d15b,'request\x20sent');logger[_0xefc1('0xc')](_0xefc1('0xd'),_0x44d15b,_0xefc1('0xe'),JSON[_0xefc1('0xf')](_0x244927));if(_0x244927[_0xefc1('0x10')]){if(_0x244927[_0xefc1('0x10')][_0xefc1('0x11')]===0x1f4){logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);return _0x77f637(_0x244927['error'][_0xefc1('0x12')]);}logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);return _0x45bec4(_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);}else{logger[_0xefc1('0xa')]('VoiceDialReport,\x20%s,\x20%s',_0x44d15b,_0xefc1('0xe'));_0x45bec4(_0x244927[_0xefc1('0x13')][_0xefc1('0x12')]);}})['catch'](function(_0x159adb){logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x159adb);_0x77f637(_0x159adb);});});}exports[_0xefc1('0x14')]=function(_0x257914){var _0x38923c=this;return new Promise(function(_0x3b5a6e,_0x126052){return db['VoiceDialReport'][_0xefc1('0x15')](_0x257914[_0xefc1('0x16')],{'raw':_0x257914[_0xefc1('0x17')]?_0x257914['options']['raw']===undefined?!![]:![]:!![]})[_0xefc1('0x9')](function(_0x492d7d){logger[_0xefc1('0xa')]('CreateVoiceDialReport',_0x257914);logger[_0xefc1('0xc')](_0xefc1('0x14'),_0x257914,JSON['stringify'](_0x492d7d));_0x3b5a6e(_0x492d7d);})[_0xefc1('0x18')](function(_0x2ea108){logger[_0xefc1('0x10')](_0xefc1('0x14'),_0x2ea108[_0xefc1('0x12')],_0x257914);_0x126052(_0x38923c[_0xefc1('0x10')](0x1f4,_0x2ea108['message']));});});};exports[_0xefc1('0x19')]=function(_0xd950ce){var _0x56b540=this;return new Promise(function(_0xae764e,_0x4b8418){return db['VoiceDialReport'][_0xefc1('0x1a')](_0xd950ce[_0xefc1('0x16')],{'raw':_0xd950ce[_0xefc1('0x17')]?_0xd950ce[_0xefc1('0x17')][_0xefc1('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd950ce[_0xefc1('0x17')]?_0xd950ce['options']['where']||null:null,'attributes':_0xd950ce[_0xefc1('0x17')]?_0xd950ce[_0xefc1('0x17')][_0xefc1('0x1c')]||null:null,'limit':_0xd950ce[_0xefc1('0x17')]?_0xd950ce[_0xefc1('0x17')]['limit']||null:null})[_0xefc1('0x9')](function(_0x3f6e1a){logger['info']('UpdateVoiceDialReport',_0xd950ce);logger[_0xefc1('0xc')](_0xefc1('0x19'),_0xd950ce,JSON[_0xefc1('0xf')](_0x3f6e1a));_0xae764e(_0x3f6e1a);})['catch'](function(_0x39d9aa){logger[_0xefc1('0x10')](_0xefc1('0x19'),_0x39d9aa[_0xefc1('0x12')],_0xd950ce);_0x4b8418(_0x56b540[_0xefc1('0x10')](0x1f4,_0x39d9aa[_0xefc1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index b99326e..8be5db9 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 _0x4213=['../../config/environment','get','isAuthenticated','index','show','post','create','/:id/applications','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x28f32c,_0x4cc342){var _0x355402=function(_0xdb5032){while(--_0xdb5032){_0x28f32c['push'](_0x28f32c['shift']());}};_0x355402(++_0x4cc342);}(_0x4213,0x77));var _0x3421=function(_0x522620,_0x6f21dc){_0x522620=_0x522620-0x0;var _0x10cb55=_0x4213[_0x522620];return _0x10cb55;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var auth=require(_0x3421('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3421('0x7'));var controller=require('./voiceExtension.controller');router[_0x3421('0x8')]('/',auth[_0x3421('0x9')](),controller[_0x3421('0xa')]);router[_0x3421('0x8')]('/:id',auth[_0x3421('0x9')](),controller[_0x3421('0xb')]);router[_0x3421('0xc')]('/',auth[_0x3421('0x9')](),controller[_0x3421('0xd')]);router['post'](_0x3421('0xe'),auth['isAuthenticated'](),controller['addApplications']);router[_0x3421('0xf')]('/:id',auth[_0x3421('0x9')](),controller[_0x3421('0x10')]);router[_0x3421('0x11')](_0x3421('0x12'),auth[_0x3421('0x9')](),controller[_0x3421('0x13')]);module[_0x3421('0x14')]=router; \ No newline at end of file +var _0x09df=['put','update','destroy','exports','multer','util','connect-timeout','../../components/auth/service','./voiceExtension.controller','get','/:id','show','post','isAuthenticated','create','/:id/applications'];(function(_0x123231,_0x35191c){var _0x14e1cd=function(_0x40f266){while(--_0x40f266){_0x123231['push'](_0x123231['shift']());}};_0x14e1cd(++_0x35191c);}(_0x09df,0x164));var _0xf09d=function(_0x25701b,_0x2a6976){_0x25701b=_0x25701b-0x0;var _0x3a8a2c=_0x09df[_0x25701b];return _0x3a8a2c;};'use strict';var multer=require(_0xf09d('0x0'));var util=require(_0xf09d('0x1'));var path=require('path');var timeout=require(_0xf09d('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xf09d('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf09d('0x4'));router[_0xf09d('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xf09d('0x6'),auth['isAuthenticated'](),controller[_0xf09d('0x7')]);router[_0xf09d('0x8')]('/',auth[_0xf09d('0x9')](),controller[_0xf09d('0xa')]);router[_0xf09d('0x8')](_0xf09d('0xb'),auth[_0xf09d('0x9')](),controller['addApplications']);router[_0xf09d('0xc')](_0xf09d('0x6'),auth['isAuthenticated'](),controller[_0xf09d('0xd')]);router['delete'](_0xf09d('0x6'),auth[_0xf09d('0x9')](),controller[_0xf09d('0xe')]);module[_0xf09d('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 0268273..902c9a1 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 _0xa75b=['BOOLEAN','wav','VIRTUAL','getDataValue','sequelize','compositeIndex','STRING','NoOp','ENUM','inbound','outbound','internal','system','INTEGER'];(function(_0x1f8cb3,_0x5b81d8){var _0x2428e2=function(_0xa3dff5){while(--_0xa3dff5){_0x1f8cb3['push'](_0x1f8cb3['shift']());}};_0x2428e2(++_0x5b81d8);}(_0xa75b,0x170));var _0xba75=function(_0x10897f,_0x48f40f){_0x10897f=_0x10897f-0x0;var _0x48af29=_0xa75b[_0x10897f];return _0x48af29;};'use strict';var Sequelize=require(_0xba75('0x0'));module['exports']={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xba75('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xba75('0x2')],'allowNull':![],'unique':_0xba75('0x1')},'priority':{'type':Sequelize[_0xba75('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xba75('0x1')},'tag':{'type':Sequelize[_0xba75('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xba75('0x2')],'allowNull':![],'defaultValue':_0xba75('0x3')},'appdata':{'type':Sequelize[_0xba75('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xba75('0x4')](_0xba75('0x5'),_0xba75('0x6'),_0xba75('0x7'),'inbound-fax','outbound-fax',_0xba75('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xba75('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0xba75('0x9')]},'isApp':{'type':Sequelize[_0xba75('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xba75('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xba75('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xba75('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xba75('0x9')]},'recordingFormat':{'type':Sequelize[_0xba75('0x2')],'defaultValue':_0xba75('0xb')},'answer':{'type':Sequelize[_0xba75('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0xba75('0xc')],'get':function(_0x8116d8){return this[_0xba75('0xd')]('exten');}}}; \ No newline at end of file +var _0x44a3=['NoOp','ENUM','inbound','system','any','*,*,*,*','BOOLEAN','VIRTUAL','exten','sequelize','exports','STRING','compositeIndex'];(function(_0x45fe9c,_0x55e0d7){var _0x233d48=function(_0xa2ba2e){while(--_0xa2ba2e){_0x45fe9c['push'](_0x45fe9c['shift']());}};_0x233d48(++_0x55e0d7);}(_0x44a3,0x1a9));var _0x344a=function(_0x18dc34,_0x205f71){_0x18dc34=_0x18dc34-0x0;var _0x4ab15b=_0x44a3[_0x18dc34];return _0x4ab15b;};'use strict';var Sequelize=require(_0x344a('0x0'));module[_0x344a('0x1')]={'context':{'type':Sequelize[_0x344a('0x2')],'allowNull':![],'unique':_0x344a('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x344a('0x2')],'allowNull':![],'unique':_0x344a('0x3')},'priority':{'type':Sequelize[_0x344a('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x344a('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x344a('0x2')],'allowNull':![],'defaultValue':_0x344a('0x4')},'appdata':{'type':Sequelize[_0x344a('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x344a('0x5')](_0x344a('0x6'),'outbound','internal','inbound-fax','outbound-fax',_0x344a('0x7'),_0x344a('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0x344a('0x2')]},'interval':{'type':Sequelize[_0x344a('0x2')],'allowNull':![],'defaultValue':_0x344a('0x9')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x344a('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x344a('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x344a('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x344a('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x344a('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0x344a('0xb')],'get':function(_0x57e42e){return this['getDataValue'](_0x344a('0xc'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 73f8039..a897e48 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 _0x4593=['rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters','merge','where','key','VIRTUAL','field','includeAll','include','VoiceExtension','findAll','catch','show','params','create','startsWith','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','InternalRoutes','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','sequelize','transaction','VoiceExtensionId','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/environment','../../mysqldb','defaults','localhost','redis','./voiceExtension.socket','register','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','inbound','OutboundRoutes','outbound','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','end','sendStatus','error','send','index'];(function(_0xc8104,_0x4f8f11){var _0x33501f=function(_0x1b93cc){while(--_0x1b93cc){_0xc8104['push'](_0xc8104['shift']());}};_0x33501f(++_0x4f8f11);}(_0x4593,0x106));var _0x3459=function(_0x5e2cb4,_0x592c64){_0x5e2cb4=_0x5e2cb4-0x0;var _0x282902=_0x4593[_0x5e2cb4];return _0x282902;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3459('0x0'));var rimraf=require(_0x3459('0x1'));var zipdir=require(_0x3459('0x2'));var jsonpatch=require(_0x3459('0x3'));var rp=require(_0x3459('0x4'));var moment=require(_0x3459('0x5'));var BPromise=require(_0x3459('0x6'));var Mustache=require('mustache');var util=require(_0x3459('0x7'));var path=require(_0x3459('0x8'));var sox=require(_0x3459('0x9'));var csv=require(_0x3459('0xa'));var ejs=require(_0x3459('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3459('0xc'));var jsforce=require(_0x3459('0xd'));var deskjs=require(_0x3459('0xe'));var toCsv=require(_0x3459('0xa'));var querystring=require('querystring');var Papa=require(_0x3459('0xf'));var Redis=require('ioredis');var authService=require(_0x3459('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x3459('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3459('0x12'));var db=require(_0x3459('0x13'))['db'];config['redis']=_[_0x3459('0x14')](config['redis'],{'host':_0x3459('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3459('0x16')]));require(_0x3459('0x17'))[_0x3459('0x18')](socket);function respondWithStatusCode(_0x2f1871,_0x474375){_0x474375=_0x474375||0xcc;return function(_0x396e5e){if(_0x396e5e){return _0x2f1871['sendStatus'](_0x474375);}return _0x2f1871[_0x3459('0x19')](_0x474375)['end']();};}function respondWithResult(_0x5c6ff1,_0x1b8c5a){_0x1b8c5a=_0x1b8c5a||0xc8;return function(_0x31e7ac){if(_0x31e7ac){return _0x5c6ff1[_0x3459('0x19')](_0x1b8c5a)[_0x3459('0x1a')](_0x31e7ac);}};}function respondWithFilteredResult(_0x8ddf90,_0x85b4c3){return function(_0x541cc3){if(_0x541cc3){var _0x7baa05=_0x541cc3[_0x3459('0x1b')],_0x435b1f=_0x85b4c3['offset'],_0x1503f5=_0x85b4c3[_0x3459('0x1c')]+_0x85b4c3[_0x3459('0x1d')],_0x1bd36b;if(_0x1503f5>=_0x7baa05){_0x1503f5=_0x7baa05;_0x1bd36b=0xc8;}else{_0x1bd36b=0xce;}_0x8ddf90[_0x3459('0x19')](_0x1bd36b);return _0x8ddf90[_0x3459('0x1e')](_0x3459('0x1f'),_0x435b1f+'-'+_0x1503f5+'/'+_0x7baa05)['json'](_0x541cc3);}return null;};}function patchUpdates(_0x4d094e){return function(_0x4c1bf5){try{jsonpatch[_0x3459('0x20')](_0x4c1bf5,_0x4d094e,!![]);}catch(_0x30810c){return BPromise[_0x3459('0x21')](_0x30810c);}return _0x4c1bf5[_0x3459('0x22')]();};}function saveUpdates(_0x39d3c0,_0xe35422){return function(_0x33f29d){if(_0x33f29d){return _0x33f29d['update'](_0x39d3c0)[_0x3459('0x23')](function(_0x44485e){return _0x44485e;});}return null;};}function removeEntity(_0x1822e5,_0x14ff75){return function(_0xdec027){if(_0xdec027){return _0xdec027[_0x3459('0x24')]()[_0x3459('0x23')](function(){var _0x2cb652=_0xdec027[_0x3459('0x25')]({'plain':!![]});var _0x1c98e4=[{'name':'InboundRoutes','value':_0x3459('0x26'),'ignore':![]},{'name':_0x3459('0x27'),'value':_0x3459('0x28'),'ignore':![]},{'name':'InternalRoutes','value':_0x3459('0x29'),'ignore':![]}];var _0x3d2274=_(_0x1c98e4)[_0x3459('0x2a')](_0x3459('0x2b'))[_0x3459('0x2c')]('value')[_0x3459('0x2d')]();if(_[_0x3459('0x2e')](_0x3d2274,_0x2cb652[_0x3459('0x2f')])){return;}var _0x4a4337=_[_0x3459('0x30')](_0x1c98e4,[_0x3459('0x2d'),_0x2cb652[_0x3459('0x2f')]])[_0x3459('0x31')];return db[_0x3459('0x32')]['destroy']({'where':{'type':_0x4a4337,'resourceId':_0x2cb652['id']}})[_0x3459('0x23')](function(){return _0xdec027;});})[_0x3459('0x23')](function(){_0x1822e5[_0x3459('0x19')](0xcc)[_0x3459('0x33')]();});}};}function handleEntityNotFound(_0x19f01d,_0xd53e79){return function(_0x591393){if(!_0x591393){_0x19f01d[_0x3459('0x34')](0x194);}return _0x591393;};}function handleError(_0x5b1618,_0x38268c){_0x38268c=_0x38268c||0x1f4;return function(_0x2bded2){logger[_0x3459('0x35')](_0x2bded2['stack']);if(_0x2bded2[_0x3459('0x31')]){delete _0x2bded2['name'];}_0x5b1618[_0x3459('0x19')](_0x38268c)[_0x3459('0x36')](_0x2bded2);};}exports[_0x3459('0x37')]=function(_0x38f1e9,_0x56b1f1){var _0x5a31f6={},_0x4d17db={},_0x232db4={'count':0x0,'rows':[]};var _0x39a79a=db['VoiceExtension'][_0x3459('0x38')];_0x4d17db[_0x3459('0x39')]=_['keys'](_0x39a79a);_0x4d17db['query']=_[_0x3459('0x3a')](_0x38f1e9[_0x3459('0x3b')]);_0x4d17db['filters']=_['intersection'](_0x4d17db[_0x3459('0x39')],_0x4d17db[_0x3459('0x3b')]);_0x5a31f6[_0x3459('0x3c')]=_[_0x3459('0x3d')](_0x4d17db['model'],qs[_0x3459('0x3e')](_0x38f1e9[_0x3459('0x3b')][_0x3459('0x3e')]));_0x5a31f6[_0x3459('0x3c')]=_0x5a31f6[_0x3459('0x3c')][_0x3459('0x3f')]?_0x5a31f6[_0x3459('0x3c')]:_0x4d17db[_0x3459('0x39')];if(!_0x38f1e9[_0x3459('0x3b')][_0x3459('0x40')]('nolimit')){_0x5a31f6[_0x3459('0x1d')]=qs[_0x3459('0x1d')](_0x38f1e9[_0x3459('0x3b')][_0x3459('0x1d')]);_0x5a31f6[_0x3459('0x1c')]=qs[_0x3459('0x1c')](_0x38f1e9[_0x3459('0x3b')][_0x3459('0x1c')]);}_0x5a31f6[_0x3459('0x41')]=qs[_0x3459('0x42')](_0x38f1e9[_0x3459('0x3b')][_0x3459('0x42')]);_0x5a31f6['where']=qs['filters'](_['pick'](_0x38f1e9[_0x3459('0x3b')],_0x4d17db[_0x3459('0x43')]));if(_0x38f1e9['query']['filter']){_0x5a31f6['where']=_[_0x3459('0x44')](_0x5a31f6[_0x3459('0x45')],{'$or':_[_0x3459('0x2c')](_0x39a79a,function(_0xfc1545){if(_0xfc1545[_0x3459('0x2f')][_0x3459('0x46')]!==_0x3459('0x47')){var _0x232bf0={};_0x232bf0[_0xfc1545[_0x3459('0x48')]]={'$like':'%'+_0x38f1e9[_0x3459('0x3b')][_0x3459('0x2a')]+'%'};return _0x232bf0;}})});}_0x5a31f6=_[_0x3459('0x44')]({},_0x5a31f6,_0x38f1e9['options']);var _0x41660f={'where':_0x5a31f6[_0x3459('0x45')]};return db['VoiceExtension'][_0x3459('0x1b')](_0x41660f)[_0x3459('0x23')](function(_0x46963b){_0x232db4[_0x3459('0x1b')]=_0x46963b;if(_0x38f1e9[_0x3459('0x3b')][_0x3459('0x49')]){_0x5a31f6[_0x3459('0x4a')]=[{'all':!![]}];}return db[_0x3459('0x4b')][_0x3459('0x4c')](_0x5a31f6);})[_0x3459('0x23')](function(_0x27a6f6){_0x232db4['rows']=_0x27a6f6;return _0x232db4;})[_0x3459('0x23')](respondWithFilteredResult(_0x56b1f1,_0x5a31f6))[_0x3459('0x4d')](handleError(_0x56b1f1,null));};exports[_0x3459('0x4e')]=function(_0x585c2c,_0xf596c0){var _0x5a5cce={'raw':![],'where':{'id':_0x585c2c['params']['id']}},_0x313cd3={};_0x313cd3[_0x3459('0x39')]=_[_0x3459('0x3a')](db[_0x3459('0x4b')][_0x3459('0x38')]);_0x313cd3[_0x3459('0x3b')]=_[_0x3459('0x3a')](_0x585c2c[_0x3459('0x3b')]);_0x313cd3[_0x3459('0x43')]=_[_0x3459('0x3d')](_0x313cd3[_0x3459('0x39')],_0x313cd3[_0x3459('0x3b')]);_0x5a5cce[_0x3459('0x3c')]=_['intersection'](_0x313cd3['model'],qs[_0x3459('0x3e')](_0x585c2c['query'][_0x3459('0x3e')]));_0x5a5cce[_0x3459('0x3c')]=_0x5a5cce[_0x3459('0x3c')]['length']?_0x5a5cce[_0x3459('0x3c')]:_0x313cd3[_0x3459('0x39')];if(_0x585c2c[_0x3459('0x3b')][_0x3459('0x49')]){_0x5a5cce[_0x3459('0x4a')]=[{'all':!![]}];}_0x5a5cce=_[_0x3459('0x44')]({},_0x5a5cce,_0x585c2c['options']);return db[_0x3459('0x4b')][_0x3459('0x30')](_0x5a5cce)[_0x3459('0x23')](handleEntityNotFound(_0xf596c0,null))['then'](respondWithResult(_0xf596c0,null))[_0x3459('0x4d')](handleError(_0xf596c0,null));};exports[_0x3459('0x24')]=function(_0x5f2d9d,_0x1dbb15){return db[_0x3459('0x4b')][_0x3459('0x30')]({'where':{'id':_0x5f2d9d[_0x3459('0x4f')]['id']}})[_0x3459('0x23')](handleEntityNotFound(_0x1dbb15,null))[_0x3459('0x23')](removeEntity(_0x1dbb15,null))[_0x3459('0x4d')](handleError(_0x1dbb15,null));};exports[_0x3459('0x50')]=function(_0x3fda1c,_0x437172){if(_0x3fda1c['body'][_0x3459('0x2f')]===_0x3459('0x28')&&!_[_0x3459('0x51')](_0x3fda1c[_0x3459('0x52')][_0x3459('0x53')],'_')){_0x3fda1c['body'][_0x3459('0x53')]='_'[_0x3459('0x54')](_0x3fda1c['body']['exten']);}return db[_0x3459('0x4b')][_0x3459('0x50')](_0x3fda1c[_0x3459('0x52')],{'raw':![]})[_0x3459('0x23')](function(_0x5e886b){var _0xf6559=_0x3fda1c[_0x3459('0x55')]['get']({'plain':!![]});if(!_0xf6559)throw new Error(_0x3459('0x56'));if(_0xf6559[_0x3459('0x57')]===_0x3459('0x55')){var _0x4535b7=_0x5e886b['get']({'plain':!![]});var _0xddf994=[{'name':_0x3459('0x58'),'value':_0x3459('0x26')},{'name':_0x3459('0x27'),'value':_0x3459('0x28')},{'name':_0x3459('0x59'),'value':_0x3459('0x29')}];var _0x1a9c48=_[_0x3459('0x30')](_0xddf994,[_0x3459('0x2d'),_0x4535b7['type']])[_0x3459('0x31')];return db[_0x3459('0x5a')][_0x3459('0x30')]({'where':{'name':_0x1a9c48,'userProfileId':_0xf6559[_0x3459('0x5b')]},'raw':!![]})[_0x3459('0x23')](function(_0x24c3fd){if(_0x24c3fd&&_0x24c3fd[_0x3459('0x5c')]===0x0){return db['UserProfileResource'][_0x3459('0x50')]({'name':_0x4535b7[_0x3459('0x31')],'resourceId':_0x4535b7['id'],'type':_0x24c3fd[_0x3459('0x31')],'sectionId':_0x24c3fd['id']},{})[_0x3459('0x23')](function(){return _0x5e886b;});}else{return _0x5e886b;}})['catch'](function(_0x2b5ea0){logger[_0x3459('0x35')](_0x3459('0x5d'),_0x2b5ea0);throw _0x2b5ea0;});}return _0x5e886b;})[_0x3459('0x23')](respondWithResult(_0x437172,0xc9))[_0x3459('0x4d')](handleError(_0x437172,null));};exports['update']=function(_0x1c82bf,_0x862084){if(_0x1c82bf[_0x3459('0x52')]['id']){delete _0x1c82bf[_0x3459('0x52')]['id'];}return db[_0x3459('0x4b')][_0x3459('0x30')]({'where':{'id':_0x1c82bf[_0x3459('0x4f')]['id']}})[_0x3459('0x23')](handleEntityNotFound(_0x862084,null))[_0x3459('0x23')](function(_0x4eb775){if(_0x4eb775){return db[_0x3459('0x4b')]['update'](_[_0x3459('0x5e')](_0x1c82bf['body'],[_0x3459('0x53'),_0x3459('0x5f'),_0x3459('0x60'),_0x3459('0x61'),_0x3459('0x62'),_0x3459('0x63')]),{'where':{'context':_0x4eb775[_0x3459('0x5f')],'exten':_0x4eb775[_0x3459('0x53')]},'individualHooks':!![]})[_0x3459('0x23')](function(_0xb2808){return _0xb2808;});}return null;})[_0x3459('0x23')](respondWithStatusCode(_0x862084,null))[_0x3459('0x4d')](handleError(_0x862084,null));};exports[_0x3459('0x64')]=function(_0x4719e1,_0x1db2b3,_0x3d7ad1){return db[_0x3459('0x4b')]['findOne']({'where':{'id':_0x4719e1['params']['id']}})[_0x3459('0x23')](handleEntityNotFound(_0x1db2b3,null))[_0x3459('0x23')](function(_0x325aac){if(_0x325aac){return db[_0x3459('0x65')][_0x3459('0x66')](function(_0x3561cb){return db['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':_0x4719e1[_0x3459('0x4f')]['id']},'transaction':_0x3561cb})['then'](function(_0x1512a8){var _0x1261f9=_['map'](_0x4719e1[_0x3459('0x52')],function(_0x54afb0){_0x54afb0[_0x3459('0x67')]=_0x4719e1[_0x3459('0x4f')]['id'];return _0x54afb0;});return db['VoiceExtension']['bulkCreate'](_0x1261f9,{'transaction':_0x3561cb});});})[_0x3459('0x23')](function(){return db[_0x3459('0x4b')][_0x3459('0x68')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4719e1[_0x3459('0x4f')]['id']},'order':_0x3459('0x69')});});}})[_0x3459('0x23')](respondWithResult(_0x1db2b3,null))['catch'](handleError(_0x1db2b3,null));}; \ No newline at end of file +var _0xcebc=['sequelize','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','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','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','InboundRoutes','inbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','error','stack','send','VoiceExtension','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','key','field','include','findAll','rows','catch','show','includeAll','options','create','body','outbound','exten','concat','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','OutboundRoutes','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','findOne'];(function(_0x3f6b1b,_0x58d3d6){var _0x4a3d2b=function(_0x5648f0){while(--_0x5648f0){_0x3f6b1b['push'](_0x3f6b1b['shift']());}};_0x4a3d2b(++_0x58d3d6);}(_0xcebc,0x1c1));var _0xcceb=function(_0x1f4986,_0x4ffff8){_0x1f4986=_0x1f4986-0x0;var _0xa7fdf=_0xcebc[_0x1f4986];return _0xa7fdf;};'use strict';var pdf=require(_0xcceb('0x0'));var emlformat=require(_0xcceb('0x1'));var rimraf=require(_0xcceb('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcceb('0x3'));var rp=require(_0xcceb('0x4'));var moment=require(_0xcceb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xcceb('0x6'));var util=require(_0xcceb('0x7'));var path=require('path');var sox=require(_0xcceb('0x8'));var csv=require(_0xcceb('0x9'));var ejs=require(_0xcceb('0xa'));var fs=require('fs');var _=require(_0xcceb('0xb'));var squel=require(_0xcceb('0xc'));var crypto=require(_0xcceb('0xd'));var jsforce=require(_0xcceb('0xe'));var deskjs=require(_0xcceb('0xf'));var toCsv=require(_0xcceb('0x9'));var querystring=require(_0xcceb('0x10'));var Papa=require(_0xcceb('0x11'));var Redis=require(_0xcceb('0x12'));var authService=require(_0xcceb('0x13'));var qs=require(_0xcceb('0x14'));var hardwareService=require(_0xcceb('0x15'));var logger=require(_0xcceb('0x16'))(_0xcceb('0x17'));var utils=require(_0xcceb('0x18'));var config=require(_0xcceb('0x19'));var db=require(_0xcceb('0x1a'))['db'];config['redis']=_[_0xcceb('0x1b')](config[_0xcceb('0x1c')],{'host':_0xcceb('0x1d'),'port':0x18eb});var socket=require(_0xcceb('0x1e'))(new Redis(config[_0xcceb('0x1c')]));require(_0xcceb('0x1f'))['register'](socket);function respondWithStatusCode(_0x57e862,_0x1860fd){_0x1860fd=_0x1860fd||0xcc;return function(_0x1f02ba){if(_0x1f02ba){return _0x57e862[_0xcceb('0x20')](_0x1860fd);}return _0x57e862[_0xcceb('0x21')](_0x1860fd)[_0xcceb('0x22')]();};}function respondWithResult(_0xf3bea,_0x4db67b){_0x4db67b=_0x4db67b||0xc8;return function(_0x222d10){if(_0x222d10){return _0xf3bea['status'](_0x4db67b)[_0xcceb('0x23')](_0x222d10);}};}function respondWithFilteredResult(_0xcbfb7,_0x3a2db9){return function(_0x40dc5a){if(_0x40dc5a){var _0x3723c9=_0x40dc5a[_0xcceb('0x24')],_0x4f9c0b=_0x3a2db9[_0xcceb('0x25')],_0x4d530c=_0x3a2db9['offset']+_0x3a2db9[_0xcceb('0x26')],_0x222188;if(_0x4d530c>=_0x3723c9){_0x4d530c=_0x3723c9;_0x222188=0xc8;}else{_0x222188=0xce;}_0xcbfb7['status'](_0x222188);return _0xcbfb7[_0xcceb('0x27')]('Content-Range',_0x4f9c0b+'-'+_0x4d530c+'/'+_0x3723c9)['json'](_0x40dc5a);}return null;};}function patchUpdates(_0x31768f){return function(_0x999dc8){try{jsonpatch[_0xcceb('0x28')](_0x999dc8,_0x31768f,!![]);}catch(_0x955f0b){return BPromise[_0xcceb('0x29')](_0x955f0b);}return _0x999dc8[_0xcceb('0x2a')]();};}function saveUpdates(_0x1c5d46,_0x488a2c){return function(_0x460005){if(_0x460005){return _0x460005[_0xcceb('0x2b')](_0x1c5d46)[_0xcceb('0x2c')](function(_0xbb526e){return _0xbb526e;});}return null;};}function removeEntity(_0x292c83,_0x407d98){return function(_0x183ed2){if(_0x183ed2){return _0x183ed2[_0xcceb('0x2d')]()[_0xcceb('0x2c')](function(){var _0x34e6af=_0x183ed2['get']({'plain':!![]});var _0x96a14b=[{'name':_0xcceb('0x2e'),'value':_0xcceb('0x2f'),'ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':_0xcceb('0x30'),'value':_0xcceb('0x31'),'ignore':![]}];var _0x4d7b16=_(_0x96a14b)[_0xcceb('0x32')](_0xcceb('0x33'))[_0xcceb('0x34')](_0xcceb('0x35'))['value']();if(_[_0xcceb('0x36')](_0x4d7b16,_0x34e6af[_0xcceb('0x37')])){return;}var _0x18be7b=_[_0xcceb('0x38')](_0x96a14b,['value',_0x34e6af[_0xcceb('0x37')]])[_0xcceb('0x39')];return db['UserProfileResource'][_0xcceb('0x2d')]({'where':{'type':_0x18be7b,'resourceId':_0x34e6af['id']}})['then'](function(){return _0x183ed2;});})[_0xcceb('0x2c')](function(){_0x292c83[_0xcceb('0x21')](0xcc)[_0xcceb('0x22')]();});}};}function handleEntityNotFound(_0x24fd1c,_0x1f7439){return function(_0x594af2){if(!_0x594af2){_0x24fd1c[_0xcceb('0x20')](0x194);}return _0x594af2;};}function handleError(_0x41f5fa,_0x3cb952){_0x3cb952=_0x3cb952||0x1f4;return function(_0x3aa311){logger[_0xcceb('0x3a')](_0x3aa311[_0xcceb('0x3b')]);if(_0x3aa311[_0xcceb('0x39')]){delete _0x3aa311['name'];}_0x41f5fa[_0xcceb('0x21')](_0x3cb952)[_0xcceb('0x3c')](_0x3aa311);};}exports['index']=function(_0x1afe43,_0x571c12){var _0x2e2c6a={},_0xc25d82={},_0x1876a7={'count':0x0,'rows':[]};var _0x115be0=db[_0xcceb('0x3d')][_0xcceb('0x3e')];_0xc25d82[_0xcceb('0x3f')]=_[_0xcceb('0x40')](_0x115be0);_0xc25d82['query']=_[_0xcceb('0x40')](_0x1afe43['query']);_0xc25d82[_0xcceb('0x41')]=_[_0xcceb('0x42')](_0xc25d82[_0xcceb('0x3f')],_0xc25d82[_0xcceb('0x43')]);_0x2e2c6a[_0xcceb('0x44')]=_[_0xcceb('0x42')](_0xc25d82[_0xcceb('0x3f')],qs[_0xcceb('0x45')](_0x1afe43[_0xcceb('0x43')][_0xcceb('0x45')]));_0x2e2c6a[_0xcceb('0x44')]=_0x2e2c6a[_0xcceb('0x44')][_0xcceb('0x46')]?_0x2e2c6a[_0xcceb('0x44')]:_0xc25d82['model'];if(!_0x1afe43[_0xcceb('0x43')][_0xcceb('0x47')](_0xcceb('0x48'))){_0x2e2c6a[_0xcceb('0x26')]=qs[_0xcceb('0x26')](_0x1afe43[_0xcceb('0x43')][_0xcceb('0x26')]);_0x2e2c6a[_0xcceb('0x25')]=qs['offset'](_0x1afe43[_0xcceb('0x43')][_0xcceb('0x25')]);}_0x2e2c6a['order']=qs[_0xcceb('0x49')](_0x1afe43['query']['sort']);_0x2e2c6a[_0xcceb('0x4a')]=qs[_0xcceb('0x41')](_[_0xcceb('0x4b')](_0x1afe43[_0xcceb('0x43')],_0xc25d82[_0xcceb('0x41')]));if(_0x1afe43[_0xcceb('0x43')]['filter']){_0x2e2c6a['where']=_[_0xcceb('0x4c')](_0x2e2c6a[_0xcceb('0x4a')],{'$or':_[_0xcceb('0x34')](_0x115be0,function(_0x29b5a0){if(_0x29b5a0[_0xcceb('0x37')][_0xcceb('0x4d')]!=='VIRTUAL'){var _0x315777={};_0x315777[_0x29b5a0[_0xcceb('0x4e')]]={'$like':'%'+_0x1afe43[_0xcceb('0x43')][_0xcceb('0x32')]+'%'};return _0x315777;}})});}_0x2e2c6a=_['merge']({},_0x2e2c6a,_0x1afe43['options']);var _0x500aa9={'where':_0x2e2c6a[_0xcceb('0x4a')]};return db['VoiceExtension'][_0xcceb('0x24')](_0x500aa9)[_0xcceb('0x2c')](function(_0x511432){_0x1876a7[_0xcceb('0x24')]=_0x511432;if(_0x1afe43[_0xcceb('0x43')]['includeAll']){_0x2e2c6a[_0xcceb('0x4f')]=[{'all':!![]}];}return db['VoiceExtension'][_0xcceb('0x50')](_0x2e2c6a);})[_0xcceb('0x2c')](function(_0x38e753){_0x1876a7[_0xcceb('0x51')]=_0x38e753;return _0x1876a7;})['then'](respondWithFilteredResult(_0x571c12,_0x2e2c6a))[_0xcceb('0x52')](handleError(_0x571c12,null));};exports[_0xcceb('0x53')]=function(_0x13a769,_0x324c7b){var _0x175646={'raw':![],'where':{'id':_0x13a769['params']['id']}},_0x26e225={};_0x26e225[_0xcceb('0x3f')]=_[_0xcceb('0x40')](db[_0xcceb('0x3d')][_0xcceb('0x3e')]);_0x26e225['query']=_[_0xcceb('0x40')](_0x13a769['query']);_0x26e225['filters']=_[_0xcceb('0x42')](_0x26e225['model'],_0x26e225['query']);_0x175646[_0xcceb('0x44')]=_['intersection'](_0x26e225['model'],qs['fields'](_0x13a769[_0xcceb('0x43')][_0xcceb('0x45')]));_0x175646[_0xcceb('0x44')]=_0x175646[_0xcceb('0x44')][_0xcceb('0x46')]?_0x175646['attributes']:_0x26e225[_0xcceb('0x3f')];if(_0x13a769[_0xcceb('0x43')][_0xcceb('0x54')]){_0x175646['include']=[{'all':!![]}];}_0x175646=_[_0xcceb('0x4c')]({},_0x175646,_0x13a769[_0xcceb('0x55')]);return db[_0xcceb('0x3d')][_0xcceb('0x38')](_0x175646)[_0xcceb('0x2c')](handleEntityNotFound(_0x324c7b,null))[_0xcceb('0x2c')](respondWithResult(_0x324c7b,null))[_0xcceb('0x52')](handleError(_0x324c7b,null));};exports['destroy']=function(_0x55b9d6,_0x2253e9){return db[_0xcceb('0x3d')][_0xcceb('0x38')]({'where':{'id':_0x55b9d6['params']['id']}})[_0xcceb('0x2c')](handleEntityNotFound(_0x2253e9,null))[_0xcceb('0x2c')](removeEntity(_0x2253e9,null))[_0xcceb('0x52')](handleError(_0x2253e9,null));};exports[_0xcceb('0x56')]=function(_0x3e7bbc,_0x433880){if(_0x3e7bbc[_0xcceb('0x57')][_0xcceb('0x37')]===_0xcceb('0x58')&&!_['startsWith'](_0x3e7bbc[_0xcceb('0x57')][_0xcceb('0x59')],'_')){_0x3e7bbc[_0xcceb('0x57')][_0xcceb('0x59')]='_'[_0xcceb('0x5a')](_0x3e7bbc['body'][_0xcceb('0x59')]);}return db[_0xcceb('0x3d')]['create'](_0x3e7bbc[_0xcceb('0x57')],{'raw':![]})[_0xcceb('0x2c')](function(_0x48a31c){var _0x1c26c2=_0x3e7bbc['user'][_0xcceb('0x5b')]({'plain':!![]});if(!_0x1c26c2)throw new Error(_0xcceb('0x5c'));if(_0x1c26c2['role']===_0xcceb('0x5d')){var _0x42396f=_0x48a31c[_0xcceb('0x5b')]({'plain':!![]});var _0xd7e64=[{'name':_0xcceb('0x2e'),'value':_0xcceb('0x2f')},{'name':_0xcceb('0x5e'),'value':_0xcceb('0x58')},{'name':_0xcceb('0x30'),'value':_0xcceb('0x31')}];var _0x50cca7=_[_0xcceb('0x38')](_0xd7e64,[_0xcceb('0x35'),_0x42396f[_0xcceb('0x37')]])[_0xcceb('0x39')];return db['UserProfileSection'][_0xcceb('0x38')]({'where':{'name':_0x50cca7,'userProfileId':_0x1c26c2[_0xcceb('0x5f')]},'raw':!![]})['then'](function(_0x28a253){if(_0x28a253&&_0x28a253['autoAssociation']===0x0){return db[_0xcceb('0x60')][_0xcceb('0x56')]({'name':_0x42396f[_0xcceb('0x39')],'resourceId':_0x42396f['id'],'type':_0x28a253[_0xcceb('0x39')],'sectionId':_0x28a253['id']},{})[_0xcceb('0x2c')](function(){return _0x48a31c;});}else{return _0x48a31c;}})['catch'](function(_0x3a31cb){logger[_0xcceb('0x3a')](_0xcceb('0x61'),_0x3a31cb);throw _0x3a31cb;});}return _0x48a31c;})[_0xcceb('0x2c')](respondWithResult(_0x433880,0xc9))[_0xcceb('0x52')](handleError(_0x433880,null));};exports['update']=function(_0x3f66b6,_0x2e7d6a){if(_0x3f66b6[_0xcceb('0x57')]['id']){delete _0x3f66b6[_0xcceb('0x57')]['id'];}return db[_0xcceb('0x3d')]['find']({'where':{'id':_0x3f66b6[_0xcceb('0x62')]['id']}})[_0xcceb('0x2c')](handleEntityNotFound(_0x2e7d6a,null))[_0xcceb('0x2c')](function(_0x30b005){if(_0x30b005){return db[_0xcceb('0x3d')][_0xcceb('0x2b')](_[_0xcceb('0x4b')](_0x3f66b6[_0xcceb('0x57')],[_0xcceb('0x59'),_0xcceb('0x63'),_0xcceb('0x64'),_0xcceb('0x65'),_0xcceb('0x66'),_0xcceb('0x67')]),{'where':{'context':_0x30b005[_0xcceb('0x63')],'exten':_0x30b005[_0xcceb('0x59')]},'individualHooks':!![]})[_0xcceb('0x2c')](function(_0x570749){return _0x570749;});}return null;})[_0xcceb('0x2c')](respondWithStatusCode(_0x2e7d6a,null))['catch'](handleError(_0x2e7d6a,null));};exports[_0xcceb('0x68')]=function(_0x4d2c7e,_0x49d412,_0x497cf8){return db[_0xcceb('0x3d')][_0xcceb('0x69')]({'where':{'id':_0x4d2c7e[_0xcceb('0x62')]['id']}})['then'](handleEntityNotFound(_0x49d412,null))[_0xcceb('0x2c')](function(_0x2646f9){if(_0x2646f9){return db[_0xcceb('0x6a')]['transaction'](function(_0x231704){return db[_0xcceb('0x3d')][_0xcceb('0x2d')]({'where':{'VoiceExtensionId':_0x4d2c7e[_0xcceb('0x62')]['id']},'transaction':_0x231704})[_0xcceb('0x2c')](function(_0x3d76fc){var _0x2b9ad6=_[_0xcceb('0x34')](_0x4d2c7e['body'],function(_0x3daacc){_0x3daacc[_0xcceb('0x6b')]=_0x4d2c7e[_0xcceb('0x62')]['id'];return _0x3daacc;});return db['VoiceExtension'][_0xcceb('0x6c')](_0x2b9ad6,{'transaction':_0x231704});});})[_0xcceb('0x2c')](function(){return db['VoiceExtension'][_0xcceb('0x6d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4d2c7e[_0xcceb('0x62')]['id']},'order':_0xcceb('0x6e')});});}})[_0xcceb('0x2c')](respondWithResult(_0x49d412,null))[_0xcceb('0x52')](handleError(_0x49d412,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 98c71fe..710caf5 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 _0x00bb=['remove','hook','exports','events','../../mysqldb','VoiceExtension','save'];(function(_0x102977,_0x3a99a6){var _0x15c466=function(_0x1a6a12){while(--_0x1a6a12){_0x102977['push'](_0x102977['shift']());}};_0x15c466(++_0x3a99a6);}(_0x00bb,0x1d8));var _0xb00b=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x00bb[_0xbb091];return _0x467a04;};'use strict';var EventEmitter=require(_0xb00b('0x0'));var VoiceExtension=require(_0xb00b('0x1'))['db'][_0xb00b('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb00b('0x3'),'afterUpdate':'update','afterDestroy':_0xb00b('0x4')};function emitEvent(_0x464fe7){return function(_0x582ef9,_0x14b5d0,_0x2dbd25){VoiceExtensionEvents['emit'](_0x464fe7+':'+_0x582ef9['id'],_0x582ef9);VoiceExtensionEvents['emit'](_0x464fe7,_0x582ef9);_0x2dbd25(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xb00b('0x5')](e,emitEvent(event));}}module[_0xb00b('0x6')]=VoiceExtensionEvents; \ No newline at end of file +var _0x9c44=['save','update','remove','emit','hasOwnProperty','hook','exports','VoiceExtension','setMaxListeners'];(function(_0x36f0e7,_0x506161){var _0x2f6993=function(_0xd5ec8d){while(--_0xd5ec8d){_0x36f0e7['push'](_0x36f0e7['shift']());}};_0x2f6993(++_0x506161);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0x49c4('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x49c4('0x1')](0x0);var events={'afterCreate':_0x49c4('0x2'),'afterUpdate':_0x49c4('0x3'),'afterDestroy':_0x49c4('0x4')};function emitEvent(_0x2ad237){return function(_0x4e0313,_0x4941f1,_0x41a183){VoiceExtensionEvents['emit'](_0x2ad237+':'+_0x4e0313['id'],_0x4e0313);VoiceExtensionEvents[_0x49c4('0x5')](_0x2ad237,_0x4e0313);_0x41a183(null);};}for(var e in events){if(events[_0x49c4('0x6')](e)){var event=events[e];VoiceExtension[_0x49c4('0x7')](e,emitEvent(event));}}module[_0x49c4('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 469742c..9ad3f65 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 _0x1b30=['./voiceExtension.attributes','define','VoiceExtension','voice_extensions','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x1afe99,_0x561560){var _0x115847=function(_0x2ec998){while(--_0x2ec998){_0x1afe99['push'](_0x1afe99['shift']());}};_0x115847(++_0x561560);}(_0x1b30,0x144));var _0x01b3=function(_0x13960b,_0x447aef){_0x13960b=_0x13960b-0x0;var _0xc0ce91=_0x1b30[_0x13960b];return _0xc0ce91;};'use strict';var _=require(_0x01b3('0x0'));var util=require(_0x01b3('0x1'));var logger=require(_0x01b3('0x2'))('api');var moment=require('moment');var BPromise=require(_0x01b3('0x3'));var rp=require(_0x01b3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x01b3('0x5'));var config=require('../../config/environment');var attributes=require(_0x01b3('0x6'));module['exports']=function(_0x5d4497,_0x44594a){return _0x5d4497[_0x01b3('0x7')](_0x01b3('0x8'),attributes,{'tableName':_0x01b3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf480=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./voiceExtension.attributes','exports','VoiceExtension','voice_extensions','util'];(function(_0xaf088d,_0x485dd8){var _0x1b5fe7=function(_0x2927a9){while(--_0x2927a9){_0xaf088d['push'](_0xaf088d['shift']());}};_0x1b5fe7(++_0x485dd8);}(_0xf480,0xe6));var _0x0f48=function(_0x53274a,_0x21b709){_0x53274a=_0x53274a-0x0;var _0x36ac6e=_0xf480[_0x53274a];return _0x36ac6e;};'use strict';var _=require('lodash');var util=require(_0x0f48('0x0'));var logger=require(_0x0f48('0x1'))(_0x0f48('0x2'));var moment=require(_0x0f48('0x3'));var BPromise=require(_0x0f48('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0f48('0x5'));var config=require(_0x0f48('0x6'));var attributes=require(_0x0f48('0x7'));module[_0x0f48('0x8')]=function(_0x28eff8,_0x1600e5){return _0x28eff8['define'](_0x0f48('0x9'),attributes,{'tableName':_0x0f48('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index aa6269f..66b02af 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 _0x750a=['map','model','attributes','GetVoiceExtension','stringify','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','register','then','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','VoiceExtension','options','where','limit','include'];(function(_0x55dea8,_0x369d68){var _0x57f09e=function(_0x272d88){while(--_0x272d88){_0x55dea8['push'](_0x55dea8['shift']());}};_0x57f09e(++_0x369d68);}(_0x750a,0x140));var _0xa750=function(_0x345b02,_0x454869){_0x345b02=_0x345b02-0x0;var _0x51483b=_0x750a[_0x345b02];return _0x51483b;};'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});config[_0xa750('0xb')]=_[_0xa750('0xc')](config[_0xa750('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa750('0xb')]));require('./voiceExtension.socket')[_0xa750('0xd')](socket);function respondWithRpcPromise(_0x1760f5,_0x51f594,_0x264284){return new BPromise(function(_0x2c2ea4,_0x5870f0){return client['request'](_0x1760f5,_0x264284)[_0xa750('0xe')](function(_0x4b19a1){logger[_0xa750('0xf')](_0xa750('0x10'),_0x51f594,'request\x20sent');logger[_0xa750('0x11')](_0xa750('0x12'),_0x51f594,_0xa750('0x13'),JSON['stringify'](_0x4b19a1));if(_0x4b19a1[_0xa750('0x14')]){if(_0x4b19a1[_0xa750('0x14')][_0xa750('0x15')]===0x1f4){logger[_0xa750('0x14')](_0xa750('0x10'),_0x51f594,_0x4b19a1[_0xa750('0x14')]['message']);return _0x5870f0(_0x4b19a1[_0xa750('0x14')][_0xa750('0x16')]);}logger[_0xa750('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x51f594,_0x4b19a1[_0xa750('0x14')][_0xa750('0x16')]);return _0x2c2ea4(_0x4b19a1['error']['message']);}else{logger[_0xa750('0xf')]('VoiceExtension,\x20%s,\x20%s',_0x51f594,_0xa750('0x13'));_0x2c2ea4(_0x4b19a1[_0xa750('0x17')]['message']);}})[_0xa750('0x18')](function(_0x500a84){logger['error'](_0xa750('0x10'),_0x51f594,_0x500a84);_0x5870f0(_0x500a84);});});}exports['GetVoiceExtension']=function(_0x3fa031){var _0x4f170f=this;return new Promise(function(_0x174a8c,_0x4a007d){return db[_0xa750('0x19')]['findAll']({'raw':_0x3fa031[_0xa750('0x1a')]?_0x3fa031['options']['raw']===undefined?!![]:![]:!![],'where':_0x3fa031[_0xa750('0x1a')]?_0x3fa031['options'][_0xa750('0x1b')]||null:null,'attributes':_0x3fa031['options']?_0x3fa031['options']['attributes']||null:null,'limit':_0x3fa031['options']?_0x3fa031[_0xa750('0x1a')][_0xa750('0x1c')]||null:null,'include':_0x3fa031[_0xa750('0x1a')]?_0x3fa031[_0xa750('0x1a')][_0xa750('0x1d')]?_[_0xa750('0x1e')](_0x3fa031[_0xa750('0x1a')][_0xa750('0x1d')],function(_0x3d52b3){return{'model':db[_0x3d52b3[_0xa750('0x1f')]],'as':_0x3d52b3['as'],'attributes':_0x3d52b3[_0xa750('0x20')],'include':_0x3d52b3[_0xa750('0x1d')]?_[_0xa750('0x1e')](_0x3d52b3[_0xa750('0x1d')],function(_0x310e2d){return{'model':db[_0x310e2d['model']],'as':_0x310e2d['as'],'attributes':_0x310e2d[_0xa750('0x20')],'include':_0x310e2d[_0xa750('0x1d')]?_[_0xa750('0x1e')](_0x310e2d['include'],function(_0x35ab53){return{'model':db[_0x35ab53[_0xa750('0x1f')]],'as':_0x35ab53['as'],'attributes':_0x35ab53[_0xa750('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa750('0xe')](function(_0x579f1c){logger[_0xa750('0xf')](_0xa750('0x21'),_0x3fa031);logger[_0xa750('0x11')](_0xa750('0x21'),_0x3fa031,JSON[_0xa750('0x22')](_0x579f1c));_0x174a8c(_0x579f1c);})['catch'](function(_0x46cc11){logger['error'](_0xa750('0x21'),_0x46cc11[_0xa750('0x16')],_0x3fa031);_0x4a007d(_0x4f170f['error'](0x1f4,_0x46cc11[_0xa750('0x16')]));});});}; \ No newline at end of file +var _0xda3f=['message','result','catch','findAll','options','where','attributes','limit','include','map','model','GetVoiceExtension','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0xda3f,0xec));var _0xfda3=function(_0x4cf18f,_0x3dde3c){_0x4cf18f=_0x4cf18f-0x0;var _0x42ac8b=_0xda3f[_0x4cf18f];return _0x42ac8b;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});config['redis']=_[_0xfda3('0x7')](config[_0xfda3('0x8')],{'host':_0xfda3('0x9'),'port':0x18eb});var socket=require(_0xfda3('0xa'))(new Redis(config[_0xfda3('0x8')]));require(_0xfda3('0xb'))[_0xfda3('0xc')](socket);function respondWithRpcPromise(_0x1b1ea6,_0xdc5b45,_0x14d549){return new BPromise(function(_0x102643,_0x4713ba){return client['request'](_0x1b1ea6,_0x14d549)[_0xfda3('0xd')](function(_0x14936b){logger[_0xfda3('0xe')](_0xfda3('0xf'),_0xdc5b45,_0xfda3('0x10'));logger['debug'](_0xfda3('0x11'),_0xdc5b45,'request\x20sent',JSON[_0xfda3('0x12')](_0x14936b));if(_0x14936b[_0xfda3('0x13')]){if(_0x14936b['error']['code']===0x1f4){logger['error'](_0xfda3('0xf'),_0xdc5b45,_0x14936b[_0xfda3('0x13')]['message']);return _0x4713ba(_0x14936b['error']['message']);}logger[_0xfda3('0x13')](_0xfda3('0xf'),_0xdc5b45,_0x14936b[_0xfda3('0x13')][_0xfda3('0x14')]);return _0x102643(_0x14936b[_0xfda3('0x13')][_0xfda3('0x14')]);}else{logger[_0xfda3('0xe')](_0xfda3('0xf'),_0xdc5b45,_0xfda3('0x10'));_0x102643(_0x14936b[_0xfda3('0x15')]['message']);}})[_0xfda3('0x16')](function(_0x1bbdda){logger[_0xfda3('0x13')](_0xfda3('0xf'),_0xdc5b45,_0x1bbdda);_0x4713ba(_0x1bbdda);});});}exports['GetVoiceExtension']=function(_0x42faad){var _0x43cfac=this;return new Promise(function(_0x2ee74c,_0x51e731){return db['VoiceExtension'][_0xfda3('0x17')]({'raw':_0x42faad[_0xfda3('0x18')]?_0x42faad[_0xfda3('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x42faad[_0xfda3('0x18')]?_0x42faad[_0xfda3('0x18')][_0xfda3('0x19')]||null:null,'attributes':_0x42faad[_0xfda3('0x18')]?_0x42faad[_0xfda3('0x18')][_0xfda3('0x1a')]||null:null,'limit':_0x42faad[_0xfda3('0x18')]?_0x42faad[_0xfda3('0x18')][_0xfda3('0x1b')]||null:null,'include':_0x42faad['options']?_0x42faad[_0xfda3('0x18')][_0xfda3('0x1c')]?_[_0xfda3('0x1d')](_0x42faad['options'][_0xfda3('0x1c')],function(_0x39e246){return{'model':db[_0x39e246[_0xfda3('0x1e')]],'as':_0x39e246['as'],'attributes':_0x39e246[_0xfda3('0x1a')],'include':_0x39e246[_0xfda3('0x1c')]?_[_0xfda3('0x1d')](_0x39e246['include'],function(_0x3c6d7d){return{'model':db[_0x3c6d7d[_0xfda3('0x1e')]],'as':_0x3c6d7d['as'],'attributes':_0x3c6d7d[_0xfda3('0x1a')],'include':_0x3c6d7d[_0xfda3('0x1c')]?_[_0xfda3('0x1d')](_0x3c6d7d['include'],function(_0x3c1549){return{'model':db[_0x3c1549[_0xfda3('0x1e')]],'as':_0x3c1549['as'],'attributes':_0x3c1549[_0xfda3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xfda3('0xd')](function(_0xe21ec6){logger[_0xfda3('0xe')](_0xfda3('0x1f'),_0x42faad);logger['debug']('GetVoiceExtension',_0x42faad,JSON[_0xfda3('0x12')](_0xe21ec6));_0x2ee74c(_0xe21ec6);})['catch'](function(_0x4b9d90){logger[_0xfda3('0x13')](_0xfda3('0x1f'),_0x4b9d90[_0xfda3('0x14')],_0x42faad);_0x51e731(_0x43cfac[_0xfda3('0x13')](0x1f4,_0x4b9d90[_0xfda3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 417b953..c4f933f 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 _0x4eb1=['save','remove','update','emit','removeListener','./voiceExtension.events'];(function(_0x19717b,_0x9994ce){var _0xf1627b=function(_0x382ad2){while(--_0x382ad2){_0x19717b['push'](_0x19717b['shift']());}};_0xf1627b(++_0x9994ce);}(_0x4eb1,0x1e5));var _0x14eb=function(_0xb6298b,_0x2631cc){_0xb6298b=_0xb6298b-0x0;var _0x3239d9=_0x4eb1[_0xb6298b];return _0x3239d9;};'use strict';var VoiceExtensionEvents=require(_0x14eb('0x0'));var events=[_0x14eb('0x1'),_0x14eb('0x2'),_0x14eb('0x3')];function createListener(_0x3c840d,_0xdaa33a){return function(_0x2f2c47){_0xdaa33a[_0x14eb('0x4')](_0x3c840d,_0x2f2c47);};}function removeListener(_0x375632,_0x348801){return function(){VoiceExtensionEvents[_0x14eb('0x5')](_0x375632,_0x348801);};}exports['register']=function(_0x3cad84){for(var _0x4ae2f0=0x0,_0xe64c93=events['length'];_0x4ae2f0<_0xe64c93;_0x4ae2f0++){var _0x752b1a=events[_0x4ae2f0];var _0x1377cd=createListener('voiceExtension:'+_0x752b1a,_0x3cad84);VoiceExtensionEvents['on'](_0x752b1a,_0x1377cd);}}; \ No newline at end of file +var _0x64f7=['length','./voiceExtension.events','save','remove','update','removeListener','register'];(function(_0x3fc7fa,_0x433a3f){var _0x5e518f=function(_0x43198b){while(--_0x43198b){_0x3fc7fa['push'](_0x3fc7fa['shift']());}};_0x5e518f(++_0x433a3f);}(_0x64f7,0x86));var _0x764f=function(_0x22d14e,_0x54fed0){_0x22d14e=_0x22d14e-0x0;var _0x35cad0=_0x64f7[_0x22d14e];return _0x35cad0;};'use strict';var VoiceExtensionEvents=require(_0x764f('0x0'));var events=[_0x764f('0x1'),_0x764f('0x2'),_0x764f('0x3')];function createListener(_0x29db57,_0x3639f1){return function(_0x168593){_0x3639f1['emit'](_0x29db57,_0x168593);};}function removeListener(_0x3d1d1d,_0x2c1da6){return function(){VoiceExtensionEvents[_0x764f('0x4')](_0x3d1d1d,_0x2c1da6);};}exports[_0x764f('0x5')]=function(_0x2961ab){for(var _0x19a78a=0x0,_0x535ba7=events[_0x764f('0x6')];_0x19a78a<_0x535ba7;_0x19a78a++){var _0x40201a=events[_0x19a78a];var _0x151d67=createListener('voiceExtension:'+_0x40201a,_0x2961ab);VoiceExtensionEvents['on'](_0x40201a,_0x151d67);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 20b84fb..ea91743 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 _0xed63=['post','put','update','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages'];(function(_0x2b2974,_0x13b4f8){var _0x3e509e=function(_0x561824){while(--_0x561824){_0x2b2974['push'](_0x2b2974['shift']());}};_0x3e509e(++_0x13b4f8);}(_0xed63,0xd0));var _0x3ed6=function(_0x3d8793,_0x61f7fa){_0x3d8793=_0x3d8793-0x0;var _0x3a7686=_0xed63[_0x3d8793];return _0x3a7686;};'use strict';var multer=require(_0x3ed6('0x0'));var util=require(_0x3ed6('0x1'));var path=require('path');var timeout=require(_0x3ed6('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x3ed6('0x3'));var interaction=require(_0x3ed6('0x4'));var config=require(_0x3ed6('0x5'));var controller=require(_0x3ed6('0x6'));router[_0x3ed6('0x7')]('/',auth[_0x3ed6('0x8')](),controller[_0x3ed6('0x9')]);router[_0x3ed6('0x7')](_0x3ed6('0xa'),auth[_0x3ed6('0x8')](),controller[_0x3ed6('0xb')]);router[_0x3ed6('0x7')](_0x3ed6('0xc'),auth['isAuthenticated'](),controller['getMessages']);router[_0x3ed6('0xd')]('/',auth[_0x3ed6('0x8')](),controller['create']);router[_0x3ed6('0xe')]('/:id',auth[_0x3ed6('0x8')](),controller[_0x3ed6('0xf')]);router['delete']('/:id',auth[_0x3ed6('0x8')](),controller['destroy']);module[_0x3ed6('0x10')]=router; \ No newline at end of file +var _0x3743=['/:id','isAuthenticated','show','/:id/messages','put','delete','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get'];(function(_0x4f1c68,_0x212885){var _0x314dea=function(_0x175d4d){while(--_0x175d4d){_0x4f1c68['push'](_0x4f1c68['shift']());}};_0x314dea(++_0x212885);}(_0x3743,0x150));var _0x3374=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x3743[_0x5a776b];return _0xbbef59;};'use strict';var multer=require('multer');var util=require(_0x3374('0x0'));var path=require(_0x3374('0x1'));var timeout=require('connect-timeout');var express=require(_0x3374('0x2'));var router=express[_0x3374('0x3')]();var auth=require(_0x3374('0x4'));var interaction=require(_0x3374('0x5'));var config=require(_0x3374('0x6'));var controller=require(_0x3374('0x7'));router[_0x3374('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3374('0x8')](_0x3374('0x9'),auth[_0x3374('0xa')](),controller[_0x3374('0xb')]);router[_0x3374('0x8')](_0x3374('0xc'),auth[_0x3374('0xa')](),controller['getMessages']);router['post']('/',auth[_0x3374('0xa')](),controller['create']);router[_0x3374('0xd')](_0x3374('0x9'),auth[_0x3374('0xa')](),controller['update']);router[_0x3374('0xe')]('/:id',auth[_0x3374('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 4cf7bbd..a258868 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 _0x7cdf=['contest_mailbox','email','string','trim','central','ENUM','yes','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','fullname','exports','STRING','from-voicemail'];(function(_0x218972,_0x1f9794){var _0x1bb1a8=function(_0x3fb962){while(--_0x3fb962){_0x218972['push'](_0x218972['shift']());}};_0x1bb1a8(++_0x1f9794);}(_0x7cdf,0xcf));var _0xf7cd=function(_0x9c516a,_0x5345db){_0x9c516a=_0x9c516a-0x0;var _0x569e74=_0x7cdf[_0x9c516a];return _0x569e74;};'use strict';var Sequelize=require('sequelize');module[_0xf7cd('0x0')]={'customer_id':{'type':Sequelize[_0xf7cd('0x1')]},'context':{'type':Sequelize[_0xf7cd('0x1')],'defaultValue':_0xf7cd('0x2'),'unique':_0xf7cd('0x3')},'mailbox':{'type':Sequelize[_0xf7cd('0x1')],'defaultValue':'','allowNull':![],'unique':_0xf7cd('0x3')},'password':{'type':Sequelize[_0xf7cd('0x1')]},'fullname':{'type':Sequelize[_0xf7cd('0x1')]},'email':{'type':Sequelize[_0xf7cd('0x1')],'validate':{'isEmail':!![]},'set':function(_0x4de6fd){this['setDataValue'](_0xf7cd('0x4'),typeof _0x4de6fd===_0xf7cd('0x5')&&_0x4de6fd[_0xf7cd('0x6')]()?_0x4de6fd[_0xf7cd('0x6')]():null);}},'pager':{'type':Sequelize[_0xf7cd('0x1')]},'tz':{'type':Sequelize[_0xf7cd('0x1')],'defaultValue':_0xf7cd('0x7')},'attach':{'type':Sequelize[_0xf7cd('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xf7cd('0x8')](_0xf7cd('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xf7cd('0x1')]},'callback':{'type':Sequelize[_0xf7cd('0x1')]},'review':{'type':Sequelize['ENUM'](_0xf7cd('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xf7cd('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xf7cd('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0xf7cd('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xf7cd('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xf7cd('0x8')](_0xf7cd('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xf7cd('0x8')](_0xf7cd('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xf7cd('0x8')]('yes','no'),'defaultValue':_0xf7cd('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0xf7cd('0x8')](_0xf7cd('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xf7cd('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xf7cd('0x8')]('yes','no'),'defaultValue':_0xf7cd('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0xf7cd('0x1')]},'emailbody':{'type':Sequelize[_0xf7cd('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xf7cd('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xf7cd('0xc')],'get':function(){return this[_0xf7cd('0xd')](_0xf7cd('0xe'))+'\x20-\x20'+this[_0xf7cd('0xd')]('mailbox');}}}; \ No newline at end of file +var _0x374f=['STRING','contest_mailbox','setDataValue','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports'];(function(_0x345cca,_0x2f2ab5){var _0x4d043f=function(_0x445a37){while(--_0x445a37){_0x345cca['push'](_0x345cca['shift']());}};_0x4d043f(++_0x2f2ab5);}(_0x374f,0x196));var _0xf374=function(_0x369bdc,_0x3f6bfd){_0x369bdc=_0x369bdc-0x0;var _0x1f12f9=_0x374f[_0x369bdc];return _0x1f12f9;};'use strict';var Sequelize=require(_0xf374('0x0'));module[_0xf374('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xf374('0x2')],'defaultValue':'from-voicemail','unique':_0xf374('0x3')},'mailbox':{'type':Sequelize[_0xf374('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xf374('0x2')]},'fullname':{'type':Sequelize[_0xf374('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x148640){this[_0xf374('0x4')]('email',typeof _0x148640===_0xf374('0x5')&&_0x148640[_0xf374('0x6')]()?_0x148640[_0xf374('0x6')]():null);}},'pager':{'type':Sequelize[_0xf374('0x2')]},'tz':{'type':Sequelize[_0xf374('0x2')],'defaultValue':_0xf374('0x7')},'attach':{'type':Sequelize[_0xf374('0x8')](_0xf374('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xf374('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0xf374('0x2')]},'callback':{'type':Sequelize[_0xf374('0x2')]},'review':{'type':Sequelize[_0xf374('0x8')](_0xf374('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xf374('0x8')](_0xf374('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xf374('0x8')](_0xf374('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xf374('0x8')](_0xf374('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xf374('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xf374('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xf374('0x8')](_0xf374('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xf374('0x8')]('yes','no'),'defaultValue':_0xf374('0x9'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xf374('0x8')](_0xf374('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xf374('0x8')](_0xf374('0x9'),'no'),'defaultValue':_0xf374('0x9'),'allowNull':![]},'stamp':{'type':_0xf374('0xb')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xf374('0x2')]},'maxsecs':{'type':Sequelize[_0xf374('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xf374('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xf374('0xd')](_0xf374('0xe'))+_0xf374('0xf')+this[_0xf374('0xd')](_0xf374('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index dfebabc..b2928de 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 _0x4cd3=['role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','pick','findAndCountAll','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','api','../../config/environment','sendStatus','status','end','json','count','offset','apply','reject','save','update','destroy','get','Voicemails','UserProfileResource','then','error','name','send','index','VoiceMail','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','filter','merge','map','key','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x37b8fd,_0xca5866){var _0x551cb8=function(_0xb13ed1){while(--_0xb13ed1){_0x37b8fd['push'](_0x37b8fd['shift']());}};_0x551cb8(++_0xca5866);}(_0x4cd3,0xa9));var _0x34cd=function(_0x4aa838,_0x4aa14f){_0x4aa838=_0x4aa838-0x0;var _0x3abff0=_0x4cd3[_0x4aa838];return _0x3abff0;};'use strict';var pdf=require(_0x34cd('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x34cd('0x1'));var jsonpatch=require(_0x34cd('0x2'));var rp=require(_0x34cd('0x3'));var moment=require(_0x34cd('0x4'));var BPromise=require(_0x34cd('0x5'));var Mustache=require('mustache');var util=require(_0x34cd('0x6'));var path=require(_0x34cd('0x7'));var sox=require(_0x34cd('0x8'));var csv=require(_0x34cd('0x9'));var ejs=require(_0x34cd('0xa'));var fs=require('fs');var _=require(_0x34cd('0xb'));var squel=require('squel');var crypto=require(_0x34cd('0xc'));var jsforce=require(_0x34cd('0xd'));var deskjs=require(_0x34cd('0xe'));var toCsv=require(_0x34cd('0x9'));var querystring=require(_0x34cd('0xf'));var Papa=require('papaparse');var Redis=require(_0x34cd('0x10'));var authService=require(_0x34cd('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x34cd('0x12'));var utils=require('../../config/utils');var config=require(_0x34cd('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe89332,_0x572fbd){_0x572fbd=_0x572fbd||0xcc;return function(_0x3f7297){if(_0x3f7297){return _0xe89332[_0x34cd('0x14')](_0x572fbd);}return _0xe89332[_0x34cd('0x15')](_0x572fbd)[_0x34cd('0x16')]();};}function respondWithResult(_0x51eed0,_0x13c2a6){_0x13c2a6=_0x13c2a6||0xc8;return function(_0x2ddcf2){if(_0x2ddcf2){return _0x51eed0[_0x34cd('0x15')](_0x13c2a6)[_0x34cd('0x17')](_0x2ddcf2);}};}function respondWithFilteredResult(_0x1c211f,_0x388724){return function(_0x3d621d){if(_0x3d621d){var _0x5277ff=_0x3d621d[_0x34cd('0x18')],_0x4ffbe4=_0x388724[_0x34cd('0x19')],_0x455841=_0x388724[_0x34cd('0x19')]+_0x388724['limit'],_0x5798b1;if(_0x455841>=_0x5277ff){_0x455841=_0x5277ff;_0x5798b1=0xc8;}else{_0x5798b1=0xce;}_0x1c211f[_0x34cd('0x15')](_0x5798b1);return _0x1c211f['set']('Content-Range',_0x4ffbe4+'-'+_0x455841+'/'+_0x5277ff)[_0x34cd('0x17')](_0x3d621d);}return null;};}function patchUpdates(_0x456187){return function(_0x3b4d8c){try{jsonpatch[_0x34cd('0x1a')](_0x3b4d8c,_0x456187,!![]);}catch(_0xfbc629){return BPromise[_0x34cd('0x1b')](_0xfbc629);}return _0x3b4d8c[_0x34cd('0x1c')]();};}function saveUpdates(_0x38dbd0,_0x1b0d8e){return function(_0x3c0e0a){if(_0x3c0e0a){return _0x3c0e0a[_0x34cd('0x1d')](_0x38dbd0)['then'](function(_0x8637de){return _0x8637de;});}return null;};}function removeEntity(_0x5ad170,_0x3514c8){return function(_0x22eb90){if(_0x22eb90){return _0x22eb90[_0x34cd('0x1e')]()['then'](function(){var _0x5cc78f=_0x22eb90[_0x34cd('0x1f')]({'plain':!![]});var _0x5602bf=_0x34cd('0x20');return db[_0x34cd('0x21')][_0x34cd('0x1e')]({'where':{'type':_0x5602bf,'resourceId':_0x5cc78f['id']}})[_0x34cd('0x22')](function(){return _0x22eb90;});})[_0x34cd('0x22')](function(){_0x5ad170['status'](0xcc)[_0x34cd('0x16')]();});}};}function handleEntityNotFound(_0x5b8490,_0x13d949){return function(_0x237d86){if(!_0x237d86){_0x5b8490[_0x34cd('0x14')](0x194);}return _0x237d86;};}function handleError(_0x3832c8,_0xa7096a){_0xa7096a=_0xa7096a||0x1f4;return function(_0x53e019){logger[_0x34cd('0x23')](_0x53e019['stack']);if(_0x53e019['name']){delete _0x53e019[_0x34cd('0x24')];}_0x3832c8[_0x34cd('0x15')](_0xa7096a)[_0x34cd('0x25')](_0x53e019);};}exports[_0x34cd('0x26')]=function(_0x382b6c,_0x310b5d){var _0x1e9e24={},_0x2b360c={},_0x5eac74={'count':0x0,'rows':[]};var _0x56f821=db[_0x34cd('0x27')][_0x34cd('0x28')];_0x2b360c[_0x34cd('0x29')]=_['keys'](_0x56f821);_0x2b360c[_0x34cd('0x2a')]=_[_0x34cd('0x2b')](_0x382b6c[_0x34cd('0x2a')]);_0x2b360c[_0x34cd('0x2c')]=_[_0x34cd('0x2d')](_0x2b360c[_0x34cd('0x29')],_0x2b360c[_0x34cd('0x2a')]);_0x1e9e24[_0x34cd('0x2e')]=_[_0x34cd('0x2d')](_0x2b360c['model'],qs[_0x34cd('0x2f')](_0x382b6c[_0x34cd('0x2a')][_0x34cd('0x2f')]));_0x1e9e24[_0x34cd('0x2e')]=_0x1e9e24[_0x34cd('0x2e')]['length']?_0x1e9e24[_0x34cd('0x2e')]:_0x2b360c['model'];if(!_0x382b6c['query'][_0x34cd('0x30')](_0x34cd('0x31'))){_0x1e9e24['limit']=qs[_0x34cd('0x32')](_0x382b6c['query']['limit']);_0x1e9e24['offset']=qs[_0x34cd('0x19')](_0x382b6c[_0x34cd('0x2a')][_0x34cd('0x19')]);}_0x1e9e24['order']=qs[_0x34cd('0x33')](_0x382b6c[_0x34cd('0x2a')][_0x34cd('0x33')]);_0x1e9e24[_0x34cd('0x34')]=qs['filters'](_['pick'](_0x382b6c[_0x34cd('0x2a')],_0x2b360c['filters']));if(_0x382b6c[_0x34cd('0x2a')][_0x34cd('0x35')]){_0x1e9e24['where']=_[_0x34cd('0x36')](_0x1e9e24[_0x34cd('0x34')],{'$or':_[_0x34cd('0x37')](_0x56f821,function(_0x307496){if(_0x307496['type'][_0x34cd('0x38')]!==_0x34cd('0x39')){var _0x1b9a6e={};_0x1b9a6e[_0x307496['field']]={'$like':'%'+_0x382b6c[_0x34cd('0x2a')][_0x34cd('0x35')]+'%'};return _0x1b9a6e;}})});}_0x1e9e24=_['merge']({},_0x1e9e24,_0x382b6c[_0x34cd('0x3a')]);var _0x1d39aa={'where':_0x1e9e24['where']};return db[_0x34cd('0x27')][_0x34cd('0x18')](_0x1d39aa)[_0x34cd('0x22')](function(_0x386c74){_0x5eac74['count']=_0x386c74;if(_0x382b6c['query'][_0x34cd('0x3b')]){_0x1e9e24[_0x34cd('0x3c')]=[{'all':!![]}];}return db[_0x34cd('0x27')][_0x34cd('0x3d')](_0x1e9e24);})[_0x34cd('0x22')](function(_0x262dad){_0x5eac74['rows']=_0x262dad;return _0x5eac74;})[_0x34cd('0x22')](respondWithFilteredResult(_0x310b5d,_0x1e9e24))[_0x34cd('0x3e')](handleError(_0x310b5d,null));};exports[_0x34cd('0x3f')]=function(_0x1c648a,_0x5b2dd7){var _0x3d6ab3={'raw':!![],'where':{'id':_0x1c648a[_0x34cd('0x40')]['id']}},_0x2f86b9={};_0x2f86b9['model']=_[_0x34cd('0x2b')](db[_0x34cd('0x27')][_0x34cd('0x28')]);_0x2f86b9[_0x34cd('0x2a')]=_[_0x34cd('0x2b')](_0x1c648a[_0x34cd('0x2a')]);_0x2f86b9[_0x34cd('0x2c')]=_[_0x34cd('0x2d')](_0x2f86b9[_0x34cd('0x29')],_0x2f86b9[_0x34cd('0x2a')]);_0x3d6ab3[_0x34cd('0x2e')]=_[_0x34cd('0x2d')](_0x2f86b9[_0x34cd('0x29')],qs['fields'](_0x1c648a[_0x34cd('0x2a')][_0x34cd('0x2f')]));_0x3d6ab3[_0x34cd('0x2e')]=_0x3d6ab3['attributes'][_0x34cd('0x41')]?_0x3d6ab3['attributes']:_0x2f86b9['model'];if(_0x1c648a[_0x34cd('0x2a')][_0x34cd('0x3b')]){_0x3d6ab3[_0x34cd('0x3c')]=[{'all':!![]}];}_0x3d6ab3=_[_0x34cd('0x36')]({},_0x3d6ab3,_0x1c648a[_0x34cd('0x3a')]);return db[_0x34cd('0x27')][_0x34cd('0x42')](_0x3d6ab3)[_0x34cd('0x22')](handleEntityNotFound(_0x5b2dd7,null))[_0x34cd('0x22')](respondWithResult(_0x5b2dd7,null))[_0x34cd('0x3e')](handleError(_0x5b2dd7,null));};exports[_0x34cd('0x43')]=function(_0x3b4828,_0x441764){return db[_0x34cd('0x27')]['create'](_0x3b4828[_0x34cd('0x44')],{})['then'](function(_0x40f821){var _0x1d9bd2=_0x3b4828[_0x34cd('0x45')][_0x34cd('0x1f')]({'plain':!![]});if(!_0x1d9bd2)throw new Error(_0x34cd('0x46'));if(_0x1d9bd2[_0x34cd('0x47')]===_0x34cd('0x45')){var _0x1e6bd6=_0x40f821['get']({'plain':!![]});var _0x327027='Voicemails';return db[_0x34cd('0x48')][_0x34cd('0x42')]({'where':{'name':_0x327027,'userProfileId':_0x1d9bd2['userProfileId']},'raw':!![]})['then'](function(_0xde4f12){if(_0xde4f12&&_0xde4f12[_0x34cd('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0x1e6bd6[_0x34cd('0x24')],'resourceId':_0x1e6bd6['id'],'type':_0xde4f12[_0x34cd('0x24')],'sectionId':_0xde4f12['id']},{})[_0x34cd('0x22')](function(){return _0x40f821;});}else{return _0x40f821;}})[_0x34cd('0x3e')](function(_0x35f838){logger[_0x34cd('0x23')](_0x34cd('0x4a'),_0x35f838);throw _0x35f838;});}return _0x40f821;})[_0x34cd('0x22')](respondWithResult(_0x441764,0xc9))['catch'](handleError(_0x441764,null));};exports[_0x34cd('0x1d')]=function(_0x57e726,_0x518bf3){if(_0x57e726['body']['id']){delete _0x57e726['body']['id'];}return db[_0x34cd('0x27')][_0x34cd('0x42')]({'where':{'id':_0x57e726[_0x34cd('0x40')]['id']}})[_0x34cd('0x22')](handleEntityNotFound(_0x518bf3,null))[_0x34cd('0x22')](saveUpdates(_0x57e726['body'],null))[_0x34cd('0x22')](respondWithResult(_0x518bf3,null))[_0x34cd('0x3e')](handleError(_0x518bf3,null));};exports['destroy']=function(_0x14a147,_0x38f1b5){return db[_0x34cd('0x27')]['find']({'where':{'id':_0x14a147[_0x34cd('0x40')]['id']}})[_0x34cd('0x22')](handleEntityNotFound(_0x38f1b5,null))[_0x34cd('0x22')](removeEntity(_0x38f1b5,null))[_0x34cd('0x3e')](handleError(_0x38f1b5,null));};exports[_0x34cd('0x4b')]=function(_0x3f9aa2,_0xd4ce8a,_0x25a16f){return db[_0x34cd('0x27')][_0x34cd('0x4c')]({'where':{'id':_0x3f9aa2[_0x34cd('0x40')]['id']}})[_0x34cd('0x22')](handleEntityNotFound(_0xd4ce8a,null))['then'](function(_0x15ab27){var _0x3b7fa6;var _0x5f40de={},_0x35b1e8={};_0x35b1e8[_0x34cd('0x29')]=_[_0x34cd('0x2b')](db[_0x34cd('0x4d')]['rawAttributes']);_0x35b1e8[_0x34cd('0x2a')]=_[_0x34cd('0x2b')](_0x3f9aa2[_0x34cd('0x2a')]);_0x35b1e8[_0x34cd('0x2c')]=_[_0x34cd('0x2d')](_0x35b1e8[_0x34cd('0x29')],_0x35b1e8['query']);_0x5f40de[_0x34cd('0x2e')]=_[_0x34cd('0x2d')](_0x35b1e8[_0x34cd('0x29')],qs[_0x34cd('0x2f')](_0x3f9aa2[_0x34cd('0x2a')]['fields']));_0x5f40de['attributes']=_0x5f40de[_0x34cd('0x2e')][_0x34cd('0x41')]?_0x5f40de[_0x34cd('0x2e')]:_0x35b1e8[_0x34cd('0x29')];if(!_0x3f9aa2[_0x34cd('0x2a')][_0x34cd('0x30')](_0x34cd('0x31'))){_0x5f40de[_0x34cd('0x32')]=qs[_0x34cd('0x32')](_0x3f9aa2['query'][_0x34cd('0x32')]);_0x5f40de[_0x34cd('0x19')]=qs[_0x34cd('0x19')](_0x3f9aa2[_0x34cd('0x2a')]['offset']);}_0x5f40de['order']=qs['sort'](_0x3f9aa2[_0x34cd('0x2a')][_0x34cd('0x33')]);_0x5f40de[_0x34cd('0x34')]=qs['filters'](_[_0x34cd('0x4e')](_0x3f9aa2[_0x34cd('0x2a')],_0x35b1e8[_0x34cd('0x2c')]));if(_0x3f9aa2[_0x34cd('0x2a')][_0x34cd('0x35')]){_0x5f40de['where']=_[_0x34cd('0x36')](_0x5f40de['where'],{'$or':_[_0x34cd('0x37')](_0x5f40de['attributes'],function(_0x41011f){var _0x2e0828={};_0x2e0828[_0x41011f]={'$like':'%'+_0x3f9aa2[_0x34cd('0x2a')][_0x34cd('0x35')]+'%'};return _0x2e0828;})});}_0x5f40de[_0x34cd('0x34')]=_['merge'](_0x5f40de['where'],{'mailboxuser':_0x15ab27['mailbox']});_0x5f40de=_['merge']({},_0x5f40de,_0x3f9aa2[_0x34cd('0x3a')]);return db['VoiceMailMessage'][_0x34cd('0x4f')](_0x5f40de)[_0x34cd('0x22')](respondWithFilteredResult(_0xd4ce8a,_0x5f40de));})[_0x34cd('0x3e')](handleError(_0xd4ce8a,null));}; \ No newline at end of file +var _0x9af0=['set','Content-Range','apply','update','then','get','Voicemails','sendStatus','name','send','index','VoiceMail','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','body','destroy','mailbox','VoiceMailMessage','findAndCountAll','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','status','end','json','count','offset','limit'];(function(_0xca8958,_0x25eed8){var _0x3d7165=function(_0x5dcced){while(--_0x5dcced){_0xca8958['push'](_0xca8958['shift']());}};_0x3d7165(++_0x25eed8);}(_0x9af0,0x8a));var _0x09af=function(_0xced191,_0x17ab5b){_0xced191=_0xced191-0x0;var _0x5ecb59=_0x9af0[_0xced191];return _0x5ecb59;};'use strict';var pdf=require(_0x09af('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x09af('0x1'));var zipdir=require(_0x09af('0x2'));var jsonpatch=require(_0x09af('0x3'));var rp=require('request-promise');var moment=require(_0x09af('0x4'));var BPromise=require(_0x09af('0x5'));var Mustache=require(_0x09af('0x6'));var util=require(_0x09af('0x7'));var path=require(_0x09af('0x8'));var sox=require(_0x09af('0x9'));var csv=require(_0x09af('0xa'));var ejs=require(_0x09af('0xb'));var fs=require('fs');var _=require(_0x09af('0xc'));var squel=require(_0x09af('0xd'));var crypto=require('crypto');var jsforce=require(_0x09af('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x09af('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x09af('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x09af('0x10'));var hardwareService=require(_0x09af('0x11'));var logger=require('../../config/logger')(_0x09af('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x09af('0x13'))['db'];function respondWithStatusCode(_0x27454a,_0x197cba){_0x197cba=_0x197cba||0xcc;return function(_0x48b504){if(_0x48b504){return _0x27454a['sendStatus'](_0x197cba);}return _0x27454a[_0x09af('0x14')](_0x197cba)[_0x09af('0x15')]();};}function respondWithResult(_0x507ab2,_0x56bf60){_0x56bf60=_0x56bf60||0xc8;return function(_0x1c83fa){if(_0x1c83fa){return _0x507ab2['status'](_0x56bf60)[_0x09af('0x16')](_0x1c83fa);}};}function respondWithFilteredResult(_0x5899a0,_0x37a28c){return function(_0x499d01){if(_0x499d01){var _0x44daaa=_0x499d01[_0x09af('0x17')],_0x57eed9=_0x37a28c[_0x09af('0x18')],_0x5119af=_0x37a28c['offset']+_0x37a28c[_0x09af('0x19')],_0x1b4e63;if(_0x5119af>=_0x44daaa){_0x5119af=_0x44daaa;_0x1b4e63=0xc8;}else{_0x1b4e63=0xce;}_0x5899a0[_0x09af('0x14')](_0x1b4e63);return _0x5899a0[_0x09af('0x1a')](_0x09af('0x1b'),_0x57eed9+'-'+_0x5119af+'/'+_0x44daaa)[_0x09af('0x16')](_0x499d01);}return null;};}function patchUpdates(_0x3cff1d){return function(_0x435f7d){try{jsonpatch[_0x09af('0x1c')](_0x435f7d,_0x3cff1d,!![]);}catch(_0x49181f){return BPromise['reject'](_0x49181f);}return _0x435f7d['save']();};}function saveUpdates(_0x793b39,_0x3aba62){return function(_0x9255a4){if(_0x9255a4){return _0x9255a4[_0x09af('0x1d')](_0x793b39)['then'](function(_0x2c19ea){return _0x2c19ea;});}return null;};}function removeEntity(_0xbbf658,_0x3b336a){return function(_0x2cfb7a){if(_0x2cfb7a){return _0x2cfb7a['destroy']()[_0x09af('0x1e')](function(){var _0x1ade45=_0x2cfb7a[_0x09af('0x1f')]({'plain':!![]});var _0x558df4=_0x09af('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x558df4,'resourceId':_0x1ade45['id']}})[_0x09af('0x1e')](function(){return _0x2cfb7a;});})[_0x09af('0x1e')](function(){_0xbbf658[_0x09af('0x14')](0xcc)[_0x09af('0x15')]();});}};}function handleEntityNotFound(_0x553488,_0x44be01){return function(_0x31508b){if(!_0x31508b){_0x553488[_0x09af('0x21')](0x194);}return _0x31508b;};}function handleError(_0x8f1f41,_0x66abe4){_0x66abe4=_0x66abe4||0x1f4;return function(_0x54518b){logger['error'](_0x54518b['stack']);if(_0x54518b[_0x09af('0x22')]){delete _0x54518b['name'];}_0x8f1f41['status'](_0x66abe4)[_0x09af('0x23')](_0x54518b);};}exports[_0x09af('0x24')]=function(_0x1a255d,_0x40badf){var _0x255a57={},_0x5d9c11={},_0x5bde8e={'count':0x0,'rows':[]};var _0x3b381d=db[_0x09af('0x25')][_0x09af('0x26')];_0x5d9c11[_0x09af('0x27')]=_['keys'](_0x3b381d);_0x5d9c11[_0x09af('0x28')]=_[_0x09af('0x29')](_0x1a255d[_0x09af('0x28')]);_0x5d9c11[_0x09af('0x2a')]=_['intersection'](_0x5d9c11[_0x09af('0x27')],_0x5d9c11[_0x09af('0x28')]);_0x255a57[_0x09af('0x2b')]=_[_0x09af('0x2c')](_0x5d9c11['model'],qs[_0x09af('0x2d')](_0x1a255d[_0x09af('0x28')][_0x09af('0x2d')]));_0x255a57[_0x09af('0x2b')]=_0x255a57[_0x09af('0x2b')][_0x09af('0x2e')]?_0x255a57[_0x09af('0x2b')]:_0x5d9c11[_0x09af('0x27')];if(!_0x1a255d['query'][_0x09af('0x2f')](_0x09af('0x30'))){_0x255a57[_0x09af('0x19')]=qs['limit'](_0x1a255d[_0x09af('0x28')][_0x09af('0x19')]);_0x255a57[_0x09af('0x18')]=qs['offset'](_0x1a255d[_0x09af('0x28')][_0x09af('0x18')]);}_0x255a57[_0x09af('0x31')]=qs[_0x09af('0x32')](_0x1a255d[_0x09af('0x28')][_0x09af('0x32')]);_0x255a57[_0x09af('0x33')]=qs[_0x09af('0x2a')](_[_0x09af('0x34')](_0x1a255d[_0x09af('0x28')],_0x5d9c11[_0x09af('0x2a')]));if(_0x1a255d[_0x09af('0x28')][_0x09af('0x35')]){_0x255a57[_0x09af('0x33')]=_[_0x09af('0x36')](_0x255a57[_0x09af('0x33')],{'$or':_[_0x09af('0x37')](_0x3b381d,function(_0x28f26d){if(_0x28f26d[_0x09af('0x38')][_0x09af('0x39')]!==_0x09af('0x3a')){var _0x3cbe10={};_0x3cbe10[_0x28f26d['field']]={'$like':'%'+_0x1a255d[_0x09af('0x28')][_0x09af('0x35')]+'%'};return _0x3cbe10;}})});}_0x255a57=_[_0x09af('0x36')]({},_0x255a57,_0x1a255d['options']);var _0x13c029={'where':_0x255a57[_0x09af('0x33')]};return db[_0x09af('0x25')][_0x09af('0x17')](_0x13c029)['then'](function(_0x8157c2){_0x5bde8e[_0x09af('0x17')]=_0x8157c2;if(_0x1a255d[_0x09af('0x28')][_0x09af('0x3b')]){_0x255a57[_0x09af('0x3c')]=[{'all':!![]}];}return db['VoiceMail'][_0x09af('0x3d')](_0x255a57);})[_0x09af('0x1e')](function(_0xe52d79){_0x5bde8e[_0x09af('0x3e')]=_0xe52d79;return _0x5bde8e;})[_0x09af('0x1e')](respondWithFilteredResult(_0x40badf,_0x255a57))[_0x09af('0x3f')](handleError(_0x40badf,null));};exports[_0x09af('0x40')]=function(_0x4e5bfa,_0x1f551a){var _0x4a0022={'raw':!![],'where':{'id':_0x4e5bfa[_0x09af('0x41')]['id']}},_0x24c3e7={};_0x24c3e7[_0x09af('0x27')]=_[_0x09af('0x29')](db[_0x09af('0x25')][_0x09af('0x26')]);_0x24c3e7[_0x09af('0x28')]=_[_0x09af('0x29')](_0x4e5bfa[_0x09af('0x28')]);_0x24c3e7[_0x09af('0x2a')]=_['intersection'](_0x24c3e7[_0x09af('0x27')],_0x24c3e7['query']);_0x4a0022[_0x09af('0x2b')]=_[_0x09af('0x2c')](_0x24c3e7[_0x09af('0x27')],qs[_0x09af('0x2d')](_0x4e5bfa[_0x09af('0x28')]['fields']));_0x4a0022[_0x09af('0x2b')]=_0x4a0022[_0x09af('0x2b')][_0x09af('0x2e')]?_0x4a0022[_0x09af('0x2b')]:_0x24c3e7[_0x09af('0x27')];if(_0x4e5bfa[_0x09af('0x28')][_0x09af('0x3b')]){_0x4a0022[_0x09af('0x3c')]=[{'all':!![]}];}_0x4a0022=_[_0x09af('0x36')]({},_0x4a0022,_0x4e5bfa[_0x09af('0x42')]);return db[_0x09af('0x25')]['find'](_0x4a0022)[_0x09af('0x1e')](handleEntityNotFound(_0x1f551a,null))[_0x09af('0x1e')](respondWithResult(_0x1f551a,null))['catch'](handleError(_0x1f551a,null));};exports[_0x09af('0x43')]=function(_0x3922b1,_0x5bafcd){return db[_0x09af('0x25')][_0x09af('0x43')](_0x3922b1['body'],{})[_0x09af('0x1e')](function(_0x23642e){var _0xc56ed3=_0x3922b1[_0x09af('0x44')][_0x09af('0x1f')]({'plain':!![]});if(!_0xc56ed3)throw new Error(_0x09af('0x45'));if(_0xc56ed3[_0x09af('0x46')]===_0x09af('0x44')){var _0x28c2c4=_0x23642e['get']({'plain':!![]});var _0x132e92=_0x09af('0x20');return db[_0x09af('0x47')][_0x09af('0x48')]({'where':{'name':_0x132e92,'userProfileId':_0xc56ed3[_0x09af('0x49')]},'raw':!![]})[_0x09af('0x1e')](function(_0x274b3e){if(_0x274b3e&&_0x274b3e[_0x09af('0x4a')]===0x0){return db[_0x09af('0x4b')][_0x09af('0x43')]({'name':_0x28c2c4[_0x09af('0x22')],'resourceId':_0x28c2c4['id'],'type':_0x274b3e[_0x09af('0x22')],'sectionId':_0x274b3e['id']},{})[_0x09af('0x1e')](function(){return _0x23642e;});}else{return _0x23642e;}})[_0x09af('0x3f')](function(_0x5943e8){logger[_0x09af('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5943e8);throw _0x5943e8;});}return _0x23642e;})[_0x09af('0x1e')](respondWithResult(_0x5bafcd,0xc9))[_0x09af('0x3f')](handleError(_0x5bafcd,null));};exports[_0x09af('0x1d')]=function(_0xabf7c1,_0x2621dd){if(_0xabf7c1[_0x09af('0x4d')]['id']){delete _0xabf7c1[_0x09af('0x4d')]['id'];}return db['VoiceMail']['find']({'where':{'id':_0xabf7c1[_0x09af('0x41')]['id']}})[_0x09af('0x1e')](handleEntityNotFound(_0x2621dd,null))['then'](saveUpdates(_0xabf7c1[_0x09af('0x4d')],null))['then'](respondWithResult(_0x2621dd,null))[_0x09af('0x3f')](handleError(_0x2621dd,null));};exports[_0x09af('0x4e')]=function(_0x4c429c,_0x458748){return db['VoiceMail'][_0x09af('0x48')]({'where':{'id':_0x4c429c[_0x09af('0x41')]['id']}})[_0x09af('0x1e')](handleEntityNotFound(_0x458748,null))[_0x09af('0x1e')](removeEntity(_0x458748,null))[_0x09af('0x3f')](handleError(_0x458748,null));};exports['getMessages']=function(_0x54086d,_0x41eff0,_0x17bee9){return db['VoiceMail']['findOne']({'where':{'id':_0x54086d[_0x09af('0x41')]['id']}})['then'](handleEntityNotFound(_0x41eff0,null))[_0x09af('0x1e')](function(_0x1b9d39){var _0x5cac5a;var _0x19e3a0={},_0x329402={};_0x329402['model']=_[_0x09af('0x29')](db['VoiceMailMessage'][_0x09af('0x26')]);_0x329402['query']=_[_0x09af('0x29')](_0x54086d[_0x09af('0x28')]);_0x329402[_0x09af('0x2a')]=_[_0x09af('0x2c')](_0x329402[_0x09af('0x27')],_0x329402[_0x09af('0x28')]);_0x19e3a0[_0x09af('0x2b')]=_[_0x09af('0x2c')](_0x329402[_0x09af('0x27')],qs['fields'](_0x54086d[_0x09af('0x28')][_0x09af('0x2d')]));_0x19e3a0[_0x09af('0x2b')]=_0x19e3a0[_0x09af('0x2b')][_0x09af('0x2e')]?_0x19e3a0[_0x09af('0x2b')]:_0x329402[_0x09af('0x27')];if(!_0x54086d[_0x09af('0x28')][_0x09af('0x2f')]('nolimit')){_0x19e3a0['limit']=qs[_0x09af('0x19')](_0x54086d[_0x09af('0x28')][_0x09af('0x19')]);_0x19e3a0[_0x09af('0x18')]=qs[_0x09af('0x18')](_0x54086d[_0x09af('0x28')][_0x09af('0x18')]);}_0x19e3a0[_0x09af('0x31')]=qs[_0x09af('0x32')](_0x54086d[_0x09af('0x28')][_0x09af('0x32')]);_0x19e3a0[_0x09af('0x33')]=qs[_0x09af('0x2a')](_[_0x09af('0x34')](_0x54086d[_0x09af('0x28')],_0x329402[_0x09af('0x2a')]));if(_0x54086d[_0x09af('0x28')][_0x09af('0x35')]){_0x19e3a0[_0x09af('0x33')]=_['merge'](_0x19e3a0[_0x09af('0x33')],{'$or':_[_0x09af('0x37')](_0x19e3a0[_0x09af('0x2b')],function(_0x1898e5){var _0x3edd74={};_0x3edd74[_0x1898e5]={'$like':'%'+_0x54086d[_0x09af('0x28')][_0x09af('0x35')]+'%'};return _0x3edd74;})});}_0x19e3a0['where']=_['merge'](_0x19e3a0[_0x09af('0x33')],{'mailboxuser':_0x1b9d39[_0x09af('0x4f')]});_0x19e3a0=_[_0x09af('0x36')]({},_0x19e3a0,_0x54086d[_0x09af('0x42')]);return db[_0x09af('0x50')][_0x09af('0x51')](_0x19e3a0)[_0x09af('0x1e')](respondWithFilteredResult(_0x41eff0,_0x19e3a0));})[_0x09af('0x3f')](handleError(_0x41eff0,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index a0fcc3c..9269e87 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 _0xf687=['bluebird','path','../../config/environment','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','api','moment'];(function(_0x1889a3,_0x2476ac){var _0x37a60d=function(_0x5e89a8){while(--_0x5e89a8){_0x1889a3['push'](_0x1889a3['shift']());}};_0x37a60d(++_0x2476ac);}(_0xf687,0x15a));var _0x7f68=function(_0x5ecac8,_0x246286){_0x5ecac8=_0x5ecac8-0x0;var _0x255862=_0xf687[_0x5ecac8];return _0x255862;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7f68('0x0'));var moment=require(_0x7f68('0x1'));var BPromise=require(_0x7f68('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f68('0x3'));var rimraf=require('rimraf');var config=require(_0x7f68('0x4'));var attributes=require('./voiceMail.attributes');module[_0x7f68('0x5')]=function(_0x58572b,_0x37ca9f){return _0x58572b[_0x7f68('0x6')](_0x7f68('0x7'),attributes,{'tableName':_0x7f68('0x8'),'paranoid':![],'indexes':[{'name':_0x7f68('0x9'),'fields':[_0x7f68('0xa'),_0x7f68('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf27e=['mailbox_context','mailbox','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail'];(function(_0x246808,_0x2d6576){var _0x2364db=function(_0x113b8a){while(--_0x113b8a){_0x246808['push'](_0x246808['shift']());}};_0x2364db(++_0x2d6576);}(_0xf27e,0x80));var _0xef27=function(_0x3e59ce,_0x35a0f6){_0x3e59ce=_0x3e59ce-0x0;var _0x53f4ca=_0xf27e[_0x3e59ce];return _0x53f4ca;};'use strict';var _=require(_0xef27('0x0'));var util=require(_0xef27('0x1'));var logger=require(_0xef27('0x2'))(_0xef27('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xef27('0x4'));var fs=require('fs');var path=require(_0xef27('0x5'));var rimraf=require('rimraf');var config=require(_0xef27('0x6'));var attributes=require(_0xef27('0x7'));module[_0xef27('0x8')]=function(_0x792e75,_0x1bfe18){return _0x792e75[_0xef27('0x9')](_0xef27('0xa'),attributes,{'tableName':_0xef27('0xb'),'paranoid':![],'indexes':[{'name':_0xef27('0xc'),'fields':[_0xef27('0xd'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 1d1ad56..5d4cff6 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 _0xca88=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','result','catch','lodash','util','moment','../../mysqldb'];(function(_0x26e4ff,_0x557272){var _0x211b75=function(_0x49078d){while(--_0x49078d){_0x26e4ff['push'](_0x26e4ff['shift']());}};_0x211b75(++_0x557272);}(_0xca88,0x14c));var _0x8ca8=function(_0x1aa4f2,_0x325b80){_0x1aa4f2=_0x1aa4f2-0x0;var _0x4786d6=_0xca88[_0x1aa4f2];return _0x4786d6;};'use strict';var _=require(_0x8ca8('0x0'));var util=require(_0x8ca8('0x1'));var moment=require(_0x8ca8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ca8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ca8('0x4'))(_0x8ca8('0x5'));var config=require(_0x8ca8('0x6'));var jayson=require(_0x8ca8('0x7'));var client=jayson['client'][_0x8ca8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x405eae,_0x1e487f,_0x265717){return new BPromise(function(_0x295813,_0x5b59c8){return client[_0x8ca8('0x9')](_0x405eae,_0x265717)['then'](function(_0x5bcad4){logger[_0x8ca8('0xa')]('VoiceMail,\x20%s,\x20%s',_0x1e487f,'request\x20sent');logger[_0x8ca8('0xb')](_0x8ca8('0xc'),_0x1e487f,_0x8ca8('0xd'),JSON[_0x8ca8('0xe')](_0x5bcad4));if(_0x5bcad4['error']){if(_0x5bcad4[_0x8ca8('0xf')][_0x8ca8('0x10')]===0x1f4){logger[_0x8ca8('0xf')](_0x8ca8('0x11'),_0x1e487f,_0x5bcad4[_0x8ca8('0xf')]['message']);return _0x5b59c8(_0x5bcad4['error'][_0x8ca8('0x12')]);}logger[_0x8ca8('0xf')]('VoiceMail,\x20%s,\x20%s',_0x1e487f,_0x5bcad4[_0x8ca8('0xf')][_0x8ca8('0x12')]);return _0x295813(_0x5bcad4[_0x8ca8('0xf')][_0x8ca8('0x12')]);}else{logger['info'](_0x8ca8('0x11'),_0x1e487f,_0x8ca8('0xd'));_0x295813(_0x5bcad4[_0x8ca8('0x13')][_0x8ca8('0x12')]);}})[_0x8ca8('0x14')](function(_0x2a4160){logger[_0x8ca8('0xf')](_0x8ca8('0x11'),_0x1e487f,_0x2a4160);_0x5b59c8(_0x2a4160);});});} \ No newline at end of file +var _0xe4bc=['client','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xbc346f,_0x3db5c0){var _0x9f9260=function(_0x37e6b9){while(--_0x37e6b9){_0xbc346f['push'](_0xbc346f['shift']());}};_0x9f9260(++_0x3db5c0);}(_0xe4bc,0x1c6));var _0xce4b=function(_0x3c5e76,_0x329b31){_0x3c5e76=_0x3c5e76-0x0;var _0x503660=_0xe4bc[_0x3c5e76];return _0x503660;};'use strict';var _=require(_0xce4b('0x0'));var util=require('util');var moment=require(_0xce4b('0x1'));var BPromise=require(_0xce4b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce4b('0x3'))['db'];var utils=require(_0xce4b('0x4'));var logger=require(_0xce4b('0x5'))(_0xce4b('0x6'));var config=require(_0xce4b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xce4b('0x8')][_0xce4b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5af617,_0x2c4df3,_0x2267d5){return new BPromise(function(_0x10a7de,_0xde76f){return client[_0xce4b('0xa')](_0x5af617,_0x2267d5)[_0xce4b('0xb')](function(_0x181ee1){logger['info'](_0xce4b('0xc'),_0x2c4df3,_0xce4b('0xd'));logger[_0xce4b('0xe')](_0xce4b('0xf'),_0x2c4df3,_0xce4b('0xd'),JSON[_0xce4b('0x10')](_0x181ee1));if(_0x181ee1[_0xce4b('0x11')]){if(_0x181ee1[_0xce4b('0x11')][_0xce4b('0x12')]===0x1f4){logger[_0xce4b('0x11')](_0xce4b('0xc'),_0x2c4df3,_0x181ee1['error'][_0xce4b('0x13')]);return _0xde76f(_0x181ee1[_0xce4b('0x11')][_0xce4b('0x13')]);}logger[_0xce4b('0x11')](_0xce4b('0xc'),_0x2c4df3,_0x181ee1[_0xce4b('0x11')][_0xce4b('0x13')]);return _0x10a7de(_0x181ee1[_0xce4b('0x11')][_0xce4b('0x13')]);}else{logger[_0xce4b('0x14')]('VoiceMail,\x20%s,\x20%s',_0x2c4df3,_0xce4b('0xd'));_0x10a7de(_0x181ee1['result'][_0xce4b('0x13')]);}})[_0xce4b('0x15')](function(_0x301f6c){logger[_0xce4b('0x11')](_0xce4b('0xc'),_0x2c4df3,_0x301f6c);_0xde76f(_0x301f6c);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index feb0748..3ce4c1d 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 _0xb7e2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','put','/:id','delete','destroy','exports','multer','util','path','Router'];(function(_0x1386f5,_0x3d5a3d){var _0x24bd63=function(_0x1faa24){while(--_0x1faa24){_0x1386f5['push'](_0x1386f5['shift']());}};_0x24bd63(++_0x3d5a3d);}(_0xb7e2,0x1f4));var _0x2b7e=function(_0x13476f,_0x172c2b){_0x13476f=_0x13476f-0x0;var _0x185947=_0xb7e2[_0x13476f];return _0x185947;};'use strict';var multer=require(_0x2b7e('0x0'));var util=require(_0x2b7e('0x1'));var path=require(_0x2b7e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2b7e('0x3')]();var auth=require(_0x2b7e('0x4'));var interaction=require(_0x2b7e('0x5'));var config=require(_0x2b7e('0x6'));var controller=require(_0x2b7e('0x7'));router[_0x2b7e('0x8')]('/',auth[_0x2b7e('0x9')](),controller[_0x2b7e('0xa')]);router[_0x2b7e('0x8')]('/:id',auth[_0x2b7e('0x9')](),controller[_0x2b7e('0xb')]);router[_0x2b7e('0x8')](_0x2b7e('0xc'),auth[_0x2b7e('0x9')](),controller[_0x2b7e('0xd')]);router[_0x2b7e('0xe')]('/',auth[_0x2b7e('0x9')](),controller[_0x2b7e('0xf')]);router[_0x2b7e('0x10')](_0x2b7e('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x2b7e('0x12')](_0x2b7e('0x11'),auth[_0x2b7e('0x9')](),controller[_0x2b7e('0x13')]);module[_0x2b7e('0x14')]=router; \ No newline at end of file +var _0xd2cc=['put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','/:id','isAuthenticated','show','create'];(function(_0x37aa81,_0x290573){var _0x4e2124=function(_0x4d94cf){while(--_0x4d94cf){_0x37aa81['push'](_0x37aa81['shift']());}};_0x4e2124(++_0x290573);}(_0xd2cc,0x101));var _0xcd2c=function(_0x50baf6,_0x227f90){_0x50baf6=_0x50baf6-0x0;var _0x36f2a6=_0xd2cc[_0x50baf6];return _0x36f2a6;};'use strict';var multer=require(_0xcd2c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcd2c('0x1'));var express=require(_0xcd2c('0x2'));var router=express[_0xcd2c('0x3')]();var auth=require(_0xcd2c('0x4'));var interaction=require(_0xcd2c('0x5'));var config=require(_0xcd2c('0x6'));var controller=require(_0xcd2c('0x7'));router[_0xcd2c('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcd2c('0x8')](_0xcd2c('0x9'),auth[_0xcd2c('0xa')](),controller[_0xcd2c('0xb')]);router[_0xcd2c('0x8')]('/:id/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0xcd2c('0xc')]);router[_0xcd2c('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xcd2c('0xe')]);router[_0xcd2c('0xf')](_0xcd2c('0x9'),auth[_0xcd2c('0xa')](),controller[_0xcd2c('0x10')]);module[_0xcd2c('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index fac3d06..7efcce4 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 _0x6e64=['BLOB','long','TIMESTAMP','sequelize','exports','VIRTUAL','STRING'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x6e64,0x1ae));var _0x46e6=function(_0x5cd510,_0x304bc0){_0x5cd510=_0x5cd510-0x0;var _0x1c0021=_0x6e64[_0x5cd510];return _0x1c0021;};'use strict';var Sequelize=require(_0x46e6('0x0'));module[_0x46e6('0x1')]={'name':{'type':Sequelize[_0x46e6('0x2')],'get':function(_0x25e1b8){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x46e6('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x46e6('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x46e6('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x46e6('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x46e6('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x46e6('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x46e6('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x46e6('0x4')](_0x46e6('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x46e6('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x46e6('0x3')],'defaultValue':''},'stamp':{'type':_0x46e6('0x6'),'allowNull':![]}}; \ No newline at end of file +var _0xd10c=['BLOB','long','TIMESTAMP','sequelize','VIRTUAL','getDataValue','INTEGER','STRING'];(function(_0x27815f,_0x30ebc7){var _0x2bb7fa=function(_0x33a60e){while(--_0x33a60e){_0x27815f['push'](_0x27815f['shift']());}};_0x2bb7fa(++_0x30ebc7);}(_0xd10c,0xdb));var _0xcd10=function(_0x5a9237,_0xf95f0){_0x5a9237=_0x5a9237-0x0;var _0x210efd=_0xd10c[_0x5a9237];return _0x210efd;};'use strict';var Sequelize=require(_0xcd10('0x0'));module['exports']={'name':{'type':Sequelize[_0xcd10('0x1')],'get':function(_0x4add1b){return this[_0xcd10('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xcd10('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xcd10('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xcd10('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xcd10('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xcd10('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xcd10('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xcd10('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xcd10('0x5')](_0xcd10('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xcd10('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xcd10('0x4')],'defaultValue':''},'stamp':{'type':_0xcd10('0x7'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 09251f9..97c11f6 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 _0x991f=['.wav\x22','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','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','VoiceMailMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','rows','show','catch','create','body','update','find','download','params','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','attachment','attachment;\x20filename=\x22'];(function(_0x942bcf,_0x40a425){var _0x58c5ab=function(_0x396131){while(--_0x396131){_0x942bcf['push'](_0x942bcf['shift']());}};_0x58c5ab(++_0x40a425);}(_0x991f,0x151));var _0xf991=function(_0x3608e4,_0x161661){_0x3608e4=_0x3608e4-0x0;var _0x283149=_0x991f[_0x3608e4];return _0x283149;};'use strict';var pdf=require(_0xf991('0x0'));var emlformat=require(_0xf991('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf991('0x2'));var jsonpatch=require(_0xf991('0x3'));var rp=require(_0xf991('0x4'));var moment=require(_0xf991('0x5'));var BPromise=require(_0xf991('0x6'));var Mustache=require(_0xf991('0x7'));var util=require(_0xf991('0x8'));var path=require(_0xf991('0x9'));var sox=require(_0xf991('0xa'));var csv=require(_0xf991('0xb'));var ejs=require(_0xf991('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf991('0xd'));var crypto=require(_0xf991('0xe'));var jsforce=require(_0xf991('0xf'));var deskjs=require(_0xf991('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf991('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf991('0x12'));var qs=require(_0xf991('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf991('0x14'))(_0xf991('0x15'));var utils=require('../../config/utils');var config=require(_0xf991('0x16'));var db=require(_0xf991('0x17'))['db'];function respondWithStatusCode(_0x3c1a94,_0x24fe7d){_0x24fe7d=_0x24fe7d||0xcc;return function(_0xdc969b){if(_0xdc969b){return _0x3c1a94['sendStatus'](_0x24fe7d);}return _0x3c1a94[_0xf991('0x18')](_0x24fe7d)[_0xf991('0x19')]();};}function respondWithResult(_0x253d66,_0x15238f){_0x15238f=_0x15238f||0xc8;return function(_0x3220bd){if(_0x3220bd){return _0x253d66['status'](_0x15238f)[_0xf991('0x1a')](_0x3220bd);}};}function respondWithFilteredResult(_0x2d4750,_0x5c5ac9){return function(_0x466fa2){if(_0x466fa2){var _0x3db2a7=_0x466fa2[_0xf991('0x1b')],_0x19efc2=_0x5c5ac9['offset'],_0x391562=_0x5c5ac9[_0xf991('0x1c')]+_0x5c5ac9[_0xf991('0x1d')],_0x2078d5;if(_0x391562>=_0x3db2a7){_0x391562=_0x3db2a7;_0x2078d5=0xc8;}else{_0x2078d5=0xce;}_0x2d4750['status'](_0x2078d5);return _0x2d4750[_0xf991('0x1e')](_0xf991('0x1f'),_0x19efc2+'-'+_0x391562+'/'+_0x3db2a7)[_0xf991('0x1a')](_0x466fa2);}return null;};}function patchUpdates(_0x4306de){return function(_0x31dafa){try{jsonpatch[_0xf991('0x20')](_0x31dafa,_0x4306de,!![]);}catch(_0x156cde){return BPromise[_0xf991('0x21')](_0x156cde);}return _0x31dafa[_0xf991('0x22')]();};}function saveUpdates(_0xd9493e,_0x355d41){return function(_0x925405){if(_0x925405){return _0x925405['update'](_0xd9493e)['then'](function(_0x6b2c17){return _0x6b2c17;});}return null;};}function removeEntity(_0x32658b,_0x3c2f43){return function(_0x45a1ce){if(_0x45a1ce){return _0x45a1ce[_0xf991('0x23')]()[_0xf991('0x24')](function(){_0x32658b['status'](0xcc)[_0xf991('0x19')]();});}};}function handleEntityNotFound(_0x45aece,_0x4a2eee){return function(_0x2ed662){if(!_0x2ed662){_0x45aece[_0xf991('0x25')](0x194);}return _0x2ed662;};}function handleError(_0x5cffc2,_0xbcd3d){_0xbcd3d=_0xbcd3d||0x1f4;return function(_0x2382e0){logger[_0xf991('0x26')](_0x2382e0[_0xf991('0x27')]);if(_0x2382e0[_0xf991('0x28')]){delete _0x2382e0[_0xf991('0x28')];}_0x5cffc2[_0xf991('0x18')](_0xbcd3d)[_0xf991('0x29')](_0x2382e0);};}exports['index']=function(_0x5bdbc0,_0x127fe7){var _0x256f0a={},_0x37e709={},_0x3e78c7={'count':0x0,'rows':[]};var _0x52d410=db[_0xf991('0x2a')][_0xf991('0x2b')];_0x37e709[_0xf991('0x2c')]=_['differenceBy'](_[_0xf991('0x2d')](_0x52d410),[_0xf991('0x28')]);_0x37e709[_0xf991('0x2e')]=_['keys'](_0x5bdbc0['query']);_0x37e709[_0xf991('0x2f')]=_[_0xf991('0x30')](_0x37e709['model'],_0x37e709[_0xf991('0x2e')]);_0x256f0a[_0xf991('0x31')]=_[_0xf991('0x30')](_0x37e709[_0xf991('0x2c')],qs[_0xf991('0x32')](_0x5bdbc0[_0xf991('0x2e')][_0xf991('0x32')]));_0x256f0a[_0xf991('0x31')]=_0x256f0a[_0xf991('0x31')][_0xf991('0x33')]?_0x256f0a[_0xf991('0x31')]:_0x37e709[_0xf991('0x2c')];if(!_0x5bdbc0['query'][_0xf991('0x34')](_0xf991('0x35'))){_0x256f0a[_0xf991('0x1d')]=qs[_0xf991('0x1d')](_0x5bdbc0['query'][_0xf991('0x1d')]);_0x256f0a[_0xf991('0x1c')]=qs[_0xf991('0x1c')](_0x5bdbc0['query']['offset']);}_0x256f0a[_0xf991('0x36')]=qs[_0xf991('0x37')](_0x5bdbc0['query'][_0xf991('0x37')]);_0x256f0a[_0xf991('0x38')]=qs['filters'](_[_0xf991('0x39')](_0x5bdbc0[_0xf991('0x2e')],_0x37e709[_0xf991('0x2f')]));if(_0x5bdbc0['query'][_0xf991('0x3a')]){_0x256f0a[_0xf991('0x38')]=_[_0xf991('0x3b')](_0x256f0a[_0xf991('0x38')],{'$or':_[_0xf991('0x3c')](_0x52d410,function(_0x34abed){if(_0x34abed[_0xf991('0x3d')][_0xf991('0x3e')]!==_0xf991('0x3f')){var _0x5a2051={};_0x5a2051[_0x34abed['field']]={'$like':'%'+_0x5bdbc0[_0xf991('0x2e')]['filter']+'%'};return _0x5a2051;}})});}_0x256f0a=_[_0xf991('0x3b')]({},_0x256f0a,_0x5bdbc0[_0xf991('0x40')]);var _0x29ad9c={'where':_0x256f0a[_0xf991('0x38')]};return db[_0xf991('0x2a')][_0xf991('0x1b')](_0x29ad9c)[_0xf991('0x24')](function(_0x2dc7d7){_0x3e78c7['count']=_0x2dc7d7;if(_0x5bdbc0[_0xf991('0x2e')][_0xf991('0x41')]){_0x256f0a[_0xf991('0x42')]=[{'all':!![]}];}return db[_0xf991('0x2a')]['findAll'](_0x256f0a);})[_0xf991('0x24')](function(_0x21550d){_0x3e78c7[_0xf991('0x43')]=_0x21550d;return _0x3e78c7;})[_0xf991('0x24')](respondWithFilteredResult(_0x127fe7,_0x256f0a))['catch'](handleError(_0x127fe7,null));};exports[_0xf991('0x44')]=function(_0x1fdf3e,_0x59a2c0){var _0x351d49={'raw':!![],'where':{'id':_0x1fdf3e['params']['id']}},_0x4481f4={};_0x4481f4['model']=_[_0xf991('0x2d')](db[_0xf991('0x2a')][_0xf991('0x2b')]);_0x4481f4[_0xf991('0x2e')]=_[_0xf991('0x2d')](_0x1fdf3e[_0xf991('0x2e')]);_0x4481f4[_0xf991('0x2f')]=_[_0xf991('0x30')](_0x4481f4[_0xf991('0x2c')],_0x4481f4[_0xf991('0x2e')]);_0x351d49[_0xf991('0x31')]=_[_0xf991('0x30')](_0x4481f4[_0xf991('0x2c')],qs[_0xf991('0x32')](_0x1fdf3e['query'][_0xf991('0x32')]));_0x351d49[_0xf991('0x31')]=_0x351d49[_0xf991('0x31')][_0xf991('0x33')]?_0x351d49[_0xf991('0x31')]:_0x4481f4[_0xf991('0x2c')];if(_0x1fdf3e[_0xf991('0x2e')]['includeAll']){_0x351d49[_0xf991('0x42')]=[{'all':!![]}];}_0x351d49=_[_0xf991('0x3b')]({},_0x351d49,_0x1fdf3e[_0xf991('0x40')]);return db[_0xf991('0x2a')]['find'](_0x351d49)['then'](handleEntityNotFound(_0x59a2c0,null))[_0xf991('0x24')](respondWithResult(_0x59a2c0,null))[_0xf991('0x45')](handleError(_0x59a2c0,null));};exports[_0xf991('0x46')]=function(_0x31756f,_0x3ceeb3){return db[_0xf991('0x2a')][_0xf991('0x46')](_0x31756f[_0xf991('0x47')],{})[_0xf991('0x24')](respondWithResult(_0x3ceeb3,0xc9))[_0xf991('0x45')](handleError(_0x3ceeb3,null));};exports[_0xf991('0x48')]=function(_0x35c87f,_0x24b2be){if(_0x35c87f['body']['id']){delete _0x35c87f['body']['id'];}return db[_0xf991('0x2a')][_0xf991('0x49')]({'where':{'id':_0x35c87f['params']['id']}})[_0xf991('0x24')](handleEntityNotFound(_0x24b2be,null))['then'](saveUpdates(_0x35c87f[_0xf991('0x47')],null))['then'](respondWithResult(_0x24b2be,null))[_0xf991('0x45')](handleError(_0x24b2be,null));};exports[_0xf991('0x23')]=function(_0x268459,_0x3ad1cc){return db[_0xf991('0x2a')]['find']({'where':{'id':_0x268459['params']['id']}})['then'](handleEntityNotFound(_0x3ad1cc,null))['then'](removeEntity(_0x3ad1cc,null))['catch'](handleError(_0x3ad1cc,null));};exports[_0xf991('0x4a')]=function(_0x56aeed,_0x2d393b,_0x1e343d){return db[_0xf991('0x2a')][_0xf991('0x49')]({'where':{'id':_0x56aeed[_0xf991('0x4b')]['id']},'attributes':['id',_0xf991('0x4c'),_0xf991('0x4d')]})[_0xf991('0x24')](handleEntityNotFound(_0x2d393b,null))[_0xf991('0x24')](function(_0x4b5d27){if(_0x4b5d27){if(!_0x4b5d27[_0xf991('0x4c')]){throw new db[(_0xf991('0x4e'))][(_0xf991('0x4f'))](_0xf991('0x50'));}var _0x4a263c={'Content-Type':'audio/wav','Content-Disposition':_0xf991('0x51')};if(_0x4b5d27[_0xf991('0x4d')]){_0x4a263c['Content-Disposition']=_0xf991('0x52')+_0x4b5d27[_0xf991('0x4d')]+_0xf991('0x53');}_0x2d393b[_0xf991('0x1e')](_0x4a263c);return _0x2d393b[_0xf991('0x29')](new Buffer(_0x4b5d27['recording']));}})[_0xf991('0x45')](handleError(_0x2d393b,null));}; \ No newline at end of file +var _0x241e=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','papaparse','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','name','send','VoiceMailMessage','model','differenceBy','query','keys','filters','intersection','attributes','length','nolimit','limit','sort','where','pick','filter','merge','map','type','key','field','options','includeAll','findAll','catch','show','rawAttributes','fields','include','find','create','body','params','destroy','download','msg_id','recording','ValidationError','audio/wav','Content-Disposition','.wav\x22','eml-format','rimraf','zip-dir','request-promise'];(function(_0x2106be,_0x1bea82){var _0x224fcb=function(_0x145166){while(--_0x145166){_0x2106be['push'](_0x2106be['shift']());}};_0x224fcb(++_0x1bea82);}(_0x241e,0x164));var _0xe241=function(_0x14c775,_0x1d0345){_0x14c775=_0x14c775-0x0;var _0xd42a97=_0x241e[_0x14c775];return _0xd42a97;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe241('0x0'));var rimraf=require(_0xe241('0x1'));var zipdir=require(_0xe241('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe241('0x3'));var moment=require('moment');var BPromise=require(_0xe241('0x4'));var Mustache=require(_0xe241('0x5'));var util=require(_0xe241('0x6'));var path=require(_0xe241('0x7'));var sox=require(_0xe241('0x8'));var csv=require(_0xe241('0x9'));var ejs=require(_0xe241('0xa'));var fs=require('fs');var _=require(_0xe241('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe241('0x9'));var querystring=require('querystring');var Papa=require(_0xe241('0xc'));var Redis=require('ioredis');var authService=require(_0xe241('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe241('0xe'))('api');var utils=require(_0xe241('0xf'));var config=require(_0xe241('0x10'));var db=require(_0xe241('0x11'))['db'];function respondWithStatusCode(_0x13e54a,_0x16e265){_0x16e265=_0x16e265||0xcc;return function(_0x2c702a){if(_0x2c702a){return _0x13e54a[_0xe241('0x12')](_0x16e265);}return _0x13e54a[_0xe241('0x13')](_0x16e265)[_0xe241('0x14')]();};}function respondWithResult(_0x383e0d,_0x44a459){_0x44a459=_0x44a459||0xc8;return function(_0x36354a){if(_0x36354a){return _0x383e0d[_0xe241('0x13')](_0x44a459)[_0xe241('0x15')](_0x36354a);}};}function respondWithFilteredResult(_0x3b2448,_0x18fb13){return function(_0x332758){if(_0x332758){var _0x3029d3=_0x332758[_0xe241('0x16')],_0x5bc66f=_0x18fb13[_0xe241('0x17')],_0x892ce4=_0x18fb13[_0xe241('0x17')]+_0x18fb13['limit'],_0x53cfe6;if(_0x892ce4>=_0x3029d3){_0x892ce4=_0x3029d3;_0x53cfe6=0xc8;}else{_0x53cfe6=0xce;}_0x3b2448[_0xe241('0x13')](_0x53cfe6);return _0x3b2448[_0xe241('0x18')](_0xe241('0x19'),_0x5bc66f+'-'+_0x892ce4+'/'+_0x3029d3)[_0xe241('0x15')](_0x332758);}return null;};}function patchUpdates(_0x2a96ba){return function(_0x4a923c){try{jsonpatch[_0xe241('0x1a')](_0x4a923c,_0x2a96ba,!![]);}catch(_0x39368c){return BPromise[_0xe241('0x1b')](_0x39368c);}return _0x4a923c['save']();};}function saveUpdates(_0x5e93fe,_0x3effe1){return function(_0x562714){if(_0x562714){return _0x562714[_0xe241('0x1c')](_0x5e93fe)[_0xe241('0x1d')](function(_0x394df3){return _0x394df3;});}return null;};}function removeEntity(_0x465d69,_0x2fdeeb){return function(_0x804c3f){if(_0x804c3f){return _0x804c3f['destroy']()[_0xe241('0x1d')](function(){_0x465d69[_0xe241('0x13')](0xcc)[_0xe241('0x14')]();});}};}function handleEntityNotFound(_0x5ce220,_0x1e7661){return function(_0x16c0e1){if(!_0x16c0e1){_0x5ce220[_0xe241('0x12')](0x194);}return _0x16c0e1;};}function handleError(_0x3df6e0,_0x2bba80){_0x2bba80=_0x2bba80||0x1f4;return function(_0x29b5e9){logger['error'](_0x29b5e9['stack']);if(_0x29b5e9[_0xe241('0x1e')]){delete _0x29b5e9[_0xe241('0x1e')];}_0x3df6e0[_0xe241('0x13')](_0x2bba80)[_0xe241('0x1f')](_0x29b5e9);};}exports['index']=function(_0x5d1be8,_0xd21083){var _0x578cb4={},_0x2eb39e={},_0x17c188={'count':0x0,'rows':[]};var _0x1c0522=db[_0xe241('0x20')]['rawAttributes'];_0x2eb39e[_0xe241('0x21')]=_[_0xe241('0x22')](_['keys'](_0x1c0522),[_0xe241('0x1e')]);_0x2eb39e[_0xe241('0x23')]=_[_0xe241('0x24')](_0x5d1be8[_0xe241('0x23')]);_0x2eb39e[_0xe241('0x25')]=_[_0xe241('0x26')](_0x2eb39e[_0xe241('0x21')],_0x2eb39e['query']);_0x578cb4[_0xe241('0x27')]=_['intersection'](_0x2eb39e[_0xe241('0x21')],qs['fields'](_0x5d1be8['query']['fields']));_0x578cb4[_0xe241('0x27')]=_0x578cb4['attributes'][_0xe241('0x28')]?_0x578cb4['attributes']:_0x2eb39e[_0xe241('0x21')];if(!_0x5d1be8[_0xe241('0x23')]['hasOwnProperty'](_0xe241('0x29'))){_0x578cb4[_0xe241('0x2a')]=qs['limit'](_0x5d1be8['query']['limit']);_0x578cb4[_0xe241('0x17')]=qs['offset'](_0x5d1be8['query'][_0xe241('0x17')]);}_0x578cb4['order']=qs['sort'](_0x5d1be8['query'][_0xe241('0x2b')]);_0x578cb4[_0xe241('0x2c')]=qs[_0xe241('0x25')](_[_0xe241('0x2d')](_0x5d1be8[_0xe241('0x23')],_0x2eb39e[_0xe241('0x25')]));if(_0x5d1be8['query'][_0xe241('0x2e')]){_0x578cb4['where']=_[_0xe241('0x2f')](_0x578cb4[_0xe241('0x2c')],{'$or':_[_0xe241('0x30')](_0x1c0522,function(_0x1c55dd){if(_0x1c55dd[_0xe241('0x31')][_0xe241('0x32')]!=='VIRTUAL'){var _0x239c36={};_0x239c36[_0x1c55dd[_0xe241('0x33')]]={'$like':'%'+_0x5d1be8[_0xe241('0x23')][_0xe241('0x2e')]+'%'};return _0x239c36;}})});}_0x578cb4=_['merge']({},_0x578cb4,_0x5d1be8[_0xe241('0x34')]);var _0x143382={'where':_0x578cb4['where']};return db[_0xe241('0x20')][_0xe241('0x16')](_0x143382)['then'](function(_0x1e4da5){_0x17c188['count']=_0x1e4da5;if(_0x5d1be8[_0xe241('0x23')][_0xe241('0x35')]){_0x578cb4['include']=[{'all':!![]}];}return db['VoiceMailMessage'][_0xe241('0x36')](_0x578cb4);})['then'](function(_0x273b70){_0x17c188['rows']=_0x273b70;return _0x17c188;})[_0xe241('0x1d')](respondWithFilteredResult(_0xd21083,_0x578cb4))[_0xe241('0x37')](handleError(_0xd21083,null));};exports[_0xe241('0x38')]=function(_0x2603b1,_0x27cb6c){var _0x52264c={'raw':!![],'where':{'id':_0x2603b1['params']['id']}},_0x19686d={};_0x19686d[_0xe241('0x21')]=_[_0xe241('0x24')](db[_0xe241('0x20')][_0xe241('0x39')]);_0x19686d[_0xe241('0x23')]=_[_0xe241('0x24')](_0x2603b1[_0xe241('0x23')]);_0x19686d['filters']=_[_0xe241('0x26')](_0x19686d[_0xe241('0x21')],_0x19686d['query']);_0x52264c['attributes']=_[_0xe241('0x26')](_0x19686d['model'],qs[_0xe241('0x3a')](_0x2603b1[_0xe241('0x23')]['fields']));_0x52264c[_0xe241('0x27')]=_0x52264c[_0xe241('0x27')][_0xe241('0x28')]?_0x52264c[_0xe241('0x27')]:_0x19686d[_0xe241('0x21')];if(_0x2603b1[_0xe241('0x23')][_0xe241('0x35')]){_0x52264c[_0xe241('0x3b')]=[{'all':!![]}];}_0x52264c=_[_0xe241('0x2f')]({},_0x52264c,_0x2603b1[_0xe241('0x34')]);return db['VoiceMailMessage'][_0xe241('0x3c')](_0x52264c)['then'](handleEntityNotFound(_0x27cb6c,null))['then'](respondWithResult(_0x27cb6c,null))['catch'](handleError(_0x27cb6c,null));};exports[_0xe241('0x3d')]=function(_0x56ae9d,_0xf4ca47){return db['VoiceMailMessage'][_0xe241('0x3d')](_0x56ae9d[_0xe241('0x3e')],{})[_0xe241('0x1d')](respondWithResult(_0xf4ca47,0xc9))[_0xe241('0x37')](handleError(_0xf4ca47,null));};exports[_0xe241('0x1c')]=function(_0x2c5705,_0x311942){if(_0x2c5705[_0xe241('0x3e')]['id']){delete _0x2c5705[_0xe241('0x3e')]['id'];}return db['VoiceMailMessage'][_0xe241('0x3c')]({'where':{'id':_0x2c5705[_0xe241('0x3f')]['id']}})[_0xe241('0x1d')](handleEntityNotFound(_0x311942,null))[_0xe241('0x1d')](saveUpdates(_0x2c5705['body'],null))[_0xe241('0x1d')](respondWithResult(_0x311942,null))[_0xe241('0x37')](handleError(_0x311942,null));};exports[_0xe241('0x40')]=function(_0x54b5a9,_0x18c3ce){return db[_0xe241('0x20')][_0xe241('0x3c')]({'where':{'id':_0x54b5a9[_0xe241('0x3f')]['id']}})[_0xe241('0x1d')](handleEntityNotFound(_0x18c3ce,null))[_0xe241('0x1d')](removeEntity(_0x18c3ce,null))['catch'](handleError(_0x18c3ce,null));};exports[_0xe241('0x41')]=function(_0x59154f,_0xe1fcd0,_0x3af3d1){return db[_0xe241('0x20')][_0xe241('0x3c')]({'where':{'id':_0x59154f['params']['id']},'attributes':['id','recording',_0xe241('0x42')]})['then'](handleEntityNotFound(_0xe1fcd0,null))[_0xe241('0x1d')](function(_0x304f66){if(_0x304f66){if(!_0x304f66[_0xe241('0x43')]){throw new db['Sequelize'][(_0xe241('0x44'))]('VoiceMailMessage\x20not\x20found');}var _0x2826f3={'Content-Type':_0xe241('0x45'),'Content-Disposition':'attachment'};if(_0x304f66[_0xe241('0x42')]){_0x2826f3[_0xe241('0x46')]='attachment;\x20filename=\x22'+_0x304f66[_0xe241('0x42')]+_0xe241('0x47');}_0xe1fcd0[_0xe241('0x18')](_0x2826f3);return _0xe1fcd0[_0xe241('0x1f')](new Buffer(_0x304f66[_0xe241('0x43')]));}})[_0xe241('0x37')](handleError(_0xe1fcd0,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 7cab95a..f8d2dd2 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 _0x5c26=['request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','util','../../config/logger','api','bluebird'];(function(_0x4b49ea,_0x4687fa){var _0x3b4a93=function(_0x2d0f2f){while(--_0x2d0f2f){_0x4b49ea['push'](_0x4b49ea['shift']());}};_0x3b4a93(++_0x4687fa);}(_0x5c26,0x168));var _0x65c2=function(_0x22b666,_0x10b2da){_0x22b666=_0x22b666-0x0;var _0x24ac3e=_0x5c26[_0x22b666];return _0x24ac3e;};'use strict';var _=require('lodash');var util=require(_0x65c2('0x0'));var logger=require(_0x65c2('0x1'))(_0x65c2('0x2'));var moment=require('moment');var BPromise=require(_0x65c2('0x3'));var rp=require(_0x65c2('0x4'));var fs=require('fs');var path=require(_0x65c2('0x5'));var rimraf=require(_0x65c2('0x6'));var config=require(_0x65c2('0x7'));var attributes=require(_0x65c2('0x8'));module[_0x65c2('0x9')]=function(_0x146f12,_0x38789b){return _0x146f12[_0x65c2('0xa')](_0x65c2('0xb'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x65c2('0xc'),'fields':[_0x65c2('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x78e9=['request-promise','path','rimraf','./voiceMailMessage.attributes','exports','define','voice_voicemail_messages','dir','lodash','../../config/logger','api','bluebird'];(function(_0x2f625b,_0x16bbdb){var _0xdac4da=function(_0x2e2c2a){while(--_0x2e2c2a){_0x2f625b['push'](_0x2f625b['shift']());}};_0xdac4da(++_0x16bbdb);}(_0x78e9,0x164));var _0x978e=function(_0x5318c8,_0x443aa3){_0x5318c8=_0x5318c8-0x0;var _0x42eb9d=_0x78e9[_0x5318c8];return _0x42eb9d;};'use strict';var _=require(_0x978e('0x0'));var util=require('util');var logger=require(_0x978e('0x1'))(_0x978e('0x2'));var moment=require('moment');var BPromise=require(_0x978e('0x3'));var rp=require(_0x978e('0x4'));var fs=require('fs');var path=require(_0x978e('0x5'));var rimraf=require(_0x978e('0x6'));var config=require('../../config/environment');var attributes=require(_0x978e('0x7'));module[_0x978e('0x8')]=function(_0x26ec87,_0x580612){return _0x26ec87[_0x978e('0x9')]('VoiceMailMessage',attributes,{'tableName':_0x978e('0xa'),'paranoid':![],'indexes':[{'name':_0x978e('0xb'),'fields':[_0x978e('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 9e504c4..2870cb9 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 _0xd664=['ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird'];(function(_0x2e81f0,_0x3100d4){var _0x441575=function(_0x535485){while(--_0x535485){_0x2e81f0['push'](_0x2e81f0['shift']());}};_0x441575(++_0x3100d4);}(_0xd664,0x10e));var _0x4d66=function(_0x5257a8,_0x102063){_0x5257a8=_0x5257a8-0x0;var _0x99658a=_0xd664[_0x5257a8];return _0x99658a;};'use strict';var _=require('lodash');var util=require(_0x4d66('0x0'));var moment=require(_0x4d66('0x1'));var BPromise=require(_0x4d66('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4d66('0x3'));var db=require(_0x4d66('0x4'))['db'];var utils=require(_0x4d66('0x5'));var logger=require(_0x4d66('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4d66('0x7'));var client=jayson[_0x4d66('0x8')][_0x4d66('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32a1f9,_0x48447e,_0x5e4c80){return new BPromise(function(_0x3407ad,_0x423fe2){return client[_0x4d66('0xa')](_0x32a1f9,_0x5e4c80)['then'](function(_0x5ebff6){logger[_0x4d66('0xb')](_0x4d66('0xc'),_0x48447e,_0x4d66('0xd'));logger[_0x4d66('0xe')](_0x4d66('0xf'),_0x48447e,_0x4d66('0xd'),JSON[_0x4d66('0x10')](_0x5ebff6));if(_0x5ebff6[_0x4d66('0x11')]){if(_0x5ebff6[_0x4d66('0x11')]['code']===0x1f4){logger[_0x4d66('0x11')](_0x4d66('0xc'),_0x48447e,_0x5ebff6[_0x4d66('0x11')][_0x4d66('0x12')]);return _0x423fe2(_0x5ebff6[_0x4d66('0x11')][_0x4d66('0x12')]);}logger['error'](_0x4d66('0xc'),_0x48447e,_0x5ebff6['error'][_0x4d66('0x12')]);return _0x3407ad(_0x5ebff6[_0x4d66('0x11')]['message']);}else{logger[_0x4d66('0xb')](_0x4d66('0xc'),_0x48447e,_0x4d66('0xd'));_0x3407ad(_0x5ebff6[_0x4d66('0x13')][_0x4d66('0x12')]);}})[_0x4d66('0x14')](function(_0x596c17){logger[_0x4d66('0x11')](_0x4d66('0xc'),_0x48447e,_0x596c17);_0x423fe2(_0x596c17);});});} \ No newline at end of file +var _0x4eea=['info','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','VoiceMailMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4eea,0x143));var _0xa4ee=function(_0x8ce970,_0x171556){_0x8ce970=_0x8ce970-0x0;var _0x9ed450=_0x4eea[_0x8ce970];return _0x9ed450;};'use strict';var _=require(_0xa4ee('0x0'));var util=require(_0xa4ee('0x1'));var moment=require(_0xa4ee('0x2'));var BPromise=require(_0xa4ee('0x3'));var rs=require(_0xa4ee('0x4'));var fs=require('fs');var Redis=require(_0xa4ee('0x5'));var db=require(_0xa4ee('0x6'))['db'];var utils=require(_0xa4ee('0x7'));var logger=require(_0xa4ee('0x8'))('rpc');var config=require(_0xa4ee('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa4ee('0xa')][_0xa4ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10d78b,_0x34332e,_0x31af3f){return new BPromise(function(_0x4d0b03,_0x32a294){return client['request'](_0x10d78b,_0x31af3f)[_0xa4ee('0xc')](function(_0x5d0722){logger[_0xa4ee('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x34332e,_0xa4ee('0xe'));logger[_0xa4ee('0xf')](_0xa4ee('0x10'),_0x34332e,'request\x20sent',JSON[_0xa4ee('0x11')](_0x5d0722));if(_0x5d0722['error']){if(_0x5d0722['error'][_0xa4ee('0x12')]===0x1f4){logger[_0xa4ee('0x13')](_0xa4ee('0x14'),_0x34332e,_0x5d0722[_0xa4ee('0x13')][_0xa4ee('0x15')]);return _0x32a294(_0x5d0722[_0xa4ee('0x13')][_0xa4ee('0x15')]);}logger[_0xa4ee('0x13')](_0xa4ee('0x14'),_0x34332e,_0x5d0722['error'][_0xa4ee('0x15')]);return _0x4d0b03(_0x5d0722[_0xa4ee('0x13')][_0xa4ee('0x15')]);}else{logger[_0xa4ee('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x34332e,_0xa4ee('0xe'));_0x4d0b03(_0x5d0722[_0xa4ee('0x16')][_0xa4ee('0x15')]);}})[_0xa4ee('0x17')](function(_0x5ae043){logger[_0xa4ee('0x13')](_0xa4ee('0x14'),_0x34332e,_0x5ae043);_0x32a294(_0x5ae043);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 4fe7cad..4462cf1 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 _0x5c12=['get','index','/:id','/:id/sounds','isAuthenticated','getSounds','post','create','addSound','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller'];(function(_0x5cb513,_0x16ed5f){var _0x505007=function(_0x44052c){while(--_0x44052c){_0x5cb513['push'](_0x5cb513['shift']());}};_0x505007(++_0x16ed5f);}(_0x5c12,0x188));var _0x25c1=function(_0x1bfe2b,_0x34856e){_0x1bfe2b=_0x1bfe2b-0x0;var _0x1477d4=_0x5c12[_0x1bfe2b];return _0x1477d4;};'use strict';var multer=require('multer');var util=require(_0x25c1('0x0'));var path=require(_0x25c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x25c1('0x2'));var router=express[_0x25c1('0x3')]();var auth=require(_0x25c1('0x4'));var interaction=require(_0x25c1('0x5'));var config=require(_0x25c1('0x6'));var controller=require(_0x25c1('0x7'));router[_0x25c1('0x8')]('/',auth['isAuthenticated'](),controller[_0x25c1('0x9')]);router[_0x25c1('0x8')](_0x25c1('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x25c1('0x8')](_0x25c1('0xb'),auth[_0x25c1('0xc')](),controller[_0x25c1('0xd')]);router[_0x25c1('0xe')]('/',auth['isAuthenticated'](),controller[_0x25c1('0xf')]);router[_0x25c1('0xe')](_0x25c1('0xb'),auth[_0x25c1('0xc')](),controller[_0x25c1('0x10')]);router['put'](_0x25c1('0xa'),auth[_0x25c1('0xc')](),controller['update']);router[_0x25c1('0x11')](_0x25c1('0xa'),auth[_0x25c1('0xc')](),controller[_0x25c1('0x12')]);router['delete']('/:id/sounds/:id2',auth['isAuthenticated'](),controller['removeSound']);module[_0x25c1('0x13')]=router; \ No newline at end of file +var _0x91a7=['Router','../../components/interaction/service','get','isAuthenticated','show','/:id/sounds','getSounds','post','addSound','put','/:id','update','delete','destroy','removeSound','util','path','connect-timeout'];(function(_0x385153,_0x29f62b){var _0x385df7=function(_0x1f0833){while(--_0x1f0833){_0x385153['push'](_0x385153['shift']());}};_0x385df7(++_0x29f62b);}(_0x91a7,0xe7));var _0x791a=function(_0x353585,_0x44eed0){_0x353585=_0x353585-0x0;var _0x147694=_0x91a7[_0x353585];return _0x147694;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x791a('0x4'));var config=require('../../config/environment');var controller=require('./voiceMusicOnHold.controller');router[_0x791a('0x5')]('/',auth[_0x791a('0x6')](),controller['index']);router[_0x791a('0x5')]('/:id',auth[_0x791a('0x6')](),controller[_0x791a('0x7')]);router['get'](_0x791a('0x8'),auth[_0x791a('0x6')](),controller[_0x791a('0x9')]);router[_0x791a('0xa')]('/',auth[_0x791a('0x6')](),controller['create']);router[_0x791a('0xa')](_0x791a('0x8'),auth['isAuthenticated'](),controller[_0x791a('0xb')]);router[_0x791a('0xc')](_0x791a('0xd'),auth[_0x791a('0x6')](),controller[_0x791a('0xe')]);router[_0x791a('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x791a('0x10')]);router[_0x791a('0xf')]('/:id/sounds/:id2',auth[_0x791a('0x6')](),controller[_0x791a('0x11')]);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 ac32711..e55120f 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 _0xa177=['mp3nb','quietmp3nb','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','ENUM','files'];(function(_0xf27a5d,_0x5a3b2f){var _0x217da7=function(_0x41f99c){while(--_0x41f99c){_0xf27a5d['push'](_0xf27a5d['shift']());}};_0x217da7(++_0x5a3b2f);}(_0xa177,0x1be));var _0x7a17=function(_0x170296,_0x486578){_0x170296=_0x170296-0x0;var _0x30f3c0=_0xa177[_0x170296];return _0x30f3c0;};'use strict';var Sequelize=require(_0x7a17('0x0'));module[_0x7a17('0x1')]={'name':{'type':Sequelize[_0x7a17('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x7a17('0x3')]('custom',_0x7a17('0x4'),_0x7a17('0x5'),_0x7a17('0x6'),'quietmp3',_0x7a17('0x7')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x7a17('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x7a17('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x7a17('0x2')],'allowNull':!![],'defaultValue':_0x7a17('0x8')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x7a17('0x9')},'defaultEntry':{'type':Sequelize[_0x7a17('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0xeb80=['mp3','files','TIMESTAMP','BOOLEAN','exports','STRING','name','ENUM','custom','quietmp3'];(function(_0x32aa4e,_0xef717a){var _0x561df8=function(_0x28cd93){while(--_0x28cd93){_0x32aa4e['push'](_0x32aa4e['shift']());}};_0x561df8(++_0xef717a);}(_0xeb80,0x1c6));var _0x0eb8=function(_0x2ba5e7,_0x137cf4){_0x2ba5e7=_0x2ba5e7-0x0;var _0x58adb0=_0xeb80[_0x2ba5e7];return _0x58adb0;};'use strict';var Sequelize=require('sequelize');module[_0x0eb8('0x0')]={'name':{'type':Sequelize[_0x0eb8('0x1')],'allowNull':![],'unique':_0x0eb8('0x2')},'mode':{'type':Sequelize[_0x0eb8('0x3')](_0x0eb8('0x4'),'files','mp3nb','quietmp3nb',_0x0eb8('0x5'),_0x0eb8('0x6')),'allowNull':!![],'defaultValue':_0x0eb8('0x7')},'directory':{'type':Sequelize[_0x0eb8('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x0eb8('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x0eb8('0x1')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x0eb8('0x1')],'allowNull':!![]},'stamp':{'type':_0x0eb8('0x8')},'defaultEntry':{'type':Sequelize[_0x0eb8('0x9')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 91d627b..ea65134 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 _0xeaa5=['server/files/sounds/converted','format','basename','save_name','%s.%s','removeSound','id2','ValidationError','getSounds','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','stack','name','send','VoiceMusicOnHold','rawAttributes','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','show','includeAll','find','body','params','sequelize','transaction','mode','files','directory','join','server/files/moh','create','mkdirSync','0777','user','role','catch','forEach','unlinkSync','rmdirSync','Sequelize','message','addSound','Sound','findOne','converted_format','root'];(function(_0x3ee31c,_0x404b00){var _0x94e47e=function(_0x4ebeb0){while(--_0x4ebeb0){_0x3ee31c['push'](_0x3ee31c['shift']());}};_0x94e47e(++_0x404b00);}(_0xeaa5,0xdc));var _0x5eaa=function(_0x3914a6,_0x51d543){_0x3914a6=_0x3914a6-0x0;var _0x12360b=_0xeaa5[_0x3914a6];return _0x12360b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5eaa('0x0'));var rimraf=require(_0x5eaa('0x1'));var zipdir=require(_0x5eaa('0x2'));var jsonpatch=require(_0x5eaa('0x3'));var rp=require(_0x5eaa('0x4'));var moment=require(_0x5eaa('0x5'));var BPromise=require(_0x5eaa('0x6'));var Mustache=require(_0x5eaa('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5eaa('0x8'));var ejs=require(_0x5eaa('0x9'));var fs=require('fs');var _=require(_0x5eaa('0xa'));var squel=require(_0x5eaa('0xb'));var crypto=require(_0x5eaa('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5eaa('0xd'));var toCsv=require(_0x5eaa('0x8'));var querystring=require('querystring');var Papa=require(_0x5eaa('0xe'));var Redis=require(_0x5eaa('0xf'));var authService=require(_0x5eaa('0x10'));var qs=require(_0x5eaa('0x11'));var hardwareService=require(_0x5eaa('0x12'));var logger=require(_0x5eaa('0x13'))(_0x5eaa('0x14'));var utils=require('../../config/utils');var config=require(_0x5eaa('0x15'));var db=require(_0x5eaa('0x16'))['db'];function respondWithStatusCode(_0x4fa1e6,_0x5b798a){_0x5b798a=_0x5b798a||0xcc;return function(_0xe7784d){if(_0xe7784d){return _0x4fa1e6[_0x5eaa('0x17')](_0x5b798a);}return _0x4fa1e6[_0x5eaa('0x18')](_0x5b798a)[_0x5eaa('0x19')]();};}function respondWithResult(_0x538729,_0x1b4b38){_0x1b4b38=_0x1b4b38||0xc8;return function(_0x2e2232){if(_0x2e2232){return _0x538729[_0x5eaa('0x18')](_0x1b4b38)['json'](_0x2e2232);}};}function respondWithFilteredResult(_0x15e8e4,_0xbdafdb){return function(_0x50591b){if(_0x50591b){var _0x221bba=_0x50591b[_0x5eaa('0x1a')],_0x39a3ff=_0xbdafdb[_0x5eaa('0x1b')],_0x249c29=_0xbdafdb['offset']+_0xbdafdb[_0x5eaa('0x1c')],_0x118f83;if(_0x249c29>=_0x221bba){_0x249c29=_0x221bba;_0x118f83=0xc8;}else{_0x118f83=0xce;}_0x15e8e4[_0x5eaa('0x18')](_0x118f83);return _0x15e8e4['set'](_0x5eaa('0x1d'),_0x39a3ff+'-'+_0x249c29+'/'+_0x221bba)[_0x5eaa('0x1e')](_0x50591b);}return null;};}function patchUpdates(_0x415683){return function(_0x5112a8){try{jsonpatch[_0x5eaa('0x1f')](_0x5112a8,_0x415683,!![]);}catch(_0x5c5d12){return BPromise[_0x5eaa('0x20')](_0x5c5d12);}return _0x5112a8[_0x5eaa('0x21')]();};}function saveUpdates(_0x4849a0,_0x17e789){return function(_0x5c08fc){if(_0x5c08fc){return _0x5c08fc[_0x5eaa('0x22')](_0x4849a0)[_0x5eaa('0x23')](function(_0x26357b){return _0x26357b;});}return null;};}function removeEntity(_0x14c611,_0x1be71f){return function(_0x3343f8){if(_0x3343f8){return _0x3343f8[_0x5eaa('0x24')]()[_0x5eaa('0x23')](function(){var _0x50104e=_0x3343f8[_0x5eaa('0x25')]({'plain':!![]});var _0x3b057f=_0x5eaa('0x26');return db[_0x5eaa('0x27')][_0x5eaa('0x24')]({'where':{'type':_0x3b057f,'resourceId':_0x50104e['id']}})[_0x5eaa('0x23')](function(){return _0x3343f8;});})[_0x5eaa('0x23')](function(){_0x14c611[_0x5eaa('0x18')](0xcc)[_0x5eaa('0x19')]();});}};}function handleEntityNotFound(_0x4727d7,_0x38b12b){return function(_0x4a5ab5){if(!_0x4a5ab5){_0x4727d7['sendStatus'](0x194);}return _0x4a5ab5;};}function handleError(_0xbc4fcb,_0x2c0341){_0x2c0341=_0x2c0341||0x1f4;return function(_0x10fb1a){logger['error'](_0x10fb1a[_0x5eaa('0x28')]);if(_0x10fb1a[_0x5eaa('0x29')]){delete _0x10fb1a[_0x5eaa('0x29')];}_0xbc4fcb[_0x5eaa('0x18')](_0x2c0341)[_0x5eaa('0x2a')](_0x10fb1a);};}exports['index']=function(_0x5a0532,_0x583353){var _0x11dfc5={},_0x4c450c={},_0x45ac1c={'count':0x0,'rows':[]};var _0x39b810=db[_0x5eaa('0x2b')][_0x5eaa('0x2c')];_0x4c450c['model']=_['keys'](_0x39b810);_0x4c450c[_0x5eaa('0x2d')]=_[_0x5eaa('0x2e')](_0x5a0532[_0x5eaa('0x2d')]);_0x4c450c[_0x5eaa('0x2f')]=_['intersection'](_0x4c450c[_0x5eaa('0x30')],_0x4c450c['query']);_0x11dfc5[_0x5eaa('0x31')]=_[_0x5eaa('0x32')](_0x4c450c[_0x5eaa('0x30')],qs[_0x5eaa('0x33')](_0x5a0532[_0x5eaa('0x2d')][_0x5eaa('0x33')]));_0x11dfc5[_0x5eaa('0x31')]=_0x11dfc5[_0x5eaa('0x31')][_0x5eaa('0x34')]?_0x11dfc5['attributes']:_0x4c450c[_0x5eaa('0x30')];if(!_0x5a0532['query'][_0x5eaa('0x35')](_0x5eaa('0x36'))){_0x11dfc5[_0x5eaa('0x1c')]=qs['limit'](_0x5a0532[_0x5eaa('0x2d')][_0x5eaa('0x1c')]);_0x11dfc5[_0x5eaa('0x1b')]=qs[_0x5eaa('0x1b')](_0x5a0532[_0x5eaa('0x2d')][_0x5eaa('0x1b')]);}_0x11dfc5[_0x5eaa('0x37')]=qs['sort'](_0x5a0532[_0x5eaa('0x2d')][_0x5eaa('0x38')]);_0x11dfc5[_0x5eaa('0x39')]=qs[_0x5eaa('0x2f')](_[_0x5eaa('0x3a')](_0x5a0532[_0x5eaa('0x2d')],_0x4c450c['filters']));if(_0x5a0532[_0x5eaa('0x2d')][_0x5eaa('0x3b')]){_0x11dfc5[_0x5eaa('0x39')]=_['merge'](_0x11dfc5[_0x5eaa('0x39')],{'$or':_['map'](_0x39b810,function(_0x2f49b5){if(_0x2f49b5[_0x5eaa('0x3c')]['key']!==_0x5eaa('0x3d')){var _0x1dce7a={};_0x1dce7a[_0x2f49b5['field']]={'$like':'%'+_0x5a0532[_0x5eaa('0x2d')][_0x5eaa('0x3b')]+'%'};return _0x1dce7a;}})});}_0x11dfc5=_[_0x5eaa('0x3e')]({},_0x11dfc5,_0x5a0532[_0x5eaa('0x3f')]);var _0x3ccf98={'where':_0x11dfc5[_0x5eaa('0x39')]};return db[_0x5eaa('0x2b')][_0x5eaa('0x1a')](_0x3ccf98)['then'](function(_0x5e59af){_0x45ac1c[_0x5eaa('0x1a')]=_0x5e59af;if(_0x5a0532[_0x5eaa('0x2d')]['includeAll']){_0x11dfc5[_0x5eaa('0x40')]=[{'all':!![]}];}return db[_0x5eaa('0x2b')][_0x5eaa('0x41')](_0x11dfc5);})[_0x5eaa('0x23')](function(_0x358216){_0x45ac1c[_0x5eaa('0x42')]=_0x358216;return _0x45ac1c;})[_0x5eaa('0x23')](respondWithFilteredResult(_0x583353,_0x11dfc5))['catch'](handleError(_0x583353,null));};exports[_0x5eaa('0x43')]=function(_0xd29331,_0x52bc13){var _0x1d3896={'raw':![],'where':{'id':_0xd29331['params']['id']}},_0x3b48d5={};_0x3b48d5[_0x5eaa('0x30')]=_[_0x5eaa('0x2e')](db[_0x5eaa('0x2b')][_0x5eaa('0x2c')]);_0x3b48d5[_0x5eaa('0x2d')]=_[_0x5eaa('0x2e')](_0xd29331[_0x5eaa('0x2d')]);_0x3b48d5[_0x5eaa('0x2f')]=_[_0x5eaa('0x32')](_0x3b48d5['model'],_0x3b48d5[_0x5eaa('0x2d')]);_0x1d3896[_0x5eaa('0x31')]=_[_0x5eaa('0x32')](_0x3b48d5[_0x5eaa('0x30')],qs['fields'](_0xd29331['query'][_0x5eaa('0x33')]));_0x1d3896[_0x5eaa('0x31')]=_0x1d3896['attributes'][_0x5eaa('0x34')]?_0x1d3896['attributes']:_0x3b48d5[_0x5eaa('0x30')];if(_0xd29331[_0x5eaa('0x2d')][_0x5eaa('0x44')]){_0x1d3896['include']=[{'all':!![]}];}_0x1d3896=_[_0x5eaa('0x3e')]({},_0x1d3896,_0xd29331[_0x5eaa('0x3f')]);return db[_0x5eaa('0x2b')][_0x5eaa('0x45')](_0x1d3896)[_0x5eaa('0x23')](handleEntityNotFound(_0x52bc13,null))[_0x5eaa('0x23')](respondWithResult(_0x52bc13,null))['catch'](handleError(_0x52bc13,null));};exports[_0x5eaa('0x22')]=function(_0x4b8a52,_0x29b9d7){if(_0x4b8a52['body']['id']){delete _0x4b8a52[_0x5eaa('0x46')]['id'];}return db[_0x5eaa('0x2b')][_0x5eaa('0x45')]({'where':{'id':_0x4b8a52[_0x5eaa('0x47')]['id']}})[_0x5eaa('0x23')](handleEntityNotFound(_0x29b9d7,null))['then'](saveUpdates(_0x4b8a52[_0x5eaa('0x46')],null))['then'](respondWithResult(_0x29b9d7,null))['catch'](handleError(_0x29b9d7,null));};exports['create']=function(_0xe6eac2,_0x5b434a,_0x5bbec4){return db[_0x5eaa('0x48')][_0x5eaa('0x49')](function(_0x20237f){if(_0xe6eac2[_0x5eaa('0x46')][_0x5eaa('0x4a')]===_0x5eaa('0x4b')){_0xe6eac2[_0x5eaa('0x46')][_0x5eaa('0x4c')]=path[_0x5eaa('0x4d')](config['root'],_0x5eaa('0x4e'),_0xe6eac2[_0x5eaa('0x46')][_0x5eaa('0x29')]);}return db[_0x5eaa('0x2b')][_0x5eaa('0x4f')](_0xe6eac2[_0x5eaa('0x46')],{'transaction':_0x20237f})['then'](function(_0x42b914){if(_0xe6eac2[_0x5eaa('0x46')][_0x5eaa('0x4a')]===_0x5eaa('0x4b')){fs[_0x5eaa('0x50')](_0x42b914[_0x5eaa('0x4c')],parseInt(_0x5eaa('0x51'),0x8));}var _0x11591b=_0xe6eac2[_0x5eaa('0x52')][_0x5eaa('0x25')]({'plain':!![]});if(!_0x11591b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11591b[_0x5eaa('0x53')]===_0x5eaa('0x52')){var _0x5d9f7b=_0x42b914['get']({'plain':!![]});return db['UserProfileSection'][_0x5eaa('0x45')]({'where':{'name':_0x5eaa('0x26'),'userProfileId':_0x11591b['userProfileId']},'raw':!![]})[_0x5eaa('0x23')](function(_0x197350){if(_0x197350&&_0x197350['autoAssociation']===0x0){return db[_0x5eaa('0x27')][_0x5eaa('0x4f')]({'name':_0x5d9f7b[_0x5eaa('0x29')],'resourceId':_0x5d9f7b['id'],'type':_0x197350[_0x5eaa('0x29')],'sectionId':_0x197350['id']},{})['then'](function(){return _0x42b914;});}else{return _0x42b914;}})[_0x5eaa('0x54')](function(_0x3d08be){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d08be);});}return _0x42b914;});})['then'](respondWithResult(_0x5b434a,0xc9))[_0x5eaa('0x54')](handleError(_0x5b434a,null));};exports[_0x5eaa('0x24')]=function(_0x240a2f,_0x89a16a,_0x202853){var _0x269d82;return db[_0x5eaa('0x2b')][_0x5eaa('0x45')]({'where':{'id':_0x240a2f[_0x5eaa('0x47')]['id']}})[_0x5eaa('0x23')](function(_0x24654b){if(_0x24654b){return db[_0x5eaa('0x48')][_0x5eaa('0x49')](function(_0x5b714d){return _0x24654b[_0x5eaa('0x24')]({'transaction':_0x5b714d,'raw':!![]})[_0x5eaa('0x23')](function(_0x4ecdf8){if(_0x4ecdf8[_0x5eaa('0x4c')]){fs['readdirSync'](_0x4ecdf8['directory'])[_0x5eaa('0x55')](function(_0x38cbda){fs[_0x5eaa('0x56')](path[_0x5eaa('0x4d')](_0x4ecdf8[_0x5eaa('0x4c')],_0x38cbda));});fs[_0x5eaa('0x57')](_0x4ecdf8[_0x5eaa('0x4c')]);}return _0x4ecdf8;});})['catch'](function(_0x21bab1){throw new db[(_0x5eaa('0x58'))]['ValidationError'](_0x21bab1[_0x5eaa('0x59')]);});}})[_0x5eaa('0x23')](handleEntityNotFound(_0x89a16a,null))[_0x5eaa('0x23')](removeEntity(_0x89a16a,null))[_0x5eaa('0x54')](handleError(_0x89a16a,null));};exports['addSound']=function(_0x196a8,_0x221afa,_0x1da56b){return db[_0x5eaa('0x48')][_0x5eaa('0x49')](function(_0x366d9d){var _0x4d0caa;return db['VoiceMusicOnHold'][_0x5eaa('0x45')]({'where':{'id':_0x196a8[_0x5eaa('0x47')]['id']}})[_0x5eaa('0x23')](function(_0x1a4081){if(_0x1a4081){_0x4d0caa=_0x1a4081;return _0x1a4081[_0x5eaa('0x5a')](_0x196a8[_0x5eaa('0x46')]['id'],{'transaction':_0x366d9d});}})['then'](function(_0x1771a4){if(_0x1771a4){return db[_0x5eaa('0x5b')][_0x5eaa('0x5c')]({'where':{'id':_0x196a8[_0x5eaa('0x46')]['id']},'attributes':['id',_0x5eaa('0x29'),'save_name',_0x5eaa('0x5d'),'createdAt'],'raw':!![]});}})[_0x5eaa('0x23')](function(_0x3f7cdd){if(_0x3f7cdd){var _0x341e28=path['join'](config[_0x5eaa('0x5e')],_0x5eaa('0x5f'),util[_0x5eaa('0x60')]('%s.%s',path[_0x5eaa('0x61')](_0x3f7cdd['save_name'],path['extname'](_0x3f7cdd[_0x5eaa('0x62')])),_0x3f7cdd['converted_format']));var _0x37ab6c=path[_0x5eaa('0x4d')](config[_0x5eaa('0x5e')],_0x5eaa('0x4e'),_0x4d0caa['name'],util[_0x5eaa('0x60')](_0x5eaa('0x63'),_0x3f7cdd['name'],_0x3f7cdd[_0x5eaa('0x5d')]));fs['symlinkSync'](_0x341e28,_0x37ab6c);return _0x3f7cdd;}})[_0x5eaa('0x54')](function(_0x4165f4){throw new db[(_0x5eaa('0x58'))]['ValidationError'](_0x4165f4[_0x5eaa('0x59')]);});})[_0x5eaa('0x23')](handleEntityNotFound(_0x221afa,null))[_0x5eaa('0x23')](respondWithResult(_0x221afa,0xc9))['catch'](handleError(_0x221afa,null));};exports[_0x5eaa('0x64')]=function(_0x180b8c,_0x35885e,_0xc0d4ea){return db[_0x5eaa('0x48')][_0x5eaa('0x49')](function(_0x45a919){var _0x4a8070;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x180b8c[_0x5eaa('0x47')]['id']}})['then'](handleEntityNotFound(_0x35885e,null))['then'](function(_0x37308a){if(_0x37308a){_0x4a8070=_0x37308a;return _0x37308a[_0x5eaa('0x64')](_0x180b8c[_0x5eaa('0x47')][_0x5eaa('0x65')]);}})['then'](function(_0x3f2daf){if(_0x3f2daf){return db[_0x5eaa('0x5b')][_0x5eaa('0x5c')]({'where':{'id':_0x180b8c['params'][_0x5eaa('0x65')]},'attributes':['id',_0x5eaa('0x29'),_0x5eaa('0x62'),_0x5eaa('0x5d'),'createdAt'],'raw':!![]});}})[_0x5eaa('0x23')](function(_0x245af1){if(_0x245af1){fs[_0x5eaa('0x56')](path[_0x5eaa('0x4d')](_0x4a8070[_0x5eaa('0x4c')],util[_0x5eaa('0x60')](_0x5eaa('0x63'),_0x245af1['name'],_0x245af1[_0x5eaa('0x5d')])));return _0x245af1;}})[_0x5eaa('0x54')](function(_0x2f4764){throw new db['Sequelize'][(_0x5eaa('0x66'))](_0x2f4764[_0x5eaa('0x59')]);});})['then'](handleEntityNotFound(_0x35885e,null))[_0x5eaa('0x23')](respondWithStatusCode(_0x35885e,0xcc))[_0x5eaa('0x54')](handleError(_0x35885e,null));};exports[_0x5eaa('0x67')]=function(_0x410bc2,_0x2e3e29,_0x2c40aa){var _0x38b26c={};var _0x31913f={};var _0x50f09c;var _0x345063;return db[_0x5eaa('0x2b')][_0x5eaa('0x5c')]({'where':{'id':_0x410bc2[_0x5eaa('0x47')]['id']}})[_0x5eaa('0x23')](handleEntityNotFound(_0x2e3e29,null))[_0x5eaa('0x23')](function(_0x421a99){if(_0x421a99){_0x50f09c=_0x421a99;_0x31913f['model']=_[_0x5eaa('0x2e')](db[_0x5eaa('0x5b')]['rawAttributes']);_0x31913f[_0x5eaa('0x2d')]=_[_0x5eaa('0x2e')](_0x410bc2['query']);_0x31913f[_0x5eaa('0x2f')]=_[_0x5eaa('0x32')](_0x31913f[_0x5eaa('0x30')],_0x31913f[_0x5eaa('0x2d')]);_0x38b26c[_0x5eaa('0x31')]=_[_0x5eaa('0x32')](_0x31913f[_0x5eaa('0x30')],qs[_0x5eaa('0x33')](_0x410bc2['query'][_0x5eaa('0x33')]));_0x38b26c['attributes']=_0x38b26c[_0x5eaa('0x31')]['length']?_0x38b26c[_0x5eaa('0x31')]:_0x31913f['model'];_0x38b26c['order']=qs['sort'](_0x410bc2[_0x5eaa('0x2d')]['sort']);_0x38b26c[_0x5eaa('0x39')]=qs['filters'](_[_0x5eaa('0x3a')](_0x410bc2[_0x5eaa('0x2d')],_0x31913f[_0x5eaa('0x2f')]));if(_0x410bc2[_0x5eaa('0x2d')]['filter']){_0x38b26c['where']=_[_0x5eaa('0x3e')](_0x38b26c['where'],{'$or':_[_0x5eaa('0x68')](_0x38b26c[_0x5eaa('0x31')],function(_0x192959){var _0x381fd8={};_0x381fd8[_0x192959]={'$like':'%'+_0x410bc2['query'][_0x5eaa('0x3b')]+'%'};return _0x381fd8;})});}_0x38b26c=_[_0x5eaa('0x3e')]({},_0x38b26c,_0x410bc2[_0x5eaa('0x3f')]);return _0x50f09c[_0x5eaa('0x67')](_0x38b26c);}})['then'](function(_0x88e840){if(_0x88e840){_0x345063=_0x88e840['length'];if(!_0x410bc2[_0x5eaa('0x2d')][_0x5eaa('0x35')](_0x5eaa('0x36'))){_0x38b26c[_0x5eaa('0x1c')]=qs['limit'](_0x410bc2[_0x5eaa('0x2d')][_0x5eaa('0x1c')]);_0x38b26c['offset']=qs[_0x5eaa('0x1b')](_0x410bc2[_0x5eaa('0x2d')][_0x5eaa('0x1b')]);}return _0x50f09c['getSounds'](_0x38b26c);}})['then'](function(_0x18b7dc){if(_0x18b7dc){return _0x18b7dc?{'count':_0x345063,'rows':_0x18b7dc}:null;}})[_0x5eaa('0x23')](respondWithResult(_0x2e3e29,null))[_0x5eaa('0x54')](handleError(_0x2e3e29,null));}; \ No newline at end of file +var _0x96e7=['mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','server/files/sounds/converted','format','%s.%s','converted_format','symlinkSync','removeSound','id2','createdAt','getSounds','map','nolimit','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','Content-Range','json','reject','destroy','then','get','MusicOnHolds','UserProfileResource','error','stack','name','send','index','VoiceMusicOnHold','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','field','merge','count','includeAll','include','findAll','show','options','find','catch','body','params','transaction','mode','files','directory','join','root','server/files/moh','create'];(function(_0x4fa737,_0x293310){var _0x475beb=function(_0x473abd){while(--_0x473abd){_0x4fa737['push'](_0x4fa737['shift']());}};_0x475beb(++_0x293310);}(_0x96e7,0xfe));var _0x796e=function(_0x301c34,_0x15701e){_0x301c34=_0x301c34-0x0;var _0x1a8c5a=_0x96e7[_0x301c34];return _0x1a8c5a;};'use strict';var pdf=require(_0x796e('0x0'));var emlformat=require(_0x796e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x796e('0x2'));var jsonpatch=require(_0x796e('0x3'));var rp=require(_0x796e('0x4'));var moment=require(_0x796e('0x5'));var BPromise=require(_0x796e('0x6'));var Mustache=require(_0x796e('0x7'));var util=require(_0x796e('0x8'));var path=require(_0x796e('0x9'));var sox=require(_0x796e('0xa'));var csv=require(_0x796e('0xb'));var ejs=require(_0x796e('0xc'));var fs=require('fs');var _=require(_0x796e('0xd'));var squel=require(_0x796e('0xe'));var crypto=require('crypto');var jsforce=require(_0x796e('0xf'));var deskjs=require(_0x796e('0x10'));var toCsv=require(_0x796e('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x796e('0x11'));var authService=require(_0x796e('0x12'));var qs=require(_0x796e('0x13'));var hardwareService=require(_0x796e('0x14'));var logger=require(_0x796e('0x15'))(_0x796e('0x16'));var utils=require(_0x796e('0x17'));var config=require(_0x796e('0x18'));var db=require(_0x796e('0x19'))['db'];function respondWithStatusCode(_0x52553b,_0x447d1e){_0x447d1e=_0x447d1e||0xcc;return function(_0x27cf8e){if(_0x27cf8e){return _0x52553b[_0x796e('0x1a')](_0x447d1e);}return _0x52553b[_0x796e('0x1b')](_0x447d1e)[_0x796e('0x1c')]();};}function respondWithResult(_0x52dc2f,_0x308010){_0x308010=_0x308010||0xc8;return function(_0x4b831f){if(_0x4b831f){return _0x52dc2f[_0x796e('0x1b')](_0x308010)['json'](_0x4b831f);}};}function respondWithFilteredResult(_0x2c6ee0,_0xf39b05){return function(_0x26aed5){if(_0x26aed5){var _0x576d75=_0x26aed5['count'],_0x4d143d=_0xf39b05['offset'],_0x4b41b6=_0xf39b05[_0x796e('0x1d')]+_0xf39b05[_0x796e('0x1e')],_0x511be1;if(_0x4b41b6>=_0x576d75){_0x4b41b6=_0x576d75;_0x511be1=0xc8;}else{_0x511be1=0xce;}_0x2c6ee0[_0x796e('0x1b')](_0x511be1);return _0x2c6ee0['set'](_0x796e('0x1f'),_0x4d143d+'-'+_0x4b41b6+'/'+_0x576d75)[_0x796e('0x20')](_0x26aed5);}return null;};}function patchUpdates(_0x429c34){return function(_0x3043a1){try{jsonpatch['apply'](_0x3043a1,_0x429c34,!![]);}catch(_0x349e9c){return BPromise[_0x796e('0x21')](_0x349e9c);}return _0x3043a1['save']();};}function saveUpdates(_0x1cd9b3,_0x2e2635){return function(_0x3d05dc){if(_0x3d05dc){return _0x3d05dc['update'](_0x1cd9b3)['then'](function(_0x572f17){return _0x572f17;});}return null;};}function removeEntity(_0x524b8b,_0x116387){return function(_0x2ccd2c){if(_0x2ccd2c){return _0x2ccd2c[_0x796e('0x22')]()[_0x796e('0x23')](function(){var _0xd275c3=_0x2ccd2c[_0x796e('0x24')]({'plain':!![]});var _0xc969b5=_0x796e('0x25');return db[_0x796e('0x26')][_0x796e('0x22')]({'where':{'type':_0xc969b5,'resourceId':_0xd275c3['id']}})[_0x796e('0x23')](function(){return _0x2ccd2c;});})[_0x796e('0x23')](function(){_0x524b8b['status'](0xcc)[_0x796e('0x1c')]();});}};}function handleEntityNotFound(_0xbdd63d,_0x117c97){return function(_0x3638af){if(!_0x3638af){_0xbdd63d[_0x796e('0x1a')](0x194);}return _0x3638af;};}function handleError(_0x53bf80,_0x5a62df){_0x5a62df=_0x5a62df||0x1f4;return function(_0x27a71a){logger[_0x796e('0x27')](_0x27a71a[_0x796e('0x28')]);if(_0x27a71a[_0x796e('0x29')]){delete _0x27a71a[_0x796e('0x29')];}_0x53bf80[_0x796e('0x1b')](_0x5a62df)[_0x796e('0x2a')](_0x27a71a);};}exports[_0x796e('0x2b')]=function(_0x274ac0,_0x225176){var _0x1dc456={},_0x16f699={},_0x31000c={'count':0x0,'rows':[]};var _0x5a0545=db[_0x796e('0x2c')][_0x796e('0x2d')];_0x16f699[_0x796e('0x2e')]=_[_0x796e('0x2f')](_0x5a0545);_0x16f699[_0x796e('0x30')]=_[_0x796e('0x2f')](_0x274ac0[_0x796e('0x30')]);_0x16f699[_0x796e('0x31')]=_[_0x796e('0x32')](_0x16f699[_0x796e('0x2e')],_0x16f699[_0x796e('0x30')]);_0x1dc456[_0x796e('0x33')]=_['intersection'](_0x16f699[_0x796e('0x2e')],qs[_0x796e('0x34')](_0x274ac0['query'][_0x796e('0x34')]));_0x1dc456['attributes']=_0x1dc456['attributes'][_0x796e('0x35')]?_0x1dc456[_0x796e('0x33')]:_0x16f699[_0x796e('0x2e')];if(!_0x274ac0['query'][_0x796e('0x36')]('nolimit')){_0x1dc456[_0x796e('0x1e')]=qs[_0x796e('0x1e')](_0x274ac0[_0x796e('0x30')][_0x796e('0x1e')]);_0x1dc456[_0x796e('0x1d')]=qs[_0x796e('0x1d')](_0x274ac0['query'][_0x796e('0x1d')]);}_0x1dc456[_0x796e('0x37')]=qs[_0x796e('0x38')](_0x274ac0['query'][_0x796e('0x38')]);_0x1dc456[_0x796e('0x39')]=qs[_0x796e('0x31')](_[_0x796e('0x3a')](_0x274ac0[_0x796e('0x30')],_0x16f699['filters']));if(_0x274ac0['query'][_0x796e('0x3b')]){_0x1dc456['where']=_['merge'](_0x1dc456[_0x796e('0x39')],{'$or':_['map'](_0x5a0545,function(_0x2f2fe7){if(_0x2f2fe7[_0x796e('0x3c')]['key']!==_0x796e('0x3d')){var _0x1ea3c8={};_0x1ea3c8[_0x2f2fe7[_0x796e('0x3e')]]={'$like':'%'+_0x274ac0[_0x796e('0x30')][_0x796e('0x3b')]+'%'};return _0x1ea3c8;}})});}_0x1dc456=_[_0x796e('0x3f')]({},_0x1dc456,_0x274ac0['options']);var _0xc5bea0={'where':_0x1dc456[_0x796e('0x39')]};return db['VoiceMusicOnHold'][_0x796e('0x40')](_0xc5bea0)[_0x796e('0x23')](function(_0x7f1b35){_0x31000c[_0x796e('0x40')]=_0x7f1b35;if(_0x274ac0['query'][_0x796e('0x41')]){_0x1dc456[_0x796e('0x42')]=[{'all':!![]}];}return db[_0x796e('0x2c')][_0x796e('0x43')](_0x1dc456);})[_0x796e('0x23')](function(_0x3ca7f8){_0x31000c['rows']=_0x3ca7f8;return _0x31000c;})[_0x796e('0x23')](respondWithFilteredResult(_0x225176,_0x1dc456))['catch'](handleError(_0x225176,null));};exports[_0x796e('0x44')]=function(_0x83bd0b,_0x41c603){var _0x2d4c1b={'raw':![],'where':{'id':_0x83bd0b['params']['id']}},_0x384163={};_0x384163[_0x796e('0x2e')]=_['keys'](db['VoiceMusicOnHold'][_0x796e('0x2d')]);_0x384163[_0x796e('0x30')]=_['keys'](_0x83bd0b['query']);_0x384163['filters']=_['intersection'](_0x384163[_0x796e('0x2e')],_0x384163[_0x796e('0x30')]);_0x2d4c1b[_0x796e('0x33')]=_['intersection'](_0x384163[_0x796e('0x2e')],qs[_0x796e('0x34')](_0x83bd0b[_0x796e('0x30')][_0x796e('0x34')]));_0x2d4c1b[_0x796e('0x33')]=_0x2d4c1b[_0x796e('0x33')][_0x796e('0x35')]?_0x2d4c1b['attributes']:_0x384163['model'];if(_0x83bd0b[_0x796e('0x30')][_0x796e('0x41')]){_0x2d4c1b[_0x796e('0x42')]=[{'all':!![]}];}_0x2d4c1b=_[_0x796e('0x3f')]({},_0x2d4c1b,_0x83bd0b[_0x796e('0x45')]);return db[_0x796e('0x2c')][_0x796e('0x46')](_0x2d4c1b)[_0x796e('0x23')](handleEntityNotFound(_0x41c603,null))['then'](respondWithResult(_0x41c603,null))[_0x796e('0x47')](handleError(_0x41c603,null));};exports['update']=function(_0x56aabe,_0xd6f027){if(_0x56aabe[_0x796e('0x48')]['id']){delete _0x56aabe[_0x796e('0x48')]['id'];}return db[_0x796e('0x2c')][_0x796e('0x46')]({'where':{'id':_0x56aabe[_0x796e('0x49')]['id']}})[_0x796e('0x23')](handleEntityNotFound(_0xd6f027,null))[_0x796e('0x23')](saveUpdates(_0x56aabe[_0x796e('0x48')],null))[_0x796e('0x23')](respondWithResult(_0xd6f027,null))[_0x796e('0x47')](handleError(_0xd6f027,null));};exports['create']=function(_0x11e7d8,_0x56bee5,_0x487ba2){return db['sequelize'][_0x796e('0x4a')](function(_0x5bc236){if(_0x11e7d8[_0x796e('0x48')][_0x796e('0x4b')]===_0x796e('0x4c')){_0x11e7d8[_0x796e('0x48')][_0x796e('0x4d')]=path[_0x796e('0x4e')](config[_0x796e('0x4f')],_0x796e('0x50'),_0x11e7d8[_0x796e('0x48')]['name']);}return db[_0x796e('0x2c')][_0x796e('0x51')](_0x11e7d8[_0x796e('0x48')],{'transaction':_0x5bc236})[_0x796e('0x23')](function(_0x157c09){if(_0x11e7d8[_0x796e('0x48')][_0x796e('0x4b')]===_0x796e('0x4c')){fs[_0x796e('0x52')](_0x157c09['directory'],parseInt('0777',0x8));}var _0x1733e4=_0x11e7d8[_0x796e('0x53')][_0x796e('0x24')]({'plain':!![]});if(!_0x1733e4)throw new Error(_0x796e('0x54'));if(_0x1733e4['role']==='user'){var _0x40e140=_0x157c09[_0x796e('0x24')]({'plain':!![]});return db[_0x796e('0x55')]['find']({'where':{'name':_0x796e('0x25'),'userProfileId':_0x1733e4[_0x796e('0x56')]},'raw':!![]})[_0x796e('0x23')](function(_0x5eebeb){if(_0x5eebeb&&_0x5eebeb[_0x796e('0x57')]===0x0){return db[_0x796e('0x26')][_0x796e('0x51')]({'name':_0x40e140[_0x796e('0x29')],'resourceId':_0x40e140['id'],'type':_0x5eebeb['name'],'sectionId':_0x5eebeb['id']},{})[_0x796e('0x23')](function(){return _0x157c09;});}else{return _0x157c09;}})['catch'](function(_0x8fb03c){logger[_0x796e('0x27')](_0x796e('0x58'),_0x8fb03c);});}return _0x157c09;});})[_0x796e('0x23')](respondWithResult(_0x56bee5,0xc9))[_0x796e('0x47')](handleError(_0x56bee5,null));};exports[_0x796e('0x22')]=function(_0x2bd3e6,_0x34d3bd,_0x4dd6f3){var _0x2b039f;return db[_0x796e('0x2c')][_0x796e('0x46')]({'where':{'id':_0x2bd3e6[_0x796e('0x49')]['id']}})[_0x796e('0x23')](function(_0x2dcaf4){if(_0x2dcaf4){return db[_0x796e('0x59')][_0x796e('0x4a')](function(_0x14a9a0){return _0x2dcaf4['destroy']({'transaction':_0x14a9a0,'raw':!![]})[_0x796e('0x23')](function(_0x42823c){if(_0x42823c[_0x796e('0x4d')]){fs[_0x796e('0x5a')](_0x42823c[_0x796e('0x4d')])[_0x796e('0x5b')](function(_0x5d11c9){fs[_0x796e('0x5c')](path[_0x796e('0x4e')](_0x42823c[_0x796e('0x4d')],_0x5d11c9));});fs[_0x796e('0x5d')](_0x42823c['directory']);}return _0x42823c;});})[_0x796e('0x47')](function(_0x36dae4){throw new db[(_0x796e('0x5e'))][(_0x796e('0x5f'))](_0x36dae4[_0x796e('0x60')]);});}})[_0x796e('0x23')](handleEntityNotFound(_0x34d3bd,null))['then'](removeEntity(_0x34d3bd,null))[_0x796e('0x47')](handleError(_0x34d3bd,null));};exports['addSound']=function(_0x500247,_0x511d02,_0xc689ba){return db[_0x796e('0x59')][_0x796e('0x4a')](function(_0x3d0738){var _0x21635c;return db[_0x796e('0x2c')][_0x796e('0x46')]({'where':{'id':_0x500247['params']['id']}})[_0x796e('0x23')](function(_0x257475){if(_0x257475){_0x21635c=_0x257475;return _0x257475[_0x796e('0x61')](_0x500247[_0x796e('0x48')]['id'],{'transaction':_0x3d0738});}})[_0x796e('0x23')](function(_0x47e931){if(_0x47e931){return db[_0x796e('0x62')][_0x796e('0x63')]({'where':{'id':_0x500247[_0x796e('0x48')]['id']},'attributes':['id',_0x796e('0x29'),_0x796e('0x64'),'converted_format','createdAt'],'raw':!![]});}})[_0x796e('0x23')](function(_0x53b4fb){if(_0x53b4fb){var _0x31e969=path[_0x796e('0x4e')](config[_0x796e('0x4f')],_0x796e('0x65'),util[_0x796e('0x66')](_0x796e('0x67'),path['basename'](_0x53b4fb[_0x796e('0x64')],path['extname'](_0x53b4fb['save_name'])),_0x53b4fb[_0x796e('0x68')]));var _0x1c8dd6=path['join'](config[_0x796e('0x4f')],'server/files/moh',_0x21635c[_0x796e('0x29')],util[_0x796e('0x66')]('%s.%s',_0x53b4fb[_0x796e('0x29')],_0x53b4fb[_0x796e('0x68')]));fs[_0x796e('0x69')](_0x31e969,_0x1c8dd6);return _0x53b4fb;}})[_0x796e('0x47')](function(_0x2ced8b){throw new db[(_0x796e('0x5e'))][(_0x796e('0x5f'))](_0x2ced8b[_0x796e('0x60')]);});})[_0x796e('0x23')](handleEntityNotFound(_0x511d02,null))[_0x796e('0x23')](respondWithResult(_0x511d02,0xc9))[_0x796e('0x47')](handleError(_0x511d02,null));};exports[_0x796e('0x6a')]=function(_0x16a5e3,_0x30b629,_0x26d45c){return db['sequelize']['transaction'](function(_0x23cb4c){var _0x4bb268;return db[_0x796e('0x2c')]['findOne']({'where':{'id':_0x16a5e3['params']['id']}})[_0x796e('0x23')](handleEntityNotFound(_0x30b629,null))['then'](function(_0x152d82){if(_0x152d82){_0x4bb268=_0x152d82;return _0x152d82[_0x796e('0x6a')](_0x16a5e3['params'][_0x796e('0x6b')]);}})['then'](function(_0x558d22){if(_0x558d22){return db[_0x796e('0x62')][_0x796e('0x63')]({'where':{'id':_0x16a5e3[_0x796e('0x49')][_0x796e('0x6b')]},'attributes':['id',_0x796e('0x29'),_0x796e('0x64'),_0x796e('0x68'),_0x796e('0x6c')],'raw':!![]});}})[_0x796e('0x23')](function(_0x45b461){if(_0x45b461){fs['unlinkSync'](path[_0x796e('0x4e')](_0x4bb268['directory'],util[_0x796e('0x66')]('%s.%s',_0x45b461[_0x796e('0x29')],_0x45b461[_0x796e('0x68')])));return _0x45b461;}})['catch'](function(_0x53b836){throw new db[(_0x796e('0x5e'))]['ValidationError'](_0x53b836[_0x796e('0x60')]);});})[_0x796e('0x23')](handleEntityNotFound(_0x30b629,null))[_0x796e('0x23')](respondWithStatusCode(_0x30b629,0xcc))[_0x796e('0x47')](handleError(_0x30b629,null));};exports[_0x796e('0x6d')]=function(_0x31166a,_0x3d70d9,_0x149be5){var _0x592abd={};var _0x17c6ca={};var _0x2aaca4;var _0x596d60;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x31166a[_0x796e('0x49')]['id']}})[_0x796e('0x23')](handleEntityNotFound(_0x3d70d9,null))['then'](function(_0x253828){if(_0x253828){_0x2aaca4=_0x253828;_0x17c6ca[_0x796e('0x2e')]=_[_0x796e('0x2f')](db['Sound']['rawAttributes']);_0x17c6ca[_0x796e('0x30')]=_[_0x796e('0x2f')](_0x31166a[_0x796e('0x30')]);_0x17c6ca[_0x796e('0x31')]=_['intersection'](_0x17c6ca['model'],_0x17c6ca[_0x796e('0x30')]);_0x592abd['attributes']=_[_0x796e('0x32')](_0x17c6ca[_0x796e('0x2e')],qs[_0x796e('0x34')](_0x31166a['query'][_0x796e('0x34')]));_0x592abd['attributes']=_0x592abd['attributes'][_0x796e('0x35')]?_0x592abd[_0x796e('0x33')]:_0x17c6ca[_0x796e('0x2e')];_0x592abd[_0x796e('0x37')]=qs[_0x796e('0x38')](_0x31166a[_0x796e('0x30')]['sort']);_0x592abd[_0x796e('0x39')]=qs[_0x796e('0x31')](_[_0x796e('0x3a')](_0x31166a[_0x796e('0x30')],_0x17c6ca[_0x796e('0x31')]));if(_0x31166a['query'][_0x796e('0x3b')]){_0x592abd[_0x796e('0x39')]=_[_0x796e('0x3f')](_0x592abd[_0x796e('0x39')],{'$or':_[_0x796e('0x6e')](_0x592abd[_0x796e('0x33')],function(_0x19e7a2){var _0x1c1116={};_0x1c1116[_0x19e7a2]={'$like':'%'+_0x31166a[_0x796e('0x30')][_0x796e('0x3b')]+'%'};return _0x1c1116;})});}_0x592abd=_['merge']({},_0x592abd,_0x31166a[_0x796e('0x45')]);return _0x2aaca4[_0x796e('0x6d')](_0x592abd);}})[_0x796e('0x23')](function(_0xaec4e2){if(_0xaec4e2){_0x596d60=_0xaec4e2[_0x796e('0x35')];if(!_0x31166a[_0x796e('0x30')][_0x796e('0x36')](_0x796e('0x6f'))){_0x592abd[_0x796e('0x1e')]=qs[_0x796e('0x1e')](_0x31166a[_0x796e('0x30')][_0x796e('0x1e')]);_0x592abd[_0x796e('0x1d')]=qs['offset'](_0x31166a[_0x796e('0x30')][_0x796e('0x1d')]);}return _0x2aaca4[_0x796e('0x6d')](_0x592abd);}})[_0x796e('0x23')](function(_0x46e82e){if(_0x46e82e){return _0x46e82e?{'count':_0x596d60,'rows':_0x46e82e}:null;}})[_0x796e('0x23')](respondWithResult(_0x3d70d9,null))[_0x796e('0x47')](handleError(_0x3d70d9,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 3f9b53a..a3e6589 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 _0x1c9f=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes'];(function(_0x13a6f1,_0x59c47c){var _0xffc301=function(_0x235a78){while(--_0x235a78){_0x13a6f1['push'](_0x13a6f1['shift']());}};_0xffc301(++_0x59c47c);}(_0x1c9f,0x9e));var _0xf1c9=function(_0x4de629,_0x1da19f){_0x4de629=_0x4de629-0x0;var _0x13ff74=_0x1c9f[_0x4de629];return _0x13ff74;};'use strict';var _=require(_0xf1c9('0x0'));var util=require(_0xf1c9('0x1'));var logger=require(_0xf1c9('0x2'))(_0xf1c9('0x3'));var moment=require(_0xf1c9('0x4'));var BPromise=require(_0xf1c9('0x5'));var rp=require(_0xf1c9('0x6'));var fs=require('fs');var path=require(_0xf1c9('0x7'));var rimraf=require(_0xf1c9('0x8'));var config=require(_0xf1c9('0x9'));var attributes=require(_0xf1c9('0xa'));module[_0xf1c9('0xb')]=function(_0x58f308,_0x13d9b7){return _0x58f308[_0xf1c9('0xc')]('VoiceMusicOnHold',attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf091=['voice_musiconhold','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold'];(function(_0x4226dd,_0x31c010){var _0x3d3bd6=function(_0x1a3f86){while(--_0x1a3f86){_0x4226dd['push'](_0x4226dd['shift']());}};_0x3d3bd6(++_0x31c010);}(_0xf091,0x8d));var _0x1f09=function(_0x1e6490,_0x5d3c24){_0x1e6490=_0x1e6490-0x0;var _0x30d349=_0xf091[_0x1e6490];return _0x30d349;};'use strict';var _=require('lodash');var util=require(_0x1f09('0x0'));var logger=require(_0x1f09('0x1'))('api');var moment=require(_0x1f09('0x2'));var BPromise=require(_0x1f09('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1f09('0x4'));var config=require(_0x1f09('0x5'));var attributes=require(_0x1f09('0x6'));module['exports']=function(_0x3f9007,_0x36807d){return _0x3f9007[_0x1f09('0x7')](_0x1f09('0x8'),attributes,{'tableName':_0x1f09('0x9'),'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 69e8ea8..9ced06b 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 _0xa38f=['VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x270c5e,_0x1a0a8d){var _0x23585b=function(_0xd694f){while(--_0xd694f){_0x270c5e['push'](_0x270c5e['shift']());}};_0x23585b(++_0x1a0a8d);}(_0xa38f,0x186));var _0xfa38=function(_0x44916a,_0x34c562){_0x44916a=_0x44916a-0x0;var _0x56da26=_0xa38f[_0x44916a];return _0x56da26;};'use strict';var _=require(_0xfa38('0x0'));var util=require(_0xfa38('0x1'));var moment=require(_0xfa38('0x2'));var BPromise=require('bluebird');var rs=require(_0xfa38('0x3'));var fs=require('fs');var Redis=require(_0xfa38('0x4'));var db=require(_0xfa38('0x5'))['db'];var utils=require(_0xfa38('0x6'));var logger=require(_0xfa38('0x7'))(_0xfa38('0x8'));var config=require(_0xfa38('0x9'));var jayson=require(_0xfa38('0xa'));var client=jayson[_0xfa38('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10446f,_0x4cb651,_0x42435c){return new BPromise(function(_0x1effa2,_0x2f81e5){return client[_0xfa38('0xc')](_0x10446f,_0x42435c)[_0xfa38('0xd')](function(_0x56863e){logger[_0xfa38('0xe')](_0xfa38('0xf'),_0x4cb651,_0xfa38('0x10'));logger[_0xfa38('0x11')](_0xfa38('0x12'),_0x4cb651,_0xfa38('0x10'),JSON[_0xfa38('0x13')](_0x56863e));if(_0x56863e[_0xfa38('0x14')]){if(_0x56863e[_0xfa38('0x14')][_0xfa38('0x15')]===0x1f4){logger[_0xfa38('0x14')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4cb651,_0x56863e[_0xfa38('0x14')]['message']);return _0x2f81e5(_0x56863e['error'][_0xfa38('0x16')]);}logger[_0xfa38('0x14')](_0xfa38('0xf'),_0x4cb651,_0x56863e[_0xfa38('0x14')][_0xfa38('0x16')]);return _0x1effa2(_0x56863e['error'][_0xfa38('0x16')]);}else{logger[_0xfa38('0xe')](_0xfa38('0xf'),_0x4cb651,_0xfa38('0x10'));_0x1effa2(_0x56863e[_0xfa38('0x17')][_0xfa38('0x16')]);}})['catch'](function(_0x16b579){logger[_0xfa38('0x14')](_0xfa38('0xf'),_0x4cb651,_0x16b579);_0x2f81e5(_0x16b579);});});} \ No newline at end of file +var _0xf22c=['then','info','VoiceMusicOnHold,\x20%s,\x20%s','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xf22c,0x11c));var _0xcf22=function(_0x29738f,_0x3b82e4){_0x29738f=_0x29738f-0x0;var _0x236543=_0xf22c[_0x29738f];return _0x236543;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcf22('0x0'));var BPromise=require(_0xcf22('0x1'));var rs=require(_0xcf22('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf22('0x3'))['db'];var utils=require(_0xcf22('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xcf22('0x5'));var jayson=require(_0xcf22('0x6'));var client=jayson[_0xcf22('0x7')][_0xcf22('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1df8bf,_0x22b00e,_0x597609){return new BPromise(function(_0x5133a7,_0x5b6fc6){return client[_0xcf22('0x9')](_0x1df8bf,_0x597609)[_0xcf22('0xa')](function(_0x1108b9){logger[_0xcf22('0xb')](_0xcf22('0xc'),_0x22b00e,'request\x20sent');logger[_0xcf22('0xd')](_0xcf22('0xe'),_0x22b00e,'request\x20sent',JSON[_0xcf22('0xf')](_0x1108b9));if(_0x1108b9['error']){if(_0x1108b9['error']['code']===0x1f4){logger[_0xcf22('0x10')](_0xcf22('0xc'),_0x22b00e,_0x1108b9[_0xcf22('0x10')][_0xcf22('0x11')]);return _0x5b6fc6(_0x1108b9[_0xcf22('0x10')][_0xcf22('0x11')]);}logger[_0xcf22('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x22b00e,_0x1108b9[_0xcf22('0x10')][_0xcf22('0x11')]);return _0x5133a7(_0x1108b9[_0xcf22('0x10')][_0xcf22('0x11')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x22b00e,_0xcf22('0x12'));_0x5133a7(_0x1108b9[_0xcf22('0x13')][_0xcf22('0x11')]);}})[_0xcf22('0x14')](function(_0x1a5d92){logger['error'](_0xcf22('0xc'),_0x22b00e,_0x1a5d92);_0x5b6fc6(_0x1a5d92);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 8ed9842..f8d95ea 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 _0xc370=['addAgents','put','delete','destroy','removeAgents','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get','/describe','/:id','/:id/users','getAgents','post','create'];(function(_0x119e2e,_0x4c2335){var _0x192ca9=function(_0x5d17e6){while(--_0x5d17e6){_0x119e2e['push'](_0x119e2e['shift']());}};_0x192ca9(++_0x4c2335);}(_0xc370,0x13a));var _0x0c37=function(_0x654593,_0xddc7d8){_0x654593=_0x654593-0x0;var _0x5f14b2=_0xc370[_0x654593];return _0x5f14b2;};'use strict';var multer=require('multer');var util=require(_0x0c37('0x0'));var path=require('path');var timeout=require(_0x0c37('0x1'));var express=require(_0x0c37('0x2'));var router=express[_0x0c37('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0c37('0x4'));var config=require(_0x0c37('0x5'));var controller=require(_0x0c37('0x6'));router['get']('/',auth[_0x0c37('0x7')](),controller[_0x0c37('0x8')]);router[_0x0c37('0x9')](_0x0c37('0xa'),auth[_0x0c37('0x7')](),controller['describe']);router[_0x0c37('0x9')](_0x0c37('0xb'),auth[_0x0c37('0x7')](),controller['show']);router['get'](_0x0c37('0xc'),auth[_0x0c37('0x7')](),controller[_0x0c37('0xd')]);router[_0x0c37('0xe')]('/',auth[_0x0c37('0x7')](),controller[_0x0c37('0xf')]);router['post'](_0x0c37('0xc'),auth[_0x0c37('0x7')](),controller[_0x0c37('0x10')]);router[_0x0c37('0x11')](_0x0c37('0xb'),auth[_0x0c37('0x7')](),controller['update']);router[_0x0c37('0x12')](_0x0c37('0xb'),auth[_0x0c37('0x7')](),controller[_0x0c37('0x13')]);router[_0x0c37('0x12')](_0x0c37('0xc'),auth[_0x0c37('0x7')](),controller[_0x0c37('0x14')]);module[_0x0c37('0x15')]=router; \ No newline at end of file +var _0x7217=['exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','describe','/:id','show','getAgents','post','create','/:id/users','addAgents','put','update','destroy','delete','removeAgents'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x7217,0xa9));var _0x7721=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x7217[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7721('0x0'));var timeout=require('connect-timeout');var express=require(_0x7721('0x1'));var router=express[_0x7721('0x2')]();var auth=require(_0x7721('0x3'));var interaction=require(_0x7721('0x4'));var config=require(_0x7721('0x5'));var controller=require(_0x7721('0x6'));router[_0x7721('0x7')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0x9')]);router[_0x7721('0x7')]('/describe',auth[_0x7721('0x8')](),controller[_0x7721('0xa')]);router[_0x7721('0x7')](_0x7721('0xb'),auth['isAuthenticated'](),controller[_0x7721('0xc')]);router[_0x7721('0x7')]('/:id/users',auth[_0x7721('0x8')](),controller[_0x7721('0xd')]);router[_0x7721('0xe')]('/',auth['isAuthenticated'](),controller[_0x7721('0xf')]);router[_0x7721('0xe')](_0x7721('0x10'),auth['isAuthenticated'](),controller[_0x7721('0x11')]);router[_0x7721('0x12')]('/:id',auth[_0x7721('0x8')](),controller[_0x7721('0x13')]);router['delete'](_0x7721('0xb'),auth[_0x7721('0x8')](),controller[_0x7721('0x14')]);router[_0x7721('0x15')](_0x7721('0x10'),auth['isAuthenticated'](),controller[_0x7721('0x16')]);module[_0x7721('0x17')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 1aac905..69a1f87 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 _0xed48=['sequelize','STRING','name','VIRTUAL','system-','getDataValue'];(function(_0x31592c,_0xcc1f3c){var _0x5df9e0=function(_0xde95a6){while(--_0xde95a6){_0x31592c['push'](_0x31592c['shift']());}};_0x5df9e0(++_0xcc1f3c);}(_0xed48,0x1f2));var _0x8ed4=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0xed48[_0x126fb9];return _0xc8a3b1;};'use strict';var Sequelize=require(_0x8ed4('0x0'));module['exports']={'name':{'type':Sequelize[_0x8ed4('0x1')],'allowNull':![],'unique':_0x8ed4('0x2')},'prefix':{'type':Sequelize[_0x8ed4('0x3')],'get':function(_0x2bf80d){return _0x8ed4('0x4')+this[_0x8ed4('0x5')]('name')+'-';}},'description':{'type':Sequelize[_0x8ed4('0x1')]},'callerIdAll':{'type':Sequelize[_0x8ed4('0x1')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xce5c=['getDataValue','INTEGER','sequelize','exports','STRING','name','VIRTUAL'];(function(_0x394862,_0x17c8cf){var _0x46ec78=function(_0x2e1d78){while(--_0x2e1d78){_0x394862['push'](_0x394862['shift']());}};_0x46ec78(++_0x17c8cf);}(_0xce5c,0xaa));var _0xcce5=function(_0x251e8c,_0x277c33){_0x251e8c=_0x251e8c-0x0;var _0x1e0c1d=_0xce5c[_0x251e8c];return _0x1e0c1d;};'use strict';var Sequelize=require(_0xcce5('0x0'));module[_0xcce5('0x1')]={'name':{'type':Sequelize[_0xcce5('0x2')],'allowNull':![],'unique':_0xcce5('0x3')},'prefix':{'type':Sequelize[_0xcce5('0x4')],'get':function(_0x2eb850){return'system-'+this[_0xcce5('0x5')](_0xcce5('0x3'))+'-';}},'description':{'type':Sequelize[_0xcce5('0x2')]},'callerIdAll':{'type':Sequelize[_0xcce5('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xcce5('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 4ea7833..4f77ccd 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 _0xe14b=['push','Set','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','transaction','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','User','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/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','end','json','count','offset','limit','status','set','apply','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','VoicePrefix','rawAttributes','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','catch','params','fields','length','find','describe','create','sequelize','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed'];(function(_0xd24f1c,_0x23e5e1){var _0x1d6268=function(_0x413a94){while(--_0x413a94){_0xd24f1c['push'](_0xd24f1c['shift']());}};_0x1d6268(++_0x23e5e1);}(_0xe14b,0x93));var _0xbe14=function(_0x570418,_0xf6e1eb){_0x570418=_0x570418-0x0;var _0x142743=_0xe14b[_0x570418];return _0x142743;};'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 hardwareService=require('../../config/license/hardware');var logger=require(_0xbe14('0x10'))(_0xbe14('0x11'));var utils=require('../../config/utils');var config=require(_0xbe14('0x12'));var db=require(_0xbe14('0x13'))['db'];config[_0xbe14('0x14')]=_[_0xbe14('0x15')](config[_0xbe14('0x14')],{'host':_0xbe14('0x16'),'port':0x18eb});var socket=require(_0xbe14('0x17'))(new Redis(config[_0xbe14('0x14')]));require(_0xbe14('0x18'))[_0xbe14('0x19')](socket);function respondWithStatusCode(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xcc;return function(_0x813399){if(_0x813399){return _0x1e4826['sendStatus'](_0x33fd54);}return _0x1e4826['status'](_0x33fd54)[_0xbe14('0x1a')]();};}function respondWithResult(_0x3dc4a9,_0xf4ac9){_0xf4ac9=_0xf4ac9||0xc8;return function(_0x37ce4e){if(_0x37ce4e){return _0x3dc4a9['status'](_0xf4ac9)[_0xbe14('0x1b')](_0x37ce4e);}};}function respondWithFilteredResult(_0xe9c3ec,_0xfd7b8f){return function(_0x123ede){if(_0x123ede){var _0x38f1ea=_0x123ede[_0xbe14('0x1c')],_0x29ab73=_0xfd7b8f[_0xbe14('0x1d')],_0x17ae86=_0xfd7b8f[_0xbe14('0x1d')]+_0xfd7b8f[_0xbe14('0x1e')],_0x5ea1f8;if(_0x17ae86>=_0x38f1ea){_0x17ae86=_0x38f1ea;_0x5ea1f8=0xc8;}else{_0x5ea1f8=0xce;}_0xe9c3ec[_0xbe14('0x1f')](_0x5ea1f8);return _0xe9c3ec[_0xbe14('0x20')]('Content-Range',_0x29ab73+'-'+_0x17ae86+'/'+_0x38f1ea)[_0xbe14('0x1b')](_0x123ede);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x21')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x22')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x23')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x24')](function(){var _0x4851f8=_0x2da350[_0xbe14('0x25')]({'plain':!![]});var _0x5fa043=_0xbe14('0x26');return db[_0xbe14('0x27')][_0xbe14('0x28')]({'where':{'type':_0x5fa043,'resourceId':_0x4851f8['id']}})[_0xbe14('0x24')](function(){return _0x2da350;});})['then'](function(){_0x3d3608[_0xbe14('0x1f')](0xcc)[_0xbe14('0x1a')]();});}};}function handleEntityNotFound(_0x391556,_0x169369){return function(_0x5dd475){if(!_0x5dd475){_0x391556[_0xbe14('0x29')](0x194);}return _0x5dd475;};}function handleError(_0x29fc64,_0x59bf34){_0x59bf34=_0x59bf34||0x1f4;return function(_0x3c3613){logger[_0xbe14('0x2a')](_0x3c3613[_0xbe14('0x2b')]);if(_0x3c3613[_0xbe14('0x2c')]){delete _0x3c3613[_0xbe14('0x2c')];}_0x29fc64[_0xbe14('0x1f')](_0x59bf34)[_0xbe14('0x2d')](_0x3c3613);};}exports[_0xbe14('0x2e')]=function(_0x4168c8,_0x16a159){var _0x40538f={},_0x3bf43c={},_0x39dc0a={'count':0x0,'rows':[]};var _0x10ae36=db[_0xbe14('0x2f')][_0xbe14('0x30')];_0x3bf43c[_0xbe14('0x31')]=_[_0xbe14('0x32')](_0x10ae36);_0x3bf43c[_0xbe14('0x33')]=_[_0xbe14('0x32')](_0x4168c8['query']);_0x3bf43c[_0xbe14('0x34')]=_['intersection'](_0x3bf43c['model'],_0x3bf43c[_0xbe14('0x33')]);_0x40538f['attributes']=_[_0xbe14('0x35')](_0x3bf43c[_0xbe14('0x31')],qs['fields'](_0x4168c8['query']['fields']));_0x40538f[_0xbe14('0x36')]=_0x40538f[_0xbe14('0x36')]['length']?_0x40538f[_0xbe14('0x36')]:_0x3bf43c[_0xbe14('0x31')];if(!_0x4168c8[_0xbe14('0x33')][_0xbe14('0x37')](_0xbe14('0x38'))){_0x40538f['limit']=qs['limit'](_0x4168c8[_0xbe14('0x33')]['limit']);_0x40538f['offset']=qs['offset'](_0x4168c8[_0xbe14('0x33')][_0xbe14('0x1d')]);}_0x40538f[_0xbe14('0x39')]=qs[_0xbe14('0x3a')](_0x4168c8[_0xbe14('0x33')][_0xbe14('0x3a')]);_0x40538f[_0xbe14('0x3b')]=qs[_0xbe14('0x34')](_[_0xbe14('0x3c')](_0x4168c8[_0xbe14('0x33')],_0x3bf43c[_0xbe14('0x34')]));if(_0x4168c8[_0xbe14('0x33')]['filter']){_0x40538f['where']=_[_0xbe14('0x3d')](_0x40538f[_0xbe14('0x3b')],{'$or':_[_0xbe14('0x3e')](_0x10ae36,function(_0x520e09){if(_0x520e09[_0xbe14('0x3f')][_0xbe14('0x40')]!==_0xbe14('0x41')){var _0x45ff31={};_0x45ff31[_0x520e09[_0xbe14('0x42')]]={'$like':'%'+_0x4168c8[_0xbe14('0x33')][_0xbe14('0x43')]+'%'};return _0x45ff31;}})});}_0x40538f=_[_0xbe14('0x3d')]({},_0x40538f,_0x4168c8[_0xbe14('0x44')]);var _0x5255ff={'where':_0x40538f[_0xbe14('0x3b')]};return db[_0xbe14('0x2f')][_0xbe14('0x1c')](_0x5255ff)[_0xbe14('0x24')](function(_0x3287b9){_0x39dc0a[_0xbe14('0x1c')]=_0x3287b9;if(_0x4168c8['query'][_0xbe14('0x45')]){_0x40538f[_0xbe14('0x46')]=[{'all':!![]}];}return db[_0xbe14('0x2f')][_0xbe14('0x47')](_0x40538f);})['then'](function(_0x4bfa96){_0x39dc0a[_0xbe14('0x48')]=_0x4bfa96;return _0x39dc0a;})[_0xbe14('0x24')](respondWithFilteredResult(_0x16a159,_0x40538f))[_0xbe14('0x49')](handleError(_0x16a159,null));};exports['show']=function(_0x5d5318,_0x6b6aa8){var _0x59ae4d={'raw':![],'where':{'id':_0x5d5318[_0xbe14('0x4a')]['id']}},_0x5657fe={};_0x5657fe[_0xbe14('0x31')]=_[_0xbe14('0x32')](db['VoicePrefix']['rawAttributes']);_0x5657fe['query']=_[_0xbe14('0x32')](_0x5d5318[_0xbe14('0x33')]);_0x5657fe[_0xbe14('0x34')]=_['intersection'](_0x5657fe[_0xbe14('0x31')],_0x5657fe[_0xbe14('0x33')]);_0x59ae4d[_0xbe14('0x36')]=_[_0xbe14('0x35')](_0x5657fe['model'],qs['fields'](_0x5d5318[_0xbe14('0x33')][_0xbe14('0x4b')]));_0x59ae4d[_0xbe14('0x36')]=_0x59ae4d[_0xbe14('0x36')][_0xbe14('0x4c')]?_0x59ae4d['attributes']:_0x5657fe['model'];if(_0x5d5318[_0xbe14('0x33')][_0xbe14('0x45')]){_0x59ae4d[_0xbe14('0x46')]=[{'all':!![]}];}_0x59ae4d=_[_0xbe14('0x3d')]({},_0x59ae4d,_0x5d5318['options']);return db[_0xbe14('0x2f')][_0xbe14('0x4d')](_0x59ae4d)['then'](handleEntityNotFound(_0x6b6aa8,null))[_0xbe14('0x24')](respondWithResult(_0x6b6aa8,null))[_0xbe14('0x49')](handleError(_0x6b6aa8,null));};exports[_0xbe14('0x28')]=function(_0x36c20c,_0x589dac){return db['VoicePrefix'][_0xbe14('0x4d')]({'where':{'id':_0x36c20c[_0xbe14('0x4a')]['id']}})['then'](handleEntityNotFound(_0x589dac,null))['then'](removeEntity(_0x589dac,null))[_0xbe14('0x49')](handleError(_0x589dac,null));};exports[_0xbe14('0x4e')]=function(_0x3f7f5b,_0x1a8a3d){return db[_0xbe14('0x2f')][_0xbe14('0x4e')]()[_0xbe14('0x24')](respondWithResult(_0x1a8a3d,null))['catch'](handleError(_0x1a8a3d,null));};exports[_0xbe14('0x4f')]=function(_0x5f22b2,_0x6928f2){var _0x22b1f8;return db[_0xbe14('0x50')]['transaction'](function(_0x3a221b){return db[_0xbe14('0x2f')][_0xbe14('0x4f')](_0x5f22b2[_0xbe14('0x51')],{'transaction':_0x3a221b})[_0xbe14('0x24')](function(_0x2dbeb1){_0x22b1f8=_0x2dbeb1['get']({'plain':!![]});return db['VoiceExtension'][_0xbe14('0x4d')]({'where':{'id':_0x22b1f8[_0xbe14('0x52')]},'raw':!![]})[_0xbe14('0x24')](function(_0x48554a){return createVoicePrefixExtensions(_0x22b1f8,_0x48554a,_0x3a221b);});});})['then'](function(){var _0x44fe0d=_0x5f22b2[_0xbe14('0x53')]['get']({'plain':!![]});if(!_0x44fe0d)throw new Error(_0xbe14('0x54'));if(_0x44fe0d[_0xbe14('0x55')]==='user'){var _0x28f995=_0x22b1f8;return db['UserProfileSection'][_0xbe14('0x4d')]({'where':{'name':_0xbe14('0x26'),'userProfileId':_0x44fe0d[_0xbe14('0x56')]},'raw':!![]})['then'](function(_0x435c8d){if(_0x435c8d&&_0x435c8d[_0xbe14('0x57')]===0x0){return db['UserProfileResource'][_0xbe14('0x4f')]({'name':_0x28f995[_0xbe14('0x2c')],'resourceId':_0x28f995['id'],'type':_0x435c8d[_0xbe14('0x2c')],'sectionId':_0x435c8d['id']},{})[_0xbe14('0x24')](function(){return _0x22b1f8;});}else{return _0x22b1f8;}})[_0xbe14('0x49')](function(_0x4f06a3){logger[_0xbe14('0x2a')](_0xbe14('0x58'),_0x4f06a3);throw _0x4f06a3;});}return _0x22b1f8;})[_0xbe14('0x24')](respondWithResult(_0x6928f2,null))[_0xbe14('0x49')](handleError(_0x6928f2,null));};function Extension(_0x32968f,_0x44084c,_0x1dd6c7,_0x56ab61){this[_0xbe14('0x59')]=_0xbe14('0x5a');this[_0xbe14('0x5b')]=_0x32968f;this[_0xbe14('0x5c')]=_0x1dd6c7;this[_0xbe14('0x3f')]=_0xbe14('0x5d');this[_0xbe14('0x5e')]=_0xbe14('0x5f');this[_0xbe14('0x60')]=_0x44084c;this[_0xbe14('0x61')]=_0x56ab61;}function createVoicePrefixExtensions(_0x358950,_0x4bccfc,_0x56bcd3){return new BPromise(function(_0x58dd79,_0x10c0bc){var _0x1bfcbf=new Extension(formatPrefixName(_0x358950[_0xbe14('0x62')]),0x1,_0xbe14('0x63'),_0xbe14('0x64'));_0x1bfcbf[_0xbe14('0x65')]=_0x358950['id'];return db[_0xbe14('0x66')][_0xbe14('0x4f')](_0x1bfcbf,{'transaction':_0x56bcd3})[_0xbe14('0x24')](function(_0x451b0b){var _0x603816=_0x451b0b[_0xbe14('0x25')]({'plain':!![]});var _0x2088e4=_[_0xbe14('0x3e')](addVoicePrefixExtensions(_0x358950,_0x4bccfc),function(_0x1c831a){_0x1c831a[_0xbe14('0x52')]=_0x603816['id'];_0x1c831a[_0xbe14('0x65')]=_0x358950['id'];return _0x1c831a;});return db[_0xbe14('0x66')][_0xbe14('0x67')](_0x2088e4,{'transaction':_0x56bcd3})[_0xbe14('0x24')](function(_0x5f394c){if(!_0x5f394c){return _0x10c0bc(_0xbe14('0x68'));}else{return _0x58dd79(_0x5f394c);}})[_0xbe14('0x49')](function(_0x2c426d){return _0x10c0bc(_0x2c426d);});});;});};function addVoicePrefixExtensions(_0x46b49c,_0x3ee6b7){var _0x222944=[];var _0x198b55=formatPrefixName(_0x46b49c[_0xbe14('0x62')]);_0x222944[_0xbe14('0x69')](new Extension(_0x198b55,0x2,_0xbe14('0x6a'),'CDR(prefix)='+_0x46b49c[_0xbe14('0x2c')]));if(_0x46b49c[_0xbe14('0x6b')]){_0x222944[_0xbe14('0x69')](new Extension(_0x198b55,0x3,_0xbe14('0x6a'),_0xbe14('0x6c')+_0x46b49c['callerIdAll']));}else{_0x222944[_0xbe14('0x69')](new Extension(_0x198b55,0x3,_0xbe14('0x63'),_0xbe14('0x6d')));}_0x222944[_0xbe14('0x69')](new Extension(_0x198b55,0x4,_0xbe14('0x6e'),_0x3ee6b7['context']+','+_0xbe14('0x6f')+(0x8+_0x46b49c[_0xbe14('0x2c')][_0xbe14('0x4c')])+'}'+','+0x1));return _0x222944;}function formatPrefixName(_0x29bb26){var _0xaebce8='_';for(var _0x289c4d=0x0;_0x289c4d<_0x29bb26[_0xbe14('0x4c')];_0x289c4d++){if(_0x29bb26[_0xbe14('0x70')](_0x289c4d)=='-'){_0xaebce8+=_0x29bb26['charAt'](_0x289c4d);}else{_0xaebce8+='['+_0x29bb26[_0xbe14('0x70')](_0x289c4d)+']';}}_0xaebce8+='.';return _0xaebce8;}exports[_0xbe14('0x23')]=function(_0x2fdf5d,_0x20b12e,_0x5982b7){var _0xa4b2a3=_0x2fdf5d[_0xbe14('0x51')];_0xa4b2a3['prefix']='system-'+_0xa4b2a3[_0xbe14('0x2c')]+'-';return db[_0xbe14('0x50')][_0xbe14('0x71')](function(_0x2510a0){return db[_0xbe14('0x2f')][_0xbe14('0x23')](_0xa4b2a3,{'where':{'id':_0xa4b2a3['id']},'transaction':_0x2510a0})[_0xbe14('0x24')](function(){return db[_0xbe14('0x66')]['destroy']({'where':{'VoicePrefixId':_0xa4b2a3['id']},'transaction':_0x2510a0})['then'](function(){return db[_0xbe14('0x66')][_0xbe14('0x4d')]({'where':{'id':_0xa4b2a3[_0xbe14('0x52')]},'raw':!![]})['then'](function(_0x76e91e){return createVoicePrefixExtensions(_0xa4b2a3,_0x76e91e,_0x2510a0);});});});})[_0xbe14('0x24')](function(){return db[_0xbe14('0x2f')][_0xbe14('0x72')](_0xa4b2a3['id']);})[_0xbe14('0x24')](respondWithResult(_0x20b12e,null))[_0xbe14('0x49')](handleError(_0x20b12e,null));};exports[_0xbe14('0x73')]=function(_0x5b5c37,_0x43b817,_0x3b6ef5){return db[_0xbe14('0x2f')][_0xbe14('0x4d')]({'where':{'id':_0x5b5c37[_0xbe14('0x4a')]['id']}})[_0xbe14('0x24')](handleEntityNotFound(_0x43b817,null))[_0xbe14('0x24')](function(_0x4a20c0){if(_0x4a20c0){return _0x4a20c0[_0xbe14('0x73')](_0x5b5c37[_0xbe14('0x51')][_0xbe14('0x74')],_[_0xbe14('0x75')](_0x5b5c37[_0xbe14('0x51')],[_0xbe14('0x74'),'id'])||{})[_0xbe14('0x76')](function(_0xd756b2){for(var _0x5d064e=0x0;_0x5d064e<_0x5b5c37[_0xbe14('0x51')][_0xbe14('0x74')][_0xbe14('0x4c')];_0x5d064e+=0x1){socket[_0xbe14('0x77')](_0xbe14('0x78'),{'UserId':_0x5b5c37[_0xbe14('0x51')]['ids'][_0x5d064e],'VoicePrefixId':_0x5b5c37[_0xbe14('0x4a')]['id']});}return _0xd756b2;});}})[_0xbe14('0x24')](respondWithResult(_0x43b817,null))[_0xbe14('0x49')](handleError(_0x43b817,null));};exports[_0xbe14('0x79')]=function(_0x508455,_0x7e9e5c,_0x1578b6){return db[_0xbe14('0x2f')][_0xbe14('0x4d')]({'where':{'id':_0x508455[_0xbe14('0x4a')]['id']}})[_0xbe14('0x24')](handleEntityNotFound(_0x7e9e5c,null))[_0xbe14('0x24')](function(_0x55e70f){if(_0x55e70f){return _0x55e70f[_0xbe14('0x79')](_0x508455['query'][_0xbe14('0x74')])['then'](function(){if(_[_0xbe14('0x7a')](_0x508455[_0xbe14('0x33')][_0xbe14('0x74')])){for(var _0x5b7f07=0x0;_0x5b7f07<_0x508455[_0xbe14('0x33')][_0xbe14('0x74')][_0xbe14('0x4c')];_0x5b7f07+=0x1){socket['emit'](_0xbe14('0x7b'),{'UserId':Number(_0x508455[_0xbe14('0x33')][_0xbe14('0x74')][_0x5b7f07]),'VoicePrefixId':Number(_0x508455[_0xbe14('0x4a')]['id'])});}}else{socket['emit'](_0xbe14('0x7b'),{'UserId':Number(_0x508455[_0xbe14('0x33')][_0xbe14('0x74')]),'VoicePrefixId':Number(_0x508455[_0xbe14('0x4a')]['id'])});}});}})[_0xbe14('0x24')](respondWithStatusCode(_0x7e9e5c,null))[_0xbe14('0x49')](handleError(_0x7e9e5c,null));};exports[_0xbe14('0x7c')]=function(_0x5ab298,_0x2ff94c,_0x123f4f){var _0x2137d5={};var _0x5c89a0={};var _0x704c05;var _0x420467;return db[_0xbe14('0x2f')]['findOne']({'where':{'id':_0x5ab298[_0xbe14('0x4a')]['id']}})[_0xbe14('0x24')](handleEntityNotFound(_0x2ff94c,null))['then'](function(_0x2be969){if(_0x2be969){_0x704c05=_0x2be969;_0x5c89a0['model']=_[_0xbe14('0x32')](db[_0xbe14('0x7d')]['rawAttributes']);_0x5c89a0['query']=_[_0xbe14('0x32')](_0x5ab298[_0xbe14('0x33')]);_0x5c89a0[_0xbe14('0x34')]=_['intersection'](_0x5c89a0[_0xbe14('0x31')],_0x5c89a0[_0xbe14('0x33')]);_0x2137d5[_0xbe14('0x36')]=_[_0xbe14('0x35')](_0x5c89a0['model'],qs['fields'](_0x5ab298[_0xbe14('0x33')][_0xbe14('0x4b')]));_0x2137d5[_0xbe14('0x36')]=_0x2137d5[_0xbe14('0x36')][_0xbe14('0x4c')]?_0x2137d5[_0xbe14('0x36')]:_0x5c89a0[_0xbe14('0x31')];_0x2137d5['order']=qs[_0xbe14('0x3a')](_0x5ab298['query'][_0xbe14('0x3a')]);_0x2137d5[_0xbe14('0x3b')]=qs[_0xbe14('0x34')](_[_0xbe14('0x3c')](_0x5ab298['query'],_0x5c89a0[_0xbe14('0x34')]));if(_0x5ab298[_0xbe14('0x33')][_0xbe14('0x43')]){_0x2137d5['where']=_[_0xbe14('0x3d')](_0x2137d5[_0xbe14('0x3b')],{'$or':_[_0xbe14('0x3e')](_0x2137d5[_0xbe14('0x36')],function(_0x26d3ae){var _0x13836b={};_0x13836b[_0x26d3ae]={'$like':'%'+_0x5ab298[_0xbe14('0x33')][_0xbe14('0x43')]+'%'};return _0x13836b;})});}_0x2137d5=_[_0xbe14('0x3d')]({},_0x2137d5,_0x5ab298[_0xbe14('0x44')]);return _0x704c05[_0xbe14('0x7c')](_0x2137d5);}})[_0xbe14('0x24')](function(_0x5af56){if(_0x5af56){_0x420467=_0x5af56[_0xbe14('0x4c')];if(!_0x5ab298[_0xbe14('0x33')][_0xbe14('0x37')](_0xbe14('0x38'))){_0x2137d5[_0xbe14('0x1e')]=qs[_0xbe14('0x1e')](_0x5ab298[_0xbe14('0x33')]['limit']);_0x2137d5[_0xbe14('0x1d')]=qs['offset'](_0x5ab298[_0xbe14('0x33')][_0xbe14('0x1d')]);}return _0x704c05[_0xbe14('0x7c')](_0x2137d5);}})[_0xbe14('0x24')](function(_0x1d7b08){if(_0x1d7b08){return _0x1d7b08?{'count':_0x420467,'rows':_0x1d7b08}:null;}})['then'](respondWithResult(_0x2ff94c,null))['catch'](handleError(_0x2ff94c,null));}; \ No newline at end of file +var _0x5fc3=['create','sequelize','transaction','body','find','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','context','charAt','VoiceExtension','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','length','userVoicePrefix:remove','getAgents','findOne','User','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','localhost','./voicePrefix.socket','register','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','sendStatus','error','stack','name','send','index','VoicePrefix','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','map','type','key','field','filter','options','includeAll','include','findAll','rows','catch','show','params','describe'];(function(_0x4eff20,_0x181984){var _0x786987=function(_0x2aebcf){while(--_0x2aebcf){_0x4eff20['push'](_0x4eff20['shift']());}};_0x786987(++_0x181984);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3b7b8a,_0x52c3b0){_0x3b7b8a=_0x3b7b8a-0x0;var _0x441206=_0x5fc3[_0x3b7b8a];return _0x441206;};'use strict';var pdf=require(_0x35fc('0x0'));var emlformat=require(_0x35fc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x35fc('0x2'));var jsonpatch=require(_0x35fc('0x3'));var rp=require(_0x35fc('0x4'));var moment=require(_0x35fc('0x5'));var BPromise=require(_0x35fc('0x6'));var Mustache=require('mustache');var util=require(_0x35fc('0x7'));var path=require(_0x35fc('0x8'));var sox=require(_0x35fc('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0xe'));var querystring=require(_0x35fc('0xf'));var Papa=require(_0x35fc('0x10'));var Redis=require(_0x35fc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x12'));var hardwareService=require(_0x35fc('0x13'));var logger=require('../../config/logger')(_0x35fc('0x14'));var utils=require(_0x35fc('0x15'));var config=require('../../config/environment');var db=require(_0x35fc('0x16'))['db'];config[_0x35fc('0x17')]=_['defaults'](config['redis'],{'host':_0x35fc('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x35fc('0x17')]));require(_0x35fc('0x19'))[_0x35fc('0x1a')](socket);function respondWithStatusCode(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xcc;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['sendStatus'](_0x38d9f2);}return _0x29730f['status'](_0x38d9f2)['end']();};}function respondWithResult(_0x398b67,_0x229d56){_0x229d56=_0x229d56||0xc8;return function(_0x53b898){if(_0x53b898){return _0x398b67[_0x35fc('0x1b')](_0x229d56)[_0x35fc('0x1c')](_0x53b898);}};}function respondWithFilteredResult(_0x1121fa,_0x480851){return function(_0x26ba54){if(_0x26ba54){var _0x45c8b7=_0x26ba54[_0x35fc('0x1d')],_0x553677=_0x480851['offset'],_0x41e165=_0x480851[_0x35fc('0x1e')]+_0x480851[_0x35fc('0x1f')],_0x363e47;if(_0x41e165>=_0x45c8b7){_0x41e165=_0x45c8b7;_0x363e47=0xc8;}else{_0x363e47=0xce;}_0x1121fa[_0x35fc('0x1b')](_0x363e47);return _0x1121fa['set'](_0x35fc('0x20'),_0x553677+'-'+_0x41e165+'/'+_0x45c8b7)[_0x35fc('0x1c')](_0x26ba54);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x21')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x22')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x23')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x24')](_0x2405e8)[_0x35fc('0x25')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x26')]()[_0x35fc('0x25')](function(){var _0x561bf8=_0x55e9e7[_0x35fc('0x27')]({'plain':!![]});var _0x5a93df=_0x35fc('0x28');return db['UserProfileResource'][_0x35fc('0x26')]({'where':{'type':_0x5a93df,'resourceId':_0x561bf8['id']}})['then'](function(){return _0x55e9e7;});})[_0x35fc('0x25')](function(){_0x2d8183[_0x35fc('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519264,_0x47774c){return function(_0x58edb6){if(!_0x58edb6){_0x519264[_0x35fc('0x29')](0x194);}return _0x58edb6;};}function handleError(_0x1a5d92,_0x57001c){_0x57001c=_0x57001c||0x1f4;return function(_0x26b7cb){logger[_0x35fc('0x2a')](_0x26b7cb[_0x35fc('0x2b')]);if(_0x26b7cb[_0x35fc('0x2c')]){delete _0x26b7cb[_0x35fc('0x2c')];}_0x1a5d92[_0x35fc('0x1b')](_0x57001c)[_0x35fc('0x2d')](_0x26b7cb);};}exports[_0x35fc('0x2e')]=function(_0x54aedc,_0x1cd1ae){var _0x220931={},_0x22af18={},_0x52acc5={'count':0x0,'rows':[]};var _0xe79f52=db[_0x35fc('0x2f')][_0x35fc('0x30')];_0x22af18[_0x35fc('0x31')]=_[_0x35fc('0x32')](_0xe79f52);_0x22af18[_0x35fc('0x33')]=_[_0x35fc('0x32')](_0x54aedc[_0x35fc('0x33')]);_0x22af18[_0x35fc('0x34')]=_[_0x35fc('0x35')](_0x22af18['model'],_0x22af18['query']);_0x220931[_0x35fc('0x36')]=_['intersection'](_0x22af18[_0x35fc('0x31')],qs[_0x35fc('0x37')](_0x54aedc[_0x35fc('0x33')][_0x35fc('0x37')]));_0x220931[_0x35fc('0x36')]=_0x220931[_0x35fc('0x36')]['length']?_0x220931[_0x35fc('0x36')]:_0x22af18[_0x35fc('0x31')];if(!_0x54aedc[_0x35fc('0x33')][_0x35fc('0x38')](_0x35fc('0x39'))){_0x220931[_0x35fc('0x1f')]=qs['limit'](_0x54aedc[_0x35fc('0x33')][_0x35fc('0x1f')]);_0x220931[_0x35fc('0x1e')]=qs['offset'](_0x54aedc[_0x35fc('0x33')]['offset']);}_0x220931[_0x35fc('0x3a')]=qs[_0x35fc('0x3b')](_0x54aedc[_0x35fc('0x33')][_0x35fc('0x3b')]);_0x220931['where']=qs['filters'](_['pick'](_0x54aedc[_0x35fc('0x33')],_0x22af18['filters']));if(_0x54aedc[_0x35fc('0x33')]['filter']){_0x220931[_0x35fc('0x3c')]=_[_0x35fc('0x3d')](_0x220931[_0x35fc('0x3c')],{'$or':_[_0x35fc('0x3e')](_0xe79f52,function(_0x1c10e0){if(_0x1c10e0[_0x35fc('0x3f')][_0x35fc('0x40')]!=='VIRTUAL'){var _0x4467f8={};_0x4467f8[_0x1c10e0[_0x35fc('0x41')]]={'$like':'%'+_0x54aedc['query'][_0x35fc('0x42')]+'%'};return _0x4467f8;}})});}_0x220931=_[_0x35fc('0x3d')]({},_0x220931,_0x54aedc[_0x35fc('0x43')]);var _0x1d2ffe={'where':_0x220931[_0x35fc('0x3c')]};return db[_0x35fc('0x2f')]['count'](_0x1d2ffe)[_0x35fc('0x25')](function(_0x267858){_0x52acc5[_0x35fc('0x1d')]=_0x267858;if(_0x54aedc['query'][_0x35fc('0x44')]){_0x220931[_0x35fc('0x45')]=[{'all':!![]}];}return db['VoicePrefix'][_0x35fc('0x46')](_0x220931);})[_0x35fc('0x25')](function(_0x43b77c){_0x52acc5[_0x35fc('0x47')]=_0x43b77c;return _0x52acc5;})[_0x35fc('0x25')](respondWithFilteredResult(_0x1cd1ae,_0x220931))[_0x35fc('0x48')](handleError(_0x1cd1ae,null));};exports[_0x35fc('0x49')]=function(_0x3ec51f,_0x5a7e9e){var _0x596e83={'raw':![],'where':{'id':_0x3ec51f[_0x35fc('0x4a')]['id']}},_0x210d5d={};_0x210d5d['model']=_['keys'](db['VoicePrefix'][_0x35fc('0x30')]);_0x210d5d[_0x35fc('0x33')]=_['keys'](_0x3ec51f[_0x35fc('0x33')]);_0x210d5d[_0x35fc('0x34')]=_[_0x35fc('0x35')](_0x210d5d[_0x35fc('0x31')],_0x210d5d['query']);_0x596e83['attributes']=_['intersection'](_0x210d5d['model'],qs['fields'](_0x3ec51f[_0x35fc('0x33')][_0x35fc('0x37')]));_0x596e83['attributes']=_0x596e83[_0x35fc('0x36')]['length']?_0x596e83[_0x35fc('0x36')]:_0x210d5d[_0x35fc('0x31')];if(_0x3ec51f[_0x35fc('0x33')][_0x35fc('0x44')]){_0x596e83[_0x35fc('0x45')]=[{'all':!![]}];}_0x596e83=_['merge']({},_0x596e83,_0x3ec51f[_0x35fc('0x43')]);return db[_0x35fc('0x2f')]['find'](_0x596e83)[_0x35fc('0x25')](handleEntityNotFound(_0x5a7e9e,null))[_0x35fc('0x25')](respondWithResult(_0x5a7e9e,null))[_0x35fc('0x48')](handleError(_0x5a7e9e,null));};exports[_0x35fc('0x26')]=function(_0x5bc8c3,_0x3666a5){return db['VoicePrefix']['find']({'where':{'id':_0x5bc8c3[_0x35fc('0x4a')]['id']}})[_0x35fc('0x25')](handleEntityNotFound(_0x3666a5,null))[_0x35fc('0x25')](removeEntity(_0x3666a5,null))[_0x35fc('0x48')](handleError(_0x3666a5,null));};exports[_0x35fc('0x4b')]=function(_0x302a7b,_0x405320){return db[_0x35fc('0x2f')]['describe']()[_0x35fc('0x25')](respondWithResult(_0x405320,null))[_0x35fc('0x48')](handleError(_0x405320,null));};exports[_0x35fc('0x4c')]=function(_0x40b5c7,_0x2ad481){var _0x1e3221;return db[_0x35fc('0x4d')][_0x35fc('0x4e')](function(_0x35fb53){return db[_0x35fc('0x2f')][_0x35fc('0x4c')](_0x40b5c7[_0x35fc('0x4f')],{'transaction':_0x35fb53})[_0x35fc('0x25')](function(_0x3146e2){_0x1e3221=_0x3146e2['get']({'plain':!![]});return db['VoiceExtension'][_0x35fc('0x50')]({'where':{'id':_0x1e3221[_0x35fc('0x51')]},'raw':!![]})[_0x35fc('0x25')](function(_0x2bf0b0){return createVoicePrefixExtensions(_0x1e3221,_0x2bf0b0,_0x35fb53);});});})[_0x35fc('0x25')](function(){var _0x3e6494=_0x40b5c7['user']['get']({'plain':!![]});if(!_0x3e6494)throw new Error(_0x35fc('0x52'));if(_0x3e6494[_0x35fc('0x53')]===_0x35fc('0x54')){var _0x38bc78=_0x1e3221;return db['UserProfileSection'][_0x35fc('0x50')]({'where':{'name':_0x35fc('0x28'),'userProfileId':_0x3e6494['userProfileId']},'raw':!![]})[_0x35fc('0x25')](function(_0x2536d3){if(_0x2536d3&&_0x2536d3['autoAssociation']===0x0){return db[_0x35fc('0x55')][_0x35fc('0x4c')]({'name':_0x38bc78[_0x35fc('0x2c')],'resourceId':_0x38bc78['id'],'type':_0x2536d3[_0x35fc('0x2c')],'sectionId':_0x2536d3['id']},{})['then'](function(){return _0x1e3221;});}else{return _0x1e3221;}})['catch'](function(_0x502a15){logger[_0x35fc('0x2a')](_0x35fc('0x56'),_0x502a15);throw _0x502a15;});}return _0x1e3221;})['then'](respondWithResult(_0x2ad481,null))[_0x35fc('0x48')](handleError(_0x2ad481,null));};function Extension(_0x1f89b3,_0x381640,_0x145854,_0x46c59b){this['context']=_0x35fc('0x57');this[_0x35fc('0x58')]=_0x1f89b3;this[_0x35fc('0x59')]=_0x145854;this['type']=_0x35fc('0x5a');this[_0x35fc('0x5b')]='Voice\x20Prefix\x20Extension';this[_0x35fc('0x5c')]=_0x381640;this[_0x35fc('0x5d')]=_0x46c59b;}function createVoicePrefixExtensions(_0x1c46b1,_0x1c4c33,_0x314666){return new BPromise(function(_0x41453b,_0x8501d1){var _0x998fd9=new Extension(formatPrefixName(_0x1c46b1['prefix']),0x1,_0x35fc('0x5e'),_0x35fc('0x5f'));_0x998fd9[_0x35fc('0x60')]=_0x1c46b1['id'];return db['VoiceExtension'][_0x35fc('0x4c')](_0x998fd9,{'transaction':_0x314666})['then'](function(_0x4ceacc){var _0x5d4a39=_0x4ceacc[_0x35fc('0x27')]({'plain':!![]});var _0xb1c68a=_[_0x35fc('0x3e')](addVoicePrefixExtensions(_0x1c46b1,_0x1c4c33),function(_0x13901c){_0x13901c[_0x35fc('0x51')]=_0x5d4a39['id'];_0x13901c['VoicePrefixId']=_0x1c46b1['id'];return _0x13901c;});return db['VoiceExtension']['bulkCreate'](_0xb1c68a,{'transaction':_0x314666})['then'](function(_0x51d231){if(!_0x51d231){return _0x8501d1(_0x35fc('0x61'));}else{return _0x41453b(_0x51d231);}})[_0x35fc('0x48')](function(_0xd470e8){return _0x8501d1(_0xd470e8);});});;});};function addVoicePrefixExtensions(_0x3ef680,_0x511e8b){var _0x458eb8=[];var _0x20b042=formatPrefixName(_0x3ef680[_0x35fc('0x62')]);_0x458eb8[_0x35fc('0x63')](new Extension(_0x20b042,0x2,_0x35fc('0x64'),_0x35fc('0x65')+_0x3ef680[_0x35fc('0x2c')]));if(_0x3ef680[_0x35fc('0x66')]){_0x458eb8[_0x35fc('0x63')](new Extension(_0x20b042,0x3,'Set',_0x35fc('0x67')+_0x3ef680['callerIdAll']));}else{_0x458eb8[_0x35fc('0x63')](new Extension(_0x20b042,0x3,_0x35fc('0x5e'),_0x35fc('0x68')));}_0x458eb8[_0x35fc('0x63')](new Extension(_0x20b042,0x4,'goto',_0x511e8b[_0x35fc('0x69')]+','+'${EXTEN:'+(0x8+_0x3ef680['name']['length'])+'}'+','+0x1));return _0x458eb8;}function formatPrefixName(_0x10dd1a){var _0x5dfeb7='_';for(var _0x3c9027=0x0;_0x3c9027<_0x10dd1a['length'];_0x3c9027++){if(_0x10dd1a[_0x35fc('0x6a')](_0x3c9027)=='-'){_0x5dfeb7+=_0x10dd1a['charAt'](_0x3c9027);}else{_0x5dfeb7+='['+_0x10dd1a[_0x35fc('0x6a')](_0x3c9027)+']';}}_0x5dfeb7+='.';return _0x5dfeb7;}exports[_0x35fc('0x24')]=function(_0x3400f0,_0x1d81a5,_0x5c2ec0){var _0x3d0ecc=_0x3400f0[_0x35fc('0x4f')];_0x3d0ecc[_0x35fc('0x62')]='system-'+_0x3d0ecc[_0x35fc('0x2c')]+'-';return db[_0x35fc('0x4d')][_0x35fc('0x4e')](function(_0x3c1b56){return db[_0x35fc('0x2f')][_0x35fc('0x24')](_0x3d0ecc,{'where':{'id':_0x3d0ecc['id']},'transaction':_0x3c1b56})[_0x35fc('0x25')](function(){return db[_0x35fc('0x6b')]['destroy']({'where':{'VoicePrefixId':_0x3d0ecc['id']},'transaction':_0x3c1b56})[_0x35fc('0x25')](function(){return db[_0x35fc('0x6b')][_0x35fc('0x50')]({'where':{'id':_0x3d0ecc['VoiceExtensionId']},'raw':!![]})[_0x35fc('0x25')](function(_0x1b76f0){return createVoicePrefixExtensions(_0x3d0ecc,_0x1b76f0,_0x3c1b56);});});});})['then'](function(){return db['VoicePrefix'][_0x35fc('0x6c')](_0x3d0ecc['id']);})['then'](respondWithResult(_0x1d81a5,null))[_0x35fc('0x48')](handleError(_0x1d81a5,null));};exports[_0x35fc('0x6d')]=function(_0x43638e,_0x10952a,_0x1932c9){return db[_0x35fc('0x2f')][_0x35fc('0x50')]({'where':{'id':_0x43638e[_0x35fc('0x4a')]['id']}})[_0x35fc('0x25')](handleEntityNotFound(_0x10952a,null))[_0x35fc('0x25')](function(_0x65ee1b){if(_0x65ee1b){return _0x65ee1b[_0x35fc('0x6d')](_0x43638e[_0x35fc('0x4f')][_0x35fc('0x6e')],_[_0x35fc('0x6f')](_0x43638e[_0x35fc('0x4f')],[_0x35fc('0x6e'),'id'])||{})[_0x35fc('0x70')](function(_0x3b2160){for(var _0x3f3f36=0x0;_0x3f3f36<_0x43638e['body'][_0x35fc('0x6e')]['length'];_0x3f3f36+=0x1){socket[_0x35fc('0x71')](_0x35fc('0x72'),{'UserId':_0x43638e[_0x35fc('0x4f')][_0x35fc('0x6e')][_0x3f3f36],'VoicePrefixId':_0x43638e[_0x35fc('0x4a')]['id']});}return _0x3b2160;});}})[_0x35fc('0x25')](respondWithResult(_0x10952a,null))[_0x35fc('0x48')](handleError(_0x10952a,null));};exports[_0x35fc('0x73')]=function(_0x2fed7b,_0x2656e5,_0x2ee880){return db['VoicePrefix'][_0x35fc('0x50')]({'where':{'id':_0x2fed7b[_0x35fc('0x4a')]['id']}})[_0x35fc('0x25')](handleEntityNotFound(_0x2656e5,null))[_0x35fc('0x25')](function(_0x3a973d){if(_0x3a973d){return _0x3a973d[_0x35fc('0x73')](_0x2fed7b['query'][_0x35fc('0x6e')])[_0x35fc('0x25')](function(){if(_[_0x35fc('0x74')](_0x2fed7b[_0x35fc('0x33')][_0x35fc('0x6e')])){for(var _0x3e2a8e=0x0;_0x3e2a8e<_0x2fed7b[_0x35fc('0x33')][_0x35fc('0x6e')][_0x35fc('0x75')];_0x3e2a8e+=0x1){socket['emit'](_0x35fc('0x76'),{'UserId':Number(_0x2fed7b['query'][_0x35fc('0x6e')][_0x3e2a8e]),'VoicePrefixId':Number(_0x2fed7b[_0x35fc('0x4a')]['id'])});}}else{socket['emit'](_0x35fc('0x76'),{'UserId':Number(_0x2fed7b[_0x35fc('0x33')][_0x35fc('0x6e')]),'VoicePrefixId':Number(_0x2fed7b[_0x35fc('0x4a')]['id'])});}});}})[_0x35fc('0x25')](respondWithStatusCode(_0x2656e5,null))[_0x35fc('0x48')](handleError(_0x2656e5,null));};exports[_0x35fc('0x77')]=function(_0x452c10,_0x25ee61,_0x5806bf){var _0x4c70e2={};var _0x4e7c7b={};var _0x531117;var _0x160a6f;return db[_0x35fc('0x2f')][_0x35fc('0x78')]({'where':{'id':_0x452c10[_0x35fc('0x4a')]['id']}})[_0x35fc('0x25')](handleEntityNotFound(_0x25ee61,null))['then'](function(_0x226fdf){if(_0x226fdf){_0x531117=_0x226fdf;_0x4e7c7b[_0x35fc('0x31')]=_[_0x35fc('0x32')](db[_0x35fc('0x79')]['rawAttributes']);_0x4e7c7b[_0x35fc('0x33')]=_[_0x35fc('0x32')](_0x452c10[_0x35fc('0x33')]);_0x4e7c7b['filters']=_[_0x35fc('0x35')](_0x4e7c7b[_0x35fc('0x31')],_0x4e7c7b[_0x35fc('0x33')]);_0x4c70e2[_0x35fc('0x36')]=_[_0x35fc('0x35')](_0x4e7c7b[_0x35fc('0x31')],qs[_0x35fc('0x37')](_0x452c10[_0x35fc('0x33')]['fields']));_0x4c70e2[_0x35fc('0x36')]=_0x4c70e2[_0x35fc('0x36')][_0x35fc('0x75')]?_0x4c70e2[_0x35fc('0x36')]:_0x4e7c7b[_0x35fc('0x31')];_0x4c70e2[_0x35fc('0x3a')]=qs['sort'](_0x452c10[_0x35fc('0x33')]['sort']);_0x4c70e2['where']=qs[_0x35fc('0x34')](_['pick'](_0x452c10[_0x35fc('0x33')],_0x4e7c7b[_0x35fc('0x34')]));if(_0x452c10[_0x35fc('0x33')]['filter']){_0x4c70e2[_0x35fc('0x3c')]=_[_0x35fc('0x3d')](_0x4c70e2[_0x35fc('0x3c')],{'$or':_[_0x35fc('0x3e')](_0x4c70e2[_0x35fc('0x36')],function(_0x5abdf9){var _0x5512f6={};_0x5512f6[_0x5abdf9]={'$like':'%'+_0x452c10['query'][_0x35fc('0x42')]+'%'};return _0x5512f6;})});}_0x4c70e2=_['merge']({},_0x4c70e2,_0x452c10[_0x35fc('0x43')]);return _0x531117[_0x35fc('0x77')](_0x4c70e2);}})[_0x35fc('0x25')](function(_0xdce898){if(_0xdce898){_0x160a6f=_0xdce898['length'];if(!_0x452c10[_0x35fc('0x33')][_0x35fc('0x38')](_0x35fc('0x39'))){_0x4c70e2['limit']=qs[_0x35fc('0x1f')](_0x452c10[_0x35fc('0x33')][_0x35fc('0x1f')]);_0x4c70e2['offset']=qs['offset'](_0x452c10['query'][_0x35fc('0x1e')]);}return _0x531117[_0x35fc('0x77')](_0x4c70e2);}})[_0x35fc('0x25')](function(_0x3858a9){if(_0x3858a9){return _0x3858a9?{'count':_0x160a6f,'rows':_0x3858a9}:null;}})['then'](respondWithResult(_0x25ee61,null))[_0x35fc('0x48')](handleError(_0x25ee61,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 4749023..47b339e 100644 --- a/server/api/voicePrefix/voicePrefix.events.js +++ b/server/api/voicePrefix/voicePrefix.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','update','emit'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var VoicePrefix=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){VoicePrefixEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);VoicePrefixEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];VoicePrefix[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0xb10b=['hasOwnProperty','hook','events','VoicePrefix','setMaxListeners','save','remove','emit'];(function(_0x155560,_0x5e326d){var _0x2e1ee9=function(_0x1ce729){while(--_0x1ce729){_0x155560['push'](_0x155560['shift']());}};_0x2e1ee9(++_0x5e326d);}(_0xb10b,0x12a));var _0xbb10=function(_0x25c4f6,_0x1d79a6){_0x25c4f6=_0x25c4f6-0x0;var _0x1279a7=_0xb10b[_0x25c4f6];return _0x1279a7;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0xbb10('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){VoicePrefixEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);VoicePrefixEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];VoicePrefix[_0xbb10('0x7')](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 d0ba0e4..148f170 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 _0xde9b=['VoicePrefix','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./voicePrefix.attributes'];(function(_0x3377b1,_0xad680c){var _0x2eea81=function(_0x35ff9e){while(--_0x35ff9e){_0x3377b1['push'](_0x3377b1['shift']());}};_0x2eea81(++_0xad680c);}(_0xde9b,0x1b9));var _0xbde9=function(_0x3dee92,_0x55e1eb){_0x3dee92=_0x3dee92-0x0;var _0x44d36e=_0xde9b[_0x3dee92];return _0x44d36e;};'use strict';var _=require(_0xbde9('0x0'));var util=require(_0xbde9('0x1'));var logger=require(_0xbde9('0x2'))(_0xbde9('0x3'));var moment=require(_0xbde9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbde9('0x5'));var rimraf=require(_0xbde9('0x6'));var config=require(_0xbde9('0x7'));var attributes=require(_0xbde9('0x8'));module['exports']=function(_0x32464a,_0xfd8a0b){return _0x32464a['define'](_0xbde9('0x9'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfdc1=['define','voice_prefixes','lodash','util','api','bluebird','request-promise','rimraf','exports'];(function(_0x2f085f,_0x4014ae){var _0x424694=function(_0x3480b4){while(--_0x3480b4){_0x2f085f['push'](_0x2f085f['shift']());}};_0x424694(++_0x4014ae);}(_0xfdc1,0x80));var _0x1fdc=function(_0x296923,_0x4adaed){_0x296923=_0x296923-0x0;var _0x29af70=_0xfdc1[_0x296923];return _0x29af70;};'use strict';var _=require(_0x1fdc('0x0'));var util=require(_0x1fdc('0x1'));var logger=require('../../config/logger')(_0x1fdc('0x2'));var moment=require('moment');var BPromise=require(_0x1fdc('0x3'));var rp=require(_0x1fdc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1fdc('0x5'));var config=require('../../config/environment');var attributes=require('./voicePrefix.attributes');module[_0x1fdc('0x6')]=function(_0x5a16a9,_0x1b0737){return _0x5a16a9[_0x1fdc('0x7')]('VoicePrefix',attributes,{'tableName':_0x1fdc('0x8'),'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 589b27f..270c405 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 _0x37dd=['../../config/utils','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x22cbf4,_0x568356){var _0x3beffa=function(_0x32ea0c){while(--_0x32ea0c){_0x22cbf4['push'](_0x22cbf4['shift']());}};_0x3beffa(++_0x568356);}(_0x37dd,0x119));var _0xd37d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x37dd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd37d('0x0'));var util=require('util');var moment=require(_0xd37d('0x1'));var BPromise=require(_0xd37d('0x2'));var rs=require(_0xd37d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd37d('0x4'))['db'];var utils=require(_0xd37d('0x5'));var logger=require('../../config/logger')(_0xd37d('0x6'));var config=require('../../config/environment');var jayson=require(_0xd37d('0x7'));var client=jayson[_0xd37d('0x8')][_0xd37d('0x9')]({'port':0x232a});config[_0xd37d('0xa')]=_['defaults'](config[_0xd37d('0xa')],{'host':_0xd37d('0xb'),'port':0x18eb});var socket=require(_0xd37d('0xc'))(new Redis(config[_0xd37d('0xa')]));require(_0xd37d('0xd'))[_0xd37d('0xe')](socket);function respondWithRpcPromise(_0x308ae7,_0x1b521e,_0x106aa3){return new BPromise(function(_0x198719,_0x46c26b){return client[_0xd37d('0xf')](_0x308ae7,_0x106aa3)[_0xd37d('0x10')](function(_0x3a1d40){logger[_0xd37d('0x11')](_0xd37d('0x12'),_0x1b521e,_0xd37d('0x13'));logger[_0xd37d('0x14')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x1b521e,_0xd37d('0x13'),JSON[_0xd37d('0x15')](_0x3a1d40));if(_0x3a1d40[_0xd37d('0x16')]){if(_0x3a1d40[_0xd37d('0x16')][_0xd37d('0x17')]===0x1f4){logger[_0xd37d('0x16')](_0xd37d('0x12'),_0x1b521e,_0x3a1d40['error'][_0xd37d('0x18')]);return _0x46c26b(_0x3a1d40[_0xd37d('0x16')][_0xd37d('0x18')]);}logger[_0xd37d('0x16')](_0xd37d('0x12'),_0x1b521e,_0x3a1d40[_0xd37d('0x16')]['message']);return _0x198719(_0x3a1d40['error']['message']);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x1b521e,_0xd37d('0x13'));_0x198719(_0x3a1d40[_0xd37d('0x19')][_0xd37d('0x18')]);}})['catch'](function(_0xe019bd){logger[_0xd37d('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x1b521e,_0xe019bd);_0x46c26b(_0xe019bd);});});} \ No newline at end of file +var _0xc52c=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x37a293,_0x2f7d3b){var _0xd5f562=function(_0xe8adaf){while(--_0xe8adaf){_0x37a293['push'](_0x37a293['shift']());}};_0xd5f562(++_0x2f7d3b);}(_0xc52c,0x183));var _0xcc52=function(_0x2f6f50,_0x1d21a7){_0x2f6f50=_0x2f6f50-0x0;var _0x2cf365=_0xc52c[_0x2f6f50];return _0x2cf365;};'use strict';var _=require('lodash');var util=require(_0xcc52('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcc52('0x1'));var fs=require('fs');var Redis=require(_0xcc52('0x2'));var db=require(_0xcc52('0x3'))['db'];var utils=require(_0xcc52('0x4'));var logger=require(_0xcc52('0x5'))(_0xcc52('0x6'));var config=require('../../config/environment');var jayson=require(_0xcc52('0x7'));var client=jayson[_0xcc52('0x8')][_0xcc52('0x9')]({'port':0x232a});config[_0xcc52('0xa')]=_[_0xcc52('0xb')](config[_0xcc52('0xa')],{'host':_0xcc52('0xc'),'port':0x18eb});var socket=require(_0xcc52('0xd'))(new Redis(config[_0xcc52('0xa')]));require(_0xcc52('0xe'))['register'](socket);function respondWithRpcPromise(_0x52b8c2,_0x4c682f,_0x594f16){return new BPromise(function(_0x2e7e0f,_0x3e2054){return client[_0xcc52('0xf')](_0x52b8c2,_0x594f16)[_0xcc52('0x10')](function(_0x361846){logger[_0xcc52('0x11')](_0xcc52('0x12'),_0x4c682f,_0xcc52('0x13'));logger[_0xcc52('0x14')](_0xcc52('0x15'),_0x4c682f,_0xcc52('0x13'),JSON[_0xcc52('0x16')](_0x361846));if(_0x361846['error']){if(_0x361846[_0xcc52('0x17')][_0xcc52('0x18')]===0x1f4){logger[_0xcc52('0x17')](_0xcc52('0x12'),_0x4c682f,_0x361846[_0xcc52('0x17')]['message']);return _0x3e2054(_0x361846[_0xcc52('0x17')]['message']);}logger['error'](_0xcc52('0x12'),_0x4c682f,_0x361846[_0xcc52('0x17')]['message']);return _0x2e7e0f(_0x361846['error'][_0xcc52('0x19')]);}else{logger[_0xcc52('0x11')](_0xcc52('0x12'),_0x4c682f,_0xcc52('0x13'));_0x2e7e0f(_0x361846[_0xcc52('0x1a')][_0xcc52('0x19')]);}})[_0xcc52('0x1b')](function(_0x5d0811){logger['error'](_0xcc52('0x12'),_0x4c682f,_0x5d0811);_0x3e2054(_0x5d0811);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 664fed5..2f9138a 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 _0x21e1=['update','removeListener','register','voicePrefix:','./voicePrefix.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x21e1,0x17e));var _0x121e=function(_0xb690ea,_0x2ba6c8){_0xb690ea=_0xb690ea-0x0;var _0xcf55cf=_0x21e1[_0xb690ea];return _0xcf55cf;};'use strict';var VoicePrefixEvents=require(_0x121e('0x0'));var events=[_0x121e('0x1'),'remove',_0x121e('0x2')];function createListener(_0x30de6a,_0x20fddd){return function(_0x31f455){_0x20fddd['emit'](_0x30de6a,_0x31f455);};}function removeListener(_0x2f602e,_0x2d5ee1){return function(){VoicePrefixEvents[_0x121e('0x3')](_0x2f602e,_0x2d5ee1);};}exports[_0x121e('0x4')]=function(_0x5b60c6){for(var _0x1e9dbe=0x0,_0x10f1c5=events['length'];_0x1e9dbe<_0x10f1c5;_0x1e9dbe++){var _0x3386fd=events[_0x1e9dbe];var _0x1581af=createListener(_0x121e('0x5')+_0x3386fd,_0x5b60c6);VoicePrefixEvents['on'](_0x3386fd,_0x1581af);}}; \ No newline at end of file +var _0xe075=['voicePrefix:','./voicePrefix.events','save','remove','update','register'];(function(_0x27dac5,_0xceae1d){var _0xd254cc=function(_0x1241bf){while(--_0x1241bf){_0x27dac5['push'](_0x27dac5['shift']());}};_0xd254cc(++_0xceae1d);}(_0xe075,0x127));var _0x5e07=function(_0x179b80,_0x2ed9db){_0x179b80=_0x179b80-0x0;var _0x2c9466=_0xe075[_0x179b80];return _0x2c9466;};'use strict';var VoicePrefixEvents=require(_0x5e07('0x0'));var events=[_0x5e07('0x1'),_0x5e07('0x2'),_0x5e07('0x3')];function createListener(_0x1b301c,_0xd9c8){return function(_0xc5c83b){_0xd9c8['emit'](_0x1b301c,_0xc5c83b);};}function removeListener(_0x85ab06,_0x517c6d){return function(){VoicePrefixEvents['removeListener'](_0x85ab06,_0x517c6d);};}exports[_0x5e07('0x4')]=function(_0x573e64){for(var _0x193b25=0x0,_0x18db7=events['length'];_0x193b25<_0x18db7;_0x193b25++){var _0x40ff5d=events[_0x193b25];var _0x3f57eb=createListener(_0x5e07('0x5')+_0x40ff5d,_0x573e64);VoicePrefixEvents['on'](_0x40ff5d,_0x3f57eb);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 6e24ffc..7cc5ac8 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 _0x9153=['getLists','getBlackLists','post','create','addTeams','/:id/users','addLists','/:id/blacklists','addBlackLists','/:id','update','destroy','delete','removeAgents','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getAgents','/:id/members','/:id/lists'];(function(_0x59a117,_0x2c6d50){var _0x3243d1=function(_0x9856b2){while(--_0x9856b2){_0x59a117['push'](_0x59a117['shift']());}};_0x3243d1(++_0x2c6d50);}(_0x9153,0xd8));var _0x3915=function(_0x385c10,_0x361ae4){_0x385c10=_0x385c10-0x0;var _0x394110=_0x9153[_0x385c10];return _0x394110;};'use strict';var multer=require(_0x3915('0x0'));var util=require(_0x3915('0x1'));var path=require(_0x3915('0x2'));var timeout=require(_0x3915('0x3'));var express=require(_0x3915('0x4'));var router=express[_0x3915('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x3915('0x6'));var config=require(_0x3915('0x7'));var controller=require(_0x3915('0x8'));router[_0x3915('0x9')]('/',auth['isAuthenticated'](),controller[_0x3915('0xa')]);router['get']('/:id',auth[_0x3915('0xb')](),controller[_0x3915('0xc')]);router[_0x3915('0x9')](_0x3915('0xd'),auth['isAuthenticated'](),controller[_0x3915('0xe')]);router['get']('/:id/hopper_histories',auth[_0x3915('0xb')](),controller[_0x3915('0xf')]);router[_0x3915('0x9')](_0x3915('0x10'),auth[_0x3915('0xb')](),controller[_0x3915('0x11')]);router[_0x3915('0x9')](_0x3915('0x12'),auth[_0x3915('0xb')](),controller[_0x3915('0x13')]);router['get'](_0x3915('0x14'),auth[_0x3915('0xb')](),controller['getTeams']);router[_0x3915('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x3915('0x15')]);router[_0x3915('0x9')](_0x3915('0x16'),auth[_0x3915('0xb')](),controller['getMembers']);router[_0x3915('0x9')](_0x3915('0x17'),auth[_0x3915('0xb')](),controller[_0x3915('0x18')]);router[_0x3915('0x9')]('/:id/blacklists',auth[_0x3915('0xb')](),controller[_0x3915('0x19')]);router[_0x3915('0x1a')]('/',auth[_0x3915('0xb')](),controller[_0x3915('0x1b')]);router[_0x3915('0x1a')]('/:id/clone',auth[_0x3915('0xb')](),controller['clone']);router['post']('/:id/teams',auth[_0x3915('0xb')](),controller[_0x3915('0x1c')]);router[_0x3915('0x1a')](_0x3915('0x1d'),auth[_0x3915('0xb')](),controller['addAgents']);router[_0x3915('0x1a')](_0x3915('0x17'),auth['isAuthenticated'](),controller[_0x3915('0x1e')]);router[_0x3915('0x1a')](_0x3915('0x1f'),auth[_0x3915('0xb')](),controller[_0x3915('0x20')]);router['put'](_0x3915('0x21'),auth['isAuthenticated'](),controller[_0x3915('0x22')]);router['delete'](_0x3915('0x21'),auth[_0x3915('0xb')](),controller[_0x3915('0x23')]);router[_0x3915('0x24')](_0x3915('0x14'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x3915('0x24')](_0x3915('0x1d'),auth[_0x3915('0xb')](),controller[_0x3915('0x25')]);router[_0x3915('0x24')](_0x3915('0x17'),auth['isAuthenticated'](),controller['removeLists']);router[_0x3915('0x24')]('/:id/blacklists',auth[_0x3915('0xb')](),controller[_0x3915('0x26')]);module[_0x3915('0x27')]=router; \ No newline at end of file +var _0xa713=['clone','post','addTeams','/:id/users','addAgents','addBlackLists','put','update','delete','/:id/teams','removeTeams','removeLists','removeBlackLists','exports','multer','connect-timeout','../../components/auth/service','../../config/environment','get','isAuthenticated','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','getTeams','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','/:id/clone'];(function(_0x5d67d8,_0x1b181d){var _0x136fe4=function(_0x4819de){while(--_0x4819de){_0x5d67d8['push'](_0x5d67d8['shift']());}};_0x136fe4(++_0x1b181d);}(_0xa713,0x7d));var _0x3a71=function(_0x17fd22,_0x37cccc){_0x17fd22=_0x17fd22-0x0;var _0x402b77=_0xa713[_0x17fd22];return _0x402b77;};'use strict';var multer=require(_0x3a71('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3a71('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x3a71('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x3a71('0x3'));var controller=require('./voiceQueue.controller');router[_0x3a71('0x4')]('/',auth[_0x3a71('0x5')](),controller['index']);router[_0x3a71('0x4')]('/:id',auth[_0x3a71('0x5')](),controller[_0x3a71('0x6')]);router[_0x3a71('0x4')](_0x3a71('0x7'),auth[_0x3a71('0x5')](),controller['getHoppers']);router[_0x3a71('0x4')](_0x3a71('0x8'),auth[_0x3a71('0x5')](),controller[_0x3a71('0x9')]);router[_0x3a71('0x4')](_0x3a71('0xa'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0x3a71('0x4')](_0x3a71('0xb'),auth[_0x3a71('0x5')](),controller[_0x3a71('0xc')]);router[_0x3a71('0x4')]('/:id/teams',auth[_0x3a71('0x5')](),controller[_0x3a71('0xd')]);router['get']('/:id/users',auth[_0x3a71('0x5')](),controller[_0x3a71('0xe')]);router[_0x3a71('0x4')](_0x3a71('0xf'),auth['isAuthenticated'](),controller[_0x3a71('0x10')]);router['get'](_0x3a71('0x11'),auth['isAuthenticated'](),controller[_0x3a71('0x12')]);router[_0x3a71('0x4')](_0x3a71('0x13'),auth['isAuthenticated'](),controller[_0x3a71('0x14')]);router['post']('/',auth[_0x3a71('0x5')](),controller[_0x3a71('0x15')]);router['post'](_0x3a71('0x16'),auth['isAuthenticated'](),controller[_0x3a71('0x17')]);router[_0x3a71('0x18')]('/:id/teams',auth[_0x3a71('0x5')](),controller[_0x3a71('0x19')]);router[_0x3a71('0x18')](_0x3a71('0x1a'),auth[_0x3a71('0x5')](),controller[_0x3a71('0x1b')]);router[_0x3a71('0x18')](_0x3a71('0x11'),auth[_0x3a71('0x5')](),controller['addLists']);router['post'](_0x3a71('0x13'),auth[_0x3a71('0x5')](),controller[_0x3a71('0x1c')]);router[_0x3a71('0x1d')]('/:id',auth[_0x3a71('0x5')](),controller[_0x3a71('0x1e')]);router[_0x3a71('0x1f')]('/:id',auth[_0x3a71('0x5')](),controller['destroy']);router['delete'](_0x3a71('0x20'),auth['isAuthenticated'](),controller[_0x3a71('0x21')]);router['delete'](_0x3a71('0x1a'),auth[_0x3a71('0x5')](),controller['removeAgents']);router[_0x3a71('0x1f')](_0x3a71('0x11'),auth[_0x3a71('0x5')](),controller[_0x3a71('0x22')]);router[_0x3a71('0x1f')](_0x3a71('0x13'),auth['isAuthenticated'](),controller[_0x3a71('0x23')]);module[_0x3a71('0x24')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 8f02715..afc4062 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 _0x2d0c=['#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','BOOLEAN','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','ringall','setDataValue','strategy','type','getDataValue','dialMethod','INTEGER','yes','all','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','power','predictive','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','UNSIGNED','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x4f4102,_0x27134e){var _0x409a44=function(_0x468a33){while(--_0x468a33){_0x4f4102['push'](_0x4f4102['shift']());}};_0x409a44(++_0x27134e);}(_0x2d0c,0x9d));var _0xc2d0=function(_0x47199b,_0x16e824){_0x47199b=_0x47199b-0x0;var _0x390911=_0x2d0c[_0x47199b];return _0x390911;};'use strict';var Sequelize=require(_0xc2d0('0x0'));module[_0xc2d0('0x1')]={'name':{'type':Sequelize[_0xc2d0('0x2')],'allowNull':![],'unique':_0xc2d0('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xc2d0('0x4')](_0xc2d0('0x5'),_0xc2d0('0x6')),'allowNull':![],'defaultValue':_0xc2d0('0x5')},'musiconhold':{'type':Sequelize[_0xc2d0('0x2')],'defaultValue':_0xc2d0('0x7')},'announce':{'type':Sequelize[_0xc2d0('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xc2d0('0x4')]('rr','ringall',_0xc2d0('0x8'),_0xc2d0('0x9'),_0xc2d0('0xa'),_0xc2d0('0xb'),_0xc2d0('0xc'),_0xc2d0('0xd'),_0xc2d0('0xe')),'allowNull':![],'defaultValue':_0xc2d0('0xf'),'set':function(_0x4427c){this[_0xc2d0('0x10')](_0xc2d0('0x11'),_0x4427c?_0x4427c:_0xc2d0('0xb'));},'get':function(){var _0x48982b=this['getDataValue'](_0xc2d0('0x12'));var _0x5eb2e7=this[_0xc2d0('0x13')](_0xc2d0('0x14'));var _0x27b5ab=this[_0xc2d0('0x13')](_0xc2d0('0x11'));if(_0x48982b===_0xc2d0('0x5')){return _0x27b5ab;}if(_0x5eb2e7==='booked'&&_0x27b5ab===_0xc2d0('0xb')||_0x5eb2e7==='booked'&&_0x27b5ab==='roundrobin'){return _0x27b5ab;}if(_0x5eb2e7==='progressive'||_0x5eb2e7==='predictive'||_0x5eb2e7==='power'){return _0x27b5ab;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xc2d0('0x15')](0xb)},'timeout':{'type':Sequelize[_0xc2d0('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xc2d0('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xc2d0('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xc2d0('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xc2d0('0x16'),'no'),'defaultValue':_0xc2d0('0x16')},'autopause':{'type':Sequelize[_0xc2d0('0x4')]('yes','no',_0xc2d0('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xc2d0('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0xc2d0('0x4')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xc2d0('0x4')](_0xc2d0('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xc2d0('0x4')](_0xc2d0('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xc2d0('0x4')](_0xc2d0('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xc2d0('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xc2d0('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xc2d0('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xc2d0('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xc2d0('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xc2d0('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xc2d0('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xc2d0('0x4')](_0xc2d0('0x16'),'no'),'defaultValue':_0xc2d0('0x16')},'announce_holdtime':{'type':Sequelize[_0xc2d0('0x4')](_0xc2d0('0x16'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xc2d0('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xc2d0('0x4')](_0xc2d0('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0xc2d0('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xc2d0('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xc2d0('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xc2d0('0x2')]},'queue_youarenext':{'type':Sequelize[_0xc2d0('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xc2d0('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xc2d0('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xc2d0('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xc2d0('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xc2d0('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xc2d0('0x2')]},'queue_quantity1':{'type':Sequelize[_0xc2d0('0x2')]},'queue_quantity2':{'type':Sequelize[_0xc2d0('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0xc2d0('0x18')],'set':function(_0x4800df){this[_0xc2d0('0x10')](_0xc2d0('0x19'),_0x4800df?_0x4800df[_0xc2d0('0x1a')](','):[]);},'get':function(){return this[_0xc2d0('0x13')](_0xc2d0('0x19'))?this[_0xc2d0('0x13')](_0xc2d0('0x19'))[_0xc2d0('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0xc2d0('0x2')],'defaultValue':'yes','set':function(_0x3e8804){this[_0xc2d0('0x10')]('joinempty',_0x3e8804?_0x3e8804['join'](','):[]);},'get':function(){return this['getDataValue'](_0xc2d0('0x1c'))?this[_0xc2d0('0x13')](_0xc2d0('0x1c'))[_0xc2d0('0x1b')](','):[];}},'leavewhenempty':{'type':Sequelize[_0xc2d0('0x2')],'defaultValue':'no','set':function(_0xcff1d){this[_0xc2d0('0x10')](_0xc2d0('0x1d'),_0xcff1d?_0xcff1d['join'](','):[]);},'get':function(){return this['getDataValue'](_0xc2d0('0x1d'))?this[_0xc2d0('0x13')](_0xc2d0('0x1d'))[_0xc2d0('0x1b')](','):[];}},'reportholdtime':{'type':Sequelize[_0xc2d0('0x4')](_0xc2d0('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xc2d0('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0xc2d0('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xc2d0('0x2')]},'description':{'type':Sequelize[_0xc2d0('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x26d5ab){this[_0xc2d0('0x10')]('acw',_0x26d5ab);if(_0x26d5ab){if(this['getDataValue'](_0xc2d0('0x1e'))<0x2){this[_0xc2d0('0x10')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0xc2d0('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xc2d0('0x1f')},'dialMethod':{'type':Sequelize[_0xc2d0('0x4')](_0xc2d0('0x20'),_0xc2d0('0x21'),_0xc2d0('0x22'),_0xc2d0('0x23'),'booked'),'defaultValue':_0xc2d0('0x21'),'comment':_0xc2d0('0x24')},'dialLimitChannel':{'type':Sequelize[_0xc2d0('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xc2d0('0x25')},'dialLimitQueue':{'type':Sequelize[_0xc2d0('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0xc2d0('0x26')](0x2)[_0xc2d0('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xc2d0('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0xc2d0('0x4')](_0xc2d0('0x29'),_0xc2d0('0x2a')),'defaultValue':_0xc2d0('0x2a'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xc2d0('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xc2d0('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0xc2d0('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xc2d0('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc2d0('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xc2d0('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc2d0('0x2d')},'dialQueueOptions':{'type':Sequelize[_0xc2d0('0x2')],'defaultValue':'tTxX','comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xc2d0('0x15')](0x3)[_0xc2d0('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc2d0('0x2e')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xc2d0('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc2d0('0x15')](0x3)[_0xc2d0('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc2d0('0x15')](0x5)[_0xc2d0('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc2d0('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc2d0('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc2d0('0x15')](0x5)[_0xc2d0('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc2d0('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc2d0('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xc2d0('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc2d0('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xc2d0('0x15')](0x3)[_0xc2d0('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc2d0('0x33')},'dialTimezone':{'type':Sequelize[_0xc2d0('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xc2d0('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xc2d0('0x34'),_0xc2d0('0x35'),'onlyIfOpen'),'defaultValue':_0xc2d0('0x34')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xc2d0('0x15')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc2d0('0x36')},'dialAMDGreeting':{'type':Sequelize[_0xc2d0('0x15')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc2d0('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc2d0('0x15')](0x9)[_0xc2d0('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc2d0('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xc2d0('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc2d0('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0xc2d0('0x15')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc2d0('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc2d0('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc2d0('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc2d0('0x15')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc2d0('0x15')](0x5)[_0xc2d0('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc2d0('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0xc2d0('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xc2d0('0x3c')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xc2d0('0x3d')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc2d0('0x4')](_0xc2d0('0x3e'),_0xc2d0('0x3f')),'defaultValue':_0xc2d0('0x3e')},'dialQueueProject2':{'type':Sequelize[_0xc2d0('0x2')],'comment':_0xc2d0('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xc2d0('0x40')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc2d0('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xc2d0('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc2d0('0x41')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc2d0('0x15')],'allowNull':!![],'comment':_0xc2d0('0x42')},'mandatoryDisposition':{'type':Sequelize[_0xc2d0('0x40')],'defaultValue':![],'comment':_0xc2d0('0x43'),'set':function(_0x536ad1){if(!_0x536ad1)this[_0xc2d0('0x10')]('mandatoryDispositionPauseId',null);this[_0xc2d0('0x10')](_0xc2d0('0x44'),_0x536ad1);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xc2d0('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xc2d0('0x15')](0x3)[_0xc2d0('0x27')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x8bf9=['#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','outbound','STRING','default','ENUM','ringall','leastrecent','rrmemory','wrandom','rrordered','strategy','getDataValue','type','dialMethod','inbound','booked','progressive','predictive','power','INTEGER','yes','all','once','periodic_announce','join','split','setDataValue','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x467c09,_0x506683){var _0x1d3d84=function(_0x599468){while(--_0x599468){_0x467c09['push'](_0x467c09['shift']());}};_0x1d3d84(++_0x506683);}(_0x8bf9,0x1f4));var _0x98bf=function(_0x27a3be,_0x5dea43){_0x27a3be=_0x27a3be-0x0;var _0x16d496=_0x8bf9[_0x27a3be];return _0x16d496;};'use strict';var Sequelize=require(_0x98bf('0x0'));module[_0x98bf('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0x98bf('0x2')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x98bf('0x3')],'defaultValue':_0x98bf('0x4')},'announce':{'type':Sequelize[_0x98bf('0x3')],'defaultValue':''},'strategy':{'type':Sequelize[_0x98bf('0x5')]('rr',_0x98bf('0x6'),_0x98bf('0x7'),'fewestcalls','random',_0x98bf('0x8'),'linear',_0x98bf('0x9'),_0x98bf('0xa')),'allowNull':![],'defaultValue':_0x98bf('0x6'),'set':function(_0x4abd16){this['setDataValue'](_0x98bf('0xb'),_0x4abd16?_0x4abd16:_0x98bf('0x8'));},'get':function(){var _0x541da5=this[_0x98bf('0xc')](_0x98bf('0xd'));var _0x280758=this[_0x98bf('0xc')](_0x98bf('0xe'));var _0x130a02=this[_0x98bf('0xc')](_0x98bf('0xb'));if(_0x541da5===_0x98bf('0xf')){return _0x130a02;}if(_0x280758===_0x98bf('0x10')&&_0x130a02===_0x98bf('0x8')||_0x280758===_0x98bf('0x10')&&_0x130a02==='roundrobin'){return _0x130a02;}if(_0x280758===_0x98bf('0x11')||_0x280758===_0x98bf('0x12')||_0x280758===_0x98bf('0x13')){return _0x130a02;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x98bf('0x3')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x98bf('0x14')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x98bf('0x3')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x98bf('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x98bf('0x5')](_0x98bf('0x15'),'no'),'defaultValue':_0x98bf('0x15')},'autopause':{'type':Sequelize[_0x98bf('0x5')](_0x98bf('0x15'),'no',_0x98bf('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x98bf('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x98bf('0x5')](_0x98bf('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x98bf('0x5')](_0x98bf('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x98bf('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x98bf('0x5')](_0x98bf('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x98bf('0x5')](_0x98bf('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x98bf('0x5')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x98bf('0x5')](_0x98bf('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x98bf('0x3')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x98bf('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x98bf('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x98bf('0x5')](_0x98bf('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x98bf('0x15')},'announce_holdtime':{'type':Sequelize[_0x98bf('0x5')](_0x98bf('0x15'),'no',_0x98bf('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x98bf('0x3')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x98bf('0x5')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x98bf('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x98bf('0x3')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x98bf('0x3')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x98bf('0x3')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x98bf('0x3')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x98bf('0x3')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x98bf('0x3')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x98bf('0x3')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x98bf('0x3')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x98bf('0x3')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x10edcf){this['setDataValue'](_0x98bf('0x18'),_0x10edcf?_0x10edcf[_0x98bf('0x19')](','):[]);},'get':function(){return this[_0x98bf('0xc')](_0x98bf('0x18'))?this[_0x98bf('0xc')](_0x98bf('0x18'))[_0x98bf('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x98bf('0x3')],'defaultValue':_0x98bf('0x15'),'set':function(_0x5aba31){this[_0x98bf('0x1b')](_0x98bf('0x1c'),_0x5aba31?_0x5aba31[_0x98bf('0x19')](','):[]);},'get':function(){return this[_0x98bf('0xc')](_0x98bf('0x1c'))?this[_0x98bf('0xc')](_0x98bf('0x1c'))[_0x98bf('0x1a')](','):[];}},'leavewhenempty':{'type':Sequelize[_0x98bf('0x3')],'defaultValue':'no','set':function(_0x33e720){this[_0x98bf('0x1b')](_0x98bf('0x1d'),_0x33e720?_0x33e720[_0x98bf('0x19')](','):[]);},'get':function(){return this[_0x98bf('0xc')](_0x98bf('0x1d'))?this['getDataValue'](_0x98bf('0x1d'))['split'](','):[];}},'reportholdtime':{'type':Sequelize['ENUM'](_0x98bf('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x98bf('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x98bf('0x5')](_0x98bf('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x98bf('0x3')]},'acw':{'type':Sequelize[_0x98bf('0x1e')],'defaultValue':0x0,'set':function(_0x29ccc4){this[_0x98bf('0x1b')]('acw',_0x29ccc4);if(_0x29ccc4){if(this[_0x98bf('0xc')](_0x98bf('0x1f'))<0x2){this[_0x98bf('0x1b')](_0x98bf('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x98bf('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x98bf('0x20')},'dialMethod':{'type':Sequelize[_0x98bf('0x5')](_0x98bf('0x21'),_0x98bf('0x11'),'power',_0x98bf('0x12'),_0x98bf('0x10')),'defaultValue':_0x98bf('0x11'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x98bf('0x14')](0x4)[_0x98bf('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x98bf('0x14')](0x4)[_0x98bf('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x98bf('0x23')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x98bf('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x98bf('0x24')},'dialPredictiveOptimization':{'type':Sequelize[_0x98bf('0x5')]('agentBusyFactor',_0x98bf('0x25')),'defaultValue':_0x98bf('0x25'),'comment':_0x98bf('0x26')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x98bf('0x27')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x98bf('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x98bf('0x28')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x98bf('0x3')]},'dialOriginateTimeout':{'type':Sequelize[_0x98bf('0x14')](0x3)[_0x98bf('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x98bf('0x29')},'dialQueueOptions':{'type':Sequelize[_0x98bf('0x3')],'defaultValue':_0x98bf('0x2a'),'comment':_0x98bf('0x2b')},'dialQueueTimeout':{'type':Sequelize[_0x98bf('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x98bf('0x2c')},'dialQueueProject':{'type':Sequelize[_0x98bf('0x3')],'comment':_0x98bf('0x2d')},'dialCongestionMaxRetry':{'type':Sequelize[_0x98bf('0x14')](0x3)[_0x98bf('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x98bf('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x98bf('0x14')](0x5)[_0x98bf('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x98bf('0x14')](0x3)[_0x98bf('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x98bf('0x2f')},'dialBusyRetryFrequency':{'type':Sequelize[_0x98bf('0x14')](0x5)[_0x98bf('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x98bf('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x98bf('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x98bf('0x31')},'dialGlobalMaxRetry':{'type':Sequelize[_0x98bf('0x14')](0x3)[_0x98bf('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x98bf('0x3')],'defaultValue':_0x98bf('0x32')},'dialPrefix':{'type':Sequelize[_0x98bf('0x3')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x98bf('0x33'),_0x98bf('0x34')),'defaultValue':_0x98bf('0x35')},'dialAMDActive':{'type':Sequelize[_0x98bf('0x1e')],'defaultValue':0x0,'comment':_0x98bf('0x36')},'dialAMDInitialSilence':{'type':Sequelize[_0x98bf('0x14')](0x9)[_0x98bf('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x98bf('0x14')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x98bf('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x98bf('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x98bf('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x98bf('0x14')](0x9)[_0x98bf('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x98bf('0x14')](0x9)[_0x98bf('0x22')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x98bf('0x39')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x98bf('0x14')](0x9)[_0x98bf('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x98bf('0x3a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x98bf('0x14')](0x9)[_0x98bf('0x22')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x98bf('0x3b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x98bf('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x98bf('0x3c')},'dialRecallMeTimeout':{'type':Sequelize[_0x98bf('0x14')](0x5)[_0x98bf('0x22')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x98bf('0x3d')},'dialRecallInQueue':{'type':Sequelize[_0x98bf('0x1e')],'defaultValue':0x0,'comment':_0x98bf('0x3e')},'dialOrderByScheduledAt':{'type':Sequelize[_0x98bf('0x5')]('DESC','ASC'),'defaultValue':_0x98bf('0x3f')},'dialQueueProject2':{'type':Sequelize[_0x98bf('0x3')],'comment':_0x98bf('0x2d')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x98bf('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x98bf('0x14')](0x3)[_0x98bf('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x98bf('0x40')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x98bf('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x98bf('0x41')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x98bf('0x14')],'allowNull':!![],'comment':_0x98bf('0x42')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x98bf('0x43'),'set':function(_0x10137a){if(!_0x10137a)this[_0x98bf('0x1b')](_0x98bf('0x44'),null);this[_0x98bf('0x1b')](_0x98bf('0x45'),_0x10137a);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x98bf('0x14')](0x3)['UNSIGNED'],'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 c96f228..6e5a8fa 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 _0x6ae2=['rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','VIRTUAL','options','findAll','rows','params','includeAll','include','find','catch','create','body','get','role','inbound','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','user','UserProfileSection','update','findOne','sort','CmHopper','getHopperHistories','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','User','Agents','interface','forEach','penalty','sequelize','transaction','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','format','SIP/%s','emit','userVoiceQueue:save','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','all','compact','userVoiceQueue:remove','addAgents','spread','online','voicePause','isEmpty','isNil','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId\x20=\x20?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','then','destroy','VoiceQueues','QueueCampaigns','outbound','ignore','value','includes','type','name','end','error','stack','send','index','VoiceQueue'];(function(_0x30a6e4,_0x2417bc){var _0x1d78a8=function(_0x2d0469){while(--_0x2d0469){_0x30a6e4['push'](_0x30a6e4['shift']());}};_0x1d78a8(++_0x2417bc);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x132c94,_0x3d723f){_0x132c94=_0x132c94-0x0;var _0x12ad2c=_0x6ae2[_0x132c94];return _0x12ad2c;};'use strict';var pdf=require(_0x26ae('0x0'));var emlformat=require(_0x26ae('0x1'));var rimraf=require(_0x26ae('0x2'));var zipdir=require(_0x26ae('0x3'));var jsonpatch=require(_0x26ae('0x4'));var rp=require(_0x26ae('0x5'));var moment=require(_0x26ae('0x6'));var BPromise=require(_0x26ae('0x7'));var Mustache=require(_0x26ae('0x8'));var util=require('util');var path=require(_0x26ae('0x9'));var sox=require(_0x26ae('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x26ae('0xb'));var squel=require(_0x26ae('0xc'));var crypto=require(_0x26ae('0xd'));var jsforce=require(_0x26ae('0xe'));var deskjs=require(_0x26ae('0xf'));var toCsv=require(_0x26ae('0x10'));var querystring=require(_0x26ae('0x11'));var Papa=require(_0x26ae('0x12'));var Redis=require(_0x26ae('0x13'));var authService=require(_0x26ae('0x14'));var qs=require(_0x26ae('0x15'));var hardwareService=require(_0x26ae('0x16'));var logger=require('../../config/logger')(_0x26ae('0x17'));var utils=require('../../config/utils');var config=require(_0x26ae('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x26ae('0x19')](config[_0x26ae('0x1a')],{'host':_0x26ae('0x1b'),'port':0x18eb});var socket=require(_0x26ae('0x1c'))(new Redis(config[_0x26ae('0x1a')]));require(_0x26ae('0x1d'))[_0x26ae('0x1e')](socket);function respondWithStatusCode(_0x1c66b8,_0x2390a7){_0x2390a7=_0x2390a7||0xcc;return function(_0x52d611){if(_0x52d611){return _0x1c66b8[_0x26ae('0x1f')](_0x2390a7);}return _0x1c66b8[_0x26ae('0x20')](_0x2390a7)['end']();};}function respondWithResult(_0x15d055,_0x32cd9e){_0x32cd9e=_0x32cd9e||0xc8;return function(_0x497974){if(_0x497974){return _0x15d055[_0x26ae('0x20')](_0x32cd9e)[_0x26ae('0x21')](_0x497974);}};}function respondWithFilteredResult(_0x4f71d8,_0x11a091){return function(_0x13ad43){if(_0x13ad43){var _0x3c6812=_0x13ad43[_0x26ae('0x22')],_0x250dc0=_0x11a091[_0x26ae('0x23')],_0x3418c9=_0x11a091[_0x26ae('0x23')]+_0x11a091[_0x26ae('0x24')],_0x28584c;if(_0x3418c9>=_0x3c6812){_0x3418c9=_0x3c6812;_0x28584c=0xc8;}else{_0x28584c=0xce;}_0x4f71d8[_0x26ae('0x20')](_0x28584c);return _0x4f71d8[_0x26ae('0x25')](_0x26ae('0x26'),_0x250dc0+'-'+_0x3418c9+'/'+_0x3c6812)[_0x26ae('0x21')](_0x13ad43);}return null;};}function patchUpdates(_0xdfcd69){return function(_0x22d535){try{jsonpatch[_0x26ae('0x27')](_0x22d535,_0xdfcd69,!![]);}catch(_0x334153){return BPromise['reject'](_0x334153);}return _0x22d535['save']();};}function saveUpdates(_0x2a2ba5,_0x5d72dc){return function(_0x22c47b){if(_0x22c47b){return _0x22c47b['update'](_0x2a2ba5)[_0x26ae('0x28')](function(_0x2e34d1){return _0x2e34d1;});}return null;};}function removeEntity(_0x19f641,_0x57062e){return function(_0x4ab3f1){if(_0x4ab3f1){return _0x4ab3f1[_0x26ae('0x29')]()[_0x26ae('0x28')](function(){var _0x29de9b=_0x4ab3f1['get']({'plain':!![]});var _0x2caf20=[{'name':_0x26ae('0x2a'),'value':'inbound','ignore':![]},{'name':_0x26ae('0x2b'),'value':_0x26ae('0x2c'),'ignore':![]}];var _0x19eacc=_(_0x2caf20)['filter'](_0x26ae('0x2d'))['map'](_0x26ae('0x2e'))[_0x26ae('0x2e')]();if(_[_0x26ae('0x2f')](_0x19eacc,_0x29de9b['type'])){return;}var _0x29eeb4=_['find'](_0x2caf20,['value',_0x29de9b[_0x26ae('0x30')]])[_0x26ae('0x31')];return db['UserProfileResource'][_0x26ae('0x29')]({'where':{'type':_0x29eeb4,'resourceId':_0x29de9b['id']}})[_0x26ae('0x28')](function(){return _0x4ab3f1;});})[_0x26ae('0x28')](function(){_0x19f641[_0x26ae('0x20')](0xcc)[_0x26ae('0x32')]();});}};}function handleEntityNotFound(_0x56f880,_0x3a4194){return function(_0x16f54c){if(!_0x16f54c){_0x56f880[_0x26ae('0x1f')](0x194);}return _0x16f54c;};}function handleError(_0x461d50,_0x247219){_0x247219=_0x247219||0x1f4;return function(_0x56588f){logger[_0x26ae('0x33')](_0x56588f[_0x26ae('0x34')]);if(_0x56588f[_0x26ae('0x31')]){delete _0x56588f[_0x26ae('0x31')];}_0x461d50[_0x26ae('0x20')](_0x247219)[_0x26ae('0x35')](_0x56588f);};}exports[_0x26ae('0x36')]=function(_0x45737c,_0x5f46bd){var _0x170dd4={},_0x543044={},_0x4c961d={'count':0x0,'rows':[]};var _0x23c723=db[_0x26ae('0x37')][_0x26ae('0x38')];_0x543044['model']=_[_0x26ae('0x39')](_0x23c723);_0x543044[_0x26ae('0x3a')]=_[_0x26ae('0x39')](_0x45737c[_0x26ae('0x3a')]);_0x543044[_0x26ae('0x3b')]=_[_0x26ae('0x3c')](_0x543044[_0x26ae('0x3d')],_0x543044[_0x26ae('0x3a')]);_0x170dd4[_0x26ae('0x3e')]=_[_0x26ae('0x3c')](_0x543044[_0x26ae('0x3d')],qs[_0x26ae('0x3f')](_0x45737c[_0x26ae('0x3a')][_0x26ae('0x3f')]));_0x170dd4['attributes']=_0x170dd4[_0x26ae('0x3e')][_0x26ae('0x40')]?_0x170dd4[_0x26ae('0x3e')]:_0x543044['model'];if(!_0x45737c[_0x26ae('0x3a')][_0x26ae('0x41')](_0x26ae('0x42'))){_0x170dd4[_0x26ae('0x24')]=qs[_0x26ae('0x24')](_0x45737c['query'][_0x26ae('0x24')]);_0x170dd4[_0x26ae('0x23')]=qs[_0x26ae('0x23')](_0x45737c[_0x26ae('0x3a')][_0x26ae('0x23')]);}_0x170dd4[_0x26ae('0x43')]=qs['sort'](_0x45737c['query']['sort']);_0x170dd4[_0x26ae('0x44')]=qs[_0x26ae('0x3b')](_[_0x26ae('0x45')](_0x45737c[_0x26ae('0x3a')],_0x543044[_0x26ae('0x3b')]));if(_0x45737c['query'][_0x26ae('0x46')]){_0x170dd4[_0x26ae('0x44')]=_[_0x26ae('0x47')](_0x170dd4[_0x26ae('0x44')],{'$or':_[_0x26ae('0x48')](_0x23c723,function(_0x210000){if(_0x210000[_0x26ae('0x30')]['key']!==_0x26ae('0x49')){var _0x7d041f={};_0x7d041f[_0x210000['field']]={'$like':'%'+_0x45737c[_0x26ae('0x3a')]['filter']+'%'};return _0x7d041f;}})});}_0x170dd4=_[_0x26ae('0x47')]({},_0x170dd4,_0x45737c[_0x26ae('0x4a')]);var _0x92a7d8={'where':_0x170dd4['where']};return db[_0x26ae('0x37')][_0x26ae('0x22')](_0x92a7d8)[_0x26ae('0x28')](function(_0x1c0d82){_0x4c961d[_0x26ae('0x22')]=_0x1c0d82;if(_0x45737c[_0x26ae('0x3a')]['includeAll']){_0x170dd4['include']=[{'all':!![]}];}return db['VoiceQueue'][_0x26ae('0x4b')](_0x170dd4);})[_0x26ae('0x28')](function(_0x3ead6b){_0x4c961d[_0x26ae('0x4c')]=_0x3ead6b;return _0x4c961d;})[_0x26ae('0x28')](respondWithFilteredResult(_0x5f46bd,_0x170dd4))['catch'](handleError(_0x5f46bd,null));};exports['show']=function(_0x1f2de3,_0x42ed2d){var _0x686879={'raw':![],'where':{'id':_0x1f2de3[_0x26ae('0x4d')]['id']}},_0x4d0093={};_0x4d0093['model']=_[_0x26ae('0x39')](db[_0x26ae('0x37')]['rawAttributes']);_0x4d0093['query']=_[_0x26ae('0x39')](_0x1f2de3['query']);_0x4d0093[_0x26ae('0x3b')]=_[_0x26ae('0x3c')](_0x4d0093[_0x26ae('0x3d')],_0x4d0093[_0x26ae('0x3a')]);_0x686879[_0x26ae('0x3e')]=_[_0x26ae('0x3c')](_0x4d0093[_0x26ae('0x3d')],qs[_0x26ae('0x3f')](_0x1f2de3[_0x26ae('0x3a')][_0x26ae('0x3f')]));_0x686879[_0x26ae('0x3e')]=_0x686879['attributes'][_0x26ae('0x40')]?_0x686879[_0x26ae('0x3e')]:_0x4d0093[_0x26ae('0x3d')];if(_0x1f2de3[_0x26ae('0x3a')][_0x26ae('0x4e')]){_0x686879[_0x26ae('0x4f')]=[{'all':!![]}];}_0x686879=_[_0x26ae('0x47')]({},_0x686879,_0x1f2de3[_0x26ae('0x4a')]);return db[_0x26ae('0x37')][_0x26ae('0x50')](_0x686879)[_0x26ae('0x28')](handleEntityNotFound(_0x42ed2d,null))[_0x26ae('0x28')](respondWithResult(_0x42ed2d,null))[_0x26ae('0x51')](handleError(_0x42ed2d,null));};exports['create']=function(_0x1b075d,_0x4d12ff){return db[_0x26ae('0x37')][_0x26ae('0x52')](_0x1b075d[_0x26ae('0x53')],{})[_0x26ae('0x28')](function(_0x448da8){var _0x1e806b=_0x1b075d['user'][_0x26ae('0x54')]({'plain':!![]});if(!_0x1e806b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e806b[_0x26ae('0x55')]==='user'){var _0x304019=_0x448da8[_0x26ae('0x54')]({'plain':!![]});var _0x502d63=[{'name':_0x26ae('0x2a'),'value':_0x26ae('0x56')},{'name':_0x26ae('0x2b'),'value':_0x26ae('0x2c')}];var _0x208057=_['find'](_0x502d63,['value',_0x304019[_0x26ae('0x30')]])[_0x26ae('0x31')];return db['UserProfileSection'][_0x26ae('0x50')]({'where':{'name':_0x208057,'userProfileId':_0x1e806b[_0x26ae('0x57')]},'raw':!![]})[_0x26ae('0x28')](function(_0x51b9ec){if(_0x51b9ec&&_0x51b9ec[_0x26ae('0x58')]===0x0){return db[_0x26ae('0x59')][_0x26ae('0x52')]({'name':_0x304019[_0x26ae('0x31')],'resourceId':_0x304019['id'],'type':_0x51b9ec[_0x26ae('0x31')],'sectionId':_0x51b9ec['id']},{})[_0x26ae('0x28')](function(){return _0x448da8;});}else{return _0x448da8;}})[_0x26ae('0x51')](function(_0x2312e4){logger[_0x26ae('0x33')](_0x26ae('0x5a'),_0x2312e4);throw _0x2312e4;});}return _0x448da8;})[_0x26ae('0x28')](respondWithResult(_0x4d12ff,0xc9))[_0x26ae('0x51')](handleError(_0x4d12ff,null));};exports[_0x26ae('0x5b')]=function(_0x43089b,_0x3eb777){var _0x4292d4={'raw':![],'where':{'id':_0x43089b[_0x26ae('0x4d')]['id']}},_0x230fc4={};_0x230fc4[_0x26ae('0x3d')]=_[_0x26ae('0x39')](db['VoiceQueue']['rawAttributes']);_0x4292d4[_0x26ae('0x3e')]=_[_0x26ae('0x3c')](_0x230fc4[_0x26ae('0x3d')],qs['fields'](_0x43089b[_0x26ae('0x3a')]['fields']));_0x4292d4[_0x26ae('0x3e')]=_0x4292d4[_0x26ae('0x3e')]['length']?_0x4292d4[_0x26ae('0x3e')]:_0x230fc4[_0x26ae('0x3d')];if(_0x43089b[_0x26ae('0x3a')][_0x26ae('0x4e')]){_0x4292d4[_0x26ae('0x4f')]=[{'all':!![]}];}_0x4292d4=_[_0x26ae('0x47')]({},_0x4292d4,_0x43089b[_0x26ae('0x4a')]);return db[_0x26ae('0x37')][_0x26ae('0x50')](_0x4292d4)[_0x26ae('0x28')](handleEntityNotFound(_0x3eb777,null))[_0x26ae('0x28')](function(_0x2c7ddc){if(_0x2c7ddc){var _0x253579=_0x2c7ddc[_0x26ae('0x54')]({'plain':!![]});_0x253579=qs[_0x26ae('0x5c')](_0x253579,['id','createdAt',_0x26ae('0x5d')]);_0x43089b['body']=_[_0x26ae('0x5c')](_0x43089b['body'],['id',_0x26ae('0x5e'),_0x26ae('0x5d')]);return db[_0x26ae('0x37')][_0x26ae('0x52')](_[_0x26ae('0x47')](_0x253579,_0x43089b['body']),{'include':_0x43089b['query'][_0x26ae('0x4e')]?[{'all':!![]}]:undefined})[_0x26ae('0x28')](function(_0x10ce69){var _0x4c5674=_0x43089b['user']['get']({'plain':!![]});if(!_0x4c5674)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c5674['role']===_0x26ae('0x5f')){var _0x516120=_0x10ce69[_0x26ae('0x54')]({'plain':!![]});var _0x1d202e=[{'name':'VoiceQueues','value':_0x26ae('0x56')},{'name':_0x26ae('0x2b'),'value':'outbound'}];var _0x3017c6=_['find'](_0x1d202e,[_0x26ae('0x2e'),_0x516120[_0x26ae('0x30')]])[_0x26ae('0x31')];return db[_0x26ae('0x60')][_0x26ae('0x50')]({'where':{'name':_0x3017c6,'userProfileId':_0x4c5674[_0x26ae('0x57')]},'raw':!![]})[_0x26ae('0x28')](function(_0x2d3685){if(_0x2d3685&&_0x2d3685[_0x26ae('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x516120[_0x26ae('0x31')],'resourceId':_0x516120['id'],'type':_0x2d3685[_0x26ae('0x31')],'sectionId':_0x2d3685['id']},{})[_0x26ae('0x28')](function(){return _0x10ce69;});}else{return _0x10ce69;}})[_0x26ae('0x51')](function(_0x85f644){logger[_0x26ae('0x33')](_0x26ae('0x5a'),_0x85f644);throw _0x85f644;});}return _0x10ce69;});}})[_0x26ae('0x28')](respondWithResult(_0x3eb777,0xc9))[_0x26ae('0x51')](handleError(_0x3eb777,null));};exports[_0x26ae('0x61')]=function(_0x3c10df,_0x4b8208){if(_0x3c10df['body']['id']){delete _0x3c10df['body']['id'];}return db[_0x26ae('0x37')][_0x26ae('0x50')]({'where':{'id':_0x3c10df['params']['id']}})['then'](handleEntityNotFound(_0x4b8208,null))['then'](saveUpdates(_0x3c10df['body'],null))[_0x26ae('0x28')](respondWithResult(_0x4b8208,null))[_0x26ae('0x51')](handleError(_0x4b8208,null));};exports['destroy']=function(_0x4ec8e7,_0x2c04d7){return db[_0x26ae('0x37')][_0x26ae('0x50')]({'where':{'id':_0x4ec8e7[_0x26ae('0x4d')]['id']}})[_0x26ae('0x28')](handleEntityNotFound(_0x2c04d7,null))[_0x26ae('0x28')](removeEntity(_0x2c04d7,null))[_0x26ae('0x51')](handleError(_0x2c04d7,null));};exports['getHoppers']=function(_0x2c2c32,_0x1013b0,_0x58e3f0){var _0x39ccaf={'raw':![],'where':{}};var _0x2e7411={};var _0x4600f2={'count':0x0,'rows':[]};return db[_0x26ae('0x37')][_0x26ae('0x62')]({'where':{'id':_0x2c2c32['params']['id']}})[_0x26ae('0x28')](handleEntityNotFound(_0x1013b0,null))[_0x26ae('0x28')](function(_0x1fb611){if(_0x1fb611){_0x2e7411['model']=_[_0x26ae('0x39')](db['CmHopper'][_0x26ae('0x38')]);_0x2e7411[_0x26ae('0x3a')]=_[_0x26ae('0x39')](_0x2c2c32[_0x26ae('0x3a')]);_0x2e7411[_0x26ae('0x3b')]=_[_0x26ae('0x3c')](_0x2e7411[_0x26ae('0x3d')],_0x2e7411[_0x26ae('0x3a')]);_0x39ccaf[_0x26ae('0x3e')]=_['intersection'](_0x2e7411[_0x26ae('0x3d')],qs[_0x26ae('0x3f')](_0x2c2c32[_0x26ae('0x3a')][_0x26ae('0x3f')]));_0x39ccaf[_0x26ae('0x3e')]=_0x39ccaf[_0x26ae('0x3e')][_0x26ae('0x40')]?_0x39ccaf[_0x26ae('0x3e')]:_0x2e7411[_0x26ae('0x3d')];if(!_0x2c2c32[_0x26ae('0x3a')]['hasOwnProperty'](_0x26ae('0x42'))){_0x39ccaf[_0x26ae('0x24')]=qs['limit'](_0x2c2c32[_0x26ae('0x3a')][_0x26ae('0x24')]);_0x39ccaf['offset']=qs['offset'](_0x2c2c32[_0x26ae('0x3a')][_0x26ae('0x23')]);}_0x39ccaf['order']=qs[_0x26ae('0x63')](_0x2c2c32['query'][_0x26ae('0x63')]);_0x39ccaf[_0x26ae('0x44')]=qs[_0x26ae('0x3b')](_[_0x26ae('0x45')](_0x2c2c32['query'],_0x2e7411[_0x26ae('0x3b')]));_0x39ccaf['where']['VoiceQueueId']=_0x1fb611['id'];if(_0x2c2c32[_0x26ae('0x3a')][_0x26ae('0x46')]){_0x39ccaf[_0x26ae('0x44')]=_[_0x26ae('0x47')](_0x39ccaf[_0x26ae('0x44')],{'$or':_['map'](_0x39ccaf[_0x26ae('0x3e')],function(_0x3aad64){var _0x3ad986={};_0x3ad986[_0x3aad64]={'$like':'%'+_0x2c2c32[_0x26ae('0x3a')][_0x26ae('0x46')]+'%'};return _0x3ad986;})});}_0x39ccaf=_[_0x26ae('0x47')]({},_0x39ccaf,_0x2c2c32[_0x26ae('0x4a')]);return db[_0x26ae('0x64')][_0x26ae('0x22')]({'where':_0x39ccaf[_0x26ae('0x44')]})[_0x26ae('0x28')](function(_0x52e883){_0x4600f2[_0x26ae('0x22')]=_0x52e883;if(_0x2c2c32[_0x26ae('0x3a')][_0x26ae('0x4e')]){_0x39ccaf['include']=[{'all':!![]}];}return db[_0x26ae('0x64')][_0x26ae('0x4b')](_0x39ccaf);})[_0x26ae('0x28')](function(_0x558280){_0x4600f2[_0x26ae('0x4c')]=_0x558280;return _0x4600f2;});}})[_0x26ae('0x28')](respondWithFilteredResult(_0x1013b0,_0x39ccaf))[_0x26ae('0x51')](handleError(_0x1013b0,null));};exports[_0x26ae('0x65')]=function(_0x49b618,_0x309457,_0x231c6c){var _0x597d76={'raw':!![],'where':{}};var _0x285967={};var _0x4a6770={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x49b618[_0x26ae('0x4d')]['id']}})[_0x26ae('0x28')](handleEntityNotFound(_0x309457,null))[_0x26ae('0x28')](function(_0x4c7a93){if(_0x4c7a93){_0x285967[_0x26ae('0x3d')]=_[_0x26ae('0x39')](db[_0x26ae('0x66')][_0x26ae('0x38')]);_0x285967[_0x26ae('0x3a')]=_[_0x26ae('0x39')](_0x49b618['query']);_0x285967[_0x26ae('0x3b')]=_['intersection'](_0x285967[_0x26ae('0x3d')],_0x285967[_0x26ae('0x3a')]);_0x597d76['attributes']=_['intersection'](_0x285967['model'],qs[_0x26ae('0x3f')](_0x49b618['query']['fields']));_0x597d76[_0x26ae('0x3e')]=_0x597d76['attributes'][_0x26ae('0x40')]?_0x597d76[_0x26ae('0x3e')]:_0x285967[_0x26ae('0x3d')];if(!_0x49b618[_0x26ae('0x3a')][_0x26ae('0x41')]('nolimit')){_0x597d76[_0x26ae('0x24')]=qs[_0x26ae('0x24')](_0x49b618[_0x26ae('0x3a')]['limit']);_0x597d76['offset']=qs[_0x26ae('0x23')](_0x49b618[_0x26ae('0x3a')][_0x26ae('0x23')]);}_0x597d76[_0x26ae('0x43')]=qs['sort'](_0x49b618[_0x26ae('0x3a')][_0x26ae('0x63')]);_0x597d76['where']=qs['filters'](_[_0x26ae('0x45')](_0x49b618[_0x26ae('0x3a')],_0x285967['filters']));_0x597d76['where'][_0x26ae('0x67')]=_0x4c7a93['id'];if(_0x49b618[_0x26ae('0x3a')][_0x26ae('0x46')]){_0x597d76[_0x26ae('0x44')]=_[_0x26ae('0x47')](_0x597d76[_0x26ae('0x44')],{'$or':_[_0x26ae('0x48')](_0x597d76[_0x26ae('0x3e')],function(_0x2dae51){var _0x1481b4={};_0x1481b4[_0x2dae51]={'$like':'%'+_0x49b618['query']['filter']+'%'};return _0x1481b4;})});}_0x597d76=_['merge']({},_0x597d76,_0x49b618[_0x26ae('0x4a')]);return db['CmHopperHistory']['count']({'where':_0x597d76[_0x26ae('0x44')]})[_0x26ae('0x28')](function(_0x39a544){_0x4a6770[_0x26ae('0x22')]=_0x39a544;if(_0x49b618[_0x26ae('0x3a')][_0x26ae('0x4e')]){_0x597d76['include']=[{'all':!![]}];}return db[_0x26ae('0x66')][_0x26ae('0x4b')](_0x597d76);})[_0x26ae('0x28')](function(_0x46f24a){_0x4a6770[_0x26ae('0x4c')]=_0x46f24a;return _0x4a6770;});}})[_0x26ae('0x28')](respondWithFilteredResult(_0x309457,_0x597d76))[_0x26ae('0x51')](handleError(_0x309457,null));};exports[_0x26ae('0x68')]=function(_0x3717fb,_0x162285,_0x12f921){var _0x3c7141={'raw':!![],'where':{}};var _0x23bb13={};var _0x41dc41={'count':0x0,'rows':[]};return db[_0x26ae('0x37')][_0x26ae('0x62')]({'where':{'id':_0x3717fb[_0x26ae('0x4d')]['id']}})[_0x26ae('0x28')](handleEntityNotFound(_0x162285,null))[_0x26ae('0x28')](function(_0xd5e522){if(_0xd5e522){_0x23bb13[_0x26ae('0x3d')]=_['keys'](db[_0x26ae('0x69')]['rawAttributes']);_0x23bb13[_0x26ae('0x3a')]=_[_0x26ae('0x39')](_0x3717fb[_0x26ae('0x3a')]);_0x23bb13[_0x26ae('0x3b')]=_['intersection'](_0x23bb13[_0x26ae('0x3d')],_0x23bb13[_0x26ae('0x3a')]);_0x3c7141[_0x26ae('0x3e')]=_[_0x26ae('0x3c')](_0x23bb13[_0x26ae('0x3d')],qs[_0x26ae('0x3f')](_0x3717fb[_0x26ae('0x3a')][_0x26ae('0x3f')]));_0x3c7141['attributes']=_0x3c7141[_0x26ae('0x3e')][_0x26ae('0x40')]?_0x3c7141[_0x26ae('0x3e')]:_0x23bb13[_0x26ae('0x3d')];if(!_0x3717fb['query'][_0x26ae('0x41')](_0x26ae('0x42'))){_0x3c7141[_0x26ae('0x24')]=qs[_0x26ae('0x24')](_0x3717fb[_0x26ae('0x3a')][_0x26ae('0x24')]);_0x3c7141['offset']=qs[_0x26ae('0x23')](_0x3717fb[_0x26ae('0x3a')][_0x26ae('0x23')]);}_0x3c7141[_0x26ae('0x43')]=qs['sort'](_0x3717fb[_0x26ae('0x3a')][_0x26ae('0x63')]);_0x3c7141[_0x26ae('0x44')]=qs[_0x26ae('0x3b')](_[_0x26ae('0x45')](_0x3717fb[_0x26ae('0x3a')],_0x23bb13[_0x26ae('0x3b')]));_0x3c7141[_0x26ae('0x44')][_0x26ae('0x67')]=_0xd5e522['id'];if(_0x3717fb[_0x26ae('0x3a')]['filter']){_0x3c7141[_0x26ae('0x44')]=_['merge'](_0x3c7141['where'],{'$or':_[_0x26ae('0x48')](_0x3c7141['attributes'],function(_0x5538fa){var _0x2de849={};_0x2de849[_0x5538fa]={'$like':'%'+_0x3717fb[_0x26ae('0x3a')][_0x26ae('0x46')]+'%'};return _0x2de849;})});}_0x3c7141=_[_0x26ae('0x47')]({},_0x3c7141,_0x3717fb['options']);return db['CmHopperFinal'][_0x26ae('0x22')]({'where':_0x3c7141['where']})['then'](function(_0xb58b8d){_0x41dc41['count']=_0xb58b8d;if(_0x3717fb['query'][_0x26ae('0x4e')]){_0x3c7141[_0x26ae('0x4f')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x3c7141);})[_0x26ae('0x28')](function(_0x33df0f){_0x41dc41[_0x26ae('0x4c')]=_0x33df0f;return _0x41dc41;});}})[_0x26ae('0x28')](respondWithFilteredResult(_0x162285,_0x3c7141))[_0x26ae('0x51')](handleError(_0x162285,null));};exports[_0x26ae('0x6a')]=function(_0x576715,_0x41dcd3,_0x186694){var _0x30d5f2={'raw':!![],'where':{}};var _0xf51d9d={};var _0x106878={'count':0x0,'rows':[]};return db[_0x26ae('0x37')]['findOne']({'where':{'id':_0x576715['params']['id']}})['then'](handleEntityNotFound(_0x41dcd3,null))[_0x26ae('0x28')](function(_0x4016d3){if(_0x4016d3){_0xf51d9d[_0x26ae('0x3d')]=_[_0x26ae('0x39')](db[_0x26ae('0x6b')][_0x26ae('0x38')]);_0xf51d9d['query']=_[_0x26ae('0x39')](_0x576715[_0x26ae('0x3a')]);_0xf51d9d[_0x26ae('0x3b')]=_[_0x26ae('0x3c')](_0xf51d9d[_0x26ae('0x3d')],_0xf51d9d['query']);_0x30d5f2[_0x26ae('0x3e')]=_['intersection'](_0xf51d9d[_0x26ae('0x3d')],qs[_0x26ae('0x3f')](_0x576715[_0x26ae('0x3a')]['fields']));_0x30d5f2[_0x26ae('0x3e')]=_0x30d5f2[_0x26ae('0x3e')][_0x26ae('0x40')]?_0x30d5f2['attributes']:_0xf51d9d[_0x26ae('0x3d')];if(!_0x576715[_0x26ae('0x3a')][_0x26ae('0x41')](_0x26ae('0x42'))){_0x30d5f2[_0x26ae('0x24')]=qs[_0x26ae('0x24')](_0x576715[_0x26ae('0x3a')][_0x26ae('0x24')]);_0x30d5f2[_0x26ae('0x23')]=qs[_0x26ae('0x23')](_0x576715['query']['offset']);}_0x30d5f2[_0x26ae('0x43')]=qs['sort'](_0x576715[_0x26ae('0x3a')][_0x26ae('0x63')]);_0x30d5f2[_0x26ae('0x44')]=qs[_0x26ae('0x3b')](_['pick'](_0x576715[_0x26ae('0x3a')],_0xf51d9d[_0x26ae('0x3b')]));_0x30d5f2[_0x26ae('0x44')]['VoiceQueueId']=_0x4016d3['id'];if(_0x576715[_0x26ae('0x3a')]['filter']){_0x30d5f2[_0x26ae('0x44')]=_[_0x26ae('0x47')](_0x30d5f2[_0x26ae('0x44')],{'$or':_['map'](_0x30d5f2[_0x26ae('0x3e')],function(_0x5f3e89){var _0x5a6cd9={};_0x5a6cd9[_0x5f3e89]={'$like':'%'+_0x576715['query'][_0x26ae('0x46')]+'%'};return _0x5a6cd9;})});}_0x30d5f2=_['merge']({},_0x30d5f2,_0x576715['options']);return db['CmHopperBlack'][_0x26ae('0x22')]({'where':_0x30d5f2[_0x26ae('0x44')]})[_0x26ae('0x28')](function(_0x315738){_0x106878['count']=_0x315738;if(_0x576715['query'][_0x26ae('0x4e')]){_0x30d5f2[_0x26ae('0x4f')]=[{'all':!![]}];}return db[_0x26ae('0x6b')]['findAll'](_0x30d5f2);})[_0x26ae('0x28')](function(_0x5e961a){_0x106878[_0x26ae('0x4c')]=_0x5e961a;return _0x106878;});}})[_0x26ae('0x28')](respondWithFilteredResult(_0x41dcd3,_0x30d5f2))[_0x26ae('0x51')](handleError(_0x41dcd3,null));};exports[_0x26ae('0x6c')]=function(_0x57be51,_0x5c1f25,_0x1b68b3){var _0x4f3adc={};var _0x488981={};var _0x530e0e;var _0x12ec4d;return db[_0x26ae('0x37')][_0x26ae('0x62')]({'where':{'id':_0x57be51[_0x26ae('0x4d')]['id']}})[_0x26ae('0x28')](handleEntityNotFound(_0x5c1f25,null))[_0x26ae('0x28')](function(_0x56d57c){if(_0x56d57c){_0x530e0e=_0x56d57c;_0x488981[_0x26ae('0x3d')]=_['keys'](db[_0x26ae('0x6d')][_0x26ae('0x38')]);_0x488981[_0x26ae('0x3a')]=_['keys'](_0x57be51[_0x26ae('0x3a')]);_0x488981[_0x26ae('0x3b')]=_[_0x26ae('0x3c')](_0x488981[_0x26ae('0x3d')],_0x488981[_0x26ae('0x3a')]);_0x4f3adc[_0x26ae('0x3e')]=_[_0x26ae('0x3c')](_0x488981[_0x26ae('0x3d')],qs[_0x26ae('0x3f')](_0x57be51[_0x26ae('0x3a')][_0x26ae('0x3f')]));_0x4f3adc[_0x26ae('0x3e')]=_0x4f3adc[_0x26ae('0x3e')][_0x26ae('0x40')]?_0x4f3adc['attributes']:_0x488981['model'];_0x4f3adc['order']=qs['sort'](_0x57be51['query'][_0x26ae('0x63')]);_0x4f3adc['where']=qs['filters'](_['pick'](_0x57be51[_0x26ae('0x3a')],_0x488981[_0x26ae('0x3b')]));if(_0x57be51[_0x26ae('0x3a')][_0x26ae('0x46')]){_0x4f3adc[_0x26ae('0x44')]=_[_0x26ae('0x47')](_0x4f3adc[_0x26ae('0x44')],{'$or':_['map'](_0x4f3adc[_0x26ae('0x3e')],function(_0x47e02a){var _0x3ad661={};_0x3ad661[_0x47e02a]={'$like':'%'+_0x57be51['query'][_0x26ae('0x46')]+'%'};return _0x3ad661;})});}_0x4f3adc=_[_0x26ae('0x47')]({},_0x4f3adc,_0x57be51[_0x26ae('0x4a')]);return _0x530e0e[_0x26ae('0x6c')](_0x4f3adc);}})[_0x26ae('0x28')](function(_0x3af650){if(_0x3af650){_0x12ec4d=_0x3af650['length'];if(!_0x57be51[_0x26ae('0x3a')][_0x26ae('0x41')]('nolimit')){_0x4f3adc[_0x26ae('0x24')]=qs['limit'](_0x57be51['query'][_0x26ae('0x24')]);_0x4f3adc[_0x26ae('0x23')]=qs[_0x26ae('0x23')](_0x57be51[_0x26ae('0x3a')][_0x26ae('0x23')]);}return _0x530e0e[_0x26ae('0x6c')](_0x4f3adc);}})['then'](function(_0x36cdb4){if(_0x36cdb4){return _0x36cdb4?{'count':_0x12ec4d,'rows':_0x36cdb4}:null;}})[_0x26ae('0x28')](respondWithResult(_0x5c1f25,null))[_0x26ae('0x51')](handleError(_0x5c1f25,null));};exports[_0x26ae('0x6e')]=function(_0x1e25d6,_0x342c37,_0x9a3151){var _0x2c7797=_0x1e25d6[_0x26ae('0x53')]['teams'];return db[_0x26ae('0x6d')][_0x26ae('0x4b')]({'where':{'id':_[_0x26ae('0x48')](_0x2c7797,'id')},'attributes':['id'],'include':[{'model':db[_0x26ae('0x6f')],'as':_0x26ae('0x70'),'attributes':['id',_0x26ae('0x31'),'online','voicePause',_0x26ae('0x71')],'raw':!![]}]})['then'](function(_0x58528e){if(_0x58528e){var _0x5b8458=_['flatMap'](_0x58528e,function(_0x358f80){var _0x7d42d9=_0x358f80['get']({'plain':!![]});_0x7d42d9[_0x26ae('0x70')][_0x26ae('0x72')](function(_0xfe42ab){_0xfe42ab[_0x26ae('0x73')]=_[_0x26ae('0x50')](_0x2c7797,{'id':_0x7d42d9['id']})[_0x26ae('0x73')];});return _0x7d42d9['Agents'];});return db[_0x26ae('0x37')][_0x26ae('0x50')]({'where':{'id':_0x1e25d6[_0x26ae('0x4d')]['id']}})[_0x26ae('0x28')](function(_0x367635){return db[_0x26ae('0x74')][_0x26ae('0x75')](function(_0x14ad6f){return _0x367635[_0x26ae('0x6e')](_[_0x26ae('0x48')](_0x2c7797,'id'),{'transaction':_0x14ad6f})[_0x26ae('0x28')](function(){return BPromise[_0x26ae('0x76')](_0x5b8458,function(_0x4362a7){return db[_0x26ae('0x77')][_0x26ae('0x78')]({'where':{'UserId':_0x4362a7['id'],'VoiceQueueId':_0x1e25d6[_0x26ae('0x4d')]['id']},'defaults':{'penalty':_0x4362a7[_0x26ae('0x73')]},'transaction':_0x14ad6f});});})['then'](function(){return BPromise['each'](_[_0x26ae('0x46')](_0x5b8458,{'online':!![]}),function(_0x437b58){return db[_0x26ae('0x79')][_0x26ae('0x7a')]({'membername':_0x437b58['name'],'UserId':_0x437b58['id'],'queue_name':_0x367635['name'],'VoiceQueueId':_0x367635['id'],'interface':_['isNil'](_0x437b58['interface'])?util[_0x26ae('0x7b')](_0x26ae('0x7c'),_0x437b58[_0x26ae('0x31')]):_0x437b58['interface'],'paused':_0x437b58['voicePause']||![],'penalty':_0x437b58['penalty']},{'transaction':_0x14ad6f});});})[_0x26ae('0x28')](function(){_0x5b8458['forEach'](function(_0x5b218e){socket[_0x26ae('0x7d')](_0x26ae('0x7e'),{'UserId':_0x5b218e['id'],'VoiceQueueId':_0x367635['id']});});});});});}})[_0x26ae('0x28')](respondWithStatusCode(_0x342c37,null))[_0x26ae('0x51')](handleError(_0x342c37,null));};exports['removeTeams']=function(_0xf0e913,_0x1d4f2e,_0x1cc74e){return db[_0x26ae('0x6d')][_0x26ae('0x4b')]({'where':{'id':_0xf0e913['query'][_0x26ae('0x7f')]},'attributes':['id'],'include':[{'model':db[_0x26ae('0x6f')],'as':_0x26ae('0x70'),'attributes':['id'],'raw':!![]}]})[_0x26ae('0x28')](handleEntityNotFound(_0x1d4f2e,null))[_0x26ae('0x28')](function(_0x3a59dd){var _0x187337=_['map'](_0x3a59dd,'id');var _0x25bb82=[];var _0x47e760=[];var _0x50a8cd=squel[_0x26ae('0x80')]();_0x50a8cd[_0x26ae('0x81')](_0x26ae('0x82'))[_0x26ae('0x83')](_0x26ae('0x84'),'tq')[_0x26ae('0x85')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x26ae('0x44')](_0x26ae('0x86'),_0xf0e913[_0x26ae('0x4d')]['id']);for(var _0x114a4b=0x0;_0x114a4b<_0x3a59dd[_0x26ae('0x40')];_0x114a4b+=0x1){let _0x2e8ff9=_0x3a59dd[_0x114a4b];for(var _0x123d9d=0x0;_0x123d9d<_0x2e8ff9['Agents']['length'];_0x123d9d+=0x1){let _0x574330=_0x2e8ff9[_0x26ae('0x70')][_0x123d9d];var _0x4d7966=_0x50a8cd[_0x26ae('0x5b')]();_0x4d7966[_0x26ae('0x44')](_0x26ae('0x87'),_0x574330['id']);_0x47e760[_0x26ae('0x88')](db[_0x26ae('0x74')][_0x26ae('0x3a')](_0x4d7966[_0x26ae('0x89')](),{'type':db[_0x26ae('0x74')][_0x26ae('0x8a')][_0x26ae('0x8b')]})[_0x26ae('0x28')](function(_0x313495){if(_0x313495['length']===0x1){return _0x574330['id'];}else{var _0x43921a=_['every'](_[_0x26ae('0x48')](_0x313495,_0x26ae('0x8c')),function(_0x1dce9c){return _[_0x26ae('0x2f')](_0x187337,_0x1dce9c);});if(_0x43921a){return _0x574330['id'];}}}));}}return BPromise[_0x26ae('0x8d')](_0x47e760)[_0x26ae('0x28')](function(_0x165954){_0x25bb82=_(_0x25bb82)['union'](_0x165954)[_0x26ae('0x8e')]()[_0x26ae('0x2e')]();return db[_0x26ae('0x37')][_0x26ae('0x50')]({'where':{'id':_0xf0e913[_0x26ae('0x4d')]['id']}})[_0x26ae('0x28')](function(_0x231d72){return db[_0x26ae('0x74')]['transaction'](function(_0x4afd3f){return _0x231d72['removeTeams'](_0xf0e913[_0x26ae('0x3a')]['ids'],{'transaction':_0x4afd3f})[_0x26ae('0x28')](function(){if(!_['isEmpty'](_0x25bb82)){return _0x231d72['removeAgents'](_0x25bb82,{'transaction':_0x4afd3f})[_0x26ae('0x28')](function(){return db[_0x26ae('0x79')]['destroy']({'where':{'VoiceQueueId':_0xf0e913[_0x26ae('0x4d')]['id'],'UserId':_0x25bb82},'transaction':_0x4afd3f});});}})[_0x26ae('0x28')](function(){_0x25bb82['forEach'](function(_0x16f958){socket[_0x26ae('0x7d')](_0x26ae('0x8f'),{'UserId':_0x16f958,'VoiceQueueId':_0x231d72['id']});});});});});});})[_0x26ae('0x28')](respondWithStatusCode(_0x1d4f2e,null))[_0x26ae('0x51')](handleError(_0x1d4f2e,null));};exports[_0x26ae('0x90')]=function(_0x33e260,_0x4dfad4,_0x1102ff){var _0x275c4f,_0x1567bb;return db['VoiceQueue'][_0x26ae('0x50')]({'where':{'id':_0x33e260[_0x26ae('0x4d')]['id']}})[_0x26ae('0x28')](handleEntityNotFound(_0x4dfad4,null))[_0x26ae('0x28')](function(_0x1923bb){if(_0x1923bb){_0x1567bb=_0x1923bb;return _0x1923bb[_0x26ae('0x90')](_0x33e260[_0x26ae('0x53')][_0x26ae('0x7f')],_[_0x26ae('0x5c')](_0x33e260[_0x26ae('0x53')],[_0x26ae('0x7f'),'id'])||{})[_0x26ae('0x91')](function(_0x4cfbe9){for(var _0xc0638d=0x0;_0xc0638d<_0x33e260[_0x26ae('0x53')]['ids']['length'];_0xc0638d+=0x1){socket[_0x26ae('0x7d')](_0x26ae('0x7e'),{'UserId':_0x33e260['body'][_0x26ae('0x7f')][_0xc0638d],'VoiceQueueId':_0x33e260[_0x26ae('0x4d')]['id']});}return _0x4cfbe9;});}})[_0x26ae('0x28')](function(_0x3d31ae){_0x275c4f=_0x3d31ae||[];if(_0x1567bb){return db['User']['findAll']({'where':{'id':_0x33e260['body'][_0x26ae('0x7f')]},'attributes':['id',_0x26ae('0x31'),_0x26ae('0x92'),_0x26ae('0x93'),_0x26ae('0x71')],'raw':!![]});}})[_0x26ae('0x28')](function(_0x97cea7){if(!_[_0x26ae('0x94')](_0x97cea7)){var _0x54ba51=[];for(var _0x2889b5=0x0;_0x2889b5<_0x97cea7[_0x26ae('0x40')];_0x2889b5++){if(_0x97cea7[_0x2889b5][_0x26ae('0x92')]){_0x54ba51[_0x26ae('0x88')](db[_0x26ae('0x79')][_0x26ae('0x7a')]({'membername':_0x97cea7[_0x2889b5]['name'],'UserId':_0x97cea7[_0x2889b5]['id'],'queue_name':_0x1567bb[_0x26ae('0x31')],'VoiceQueueId':_0x1567bb['id'],'interface':_[_0x26ae('0x95')](_0x97cea7[_0x2889b5]['interface'])?util[_0x26ae('0x7b')](_0x26ae('0x7c'),_0x97cea7[_0x2889b5][_0x26ae('0x31')]):_0x97cea7[_0x2889b5][_0x26ae('0x71')],'paused':_0x97cea7[_0x2889b5][_0x26ae('0x93')]||![],'penalty':_0x33e260[_0x26ae('0x53')][_0x26ae('0x73')]||0x0}));}}return BPromise[_0x26ae('0x8d')](_0x54ba51);}})['then'](function(){return _0x275c4f;})['then'](respondWithResult(_0x4dfad4,null))[_0x26ae('0x51')](handleError(_0x4dfad4,null));};exports[_0x26ae('0x96')]=function(_0x56139e,_0x2e45e9,_0xe60259){return db['VoiceQueue'][_0x26ae('0x50')]({'where':{'id':_0x56139e['params']['id']}})[_0x26ae('0x28')](handleEntityNotFound(_0x2e45e9,null))['then'](function(_0xdafb12){if(_0xdafb12){return _0xdafb12[_0x26ae('0x96')](_0x56139e[_0x26ae('0x3a')]['ids'])[_0x26ae('0x28')](function(){if(_[_0x26ae('0x97')](_0x56139e[_0x26ae('0x3a')][_0x26ae('0x7f')])){for(var _0x2519c8=0x0;_0x2519c8<_0x56139e[_0x26ae('0x3a')][_0x26ae('0x7f')]['length'];_0x2519c8+=0x1){socket[_0x26ae('0x7d')](_0x26ae('0x8f'),{'UserId':Number(_0x56139e[_0x26ae('0x3a')][_0x26ae('0x7f')][_0x2519c8]),'VoiceQueueId':Number(_0x56139e['params']['id'])});}}else{socket[_0x26ae('0x7d')](_0x26ae('0x8f'),{'UserId':Number(_0x56139e[_0x26ae('0x3a')][_0x26ae('0x7f')]),'VoiceQueueId':Number(_0x56139e[_0x26ae('0x4d')]['id'])});}});}})[_0x26ae('0x28')](function(_0x1c4e14){return db[_0x26ae('0x79')][_0x26ae('0x29')]({'where':{'VoiceQueueId':_0x56139e['params']['id'],'UserId':_0x56139e[_0x26ae('0x3a')]['ids']}})[_0x26ae('0x28')](function(){return _0x1c4e14;});})[_0x26ae('0x28')](respondWithStatusCode(_0x2e45e9,null))[_0x26ae('0x51')](handleError(_0x2e45e9,null));};exports[_0x26ae('0x98')]=function(_0x49d4cf,_0x281578,_0x3217bf){var _0x16cbb9={};var _0xdbe92b={};var _0x14115a;var _0x120e71;return db['VoiceQueue'][_0x26ae('0x62')]({'where':{'id':_0x49d4cf['params']['id']}})[_0x26ae('0x28')](handleEntityNotFound(_0x281578,null))[_0x26ae('0x28')](function(_0x46c7c2){if(_0x46c7c2){_0x14115a=_0x46c7c2;_0xdbe92b[_0x26ae('0x3d')]=_[_0x26ae('0x39')](db[_0x26ae('0x6f')]['rawAttributes']);_0xdbe92b[_0x26ae('0x3a')]=_['keys'](_0x49d4cf[_0x26ae('0x3a')]);_0xdbe92b[_0x26ae('0x3b')]=_[_0x26ae('0x3c')](_0xdbe92b[_0x26ae('0x3d')],_0xdbe92b[_0x26ae('0x3a')]);_0x16cbb9[_0x26ae('0x3e')]=_[_0x26ae('0x3c')](_0xdbe92b[_0x26ae('0x3d')],qs['fields'](_0x49d4cf['query']['fields']));_0x16cbb9[_0x26ae('0x3e')]=_0x16cbb9[_0x26ae('0x3e')][_0x26ae('0x40')]?_0x16cbb9[_0x26ae('0x3e')]:_0xdbe92b[_0x26ae('0x3d')];_0x16cbb9[_0x26ae('0x43')]=qs[_0x26ae('0x63')](_0x49d4cf[_0x26ae('0x3a')][_0x26ae('0x63')]);_0x16cbb9[_0x26ae('0x44')]=qs[_0x26ae('0x3b')](_[_0x26ae('0x45')](_0x49d4cf['query'],_0xdbe92b[_0x26ae('0x3b')]));if(_0x49d4cf[_0x26ae('0x3a')][_0x26ae('0x46')]){_0x16cbb9['where']=_[_0x26ae('0x47')](_0x16cbb9['where'],{'$or':_[_0x26ae('0x48')](_0x16cbb9[_0x26ae('0x3e')],function(_0x2a8a62){var _0x2cf3f4={};_0x2cf3f4[_0x2a8a62]={'$like':'%'+_0x49d4cf[_0x26ae('0x3a')][_0x26ae('0x46')]+'%'};return _0x2cf3f4;})});}_0x16cbb9=_[_0x26ae('0x47')]({},_0x16cbb9,_0x49d4cf['options']);return _0x14115a[_0x26ae('0x98')](_0x16cbb9);}})[_0x26ae('0x28')](function(_0x2d5848){if(_0x2d5848){_0x120e71=_0x2d5848[_0x26ae('0x40')];if(!_0x49d4cf[_0x26ae('0x3a')]['hasOwnProperty'](_0x26ae('0x42'))){_0x16cbb9[_0x26ae('0x24')]=qs[_0x26ae('0x24')](_0x49d4cf[_0x26ae('0x3a')][_0x26ae('0x24')]);_0x16cbb9[_0x26ae('0x23')]=qs['offset'](_0x49d4cf['query'][_0x26ae('0x23')]);}return _0x14115a[_0x26ae('0x98')](_0x16cbb9);}})['then'](function(_0x297380){if(_0x297380){return _0x297380?{'count':_0x120e71,'rows':_0x297380}:null;}})[_0x26ae('0x28')](respondWithResult(_0x281578,null))['catch'](handleError(_0x281578,null));};exports[_0x26ae('0x99')]=function(_0x5507ce,_0x396848,_0x103fee){var _0x56b6ed={};var _0x2681f2={};var _0x346976;var _0x2c7b67;return db[_0x26ae('0x37')][_0x26ae('0x62')]({'where':{'id':_0x5507ce[_0x26ae('0x4d')]['id']}})[_0x26ae('0x28')](handleEntityNotFound(_0x396848,null))[_0x26ae('0x28')](function(_0x19f280){if(_0x19f280){_0x346976=_0x19f280;_0x2681f2[_0x26ae('0x3d')]=_[_0x26ae('0x39')](db[_0x26ae('0x79')][_0x26ae('0x38')]);_0x2681f2[_0x26ae('0x3a')]=_[_0x26ae('0x39')](_0x5507ce[_0x26ae('0x3a')]);_0x2681f2[_0x26ae('0x3b')]=_['intersection'](_0x2681f2[_0x26ae('0x3d')],_0x2681f2[_0x26ae('0x3a')]);_0x56b6ed['attributes']=_[_0x26ae('0x3c')](_0x2681f2[_0x26ae('0x3d')],qs['fields'](_0x5507ce[_0x26ae('0x3a')][_0x26ae('0x3f')]));_0x56b6ed[_0x26ae('0x3e')]=_0x56b6ed[_0x26ae('0x3e')][_0x26ae('0x40')]?_0x56b6ed['attributes']:_0x2681f2[_0x26ae('0x3d')];_0x56b6ed[_0x26ae('0x43')]=qs[_0x26ae('0x63')](_0x5507ce[_0x26ae('0x3a')][_0x26ae('0x63')]);_0x56b6ed[_0x26ae('0x44')]=qs[_0x26ae('0x3b')](_['pick'](_0x5507ce['query'],_0x2681f2[_0x26ae('0x3b')]));if(_0x5507ce[_0x26ae('0x3a')][_0x26ae('0x46')]){_0x56b6ed['where']=_[_0x26ae('0x47')](_0x56b6ed['where'],{'$or':_[_0x26ae('0x48')](_0x56b6ed[_0x26ae('0x3e')],function(_0x4f9128){var _0x5b256c={};_0x5b256c[_0x4f9128]={'$like':'%'+_0x5507ce[_0x26ae('0x3a')][_0x26ae('0x46')]+'%'};return _0x5b256c;})});}_0x56b6ed=_['merge']({},_0x56b6ed,_0x5507ce['options']);return _0x346976['getMembers'](_0x56b6ed);}})[_0x26ae('0x28')](function(_0x11a468){if(_0x11a468){_0x2c7b67=_0x11a468[_0x26ae('0x40')];if(!_0x5507ce[_0x26ae('0x3a')]['hasOwnProperty'](_0x26ae('0x42'))){_0x56b6ed[_0x26ae('0x24')]=qs[_0x26ae('0x24')](_0x5507ce['query']['limit']);_0x56b6ed[_0x26ae('0x23')]=qs[_0x26ae('0x23')](_0x5507ce['query'][_0x26ae('0x23')]);}return _0x346976[_0x26ae('0x99')](_0x56b6ed);}})[_0x26ae('0x28')](function(_0x26af9a){return _0x26af9a?{'count':_0x2c7b67,'rows':_0x26af9a}:null;})[_0x26ae('0x28')](respondWithResult(_0x396848,null))[_0x26ae('0x51')](handleError(_0x396848,null));};exports[_0x26ae('0x9a')]=function(_0x387d64,_0xcf44,_0x7a93d8){var _0x2f52ec={};var _0x5dc4d0={};var _0xf06716;var _0xab66f9;return db[_0x26ae('0x37')][_0x26ae('0x62')]({'where':{'id':_0x387d64[_0x26ae('0x4d')]['id']}})[_0x26ae('0x28')](handleEntityNotFound(_0xcf44,null))[_0x26ae('0x28')](function(_0x1718d0){if(_0x1718d0){_0xf06716=_0x1718d0;_0x5dc4d0[_0x26ae('0x3d')]=_[_0x26ae('0x39')](db[_0x26ae('0x9b')][_0x26ae('0x38')]);_0x5dc4d0[_0x26ae('0x3a')]=_['keys'](_0x387d64['query']);_0x5dc4d0[_0x26ae('0x3b')]=_[_0x26ae('0x3c')](_0x5dc4d0[_0x26ae('0x3d')],_0x5dc4d0[_0x26ae('0x3a')]);_0x2f52ec[_0x26ae('0x3e')]=_[_0x26ae('0x3c')](_0x5dc4d0['model'],qs['fields'](_0x387d64['query']['fields']));_0x2f52ec[_0x26ae('0x3e')]=_0x2f52ec['attributes'][_0x26ae('0x40')]?_0x2f52ec[_0x26ae('0x3e')]:_0x5dc4d0[_0x26ae('0x3d')];_0x2f52ec[_0x26ae('0x43')]=qs[_0x26ae('0x63')](_0x387d64[_0x26ae('0x3a')][_0x26ae('0x63')]);_0x2f52ec[_0x26ae('0x44')]=qs[_0x26ae('0x3b')](_[_0x26ae('0x45')](_0x387d64['query'],_0x5dc4d0[_0x26ae('0x3b')]));if(_0x387d64[_0x26ae('0x3a')]['filter']){_0x2f52ec[_0x26ae('0x44')]=_['merge'](_0x2f52ec[_0x26ae('0x44')],{'$or':_[_0x26ae('0x48')](_0x2f52ec[_0x26ae('0x3e')],function(_0x36c6bd){var _0x3a59cc={};_0x3a59cc[_0x36c6bd]={'$like':'%'+_0x387d64[_0x26ae('0x3a')][_0x26ae('0x46')]+'%'};return _0x3a59cc;})});}_0x2f52ec=_[_0x26ae('0x47')]({},_0x2f52ec,_0x387d64[_0x26ae('0x4a')]);return _0xf06716[_0x26ae('0x9a')](_0x2f52ec);}})[_0x26ae('0x28')](function(_0x3038fc){if(_0x3038fc){_0xab66f9=_0x3038fc['length'];if(!_0x387d64[_0x26ae('0x3a')][_0x26ae('0x41')]('nolimit')){_0x2f52ec[_0x26ae('0x24')]=qs[_0x26ae('0x24')](_0x387d64['query'][_0x26ae('0x24')]);_0x2f52ec[_0x26ae('0x23')]=qs['offset'](_0x387d64[_0x26ae('0x3a')]['offset']);}return _0xf06716[_0x26ae('0x9a')](_0x2f52ec);}})[_0x26ae('0x28')](function(_0x45f911){if(_0x45f911){return _0x45f911?{'count':_0xab66f9,'rows':_0x45f911}:null;}})[_0x26ae('0x28')](respondWithResult(_0xcf44,null))[_0x26ae('0x51')](handleError(_0xcf44,null));};exports['addLists']=function(_0x4a5123,_0x4c6279,_0x4329b1){var _0x3245b7,_0x2aff90;return db[_0x26ae('0x37')][_0x26ae('0x50')]({'where':{'id':_0x4a5123[_0x26ae('0x4d')]['id']}})[_0x26ae('0x28')](handleEntityNotFound(_0x4c6279,null))[_0x26ae('0x28')](function(_0x353bf1){if(_0x353bf1){_0x2aff90=_0x353bf1;return _0x353bf1[_0x26ae('0x9c')](_0x4a5123[_0x26ae('0x53')][_0x26ae('0x7f')],_[_0x26ae('0x5c')](_0x4a5123[_0x26ae('0x53')],['ids','id'])||{});}return null;})[_0x26ae('0x91')](function(_0x440e86){var _0x3eddf9;_0x3245b7=_0x440e86||[];var _0x492c17=[];if(_0x440e86){for(var _0x120647=0x0;_0x120647<_0x440e86['length'];_0x120647+=0x1){var _0x1173b5=_0x440e86[_0x120647][_0x26ae('0x54')]({'plain':!![]});_0x2aff90[_0x26ae('0x9d')]=_0x4a5123[_0x26ae('0x53')][_0x26ae('0x9d')]?_0x4a5123[_0x26ae('0x53')][_0x26ae('0x9d')]:_0x2aff90[_0x26ae('0x9d')];switch(_0x2aff90[_0x26ae('0x9d')]){case _0x26ae('0x9e'):_0x3eddf9=squel[_0x26ae('0x9f')]()[_0x26ae('0xa0')](_0x26ae('0xa1'))[_0x26ae('0xa2')]([_0x26ae('0xa3'),_0x26ae('0xa4'),_0x26ae('0xa5'),_0x26ae('0xa6'),_0x26ae('0x67'),_0x26ae('0x5e'),'updatedAt'],squel['select']()[_0x26ae('0x81')](_0x26ae('0xa3'),_0x26ae('0xa3'))[_0x26ae('0x81')](_0x26ae('0xa7'),_0x26ae('0xa4'))[_0x26ae('0x81')]('id',_0x26ae('0xa5'))[_0x26ae('0x81')](_0x1173b5[_0x26ae('0xa8')][_0x26ae('0x89')](),_0x26ae('0xa6'))[_0x26ae('0x81')](_0x4a5123[_0x26ae('0x4d')]['id'][_0x26ae('0x89')](),_0x26ae('0x67'))['field'](_0x26ae('0xa7'),'createdAt')[_0x26ae('0x81')]('NOW()',_0x26ae('0x5d'))[_0x26ae('0x83')](_0x26ae('0xa9'))[_0x26ae('0x44')](_0x26ae('0xaa'))[_0x26ae('0x44')]('ListId\x20=\x20?',_0x1173b5['CmListId'][_0x26ae('0x89')]())[_0x26ae('0x44')](_0x26ae('0xab'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x26ae('0x80')]()[_0x26ae('0x81')](_0x26ae('0xac'))[_0x26ae('0x83')](_0x26ae('0xad'))['where'](_0x26ae('0x86'),_0x4a5123['params']['id']['toString']()))[_0x26ae('0x44')](_0x26ae('0xae'),squel['select']()['field'](_0x26ae('0xaf'))[_0x26ae('0x83')]('cm_hopper')[_0x26ae('0x44')](_0x26ae('0x86'),_0x4a5123['params']['id']['toString']())))[_0x26ae('0x89')]();break;case _0x26ae('0xb0'):_0x3eddf9=squel[_0x26ae('0x9f')]()['into']('cm_hopper')['fromQuery']([_0x26ae('0xa3'),'scheduledAt',_0x26ae('0xa5'),_0x26ae('0xa6'),_0x26ae('0x67'),_0x26ae('0x5e'),_0x26ae('0x5d')],squel['select']()[_0x26ae('0x81')](_0x26ae('0xa3'),_0x26ae('0xa3'))[_0x26ae('0x81')](_0x26ae('0xa7'),_0x26ae('0xa4'))[_0x26ae('0x81')]('id',_0x26ae('0xa5'))[_0x26ae('0x81')](_0x1173b5[_0x26ae('0xa8')]['toString'](),'ListId')[_0x26ae('0x81')](_0x4a5123[_0x26ae('0x4d')]['id'][_0x26ae('0x89')](),'VoiceQueueId')[_0x26ae('0x81')](_0x26ae('0xa7'),_0x26ae('0x5e'))[_0x26ae('0x81')](_0x26ae('0xa7'),_0x26ae('0x5d'))['from'](_0x26ae('0xa9'))['where'](_0x26ae('0xaa'))[_0x26ae('0x44')]('ListId\x20=\x20?',_0x1173b5['CmListId'][_0x26ae('0x89')]())[_0x26ae('0x44')]('phone\x20IS\x20NOT\x20NULL')[_0x26ae('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x26ae('0x80')]()['field'](_0x26ae('0xaf'))['from'](_0x26ae('0xa1'))[_0x26ae('0x44')](_0x26ae('0x86'),_0x4a5123[_0x26ae('0x4d')]['id'][_0x26ae('0x89')]())))[_0x26ae('0x89')]();break;default:_0x3eddf9=squel[_0x26ae('0x9f')]()['into'](_0x26ae('0xa1'))[_0x26ae('0xa2')](['phone','scheduledAt',_0x26ae('0xa5'),_0x26ae('0xa6'),_0x26ae('0x67'),_0x26ae('0x5e'),_0x26ae('0x5d')],squel['select']()[_0x26ae('0x81')]('phone',_0x26ae('0xa3'))['field'](_0x26ae('0xa7'),'scheduledAt')['field']('id',_0x26ae('0xa5'))[_0x26ae('0x81')](_0x1173b5['CmListId']['toString'](),'ListId')[_0x26ae('0x81')](_0x4a5123[_0x26ae('0x4d')]['id'][_0x26ae('0x89')](),_0x26ae('0x67'))[_0x26ae('0x81')](_0x26ae('0xa7'),'createdAt')[_0x26ae('0x81')](_0x26ae('0xa7'),_0x26ae('0x5d'))[_0x26ae('0x83')](_0x26ae('0xa9'))[_0x26ae('0x44')](_0x26ae('0xaa'))[_0x26ae('0x44')](_0x26ae('0xb1'),_0x1173b5[_0x26ae('0xa8')][_0x26ae('0x89')]())[_0x26ae('0x44')](_0x26ae('0xab')))['toString']();}_0x492c17[_0x26ae('0x88')](db['sequelize'][_0x26ae('0x3a')](_0x3eddf9));}return BPromise[_0x26ae('0x8d')](_0x492c17);}})['then'](function(){return _0x3245b7;})[_0x26ae('0x28')](respondWithResult(_0x4c6279,null))[_0x26ae('0x51')](handleError(_0x4c6279,null));};exports[_0x26ae('0xb2')]=function(_0x3da362,_0x178da7,_0x255161){return db['VoiceQueue'][_0x26ae('0x50')]({'where':{'id':_0x3da362['params']['id']}})[_0x26ae('0x28')](handleEntityNotFound(_0x178da7,null))[_0x26ae('0x28')](function(_0xe7db05){if(_0xe7db05){return _0xe7db05[_0x26ae('0xb2')](_0x3da362[_0x26ae('0x3a')][_0x26ae('0x7f')]);}})[_0x26ae('0x28')](function(_0x478615){if(_0x478615){return db['CmHopper'][_0x26ae('0x29')]({'where':{'ListId':_0x3da362[_0x26ae('0x3a')][_0x26ae('0x7f')],'VoiceQueueId':_0x3da362[_0x26ae('0x4d')]['id']}})[_0x26ae('0x28')](function(){return _0x478615;});}})[_0x26ae('0x28')](respondWithStatusCode(_0x178da7,null))['catch'](handleError(_0x178da7,null));};exports['getBlackLists']=function(_0x3498d0,_0x4d4c51,_0x3ad5b2){var _0x15c4b5={};var _0x3941c9={};var _0x9a5a94;var _0x3d5eee;return db[_0x26ae('0x37')][_0x26ae('0x62')]({'where':{'id':_0x3498d0['params']['id']}})[_0x26ae('0x28')](handleEntityNotFound(_0x4d4c51,null))[_0x26ae('0x28')](function(_0x4ba28e){if(_0x4ba28e){_0x9a5a94=_0x4ba28e;_0x3941c9['model']=_[_0x26ae('0x39')](db['CmList'][_0x26ae('0x38')]);_0x3941c9['query']=_[_0x26ae('0x39')](_0x3498d0[_0x26ae('0x3a')]);_0x3941c9[_0x26ae('0x3b')]=_['intersection'](_0x3941c9['model'],_0x3941c9[_0x26ae('0x3a')]);_0x15c4b5['attributes']=_[_0x26ae('0x3c')](_0x3941c9['model'],qs['fields'](_0x3498d0[_0x26ae('0x3a')][_0x26ae('0x3f')]));_0x15c4b5[_0x26ae('0x3e')]=_0x15c4b5[_0x26ae('0x3e')][_0x26ae('0x40')]?_0x15c4b5[_0x26ae('0x3e')]:_0x3941c9[_0x26ae('0x3d')];_0x15c4b5[_0x26ae('0x43')]=qs[_0x26ae('0x63')](_0x3498d0[_0x26ae('0x3a')]['sort']);_0x15c4b5[_0x26ae('0x44')]=qs[_0x26ae('0x3b')](_[_0x26ae('0x45')](_0x3498d0[_0x26ae('0x3a')],_0x3941c9['filters']));if(_0x3498d0[_0x26ae('0x3a')]['filter']){_0x15c4b5['where']=_['merge'](_0x15c4b5[_0x26ae('0x44')],{'$or':_[_0x26ae('0x48')](_0x15c4b5[_0x26ae('0x3e')],function(_0x1bbd13){var _0x3508a5={};_0x3508a5[_0x1bbd13]={'$like':'%'+_0x3498d0[_0x26ae('0x3a')][_0x26ae('0x46')]+'%'};return _0x3508a5;})});}_0x15c4b5=_[_0x26ae('0x47')]({},_0x15c4b5,_0x3498d0[_0x26ae('0x4a')]);return _0x9a5a94[_0x26ae('0xb3')](_0x15c4b5);}})[_0x26ae('0x28')](function(_0x2223b7){if(_0x2223b7){_0x3d5eee=_0x2223b7[_0x26ae('0x40')];if(!_0x3498d0[_0x26ae('0x3a')][_0x26ae('0x41')](_0x26ae('0x42'))){_0x15c4b5[_0x26ae('0x24')]=qs[_0x26ae('0x24')](_0x3498d0[_0x26ae('0x3a')]['limit']);_0x15c4b5['offset']=qs[_0x26ae('0x23')](_0x3498d0[_0x26ae('0x3a')][_0x26ae('0x23')]);}return _0x9a5a94[_0x26ae('0xb3')](_0x15c4b5);}})[_0x26ae('0x28')](function(_0x3b3a62){if(_0x3b3a62){return _0x3b3a62?{'count':_0x3d5eee,'rows':_0x3b3a62}:null;}})[_0x26ae('0x28')](respondWithResult(_0x4d4c51,null))['catch'](handleError(_0x4d4c51,null));};exports[_0x26ae('0xb4')]=function(_0x4df083,_0x1e77fe,_0x11463a){var _0x18b15b,_0x48619b;return db[_0x26ae('0x37')][_0x26ae('0x50')]({'where':{'id':_0x4df083[_0x26ae('0x4d')]['id']}})[_0x26ae('0x28')](handleEntityNotFound(_0x1e77fe,null))[_0x26ae('0x28')](function(_0x3044ce){if(_0x3044ce){_0x48619b=_0x3044ce;return _0x3044ce[_0x26ae('0xb4')](_0x4df083[_0x26ae('0x53')][_0x26ae('0x7f')],_['omit'](_0x4df083[_0x26ae('0x53')],[_0x26ae('0x7f'),'id'])||{});}return null;})['spread'](function(_0x3174c1){var _0x55eae2;_0x18b15b=_0x3174c1||[];var _0x3d4131=[];if(_0x3174c1){for(var _0x489066=0x0;_0x489066<_0x3174c1[_0x26ae('0x40')];_0x489066+=0x1){var _0x215863=_0x3174c1[_0x489066][_0x26ae('0x54')]({'plain':!![]});_0x55eae2=squel[_0x26ae('0x9f')]()[_0x26ae('0xa0')](_0x26ae('0xb5'))[_0x26ae('0xa2')]([_0x26ae('0xa3'),_0x26ae('0xa5'),_0x26ae('0xa6'),'VoiceQueueId',_0x26ae('0x5e'),_0x26ae('0x5d')],squel[_0x26ae('0x80')]()[_0x26ae('0x81')](_0x26ae('0xa3'),'phone')[_0x26ae('0x81')]('id',_0x26ae('0xa5'))[_0x26ae('0x81')](_0x215863[_0x26ae('0xa8')][_0x26ae('0x89')](),_0x26ae('0xa6'))[_0x26ae('0x81')](_0x4df083[_0x26ae('0x4d')]['id'][_0x26ae('0x89')](),_0x26ae('0x67'))[_0x26ae('0x81')](_0x26ae('0xa7'),'createdAt')['field'](_0x26ae('0xa7'),_0x26ae('0x5d'))[_0x26ae('0x83')](_0x26ae('0xa9'))[_0x26ae('0x44')](_0x26ae('0xaa'))[_0x26ae('0x44')](_0x26ae('0xb1'),_0x215863[_0x26ae('0xa8')][_0x26ae('0x89')]())[_0x26ae('0x44')](_0x26ae('0xab')))[_0x26ae('0x89')]();_0x3d4131[_0x26ae('0x88')](db['sequelize'][_0x26ae('0x3a')](_0x55eae2));}return BPromise[_0x26ae('0x8d')](_0x3d4131);}})['then'](function(){return _0x18b15b;})['then'](respondWithResult(_0x1e77fe,null))['catch'](handleError(_0x1e77fe,null));};exports[_0x26ae('0xb6')]=function(_0x2dba04,_0x3d9782,_0x334efc){return db[_0x26ae('0x37')]['find']({'where':{'id':_0x2dba04['params']['id']}})['then'](handleEntityNotFound(_0x3d9782,null))[_0x26ae('0x28')](function(_0x106840){if(_0x106840){return _0x106840[_0x26ae('0xb6')](_0x2dba04[_0x26ae('0x3a')][_0x26ae('0x7f')]);}})[_0x26ae('0x28')](function(_0x564ffe){if(_0x564ffe){return db[_0x26ae('0x6b')]['destroy']({'where':{'ListId':_0x2dba04[_0x26ae('0x3a')][_0x26ae('0x7f')],'VoiceQueueId':_0x2dba04[_0x26ae('0x4d')]['id']}})[_0x26ae('0x28')](function(){return _0x564ffe;});}})[_0x26ae('0x28')](respondWithStatusCode(_0x3d9782,null))['catch'](handleError(_0x3d9782,null));}; \ No newline at end of file +var _0x2dae=['scheduledAt','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./voiceQueue.socket','register','sendStatus','json','count','offset','limit','status','Content-Range','apply','save','update','then','get','VoiceQueues','inbound','QueueCampaigns','filter','ignore','map','value','includes','type','name','UserProfileResource','destroy','end','send','index','VoiceQueue','rawAttributes','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','filters','where','merge','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','find','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','clone','length','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','order','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','voicePause','forEach','penalty','sequelize','transaction','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','interface','format','SIP/%s','ids','select','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','removeTeams','removeAgents','addAgents','spread','emit','userVoiceQueue:save','online','isEmpty','push','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','fromQuery','phone','ContactId','ListId','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','into','cm_hopper'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_0x2dae,0xc3));var _0xe2da=function(_0x4ca6a4,_0x5e9694){_0x4ca6a4=_0x4ca6a4-0x0;var _0x120555=_0x2dae[_0x4ca6a4];return _0x120555;};'use strict';var pdf=require(_0xe2da('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe2da('0x1'));var zipdir=require(_0xe2da('0x2'));var jsonpatch=require(_0xe2da('0x3'));var rp=require(_0xe2da('0x4'));var moment=require(_0xe2da('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe2da('0x6'));var util=require(_0xe2da('0x7'));var path=require(_0xe2da('0x8'));var sox=require(_0xe2da('0x9'));var csv=require('to-csv');var ejs=require(_0xe2da('0xa'));var fs=require('fs');var _=require(_0xe2da('0xb'));var squel=require(_0xe2da('0xc'));var crypto=require(_0xe2da('0xd'));var jsforce=require(_0xe2da('0xe'));var deskjs=require(_0xe2da('0xf'));var toCsv=require(_0xe2da('0x10'));var querystring=require(_0xe2da('0x11'));var Papa=require(_0xe2da('0x12'));var Redis=require('ioredis');var authService=require(_0xe2da('0x13'));var qs=require(_0xe2da('0x14'));var hardwareService=require(_0xe2da('0x15'));var logger=require(_0xe2da('0x16'))(_0xe2da('0x17'));var utils=require(_0xe2da('0x18'));var config=require(_0xe2da('0x19'));var db=require(_0xe2da('0x1a'))['db'];config['redis']=_[_0xe2da('0x1b')](config['redis'],{'host':_0xe2da('0x1c'),'port':0x18eb});var socket=require(_0xe2da('0x1d'))(new Redis(config[_0xe2da('0x1e')]));require(_0xe2da('0x1f'))[_0xe2da('0x20')](socket);function respondWithStatusCode(_0x5660b5,_0x295a86){_0x295a86=_0x295a86||0xcc;return function(_0x48584b){if(_0x48584b){return _0x5660b5[_0xe2da('0x21')](_0x295a86);}return _0x5660b5['status'](_0x295a86)['end']();};}function respondWithResult(_0x403d1c,_0x3dfc52){_0x3dfc52=_0x3dfc52||0xc8;return function(_0x33f919){if(_0x33f919){return _0x403d1c['status'](_0x3dfc52)[_0xe2da('0x22')](_0x33f919);}};}function respondWithFilteredResult(_0x2c0353,_0x2ea60e){return function(_0x33568f){if(_0x33568f){var _0x4e1623=_0x33568f[_0xe2da('0x23')],_0x45bb92=_0x2ea60e[_0xe2da('0x24')],_0x1f7d33=_0x2ea60e['offset']+_0x2ea60e[_0xe2da('0x25')],_0x417363;if(_0x1f7d33>=_0x4e1623){_0x1f7d33=_0x4e1623;_0x417363=0xc8;}else{_0x417363=0xce;}_0x2c0353[_0xe2da('0x26')](_0x417363);return _0x2c0353['set'](_0xe2da('0x27'),_0x45bb92+'-'+_0x1f7d33+'/'+_0x4e1623)[_0xe2da('0x22')](_0x33568f);}return null;};}function patchUpdates(_0x332193){return function(_0x203d36){try{jsonpatch[_0xe2da('0x28')](_0x203d36,_0x332193,!![]);}catch(_0x3e22de){return BPromise['reject'](_0x3e22de);}return _0x203d36[_0xe2da('0x29')]();};}function saveUpdates(_0x53cc4e,_0x30efdc){return function(_0x191d38){if(_0x191d38){return _0x191d38[_0xe2da('0x2a')](_0x53cc4e)[_0xe2da('0x2b')](function(_0x30dea4){return _0x30dea4;});}return null;};}function removeEntity(_0x1e45e9,_0x38f2c4){return function(_0x221e98){if(_0x221e98){return _0x221e98['destroy']()[_0xe2da('0x2b')](function(){var _0x357bff=_0x221e98[_0xe2da('0x2c')]({'plain':!![]});var _0x14704d=[{'name':_0xe2da('0x2d'),'value':_0xe2da('0x2e'),'ignore':![]},{'name':_0xe2da('0x2f'),'value':'outbound','ignore':![]}];var _0x2adc49=_(_0x14704d)[_0xe2da('0x30')](_0xe2da('0x31'))[_0xe2da('0x32')](_0xe2da('0x33'))[_0xe2da('0x33')]();if(_[_0xe2da('0x34')](_0x2adc49,_0x357bff[_0xe2da('0x35')])){return;}var _0x516f42=_['find'](_0x14704d,['value',_0x357bff[_0xe2da('0x35')]])[_0xe2da('0x36')];return db[_0xe2da('0x37')][_0xe2da('0x38')]({'where':{'type':_0x516f42,'resourceId':_0x357bff['id']}})['then'](function(){return _0x221e98;});})['then'](function(){_0x1e45e9[_0xe2da('0x26')](0xcc)[_0xe2da('0x39')]();});}};}function handleEntityNotFound(_0x262d40,_0x39f983){return function(_0x7ab5ee){if(!_0x7ab5ee){_0x262d40[_0xe2da('0x21')](0x194);}return _0x7ab5ee;};}function handleError(_0x195b93,_0xd9bfa9){_0xd9bfa9=_0xd9bfa9||0x1f4;return function(_0x461610){logger['error'](_0x461610['stack']);if(_0x461610[_0xe2da('0x36')]){delete _0x461610[_0xe2da('0x36')];}_0x195b93[_0xe2da('0x26')](_0xd9bfa9)[_0xe2da('0x3a')](_0x461610);};}exports[_0xe2da('0x3b')]=function(_0x27e86d,_0x121cbf){var _0x7fa46c={},_0x28e61a={},_0x46df04={'count':0x0,'rows':[]};var _0x3087a8=db[_0xe2da('0x3c')][_0xe2da('0x3d')];_0x28e61a[_0xe2da('0x3e')]=_[_0xe2da('0x3f')](_0x3087a8);_0x28e61a[_0xe2da('0x40')]=_[_0xe2da('0x3f')](_0x27e86d[_0xe2da('0x40')]);_0x28e61a['filters']=_[_0xe2da('0x41')](_0x28e61a[_0xe2da('0x3e')],_0x28e61a[_0xe2da('0x40')]);_0x7fa46c['attributes']=_[_0xe2da('0x41')](_0x28e61a[_0xe2da('0x3e')],qs[_0xe2da('0x42')](_0x27e86d['query']['fields']));_0x7fa46c[_0xe2da('0x43')]=_0x7fa46c[_0xe2da('0x43')]['length']?_0x7fa46c[_0xe2da('0x43')]:_0x28e61a[_0xe2da('0x3e')];if(!_0x27e86d[_0xe2da('0x40')][_0xe2da('0x44')](_0xe2da('0x45'))){_0x7fa46c['limit']=qs[_0xe2da('0x25')](_0x27e86d['query']['limit']);_0x7fa46c[_0xe2da('0x24')]=qs['offset'](_0x27e86d[_0xe2da('0x40')][_0xe2da('0x24')]);}_0x7fa46c['order']=qs[_0xe2da('0x46')](_0x27e86d[_0xe2da('0x40')]['sort']);_0x7fa46c['where']=qs['filters'](_[_0xe2da('0x47')](_0x27e86d[_0xe2da('0x40')],_0x28e61a[_0xe2da('0x48')]));if(_0x27e86d[_0xe2da('0x40')][_0xe2da('0x30')]){_0x7fa46c[_0xe2da('0x49')]=_[_0xe2da('0x4a')](_0x7fa46c['where'],{'$or':_[_0xe2da('0x32')](_0x3087a8,function(_0x155b27){if(_0x155b27[_0xe2da('0x35')][_0xe2da('0x4b')]!==_0xe2da('0x4c')){var _0x5a1550={};_0x5a1550[_0x155b27[_0xe2da('0x4d')]]={'$like':'%'+_0x27e86d[_0xe2da('0x40')][_0xe2da('0x30')]+'%'};return _0x5a1550;}})});}_0x7fa46c=_['merge']({},_0x7fa46c,_0x27e86d[_0xe2da('0x4e')]);var _0x279f67={'where':_0x7fa46c[_0xe2da('0x49')]};return db[_0xe2da('0x3c')][_0xe2da('0x23')](_0x279f67)[_0xe2da('0x2b')](function(_0x13a4a5){_0x46df04[_0xe2da('0x23')]=_0x13a4a5;if(_0x27e86d['query'][_0xe2da('0x4f')]){_0x7fa46c[_0xe2da('0x50')]=[{'all':!![]}];}return db[_0xe2da('0x3c')][_0xe2da('0x51')](_0x7fa46c);})[_0xe2da('0x2b')](function(_0x4c9a54){_0x46df04[_0xe2da('0x52')]=_0x4c9a54;return _0x46df04;})[_0xe2da('0x2b')](respondWithFilteredResult(_0x121cbf,_0x7fa46c))[_0xe2da('0x53')](handleError(_0x121cbf,null));};exports[_0xe2da('0x54')]=function(_0x33817a,_0x3383cc){var _0x35d207={'raw':![],'where':{'id':_0x33817a[_0xe2da('0x55')]['id']}},_0x4e4070={};_0x4e4070['model']=_[_0xe2da('0x3f')](db[_0xe2da('0x3c')][_0xe2da('0x3d')]);_0x4e4070['query']=_[_0xe2da('0x3f')](_0x33817a[_0xe2da('0x40')]);_0x4e4070['filters']=_[_0xe2da('0x41')](_0x4e4070[_0xe2da('0x3e')],_0x4e4070[_0xe2da('0x40')]);_0x35d207['attributes']=_[_0xe2da('0x41')](_0x4e4070['model'],qs['fields'](_0x33817a[_0xe2da('0x40')]['fields']));_0x35d207[_0xe2da('0x43')]=_0x35d207[_0xe2da('0x43')]['length']?_0x35d207[_0xe2da('0x43')]:_0x4e4070[_0xe2da('0x3e')];if(_0x33817a['query']['includeAll']){_0x35d207[_0xe2da('0x50')]=[{'all':!![]}];}_0x35d207=_['merge']({},_0x35d207,_0x33817a[_0xe2da('0x4e')]);return db[_0xe2da('0x3c')][_0xe2da('0x56')](_0x35d207)[_0xe2da('0x2b')](handleEntityNotFound(_0x3383cc,null))[_0xe2da('0x2b')](respondWithResult(_0x3383cc,null))[_0xe2da('0x53')](handleError(_0x3383cc,null));};exports[_0xe2da('0x57')]=function(_0xaaee6d,_0x1d86a6){return db['VoiceQueue'][_0xe2da('0x57')](_0xaaee6d[_0xe2da('0x58')],{})[_0xe2da('0x2b')](function(_0x50c260){var _0x17b64f=_0xaaee6d[_0xe2da('0x59')][_0xe2da('0x2c')]({'plain':!![]});if(!_0x17b64f)throw new Error(_0xe2da('0x5a'));if(_0x17b64f[_0xe2da('0x5b')]===_0xe2da('0x59')){var _0x246384=_0x50c260['get']({'plain':!![]});var _0x55170d=[{'name':_0xe2da('0x2d'),'value':_0xe2da('0x2e')},{'name':_0xe2da('0x2f'),'value':'outbound'}];var _0x572690=_[_0xe2da('0x56')](_0x55170d,['value',_0x246384[_0xe2da('0x35')]])[_0xe2da('0x36')];return db[_0xe2da('0x5c')][_0xe2da('0x56')]({'where':{'name':_0x572690,'userProfileId':_0x17b64f[_0xe2da('0x5d')]},'raw':!![]})[_0xe2da('0x2b')](function(_0x17be28){if(_0x17be28&&_0x17be28[_0xe2da('0x5e')]===0x0){return db[_0xe2da('0x37')]['create']({'name':_0x246384[_0xe2da('0x36')],'resourceId':_0x246384['id'],'type':_0x17be28[_0xe2da('0x36')],'sectionId':_0x17be28['id']},{})[_0xe2da('0x2b')](function(){return _0x50c260;});}else{return _0x50c260;}})[_0xe2da('0x53')](function(_0x51d174){logger[_0xe2da('0x5f')](_0xe2da('0x60'),_0x51d174);throw _0x51d174;});}return _0x50c260;})[_0xe2da('0x2b')](respondWithResult(_0x1d86a6,0xc9))['catch'](handleError(_0x1d86a6,null));};exports[_0xe2da('0x61')]=function(_0x24cd44,_0x3e6e98){var _0x1dd128={'raw':![],'where':{'id':_0x24cd44[_0xe2da('0x55')]['id']}},_0x188bb0={};_0x188bb0[_0xe2da('0x3e')]=_[_0xe2da('0x3f')](db[_0xe2da('0x3c')][_0xe2da('0x3d')]);_0x1dd128[_0xe2da('0x43')]=_[_0xe2da('0x41')](_0x188bb0['model'],qs[_0xe2da('0x42')](_0x24cd44[_0xe2da('0x40')][_0xe2da('0x42')]));_0x1dd128[_0xe2da('0x43')]=_0x1dd128[_0xe2da('0x43')][_0xe2da('0x62')]?_0x1dd128[_0xe2da('0x43')]:_0x188bb0['model'];if(_0x24cd44[_0xe2da('0x40')]['includeAll']){_0x1dd128[_0xe2da('0x50')]=[{'all':!![]}];}_0x1dd128=_[_0xe2da('0x4a')]({},_0x1dd128,_0x24cd44['options']);return db['VoiceQueue'][_0xe2da('0x56')](_0x1dd128)['then'](handleEntityNotFound(_0x3e6e98,null))[_0xe2da('0x2b')](function(_0x4bf342){if(_0x4bf342){var _0x148615=_0x4bf342[_0xe2da('0x2c')]({'plain':!![]});_0x148615=qs[_0xe2da('0x63')](_0x148615,['id','createdAt','updatedAt']);_0x24cd44['body']=_[_0xe2da('0x63')](_0x24cd44[_0xe2da('0x58')],['id',_0xe2da('0x64'),_0xe2da('0x65')]);return db['VoiceQueue'][_0xe2da('0x57')](_[_0xe2da('0x4a')](_0x148615,_0x24cd44[_0xe2da('0x58')]),{'include':_0x24cd44[_0xe2da('0x40')][_0xe2da('0x4f')]?[{'all':!![]}]:undefined})[_0xe2da('0x2b')](function(_0x407c1a){var _0x57f90a=_0x24cd44[_0xe2da('0x59')][_0xe2da('0x2c')]({'plain':!![]});if(!_0x57f90a)throw new Error(_0xe2da('0x5a'));if(_0x57f90a[_0xe2da('0x5b')]===_0xe2da('0x59')){var _0x4cf58d=_0x407c1a[_0xe2da('0x2c')]({'plain':!![]});var _0x56c488=[{'name':_0xe2da('0x2d'),'value':'inbound'},{'name':_0xe2da('0x2f'),'value':'outbound'}];var _0x58f9db=_[_0xe2da('0x56')](_0x56c488,[_0xe2da('0x33'),_0x4cf58d[_0xe2da('0x35')]])[_0xe2da('0x36')];return db[_0xe2da('0x5c')][_0xe2da('0x56')]({'where':{'name':_0x58f9db,'userProfileId':_0x57f90a[_0xe2da('0x5d')]},'raw':!![]})[_0xe2da('0x2b')](function(_0x3209ea){if(_0x3209ea&&_0x3209ea[_0xe2da('0x5e')]===0x0){return db['UserProfileResource'][_0xe2da('0x57')]({'name':_0x4cf58d[_0xe2da('0x36')],'resourceId':_0x4cf58d['id'],'type':_0x3209ea[_0xe2da('0x36')],'sectionId':_0x3209ea['id']},{})[_0xe2da('0x2b')](function(){return _0x407c1a;});}else{return _0x407c1a;}})['catch'](function(_0xe81698){logger[_0xe2da('0x5f')](_0xe2da('0x60'),_0xe81698);throw _0xe81698;});}return _0x407c1a;});}})[_0xe2da('0x2b')](respondWithResult(_0x3e6e98,0xc9))['catch'](handleError(_0x3e6e98,null));};exports[_0xe2da('0x2a')]=function(_0x57bf38,_0x36431a){if(_0x57bf38[_0xe2da('0x58')]['id']){delete _0x57bf38['body']['id'];}return db[_0xe2da('0x3c')][_0xe2da('0x56')]({'where':{'id':_0x57bf38[_0xe2da('0x55')]['id']}})[_0xe2da('0x2b')](handleEntityNotFound(_0x36431a,null))[_0xe2da('0x2b')](saveUpdates(_0x57bf38['body'],null))[_0xe2da('0x2b')](respondWithResult(_0x36431a,null))['catch'](handleError(_0x36431a,null));};exports['destroy']=function(_0x5af534,_0x5b75b0){return db[_0xe2da('0x3c')][_0xe2da('0x56')]({'where':{'id':_0x5af534[_0xe2da('0x55')]['id']}})[_0xe2da('0x2b')](handleEntityNotFound(_0x5b75b0,null))[_0xe2da('0x2b')](removeEntity(_0x5b75b0,null))[_0xe2da('0x53')](handleError(_0x5b75b0,null));};exports[_0xe2da('0x66')]=function(_0x281d13,_0x406782,_0x56e6bc){var _0x14fc5c={'raw':![],'where':{}};var _0x325248={};var _0x14377d={'count':0x0,'rows':[]};return db[_0xe2da('0x3c')][_0xe2da('0x67')]({'where':{'id':_0x281d13[_0xe2da('0x55')]['id']}})[_0xe2da('0x2b')](handleEntityNotFound(_0x406782,null))[_0xe2da('0x2b')](function(_0x414635){if(_0x414635){_0x325248[_0xe2da('0x3e')]=_['keys'](db[_0xe2da('0x68')][_0xe2da('0x3d')]);_0x325248[_0xe2da('0x40')]=_[_0xe2da('0x3f')](_0x281d13[_0xe2da('0x40')]);_0x325248[_0xe2da('0x48')]=_[_0xe2da('0x41')](_0x325248[_0xe2da('0x3e')],_0x325248[_0xe2da('0x40')]);_0x14fc5c[_0xe2da('0x43')]=_[_0xe2da('0x41')](_0x325248[_0xe2da('0x3e')],qs['fields'](_0x281d13[_0xe2da('0x40')]['fields']));_0x14fc5c[_0xe2da('0x43')]=_0x14fc5c[_0xe2da('0x43')][_0xe2da('0x62')]?_0x14fc5c[_0xe2da('0x43')]:_0x325248[_0xe2da('0x3e')];if(!_0x281d13[_0xe2da('0x40')][_0xe2da('0x44')]('nolimit')){_0x14fc5c[_0xe2da('0x25')]=qs[_0xe2da('0x25')](_0x281d13[_0xe2da('0x40')][_0xe2da('0x25')]);_0x14fc5c[_0xe2da('0x24')]=qs[_0xe2da('0x24')](_0x281d13['query'][_0xe2da('0x24')]);}_0x14fc5c[_0xe2da('0x69')]=qs[_0xe2da('0x46')](_0x281d13[_0xe2da('0x40')][_0xe2da('0x46')]);_0x14fc5c[_0xe2da('0x49')]=qs[_0xe2da('0x48')](_['pick'](_0x281d13[_0xe2da('0x40')],_0x325248[_0xe2da('0x48')]));_0x14fc5c[_0xe2da('0x49')][_0xe2da('0x6a')]=_0x414635['id'];if(_0x281d13[_0xe2da('0x40')][_0xe2da('0x30')]){_0x14fc5c['where']=_[_0xe2da('0x4a')](_0x14fc5c['where'],{'$or':_['map'](_0x14fc5c[_0xe2da('0x43')],function(_0x6b5a99){var _0x4afc18={};_0x4afc18[_0x6b5a99]={'$like':'%'+_0x281d13['query'][_0xe2da('0x30')]+'%'};return _0x4afc18;})});}_0x14fc5c=_[_0xe2da('0x4a')]({},_0x14fc5c,_0x281d13[_0xe2da('0x4e')]);return db[_0xe2da('0x68')]['count']({'where':_0x14fc5c[_0xe2da('0x49')]})['then'](function(_0x4ccff8){_0x14377d[_0xe2da('0x23')]=_0x4ccff8;if(_0x281d13[_0xe2da('0x40')][_0xe2da('0x4f')]){_0x14fc5c[_0xe2da('0x50')]=[{'all':!![]}];}return db[_0xe2da('0x68')][_0xe2da('0x51')](_0x14fc5c);})['then'](function(_0x761f4d){_0x14377d[_0xe2da('0x52')]=_0x761f4d;return _0x14377d;});}})[_0xe2da('0x2b')](respondWithFilteredResult(_0x406782,_0x14fc5c))['catch'](handleError(_0x406782,null));};exports[_0xe2da('0x6b')]=function(_0xfe78a1,_0x232f8a,_0x4af523){var _0x21ac55={'raw':!![],'where':{}};var _0x12667e={};var _0x345b72={'count':0x0,'rows':[]};return db[_0xe2da('0x3c')][_0xe2da('0x67')]({'where':{'id':_0xfe78a1['params']['id']}})[_0xe2da('0x2b')](handleEntityNotFound(_0x232f8a,null))[_0xe2da('0x2b')](function(_0x1c4989){if(_0x1c4989){_0x12667e[_0xe2da('0x3e')]=_[_0xe2da('0x3f')](db[_0xe2da('0x6c')][_0xe2da('0x3d')]);_0x12667e[_0xe2da('0x40')]=_[_0xe2da('0x3f')](_0xfe78a1['query']);_0x12667e[_0xe2da('0x48')]=_[_0xe2da('0x41')](_0x12667e['model'],_0x12667e[_0xe2da('0x40')]);_0x21ac55['attributes']=_['intersection'](_0x12667e['model'],qs[_0xe2da('0x42')](_0xfe78a1[_0xe2da('0x40')]['fields']));_0x21ac55[_0xe2da('0x43')]=_0x21ac55['attributes'][_0xe2da('0x62')]?_0x21ac55[_0xe2da('0x43')]:_0x12667e[_0xe2da('0x3e')];if(!_0xfe78a1[_0xe2da('0x40')][_0xe2da('0x44')](_0xe2da('0x45'))){_0x21ac55[_0xe2da('0x25')]=qs['limit'](_0xfe78a1['query'][_0xe2da('0x25')]);_0x21ac55[_0xe2da('0x24')]=qs[_0xe2da('0x24')](_0xfe78a1[_0xe2da('0x40')]['offset']);}_0x21ac55[_0xe2da('0x69')]=qs['sort'](_0xfe78a1[_0xe2da('0x40')][_0xe2da('0x46')]);_0x21ac55[_0xe2da('0x49')]=qs[_0xe2da('0x48')](_[_0xe2da('0x47')](_0xfe78a1[_0xe2da('0x40')],_0x12667e['filters']));_0x21ac55[_0xe2da('0x49')][_0xe2da('0x6a')]=_0x1c4989['id'];if(_0xfe78a1[_0xe2da('0x40')][_0xe2da('0x30')]){_0x21ac55[_0xe2da('0x49')]=_[_0xe2da('0x4a')](_0x21ac55[_0xe2da('0x49')],{'$or':_[_0xe2da('0x32')](_0x21ac55['attributes'],function(_0x260c58){var _0x4cd3c6={};_0x4cd3c6[_0x260c58]={'$like':'%'+_0xfe78a1[_0xe2da('0x40')][_0xe2da('0x30')]+'%'};return _0x4cd3c6;})});}_0x21ac55=_['merge']({},_0x21ac55,_0xfe78a1['options']);return db[_0xe2da('0x6c')]['count']({'where':_0x21ac55[_0xe2da('0x49')]})[_0xe2da('0x2b')](function(_0x2f879e){_0x345b72['count']=_0x2f879e;if(_0xfe78a1[_0xe2da('0x40')]['includeAll']){_0x21ac55['include']=[{'all':!![]}];}return db[_0xe2da('0x6c')][_0xe2da('0x51')](_0x21ac55);})['then'](function(_0x68f9e1){_0x345b72['rows']=_0x68f9e1;return _0x345b72;});}})[_0xe2da('0x2b')](respondWithFilteredResult(_0x232f8a,_0x21ac55))[_0xe2da('0x53')](handleError(_0x232f8a,null));};exports[_0xe2da('0x6d')]=function(_0x342ae0,_0x283281,_0x58599a){var _0x1f2f94={'raw':!![],'where':{}};var _0x16700b={};var _0x507a27={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xe2da('0x67')]({'where':{'id':_0x342ae0[_0xe2da('0x55')]['id']}})[_0xe2da('0x2b')](handleEntityNotFound(_0x283281,null))[_0xe2da('0x2b')](function(_0x36cf43){if(_0x36cf43){_0x16700b[_0xe2da('0x3e')]=_[_0xe2da('0x3f')](db[_0xe2da('0x6e')]['rawAttributes']);_0x16700b['query']=_[_0xe2da('0x3f')](_0x342ae0['query']);_0x16700b[_0xe2da('0x48')]=_[_0xe2da('0x41')](_0x16700b[_0xe2da('0x3e')],_0x16700b[_0xe2da('0x40')]);_0x1f2f94[_0xe2da('0x43')]=_[_0xe2da('0x41')](_0x16700b[_0xe2da('0x3e')],qs['fields'](_0x342ae0[_0xe2da('0x40')]['fields']));_0x1f2f94[_0xe2da('0x43')]=_0x1f2f94['attributes']['length']?_0x1f2f94[_0xe2da('0x43')]:_0x16700b[_0xe2da('0x3e')];if(!_0x342ae0[_0xe2da('0x40')][_0xe2da('0x44')](_0xe2da('0x45'))){_0x1f2f94[_0xe2da('0x25')]=qs[_0xe2da('0x25')](_0x342ae0['query'][_0xe2da('0x25')]);_0x1f2f94[_0xe2da('0x24')]=qs[_0xe2da('0x24')](_0x342ae0['query'][_0xe2da('0x24')]);}_0x1f2f94['order']=qs['sort'](_0x342ae0[_0xe2da('0x40')][_0xe2da('0x46')]);_0x1f2f94['where']=qs['filters'](_[_0xe2da('0x47')](_0x342ae0['query'],_0x16700b[_0xe2da('0x48')]));_0x1f2f94[_0xe2da('0x49')][_0xe2da('0x6a')]=_0x36cf43['id'];if(_0x342ae0[_0xe2da('0x40')][_0xe2da('0x30')]){_0x1f2f94[_0xe2da('0x49')]=_['merge'](_0x1f2f94[_0xe2da('0x49')],{'$or':_[_0xe2da('0x32')](_0x1f2f94[_0xe2da('0x43')],function(_0x329413){var _0x2360d2={};_0x2360d2[_0x329413]={'$like':'%'+_0x342ae0[_0xe2da('0x40')]['filter']+'%'};return _0x2360d2;})});}_0x1f2f94=_[_0xe2da('0x4a')]({},_0x1f2f94,_0x342ae0[_0xe2da('0x4e')]);return db[_0xe2da('0x6e')]['count']({'where':_0x1f2f94[_0xe2da('0x49')]})[_0xe2da('0x2b')](function(_0x2c3101){_0x507a27[_0xe2da('0x23')]=_0x2c3101;if(_0x342ae0[_0xe2da('0x40')][_0xe2da('0x4f')]){_0x1f2f94['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xe2da('0x51')](_0x1f2f94);})[_0xe2da('0x2b')](function(_0x58d4b7){_0x507a27['rows']=_0x58d4b7;return _0x507a27;});}})[_0xe2da('0x2b')](respondWithFilteredResult(_0x283281,_0x1f2f94))['catch'](handleError(_0x283281,null));};exports[_0xe2da('0x6f')]=function(_0x1c9dc9,_0x56e4c2,_0x38a66e){var _0x40bed1={'raw':!![],'where':{}};var _0x2d2d71={};var _0x3603b1={'count':0x0,'rows':[]};return db[_0xe2da('0x3c')][_0xe2da('0x67')]({'where':{'id':_0x1c9dc9['params']['id']}})[_0xe2da('0x2b')](handleEntityNotFound(_0x56e4c2,null))['then'](function(_0x2bf538){if(_0x2bf538){_0x2d2d71[_0xe2da('0x3e')]=_[_0xe2da('0x3f')](db['CmHopperBlack'][_0xe2da('0x3d')]);_0x2d2d71['query']=_[_0xe2da('0x3f')](_0x1c9dc9['query']);_0x2d2d71['filters']=_[_0xe2da('0x41')](_0x2d2d71['model'],_0x2d2d71[_0xe2da('0x40')]);_0x40bed1[_0xe2da('0x43')]=_[_0xe2da('0x41')](_0x2d2d71[_0xe2da('0x3e')],qs[_0xe2da('0x42')](_0x1c9dc9[_0xe2da('0x40')][_0xe2da('0x42')]));_0x40bed1['attributes']=_0x40bed1['attributes'][_0xe2da('0x62')]?_0x40bed1[_0xe2da('0x43')]:_0x2d2d71[_0xe2da('0x3e')];if(!_0x1c9dc9[_0xe2da('0x40')][_0xe2da('0x44')](_0xe2da('0x45'))){_0x40bed1['limit']=qs['limit'](_0x1c9dc9[_0xe2da('0x40')][_0xe2da('0x25')]);_0x40bed1[_0xe2da('0x24')]=qs['offset'](_0x1c9dc9[_0xe2da('0x40')][_0xe2da('0x24')]);}_0x40bed1[_0xe2da('0x69')]=qs[_0xe2da('0x46')](_0x1c9dc9['query'][_0xe2da('0x46')]);_0x40bed1['where']=qs['filters'](_[_0xe2da('0x47')](_0x1c9dc9['query'],_0x2d2d71['filters']));_0x40bed1[_0xe2da('0x49')][_0xe2da('0x6a')]=_0x2bf538['id'];if(_0x1c9dc9[_0xe2da('0x40')][_0xe2da('0x30')]){_0x40bed1['where']=_[_0xe2da('0x4a')](_0x40bed1['where'],{'$or':_['map'](_0x40bed1['attributes'],function(_0x10a155){var _0x2597d9={};_0x2597d9[_0x10a155]={'$like':'%'+_0x1c9dc9['query'][_0xe2da('0x30')]+'%'};return _0x2597d9;})});}_0x40bed1=_[_0xe2da('0x4a')]({},_0x40bed1,_0x1c9dc9['options']);return db[_0xe2da('0x70')][_0xe2da('0x23')]({'where':_0x40bed1['where']})[_0xe2da('0x2b')](function(_0x5a1eb0){_0x3603b1[_0xe2da('0x23')]=_0x5a1eb0;if(_0x1c9dc9[_0xe2da('0x40')]['includeAll']){_0x40bed1['include']=[{'all':!![]}];}return db[_0xe2da('0x70')][_0xe2da('0x51')](_0x40bed1);})[_0xe2da('0x2b')](function(_0x5a6e1f){_0x3603b1['rows']=_0x5a6e1f;return _0x3603b1;});}})['then'](respondWithFilteredResult(_0x56e4c2,_0x40bed1))['catch'](handleError(_0x56e4c2,null));};exports[_0xe2da('0x71')]=function(_0x3fc83f,_0x13f4bb,_0x1d826d){var _0x959f4e={};var _0x6c815b={};var _0xc01fb9;var _0x3b8aaa;return db[_0xe2da('0x3c')][_0xe2da('0x67')]({'where':{'id':_0x3fc83f[_0xe2da('0x55')]['id']}})[_0xe2da('0x2b')](handleEntityNotFound(_0x13f4bb,null))['then'](function(_0x3af398){if(_0x3af398){_0xc01fb9=_0x3af398;_0x6c815b[_0xe2da('0x3e')]=_['keys'](db[_0xe2da('0x72')][_0xe2da('0x3d')]);_0x6c815b[_0xe2da('0x40')]=_[_0xe2da('0x3f')](_0x3fc83f['query']);_0x6c815b[_0xe2da('0x48')]=_[_0xe2da('0x41')](_0x6c815b[_0xe2da('0x3e')],_0x6c815b[_0xe2da('0x40')]);_0x959f4e[_0xe2da('0x43')]=_[_0xe2da('0x41')](_0x6c815b[_0xe2da('0x3e')],qs[_0xe2da('0x42')](_0x3fc83f[_0xe2da('0x40')][_0xe2da('0x42')]));_0x959f4e[_0xe2da('0x43')]=_0x959f4e[_0xe2da('0x43')]['length']?_0x959f4e[_0xe2da('0x43')]:_0x6c815b[_0xe2da('0x3e')];_0x959f4e[_0xe2da('0x69')]=qs['sort'](_0x3fc83f[_0xe2da('0x40')][_0xe2da('0x46')]);_0x959f4e[_0xe2da('0x49')]=qs[_0xe2da('0x48')](_[_0xe2da('0x47')](_0x3fc83f[_0xe2da('0x40')],_0x6c815b['filters']));if(_0x3fc83f[_0xe2da('0x40')][_0xe2da('0x30')]){_0x959f4e[_0xe2da('0x49')]=_[_0xe2da('0x4a')](_0x959f4e[_0xe2da('0x49')],{'$or':_['map'](_0x959f4e['attributes'],function(_0x3b8592){var _0x12a1d2={};_0x12a1d2[_0x3b8592]={'$like':'%'+_0x3fc83f['query'][_0xe2da('0x30')]+'%'};return _0x12a1d2;})});}_0x959f4e=_[_0xe2da('0x4a')]({},_0x959f4e,_0x3fc83f[_0xe2da('0x4e')]);return _0xc01fb9[_0xe2da('0x71')](_0x959f4e);}})[_0xe2da('0x2b')](function(_0x5af48a){if(_0x5af48a){_0x3b8aaa=_0x5af48a[_0xe2da('0x62')];if(!_0x3fc83f[_0xe2da('0x40')]['hasOwnProperty']('nolimit')){_0x959f4e['limit']=qs[_0xe2da('0x25')](_0x3fc83f['query']['limit']);_0x959f4e['offset']=qs[_0xe2da('0x24')](_0x3fc83f['query'][_0xe2da('0x24')]);}return _0xc01fb9[_0xe2da('0x71')](_0x959f4e);}})[_0xe2da('0x2b')](function(_0x28c0c9){if(_0x28c0c9){return _0x28c0c9?{'count':_0x3b8aaa,'rows':_0x28c0c9}:null;}})['then'](respondWithResult(_0x13f4bb,null))[_0xe2da('0x53')](handleError(_0x13f4bb,null));};exports[_0xe2da('0x73')]=function(_0x3c47e4,_0x253125,_0x37f886){var _0x258172=_0x3c47e4[_0xe2da('0x58')][_0xe2da('0x74')];return db[_0xe2da('0x72')][_0xe2da('0x51')]({'where':{'id':_[_0xe2da('0x32')](_0x258172,'id')},'attributes':['id'],'include':[{'model':db[_0xe2da('0x75')],'as':_0xe2da('0x76'),'attributes':['id',_0xe2da('0x36'),'online',_0xe2da('0x77'),'interface'],'raw':!![]}]})[_0xe2da('0x2b')](function(_0x410935){if(_0x410935){var _0x20a584=_['flatMap'](_0x410935,function(_0xd49c7f){var _0x36d281=_0xd49c7f[_0xe2da('0x2c')]({'plain':!![]});_0x36d281[_0xe2da('0x76')][_0xe2da('0x78')](function(_0x3ced02){_0x3ced02['penalty']=_[_0xe2da('0x56')](_0x258172,{'id':_0x36d281['id']})[_0xe2da('0x79')];});return _0x36d281[_0xe2da('0x76')];});return db[_0xe2da('0x3c')][_0xe2da('0x56')]({'where':{'id':_0x3c47e4[_0xe2da('0x55')]['id']}})['then'](function(_0x2b6d27){return db[_0xe2da('0x7a')][_0xe2da('0x7b')](function(_0x5f5cb2){return _0x2b6d27[_0xe2da('0x73')](_['map'](_0x258172,'id'),{'transaction':_0x5f5cb2})[_0xe2da('0x2b')](function(){return BPromise[_0xe2da('0x7c')](_0x20a584,function(_0x332ef0){return db[_0xe2da('0x7d')][_0xe2da('0x7e')]({'where':{'UserId':_0x332ef0['id'],'VoiceQueueId':_0x3c47e4['params']['id']},'defaults':{'penalty':_0x332ef0[_0xe2da('0x79')]},'transaction':_0x5f5cb2});});})[_0xe2da('0x2b')](function(){return BPromise[_0xe2da('0x7c')](_[_0xe2da('0x30')](_0x20a584,{'online':!![]}),function(_0x4f72ab){return db[_0xe2da('0x7f')][_0xe2da('0x80')]({'membername':_0x4f72ab['name'],'UserId':_0x4f72ab['id'],'queue_name':_0x2b6d27[_0xe2da('0x36')],'VoiceQueueId':_0x2b6d27['id'],'interface':_[_0xe2da('0x81')](_0x4f72ab[_0xe2da('0x82')])?util[_0xe2da('0x83')](_0xe2da('0x84'),_0x4f72ab[_0xe2da('0x36')]):_0x4f72ab['interface'],'paused':_0x4f72ab[_0xe2da('0x77')]||![],'penalty':_0x4f72ab[_0xe2da('0x79')]},{'transaction':_0x5f5cb2});});})['then'](function(){_0x20a584['forEach'](function(_0x5c5822){socket['emit']('userVoiceQueue:save',{'UserId':_0x5c5822['id'],'VoiceQueueId':_0x2b6d27['id']});});});});});}})[_0xe2da('0x2b')](respondWithStatusCode(_0x253125,null))[_0xe2da('0x53')](handleError(_0x253125,null));};exports['removeTeams']=function(_0x20ddc5,_0x1508c,_0x3ca50e){return db[_0xe2da('0x72')][_0xe2da('0x51')]({'where':{'id':_0x20ddc5[_0xe2da('0x40')][_0xe2da('0x85')]},'attributes':['id'],'include':[{'model':db[_0xe2da('0x75')],'as':_0xe2da('0x76'),'attributes':['id'],'raw':!![]}]})[_0xe2da('0x2b')](handleEntityNotFound(_0x1508c,null))[_0xe2da('0x2b')](function(_0x2c6166){var _0x1c31b5=_[_0xe2da('0x32')](_0x2c6166,'id');var _0x1163c7=[];var _0x4d1fbc=[];var _0x520581=squel[_0xe2da('0x86')]();_0x520581[_0xe2da('0x4d')]('tq.TeamId')[_0xe2da('0x87')]('team_has_voice_queues','tq')[_0xe2da('0x88')](_0xe2da('0x89'),'ut',_0xe2da('0x8a'))[_0xe2da('0x49')]('VoiceQueueId\x20=\x20?',_0x20ddc5[_0xe2da('0x55')]['id']);for(var _0x1d3f5d=0x0;_0x1d3f5d<_0x2c6166[_0xe2da('0x62')];_0x1d3f5d+=0x1){let _0x3a8f89=_0x2c6166[_0x1d3f5d];for(var _0x44a3d6=0x0;_0x44a3d6<_0x3a8f89[_0xe2da('0x76')][_0xe2da('0x62')];_0x44a3d6+=0x1){let _0x29b447=_0x3a8f89[_0xe2da('0x76')][_0x44a3d6];var _0x120e91=_0x520581[_0xe2da('0x61')]();_0x120e91[_0xe2da('0x49')](_0xe2da('0x8b'),_0x29b447['id']);_0x4d1fbc['push'](db['sequelize'][_0xe2da('0x40')](_0x120e91[_0xe2da('0x8c')](),{'type':db['sequelize'][_0xe2da('0x8d')][_0xe2da('0x8e')]})[_0xe2da('0x2b')](function(_0x3837b9){if(_0x3837b9[_0xe2da('0x62')]===0x1){return _0x29b447['id'];}else{var _0x5309ea=_[_0xe2da('0x8f')](_[_0xe2da('0x32')](_0x3837b9,_0xe2da('0x90')),function(_0x2fe6ca){return _[_0xe2da('0x34')](_0x1c31b5,_0x2fe6ca);});if(_0x5309ea){return _0x29b447['id'];}}}));}}return BPromise[_0xe2da('0x91')](_0x4d1fbc)[_0xe2da('0x2b')](function(_0x2a6228){_0x1163c7=_(_0x1163c7)['union'](_0x2a6228)['compact']()[_0xe2da('0x33')]();return db[_0xe2da('0x3c')][_0xe2da('0x56')]({'where':{'id':_0x20ddc5[_0xe2da('0x55')]['id']}})['then'](function(_0xf9567e){return db[_0xe2da('0x7a')]['transaction'](function(_0xbe09ee){return _0xf9567e[_0xe2da('0x92')](_0x20ddc5[_0xe2da('0x40')][_0xe2da('0x85')],{'transaction':_0xbe09ee})[_0xe2da('0x2b')](function(){if(!_['isEmpty'](_0x1163c7)){return _0xf9567e[_0xe2da('0x93')](_0x1163c7,{'transaction':_0xbe09ee})[_0xe2da('0x2b')](function(){return db[_0xe2da('0x7f')][_0xe2da('0x38')]({'where':{'VoiceQueueId':_0x20ddc5['params']['id'],'UserId':_0x1163c7},'transaction':_0xbe09ee});});}})[_0xe2da('0x2b')](function(){_0x1163c7[_0xe2da('0x78')](function(_0x6b38e9){socket['emit']('userVoiceQueue:remove',{'UserId':_0x6b38e9,'VoiceQueueId':_0xf9567e['id']});});});});});});})[_0xe2da('0x2b')](respondWithStatusCode(_0x1508c,null))[_0xe2da('0x53')](handleError(_0x1508c,null));};exports[_0xe2da('0x94')]=function(_0x25c9b9,_0x4db154,_0x2fc787){var _0x2f6492,_0x29d922;return db[_0xe2da('0x3c')][_0xe2da('0x56')]({'where':{'id':_0x25c9b9[_0xe2da('0x55')]['id']}})[_0xe2da('0x2b')](handleEntityNotFound(_0x4db154,null))[_0xe2da('0x2b')](function(_0x4b6e6b){if(_0x4b6e6b){_0x29d922=_0x4b6e6b;return _0x4b6e6b[_0xe2da('0x94')](_0x25c9b9[_0xe2da('0x58')][_0xe2da('0x85')],_[_0xe2da('0x63')](_0x25c9b9['body'],[_0xe2da('0x85'),'id'])||{})[_0xe2da('0x95')](function(_0x40636b){for(var _0x1a26e5=0x0;_0x1a26e5<_0x25c9b9[_0xe2da('0x58')][_0xe2da('0x85')][_0xe2da('0x62')];_0x1a26e5+=0x1){socket[_0xe2da('0x96')](_0xe2da('0x97'),{'UserId':_0x25c9b9[_0xe2da('0x58')]['ids'][_0x1a26e5],'VoiceQueueId':_0x25c9b9[_0xe2da('0x55')]['id']});}return _0x40636b;});}})[_0xe2da('0x2b')](function(_0x5f5354){_0x2f6492=_0x5f5354||[];if(_0x29d922){return db[_0xe2da('0x75')][_0xe2da('0x51')]({'where':{'id':_0x25c9b9[_0xe2da('0x58')][_0xe2da('0x85')]},'attributes':['id',_0xe2da('0x36'),_0xe2da('0x98'),_0xe2da('0x77'),_0xe2da('0x82')],'raw':!![]});}})[_0xe2da('0x2b')](function(_0x295354){if(!_[_0xe2da('0x99')](_0x295354)){var _0x34feeb=[];for(var _0xb819b7=0x0;_0xb819b7<_0x295354[_0xe2da('0x62')];_0xb819b7++){if(_0x295354[_0xb819b7][_0xe2da('0x98')]){_0x34feeb[_0xe2da('0x9a')](db[_0xe2da('0x7f')][_0xe2da('0x80')]({'membername':_0x295354[_0xb819b7][_0xe2da('0x36')],'UserId':_0x295354[_0xb819b7]['id'],'queue_name':_0x29d922[_0xe2da('0x36')],'VoiceQueueId':_0x29d922['id'],'interface':_[_0xe2da('0x81')](_0x295354[_0xb819b7][_0xe2da('0x82')])?util[_0xe2da('0x83')](_0xe2da('0x84'),_0x295354[_0xb819b7][_0xe2da('0x36')]):_0x295354[_0xb819b7]['interface'],'paused':_0x295354[_0xb819b7][_0xe2da('0x77')]||![],'penalty':_0x25c9b9[_0xe2da('0x58')][_0xe2da('0x79')]||0x0}));}}return BPromise['all'](_0x34feeb);}})[_0xe2da('0x2b')](function(){return _0x2f6492;})[_0xe2da('0x2b')](respondWithResult(_0x4db154,null))[_0xe2da('0x53')](handleError(_0x4db154,null));};exports[_0xe2da('0x93')]=function(_0x18e4e6,_0x3c5b99,_0x309243){return db[_0xe2da('0x3c')]['find']({'where':{'id':_0x18e4e6[_0xe2da('0x55')]['id']}})['then'](handleEntityNotFound(_0x3c5b99,null))['then'](function(_0x33d86e){if(_0x33d86e){return _0x33d86e['removeAgents'](_0x18e4e6[_0xe2da('0x40')][_0xe2da('0x85')])[_0xe2da('0x2b')](function(){if(_[_0xe2da('0x9b')](_0x18e4e6['query']['ids'])){for(var _0x24375c=0x0;_0x24375c<_0x18e4e6[_0xe2da('0x40')][_0xe2da('0x85')][_0xe2da('0x62')];_0x24375c+=0x1){socket[_0xe2da('0x96')](_0xe2da('0x9c'),{'UserId':Number(_0x18e4e6[_0xe2da('0x40')][_0xe2da('0x85')][_0x24375c]),'VoiceQueueId':Number(_0x18e4e6[_0xe2da('0x55')]['id'])});}}else{socket[_0xe2da('0x96')](_0xe2da('0x9c'),{'UserId':Number(_0x18e4e6[_0xe2da('0x40')][_0xe2da('0x85')]),'VoiceQueueId':Number(_0x18e4e6['params']['id'])});}});}})[_0xe2da('0x2b')](function(_0x3a2f79){return db[_0xe2da('0x7f')][_0xe2da('0x38')]({'where':{'VoiceQueueId':_0x18e4e6[_0xe2da('0x55')]['id'],'UserId':_0x18e4e6[_0xe2da('0x40')][_0xe2da('0x85')]}})[_0xe2da('0x2b')](function(){return _0x3a2f79;});})[_0xe2da('0x2b')](respondWithStatusCode(_0x3c5b99,null))[_0xe2da('0x53')](handleError(_0x3c5b99,null));};exports[_0xe2da('0x9d')]=function(_0x1295b8,_0x2f5bf3,_0x5a7583){var _0x5da6ec={};var _0x36945d={};var _0x333f60;var _0x405231;return db['VoiceQueue']['findOne']({'where':{'id':_0x1295b8[_0xe2da('0x55')]['id']}})['then'](handleEntityNotFound(_0x2f5bf3,null))[_0xe2da('0x2b')](function(_0x5d09f0){if(_0x5d09f0){_0x333f60=_0x5d09f0;_0x36945d[_0xe2da('0x3e')]=_[_0xe2da('0x3f')](db[_0xe2da('0x75')][_0xe2da('0x3d')]);_0x36945d[_0xe2da('0x40')]=_[_0xe2da('0x3f')](_0x1295b8[_0xe2da('0x40')]);_0x36945d[_0xe2da('0x48')]=_[_0xe2da('0x41')](_0x36945d['model'],_0x36945d[_0xe2da('0x40')]);_0x5da6ec[_0xe2da('0x43')]=_[_0xe2da('0x41')](_0x36945d[_0xe2da('0x3e')],qs[_0xe2da('0x42')](_0x1295b8['query']['fields']));_0x5da6ec['attributes']=_0x5da6ec[_0xe2da('0x43')][_0xe2da('0x62')]?_0x5da6ec[_0xe2da('0x43')]:_0x36945d['model'];_0x5da6ec[_0xe2da('0x69')]=qs[_0xe2da('0x46')](_0x1295b8[_0xe2da('0x40')][_0xe2da('0x46')]);_0x5da6ec[_0xe2da('0x49')]=qs[_0xe2da('0x48')](_[_0xe2da('0x47')](_0x1295b8[_0xe2da('0x40')],_0x36945d[_0xe2da('0x48')]));if(_0x1295b8[_0xe2da('0x40')][_0xe2da('0x30')]){_0x5da6ec[_0xe2da('0x49')]=_['merge'](_0x5da6ec[_0xe2da('0x49')],{'$or':_[_0xe2da('0x32')](_0x5da6ec['attributes'],function(_0x13eeb1){var _0x46c3e0={};_0x46c3e0[_0x13eeb1]={'$like':'%'+_0x1295b8[_0xe2da('0x40')][_0xe2da('0x30')]+'%'};return _0x46c3e0;})});}_0x5da6ec=_[_0xe2da('0x4a')]({},_0x5da6ec,_0x1295b8[_0xe2da('0x4e')]);return _0x333f60[_0xe2da('0x9d')](_0x5da6ec);}})[_0xe2da('0x2b')](function(_0x5f55c0){if(_0x5f55c0){_0x405231=_0x5f55c0[_0xe2da('0x62')];if(!_0x1295b8['query'][_0xe2da('0x44')]('nolimit')){_0x5da6ec['limit']=qs['limit'](_0x1295b8[_0xe2da('0x40')][_0xe2da('0x25')]);_0x5da6ec[_0xe2da('0x24')]=qs['offset'](_0x1295b8[_0xe2da('0x40')][_0xe2da('0x24')]);}return _0x333f60[_0xe2da('0x9d')](_0x5da6ec);}})[_0xe2da('0x2b')](function(_0x28862f){if(_0x28862f){return _0x28862f?{'count':_0x405231,'rows':_0x28862f}:null;}})[_0xe2da('0x2b')](respondWithResult(_0x2f5bf3,null))[_0xe2da('0x53')](handleError(_0x2f5bf3,null));};exports[_0xe2da('0x9e')]=function(_0x4d3fff,_0x1de65f,_0x216dc9){var _0xd235c5={};var _0x5ee502={};var _0x11c33d;var _0x1f523b;return db[_0xe2da('0x3c')]['findOne']({'where':{'id':_0x4d3fff[_0xe2da('0x55')]['id']}})[_0xe2da('0x2b')](handleEntityNotFound(_0x1de65f,null))[_0xe2da('0x2b')](function(_0x2f72fb){if(_0x2f72fb){_0x11c33d=_0x2f72fb;_0x5ee502['model']=_[_0xe2da('0x3f')](db[_0xe2da('0x7f')][_0xe2da('0x3d')]);_0x5ee502['query']=_['keys'](_0x4d3fff['query']);_0x5ee502[_0xe2da('0x48')]=_[_0xe2da('0x41')](_0x5ee502[_0xe2da('0x3e')],_0x5ee502[_0xe2da('0x40')]);_0xd235c5[_0xe2da('0x43')]=_[_0xe2da('0x41')](_0x5ee502[_0xe2da('0x3e')],qs[_0xe2da('0x42')](_0x4d3fff[_0xe2da('0x40')]['fields']));_0xd235c5[_0xe2da('0x43')]=_0xd235c5[_0xe2da('0x43')][_0xe2da('0x62')]?_0xd235c5['attributes']:_0x5ee502[_0xe2da('0x3e')];_0xd235c5[_0xe2da('0x69')]=qs['sort'](_0x4d3fff[_0xe2da('0x40')]['sort']);_0xd235c5[_0xe2da('0x49')]=qs[_0xe2da('0x48')](_[_0xe2da('0x47')](_0x4d3fff[_0xe2da('0x40')],_0x5ee502['filters']));if(_0x4d3fff[_0xe2da('0x40')][_0xe2da('0x30')]){_0xd235c5[_0xe2da('0x49')]=_[_0xe2da('0x4a')](_0xd235c5['where'],{'$or':_[_0xe2da('0x32')](_0xd235c5[_0xe2da('0x43')],function(_0x240bb6){var _0x4e4c54={};_0x4e4c54[_0x240bb6]={'$like':'%'+_0x4d3fff[_0xe2da('0x40')][_0xe2da('0x30')]+'%'};return _0x4e4c54;})});}_0xd235c5=_[_0xe2da('0x4a')]({},_0xd235c5,_0x4d3fff['options']);return _0x11c33d[_0xe2da('0x9e')](_0xd235c5);}})[_0xe2da('0x2b')](function(_0x3a42c5){if(_0x3a42c5){_0x1f523b=_0x3a42c5[_0xe2da('0x62')];if(!_0x4d3fff['query'][_0xe2da('0x44')](_0xe2da('0x45'))){_0xd235c5[_0xe2da('0x25')]=qs['limit'](_0x4d3fff[_0xe2da('0x40')][_0xe2da('0x25')]);_0xd235c5[_0xe2da('0x24')]=qs[_0xe2da('0x24')](_0x4d3fff['query'][_0xe2da('0x24')]);}return _0x11c33d[_0xe2da('0x9e')](_0xd235c5);}})[_0xe2da('0x2b')](function(_0x1fef76){return _0x1fef76?{'count':_0x1f523b,'rows':_0x1fef76}:null;})['then'](respondWithResult(_0x1de65f,null))['catch'](handleError(_0x1de65f,null));};exports[_0xe2da('0x9f')]=function(_0x53fcd0,_0x395d85,_0x221dae){var _0xd53b86={};var _0x14ad30={};var _0xe1805f;var _0x3c1f42;return db[_0xe2da('0x3c')]['findOne']({'where':{'id':_0x53fcd0[_0xe2da('0x55')]['id']}})[_0xe2da('0x2b')](handleEntityNotFound(_0x395d85,null))[_0xe2da('0x2b')](function(_0x252e72){if(_0x252e72){_0xe1805f=_0x252e72;_0x14ad30[_0xe2da('0x3e')]=_[_0xe2da('0x3f')](db[_0xe2da('0xa0')][_0xe2da('0x3d')]);_0x14ad30[_0xe2da('0x40')]=_[_0xe2da('0x3f')](_0x53fcd0[_0xe2da('0x40')]);_0x14ad30[_0xe2da('0x48')]=_['intersection'](_0x14ad30[_0xe2da('0x3e')],_0x14ad30[_0xe2da('0x40')]);_0xd53b86[_0xe2da('0x43')]=_[_0xe2da('0x41')](_0x14ad30[_0xe2da('0x3e')],qs[_0xe2da('0x42')](_0x53fcd0[_0xe2da('0x40')]['fields']));_0xd53b86[_0xe2da('0x43')]=_0xd53b86[_0xe2da('0x43')][_0xe2da('0x62')]?_0xd53b86[_0xe2da('0x43')]:_0x14ad30[_0xe2da('0x3e')];_0xd53b86[_0xe2da('0x69')]=qs[_0xe2da('0x46')](_0x53fcd0[_0xe2da('0x40')][_0xe2da('0x46')]);_0xd53b86[_0xe2da('0x49')]=qs['filters'](_['pick'](_0x53fcd0['query'],_0x14ad30[_0xe2da('0x48')]));if(_0x53fcd0['query']['filter']){_0xd53b86[_0xe2da('0x49')]=_[_0xe2da('0x4a')](_0xd53b86[_0xe2da('0x49')],{'$or':_['map'](_0xd53b86[_0xe2da('0x43')],function(_0x580fbd){var _0x37538b={};_0x37538b[_0x580fbd]={'$like':'%'+_0x53fcd0['query']['filter']+'%'};return _0x37538b;})});}_0xd53b86=_['merge']({},_0xd53b86,_0x53fcd0[_0xe2da('0x4e')]);return _0xe1805f[_0xe2da('0x9f')](_0xd53b86);}})['then'](function(_0x2862ce){if(_0x2862ce){_0x3c1f42=_0x2862ce[_0xe2da('0x62')];if(!_0x53fcd0['query']['hasOwnProperty']('nolimit')){_0xd53b86[_0xe2da('0x25')]=qs[_0xe2da('0x25')](_0x53fcd0[_0xe2da('0x40')][_0xe2da('0x25')]);_0xd53b86[_0xe2da('0x24')]=qs[_0xe2da('0x24')](_0x53fcd0['query'][_0xe2da('0x24')]);}return _0xe1805f[_0xe2da('0x9f')](_0xd53b86);}})[_0xe2da('0x2b')](function(_0x9ad812){if(_0x9ad812){return _0x9ad812?{'count':_0x3c1f42,'rows':_0x9ad812}:null;}})['then'](respondWithResult(_0x395d85,null))[_0xe2da('0x53')](handleError(_0x395d85,null));};exports[_0xe2da('0xa1')]=function(_0x2672ae,_0x1e68ca,_0x179d00){var _0x34c55b,_0x1cd7ac;return db[_0xe2da('0x3c')]['find']({'where':{'id':_0x2672ae['params']['id']}})[_0xe2da('0x2b')](handleEntityNotFound(_0x1e68ca,null))['then'](function(_0x494569){if(_0x494569){_0x1cd7ac=_0x494569;return _0x494569[_0xe2da('0xa1')](_0x2672ae['body']['ids'],_[_0xe2da('0x63')](_0x2672ae[_0xe2da('0x58')],[_0xe2da('0x85'),'id'])||{});}return null;})['spread'](function(_0x5de19e){var _0x36d61e;_0x34c55b=_0x5de19e||[];var _0x44fd4b=[];if(_0x5de19e){for(var _0x2a967a=0x0;_0x2a967a<_0x5de19e[_0xe2da('0x62')];_0x2a967a+=0x1){var _0x278e34=_0x5de19e[_0x2a967a]['get']({'plain':!![]});_0x1cd7ac['dialCheckDuplicateType']=_0x2672ae['body']['dialCheckDuplicateType']?_0x2672ae['body'][_0xe2da('0xa2')]:_0x1cd7ac[_0xe2da('0xa2')];switch(_0x1cd7ac[_0xe2da('0xa2')]){case _0xe2da('0xa3'):_0x36d61e=squel['insert']()['into']('cm_hopper')[_0xe2da('0xa4')]([_0xe2da('0xa5'),'scheduledAt',_0xe2da('0xa6'),_0xe2da('0xa7'),_0xe2da('0x6a'),_0xe2da('0x64'),_0xe2da('0x65')],squel['select']()[_0xe2da('0x4d')]('phone',_0xe2da('0xa5'))[_0xe2da('0x4d')](_0xe2da('0xa8'),'scheduledAt')[_0xe2da('0x4d')]('id','ContactId')[_0xe2da('0x4d')](_0x278e34[_0xe2da('0xa9')][_0xe2da('0x8c')](),'ListId')[_0xe2da('0x4d')](_0x2672ae[_0xe2da('0x55')]['id']['toString'](),_0xe2da('0x6a'))[_0xe2da('0x4d')](_0xe2da('0xa8'),_0xe2da('0x64'))[_0xe2da('0x4d')](_0xe2da('0xa8'),_0xe2da('0x65'))[_0xe2da('0x87')](_0xe2da('0xaa'))[_0xe2da('0x49')](_0xe2da('0xab'))['where'](_0xe2da('0xac'),_0x278e34['CmListId'][_0xe2da('0x8c')]())[_0xe2da('0x49')](_0xe2da('0xad'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xe2da('0x86')]()[_0xe2da('0x4d')](_0xe2da('0xae'))[_0xe2da('0x87')](_0xe2da('0xaf'))[_0xe2da('0x49')](_0xe2da('0xb0'),_0x2672ae[_0xe2da('0x55')]['id'][_0xe2da('0x8c')]()))[_0xe2da('0x49')](_0xe2da('0xb1'),squel[_0xe2da('0x86')]()[_0xe2da('0x4d')](_0xe2da('0xb2'))[_0xe2da('0x87')]('cm_hopper')[_0xe2da('0x49')](_0xe2da('0xb0'),_0x2672ae[_0xe2da('0x55')]['id'][_0xe2da('0x8c')]())))['toString']();break;case _0xe2da('0xb3'):_0x36d61e=squel[_0xe2da('0xb4')]()[_0xe2da('0xb5')](_0xe2da('0xb6'))['fromQuery']([_0xe2da('0xa5'),'scheduledAt',_0xe2da('0xa6'),_0xe2da('0xa7'),_0xe2da('0x6a'),'createdAt',_0xe2da('0x65')],squel[_0xe2da('0x86')]()['field']('phone','phone')[_0xe2da('0x4d')]('NOW()',_0xe2da('0xb7'))['field']('id','ContactId')[_0xe2da('0x4d')](_0x278e34['CmListId']['toString'](),'ListId')[_0xe2da('0x4d')](_0x2672ae[_0xe2da('0x55')]['id'][_0xe2da('0x8c')](),_0xe2da('0x6a'))[_0xe2da('0x4d')]('NOW()',_0xe2da('0x64'))[_0xe2da('0x4d')]('NOW()',_0xe2da('0x65'))[_0xe2da('0x87')](_0xe2da('0xaa'))[_0xe2da('0x49')]('deletedAt\x20IS\x20NULL')[_0xe2da('0x49')](_0xe2da('0xac'),_0x278e34[_0xe2da('0xa9')][_0xe2da('0x8c')]())['where'](_0xe2da('0xad'))[_0xe2da('0x49')]('phone\x20NOT\x20IN\x20(?)',squel[_0xe2da('0x86')]()[_0xe2da('0x4d')](_0xe2da('0xb2'))['from'](_0xe2da('0xb6'))['where'](_0xe2da('0xb0'),_0x2672ae['params']['id']['toString']())))[_0xe2da('0x8c')]();break;default:_0x36d61e=squel[_0xe2da('0xb4')]()[_0xe2da('0xb5')]('cm_hopper')['fromQuery']([_0xe2da('0xa5'),_0xe2da('0xb7'),_0xe2da('0xa6'),_0xe2da('0xa7'),_0xe2da('0x6a'),_0xe2da('0x64'),_0xe2da('0x65')],squel[_0xe2da('0x86')]()[_0xe2da('0x4d')](_0xe2da('0xa5'),_0xe2da('0xa5'))[_0xe2da('0x4d')]('NOW()',_0xe2da('0xb7'))[_0xe2da('0x4d')]('id',_0xe2da('0xa6'))['field'](_0x278e34[_0xe2da('0xa9')][_0xe2da('0x8c')](),'ListId')[_0xe2da('0x4d')](_0x2672ae['params']['id']['toString'](),_0xe2da('0x6a'))[_0xe2da('0x4d')]('NOW()','createdAt')[_0xe2da('0x4d')](_0xe2da('0xa8'),_0xe2da('0x65'))[_0xe2da('0x87')](_0xe2da('0xaa'))['where'](_0xe2da('0xab'))[_0xe2da('0x49')](_0xe2da('0xac'),_0x278e34['CmListId']['toString']())['where'](_0xe2da('0xad')))[_0xe2da('0x8c')]();}_0x44fd4b[_0xe2da('0x9a')](db[_0xe2da('0x7a')][_0xe2da('0x40')](_0x36d61e));}return BPromise[_0xe2da('0x91')](_0x44fd4b);}})['then'](function(){return _0x34c55b;})[_0xe2da('0x2b')](respondWithResult(_0x1e68ca,null))[_0xe2da('0x53')](handleError(_0x1e68ca,null));};exports[_0xe2da('0xb8')]=function(_0x2a7766,_0x17e3f1,_0x2cbde6){return db[_0xe2da('0x3c')][_0xe2da('0x56')]({'where':{'id':_0x2a7766[_0xe2da('0x55')]['id']}})[_0xe2da('0x2b')](handleEntityNotFound(_0x17e3f1,null))[_0xe2da('0x2b')](function(_0x4f200b){if(_0x4f200b){return _0x4f200b[_0xe2da('0xb8')](_0x2a7766['query']['ids']);}})[_0xe2da('0x2b')](function(_0x2528d6){if(_0x2528d6){return db[_0xe2da('0x68')][_0xe2da('0x38')]({'where':{'ListId':_0x2a7766[_0xe2da('0x40')][_0xe2da('0x85')],'VoiceQueueId':_0x2a7766[_0xe2da('0x55')]['id']}})[_0xe2da('0x2b')](function(){return _0x2528d6;});}})[_0xe2da('0x2b')](respondWithStatusCode(_0x17e3f1,null))[_0xe2da('0x53')](handleError(_0x17e3f1,null));};exports[_0xe2da('0xb9')]=function(_0x656d3a,_0x31046d,_0x30491c){var _0x3e157={};var _0x313a2e={};var _0xa49a8f;var _0x33d00c;return db[_0xe2da('0x3c')][_0xe2da('0x67')]({'where':{'id':_0x656d3a[_0xe2da('0x55')]['id']}})[_0xe2da('0x2b')](handleEntityNotFound(_0x31046d,null))[_0xe2da('0x2b')](function(_0x430112){if(_0x430112){_0xa49a8f=_0x430112;_0x313a2e[_0xe2da('0x3e')]=_[_0xe2da('0x3f')](db[_0xe2da('0xa0')][_0xe2da('0x3d')]);_0x313a2e[_0xe2da('0x40')]=_['keys'](_0x656d3a[_0xe2da('0x40')]);_0x313a2e['filters']=_[_0xe2da('0x41')](_0x313a2e[_0xe2da('0x3e')],_0x313a2e[_0xe2da('0x40')]);_0x3e157[_0xe2da('0x43')]=_[_0xe2da('0x41')](_0x313a2e['model'],qs[_0xe2da('0x42')](_0x656d3a[_0xe2da('0x40')][_0xe2da('0x42')]));_0x3e157['attributes']=_0x3e157['attributes'][_0xe2da('0x62')]?_0x3e157[_0xe2da('0x43')]:_0x313a2e[_0xe2da('0x3e')];_0x3e157[_0xe2da('0x69')]=qs[_0xe2da('0x46')](_0x656d3a['query'][_0xe2da('0x46')]);_0x3e157['where']=qs['filters'](_[_0xe2da('0x47')](_0x656d3a[_0xe2da('0x40')],_0x313a2e[_0xe2da('0x48')]));if(_0x656d3a['query'][_0xe2da('0x30')]){_0x3e157[_0xe2da('0x49')]=_['merge'](_0x3e157['where'],{'$or':_[_0xe2da('0x32')](_0x3e157[_0xe2da('0x43')],function(_0x30e12e){var _0x28ca5e={};_0x28ca5e[_0x30e12e]={'$like':'%'+_0x656d3a[_0xe2da('0x40')][_0xe2da('0x30')]+'%'};return _0x28ca5e;})});}_0x3e157=_[_0xe2da('0x4a')]({},_0x3e157,_0x656d3a[_0xe2da('0x4e')]);return _0xa49a8f['getBlackLists'](_0x3e157);}})[_0xe2da('0x2b')](function(_0x2cd8bb){if(_0x2cd8bb){_0x33d00c=_0x2cd8bb['length'];if(!_0x656d3a[_0xe2da('0x40')]['hasOwnProperty']('nolimit')){_0x3e157[_0xe2da('0x25')]=qs[_0xe2da('0x25')](_0x656d3a[_0xe2da('0x40')]['limit']);_0x3e157[_0xe2da('0x24')]=qs[_0xe2da('0x24')](_0x656d3a['query'][_0xe2da('0x24')]);}return _0xa49a8f[_0xe2da('0xb9')](_0x3e157);}})[_0xe2da('0x2b')](function(_0x1b56a7){if(_0x1b56a7){return _0x1b56a7?{'count':_0x33d00c,'rows':_0x1b56a7}:null;}})[_0xe2da('0x2b')](respondWithResult(_0x31046d,null))[_0xe2da('0x53')](handleError(_0x31046d,null));};exports[_0xe2da('0xba')]=function(_0x3d79bd,_0x20b8c6,_0x33d9aa){var _0x4e5369,_0x416a8b;return db[_0xe2da('0x3c')][_0xe2da('0x56')]({'where':{'id':_0x3d79bd['params']['id']}})[_0xe2da('0x2b')](handleEntityNotFound(_0x20b8c6,null))[_0xe2da('0x2b')](function(_0x582eef){if(_0x582eef){_0x416a8b=_0x582eef;return _0x582eef[_0xe2da('0xba')](_0x3d79bd['body'][_0xe2da('0x85')],_[_0xe2da('0x63')](_0x3d79bd[_0xe2da('0x58')],['ids','id'])||{});}return null;})['spread'](function(_0x1f6b7e){var _0x135615;_0x4e5369=_0x1f6b7e||[];var _0x3ef499=[];if(_0x1f6b7e){for(var _0x9e9b0b=0x0;_0x9e9b0b<_0x1f6b7e[_0xe2da('0x62')];_0x9e9b0b+=0x1){var _0x28a445=_0x1f6b7e[_0x9e9b0b][_0xe2da('0x2c')]({'plain':!![]});_0x135615=squel['insert']()[_0xe2da('0xb5')](_0xe2da('0xbb'))['fromQuery'](['phone',_0xe2da('0xa6'),'ListId','VoiceQueueId',_0xe2da('0x64'),'updatedAt'],squel[_0xe2da('0x86')]()[_0xe2da('0x4d')]('phone',_0xe2da('0xa5'))['field']('id',_0xe2da('0xa6'))['field'](_0x28a445[_0xe2da('0xa9')][_0xe2da('0x8c')](),_0xe2da('0xa7'))[_0xe2da('0x4d')](_0x3d79bd[_0xe2da('0x55')]['id'][_0xe2da('0x8c')](),_0xe2da('0x6a'))[_0xe2da('0x4d')](_0xe2da('0xa8'),'createdAt')[_0xe2da('0x4d')](_0xe2da('0xa8'),'updatedAt')['from'](_0xe2da('0xaa'))[_0xe2da('0x49')](_0xe2da('0xab'))[_0xe2da('0x49')](_0xe2da('0xac'),_0x28a445[_0xe2da('0xa9')][_0xe2da('0x8c')]())[_0xe2da('0x49')](_0xe2da('0xad')))[_0xe2da('0x8c')]();_0x3ef499[_0xe2da('0x9a')](db[_0xe2da('0x7a')]['query'](_0x135615));}return BPromise[_0xe2da('0x91')](_0x3ef499);}})[_0xe2da('0x2b')](function(){return _0x4e5369;})['then'](respondWithResult(_0x20b8c6,null))[_0xe2da('0x53')](handleError(_0x20b8c6,null));};exports[_0xe2da('0xbc')]=function(_0x5758ae,_0x3cd846,_0x429403){return db[_0xe2da('0x3c')][_0xe2da('0x56')]({'where':{'id':_0x5758ae['params']['id']}})[_0xe2da('0x2b')](handleEntityNotFound(_0x3cd846,null))[_0xe2da('0x2b')](function(_0x39b146){if(_0x39b146){return _0x39b146['removeBlackLists'](_0x5758ae['query'][_0xe2da('0x85')]);}})[_0xe2da('0x2b')](function(_0x2a928c){if(_0x2a928c){return db[_0xe2da('0x70')][_0xe2da('0x38')]({'where':{'ListId':_0x5758ae[_0xe2da('0x40')][_0xe2da('0x85')],'VoiceQueueId':_0x5758ae['params']['id']}})['then'](function(){return _0x2a928c;});}})['then'](respondWithStatusCode(_0x3cd846,null))[_0xe2da('0x53')](handleError(_0x3cd846,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index f02d59a..213286a 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 _0x3f55=['exports','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1e0237,_0x5456bd){var _0x2a68fa=function(_0xd1c359){while(--_0xd1c359){_0x1e0237['push'](_0x1e0237['shift']());}};_0x2a68fa(++_0x5456bd);}(_0x3f55,0x1b9));var _0x53f5=function(_0x2c27c6,_0xb57741){_0x2c27c6=_0x2c27c6-0x0;var _0x43e0a3=_0x3f55[_0x2c27c6];return _0x43e0a3;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x53f5('0x0'))['db'][_0x53f5('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x53f5('0x2')](0x0);var events={'afterCreate':_0x53f5('0x3'),'afterUpdate':_0x53f5('0x4'),'afterDestroy':_0x53f5('0x5')};function emitEvent(_0x174cf1){return function(_0x1dc2ba,_0x589958,_0x1ead59){VoiceQueueEvents[_0x53f5('0x6')](_0x174cf1+':'+_0x1dc2ba['id'],_0x1dc2ba);VoiceQueueEvents[_0x53f5('0x6')](_0x174cf1,_0x1dc2ba);_0x1ead59(null);};}for(var e in events){if(events[_0x53f5('0x7')](e)){var event=events[e];VoiceQueue[_0x53f5('0x8')](e,emitEvent(event));}}module[_0x53f5('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0x2dea=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x388717,_0x44fbc1){var _0x14df55=function(_0x1348af){while(--_0x1348af){_0x388717['push'](_0x388717['shift']());}};_0x14df55(++_0x44fbc1);}(_0x2dea,0xef));var _0xa2de=function(_0x518b8f,_0x476de4){_0x518b8f=_0x518b8f-0x0;var _0x51cece=_0x2dea[_0x518b8f];return _0x51cece;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xa2de('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xa2de('0x1')](0x0);var events={'afterCreate':_0xa2de('0x2'),'afterUpdate':_0xa2de('0x3'),'afterDestroy':_0xa2de('0x4')};function emitEvent(_0x1ad5df){return function(_0x48095c,_0x148bee,_0x316e4c){VoiceQueueEvents[_0xa2de('0x5')](_0x1ad5df+':'+_0x48095c['id'],_0x48095c);VoiceQueueEvents[_0xa2de('0x5')](_0x1ad5df,_0x48095c);_0x316e4c(null);};}for(var e in events){if(events[_0xa2de('0x6')](e)){var event=events[e];VoiceQueue[_0xa2de('0x7')](e,emitEvent(event));}}module[_0xa2de('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index f2ffcfc..9168ea5 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 _0xa571=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','VoiceQueue','voice_queues','lodash'];(function(_0x1b0cc5,_0x40fc75){var _0x4687ff=function(_0x1cea03){while(--_0x1cea03){_0x1b0cc5['push'](_0x1b0cc5['shift']());}};_0x4687ff(++_0x40fc75);}(_0xa571,0x107));var _0x1a57=function(_0xcc7765,_0xb294ff){_0xcc7765=_0xcc7765-0x0;var _0x2b00b5=_0xa571[_0xcc7765];return _0x2b00b5;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var logger=require(_0x1a57('0x2'))(_0x1a57('0x3'));var moment=require('moment');var BPromise=require(_0x1a57('0x4'));var rp=require(_0x1a57('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1a57('0x6'));var attributes=require('./voiceQueue.attributes');module[_0x1a57('0x7')]=function(_0xd97a33,_0x22ca20){return _0xd97a33[_0x1a57('0x8')](_0x1a57('0x9'),attributes,{'tableName':_0x1a57('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1339=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceQueue','voice_queues','../../config/logger','api'];(function(_0x22d2a8,_0x34224b){var _0x4c6392=function(_0x3ddcc5){while(--_0x3ddcc5){_0x22d2a8['push'](_0x22d2a8['shift']());}};_0x4c6392(++_0x34224b);}(_0x1339,0x1ed));var _0x9133=function(_0xb17d53,_0x23eeec){_0xb17d53=_0xb17d53-0x0;var _0x145990=_0x1339[_0xb17d53];return _0x145990;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9133('0x0'))(_0x9133('0x1'));var moment=require(_0x9133('0x2'));var BPromise=require(_0x9133('0x3'));var rp=require(_0x9133('0x4'));var fs=require('fs');var path=require(_0x9133('0x5'));var rimraf=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var attributes=require('./voiceQueue.attributes');module[_0x9133('0x8')]=function(_0x855473,_0x379915){return _0x855473['define'](_0x9133('0x9'),attributes,{'tableName':_0x9133('0xa'),'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 75f3d6f..fcb7d10 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 _0xa9e0=['register','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowVoiceQueue','VoiceQueue','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter'];(function(_0x4242e8,_0x1a686e){var _0x44850d=function(_0x206b72){while(--_0x206b72){_0x4242e8['push'](_0x4242e8['shift']());}};_0x44850d(++_0x1a686e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['VoiceQueue'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'limit':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]||null:null,'include':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x1314ae[_0x0a9e('0x1b')]['include'],function(_0x59181e){return{'model':db[_0x59181e[_0x0a9e('0x22')]],'as':_0x59181e['as'],'attributes':_0x59181e[_0x0a9e('0x1e')],'include':_0x59181e[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x59181e['include'],function(_0x384319){return{'model':db[_0x384319['model']],'as':_0x384319['as'],'attributes':_0x384319[_0x0a9e('0x1e')],'include':_0x384319['include']?_[_0x0a9e('0x21')](_0x384319[_0x0a9e('0x20')],function(_0x25fba9){return{'model':db[_0x25fba9[_0x0a9e('0x22')]],'as':_0x25fba9['as'],'attributes':_0x25fba9[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x11c3b6){logger[_0x0a9e('0x16')]('GetVoiceQueue',_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON[_0x0a9e('0x12')](_0x11c3b6));_0x1c696a(_0x11c3b6);})[_0x0a9e('0x18')](function(_0x5c877d){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x5c877d[_0x0a9e('0x15')],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x5c877d[_0x0a9e('0x15')]));});});};exports[_0x0a9e('0x24')]=function(_0x296f41){var _0x2e8759=this;return new Promise(function(_0x1dbde2,_0x540530){return db[_0x0a9e('0x25')]['find']({'raw':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')]['where']||null:null,'attributes':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x296f41[_0x0a9e('0x1b')]['include'],function(_0x44295a){return{'model':db[_0x44295a['model']],'as':_0x44295a['as'],'attributes':_0x44295a[_0x0a9e('0x1e')],'include':_0x44295a[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x44295a[_0x0a9e('0x20')],function(_0x567193){return{'model':db[_0x567193[_0x0a9e('0x22')]],'as':_0x567193['as'],'attributes':_0x567193[_0x0a9e('0x1e')],'include':_0x567193[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x567193['include'],function(_0x54135e){return{'model':db[_0x54135e[_0x0a9e('0x22')]],'as':_0x54135e['as'],'attributes':_0x54135e['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x3d9717){logger[_0x0a9e('0x16')](_0x0a9e('0x24'),_0x296f41);logger['debug'](_0x0a9e('0x24'),_0x296f41,JSON[_0x0a9e('0x12')](_0x3d9717));_0x1dbde2(_0x3d9717);})[_0x0a9e('0x18')](function(_0x533942){logger[_0x0a9e('0x13')](_0x0a9e('0x24'),_0x533942[_0x0a9e('0x15')],_0x296f41);_0x540530(_0x2e8759['error'](0x1f4,_0x533942['message']));});});}; \ No newline at end of file +var _0xa9e0=['register','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowVoiceQueue','VoiceQueue','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter'];(function(_0xccb134,_0x5a373f){var _0x25daeb=function(_0x3546cd){while(--_0x3546cd){_0xccb134['push'](_0xccb134['shift']());}};_0x25daeb(++_0x5a373f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['VoiceQueue'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'limit':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]||null:null,'include':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x1314ae[_0x0a9e('0x1b')]['include'],function(_0x59181e){return{'model':db[_0x59181e[_0x0a9e('0x22')]],'as':_0x59181e['as'],'attributes':_0x59181e[_0x0a9e('0x1e')],'include':_0x59181e[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x59181e['include'],function(_0x384319){return{'model':db[_0x384319['model']],'as':_0x384319['as'],'attributes':_0x384319[_0x0a9e('0x1e')],'include':_0x384319['include']?_[_0x0a9e('0x21')](_0x384319[_0x0a9e('0x20')],function(_0x25fba9){return{'model':db[_0x25fba9[_0x0a9e('0x22')]],'as':_0x25fba9['as'],'attributes':_0x25fba9[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x11c3b6){logger[_0x0a9e('0x16')]('GetVoiceQueue',_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON[_0x0a9e('0x12')](_0x11c3b6));_0x1c696a(_0x11c3b6);})[_0x0a9e('0x18')](function(_0x5c877d){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x5c877d[_0x0a9e('0x15')],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x5c877d[_0x0a9e('0x15')]));});});};exports[_0x0a9e('0x24')]=function(_0x296f41){var _0x2e8759=this;return new Promise(function(_0x1dbde2,_0x540530){return db[_0x0a9e('0x25')]['find']({'raw':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')]['where']||null:null,'attributes':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x296f41[_0x0a9e('0x1b')]['include'],function(_0x44295a){return{'model':db[_0x44295a['model']],'as':_0x44295a['as'],'attributes':_0x44295a[_0x0a9e('0x1e')],'include':_0x44295a[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x44295a[_0x0a9e('0x20')],function(_0x567193){return{'model':db[_0x567193[_0x0a9e('0x22')]],'as':_0x567193['as'],'attributes':_0x567193[_0x0a9e('0x1e')],'include':_0x567193[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x567193['include'],function(_0x54135e){return{'model':db[_0x54135e[_0x0a9e('0x22')]],'as':_0x54135e['as'],'attributes':_0x54135e['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x3d9717){logger[_0x0a9e('0x16')](_0x0a9e('0x24'),_0x296f41);logger['debug'](_0x0a9e('0x24'),_0x296f41,JSON[_0x0a9e('0x12')](_0x3d9717));_0x1dbde2(_0x3d9717);})[_0x0a9e('0x18')](function(_0x533942){logger[_0x0a9e('0x13')](_0x0a9e('0x24'),_0x533942[_0x0a9e('0x15')],_0x296f41);_0x540530(_0x2e8759['error'](0x1f4,_0x533942['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index d132100..1c361f6 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 _0xf802=['remove','removeListener','register','voiceQueue:','save'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xf802,0x1ad));var _0x2f80=function(_0x40af78,_0x3d4e16){_0x40af78=_0x40af78-0x0;var _0x5bfb2e=_0xf802[_0x40af78];return _0x5bfb2e;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x2f80('0x0'),_0x2f80('0x1'),'update'];function createListener(_0x5eff33,_0x3f0a32){return function(_0x2c2953){_0x3f0a32['emit'](_0x5eff33,_0x2c2953);};}function removeListener(_0x416cfc,_0x40f144){return function(){VoiceQueueEvents[_0x2f80('0x2')](_0x416cfc,_0x40f144);};}exports[_0x2f80('0x3')]=function(_0xf5e9d3){for(var _0x5d5c3e=0x0,_0x2a981c=events['length'];_0x5d5c3e<_0x2a981c;_0x5d5c3e++){var _0x1829ce=events[_0x5d5c3e];var _0x364670=createListener(_0x2f80('0x4')+_0x1829ce,_0xf5e9d3);VoiceQueueEvents['on'](_0x1829ce,_0x364670);}}; \ No newline at end of file +var _0xbae9=['update','removeListener','register','length','voiceQueue:','./voiceQueue.events','save','remove'];(function(_0x4d2b99,_0x3a93f9){var _0x49b0f0=function(_0x30236c){while(--_0x30236c){_0x4d2b99['push'](_0x4d2b99['shift']());}};_0x49b0f0(++_0x3a93f9);}(_0xbae9,0x7d));var _0x9bae=function(_0x186d17,_0x9fa8ef){_0x186d17=_0x186d17-0x0;var _0x5d4b89=_0xbae9[_0x186d17];return _0x5d4b89;};'use strict';var VoiceQueueEvents=require(_0x9bae('0x0'));var events=[_0x9bae('0x1'),_0x9bae('0x2'),_0x9bae('0x3')];function createListener(_0x2fb8bd,_0x39bc1c){return function(_0x59d627){_0x39bc1c['emit'](_0x2fb8bd,_0x59d627);};}function removeListener(_0x252463,_0x2e1052){return function(){VoiceQueueEvents[_0x9bae('0x4')](_0x252463,_0x2e1052);};}exports[_0x9bae('0x5')]=function(_0x326004){for(var _0x3d92bc=0x0,_0x135cdb=events[_0x9bae('0x6')];_0x3d92bc<_0x135cdb;_0x3d92bc++){var _0x40cbbb=events[_0x3d92bc];var _0x376772=createListener(_0x9bae('0x7')+_0x40cbbb,_0x326004);VoiceQueueEvents['on'](_0x40cbbb,_0x376772);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index dbfcc1b..cb65602 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 _0x1114=['/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','getVoiceQueuesReport'];(function(_0x4c556c,_0x49f0de){var _0x53a390=function(_0x533159){while(--_0x533159){_0x4c556c['push'](_0x4c556c['shift']());}};_0x53a390(++_0x49f0de);}(_0x1114,0x1d5));var _0x4111=function(_0x1b3e32,_0x49ad74){_0x1b3e32=_0x1b3e32-0x0;var _0x4796e3=_0x1114[_0x1b3e32];return _0x4796e3;};'use strict';var multer=require(_0x4111('0x0'));var util=require(_0x4111('0x1'));var path=require(_0x4111('0x2'));var timeout=require(_0x4111('0x3'));var express=require(_0x4111('0x4'));var router=express[_0x4111('0x5')]();var auth=require(_0x4111('0x6'));var interaction=require(_0x4111('0x7'));var config=require(_0x4111('0x8'));var controller=require('./voiceQueueReport.controller');router[_0x4111('0x9')]('/',auth[_0x4111('0xa')](),controller[_0x4111('0xb')]);router[_0x4111('0x9')](_0x4111('0xc'),auth[_0x4111('0xa')](),controller[_0x4111('0xd')]);router[_0x4111('0x9')]('/index',auth[_0x4111('0xa')](),controller[_0x4111('0xe')]);router[_0x4111('0x9')](_0x4111('0xf'),auth['isAuthenticated'](),controller[_0x4111('0x10')]);router[_0x4111('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4111('0x12')](_0x4111('0xf'),auth[_0x4111('0xa')](),controller['update']);router[_0x4111('0x13')](_0x4111('0xf'),auth[_0x4111('0xa')](),controller[_0x4111('0x14')]);module[_0x4111('0x15')]=router; \ No newline at end of file +var _0x0cd5=['express','Router','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','index','get','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x120376,_0x571898){var _0x28c529=function(_0x4f130c){while(--_0x4f130c){_0x120376['push'](_0x120376['shift']());}};_0x28c529(++_0x571898);}(_0x0cd5,0x111));var _0x50cd=function(_0x486008,_0x2b2d05){_0x486008=_0x486008-0x0;var _0x2fefc7=_0x0cd5[_0x486008];return _0x2fefc7;};'use strict';var multer=require('multer');var util=require(_0x50cd('0x0'));var path=require(_0x50cd('0x1'));var timeout=require(_0x50cd('0x2'));var express=require(_0x50cd('0x3'));var router=express[_0x50cd('0x4')]();var auth=require(_0x50cd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x50cd('0x6'));var controller=require(_0x50cd('0x7'));router['get']('/',auth[_0x50cd('0x8')](),controller[_0x50cd('0x9')]);router[_0x50cd('0xa')]('/describe',auth[_0x50cd('0x8')](),controller[_0x50cd('0xb')]);router[_0x50cd('0xa')](_0x50cd('0xc'),auth[_0x50cd('0x8')](),controller[_0x50cd('0xd')]);router[_0x50cd('0xa')](_0x50cd('0xe'),auth[_0x50cd('0x8')](),controller[_0x50cd('0xf')]);router[_0x50cd('0x10')]('/',auth[_0x50cd('0x8')](),controller[_0x50cd('0x11')]);router[_0x50cd('0x12')](_0x50cd('0xe'),auth[_0x50cd('0x8')](),controller[_0x50cd('0x13')]);router[_0x50cd('0x14')]('/:id',auth[_0x50cd('0x8')](),controller[_0x50cd('0x15')]);module[_0x50cd('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 1ad7164..7970211 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 _0x5b44=['queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue'];(function(_0x2aa7a1,_0x1389b2){var _0x1c8bd1=function(_0x2f1746){while(--_0x2f1746){_0x2aa7a1['push'](_0x2aa7a1['shift']());}};_0x1c8bd1(++_0x1389b2);}(_0x5b44,0x86));var _0x45b4=function(_0x672c45,_0x4f03b3){_0x672c45=_0x672c45-0x0;var _0x168ca1=_0x5b44[_0x672c45];return _0x168ca1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x45b4('0x0'));module[_0x45b4('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x45b4('0x2')]},'calleridnum':{'type':Sequelize[_0x45b4('0x2')]},'calleridname':{'type':Sequelize[_0x45b4('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x45b4('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x45b4('0x3')],'set':function(_0x5062ba){var _0x1499f6=moment(_0x5062ba);var _0x148b7d=moment(this[_0x45b4('0x4')](_0x45b4('0x5')))['format'](_0x45b4('0x6'));var _0x594ea7=_0x1499f6[_0x45b4('0x7')](_0x148b7d,_0x45b4('0x8'));this[_0x45b4('0x9')](_0x45b4('0xa'),_0x5062ba);this[_0x45b4('0x9')](_0x45b4('0xb'),_0x594ea7||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x45b4('0xc')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x45b4('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x45b4('0x3')]},'queuecallerexit':{'type':Sequelize[_0x45b4('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x45b4('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x45b4('0x2')],'comment':_0x45b4('0xe')},'originalposition':{'type':Sequelize[_0x45b4('0xc')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x45b4('0x2')]},'accountcode':{'type':Sequelize[_0x45b4('0x2')]},'context':{'type':Sequelize[_0x45b4('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x45b4('0x2')]},'holdtime':{'type':Sequelize[_0x45b4('0xc')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x45b4('0xf')},'transferexten':{'type':Sequelize[_0x45b4('0x2')]},'transferuniqueid':{'type':Sequelize[_0x45b4('0x2')]},'disposition':{'type':Sequelize[_0x45b4('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa5be=['YYYY-MM-DD\x20HH:mm:ss','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE','getDataValue','queuecallerjoinAt','format'];(function(_0x45dea6,_0x4ac662){var _0x1eedc9=function(_0x77199f){while(--_0x77199f){_0x45dea6['push'](_0x45dea6['shift']());}};_0x1eedc9(++_0x4ac662);}(_0xa5be,0x89));var _0xea5b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xa5be[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0xea5b('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0xea5b('0x1')]},'uniqueid':{'type':Sequelize[_0xea5b('0x1')]},'calleridnum':{'type':Sequelize[_0xea5b('0x1')]},'calleridname':{'type':Sequelize[_0xea5b('0x1')]},'queue':{'type':Sequelize[_0xea5b('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0xea5b('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0xea5b('0x2')],'set':function(_0x1be004){var _0x45d625=moment(_0x1be004);var _0x367697=moment(this[_0xea5b('0x3')](_0xea5b('0x4')))[_0xea5b('0x5')](_0xea5b('0x6'));var _0x4c49f8=_0x45d625['diff'](_0x367697,'seconds');this[_0xea5b('0x7')](_0xea5b('0x8'),_0x1be004);this[_0xea5b('0x7')]('holdtime',_0x4c49f8||null);}},'position':{'type':Sequelize[_0xea5b('0x9')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xea5b('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xea5b('0x2')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xea5b('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xea5b('0xb')},'originalposition':{'type':Sequelize[_0xea5b('0x9')]},'channel':{'type':Sequelize[_0xea5b('0x1')]},'connectedlinenum':{'type':Sequelize[_0xea5b('0x1')]},'connectedlinename':{'type':Sequelize[_0xea5b('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xea5b('0x1')]},'exten':{'type':Sequelize[_0xea5b('0x1')]},'priority':{'type':Sequelize[_0xea5b('0x1')]},'holdtime':{'type':Sequelize[_0xea5b('0x9')]},'mohtime':{'type':Sequelize[_0xea5b('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xea5b('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xea5b('0x1')]},'transfer':{'type':Sequelize[_0xea5b('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xea5b('0x1')],'comment':_0xea5b('0xc')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xea5b('0x1')]},'disposition':{'type':Sequelize[_0xea5b('0x1')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'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 2b934aa..eb6b518 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 _0x0caf=['getVoiceQueuesReport','sort','filter','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./voiceQueueReport.socket','register','end','status','count','offset','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','send','index','VoiceQueueReport','rawAttributes','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','filters','pick','where','merge','map','type','VIRTUAL','field','includeAll','include','findAll','rows','catch','keys','options','find','create','body','destroy','params','describe'];(function(_0x4fe19c,_0x45d0fe){var _0x952ac7=function(_0x274a16){while(--_0x274a16){_0x4fe19c['push'](_0x4fe19c['shift']());}};_0x952ac7(++_0x45d0fe);}(_0x0caf,0x9f));var _0xf0ca=function(_0x5c1083,_0x3fc9e5){_0x5c1083=_0x5c1083-0x0;var _0x1ec071=_0x0caf[_0x5c1083];return _0x1ec071;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf0ca('0x0'));var jsonpatch=require(_0xf0ca('0x1'));var rp=require(_0xf0ca('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf0ca('0x3'));var util=require(_0xf0ca('0x4'));var path=require('path');var sox=require(_0xf0ca('0x5'));var csv=require(_0xf0ca('0x6'));var ejs=require(_0xf0ca('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf0ca('0x8'));var crypto=require(_0xf0ca('0x9'));var jsforce=require(_0xf0ca('0xa'));var deskjs=require(_0xf0ca('0xb'));var toCsv=require(_0xf0ca('0x6'));var querystring=require(_0xf0ca('0xc'));var Papa=require(_0xf0ca('0xd'));var Redis=require('ioredis');var authService=require(_0xf0ca('0xe'));var qs=require(_0xf0ca('0xf'));var hardwareService=require(_0xf0ca('0x10'));var logger=require(_0xf0ca('0x11'))(_0xf0ca('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf0ca('0x13'))['db'];config['redis']=_[_0xf0ca('0x14')](config['redis'],{'host':_0xf0ca('0x15'),'port':0x18eb});var socket=require(_0xf0ca('0x16'))(new Redis(config[_0xf0ca('0x17')]));require(_0xf0ca('0x18'))[_0xf0ca('0x19')](socket);function respondWithStatusCode(_0x3f6251,_0x5c5875){_0x5c5875=_0x5c5875||0xcc;return function(_0x6d9157){if(_0x6d9157){return _0x3f6251['sendStatus'](_0x5c5875);}return _0x3f6251['status'](_0x5c5875)[_0xf0ca('0x1a')]();};}function respondWithResult(_0x34ea00,_0x3b1daa){_0x3b1daa=_0x3b1daa||0xc8;return function(_0x2b074e){if(_0x2b074e){return _0x34ea00[_0xf0ca('0x1b')](_0x3b1daa)['json'](_0x2b074e);}};}function respondWithFilteredResult(_0x5cbd5e,_0x2c15cc){return function(_0x4d08f2){if(_0x4d08f2){var _0x5af77f=_0x4d08f2[_0xf0ca('0x1c')],_0x3245b2=_0x2c15cc[_0xf0ca('0x1d')],_0x5eb7e8=_0x2c15cc[_0xf0ca('0x1d')]+_0x2c15cc['limit'],_0x2473f0;if(_0x5eb7e8>=_0x5af77f){_0x5eb7e8=_0x5af77f;_0x2473f0=0xc8;}else{_0x2473f0=0xce;}_0x5cbd5e[_0xf0ca('0x1b')](_0x2473f0);return _0x5cbd5e['set'](_0xf0ca('0x1e'),_0x3245b2+'-'+_0x5eb7e8+'/'+_0x5af77f)[_0xf0ca('0x1f')](_0x4d08f2);}return null;};}function patchUpdates(_0x50f742){return function(_0x24303d){try{jsonpatch[_0xf0ca('0x20')](_0x24303d,_0x50f742,!![]);}catch(_0x3512b3){return BPromise[_0xf0ca('0x21')](_0x3512b3);}return _0x24303d[_0xf0ca('0x22')]();};}function saveUpdates(_0x2e54bf,_0x3414eb){return function(_0x520863){if(_0x520863){return _0x520863[_0xf0ca('0x23')](_0x2e54bf)[_0xf0ca('0x24')](function(_0x1ba29d){return _0x1ba29d;});}return null;};}function removeEntity(_0x3d6bad,_0x5f31c6){return function(_0xd8312a){if(_0xd8312a){return _0xd8312a['destroy']()['then'](function(){_0x3d6bad[_0xf0ca('0x1b')](0xcc)[_0xf0ca('0x1a')]();});}};}function handleEntityNotFound(_0x8dbaed,_0x11916a){return function(_0x106f8e){if(!_0x106f8e){_0x8dbaed[_0xf0ca('0x25')](0x194);}return _0x106f8e;};}function handleError(_0x20bfbc,_0x30b5a3){_0x30b5a3=_0x30b5a3||0x1f4;return function(_0x4c2365){logger['error'](_0x4c2365[_0xf0ca('0x26')]);if(_0x4c2365[_0xf0ca('0x27')]){delete _0x4c2365['name'];}_0x20bfbc[_0xf0ca('0x1b')](_0x30b5a3)[_0xf0ca('0x28')](_0x4c2365);};}exports[_0xf0ca('0x29')]=function(_0x2aaae9,_0x48bbf8){var _0xb41d0a={},_0xbefb0e={},_0x35b78c={'count':0x0,'rows':[]};var _0x2ee938=db[_0xf0ca('0x2a')][_0xf0ca('0x2b')];_0xbefb0e[_0xf0ca('0x2c')]=_['keys'](_0x2ee938);_0xbefb0e[_0xf0ca('0x2d')]=_['keys'](_0x2aaae9[_0xf0ca('0x2d')]);_0xbefb0e['filters']=_[_0xf0ca('0x2e')](_0xbefb0e[_0xf0ca('0x2c')],_0xbefb0e[_0xf0ca('0x2d')]);_0xb41d0a[_0xf0ca('0x2f')]=_[_0xf0ca('0x2e')](_0xbefb0e[_0xf0ca('0x2c')],qs[_0xf0ca('0x30')](_0x2aaae9[_0xf0ca('0x2d')][_0xf0ca('0x30')]));_0xb41d0a[_0xf0ca('0x2f')]=_0xb41d0a[_0xf0ca('0x2f')][_0xf0ca('0x31')]?_0xb41d0a[_0xf0ca('0x2f')]:_0xbefb0e[_0xf0ca('0x2c')];if(!_0x2aaae9['query'][_0xf0ca('0x32')](_0xf0ca('0x33'))){_0xb41d0a[_0xf0ca('0x34')]=qs[_0xf0ca('0x34')](_0x2aaae9['query'][_0xf0ca('0x34')]);_0xb41d0a['offset']=qs[_0xf0ca('0x1d')](_0x2aaae9['query'][_0xf0ca('0x1d')]);}_0xb41d0a[_0xf0ca('0x35')]=qs['sort'](_0x2aaae9[_0xf0ca('0x2d')]['sort']);_0xb41d0a['where']=qs[_0xf0ca('0x36')](_[_0xf0ca('0x37')](_0x2aaae9[_0xf0ca('0x2d')],_0xbefb0e[_0xf0ca('0x36')]));if(_0x2aaae9[_0xf0ca('0x2d')]['filter']){_0xb41d0a[_0xf0ca('0x38')]=_[_0xf0ca('0x39')](_0xb41d0a[_0xf0ca('0x38')],{'$or':_[_0xf0ca('0x3a')](_0x2ee938,function(_0xb891bf){if(_0xb891bf[_0xf0ca('0x3b')]['key']!==_0xf0ca('0x3c')){var _0x4204a7={};_0x4204a7[_0xb891bf[_0xf0ca('0x3d')]]={'$like':'%'+_0x2aaae9[_0xf0ca('0x2d')]['filter']+'%'};return _0x4204a7;}})});}_0xb41d0a=_[_0xf0ca('0x39')]({},_0xb41d0a,_0x2aaae9['options']);var _0x3a7f56={'where':_0xb41d0a[_0xf0ca('0x38')]};return db[_0xf0ca('0x2a')][_0xf0ca('0x1c')](_0x3a7f56)[_0xf0ca('0x24')](function(_0x593732){_0x35b78c['count']=_0x593732;if(_0x2aaae9[_0xf0ca('0x2d')][_0xf0ca('0x3e')]){_0xb41d0a[_0xf0ca('0x3f')]=[{'all':!![]}];}return db[_0xf0ca('0x2a')][_0xf0ca('0x40')](_0xb41d0a);})[_0xf0ca('0x24')](function(_0x318c07){_0x35b78c[_0xf0ca('0x41')]=_0x318c07;return _0x35b78c;})[_0xf0ca('0x24')](respondWithFilteredResult(_0x48bbf8,_0xb41d0a))[_0xf0ca('0x42')](handleError(_0x48bbf8,null));};exports['show']=function(_0x466857,_0x19dd2e){var _0x1556a4={'raw':![],'where':{'id':_0x466857['params']['id']}},_0x23f901={};_0x23f901['model']=_[_0xf0ca('0x43')](db[_0xf0ca('0x2a')][_0xf0ca('0x2b')]);_0x23f901['query']=_[_0xf0ca('0x43')](_0x466857[_0xf0ca('0x2d')]);_0x23f901[_0xf0ca('0x36')]=_[_0xf0ca('0x2e')](_0x23f901[_0xf0ca('0x2c')],_0x23f901[_0xf0ca('0x2d')]);_0x1556a4[_0xf0ca('0x2f')]=_[_0xf0ca('0x2e')](_0x23f901[_0xf0ca('0x2c')],qs[_0xf0ca('0x30')](_0x466857[_0xf0ca('0x2d')][_0xf0ca('0x30')]));_0x1556a4[_0xf0ca('0x2f')]=_0x1556a4[_0xf0ca('0x2f')][_0xf0ca('0x31')]?_0x1556a4[_0xf0ca('0x2f')]:_0x23f901[_0xf0ca('0x2c')];if(_0x466857[_0xf0ca('0x2d')][_0xf0ca('0x3e')]){_0x1556a4[_0xf0ca('0x3f')]=[{'all':!![]}];}_0x1556a4=_[_0xf0ca('0x39')]({},_0x1556a4,_0x466857[_0xf0ca('0x44')]);return db[_0xf0ca('0x2a')][_0xf0ca('0x45')](_0x1556a4)[_0xf0ca('0x24')](handleEntityNotFound(_0x19dd2e,null))['then'](respondWithResult(_0x19dd2e,null))[_0xf0ca('0x42')](handleError(_0x19dd2e,null));};exports[_0xf0ca('0x46')]=function(_0x1389c4,_0x23158a){return db[_0xf0ca('0x2a')]['create'](_0x1389c4[_0xf0ca('0x47')],{})[_0xf0ca('0x24')](respondWithResult(_0x23158a,0xc9))['catch'](handleError(_0x23158a,null));};exports['update']=function(_0x246611,_0x3e6b79){if(_0x246611[_0xf0ca('0x47')]['id']){delete _0x246611['body']['id'];}return db[_0xf0ca('0x2a')]['find']({'where':{'id':_0x246611['params']['id']}})[_0xf0ca('0x24')](handleEntityNotFound(_0x3e6b79,null))['then'](saveUpdates(_0x246611['body'],null))[_0xf0ca('0x24')](respondWithResult(_0x3e6b79,null))['catch'](handleError(_0x3e6b79,null));};exports[_0xf0ca('0x48')]=function(_0x2bee7d,_0x3d0ab3){return db[_0xf0ca('0x2a')][_0xf0ca('0x45')]({'where':{'id':_0x2bee7d[_0xf0ca('0x49')]['id']}})['then'](handleEntityNotFound(_0x3d0ab3,null))[_0xf0ca('0x24')](removeEntity(_0x3d0ab3,null))[_0xf0ca('0x42')](handleError(_0x3d0ab3,null));};exports[_0xf0ca('0x4a')]=function(_0x394db0,_0x5737d3){return db[_0xf0ca('0x2a')][_0xf0ca('0x4a')]()[_0xf0ca('0x24')](respondWithResult(_0x5737d3,null))[_0xf0ca('0x42')](handleError(_0x5737d3,null));};exports[_0xf0ca('0x4b')]=function(_0x121690,_0x1685f0){var _0x8200f3={},_0x4f132d={},_0x4c4e50={'count':0x0,'rows':[]};_0x4f132d[_0xf0ca('0x2c')]=_[_0xf0ca('0x43')](db[_0xf0ca('0x2a')][_0xf0ca('0x2b')]);_0x4f132d[_0xf0ca('0x2d')]=_[_0xf0ca('0x43')](_0x121690[_0xf0ca('0x2d')]);_0x4f132d[_0xf0ca('0x36')]=_[_0xf0ca('0x2e')](_0x4f132d[_0xf0ca('0x2c')],_0x4f132d[_0xf0ca('0x2d')]);_0x8200f3[_0xf0ca('0x2f')]=_[_0xf0ca('0x2e')](_0x4f132d[_0xf0ca('0x2c')],qs['fields'](_0x121690[_0xf0ca('0x2d')][_0xf0ca('0x30')]));_0x8200f3['attributes']=_0x8200f3[_0xf0ca('0x2f')][_0xf0ca('0x31')]?_0x8200f3['attributes']:_0x4f132d[_0xf0ca('0x2c')];if(!_0x121690['query'][_0xf0ca('0x32')]('nolimit')){_0x8200f3[_0xf0ca('0x34')]=qs[_0xf0ca('0x34')](_0x121690[_0xf0ca('0x2d')][_0xf0ca('0x34')]);_0x8200f3[_0xf0ca('0x1d')]=qs[_0xf0ca('0x1d')](_0x121690[_0xf0ca('0x2d')][_0xf0ca('0x1d')]);}_0x8200f3[_0xf0ca('0x35')]=qs[_0xf0ca('0x4c')](_0x121690[_0xf0ca('0x2d')][_0xf0ca('0x4c')]);_0x8200f3[_0xf0ca('0x38')]=qs[_0xf0ca('0x36')](_['pick'](_0x121690[_0xf0ca('0x2d')],_0x4f132d[_0xf0ca('0x36')]));if(_0x121690[_0xf0ca('0x2d')][_0xf0ca('0x4d')]){_0x8200f3[_0xf0ca('0x38')]=_['merge'](_0x8200f3['where'],{'$or':_['map'](_0x8200f3['attributes'],function(_0x29b5be){var _0x3a7f59={};_0x3a7f59[_0x29b5be]={'$like':'%'+_0x121690[_0xf0ca('0x2d')][_0xf0ca('0x4d')]+'%'};return _0x3a7f59;})});}_0x8200f3=_['merge']({},_0x8200f3,_0x121690[_0xf0ca('0x44')]);var _0x5d4a16={'where':_0x8200f3[_0xf0ca('0x38')]};return db[_0xf0ca('0x2a')]['count'](_0x5d4a16)[_0xf0ca('0x24')](function(_0x68ff58){_0x4c4e50[_0xf0ca('0x1c')]=_0x68ff58;if(_0x121690['query'][_0xf0ca('0x3e')]){_0x8200f3['include']=[{'all':!![]}];}return db[_0xf0ca('0x2a')][_0xf0ca('0x40')](_0x8200f3);})[_0xf0ca('0x24')](function(_0x3c4796){_0x4c4e50[_0xf0ca('0x41')]=_0x3c4796;return _0x4c4e50;})[_0xf0ca('0x24')](respondWithFilteredResult(_0x1685f0,_0x8200f3,_0xf0ca('0x4b')))[_0xf0ca('0x42')](handleError(_0x1685f0,null,_0xf0ca('0x4b')));}; \ No newline at end of file +var _0xa7b5=['pick','filter','merge','where','map','type','key','VIRTUAL','field','options','then','includeAll','include','findAll','rows','catch','params','model','create','body','find','destroy','describe','getVoiceQueuesReport','hasOwnProperty','order','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','count','offset','limit','set','Content-Range','reject','save','sendStatus','error','name','index','VoiceQueueReport','rawAttributes','keys','query','filters','intersection','fields','attributes','length','nolimit','sort'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xa7b5,0x15a));var _0x5a7b=function(_0x5b1601,_0x314367){_0x5b1601=_0x5b1601-0x0;var _0x475ae8=_0xa7b5[_0x5b1601];return _0x475ae8;};'use strict';var pdf=require(_0x5a7b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5a7b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5a7b('0x2'));var rp=require(_0x5a7b('0x3'));var moment=require(_0x5a7b('0x4'));var BPromise=require(_0x5a7b('0x5'));var Mustache=require(_0x5a7b('0x6'));var util=require(_0x5a7b('0x7'));var path=require(_0x5a7b('0x8'));var sox=require(_0x5a7b('0x9'));var csv=require(_0x5a7b('0xa'));var ejs=require(_0x5a7b('0xb'));var fs=require('fs');var _=require(_0x5a7b('0xc'));var squel=require(_0x5a7b('0xd'));var crypto=require(_0x5a7b('0xe'));var jsforce=require(_0x5a7b('0xf'));var deskjs=require(_0x5a7b('0x10'));var toCsv=require(_0x5a7b('0xa'));var querystring=require(_0x5a7b('0x11'));var Papa=require(_0x5a7b('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5a7b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5a7b('0x14'))(_0x5a7b('0x15'));var utils=require(_0x5a7b('0x16'));var config=require(_0x5a7b('0x17'));var db=require(_0x5a7b('0x18'))['db'];config[_0x5a7b('0x19')]=_[_0x5a7b('0x1a')](config[_0x5a7b('0x19')],{'host':_0x5a7b('0x1b'),'port':0x18eb});var socket=require(_0x5a7b('0x1c'))(new Redis(config[_0x5a7b('0x19')]));require('./voiceQueueReport.socket')[_0x5a7b('0x1d')](socket);function respondWithStatusCode(_0x43f889,_0x1a217e){_0x1a217e=_0x1a217e||0xcc;return function(_0x292a44){if(_0x292a44){return _0x43f889['sendStatus'](_0x1a217e);}return _0x43f889[_0x5a7b('0x1e')](_0x1a217e)[_0x5a7b('0x1f')]();};}function respondWithResult(_0x599bb8,_0x3e922e){_0x3e922e=_0x3e922e||0xc8;return function(_0x4d2e57){if(_0x4d2e57){return _0x599bb8[_0x5a7b('0x1e')](_0x3e922e)['json'](_0x4d2e57);}};}function respondWithFilteredResult(_0x340241,_0x3c3359){return function(_0x2fc1fa){if(_0x2fc1fa){var _0x5a3a89=_0x2fc1fa[_0x5a7b('0x20')],_0x33b996=_0x3c3359[_0x5a7b('0x21')],_0x490d82=_0x3c3359[_0x5a7b('0x21')]+_0x3c3359[_0x5a7b('0x22')],_0x192009;if(_0x490d82>=_0x5a3a89){_0x490d82=_0x5a3a89;_0x192009=0xc8;}else{_0x192009=0xce;}_0x340241[_0x5a7b('0x1e')](_0x192009);return _0x340241[_0x5a7b('0x23')](_0x5a7b('0x24'),_0x33b996+'-'+_0x490d82+'/'+_0x5a3a89)['json'](_0x2fc1fa);}return null;};}function patchUpdates(_0x4126a5){return function(_0x6695e1){try{jsonpatch['apply'](_0x6695e1,_0x4126a5,!![]);}catch(_0x49a892){return BPromise[_0x5a7b('0x25')](_0x49a892);}return _0x6695e1[_0x5a7b('0x26')]();};}function saveUpdates(_0x2ebf51,_0x8b05ef){return function(_0x285369){if(_0x285369){return _0x285369['update'](_0x2ebf51)['then'](function(_0x1ad9cc){return _0x1ad9cc;});}return null;};}function removeEntity(_0x342a23,_0x26442f){return function(_0x2a0550){if(_0x2a0550){return _0x2a0550['destroy']()['then'](function(){_0x342a23['status'](0xcc)[_0x5a7b('0x1f')]();});}};}function handleEntityNotFound(_0x3fbff6,_0x11223d){return function(_0x3e572a){if(!_0x3e572a){_0x3fbff6[_0x5a7b('0x27')](0x194);}return _0x3e572a;};}function handleError(_0x5673b9,_0x2d8001){_0x2d8001=_0x2d8001||0x1f4;return function(_0x55724d){logger[_0x5a7b('0x28')](_0x55724d['stack']);if(_0x55724d[_0x5a7b('0x29')]){delete _0x55724d[_0x5a7b('0x29')];}_0x5673b9[_0x5a7b('0x1e')](_0x2d8001)['send'](_0x55724d);};}exports[_0x5a7b('0x2a')]=function(_0x449cc7,_0x169762){var _0x54f1c6={},_0x36b90e={},_0x3172a8={'count':0x0,'rows':[]};var _0x27b2cf=db[_0x5a7b('0x2b')][_0x5a7b('0x2c')];_0x36b90e['model']=_[_0x5a7b('0x2d')](_0x27b2cf);_0x36b90e[_0x5a7b('0x2e')]=_[_0x5a7b('0x2d')](_0x449cc7[_0x5a7b('0x2e')]);_0x36b90e[_0x5a7b('0x2f')]=_[_0x5a7b('0x30')](_0x36b90e['model'],_0x36b90e[_0x5a7b('0x2e')]);_0x54f1c6['attributes']=_[_0x5a7b('0x30')](_0x36b90e['model'],qs[_0x5a7b('0x31')](_0x449cc7[_0x5a7b('0x2e')][_0x5a7b('0x31')]));_0x54f1c6[_0x5a7b('0x32')]=_0x54f1c6[_0x5a7b('0x32')][_0x5a7b('0x33')]?_0x54f1c6[_0x5a7b('0x32')]:_0x36b90e['model'];if(!_0x449cc7[_0x5a7b('0x2e')]['hasOwnProperty'](_0x5a7b('0x34'))){_0x54f1c6[_0x5a7b('0x22')]=qs[_0x5a7b('0x22')](_0x449cc7[_0x5a7b('0x2e')]['limit']);_0x54f1c6[_0x5a7b('0x21')]=qs[_0x5a7b('0x21')](_0x449cc7[_0x5a7b('0x2e')][_0x5a7b('0x21')]);}_0x54f1c6['order']=qs[_0x5a7b('0x35')](_0x449cc7[_0x5a7b('0x2e')][_0x5a7b('0x35')]);_0x54f1c6['where']=qs[_0x5a7b('0x2f')](_[_0x5a7b('0x36')](_0x449cc7[_0x5a7b('0x2e')],_0x36b90e[_0x5a7b('0x2f')]));if(_0x449cc7['query'][_0x5a7b('0x37')]){_0x54f1c6['where']=_[_0x5a7b('0x38')](_0x54f1c6[_0x5a7b('0x39')],{'$or':_[_0x5a7b('0x3a')](_0x27b2cf,function(_0x4ce165){if(_0x4ce165[_0x5a7b('0x3b')][_0x5a7b('0x3c')]!==_0x5a7b('0x3d')){var _0x1307b3={};_0x1307b3[_0x4ce165[_0x5a7b('0x3e')]]={'$like':'%'+_0x449cc7[_0x5a7b('0x2e')][_0x5a7b('0x37')]+'%'};return _0x1307b3;}})});}_0x54f1c6=_[_0x5a7b('0x38')]({},_0x54f1c6,_0x449cc7[_0x5a7b('0x3f')]);var _0x127ecc={'where':_0x54f1c6['where']};return db['VoiceQueueReport']['count'](_0x127ecc)[_0x5a7b('0x40')](function(_0x4e2708){_0x3172a8[_0x5a7b('0x20')]=_0x4e2708;if(_0x449cc7['query'][_0x5a7b('0x41')]){_0x54f1c6[_0x5a7b('0x42')]=[{'all':!![]}];}return db[_0x5a7b('0x2b')][_0x5a7b('0x43')](_0x54f1c6);})[_0x5a7b('0x40')](function(_0x5e245d){_0x3172a8[_0x5a7b('0x44')]=_0x5e245d;return _0x3172a8;})[_0x5a7b('0x40')](respondWithFilteredResult(_0x169762,_0x54f1c6))[_0x5a7b('0x45')](handleError(_0x169762,null));};exports['show']=function(_0x959137,_0x2124fa){var _0x346749={'raw':![],'where':{'id':_0x959137[_0x5a7b('0x46')]['id']}},_0x476213={};_0x476213[_0x5a7b('0x47')]=_['keys'](db[_0x5a7b('0x2b')]['rawAttributes']);_0x476213[_0x5a7b('0x2e')]=_['keys'](_0x959137[_0x5a7b('0x2e')]);_0x476213['filters']=_[_0x5a7b('0x30')](_0x476213[_0x5a7b('0x47')],_0x476213['query']);_0x346749['attributes']=_[_0x5a7b('0x30')](_0x476213['model'],qs[_0x5a7b('0x31')](_0x959137['query']['fields']));_0x346749['attributes']=_0x346749[_0x5a7b('0x32')][_0x5a7b('0x33')]?_0x346749[_0x5a7b('0x32')]:_0x476213['model'];if(_0x959137[_0x5a7b('0x2e')][_0x5a7b('0x41')]){_0x346749['include']=[{'all':!![]}];}_0x346749=_[_0x5a7b('0x38')]({},_0x346749,_0x959137['options']);return db[_0x5a7b('0x2b')]['find'](_0x346749)['then'](handleEntityNotFound(_0x2124fa,null))[_0x5a7b('0x40')](respondWithResult(_0x2124fa,null))[_0x5a7b('0x45')](handleError(_0x2124fa,null));};exports[_0x5a7b('0x48')]=function(_0x31d613,_0xb60b8){return db['VoiceQueueReport'][_0x5a7b('0x48')](_0x31d613[_0x5a7b('0x49')],{})[_0x5a7b('0x40')](respondWithResult(_0xb60b8,0xc9))[_0x5a7b('0x45')](handleError(_0xb60b8,null));};exports['update']=function(_0x4924b9,_0x108d85){if(_0x4924b9['body']['id']){delete _0x4924b9[_0x5a7b('0x49')]['id'];}return db[_0x5a7b('0x2b')][_0x5a7b('0x4a')]({'where':{'id':_0x4924b9[_0x5a7b('0x46')]['id']}})['then'](handleEntityNotFound(_0x108d85,null))[_0x5a7b('0x40')](saveUpdates(_0x4924b9['body'],null))['then'](respondWithResult(_0x108d85,null))[_0x5a7b('0x45')](handleError(_0x108d85,null));};exports[_0x5a7b('0x4b')]=function(_0x5eb7bf,_0x4f981e){return db['VoiceQueueReport'][_0x5a7b('0x4a')]({'where':{'id':_0x5eb7bf[_0x5a7b('0x46')]['id']}})['then'](handleEntityNotFound(_0x4f981e,null))[_0x5a7b('0x40')](removeEntity(_0x4f981e,null))[_0x5a7b('0x45')](handleError(_0x4f981e,null));};exports['describe']=function(_0x28be64,_0x5a4557){return db[_0x5a7b('0x2b')][_0x5a7b('0x4c')]()[_0x5a7b('0x40')](respondWithResult(_0x5a4557,null))[_0x5a7b('0x45')](handleError(_0x5a4557,null));};exports[_0x5a7b('0x4d')]=function(_0x4865fb,_0x3a9262){var _0x39538d={},_0xee0061={},_0x4c736f={'count':0x0,'rows':[]};_0xee0061[_0x5a7b('0x47')]=_[_0x5a7b('0x2d')](db[_0x5a7b('0x2b')]['rawAttributes']);_0xee0061[_0x5a7b('0x2e')]=_[_0x5a7b('0x2d')](_0x4865fb['query']);_0xee0061[_0x5a7b('0x2f')]=_[_0x5a7b('0x30')](_0xee0061['model'],_0xee0061[_0x5a7b('0x2e')]);_0x39538d[_0x5a7b('0x32')]=_['intersection'](_0xee0061[_0x5a7b('0x47')],qs[_0x5a7b('0x31')](_0x4865fb[_0x5a7b('0x2e')][_0x5a7b('0x31')]));_0x39538d['attributes']=_0x39538d[_0x5a7b('0x32')][_0x5a7b('0x33')]?_0x39538d[_0x5a7b('0x32')]:_0xee0061['model'];if(!_0x4865fb['query'][_0x5a7b('0x4e')]('nolimit')){_0x39538d[_0x5a7b('0x22')]=qs[_0x5a7b('0x22')](_0x4865fb[_0x5a7b('0x2e')]['limit']);_0x39538d[_0x5a7b('0x21')]=qs[_0x5a7b('0x21')](_0x4865fb[_0x5a7b('0x2e')][_0x5a7b('0x21')]);}_0x39538d[_0x5a7b('0x4f')]=qs['sort'](_0x4865fb[_0x5a7b('0x2e')][_0x5a7b('0x35')]);_0x39538d['where']=qs[_0x5a7b('0x2f')](_[_0x5a7b('0x36')](_0x4865fb[_0x5a7b('0x2e')],_0xee0061[_0x5a7b('0x2f')]));if(_0x4865fb['query'][_0x5a7b('0x37')]){_0x39538d[_0x5a7b('0x39')]=_[_0x5a7b('0x38')](_0x39538d[_0x5a7b('0x39')],{'$or':_[_0x5a7b('0x3a')](_0x39538d[_0x5a7b('0x32')],function(_0x3a3479){var _0x247afa={};_0x247afa[_0x3a3479]={'$like':'%'+_0x4865fb[_0x5a7b('0x2e')][_0x5a7b('0x37')]+'%'};return _0x247afa;})});}_0x39538d=_[_0x5a7b('0x38')]({},_0x39538d,_0x4865fb['options']);var _0x55795e={'where':_0x39538d[_0x5a7b('0x39')]};return db[_0x5a7b('0x2b')][_0x5a7b('0x20')](_0x55795e)['then'](function(_0x21fa1a){_0x4c736f[_0x5a7b('0x20')]=_0x21fa1a;if(_0x4865fb[_0x5a7b('0x2e')][_0x5a7b('0x41')]){_0x39538d[_0x5a7b('0x42')]=[{'all':!![]}];}return db[_0x5a7b('0x2b')][_0x5a7b('0x43')](_0x39538d);})[_0x5a7b('0x40')](function(_0x38b48a){_0x4c736f[_0x5a7b('0x44')]=_0x38b48a;return _0x4c736f;})[_0x5a7b('0x40')](respondWithFilteredResult(_0x3a9262,_0x39538d,'getVoiceQueuesReport'))[_0x5a7b('0x45')](handleError(_0x3a9262,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 05a9a16..a1d211c 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 _0xef4d=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xef4d,0xad));var _0xdef4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xef4d[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xdef4('0x0'));var VoiceQueueReport=require(_0xdef4('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xdef4('0x2')](0x0);var events={'afterCreate':_0xdef4('0x3'),'afterUpdate':_0xdef4('0x4'),'afterDestroy':_0xdef4('0x5')};function emitEvent(_0x3477d0){return function(_0x5468ff,_0x2c4b53,_0x5da850){VoiceQueueReportEvents[_0xdef4('0x6')](_0x3477d0+':'+_0x5468ff['id'],_0x5468ff);VoiceQueueReportEvents[_0xdef4('0x6')](_0x3477d0,_0x5468ff);_0x5da850(null);};}for(var e in events){if(events[_0xdef4('0x7')](e)){var event=events[e];VoiceQueueReport[_0xdef4('0x8')](e,emitEvent(event));}}module[_0xdef4('0x9')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x4b84=['events','../../mysqldb','save','hasOwnProperty','exports'];(function(_0x343e44,_0x519af9){var _0xa5130e=function(_0xae1fa0){while(--_0xae1fa0){_0x343e44['push'](_0x343e44['shift']());}};_0xa5130e(++_0x519af9);}(_0x4b84,0x1cc));var _0x44b8=function(_0x33975c,_0x50d085){_0x33975c=_0x33975c-0x0;var _0x1c15ab=_0x4b84[_0x33975c];return _0x1c15ab;};'use strict';var EventEmitter=require(_0x44b8('0x0'));var VoiceQueueReport=require(_0x44b8('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x44b8('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3b26c7){return function(_0x31282a,_0x39ad16,_0x5766b0){VoiceQueueReportEvents['emit'](_0x3b26c7+':'+_0x31282a['id'],_0x31282a);VoiceQueueReportEvents['emit'](_0x3b26c7,_0x31282a);_0x5766b0(null);};}for(var e in events){if(events[_0x44b8('0x3')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x44b8('0x4')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index f994310..39bad8e 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 _0x1e58=['exports','VoiceQueueReport','report_queue','lodash','util','moment','bluebird','request-promise','rimraf','./voiceQueueReport.attributes'];(function(_0x158d21,_0x2b6b98){var _0x45f34a=function(_0xfca326){while(--_0xfca326){_0x158d21['push'](_0x158d21['shift']());}};_0x45f34a(++_0x2b6b98);}(_0x1e58,0xe9));var _0x81e5=function(_0x1614df,_0x14e412){_0x1614df=_0x1614df-0x0;var _0x4d677c=_0x1e58[_0x1614df];return _0x4d677c;};'use strict';var _=require(_0x81e5('0x0'));var util=require(_0x81e5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x81e5('0x2'));var BPromise=require(_0x81e5('0x3'));var rp=require(_0x81e5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x81e5('0x5'));var config=require('../../config/environment');var attributes=require(_0x81e5('0x6'));module[_0x81e5('0x7')]=function(_0x1f0266,_0x5c6abf){return _0x1f0266['define'](_0x81e5('0x8'),attributes,{'tableName':_0x81e5('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0xced3=['calleridnum','util','moment','bluebird','request-promise','path','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue'];(function(_0x3dbc4c,_0x5ed9e8){var _0x3871e2=function(_0x52e897){while(--_0x52e897){_0x3dbc4c['push'](_0x3dbc4c['shift']());}};_0x3871e2(++_0x5ed9e8);}(_0xced3,0x12a));var _0x3ced=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xced3[_0x243b59];return _0x3e1676;};'use strict';var _=require('lodash');var util=require(_0x3ced('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3ced('0x1'));var BPromise=require(_0x3ced('0x2'));var rp=require(_0x3ced('0x3'));var fs=require('fs');var path=require(_0x3ced('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3ced('0x5'));module[_0x3ced('0x6')]=function(_0x395a1e,_0x1a0d51){return _0x395a1e[_0x3ced('0x7')](_0x3ced('0x8'),attributes,{'tableName':_0x3ced('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x3ced('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 1da09a6..4b4bd92 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 _0x4c5b=['then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','attributes','limit','include','map','model','CreateVoiceQueueReport','body','raw','UpdateVoiceQueueReport','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','defaults','redis','socket.io-emitter','./voiceQueueReport.socket','request'];(function(_0x859a3a,_0x2864cd){var _0x48e4f0=function(_0x2dc3c1){while(--_0x2dc3c1){_0x859a3a['push'](_0x859a3a['shift']());}};_0x48e4f0(++_0x2864cd);}(_0x4c5b,0xfd));var _0xb4c5=function(_0x3f121f,_0x5e59e5){_0x3f121f=_0x3f121f-0x0;var _0x2540a1=_0x4c5b[_0x3f121f];return _0x2540a1;};'use strict';var _=require(_0xb4c5('0x0'));var util=require('util');var moment=require(_0xb4c5('0x1'));var BPromise=require(_0xb4c5('0x2'));var rs=require(_0xb4c5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb4c5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb4c5('0x5'))(_0xb4c5('0x6'));var config=require(_0xb4c5('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xb4c5('0x8')](config[_0xb4c5('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xb4c5('0xa'))(new Redis(config[_0xb4c5('0x9')]));require(_0xb4c5('0xb'))['register'](socket);function respondWithRpcPromise(_0x231620,_0x293845,_0x14afe9){return new BPromise(function(_0x59be8c,_0x31f5c5){return client[_0xb4c5('0xc')](_0x231620,_0x14afe9)[_0xb4c5('0xd')](function(_0x2dd28f){logger[_0xb4c5('0xe')](_0xb4c5('0xf'),_0x293845,_0xb4c5('0x10'));logger[_0xb4c5('0x11')](_0xb4c5('0x12'),_0x293845,_0xb4c5('0x10'),JSON[_0xb4c5('0x13')](_0x2dd28f));if(_0x2dd28f['error']){if(_0x2dd28f[_0xb4c5('0x14')][_0xb4c5('0x15')]===0x1f4){logger[_0xb4c5('0x14')](_0xb4c5('0xf'),_0x293845,_0x2dd28f['error']['message']);return _0x31f5c5(_0x2dd28f[_0xb4c5('0x14')][_0xb4c5('0x16')]);}logger[_0xb4c5('0x14')](_0xb4c5('0xf'),_0x293845,_0x2dd28f[_0xb4c5('0x14')][_0xb4c5('0x16')]);return _0x59be8c(_0x2dd28f[_0xb4c5('0x14')][_0xb4c5('0x16')]);}else{logger[_0xb4c5('0xe')]('VoiceQueueReport,\x20%s,\x20%s',_0x293845,'request\x20sent');_0x59be8c(_0x2dd28f['result'][_0xb4c5('0x16')]);}})[_0xb4c5('0x17')](function(_0x1569c9){logger[_0xb4c5('0x14')](_0xb4c5('0xf'),_0x293845,_0x1569c9);_0x31f5c5(_0x1569c9);});});}exports[_0xb4c5('0x18')]=function(_0x28f2fb){var _0x5a42ff=this;return new Promise(function(_0x48f9a5,_0x438376){return db[_0xb4c5('0x19')][_0xb4c5('0x1a')]({'raw':_0x28f2fb['options']?_0x28f2fb['options']['raw']===undefined?!![]:![]:!![],'where':_0x28f2fb[_0xb4c5('0x1b')]?_0x28f2fb[_0xb4c5('0x1b')][_0xb4c5('0x1c')]||null:null,'attributes':_0x28f2fb[_0xb4c5('0x1b')]?_0x28f2fb[_0xb4c5('0x1b')][_0xb4c5('0x1d')]||null:null,'limit':_0x28f2fb[_0xb4c5('0x1b')]?_0x28f2fb[_0xb4c5('0x1b')][_0xb4c5('0x1e')]||null:null,'include':_0x28f2fb[_0xb4c5('0x1b')]?_0x28f2fb[_0xb4c5('0x1b')][_0xb4c5('0x1f')]?_[_0xb4c5('0x20')](_0x28f2fb[_0xb4c5('0x1b')]['include'],function(_0x3d5a65){return{'model':db[_0x3d5a65[_0xb4c5('0x21')]],'as':_0x3d5a65['as'],'attributes':_0x3d5a65[_0xb4c5('0x1d')],'include':_0x3d5a65['include']?_['map'](_0x3d5a65[_0xb4c5('0x1f')],function(_0x3f836a){return{'model':db[_0x3f836a[_0xb4c5('0x21')]],'as':_0x3f836a['as'],'attributes':_0x3f836a['attributes'],'include':_0x3f836a['include']?_['map'](_0x3f836a[_0xb4c5('0x1f')],function(_0x3c57d6){return{'model':db[_0x3c57d6['model']],'as':_0x3c57d6['as'],'attributes':_0x3c57d6[_0xb4c5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb4c5('0xd')](function(_0x44a98c){logger[_0xb4c5('0xe')](_0xb4c5('0x18'),_0x28f2fb);logger[_0xb4c5('0x11')](_0xb4c5('0x18'),_0x28f2fb,JSON['stringify'](_0x44a98c));_0x48f9a5(_0x44a98c);})[_0xb4c5('0x17')](function(_0x2d51f3){logger[_0xb4c5('0x14')](_0xb4c5('0x18'),_0x2d51f3[_0xb4c5('0x16')],_0x28f2fb);_0x438376(_0x5a42ff[_0xb4c5('0x14')](0x1f4,_0x2d51f3[_0xb4c5('0x16')]));});});};exports[_0xb4c5('0x22')]=function(_0x564e1b){var _0x292575=this;return new Promise(function(_0x493fb8,_0x143cb1){return db[_0xb4c5('0x19')]['create'](_0x564e1b[_0xb4c5('0x23')],{'raw':_0x564e1b['options']?_0x564e1b[_0xb4c5('0x1b')][_0xb4c5('0x24')]===undefined?!![]:![]:!![]})['then'](function(_0x394bd3){logger[_0xb4c5('0xe')](_0xb4c5('0x22'),_0x564e1b);logger[_0xb4c5('0x11')](_0xb4c5('0x22'),_0x564e1b,JSON[_0xb4c5('0x13')](_0x394bd3));_0x493fb8(_0x394bd3);})[_0xb4c5('0x17')](function(_0x3f1162){logger[_0xb4c5('0x14')](_0xb4c5('0x22'),_0x3f1162[_0xb4c5('0x16')],_0x564e1b);_0x143cb1(_0x292575[_0xb4c5('0x14')](0x1f4,_0x3f1162[_0xb4c5('0x16')]));});});};exports['UpdateVoiceQueueReport']=function(_0x201c1c){var _0x20dfda=this;return new Promise(function(_0x47957a,_0x39f8cc){return db[_0xb4c5('0x19')]['update'](_0x201c1c[_0xb4c5('0x23')],{'raw':_0x201c1c['options']?_0x201c1c[_0xb4c5('0x1b')][_0xb4c5('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x201c1c[_0xb4c5('0x1b')]?_0x201c1c[_0xb4c5('0x1b')][_0xb4c5('0x1c')]||null:null,'attributes':_0x201c1c[_0xb4c5('0x1b')]?_0x201c1c['options'][_0xb4c5('0x1d')]||null:null,'limit':_0x201c1c[_0xb4c5('0x1b')]?_0x201c1c[_0xb4c5('0x1b')][_0xb4c5('0x1e')]||null:null})[_0xb4c5('0xd')](function(_0x89bb0c){logger[_0xb4c5('0xe')](_0xb4c5('0x25'),_0x201c1c);logger['debug'](_0xb4c5('0x25'),_0x201c1c,JSON[_0xb4c5('0x13')](_0x89bb0c));_0x47957a(_0x89bb0c);})[_0xb4c5('0x17')](function(_0x477477){logger['error']('UpdateVoiceQueueReport',_0x477477[_0xb4c5('0x16')],_0x201c1c);_0x39f8cc(_0x20dfda[_0xb4c5('0x14')](0x1f4,_0x477477[_0xb4c5('0x16')]));});});}; \ No newline at end of file +var _0xcf2f=['localhost','socket.io-emitter','./voiceQueueReport.socket','register','info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','attributes','limit','include','map','model','then','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x137da3,_0xa6277a){var _0x1ac46c=function(_0x49e68b){while(--_0x49e68b){_0x137da3['push'](_0x137da3['shift']());}};_0x1ac46c(++_0xa6277a);}(_0xcf2f,0x1a0));var _0xfcf2=function(_0x3facc7,_0x1925c9){_0x3facc7=_0x3facc7-0x0;var _0xc0ed95=_0xcf2f[_0x3facc7];return _0xc0ed95;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var moment=require('moment');var BPromise=require(_0xfcf2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfcf2('0x3'));var db=require(_0xfcf2('0x4'))['db'];var utils=require(_0xfcf2('0x5'));var logger=require(_0xfcf2('0x6'))(_0xfcf2('0x7'));var config=require(_0xfcf2('0x8'));var jayson=require(_0xfcf2('0x9'));var client=jayson[_0xfcf2('0xa')][_0xfcf2('0xb')]({'port':0x232a});config[_0xfcf2('0xc')]=_[_0xfcf2('0xd')](config[_0xfcf2('0xc')],{'host':_0xfcf2('0xe'),'port':0x18eb});var socket=require(_0xfcf2('0xf'))(new Redis(config[_0xfcf2('0xc')]));require(_0xfcf2('0x10'))[_0xfcf2('0x11')](socket);function respondWithRpcPromise(_0x58d48b,_0x3fa0df,_0x3d0a57){return new BPromise(function(_0x4617b5,_0x45954a){return client['request'](_0x58d48b,_0x3d0a57)['then'](function(_0x6d1c56){logger[_0xfcf2('0x12')](_0xfcf2('0x13'),_0x3fa0df,'request\x20sent');logger[_0xfcf2('0x14')](_0xfcf2('0x15'),_0x3fa0df,_0xfcf2('0x16'),JSON[_0xfcf2('0x17')](_0x6d1c56));if(_0x6d1c56[_0xfcf2('0x18')]){if(_0x6d1c56[_0xfcf2('0x18')]['code']===0x1f4){logger['error'](_0xfcf2('0x13'),_0x3fa0df,_0x6d1c56[_0xfcf2('0x18')][_0xfcf2('0x19')]);return _0x45954a(_0x6d1c56[_0xfcf2('0x18')][_0xfcf2('0x19')]);}logger[_0xfcf2('0x18')](_0xfcf2('0x13'),_0x3fa0df,_0x6d1c56[_0xfcf2('0x18')][_0xfcf2('0x19')]);return _0x4617b5(_0x6d1c56['error']['message']);}else{logger[_0xfcf2('0x12')](_0xfcf2('0x13'),_0x3fa0df,_0xfcf2('0x16'));_0x4617b5(_0x6d1c56['result']['message']);}})[_0xfcf2('0x1a')](function(_0x442e70){logger[_0xfcf2('0x18')](_0xfcf2('0x13'),_0x3fa0df,_0x442e70);_0x45954a(_0x442e70);});});}exports[_0xfcf2('0x1b')]=function(_0x36bb58){var _0x4d92c3=this;return new Promise(function(_0xbf2d4f,_0x4bdcbf){return db[_0xfcf2('0x1c')]['findAll']({'raw':_0x36bb58[_0xfcf2('0x1d')]?_0x36bb58[_0xfcf2('0x1d')][_0xfcf2('0x1e')]===undefined?!![]:![]:!![],'where':_0x36bb58[_0xfcf2('0x1d')]?_0x36bb58[_0xfcf2('0x1d')][_0xfcf2('0x1f')]||null:null,'attributes':_0x36bb58[_0xfcf2('0x1d')]?_0x36bb58[_0xfcf2('0x1d')][_0xfcf2('0x20')]||null:null,'limit':_0x36bb58[_0xfcf2('0x1d')]?_0x36bb58['options'][_0xfcf2('0x21')]||null:null,'include':_0x36bb58[_0xfcf2('0x1d')]?_0x36bb58['options'][_0xfcf2('0x22')]?_[_0xfcf2('0x23')](_0x36bb58[_0xfcf2('0x1d')]['include'],function(_0x1dac32){return{'model':db[_0x1dac32[_0xfcf2('0x24')]],'as':_0x1dac32['as'],'attributes':_0x1dac32[_0xfcf2('0x20')],'include':_0x1dac32[_0xfcf2('0x22')]?_['map'](_0x1dac32['include'],function(_0x41ec76){return{'model':db[_0x41ec76[_0xfcf2('0x24')]],'as':_0x41ec76['as'],'attributes':_0x41ec76[_0xfcf2('0x20')],'include':_0x41ec76['include']?_[_0xfcf2('0x23')](_0x41ec76[_0xfcf2('0x22')],function(_0xdbb5e2){return{'model':db[_0xdbb5e2[_0xfcf2('0x24')]],'as':_0xdbb5e2['as'],'attributes':_0xdbb5e2['attributes']};}):[]};}):[]};}):[]:[]})[_0xfcf2('0x25')](function(_0x15217a){logger[_0xfcf2('0x12')](_0xfcf2('0x1b'),_0x36bb58);logger['debug'](_0xfcf2('0x1b'),_0x36bb58,JSON[_0xfcf2('0x17')](_0x15217a));_0xbf2d4f(_0x15217a);})['catch'](function(_0x48555e){logger[_0xfcf2('0x18')](_0xfcf2('0x1b'),_0x48555e[_0xfcf2('0x19')],_0x36bb58);_0x4bdcbf(_0x4d92c3['error'](0x1f4,_0x48555e[_0xfcf2('0x19')]));});});};exports['CreateVoiceQueueReport']=function(_0x4a7e89){var _0x4a12e3=this;return new Promise(function(_0x18067e,_0x207b23){return db[_0xfcf2('0x1c')][_0xfcf2('0x26')](_0x4a7e89[_0xfcf2('0x27')],{'raw':_0x4a7e89['options']?_0x4a7e89['options'][_0xfcf2('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x1f0c5c){logger[_0xfcf2('0x12')](_0xfcf2('0x28'),_0x4a7e89);logger[_0xfcf2('0x14')](_0xfcf2('0x28'),_0x4a7e89,JSON[_0xfcf2('0x17')](_0x1f0c5c));_0x18067e(_0x1f0c5c);})[_0xfcf2('0x1a')](function(_0x3eb30d){logger[_0xfcf2('0x18')](_0xfcf2('0x28'),_0x3eb30d['message'],_0x4a7e89);_0x207b23(_0x4a12e3['error'](0x1f4,_0x3eb30d[_0xfcf2('0x19')]));});});};exports[_0xfcf2('0x29')]=function(_0x475e5a){var _0x1b1cbf=this;return new Promise(function(_0x198a76,_0x39fbd0){return db[_0xfcf2('0x1c')][_0xfcf2('0x2a')](_0x475e5a[_0xfcf2('0x27')],{'raw':_0x475e5a[_0xfcf2('0x1d')]?_0x475e5a[_0xfcf2('0x1d')][_0xfcf2('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x475e5a[_0xfcf2('0x1d')]?_0x475e5a[_0xfcf2('0x1d')][_0xfcf2('0x1f')]||null:null,'attributes':_0x475e5a[_0xfcf2('0x1d')]?_0x475e5a[_0xfcf2('0x1d')]['attributes']||null:null,'limit':_0x475e5a[_0xfcf2('0x1d')]?_0x475e5a[_0xfcf2('0x1d')][_0xfcf2('0x21')]||null:null})[_0xfcf2('0x25')](function(_0x2fafe9){logger['info'](_0xfcf2('0x29'),_0x475e5a);logger[_0xfcf2('0x14')]('UpdateVoiceQueueReport',_0x475e5a,JSON[_0xfcf2('0x17')](_0x2fafe9));_0x198a76(_0x2fafe9);})[_0xfcf2('0x1a')](function(_0x1e9fd4){logger['error'](_0xfcf2('0x29'),_0x1e9fd4[_0xfcf2('0x19')],_0x475e5a);_0x39fbd0(_0x1b1cbf[_0xfcf2('0x18')](0x1f4,_0x1e9fd4['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 450607d..00f7009 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 _0x1cdb=['register','length','voiceQueueReport:','save','emit','removeListener'];(function(_0x4accda,_0x5a9aca){var _0x5bf719=function(_0x5dcf1d){while(--_0x5dcf1d){_0x4accda['push'](_0x4accda['shift']());}};_0x5bf719(++_0x5a9aca);}(_0x1cdb,0x117));var _0xb1cd=function(_0x2237e5,_0x51edc7){_0x2237e5=_0x2237e5-0x0;var _0x1838b9=_0x1cdb[_0x2237e5];return _0x1838b9;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xb1cd('0x0'),'remove','update'];function createListener(_0x23649b,_0x28d200){return function(_0x237682){_0x28d200[_0xb1cd('0x1')](_0x23649b,_0x237682);};}function removeListener(_0xa23caa,_0x24aaea){return function(){VoiceQueueReportEvents[_0xb1cd('0x2')](_0xa23caa,_0x24aaea);};}exports[_0xb1cd('0x3')]=function(_0x230cfd){for(var _0x3eb3ae=0x0,_0x177dca=events[_0xb1cd('0x4')];_0x3eb3ae<_0x177dca;_0x3eb3ae++){var _0x2fc36a=events[_0x3eb3ae];var _0x15d41c=createListener(_0xb1cd('0x5')+_0x2fc36a,_0x230cfd);VoiceQueueReportEvents['on'](_0x2fc36a,_0x15d41c);}}; \ No newline at end of file +var _0xe9d0=['removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update'];(function(_0x2fd160,_0x53c0d6){var _0x5c2031=function(_0x8ecfa5){while(--_0x8ecfa5){_0x2fd160['push'](_0x2fd160['shift']());}};_0x5c2031(++_0x53c0d6);}(_0xe9d0,0x124));var _0x0e9d=function(_0x53a7a8,_0x14aa8d){_0x53a7a8=_0x53a7a8-0x0;var _0x2337ae=_0xe9d0[_0x53a7a8];return _0x2337ae;};'use strict';var VoiceQueueReportEvents=require(_0x0e9d('0x0'));var events=[_0x0e9d('0x1'),_0x0e9d('0x2'),_0x0e9d('0x3')];function createListener(_0x5468e3,_0x1a1b50){return function(_0xd65c59){_0x1a1b50['emit'](_0x5468e3,_0xd65c59);};}function removeListener(_0x563aca,_0x34a160){return function(){VoiceQueueReportEvents[_0x0e9d('0x4')](_0x563aca,_0x34a160);};}exports[_0x0e9d('0x5')]=function(_0x27d3c4){for(var _0x165e40=0x0,_0x3368ac=events[_0x0e9d('0x6')];_0x165e40<_0x3368ac;_0x165e40++){var _0x24adac=events[_0x165e40];var _0x221e55=createListener(_0x0e9d('0x7')+_0x24adac,_0x27d3c4);VoiceQueueReportEvents['on'](_0x24adac,_0x221e55);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index aa41764..d081804 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 _0x4fb4=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','post','put'];(function(_0x458b69,_0x2bcfff){var _0x29d67d=function(_0x3bcf0f){while(--_0x3bcf0f){_0x458b69['push'](_0x458b69['shift']());}};_0x29d67d(++_0x2bcfff);}(_0x4fb4,0x190));var _0x44fb=function(_0x577ae9,_0x443c94){_0x577ae9=_0x577ae9-0x0;var _0x2155c5=_0x4fb4[_0x577ae9];return _0x2155c5;};'use strict';var multer=require('multer');var util=require(_0x44fb('0x0'));var path=require(_0x44fb('0x1'));var timeout=require(_0x44fb('0x2'));var express=require(_0x44fb('0x3'));var router=express[_0x44fb('0x4')]();var auth=require(_0x44fb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x44fb('0x6'));var controller=require(_0x44fb('0x7'));router[_0x44fb('0x8')]('/',auth[_0x44fb('0x9')](),controller[_0x44fb('0xa')]);router[_0x44fb('0x8')](_0x44fb('0xb'),auth[_0x44fb('0x9')](),controller['show']);router[_0x44fb('0xc')]('/',auth[_0x44fb('0x9')](),controller['create']);router[_0x44fb('0xd')](_0x44fb('0xb'),auth[_0x44fb('0x9')](),controller[_0x44fb('0xe')]);router[_0x44fb('0xf')](_0x44fb('0xb'),auth[_0x44fb('0x9')](),controller[_0x44fb('0x10')]);module[_0x44fb('0x11')]=router; \ No newline at end of file +var _0xe2bc=['update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x139e9d,_0x26b475){var _0x5a4b95=function(_0x4c6dcb){while(--_0x4c6dcb){_0x139e9d['push'](_0x139e9d['shift']());}};_0x5a4b95(++_0x26b475);}(_0xe2bc,0x1a6));var _0xce2b=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xe2bc[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0xce2b('0x0'));var util=require('util');var path=require(_0xce2b('0x1'));var timeout=require('connect-timeout');var express=require(_0xce2b('0x2'));var router=express[_0xce2b('0x3')]();var auth=require(_0xce2b('0x4'));var interaction=require(_0xce2b('0x5'));var config=require(_0xce2b('0x6'));var controller=require('./voiceQueuesLog.controller');router[_0xce2b('0x7')]('/',auth[_0xce2b('0x8')](),controller[_0xce2b('0x9')]);router[_0xce2b('0x7')](_0xce2b('0xa'),auth['isAuthenticated'](),controller[_0xce2b('0xb')]);router[_0xce2b('0xc')]('/',auth['isAuthenticated'](),controller[_0xce2b('0xd')]);router[_0xce2b('0xe')](_0xce2b('0xa'),auth[_0xce2b('0x8')](),controller[_0xce2b('0xf')]);router[_0xce2b('0x10')](_0xce2b('0xa'),auth[_0xce2b('0x8')](),controller[_0xce2b('0x11')]);module[_0xce2b('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 8a12a49..e368568 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 _0xdbf5=['YYYY-MM-DD\x20HH:mm:ss','moment','STRING','DATE','format'];(function(_0x48fa1b,_0x369aa5){var _0x6b81a5=function(_0x474653){while(--_0x474653){_0x48fa1b['push'](_0x48fa1b['shift']());}};_0x6b81a5(++_0x369aa5);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x1c2048,_0x54928b){_0x1c2048=_0x1c2048-0x0;var _0x4db341=_0xdbf5[_0x1c2048];return _0x4db341;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5dbf('0x0'));module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x5dbf('0x2')],'allowNull':![],'defaultValue':moment()[_0x5dbf('0x3')](_0x5dbf('0x4'))}}; \ No newline at end of file +var _0x33c5=['format','YYYY-MM-DD\x20HH:mm:ss','moment','exports','STRING','DATE'];(function(_0x4b26b5,_0x4f71fd){var _0x4dec71=function(_0x184329){while(--_0x184329){_0x4b26b5['push'](_0x4b26b5['shift']());}};_0x4dec71(++_0x4f71fd);}(_0x33c5,0xe6));var _0x533c=function(_0x764874,_0x3ed544){_0x764874=_0x764874-0x0;var _0x29f9d5=_0x33c5[_0x764874];return _0x29f9d5;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x533c('0x0'));module[_0x533c('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x533c('0x3')],'allowNull':![],'defaultValue':moment()[_0x533c('0x4')](_0x533c('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index e58caee..2c4b9a0 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 _0x3179=['include','findAll','catch','show','params','options','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','VoiceQueuesLog','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','includeAll'];(function(_0x4a17bd,_0x267ddf){var _0x1ba47f=function(_0x387b10){while(--_0x387b10){_0x4a17bd['push'](_0x4a17bd['shift']());}};_0x1ba47f(++_0x267ddf);}(_0x3179,0x9b));var _0x9317=function(_0x584894,_0x215699){_0x584894=_0x584894-0x0;var _0x357335=_0x3179[_0x584894];return _0x357335;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x9317('0x0'));var zipdir=require(_0x9317('0x1'));var jsonpatch=require(_0x9317('0x2'));var rp=require('request-promise');var moment=require(_0x9317('0x3'));var BPromise=require(_0x9317('0x4'));var Mustache=require(_0x9317('0x5'));var util=require(_0x9317('0x6'));var path=require(_0x9317('0x7'));var sox=require(_0x9317('0x8'));var csv=require(_0x9317('0x9'));var ejs=require(_0x9317('0xa'));var fs=require('fs');var _=require(_0x9317('0xb'));var squel=require(_0x9317('0xc'));var crypto=require('crypto');var jsforce=require(_0x9317('0xd'));var deskjs=require(_0x9317('0xe'));var toCsv=require(_0x9317('0x9'));var querystring=require('querystring');var Papa=require(_0x9317('0xf'));var Redis=require(_0x9317('0x10'));var authService=require(_0x9317('0x11'));var qs=require(_0x9317('0x12'));var hardwareService=require(_0x9317('0x13'));var logger=require('../../config/logger')(_0x9317('0x14'));var utils=require('../../config/utils');var config=require(_0x9317('0x15'));var db=require(_0x9317('0x16'))['db'];function respondWithStatusCode(_0xabfe6f,_0x1aa638){_0x1aa638=_0x1aa638||0xcc;return function(_0x404c43){if(_0x404c43){return _0xabfe6f[_0x9317('0x17')](_0x1aa638);}return _0xabfe6f[_0x9317('0x18')](_0x1aa638)['end']();};}function respondWithResult(_0x36e3b9,_0x3caf64){_0x3caf64=_0x3caf64||0xc8;return function(_0x1f9b8c){if(_0x1f9b8c){return _0x36e3b9['status'](_0x3caf64)[_0x9317('0x19')](_0x1f9b8c);}};}function respondWithFilteredResult(_0x39fabd,_0x5246ed){return function(_0x137b7b){if(_0x137b7b){var _0x1c5290=_0x137b7b[_0x9317('0x1a')],_0x376c1e=_0x5246ed['offset'],_0xbda64=_0x5246ed[_0x9317('0x1b')]+_0x5246ed['limit'],_0x1e697d;if(_0xbda64>=_0x1c5290){_0xbda64=_0x1c5290;_0x1e697d=0xc8;}else{_0x1e697d=0xce;}_0x39fabd[_0x9317('0x18')](_0x1e697d);return _0x39fabd[_0x9317('0x1c')](_0x9317('0x1d'),_0x376c1e+'-'+_0xbda64+'/'+_0x1c5290)[_0x9317('0x19')](_0x137b7b);}return null;};}function patchUpdates(_0x5ddc57){return function(_0x3dacc4){try{jsonpatch[_0x9317('0x1e')](_0x3dacc4,_0x5ddc57,!![]);}catch(_0xe9397a){return BPromise[_0x9317('0x1f')](_0xe9397a);}return _0x3dacc4[_0x9317('0x20')]();};}function saveUpdates(_0x4e3f3b,_0x31ff5e){return function(_0x91fded){if(_0x91fded){return _0x91fded['update'](_0x4e3f3b)[_0x9317('0x21')](function(_0x25b7db){return _0x25b7db;});}return null;};}function removeEntity(_0x52d728,_0xe7dc02){return function(_0x257d80){if(_0x257d80){return _0x257d80[_0x9317('0x22')]()[_0x9317('0x21')](function(){_0x52d728['status'](0xcc)[_0x9317('0x23')]();});}};}function handleEntityNotFound(_0x43c4fe,_0x353a93){return function(_0xef67e0){if(!_0xef67e0){_0x43c4fe[_0x9317('0x17')](0x194);}return _0xef67e0;};}function handleError(_0x401b49,_0x5a1efd){_0x5a1efd=_0x5a1efd||0x1f4;return function(_0xf0beb0){logger[_0x9317('0x24')](_0xf0beb0[_0x9317('0x25')]);if(_0xf0beb0[_0x9317('0x26')]){delete _0xf0beb0[_0x9317('0x26')];}_0x401b49[_0x9317('0x18')](_0x5a1efd)[_0x9317('0x27')](_0xf0beb0);};}exports['index']=function(_0x59546f,_0x22cc91){var _0x225dcf={},_0x2dd2a8={},_0x244db7={'count':0x0,'rows':[]};var _0x12ba8a=db[_0x9317('0x28')][_0x9317('0x29')];_0x2dd2a8[_0x9317('0x2a')]=_[_0x9317('0x2b')](_0x12ba8a);_0x2dd2a8[_0x9317('0x2c')]=_['keys'](_0x59546f[_0x9317('0x2c')]);_0x2dd2a8[_0x9317('0x2d')]=_[_0x9317('0x2e')](_0x2dd2a8[_0x9317('0x2a')],_0x2dd2a8[_0x9317('0x2c')]);_0x225dcf['attributes']=_[_0x9317('0x2e')](_0x2dd2a8[_0x9317('0x2a')],qs[_0x9317('0x2f')](_0x59546f[_0x9317('0x2c')]['fields']));_0x225dcf['attributes']=_0x225dcf[_0x9317('0x30')][_0x9317('0x31')]?_0x225dcf[_0x9317('0x30')]:_0x2dd2a8[_0x9317('0x2a')];if(!_0x59546f[_0x9317('0x2c')][_0x9317('0x32')](_0x9317('0x33'))){_0x225dcf['limit']=qs[_0x9317('0x34')](_0x59546f[_0x9317('0x2c')]['limit']);_0x225dcf[_0x9317('0x1b')]=qs[_0x9317('0x1b')](_0x59546f[_0x9317('0x2c')][_0x9317('0x1b')]);}_0x225dcf['order']=qs[_0x9317('0x35')](_0x59546f[_0x9317('0x2c')][_0x9317('0x35')]);_0x225dcf[_0x9317('0x36')]=qs[_0x9317('0x2d')](_[_0x9317('0x37')](_0x59546f[_0x9317('0x2c')],_0x2dd2a8[_0x9317('0x2d')]));if(_0x59546f[_0x9317('0x2c')][_0x9317('0x38')]){_0x225dcf['where']=_[_0x9317('0x39')](_0x225dcf[_0x9317('0x36')],{'$or':_[_0x9317('0x3a')](_0x12ba8a,function(_0x3991de){if(_0x3991de[_0x9317('0x3b')][_0x9317('0x3c')]!==_0x9317('0x3d')){var _0x4d849a={};_0x4d849a[_0x3991de[_0x9317('0x3e')]]={'$like':'%'+_0x59546f[_0x9317('0x2c')][_0x9317('0x38')]+'%'};return _0x4d849a;}})});}_0x225dcf=_[_0x9317('0x39')]({},_0x225dcf,_0x59546f['options']);var _0x1662fa={'where':_0x225dcf[_0x9317('0x36')]};return db[_0x9317('0x28')][_0x9317('0x1a')](_0x1662fa)[_0x9317('0x21')](function(_0x48d5a2){_0x244db7[_0x9317('0x1a')]=_0x48d5a2;if(_0x59546f[_0x9317('0x2c')][_0x9317('0x3f')]){_0x225dcf[_0x9317('0x40')]=[{'all':!![]}];}return db[_0x9317('0x28')][_0x9317('0x41')](_0x225dcf);})[_0x9317('0x21')](function(_0x255ff6){_0x244db7['rows']=_0x255ff6;return _0x244db7;})[_0x9317('0x21')](respondWithFilteredResult(_0x22cc91,_0x225dcf))[_0x9317('0x42')](handleError(_0x22cc91,null));};exports[_0x9317('0x43')]=function(_0x18dc11,_0x5a8dcc){var _0x312212={'raw':!![],'where':{'id':_0x18dc11[_0x9317('0x44')]['id']}},_0x488d9e={};_0x488d9e['model']=_['keys'](db['VoiceQueuesLog'][_0x9317('0x29')]);_0x488d9e['query']=_[_0x9317('0x2b')](_0x18dc11[_0x9317('0x2c')]);_0x488d9e[_0x9317('0x2d')]=_[_0x9317('0x2e')](_0x488d9e[_0x9317('0x2a')],_0x488d9e[_0x9317('0x2c')]);_0x312212[_0x9317('0x30')]=_[_0x9317('0x2e')](_0x488d9e[_0x9317('0x2a')],qs[_0x9317('0x2f')](_0x18dc11[_0x9317('0x2c')][_0x9317('0x2f')]));_0x312212[_0x9317('0x30')]=_0x312212[_0x9317('0x30')][_0x9317('0x31')]?_0x312212['attributes']:_0x488d9e[_0x9317('0x2a')];if(_0x18dc11[_0x9317('0x2c')][_0x9317('0x3f')]){_0x312212[_0x9317('0x40')]=[{'all':!![]}];}_0x312212=_[_0x9317('0x39')]({},_0x312212,_0x18dc11[_0x9317('0x45')]);return db[_0x9317('0x28')][_0x9317('0x46')](_0x312212)[_0x9317('0x21')](handleEntityNotFound(_0x5a8dcc,null))[_0x9317('0x21')](respondWithResult(_0x5a8dcc,null))['catch'](handleError(_0x5a8dcc,null));};exports[_0x9317('0x47')]=function(_0x345b13,_0x2e8944){return db[_0x9317('0x28')][_0x9317('0x47')](_0x345b13['body'],{})[_0x9317('0x21')](respondWithResult(_0x2e8944,0xc9))[_0x9317('0x42')](handleError(_0x2e8944,null));};exports['update']=function(_0x30c748,_0x1c5689){if(_0x30c748[_0x9317('0x48')]['id']){delete _0x30c748['body']['id'];}return db[_0x9317('0x28')]['find']({'where':{'id':_0x30c748[_0x9317('0x44')]['id']}})[_0x9317('0x21')](handleEntityNotFound(_0x1c5689,null))[_0x9317('0x21')](saveUpdates(_0x30c748[_0x9317('0x48')],null))[_0x9317('0x21')](respondWithResult(_0x1c5689,null))[_0x9317('0x42')](handleError(_0x1c5689,null));};exports['destroy']=function(_0x451372,_0x150b7a){return db[_0x9317('0x28')][_0x9317('0x46')]({'where':{'id':_0x451372[_0x9317('0x44')]['id']}})['then'](handleEntityNotFound(_0x150b7a,null))['then'](removeEntity(_0x150b7a,null))[_0x9317('0x42')](handleError(_0x150b7a,null));}; \ No newline at end of file +var _0xeea5=['length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','key','VIRTUAL','field','options','include','findAll','rows','catch','show','params','includeAll','find','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','VoiceQueuesLog','rawAttributes','model','query','keys','intersection','attributes','fields'];(function(_0x362a66,_0x67217b){var _0x5c1dae=function(_0x2cdb75){while(--_0x2cdb75){_0x362a66['push'](_0x362a66['shift']());}};_0x5c1dae(++_0x67217b);}(_0xeea5,0x1ec));var _0x5eea=function(_0x4a6bf5,_0x448b51){_0x4a6bf5=_0x4a6bf5-0x0;var _0x59f915=_0xeea5[_0x4a6bf5];return _0x59f915;};'use strict';var pdf=require(_0x5eea('0x0'));var emlformat=require(_0x5eea('0x1'));var rimraf=require(_0x5eea('0x2'));var zipdir=require(_0x5eea('0x3'));var jsonpatch=require(_0x5eea('0x4'));var rp=require(_0x5eea('0x5'));var moment=require(_0x5eea('0x6'));var BPromise=require(_0x5eea('0x7'));var Mustache=require(_0x5eea('0x8'));var util=require(_0x5eea('0x9'));var path=require(_0x5eea('0xa'));var sox=require(_0x5eea('0xb'));var csv=require(_0x5eea('0xc'));var ejs=require(_0x5eea('0xd'));var fs=require('fs');var _=require(_0x5eea('0xe'));var squel=require(_0x5eea('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5eea('0x10'));var toCsv=require(_0x5eea('0xc'));var querystring=require(_0x5eea('0x11'));var Papa=require(_0x5eea('0x12'));var Redis=require(_0x5eea('0x13'));var authService=require(_0x5eea('0x14'));var qs=require(_0x5eea('0x15'));var hardwareService=require(_0x5eea('0x16'));var logger=require(_0x5eea('0x17'))('api');var utils=require(_0x5eea('0x18'));var config=require(_0x5eea('0x19'));var db=require(_0x5eea('0x1a'))['db'];function respondWithStatusCode(_0x18a238,_0x8bfada){_0x8bfada=_0x8bfada||0xcc;return function(_0x5c58b0){if(_0x5c58b0){return _0x18a238['sendStatus'](_0x8bfada);}return _0x18a238[_0x5eea('0x1b')](_0x8bfada)[_0x5eea('0x1c')]();};}function respondWithResult(_0x3f2557,_0x4a6953){_0x4a6953=_0x4a6953||0xc8;return function(_0x23595f){if(_0x23595f){return _0x3f2557[_0x5eea('0x1b')](_0x4a6953)[_0x5eea('0x1d')](_0x23595f);}};}function respondWithFilteredResult(_0x109903,_0x4e8962){return function(_0x2b735c){if(_0x2b735c){var _0x4494a7=_0x2b735c[_0x5eea('0x1e')],_0x4c83d2=_0x4e8962['offset'],_0x2f66cf=_0x4e8962[_0x5eea('0x1f')]+_0x4e8962[_0x5eea('0x20')],_0x145c81;if(_0x2f66cf>=_0x4494a7){_0x2f66cf=_0x4494a7;_0x145c81=0xc8;}else{_0x145c81=0xce;}_0x109903[_0x5eea('0x1b')](_0x145c81);return _0x109903[_0x5eea('0x21')](_0x5eea('0x22'),_0x4c83d2+'-'+_0x2f66cf+'/'+_0x4494a7)[_0x5eea('0x1d')](_0x2b735c);}return null;};}function patchUpdates(_0x31a228){return function(_0x248ee8){try{jsonpatch[_0x5eea('0x23')](_0x248ee8,_0x31a228,!![]);}catch(_0x32750e){return BPromise[_0x5eea('0x24')](_0x32750e);}return _0x248ee8[_0x5eea('0x25')]();};}function saveUpdates(_0x320415,_0x379c48){return function(_0x4571f7){if(_0x4571f7){return _0x4571f7[_0x5eea('0x26')](_0x320415)[_0x5eea('0x27')](function(_0x8de37a){return _0x8de37a;});}return null;};}function removeEntity(_0x18e175,_0x2c4ff7){return function(_0x41f129){if(_0x41f129){return _0x41f129[_0x5eea('0x28')]()[_0x5eea('0x27')](function(){_0x18e175['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc7bd1e,_0x3f597c){return function(_0x344143){if(!_0x344143){_0xc7bd1e['sendStatus'](0x194);}return _0x344143;};}function handleError(_0x147f3b,_0x416832){_0x416832=_0x416832||0x1f4;return function(_0x2f9d28){logger[_0x5eea('0x29')](_0x2f9d28[_0x5eea('0x2a')]);if(_0x2f9d28[_0x5eea('0x2b')]){delete _0x2f9d28[_0x5eea('0x2b')];}_0x147f3b[_0x5eea('0x1b')](_0x416832)[_0x5eea('0x2c')](_0x2f9d28);};}exports[_0x5eea('0x2d')]=function(_0x57f532,_0x4ffca7){var _0x420fba={},_0x4cfffa={},_0x40114e={'count':0x0,'rows':[]};var _0x2b9d04=db[_0x5eea('0x2e')][_0x5eea('0x2f')];_0x4cfffa[_0x5eea('0x30')]=_['keys'](_0x2b9d04);_0x4cfffa[_0x5eea('0x31')]=_[_0x5eea('0x32')](_0x57f532[_0x5eea('0x31')]);_0x4cfffa['filters']=_[_0x5eea('0x33')](_0x4cfffa['model'],_0x4cfffa[_0x5eea('0x31')]);_0x420fba[_0x5eea('0x34')]=_[_0x5eea('0x33')](_0x4cfffa[_0x5eea('0x30')],qs[_0x5eea('0x35')](_0x57f532['query']['fields']));_0x420fba[_0x5eea('0x34')]=_0x420fba[_0x5eea('0x34')][_0x5eea('0x36')]?_0x420fba[_0x5eea('0x34')]:_0x4cfffa[_0x5eea('0x30')];if(!_0x57f532[_0x5eea('0x31')][_0x5eea('0x37')](_0x5eea('0x38'))){_0x420fba[_0x5eea('0x20')]=qs['limit'](_0x57f532['query']['limit']);_0x420fba[_0x5eea('0x1f')]=qs[_0x5eea('0x1f')](_0x57f532[_0x5eea('0x31')][_0x5eea('0x1f')]);}_0x420fba[_0x5eea('0x39')]=qs[_0x5eea('0x3a')](_0x57f532[_0x5eea('0x31')][_0x5eea('0x3a')]);_0x420fba[_0x5eea('0x3b')]=qs[_0x5eea('0x3c')](_[_0x5eea('0x3d')](_0x57f532[_0x5eea('0x31')],_0x4cfffa['filters']));if(_0x57f532['query'][_0x5eea('0x3e')]){_0x420fba[_0x5eea('0x3b')]=_[_0x5eea('0x3f')](_0x420fba['where'],{'$or':_[_0x5eea('0x40')](_0x2b9d04,function(_0x312f67){if(_0x312f67['type'][_0x5eea('0x41')]!==_0x5eea('0x42')){var _0x4e65a5={};_0x4e65a5[_0x312f67[_0x5eea('0x43')]]={'$like':'%'+_0x57f532[_0x5eea('0x31')][_0x5eea('0x3e')]+'%'};return _0x4e65a5;}})});}_0x420fba=_['merge']({},_0x420fba,_0x57f532[_0x5eea('0x44')]);var _0x5e59dc={'where':_0x420fba[_0x5eea('0x3b')]};return db[_0x5eea('0x2e')][_0x5eea('0x1e')](_0x5e59dc)[_0x5eea('0x27')](function(_0x4c7481){_0x40114e[_0x5eea('0x1e')]=_0x4c7481;if(_0x57f532[_0x5eea('0x31')]['includeAll']){_0x420fba[_0x5eea('0x45')]=[{'all':!![]}];}return db[_0x5eea('0x2e')][_0x5eea('0x46')](_0x420fba);})[_0x5eea('0x27')](function(_0x47da88){_0x40114e[_0x5eea('0x47')]=_0x47da88;return _0x40114e;})[_0x5eea('0x27')](respondWithFilteredResult(_0x4ffca7,_0x420fba))[_0x5eea('0x48')](handleError(_0x4ffca7,null));};exports[_0x5eea('0x49')]=function(_0x764b4c,_0x108b1a){var _0x3ff5bc={'raw':!![],'where':{'id':_0x764b4c[_0x5eea('0x4a')]['id']}},_0x5ab819={};_0x5ab819[_0x5eea('0x30')]=_[_0x5eea('0x32')](db[_0x5eea('0x2e')]['rawAttributes']);_0x5ab819[_0x5eea('0x31')]=_[_0x5eea('0x32')](_0x764b4c[_0x5eea('0x31')]);_0x5ab819[_0x5eea('0x3c')]=_[_0x5eea('0x33')](_0x5ab819[_0x5eea('0x30')],_0x5ab819[_0x5eea('0x31')]);_0x3ff5bc['attributes']=_[_0x5eea('0x33')](_0x5ab819[_0x5eea('0x30')],qs[_0x5eea('0x35')](_0x764b4c[_0x5eea('0x31')][_0x5eea('0x35')]));_0x3ff5bc[_0x5eea('0x34')]=_0x3ff5bc['attributes'][_0x5eea('0x36')]?_0x3ff5bc['attributes']:_0x5ab819[_0x5eea('0x30')];if(_0x764b4c[_0x5eea('0x31')][_0x5eea('0x4b')]){_0x3ff5bc[_0x5eea('0x45')]=[{'all':!![]}];}_0x3ff5bc=_['merge']({},_0x3ff5bc,_0x764b4c[_0x5eea('0x44')]);return db[_0x5eea('0x2e')][_0x5eea('0x4c')](_0x3ff5bc)['then'](handleEntityNotFound(_0x108b1a,null))[_0x5eea('0x27')](respondWithResult(_0x108b1a,null))['catch'](handleError(_0x108b1a,null));};exports['create']=function(_0xaffd14,_0x5b85f3){return db[_0x5eea('0x2e')]['create'](_0xaffd14['body'],{})['then'](respondWithResult(_0x5b85f3,0xc9))['catch'](handleError(_0x5b85f3,null));};exports['update']=function(_0x5c475b,_0x2d3633){if(_0x5c475b[_0x5eea('0x4d')]['id']){delete _0x5c475b[_0x5eea('0x4d')]['id'];}return db[_0x5eea('0x2e')][_0x5eea('0x4c')]({'where':{'id':_0x5c475b[_0x5eea('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2d3633,null))[_0x5eea('0x27')](saveUpdates(_0x5c475b[_0x5eea('0x4d')],null))['then'](respondWithResult(_0x2d3633,null))[_0x5eea('0x48')](handleError(_0x2d3633,null));};exports[_0x5eea('0x28')]=function(_0x199c17,_0x196072){return db[_0x5eea('0x2e')][_0x5eea('0x4c')]({'where':{'id':_0x199c17[_0x5eea('0x4a')]['id']}})[_0x5eea('0x27')](handleEntityNotFound(_0x196072,null))[_0x5eea('0x27')](removeEntity(_0x196072,null))[_0x5eea('0x48')](handleError(_0x196072,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index bff831d..151bf67 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 _0xe45e=['define','VoiceQueuesLog','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports'];(function(_0x3adb8e,_0x247ca2){var _0x3eacdb=function(_0x127ddf){while(--_0x127ddf){_0x3adb8e['push'](_0x3adb8e['shift']());}};_0x3eacdb(++_0x247ca2);}(_0xe45e,0x7b));var _0xee45=function(_0x120376,_0x571898){_0x120376=_0x120376-0x0;var _0x28c529=_0xe45e[_0x120376];return _0x28c529;};'use strict';var _=require(_0xee45('0x0'));var util=require('util');var logger=require(_0xee45('0x1'))('api');var moment=require(_0xee45('0x2'));var BPromise=require(_0xee45('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee45('0x4'));var rimraf=require(_0xee45('0x5'));var config=require(_0xee45('0x6'));var attributes=require(_0xee45('0x7'));module[_0xee45('0x8')]=function(_0x2f7e10,_0x327a3e){return _0x2f7e10[_0xee45('0x9')](_0xee45('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':['event','dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0xae96=['api','moment','bluebird','request-promise','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','event','dtm','lodash','util','../../config/logger'];(function(_0x2683f0,_0x5e116c){var _0x46d74a=function(_0x241e28){while(--_0x241e28){_0x2683f0['push'](_0x2683f0['shift']());}};_0x46d74a(++_0x5e116c);}(_0xae96,0xa6));var _0x6ae9=function(_0xd1fab6,_0x238478){_0xd1fab6=_0xd1fab6-0x0;var _0x17162a=_0xae96[_0xd1fab6];return _0x17162a;};'use strict';var _=require(_0x6ae9('0x0'));var util=require(_0x6ae9('0x1'));var logger=require(_0x6ae9('0x2'))(_0x6ae9('0x3'));var moment=require(_0x6ae9('0x4'));var BPromise=require(_0x6ae9('0x5'));var rp=require(_0x6ae9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6ae9('0x7'));var attributes=require(_0x6ae9('0x8'));module['exports']=function(_0x59e27a,_0x227fe6){return _0x59e27a[_0x6ae9('0x9')](_0x6ae9('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x6ae9('0xb'),_0x6ae9('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 3195b42..3679965 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 _0xaf42=['catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x3e493c,_0xa502e9){var _0x107e89=function(_0x10eda4){while(--_0x10eda4){_0x3e493c['push'](_0x3e493c['shift']());}};_0x107e89(++_0xa502e9);}(_0xaf42,0x11f));var _0x2af4=function(_0x410597,_0x104fd7){_0x410597=_0x410597-0x0;var _0x27ace3=_0xaf42[_0x410597];return _0x27ace3;};'use strict';var _=require('lodash');var util=require(_0x2af4('0x0'));var moment=require(_0x2af4('0x1'));var BPromise=require(_0x2af4('0x2'));var rs=require(_0x2af4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2af4('0x4'));var logger=require(_0x2af4('0x5'))(_0x2af4('0x6'));var config=require(_0x2af4('0x7'));var jayson=require(_0x2af4('0x8'));var client=jayson['client'][_0x2af4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d6b4a,_0x8b8039,_0x283c06){return new BPromise(function(_0x5e6f84,_0x451ea9){return client[_0x2af4('0xa')](_0x3d6b4a,_0x283c06)[_0x2af4('0xb')](function(_0x4a1dc2){logger[_0x2af4('0xc')](_0x2af4('0xd'),_0x8b8039,'request\x20sent');logger[_0x2af4('0xe')](_0x2af4('0xf'),_0x8b8039,_0x2af4('0x10'),JSON['stringify'](_0x4a1dc2));if(_0x4a1dc2['error']){if(_0x4a1dc2[_0x2af4('0x11')][_0x2af4('0x12')]===0x1f4){logger[_0x2af4('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x8b8039,_0x4a1dc2[_0x2af4('0x11')][_0x2af4('0x13')]);return _0x451ea9(_0x4a1dc2[_0x2af4('0x11')][_0x2af4('0x13')]);}logger[_0x2af4('0x11')](_0x2af4('0xd'),_0x8b8039,_0x4a1dc2[_0x2af4('0x11')][_0x2af4('0x13')]);return _0x5e6f84(_0x4a1dc2[_0x2af4('0x11')]['message']);}else{logger[_0x2af4('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x8b8039,_0x2af4('0x10'));_0x5e6f84(_0x4a1dc2[_0x2af4('0x14')][_0x2af4('0x13')]);}})[_0x2af4('0x15')](function(_0x37384b){logger[_0x2af4('0x11')](_0x2af4('0xd'),_0x8b8039,_0x37384b);_0x451ea9(_0x37384b);});});} \ No newline at end of file +var _0x36e1=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x144868,_0x27df7f){var _0x2764d0=function(_0x2615e2){while(--_0x2615e2){_0x144868['push'](_0x144868['shift']());}};_0x2764d0(++_0x27df7f);}(_0x36e1,0x187));var _0x136e=function(_0x2637ac,_0x377857){_0x2637ac=_0x2637ac-0x0;var _0x4a5758=_0x36e1[_0x2637ac];return _0x4a5758;};'use strict';var _=require(_0x136e('0x0'));var util=require(_0x136e('0x1'));var moment=require(_0x136e('0x2'));var BPromise=require('bluebird');var rs=require(_0x136e('0x3'));var fs=require('fs');var Redis=require(_0x136e('0x4'));var db=require(_0x136e('0x5'))['db'];var utils=require(_0x136e('0x6'));var logger=require(_0x136e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x136e('0x8'));var client=jayson[_0x136e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46110e,_0x33de75,_0x3b241f){return new BPromise(function(_0x15ec52,_0x233640){return client[_0x136e('0xa')](_0x46110e,_0x3b241f)[_0x136e('0xb')](function(_0x50e26f){logger[_0x136e('0xc')](_0x136e('0xd'),_0x33de75,'request\x20sent');logger[_0x136e('0xe')](_0x136e('0xf'),_0x33de75,'request\x20sent',JSON[_0x136e('0x10')](_0x50e26f));if(_0x50e26f[_0x136e('0x11')]){if(_0x50e26f[_0x136e('0x11')]['code']===0x1f4){logger[_0x136e('0x11')](_0x136e('0xd'),_0x33de75,_0x50e26f[_0x136e('0x11')][_0x136e('0x12')]);return _0x233640(_0x50e26f[_0x136e('0x11')][_0x136e('0x12')]);}logger[_0x136e('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x33de75,_0x50e26f[_0x136e('0x11')][_0x136e('0x12')]);return _0x15ec52(_0x50e26f[_0x136e('0x11')]['message']);}else{logger[_0x136e('0xc')](_0x136e('0xd'),_0x33de75,_0x136e('0x13'));_0x15ec52(_0x50e26f[_0x136e('0x14')][_0x136e('0x12')]);}})[_0x136e('0x15')](function(_0x1c0b1f){logger[_0x136e('0x11')](_0x136e('0xd'),_0x33de75,_0x1c0b1f);_0x233640(_0x1c0b1f);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 6b6899a..0703284 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 _0xd52d=['path','express','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','post','create','put','update','delete','destroy','exports','util'];(function(_0x7dfb98,_0x1dd07b){var _0x459a87=function(_0x2d38e4){while(--_0x2d38e4){_0x7dfb98['push'](_0x7dfb98['shift']());}};_0x459a87(++_0x1dd07b);}(_0xd52d,0x1c7));var _0xdd52=function(_0x877303,_0x14c01b){_0x877303=_0x877303-0x0;var _0x20bda0=_0xd52d[_0x877303];return _0x20bda0;};'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'),controller[_0xdd52('0x10')]);router[_0xdd52('0x11')]('/',auth['isAuthenticated'](),controller[_0xdd52('0x12')]);router[_0xdd52('0x13')](_0xdd52('0xb'),auth[_0xdd52('0x7')](),controller[_0xdd52('0x14')]);router[_0xdd52('0x15')]('/:id',auth[_0xdd52('0x7')](),controller[_0xdd52('0x16')]);module[_0xdd52('0x17')]=router; \ No newline at end of file +var _0x1d2d=['/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./voiceRecording.controller','get','isAuthenticated','index'];(function(_0x51a696,_0x3ab568){var _0x56cf0d=function(_0x2e229d){while(--_0x2e229d){_0x51a696['push'](_0x51a696['shift']());}};_0x56cf0d(++_0x3ab568);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x2a337b,_0x4f120f){_0x2a337b=_0x2a337b-0x0;var _0x23fe0b=_0x1d2d[_0x2a337b];return _0x23fe0b;};'use strict';var multer=require(_0xd1d2('0x0'));var util=require(_0xd1d2('0x1'));var path=require(_0xd1d2('0x2'));var timeout=require(_0xd1d2('0x3'));var express=require(_0xd1d2('0x4'));var router=express['Router']();var auth=require(_0xd1d2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd1d2('0x6'));router[_0xd1d2('0x7')]('/',auth[_0xd1d2('0x8')](),controller[_0xd1d2('0x9')]);router[_0xd1d2('0x7')](_0xd1d2('0xa'),auth['isAuthenticated'](),controller[_0xd1d2('0xb')]);router[_0xd1d2('0x7')](_0xd1d2('0xc'),auth[_0xd1d2('0x8')](),controller[_0xd1d2('0xd')]);router[_0xd1d2('0x7')](_0xd1d2('0xe'),auth[_0xd1d2('0x8')](),controller[_0xd1d2('0xf')]);router[_0xd1d2('0x7')](_0xd1d2('0x10'),controller[_0xd1d2('0x11')]);router[_0xd1d2('0x12')]('/',auth['isAuthenticated'](),controller[_0xd1d2('0x13')]);router[_0xd1d2('0x14')](_0xd1d2('0xc'),auth[_0xd1d2('0x8')](),controller[_0xd1d2('0x15')]);router[_0xd1d2('0x16')](_0xd1d2('0xc'),auth[_0xd1d2('0x8')](),controller[_0xd1d2('0x17')]);module[_0xd1d2('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index de7754c..85fdbe4 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 _0xfd84=['extname','STRING','setDataValue','split','INTEGER','DATE','createdAt','format','toString','updatedAt','MM-DD-YYYY\x20HH:mm','sequelize','moment','path','exports','getDataValue','value'];(function(_0x256577,_0x2bb94f){var _0x328135=function(_0x26c2ea){while(--_0x26c2ea){_0x256577['push'](_0x256577['shift']());}};_0x328135(++_0x2bb94f);}(_0xfd84,0xb5));var _0x4fd8=function(_0x330997,_0x387361){_0x330997=_0x330997-0x0;var _0x472a63=_0xfd84[_0x330997];return _0x472a63;};'use strict';var Sequelize=require(_0x4fd8('0x0'));var moment=require(_0x4fd8('0x1'));var path=require(_0x4fd8('0x2'));module[_0x4fd8('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x4fd8('0x4')](_0x4fd8('0x5'))?path[_0x4fd8('0x6')](this['getDataValue']('value')):undefined;}},'uniqueid':{'type':Sequelize[_0x4fd8('0x7')]},'channel':{'type':Sequelize[_0x4fd8('0x7')],'set':function(_0x24d518){if(_0x24d518){this[_0x4fd8('0x8')]('channel',_0x24d518);this[_0x4fd8('0x8')]('membername',_0x24d518[_0x4fd8('0x9')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x4fd8('0x7')]},'calleridnum':{'type':Sequelize[_0x4fd8('0x7')]},'calleridname':{'type':Sequelize[_0x4fd8('0x7')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x4fd8('0x7')]},'accountcode':{'type':Sequelize[_0x4fd8('0x7')]},'context':{'type':Sequelize[_0x4fd8('0x7')]},'exten':{'type':Sequelize[_0x4fd8('0x7')]},'value':{'type':Sequelize[_0x4fd8('0x7')]},'type':{'type':Sequelize[_0x4fd8('0x7')]},'rating':{'type':Sequelize[_0x4fd8('0xa')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x4fd8('0x7')]},'userDisposition':{'type':Sequelize[_0x4fd8('0x7')]},'createdAt':{'type':Sequelize[_0x4fd8('0xb')],'get':function(){return moment(this[_0x4fd8('0x4')](_0x4fd8('0xc')))[_0x4fd8('0xd')]('MM-DD-YYYY\x20HH:mm')[_0x4fd8('0xe')]();}},'updatedAt':{'type':Sequelize[_0x4fd8('0xb')],'get':function(){return moment(this[_0x4fd8('0x4')](_0x4fd8('0xf')))['format'](_0x4fd8('0x10'))[_0x4fd8('0xe')]();}}}; \ No newline at end of file +var _0x4927=['createdAt','format','MM-DD-YYYY\x20HH:mm','toString','DATE','updatedAt','sequelize','moment','path','exports','VIRTUAL','value','extname','getDataValue','STRING','setDataValue','channel','split','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4927,0x1f4));var _0x7492=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4927[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x7492('0x0'));var moment=require(_0x7492('0x1'));var path=require(_0x7492('0x2'));module[_0x7492('0x3')]={'format':{'type':Sequelize[_0x7492('0x4')],'get':function(){return this['getDataValue'](_0x7492('0x5'))?path[_0x7492('0x6')](this[_0x7492('0x7')](_0x7492('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x7492('0x8')]},'channel':{'type':Sequelize['STRING'],'set':function(_0x47a89b){if(_0x47a89b){this[_0x7492('0x9')](_0x7492('0xa'),_0x47a89b);this[_0x7492('0x9')]('membername',_0x47a89b[_0x7492('0xb')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x7492('0x8')]},'calleridnum':{'type':Sequelize[_0x7492('0x8')]},'calleridname':{'type':Sequelize[_0x7492('0x8')]},'connectedlinenum':{'type':Sequelize[_0x7492('0x8')]},'connectedlinename':{'type':Sequelize[_0x7492('0x8')]},'accountcode':{'type':Sequelize[_0x7492('0x8')]},'context':{'type':Sequelize[_0x7492('0x8')]},'exten':{'type':Sequelize[_0x7492('0x8')]},'value':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7492('0x8')]},'rating':{'type':Sequelize[_0x7492('0xc')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x7492('0xd')))[_0x7492('0xe')](_0x7492('0xf'))[_0x7492('0x10')]();}},'updatedAt':{'type':Sequelize[_0x7492('0x11')],'get':function(){return moment(this['getDataValue'](_0x7492('0x12')))['format'](_0x7492('0xf'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 8b78257..22140b8 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 _0xd037=['describe','download','../../components/encryptor','type','uniqueid','value','existsSync','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','extname','message','Not\x20found','downloads','sequelize','col','token','$and','push','%s.cypher','ValidationError','unlink','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','end','status','json','count','offset','limit','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','VoiceRecording','rawAttributes','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','map','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','params','include','find','create','update','body'];(function(_0x45c512,_0x10dd99){var _0x4a443f=function(_0x186e8a){while(--_0x186e8a){_0x45c512['push'](_0x45c512['shift']());}};_0x4a443f(++_0x10dd99);}(_0xd037,0x78));var _0x7d03=function(_0x278ec4,_0x379f24){_0x278ec4=_0x278ec4-0x0;var _0xfc7564=_0xd037[_0x278ec4];return _0xfc7564;};'use strict';var pdf=require(_0x7d03('0x0'));var emlformat=require(_0x7d03('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7d03('0x2'));var jsonpatch=require(_0x7d03('0x3'));var rp=require(_0x7d03('0x4'));var moment=require(_0x7d03('0x5'));var BPromise=require(_0x7d03('0x6'));var Mustache=require(_0x7d03('0x7'));var util=require(_0x7d03('0x8'));var path=require(_0x7d03('0x9'));var sox=require(_0x7d03('0xa'));var csv=require(_0x7d03('0xb'));var ejs=require(_0x7d03('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7d03('0xd'));var deskjs=require(_0x7d03('0xe'));var toCsv=require(_0x7d03('0xb'));var querystring=require(_0x7d03('0xf'));var Papa=require('papaparse');var Redis=require(_0x7d03('0x10'));var authService=require(_0x7d03('0x11'));var qs=require(_0x7d03('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d03('0x13'))(_0x7d03('0x14'));var utils=require(_0x7d03('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11ef3e,_0x495deb){_0x495deb=_0x495deb||0xcc;return function(_0x204e01){if(_0x204e01){return _0x11ef3e['sendStatus'](_0x495deb);}return _0x11ef3e['status'](_0x495deb)[_0x7d03('0x16')]();};}function respondWithResult(_0x55b065,_0x529962){_0x529962=_0x529962||0xc8;return function(_0x31c19d){if(_0x31c19d){return _0x55b065[_0x7d03('0x17')](_0x529962)[_0x7d03('0x18')](_0x31c19d);}};}function respondWithFilteredResult(_0x41b10e,_0x4377b7){return function(_0x4a83fe){if(_0x4a83fe){var _0x56e540=_0x4a83fe[_0x7d03('0x19')],_0x2fa1b1=_0x4377b7[_0x7d03('0x1a')],_0x1fd064=_0x4377b7[_0x7d03('0x1a')]+_0x4377b7[_0x7d03('0x1b')],_0x21cd3f;if(_0x1fd064>=_0x56e540){_0x1fd064=_0x56e540;_0x21cd3f=0xc8;}else{_0x21cd3f=0xce;}_0x41b10e[_0x7d03('0x17')](_0x21cd3f);return _0x41b10e['set']('Content-Range',_0x2fa1b1+'-'+_0x1fd064+'/'+_0x56e540)['json'](_0x4a83fe);}return null;};}function patchUpdates(_0x4415fc){return function(_0x357e6a){try{jsonpatch[_0x7d03('0x1c')](_0x357e6a,_0x4415fc,!![]);}catch(_0xbc8768){return BPromise[_0x7d03('0x1d')](_0xbc8768);}return _0x357e6a[_0x7d03('0x1e')]();};}function saveUpdates(_0x530adf,_0x34a8c5){return function(_0x3dd197){if(_0x3dd197){return _0x3dd197['update'](_0x530adf)['then'](function(_0x41ff03){return _0x41ff03;});}return null;};}function removeEntity(_0x32deb7,_0x1e2f5c){return function(_0x1d29b3){if(_0x1d29b3){return _0x1d29b3[_0x7d03('0x1f')]()[_0x7d03('0x20')](function(){_0x32deb7[_0x7d03('0x17')](0xcc)[_0x7d03('0x16')]();});}};}function handleEntityNotFound(_0x43f612,_0x3e855f){return function(_0x3fb94a){if(!_0x3fb94a){_0x43f612[_0x7d03('0x21')](0x194);}return _0x3fb94a;};}function handleError(_0x444604,_0x2ee85b){_0x2ee85b=_0x2ee85b||0x1f4;return function(_0x519847){logger[_0x7d03('0x22')](_0x519847[_0x7d03('0x23')]);if(_0x519847[_0x7d03('0x24')]){delete _0x519847[_0x7d03('0x24')];}_0x444604[_0x7d03('0x17')](_0x2ee85b)[_0x7d03('0x25')](_0x519847);};}exports['index']=function(_0x5ea44a,_0x1f14ac){var _0x57703f={},_0x30b01d={},_0x4e9dad={'count':0x0,'rows':[]};var _0x36db59=db[_0x7d03('0x26')][_0x7d03('0x27')];_0x30b01d[_0x7d03('0x28')]=_[_0x7d03('0x29')](_['keys'](_0x36db59),[_0x7d03('0x2a')]);_0x30b01d[_0x7d03('0x2b')]=_[_0x7d03('0x2c')](_0x5ea44a[_0x7d03('0x2b')]);_0x30b01d[_0x7d03('0x2d')]=_[_0x7d03('0x2e')](_0x30b01d[_0x7d03('0x28')],_0x30b01d[_0x7d03('0x2b')]);_0x57703f[_0x7d03('0x2f')]=_[_0x7d03('0x2e')](_0x30b01d[_0x7d03('0x28')],qs[_0x7d03('0x30')](_0x5ea44a[_0x7d03('0x2b')]['fields']));_0x57703f[_0x7d03('0x2f')]=_0x57703f['attributes'][_0x7d03('0x31')]?_0x57703f[_0x7d03('0x2f')]:_0x30b01d[_0x7d03('0x28')];if(!_0x5ea44a[_0x7d03('0x2b')][_0x7d03('0x32')]('nolimit')){_0x57703f[_0x7d03('0x1b')]=qs['limit'](_0x5ea44a[_0x7d03('0x2b')][_0x7d03('0x1b')]);_0x57703f['offset']=qs['offset'](_0x5ea44a[_0x7d03('0x2b')]['offset']);}_0x57703f['order']=qs[_0x7d03('0x33')](_0x5ea44a[_0x7d03('0x2b')]['sort']);_0x57703f[_0x7d03('0x34')]=qs[_0x7d03('0x2d')](_[_0x7d03('0x35')](_0x5ea44a[_0x7d03('0x2b')],_0x30b01d[_0x7d03('0x2d')]));if(_0x5ea44a[_0x7d03('0x2b')][_0x7d03('0x36')]){_0x57703f[_0x7d03('0x34')]=_['merge'](_0x57703f[_0x7d03('0x34')],{'$or':_[_0x7d03('0x37')](_0x36db59,function(_0x241762){if(_0x241762['type']['key']!==_0x7d03('0x38')){var _0x271e51={};_0x271e51[_0x241762[_0x7d03('0x39')]]={'$like':'%'+_0x5ea44a[_0x7d03('0x2b')]['filter']+'%'};return _0x271e51;}})});}_0x57703f=_['merge']({},_0x57703f,_0x5ea44a[_0x7d03('0x3a')]);var _0x1152c6={'where':_0x57703f[_0x7d03('0x34')]};return db[_0x7d03('0x26')][_0x7d03('0x19')](_0x1152c6)[_0x7d03('0x20')](function(_0x28fdcb){_0x4e9dad[_0x7d03('0x19')]=_0x28fdcb;if(_0x5ea44a[_0x7d03('0x2b')][_0x7d03('0x3b')]){_0x57703f['include']=[{'all':!![]}];}return db['VoiceRecording'][_0x7d03('0x3c')](_0x57703f);})[_0x7d03('0x20')](function(_0x22effa){_0x4e9dad[_0x7d03('0x3d')]=_0x22effa;return _0x4e9dad;})['then'](respondWithFilteredResult(_0x1f14ac,_0x57703f))[_0x7d03('0x3e')](handleError(_0x1f14ac,null));};exports[_0x7d03('0x3f')]=function(_0x4b799d,_0x4b99bf){var _0x3828f7={'raw':![],'where':{'id':_0x4b799d[_0x7d03('0x40')]['id']}},_0x4adeb9={};_0x4adeb9[_0x7d03('0x28')]=_['keys'](db[_0x7d03('0x26')]['rawAttributes']);_0x4adeb9[_0x7d03('0x2b')]=_[_0x7d03('0x2c')](_0x4b799d[_0x7d03('0x2b')]);_0x4adeb9[_0x7d03('0x2d')]=_[_0x7d03('0x2e')](_0x4adeb9[_0x7d03('0x28')],_0x4adeb9[_0x7d03('0x2b')]);_0x3828f7['attributes']=_['intersection'](_0x4adeb9['model'],qs[_0x7d03('0x30')](_0x4b799d[_0x7d03('0x2b')][_0x7d03('0x30')]));_0x3828f7[_0x7d03('0x2f')]=_0x3828f7[_0x7d03('0x2f')][_0x7d03('0x31')]?_0x3828f7[_0x7d03('0x2f')]:_0x4adeb9[_0x7d03('0x28')];if(_0x4b799d[_0x7d03('0x2b')]['includeAll']){_0x3828f7[_0x7d03('0x41')]=[{'all':!![]}];}_0x3828f7=_['merge']({},_0x3828f7,_0x4b799d['options']);return db[_0x7d03('0x26')][_0x7d03('0x42')](_0x3828f7)[_0x7d03('0x20')](handleEntityNotFound(_0x4b99bf,null))['then'](respondWithResult(_0x4b99bf,null))['catch'](handleError(_0x4b99bf,null));};exports[_0x7d03('0x43')]=function(_0x268fa4,_0x348959){return db['VoiceRecording'][_0x7d03('0x43')](_0x268fa4['body'],{})['then'](respondWithResult(_0x348959,0xc9))[_0x7d03('0x3e')](handleError(_0x348959,null));};exports[_0x7d03('0x44')]=function(_0x51a86a,_0x510260){if(_0x51a86a[_0x7d03('0x45')]['id']){delete _0x51a86a[_0x7d03('0x45')]['id'];}return db['VoiceRecording'][_0x7d03('0x42')]({'where':{'id':_0x51a86a[_0x7d03('0x40')]['id']}})['then'](handleEntityNotFound(_0x510260,null))[_0x7d03('0x20')](saveUpdates(_0x51a86a[_0x7d03('0x45')],null))[_0x7d03('0x20')](respondWithResult(_0x510260,null))[_0x7d03('0x3e')](handleError(_0x510260,null));};exports[_0x7d03('0x1f')]=function(_0x1c6bf5,_0x2d9eca){return db[_0x7d03('0x26')][_0x7d03('0x42')]({'where':{'id':_0x1c6bf5[_0x7d03('0x40')]['id']}})[_0x7d03('0x20')](handleEntityNotFound(_0x2d9eca,null))[_0x7d03('0x20')](removeEntity(_0x2d9eca,null))[_0x7d03('0x3e')](handleError(_0x2d9eca,null));};exports[_0x7d03('0x46')]=function(_0x5dbabe,_0x2c011b){return db[_0x7d03('0x26')][_0x7d03('0x46')]()[_0x7d03('0x20')](respondWithResult(_0x2c011b,null))[_0x7d03('0x3e')](handleError(_0x2c011b,null));};exports[_0x7d03('0x47')]=function(_0x100932,_0x5a7e2a,_0x49a26b){var _0x369c24=require(_0x7d03('0x48'));var _0x4ce377=![];var _0x1de120={};if(_0x100932[_0x7d03('0x2b')][_0x7d03('0x49')]&&_0x100932[_0x7d03('0x2b')]['type']==='uniqueid'){_0x1de120[_0x7d03('0x4a')]=_0x100932['params']['id'];}else{_0x1de120['id']=_0x100932[_0x7d03('0x40')]['id'];}return db['VoiceRecording'][_0x7d03('0x42')]({'where':_0x1de120,'attributes':['id',_0x7d03('0x4b')],'raw':!![]})[_0x7d03('0x20')](handleEntityNotFound(_0x5a7e2a,null))['then'](function(_0x12bb97){if(_0x12bb97){var _0x529b60=_0x12bb97['value'];var _0x23e18c=util[_0x7d03('0x2a')]('%s.cypher',_0x529b60);if(fs[_0x7d03('0x4c')](_0x23e18c)){_0x4ce377=!![];return _0x369c24[_0x7d03('0x4d')](_0x23e18c,_0x529b60,config[_0x7d03('0x4e')][_0x7d03('0x4f')])[_0x7d03('0x20')](function(){return _0x12bb97;});}return _0x12bb97;}})['then'](function(_0x59c8b0){if(_0x59c8b0){var _0x89a81b=_0x59c8b0['value'];if(!fs[_0x7d03('0x4c')](_0x89a81b)){throw new db[(_0x7d03('0x50'))]['ValidationError'](_0x7d03('0x51'));}if(_0x59c8b0['filename']){return _0x5a7e2a[_0x7d03('0x47')](_0x89a81b,_0x59c8b0[_0x7d03('0x52')]+path[_0x7d03('0x53')](_0x89a81b),function(){if(_0x4ce377){fs['unlink'](_0x89a81b);}});}else{return _0x5a7e2a[_0x7d03('0x47')](_0x89a81b,function(_0x5b7cb7){if(_0x4ce377){fs['unlink'](_0x89a81b);}});}}})[_0x7d03('0x3e')](function(_0x20ea8d){if(_0x20ea8d[_0x7d03('0x54')]==='VoiceRecording\x20not\x20found'){_0x5a7e2a['status'](0x194)[_0x7d03('0x25')](_0x7d03('0x55'));}else{return handleError(_0x5a7e2a,null);}});};exports[_0x7d03('0x56')]=function(_0x43e122,_0x422699,_0x37689e){var _0xbaa21b=require(_0x7d03('0x48'));var _0x5f31cf=![];var _0x4a2857={'$and':[db[_0x7d03('0x57')][_0x7d03('0x34')](db[_0x7d03('0x57')]['fn']('MD5',db[_0x7d03('0x57')][_0x7d03('0x58')](_0x7d03('0x4a'))),_0x43e122[_0x7d03('0x2b')][_0x7d03('0x59')])]};if(_0x43e122[_0x7d03('0x2b')][_0x7d03('0x49')]&&_0x43e122['query'][_0x7d03('0x49')]==='uniqueid'){_0x4a2857[_0x7d03('0x5a')][_0x7d03('0x5b')]({'uniqueid':_0x43e122[_0x7d03('0x40')]['id']});}else{_0x4a2857[_0x7d03('0x5a')][_0x7d03('0x5b')]({'id':_0x43e122[_0x7d03('0x40')]['id']});}return db[_0x7d03('0x26')][_0x7d03('0x42')]({'where':_0x4a2857,'attributes':['id',_0x7d03('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x422699,null))[_0x7d03('0x20')](function(_0x5d42c4){if(_0x5d42c4){var _0x267265=util['format'](_0x7d03('0x5c'),_0x5d42c4[_0x7d03('0x4b')]);if(fs[_0x7d03('0x4c')](_0x267265)){_0x5f31cf=!![];return _0xbaa21b[_0x7d03('0x4d')](_0x267265,_0x5d42c4['value'],config[_0x7d03('0x4e')][_0x7d03('0x4f')])[_0x7d03('0x20')](function(){return _0x5d42c4;});}return _0x5d42c4;}})[_0x7d03('0x20')](function(_0xe4686){if(_0xe4686){if(!fs[_0x7d03('0x4c')](_0xe4686[_0x7d03('0x4b')])){throw new db[(_0x7d03('0x50'))][(_0x7d03('0x5d'))](_0x7d03('0x51'));}if(_0xe4686[_0x7d03('0x52')]){return _0x422699[_0x7d03('0x47')](_0xe4686[_0x7d03('0x4b')],_0xe4686[_0x7d03('0x52')]+path[_0x7d03('0x53')](_0xe4686[_0x7d03('0x4b')]),function(){if(_0x5f31cf){fs[_0x7d03('0x5e')](_0xe4686[_0x7d03('0x4b')]);}});}else{return _0x422699[_0x7d03('0x47')](_0xe4686[_0x7d03('0x4b')],function(_0x20c1c0){if(_0x5f31cf){fs[_0x7d03('0x5e')](_0xe4686[_0x7d03('0x4b')]);}});}}})[_0x7d03('0x3e')](handleError(_0x422699,null));}; \ No newline at end of file +var _0xc7ad=['hasOwnProperty','nolimit','offset','sort','where','pick','filters','filter','map','type','VIRTUAL','field','merge','options','includeAll','include','show','params','find','catch','create','body','update','describe','../../components/encryptor','value','format','%s.cypher','existsSync','decryptFile','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','downloads','sequelize','MD5','col','uniqueid','token','$and','push','secrets','recording','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','count','limit','set','json','apply','reject','then','destroy','end','error','stack','name','send','VoiceRecording','model','differenceBy','keys','query','intersection','attributes','fields','length'];(function(_0x4d0c3e,_0x467d04){var _0x1b9448=function(_0x42efe5){while(--_0x42efe5){_0x4d0c3e['push'](_0x4d0c3e['shift']());}};_0x1b9448(++_0x467d04);}(_0xc7ad,0x150));var _0xdc7a=function(_0x118b94,_0xb66673){_0x118b94=_0x118b94-0x0;var _0x56b35f=_0xc7ad[_0x118b94];return _0x56b35f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdc7a('0x0'));var rimraf=require(_0xdc7a('0x1'));var zipdir=require(_0xdc7a('0x2'));var jsonpatch=require(_0xdc7a('0x3'));var rp=require(_0xdc7a('0x4'));var moment=require('moment');var BPromise=require(_0xdc7a('0x5'));var Mustache=require(_0xdc7a('0x6'));var util=require(_0xdc7a('0x7'));var path=require('path');var sox=require(_0xdc7a('0x8'));var csv=require('to-csv');var ejs=require(_0xdc7a('0x9'));var fs=require('fs');var _=require(_0xdc7a('0xa'));var squel=require(_0xdc7a('0xb'));var crypto=require(_0xdc7a('0xc'));var jsforce=require(_0xdc7a('0xd'));var deskjs=require(_0xdc7a('0xe'));var toCsv=require(_0xdc7a('0xf'));var querystring=require(_0xdc7a('0x10'));var Papa=require('papaparse');var Redis=require(_0xdc7a('0x11'));var authService=require(_0xdc7a('0x12'));var qs=require(_0xdc7a('0x13'));var hardwareService=require(_0xdc7a('0x14'));var logger=require(_0xdc7a('0x15'))(_0xdc7a('0x16'));var utils=require('../../config/utils');var config=require(_0xdc7a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x478b83,_0x2bcfb2){_0x2bcfb2=_0x2bcfb2||0xcc;return function(_0x32b26e){if(_0x32b26e){return _0x478b83[_0xdc7a('0x18')](_0x2bcfb2);}return _0x478b83[_0xdc7a('0x19')](_0x2bcfb2)['end']();};}function respondWithResult(_0x2f53fa,_0x900b7){_0x900b7=_0x900b7||0xc8;return function(_0x170a10){if(_0x170a10){return _0x2f53fa[_0xdc7a('0x19')](_0x900b7)['json'](_0x170a10);}};}function respondWithFilteredResult(_0x24afda,_0x277433){return function(_0x3a0d02){if(_0x3a0d02){var _0x238156=_0x3a0d02[_0xdc7a('0x1a')],_0x5b77c8=_0x277433['offset'],_0x311687=_0x277433['offset']+_0x277433[_0xdc7a('0x1b')],_0x22ce24;if(_0x311687>=_0x238156){_0x311687=_0x238156;_0x22ce24=0xc8;}else{_0x22ce24=0xce;}_0x24afda['status'](_0x22ce24);return _0x24afda[_0xdc7a('0x1c')]('Content-Range',_0x5b77c8+'-'+_0x311687+'/'+_0x238156)[_0xdc7a('0x1d')](_0x3a0d02);}return null;};}function patchUpdates(_0x5c67aa){return function(_0x3cb6b4){try{jsonpatch[_0xdc7a('0x1e')](_0x3cb6b4,_0x5c67aa,!![]);}catch(_0x162f9c){return BPromise[_0xdc7a('0x1f')](_0x162f9c);}return _0x3cb6b4['save']();};}function saveUpdates(_0x299866,_0x1fb97a){return function(_0x1e7dda){if(_0x1e7dda){return _0x1e7dda['update'](_0x299866)[_0xdc7a('0x20')](function(_0x5c4c67){return _0x5c4c67;});}return null;};}function removeEntity(_0x3f4278,_0x41a1a0){return function(_0x35acba){if(_0x35acba){return _0x35acba[_0xdc7a('0x21')]()[_0xdc7a('0x20')](function(){_0x3f4278[_0xdc7a('0x19')](0xcc)[_0xdc7a('0x22')]();});}};}function handleEntityNotFound(_0x420ef4,_0x582faa){return function(_0x49156e){if(!_0x49156e){_0x420ef4[_0xdc7a('0x18')](0x194);}return _0x49156e;};}function handleError(_0x2313e1,_0x460f5a){_0x460f5a=_0x460f5a||0x1f4;return function(_0xbd0913){logger[_0xdc7a('0x23')](_0xbd0913[_0xdc7a('0x24')]);if(_0xbd0913[_0xdc7a('0x25')]){delete _0xbd0913[_0xdc7a('0x25')];}_0x2313e1[_0xdc7a('0x19')](_0x460f5a)[_0xdc7a('0x26')](_0xbd0913);};}exports['index']=function(_0x310717,_0x38b7c2){var _0x1abe28={},_0x2ebdec={},_0x337513={'count':0x0,'rows':[]};var _0x59fe82=db[_0xdc7a('0x27')]['rawAttributes'];_0x2ebdec[_0xdc7a('0x28')]=_[_0xdc7a('0x29')](_[_0xdc7a('0x2a')](_0x59fe82),['format']);_0x2ebdec[_0xdc7a('0x2b')]=_['keys'](_0x310717[_0xdc7a('0x2b')]);_0x2ebdec['filters']=_[_0xdc7a('0x2c')](_0x2ebdec[_0xdc7a('0x28')],_0x2ebdec[_0xdc7a('0x2b')]);_0x1abe28[_0xdc7a('0x2d')]=_[_0xdc7a('0x2c')](_0x2ebdec[_0xdc7a('0x28')],qs[_0xdc7a('0x2e')](_0x310717[_0xdc7a('0x2b')][_0xdc7a('0x2e')]));_0x1abe28[_0xdc7a('0x2d')]=_0x1abe28[_0xdc7a('0x2d')][_0xdc7a('0x2f')]?_0x1abe28[_0xdc7a('0x2d')]:_0x2ebdec[_0xdc7a('0x28')];if(!_0x310717['query'][_0xdc7a('0x30')](_0xdc7a('0x31'))){_0x1abe28['limit']=qs[_0xdc7a('0x1b')](_0x310717['query']['limit']);_0x1abe28[_0xdc7a('0x32')]=qs[_0xdc7a('0x32')](_0x310717[_0xdc7a('0x2b')]['offset']);}_0x1abe28['order']=qs['sort'](_0x310717[_0xdc7a('0x2b')][_0xdc7a('0x33')]);_0x1abe28[_0xdc7a('0x34')]=qs['filters'](_[_0xdc7a('0x35')](_0x310717[_0xdc7a('0x2b')],_0x2ebdec[_0xdc7a('0x36')]));if(_0x310717[_0xdc7a('0x2b')][_0xdc7a('0x37')]){_0x1abe28[_0xdc7a('0x34')]=_['merge'](_0x1abe28[_0xdc7a('0x34')],{'$or':_[_0xdc7a('0x38')](_0x59fe82,function(_0x2216b2){if(_0x2216b2[_0xdc7a('0x39')]['key']!==_0xdc7a('0x3a')){var _0x28624d={};_0x28624d[_0x2216b2[_0xdc7a('0x3b')]]={'$like':'%'+_0x310717[_0xdc7a('0x2b')]['filter']+'%'};return _0x28624d;}})});}_0x1abe28=_[_0xdc7a('0x3c')]({},_0x1abe28,_0x310717[_0xdc7a('0x3d')]);var _0x2be2c4={'where':_0x1abe28[_0xdc7a('0x34')]};return db[_0xdc7a('0x27')][_0xdc7a('0x1a')](_0x2be2c4)[_0xdc7a('0x20')](function(_0x41ce43){_0x337513[_0xdc7a('0x1a')]=_0x41ce43;if(_0x310717[_0xdc7a('0x2b')][_0xdc7a('0x3e')]){_0x1abe28[_0xdc7a('0x3f')]=[{'all':!![]}];}return db[_0xdc7a('0x27')]['findAll'](_0x1abe28);})[_0xdc7a('0x20')](function(_0x232742){_0x337513['rows']=_0x232742;return _0x337513;})[_0xdc7a('0x20')](respondWithFilteredResult(_0x38b7c2,_0x1abe28))['catch'](handleError(_0x38b7c2,null));};exports[_0xdc7a('0x40')]=function(_0x1b1227,_0x4f4577){var _0x44316f={'raw':![],'where':{'id':_0x1b1227[_0xdc7a('0x41')]['id']}},_0x128eda={};_0x128eda[_0xdc7a('0x28')]=_[_0xdc7a('0x2a')](db['VoiceRecording']['rawAttributes']);_0x128eda[_0xdc7a('0x2b')]=_[_0xdc7a('0x2a')](_0x1b1227[_0xdc7a('0x2b')]);_0x128eda['filters']=_[_0xdc7a('0x2c')](_0x128eda[_0xdc7a('0x28')],_0x128eda[_0xdc7a('0x2b')]);_0x44316f[_0xdc7a('0x2d')]=_[_0xdc7a('0x2c')](_0x128eda['model'],qs[_0xdc7a('0x2e')](_0x1b1227[_0xdc7a('0x2b')]['fields']));_0x44316f[_0xdc7a('0x2d')]=_0x44316f[_0xdc7a('0x2d')][_0xdc7a('0x2f')]?_0x44316f[_0xdc7a('0x2d')]:_0x128eda['model'];if(_0x1b1227[_0xdc7a('0x2b')][_0xdc7a('0x3e')]){_0x44316f['include']=[{'all':!![]}];}_0x44316f=_['merge']({},_0x44316f,_0x1b1227[_0xdc7a('0x3d')]);return db[_0xdc7a('0x27')][_0xdc7a('0x42')](_0x44316f)['then'](handleEntityNotFound(_0x4f4577,null))[_0xdc7a('0x20')](respondWithResult(_0x4f4577,null))[_0xdc7a('0x43')](handleError(_0x4f4577,null));};exports[_0xdc7a('0x44')]=function(_0x40d7ff,_0x355a47){return db[_0xdc7a('0x27')][_0xdc7a('0x44')](_0x40d7ff[_0xdc7a('0x45')],{})[_0xdc7a('0x20')](respondWithResult(_0x355a47,0xc9))[_0xdc7a('0x43')](handleError(_0x355a47,null));};exports[_0xdc7a('0x46')]=function(_0x1fe957,_0x2e4f3d){if(_0x1fe957[_0xdc7a('0x45')]['id']){delete _0x1fe957[_0xdc7a('0x45')]['id'];}return db[_0xdc7a('0x27')][_0xdc7a('0x42')]({'where':{'id':_0x1fe957[_0xdc7a('0x41')]['id']}})[_0xdc7a('0x20')](handleEntityNotFound(_0x2e4f3d,null))[_0xdc7a('0x20')](saveUpdates(_0x1fe957[_0xdc7a('0x45')],null))[_0xdc7a('0x20')](respondWithResult(_0x2e4f3d,null))[_0xdc7a('0x43')](handleError(_0x2e4f3d,null));};exports[_0xdc7a('0x21')]=function(_0x33fb38,_0x81c7cc){return db[_0xdc7a('0x27')][_0xdc7a('0x42')]({'where':{'id':_0x33fb38['params']['id']}})[_0xdc7a('0x20')](handleEntityNotFound(_0x81c7cc,null))[_0xdc7a('0x20')](removeEntity(_0x81c7cc,null))[_0xdc7a('0x43')](handleError(_0x81c7cc,null));};exports[_0xdc7a('0x47')]=function(_0x377660,_0x6e30ed){return db[_0xdc7a('0x27')][_0xdc7a('0x47')]()[_0xdc7a('0x20')](respondWithResult(_0x6e30ed,null))['catch'](handleError(_0x6e30ed,null));};exports['download']=function(_0x3addc0,_0x14bdf6,_0x797b3d){var _0x2b1965=require(_0xdc7a('0x48'));var _0x1b5ab9=![];var _0x4c581f={};if(_0x3addc0[_0xdc7a('0x2b')][_0xdc7a('0x39')]&&_0x3addc0[_0xdc7a('0x2b')][_0xdc7a('0x39')]==='uniqueid'){_0x4c581f['uniqueid']=_0x3addc0[_0xdc7a('0x41')]['id'];}else{_0x4c581f['id']=_0x3addc0[_0xdc7a('0x41')]['id'];}return db['VoiceRecording'][_0xdc7a('0x42')]({'where':_0x4c581f,'attributes':['id',_0xdc7a('0x49')],'raw':!![]})[_0xdc7a('0x20')](handleEntityNotFound(_0x14bdf6,null))[_0xdc7a('0x20')](function(_0x157058){if(_0x157058){var _0x4ffad6=_0x157058['value'];var _0x12083c=util[_0xdc7a('0x4a')](_0xdc7a('0x4b'),_0x4ffad6);if(fs[_0xdc7a('0x4c')](_0x12083c)){_0x1b5ab9=!![];return _0x2b1965[_0xdc7a('0x4d')](_0x12083c,_0x4ffad6,config['secrets']['recording'])['then'](function(){return _0x157058;});}return _0x157058;}})[_0xdc7a('0x20')](function(_0x2e4be3){if(_0x2e4be3){var _0x4f4a9f=_0x2e4be3[_0xdc7a('0x49')];if(!fs['existsSync'](_0x4f4a9f)){throw new db[(_0xdc7a('0x4e'))][(_0xdc7a('0x4f'))](_0xdc7a('0x50'));}if(_0x2e4be3[_0xdc7a('0x51')]){return _0x14bdf6[_0xdc7a('0x52')](_0x4f4a9f,_0x2e4be3[_0xdc7a('0x51')]+path[_0xdc7a('0x53')](_0x4f4a9f),function(){if(_0x1b5ab9){fs[_0xdc7a('0x54')](_0x4f4a9f);}});}else{return _0x14bdf6[_0xdc7a('0x52')](_0x4f4a9f,function(_0x4d0ee9){if(_0x1b5ab9){fs['unlink'](_0x4f4a9f);}});}}})['catch'](function(_0x2449ee){if(_0x2449ee[_0xdc7a('0x55')]==='VoiceRecording\x20not\x20found'){_0x14bdf6['status'](0x194)[_0xdc7a('0x26')]('Not\x20found');}else{return handleError(_0x14bdf6,null);}});};exports[_0xdc7a('0x56')]=function(_0x38c977,_0x117e12,_0x2d57e6){var _0x5469ba=require(_0xdc7a('0x48'));var _0x27b2f7=![];var _0x5c419d={'$and':[db['sequelize'][_0xdc7a('0x34')](db[_0xdc7a('0x57')]['fn'](_0xdc7a('0x58'),db[_0xdc7a('0x57')][_0xdc7a('0x59')](_0xdc7a('0x5a'))),_0x38c977['query'][_0xdc7a('0x5b')])]};if(_0x38c977['query'][_0xdc7a('0x39')]&&_0x38c977['query']['type']===_0xdc7a('0x5a')){_0x5c419d['$and']['push']({'uniqueid':_0x38c977[_0xdc7a('0x41')]['id']});}else{_0x5c419d[_0xdc7a('0x5c')][_0xdc7a('0x5d')]({'id':_0x38c977['params']['id']});}return db[_0xdc7a('0x27')][_0xdc7a('0x42')]({'where':_0x5c419d,'attributes':['id',_0xdc7a('0x49')],'raw':!![]})[_0xdc7a('0x20')](handleEntityNotFound(_0x117e12,null))[_0xdc7a('0x20')](function(_0x55f3b5){if(_0x55f3b5){var _0x2a6722=util['format'](_0xdc7a('0x4b'),_0x55f3b5[_0xdc7a('0x49')]);if(fs[_0xdc7a('0x4c')](_0x2a6722)){_0x27b2f7=!![];return _0x5469ba[_0xdc7a('0x4d')](_0x2a6722,_0x55f3b5[_0xdc7a('0x49')],config[_0xdc7a('0x5e')][_0xdc7a('0x5f')])[_0xdc7a('0x20')](function(){return _0x55f3b5;});}return _0x55f3b5;}})[_0xdc7a('0x20')](function(_0x4ded90){if(_0x4ded90){if(!fs[_0xdc7a('0x4c')](_0x4ded90[_0xdc7a('0x49')])){throw new db['Sequelize']['ValidationError'](_0xdc7a('0x50'));}if(_0x4ded90[_0xdc7a('0x51')]){return _0x117e12[_0xdc7a('0x52')](_0x4ded90['value'],_0x4ded90[_0xdc7a('0x51')]+path[_0xdc7a('0x53')](_0x4ded90['value']),function(){if(_0x27b2f7){fs[_0xdc7a('0x54')](_0x4ded90[_0xdc7a('0x49')]);}});}else{return _0x117e12[_0xdc7a('0x52')](_0x4ded90[_0xdc7a('0x49')],function(_0x3083cf){if(_0x27b2f7){fs[_0xdc7a('0x54')](_0x4ded90['value']);}});}}})[_0xdc7a('0x43')](handleError(_0x117e12,null));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 3cfcafa..decf43c 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 _0xd9c6=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','voice_recordings','uniqueid','util'];(function(_0x2f9537,_0x208824){var _0x2d3a43=function(_0x5e196a){while(--_0x5e196a){_0x2f9537['push'](_0x2f9537['shift']());}};_0x2d3a43(++_0x208824);}(_0xd9c6,0x1b7));var _0x6d9c=function(_0x282f5c,_0x4e0da4){_0x282f5c=_0x282f5c-0x0;var _0x4e3291=_0xd9c6[_0x282f5c];return _0x4e3291;};'use strict';var _=require('lodash');var util=require(_0x6d9c('0x0'));var logger=require(_0x6d9c('0x1'))(_0x6d9c('0x2'));var moment=require(_0x6d9c('0x3'));var BPromise=require(_0x6d9c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d9c('0x5'));var rimraf=require(_0x6d9c('0x6'));var config=require(_0x6d9c('0x7'));var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x493b38,_0x4af604){return _0x493b38[_0x6d9c('0x8')]('VoiceRecording',attributes,{'tableName':_0x6d9c('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6d9c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x80d6=['define','voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports'];(function(_0x3af529,_0xf4d73){var _0x5cf4c2=function(_0x24418d){while(--_0x24418d){_0x3af529['push'](_0x3af529['shift']());}};_0x5cf4c2(++_0xf4d73);}(_0x80d6,0xd5));var _0x680d=function(_0x18b191,_0x4e0684){_0x18b191=_0x18b191-0x0;var _0x43e146=_0x80d6[_0x18b191];return _0x43e146;};'use strict';var _=require(_0x680d('0x0'));var util=require(_0x680d('0x1'));var logger=require(_0x680d('0x2'))(_0x680d('0x3'));var moment=require(_0x680d('0x4'));var BPromise=require(_0x680d('0x5'));var rp=require(_0x680d('0x6'));var fs=require('fs');var path=require(_0x680d('0x7'));var rimraf=require(_0x680d('0x8'));var config=require(_0x680d('0x9'));var attributes=require(_0x680d('0xa'));module[_0x680d('0xb')]=function(_0x11630a,_0x2d2829){return _0x11630a[_0x680d('0xc')]('VoiceRecording',attributes,{'tableName':_0x680d('0xd'),'paranoid':![],'indexes':[{'name':_0x680d('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 72d49a3..6d0eb81 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 _0x1403=['create','callRecordingEncryption','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','util','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','limit','CreateVoiceRecording','../../components/encryptor','Setting'];(function(_0x501c2b,_0x47652a){var _0x5af099=function(_0x5d8481){while(--_0x5d8481){_0x501c2b['push'](_0x501c2b['shift']());}};_0x5af099(++_0x47652a);}(_0x1403,0x142));var _0x3140=function(_0x55d58f,_0x2bea83){_0x55d58f=_0x55d58f-0x0;var _0x1ad6e6=_0x1403[_0x55d58f];return _0x1ad6e6;};'use strict';var _=require('lodash');var util=require(_0x3140('0x0'));var moment=require('moment');var BPromise=require(_0x3140('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3140('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x3140('0x3'))(_0x3140('0x4'));var config=require('../../config/environment');var jayson=require(_0x3140('0x5'));var client=jayson[_0x3140('0x6')][_0x3140('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5ec216,_0x30fad7,_0x2b9c23){return new BPromise(function(_0x4cce12,_0x4a42e6){return client['request'](_0x5ec216,_0x2b9c23)[_0x3140('0x8')](function(_0x2f532a){logger[_0x3140('0x9')](_0x3140('0xa'),_0x30fad7,_0x3140('0xb'));logger[_0x3140('0xc')](_0x3140('0xd'),_0x30fad7,_0x3140('0xb'),JSON[_0x3140('0xe')](_0x2f532a));if(_0x2f532a['error']){if(_0x2f532a[_0x3140('0xf')][_0x3140('0x10')]===0x1f4){logger['error'](_0x3140('0xa'),_0x30fad7,_0x2f532a[_0x3140('0xf')]['message']);return _0x4a42e6(_0x2f532a[_0x3140('0xf')]['message']);}logger['error'](_0x3140('0xa'),_0x30fad7,_0x2f532a['error'][_0x3140('0x11')]);return _0x4cce12(_0x2f532a[_0x3140('0xf')]['message']);}else{logger[_0x3140('0x9')](_0x3140('0xa'),_0x30fad7,_0x3140('0xb'));_0x4cce12(_0x2f532a[_0x3140('0x12')][_0x3140('0x11')]);}})[_0x3140('0x13')](function(_0x27052f){logger['error'](_0x3140('0xa'),_0x30fad7,_0x27052f);_0x4a42e6(_0x27052f);});});}exports[_0x3140('0x14')]=function(_0x217225){var _0x2d504a=this;return new Promise(function(_0x58fed2,_0x8f44b4){return db[_0x3140('0x15')]['update'](_0x217225[_0x3140('0x16')],{'raw':_0x217225[_0x3140('0x17')]?_0x217225[_0x3140('0x17')][_0x3140('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x217225[_0x3140('0x17')]?_0x217225['options']['where']||null:null,'attributes':_0x217225[_0x3140('0x17')]?_0x217225[_0x3140('0x17')]['attributes']||null:null,'limit':_0x217225[_0x3140('0x17')]?_0x217225['options'][_0x3140('0x19')]||null:null})['then'](function(_0x2047a6){logger[_0x3140('0x9')]('UpdateVoiceRecording',_0x217225);logger[_0x3140('0xc')](_0x3140('0x14'),_0x217225,JSON[_0x3140('0xe')](_0x2047a6));_0x58fed2(_0x2047a6);})[_0x3140('0x13')](function(_0x2d1c77){logger[_0x3140('0xf')]('UpdateVoiceRecording',_0x2d1c77['message'],_0x217225);_0x8f44b4(_0x2d504a['error'](0x1f4,_0x2d1c77[_0x3140('0x11')]));});});};exports[_0x3140('0x1a')]=function(_0x223368){var _0x46b1ff=this;return new Promise(function(_0xe688ed,_0x56bb39){var _0x1d7a5f=require(_0x3140('0x1b'));var _0x2cf495;return db[_0x3140('0x1c')]['findOne']({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x3140('0x8')](function(_0x1fcabb){_0x2cf495=_0x1fcabb;return db[_0x3140('0x15')][_0x3140('0x1d')](_0x223368[_0x3140('0x16')]);})[_0x3140('0x8')](function(_0x5b4f66){if(_0x2cf495[_0x3140('0x1e')]&&fs[_0x3140('0x1f')](_0x5b4f66[_0x3140('0x20')])){var _0xca674e=util['format'](_0x3140('0x21'),_0x5b4f66[_0x3140('0x20')]);return _0x1d7a5f[_0x3140('0x22')](_0x5b4f66[_0x3140('0x20')],_0xca674e,config[_0x3140('0x23')][_0x3140('0x24')])[_0x3140('0x8')](function(){fs[_0x3140('0x25')](_0x5b4f66[_0x3140('0x20')]);logger[_0x3140('0x9')](_0x3140('0x26'));return _0x5b4f66;});}return _0x5b4f66;})['then'](function(_0x110bed){logger[_0x3140('0x9')](_0x3140('0x1a'),_0x223368);logger[_0x3140('0xc')](_0x3140('0x1a'),_0x223368,JSON[_0x3140('0xe')](_0x110bed));_0xe688ed(_0x110bed);})[_0x3140('0x13')](function(_0x3aa458){logger['error'](_0x3140('0x1a'),_0x3aa458['message'],_0x223368);_0x56bb39(_0x46b1ff[_0x3140('0xf')](0x1f4,_0x3aa458[_0x3140('0x11')]));});});}; \ No newline at end of file +var _0xbd33=['stringify','catch','CreateVoiceRecording','../../components/encryptor','Setting','callRecordingEncryption','create','existsSync','format','%s.cypher','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateVoiceRecording','VoiceRecording','options','raw','where','attributes','limit'];(function(_0x2edc63,_0x5c07e5){var _0x535de7=function(_0x507b5d){while(--_0x507b5d){_0x2edc63['push'](_0x2edc63['shift']());}};_0x535de7(++_0x5c07e5);}(_0xbd33,0x1b7));var _0x3bd3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbd33[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3bd3('0x0'));var util=require(_0x3bd3('0x1'));var moment=require(_0x3bd3('0x2'));var BPromise=require(_0x3bd3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3bd3('0x4'));var db=require(_0x3bd3('0x5'))['db'];var utils=require(_0x3bd3('0x6'));var logger=require(_0x3bd3('0x7'))(_0x3bd3('0x8'));var config=require(_0x3bd3('0x9'));var jayson=require(_0x3bd3('0xa'));var client=jayson[_0x3bd3('0xb')][_0x3bd3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18c6b5,_0x4295e3,_0x537387){return new BPromise(function(_0x25002c,_0x4653ab){return client[_0x3bd3('0xd')](_0x18c6b5,_0x537387)[_0x3bd3('0xe')](function(_0x33bc73){logger[_0x3bd3('0xf')](_0x3bd3('0x10'),_0x4295e3,_0x3bd3('0x11'));logger[_0x3bd3('0x12')](_0x3bd3('0x13'),_0x4295e3,_0x3bd3('0x11'),JSON['stringify'](_0x33bc73));if(_0x33bc73[_0x3bd3('0x14')]){if(_0x33bc73[_0x3bd3('0x14')][_0x3bd3('0x15')]===0x1f4){logger[_0x3bd3('0x14')]('VoiceRecording,\x20%s,\x20%s',_0x4295e3,_0x33bc73[_0x3bd3('0x14')][_0x3bd3('0x16')]);return _0x4653ab(_0x33bc73[_0x3bd3('0x14')][_0x3bd3('0x16')]);}logger[_0x3bd3('0x14')](_0x3bd3('0x10'),_0x4295e3,_0x33bc73[_0x3bd3('0x14')][_0x3bd3('0x16')]);return _0x25002c(_0x33bc73['error'][_0x3bd3('0x16')]);}else{logger[_0x3bd3('0xf')]('VoiceRecording,\x20%s,\x20%s',_0x4295e3,_0x3bd3('0x11'));_0x25002c(_0x33bc73[_0x3bd3('0x17')]['message']);}})['catch'](function(_0x569f7e){logger['error'](_0x3bd3('0x10'),_0x4295e3,_0x569f7e);_0x4653ab(_0x569f7e);});});}exports[_0x3bd3('0x18')]=function(_0x24c57f){var _0x15b969=this;return new Promise(function(_0x14b174,_0x1f61b0){return db[_0x3bd3('0x19')]['update'](_0x24c57f['body'],{'raw':_0x24c57f[_0x3bd3('0x1a')]?_0x24c57f['options'][_0x3bd3('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24c57f['options']?_0x24c57f['options'][_0x3bd3('0x1c')]||null:null,'attributes':_0x24c57f['options']?_0x24c57f['options'][_0x3bd3('0x1d')]||null:null,'limit':_0x24c57f[_0x3bd3('0x1a')]?_0x24c57f[_0x3bd3('0x1a')][_0x3bd3('0x1e')]||null:null})[_0x3bd3('0xe')](function(_0x2cc299){logger[_0x3bd3('0xf')]('UpdateVoiceRecording',_0x24c57f);logger[_0x3bd3('0x12')]('UpdateVoiceRecording',_0x24c57f,JSON[_0x3bd3('0x1f')](_0x2cc299));_0x14b174(_0x2cc299);})[_0x3bd3('0x20')](function(_0x2a8771){logger[_0x3bd3('0x14')](_0x3bd3('0x18'),_0x2a8771[_0x3bd3('0x16')],_0x24c57f);_0x1f61b0(_0x15b969['error'](0x1f4,_0x2a8771[_0x3bd3('0x16')]));});});};exports[_0x3bd3('0x21')]=function(_0x5707b8){var _0x28830d=this;return new Promise(function(_0x3340c4,_0x3aefe9){var _0x558766=require(_0x3bd3('0x22'));var _0x24a243;return db[_0x3bd3('0x23')]['findOne']({'attributes':['id',_0x3bd3('0x24')],'where':{'id':0x1},'raw':!![]})[_0x3bd3('0xe')](function(_0x588363){_0x24a243=_0x588363;return db[_0x3bd3('0x19')][_0x3bd3('0x25')](_0x5707b8['body']);})[_0x3bd3('0xe')](function(_0xe1cf16){if(_0x24a243[_0x3bd3('0x24')]&&fs[_0x3bd3('0x26')](_0xe1cf16['value'])){var _0xb417e3=util[_0x3bd3('0x27')](_0x3bd3('0x28'),_0xe1cf16[_0x3bd3('0x29')]);return _0x558766[_0x3bd3('0x2a')](_0xe1cf16['value'],_0xb417e3,config[_0x3bd3('0x2b')][_0x3bd3('0x2c')])[_0x3bd3('0xe')](function(){fs[_0x3bd3('0x2d')](_0xe1cf16[_0x3bd3('0x29')]);logger[_0x3bd3('0xf')](_0x3bd3('0x2e'));return _0xe1cf16;});}return _0xe1cf16;})[_0x3bd3('0xe')](function(_0x3a0387){logger[_0x3bd3('0xf')](_0x3bd3('0x21'),_0x5707b8);logger[_0x3bd3('0x12')](_0x3bd3('0x21'),_0x5707b8,JSON[_0x3bd3('0x1f')](_0x3a0387));_0x3340c4(_0x3a0387);})[_0x3bd3('0x20')](function(_0x367a83){logger['error']('CreateVoiceRecording',_0x367a83[_0x3bd3('0x16')],_0x5707b8);_0x3aefe9(_0x28830d[_0x3bd3('0x14')](0x1f4,_0x367a83['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 645fe80..5ab25b8 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 _0x3dbe=['show','post','put','update','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id'];(function(_0x409fbb,_0x4b2a27){var _0xd4b436=function(_0x51e28f){while(--_0x51e28f){_0x409fbb['push'](_0x409fbb['shift']());}};_0xd4b436(++_0x4b2a27);}(_0x3dbe,0x105));var _0xe3db=function(_0x39506b,_0x48fb4e){_0x39506b=_0x39506b-0x0;var _0x4a9122=_0x3dbe[_0x39506b];return _0x4a9122;};'use strict';var multer=require(_0xe3db('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe3db('0x1'));var express=require(_0xe3db('0x2'));var router=express['Router']();var auth=require(_0xe3db('0x3'));var interaction=require(_0xe3db('0x4'));var config=require('../../config/environment');var controller=require('./voiceTransferReport.controller');router[_0xe3db('0x5')]('/',auth[_0xe3db('0x6')](),controller[_0xe3db('0x7')]);router['get'](_0xe3db('0x8'),auth[_0xe3db('0x6')](),controller[_0xe3db('0x9')]);router[_0xe3db('0xa')]('/',auth[_0xe3db('0x6')](),controller['create']);router[_0xe3db('0xb')](_0xe3db('0x8'),auth[_0xe3db('0x6')](),controller[_0xe3db('0xc')]);router['delete'](_0xe3db('0x8'),auth['isAuthenticated'](),controller[_0xe3db('0xd')]);module[_0xe3db('0xe')]=router; \ No newline at end of file +var _0x6042=['./voiceTransferReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x761622,_0x4757d5){var _0x4a173e=function(_0x39c24a){while(--_0x39c24a){_0x761622['push'](_0x761622['shift']());}};_0x4a173e(++_0x4757d5);}(_0x6042,0x92));var _0x2604=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x6042[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x2604('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2604('0x1'));var router=express[_0x2604('0x2')]();var auth=require(_0x2604('0x3'));var interaction=require(_0x2604('0x4'));var config=require(_0x2604('0x5'));var controller=require(_0x2604('0x6'));router[_0x2604('0x7')]('/',auth[_0x2604('0x8')](),controller[_0x2604('0x9')]);router['get'](_0x2604('0xa'),auth[_0x2604('0x8')](),controller[_0x2604('0xb')]);router[_0x2604('0xc')]('/',auth[_0x2604('0x8')](),controller[_0x2604('0xd')]);router[_0x2604('0xe')](_0x2604('0xa'),auth['isAuthenticated'](),controller[_0x2604('0xf')]);router[_0x2604('0x10')](_0x2604('0xa'),auth[_0x2604('0x8')](),controller[_0x2604('0x11')]);module[_0x2604('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index d8934e6..dd175aa 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 _0xca28=['blind','STRING','Yes','sequelize','moment','exports','ENUM'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xca28,0x145));var _0x8ca2=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xca28[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0x8ca2('0x0'));var moment=require(_0x8ca2('0x1'));module[_0x8ca2('0x2')]={'type':{'type':Sequelize[_0x8ca2('0x3')](_0x8ca2('0x4'),'attended')},'result':{'type':Sequelize[_0x8ca2('0x5')]},'transfererchannel':{'type':Sequelize[_0x8ca2('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x8ca2('0x5')]},'transferercontext':{'type':Sequelize[_0x8ca2('0x5')]},'transfererexten':{'type':Sequelize[_0x8ca2('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x8ca2('0x5')]},'transfereechannel':{'type':Sequelize[_0x8ca2('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x8ca2('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x8ca2('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x8ca2('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x8ca2('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x8ca2('0x5')]},'isexternal':{'type':Sequelize['ENUM'](_0x8ca2('0x6'),'No')},'context':{'type':Sequelize[_0x8ca2('0x5')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2566=['sequelize','moment','ENUM','blind','STRING','Yes'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x2566,0x156));var _0x6256=function(_0x46f0b7,_0x110064){_0x46f0b7=_0x46f0b7-0x0;var _0x4aca30=_0x2566[_0x46f0b7];return _0x4aca30;};'use strict';var Sequelize=require(_0x6256('0x0'));var moment=require(_0x6256('0x1'));module['exports']={'type':{'type':Sequelize[_0x6256('0x2')](_0x6256('0x3'),'attended')},'result':{'type':Sequelize[_0x6256('0x4')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x6256('0x4')]},'transferercalleridname':{'type':Sequelize[_0x6256('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x6256('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x6256('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x6256('0x4')]},'transferercontext':{'type':Sequelize[_0x6256('0x4')]},'transfererexten':{'type':Sequelize[_0x6256('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x6256('0x4')]},'transfereechannel':{'type':Sequelize[_0x6256('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x6256('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x6256('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x6256('0x4')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x6256('0x4')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x6256('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x6256('0x4')]},'isexternal':{'type':Sequelize[_0x6256('0x2')](_0x6256('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x6256('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index c336eeb..44b9e51 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 _0x4137=['fields','length','hasOwnProperty','nolimit','order','sort','pick','where','map','type','key','VIRTUAL','field','filter','merge','options','count','includeAll','catch','params','keys','include','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','index','VoiceTransferReport','rawAttributes','model','query','filters','intersection','attributes'];(function(_0xb1f6cd,_0xc5c156){var _0x42e91e=function(_0x49b29a){while(--_0x49b29a){_0xb1f6cd['push'](_0xb1f6cd['shift']());}};_0x42e91e(++_0xc5c156);}(_0x4137,0xf8));var _0x7413=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x4137[_0x1cc8fe];return _0x230054;};'use strict';var pdf=require(_0x7413('0x0'));var emlformat=require(_0x7413('0x1'));var rimraf=require(_0x7413('0x2'));var zipdir=require(_0x7413('0x3'));var jsonpatch=require(_0x7413('0x4'));var rp=require(_0x7413('0x5'));var moment=require(_0x7413('0x6'));var BPromise=require(_0x7413('0x7'));var Mustache=require(_0x7413('0x8'));var util=require(_0x7413('0x9'));var path=require(_0x7413('0xa'));var sox=require(_0x7413('0xb'));var csv=require('to-csv');var ejs=require(_0x7413('0xc'));var fs=require('fs');var _=require(_0x7413('0xd'));var squel=require(_0x7413('0xe'));var crypto=require(_0x7413('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7413('0x10'));var toCsv=require(_0x7413('0x11'));var querystring=require('querystring');var Papa=require(_0x7413('0x12'));var Redis=require(_0x7413('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x7413('0x14'));var hardwareService=require(_0x7413('0x15'));var logger=require(_0x7413('0x16'))(_0x7413('0x17'));var utils=require(_0x7413('0x18'));var config=require('../../config/environment');var db=require(_0x7413('0x19'))['db'];function respondWithStatusCode(_0x32034c,_0x4bf07d){_0x4bf07d=_0x4bf07d||0xcc;return function(_0x18a874){if(_0x18a874){return _0x32034c[_0x7413('0x1a')](_0x4bf07d);}return _0x32034c[_0x7413('0x1b')](_0x4bf07d)['end']();};}function respondWithResult(_0x5956b0,_0x55ef69){_0x55ef69=_0x55ef69||0xc8;return function(_0x2267f6){if(_0x2267f6){return _0x5956b0[_0x7413('0x1b')](_0x55ef69)['json'](_0x2267f6);}};}function respondWithFilteredResult(_0x1a42aa,_0x45bef0){return function(_0x4955d3){if(_0x4955d3){var _0x38b3d1=_0x4955d3['count'],_0x50f301=_0x45bef0[_0x7413('0x1c')],_0x4b9a5b=_0x45bef0['offset']+_0x45bef0[_0x7413('0x1d')],_0x26501b;if(_0x4b9a5b>=_0x38b3d1){_0x4b9a5b=_0x38b3d1;_0x26501b=0xc8;}else{_0x26501b=0xce;}_0x1a42aa[_0x7413('0x1b')](_0x26501b);return _0x1a42aa[_0x7413('0x1e')](_0x7413('0x1f'),_0x50f301+'-'+_0x4b9a5b+'/'+_0x38b3d1)[_0x7413('0x20')](_0x4955d3);}return null;};}function patchUpdates(_0x26dafe){return function(_0x51194e){try{jsonpatch[_0x7413('0x21')](_0x51194e,_0x26dafe,!![]);}catch(_0x17c062){return BPromise[_0x7413('0x22')](_0x17c062);}return _0x51194e[_0x7413('0x23')]();};}function saveUpdates(_0x5bee15,_0x239d0e){return function(_0x12d94d){if(_0x12d94d){return _0x12d94d[_0x7413('0x24')](_0x5bee15)[_0x7413('0x25')](function(_0x409392){return _0x409392;});}return null;};}function removeEntity(_0x2d220f,_0x4886e3){return function(_0x4e18cb){if(_0x4e18cb){return _0x4e18cb['destroy']()['then'](function(){_0x2d220f[_0x7413('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1585ba,_0x372944){return function(_0x3b0c81){if(!_0x3b0c81){_0x1585ba[_0x7413('0x1a')](0x194);}return _0x3b0c81;};}function handleError(_0x1d46e9,_0x346ce8){_0x346ce8=_0x346ce8||0x1f4;return function(_0x1d97fd){logger[_0x7413('0x26')](_0x1d97fd[_0x7413('0x27')]);if(_0x1d97fd['name']){delete _0x1d97fd['name'];}_0x1d46e9[_0x7413('0x1b')](_0x346ce8)['send'](_0x1d97fd);};}exports[_0x7413('0x28')]=function(_0x71cbb4,_0x463b21){var _0x4c2e90={},_0x35e0fd={},_0x896552={'count':0x0,'rows':[]};var _0x79cab6=db[_0x7413('0x29')][_0x7413('0x2a')];_0x35e0fd[_0x7413('0x2b')]=_['keys'](_0x79cab6);_0x35e0fd[_0x7413('0x2c')]=_['keys'](_0x71cbb4[_0x7413('0x2c')]);_0x35e0fd[_0x7413('0x2d')]=_[_0x7413('0x2e')](_0x35e0fd[_0x7413('0x2b')],_0x35e0fd[_0x7413('0x2c')]);_0x4c2e90[_0x7413('0x2f')]=_['intersection'](_0x35e0fd[_0x7413('0x2b')],qs[_0x7413('0x30')](_0x71cbb4[_0x7413('0x2c')][_0x7413('0x30')]));_0x4c2e90[_0x7413('0x2f')]=_0x4c2e90[_0x7413('0x2f')][_0x7413('0x31')]?_0x4c2e90['attributes']:_0x35e0fd[_0x7413('0x2b')];if(!_0x71cbb4[_0x7413('0x2c')][_0x7413('0x32')](_0x7413('0x33'))){_0x4c2e90[_0x7413('0x1d')]=qs['limit'](_0x71cbb4[_0x7413('0x2c')]['limit']);_0x4c2e90[_0x7413('0x1c')]=qs[_0x7413('0x1c')](_0x71cbb4[_0x7413('0x2c')]['offset']);}_0x4c2e90[_0x7413('0x34')]=qs['sort'](_0x71cbb4[_0x7413('0x2c')][_0x7413('0x35')]);_0x4c2e90['where']=qs['filters'](_[_0x7413('0x36')](_0x71cbb4[_0x7413('0x2c')],_0x35e0fd[_0x7413('0x2d')]));if(_0x71cbb4['query']['filter']){_0x4c2e90[_0x7413('0x37')]=_['merge'](_0x4c2e90['where'],{'$or':_[_0x7413('0x38')](_0x79cab6,function(_0x575a79){if(_0x575a79[_0x7413('0x39')][_0x7413('0x3a')]!==_0x7413('0x3b')){var _0x2b178c={};_0x2b178c[_0x575a79[_0x7413('0x3c')]]={'$like':'%'+_0x71cbb4['query'][_0x7413('0x3d')]+'%'};return _0x2b178c;}})});}_0x4c2e90=_[_0x7413('0x3e')]({},_0x4c2e90,_0x71cbb4[_0x7413('0x3f')]);var _0xfa34ef={'where':_0x4c2e90[_0x7413('0x37')]};return db[_0x7413('0x29')][_0x7413('0x40')](_0xfa34ef)[_0x7413('0x25')](function(_0x5993d){_0x896552[_0x7413('0x40')]=_0x5993d;if(_0x71cbb4[_0x7413('0x2c')][_0x7413('0x41')]){_0x4c2e90['include']=[{'all':!![]}];}return db[_0x7413('0x29')]['findAll'](_0x4c2e90);})['then'](function(_0x5b592c){_0x896552['rows']=_0x5b592c;return _0x896552;})['then'](respondWithFilteredResult(_0x463b21,_0x4c2e90))[_0x7413('0x42')](handleError(_0x463b21,null));};exports['show']=function(_0x535e49,_0x5dc077){var _0x4d0008={'raw':!![],'where':{'id':_0x535e49[_0x7413('0x43')]['id']}},_0x4c6746={};_0x4c6746[_0x7413('0x2b')]=_[_0x7413('0x44')](db[_0x7413('0x29')][_0x7413('0x2a')]);_0x4c6746['query']=_[_0x7413('0x44')](_0x535e49['query']);_0x4c6746[_0x7413('0x2d')]=_[_0x7413('0x2e')](_0x4c6746[_0x7413('0x2b')],_0x4c6746[_0x7413('0x2c')]);_0x4d0008[_0x7413('0x2f')]=_[_0x7413('0x2e')](_0x4c6746[_0x7413('0x2b')],qs[_0x7413('0x30')](_0x535e49[_0x7413('0x2c')][_0x7413('0x30')]));_0x4d0008[_0x7413('0x2f')]=_0x4d0008[_0x7413('0x2f')][_0x7413('0x31')]?_0x4d0008['attributes']:_0x4c6746[_0x7413('0x2b')];if(_0x535e49[_0x7413('0x2c')][_0x7413('0x41')]){_0x4d0008[_0x7413('0x45')]=[{'all':!![]}];}_0x4d0008=_[_0x7413('0x3e')]({},_0x4d0008,_0x535e49[_0x7413('0x3f')]);return db[_0x7413('0x29')][_0x7413('0x46')](_0x4d0008)[_0x7413('0x25')](handleEntityNotFound(_0x5dc077,null))[_0x7413('0x25')](respondWithResult(_0x5dc077,null))[_0x7413('0x42')](handleError(_0x5dc077,null));};exports['create']=function(_0x2c5d1b,_0x52a088){return db[_0x7413('0x29')][_0x7413('0x47')](_0x2c5d1b[_0x7413('0x48')],{})[_0x7413('0x25')](respondWithResult(_0x52a088,0xc9))[_0x7413('0x42')](handleError(_0x52a088,null));};exports[_0x7413('0x24')]=function(_0x203729,_0x7de9d8){if(_0x203729[_0x7413('0x48')]['id']){delete _0x203729[_0x7413('0x48')]['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x203729[_0x7413('0x43')]['id']}})['then'](handleEntityNotFound(_0x7de9d8,null))['then'](saveUpdates(_0x203729[_0x7413('0x48')],null))[_0x7413('0x25')](respondWithResult(_0x7de9d8,null))['catch'](handleError(_0x7de9d8,null));};exports[_0x7413('0x49')]=function(_0x586d25,_0x562bae){return db[_0x7413('0x29')]['find']({'where':{'id':_0x586d25[_0x7413('0x43')]['id']}})[_0x7413('0x25')](handleEntityNotFound(_0x562bae,null))[_0x7413('0x25')](removeEntity(_0x562bae,null))[_0x7413('0x42')](handleError(_0x562bae,null));}; \ No newline at end of file +var _0xa5aa=['create','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','VoiceTransferReport','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','merge','map','type','key','VIRTUAL','options','findAll','catch','show','params','includeAll','include','find'];(function(_0x86b219,_0x43038f){var _0x1f320c=function(_0x8cd63f){while(--_0x8cd63f){_0x86b219['push'](_0x86b219['shift']());}};_0x1f320c(++_0x43038f);}(_0xa5aa,0x1ac));var _0xaa5a=function(_0x5ba14e,_0x3949fe){_0x5ba14e=_0x5ba14e-0x0;var _0x30e38b=_0xa5aa[_0x5ba14e];return _0x30e38b;};'use strict';var pdf=require(_0xaa5a('0x0'));var emlformat=require(_0xaa5a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xaa5a('0x2'));var jsonpatch=require(_0xaa5a('0x3'));var rp=require(_0xaa5a('0x4'));var moment=require(_0xaa5a('0x5'));var BPromise=require(_0xaa5a('0x6'));var Mustache=require(_0xaa5a('0x7'));var util=require('util');var path=require(_0xaa5a('0x8'));var sox=require(_0xaa5a('0x9'));var csv=require(_0xaa5a('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xaa5a('0xb'));var crypto=require(_0xaa5a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xaa5a('0xd'));var toCsv=require(_0xaa5a('0xa'));var querystring=require(_0xaa5a('0xe'));var Papa=require('papaparse');var Redis=require(_0xaa5a('0xf'));var authService=require(_0xaa5a('0x10'));var qs=require(_0xaa5a('0x11'));var hardwareService=require(_0xaa5a('0x12'));var logger=require(_0xaa5a('0x13'))(_0xaa5a('0x14'));var utils=require('../../config/utils');var config=require(_0xaa5a('0x15'));var db=require(_0xaa5a('0x16'))['db'];function respondWithStatusCode(_0x277150,_0x2a84fd){_0x2a84fd=_0x2a84fd||0xcc;return function(_0x3edbba){if(_0x3edbba){return _0x277150[_0xaa5a('0x17')](_0x2a84fd);}return _0x277150[_0xaa5a('0x18')](_0x2a84fd)[_0xaa5a('0x19')]();};}function respondWithResult(_0x2fee02,_0x773260){_0x773260=_0x773260||0xc8;return function(_0x1eb04d){if(_0x1eb04d){return _0x2fee02[_0xaa5a('0x18')](_0x773260)['json'](_0x1eb04d);}};}function respondWithFilteredResult(_0x2d931c,_0x40b34f){return function(_0x10919d){if(_0x10919d){var _0x5ee610=_0x10919d[_0xaa5a('0x1a')],_0x29ce43=_0x40b34f[_0xaa5a('0x1b')],_0x10ba31=_0x40b34f[_0xaa5a('0x1b')]+_0x40b34f[_0xaa5a('0x1c')],_0x286f17;if(_0x10ba31>=_0x5ee610){_0x10ba31=_0x5ee610;_0x286f17=0xc8;}else{_0x286f17=0xce;}_0x2d931c[_0xaa5a('0x18')](_0x286f17);return _0x2d931c[_0xaa5a('0x1d')](_0xaa5a('0x1e'),_0x29ce43+'-'+_0x10ba31+'/'+_0x5ee610)[_0xaa5a('0x1f')](_0x10919d);}return null;};}function patchUpdates(_0x1c613d){return function(_0x127d71){try{jsonpatch[_0xaa5a('0x20')](_0x127d71,_0x1c613d,!![]);}catch(_0x44279b){return BPromise[_0xaa5a('0x21')](_0x44279b);}return _0x127d71[_0xaa5a('0x22')]();};}function saveUpdates(_0x57cc60,_0x20ec46){return function(_0xb9156c){if(_0xb9156c){return _0xb9156c[_0xaa5a('0x23')](_0x57cc60)[_0xaa5a('0x24')](function(_0x5af50f){return _0x5af50f;});}return null;};}function removeEntity(_0x3af4dc,_0x2b2f2b){return function(_0x399b12){if(_0x399b12){return _0x399b12[_0xaa5a('0x25')]()[_0xaa5a('0x24')](function(){_0x3af4dc[_0xaa5a('0x18')](0xcc)[_0xaa5a('0x19')]();});}};}function handleEntityNotFound(_0x1d3fbc,_0x2a3dd7){return function(_0x5a9993){if(!_0x5a9993){_0x1d3fbc[_0xaa5a('0x17')](0x194);}return _0x5a9993;};}function handleError(_0x4c9035,_0x416351){_0x416351=_0x416351||0x1f4;return function(_0xbe9ce1){logger[_0xaa5a('0x26')](_0xbe9ce1[_0xaa5a('0x27')]);if(_0xbe9ce1[_0xaa5a('0x28')]){delete _0xbe9ce1['name'];}_0x4c9035[_0xaa5a('0x18')](_0x416351)[_0xaa5a('0x29')](_0xbe9ce1);};}exports['index']=function(_0x46e035,_0x4c7d86){var _0x36582e={},_0xc915c1={},_0x24c8e5={'count':0x0,'rows':[]};var _0x27fe53=db[_0xaa5a('0x2a')][_0xaa5a('0x2b')];_0xc915c1['model']=_[_0xaa5a('0x2c')](_0x27fe53);_0xc915c1[_0xaa5a('0x2d')]=_['keys'](_0x46e035[_0xaa5a('0x2d')]);_0xc915c1[_0xaa5a('0x2e')]=_['intersection'](_0xc915c1[_0xaa5a('0x2f')],_0xc915c1[_0xaa5a('0x2d')]);_0x36582e[_0xaa5a('0x30')]=_[_0xaa5a('0x31')](_0xc915c1[_0xaa5a('0x2f')],qs[_0xaa5a('0x32')](_0x46e035['query'][_0xaa5a('0x32')]));_0x36582e[_0xaa5a('0x30')]=_0x36582e[_0xaa5a('0x30')][_0xaa5a('0x33')]?_0x36582e['attributes']:_0xc915c1['model'];if(!_0x46e035[_0xaa5a('0x2d')][_0xaa5a('0x34')]('nolimit')){_0x36582e[_0xaa5a('0x1c')]=qs['limit'](_0x46e035['query'][_0xaa5a('0x1c')]);_0x36582e[_0xaa5a('0x1b')]=qs[_0xaa5a('0x1b')](_0x46e035[_0xaa5a('0x2d')][_0xaa5a('0x1b')]);}_0x36582e[_0xaa5a('0x35')]=qs[_0xaa5a('0x36')](_0x46e035['query'][_0xaa5a('0x36')]);_0x36582e[_0xaa5a('0x37')]=qs[_0xaa5a('0x2e')](_['pick'](_0x46e035[_0xaa5a('0x2d')],_0xc915c1['filters']));if(_0x46e035[_0xaa5a('0x2d')]['filter']){_0x36582e['where']=_[_0xaa5a('0x38')](_0x36582e[_0xaa5a('0x37')],{'$or':_[_0xaa5a('0x39')](_0x27fe53,function(_0x21e0b1){if(_0x21e0b1[_0xaa5a('0x3a')][_0xaa5a('0x3b')]!==_0xaa5a('0x3c')){var _0x37e24c={};_0x37e24c[_0x21e0b1['field']]={'$like':'%'+_0x46e035['query']['filter']+'%'};return _0x37e24c;}})});}_0x36582e=_[_0xaa5a('0x38')]({},_0x36582e,_0x46e035[_0xaa5a('0x3d')]);var _0x330a97={'where':_0x36582e[_0xaa5a('0x37')]};return db[_0xaa5a('0x2a')][_0xaa5a('0x1a')](_0x330a97)['then'](function(_0x5aa3f6){_0x24c8e5['count']=_0x5aa3f6;if(_0x46e035[_0xaa5a('0x2d')]['includeAll']){_0x36582e['include']=[{'all':!![]}];}return db['VoiceTransferReport'][_0xaa5a('0x3e')](_0x36582e);})[_0xaa5a('0x24')](function(_0x264a35){_0x24c8e5['rows']=_0x264a35;return _0x24c8e5;})[_0xaa5a('0x24')](respondWithFilteredResult(_0x4c7d86,_0x36582e))[_0xaa5a('0x3f')](handleError(_0x4c7d86,null));};exports[_0xaa5a('0x40')]=function(_0xe2234b,_0x20132a){var _0x5e5b09={'raw':!![],'where':{'id':_0xe2234b[_0xaa5a('0x41')]['id']}},_0xd2322f={};_0xd2322f[_0xaa5a('0x2f')]=_[_0xaa5a('0x2c')](db[_0xaa5a('0x2a')][_0xaa5a('0x2b')]);_0xd2322f[_0xaa5a('0x2d')]=_[_0xaa5a('0x2c')](_0xe2234b[_0xaa5a('0x2d')]);_0xd2322f['filters']=_['intersection'](_0xd2322f['model'],_0xd2322f['query']);_0x5e5b09[_0xaa5a('0x30')]=_[_0xaa5a('0x31')](_0xd2322f[_0xaa5a('0x2f')],qs[_0xaa5a('0x32')](_0xe2234b[_0xaa5a('0x2d')][_0xaa5a('0x32')]));_0x5e5b09[_0xaa5a('0x30')]=_0x5e5b09[_0xaa5a('0x30')][_0xaa5a('0x33')]?_0x5e5b09[_0xaa5a('0x30')]:_0xd2322f['model'];if(_0xe2234b[_0xaa5a('0x2d')][_0xaa5a('0x42')]){_0x5e5b09[_0xaa5a('0x43')]=[{'all':!![]}];}_0x5e5b09=_[_0xaa5a('0x38')]({},_0x5e5b09,_0xe2234b[_0xaa5a('0x3d')]);return db[_0xaa5a('0x2a')][_0xaa5a('0x44')](_0x5e5b09)['then'](handleEntityNotFound(_0x20132a,null))[_0xaa5a('0x24')](respondWithResult(_0x20132a,null))[_0xaa5a('0x3f')](handleError(_0x20132a,null));};exports[_0xaa5a('0x45')]=function(_0x1426a3,_0x3b5723){return db[_0xaa5a('0x2a')][_0xaa5a('0x45')](_0x1426a3[_0xaa5a('0x46')],{})[_0xaa5a('0x24')](respondWithResult(_0x3b5723,0xc9))['catch'](handleError(_0x3b5723,null));};exports['update']=function(_0xfe206a,_0x339b36){if(_0xfe206a[_0xaa5a('0x46')]['id']){delete _0xfe206a[_0xaa5a('0x46')]['id'];}return db[_0xaa5a('0x2a')][_0xaa5a('0x44')]({'where':{'id':_0xfe206a[_0xaa5a('0x41')]['id']}})['then'](handleEntityNotFound(_0x339b36,null))[_0xaa5a('0x24')](saveUpdates(_0xfe206a[_0xaa5a('0x46')],null))[_0xaa5a('0x24')](respondWithResult(_0x339b36,null))[_0xaa5a('0x3f')](handleError(_0x339b36,null));};exports[_0xaa5a('0x25')]=function(_0x52d126,_0x4eeceb){return db['VoiceTransferReport']['find']({'where':{'id':_0x52d126[_0xaa5a('0x41')]['id']}})[_0xaa5a('0x24')](handleEntityNotFound(_0x4eeceb,null))[_0xaa5a('0x24')](removeEntity(_0x4eeceb,null))[_0xaa5a('0x3f')](handleError(_0x4eeceb,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index b470336..6b07c27 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 _0x548a=['api','bluebird','path','rimraf','./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','util','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x548a,0x105));var _0xa548=function(_0x2ec395,_0x53e19f){_0x2ec395=_0x2ec395-0x0;var _0x4a2fb4=_0x548a[_0x2ec395];return _0x4a2fb4;};'use strict';var _=require(_0xa548('0x0'));var util=require(_0xa548('0x1'));var logger=require(_0xa548('0x2'))(_0xa548('0x3'));var moment=require('moment');var BPromise=require(_0xa548('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa548('0x5'));var rimraf=require(_0xa548('0x6'));var config=require('../../config/environment');var attributes=require(_0xa548('0x7'));module[_0xa548('0x8')]=function(_0x540181,_0xa7a771){return _0x540181[_0xa548('0x9')]('VoiceTransferReport',attributes,{'tableName':_0xa548('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb638=['report_call_transfer','lodash','../../config/logger','moment','bluebird','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','VoiceTransferReport'];(function(_0x1a595a,_0x263824){var _0x33f008=function(_0x1e2f9c){while(--_0x1e2f9c){_0x1a595a['push'](_0x1a595a['shift']());}};_0x33f008(++_0x263824);}(_0xb638,0x14b));var _0x8b63=function(_0x18088a,_0x1b5ec8){_0x18088a=_0x18088a-0x0;var _0x226c46=_0xb638[_0x18088a];return _0x226c46;};'use strict';var _=require(_0x8b63('0x0'));var util=require('util');var logger=require(_0x8b63('0x1'))('api');var moment=require(_0x8b63('0x2'));var BPromise=require(_0x8b63('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8b63('0x4'));var config=require(_0x8b63('0x5'));var attributes=require(_0x8b63('0x6'));module[_0x8b63('0x7')]=function(_0xeb7b20,_0x341838){return _0xeb7b20['define'](_0x8b63('0x8'),attributes,{'tableName':_0x8b63('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 e4bffda..600cfc8 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 _0x99d1=['raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options'];(function(_0x135e12,_0x158374){var _0x3a8f8d=function(_0x8ae770){while(--_0x8ae770){_0x135e12['push'](_0x135e12['shift']());}};_0x3a8f8d(++_0x158374);}(_0x99d1,0xe9));var _0x199d=function(_0x26f3fe,_0x69770d){_0x26f3fe=_0x26f3fe-0x0;var _0x221899=_0x99d1[_0x26f3fe];return _0x221899;};'use strict';var _=require('lodash');var util=require(_0x199d('0x0'));var moment=require('moment');var BPromise=require(_0x199d('0x1'));var rs=require(_0x199d('0x2'));var fs=require('fs');var Redis=require(_0x199d('0x3'));var db=require(_0x199d('0x4'))['db'];var utils=require(_0x199d('0x5'));var logger=require(_0x199d('0x6'))('rpc');var config=require(_0x199d('0x7'));var jayson=require(_0x199d('0x8'));var client=jayson[_0x199d('0x9')][_0x199d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b751b,_0x5aaa13,_0x4cf41a){return new BPromise(function(_0x2e8322,_0x1a9875){return client[_0x199d('0xb')](_0x5b751b,_0x4cf41a)[_0x199d('0xc')](function(_0x7ab43e){logger[_0x199d('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x5aaa13,'request\x20sent');logger[_0x199d('0xe')](_0x199d('0xf'),_0x5aaa13,_0x199d('0x10'),JSON[_0x199d('0x11')](_0x7ab43e));if(_0x7ab43e[_0x199d('0x12')]){if(_0x7ab43e[_0x199d('0x12')]['code']===0x1f4){logger['error'](_0x199d('0x13'),_0x5aaa13,_0x7ab43e[_0x199d('0x12')][_0x199d('0x14')]);return _0x1a9875(_0x7ab43e['error'][_0x199d('0x14')]);}logger['error'](_0x199d('0x13'),_0x5aaa13,_0x7ab43e[_0x199d('0x12')][_0x199d('0x14')]);return _0x2e8322(_0x7ab43e['error']['message']);}else{logger['info'](_0x199d('0x13'),_0x5aaa13,_0x199d('0x10'));_0x2e8322(_0x7ab43e[_0x199d('0x15')][_0x199d('0x14')]);}})[_0x199d('0x16')](function(_0x1ffe4f){logger[_0x199d('0x12')](_0x199d('0x13'),_0x5aaa13,_0x1ffe4f);_0x1a9875(_0x1ffe4f);});});}exports[_0x199d('0x17')]=function(_0x3681f6){var _0x124821=this;return new Promise(function(_0x4a2e24,_0x16bd13){return db[_0x199d('0x18')][_0x199d('0x19')](_0x3681f6[_0x199d('0x1a')],{'raw':_0x3681f6['options']?_0x3681f6[_0x199d('0x1b')][_0x199d('0x1c')]===undefined?!![]:![]:!![]})[_0x199d('0xc')](function(_0x2d7c32){logger[_0x199d('0xd')](_0x199d('0x17'),_0x3681f6);logger[_0x199d('0xe')](_0x199d('0x17'),_0x3681f6,JSON[_0x199d('0x11')](_0x2d7c32));_0x4a2e24(_0x2d7c32);})[_0x199d('0x16')](function(_0x3537cb){logger[_0x199d('0x12')](_0x199d('0x17'),_0x3537cb[_0x199d('0x14')],_0x3681f6);_0x16bd13(_0x124821['error'](0x1f4,_0x3537cb['message']));});});}; \ No newline at end of file +var _0x77b7=['../../config/logger','rpc','../../config/environment','request','info','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceTransferReport,\x20%s,\x20%s','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x37b31c,_0x19ffd5){var _0x18cccc=function(_0x29f594){while(--_0x29f594){_0x37b31c['push'](_0x37b31c['shift']());}};_0x18cccc(++_0x19ffd5);}(_0x77b7,0x1a9));var _0x777b=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x77b7[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x777b('0x0'));var util=require(_0x777b('0x1'));var moment=require(_0x777b('0x2'));var BPromise=require('bluebird');var rs=require(_0x777b('0x3'));var fs=require('fs');var Redis=require(_0x777b('0x4'));var db=require(_0x777b('0x5'))['db'];var utils=require(_0x777b('0x6'));var logger=require(_0x777b('0x7'))(_0x777b('0x8'));var config=require(_0x777b('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xb4928e,_0x152b7a,_0x1e6bd2){return new BPromise(function(_0x18697f,_0x174ed2){return client[_0x777b('0xa')](_0xb4928e,_0x1e6bd2)['then'](function(_0x29fcda){logger[_0x777b('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x152b7a,_0x777b('0xc'));logger['debug'](_0x777b('0xd'),_0x152b7a,_0x777b('0xc'),JSON[_0x777b('0xe')](_0x29fcda));if(_0x29fcda[_0x777b('0xf')]){if(_0x29fcda[_0x777b('0xf')][_0x777b('0x10')]===0x1f4){logger[_0x777b('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x152b7a,_0x29fcda[_0x777b('0xf')]['message']);return _0x174ed2(_0x29fcda[_0x777b('0xf')][_0x777b('0x11')]);}logger[_0x777b('0xf')](_0x777b('0x12'),_0x152b7a,_0x29fcda[_0x777b('0xf')][_0x777b('0x11')]);return _0x18697f(_0x29fcda[_0x777b('0xf')][_0x777b('0x11')]);}else{logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x152b7a,_0x777b('0xc'));_0x18697f(_0x29fcda[_0x777b('0x13')][_0x777b('0x11')]);}})[_0x777b('0x14')](function(_0x19bee9){logger[_0x777b('0xf')](_0x777b('0x12'),_0x152b7a,_0x19bee9);_0x174ed2(_0x19bee9);});});}exports[_0x777b('0x15')]=function(_0x3a8501){var _0x48b10c=this;return new Promise(function(_0x13ce8a,_0x10ca94){return db[_0x777b('0x16')][_0x777b('0x17')](_0x3a8501[_0x777b('0x18')],{'raw':_0x3a8501['options']?_0x3a8501[_0x777b('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3061f5){logger[_0x777b('0xb')]('CreateVoiceTransferReport',_0x3a8501);logger[_0x777b('0x1a')]('CreateVoiceTransferReport',_0x3a8501,JSON[_0x777b('0xe')](_0x3061f5));_0x13ce8a(_0x3061f5);})[_0x777b('0x14')](function(_0x261e99){logger[_0x777b('0xf')](_0x777b('0x15'),_0x261e99[_0x777b('0x11')],_0x3a8501);_0x10ca94(_0x48b10c[_0x777b('0xf')](0x1f4,_0x261e99[_0x777b('0x11')]));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index 7bd4b57..a3b5d97 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00dc=['./rpc','./config/environment','app','./config/pm2','./config/schedule','sequelize','then','listen','info','start','Online\x20apps:','map','online','name','join','Offline\x20apps:','filter','status','None','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb'];(function(_0x49bf79,_0x398131){var _0x147b4e=function(_0x4b199b){while(--_0x4b199b){_0x49bf79['push'](_0x49bf79['shift']());}};_0x147b4e(++_0x398131);}(_0x00dc,0x13d));var _0xc00d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x00dc[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xc00d('0x0'));var mysqldb=require(_0xc00d('0x1'));var rpc=require(_0xc00d('0x2'));var config=require(_0xc00d('0x3'));var logger=require('./config/logger')(_0xc00d('0x4'));var pm2=require(_0xc00d('0x5'));var pm2Config=require('./config/pm2/config');var schedule=require(_0xc00d('0x6'));var chat=require('./config/schedule/chat');function main(){return mysqldb['db'][_0xc00d('0x7')]['sync']()[_0xc00d('0x8')](function(){return rpc[_0xc00d('0x9')]();})[_0xc00d('0x8')](function(_0x8a29ed){logger[_0xc00d('0xa')](_0x8a29ed);return chat[_0xc00d('0xb')]();})[_0xc00d('0x8')](function(){return schedule['start']();})[_0xc00d('0x8')](function(_0x4575e7){logger[_0xc00d('0xa')](_0x4575e7);return pm2[_0xc00d('0xb')](pm2Config);})[_0xc00d('0x8')](function(_0x34dd6e){logger[_0xc00d('0xa')](_0xc00d('0xc'),_[_0xc00d('0xd')](_['filter'](_0x34dd6e,{'status':_0xc00d('0xe')}),_0xc00d('0xf'))[_0xc00d('0x10')]());logger[_0xc00d('0xa')](_0xc00d('0x11'),_[_0xc00d('0xd')](_[_0xc00d('0x12')](_0x34dd6e,function(_0x3d601b){return _0x3d601b[_0xc00d('0x13')]!=='online';}),_0xc00d('0xf'))[_0xc00d('0x10')]()||_0xc00d('0x14'));config[_0xc00d('0x15')]&&require(_0xc00d('0x16'))[_0xc00d('0x17')]();require(_0xc00d('0x18'))[_0xc00d('0x17')]();})[_0xc00d('0x19')](function(_0x12b7a4){logger[_0xc00d('0x1a')](_0xc00d('0x1b'),_0x12b7a4);process[_0xc00d('0x1c')](0x1);});}main(); \ No newline at end of file +var _0xa090=['sync','then','listen','info','start','Online\x20apps:','filter','online','join','status','name','None','seedDB','./config/seedDB','default','./config/license','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat'];(function(_0x5774af,_0x411c94){var _0x480589=function(_0x414114){while(--_0x414114){_0x5774af['push'](_0x5774af['shift']());}};_0x480589(++_0x411c94);}(_0xa090,0x121));var _0x0a09=function(_0x4dab14,_0x164ea0){_0x4dab14=_0x4dab14-0x0;var _0xf41aa=_0xa090[_0x4dab14];return _0xf41aa;};'use strict';var _=require(_0x0a09('0x0'));var mysqldb=require('./mysqldb');var rpc=require('./rpc');var config=require(_0x0a09('0x1'));var logger=require(_0x0a09('0x2'))(_0x0a09('0x3'));var pm2=require(_0x0a09('0x4'));var pm2Config=require(_0x0a09('0x5'));var schedule=require(_0x0a09('0x6'));var chat=require(_0x0a09('0x7'));function main(){return mysqldb['db']['sequelize'][_0x0a09('0x8')]()[_0x0a09('0x9')](function(){return rpc[_0x0a09('0xa')]();})[_0x0a09('0x9')](function(_0x272f51){logger[_0x0a09('0xb')](_0x272f51);return chat[_0x0a09('0xc')]();})[_0x0a09('0x9')](function(){return schedule[_0x0a09('0xc')]();})['then'](function(_0x32e4e7){logger[_0x0a09('0xb')](_0x32e4e7);return pm2['start'](pm2Config);})[_0x0a09('0x9')](function(_0x22f724){logger[_0x0a09('0xb')](_0x0a09('0xd'),_['map'](_[_0x0a09('0xe')](_0x22f724,{'status':_0x0a09('0xf')}),'name')[_0x0a09('0x10')]());logger[_0x0a09('0xb')]('Offline\x20apps:',_['map'](_[_0x0a09('0xe')](_0x22f724,function(_0x4ac812){return _0x4ac812[_0x0a09('0x11')]!==_0x0a09('0xf');}),_0x0a09('0x12'))['join']()||_0x0a09('0x13'));config[_0x0a09('0x14')]&&require(_0x0a09('0x15'))[_0x0a09('0x16')]();require(_0x0a09('0x17'))[_0x0a09('0x16')]();})[_0x0a09('0x18')](function(_0x21769b){logger['error'](_0x0a09('0x19'),_0x21769b);process[_0x0a09('0x1a')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index edac308..e2ae6dc 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 _0x58c3=['json','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','verify','secrets','getUuid','sub','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','User\x20not\x20found.','User\x20object\x20not\x20found.','../../config/license/util','getLicense','update','Forbidden','canUpdate','hasRole','Required\x20role\x20needs\x20to\x20be\x20set','indexOf','userRoles','isMiddleware','setTokenCookie','cookie','motion.user','pick','redirect','retrieveApiKey','apiKeyNonce','isNil','apiKeyIat','generateApiKey','toString','hex','floor','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','sign','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','basic-auth','crypto','ipaddr.js','session','name','internal','email','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','phoneBarRemoteControlPort','phoneBarRemoteControl','interface','userProfileId','isChatInteractionAuthorized','use','user','params','closed','disposition','status','unmanaged','catch','headers','authorization','startsWith','User','find','then','authenticate','pass'];(function(_0x25f455,_0x141717){var _0x354bb6=function(_0x5ef9a6){while(--_0x5ef9a6){_0x25f455['push'](_0x25f455['shift']());}};_0x354bb6(++_0x141717);}(_0x58c3,0x1d3));var _0x358c=function(_0x334599,_0x4b1cfa){_0x334599=_0x334599-0x0;var _0x4cdff2=_0x58c3[_0x334599];return _0x4cdff2;};'use strict';var db=require(_0x358c('0x0'))['db'];var config=require(_0x358c('0x1'));var hardwareConf=require(_0x358c('0x2'));var _=require(_0x358c('0x3'));var jwt=require(_0x358c('0x4'));var expressJwt=require('express-jwt');var compose=require('composable-middleware');var basicAuth=require(_0x358c('0x5'));var crypto=require(_0x358c('0x6'));var ipaddr=require(_0x358c('0x7'));var validateJwt=expressJwt({'secret':config['secrets'][_0x358c('0x8')]});var userAttributes=['id','role','fullname',_0x358c('0x9'),_0x358c('0xa'),_0x358c('0xb'),_0x358c('0xc'),_0x358c('0xd'),_0x358c('0xe'),_0x358c('0xf'),_0x358c('0x10'),_0x358c('0x11'),_0x358c('0x12'),_0x358c('0x13'),_0x358c('0x14'),_0x358c('0x15'),_0x358c('0x16'),_0x358c('0x17'),_0x358c('0x18'),_0x358c('0x19')];exports[_0x358c('0x1a')]=function(){return isAuthenticated(!![])[_0x358c('0x1b')](function(_0x1260b3,_0x9643bd,_0x2a7e98){if(_0x1260b3[_0x358c('0x1c')]){_0x2a7e98();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x1260b3[_0x358c('0x1d')]['id']},'attributes':['id',_0x358c('0x1e'),_0x358c('0x1f')],'raw':!![]})['then'](function(_0x5afe9f){if(_0x5afe9f&&_0x5afe9f[_0x358c('0x1e')]){return _0x9643bd[_0x358c('0x20')](_0x5afe9f['disposition']===_0x358c('0x21')?0x195:0x193)['json']({'message':_0x5afe9f[_0x358c('0x1f')]===_0x358c('0x21')?'Unmanaged.':'Forbidden.'});}else{_0x2a7e98();}})[_0x358c('0x22')](function(_0x1e09f3){_0x2a7e98(_0x1e09f3);});}});};function isAuthenticated(_0x36e30b){return compose()[_0x358c('0x1b')](function(_0x5b1e98,_0x329001,_0x5deb60){if(_0x5b1e98[_0x358c('0x23')][_0x358c('0x24')]){if(_[_0x358c('0x25')](_0x5b1e98[_0x358c('0x23')][_0x358c('0x24')],'Basic')){var _0x353b9f=basicAuth(_0x5b1e98);db[_0x358c('0x26')][_0x358c('0x27')]({'where':{'name':_0x353b9f['name']}})[_0x358c('0x28')](function(_0x1de177){if(!_0x1de177||!_0x1de177[_0x358c('0x29')](_0x353b9f[_0x358c('0x2a')])){return _0x329001[_0x358c('0x20')](0x191)[_0x358c('0x2b')]({'message':_0x358c('0x2c')});}_0x5b1e98[_0x358c('0x1c')]={'id':_0x1de177['id']};_0x5deb60();})['catch'](function(_0x1b2c97){_0x5deb60(_0x1b2c97);});}else if(_[_0x358c('0x25')](_0x5b1e98[_0x358c('0x23')][_0x358c('0x24')],_0x358c('0x2d'))){validateJwt(_0x5b1e98,_0x329001,_0x5deb60);}else{if(_0x36e30b){_0x5deb60();}else{return _0x329001[_0x358c('0x20')](0x193)[_0x358c('0x2b')]({'message':_0x358c('0x2e')});}}}else if(_0x5b1e98[_0x358c('0x2f')][_0x358c('0x30')]){try{var _0x36d9a3=jwt[_0x358c('0x31')](_0x5b1e98[_0x358c('0x2f')][_0x358c('0x30')],config[_0x358c('0x32')][_0x358c('0x8')],{'audience':hardwareConf[_0x358c('0x33')](),'issuer':hardwareConf['getUuid']()});db[_0x358c('0x26')]['find']({'where':{'id':_0x36d9a3[_0x358c('0x34')]}})[_0x358c('0x28')](function(_0xd83743){if(!_0xd83743||!_[_0x358c('0x35')](_0xd83743['apiKeyNonce'],_0x36d9a3[_0x358c('0x36')])){return _0x329001[_0x358c('0x20')](0x193)[_0x358c('0x2b')]({'message':_0x358c('0x37')});}_0x5b1e98['user']={'id':_0xd83743['id']};_0x5deb60();})['catch'](function(_0x9c3d32){_0x5deb60(_0x9c3d32);});}catch(_0x58d613){console['log'](_0x58d613);return _0x329001[_0x358c('0x20')](0x193)[_0x358c('0x2b')]({'message':'Unrecognized\x20API\x20access\x20key'});}}else if(_0x36e30b){_0x5deb60();}else{return _0x329001[_0x358c('0x20')](0x193)[_0x358c('0x2b')]({'message':_0x358c('0x2e')});}})[_0x358c('0x1b')](function(_0x386300,_0x5b8793,_0x1751bc){if(_0x386300[_0x358c('0x1c')]){db[_0x358c('0x26')][_0x358c('0x27')]({'where':{'id':_0x386300[_0x358c('0x1c')]['id']},'attributes':userAttributes})['then'](function(_0x4429b3){if(!_0x4429b3){return _0x5b8793[_0x358c('0x20')](0x194)[_0x358c('0x2b')]({'message':_0x358c('0x38')});}_0x386300[_0x358c('0x1c')]=_0x4429b3;_0x1751bc();})['catch'](function(_0x1d1b33){_0x1751bc(_0x1d1b33);});}else if(_0x36e30b){_0x1751bc();}else{return _0x5b8793[_0x358c('0x20')](0x194)[_0x358c('0x2b')]({'message':_0x358c('0x39')});}});}exports['isAuthenticated']=isAuthenticated;function canUpdate(){return compose()[_0x358c('0x1b')](function(_0xfb9eb6,_0x155a7d,_0x41d8b0){return require(_0x358c('0x3a'))[_0x358c('0x3b')]()[_0x358c('0x28')](function(_0x197f3a){if(_0x197f3a[_0x358c('0x3c')]){_0x41d8b0();}else{return _0x155a7d[_0x358c('0x20')](0x193)[_0x358c('0x2b')]({'message':_0x358c('0x3d')});}})[_0x358c('0x22')](function(_0x4a3b1a){_0x41d8b0(_0x4a3b1a);});});}exports[_0x358c('0x3e')]=canUpdate;function signToken(_0x1629f1,_0x469e10){return jwt['sign']({'id':_0x1629f1,'role':_0x469e10},config['secrets'][_0x358c('0x8')],{'expiresIn':0x15180});}exports['signToken']=signToken;exports[_0x358c('0x3f')]=function(_0x45bbe2){if(!_0x45bbe2){throw new Error(_0x358c('0x40'));}return compose()[_0x358c('0x1b')](isAuthenticated())[_0x358c('0x1b')](function meetsRequirements(_0x498d5e,_0x3caade,_0x5cbb04){if(config['userRoles'][_0x358c('0x41')](_0x498d5e[_0x358c('0x1c')]['role'])>=config[_0x358c('0x42')][_0x358c('0x41')](_0x45bbe2)){return _0x5cbb04();}else{return _0x3caade[_0x358c('0x20')](0x193)['json']({'message':'Forbidden'});}});};exports[_0x358c('0x43')]=function(_0x28cdd7,_0x346235,_0x20fc63){_0x28cdd7[_0x358c('0x43')]=!![];return _0x20fc63();};exports[_0x358c('0x44')]=function(_0x137407,_0x1b6d82){if(!_0x137407[_0x358c('0x1c')]){return _0x1b6d82[_0x358c('0x20')](0x194)[_0x358c('0x2b')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x17cdf0=signToken(_0x137407[_0x358c('0x1c')]['id'],_0x137407[_0x358c('0x1c')]['role']);_0x1b6d82['cookie']('motion.token',_0x17cdf0);_0x1b6d82[_0x358c('0x45')](_0x358c('0x46'),JSON['stringify'](_[_0x358c('0x47')](_0x137407[_0x358c('0x1c')],userAttributes)));_0x1b6d82[_0x358c('0x48')]('/dashboards/general');};exports[_0x358c('0x49')]=function(_0x39ed40){if(_['isNil'](_0x39ed40[_0x358c('0x4a')])||_[_0x358c('0x4b')](_0x39ed40[_0x358c('0x4c')]))return null;else return createJwt(_0x39ed40);};exports[_0x358c('0x4d')]=function(_0x112d72){_0x112d72['apiKeyNonce']=crypto['randomBytes'](0x10)[_0x358c('0x4e')](_0x358c('0x4f'));_0x112d72[_0x358c('0x4c')]=Math[_0x358c('0x50')](Date['now']()/0x3e8)[_0x358c('0x4e')]();return createJwt(_0x112d72);};exports[_0x358c('0x51')]=function(_0x5e7d82,_0xc995e){if(_0x5e7d82['query'][_0x358c('0x30')]){jwt['verify'](_0x5e7d82['query'][_0x358c('0x30')],config[_0x358c('0x32')][_0x358c('0x8')],{'nonce':_0xc995e[_0x358c('0x4a')],'iat':_0xc995e[_0x358c('0x4c')],'audience':hardwareConf[_0x358c('0x33')](),'issuer':hardwareConf[_0x358c('0x33')]()});return generateApiKey(_0xc995e);}else{throw{'message':_0x358c('0x52')};}};function createJwt(_0x38f851){return jwt[_0x358c('0x53')]({'iat':_0x38f851[_0x358c('0x4c')],'nonce':_0x38f851['apiKeyNonce']},config[_0x358c('0x32')][_0x358c('0x8')],{'algorithm':_0x358c('0x54'),'subject':_0x38f851['id'][_0x358c('0x4e')](),'issuer':hardwareConf[_0x358c('0x33')](),'audience':hardwareConf['getUuid']()});} \ No newline at end of file +var _0x8a93=['randomBytes','toString','hex','now','apiKeyNonce','getUuid','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','../../config/environment','../../config/license/hardware','lodash','composable-middleware','basic-auth','crypto','secrets','session','role','fullname','name','internal','userpic','permissions','voicePause','mailPause','faxPause','smsPause','phoneBarRemoteControlPort','phoneBarRemoteControl','interface','userProfileId','isChatInteractionAuthorized','ChatInteraction','findOne','params','then','closed','status','disposition','unmanaged','json','Unmanaged.','Forbidden.','catch','headers','startsWith','find','authenticate','Wrong\x20credentials.','user','authorization','Bearer','Unknown\x20authorization\x20format','query','apikey','verify','User','sub','isEqual','nonce','log','Unrecognized\x20API\x20access\x20key','use','User\x20not\x20found.','User\x20object\x20not\x20found.','isAuthenticated','../../config/license/util','update','canUpdate','sign','hasRole','userRoles','indexOf','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.user','pick','redirect','/dashboards/general','isNil','apiKeyIat','generateApiKey'];(function(_0x51e123,_0x36c704){var _0x4b0b09=function(_0x566025){while(--_0x566025){_0x51e123['push'](_0x51e123['shift']());}};_0x4b0b09(++_0x36c704);}(_0x8a93,0xab));var _0x38a9=function(_0x4e13b0,_0x1ca561){_0x4e13b0=_0x4e13b0-0x0;var _0x5c2a63=_0x8a93[_0x4e13b0];return _0x5c2a63;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x38a9('0x0'));var hardwareConf=require(_0x38a9('0x1'));var _=require(_0x38a9('0x2'));var jwt=require('jsonwebtoken');var expressJwt=require('express-jwt');var compose=require(_0x38a9('0x3'));var basicAuth=require(_0x38a9('0x4'));var crypto=require(_0x38a9('0x5'));var ipaddr=require('ipaddr.js');var validateJwt=expressJwt({'secret':config[_0x38a9('0x6')][_0x38a9('0x7')]});var userAttributes=['id',_0x38a9('0x8'),_0x38a9('0x9'),_0x38a9('0xa'),_0x38a9('0xb'),'email',_0x38a9('0xc'),_0x38a9('0xd'),_0x38a9('0xe'),'chatPause',_0x38a9('0xf'),_0x38a9('0x10'),_0x38a9('0x11'),'openchannelPause','pauseType','showWebBar',_0x38a9('0x12'),_0x38a9('0x13'),_0x38a9('0x14'),_0x38a9('0x15')];exports[_0x38a9('0x16')]=function(){return isAuthenticated(!![])['use'](function(_0x147b44,_0x5f9b2,_0x234507){if(_0x147b44['user']){_0x234507();}else{return db[_0x38a9('0x17')][_0x38a9('0x18')]({'where':{'id':_0x147b44[_0x38a9('0x19')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})[_0x38a9('0x1a')](function(_0x25ddcc){if(_0x25ddcc&&_0x25ddcc[_0x38a9('0x1b')]){return _0x5f9b2[_0x38a9('0x1c')](_0x25ddcc[_0x38a9('0x1d')]===_0x38a9('0x1e')?0x195:0x193)[_0x38a9('0x1f')]({'message':_0x25ddcc[_0x38a9('0x1d')]===_0x38a9('0x1e')?_0x38a9('0x20'):_0x38a9('0x21')});}else{_0x234507();}})[_0x38a9('0x22')](function(_0x42ffe5){_0x234507(_0x42ffe5);});}});};function isAuthenticated(_0x50d002){return compose()['use'](function(_0x4a1bb7,_0x15e3bf,_0x560e3f){if(_0x4a1bb7[_0x38a9('0x23')]['authorization']){if(_[_0x38a9('0x24')](_0x4a1bb7[_0x38a9('0x23')]['authorization'],'Basic')){var _0x294baf=basicAuth(_0x4a1bb7);db['User'][_0x38a9('0x25')]({'where':{'name':_0x294baf['name']}})[_0x38a9('0x1a')](function(_0x20cd3b){if(!_0x20cd3b||!_0x20cd3b[_0x38a9('0x26')](_0x294baf['pass'])){return _0x15e3bf[_0x38a9('0x1c')](0x191)[_0x38a9('0x1f')]({'message':_0x38a9('0x27')});}_0x4a1bb7[_0x38a9('0x28')]={'id':_0x20cd3b['id']};_0x560e3f();})[_0x38a9('0x22')](function(_0x1f00b2){_0x560e3f(_0x1f00b2);});}else if(_[_0x38a9('0x24')](_0x4a1bb7['headers'][_0x38a9('0x29')],_0x38a9('0x2a'))){validateJwt(_0x4a1bb7,_0x15e3bf,_0x560e3f);}else{if(_0x50d002){_0x560e3f();}else{return _0x15e3bf['status'](0x193)[_0x38a9('0x1f')]({'message':_0x38a9('0x2b')});}}}else if(_0x4a1bb7[_0x38a9('0x2c')][_0x38a9('0x2d')]){try{var _0x5f0b00=jwt[_0x38a9('0x2e')](_0x4a1bb7[_0x38a9('0x2c')][_0x38a9('0x2d')],config['secrets'][_0x38a9('0x7')],{'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()});db[_0x38a9('0x2f')][_0x38a9('0x25')]({'where':{'id':_0x5f0b00[_0x38a9('0x30')]}})[_0x38a9('0x1a')](function(_0x3e4a28){if(!_0x3e4a28||!_[_0x38a9('0x31')](_0x3e4a28['apiKeyNonce'],_0x5f0b00[_0x38a9('0x32')])){return _0x15e3bf['status'](0x193)[_0x38a9('0x1f')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}_0x4a1bb7[_0x38a9('0x28')]={'id':_0x3e4a28['id']};_0x560e3f();})[_0x38a9('0x22')](function(_0x2ba80a){_0x560e3f(_0x2ba80a);});}catch(_0x892faf){console[_0x38a9('0x33')](_0x892faf);return _0x15e3bf[_0x38a9('0x1c')](0x193)[_0x38a9('0x1f')]({'message':_0x38a9('0x34')});}}else if(_0x50d002){_0x560e3f();}else{return _0x15e3bf[_0x38a9('0x1c')](0x193)[_0x38a9('0x1f')]({'message':_0x38a9('0x2b')});}})[_0x38a9('0x35')](function(_0x2cb155,_0x21f503,_0x4cd7bf){if(_0x2cb155[_0x38a9('0x28')]){db['User'][_0x38a9('0x25')]({'where':{'id':_0x2cb155[_0x38a9('0x28')]['id']},'attributes':userAttributes})['then'](function(_0x1db197){if(!_0x1db197){return _0x21f503['status'](0x194)[_0x38a9('0x1f')]({'message':_0x38a9('0x36')});}_0x2cb155['user']=_0x1db197;_0x4cd7bf();})[_0x38a9('0x22')](function(_0x4a090d){_0x4cd7bf(_0x4a090d);});}else if(_0x50d002){_0x4cd7bf();}else{return _0x21f503[_0x38a9('0x1c')](0x194)[_0x38a9('0x1f')]({'message':_0x38a9('0x37')});}});}exports[_0x38a9('0x38')]=isAuthenticated;function canUpdate(){return compose()['use'](function(_0x1ccb6d,_0x459c39,_0x19ee40){return require(_0x38a9('0x39'))['getLicense']()[_0x38a9('0x1a')](function(_0x1b9f87){if(_0x1b9f87[_0x38a9('0x3a')]){_0x19ee40();}else{return _0x459c39[_0x38a9('0x1c')](0x193)[_0x38a9('0x1f')]({'message':'Forbidden'});}})[_0x38a9('0x22')](function(_0x461e35){_0x19ee40(_0x461e35);});});}exports[_0x38a9('0x3b')]=canUpdate;function signToken(_0x1b8b60,_0x1b29ab){return jwt[_0x38a9('0x3c')]({'id':_0x1b8b60,'role':_0x1b29ab},config[_0x38a9('0x6')]['session'],{'expiresIn':0x15180});}exports['signToken']=signToken;exports[_0x38a9('0x3d')]=function(_0x26436a){if(!_0x26436a){throw new Error('Required\x20role\x20needs\x20to\x20be\x20set');}return compose()[_0x38a9('0x35')](isAuthenticated())['use'](function meetsRequirements(_0x1468e8,_0x49c4d6,_0x2ebe0a){if(config[_0x38a9('0x3e')][_0x38a9('0x3f')](_0x1468e8[_0x38a9('0x28')][_0x38a9('0x8')])>=config[_0x38a9('0x3e')][_0x38a9('0x3f')](_0x26436a)){return _0x2ebe0a();}else{return _0x49c4d6['status'](0x193)[_0x38a9('0x1f')]({'message':'Forbidden'});}});};exports[_0x38a9('0x40')]=function(_0x478ed3,_0x314370,_0x2c073b){_0x478ed3[_0x38a9('0x40')]=!![];return _0x2c073b();};exports[_0x38a9('0x41')]=function(_0x1e60b2,_0x472394){if(!_0x1e60b2[_0x38a9('0x28')]){return _0x472394[_0x38a9('0x1c')](0x194)[_0x38a9('0x1f')]({'message':_0x38a9('0x42')});}var _0x5c2b07=signToken(_0x1e60b2[_0x38a9('0x28')]['id'],_0x1e60b2[_0x38a9('0x28')]['role']);_0x472394[_0x38a9('0x43')]('motion.token',_0x5c2b07);_0x472394[_0x38a9('0x43')](_0x38a9('0x44'),JSON['stringify'](_[_0x38a9('0x45')](_0x1e60b2[_0x38a9('0x28')],userAttributes)));_0x472394[_0x38a9('0x46')](_0x38a9('0x47'));};exports['retrieveApiKey']=function(_0x20a3db){if(_['isNil'](_0x20a3db['apiKeyNonce'])||_[_0x38a9('0x48')](_0x20a3db[_0x38a9('0x49')]))return null;else return createJwt(_0x20a3db);};exports[_0x38a9('0x4a')]=function(_0x4b0e2d){_0x4b0e2d['apiKeyNonce']=crypto[_0x38a9('0x4b')](0x10)[_0x38a9('0x4c')](_0x38a9('0x4d'));_0x4b0e2d[_0x38a9('0x49')]=Math['floor'](Date[_0x38a9('0x4e')]()/0x3e8)[_0x38a9('0x4c')]();return createJwt(_0x4b0e2d);};exports['regenerateApiKey']=function(_0x16d026,_0x30c79a){if(_0x16d026['query'][_0x38a9('0x2d')]){jwt['verify'](_0x16d026['query'][_0x38a9('0x2d')],config[_0x38a9('0x6')]['session'],{'nonce':_0x30c79a[_0x38a9('0x4f')],'iat':_0x30c79a[_0x38a9('0x49')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x38a9('0x50')]()});return generateApiKey(_0x30c79a);}else{throw{'message':_0x38a9('0x51')};}};function createJwt(_0x4a5a0c){return jwt[_0x38a9('0x3c')]({'iat':_0x4a5a0c['apiKeyIat'],'nonce':_0x4a5a0c['apiKeyNonce']},config['secrets'][_0x38a9('0x7')],{'algorithm':'HS512','subject':_0x4a5a0c['id'][_0x38a9('0x4c')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 72534c8..9844f00 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 _0x20a8=['update','binary','end','final','unlink','data','write','close','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm'];(function(_0x11cfd4,_0x12b21c){var _0x1f44d0=function(_0x5bc913){while(--_0x5bc913){_0x11cfd4['push'](_0x11cfd4['shift']());}};_0x1f44d0(++_0x12b21c);}(_0x20a8,0x118));var _0x820a=function(_0x247430,_0x5c2826){_0x247430=_0x247430-0x0;var _0xbd29c5=_0x20a8[_0x247430];return _0xbd29c5;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x820a('0x0'));var defaultOptions={'algorithm':_0x820a('0x1')};function combineOptions(_0x3c942a){var _0x350370={};for(var _0x43aba6 in defaultOptions){if(defaultOptions[_0x820a('0x2')](_0x43aba6)){_0x350370[_0x43aba6]=defaultOptions[_0x43aba6];}}if(_0x3c942a){for(var _0x58324e in _0x3c942a){if(_0x3c942a[_0x820a('0x2')](_0x58324e)){_0x350370[_0x58324e]=_0x3c942a[_0x58324e];}}}return _0x350370;}exports[_0x820a('0x3')]=function(_0x3db2eb,_0x59a11b,_0x2fd828,_0x3f1c96){return new BPromise(function(_0x201ec4,_0x35d9ac){_0x3f1c96=combineOptions(_0x3f1c96);var _0x2c4778=new Buffer(_0x2fd828);var _0x1b7e08=fs[_0x820a('0x4')](_0x3db2eb);var _0x550856=fs[_0x820a('0x5')](_0x59a11b);var _0x2ef611=crypto[_0x820a('0x6')](_0x3f1c96[_0x820a('0x7')],_0x2c4778);_0x1b7e08['on']('data',function(_0x5ee5ee){var _0x66217=new Buffer(_0x2ef611[_0x820a('0x8')](_0x5ee5ee),_0x820a('0x9'));_0x550856['write'](_0x66217);});_0x1b7e08['on'](_0x820a('0xa'),function(){try{var _0x477a2a=new Buffer(_0x2ef611[_0x820a('0xb')]('binary'),_0x820a('0x9'));_0x550856['write'](_0x477a2a);_0x550856[_0x820a('0xa')]();_0x550856['on']('close',function(){return _0x201ec4(_0x59a11b);});}catch(_0x259c3b){fs[_0x820a('0xc')](_0x59a11b);return _0x35d9ac(_0x259c3b);}});});};exports['decryptFile']=function(_0x81916,_0x65bc19,_0x5f344b,_0x54d236){return new BPromise(function(_0x4e95ab,_0x3cc726){_0x54d236=combineOptions(_0x54d236);var _0xae939d=new Buffer(_0x5f344b);var _0x18c257=fs['createReadStream'](_0x81916);var _0x391a41=fs['createWriteStream'](_0x65bc19);var _0x1a9847=crypto['createDecipher'](_0x54d236[_0x820a('0x7')],_0xae939d);_0x18c257['on'](_0x820a('0xd'),function(_0xdb6700){var _0x4bb37e=new Buffer(_0x1a9847[_0x820a('0x8')](_0xdb6700),_0x820a('0x9'));_0x391a41[_0x820a('0xe')](_0x4bb37e);});_0x18c257['on'](_0x820a('0xa'),function(){try{var _0x4c10b0=new Buffer(_0x1a9847[_0x820a('0xb')](_0x820a('0x9')),_0x820a('0x9'));_0x391a41[_0x820a('0xe')](_0x4c10b0);_0x391a41['end']();_0x391a41['on'](_0x820a('0xf'),function(){return _0x4e95ab(_0x65bc19);});}catch(_0x5d2d78){fs[_0x820a('0xc')](_0x65bc19);return _0x3cc726(_0x5d2d78);}});});}; \ No newline at end of file +var _0x3076=['close','decryptFile','createDecipher','data','final','unlink','bluebird','hasOwnProperty','createReadStream','createWriteStream','createCipher','algorithm','update','binary','write','end'];(function(_0x152680,_0x10c134){var _0x3aa359=function(_0x2229e2){while(--_0x2229e2){_0x152680['push'](_0x152680['shift']());}};_0x3aa359(++_0x10c134);}(_0x3076,0xb6));var _0x6307=function(_0x5bb0ba,_0x3a1803){_0x5bb0ba=_0x5bb0ba-0x0;var _0x551a4e=_0x3076[_0x5bb0ba];return _0x551a4e;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x6307('0x0'));var defaultOptions={'algorithm':'aes192'};function combineOptions(_0x1821b4){var _0x1ce89c={};for(var _0xf55c7 in defaultOptions){if(defaultOptions[_0x6307('0x1')](_0xf55c7)){_0x1ce89c[_0xf55c7]=defaultOptions[_0xf55c7];}}if(_0x1821b4){for(var _0x4a8253 in _0x1821b4){if(_0x1821b4[_0x6307('0x1')](_0x4a8253)){_0x1ce89c[_0x4a8253]=_0x1821b4[_0x4a8253];}}}return _0x1ce89c;}exports['encryptFile']=function(_0x174fd9,_0x54c64f,_0x526543,_0x506265){return new BPromise(function(_0x54cea9,_0x401b39){_0x506265=combineOptions(_0x506265);var _0x4372aa=new Buffer(_0x526543);var _0x4425cf=fs[_0x6307('0x2')](_0x174fd9);var _0x260213=fs[_0x6307('0x3')](_0x54c64f);var _0x546727=crypto[_0x6307('0x4')](_0x506265[_0x6307('0x5')],_0x4372aa);_0x4425cf['on']('data',function(_0x10d99f){var _0x3895eb=new Buffer(_0x546727[_0x6307('0x6')](_0x10d99f),_0x6307('0x7'));_0x260213[_0x6307('0x8')](_0x3895eb);});_0x4425cf['on']('end',function(){try{var _0x45b3a7=new Buffer(_0x546727['final'](_0x6307('0x7')),'binary');_0x260213[_0x6307('0x8')](_0x45b3a7);_0x260213[_0x6307('0x9')]();_0x260213['on'](_0x6307('0xa'),function(){return _0x54cea9(_0x54c64f);});}catch(_0x24d2a4){fs['unlink'](_0x54c64f);return _0x401b39(_0x24d2a4);}});});};exports[_0x6307('0xb')]=function(_0x572bcd,_0x357c37,_0x59ca63,_0xa7aa20){return new BPromise(function(_0x2af7f3,_0x5c67ab){_0xa7aa20=combineOptions(_0xa7aa20);var _0x113342=new Buffer(_0x59ca63);var _0x3af0de=fs[_0x6307('0x2')](_0x572bcd);var _0xd0acbf=fs[_0x6307('0x3')](_0x357c37);var _0x5d5c85=crypto[_0x6307('0xc')](_0xa7aa20[_0x6307('0x5')],_0x113342);_0x3af0de['on'](_0x6307('0xd'),function(_0x20f69e){var _0x4800f2=new Buffer(_0x5d5c85[_0x6307('0x6')](_0x20f69e),'binary');_0xd0acbf[_0x6307('0x8')](_0x4800f2);});_0x3af0de['on'](_0x6307('0x9'),function(){try{var _0x41457c=new Buffer(_0x5d5c85[_0x6307('0xe')]('binary'),_0x6307('0x7'));_0xd0acbf[_0x6307('0x8')](_0x41457c);_0xd0acbf[_0x6307('0x9')]();_0xd0acbf['on']('close',function(){return _0x2af7f3(_0x357c37);});}catch(_0x49fc04){fs[_0x6307('0xf')](_0x357c37);return _0x5c67ab(_0x49fc04);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index da79a02..463762d 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 _0xd93c=['split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','length','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','util','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find'];(function(_0x1d502d,_0x153ed9){var _0x24837d=function(_0x82bfa8){while(--_0x82bfa8){_0x1d502d['push'](_0x1d502d['shift']());}};_0x24837d(++_0x153ed9);}(_0xd93c,0x1ca));var _0xcd93=function(_0x3d1cb4,_0x536d66){_0x3d1cb4=_0x3d1cb4-0x0;var _0xad5a4a=_0xd93c[_0x3d1cb4];return _0xad5a4a;};'use strict';var util=require(_0xcd93('0x0'));var path=require('path');var _=require('lodash');var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xcd93('0x1'));var zipdir=require(_0xcd93('0x2'));var rimraf=require(_0xcd93('0x3'));var db=require(_0xcd93('0x4'))['db'];var dbH=require(_0xcd93('0x4'))['dbH'];var logger=require(_0xcd93('0x5'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xcd93('0x6')][0x3];var PATH=process[_0xcd93('0x6')][0x4];function analyticExtractedReport(_0x559564,_0x5d79f5){var _0x245a08={'status':_0x559564};var _0x3642cf={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5d79f5){_0x245a08[_0xcd93('0x7')]=_0x5d79f5;}return db[_0xcd93('0x8')][_0xcd93('0x9')](_0x245a08,_0x3642cf);}function main(){var _0x31d878=0x1388;var _0xe3afbf;logger['info'](util[_0xcd93('0xa')](_0xcd93('0xb'),EXTRACTED_REPORT_ID,_0xcd93('0xc')));return db[_0xcd93('0xd')][_0xcd93('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xcd93('0xf'),_0xcd93('0x10')]})[_0xcd93('0x11')](function(_0x275d8e){if(_0x275d8e){_0xe3afbf=_0x275d8e;_0x31d878=_0xe3afbf[_0xcd93('0x10')]||0x1388;}})[_0xcd93('0x11')](function(){return dbH[_0xcd93('0x12')][_0xcd93('0x13')](util[_0xcd93('0xa')](_0xcd93('0x14'),QUERY),{'type':dbH[_0xcd93('0x12')][_0xcd93('0x15')][_0xcd93('0x16')]});})[_0xcd93('0x11')](function(_0x48ecc9){if(!_0x48ecc9[0x0]['num']){return analyticExtractedReport('Empty');}var _0x3d945e=[];var _0x46e7ad=0x0;var _0x1772c2=!![];if(_0x48ecc9&&_0x48ecc9[_0xcd93('0x17')]){var _0x1c010f=_0x48ecc9[0x0][_0xcd93('0x18')]%(_0x46e7ad+_0x31d878);if(_0xe3afbf[_0xcd93('0xf')]){for(;_0x1772c2;_0x46e7ad+=_0x31d878,_0x1c010f=_0x48ecc9[0x0][_0xcd93('0x18')]%(_0x46e7ad+_0x31d878)){if(_0x1c010f==0x0||_0x1c010f==_0x48ecc9[0x0]['num']){_0x1772c2=![];}_0x3d945e[_0xcd93('0x19')](dbH[_0xcd93('0x12')][_0xcd93('0x13')](util[_0xcd93('0xa')](_0xcd93('0x1a'),QUERY,_0x31d878,_0x46e7ad),{'type':dbH[_0xcd93('0x12')][_0xcd93('0x15')][_0xcd93('0x16')]}));}}else{_0x3d945e['push'](dbH[_0xcd93('0x12')][_0xcd93('0x13')](QUERY,{'type':dbH[_0xcd93('0x12')][_0xcd93('0x15')]['SELECT']}));}}var _0x52ce8e=path[_0xcd93('0x1b')](PATH);var _0x455e11=path[_0xcd93('0x1c')](PATH,_0xcd93('0x1d'));var _0x1e8d2f=_0xe3afbf[_0xcd93('0xf')]&&_0x3d945e[_0xcd93('0x17')]>0x1;var _0x32224b=[];if(!fs[_0xcd93('0x1e')](path[_0xcd93('0x1f')](_0x52ce8e,_0x455e11))&&_0x1e8d2f){fs[_0xcd93('0x20')](path[_0xcd93('0x1f')](_0x52ce8e,_0x455e11));}return BPromise[_0xcd93('0x21')](_0x3d945e,function(_0x482a05){_0x32224b[_0xcd93('0x19')](_0x482a05);})[_0xcd93('0x11')](function(){for(var _0x2a1af9=0x0;_0x2a1af9<_0x32224b[_0xcd93('0x17')];_0x2a1af9+=0x1){var _0x14926d;var _0x217356=_0x32224b[_0x2a1af9];if(_0x1e8d2f){_0x14926d=path['join'](_0x52ce8e,_0x455e11,util['format'](_0xcd93('0x22'),_0x455e11,_0x2a1af9,_0xcd93('0x23')));}else{_0x14926d=path[_0xcd93('0x1f')](_0x52ce8e,util[_0xcd93('0xa')](_0xcd93('0x24'),_0x455e11,_0xcd93('0x23')));}fs['writeFileSync'](_0x14926d,csv(_0x217356));}})[_0xcd93('0x11')](function(){if(_0x1e8d2f){zipdir(path[_0xcd93('0x1f')](_0x52ce8e,_0x455e11),{'saveTo':path[_0xcd93('0x1f')](_0x52ce8e,util[_0xcd93('0xa')](_0xcd93('0x24'),_0x455e11,_0xcd93('0x25')))},function(_0x410400,_0x3cd64d){});rimraf(path[_0xcd93('0x1f')](_0x52ce8e,_0x455e11),function(){});}})[_0xcd93('0x11')](function(){logger[_0xcd93('0x26')](util[_0xcd93('0xa')](_0xcd93('0x27'),EXTRACTED_REPORT_ID,_0xcd93('0xc')));return analyticExtractedReport(_0xcd93('0x28'),_0x1e8d2f?util[_0xcd93('0xa')](_0xcd93('0x24'),_0x455e11,_0x1e8d2f?_0xcd93('0x25'):_0xcd93('0x23')):null);});})[_0xcd93('0x29')](function(_0x3635b5){logger['info'](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xcd93('0xc')),util[_0xcd93('0x2a')](_0x3635b5,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0x54a5=['SELECT','QueryTypes','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','path','lodash','zip-dir','rimraf','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','then','splitSizeCsv','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','Empty','length','num','push'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x54a5,0xfa));var _0x554a=function(_0x16a5da,_0xf13e00){_0x16a5da=_0x16a5da-0x0;var _0x46bc4d=_0x54a5[_0x16a5da];return _0x46bc4d;};'use strict';var util=require('util');var path=require(_0x554a('0x0'));var _=require(_0x554a('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x554a('0x2'));var rimraf=require(_0x554a('0x3'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x554a('0x4')];var logger=require(_0x554a('0x5'))(_0x554a('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x554a('0x7')][0x2]);var QUERY=process[_0x554a('0x7')][0x3];var PATH=process[_0x554a('0x7')][0x4];function analyticExtractedReport(_0x461a2c,_0x36da71){var _0x292f84={'status':_0x461a2c};var _0x2b86b8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x36da71){_0x292f84[_0x554a('0x8')]=_0x36da71;}return db[_0x554a('0x9')][_0x554a('0xa')](_0x292f84,_0x2b86b8);}function main(){var _0x3a8ca5=0x1388;var _0x40fbce;logger[_0x554a('0xb')](util[_0x554a('0xc')](_0x554a('0xd'),EXTRACTED_REPORT_ID,_0x554a('0xe')));return db['Setting'][_0x554a('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x554a('0x10'),'splitSizeCsv']})[_0x554a('0x11')](function(_0x16c737){if(_0x16c737){_0x40fbce=_0x16c737;_0x3a8ca5=_0x40fbce[_0x554a('0x12')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0x554a('0x13')](util[_0x554a('0xc')](_0x554a('0x14'),QUERY),{'type':dbH[_0x554a('0x15')]['QueryTypes']['SELECT']});})[_0x554a('0x11')](function(_0xabd1a0){if(!_0xabd1a0[0x0]['num']){return analyticExtractedReport(_0x554a('0x16'));}var _0x2e9f90=[];var _0x10d547=0x0;var _0x173169=!![];if(_0xabd1a0&&_0xabd1a0[_0x554a('0x17')]){var _0x5eebae=_0xabd1a0[0x0][_0x554a('0x18')]%(_0x10d547+_0x3a8ca5);if(_0x40fbce[_0x554a('0x10')]){for(;_0x173169;_0x10d547+=_0x3a8ca5,_0x5eebae=_0xabd1a0[0x0][_0x554a('0x18')]%(_0x10d547+_0x3a8ca5)){if(_0x5eebae==0x0||_0x5eebae==_0xabd1a0[0x0]['num']){_0x173169=![];}_0x2e9f90[_0x554a('0x19')](dbH[_0x554a('0x15')][_0x554a('0x13')](util[_0x554a('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3a8ca5,_0x10d547),{'type':dbH['sequelize']['QueryTypes'][_0x554a('0x1a')]}));}}else{_0x2e9f90[_0x554a('0x19')](dbH[_0x554a('0x15')][_0x554a('0x13')](QUERY,{'type':dbH[_0x554a('0x15')][_0x554a('0x1b')][_0x554a('0x1a')]}));}}var _0x34f799=path[_0x554a('0x1c')](PATH);var _0x294a68=path[_0x554a('0x1d')](PATH,_0x554a('0x1e'));var _0x366c84=_0x40fbce[_0x554a('0x10')]&&_0x2e9f90[_0x554a('0x17')]>0x1;var _0x23d017=[];if(!fs[_0x554a('0x1f')](path[_0x554a('0x20')](_0x34f799,_0x294a68))&&_0x366c84){fs[_0x554a('0x21')](path[_0x554a('0x20')](_0x34f799,_0x294a68));}return BPromise[_0x554a('0x22')](_0x2e9f90,function(_0x5d2953){_0x23d017['push'](_0x5d2953);})[_0x554a('0x11')](function(){for(var _0x1b9143=0x0;_0x1b9143<_0x23d017[_0x554a('0x17')];_0x1b9143+=0x1){var _0x55f425;var _0x340aaa=_0x23d017[_0x1b9143];if(_0x366c84){_0x55f425=path[_0x554a('0x20')](_0x34f799,_0x294a68,util[_0x554a('0xc')](_0x554a('0x23'),_0x294a68,_0x1b9143,_0x554a('0x24')));}else{_0x55f425=path[_0x554a('0x20')](_0x34f799,util['format'](_0x554a('0x25'),_0x294a68,_0x554a('0x24')));}fs[_0x554a('0x26')](_0x55f425,csv(_0x340aaa));}})[_0x554a('0x11')](function(){if(_0x366c84){zipdir(path[_0x554a('0x20')](_0x34f799,_0x294a68),{'saveTo':path['join'](_0x34f799,util[_0x554a('0xc')](_0x554a('0x25'),_0x294a68,'zip'))},function(_0x2a05bc,_0x1de6bb){});rimraf(path[_0x554a('0x20')](_0x34f799,_0x294a68),function(){});}})[_0x554a('0x11')](function(){logger[_0x554a('0xb')](util['format'](_0x554a('0x27'),EXTRACTED_REPORT_ID,_0x554a('0xe')));return analyticExtractedReport(_0x554a('0x28'),_0x366c84?util[_0x554a('0xc')]('%s.%s',_0x294a68,_0x366c84?_0x554a('0x29'):_0x554a('0x24')):null);});})[_0x554a('0x2a')](function(_0x1384f8){logger[_0x554a('0xb')](util[_0x554a('0xc')](_0x554a('0x2b'),EXTRACTED_REPORT_ID,_0x554a('0xe')),util[_0x554a('0x2c')](_0x1384f8,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x554a('0x2d'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 0daf68e..7a4fd83 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 _0x1fb8=['splitSizePdf','then','length','sequelize','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','join','each','name','startDate','endDate','black','body','hasOwnProperty','toString','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-MediumItalic.ttf','%s%d.%s','pdf','%s.%s','pipe','createWriteStream','finish','error','err','end','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','util','path','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','update','push','tableHeader','num','Empty','.pdf','Setting','find','split'];(function(_0x1955c8,_0x3aeb09){var _0x1cad9d=function(_0x193cc1){while(--_0x193cc1){_0x1955c8['push'](_0x1955c8['shift']());}};_0x1cad9d(++_0x3aeb09);}(_0x1fb8,0x1e3));var _0x81fb=function(_0x39a99d,_0x36fdec){_0x39a99d=_0x39a99d-0x0;var _0x229fd5=_0x1fb8[_0x39a99d];return _0x229fd5;};'use strict';var _=require(_0x81fb('0x0'));var fs=require('fs');var BPromise=require(_0x81fb('0x1'));var util=require(_0x81fb('0x2'));var path=require(_0x81fb('0x3'));var moment=require('moment');var PdfPrinter=require(_0x81fb('0x4'));var zipdir=require(_0x81fb('0x5'));var rimraf=require(_0x81fb('0x6'));var db=require(_0x81fb('0x7'))['db'];var dbH=require('../../mysqldb')[_0x81fb('0x8')];var logger=require('../../config/logger')(_0x81fb('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x81fb('0xa')][0x2]);var QUERY=process[_0x81fb('0xa')][0x3];var PATH=process[_0x81fb('0xa')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x81fb('0xb');var _extractedReport;function analyticExtractedReport(_0x24eba3,_0x579798){var _0x5d22af={'status':_0x24eba3};var _0x2d0881={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x579798){_0x5d22af['savename']=_0x579798;}return db['AnalyticExtractedReport'][_0x81fb('0xc')](_0x5d22af,_0x2d0881);}function getHeader(_0xba947b){var _0x404edd=[];for(var _0x11073c in _0xba947b){if(_0xba947b['hasOwnProperty'](_0x11073c)){_0x404edd[_0x81fb('0xd')]({'text':_0x11073c,'style':_0x81fb('0xe')});}}return _0x404edd;}function extractReport(_0x335131){var _0x440663=0x1388;var _0x19476b;if(!_0x335131[0x0][_0x81fb('0xf')]){return analyticExtractedReport(_0x81fb('0x10'));}var _0x55c3ca=[];var _0x149804=0x0;var _0x3eb44e=!![];var _0x27f341=path['dirname'](PATH);var _0x6e5a2f=path['basename'](PATH,_0x81fb('0x11'));var _0x4a5a65=![];var _0x43bdd7=[];return db[_0x81fb('0x12')][_0x81fb('0x13')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x81fb('0x14'),_0x81fb('0x15')]})[_0x81fb('0x16')](function(_0xebbf2c){if(_0xebbf2c){_0x19476b=_0xebbf2c;_0x440663=_0x19476b[_0x81fb('0x15')]||0x3e8;}})[_0x81fb('0x16')](function(){if(_0x335131&&_0x335131[_0x81fb('0x17')]){var _0x2fc7f4=_0x335131[0x0][_0x81fb('0xf')]%(_0x149804+_0x440663);if(_0x19476b[_0x81fb('0x14')]){for(;_0x3eb44e;_0x149804+=_0x440663,_0x2fc7f4=_0x335131[0x0][_0x81fb('0xf')]%(_0x149804+_0x440663)){if(_0x2fc7f4==0x0||_0x2fc7f4==_0x335131[0x0]['num']){_0x3eb44e=![];}_0x55c3ca[_0x81fb('0xd')](dbH[_0x81fb('0x18')][_0x81fb('0x19')](util[_0x81fb('0x1a')](_0x81fb('0x1b'),QUERY,_0x440663,_0x149804),{'type':dbH[_0x81fb('0x18')][_0x81fb('0x1c')]['SELECT']}));}}else{_0x55c3ca[_0x81fb('0xd')](dbH['sequelize'][_0x81fb('0x19')](QUERY,{'type':dbH[_0x81fb('0x18')][_0x81fb('0x1c')][_0x81fb('0x1d')]}));}}_0x4a5a65=_0x19476b[_0x81fb('0x14')]&&_0x55c3ca[_0x81fb('0x17')]>0x1;if(!fs['existsSync'](path[_0x81fb('0x1e')](_0x27f341,_0x6e5a2f))&&_0x4a5a65){fs['mkdirSync'](path[_0x81fb('0x1e')](_0x27f341,_0x6e5a2f));}return BPromise[_0x81fb('0x1f')](_0x55c3ca,function(_0xfbc0b7){_0x43bdd7['push'](_0xfbc0b7);});})[_0x81fb('0x16')](function(){return BPromise[_0x81fb('0x1f')](_0x55c3ca,function(_0x29d598,_0x5a6e65){var _0x3a77b0;var _0x2d93c8=util[_0x81fb('0x1a')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,_extractedReport[_0x81fb('0x20')],moment(_extractedReport[_0x81fb('0x21')])[_0x81fb('0x1a')](FORMAT),moment(_extractedReport[_0x81fb('0x22')])[_0x81fb('0x1a')](FORMAT));var _0x390d1e={'pageSize':'A4','pageOrientation':'landscape','content':[{'text':_0x2d93c8,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x81fb('0x23')}}};var _0x28ad18={'headerRows':0x1,'body':[]};_0x28ad18[_0x81fb('0x24')][_0x81fb('0xd')](getHeader(_0x29d598[0x0]));var _0xf13e56;for(var _0x271e2b=0x0;_0x271e2b<_0x29d598[_0x81fb('0x17')];_0x271e2b+=0x1){_0xf13e56=[];for(var _0x2196cf in _0x29d598[_0x271e2b]){if(_0x29d598[_0x271e2b][_0x81fb('0x25')](_0x2196cf)){_0xf13e56[_0x81fb('0xd')](_0x29d598[_0x271e2b][_0x2196cf]?_[_0x81fb('0x26')](_0x29d598[_0x271e2b][_0x2196cf]):'');}}_0x28ad18[_0x81fb('0x24')][_0x81fb('0xd')](_0xf13e56);}_0x390d1e[_0x81fb('0x27')]['push']({'table':_0x28ad18});return new BPromise(function(_0x3c7b86,_0x4ebf98){var _0x4145d2=new PdfPrinter({'Roboto':{'normal':__dirname+_0x81fb('0x28'),'bold':__dirname+_0x81fb('0x29'),'italics':__dirname+'/fonts/Roboto-Italic.ttf','bolditalics':__dirname+_0x81fb('0x2a')}});var _0x5ebb45=_0x4145d2['createPdfKitDocument'](_0x390d1e);if(_0x4a5a65){_0x3a77b0=path[_0x81fb('0x1e')](_0x27f341,_0x6e5a2f,util[_0x81fb('0x1a')](_0x81fb('0x2b'),_0x6e5a2f,_0x5a6e65,_0x81fb('0x2c')));}else{_0x3a77b0=path[_0x81fb('0x1e')](_0x27f341,util[_0x81fb('0x1a')](_0x81fb('0x2d'),_0x6e5a2f,'pdf'));}var _0xc23dec=_0x5ebb45[_0x81fb('0x2e')](fs[_0x81fb('0x2f')](_0x3a77b0));_0xc23dec['on'](_0x81fb('0x30'),function(){_0x3c7b86();});_0xc23dec['on'](_0x81fb('0x31'),function(_0x4bf5da){console['log'](_0x81fb('0x32'),_0x4bf5da);_0x4ebf98(_0x4bf5da);});_0x5ebb45[_0x81fb('0x33')]();});});})[_0x81fb('0x16')](function(){if(_0x4a5a65){return new BPromise(function(_0xe43a1b,_0x5bafc6){zipdir(path[_0x81fb('0x1e')](_0x27f341,_0x6e5a2f),{'saveTo':path[_0x81fb('0x1e')](_0x27f341,util[_0x81fb('0x1a')](_0x81fb('0x2d'),_0x6e5a2f,_0x81fb('0x34')))},function(_0x3d293d){if(_0x3d293d){_0x5bafc6(_0x3d293d);}else{_0xe43a1b();}});});}})[_0x81fb('0x16')](function(){if(_0x4a5a65){rimraf(path[_0x81fb('0x1e')](_0x27f341,_0x6e5a2f),function(){});}})[_0x81fb('0x16')](function(){logger[_0x81fb('0x35')](util[_0x81fb('0x1a')](_0x81fb('0x36'),EXTRACTED_REPORT_ID,_0x81fb('0x37')));return analyticExtractedReport(_0x81fb('0x38'),_0x4a5a65?util[_0x81fb('0x1a')](_0x81fb('0x2d'),_0x6e5a2f,_0x4a5a65?_0x81fb('0x34'):_0x81fb('0x2c')):null);});}function main(){logger[_0x81fb('0x35')](util[_0x81fb('0x1a')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x81fb('0x39')));return db['AnalyticExtractedReport'][_0x81fb('0x3a')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x81fb('0x16')](function(_0x4da07b){_extractedReport=_0x4da07b;return dbH[_0x81fb('0x18')][_0x81fb('0x19')](util[_0x81fb('0x1a')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x81fb('0x18')]['QueryTypes'][_0x81fb('0x1d')]});})['then'](extractReport)[_0x81fb('0x3b')](function(_0x3a590b){logger['info'](util[_0x81fb('0x1a')](_0x81fb('0x3c'),EXTRACTED_REPORT_ID,'PDF'),util[_0x81fb('0x3d')](_0x3a590b,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x81fb('0x3e'));});}main(); \ No newline at end of file +var _0x76ae=['PDF','AnalyticExtractedReport','findOne','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','lodash','bluebird','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','hasOwnProperty','push','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','then','splitSizePdf','length','format','QueryTypes','sequelize','SELECT','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','body','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','createPdfKitDocument','%s%d.%s','pdf','%s.%s','pipe','createWriteStream','error','err','zip','info','CSV','Completed'];(function(_0x4d08b8,_0x34c445){var _0x70214a=function(_0x4db67c){while(--_0x4db67c){_0x4d08b8['push'](_0x4d08b8['shift']());}};_0x70214a(++_0x34c445);}(_0x76ae,0xff));var _0xe76a=function(_0x222cb7,_0x233a13){_0x222cb7=_0x222cb7-0x0;var _0x31ed60=_0x76ae[_0x222cb7];return _0x31ed60;};'use strict';var _=require(_0xe76a('0x0'));var fs=require('fs');var BPromise=require(_0xe76a('0x1'));var util=require(_0xe76a('0x2'));var path=require(_0xe76a('0x3'));var moment=require(_0xe76a('0x4'));var PdfPrinter=require(_0xe76a('0x5'));var zipdir=require(_0xe76a('0x6'));var rimraf=require(_0xe76a('0x7'));var db=require(_0xe76a('0x8'))['db'];var dbH=require('../../mysqldb')[_0xe76a('0x9')];var logger=require(_0xe76a('0xa'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xe76a('0xb')][0x2]);var QUERY=process[_0xe76a('0xb')][0x3];var PATH=process[_0xe76a('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xe76a('0xc');var _extractedReport;function analyticExtractedReport(_0x1a8ba0,_0x462476){var _0x262c5c={'status':_0x1a8ba0};var _0x1c0813={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x462476){_0x262c5c[_0xe76a('0xd')]=_0x462476;}return db['AnalyticExtractedReport'][_0xe76a('0xe')](_0x262c5c,_0x1c0813);}function getHeader(_0x578c4a){var _0x29ba38=[];for(var _0x47dc65 in _0x578c4a){if(_0x578c4a[_0xe76a('0xf')](_0x47dc65)){_0x29ba38[_0xe76a('0x10')]({'text':_0x47dc65,'style':_0xe76a('0x11')});}}return _0x29ba38;}function extractReport(_0x5401e5){var _0x33668d=0x1388;var _0x29503c;if(!_0x5401e5[0x0][_0xe76a('0x12')]){return analyticExtractedReport(_0xe76a('0x13'));}var _0x2151f2=[];var _0x4bffcd=0x0;var _0x5be4e3=!![];var _0x505099=path[_0xe76a('0x14')](PATH);var _0xcba126=path[_0xe76a('0x15')](PATH,_0xe76a('0x16'));var _0x19c2d7=![];var _0x8d0f71=[];return db[_0xe76a('0x17')][_0xe76a('0x18')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe76a('0x19'),'splitSizePdf']})[_0xe76a('0x1a')](function(_0x1b867d){if(_0x1b867d){_0x29503c=_0x1b867d;_0x33668d=_0x29503c[_0xe76a('0x1b')]||0x3e8;}})[_0xe76a('0x1a')](function(){if(_0x5401e5&&_0x5401e5[_0xe76a('0x1c')]){var _0x153c5e=_0x5401e5[0x0][_0xe76a('0x12')]%(_0x4bffcd+_0x33668d);if(_0x29503c[_0xe76a('0x19')]){for(;_0x5be4e3;_0x4bffcd+=_0x33668d,_0x153c5e=_0x5401e5[0x0][_0xe76a('0x12')]%(_0x4bffcd+_0x33668d)){if(_0x153c5e==0x0||_0x153c5e==_0x5401e5[0x0][_0xe76a('0x12')]){_0x5be4e3=![];}_0x2151f2[_0xe76a('0x10')](dbH['sequelize']['query'](util[_0xe76a('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x33668d,_0x4bffcd),{'type':dbH['sequelize'][_0xe76a('0x1e')]['SELECT']}));}}else{_0x2151f2[_0xe76a('0x10')](dbH[_0xe76a('0x1f')]['query'](QUERY,{'type':dbH[_0xe76a('0x1f')]['QueryTypes'][_0xe76a('0x20')]}));}}_0x19c2d7=_0x29503c[_0xe76a('0x19')]&&_0x2151f2['length']>0x1;if(!fs['existsSync'](path[_0xe76a('0x21')](_0x505099,_0xcba126))&&_0x19c2d7){fs[_0xe76a('0x22')](path[_0xe76a('0x21')](_0x505099,_0xcba126));}return BPromise[_0xe76a('0x23')](_0x2151f2,function(_0x39002a){_0x8d0f71[_0xe76a('0x10')](_0x39002a);});})[_0xe76a('0x1a')](function(){return BPromise['each'](_0x2151f2,function(_0x3d3031,_0x5f0093){var _0x40851d;var _0x4bb3f0=util[_0xe76a('0x1d')](_0xe76a('0x24'),NAME,_extractedReport['name'],moment(_extractedReport[_0xe76a('0x25')])['format'](FORMAT),moment(_extractedReport['endDate'])[_0xe76a('0x1d')](FORMAT));var _0x469042={'pageSize':'A4','pageOrientation':'landscape','content':[{'text':_0x4bb3f0,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'}}};var _0x5ba80f={'headerRows':0x1,'body':[]};_0x5ba80f[_0xe76a('0x26')][_0xe76a('0x10')](getHeader(_0x3d3031[0x0]));var _0x370efa;for(var _0x27f384=0x0;_0x27f384<_0x3d3031['length'];_0x27f384+=0x1){_0x370efa=[];for(var _0x306acd in _0x3d3031[_0x27f384]){if(_0x3d3031[_0x27f384]['hasOwnProperty'](_0x306acd)){_0x370efa[_0xe76a('0x10')](_0x3d3031[_0x27f384][_0x306acd]?_['toString'](_0x3d3031[_0x27f384][_0x306acd]):'');}}_0x5ba80f[_0xe76a('0x26')][_0xe76a('0x10')](_0x370efa);}_0x469042[_0xe76a('0x27')][_0xe76a('0x10')]({'table':_0x5ba80f});return new BPromise(function(_0x577e1d,_0x1ec8f0){var _0x22a8e1=new PdfPrinter({'Roboto':{'normal':__dirname+_0xe76a('0x28'),'bold':__dirname+_0xe76a('0x29'),'italics':__dirname+_0xe76a('0x2a'),'bolditalics':__dirname+'/fonts/Roboto-MediumItalic.ttf'}});var _0x286747=_0x22a8e1[_0xe76a('0x2b')](_0x469042);if(_0x19c2d7){_0x40851d=path[_0xe76a('0x21')](_0x505099,_0xcba126,util['format'](_0xe76a('0x2c'),_0xcba126,_0x5f0093,_0xe76a('0x2d')));}else{_0x40851d=path[_0xe76a('0x21')](_0x505099,util[_0xe76a('0x1d')](_0xe76a('0x2e'),_0xcba126,_0xe76a('0x2d')));}var _0x8737a6=_0x286747[_0xe76a('0x2f')](fs[_0xe76a('0x30')](_0x40851d));_0x8737a6['on']('finish',function(){_0x577e1d();});_0x8737a6['on'](_0xe76a('0x31'),function(_0x1d2af1){console['log'](_0xe76a('0x32'),_0x1d2af1);_0x1ec8f0(_0x1d2af1);});_0x286747['end']();});});})[_0xe76a('0x1a')](function(){if(_0x19c2d7){return new BPromise(function(_0x4a2609,_0x42fe97){zipdir(path['join'](_0x505099,_0xcba126),{'saveTo':path[_0xe76a('0x21')](_0x505099,util[_0xe76a('0x1d')](_0xe76a('0x2e'),_0xcba126,_0xe76a('0x33')))},function(_0x41877a){if(_0x41877a){_0x42fe97(_0x41877a);}else{_0x4a2609();}});});}})[_0xe76a('0x1a')](function(){if(_0x19c2d7){rimraf(path[_0xe76a('0x21')](_0x505099,_0xcba126),function(){});}})[_0xe76a('0x1a')](function(){logger[_0xe76a('0x34')](util[_0xe76a('0x1d')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xe76a('0x35')));return analyticExtractedReport(_0xe76a('0x36'),_0x19c2d7?util[_0xe76a('0x1d')](_0xe76a('0x2e'),_0xcba126,_0x19c2d7?_0xe76a('0x33'):_0xe76a('0x2d')):null);});}function main(){logger[_0xe76a('0x34')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xe76a('0x37')));return db[_0xe76a('0x38')][_0xe76a('0x39')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xe76a('0x1a')](function(_0x45b156){_extractedReport=_0x45b156;return dbH[_0xe76a('0x1f')][_0xe76a('0x3a')](util['format'](_0xe76a('0x3b'),QUERY),{'type':dbH[_0xe76a('0x1f')]['QueryTypes'][_0xe76a('0x20')]});})[_0xe76a('0x1a')](extractReport)['catch'](function(_0x54fccb){logger[_0xe76a('0x34')](util[_0xe76a('0x1d')](_0xe76a('0x3c'),EXTRACTED_REPORT_ID,'PDF'),util[_0xe76a('0x3d')](_0x54fccb,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index d112a4f..1118dc0 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 _0x3b47=['argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','push','SELECT','dirname','basename','.xlsx','existsSync','mkdirSync','join','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger'];(function(_0xbcb4bf,_0x5296ed){var _0x3932b3=function(_0x3df0f2){while(--_0x3df0f2){_0xbcb4bf['push'](_0xbcb4bf['shift']());}};_0x3932b3(++_0x5296ed);}(_0x3b47,0x1ce));var _0x73b4=function(_0x2a57d2,_0x3c8e71){_0x2a57d2=_0x2a57d2-0x0;var _0x6e44c4=_0x3b47[_0x2a57d2];return _0x6e44c4;};'use strict';var util=require(_0x73b4('0x0'));var path=require(_0x73b4('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x73b4('0x2'));var BPromise=require(_0x73b4('0x3'));var zipdir=require(_0x73b4('0x4'));var rimraf=require(_0x73b4('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0x73b4('0x6'))['dbH'];var logger=require(_0x73b4('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x73b4('0x8')][0x2]);var QUERY=process[_0x73b4('0x8')][0x3];var PATH=process[_0x73b4('0x8')][0x4];function analyticExtractedReport(_0x5a02a1,_0x976c82){var _0x2ef999={'status':_0x5a02a1};var _0x612f08={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x976c82){_0x2ef999[_0x73b4('0x9')]=_0x976c82;}return db['AnalyticExtractedReport'][_0x73b4('0xa')](_0x2ef999,_0x612f08);}function main(){var _0xfb725f=0x1388;var _0x42547f;logger[_0x73b4('0xb')](util[_0x73b4('0xc')](_0x73b4('0xd'),EXTRACTED_REPORT_ID,_0x73b4('0xe')));return db[_0x73b4('0xf')][_0x73b4('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x73b4('0x11'),'splitSizeXlsx']})['then'](function(_0x20156a){if(_0x20156a){_0x42547f=_0x20156a;_0xfb725f=_0x42547f[_0x73b4('0x12')]||0x1388;}})[_0x73b4('0x13')](function(){return dbH[_0x73b4('0x14')][_0x73b4('0x15')](util['format'](_0x73b4('0x16'),QUERY),{'type':dbH[_0x73b4('0x14')][_0x73b4('0x17')]['SELECT']});})[_0x73b4('0x13')](function(_0x2fcc6a){if(!_0x2fcc6a[0x0][_0x73b4('0x18')]){return analyticExtractedReport(_0x73b4('0x19'));}var _0x12f487=[];var _0x565179=0x0;var _0x59492e=!![];if(_0x42547f['split']){if(_0x2fcc6a&&_0x2fcc6a[_0x73b4('0x1a')]){var _0x9a9345=_0x2fcc6a[0x0][_0x73b4('0x18')]%(_0x565179+_0xfb725f);for(;_0x59492e;_0x565179+=_0xfb725f,_0x9a9345=_0x2fcc6a[0x0][_0x73b4('0x18')]%(_0x565179+_0xfb725f)){if(_0x9a9345==0x0||_0x9a9345==_0x2fcc6a[0x0][_0x73b4('0x18')]){_0x59492e=![];}_0x12f487[_0x73b4('0x1b')](dbH[_0x73b4('0x14')]['query'](util[_0x73b4('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xfb725f,_0x565179),{'type':dbH[_0x73b4('0x14')]['QueryTypes'][_0x73b4('0x1c')]}));}}}else{_0x12f487[_0x73b4('0x1b')](dbH[_0x73b4('0x14')]['query'](QUERY,{'type':dbH['sequelize'][_0x73b4('0x17')][_0x73b4('0x1c')]}));}var _0x427120=path[_0x73b4('0x1d')](PATH);var _0x83c6ae=path[_0x73b4('0x1e')](PATH,_0x73b4('0x1f'));var _0xbaae72=_0x42547f[_0x73b4('0x11')]&&_0x12f487['length']>0x1;var _0x463b0b=[];if(!fs[_0x73b4('0x20')](path['join'](_0x427120,_0x83c6ae))&&_0xbaae72){fs[_0x73b4('0x21')](path[_0x73b4('0x22')](_0x427120,_0x83c6ae));}return BPromise['each'](_0x12f487,function(_0x5f10a1){_0x463b0b[_0x73b4('0x1b')](_0x5f10a1);})[_0x73b4('0x13')](function(){for(var _0x2701f1=0x0;_0x2701f1<_0x463b0b[_0x73b4('0x1a')];_0x2701f1+=0x1){var _0x3bdffb;var _0x3baea8=_0x463b0b[_0x2701f1];if(_0xbaae72){_0x3bdffb=path[_0x73b4('0x22')](_0x427120,_0x83c6ae,util[_0x73b4('0xc')](_0x73b4('0x23'),_0x83c6ae,_0x2701f1,_0x73b4('0x24')));}else{_0x3bdffb=path[_0x73b4('0x22')](_0x427120,util['format'](_0x73b4('0x25'),_0x83c6ae,_0x73b4('0x24')));}fs[_0x73b4('0x26')](_0x3bdffb,json2xls(_0x3baea8),_0x73b4('0x27'));}})[_0x73b4('0x13')](function(){if(_0xbaae72){zipdir(path[_0x73b4('0x22')](_0x427120,_0x83c6ae),{'saveTo':path[_0x73b4('0x22')](_0x427120,util[_0x73b4('0xc')](_0x73b4('0x25'),_0x83c6ae,_0x73b4('0x28')))},function(_0x2bf024,_0x100aab){});rimraf(path[_0x73b4('0x22')](_0x427120,_0x83c6ae),function(){});}})[_0x73b4('0x13')](function(){logger[_0x73b4('0xb')](util[_0x73b4('0xc')](_0x73b4('0x29'),EXTRACTED_REPORT_ID,_0x73b4('0xe')));return analyticExtractedReport(_0x73b4('0x2a'),_0xbaae72?util['format'](_0x73b4('0x25'),_0x83c6ae,_0xbaae72?'zip':_0x73b4('0x24')):null);});})[_0x73b4('0x2b')](function(_0xbd0cf9){logger[_0x73b4('0xb')](util[_0x73b4('0xc')](_0x73b4('0x2c'),EXTRACTED_REPORT_ID,_0x73b4('0xe')),util[_0x73b4('0x2d')](_0xbd0cf9,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x73b4('0x2e'));});}main(); \ No newline at end of file +var _0x80bc=['split','then','splitSizeXlsx','sequelize','format','QueryTypes','SELECT','num','length','push','query','dirname','.xlsx','existsSync','join','each','%s%d.%s','%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','path','lodash','bluebird','zip-dir','../../mysqldb','analytics','argv','info','XLSX','Setting'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0x80bc,0x125));var _0xc80b=function(_0x3c4a7c,_0x2f4e3c){_0x3c4a7c=_0x3c4a7c-0x0;var _0xf13d1e=_0x80bc[_0x3c4a7c];return _0xf13d1e;};'use strict';var util=require(_0xc80b('0x0'));var path=require(_0xc80b('0x1'));var _=require(_0xc80b('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xc80b('0x3'));var zipdir=require(_0xc80b('0x4'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0xc80b('0x5'))['dbH'];var logger=require('../../config/logger')(_0xc80b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xc80b('0x7')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0xe86a3,_0x5030fa){var _0x129d01={'status':_0xe86a3};var _0x105185={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5030fa){_0x129d01['savename']=_0x5030fa;}return db['AnalyticExtractedReport']['update'](_0x129d01,_0x105185);}function main(){var _0x42be18=0x1388;var _0x3dec9c;logger[_0xc80b('0x8')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xc80b('0x9')));return db[_0xc80b('0xa')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc80b('0xb'),'splitSizeXlsx']})[_0xc80b('0xc')](function(_0x5a43cf){if(_0x5a43cf){_0x3dec9c=_0x5a43cf;_0x42be18=_0x3dec9c[_0xc80b('0xd')]||0x1388;}})[_0xc80b('0xc')](function(){return dbH[_0xc80b('0xe')]['query'](util[_0xc80b('0xf')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xc80b('0xe')][_0xc80b('0x10')][_0xc80b('0x11')]});})[_0xc80b('0xc')](function(_0xbec26e){if(!_0xbec26e[0x0][_0xc80b('0x12')]){return analyticExtractedReport('Empty');}var _0x1b1c11=[];var _0x4be0dc=0x0;var _0x1c7863=!![];if(_0x3dec9c[_0xc80b('0xb')]){if(_0xbec26e&&_0xbec26e[_0xc80b('0x13')]){var _0x46f2b1=_0xbec26e[0x0][_0xc80b('0x12')]%(_0x4be0dc+_0x42be18);for(;_0x1c7863;_0x4be0dc+=_0x42be18,_0x46f2b1=_0xbec26e[0x0][_0xc80b('0x12')]%(_0x4be0dc+_0x42be18)){if(_0x46f2b1==0x0||_0x46f2b1==_0xbec26e[0x0][_0xc80b('0x12')]){_0x1c7863=![];}_0x1b1c11[_0xc80b('0x14')](dbH[_0xc80b('0xe')][_0xc80b('0x15')](util[_0xc80b('0xf')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x42be18,_0x4be0dc),{'type':dbH[_0xc80b('0xe')][_0xc80b('0x10')]['SELECT']}));}}}else{_0x1b1c11[_0xc80b('0x14')](dbH[_0xc80b('0xe')][_0xc80b('0x15')](QUERY,{'type':dbH[_0xc80b('0xe')]['QueryTypes']['SELECT']}));}var _0x4638fc=path[_0xc80b('0x16')](PATH);var _0x5db5ef=path['basename'](PATH,_0xc80b('0x17'));var _0x4681af=_0x3dec9c[_0xc80b('0xb')]&&_0x1b1c11[_0xc80b('0x13')]>0x1;var _0x4712ec=[];if(!fs[_0xc80b('0x18')](path[_0xc80b('0x19')](_0x4638fc,_0x5db5ef))&&_0x4681af){fs['mkdirSync'](path[_0xc80b('0x19')](_0x4638fc,_0x5db5ef));}return BPromise[_0xc80b('0x1a')](_0x1b1c11,function(_0x43a88e){_0x4712ec['push'](_0x43a88e);})[_0xc80b('0xc')](function(){for(var _0x5ce4d1=0x0;_0x5ce4d1<_0x4712ec[_0xc80b('0x13')];_0x5ce4d1+=0x1){var _0x1e007f;var _0x4ac272=_0x4712ec[_0x5ce4d1];if(_0x4681af){_0x1e007f=path['join'](_0x4638fc,_0x5db5ef,util[_0xc80b('0xf')](_0xc80b('0x1b'),_0x5db5ef,_0x5ce4d1,'xlsx'));}else{_0x1e007f=path[_0xc80b('0x19')](_0x4638fc,util[_0xc80b('0xf')](_0xc80b('0x1c'),_0x5db5ef,_0xc80b('0x1d')));}fs[_0xc80b('0x1e')](_0x1e007f,json2xls(_0x4ac272),'binary');}})[_0xc80b('0xc')](function(){if(_0x4681af){zipdir(path[_0xc80b('0x19')](_0x4638fc,_0x5db5ef),{'saveTo':path[_0xc80b('0x19')](_0x4638fc,util[_0xc80b('0xf')](_0xc80b('0x1c'),_0x5db5ef,_0xc80b('0x1f')))},function(_0x35b6f8,_0x3e2b77){});rimraf(path[_0xc80b('0x19')](_0x4638fc,_0x5db5ef),function(){});}})[_0xc80b('0xc')](function(){logger['info'](util[_0xc80b('0xf')](_0xc80b('0x20'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0xc80b('0x21'),_0x4681af?util['format']('%s.%s',_0x5db5ef,_0x4681af?'zip':_0xc80b('0x1d')):null);});})[_0xc80b('0x22')](function(_0x9259ee){logger['info'](util[_0xc80b('0xf')](_0xc80b('0x23'),EXTRACTED_REPORT_ID,_0xc80b('0x9')),util[_0xc80b('0x24')](_0x9259ee,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xc80b('0x25'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 109da3a..f661fa4 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 _0x0ff5=['XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','last','concat','Hangup','destroy','bulkCreate','sortBy','rewrite','util','models','findAll','then','VoiceExtension','uniq','map','exten','groupBy','queue','priority','extension','find','extensions','Set','format','type','context','VoiceExtensionId','push','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','createdAt','updatedAt','interval','*,*,*,*','IntervalId','intervals','tag','CDR(tag)=','hasOwnProperty','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer'];(function(_0x274dd7,_0x2e6051){var _0x148829=function(_0x4cec98){while(--_0x4cec98){_0x274dd7['push'](_0x274dd7['shift']());}};_0x148829(++_0x2e6051);}(_0x0ff5,0x191));var _0x50ff=function(_0x4aaaef,_0x4cd2d0){_0x4aaaef=_0x4aaaef-0x0;var _0xbe59a=_0x0ff5[_0x4aaaef];return _0xbe59a;};'use strict';var _=require('lodash');var util=require(_0x50ff('0x0'));function rewrite(_0x169300,_0x70dd31){var _0x3313d6=this;return _0x169300[_0x50ff('0x1')]['Interval'][_0x50ff('0x2')]({'raw':!![]})[_0x50ff('0x3')](function(_0x40a92f){_0x3313d6['intervals']=_0x40a92f;return _0x169300[_0x50ff('0x1')]['VoiceExtension'][_0x50ff('0x2')]({'where':{'IntervalId':_0x70dd31['IntervalId']},'raw':!![]});})[_0x50ff('0x3')](function(_0x47023c){return _0x169300[_0x50ff('0x1')][_0x50ff('0x4')][_0x50ff('0x2')]({'where':{'exten':{'$in':_[_0x50ff('0x5')](_[_0x50ff('0x6')](_0x47023c,_0x50ff('0x7')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x2faab5){var _0x3beb25=_['filter'](_0x2faab5,{'priority':'1'});var _0x33dbf6=_['filter'](_0x2faab5,{'isApp':0x1});var _0x46a432=_[_0x50ff('0x8')](_0x33dbf6,_0x50ff('0x7'));var _0x40b327=[_0x50ff('0x9'),'playback'];var _0x372c97=[];var _0x450c82=[];for(var _0x51a30e in _0x46a432){if(_0x46a432['hasOwnProperty'](_0x51a30e)){_0x3313d6[_0x50ff('0xa')]=0x2;_0x3313d6['extensions']=[];_0x3313d6[_0x50ff('0xb')]=_[_0x50ff('0xc')](_0x3beb25,{'exten':_0x46a432[_0x51a30e][0x0][_0x50ff('0x7')]});_0x3313d6[_0x50ff('0xd')]['push']({'type':_0x46a432[_0x51a30e][0x0]['type'],'app':_0x50ff('0xe'),'appdata':util[_0x50ff('0xf')]('CDR(type)=%s',_0x46a432[_0x51a30e][0x0][_0x50ff('0x10')]),'context':_0x46a432[_0x51a30e][0x0][_0x50ff('0x11')],'exten':_0x46a432[_0x51a30e][0x0][_0x50ff('0x7')],'priority':_0x3313d6[_0x50ff('0xa')]++,'VoiceExtensionId':_0x46a432[_0x51a30e][0x0][_0x50ff('0x12')]});if(_0x46a432[_0x51a30e][0x0]['type']==='outbound'){if(_0x3313d6[_0x50ff('0xb')]){_0x3313d6[_0x50ff('0xd')][_0x50ff('0x13')]({'type':_0x46a432[_0x51a30e][0x0][_0x50ff('0x10')],'app':'Set','appdata':_0x50ff('0x14')+(_0x3313d6[_0x50ff('0xb')]['cutdigits']?'${EXTEN:'+_0x3313d6[_0x50ff('0xb')][_0x50ff('0x15')]+'}':_0x50ff('0x16')),'context':_0x46a432[_0x51a30e][0x0][_0x50ff('0x11')],'exten':_0x46a432[_0x51a30e][0x0][_0x50ff('0x7')],'priority':_0x3313d6[_0x50ff('0xa')]++,'VoiceExtensionId':_0x46a432[_0x51a30e][0x0][_0x50ff('0x12')]});}_0x3313d6[_0x50ff('0xd')]['push']({'type':_0x46a432[_0x51a30e][0x0][_0x50ff('0x10')],'app':_0x50ff('0xe'),'appdata':'CDR(routeid)='+_0x46a432[_0x51a30e][0x0][_0x50ff('0x12')],'context':_0x46a432[_0x51a30e][0x0][_0x50ff('0x11')],'exten':_0x46a432[_0x51a30e][0x0][_0x50ff('0x7')],'priority':_0x3313d6[_0x50ff('0xa')]++,'VoiceExtensionId':_0x46a432[_0x51a30e][0x0]['VoiceExtensionId']});var _0x6a3927=_0x3313d6[_0x50ff('0xa')]++;_0x3313d6[_0x50ff('0xd')][_0x50ff('0x13')]({'type':_0x46a432[_0x51a30e][0x0]['type'],'app':_0x50ff('0x17'),'appdata':_0x50ff('0x18')+(_0x6a3927+0x2)+_0x50ff('0x19')+(_0x6a3927+0x1)+')','context':_0x46a432[_0x51a30e][0x0]['context'],'exten':_0x46a432[_0x51a30e][0x0]['exten'],'priority':_0x6a3927,'VoiceExtensionId':_0x46a432[_0x51a30e][0x0]['VoiceExtensionId']});if(_0x3313d6[_0x50ff('0xb')]){_0x3313d6[_0x50ff('0xd')][_0x50ff('0x13')]({'type':_0x46a432[_0x51a30e][0x0]['type'],'app':_0x50ff('0xe'),'appdata':_0x3313d6[_0x50ff('0xb')]['cutdigits']?_0x50ff('0x1a')+_0x3313d6[_0x50ff('0xb')][_0x50ff('0x15')]+'}':_0x50ff('0x1b'),'context':_0x46a432[_0x51a30e][0x0][_0x50ff('0x11')],'exten':_0x46a432[_0x51a30e][0x0]['exten'],'priority':_0x3313d6[_0x50ff('0xa')]++,'VoiceExtensionId':_0x46a432[_0x51a30e][0x0][_0x50ff('0x12')]});}_0x3313d6[_0x50ff('0xd')][_0x50ff('0x13')]({'type':_0x46a432[_0x51a30e][0x0][_0x50ff('0x10')],'app':_0x50ff('0xe'),'appdata':_0x50ff('0x1c')+_0x46a432[_0x51a30e][0x0][_0x50ff('0x12')],'context':_0x46a432[_0x51a30e][0x0]['context'],'exten':_0x46a432[_0x51a30e][0x0][_0x50ff('0x7')],'priority':_0x3313d6['priority']++,'VoiceExtensionId':_0x46a432[_0x51a30e][0x0][_0x50ff('0x12')]});if(_0x3313d6['extension']&&_0x3313d6[_0x50ff('0xb')]['hasOwnProperty']('recordingFormat')&&_0x3313d6[_0x50ff('0xb')][_0x50ff('0x1d')]!==_0x50ff('0x1e')){_0x3313d6['extensions']['push']({'type':_0x46a432[_0x51a30e][0x0]['type'],'app':_0x50ff('0xe'),'appdata':_0x50ff('0x1f'),'context':_0x46a432[_0x51a30e][0x0]['context'],'exten':_0x46a432[_0x51a30e][0x0][_0x50ff('0x7')],'priority':_0x3313d6[_0x50ff('0xa')]++,'VoiceExtensionId':_0x46a432[_0x51a30e][0x0][_0x50ff('0x12')]});_0x3313d6[_0x50ff('0xd')][_0x50ff('0x13')]({'type':_0x46a432[_0x51a30e][0x0]['type'],'app':'Set','appdata':_0x50ff('0x20')+_0x3313d6[_0x50ff('0xb')]['recordingFormat']||'wav','context':_0x46a432[_0x51a30e][0x0][_0x50ff('0x11')],'exten':_0x46a432[_0x51a30e][0x0][_0x50ff('0x7')],'priority':_0x3313d6[_0x50ff('0xa')]++,'VoiceExtensionId':_0x46a432[_0x51a30e][0x0][_0x50ff('0x12')]});}}_0x3313d6[_0x50ff('0xd')][_0x50ff('0x13')]({'type':_0x46a432[_0x51a30e][0x0][_0x50ff('0x10')],'app':_0x50ff('0xe'),'appdata':_0x50ff('0x21'),'context':_0x46a432[_0x51a30e][0x0][_0x50ff('0x11')],'exten':_0x46a432[_0x51a30e][0x0][_0x50ff('0x7')],'priority':_0x3313d6[_0x50ff('0xa')]++,'VoiceExtensionId':_0x46a432[_0x51a30e][0x0]['VoiceExtensionId']});_0x3313d6['extensions'][_0x50ff('0x13')]({'type':_0x46a432[_0x51a30e][0x0]['type'],'app':'Set','appdata':_0x50ff('0x22'),'context':_0x46a432[_0x51a30e][0x0]['context'],'exten':_0x46a432[_0x51a30e][0x0][_0x50ff('0x7')],'priority':_0x3313d6['priority']++,'VoiceExtensionId':_0x46a432[_0x51a30e][0x0][_0x50ff('0x12')]});_0x3313d6['extensions'][_0x50ff('0x13')]({'type':_0x46a432[_0x51a30e][0x0]['type'],'app':_0x50ff('0xe'),'appdata':'MONITOR_OPTIONS=ab','context':_0x46a432[_0x51a30e][0x0][_0x50ff('0x11')],'exten':_0x46a432[_0x51a30e][0x0]['exten'],'priority':_0x3313d6['priority']++,'VoiceExtensionId':_0x46a432[_0x51a30e][0x0][_0x50ff('0x12')]});for(var _0x53844b=0x0,_0x574a3e=0x0;_0x53844b<_0x46a432[_0x51a30e][_0x50ff('0x23')];_0x53844b+=0x1,_0x574a3e=0x0){var _0x57a6e7=_0x46a432[_0x51a30e][_0x53844b];if(_0x57a6e7[_0x50ff('0x10')]){_0x57a6e7[_0x50ff('0x10')]=_0x57a6e7['type']['toLowerCase']();}var _0x57f856=[];var _0x324938=[];delete _0x57a6e7['id'];delete _0x57a6e7[_0x50ff('0x24')];delete _0x57a6e7[_0x50ff('0x25')];var _0x2d7867=_0x57a6e7[_0x50ff('0x26')]!==_0x50ff('0x27')?[_0x57a6e7['interval']]:_0x57a6e7[_0x50ff('0x28')]?_['map'](_['filter'](_0x3313d6[_0x50ff('0x29')],{'IntervalId':_0x57a6e7[_0x50ff('0x28')]}),_0x50ff('0x26')):[];if(_0x57a6e7['hasOwnProperty'](_0x50ff('0x2a'))){if(_0x57a6e7['tag']&&_0x57a6e7['tag']!=='--'){_0x57f856[_0x50ff('0x13')]({'type':_0x57a6e7[_0x50ff('0x10')],'app':'Set','appdata':_0x50ff('0x2b')+_0x57a6e7[_0x50ff('0x2a')],'context':_0x57a6e7[_0x50ff('0x11')],'exten':_0x57a6e7[_0x50ff('0x7')],'priority':_0x2d7867[_0x50ff('0x23')]+_0x3313d6[_0x50ff('0xa')]+_0x574a3e++,'VoiceExtensionId':_0x57a6e7[_0x50ff('0x12')]});}}if(_0x57a6e7['type']==='outbound'&&_0x57a6e7[_0x50ff('0x2c')]('callerID')){if(_0x57a6e7['callerID']){_0x57f856['push']({'type':_0x57a6e7[_0x50ff('0x10')],'app':_0x50ff('0x17'),'appdata':_0x50ff('0x2d')+_0x57a6e7[_0x50ff('0x2e')]+')','context':_0x57a6e7[_0x50ff('0x11')],'exten':_0x57a6e7[_0x50ff('0x7')],'priority':_0x2d7867[_0x50ff('0x23')]+_0x3313d6['priority']+_0x574a3e++,'VoiceExtensionId':_0x57a6e7[_0x50ff('0x12')]});}else{_0x57f856[_0x50ff('0x13')]({'type':_0x57a6e7[_0x50ff('0x10')],'app':_0x50ff('0x17'),'appdata':_0x50ff('0x2f'),'context':_0x57a6e7['context'],'exten':_0x57a6e7[_0x50ff('0x7')],'priority':_0x2d7867[_0x50ff('0x23')]+_0x3313d6[_0x50ff('0xa')]+_0x574a3e++,'VoiceExtensionId':_0x57a6e7[_0x50ff('0x12')]});}}if(_0x57a6e7['hasOwnProperty'](_0x50ff('0x30'))){if(_0x40b327[_0x50ff('0x31')](_0x57a6e7[_0x50ff('0x32')][_0x50ff('0x33')]())>=0x0&&_0x57a6e7[_0x50ff('0x34')]!=='custom'){if(_0x57a6e7[_0x50ff('0x30')]){_0x57f856[_0x50ff('0x13')]({'type':_0x57a6e7['type'],'app':_0x50ff('0x17'),'appdata':_0x50ff('0x35'),'context':_0x57a6e7['context'],'exten':_0x57a6e7[_0x50ff('0x7')],'priority':_0x2d7867['length']+_0x3313d6[_0x50ff('0xa')]+_0x574a3e++,'VoiceExtensionId':_0x57a6e7['VoiceExtensionId']});_0x57f856[_0x50ff('0x13')]({'type':_0x57a6e7['type'],'app':_0x50ff('0xe'),'appdata':_0x50ff('0x36'),'context':_0x57a6e7[_0x50ff('0x11')],'exten':_0x57a6e7[_0x50ff('0x7')],'priority':_0x2d7867[_0x50ff('0x23')]+_0x3313d6[_0x50ff('0xa')]+_0x574a3e++,'VoiceExtensionId':_0x57a6e7[_0x50ff('0x12')]});}else{_0x57f856[_0x50ff('0x13')]({'type':_0x57a6e7[_0x50ff('0x10')],'app':_0x50ff('0x17'),'appdata':_0x50ff('0x37'),'context':_0x57a6e7['context'],'exten':_0x57a6e7[_0x50ff('0x7')],'priority':_0x2d7867['length']+_0x3313d6[_0x50ff('0xa')]+_0x574a3e++,'VoiceExtensionId':_0x57a6e7[_0x50ff('0x12')]});_0x57f856[_0x50ff('0x13')]({'type':_0x57a6e7[_0x50ff('0x10')],'app':_0x50ff('0xe'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x57a6e7[_0x50ff('0x11')],'exten':_0x57a6e7[_0x50ff('0x7')],'priority':_0x2d7867[_0x50ff('0x23')]+_0x3313d6[_0x50ff('0xa')]+_0x574a3e++,'VoiceExtensionId':_0x57a6e7[_0x50ff('0x12')]});}}}for(var _0x3e6372=0x0;_0x3e6372<_0x2d7867[_0x50ff('0x23')];_0x3e6372+=0x1){var _0x429751=_0x3313d6[_0x50ff('0xa')]+_0x2d7867[_0x50ff('0x23')];var _0x5d3830=_0x3e6372===_0x2d7867[_0x50ff('0x23')]-0x1?_0x3313d6[_0x50ff('0xa')]+_0x57f856['length']+_0x324938['length']+0x2:_0x3313d6[_0x50ff('0xa')]+_0x3e6372+0x1;_0x57f856[_0x50ff('0x38')](_0x3e6372,0x0,{'type':_0x57a6e7['type'],'app':'GotoIfTime','appdata':_0x2d7867[_0x3e6372]+'?'+_0x57a6e7['context']+_0x50ff('0x39')+_0x429751+':'+_0x57a6e7[_0x50ff('0x11')]+_0x50ff('0x39')+_0x5d3830,'exten':_0x57a6e7['exten'],'context':_0x57a6e7[_0x50ff('0x11')],'priority':_0x3313d6[_0x50ff('0xa')]+_0x3e6372,'VoiceExtensionId':_0x46a432[_0x51a30e][0x0][_0x50ff('0x12')]});}_0x57a6e7[_0x50ff('0xa')]=_0x57f856[_0x50ff('0x23')]?_[_0x50ff('0x3a')](_0x57f856)[_0x50ff('0xa')]+0x1:_0x3313d6[_0x50ff('0xa')];_0x3313d6[_0x50ff('0xa')]=(_0x324938[_0x50ff('0x23')]?_[_0x50ff('0x3a')](_0x324938)[_0x50ff('0xa')]:_0x57a6e7[_0x50ff('0xa')])+0x1;_0x3313d6[_0x50ff('0xd')]=_[_0x50ff('0x3b')](_0x3313d6[_0x50ff('0xd')],_0x57f856,[_0x57a6e7],_0x324938);}_0x3313d6[_0x50ff('0xd')][_0x50ff('0x13')]({'type':_0x46a432[_0x51a30e][0x0]['type'],'app':_0x50ff('0x3c'),'exten':_0x46a432[_0x51a30e][0x0][_0x50ff('0x7')],'context':_0x46a432[_0x51a30e][0x0][_0x50ff('0x11')],'priority':_0x3313d6[_0x50ff('0xa')],'VoiceExtensionId':_0x46a432[_0x51a30e][0x0][_0x50ff('0x12')]});_0x372c97[_0x50ff('0x13')](_0x46a432[_0x51a30e][0x0][_0x50ff('0x12')]);_0x450c82=_[_0x50ff('0x3b')](_0x450c82,_0x3313d6[_0x50ff('0xd')]);}}return _0x169300['transaction'](function(_0x1c3134){return _0x169300[_0x50ff('0x1')]['VoiceExtension'][_0x50ff('0x3d')]({'where':{'VoiceExtensionId':{'$in':_0x372c97}},'transaction':_0x1c3134})['then'](function(_0x5d0127){return _0x169300[_0x50ff('0x1')][_0x50ff('0x4')][_0x50ff('0x3e')](_[_0x50ff('0x3f')](_0x450c82,_0x50ff('0xa')),{'transaction':_0x1c3134});});});})['catch'](function(_0x299d6c){console['error'](_0x299d6c);});}exports[_0x50ff('0x40')]=rewrite; \ No newline at end of file +var _0x01e7=['intervals','VoiceExtension','findAll','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','priority','extensions','extension','find','push','type','Set','CDR(type)=%s','context','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN:','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','appType','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','transaction','destroy','sortBy','catch','rewrite','lodash','models','Interval','then'];(function(_0x9c8b4a,_0x2387ff){var _0x198bef=function(_0x2eb4e8){while(--_0x2eb4e8){_0x9c8b4a['push'](_0x9c8b4a['shift']());}};_0x198bef(++_0x2387ff);}(_0x01e7,0xc5));var _0x701e=function(_0xe0ea0c,_0x5dc1d9){_0xe0ea0c=_0xe0ea0c-0x0;var _0x46ff13=_0x01e7[_0xe0ea0c];return _0x46ff13;};'use strict';var _=require(_0x701e('0x0'));var util=require('util');function rewrite(_0x33f438,_0x14d4a5){var _0x26a823=this;return _0x33f438[_0x701e('0x1')][_0x701e('0x2')]['findAll']({'raw':!![]})[_0x701e('0x3')](function(_0x35eeef){_0x26a823[_0x701e('0x4')]=_0x35eeef;return _0x33f438[_0x701e('0x1')][_0x701e('0x5')][_0x701e('0x6')]({'where':{'IntervalId':_0x14d4a5[_0x701e('0x7')]},'raw':!![]});})['then'](function(_0x57c578){return _0x33f438[_0x701e('0x1')][_0x701e('0x5')][_0x701e('0x6')]({'where':{'exten':{'$in':_[_0x701e('0x8')](_[_0x701e('0x9')](_0x57c578,_0x701e('0xa')))}},'order':[{'raw':_0x701e('0xb')}],'raw':!![]});})[_0x701e('0x3')](function(_0x13f809){var _0x3cd380=_[_0x701e('0xc')](_0x13f809,{'priority':'1'});var _0x4e21c7=_[_0x701e('0xc')](_0x13f809,{'isApp':0x1});var _0x36415d=_[_0x701e('0xd')](_0x4e21c7,'exten');var _0x338e44=[_0x701e('0xe'),'playback'];var _0x6a3155=[];var _0x87298a=[];for(var _0x1beb29 in _0x36415d){if(_0x36415d['hasOwnProperty'](_0x1beb29)){_0x26a823[_0x701e('0xf')]=0x2;_0x26a823[_0x701e('0x10')]=[];_0x26a823[_0x701e('0x11')]=_[_0x701e('0x12')](_0x3cd380,{'exten':_0x36415d[_0x1beb29][0x0][_0x701e('0xa')]});_0x26a823[_0x701e('0x10')][_0x701e('0x13')]({'type':_0x36415d[_0x1beb29][0x0][_0x701e('0x14')],'app':_0x701e('0x15'),'appdata':util['format'](_0x701e('0x16'),_0x36415d[_0x1beb29][0x0][_0x701e('0x14')]),'context':_0x36415d[_0x1beb29][0x0][_0x701e('0x17')],'exten':_0x36415d[_0x1beb29][0x0][_0x701e('0xa')],'priority':_0x26a823['priority']++,'VoiceExtensionId':_0x36415d[_0x1beb29][0x0][_0x701e('0x18')]});if(_0x36415d[_0x1beb29][0x0][_0x701e('0x14')]===_0x701e('0x19')){if(_0x26a823[_0x701e('0x11')]){_0x26a823[_0x701e('0x10')][_0x701e('0x13')]({'type':_0x36415d[_0x1beb29][0x0][_0x701e('0x14')],'app':_0x701e('0x15'),'appdata':_0x701e('0x1a')+(_0x26a823[_0x701e('0x11')][_0x701e('0x1b')]?_0x701e('0x1c')+_0x26a823[_0x701e('0x11')][_0x701e('0x1b')]+'}':'${EXTEN}'),'context':_0x36415d[_0x1beb29][0x0][_0x701e('0x17')],'exten':_0x36415d[_0x1beb29][0x0][_0x701e('0xa')],'priority':_0x26a823[_0x701e('0xf')]++,'VoiceExtensionId':_0x36415d[_0x1beb29][0x0][_0x701e('0x18')]});}_0x26a823[_0x701e('0x10')][_0x701e('0x13')]({'type':_0x36415d[_0x1beb29][0x0][_0x701e('0x14')],'app':'Set','appdata':_0x701e('0x1d')+_0x36415d[_0x1beb29][0x0][_0x701e('0x18')],'context':_0x36415d[_0x1beb29][0x0][_0x701e('0x17')],'exten':_0x36415d[_0x1beb29][0x0][_0x701e('0xa')],'priority':_0x26a823[_0x701e('0xf')]++,'VoiceExtensionId':_0x36415d[_0x1beb29][0x0][_0x701e('0x18')]});var _0x57899c=_0x26a823['priority']++;_0x26a823[_0x701e('0x10')][_0x701e('0x13')]({'type':_0x36415d[_0x1beb29][0x0]['type'],'app':_0x701e('0x1e'),'appdata':_0x701e('0x1f')+(_0x57899c+0x2)+_0x701e('0x20')+(_0x57899c+0x1)+')','context':_0x36415d[_0x1beb29][0x0][_0x701e('0x17')],'exten':_0x36415d[_0x1beb29][0x0][_0x701e('0xa')],'priority':_0x57899c,'VoiceExtensionId':_0x36415d[_0x1beb29][0x0][_0x701e('0x18')]});if(_0x26a823[_0x701e('0x11')]){_0x26a823[_0x701e('0x10')]['push']({'type':_0x36415d[_0x1beb29][0x0][_0x701e('0x14')],'app':_0x701e('0x15'),'appdata':_0x26a823[_0x701e('0x11')][_0x701e('0x1b')]?'CDR(prefix)=${EXTEN:0:'+_0x26a823['extension'][_0x701e('0x1b')]+'}':_0x701e('0x21'),'context':_0x36415d[_0x1beb29][0x0][_0x701e('0x17')],'exten':_0x36415d[_0x1beb29][0x0]['exten'],'priority':_0x26a823[_0x701e('0xf')]++,'VoiceExtensionId':_0x36415d[_0x1beb29][0x0][_0x701e('0x18')]});}_0x26a823['extensions']['push']({'type':_0x36415d[_0x1beb29][0x0][_0x701e('0x14')],'app':_0x701e('0x15'),'appdata':_0x701e('0x22')+_0x36415d[_0x1beb29][0x0]['VoiceExtensionId'],'context':_0x36415d[_0x1beb29][0x0][_0x701e('0x17')],'exten':_0x36415d[_0x1beb29][0x0][_0x701e('0xa')],'priority':_0x26a823[_0x701e('0xf')]++,'VoiceExtensionId':_0x36415d[_0x1beb29][0x0]['VoiceExtensionId']});if(_0x26a823['extension']&&_0x26a823[_0x701e('0x11')][_0x701e('0x23')]('recordingFormat')&&_0x26a823['extension'][_0x701e('0x24')]!==_0x701e('0x25')){_0x26a823[_0x701e('0x10')]['push']({'type':_0x36415d[_0x1beb29][0x0][_0x701e('0x14')],'app':'Set','appdata':_0x701e('0x26'),'context':_0x36415d[_0x1beb29][0x0][_0x701e('0x17')],'exten':_0x36415d[_0x1beb29][0x0][_0x701e('0xa')],'priority':_0x26a823['priority']++,'VoiceExtensionId':_0x36415d[_0x1beb29][0x0][_0x701e('0x18')]});_0x26a823[_0x701e('0x10')][_0x701e('0x13')]({'type':_0x36415d[_0x1beb29][0x0][_0x701e('0x14')],'app':_0x701e('0x15'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x26a823[_0x701e('0x11')][_0x701e('0x24')]||'wav','context':_0x36415d[_0x1beb29][0x0]['context'],'exten':_0x36415d[_0x1beb29][0x0][_0x701e('0xa')],'priority':_0x26a823[_0x701e('0xf')]++,'VoiceExtensionId':_0x36415d[_0x1beb29][0x0][_0x701e('0x18')]});}}_0x26a823[_0x701e('0x10')][_0x701e('0x13')]({'type':_0x36415d[_0x1beb29][0x0][_0x701e('0x14')],'app':'Set','appdata':_0x701e('0x27'),'context':_0x36415d[_0x1beb29][0x0]['context'],'exten':_0x36415d[_0x1beb29][0x0][_0x701e('0xa')],'priority':_0x26a823[_0x701e('0xf')]++,'VoiceExtensionId':_0x36415d[_0x1beb29][0x0][_0x701e('0x18')]});_0x26a823['extensions']['push']({'type':_0x36415d[_0x1beb29][0x0][_0x701e('0x14')],'app':_0x701e('0x15'),'appdata':_0x701e('0x28'),'context':_0x36415d[_0x1beb29][0x0][_0x701e('0x17')],'exten':_0x36415d[_0x1beb29][0x0][_0x701e('0xa')],'priority':_0x26a823['priority']++,'VoiceExtensionId':_0x36415d[_0x1beb29][0x0]['VoiceExtensionId']});_0x26a823[_0x701e('0x10')]['push']({'type':_0x36415d[_0x1beb29][0x0][_0x701e('0x14')],'app':'Set','appdata':_0x701e('0x29'),'context':_0x36415d[_0x1beb29][0x0][_0x701e('0x17')],'exten':_0x36415d[_0x1beb29][0x0][_0x701e('0xa')],'priority':_0x26a823[_0x701e('0xf')]++,'VoiceExtensionId':_0x36415d[_0x1beb29][0x0]['VoiceExtensionId']});for(var _0x55fbf1=0x0,_0x12ae00=0x0;_0x55fbf1<_0x36415d[_0x1beb29][_0x701e('0x2a')];_0x55fbf1+=0x1,_0x12ae00=0x0){var _0x2e1348=_0x36415d[_0x1beb29][_0x55fbf1];if(_0x2e1348['type']){_0x2e1348[_0x701e('0x14')]=_0x2e1348[_0x701e('0x14')][_0x701e('0x2b')]();}var _0x208a36=[];var _0x28acdc=[];delete _0x2e1348['id'];delete _0x2e1348['createdAt'];delete _0x2e1348[_0x701e('0x2c')];var _0xc230bb=_0x2e1348[_0x701e('0x2d')]!==_0x701e('0x2e')?[_0x2e1348[_0x701e('0x2d')]]:_0x2e1348[_0x701e('0x7')]?_[_0x701e('0x9')](_[_0x701e('0xc')](_0x26a823[_0x701e('0x4')],{'IntervalId':_0x2e1348[_0x701e('0x7')]}),_0x701e('0x2d')):[];if(_0x2e1348[_0x701e('0x23')]('tag')){if(_0x2e1348[_0x701e('0x2f')]&&_0x2e1348[_0x701e('0x2f')]!=='--'){_0x208a36[_0x701e('0x13')]({'type':_0x2e1348[_0x701e('0x14')],'app':_0x701e('0x15'),'appdata':_0x701e('0x30')+_0x2e1348[_0x701e('0x2f')],'context':_0x2e1348['context'],'exten':_0x2e1348['exten'],'priority':_0xc230bb[_0x701e('0x2a')]+_0x26a823[_0x701e('0xf')]+_0x12ae00++,'VoiceExtensionId':_0x2e1348[_0x701e('0x18')]});}}if(_0x2e1348[_0x701e('0x14')]===_0x701e('0x19')&&_0x2e1348[_0x701e('0x23')](_0x701e('0x31'))){if(_0x2e1348[_0x701e('0x31')]){_0x208a36[_0x701e('0x13')]({'type':_0x2e1348[_0x701e('0x14')],'app':_0x701e('0x1e'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x2e1348[_0x701e('0x31')]+')','context':_0x2e1348[_0x701e('0x17')],'exten':_0x2e1348[_0x701e('0xa')],'priority':_0xc230bb['length']+_0x26a823['priority']+_0x12ae00++,'VoiceExtensionId':_0x2e1348[_0x701e('0x18')]});}else{_0x208a36['push']({'type':_0x2e1348[_0x701e('0x14')],'app':_0x701e('0x1e'),'appdata':_0x701e('0x32'),'context':_0x2e1348[_0x701e('0x17')],'exten':_0x2e1348['exten'],'priority':_0xc230bb[_0x701e('0x2a')]+_0x26a823['priority']+_0x12ae00++,'VoiceExtensionId':_0x2e1348['VoiceExtensionId']});}}if(_0x2e1348[_0x701e('0x23')]('answer')){if(_0x338e44[_0x701e('0x33')](_0x2e1348['app'][_0x701e('0x2b')]())>=0x0&&_0x2e1348[_0x701e('0x34')]!=='custom'){if(_0x2e1348[_0x701e('0x35')]){_0x208a36['push']({'type':_0x2e1348['type'],'app':_0x701e('0x1e'),'appdata':_0x701e('0x36'),'context':_0x2e1348['context'],'exten':_0x2e1348[_0x701e('0xa')],'priority':_0xc230bb[_0x701e('0x2a')]+_0x26a823[_0x701e('0xf')]+_0x12ae00++,'VoiceExtensionId':_0x2e1348[_0x701e('0x18')]});_0x208a36['push']({'type':_0x2e1348[_0x701e('0x14')],'app':_0x701e('0x15'),'appdata':_0x701e('0x37'),'context':_0x2e1348[_0x701e('0x17')],'exten':_0x2e1348[_0x701e('0xa')],'priority':_0xc230bb[_0x701e('0x2a')]+_0x26a823['priority']+_0x12ae00++,'VoiceExtensionId':_0x2e1348['VoiceExtensionId']});}else{_0x208a36[_0x701e('0x13')]({'type':_0x2e1348[_0x701e('0x14')],'app':'ExecIf','appdata':_0x701e('0x38'),'context':_0x2e1348[_0x701e('0x17')],'exten':_0x2e1348[_0x701e('0xa')],'priority':_0xc230bb[_0x701e('0x2a')]+_0x26a823['priority']+_0x12ae00++,'VoiceExtensionId':_0x2e1348[_0x701e('0x18')]});_0x208a36[_0x701e('0x13')]({'type':_0x2e1348['type'],'app':_0x701e('0x15'),'appdata':_0x701e('0x39'),'context':_0x2e1348[_0x701e('0x17')],'exten':_0x2e1348[_0x701e('0xa')],'priority':_0xc230bb[_0x701e('0x2a')]+_0x26a823[_0x701e('0xf')]+_0x12ae00++,'VoiceExtensionId':_0x2e1348['VoiceExtensionId']});}}}for(var _0x18d023=0x0;_0x18d023<_0xc230bb[_0x701e('0x2a')];_0x18d023+=0x1){var _0x1dd06=_0x26a823['priority']+_0xc230bb[_0x701e('0x2a')];var _0x1d6b40=_0x18d023===_0xc230bb['length']-0x1?_0x26a823[_0x701e('0xf')]+_0x208a36['length']+_0x28acdc[_0x701e('0x2a')]+0x2:_0x26a823['priority']+_0x18d023+0x1;_0x208a36[_0x701e('0x3a')](_0x18d023,0x0,{'type':_0x2e1348[_0x701e('0x14')],'app':'GotoIfTime','appdata':_0xc230bb[_0x18d023]+'?'+_0x2e1348[_0x701e('0x17')]+',${EXTEN},'+_0x1dd06+':'+_0x2e1348[_0x701e('0x17')]+_0x701e('0x3b')+_0x1d6b40,'exten':_0x2e1348[_0x701e('0xa')],'context':_0x2e1348[_0x701e('0x17')],'priority':_0x26a823['priority']+_0x18d023,'VoiceExtensionId':_0x36415d[_0x1beb29][0x0]['VoiceExtensionId']});}_0x2e1348[_0x701e('0xf')]=_0x208a36[_0x701e('0x2a')]?_[_0x701e('0x3c')](_0x208a36)[_0x701e('0xf')]+0x1:_0x26a823['priority'];_0x26a823[_0x701e('0xf')]=(_0x28acdc[_0x701e('0x2a')]?_[_0x701e('0x3c')](_0x28acdc)[_0x701e('0xf')]:_0x2e1348[_0x701e('0xf')])+0x1;_0x26a823['extensions']=_[_0x701e('0x3d')](_0x26a823[_0x701e('0x10')],_0x208a36,[_0x2e1348],_0x28acdc);}_0x26a823[_0x701e('0x10')][_0x701e('0x13')]({'type':_0x36415d[_0x1beb29][0x0]['type'],'app':'Hangup','exten':_0x36415d[_0x1beb29][0x0]['exten'],'context':_0x36415d[_0x1beb29][0x0][_0x701e('0x17')],'priority':_0x26a823[_0x701e('0xf')],'VoiceExtensionId':_0x36415d[_0x1beb29][0x0]['VoiceExtensionId']});_0x6a3155[_0x701e('0x13')](_0x36415d[_0x1beb29][0x0][_0x701e('0x18')]);_0x87298a=_['concat'](_0x87298a,_0x26a823[_0x701e('0x10')]);}}return _0x33f438[_0x701e('0x3e')](function(_0x1f4abe){return _0x33f438['models'][_0x701e('0x5')][_0x701e('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x6a3155}},'transaction':_0x1f4abe})[_0x701e('0x3')](function(_0x4628d8){return _0x33f438[_0x701e('0x1')][_0x701e('0x5')]['bulkCreate'](_[_0x701e('0x40')](_0x87298a,_0x701e('0xf')),{'transaction':_0x1f4abe});});});})[_0x701e('0x41')](function(_0x2ec41d){console['error'](_0x2ec41d);});}exports[_0x701e('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 b216237..eda689d 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 _0x900a=['cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','defaults','redis','localhost','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','message','join','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','then','push','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','insert','into','cm_hopper','createdAt','updatedAt','select','field','NOW()','ContactId','toString','cm_contacts','where','\x20=\x20?','scheduledAt','from','deletedAt\x20IS\x20NULL','str','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','calleridnum','fromQuery','ListId\x20=\x20?','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','get','always','sequelize','query','VoiceQueueId','catch','onlyIfOpen','CmList','BlackLists','Campaign','CampaignId','all'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x900a,0x164));var _0xa900=function(_0xa11b63,_0x2961d5){_0xa11b63=_0xa11b63-0x0;var _0x53e2d2=_0x900a[_0xa11b63];return _0x53e2d2;};'use strict';var BPromise=require(_0xa900('0x0'));var util=require('util');var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0xa900('0x1'));var Redis=require(_0xa900('0x2'));var db=require(_0xa900('0x3'))['db'];var config=require(_0xa900('0x4'));var logger=require(_0xa900('0x5'))(_0xa900('0x6'));config['redis']=_[_0xa900('0x7')](config[_0xa900('0x8')],{'host':_0xa900('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa900('0x8')]));require('../../../api/cmContact/cmContact.socket')[_0xa900('0xa')](socket);try{if(!process[_0xa900('0xb')][0x2]||process[_0xa900('0xb')][0x2]===_0xa900('0xc')||process[_0xa900('0xb')][0x2]===_0xa900('0xd')){throw new Error(_0xa900('0xe'));}var FILEPATH=process[_0xa900('0xb')][0x2];if(!process[_0xa900('0xb')][0x3]||process['argv'][0x3]===_0xa900('0xc')||process[_0xa900('0xb')][0x3]===_0xa900('0xd')||!process[_0xa900('0xb')][0x4]||process[_0xa900('0xb')][0x4]===_0xa900('0xc')||process[_0xa900('0xb')][0x4]===_0xa900('0xd')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xa900('0xf')](process['argv'][0x3][_0xa900('0x10')](','),process[_0xa900('0xb')][0x4][_0xa900('0x10')](','));if(!process[_0xa900('0xb')][0x5]||process['argv'][0x5]===_0xa900('0xc')||process[_0xa900('0xb')][0x5]==='null'){throw new Error(_0xa900('0x11'));}var LISTID=process[_0xa900('0xb')][0x5];var COMPANYID=process[_0xa900('0xb')][0x6]&&process[_0xa900('0xb')][0x6]!=='undefined'&&process['argv'][0x6]!=='null'?process[_0xa900('0xb')][0x6]:null;var DUPLICATES=process[_0xa900('0xb')][0x7]&&process['argv'][0x7]!==_0xa900('0xc')&&process[_0xa900('0xb')][0x7]!=='null'?process[_0xa900('0xb')][0x7]:null;if(!process[_0xa900('0xb')][0x8]||process[_0xa900('0xb')][0x8]===_0xa900('0xc')||process[_0xa900('0xb')][0x8]===_0xa900('0xd')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0xa900('0xb')][0x8];}catch(_0x4b4c56){logger[_0xa900('0x12')](_0x4b4c56);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(_0x3cd361,_0x27081a,_0x3a2467,_0x4dfc6a){var _0x495406={'message':_0x27081a};_0x495406[_0x3cd361]=!![];if(_0x3a2467){_0x495406[_0xa900('0x13')]=_0x3a2467;}if(_0x4dfc6a){_0x495406[_0xa900('0x14')]=_0x4dfc6a;}return _0x495406;}function isEmail(_0x4bf514){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))*$/[_0xa900('0x15')](_0x4bf514);}function checkRow(_0x2f226e,_0x3f3f7a,_0x5b9411){return new BPromise(function(_0xacc95a,_0x4ba3fc){if(_[_0xa900('0x16')](_0x2f226e)){return _0x4ba3fc(handleCheckRowError(_0xa900('0x12'),_0xa900('0x17'),null,_0x5b9411));}if(_0x2f226e[_0xa900('0x18')]&&_0x2f226e[_0xa900('0x18')]['length']){var _0x4bfcef=_['map'](_0x2f226e[_0xa900('0x18')],_0xa900('0x19'))[_0xa900('0x1a')](';');return _0x4ba3fc(handleCheckRowError(_0xa900('0x12'),_0x4bfcef,null,_0x5b9411));}var _0x3dccaa={};for(var _0x4c3197 in FIELDS){if(FIELDS['hasOwnProperty'](_0x4c3197)&&FIELDS[_0x4c3197]){_0x3dccaa[_0x4c3197]=_0x2f226e[_0xa900('0x1b')][0x0][FIELDS[_0x4c3197]]||_0x2f226e[_0xa900('0x1b')][0x0]['\ufeff'+FIELDS[_0x4c3197]];}}if(!_0x3dccaa[_0xa900('0x1c')]){return _0x4ba3fc(handleCheckRowError(_0xa900('0x12'),_0xa900('0x1d'),null,_0x5b9411));}if(!_0x3dccaa[_0xa900('0x1e')]){return _0x4ba3fc(handleCheckRowError('error','phone\x20not\x20specified!',null,_0x5b9411));}if(_0x3dccaa[_0xa900('0x1f')]){var _0x25a7ea=moment(_0x3dccaa[_0xa900('0x1f')],_0xa900('0x20'));if(!_0x25a7ea[_0xa900('0x21')]()){return _0x4ba3fc(handleCheckRowError(_0xa900('0x12'),_0xa900('0x22'),null,_0x5b9411));}}if(_0x3dccaa[_0xa900('0x23')]){if(!isEmail(_0x3dccaa[_0xa900('0x23')])){return _0x4ba3fc(handleCheckRowError(_0xa900('0x12'),_0xa900('0x24'),null,_0x5b9411));}}_0x3dccaa[_0xa900('0x25')]=LISTID;_0x3dccaa[_0xa900('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xa900('0x27')]&&_0x3f3f7a){var _0x5d75c5={};for(var _0x35e5e9=0x0,_0x5becbf=DUPLICATES[_0xa900('0x27')];_0x35e5e9<_0x5becbf;_0x35e5e9+=0x1){_0x5d75c5[DUPLICATES[_0x35e5e9]]=_0x3dccaa[DUPLICATES[_0x35e5e9]];}var _0x183eb8=_[_0xa900('0x28')](_0x3f3f7a,_0x5d75c5);if(_0x183eb8){return _0x4ba3fc(handleCheckRowError(_0xa900('0x29'),_0xa900('0x2a'),_0x183eb8,_0x5b9411));}}return db[_0xa900('0x2b')][_0xa900('0x2c')](_0x3dccaa,{'raw':!![],'hooks':![],'fields':_['keys'](_0x3dccaa)})[_0xa900('0x2d')](function(_0x5c5b67){if(DUPLICATES&&DUPLICATES[_0xa900('0x27')]&&_0x3f3f7a){_0x3f3f7a[_0xa900('0x2e')](_['pick'](_0x3dccaa,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5c5b67['id'];return _0xacc95a();})['catch'](function(_0x1b9048){return _0x4ba3fc(handleCheckRowError('error',_0xa900('0x2f')+(_0x1b9048[_0xa900('0x19')]||JSON[_0xa900('0x30')](_0x1b9048)),null,_0x5b9411));});});}function checkHopper(){function _0x45fa33(){return function(_0x282800){logger['error'](_0xa900('0x31'),_0xa900('0x32'),util['inspect'](_0x282800,{'showHidden':![],'depth':null}));};}var _0x312a8d=function(_0x2e6c0a,_0x1e2fcc){var _0x23bb94=squel[_0xa900('0x33')]()[_0xa900('0x34')](_0xa900('0x35'))['fromQuery']([_0xa900('0x1e'),'scheduledAt','ContactId',_0xa900('0x25'),_0x1e2fcc,_0xa900('0x36'),_0xa900('0x37')],squel[_0xa900('0x38')]()[_0xa900('0x39')](_0xa900('0x1e'),'phone')['field'](_0xa900('0x3a'),'scheduledAt')['field']('id',_0xa900('0x3b'))[_0xa900('0x39')](LISTID[_0xa900('0x3c')](),_0xa900('0x25'))[_0xa900('0x39')](_0x2e6c0a['id']['toString'](),_0x1e2fcc)[_0xa900('0x39')]('NOW()',_0xa900('0x36'))[_0xa900('0x39')](_0xa900('0x3a'),_0xa900('0x37'))['from'](_0xa900('0x3d'))['where']('deletedAt\x20IS\x20NULL')[_0xa900('0x3e')]('ListId\x20=\x20?',LISTID[_0xa900('0x3c')]())[_0xa900('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0xa900('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa900('0x38')]()[_0xa900('0x39')]('phone')['from'](_0xa900('0x35'))[_0xa900('0x3e')](_0x1e2fcc+_0xa900('0x3f'),_0x2e6c0a['id'][_0xa900('0x3c')]())))[_0xa900('0x3c')]();return _0x23bb94;};var _0x2dc4f8=function(_0x1929f7,_0x16468b){var _0x453ef5=squel[_0xa900('0x33')]()['into'](_0xa900('0x35'))['fromQuery']([_0xa900('0x1e'),_0xa900('0x40'),_0xa900('0x3b'),_0xa900('0x25'),_0x16468b,'createdAt','updatedAt'],squel['select']()[_0xa900('0x39')](_0xa900('0x1e'),_0xa900('0x1e'))[_0xa900('0x39')]('NOW()',_0xa900('0x40'))[_0xa900('0x39')]('id',_0xa900('0x3b'))['field'](LISTID[_0xa900('0x3c')](),_0xa900('0x25'))['field'](_0x1929f7['id'][_0xa900('0x3c')](),_0x16468b)[_0xa900('0x39')]('NOW()',_0xa900('0x36'))[_0xa900('0x39')]('NOW()',_0xa900('0x37'))[_0xa900('0x41')]('cm_contacts')['where'](_0xa900('0x42'))['where']('ListId\x20=\x20?',LISTID[_0xa900('0x3c')]())[_0xa900('0x3e')]('id\x20IN\x20?',squel[_0xa900('0x43')](hopperContacts))[_0xa900('0x3e')](_0xa900('0x44'))[_0xa900('0x3e')](_0xa900('0x45'),squel[_0xa900('0x38')]()[_0xa900('0x39')](_0xa900('0x46'))[_0xa900('0x41')]('cm_hopper_final')[_0xa900('0x3e')](_0x16468b+_0xa900('0x3f'),_0x1929f7['id']['toString']()))[_0xa900('0x3e')](_0xa900('0x45'),squel[_0xa900('0x38')]()[_0xa900('0x39')](_0xa900('0x1e'))['from'](_0xa900('0x35'))[_0xa900('0x3e')](_0x16468b+_0xa900('0x3f'),_0x1929f7['id'][_0xa900('0x3c')]())))[_0xa900('0x3c')]();return _0x453ef5;};function _0x1c2926(_0x23be37,_0x55a188){var _0x58fa6b=squel[_0xa900('0x33')]()['into'](_0xa900('0x35'))[_0xa900('0x47')](['phone',_0xa900('0x40'),'ContactId','ListId',_0x55a188,'createdAt',_0xa900('0x37')],squel[_0xa900('0x38')]()['field']('phone',_0xa900('0x1e'))[_0xa900('0x39')](_0xa900('0x3a'),'scheduledAt')[_0xa900('0x39')]('id',_0xa900('0x3b'))['field'](LISTID[_0xa900('0x3c')](),'ListId')[_0xa900('0x39')](_0x23be37['id'][_0xa900('0x3c')](),_0x55a188)['field'](_0xa900('0x3a'),_0xa900('0x36'))['field'](_0xa900('0x3a'),_0xa900('0x37'))[_0xa900('0x41')](_0xa900('0x3d'))[_0xa900('0x3e')]('deletedAt\x20IS\x20NULL')[_0xa900('0x3e')](_0xa900('0x48'),LISTID[_0xa900('0x3c')]())[_0xa900('0x3e')](_0xa900('0x49'),squel[_0xa900('0x43')](hopperContacts))[_0xa900('0x3e')]('phone\x20IS\x20NOT\x20NULL'))[_0xa900('0x3c')]();return _0x58fa6b;}function _0x6cf550(_0x2cdf59,_0xa0bee6){var _0x1a4876=squel['insert']()[_0xa900('0x34')](_0xa900('0x4a'))['fromQuery']([_0xa900('0x1e'),'ContactId',_0xa900('0x25'),_0xa0bee6,_0xa900('0x36'),'updatedAt'],squel[_0xa900('0x38')]()[_0xa900('0x39')](_0xa900('0x1e'),_0xa900('0x1e'))['field']('id','ContactId')['field'](LISTID[_0xa900('0x3c')](),_0xa900('0x25'))[_0xa900('0x39')](_0x2cdf59['id'][_0xa900('0x3c')](),_0xa0bee6)[_0xa900('0x39')](_0xa900('0x3a'),_0xa900('0x36'))[_0xa900('0x39')](_0xa900('0x3a'),_0xa900('0x37'))[_0xa900('0x41')](_0xa900('0x3d'))[_0xa900('0x3e')](_0xa900('0x42'))['where'](_0xa900('0x48'),LISTID[_0xa900('0x3c')]())[_0xa900('0x3e')](_0xa900('0x49'),squel[_0xa900('0x43')](hopperContacts))[_0xa900('0x3e')](_0xa900('0x44')))[_0xa900('0x3c')]();return _0x1a4876;}return db[_0xa900('0x4b')][_0xa900('0x4c')]({'where':{'type':_0xa900('0x4d')},'attributes':['id',_0xa900('0x4e')],'include':[{'model':db['CmList'],'as':_0xa900('0x4f'),'where':{'id':LISTID}}]})[_0xa900('0x2d')](function(_0x31f22d){var _0x19c892=[];if(_0x31f22d){var _0x1da777;for(var _0xe0de62=0x0,_0x2154dd;_0xe0de62<_0x31f22d['length'];_0xe0de62+=0x1){_0x2154dd=_0x31f22d[_0xe0de62][_0xa900('0x50')]({'plain':!![]});switch(_0x2154dd[_0xa900('0x4e')]){case _0xa900('0x51'):_0x19c892['push'](db[_0xa900('0x52')][_0xa900('0x53')](_0x2dc4f8(_0x2154dd,_0xa900('0x54')))['then'](function(){})[_0xa900('0x55')](_0x45fa33()));break;case _0xa900('0x56'):_0x19c892[_0xa900('0x2e')](db[_0xa900('0x52')][_0xa900('0x53')](_0x312a8d(_0x2154dd,_0xa900('0x54')))['then'](function(){})[_0xa900('0x55')](_0x45fa33()));break;default:_0x19c892[_0xa900('0x2e')](db['sequelize'][_0xa900('0x53')](_0x1c2926(_0x2154dd,_0xa900('0x54')))['then'](function(){})[_0xa900('0x55')](_0x45fa33()));}}}return _0x19c892;})['all']()[_0xa900('0x2d')](function(){return db[_0xa900('0x4b')][_0xa900('0x4c')]({'where':{'type':_0xa900('0x4d')},'attributes':['id'],'include':[{'model':db[_0xa900('0x57')],'as':_0xa900('0x58'),'where':{'id':LISTID}}]})[_0xa900('0x2d')](function(_0xe3aa96){var _0x517bd6=[];if(_0xe3aa96){var _0x58b51c;for(var _0x945c4e=0x0,_0x4f4e5e;_0x945c4e<_0xe3aa96[_0xa900('0x27')];_0x945c4e+=0x1){_0x4f4e5e=_0xe3aa96[_0x945c4e][_0xa900('0x50')]({'plain':!![]});_0x517bd6[_0xa900('0x2e')](db[_0xa900('0x52')][_0xa900('0x53')](_0x6cf550(_0x4f4e5e,_0xa900('0x54')))[_0xa900('0x2d')](function(){})[_0xa900('0x55')](_0x45fa33()));}}return _0x517bd6;})['all']();})[_0xa900('0x2d')](function(){return db[_0xa900('0x59')][_0xa900('0x4c')]({'attributes':['id',_0xa900('0x4e')],'include':[{'model':db[_0xa900('0x57')],'as':_0xa900('0x4f'),'where':{'id':LISTID}}]})[_0xa900('0x2d')](function(_0x25309f){var _0x160340=[];if(_0x25309f){for(var _0x3b48bf=0x0,_0x179e01;_0x3b48bf<_0x25309f[_0xa900('0x27')];_0x3b48bf+=0x1){_0x179e01=_0x25309f[_0x3b48bf][_0xa900('0x50')]({'plain':!![]});switch(_0x179e01['dialCheckDuplicateType']){case _0xa900('0x51'):_0x160340[_0xa900('0x2e')](db[_0xa900('0x52')]['query'](_0x2dc4f8(_0x179e01,_0xa900('0x5a')))[_0xa900('0x2d')](function(){})[_0xa900('0x55')](_0x45fa33()));break;case _0xa900('0x56'):_0x160340['push'](db['sequelize'][_0xa900('0x53')](_0x312a8d(_0x179e01,'CampaignId'))[_0xa900('0x2d')](function(){})[_0xa900('0x55')](_0x45fa33()));break;default:_0x160340['push'](db[_0xa900('0x52')][_0xa900('0x53')](_0x1c2926(_0x179e01,'CampaignId'))[_0xa900('0x2d')](function(){})[_0xa900('0x55')](_0x45fa33()));}}}return _0x160340;})[_0xa900('0x5b')]();})[_0xa900('0x2d')](function(){return db[_0xa900('0x59')][_0xa900('0x4c')]({'attributes':['id'],'include':[{'model':db[_0xa900('0x57')],'as':_0xa900('0x58'),'where':{'id':LISTID}}]})[_0xa900('0x2d')](function(_0x289231){var _0x466248=[];if(_0x289231){for(var _0x2ab4e1=0x0,_0x3a9f67;_0x2ab4e1<_0x289231['length'];_0x2ab4e1+=0x1){_0x3a9f67=_0x289231[_0x2ab4e1][_0xa900('0x50')]({'plain':!![]});_0x466248[_0xa900('0x2e')](db[_0xa900('0x52')][_0xa900('0x53')](_0x6cf550(_0x3a9f67,'CampaignId'))[_0xa900('0x2d')](function(){})[_0xa900('0x55')](_0x45fa33()));}}return _0x466248;})['all']();})[_0xa900('0x55')](function(_0x2890c5){logger[_0xa900('0x12')](_0xa900('0x5c'),_0xa900('0x5d'),_0x2890c5['message']);});}var processPromises=function(_0x5be0e4){return BPromise['all'](promises)[_0xa900('0x2d')](function(_0xff0a99){})[_0xa900('0x55')](function(_0x4fad49){logger[_0xa900('0x12')](_0xa900('0x5e'),JSON[_0xa900('0x30')](_0x4fad49));})[_0xa900('0x5f')](function(){socket[_0xa900('0x60')](_0xa900('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5be0e4){return _0x5be0e4[_0xa900('0x62')]();}});};var endCsv=function(){return BPromise[_0xa900('0x63')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xa900('0x2d')](function(){socket[_0xa900('0x60')](_0xa900('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xa900('0x64')](FILEPATH);}catch(_0x4ca1a5){logger[_0xa900('0x12')](_0xa900('0x65'),JSON[_0xa900('0x30')](_0x4ca1a5));}finally{process[_0xa900('0x66')](0x0);}});};process['on'](_0xa900('0x67'),function(){logger[_0xa900('0x68')](_0xa900('0x69'));endCsv();});function main(){return BPromise[_0xa900('0x63')]()[_0xa900('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xa900('0x10')](',');return db[_0xa900('0x2b')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xa900('0x2d')](function(_0x5deae7){var _0x3ae48f=fs[_0xa900('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xa900('0x6b')](_0x3ae48f,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5538cf,_0x3a8d81){total+=0x1;var _0x1a42ac=total;promises[_0xa900('0x2e')](checkRow(_0x5538cf,_0x5deae7,_0x1a42ac)[_0xa900('0x2d')](function(){success+=0x1;})[_0xa900('0x55')](function(_0x218146){if(_0x218146[_0xa900('0x12')]){errors+=0x1;delete _0x218146[_0xa900('0x12')];}else if(_0x218146[_0xa900('0x29')]){duplicates+=0x1;delete _0x218146[_0xa900('0x29')];}rows['push'](_0x218146);}));if(total%0xc8===0x0){_0x3a8d81[_0xa900('0x6c')]();return processPromises(_0x3a8d81);}},'complete':function(){return processPromises()[_0xa900('0x2d')](function(){logger[_0xa900('0x68')](_0xa900('0x6d'));endCsv();});},'error':function(_0x309c7c,_0x14e122){logger['info'](_0xa900('0x6e'),JSON['stringify'](_0x309c7c));endCsv();}});})[_0xa900('0x55')](function(_0xb66cf9){logger['error'](_0xa900('0x6f'),JSON[_0xa900('0x30')](_0xb66cf9));});}main(); \ No newline at end of file +var _0x35dd=['updatedAt','select','field','NOW()','toString','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','insert','cm_contacts','id\x20IN\x20?','str','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','CmList','get','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','argv','undefined','Missing\x20filepath\x20parameter!','null','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','find','Duplicate\x20Contact','CmContact','create','keys','then','push','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt'];(function(_0x291d3f,_0x3ef99f){var _0x242080=function(_0x257705){while(--_0x257705){_0x291d3f['push'](_0x291d3f['shift']());}};_0x242080(++_0x3ef99f);}(_0x35dd,0xa1));var _0xd35d=function(_0x42f5dd,_0x3b3772){_0x42f5dd=_0x42f5dd-0x0;var _0x555306=_0x35dd[_0x42f5dd];return _0x555306;};'use strict';var BPromise=require(_0xd35d('0x0'));var util=require(_0xd35d('0x1'));var _=require(_0xd35d('0x2'));var fs=require('fs');var squel=require(_0xd35d('0x3'));var Papa=require(_0xd35d('0x4'));var Redis=require(_0xd35d('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0xd35d('0x6'));var logger=require(_0xd35d('0x7'))('api');config[_0xd35d('0x8')]=_['defaults'](config[_0xd35d('0x8')],{'host':_0xd35d('0x9'),'port':0x18eb});var socket=require(_0xd35d('0xa'))(new Redis(config[_0xd35d('0x8')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0xd35d('0xb')][0x2]||process['argv'][0x2]===_0xd35d('0xc')||process[_0xd35d('0xb')][0x2]==='null'){throw new Error(_0xd35d('0xd'));}var FILEPATH=process[_0xd35d('0xb')][0x2];if(!process[_0xd35d('0xb')][0x3]||process[_0xd35d('0xb')][0x3]===_0xd35d('0xc')||process[_0xd35d('0xb')][0x3]===_0xd35d('0xe')||!process[_0xd35d('0xb')][0x4]||process[_0xd35d('0xb')][0x4]===_0xd35d('0xc')||process['argv'][0x4]==='null'){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_['zipObject'](process[_0xd35d('0xb')][0x3][_0xd35d('0xf')](','),process[_0xd35d('0xb')][0x4][_0xd35d('0xf')](','));if(!process['argv'][0x5]||process[_0xd35d('0xb')][0x5]===_0xd35d('0xc')||process['argv'][0x5]===_0xd35d('0xe')){throw new Error(_0xd35d('0x10'));}var LISTID=process[_0xd35d('0xb')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xd35d('0xb')][0x6]!==_0xd35d('0xc')&&process[_0xd35d('0xb')][0x6]!==_0xd35d('0xe')?process[_0xd35d('0xb')][0x6]:null;var DUPLICATES=process[_0xd35d('0xb')][0x7]&&process[_0xd35d('0xb')][0x7]!==_0xd35d('0xc')&&process[_0xd35d('0xb')][0x7]!==_0xd35d('0xe')?process[_0xd35d('0xb')][0x7]:null;if(!process['argv'][0x8]||process['argv'][0x8]===_0xd35d('0xc')||process[_0xd35d('0xb')][0x8]===_0xd35d('0xe')){throw new Error(_0xd35d('0x11'));}var SOCKET_TIMESTAMP=process[_0xd35d('0xb')][0x8];}catch(_0x5ce855){logger[_0xd35d('0x12')](_0x5ce855);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(_0x523271,_0x766ded,_0x2c8c88,_0x388168){var _0x75fcc6={'message':_0x766ded};_0x75fcc6[_0x523271]=!![];if(_0x2c8c88){_0x75fcc6[_0xd35d('0x13')]=_0x2c8c88;}if(_0x388168){_0x75fcc6[_0xd35d('0x14')]=_0x388168;}return _0x75fcc6;}function isEmail(_0x43b817){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))*$/[_0xd35d('0x15')](_0x43b817);}function checkRow(_0x43039e,_0x3e50a1,_0x27404a){return new BPromise(function(_0x240507,_0x19bf0a){if(_['isNil'](_0x43039e)){return _0x19bf0a(handleCheckRowError(_0xd35d('0x12'),_0xd35d('0x16'),null,_0x27404a));}if(_0x43039e['errors']&&_0x43039e[_0xd35d('0x17')][_0xd35d('0x18')]){var _0x3de5af=_[_0xd35d('0x19')](_0x43039e[_0xd35d('0x17')],_0xd35d('0x1a'))[_0xd35d('0x1b')](';');return _0x19bf0a(handleCheckRowError(_0xd35d('0x12'),_0x3de5af,null,_0x27404a));}var _0x6fcecd={};for(var _0x393552 in FIELDS){if(FIELDS[_0xd35d('0x1c')](_0x393552)&&FIELDS[_0x393552]){_0x6fcecd[_0x393552]=_0x43039e[_0xd35d('0x1d')][0x0][FIELDS[_0x393552]]||_0x43039e['data'][0x0]['\ufeff'+FIELDS[_0x393552]];}}if(!_0x6fcecd[_0xd35d('0x1e')]){return _0x19bf0a(handleCheckRowError(_0xd35d('0x12'),'firstName\x20not\x20specified!',null,_0x27404a));}if(!_0x6fcecd[_0xd35d('0x1f')]){return _0x19bf0a(handleCheckRowError(_0xd35d('0x12'),_0xd35d('0x20'),null,_0x27404a));}if(_0x6fcecd[_0xd35d('0x21')]){var _0x39f44f=moment(_0x6fcecd[_0xd35d('0x21')],_0xd35d('0x22'));if(!_0x39f44f[_0xd35d('0x23')]()){return _0x19bf0a(handleCheckRowError(_0xd35d('0x12'),_0xd35d('0x24'),null,_0x27404a));}}if(_0x6fcecd[_0xd35d('0x25')]){if(!isEmail(_0x6fcecd[_0xd35d('0x25')])){return _0x19bf0a(handleCheckRowError(_0xd35d('0x12'),_0xd35d('0x26'),null,_0x27404a));}}_0x6fcecd[_0xd35d('0x27')]=LISTID;_0x6fcecd['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xd35d('0x18')]&&_0x3e50a1){var _0x32aebd={};for(var _0x315642=0x0,_0x48c486=DUPLICATES[_0xd35d('0x18')];_0x315642<_0x48c486;_0x315642+=0x1){_0x32aebd[DUPLICATES[_0x315642]]=_0x6fcecd[DUPLICATES[_0x315642]];}var _0x213fd8=_[_0xd35d('0x28')](_0x3e50a1,_0x32aebd);if(_0x213fd8){return _0x19bf0a(handleCheckRowError('duplicate',_0xd35d('0x29'),_0x213fd8,_0x27404a));}}return db[_0xd35d('0x2a')][_0xd35d('0x2b')](_0x6fcecd,{'raw':!![],'hooks':![],'fields':_[_0xd35d('0x2c')](_0x6fcecd)})[_0xd35d('0x2d')](function(_0x48d798){if(DUPLICATES&&DUPLICATES['length']&&_0x3e50a1){_0x3e50a1[_0xd35d('0x2e')](_['pick'](_0x6fcecd,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x48d798['id'];return _0x240507();})[_0xd35d('0x2f')](function(_0x43776c){return _0x19bf0a(handleCheckRowError(_0xd35d('0x12'),_0xd35d('0x30')+(_0x43776c[_0xd35d('0x1a')]||JSON[_0xd35d('0x31')](_0x43776c)),null,_0x27404a));});});}function checkHopper(){function _0x5b97d6(){return function(_0x418663){logger[_0xd35d('0x12')](_0xd35d('0x32'),_0xd35d('0x33'),util[_0xd35d('0x34')](_0x418663,{'showHidden':![],'depth':null}));};}var _0x4398cd=function(_0x3fcd45,_0x25bcce){var _0x5ca88a=squel['insert']()[_0xd35d('0x35')](_0xd35d('0x36'))[_0xd35d('0x37')]([_0xd35d('0x1f'),_0xd35d('0x38'),_0xd35d('0x39'),_0xd35d('0x27'),_0x25bcce,_0xd35d('0x3a'),_0xd35d('0x3b')],squel[_0xd35d('0x3c')]()[_0xd35d('0x3d')](_0xd35d('0x1f'),_0xd35d('0x1f'))[_0xd35d('0x3d')](_0xd35d('0x3e'),_0xd35d('0x38'))[_0xd35d('0x3d')]('id',_0xd35d('0x39'))[_0xd35d('0x3d')](LISTID[_0xd35d('0x3f')](),_0xd35d('0x27'))[_0xd35d('0x3d')](_0x3fcd45['id'][_0xd35d('0x3f')](),_0x25bcce)[_0xd35d('0x3d')](_0xd35d('0x3e'),_0xd35d('0x3a'))['field'](_0xd35d('0x3e'),_0xd35d('0x3b'))[_0xd35d('0x40')]('cm_contacts')[_0xd35d('0x41')](_0xd35d('0x42'))[_0xd35d('0x41')](_0xd35d('0x43'),LISTID[_0xd35d('0x3f')]())[_0xd35d('0x41')](_0xd35d('0x44'))['where'](_0xd35d('0x45'),squel[_0xd35d('0x3c')]()['field'](_0xd35d('0x1f'))[_0xd35d('0x40')](_0xd35d('0x36'))[_0xd35d('0x41')](_0x25bcce+'\x20=\x20?',_0x3fcd45['id'][_0xd35d('0x3f')]())))[_0xd35d('0x3f')]();return _0x5ca88a;};var _0x5b7e50=function(_0x24648b,_0x3e4859){var _0xe765cb=squel[_0xd35d('0x46')]()[_0xd35d('0x35')](_0xd35d('0x36'))[_0xd35d('0x37')]([_0xd35d('0x1f'),_0xd35d('0x38'),'ContactId',_0xd35d('0x27'),_0x3e4859,_0xd35d('0x3a'),_0xd35d('0x3b')],squel[_0xd35d('0x3c')]()['field'](_0xd35d('0x1f'),_0xd35d('0x1f'))[_0xd35d('0x3d')](_0xd35d('0x3e'),_0xd35d('0x38'))[_0xd35d('0x3d')]('id','ContactId')['field'](LISTID[_0xd35d('0x3f')](),'ListId')[_0xd35d('0x3d')](_0x24648b['id'][_0xd35d('0x3f')](),_0x3e4859)[_0xd35d('0x3d')](_0xd35d('0x3e'),_0xd35d('0x3a'))[_0xd35d('0x3d')]('NOW()','updatedAt')['from'](_0xd35d('0x47'))[_0xd35d('0x41')]('deletedAt\x20IS\x20NULL')[_0xd35d('0x41')](_0xd35d('0x43'),LISTID[_0xd35d('0x3f')]())[_0xd35d('0x41')](_0xd35d('0x48'),squel[_0xd35d('0x49')](hopperContacts))[_0xd35d('0x41')](_0xd35d('0x44'))[_0xd35d('0x41')](_0xd35d('0x45'),squel[_0xd35d('0x3c')]()['field']('calleridnum')[_0xd35d('0x40')](_0xd35d('0x4a'))[_0xd35d('0x41')](_0x3e4859+'\x20=\x20?',_0x24648b['id'][_0xd35d('0x3f')]()))[_0xd35d('0x41')](_0xd35d('0x45'),squel[_0xd35d('0x3c')]()['field'](_0xd35d('0x1f'))[_0xd35d('0x40')]('cm_hopper')[_0xd35d('0x41')](_0x3e4859+'\x20=\x20?',_0x24648b['id'][_0xd35d('0x3f')]())))['toString']();return _0xe765cb;};function _0x4cd7e2(_0x1f21c0,_0x37a3a6){var _0x10f73c=squel['insert']()[_0xd35d('0x35')](_0xd35d('0x36'))['fromQuery']([_0xd35d('0x1f'),_0xd35d('0x38'),_0xd35d('0x39'),'ListId',_0x37a3a6,'createdAt',_0xd35d('0x3b')],squel[_0xd35d('0x3c')]()[_0xd35d('0x3d')]('phone',_0xd35d('0x1f'))[_0xd35d('0x3d')](_0xd35d('0x3e'),_0xd35d('0x38'))[_0xd35d('0x3d')]('id',_0xd35d('0x39'))[_0xd35d('0x3d')](LISTID[_0xd35d('0x3f')](),_0xd35d('0x27'))[_0xd35d('0x3d')](_0x1f21c0['id'][_0xd35d('0x3f')](),_0x37a3a6)[_0xd35d('0x3d')]('NOW()',_0xd35d('0x3a'))[_0xd35d('0x3d')](_0xd35d('0x3e'),_0xd35d('0x3b'))['from'](_0xd35d('0x47'))[_0xd35d('0x41')]('deletedAt\x20IS\x20NULL')[_0xd35d('0x41')]('ListId\x20=\x20?',LISTID[_0xd35d('0x3f')]())[_0xd35d('0x41')](_0xd35d('0x48'),squel[_0xd35d('0x49')](hopperContacts))[_0xd35d('0x41')](_0xd35d('0x44')))[_0xd35d('0x3f')]();return _0x10f73c;}function _0x1c959b(_0x1e208e,_0x2e4cf5){var _0x4793ce=squel[_0xd35d('0x46')]()[_0xd35d('0x35')](_0xd35d('0x4b'))[_0xd35d('0x37')]([_0xd35d('0x1f'),'ContactId',_0xd35d('0x27'),_0x2e4cf5,'createdAt',_0xd35d('0x3b')],squel[_0xd35d('0x3c')]()['field'](_0xd35d('0x1f'),_0xd35d('0x1f'))[_0xd35d('0x3d')]('id','ContactId')['field'](LISTID[_0xd35d('0x3f')](),_0xd35d('0x27'))[_0xd35d('0x3d')](_0x1e208e['id']['toString'](),_0x2e4cf5)[_0xd35d('0x3d')](_0xd35d('0x3e'),_0xd35d('0x3a'))[_0xd35d('0x3d')]('NOW()',_0xd35d('0x3b'))[_0xd35d('0x40')](_0xd35d('0x47'))[_0xd35d('0x41')](_0xd35d('0x42'))[_0xd35d('0x41')](_0xd35d('0x43'),LISTID[_0xd35d('0x3f')]())['where']('id\x20IN\x20?',squel['str'](hopperContacts))[_0xd35d('0x41')](_0xd35d('0x44')))[_0xd35d('0x3f')]();return _0x4793ce;}return db[_0xd35d('0x4c')][_0xd35d('0x4d')]({'where':{'type':_0xd35d('0x4e')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0xd35d('0x2d')](function(_0x5713b9){var _0x236d38=[];if(_0x5713b9){var _0x4536f5;for(var _0x216df6=0x0,_0x3dd086;_0x216df6<_0x5713b9[_0xd35d('0x18')];_0x216df6+=0x1){_0x3dd086=_0x5713b9[_0x216df6]['get']({'plain':!![]});switch(_0x3dd086[_0xd35d('0x4f')]){case _0xd35d('0x50'):_0x236d38['push'](db[_0xd35d('0x51')][_0xd35d('0x52')](_0x5b7e50(_0x3dd086,_0xd35d('0x53')))['then'](function(){})[_0xd35d('0x2f')](_0x5b97d6()));break;case _0xd35d('0x54'):_0x236d38[_0xd35d('0x2e')](db[_0xd35d('0x51')]['query'](_0x4398cd(_0x3dd086,'VoiceQueueId'))['then'](function(){})['catch'](_0x5b97d6()));break;default:_0x236d38['push'](db[_0xd35d('0x51')][_0xd35d('0x52')](_0x4cd7e2(_0x3dd086,_0xd35d('0x53')))['then'](function(){})['catch'](_0x5b97d6()));}}}return _0x236d38;})[_0xd35d('0x55')]()[_0xd35d('0x2d')](function(){return db['VoiceQueue']['findAll']({'where':{'type':_0xd35d('0x4e')},'attributes':['id'],'include':[{'model':db[_0xd35d('0x56')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xd35d('0x2d')](function(_0x15ba37){var _0x297baf=[];if(_0x15ba37){var _0x6b18ef;for(var _0x202de5=0x0,_0x32089c;_0x202de5<_0x15ba37[_0xd35d('0x18')];_0x202de5+=0x1){_0x32089c=_0x15ba37[_0x202de5][_0xd35d('0x57')]({'plain':!![]});_0x297baf[_0xd35d('0x2e')](db['sequelize']['query'](_0x1c959b(_0x32089c,_0xd35d('0x53')))[_0xd35d('0x2d')](function(){})[_0xd35d('0x2f')](_0x5b97d6()));}}return _0x297baf;})['all']();})[_0xd35d('0x2d')](function(){return db[_0xd35d('0x58')][_0xd35d('0x4d')]({'attributes':['id',_0xd35d('0x4f')],'include':[{'model':db[_0xd35d('0x56')],'as':'Lists','where':{'id':LISTID}}]})[_0xd35d('0x2d')](function(_0x3ec188){var _0x1b6834=[];if(_0x3ec188){for(var _0x927ece=0x0,_0x56414e;_0x927ece<_0x3ec188[_0xd35d('0x18')];_0x927ece+=0x1){_0x56414e=_0x3ec188[_0x927ece]['get']({'plain':!![]});switch(_0x56414e[_0xd35d('0x4f')]){case _0xd35d('0x50'):_0x1b6834[_0xd35d('0x2e')](db[_0xd35d('0x51')][_0xd35d('0x52')](_0x5b7e50(_0x56414e,_0xd35d('0x59')))[_0xd35d('0x2d')](function(){})['catch'](_0x5b97d6()));break;case _0xd35d('0x54'):_0x1b6834[_0xd35d('0x2e')](db[_0xd35d('0x51')]['query'](_0x4398cd(_0x56414e,_0xd35d('0x59')))['then'](function(){})['catch'](_0x5b97d6()));break;default:_0x1b6834[_0xd35d('0x2e')](db[_0xd35d('0x51')][_0xd35d('0x52')](_0x4cd7e2(_0x56414e,_0xd35d('0x59')))[_0xd35d('0x2d')](function(){})['catch'](_0x5b97d6()));}}}return _0x1b6834;})[_0xd35d('0x55')]();})[_0xd35d('0x2d')](function(){return db[_0xd35d('0x58')][_0xd35d('0x4d')]({'attributes':['id'],'include':[{'model':db[_0xd35d('0x56')],'as':_0xd35d('0x5a'),'where':{'id':LISTID}}]})['then'](function(_0xe07691){var _0x553fa1=[];if(_0xe07691){for(var _0x4cb065=0x0,_0x23d5d4;_0x4cb065<_0xe07691['length'];_0x4cb065+=0x1){_0x23d5d4=_0xe07691[_0x4cb065][_0xd35d('0x57')]({'plain':!![]});_0x553fa1['push'](db[_0xd35d('0x51')][_0xd35d('0x52')](_0x1c959b(_0x23d5d4,_0xd35d('0x59')))[_0xd35d('0x2d')](function(){})[_0xd35d('0x2f')](_0x5b97d6()));}}return _0x553fa1;})[_0xd35d('0x55')]();})[_0xd35d('0x2f')](function(_0x698ace){logger[_0xd35d('0x12')](_0xd35d('0x5b'),'generalCheckHopper',_0x698ace[_0xd35d('0x1a')]);});}var processPromises=function(_0x4e8ce6){return BPromise[_0xd35d('0x55')](promises)[_0xd35d('0x2d')](function(_0x442613){})[_0xd35d('0x2f')](function(_0x55070b){logger[_0xd35d('0x12')](_0xd35d('0x5c'),JSON[_0xd35d('0x31')](_0x55070b));})[_0xd35d('0x5d')](function(){socket[_0xd35d('0x5e')](_0xd35d('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4e8ce6){return _0x4e8ce6[_0xd35d('0x60')]();}});};var endCsv=function(){return BPromise[_0xd35d('0x61')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xd35d('0x2d')](function(){socket[_0xd35d('0x5e')](_0xd35d('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x54da76){logger[_0xd35d('0x12')](_0xd35d('0x62'),JSON[_0xd35d('0x31')](_0x54da76));}finally{process[_0xd35d('0x63')](0x0);}});};process['on'](_0xd35d('0x64'),function(){logger[_0xd35d('0x65')](_0xd35d('0x66'));endCsv();});function main(){return BPromise[_0xd35d('0x61')]()[_0xd35d('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db['CmContact'][_0xd35d('0x4d')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x103eb3){var _0x3b542a=fs[_0xd35d('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xd35d('0x68')](_0x3b542a,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5b40f1,_0x2597a8){total+=0x1;var _0x18bcdf=total;promises[_0xd35d('0x2e')](checkRow(_0x5b40f1,_0x103eb3,_0x18bcdf)[_0xd35d('0x2d')](function(){success+=0x1;})[_0xd35d('0x2f')](function(_0x4674b8){if(_0x4674b8['error']){errors+=0x1;delete _0x4674b8[_0xd35d('0x12')];}else if(_0x4674b8[_0xd35d('0x69')]){duplicates+=0x1;delete _0x4674b8['duplicate'];}rows[_0xd35d('0x2e')](_0x4674b8);}));if(total%0xc8===0x0){_0x2597a8[_0xd35d('0x6a')]();return processPromises(_0x2597a8);}},'complete':function(){return processPromises()[_0xd35d('0x2d')](function(){logger['info'](_0xd35d('0x6b'));endCsv();});},'error':function(_0x507b3b,_0x21b9f6){logger[_0xd35d('0x65')](_0xd35d('0x6c'),JSON[_0xd35d('0x31')](_0x507b3b));endCsv();}});})[_0xd35d('0x2f')](function(_0xb93f8a){logger[_0xd35d('0x12')](_0xd35d('0x6d'),JSON[_0xd35d('0x31')](_0xb93f8a));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 19de242..f50d57e 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 _0xade8=['../../../mysqldb','redis','localhost','format','select','field','phone','from','join','where','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','insert','fromQuery','ContactId','ListId','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_hopper','\x22always\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.createdAt','into','cm_hopper_black','createdAt','updatedAt','.id\x20=\x20','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','push','code','message','sequelize','catch','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','length','rows','errors','data','replace','scheduledat','YYYY-MM-DD\x20HH:mm:ss','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','firstName','\x20not\x20specified','SystemRow','emit','contact:import:','Abort\x20parser','abort','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil','DROP\x20TABLE\x20','VoiceQueueId','voice_queues','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','campaigns','then','finish','affectedRows','unlink','exit','argv','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','body\x20id\x20mandatory','SIGINT','uncaughtException','path','lodash','papaparse','util','moment','squel'];(function(_0x2ca2d0,_0x3ea8e4){var _0x521c23=function(_0x5b0731){while(--_0x5b0731){_0x2ca2d0['push'](_0x2ca2d0['shift']());}};_0x521c23(++_0x3ea8e4);}(_0xade8,0x168));var _0x8ade=function(_0x3d3fc1,_0x1ed299){_0x3d3fc1=_0x3d3fc1-0x0;var _0x3d1156=_0xade8[_0x3d3fc1];return _0x3d1156;};'use strict';var fs=require('fs');var path=require(_0x8ade('0x0'));var _=require(_0x8ade('0x1'));var Papa=require(_0x8ade('0x2'));var util=require(_0x8ade('0x3'));var BPromise=require('bluebird');var moment=require(_0x8ade('0x4'));var squel=require(_0x8ade('0x5'));var Redis=require('ioredis');var db=require(_0x8ade('0x6'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')('import');config[_0x8ade('0x7')]=_['defaults'](config[_0x8ade('0x7')],{'host':_0x8ade('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8ade('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x8ade('0x9')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x55d62e){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'](_0x55d62e);}function selectNotIn(_0xf44464,_0x5fd5a8,_0x5ef2ac,_0x244e1c,_0x1b792b){return squel[_0x8ade('0xa')]()[_0x8ade('0xb')](_0x8ade('0xc'))[_0x8ade('0xd')](_0x244e1c)[_0x8ade('0xe')](_0x5fd5a8,null,_0x5fd5a8+'.id\x20=\x20'+_0x244e1c+'.'+_0x5ef2ac)[_0x8ade('0xf')](_0x244e1c+'.'+_0x5ef2ac+'\x20=\x20'+_0xf44464+'.'+_0x5ef2ac)[_0x8ade('0xf')](_0x5fd5a8+'.dialCheckDuplicateType\x20IN\x20('+_0x1b792b[_0x8ade('0xe')]()+')');}function insertCmHopper(_0x2cda42,_0x24341e,_0x6994d4,_0xbd9184,_0x5afb96){var _0x4e8203=[_0x8ade('0x10'),'cm_contacts.scheduledat',_0x8ade('0x11'),_0x8ade('0x12'),_0x24341e+'.'+_0xbd9184,'cm_contacts.createdAt',_0x8ade('0x13'),_0x8ade('0x14'),'cm_contacts.UserId','\x22'+_0x5afb96+'\x22'];return squel[_0x8ade('0x15')]()['into']('cm_hopper')[_0x8ade('0x16')]([_0x8ade('0xc'),'scheduledat',_0x8ade('0x17'),_0x8ade('0x18'),_0xbd9184,'createdAt','updatedAt','priority',_0x8ade('0x19'),'recallme'],squel['select']()[_0x8ade('0x1a')](_0x4e8203)[_0x8ade('0xd')](_0x24341e)[_0x8ade('0xe')](_0x8ade('0x1b'),null,_0x8ade('0x1c')+_0x24341e+_0x8ade('0x1d'))[_0x8ade('0xe')](_0x6994d4,null,_0x6994d4+'.id\x20=\x20'+_0x24341e+'.'+_0xbd9184)[_0x8ade('0xf')](_0x24341e+_0x8ade('0x1e'),_0x2cda42)[_0x8ade('0xf')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x8ade('0xf')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x24341e,_0x6994d4,_0xbd9184,_0x8ade('0x1f'),[_0x8ade('0x20'),'\x22onlyIfOpen\x22']))[_0x8ade('0xf')](_0x8ade('0x21'),selectNotIn(_0x24341e,_0x6994d4,_0xbd9184,_0x8ade('0x1f'),[_0x8ade('0x20')])))[_0x8ade('0x22')]();}function insertCmHopperBlack(_0x2e449e,_0x217874,_0x3fbfeb,_0x1f2afd){var _0x3af194=[_0x8ade('0x10'),'cm_contacts.id',_0x8ade('0x12'),_0x217874+'.'+_0x1f2afd,_0x8ade('0x23'),'cm_contacts.updatedAt'];return squel[_0x8ade('0x15')]()[_0x8ade('0x24')](_0x8ade('0x25'))['fromQuery'](['phone','ContactId','ListId',_0x1f2afd,_0x8ade('0x26'),_0x8ade('0x27')],squel[_0x8ade('0xa')]()['fields'](_0x3af194)['from'](_0x217874)[_0x8ade('0xe')](_0x8ade('0x1b'),null,_0x8ade('0x1c')+_0x217874+_0x8ade('0x1d'))[_0x8ade('0xe')](_0x3fbfeb,null,_0x3fbfeb+_0x8ade('0x28')+_0x217874+'.'+_0x1f2afd)['where'](_0x217874+_0x8ade('0x1e'),_0x2e449e)[_0x8ade('0xf')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x8ade('0xf')](_0x8ade('0x21'),squel[_0x8ade('0xa')]()[_0x8ade('0xb')](_0x8ade('0xc'))['from'](_0x8ade('0x25'))[_0x8ade('0xf')](_0x8ade('0x29'),_0x2e449e)[_0x8ade('0xf')](_0x1f2afd+_0x8ade('0x2a'),_0x217874+'.'+_0x1f2afd)))[_0x8ade('0x22')]();}function insertCmContact(_0x27ffcd,_0x171eae,_0x45cf36,_0x1c1c9b){var _0x28ea1d=_[_0x8ade('0x2b')](_[_0x8ade('0x2c')](_0x1c1c9b),[_0x8ade('0x18'),_0x8ade('0x2d'),'createdAt','updatedAt']);return squel[_0x8ade('0x15')]()[_0x8ade('0x24')]('cm_contacts')['fromQuery'](_0x28ea1d,squel['select']()['fields'](_0x28ea1d)[_0x8ade('0xd')](_0x171eae)[_0x8ade('0xf')]('('+_0x45cf36[_0x8ade('0xe')](',')+_0x8ade('0x2e'),squel[_0x8ade('0xa')]()[_0x8ade('0x1a')](_0x45cf36)[_0x8ade('0xd')](_0x8ade('0x1b'))[_0x8ade('0xf')](_0x8ade('0x29'),_0x27ffcd))[_0x8ade('0xf')](_0x8ade('0x2f'),squel['select']()[_0x8ade('0xb')](_0x8ade('0x30'),_0x8ade('0x31'))[_0x8ade('0xd')](_0x171eae)[_0x8ade('0x32')](_0x45cf36[_0x8ade('0xe')](','))))['toString']();}function handleStop(){logger[_0x8ade('0x33')](_0x8ade('0x34'));stopped=!![];}function handleUncaughtException(_0x5ca2b0){logger[_0x8ade('0x35')](_0x5ca2b0['message']);process['exit'](0x1);}function handleError(_0x4a9e53,_0xc0c308){stats['errors'][_0x8ade('0x36')]({'name':_0xc0c308[_0x8ade('0x37')],'message':_0xc0c308[_0x8ade('0x38')],'row':_0x4a9e53});}function handleQuery(_0x18b55a){logger[_0x8ade('0x33')](_0x18b55a);return db[_0x8ade('0x39')]['query'](_0x18b55a)['spread'](function(_0x439be3){results[_0x8ade('0x36')](_0x439be3);})[_0x8ade('0x3a')](function(_0x2813df){logger[_0x8ade('0x35')](_0x2813df[_0x8ade('0x38')]);});}function main(_0x5aea7a,_0x3220bb,_0x4891de,_0x5192eb){logger[_0x8ade('0x33')](_0x8ade('0x3b'),_0x5aea7a,JSON[_0x8ade('0x3c')](_0x3220bb));process[_0x8ade('0x3d')](_0x8ade('0x3e'));var _0x479f74=_0x3220bb[_0x8ade('0x3f')];var _0x1448e5=_0x3220bb[_0x8ade('0x40')];var _0x40b913=path['join'](config[_0x8ade('0x41')],_0x8ade('0x42'),_0x1448e5+_0x8ade('0x43'));var _0x389836=_[_0x8ade('0x2c')](_0x479f74)[_0x8ade('0xe')]();logger['info'](_0x8ade('0x44'),_0x389836);fs[_0x8ade('0x45')](_0x40b913,_0x389836+'\x0a');Papa[_0x8ade('0x46')](fs[_0x8ade('0x47')](_0x5aea7a),{'header':!![],'skipEmptyLines':!![],'step':function(_0x22fd15,_0x620403){try{for(var _0x1763c8=0x0,_0x7835bb=[];_0x1763c8<_0x22fd15['data'][_0x8ade('0x48')];_0x1763c8++){stats[_0x8ade('0x49')]+=0x1;if(_0x22fd15[_0x8ade('0x4a')][_0x1763c8]){handleError(_0x22fd15[_0x8ade('0x4b')][_0x1763c8],_0x22fd15['errors'][_0x1763c8]);}else{var _0x2b92c8=[];for(var _0x27565c in _0x479f74){if(_0x479f74['hasOwnProperty'](_0x27565c)){if(_0x22fd15[_0x8ade('0x4b')][_0x1763c8][_0x479f74[_0x27565c]]){var _0x3429e7=_['trim'](_0x22fd15[_0x8ade('0x4b')][_0x1763c8][_0x479f74[_0x27565c]][_0x8ade('0x4c')](/"/g,'\x27'));switch(_0x27565c){case _0x8ade('0x4d'):var _0x3f05d2=moment(_0x3429e7,_0x8ade('0x4e'),!![]);if(_0x3f05d2['isValid']()){_0x7835bb['push']('\x22'+_0x3429e7+'\x22');}else{_0x2b92c8[_0x8ade('0x36')](_0x8ade('0x4f'));}break;case _0x8ade('0x50'):var _0x17989e=parseInt(_0x3429e7);_0x3429e7=_[_0x8ade('0x51')](_0x17989e)||_0x17989e<0x0||_0x17989e>0x4?_0x5192eb?0x3:0x2:_0x17989e;_0x7835bb[_0x8ade('0x36')]('\x22'+_0x3429e7+'\x22');break;case _0x8ade('0x19'):var _0x2bf6f8=parseInt(_0x3429e7);if(_[_0x8ade('0x52')](_0x2bf6f8)&&_['includes'](_0x4891de,_0x2bf6f8)){_0x7835bb['push']('\x22'+_0x2bf6f8+'\x22');}else{_0x2b92c8[_0x8ade('0x36')](_0x8ade('0x53'));}break;case'email':if(isEmail(_0x3429e7)){_0x7835bb['push']('\x22'+_0x3429e7+'\x22');}else{_0x2b92c8[_0x8ade('0x36')](_0x8ade('0x54'));}break;case _0x8ade('0x55'):var _0x438f88=moment(_0x3429e7,_0x8ade('0x56'),!![]);if(_0x438f88[_0x8ade('0x57')]()){_0x7835bb[_0x8ade('0x36')]('\x22'+_0x3429e7+'\x22');}else{_0x2b92c8[_0x8ade('0x36')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x7835bb[_0x8ade('0x36')]('\x22'+_0x3429e7+'\x22');}}else{switch(_0x27565c){case _0x8ade('0x58'):case _0x8ade('0xc'):_0x2b92c8[_0x8ade('0x36')](_0x27565c+_0x8ade('0x59'));break;default:_0x7835bb[_0x8ade('0x36')]('\x22\x22');}}}}if(_0x2b92c8[_0x8ade('0x48')]){handleError(_0x22fd15['data'][_0x1763c8],{'code':_0x8ade('0x5a'),'message':_0x2b92c8[_0x8ade('0xe')]()});}else{fs['appendFileSync'](_0x40b913,_0x7835bb[_0x8ade('0xe')]()+'\x0a');}_0x7835bb=[];}if(!(stats['rows']%0xc8)){socket[_0x8ade('0x5b')](_0x8ade('0x5c')+_0x1448e5,stats);stats[_0x8ade('0x4a')]=[];}}if(stopped){logger['info'](_0x8ade('0x5d'));_0x620403[_0x8ade('0x5e')]();}}catch(_0x55e1fa){handleError(_0x22fd15['data'][_0x1763c8],{'code':'SystemError','message':_0x55e1fa[_0x8ade('0x38')]});logger[_0x8ade('0x35')](_0x8ade('0x5f'),_0x55e1fa[_0x8ade('0x38')]);}},'complete':function(){try{var _0x2438ff=[];var _0x4f0295=_0x8ade('0x1b');if(_0x3220bb[_0x8ade('0x60')]&&_0x3220bb[_0x8ade('0x60')][_0x8ade('0x48')]){_0x4f0295='cm_contacts_'+_0x1448e5;_0x2438ff[_0x8ade('0x36')](_0x8ade('0x61')+_0x4f0295+_0x8ade('0x62'));}var _0x131eb2=util[_0x8ade('0x9')](_0x8ade('0x63'),_0x40b913,_0x4f0295,_0x389836,_0x3220bb[_0x8ade('0x18')],_0x3220bb[_0x8ade('0x2d')]||null,NOW,NOW);if(_[_0x8ade('0x64')](_0x479f74['scheduledat'])){_0x131eb2+=',\x20scheduledAt\x20=\x20NOW()';}_0x2438ff[_0x8ade('0x36')](_0x131eb2);if(_0x3220bb[_0x8ade('0x60')]&&_0x3220bb[_0x8ade('0x60')][_0x8ade('0x48')]){_0x2438ff[_0x8ade('0x36')](insertCmContact(_0x3220bb[_0x8ade('0x18')],_0x4f0295,_0x3220bb['duplicates'],_0x479f74));_0x2438ff[_0x8ade('0x36')](_0x8ade('0x65')+_0x4f0295+';');}_0x2438ff[_0x8ade('0x36')](insertCmHopper(_0x3220bb['ListId'],'voice_queues_has_cm_lists','voice_queues',_0x8ade('0x66'),_0x5192eb));_0x2438ff[_0x8ade('0x36')](insertCmHopperBlack(_0x3220bb['ListId'],'voice_queues_has_cm_blacklists',_0x8ade('0x67'),'VoiceQueueId'));_0x2438ff[_0x8ade('0x36')](insertCmHopper(_0x3220bb[_0x8ade('0x18')],_0x8ade('0x68'),'campaigns',_0x8ade('0x69'),_0x5192eb));_0x2438ff[_0x8ade('0x36')](insertCmHopperBlack(_0x3220bb[_0x8ade('0x18')],_0x8ade('0x6a'),_0x8ade('0x6b'),_0x8ade('0x69')));BPromise['each'](_0x2438ff,handleQuery)[_0x8ade('0x6c')](function(_0x5de535){stats[_0x8ade('0x6d')]=!![];stats[_0x8ade('0x6e')]=_0x3220bb[_0x8ade('0x60')]&&_0x3220bb[_0x8ade('0x60')][_0x8ade('0x48')]?results[0x2]['affectedRows']:results[0x0]['affectedRows'];socket['emit'](_0x8ade('0x5c')+_0x1448e5,stats);fs['unlink'](_0x5aea7a);fs[_0x8ade('0x6f')](_0x40b913);process[_0x8ade('0x70')](0x0);})[_0x8ade('0x3a')](function(_0x5a70e){logger[_0x8ade('0x35')](_0x5a70e[_0x8ade('0x38')]);process[_0x8ade('0x70')](0x1);});}catch(_0x474d65){logger[_0x8ade('0x35')]('complete',_0x474d65[_0x8ade('0x38')]);process[_0x8ade('0x70')](0x1);}},'error':function(_0xdcb1c9,_0x318a25,_0x11fb6b,_0x284216){throw new Error(_0x284216);}});}function validate(){if(process[_0x8ade('0x71')]&&process[_0x8ade('0x71')][_0x8ade('0x48')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x4d9f22=path[_0x8ade('0xe')](config[_0x8ade('0x41')],_0x8ade('0x42'),process[_0x8ade('0x71')][0x2]);if(!fs[_0x8ade('0x72')](_0x4d9f22)){throw new Error(_0x8ade('0x73'));}var _0x413bbc={};try{_0x413bbc=JSON['parse'](process[_0x8ade('0x71')][0x3]);if(!_0x413bbc[_0x8ade('0x3f')]){throw new Error(_0x8ade('0x74'));}if(!_0x413bbc[_0x8ade('0x3f')][_0x8ade('0xc')]){throw new Error(_0x8ade('0x75'));}if(!_0x413bbc[_0x8ade('0x3f')][_0x8ade('0x58')]){throw new Error(_0x8ade('0x76'));}var _0x31c5d8=0x0;if(_0x413bbc[_0x8ade('0x3f')][_0x8ade('0x19')]){_0x31c5d8=0x1;}if(!_0x413bbc[_0x8ade('0x18')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x545543){throw new Error(_0x8ade('0x77'));}var _0x4245d4=[];try{_0x4245d4=_['map'](JSON[_0x8ade('0x46')](process[_0x8ade('0x71')][0x4]),'id');}catch(_0x295500){logger[_0x8ade('0x33')]('No\x20agent\x20available');}main(_0x4d9f22,_0x413bbc,_0x4245d4,_0x31c5d8);}validate();process['on'](_0x8ade('0x78'),handleStop);process['on'](_0x8ade('0x79'),handleUncaughtException); \ No newline at end of file +var _0x34a5=['trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','push','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','SystemRow','emit','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','format','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','voice_queues_has_cm_blacklists','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','existsSync','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','map','SIGINT','uncaughtException','path','papaparse','util','bluebird','moment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.updatedAt','insert','into','cm_hopper','scheduledat','ContactId','ListId','createdAt','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.id','cm_hopper_black','fromQuery','updatedAt','.CmListId','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','id\x20IN\x20?','MIN(id)','group','Received\x20SIGINT','message','exit','errors','info','query','spread','catch','error','main','send','start','binding','root','server/files/tmp','header','writeFileSync','createReadStream','data','length','rows','hasOwnProperty'];(function(_0x2a84a8,_0x467d4e){var _0x5c698c=function(_0x2de388){while(--_0x2de388){_0x2a84a8['push'](_0x2a84a8['shift']());}};_0x5c698c(++_0x467d4e);}(_0x34a5,0xad));var _0x534a=function(_0x56431c,_0x3130f6){_0x56431c=_0x56431c-0x0;var _0x3ad378=_0x34a5[_0x56431c];return _0x3ad378;};'use strict';var fs=require('fs');var path=require(_0x534a('0x0'));var _=require('lodash');var Papa=require(_0x534a('0x1'));var util=require(_0x534a('0x2'));var BPromise=require(_0x534a('0x3'));var moment=require(_0x534a('0x4'));var squel=require('squel');var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0x534a('0x5'))(_0x534a('0x6'));config[_0x534a('0x7')]=_[_0x534a('0x8')](config[_0x534a('0x7')],{'host':_0x534a('0x9'),'port':0x18eb});var socket=require(_0x534a('0xa'))(new Redis(config[_0x534a('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x2ca829){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))*$/[_0x534a('0xb')](_0x2ca829);}function selectNotIn(_0x1088bb,_0x4b1cb7,_0x222098,_0x2ccc5c,_0x25f332){return squel[_0x534a('0xc')]()[_0x534a('0xd')](_0x534a('0xe'))[_0x534a('0xf')](_0x2ccc5c)[_0x534a('0x10')](_0x4b1cb7,null,_0x4b1cb7+_0x534a('0x11')+_0x2ccc5c+'.'+_0x222098)[_0x534a('0x12')](_0x2ccc5c+'.'+_0x222098+_0x534a('0x13')+_0x1088bb+'.'+_0x222098)[_0x534a('0x12')](_0x4b1cb7+_0x534a('0x14')+_0x25f332[_0x534a('0x10')]()+')');}function insertCmHopper(_0x5a4626,_0x36b771,_0x4659c2,_0x5dea09,_0x28a91){var _0x1beb21=[_0x534a('0x15'),_0x534a('0x16'),'cm_contacts.id',_0x534a('0x17'),_0x36b771+'.'+_0x5dea09,'cm_contacts.createdAt',_0x534a('0x18'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x28a91+'\x22'];return squel[_0x534a('0x19')]()[_0x534a('0x1a')](_0x534a('0x1b'))['fromQuery']([_0x534a('0xe'),_0x534a('0x1c'),_0x534a('0x1d'),_0x534a('0x1e'),_0x5dea09,_0x534a('0x1f'),'updatedAt','priority',_0x534a('0x20'),_0x534a('0x21')],squel[_0x534a('0xc')]()[_0x534a('0x22')](_0x1beb21)[_0x534a('0xf')](_0x36b771)[_0x534a('0x10')](_0x534a('0x23'),null,_0x534a('0x24')+_0x36b771+'.CmListId')[_0x534a('0x10')](_0x4659c2,null,_0x4659c2+_0x534a('0x11')+_0x36b771+'.'+_0x5dea09)['where'](_0x36b771+_0x534a('0x25'),_0x5a4626)[_0x534a('0x12')](_0x534a('0x26'),NOW)[_0x534a('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x36b771,_0x4659c2,_0x5dea09,_0x534a('0x1b'),[_0x534a('0x27'),_0x534a('0x28')]))['where'](_0x534a('0x29'),selectNotIn(_0x36b771,_0x4659c2,_0x5dea09,_0x534a('0x1b'),[_0x534a('0x27')])))[_0x534a('0x2a')]();}function insertCmHopperBlack(_0x529ee7,_0x1bb8b9,_0x45b1bc,_0x3860e5){var _0x1d2d4f=[_0x534a('0x15'),_0x534a('0x2b'),'cm_contacts.ListId',_0x1bb8b9+'.'+_0x3860e5,'cm_contacts.createdAt',_0x534a('0x18')];return squel[_0x534a('0x19')]()[_0x534a('0x1a')](_0x534a('0x2c'))[_0x534a('0x2d')]([_0x534a('0xe'),_0x534a('0x1d'),'ListId',_0x3860e5,_0x534a('0x1f'),_0x534a('0x2e')],squel[_0x534a('0xc')]()[_0x534a('0x22')](_0x1d2d4f)[_0x534a('0xf')](_0x1bb8b9)[_0x534a('0x10')](_0x534a('0x23'),null,_0x534a('0x24')+_0x1bb8b9+_0x534a('0x2f'))['join'](_0x45b1bc,null,_0x45b1bc+_0x534a('0x11')+_0x1bb8b9+'.'+_0x3860e5)[_0x534a('0x12')](_0x1bb8b9+_0x534a('0x25'),_0x529ee7)[_0x534a('0x12')](_0x534a('0x26'),NOW)[_0x534a('0x12')](_0x534a('0x29'),squel['select']()['field']('phone')[_0x534a('0xf')](_0x534a('0x2c'))['where']('ListId\x20=\x20?',_0x529ee7)[_0x534a('0x12')](_0x3860e5+_0x534a('0x30'),_0x1bb8b9+'.'+_0x3860e5)))[_0x534a('0x2a')]();}function insertCmContact(_0x390447,_0x7063a9,_0x2efaaa,_0x165d33){var _0x1d98b5=_[_0x534a('0x31')](_[_0x534a('0x32')](_0x165d33),[_0x534a('0x1e'),_0x534a('0x33'),_0x534a('0x1f'),_0x534a('0x2e')]);return squel[_0x534a('0x19')]()[_0x534a('0x1a')]('cm_contacts')[_0x534a('0x2d')](_0x1d98b5,squel[_0x534a('0xc')]()[_0x534a('0x22')](_0x1d98b5)[_0x534a('0xf')](_0x7063a9)[_0x534a('0x12')]('('+_0x2efaaa[_0x534a('0x10')](',')+_0x534a('0x34'),squel[_0x534a('0xc')]()[_0x534a('0x22')](_0x2efaaa)[_0x534a('0xf')](_0x534a('0x23'))[_0x534a('0x12')](_0x534a('0x35'),_0x390447))[_0x534a('0x12')](_0x534a('0x36'),squel['select']()[_0x534a('0xd')](_0x534a('0x37'),'min_id')[_0x534a('0xf')](_0x7063a9)[_0x534a('0x38')](_0x2efaaa[_0x534a('0x10')](','))))[_0x534a('0x2a')]();}function handleStop(){logger['info'](_0x534a('0x39'));stopped=!![];}function handleUncaughtException(_0x28a064){logger['error'](_0x28a064[_0x534a('0x3a')]);process[_0x534a('0x3b')](0x1);}function handleError(_0x40611d,_0xca0f4e){stats[_0x534a('0x3c')]['push']({'name':_0xca0f4e['code'],'message':_0xca0f4e['message'],'row':_0x40611d});}function handleQuery(_0x1845c4){logger[_0x534a('0x3d')](_0x1845c4);return db['sequelize'][_0x534a('0x3e')](_0x1845c4)[_0x534a('0x3f')](function(_0x46295e){results['push'](_0x46295e);})[_0x534a('0x40')](function(_0x5ed530){logger[_0x534a('0x41')](_0x5ed530['message']);});}function main(_0x3359cc,_0x15c1db,_0x40f33d,_0x3829f8){logger[_0x534a('0x3d')](_0x534a('0x42'),_0x3359cc,JSON['stringify'](_0x15c1db));process[_0x534a('0x43')](_0x534a('0x44'));var _0x4dd98f=_0x15c1db[_0x534a('0x45')];var _0x429d54=_0x15c1db['socket_timestamp'];var _0x3ed2f6=path['join'](config[_0x534a('0x46')],_0x534a('0x47'),_0x429d54+'.csv');var _0x236242=_[_0x534a('0x32')](_0x4dd98f)[_0x534a('0x10')]();logger[_0x534a('0x3d')](_0x534a('0x48'),_0x236242);fs[_0x534a('0x49')](_0x3ed2f6,_0x236242+'\x0a');Papa['parse'](fs[_0x534a('0x4a')](_0x3359cc),{'header':!![],'skipEmptyLines':!![],'step':function(_0x29e588,_0x5b29bf){try{for(var _0x32153d=0x0,_0x1e7673=[];_0x32153d<_0x29e588[_0x534a('0x4b')][_0x534a('0x4c')];_0x32153d++){stats[_0x534a('0x4d')]+=0x1;if(_0x29e588[_0x534a('0x3c')][_0x32153d]){handleError(_0x29e588['data'][_0x32153d],_0x29e588[_0x534a('0x3c')][_0x32153d]);}else{var _0x55000e=[];for(var _0x576077 in _0x4dd98f){if(_0x4dd98f[_0x534a('0x4e')](_0x576077)){if(_0x29e588[_0x534a('0x4b')][_0x32153d][_0x4dd98f[_0x576077]]){var _0xcaea54=_[_0x534a('0x4f')](_0x29e588[_0x534a('0x4b')][_0x32153d][_0x4dd98f[_0x576077]][_0x534a('0x50')](/"/g,'\x27'));switch(_0x576077){case _0x534a('0x1c'):var _0x32cd41=moment(_0xcaea54,_0x534a('0x51'),!![]);if(_0x32cd41[_0x534a('0x52')]()){_0x1e7673['push']('\x22'+_0xcaea54+'\x22');}else{_0x55000e[_0x534a('0x53')](_0x534a('0x54'));}break;case _0x534a('0x55'):var _0x275485=parseInt(_0xcaea54);_0xcaea54=_['isNaN'](_0x275485)||_0x275485<0x0||_0x275485>0x4?_0x3829f8?0x3:0x2:_0x275485;_0x1e7673[_0x534a('0x53')]('\x22'+_0xcaea54+'\x22');break;case _0x534a('0x20'):var _0x27e397=parseInt(_0xcaea54);if(_[_0x534a('0x56')](_0x27e397)&&_[_0x534a('0x57')](_0x40f33d,_0x27e397)){_0x1e7673['push']('\x22'+_0x27e397+'\x22');}else{_0x55000e['push'](_0x534a('0x58'));}break;case'email':if(isEmail(_0xcaea54)){_0x1e7673[_0x534a('0x53')]('\x22'+_0xcaea54+'\x22');}else{_0x55000e[_0x534a('0x53')](_0x534a('0x59'));}break;case _0x534a('0x5a'):var _0x78f670=moment(_0xcaea54,_0x534a('0x5b'),!![]);if(_0x78f670['isValid']()){_0x1e7673['push']('\x22'+_0xcaea54+'\x22');}else{_0x55000e[_0x534a('0x53')](_0x534a('0x5c'));}break;default:_0x1e7673['push']('\x22'+_0xcaea54+'\x22');}}else{switch(_0x576077){case _0x534a('0x5d'):case _0x534a('0xe'):_0x55000e['push'](_0x576077+'\x20not\x20specified');break;default:_0x1e7673[_0x534a('0x53')]('\x22\x22');}}}}if(_0x55000e[_0x534a('0x4c')]){handleError(_0x29e588[_0x534a('0x4b')][_0x32153d],{'code':_0x534a('0x5e'),'message':_0x55000e[_0x534a('0x10')]()});}else{fs['appendFileSync'](_0x3ed2f6,_0x1e7673[_0x534a('0x10')]()+'\x0a');}_0x1e7673=[];}if(!(stats[_0x534a('0x4d')]%0xc8)){socket[_0x534a('0x5f')]('contact:import:'+_0x429d54,stats);stats[_0x534a('0x3c')]=[];}}if(stopped){logger[_0x534a('0x3d')]('Abort\x20parser');_0x5b29bf['abort']();}}catch(_0x566536){handleError(_0x29e588['data'][_0x32153d],{'code':'SystemError','message':_0x566536['message']});logger[_0x534a('0x41')]('step',_0x566536[_0x534a('0x3a')]);}},'complete':function(){try{var _0xd77553=[];var _0x378bef=_0x534a('0x23');if(_0x15c1db[_0x534a('0x60')]&&_0x15c1db[_0x534a('0x60')][_0x534a('0x4c')]){_0x378bef=_0x534a('0x61')+_0x429d54;_0xd77553[_0x534a('0x53')](_0x534a('0x62')+_0x378bef+_0x534a('0x63'));}var _0x18f9d2=util[_0x534a('0x64')](_0x534a('0x65'),_0x3ed2f6,_0x378bef,_0x236242,_0x15c1db[_0x534a('0x1e')],_0x15c1db[_0x534a('0x33')]||null,NOW,NOW);if(_[_0x534a('0x66')](_0x4dd98f[_0x534a('0x1c')])){_0x18f9d2+=',\x20scheduledAt\x20=\x20NOW()';}_0xd77553[_0x534a('0x53')](_0x18f9d2);if(_0x15c1db[_0x534a('0x60')]&&_0x15c1db[_0x534a('0x60')]['length']){_0xd77553[_0x534a('0x53')](insertCmContact(_0x15c1db[_0x534a('0x1e')],_0x378bef,_0x15c1db[_0x534a('0x60')],_0x4dd98f));_0xd77553[_0x534a('0x53')]('DROP\x20TABLE\x20'+_0x378bef+';');}_0xd77553[_0x534a('0x53')](insertCmHopper(_0x15c1db[_0x534a('0x1e')],'voice_queues_has_cm_lists',_0x534a('0x67'),'VoiceQueueId',_0x3829f8));_0xd77553[_0x534a('0x53')](insertCmHopperBlack(_0x15c1db[_0x534a('0x1e')],_0x534a('0x68'),'voice_queues',_0x534a('0x69')));_0xd77553[_0x534a('0x53')](insertCmHopper(_0x15c1db[_0x534a('0x1e')],_0x534a('0x6a'),_0x534a('0x6b'),_0x534a('0x6c'),_0x3829f8));_0xd77553[_0x534a('0x53')](insertCmHopperBlack(_0x15c1db[_0x534a('0x1e')],_0x534a('0x6d'),_0x534a('0x6b'),'CampaignId'));BPromise[_0x534a('0x6e')](_0xd77553,handleQuery)[_0x534a('0x6f')](function(_0x250665){stats[_0x534a('0x70')]=!![];stats[_0x534a('0x71')]=_0x15c1db['duplicates']&&_0x15c1db['duplicates']['length']?results[0x2]['affectedRows']:results[0x0]['affectedRows'];socket['emit'](_0x534a('0x72')+_0x429d54,stats);fs[_0x534a('0x73')](_0x3359cc);fs['unlink'](_0x3ed2f6);process['exit'](0x0);})[_0x534a('0x40')](function(_0x43ab19){logger[_0x534a('0x41')](_0x43ab19[_0x534a('0x3a')]);process[_0x534a('0x3b')](0x1);});}catch(_0x2f9db0){logger[_0x534a('0x41')](_0x534a('0x74'),_0x2f9db0[_0x534a('0x3a')]);process['exit'](0x1);}},'error':function(_0x481333,_0x55fd0f,_0x42dac4,_0x2867ec){throw new Error(_0x2867ec);}});}function validate(){if(process['argv']&&process[_0x534a('0x75')][_0x534a('0x4c')]<0x4){throw new Error(_0x534a('0x76'));}var _0x13b85a=path[_0x534a('0x10')](config['root'],_0x534a('0x47'),process['argv'][0x2]);if(!fs[_0x534a('0x77')](_0x13b85a)){throw new Error('file\x20doesn\x27t\x20exists');}var _0xf6ed4f={};try{_0xf6ed4f=JSON[_0x534a('0x78')](process['argv'][0x3]);if(!_0xf6ed4f['binding']){throw new Error(_0x534a('0x79'));}if(!_0xf6ed4f[_0x534a('0x45')][_0x534a('0xe')]){throw new Error(_0x534a('0x7a'));}if(!_0xf6ed4f[_0x534a('0x45')]['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x3b8464=0x0;if(_0xf6ed4f[_0x534a('0x45')]['UserId']){_0x3b8464=0x1;}if(!_0xf6ed4f['ListId']){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x4116d3){throw new Error('body\x20id\x20mandatory');}var _0x37c6f8=[];try{_0x37c6f8=_[_0x534a('0x7b')](JSON[_0x534a('0x78')](process['argv'][0x4]),'id');}catch(_0x5c2cfb){logger['info']('No\x20agent\x20available');}main(_0x13b85a,_0xf6ed4f,_0x37c6f8,_0x3b8464);}validate();process['on'](_0x534a('0x7c'),handleStop);process['on'](_0x534a('0x7d'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index effc4c3..844d006 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 _0x2032=['Agent\x20Ring','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','talktime','destcalleridnum','Member\x20Name','membername','Date','starttime','***\x20Time\x20Info\x20***','answertime','Duration','duration','Billable\x20Time','billableseconds','[xCALLY\x20Ticket]','toLowerCase','inbound','push','variable','queue','calleridnum','outbound','string','getDescriptions','***\x20Call\x20Info\x20***','Caller\x20Name','keyValue','Call\x20To','destexten','Queue','UniqueId','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number'];(function(_0x1cd3bc,_0x39ab3b){var _0x3215b7=function(_0x28eca9){while(--_0x28eca9){_0x1cd3bc['push'](_0x1cd3bc['shift']());}};_0x3215b7(++_0x39ab3b);}(_0x2032,0xd9));var _0x2203=function(_0x2ca6a9,_0x1d9351){_0x2ca6a9=_0x2ca6a9-0x0;var _0x5cec11=_0x2032[_0x2ca6a9];return _0x5cec11;};'use strict';exports['getSubjects']=function(_0x2c2259,_0x1e103d){var _0xcd892f=[{'type':'string','content':_0x2203('0x0'),'variableName':null}];switch(_0x2c2259[_0x2203('0x1')]()){case'voice':switch(_0x1e103d[_0x2203('0x1')]()){case _0x2203('0x2'):_0xcd892f[_0x2203('0x3')]({'type':_0x2203('0x4'),'content':'','variableName':_0x2203('0x5')});_0xcd892f[_0x2203('0x3')]({'type':_0x2203('0x4'),'content':'','variableName':_0x2203('0x6')});break;case _0x2203('0x7'):_0xcd892f[_0x2203('0x3')]({'type':_0x2203('0x8'),'content':'Outbound\x20Call','variableName':null});_0xcd892f['push']({'type':_0x2203('0x4'),'content':'','variableName':'destcalleridnum'});break;}}return _0xcd892f;};exports[_0x2203('0x9')]=function(_0x2972f3,_0x6339c4){var _0x5b19df=[];switch(_0x2972f3[_0x2203('0x1')]()){case'voice':switch(_0x6339c4[_0x2203('0x1')]()){case'inbound':_0x5b19df=[{'type':_0x2203('0x8'),'content':_0x2203('0xa'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Caller\x20Number','keyType':'variable','variableName':'calleridnum'},{'type':'keyValue','content':'','key':_0x2203('0xb'),'keyType':'variable','variableName':'calleridname'},{'type':_0x2203('0xc'),'content':'','key':_0x2203('0xd'),'keyType':_0x2203('0x4'),'variableName':_0x2203('0xe')},{'type':_0x2203('0xc'),'content':'','key':_0x2203('0xf'),'keyType':_0x2203('0x4'),'variableName':_0x2203('0x5')},{'type':_0x2203('0xc'),'content':'','key':_0x2203('0x10'),'keyType':'variable','variableName':_0x2203('0x11')},{'type':_0x2203('0xc'),'content':'','key':'Date','keyType':_0x2203('0x4'),'variableName':_0x2203('0x12')},{'type':'string','content':_0x2203('0x13'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x2203('0x14'),'keyType':_0x2203('0x4'),'variableName':_0x2203('0x15')},{'type':_0x2203('0xc'),'content':'','key':_0x2203('0x16'),'keyType':_0x2203('0x4'),'variableName':'destcalleridnum'},{'type':_0x2203('0x8'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x2203('0x17'),'keyType':'variable','variableName':_0x2203('0x12')},{'type':_0x2203('0xc'),'content':'','key':'Agent\x20Connect','keyType':_0x2203('0x4'),'variableName':'agentconnectAt'},{'type':'keyValue','content':'','key':_0x2203('0x18'),'keyType':_0x2203('0x4'),'variableName':_0x2203('0x19')},{'type':_0x2203('0xc'),'content':'','key':_0x2203('0x1a'),'keyType':_0x2203('0x4'),'variableName':_0x2203('0x1b')},{'type':_0x2203('0xc'),'content':'','key':'Talk\x20Time','keyType':_0x2203('0x4'),'variableName':_0x2203('0x1c')}];break;case _0x2203('0x7'):_0x5b19df=[{'type':'string','content':_0x2203('0xa'),'variableName':null},{'type':_0x2203('0xc'),'content':'','key':'Called\x20Number','keyType':_0x2203('0x4'),'keyContent':'','variableName':_0x2203('0x1d')},{'type':_0x2203('0xc'),'content':'','key':_0x2203('0x1e'),'keyType':_0x2203('0x4'),'keyContent':'','variableName':_0x2203('0x1f')},{'type':_0x2203('0xc'),'content':'','key':'UniqueId','keyType':_0x2203('0x4'),'keyContent':'','variableName':_0x2203('0x11')},{'type':_0x2203('0xc'),'content':'','key':_0x2203('0x20'),'keyType':'variable','keyContent':'','variableName':_0x2203('0x21')},{'type':_0x2203('0x8'),'content':_0x2203('0x22')},{'type':_0x2203('0xc'),'content':'','key':'Answer\x20Time','keyType':_0x2203('0x4'),'keyContent':'','variableName':_0x2203('0x23')},{'type':'keyValue','content':'','key':'Complete\x20Time','keyType':_0x2203('0x4'),'keyContent':'','variableName':'endtime'},{'type':'keyValue','content':'','key':_0x2203('0x24'),'keyType':_0x2203('0x4'),'keyContent':'','variableName':_0x2203('0x25')},{'type':_0x2203('0xc'),'content':'','key':_0x2203('0x26'),'keyType':'variable','keyContent':'','variableName':_0x2203('0x27')}];break;}}return _0x5b19df;}; \ No newline at end of file +var _0x5f66=['***\x20Time\x20Info\x20***','Agent\x20Ring','agentconnectAt','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name','starttime','Answer\x20Time','Complete\x20Time','endtime','Duration','Billable\x20Time','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','variable','queue','calleridnum','outbound','push','Outbound\x20Call','getDescriptions','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','Agent\x20Number','destcalleridnum'];(function(_0x4e1803,_0x5716e5){var _0x18790b=function(_0x4d6faa){while(--_0x4d6faa){_0x4e1803['push'](_0x4e1803['shift']());}};_0x18790b(++_0x5716e5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';exports['getSubjects']=function(_0x61c60c,_0x4a3887){var _0x2d5fd9=[{'type':_0x65f6('0x0'),'content':_0x65f6('0x1'),'variableName':null}];switch(_0x61c60c[_0x65f6('0x2')]()){case _0x65f6('0x3'):switch(_0x4a3887['toLowerCase']()){case _0x65f6('0x4'):_0x2d5fd9['push']({'type':_0x65f6('0x5'),'content':'','variableName':_0x65f6('0x6')});_0x2d5fd9['push']({'type':'variable','content':'','variableName':_0x65f6('0x7')});break;case _0x65f6('0x8'):_0x2d5fd9[_0x65f6('0x9')]({'type':_0x65f6('0x0'),'content':_0x65f6('0xa'),'variableName':null});_0x2d5fd9[_0x65f6('0x9')]({'type':'variable','content':'','variableName':'destcalleridnum'});break;}}return _0x2d5fd9;};exports[_0x65f6('0xb')]=function(_0x2f6d5b,_0x264647){var _0x25c416=[];switch(_0x2f6d5b['toLowerCase']()){case _0x65f6('0x3'):switch(_0x264647['toLowerCase']()){case'inbound':_0x25c416=[{'type':_0x65f6('0x0'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x65f6('0xc'),'content':'','key':'Caller\x20Number','keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x7')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0xd'),'keyType':_0x65f6('0x5'),'variableName':_0x65f6('0xe')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0xf'),'keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x10')},{'type':'keyValue','content':'','key':_0x65f6('0x11'),'keyType':'variable','variableName':'queue'},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x12'),'keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x13')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x14'),'keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x15')},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x65f6('0xc'),'content':'','key':'Agent\x20Name','keyType':'variable','variableName':'destcalleridname'},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x16'),'keyType':'variable','variableName':_0x65f6('0x17')},{'type':_0x65f6('0x0'),'content':_0x65f6('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x19'),'keyType':_0x65f6('0x5'),'variableName':'agentcalledAt'},{'type':_0x65f6('0xc'),'content':'','key':'Agent\x20Connect','keyType':'variable','variableName':_0x65f6('0x1a')},{'type':_0x65f6('0xc'),'content':'','key':'Agent\x20Complete','keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x1b')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x1c'),'keyType':'variable','variableName':_0x65f6('0x1d')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x1e'),'keyType':'variable','variableName':'talktime'}];break;case'outbound':_0x25c416=[{'type':_0x65f6('0x0'),'content':_0x65f6('0x1f'),'variableName':null},{'type':'keyValue','content':'','key':_0x65f6('0x20'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x21'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'membername'},{'type':'keyValue','content':'','key':'UniqueId','keyType':_0x65f6('0x5'),'keyContent':'','variableName':_0x65f6('0x13')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x14'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':_0x65f6('0x22')},{'type':_0x65f6('0x0'),'content':'***\x20Time\x20Info\x20***'},{'type':'keyValue','content':'','key':_0x65f6('0x23'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'answertime'},{'type':'keyValue','content':'','key':_0x65f6('0x24'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':_0x65f6('0x25')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x26'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'duration'},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x27'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x25c416;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index a382852..e9b0d3f 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 _0xf429=['null','Interaction','findOne','then','info','catch','error','tracked','user','query','clone','omit','html','phone','fax','mobile','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role'];(function(_0xf17799,_0x1e4578){var _0x237aa5=function(_0x389238){while(--_0x389238){_0xf17799['push'](_0xf17799['shift']());}};_0x237aa5(++_0x1e4578);}(_0xf429,0xd4));var _0x9f42=function(_0x544072,_0xc41ee1){_0x544072=_0x544072-0x0;var _0x590bf6=_0xf429[_0x544072];return _0x590bf6;};'use strict';var _=require('lodash');var db=require(_0x9f42('0x0'))['db'];var loggers={'openchannel':require(_0x9f42('0x1'))(_0x9f42('0x2')),'mail':require('../../config/logger')(_0x9f42('0x3')),'fax':require(_0x9f42('0x1'))('fax-interactions'),'sms':require(_0x9f42('0x1'))(_0x9f42('0x4')),'chat':require(_0x9f42('0x1'))('chat-interactions')};function getInteractionId(_0x4d3ea7,_0x874a2b,_0x419791){if(_0x4d3ea7&&_0x4d3ea7[_[_0x9f42('0x5')](_0x419791)+_0x9f42('0x6')]){return _0x4d3ea7[_['upperFirst'](_0x419791)+'InteractionId'];}else if(_0x4d3ea7&&_0x4d3ea7['id']){return _0x4d3ea7['id'];}else if(_0x874a2b&&_0x874a2b['id']){return _0x874a2b['id'];}else{return _0x9f42('0x7');}}function log(_0x583df0,_0x9ebde2,_0x5dde1c,_0x1b5140,_0x2b1051,_0x424816){loggers[_0x2b1051[_0x9f42('0x8')]()][_0x583df0](_0x9f42('0x9'),_0x424816[_0x9f42('0xa')](),_0x9ebde2?_0x9ebde2['id']:null,_0x9ebde2?_0x9ebde2['name']:null,_0x9ebde2?_0x9ebde2[_0x9f42('0xb')]:null,getInteractionId(_0x5dde1c,_0x1b5140,_0x2b1051),_0x5dde1c?JSON['stringify'](_0x5dde1c):_0x9f42('0xc'));}function updateUser(_0x78bc2a,_0x3adabf,_0x3f1894,_0x4552f1,_0x2a6717){db[_['upperFirst'](_0x4552f1)+_0x9f42('0xd')][_0x9f42('0xe')]({'where':{'id':getInteractionId(_0x3adabf,_0x3f1894,_0x4552f1)}})[_0x9f42('0xf')](function(_0x252db6){if(_0x252db6){return _0x252db6['update']({'UserId':_0x78bc2a?_0x78bc2a['id']:null});}})['then'](function(_0x152f7a){if(_0x152f7a){log(_0x9f42('0x10'),_0x78bc2a,_0x3adabf,_0x3f1894,_0x4552f1,_0x2a6717);}})[_0x9f42('0x11')](function(){log(_0x9f42('0x12'),_0x78bc2a,_0x3adabf,_0x3f1894,_0x4552f1,_0x2a6717);});}exports[_0x9f42('0x13')]=function(_0x3bdae8,_0x1dd8b8){return function(_0x186ee6,_0x54e9fc,_0x701591){var _0x294fd2=_0x186ee6[_0x9f42('0x14')];var _0x585730={};var _0x306d85=_0x186ee6[_0x9f42('0x15')];if(_0x585730){_0x585730=_[_0x9f42('0x16')](_0x186ee6['body']);_0x585730=_[_0x9f42('0x17')](_0x585730,['body',_0x9f42('0x18'),_0x9f42('0x19'),_0x9f42('0x1a'),_0x9f42('0x1b')]);}updateUser(_0x294fd2,_0x585730,_0x306d85,_0x3bdae8,_0x1dd8b8);_0x701591(null);};}; \ No newline at end of file +var _0x4c35=['../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','update','then','error','tracked','user','query','clone','body','omit','html','phone','fax','mobile','../../mysqldb'];(function(_0x509252,_0x38cb45){var _0x2eeffc=function(_0x46e384){while(--_0x46e384){_0x509252['push'](_0x509252['shift']());}};_0x2eeffc(++_0x38cb45);}(_0x4c35,0x9a));var _0x54c3=function(_0x3a0c4f,_0x5dd1a3){_0x3a0c4f=_0x3a0c4f-0x0;var _0x247049=_0x4c35[_0x3a0c4f];return _0x247049;};'use strict';var _=require('lodash');var db=require(_0x54c3('0x0'))['db'];var loggers={'openchannel':require(_0x54c3('0x1'))(_0x54c3('0x2')),'mail':require('../../config/logger')(_0x54c3('0x3')),'fax':require(_0x54c3('0x1'))(_0x54c3('0x4')),'sms':require(_0x54c3('0x1'))(_0x54c3('0x5')),'chat':require(_0x54c3('0x1'))(_0x54c3('0x6'))};function getInteractionId(_0x5c8e2f,_0x3a86e1,_0x55a189){if(_0x5c8e2f&&_0x5c8e2f[_[_0x54c3('0x7')](_0x55a189)+_0x54c3('0x8')]){return _0x5c8e2f[_[_0x54c3('0x7')](_0x55a189)+_0x54c3('0x8')];}else if(_0x5c8e2f&&_0x5c8e2f['id']){return _0x5c8e2f['id'];}else if(_0x3a86e1&&_0x3a86e1['id']){return _0x3a86e1['id'];}else{return _0x54c3('0x9');}}function log(_0x152df5,_0x2b0dbe,_0x3770db,_0x365b6b,_0x4d32d6,_0x244dc9){loggers[_0x4d32d6[_0x54c3('0xa')]()][_0x152df5](_0x54c3('0xb'),_0x244dc9[_0x54c3('0xc')](),_0x2b0dbe?_0x2b0dbe['id']:null,_0x2b0dbe?_0x2b0dbe[_0x54c3('0xd')]:null,_0x2b0dbe?_0x2b0dbe[_0x54c3('0xe')]:null,getInteractionId(_0x3770db,_0x365b6b,_0x4d32d6),_0x3770db?JSON[_0x54c3('0xf')](_0x3770db):_0x54c3('0x10'));}function updateUser(_0x4acbbe,_0x1e7894,_0x76021,_0x228f35,_0x4aecb6){db[_[_0x54c3('0x7')](_0x228f35)+_0x54c3('0x11')]['findOne']({'where':{'id':getInteractionId(_0x1e7894,_0x76021,_0x228f35)}})['then'](function(_0x55e13e){if(_0x55e13e){return _0x55e13e[_0x54c3('0x12')]({'UserId':_0x4acbbe?_0x4acbbe['id']:null});}})[_0x54c3('0x13')](function(_0x130dae){if(_0x130dae){log('info',_0x4acbbe,_0x1e7894,_0x76021,_0x228f35,_0x4aecb6);}})['catch'](function(){log(_0x54c3('0x14'),_0x4acbbe,_0x1e7894,_0x76021,_0x228f35,_0x4aecb6);});}exports[_0x54c3('0x15')]=function(_0xbe87ea,_0x5abbc8){return function(_0x3913da,_0x409aed,_0x2039a1){var _0x4344a2=_0x3913da[_0x54c3('0x16')];var _0x529dcc={};var _0x5eeb82=_0x3913da[_0x54c3('0x17')];if(_0x529dcc){_0x529dcc=_[_0x54c3('0x18')](_0x3913da[_0x54c3('0x19')]);_0x529dcc=_[_0x54c3('0x1a')](_0x529dcc,[_0x54c3('0x19'),_0x54c3('0x1b'),_0x54c3('0x1c'),_0x54c3('0x1d'),_0x54c3('0x1e')]);}updateUser(_0x4344a2,_0x529dcc,_0x5eeb82,_0xbe87ea,_0x5abbc8);_0x2039a1(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 43b8c56..8f9aac5 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 _0xf445=['utf8','final','parse','use','License','then','count','status','json','format','catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr','%s:%s:%s','update'];(function(_0x2fff83,_0x29d5fe){var _0xa2a722=function(_0x18b6b0){while(--_0x18b6b0){_0x2fff83['push'](_0x2fff83['shift']());}};_0xa2a722(++_0x29d5fe);}(_0xf445,0xe8));var _0x5f44=function(_0x29af75,_0x152b87){_0x29af75=_0x29af75-0x0;var _0x32b56b=_0xf445[_0x29af75];return _0x32b56b;};'use strict';var crypto=require(_0x5f44('0x0'));var util=require(_0x5f44('0x1'));var compose=require(_0x5f44('0x2'));var db=require(_0x5f44('0x3'))['db'];var config=require(_0x5f44('0x4'));function getValueFromLicense(_0x345c65,_0x567ac2){if(_0x345c65&&_0x567ac2){if(_0x567ac2['data1']&&_0x567ac2['license']){var _0x506fb1=_0x567ac2[_0x5f44('0x5')];var _0x20f08b=_0x567ac2[_0x5f44('0x6')];var _0x3b3575=_0x506fb1['split']('-')[0x4];var _0x3cab3e=_0x506fb1[_0x5f44('0x7')]('-')[0x0];var _0x4719c0=crypto['createDecipher'](_0x5f44('0x8'),util['format'](_0x5f44('0x9'),_0x3b3575,_0x506fb1,_0x3cab3e));var _0x57249c=_0x4719c0[_0x5f44('0xa')](_0x20f08b,'base64',_0x5f44('0xb'));_0x57249c+=_0x4719c0[_0x5f44('0xc')]('utf8');var _0x5e6340=JSON[_0x5f44('0xd')](_0x57249c);return _0x5e6340['hasOwnProperty'](_0x345c65)?_0x5e6340[_0x345c65]:null;}}return null;}function isLimit(_0x52c17c,_0x4194e9,_0x1b85fa,_0x455a1d){var _0xe9b33b=_0x4194e9;return compose()[_0x5f44('0xe')](function(_0x29a99a,_0x5c06df,_0x51712e){return db[_0x5f44('0xf')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x5f44('0x10')](function(_0x514650){var _0x97e0a=getValueFromLicense(_0x52c17c,_0x514650);return _0x97e0a?_0x97e0a:_0xe9b33b;})[_0x5f44('0x10')](function(_0x4bf083){_0xe9b33b=_0x4bf083;return _0x1b85fa[_0x5f44('0x11')](_0x455a1d);})[_0x5f44('0x10')](function(_0xee42f3){if(_0xee42f3>=_0xe9b33b){return _0x5c06df[_0x5f44('0x12')](0x193)[_0x5f44('0x13')]({'message':util[_0x5f44('0x14')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x52c17c)});}_0x51712e();})[_0x5f44('0x15')](function(_0x2bb269){_0x51712e(_0x2bb269);});});}function isUserLimit(){return isLimit(_0x5f44('0x16'),0x1,db[_0x5f44('0x17')],{'where':{'$or':[{'role':_0x5f44('0x18')},{'role':_0x5f44('0x19')}]}});}exports[_0x5f44('0x1a')]=isUserLimit; \ No newline at end of file +var _0x120e=['aes-256-ctr','format','update','base64','utf8','hasOwnProperty','use','License','findOne','then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','composable-middleware','../../mysqldb','data1','license','split','createDecipher'];(function(_0x4090f4,_0x3c07d3){var _0x583fc2=function(_0x46d9df){while(--_0x46d9df){_0x4090f4['push'](_0x4090f4['shift']());}};_0x583fc2(++_0x3c07d3);}(_0x120e,0x17a));var _0xe120=function(_0x3ef406,_0x3566a1){_0x3ef406=_0x3ef406-0x0;var _0x4fbf50=_0x120e[_0x3ef406];return _0x4fbf50;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require(_0xe120('0x0'));var db=require(_0xe120('0x1'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x376a04,_0x28c2de){if(_0x376a04&&_0x28c2de){if(_0x28c2de[_0xe120('0x2')]&&_0x28c2de[_0xe120('0x3')]){var _0x32cce3=_0x28c2de[_0xe120('0x2')];var _0x20607b=_0x28c2de[_0xe120('0x3')];var _0x501b6f=_0x32cce3[_0xe120('0x4')]('-')[0x4];var _0x5a5f09=_0x32cce3['split']('-')[0x0];var _0x27ded0=crypto[_0xe120('0x5')](_0xe120('0x6'),util[_0xe120('0x7')]('%s:%s:%s',_0x501b6f,_0x32cce3,_0x5a5f09));var _0x209550=_0x27ded0[_0xe120('0x8')](_0x20607b,_0xe120('0x9'),_0xe120('0xa'));_0x209550+=_0x27ded0['final'](_0xe120('0xa'));var _0x241d97=JSON['parse'](_0x209550);return _0x241d97[_0xe120('0xb')](_0x376a04)?_0x241d97[_0x376a04]:null;}}return null;}function isLimit(_0x461d03,_0x5b4296,_0x427f58,_0x2957ba){var _0x2a98ab=_0x5b4296;return compose()[_0xe120('0xc')](function(_0x3f0cd5,_0x4f4e56,_0x134b28){return db[_0xe120('0xd')][_0xe120('0xe')]({'where':{'id':0x1},'raw':!![]})[_0xe120('0xf')](function(_0x1db284){var _0x103627=getValueFromLicense(_0x461d03,_0x1db284);return _0x103627?_0x103627:_0x2a98ab;})[_0xe120('0xf')](function(_0x360141){_0x2a98ab=_0x360141;return _0x427f58[_0xe120('0x10')](_0x2957ba);})[_0xe120('0xf')](function(_0xac9d79){if(_0xac9d79>=_0x2a98ab){return _0x4f4e56[_0xe120('0x11')](0x193)['json']({'message':util['format'](_0xe120('0x12'),_0x461d03)});}_0x134b28();})[_0xe120('0x13')](function(_0x1b48ba){_0x134b28(_0x1b48ba);});});}function isUserLimit(){return isLimit(_0xe120('0x14'),0x1,db[_0xe120('0x15')],{'where':{'$or':[{'role':_0xe120('0x16')},{'role':_0xe120('0x17')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 343e006..cbeeff2 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 _0xd0e2=['^[0-9]*$','isEmail','lodash','sequelize','fields','split','isEmpty','forOwn','limit','offset','sort','map','priority','cast','col','unsigned','substr','DESC','omit','isArray','length','isObject','unset','hasOwnProperty','isNumeric','match'];(function(_0x4a186d,_0x22dc5c){var _0x8e337e=function(_0x4654f7){while(--_0x4654f7){_0x4a186d['push'](_0x4a186d['shift']());}};_0x8e337e(++_0x22dc5c);}(_0xd0e2,0x106));var _0x2d0e=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd0e2[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x2d0e('0x0'));var moment=require('moment');var sequelize=require(_0x2d0e('0x1'));var LIMIT_VALUE=0xfa;exports[_0x2d0e('0x2')]=function(_0x5b1a2d){var _0x34c39e=null;if(_0x5b1a2d){_0x34c39e=_0x5b1a2d[_0x2d0e('0x3')](',');}return _0x34c39e;};exports['filters']=function(_0x380b19){var _0x4d27e9={};if(!_[_0x2d0e('0x4')](_0x380b19)){_0x4d27e9={};_[_0x2d0e('0x5')](_0x380b19,function(_0xfff933,_0x24db11){try{_0x4d27e9[_0x24db11]=_['isArray'](_0xfff933)?_0xfff933:JSON['parse'](_0xfff933);}catch(_0x1e1e58){_0x4d27e9[_0x24db11]=_0xfff933[_0x2d0e('0x3')](',');}});}return _0x4d27e9;};exports[_0x2d0e('0x6')]=function(_0x4111c8){_0x4111c8=parseInt(_0x4111c8,0xa);if(!_0x4111c8||_0x4111c8<0x0){_0x4111c8=LIMIT_VALUE;}return _0x4111c8;};exports[_0x2d0e('0x7')]=function(_0xa6c34f){_0xa6c34f=parseInt(_0xa6c34f,0xa);if(!_0xa6c34f||_0xa6c34f<0x0){_0xa6c34f=0x0;}return _0xa6c34f;};exports[_0x2d0e('0x8')]=function(_0x1963c0){var _0x20df17,_0x48662a=null;if(_0x1963c0){_0x20df17=_0x1963c0[_0x2d0e('0x3')](',');_0x48662a=_[_0x2d0e('0x9')](_0x20df17,function(_0x1a54b9){if(_0x1a54b9['indexOf']('-')===0x0){return[_0x1a54b9===_0x2d0e('0xa')?sequelize[_0x2d0e('0xb')](sequelize[_0x2d0e('0xc')](_0x2d0e('0xa')),_0x2d0e('0xd')):_0x1a54b9[_0x2d0e('0xe')](0x1),_0x2d0e('0xf')];}else{return[_0x1a54b9===_0x2d0e('0xa')?sequelize['cast'](sequelize[_0x2d0e('0xc')](_0x2d0e('0xa')),_0x2d0e('0xd')):_0x1a54b9,'ASC'];}});}return _0x48662a;};exports[_0x2d0e('0x10')]=function(_0x5e1f5a,_0x516592){if(_['isEmpty'](_0x5e1f5a)){return _0x5e1f5a;}if(_[_0x2d0e('0x11')](_0x5e1f5a)){for(var _0xdde0c=0x0;_0xdde0c<_0x5e1f5a[_0x2d0e('0x12')];_0xdde0c+=0x1){_0x5e1f5a[_0xdde0c]=this[_0x2d0e('0x10')](_0x5e1f5a[_0xdde0c],_0x516592);}return _0x5e1f5a;}if(!_[_0x2d0e('0x13')](_0x5e1f5a)){return _0x5e1f5a;}if(_['isString'](_0x516592)){_0x516592=[_0x516592];}if(!_[_0x2d0e('0x11')](_0x516592)){return _0x5e1f5a;}for(var _0x518a98=0x0;_0x518a98<_0x516592[_0x2d0e('0x12')];_0x518a98+=0x1){_[_0x2d0e('0x14')](_0x5e1f5a,_0x516592[_0x518a98]);}for(var _0xa20399 in _0x5e1f5a){if(_0x5e1f5a[_0x2d0e('0x15')](_0xa20399)){_0x5e1f5a[_0xa20399]=this[_0x2d0e('0x10')](_0x5e1f5a[_0xa20399],_0x516592);}}return _0x5e1f5a;};exports[_0x2d0e('0x16')]=function(_0x26236e){return _0x26236e[_0x2d0e('0x17')](RegExp(_0x2d0e('0x18')))?!![]:![];};exports[_0x2d0e('0x19')]=function(_0x1c9fe0){return _0x1c9fe0['match'](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file +var _0x30a1=['unset','hasOwnProperty','isNumeric','match','^[0-9]*$','lodash','moment','sequelize','fields','filters','isEmpty','forOwn','isArray','parse','split','limit','map','indexOf','priority','col','substr','DESC','length','isString'];(function(_0x5e526e,_0x5c3cc0){var _0xbb8ff0=function(_0x1ac4e0){while(--_0x1ac4e0){_0x5e526e['push'](_0x5e526e['shift']());}};_0xbb8ff0(++_0x5c3cc0);}(_0x30a1,0x19d));var _0x130a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x30a1[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x130a('0x0'));var moment=require(_0x130a('0x1'));var sequelize=require(_0x130a('0x2'));var LIMIT_VALUE=0xfa;exports[_0x130a('0x3')]=function(_0x4ef11b){var _0x5f4013=null;if(_0x4ef11b){_0x5f4013=_0x4ef11b['split'](',');}return _0x5f4013;};exports[_0x130a('0x4')]=function(_0x3f4773){var _0x2c844c={};if(!_[_0x130a('0x5')](_0x3f4773)){_0x2c844c={};_[_0x130a('0x6')](_0x3f4773,function(_0x5017b7,_0x153579){try{_0x2c844c[_0x153579]=_[_0x130a('0x7')](_0x5017b7)?_0x5017b7:JSON[_0x130a('0x8')](_0x5017b7);}catch(_0x3a5701){_0x2c844c[_0x153579]=_0x5017b7[_0x130a('0x9')](',');}});}return _0x2c844c;};exports[_0x130a('0xa')]=function(_0x37fe0f){_0x37fe0f=parseInt(_0x37fe0f,0xa);if(!_0x37fe0f||_0x37fe0f<0x0){_0x37fe0f=LIMIT_VALUE;}return _0x37fe0f;};exports['offset']=function(_0x43a359){_0x43a359=parseInt(_0x43a359,0xa);if(!_0x43a359||_0x43a359<0x0){_0x43a359=0x0;}return _0x43a359;};exports['sort']=function(_0x462b26){var _0x35d532,_0x5f0ce2=null;if(_0x462b26){_0x35d532=_0x462b26[_0x130a('0x9')](',');_0x5f0ce2=_[_0x130a('0xb')](_0x35d532,function(_0x4e31da){if(_0x4e31da[_0x130a('0xc')]('-')===0x0){return[_0x4e31da===_0x130a('0xd')?sequelize['cast'](sequelize[_0x130a('0xe')]('priority'),'unsigned'):_0x4e31da[_0x130a('0xf')](0x1),_0x130a('0x10')];}else{return[_0x4e31da===_0x130a('0xd')?sequelize['cast'](sequelize['col'](_0x130a('0xd')),'unsigned'):_0x4e31da,'ASC'];}});}return _0x5f0ce2;};exports['omit']=function(_0x4b53fe,_0xfc53f){if(_[_0x130a('0x5')](_0x4b53fe)){return _0x4b53fe;}if(_[_0x130a('0x7')](_0x4b53fe)){for(var _0x3975ce=0x0;_0x3975ce<_0x4b53fe[_0x130a('0x11')];_0x3975ce+=0x1){_0x4b53fe[_0x3975ce]=this['omit'](_0x4b53fe[_0x3975ce],_0xfc53f);}return _0x4b53fe;}if(!_['isObject'](_0x4b53fe)){return _0x4b53fe;}if(_[_0x130a('0x12')](_0xfc53f)){_0xfc53f=[_0xfc53f];}if(!_[_0x130a('0x7')](_0xfc53f)){return _0x4b53fe;}for(var _0x2f273b=0x0;_0x2f273b<_0xfc53f[_0x130a('0x11')];_0x2f273b+=0x1){_[_0x130a('0x13')](_0x4b53fe,_0xfc53f[_0x2f273b]);}for(var _0x55a1fb in _0x4b53fe){if(_0x4b53fe[_0x130a('0x14')](_0x55a1fb)){_0x4b53fe[_0x55a1fb]=this['omit'](_0x4b53fe[_0x55a1fb],_0xfc53f);}}return _0x4b53fe;};exports[_0x130a('0x15')]=function(_0x4b46e2){return _0x4b46e2[_0x130a('0x16')](RegExp(_0x130a('0x17')))?!![]:![];};exports['isEmail']=function(_0x29b39d){return _0x29b39d[_0x130a('0x16')](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 749567d..4c449e9 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['use','join','root','favicon.ico','set','appPath','development','test','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','initialize','body-parser','method-override','cookie-parser','errorhandler','path','cors','moment','./environment','../mysqldb','default','get','env','production'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require(_0x3071('0x0'));var methodOverride=require(_0x3071('0x1'));var cookieParser=require(_0x3071('0x2'));var errorHandler=require(_0x3071('0x3'));var path=require(_0x3071('0x4'));var passport=require('passport');var cors=require(_0x3071('0x5'));var moment=require(_0x3071('0x6'));var config=require(_0x3071('0x7'));var db=require(_0x3071('0x8'))['db'];exports[_0x3071('0x9')]=function(_0x41cf76){var _0x1d3dd6=_0x41cf76[_0x3071('0xa')](_0x3071('0xb'));if(_0x1d3dd6===_0x3071('0xc')){_0x41cf76[_0x3071('0xd')](favicon(path[_0x3071('0xe')](config[_0x3071('0xf')],'public',_0x3071('0x10'))));_0x41cf76[_0x3071('0x11')](_0x3071('0x12'),path[_0x3071('0xe')](config[_0x3071('0xf')],'public'));}if(_0x1d3dd6===_0x3071('0x13')||_0x1d3dd6===_0x3071('0x14')){_0x41cf76[_0x3071('0xd')](favicon(path[_0x3071('0xe')](config[_0x3071('0xf')],'client','favicon.ico')));_0x41cf76[_0x3071('0x11')]('appPath',path[_0x3071('0xe')](config[_0x3071('0xf')],'client'));_0x41cf76[_0x3071('0xd')](errorHandler());}_0x41cf76['set'](_0x3071('0x15'),function(_0x45c93b,_0x1271d0){if(this[_0x45c93b]instanceof Date){_0x1271d0=this[_0x45c93b][_0x3071('0x16')]()[_0x3071('0x17')]('.')[0x0]+'Z';}return _0x1271d0;});_0x41cf76[_0x3071('0xd')](express[_0x3071('0x18')](_0x41cf76[_0x3071('0xa')](_0x3071('0x12'))));_0x41cf76[_0x3071('0x11')]('views',config[_0x3071('0xf')]+_0x3071('0x19'));_0x41cf76[_0x3071('0x1a')](_0x3071('0x1b'),require(_0x3071('0x1c'))[_0x3071('0x1d')]);_0x41cf76[_0x3071('0x11')](_0x3071('0x1e'),'html');_0x41cf76[_0x3071('0xd')](bodyParser[_0x3071('0x1f')]({'limit':_0x3071('0x20'),'extended':!![]}));_0x41cf76['use'](bodyParser[_0x3071('0x21')]({'limit':'50mb'}));_0x41cf76[_0x3071('0xd')](cors());_0x41cf76[_0x3071('0xd')](methodOverride());_0x41cf76[_0x3071('0xd')](cookieParser());_0x41cf76[_0x3071('0xd')](passport[_0x3071('0x22')]());}; \ No newline at end of file +var _0x0713=['use','join','root','favicon.ico','set','appPath','development','test','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','initialize','body-parser','method-override','cookie-parser','errorhandler','path','cors','moment','./environment','../mysqldb','default','get','env','production'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require(_0x3071('0x0'));var methodOverride=require(_0x3071('0x1'));var cookieParser=require(_0x3071('0x2'));var errorHandler=require(_0x3071('0x3'));var path=require(_0x3071('0x4'));var passport=require('passport');var cors=require(_0x3071('0x5'));var moment=require(_0x3071('0x6'));var config=require(_0x3071('0x7'));var db=require(_0x3071('0x8'))['db'];exports[_0x3071('0x9')]=function(_0x41cf76){var _0x1d3dd6=_0x41cf76[_0x3071('0xa')](_0x3071('0xb'));if(_0x1d3dd6===_0x3071('0xc')){_0x41cf76[_0x3071('0xd')](favicon(path[_0x3071('0xe')](config[_0x3071('0xf')],'public',_0x3071('0x10'))));_0x41cf76[_0x3071('0x11')](_0x3071('0x12'),path[_0x3071('0xe')](config[_0x3071('0xf')],'public'));}if(_0x1d3dd6===_0x3071('0x13')||_0x1d3dd6===_0x3071('0x14')){_0x41cf76[_0x3071('0xd')](favicon(path[_0x3071('0xe')](config[_0x3071('0xf')],'client','favicon.ico')));_0x41cf76[_0x3071('0x11')]('appPath',path[_0x3071('0xe')](config[_0x3071('0xf')],'client'));_0x41cf76[_0x3071('0xd')](errorHandler());}_0x41cf76['set'](_0x3071('0x15'),function(_0x45c93b,_0x1271d0){if(this[_0x45c93b]instanceof Date){_0x1271d0=this[_0x45c93b][_0x3071('0x16')]()[_0x3071('0x17')]('.')[0x0]+'Z';}return _0x1271d0;});_0x41cf76[_0x3071('0xd')](express[_0x3071('0x18')](_0x41cf76[_0x3071('0xa')](_0x3071('0x12'))));_0x41cf76[_0x3071('0x11')]('views',config[_0x3071('0xf')]+_0x3071('0x19'));_0x41cf76[_0x3071('0x1a')](_0x3071('0x1b'),require(_0x3071('0x1c'))[_0x3071('0x1d')]);_0x41cf76[_0x3071('0x11')](_0x3071('0x1e'),'html');_0x41cf76[_0x3071('0xd')](bodyParser[_0x3071('0x1f')]({'limit':_0x3071('0x20'),'extended':!![]}));_0x41cf76['use'](bodyParser[_0x3071('0x21')]({'limit':'50mb'}));_0x41cf76[_0x3071('0xd')](cors());_0x41cf76[_0x3071('0xd')](methodOverride());_0x41cf76[_0x3071('0xd')](cookieParser());_0x41cf76[_0x3071('0xd')](passport[_0x3071('0x22')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 6f50d7e..f18c4d5 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 _0x02cf=['head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','join','createHash','md5','update','digest','hex','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','replace','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','concat'];(function(_0x9972c7,_0xfd2c79){var _0x29f272=function(_0x1dc927){while(--_0x1dc927){_0x9972c7['push'](_0x9972c7['shift']());}};_0x29f272(++_0xfd2c79);}(_0x02cf,0x1ea));var _0xf02c=function(_0x36b530,_0x48d775){_0x36b530=_0x36b530-0x0;var _0x5a46f0=_0x02cf[_0x36b530];return _0x5a46f0;};'use strict';var _=require(_0xf02c('0x0'));var os=require('os');var crypto=require(_0xf02c('0x1'));var machine=require(_0xf02c('0x2'));var exec=require(_0xf02c('0x3'))[_0xf02c('0x4')];function getInterfaces(){var _0x1e335d=[];var _0x32c95b=os[_0xf02c('0x5')]();var _0x257d18=_[_0xf02c('0x6')](_[_0xf02c('0x7')](_0x32c95b));for(var _0x497347=0x0;_0x497347<_0x257d18[_0xf02c('0x8')];_0x497347++){var _0x353192=_0x32c95b[_0x257d18[_0x497347]][_0xf02c('0x9')](function(_0xffc31c){return _0xffc31c[_0xf02c('0xa')]===_0xf02c('0xb')&&_0xffc31c[_0xf02c('0xc')]===![];});_0x1e335d=_0x1e335d[_0xf02c('0xd')](_0x353192);}return _0x1e335d;}function getFirstInterface(){var _0x4f4ee6=_[_0xf02c('0xe')](getInterfaces());return{'macAddress':_0x4f4ee6&&_0x4f4ee6[_0xf02c('0xf')]?_0x4f4ee6[_0xf02c('0xf')]:_0xf02c('0x10'),'ipAddress':_0x4f4ee6&&_0x4f4ee6[_0xf02c('0x11')]?_0x4f4ee6[_0xf02c('0x11')]:_0xf02c('0x12')};}exports[_0xf02c('0x13')]=getFirstInterface;function getCPUhash(){var _0x2b8fd6=_['orderBy'](os[_0xf02c('0x14')]()[_0xf02c('0x15')](function(_0x597093){return _0x597093['model'];}))[_0xf02c('0x16')](':');return crypto[_0xf02c('0x17')](_0xf02c('0x18'))[_0xf02c('0x19')](_0x2b8fd6)[_0xf02c('0x1a')](_0xf02c('0x1b'));}exports[_0xf02c('0x1c')]=function(){switch(os[_0xf02c('0x1d')]()){case _0xf02c('0x1e'):return exec(_0xf02c('0x1f'),{'encoding':'utf8'})[_0xf02c('0x20')]('\x0d\x0a','');default:var _0x490735=getFirstInterface();var _0xa0615f=getCPUhash();var _0x3538d3=_0xa0615f+'|'+os['hostname']()+'|'+_0x490735[_0xf02c('0x21')]+'|'+_0x490735[_0xf02c('0x22')];var _0x1946a9=crypto[_0xf02c('0x17')](_0xf02c('0x18'))[_0xf02c('0x19')](_0x3538d3)[_0xf02c('0x1a')]('hex');return _0x1946a9['substring'](0x0,0x8)+'-'+_0x1946a9[_0xf02c('0x23')](0x8,0xc)+'-'+_0x1946a9[_0xf02c('0x23')](0xc,0x10)+'-'+_0x1946a9[_0xf02c('0x23')](0x10,0x14)+'-'+_0x1946a9['substring'](0x14);}}; \ No newline at end of file +var _0x62ee=['win32','dmidecode\x20--string\x20system-uuid','macAddress','md5','substring','lodash','crypto','child_process','execSync','orderBy','keys','length','filter','family','IPv4','internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','join','createHash','update','digest','hex','getUuid','platform'];(function(_0x24ed85,_0x44c519){var _0x82bcd5=function(_0x291ffc){while(--_0x291ffc){_0x24ed85['push'](_0x24ed85['shift']());}};_0x82bcd5(++_0x44c519);}(_0x62ee,0xbf));var _0xe62e=function(_0x38b822,_0x3d317b){_0x38b822=_0x38b822-0x0;var _0x28cb56=_0x62ee[_0x38b822];return _0x28cb56;};'use strict';var _=require(_0xe62e('0x0'));var os=require('os');var crypto=require(_0xe62e('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0xe62e('0x2'))[_0xe62e('0x3')];function getInterfaces(){var _0x172a2d=[];var _0x189a15=os['networkInterfaces']();var _0xe7b76d=_[_0xe62e('0x4')](_[_0xe62e('0x5')](_0x189a15));for(var _0x127fe8=0x0;_0x127fe8<_0xe7b76d[_0xe62e('0x6')];_0x127fe8++){var _0x5e818b=_0x189a15[_0xe7b76d[_0x127fe8]][_0xe62e('0x7')](function(_0x15177c){return _0x15177c[_0xe62e('0x8')]===_0xe62e('0x9')&&_0x15177c[_0xe62e('0xa')]===![];});_0x172a2d=_0x172a2d[_0xe62e('0xb')](_0x5e818b);}return _0x172a2d;}function getFirstInterface(){var _0xf2cb08=_['head'](getInterfaces());return{'macAddress':_0xf2cb08&&_0xf2cb08[_0xe62e('0xc')]?_0xf2cb08[_0xe62e('0xc')]:_0xe62e('0xd'),'ipAddress':_0xf2cb08&&_0xf2cb08[_0xe62e('0xe')]?_0xf2cb08[_0xe62e('0xe')]:_0xe62e('0xf')};}exports[_0xe62e('0x10')]=getFirstInterface;function getCPUhash(){var _0x23eb45=_[_0xe62e('0x4')](os[_0xe62e('0x11')]()[_0xe62e('0x12')](function(_0x1fd7d8){return _0x1fd7d8['model'];}))[_0xe62e('0x13')](':');return crypto[_0xe62e('0x14')]('md5')[_0xe62e('0x15')](_0x23eb45)[_0xe62e('0x16')](_0xe62e('0x17'));}exports[_0xe62e('0x18')]=function(){switch(os[_0xe62e('0x19')]()){case _0xe62e('0x1a'):return exec(_0xe62e('0x1b'),{'encoding':'utf8'})['replace']('\x0d\x0a','');default:var _0x3b5b81=getFirstInterface();var _0x4211f6=getCPUhash();var _0x59d93f=_0x4211f6+'|'+os['hostname']()+'|'+_0x3b5b81[_0xe62e('0x1c')]+'|'+_0x3b5b81['ipAddress'];var _0x296624=crypto[_0xe62e('0x14')](_0xe62e('0x1d'))['update'](_0x59d93f)['digest'](_0xe62e('0x17'));return _0x296624[_0xe62e('0x1e')](0x0,0x8)+'-'+_0x296624[_0xe62e('0x1e')](0x8,0xc)+'-'+_0x296624['substring'](0xc,0x10)+'-'+_0x296624[_0xe62e('0x1e')](0x10,0x14)+'-'+_0x296624['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 7559379..e283358 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 _0x7270=['default','util','crypto','moment','request-promise','bluebird','version','../../mysqldb','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','catch','createCipher','aes-256-ctr','secrets','session','update','utf8','base64','final','createDecipher','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','email','then','|reason|','|uuid|','getFirstInterface','ipAddress','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data1','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','diff','DEMO\x20START\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','message','finally','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error'];(function(_0x3c023e,_0x5585c9){var _0x1877ce=function(_0xd7a8ae){while(--_0xd7a8ae){_0x3c023e['push'](_0x3c023e['shift']());}};_0x1877ce(++_0x5585c9);}(_0x7270,0x1d9));var _0x0727=function(_0x26a818,_0x40708a){_0x26a818=_0x26a818-0x0;var _0x5d8ca0=_0x7270[_0x26a818];return _0x5d8ca0;};'use strict';var util=require(_0x0727('0x0'));var crypto=require(_0x0727('0x1'));var moment=require(_0x0727('0x2'));var rp=require(_0x0727('0x3'));var BPromise=require(_0x0727('0x4'));var pkginfo=require('pkginfo')(module,_0x0727('0x5'));var db=require(_0x0727('0x6'))['db'];var config=require('../environment');var hardware=require('./hardware');var logger=require('../logger')(_0x0727('0x7'));var jira=require('../../api/jira/jira.controller');var HOST=_0x0727('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x5850e2){return new BPromise(function(_0x51c76e,_0x30c79e){var _0x557a7f=util[_0x0727('0x9')](_0x0727('0xa'),HOST,_0x5850e2,module[_0x0727('0xb')][_0x0727('0x5')]);if(oldToken){_0x557a7f=util[_0x0727('0x9')](_0x0727('0xc'),HOST,_0x5850e2,module[_0x0727('0xb')][_0x0727('0x5')],oldToken);}var _0xbd1c6c={'uri':_0x557a7f,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0xbd1c6c)['then'](function(_0x2bc308){_0x51c76e(_0x2bc308);})[_0x0727('0xd')](function(_0x1683d7){_0x30c79e(_0x1683d7);});});}function encryptDate(_0x2a2754){var _0x45fc30=crypto[_0x0727('0xe')](_0x0727('0xf'),config[_0x0727('0x10')][_0x0727('0x11')]);var _0x5b3e5b=_0x45fc30[_0x0727('0x12')](_0x2a2754,_0x0727('0x13'),_0x0727('0x14'));_0x5b3e5b+=_0x45fc30[_0x0727('0x15')]('base64');return _0x5b3e5b;}function decryptDate(_0x185da6){var _0x476c5c=crypto[_0x0727('0x16')](_0x0727('0xf'),config[_0x0727('0x10')]['session']);var _0x4db138=_0x476c5c[_0x0727('0x12')](_0x185da6,_0x0727('0x14'),_0x0727('0x13'));_0x4db138+=_0x476c5c['final']('utf8');return _0x4db138;}function sendJiraAlert(_0x37f6dd,_0x3df802,_0xc558da){var _0x34fdd3=_0x0727('0x17');return db[_0x0727('0x18')][_0x0727('0x19')]({'where':{'role':_0x0727('0x1a')},'attributes':[_0x0727('0x1b'),_0x0727('0x1c')],'raw':!![]})[_0x0727('0x1d')](function(_0x12ad9){ADMIN=_0x12ad9;_0x34fdd3+=_0x0727('0x1e')+_0xc558da+'|\x0a';_0x34fdd3+=_0x0727('0x1f')+_0x37f6dd+'|\x0a';_0x34fdd3+='|machineUuid|'+_0x3df802+'|\x0a';_0x34fdd3+='|name|'+ADMIN[_0x0727('0x1b')]+'|\x0a';_0x34fdd3+='|email|'+ADMIN[_0x0727('0x1c')]+'|\x0a';return _0x34fdd3;})[_0x0727('0x1d')](function(_0x5d3ca1){var _0x32285b=hardware[_0x0727('0x20')]()[_0x0727('0x21')];return jira['openIssue']({'key':_0x0727('0x22'),'summary':_0x0727('0x23'),'description':_0x5d3ca1,'issuetype':_0x0727('0x24'),'oldToken':_0x37f6dd,'newToken':_0x3df802,'email':ADMIN[_0x0727('0x1c')],'name':ADMIN[_0x0727('0x1b')],'reason':GRAY_PERIOD_REASON,'ip':_0x32285b});});}function manageLicense(_0x30e664,_0x3a2b0c){var _0x1cc8a7=_0x3a2b0c[_0x0727('0x25')]({'plain':!![]});httpRequest(_0x30e664)[_0x0727('0x1d')](function(_0x38ed8b){if(oldToken){oldToken=undefined;}if(_0x38ed8b[_0x0727('0x26')]){if(!_0x1cc8a7['license']&&_0x1cc8a7[_0x0727('0x7')]!=_0x38ed8b[_0x0727('0x7')]||_0x1cc8a7[_0x0727('0x7')]&&_0x1cc8a7[_0x0727('0x27')]){logger[_0x0727('0x28')](_0x0727('0x29'));}if(_0x1cc8a7['license']&&!_0x1cc8a7[_0x0727('0x27')]&&_0x1cc8a7[_0x0727('0x7')]!=_0x38ed8b[_0x0727('0x7')]){logger[_0x0727('0x28')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x1cc8a7[_0x0727('0x7')]&&!_0x1cc8a7[_0x0727('0x27')]&&_0x1cc8a7['license']==_0x38ed8b[_0x0727('0x7')]){return _0x3a2b0c;}return _0x3a2b0c[_0x0727('0x12')]({'data1':_0x30e664,'data2':null,'license':_0x38ed8b[_0x0727('0x7')]});}else{if(_0x38ed8b['license']||_0x1cc8a7[_0x0727('0x7')]){if(!_0x1cc8a7[_0x0727('0x27')]){if(_0x1cc8a7[_0x0727('0x2a')]==_0x30e664){GRAY_PERIOD_REASON=_0x0727('0x2b');logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x0727('0x2c');oldToken=_0x1cc8a7[_0x0727('0x2a')];logger[_0x0727('0x28')](_0x0727('0x2d'),_0x1cc8a7['data1'],_0x30e664);}sendJiraAlert(_0x1cc8a7['data1'],_0x38ed8b[_0x0727('0x2e')],GRAY_PERIOD_REASON);logger[_0x0727('0x28')](_0x0727('0x2f'),GRAY_PERIOD_REASON[_0x0727('0x30')](),moment()[_0x0727('0x9')]('YYYY-MM-DD\x20HH:mm'));return _0x3a2b0c['update']({'data2':encryptDate(moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x0727('0x31')](decryptDate(_0x1cc8a7['data2']),'days')>DAYS){logger[_0x0727('0x28')](_0x0727('0x32'),moment()[_0x0727('0x9')](_0x0727('0x33')));return _0x3a2b0c['update']({'data1':_0x30e664,'data2':null,'license':null});}}}else{if(_0x1cc8a7[_0x0727('0x2a')]!=_0x30e664){logger[_0x0727('0x28')](_0x0727('0x2d'),_0x1cc8a7[_0x0727('0x2a')],_0x30e664);return _0x3a2b0c[_0x0727('0x12')]({'data1':_0x30e664,'data2':null,'license':null});}}}return _0x3a2b0c;})[_0x0727('0x1d')](function(_0xa6efcc){_0x3a2b0c=_0xa6efcc;})['catch'](function(_0x380376){logger['error'](_0x380376[_0x0727('0x34')]);})[_0x0727('0x35')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x3a2b0c);},TIME);});}function defaultLicense(){var _0x34e1c5=hardware['getUuid']();if(_0x34e1c5){return db[_0x0727('0x36')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x34e1c5}})[_0x0727('0x37')](function(_0x55f700,_0x302097){logger[_0x0727('0x28')](_0x0727('0x38'),_0x34e1c5);manageLicense(_0x34e1c5,_0x55f700);})[_0x0727('0xd')](function(_0x436772){logger[_0x0727('0x39')](_0x436772['message']);});}}exports[_0x0727('0x3a')]=defaultLicense; \ No newline at end of file +var _0x3041=['then','createCipher','secrets','update','utf8','final','aes-256-ctr','session','base64','User','admin','email','|reason|','|uuid|','|machineUuid|','|name|','fullname','|email|','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','license','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','crypto','moment','request-promise','bluebird','pkginfo','../../mysqldb','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version'];(function(_0x47e731,_0x26e230){var _0x1d3d61=function(_0xf8d835){while(--_0xf8d835){_0x47e731['push'](_0x47e731['shift']());}};_0x1d3d61(++_0x26e230);}(_0x3041,0xe9));var _0x1304=function(_0x3216f5,_0xe32e8a){_0x3216f5=_0x3216f5-0x0;var _0x17035a=_0x3041[_0x3216f5];return _0x17035a;};'use strict';var util=require('util');var crypto=require(_0x1304('0x0'));var moment=require(_0x1304('0x1'));var rp=require(_0x1304('0x2'));var BPromise=require(_0x1304('0x3'));var pkginfo=require(_0x1304('0x4'))(module,'version');var db=require(_0x1304('0x5'))['db'];var config=require('../environment');var hardware=require('./hardware');var logger=require('../logger')('license');var jira=require('../../api/jira/jira.controller');var HOST=_0x1304('0x6');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x48f263){return new BPromise(function(_0x5ce0b9,_0x14eb0d){var _0x1de66b=util[_0x1304('0x7')](_0x1304('0x8'),HOST,_0x48f263,module[_0x1304('0x9')][_0x1304('0xa')]);if(oldToken){_0x1de66b=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x48f263,module[_0x1304('0x9')]['version'],oldToken);}var _0x3ef4b5={'uri':_0x1de66b,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x3ef4b5)[_0x1304('0xb')](function(_0x50026f){_0x5ce0b9(_0x50026f);})['catch'](function(_0x2f06d0){_0x14eb0d(_0x2f06d0);});});}function encryptDate(_0x37efb9){var _0x2ff800=crypto[_0x1304('0xc')]('aes-256-ctr',config[_0x1304('0xd')]['session']);var _0x1b5ccb=_0x2ff800[_0x1304('0xe')](_0x37efb9,_0x1304('0xf'),'base64');_0x1b5ccb+=_0x2ff800[_0x1304('0x10')]('base64');return _0x1b5ccb;}function decryptDate(_0x46fd0a){var _0x1f7a24=crypto['createDecipher'](_0x1304('0x11'),config[_0x1304('0xd')][_0x1304('0x12')]);var _0x412785=_0x1f7a24['update'](_0x46fd0a,_0x1304('0x13'),_0x1304('0xf'));_0x412785+=_0x1f7a24[_0x1304('0x10')](_0x1304('0xf'));return _0x412785;}function sendJiraAlert(_0xff9fff,_0x5ccb88,_0x13e616){var _0x6abb='||FIELD||VALUE||\x0a';return db[_0x1304('0x14')]['findOne']({'where':{'role':_0x1304('0x15')},'attributes':['fullname',_0x1304('0x16')],'raw':!![]})[_0x1304('0xb')](function(_0x17af35){ADMIN=_0x17af35;_0x6abb+=_0x1304('0x17')+_0x13e616+'|\x0a';_0x6abb+=_0x1304('0x18')+_0xff9fff+'|\x0a';_0x6abb+=_0x1304('0x19')+_0x5ccb88+'|\x0a';_0x6abb+=_0x1304('0x1a')+ADMIN[_0x1304('0x1b')]+'|\x0a';_0x6abb+=_0x1304('0x1c')+ADMIN[_0x1304('0x16')]+'|\x0a';return _0x6abb;})['then'](function(_0x47ce3b){var _0x50a05c=hardware[_0x1304('0x1d')]()[_0x1304('0x1e')];return jira[_0x1304('0x1f')]({'key':_0x1304('0x20'),'summary':_0x1304('0x21'),'description':_0x47ce3b,'issuetype':_0x1304('0x22'),'oldToken':_0xff9fff,'newToken':_0x5ccb88,'email':ADMIN[_0x1304('0x16')],'name':ADMIN[_0x1304('0x1b')],'reason':GRAY_PERIOD_REASON,'ip':_0x50a05c});});}function manageLicense(_0x2df329,_0x295513){var _0x2e1bea=_0x295513[_0x1304('0x23')]({'plain':!![]});httpRequest(_0x2df329)['then'](function(_0x10edc5){if(oldToken){oldToken=undefined;}if(_0x10edc5[_0x1304('0x24')]){if(!_0x2e1bea[_0x1304('0x25')]&&_0x2e1bea[_0x1304('0x25')]!=_0x10edc5['license']||_0x2e1bea[_0x1304('0x25')]&&_0x2e1bea[_0x1304('0x26')]){logger[_0x1304('0x27')](_0x1304('0x28'));}if(_0x2e1bea[_0x1304('0x25')]&&!_0x2e1bea[_0x1304('0x26')]&&_0x2e1bea['license']!=_0x10edc5[_0x1304('0x25')]){logger[_0x1304('0x27')](_0x1304('0x29'));}if(_0x2e1bea[_0x1304('0x25')]&&!_0x2e1bea['data2']&&_0x2e1bea['license']==_0x10edc5['license']){return _0x295513;}return _0x295513[_0x1304('0xe')]({'data1':_0x2df329,'data2':null,'license':_0x10edc5[_0x1304('0x25')]});}else{if(_0x10edc5['license']||_0x2e1bea[_0x1304('0x25')]){if(!_0x2e1bea['data2']){if(_0x2e1bea[_0x1304('0x2a')]==_0x2df329){GRAY_PERIOD_REASON=_0x1304('0x2b');logger[_0x1304('0x27')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x1304('0x2c');oldToken=_0x2e1bea[_0x1304('0x2a')];logger[_0x1304('0x27')](_0x1304('0x2d'),_0x2e1bea[_0x1304('0x2a')],_0x2df329);}sendJiraAlert(_0x2e1bea[_0x1304('0x2a')],_0x10edc5[_0x1304('0x2e')],GRAY_PERIOD_REASON);logger[_0x1304('0x27')](_0x1304('0x2f'),GRAY_PERIOD_REASON[_0x1304('0x30')](),moment()['format'](_0x1304('0x31')));return _0x295513['update']({'data2':encryptDate(moment()[_0x1304('0x7')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x1304('0x32')](decryptDate(_0x2e1bea[_0x1304('0x26')]),_0x1304('0x33'))>DAYS){logger[_0x1304('0x27')](_0x1304('0x34'),moment()[_0x1304('0x7')]('YYYY-MM-DD\x20HH:mm'));return _0x295513[_0x1304('0xe')]({'data1':_0x2df329,'data2':null,'license':null});}}}else{if(_0x2e1bea[_0x1304('0x2a')]!=_0x2df329){logger[_0x1304('0x27')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2e1bea['data1'],_0x2df329);return _0x295513['update']({'data1':_0x2df329,'data2':null,'license':null});}}}return _0x295513;})[_0x1304('0xb')](function(_0xa1b798){_0x295513=_0xa1b798;})['catch'](function(_0x3032d3){logger[_0x1304('0x35')](_0x3032d3[_0x1304('0x36')]);})[_0x1304('0x37')](function(){setTimeout(function(){manageLicense(hardware[_0x1304('0x38')](),_0x295513);},TIME);});}function defaultLicense(){var _0x4d01eb=hardware[_0x1304('0x38')]();if(_0x4d01eb){return db[_0x1304('0x39')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x4d01eb}})[_0x1304('0x3a')](function(_0x2ecc66,_0x58fb4d){logger[_0x1304('0x27')](_0x1304('0x3b'),_0x4d01eb);manageLicense(_0x4d01eb,_0x2ecc66);})['catch'](function(_0x4d549e){logger[_0x1304('0x35')](_0x4d549e[_0x1304('0x36')]);});}}exports[_0x1304('0x3c')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index a91f89d..59a9a7b 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 _0xadbc=['disabled','Breaking\x20license','message','2027-01-01T00:00:00.000Z','Demo\x20license','getLicense','License','find','then','crypto','util','lodash','./hardware','../environment','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','split','createDecipher','format','%s:%s:%s','utf8','demo','uuid','machineUuid','getUuid','secrets','update','final','gray','deadline','grayReason','changed'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xadbc,0x1a1));var _0xcadb=function(_0x27648f,_0x32e376){_0x27648f=_0x27648f-0x0;var _0x18ece5=_0xadbc[_0x27648f];return _0x18ece5;};'use strict';var crypto=require(_0xcadb('0x0'));var util=require(_0xcadb('0x1'));var _=require(_0xcadb('0x2'));var moment=require('moment');var hardware=require(_0xcadb('0x3'));var config=require(_0xcadb('0x4'));var db=require('../../mysqldb')['db'];function checkLicense(_0x357411,_0x30f35e){if(_0x357411){try{var _0x3cfa26=_0x30f35e||_0x357411[_0xcadb('0x5')];if(_[_0xcadb('0x6')](_0x3cfa26)){throw new Error(_0xcadb('0x7'));}var _0x307da4=_0x357411[_0xcadb('0x8')];var _0x63fb20=_0x357411['data2'];var _0x18cc87=_0x307da4[_0xcadb('0x9')]('-')[0x4];var _0x441c08=_0x307da4[_0xcadb('0x9')]('-')[0x0];var _0x47e76d=crypto[_0xcadb('0xa')]('aes-256-ctr',util[_0xcadb('0xb')](_0xcadb('0xc'),_0x18cc87,_0x307da4,_0x441c08));var _0x44bc8c=_0x47e76d['update'](_0x3cfa26,'base64',_0xcadb('0xd'));_0x44bc8c+=_0x47e76d['final'](_0xcadb('0xd'));var _0x50a39e=JSON['parse'](_0x44bc8c);_0x50a39e[_0xcadb('0xe')]=![];_0x50a39e[_0xcadb('0xf')]=_0x307da4;_0x50a39e[_0xcadb('0x10')]=hardware[_0xcadb('0x11')]();if(_0x63fb20){var _0x4421cc=crypto[_0xcadb('0xa')]('aes-256-ctr',config[_0xcadb('0x12')]['session']);var _0x1bc0c0=_0x4421cc[_0xcadb('0x13')](_0x63fb20,'base64',_0xcadb('0xd'));_0x1bc0c0+=_0x4421cc[_0xcadb('0x14')](_0xcadb('0xd'));_0x50a39e[_0xcadb('0x15')]=_0x1bc0c0;_0x50a39e[_0xcadb('0x16')]=moment(_0x1bc0c0)['add'](0x7,'days')[_0xcadb('0xb')]();_0x50a39e[_0xcadb('0x17')]=_0x50a39e[_0xcadb('0xf')]!=_0x50a39e[_0xcadb('0x10')]?_0xcadb('0x18'):_0xcadb('0x19');}return _0x50a39e;}catch(_0x510a9d){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':_0xcadb('0x1a'),'uuid':_0x357411[_0xcadb('0x8')],'machineUuid':hardware[_0xcadb('0x11')](),'message':_0x510a9d[_0xcadb('0x1b')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xcadb('0x1c'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xcadb('0x1d'),'uuid':_0x357411[_0xcadb('0x8')],'machineUuid':hardware[_0xcadb('0x11')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0xcadb('0x1e')]=function(_0x1c35eb){return db[_0xcadb('0x1f')][_0xcadb('0x20')](_['defaults'](_0x1c35eb,{'raw':!![],'where':{'id':0x1}}))[_0xcadb('0x21')](function(_0x4e42b9){return checkLicense(_0x4e42b9,null);});};exports['checkLicense']=checkLicense; \ No newline at end of file +var _0xfe90=['grayReason','uuid','changed','disabled','2027-01-01T00:00:00.000Z','data1','message','Demo\x20license','getLicense','License','defaults','checkLicense','crypto','util','lodash','moment','./hardware','../environment','../../mysqldb','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','demo','getUuid','createDecipher','secrets','session','gray','deadline','add','days'];(function(_0x2de0a7,_0x38d3e7){var _0x429437=function(_0x23c148){while(--_0x23c148){_0x2de0a7['push'](_0x2de0a7['shift']());}};_0x429437(++_0x38d3e7);}(_0xfe90,0x1a6));var _0x0fe9=function(_0x4651ed,_0xa8b108){_0x4651ed=_0x4651ed-0x0;var _0x24dc33=_0xfe90[_0x4651ed];return _0x24dc33;};'use strict';var crypto=require(_0x0fe9('0x0'));var util=require(_0x0fe9('0x1'));var _=require(_0x0fe9('0x2'));var moment=require(_0x0fe9('0x3'));var hardware=require(_0x0fe9('0x4'));var config=require(_0x0fe9('0x5'));var db=require(_0x0fe9('0x6'))['db'];function checkLicense(_0x12da58,_0x43a92f){if(_0x12da58){try{var _0x19a7d9=_0x43a92f||_0x12da58[_0x0fe9('0x7')];if(_[_0x0fe9('0x8')](_0x19a7d9)){throw new Error(_0x0fe9('0x9'));}var _0x1105bd=_0x12da58['data1'];var _0x3dd0ac=_0x12da58[_0x0fe9('0xa')];var _0x45226b=_0x1105bd[_0x0fe9('0xb')]('-')[0x4];var _0x15751a=_0x1105bd[_0x0fe9('0xb')]('-')[0x0];var _0x1700fa=crypto['createDecipher'](_0x0fe9('0xc'),util[_0x0fe9('0xd')](_0x0fe9('0xe'),_0x45226b,_0x1105bd,_0x15751a));var _0x4f301a=_0x1700fa[_0x0fe9('0xf')](_0x19a7d9,_0x0fe9('0x10'),_0x0fe9('0x11'));_0x4f301a+=_0x1700fa[_0x0fe9('0x12')](_0x0fe9('0x11'));var _0x35b19d=JSON[_0x0fe9('0x13')](_0x4f301a);_0x35b19d[_0x0fe9('0x14')]=![];_0x35b19d['uuid']=_0x1105bd;_0x35b19d['machineUuid']=hardware[_0x0fe9('0x15')]();if(_0x3dd0ac){var _0x1cff9c=crypto[_0x0fe9('0x16')]('aes-256-ctr',config[_0x0fe9('0x17')][_0x0fe9('0x18')]);var _0x556bfd=_0x1cff9c[_0x0fe9('0xf')](_0x3dd0ac,_0x0fe9('0x10'),_0x0fe9('0x11'));_0x556bfd+=_0x1cff9c[_0x0fe9('0x12')](_0x0fe9('0x11'));_0x35b19d[_0x0fe9('0x19')]=_0x556bfd;_0x35b19d[_0x0fe9('0x1a')]=moment(_0x556bfd)[_0x0fe9('0x1b')](0x7,_0x0fe9('0x1c'))[_0x0fe9('0xd')]();_0x35b19d[_0x0fe9('0x1d')]=_0x35b19d[_0x0fe9('0x1e')]!=_0x35b19d['machineUuid']?_0x0fe9('0x1f'):_0x0fe9('0x20');}return _0x35b19d;}catch(_0x2e9a51){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x0fe9('0x21'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x12da58[_0x0fe9('0x22')],'machineUuid':hardware[_0x0fe9('0x15')](),'message':_0x2e9a51[_0x0fe9('0x23')],'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':_0x0fe9('0x24'),'uuid':_0x12da58[_0x0fe9('0x22')],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0x0fe9('0x25')]=function(_0x2cc3bd){return db[_0x0fe9('0x26')]['find'](_[_0x0fe9('0x27')](_0x2cc3bd,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x33d7a0){return checkLicense(_0x33d7a0,null);});};exports[_0x0fe9('0x28')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 5298d0c..c8e7ef4 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 _0xa631=['http://localhost:9000','myappanuglar-secret','app-id'];(function(_0x34a4fd,_0x5c07f2){var _0xf89bcb=function(_0x575bbe){while(--_0x575bbe){_0x34a4fd['push'](_0x34a4fd['shift']());}};_0xf89bcb(++_0x5c07f2);}(_0xa631,0xe4));var _0x1a63=function(_0x171e15,_0x2b5501){_0x171e15=_0x171e15-0x0;var _0x5467b3=_0xa631[_0x171e15];return _0x5467b3;};'use strict';module['exports']={'DOMAIN':_0x1a63('0x0'),'SESSION_SECRET':_0x1a63('0x1'),'GOOGLE_ID':_0x1a63('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x0fc2=['myappanuglar-secret','app-id','exports','http://localhost:9000'];(function(_0x2bae53,_0x38979a){var _0x404099=function(_0x213594){while(--_0x213594){_0x2bae53['push'](_0x2bae53['shift']());}};_0x404099(++_0x38979a);}(_0x0fc2,0x6e));var _0x20fc=function(_0xbd66b7,_0x455bfd){_0xbd66b7=_0xbd66b7-0x0;var _0x142405=_0x0fc2[_0xbd66b7];return _0x142405;};'use strict';module[_0x20fc('0x0')]={'DOMAIN':_0x20fc('0x1'),'SESSION_SECRET':_0x20fc('0x2'),'GOOGLE_ID':_0x20fc('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 8fa944c..b7c298f 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa807=['exports','transports','File','%s-%s','error','info','Console','moment','winston','path','INFO','/var','log','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase'];(function(_0x155839,_0x3f679d){var _0x51d322=function(_0xf96e28){while(--_0xf96e28){_0x155839['push'](_0x155839['shift']());}};_0x51d322(++_0x3f679d);}(_0xa807,0x137));var _0x7a80=function(_0x43b92f,_0x41371f){_0x43b92f=_0x43b92f-0x0;var _0x23cb82=_0xa807[_0x43b92f];return _0x23cb82;};'use strict';var moment=require(_0x7a80('0x0'));var winston=require(_0x7a80('0x1'));var util=require('util');var path=require(_0x7a80('0x2'));var debugLevel=_0x7a80('0x3');function filename(_0x92eb42,_0x230b17){return path['join'](_0x7a80('0x4'),_0x7a80('0x5'),'xcally',util[_0x7a80('0x6')](_0x7a80('0x7'),_0x92eb42,_0x230b17));}function formatter(_0x1dc7dd,_0xd1112){return util['format'](_0x7a80('0x8'),moment()[_0x7a80('0x6')](_0x7a80('0x9')),_0xd1112[_0x7a80('0xa')][_0x7a80('0xb')](),_0x1dc7dd,_0xd1112['message']);}module[_0x7a80('0xc')]=function(_0x3cf507){return new winston['Logger']({'transports':[new winston[(_0x7a80('0xd'))][(_0x7a80('0xe'))]({'name':util[_0x7a80('0x6')](_0x7a80('0xf'),_0x3cf507,_0x7a80('0x10')),'filename':filename(_0x3cf507,_0x7a80('0x10')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x716eee){return formatter(_0x3cf507,_0x716eee);}}),new winston[(_0x7a80('0xd'))][(_0x7a80('0xe'))]({'name':util['format'](_0x7a80('0xf'),_0x3cf507,_0x7a80('0x11')),'filename':filename(_0x3cf507,_0x7a80('0x11')),'level':_0x7a80('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x149198){return formatter(_0x3cf507,_0x149198);}}),new winston['transports'][(_0x7a80('0x12'))]({'level':process['env']['debugLevel']||debugLevel,'json':![],'formatter':function(_0x3197a1){return formatter(_0x3cf507,_0x3197a1);}})]});}; \ No newline at end of file +var _0xe642=['xcally','format','message','exports','Logger','transports','File','%s-%s','error','info','Console','env','moment','util','path','INFO','join','/var','log'];(function(_0x249967,_0x46879f){var _0x19f07c=function(_0x5ddcad){while(--_0x5ddcad){_0x249967['push'](_0x249967['shift']());}};_0x19f07c(++_0x46879f);}(_0xe642,0xdd));var _0x2e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe642[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x2e64('0x0'));var winston=require('winston');var util=require(_0x2e64('0x1'));var path=require(_0x2e64('0x2'));var debugLevel=_0x2e64('0x3');function filename(_0x6f7f9,_0x3cf7bd){return path[_0x2e64('0x4')](_0x2e64('0x5'),_0x2e64('0x6'),_0x2e64('0x7'),util[_0x2e64('0x8')]('%s-%s.log',_0x6f7f9,_0x3cf7bd));}function formatter(_0x3617c3,_0x26de0b){return util[_0x2e64('0x8')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x2e64('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),_0x26de0b['level']['toUpperCase'](),_0x3617c3,_0x26de0b[_0x2e64('0x9')]);}module[_0x2e64('0xa')]=function(_0x4b4712){return new winston[(_0x2e64('0xb'))]({'transports':[new winston[(_0x2e64('0xc'))][(_0x2e64('0xd'))]({'name':util['format'](_0x2e64('0xe'),_0x4b4712,'error'),'filename':filename(_0x4b4712,'error'),'level':_0x2e64('0xf'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x114ce6){return formatter(_0x4b4712,_0x114ce6);}}),new winston[(_0x2e64('0xc'))][(_0x2e64('0xd'))]({'name':util[_0x2e64('0x8')](_0x2e64('0xe'),_0x4b4712,_0x2e64('0x10')),'filename':filename(_0x4b4712,'info'),'level':_0x2e64('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5d74f1){return formatter(_0x4b4712,_0x5d74f1);}}),new winston[(_0x2e64('0xc'))][(_0x2e64('0x11'))]({'level':process[_0x2e64('0x12')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x3caa0f){return formatter(_0x4b4712,_0x3caa0f);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index cae9382..a2d2e45 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 _0x87df=['../../services/ami/index.js','agi','../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','ami'];(function(_0x53b59b,_0x67840d){var _0x35768d=function(_0x1f6e21){while(--_0x1f6e21){_0x53b59b['push'](_0x53b59b['shift']());}};_0x35768d(++_0x67840d);}(_0x87df,0x167));var _0xf87d=function(_0x321421,_0x555332){_0x321421=_0x321421-0x0;var _0x5374a4=_0x87df[_0x321421];return _0x5374a4;};'use strict';var path=require(_0xf87d('0x0'));var os=require('os');var config={'apps':[{'name':_0xf87d('0x1'),'script':path[_0xf87d('0x2')](__dirname,_0xf87d('0x3'))},{'name':_0xf87d('0x4'),'script':path[_0xf87d('0x2')](__dirname,_0xf87d('0x5'))},{'name':_0xf87d('0x6'),'script':path[_0xf87d('0x2')](__dirname,_0xf87d('0x7'))},{'name':'email','script':path['join'](__dirname,_0xf87d('0x8'))},{'name':_0xf87d('0x9'),'script':path['join'](__dirname,_0xf87d('0xa'))},{'name':_0xf87d('0xb'),'script':path[_0xf87d('0x2')](__dirname,_0xf87d('0xc'))}]};module[_0xf87d('0xd')]=config; \ No newline at end of file +var _0xdb4c=['../../services/routing/index.js','../../services/xdr/index.js','exports','path','express','../../services/express/index.js','ami','join','../../services/ami/index.js','email','routing'];(function(_0xbb0176,_0x28b3ec){var _0x1d6291=function(_0x29c190){while(--_0x29c190){_0xbb0176['push'](_0xbb0176['shift']());}};_0x1d6291(++_0x28b3ec);}(_0xdb4c,0x1c6));var _0xcdb4=function(_0x5306a6,_0x16372e){_0x5306a6=_0x5306a6-0x0;var _0x21e111=_0xdb4c[_0x5306a6];return _0x21e111;};'use strict';var path=require(_0xcdb4('0x0'));var os=require('os');var config={'apps':[{'name':_0xcdb4('0x1'),'script':path['join'](__dirname,_0xcdb4('0x2'))},{'name':_0xcdb4('0x3'),'script':path[_0xcdb4('0x4')](__dirname,_0xcdb4('0x5'))},{'name':'agi','script':path[_0xcdb4('0x4')](__dirname,'../../services/agi/index.js')},{'name':_0xcdb4('0x6'),'script':path[_0xcdb4('0x4')](__dirname,'../../services/email/index.js')},{'name':_0xcdb4('0x7'),'script':path[_0xcdb4('0x4')](__dirname,_0xcdb4('0x8'))},{'name':'xdr','script':path[_0xcdb4('0x4')](__dirname,_0xcdb4('0x9'))}]};module[_0xcdb4('0xa')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 25a7d11..ed04542 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 _0x55ca=['stop','restart','list','describe','delete','dump','pm2','bluebird','connect','start','then','disconnect'];(function(_0x35cdc6,_0x118777){var _0xd04da8=function(_0x2a2a30){while(--_0x2a2a30){_0x35cdc6['push'](_0x35cdc6['shift']());}};_0xd04da8(++_0x118777);}(_0x55ca,0x126));var _0xa55c=function(_0x178f52,_0x5d9675){_0x178f52=_0x178f52-0x0;var _0x556f99=_0x55ca[_0x178f52];return _0x556f99;};'use strict';var pm2=require(_0xa55c('0x0'));var BPromise=require(_0xa55c('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x5edc58,_0x49875a){return pm2[_0xa55c('0x2')](function(_0x267ea0){if(_0x267ea0){return _0x49875a(_0x267ea0);}return _0x5edc58('connected');});});};exports[_0xa55c('0x3')]=function(_0x2db02a){return connect()[_0xa55c('0x4')](function(){return new BPromise(function(_0x204951,_0x3c97c8){return pm2[_0xa55c('0x3')](_0x2db02a,function(_0x36b623,_0x4d0624){if(_0x36b623){return _0x3c97c8(_0x36b623);}pm2[_0xa55c('0x5')]();return _0x204951(_0x4d0624);});});});};exports[_0xa55c('0x6')]=function(_0x57e069){return connect()[_0xa55c('0x4')](function(){return new BPromise(function(_0x290d28,_0x52a3bc){return pm2['stop'](_0x57e069,function(_0x473d0e,_0x20c76a){if(_0x473d0e){return _0x52a3bc(_0x473d0e);}pm2[_0xa55c('0x5')]();return _0x290d28(_0x20c76a);});});});};exports[_0xa55c('0x7')]=function(_0x31646d){return connect()[_0xa55c('0x4')](function(){return new BPromise(function(_0x508342,_0x70c2de){return pm2[_0xa55c('0x7')](_0x31646d,function(_0x15eec8,_0x5d47ff){if(_0x15eec8){return _0x70c2de(_0x15eec8);}pm2['disconnect']();return _0x508342(_0x5d47ff);});});});};exports[_0xa55c('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x5a3672,_0x59ea8d){return pm2[_0xa55c('0x8')](function(_0x3930e4,_0x462cd6){if(_0x3930e4){return _0x59ea8d(_0x3930e4);}pm2[_0xa55c('0x5')]();return _0x5a3672(_0x462cd6);});});});};exports[_0xa55c('0x9')]=function(_0x247e77){return connect()['then'](function(){return new BPromise(function(_0x3ccf65,_0x3dcf4f){return pm2[_0xa55c('0x9')](_0x247e77,function(_0x31e10d,_0x1c4cfd){if(_0x31e10d){return _0x3dcf4f(_0x31e10d);}pm2[_0xa55c('0x5')]();return _0x3ccf65(_0x1c4cfd);});});});};exports[_0xa55c('0xa')]=function(_0x2d09d8){return connect()[_0xa55c('0x4')](function(){return new BPromise(function(_0x4cee3c,_0x3d4c9e){return pm2[_0xa55c('0xa')](_0x2d09d8,function(_0x461284,_0x358b61){if(_0x461284){return _0x3d4c9e(_0x461284);}pm2[_0xa55c('0x5')]();return _0x4cee3c(_0x358b61);});});});};exports[_0xa55c('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x5f5158,_0xd643cc){return pm2[_0xa55c('0xb')](function(_0xade4c4){if(_0xade4c4){return _0xd643cc(_0xade4c4);}return _0x5f5158('saved');});});});}; \ No newline at end of file +var _0x9c44=['describe','delete','dump','saved','./config','connect','connected','then','start','disconnect','restart','list'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x49c4('0x0'));function connect(){return new BPromise(function(_0x18bf2d,_0x26844b){return pm2[_0x49c4('0x1')](function(_0x455700){if(_0x455700){return _0x26844b(_0x455700);}return _0x18bf2d(_0x49c4('0x2'));});});};exports['start']=function(_0x4941f1){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x57effd,_0xc1278f){return pm2[_0x49c4('0x4')](_0x4941f1,function(_0x69bc41,_0x2c4e2e){if(_0x69bc41){return _0xc1278f(_0x69bc41);}pm2[_0x49c4('0x5')]();return _0x57effd(_0x2c4e2e);});});});};exports['stop']=function(_0x11c586){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x1d13fb,_0x4487ca){return pm2['stop'](_0x11c586,function(_0x5ab4a3,_0x451ea6){if(_0x5ab4a3){return _0x4487ca(_0x5ab4a3);}pm2[_0x49c4('0x5')]();return _0x1d13fb(_0x451ea6);});});});};exports['restart']=function(_0xb611a1){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x4adb3c,_0x536d42){return pm2[_0x49c4('0x6')](_0xb611a1,function(_0x6d1b08,_0x5487cd){if(_0x6d1b08){return _0x536d42(_0x6d1b08);}pm2[_0x49c4('0x5')]();return _0x4adb3c(_0x5487cd);});});});};exports[_0x49c4('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x1909fe,_0x280996){return pm2[_0x49c4('0x7')](function(_0x2decee,_0x12777c){if(_0x2decee){return _0x280996(_0x2decee);}pm2[_0x49c4('0x5')]();return _0x1909fe(_0x12777c);});});});};exports[_0x49c4('0x8')]=function(_0x3de397){return connect()['then'](function(){return new BPromise(function(_0x3acd06,_0x141003){return pm2[_0x49c4('0x8')](_0x3de397,function(_0x81e831,_0x2abc78){if(_0x81e831){return _0x141003(_0x81e831);}pm2['disconnect']();return _0x3acd06(_0x2abc78);});});});};exports[_0x49c4('0x9')]=function(_0x2891f4){return connect()['then'](function(){return new BPromise(function(_0x512650,_0x3c782d){return pm2[_0x49c4('0x9')](_0x2891f4,function(_0x3addb2,_0x59f29b){if(_0x3addb2){return _0x3c782d(_0x3addb2);}pm2[_0x49c4('0x5')]();return _0x512650(_0x59f29b);});});});};exports['dump']=function(){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x1806c2,_0xe31fcc){return pm2[_0x49c4('0xa')](function(_0x382040){if(_0x382040){return _0xe31fcc(_0x382040);}return _0x1806c2(_0x49c4('0xb'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index f1a7a23..7f80ba0 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 _0x2aa2=['../../mysqldb','../../config/environment','redis','localhost','socket.io-emitter','Setting','chatTimeout','then','ChatInteraction','lastMsgAt','subtract','minutes','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','map','emit','chatInteraction:update','start','lodash','moment','ioredis'];(function(_0x18211c,_0x5da85f){var _0x519e10=function(_0x832252){while(--_0x832252){_0x18211c['push'](_0x18211c['shift']());}};_0x519e10(++_0x5da85f);}(_0x2aa2,0x75));var _0x22aa=function(_0x2cdb45,_0x54928b){_0x2cdb45=_0x2cdb45-0x0;var _0x374912=_0x2aa2[_0x2cdb45];return _0x374912;};'use strict';var _=require(_0x22aa('0x0'));var moment=require(_0x22aa('0x1'));var Redis=require(_0x22aa('0x2'));var db=require(_0x22aa('0x3'))['db'];var config=require(_0x22aa('0x4'));config['redis']=_['defaults'](config[_0x22aa('0x5')],{'host':_0x22aa('0x6'),'port':0x18eb});var io=require(_0x22aa('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0x5eb666=0x0;var _0x3d7c36=[];return db[_0x22aa('0x8')]['find']({'raw':!![],'attributes':['id',_0x22aa('0x9')],'where':{'id':0x1}})[_0x22aa('0xa')](function(_0x39e599){_0x5eb666=_0x39e599[_0x22aa('0x9')];if(_0x5eb666){return db[_0x22aa('0xb')]['findAll']({'raw':!![],'attributes':['id',_0x22aa('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x22aa('0xd')](_0x39e599[_0x22aa('0x9')],_0x22aa('0xe'))}}});}else{return[];}})[_0x22aa('0xa')](function(_0x42d109){_0x3d7c36=_0x42d109;if(_0x5eb666){return db[_0x22aa('0xb')][_0x22aa('0xf')]({'closeReason':_0x22aa('0x10'),'disposition':_0x22aa('0x11'),'closed':!![],'closedAt':moment()[_0x22aa('0x12')](_0x22aa('0x13'))},{'where':{'id':_[_0x22aa('0x14')](_0x3d7c36||[],'id')}});}})[_0x22aa('0xa')](function(_0x27bac4){for(var _0xf085bb=0x0;_0xf085bb<_0x3d7c36['length'];_0xf085bb++){io[_0x22aa('0x15')](_0x22aa('0x16'),{'id':_0x3d7c36[_0xf085bb]['id'],'closed':!![]});}})['catch'](function(_0x455dd4){console['error'](_0x455dd4);});}exports[_0x22aa('0x17')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x5d0e=['lodash','moment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','Setting','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','chatInteraction:update','catch','error'];(function(_0x44ca6e,_0x5e2c91){var _0x2edab2=function(_0x3afa91){while(--_0x3afa91){_0x44ca6e['push'](_0x44ca6e['shift']());}};_0x2edab2(++_0x5e2c91);}(_0x5d0e,0x78));var _0xe5d0=function(_0x88dd14,_0x279b41){_0x88dd14=_0x88dd14-0x0;var _0x797327=_0x5d0e[_0x88dd14];return _0x797327;};'use strict';var _=require(_0xe5d0('0x0'));var moment=require(_0xe5d0('0x1'));var Redis=require('ioredis');var db=require(_0xe5d0('0x2'))['db'];var config=require('../../config/environment');config[_0xe5d0('0x3')]=_[_0xe5d0('0x4')](config['redis'],{'host':_0xe5d0('0x5'),'port':0x18eb});var io=require(_0xe5d0('0x6'))(new Redis(config[_0xe5d0('0x3')]));function closeInteractions(){var _0x56b1e4=0x0;var _0x5d37ae=[];return db[_0xe5d0('0x7')]['find']({'raw':!![],'attributes':['id',_0xe5d0('0x8')],'where':{'id':0x1}})[_0xe5d0('0x9')](function(_0x5786e6){_0x56b1e4=_0x5786e6[_0xe5d0('0x8')];if(_0x56b1e4){return db[_0xe5d0('0xa')][_0xe5d0('0xb')]({'raw':!![],'attributes':['id',_0xe5d0('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xe5d0('0xd')](_0x5786e6[_0xe5d0('0x8')],_0xe5d0('0xe'))}}});}else{return[];}})['then'](function(_0x2f78ba){_0x5d37ae=_0x2f78ba;if(_0x56b1e4){return db[_0xe5d0('0xa')][_0xe5d0('0xf')]({'closeReason':_0xe5d0('0x10'),'disposition':_0xe5d0('0x11'),'closed':!![],'closedAt':moment()[_0xe5d0('0x12')](_0xe5d0('0x13'))},{'where':{'id':_['map'](_0x5d37ae||[],'id')}});}})[_0xe5d0('0x9')](function(_0x45aac9){for(var _0x805266=0x0;_0x805266<_0x5d37ae['length'];_0x805266++){io[_0xe5d0('0x14')](_0xe5d0('0x15'),{'id':_0x5d37ae[_0x805266]['id'],'closed':!![]});}})[_0xe5d0('0x16')](function(_0x517f22){console[_0xe5d0('0x17')](_0x517f22);});}exports['start']=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 90caa48..f6fceec 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 _0x1a08=['map','toString','intersection','difference','length','exists','stop','delete\x20cron','toRun','index','run\x20job','cron','isBetween','startAt','add','start','add\x20cron','deleteJob','stop\x20cron','endAt','update','update\x20cron','run','util','moment','cron-job-manager','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','format','\x22%s\x22\x20<%s>','bcc','name','subtractNumber','subtractUnit','join','savename','%s.%s','basename','existsSync','Sent','message','attachments','status','text','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','then','error','error\x20mail','stringify','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','jobs'];(function(_0x39e2e9,_0x243d50){var _0x3a0c06=function(_0x508482){while(--_0x508482){_0x39e2e9['push'](_0x39e2e9['shift']());}};_0x3a0c06(++_0x243d50);}(_0x1a08,0x6d));var _0x81a0=function(_0x874cf1,_0x2a4954){_0x874cf1=_0x874cf1-0x0;var _0x233579=_0x1a08[_0x874cf1];return _0x233579;};'use strict';var fs=require('fs');var util=require(_0x81a0('0x0'));var path=require('path');var _=require('lodash');var moment=require(_0x81a0('0x1'));var CronJobManager=require(_0x81a0('0x2'));var jayson=require('jayson/promise');var BPromise=require(_0x81a0('0x3'));var logger=require(_0x81a0('0x4'))('schedule');var db=require(_0x81a0('0x5'))['db'];var analyticCustomReportController=require(_0x81a0('0x6'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x81a0('0x7')][_0x81a0('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x46a54f,_0xf672b1){return function(){logger[_0x81a0('0x9')](_0x81a0('0xa'),_0x46a54f[_0x81a0('0xb')]);var _0x1bc5f8=!![];var _0x476560={'tls':{'rejectUnauthorized':![]}};if(_0x46a54f[_0x81a0('0xc')][_0x81a0('0xd')]['service']){_0x476560[_0x81a0('0xe')]=_0x46a54f[_0x81a0('0xc')][_0x81a0('0xd')][_0x81a0('0xe')];}else{_0x476560['host']=_0x46a54f[_0x81a0('0xc')]['Smtp'][_0x81a0('0xf')];_0x476560[_0x81a0('0x10')]=_0x46a54f[_0x81a0('0xc')]['Smtp'][_0x81a0('0x10')];_0x476560[_0x81a0('0x11')]=_0x46a54f[_0x81a0('0xc')][_0x81a0('0xd')][_0x81a0('0x11')];}if(_0x46a54f[_0x81a0('0xc')]['Smtp'][_0x81a0('0x12')]){_0x476560[_0x81a0('0x13')]={'user':_0x46a54f['MailAccount'][_0x81a0('0xd')][_0x81a0('0x14')],'pass':_0x46a54f[_0x81a0('0xc')][_0x81a0('0xd')]['pass']};}var _0x461dc7={'account':_0x476560,'message':{'from':util[_0x81a0('0x15')](_0x81a0('0x16'),_0x46a54f['MailAccount']['name'],_0x46a54f[_0x81a0('0xc')][_0x81a0('0xb')]||_0x46a54f['MailAccount'][_0x81a0('0xd')][_0x81a0('0x14')]),'to':_0x46a54f[_0x81a0('0xb')],'cc':_0x46a54f['cc'],'bcc':_0x46a54f[_0x81a0('0x17')],'subject':util[_0x81a0('0x15')]('Report\x20%s\x20last\x20%s\x20%s',_0xf672b1[_0x81a0('0x18')],_0x46a54f[_0x81a0('0x19')],_0x46a54f[_0x81a0('0x1a')])}};var _0x39dc7b=path[_0x81a0('0x1b')](__dirname,'../../files/reports');var _0x3e871f=_0xf672b1[_0x81a0('0x1c')];var _0x7acd08=util[_0x81a0('0x15')](_0x81a0('0x1d'),path[_0x81a0('0x1e')](_0xf672b1[_0x81a0('0x1c')],path['extname'](_0xf672b1[_0x81a0('0x1c')])),'zip');var _0x181d9d=path[_0x81a0('0x1b')](_0x39dc7b,_0x3e871f);var _0x427a25=path[_0x81a0('0x1b')](_0x39dc7b,_0x7acd08);if(fs[_0x81a0('0x1f')](_0x181d9d)){_0xf672b1['status']=_0x81a0('0x20');_0x461dc7[_0x81a0('0x21')][_0x81a0('0x22')]=[{'filename':_0x3e871f,'path':_0x181d9d}];_0x461dc7['message']['text']=util[_0x81a0('0x15')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON['stringify'](_0xf672b1,null,0x2));}else if(fs[_0x81a0('0x1f')](_0x427a25)){_0xf672b1[_0x81a0('0x23')]=_0x81a0('0x20');_0x461dc7[_0x81a0('0x21')]['attachments']=[{'filename':_0x7acd08,'path':_0x427a25}];}else{_0x461dc7[_0x81a0('0x21')][_0x81a0('0x24')]=_0x81a0('0x25');if(!_0x46a54f['sendIfEmpty']){_0x1bc5f8=![];logger['info'](_0x81a0('0x26'));}}if(_0x1bc5f8){return client[_0x81a0('0x27')](_0x81a0('0x28'),_0x461dc7)[_0x81a0('0x29')](function(_0x2f9158){if(_0x2f9158[_0x81a0('0x2a')]){return logger[_0x81a0('0x2a')](_0x81a0('0x2b'),JSON[_0x81a0('0x2c')](_0x2f9158));}return logger[_0x81a0('0x9')]('email\x20sent');})['catch'](function(_0x24248c){return logger[_0x81a0('0x2a')](_0x81a0('0x2b'),JSON[_0x81a0('0x2c')](_0x24248c));});}};}function handleError(){return function(_0x25241d){return logger[_0x81a0('0x2a')](JSON[_0x81a0('0x2c')](_0x25241d));};}function handleResult(_0x4205a3){return function(_0x5415a8){logger[_0x81a0('0x9')](_0x81a0('0x2d'),JSON['stringify'](_0x5415a8));if(_0x4205a3[_0x81a0('0xc')]&&_0x4205a3[_0x81a0('0xc')][_0x81a0('0xd')]&&!_[_0x81a0('0x2e')](_0x4205a3['email'])){setTimeout(handleSendEmail(_0x4205a3,_0x5415a8),0x3c*0x3e8);}};}function handleJob(_0xb849a5){return function(){try{if(_[_0x81a0('0x2e')](_0xb849a5['subtractNumber'])){return logger[_0x81a0('0x9')](_0x81a0('0x2f'));}if(_['isNil'](_0xb849a5['subtractUnit'])){return logger['info'](_0x81a0('0x30'));}var _0x6822cc={'startDate':moment()['subtract'](_0xb849a5['subtractNumber'],_0xb849a5['subtractUnit'])['format'](_0x81a0('0x31')),'endDate':moment()[_0x81a0('0x15')](_0x81a0('0x31')),'type':_0x81a0('0x32'),'output':_0xb849a5[_0x81a0('0x33')],'name':_0xb849a5[_0x81a0('0x18')]};if(!_['isNil'](_0xb849a5[_0x81a0('0x34')])){logger[_0x81a0('0x9')](_0x81a0('0x35'),_0xb849a5[_0x81a0('0x34')]);return analyticDefaultReportController[_0x81a0('0x36')]({'id':_0xb849a5[_0x81a0('0x34')]},_0x6822cc)['then'](handleResult(_0xb849a5))[_0x81a0('0x37')](handleError());}if(!_[_0x81a0('0x2e')](_0xb849a5[_0x81a0('0x38')])){logger['info'](_0x81a0('0x39'),_0xb849a5[_0x81a0('0x38')]);return analyticCustomReportController[_0x81a0('0x36')]({'id':_0xb849a5['CustomReportId']},_0x6822cc)[_0x81a0('0x29')](handleResult(_0xb849a5))[_0x81a0('0x37')](handleError());}}catch(_0x9e924d){logger[_0x81a0('0x2a')](JSON[_0x81a0('0x2c')](_0x9e924d));}return logger['info'](_0x81a0('0x3a'));};}function getJobs(_0x1e6f72){var _0x415baf={};if(_0x1e6f72){_0x415baf['id']=_0x1e6f72;}return db[_0x81a0('0x3b')][_0x81a0('0x3c')]({'where':_0x415baf,'include':[{'model':db[_0x81a0('0xc')],'attributes':['id',_0x81a0('0x18'),_0x81a0('0xb')],'include':[{'model':db[_0x81a0('0x3d')],'as':_0x81a0('0xd')}]}]})[_0x81a0('0x29')](function(_0x50c20c){var _0x5ccb44=_['keys'](manager[_0x81a0('0x3e')]);var _0xf77b54=_[_0x81a0('0x3f')](_0x50c20c,function(_0x458688){return _0x458688['id']['toString']();});var _0x5cb2db=_['keyBy'](_0x50c20c,function(_0x413273){return _0x413273['id'][_0x81a0('0x40')]();});var _0x5e5966=_0x1e6f72?_0xf77b54:_['difference'](_0xf77b54,_0x5ccb44);var _0x2d8df5=_[_0x81a0('0x41')](_0xf77b54,_0x5ccb44);var _0x20b679=_[_0x81a0('0x42')](_0x5ccb44,_0xf77b54);var _0x4b43a8;var _0x24ea66;for(_0x4b43a8=0x0;_0x4b43a8<_0x20b679[_0x81a0('0x43')]&&!_0x1e6f72;_0x4b43a8+=0x1){_0x24ea66=_0x20b679[_0x4b43a8][_0x81a0('0x40')]();if(manager[_0x81a0('0x44')](_0x24ea66)){manager[_0x81a0('0x45')](_0x24ea66);manager['deleteJob'](_0x24ea66);logger['info'](_0x81a0('0x46'),_0x24ea66);}}logger['info'](_0x81a0('0x47'),JSON['stringify'](_0x5e5966));for(_0x4b43a8=0x0;_0x4b43a8<_0x5e5966[_0x81a0('0x43')];_0x4b43a8+=0x1){_0x24ea66=_0x5e5966[_0x4b43a8][_0x81a0('0x40')]();logger[_0x81a0('0x9')](_0x81a0('0x48'),_0x24ea66);if(_0x1e6f72){logger['info']('my\x20id',_0x1e6f72);logger[_0x81a0('0x9')](JSON[_0x81a0('0x2c')](_0x5cb2db[_0x24ea66]));BPromise['resolve']()[_0x81a0('0x29')](handleJob(_0x5cb2db[_0x24ea66]));logger['info'](_0x81a0('0x49'),_0x5cb2db[_0x24ea66][_0x81a0('0x18')],_0x5cb2db[_0x24ea66][_0x81a0('0x4a')]);}else if(_0x5cb2db[_0x24ea66][_0x81a0('0x4a')]&&_0x5cb2db[_0x24ea66]['active']&&moment()[_0x81a0('0x4b')](_0x5cb2db[_0x24ea66][_0x81a0('0x4c')],_0x5cb2db[_0x24ea66]['endAt'])){manager[_0x81a0('0x4d')](_0x24ea66,_0x5cb2db[_0x24ea66][_0x81a0('0x4a')],handleJob(_0x5cb2db[_0x24ea66]));manager[_0x81a0('0x4e')](_0x24ea66);logger['info'](_0x81a0('0x4f'),_0x5cb2db[_0x24ea66][_0x81a0('0x18')],_0x5cb2db[_0x24ea66]['cron']);}else if(manager['exists'](_0x24ea66)){manager[_0x81a0('0x45')](_0x24ea66);manager[_0x81a0('0x50')](_0x24ea66);logger['info'](_0x81a0('0x51'),_0x5cb2db[_0x24ea66][_0x81a0('0x18')],_0x5cb2db[_0x24ea66][_0x81a0('0x4a')]);}}for(_0x4b43a8=0x0,_0x24ea66;_0x4b43a8<_0x2d8df5[_0x81a0('0x43')]&&!_0x1e6f72;_0x4b43a8+=0x1){_0x24ea66=_0x2d8df5[_0x4b43a8][_0x81a0('0x40')]();if(manager['exists'](_0x24ea66)){if(_0x5cb2db[_0x24ea66]['cron']&&_0x5cb2db[_0x24ea66]['active']&&moment()[_0x81a0('0x4b')](_0x5cb2db[_0x24ea66][_0x81a0('0x4c')],_0x5cb2db[_0x24ea66][_0x81a0('0x52')])){manager[_0x81a0('0x53')](_0x24ea66,_0x5cb2db[_0x24ea66][_0x81a0('0x4a')],handleJob(_0x5cb2db[_0x24ea66]));logger[_0x81a0('0x9')](_0x81a0('0x54'),_0x5cb2db[_0x24ea66]['name'],_0x5cb2db[_0x24ea66][_0x81a0('0x4a')]);}else{manager['stop'](_0x24ea66);manager[_0x81a0('0x50')](_0x24ea66);logger[_0x81a0('0x9')](_0x81a0('0x51'),_0x5cb2db[_0x24ea66][_0x81a0('0x18')],_0x5cb2db[_0x24ea66][_0x81a0('0x4a')]);}}}})[_0x81a0('0x37')](function(_0x3cd05f){logger[_0x81a0('0x2a')](JSON[_0x81a0('0x2c')](_0x3cd05f));});}exports[_0x81a0('0x55')]=function(_0x536fa9){return getJobs(_0x536fa9);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x91a3=['existsSync','status','Sent','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','SendMail','then','error','stringify','catch','error\x20mail','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','Schedule','findAll','MailServerOut','keys','jobs','map','keyBy','toString','difference','intersection','length','deleteJob','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','add\x20cron','exists','stop','stop\x20cron','endAt','update','update\x20cron','start','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','auth','user','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','../../files/reports','%s.%s','basename','savename','extname','zip'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x91a3,0x1a3));var _0x391a=function(_0x41a457,_0x38c5a2){_0x41a457=_0x41a457-0x0;var _0x276489=_0x91a3[_0x41a457];return _0x276489;};'use strict';var fs=require('fs');var util=require(_0x391a('0x0'));var path=require(_0x391a('0x1'));var _=require(_0x391a('0x2'));var moment=require(_0x391a('0x3'));var CronJobManager=require(_0x391a('0x4'));var jayson=require(_0x391a('0x5'));var BPromise=require(_0x391a('0x6'));var logger=require('../logger')(_0x391a('0x7'));var db=require(_0x391a('0x8'))['db'];var analyticCustomReportController=require(_0x391a('0x9'));var analyticDefaultReportController=require(_0x391a('0xa'));var client=jayson[_0x391a('0xb')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x45914a,_0x218092){return function(){logger[_0x391a('0xc')](_0x391a('0xd'),_0x45914a[_0x391a('0xe')]);var _0x27db1c=!![];var _0x4ba809={'tls':{'rejectUnauthorized':![]}};if(_0x45914a[_0x391a('0xf')][_0x391a('0x10')][_0x391a('0x11')]){_0x4ba809['service']=_0x45914a[_0x391a('0xf')]['Smtp']['service'];}else{_0x4ba809[_0x391a('0x12')]=_0x45914a[_0x391a('0xf')][_0x391a('0x10')][_0x391a('0x12')];_0x4ba809['port']=_0x45914a['MailAccount']['Smtp'][_0x391a('0x13')];_0x4ba809[_0x391a('0x14')]=_0x45914a[_0x391a('0xf')][_0x391a('0x10')][_0x391a('0x14')];}if(_0x45914a['MailAccount'][_0x391a('0x10')]['authentication']){_0x4ba809[_0x391a('0x15')]={'user':_0x45914a[_0x391a('0xf')]['Smtp'][_0x391a('0x16')],'pass':_0x45914a[_0x391a('0xf')][_0x391a('0x10')]['pass']};}var _0x43174={'account':_0x4ba809,'message':{'from':util[_0x391a('0x17')](_0x391a('0x18'),_0x45914a[_0x391a('0xf')][_0x391a('0x19')],_0x45914a[_0x391a('0xf')][_0x391a('0xe')]||_0x45914a[_0x391a('0xf')]['Smtp'][_0x391a('0x16')]),'to':_0x45914a[_0x391a('0xe')],'cc':_0x45914a['cc'],'bcc':_0x45914a[_0x391a('0x1a')],'subject':util[_0x391a('0x17')](_0x391a('0x1b'),_0x218092[_0x391a('0x19')],_0x45914a[_0x391a('0x1c')],_0x45914a['subtractUnit'])}};var _0x4ae4ef=path[_0x391a('0x1d')](__dirname,_0x391a('0x1e'));var _0x34357e=_0x218092['savename'];var _0x4a6d60=util[_0x391a('0x17')](_0x391a('0x1f'),path[_0x391a('0x20')](_0x218092[_0x391a('0x21')],path[_0x391a('0x22')](_0x218092[_0x391a('0x21')])),_0x391a('0x23'));var _0xd1bd01=path[_0x391a('0x1d')](_0x4ae4ef,_0x34357e);var _0x3e8e16=path[_0x391a('0x1d')](_0x4ae4ef,_0x4a6d60);if(fs[_0x391a('0x24')](_0xd1bd01)){_0x218092[_0x391a('0x25')]=_0x391a('0x26');_0x43174[_0x391a('0x27')][_0x391a('0x28')]=[{'filename':_0x34357e,'path':_0xd1bd01}];_0x43174[_0x391a('0x27')]['text']=util[_0x391a('0x17')](_0x391a('0x29'),JSON['stringify'](_0x218092,null,0x2));}else if(fs[_0x391a('0x24')](_0x3e8e16)){_0x218092[_0x391a('0x25')]=_0x391a('0x26');_0x43174[_0x391a('0x27')]['attachments']=[{'filename':_0x4a6d60,'path':_0x3e8e16}];}else{_0x43174[_0x391a('0x27')]['text']=_0x391a('0x2a');if(!_0x45914a[_0x391a('0x2b')]){_0x27db1c=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x27db1c){return client[_0x391a('0x2c')](_0x391a('0x2d'),_0x43174)[_0x391a('0x2e')](function(_0x173bcc){if(_0x173bcc[_0x391a('0x2f')]){return logger[_0x391a('0x2f')]('error\x20mail',JSON[_0x391a('0x30')](_0x173bcc));}return logger[_0x391a('0xc')]('email\x20sent');})[_0x391a('0x31')](function(_0x2062d8){return logger[_0x391a('0x2f')](_0x391a('0x32'),JSON['stringify'](_0x2062d8));});}};}function handleError(){return function(_0x3dbad0){return logger[_0x391a('0x2f')](JSON[_0x391a('0x30')](_0x3dbad0));};}function handleResult(_0x503ba3){return function(_0xc513eb){logger[_0x391a('0xc')]('data',JSON['stringify'](_0xc513eb));if(_0x503ba3[_0x391a('0xf')]&&_0x503ba3[_0x391a('0xf')][_0x391a('0x10')]&&!_[_0x391a('0x33')](_0x503ba3[_0x391a('0xe')])){setTimeout(handleSendEmail(_0x503ba3,_0xc513eb),0x3c*0x3e8);}};}function handleJob(_0x49bcdb){return function(){try{if(_[_0x391a('0x33')](_0x49bcdb['subtractNumber'])){return logger[_0x391a('0xc')](_0x391a('0x34'));}if(_[_0x391a('0x33')](_0x49bcdb[_0x391a('0x35')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x19cd61={'startDate':moment()[_0x391a('0x36')](_0x49bcdb['subtractNumber'],_0x49bcdb['subtractUnit'])['format'](_0x391a('0x37')),'endDate':moment()[_0x391a('0x17')](_0x391a('0x37')),'type':_0x391a('0x38'),'output':_0x49bcdb['output'],'name':_0x49bcdb[_0x391a('0x19')]};if(!_[_0x391a('0x33')](_0x49bcdb[_0x391a('0x39')])){logger['info'](_0x391a('0x3a'),_0x49bcdb[_0x391a('0x39')]);return analyticDefaultReportController[_0x391a('0x3b')]({'id':_0x49bcdb[_0x391a('0x39')]},_0x19cd61)[_0x391a('0x2e')](handleResult(_0x49bcdb))[_0x391a('0x31')](handleError());}if(!_[_0x391a('0x33')](_0x49bcdb[_0x391a('0x3c')])){logger[_0x391a('0xc')]('exec\x20custom\x20report\x20id:%s',_0x49bcdb[_0x391a('0x3c')]);return analyticCustomReportController[_0x391a('0x3b')]({'id':_0x49bcdb[_0x391a('0x3c')]},_0x19cd61)[_0x391a('0x2e')](handleResult(_0x49bcdb))[_0x391a('0x31')](handleError());}}catch(_0x5a523d){logger['error'](JSON[_0x391a('0x30')](_0x5a523d));}return logger[_0x391a('0xc')]('no\x20report\x20id');};}function getJobs(_0x5d7b0a){var _0x32903d={};if(_0x5d7b0a){_0x32903d['id']=_0x5d7b0a;}return db[_0x391a('0x3d')][_0x391a('0x3e')]({'where':_0x32903d,'include':[{'model':db[_0x391a('0xf')],'attributes':['id',_0x391a('0x19'),_0x391a('0xe')],'include':[{'model':db[_0x391a('0x3f')],'as':_0x391a('0x10')}]}]})[_0x391a('0x2e')](function(_0x1fde5d){var _0x3d0d78=_[_0x391a('0x40')](manager[_0x391a('0x41')]);var _0x1369bf=_[_0x391a('0x42')](_0x1fde5d,function(_0x1c100d){return _0x1c100d['id']['toString']();});var _0x1a743c=_[_0x391a('0x43')](_0x1fde5d,function(_0x1cd571){return _0x1cd571['id'][_0x391a('0x44')]();});var _0xa6ba07=_0x5d7b0a?_0x1369bf:_[_0x391a('0x45')](_0x1369bf,_0x3d0d78);var _0x36abb4=_[_0x391a('0x46')](_0x1369bf,_0x3d0d78);var _0x4d0fd2=_['difference'](_0x3d0d78,_0x1369bf);var _0x59a2b8;var _0x3cd2b7;for(_0x59a2b8=0x0;_0x59a2b8<_0x4d0fd2[_0x391a('0x47')]&&!_0x5d7b0a;_0x59a2b8+=0x1){_0x3cd2b7=_0x4d0fd2[_0x59a2b8][_0x391a('0x44')]();if(manager['exists'](_0x3cd2b7)){manager['stop'](_0x3cd2b7);manager[_0x391a('0x48')](_0x3cd2b7);logger[_0x391a('0xc')]('delete\x20cron',_0x3cd2b7);}}logger[_0x391a('0xc')](_0x391a('0x49'),JSON[_0x391a('0x30')](_0xa6ba07));for(_0x59a2b8=0x0;_0x59a2b8<_0xa6ba07[_0x391a('0x47')];_0x59a2b8+=0x1){_0x3cd2b7=_0xa6ba07[_0x59a2b8][_0x391a('0x44')]();logger[_0x391a('0xc')](_0x391a('0x4a'),_0x3cd2b7);if(_0x5d7b0a){logger[_0x391a('0xc')](_0x391a('0x4b'),_0x5d7b0a);logger[_0x391a('0xc')](JSON[_0x391a('0x30')](_0x1a743c[_0x3cd2b7]));BPromise[_0x391a('0x4c')]()[_0x391a('0x2e')](handleJob(_0x1a743c[_0x3cd2b7]));logger[_0x391a('0xc')](_0x391a('0x4d'),_0x1a743c[_0x3cd2b7][_0x391a('0x19')],_0x1a743c[_0x3cd2b7][_0x391a('0x4e')]);}else if(_0x1a743c[_0x3cd2b7]['cron']&&_0x1a743c[_0x3cd2b7][_0x391a('0x4f')]&&moment()[_0x391a('0x50')](_0x1a743c[_0x3cd2b7][_0x391a('0x51')],_0x1a743c[_0x3cd2b7]['endAt'])){manager[_0x391a('0x52')](_0x3cd2b7,_0x1a743c[_0x3cd2b7][_0x391a('0x4e')],handleJob(_0x1a743c[_0x3cd2b7]));manager['start'](_0x3cd2b7);logger[_0x391a('0xc')](_0x391a('0x53'),_0x1a743c[_0x3cd2b7][_0x391a('0x19')],_0x1a743c[_0x3cd2b7]['cron']);}else if(manager[_0x391a('0x54')](_0x3cd2b7)){manager[_0x391a('0x55')](_0x3cd2b7);manager[_0x391a('0x48')](_0x3cd2b7);logger[_0x391a('0xc')](_0x391a('0x56'),_0x1a743c[_0x3cd2b7][_0x391a('0x19')],_0x1a743c[_0x3cd2b7][_0x391a('0x4e')]);}}for(_0x59a2b8=0x0,_0x3cd2b7;_0x59a2b8<_0x36abb4[_0x391a('0x47')]&&!_0x5d7b0a;_0x59a2b8+=0x1){_0x3cd2b7=_0x36abb4[_0x59a2b8][_0x391a('0x44')]();if(manager[_0x391a('0x54')](_0x3cd2b7)){if(_0x1a743c[_0x3cd2b7][_0x391a('0x4e')]&&_0x1a743c[_0x3cd2b7][_0x391a('0x4f')]&&moment()['isBetween'](_0x1a743c[_0x3cd2b7][_0x391a('0x51')],_0x1a743c[_0x3cd2b7][_0x391a('0x57')])){manager[_0x391a('0x58')](_0x3cd2b7,_0x1a743c[_0x3cd2b7][_0x391a('0x4e')],handleJob(_0x1a743c[_0x3cd2b7]));logger[_0x391a('0xc')](_0x391a('0x59'),_0x1a743c[_0x3cd2b7][_0x391a('0x19')],_0x1a743c[_0x3cd2b7]['cron']);}else{manager[_0x391a('0x55')](_0x3cd2b7);manager[_0x391a('0x48')](_0x3cd2b7);logger[_0x391a('0xc')](_0x391a('0x56'),_0x1a743c[_0x3cd2b7][_0x391a('0x19')],_0x1a743c[_0x3cd2b7][_0x391a('0x4e')]);}}}})[_0x391a('0x31')](function(_0x521abb){logger['error'](JSON[_0x391a('0x30')](_0x521abb));});}exports['run']=function(_0x1a2356){return getJobs(_0x1a2356);};exports[_0x391a('0x5a')]=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 91276e5..89aa8df 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf6e=['bulkCreate','hopper1','hopper2','catch','util','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','push','now','CmContact','destroy','then','log','finished\x20populating','contacts1','CmHopper'];(function(_0x1d2fda,_0x13bc0f){var _0x29c583=function(_0x1b2887){while(--_0x1b2887){_0x1d2fda['push'](_0x1d2fda['shift']());}};_0x29c583(++_0x13bc0f);}(_0xdf6e,0x89));var _0xedf6=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xdf6e[_0x13e741];return _0x3f8bb3;};'use strict';var util=require(_0xedf6('0x0'));var db=require(_0xedf6('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xedf6('0x2')+i,'lastName':_0xedf6('0x3')+i,'phone':0xf879fb460+i,'email':_0xedf6('0x4')+i+_0xedf6('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xedf6('0x6')]({'id':i,'active':![],'scheduledat':Date[_0xedf6('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xedf6('0x7')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xedf6('0x6')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xedf6('0x3')+i,'phone':0xf879fb460+i,'email':_0xedf6('0x4')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xedf6('0x6')]({'id':i,'active':![],'scheduledat':Date[_0xedf6('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xedf6('0x7')](),'updatedAt':Date[_0xedf6('0x7')]()});}db[_0xedf6('0x8')][_0xedf6('0x9')]({'where':{}})[_0xedf6('0xa')](function(){return db[_0xedf6('0x8')]['bulkCreate'](contacts);})[_0xedf6('0xa')](function(){console[_0xedf6('0xb')](_0xedf6('0xc'),_0xedf6('0xd'));return db[_0xedf6('0xe')][_0xedf6('0x9')]({'where':{}});})['then'](function(){return db['CmHopper'][_0xedf6('0xf')](hopper);})[_0xedf6('0xa')](function(){console[_0xedf6('0xb')](_0xedf6('0xc'),_0xedf6('0x10'));return db[_0xedf6('0x8')][_0xedf6('0xf')](contacts2);})[_0xedf6('0xa')](function(){console[_0xedf6('0xb')](_0xedf6('0xc'),'contacts2');return db[_0xedf6('0xe')][_0xedf6('0xf')](hopper2);})[_0xedf6('0xa')](function(){console['log'](_0xedf6('0xc'),_0xedf6('0x11'));})[_0xedf6('0x12')](function(_0x2a18ab){console['log'](_0x2a18ab);}); \ No newline at end of file +var _0x31a3=['log','finished\x20populating','CmHopper','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate'];(function(_0x441eaf,_0x5cb00b){var _0x154f35=function(_0x445ad2){while(--_0x445ad2){_0x441eaf['push'](_0x441eaf['shift']());}};_0x154f35(++_0x5cb00b);}(_0x31a3,0x183));var _0x331a=function(_0x297dcf,_0x448cf5){_0x297dcf=_0x297dcf-0x0;var _0xe1699b=_0x31a3[_0x297dcf];return _0xe1699b;};'use strict';var util=require(_0x331a('0x0'));var db=require(_0x331a('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x331a('0x2')]({'id':i,'firstName':_0x331a('0x3')+i,'lastName':_0x331a('0x4')+i,'phone':0xf879fb460+i,'email':_0x331a('0x5')+i+_0x331a('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x331a('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x331a('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x331a('0x7')](),'updatedAt':Date[_0x331a('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x331a('0x2')]({'id':i,'firstName':_0x331a('0x3')+i,'lastName':_0x331a('0x4')+i,'phone':0xf879fb460+i,'email':_0x331a('0x5')+i+_0x331a('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x331a('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x331a('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db[_0x331a('0x8')][_0x331a('0x9')]({'where':{}})[_0x331a('0xa')](function(){return db[_0x331a('0x8')][_0x331a('0xb')](contacts);})[_0x331a('0xa')](function(){console[_0x331a('0xc')](_0x331a('0xd'),'contacts1');return db[_0x331a('0xe')][_0x331a('0x9')]({'where':{}});})[_0x331a('0xa')](function(){return db[_0x331a('0xe')][_0x331a('0xb')](hopper);})[_0x331a('0xa')](function(){console[_0x331a('0xc')](_0x331a('0xd'),_0x331a('0xf'));return db[_0x331a('0x8')]['bulkCreate'](contacts2);})[_0x331a('0xa')](function(){console[_0x331a('0xc')]('finished\x20populating',_0x331a('0x10'));return db['CmHopper'][_0x331a('0xb')](hopper2);})[_0x331a('0xa')](function(){console[_0x331a('0xc')](_0x331a('0xd'),_0x331a('0x11'));})[_0x331a('0x12')](function(_0x394a95){console[_0x331a('0xc')](_0x394a95);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 511a173..305a029 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce64=['log','add\x20user','catch','util','../mysqldb','format','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','%s%s','User','bulkCreate'];(function(_0x8ab7dc,_0x58006f){var _0xc9b621=function(_0x434a50){while(--_0x434a50){_0x8ab7dc['push'](_0x8ab7dc['shift']());}};_0xc9b621(++_0x58006f);}(_0xce64,0x1e7));var _0x4ce6=function(_0x3ea9fb,_0x1ada5f){_0x3ea9fb=_0x3ea9fb-0x0;var _0x5a10a4=_0xce64[_0x3ea9fb];return _0x5a10a4;};'use strict';var util=require(_0x4ce6('0x0'));var db=require(_0x4ce6('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x4ce6('0x2')]('%s%s',_0x4ce6('0x3'),i),'fullname':util['format']('%s%s',_0x4ce6('0x3'),i),'email':util[_0x4ce6('0x2')](_0x4ce6('0x4'),_0x4ce6('0x3'),i),'role':_0x4ce6('0x3'),'password':_0x4ce6('0x5'),'internal':0xfa0+i,'type':_0x4ce6('0x6'),'transport':[_0x4ce6('0x7'),'ws',_0x4ce6('0x8')],'disallow':[_0x4ce6('0x9')],'allow':[_0x4ce6('0xa')],'defaultuser':util[_0x4ce6('0x2')]('%s%s',_0x4ce6('0x3'),i),'encryption':_0x4ce6('0xb'),'avpf':_0x4ce6('0xb'),'force_avp':_0x4ce6('0xb'),'icesupport':_0x4ce6('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x4ce6('0xc'),'dtlsprivatekey':_0x4ce6('0xd'),'dtlssetup':_0x4ce6('0xe'),'callerid':util[_0x4ce6('0x2')](_0x4ce6('0xf'),util[_0x4ce6('0x2')](_0x4ce6('0x10'),_0x4ce6('0x3'),i),0xfa0+i)});}db[_0x4ce6('0x11')][_0x4ce6('0x12')](users)['then'](function(){console[_0x4ce6('0x13')](_0x4ce6('0x14'));})[_0x4ce6('0x15')](function(_0xc3f120){console[_0x4ce6('0x13')](_0xc3f120);}); \ No newline at end of file +var _0x5a81=['../mysqldb','push','%s%s','agent','format','%s%s@xcally.com','password','wss','ulaw','yes','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','then','log','util'];(function(_0x382dcc,_0x3eba4d){var _0x744637=function(_0x28b384){while(--_0x28b384){_0x382dcc['push'](_0x382dcc['shift']());}};_0x744637(++_0x3eba4d);}(_0x5a81,0x1cf));var _0x15a8=function(_0x334c39,_0x3a4ba3){_0x334c39=_0x334c39-0x0;var _0x351467=_0x5a81[_0x334c39];return _0x351467;};'use strict';var util=require(_0x15a8('0x0'));var db=require(_0x15a8('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x15a8('0x2')]({'name':util['format'](_0x15a8('0x3'),_0x15a8('0x4'),i),'fullname':util[_0x15a8('0x5')](_0x15a8('0x3'),_0x15a8('0x4'),i),'email':util['format'](_0x15a8('0x6'),'agent',i),'role':'agent','password':_0x15a8('0x7'),'internal':0xfa0+i,'type':'friend','transport':['udp','ws',_0x15a8('0x8')],'disallow':['all'],'allow':[_0x15a8('0x9')],'defaultuser':util[_0x15a8('0x5')](_0x15a8('0x3'),_0x15a8('0x4'),i),'encryption':_0x15a8('0xa'),'avpf':_0x15a8('0xa'),'force_avp':_0x15a8('0xa'),'icesupport':_0x15a8('0xa'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x15a8('0xb'),'dtlssetup':'actpass','callerid':util['format'](_0x15a8('0xc'),util[_0x15a8('0x5')](_0x15a8('0x3'),'agent',i),0xfa0+i)});}db[_0x15a8('0xd')]['bulkCreate'](users)[_0x15a8('0xe')](function(){console[_0x15a8('0xf')]('add\x20user');})['catch'](function(_0x334383){console[_0x15a8('0xf')](_0x334383);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 8208e36..99fefe7 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5f4=['ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','MailQueues','OpenchannelQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','map','resourceId','where','role','Campaign','format','%s:queue:%s','Agents','length','query','find','userProfileId','handshake','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','ChatQueue','FaxQueue','SmsQueue','OpenchannelQueue','user','MailQueue','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','all','chat','fax','sms','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','user:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','catch','connection','setMaxListeners','address','request','remoteAddress','remotePort','log','SocketIO\x20','nsp','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','name','User','agent','telephone'];(function(_0x1ddd0,_0x15f9f4){var _0x4d86d0=function(_0x3173d7){while(--_0x3173d7){_0x1ddd0['push'](_0x1ddd0['shift']());}};_0x4d86d0(++_0x15f9f4);}(_0xe5f4,0x1ba));var _0x4e5f=function(_0x3c5735,_0x1f4f53){_0x3c5735=_0x3c5735-0x0;var _0x2cd61d=_0xe5f4[_0x3c5735];return _0x2cd61d;};'use strict';var _=require(_0x4e5f('0x0'));var util=require(_0x4e5f('0x1'));var BPromise=require(_0x4e5f('0x2'));var db=require(_0x4e5f('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x4e5f('0x4')],'include':[{'as':'Agents','model':db[_0x4e5f('0x5')],'attributes':['id',_0x4e5f('0x4'),'role'],'raw':!![],'where':{'role':_0x4e5f('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x4e5f('0x4')],'where':{'role':_0x4e5f('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x4e5f('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x4e5f('0x4')],'where':{'role':_0x4e5f('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x4e5f('0x4'),'type'],'where':{'type':_0x4e5f('0x8')}};function getAssociatedResources(_0xa5a062,_0xa6a158,_0x456785){return db[_0x4e5f('0x9')][_0x4e5f('0xa')]({'where':{'name':_0xa5a062,'userProfileId':_0xa6a158},'raw':!![]})[_0x4e5f('0xb')](function(_0x190705){if(_0x190705){if(_0x190705[_0x4e5f('0xc')]){switch(_0xa5a062){case'VoiceQueues':case _0x4e5f('0xd'):case'FaxQueues':case'SmsQueues':case _0x4e5f('0xe'):case _0x4e5f('0xf'):return db[_0x456785]['findAll'](queryQueues);case _0x4e5f('0x10'):return db[_0x456785][_0x4e5f('0x11')](queryTelephones);case _0x4e5f('0x12'):return db[_0x456785][_0x4e5f('0x11')](queryTrunks);case _0x4e5f('0x13'):return db[_0x456785]['findAll'](queryCampaigns);}}else{return db[_0x4e5f('0x14')][_0x4e5f('0x11')]({'attributes':['resourceId'],'where':{'sectionId':_0x190705['id']},'raw':!![]})[_0x4e5f('0xb')](function(_0x2e373c){if(_0x2e373c){var _0x4e0931={'where':{'id':_[_0x4e5f('0x15')](_0x2e373c,_0x4e5f('0x16'))},'raw':!![]};switch(_0x456785){case _0x4e5f('0x5'):_0x4e0931[_0x4e5f('0x17')][_0x4e5f('0x18')]='telephone';break;case _0x4e5f('0x19'):_0x4e0931[_0x4e5f('0x17')]['type']=_0x4e5f('0x8');break;}return db[_0x456785][_0x4e5f('0x11')](_0x4e0931);}else{return[];}});}}else{return[];}})[_0x4e5f('0xb')](function(_0x2b877d){return _0x2b877d;});}function joinOrLeaveQueues(_0x4d1dbb,_0x2a9276,_0x3e9cb9,_0x3c1216){_0x4d1dbb[_0x2a9276](util[_0x4e5f('0x1a')](_0x4e5f('0x1b'),_0x3e9cb9,_0x3c1216[_0x4e5f('0x4')]));if(_0x3c1216[_0x4e5f('0x1c')]){for(var _0x222aa1=0x0;_0x222aa1<_0x3c1216['Agents'][_0x4e5f('0x1d')];_0x222aa1+=0x1){_0x4d1dbb[_0x2a9276](util[_0x4e5f('0x1a')]('user:%s',_0x3c1216[_0x4e5f('0x1c')][_0x222aa1][_0x4e5f('0x4')]));}}}function joinOrLeave(_0x2a0b0f,_0x34cd77,_0x4bbc07){var _0x2f536b;if(_0x2a0b0f['handshake'][_0x4e5f('0x1e')]['id']){db[_0x4e5f('0x5')][_0x4e5f('0x1f')]({'attributes':['id',_0x4e5f('0x4'),_0x4e5f('0x18'),_0x4e5f('0x20')],'where':{'id':_0x2a0b0f[_0x4e5f('0x21')]['query']['id']},'include':[{'model':db['ChatInteraction'],'as':_0x4e5f('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x4e5f('0x23')],'as':_0x4e5f('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x4e5f('0x25')],'as':_0x4e5f('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x4e5f('0x27')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x4e5f('0x28'),'attributes':['id'],'raw':!![]}]})[_0x4e5f('0xb')](function(_0x1966c9){if(_0x1966c9){_0x2f536b=_0x1966c9;_0x2a0b0f[_0x34cd77](util[_0x4e5f('0x1a')]('user:%s',_0x1966c9['name']));var _0x4ad0f7=[];switch(_0x1966c9[_0x4e5f('0x18')]){case _0x4e5f('0x29'):_0x2a0b0f[_0x34cd77](_0x4e5f('0x2a'));_0x2a0b0f[_0x34cd77](_0x4e5f('0x2b'));if(queryQueues[_0x4e5f('0x2c')]('include')){delete queryQueues[_0x4e5f('0x2d')];}_0x4ad0f7['push'](db[_0x4e5f('0x2e')][_0x4e5f('0x11')](queryQueues));_0x4ad0f7[_0x4e5f('0x2f')](db[_0x4e5f('0x30')][_0x4e5f('0x11')](queryQueues));_0x4ad0f7[_0x4e5f('0x2f')](db[_0x4e5f('0x31')][_0x4e5f('0x11')](queryQueues));_0x4ad0f7['push'](db[_0x4e5f('0x32')][_0x4e5f('0x11')](queryQueues));_0x4ad0f7[_0x4e5f('0x2f')](db['MailQueue'][_0x4e5f('0x11')](queryQueues));_0x4ad0f7[_0x4e5f('0x2f')](db[_0x4e5f('0x33')][_0x4e5f('0x11')](queryQueues));_0x4ad0f7[_0x4e5f('0x2f')](db['User']['findAll'](queryTelephones));_0x4ad0f7['push'](db['Trunk'][_0x4e5f('0x11')](queryTrunks));_0x4ad0f7[_0x4e5f('0x2f')](db[_0x4e5f('0x19')][_0x4e5f('0x11')](queryCampaigns));_0x4ad0f7[_0x4e5f('0x2f')](db['User']['findAll'](queryAgents));break;case _0x4e5f('0x34'):_0x2a0b0f[_0x34cd77](_0x4e5f('0x2a'));_0x2a0b0f[_0x34cd77](_0x4e5f('0x2b'));_0x4ad0f7[_0x4e5f('0x2f')](getAssociatedResources('VoiceQueues',_0x1966c9[_0x4e5f('0x20')],_0x4e5f('0x2e')));_0x4ad0f7[_0x4e5f('0x2f')](getAssociatedResources(_0x4e5f('0xd'),_0x1966c9[_0x4e5f('0x20')],'ChatQueue'));_0x4ad0f7[_0x4e5f('0x2f')](getAssociatedResources('FaxQueues',_0x1966c9['userProfileId'],_0x4e5f('0x31')));_0x4ad0f7[_0x4e5f('0x2f')](getAssociatedResources('SmsQueues',_0x1966c9[_0x4e5f('0x20')],_0x4e5f('0x32')));_0x4ad0f7[_0x4e5f('0x2f')](getAssociatedResources('MailQueues',_0x1966c9['userProfileId'],_0x4e5f('0x35')));_0x4ad0f7[_0x4e5f('0x2f')](getAssociatedResources(_0x4e5f('0xf'),_0x1966c9[_0x4e5f('0x20')],_0x4e5f('0x33')));_0x4ad0f7[_0x4e5f('0x2f')](getAssociatedResources(_0x4e5f('0x10'),_0x1966c9[_0x4e5f('0x20')],'User'));_0x4ad0f7[_0x4e5f('0x2f')](getAssociatedResources('Trunks',_0x1966c9[_0x4e5f('0x20')],_0x4e5f('0x36')));_0x4ad0f7[_0x4e5f('0x2f')](getAssociatedResources(_0x4e5f('0x13'),_0x1966c9[_0x4e5f('0x20')],_0x4e5f('0x19')));_0x4ad0f7[_0x4e5f('0x2f')](db['User'][_0x4e5f('0x11')](queryAgents));break;case'agent':_0x2a0b0f[_0x34cd77](_0x4e5f('0x2a'));_0x2a0b0f[_0x34cd77](_0x4e5f('0x2b'));_0x4ad0f7[_0x4e5f('0x2f')](_0x1966c9[_0x4e5f('0x37')]({'attributes':['id',_0x4e5f('0x4')]}));_0x4ad0f7[_0x4e5f('0x2f')](_0x1966c9[_0x4e5f('0x38')]({'attributes':['id',_0x4e5f('0x4')]}));_0x4ad0f7[_0x4e5f('0x2f')](_0x1966c9[_0x4e5f('0x39')]({'attributes':['id','name']}));_0x4ad0f7[_0x4e5f('0x2f')](_0x1966c9['getSmsQueues']({'attributes':['id',_0x4e5f('0x4')]}));_0x4ad0f7[_0x4e5f('0x2f')](_0x1966c9['getMailQueues']({'attributes':['id',_0x4e5f('0x4')]}));_0x4ad0f7[_0x4e5f('0x2f')](_0x1966c9['getOpenchannelQueues']({'attributes':['id',_0x4e5f('0x4')]}));break;}return BPromise[_0x4e5f('0x3a')](_0x4ad0f7);}})[_0x4e5f('0xb')](function(_0x5b3ef6){if(_0x5b3ef6&&_0x5b3ef6[_0x4e5f('0x1d')]){for(var _0xbb0468=0x0;_0xbb0468<_0x5b3ef6[_0x4e5f('0x1d')];_0xbb0468+=0x1){for(var _0x541100=0x0;_0x541100<_0x5b3ef6[_0xbb0468]['length'];_0x541100+=0x1){switch(_0xbb0468){case 0x0:joinOrLeaveQueues(_0x2a0b0f,_0x34cd77,'voice',_0x5b3ef6[_0xbb0468][_0x541100]);break;case 0x1:joinOrLeaveQueues(_0x2a0b0f,_0x34cd77,_0x4e5f('0x3b'),_0x5b3ef6[_0xbb0468][_0x541100]);break;case 0x2:joinOrLeaveQueues(_0x2a0b0f,_0x34cd77,_0x4e5f('0x3c'),_0x5b3ef6[_0xbb0468][_0x541100]);break;case 0x3:joinOrLeaveQueues(_0x2a0b0f,_0x34cd77,_0x4e5f('0x3d'),_0x5b3ef6[_0xbb0468][_0x541100]);break;case 0x4:joinOrLeaveQueues(_0x2a0b0f,_0x34cd77,_0x4e5f('0x3e'),_0x5b3ef6[_0xbb0468][_0x541100]);break;case 0x5:joinOrLeaveQueues(_0x2a0b0f,_0x34cd77,_0x4e5f('0x3f'),_0x5b3ef6[_0xbb0468][_0x541100]);break;case 0x6:_0x2a0b0f[_0x34cd77](util['format'](_0x4e5f('0x40'),_0x5b3ef6[_0xbb0468][_0x541100][_0x4e5f('0x4')]));break;case 0x7:_0x2a0b0f[_0x34cd77](util['format'](_0x4e5f('0x41'),_0x5b3ef6[_0xbb0468][_0x541100][_0x4e5f('0x4')]));break;case 0x8:_0x2a0b0f[_0x34cd77](util[_0x4e5f('0x1a')](_0x4e5f('0x42'),_0x5b3ef6[_0xbb0468][_0x541100]['type'],_0x5b3ef6[_0xbb0468][_0x541100][_0x4e5f('0x4')]));break;case 0x9:_0x2a0b0f[_0x34cd77](util[_0x4e5f('0x1a')](_0x4e5f('0x43'),_0x5b3ef6[_0xbb0468][_0x541100][_0x4e5f('0x4')]));break;}}}}})[_0x4e5f('0xb')](function(){if(_0x34cd77===_0x4e5f('0x44')){var _0x46bdb5=_[_0x4e5f('0x15')](_0x2f536b['ChatInteractions'],'id');return _0x2f536b[_0x4e5f('0x45')](_0x46bdb5)[_0x4e5f('0xb')](function(){for(var _0x57d0e1=0x0;_0x57d0e1<_0x46bdb5[_0x4e5f('0x1d')];_0x57d0e1+=0x1){_0x4bbc07[_0x4e5f('0x46')](_0x4e5f('0x47'),{'ChatInteractionId':Number(_0x46bdb5[_0x57d0e1]),'UserId':Number(_0x2f536b['id'])});}});}})['then'](function(){if(_0x34cd77==='leave'){var _0x3720b3=_[_0x4e5f('0x15')](_0x2f536b['MailInteractions'],'id');return _0x2f536b[_0x4e5f('0x48')](_0x3720b3)[_0x4e5f('0xb')](function(){for(var _0x1ccde6=0x0;_0x1ccde6<_0x3720b3[_0x4e5f('0x1d')];_0x1ccde6+=0x1){_0x4bbc07['emit'](_0x4e5f('0x49'),{'MailInteractionId':Number(_0x3720b3[_0x1ccde6]),'UserId':Number(_0x2f536b['id'])});}});}})['then'](function(){if(_0x34cd77===_0x4e5f('0x44')){var _0x19d908=_['map'](_0x2f536b[_0x4e5f('0x26')],'id');return _0x2f536b[_0x4e5f('0x4a')](_0x19d908)[_0x4e5f('0xb')](function(){for(var _0xa6c20a=0x0;_0xa6c20a<_0x19d908[_0x4e5f('0x1d')];_0xa6c20a+=0x1){_0x4bbc07[_0x4e5f('0x46')](_0x4e5f('0x4b'),{'FaxInteractionId':Number(_0x19d908[_0xa6c20a]),'UserId':Number(_0x2f536b['id'])});}});}})[_0x4e5f('0xb')](function(){if(_0x34cd77==='leave'){var _0x10e989=_['map'](_0x2f536b['SmsInteractions'],'id');return _0x2f536b['removeSmsInteractions'](_0x10e989)[_0x4e5f('0xb')](function(){for(var _0x322a0f=0x0;_0x322a0f<_0x10e989['length'];_0x322a0f+=0x1){_0x4bbc07[_0x4e5f('0x46')](_0x4e5f('0x4c'),{'SmsInteractionId':Number(_0x10e989[_0x322a0f]),'UserId':Number(_0x2f536b['id'])});}});}})[_0x4e5f('0xb')](function(){if(_0x34cd77==='leave'){var _0x548f52=_[_0x4e5f('0x15')](_0x2f536b[_0x4e5f('0x28')],'id');return _0x2f536b['removeOpenchannelInteractions'](_0x548f52)['then'](function(){for(var _0x13bc58=0x0;_0x13bc58<_0x548f52[_0x4e5f('0x1d')];_0x13bc58+=0x1){_0x4bbc07[_0x4e5f('0x46')](_0x4e5f('0x4d'),{'OpenchannelInteractionId':Number(_0x548f52[_0x13bc58]),'UserId':Number(_0x2f536b['id'])});}});}})[_0x4e5f('0x4e')](function(_0x1f7567){_0x2a0b0f['log'](_0x1f7567);});}}function onDisconnect(_0x5e5fe5,_0x19bc09){joinOrLeave(_0x5e5fe5,_0x4e5f('0x44'),_0x19bc09);}function onConnect(_0x32708f){joinOrLeave(_0x32708f,'join');}exports['default']=function(_0x2bd6d5){_0x2bd6d5['on'](_0x4e5f('0x4f'),function(_0x1988ec){_0x1988ec[_0x4e5f('0x50')](0x0);_0x1988ec[_0x4e5f('0x51')]=_0x1988ec[_0x4e5f('0x52')][_0x4e5f('0x4f')][_0x4e5f('0x53')]+':'+_0x1988ec['request'][_0x4e5f('0x4f')][_0x4e5f('0x54')];_0x1988ec['connectedAt']=new Date();_0x1988ec[_0x4e5f('0x55')]=function(_0x2f4d8d){console['log'](_0x4e5f('0x56')+_0x1988ec[_0x4e5f('0x57')][_0x4e5f('0x4')]+'['+_0x1988ec['address']+']',_0x2f4d8d);};_0x1988ec['on']('disconnect',function(){onDisconnect(_0x1988ec,_0x2bd6d5);_0x1988ec['log'](_0x4e5f('0x58'));});onConnect(_0x1988ec);_0x1988ec[_0x4e5f('0x55')](_0x4e5f('0x59'));});}; \ No newline at end of file +var _0x0621=['mail','openchannel','trunk:%s','campaign:%s:%s','leave','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join','default','connection','setMaxListeners','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','Agents','name','role','agent','telephone','type','ivr','UserProfileSection','then','VoiceQueues','ChatQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','map','where','format','%s:queue:%s','length','find','userProfileId','handshake','query','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','user:%s','admin','voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','SmsQueue','OpenchannelQueue','User','Campaign','user','VoiceQueue','MailQueue','Trunks','voice:inbound','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','fax','sms'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0621,0x7c));var _0x1062=function(_0x45cd48,_0x5821bd){_0x45cd48=_0x45cd48-0x0;var _0x5aae54=_0x0621[_0x45cd48];return _0x5aae54;};'use strict';var _=require(_0x1062('0x0'));var util=require(_0x1062('0x1'));var BPromise=require(_0x1062('0x2'));var db=require(_0x1062('0x3'))['db'];var config=require(_0x1062('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x1062('0x5'),'model':db['User'],'attributes':['id',_0x1062('0x6'),_0x1062('0x7')],'raw':!![],'where':{'role':_0x1062('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x1062('0x6')],'where':{'role':_0x1062('0x9')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x1062('0x6'),_0x1062('0xa')],'where':{'type':_0x1062('0xb')}};function getAssociatedResources(_0x50a6cd,_0x14efea,_0x23fb68){return db[_0x1062('0xc')]['findOne']({'where':{'name':_0x50a6cd,'userProfileId':_0x14efea},'raw':!![]})[_0x1062('0xd')](function(_0x4e003e){if(_0x4e003e){if(_0x4e003e['autoAssociation']){switch(_0x50a6cd){case _0x1062('0xe'):case _0x1062('0xf'):case'FaxQueues':case _0x1062('0x10'):case _0x1062('0x11'):case _0x1062('0x12'):return db[_0x23fb68][_0x1062('0x13')](queryQueues);case _0x1062('0x14'):return db[_0x23fb68][_0x1062('0x13')](queryTelephones);case'Trunks':return db[_0x23fb68]['findAll'](queryTrunks);case _0x1062('0x15'):return db[_0x23fb68][_0x1062('0x13')](queryCampaigns);}}else{return db[_0x1062('0x16')][_0x1062('0x13')]({'attributes':[_0x1062('0x17')],'where':{'sectionId':_0x4e003e['id']},'raw':!![]})[_0x1062('0xd')](function(_0x114c2d){if(_0x114c2d){var _0x1203a9={'where':{'id':_[_0x1062('0x18')](_0x114c2d,_0x1062('0x17'))},'raw':!![]};switch(_0x23fb68){case'User':_0x1203a9[_0x1062('0x19')][_0x1062('0x7')]=_0x1062('0x9');break;case'Campaign':_0x1203a9['where'][_0x1062('0xa')]=_0x1062('0xb');break;}return db[_0x23fb68][_0x1062('0x13')](_0x1203a9);}else{return[];}});}}else{return[];}})['then'](function(_0xf8f42c){return _0xf8f42c;});}function joinOrLeaveQueues(_0x4c4f06,_0x289d38,_0x4f94a7,_0x58a688){_0x4c4f06[_0x289d38](util[_0x1062('0x1a')](_0x1062('0x1b'),_0x4f94a7,_0x58a688['name']));if(_0x58a688[_0x1062('0x5')]){for(var _0x2b3fd5=0x0;_0x2b3fd5<_0x58a688[_0x1062('0x5')][_0x1062('0x1c')];_0x2b3fd5+=0x1){_0x4c4f06[_0x289d38](util[_0x1062('0x1a')]('user:%s',_0x58a688['Agents'][_0x2b3fd5]['name']));}}}function joinOrLeave(_0x37b2a7,_0xe7debd,_0xac29ba){var _0x5c27d9;if(_0x37b2a7['handshake']['query']['id']){db['User'][_0x1062('0x1d')]({'attributes':['id',_0x1062('0x6'),'role',_0x1062('0x1e')],'where':{'id':_0x37b2a7[_0x1062('0x1f')][_0x1062('0x20')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x1062('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x1062('0x22')],'as':_0x1062('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x1062('0x24')],'as':_0x1062('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x1062('0x26')],'as':_0x1062('0x27'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]}]})[_0x1062('0xd')](function(_0x4883cc){if(_0x4883cc){_0x5c27d9=_0x4883cc;_0x37b2a7[_0xe7debd](util[_0x1062('0x1a')](_0x1062('0x28'),_0x4883cc[_0x1062('0x6')]));var _0x11b2ad=[];switch(_0x4883cc[_0x1062('0x7')]){case _0x1062('0x29'):_0x37b2a7[_0xe7debd]('voice:inbound');_0x37b2a7[_0xe7debd](_0x1062('0x2a'));if(queryQueues[_0x1062('0x2b')](_0x1062('0x2c'))){delete queryQueues[_0x1062('0x2c')];}_0x11b2ad[_0x1062('0x2d')](db['VoiceQueue'][_0x1062('0x13')](queryQueues));_0x11b2ad[_0x1062('0x2d')](db[_0x1062('0x2e')][_0x1062('0x13')](queryQueues));_0x11b2ad[_0x1062('0x2d')](db[_0x1062('0x2f')][_0x1062('0x13')](queryQueues));_0x11b2ad[_0x1062('0x2d')](db[_0x1062('0x30')][_0x1062('0x13')](queryQueues));_0x11b2ad[_0x1062('0x2d')](db['MailQueue'][_0x1062('0x13')](queryQueues));_0x11b2ad[_0x1062('0x2d')](db[_0x1062('0x31')][_0x1062('0x13')](queryQueues));_0x11b2ad[_0x1062('0x2d')](db[_0x1062('0x32')][_0x1062('0x13')](queryTelephones));_0x11b2ad[_0x1062('0x2d')](db['Trunk'][_0x1062('0x13')](queryTrunks));_0x11b2ad[_0x1062('0x2d')](db[_0x1062('0x33')][_0x1062('0x13')](queryCampaigns));_0x11b2ad[_0x1062('0x2d')](db['User']['findAll'](queryAgents));break;case _0x1062('0x34'):_0x37b2a7[_0xe7debd]('voice:inbound');_0x37b2a7[_0xe7debd](_0x1062('0x2a'));_0x11b2ad[_0x1062('0x2d')](getAssociatedResources(_0x1062('0xe'),_0x4883cc[_0x1062('0x1e')],_0x1062('0x35')));_0x11b2ad[_0x1062('0x2d')](getAssociatedResources(_0x1062('0xf'),_0x4883cc[_0x1062('0x1e')],_0x1062('0x2e')));_0x11b2ad[_0x1062('0x2d')](getAssociatedResources('FaxQueues',_0x4883cc[_0x1062('0x1e')],_0x1062('0x2f')));_0x11b2ad[_0x1062('0x2d')](getAssociatedResources(_0x1062('0x10'),_0x4883cc[_0x1062('0x1e')],_0x1062('0x30')));_0x11b2ad[_0x1062('0x2d')](getAssociatedResources('MailQueues',_0x4883cc['userProfileId'],_0x1062('0x36')));_0x11b2ad[_0x1062('0x2d')](getAssociatedResources(_0x1062('0x12'),_0x4883cc[_0x1062('0x1e')],_0x1062('0x31')));_0x11b2ad[_0x1062('0x2d')](getAssociatedResources(_0x1062('0x14'),_0x4883cc[_0x1062('0x1e')],_0x1062('0x32')));_0x11b2ad[_0x1062('0x2d')](getAssociatedResources(_0x1062('0x37'),_0x4883cc[_0x1062('0x1e')],'Trunk'));_0x11b2ad[_0x1062('0x2d')](getAssociatedResources(_0x1062('0x15'),_0x4883cc[_0x1062('0x1e')],_0x1062('0x33')));_0x11b2ad[_0x1062('0x2d')](db[_0x1062('0x32')]['findAll'](queryAgents));break;case _0x1062('0x8'):_0x37b2a7[_0xe7debd](_0x1062('0x38'));_0x37b2a7[_0xe7debd](_0x1062('0x2a'));_0x11b2ad[_0x1062('0x2d')](_0x4883cc[_0x1062('0x39')]({'attributes':['id','name']}));_0x11b2ad[_0x1062('0x2d')](_0x4883cc[_0x1062('0x3a')]({'attributes':['id',_0x1062('0x6')]}));_0x11b2ad[_0x1062('0x2d')](_0x4883cc[_0x1062('0x3b')]({'attributes':['id','name']}));_0x11b2ad[_0x1062('0x2d')](_0x4883cc[_0x1062('0x3c')]({'attributes':['id','name']}));_0x11b2ad[_0x1062('0x2d')](_0x4883cc[_0x1062('0x3d')]({'attributes':['id',_0x1062('0x6')]}));_0x11b2ad[_0x1062('0x2d')](_0x4883cc[_0x1062('0x3e')]({'attributes':['id',_0x1062('0x6')]}));break;}return BPromise[_0x1062('0x3f')](_0x11b2ad);}})[_0x1062('0xd')](function(_0x4438fb){if(_0x4438fb&&_0x4438fb[_0x1062('0x1c')]){for(var _0x4a9d44=0x0;_0x4a9d44<_0x4438fb['length'];_0x4a9d44+=0x1){for(var _0x5bcb4c=0x0;_0x5bcb4c<_0x4438fb[_0x4a9d44][_0x1062('0x1c')];_0x5bcb4c+=0x1){switch(_0x4a9d44){case 0x0:joinOrLeaveQueues(_0x37b2a7,_0xe7debd,_0x1062('0x40'),_0x4438fb[_0x4a9d44][_0x5bcb4c]);break;case 0x1:joinOrLeaveQueues(_0x37b2a7,_0xe7debd,_0x1062('0x41'),_0x4438fb[_0x4a9d44][_0x5bcb4c]);break;case 0x2:joinOrLeaveQueues(_0x37b2a7,_0xe7debd,_0x1062('0x42'),_0x4438fb[_0x4a9d44][_0x5bcb4c]);break;case 0x3:joinOrLeaveQueues(_0x37b2a7,_0xe7debd,_0x1062('0x43'),_0x4438fb[_0x4a9d44][_0x5bcb4c]);break;case 0x4:joinOrLeaveQueues(_0x37b2a7,_0xe7debd,_0x1062('0x44'),_0x4438fb[_0x4a9d44][_0x5bcb4c]);break;case 0x5:joinOrLeaveQueues(_0x37b2a7,_0xe7debd,_0x1062('0x45'),_0x4438fb[_0x4a9d44][_0x5bcb4c]);break;case 0x6:_0x37b2a7[_0xe7debd](util[_0x1062('0x1a')]('telephone:%s',_0x4438fb[_0x4a9d44][_0x5bcb4c][_0x1062('0x6')]));break;case 0x7:_0x37b2a7[_0xe7debd](util[_0x1062('0x1a')](_0x1062('0x46'),_0x4438fb[_0x4a9d44][_0x5bcb4c][_0x1062('0x6')]));break;case 0x8:_0x37b2a7[_0xe7debd](util[_0x1062('0x1a')](_0x1062('0x47'),_0x4438fb[_0x4a9d44][_0x5bcb4c][_0x1062('0xa')],_0x4438fb[_0x4a9d44][_0x5bcb4c]['name']));break;case 0x9:_0x37b2a7[_0xe7debd](util['format'](_0x1062('0x28'),_0x4438fb[_0x4a9d44][_0x5bcb4c][_0x1062('0x6')]));break;}}}}})[_0x1062('0xd')](function(){if(_0xe7debd===_0x1062('0x48')){var _0x2ab594=_[_0x1062('0x18')](_0x5c27d9[_0x1062('0x21')],'id');return _0x5c27d9['removeChatInteractions'](_0x2ab594)[_0x1062('0xd')](function(){for(var _0x33cf6e=0x0;_0x33cf6e<_0x2ab594[_0x1062('0x1c')];_0x33cf6e+=0x1){_0xac29ba['emit'](_0x1062('0x49'),{'ChatInteractionId':Number(_0x2ab594[_0x33cf6e]),'UserId':Number(_0x5c27d9['id'])});}});}})['then'](function(){if(_0xe7debd===_0x1062('0x48')){var _0x5f0f31=_[_0x1062('0x18')](_0x5c27d9['MailInteractions'],'id');return _0x5c27d9[_0x1062('0x4a')](_0x5f0f31)[_0x1062('0xd')](function(){for(var _0x22a929=0x0;_0x22a929<_0x5f0f31[_0x1062('0x1c')];_0x22a929+=0x1){_0xac29ba[_0x1062('0x4b')](_0x1062('0x4c'),{'MailInteractionId':Number(_0x5f0f31[_0x22a929]),'UserId':Number(_0x5c27d9['id'])});}});}})[_0x1062('0xd')](function(){if(_0xe7debd===_0x1062('0x48')){var _0x26783e=_[_0x1062('0x18')](_0x5c27d9['FaxInteractions'],'id');return _0x5c27d9[_0x1062('0x4d')](_0x26783e)['then'](function(){for(var _0x337ef3=0x0;_0x337ef3<_0x26783e[_0x1062('0x1c')];_0x337ef3+=0x1){_0xac29ba[_0x1062('0x4b')](_0x1062('0x4e'),{'FaxInteractionId':Number(_0x26783e[_0x337ef3]),'UserId':Number(_0x5c27d9['id'])});}});}})[_0x1062('0xd')](function(){if(_0xe7debd===_0x1062('0x48')){var _0x3ced78=_['map'](_0x5c27d9[_0x1062('0x27')],'id');return _0x5c27d9[_0x1062('0x4f')](_0x3ced78)['then'](function(){for(var _0x44c34a=0x0;_0x44c34a<_0x3ced78['length'];_0x44c34a+=0x1){_0xac29ba[_0x1062('0x4b')](_0x1062('0x50'),{'SmsInteractionId':Number(_0x3ced78[_0x44c34a]),'UserId':Number(_0x5c27d9['id'])});}});}})['then'](function(){if(_0xe7debd===_0x1062('0x48')){var _0x291b76=_[_0x1062('0x18')](_0x5c27d9['OpenchannelInteractions'],'id');return _0x5c27d9[_0x1062('0x51')](_0x291b76)['then'](function(){for(var _0x2e46f1=0x0;_0x2e46f1<_0x291b76[_0x1062('0x1c')];_0x2e46f1+=0x1){_0xac29ba[_0x1062('0x4b')](_0x1062('0x52'),{'OpenchannelInteractionId':Number(_0x291b76[_0x2e46f1]),'UserId':Number(_0x5c27d9['id'])});}});}})[_0x1062('0x53')](function(_0x2973fd){_0x37b2a7[_0x1062('0x54')](_0x2973fd);});}}function onDisconnect(_0x140a51,_0x2c1250){joinOrLeave(_0x140a51,_0x1062('0x48'),_0x2c1250);}function onConnect(_0x5995e9){joinOrLeave(_0x5995e9,_0x1062('0x55'));}exports[_0x1062('0x56')]=function(_0x46d1af){_0x46d1af['on'](_0x1062('0x57'),function(_0x2dee6e){_0x2dee6e[_0x1062('0x58')](0x0);_0x2dee6e['address']=_0x2dee6e['request'][_0x1062('0x57')][_0x1062('0x59')]+':'+_0x2dee6e['request']['connection'][_0x1062('0x5a')];_0x2dee6e[_0x1062('0x5b')]=new Date();_0x2dee6e[_0x1062('0x54')]=function(_0x1b1755){console[_0x1062('0x54')](_0x1062('0x5c')+_0x2dee6e[_0x1062('0x5d')][_0x1062('0x6')]+'['+_0x2dee6e['address']+']',_0x1b1755);};_0x2dee6e['on']('disconnect',function(){onDisconnect(_0x2dee6e,_0x46d1af);_0x2dee6e['log'](_0x1062('0x5e'));});onConnect(_0x2dee6e);_0x2dee6e['log'](_0x1062('0x5f'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index b4b229d..c7740eb 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 _0x2dec=['afterUpdate','closedinteraction','ChatMessage','Sms','newmessage','Fax','FaxInteraction','newinteraction','FaxMessage','Mail','MailInteraction','Openchannel','OpenchannelInteraction','request','then','info','Trigger,\x20%s','EventManager','error','get','direction','UserId','User','find','interface','format','SIP/%s','name','channel','incomingmessage','catch','event','opened','changed','closed','length','model','callback','util','../../mysqldb','jayson/promise','../logger','triggers','http','Chat','ChatInteraction','afterCreate'];(function(_0x38d08a,_0x54b43f){var _0x532554=function(_0x2ee78d){while(--_0x2ee78d){_0x38d08a['push'](_0x38d08a['shift']());}};_0x532554(++_0x54b43f);}(_0x2dec,0xe2));var _0xc2de=function(_0x9307ea,_0x38968a){_0x9307ea=_0x9307ea-0x0;var _0x295554=_0x2dec[_0x9307ea];return _0x295554;};'use strict';var util=require(_0xc2de('0x0'));var db=require(_0xc2de('0x1'))['db'];var jayson=require(_0xc2de('0x2'));var logger=require(_0xc2de('0x3'))(_0xc2de('0x4'));var client=jayson['client'][_0xc2de('0x5')]({'port':0x232a});var triggers=[{'channel':_0xc2de('0x6'),'model':_0xc2de('0x7'),'event':_0xc2de('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xc2de('0x6'),'model':_0xc2de('0x7'),'event':_0xc2de('0x9'),'condition':_0xc2de('0xa'),'callback':afterUpdate},{'channel':_0xc2de('0x6'),'model':_0xc2de('0xb'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xc2de('0xc'),'model':'SmsInteraction','event':_0xc2de('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xc2de('0xc'),'model':'SmsInteraction','event':_0xc2de('0x9'),'condition':_0xc2de('0xa'),'callback':afterUpdate},{'channel':'Sms','model':'SmsMessage','event':_0xc2de('0x8'),'condition':_0xc2de('0xd'),'callback':afterCreateMessage},{'channel':_0xc2de('0xe'),'model':_0xc2de('0xf'),'event':_0xc2de('0x8'),'condition':_0xc2de('0x10'),'callback':afterCreate},{'channel':_0xc2de('0xe'),'model':'FaxInteraction','event':_0xc2de('0x9'),'condition':_0xc2de('0xa'),'callback':afterUpdate},{'channel':_0xc2de('0xe'),'model':_0xc2de('0x11'),'event':'afterCreate','condition':_0xc2de('0xd'),'callback':afterCreateMessage},{'channel':_0xc2de('0x12'),'model':_0xc2de('0x13'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xc2de('0x12'),'model':_0xc2de('0x13'),'event':_0xc2de('0x9'),'condition':_0xc2de('0xa'),'callback':afterUpdate},{'channel':'Mail','model':'MailMessage','event':_0xc2de('0x8'),'condition':_0xc2de('0xd'),'callback':afterCreateMessage},{'channel':_0xc2de('0x14'),'model':_0xc2de('0x15'),'event':'afterCreate','condition':_0xc2de('0x10'),'callback':afterCreate},{'channel':_0xc2de('0x14'),'model':_0xc2de('0x15'),'event':'afterUpdate','condition':_0xc2de('0xa'),'callback':afterUpdate},{'channel':'Openchannel','model':'OpenchannelMessage','event':_0xc2de('0x8'),'condition':_0xc2de('0xd'),'callback':afterCreateMessage}];function request(_0x25839a){return client[_0xc2de('0x16')]('EventManager',_0x25839a)[_0xc2de('0x17')](function(_0x4579b7){logger[_0xc2de('0x18')](_0xc2de('0x19'),_0xc2de('0x1a'),_0x4579b7);if(_0x4579b7[_0xc2de('0x1b')]){if(_0x4579b7[_0xc2de('0x1b')]['code']===0x1f4){logger['error']('Trigger,\x20%s',_0xc2de('0x1a'),_0x4579b7[_0xc2de('0x1b')]);}}})['catch'](function(_0x2201d9){logger['error'](_0xc2de('0x19'),_0xc2de('0x1a'),_0x2201d9);});}function afterCreateMessage(_0x12ad99,_0x2d80b8){return function(_0x3f41b3,_0x57103f){_0x3f41b3=_0x3f41b3[_0xc2de('0x1c')]({'plain':!![]});_0x3f41b3['channel']=_0x12ad99;_0x3f41b3['event']=_0x3f41b3[_0xc2de('0x1d')];if(_0x3f41b3[_0xc2de('0x1e')]){return db[_0xc2de('0x1f')][_0xc2de('0x20')]({'where':{'id':_0x3f41b3[_0xc2de('0x1e')]},'attributes':['id','name'],'raw':!![]})[_0xc2de('0x17')](function(_0x457b08){_0x3f41b3[_0xc2de('0x21')]=util[_0xc2de('0x22')](_0xc2de('0x23'),_0x457b08[_0xc2de('0x24')]);_0x3f41b3[_0xc2de('0x25')]=_0x12ad99;return request({'event':_0xc2de('0x26'),'message':_0x3f41b3});})[_0xc2de('0x27')](function(_0x5bff3d){console['error'](_0x5bff3d);});}else{return request({'event':'outgoingmessage','message':_0x3f41b3});}};}function afterCreate(_0x39f80b,_0x6dd760){return function(_0x1decec,_0x5969a4){_0x1decec=_0x1decec[_0xc2de('0x1c')]({'plain':!![]});_0x1decec[_0xc2de('0x25')]=_0x39f80b;_0x1decec[_0xc2de('0x28')]=_0xc2de('0x29');return request({'event':_0x6dd760,'message':_0x1decec});};}function afterUpdate(_0x16de6e,_0x12f637){return function(_0x2facfc,_0x43f51e){if(_0x2facfc[_0xc2de('0x2a')]('closed')&&_0x2facfc[_0xc2de('0x2b')]){_0x2facfc=_0x2facfc[_0xc2de('0x1c')]({'plain':!![]});_0x2facfc[_0xc2de('0x25')]=_0x16de6e;_0x2facfc[_0xc2de('0x28')]=_0xc2de('0x2b');if(_0x2facfc[_0xc2de('0x1e')]){return db[_0xc2de('0x1f')][_0xc2de('0x20')]({'where':{'id':_0x2facfc[_0xc2de('0x1e')]},'attributes':['id',_0xc2de('0x24')],'raw':!![]})[_0xc2de('0x17')](function(_0x58b77d){_0x2facfc[_0xc2de('0x21')]=util[_0xc2de('0x22')]('SIP/%s',_0x58b77d[_0xc2de('0x24')]);return request({'event':_0x12f637,'message':_0x2facfc});})[_0xc2de('0x27')](function(_0x1787d1){console[_0xc2de('0x1b')](_0x1787d1);});}else{return request({'event':_0x12f637,'message':_0x2facfc});}}};}exports['default']=function(){for(var _0x2f3413=0x0;_0x2f3413=_0x2b7a8d[_0xd6ce('0x12')]){throw Error(_0xd6ce('0x13'));}_0x343ea2(_0x557c9a);})[_0xd6ce('0x14')](function(_0x486876){_0x476ada(_0x486876);});});}; \ No newline at end of file +var _0xfc67=['isValidChannel','isUndefined','blockedAt','getLicense','role','agent','User','count','agents','Maximum\x20login\x20has\x20been\x20reached','bluebird','./license/util','voice','mail','fax','openchannel'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xfc67,0xea));var _0x7fc6=function(_0x48788c,_0x22c6cf){_0x48788c=_0x48788c-0x0;var _0x111b0f=_0xfc67[_0x48788c];return _0x111b0f;};'use strict';var _=require('lodash');var BPromise=require(_0x7fc6('0x0'));var db=require('../mysqldb')['db'];var util=require(_0x7fc6('0x1'));var channels=[_0x7fc6('0x2'),_0x7fc6('0x3'),'chat',_0x7fc6('0x4'),'sms',_0x7fc6('0x5')];exports['getChannels']=function(){return channels;};exports[_0x7fc6('0x6')]=function(_0x342e56){_0x342e56=_0x342e56['toLowerCase']();return _['includes'](channels,_0x342e56);};exports['clearBlockUser']=function(_0x54608f,_0x1da4f3,_0x1ce145,_0x446c52){var _0x49ef40={'loginAttempts':_0x1da4f3,'blocked':_0x1ce145};if(!_[_0x7fc6('0x7')](_0x446c52)){_0x49ef40[_0x7fc6('0x8')]=_0x446c52;}return _0x54608f['updateAttributes'](_0x49ef40);};exports[_0x7fc6('0x9')]=function(_0x45797a){return new BPromise(function(_0x2d34fd,_0x874e5b){var _0x5134f1=0x0;if(_0x45797a[_0x7fc6('0xa')]!==_0x7fc6('0xb')){_0x2d34fd(_0x45797a);}db[_0x7fc6('0xc')][_0x7fc6('0xd')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x45797a['id']}}})['then'](function(_0x17a970){_0x5134f1=_0x17a970;return util[_0x7fc6('0x9')]();})['then'](function(_0x3723af){if(_0x3723af&&_0x3723af[_0x7fc6('0xe')]&&_0x5134f1>=_0x3723af[_0x7fc6('0xe')]){throw Error(_0x7fc6('0xf'));}_0x2d34fd(_0x45797a);})['catch'](function(_0x58e16b){_0x874e5b(_0x58e16b);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index ceb2536..7c0c529 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbde0=['exports','404','status','render','json'];(function(_0x333fc8,_0x2b292c){var _0x432439=function(_0x5501b6){while(--_0x5501b6){_0x333fc8['push'](_0x333fc8['shift']());}};_0x432439(++_0x2b292c);}(_0xbde0,0x16d));var _0x0bde=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xbde0[_0x819464];return _0x49dcc0;};'use strict';module[_0x0bde('0x0')][0x194]=function pageNotFound(_0x360e00,_0x2fb132){var _0x32a979=_0x0bde('0x1');var _0x454567=0x194;var _0x34f0c1={'status':_0x454567};_0x2fb132['status'](_0x34f0c1[_0x0bde('0x2')]);_0x2fb132[_0x0bde('0x3')](_0x32a979,{},function(_0x127502,_0x5889b9){if(_0x127502){return _0x2fb132[_0x0bde('0x2')](_0x34f0c1[_0x0bde('0x2')])[_0x0bde('0x4')](_0x34f0c1);}_0x2fb132['send'](_0x5889b9);});}; \ No newline at end of file +var _0x058d=['status','render','send','exports','404'];(function(_0x1ac77b,_0x10ee7a){var _0x161584=function(_0x5a810d){while(--_0x5a810d){_0x1ac77b['push'](_0x1ac77b['shift']());}};_0x161584(++_0x10ee7a);}(_0x058d,0x175));var _0xd058=function(_0x2d6903,_0x1f2746){_0x2d6903=_0x2d6903-0x0;var _0x426fc9=_0x058d[_0x2d6903];return _0x426fc9;};'use strict';module[_0xd058('0x0')][0x194]=function pageNotFound(_0x39e2d2,_0x40effd){var _0x45f980=_0xd058('0x1');var _0x5b680a=0x194;var _0x449a5e={'status':_0x5b680a};_0x40effd['status'](_0x449a5e[_0xd058('0x2')]);_0x40effd[_0xd058('0x3')](_0x45f980,{},function(_0x422895,_0x469027){if(_0x422895){return _0x40effd[_0xd058('0x2')](_0x449a5e[_0xd058('0x2')])['json'](_0x449a5e);}_0x40effd[_0xd058('0x4')](_0x469027);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 23cfeb5..fafcad6 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x31f0=['user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','SquareProjects','user_has_square_projects','ChanSpyId','VoiceContext','Applications','Sound','Sounds','moh_has_sounds','UserVoiceQueueRt','Members','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','belongsTo','TrunkBackupId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Team','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','AgentReports','uniqueid','Contact','MailServerIn','MailAccountId','Imap','MailServerOut','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','ListId','Template','TemplateId','team_has_mail_queues','ContactId','Owner','mail_interaction_has_tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','Account','restrict','IntervalId','TagId','MailQueueReport','Items','FaxAccountId','FaxApplication','Exntensions','List','FaxInteractionId','Attachment','AttachmentId','team_has_fax_queues','SmsAccountId','SmsApplication','user_has_sms_accounts','sms_interaction_has_tags','Tags','SmsInteractionId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','Agent','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','chat_group_has_users','CompanyId','Hoppers','Company','cm_contact_has_tags','Queue','OwnerId','Condition','OneAll','AutomationAllId','AutomationAnyId','Actions','AutomationId','Intervals','MailApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','AllConditions','AllCondition','TriggerAllId','AnyConditions','Action','TriggerId','Fields','MetricId','AccountId','SubjectId','SalesforceConfiguration','DescriptionId','FieldId','Subject','Description','Field','Variable','VariableId','Configurations','Subjects','Descriptions','ZohoAccount','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskField','FreshdeskAccount','int_freshdesk_configuration_has_tags','int_vtiger_configuration_has_tags','Dynamics365Account','Dynamics365Field','FromId','ProjectId','ChatQueues','CampaignId','TrunkId','TrunkBackup','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','FromAccount','ToUserId','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','voice_queues_has_cm_lists','UserProfileSections','Resources','sectionId','path','sequelize','jstz','determine','defaultsDeep','motion2','xcall','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','xC@LL1234','127.0.0.1','mysql','name','database','username','password','options','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/mailServerIn/mailServerIn.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/template/template.model','Trigger','../api/trigger/trigger.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.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','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','hasOne','cascade','hasMany','VoiceRecording','Recordings','UserId','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','ChatInteractions','SmsInteractions','FaxInteraction','userProfileId','belongsToMany','Groups','Contacts','Lists','cm_user_has_lists','user_has_teams','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteractions','VoiceQueue','VoiceQueues','MailQueues','FaxQueues','SmsQueues','UserSmsQueue','OpenchannelQueues','user_has_voice_prefixes','ChatWebsite'];(function(_0xf711d8,_0x1ccf88){var _0x58ebb8=function(_0xe08dd7){while(--_0xe08dd7){_0xf711d8['push'](_0xf711d8['shift']());}};_0x58ebb8(++_0x1ccf88);}(_0x31f0,0xb7));var _0x031f=function(_0x38f665,_0x3a505f){_0x38f665=_0x38f665-0x0;var _0x581c74=_0x31f0[_0x38f665];return _0x581c74;};'use strict';var path=require(_0x031f('0x0'));var config=require('../config/environment');var Sequelize=require(_0x031f('0x1'));var _=require('lodash');var jstz=require(_0x031f('0x2'));var timezone=jstz[_0x031f('0x3')]();config[_0x031f('0x1')]=_[_0x031f('0x4')](config['sequelize'],{'database':_0x031f('0x5'),'username':_0x031f('0x6'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x031f('0x7')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x031f('0x8'),'collate':_0x031f('0x9')}}});config[_0x031f('0xa')]=_[_0x031f('0x4')](config['sequelizeHistory'],{'database':_0x031f('0x5'),'username':_0x031f('0x6'),'password':_0x031f('0xb'),'options':{'host':_0x031f('0xc'),'port':0xcea,'dialect':_0x031f('0xd'),'dialectOptions':{'charset':_0x031f('0x7')},'logging':![],'timezone':timezone[_0x031f('0xe')](),'define':{'charset':_0x031f('0x8'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x031f('0x1')][_0x031f('0xf')],config[_0x031f('0x1')][_0x031f('0x10')],config[_0x031f('0x1')][_0x031f('0x11')],config[_0x031f('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x031f('0xa')][_0x031f('0xf')],config[_0x031f('0xa')][_0x031f('0x10')],config[_0x031f('0xa')]['password'],config['sequelizeHistory'][_0x031f('0x12')])};db[_0x031f('0x13')]=db[_0x031f('0x1')][_0x031f('0x14')]('../api/user/user.model');db[_0x031f('0x15')]=db[_0x031f('0x1')]['import'](_0x031f('0x16'));db['VoiceContext']=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x17'));db[_0x031f('0x18')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x19'));db[_0x031f('0x1a')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x1b'));db['VoiceQueue']=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x1c'));db['VoiceRecording']=db['sequelize'][_0x031f('0x14')]('../api/voiceRecording/voiceRecording.model');db[_0x031f('0x1d')]=db['sequelize']['import']('../api/screenRecording/screenRecording.model');db[_0x031f('0x1e')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x1f'));db['VoiceMailMessage']=db[_0x031f('0x1')]['import'](_0x031f('0x20'));db[_0x031f('0x21')]=db[_0x031f('0x1')]['import'](_0x031f('0x22'));db[_0x031f('0x23')]=db['sequelize'][_0x031f('0x14')](_0x031f('0x24'));db[_0x031f('0x25')]=db['sequelize'][_0x031f('0x14')](_0x031f('0x26'));db[_0x031f('0x27')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x28'));db['MemberReport']=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x29'));db[_0x031f('0x2a')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x2b'));db[_0x031f('0x2c')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x2d'));db['UserVoiceQueueRt']=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x2e'));db[_0x031f('0x2f')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x30'));db[_0x031f('0x31')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x32'));db[_0x031f('0x33')]=db[_0x031f('0x1')]['import'](_0x031f('0x34'));db[_0x031f('0x35')]=db['sequelize'][_0x031f('0x14')](_0x031f('0x36'));db['UserSmsQueue']=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x37'));db[_0x031f('0x38')]=db['sequelize']['import'](_0x031f('0x39'));db['MailServerIn']=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x3a'));db['MailServerOut']=db['sequelize'][_0x031f('0x14')]('../api/mailServerOut/mailServerOut.model');db['MailAccount']=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x3b'));db[_0x031f('0x3c')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x3d'));db['MailSubstatus']=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x3e'));db[_0x031f('0x3f')]=db['sequelize'][_0x031f('0x14')](_0x031f('0x40'));db[_0x031f('0x41')]=db['sequelize'][_0x031f('0x14')](_0x031f('0x42'));db['MailApplication']=db[_0x031f('0x1')][_0x031f('0x14')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x43'));db[_0x031f('0x44')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x45'));db['DashboardItem']=db[_0x031f('0x1')][_0x031f('0x14')]('../api/dashboardItem/dashboardItem.model');db[_0x031f('0x46')]=db['sequelize'][_0x031f('0x14')](_0x031f('0x47'));db['FaxApplication']=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x48'));db['FaxInteraction']=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x49'));db[_0x031f('0x4a')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x4b'));db[_0x031f('0x4c')]=db[_0x031f('0x1')]['import'](_0x031f('0x4d'));db[_0x031f('0x4e')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x4f'));db[_0x031f('0x50')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x51'));db['SmsApplication']=db[_0x031f('0x1')]['import']('../api/smsApplication/smsApplication.model');db[_0x031f('0x52')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x53'));db[_0x031f('0x54')]=db['sequelize'][_0x031f('0x14')](_0x031f('0x55'));db[_0x031f('0x56')]=db['sequelize'][_0x031f('0x14')](_0x031f('0x57'));db[_0x031f('0x58')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x59'));db['OpenchannelApplication']=db['sequelize'][_0x031f('0x14')]('../api/openchannelApplication/openchannelApplication.model');db[_0x031f('0x5a')]=db[_0x031f('0x1')]['import'](_0x031f('0x5b'));db['OpenchannelMessage']=db['sequelize'][_0x031f('0x14')]('../api/openchannelMessage/openchannelMessage.model');db[_0x031f('0x5c')]=db['sequelize'][_0x031f('0x14')](_0x031f('0x5d'));db['ChatWebsite']=db[_0x031f('0x1')][_0x031f('0x14')]('../api/chatWebsite/chatWebsite.model');db[_0x031f('0x5e')]=db['sequelize'][_0x031f('0x14')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x031f('0x5f')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x60'));db[_0x031f('0x61')]=db['sequelize'][_0x031f('0x14')]('../api/chatInteraction/chatInteraction.model');db[_0x031f('0x62')]=db[_0x031f('0x1')]['import'](_0x031f('0x63'));db[_0x031f('0x64')]=db['sequelize'][_0x031f('0x14')](_0x031f('0x65'));db[_0x031f('0x66')]=db['sequelize'][_0x031f('0x14')]('../api/chatQueue/chatQueue.model');db[_0x031f('0x67')]=db['sequelize'][_0x031f('0x14')]('../api/chatGroup/chatGroup.model');db[_0x031f('0x68')]=db[_0x031f('0x1')]['import']('../api/chatProactiveAction/chatProactiveAction.model');db[_0x031f('0x69')]=db[_0x031f('0x1')]['import'](_0x031f('0x6a'));db[_0x031f('0x6b')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x6c'));db[_0x031f('0x6d')]=db[_0x031f('0x1')][_0x031f('0x14')]('../api/cmHopper/cmHopper.model');db[_0x031f('0x6e')]=db[_0x031f('0x1')][_0x031f('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x031f('0x6f')]=db[_0x031f('0x1')]['import'](_0x031f('0x70'));db[_0x031f('0x71')]=db[_0x031f('0x1')][_0x031f('0x14')]('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db['sequelize']['import'](_0x031f('0x72'));db[_0x031f('0x73')]=db['sequelize'][_0x031f('0x14')](_0x031f('0x74'));db['Action']=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x75'));db[_0x031f('0x76')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x77'));db[_0x031f('0x78')]=db[_0x031f('0x1')]['import'](_0x031f('0x79'));db['Disposition']=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x7a'));db['Condition']=db['sequelize'][_0x031f('0x14')](_0x031f('0x7b'));db[_0x031f('0x7c')]=db[_0x031f('0x1')]['import'](_0x031f('0x7d'));db['Pause']=db['sequelize'][_0x031f('0x14')]('../api/pause/pause.model');db['Cdr']=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x7e'));db[_0x031f('0x7f')]=db[_0x031f('0x1')]['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x031f('0x80')]=db['sequelize'][_0x031f('0x14')](_0x031f('0x81'));db['Sound']=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x82'));db[_0x031f('0x83')]=db[_0x031f('0x1')][_0x031f('0x14')]('../api/tag/tag.model');db['Template']=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x84'));db[_0x031f('0x85')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x86'));db['Variable']=db['sequelize']['import']('../api/variable/variable.model');db[_0x031f('0x87')]=db[_0x031f('0x1')][_0x031f('0x14')]('../api/integration/integration.model');db[_0x031f('0x88')]=db[_0x031f('0x1')]['import'](_0x031f('0x89'));db[_0x031f('0x8a')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x8b'));db[_0x031f('0x8c')]=db[_0x031f('0x1')]['import']('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x031f('0x8d')]=db['sequelize'][_0x031f('0x14')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x031f('0x8e')]=db[_0x031f('0x1')][_0x031f('0x14')]('../api/analyticMetric/analyticMetric.model');db[_0x031f('0x8f')]=db['sequelize'][_0x031f('0x14')](_0x031f('0x90'));db[_0x031f('0x91')]=db['sequelize'][_0x031f('0x14')](_0x031f('0x92'));db[_0x031f('0x93')]=db[_0x031f('0x1')][_0x031f('0x14')]('../api/intSalesforceAccount/intSalesforceAccount.model');db['SalesforceConfiguration']=db[_0x031f('0x1')][_0x031f('0x14')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x031f('0x94')]=db['sequelize'][_0x031f('0x14')](_0x031f('0x95'));db[_0x031f('0x96')]=db[_0x031f('0x1')]['import'](_0x031f('0x97'));db[_0x031f('0x98')]=db[_0x031f('0x1')]['import'](_0x031f('0x99'));db[_0x031f('0x9a')]=db['sequelize'][_0x031f('0x14')](_0x031f('0x9b'));db[_0x031f('0x9c')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0x9d'));db[_0x031f('0x9e')]=db['sequelize'][_0x031f('0x14')](_0x031f('0x9f'));db[_0x031f('0xa0')]=db['sequelize']['import'](_0x031f('0xa1'));db['ZohoAccount']=db['sequelize'][_0x031f('0x14')](_0x031f('0xa2'));db[_0x031f('0xa3')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0xa4'));db[_0x031f('0xa5')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0xa6'));db[_0x031f('0xa7')]=db['sequelize'][_0x031f('0x14')](_0x031f('0xa8'));db[_0x031f('0xa9')]=db[_0x031f('0x1')]['import'](_0x031f('0xaa'));db['ZendeskField']=db['sequelize'][_0x031f('0x14')](_0x031f('0xab'));db['FreshdeskAccount']=db['sequelize'][_0x031f('0x14')](_0x031f('0xac'));db[_0x031f('0xad')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0xae'));db['FreshdeskField']=db[_0x031f('0x1')][_0x031f('0x14')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x031f('0xaf')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0xb0'));db[_0x031f('0xb1')]=db[_0x031f('0x1')][_0x031f('0x14')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x031f('0xb2')]=db['sequelize'][_0x031f('0x14')](_0x031f('0xb3'));db[_0x031f('0xb4')]=db['sequelize']['import']('../api/intServicenowAccount/intServicenowAccount.model');db[_0x031f('0xb5')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0xb6'));db[_0x031f('0xb7')]=db[_0x031f('0x1')][_0x031f('0x14')]('../api/intServicenowField/intServicenowField.model');db['Dynamics365Account']=db[_0x031f('0x1')][_0x031f('0x14')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x031f('0xb8')]=db['sequelize'][_0x031f('0x14')](_0x031f('0xb9'));db['Dynamics365Field']=db[_0x031f('0x1')][_0x031f('0x14')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x031f('0x87')]=db[_0x031f('0x1')][_0x031f('0x14')]('../api/integration/integration.model');db[_0x031f('0xba')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0xbb'));db[_0x031f('0xbc')]=db[_0x031f('0x1')]['import'](_0x031f('0xbd'));db[_0x031f('0xbe')]=db[_0x031f('0x1')][_0x031f('0x14')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x031f('0xbf')]=db[_0x031f('0x1')]['import'](_0x031f('0xc0'));db[_0x031f('0xc1')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0xc2'));db[_0x031f('0xc3')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0xc4'));db[_0x031f('0xc5')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0xc6'));db[_0x031f('0xc7')]=db[_0x031f('0x1')]['import'](_0x031f('0xc8'));db[_0x031f('0xc9')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0xca'));db[_0x031f('0xcb')]=db['sequelize']['import']('../api/jscriptyProject/jscriptyProject.model');db[_0x031f('0xcc')]=db[_0x031f('0x1')]['import'](_0x031f('0xcd'));db[_0x031f('0xce')]=db[_0x031f('0x1')][_0x031f('0x14')]('../api/squareOdbc/squareOdbc.model');db[_0x031f('0xcf')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0xd0'));db[_0x031f('0xd1')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0xd2'));db[_0x031f('0xd3')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0xd4'));db['Team']=db[_0x031f('0x1')][_0x031f('0x14')]('../api/team/team.model');db[_0x031f('0xd5')]=db[_0x031f('0x1')]['import'](_0x031f('0xd6'));db[_0x031f('0xd7')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0xd8'));db[_0x031f('0xd9')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0xda'));db['Attachment']=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0xdb'));db['Plugin']=db['sequelize'][_0x031f('0x14')]('../api/plugin/plugin.model');db[_0x031f('0xdc')]=db[_0x031f('0x1')]['import'](_0x031f('0xdd'));db[_0x031f('0xde')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0xdf'));db[_0x031f('0xe0')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0xe1'));db[_0x031f('0xe2')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0xe3'));db['SmsTransferReport']=db['sequelize'][_0x031f('0x14')]('../api/smsTransferReport/smsTransferReport.model');db[_0x031f('0xe4')]=db[_0x031f('0x1')][_0x031f('0x14')]('../api/cmList/cmList.model');db[_0x031f('0xe5')]=db[_0x031f('0x1')]['import'](_0x031f('0xe6'));db[_0x031f('0xe7')]=db[_0x031f('0x1')][_0x031f('0x14')](_0x031f('0xe8'));db[_0x031f('0xe9')]=db[_0x031f('0x1')]['import'](_0x031f('0xea'));db[_0x031f('0xeb')]=db[_0x031f('0x1')][_0x031f('0x14')]('../api/userProfileResource/userProfileResource.model');db['User'][_0x031f('0xec')](db['VoiceMail'],{'as':'VoiceMail','onDelete':_0x031f('0xed'),'foreignKey':'UserId'});db['User'][_0x031f('0xee')](db[_0x031f('0xef')],{'as':_0x031f('0xf0'),'foreignKey':_0x031f('0xf1')});db[_0x031f('0x13')][_0x031f('0xee')](db['UserVoiceQueueRt'],{'as':_0x031f('0xf2'),'foreignKey':_0x031f('0xf1')});db['User'][_0x031f('0xee')](db[_0x031f('0x18')],{'as':_0x031f('0xf3'),'onDelete':_0x031f('0xed'),'hooks':!![]});db['User']['hasMany'](db['CmHopperFinal'],{'as':_0x031f('0xf4'),'foreignKey':_0x031f('0xf1')});db[_0x031f('0x13')][_0x031f('0xee')](db[_0x031f('0x71')],{'as':_0x031f('0xf5'),'foreignKey':_0x031f('0xf1')});db[_0x031f('0x13')][_0x031f('0xee')](db['ReportAgentPreview'],{'as':_0x031f('0xf6'),'foreignKey':_0x031f('0xf1')});db[_0x031f('0x13')][_0x031f('0xee')](db[_0x031f('0x5a')],{'as':'OpenchannelInteractions','foreignKey':'UserId'});db['User'][_0x031f('0xee')](db[_0x031f('0x61')],{'as':_0x031f('0xf7'),'foreignKey':_0x031f('0xf1')});db['User'][_0x031f('0xee')](db['SmsInteraction'],{'as':_0x031f('0xf8'),'foreignKey':_0x031f('0xf1')});db[_0x031f('0x13')][_0x031f('0xee')](db[_0x031f('0xf9')],{'as':'FaxInteractions','foreignKey':_0x031f('0xf1')});db[_0x031f('0x13')][_0x031f('0xee')](db[_0x031f('0x3f')],{'as':'MailInteractions','foreignKey':_0x031f('0xf1')});db[_0x031f('0x13')]['belongsTo'](db[_0x031f('0xe7')],{'as':'UserProfile','foreignKey':_0x031f('0xfa')});db[_0x031f('0x13')][_0x031f('0xfb')](db[_0x031f('0x67')],{'as':_0x031f('0xfc'),'through':'chat_group_has_users'});db[_0x031f('0x13')]['belongsToMany'](db[_0x031f('0x6b')],{'as':_0x031f('0xfd'),'through':'cm_user_has_contacts'});db[_0x031f('0x13')][_0x031f('0xfb')](db[_0x031f('0xe4')],{'as':_0x031f('0xfe'),'through':_0x031f('0xff')});db['User']['belongsToMany'](db['Team'],{'through':_0x031f('0x100')});db['User'][_0x031f('0xfb')](db[_0x031f('0x3f')],{'as':_0x031f('0x101'),'through':_0x031f('0x102')});db[_0x031f('0x13')]['belongsToMany'](db[_0x031f('0x61')],{'as':'ChatInteractions','through':_0x031f('0x103')});db[_0x031f('0x13')][_0x031f('0xfb')](db['FaxInteraction'],{'as':_0x031f('0x104'),'through':_0x031f('0x105')});db[_0x031f('0x13')][_0x031f('0xfb')](db['SmsInteraction'],{'as':_0x031f('0xf8'),'through':_0x031f('0x106')});db[_0x031f('0x13')][_0x031f('0xfb')](db[_0x031f('0x5a')],{'as':_0x031f('0x107'),'through':'user_has_openchannel_interactions'});db[_0x031f('0x13')][_0x031f('0xfb')](db[_0x031f('0x108')],{'as':_0x031f('0x109'),'through':_0x031f('0x2f'),'required':![]});db[_0x031f('0x13')][_0x031f('0xfb')](db['MailQueue'],{'as':_0x031f('0x10a'),'through':_0x031f('0x33'),'required':![]});db[_0x031f('0x13')][_0x031f('0xfb')](db[_0x031f('0x66')],{'as':'ChatQueues','through':_0x031f('0x31'),'required':![],'hooks':!![]});db[_0x031f('0x13')][_0x031f('0xfb')](db[_0x031f('0x4c')],{'as':_0x031f('0x10b'),'through':'UserFaxQueue','required':![]});db[_0x031f('0x13')][_0x031f('0xfb')](db[_0x031f('0x56')],{'as':_0x031f('0x10c'),'through':_0x031f('0x10d'),'required':![]});db['User']['belongsToMany'](db[_0x031f('0x5c')],{'as':_0x031f('0x10e'),'through':'UserOpenchannelQueue','required':![]});db[_0x031f('0x13')]['belongsToMany'](db[_0x031f('0xe4')],{'through':_0x031f('0xff')});db[_0x031f('0x13')][_0x031f('0xfb')](db['VoicePrefix'],{'as':'VoicePrefixes','through':_0x031f('0x10f'),'required':![]});db[_0x031f('0x13')][_0x031f('0xfb')](db[_0x031f('0x110')],{'as':'ChatWebsites','through':_0x031f('0x111')});db[_0x031f('0x13')][_0x031f('0xfb')](db['FaxAccount'],{'as':_0x031f('0x112'),'through':_0x031f('0x113')});db[_0x031f('0x13')]['belongsToMany'](db[_0x031f('0x114')],{'as':_0x031f('0x115'),'through':_0x031f('0x116')});db[_0x031f('0x13')][_0x031f('0xfb')](db['OpenchannelAccount'],{'as':_0x031f('0x117'),'through':_0x031f('0x118')});db[_0x031f('0x13')][_0x031f('0xfb')](db[_0x031f('0x50')],{'as':_0x031f('0x119'),'through':'user_has_sms_accounts'});db['User'][_0x031f('0xfb')](db[_0x031f('0xcf')],{'as':_0x031f('0x11a'),'through':_0x031f('0x11b')});db[_0x031f('0x15')][_0x031f('0xee')](db[_0x031f('0x18')],{'as':'SpiedAgents','onDelete':_0x031f('0xed'),'foreignKey':_0x031f('0x11c')});db[_0x031f('0x11d')][_0x031f('0xee')](db[_0x031f('0x18')],{'onDelete':_0x031f('0xed')});db[_0x031f('0x18')][_0x031f('0xee')](db['VoiceExtension'],{'as':_0x031f('0x11e'),'onDelete':_0x031f('0xed')});db['VoiceMusicOnHold'][_0x031f('0xfb')](db[_0x031f('0x11f')],{'as':_0x031f('0x120'),'through':_0x031f('0x121')});db[_0x031f('0x108')]['hasMany'](db[_0x031f('0x122')],{'as':_0x031f('0x123'),'foreignKey':_0x031f('0x124')});db[_0x031f('0x108')]['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':'VoiceQueueId'});db[_0x031f('0x108')]['hasMany'](db[_0x031f('0x6f')],{'as':'HopperFinals','foreignKey':_0x031f('0x124')});db[_0x031f('0x108')][_0x031f('0xee')](db[_0x031f('0x71')],{'as':_0x031f('0x125'),'foreignKey':_0x031f('0x124')});db[_0x031f('0x108')]['hasMany'](db[_0x031f('0xf6')],{'as':_0x031f('0xf6'),'foreignKey':_0x031f('0x124')});db[_0x031f('0x108')][_0x031f('0xee')](db['CmHopperBlack'],{'as':_0x031f('0x126'),'foreignKey':_0x031f('0x124')});db[_0x031f('0x108')][_0x031f('0xee')](db[_0x031f('0xc3')],{'as':_0x031f('0x127'),'foreignKey':_0x031f('0x124')});db[_0x031f('0x108')][_0x031f('0x128')](db[_0x031f('0x2a')],{'as':_0x031f('0x2a'),'foreignKey':'TrunkId'});db[_0x031f('0x108')]['belongsTo'](db[_0x031f('0x2a')],{'as':'TrunkBackup','foreignKey':_0x031f('0x129')});db[_0x031f('0x108')]['belongsTo'](db[_0x031f('0x7c')],{'as':_0x031f('0x7c'),'foreignKey':'IntervalId'});db['VoiceQueue'][_0x031f('0x128')](db[_0x031f('0x12a')],{'as':_0x031f('0x12b'),'foreignKey':_0x031f('0x12c')});db[_0x031f('0x108')]['belongsToMany'](db[_0x031f('0xe4')],{'as':_0x031f('0xfe'),'through':'voice_queues_has_cm_lists'});db['VoiceQueue']['belongsToMany'](db[_0x031f('0x13')],{'as':_0x031f('0x12d'),'through':_0x031f('0x2f')});db[_0x031f('0x108')][_0x031f('0xfb')](db[_0x031f('0x12e')],{'as':_0x031f('0x12f'),'through':_0x031f('0x130')});db[_0x031f('0x108')][_0x031f('0xfb')](db[_0x031f('0xe4')],{'as':_0x031f('0x131'),'through':_0x031f('0x132')});db['VoiceRecording'][_0x031f('0x128')](db[_0x031f('0x13')],{'as':_0x031f('0x13'),'foreignKey':_0x031f('0xf1')});db['ScreenRecording']['belongsTo'](db['User'],{'as':_0x031f('0x13'),'foreignKey':_0x031f('0xf1')});db[_0x031f('0x1e')]['hasMany'](db[_0x031f('0x133')],{'as':_0x031f('0x134'),'onDelete':_0x031f('0xed'),'foreignKey':_0x031f('0x135'),'sourceKey':_0x031f('0x136')});db[_0x031f('0x133')][_0x031f('0x128')](db[_0x031f('0x1e')],{'foreignKey':_0x031f('0x135'),'targetKey':_0x031f('0x136')});db[_0x031f('0x21')]['hasMany'](db[_0x031f('0x27')],{'as':'QueueCalls','foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport'][_0x031f('0xee')](db[_0x031f('0x25')],{'as':_0x031f('0x137'),'foreignKey':_0x031f('0x138'),'constraints':![]});db[_0x031f('0x21')]['belongsTo'](db['User'],{'as':_0x031f('0x13'),'foreignKey':_0x031f('0xf1')});db[_0x031f('0x21')][_0x031f('0x128')](db[_0x031f('0x6b')],{'as':_0x031f('0x139'),'foreignKey':'ContactId'});db[_0x031f('0x13a')]['belongsTo'](db[_0x031f('0x114')],{'as':_0x031f('0x114'),'foreignKey':'MailAccountId'});db['MailServerOut'][_0x031f('0x128')](db[_0x031f('0x114')],{'as':_0x031f('0x114'),'foreignKey':_0x031f('0x13b')});db[_0x031f('0x114')][_0x031f('0xec')](db[_0x031f('0x13a')],{'as':_0x031f('0x13c'),'onDelete':_0x031f('0xed')});db[_0x031f('0x114')][_0x031f('0xec')](db[_0x031f('0x13d')],{'as':_0x031f('0x13e'),'onDelete':_0x031f('0xed')});db[_0x031f('0x114')][_0x031f('0xee')](db[_0x031f('0x13f')],{'as':_0x031f('0x140'),'foreignKey':'MailAccountId'});db[_0x031f('0x114')]['hasMany'](db[_0x031f('0x78')],{'as':_0x031f('0x141'),'foreignKey':'MailAccountId'});db[_0x031f('0x114')][_0x031f('0xee')](db[_0x031f('0x41')],{'as':_0x031f('0x134'),'foreignKey':_0x031f('0x13b')});db[_0x031f('0x114')]['hasMany'](db[_0x031f('0x3f')],{'as':_0x031f('0x142')});db['MailAccount'][_0x031f('0xee')](db[_0x031f('0x143')],{'as':_0x031f('0x11e')});db[_0x031f('0x114')][_0x031f('0x128')](db[_0x031f('0xe4')],{'as':'List','foreignKey':_0x031f('0x144')});db['MailAccount']['belongsTo'](db[_0x031f('0x145')],{'as':_0x031f('0x145'),'foreignKey':_0x031f('0x146')});db[_0x031f('0x114')][_0x031f('0x128')](db[_0x031f('0x12a')],{'as':_0x031f('0x12b'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x031f('0x114')][_0x031f('0xfb')](db[_0x031f('0x13')],{'as':'Agents','through':_0x031f('0x116')});db['MailQueue']['belongsToMany'](db[_0x031f('0x13')],{'as':_0x031f('0x12d'),'through':_0x031f('0x33')});db[_0x031f('0x3c')][_0x031f('0xfb')](db[_0x031f('0x12e')],{'through':_0x031f('0x147'),'as':_0x031f('0x12f')});db['MailInteraction'][_0x031f('0xee')](db[_0x031f('0x41')],{'as':_0x031f('0x134'),'onDelete':_0x031f('0xed'),'foreignKey':'MailInteractionId'});db[_0x031f('0x3f')][_0x031f('0x128')](db[_0x031f('0x114')],{'as':'Account','foreignKey':'MailAccountId'});db[_0x031f('0x3f')][_0x031f('0x128')](db[_0x031f('0x6b')],{'as':_0x031f('0x139'),'foreignKey':_0x031f('0x148')});db[_0x031f('0x3f')][_0x031f('0x128')](db[_0x031f('0x13')],{'as':_0x031f('0x149'),'foreignKey':'UserId'});db[_0x031f('0x3f')][_0x031f('0xfb')](db[_0x031f('0x83')],{'through':_0x031f('0x14a'),'as':'Tags'});db[_0x031f('0x3f')][_0x031f('0xfb')](db[_0x031f('0x83')],{'through':_0x031f('0x14a'),'as':_0x031f('0x14b')});db[_0x031f('0x3f')][_0x031f('0xfb')](db['User'],{'as':_0x031f('0x14c'),'through':'user_has_mail_interactions','foreignKey':_0x031f('0x14d')});db['MailMessage'][_0x031f('0xee')](db['Attachment'],{'as':_0x031f('0x14e'),'onDelete':_0x031f('0xed')});db[_0x031f('0x41')]['belongsTo'](db[_0x031f('0x13')],{'as':_0x031f('0x13')});db[_0x031f('0x41')][_0x031f('0x128')](db[_0x031f('0x6b')],{'onDelete':_0x031f('0xed'),'as':_0x031f('0x139')});db[_0x031f('0x41')][_0x031f('0x128')](db['MailInteraction'],{'as':_0x031f('0x14f'),'foreignKey':_0x031f('0x14d')});db[_0x031f('0x41')][_0x031f('0x128')](db[_0x031f('0x114')],{'as':_0x031f('0x150'),'foreignKey':_0x031f('0x13b')});db[_0x031f('0x143')]['belongsTo'](db['User'],{'onDelete':_0x031f('0x151')});db['MailApplication'][_0x031f('0x128')](db['MailQueue'],{'onDelete':'restrict'});db[_0x031f('0x143')][_0x031f('0x128')](db[_0x031f('0x114')],{'onDelete':_0x031f('0x151')});db[_0x031f('0x143')]['belongsTo'](db[_0x031f('0x7c')],{'onDelete':'restrict','foreignKey':_0x031f('0x152')});db['MailApplication']['belongsTo'](db[_0x031f('0x83')],{'onDelete':_0x031f('0x151'),'foreignKey':_0x031f('0x153')});db[_0x031f('0x154')][_0x031f('0x128')](db['MailAccount'],{});db['MailQueueReport']['belongsTo'](db[_0x031f('0xe4')],{'as':'List','foreignKey':_0x031f('0x144')});db[_0x031f('0x154')]['belongsTo'](db[_0x031f('0x6b')],{'as':_0x031f('0x139'),'foreignKey':_0x031f('0x148')});db['MailQueueReport']['belongsTo'](db[_0x031f('0x3f')],{});db[_0x031f('0x154')][_0x031f('0x128')](db['MailMessage'],{});db['MailQueueReport'][_0x031f('0x128')](db['User'],{});db['MailQueueReport'][_0x031f('0x128')](db[_0x031f('0x3c')],{});db[_0x031f('0x44')]['hasMany'](db['DashboardItem'],{'as':_0x031f('0x155'),'onDelete':_0x031f('0xed')});db[_0x031f('0x46')][_0x031f('0xee')](db[_0x031f('0x13f')],{'as':_0x031f('0x140'),'foreignKey':_0x031f('0x156')});db[_0x031f('0x46')]['hasMany'](db[_0x031f('0x78')],{'as':_0x031f('0x141'),'foreignKey':_0x031f('0x156')});db['FaxAccount'][_0x031f('0xee')](db['FaxInteraction'],{'as':_0x031f('0x142')});db[_0x031f('0x46')][_0x031f('0xee')](db[_0x031f('0x157')],{'as':_0x031f('0x11e')});db[_0x031f('0x46')]['hasMany'](db[_0x031f('0x18')],{'as':_0x031f('0x158'),'onDelete':_0x031f('0xed')});db['FaxAccount'][_0x031f('0xee')](db[_0x031f('0x4a')],{'as':'Messages'});db[_0x031f('0x46')][_0x031f('0x128')](db[_0x031f('0x2a')],{'as':'Trunk'});db['FaxAccount'][_0x031f('0x128')](db[_0x031f('0xe4')],{'as':_0x031f('0x159'),'foreignKey':_0x031f('0x144')});db[_0x031f('0x46')][_0x031f('0x128')](db[_0x031f('0x12a')],{'as':_0x031f('0x12b'),'foreignKey':_0x031f('0x12c')});db['FaxAccount'][_0x031f('0xfb')](db[_0x031f('0x13')],{'as':_0x031f('0x12d'),'through':_0x031f('0x113')});db['FaxApplication']['belongsTo'](db[_0x031f('0x13')],{'onDelete':'restrict'});db[_0x031f('0x157')][_0x031f('0x128')](db['FaxQueue'],{'onDelete':_0x031f('0x151')});db[_0x031f('0x157')][_0x031f('0x128')](db['FaxAccount'],{'onDelete':_0x031f('0x151')});db[_0x031f('0x157')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':_0x031f('0x153')});db[_0x031f('0xf9')][_0x031f('0xee')](db[_0x031f('0x4a')],{'as':_0x031f('0x134'),'onDelete':_0x031f('0xed'),'foreignKey':_0x031f('0x15a')});db['FaxInteraction'][_0x031f('0x128')](db['FaxAccount'],{'as':_0x031f('0x150'),'foreignKey':_0x031f('0x156')});db['FaxInteraction'][_0x031f('0x128')](db[_0x031f('0x6b')],{'as':_0x031f('0x139'),'foreignKey':_0x031f('0x148')});db[_0x031f('0xf9')][_0x031f('0x128')](db[_0x031f('0x13')],{'as':_0x031f('0x149'),'foreignKey':'UserId'});db[_0x031f('0xf9')][_0x031f('0xfb')](db[_0x031f('0x83')],{'through':'fax_interaction_has_tags','as':'Tags'});db[_0x031f('0xf9')]['belongsToMany'](db[_0x031f('0x83')],{'through':'fax_interaction_has_tags','as':'ThroughTags'});db['FaxInteraction'][_0x031f('0xfb')](db[_0x031f('0x13')],{'as':_0x031f('0x14c'),'through':_0x031f('0x105'),'foreignKey':_0x031f('0x15a')});db[_0x031f('0x4a')]['belongsTo'](db[_0x031f('0x13')],{'onDelete':'cascade','as':'User'});db['FaxMessage'][_0x031f('0x128')](db[_0x031f('0xf9')],{'as':_0x031f('0x14f'),'foreignKey':_0x031f('0x15a')});db[_0x031f('0x4a')][_0x031f('0x128')](db[_0x031f('0x6b')],{'onDelete':_0x031f('0xed'),'as':_0x031f('0x139')});db[_0x031f('0x4a')]['belongsTo'](db[_0x031f('0x15b')],{'as':_0x031f('0x15b'),'foreignKey':_0x031f('0x15c')});db[_0x031f('0x4a')]['belongsTo'](db[_0x031f('0x46')],{'as':'Account','foreignKey':_0x031f('0x156')});db[_0x031f('0x4c')][_0x031f('0xfb')](db['User'],{'as':_0x031f('0x12d'),'through':'UserFaxQueue'});db[_0x031f('0x4c')][_0x031f('0xfb')](db[_0x031f('0x12e')],{'through':_0x031f('0x15d'),'as':_0x031f('0x12f')});db['FaxQueueReport'][_0x031f('0x128')](db[_0x031f('0x46')],{});db['FaxQueueReport']['belongsTo'](db['CmList'],{'as':_0x031f('0x159'),'foreignKey':_0x031f('0x144')});db[_0x031f('0x4e')][_0x031f('0x128')](db[_0x031f('0x6b')],{'as':_0x031f('0x139'),'foreignKey':_0x031f('0x148')});db['FaxQueueReport'][_0x031f('0x128')](db[_0x031f('0xf9')],{});db[_0x031f('0x4e')][_0x031f('0x128')](db['FaxMessage'],{});db[_0x031f('0x4e')][_0x031f('0x128')](db[_0x031f('0x13')],{});db['FaxQueueReport'][_0x031f('0x128')](db['FaxQueue'],{});db[_0x031f('0x50')][_0x031f('0xee')](db[_0x031f('0x13f')],{'as':_0x031f('0x140'),'foreignKey':_0x031f('0x15e')});db[_0x031f('0x50')][_0x031f('0xee')](db[_0x031f('0x78')],{'as':_0x031f('0x141'),'foreignKey':_0x031f('0x15e')});db[_0x031f('0x50')][_0x031f('0xee')](db[_0x031f('0x54')],{'as':'Messages','foreignKey':_0x031f('0x15e')});db[_0x031f('0x50')]['hasMany'](db[_0x031f('0x52')],{'as':_0x031f('0x142')});db['SmsAccount'][_0x031f('0xee')](db[_0x031f('0x15f')],{'as':'Applications'});db['SmsAccount'][_0x031f('0x128')](db['CmList'],{'as':_0x031f('0x159'),'foreignKey':'ListId'});db[_0x031f('0x50')][_0x031f('0x128')](db[_0x031f('0x12a')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x031f('0x50')][_0x031f('0xfb')](db[_0x031f('0x13')],{'as':'Agents','through':_0x031f('0x160')});db[_0x031f('0x15f')]['belongsTo'](db['User'],{'onDelete':_0x031f('0x151')});db[_0x031f('0x15f')][_0x031f('0x128')](db[_0x031f('0x56')],{'onDelete':_0x031f('0x151')});db['SmsApplication']['belongsTo'](db[_0x031f('0x50')],{'onDelete':_0x031f('0x151')});db['SmsApplication'][_0x031f('0x128')](db[_0x031f('0x7c')],{'onDelete':'restrict','foreignKey':_0x031f('0x152')});db[_0x031f('0x15f')]['belongsTo'](db[_0x031f('0x83')],{'onDelete':_0x031f('0x151'),'foreignKey':'TagId'});db[_0x031f('0x52')][_0x031f('0xee')](db[_0x031f('0x54')],{'as':'Messages','onDelete':_0x031f('0xed'),'foreignKey':'SmsInteractionId'});db[_0x031f('0x52')][_0x031f('0x128')](db[_0x031f('0x50')],{'as':_0x031f('0x150'),'foreignKey':_0x031f('0x15e')});db[_0x031f('0x52')]['belongsTo'](db[_0x031f('0x6b')],{'as':_0x031f('0x139'),'foreignKey':_0x031f('0x148')});db[_0x031f('0x52')][_0x031f('0x128')](db['User'],{'as':_0x031f('0x149'),'foreignKey':_0x031f('0xf1')});db[_0x031f('0x52')][_0x031f('0xfb')](db[_0x031f('0x83')],{'through':_0x031f('0x161'),'as':_0x031f('0x162')});db[_0x031f('0x52')][_0x031f('0xfb')](db[_0x031f('0x83')],{'through':_0x031f('0x161'),'as':_0x031f('0x14b')});db[_0x031f('0x52')]['belongsToMany'](db[_0x031f('0x13')],{'as':_0x031f('0x14c'),'through':_0x031f('0x106'),'foreignKey':_0x031f('0x163')});db[_0x031f('0x54')]['belongsTo'](db[_0x031f('0x13')],{'as':_0x031f('0x13')});db['SmsMessage']['belongsTo'](db[_0x031f('0x6b')],{'onDelete':'cascade','as':_0x031f('0x139')});db[_0x031f('0x54')][_0x031f('0x128')](db[_0x031f('0x52')],{'onDelete':_0x031f('0xed'),'as':_0x031f('0x14f'),'foreignKey':'SmsInteractionId'});db[_0x031f('0x54')][_0x031f('0x128')](db[_0x031f('0x50')],{'as':'Account','foreignKey':_0x031f('0x15e')});db[_0x031f('0x56')][_0x031f('0xfb')](db[_0x031f('0x13')],{'as':_0x031f('0x12d'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db[_0x031f('0x56')][_0x031f('0xfb')](db[_0x031f('0x12e')],{'through':_0x031f('0x164'),'as':_0x031f('0x12f')});db[_0x031f('0x58')]['hasMany'](db[_0x031f('0x13f')],{'as':_0x031f('0x140'),'foreignKey':_0x031f('0x165')});db[_0x031f('0x58')]['hasMany'](db['CannedAnswer'],{'as':_0x031f('0x141'),'foreignKey':_0x031f('0x165')});db[_0x031f('0x58')][_0x031f('0xee')](db['OpenchannelInteraction'],{'as':'Interactions','foreignKey':_0x031f('0x165')});db['OpenchannelAccount'][_0x031f('0xee')](db[_0x031f('0x166')],{'as':'Messages','foreignKey':_0x031f('0x165')});db['OpenchannelAccount'][_0x031f('0xee')](db[_0x031f('0x167')],{'as':_0x031f('0x11e'),'foreignKey':_0x031f('0x165')});db[_0x031f('0x58')][_0x031f('0x128')](db[_0x031f('0xe4')],{'as':'List','foreignKey':_0x031f('0x144')});db[_0x031f('0x58')][_0x031f('0x128')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x031f('0x12c')});db['OpenchannelAccount'][_0x031f('0xfb')](db[_0x031f('0x13')],{'as':_0x031f('0x12d'),'through':_0x031f('0x118')});db[_0x031f('0x167')]['belongsTo'](db[_0x031f('0x13')],{'onDelete':_0x031f('0x151')});db[_0x031f('0x167')][_0x031f('0x128')](db[_0x031f('0x5c')],{'onDelete':_0x031f('0x151'),'foreignKey':_0x031f('0x168')});db[_0x031f('0x167')]['belongsTo'](db[_0x031f('0x58')],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db[_0x031f('0x167')][_0x031f('0x128')](db['Interval'],{'onDelete':_0x031f('0x151'),'foreignKey':_0x031f('0x152')});db[_0x031f('0x167')][_0x031f('0x128')](db[_0x031f('0x83')],{'onDelete':_0x031f('0x151'),'foreignKey':'TagId'});db[_0x031f('0x5a')][_0x031f('0xee')](db['OpenchannelMessage'],{'as':_0x031f('0x134'),'onDelete':_0x031f('0xed'),'foreignKey':_0x031f('0x169')});db[_0x031f('0x5a')][_0x031f('0x128')](db['OpenchannelAccount'],{'as':_0x031f('0x150'),'foreignKey':_0x031f('0x165')});db[_0x031f('0x5a')]['belongsTo'](db[_0x031f('0x6b')],{'as':'Contact','foreignKey':_0x031f('0x148')});db[_0x031f('0x5a')][_0x031f('0x128')](db['User'],{'as':_0x031f('0x149'),'foreignKey':_0x031f('0xf1')});db[_0x031f('0x5a')][_0x031f('0xfb')](db[_0x031f('0x83')],{'through':_0x031f('0x16a'),'as':_0x031f('0x162')});db[_0x031f('0x5a')][_0x031f('0xfb')](db[_0x031f('0x83')],{'through':_0x031f('0x16a'),'as':_0x031f('0x14b')});db[_0x031f('0x5a')][_0x031f('0xfb')](db[_0x031f('0x13')],{'as':_0x031f('0x14c'),'through':'user_has_openchannel_interactions','foreignKey':_0x031f('0x169')});db[_0x031f('0x166')][_0x031f('0x128')](db[_0x031f('0x13')],{'onDelete':_0x031f('0xed'),'as':_0x031f('0x13')});db[_0x031f('0x166')]['belongsTo'](db['CmContact'],{'onDelete':_0x031f('0xed'),'as':_0x031f('0x139')});db[_0x031f('0x166')][_0x031f('0x128')](db[_0x031f('0x5a')],{'onDelete':_0x031f('0xed'),'as':_0x031f('0x14f'),'foreignKey':_0x031f('0x169')});db[_0x031f('0x166')][_0x031f('0x128')](db[_0x031f('0x15b')],{'as':_0x031f('0x15b'),'foreignKey':'AttachmentId'});db[_0x031f('0x166')][_0x031f('0x128')](db[_0x031f('0x58')],{'as':_0x031f('0x150'),'foreignKey':_0x031f('0x165')});db[_0x031f('0x5c')][_0x031f('0xfb')](db[_0x031f('0x13')],{'as':'Agents','through':_0x031f('0x38'),'foreignKey':_0x031f('0x168')});db[_0x031f('0x5c')][_0x031f('0xfb')](db[_0x031f('0x12e')],{'through':_0x031f('0x16b'),'as':_0x031f('0x12f')});db[_0x031f('0x110')]['hasMany'](db[_0x031f('0x13f')],{'as':_0x031f('0x140'),'foreignKey':_0x031f('0x16c')});db[_0x031f('0x110')][_0x031f('0xee')](db['CannedAnswer'],{'as':_0x031f('0x141'),'foreignKey':_0x031f('0x16c')});db['ChatWebsite'][_0x031f('0xee')](db[_0x031f('0x68')],{'as':_0x031f('0x16d')});db[_0x031f('0x110')]['hasMany'](db[_0x031f('0x61')],{'as':_0x031f('0x142')});db[_0x031f('0x110')][_0x031f('0xee')](db[_0x031f('0x5f')],{'as':'Applications'});db['ChatWebsite'][_0x031f('0xee')](db[_0x031f('0x62')],{'as':_0x031f('0x134')});db[_0x031f('0x110')][_0x031f('0x128')](db['CmList'],{'as':_0x031f('0x159'),'foreignKey':_0x031f('0x144')});db[_0x031f('0x110')][_0x031f('0x128')](db[_0x031f('0x7c')],{'as':'Interval','foreignKey':_0x031f('0x152')});db[_0x031f('0x110')][_0x031f('0x128')](db[_0x031f('0x12a')],{'as':_0x031f('0x12b'),'foreignKey':_0x031f('0x12c')});db[_0x031f('0x110')]['belongsToMany'](db['User'],{'as':_0x031f('0x12d'),'through':_0x031f('0x111')});db['OpenchannelQueueReport'][_0x031f('0x128')](db[_0x031f('0x58')],{});db[_0x031f('0x5e')]['belongsTo'](db[_0x031f('0xe4')],{'as':_0x031f('0x159'),'foreignKey':_0x031f('0x144')});db['OpenchannelQueueReport'][_0x031f('0x128')](db[_0x031f('0x6b')],{'as':_0x031f('0x139'),'foreignKey':'ContactId'});db[_0x031f('0x5e')]['belongsTo'](db[_0x031f('0x5a')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x031f('0x166')],{});db[_0x031f('0x5e')][_0x031f('0x128')](db[_0x031f('0x13')],{});db[_0x031f('0x5e')]['belongsTo'](db[_0x031f('0x5c')],{});db[_0x031f('0x5f')][_0x031f('0x128')](db[_0x031f('0x13')],{'as':_0x031f('0x16e'),'foreignKey':'UserId','onDelete':_0x031f('0x151')});db[_0x031f('0x5f')][_0x031f('0x128')](db[_0x031f('0x66')],{'as':'Queue','foreignKey':_0x031f('0x16f'),'onDelete':'restrict'});db['ChatApplication'][_0x031f('0x128')](db[_0x031f('0x110')],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':_0x031f('0x151')});db[_0x031f('0x5f')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x031f('0x61')][_0x031f('0xee')](db[_0x031f('0x62')],{'as':_0x031f('0x134'),'onDelete':'cascade','foreignKey':_0x031f('0x170')});db['ChatInteraction'][_0x031f('0x128')](db[_0x031f('0x110')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x031f('0x61')][_0x031f('0x128')](db[_0x031f('0x6b')],{'as':_0x031f('0x139'),'foreignKey':_0x031f('0x148')});db[_0x031f('0x61')]['belongsTo'](db['User'],{'as':_0x031f('0x149'),'foreignKey':'UserId'});db[_0x031f('0x61')]['belongsToMany'](db[_0x031f('0x83')],{'through':_0x031f('0x171'),'as':_0x031f('0x162')});db[_0x031f('0x61')][_0x031f('0xfb')](db[_0x031f('0x83')],{'through':_0x031f('0x171'),'as':'ThroughTags'});db[_0x031f('0x61')][_0x031f('0xfb')](db[_0x031f('0x13')],{'as':_0x031f('0x14c'),'through':_0x031f('0x103'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0x031f('0x128')](db[_0x031f('0x13')],{'onDelete':_0x031f('0xed'),'as':_0x031f('0x13')});db[_0x031f('0x62')][_0x031f('0x128')](db[_0x031f('0x6b')],{'onDelete':_0x031f('0xed'),'as':_0x031f('0x139'),'foreignKey':'ContactId'});db['ChatMessage'][_0x031f('0x128')](db[_0x031f('0x61')],{'onDelete':'cascade','as':_0x031f('0x14f'),'foreignKey':_0x031f('0x170')});db['ChatMessage'][_0x031f('0x128')](db[_0x031f('0x15b')],{'as':_0x031f('0x15b'),'foreignKey':_0x031f('0x15c')});db[_0x031f('0x62')][_0x031f('0x128')](db[_0x031f('0x110')],{'as':_0x031f('0x150'),'foreignKey':'ChatWebsiteId'});db[_0x031f('0x64')][_0x031f('0x128')](db[_0x031f('0x6b')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x031f('0x148')});db[_0x031f('0x64')][_0x031f('0x128')](db['ChatWebsite'],{'as':_0x031f('0x150'),'foreignKey':'ChatWebsiteId'});db[_0x031f('0x66')][_0x031f('0xfb')](db['User'],{'as':_0x031f('0x12d'),'through':_0x031f('0x31'),'hooks':!![]});db[_0x031f('0x66')][_0x031f('0xfb')](db[_0x031f('0x12e')],{'through':_0x031f('0x172'),'as':_0x031f('0x12f')});db[_0x031f('0x67')][_0x031f('0xee')](db[_0x031f('0xbe')],{'as':_0x031f('0x134'),'foreignKey':_0x031f('0x173'),'onDelete':_0x031f('0xed')});db[_0x031f('0x67')][_0x031f('0xfb')](db[_0x031f('0x13')],{'as':_0x031f('0x123'),'through':_0x031f('0x174')});db['ChatProactiveAction'][_0x031f('0x128')](db['ChatWebsite'],{'as':'Website','foreignKey':_0x031f('0x16c')});db[_0x031f('0x69')][_0x031f('0xee')](db['CmContact'],{'as':_0x031f('0xfd'),'foreignKey':_0x031f('0x175')});db[_0x031f('0x6b')][_0x031f('0xee')](db[_0x031f('0x6d')],{'as':_0x031f('0x176'),'foreignKey':'ContactId'});db['CmContact']['hasMany'](db[_0x031f('0x6f')],{'as':_0x031f('0xf4'),'foreignKey':_0x031f('0x148')});db['CmContact']['hasMany'](db['CmHopperHistory'],{'as':_0x031f('0x125'),'foreignKey':_0x031f('0x148')});db[_0x031f('0x6b')][_0x031f('0xee')](db[_0x031f('0xf6')],{'as':'ReportAgentPreview','foreignKey':'ContactId'});db[_0x031f('0x6b')][_0x031f('0xee')](db[_0x031f('0xc3')],{'as':_0x031f('0x127'),'foreignKey':_0x031f('0x148')});db[_0x031f('0x6b')][_0x031f('0xee')](db[_0x031f('0x5a')],{'as':_0x031f('0x107'),'foreignKey':_0x031f('0x148'),'onDelete':'restrict'});db[_0x031f('0x6b')]['hasMany'](db[_0x031f('0x61')],{'as':_0x031f('0xf7'),'foreignKey':_0x031f('0x148'),'onDelete':_0x031f('0x151')});db[_0x031f('0x6b')]['hasMany'](db[_0x031f('0x52')],{'as':_0x031f('0xf8'),'foreignKey':_0x031f('0x148'),'onDelete':_0x031f('0x151')});db[_0x031f('0x6b')][_0x031f('0xee')](db[_0x031f('0xf9')],{'as':_0x031f('0x104'),'foreignKey':_0x031f('0x148'),'onDelete':_0x031f('0x151')});db[_0x031f('0x6b')]['hasMany'](db[_0x031f('0x3f')],{'as':_0x031f('0x101'),'foreignKey':_0x031f('0x148'),'onDelete':_0x031f('0x151')});db[_0x031f('0x6b')][_0x031f('0x128')](db[_0x031f('0x69')],{'as':_0x031f('0x177'),'foreignKey':_0x031f('0x175')});db[_0x031f('0x6b')][_0x031f('0x128')](db[_0x031f('0xe4')],{'as':_0x031f('0x159'),'foreignKey':_0x031f('0x144'),'onDelete':_0x031f('0xed')});db['CmContact'][_0x031f('0xfb')](db['User'],{'as':_0x031f('0x14c'),'through':'cm_user_has_contacts'});db['CmContact'][_0x031f('0xfb')](db[_0x031f('0x83')],{'as':'Tags','through':'cm_contact_has_tags'});db[_0x031f('0x6b')][_0x031f('0xfb')](db[_0x031f('0x83')],{'through':_0x031f('0x178'),'as':_0x031f('0x14b')});db[_0x031f('0x6d')][_0x031f('0x128')](db[_0x031f('0x6b')],{'as':_0x031f('0x139'),'foreignKey':_0x031f('0x148'),'onDelete':_0x031f('0xed')});db[_0x031f('0x6d')][_0x031f('0x128')](db[_0x031f('0xe4')],{'as':_0x031f('0x159'),'foreignKey':_0x031f('0x144'),'onDelete':_0x031f('0xed')});db[_0x031f('0x6d')]['belongsTo'](db['User'],{'as':'Agent','foreignKey':'UserId'});db['CmHopper']['belongsTo'](db[_0x031f('0x108')],{'as':_0x031f('0x179'),'foreignKey':_0x031f('0x124'),'onDelete':_0x031f('0xed')});db[_0x031f('0x6d')][_0x031f('0x128')](db['Campaign'],{'as':_0x031f('0xd7'),'foreignKey':'CampaignId','onDelete':_0x031f('0xed')});db[_0x031f('0x6d')]['belongsTo'](db[_0x031f('0x13')],{'as':_0x031f('0x149'),'foreignKey':_0x031f('0x17a')});db[_0x031f('0x6e')][_0x031f('0x128')](db[_0x031f('0x6b')],{'as':_0x031f('0x139'),'foreignKey':_0x031f('0x148'),'onDelete':_0x031f('0xed')});db[_0x031f('0x6e')][_0x031f('0x128')](db[_0x031f('0xe4')],{'as':'List','foreignKey':_0x031f('0x144'),'onDelete':'cascade'});db['CmHopperBlack'][_0x031f('0x128')](db['VoiceQueue'],{'as':_0x031f('0x179'),'foreignKey':'VoiceQueueId','onDelete':_0x031f('0xed')});db[_0x031f('0x6e')][_0x031f('0x128')](db[_0x031f('0xd7')],{'as':_0x031f('0xd7'),'foreignKey':'CampaignId','onDelete':_0x031f('0xed')});db[_0x031f('0x76')][_0x031f('0xee')](db[_0x031f('0x17b')],{'as':{'plural':'All','singular':_0x031f('0x17c')},'foreignKey':_0x031f('0x17d'),'onDelete':_0x031f('0xed'),'hooks':!![]});db['Automation'][_0x031f('0xee')](db[_0x031f('0x17b')],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':_0x031f('0x17e'),'onDelete':_0x031f('0xed'),'hooks':!![]});db[_0x031f('0x76')][_0x031f('0xee')](db['Action'],{'as':_0x031f('0x17f'),'foreignKey':_0x031f('0x180'),'onDelete':_0x031f('0xed'),'hooks':!![]});db[_0x031f('0x7c')][_0x031f('0xee')](db[_0x031f('0x7c')],{'as':_0x031f('0x181'),'foreignKey':_0x031f('0x152'),'onDelete':_0x031f('0xed'),'hooks':!![],'required':![]});db[_0x031f('0x7c')]['hasMany'](db[_0x031f('0x18')],{'as':_0x031f('0xf3'),'foreignKey':_0x031f('0x152'),'onDelete':'restrict'});db[_0x031f('0x7c')][_0x031f('0xee')](db[_0x031f('0x143')],{'as':_0x031f('0x182'),'foreignKey':'IntervalId'});db[_0x031f('0x7c')]['hasMany'](db[_0x031f('0x5f')],{'as':'ChatApplications','foreignKey':'IntervalId'});db['Interval'][_0x031f('0xee')](db[_0x031f('0x157')],{'as':_0x031f('0x183'),'foreignKey':_0x031f('0x152')});db['Interval'][_0x031f('0xee')](db[_0x031f('0x15f')],{'as':_0x031f('0x184'),'foreignKey':_0x031f('0x152')});db[_0x031f('0x80')]['belongsTo'](db[_0x031f('0x114')],{});db[_0x031f('0x80')]['belongsTo'](db[_0x031f('0x8c')],{'foreignKey':_0x031f('0x185')});db[_0x031f('0x80')][_0x031f('0x128')](db['AnalyticCustomReport'],{'foreignKey':_0x031f('0x186')});db[_0x031f('0x11f')][_0x031f('0xfb')](db[_0x031f('0x1a')],{'as':_0x031f('0x187'),'through':_0x031f('0x121'),'onDelete':'restrict'});db['Tag'][_0x031f('0xfb')](db['CmContact'],{'through':_0x031f('0x178')});db[_0x031f('0x83')][_0x031f('0xfb')](db[_0x031f('0x61')],{'through':_0x031f('0x171')});db[_0x031f('0x83')]['belongsToMany'](db['MailInteraction'],{'through':_0x031f('0x14a')});db['Tag']['belongsToMany'](db[_0x031f('0x52')],{'through':_0x031f('0x161')});db[_0x031f('0x83')][_0x031f('0xfb')](db[_0x031f('0xf9')],{'through':'fax_interaction_has_tags'});db[_0x031f('0x83')][_0x031f('0xfb')](db['OpenchannelInteraction'],{'through':_0x031f('0x16a')});db['Trigger'][_0x031f('0xee')](db[_0x031f('0x17b')],{'as':{'plural':_0x031f('0x188'),'singular':_0x031f('0x189')},'foreignKey':_0x031f('0x18a'),'onDelete':'cascade','hooks':!![]});db[_0x031f('0x85')][_0x031f('0xee')](db[_0x031f('0x17b')],{'as':{'plural':_0x031f('0x18b'),'singular':'AnyCondition'},'foreignKey':'TriggerAnyId','onDelete':_0x031f('0xed'),'hooks':!![]});db[_0x031f('0x85')]['hasMany'](db[_0x031f('0x18c')],{'as':'Actions','foreignKey':_0x031f('0x18d'),'onDelete':_0x031f('0xed'),'hooks':!![]});db[_0x031f('0x8a')][_0x031f('0xee')](db[_0x031f('0x8f')],{'as':_0x031f('0x18e'),'onDelete':_0x031f('0xed'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x031f('0xee')](db[_0x031f('0x8f')],{'as':_0x031f('0x18e'),'onDelete':_0x031f('0xed'),'foreignKey':_0x031f('0x185')});db['AnalyticMetric'][_0x031f('0xee')](db[_0x031f('0x8f')],{'as':_0x031f('0x18e'),'onDelete':_0x031f('0xed'),'foreignKey':_0x031f('0x18f')});db['AnalyticFieldReport'][_0x031f('0x128')](db[_0x031f('0x8e')],{'foreignKey':_0x031f('0x18f')});db[_0x031f('0x93')][_0x031f('0xee')](db['SalesforceConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x031f('0x190')});db['SalesforceConfiguration'][_0x031f('0xee')](db['SalesforceField'],{'as':'Subjects','onDelete':_0x031f('0xed'),'foreignKey':_0x031f('0x191')});db[_0x031f('0x192')][_0x031f('0xee')](db[_0x031f('0x94')],{'as':'Descriptions','onDelete':_0x031f('0xed'),'foreignKey':_0x031f('0x193')});db[_0x031f('0x192')][_0x031f('0xee')](db[_0x031f('0x94')],{'as':_0x031f('0x18e'),'onDelete':'cascade','foreignKey':_0x031f('0x194')});db[_0x031f('0x192')]['belongsTo'](db[_0x031f('0x93')],{'as':_0x031f('0x150'),'foreignKey':'AccountId'});db[_0x031f('0x94')]['hasMany'](db[_0x031f('0x94')],{'as':_0x031f('0x195'),'foreignKey':_0x031f('0x191')});db[_0x031f('0x94')]['hasMany'](db[_0x031f('0x94')],{'as':_0x031f('0x196'),'foreignKey':'DescriptionId'});db[_0x031f('0x94')][_0x031f('0xee')](db[_0x031f('0x94')],{'as':_0x031f('0x197'),'foreignKey':_0x031f('0x194')});db['SalesforceField'][_0x031f('0x128')](db['Variable'],{'as':_0x031f('0x198'),'foreignKey':_0x031f('0x199')});db[_0x031f('0x96')]['hasMany'](db[_0x031f('0x98')],{'as':_0x031f('0x19a'),'onDelete':'cascade','foreignKey':_0x031f('0x190')});db['SugarcrmConfiguration']['hasMany'](db[_0x031f('0x9a')],{'as':_0x031f('0x19b'),'onDelete':_0x031f('0xed'),'foreignKey':_0x031f('0x191')});db[_0x031f('0x98')][_0x031f('0xee')](db['SugarcrmField'],{'as':_0x031f('0x19c'),'onDelete':'cascade','foreignKey':_0x031f('0x193')});db[_0x031f('0x98')][_0x031f('0xee')](db[_0x031f('0x9a')],{'as':'Fields','onDelete':_0x031f('0xed'),'foreignKey':_0x031f('0x194')});db[_0x031f('0x98')][_0x031f('0x128')](db[_0x031f('0x96')],{'as':'Account','foreignKey':_0x031f('0x190')});db[_0x031f('0x9a')][_0x031f('0xee')](db[_0x031f('0x9a')],{'as':_0x031f('0x195'),'foreignKey':_0x031f('0x191')});db[_0x031f('0x9a')][_0x031f('0xee')](db[_0x031f('0x9a')],{'as':_0x031f('0x196'),'foreignKey':_0x031f('0x193')});db['SugarcrmField'][_0x031f('0xee')](db[_0x031f('0x9a')],{'as':_0x031f('0x197'),'foreignKey':_0x031f('0x194')});db[_0x031f('0x9a')][_0x031f('0x128')](db[_0x031f('0x198')],{'as':_0x031f('0x198'),'foreignKey':_0x031f('0x199')});db[_0x031f('0x9c')]['hasMany'](db[_0x031f('0x9e')],{'as':_0x031f('0x19a'),'onDelete':_0x031f('0xed'),'foreignKey':_0x031f('0x190')});db[_0x031f('0x9e')]['hasMany'](db[_0x031f('0xa0')],{'as':'Subjects','onDelete':_0x031f('0xed'),'foreignKey':_0x031f('0x191')});db[_0x031f('0x9e')][_0x031f('0xee')](db['DeskField'],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x031f('0x193')});db['DeskConfiguration'][_0x031f('0xee')](db[_0x031f('0xa0')],{'as':_0x031f('0x18e'),'onDelete':'cascade','foreignKey':_0x031f('0x194')});db[_0x031f('0x9e')][_0x031f('0x128')](db[_0x031f('0x9c')],{'as':'Account','foreignKey':'AccountId'});db['DeskConfiguration']['belongsToMany'](db[_0x031f('0x83')],{'through':'int_desk_configuration_has_tags'});db[_0x031f('0xa0')][_0x031f('0xee')](db[_0x031f('0xa0')],{'as':'Subject','foreignKey':_0x031f('0x191')});db[_0x031f('0xa0')]['hasMany'](db['DeskField'],{'as':'Description','foreignKey':_0x031f('0x193')});db[_0x031f('0xa0')][_0x031f('0xee')](db['DeskField'],{'as':_0x031f('0x197'),'foreignKey':_0x031f('0x194')});db[_0x031f('0xa0')][_0x031f('0x128')](db[_0x031f('0x198')],{'as':_0x031f('0x198'),'foreignKey':_0x031f('0x199')});db['ZohoAccount'][_0x031f('0xee')](db[_0x031f('0xa3')],{'as':_0x031f('0x19a'),'onDelete':'cascade','foreignKey':_0x031f('0x190')});db['ZohoConfiguration'][_0x031f('0xee')](db['ZohoField'],{'as':_0x031f('0x19b'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x031f('0xa3')][_0x031f('0xee')](db['ZohoField'],{'as':_0x031f('0x19c'),'onDelete':'cascade','foreignKey':_0x031f('0x193')});db['ZohoConfiguration']['hasMany'](db[_0x031f('0xa5')],{'as':_0x031f('0x18e'),'onDelete':_0x031f('0xed'),'foreignKey':'FieldId'});db['ZohoConfiguration'][_0x031f('0x128')](db[_0x031f('0x19d')],{'as':_0x031f('0x150'),'foreignKey':_0x031f('0x190')});db[_0x031f('0xa5')][_0x031f('0xee')](db[_0x031f('0xa5')],{'as':_0x031f('0x195'),'foreignKey':'SubjectId'});db[_0x031f('0xa5')][_0x031f('0xee')](db[_0x031f('0xa5')],{'as':_0x031f('0x196'),'foreignKey':'DescriptionId'});db[_0x031f('0xa5')][_0x031f('0xee')](db[_0x031f('0xa5')],{'as':'Field','foreignKey':_0x031f('0x194')});db[_0x031f('0xa5')]['belongsTo'](db[_0x031f('0x198')],{'as':'Variable','foreignKey':_0x031f('0x199')});db[_0x031f('0xa7')][_0x031f('0xee')](db[_0x031f('0xa9')],{'as':_0x031f('0x19a'),'onDelete':'cascade','foreignKey':_0x031f('0x190')});db[_0x031f('0xa9')]['hasMany'](db[_0x031f('0x19e')],{'as':_0x031f('0x19b'),'foreignKey':_0x031f('0x191')});db['ZendeskConfiguration'][_0x031f('0xee')](db['ZendeskField'],{'as':_0x031f('0x19c'),'foreignKey':'DescriptionId'});db[_0x031f('0xa9')][_0x031f('0xee')](db['ZendeskField'],{'as':_0x031f('0x18e'),'foreignKey':'FieldId'});db['ZendeskConfiguration'][_0x031f('0x128')](db['ZendeskAccount'],{'as':'Account','foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x031f('0xfb')](db[_0x031f('0x83')],{'through':_0x031f('0x19f')});db['ZendeskField'][_0x031f('0xee')](db[_0x031f('0x19e')],{'as':_0x031f('0x195'),'foreignKey':_0x031f('0x191')});db['ZendeskField'][_0x031f('0xee')](db[_0x031f('0x19e')],{'as':'Description','foreignKey':_0x031f('0x193')});db[_0x031f('0x19e')][_0x031f('0xee')](db[_0x031f('0x19e')],{'as':_0x031f('0x197'),'foreignKey':_0x031f('0x194')});db['ZendeskField'][_0x031f('0x128')](db[_0x031f('0x198')],{'as':_0x031f('0x198'),'foreignKey':'VariableId'});db['FreshdeskAccount'][_0x031f('0xee')](db[_0x031f('0xad')],{'as':_0x031f('0x19a'),'onDelete':_0x031f('0xed'),'foreignKey':'AccountId'});db[_0x031f('0xad')]['hasMany'](db[_0x031f('0x1a0')],{'as':_0x031f('0x19b'),'onDelete':_0x031f('0xed'),'foreignKey':'SubjectId'});db['FreshdeskConfiguration'][_0x031f('0xee')](db[_0x031f('0x1a0')],{'as':_0x031f('0x19c'),'onDelete':_0x031f('0xed'),'foreignKey':_0x031f('0x193')});db[_0x031f('0xad')][_0x031f('0xee')](db[_0x031f('0x1a0')],{'as':'Fields','onDelete':_0x031f('0xed'),'foreignKey':_0x031f('0x194')});db[_0x031f('0xad')][_0x031f('0x128')](db[_0x031f('0x1a1')],{'as':_0x031f('0x150'),'foreignKey':_0x031f('0x190')});db[_0x031f('0xad')][_0x031f('0xfb')](db[_0x031f('0x83')],{'through':_0x031f('0x1a2')});db['FreshdeskField'][_0x031f('0xee')](db[_0x031f('0x1a0')],{'as':'Subject','foreignKey':_0x031f('0x191')});db['FreshdeskField'][_0x031f('0xee')](db[_0x031f('0x1a0')],{'as':_0x031f('0x196'),'foreignKey':_0x031f('0x193')});db[_0x031f('0x1a0')][_0x031f('0xee')](db[_0x031f('0x1a0')],{'as':_0x031f('0x197'),'foreignKey':_0x031f('0x194')});db[_0x031f('0x1a0')][_0x031f('0x128')](db[_0x031f('0x198')],{'as':_0x031f('0x198'),'foreignKey':_0x031f('0x199')});db[_0x031f('0xaf')][_0x031f('0xee')](db[_0x031f('0xb1')],{'as':'Configurations','onDelete':_0x031f('0xed'),'foreignKey':'AccountId'});db[_0x031f('0xb1')]['hasMany'](db[_0x031f('0xb2')],{'as':_0x031f('0x19b'),'foreignKey':_0x031f('0x191')});db[_0x031f('0xb1')][_0x031f('0xee')](db['VtigerField'],{'as':_0x031f('0x19c'),'foreignKey':'DescriptionId'});db['VtigerConfiguration']['hasMany'](db[_0x031f('0xb2')],{'as':_0x031f('0x18e'),'foreignKey':_0x031f('0x194')});db[_0x031f('0xb1')][_0x031f('0x128')](db[_0x031f('0xaf')],{'as':_0x031f('0x150'),'foreignKey':'AccountId'});db[_0x031f('0xb1')][_0x031f('0xfb')](db[_0x031f('0x83')],{'through':_0x031f('0x1a3')});db['VtigerField'][_0x031f('0xee')](db['VtigerField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x031f('0xb2')][_0x031f('0xee')](db['VtigerField'],{'as':_0x031f('0x196'),'foreignKey':_0x031f('0x193')});db['VtigerField'][_0x031f('0xee')](db[_0x031f('0xb2')],{'as':_0x031f('0x197'),'foreignKey':_0x031f('0x194')});db[_0x031f('0xb2')][_0x031f('0x128')](db[_0x031f('0x198')],{'as':_0x031f('0x198'),'foreignKey':_0x031f('0x199')});db[_0x031f('0xb4')]['hasMany'](db[_0x031f('0xb5')],{'as':_0x031f('0x19a'),'onDelete':'cascade','foreignKey':_0x031f('0x190')});db[_0x031f('0xb5')][_0x031f('0xee')](db[_0x031f('0xb7')],{'as':_0x031f('0x19b'),'foreignKey':_0x031f('0x191')});db[_0x031f('0xb5')]['hasMany'](db[_0x031f('0xb7')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x031f('0xb5')][_0x031f('0xee')](db[_0x031f('0xb7')],{'as':'Fields','foreignKey':_0x031f('0x194')});db['ServicenowConfiguration'][_0x031f('0x128')](db[_0x031f('0xb4')],{'as':_0x031f('0x150'),'foreignKey':_0x031f('0x190')});db[_0x031f('0xb7')][_0x031f('0xee')](db['ServicenowField'],{'as':_0x031f('0x195'),'foreignKey':'SubjectId'});db[_0x031f('0xb7')][_0x031f('0xee')](db[_0x031f('0xb7')],{'as':_0x031f('0x196'),'foreignKey':_0x031f('0x193')});db[_0x031f('0xb7')][_0x031f('0xee')](db[_0x031f('0xb7')],{'as':_0x031f('0x197'),'foreignKey':'FieldId'});db['ServicenowField'][_0x031f('0x128')](db[_0x031f('0x198')],{'as':'Variable','foreignKey':_0x031f('0x199')});db[_0x031f('0x1a4')][_0x031f('0xee')](db[_0x031f('0xb8')],{'as':_0x031f('0x19a'),'onDelete':_0x031f('0xed'),'foreignKey':_0x031f('0x190')});db[_0x031f('0xb8')][_0x031f('0xee')](db[_0x031f('0x1a5')],{'as':_0x031f('0x19b'),'onDelete':'cascade','foreignKey':_0x031f('0x191')});db[_0x031f('0xb8')][_0x031f('0xee')](db[_0x031f('0x1a5')],{'as':_0x031f('0x19c'),'onDelete':_0x031f('0xed'),'foreignKey':'DescriptionId'});db[_0x031f('0xb8')][_0x031f('0xee')](db[_0x031f('0x1a5')],{'as':'Fields','onDelete':_0x031f('0xed'),'foreignKey':_0x031f('0x194')});db['Dynamics365Configuration'][_0x031f('0x128')](db['Dynamics365Account'],{'as':_0x031f('0x150'),'foreignKey':_0x031f('0x190')});db[_0x031f('0x1a5')][_0x031f('0xee')](db[_0x031f('0x1a5')],{'as':_0x031f('0x195'),'foreignKey':_0x031f('0x191')});db[_0x031f('0x1a5')][_0x031f('0xee')](db[_0x031f('0x1a5')],{'as':'Description','foreignKey':_0x031f('0x193')});db[_0x031f('0x1a5')][_0x031f('0xee')](db[_0x031f('0x1a5')],{'as':_0x031f('0x197'),'foreignKey':_0x031f('0x194')});db['Dynamics365Field'][_0x031f('0x128')](db['Variable'],{'as':'Variable','foreignKey':_0x031f('0x199')});db['ChatQueueReport'][_0x031f('0x128')](db['ChatWebsite'],{});db['ChatQueueReport'][_0x031f('0x128')](db[_0x031f('0xe4')],{'as':'List','foreignKey':'ListId'});db['ChatQueueReport'][_0x031f('0x128')](db[_0x031f('0x6b')],{'as':'Contact','foreignKey':_0x031f('0x148')});db[_0x031f('0xbc')]['belongsTo'](db[_0x031f('0x61')],{});db[_0x031f('0xbc')][_0x031f('0x128')](db['ChatMessage'],{});db[_0x031f('0xbc')][_0x031f('0x128')](db[_0x031f('0x13')],{});db[_0x031f('0xbc')][_0x031f('0x128')](db['ChatQueue'],{});db['ChatInternalMessage'][_0x031f('0x128')](db[_0x031f('0x13')],{'onDelete':_0x031f('0xed'),'foreignKey':_0x031f('0x1a6')});db[_0x031f('0xbe')]['belongsTo'](db[_0x031f('0x13')],{'onDelete':'cascade','foreignKey':'ToId'});db['JscriptySessionReport']['hasMany'](db[_0x031f('0xc1')],{'foreignKey':'SessionId','onDelete':_0x031f('0xed')});db[_0x031f('0xc3')][_0x031f('0xee')](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':_0x031f('0xed')});db[_0x031f('0xc5')][_0x031f('0x128')](db[_0x031f('0x50')],{});db[_0x031f('0xc5')]['belongsTo'](db[_0x031f('0xe4')],{'as':_0x031f('0x159'),'foreignKey':'ListId'});db[_0x031f('0xc5')][_0x031f('0x128')](db[_0x031f('0x6b')],{'as':_0x031f('0x139'),'foreignKey':_0x031f('0x148')});db[_0x031f('0xc5')][_0x031f('0x128')](db['SmsInteraction'],{});db[_0x031f('0xc5')][_0x031f('0x128')](db[_0x031f('0x54')],{});db['SmsQueueReport'][_0x031f('0x128')](db[_0x031f('0x13')],{});db[_0x031f('0xc5')][_0x031f('0x128')](db[_0x031f('0x56')],{});db['JscriptyProject'][_0x031f('0xee')](db['JscriptySessionReport'],{'foreignKey':'ProjectId'});db[_0x031f('0xcb')][_0x031f('0xee')](db[_0x031f('0xc1')],{'foreignKey':_0x031f('0x1a7')});db[_0x031f('0xcb')]['hasMany'](db[_0x031f('0xbf')],{'foreignKey':_0x031f('0x1a7')});db[_0x031f('0xcf')]['belongsToMany'](db[_0x031f('0x13')],{'as':_0x031f('0x14c'),'through':_0x031f('0x11b')});db[_0x031f('0x12e')][_0x031f('0xfb')](db['User'],{'as':_0x031f('0x12d'),'through':_0x031f('0x100')});db[_0x031f('0x12e')][_0x031f('0xfb')](db[_0x031f('0x108')],{'through':'team_has_voice_queues','as':'VoiceQueues'});db[_0x031f('0x12e')][_0x031f('0xfb')](db[_0x031f('0x3c')],{'through':_0x031f('0x147'),'as':'MailQueues'});db[_0x031f('0x12e')][_0x031f('0xfb')](db[_0x031f('0x66')],{'through':_0x031f('0x172'),'as':_0x031f('0x1a8')});db['Team']['belongsToMany'](db['FaxQueue'],{'through':'team_has_fax_queues','as':_0x031f('0x10b')});db['Team']['belongsToMany'](db['SmsQueue'],{'through':_0x031f('0x164'),'as':_0x031f('0x10c')});db[_0x031f('0x12e')][_0x031f('0xfb')](db[_0x031f('0x5c')],{'through':_0x031f('0x16b'),'as':_0x031f('0x10e')});db[_0x031f('0xd7')]['hasMany'](db[_0x031f('0x6d')],{'as':_0x031f('0x176'),'foreignKey':_0x031f('0x1a9')});db[_0x031f('0xd7')][_0x031f('0xee')](db[_0x031f('0x6f')],{'as':_0x031f('0xf4'),'foreignKey':_0x031f('0x1a9')});db[_0x031f('0xd7')]['hasMany'](db[_0x031f('0x71')],{'as':'HopperHistories','foreignKey':_0x031f('0x1a9')});db['Campaign'][_0x031f('0xee')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0x031f('0x1a9')});db['Campaign']['belongsTo'](db['Trunk'],{'as':_0x031f('0x2a'),'foreignKey':_0x031f('0x1aa')});db[_0x031f('0xd7')][_0x031f('0x128')](db[_0x031f('0x2a')],{'as':_0x031f('0x1ab'),'foreignKey':_0x031f('0x129')});db[_0x031f('0xd7')][_0x031f('0x128')](db[_0x031f('0x7c')],{'as':_0x031f('0x7c'),'foreignKey':_0x031f('0x152')});db[_0x031f('0xd7')][_0x031f('0x128')](db['SquareProject'],{'as':'SquareProject','foreignKey':_0x031f('0x1ac')});db[_0x031f('0xd7')][_0x031f('0xfb')](db[_0x031f('0xe4')],{'as':_0x031f('0xfe'),'through':'campaigns_has_cm_lists'});db[_0x031f('0xd7')][_0x031f('0xfb')](db['CmList'],{'as':'BlackLists','through':_0x031f('0x1ad')});db[_0x031f('0xdc')]['belongsTo'](db[_0x031f('0x41')],{});db['MailTransferReport'][_0x031f('0x128')](db['MailInteraction'],{});db['MailTransferReport']['belongsTo'](db[_0x031f('0x114')],{'foreignKey':_0x031f('0x1ae'),'as':'FromAccount'});db[_0x031f('0xdc')][_0x031f('0x128')](db['User'],{'foreignKey':_0x031f('0x1af'),'as':_0x031f('0x1b0')});db[_0x031f('0xdc')][_0x031f('0x128')](db[_0x031f('0x13')],{'foreignKey':'ToUserId','as':_0x031f('0x1b1')});db['MailTransferReport'][_0x031f('0x128')](db[_0x031f('0x3c')],{'foreignKey':_0x031f('0x1b2'),'as':_0x031f('0x1b3')});db[_0x031f('0xdc')][_0x031f('0x128')](db[_0x031f('0x114')],{'foreignKey':_0x031f('0x1b4'),'as':'ToAccount'});db[_0x031f('0xde')][_0x031f('0x128')](db[_0x031f('0x62')],{});db[_0x031f('0xde')]['belongsTo'](db[_0x031f('0x61')],{});db[_0x031f('0xde')][_0x031f('0x128')](db[_0x031f('0x110')],{'foreignKey':'FromChatWebsiteId','as':_0x031f('0x1b5')});db['ChatTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x031f('0x1af'),'as':_0x031f('0x1b0')});db[_0x031f('0xde')][_0x031f('0x128')](db[_0x031f('0x13')],{'foreignKey':_0x031f('0x1b6'),'as':_0x031f('0x1b1')});db['ChatTransferReport'][_0x031f('0x128')](db[_0x031f('0x66')],{'foreignKey':'ToChatQueueId','as':_0x031f('0x1b3')});db[_0x031f('0xde')][_0x031f('0x128')](db['ChatWebsite'],{'foreignKey':_0x031f('0x1b7'),'as':_0x031f('0x1b8')});db[_0x031f('0xe0')][_0x031f('0x128')](db[_0x031f('0x4a')],{});db[_0x031f('0xe0')][_0x031f('0x128')](db[_0x031f('0xf9')],{});db[_0x031f('0xe0')][_0x031f('0x128')](db['FaxAccount'],{'foreignKey':_0x031f('0x1b9'),'as':_0x031f('0x1b5')});db[_0x031f('0xe0')][_0x031f('0x128')](db['User'],{'foreignKey':_0x031f('0x1af'),'as':_0x031f('0x1b0')});db[_0x031f('0xe0')][_0x031f('0x128')](db[_0x031f('0x13')],{'foreignKey':_0x031f('0x1b6'),'as':_0x031f('0x1b1')});db[_0x031f('0xe0')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x031f('0x1ba'),'as':_0x031f('0x1b3')});db[_0x031f('0xe0')]['belongsTo'](db['FaxAccount'],{'foreignKey':_0x031f('0x1bb'),'as':_0x031f('0x1b8')});db['OpenchannelTransferReport'][_0x031f('0x128')](db[_0x031f('0x166')],{});db[_0x031f('0xe2')]['belongsTo'](db[_0x031f('0x5a')],{});db[_0x031f('0xe2')][_0x031f('0x128')](db[_0x031f('0x58')],{'foreignKey':'FromOpenchannelAccountId','as':_0x031f('0x1b5')});db['OpenchannelTransferReport'][_0x031f('0x128')](db[_0x031f('0x13')],{'foreignKey':_0x031f('0x1af'),'as':'FromAgent'});db[_0x031f('0xe2')][_0x031f('0x128')](db[_0x031f('0x13')],{'foreignKey':_0x031f('0x1b6'),'as':_0x031f('0x1b1')});db[_0x031f('0xe2')][_0x031f('0x128')](db['OpenchannelQueue'],{'foreignKey':_0x031f('0x1bc'),'as':_0x031f('0x1b3')});db[_0x031f('0xe2')][_0x031f('0x128')](db[_0x031f('0x58')],{'foreignKey':_0x031f('0x1bd'),'as':'ToAccount'});db[_0x031f('0x1be')][_0x031f('0x128')](db[_0x031f('0x54')],{});db[_0x031f('0x1be')][_0x031f('0x128')](db[_0x031f('0x52')],{});db[_0x031f('0x1be')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0x031f('0x1bf'),'as':_0x031f('0x1b5')});db[_0x031f('0x1be')][_0x031f('0x128')](db[_0x031f('0x13')],{'foreignKey':_0x031f('0x1af'),'as':_0x031f('0x1b0')});db[_0x031f('0x1be')]['belongsTo'](db[_0x031f('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x031f('0x1be')][_0x031f('0x128')](db[_0x031f('0x56')],{'foreignKey':_0x031f('0x1c0'),'as':'ToQueue'});db[_0x031f('0x1be')][_0x031f('0x128')](db[_0x031f('0x50')],{'foreignKey':_0x031f('0x1c1'),'as':_0x031f('0x1b8')});db[_0x031f('0xe4')][_0x031f('0xee')](db[_0x031f('0x13f')],{'as':_0x031f('0x140'),'foreignKey':_0x031f('0x144')});db[_0x031f('0xe4')]['hasMany'](db[_0x031f('0x73')],{'as':_0x031f('0x1c2'),'foreignKey':'ListId'});db[_0x031f('0xe4')][_0x031f('0xee')](db[_0x031f('0x6b')],{'as':'Contacts','onDelete':_0x031f('0xed'),'foreignKey':_0x031f('0x144')});db[_0x031f('0xe4')][_0x031f('0xee')](db[_0x031f('0x6f')],{'as':_0x031f('0xf4'),'foreignKey':_0x031f('0x144')});db[_0x031f('0xe4')][_0x031f('0xee')](db[_0x031f('0x71')],{'as':'HopperHistory','foreignKey':_0x031f('0x144')});db[_0x031f('0xe4')][_0x031f('0xee')](db[_0x031f('0xf6')],{'as':_0x031f('0xf6'),'foreignKey':_0x031f('0x144')});db[_0x031f('0xe4')][_0x031f('0xfb')](db[_0x031f('0x108')],{'as':_0x031f('0x1c3'),'through':_0x031f('0x1c4')});db[_0x031f('0xe4')]['belongsToMany'](db[_0x031f('0x13')],{'as':_0x031f('0x12d'),'through':_0x031f('0xff')});db[_0x031f('0xe5')][_0x031f('0xee')](db['VoiceExtension'],{'as':_0x031f('0xf3'),'onDelete':_0x031f('0x151')});db['VoicePrefix'][_0x031f('0xfb')](db[_0x031f('0x13')],{'as':_0x031f('0x12d'),'through':_0x031f('0x10f')});db[_0x031f('0xe7')]['hasMany'](db[_0x031f('0x13')],{'as':'Users','foreignKey':_0x031f('0xfa')});db[_0x031f('0xe7')][_0x031f('0xee')](db[_0x031f('0xe9')],{'as':_0x031f('0x1c5'),'foreignKey':_0x031f('0xfa'),'onDelete':_0x031f('0xed')});db[_0x031f('0xe9')][_0x031f('0xee')](db[_0x031f('0xeb')],{'as':_0x031f('0x1c6'),'foreignKey':_0x031f('0x1c7'),'onDelete':_0x031f('0xed')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x7409=['Tags','user_has_sms_interactions','SmsQueueId','team_has_sms_queues','OpenchannelAccount','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelQueue','ChatWebsiteId','ProactiveActions','ChatMessage','Agent','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessage','team_has_chat_queues','CmCompany','Company','CompanyId','cm_user_has_contacts','cm_contact_has_tags','Queue','CampaignId','Condition','OneAll','AutomationAllId','AutomationAnyId','Actions','AutomationId','MailApplications','FaxApplications','SmsApplications','Schedule','DefaultReportId','CustomReportId','Sound','Mohs','moh_has_sounds','sms_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticFieldReport','Fields','MetricId','SalesforceConfiguration','Configurations','AccountId','Subjects','SubjectId','Descriptions','Subject','Description','DescriptionId','FieldId','VariableId','Field','int_desk_configuration_has_tags','ZohoAccount','ZohoConfiguration','ZohoField','ZendeskAccount','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','Dynamics365Configuration','Dynamics365Field','FromId','SessionId','ProjectId','team_has_voice_queues','SmsQueues','team_has_openchannel_queues','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','ToUserId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','CustomFields','UserProfileSections','UserProfileResource','Resources','sectionId','exports','path','../config/environment','lodash','jstz','determine','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','mysql','utf8mb4','name','utf8_general_ci','sequelizeHistory','127.0.0.1','utf8','username','password','options','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.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','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','../api/condition/condition.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','hasOne','UserId','hasMany','Recordings','VoiceQueuesRt','Extensions','cascade','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteractions','MailInteractions','belongsTo','userProfileId','belongsToMany','ChatGroup','Groups','chat_group_has_users','Contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_openchannel_interactions','VoiceQueues','MailQueues','UserMailQueue','ChatQueues','FaxQueues','SmsQueue','OpenchannelQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','ChanSpyId','Applications','Sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','Interval','IntervalId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Team','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','AgentReports','Contact','ContactId','MailAccountId','Imap','Smtp','Disposition','CannedAnswer','Answers','MailMessage','List','ListId','TemplateId','user_has_mail_accounts','team_has_mail_queues','Account','mail_interaction_has_tags','ThroughTags','Attachments','MailInteractionId','restrict','TagId','Dispositions','Exntensions','user_has_fax_accounts','FaxInteractionId','FaxAccountId','Owner','fax_interaction_has_tags','Users','user_has_fax_interactions','Interaction','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','Interactions','SmsInteractionId'];(function(_0x113ab4,_0x3917ec){var _0x366c5d=function(_0x4ebbfe){while(--_0x4ebbfe){_0x113ab4['push'](_0x113ab4['shift']());}};_0x366c5d(++_0x3917ec);}(_0x7409,0x6e));var _0x9740=function(_0x42ec8f,_0x43ac68){_0x42ec8f=_0x42ec8f-0x0;var _0x3475e5=_0x7409[_0x42ec8f];return _0x3475e5;};'use strict';var path=require(_0x9740('0x0'));var config=require(_0x9740('0x1'));var Sequelize=require('sequelize');var _=require(_0x9740('0x2'));var jstz=require(_0x9740('0x3'));var timezone=jstz[_0x9740('0x4')]();config[_0x9740('0x5')]=_[_0x9740('0x6')](config[_0x9740('0x5')],{'database':_0x9740('0x7'),'username':_0x9740('0x8'),'password':_0x9740('0x9'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x9740('0xa'),'dialectOptions':{'charset':_0x9740('0xb')},'logging':![],'timezone':timezone[_0x9740('0xc')](),'define':{'charset':'utf8','collate':_0x9740('0xd')}}});config[_0x9740('0xe')]=_[_0x9740('0x6')](config['sequelizeHistory'],{'database':_0x9740('0x7'),'username':'xcall','password':_0x9740('0x9'),'options':{'host':_0x9740('0xf'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x9740('0x10'),'collate':_0x9740('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9740('0x5')]['database'],config['sequelize']['username'],config['sequelize']['password'],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9740('0xe')]['database'],config['sequelizeHistory'][_0x9740('0x11')],config['sequelizeHistory'][_0x9740('0x12')],config[_0x9740('0xe')][_0x9740('0x13')])};db[_0x9740('0x14')]=db['sequelize'][_0x9740('0x15')]('../api/user/user.model');db[_0x9740('0x16')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x17'));db[_0x9740('0x18')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x19'));db[_0x9740('0x1a')]=db['sequelize'][_0x9740('0x15')](_0x9740('0x1b'));db[_0x9740('0x1c')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x1d'));db[_0x9740('0x1e')]=db[_0x9740('0x5')]['import'](_0x9740('0x1f'));db['VoiceRecording']=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x20'));db[_0x9740('0x21')]=db[_0x9740('0x5')][_0x9740('0x15')]('../api/screenRecording/screenRecording.model');db[_0x9740('0x22')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x23'));db[_0x9740('0x24')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x25'));db[_0x9740('0x26')]=db['sequelize'][_0x9740('0x15')]('../api/voiceCallReport/voiceCallReport.model');db['VoiceDialReport']=db['sequelize']['import'](_0x9740('0x27'));db[_0x9740('0x28')]=db[_0x9740('0x5')]['import'](_0x9740('0x29'));db[_0x9740('0x2a')]=db[_0x9740('0x5')][_0x9740('0x15')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x9740('0x2b')]=db[_0x9740('0x5')][_0x9740('0x15')]('../api/memberReport/memberReport.model');db[_0x9740('0x2c')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x2d'));db[_0x9740('0x2e')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x2f'));db[_0x9740('0x30')]=db[_0x9740('0x5')]['import'](_0x9740('0x31'));db[_0x9740('0x32')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x33'));db[_0x9740('0x34')]=db['sequelize'][_0x9740('0x15')]('../api/userChatQueue/userChatQueue.model');db['UserMailQueue']=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x35'));db[_0x9740('0x36')]=db[_0x9740('0x5')]['import'](_0x9740('0x37'));db[_0x9740('0x38')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x39'));db[_0x9740('0x3a')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x3b'));db[_0x9740('0x3c')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x3d'));db[_0x9740('0x3e')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x3f'));db[_0x9740('0x40')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x41'));db[_0x9740('0x42')]=db['sequelize'][_0x9740('0x15')]('../api/mailQueue/mailQueue.model');db[_0x9740('0x43')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x44'));db[_0x9740('0x45')]=db[_0x9740('0x5')][_0x9740('0x15')]('../api/mailInteraction/mailInteraction.model');db['MailMessage']=db['sequelize'][_0x9740('0x15')](_0x9740('0x46'));db[_0x9740('0x47')]=db[_0x9740('0x5')][_0x9740('0x15')]('../api/mailApplication/mailApplication.model');db[_0x9740('0x48')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x49'));db[_0x9740('0x4a')]=db[_0x9740('0x5')]['import'](_0x9740('0x4b'));db[_0x9740('0x4c')]=db[_0x9740('0x5')]['import']('../api/dashboardItem/dashboardItem.model');db[_0x9740('0x4d')]=db[_0x9740('0x5')][_0x9740('0x15')]('../api/faxAccount/faxAccount.model');db[_0x9740('0x4e')]=db[_0x9740('0x5')][_0x9740('0x15')]('../api/faxApplication/faxApplication.model');db[_0x9740('0x4f')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x50'));db[_0x9740('0x51')]=db['sequelize'][_0x9740('0x15')](_0x9740('0x52'));db[_0x9740('0x53')]=db['sequelize'][_0x9740('0x15')](_0x9740('0x54'));db['FaxQueueReport']=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x55'));db[_0x9740('0x56')]=db['sequelize'][_0x9740('0x15')](_0x9740('0x57'));db[_0x9740('0x58')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x59'));db['SmsInteraction']=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x5a'));db[_0x9740('0x5b')]=db['sequelize'][_0x9740('0x15')](_0x9740('0x5c'));db['SmsQueue']=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x5d'));db['OpenchannelAccount']=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x5e'));db[_0x9740('0x5f')]=db[_0x9740('0x5')][_0x9740('0x15')]('../api/openchannelApplication/openchannelApplication.model');db[_0x9740('0x60')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x61'));db['OpenchannelMessage']=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x62'));db['OpenchannelQueue']=db['sequelize'][_0x9740('0x15')](_0x9740('0x63'));db[_0x9740('0x64')]=db['sequelize'][_0x9740('0x15')]('../api/chatWebsite/chatWebsite.model');db[_0x9740('0x65')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x66'));db[_0x9740('0x67')]=db[_0x9740('0x5')]['import'](_0x9740('0x68'));db[_0x9740('0x69')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x6a'));db['ChatMessage']=db[_0x9740('0x5')]['import']('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x6b'));db[_0x9740('0x6c')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x6d'));db['ChatGroup']=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x6e'));db[_0x9740('0x6f')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x70'));db['CmCompany']=db[_0x9740('0x5')][_0x9740('0x15')]('../api/cmCompany/cmCompany.model');db[_0x9740('0x71')]=db['sequelize'][_0x9740('0x15')](_0x9740('0x72'));db[_0x9740('0x73')]=db[_0x9740('0x5')][_0x9740('0x15')]('../api/cmHopper/cmHopper.model');db[_0x9740('0x74')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x75'));db[_0x9740('0x76')]=db[_0x9740('0x5')]['import'](_0x9740('0x77'));db[_0x9740('0x78')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x79'));db[_0x9740('0x7a')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x7b'));db[_0x9740('0x7c')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x7d'));db[_0x9740('0x7e')]=db['sequelize']['import'](_0x9740('0x7f'));db[_0x9740('0x80')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x81'));db['CannedAnswer']=db['sequelize'][_0x9740('0x15')](_0x9740('0x82'));db['Disposition']=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x83'));db['Condition']=db[_0x9740('0x5')]['import'](_0x9740('0x84'));db['Interval']=db[_0x9740('0x5')]['import']('../api/interval/interval.model');db['Pause']=db[_0x9740('0x5')][_0x9740('0x15')]('../api/pause/pause.model');db[_0x9740('0x85')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x86'));db[_0x9740('0x87')]=db['sequelize'][_0x9740('0x15')](_0x9740('0x88'));db['Schedule']=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x89'));db['Sound']=db[_0x9740('0x5')]['import'](_0x9740('0x8a'));db[_0x9740('0x8b')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x8c'));db[_0x9740('0x8d')]=db[_0x9740('0x5')]['import'](_0x9740('0x8e'));db[_0x9740('0x8f')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x90'));db[_0x9740('0x91')]=db[_0x9740('0x5')]['import'](_0x9740('0x92'));db[_0x9740('0x93')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x94'));db[_0x9740('0x95')]=db[_0x9740('0x5')][_0x9740('0x15')]('../api/integrationReport/integrationReport.model');db[_0x9740('0x96')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x97'));db[_0x9740('0x98')]=db[_0x9740('0x5')]['import'](_0x9740('0x99'));db[_0x9740('0x9a')]=db[_0x9740('0x5')]['import'](_0x9740('0x9b'));db[_0x9740('0x9c')]=db[_0x9740('0x5')][_0x9740('0x15')]('../api/analyticMetric/analyticMetric.model');db['AnalyticFieldReport']=db['sequelize'][_0x9740('0x15')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x9740('0x9d')]=db['sequelize']['import'](_0x9740('0x9e'));db[_0x9740('0x9f')]=db['sequelize'][_0x9740('0x15')](_0x9740('0xa0'));db['SalesforceConfiguration']=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0xa1'));db[_0x9740('0xa2')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0xa3'));db[_0x9740('0xa4')]=db[_0x9740('0x5')]['import'](_0x9740('0xa5'));db[_0x9740('0xa6')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0xa7'));db[_0x9740('0xa8')]=db['sequelize'][_0x9740('0x15')](_0x9740('0xa9'));db[_0x9740('0xaa')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0xab'));db[_0x9740('0xac')]=db['sequelize'][_0x9740('0x15')](_0x9740('0xad'));db[_0x9740('0xae')]=db['sequelize'][_0x9740('0x15')](_0x9740('0xaf'));db['ZohoAccount']=db[_0x9740('0x5')]['import']('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0xb0'));db['ZohoField']=db[_0x9740('0x5')]['import'](_0x9740('0xb1'));db['ZendeskAccount']=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0xb2'));db[_0x9740('0xb3')]=db[_0x9740('0x5')]['import'](_0x9740('0xb4'));db[_0x9740('0xb5')]=db['sequelize']['import'](_0x9740('0xb6'));db[_0x9740('0xb7')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0xb8'));db[_0x9740('0xb9')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0xba'));db[_0x9740('0xbb')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0xbc'));db[_0x9740('0xbd')]=db['sequelize']['import'](_0x9740('0xbe'));db[_0x9740('0xbf')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0xc0'));db[_0x9740('0xc1')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0xc2'));db[_0x9740('0xc3')]=db['sequelize'][_0x9740('0x15')](_0x9740('0xc4'));db[_0x9740('0xc5')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0xc6'));db[_0x9740('0xc7')]=db['sequelize'][_0x9740('0x15')](_0x9740('0xc8'));db[_0x9740('0xc9')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0xca'));db['Dynamics365Configuration']=db['sequelize'][_0x9740('0x15')](_0x9740('0xcb'));db['Dynamics365Field']=db[_0x9740('0x5')]['import'](_0x9740('0xcc'));db[_0x9740('0x93')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0x94'));db['Network']=db[_0x9740('0x5')]['import'](_0x9740('0xcd'));db[_0x9740('0xce')]=db[_0x9740('0x5')]['import'](_0x9740('0xcf'));db[_0x9740('0xd0')]=db['sequelize'][_0x9740('0x15')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x9740('0xd1')]=db[_0x9740('0x5')]['import']('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x9740('0xd2')]=db[_0x9740('0x5')]['import'](_0x9740('0xd3'));db[_0x9740('0xd4')]=db[_0x9740('0x5')][_0x9740('0x15')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x9740('0xd5')]=db['sequelize']['import'](_0x9740('0xd6'));db[_0x9740('0xd7')]=db[_0x9740('0x5')]['import']('../api/squareReport/squareReport.model');db[_0x9740('0xd8')]=db['sequelize'][_0x9740('0x15')](_0x9740('0xd9'));db[_0x9740('0xda')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0xdb'));db[_0x9740('0xdc')]=db['sequelize'][_0x9740('0x15')](_0x9740('0xdd'));db[_0x9740('0xde')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0xdf'));db[_0x9740('0xe0')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0xe1'));db[_0x9740('0xe2')]=db[_0x9740('0x5')][_0x9740('0x15')]('../api/squareRecording/squareRecording.model');db['SquareMessage']=db['sequelize']['import']('../api/squareMessage/squareMessage.model');db['Team']=db[_0x9740('0x5')]['import'](_0x9740('0xe3'));db[_0x9740('0xe4')]=db['sequelize'][_0x9740('0x15')]('../api/license/license.model');db[_0x9740('0xe5')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0xe6'));db[_0x9740('0xe7')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0xe8'));db[_0x9740('0xe9')]=db[_0x9740('0x5')][_0x9740('0x15')]('../api/attachment/attachment.model');db[_0x9740('0xea')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0xeb'));db[_0x9740('0xec')]=db['sequelize'][_0x9740('0x15')]('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db['sequelize'][_0x9740('0x15')](_0x9740('0xed'));db['FaxTransferReport']=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0xee'));db[_0x9740('0xef')]=db['sequelize'][_0x9740('0x15')](_0x9740('0xf0'));db['SmsTransferReport']=db['sequelize'][_0x9740('0x15')]('../api/smsTransferReport/smsTransferReport.model');db[_0x9740('0xf1')]=db[_0x9740('0x5')]['import'](_0x9740('0xf2'));db[_0x9740('0xf3')]=db[_0x9740('0x5')][_0x9740('0x15')]('../api/voicePrefix/voicePrefix.model');db[_0x9740('0xf4')]=db[_0x9740('0x5')]['import'](_0x9740('0xf5'));db[_0x9740('0xf6')]=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0xf7'));db['UserProfileResource']=db[_0x9740('0x5')][_0x9740('0x15')](_0x9740('0xf8'));db[_0x9740('0x14')][_0x9740('0xf9')](db[_0x9740('0x22')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':_0x9740('0xfa')});db['User'][_0x9740('0xfb')](db['VoiceRecording'],{'as':_0x9740('0xfc'),'foreignKey':_0x9740('0xfa')});db[_0x9740('0x14')][_0x9740('0xfb')](db[_0x9740('0x30')],{'as':_0x9740('0xfd'),'foreignKey':_0x9740('0xfa')});db[_0x9740('0x14')][_0x9740('0xfb')](db[_0x9740('0x1a')],{'as':_0x9740('0xfe'),'onDelete':_0x9740('0xff'),'hooks':!![]});db[_0x9740('0x14')][_0x9740('0xfb')](db[_0x9740('0x76')],{'as':_0x9740('0x100'),'foreignKey':'UserId'});db[_0x9740('0x14')][_0x9740('0xfb')](db[_0x9740('0x78')],{'as':_0x9740('0x101'),'foreignKey':_0x9740('0xfa')});db[_0x9740('0x14')]['hasMany'](db[_0x9740('0x7a')],{'as':_0x9740('0x7a'),'foreignKey':_0x9740('0xfa')});db[_0x9740('0x14')][_0x9740('0xfb')](db[_0x9740('0x60')],{'as':_0x9740('0x102'),'foreignKey':_0x9740('0xfa')});db[_0x9740('0x14')][_0x9740('0xfb')](db[_0x9740('0x69')],{'as':_0x9740('0x103'),'foreignKey':_0x9740('0xfa')});db[_0x9740('0x14')]['hasMany'](db[_0x9740('0x104')],{'as':_0x9740('0x105'),'foreignKey':_0x9740('0xfa')});db['User'][_0x9740('0xfb')](db[_0x9740('0x4f')],{'as':_0x9740('0x106'),'foreignKey':_0x9740('0xfa')});db[_0x9740('0x14')][_0x9740('0xfb')](db[_0x9740('0x45')],{'as':_0x9740('0x107'),'foreignKey':'UserId'});db[_0x9740('0x14')][_0x9740('0x108')](db[_0x9740('0xf4')],{'as':_0x9740('0xf4'),'foreignKey':_0x9740('0x109')});db['User'][_0x9740('0x10a')](db[_0x9740('0x10b')],{'as':_0x9740('0x10c'),'through':_0x9740('0x10d')});db[_0x9740('0x14')][_0x9740('0x10a')](db[_0x9740('0x71')],{'as':_0x9740('0x10e'),'through':'cm_user_has_contacts'});db[_0x9740('0x14')][_0x9740('0x10a')](db[_0x9740('0xf1')],{'as':_0x9740('0x10f'),'through':_0x9740('0x110')});db[_0x9740('0x14')][_0x9740('0x10a')](db['Team'],{'through':_0x9740('0x111')});db[_0x9740('0x14')]['belongsToMany'](db[_0x9740('0x45')],{'as':_0x9740('0x107'),'through':_0x9740('0x112')});db[_0x9740('0x14')][_0x9740('0x10a')](db[_0x9740('0x69')],{'as':_0x9740('0x103'),'through':_0x9740('0x113')});db[_0x9740('0x14')][_0x9740('0x10a')](db['FaxInteraction'],{'as':_0x9740('0x106'),'through':'user_has_fax_interactions'});db[_0x9740('0x14')]['belongsToMany'](db[_0x9740('0x104')],{'as':_0x9740('0x105'),'through':'user_has_sms_interactions'});db[_0x9740('0x14')][_0x9740('0x10a')](db['OpenchannelInteraction'],{'as':_0x9740('0x102'),'through':_0x9740('0x114')});db['User'][_0x9740('0x10a')](db[_0x9740('0x1e')],{'as':_0x9740('0x115'),'through':_0x9740('0x32'),'required':![]});db[_0x9740('0x14')][_0x9740('0x10a')](db[_0x9740('0x42')],{'as':_0x9740('0x116'),'through':_0x9740('0x117'),'required':![]});db[_0x9740('0x14')][_0x9740('0x10a')](db['ChatQueue'],{'as':_0x9740('0x118'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x9740('0x14')]['belongsToMany'](db[_0x9740('0x53')],{'as':_0x9740('0x119'),'through':_0x9740('0x36'),'required':![]});db[_0x9740('0x14')][_0x9740('0x10a')](db[_0x9740('0x11a')],{'as':'SmsQueues','through':'UserSmsQueue','required':![]});db[_0x9740('0x14')]['belongsToMany'](db['OpenchannelQueue'],{'as':_0x9740('0x11b'),'through':_0x9740('0x3a'),'required':![]});db['User'][_0x9740('0x10a')](db[_0x9740('0xf1')],{'through':_0x9740('0x110')});db[_0x9740('0x14')][_0x9740('0x10a')](db[_0x9740('0xf3')],{'as':_0x9740('0x11c'),'through':_0x9740('0x11d'),'required':![]});db[_0x9740('0x14')][_0x9740('0x10a')](db['ChatWebsite'],{'as':_0x9740('0x11e'),'through':_0x9740('0x11f')});db[_0x9740('0x14')][_0x9740('0x10a')](db[_0x9740('0x4d')],{'as':_0x9740('0x120'),'through':'user_has_fax_accounts'});db[_0x9740('0x14')][_0x9740('0x10a')](db[_0x9740('0x40')],{'as':'MailAccounts','through':'user_has_mail_accounts'});db[_0x9740('0x14')][_0x9740('0x10a')](db['OpenchannelAccount'],{'as':_0x9740('0x121'),'through':_0x9740('0x122')});db[_0x9740('0x14')][_0x9740('0x10a')](db['SmsAccount'],{'as':_0x9740('0x123'),'through':_0x9740('0x124')});db[_0x9740('0x14')][_0x9740('0x10a')](db['SquareProject'],{'as':_0x9740('0x125'),'through':_0x9740('0x126')});db[_0x9740('0x16')]['hasMany'](db[_0x9740('0x1a')],{'as':'SpiedAgents','onDelete':_0x9740('0xff'),'foreignKey':_0x9740('0x127')});db['VoiceContext'][_0x9740('0xfb')](db['VoiceExtension'],{'onDelete':'cascade'});db['VoiceExtension'][_0x9740('0xfb')](db[_0x9740('0x1a')],{'as':_0x9740('0x128'),'onDelete':_0x9740('0xff')});db['VoiceMusicOnHold'][_0x9740('0x10a')](db['Sound'],{'as':_0x9740('0x129'),'through':'moh_has_sounds'});db[_0x9740('0x1e')][_0x9740('0xfb')](db[_0x9740('0x30')],{'as':_0x9740('0x12a'),'foreignKey':_0x9740('0x12b')});db[_0x9740('0x1e')][_0x9740('0xfb')](db[_0x9740('0x73')],{'as':_0x9740('0x12c'),'foreignKey':_0x9740('0x12b')});db[_0x9740('0x1e')][_0x9740('0xfb')](db[_0x9740('0x76')],{'as':_0x9740('0x100'),'foreignKey':'VoiceQueueId'});db[_0x9740('0x1e')]['hasMany'](db[_0x9740('0x78')],{'as':_0x9740('0x12d'),'foreignKey':_0x9740('0x12b')});db['VoiceQueue'][_0x9740('0xfb')](db[_0x9740('0x7a')],{'as':_0x9740('0x7a'),'foreignKey':_0x9740('0x12b')});db['VoiceQueue'][_0x9740('0xfb')](db['CmHopperBlack'],{'as':_0x9740('0x12e'),'foreignKey':_0x9740('0x12b')});db[_0x9740('0x1e')][_0x9740('0xfb')](db[_0x9740('0xd4')],{'as':_0x9740('0x12f'),'foreignKey':_0x9740('0x12b')});db[_0x9740('0x1e')][_0x9740('0x108')](db[_0x9740('0x2c')],{'as':_0x9740('0x2c'),'foreignKey':_0x9740('0x130')});db['VoiceQueue'][_0x9740('0x108')](db[_0x9740('0x2c')],{'as':_0x9740('0x131'),'foreignKey':_0x9740('0x132')});db[_0x9740('0x1e')][_0x9740('0x108')](db[_0x9740('0x133')],{'as':_0x9740('0x133'),'foreignKey':_0x9740('0x134')});db[_0x9740('0x1e')][_0x9740('0x108')](db[_0x9740('0x135')],{'as':_0x9740('0x136'),'foreignKey':_0x9740('0x137')});db[_0x9740('0x1e')][_0x9740('0x10a')](db[_0x9740('0xf1')],{'as':_0x9740('0x10f'),'through':_0x9740('0x138')});db['VoiceQueue'][_0x9740('0x10a')](db[_0x9740('0x14')],{'as':_0x9740('0x139'),'through':'UserVoiceQueue'});db[_0x9740('0x1e')][_0x9740('0x10a')](db[_0x9740('0x13a')],{'as':_0x9740('0x13b'),'through':'team_has_voice_queues'});db[_0x9740('0x1e')]['belongsToMany'](db[_0x9740('0xf1')],{'as':_0x9740('0x13c'),'through':_0x9740('0x13d')});db['VoiceRecording'][_0x9740('0x108')](db['User'],{'as':_0x9740('0x14'),'foreignKey':_0x9740('0xfa')});db[_0x9740('0x21')][_0x9740('0x108')](db[_0x9740('0x14')],{'as':_0x9740('0x14'),'foreignKey':_0x9740('0xfa')});db[_0x9740('0x22')][_0x9740('0xfb')](db[_0x9740('0x24')],{'as':_0x9740('0x13e'),'onDelete':_0x9740('0xff'),'foreignKey':_0x9740('0x13f'),'sourceKey':'mailbox'});db['VoiceMailMessage'][_0x9740('0x108')](db[_0x9740('0x22')],{'foreignKey':_0x9740('0x13f'),'targetKey':_0x9740('0x140')});db[_0x9740('0x26')]['hasMany'](db[_0x9740('0x2a')],{'as':_0x9740('0x141'),'foreignKey':'uniqueid','constraints':![]});db[_0x9740('0x26')][_0x9740('0xfb')](db[_0x9740('0x28')],{'as':_0x9740('0x142'),'foreignKey':'uniqueid','constraints':![]});db[_0x9740('0x26')][_0x9740('0x108')](db[_0x9740('0x14')],{'as':_0x9740('0x14'),'foreignKey':_0x9740('0xfa')});db['VoiceCallReport'][_0x9740('0x108')](db[_0x9740('0x71')],{'as':_0x9740('0x143'),'foreignKey':_0x9740('0x144')});db[_0x9740('0x3c')][_0x9740('0x108')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x9740('0x145')});db[_0x9740('0x3e')][_0x9740('0x108')](db[_0x9740('0x40')],{'as':_0x9740('0x40'),'foreignKey':_0x9740('0x145')});db[_0x9740('0x40')]['hasOne'](db['MailServerIn'],{'as':_0x9740('0x146'),'onDelete':_0x9740('0xff')});db[_0x9740('0x40')][_0x9740('0xf9')](db[_0x9740('0x3e')],{'as':_0x9740('0x147'),'onDelete':_0x9740('0xff')});db[_0x9740('0x40')][_0x9740('0xfb')](db[_0x9740('0x148')],{'as':'Dispositions','foreignKey':_0x9740('0x145')});db[_0x9740('0x40')][_0x9740('0xfb')](db[_0x9740('0x149')],{'as':_0x9740('0x14a'),'foreignKey':'MailAccountId'});db[_0x9740('0x40')][_0x9740('0xfb')](db[_0x9740('0x14b')],{'as':'Messages','foreignKey':_0x9740('0x145')});db[_0x9740('0x40')][_0x9740('0xfb')](db[_0x9740('0x45')],{'as':'Interactions'});db[_0x9740('0x40')][_0x9740('0xfb')](db[_0x9740('0x47')],{'as':_0x9740('0x128')});db['MailAccount'][_0x9740('0x108')](db['CmList'],{'as':_0x9740('0x14c'),'foreignKey':_0x9740('0x14d')});db[_0x9740('0x40')][_0x9740('0x108')](db['Template'],{'as':_0x9740('0x8d'),'foreignKey':_0x9740('0x14e')});db['MailAccount']['belongsTo'](db[_0x9740('0x135')],{'as':_0x9740('0x136'),'foreignKey':_0x9740('0x137')});db[_0x9740('0x40')]['belongsToMany'](db['User'],{'as':_0x9740('0x139'),'through':_0x9740('0x14f')});db[_0x9740('0x42')]['belongsToMany'](db[_0x9740('0x14')],{'as':'Agents','through':'UserMailQueue'});db[_0x9740('0x42')][_0x9740('0x10a')](db['Team'],{'through':_0x9740('0x150'),'as':'Teams'});db[_0x9740('0x45')][_0x9740('0xfb')](db['MailMessage'],{'as':_0x9740('0x13e'),'onDelete':_0x9740('0xff'),'foreignKey':'MailInteractionId'});db[_0x9740('0x45')]['belongsTo'](db['MailAccount'],{'as':_0x9740('0x151'),'foreignKey':'MailAccountId'});db['MailInteraction'][_0x9740('0x108')](db[_0x9740('0x71')],{'as':_0x9740('0x143'),'foreignKey':_0x9740('0x144')});db[_0x9740('0x45')][_0x9740('0x108')](db[_0x9740('0x14')],{'as':'Owner','foreignKey':'UserId'});db[_0x9740('0x45')][_0x9740('0x10a')](db[_0x9740('0x8b')],{'through':_0x9740('0x152'),'as':'Tags'});db[_0x9740('0x45')][_0x9740('0x10a')](db[_0x9740('0x8b')],{'through':_0x9740('0x152'),'as':_0x9740('0x153')});db[_0x9740('0x45')][_0x9740('0x10a')](db[_0x9740('0x14')],{'as':'Users','through':_0x9740('0x112'),'foreignKey':'MailInteractionId'});db[_0x9740('0x14b')]['hasMany'](db[_0x9740('0xe9')],{'as':_0x9740('0x154'),'onDelete':_0x9740('0xff')});db[_0x9740('0x14b')][_0x9740('0x108')](db[_0x9740('0x14')],{'as':'User'});db['MailMessage'][_0x9740('0x108')](db[_0x9740('0x71')],{'onDelete':'cascade','as':_0x9740('0x143')});db['MailMessage'][_0x9740('0x108')](db[_0x9740('0x45')],{'as':'Interaction','foreignKey':_0x9740('0x155')});db[_0x9740('0x14b')][_0x9740('0x108')](db['MailAccount'],{'as':_0x9740('0x151'),'foreignKey':_0x9740('0x145')});db['MailApplication'][_0x9740('0x108')](db[_0x9740('0x14')],{'onDelete':_0x9740('0x156')});db[_0x9740('0x47')][_0x9740('0x108')](db[_0x9740('0x42')],{'onDelete':'restrict'});db['MailApplication']['belongsTo'](db[_0x9740('0x40')],{'onDelete':_0x9740('0x156')});db['MailApplication'][_0x9740('0x108')](db['Interval'],{'onDelete':_0x9740('0x156'),'foreignKey':_0x9740('0x134')});db['MailApplication'][_0x9740('0x108')](db[_0x9740('0x8b')],{'onDelete':_0x9740('0x156'),'foreignKey':_0x9740('0x157')});db[_0x9740('0x48')][_0x9740('0x108')](db['MailAccount'],{});db[_0x9740('0x48')]['belongsTo'](db[_0x9740('0xf1')],{'as':_0x9740('0x14c'),'foreignKey':'ListId'});db['MailQueueReport'][_0x9740('0x108')](db[_0x9740('0x71')],{'as':_0x9740('0x143'),'foreignKey':_0x9740('0x144')});db[_0x9740('0x48')]['belongsTo'](db[_0x9740('0x45')],{});db['MailQueueReport'][_0x9740('0x108')](db[_0x9740('0x14b')],{});db[_0x9740('0x48')][_0x9740('0x108')](db[_0x9740('0x14')],{});db[_0x9740('0x48')]['belongsTo'](db[_0x9740('0x42')],{});db[_0x9740('0x4a')][_0x9740('0xfb')](db[_0x9740('0x4c')],{'as':'Items','onDelete':_0x9740('0xff')});db[_0x9740('0x4d')][_0x9740('0xfb')](db[_0x9740('0x148')],{'as':_0x9740('0x158'),'foreignKey':'FaxAccountId'});db[_0x9740('0x4d')][_0x9740('0xfb')](db[_0x9740('0x149')],{'as':_0x9740('0x14a'),'foreignKey':'FaxAccountId'});db[_0x9740('0x4d')]['hasMany'](db[_0x9740('0x4f')],{'as':'Interactions'});db[_0x9740('0x4d')]['hasMany'](db[_0x9740('0x4e')],{'as':_0x9740('0x128')});db[_0x9740('0x4d')][_0x9740('0xfb')](db[_0x9740('0x1a')],{'as':_0x9740('0x159'),'onDelete':_0x9740('0xff')});db[_0x9740('0x4d')][_0x9740('0xfb')](db[_0x9740('0x51')],{'as':_0x9740('0x13e')});db[_0x9740('0x4d')][_0x9740('0x108')](db[_0x9740('0x2c')],{'as':_0x9740('0x2c')});db['FaxAccount'][_0x9740('0x108')](db['CmList'],{'as':'List','foreignKey':_0x9740('0x14d')});db[_0x9740('0x4d')][_0x9740('0x108')](db[_0x9740('0x135')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['FaxAccount'][_0x9740('0x10a')](db[_0x9740('0x14')],{'as':'Agents','through':_0x9740('0x15a')});db[_0x9740('0x4e')]['belongsTo'](db[_0x9740('0x14')],{'onDelete':'restrict'});db[_0x9740('0x4e')][_0x9740('0x108')](db[_0x9740('0x53')],{'onDelete':'restrict'});db[_0x9740('0x4e')][_0x9740('0x108')](db[_0x9740('0x4d')],{'onDelete':_0x9740('0x156')});db['FaxApplication'][_0x9740('0x108')](db['Tag'],{'onDelete':_0x9740('0x156'),'foreignKey':_0x9740('0x157')});db[_0x9740('0x4f')][_0x9740('0xfb')](db['FaxMessage'],{'as':'Messages','onDelete':_0x9740('0xff'),'foreignKey':_0x9740('0x15b')});db[_0x9740('0x4f')][_0x9740('0x108')](db['FaxAccount'],{'as':'Account','foreignKey':_0x9740('0x15c')});db['FaxInteraction'][_0x9740('0x108')](db[_0x9740('0x71')],{'as':_0x9740('0x143'),'foreignKey':_0x9740('0x144')});db[_0x9740('0x4f')][_0x9740('0x108')](db[_0x9740('0x14')],{'as':_0x9740('0x15d'),'foreignKey':_0x9740('0xfa')});db[_0x9740('0x4f')]['belongsToMany'](db['Tag'],{'through':_0x9740('0x15e'),'as':'Tags'});db[_0x9740('0x4f')][_0x9740('0x10a')](db[_0x9740('0x8b')],{'through':'fax_interaction_has_tags','as':_0x9740('0x153')});db[_0x9740('0x4f')][_0x9740('0x10a')](db[_0x9740('0x14')],{'as':_0x9740('0x15f'),'through':_0x9740('0x160'),'foreignKey':'FaxInteractionId'});db[_0x9740('0x51')][_0x9740('0x108')](db[_0x9740('0x14')],{'onDelete':_0x9740('0xff'),'as':_0x9740('0x14')});db[_0x9740('0x51')][_0x9740('0x108')](db['FaxInteraction'],{'as':_0x9740('0x161'),'foreignKey':_0x9740('0x15b')});db[_0x9740('0x51')][_0x9740('0x108')](db[_0x9740('0x71')],{'onDelete':_0x9740('0xff'),'as':'Contact'});db[_0x9740('0x51')][_0x9740('0x108')](db[_0x9740('0xe9')],{'as':_0x9740('0xe9'),'foreignKey':_0x9740('0x162')});db[_0x9740('0x51')]['belongsTo'](db[_0x9740('0x4d')],{'as':_0x9740('0x151'),'foreignKey':_0x9740('0x15c')});db[_0x9740('0x53')][_0x9740('0x10a')](db[_0x9740('0x14')],{'as':'Agents','through':_0x9740('0x36')});db['FaxQueue'][_0x9740('0x10a')](db['Team'],{'through':_0x9740('0x163'),'as':'Teams'});db[_0x9740('0x164')]['belongsTo'](db['FaxAccount'],{});db[_0x9740('0x164')][_0x9740('0x108')](db[_0x9740('0xf1')],{'as':_0x9740('0x14c'),'foreignKey':_0x9740('0x14d')});db[_0x9740('0x164')]['belongsTo'](db[_0x9740('0x71')],{'as':'Contact','foreignKey':'ContactId'});db[_0x9740('0x164')][_0x9740('0x108')](db['FaxInteraction'],{});db['FaxQueueReport'][_0x9740('0x108')](db['FaxMessage'],{});db[_0x9740('0x164')][_0x9740('0x108')](db['User'],{});db['FaxQueueReport'][_0x9740('0x108')](db[_0x9740('0x53')],{});db[_0x9740('0x56')][_0x9740('0xfb')](db[_0x9740('0x148')],{'as':'Dispositions','foreignKey':_0x9740('0x165')});db[_0x9740('0x56')][_0x9740('0xfb')](db[_0x9740('0x149')],{'as':_0x9740('0x14a'),'foreignKey':'SmsAccountId'});db[_0x9740('0x56')][_0x9740('0xfb')](db[_0x9740('0x5b')],{'as':_0x9740('0x13e'),'foreignKey':'SmsAccountId'});db[_0x9740('0x56')][_0x9740('0xfb')](db['SmsInteraction'],{'as':_0x9740('0x166')});db[_0x9740('0x56')][_0x9740('0xfb')](db[_0x9740('0x58')],{'as':'Applications'});db[_0x9740('0x56')][_0x9740('0x108')](db['CmList'],{'as':'List','foreignKey':_0x9740('0x14d')});db[_0x9740('0x56')][_0x9740('0x108')](db[_0x9740('0x135')],{'as':_0x9740('0x136'),'foreignKey':'mandatoryDispositionPauseId'});db['SmsAccount'][_0x9740('0x10a')](db[_0x9740('0x14')],{'as':_0x9740('0x139'),'through':'user_has_sms_accounts'});db[_0x9740('0x58')][_0x9740('0x108')](db[_0x9740('0x14')],{'onDelete':_0x9740('0x156')});db[_0x9740('0x58')][_0x9740('0x108')](db[_0x9740('0x11a')],{'onDelete':_0x9740('0x156')});db['SmsApplication'][_0x9740('0x108')](db[_0x9740('0x56')],{'onDelete':_0x9740('0x156')});db[_0x9740('0x58')][_0x9740('0x108')](db[_0x9740('0x133')],{'onDelete':_0x9740('0x156'),'foreignKey':_0x9740('0x134')});db[_0x9740('0x58')][_0x9740('0x108')](db[_0x9740('0x8b')],{'onDelete':_0x9740('0x156'),'foreignKey':_0x9740('0x157')});db['SmsInteraction'][_0x9740('0xfb')](db['SmsMessage'],{'as':_0x9740('0x13e'),'onDelete':_0x9740('0xff'),'foreignKey':_0x9740('0x167')});db['SmsInteraction']['belongsTo'](db[_0x9740('0x56')],{'as':'Account','foreignKey':'SmsAccountId'});db[_0x9740('0x104')][_0x9740('0x108')](db['CmContact'],{'as':'Contact','foreignKey':_0x9740('0x144')});db['SmsInteraction'][_0x9740('0x108')](db[_0x9740('0x14')],{'as':_0x9740('0x15d'),'foreignKey':_0x9740('0xfa')});db[_0x9740('0x104')]['belongsToMany'](db[_0x9740('0x8b')],{'through':'sms_interaction_has_tags','as':_0x9740('0x168')});db[_0x9740('0x104')][_0x9740('0x10a')](db[_0x9740('0x8b')],{'through':'sms_interaction_has_tags','as':'ThroughTags'});db[_0x9740('0x104')][_0x9740('0x10a')](db[_0x9740('0x14')],{'as':'Users','through':_0x9740('0x169'),'foreignKey':_0x9740('0x167')});db[_0x9740('0x5b')]['belongsTo'](db[_0x9740('0x14')],{'as':_0x9740('0x14')});db[_0x9740('0x5b')][_0x9740('0x108')](db['CmContact'],{'onDelete':_0x9740('0xff'),'as':_0x9740('0x143')});db[_0x9740('0x5b')]['belongsTo'](db[_0x9740('0x104')],{'onDelete':_0x9740('0xff'),'as':_0x9740('0x161'),'foreignKey':'SmsInteractionId'});db[_0x9740('0x5b')][_0x9740('0x108')](db[_0x9740('0x56')],{'as':_0x9740('0x151'),'foreignKey':_0x9740('0x165')});db[_0x9740('0x11a')]['belongsToMany'](db['User'],{'as':_0x9740('0x139'),'through':'UserSmsQueue','foreignKey':_0x9740('0x16a')});db['SmsQueue'][_0x9740('0x10a')](db[_0x9740('0x13a')],{'through':_0x9740('0x16b'),'as':'Teams'});db[_0x9740('0x16c')][_0x9740('0xfb')](db['Disposition'],{'as':_0x9740('0x158'),'foreignKey':_0x9740('0x16d')});db['OpenchannelAccount'][_0x9740('0xfb')](db['CannedAnswer'],{'as':_0x9740('0x14a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x9740('0xfb')](db[_0x9740('0x60')],{'as':_0x9740('0x166'),'foreignKey':_0x9740('0x16d')});db[_0x9740('0x16c')][_0x9740('0xfb')](db[_0x9740('0x16e')],{'as':_0x9740('0x13e'),'foreignKey':_0x9740('0x16d')});db['OpenchannelAccount'][_0x9740('0xfb')](db['OpenchannelApplication'],{'as':_0x9740('0x128'),'foreignKey':_0x9740('0x16d')});db['OpenchannelAccount']['belongsTo'](db[_0x9740('0xf1')],{'as':_0x9740('0x14c'),'foreignKey':_0x9740('0x14d')});db[_0x9740('0x16c')][_0x9740('0x108')](db['Pause'],{'as':_0x9740('0x136'),'foreignKey':_0x9740('0x137')});db[_0x9740('0x16c')][_0x9740('0x10a')](db[_0x9740('0x14')],{'as':_0x9740('0x139'),'through':_0x9740('0x122')});db[_0x9740('0x5f')][_0x9740('0x108')](db[_0x9740('0x14')],{'onDelete':_0x9740('0x156')});db[_0x9740('0x5f')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0x9740('0x156'),'foreignKey':_0x9740('0x16f')});db['OpenchannelApplication'][_0x9740('0x108')](db['OpenchannelAccount'],{'onDelete':_0x9740('0x156'),'foreignKey':_0x9740('0x16d')});db['OpenchannelApplication']['belongsTo'](db[_0x9740('0x133')],{'onDelete':'restrict','foreignKey':_0x9740('0x134')});db['OpenchannelApplication']['belongsTo'](db[_0x9740('0x8b')],{'onDelete':'restrict','foreignKey':_0x9740('0x157')});db[_0x9740('0x60')][_0x9740('0xfb')](db[_0x9740('0x16e')],{'as':_0x9740('0x13e'),'onDelete':'cascade','foreignKey':_0x9740('0x170')});db[_0x9740('0x60')][_0x9740('0x108')](db[_0x9740('0x16c')],{'as':_0x9740('0x151'),'foreignKey':_0x9740('0x16d')});db[_0x9740('0x60')][_0x9740('0x108')](db[_0x9740('0x71')],{'as':_0x9740('0x143'),'foreignKey':_0x9740('0x144')});db[_0x9740('0x60')][_0x9740('0x108')](db[_0x9740('0x14')],{'as':'Owner','foreignKey':_0x9740('0xfa')});db[_0x9740('0x60')][_0x9740('0x10a')](db[_0x9740('0x8b')],{'through':_0x9740('0x171'),'as':_0x9740('0x168')});db[_0x9740('0x60')][_0x9740('0x10a')](db[_0x9740('0x8b')],{'through':'openchannel_interaction_has_tags','as':_0x9740('0x153')});db[_0x9740('0x60')][_0x9740('0x10a')](db[_0x9740('0x14')],{'as':_0x9740('0x15f'),'through':_0x9740('0x114'),'foreignKey':_0x9740('0x170')});db[_0x9740('0x16e')]['belongsTo'](db[_0x9740('0x14')],{'onDelete':_0x9740('0xff'),'as':_0x9740('0x14')});db[_0x9740('0x16e')][_0x9740('0x108')](db[_0x9740('0x71')],{'onDelete':_0x9740('0xff'),'as':_0x9740('0x143')});db['OpenchannelMessage']['belongsTo'](db['OpenchannelInteraction'],{'onDelete':_0x9740('0xff'),'as':_0x9740('0x161'),'foreignKey':'OpenchannelInteractionId'});db[_0x9740('0x16e')]['belongsTo'](db[_0x9740('0xe9')],{'as':_0x9740('0xe9'),'foreignKey':'AttachmentId'});db[_0x9740('0x16e')][_0x9740('0x108')](db[_0x9740('0x16c')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db['OpenchannelQueue'][_0x9740('0x10a')](db[_0x9740('0x14')],{'as':'Agents','through':'UserOpenchannelQueue','foreignKey':'OpenchannelQueueId'});db[_0x9740('0x172')]['belongsToMany'](db['Team'],{'through':'team_has_openchannel_queues','as':_0x9740('0x13b')});db[_0x9740('0x64')]['hasMany'](db[_0x9740('0x148')],{'as':_0x9740('0x158'),'foreignKey':_0x9740('0x173')});db['ChatWebsite']['hasMany'](db[_0x9740('0x149')],{'as':_0x9740('0x14a'),'foreignKey':'ChatWebsiteId'});db['ChatWebsite'][_0x9740('0xfb')](db[_0x9740('0x6f')],{'as':_0x9740('0x174')});db[_0x9740('0x64')][_0x9740('0xfb')](db[_0x9740('0x69')],{'as':_0x9740('0x166')});db[_0x9740('0x64')][_0x9740('0xfb')](db['ChatApplication'],{'as':_0x9740('0x128')});db[_0x9740('0x64')]['hasMany'](db[_0x9740('0x175')],{'as':'Messages'});db['ChatWebsite'][_0x9740('0x108')](db[_0x9740('0xf1')],{'as':'List','foreignKey':_0x9740('0x14d')});db['ChatWebsite'][_0x9740('0x108')](db[_0x9740('0x133')],{'as':_0x9740('0x133'),'foreignKey':_0x9740('0x134')});db[_0x9740('0x64')][_0x9740('0x108')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x9740('0x64')][_0x9740('0x10a')](db[_0x9740('0x14')],{'as':_0x9740('0x139'),'through':_0x9740('0x11f')});db[_0x9740('0x65')][_0x9740('0x108')](db[_0x9740('0x16c')],{});db[_0x9740('0x65')][_0x9740('0x108')](db[_0x9740('0xf1')],{'as':'List','foreignKey':_0x9740('0x14d')});db[_0x9740('0x65')][_0x9740('0x108')](db['CmContact'],{'as':_0x9740('0x143'),'foreignKey':_0x9740('0x144')});db[_0x9740('0x65')][_0x9740('0x108')](db[_0x9740('0x60')],{});db[_0x9740('0x65')][_0x9740('0x108')](db[_0x9740('0x16e')],{});db[_0x9740('0x65')]['belongsTo'](db['User'],{});db['OpenchannelQueueReport'][_0x9740('0x108')](db[_0x9740('0x172')],{});db[_0x9740('0x67')][_0x9740('0x108')](db[_0x9740('0x14')],{'as':_0x9740('0x176'),'foreignKey':_0x9740('0xfa'),'onDelete':_0x9740('0x156')});db['ChatApplication'][_0x9740('0x108')](db[_0x9740('0x6c')],{'as':'Queue','foreignKey':_0x9740('0x177'),'onDelete':_0x9740('0x156')});db[_0x9740('0x67')][_0x9740('0x108')](db[_0x9740('0x64')],{'as':_0x9740('0x178'),'foreignKey':_0x9740('0x173'),'onDelete':_0x9740('0x156')});db[_0x9740('0x67')][_0x9740('0x108')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x9740('0x157')});db[_0x9740('0x69')][_0x9740('0xfb')](db[_0x9740('0x175')],{'as':_0x9740('0x13e'),'onDelete':_0x9740('0xff'),'foreignKey':_0x9740('0x179')});db[_0x9740('0x69')][_0x9740('0x108')](db['ChatWebsite'],{'as':_0x9740('0x151'),'foreignKey':_0x9740('0x173')});db[_0x9740('0x69')][_0x9740('0x108')](db[_0x9740('0x71')],{'as':_0x9740('0x143'),'foreignKey':'ContactId'});db[_0x9740('0x69')][_0x9740('0x108')](db['User'],{'as':'Owner','foreignKey':_0x9740('0xfa')});db[_0x9740('0x69')][_0x9740('0x10a')](db[_0x9740('0x8b')],{'through':_0x9740('0x17a'),'as':'Tags'});db['ChatInteraction'][_0x9740('0x10a')](db['Tag'],{'through':_0x9740('0x17a'),'as':_0x9740('0x153')});db[_0x9740('0x69')][_0x9740('0x10a')](db[_0x9740('0x14')],{'as':_0x9740('0x15f'),'through':_0x9740('0x113'),'foreignKey':_0x9740('0x179')});db['ChatMessage'][_0x9740('0x108')](db[_0x9740('0x14')],{'onDelete':'cascade','as':_0x9740('0x14')});db[_0x9740('0x175')]['belongsTo'](db[_0x9740('0x71')],{'onDelete':_0x9740('0xff'),'as':_0x9740('0x143'),'foreignKey':_0x9740('0x144')});db[_0x9740('0x175')][_0x9740('0x108')](db[_0x9740('0x69')],{'onDelete':_0x9740('0xff'),'as':_0x9740('0x161'),'foreignKey':_0x9740('0x179')});db[_0x9740('0x175')][_0x9740('0x108')](db['Attachment'],{'as':_0x9740('0xe9'),'foreignKey':_0x9740('0x162')});db[_0x9740('0x175')][_0x9740('0x108')](db[_0x9740('0x64')],{'as':_0x9740('0x151'),'foreignKey':_0x9740('0x173')});db[_0x9740('0x17b')][_0x9740('0x108')](db[_0x9740('0x71')],{'onDelete':_0x9740('0xff'),'as':_0x9740('0x143'),'foreignKey':'ContactId'});db[_0x9740('0x17b')][_0x9740('0x108')](db[_0x9740('0x64')],{'as':_0x9740('0x151'),'foreignKey':'ChatWebsiteId'});db['ChatQueue'][_0x9740('0x10a')](db[_0x9740('0x14')],{'as':_0x9740('0x139'),'through':_0x9740('0x34'),'hooks':!![]});db[_0x9740('0x6c')][_0x9740('0x10a')](db[_0x9740('0x13a')],{'through':_0x9740('0x17c'),'as':_0x9740('0x13b')});db['ChatGroup'][_0x9740('0xfb')](db[_0x9740('0xd0')],{'as':_0x9740('0x13e'),'foreignKey':'ChatGroupId','onDelete':_0x9740('0xff')});db[_0x9740('0x10b')][_0x9740('0x10a')](db[_0x9740('0x14')],{'as':_0x9740('0x12a'),'through':_0x9740('0x10d')});db[_0x9740('0x6f')][_0x9740('0x108')](db[_0x9740('0x64')],{'as':_0x9740('0x178'),'foreignKey':_0x9740('0x173')});db[_0x9740('0x17d')]['hasMany'](db[_0x9740('0x71')],{'as':_0x9740('0x10e'),'foreignKey':'CompanyId'});db[_0x9740('0x71')][_0x9740('0xfb')](db[_0x9740('0x73')],{'as':_0x9740('0x12c'),'foreignKey':_0x9740('0x144')});db['CmContact']['hasMany'](db[_0x9740('0x76')],{'as':_0x9740('0x100'),'foreignKey':'ContactId'});db[_0x9740('0x71')][_0x9740('0xfb')](db[_0x9740('0x78')],{'as':_0x9740('0x12d'),'foreignKey':_0x9740('0x144')});db[_0x9740('0x71')][_0x9740('0xfb')](db[_0x9740('0x7a')],{'as':_0x9740('0x7a'),'foreignKey':_0x9740('0x144')});db[_0x9740('0x71')][_0x9740('0xfb')](db[_0x9740('0xd4')],{'as':'JscriptySessions','foreignKey':_0x9740('0x144')});db[_0x9740('0x71')][_0x9740('0xfb')](db['OpenchannelInteraction'],{'as':_0x9740('0x102'),'foreignKey':'ContactId','onDelete':_0x9740('0x156')});db[_0x9740('0x71')]['hasMany'](db[_0x9740('0x69')],{'as':_0x9740('0x103'),'foreignKey':_0x9740('0x144'),'onDelete':_0x9740('0x156')});db['CmContact'][_0x9740('0xfb')](db[_0x9740('0x104')],{'as':_0x9740('0x105'),'foreignKey':_0x9740('0x144'),'onDelete':_0x9740('0x156')});db['CmContact'][_0x9740('0xfb')](db[_0x9740('0x4f')],{'as':_0x9740('0x106'),'foreignKey':_0x9740('0x144'),'onDelete':_0x9740('0x156')});db[_0x9740('0x71')]['hasMany'](db[_0x9740('0x45')],{'as':_0x9740('0x107'),'foreignKey':_0x9740('0x144'),'onDelete':_0x9740('0x156')});db['CmContact'][_0x9740('0x108')](db[_0x9740('0x17d')],{'as':_0x9740('0x17e'),'foreignKey':_0x9740('0x17f')});db[_0x9740('0x71')][_0x9740('0x108')](db['CmList'],{'as':_0x9740('0x14c'),'foreignKey':_0x9740('0x14d'),'onDelete':'cascade'});db['CmContact'][_0x9740('0x10a')](db[_0x9740('0x14')],{'as':'Users','through':_0x9740('0x180')});db[_0x9740('0x71')][_0x9740('0x10a')](db[_0x9740('0x8b')],{'as':_0x9740('0x168'),'through':_0x9740('0x181')});db['CmContact']['belongsToMany'](db['Tag'],{'through':_0x9740('0x181'),'as':_0x9740('0x153')});db[_0x9740('0x73')][_0x9740('0x108')](db[_0x9740('0x71')],{'as':'Contact','foreignKey':'ContactId','onDelete':_0x9740('0xff')});db[_0x9740('0x73')]['belongsTo'](db['CmList'],{'as':_0x9740('0x14c'),'foreignKey':_0x9740('0x14d'),'onDelete':_0x9740('0xff')});db['CmHopper'][_0x9740('0x108')](db[_0x9740('0x14')],{'as':_0x9740('0x176'),'foreignKey':'UserId'});db[_0x9740('0x73')][_0x9740('0x108')](db[_0x9740('0x1e')],{'as':_0x9740('0x182'),'foreignKey':_0x9740('0x12b'),'onDelete':_0x9740('0xff')});db[_0x9740('0x73')]['belongsTo'](db['Campaign'],{'as':_0x9740('0xe5'),'foreignKey':_0x9740('0x183'),'onDelete':_0x9740('0xff')});db[_0x9740('0x73')][_0x9740('0x108')](db[_0x9740('0x14')],{'as':_0x9740('0x15d'),'foreignKey':'OwnerId'});db[_0x9740('0x74')]['belongsTo'](db[_0x9740('0x71')],{'as':_0x9740('0x143'),'foreignKey':_0x9740('0x144'),'onDelete':'cascade'});db['CmHopperBlack'][_0x9740('0x108')](db[_0x9740('0xf1')],{'as':_0x9740('0x14c'),'foreignKey':_0x9740('0x14d'),'onDelete':'cascade'});db[_0x9740('0x74')][_0x9740('0x108')](db[_0x9740('0x1e')],{'as':'Queue','foreignKey':_0x9740('0x12b'),'onDelete':_0x9740('0xff')});db[_0x9740('0x74')]['belongsTo'](db[_0x9740('0xe5')],{'as':_0x9740('0xe5'),'foreignKey':'CampaignId','onDelete':_0x9740('0xff')});db[_0x9740('0x80')][_0x9740('0xfb')](db[_0x9740('0x184')],{'as':{'plural':'All','singular':_0x9740('0x185')},'foreignKey':_0x9740('0x186'),'onDelete':_0x9740('0xff'),'hooks':!![]});db[_0x9740('0x80')][_0x9740('0xfb')](db['Condition'],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':_0x9740('0x187'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0x9740('0xfb')](db[_0x9740('0x7e')],{'as':_0x9740('0x188'),'foreignKey':_0x9740('0x189'),'onDelete':_0x9740('0xff'),'hooks':!![]});db[_0x9740('0x133')]['hasMany'](db[_0x9740('0x133')],{'as':'Intervals','foreignKey':_0x9740('0x134'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0x9740('0x133')][_0x9740('0xfb')](db[_0x9740('0x1a')],{'as':_0x9740('0xfe'),'foreignKey':'IntervalId','onDelete':_0x9740('0x156')});db['Interval'][_0x9740('0xfb')](db['MailApplication'],{'as':_0x9740('0x18a'),'foreignKey':'IntervalId'});db[_0x9740('0x133')][_0x9740('0xfb')](db[_0x9740('0x67')],{'as':'ChatApplications','foreignKey':_0x9740('0x134')});db['Interval'][_0x9740('0xfb')](db[_0x9740('0x4e')],{'as':_0x9740('0x18b'),'foreignKey':_0x9740('0x134')});db['Interval'][_0x9740('0xfb')](db[_0x9740('0x58')],{'as':_0x9740('0x18c'),'foreignKey':_0x9740('0x134')});db[_0x9740('0x18d')]['belongsTo'](db[_0x9740('0x40')],{});db['Schedule'][_0x9740('0x108')](db['AnalyticDefaultReport'],{'foreignKey':_0x9740('0x18e')});db[_0x9740('0x18d')]['belongsTo'](db[_0x9740('0x96')],{'foreignKey':_0x9740('0x18f')});db[_0x9740('0x190')][_0x9740('0x10a')](db[_0x9740('0x1c')],{'as':_0x9740('0x191'),'through':_0x9740('0x192'),'onDelete':'restrict'});db['Tag']['belongsToMany'](db['CmContact'],{'through':_0x9740('0x181')});db[_0x9740('0x8b')][_0x9740('0x10a')](db['ChatInteraction'],{'through':_0x9740('0x17a')});db[_0x9740('0x8b')]['belongsToMany'](db[_0x9740('0x45')],{'through':'mail_interaction_has_tags'});db['Tag'][_0x9740('0x10a')](db[_0x9740('0x104')],{'through':_0x9740('0x193')});db[_0x9740('0x8b')]['belongsToMany'](db[_0x9740('0x4f')],{'through':_0x9740('0x15e')});db[_0x9740('0x8b')]['belongsToMany'](db[_0x9740('0x60')],{'through':_0x9740('0x171')});db[_0x9740('0x8f')][_0x9740('0xfb')](db[_0x9740('0x184')],{'as':{'plural':_0x9740('0x194'),'singular':_0x9740('0x195')},'foreignKey':_0x9740('0x196'),'onDelete':_0x9740('0xff'),'hooks':!![]});db['Trigger']['hasMany'](db[_0x9740('0x184')],{'as':{'plural':_0x9740('0x197'),'singular':_0x9740('0x198')},'foreignKey':_0x9740('0x199'),'onDelete':_0x9740('0xff'),'hooks':!![]});db['Trigger']['hasMany'](db[_0x9740('0x7e')],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0x9740('0xff'),'hooks':!![]});db[_0x9740('0x96')][_0x9740('0xfb')](db[_0x9740('0x19a')],{'as':_0x9740('0x19b'),'onDelete':_0x9740('0xff'),'foreignKey':_0x9740('0x18f'),'hooks':!![]});db[_0x9740('0x98')][_0x9740('0xfb')](db[_0x9740('0x19a')],{'as':_0x9740('0x19b'),'onDelete':'cascade','foreignKey':_0x9740('0x18e')});db[_0x9740('0x9c')][_0x9740('0xfb')](db[_0x9740('0x19a')],{'as':_0x9740('0x19b'),'onDelete':_0x9740('0xff'),'foreignKey':_0x9740('0x19c')});db['AnalyticFieldReport'][_0x9740('0x108')](db[_0x9740('0x9c')],{'foreignKey':'MetricId'});db[_0x9740('0x9f')][_0x9740('0xfb')](db[_0x9740('0x19d')],{'as':_0x9740('0x19e'),'onDelete':_0x9740('0xff'),'foreignKey':_0x9740('0x19f')});db[_0x9740('0x19d')][_0x9740('0xfb')](db['SalesforceField'],{'as':_0x9740('0x1a0'),'onDelete':_0x9740('0xff'),'foreignKey':_0x9740('0x1a1')});db[_0x9740('0x19d')][_0x9740('0xfb')](db[_0x9740('0xa2')],{'as':_0x9740('0x1a2'),'onDelete':_0x9740('0xff'),'foreignKey':'DescriptionId'});db[_0x9740('0x19d')][_0x9740('0xfb')](db[_0x9740('0xa2')],{'as':_0x9740('0x19b'),'onDelete':_0x9740('0xff'),'foreignKey':'FieldId'});db[_0x9740('0x19d')][_0x9740('0x108')](db[_0x9740('0x9f')],{'as':_0x9740('0x151'),'foreignKey':_0x9740('0x19f')});db[_0x9740('0xa2')][_0x9740('0xfb')](db[_0x9740('0xa2')],{'as':_0x9740('0x1a3'),'foreignKey':'SubjectId'});db[_0x9740('0xa2')][_0x9740('0xfb')](db[_0x9740('0xa2')],{'as':_0x9740('0x1a4'),'foreignKey':_0x9740('0x1a5')});db[_0x9740('0xa2')][_0x9740('0xfb')](db['SalesforceField'],{'as':'Field','foreignKey':_0x9740('0x1a6')});db[_0x9740('0xa2')][_0x9740('0x108')](db[_0x9740('0x91')],{'as':'Variable','foreignKey':_0x9740('0x1a7')});db[_0x9740('0xa4')]['hasMany'](db[_0x9740('0xa6')],{'as':'Configurations','onDelete':_0x9740('0xff'),'foreignKey':_0x9740('0x19f')});db[_0x9740('0xa6')]['hasMany'](db['SugarcrmField'],{'as':_0x9740('0x1a0'),'onDelete':'cascade','foreignKey':_0x9740('0x1a1')});db['SugarcrmConfiguration']['hasMany'](db[_0x9740('0xa8')],{'as':_0x9740('0x1a2'),'onDelete':'cascade','foreignKey':_0x9740('0x1a5')});db[_0x9740('0xa6')][_0x9740('0xfb')](db['SugarcrmField'],{'as':_0x9740('0x19b'),'onDelete':_0x9740('0xff'),'foreignKey':_0x9740('0x1a6')});db[_0x9740('0xa6')]['belongsTo'](db[_0x9740('0xa4')],{'as':_0x9740('0x151'),'foreignKey':_0x9740('0x19f')});db[_0x9740('0xa8')][_0x9740('0xfb')](db[_0x9740('0xa8')],{'as':'Subject','foreignKey':_0x9740('0x1a1')});db[_0x9740('0xa8')][_0x9740('0xfb')](db[_0x9740('0xa8')],{'as':_0x9740('0x1a4'),'foreignKey':'DescriptionId'});db[_0x9740('0xa8')][_0x9740('0xfb')](db[_0x9740('0xa8')],{'as':_0x9740('0x1a8'),'foreignKey':'FieldId'});db['SugarcrmField']['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0x9740('0x1a7')});db[_0x9740('0xaa')][_0x9740('0xfb')](db[_0x9740('0xac')],{'as':_0x9740('0x19e'),'onDelete':_0x9740('0xff'),'foreignKey':'AccountId'});db[_0x9740('0xac')][_0x9740('0xfb')](db['DeskField'],{'as':_0x9740('0x1a0'),'onDelete':_0x9740('0xff'),'foreignKey':'SubjectId'});db[_0x9740('0xac')][_0x9740('0xfb')](db['DeskField'],{'as':_0x9740('0x1a2'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x9740('0xac')][_0x9740('0xfb')](db[_0x9740('0xae')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x9740('0x1a6')});db[_0x9740('0xac')][_0x9740('0x108')](db[_0x9740('0xaa')],{'as':_0x9740('0x151'),'foreignKey':_0x9740('0x19f')});db['DeskConfiguration'][_0x9740('0x10a')](db[_0x9740('0x8b')],{'through':_0x9740('0x1a9')});db[_0x9740('0xae')][_0x9740('0xfb')](db[_0x9740('0xae')],{'as':_0x9740('0x1a3'),'foreignKey':'SubjectId'});db[_0x9740('0xae')][_0x9740('0xfb')](db[_0x9740('0xae')],{'as':'Description','foreignKey':_0x9740('0x1a5')});db[_0x9740('0xae')]['hasMany'](db[_0x9740('0xae')],{'as':_0x9740('0x1a8'),'foreignKey':_0x9740('0x1a6')});db['DeskField']['belongsTo'](db[_0x9740('0x91')],{'as':_0x9740('0x91'),'foreignKey':_0x9740('0x1a7')});db[_0x9740('0x1aa')]['hasMany'](db['ZohoConfiguration'],{'as':_0x9740('0x19e'),'onDelete':_0x9740('0xff'),'foreignKey':_0x9740('0x19f')});db['ZohoConfiguration'][_0x9740('0xfb')](db['ZohoField'],{'as':_0x9740('0x1a0'),'onDelete':'cascade','foreignKey':_0x9740('0x1a1')});db[_0x9740('0x1ab')]['hasMany'](db[_0x9740('0x1ac')],{'as':_0x9740('0x1a2'),'onDelete':'cascade','foreignKey':_0x9740('0x1a5')});db['ZohoConfiguration'][_0x9740('0xfb')](db['ZohoField'],{'as':'Fields','onDelete':'cascade','foreignKey':_0x9740('0x1a6')});db[_0x9740('0x1ab')][_0x9740('0x108')](db['ZohoAccount'],{'as':_0x9740('0x151'),'foreignKey':_0x9740('0x19f')});db['ZohoField'][_0x9740('0xfb')](db[_0x9740('0x1ac')],{'as':_0x9740('0x1a3'),'foreignKey':_0x9740('0x1a1')});db[_0x9740('0x1ac')][_0x9740('0xfb')](db[_0x9740('0x1ac')],{'as':'Description','foreignKey':_0x9740('0x1a5')});db[_0x9740('0x1ac')][_0x9740('0xfb')](db[_0x9740('0x1ac')],{'as':_0x9740('0x1a8'),'foreignKey':_0x9740('0x1a6')});db[_0x9740('0x1ac')][_0x9740('0x108')](db[_0x9740('0x91')],{'as':_0x9740('0x91'),'foreignKey':_0x9740('0x1a7')});db[_0x9740('0x1ad')][_0x9740('0xfb')](db[_0x9740('0xb3')],{'as':'Configurations','onDelete':_0x9740('0xff'),'foreignKey':_0x9740('0x19f')});db[_0x9740('0xb3')]['hasMany'](db['ZendeskField'],{'as':_0x9740('0x1a0'),'foreignKey':_0x9740('0x1a1')});db[_0x9740('0xb3')][_0x9740('0xfb')](db[_0x9740('0xb5')],{'as':_0x9740('0x1a2'),'foreignKey':_0x9740('0x1a5')});db['ZendeskConfiguration'][_0x9740('0xfb')](db[_0x9740('0xb5')],{'as':'Fields','foreignKey':_0x9740('0x1a6')});db[_0x9740('0xb3')]['belongsTo'](db['ZendeskAccount'],{'as':_0x9740('0x151'),'foreignKey':_0x9740('0x19f')});db[_0x9740('0xb3')]['belongsToMany'](db[_0x9740('0x8b')],{'through':_0x9740('0x1ae')});db['ZendeskField'][_0x9740('0xfb')](db[_0x9740('0xb5')],{'as':'Subject','foreignKey':_0x9740('0x1a1')});db[_0x9740('0xb5')][_0x9740('0xfb')](db[_0x9740('0xb5')],{'as':_0x9740('0x1a4'),'foreignKey':_0x9740('0x1a5')});db[_0x9740('0xb5')][_0x9740('0xfb')](db[_0x9740('0xb5')],{'as':_0x9740('0x1a8'),'foreignKey':'FieldId'});db[_0x9740('0xb5')][_0x9740('0x108')](db[_0x9740('0x91')],{'as':_0x9740('0x91'),'foreignKey':_0x9740('0x1a7')});db[_0x9740('0xb7')]['hasMany'](db['FreshdeskConfiguration'],{'as':_0x9740('0x19e'),'onDelete':_0x9740('0xff'),'foreignKey':_0x9740('0x19f')});db[_0x9740('0xb9')]['hasMany'](db[_0x9740('0xbb')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x9740('0x1a1')});db[_0x9740('0xb9')][_0x9740('0xfb')](db[_0x9740('0xbb')],{'as':_0x9740('0x1a2'),'onDelete':_0x9740('0xff'),'foreignKey':'DescriptionId'});db['FreshdeskConfiguration'][_0x9740('0xfb')](db[_0x9740('0xbb')],{'as':_0x9740('0x19b'),'onDelete':_0x9740('0xff'),'foreignKey':_0x9740('0x1a6')});db[_0x9740('0xb9')][_0x9740('0x108')](db[_0x9740('0xb7')],{'as':_0x9740('0x151'),'foreignKey':_0x9740('0x19f')});db[_0x9740('0xb9')][_0x9740('0x10a')](db[_0x9740('0x8b')],{'through':_0x9740('0x1af')});db[_0x9740('0xbb')][_0x9740('0xfb')](db[_0x9740('0xbb')],{'as':_0x9740('0x1a3'),'foreignKey':'SubjectId'});db[_0x9740('0xbb')][_0x9740('0xfb')](db[_0x9740('0xbb')],{'as':_0x9740('0x1a4'),'foreignKey':'DescriptionId'});db[_0x9740('0xbb')][_0x9740('0xfb')](db[_0x9740('0xbb')],{'as':_0x9740('0x1a8'),'foreignKey':_0x9740('0x1a6')});db[_0x9740('0xbb')]['belongsTo'](db[_0x9740('0x91')],{'as':_0x9740('0x91'),'foreignKey':_0x9740('0x1a7')});db[_0x9740('0xbd')][_0x9740('0xfb')](db[_0x9740('0xbf')],{'as':_0x9740('0x19e'),'onDelete':_0x9740('0xff'),'foreignKey':_0x9740('0x19f')});db[_0x9740('0xbf')][_0x9740('0xfb')](db['VtigerField'],{'as':_0x9740('0x1a0'),'foreignKey':_0x9740('0x1a1')});db[_0x9740('0xbf')][_0x9740('0xfb')](db['VtigerField'],{'as':_0x9740('0x1a2'),'foreignKey':'DescriptionId'});db['VtigerConfiguration'][_0x9740('0xfb')](db[_0x9740('0xc1')],{'as':'Fields','foreignKey':_0x9740('0x1a6')});db[_0x9740('0xbf')][_0x9740('0x108')](db['VtigerAccount'],{'as':_0x9740('0x151'),'foreignKey':_0x9740('0x19f')});db[_0x9740('0xbf')][_0x9740('0x10a')](db['Tag'],{'through':'int_vtiger_configuration_has_tags'});db[_0x9740('0xc1')][_0x9740('0xfb')](db[_0x9740('0xc1')],{'as':_0x9740('0x1a3'),'foreignKey':_0x9740('0x1a1')});db[_0x9740('0xc1')][_0x9740('0xfb')](db[_0x9740('0xc1')],{'as':_0x9740('0x1a4'),'foreignKey':_0x9740('0x1a5')});db[_0x9740('0xc1')][_0x9740('0xfb')](db[_0x9740('0xc1')],{'as':_0x9740('0x1a8'),'foreignKey':_0x9740('0x1a6')});db[_0x9740('0xc1')][_0x9740('0x108')](db[_0x9740('0x91')],{'as':'Variable','foreignKey':_0x9740('0x1a7')});db['ServicenowAccount'][_0x9740('0xfb')](db[_0x9740('0xc5')],{'as':'Configurations','onDelete':_0x9740('0xff'),'foreignKey':_0x9740('0x19f')});db[_0x9740('0xc5')][_0x9740('0xfb')](db[_0x9740('0xc7')],{'as':'Subjects','foreignKey':_0x9740('0x1a1')});db[_0x9740('0xc5')][_0x9740('0xfb')](db[_0x9740('0xc7')],{'as':'Descriptions','foreignKey':_0x9740('0x1a5')});db[_0x9740('0xc5')][_0x9740('0xfb')](db['ServicenowField'],{'as':'Fields','foreignKey':_0x9740('0x1a6')});db[_0x9740('0xc5')][_0x9740('0x108')](db[_0x9740('0xc3')],{'as':_0x9740('0x151'),'foreignKey':_0x9740('0x19f')});db['ServicenowField'][_0x9740('0xfb')](db[_0x9740('0xc7')],{'as':_0x9740('0x1a3'),'foreignKey':_0x9740('0x1a1')});db[_0x9740('0xc7')][_0x9740('0xfb')](db[_0x9740('0xc7')],{'as':_0x9740('0x1a4'),'foreignKey':_0x9740('0x1a5')});db[_0x9740('0xc7')][_0x9740('0xfb')](db['ServicenowField'],{'as':_0x9740('0x1a8'),'foreignKey':_0x9740('0x1a6')});db['ServicenowField'][_0x9740('0x108')](db['Variable'],{'as':'Variable','foreignKey':_0x9740('0x1a7')});db[_0x9740('0xc9')]['hasMany'](db['Dynamics365Configuration'],{'as':'Configurations','onDelete':_0x9740('0xff'),'foreignKey':_0x9740('0x19f')});db[_0x9740('0x1b0')][_0x9740('0xfb')](db[_0x9740('0x1b1')],{'as':_0x9740('0x1a0'),'onDelete':_0x9740('0xff'),'foreignKey':'SubjectId'});db[_0x9740('0x1b0')][_0x9740('0xfb')](db[_0x9740('0x1b1')],{'as':_0x9740('0x1a2'),'onDelete':'cascade','foreignKey':_0x9740('0x1a5')});db[_0x9740('0x1b0')][_0x9740('0xfb')](db[_0x9740('0x1b1')],{'as':_0x9740('0x19b'),'onDelete':_0x9740('0xff'),'foreignKey':'FieldId'});db[_0x9740('0x1b0')]['belongsTo'](db[_0x9740('0xc9')],{'as':_0x9740('0x151'),'foreignKey':_0x9740('0x19f')});db[_0x9740('0x1b1')][_0x9740('0xfb')](db[_0x9740('0x1b1')],{'as':_0x9740('0x1a3'),'foreignKey':_0x9740('0x1a1')});db[_0x9740('0x1b1')][_0x9740('0xfb')](db['Dynamics365Field'],{'as':'Description','foreignKey':_0x9740('0x1a5')});db[_0x9740('0x1b1')][_0x9740('0xfb')](db[_0x9740('0x1b1')],{'as':_0x9740('0x1a8'),'foreignKey':_0x9740('0x1a6')});db[_0x9740('0x1b1')][_0x9740('0x108')](db['Variable'],{'as':_0x9740('0x91'),'foreignKey':_0x9740('0x1a7')});db['ChatQueueReport'][_0x9740('0x108')](db[_0x9740('0x64')],{});db['ChatQueueReport'][_0x9740('0x108')](db[_0x9740('0xf1')],{'as':'List','foreignKey':_0x9740('0x14d')});db[_0x9740('0xce')]['belongsTo'](db['CmContact'],{'as':_0x9740('0x143'),'foreignKey':_0x9740('0x144')});db['ChatQueueReport']['belongsTo'](db[_0x9740('0x69')],{});db[_0x9740('0xce')][_0x9740('0x108')](db['ChatMessage'],{});db['ChatQueueReport'][_0x9740('0x108')](db[_0x9740('0x14')],{});db['ChatQueueReport'][_0x9740('0x108')](db[_0x9740('0x6c')],{});db[_0x9740('0xd0')][_0x9740('0x108')](db[_0x9740('0x14')],{'onDelete':_0x9740('0xff'),'foreignKey':_0x9740('0x1b2')});db[_0x9740('0xd0')][_0x9740('0x108')](db['User'],{'onDelete':_0x9740('0xff'),'foreignKey':'ToId'});db[_0x9740('0xd4')][_0x9740('0xfb')](db[_0x9740('0xd2')],{'foreignKey':'SessionId','onDelete':_0x9740('0xff')});db[_0x9740('0xd4')][_0x9740('0xfb')](db[_0x9740('0xd1')],{'foreignKey':_0x9740('0x1b3'),'onDelete':_0x9740('0xff')});db[_0x9740('0xd5')][_0x9740('0x108')](db['SmsAccount'],{});db[_0x9740('0xd5')][_0x9740('0x108')](db['CmList'],{'as':_0x9740('0x14c'),'foreignKey':_0x9740('0x14d')});db['SmsQueueReport'][_0x9740('0x108')](db['CmContact'],{'as':_0x9740('0x143'),'foreignKey':_0x9740('0x144')});db['SmsQueueReport'][_0x9740('0x108')](db[_0x9740('0x104')],{});db[_0x9740('0xd5')]['belongsTo'](db[_0x9740('0x5b')],{});db['SmsQueueReport'][_0x9740('0x108')](db[_0x9740('0x14')],{});db[_0x9740('0xd5')]['belongsTo'](db[_0x9740('0x11a')],{});db['JscriptyProject'][_0x9740('0xfb')](db['JscriptySessionReport'],{'foreignKey':_0x9740('0x1b4')});db[_0x9740('0xda')][_0x9740('0xfb')](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db[_0x9740('0xda')][_0x9740('0xfb')](db[_0x9740('0xd1')],{'foreignKey':_0x9740('0x1b4')});db['SquareProject'][_0x9740('0x10a')](db['User'],{'as':_0x9740('0x15f'),'through':_0x9740('0x126')});db[_0x9740('0x13a')][_0x9740('0x10a')](db[_0x9740('0x14')],{'as':_0x9740('0x139'),'through':_0x9740('0x111')});db[_0x9740('0x13a')][_0x9740('0x10a')](db[_0x9740('0x1e')],{'through':_0x9740('0x1b5'),'as':_0x9740('0x115')});db[_0x9740('0x13a')][_0x9740('0x10a')](db[_0x9740('0x42')],{'through':_0x9740('0x150'),'as':_0x9740('0x116')});db[_0x9740('0x13a')][_0x9740('0x10a')](db[_0x9740('0x6c')],{'through':_0x9740('0x17c'),'as':_0x9740('0x118')});db['Team'][_0x9740('0x10a')](db['FaxQueue'],{'through':_0x9740('0x163'),'as':_0x9740('0x119')});db[_0x9740('0x13a')][_0x9740('0x10a')](db[_0x9740('0x11a')],{'through':_0x9740('0x16b'),'as':_0x9740('0x1b6')});db[_0x9740('0x13a')][_0x9740('0x10a')](db[_0x9740('0x172')],{'through':_0x9740('0x1b7'),'as':_0x9740('0x11b')});db[_0x9740('0xe5')][_0x9740('0xfb')](db[_0x9740('0x73')],{'as':_0x9740('0x12c'),'foreignKey':_0x9740('0x183')});db['Campaign'][_0x9740('0xfb')](db[_0x9740('0x76')],{'as':_0x9740('0x100'),'foreignKey':_0x9740('0x183')});db['Campaign'][_0x9740('0xfb')](db[_0x9740('0x78')],{'as':_0x9740('0x12d'),'foreignKey':'CampaignId'});db[_0x9740('0xe5')][_0x9740('0xfb')](db[_0x9740('0x74')],{'as':_0x9740('0x12e'),'foreignKey':_0x9740('0x183')});db[_0x9740('0xe5')][_0x9740('0x108')](db['Trunk'],{'as':'Trunk','foreignKey':_0x9740('0x130')});db[_0x9740('0xe5')][_0x9740('0x108')](db['Trunk'],{'as':_0x9740('0x131'),'foreignKey':_0x9740('0x132')});db['Campaign'][_0x9740('0x108')](db[_0x9740('0x133')],{'as':_0x9740('0x133'),'foreignKey':_0x9740('0x134')});db[_0x9740('0xe5')][_0x9740('0x108')](db[_0x9740('0xe0')],{'as':_0x9740('0xe0'),'foreignKey':'SquareProjectId'});db[_0x9740('0xe5')][_0x9740('0x10a')](db[_0x9740('0xf1')],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0x9740('0xe5')]['belongsToMany'](db['CmList'],{'as':_0x9740('0x13c'),'through':_0x9740('0x1b8')});db[_0x9740('0xec')][_0x9740('0x108')](db[_0x9740('0x14b')],{});db[_0x9740('0xec')][_0x9740('0x108')](db[_0x9740('0x45')],{});db['MailTransferReport'][_0x9740('0x108')](db[_0x9740('0x40')],{'foreignKey':_0x9740('0x1b9'),'as':_0x9740('0x1ba')});db[_0x9740('0xec')][_0x9740('0x108')](db[_0x9740('0x14')],{'foreignKey':'FromUserId','as':_0x9740('0x1bb')});db[_0x9740('0xec')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':_0x9740('0x1bc')});db[_0x9740('0xec')][_0x9740('0x108')](db[_0x9740('0x42')],{'foreignKey':_0x9740('0x1bd'),'as':_0x9740('0x1be')});db[_0x9740('0xec')][_0x9740('0x108')](db[_0x9740('0x40')],{'foreignKey':_0x9740('0x1bf'),'as':_0x9740('0x1c0')});db[_0x9740('0x1c1')][_0x9740('0x108')](db['ChatMessage'],{});db['ChatTransferReport']['belongsTo'](db[_0x9740('0x69')],{});db[_0x9740('0x1c1')][_0x9740('0x108')](db[_0x9740('0x64')],{'foreignKey':_0x9740('0x1c2'),'as':_0x9740('0x1ba')});db[_0x9740('0x1c1')][_0x9740('0x108')](db[_0x9740('0x14')],{'foreignKey':_0x9740('0x1c3'),'as':'FromAgent'});db[_0x9740('0x1c1')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x9740('0x1c1')][_0x9740('0x108')](db[_0x9740('0x6c')],{'foreignKey':_0x9740('0x1c4'),'as':_0x9740('0x1be')});db[_0x9740('0x1c1')][_0x9740('0x108')](db['ChatWebsite'],{'foreignKey':_0x9740('0x1c5'),'as':_0x9740('0x1c0')});db[_0x9740('0x1c6')][_0x9740('0x108')](db[_0x9740('0x51')],{});db[_0x9740('0x1c6')]['belongsTo'](db['FaxInteraction'],{});db[_0x9740('0x1c6')][_0x9740('0x108')](db['FaxAccount'],{'foreignKey':_0x9740('0x1c7'),'as':'FromAccount'});db[_0x9740('0x1c6')][_0x9740('0x108')](db[_0x9740('0x14')],{'foreignKey':_0x9740('0x1c3'),'as':_0x9740('0x1bb')});db[_0x9740('0x1c6')]['belongsTo'](db[_0x9740('0x14')],{'foreignKey':_0x9740('0x1c8'),'as':_0x9740('0x1bc')});db[_0x9740('0x1c6')]['belongsTo'](db[_0x9740('0x53')],{'foreignKey':_0x9740('0x1c9'),'as':_0x9740('0x1be')});db[_0x9740('0x1c6')][_0x9740('0x108')](db[_0x9740('0x4d')],{'foreignKey':_0x9740('0x1ca'),'as':_0x9740('0x1c0')});db[_0x9740('0xef')]['belongsTo'](db[_0x9740('0x16e')],{});db[_0x9740('0xef')][_0x9740('0x108')](db['OpenchannelInteraction'],{});db[_0x9740('0xef')][_0x9740('0x108')](db[_0x9740('0x16c')],{'foreignKey':_0x9740('0x1cb'),'as':_0x9740('0x1ba')});db[_0x9740('0xef')][_0x9740('0x108')](db[_0x9740('0x14')],{'foreignKey':_0x9740('0x1c3'),'as':'FromAgent'});db['OpenchannelTransferReport'][_0x9740('0x108')](db['User'],{'foreignKey':_0x9740('0x1c8'),'as':_0x9740('0x1bc')});db['OpenchannelTransferReport']['belongsTo'](db[_0x9740('0x172')],{'foreignKey':_0x9740('0x1cc'),'as':_0x9740('0x1be')});db[_0x9740('0xef')][_0x9740('0x108')](db[_0x9740('0x16c')],{'foreignKey':_0x9740('0x1cd'),'as':_0x9740('0x1c0')});db[_0x9740('0x1ce')][_0x9740('0x108')](db['SmsMessage'],{});db['SmsTransferReport'][_0x9740('0x108')](db[_0x9740('0x104')],{});db[_0x9740('0x1ce')]['belongsTo'](db[_0x9740('0x56')],{'foreignKey':_0x9740('0x1cf'),'as':_0x9740('0x1ba')});db[_0x9740('0x1ce')]['belongsTo'](db[_0x9740('0x14')],{'foreignKey':_0x9740('0x1c3'),'as':_0x9740('0x1bb')});db[_0x9740('0x1ce')][_0x9740('0x108')](db['User'],{'foreignKey':'ToUserId','as':_0x9740('0x1bc')});db[_0x9740('0x1ce')][_0x9740('0x108')](db[_0x9740('0x11a')],{'foreignKey':'ToSmsQueueId','as':_0x9740('0x1be')});db['SmsTransferReport'][_0x9740('0x108')](db[_0x9740('0x56')],{'foreignKey':'ToSmsAccountId','as':_0x9740('0x1c0')});db['CmList'][_0x9740('0xfb')](db[_0x9740('0x148')],{'as':_0x9740('0x158'),'foreignKey':_0x9740('0x14d')});db['CmList'][_0x9740('0xfb')](db[_0x9740('0x7c')],{'as':_0x9740('0x1d0'),'foreignKey':_0x9740('0x14d')});db[_0x9740('0xf1')]['hasMany'](db['CmContact'],{'as':_0x9740('0x10e'),'onDelete':_0x9740('0xff'),'foreignKey':_0x9740('0x14d')});db[_0x9740('0xf1')]['hasMany'](db[_0x9740('0x76')],{'as':_0x9740('0x100'),'foreignKey':_0x9740('0x14d')});db[_0x9740('0xf1')]['hasMany'](db[_0x9740('0x78')],{'as':_0x9740('0x101'),'foreignKey':_0x9740('0x14d')});db[_0x9740('0xf1')][_0x9740('0xfb')](db[_0x9740('0x7a')],{'as':_0x9740('0x7a'),'foreignKey':'ListId'});db[_0x9740('0xf1')][_0x9740('0x10a')](db['VoiceQueue'],{'as':'Queues','through':_0x9740('0x138')});db[_0x9740('0xf1')][_0x9740('0x10a')](db[_0x9740('0x14')],{'as':_0x9740('0x139'),'through':_0x9740('0x110')});db['VoicePrefix'][_0x9740('0xfb')](db[_0x9740('0x1a')],{'as':_0x9740('0xfe'),'onDelete':'restrict'});db['VoicePrefix'][_0x9740('0x10a')](db[_0x9740('0x14')],{'as':_0x9740('0x139'),'through':_0x9740('0x11d')});db[_0x9740('0xf4')]['hasMany'](db[_0x9740('0x14')],{'as':_0x9740('0x15f'),'foreignKey':_0x9740('0x109')});db['UserProfile'][_0x9740('0xfb')](db[_0x9740('0xf6')],{'as':_0x9740('0x1d1'),'foreignKey':_0x9740('0x109'),'onDelete':_0x9740('0xff')});db[_0x9740('0xf6')][_0x9740('0xfb')](db[_0x9740('0x1d2')],{'as':_0x9740('0x1d3'),'foreignKey':_0x9740('0x1d4'),'onDelete':'cascade'});module[_0x9740('0x1d5')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 74dd701..5664916 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d02=['./api/authGoogle','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/pm2','./api/pm2','static','join','/apidoc','/www','root','/demo','snippet','1.0.14','/plugins','/server/files/plugins','route','get','sendFile','resolve','appPath','path','express-winston','./errors','./config/logger','api','auth','default','format','method','headers','x-forwarded-for','remoteAddress','url','statusCode','responseTime','user','name','role','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','other','agent_id','agent_name','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','/api/cm/companies','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','./api/template','/api/triggers','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareRecording','/api/square/messages','/api/teams','/api/license','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/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/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/auth/local','./api/authLocal','/api/auth/google'];(function(_0xc93414,_0x4673b5){var _0x4b6727=function(_0x2d6b6f){while(--_0x2d6b6f){_0xc93414['push'](_0xc93414['shift']());}};_0x4b6727(++_0x4673b5);}(_0x9d02,0x118));var _0x29d0=function(_0x4e71dd,_0x1661ae){_0x4e71dd=_0x4e71dd-0x0;var _0x5eafbc=_0x9d02[_0x4e71dd];return _0x5eafbc;};'use strict';var path=require(_0x29d0('0x0'));var express=require('express');var ewinston=require(_0x29d0('0x1'));var util=require('util');var errors=require(_0x29d0('0x2'));var config=require('./config/environment');var logger=require(_0x29d0('0x3'))(_0x29d0('0x4'));var authLogger=require('./config/logger')(_0x29d0('0x5'));exports[_0x29d0('0x6')]=function(_0x242299){_0x242299['use'](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x5e35b3,_0x351d26){return util[_0x29d0('0x7')]('%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s',_0x5e35b3[_0x29d0('0x8')],_0x5e35b3[_0x29d0('0x9')]['x-forwarded-for']?_0x5e35b3[_0x29d0('0x9')][_0x29d0('0xa')]:_0x5e35b3['connection'][_0x29d0('0xb')]||_0x5e35b3['ip'],_0x5e35b3[_0x29d0('0xc')],_0x351d26[_0x29d0('0xd')],_0x351d26[_0x29d0('0xe')],_0x5e35b3['user']?_0x5e35b3['user']['id']:null,_0x5e35b3[_0x29d0('0xf')]?_0x5e35b3[_0x29d0('0xf')][_0x29d0('0x10')]:null,_0x5e35b3[_0x29d0('0xf')]?_0x5e35b3[_0x29d0('0xf')][_0x29d0('0x11')]:null);}}));_0x242299[_0x29d0('0x12')](ewinston[_0x29d0('0x13')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x4545b9,_0x4c5eed){var _0x22903c=_0x29d0('0x14');if(_0x4545b9[_0x29d0('0x15')]&&_0x4545b9[_0x29d0('0x15')][_0x29d0('0x16')]&&_0x4545b9[_0x29d0('0x15')]['agent_id']){_0x22903c=_0x29d0('0x17');}return util[_0x29d0('0x7')](_0x22903c,_0x4545b9[_0x29d0('0x8')],_0x4545b9['headers'][_0x29d0('0xa')]?_0x4545b9[_0x29d0('0x9')][_0x29d0('0xa')]:_0x4545b9[_0x29d0('0x18')][_0x29d0('0xb')]||_0x4545b9['ip'],_0x4545b9[_0x29d0('0xc')],_0x4c5eed['statusCode'],_0x4c5eed[_0x29d0('0xe')],_0x4545b9[_0x29d0('0xf')]?_0x4545b9[_0x29d0('0xf')]['id']:null,_0x4545b9[_0x29d0('0xf')]?_0x4545b9[_0x29d0('0xf')][_0x29d0('0x10')]:null,_0x4545b9['user']?_0x4545b9[_0x29d0('0xf')][_0x29d0('0x11')]:null,_0x4545b9[_0x29d0('0x15')]&&_0x4545b9['body'][_0x29d0('0x16')]?_0x4545b9[_0x29d0('0x15')][_0x29d0('0x16')]:_0x29d0('0x19'),_0x4545b9['body']&&_0x4545b9[_0x29d0('0x15')][_0x29d0('0x1a')]?_0x4545b9[_0x29d0('0x15')]['agent_id']:'',_0x4545b9[_0x29d0('0x15')]&&_0x4545b9[_0x29d0('0x15')][_0x29d0('0x1b')]?_0x4545b9[_0x29d0('0x15')][_0x29d0('0x1b')]:'');},'ignoreRoute':function(_0x286e30){var _0x39037a=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x39037a['test'](_0x286e30[_0x29d0('0xc')]);}}));_0x242299[_0x29d0('0x12')](_0x29d0('0x1c'),require(_0x29d0('0x1d')));_0x242299[_0x29d0('0x12')](_0x29d0('0x1e'),require('./api/voiceChanSpy'));_0x242299[_0x29d0('0x12')](_0x29d0('0x1f'),require(_0x29d0('0x20')));_0x242299['use'](_0x29d0('0x21'),require(_0x29d0('0x22')));_0x242299[_0x29d0('0x12')](_0x29d0('0x23'),require(_0x29d0('0x24')));_0x242299[_0x29d0('0x12')](_0x29d0('0x25'),require(_0x29d0('0x26')));_0x242299[_0x29d0('0x12')](_0x29d0('0x27'),require(_0x29d0('0x28')));_0x242299['use'](_0x29d0('0x29'),require(_0x29d0('0x2a')));_0x242299[_0x29d0('0x12')]('/api/voice/mails',require(_0x29d0('0x2b')));_0x242299['use'](_0x29d0('0x2c'),require('./api/voiceMailMessage'));_0x242299[_0x29d0('0x12')]('/api/voice/calls/reports',require(_0x29d0('0x2d')));_0x242299['use'](_0x29d0('0x2e'),require(_0x29d0('0x2f')));_0x242299[_0x29d0('0x12')](_0x29d0('0x30'),require(_0x29d0('0x31')));_0x242299['use'](_0x29d0('0x32'),require(_0x29d0('0x33')));_0x242299['use']('/api/members/reports',require('./api/memberReport'));_0x242299['use'](_0x29d0('0x34'),require('./api/trunk'));_0x242299[_0x29d0('0x12')](_0x29d0('0x35'),require(_0x29d0('0x36')));_0x242299[_0x29d0('0x12')]('/api/mail/out_servers',require(_0x29d0('0x37')));_0x242299[_0x29d0('0x12')](_0x29d0('0x38'),require('./api/mailAccount'));_0x242299['use']('/api/mail/queues',require('./api/mailQueue'));_0x242299[_0x29d0('0x12')](_0x29d0('0x39'),require(_0x29d0('0x3a')));_0x242299[_0x29d0('0x12')](_0x29d0('0x3b'),require(_0x29d0('0x3c')));_0x242299[_0x29d0('0x12')]('/api/mail/messages',require(_0x29d0('0x3d')));_0x242299[_0x29d0('0x12')](_0x29d0('0x3e'),require('./api/mailApplication'));_0x242299[_0x29d0('0x12')]('/api/mail/reports/queue',require(_0x29d0('0x3f')));_0x242299['use']('/api/dashboards',require(_0x29d0('0x40')));_0x242299[_0x29d0('0x12')](_0x29d0('0x41'),require('./api/dashboardItem'));_0x242299[_0x29d0('0x12')](_0x29d0('0x42'),require(_0x29d0('0x43')));_0x242299[_0x29d0('0x12')](_0x29d0('0x44'),require(_0x29d0('0x45')));_0x242299[_0x29d0('0x12')]('/api/fax/interactions',require('./api/faxInteraction'));_0x242299[_0x29d0('0x12')]('/api/fax/messages',require(_0x29d0('0x46')));_0x242299[_0x29d0('0x12')](_0x29d0('0x47'),require(_0x29d0('0x48')));_0x242299[_0x29d0('0x12')]('/api/fax/reports/queue',require(_0x29d0('0x49')));_0x242299[_0x29d0('0x12')](_0x29d0('0x4a'),require(_0x29d0('0x4b')));_0x242299['use'](_0x29d0('0x4c'),require(_0x29d0('0x4d')));_0x242299[_0x29d0('0x12')](_0x29d0('0x4e'),require(_0x29d0('0x4f')));_0x242299[_0x29d0('0x12')](_0x29d0('0x50'),require(_0x29d0('0x51')));_0x242299[_0x29d0('0x12')](_0x29d0('0x52'),require(_0x29d0('0x53')));_0x242299[_0x29d0('0x12')](_0x29d0('0x54'),require(_0x29d0('0x55')));_0x242299['use'](_0x29d0('0x56'),require('./api/openchannelApplication'));_0x242299[_0x29d0('0x12')](_0x29d0('0x57'),require(_0x29d0('0x58')));_0x242299['use']('/api/openchannel/messages',require(_0x29d0('0x59')));_0x242299[_0x29d0('0x12')](_0x29d0('0x5a'),require(_0x29d0('0x5b')));_0x242299['use'](_0x29d0('0x5c'),require(_0x29d0('0x5d')));_0x242299[_0x29d0('0x12')](_0x29d0('0x5e'),require(_0x29d0('0x5f')));_0x242299[_0x29d0('0x12')](_0x29d0('0x60'),require('./api/chatApplication'));_0x242299['use'](_0x29d0('0x61'),require(_0x29d0('0x62')));_0x242299['use'](_0x29d0('0x63'),require('./api/chatMessage'));_0x242299[_0x29d0('0x12')](_0x29d0('0x64'),require(_0x29d0('0x65')));_0x242299['use']('/api/chat/queues',require(_0x29d0('0x66')));_0x242299[_0x29d0('0x12')](_0x29d0('0x67'),require('./api/chatGroup'));_0x242299['use'](_0x29d0('0x68'),require('./api/chatProactiveAction'));_0x242299[_0x29d0('0x12')](_0x29d0('0x69'),require('./api/cmCompany'));_0x242299[_0x29d0('0x12')](_0x29d0('0x6a'),require(_0x29d0('0x6b')));_0x242299[_0x29d0('0x12')]('/api/cm/hopper',require(_0x29d0('0x6c')));_0x242299[_0x29d0('0x12')](_0x29d0('0x6d'),require(_0x29d0('0x6e')));_0x242299['use']('/api/cm/hopper_final',require(_0x29d0('0x6f')));_0x242299[_0x29d0('0x12')](_0x29d0('0x70'),require(_0x29d0('0x71')));_0x242299[_0x29d0('0x12')](_0x29d0('0x72'),require(_0x29d0('0x73')));_0x242299[_0x29d0('0x12')]('/api/actions',require(_0x29d0('0x74')));_0x242299[_0x29d0('0x12')]('/api/automations',require(_0x29d0('0x75')));_0x242299[_0x29d0('0x12')](_0x29d0('0x76'),require('./api/cannedAnswer'));_0x242299['use'](_0x29d0('0x77'),require(_0x29d0('0x78')));_0x242299[_0x29d0('0x12')](_0x29d0('0x79'),require('./api/condition'));_0x242299[_0x29d0('0x12')](_0x29d0('0x7a'),require(_0x29d0('0x7b')));_0x242299['use'](_0x29d0('0x7c'),require(_0x29d0('0x7d')));_0x242299['use'](_0x29d0('0x7e'),require(_0x29d0('0x7f')));_0x242299[_0x29d0('0x12')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x242299[_0x29d0('0x12')](_0x29d0('0x80'),require(_0x29d0('0x81')));_0x242299[_0x29d0('0x12')](_0x29d0('0x82'),require(_0x29d0('0x83')));_0x242299[_0x29d0('0x12')]('/api/tags',require(_0x29d0('0x84')));_0x242299[_0x29d0('0x12')]('/api/templates',require(_0x29d0('0x85')));_0x242299[_0x29d0('0x12')](_0x29d0('0x86'),require('./api/trigger'));_0x242299['use']('/api/variables',require('./api/variable'));_0x242299[_0x29d0('0x12')]('/api/integrations',require(_0x29d0('0x87')));_0x242299[_0x29d0('0x12')](_0x29d0('0x88'),require(_0x29d0('0x89')));_0x242299[_0x29d0('0x12')](_0x29d0('0x8a'),require(_0x29d0('0x8b')));_0x242299[_0x29d0('0x12')](_0x29d0('0x8c'),require(_0x29d0('0x8d')));_0x242299[_0x29d0('0x12')](_0x29d0('0x8e'),require('./api/analyticExtractedReport'));_0x242299[_0x29d0('0x12')](_0x29d0('0x8f'),require(_0x29d0('0x90')));_0x242299['use'](_0x29d0('0x91'),require('./api/analyticFieldReport'));_0x242299[_0x29d0('0x12')](_0x29d0('0x92'),require(_0x29d0('0x93')));_0x242299[_0x29d0('0x12')]('/api/integrations/salesforce/accounts',require(_0x29d0('0x94')));_0x242299['use']('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x242299[_0x29d0('0x12')]('/api/integrations/salesforce/fields',require(_0x29d0('0x95')));_0x242299[_0x29d0('0x12')]('/api/integrations/sugarcrm/accounts',require(_0x29d0('0x96')));_0x242299[_0x29d0('0x12')](_0x29d0('0x97'),require(_0x29d0('0x98')));_0x242299[_0x29d0('0x12')](_0x29d0('0x99'),require(_0x29d0('0x9a')));_0x242299[_0x29d0('0x12')](_0x29d0('0x9b'),require(_0x29d0('0x9c')));_0x242299[_0x29d0('0x12')]('/api/integrations/desk/configurations',require(_0x29d0('0x9d')));_0x242299[_0x29d0('0x12')]('/api/integrations/desk/fields',require(_0x29d0('0x9e')));_0x242299['use'](_0x29d0('0x9f'),require('./api/intZohoAccount'));_0x242299['use'](_0x29d0('0xa0'),require(_0x29d0('0xa1')));_0x242299[_0x29d0('0x12')](_0x29d0('0xa2'),require(_0x29d0('0xa3')));_0x242299[_0x29d0('0x12')](_0x29d0('0xa4'),require(_0x29d0('0xa5')));_0x242299[_0x29d0('0x12')](_0x29d0('0xa6'),require(_0x29d0('0xa7')));_0x242299[_0x29d0('0x12')](_0x29d0('0xa8'),require(_0x29d0('0xa9')));_0x242299['use'](_0x29d0('0xaa'),require('./api/intFreshdeskAccount'));_0x242299[_0x29d0('0x12')](_0x29d0('0xab'),require('./api/intFreshdeskConfiguration'));_0x242299[_0x29d0('0x12')](_0x29d0('0xac'),require('./api/intFreshdeskField'));_0x242299[_0x29d0('0x12')](_0x29d0('0xad'),require(_0x29d0('0xae')));_0x242299[_0x29d0('0x12')](_0x29d0('0xaf'),require(_0x29d0('0xb0')));_0x242299[_0x29d0('0x12')](_0x29d0('0xb1'),require(_0x29d0('0xb2')));_0x242299[_0x29d0('0x12')]('/api/integrations/servicenow/accounts',require(_0x29d0('0xb3')));_0x242299[_0x29d0('0x12')]('/api/integrations/servicenow/configurations',require(_0x29d0('0xb4')));_0x242299['use']('/api/integrations/servicenow/fields',require(_0x29d0('0xb5')));_0x242299[_0x29d0('0x12')](_0x29d0('0xb6'),require(_0x29d0('0xb7')));_0x242299[_0x29d0('0x12')](_0x29d0('0xb8'),require('./api/intDynamics365Configuration'));_0x242299[_0x29d0('0x12')](_0x29d0('0xb9'),require('./api/intDynamics365Field'));_0x242299[_0x29d0('0x12')]('/api/networks',require(_0x29d0('0xba')));_0x242299[_0x29d0('0x12')](_0x29d0('0xbb'),require(_0x29d0('0xbc')));_0x242299[_0x29d0('0x12')](_0x29d0('0xbd'),require(_0x29d0('0xbe')));_0x242299[_0x29d0('0x12')](_0x29d0('0xbf'),require('./api/jscriptyAnswerReport'));_0x242299[_0x29d0('0x12')]('/api/jscripty/questions/reports',require('./api/jscriptyQuestionReport'));_0x242299[_0x29d0('0x12')](_0x29d0('0xc0'),require(_0x29d0('0xc1')));_0x242299[_0x29d0('0x12')](_0x29d0('0xc2'),require(_0x29d0('0xc3')));_0x242299[_0x29d0('0x12')](_0x29d0('0xc4'),require(_0x29d0('0xc5')));_0x242299['use'](_0x29d0('0xc6'),require('./api/squareReportDetail'));_0x242299[_0x29d0('0x12')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x242299[_0x29d0('0x12')](_0x29d0('0xc7'),require(_0x29d0('0xc8')));_0x242299['use'](_0x29d0('0xc9'),require(_0x29d0('0xca')));_0x242299[_0x29d0('0x12')](_0x29d0('0xcb'),require('./api/squareProject'));_0x242299['use']('/api/square/recordings',require(_0x29d0('0xcc')));_0x242299[_0x29d0('0x12')](_0x29d0('0xcd'),require('./api/squareMessage'));_0x242299[_0x29d0('0x12')](_0x29d0('0xce'),require('./api/team'));_0x242299[_0x29d0('0x12')](_0x29d0('0xcf'),require(_0x29d0('0xd0')));_0x242299[_0x29d0('0x12')]('/api/campaigns',require(_0x29d0('0xd1')));_0x242299[_0x29d0('0x12')](_0x29d0('0xd2'),require(_0x29d0('0xd3')));_0x242299['use'](_0x29d0('0xd4'),require(_0x29d0('0xd5')));_0x242299['use'](_0x29d0('0xd6'),require(_0x29d0('0xd7')));_0x242299[_0x29d0('0x12')](_0x29d0('0xd8'),require('./api/mailTransferReport'));_0x242299['use'](_0x29d0('0xd9'),require(_0x29d0('0xda')));_0x242299[_0x29d0('0x12')](_0x29d0('0xdb'),require(_0x29d0('0xdc')));_0x242299[_0x29d0('0x12')](_0x29d0('0xdd'),require(_0x29d0('0xde')));_0x242299[_0x29d0('0x12')](_0x29d0('0xdf'),require('./api/smsTransferReport'));_0x242299[_0x29d0('0x12')](_0x29d0('0xe0'),require('./api/cmList'));_0x242299[_0x29d0('0x12')](_0x29d0('0xe1'),require(_0x29d0('0xe2')));_0x242299[_0x29d0('0x12')](_0x29d0('0xe3'),require('./api/userProfile'));_0x242299[_0x29d0('0x12')]('/api/userProfile/sections',require(_0x29d0('0xe4')));_0x242299[_0x29d0('0x12')](_0x29d0('0xe5'),require(_0x29d0('0xe6')));_0x242299[_0x29d0('0x12')](_0x29d0('0xe7'),require(_0x29d0('0xe8')));_0x242299[_0x29d0('0x12')](_0x29d0('0xe9'),require(_0x29d0('0xea')));_0x242299[_0x29d0('0x12')]('/api/jira',require(_0x29d0('0xeb')));_0x242299['use'](_0x29d0('0xec'),require(_0x29d0('0xed')));_0x242299[_0x29d0('0x12')](_0x29d0('0xee'),require(_0x29d0('0xef')));_0x242299[_0x29d0('0x12')]('/api/system',require('./api/system'));_0x242299[_0x29d0('0x12')](_0x29d0('0xf0'),require(_0x29d0('0xf1')));_0x242299[_0x29d0('0x12')]('/apidoc',express[_0x29d0('0xf2')](path[_0x29d0('0xf3')](config['root'],_0x29d0('0xf4'))));_0x242299[_0x29d0('0x12')](_0x29d0('0xf5'),express[_0x29d0('0xf2')](path[_0x29d0('0xf3')](config[_0x29d0('0xf6')],_0x29d0('0xf5'))));_0x242299['use']('/demo',express['static'](path[_0x29d0('0xf3')](config[_0x29d0('0xf6')],_0x29d0('0xf7'))));_0x242299[_0x29d0('0x12')]('/snippet',express[_0x29d0('0xf2')](path[_0x29d0('0xf3')](config['root'],_0x29d0('0xf8'),_0x29d0('0xf9'))));_0x242299[_0x29d0('0x12')](_0x29d0('0xfa'),express[_0x29d0('0xf2')](path[_0x29d0('0xf3')](config[_0x29d0('0xf6')],_0x29d0('0xfb'))));_0x242299[_0x29d0('0xfc')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x29d0('0xfd')](errors[0x194]);_0x242299[_0x29d0('0xfc')]('/*')[_0x29d0('0xfd')](function(_0x307cb6,_0x3a9535){_0x3a9535[_0x29d0('0xfe')](path[_0x29d0('0xff')](_0x242299[_0x29d0('0xfd')](_0x29d0('0x100'))+'/index.html'));});}; \ No newline at end of file +var _0xe644=['./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/networks','./api/network','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','./api/license','./api/campaign','/api/migrations','/api/attachments','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfileResource','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','static','join','root','/www','/demo','snippet','1.0.14','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','sendFile','resolve','get','appPath','/index.html','path','express','express-winston','util','./errors','./config/environment','api','./config/logger','auth','default','use','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','user','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','format','role','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','./api/cmContact','/api/cm/hopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/templates','/api/triggers','./api/trigger','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowConfiguration','/api/integrations/servicenow/fields'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0x4e64('0x0'));var express=require(_0x4e64('0x1'));var ewinston=require(_0x4e64('0x2'));var util=require(_0x4e64('0x3'));var errors=require(_0x4e64('0x4'));var config=require(_0x4e64('0x5'));var logger=require('./config/logger')(_0x4e64('0x6'));var authLogger=require(_0x4e64('0x7'))(_0x4e64('0x8'));exports[_0x4e64('0x9')]=function(_0x4156ef){_0x4156ef[_0x4e64('0xa')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x66faf,_0x12c40d){return util['format']('%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s',_0x66faf[_0x4e64('0xb')],_0x66faf['headers']['x-forwarded-for']?_0x66faf[_0x4e64('0xc')][_0x4e64('0xd')]:_0x66faf[_0x4e64('0xe')][_0x4e64('0xf')]||_0x66faf['ip'],_0x66faf[_0x4e64('0x10')],_0x12c40d[_0x4e64('0x11')],_0x12c40d['responseTime'],_0x66faf[_0x4e64('0x12')]?_0x66faf[_0x4e64('0x12')]['id']:null,_0x66faf['user']?_0x66faf[_0x4e64('0x12')]['name']:null,_0x66faf['user']?_0x66faf[_0x4e64('0x12')]['role']:null);}}));_0x4156ef[_0x4e64('0xa')](ewinston[_0x4e64('0x13')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x9333fa,_0x2aa800){var _0x352eca=_0x4e64('0x14');if(_0x9333fa[_0x4e64('0x15')]&&_0x9333fa['body'][_0x4e64('0x16')]&&_0x9333fa[_0x4e64('0x15')][_0x4e64('0x17')]){_0x352eca='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x4e64('0x18')](_0x352eca,_0x9333fa[_0x4e64('0xb')],_0x9333fa[_0x4e64('0xc')][_0x4e64('0xd')]?_0x9333fa[_0x4e64('0xc')][_0x4e64('0xd')]:_0x9333fa[_0x4e64('0xe')][_0x4e64('0xf')]||_0x9333fa['ip'],_0x9333fa[_0x4e64('0x10')],_0x2aa800[_0x4e64('0x11')],_0x2aa800['responseTime'],_0x9333fa[_0x4e64('0x12')]?_0x9333fa[_0x4e64('0x12')]['id']:null,_0x9333fa['user']?_0x9333fa[_0x4e64('0x12')]['name']:null,_0x9333fa['user']?_0x9333fa[_0x4e64('0x12')][_0x4e64('0x19')]:null,_0x9333fa[_0x4e64('0x15')]&&_0x9333fa['body'][_0x4e64('0x16')]?_0x9333fa['body'][_0x4e64('0x16')]:_0x4e64('0x1a'),_0x9333fa[_0x4e64('0x15')]&&_0x9333fa['body'][_0x4e64('0x17')]?_0x9333fa[_0x4e64('0x15')][_0x4e64('0x17')]:'',_0x9333fa[_0x4e64('0x15')]&&_0x9333fa[_0x4e64('0x15')][_0x4e64('0x1b')]?_0x9333fa[_0x4e64('0x15')]['agent_name']:'');},'ignoreRoute':function(_0x83bebc){var _0x29b4f8=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x29b4f8[_0x4e64('0x1c')](_0x83bebc['url']);}}));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x1d'),require(_0x4e64('0x1e')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x1f'),require('./api/voiceChanSpy'));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x20'),require(_0x4e64('0x21')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x22'),require(_0x4e64('0x23')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x24'),require('./api/voiceMusicOnHold'));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x25'),require(_0x4e64('0x26')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x27'),require(_0x4e64('0x28')));_0x4156ef[_0x4e64('0xa')]('/api/screen/recordings',require(_0x4e64('0x29')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x2a'),require(_0x4e64('0x2b')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x2c'),require(_0x4e64('0x2d')));_0x4156ef['use'](_0x4e64('0x2e'),require(_0x4e64('0x2f')));_0x4156ef[_0x4e64('0xa')]('/api/voice/dials/reports',require(_0x4e64('0x30')));_0x4156ef['use'](_0x4e64('0x31'),require(_0x4e64('0x32')));_0x4156ef['use']('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x4156ef[_0x4e64('0xa')]('/api/members/reports',require(_0x4e64('0x33')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x34'),require(_0x4e64('0x35')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x36'),require(_0x4e64('0x37')));_0x4156ef['use'](_0x4e64('0x38'),require('./api/mailServerOut'));_0x4156ef[_0x4e64('0xa')]('/api/mail/accounts',require('./api/mailAccount'));_0x4156ef['use'](_0x4e64('0x39'),require('./api/mailQueue'));_0x4156ef['use'](_0x4e64('0x3a'),require(_0x4e64('0x3b')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x3c'),require(_0x4e64('0x3d')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x3e'),require('./api/mailMessage'));_0x4156ef['use']('/api/mail/applications',require(_0x4e64('0x3f')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x40'),require(_0x4e64('0x41')));_0x4156ef['use'](_0x4e64('0x42'),require(_0x4e64('0x43')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x44'),require(_0x4e64('0x45')));_0x4156ef['use']('/api/fax/accounts',require(_0x4e64('0x46')));_0x4156ef['use'](_0x4e64('0x47'),require(_0x4e64('0x48')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x49'),require(_0x4e64('0x4a')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x4b'),require('./api/faxMessage'));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x4c'),require(_0x4e64('0x4d')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x4e'),require(_0x4e64('0x4f')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x50'),require('./api/smsAccount'));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x51'),require('./api/smsApplication'));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x52'),require('./api/smsInteraction'));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x53'),require(_0x4e64('0x54')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x55'),require('./api/smsQueue'));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x56'),require(_0x4e64('0x57')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x58'),require(_0x4e64('0x59')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x5a'),require('./api/openchannelInteraction'));_0x4156ef['use'](_0x4e64('0x5b'),require(_0x4e64('0x5c')));_0x4156ef[_0x4e64('0xa')]('/api/openchannel/queues',require(_0x4e64('0x5d')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x5e'),require(_0x4e64('0x5f')));_0x4156ef[_0x4e64('0xa')]('/api/openchannel/reports/queue',require(_0x4e64('0x60')));_0x4156ef['use'](_0x4e64('0x61'),require(_0x4e64('0x62')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x63'),require('./api/chatInteraction'));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x64'),require(_0x4e64('0x65')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x66'),require('./api/chatOfflineMessage'));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x67'),require(_0x4e64('0x68')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x69'),require(_0x4e64('0x6a')));_0x4156ef['use'](_0x4e64('0x6b'),require(_0x4e64('0x6c')));_0x4156ef[_0x4e64('0xa')]('/api/cm/companies',require(_0x4e64('0x6d')));_0x4156ef[_0x4e64('0xa')]('/api/cm/contacts',require(_0x4e64('0x6e')));_0x4156ef['use'](_0x4e64('0x6f'),require('./api/cmHopper'));_0x4156ef[_0x4e64('0xa')]('/api/cm/hopper_black',require(_0x4e64('0x70')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x71'),require(_0x4e64('0x72')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x73'),require(_0x4e64('0x74')));_0x4156ef['use'](_0x4e64('0x75'),require(_0x4e64('0x76')));_0x4156ef[_0x4e64('0xa')]('/api/actions',require('./api/action'));_0x4156ef[_0x4e64('0xa')]('/api/automations',require(_0x4e64('0x77')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x78'),require(_0x4e64('0x79')));_0x4156ef[_0x4e64('0xa')]('/api/dispositions',require('./api/disposition'));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x7a'),require(_0x4e64('0x7b')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x7c'),require(_0x4e64('0x7d')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x7e'),require('./api/pause'));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x7f'),require(_0x4e64('0x80')));_0x4156ef['use'](_0x4e64('0x81'),require(_0x4e64('0x82')));_0x4156ef['use'](_0x4e64('0x83'),require(_0x4e64('0x84')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x85'),require(_0x4e64('0x86')));_0x4156ef[_0x4e64('0xa')]('/api/tags',require(_0x4e64('0x87')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x88'),require('./api/template'));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x89'),require(_0x4e64('0x8a')));_0x4156ef[_0x4e64('0xa')]('/api/variables',require(_0x4e64('0x8b')));_0x4156ef[_0x4e64('0xa')]('/api/integrations',require(_0x4e64('0x8c')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x8d'),require(_0x4e64('0x8e')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x8f'),require(_0x4e64('0x90')));_0x4156ef[_0x4e64('0xa')]('/api/analytics/default_reports',require(_0x4e64('0x91')));_0x4156ef[_0x4e64('0xa')]('/api/analytics/extracted_reports',require(_0x4e64('0x92')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x93'),require(_0x4e64('0x94')));_0x4156ef[_0x4e64('0xa')]('/api/analytics/field_reports',require(_0x4e64('0x95')));_0x4156ef[_0x4e64('0xa')]('/api/analytics/tree_reports',require(_0x4e64('0x96')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x97'),require(_0x4e64('0x98')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x99'),require('./api/intSalesforceConfiguration'));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x9a'),require(_0x4e64('0x9b')));_0x4156ef['use'](_0x4e64('0x9c'),require(_0x4e64('0x9d')));_0x4156ef[_0x4e64('0xa')]('/api/integrations/sugarcrm/configurations',require(_0x4e64('0x9e')));_0x4156ef[_0x4e64('0xa')]('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x4156ef['use'](_0x4e64('0x9f'),require(_0x4e64('0xa0')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xa1'),require(_0x4e64('0xa2')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xa3'),require(_0x4e64('0xa4')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xa5'),require(_0x4e64('0xa6')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xa7'),require(_0x4e64('0xa8')));_0x4156ef['use']('/api/integrations/zoho/fields',require(_0x4e64('0xa9')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xaa'),require(_0x4e64('0xab')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xac'),require('./api/intZendeskConfiguration'));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xad'),require(_0x4e64('0xae')));_0x4156ef[_0x4e64('0xa')]('/api/integrations/freshdesk/accounts',require('./api/intFreshdeskAccount'));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xaf'),require(_0x4e64('0xb0')));_0x4156ef['use'](_0x4e64('0xb1'),require(_0x4e64('0xb2')));_0x4156ef[_0x4e64('0xa')]('/api/integrations/vtiger/accounts',require(_0x4e64('0xb3')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xb4'),require(_0x4e64('0xb5')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xb6'),require(_0x4e64('0xb7')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xb8'),require('./api/intServicenowAccount'));_0x4156ef[_0x4e64('0xa')]('/api/integrations/servicenow/configurations',require(_0x4e64('0xb9')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xba'),require(_0x4e64('0xbb')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xbc'),require(_0x4e64('0xbd')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xbe'),require(_0x4e64('0xbf')));_0x4156ef[_0x4e64('0xa')]('/api/integrations/dynamics365/fields',require(_0x4e64('0xc0')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xc1'),require(_0x4e64('0xc2')));_0x4156ef['use']('/api/chat/reports/queue',require(_0x4e64('0xc3')));_0x4156ef[_0x4e64('0xa')]('/api/chat/internal/messages',require(_0x4e64('0xc4')));_0x4156ef['use'](_0x4e64('0xc5'),require(_0x4e64('0xc6')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xc7'),require('./api/jscriptyQuestionReport'));_0x4156ef[_0x4e64('0xa')]('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x4156ef['use'](_0x4e64('0xc8'),require(_0x4e64('0xc9')));_0x4156ef['use'](_0x4e64('0xca'),require(_0x4e64('0xcb')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xcc'),require('./api/squareReportDetail'));_0x4156ef[_0x4e64('0xa')]('/api/jscripty/projects',require(_0x4e64('0xcd')));_0x4156ef['use']('/api/settings',require(_0x4e64('0xce')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xcf'),require(_0x4e64('0xd0')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xd1'),require(_0x4e64('0xd2')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xd3'),require(_0x4e64('0xd4')));_0x4156ef[_0x4e64('0xa')]('/api/square/messages',require(_0x4e64('0xd5')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xd6'),require(_0x4e64('0xd7')));_0x4156ef[_0x4e64('0xa')]('/api/license',require(_0x4e64('0xd8')));_0x4156ef['use']('/api/campaigns',require(_0x4e64('0xd9')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xda'),require('./api/migration'));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xdb'),require('./api/attachment'));_0x4156ef['use'](_0x4e64('0xdc'),require(_0x4e64('0xdd')));_0x4156ef[_0x4e64('0xa')]('/api/mail/reports/transfer',require(_0x4e64('0xde')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xdf'),require(_0x4e64('0xe0')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xe1'),require(_0x4e64('0xe2')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xe3'),require(_0x4e64('0xe4')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xe5'),require(_0x4e64('0xe6')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xe7'),require(_0x4e64('0xe8')));_0x4156ef['use'](_0x4e64('0xe9'),require(_0x4e64('0xea')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xeb'),require('./api/userProfile'));_0x4156ef['use']('/api/userProfile/sections',require('./api/userProfileSection'));_0x4156ef[_0x4e64('0xa')]('/api/userProfile/resources',require(_0x4e64('0xec')));_0x4156ef[_0x4e64('0xa')]('/api/auth/local',require('./api/authLocal'));_0x4156ef['use'](_0x4e64('0xed'),require(_0x4e64('0xee')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xef'),require(_0x4e64('0xf0')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xf1'),require(_0x4e64('0xf2')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xf3'),require(_0x4e64('0xf4')));_0x4156ef['use'](_0x4e64('0xf5'),require(_0x4e64('0xf6')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xf7'),require(_0x4e64('0xf8')));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xf9'),express[_0x4e64('0xfa')](path[_0x4e64('0xfb')](config[_0x4e64('0xfc')],_0x4e64('0xf9'))));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xfd'),express[_0x4e64('0xfa')](path[_0x4e64('0xfb')](config['root'],_0x4e64('0xfd'))));_0x4156ef[_0x4e64('0xa')](_0x4e64('0xfe'),express[_0x4e64('0xfa')](path['join'](config[_0x4e64('0xfc')],_0x4e64('0xfe'))));_0x4156ef[_0x4e64('0xa')]('/snippet',express[_0x4e64('0xfa')](path['join'](config[_0x4e64('0xfc')],_0x4e64('0xff'),_0x4e64('0x100'))));_0x4156ef[_0x4e64('0xa')](_0x4e64('0x101'),express['static'](path[_0x4e64('0xfb')](config['root'],_0x4e64('0x102'))));_0x4156ef[_0x4e64('0x103')](_0x4e64('0x104'))['get'](errors[0x194]);_0x4156ef['route']('/*')['get'](function(_0x30f024,_0x5f3153){_0x5f3153[_0x4e64('0x105')](path[_0x4e64('0x106')](_0x4156ef[_0x4e64('0x107')](_0x4e64('0x108'))+_0x4e64('0x109')));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index cccd508..f139f56 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf987=['../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueueReport/faxQueueReport.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/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.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/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','server','http','rpc','port','localhost','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc'];(function(_0x362c44,_0x2c020d){var _0x477137=function(_0x2ac891){while(--_0x2ac891){_0x362c44['push'](_0x362c44['shift']());}};_0x477137(++_0x2c020d);}(_0xf987,0x18a));var _0x7f98=function(_0x78a88a,_0x49b19b){_0x78a88a=_0x78a88a-0x0;var _0x2111e4=_0xf987[_0x78a88a];return _0x2111e4;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var _=require(_0x7f98('0x0'));var config=require(_0x7f98('0x1'));exports['listen']=function(){return new BPromise(function(_0x46c60f,_0x13b552){var _0xce9e6c={};_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x3')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x4')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x5')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x6')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require('../api/voiceCallReport/voiceCallReport.rpc'));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x7')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x8')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require('../api/memberReport/memberReport.rpc'));_0xce9e6c=_['merge'](_0xce9e6c,require(_0x7f98('0x9')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0xa')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require('../api/mailServerIn/mailServerIn.rpc'));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0xb')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0xc')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0xd')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0xe')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0xf')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x10')));_0xce9e6c=_['merge'](_0xce9e6c,require(_0x7f98('0x11')));_0xce9e6c=_['merge'](_0xce9e6c,require('../api/faxApplication/faxApplication.rpc'));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x12')));_0xce9e6c=_['merge'](_0xce9e6c,require('../api/faxMessage/faxMessage.rpc'));_0xce9e6c=_['merge'](_0xce9e6c,require('../api/faxQueue/faxQueue.rpc'));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x13')));_0xce9e6c=_['merge'](_0xce9e6c,require('../api/smsAccount/smsAccount.rpc'));_0xce9e6c=_['merge'](_0xce9e6c,require(_0x7f98('0x14')));_0xce9e6c=_['merge'](_0xce9e6c,require(_0x7f98('0x15')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x16')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x17')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x18')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x19')));_0xce9e6c=_['merge'](_0xce9e6c,require('../api/openchannelQueue/openchannelQueue.rpc'));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x1a')));_0xce9e6c=_['merge'](_0xce9e6c,require(_0x7f98('0x1b')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require('../api/chatQueue/chatQueue.rpc'));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x1c')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x1d')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x1e')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x1f')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x20')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x21')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require('../api/interval/interval.rpc'));_0xce9e6c=_['merge'](_0xce9e6c,require(_0x7f98('0x22')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x23')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x24')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x25')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x26')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x27')));_0xce9e6c=_['merge'](_0xce9e6c,require(_0x7f98('0x28')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x29')));_0xce9e6c=_['merge'](_0xce9e6c,require(_0x7f98('0x2a')));_0xce9e6c=_['merge'](_0xce9e6c,require(_0x7f98('0x2b')));_0xce9e6c=_['merge'](_0xce9e6c,require(_0x7f98('0x2c')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x2d')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x2e')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x2f')));_0xce9e6c=_['merge'](_0xce9e6c,require('../api/smsQueueReport/smsQueueReport.rpc'));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x30')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x31')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x32')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require('../api/squareProject/squareProject.rpc'));_0xce9e6c=_['merge'](_0xce9e6c,require(_0x7f98('0x33')));_0xce9e6c=_['merge'](_0xce9e6c,require(_0x7f98('0x34')));_0xce9e6c=_['merge'](_0xce9e6c,require(_0x7f98('0x35')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x36')));_0xce9e6c=_[_0x7f98('0x2')](_0xce9e6c,require(_0x7f98('0x37')));var _0x3af59f=jayson[_0x7f98('0x38')](_0xce9e6c)[_0x7f98('0x39')]();var _0x409913=config[_0x7f98('0x3a')][_0x7f98('0x3b')]||config[_0x7f98('0x3b')]+0x1;var _0x4000ca=config[_0x7f98('0x3a')]['ip']||_0x7f98('0x3c');_0x3af59f['on'](_0x7f98('0x3d'),function(_0x35165d){return _0x13b552(_0x35165d);});_0x3af59f[_0x7f98('0x3e')](_0x409913,_0x4000ca,function(){console[_0x7f98('0x3f')](_0x7f98('0x40'),_0x4000ca,_0x409913);require(_0x7f98('0x41'))[_0x7f98('0x42')]();return _0x46c60f(_0x7f98('0x43')+_0x4000ca+':'+_0x409913);});});}; \ No newline at end of file +var _0x158f=['../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','server','http','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','bluebird','lodash','../config/environment','listen','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.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/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc'];(function(_0x12c7e3,_0x417a84){var _0x348f08=function(_0x3b3052){while(--_0x3b3052){_0x12c7e3['push'](_0x12c7e3['shift']());}};_0x348f08(++_0x417a84);}(_0x158f,0x137));var _0xf158=function(_0x35c26e,_0x1583cc){_0x35c26e=_0x35c26e-0x0;var _0x364f03=_0x158f[_0x35c26e];return _0x364f03;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xf158('0x0'));var _=require(_0xf158('0x1'));var config=require(_0xf158('0x2'));exports[_0xf158('0x3')]=function(){return new BPromise(function(_0x1bbba1,_0x150b19){var _0x1e7add={};_0x1e7add=_['merge'](_0x1e7add,require(_0xf158('0x4')));_0x1e7add=_['merge'](_0x1e7add,require(_0xf158('0x5')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x7')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x8')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x9')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0xa')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0xb')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0xc')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0xd')));_0x1e7add=_['merge'](_0x1e7add,require(_0xf158('0xe')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0xf')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x10')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x11')));_0x1e7add=_['merge'](_0x1e7add,require(_0xf158('0x12')));_0x1e7add=_['merge'](_0x1e7add,require(_0xf158('0x13')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x14')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x15')));_0x1e7add=_['merge'](_0x1e7add,require(_0xf158('0x16')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x17')));_0x1e7add=_['merge'](_0x1e7add,require(_0xf158('0x18')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require('../api/faxInteraction/faxInteraction.rpc'));_0x1e7add=_['merge'](_0x1e7add,require(_0xf158('0x19')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x1a')));_0x1e7add=_['merge'](_0x1e7add,require(_0xf158('0x1b')));_0x1e7add=_['merge'](_0x1e7add,require('../api/smsAccount/smsAccount.rpc'));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x1c')));_0x1e7add=_['merge'](_0x1e7add,require(_0xf158('0x1d')));_0x1e7add=_['merge'](_0x1e7add,require(_0xf158('0x1e')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x1f')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x20')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x21')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x22')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x23')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x24')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x25')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require('../api/chatQueue/chatQueue.rpc'));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require('../api/cmContact/cmContact.rpc'));_0x1e7add=_['merge'](_0x1e7add,require(_0xf158('0x26')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x27')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x28')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x29')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require('../api/interval/interval.rpc'));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x2a')));_0x1e7add=_['merge'](_0x1e7add,require(_0xf158('0x2b')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x2c')));_0x1e7add=_['merge'](_0x1e7add,require(_0xf158('0x2d')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x2e')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x2f')));_0x1e7add=_['merge'](_0x1e7add,require(_0xf158('0x30')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x31')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x32')));_0x1e7add=_['merge'](_0x1e7add,require(_0xf158('0x33')));_0x1e7add=_['merge'](_0x1e7add,require(_0xf158('0x34')));_0x1e7add=_['merge'](_0x1e7add,require(_0xf158('0x35')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x36')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x37')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x38')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require('../api/squareReport/squareReport.rpc'));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x39')));_0x1e7add=_['merge'](_0x1e7add,require(_0xf158('0x3a')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x3b')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x3c')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x3d')));_0x1e7add=_[_0xf158('0x6')](_0x1e7add,require(_0xf158('0x3e')));_0x1e7add=_['merge'](_0x1e7add,require('../api/plugin/plugin.rpc'));var _0x4b9ef8=jayson[_0xf158('0x3f')](_0x1e7add)[_0xf158('0x40')]();var _0x1619a1=config[_0xf158('0x41')][_0xf158('0x42')]||config[_0xf158('0x42')]+0x1;var _0xffb0fa=config[_0xf158('0x41')]['ip']||_0xf158('0x43');_0x4b9ef8['on']('error',function(_0x5f3a97){return _0x150b19(_0x5f3a97);});_0x4b9ef8['listen'](_0x1619a1,_0xffb0fa,function(){console[_0xf158('0x44')](_0xf158('0x45'),_0xffb0fa,_0x1619a1);require(_0xf158('0x46'))[_0xf158('0x47')]();return _0x1bbba1('RPC\x20listening\x20on\x20'+_0xffb0fa+':'+_0x1619a1);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index af1d7e8..f9adf33 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 _0x1b09=['ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','EventEmitter','./reply','call','setEncoding','setTimeout','headers','ready','line','toLowerCase','hangup','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','result=','indexOf','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','prototype','sendRequest','sync','answer','ANSWER','getData','beep','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','SAY\x20NUMBER\x20%s\x20%s','continueAt','extension','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','wait','WAIT'];(function(_0x561108,_0x1d1960){var _0x3bb151=function(_0x22cbb8){while(--_0x22cbb8){_0x561108['push'](_0x561108['shift']());}};_0x3bb151(++_0x1d1960);}(_0x1b09,0x1b9));var _0x91b0=function(_0x13d5bc,_0x3fce3c){_0x13d5bc=_0x13d5bc-0x0;var _0x4b8a40=_0x1b09[_0x13d5bc];return _0x4b8a40;};'use strict';var util=require('util');var _=require(_0x91b0('0x0'));var EventEmitter=require(_0x91b0('0x1'))[_0x91b0('0x2')];var AGIReply=require(_0x91b0('0x3'));var AGIError=require('./error');function AGIChannel(_0x1e077){var _0x4cb851=this,_0x53a697=new AGIReply(),_0xb77495=![],_0x458d8e={};EventEmitter[_0x91b0('0x4')](_0x4cb851);_0x1e077[_0x91b0('0x5')]('utf8');_0x1e077[_0x91b0('0x6')](0x8*0x3c*0x3c*0x3e8);_0x53a697[_0x91b0('0x5')]('utf8');_0x53a697['on'](_0x91b0('0x7'),function(_0x4d6ca4){for(var _0x2268c7 in _0x4d6ca4){_0x4cb851[_0x2268c7]=_0x4d6ca4[_0x2268c7];}_0x4cb851['emit'](_0x91b0('0x8'));});_0x53a697['on'](_0x91b0('0x9'),function(_0x209fed){if(_0x209fed[_0x91b0('0xa')]()==_0x91b0('0xb')){_0x4cb851[_0x91b0('0xc')]('hangup');return;}if(_0x209fed[_0x91b0('0xd')](0x0,0xb)==_0x91b0('0xe')){_0xb77495=!![];}if(_0xb77495){_0x458d8e['rx']+=_0x209fed+'\x0a';if(_0x209fed[_0x91b0('0xf')](_0x91b0('0x10'))!=-0x1){_0xb77495=![];}}else{_0x458d8e['rx']=_0x209fed;}if(_0xb77495){return;}if(typeof _0x458d8e['cb']==_0x91b0('0x11')){var _0x1befe4=_0x458d8e['rx'][_0x91b0('0xd')](0x0,0x3),_0xd9ff7=null,_0x11f401=null;_0x1befe4=parseInt(_0x1befe4);if(isNaN(_0x1befe4)){_0x458d8e['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x91b0('0x12')});return;}if(_0x1befe4!=0xc8){_0x458d8e['cb'](null,{'code':_0x1befe4,'result':-0x1,'extra':'KO'});return;}_0xd9ff7=_0x458d8e['rx'][_0x91b0('0xd')](0x4)['replace'](_0x91b0('0x13'),'');if(_0xd9ff7[_0x91b0('0x14')]('\x20')!=-0x1){_0xd9ff7=_0xd9ff7['substr'](0x0,_0xd9ff7[_0x91b0('0x14')]('\x20'));}if(_['startsWith'](_0xd9ff7,'-1')){_0xd9ff7=parseInt(_0xd9ff7);}_0x11f401=_0x458d8e['rx'][_0x91b0('0x15')]('\x20');if(_0x11f401[_0x91b0('0x16')]==0x3){_0x11f401=_0x11f401[0x2]['substring'](0x1,_0x11f401[0x2]['length']-0x1);}else if(_0x11f401['length']>0x3){var _0x44d4c8=/\((.+)\)/;var _0x5185b2=_0x458d8e['rx'][_0x91b0('0x17')](_0x44d4c8);if(_0x5185b2){_0x11f401=_0x5185b2[0x1];}else{_0x11f401=null;}}else{_0x11f401=null;}_0x458d8e['cb'](null,{'code':_0x1befe4,'result':_0xd9ff7,'extra':_0x11f401});}});_0x1e077['on']('error',function(_0x1eb087){_0x4cb851['emit'](_0x91b0('0x18'),new AGIError('E_AGI_SOCKET_ERROR',_0x1eb087[_0x91b0('0x19')]));});_0x1e077['on'](_0x91b0('0x1a'),function(){_0x4cb851['emit'](_0x91b0('0x1a'),new AGIError(_0x91b0('0x1b')));});_0x1e077['on']('timeout',function(){_0x4cb851[_0x91b0('0xc')]('timeout',new AGIError(_0x91b0('0x1c')));_0x1e077[_0x91b0('0x1d')]();});_0x1e077[_0x91b0('0x1e')](_0x53a697);this[_0x91b0('0x1f')]=function(_0x50b8a5,_0x597782){var _0x50b8a5=_0x50b8a5||'',_0x597782=typeof _0x597782=='function'?_0x597782:new Function();_0x458d8e={'tx':_0x50b8a5,'rx':'','cb':_0x597782};_0x1e077[_0x91b0('0x20')](_0x50b8a5+'\x0a');},this['close']=function(){_0x1e077['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x91b0('0x21')][_0x91b0('0x22')]=function(_0x3a80ca){return this[_0x91b0('0x1f')][_0x91b0('0x23')](this,_0x3a80ca);};AGIChannel[_0x91b0('0x21')][_0x91b0('0x24')]=function(){return this[_0x91b0('0x22')](_0x91b0('0x25'));};AGIChannel[_0x91b0('0x21')][_0x91b0('0x26')]=function(_0x43a443,_0x106f7b,_0x27392f){_0x43a443=_0x43a443===undefined?_0x91b0('0x27'):_0x43a443;_0x106f7b=_0x106f7b===undefined?'5':_0x106f7b;_0x27392f=_0x27392f===undefined?'1':_0x27392f;return this['sendRequest'](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x43a443,_0x106f7b*0x3e8,_0x27392f));};AGIChannel[_0x91b0('0x21')][_0x91b0('0x28')]=function(_0x2875bf){_0x2875bf=_0x2875bf||_0x91b0('0x29');return this['sendRequest'](util[_0x91b0('0x2a')](_0x91b0('0x2b'),_0x2875bf));};AGIChannel[_0x91b0('0x21')][_0x91b0('0x2c')]=function(_0x32d276,_0x1e3630){if(_[_0x91b0('0x2d')](_0x1e3630)){return this[_0x91b0('0x22')](util[_0x91b0('0x2a')](_0x91b0('0x2e'),_0x32d276,_0x1e3630[_0x91b0('0x2f')](',')));}return this[_0x91b0('0x22')](util['format']('EXEC\x20%s\x20%s',_0x32d276,_0x1e3630));};AGIChannel[_0x91b0('0x21')][_0x91b0('0x30')]=function(_0x320d4c){return this[_0x91b0('0x22')](util[_0x91b0('0x2a')]('SET\x20CONTEXT\x20%s',_0x320d4c));};AGIChannel['prototype'][_0x91b0('0x31')]=function(_0x2e4801){return this[_0x91b0('0x22')](util[_0x91b0('0x2a')](_0x91b0('0x32'),_0x2e4801));};AGIChannel[_0x91b0('0x21')][_0x91b0('0x33')]=function(_0x12a609){return this[_0x91b0('0x22')](util[_0x91b0('0x2a')](_0x91b0('0x34'),_0x12a609));};AGIChannel[_0x91b0('0x21')]['hangup']=function(){return this[_0x91b0('0x22')](_0x91b0('0x35'));};AGIChannel['prototype'][_0x91b0('0x36')]=function(_0x5710b0,_0x535ec0){return this[_0x91b0('0x22')](util[_0x91b0('0x2a')](_0x91b0('0x37'),_0x5710b0,_0x535ec0?_0x535ec0[_0x91b0('0x38')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x91b0('0x21')]['sayNumber']=function(_0x22e444,_0x4b699f){return this[_0x91b0('0x22')](util[_0x91b0('0x2a')](_0x91b0('0x39'),_0x22e444,_0x4b699f));};AGIChannel[_0x91b0('0x21')]['sayDigits']=function(_0x310f7b,_0x5801b1){return this['sendRequest'](util[_0x91b0('0x2a')]('SAY\x20DIGITS\x20%s\x20%s',_0x310f7b,_0x5801b1));};AGIChannel[_0x91b0('0x21')]['sayPhonetic']=function(_0x391cd3,_0x359eea){return this[_0x91b0('0x22')](util[_0x91b0('0x2a')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x391cd3,_0x359eea));};AGIChannel[_0x91b0('0x21')][_0x91b0('0x3a')]=function(_0x321ecb,_0x4b7a93,_0xa58bc9){_0x4b7a93=_0x4b7a93||this[_0x91b0('0x3b')];_0xa58bc9=_0xa58bc9||0x1;this[_0x91b0('0x30')](_0x321ecb);this[_0x91b0('0x31')](_0x4b7a93);this[_0x91b0('0x33')](_0xa58bc9);return this[_0x91b0('0x28')](util[_0x91b0('0x2a')]('GOTO\x20%s\x20%s\x20%s',_0x321ecb,_0x4b7a93,_0xa58bc9));};AGIChannel[_0x91b0('0x21')][_0x91b0('0x3c')]=function(_0x486338){return this[_0x91b0('0x22')](util[_0x91b0('0x2a')](_0x91b0('0x3d'),_0x486338));};AGIChannel[_0x91b0('0x21')][_0x91b0('0x3e')]=function(_0x69460f,_0x29d7fb,_0x2aa632,_0x5b2170,_0x52596b,_0x266f62){_0x29d7fb=_0x29d7fb||_0x91b0('0x3f');_0x2aa632=_0x2aa632||'';_0x5b2170=_0x5b2170===undefined?-0x1:_0x5b2170==='-1'?-0x1:_0x5b2170*0x3e8;_0x52596b=_0x52596b===undefined?'':'s='+_0x52596b;_0x266f62=_0x266f62?_0x91b0('0x40'):'';return this[_0x91b0('0x22')](util['format'](_0x91b0('0x41'),_0x69460f,_0x29d7fb,_0x2aa632,_0x5b2170,_0x266f62,_0x52596b));};AGIChannel[_0x91b0('0x21')][_0x91b0('0x42')]=function(_0x4c62f2,_0x49e3e0){_0x49e3e0=_0x49e3e0||'';return this[_0x91b0('0x22')](util[_0x91b0('0x2a')](_0x91b0('0x43'),_0x4c62f2,_0x49e3e0));};AGIChannel[_0x91b0('0x21')]['agi']=function(_0x139c8b){return this[_0x91b0('0x2c')]('AGI',_0x139c8b);};AGIChannel[_0x91b0('0x21')][_0x91b0('0x44')]=function(_0x4cf573){return this[_0x91b0('0x2c')](_0x91b0('0x45'),_0x4cf573);};AGIChannel['prototype'][_0x91b0('0x18')]=function(_0x4710e4,_0x10f760){this[_0x91b0('0x28')](util[_0x91b0('0x2a')](_0x91b0('0x46'),_0x4710e4['id'],_0x4710e4[_0x91b0('0x47')],_0x10f760));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x91b0('0x48')]=AGIChannel; \ No newline at end of file +var _0xcceb=['setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','extension','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','WAIT','noop','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','lodash','events','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','substr','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','timeout','destroy','pipe','write','inherits','prototype','sendRequest','command','sync','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','HANGUP'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcceb,0x13e));var _0xbcce=function(_0x4bae70,_0x1ae678){_0x4bae70=_0x4bae70-0x0;var _0x49f856=_0xcceb[_0x4bae70];return _0x49f856;};'use strict';var util=require('util');var _=require(_0xbcce('0x0'));var EventEmitter=require(_0xbcce('0x1'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0x3a7f60){var _0x15c333=this,_0x232b3b=new AGIReply(),_0x1f1ea3=![],_0x32b606={};EventEmitter[_0xbcce('0x2')](_0x15c333);_0x3a7f60[_0xbcce('0x3')](_0xbcce('0x4'));_0x3a7f60[_0xbcce('0x5')](0x8*0x3c*0x3c*0x3e8);_0x232b3b[_0xbcce('0x3')](_0xbcce('0x4'));_0x232b3b['on'](_0xbcce('0x6'),function(_0x1a643c){for(var _0x53cae2 in _0x1a643c){_0x15c333[_0x53cae2]=_0x1a643c[_0x53cae2];}_0x15c333[_0xbcce('0x7')](_0xbcce('0x8'));});_0x232b3b['on'](_0xbcce('0x9'),function(_0x33ae7a){if(_0x33ae7a['toLowerCase']()==_0xbcce('0xa')){_0x15c333['emit']('hangup');return;}if(_0x33ae7a[_0xbcce('0xb')](0x0,0xb)==_0xbcce('0xc')){_0x1f1ea3=!![];}if(_0x1f1ea3){_0x32b606['rx']+=_0x33ae7a+'\x0a';if(_0x33ae7a[_0xbcce('0xd')](_0xbcce('0xe'))!=-0x1){_0x1f1ea3=![];}}else{_0x32b606['rx']=_0x33ae7a;}if(_0x1f1ea3){return;}if(typeof _0x32b606['cb']==_0xbcce('0xf')){var _0x4d71a8=_0x32b606['rx'][_0xbcce('0xb')](0x0,0x3),_0x22dc89=null,_0x45c3e6=null;_0x4d71a8=parseInt(_0x4d71a8);if(isNaN(_0x4d71a8)){_0x32b606['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xbcce('0x10')});return;}if(_0x4d71a8!=0xc8){_0x32b606['cb'](null,{'code':_0x4d71a8,'result':-0x1,'extra':'KO'});return;}_0x22dc89=_0x32b606['rx']['substring'](0x4)[_0xbcce('0x11')](_0xbcce('0x12'),'');if(_0x22dc89['indexOf']('\x20')!=-0x1){_0x22dc89=_0x22dc89[_0xbcce('0x13')](0x0,_0x22dc89[_0xbcce('0x14')]('\x20'));}if(_[_0xbcce('0x15')](_0x22dc89,'-1')){_0x22dc89=parseInt(_0x22dc89);}_0x45c3e6=_0x32b606['rx'][_0xbcce('0x16')]('\x20');if(_0x45c3e6[_0xbcce('0x17')]==0x3){_0x45c3e6=_0x45c3e6[0x2]['substring'](0x1,_0x45c3e6[0x2][_0xbcce('0x17')]-0x1);}else if(_0x45c3e6[_0xbcce('0x17')]>0x3){var _0x5e09ea=/\((.+)\)/;var _0x5ec77b=_0x32b606['rx'][_0xbcce('0x18')](_0x5e09ea);if(_0x5ec77b){_0x45c3e6=_0x5ec77b[0x1];}else{_0x45c3e6=null;}}else{_0x45c3e6=null;}_0x32b606['cb'](null,{'code':_0x4d71a8,'result':_0x22dc89,'extra':_0x45c3e6});}});_0x3a7f60['on'](_0xbcce('0x19'),function(_0x1eca76){_0x15c333['emit'](_0xbcce('0x19'),new AGIError(_0xbcce('0x1a'),_0x1eca76['code']));});_0x3a7f60['on'](_0xbcce('0x1b'),function(){_0x15c333[_0xbcce('0x7')](_0xbcce('0x1b'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x3a7f60['on'](_0xbcce('0x1c'),function(){_0x15c333[_0xbcce('0x7')](_0xbcce('0x1c'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x3a7f60[_0xbcce('0x1d')]();});_0x3a7f60[_0xbcce('0x1e')](_0x232b3b);this['command']=function(_0xd212b3,_0x5aec2f){var _0xd212b3=_0xd212b3||'',_0x5aec2f=typeof _0x5aec2f==_0xbcce('0xf')?_0x5aec2f:new Function();_0x32b606={'tx':_0xd212b3,'rx':'','cb':_0x5aec2f};_0x3a7f60[_0xbcce('0x1f')](_0xd212b3+'\x0a');},this[_0xbcce('0x1b')]=function(){_0x3a7f60[_0xbcce('0x1d')]();};}util[_0xbcce('0x20')](AGIChannel,EventEmitter);AGIChannel[_0xbcce('0x21')][_0xbcce('0x22')]=function(_0x26d8ab){return this[_0xbcce('0x23')][_0xbcce('0x24')](this,_0x26d8ab);};AGIChannel[_0xbcce('0x21')][_0xbcce('0x25')]=function(){return this[_0xbcce('0x22')](_0xbcce('0x26'));};AGIChannel[_0xbcce('0x21')][_0xbcce('0x27')]=function(_0x22f579,_0x2d24e2,_0x214f55){_0x22f579=_0x22f579===undefined?_0xbcce('0x28'):_0x22f579;_0x2d24e2=_0x2d24e2===undefined?'5':_0x2d24e2;_0x214f55=_0x214f55===undefined?'1':_0x214f55;return this[_0xbcce('0x22')](util[_0xbcce('0x29')](_0xbcce('0x2a'),_0x22f579,_0x2d24e2*0x3e8,_0x214f55));};AGIChannel['prototype']['noop']=function(_0x84c322){_0x84c322=_0x84c322||_0xbcce('0x2b');return this['sendRequest'](util[_0xbcce('0x29')](_0xbcce('0x2c'),_0x84c322));};AGIChannel[_0xbcce('0x21')][_0xbcce('0x2d')]=function(_0x32582f,_0x53c0b5){if(_['isArray'](_0x53c0b5)){return this[_0xbcce('0x22')](util[_0xbcce('0x29')](_0xbcce('0x2e'),_0x32582f,_0x53c0b5[_0xbcce('0x2f')](',')));}return this[_0xbcce('0x22')](util['format']('EXEC\x20%s\x20%s',_0x32582f,_0x53c0b5));};AGIChannel['prototype'][_0xbcce('0x30')]=function(_0x16961b){return this[_0xbcce('0x22')](util[_0xbcce('0x29')](_0xbcce('0x31'),_0x16961b));};AGIChannel[_0xbcce('0x21')]['setExtension']=function(_0x17faad){return this[_0xbcce('0x22')](util['format'](_0xbcce('0x32'),_0x17faad));};AGIChannel['prototype']['setPriority']=function(_0x32054b){return this[_0xbcce('0x22')](util['format']('SET\x20PRIORITY\x20%s',_0x32054b));};AGIChannel['prototype'][_0xbcce('0xa')]=function(){return this[_0xbcce('0x22')](_0xbcce('0x33'));};AGIChannel[_0xbcce('0x21')][_0xbcce('0x34')]=function(_0x39c4ff,_0x5f4ea3){return this[_0xbcce('0x22')](util[_0xbcce('0x29')](_0xbcce('0x35'),_0x39c4ff,_0x5f4ea3?_0x5f4ea3['toString']()[_0xbcce('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xbcce('0x36')]=function(_0x5123af,_0x43011f){return this['sendRequest'](util[_0xbcce('0x29')](_0xbcce('0x37'),_0x5123af,_0x43011f));};AGIChannel[_0xbcce('0x21')][_0xbcce('0x38')]=function(_0xd2116e,_0x376d62){return this[_0xbcce('0x22')](util[_0xbcce('0x29')](_0xbcce('0x39'),_0xd2116e,_0x376d62));};AGIChannel[_0xbcce('0x21')]['sayPhonetic']=function(_0x49cf52,_0x1d654d){return this[_0xbcce('0x22')](util['format']('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x49cf52,_0x1d654d));};AGIChannel['prototype']['continueAt']=function(_0x1b52fe,_0x49ad00,_0x1483f0){_0x49ad00=_0x49ad00||this[_0xbcce('0x3a')];_0x1483f0=_0x1483f0||0x1;this[_0xbcce('0x30')](_0x1b52fe);this['setExtension'](_0x49ad00);this[_0xbcce('0x3b')](_0x1483f0);return this['noop'](util[_0xbcce('0x29')](_0xbcce('0x3c'),_0x1b52fe,_0x49ad00,_0x1483f0));};AGIChannel[_0xbcce('0x21')][_0xbcce('0x3d')]=function(_0xaf42f8){return this[_0xbcce('0x22')](util['format'](_0xbcce('0x3e'),_0xaf42f8));};AGIChannel['prototype'][_0xbcce('0x3f')]=function(_0x5591b4,_0xd8379,_0x174418,_0x28be78,_0x5c5c97,_0x4ac6b4){_0xd8379=_0xd8379||_0xbcce('0x40');_0x174418=_0x174418||'';_0x28be78=_0x28be78===undefined?-0x1:_0x28be78==='-1'?-0x1:_0x28be78*0x3e8;_0x5c5c97=_0x5c5c97===undefined?'':'s='+_0x5c5c97;_0x4ac6b4=_0x4ac6b4?_0xbcce('0x41'):'';return this[_0xbcce('0x22')](util[_0xbcce('0x29')](_0xbcce('0x42'),_0x5591b4,_0xd8379,_0x174418,_0x28be78,_0x4ac6b4,_0x5c5c97));};AGIChannel[_0xbcce('0x21')][_0xbcce('0x43')]=function(_0x388330,_0x5fd1df){_0x5fd1df=_0x5fd1df||'';return this[_0xbcce('0x22')](util[_0xbcce('0x29')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x388330,_0x5fd1df));};AGIChannel[_0xbcce('0x21')][_0xbcce('0x44')]=function(_0x1a1fa6){return this[_0xbcce('0x2d')](_0xbcce('0x45'),_0x1a1fa6);};AGIChannel[_0xbcce('0x21')]['wait']=function(_0xb9c0a2){return this[_0xbcce('0x2d')](_0xbcce('0x46'),_0xb9c0a2);};AGIChannel[_0xbcce('0x21')]['error']=function(_0x8e547d,_0x176533){this[_0xbcce('0x47')](util[_0xbcce('0x29')](_0xbcce('0x48'),_0x8e547d['id'],_0x8e547d['label'],_0x176533));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xbcce('0x49')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 53fa8fc..400fbf6 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 _0xce76=['[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','util','Server\x20error.\x20Code:\x20%s.'];(function(_0x4dd747,_0x2c1d03){var _0x36890e=function(_0x569e66){while(--_0x569e66){_0x4dd747['push'](_0x4dd747['shift']());}};_0x36890e(++_0x2c1d03);}(_0xce76,0x1cc));var _0x6ce7=function(_0x131883,_0x106edc){_0x131883=_0x131883-0x0;var _0x23f4a1=_0xce76[_0x131883];return _0x23f4a1;};'use strict';var util=require(_0x6ce7('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x6ce7('0x1'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x6ce7('0x2'),'E_AGI_SERVER_VOICE_DISABLED':_0x6ce7('0x3'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x6ce7('0x4'),'E_AGI_SOCKET_TIMEOUT':_0x6ce7('0x5'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x6ce7('0x6')};function AGIError(_0x59bda5){var _0x59bda5=_0x59bda5||null,_0x4ba47a=_0x4ba47a||[],_0x419517=0x1,_0x157335='';if(!error[_0x59bda5]){_0x59bda5=_0x6ce7('0x7');}_0x4ba47a[_0x6ce7('0x8')](error[_0x59bda5]);while(arguments[_0x419517]){_0x4ba47a[_0x6ce7('0x8')](arguments[_0x419517]);_0x419517++;}_0x157335=util[_0x6ce7('0x9')][_0x6ce7('0xa')](util,_0x4ba47a);this[_0x6ce7('0xb')]=_0x157335;this[_0x6ce7('0xc')]=_0x59bda5;}module[_0x6ce7('0xd')]=AGIError; \ No newline at end of file +var _0x6528=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','message','name','exports','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.'];(function(_0x537564,_0x56757c){var _0x3bd62a=function(_0x106c21){while(--_0x106c21){_0x537564['push'](_0x537564['shift']());}};_0x3bd62a(++_0x56757c);}(_0x6528,0x15a));var _0x8652=function(_0x1a5680,_0xd1e4f){_0x1a5680=_0x1a5680-0x0;var _0x13d9ea=_0x6528[_0x1a5680];return _0x13d9ea;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x8652('0x0'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x8652('0x1'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x8652('0x2'),'E_AGI_SOCKET_ERROR':_0x8652('0x3'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x8652('0x4'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x8652('0x5'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x2d28ef){var _0x2d28ef=_0x2d28ef||null,_0x534ab7=_0x534ab7||[],_0xacf06f=0x1,_0x4c7d82='';if(!error[_0x2d28ef]){_0x2d28ef=_0x8652('0x6');}_0x534ab7[_0x8652('0x7')](error[_0x2d28ef]);while(arguments[_0xacf06f]){_0x534ab7[_0x8652('0x7')](arguments[_0xacf06f]);_0xacf06f++;}_0x4c7d82=util[_0x8652('0x8')]['apply'](util,_0x534ab7);this[_0x8652('0x9')]=_0x4c7d82;this[_0x8652('0xa')]=_0x2d28ef;}module[_0x8652('0xb')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 09661df..556ea14 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 _0x9f4d=['getdigits','getsecretdigits','vertices','edges','numberOfEdges','addVertex','prototype','addEdge','push','size','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','vswitch','target','default','invalid','agicommand','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','lodash','../../../config/logger','agi','menu'];(function(_0x25a92f,_0x352bf0){var _0x1e43fe=function(_0x467615){while(--_0x467615){_0x25a92f['push'](_0x25a92f['shift']());}};_0x1e43fe(++_0x352bf0);}(_0x9f4d,0xb0));var _0xd9f4=function(_0xcce84a,_0x148a0a){_0xcce84a=_0xcce84a-0x0;var _0x273e9d=_0x9f4d[_0xcce84a];return _0x273e9d;};'use strict';var _=require(_0xd9f4('0x0'));var logger=require(_0xd9f4('0x1'))(_0xd9f4('0x2'));var verticesWithRetry=[_0xd9f4('0x3'),_0xd9f4('0x4'),_0xd9f4('0x5')];var Graph=function(){this[_0xd9f4('0x6')]={};this[_0xd9f4('0x7')]={};this[_0xd9f4('0x8')]=0x0;};Graph['prototype'][_0xd9f4('0x9')]=function(_0x4976fc){this[_0xd9f4('0x6')][_0x4976fc['id']]=_0x4976fc;this[_0xd9f4('0x7')][_0x4976fc['id']]=[];};Graph[_0xd9f4('0xa')][_0xd9f4('0xb')]=function(_0x5cf448,_0x6b13b5,_0x18305f){this['edges'][_0x5cf448][_0xd9f4('0xc')]({'target':_0x6b13b5,'condition':_0x18305f});this['numberOfEdges']+=0x1;};Graph[_0xd9f4('0xa')][_0xd9f4('0xd')]=function(){return _[_0xd9f4('0xd')](this[_0xd9f4('0x6')]);};Graph[_0xd9f4('0xa')]['relations']=function(){return this[_0xd9f4('0x8')];};Graph[_0xd9f4('0xa')][_0xd9f4('0xe')]=function(_0x3b05f5){return this[_0xd9f4('0x6')][_0x3b05f5];};Graph[_0xd9f4('0xa')][_0xd9f4('0xf')]=function(_0x131804,_0x4d8bd2){if(!this[_0xd9f4('0x6')][_0x131804]){return logger[_0xd9f4('0x10')](_0xd9f4('0x11'));}var _0xef7729=_0x4d8bd2(this[_0xd9f4('0x6')][_0x131804]);if(!_0xef7729){return logger[_0xd9f4('0x10')](_0xd9f4('0x12'));}if(this[_0xd9f4('0x7')][_0x131804][_0xd9f4('0x13')]===0x0){return logger[_0xd9f4('0x10')](_0xd9f4('0x14'));}for(var _0x14c78e=0x0,_0x33ca2f=[],_0x5e7da1=![];_0x14c78e\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','root','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','target','addEdge','source','value','getSquareProject','then','catch','createSquareReport','agi_','substring','inspect','debug','variables','stringify','close','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','isUndefined','toString','agicommand\x20not\x20found','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s'];(function(_0x4c926f,_0x14f7a1){var _0x322290=function(_0x415b46){while(--_0x415b46){_0x4c926f['push'](_0x4c926f['shift']());}};_0x322290(++_0x14f7a1);}(_0x0f9f,0x1cc));var _0xf0f9=function(_0x1d72d0,_0x89db32){_0x1d72d0=_0x1d72d0-0x0;var _0x234ae9=_0x0f9f[_0x1d72d0];return _0x234ae9;};'use strict';var parser=require('xml2json');var _=require(_0xf0f9('0x0'));var syncho=require(_0xf0f9('0x1'));var util=require(_0xf0f9('0x2'));var moment=require('moment');var config=require(_0xf0f9('0x3'));var logger=require(_0xf0f9('0x4'))(_0xf0f9('0x5'));var utilLicense=require(_0xf0f9('0x6'));var rpc=require(_0xf0f9('0x7'));var mailRpc=require(_0xf0f9('0x8'));var Graph=require(_0xf0f9('0x9'));var Vertices=require(_0xf0f9('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xf0f9('0x5')]=_[_0xf0f9('0xb')](config['agi'],{'ip':_0xf0f9('0xc'),'port':0x11dd});function connectionHandler(_0x294b42){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x294b42);agiHandler(_0x294b42);}catch(_0x2a9c6b){logger[_0xf0f9('0xd')](_0x2a9c6b[_0xf0f9('0xe')]);}});});}function listeningHandler(){console['log'](_0xf0f9('0xf'),config[_0xf0f9('0x5')][_0xf0f9('0x10')]);logger['info'](util['format'](_0xf0f9('0x11'),config[_0xf0f9('0x5')]['ip'],config[_0xf0f9('0x5')][_0xf0f9('0x10')]));}function errorHandler(_0x2708e1){if(_0x2708e1&&_0x2708e1[_0xf0f9('0x12')]&&_0x2708e1[_0xf0f9('0x13')]){logger['error'](util[_0xf0f9('0x14')](_0xf0f9('0x15'),_0x2708e1[_0xf0f9('0x12')],_0x2708e1[_0xf0f9('0x13')]));}else{logger[_0xf0f9('0xd')](util['format'](_0xf0f9('0x16'),_0x2708e1[_0xf0f9('0xe')]));}}function closeHandler(){logger[_0xf0f9('0x17')](util[_0xf0f9('0x14')](_0xf0f9('0x18'),this[_0xf0f9('0x19')],this[_0xf0f9('0x1a')],this[_0xf0f9('0x1b')],this[_0xf0f9('0x1c')],this[_0xf0f9('0x1d')]));try{createSquareReport(this);}catch(_0x4d3534){logger['error'](_0x4d3534[_0xf0f9('0xe')]);}}function timeoutHandler(){logger[_0xf0f9('0x17')](util['format'](_0xf0f9('0x1e'),this['arg_1'],this['calleridname'],this[_0xf0f9('0x1b')],this[_0xf0f9('0x1c')],this[_0xf0f9('0x1d')]));}function hangupHandler(){logger[_0xf0f9('0x17')](util[_0xf0f9('0x14')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this['calleridname'],this[_0xf0f9('0x1b')],this[_0xf0f9('0x1c')],this[_0xf0f9('0x1d')]));this['evtHangup']=!![];}function getRoot(_0x4a8726){return parser[_0xf0f9('0x1f')](_0x4a8726,{'object':!![]})['mxGraphModel'][_0xf0f9('0x20')];}function addVertex(_0x414f87,_0x173c79,_0x570c68){_0x173c79[_0xf0f9('0x21')]=_0x570c68;if(_0x173c79[_0xf0f9('0x22')](_0xf0f9('0x23'))){_0x173c79['maxRetry']=parseInt(_0x173c79[_0xf0f9('0x23')],0xa);}_0x414f87[_0xf0f9('0x24')](_[_0xf0f9('0x25')](_0x173c79,_0xf0f9('0x26')));}function initGraph(_0x16f639,_0x19d750){var _0x5df7f5=new Graph();for(var _0x28e1f6 in _0x16f639){if(_0x16f639['hasOwnProperty'](_0x28e1f6)){if(_[_0xf0f9('0x27')](_0x16f639[_0x28e1f6])){for(var _0x30e85c=0x0;_0x30e85c<_0x16f639[_0x28e1f6]['length'];_0x30e85c+=0x1){addVertex(_0x5df7f5,_0x16f639[_0x28e1f6][_0x30e85c],_0x28e1f6);}}else{addVertex(_0x5df7f5,_0x16f639[_0x28e1f6],_0x28e1f6);}}}for(var _0x4b75b2=0x0;_0x4b75b2<_0x19d750[_0xf0f9('0x28')];_0x4b75b2+=0x1){if(_0x19d750[_0x4b75b2]['source']&&_0x19d750[_0x4b75b2][_0xf0f9('0x29')]){_0x5df7f5[_0xf0f9('0x2a')](_0x19d750[_0x4b75b2][_0xf0f9('0x2b')],_0x19d750[_0x4b75b2][_0xf0f9('0x29')],_0x19d750[_0x4b75b2][_0xf0f9('0x2c')]);}}return _0x5df7f5;}function getSquareProject(_0x39cd34,_0x1377ed){rpc[_0xf0f9('0x2d')](_0x39cd34)[_0xf0f9('0x2e')](function(_0x4e4e08){_0x1377ed(null,_0x4e4e08);})[_0xf0f9('0x2f')](function(_0x28da31){_0x1377ed(null,_0x28da31);});}function createSquareReport(_0x534083,_0x48ef2a){rpc[_0xf0f9('0x30')](_0x534083)['then'](function(_0x483a8c){if(_0x48ef2a){_0x48ef2a(null,_0x483a8c);}})[_0xf0f9('0x2f')](function(_0x490e91){if(_0x48ef2a){_0x48ef2a(null,_0x490e91);}});}function setChannelVariables(_0x31b6c4){for(var _0xf9b6a8 in _0x31b6c4){if(_0x31b6c4['hasOwnProperty'](_0xf9b6a8)){if(_0xf9b6a8['indexOf'](_0xf0f9('0x31'))===0x0){_0x31b6c4[_0xf9b6a8[_0xf0f9('0x32')](0x4)]=_0x31b6c4[_0xf9b6a8];delete _0x31b6c4[_0xf9b6a8];}}}}function getLogFromObject(_0x3393bd){return util[_0xf0f9('0x33')](_0x3393bd,{'showHidden':![],'depth':null});}function agiHandler(_0x278192){var _0x1c03ad,_0x1b784a,_0x30bc8e,_0x3c92f7,_0xaf9500;logger[_0xf0f9('0x34')](_0xf0f9('0x35'),JSON[_0xf0f9('0x36')](_0x278192,null,0x2));logger['info'](util[_0xf0f9('0x14')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x278192[_0xf0f9('0x19')],_0x278192[_0xf0f9('0x1a')],_0x278192[_0xf0f9('0x1b')],_0x278192[_0xf0f9('0x1c')],_0x278192[_0xf0f9('0x1d')]));_0x278192['on'](_0xf0f9('0xd'),errorHandler);_0x278192['on'](_0xf0f9('0x37'),closeHandler);_0x278192['on']('timeout',timeoutHandler);_0x278192['evtHangup']=![];_0x278192['on'](_0xf0f9('0x38'),hangupHandler);var _0x3b37c2=getSquareProject[_0xf0f9('0x39')](null,_0x278192[_0xf0f9('0x19')]);if(_0x3b37c2){if(_0x3b37c2[_0xf0f9('0x3a')]){_0x1c03ad=getRoot(_0x3b37c2['production']);if(_0x1c03ad&&_0x1c03ad[_0xf0f9('0x3b')]){logger[_0xf0f9('0x34')](_0xf0f9('0x20'),JSON[_0xf0f9('0x36')](_0x1c03ad,null,0x2));_0x278192[_0xf0f9('0x3c')]=moment()['format'](_0xf0f9('0x3d'));_0x1b784a=initGraph(_[_0xf0f9('0x25')](_0x1c03ad,_0xf0f9('0x26')),_0x1c03ad[_0xf0f9('0x26')]);_0x30bc8e=new Vertices(_0x278192,rpc,mailRpc);logger[_0xf0f9('0x17')](util[_0xf0f9('0x14')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x278192[_0xf0f9('0x19')],_0x278192[_0xf0f9('0x1a')],_0x278192[_0xf0f9('0x1b')],_0x278192['dnid'],_0x278192[_0xf0f9('0x1d')]));_0x1b784a[_0xf0f9('0x3e')](_0x1c03ad[_0xf0f9('0x3b')]['id'],function(_0xa2b82b){try{_0xa2b82b=_0x30bc8e[_0xf0f9('0x3f')](_0xa2b82b);logger[_0xf0f9('0x34')](_0xf0f9('0x40'),JSON[_0xf0f9('0x36')](_0xa2b82b,null,0x2));if(_0xa2b82b[_0xf0f9('0x21')]===_0xf0f9('0x41')){logger[_0xf0f9('0x17')](_0xf0f9('0x42'));_0x278192[_0xf0f9('0x43')]=_0xa2b82b['context']||_0x278192['context'];_0x278192[_0xf0f9('0x44')]=_0xa2b82b['extension'];_0x278192['priority']=_0xa2b82b['priority']?_0xa2b82b[_0xf0f9('0x45')]-0x1:0x1;return null;}else if(_0xa2b82b&&_0x30bc8e[_0xa2b82b[_0xf0f9('0x21')]]){_0xaf9500=_0x30bc8e[_0xa2b82b[_0xf0f9('0x21')]](_0xa2b82b);logger[_0xf0f9('0x17')](_0xf0f9('0x46'),JSON[_0xf0f9('0x36')](_0xaf9500,null,0x2));if(_0xaf9500&&_0xaf9500[_0xf0f9('0x47')]===AGI_CODE_SUCCESS&&_0xaf9500[_0xf0f9('0x48')]!==AGI_RESULT_ERROR&&!_0x278192[_0xf0f9('0x49')]){logger['debug'](_0xf0f9('0x46'),getLogFromObject(_0xaf9500));return _[_0xf0f9('0x4a')](_0xaf9500[_0xf0f9('0x48')])?null:_0xaf9500['result'][_0xf0f9('0x4b')]();}else{logger[_0xf0f9('0xd')](_0xf0f9('0x46'),getLogFromObject(_0xaf9500));return null;}}else{logger['error'](_0xf0f9('0x4c'));return null;}}catch(_0x44d56e){logger['error'](_0x44d56e[_0xf0f9('0xe')]);return null;}});if(_0x1c03ad[_0xf0f9('0x4d')]){logger[_0xf0f9('0x17')](util[_0xf0f9('0x14')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x278192[_0xf0f9('0x19')],_0x278192[_0xf0f9('0x1a')],_0x278192[_0xf0f9('0x1b')],_0x278192[_0xf0f9('0x1c')],_0x278192[_0xf0f9('0x1d')]));_0x1b784a[_0xf0f9('0x3e')](_0x1c03ad['finally']['id'],function(_0x27cbb1){try{_0x27cbb1=_0x30bc8e['clear'](_0x27cbb1);logger[_0xf0f9('0x34')](_0xf0f9('0x40'),JSON[_0xf0f9('0x36')](_0x27cbb1,null,0x2));if(_0x27cbb1&&_0x30bc8e[_0x27cbb1[_0xf0f9('0x21')]]){_0xaf9500=_0x30bc8e[_0x27cbb1[_0xf0f9('0x21')]](_0x27cbb1);if(_0xaf9500){logger[_0xf0f9('0x34')](_0xf0f9('0x46'),getLogFromObject(_0xaf9500));return _[_0xf0f9('0x4a')](_0xaf9500[_0xf0f9('0x48')])?null:_0xaf9500[_0xf0f9('0x48')][_0xf0f9('0x4b')]();}else{logger[_0xf0f9('0xd')](_0xf0f9('0x46'),getLogFromObject(_0xaf9500));return null;}}else{logger[_0xf0f9('0xd')](_0xf0f9('0x4c'));return null;}}catch(_0x3cb91a){logger[_0xf0f9('0xd')](_0x3cb91a[_0xf0f9('0xe')]);return null;}});}logger[_0xf0f9('0x17')](util[_0xf0f9('0x14')](_0xf0f9('0x4e'),_0x278192[_0xf0f9('0x19')],_0x278192[_0xf0f9('0x1a')],_0x278192[_0xf0f9('0x1b')],_0x278192['dnid'],_0x278192['uniqueid']));logger[_0xf0f9('0x17')](util['format'](_0xf0f9('0x4f'),_0x278192[_0xf0f9('0x43')],_0x278192[_0xf0f9('0x44')],parseInt(_0x278192['priority'],0xa)+0x1));_0x278192[_0xf0f9('0x50')](_0x278192['context'],_0x278192[_0xf0f9('0x44')],parseInt(_0x278192[_0xf0f9('0x45')],0xa)+0x1);_0x278192[_0xf0f9('0x37')]();}}else{logger[_0xf0f9('0xd')](util[_0xf0f9('0x14')]('Project\x20%s\x20not\x20published',_0x278192[_0xf0f9('0x19')]));_0x278192['continueAt'](_0x278192[_0xf0f9('0x43')],_0x278192[_0xf0f9('0x44')],parseInt(_0x278192[_0xf0f9('0x45')],0xa)+0x1);_0x278192[_0xf0f9('0x37')]();}}else{logger[_0xf0f9('0xd')](util['format'](_0xf0f9('0x51'),_0x278192[_0xf0f9('0x19')]));_0x278192[_0xf0f9('0x50')](_0x278192[_0xf0f9('0x43')],_0x278192[_0xf0f9('0x44')],parseInt(_0x278192[_0xf0f9('0x45')],0xa)+0x1);_0x278192[_0xf0f9('0x37')]();}}function main(){var _0x26c1d6;return utilLicense[_0xf0f9('0x52')]()[_0xf0f9('0x2e')](function(_0x2884f1){if(_0x2884f1){if(_0x2884f1[_0xf0f9('0x53')]){if(_0x2884f1[_0xf0f9('0x54')]&&_0x2884f1[_0xf0f9('0x54')]>0x0){logger['info'](util[_0xf0f9('0x14')](_0xf0f9('0x55'),_0x2884f1[_0xf0f9('0x54')]));_0x26c1d6=_0x2884f1['callysquare'];}else{logger[_0xf0f9('0x17')](_0xf0f9('0x56'));}}else{logger[_0xf0f9('0x17')](_0xf0f9('0x57'));_0x26c1d6=-0x1;}}})[_0xf0f9('0x2f')](function(_0x586022){logger[_0xf0f9('0xd')](_0xf0f9('0x58'),_0x586022[_0xf0f9('0xe')]);})[_0xf0f9('0x4d')](function(){var _0x2807f9=require(_0xf0f9('0x59'))(config[_0xf0f9('0x5')][_0xf0f9('0x10')],config[_0xf0f9('0x5')]['ip'],_0x26c1d6);_0x2807f9['on'](_0xf0f9('0xd'),errorHandler);_0x2807f9['on']('listening',listeningHandler);_0x2807f9['on'](_0xf0f9('0x5a'),connectionHandler);_0x2807f9['on'](_0xf0f9('0x37'),closeHandler);});}main(); \ No newline at end of file +var _0x4bc3=['util','moment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','defaults','nextTick','error','stack','log','port','info','format','name','[%s]\x20%s','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','target','addEdge','source','value','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','debug','variables','stringify','close','timeout','sync','production','start','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x4bc3,0x16e));var _0x34bc=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4bc3[_0xfae23b];return _0x200640;};'use strict';var parser=require(_0x34bc('0x0'));var _=require(_0x34bc('0x1'));var syncho=require('syncho');var util=require(_0x34bc('0x2'));var moment=require(_0x34bc('0x3'));var config=require('../../config/environment');var logger=require(_0x34bc('0x4'))(_0x34bc('0x5'));var utilLicense=require(_0x34bc('0x6'));var rpc=require(_0x34bc('0x7'));var mailRpc=require(_0x34bc('0x8'));var Graph=require(_0x34bc('0x9'));var Vertices=require(_0x34bc('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x34bc('0xb')](config['agi'],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x18a01c){process[_0x34bc('0xc')](function(){syncho(function(){try{setChannelVariables(_0x18a01c);agiHandler(_0x18a01c);}catch(_0x1f72d8){logger[_0x34bc('0xd')](_0x1f72d8[_0x34bc('0xe')]);}});});}function listeningHandler(){console[_0x34bc('0xf')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config['agi'][_0x34bc('0x10')]);logger[_0x34bc('0x11')](util[_0x34bc('0x12')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x34bc('0x5')]['ip'],config['agi'][_0x34bc('0x10')]));}function errorHandler(_0x124b87){if(_0x124b87&&_0x124b87[_0x34bc('0x13')]&&_0x124b87['message']){logger[_0x34bc('0xd')](util['format'](_0x34bc('0x14'),_0x124b87[_0x34bc('0x13')],_0x124b87[_0x34bc('0x15')]));}else{logger['error'](util['format'](_0x34bc('0x16'),_0x124b87['stack']));}}function closeHandler(){logger[_0x34bc('0x11')](util[_0x34bc('0x12')](_0x34bc('0x17'),this[_0x34bc('0x18')],this[_0x34bc('0x19')],this[_0x34bc('0x1a')],this['dnid'],this['uniqueid']));try{createSquareReport(this);}catch(_0x5a5895){logger[_0x34bc('0xd')](_0x5a5895[_0x34bc('0xe')]);}}function timeoutHandler(){logger[_0x34bc('0x11')](util[_0x34bc('0x12')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x34bc('0x18')],this[_0x34bc('0x19')],this['callerid'],this[_0x34bc('0x1b')],this[_0x34bc('0x1c')]));}function hangupHandler(){logger['info'](util[_0x34bc('0x12')](_0x34bc('0x1d'),this[_0x34bc('0x18')],this[_0x34bc('0x19')],this[_0x34bc('0x1a')],this[_0x34bc('0x1b')],this['uniqueid']));this[_0x34bc('0x1e')]=!![];}function getRoot(_0x3c9939){return parser[_0x34bc('0x1f')](_0x3c9939,{'object':!![]})['mxGraphModel']['root'];}function addVertex(_0x358d51,_0x1b820a,_0x4263de){_0x1b820a[_0x34bc('0x20')]=_0x4263de;if(_0x1b820a[_0x34bc('0x21')](_0x34bc('0x22'))){_0x1b820a[_0x34bc('0x23')]=parseInt(_0x1b820a[_0x34bc('0x22')],0xa);}_0x358d51[_0x34bc('0x24')](_[_0x34bc('0x25')](_0x1b820a,_0x34bc('0x26')));}function initGraph(_0x1edcb0,_0x4fd589){var _0x43e527=new Graph();for(var _0x48ec13 in _0x1edcb0){if(_0x1edcb0['hasOwnProperty'](_0x48ec13)){if(_[_0x34bc('0x27')](_0x1edcb0[_0x48ec13])){for(var _0x5332c8=0x0;_0x5332c8<_0x1edcb0[_0x48ec13][_0x34bc('0x28')];_0x5332c8+=0x1){addVertex(_0x43e527,_0x1edcb0[_0x48ec13][_0x5332c8],_0x48ec13);}}else{addVertex(_0x43e527,_0x1edcb0[_0x48ec13],_0x48ec13);}}}for(var _0x446b58=0x0;_0x446b58<_0x4fd589[_0x34bc('0x28')];_0x446b58+=0x1){if(_0x4fd589[_0x446b58]['source']&&_0x4fd589[_0x446b58][_0x34bc('0x29')]){_0x43e527[_0x34bc('0x2a')](_0x4fd589[_0x446b58][_0x34bc('0x2b')],_0x4fd589[_0x446b58][_0x34bc('0x29')],_0x4fd589[_0x446b58][_0x34bc('0x2c')]);}}return _0x43e527;}function getSquareProject(_0x33bf46,_0x520fd4){rpc[_0x34bc('0x2d')](_0x33bf46)[_0x34bc('0x2e')](function(_0x22aacc){_0x520fd4(null,_0x22aacc);})[_0x34bc('0x2f')](function(_0x2241b4){_0x520fd4(null,_0x2241b4);});}function createSquareReport(_0xd92957,_0x5b37de){rpc[_0x34bc('0x30')](_0xd92957)['then'](function(_0x530748){if(_0x5b37de){_0x5b37de(null,_0x530748);}})[_0x34bc('0x2f')](function(_0x540aa3){if(_0x5b37de){_0x5b37de(null,_0x540aa3);}});}function setChannelVariables(_0x1e8445){for(var _0x2ffd4b in _0x1e8445){if(_0x1e8445[_0x34bc('0x21')](_0x2ffd4b)){if(_0x2ffd4b[_0x34bc('0x31')](_0x34bc('0x32'))===0x0){_0x1e8445[_0x2ffd4b[_0x34bc('0x33')](0x4)]=_0x1e8445[_0x2ffd4b];delete _0x1e8445[_0x2ffd4b];}}}}function getLogFromObject(_0x2f0ce5){return util['inspect'](_0x2f0ce5,{'showHidden':![],'depth':null});}function agiHandler(_0xbd59f9){var _0x3a5a74,_0xc0a30e,_0x3224c7,_0x360126,_0x5c7e56;logger[_0x34bc('0x34')](_0x34bc('0x35'),JSON[_0x34bc('0x36')](_0xbd59f9,null,0x2));logger[_0x34bc('0x11')](util[_0x34bc('0x12')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0xbd59f9['arg_1'],_0xbd59f9[_0x34bc('0x19')],_0xbd59f9[_0x34bc('0x1a')],_0xbd59f9[_0x34bc('0x1b')],_0xbd59f9[_0x34bc('0x1c')]));_0xbd59f9['on']('error',errorHandler);_0xbd59f9['on'](_0x34bc('0x37'),closeHandler);_0xbd59f9['on'](_0x34bc('0x38'),timeoutHandler);_0xbd59f9[_0x34bc('0x1e')]=![];_0xbd59f9['on']('hangup',hangupHandler);var _0x37cd30=getSquareProject[_0x34bc('0x39')](null,_0xbd59f9[_0x34bc('0x18')]);if(_0x37cd30){if(_0x37cd30[_0x34bc('0x3a')]){_0x3a5a74=getRoot(_0x37cd30['production']);if(_0x3a5a74&&_0x3a5a74[_0x34bc('0x3b')]){logger[_0x34bc('0x34')](_0x34bc('0x3c'),JSON['stringify'](_0x3a5a74,null,0x2));_0xbd59f9[_0x34bc('0x3d')]=moment()[_0x34bc('0x12')](_0x34bc('0x3e'));_0xc0a30e=initGraph(_[_0x34bc('0x25')](_0x3a5a74,_0x34bc('0x26')),_0x3a5a74['mxCell']);_0x3224c7=new Vertices(_0xbd59f9,rpc,mailRpc);logger[_0x34bc('0x11')](util[_0x34bc('0x12')](_0x34bc('0x3f'),_0xbd59f9[_0x34bc('0x18')],_0xbd59f9[_0x34bc('0x19')],_0xbd59f9['callerid'],_0xbd59f9[_0x34bc('0x1b')],_0xbd59f9['uniqueid']));_0xc0a30e[_0x34bc('0x40')](_0x3a5a74[_0x34bc('0x3b')]['id'],function(_0xfaa92d){try{_0xfaa92d=_0x3224c7[_0x34bc('0x41')](_0xfaa92d);logger['debug'](_0x34bc('0x42'),JSON[_0x34bc('0x36')](_0xfaa92d,null,0x2));if(_0xfaa92d['agicommand']===_0x34bc('0x43')){logger[_0x34bc('0x11')](_0x34bc('0x44'));_0xbd59f9['context']=_0xfaa92d[_0x34bc('0x45')]||_0xbd59f9[_0x34bc('0x45')];_0xbd59f9[_0x34bc('0x46')]=_0xfaa92d[_0x34bc('0x46')];_0xbd59f9[_0x34bc('0x47')]=_0xfaa92d[_0x34bc('0x47')]?_0xfaa92d[_0x34bc('0x47')]-0x1:0x1;return null;}else if(_0xfaa92d&&_0x3224c7[_0xfaa92d[_0x34bc('0x20')]]){_0x5c7e56=_0x3224c7[_0xfaa92d[_0x34bc('0x20')]](_0xfaa92d);logger[_0x34bc('0x11')](_0x34bc('0x48'),JSON['stringify'](_0x5c7e56,null,0x2));if(_0x5c7e56&&_0x5c7e56['code']===AGI_CODE_SUCCESS&&_0x5c7e56[_0x34bc('0x49')]!==AGI_RESULT_ERROR&&!_0xbd59f9[_0x34bc('0x1e')]){logger[_0x34bc('0x34')](_0x34bc('0x48'),getLogFromObject(_0x5c7e56));return _[_0x34bc('0x4a')](_0x5c7e56[_0x34bc('0x49')])?null:_0x5c7e56['result'][_0x34bc('0x4b')]();}else{logger['error'](_0x34bc('0x48'),getLogFromObject(_0x5c7e56));return null;}}else{logger[_0x34bc('0xd')](_0x34bc('0x4c'));return null;}}catch(_0x4ba4eb){logger[_0x34bc('0xd')](_0x4ba4eb[_0x34bc('0xe')]);return null;}});if(_0x3a5a74[_0x34bc('0x4d')]){logger[_0x34bc('0x11')](util[_0x34bc('0x12')](_0x34bc('0x4e'),_0xbd59f9[_0x34bc('0x18')],_0xbd59f9[_0x34bc('0x19')],_0xbd59f9[_0x34bc('0x1a')],_0xbd59f9[_0x34bc('0x1b')],_0xbd59f9[_0x34bc('0x1c')]));_0xc0a30e[_0x34bc('0x40')](_0x3a5a74['finally']['id'],function(_0x56494f){try{_0x56494f=_0x3224c7[_0x34bc('0x41')](_0x56494f);logger[_0x34bc('0x34')](_0x34bc('0x42'),JSON['stringify'](_0x56494f,null,0x2));if(_0x56494f&&_0x3224c7[_0x56494f['agicommand']]){_0x5c7e56=_0x3224c7[_0x56494f[_0x34bc('0x20')]](_0x56494f);if(_0x5c7e56){logger[_0x34bc('0x34')](_0x34bc('0x48'),getLogFromObject(_0x5c7e56));return _['isUndefined'](_0x5c7e56[_0x34bc('0x49')])?null:_0x5c7e56[_0x34bc('0x49')]['toString']();}else{logger[_0x34bc('0xd')]('response',getLogFromObject(_0x5c7e56));return null;}}else{logger[_0x34bc('0xd')]('agicommand\x20not\x20found');return null;}}catch(_0x281d6f){logger[_0x34bc('0xd')](_0x281d6f[_0x34bc('0xe')]);return null;}});}logger[_0x34bc('0x11')](util['format'](_0x34bc('0x4f'),_0xbd59f9[_0x34bc('0x18')],_0xbd59f9[_0x34bc('0x19')],_0xbd59f9[_0x34bc('0x1a')],_0xbd59f9[_0x34bc('0x1b')],_0xbd59f9[_0x34bc('0x1c')]));logger[_0x34bc('0x11')](util[_0x34bc('0x12')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0xbd59f9['context'],_0xbd59f9['extension'],parseInt(_0xbd59f9[_0x34bc('0x47')],0xa)+0x1));_0xbd59f9[_0x34bc('0x50')](_0xbd59f9['context'],_0xbd59f9[_0x34bc('0x46')],parseInt(_0xbd59f9[_0x34bc('0x47')],0xa)+0x1);_0xbd59f9[_0x34bc('0x37')]();}}else{logger[_0x34bc('0xd')](util[_0x34bc('0x12')]('Project\x20%s\x20not\x20published',_0xbd59f9['arg_1']));_0xbd59f9['continueAt'](_0xbd59f9[_0x34bc('0x45')],_0xbd59f9[_0x34bc('0x46')],parseInt(_0xbd59f9[_0x34bc('0x47')],0xa)+0x1);_0xbd59f9[_0x34bc('0x37')]();}}else{logger[_0x34bc('0xd')](util['format'](_0x34bc('0x51'),_0xbd59f9[_0x34bc('0x18')]));_0xbd59f9[_0x34bc('0x50')](_0xbd59f9[_0x34bc('0x45')],_0xbd59f9['extension'],parseInt(_0xbd59f9[_0x34bc('0x47')],0xa)+0x1);_0xbd59f9[_0x34bc('0x37')]();}}function main(){var _0x29d7df;return utilLicense[_0x34bc('0x52')]()[_0x34bc('0x2e')](function(_0x31c40b){if(_0x31c40b){if(_0x31c40b[_0x34bc('0x53')]){if(_0x31c40b[_0x34bc('0x54')]&&_0x31c40b[_0x34bc('0x54')]>0x0){logger[_0x34bc('0x11')](util[_0x34bc('0x12')](_0x34bc('0x55'),_0x31c40b[_0x34bc('0x54')]));_0x29d7df=_0x31c40b['callysquare'];}else{logger[_0x34bc('0x11')](_0x34bc('0x56'));}}else{logger[_0x34bc('0x11')](_0x34bc('0x57'));_0x29d7df=-0x1;}}})[_0x34bc('0x2f')](function(_0x1b3704){logger[_0x34bc('0xd')](_0x34bc('0x58'),_0x1b3704[_0x34bc('0xe')]);})[_0x34bc('0x4d')](function(){var _0x11cd4c=require(_0x34bc('0x59'))(config[_0x34bc('0x5')][_0x34bc('0x10')],config['agi']['ip'],_0x29d7df);_0x11cd4c['on'](_0x34bc('0xd'),errorHandler);_0x11cd4c['on'](_0x34bc('0x5a'),listeningHandler);_0x11cd4c['on'](_0x34bc('0x5b'),connectionHandler);_0x11cd4c['on'](_0x34bc('0x37'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index a4e3413..619c4b4 100644 --- a/server/services/agi/mailRpc/index.js +++ b/server/services/agi/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0xd26ecf,_0x156c73){var _0x3b1f46=function(_0x509c07){while(--_0x509c07){_0xd26ecf['push'](_0xd26ecf['shift']());}};_0x3b1f46(++_0x156c73);}(_0x34e8,0x12c));var _0x834e=function(_0x48ffd2,_0x2ee398){_0x48ffd2=_0x48ffd2-0x0;var _0x2d7c9d=_0x34e8[_0x48ffd2];return _0x2d7c9d;};'use strict';var BPromise=require(_0x834e('0x0'));var jayson=require(_0x834e('0x1'));var client=jayson[_0x834e('0x2')][_0x834e('0x3')]({'port':0x232b});function request(_0x530939,_0x832422){return new BPromise(function(_0x21e2e0,_0x472111){return client[_0x834e('0x4')](_0x530939,_0x832422)[_0x834e('0x5')](function(_0x19a3e0){if(_0x19a3e0[_0x834e('0x6')]){return _0x472111(_0x19a3e0['error'][_0x834e('0x7')]);}else{return _0x21e2e0(_0x19a3e0['result']);}})[_0x834e('0x8')](function(_0x3cc2e3){return _0x472111(_0x3cc2e3);});});}exports[_0x834e('0x9')]=function(_0x2e69e2,_0x33ea05){return request(_0x834e('0xa'),{'account':_0x2e69e2,'message':_0x33ea05});}; \ No newline at end of file +var _0x34e8=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x525614,_0x5c7064){var _0x4fcb90=function(_0x55f13c){while(--_0x55f13c){_0x525614['push'](_0x525614['shift']());}};_0x4fcb90(++_0x5c7064);}(_0x34e8,0x12c));var _0x834e=function(_0x33d4b1,_0x2e8d85){_0x33d4b1=_0x33d4b1-0x0;var _0x6feee6=_0x34e8[_0x33d4b1];return _0x6feee6;};'use strict';var BPromise=require(_0x834e('0x0'));var jayson=require(_0x834e('0x1'));var client=jayson[_0x834e('0x2')][_0x834e('0x3')]({'port':0x232b});function request(_0x530939,_0x832422){return new BPromise(function(_0x21e2e0,_0x472111){return client[_0x834e('0x4')](_0x530939,_0x832422)[_0x834e('0x5')](function(_0x19a3e0){if(_0x19a3e0[_0x834e('0x6')]){return _0x472111(_0x19a3e0['error'][_0x834e('0x7')]);}else{return _0x21e2e0(_0x19a3e0['result']);}})[_0x834e('0x8')](function(_0x3cc2e3){return _0x472111(_0x3cc2e3);});});}exports[_0x834e('0x9')]=function(_0x2e69e2,_0x33ea05){return request(_0x834e('0xa'),{'account':_0x2e69e2,'message':_0x33ea05});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index fcf1ec6..840cfa6 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(_0x138b2c,_0x142181){var _0xa8b921=function(_0xc1799e){while(--_0xc1799e){_0x138b2c['push'](_0x138b2c['shift']());}};_0xa8b921(++_0x142181);}(_0x5f2f,0x73));var _0xf5f2=function(_0x21e23d,_0x749755){_0x21e23d=_0x21e23d-0x0;var _0x423baa=_0x5f2f[_0x21e23d];return _0x423baa;};'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 _0x7a54=['substring','length','split','indexOf','slice','trim','emit','util','stream','Transform','call','_localBuffer','inherits','prototype','_transform','toString','_inBody'];(function(_0x16a764,_0x23d8ab){var _0x1fabe0=function(_0x144c2e){while(--_0x144c2e){_0x16a764['push'](_0x16a764['shift']());}};_0x1fabe0(++_0x23d8ab);}(_0x7a54,0x106));var _0x47a5=function(_0x27d4aa,_0x49d7a8){_0x27d4aa=_0x27d4aa-0x0;var _0x37d333=_0x7a54[_0x27d4aa];return _0x37d333;};'use strict';var util=require(_0x47a5('0x0'));var Transform=require(_0x47a5('0x1'))[_0x47a5('0x2')];function AGIReply(_0x58157c){Transform[_0x47a5('0x3')](this,_0x58157c);this[_0x47a5('0x4')]='';this['_inBody']=![];}util[_0x47a5('0x5')](AGIReply,Transform);AGIReply[_0x47a5('0x6')][_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){var _0x3d5629='\x0a',_0x59199c=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x343372=-0x1,_0x30e405=-0x1,_0x506eda='',_0x194fb0=0x0,_0x5077f3='',_0x5d90b3='';this[_0x47a5('0x4')]+=_0x3717e1[_0x47a5('0x8')]();_0x5077f3=this['_localBuffer'];if(!this[_0x47a5('0x9')]){_0x194fb0=0x0;while(_0x59199c[_0x194fb0]){while((_0x30e405=_0x5077f3['indexOf'](_0x59199c[_0x194fb0]))!=-0x1){_0x506eda=_0x59199c[_0x194fb0];_0x5d90b3=_0x5077f3['substring'](0x0,_0x30e405);_0x5077f3=_0x5077f3[_0x47a5('0xa')](_0x30e405+_0x506eda[_0x47a5('0xb')]);var _0x2f399b=_0x5d90b3[_0x47a5('0xc')](_0x3d5629),_0x250fad=0x0,_0xd612dd={},_0xd308b8='',_0x1eae59='',_0x5beb89=-0x1;while(_0x2f399b[_0x250fad]){_0x5beb89=_0x2f399b[_0x250fad][_0x47a5('0xd')](':');if(_0x5beb89!=-0x1){_0xd308b8=_0x2f399b[_0x250fad][_0x47a5('0xe')](0x0,_0x5beb89)[_0x47a5('0xf')]();_0x1eae59=_0x2f399b[_0x250fad][_0x47a5('0xe')](_0x5beb89+0x1)[_0x47a5('0xf')]();if(_0xd308b8[_0x47a5('0xb')]>0x0){_0xd612dd[_0xd308b8]=_0x1eae59;}}else{}_0x250fad++;}this[_0x47a5('0x10')]('headers',_0xd612dd);this[_0x47a5('0x9')]=!![];}_0x194fb0++;}this[_0x47a5('0x4')]=_0x5077f3;}else{while((_0x343372=_0x5077f3[_0x47a5('0xd')](_0x3d5629))!=-0x1){_0x5d90b3=_0x5077f3[_0x47a5('0xa')](0x0,_0x343372);this[_0x47a5('0x10')]('line',_0x5d90b3);_0x5077f3=_0x5077f3['substring'](_0x343372+_0x3d5629[_0x47a5('0xb')]);}this['_localBuffer']=_0x5077f3;}_0x545a97();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 53cbac0..720d0ed 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 _0xfd6f=['util','jayson/promise','http','request','then','error','message','result','getSquareProject','ShowSquareProject','production','Smtp','name','email','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getTrunkById','ShowTrunk','ShowSound','save_name','getIntervalById','Interval','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','merge','arg_1','arg_2','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash'];(function(_0x3045a8,_0x442c25){var _0x52883c=function(_0x1dfb2e){while(--_0x1dfb2e){_0x3045a8['push'](_0x3045a8['shift']());}};_0x52883c(++_0x442c25);}(_0xfd6f,0x19d));var _0xffd6=function(_0xa55f7a,_0x31978b){_0xa55f7a=_0xa55f7a-0x0;var _0x1c3bd6=_0xfd6f[_0xa55f7a];return _0x1c3bd6;};'use strict';var BPromise=require(_0xffd6('0x0'));var moment=require(_0xffd6('0x1'));var _=require(_0xffd6('0x2'));var util=require(_0xffd6('0x3'));var jayson=require(_0xffd6('0x4'));var client=jayson['client'][_0xffd6('0x5')]({'port':0x2329});function request(_0x1e3b9b,_0x158741){return new BPromise(function(_0x353c27,_0x54e670){return client[_0xffd6('0x6')](_0x1e3b9b,_0x158741)[_0xffd6('0x7')](function(_0x3f3cd8){if(_0x3f3cd8[_0xffd6('0x8')]){return _0x54e670(_0x3f3cd8['error'][_0xffd6('0x9')]);}else{return _0x353c27(_0x3f3cd8[_0xffd6('0xa')]);}})['catch'](function(_0x5cca56){return _0x54e670(_0x5cca56);});});}exports[_0xffd6('0xb')]=function(_0x4267fc){return request(_0xffd6('0xc'),{'options':{'raw':![],'where':{'name':_0x4267fc},'attributes':[_0xffd6('0xd')]}});};exports['getMailAccountById']=function(_0x103aac){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x103aac},'include':[{'model':'MailServerOut','as':_0xffd6('0xe')}],'attributes':['id',_0xffd6('0xf'),_0xffd6('0x10')]}});};exports['getSquareProjectById']=function(_0xf97de){return request(_0xffd6('0xc'),{'options':{'where':{'id':_0xf97de},'attributes':['name']}});};exports[_0xffd6('0x11')]=function(_0x1bef90){return request(_0xffd6('0x12'),{'options':{'where':{'id':_0x1bef90},'attributes':[_0xffd6('0xf')]}});};exports['getVariableById']=function(_0x5f4765){return request(_0xffd6('0x13'),{'options':{'where':{'id':_0x5f4765},'attributes':[_0xffd6('0xf')]}});};exports[_0xffd6('0x14')]=function(_0x575120){return request(_0xffd6('0x15'),{'options':{'where':{'id':_0x575120},'attributes':[_0xffd6('0x16')]}});};exports['getUserById']=function(_0x39c0a6){return request('ShowUser',{'options':{'where':{'id':_0x39c0a6},'attributes':[_0xffd6('0xf')]}});};exports[_0xffd6('0x17')]=function(_0x2271c4){return request(_0xffd6('0x18'),{'options':{'where':{'id':_0x2271c4},'attributes':[_0xffd6('0xf')]}});};exports['getSoundById']=function(_0xe2f572){return request(_0xffd6('0x19'),{'options':{'where':{'id':_0xe2f572},'attributes':[_0xffd6('0x1a')]}});};exports[_0xffd6('0x1b')]=function(_0x56dd04){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x56dd04},'include':[{'model':_0xffd6('0x1c'),'as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x453e4e){return request(_0xffd6('0x1d'),{'options':{'where':{'id':_0x453e4e},'attributes':['id',_0xffd6('0xf')]}});};exports[_0xffd6('0x1e')]=function(_0x191642){return request(_0xffd6('0x1f'),{'body':_0x191642});};exports['createSquareDetailsReport']=function(_0x44e5f5){return request(_0xffd6('0x20'),{'body':_0x44e5f5});};exports['createSquareReport']=function(_0x15ed6a){return request('CreateSquareReport',{'body':_[_0xffd6('0x21')](_0x15ed6a,{'project_name':_0x15ed6a[_0xffd6('0x22')],'prev_project_name':_0x15ed6a[_0xffd6('0x23')]||'','is_subproject':_0x15ed6a['arg_2']?!![]:![],'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xffd6('0x24')]=function(_0x16f8bf){return request(_0xffd6('0x25'),{'body':_0x16f8bf});};exports['createSquareMessage']=function(_0x423bb8){return request(_0xffd6('0x26'),{'body':_0x423bb8});};exports[_0xffd6('0x27')]=function(_0xdec862){return request(_0xffd6('0x28'),{'options':{'raw':![],'where':{'phone':_0xdec862['phone'],'ListId':_0xdec862[_0xffd6('0x29')]}}})[_0xffd6('0x7')](function(_0x4e2741){if(_0x4e2741){return _0x4e2741;}return request(_0xffd6('0x2a'),{'body':_0xdec862});});};exports[_0xffd6('0x2b')]=function(_0x434ee0){return request(_0xffd6('0x2c'),{'options':{'where':{'id':_0x434ee0},'attributes':[_0xffd6('0xf')]}});};exports[_0xffd6('0x2d')]=function(_0x4440f8,_0x44276a){return request('LoginUser',{'body':{'interface':_0x44276a},'options':{'where':_0x4440f8}});};exports[_0xffd6('0x2e')]=function(_0x3eb1b3,_0x261266,_0x35328a){return request(_0xffd6('0x2f'),{'body':{'type':_0x261266,'uniqueid':_0x35328a},'options':{'where':_0x3eb1b3}});};exports[_0xffd6('0x30')]=function(_0x4b2d96){return request(_0xffd6('0x31'),{'body':{},'options':{'where':_0x4b2d96}});};exports[_0xffd6('0x32')]=function(_0x25c11c){return request(_0xffd6('0x33'),{'body':{},'options':{'where':_0x25c11c}});}; \ No newline at end of file +var _0xc260=['getSoundById','save_name','getIntervalById','Interval','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','then','CreateCmContact','getPauseById','ShowPause','agentLogin','agentPause','PauseUser','LogoutUser','bluebird','moment','lodash','util','jayson/promise','http','request','error','message','result','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','email','getSquareProjectById','name','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getTrunkById','ShowTrunk'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xc260,0x10f));var _0x0c26=function(_0x14f3eb,_0x576492){_0x14f3eb=_0x14f3eb-0x0;var _0x41b465=_0xc260[_0x14f3eb];return _0x41b465;};'use strict';var BPromise=require(_0x0c26('0x0'));var moment=require(_0x0c26('0x1'));var _=require(_0x0c26('0x2'));var util=require(_0x0c26('0x3'));var jayson=require(_0x0c26('0x4'));var client=jayson['client'][_0x0c26('0x5')]({'port':0x2329});function request(_0x178e4e,_0x521efb){return new BPromise(function(_0x40a17d,_0x4b358e){return client[_0x0c26('0x6')](_0x178e4e,_0x521efb)['then'](function(_0x292992){if(_0x292992[_0x0c26('0x7')]){return _0x4b358e(_0x292992[_0x0c26('0x7')][_0x0c26('0x8')]);}else{return _0x40a17d(_0x292992[_0x0c26('0x9')]);}})['catch'](function(_0x1d4935){return _0x4b358e(_0x1d4935);});});}exports[_0x0c26('0xa')]=function(_0xeb0d29){return request(_0x0c26('0xb'),{'options':{'raw':![],'where':{'name':_0xeb0d29},'attributes':[_0x0c26('0xc')]}});};exports[_0x0c26('0xd')]=function(_0x2573b2){return request(_0x0c26('0xe'),{'options':{'raw':![],'where':{'id':_0x2573b2},'include':[{'model':_0x0c26('0xf'),'as':_0x0c26('0x10')}],'attributes':['id','name',_0x0c26('0x11')]}});};exports[_0x0c26('0x12')]=function(_0x305c73){return request(_0x0c26('0xb'),{'options':{'where':{'id':_0x305c73},'attributes':[_0x0c26('0x13')]}});};exports[_0x0c26('0x14')]=function(_0x2a7ac4){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x2a7ac4},'attributes':['name']}});};exports[_0x0c26('0x15')]=function(_0x59fac5){return request(_0x0c26('0x16'),{'options':{'where':{'id':_0x59fac5},'attributes':[_0x0c26('0x13')]}});};exports[_0x0c26('0x17')]=function(_0xf1ad4f){return request(_0x0c26('0x18'),{'options':{'where':{'id':_0xf1ad4f},'attributes':[_0x0c26('0x19')]}});};exports['getUserById']=function(_0x3cc121){return request(_0x0c26('0x1a'),{'options':{'where':{'id':_0x3cc121},'attributes':['name']}});};exports[_0x0c26('0x1b')]=function(_0x237ae6){return request(_0x0c26('0x1c'),{'options':{'where':{'id':_0x237ae6},'attributes':['name']}});};exports[_0x0c26('0x1d')]=function(_0xe29adc){return request('ShowSound',{'options':{'where':{'id':_0xe29adc},'attributes':[_0x0c26('0x1e')]}});};exports[_0x0c26('0x1f')]=function(_0x428070){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x428070},'include':[{'model':_0x0c26('0x20'),'as':_0x0c26('0x21')}]}});};exports[_0x0c26('0x22')]=function(_0xfff859){return request(_0x0c26('0x23'),{'options':{'where':{'id':_0xfff859},'attributes':['id',_0x0c26('0x13')]}});};exports['createSmsMessage']=function(_0x5d1167){return request(_0x0c26('0x24'),{'body':_0x5d1167});};exports[_0x0c26('0x25')]=function(_0x5af0ca){return request(_0x0c26('0x26'),{'body':_0x5af0ca});};exports[_0x0c26('0x27')]=function(_0x2c0b2b){return request('CreateSquareReport',{'body':_[_0x0c26('0x28')](_0x2c0b2b,{'project_name':_0x2c0b2b[_0x0c26('0x29')],'prev_project_name':_0x2c0b2b[_0x0c26('0x2a')]||'','is_subproject':_0x2c0b2b[_0x0c26('0x2a')]?!![]:![],'leaveAt':moment()[_0x0c26('0x2b')](_0x0c26('0x2c'))})});};exports[_0x0c26('0x2d')]=function(_0x4b214f){return request(_0x0c26('0x2e'),{'body':_0x4b214f});};exports[_0x0c26('0x2f')]=function(_0x585353){return request(_0x0c26('0x30'),{'body':_0x585353});};exports[_0x0c26('0x31')]=function(_0x17abc1){return request(_0x0c26('0x32'),{'options':{'raw':![],'where':{'phone':_0x17abc1[_0x0c26('0x33')],'ListId':_0x17abc1['ListId']}}})[_0x0c26('0x34')](function(_0x55e260){if(_0x55e260){return _0x55e260;}return request(_0x0c26('0x35'),{'body':_0x17abc1});});};exports[_0x0c26('0x36')]=function(_0x5ce03e){return request(_0x0c26('0x37'),{'options':{'where':{'id':_0x5ce03e},'attributes':[_0x0c26('0x13')]}});};exports[_0x0c26('0x38')]=function(_0x598f36,_0x234ad0){return request('LoginUser',{'body':{'interface':_0x234ad0},'options':{'where':_0x598f36}});};exports[_0x0c26('0x39')]=function(_0x4c90dc,_0x31ad7e,_0x499e75){return request(_0x0c26('0x3a'),{'body':{'type':_0x31ad7e,'uniqueid':_0x499e75},'options':{'where':_0x4c90dc}});};exports['agentUnpause']=function(_0x23c707){return request('UnpauseUser',{'body':{},'options':{'where':_0x23c707}});};exports['agentLogout']=function(_0xd09bb3){return request(_0x0c26('0x3b'),{'body':{},'options':{'where':_0xd09bb3}});}; \ 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 8e05a59..f256b5c 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 _0x7ce5=['./lex'];(function(_0x498dd3,_0x142a3e){var _0x2aff1c=function(_0x52257c){while(--_0x52257c){_0x498dd3['push'](_0x498dd3['shift']());}};_0x2aff1c(++_0x142a3e);}(_0x7ce5,0xb0));var _0x57ce=function(_0xd21c1e,_0x4ad5cf){_0xd21c1e=_0xd21c1e-0x0;var _0x429a5a=_0x7ce5[_0xd21c1e];return _0x429a5a;};var polly=require('./polly');var lex=require(_0x57ce('0x0'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x615d=['exports','./polly','./lex'];(function(_0x44a9c8,_0x19facb){var _0x3a3d70=function(_0x133828){while(--_0x133828){_0x44a9c8['push'](_0x44a9c8['shift']());}};_0x3a3d70(++_0x19facb);}(_0x615d,0x157));var _0xd615=function(_0x419e17,_0x7fe78c){_0x419e17=_0x419e17-0x0;var _0x1f2044=_0x615d[_0x419e17];return _0x1f2044;};var polly=require(_0xd615('0x0'));var lex=require(_0xd615('0x1'));module[_0xd615('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 401831a..68ceacc 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 _0x524a=['exports','./lib/api'];(function(_0x2e6654,_0x4f9717){var _0xaf943f=function(_0x334c98){while(--_0x334c98){_0x2e6654['push'](_0x2e6654['shift']());}};_0xaf943f(++_0x4f9717);}(_0x524a,0xf5));var _0xa524=function(_0x532b84,_0x2cdc24){_0x532b84=_0x532b84-0x0;var _0x375477=_0x524a[_0x532b84];return _0x375477;};'use strict';var lex=require(_0xa524('0x0'));module[_0xa524('0x1')]=function(_0x106295,_0x3d238d,_0x53c48c,_0x4a29b7,_0x2ef77c,_0xa89d8c){return lex(_0x106295,_0x3d238d,_0x53c48c,_0x4a29b7,_0x2ef77c,_0xa89d8c);}; \ No newline at end of file +var _0xe43c=['./lib/api','exports'];(function(_0x3a8df4,_0xe18ae3){var _0x2ce1ff=function(_0x476f7a){while(--_0x476f7a){_0x3a8df4['push'](_0x3a8df4['shift']());}};_0x2ce1ff(++_0xe18ae3);}(_0xe43c,0x180));var _0xce43=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xe43c[_0x4b369d];return _0x571a98;};'use strict';var lex=require(_0xce43('0x0'));module[_0xce43('0x1')]=function(_0x159823,_0x207c20,_0x6f053b,_0x357837,_0x5baedd,_0x415941){return lex(_0x159823,_0x207c20,_0x6f053b,_0x357837,_0x5baedd,_0x415941);}; \ 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 4580be5..50a0dac 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 _0x9c10=['slot_','exports','LexRuntime','$LATEST','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9c10,0x17c));var _0x09c1=function(_0x1b0846,_0x1ff7f2){_0x1b0846=_0x1b0846-0x0;var _0x2717a3=_0x9c10[_0x1b0846];return _0x2717a3;};'use strict';var BPromise=require(_0x09c1('0x0'));var AWS=require(_0x09c1('0x1'));function lexResult(_0x2e2bfb,_0x32d6d6){return new BPromise(function(_0x3ae76a,_0x5b098c){_0x2e2bfb['postText'](_0x32d6d6,function(_0x39b2d6,_0x5318d8){if(_0x39b2d6){_0x5b098c(_0x39b2d6);}if(_0x5318d8[_0x09c1('0x2')]){for(const _0x3a45c9 in _0x5318d8[_0x09c1('0x2')]){if(_0x5318d8['slots'][_0x09c1('0x3')](_0x3a45c9)){var _0x354075=_0x5318d8[_0x09c1('0x2')][_0x3a45c9];_0x5318d8[_0x09c1('0x4')+_0x3a45c9]=_0x354075;}}}_0x3ae76a(_0x5318d8);});});}module[_0x09c1('0x5')]=function(_0xde3acc,_0xa88d38,_0x5d0647,_0x4c5093,_0x4bcd85,_0x30862e){var _0x157a62=new AWS[(_0x09c1('0x6'))]({'accessKeyId':_0xa88d38,'secretAccessKey':_0x5d0647,'region':_0x4c5093});var _0x441af2={'botAlias':_0x09c1('0x7'),'botName':_0x30862e,'inputText':_0x4bcd85,'userId':_0xde3acc};return lexResult(_0x157a62,_0x441af2);}; \ No newline at end of file +var _0x1c83=['LexRuntime','$LATEST','aws-sdk','postText','slots','hasOwnProperty','slot_','exports'];(function(_0x51b42e,_0x8dea09){var _0x43ed23=function(_0x2de749){while(--_0x2de749){_0x51b42e['push'](_0x51b42e['shift']());}};_0x43ed23(++_0x8dea09);}(_0x1c83,0x1e2));var _0x31c8=function(_0x141fb5,_0x329be1){_0x141fb5=_0x141fb5-0x0;var _0x1f286d=_0x1c83[_0x141fb5];return _0x1f286d;};'use strict';var BPromise=require('bluebird');var AWS=require(_0x31c8('0x0'));function lexResult(_0x51a2ed,_0x454048){return new BPromise(function(_0xac39cf,_0x4f1a3f){_0x51a2ed[_0x31c8('0x1')](_0x454048,function(_0x101383,_0x29f797){if(_0x101383){_0x4f1a3f(_0x101383);}if(_0x29f797['slots']){for(const _0x5443f0 in _0x29f797[_0x31c8('0x2')]){if(_0x29f797['slots'][_0x31c8('0x3')](_0x5443f0)){var _0x1e94b3=_0x29f797[_0x31c8('0x2')][_0x5443f0];_0x29f797[_0x31c8('0x4')+_0x5443f0]=_0x1e94b3;}}}_0xac39cf(_0x29f797);});});}module[_0x31c8('0x5')]=function(_0x3318fb,_0x1655f7,_0x58b669,_0x3dacf6,_0x554a9f,_0x1c9671){var _0x2a5594=new AWS[(_0x31c8('0x6'))]({'accessKeyId':_0x1655f7,'secretAccessKey':_0x58b669,'region':_0x3dacf6});var _0x598af2={'botAlias':_0x31c8('0x7'),'botName':_0x1c9671,'inputText':_0x554a9f,'userId':_0x3318fb};return lexResult(_0x2a5594,_0x598af2);}; \ 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 2f1ffb4..2dce7fb 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 _0x69ca=['./lib/api','exports'];(function(_0x408760,_0xb5e2e5){var _0x1a026b=function(_0x21f3a2){while(--_0x21f3a2){_0x408760['push'](_0x408760['shift']());}};_0x1a026b(++_0xb5e2e5);}(_0x69ca,0x8a));var _0xa69c=function(_0x3efcd5,_0x9bbba3){_0x3efcd5=_0x3efcd5-0x0;var _0x54e50a=_0x69ca[_0x3efcd5];return _0x54e50a;};'use strict';var polly=require(_0xa69c('0x0'));module[_0xa69c('0x1')]=function(_0x14a57f,_0x3180f8,_0x4e0cb9,_0x29702a,_0x5a97ba,_0xed3803,_0x207299){return polly(_0x14a57f,_0x3180f8,_0x4e0cb9,_0x29702a,_0x5a97ba,_0xed3803,_0x207299);}; \ No newline at end of file +var _0x957b=['./lib/api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x957b,0x144));var _0xb957=function(_0x5160aa,_0xea9d41){_0x5160aa=_0x5160aa-0x0;var _0x4913ce=_0x957b[_0x5160aa];return _0x4913ce;};'use strict';var polly=require(_0xb957('0x0'));module['exports']=function(_0x2033f5,_0xa6f570,_0xb5c4f1,_0x4c2cc1,_0x185ab7,_0x3933ee,_0x565f3a){return polly(_0x2033f5,_0xa6f570,_0xb5c4f1,_0x4c2cc1,_0x185ab7,_0x3933ee,_0x565f3a);}; \ 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 2a876d1..c74bea6 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 _0x6954=['mp3','path','randomstring','aws-sdk','synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text'];(function(_0x40b493,_0x4050de){var _0x548365=function(_0x8ceba7){while(--_0x8ceba7){_0x40b493['push'](_0x40b493['shift']());}};_0x548365(++_0x4050de);}(_0x6954,0x199));var _0x4695=function(_0x5af94f,_0x16f5bf){_0x5af94f=_0x5af94f-0x0;var _0x34ac79=_0x6954[_0x5af94f];return _0x34ac79;};'use strict';var fs=require('fs');var path=require(_0x4695('0x0'));var BPromise=require('bluebird');var rs=require(_0x4695('0x1'));var AWS=require(_0x4695('0x2'));function pollyResult(_0xbfcd0c,_0x409707,_0xecd885){return new BPromise(function(_0x46fa0f,_0x484ebb){_0xbfcd0c[_0x4695('0x3')](_0x409707,function(_0x5b40ff,_0x296ccc){if(_0x5b40ff){_0x484ebb(_0x5b40ff);}else if(_0x296ccc){if(_0x296ccc['AudioStream']instanceof Buffer){fs[_0x4695('0x4')](_0xecd885,_0x296ccc[_0x4695('0x5')],function(_0x1d1762){if(_0x1d1762){_0x484ebb(_0x1d1762);}else{_0x46fa0f();}});}else{_0x484ebb(new Error(_0x4695('0x6')));}}else{_0x484ebb(new Error(_0x4695('0x7')));}});});}module[_0x4695('0x8')]=function(_0x216e19,_0x104aaa,_0x12390c,_0x334a2b,_0x596cd0,_0x3a5d04,_0x47ea56){var _0x5e7b48=new AWS[(_0x4695('0x9'))]({'accessKeyId':_0x216e19,'secretAccessKey':_0x104aaa,'region':_0x12390c});var _0x38d068={'Text':_0x596cd0,'TextType':_0x3a5d04||_0x4695('0xa'),'OutputFormat':_0x4695('0xb'),'VoiceId':_0x334a2b};return pollyResult(_0x5e7b48,_0x38d068,_0x47ea56);}; \ No newline at end of file +var _0x6c18=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','mp3','randomstring','aws-sdk','AudioStream','writeFile'];(function(_0x9f561d,_0x2a9d37){var _0x1f0dd6=function(_0x4ca0b2){while(--_0x4ca0b2){_0x9f561d['push'](_0x9f561d['shift']());}};_0x1f0dd6(++_0x2a9d37);}(_0x6c18,0x10c));var _0x86c1=function(_0x511eb8,_0x428254){_0x511eb8=_0x511eb8-0x0;var _0x49759b=_0x6c18[_0x511eb8];return _0x49759b;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require(_0x86c1('0x0'));var AWS=require(_0x86c1('0x1'));function pollyResult(_0x2775cd,_0x33adec,_0x5a0c47){return new BPromise(function(_0x39c36a,_0xda1a55){_0x2775cd['synthesizeSpeech'](_0x33adec,function(_0x4fedf6,_0x333d9e){if(_0x4fedf6){_0xda1a55(_0x4fedf6);}else if(_0x333d9e){if(_0x333d9e[_0x86c1('0x2')]instanceof Buffer){fs[_0x86c1('0x3')](_0x5a0c47,_0x333d9e[_0x86c1('0x2')],function(_0x217150){if(_0x217150){_0xda1a55(_0x217150);}else{_0x39c36a();}});}else{_0xda1a55(new Error(_0x86c1('0x4')));}}else{_0xda1a55(new Error(_0x86c1('0x5')));}});});}module['exports']=function(_0x54ba26,_0x5f0171,_0x3e4303,_0x5c7fb4,_0x26873f,_0x9728bc,_0x457ff9){var _0x400539=new AWS[(_0x86c1('0x6'))]({'accessKeyId':_0x54ba26,'secretAccessKey':_0x5f0171,'region':_0x3e4303});var _0x5072eb={'Text':_0x26873f,'TextType':_0x9728bc||'text','OutputFormat':_0x86c1('0x7'),'VoiceId':_0x5c7fb4};return pollyResult(_0x400539,_0x5072eb,_0x457ff9);}; \ 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 9324b46..cafbfe8 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 _0xaf4c=['exports'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xaf4c,0x1ed));var _0xcaf4=function(_0x1a14cc,_0x3f3ad5){_0x1a14cc=_0x1a14cc-0x0;var _0x28a521=_0xaf4c[_0x1a14cc];return _0x28a521;};'use strict';var asr=require('./lib/api');module[_0xcaf4('0x0')]=function(_0x3af3b5,_0x4cd268,_0x10c20a,_0x453ce8){return asr(_0x3af3b5,_0x4cd268,_0x10c20a);}; \ No newline at end of file +var _0x3a27=['./lib/api','exports'];(function(_0xa1d715,_0x4d61b9){var _0x3fc976=function(_0x134bc5){while(--_0x134bc5){_0xa1d715['push'](_0xa1d715['shift']());}};_0x3fc976(++_0x4d61b9);}(_0x3a27,0x19c));var _0x73a2=function(_0x5317c0,_0x24e30a){_0x5317c0=_0x5317c0-0x0;var _0x3eba11=_0x3a27[_0x5317c0];return _0x3eba11;};'use strict';var asr=require(_0x73a2('0x0'));module[_0x73a2('0x1')]=function(_0x2acf7d,_0x14a409,_0x1a6624,_0x25db63){return asr(_0x2acf7d,_0x14a409,_0x1a6624);}; \ 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 3cde602..83d754d 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 _0x0c19=['undefined','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','exports','string','length','key\x20should\x20be\x20a\x20string'];(function(_0x270fec,_0xfa133d){var _0x7f91af=function(_0x33e5c6){while(--_0x33e5c6){_0x270fec['push'](_0x270fec['shift']());}};_0x7f91af(++_0xfa133d);}(_0x0c19,0x158));var _0x90c1=function(_0x4cff1c,_0x1893dc){_0x4cff1c=_0x4cff1c-0x0;var _0x272696=_0x0c19[_0x4cff1c];return _0x272696;};'use strict';var url=require(_0x90c1('0x0'));var BPromise=require(_0x90c1('0x1'));var fs=require('fs');var host=_0x90c1('0x2');module[_0x90c1('0x3')]=function(_0x56e5ee,_0xc7fb20,_0xccd2ce){return new BPromise(function(_0x4caa69,_0x22a01c){var _0x4b4625;if(typeof _0x56e5ee!==_0x90c1('0x4')||_0x56e5ee[_0x90c1('0x5')]===0x0){return _0x22a01c('filepath\x20should\x20be\x20a\x20string');}if(typeof _0xc7fb20!==_0x90c1('0x4')||_0xc7fb20[_0x90c1('0x5')]===0x0){return _0x22a01c(_0x90c1('0x6'));}if(typeof _0xccd2ce!==_0x90c1('0x7')&&(typeof _0xccd2ce!==_0x90c1('0x4')||_0xccd2ce[_0x90c1('0x5')]===0x0)){return _0x22a01c('lang\x20should\x20be\x20a\x20string');}try{_0x4b4625=fs['readFileSync'](_0x56e5ee)[_0x90c1('0x8')](_0x90c1('0x9'));}catch(_0x5e37c8){return _0x22a01c(_0x5e37c8);}return _0x4caa69({'method':_0x90c1('0xa'),'uri':host+_0x90c1('0xb')+_0xc7fb20,'body':{'config':{'encoding':_0x90c1('0xc'),'sampleRateHertz':'8000','languageCode':_0xccd2ce},'audio':{'content':_0x4b4625}},'json':!![]});});}; \ No newline at end of file +var _0xbd15=['length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','POST','8000','url','bluebird','https://speech.googleapis.com','exports','string'];(function(_0x541e5e,_0x2f02e3){var _0x3cedaa=function(_0x2a6172){while(--_0x2a6172){_0x541e5e['push'](_0x541e5e['shift']());}};_0x3cedaa(++_0x2f02e3);}(_0xbd15,0x167));var _0x5bd1=function(_0x4d8fe1,_0x3ed474){_0x4d8fe1=_0x4d8fe1-0x0;var _0x46685e=_0xbd15[_0x4d8fe1];return _0x46685e;};'use strict';var url=require(_0x5bd1('0x0'));var BPromise=require(_0x5bd1('0x1'));var fs=require('fs');var host=_0x5bd1('0x2');module[_0x5bd1('0x3')]=function(_0x43bb89,_0x46dab2,_0x5d3482){return new BPromise(function(_0x3a3405,_0x7c8a76){var _0x582fd0;if(typeof _0x43bb89!==_0x5bd1('0x4')||_0x43bb89[_0x5bd1('0x5')]===0x0){return _0x7c8a76(_0x5bd1('0x6'));}if(typeof _0x46dab2!==_0x5bd1('0x4')||_0x46dab2['length']===0x0){return _0x7c8a76('key\x20should\x20be\x20a\x20string');}if(typeof _0x5d3482!==_0x5bd1('0x7')&&(typeof _0x5d3482!==_0x5bd1('0x4')||_0x5d3482[_0x5bd1('0x5')]===0x0)){return _0x7c8a76(_0x5bd1('0x8'));}try{_0x582fd0=fs['readFileSync'](_0x43bb89)[_0x5bd1('0x9')](_0x5bd1('0xa'));}catch(_0x5cb2b6){return _0x7c8a76(_0x5cb2b6);}return _0x3a3405({'method':_0x5bd1('0xb'),'uri':host+'/v1/speech:recognize?key='+_0x46dab2,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x5bd1('0xc'),'languageCode':_0x5d3482},'audio':{'content':_0x582fd0}},'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 484c51f..67d0104 100644 --- a/server/services/agi/scripts/google/index.js +++ b/server/services/agi/scripts/google/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','./asr'];(function(_0x570d72,_0x24d36e){var _0x1052d8=function(_0x4e8016){while(--_0x4e8016){_0x570d72['push'](_0x570d72['shift']());}};_0x1052d8(++_0x24d36e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};var asr=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'asr':asr}; \ No newline at end of file +var _0x34e8=['./asr','exports'];(function(_0x134d5e,_0x2a47d8){var _0x1e166a=function(_0x53f10d){while(--_0x53f10d){_0x134d5e['push'](_0x134d5e['shift']());}};_0x1e166a(++_0x2a47d8);}(_0x34e8,0x12c));var _0x834e=function(_0x3a6fe7,_0x57f64f){_0x3a6fe7=_0x3a6fe7-0x0;var _0x42558b=_0x34e8[_0x3a6fe7];return _0x42558b;};var asr=require(_0x834e('0x0'));module[_0x834e('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index b5656ee..50643e4 100644 --- a/server/services/agi/scripts/index.js +++ b/server/services/agi/scripts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['text','channelData','CustomAction','AudioFromTts','Data','dirName','path','http','https','bluebird','sox','request-promise','util','querystring','moment','apiai-promise','md5','./google','./sestek','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','error','unlink','download\x20error','pipe','end','protocol','https:','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','split','readFileSync','googleTTS','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','format','freeform=3','parse','sestekNDA','nda'];(function(_0x4bf5ee,_0x3c2745){var _0x497ffe=function(_0x24adea){while(--_0x24adea){_0x4bf5ee['push'](_0x4bf5ee['shift']());}};_0x497ffe(++_0x3c2745);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var fs=require('fs');var path=require(_0x0a9e('0x0'));var http=require(_0x0a9e('0x1'));var https=require(_0x0a9e('0x2'));var urlParse=require('url')['parse'];var BPromise=require(_0x0a9e('0x3'));var rs=require('randomstring');var sox=require(_0x0a9e('0x4'));var rp=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var querystring=require(_0x0a9e('0x7'));var moment=require(_0x0a9e('0x8'));var tts=require('google-tts-api');var apiai=require(_0x0a9e('0x9'));var md5=require(_0x0a9e('0xa'));var google=require(_0x0a9e('0xb'));var aws=require('./aws');var tilde=require('./tilde');var sestek=require(_0x0a9e('0xc'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x0a9e('0xd');function downloadFile(_0xf81284,_0x307b3e){return new BPromise(function(_0x3ab53f,_0xfeb75b){var _0xbd1168=urlParse(_0xf81284);var _0x4a4c56=_0xbd1168['protocol']==='https:'?https:http;var _0x4cfe67={'host':_0xbd1168[_0x0a9e('0xe')],'path':_0xbd1168[_0x0a9e('0x0')],'headers':{'user-agent':_0x0a9e('0xf')}};_0x4a4c56[_0x0a9e('0x10')](_0x4cfe67,function(_0x32d742){if(_0x32d742[_0x0a9e('0x11')]!==0xc8){logger['error'](_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742[_0x0a9e('0x11')]+'\x20('+_0x32d742[_0x0a9e('0x14')]+')');_0xfeb75b(new Error(_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742['statusCode']+'\x20('+_0x32d742[_0x0a9e('0x14')]+')'));return;}var _0x5d0880=fs[_0x0a9e('0x15')](_0x307b3e);_0x5d0880['on']('finish',function(){logger[_0x0a9e('0x16')](_0x0a9e('0x17'));_0x5d0880['close'](_0x3ab53f);});_0x5d0880['on'](_0x0a9e('0x18'),function(_0x5a0a06){fs[_0x0a9e('0x19')](_0x307b3e);logger[_0x0a9e('0x18')](_0x0a9e('0x1a'),_0x5a0a06);_0xfeb75b(_0x5a0a06);});_0x32d742[_0x0a9e('0x1b')](_0x5d0880);})['on'](_0x0a9e('0x18'),function(_0x2eb11f){logger[_0x0a9e('0x18')](_0x2eb11f);_0xfeb75b(_0x2eb11f);})[_0x0a9e('0x1c')]();});}function uploadFile(_0x1314ae){return new BPromise(function(_0x112016,_0x1c696a){var _0x105080=urlParse(_0x1314ae);var _0x4bb1e3=_0x105080[_0x0a9e('0x1d')]===_0x0a9e('0x1e')?https:http;var _0x53682f={'host':_0x105080[_0x0a9e('0xe')],'path':_0x105080['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x4bb1e3[_0x0a9e('0x10')](_0x53682f,function(_0x432e56){if(_0x432e56[_0x0a9e('0x11')]!==0xc8){_0x1c696a(new Error(_0x0a9e('0x12')+_0x1314ae+'\x20failed,\x20status\x20code\x20=\x20'+_0x432e56[_0x0a9e('0x11')]+'\x20('+_0x432e56[_0x0a9e('0x14')]+')'));return;}var _0x3b45bc='';_0x432e56['on'](_0x0a9e('0x1f'),function(_0x370d86){_0x3b45bc+=_0x370d86;});_0x432e56['on'](_0x0a9e('0x1c'),function(){_0x112016(_0x3b45bc);});})['on'](_0x0a9e('0x18'),function(_0x5ea472){_0x1c696a(_0x5ea472);})['end']();});}function convertFile(_0x197ec0,_0x3a8e58){return new BPromise(function(_0x40c424,_0x33161b){var _0x526cf3=sox[_0x0a9e('0x20')](_0x197ec0,_0x3a8e58,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x526cf3['on'](_0x0a9e('0x18'),function(_0x5bfb33){logger[_0x0a9e('0x18')](_0x0a9e('0x21'),_0x5bfb33);_0x33161b(_0x5bfb33);});_0x526cf3['on'](_0x0a9e('0x1c'),function(){logger[_0x0a9e('0x16')](_0x0a9e('0x22'));_0x40c424();});_0x526cf3[_0x0a9e('0x23')]();});}function base64Decode(_0x11c3b6,_0x14de77){var _0x5a101a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));fs['writeFileSync'](_0x5a101a,_0x11c3b6,_0x0a9e('0x28'));return convertFile(_0x5a101a,_0x14de77)[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x5a101a);fs[_0x0a9e('0x2a')](_0x14de77,_0x0a9e('0x2b'));}catch(_0x563b45){logger[_0x0a9e('0x18')](_0x563b45);}return _0x14de77[_0x0a9e('0x2c')]('.')[0x0];});}function base64Encode(_0x1dbde2){var _0x540530=fs[_0x0a9e('0x2d')](_0x1dbde2);return new Buffer(_0x540530)['toString'](_0x0a9e('0x28'));}exports[_0x0a9e('0x2e')]=function(_0x1122db,_0x33bdb7){var _0x25ce3a,_0x5180f1;return tts(_0x1122db,_0x33bdb7||'en',0x1)[_0x0a9e('0x29')](function(_0x46f0a5){logger[_0x0a9e('0x16')](_0x46f0a5);_0x25ce3a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));return downloadFile(_0x46f0a5,_0x25ce3a);})[_0x0a9e('0x29')](function(){_0x5180f1=path['resolve'](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27'));return convertFile(_0x25ce3a,_0x5180f1);})[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x25ce3a);fs[_0x0a9e('0x2a')](_0x5180f1,'777');}catch(_0x191e91){logger[_0x0a9e('0x18')](_0x191e91);}logger[_0x0a9e('0x16')](_0x0a9e('0x30'),_0x5180f1['split']('.')[0x0]);return _0x5180f1['split']('.')[0x0];});};exports[_0x0a9e('0x31')]=function(_0x5640eb,_0x24936a,_0x3d9717){return google[_0x0a9e('0x32')](_0x5640eb,_0x24936a,_0x3d9717)[_0x0a9e('0x29')](function(_0x4f41ae){logger[_0x0a9e('0x16')](_0x4f41ae[_0x0a9e('0x33')]);return rp(_0x4f41ae);})[_0x0a9e('0x29')](function(_0x533942){var _0x1dbf74='';var _0x1a180b=0x0;try{fs[_0x0a9e('0x19')](_0x5640eb);}catch(_0x4c1c0e){logger['error'](_0x4c1c0e);}if(_0x533942&&_0x533942[_0x0a9e('0x34')]){_0x1dbf74=_0x533942[_0x0a9e('0x34')]['map'](function(_0x2b814e){return _0x2b814e&&_0x2b814e[_0x0a9e('0x35')][0x0]&&_0x2b814e[_0x0a9e('0x35')][0x0][_0x0a9e('0x36')]?_0x2b814e['alternatives'][0x0]['transcript']:'';})[_0x0a9e('0x37')]('\x0a');_0x1a180b=_0x533942[_0x0a9e('0x34')]['map'](function(_0x183991){return _0x183991&&_0x183991[_0x0a9e('0x35')][0x0]&&_0x183991[_0x0a9e('0x35')][0x0]['confidence']?_0x183991[_0x0a9e('0x35')][0x0][_0x0a9e('0x38')]:0x0;})[_0x0a9e('0x37')]('\x0a');}logger[_0x0a9e('0x16')](_0x0a9e('0x39'),_0x1dbf74);logger[_0x0a9e('0x16')](_0x0a9e('0x3a'),_0x1a180b);return{'transcript':_0x1dbf74,'confidence':_0x1a180b};})[_0x0a9e('0x3b')](function(_0x23b089){logger[_0x0a9e('0x18')](_0x0a9e('0x3c'),_0x23b089[_0x0a9e('0x11')],_0x23b089[_0x0a9e('0x3d')],_0x23b089[_0x0a9e('0x3e')]);});};exports[_0x0a9e('0x3f')]=function(_0x4d04c8,_0x52628e,_0x473fdc,_0xb3795a){var _0x405c8f=apiai(_0x52628e,{'language':_0xb3795a||'en'});return _0x405c8f[_0x0a9e('0x40')](_0x473fdc,{'sessionId':md5(_0x4d04c8)})[_0x0a9e('0x29')](function(_0xc9a702){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0xc9a702));return{'source':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x43')],'resolvedQuery':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x44')],'action':_0xc9a702['result'][_0x0a9e('0x45')],'actionIncomplete':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x46')],'speech':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x47')][_0x0a9e('0x48')],'score':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x49')],'statusCode':_0xc9a702['status'][_0x0a9e('0x4a')],'endConversation':_0xc9a702['result'][_0x0a9e('0x4b')][_0x0a9e('0x4c')]||![],'isFallbackIntent':_0xc9a702[_0x0a9e('0x42')]['metadata'][_0x0a9e('0x4d')]};});};exports[_0x0a9e('0x4e')]=function(_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73){return tilde[_0x0a9e('0x32')](_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73)['then'](function(_0x13f44d){try{fs[_0x0a9e('0x19')](_0x4774f4);}catch(_0x1b5e80){logger[_0x0a9e('0x18')](_0x1b5e80);}logger[_0x0a9e('0x16')](_0x0a9e('0x4f'),_0x13f44d[_0x0a9e('0x36')]);logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x13f44d['confidence']);return _0x13f44d;});};exports[_0x0a9e('0x51')]=function(_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3){var _0x37edaa=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x375c18;return aws['polly'](_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3,_0x37edaa)['then'](function(){_0x375c18=path['resolve'](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x37edaa,_0x375c18);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x37edaa);fs[_0x0a9e('0x2a')](_0x375c18,'777');}catch(_0x5a88da){logger[_0x0a9e('0x18')](_0x5a88da);}return _0x375c18['split']('.')[0x0];});};exports[_0x0a9e('0x52')]=function(_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return aws[_0x0a9e('0x53')](_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da)['then'](function(_0x50f687){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0x50f687));return _0x50f687;});};exports['ispeechTTS']=function(_0x145931,_0x5ce9ac,_0x211ef9,_0x523cd2){var _0xe22ccc=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x145931,encodeURIComponent(_0x5ce9ac),_0x211ef9,_0x523cd2);var _0x5df0ad=path[_0x0a9e('0x24')](__dirname,'tmp',rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x3cfd00;return downloadFile(_0xe22ccc,_0x5df0ad)[_0x0a9e('0x29')](function(){_0x3cfd00=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x5df0ad,_0x3cfd00);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x5df0ad);fs[_0x0a9e('0x2a')](_0x3cfd00,_0x0a9e('0x2b'));}catch(_0x30c491){logger[_0x0a9e('0x18')](_0x30c491);}return _0x3cfd00[_0x0a9e('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x956fbe,_0x26bc80,_0x5239ef,_0x3649cc){var _0x5cc8fb=util[_0x0a9e('0x54')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x26bc80,_0x5239ef,base64Encode(_0x956fbe),_0x3649cc?util['format']('model=%s',encodeURIComponent(_0x3649cc)):_0x0a9e('0x55'));return uploadFile(_0x5cc8fb)['then'](function(_0x2244d6){return querystring[_0x0a9e('0x56')](_0x2244d6);});};exports[_0x0a9e('0x57')]=function(_0x7be420,_0x1cca9f){return sestek[_0x0a9e('0x58')](_0x7be420,_0x1cca9f)['then'](function(_0x1627a7){logger['info'](JSON[_0x0a9e('0x41')](_0x1627a7));var _0x1f07cb={'speech':_0x1627a7[_0x0a9e('0x59')],'action':_0x1627a7['channelData']?_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5b')]:undefined,'actiondata':_0x1627a7[_0x0a9e('0x5a')]?_0x1627a7[_0x0a9e('0x5a')]['CustomActionData']:undefined};if(_0x1627a7[_0x0a9e('0x5a')]&&_0x1627a7[_0x0a9e('0x5a')]['AudioFromTts']){return base64Decode(_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5c')][_0x0a9e('0x5d')],path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27')))[_0x0a9e('0x29')](function(_0x281c7d){_0x1f07cb['audiofile']=_0x281c7d;return _0x1f07cb;});}return _0x1f07cb;});};exports[_0x0a9e('0x5e')]=function(){return __dirname;}; \ No newline at end of file +var _0xa9e0=['text','channelData','CustomAction','AudioFromTts','Data','dirName','path','http','https','bluebird','sox','request-promise','util','querystring','moment','apiai-promise','md5','./google','./sestek','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','error','unlink','download\x20error','pipe','end','protocol','https:','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','split','readFileSync','googleTTS','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','format','freeform=3','parse','sestekNDA','nda'];(function(_0xc97abf,_0xb5ec20){var _0x49751a=function(_0x2c3346){while(--_0x2c3346){_0xc97abf['push'](_0xc97abf['shift']());}};_0x49751a(++_0xb5ec20);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var fs=require('fs');var path=require(_0x0a9e('0x0'));var http=require(_0x0a9e('0x1'));var https=require(_0x0a9e('0x2'));var urlParse=require('url')['parse'];var BPromise=require(_0x0a9e('0x3'));var rs=require('randomstring');var sox=require(_0x0a9e('0x4'));var rp=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var querystring=require(_0x0a9e('0x7'));var moment=require(_0x0a9e('0x8'));var tts=require('google-tts-api');var apiai=require(_0x0a9e('0x9'));var md5=require(_0x0a9e('0xa'));var google=require(_0x0a9e('0xb'));var aws=require('./aws');var tilde=require('./tilde');var sestek=require(_0x0a9e('0xc'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x0a9e('0xd');function downloadFile(_0xf81284,_0x307b3e){return new BPromise(function(_0x3ab53f,_0xfeb75b){var _0xbd1168=urlParse(_0xf81284);var _0x4a4c56=_0xbd1168['protocol']==='https:'?https:http;var _0x4cfe67={'host':_0xbd1168[_0x0a9e('0xe')],'path':_0xbd1168[_0x0a9e('0x0')],'headers':{'user-agent':_0x0a9e('0xf')}};_0x4a4c56[_0x0a9e('0x10')](_0x4cfe67,function(_0x32d742){if(_0x32d742[_0x0a9e('0x11')]!==0xc8){logger['error'](_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742[_0x0a9e('0x11')]+'\x20('+_0x32d742[_0x0a9e('0x14')]+')');_0xfeb75b(new Error(_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742['statusCode']+'\x20('+_0x32d742[_0x0a9e('0x14')]+')'));return;}var _0x5d0880=fs[_0x0a9e('0x15')](_0x307b3e);_0x5d0880['on']('finish',function(){logger[_0x0a9e('0x16')](_0x0a9e('0x17'));_0x5d0880['close'](_0x3ab53f);});_0x5d0880['on'](_0x0a9e('0x18'),function(_0x5a0a06){fs[_0x0a9e('0x19')](_0x307b3e);logger[_0x0a9e('0x18')](_0x0a9e('0x1a'),_0x5a0a06);_0xfeb75b(_0x5a0a06);});_0x32d742[_0x0a9e('0x1b')](_0x5d0880);})['on'](_0x0a9e('0x18'),function(_0x2eb11f){logger[_0x0a9e('0x18')](_0x2eb11f);_0xfeb75b(_0x2eb11f);})[_0x0a9e('0x1c')]();});}function uploadFile(_0x1314ae){return new BPromise(function(_0x112016,_0x1c696a){var _0x105080=urlParse(_0x1314ae);var _0x4bb1e3=_0x105080[_0x0a9e('0x1d')]===_0x0a9e('0x1e')?https:http;var _0x53682f={'host':_0x105080[_0x0a9e('0xe')],'path':_0x105080['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x4bb1e3[_0x0a9e('0x10')](_0x53682f,function(_0x432e56){if(_0x432e56[_0x0a9e('0x11')]!==0xc8){_0x1c696a(new Error(_0x0a9e('0x12')+_0x1314ae+'\x20failed,\x20status\x20code\x20=\x20'+_0x432e56[_0x0a9e('0x11')]+'\x20('+_0x432e56[_0x0a9e('0x14')]+')'));return;}var _0x3b45bc='';_0x432e56['on'](_0x0a9e('0x1f'),function(_0x370d86){_0x3b45bc+=_0x370d86;});_0x432e56['on'](_0x0a9e('0x1c'),function(){_0x112016(_0x3b45bc);});})['on'](_0x0a9e('0x18'),function(_0x5ea472){_0x1c696a(_0x5ea472);})['end']();});}function convertFile(_0x197ec0,_0x3a8e58){return new BPromise(function(_0x40c424,_0x33161b){var _0x526cf3=sox[_0x0a9e('0x20')](_0x197ec0,_0x3a8e58,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x526cf3['on'](_0x0a9e('0x18'),function(_0x5bfb33){logger[_0x0a9e('0x18')](_0x0a9e('0x21'),_0x5bfb33);_0x33161b(_0x5bfb33);});_0x526cf3['on'](_0x0a9e('0x1c'),function(){logger[_0x0a9e('0x16')](_0x0a9e('0x22'));_0x40c424();});_0x526cf3[_0x0a9e('0x23')]();});}function base64Decode(_0x11c3b6,_0x14de77){var _0x5a101a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));fs['writeFileSync'](_0x5a101a,_0x11c3b6,_0x0a9e('0x28'));return convertFile(_0x5a101a,_0x14de77)[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x5a101a);fs[_0x0a9e('0x2a')](_0x14de77,_0x0a9e('0x2b'));}catch(_0x563b45){logger[_0x0a9e('0x18')](_0x563b45);}return _0x14de77[_0x0a9e('0x2c')]('.')[0x0];});}function base64Encode(_0x1dbde2){var _0x540530=fs[_0x0a9e('0x2d')](_0x1dbde2);return new Buffer(_0x540530)['toString'](_0x0a9e('0x28'));}exports[_0x0a9e('0x2e')]=function(_0x1122db,_0x33bdb7){var _0x25ce3a,_0x5180f1;return tts(_0x1122db,_0x33bdb7||'en',0x1)[_0x0a9e('0x29')](function(_0x46f0a5){logger[_0x0a9e('0x16')](_0x46f0a5);_0x25ce3a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));return downloadFile(_0x46f0a5,_0x25ce3a);})[_0x0a9e('0x29')](function(){_0x5180f1=path['resolve'](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27'));return convertFile(_0x25ce3a,_0x5180f1);})[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x25ce3a);fs[_0x0a9e('0x2a')](_0x5180f1,'777');}catch(_0x191e91){logger[_0x0a9e('0x18')](_0x191e91);}logger[_0x0a9e('0x16')](_0x0a9e('0x30'),_0x5180f1['split']('.')[0x0]);return _0x5180f1['split']('.')[0x0];});};exports[_0x0a9e('0x31')]=function(_0x5640eb,_0x24936a,_0x3d9717){return google[_0x0a9e('0x32')](_0x5640eb,_0x24936a,_0x3d9717)[_0x0a9e('0x29')](function(_0x4f41ae){logger[_0x0a9e('0x16')](_0x4f41ae[_0x0a9e('0x33')]);return rp(_0x4f41ae);})[_0x0a9e('0x29')](function(_0x533942){var _0x1dbf74='';var _0x1a180b=0x0;try{fs[_0x0a9e('0x19')](_0x5640eb);}catch(_0x4c1c0e){logger['error'](_0x4c1c0e);}if(_0x533942&&_0x533942[_0x0a9e('0x34')]){_0x1dbf74=_0x533942[_0x0a9e('0x34')]['map'](function(_0x2b814e){return _0x2b814e&&_0x2b814e[_0x0a9e('0x35')][0x0]&&_0x2b814e[_0x0a9e('0x35')][0x0][_0x0a9e('0x36')]?_0x2b814e['alternatives'][0x0]['transcript']:'';})[_0x0a9e('0x37')]('\x0a');_0x1a180b=_0x533942[_0x0a9e('0x34')]['map'](function(_0x183991){return _0x183991&&_0x183991[_0x0a9e('0x35')][0x0]&&_0x183991[_0x0a9e('0x35')][0x0]['confidence']?_0x183991[_0x0a9e('0x35')][0x0][_0x0a9e('0x38')]:0x0;})[_0x0a9e('0x37')]('\x0a');}logger[_0x0a9e('0x16')](_0x0a9e('0x39'),_0x1dbf74);logger[_0x0a9e('0x16')](_0x0a9e('0x3a'),_0x1a180b);return{'transcript':_0x1dbf74,'confidence':_0x1a180b};})[_0x0a9e('0x3b')](function(_0x23b089){logger[_0x0a9e('0x18')](_0x0a9e('0x3c'),_0x23b089[_0x0a9e('0x11')],_0x23b089[_0x0a9e('0x3d')],_0x23b089[_0x0a9e('0x3e')]);});};exports[_0x0a9e('0x3f')]=function(_0x4d04c8,_0x52628e,_0x473fdc,_0xb3795a){var _0x405c8f=apiai(_0x52628e,{'language':_0xb3795a||'en'});return _0x405c8f[_0x0a9e('0x40')](_0x473fdc,{'sessionId':md5(_0x4d04c8)})[_0x0a9e('0x29')](function(_0xc9a702){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0xc9a702));return{'source':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x43')],'resolvedQuery':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x44')],'action':_0xc9a702['result'][_0x0a9e('0x45')],'actionIncomplete':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x46')],'speech':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x47')][_0x0a9e('0x48')],'score':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x49')],'statusCode':_0xc9a702['status'][_0x0a9e('0x4a')],'endConversation':_0xc9a702['result'][_0x0a9e('0x4b')][_0x0a9e('0x4c')]||![],'isFallbackIntent':_0xc9a702[_0x0a9e('0x42')]['metadata'][_0x0a9e('0x4d')]};});};exports[_0x0a9e('0x4e')]=function(_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73){return tilde[_0x0a9e('0x32')](_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73)['then'](function(_0x13f44d){try{fs[_0x0a9e('0x19')](_0x4774f4);}catch(_0x1b5e80){logger[_0x0a9e('0x18')](_0x1b5e80);}logger[_0x0a9e('0x16')](_0x0a9e('0x4f'),_0x13f44d[_0x0a9e('0x36')]);logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x13f44d['confidence']);return _0x13f44d;});};exports[_0x0a9e('0x51')]=function(_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3){var _0x37edaa=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x375c18;return aws['polly'](_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3,_0x37edaa)['then'](function(){_0x375c18=path['resolve'](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x37edaa,_0x375c18);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x37edaa);fs[_0x0a9e('0x2a')](_0x375c18,'777');}catch(_0x5a88da){logger[_0x0a9e('0x18')](_0x5a88da);}return _0x375c18['split']('.')[0x0];});};exports[_0x0a9e('0x52')]=function(_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return aws[_0x0a9e('0x53')](_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da)['then'](function(_0x50f687){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0x50f687));return _0x50f687;});};exports['ispeechTTS']=function(_0x145931,_0x5ce9ac,_0x211ef9,_0x523cd2){var _0xe22ccc=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x145931,encodeURIComponent(_0x5ce9ac),_0x211ef9,_0x523cd2);var _0x5df0ad=path[_0x0a9e('0x24')](__dirname,'tmp',rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x3cfd00;return downloadFile(_0xe22ccc,_0x5df0ad)[_0x0a9e('0x29')](function(){_0x3cfd00=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x5df0ad,_0x3cfd00);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x5df0ad);fs[_0x0a9e('0x2a')](_0x3cfd00,_0x0a9e('0x2b'));}catch(_0x30c491){logger[_0x0a9e('0x18')](_0x30c491);}return _0x3cfd00[_0x0a9e('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x956fbe,_0x26bc80,_0x5239ef,_0x3649cc){var _0x5cc8fb=util[_0x0a9e('0x54')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x26bc80,_0x5239ef,base64Encode(_0x956fbe),_0x3649cc?util['format']('model=%s',encodeURIComponent(_0x3649cc)):_0x0a9e('0x55'));return uploadFile(_0x5cc8fb)['then'](function(_0x2244d6){return querystring[_0x0a9e('0x56')](_0x2244d6);});};exports[_0x0a9e('0x57')]=function(_0x7be420,_0x1cca9f){return sestek[_0x0a9e('0x58')](_0x7be420,_0x1cca9f)['then'](function(_0x1627a7){logger['info'](JSON[_0x0a9e('0x41')](_0x1627a7));var _0x1f07cb={'speech':_0x1627a7[_0x0a9e('0x59')],'action':_0x1627a7['channelData']?_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5b')]:undefined,'actiondata':_0x1627a7[_0x0a9e('0x5a')]?_0x1627a7[_0x0a9e('0x5a')]['CustomActionData']:undefined};if(_0x1627a7[_0x0a9e('0x5a')]&&_0x1627a7[_0x0a9e('0x5a')]['AudioFromTts']){return base64Decode(_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5c')][_0x0a9e('0x5d')],path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27')))[_0x0a9e('0x29')](function(_0x281c7d){_0x1f07cb['audiofile']=_0x281c7d;return _0x1f07cb;});}return _0x1f07cb;});};exports[_0x0a9e('0x5e')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 58aa26e..a1e950c 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 _0x66a2=['exports','./nda'];(function(_0x3e6b2f,_0x1ffa07){var _0x323215=function(_0x5c4d82){while(--_0x5c4d82){_0x3e6b2f['push'](_0x3e6b2f['shift']());}};_0x323215(++_0x1ffa07);}(_0x66a2,0xf3));var _0x266a=function(_0x32aa91,_0x122622){_0x32aa91=_0x32aa91-0x0;var _0x19442d=_0x66a2[_0x32aa91];return _0x19442d;};var nda=require(_0x266a('0x0'));module[_0x266a('0x1')]={'nda':nda}; \ No newline at end of file +var _0xa512=['exports','./nda'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xa512,0x1d1));var _0x2a51=function(_0xb04cb1,_0x13b8e3){_0xb04cb1=_0xb04cb1-0x0;var _0x309445=_0xa512[_0xb04cb1];return _0x309445;};var nda=require(_0x2a51('0x0'));module[_0x2a51('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index bda9250..e272f88 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 _0x8250=['password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','callerid','calleridname','dnid','extension','text','access_token','project','body','channelData','ProjectName','AudioOutputSettings','audio/wav','custom_action','CustomActionData','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url'];(function(_0x22cdb5,_0x26b132){var _0x2c5618=function(_0x474094){while(--_0x474094){_0x22cdb5['push'](_0x22cdb5['shift']());}};_0x2c5618(++_0x26b132);}(_0x8250,0x121));var _0x0825=function(_0x2ad477,_0x323d3a){_0x2ad477=_0x2ad477-0x0;var _0x3083da=_0x8250[_0x2ad477];return _0x3083da;};'use strict';var rp=require(_0x0825('0x0'));var url=require(_0x0825('0x1'));var logger=require(_0x0825('0x2'))(_0x0825('0x3'));module[_0x0825('0x4')]=function(_0xfe6789,_0x4f022c){var _0x42fc21={'method':_0x0825('0x5'),'uri':url[_0x0825('0x6')](_0x4f022c[_0x0825('0x7')],'/token'),'form':{'grant_type':_0x0825('0x8'),'username':_0x4f022c[_0x0825('0x9')],'password':_0x4f022c[_0x0825('0x8')]},'json':!![]};return rp(_0x42fc21)[_0x0825('0xa')](function(_0x4e884e){var _0x21981a={'method':_0x0825('0x5'),'uri':url[_0x0825('0x6')](_0x4f022c[_0x0825('0xb')],_0x0825('0xc')),'body':{'type':_0x4f022c[_0x0825('0xd')]||_0x0825('0xe'),'channelId':'Nda','conversation':{'id':_0xfe6789[_0x0825('0xf')]},'from':{'id':_0xfe6789[_0x0825('0x10')],'name':_0xfe6789[_0x0825('0x11')]},'recipient':{'id':_0xfe6789[_0x0825('0x12')],'name':_0xfe6789[_0x0825('0x13')]},'text':_0x4f022c[_0x0825('0x14')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x4e884e[_0x0825('0x15')]},'json':!![]};if(_0x4f022c[_0x0825('0x16')]){_0x21981a[_0x0825('0x17')][_0x0825('0x18')][_0x0825('0x19')]=_0x4f022c[_0x0825('0x16')];}if(_0x4f022c['ndagenerate_audio']=='1'){_0x21981a[_0x0825('0x17')][_0x0825('0x18')][_0x0825('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x0825('0x1b')};}if(_0x4f022c[_0x0825('0x1c')]){_0x21981a[_0x0825('0x17')][_0x0825('0x18')]['CustomAction']=_0x4f022c[_0x0825('0x1c')];if(_0x4f022c['custom_action_data']){_0x21981a[_0x0825('0x17')][_0x0825('0x18')][_0x0825('0x1d')]=_0x4f022c[_0x0825('0x1e')];}}logger[_0x0825('0x1f')](JSON[_0x0825('0x20')](_0x21981a));return rp(_0x21981a);});}; \ No newline at end of file +var _0xbf39=['exports','POST','resolve','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','project','body','channelData','AudioOutputSettings','audio/wav','custom_action','custom_action_data','info','stringify','request-promise','url','agi'];(function(_0x255ac0,_0x3f6645){var _0x437bf1=function(_0x5baff0){while(--_0x5baff0){_0x255ac0['push'](_0x255ac0['shift']());}};_0x437bf1(++_0x3f6645);}(_0xbf39,0xab));var _0x9bf3=function(_0x38eccc,_0x2da824){_0x38eccc=_0x38eccc-0x0;var _0x25d4cb=_0xbf39[_0x38eccc];return _0x25d4cb;};'use strict';var rp=require(_0x9bf3('0x0'));var url=require(_0x9bf3('0x1'));var logger=require('../../../../../config/logger')(_0x9bf3('0x2'));module[_0x9bf3('0x3')]=function(_0xfaa474,_0x9ef4f4){var _0x197433={'method':_0x9bf3('0x4'),'uri':url[_0x9bf3('0x5')](_0x9ef4f4['ndauth_url'],_0x9bf3('0x6')),'form':{'grant_type':_0x9bf3('0x7'),'username':_0x9ef4f4[_0x9bf3('0x8')],'password':_0x9ef4f4[_0x9bf3('0x7')]},'json':!![]};return rp(_0x197433)[_0x9bf3('0x9')](function(_0x5a85af){var _0x25186c={'method':_0x9bf3('0x4'),'uri':url[_0x9bf3('0x5')](_0x9ef4f4[_0x9bf3('0xa')],_0x9bf3('0xb')),'body':{'type':_0x9ef4f4['ndaactivity_type']||'message','channelId':_0x9bf3('0xc'),'conversation':{'id':_0xfaa474[_0x9bf3('0xd')]},'from':{'id':_0xfaa474[_0x9bf3('0xe')],'name':_0xfaa474[_0x9bf3('0xf')]},'recipient':{'id':_0xfaa474[_0x9bf3('0x10')],'name':_0xfaa474[_0x9bf3('0x11')]},'text':_0x9ef4f4[_0x9bf3('0x12')],'channelData':{}},'headers':{'Authorization':_0x9bf3('0x13')+_0x5a85af['access_token']},'json':!![]};if(_0x9ef4f4[_0x9bf3('0x14')]){_0x25186c[_0x9bf3('0x15')][_0x9bf3('0x16')]['ProjectName']=_0x9ef4f4['project'];}if(_0x9ef4f4['ndagenerate_audio']=='1'){_0x25186c[_0x9bf3('0x15')][_0x9bf3('0x16')][_0x9bf3('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x9bf3('0x18')};}if(_0x9ef4f4['custom_action']){_0x25186c[_0x9bf3('0x15')][_0x9bf3('0x16')]['CustomAction']=_0x9ef4f4[_0x9bf3('0x19')];if(_0x9ef4f4[_0x9bf3('0x1a')]){_0x25186c[_0x9bf3('0x15')][_0x9bf3('0x16')]['CustomActionData']=_0x9ef4f4[_0x9bf3('0x1a')];}}logger[_0x9bf3('0x1b')](JSON[_0x9bf3('0x1c')](_0x25186c));return rp(_0x25186c);});}; \ 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 7d2b278..afa0610 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 _0xa74d=['exports'];(function(_0x26d4b8,_0x2a71ee){var _0x872a2=function(_0x11e76c){while(--_0x11e76c){_0x26d4b8['push'](_0x26d4b8['shift']());}};_0x872a2(++_0x2a71ee);}(_0xa74d,0x166));var _0xda74=function(_0x3b0e38,_0x231369){_0x3b0e38=_0x3b0e38-0x0;var _0x61585f=_0xa74d[_0x3b0e38];return _0x61585f;};'use strict';var asr=require('./lib/api');module[_0xda74('0x0')]=function(_0x2b22f1,_0xecddf2,_0x46594c,_0x50d659){return asr(_0x2b22f1,_0xecddf2,_0x46594c,_0x50d659);}; \ No newline at end of file +var _0x9b09=['exports','./lib/api'];(function(_0x1fc84d,_0x3f469d){var _0x2658fa=function(_0x189ad0){while(--_0x189ad0){_0x1fc84d['push'](_0x1fc84d['shift']());}};_0x2658fa(++_0x3f469d);}(_0x9b09,0x1e7));var _0x99b0=function(_0x32cce8,_0x18762f){_0x32cce8=_0x32cce8-0x0;var _0x4a732b=_0x9b09[_0x32cce8];return _0x4a732b;};'use strict';var asr=require(_0x99b0('0x0'));module[_0x99b0('0x1')]=function(_0x261ca7,_0x589f55,_0x2cedd0,_0x2d0f73){return asr(_0x261ca7,_0x589f55,_0x2cedd0,_0x2d0f73);}; \ 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 d57f557..185f8dc 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 _0xd0a7=['unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','result','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket'];(function(_0x23e170,_0x94298d){var _0x567cc4=function(_0x126c68){while(--_0x126c68){_0x23e170['push'](_0x23e170['shift']());}};_0x567cc4(++_0x94298d);}(_0xd0a7,0xda));var _0x7d0a=function(_0x2baab5,_0x3f300d){_0x2baab5=_0x2baab5-0x0;var _0xeebab6=_0xd0a7[_0x2baab5];return _0xeebab6;};'use strict';var BPromise=require(_0x7d0a('0x0'));var _=require(_0x7d0a('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x7d0a('0x2'));var crypto=require(_0x7d0a('0x3'));var logger=require(_0x7d0a('0x4'))(_0x7d0a('0x5'));module[_0x7d0a('0x6')]=function(_0xd0638b,_0x429997,_0x360290,_0x8876f8){return new BPromise(function(_0x3b0ecd,_0x38569c){logger[_0x7d0a('0x7')](_0x7d0a('0x8'),_0x8876f8||_0x7d0a('0x9'));var _0x37934e=new WebSocket(_0x8876f8||_0x7d0a('0x9'),{'perMessageDeflate':![]});var _0x30c32f='';var _0x42f8d7='0';var _0x273ea6='1';var _0x1b8698=_0x7d0a('0xa');function _0x2e865b(_0x22e180){var _0x325c07=crypto[_0x7d0a('0xb')](_0x7d0a('0xc'));_0x325c07[_0x7d0a('0xd')](_0x22e180);return _0x325c07['digest'](_0x7d0a('0xe'));}function _0x33b411(){try{logger[_0x7d0a('0x7')](_0x7d0a('0xf'));var _0x38e2c7=moment()[_0x7d0a('0x10')]();var _0x4e7928=_0x2e865b(_0x38e2c7+_0x429997+_0x360290);_0x37934e[_0x7d0a('0x11')](JSON[_0x7d0a('0x12')]({'appID':_0x429997,'timestamp':_0x38e2c7,'appKey':_0x4e7928}));var _0x3bb403=fs[_0x7d0a('0x13')](_0xd0638b);_0x3bb403['on'](_0x7d0a('0x14'),function(_0x27a552){_0x37934e[_0x7d0a('0x11')](_0x27a552);});_0x3bb403['on'](_0x7d0a('0x15'),function(){_0x37934e[_0x7d0a('0x11')](_0x7d0a('0x16'));});}catch(_0x59c5d5){logger[_0x7d0a('0x17')](_0x7d0a('0x18'),JSON[_0x7d0a('0x12')](_0x59c5d5));_0x37934e[_0x7d0a('0x19')]();}}function _0x128540(_0x2dcc07){try{if(_0x2dcc07){var _0x54200f=JSON['parse'](_0x2dcc07);switch(_0x54200f['status']){case 0x0:if(_0x54200f['result']){if(_0x54200f[_0x7d0a('0x1a')]['final']){logger[_0x7d0a('0x7')]('Tilde\x20ASR\x20hypoteses',JSON[_0x7d0a('0x12')](_0x54200f[_0x7d0a('0x1a')][_0x7d0a('0x1b')]));_0x30c32f=_0x54200f['result']['hypotheses'][0x0][_0x7d0a('0x1c')];_0x42f8d7=_0x54200f[_0x7d0a('0x1a')][_0x7d0a('0x1b')][0x0][_0x7d0a('0x1d')];_0x273ea6='0';_0x1b8698=_0x7d0a('0x1e');_0x37934e[_0x7d0a('0x19')]();}}break;case 0x1:logger[_0x7d0a('0x7')](_0x7d0a('0xa'));_0x273ea6='1';_0x1b8698=_0x7d0a('0xa');break;case 0x2:logger[_0x7d0a('0x7')](_0x7d0a('0x1f'));_0x273ea6='2';_0x1b8698=_0x7d0a('0x1f');break;case 0x9:logger[_0x7d0a('0x7')](_0x7d0a('0x20'));_0x273ea6='9';_0x1b8698='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x7d0a('0x7')]('Authentication\x20failed.');_0x273ea6='10';_0x1b8698=_0x7d0a('0x21');break;case 0xb:logger[_0x7d0a('0x7')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x273ea6='11';_0x1b8698='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x7f2d18){logger[_0x7d0a('0x17')](_0x7d0a('0x22'),JSON[_0x7d0a('0x12')](_0x7f2d18));_0x37934e[_0x7d0a('0x19')]();}}function _0x1d1cf4(){logger[_0x7d0a('0x7')](_0x7d0a('0x23'));_0x3b0ecd({'transcript':_0x30c32f,'confidence':_0x42f8d7,'status':_0x273ea6,'status_message':_0x1b8698});}function _0x35c99a(_0x3ec7d0){logger[_0x7d0a('0x17')](_0x7d0a('0x24'));if(!_[_0x7d0a('0x25')](_0x3ec7d0)){logger[_0x7d0a('0x17')](_['isObject'](_0x3ec7d0)?JSON[_0x7d0a('0x12')](_0x3ec7d0):_0x3ec7d0);}}_0x37934e['on'](_0x7d0a('0x26'),_0x33b411);_0x37934e['on']('message',_0x128540);_0x37934e['on'](_0x7d0a('0x15'),_0x1d1cf4);_0x37934e['on'](_0x7d0a('0x17'),_0x35c99a);});}; \ No newline at end of file +var _0x9814=['final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','bluebird','lodash','crypto','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','close','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result'];(function(_0x1ea726,_0x2a9c43){var _0x5e72d4=function(_0x43f270){while(--_0x43f270){_0x1ea726['push'](_0x1ea726['shift']());}};_0x5e72d4(++_0x2a9c43);}(_0x9814,0xa3));var _0x4981=function(_0x4de23e,_0x3a2a45){_0x4de23e=_0x4de23e-0x0;var _0x282a65=_0x9814[_0x4de23e];return _0x282a65;};'use strict';var BPromise=require(_0x4981('0x0'));var _=require(_0x4981('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x4981('0x2'));var logger=require('../../../../../../config/logger')('agi');module[_0x4981('0x3')]=function(_0x1037ae,_0x3d560b,_0x2825f1,_0x1cf156){return new BPromise(function(_0x26f46e,_0x3bf3db){logger[_0x4981('0x4')](_0x4981('0x5'),_0x1cf156||_0x4981('0x6'));var _0x1d4ecf=new WebSocket(_0x1cf156||_0x4981('0x6'),{'perMessageDeflate':![]});var _0x4e01ee='';var _0x4ffa66='0';var _0x33644f='1';var _0x39ada8=_0x4981('0x7');function _0x5de860(_0x555d6b){var _0x4fad9a=crypto[_0x4981('0x8')]('sha1');_0x4fad9a[_0x4981('0x9')](_0x555d6b);return _0x4fad9a[_0x4981('0xa')]('hex');}function _0x4c5f84(){try{logger[_0x4981('0x4')](_0x4981('0xb'));var _0x9ae1f8=moment()[_0x4981('0xc')]();var _0x1f1ad7=_0x5de860(_0x9ae1f8+_0x3d560b+_0x2825f1);_0x1d4ecf[_0x4981('0xd')](JSON[_0x4981('0xe')]({'appID':_0x3d560b,'timestamp':_0x9ae1f8,'appKey':_0x1f1ad7}));var _0x425d72=fs[_0x4981('0xf')](_0x1037ae);_0x425d72['on']('data',function(_0x1a9138){_0x1d4ecf[_0x4981('0xd')](_0x1a9138);});_0x425d72['on'](_0x4981('0x10'),function(){_0x1d4ecf[_0x4981('0xd')]('EOS');});}catch(_0x4374ee){logger[_0x4981('0x11')](_0x4981('0x12'),JSON['stringify'](_0x4374ee));_0x1d4ecf[_0x4981('0x13')]();}}function _0x480610(_0x23fb44){try{if(_0x23fb44){var _0xccb10d=JSON[_0x4981('0x14')](_0x23fb44);switch(_0xccb10d['status']){case 0x0:if(_0xccb10d['result']){if(_0xccb10d[_0x4981('0x15')][_0x4981('0x16')]){logger['info'](_0x4981('0x17'),JSON[_0x4981('0xe')](_0xccb10d[_0x4981('0x15')][_0x4981('0x18')]));_0x4e01ee=_0xccb10d[_0x4981('0x15')][_0x4981('0x18')][0x0][_0x4981('0x19')];_0x4ffa66=_0xccb10d[_0x4981('0x15')][_0x4981('0x18')][0x0][_0x4981('0x1a')];_0x33644f='0';_0x39ada8=_0x4981('0x1b');_0x1d4ecf[_0x4981('0x13')]();}}break;case 0x1:logger[_0x4981('0x4')](_0x4981('0x7'));_0x33644f='1';_0x39ada8=_0x4981('0x7');break;case 0x2:logger[_0x4981('0x4')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x33644f='2';_0x39ada8=_0x4981('0x1c');break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x33644f='9';_0x39ada8=_0x4981('0x1d');break;case 0xa:logger[_0x4981('0x4')]('Authentication\x20failed.');_0x33644f='10';_0x39ada8=_0x4981('0x1e');break;case 0xb:logger[_0x4981('0x4')](_0x4981('0x1f'));_0x33644f='11';_0x39ada8=_0x4981('0x1f');}}}catch(_0x185f81){logger[_0x4981('0x11')](_0x4981('0x20'),JSON[_0x4981('0xe')](_0x185f81));_0x1d4ecf[_0x4981('0x13')]();}}function _0x302a6f(){logger[_0x4981('0x4')](_0x4981('0x21'));_0x26f46e({'transcript':_0x4e01ee,'confidence':_0x4ffa66,'status':_0x33644f,'status_message':_0x39ada8});}function _0x4ab990(_0x1e25ef){logger['error'](_0x4981('0x22'));if(!_[_0x4981('0x23')](_0x1e25ef)){logger[_0x4981('0x11')](_[_0x4981('0x24')](_0x1e25ef)?JSON[_0x4981('0xe')](_0x1e25ef):_0x1e25ef);}}_0x1d4ecf['on']('open',_0x4c5f84);_0x1d4ecf['on']('message',_0x480610);_0x1d4ecf['on']('close',_0x302a6f);_0x1d4ecf['on'](_0x4981('0x11'),_0x4ab990);});}; \ 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 10cb4be..4917947 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 asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0x34e8=['./asr','exports'];(function(_0x20229e,_0xa59f8a){var _0x317377=function(_0x290697){while(--_0x290697){_0x20229e['push'](_0x20229e['shift']());}};_0x317377(++_0xa59f8a);}(_0x34e8,0x12c));var _0x834e=function(_0x1f1be7,_0x4c39b3){_0x1f1be7=_0x1f1be7-0x0;var _0x2dcac4=_0x34e8[_0x1f1be7];return _0x2dcac4;};var asr=require(_0x834e('0x0'));module[_0x834e('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index fe7a35e..18de702 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 _0x0ffc=['emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','destroy','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','inherits','net','events','./error','127.0.0.1'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0ffc,0x9e));var _0xc0ff=function(_0x544f50,_0x86e4f0){_0x544f50=_0x544f50-0x0;var _0x5a9855=_0x0ffc[_0x544f50];return _0x5a9855;};'use strict';var util=require('util');var net=require(_0xc0ff('0x0'));var EventEmitter=require(_0xc0ff('0x1'))['EventEmitter'];var AGIError=require(_0xc0ff('0x2'));var AGIChannel=require('./channel');var AGIServer=function(_0x10f71b,_0x114cd6,_0x145a1b){var _0x46319b=this,_0x10f71b=_0x10f71b||0x11dd,_0x114cd6=_0x114cd6||_0xc0ff('0x3'),_0x2fe7a2=null,_0x1b69a1=0x0;EventEmitter['call'](_0x46319b);function _0x29f9b7(){if(!_0x10f71b){_0x46319b[_0xc0ff('0x4')](_0xc0ff('0x5'),new AGIError(_0xc0ff('0x6')));return![];}_0x2fe7a2=net[_0xc0ff('0x7')]();_0x2fe7a2[_0xc0ff('0x8')](_0x10f71b,_0x114cd6);_0x2fe7a2['on'](_0xc0ff('0x9'),function(){_0x46319b[_0xc0ff('0x4')]('listening');});_0x2fe7a2['on']('connection',function(_0xdd47a6){_0x2fe7a2['getConnections'](function(_0x3b47f5,_0x2c5060){if(_0x3b47f5){_0x46319b[_0xc0ff('0x4')](_0xc0ff('0x5'),new AGIError('E_AGI_SERVER_ERROR',_0x3b47f5));}else if(_0x145a1b&&_0x145a1b<0x0){_0x46319b[_0xc0ff('0x4')](_0xc0ff('0x5'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0xdd47a6[_0xc0ff('0xa')]();}else if(_0x145a1b&&_0x145a1b>0x0&&_0x145a1b<_0x2c5060){_0x1b69a1+=0x1;_0x46319b['emit']('error',new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x1b69a1));_0xdd47a6[_0xc0ff('0xa')]();}else{var _0xa91369=new AGIChannel(_0xdd47a6);_0xa91369['on'](_0xc0ff('0xb'),function(){_0x46319b['emit'](_0xc0ff('0xc'),_0xa91369);});}});});_0x2fe7a2['on'](_0xc0ff('0x5'),function(_0x2ddf56){_0x46319b[_0xc0ff('0x4')](_0xc0ff('0x5'),new AGIError(_0xc0ff('0xd'),_0x2ddf56[_0xc0ff('0xe')]));});_0x2fe7a2['on'](_0xc0ff('0xf'),function(){_0x46319b[_0xc0ff('0x4')](_0xc0ff('0xf'),new AGIError(_0xc0ff('0x10')));});}process['nextTick'](function(){_0x29f9b7();});};util[_0xc0ff('0x11')](AGIServer,EventEmitter);module['exports']=function(_0x13b3f3,_0x455047,_0x42a70a){return new AGIServer(_0x13b3f3,_0x455047,_0x42a70a);}; \ No newline at end of file +var _0x306e=['createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','exports','util','net','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT'];(function(_0x5786cf,_0x4d9669){var _0x4b548c=function(_0x26c8af){while(--_0x26c8af){_0x5786cf['push'](_0x5786cf['shift']());}};_0x4b548c(++_0x4d9669);}(_0x306e,0x13b));var _0xe306=function(_0xe3eb7f,_0x58cc76){_0xe3eb7f=_0xe3eb7f-0x0;var _0x4894f1=_0x306e[_0xe3eb7f];return _0x4894f1;};'use strict';var util=require(_0xe306('0x0'));var net=require(_0xe306('0x1'));var EventEmitter=require('events')[_0xe306('0x2')];var AGIError=require(_0xe306('0x3'));var AGIChannel=require(_0xe306('0x4'));var AGIServer=function(_0x22f3fa,_0x56fa6f,_0x3cd11c){var _0x260937=this,_0x22f3fa=_0x22f3fa||0x11dd,_0x56fa6f=_0x56fa6f||_0xe306('0x5'),_0x239ba=null,_0x575e2f=0x0;EventEmitter[_0xe306('0x6')](_0x260937);function _0x102ecb(){if(!_0x22f3fa){_0x260937[_0xe306('0x7')](_0xe306('0x8'),new AGIError(_0xe306('0x9')));return![];}_0x239ba=net[_0xe306('0xa')]();_0x239ba[_0xe306('0xb')](_0x22f3fa,_0x56fa6f);_0x239ba['on'](_0xe306('0xc'),function(){_0x260937['emit'](_0xe306('0xc'));});_0x239ba['on'](_0xe306('0xd'),function(_0x3ff545){_0x239ba[_0xe306('0xe')](function(_0x3f7aaf,_0x235bdd){if(_0x3f7aaf){_0x260937[_0xe306('0x7')]('error',new AGIError(_0xe306('0xf'),_0x3f7aaf));}else if(_0x3cd11c&&_0x3cd11c<0x0){_0x260937['emit'](_0xe306('0x8'),new AGIError(_0xe306('0x10')));_0x3ff545[_0xe306('0x11')]();}else if(_0x3cd11c&&_0x3cd11c>0x0&&_0x3cd11c<_0x235bdd){_0x575e2f+=0x1;_0x260937[_0xe306('0x7')](_0xe306('0x8'),new AGIError(_0xe306('0x12'),_0x575e2f));_0x3ff545[_0xe306('0x11')]();}else{var _0x2f43c9=new AGIChannel(_0x3ff545);_0x2f43c9['on'](_0xe306('0x13'),function(){_0x260937[_0xe306('0x7')](_0xe306('0xd'),_0x2f43c9);});}});});_0x239ba['on'](_0xe306('0x8'),function(_0x5d6696){_0x260937[_0xe306('0x7')](_0xe306('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0x5d6696[_0xe306('0x14')]));});_0x239ba['on']('close',function(){_0x260937[_0xe306('0x7')](_0xe306('0x15'),new AGIError(_0xe306('0x16')));});}process[_0xe306('0x17')](function(){_0x102ecb();});};util['inherits'](AGIServer,EventEmitter);module[_0xe306('0x18')]=function(_0x4350e5,_0x2a4ff5,_0x16c77d){return new AGIServer(_0x4350e5,_0x2a4ff5,_0x16c77d);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index ffb491f..1cf83d5 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 _0x4ee6=['Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','no\x20trunk\x20selected','trunk_id','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','stringify','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_access_key_id','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','unlink','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','%s.%s','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','false','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','no\x20operation\x20configured','math\x20%s','operation','no\x20variable\x20found','isArray','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','escape_digits','saydigits','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','\x22%s\x22\x20<%s>','user','bcc','subject','service','host','port','secure','authentication','auth','template_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','no\x20subproject\x20selected','project_id','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','mailbox','VOICEMAIL','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','path','util','lodash','shelljs','odbc','randomstring','mustache','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','menu','getdigits','getsecretdigits','channel','mailRpc','prototype','getVariable','rpc','getVariableById','then','name','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','getSquareOdbc','getUser','getTrunkById','getSound','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervalById','interval','map','Intervals','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','info','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','context','priority','accountcode','dnid','arg_1','createSquareMessage','createCmContact','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','callback_priority','getPause','getPauseById','agent','agentPause','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','trim','replace','googleTTS','text','google_tts_language','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','uri','clear','includes','hasOwnProperty','isString','replaceAllVariables','split','length','replaceAll','extra','toString','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','sync','retry','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','timeout','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','minutes','custom_app','exec','options','noop','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','opts','url','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','googleDialogflow','DIALOGFLOW_%s','speech','out','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','toUpperCase','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable'];(function(_0x482be6,_0xd6e2d7){var _0x5479e5=function(_0xe194c2){while(--_0xe194c2){_0x482be6['push'](_0x482be6['shift']());}};_0x5479e5(++_0xd6e2d7);}(_0x4ee6,0xbc));var _0x64ee=function(_0x47cc51,_0x229c4d){_0x47cc51=_0x47cc51-0x0;var _0x53a4ac=_0x4ee6[_0x47cc51];return _0x53a4ac;};'use strict';var fs=require('fs');var path=require(_0x64ee('0x0'));var util=require(_0x64ee('0x1'));var _=require(_0x64ee('0x2'));var sh=require(_0x64ee('0x3'));var odbc=require(_0x64ee('0x4'))();var rs=require(_0x64ee('0x5'));var moment=require('moment');var Mustache=require(_0x64ee('0x6'));var logger=require(_0x64ee('0x7'))(_0x64ee('0x8'));var config=require(_0x64ee('0x9'));var scripts=require(_0x64ee('0xa'));var FILES_PATH=_0x64ee('0xb');var verticesWithRetry=[_0x64ee('0xc'),_0x64ee('0xd'),_0x64ee('0xe')];var AGIVertices=function(_0x4b58e7,_0x58273a,_0x1b7584){this[_0x64ee('0xf')]=_0x4b58e7;this['rpc']=_0x58273a;this[_0x64ee('0x10')]=_0x1b7584;};AGIVertices[_0x64ee('0x11')][_0x64ee('0x12')]=function(_0x19c1ca,_0x24d6a6){this[_0x64ee('0x13')][_0x64ee('0x14')](_0x19c1ca)[_0x64ee('0x15')](function(_0x161486){_0x24d6a6(null,_0x161486?_0x161486[_0x64ee('0x16')]:![]);})['catch'](function(_0x512d95){_0x24d6a6(_0x512d95);});};AGIVertices[_0x64ee('0x11')][_0x64ee('0x17')]=function(_0x406c83,_0x44b131){this[_0x64ee('0x13')][_0x64ee('0x18')](_0x406c83)['then'](function(_0x3f2196){_0x44b131(null,_0x3f2196?_0x3f2196[_0x64ee('0x16')]:![]);})[_0x64ee('0x19')](function(_0x4126ae){_0x44b131(_0x4126ae);});};AGIVertices[_0x64ee('0x11')][_0x64ee('0x1a')]=function(_0x164a06,_0x30a7d1){this[_0x64ee('0x13')]['getSquareProjectById'](_0x164a06)[_0x64ee('0x15')](function(_0x186c72){_0x30a7d1(null,_0x186c72?_0x186c72[_0x64ee('0x16')]:![]);})[_0x64ee('0x19')](function(_0x5cb9ba){_0x30a7d1(_0x5cb9ba);});};AGIVertices[_0x64ee('0x11')][_0x64ee('0x1b')]=function(_0x3b9191,_0x1b6c95){this[_0x64ee('0x13')]['getSquareOdbcById'](_0x3b9191)[_0x64ee('0x15')](function(_0x58e98c){_0x1b6c95(null,_0x58e98c?_0x58e98c['dsn']:![]);})[_0x64ee('0x19')](function(_0x4ead1d){_0x1b6c95(_0x4ead1d);});};AGIVertices[_0x64ee('0x11')][_0x64ee('0x1c')]=function(_0x1552a5,_0x491f68){this[_0x64ee('0x13')]['getUserById'](_0x1552a5)['then'](function(_0x1bdb5a){_0x491f68(null,_0x1bdb5a?_0x1bdb5a[_0x64ee('0x16')]:![]);})[_0x64ee('0x19')](function(_0x180991){_0x491f68(_0x180991);});};AGIVertices[_0x64ee('0x11')]['getTrunk']=function(_0x484dff,_0x2eb40f){this[_0x64ee('0x13')][_0x64ee('0x1d')](_0x484dff)['then'](function(_0x42f5ee){_0x2eb40f(null,_0x42f5ee?_0x42f5ee[_0x64ee('0x16')]:![]);})[_0x64ee('0x19')](function(_0x55cb92){_0x2eb40f(_0x55cb92);});};AGIVertices[_0x64ee('0x11')][_0x64ee('0x1e')]=function(_0x1e338e,_0x3c1a95){var _0x1631a4=this;this[_0x64ee('0x13')]['getSoundById'](_0x1e338e)[_0x64ee('0x15')](function(_0x1a5665){_0x3c1a95(null,_0x1a5665?_0x1631a4[_0x64ee('0x1f')](_0x1a5665[_0x64ee('0x20')]):![]);})['catch'](function(_0x121141){_0x3c1a95(_0x121141);});};AGIVertices[_0x64ee('0x11')]['getMailAccount']=function(_0x3fe785,_0xe54ff2){this[_0x64ee('0x13')][_0x64ee('0x21')](_0x3fe785)[_0x64ee('0x15')](function(_0x589b06){_0xe54ff2(null,_0x589b06?_0x589b06:![]);})['catch'](function(_0x1b5468){_0xe54ff2(_0x1b5468);});};AGIVertices['prototype'][_0x64ee('0x22')]=function(_0x4e6841,_0x2ada44,_0x2274ba){this[_0x64ee('0x10')][_0x64ee('0x22')](_0x4e6841,_0x2ada44)[_0x64ee('0x15')](function(){_0x2274ba(null);})[_0x64ee('0x19')](function(_0x1032a7){_0x2274ba(_0x1032a7);});};AGIVertices[_0x64ee('0x11')]['getIntervals']=function(_0x543cc0,_0x5ac40e){this[_0x64ee('0x13')][_0x64ee('0x23')](_0x543cc0)['then'](function(_0x43ddbc){if(_0x43ddbc){if(_0x43ddbc['IntervalId']){_0x5ac40e(null,[_0x43ddbc[_0x64ee('0x24')]]);}else{_0x5ac40e(null,_[_0x64ee('0x25')](_0x43ddbc[_0x64ee('0x26')],_0x64ee('0x24')));}}else{_0x5ac40e(null,![]);}})['catch'](function(_0x197cde){_0x5ac40e(_0x197cde);});};AGIVertices[_0x64ee('0x11')][_0x64ee('0x1f')]=function(_0x4bd9d3){return util[_0x64ee('0x27')]('%s/sounds/converted/%s',FILES_PATH,_0x4bd9d3);};AGIVertices[_0x64ee('0x11')][_0x64ee('0x28')]=function(_0x584972,_0x2ecb61,_0x1739b4){odbc[_0x64ee('0x29')](_0x584972,function(_0x4083d3){if(_0x4083d3){logger[_0x64ee('0x2a')](_0x64ee('0x2b'),_0x4083d3);_0x1739b4(_0x4083d3);}else{logger['info'](_0x64ee('0x2c'));odbc['query'](_0x2ecb61,function(_0xcc484f,_0x133a8b){if(_0xcc484f){logger['info']('Error\x20executing\x20query\x20%s',_0x2ecb61);_0x1739b4(_0xcc484f);}else{logger[_0x64ee('0x2d')](_0x64ee('0x2e'),_0x2ecb61);odbc[_0x64ee('0x2f')](function(_0x4edf81){if(_0x4edf81){logger[_0x64ee('0x2a')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x4edf81);}_0x1739b4(null,_0x133a8b);});}});}});};AGIVertices[_0x64ee('0x11')][_0x64ee('0x30')]=function(_0x72d7cf,_0xc137ef){this[_0x64ee('0x13')][_0x64ee('0x31')](_0x72d7cf)['then'](function(_0x19d675){_0xc137ef(null,_0x19d675?_0x19d675:![]);})['catch'](function(_0x2a5daa){_0xc137ef(_0x2a5daa);});};AGIVertices[_0x64ee('0x11')]['createSmsMessage']=function(_0x1f5787,_0x3d6be0){this[_0x64ee('0x13')][_0x64ee('0x32')](_0x1f5787)[_0x64ee('0x15')](function(_0x45e2c1){_0x3d6be0(null,_0x45e2c1);})[_0x64ee('0x19')](function(_0x22b76a){_0x3d6be0(_0x22b76a);});};AGIVertices[_0x64ee('0x11')][_0x64ee('0x33')]=function(_0x1b6114,_0x1bb12f,_0x443ce8){this[_0x64ee('0x13')][_0x64ee('0x33')]({'uniqueid':this[_0x64ee('0xf')][_0x64ee('0x34')],'node':_0x1b6114[_0x64ee('0x35')],'application':_0x1b6114[_0x64ee('0x36')],'data':_0x1bb12f||null,'project_name':this[_0x64ee('0xf')]['arg_1'],'callerid':this[_0x64ee('0xf')][_0x64ee('0x37')]})[_0x64ee('0x15')](function(_0x2a0bcb){if(_0x443ce8){_0x443ce8(null,_0x2a0bcb);}})[_0x64ee('0x19')](function(_0x334463){if(_0x443ce8){_0x443ce8(_0x334463);}});};AGIVertices[_0x64ee('0x11')][_0x64ee('0x38')]=function(_0x37c642,_0x5a69e4,_0x15e4af,_0x23bb3a){this['rpc']['createSquareRecording']({'uniqueid':this[_0x64ee('0xf')][_0x64ee('0x34')],'callerid':this[_0x64ee('0xf')]['callerid'],'calleridname':this[_0x64ee('0xf')][_0x64ee('0x39')],'context':this[_0x64ee('0xf')][_0x64ee('0x3a')],'extension':this['channel']['extension'],'priority':this[_0x64ee('0xf')][_0x64ee('0x3b')],'accountcode':this[_0x64ee('0xf')][_0x64ee('0x3c')],'dnid':this[_0x64ee('0xf')][_0x64ee('0x3d')],'projectName':this['channel'][_0x64ee('0x3e')],'saveName':_0x5a69e4,'filename':_0x37c642['file']||_0x5a69e4,'savePath':_0x15e4af})[_0x64ee('0x15')](function(_0x5c5146){_0x23bb3a(null,_0x5c5146);})[_0x64ee('0x19')](function(_0xaca71a){_0x23bb3a(_0xaca71a);});};AGIVertices[_0x64ee('0x11')][_0x64ee('0x3f')]=function(_0x57da95,_0x3d9119,_0x450eed){this['rpc']['createSquareMessage']({'uniqueid':this[_0x64ee('0xf')][_0x64ee('0x34')],'body':_0x57da95,'direction':_0x3d9119})['then'](function(_0x1bc458){if(_0x450eed){_0x450eed(null,_0x1bc458);}})[_0x64ee('0x19')](function(_0x1d7e3e){if(_0x450eed){_0x450eed(_0x1d7e3e);}});};AGIVertices[_0x64ee('0x11')][_0x64ee('0x40')]=function(_0x323863,_0x2cc5db){this[_0x64ee('0x13')][_0x64ee('0x40')]({'firstName':_['isEmpty'](_0x323863[_0x64ee('0x16')])||_[_0x64ee('0x41')](_0x323863[_0x64ee('0x16')])?_0x64ee('0x42')+Math[_0x64ee('0x43')]():_0x323863['name'],'lastName':_['isEmpty'](_0x323863[_0x64ee('0x44')])||_['isNil'](_0x323863['lastName'])?null:_0x323863['lastName'],'phone':_0x323863[_0x64ee('0x45')],'ListId':_0x323863[_0x64ee('0x46')],'scheduledAt':_0x323863[_0x64ee('0x47')],'callbackUniqueid':this['channel'][_0x64ee('0x34')],'tags':_0x64ee('0x48'),'description':_0x64ee('0x49')+_0x323863[_0x64ee('0x47')]['toString'](),'priority':_0x323863[_0x64ee('0x4a')]})[_0x64ee('0x15')](function(_0x4217c8){_0x2cc5db(null,_0x4217c8);})[_0x64ee('0x19')](function(_0x292c41){_0x2cc5db(_0x292c41);});};AGIVertices[_0x64ee('0x11')][_0x64ee('0x4b')]=function(_0x41bc00,_0x5e2878){this[_0x64ee('0x13')][_0x64ee('0x4c')](_0x41bc00)[_0x64ee('0x15')](function(_0x237ec6){_0x5e2878(null,_0x237ec6?_0x237ec6[_0x64ee('0x16')]:![]);})[_0x64ee('0x19')](function(_0xb5f86c){_0x5e2878(_0xb5f86c);});};AGIVertices[_0x64ee('0x11')]['agentPause']=function(_0x1251eb,_0x2866d6,_0x5bde5d){var _0x5558d6={'role':_0x64ee('0x4d')};_0x5558d6[_0x1251eb]=this['channel'][_0x64ee('0x37')];this['rpc'][_0x64ee('0x4e')](_0x5558d6,_0x2866d6,this[_0x64ee('0xf')][_0x64ee('0x34')])[_0x64ee('0x15')](function(_0x1cb279){_0x5bde5d(null,_[_0x64ee('0x41')](_0x1cb279)?![]:!![]);})['catch'](function(_0x591c55){logger[_0x64ee('0x2a')](_0x591c55);_0x5bde5d(null,![]);});};AGIVertices['prototype'][_0x64ee('0x4f')]=function(_0x33222f,_0x11c002){var _0xd05d39={'role':_0x64ee('0x4d')};_0xd05d39[_0x33222f]=this[_0x64ee('0xf')][_0x64ee('0x37')];this[_0x64ee('0x13')][_0x64ee('0x4f')](_0xd05d39)[_0x64ee('0x15')](function(_0x5f0319){_0x11c002(null,_[_0x64ee('0x41')](_0x5f0319)?![]:!![]);})[_0x64ee('0x19')](function(_0x467200){logger[_0x64ee('0x2a')](_0x467200);_0x11c002(null,![]);});};AGIVertices[_0x64ee('0x11')]['agentLogout']=function(_0x501d72,_0x2bf1bf){var _0x1b9219={'role':_0x64ee('0x4d')};_0x1b9219[_0x501d72]=this[_0x64ee('0xf')][_0x64ee('0x37')];this[_0x64ee('0x13')][_0x64ee('0x50')](_0x1b9219)[_0x64ee('0x15')](function(_0x1af269){_0x2bf1bf(null,_['isNil'](_0x1af269)?![]:!![]);})['catch'](function(_0x288f05){logger['error'](_0x288f05);_0x2bf1bf(null,![]);});};AGIVertices[_0x64ee('0x11')][_0x64ee('0x51')]=function(_0x557429,_0x4d363b){var _0x4ac8ef={'role':_0x64ee('0x4d')};_0x4ac8ef[_0x557429]=this[_0x64ee('0xf')][_0x64ee('0x37')];var _0x6580ab=_0x557429!=_0x64ee('0x52')?util[_0x64ee('0x27')](_0x64ee('0x53'),_0x64ee('0x54'),this[_0x64ee('0xf')]['callerid']):undefined;this['rpc']['agentLogin'](_0x4ac8ef,_0x6580ab)[_0x64ee('0x15')](function(_0x17461c){_0x4d363b(null,_[_0x64ee('0x41')](_0x17461c)?![]:!![]);})['catch'](function(_0x1fbe1b){logger[_0x64ee('0x2a')](_0x1fbe1b);_0x4d363b(null,![]);});};AGIVertices[_0x64ee('0x11')][_0x64ee('0x55')]=function(_0x3c7005,_0x56851f){sh['exec'](_[_0x64ee('0x56')](_0x3c7005),function(_0x3ac030,_0x495f69){var _0x370fea=_0x495f69[_0x64ee('0x57')](/(\r\n|\n|\r)/gm,'');_0x56851f(null,_0x370fea);});};AGIVertices[_0x64ee('0x11')][_0x64ee('0x58')]=function(_0x3ab58e,_0x520d94){scripts[_0x64ee('0x58')](_0x3ab58e[_0x64ee('0x59')],_0x3ab58e[_0x64ee('0x5a')]||'en',0x1)[_0x64ee('0x15')](function(_0xc478c3){_0x520d94(null,_0xc478c3);})[_0x64ee('0x19')](function(_0x236526){_0x520d94(_0x236526);});};AGIVertices[_0x64ee('0x11')]['googleDialogflow']=function(_0x4c6d43,_0x5117dd){scripts['googleDialogflow'](this[_0x64ee('0xf')][_0x64ee('0x34')],_0x4c6d43[_0x64ee('0x5b')],_0x4c6d43['text'],_0x4c6d43[_0x64ee('0x5c')]||'en')[_0x64ee('0x15')](function(_0xa254e6){_0x5117dd(null,_0xa254e6);})[_0x64ee('0x19')](function(_0x4928db){_0x5117dd(_0x4928db);});};AGIVertices[_0x64ee('0x11')][_0x64ee('0x5d')]=function(_0x43bf4d,_0x1d45bd){scripts[_0x64ee('0x5d')](this[_0x64ee('0xf')],_0x43bf4d)[_0x64ee('0x15')](function(_0x272f35){_0x1d45bd(null,_0x272f35);})[_0x64ee('0x19')](function(_0x267b71){_0x1d45bd(_0x267b71);});};AGIVertices['prototype'][_0x64ee('0x5e')]=function(_0xd3a4ef,_0x11dbf1){scripts[_0x64ee('0x5e')](_0xd3a4ef[_0x64ee('0x5b')],_0xd3a4ef[_0x64ee('0x59')],_0xd3a4ef[_0x64ee('0x5f')]||_0x64ee('0x60'),_0xd3a4ef[_0x64ee('0x61')])[_0x64ee('0x15')](function(_0xaac274){_0x11dbf1(null,_0xaac274);})[_0x64ee('0x19')](function(_0x40bcdd){_0x11dbf1(_0x40bcdd);});};AGIVertices[_0x64ee('0x11')][_0x64ee('0x62')]=function(_0x12b74,_0x5d3d8e,_0x559588){scripts[_0x64ee('0x62')](_0x5d3d8e,_0x12b74[_0x64ee('0x5b')],_0x12b74[_0x64ee('0x63')]||'en-US',this[_0x64ee('0x64')](_0x12b74[_0x64ee('0x65')])?_0x12b74[_0x64ee('0x65')]:undefined)[_0x64ee('0x15')](function(_0x8d7601){_0x559588(null,_0x8d7601);})['catch'](function(_0x15dc1c){_0x559588(_0x15dc1c);});};AGIVertices[_0x64ee('0x11')][_0x64ee('0x66')]=function(_0x29a6d4,_0x24f428){scripts[_0x64ee('0x66')](_0x29a6d4['aws_access_key_id'],_0x29a6d4[_0x64ee('0x67')],_0x29a6d4[_0x64ee('0x68')],_0x29a6d4[_0x64ee('0x69')]||'Amy',_0x29a6d4['text'],_0x29a6d4[_0x64ee('0x6a')]||_0x64ee('0x59'))['then'](function(_0x3246cc){_0x24f428(null,_0x3246cc);})[_0x64ee('0x19')](function(_0x5d2a65){_0x24f428(_0x5d2a65);});};AGIVertices[_0x64ee('0x11')][_0x64ee('0x6b')]=function(_0x3fbba7,_0x467fb9){scripts[_0x64ee('0x6b')](this[_0x64ee('0xf')][_0x64ee('0x34')],_0x3fbba7['aws_access_key_id'],_0x3fbba7[_0x64ee('0x67')],_0x3fbba7[_0x64ee('0x6c')],_0x3fbba7[_0x64ee('0x59')],_0x3fbba7[_0x64ee('0x6d')])[_0x64ee('0x15')](function(_0x2789e8){_0x467fb9(null,_0x2789e8);})[_0x64ee('0x19')](function(_0x206498){_0x467fb9(_0x206498);});};AGIVertices[_0x64ee('0x11')]['googleASR']=function(_0x31d3d8,_0x4f6a78,_0x2b150c){scripts[_0x64ee('0x6e')](_0x4f6a78,_0x31d3d8[_0x64ee('0x5b')],_0x31d3d8[_0x64ee('0x6f')]||_0x64ee('0x60'))[_0x64ee('0x15')](function(_0x39897f){_0x2b150c(null,_0x39897f);})[_0x64ee('0x19')](function(_0x247f1b){_0x2b150c(_0x247f1b);});};AGIVertices[_0x64ee('0x11')]['tildeASR']=function(_0x2a6f06,_0xaa02e5,_0x311f55){scripts[_0x64ee('0x70')](_0xaa02e5,_0x2a6f06['appid'],_0x2a6f06['appsecret'],_0x2a6f06[_0x64ee('0x71')])[_0x64ee('0x15')](function(_0x2784cb){_0x311f55(null,_0x2784cb);})[_0x64ee('0x19')](function(_0x32b666){_0x311f55(_0x32b666);});};AGIVertices['prototype'][_0x64ee('0x72')]=function(_0x9c436b){var _0x49dbc0=_[_0x64ee('0x73')](verticesWithRetry,_0x9c436b[_0x64ee('0x36')])?_0x9c436b:_['clone'](_0x9c436b);for(var _0x50e45a in _0x49dbc0){if(_0x49dbc0[_0x64ee('0x74')](_0x50e45a)){if(_0x49dbc0[_0x50e45a]&&_[_0x64ee('0x75')](_0x49dbc0[_0x50e45a])){_0x49dbc0[_0x50e45a]=this[_0x64ee('0x76')](_0x49dbc0[_0x50e45a]);}}}return _0x49dbc0;};AGIVertices[_0x64ee('0x11')][_0x64ee('0x76')]=function(_0xf8828d){var _0x2eed36=_0xf8828d[_0x64ee('0x77')]('{');for(var _0x253c0e=0x1;_0x253c0e<_0x2eed36[_0x64ee('0x78')];_0x253c0e+=0x1){var _0x5c3574=_0x2eed36[_0x253c0e][_0x64ee('0x77')]('}');if(_0x5c3574[_0x64ee('0x78')]>0x1){_0xf8828d=_0xf8828d[_0x64ee('0x79')]('{'+_0x5c3574[0x0]+'}',this[_0x64ee('0xf')][_0x64ee('0x12')](_0x5c3574[0x0])[_0x64ee('0x7a')]||_0x5c3574[0x0]);}}if(_0x2eed36[_0x64ee('0x78')]===0x1){return _0xf8828d[_0x64ee('0x7b')]();}return this[_0x64ee('0x76')](_0xf8828d);};AGIVertices[_0x64ee('0x11')][_0x64ee('0x7c')]=function(_0x2c8ca5,_0x5e993a){var _0x3aeb24=this['channel']['getVariable'](_0x2c8ca5);if(_0x3aeb24[_0x64ee('0x7d')]===-0x1){return _0x3aeb24;}logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0x7e'),_0x5e993a,_0x3aeb24[_0x64ee('0x7a')]));return this['channel'][_0x64ee('0x7f')](_0x5e993a,_0x3aeb24[_0x64ee('0x7a')]);};AGIVertices[_0x64ee('0x11')]['isConfigured']=function(_0x159acf){return _0x159acf&&_0x159acf!=='0'&&_0x159acf!=='-1'&&_0x159acf!=='';};AGIVertices[_0x64ee('0x11')][_0x64ee('0x80')]=function(_0x4caf80){this[_0x64ee('0x33')][_0x64ee('0x81')](this,_0x4caf80,'-');_0x4caf80[_0x64ee('0x82')]=_0x4caf80[_0x64ee('0x80')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x64ee('0x11')][_0x64ee('0x8')]=function(_0x4f3b68){logger['info'](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x4f3b68[_0x64ee('0x35')]));return this[_0x64ee('0xf')][_0x64ee('0x8')]([_0x4f3b68[_0x64ee('0x83')],_0x4f3b68[_0x64ee('0x84')]]);};AGIVertices['prototype'][_0x64ee('0x85')]=function(_0x3cc626){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0x86'),_0x3cc626[_0x64ee('0x35')]));if(this['isConfigured'](_0x3cc626[_0x64ee('0x87')])){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x3cc626[_0x64ee('0x87')]));var _0x4f68f3=this[_0x64ee('0xf')][_0x64ee('0x88')](_0x3cc626['timeout']);if(_0x4f68f3['result']===-0x1){return _0x4f68f3;}}return this[_0x64ee('0xf')][_0x64ee('0x85')]();};AGIVertices[_0x64ee('0x11')][_0x64ee('0x48')]=function(_0x2d89bb){logger['info'](util[_0x64ee('0x27')](_0x64ee('0x89'),_0x2d89bb['label']));if(!this[_0x64ee('0x64')](_0x2d89bb[_0x64ee('0x46')])){return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x2d89bb,_0x64ee('0x8a'));}_0x2d89bb[_0x64ee('0x47')]=moment();if(this[_0x64ee('0x64')](_0x2d89bb['delay'])){_0x2d89bb[_0x64ee('0x47')]=moment()[_0x64ee('0x8b')](_0x2d89bb['delay'],_0x64ee('0x8c'));}if(!this[_0x64ee('0x64')](_0x2d89bb[_0x64ee('0x4a')])){_0x2d89bb[_0x64ee('0x4a')]=0x2;}this['createCmContact']['sync'](this,_0x2d89bb);return this[_0x64ee('0xf')]['noop'](util[_0x64ee('0x27')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x2d89bb[_0x64ee('0x45')],_0x2d89bb[_0x64ee('0x46')],_0x2d89bb[_0x64ee('0x47')]));};AGIVertices['prototype'][_0x64ee('0x8d')]=function(_0xdc170c){logger[_0x64ee('0x2d')](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0xdc170c[_0x64ee('0x35')]));var _0x3bbeed=this[_0x64ee('0xf')][_0x64ee('0x8e')](_0xdc170c['application'],_0xdc170c[_0x64ee('0x8f')]);if(_0x3bbeed['result']===-0x1){return _0x3bbeed;}return this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')](_0x64ee('0x91'),_0xdc170c[_0x64ee('0x92')],_0xdc170c[_0x64ee('0x8f')]));};AGIVertices[_0x64ee('0x11')][_0x64ee('0x93')]=function(_0x34877d){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0x94'),_0x34877d[_0x64ee('0x35')]));if(!this['isConfigured'](_0x34877d[_0x64ee('0x59')])){return this['channel'][_0x64ee('0x90')](_0x64ee('0x95'));}var _0x4208ec='\x22'+_0x34877d[_0x64ee('0x59')]+'\x22';if(this[_0x64ee('0x64')](_0x34877d[_0x64ee('0x8f')])){_0x4208ec+=','+_0x34877d[_0x64ee('0x8f')];}var _0x238278=this[_0x64ee('0xf')][_0x64ee('0x8e')](_0x64ee('0x96'),_0x4208ec);if(_0x238278['result']===-0x1){return _0x238278;}return this[_0x64ee('0xf')][_0x64ee('0x90')](util['format'](_0x64ee('0x97'),_0x4208ec));};AGIVertices['prototype']['sestektts']=function(_0x3e2c14){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x3e2c14[_0x64ee('0x35')]));if(!this['isConfigured'](_0x3e2c14[_0x64ee('0x59')])){return this[_0x64ee('0xf')]['noop'](_0x64ee('0x95'));}var _0x5d6648='\x22'+_0x3e2c14[_0x64ee('0x59')]+'\x22';if(this[_0x64ee('0x64')](_0x3e2c14[_0x64ee('0x8f')])){_0x5d6648+=','+_0x3e2c14[_0x64ee('0x8f')];}var _0xd5458=this[_0x64ee('0xf')][_0x64ee('0x8e')](_0x64ee('0x96'),_0x5d6648);if(_0xd5458[_0x64ee('0x7d')]===-0x1){return _0xd5458;}return this[_0x64ee('0xf')][_0x64ee('0x90')](util['format'](_0x64ee('0x97'),_0x5d6648));};AGIVertices['prototype']['lumenvoxasr']=function(_0x2a361b){logger['info'](util['format'](_0x64ee('0x98'),_0x2a361b[_0x64ee('0x35')]));if(!this[_0x64ee('0x64')](_0x2a361b['grammar'])){return this[_0x64ee('0xf')]['noop'](_0x64ee('0x99'));}var _0x55c5d9=_0x2a361b[_0x64ee('0x9a')];if(this[_0x64ee('0x64')](_0x2a361b[_0x64ee('0x8f')])){_0x55c5d9+=','+_0x2a361b['options'];}var _0xcbacc4=this['channel']['exec'](_0x64ee('0x9b'),_0x55c5d9);if(_0xcbacc4['result']===-0x1){return _0xcbacc4;}var _0x5b062a=this['getAndSetVariable'](_0x64ee('0x9c'),_0x64ee('0x9d'));if(_0x5b062a['result']===-0x1){return _0x5b062a;}var _0x4df2a7=this[_0x64ee('0x7c')](_0x64ee('0x9e'),_0x64ee('0x9f'));if(_0x4df2a7[_0x64ee('0x7d')]===-0x1){return _0x4df2a7;}var _0x815167=this['getAndSetVariable'](_0x64ee('0xa0'),_0x64ee('0xa1'));if(_0x815167['result']===-0x1){return _0x815167;}return this[_0x64ee('0xf')]['noop'](util[_0x64ee('0x27')](_0x64ee('0xa2'),_0x55c5d9));};AGIVertices[_0x64ee('0x11')][_0x64ee('0xa3')]=function(_0xdf9ae8){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0xa4'),_0xdf9ae8['label']));if(!this[_0x64ee('0x64')](_0xdf9ae8[_0x64ee('0x9a')])){return this['channel'][_0x64ee('0x90')](_0x64ee('0x99'));}var _0x2fce0b=_0xdf9ae8[_0x64ee('0x9a')];if(this['isConfigured'](_0xdf9ae8[_0x64ee('0x8f')])){_0x2fce0b+=','+_0xdf9ae8[_0x64ee('0x8f')];}var _0x2a1c38=this[_0x64ee('0xf')]['exec'](_0x64ee('0x9b'),_0x2fce0b);if(_0x2a1c38['result']===-0x1){return _0x2a1c38;}var _0x264877=this[_0x64ee('0x7c')]('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x264877[_0x64ee('0x7d')]===-0x1){return _0x264877;}var _0x52c351=this[_0x64ee('0x7c')](_0x64ee('0x9e'),_0x64ee('0xa5'));if(_0x52c351[_0x64ee('0x7d')]===-0x1){return _0x52c351;}var _0x5f2f5d=this[_0x64ee('0x7c')](_0x64ee('0xa0'),_0x64ee('0xa6'));if(_0x5f2f5d[_0x64ee('0x7d')]===-0x1){return _0x5f2f5d;}return this[_0x64ee('0xf')]['noop'](util[_0x64ee('0x27')](_0x64ee('0xa2'),_0x2fce0b));};AGIVertices[_0x64ee('0x11')][_0x64ee('0xa7')]=function(_0x60583c){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x60583c[_0x64ee('0x35')]));if(!this['isConfigured'](_0x60583c[_0x64ee('0xa8')])){return this[_0x64ee('0xf')]['error'](_0x60583c,_0x64ee('0xa9'));}var _0x1ec810=this[_0x64ee('0x1b')]['sync'](this,_0x60583c[_0x64ee('0xa8')]);if(!_0x1ec810){return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x60583c,_0x64ee('0xaa'));}if(!this['isConfigured'](_0x60583c[_0x64ee('0xab')])){return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x60583c,'no\x20query\x20configured');}var _0x27fe03=_0x60583c[_0x64ee('0xab')][_0x64ee('0x57')](/(\r\n|\n|\r)/gm,'\x20');this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')](_0x64ee('0xac'),_0x27fe03));var _0x4a31f5=this[_0x64ee('0x28')][_0x64ee('0x81')](this,_0x1ec810,_0x27fe03);this[_0x64ee('0x33')][_0x64ee('0x81')](this,_0x60583c,_0x27fe03);if(!this[_0x64ee('0x64')](_0x60583c['variable_id'])){return this[_0x64ee('0xf')]['noop'](_0x64ee('0xad'));}var _0x306261=this[_0x64ee('0x12')]['sync'](this,_0x60583c[_0x64ee('0xae')]);if(!_0x306261){return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x60583c,'no\x20variable\x20found');}var _0x270080=this;_0x4a31f5[_0x64ee('0xaf')](function(_0x2f1704,_0x417383){Object[_0x64ee('0xb0')](_0x2f1704)[_0x64ee('0xaf')](function(_0x377f7a){_0x270080[_0x64ee('0xf')][_0x64ee('0x7f')](util[_0x64ee('0x27')](_0x64ee('0xb1'),_0x306261,_0x417383,_0x377f7a),_0x2f1704[_0x377f7a]);});});this[_0x64ee('0xf')]['setVariable'](util[_0x64ee('0x27')](_0x64ee('0xb2'),_0x306261),_0x4a31f5['length']);return this['channel'][_0x64ee('0x90')](util[_0x64ee('0x27')](_0x64ee('0xb3'),_0x306261));};AGIVertices[_0x64ee('0x11')][_0x64ee('0xb4')]=function(_0x180479){logger[_0x64ee('0xb5')](util[_0x64ee('0x27')](_0x64ee('0xb6'),_0x180479['label']));if(!this[_0x64ee('0x64')](_0x180479[_0x64ee('0xb7')])){return this['channel'][_0x64ee('0x2a')](_0x180479,_0x64ee('0xb8'));}var _0x472e50=this[_0x64ee('0x1c')]['sync'](this,_0x180479[_0x64ee('0xb7')]);if(!_0x472e50){return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x180479,'no\x20user\x20found');}var _0x41bbd4=this['channel']['exec'](_0x64ee('0xb9'),[util[_0x64ee('0x27')]('SIP/%s',_0x472e50),_0x180479[_0x64ee('0x87')],_0x180479[_0x64ee('0xba')],_0x180479[_0x64ee('0xbb')]]);if(_0x41bbd4[_0x64ee('0x7d')]===-0x1){return _0x41bbd4;}return this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')](_0x64ee('0xbc'),'DIAL'));};AGIVertices['prototype'][_0x64ee('0xbd')]=function(_0x512952){logger['info'](util[_0x64ee('0x27')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x512952[_0x64ee('0x35')]));if(!this[_0x64ee('0x64')](_0x512952[_0x64ee('0x5b')])){return this['channel']['noop'](_0x64ee('0xbe'));}if(!this[_0x64ee('0x64')](_0x512952[_0x64ee('0x59')])){return this['channel'][_0x64ee('0x90')]('no\x20text\x20configured');}this['channel'][_0x64ee('0xbf')]=!![];this[_0x64ee('0x33')](_0x512952);this['createSquareMessage'](_0x512952[_0x64ee('0x59')],'in');this['channel'][_0x64ee('0x90')](util[_0x64ee('0x27')](_0x64ee('0xc0'),_0x512952[_0x64ee('0x59')]));var _0x4d71bb=this[_0x64ee('0xc1')][_0x64ee('0x81')](this,_0x512952);if(_0x4d71bb){for(var _0x5103a9 in _0x4d71bb){if(_0x4d71bb['hasOwnProperty'](_0x5103a9)){this[_0x64ee('0xf')][_0x64ee('0x7f')](util[_0x64ee('0x27')](_0x64ee('0xc2'),_0x5103a9['toUpperCase']()),_0x4d71bb[_0x5103a9]);}}this[_0x64ee('0x3f')](_0x4d71bb[_0x64ee('0xc3')],_0x64ee('0xc4'));return this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')]('Dialogflow\x20Result\x20%s',_0x4d71bb[_0x64ee('0xc3')]));}return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x512952,_0x64ee('0xc5'));};AGIVertices[_0x64ee('0x11')][_0x64ee('0xc6')]=function(_0x387bed){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0xc7'),_0x387bed[_0x64ee('0x35')]));if(!this[_0x64ee('0x64')](_0x387bed[_0x64ee('0xc8')])){return this[_0x64ee('0xf')][_0x64ee('0x90')](_0x64ee('0xc9'));}if(!this['isConfigured'](_0x387bed[_0x64ee('0xca')])){return this[_0x64ee('0xf')][_0x64ee('0x90')](_0x64ee('0xcb'));}if(!this[_0x64ee('0x64')](_0x387bed[_0x64ee('0xcc')])){return this[_0x64ee('0xf')][_0x64ee('0x90')]('no\x20password\x20configured');}if(!this[_0x64ee('0x64')](_0x387bed[_0x64ee('0xcd')])){return this[_0x64ee('0xf')][_0x64ee('0x90')](_0x64ee('0x95'));}this[_0x64ee('0xf')][_0x64ee('0xbf')]=!![];this[_0x64ee('0x33')](_0x387bed);this[_0x64ee('0x3f')](_0x387bed['text'],'in');this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')](_0x64ee('0xce'),_0x387bed[_0x64ee('0x59')]));var _0x5e3f4e=this[_0x64ee('0x5d')][_0x64ee('0x81')](this,_0x387bed);if(_0x5e3f4e){for(var _0x2e4ab0 in _0x5e3f4e){if(_0x5e3f4e[_0x64ee('0x74')](_0x2e4ab0)){this[_0x64ee('0xf')][_0x64ee('0x7f')](util[_0x64ee('0x27')]('SESTEK_NDA_%s',_0x2e4ab0[_0x64ee('0xcf')]()),_0x5e3f4e[_0x2e4ab0]);}}this['createSquareMessage'](_0x5e3f4e[_0x64ee('0xc3')],_0x64ee('0xc4'));if(_0x5e3f4e['audiofile']){this['channel'][_0x64ee('0x90')](util[_0x64ee('0x27')](_0x64ee('0xd0'),_0x5e3f4e[_0x64ee('0xd1')]));var _0xc2dd6c=this[_0x64ee('0xf')][_0x64ee('0xd2')](_0x5e3f4e['audiofile']);try{fs['unlink'](_0x5e3f4e[_0x64ee('0xd1')]+'.wav');}catch(_0xa72c23){logger['error'](_0xa72c23);}return _0xc2dd6c;}else{return this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')](_0x64ee('0xd3'),_0x5e3f4e[_0x64ee('0xc3')]));}}return this['channel']['error'](_0x387bed,_0x64ee('0xd4'));};AGIVertices[_0x64ee('0x11')]['end']=function(_0xeacd57){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0xd5'),_0xeacd57['label']));return this[_0x64ee('0xf')][_0x64ee('0x90')]('end');};AGIVertices[_0x64ee('0x11')][_0x64ee('0xd6')]=function(_0x4df7f1){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0xd7'),_0x4df7f1[_0x64ee('0x35')]));var _0x4c0186='';if(_0x4df7f1['trunk_id']){if(!this[_0x64ee('0x64')](_0x4df7f1['trunk_id'])){return this['channel'][_0x64ee('0x2a')](_0x4df7f1,_0x64ee('0xd8'));}else{var _0x306c42=parseInt(_0x4df7f1['trunk_id'],0xa);if(isNaN(_0x306c42)){_0x4c0186=_0x4df7f1[_0x64ee('0xd9')];}else{_0x4c0186=this['getTrunk'][_0x64ee('0x81')](this,_0x4df7f1[_0x64ee('0xd9')]);if(!_0x4c0186){return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x4df7f1,_0x64ee('0xda'));}}}}else if(_0x4df7f1[_0x64ee('0xdb')]){_0x4c0186=_0x4df7f1['trunk_name'];}else{return this['channel']['error'](_0x4df7f1,'no\x20trunk\x20selected');}var _0x4b4e93=this[_0x64ee('0xf')][_0x64ee('0x8e')](_0x64ee('0xb9'),[util[_0x64ee('0x27')](_0x64ee('0xdc'),_0x4c0186,_0x4df7f1['phone']),_0x4df7f1[_0x64ee('0x87')],_0x4df7f1['opts'],_0x4df7f1[_0x64ee('0xbb')]]);if(_0x4b4e93[_0x64ee('0x7d')]===-0x1){return _0x4b4e93;}return this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')](_0x64ee('0xbc'),_0x64ee('0xb9')));};AGIVertices['prototype'][_0x64ee('0xdd')]=function(_0x2d8225){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x2d8225[_0x64ee('0x35')]));return this[_0x64ee('0xf')][_0x64ee('0x90')](_0x64ee('0xdd'));};AGIVertices['prototype'][_0x64ee('0xd')]=function(_0x1a6858){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0xde'),_0x1a6858[_0x64ee('0x35')]));if(_0x1a6858[_0x64ee('0x82')]===0x0){return this[_0x64ee('0x80')](_0x1a6858);}_0x1a6858[_0x64ee('0x82')]-=0x1;if(!this['isConfigured'](_0x1a6858[_0x64ee('0xdf')])){return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x1a6858,_0x64ee('0xe0'));}var _0x516930=this['getSound'][_0x64ee('0x81')](this,_0x1a6858[_0x64ee('0xdf')]);if(!_0x516930){return this['channel'][_0x64ee('0x2a')](_0x1a6858,_0x64ee('0xe1'));}if(!this[_0x64ee('0x64')](_0x1a6858[_0x64ee('0xae')])){return this['channel']['error'](_0x64ee('0xad'));}var _0x3e2e72=this['channel'][_0x64ee('0xe2')](_0x516930,_0x1a6858[_0x64ee('0xe3')],_0x1a6858['maxdigit']);var _0x369538=_0x3e2e72[_0x64ee('0x7d')]?_0x3e2e72[_0x64ee('0x7d')]['toString']():'';logger['info']('test',JSON[_0x64ee('0xe4')](_0x3e2e72));if(_0x3e2e72[_0x64ee('0x7d')]===-0x1){this[_0x64ee('0x33')]['sync'](this,_0x1a6858,_0x369538);return _0x3e2e72;}else if(_0x3e2e72['extra']===_0x64ee('0x87')){_0x3e2e72[_0x64ee('0x7d')]=_0x369538[_0x64ee('0x78')]>=parseInt(_0x1a6858[_0x64ee('0xe5')])?'x':'i';}else{_0x3e2e72['result']=_0x369538[_0x64ee('0x78')]>=parseInt(_0x1a6858[_0x64ee('0xe5')])&&_0x369538[_0x64ee('0x78')]<=parseInt(_0x1a6858[_0x64ee('0xe6')])?'x':'i';}var _0x53ebd2=this['getVariable'][_0x64ee('0x81')](this,_0x1a6858[_0x64ee('0xae')]);if(!_0x53ebd2){return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x1a6858,'no\x20variable\x20found');}this['channel'][_0x64ee('0x7f')](_0x53ebd2,_0x369538);if(this[_0x64ee('0x64')](_0x1a6858['hiddendigitsnum'])){var _0x529fbe=parseInt(_0x1a6858[_0x64ee('0xe7')],0xa);var _0x548afd=rs[_0x64ee('0xe8')]({'charset':'*','length':_0x529fbe});var _0x3fd9d1=_0x369538[_0x64ee('0x78')];if(_0x3fd9d1>0x0){if(_0x3fd9d1>_0x529fbe){this[_0x64ee('0x33')]['sync'](this,_0x1a6858,_0x1a6858[_0x64ee('0xe9')]==='first'?_0x548afd+_0x369538[_0x64ee('0xea')](_0x529fbe):_0x369538[_0x64ee('0xea')](0x0,_0x3fd9d1-_0x529fbe)+_0x548afd);}else{this[_0x64ee('0x33')][_0x64ee('0x81')](this,_0x1a6858,rs[_0x64ee('0xe8')]({'charset':'*','length':_0x3fd9d1}));}}else{this[_0x64ee('0x33')][_0x64ee('0x81')](this,_0x1a6858,'');}}else{this[_0x64ee('0x33')]['sync'](this,_0x1a6858,_0x369538);}return _0x3e2e72;};AGIVertices[_0x64ee('0x11')]['getsecretdigits']=function(_0x5a0862){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x5a0862['label']));return this[_0x64ee('0xd')](_0x5a0862);};AGIVertices[_0x64ee('0x11')][_0x64ee('0xeb')]=function(_0x2a360a){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0xec'),_0x2a360a['label']));this[_0x64ee('0x33')][_0x64ee('0x81')](this,_0x2a360a,_0x2a360a[_0x64ee('0xed')]);return this[_0x64ee('0xf')]['noop'](util[_0x64ee('0x27')](_0x64ee('0xee'),_0x2a360a[_0x64ee('0xed')]));};AGIVertices[_0x64ee('0x11')]['awspolly']=function(_0x111149){logger[_0x64ee('0x2d')](util['format'](_0x64ee('0xef'),_0x111149[_0x64ee('0x35')]));if(!this[_0x64ee('0x64')](_0x111149[_0x64ee('0xf0')])||!this['isConfigured'](_0x111149['aws_secret_access_key'])){return this[_0x64ee('0xf')][_0x64ee('0x90')](_0x64ee('0xf1'));}if(!this['isConfigured'](_0x111149[_0x64ee('0x59')])){return this['channel'][_0x64ee('0x90')]('no\x20text\x20configured');}this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')]('Trying\x20aws\x20Polly\x20%s',_0x111149['text']));var _0x3e3755=this[_0x64ee('0x66')][_0x64ee('0x81')](this,_0x111149);if(_0x3e3755){this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')](_0x64ee('0xf2'),_0x3e3755));var _0x5deafd=this[_0x64ee('0xf')]['streamFile'](_0x3e3755);try{fs[_0x64ee('0xf3')](_0x3e3755+_0x64ee('0xf4'));}catch(_0x3ee523){logger[_0x64ee('0x2a')](_0x3ee523);}return _0x5deafd;}return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x111149,_0x64ee('0xf5'));};AGIVertices[_0x64ee('0x11')][_0x64ee('0xf6')]=function(_0x507d97){logger['info'](util[_0x64ee('0x27')](_0x64ee('0xf7'),_0x507d97[_0x64ee('0x35')]));if(!this[_0x64ee('0x64')](_0x507d97[_0x64ee('0xf0')])||!this['isConfigured'](_0x507d97[_0x64ee('0x67')])){return this[_0x64ee('0xf')][_0x64ee('0x90')](_0x64ee('0xf1'));}if(!this[_0x64ee('0x64')](_0x507d97[_0x64ee('0x6d')])){return this[_0x64ee('0xf')][_0x64ee('0x90')](_0x64ee('0xf8'));}if(!this[_0x64ee('0x64')](_0x507d97['text'])){return this[_0x64ee('0xf')]['noop'](_0x64ee('0x95'));}this[_0x64ee('0xf')][_0x64ee('0xbf')]=!![];this['createSquareDetailsReport'](_0x507d97);this[_0x64ee('0x3f')](_0x507d97[_0x64ee('0x59')],'in');this[_0x64ee('0xf')]['noop'](util[_0x64ee('0x27')](_0x64ee('0xf9'),_0x507d97[_0x64ee('0x59')]));var _0x34f2fe=this[_0x64ee('0x6b')][_0x64ee('0x81')](this,_0x507d97);if(_0x34f2fe){for(var _0x2ca114 in _0x34f2fe){if(_0x34f2fe[_0x64ee('0x74')](_0x2ca114)&&_[_0x64ee('0x75')](_0x34f2fe[_0x2ca114])){this[_0x64ee('0xf')]['setVariable'](util[_0x64ee('0x27')](_0x64ee('0xfa'),_0x2ca114[_0x64ee('0xcf')]()),_0x34f2fe[_0x2ca114]);}}if(_[_0x64ee('0x41')](_0x34f2fe[_0x64ee('0xfb')])){return this['channel']['noop'](_0x64ee('0xfc'));}else{this[_0x64ee('0x3f')](_0x34f2fe[_0x64ee('0xfb')],_0x64ee('0xc4'));return this['channel'][_0x64ee('0x90')](util[_0x64ee('0x27')](_0x64ee('0xfd'),_0x34f2fe[_0x64ee('0xfb')]));}}return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x507d97,_0x64ee('0xfe'));};AGIVertices[_0x64ee('0x11')][_0x64ee('0xff')]=function(_0x4c631d){logger['info'](util[_0x64ee('0x27')](_0x64ee('0x100'),_0x4c631d[_0x64ee('0x35')],_0x4c631d['timeout']));if(!this[_0x64ee('0x64')](_0x4c631d[_0x64ee('0x5b')])){return this['channel'][_0x64ee('0x90')]('no\x20key\x20configured');}var _0x318a17=_0x64ee('0x101');var _0x96bc9f=util[_0x64ee('0x27')](_0x64ee('0x102'),FILES_PATH,rs[_0x64ee('0xe8')](0x4));var _0x4927ac=util['format']('%s.%s',_0x96bc9f,_0x318a17);var _0x2b82a5=!![];if(_0x4c631d[_0x64ee('0x103')]===_0x64ee('0x104')){_0x2b82a5=![];}var _0x17851d=this['channel'][_0x64ee('0x105')](_0x96bc9f,_0x318a17,_0x4c631d['intKey'],_0x4c631d['timeout'],undefined,_0x2b82a5);if(_0x17851d[_0x64ee('0x7d')]!==-0x1){this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')](_0x64ee('0x106'),_0x4927ac));var _0x1d801b=this[_0x64ee('0x6e')][_0x64ee('0x81')](this,_0x4c631d,_0x4927ac);if(_0x1d801b){for(var _0x5a6d55 in _0x1d801b){if(_0x1d801b['hasOwnProperty'](_0x5a6d55)){this['channel']['setVariable'](util['format'](_0x64ee('0x107'),_0x5a6d55['toUpperCase']()),_0x1d801b[_0x5a6d55]);}}return this['channel'][_0x64ee('0x90')](util[_0x64ee('0x27')](_0x64ee('0x108'),JSON[_0x64ee('0xe4')](_0x1d801b)));}}return _0x17851d;};AGIVertices[_0x64ee('0x11')]['tildeasr']=function(_0x3870e2){logger['info'](util['format'](_0x64ee('0x109'),_0x3870e2[_0x64ee('0x35')]));if(!this[_0x64ee('0x64')](_0x3870e2['appid'])){return this[_0x64ee('0xf')][_0x64ee('0x90')](_0x64ee('0x10a'));}if(!this[_0x64ee('0x64')](_0x3870e2['appsecret'])){return this[_0x64ee('0xf')][_0x64ee('0x90')](_0x64ee('0x10b'));}var _0x1ac4f6=_0x64ee('0x101');var _0x3939a4=util[_0x64ee('0x27')](_0x64ee('0x102'),FILES_PATH,rs['generate'](0x4));var _0x3498a0=util[_0x64ee('0x27')](_0x64ee('0x10c'),_0x3939a4,_0x1ac4f6);var _0x2132d7=!![];if(_0x3870e2[_0x64ee('0x103')]===_0x64ee('0x104')){_0x2132d7=![];}var _0x481761=this[_0x64ee('0xf')]['recordFile'](_0x3939a4,_0x1ac4f6,_0x3870e2[_0x64ee('0x10d')],_0x3870e2[_0x64ee('0x87')],undefined,_0x2132d7);if(_0x481761['result']!==-0x1){this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')](_0x64ee('0x10e'),_0x3498a0));var _0x785044=this[_0x64ee('0x70')][_0x64ee('0x81')](this,_0x3870e2,_0x3498a0);if(_0x785044){for(var _0x5e64fd in _0x785044){if(_0x785044[_0x64ee('0x74')](_0x5e64fd)){this[_0x64ee('0xf')][_0x64ee('0x7f')](util[_0x64ee('0x27')](_0x64ee('0x10f'),_0x5e64fd[_0x64ee('0xcf')]()),_0x785044[_0x5e64fd]);}}return this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')]('TildeASR\x20Result\x20%s',JSON[_0x64ee('0xe4')](_0x785044)));}}return _0x481761;};AGIVertices[_0x64ee('0x11')][_0x64ee('0x110')]=function(_0x21e6fb){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0x111'),_0x21e6fb[_0x64ee('0x35')]));return this[_0x64ee('0xf')][_0x64ee('0x112')](_0x21e6fb['context'],_0x21e6fb['extension'],_0x21e6fb[_0x64ee('0x3b')]);};AGIVertices['prototype'][_0x64ee('0x113')]=function(_0x5cff50){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0x114'),_0x5cff50[_0x64ee('0x35')]));if(!this[_0x64ee('0x64')](_0x5cff50['condition'])){return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x5cff50,_0x64ee('0x115'));}try{var _0x4edb84=eval(_0x5cff50[_0x64ee('0x116')])?_0x64ee('0x117'):_0x64ee('0x118');this['channel'][_0x64ee('0x90')](util[_0x64ee('0x27')]('EVAL\x20CONDITION\x20%s\x20%s',_0x5cff50['condition'],_0x4edb84));return{'code':0xc8,'result':_0x4edb84};}catch(_0x4ad830){return{'code':0xc8,'result':_0x64ee('0x118')};}};AGIVertices[_0x64ee('0x11')]['gotoiftime']=function(_0x57664f){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x57664f[_0x64ee('0x35')]));if(!this[_0x64ee('0x64')](_0x57664f[_0x64ee('0x119')])){return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x57664f,_0x64ee('0x11a'));}var _0x298da7=this[_0x64ee('0x11b')]['sync'](this,_0x57664f['interval_id']);if(!_0x298da7){return this['channel'][_0x64ee('0x2a')](_0x57664f,_0x64ee('0x11c'));}for(var _0xe84631=0x0;_0xe84631<_0x298da7[_0x64ee('0x78')];_0xe84631+=0x1){var _0x3679dd=this[_0x64ee('0xf')][_0x64ee('0x12')](util['format'](_0x64ee('0x11d'),_0x298da7[_0xe84631]));if(_0x3679dd[_0x64ee('0x7d')]===-0x1){return _0x3679dd;}logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0x11e'),_0x298da7[_0xe84631],_0x3679dd['extra']));if(_0x3679dd[_0x64ee('0x7a')]==='true'){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0x11e'),_0x298da7[_0xe84631],'true'));this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')]('IFTIME\x20%s\x20%s',_0x298da7[_0xe84631],_0x64ee('0x117')));return{'code':0xc8,'result':_0x64ee('0x117')};}else{logger[_0x64ee('0x2d')](util['format'](_0x64ee('0x11e'),_0x298da7[_0xe84631],_0x64ee('0x118')));this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')]('IFTIME\x20%s\x20%s',_0x298da7[_0xe84631],_0x64ee('0x118')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x64ee('0x11')][_0x64ee('0x11f')]=function(_0x1618fc){logger[_0x64ee('0x2d')](util['format'](_0x64ee('0x120'),_0x1618fc[_0x64ee('0x35')]));return this[_0x64ee('0xf')]['hangup']();};AGIVertices['prototype']['ispeechasr']=function(_0x23a3c9){logger[_0x64ee('0x2d')](util['format'](_0x64ee('0x121'),_0x23a3c9[_0x64ee('0x35')]));if(!this[_0x64ee('0x64')](_0x23a3c9[_0x64ee('0x5b')])){return this['channel']['noop'](_0x64ee('0xbe'));}var _0x304945=_0x64ee('0x101');var _0x1feefd=util[_0x64ee('0x27')](_0x64ee('0x102'),FILES_PATH,rs['generate'](0x4));var _0x2a538d=util['format'](_0x64ee('0x10c'),_0x1feefd,_0x304945);var _0xb9daf6=!![];if(_0x23a3c9['beep']==='NOBEEP'){_0xb9daf6=![];}var _0x40dea4=this[_0x64ee('0xf')]['recordFile'](_0x1feefd,_0x304945,_0x23a3c9[_0x64ee('0x10d')],_0x23a3c9['timeout'],undefined,_0xb9daf6);if(_0x40dea4['result']!==-0x1){this[_0x64ee('0xf')][_0x64ee('0x90')](util['format'](_0x64ee('0x122'),_0x2a538d));var _0x1c134e=this[_0x64ee('0x62')][_0x64ee('0x81')](this,_0x23a3c9,_0x2a538d);if(_0x1c134e){for(var _0x44d2d9 in _0x1c134e){if(_0x1c134e['hasOwnProperty'](_0x44d2d9)){this[_0x64ee('0xf')][_0x64ee('0x7f')](util[_0x64ee('0x27')]('ISPEECH_ASR_%s',_0x44d2d9[_0x64ee('0xcf')]()),_0x1c134e[_0x44d2d9]);}}return this[_0x64ee('0xf')]['noop'](util[_0x64ee('0x27')](_0x64ee('0x123'),JSON[_0x64ee('0xe4')](_0x1c134e)));}}return _0x40dea4;};AGIVertices[_0x64ee('0x11')]['ispeechtts']=function(_0x57db85){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0x124'),_0x57db85[_0x64ee('0x35')]));if(!this[_0x64ee('0x64')](_0x57db85[_0x64ee('0x5b')])){return this[_0x64ee('0xf')][_0x64ee('0x90')]('no\x20key\x20configured');}if(!this[_0x64ee('0x64')](_0x57db85['text'])){return this[_0x64ee('0xf')][_0x64ee('0x90')](_0x64ee('0x95'));}this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')](_0x64ee('0x125'),_0x57db85[_0x64ee('0x59')]));var _0x4a0904=this[_0x64ee('0x5e')][_0x64ee('0x81')](this,_0x57db85);if(_0x4a0904){this[_0x64ee('0xf')][_0x64ee('0x90')](util['format'](_0x64ee('0x122'),_0x4a0904));var _0x2ce336=this[_0x64ee('0xf')][_0x64ee('0xd2')](_0x4a0904,_0x57db85['intKey']);try{fs[_0x64ee('0xf3')](_0x4a0904+_0x64ee('0xf4'));}catch(_0x53bd42){logger[_0x64ee('0x2a')](_0x53bd42);}return _0x2ce336;}return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x57db85,_0x64ee('0x126'));};AGIVertices[_0x64ee('0x11')][_0x64ee('0x127')]=function(_0x22776f){logger['info'](util['format'](_0x64ee('0x128'),_0x22776f[_0x64ee('0x35')]));if(!this[_0x64ee('0x64')](_0x22776f['findBy'])){return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x22776f,_0x64ee('0x129'));}logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0x12a'),this[_0x64ee('0xf')][_0x64ee('0x37')],_0x22776f[_0x64ee('0x12b')]));var _0x46f4f7=this['agentLogin']['sync'](this,_0x22776f[_0x64ee('0x12b')]);if(_0x46f4f7){logger[_0x64ee('0x2d')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x64ee('0x37')],_0x22776f['findBy']));this[_0x64ee('0xf')]['noop'](util[_0x64ee('0x27')](_0x64ee('0x12c'),this[_0x64ee('0xf')][_0x64ee('0x37')],_0x22776f[_0x64ee('0x12b')]));return{'code':0xc8,'result':_0x64ee('0x12d')};}else{logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0x12e'),this[_0x64ee('0xf')]['callerid'],_0x22776f['findBy']));this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x64ee('0xf')][_0x64ee('0x37')],_0x22776f['findBy']));return{'code':0xc8,'result':_0x64ee('0x12f')};}};AGIVertices[_0x64ee('0x11')]['logout']=function(_0x469040){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0x130'),_0x469040[_0x64ee('0x35')]));if(!this[_0x64ee('0x64')](_0x469040['findBy'])){return this[_0x64ee('0xf')]['error'](_0x469040,_0x64ee('0x129'));}logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0x12a'),this[_0x64ee('0xf')][_0x64ee('0x37')],_0x469040[_0x64ee('0x12b')]));var _0x2b5827=this[_0x64ee('0x50')][_0x64ee('0x81')](this,_0x469040[_0x64ee('0x12b')]);if(_0x2b5827){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0x12c'),this['channel']['callerid'],_0x469040[_0x64ee('0x12b')]));this[_0x64ee('0xf')][_0x64ee('0x90')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x64ee('0xf')]['callerid'],_0x469040['findBy']));return{'code':0xc8,'result':_0x64ee('0x12d')};}else{logger['info'](util[_0x64ee('0x27')](_0x64ee('0x12e'),this[_0x64ee('0xf')][_0x64ee('0x37')],_0x469040[_0x64ee('0x12b')]));this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')](_0x64ee('0x12e'),this[_0x64ee('0xf')][_0x64ee('0x37')],_0x469040[_0x64ee('0x12b')]));return{'code':0xc8,'result':_0x64ee('0x12f')};}};AGIVertices[_0x64ee('0x11')][_0x64ee('0x131')]=function(_0x525247){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x525247[_0x64ee('0x35')]));if(!this[_0x64ee('0x64')](_0x525247['operation'])){return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x525247,_0x64ee('0x132'));}this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')](_0x64ee('0x133'),_0x525247[_0x64ee('0x134')]));var _0x4758b4=eval(_0x525247[_0x64ee('0x134')]);if(!this['isConfigured'](_0x525247[_0x64ee('0xae')])){return this[_0x64ee('0xf')][_0x64ee('0x90')](_0x64ee('0xad'));}var _0x3a9a93=this[_0x64ee('0x12')][_0x64ee('0x81')](this,_0x525247['variable_id']);if(!_0x3a9a93){return this['channel'][_0x64ee('0x2a')](_0x525247,_0x64ee('0x135'));}if(_[_0x64ee('0x136')](_0x4758b4)){var _0x1ad6e5=this;_0x4758b4[_0x64ee('0xaf')](function(_0x54f13e,_0x2f58af){_0x1ad6e5[_0x64ee('0xf')][_0x64ee('0x7f')](util[_0x64ee('0x27')]('%s[%s]',_0x3a9a93,_0x2f58af),_0x54f13e);});return this[_0x64ee('0xf')][_0x64ee('0x90')](util['format']('variable\x20%s[key]\x20set',_0x3a9a93));}else{return this[_0x64ee('0xf')][_0x64ee('0x7f')](_0x3a9a93,_0x4758b4);}};AGIVertices[_0x64ee('0x11')][_0x64ee('0xc')]=function(_0x5661af){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0x137'),_0x5661af['label']));if(_0x5661af[_0x64ee('0x82')]===0x0){return this[_0x64ee('0x80')](_0x5661af);}_0x5661af[_0x64ee('0x82')]-=0x1;if(!this[_0x64ee('0x64')](_0x5661af[_0x64ee('0xdf')])){return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x5661af,'no\x20file\x20audio\x20selected');}var _0x37cce7=this[_0x64ee('0x1e')]['sync'](this,_0x5661af[_0x64ee('0xdf')]);if(!_0x37cce7){return this[_0x64ee('0xf')]['error'](_0x5661af,'no\x20file\x20audio\x20found');}var _0x195483=this['channel'][_0x64ee('0xe2')](_0x37cce7,_0x5661af['response'],_0x5661af[_0x64ee('0x138')]);var _0x28190c=_0x195483['result'];if(_0x195483[_0x64ee('0x7d')]===-0x1){this[_0x64ee('0x33')][_0x64ee('0x81')](this,_0x5661af,'-1');return _0x195483;}else if(_0x195483[_0x64ee('0x7a')]===_0x64ee('0x87')){_0x195483['result']=_0x195483[_0x64ee('0x7d')][_0x64ee('0x78')]>0x0?_0x195483[_0x64ee('0x7d')]:'t';}else if(_['isEmpty'](_0x195483[_0x64ee('0x7d')])){_0x195483[_0x64ee('0x7d')]='#';_0x28190c='#';}if(!this[_0x64ee('0x64')](_0x5661af['variable_id'])){this[_0x64ee('0xf')][_0x64ee('0x90')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x1937f2=this[_0x64ee('0x12')][_0x64ee('0x81')](this,_0x5661af[_0x64ee('0xae')]);if(!_0x1937f2){return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x5661af,_0x64ee('0x135'));}this[_0x64ee('0xf')][_0x64ee('0x7f')](_0x1937f2,_0x28190c);}this[_0x64ee('0x33')][_0x64ee('0x81')](this,_0x5661af,_0x28190c);return _0x195483;};AGIVertices[_0x64ee('0x11')][_0x64ee('0x90')]=function(_0x355d40){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0x139'),_0x355d40[_0x64ee('0x35')]));return this[_0x64ee('0xf')][_0x64ee('0x90')](_0x355d40[_0x64ee('0x13a')]||_0x355d40['label']);};AGIVertices[_0x64ee('0x11')][_0x64ee('0x13b')]=function(_0xd04109){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0x13c'),_0xd04109[_0x64ee('0x35')]));if(!this['isConfigured'](_0xd04109[_0x64ee('0x12b')])){return this['channel']['error'](_0xd04109,'no\x20find\x20by\x20configured');}logger[_0x64ee('0x2d')](util['format'](_0x64ee('0x12a'),this[_0x64ee('0xf')]['callerid'],_0xd04109[_0x64ee('0x12b')]));var _0x179fd4=this[_0x64ee('0x4b')][_0x64ee('0x81')](this,_0xd04109[_0x64ee('0x13d')]);var _0x40d5e0=this['agentPause']['sync'](this,_0xd04109[_0x64ee('0x12b')],_0x179fd4);if(_0x40d5e0){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0x12c'),this['channel'][_0x64ee('0x37')],_0xd04109['findBy']));this[_0x64ee('0xf')]['noop'](util[_0x64ee('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x64ee('0xf')][_0x64ee('0x37')],_0xd04109[_0x64ee('0x12b')]));return{'code':0xc8,'result':_0x64ee('0x12d')};}else{logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0x12e'),this[_0x64ee('0xf')]['callerid'],_0xd04109[_0x64ee('0x12b')]));this['channel']['noop'](util['format'](_0x64ee('0x12c'),this[_0x64ee('0xf')][_0x64ee('0x37')],_0xd04109[_0x64ee('0x12b')]));return{'code':0xc8,'result':_0x64ee('0x12f')};}};AGIVertices[_0x64ee('0x11')][_0x64ee('0x13e')]=function(_0x101c92){logger['info'](util[_0x64ee('0x27')](_0x64ee('0x13f'),_0x101c92[_0x64ee('0x35')]));if(!this['isConfigured'](_0x101c92[_0x64ee('0xdf')])){return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x101c92,'no\x20file\x20audio\x20selected');}var _0x1cce96=this[_0x64ee('0x1e')][_0x64ee('0x81')](this,_0x101c92[_0x64ee('0xdf')]);if(!_0x1cce96){return this['channel']['error'](_0x101c92,_0x64ee('0xe1'));}var _0x1e769f=this[_0x64ee('0xf')][_0x64ee('0x8e')](_0x64ee('0x140'),[_0x1cce96,_0x101c92[_0x64ee('0xba')]]);if(_0x1e769f[_0x64ee('0x7d')]===-0x1){return _0x1e769f;}return this[_0x64ee('0xf')][_0x64ee('0x90')](util['format'](_0x64ee('0x91'),_0x64ee('0x140'),_0x1cce96));};AGIVertices[_0x64ee('0x11')][_0x64ee('0x141')]=function(_0x5ec1d8){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x5ec1d8['label']));if(!this['isConfigured'](_0x5ec1d8['queue_id'])){return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x5ec1d8,_0x64ee('0x142'));}var _0x11ca59='';var _0x2f3681=parseInt(_0x5ec1d8[_0x64ee('0x143')],0xa);if(isNaN(_0x2f3681)){_0x11ca59=_0x5ec1d8[_0x64ee('0x143')];}else{_0x11ca59=this[_0x64ee('0x17')][_0x64ee('0x81')](this,_0x5ec1d8[_0x64ee('0x143')]);if(!_0x11ca59){return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x5ec1d8,_0x64ee('0x144'));}}var _0x3d75a2='';if(this[_0x64ee('0x64')](_0x5ec1d8['file_id'])){var _0x31d601=this[_0x64ee('0x1e')][_0x64ee('0x81')](this,_0x5ec1d8[_0x64ee('0xdf')]);if(_0x31d601){_0x3d75a2=_0x31d601;}}this[_0x64ee('0x33')]['sync'](this,_0x5ec1d8,_0x11ca59);if(_0x5ec1d8[_0x64ee('0xba')][_0x64ee('0x145')]('x')<0x0){_0x5ec1d8[_0x64ee('0xba')]+='x';}if(_0x5ec1d8['opts']['indexOf']('X')<0x0){_0x5ec1d8[_0x64ee('0xba')]+='X';}this[_0x64ee('0xf')]['setVariable'](_0x64ee('0x146'),_0x11ca59?_0x11ca59[_0x64ee('0x147')]():'');var _0x37bc17=this[_0x64ee('0xf')][_0x64ee('0x8e')](_0x64ee('0x148'),[_0x11ca59,_0x5ec1d8[_0x64ee('0xba')],_0x5ec1d8['url'],_0x3d75a2,_0x5ec1d8[_0x64ee('0x87')],_0x5ec1d8[_0x64ee('0x8')],_0x5ec1d8[_0x64ee('0x149')],_0x5ec1d8[_0x64ee('0x14a')],'',_0x5ec1d8[_0x64ee('0x14b')]]);if(_0x37bc17[_0x64ee('0x7d')]===-0x1){return _0x37bc17;}return this[_0x64ee('0xf')]['noop'](util[_0x64ee('0x27')](_0x64ee('0x91'),_0x64ee('0x148'),_0x11ca59));};AGIVertices['prototype'][_0x64ee('0x14c')]=function(_0x3da490){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0x14d'),_0x3da490[_0x64ee('0x35')]));var _0x56d3f9=_0x3da490[_0x64ee('0x14e')]||'wav';var _0x171f01=util[_0x64ee('0x27')](_0x64ee('0x14f'),this[_0x64ee('0xf')][_0x64ee('0x34')],rs[_0x64ee('0xe8')](0x5));var _0x583f0c=util[_0x64ee('0x27')]('%s/recordings/%s.%s',FILES_PATH,_0x171f01,_0x56d3f9);var _0x57a622=util[_0x64ee('0x27')](_0x64ee('0x102'),FILES_PATH,_0x171f01);this['createSquareRecording']['sync'](this,_0x3da490,_0x171f01,_0x583f0c);this[_0x64ee('0xf')][_0x64ee('0x7f')](_0x64ee('0x150'),_0x171f01);logger[_0x64ee('0x2d')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x57a622,_0x56d3f9,_0x3da490[_0x64ee('0x151')],_0x3da490[_0x64ee('0x87')]);return this['channel'][_0x64ee('0x105')](_0x57a622,_0x56d3f9,_0x3da490['escape_digits'],_0x3da490[_0x64ee('0x87')],undefined,!![]);};AGIVertices[_0x64ee('0x11')][_0x64ee('0x152')]=function(_0x5279ab){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x5279ab[_0x64ee('0x35')]));return this[_0x64ee('0xf')][_0x64ee('0x153')](_0x5279ab[_0x64ee('0x154')][_0x64ee('0x57')](/\s+/g,''),_0x5279ab[_0x64ee('0x151')]);};AGIVertices[_0x64ee('0x11')]['saynumber']=function(_0x15f2db){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0x155'),_0x15f2db[_0x64ee('0x35')]));return this[_0x64ee('0xf')][_0x64ee('0x156')](_0x15f2db['number']['replace'](/\s+/g,''),_0x15f2db[_0x64ee('0x151')]);};AGIVertices['prototype'][_0x64ee('0x157')]=function(_0x325cdd){logger[_0x64ee('0x2d')](util['format'](_0x64ee('0x158'),_0x325cdd[_0x64ee('0x35')]));return this['channel'][_0x64ee('0x159')](_0x325cdd[_0x64ee('0x59')],_0x325cdd[_0x64ee('0x151')]);};AGIVertices[_0x64ee('0x11')][_0x64ee('0x15a')]=function(_0x517868){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0x15b'),_0x517868[_0x64ee('0x35')]));if(!this[_0x64ee('0x64')](_0x517868[_0x64ee('0x15c')])){return this[_0x64ee('0xf')]['noop'](_0x64ee('0x15d'));}var _0x488bdb=this[_0x64ee('0x15e')][_0x64ee('0x81')](this,_0x517868[_0x64ee('0x15c')]);if(!_0x488bdb||!_0x488bdb[_0x64ee('0x15f')]){return this['channel']['error'](_0x517868,'no\x20mail\x20account\x20found');}var _0x2ec599={'from':util[_0x64ee('0x27')](_0x64ee('0x160'),_0x488bdb['name'],_0x488bdb['email']||_0x488bdb['Smtp'][_0x64ee('0x161')]),'to':_0x517868['to']||'','cc':_0x517868['cc']||'','bcc':_0x517868[_0x64ee('0x162')]||'','subject':_0x517868[_0x64ee('0x163')],'html':_0x517868[_0x64ee('0x59')],'text':_0x517868[_0x64ee('0x59')]};var _0x523e0a={'tls':{'rejectUnauthorized':![]}};if(_0x488bdb[_0x64ee('0x15f')][_0x64ee('0x164')]){_0x523e0a[_0x64ee('0x164')]=_0x488bdb['Smtp']['service'];}else{_0x523e0a[_0x64ee('0x165')]=_0x488bdb[_0x64ee('0x15f')][_0x64ee('0x165')];_0x523e0a[_0x64ee('0x166')]=_0x488bdb[_0x64ee('0x15f')][_0x64ee('0x166')];_0x523e0a[_0x64ee('0x167')]=_0x488bdb['Smtp'][_0x64ee('0x167')];}if(_0x488bdb[_0x64ee('0x15f')][_0x64ee('0x168')]){_0x523e0a[_0x64ee('0x169')]={'user':_0x488bdb[_0x64ee('0x15f')][_0x64ee('0x161')],'pass':_0x488bdb[_0x64ee('0x15f')]['pass']};}if(this['isConfigured'](_0x517868[_0x64ee('0x16a')])){}logger['debug']('sendMail\x20message',JSON[_0x64ee('0xe4')](_0x2ec599));this[_0x64ee('0x33')][_0x64ee('0x81')](this,_0x517868,_0x517868[_0x64ee('0x15c')]);this['channel']['noop'](util[_0x64ee('0x27')](_0x64ee('0x16b'),_0x488bdb[_0x64ee('0x16')]));this[_0x64ee('0x22')][_0x64ee('0x81')](this,_0x523e0a,_0x2ec599);return this['channel'][_0x64ee('0x90')](_0x64ee('0x16c'));};AGIVertices[_0x64ee('0x11')][_0x64ee('0x16d')]=function(_0x1475b8){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x1475b8['label']));return this['channel'][_0x64ee('0x90')](_0x64ee('0x16e'));};AGIVertices[_0x64ee('0x11')]['sendSMS']=function(_0x3ba8fa){logger['info'](util[_0x64ee('0x27')](_0x64ee('0x16f'),_0x3ba8fa[_0x64ee('0x35')]));if(!this['isConfigured'](_0x3ba8fa[_0x64ee('0x170')])){return this[_0x64ee('0xf')][_0x64ee('0x90')](_0x64ee('0x171'));}var _0x1e53dd=this['getSmsAccount'][_0x64ee('0x81')](this,_0x3ba8fa[_0x64ee('0x170')]);if(!_0x1e53dd){return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x3ba8fa,_0x64ee('0x172'));}var _0x5d8829={'body':_0x3ba8fa[_0x64ee('0x173')],'phone':_0x3ba8fa['to']||'','SmsAccountId':_0x1e53dd['id']};logger[_0x64ee('0xb5')](_0x64ee('0x174'),JSON[_0x64ee('0xe4')](_0x5d8829));this[_0x64ee('0x33')][_0x64ee('0x81')](this,_0x3ba8fa,_0x3ba8fa['sms_account_id']);this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')](_0x64ee('0x175'),_0x1e53dd['name']));this[_0x64ee('0x32')][_0x64ee('0x81')](this,_0x5d8829);return this[_0x64ee('0xf')]['noop'](_0x64ee('0x176'));};AGIVertices[_0x64ee('0x11')][_0x64ee('0x177')]=function(_0x392250){logger['info'](util[_0x64ee('0x27')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x392250[_0x64ee('0x35')]));if(!this[_0x64ee('0x64')](_0x392250['variable_id'])){return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x392250,'no\x20variable\x20selected');}var _0x420c5e=this[_0x64ee('0x12')][_0x64ee('0x81')](this,_0x392250[_0x64ee('0xae')]);if(!_0x420c5e){return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x392250,_0x64ee('0x135'));}return this[_0x64ee('0xf')][_0x64ee('0x7f')](_0x420c5e,_0x392250[_0x64ee('0x178')]);};AGIVertices[_0x64ee('0x11')]['start']=function(_0x24f500){logger[_0x64ee('0x2d')](util['format'](_0x64ee('0x179'),_0x24f500[_0x64ee('0x35')]));this[_0x64ee('0xf')]['noop'](_0x64ee('0x17a'));if(_0x24f500[_0x64ee('0x85')]==='yes'){this[_0x64ee('0xf')][_0x64ee('0x90')](_0x64ee('0x17b'));return this[_0x64ee('0xf')][_0x64ee('0x85')]();}return this[_0x64ee('0xf')][_0x64ee('0x90')](_0x64ee('0x17c'));};AGIVertices[_0x64ee('0x11')]['subproject']=function(_0x302f01){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x302f01['label']));if(!this[_0x64ee('0x64')](_0x302f01['project_id'])){return this['channel'][_0x64ee('0x2a')](_0x302f01,_0x64ee('0x17d'));}var _0x11384e=this[_0x64ee('0x1a')][_0x64ee('0x81')](this,_0x302f01[_0x64ee('0x17e')]);if(!this[_0x64ee('0x64')](_0x11384e)){return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x302f01,util[_0x64ee('0x27')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x302f01[_0x64ee('0x17e')]));}if(_0x11384e===this[_0x64ee('0xf')][_0x64ee('0x3e')]){return this['channel'][_0x64ee('0x2a')](_0x302f01,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this['createSquareDetailsReport']['sync'](this,_0x302f01,_0x11384e);var _0x4d8a55=this['channel'][_0x64ee('0x8e')](_0x64ee('0x17f'),util[_0x64ee('0x27')](_0x64ee('0x180'),config[_0x64ee('0x8')][_0x64ee('0x165')]||_0x64ee('0x181'),_0x11384e,this[_0x64ee('0xf')][_0x64ee('0x3e')]));if(_0x4d8a55[_0x64ee('0x7d')]===-0x1){return _0x4d8a55;}return this[_0x64ee('0xf')][_0x64ee('0x90')](util['format'](_0x64ee('0x91'),_0x64ee('0x17f'),_0x11384e));};AGIVertices[_0x64ee('0x11')][_0x64ee('0x182')]=function(_0x47b05f){logger['info'](util[_0x64ee('0x27')](_0x64ee('0x183'),_0x47b05f['label']));var _0x3bb064=this['shellCommand'][_0x64ee('0x81')](this,_0x47b05f['command']);this[_0x64ee('0x33')][_0x64ee('0x81')](this,_0x47b05f,_0x47b05f[_0x64ee('0x83')]);if(this[_0x64ee('0x64')](_0x47b05f[_0x64ee('0xae')])){var _0x50b740=this['getVariable'][_0x64ee('0x81')](this,_0x47b05f[_0x64ee('0xae')]);if(_0x50b740){this[_0x64ee('0xf')][_0x64ee('0x7f')](_0x50b740,_0x3bb064);return this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x47b05f[_0x64ee('0x83')],_0x50b740));}}return this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')](_0x64ee('0x184'),_0x47b05f[_0x64ee('0x83')]));};AGIVertices[_0x64ee('0x11')][_0x64ee('0x185')]=function(_0xc70ce4){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0xc70ce4[_0x64ee('0x35')]));if(!this[_0x64ee('0x64')](_0xc70ce4[_0x64ee('0x59')])){return this[_0x64ee('0xf')][_0x64ee('0x90')]('no\x20text\x20configured');}this[_0x64ee('0xf')][_0x64ee('0x90')](util['format'](_0x64ee('0x186'),_0xc70ce4[_0x64ee('0x59')]));var _0x2e0aa8=this['googleTTS']['sync'](this,_0xc70ce4);if(_0x2e0aa8){this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')](_0x64ee('0x187'),_0x2e0aa8));var _0x536154=this[_0x64ee('0xf')][_0x64ee('0xd2')](_0x2e0aa8);try{fs[_0x64ee('0xf3')](_0x2e0aa8+_0x64ee('0xf4'));}catch(_0x517367){logger[_0x64ee('0x2a')](_0x517367);}return _0x536154;}return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0xc70ce4,_0x64ee('0x188'));};AGIVertices[_0x64ee('0x11')][_0x64ee('0x189')]=function(_0x1f73f8){logger[_0x64ee('0x2d')](util['format']('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x1f73f8['label']));if(!this[_0x64ee('0x64')](_0x1f73f8[_0x64ee('0x12b')])){return this[_0x64ee('0xf')][_0x64ee('0x2a')](_0x1f73f8,_0x64ee('0x129'));}logger[_0x64ee('0x2d')](util['format'](_0x64ee('0x12a'),this[_0x64ee('0xf')]['callerid'],_0x1f73f8[_0x64ee('0x12b')]));var _0x3e7fac=this[_0x64ee('0x4f')][_0x64ee('0x81')](this,_0x1f73f8[_0x64ee('0x12b')]);if(_0x3e7fac){logger[_0x64ee('0x2d')](util['format'](_0x64ee('0x12c'),this['channel'][_0x64ee('0x37')],_0x1f73f8['findBy']));this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x1f73f8[_0x64ee('0x12b')]));return{'code':0xc8,'result':_0x64ee('0x12d')};}else{logger[_0x64ee('0x2d')](util[_0x64ee('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x64ee('0xf')][_0x64ee('0x37')],_0x1f73f8[_0x64ee('0x12b')]));this[_0x64ee('0xf')][_0x64ee('0x90')](util[_0x64ee('0x27')](_0x64ee('0x12e'),this[_0x64ee('0xf')][_0x64ee('0x37')],_0x1f73f8[_0x64ee('0x12b')]));return{'code':0xc8,'result':_0x64ee('0x12f')};}};AGIVertices[_0x64ee('0x11')][_0x64ee('0x18a')]=function(_0x47b022){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x47b022[_0x64ee('0x35')]));var _0x1805b1=this['channel'][_0x64ee('0x8e')]('VOICEMAIL',[_0x47b022[_0x64ee('0x18b')],_0x47b022[_0x64ee('0x8f')]]);if(_0x1805b1[_0x64ee('0x7d')]===-0x1){return _0x1805b1;}return this['channel'][_0x64ee('0x90')](util[_0x64ee('0x27')](_0x64ee('0x91'),_0x64ee('0x18c'),_0x47b022[_0x64ee('0x18b')]));};AGIVertices['prototype']['vswitch']=function(_0x5d7282){logger[_0x64ee('0x2d')](util[_0x64ee('0x27')](_0x64ee('0x18d'),_0x5d7282[_0x64ee('0x35')]));if(!this['isConfigured'](_0x5d7282[_0x64ee('0xae')])){return this['channel'][_0x64ee('0x2a')](_0x5d7282,_0x64ee('0x18e'));}var _0x225372=this[_0x64ee('0x12')][_0x64ee('0x81')](this,_0x5d7282['variable_id']);if(!_0x225372){return this[_0x64ee('0xf')]['error'](_0x5d7282,_0x64ee('0x135'));}var _0x548bec=this[_0x64ee('0xf')][_0x64ee('0x12')](_0x225372);return{'code':0xc8,'result':_0x548bec[_0x64ee('0x7a')]?_0x548bec[_0x64ee('0x7a')]:'-'};};String['prototype'][_0x64ee('0x79')]=function(_0x4b2f26,_0x57252d){return this[_0x64ee('0x77')](_0x4b2f26)[_0x64ee('0x18f')](_0x57252d);};module[_0x64ee('0x190')]=AGIVertices; \ No newline at end of file +var _0x49a0=['googleDialogflow','text','sestekNDA','ispeechTTS','key','ispeech_tts_language','ispeechASR','ispeech_asr_language','en-US','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','includes','clone','hasOwnProperty','isString','replaceAllVariables','split','length','getVariable','extra','maxRetry','retry','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','timeout','Wait\x20%s\x20seconds\x20before\x20answer','wait','result','no\x20list\x20selected','delay','add','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','options','Executed\x20command\x20%s\x20%s','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE','database','no\x20database\x20selected','getSquareOdbc','sync','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','setVariable','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','url','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','audiofile','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','test','stringify','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','unlink','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s.%s','beep','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','priority','gotoif','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','no\x20key\x20configured','%s/recordings/%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','FIND\x20AGENT\x20%s\x20BY\x20%s','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','no\x20variable\x20found','isArray','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','sayNumber','sayphonetic','sayPhonetic','sendMail','no\x20mail\x20account\x20configured','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','subject','service','port','secure','authentication','auth','pass','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','replaceAll','exports','path','util','lodash','odbc','randomstring','moment','../../config/logger','./scripts','/var/opt/motion2/server/files','menu','getdigits','getsecretdigits','rpc','mailRpc','prototype','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareOdbcById','dsn','getUser','getUserById','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','map','Intervals','interval','format','%s/sounds/converted/%s','getQueryOdbc','info','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','context','accountcode','dnid','arg_1','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','getPauseById','agentPause','error','agentUnpause','agent','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleTTS'];(function(_0x258d78,_0x619138){var _0x4b20ac=function(_0x5d926f){while(--_0x5d926f){_0x258d78['push'](_0x258d78['shift']());}};_0x4b20ac(++_0x619138);}(_0x49a0,0x132));var _0x049a=function(_0x43d701,_0x4bb2e9){_0x43d701=_0x43d701-0x0;var _0x2ec4c6=_0x49a0[_0x43d701];return _0x2ec4c6;};'use strict';var fs=require('fs');var path=require(_0x049a('0x0'));var util=require(_0x049a('0x1'));var _=require(_0x049a('0x2'));var sh=require('shelljs');var odbc=require(_0x049a('0x3'))();var rs=require(_0x049a('0x4'));var moment=require(_0x049a('0x5'));var Mustache=require('mustache');var logger=require(_0x049a('0x6'))('agi');var config=require('../../config/environment');var scripts=require(_0x049a('0x7'));var FILES_PATH=_0x049a('0x8');var verticesWithRetry=[_0x049a('0x9'),_0x049a('0xa'),_0x049a('0xb')];var AGIVertices=function(_0x3bcc05,_0x69fb8e,_0x49e803){this['channel']=_0x3bcc05;this[_0x049a('0xc')]=_0x69fb8e;this[_0x049a('0xd')]=_0x49e803;};AGIVertices[_0x049a('0xe')]['getVariable']=function(_0x1f3158,_0x5cf0ff){this[_0x049a('0xc')][_0x049a('0xf')](_0x1f3158)[_0x049a('0x10')](function(_0x4796d1){_0x5cf0ff(null,_0x4796d1?_0x4796d1[_0x049a('0x11')]:![]);})[_0x049a('0x12')](function(_0x801f3c){_0x5cf0ff(_0x801f3c);});};AGIVertices[_0x049a('0xe')][_0x049a('0x13')]=function(_0x9a7150,_0x1f95d0){this['rpc'][_0x049a('0x14')](_0x9a7150)[_0x049a('0x10')](function(_0x3f719d){_0x1f95d0(null,_0x3f719d?_0x3f719d['name']:![]);})[_0x049a('0x12')](function(_0x593cbd){_0x1f95d0(_0x593cbd);});};AGIVertices[_0x049a('0xe')][_0x049a('0x15')]=function(_0x191784,_0x4a996e){this[_0x049a('0xc')]['getSquareProjectById'](_0x191784)[_0x049a('0x10')](function(_0x477507){_0x4a996e(null,_0x477507?_0x477507['name']:![]);})[_0x049a('0x12')](function(_0x309b9d){_0x4a996e(_0x309b9d);});};AGIVertices[_0x049a('0xe')]['getSquareOdbc']=function(_0x5c3f60,_0x1decb4){this[_0x049a('0xc')][_0x049a('0x16')](_0x5c3f60)[_0x049a('0x10')](function(_0x4355ee){_0x1decb4(null,_0x4355ee?_0x4355ee[_0x049a('0x17')]:![]);})[_0x049a('0x12')](function(_0x231079){_0x1decb4(_0x231079);});};AGIVertices['prototype'][_0x049a('0x18')]=function(_0x5dae75,_0x24417b){this[_0x049a('0xc')][_0x049a('0x19')](_0x5dae75)[_0x049a('0x10')](function(_0x59a73e){_0x24417b(null,_0x59a73e?_0x59a73e['name']:![]);})['catch'](function(_0x241e60){_0x24417b(_0x241e60);});};AGIVertices[_0x049a('0xe')]['getTrunk']=function(_0x3b4444,_0xa746ec){this[_0x049a('0xc')][_0x049a('0x1a')](_0x3b4444)[_0x049a('0x10')](function(_0x12834e){_0xa746ec(null,_0x12834e?_0x12834e['name']:![]);})[_0x049a('0x12')](function(_0x2ef200){_0xa746ec(_0x2ef200);});};AGIVertices[_0x049a('0xe')][_0x049a('0x1b')]=function(_0x116e26,_0x3556ef){var _0x1f3c89=this;this[_0x049a('0xc')][_0x049a('0x1c')](_0x116e26)['then'](function(_0x52798c){_0x3556ef(null,_0x52798c?_0x1f3c89[_0x049a('0x1d')](_0x52798c[_0x049a('0x1e')]):![]);})['catch'](function(_0x156fc5){_0x3556ef(_0x156fc5);});};AGIVertices[_0x049a('0xe')][_0x049a('0x1f')]=function(_0x37fffc,_0x3560d2){this[_0x049a('0xc')]['getMailAccountById'](_0x37fffc)['then'](function(_0xf882ec){_0x3560d2(null,_0xf882ec?_0xf882ec:![]);})['catch'](function(_0x5a87c3){_0x3560d2(_0x5a87c3);});};AGIVertices[_0x049a('0xe')][_0x049a('0x20')]=function(_0x569401,_0xb2393d,_0x5dcfa3){this[_0x049a('0xd')]['sendMailMessage'](_0x569401,_0xb2393d)[_0x049a('0x10')](function(){_0x5dcfa3(null);})['catch'](function(_0x290c35){_0x5dcfa3(_0x290c35);});};AGIVertices[_0x049a('0xe')][_0x049a('0x21')]=function(_0x1c470a,_0x4e10ed){this[_0x049a('0xc')][_0x049a('0x22')](_0x1c470a)['then'](function(_0xdd7be){if(_0xdd7be){if(_0xdd7be[_0x049a('0x23')]){_0x4e10ed(null,[_0xdd7be['interval']]);}else{_0x4e10ed(null,_[_0x049a('0x24')](_0xdd7be[_0x049a('0x25')],_0x049a('0x26')));}}else{_0x4e10ed(null,![]);}})[_0x049a('0x12')](function(_0x43d0fb){_0x4e10ed(_0x43d0fb);});};AGIVertices[_0x049a('0xe')][_0x049a('0x1d')]=function(_0x11ac00){return util[_0x049a('0x27')](_0x049a('0x28'),FILES_PATH,_0x11ac00);};AGIVertices['prototype'][_0x049a('0x29')]=function(_0x352772,_0x2819af,_0x45f012){odbc['open'](_0x352772,function(_0x58e22f){if(_0x58e22f){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x58e22f);_0x45f012(_0x58e22f);}else{logger[_0x049a('0x2a')]('ODBC\x20connection\x20successfully');odbc[_0x049a('0x2b')](_0x2819af,function(_0x559da8,_0x34b758){if(_0x559da8){logger[_0x049a('0x2a')]('Error\x20executing\x20query\x20%s',_0x2819af);_0x45f012(_0x559da8);}else{logger[_0x049a('0x2a')](_0x049a('0x2c'),_0x2819af);odbc[_0x049a('0x2d')](function(_0x1c08a9){if(_0x1c08a9){logger['error'](_0x049a('0x2e'),_0x1c08a9);}_0x45f012(null,_0x34b758);});}});}});};AGIVertices['prototype'][_0x049a('0x2f')]=function(_0x4203b6,_0x120ea5){this['rpc']['getSmsAccountById'](_0x4203b6)[_0x049a('0x10')](function(_0x54a581){_0x120ea5(null,_0x54a581?_0x54a581:![]);})[_0x049a('0x12')](function(_0x57f06d){_0x120ea5(_0x57f06d);});};AGIVertices[_0x049a('0xe')][_0x049a('0x30')]=function(_0x56195a,_0x121e2c){this[_0x049a('0xc')][_0x049a('0x30')](_0x56195a)[_0x049a('0x10')](function(_0x2c0af1){_0x121e2c(null,_0x2c0af1);})[_0x049a('0x12')](function(_0x34f9c6){_0x121e2c(_0x34f9c6);});};AGIVertices['prototype'][_0x049a('0x31')]=function(_0x4a40dc,_0x9478c8,_0x3ebc99){this[_0x049a('0xc')][_0x049a('0x31')]({'uniqueid':this[_0x049a('0x32')][_0x049a('0x33')],'node':_0x4a40dc[_0x049a('0x34')],'application':_0x4a40dc[_0x049a('0x35')],'data':_0x9478c8||null,'project_name':this[_0x049a('0x32')]['arg_1'],'callerid':this[_0x049a('0x32')][_0x049a('0x36')]})[_0x049a('0x10')](function(_0x3f4f55){if(_0x3ebc99){_0x3ebc99(null,_0x3f4f55);}})['catch'](function(_0x45f001){if(_0x3ebc99){_0x3ebc99(_0x45f001);}});};AGIVertices['prototype']['createSquareRecording']=function(_0x960cd1,_0x3dba13,_0x11b404,_0x970569){this[_0x049a('0xc')][_0x049a('0x37')]({'uniqueid':this[_0x049a('0x32')][_0x049a('0x33')],'callerid':this['channel']['callerid'],'calleridname':this[_0x049a('0x32')][_0x049a('0x38')],'context':this[_0x049a('0x32')][_0x049a('0x39')],'extension':this[_0x049a('0x32')]['extension'],'priority':this[_0x049a('0x32')]['priority'],'accountcode':this['channel'][_0x049a('0x3a')],'dnid':this[_0x049a('0x32')][_0x049a('0x3b')],'projectName':this['channel'][_0x049a('0x3c')],'saveName':_0x3dba13,'filename':_0x960cd1['file']||_0x3dba13,'savePath':_0x11b404})[_0x049a('0x10')](function(_0x18ad24){_0x970569(null,_0x18ad24);})[_0x049a('0x12')](function(_0x2ce08d){_0x970569(_0x2ce08d);});};AGIVertices[_0x049a('0xe')][_0x049a('0x3d')]=function(_0x7b55b5,_0x3ac842,_0x34edb4){this['rpc'][_0x049a('0x3d')]({'uniqueid':this[_0x049a('0x32')][_0x049a('0x33')],'body':_0x7b55b5,'direction':_0x3ac842})['then'](function(_0x563ee8){if(_0x34edb4){_0x34edb4(null,_0x563ee8);}})[_0x049a('0x12')](function(_0x3f70a9){if(_0x34edb4){_0x34edb4(_0x3f70a9);}});};AGIVertices[_0x049a('0xe')][_0x049a('0x3e')]=function(_0x5effe,_0xc2153a){this['rpc'][_0x049a('0x3e')]({'firstName':_[_0x049a('0x3f')](_0x5effe['name'])||_[_0x049a('0x40')](_0x5effe[_0x049a('0x11')])?_0x049a('0x41')+Math['random']():_0x5effe[_0x049a('0x11')],'lastName':_['isEmpty'](_0x5effe['lastName'])||_[_0x049a('0x40')](_0x5effe[_0x049a('0x42')])?null:_0x5effe[_0x049a('0x42')],'phone':_0x5effe[_0x049a('0x43')],'ListId':_0x5effe[_0x049a('0x44')],'scheduledAt':_0x5effe[_0x049a('0x45')],'callbackUniqueid':this[_0x049a('0x32')][_0x049a('0x33')],'tags':_0x049a('0x46'),'description':'Callback\x20scheduled\x20at\x20'+_0x5effe[_0x049a('0x45')][_0x049a('0x47')](),'priority':_0x5effe[_0x049a('0x48')]})[_0x049a('0x10')](function(_0x4ced42){_0xc2153a(null,_0x4ced42);})['catch'](function(_0x578229){_0xc2153a(_0x578229);});};AGIVertices[_0x049a('0xe')]['getPause']=function(_0x54a694,_0x470087){this[_0x049a('0xc')][_0x049a('0x49')](_0x54a694)[_0x049a('0x10')](function(_0x4b6237){_0x470087(null,_0x4b6237?_0x4b6237['name']:![]);})['catch'](function(_0x4a7de9){_0x470087(_0x4a7de9);});};AGIVertices['prototype'][_0x049a('0x4a')]=function(_0x362ee2,_0x2bea71,_0x18332a){var _0x51bca9={'role':'agent'};_0x51bca9[_0x362ee2]=this['channel'][_0x049a('0x36')];this[_0x049a('0xc')]['agentPause'](_0x51bca9,_0x2bea71,this['channel']['uniqueid'])['then'](function(_0x2b9a28){_0x18332a(null,_[_0x049a('0x40')](_0x2b9a28)?![]:!![]);})[_0x049a('0x12')](function(_0x3a99e1){logger[_0x049a('0x4b')](_0x3a99e1);_0x18332a(null,![]);});};AGIVertices['prototype'][_0x049a('0x4c')]=function(_0x2c91e0,_0x497054){var _0x25e5f4={'role':_0x049a('0x4d')};_0x25e5f4[_0x2c91e0]=this[_0x049a('0x32')]['callerid'];this[_0x049a('0xc')]['agentUnpause'](_0x25e5f4)[_0x049a('0x10')](function(_0x3f0d65){_0x497054(null,_['isNil'](_0x3f0d65)?![]:!![]);})['catch'](function(_0x2e2555){logger[_0x049a('0x4b')](_0x2e2555);_0x497054(null,![]);});};AGIVertices[_0x049a('0xe')][_0x049a('0x4e')]=function(_0x1d5666,_0x27e912){var _0xea3ed4={'role':_0x049a('0x4d')};_0xea3ed4[_0x1d5666]=this[_0x049a('0x32')][_0x049a('0x36')];this[_0x049a('0xc')][_0x049a('0x4e')](_0xea3ed4)[_0x049a('0x10')](function(_0x576cf8){_0x27e912(null,_['isNil'](_0x576cf8)?![]:!![]);})[_0x049a('0x12')](function(_0x61c7ef){logger['error'](_0x61c7ef);_0x27e912(null,![]);});};AGIVertices['prototype'][_0x049a('0x4f')]=function(_0x371261,_0x4b80ed){var _0x106318={'role':_0x049a('0x4d')};_0x106318[_0x371261]=this[_0x049a('0x32')]['callerid'];var _0x5356c6=_0x371261!='internal'?util[_0x049a('0x27')](_0x049a('0x50'),_0x049a('0x51'),this[_0x049a('0x32')][_0x049a('0x36')]):undefined;this[_0x049a('0xc')][_0x049a('0x4f')](_0x106318,_0x5356c6)[_0x049a('0x10')](function(_0x2e1e0f){_0x4b80ed(null,_[_0x049a('0x40')](_0x2e1e0f)?![]:!![]);})[_0x049a('0x12')](function(_0x44c743){logger[_0x049a('0x4b')](_0x44c743);_0x4b80ed(null,![]);});};AGIVertices[_0x049a('0xe')][_0x049a('0x52')]=function(_0x5888be,_0x29395f){sh[_0x049a('0x53')](_[_0x049a('0x54')](_0x5888be),function(_0x512de6,_0x4ffa6a){var _0x54cbe1=_0x4ffa6a[_0x049a('0x55')](/(\r\n|\n|\r)/gm,'');_0x29395f(null,_0x54cbe1);});};AGIVertices['prototype'][_0x049a('0x56')]=function(_0x2cbe8f,_0x1e2c5a){scripts[_0x049a('0x56')](_0x2cbe8f['text'],_0x2cbe8f['google_tts_language']||'en',0x1)[_0x049a('0x10')](function(_0x2e9969){_0x1e2c5a(null,_0x2e9969);})[_0x049a('0x12')](function(_0x4efc51){_0x1e2c5a(_0x4efc51);});};AGIVertices[_0x049a('0xe')][_0x049a('0x57')]=function(_0x45161d,_0x3d7c84){scripts[_0x049a('0x57')](this[_0x049a('0x32')]['uniqueid'],_0x45161d['key'],_0x45161d[_0x049a('0x58')],_0x45161d['dialogflow_language']||'en')[_0x049a('0x10')](function(_0x283479){_0x3d7c84(null,_0x283479);})[_0x049a('0x12')](function(_0xcd61ca){_0x3d7c84(_0xcd61ca);});};AGIVertices[_0x049a('0xe')][_0x049a('0x59')]=function(_0x231f4c,_0x4832bf){scripts['sestekNDA'](this[_0x049a('0x32')],_0x231f4c)[_0x049a('0x10')](function(_0x22c9ae){_0x4832bf(null,_0x22c9ae);})[_0x049a('0x12')](function(_0x2c6d4b){_0x4832bf(_0x2c6d4b);});};AGIVertices[_0x049a('0xe')][_0x049a('0x5a')]=function(_0x4b8040,_0x5a27f4){scripts['ispeechTTS'](_0x4b8040[_0x049a('0x5b')],_0x4b8040['text'],_0x4b8040[_0x049a('0x5c')]||'en-US',_0x4b8040['speed'])['then'](function(_0xfcc05a){_0x5a27f4(null,_0xfcc05a);})[_0x049a('0x12')](function(_0x18fdae){_0x5a27f4(_0x18fdae);});};AGIVertices[_0x049a('0xe')][_0x049a('0x5d')]=function(_0x40db98,_0x4c08f3,_0x473d3e){scripts[_0x049a('0x5d')](_0x4c08f3,_0x40db98[_0x049a('0x5b')],_0x40db98[_0x049a('0x5e')]||_0x049a('0x5f'),this[_0x049a('0x60')](_0x40db98[_0x049a('0x61')])?_0x40db98[_0x049a('0x61')]:undefined)['then'](function(_0x6070fd){_0x473d3e(null,_0x6070fd);})[_0x049a('0x12')](function(_0x41f24e){_0x473d3e(_0x41f24e);});};AGIVertices['prototype'][_0x049a('0x62')]=function(_0x2c9ca5,_0x1792b7){scripts['awsPolly'](_0x2c9ca5[_0x049a('0x63')],_0x2c9ca5[_0x049a('0x64')],_0x2c9ca5[_0x049a('0x65')],_0x2c9ca5[_0x049a('0x66')]||_0x049a('0x67'),_0x2c9ca5[_0x049a('0x58')],_0x2c9ca5[_0x049a('0x68')]||_0x049a('0x58'))[_0x049a('0x10')](function(_0x4e161c){_0x1792b7(null,_0x4e161c);})[_0x049a('0x12')](function(_0x4db6df){_0x1792b7(_0x4db6df);});};AGIVertices[_0x049a('0xe')]['awsLex']=function(_0x590c56,_0x397339){scripts[_0x049a('0x69')](this['channel'][_0x049a('0x33')],_0x590c56[_0x049a('0x63')],_0x590c56[_0x049a('0x64')],_0x590c56[_0x049a('0x6a')],_0x590c56[_0x049a('0x58')],_0x590c56['aws_bot_name'])['then'](function(_0x5424a5){_0x397339(null,_0x5424a5);})[_0x049a('0x12')](function(_0xa9da3d){_0x397339(_0xa9da3d);});};AGIVertices[_0x049a('0xe')][_0x049a('0x6b')]=function(_0x276387,_0x2285f3,_0x2f0f33){scripts[_0x049a('0x6b')](_0x2285f3,_0x276387[_0x049a('0x5b')],_0x276387[_0x049a('0x6c')]||_0x049a('0x5f'))[_0x049a('0x10')](function(_0x2ddbeb){_0x2f0f33(null,_0x2ddbeb);})[_0x049a('0x12')](function(_0x14527e){_0x2f0f33(_0x14527e);});};AGIVertices[_0x049a('0xe')][_0x049a('0x6d')]=function(_0x415e39,_0x11c572,_0x2b4159){scripts[_0x049a('0x6d')](_0x11c572,_0x415e39[_0x049a('0x6e')],_0x415e39[_0x049a('0x6f')],_0x415e39[_0x049a('0x70')])[_0x049a('0x10')](function(_0x4bf14d){_0x2b4159(null,_0x4bf14d);})[_0x049a('0x12')](function(_0x4e2303){_0x2b4159(_0x4e2303);});};AGIVertices['prototype'][_0x049a('0x71')]=function(_0x3b5a16){var _0x59c4de=_[_0x049a('0x72')](verticesWithRetry,_0x3b5a16[_0x049a('0x35')])?_0x3b5a16:_[_0x049a('0x73')](_0x3b5a16);for(var _0x5b1712 in _0x59c4de){if(_0x59c4de[_0x049a('0x74')](_0x5b1712)){if(_0x59c4de[_0x5b1712]&&_[_0x049a('0x75')](_0x59c4de[_0x5b1712])){_0x59c4de[_0x5b1712]=this[_0x049a('0x76')](_0x59c4de[_0x5b1712]);}}}return _0x59c4de;};AGIVertices[_0x049a('0xe')]['replaceAllVariables']=function(_0x142e47){var _0x25efaf=_0x142e47[_0x049a('0x77')]('{');for(var _0x3c2192=0x1;_0x3c2192<_0x25efaf[_0x049a('0x78')];_0x3c2192+=0x1){var _0x55efe5=_0x25efaf[_0x3c2192]['split']('}');if(_0x55efe5['length']>0x1){_0x142e47=_0x142e47['replaceAll']('{'+_0x55efe5[0x0]+'}',this[_0x049a('0x32')][_0x049a('0x79')](_0x55efe5[0x0])[_0x049a('0x7a')]||_0x55efe5[0x0]);}}if(_0x25efaf[_0x049a('0x78')]===0x1){return _0x142e47[_0x049a('0x47')]();}return this[_0x049a('0x76')](_0x142e47);};AGIVertices[_0x049a('0xe')]['getAndSetVariable']=function(_0x3b2126,_0x3facf2){var _0x5e34e5=this['channel'][_0x049a('0x79')](_0x3b2126);if(_0x5e34e5['result']===-0x1){return _0x5e34e5;}logger[_0x049a('0x2a')](util[_0x049a('0x27')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x3facf2,_0x5e34e5['extra']));return this['channel']['setVariable'](_0x3facf2,_0x5e34e5['extra']);};AGIVertices['prototype'][_0x049a('0x60')]=function(_0x545fc8){return _0x545fc8&&_0x545fc8!=='0'&&_0x545fc8!=='-1'&&_0x545fc8!=='';};AGIVertices[_0x049a('0xe')][_0x049a('0x7b')]=function(_0x79bba0){this[_0x049a('0x31')]['sync'](this,_0x79bba0,'-');_0x79bba0[_0x049a('0x7c')]=_0x79bba0[_0x049a('0x7b')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x049a('0xe')][_0x049a('0x7d')]=function(_0x368458){logger[_0x049a('0x2a')](util['format'](_0x049a('0x7e'),_0x368458[_0x049a('0x34')]));return this[_0x049a('0x32')][_0x049a('0x7d')]([_0x368458[_0x049a('0x7f')],_0x368458[_0x049a('0x80')]]);};AGIVertices['prototype'][_0x049a('0x81')]=function(_0x1337af){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x82'),_0x1337af[_0x049a('0x34')]));if(this[_0x049a('0x60')](_0x1337af[_0x049a('0x83')])){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x84'),_0x1337af[_0x049a('0x83')]));var _0x4348eb=this[_0x049a('0x32')][_0x049a('0x85')](_0x1337af['timeout']);if(_0x4348eb[_0x049a('0x86')]===-0x1){return _0x4348eb;}}return this[_0x049a('0x32')]['answer']();};AGIVertices[_0x049a('0xe')][_0x049a('0x46')]=function(_0x359d95){logger[_0x049a('0x2a')](util[_0x049a('0x27')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x359d95[_0x049a('0x34')]));if(!this[_0x049a('0x60')](_0x359d95[_0x049a('0x44')])){return this[_0x049a('0x32')][_0x049a('0x4b')](_0x359d95,_0x049a('0x87'));}_0x359d95[_0x049a('0x45')]=moment();if(this[_0x049a('0x60')](_0x359d95[_0x049a('0x88')])){_0x359d95[_0x049a('0x45')]=moment()[_0x049a('0x89')](_0x359d95['delay'],'minutes');}if(!this[_0x049a('0x60')](_0x359d95[_0x049a('0x48')])){_0x359d95[_0x049a('0x48')]=0x2;}this[_0x049a('0x3e')]['sync'](this,_0x359d95);return this['channel'][_0x049a('0x8a')](util[_0x049a('0x27')](_0x049a('0x8b'),_0x359d95['phone'],_0x359d95['list_id'],_0x359d95[_0x049a('0x45')]));};AGIVertices[_0x049a('0xe')][_0x049a('0x8c')]=function(_0x3438a4){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x8d'),_0x3438a4[_0x049a('0x34')]));var _0x95297c=this['channel'][_0x049a('0x53')](_0x3438a4[_0x049a('0x8e')],_0x3438a4[_0x049a('0x8f')]);if(_0x95297c[_0x049a('0x86')]===-0x1){return _0x95297c;}return this[_0x049a('0x32')][_0x049a('0x8a')](util[_0x049a('0x27')](_0x049a('0x90'),_0x3438a4[_0x049a('0x8e')],_0x3438a4[_0x049a('0x8f')]));};AGIVertices[_0x049a('0xe')]['lumenvoxtts']=function(_0x5db923){logger['info'](util['format']('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x5db923[_0x049a('0x34')]));if(!this[_0x049a('0x60')](_0x5db923[_0x049a('0x58')])){return this[_0x049a('0x32')]['noop'](_0x049a('0x91'));}var _0xde8b1f='\x22'+_0x5db923[_0x049a('0x58')]+'\x22';if(this[_0x049a('0x60')](_0x5db923[_0x049a('0x8f')])){_0xde8b1f+=','+_0x5db923['options'];}var _0xa8e62b=this[_0x049a('0x32')]['exec'](_0x049a('0x92'),_0xde8b1f);if(_0xa8e62b['result']===-0x1){return _0xa8e62b;}return this[_0x049a('0x32')][_0x049a('0x8a')](util[_0x049a('0x27')](_0x049a('0x93'),_0xde8b1f));};AGIVertices[_0x049a('0xe')][_0x049a('0x94')]=function(_0x3b8afa){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x95'),_0x3b8afa[_0x049a('0x34')]));if(!this[_0x049a('0x60')](_0x3b8afa['text'])){return this['channel'][_0x049a('0x8a')]('no\x20text\x20configured');}var _0x31d8a1='\x22'+_0x3b8afa[_0x049a('0x58')]+'\x22';if(this[_0x049a('0x60')](_0x3b8afa['options'])){_0x31d8a1+=','+_0x3b8afa[_0x049a('0x8f')];}var _0x34d15b=this[_0x049a('0x32')][_0x049a('0x53')]('MRCPSynth',_0x31d8a1);if(_0x34d15b[_0x049a('0x86')]===-0x1){return _0x34d15b;}return this[_0x049a('0x32')][_0x049a('0x8a')](util[_0x049a('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x31d8a1));};AGIVertices['prototype'][_0x049a('0x96')]=function(_0x2ff4ab){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x97'),_0x2ff4ab[_0x049a('0x34')]));if(!this[_0x049a('0x60')](_0x2ff4ab[_0x049a('0x98')])){return this['channel'][_0x049a('0x8a')](_0x049a('0x99'));}var _0x11674f=_0x2ff4ab[_0x049a('0x98')];if(this[_0x049a('0x60')](_0x2ff4ab['options'])){_0x11674f+=','+_0x2ff4ab[_0x049a('0x8f')];}var _0x5834a1=this['channel']['exec'](_0x049a('0x9a'),_0x11674f);if(_0x5834a1[_0x049a('0x86')]===-0x1){return _0x5834a1;}var _0x1c96f5=this[_0x049a('0x9b')]('RECOG_CONFIDENCE()',_0x049a('0x9c'));if(_0x1c96f5[_0x049a('0x86')]===-0x1){return _0x1c96f5;}var _0x540efb=this[_0x049a('0x9b')](_0x049a('0x9d'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x540efb[_0x049a('0x86')]===-0x1){return _0x540efb;}var _0x308856=this[_0x049a('0x9b')](_0x049a('0x9e'),_0x049a('0x9f'));if(_0x308856[_0x049a('0x86')]===-0x1){return _0x308856;}return this[_0x049a('0x32')][_0x049a('0x8a')](util[_0x049a('0x27')](_0x049a('0xa0'),_0x11674f));};AGIVertices['prototype'][_0x049a('0xa1')]=function(_0x73aea9){logger[_0x049a('0x2a')](util[_0x049a('0x27')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x73aea9[_0x049a('0x34')]));if(!this[_0x049a('0x60')](_0x73aea9[_0x049a('0x98')])){return this[_0x049a('0x32')][_0x049a('0x8a')]('no\x20grammar\x20configured');}var _0x47ae97=_0x73aea9[_0x049a('0x98')];if(this['isConfigured'](_0x73aea9[_0x049a('0x8f')])){_0x47ae97+=','+_0x73aea9[_0x049a('0x8f')];}var _0x206ebd=this[_0x049a('0x32')][_0x049a('0x53')](_0x049a('0x9a'),_0x47ae97);if(_0x206ebd[_0x049a('0x86')]===-0x1){return _0x206ebd;}var _0x2837d2=this[_0x049a('0x9b')](_0x049a('0xa2'),_0x049a('0xa3'));if(_0x2837d2['result']===-0x1){return _0x2837d2;}var _0xb3f770=this[_0x049a('0x9b')](_0x049a('0x9d'),'SESTEK_ASR_TRANSCRIPT');if(_0xb3f770['result']===-0x1){return _0xb3f770;}var _0x330d20=this[_0x049a('0x9b')](_0x049a('0x9e'),'SESTEK_ASR_INSTANCE');if(_0x330d20[_0x049a('0x86')]===-0x1){return _0x330d20;}return this[_0x049a('0x32')]['noop'](util[_0x049a('0x27')](_0x049a('0xa0'),_0x47ae97));};AGIVertices[_0x049a('0xe')][_0x049a('0xa4')]=function(_0x1bd95c){logger[_0x049a('0x2a')](util[_0x049a('0x27')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x1bd95c[_0x049a('0x34')]));if(!this[_0x049a('0x60')](_0x1bd95c['odbc_id'])){return this[_0x049a('0x32')][_0x049a('0x4b')](_0x1bd95c,_0x049a('0xa5'));}var _0xd980d7=this[_0x049a('0xa6')][_0x049a('0xa7')](this,_0x1bd95c[_0x049a('0xa8')]);if(!_0xd980d7){return this[_0x049a('0x32')][_0x049a('0x4b')](_0x1bd95c,_0x049a('0xa9'));}if(!this[_0x049a('0x60')](_0x1bd95c['query'])){return this[_0x049a('0x32')]['error'](_0x1bd95c,_0x049a('0xaa'));}var _0x146a95=_0x1bd95c[_0x049a('0x2b')][_0x049a('0x55')](/(\r\n|\n|\r)/gm,'\x20');this[_0x049a('0x32')][_0x049a('0x8a')](util[_0x049a('0x27')](_0x049a('0xab'),_0x146a95));var _0x3af4e6=this[_0x049a('0x29')][_0x049a('0xa7')](this,_0xd980d7,_0x146a95);this[_0x049a('0x31')][_0x049a('0xa7')](this,_0x1bd95c,_0x146a95);if(!this[_0x049a('0x60')](_0x1bd95c[_0x049a('0xac')])){return this[_0x049a('0x32')]['noop'](_0x049a('0xad'));}var _0x147dc5=this[_0x049a('0x79')][_0x049a('0xa7')](this,_0x1bd95c['variable_id']);if(!_0x147dc5){return this['channel'][_0x049a('0x4b')](_0x1bd95c,'no\x20variable\x20found');}var _0x2b1948=this;_0x3af4e6[_0x049a('0xae')](function(_0x3b200a,_0x462049){Object[_0x049a('0xaf')](_0x3b200a)[_0x049a('0xae')](function(_0x1c1908){_0x2b1948[_0x049a('0x32')][_0x049a('0xb0')](util[_0x049a('0x27')]('%s[%s][%s]',_0x147dc5,_0x462049,_0x1c1908),_0x3b200a[_0x1c1908]);});});this[_0x049a('0x32')][_0x049a('0xb0')](util[_0x049a('0x27')](_0x049a('0xb1'),_0x147dc5),_0x3af4e6['length']);return this['channel'][_0x049a('0x8a')](util[_0x049a('0x27')](_0x049a('0xb2'),_0x147dc5));};AGIVertices[_0x049a('0xe')][_0x049a('0xb3')]=function(_0x395560){logger[_0x049a('0xb4')](util[_0x049a('0x27')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x395560[_0x049a('0x34')]));if(!this[_0x049a('0x60')](_0x395560[_0x049a('0xb5')])){return this[_0x049a('0x32')][_0x049a('0x4b')](_0x395560,_0x049a('0xb6'));}var _0x371162=this[_0x049a('0x18')]['sync'](this,_0x395560[_0x049a('0xb5')]);if(!_0x371162){return this['channel']['error'](_0x395560,_0x049a('0xb7'));}var _0x1ab696=this[_0x049a('0x32')][_0x049a('0x53')](_0x049a('0xb8'),[util['format'](_0x049a('0xb9'),_0x371162),_0x395560[_0x049a('0x83')],_0x395560[_0x049a('0xba')],_0x395560[_0x049a('0xbb')]]);if(_0x1ab696[_0x049a('0x86')]===-0x1){return _0x1ab696;}return this[_0x049a('0x32')][_0x049a('0x8a')](util[_0x049a('0x27')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x049a('0xe')][_0x049a('0xbc')]=function(_0x3eaeaa){logger['info'](util[_0x049a('0x27')](_0x049a('0xbd'),_0x3eaeaa[_0x049a('0x34')]));if(!this[_0x049a('0x60')](_0x3eaeaa[_0x049a('0x5b')])){return this[_0x049a('0x32')][_0x049a('0x8a')]('no\x20key\x20configured');}if(!this[_0x049a('0x60')](_0x3eaeaa[_0x049a('0x58')])){return this[_0x049a('0x32')][_0x049a('0x8a')](_0x049a('0x91'));}this[_0x049a('0x32')]['bot']=!![];this[_0x049a('0x31')](_0x3eaeaa);this[_0x049a('0x3d')](_0x3eaeaa[_0x049a('0x58')],'in');this[_0x049a('0x32')][_0x049a('0x8a')](util[_0x049a('0x27')](_0x049a('0xbe'),_0x3eaeaa['text']));var _0x3b1eec=this['googleDialogflow'][_0x049a('0xa7')](this,_0x3eaeaa);if(_0x3b1eec){for(var _0x422295 in _0x3b1eec){if(_0x3b1eec[_0x049a('0x74')](_0x422295)){this[_0x049a('0x32')][_0x049a('0xb0')](util[_0x049a('0x27')](_0x049a('0xbf'),_0x422295[_0x049a('0xc0')]()),_0x3b1eec[_0x422295]);}}this['createSquareMessage'](_0x3b1eec[_0x049a('0xc1')],_0x049a('0xc2'));return this[_0x049a('0x32')][_0x049a('0x8a')](util[_0x049a('0x27')](_0x049a('0xc3'),_0x3b1eec[_0x049a('0xc1')]));}return this[_0x049a('0x32')][_0x049a('0x4b')](_0x3eaeaa,_0x049a('0xc4'));};AGIVertices[_0x049a('0xe')]['sesteknda']=function(_0x5b5d81){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0xc5'),_0x5b5d81[_0x049a('0x34')]));if(!this[_0x049a('0x60')](_0x5b5d81[_0x049a('0xc6')])){return this['channel'][_0x049a('0x8a')]('no\x20ndauth\x20url\x20configured');}if(!this['isConfigured'](_0x5b5d81['username'])){return this[_0x049a('0x32')][_0x049a('0x8a')]('no\x20username\x20configured');}if(!this[_0x049a('0x60')](_0x5b5d81[_0x049a('0xc7')])){return this[_0x049a('0x32')][_0x049a('0x8a')](_0x049a('0xc8'));}if(!this[_0x049a('0x60')](_0x5b5d81[_0x049a('0xc9')])){return this[_0x049a('0x32')]['noop'](_0x049a('0x91'));}this['channel']['bot']=!![];this[_0x049a('0x31')](_0x5b5d81);this[_0x049a('0x3d')](_0x5b5d81['text'],'in');this[_0x049a('0x32')][_0x049a('0x8a')](util['format']('Trying\x20SestekNDA:\x20%s',_0x5b5d81[_0x049a('0x58')]));var _0x5e21c6=this['sestekNDA'][_0x049a('0xa7')](this,_0x5b5d81);if(_0x5e21c6){for(var _0x56954b in _0x5e21c6){if(_0x5e21c6[_0x049a('0x74')](_0x56954b)){this['channel'][_0x049a('0xb0')](util['format'](_0x049a('0xca'),_0x56954b[_0x049a('0xc0')]()),_0x5e21c6[_0x56954b]);}}this[_0x049a('0x3d')](_0x5e21c6[_0x049a('0xc1')],_0x049a('0xc2'));if(_0x5e21c6[_0x049a('0xcb')]){this[_0x049a('0x32')]['noop'](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x5e21c6['audiofile']));var _0x523143=this[_0x049a('0x32')]['streamFile'](_0x5e21c6[_0x049a('0xcb')]);try{fs['unlink'](_0x5e21c6[_0x049a('0xcb')]+'.wav');}catch(_0xb0afcb){logger['error'](_0xb0afcb);}return _0x523143;}else{return this['channel'][_0x049a('0x8a')](util['format'](_0x049a('0xcc'),_0x5e21c6['speech']));}}return this[_0x049a('0x32')][_0x049a('0x4b')](_0x5b5d81,_0x049a('0xcd'));};AGIVertices[_0x049a('0xe')][_0x049a('0xce')]=function(_0x5d9080){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0xcf'),_0x5d9080[_0x049a('0x34')]));return this[_0x049a('0x32')][_0x049a('0x8a')](_0x049a('0xce'));};AGIVertices[_0x049a('0xe')][_0x049a('0xd0')]=function(_0x799c48){logger[_0x049a('0x2a')](util[_0x049a('0x27')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x799c48[_0x049a('0x34')]));var _0x46ca4a='';if(_0x799c48['trunk_id']){if(!this[_0x049a('0x60')](_0x799c48[_0x049a('0xd1')])){return this[_0x049a('0x32')]['error'](_0x799c48,_0x049a('0xd2'));}else{var _0x2e75a6=parseInt(_0x799c48[_0x049a('0xd1')],0xa);if(isNaN(_0x2e75a6)){_0x46ca4a=_0x799c48[_0x049a('0xd1')];}else{_0x46ca4a=this[_0x049a('0xd3')][_0x049a('0xa7')](this,_0x799c48[_0x049a('0xd1')]);if(!_0x46ca4a){return this[_0x049a('0x32')][_0x049a('0x4b')](_0x799c48,_0x049a('0xd4'));}}}}else if(_0x799c48['trunk_name']){_0x46ca4a=_0x799c48[_0x049a('0xd5')];}else{return this[_0x049a('0x32')][_0x049a('0x4b')](_0x799c48,_0x049a('0xd2'));}var _0x29b7bf=this[_0x049a('0x32')][_0x049a('0x53')]('DIAL',[util[_0x049a('0x27')](_0x049a('0xd6'),_0x46ca4a,_0x799c48['phone']),_0x799c48['timeout'],_0x799c48[_0x049a('0xba')],_0x799c48[_0x049a('0xbb')]]);if(_0x29b7bf[_0x049a('0x86')]===-0x1){return _0x29b7bf;}return this[_0x049a('0x32')][_0x049a('0x8a')](util[_0x049a('0x27')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x049a('0xe')][_0x049a('0xd7')]=function(_0x335b3d){logger[_0x049a('0x2a')](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x335b3d[_0x049a('0x34')]));return this[_0x049a('0x32')]['noop'](_0x049a('0xd7'));};AGIVertices[_0x049a('0xe')]['getdigits']=function(_0x314de0){logger[_0x049a('0x2a')](util[_0x049a('0x27')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x314de0[_0x049a('0x34')]));if(_0x314de0[_0x049a('0x7c')]===0x0){return this[_0x049a('0x7b')](_0x314de0);}_0x314de0[_0x049a('0x7c')]-=0x1;if(!this[_0x049a('0x60')](_0x314de0[_0x049a('0xd8')])){return this[_0x049a('0x32')]['error'](_0x314de0,_0x049a('0xd9'));}var _0x4c32d4=this[_0x049a('0x1b')]['sync'](this,_0x314de0['file_id']);if(!_0x4c32d4){return this['channel'][_0x049a('0x4b')](_0x314de0,_0x049a('0xda'));}if(!this[_0x049a('0x60')](_0x314de0[_0x049a('0xac')])){return this[_0x049a('0x32')][_0x049a('0x4b')](_0x049a('0xad'));}var _0x418c37=this[_0x049a('0x32')][_0x049a('0xdb')](_0x4c32d4,_0x314de0['response'],_0x314de0['maxdigit']);var _0xf2b13=_0x418c37[_0x049a('0x86')]?_0x418c37[_0x049a('0x86')]['toString']():'';logger[_0x049a('0x2a')](_0x049a('0xdc'),JSON[_0x049a('0xdd')](_0x418c37));if(_0x418c37[_0x049a('0x86')]===-0x1){this['createSquareDetailsReport'][_0x049a('0xa7')](this,_0x314de0,_0xf2b13);return _0x418c37;}else if(_0x418c37[_0x049a('0x7a')]===_0x049a('0x83')){_0x418c37['result']=_0xf2b13['length']>=parseInt(_0x314de0[_0x049a('0xde')])?'x':'i';}else{_0x418c37[_0x049a('0x86')]=_0xf2b13[_0x049a('0x78')]>=parseInt(_0x314de0[_0x049a('0xde')])&&_0xf2b13[_0x049a('0x78')]<=parseInt(_0x314de0['maxdigit'])?'x':'i';}var _0x107fba=this['getVariable'][_0x049a('0xa7')](this,_0x314de0[_0x049a('0xac')]);if(!_0x107fba){return this[_0x049a('0x32')][_0x049a('0x4b')](_0x314de0,'no\x20variable\x20found');}this['channel']['setVariable'](_0x107fba,_0xf2b13);if(this['isConfigured'](_0x314de0[_0x049a('0xdf')])){var _0x475ce5=parseInt(_0x314de0['hiddendigitsnum'],0xa);var _0x3127a7=rs[_0x049a('0xe0')]({'charset':'*','length':_0x475ce5});var _0x10a473=_0xf2b13[_0x049a('0x78')];if(_0x10a473>0x0){if(_0x10a473>_0x475ce5){this[_0x049a('0x31')][_0x049a('0xa7')](this,_0x314de0,_0x314de0[_0x049a('0xe1')]===_0x049a('0xe2')?_0x3127a7+_0xf2b13[_0x049a('0xe3')](_0x475ce5):_0xf2b13[_0x049a('0xe3')](0x0,_0x10a473-_0x475ce5)+_0x3127a7);}else{this[_0x049a('0x31')][_0x049a('0xa7')](this,_0x314de0,rs['generate']({'charset':'*','length':_0x10a473}));}}else{this[_0x049a('0x31')]['sync'](this,_0x314de0,'');}}else{this[_0x049a('0x31')][_0x049a('0xa7')](this,_0x314de0,_0xf2b13);}return _0x418c37;};AGIVertices[_0x049a('0xe')][_0x049a('0xb')]=function(_0x123784){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0xe4'),_0x123784[_0x049a('0x34')]));return this[_0x049a('0xa')](_0x123784);};AGIVertices['prototype'][_0x049a('0xe5')]=function(_0x13c4c0){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0xe6'),_0x13c4c0['label']));this['createSquareDetailsReport'][_0x049a('0xa7')](this,_0x13c4c0,_0x13c4c0[_0x049a('0xe7')]);return this['channel'][_0x049a('0x8a')](util[_0x049a('0x27')](_0x049a('0xe8'),_0x13c4c0[_0x049a('0xe7')]));};AGIVertices[_0x049a('0xe')]['awspolly']=function(_0x2cdc78){logger[_0x049a('0x2a')](util[_0x049a('0x27')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x2cdc78[_0x049a('0x34')]));if(!this['isConfigured'](_0x2cdc78[_0x049a('0x63')])||!this[_0x049a('0x60')](_0x2cdc78[_0x049a('0x64')])){return this[_0x049a('0x32')]['noop'](_0x049a('0xe9'));}if(!this[_0x049a('0x60')](_0x2cdc78[_0x049a('0x58')])){return this[_0x049a('0x32')]['noop']('no\x20text\x20configured');}this['channel'][_0x049a('0x8a')](util['format'](_0x049a('0xea'),_0x2cdc78[_0x049a('0x58')]));var _0x18db6b=this[_0x049a('0x62')][_0x049a('0xa7')](this,_0x2cdc78);if(_0x18db6b){this[_0x049a('0x32')][_0x049a('0x8a')](util[_0x049a('0x27')](_0x049a('0xeb'),_0x18db6b));var _0x479755=this['channel'][_0x049a('0xec')](_0x18db6b);try{fs[_0x049a('0xed')](_0x18db6b+_0x049a('0xee'));}catch(_0x393ff0){logger[_0x049a('0x4b')](_0x393ff0);}return _0x479755;}return this['channel'][_0x049a('0x4b')](_0x2cdc78,_0x049a('0xef'));};AGIVertices[_0x049a('0xe')][_0x049a('0xf0')]=function(_0xd633e6){logger[_0x049a('0x2a')](util[_0x049a('0x27')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0xd633e6[_0x049a('0x34')]));if(!this[_0x049a('0x60')](_0xd633e6[_0x049a('0x63')])||!this[_0x049a('0x60')](_0xd633e6[_0x049a('0x64')])){return this[_0x049a('0x32')]['noop'](_0x049a('0xe9'));}if(!this[_0x049a('0x60')](_0xd633e6['aws_bot_name'])){return this[_0x049a('0x32')][_0x049a('0x8a')]('no\x20bot\x20name\x20configured');}if(!this[_0x049a('0x60')](_0xd633e6[_0x049a('0x58')])){return this[_0x049a('0x32')][_0x049a('0x8a')](_0x049a('0x91'));}this[_0x049a('0x32')]['bot']=!![];this['createSquareDetailsReport'](_0xd633e6);this[_0x049a('0x3d')](_0xd633e6[_0x049a('0x58')],'in');this[_0x049a('0x32')][_0x049a('0x8a')](util[_0x049a('0x27')](_0x049a('0xf1'),_0xd633e6[_0x049a('0x58')]));var _0x28031d=this[_0x049a('0x69')][_0x049a('0xa7')](this,_0xd633e6);if(_0x28031d){for(var _0x3d0a4d in _0x28031d){if(_0x28031d[_0x049a('0x74')](_0x3d0a4d)&&_[_0x049a('0x75')](_0x28031d[_0x3d0a4d])){this[_0x049a('0x32')][_0x049a('0xb0')](util['format'](_0x049a('0xf2'),_0x3d0a4d[_0x049a('0xc0')]()),_0x28031d[_0x3d0a4d]);}}if(_[_0x049a('0x40')](_0x28031d[_0x049a('0xf3')])){return this[_0x049a('0x32')]['noop'](_0x049a('0xf4'));}else{this['createSquareMessage'](_0x28031d['message'],_0x049a('0xc2'));return this['channel']['noop'](util['format'](_0x049a('0xf5'),_0x28031d[_0x049a('0xf3')]));}}return this[_0x049a('0x32')][_0x049a('0x4b')](_0xd633e6,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x049a('0xe')]['googleasr']=function(_0x92ad42){logger['info'](util[_0x049a('0x27')](_0x049a('0xf6'),_0x92ad42['label'],_0x92ad42[_0x049a('0x83')]));if(!this[_0x049a('0x60')](_0x92ad42[_0x049a('0x5b')])){return this[_0x049a('0x32')]['noop']('no\x20key\x20configured');}var _0x2acbe7=_0x049a('0xf7');var _0x595a9c=util[_0x049a('0x27')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x4a7cbd=util[_0x049a('0x27')](_0x049a('0xf8'),_0x595a9c,_0x2acbe7);var _0x565747=!![];if(_0x92ad42[_0x049a('0xf9')]==='NOBEEP'){_0x565747=![];}var _0x286211=this[_0x049a('0x32')][_0x049a('0xfa')](_0x595a9c,_0x2acbe7,_0x92ad42[_0x049a('0xfb')],_0x92ad42[_0x049a('0x83')],undefined,_0x565747);if(_0x286211['result']!==-0x1){this[_0x049a('0x32')][_0x049a('0x8a')](util[_0x049a('0x27')]('google\x20%s\x20file\x20created',_0x4a7cbd));var _0x305478=this['googleASR'][_0x049a('0xa7')](this,_0x92ad42,_0x4a7cbd);if(_0x305478){for(var _0x5484a5 in _0x305478){if(_0x305478[_0x049a('0x74')](_0x5484a5)){this[_0x049a('0x32')][_0x049a('0xb0')](util['format'](_0x049a('0xfc'),_0x5484a5[_0x049a('0xc0')]()),_0x305478[_0x5484a5]);}}return this['channel']['noop'](util[_0x049a('0x27')](_0x049a('0xfd'),JSON['stringify'](_0x305478)));}}return _0x286211;};AGIVertices[_0x049a('0xe')][_0x049a('0xfe')]=function(_0x13d6d8){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0xff'),_0x13d6d8['label']));if(!this[_0x049a('0x60')](_0x13d6d8[_0x049a('0x6e')])){return this['channel']['noop'](_0x049a('0x100'));}if(!this['isConfigured'](_0x13d6d8[_0x049a('0x6f')])){return this[_0x049a('0x32')][_0x049a('0x8a')](_0x049a('0x101'));}var _0x1d59b1='wav';var _0x57e0c4=util[_0x049a('0x27')]('%s/recordings/%s',FILES_PATH,rs[_0x049a('0xe0')](0x4));var _0x10c4b0=util[_0x049a('0x27')]('%s.%s',_0x57e0c4,_0x1d59b1);var _0x5a728a=!![];if(_0x13d6d8[_0x049a('0xf9')]===_0x049a('0x102')){_0x5a728a=![];}var _0x5b99d8=this[_0x049a('0x32')]['recordFile'](_0x57e0c4,_0x1d59b1,_0x13d6d8[_0x049a('0xfb')],_0x13d6d8['timeout'],undefined,_0x5a728a);if(_0x5b99d8[_0x049a('0x86')]!==-0x1){this[_0x049a('0x32')][_0x049a('0x8a')](util[_0x049a('0x27')](_0x049a('0x103'),_0x10c4b0));var _0x538d18=this[_0x049a('0x6d')][_0x049a('0xa7')](this,_0x13d6d8,_0x10c4b0);if(_0x538d18){for(var _0x4bf6cc in _0x538d18){if(_0x538d18[_0x049a('0x74')](_0x4bf6cc)){this[_0x049a('0x32')]['setVariable'](util[_0x049a('0x27')](_0x049a('0x104'),_0x4bf6cc[_0x049a('0xc0')]()),_0x538d18[_0x4bf6cc]);}}return this['channel'][_0x049a('0x8a')](util['format'](_0x049a('0x105'),JSON[_0x049a('0xdd')](_0x538d18)));}}return _0x5b99d8;};AGIVertices[_0x049a('0xe')][_0x049a('0x106')]=function(_0x12e002){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x107'),_0x12e002[_0x049a('0x34')]));return this['channel'][_0x049a('0x108')](_0x12e002['context'],_0x12e002[_0x049a('0x109')],_0x12e002[_0x049a('0x10a')]);};AGIVertices[_0x049a('0xe')][_0x049a('0x10b')]=function(_0x3f91b9){logger[_0x049a('0x2a')](util[_0x049a('0x27')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x3f91b9[_0x049a('0x34')]));if(!this['isConfigured'](_0x3f91b9[_0x049a('0x10c')])){return this['channel'][_0x049a('0x4b')](_0x3f91b9,_0x049a('0x10d'));}try{var _0x41654d=eval(_0x3f91b9[_0x049a('0x10c')])?_0x049a('0x10e'):_0x049a('0x10f');this[_0x049a('0x32')][_0x049a('0x8a')](util[_0x049a('0x27')](_0x049a('0x110'),_0x3f91b9[_0x049a('0x10c')],_0x41654d));return{'code':0xc8,'result':_0x41654d};}catch(_0x436b48){return{'code':0xc8,'result':_0x049a('0x10f')};}};AGIVertices['prototype']['gotoiftime']=function(_0x33dbc9){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x111'),_0x33dbc9[_0x049a('0x34')]));if(!this[_0x049a('0x60')](_0x33dbc9['interval_id'])){return this[_0x049a('0x32')][_0x049a('0x4b')](_0x33dbc9,_0x049a('0x112'));}var _0x4b4032=this[_0x049a('0x21')][_0x049a('0xa7')](this,_0x33dbc9[_0x049a('0x113')]);if(!_0x4b4032){return this[_0x049a('0x32')][_0x049a('0x4b')](_0x33dbc9,_0x049a('0x114'));}for(var _0x1d3e81=0x0;_0x1d3e81<_0x4b4032[_0x049a('0x78')];_0x1d3e81+=0x1){var _0x28737c=this[_0x049a('0x32')][_0x049a('0x79')](util[_0x049a('0x27')]('IFTIME(%s?true:false)',_0x4b4032[_0x1d3e81]));if(_0x28737c[_0x049a('0x86')]===-0x1){return _0x28737c;}logger[_0x049a('0x2a')](util['format'](_0x049a('0x115'),_0x4b4032[_0x1d3e81],_0x28737c[_0x049a('0x7a')]));if(_0x28737c[_0x049a('0x7a')]===_0x049a('0x10e')){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x115'),_0x4b4032[_0x1d3e81],'true'));this['channel'][_0x049a('0x8a')](util['format']('IFTIME\x20%s\x20%s',_0x4b4032[_0x1d3e81],_0x049a('0x10e')));return{'code':0xc8,'result':'true'};}else{logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x115'),_0x4b4032[_0x1d3e81],_0x049a('0x10f')));this[_0x049a('0x32')]['noop'](util['format'](_0x049a('0x115'),_0x4b4032[_0x1d3e81],_0x049a('0x10f')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x049a('0xe')]['hangup']=function(_0x5bd5e9){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x116'),_0x5bd5e9[_0x049a('0x34')]));return this[_0x049a('0x32')][_0x049a('0x117')]();};AGIVertices[_0x049a('0xe')][_0x049a('0x118')]=function(_0x5655c6){logger['info'](util['format'](_0x049a('0x119'),_0x5655c6['label']));if(!this['isConfigured'](_0x5655c6[_0x049a('0x5b')])){return this['channel']['noop'](_0x049a('0x11a'));}var _0x3cf5cd=_0x049a('0xf7');var _0x4b67d7=util[_0x049a('0x27')](_0x049a('0x11b'),FILES_PATH,rs[_0x049a('0xe0')](0x4));var _0x276dcf=util[_0x049a('0x27')](_0x049a('0xf8'),_0x4b67d7,_0x3cf5cd);var _0x4e4ae2=!![];if(_0x5655c6[_0x049a('0xf9')]===_0x049a('0x102')){_0x4e4ae2=![];}var _0x33eaed=this[_0x049a('0x32')][_0x049a('0xfa')](_0x4b67d7,_0x3cf5cd,_0x5655c6[_0x049a('0xfb')],_0x5655c6[_0x049a('0x83')],undefined,_0x4e4ae2);if(_0x33eaed[_0x049a('0x86')]!==-0x1){this['channel']['noop'](util['format']('ispeech\x20%s\x20file\x20created',_0x276dcf));var _0x1fb465=this[_0x049a('0x5d')]['sync'](this,_0x5655c6,_0x276dcf);if(_0x1fb465){for(var _0x2dac4f in _0x1fb465){if(_0x1fb465[_0x049a('0x74')](_0x2dac4f)){this[_0x049a('0x32')][_0x049a('0xb0')](util[_0x049a('0x27')]('ISPEECH_ASR_%s',_0x2dac4f[_0x049a('0xc0')]()),_0x1fb465[_0x2dac4f]);}}return this[_0x049a('0x32')][_0x049a('0x8a')](util['format']('IspeechASR\x20Result\x20%s',JSON[_0x049a('0xdd')](_0x1fb465)));}}return _0x33eaed;};AGIVertices[_0x049a('0xe')][_0x049a('0x11c')]=function(_0x5f3316){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x11d'),_0x5f3316[_0x049a('0x34')]));if(!this[_0x049a('0x60')](_0x5f3316[_0x049a('0x5b')])){return this[_0x049a('0x32')][_0x049a('0x8a')](_0x049a('0x11a'));}if(!this['isConfigured'](_0x5f3316[_0x049a('0x58')])){return this[_0x049a('0x32')][_0x049a('0x8a')](_0x049a('0x91'));}this['channel']['noop'](util[_0x049a('0x27')](_0x049a('0x11e'),_0x5f3316[_0x049a('0x58')]));var _0x27bd66=this[_0x049a('0x5a')][_0x049a('0xa7')](this,_0x5f3316);if(_0x27bd66){this['channel'][_0x049a('0x8a')](util[_0x049a('0x27')](_0x049a('0x11f'),_0x27bd66));var _0x538543=this[_0x049a('0x32')][_0x049a('0xec')](_0x27bd66,_0x5f3316[_0x049a('0xfb')]);try{fs[_0x049a('0xed')](_0x27bd66+_0x049a('0xee'));}catch(_0x34e6e1){logger[_0x049a('0x4b')](_0x34e6e1);}return _0x538543;}return this['channel'][_0x049a('0x4b')](_0x5f3316,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['login']=function(_0x186099){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x120'),_0x186099[_0x049a('0x34')]));if(!this[_0x049a('0x60')](_0x186099[_0x049a('0x121')])){return this[_0x049a('0x32')][_0x049a('0x4b')](_0x186099,_0x049a('0x122'));}logger[_0x049a('0x2a')](util[_0x049a('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x049a('0x32')]['callerid'],_0x186099[_0x049a('0x121')]));var _0xaa39fc=this[_0x049a('0x4f')][_0x049a('0xa7')](this,_0x186099['findBy']);if(_0xaa39fc){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x123'),this[_0x049a('0x32')][_0x049a('0x36')],_0x186099[_0x049a('0x121')]));this[_0x049a('0x32')][_0x049a('0x8a')](util[_0x049a('0x27')](_0x049a('0x123'),this[_0x049a('0x32')]['callerid'],_0x186099[_0x049a('0x121')]));return{'code':0xc8,'result':_0x049a('0x124')};}else{logger[_0x049a('0x2a')](util['format'](_0x049a('0x125'),this['channel']['callerid'],_0x186099[_0x049a('0x121')]));this['channel'][_0x049a('0x8a')](util[_0x049a('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x049a('0x32')][_0x049a('0x36')],_0x186099[_0x049a('0x121')]));return{'code':0xc8,'result':_0x049a('0x126')};}};AGIVertices[_0x049a('0xe')][_0x049a('0x127')]=function(_0x3a808e){logger[_0x049a('0x2a')](util['format']('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x3a808e[_0x049a('0x34')]));if(!this[_0x049a('0x60')](_0x3a808e[_0x049a('0x121')])){return this['channel'][_0x049a('0x4b')](_0x3a808e,_0x049a('0x122'));}logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x128'),this[_0x049a('0x32')][_0x049a('0x36')],_0x3a808e[_0x049a('0x121')]));var _0x4f6e20=this[_0x049a('0x4e')][_0x049a('0xa7')](this,_0x3a808e[_0x049a('0x121')]);if(_0x4f6e20){logger['info'](util[_0x049a('0x27')](_0x049a('0x123'),this[_0x049a('0x32')][_0x049a('0x36')],_0x3a808e[_0x049a('0x121')]));this['channel'][_0x049a('0x8a')](util[_0x049a('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x049a('0x32')][_0x049a('0x36')],_0x3a808e['findBy']));return{'code':0xc8,'result':_0x049a('0x124')};}else{logger['info'](util[_0x049a('0x27')](_0x049a('0x125'),this[_0x049a('0x32')][_0x049a('0x36')],_0x3a808e[_0x049a('0x121')]));this[_0x049a('0x32')][_0x049a('0x8a')](util[_0x049a('0x27')](_0x049a('0x125'),this[_0x049a('0x32')][_0x049a('0x36')],_0x3a808e[_0x049a('0x121')]));return{'code':0xc8,'result':_0x049a('0x126')};}};AGIVertices[_0x049a('0xe')]['math']=function(_0x47ecb5){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x129'),_0x47ecb5[_0x049a('0x34')]));if(!this['isConfigured'](_0x47ecb5[_0x049a('0x12a')])){return this['channel'][_0x049a('0x4b')](_0x47ecb5,_0x049a('0x12b'));}this[_0x049a('0x32')][_0x049a('0x8a')](util[_0x049a('0x27')]('math\x20%s',_0x47ecb5[_0x049a('0x12a')]));var _0x58f9c1=eval(_0x47ecb5['operation']);if(!this[_0x049a('0x60')](_0x47ecb5[_0x049a('0xac')])){return this[_0x049a('0x32')][_0x049a('0x8a')](_0x049a('0xad'));}var _0x651edf=this['getVariable'][_0x049a('0xa7')](this,_0x47ecb5[_0x049a('0xac')]);if(!_0x651edf){return this['channel'][_0x049a('0x4b')](_0x47ecb5,_0x049a('0x12c'));}if(_[_0x049a('0x12d')](_0x58f9c1)){var _0x52c5cf=this;_0x58f9c1[_0x049a('0xae')](function(_0x229232,_0x371fb6){_0x52c5cf[_0x049a('0x32')][_0x049a('0xb0')](util[_0x049a('0x27')](_0x049a('0x12e'),_0x651edf,_0x371fb6),_0x229232);});return this[_0x049a('0x32')]['noop'](util[_0x049a('0x27')]('variable\x20%s[key]\x20set',_0x651edf));}else{return this[_0x049a('0x32')][_0x049a('0xb0')](_0x651edf,_0x58f9c1);}};AGIVertices[_0x049a('0xe')][_0x049a('0x9')]=function(_0x22ce06){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x12f'),_0x22ce06[_0x049a('0x34')]));if(_0x22ce06[_0x049a('0x7c')]===0x0){return this['maxRetry'](_0x22ce06);}_0x22ce06[_0x049a('0x7c')]-=0x1;if(!this['isConfigured'](_0x22ce06[_0x049a('0xd8')])){return this[_0x049a('0x32')][_0x049a('0x4b')](_0x22ce06,_0x049a('0xd9'));}var _0x484820=this[_0x049a('0x1b')][_0x049a('0xa7')](this,_0x22ce06[_0x049a('0xd8')]);if(!_0x484820){return this[_0x049a('0x32')][_0x049a('0x4b')](_0x22ce06,_0x049a('0xda'));}var _0x3da562=this[_0x049a('0x32')][_0x049a('0xdb')](_0x484820,_0x22ce06[_0x049a('0x130')],_0x22ce06[_0x049a('0x131')]);var _0x20ee1e=_0x3da562[_0x049a('0x86')];if(_0x3da562[_0x049a('0x86')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x22ce06,'-1');return _0x3da562;}else if(_0x3da562[_0x049a('0x7a')]===_0x049a('0x83')){_0x3da562[_0x049a('0x86')]=_0x3da562[_0x049a('0x86')][_0x049a('0x78')]>0x0?_0x3da562[_0x049a('0x86')]:'t';}else if(_[_0x049a('0x3f')](_0x3da562[_0x049a('0x86')])){_0x3da562[_0x049a('0x86')]='#';_0x20ee1e='#';}if(!this[_0x049a('0x60')](_0x22ce06['variable_id'])){this[_0x049a('0x32')][_0x049a('0x8a')](_0x049a('0xad'));}else{var _0x984a92=this['getVariable']['sync'](this,_0x22ce06[_0x049a('0xac')]);if(!_0x984a92){return this[_0x049a('0x32')]['error'](_0x22ce06,'no\x20variable\x20found');}this[_0x049a('0x32')][_0x049a('0xb0')](_0x984a92,_0x20ee1e);}this[_0x049a('0x31')][_0x049a('0xa7')](this,_0x22ce06,_0x20ee1e);return _0x3da562;};AGIVertices['prototype'][_0x049a('0x8a')]=function(_0x2ce46f){logger['info'](util[_0x049a('0x27')](_0x049a('0x132'),_0x2ce46f[_0x049a('0x34')]));return this['channel'][_0x049a('0x8a')](_0x2ce46f[_0x049a('0x133')]||_0x2ce46f[_0x049a('0x34')]);};AGIVertices['prototype']['pause']=function(_0x15f9f1){logger['info'](util['format'](_0x049a('0x134'),_0x15f9f1[_0x049a('0x34')]));if(!this['isConfigured'](_0x15f9f1[_0x049a('0x121')])){return this[_0x049a('0x32')]['error'](_0x15f9f1,_0x049a('0x122'));}logger[_0x049a('0x2a')](util['format'](_0x049a('0x128'),this[_0x049a('0x32')][_0x049a('0x36')],_0x15f9f1[_0x049a('0x121')]));var _0x4ecf06=this['getPause']['sync'](this,_0x15f9f1[_0x049a('0x135')]);var _0x204eb8=this['agentPause'][_0x049a('0xa7')](this,_0x15f9f1[_0x049a('0x121')],_0x4ecf06);if(_0x204eb8){logger[_0x049a('0x2a')](util[_0x049a('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x049a('0x36')],_0x15f9f1[_0x049a('0x121')]));this['channel'][_0x049a('0x8a')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x15f9f1[_0x049a('0x121')]));return{'code':0xc8,'result':_0x049a('0x124')};}else{logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x125'),this[_0x049a('0x32')][_0x049a('0x36')],_0x15f9f1[_0x049a('0x121')]));this[_0x049a('0x32')][_0x049a('0x8a')](util[_0x049a('0x27')](_0x049a('0x123'),this[_0x049a('0x32')][_0x049a('0x36')],_0x15f9f1[_0x049a('0x121')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x049a('0xe')]['playback']=function(_0x32a1cf){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x136'),_0x32a1cf[_0x049a('0x34')]));if(!this[_0x049a('0x60')](_0x32a1cf[_0x049a('0xd8')])){return this[_0x049a('0x32')]['error'](_0x32a1cf,'no\x20file\x20audio\x20selected');}var _0xbaab90=this[_0x049a('0x1b')][_0x049a('0xa7')](this,_0x32a1cf['file_id']);if(!_0xbaab90){return this[_0x049a('0x32')][_0x049a('0x4b')](_0x32a1cf,'no\x20file\x20audio\x20found');}var _0xfa20a9=this['channel'][_0x049a('0x53')](_0x049a('0x137'),[_0xbaab90,_0x32a1cf[_0x049a('0xba')]]);if(_0xfa20a9['result']===-0x1){return _0xfa20a9;}return this[_0x049a('0x32')][_0x049a('0x8a')](util['format']('Executed\x20command\x20%s\x20%s',_0x049a('0x137'),_0xbaab90));};AGIVertices[_0x049a('0xe')]['queue']=function(_0x232d8a){logger[_0x049a('0x2a')](util['format'](_0x049a('0x138'),_0x232d8a[_0x049a('0x34')]));if(!this['isConfigured'](_0x232d8a[_0x049a('0x139')])){return this[_0x049a('0x32')][_0x049a('0x4b')](_0x232d8a,'no\x20queue\x20selected');}var _0x39274a='';var _0x4e720e=parseInt(_0x232d8a[_0x049a('0x139')],0xa);if(isNaN(_0x4e720e)){_0x39274a=_0x232d8a[_0x049a('0x139')];}else{_0x39274a=this['getVoiceQueue'][_0x049a('0xa7')](this,_0x232d8a['queue_id']);if(!_0x39274a){return this[_0x049a('0x32')][_0x049a('0x4b')](_0x232d8a,_0x049a('0x13a'));}}var _0x1b1a65='';if(this[_0x049a('0x60')](_0x232d8a['file_id'])){var _0x23e358=this[_0x049a('0x1b')]['sync'](this,_0x232d8a[_0x049a('0xd8')]);if(_0x23e358){_0x1b1a65=_0x23e358;}}this[_0x049a('0x31')][_0x049a('0xa7')](this,_0x232d8a,_0x39274a);if(_0x232d8a[_0x049a('0xba')][_0x049a('0x13b')]('x')<0x0){_0x232d8a['opts']+='x';}if(_0x232d8a[_0x049a('0xba')]['indexOf']('X')<0x0){_0x232d8a[_0x049a('0xba')]+='X';}this[_0x049a('0x32')][_0x049a('0xb0')](_0x049a('0x13c'),_0x39274a?_0x39274a[_0x049a('0x13d')]():'');var _0x1ac660=this[_0x049a('0x32')][_0x049a('0x53')](_0x049a('0x13e'),[_0x39274a,_0x232d8a[_0x049a('0xba')],_0x232d8a[_0x049a('0xbb')],_0x1b1a65,_0x232d8a[_0x049a('0x83')],_0x232d8a[_0x049a('0x7d')],_0x232d8a[_0x049a('0x13f')],_0x232d8a[_0x049a('0x140')],'',_0x232d8a[_0x049a('0x141')]]);if(_0x1ac660[_0x049a('0x86')]===-0x1){return _0x1ac660;}return this[_0x049a('0x32')][_0x049a('0x8a')](util['format'](_0x049a('0x90'),_0x049a('0x13e'),_0x39274a));};AGIVertices[_0x049a('0xe')][_0x049a('0x142')]=function(_0x40ce89){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x143'),_0x40ce89[_0x049a('0x34')]));var _0x1a00f4=_0x40ce89['recordingFormat']||_0x049a('0xf7');var _0x341776=util[_0x049a('0x27')](_0x049a('0x144'),this['channel'][_0x049a('0x33')],rs[_0x049a('0xe0')](0x5));var _0x261bdc=util['format'](_0x049a('0x145'),FILES_PATH,_0x341776,_0x1a00f4);var _0x3ddde4=util[_0x049a('0x27')](_0x049a('0x11b'),FILES_PATH,_0x341776);this['createSquareRecording']['sync'](this,_0x40ce89,_0x341776,_0x261bdc);this[_0x049a('0x32')][_0x049a('0xb0')](_0x049a('0x146'),_0x341776);logger[_0x049a('0x2a')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x3ddde4,_0x1a00f4,_0x40ce89['escape_digits'],_0x40ce89[_0x049a('0x83')]);return this[_0x049a('0x32')][_0x049a('0xfa')](_0x3ddde4,_0x1a00f4,_0x40ce89[_0x049a('0x147')],_0x40ce89[_0x049a('0x83')],undefined,!![]);};AGIVertices['prototype'][_0x049a('0x148')]=function(_0x66b09){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x149'),_0x66b09[_0x049a('0x34')]));return this[_0x049a('0x32')][_0x049a('0x14a')](_0x66b09[_0x049a('0x14b')][_0x049a('0x55')](/\s+/g,''),_0x66b09[_0x049a('0x147')]);};AGIVertices[_0x049a('0xe')]['saynumber']=function(_0x52168e){logger[_0x049a('0x2a')](util[_0x049a('0x27')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x52168e[_0x049a('0x34')]));return this[_0x049a('0x32')][_0x049a('0x14c')](_0x52168e['number'][_0x049a('0x55')](/\s+/g,''),_0x52168e['escape_digits']);};AGIVertices['prototype'][_0x049a('0x14d')]=function(_0x236ee2){logger[_0x049a('0x2a')](util[_0x049a('0x27')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x236ee2[_0x049a('0x34')]));return this[_0x049a('0x32')][_0x049a('0x14e')](_0x236ee2[_0x049a('0x58')],_0x236ee2['escape_digits']);};AGIVertices[_0x049a('0xe')][_0x049a('0x14f')]=function(_0x457dff){logger[_0x049a('0x2a')](util[_0x049a('0x27')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x457dff[_0x049a('0x34')]));if(!this['isConfigured'](_0x457dff['account_id'])){return this[_0x049a('0x32')][_0x049a('0x8a')](_0x049a('0x150'));}var _0x4d0acb=this['getMailAccount'][_0x049a('0xa7')](this,_0x457dff[_0x049a('0x151')]);if(!_0x4d0acb||!_0x4d0acb[_0x049a('0x152')]){return this[_0x049a('0x32')]['error'](_0x457dff,_0x049a('0x153'));}var _0x1723f5={'from':util[_0x049a('0x27')](_0x049a('0x154'),_0x4d0acb[_0x049a('0x11')],_0x4d0acb['email']||_0x4d0acb[_0x049a('0x152')][_0x049a('0x155')]),'to':_0x457dff['to']||'','cc':_0x457dff['cc']||'','bcc':_0x457dff['bcc']||'','subject':_0x457dff[_0x049a('0x156')],'html':_0x457dff[_0x049a('0x58')],'text':_0x457dff[_0x049a('0x58')]};var _0x3c9166={'tls':{'rejectUnauthorized':![]}};if(_0x4d0acb['Smtp'][_0x049a('0x157')]){_0x3c9166['service']=_0x4d0acb[_0x049a('0x152')][_0x049a('0x157')];}else{_0x3c9166['host']=_0x4d0acb[_0x049a('0x152')]['host'];_0x3c9166[_0x049a('0x158')]=_0x4d0acb[_0x049a('0x152')][_0x049a('0x158')];_0x3c9166[_0x049a('0x159')]=_0x4d0acb[_0x049a('0x152')][_0x049a('0x159')];}if(_0x4d0acb[_0x049a('0x152')][_0x049a('0x15a')]){_0x3c9166[_0x049a('0x15b')]={'user':_0x4d0acb[_0x049a('0x152')]['user'],'pass':_0x4d0acb[_0x049a('0x152')][_0x049a('0x15c')]};}if(this['isConfigured'](_0x457dff['template_id'])){}logger['debug']('sendMail\x20message',JSON[_0x049a('0xdd')](_0x1723f5));this[_0x049a('0x31')][_0x049a('0xa7')](this,_0x457dff,_0x457dff[_0x049a('0x151')]);this[_0x049a('0x32')][_0x049a('0x8a')](util[_0x049a('0x27')](_0x049a('0x15d'),_0x4d0acb[_0x049a('0x11')]));this[_0x049a('0x20')]['sync'](this,_0x3c9166,_0x1723f5);return this[_0x049a('0x32')][_0x049a('0x8a')](_0x049a('0x15e'));};AGIVertices['prototype'][_0x049a('0x15f')]=function(_0xf06f39){logger['info'](util[_0x049a('0x27')](_0x049a('0x160'),_0xf06f39[_0x049a('0x34')]));return this[_0x049a('0x32')][_0x049a('0x8a')](_0x049a('0x161'));};AGIVertices[_0x049a('0xe')][_0x049a('0x162')]=function(_0xd64b10){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x163'),_0xd64b10['label']));if(!this[_0x049a('0x60')](_0xd64b10['sms_account_id'])){return this[_0x049a('0x32')][_0x049a('0x8a')](_0x049a('0x164'));}var _0x46448e=this[_0x049a('0x2f')][_0x049a('0xa7')](this,_0xd64b10[_0x049a('0x165')]);if(!_0x46448e){return this[_0x049a('0x32')]['error'](_0xd64b10,_0x049a('0x166'));}var _0x1e916c={'body':_0xd64b10[_0x049a('0x167')],'phone':_0xd64b10['to']||'','SmsAccountId':_0x46448e['id']};logger['debug'](_0x049a('0x168'),JSON[_0x049a('0xdd')](_0x1e916c));this['createSquareDetailsReport'][_0x049a('0xa7')](this,_0xd64b10,_0xd64b10[_0x049a('0x165')]);this['channel'][_0x049a('0x8a')](util[_0x049a('0x27')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x46448e[_0x049a('0x11')]));this[_0x049a('0x30')][_0x049a('0xa7')](this,_0x1e916c);return this[_0x049a('0x32')][_0x049a('0x8a')](_0x049a('0x169'));};AGIVertices[_0x049a('0xe')][_0x049a('0x16a')]=function(_0x510958){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x16b'),_0x510958[_0x049a('0x34')]));if(!this[_0x049a('0x60')](_0x510958[_0x049a('0xac')])){return this[_0x049a('0x32')][_0x049a('0x4b')](_0x510958,_0x049a('0x16c'));}var _0x37b2e6=this[_0x049a('0x79')][_0x049a('0xa7')](this,_0x510958['variable_id']);if(!_0x37b2e6){return this[_0x049a('0x32')][_0x049a('0x4b')](_0x510958,_0x049a('0x12c'));}return this['channel']['setVariable'](_0x37b2e6,_0x510958[_0x049a('0x16d')]);};AGIVertices['prototype'][_0x049a('0x16e')]=function(_0x2b6dc2){logger[_0x049a('0x2a')](util['format'](_0x049a('0x16f'),_0x2b6dc2[_0x049a('0x34')]));this[_0x049a('0x32')][_0x049a('0x8a')]('START\x20CALLY\x20SQUARE');if(_0x2b6dc2[_0x049a('0x81')]===_0x049a('0x170')){this['channel'][_0x049a('0x8a')](_0x049a('0x171'));return this['channel'][_0x049a('0x81')]();}return this[_0x049a('0x32')][_0x049a('0x8a')](_0x049a('0x172'));};AGIVertices['prototype'][_0x049a('0x173')]=function(_0x17eae8){logger[_0x049a('0x2a')](util[_0x049a('0x27')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x17eae8['label']));if(!this[_0x049a('0x60')](_0x17eae8[_0x049a('0x174')])){return this[_0x049a('0x32')][_0x049a('0x4b')](_0x17eae8,'no\x20subproject\x20selected');}var _0x408d19=this[_0x049a('0x15')][_0x049a('0xa7')](this,_0x17eae8['project_id']);if(!this[_0x049a('0x60')](_0x408d19)){return this[_0x049a('0x32')][_0x049a('0x4b')](_0x17eae8,util['format'](_0x049a('0x175'),_0x17eae8[_0x049a('0x174')]));}if(_0x408d19===this[_0x049a('0x32')][_0x049a('0x3c')]){return this[_0x049a('0x32')]['error'](_0x17eae8,_0x049a('0x176'));}this[_0x049a('0x31')][_0x049a('0xa7')](this,_0x17eae8,_0x408d19);var _0x2ccbb5=this[_0x049a('0x32')][_0x049a('0x53')](_0x049a('0x177'),util[_0x049a('0x27')](_0x049a('0x178'),config['agi'][_0x049a('0x179')]||'127.0.0.1',_0x408d19,this[_0x049a('0x32')][_0x049a('0x3c')]));if(_0x2ccbb5[_0x049a('0x86')]===-0x1){return _0x2ccbb5;}return this[_0x049a('0x32')]['noop'](util['format'](_0x049a('0x90'),_0x049a('0x177'),_0x408d19));};AGIVertices[_0x049a('0xe')][_0x049a('0x17a')]=function(_0x39a7cf){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x17b'),_0x39a7cf[_0x049a('0x34')]));var _0x3a4baa=this[_0x049a('0x52')][_0x049a('0xa7')](this,_0x39a7cf[_0x049a('0x7f')]);this['createSquareDetailsReport']['sync'](this,_0x39a7cf,_0x39a7cf['command']);if(this['isConfigured'](_0x39a7cf[_0x049a('0xac')])){var _0x580d16=this[_0x049a('0x79')][_0x049a('0xa7')](this,_0x39a7cf[_0x049a('0xac')]);if(_0x580d16){this[_0x049a('0x32')][_0x049a('0xb0')](_0x580d16,_0x3a4baa);return this[_0x049a('0x32')][_0x049a('0x8a')](util['format'](_0x049a('0x17c'),_0x39a7cf[_0x049a('0x7f')],_0x580d16));}}return this['channel'][_0x049a('0x8a')](util[_0x049a('0x27')](_0x049a('0x17d'),_0x39a7cf[_0x049a('0x7f')]));};AGIVertices[_0x049a('0xe')][_0x049a('0x17e')]=function(_0x1e3285){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x17f'),_0x1e3285['label']));if(!this[_0x049a('0x60')](_0x1e3285[_0x049a('0x58')])){return this['channel'][_0x049a('0x8a')](_0x049a('0x91'));}this[_0x049a('0x32')][_0x049a('0x8a')](util[_0x049a('0x27')]('Trying\x20Google\x20TTS\x20%s',_0x1e3285[_0x049a('0x58')]));var _0x23b8ac=this[_0x049a('0x56')]['sync'](this,_0x1e3285);if(_0x23b8ac){this['channel'][_0x049a('0x8a')](util[_0x049a('0x27')]('Google\x20TTS\x20%s\x20file\x20created',_0x23b8ac));var _0xcb1541=this[_0x049a('0x32')]['streamFile'](_0x23b8ac);try{fs[_0x049a('0xed')](_0x23b8ac+'.wav');}catch(_0x287fae){logger['error'](_0x287fae);}return _0xcb1541;}return this[_0x049a('0x32')][_0x049a('0x4b')](_0x1e3285,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x049a('0xe')][_0x049a('0x180')]=function(_0x42ab65){logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x181'),_0x42ab65[_0x049a('0x34')]));if(!this[_0x049a('0x60')](_0x42ab65[_0x049a('0x121')])){return this[_0x049a('0x32')][_0x049a('0x4b')](_0x42ab65,'no\x20find\x20by\x20configured');}logger['info'](util[_0x049a('0x27')](_0x049a('0x128'),this[_0x049a('0x32')][_0x049a('0x36')],_0x42ab65['findBy']));var _0xefc957=this[_0x049a('0x4c')]['sync'](this,_0x42ab65[_0x049a('0x121')]);if(_0xefc957){logger[_0x049a('0x2a')](util['format'](_0x049a('0x123'),this[_0x049a('0x32')]['callerid'],_0x42ab65[_0x049a('0x121')]));this[_0x049a('0x32')][_0x049a('0x8a')](util[_0x049a('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x049a('0x32')][_0x049a('0x36')],_0x42ab65[_0x049a('0x121')]));return{'code':0xc8,'result':_0x049a('0x124')};}else{logger[_0x049a('0x2a')](util[_0x049a('0x27')](_0x049a('0x125'),this[_0x049a('0x32')][_0x049a('0x36')],_0x42ab65[_0x049a('0x121')]));this[_0x049a('0x32')][_0x049a('0x8a')](util[_0x049a('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x049a('0x32')]['callerid'],_0x42ab65[_0x049a('0x121')]));return{'code':0xc8,'result':_0x049a('0x126')};}};AGIVertices[_0x049a('0xe')][_0x049a('0x182')]=function(_0x8b5424){logger['info'](util['format'](_0x049a('0x183'),_0x8b5424[_0x049a('0x34')]));var _0x46a8cd=this['channel'][_0x049a('0x53')](_0x049a('0x184'),[_0x8b5424[_0x049a('0x185')],_0x8b5424[_0x049a('0x8f')]]);if(_0x46a8cd['result']===-0x1){return _0x46a8cd;}return this[_0x049a('0x32')][_0x049a('0x8a')](util[_0x049a('0x27')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x8b5424[_0x049a('0x185')]));};AGIVertices[_0x049a('0xe')][_0x049a('0x186')]=function(_0x4bf4bf){logger[_0x049a('0x2a')](util[_0x049a('0x27')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x4bf4bf[_0x049a('0x34')]));if(!this['isConfigured'](_0x4bf4bf[_0x049a('0xac')])){return this[_0x049a('0x32')][_0x049a('0x4b')](_0x4bf4bf,_0x049a('0x16c'));}var _0x1137d3=this[_0x049a('0x79')]['sync'](this,_0x4bf4bf[_0x049a('0xac')]);if(!_0x1137d3){return this[_0x049a('0x32')][_0x049a('0x4b')](_0x4bf4bf,_0x049a('0x12c'));}var _0x59d1f5=this[_0x049a('0x32')][_0x049a('0x79')](_0x1137d3);return{'code':0xc8,'result':_0x59d1f5[_0x049a('0x7a')]?_0x59d1f5['extra']:'-'};};String[_0x049a('0xe')][_0x049a('0x187')]=function(_0xb8826c,_0x955c58){return this[_0x049a('0x77')](_0xb8826c)['join'](_0x955c58);};module[_0x049a('0x188')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index f79ca44..eb4a44f 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 _0x5fd1=['../../../config/logger','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangup','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[ACW][START]\x20%s','message','stopAcw','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','acw','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','attended','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../ami'];(function(_0x59d1da,_0x3696ba){var _0x3872c0=function(_0x42d555){while(--_0x42d555){_0x59d1da['push'](_0x59d1da['shift']());}};_0x3872c0(++_0x3696ba);}(_0x5fd1,0x155));var _0x15fd=function(_0x172dca,_0xda5041){_0x172dca=_0x172dca-0x0;var _0x2a887f=_0x5fd1[_0x172dca];return _0x2a887f;};'use strict';var util=require(_0x15fd('0x0'));var _=require('lodash');var moment=require(_0x15fd('0x1'));var ami=require(_0x15fd('0x2'));var logger=require(_0x15fd('0x3'))('acw');var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x15fd('0x4'));function Acw(_0x3138f3){this[_0x15fd('0x5')]=_0x3138f3['voiceQueues'];this[_0x15fd('0x6')]=_0x3138f3[_0x15fd('0x6')];this[_0x15fd('0x7')]=_0x3138f3[_0x15fd('0x7')];this[_0x15fd('0x8')]={};ami['on']('agentconnect',this[_0x15fd('0x9')][_0x15fd('0xa')](this));ami['on'](_0x15fd('0xb'),this['syncHangupRequest'][_0x15fd('0xa')](this));ami['on']('hangup',this[_0x15fd('0xc')][_0x15fd('0xa')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0x15fd('0xd'),this[_0x15fd('0xe')][_0x15fd('0xa')](this));ami['on'](_0x15fd('0xf'),this[_0x15fd('0x10')][_0x15fd('0xa')](this));ami['on'](_0x15fd('0x11'),this[_0x15fd('0x12')][_0x15fd('0xa')](this));}function getDiff(_0x4cb391){var _0x5b7af0=moment()['milliseconds'](0x0);var _0x3fda60=moment(_0x4cb391)[_0x15fd('0x13')](0x0);return _0x5b7af0[_0x15fd('0x14')](_0x3fda60,_0x15fd('0x15'));}Acw[_0x15fd('0x16')][_0x15fd('0x17')]=function(_0x2c5375){try{var _0x44a63a=this;var _0x5aae13=this['channels'][_0x2c5375][_0x15fd('0x18')];var _0x5ca5a2=this[_0x15fd('0x8')][_0x2c5375]['queue'];var _0x917fe4=this[_0x15fd('0x5')][_0x5ca5a2];var _0x855bae=![];var _0x49ceac=_0x15fd('0x19');if(_0x917fe4[_0x15fd('0x1a')]){if(_0x917fe4[_0x15fd('0x1b')][_0x15fd('0x1c')]){_0x855bae=!![];_0x49ceac=_0x917fe4[_0x15fd('0x1b')][_0x15fd('0x1c')];}}ami[_0x15fd('0x1d')]({'action':_0x15fd('0x1e'),'interface':_0x5aae13,'paused':!![],'reason':_0x49ceac})[_0x15fd('0x1f')](function(_0x1eab55){if(_0x44a63a[_0x15fd('0x6')][_0x5aae13]){return RpcUser['getAgent'](_0x44a63a['agents'][_0x5aae13]['id'])[_0x15fd('0x1f')](function(_0x36b21e){if(_0x36b21e&&!_0x36b21e[_0x15fd('0x20')]){logger[_0x15fd('0x21')](_0x15fd('0x22'),_0x2c5375,_0x5aae13,_0x5ca5a2);var _0x11496a=_0x44a63a[_0x15fd('0x8')][_0x2c5375]['attended']&&_0x44a63a[_0x15fd('0x8')][_0x2c5375][_0x15fd('0x23')]?_0x44a63a[_0x15fd('0x8')][_0x2c5375]['destlinkedid']:_0x2c5375;return RpcUser[_0x15fd('0x24')](_0x44a63a['agents'][_0x5aae13],_0x49ceac,_0x11496a)[_0x15fd('0x1f')](function(_0x1fc24f){if(!_0x855bae){_0x44a63a[_0x15fd('0x7')][_0x5aae13]={};logger['info'](_0x15fd('0x25'),_0x2c5375,_0x44a63a[_0x15fd('0x5')][_0x5ca5a2][_0x15fd('0x26')],_0x5aae13,_0x5ca5a2);_0x44a63a['timers'][_0x5aae13][_0x15fd('0x27')]=setTimeout(_0x44a63a['stopAcw'][_0x15fd('0xa')](_0x44a63a,_0x5aae13),_0x44a63a[_0x15fd('0x5')][_0x5ca5a2][_0x15fd('0x26')]*0x3e8);_0x44a63a[_0x15fd('0x7')][_0x5aae13][_0x15fd('0x28')]=moment()[_0x15fd('0x29')](_0x15fd('0x2a'));_0x44a63a[_0x15fd('0x7')][_0x5aae13][_0x15fd('0x2b')]=_0x2c5375;_0x44a63a[_0x15fd('0x7')][_0x5aae13][_0x15fd('0x2c')]=_0x5ca5a2;_0x44a63a['timers'][_0x5aae13][_0x15fd('0x2d')]=function(){var _0x2fe61e=getDiff(_0x44a63a['timers'][_0x5aae13][_0x15fd('0x28')]);clearTimeout(_0x44a63a[_0x15fd('0x7')][_0x5aae13]['timer']);_0x44a63a[_0x15fd('0x7')][_0x5aae13][_0x15fd('0x27')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x2fe61e},_0x44a63a[_0x15fd('0x7')][_0x5aae13][_0x15fd('0x2b')],_0x5aae13)[_0x15fd('0x1f')](function(_0x476828){logger[_0x15fd('0x21')](_0x15fd('0x2e'),_0x2c5375,_0x2fe61e,_0x476828);})['catch'](function(_0x2d647c){logger[_0x15fd('0x2f')](_0x15fd('0x30'),_0x2c5375,_0x2d647c);});delete _0x44a63a[_0x15fd('0x7')][_0x5aae13];};}});}else{logger['info'](_0x15fd('0x31'),_0x2c5375,_0x5aae13,_0x5ca5a2);}});}})[_0x15fd('0x32')](function(_0x11b3a1){logger[_0x15fd('0x2f')](_0x15fd('0x25'),_0x2c5375,_0x44a63a[_0x15fd('0x5')][_0x5ca5a2]['acwTimeout'],_0x5aae13,_0x5ca5a2);})[_0x15fd('0x33')](function(){delete _0x44a63a[_0x15fd('0x8')][_0x2c5375];});}catch(_0x57c118){logger[_0x15fd('0x2f')](_0x15fd('0x34'),_0x57c118[_0x15fd('0x35')]);}};Acw['prototype'][_0x15fd('0x36')]=function(_0x309851){try{var _0x1732bc=this;if(_0x1732bc[_0x15fd('0x7')][_0x309851]){_0x1732bc[_0x15fd('0x7')][_0x309851][_0x15fd('0x27')]=![];var _0x4d7259=_0x1732bc['timers'][_0x309851]['uniqueid'];var _0x340d17=_0x1732bc[_0x15fd('0x7')][_0x309851][_0x15fd('0x2c')];var _0x4e608d=_0x1732bc['voiceQueues'][_0x340d17][_0x15fd('0x26')];logger['info']('[TIMER][STOP][AGENT:%s]',_0x309851);RpcUser['saveUnpause'](this[_0x15fd('0x6')][_0x309851]);RpcVoiceAgentReport[_0x15fd('0x37')]({'acwtime':_0x4e608d,'agentacw':!![]},_0x4d7259,_0x309851)[_0x15fd('0x1f')](function(_0x59d0d7){logger[_0x15fd('0x21')](_0x15fd('0x2e'),_0x4d7259,_0x4e608d,_0x59d0d7);})[_0x15fd('0x32')](function(_0x5beb6e){logger[_0x15fd('0x2f')](_0x15fd('0x30'),_0x4d7259,_0x5beb6e);});}else{logger[_0x15fd('0x2f')](_0x15fd('0x38'),_0x309851);if(_0x1732bc[_0x15fd('0x7')]){logger[_0x15fd('0x21')](_0x15fd('0x39'),JSON[_0x15fd('0x3a')](_0x1732bc[_0x15fd('0x7')]));}}}catch(_0x5dd3c4){logger[_0x15fd('0x2f')](_0x15fd('0x3b'),_0x5dd3c4[_0x15fd('0x35')]);}};Acw[_0x15fd('0x16')][_0x15fd('0x9')]=function(_0x5f9429){try{if(this[_0x15fd('0x5')][_0x5f9429[_0x15fd('0x2c')]]&&(this[_0x15fd('0x5')][_0x5f9429[_0x15fd('0x2c')]][_0x15fd('0x3c')]||this[_0x15fd('0x5')][_0x5f9429[_0x15fd('0x2c')]][_0x15fd('0x1a')])){if(this[_0x15fd('0x6')][_0x5f9429['interface']]){this[_0x15fd('0x8')][_0x5f9429[_0x15fd('0x2b')]]={'queue':_0x5f9429[_0x15fd('0x2c')],'interface':_0x5f9429[_0x15fd('0x18')],'destlinkedid':_0x5f9429[_0x15fd('0x23')]};}}}catch(_0x44d08b){logger[_0x15fd('0x2f')](_0x15fd('0x3d'),_0x44d08b['message']);}};Acw['prototype'][_0x15fd('0x12')]=function(_0x57bbd5){try{if(this[_0x15fd('0x5')][_0x57bbd5[_0x15fd('0x2c')]]&&(this['voiceQueues'][_0x57bbd5[_0x15fd('0x2c')]][_0x15fd('0x3c')]||this[_0x15fd('0x5')][_0x57bbd5[_0x15fd('0x2c')]][_0x15fd('0x1a')])){if(this[_0x15fd('0x6')][_0x57bbd5['interface']]){this[_0x15fd('0x8')][_0x57bbd5[_0x15fd('0x2b')]]={'queue':_0x57bbd5[_0x15fd('0x2c')],'interface':_0x57bbd5[_0x15fd('0x18')]};}}}catch(_0xcce802){logger[_0x15fd('0x2f')](_0x15fd('0x3e'),_0xcce802[_0x15fd('0x35')]);}};Acw[_0x15fd('0x16')][_0x15fd('0x3f')]=function(_0x16b4f5){try{if(this[_0x15fd('0x8')][_0x16b4f5['uniqueid']]&&_[_0x15fd('0x40')](this['channels'][_0x16b4f5[_0x15fd('0x2b')]][_0x15fd('0x41')])){logger[_0x15fd('0x21')]('[%s][HANGUP:UNIQUEID]',_0x16b4f5[_0x15fd('0x2b')]);this[_0x15fd('0x17')](_0x16b4f5[_0x15fd('0x2b')]);}else if(this[_0x15fd('0x8')][_0x16b4f5['linkedid']]&&_[_0x15fd('0x40')](this[_0x15fd('0x8')][_0x16b4f5[_0x15fd('0x42')]][_0x15fd('0x41')])){logger['info'](_0x15fd('0x43'),_0x16b4f5[_0x15fd('0x42')]);this['startAcw'](_0x16b4f5['linkedid']);}}catch(_0x5da44c){logger[_0x15fd('0x2f')](_0x15fd('0x44'),_0x5da44c[_0x15fd('0x35')]);}};Acw[_0x15fd('0x16')][_0x15fd('0xc')]=function(_0x33a128){try{if(this['channels'][_0x33a128[_0x15fd('0x2b')]]&&this[_0x15fd('0x8')][_0x33a128[_0x15fd('0x2b')]]['attended']){logger[_0x15fd('0x21')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x33a128[_0x15fd('0x2b')]);this[_0x15fd('0x17')](_0x33a128[_0x15fd('0x2b')]);}else if(this[_0x15fd('0x8')][_0x33a128[_0x15fd('0x42')]]&&this[_0x15fd('0x8')][_0x33a128[_0x15fd('0x42')]][_0x15fd('0x41')]){logger[_0x15fd('0x21')](_0x15fd('0x45'),_0x33a128[_0x15fd('0x42')]);this[_0x15fd('0x17')](_0x33a128[_0x15fd('0x42')]);}}catch(_0x5343b8){logger[_0x15fd('0x2f')]('[ACW][syncHangup]\x20%s',_0x5343b8[_0x15fd('0x35')]);}};Acw['prototype'][_0x15fd('0xe')]=function(_0x1fac7f){try{if(!_[_0x15fd('0x46')](this['channels'][_0x1fac7f['transfereeuniqueid']])){this[_0x15fd('0x17')](_0x1fac7f[_0x15fd('0x47')]);if(this[_0x15fd('0x8')][_0x1fac7f[_0x15fd('0x48')]]){this['channels'][_0x1fac7f[_0x15fd('0x48')]][_0x15fd('0x41')]=!![];this[_0x15fd('0x8')][_0x1fac7f[_0x15fd('0x49')]]=this[_0x15fd('0x8')][_0x1fac7f[_0x15fd('0x48')]];delete this['channels'][_0x1fac7f[_0x15fd('0x48')]];}}else if(!_[_0x15fd('0x46')](this[_0x15fd('0x8')][_0x1fac7f[_0x15fd('0x49')]])){this[_0x15fd('0x17')](_0x1fac7f[_0x15fd('0x49')]);if(this['channels'][_0x1fac7f['origtransfereruniqueid']]){this[_0x15fd('0x8')][_0x1fac7f[_0x15fd('0x4a')]]['attended']=!![];this[_0x15fd('0x8')][_0x1fac7f[_0x15fd('0x47')]]=this['channels'][_0x1fac7f[_0x15fd('0x4a')]];delete this[_0x15fd('0x8')][_0x1fac7f[_0x15fd('0x4a')]];}}}catch(_0x53bfd7){logger[_0x15fd('0x2f')](_0x15fd('0x4b'),_0x53bfd7[_0x15fd('0x35')]);}};Acw[_0x15fd('0x16')][_0x15fd('0x10')]=function(_0x1f4581){try{if(this[_0x15fd('0x8')][_0x1f4581[_0x15fd('0x4c')]]){logger[_0x15fd('0x21')](_0x15fd('0x4d'),JSON['stringify'](_0x1f4581[_0x15fd('0x4c')]));this[_0x15fd('0x17')](_0x1f4581['transfereruniqueid']);}else if(this['channels'][_0x1f4581[_0x15fd('0x4e')]]){logger[_0x15fd('0x21')](_0x15fd('0x4f'),JSON[_0x15fd('0x3a')](_0x1f4581[_0x15fd('0x4e')]));this[_0x15fd('0x17')](_0x1f4581['transfererlinkedid']);}}catch(_0x41d398){logger[_0x15fd('0x2f')](_0x15fd('0x50'),_0x41d398[_0x15fd('0x35')]);}};Acw[_0x15fd('0x16')][_0x15fd('0x51')]=function(_0xf27ab4){try{if(this[_0x15fd('0x5')][_0xf27ab4[_0x15fd('0x2c')]]&&this[_0x15fd('0x5')][_0xf27ab4[_0x15fd('0x2c')]]['autopause']==='all'){if(this[_0x15fd('0x6')][_0xf27ab4[_0x15fd('0x18')]]){logger[_0x15fd('0x21')](_0x15fd('0x52'),_0xf27ab4[_0x15fd('0x2b')],_0xf27ab4[_0x15fd('0x18')],_0xf27ab4[_0x15fd('0x2c')]);return RpcUser['savePause'](this[_0x15fd('0x6')][_0xf27ab4['interface']],_0x15fd('0x53'),_0xf27ab4['uniqueid']);}}}catch(_0x1c2828){logger['error'](_0x15fd('0x54'),_0x1c2828[_0x15fd('0x35')]);}};module[_0x15fd('0x55')]=Acw; \ No newline at end of file +var _0x008c=['[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','lastPauseAt','timer','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','[ACW][START]\x20%s','message','stopAcw','[TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','acw','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','attended','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','isUndefined','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','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','bind','hangup','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','channels','interface','mandatoryDisposition','Action','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause'];(function(_0x1b0dc8,_0x37ec4d){var _0x340740=function(_0x758882){while(--_0x758882){_0x1b0dc8['push'](_0x1b0dc8['shift']());}};_0x340740(++_0x37ec4d);}(_0x008c,0x188));var _0xc008=function(_0x2af160,_0x765b1){_0x2af160=_0x2af160-0x0;var _0x439d67=_0x008c[_0x2af160];return _0x439d67;};'use strict';var util=require(_0xc008('0x0'));var _=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var ami=require(_0xc008('0x3'));var logger=require(_0xc008('0x4'))('acw');var RpcUser=require(_0xc008('0x5'));var RpcVoiceAgentReport=require(_0xc008('0x6'));function Acw(_0x10b33c){this[_0xc008('0x7')]=_0x10b33c[_0xc008('0x7')];this[_0xc008('0x8')]=_0x10b33c[_0xc008('0x8')];this[_0xc008('0x9')]=_0x10b33c[_0xc008('0x9')];this['channels']={};ami['on'](_0xc008('0xa'),this['syncAgentConnect'][_0xc008('0xb')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0xc008('0xb')](this));ami['on'](_0xc008('0xc'),this['syncHangup']['bind'](this));ami['on']('agentringnoanswer',this[_0xc008('0xd')][_0xc008('0xb')](this));ami['on']('attendedtransfer',this[_0xc008('0xe')][_0xc008('0xb')](this));ami['on'](_0xc008('0xf'),this[_0xc008('0x10')][_0xc008('0xb')](this));ami['on'](_0xc008('0x11'),this[_0xc008('0x12')]['bind'](this));}function getDiff(_0x560e28){var _0x33f44c=moment()['milliseconds'](0x0);var _0x25e13f=moment(_0x560e28)[_0xc008('0x13')](0x0);return _0x33f44c[_0xc008('0x14')](_0x25e13f,_0xc008('0x15'));}Acw[_0xc008('0x16')]['startAcw']=function(_0x5e894e){try{var _0x4bd0f4=this;var _0x11ef38=this[_0xc008('0x17')][_0x5e894e][_0xc008('0x18')];var _0x3eb12a=this['channels'][_0x5e894e]['queue'];var _0x540e45=this['voiceQueues'][_0x3eb12a];var _0x46042b=![];var _0x462af5='ACW';if(_0x540e45[_0xc008('0x19')]){if(_0x540e45['mandatoryDispositionPause']['name']){_0x46042b=!![];_0x462af5=_0x540e45['mandatoryDispositionPause']['name'];}}ami[_0xc008('0x1a')]({'action':'QueuePause','interface':_0x11ef38,'paused':!![],'reason':_0x462af5})['then'](function(_0x590a71){if(_0x4bd0f4['agents'][_0x11ef38]){return RpcUser['getAgent'](_0x4bd0f4[_0xc008('0x8')][_0x11ef38]['id'])[_0xc008('0x1b')](function(_0x251db2){if(_0x251db2&&!_0x251db2[_0xc008('0x1c')]){logger[_0xc008('0x1d')](_0xc008('0x1e'),_0x5e894e,_0x11ef38,_0x3eb12a);var _0x4f43e2=_0x4bd0f4[_0xc008('0x17')][_0x5e894e]['attended']&&_0x4bd0f4['channels'][_0x5e894e][_0xc008('0x1f')]?_0x4bd0f4[_0xc008('0x17')][_0x5e894e][_0xc008('0x1f')]:_0x5e894e;return RpcUser[_0xc008('0x20')](_0x4bd0f4['agents'][_0x11ef38],_0x462af5,_0x4f43e2)['then'](function(_0x5de1e9){if(!_0x46042b){_0x4bd0f4[_0xc008('0x9')][_0x11ef38]={};logger[_0xc008('0x1d')](_0xc008('0x21'),_0x5e894e,_0x4bd0f4[_0xc008('0x7')][_0x3eb12a]['acwTimeout'],_0x11ef38,_0x3eb12a);_0x4bd0f4['timers'][_0x11ef38]['timer']=setTimeout(_0x4bd0f4['stopAcw']['bind'](_0x4bd0f4,_0x11ef38),_0x4bd0f4[_0xc008('0x7')][_0x3eb12a][_0xc008('0x22')]*0x3e8);_0x4bd0f4[_0xc008('0x9')][_0x11ef38]['lastPauseAt']=moment()[_0xc008('0x23')](_0xc008('0x24'));_0x4bd0f4[_0xc008('0x9')][_0x11ef38][_0xc008('0x25')]=_0x5e894e;_0x4bd0f4['timers'][_0x11ef38][_0xc008('0x26')]=_0x3eb12a;_0x4bd0f4[_0xc008('0x9')][_0x11ef38]['updateAcw']=function(){var _0x58db82=getDiff(_0x4bd0f4['timers'][_0x11ef38][_0xc008('0x27')]);clearTimeout(_0x4bd0f4[_0xc008('0x9')][_0x11ef38][_0xc008('0x28')]);_0x4bd0f4[_0xc008('0x9')][_0x11ef38][_0xc008('0x28')]=![];RpcVoiceAgentReport[_0xc008('0x29')]({'acwtime':_0x58db82},_0x4bd0f4[_0xc008('0x9')][_0x11ef38][_0xc008('0x25')],_0x11ef38)[_0xc008('0x1b')](function(_0x2b862d){logger[_0xc008('0x1d')](_0xc008('0x2a'),_0x5e894e,_0x58db82,_0x2b862d);})['catch'](function(_0x334a09){logger[_0xc008('0x2b')]('[%s][UPDATE][ERRORS:%s]',_0x5e894e,_0x334a09);});delete _0x4bd0f4[_0xc008('0x9')][_0x11ef38];};}});}else{logger[_0xc008('0x1d')](_0xc008('0x2c'),_0x5e894e,_0x11ef38,_0x3eb12a);}});}})[_0xc008('0x2d')](function(_0xd0e05a){logger[_0xc008('0x2b')](_0xc008('0x21'),_0x5e894e,_0x4bd0f4[_0xc008('0x7')][_0x3eb12a][_0xc008('0x22')],_0x11ef38,_0x3eb12a);})['finally'](function(){delete _0x4bd0f4[_0xc008('0x17')][_0x5e894e];});}catch(_0x389a40){logger[_0xc008('0x2b')](_0xc008('0x2e'),_0x389a40[_0xc008('0x2f')]);}};Acw[_0xc008('0x16')][_0xc008('0x30')]=function(_0x5d0e06){try{var _0x35f360=this;if(_0x35f360[_0xc008('0x9')][_0x5d0e06]){_0x35f360['timers'][_0x5d0e06][_0xc008('0x28')]=![];var _0x15453c=_0x35f360['timers'][_0x5d0e06][_0xc008('0x25')];var _0x2e4ae1=_0x35f360[_0xc008('0x9')][_0x5d0e06]['queue'];var _0x53b353=_0x35f360['voiceQueues'][_0x2e4ae1][_0xc008('0x22')];logger['info'](_0xc008('0x31'),_0x5d0e06);RpcUser[_0xc008('0x32')](this[_0xc008('0x8')][_0x5d0e06]);RpcVoiceAgentReport[_0xc008('0x29')]({'acwtime':_0x53b353,'agentacw':!![]},_0x15453c,_0x5d0e06)[_0xc008('0x1b')](function(_0xa381d1){logger[_0xc008('0x1d')](_0xc008('0x2a'),_0x15453c,_0x53b353,_0xa381d1);})[_0xc008('0x2d')](function(_0x387dfd){logger[_0xc008('0x2b')](_0xc008('0x33'),_0x15453c,_0x387dfd);});}else{logger[_0xc008('0x2b')](_0xc008('0x34'),_0x5d0e06);if(_0x35f360['timers']){logger[_0xc008('0x1d')](_0xc008('0x35'),JSON[_0xc008('0x36')](_0x35f360[_0xc008('0x9')]));}}}catch(_0x49a16d){logger[_0xc008('0x2b')](_0xc008('0x37'),_0x49a16d[_0xc008('0x2f')]);}};Acw[_0xc008('0x16')][_0xc008('0x38')]=function(_0x5706bb){try{if(this[_0xc008('0x7')][_0x5706bb[_0xc008('0x26')]]&&(this[_0xc008('0x7')][_0x5706bb[_0xc008('0x26')]][_0xc008('0x39')]||this['voiceQueues'][_0x5706bb[_0xc008('0x26')]][_0xc008('0x19')])){if(this[_0xc008('0x8')][_0x5706bb[_0xc008('0x18')]]){this['channels'][_0x5706bb[_0xc008('0x25')]]={'queue':_0x5706bb[_0xc008('0x26')],'interface':_0x5706bb[_0xc008('0x18')],'destlinkedid':_0x5706bb['destlinkedid']};}}}catch(_0x1f9af7){logger['error'](_0xc008('0x3a'),_0x1f9af7['message']);}};Acw[_0xc008('0x16')][_0xc008('0x12')]=function(_0x5a5d85){try{if(this[_0xc008('0x7')][_0x5a5d85[_0xc008('0x26')]]&&(this[_0xc008('0x7')][_0x5a5d85['queue']][_0xc008('0x39')]||this[_0xc008('0x7')][_0x5a5d85[_0xc008('0x26')]][_0xc008('0x19')])){if(this[_0xc008('0x8')][_0x5a5d85[_0xc008('0x18')]]){this['channels'][_0x5a5d85['uniqueid']]={'queue':_0x5a5d85['queue'],'interface':_0x5a5d85[_0xc008('0x18')]};}}}catch(_0x36417a){logger[_0xc008('0x2b')](_0xc008('0x3b'),_0x36417a[_0xc008('0x2f')]);}};Acw[_0xc008('0x16')][_0xc008('0x3c')]=function(_0x33be4f){try{if(this['channels'][_0x33be4f['uniqueid']]&&_['isUndefined'](this[_0xc008('0x17')][_0x33be4f[_0xc008('0x25')]][_0xc008('0x3d')])){logger['info'](_0xc008('0x3e'),_0x33be4f[_0xc008('0x25')]);this[_0xc008('0x3f')](_0x33be4f[_0xc008('0x25')]);}else if(this[_0xc008('0x17')][_0x33be4f[_0xc008('0x40')]]&&_[_0xc008('0x41')](this[_0xc008('0x17')][_0x33be4f[_0xc008('0x40')]][_0xc008('0x3d')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x33be4f[_0xc008('0x40')]);this['startAcw'](_0x33be4f[_0xc008('0x40')]);}}catch(_0x36e6f8){logger[_0xc008('0x2b')]('[ACW][syncHangupRequest]\x20%s',_0x36e6f8[_0xc008('0x2f')]);}};Acw[_0xc008('0x16')][_0xc008('0x42')]=function(_0x8b9775){try{if(this[_0xc008('0x17')][_0x8b9775['uniqueid']]&&this[_0xc008('0x17')][_0x8b9775[_0xc008('0x25')]]['attended']){logger[_0xc008('0x1d')](_0xc008('0x43'),_0x8b9775['uniqueid']);this['startAcw'](_0x8b9775[_0xc008('0x25')]);}else if(this[_0xc008('0x17')][_0x8b9775[_0xc008('0x40')]]&&this[_0xc008('0x17')][_0x8b9775[_0xc008('0x40')]]['attended']){logger['info'](_0xc008('0x44'),_0x8b9775['linkedid']);this[_0xc008('0x3f')](_0x8b9775[_0xc008('0x40')]);}}catch(_0xf94fcb){logger[_0xc008('0x2b')](_0xc008('0x45'),_0xf94fcb[_0xc008('0x2f')]);}};Acw['prototype'][_0xc008('0xe')]=function(_0xbd7422){try{if(!_[_0xc008('0x46')](this[_0xc008('0x17')][_0xbd7422[_0xc008('0x47')]])){this['startAcw'](_0xbd7422[_0xc008('0x47')]);if(this['channels'][_0xbd7422['secondtransfereruniqueid']]){this['channels'][_0xbd7422[_0xc008('0x48')]][_0xc008('0x3d')]=!![];this[_0xc008('0x17')][_0xbd7422['transfertargetuniqueid']]=this[_0xc008('0x17')][_0xbd7422[_0xc008('0x48')]];delete this[_0xc008('0x17')][_0xbd7422['secondtransfereruniqueid']];}}else if(!_[_0xc008('0x46')](this[_0xc008('0x17')][_0xbd7422[_0xc008('0x49')]])){this[_0xc008('0x3f')](_0xbd7422['transfertargetuniqueid']);if(this[_0xc008('0x17')][_0xbd7422['origtransfereruniqueid']]){this[_0xc008('0x17')][_0xbd7422[_0xc008('0x4a')]][_0xc008('0x3d')]=!![];this[_0xc008('0x17')][_0xbd7422[_0xc008('0x47')]]=this[_0xc008('0x17')][_0xbd7422['origtransfereruniqueid']];delete this[_0xc008('0x17')][_0xbd7422['origtransfereruniqueid']];}}}catch(_0x5bf4a9){logger[_0xc008('0x2b')](_0xc008('0x4b'),_0x5bf4a9['message']);}};Acw[_0xc008('0x16')][_0xc008('0x10')]=function(_0x3e373e){try{if(this[_0xc008('0x17')][_0x3e373e[_0xc008('0x4c')]]){logger[_0xc008('0x1d')](_0xc008('0x4d'),JSON['stringify'](_0x3e373e[_0xc008('0x4c')]));this[_0xc008('0x3f')](_0x3e373e[_0xc008('0x4c')]);}else if(this[_0xc008('0x17')][_0x3e373e[_0xc008('0x4e')]]){logger[_0xc008('0x1d')](_0xc008('0x4f'),JSON[_0xc008('0x36')](_0x3e373e[_0xc008('0x4e')]));this[_0xc008('0x3f')](_0x3e373e[_0xc008('0x4e')]);}}catch(_0x2b5eb6){logger[_0xc008('0x2b')](_0xc008('0x50'),_0x2b5eb6['message']);}};Acw[_0xc008('0x16')][_0xc008('0xd')]=function(_0x3d3a7e){try{if(this['voiceQueues'][_0x3d3a7e[_0xc008('0x26')]]&&this[_0xc008('0x7')][_0x3d3a7e['queue']]['autopause']===_0xc008('0x51')){if(this[_0xc008('0x8')][_0x3d3a7e[_0xc008('0x18')]]){logger[_0xc008('0x1d')](_0xc008('0x52'),_0x3d3a7e[_0xc008('0x25')],_0x3d3a7e[_0xc008('0x18')],_0x3d3a7e[_0xc008('0x26')]);return RpcUser[_0xc008('0x20')](this[_0xc008('0x8')][_0x3d3a7e[_0xc008('0x18')]],'Auto-Pause',_0x3d3a7e[_0xc008('0x25')]);}}}catch(_0x25a52b){logger[_0xc008('0x2b')](_0xc008('0x53'),_0x25a52b['message']);}};module[_0xc008('0x54')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 89e9aba..52a4f56 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 _0x8576=['action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','actionDeviceStateList','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionSipPeerStatus','actionQueueSummary','catch','log','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','ami','asterisk','username','password','Action','promisify'];(function(_0x353204,_0x3ea389){var _0x53b2a6=function(_0x217298){while(--_0x217298){_0x353204['push'](_0x353204['shift']());}};_0x53b2a6(++_0x3ea389);}(_0x8576,0x6c));var _0x6857=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x8576[_0x2642cb];return _0xe6e41;};'use strict';var Manager=require(_0x6857('0x0'));var BPromise=require(_0x6857('0x1'));var moment=require(_0x6857('0x2'));var util=require(_0x6857('0x3'));var _=require(_0x6857('0x4'));var logger=require(_0x6857('0x5'))(_0x6857('0x6'));var config=require('../../config/environment');var ami=new Manager(config[_0x6857('0x7')]['port'],config[_0x6857('0x7')]['ip'],config[_0x6857('0x7')][_0x6857('0x8')],config[_0x6857('0x7')][_0x6857('0x9')],!![]);ami['keepConnected']();ami[_0x6857('0xa')]=BPromise[_0x6857('0xb')](ami[_0x6857('0xc')]);function error(_0x3200ed){logger['error'](util[_0x6857('0xd')](_0x6857('0xe'),config['asterisk'][_0x6857('0x8')],config[_0x6857('0x7')]['ip'],config['asterisk'][_0x6857('0xf')],util[_0x6857('0x10')](_0x3200ed,![],null)));}function close(){logger[_0x6857('0x11')](util['format'](_0x6857('0x12'),config[_0x6857('0x7')][_0x6857('0x8')],config[_0x6857('0x7')]['ip'],config[_0x6857('0x7')][_0x6857('0xf')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x6857('0xa')]({'action':_0x6857('0x13')});};};ami[_0x6857('0x14')]=function(){return function(){return ami[_0x6857('0xa')]({'action':'devicestatelist'});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x6857('0xa')]({'action':_0x6857('0x15')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x6857('0xa')]({'action':_0x6857('0x16')});};};ami[_0x6857('0x17')]=function(){return function(){return ami['Action']({'action':_0x6857('0x18')});};};function connect(_0x18e280){logger['info'](util['format'](_0x6857('0x19'),config[_0x6857('0x7')][_0x6857('0x8')],config[_0x6857('0x7')]['ip'],config[_0x6857('0x7')][_0x6857('0xf')]));ami[_0x6857('0x1a')]('error',error);ami[_0x6857('0x1a')](_0x6857('0x1b'),close);}ami['on'](_0x6857('0x1c'),connect);ami['on'](_0x6857('0x1d'),function(_0x330432){logger[_0x6857('0x1e')](util[_0x6857('0xd')](_0x6857('0x1f'),config[_0x6857('0x7')]['username'],config[_0x6857('0x7')]['ip'],config['asterisk']['port'],util[_0x6857('0x10')](_0x330432,![],null)));});ami['on']('fullybooted',function(_0x36d49d){logger[_0x6857('0x1e')](util['format'](_0x6857('0x20'),config[_0x6857('0x7')][_0x6857('0x8')],config[_0x6857('0x7')]['ip'],config[_0x6857('0x7')][_0x6857('0xf')]));return BPromise[_0x6857('0x21')]()[_0x6857('0x22')](ami[_0x6857('0x23')]())['then'](ami[_0x6857('0x14')]())[_0x6857('0x22')](ami[_0x6857('0x24')]())[_0x6857('0x22')](ami[_0x6857('0x25')]())[_0x6857('0x22')](ami[_0x6857('0x17')]())[_0x6857('0x26')](function(_0x461289){console[_0x6857('0x27')](_0x461289);});});ami[_0x6857('0x1a')](_0x6857('0x11'),error);ami[_0x6857('0x1a')](_0x6857('0x1b'),close);module['exports']=ami; \ No newline at end of file +var _0x9289=['queuesummary','actionCoreShowChannels','coreshowchannels','once','close','connect','shutdown','inspect','fullybooted','info','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','actionSipShowRegistry','actionDeviceStateList','then','log','bluebird','moment','lodash','../../config/logger','ami','../../config/environment','asterisk','password','keepConnected','Action','promisify','action','error','format','username','port','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary'];(function(_0x3a27bd,_0x150aee){var _0x1cceba=function(_0x2c5bf6){while(--_0x2c5bf6){_0x3a27bd['push'](_0x3a27bd['shift']());}};_0x1cceba(++_0x150aee);}(_0x9289,0x82));var _0x9928=function(_0x5d8711,_0x28772c){_0x5d8711=_0x5d8711-0x0;var _0x18ca49=_0x9289[_0x5d8711];return _0x18ca49;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x9928('0x0'));var moment=require(_0x9928('0x1'));var util=require('util');var _=require(_0x9928('0x2'));var logger=require(_0x9928('0x3'))(_0x9928('0x4'));var config=require(_0x9928('0x5'));var ami=new Manager(config['asterisk']['port'],config[_0x9928('0x6')]['ip'],config['asterisk']['username'],config[_0x9928('0x6')][_0x9928('0x7')],!![]);ami[_0x9928('0x8')]();ami[_0x9928('0x9')]=BPromise[_0x9928('0xa')](ami[_0x9928('0xb')]);function error(_0x151d7d){logger[_0x9928('0xc')](util[_0x9928('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x9928('0x6')][_0x9928('0xe')],config['asterisk']['ip'],config[_0x9928('0x6')][_0x9928('0xf')],util['inspect'](_0x151d7d,![],null)));}function close(){logger['error'](util[_0x9928('0xd')](_0x9928('0x10'),config[_0x9928('0x6')][_0x9928('0xe')],config['asterisk']['ip'],config['asterisk'][_0x9928('0xf')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x9928('0x9')]({'action':_0x9928('0x11')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x9928('0x9')]({'action':_0x9928('0x12')});};};ami[_0x9928('0x13')]=function(){return function(){return ami[_0x9928('0x9')]({'action':_0x9928('0x14')});};};ami[_0x9928('0x15')]=function(){return function(){return ami[_0x9928('0x9')]({'action':_0x9928('0x16')});};};ami[_0x9928('0x17')]=function(){return function(){return ami['Action']({'action':_0x9928('0x18')});};};function connect(_0x39eef3){logger['info'](util[_0x9928('0xd')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x9928('0x6')][_0x9928('0xe')],config[_0x9928('0x6')]['ip'],config['asterisk'][_0x9928('0xf')]));ami['once'](_0x9928('0xc'),error);ami[_0x9928('0x19')](_0x9928('0x1a'),close);}ami['on'](_0x9928('0x1b'),connect);ami['on'](_0x9928('0x1c'),function(_0x416c8b){logger['info'](util[_0x9928('0xd')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x9928('0x6')][_0x9928('0xe')],config['asterisk']['ip'],config[_0x9928('0x6')][_0x9928('0xf')],util[_0x9928('0x1d')](_0x416c8b,![],null)));});ami['on'](_0x9928('0x1e'),function(_0x49c13b){logger[_0x9928('0x1f')](util[_0x9928('0xd')](_0x9928('0x20'),config[_0x9928('0x6')][_0x9928('0xe')],config[_0x9928('0x6')]['ip'],config['asterisk'][_0x9928('0xf')]));return BPromise[_0x9928('0x21')]()['then'](ami[_0x9928('0x22')]())['then'](ami[_0x9928('0x23')]())[_0x9928('0x24')](ami[_0x9928('0x13')]())[_0x9928('0x24')](ami['actionQueueSummary']())[_0x9928('0x24')](ami[_0x9928('0x17')]())['catch'](function(_0x3f042a){console[_0x9928('0x25')](_0x3f042a);});});ami[_0x9928('0x19')](_0x9928('0xc'),error);ami[_0x9928('0x19')](_0x9928('0x1a'),close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 15adda9..e67f237 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 _0x2a88=['error','message','catch','exports','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport'];(function(_0x44cad0,_0x229ce2){var _0x360e6f=function(_0x5a185e){while(--_0x5a185e){_0x44cad0['push'](_0x44cad0['shift']());}};_0x360e6f(++_0x229ce2);}(_0x2a88,0x1d2));var _0x82a8=function(_0x3b080a,_0x5a9164){_0x3b080a=_0x3b080a-0x0;var _0x1b5aba=_0x2a88[_0x3b080a];return _0x1b5aba;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x82a8('0x0'));var logger=require(_0x82a8('0x1'))('ami');var client=jayson[_0x82a8('0x2')][_0x82a8('0x3')]({'port':0x2329});client[_0x82a8('0x4')]=function(_0x4be609,_0xc38704){return new BPromise(function(_0xf3f815,_0x40b2a7){return client[_0x82a8('0x5')](_0x4be609,_0xc38704)[_0x82a8('0x6')](function(_0x382041){logger[_0x82a8('0x7')](_0x82a8('0x8'),_0x82a8('0x9'),_0x4be609,_0xc38704,_0x382041);if(_0x382041['error']){logger[_0x82a8('0xa')]('rpc',_0x82a8('0x9'),_0x4be609,_0x382041['error'][_0x82a8('0xb')],_0xc38704);return _0x40b2a7(_0x382041[_0x82a8('0xa')][_0x82a8('0xb')]);}else{return _0xf3f815(_0x382041['result']);}})[_0x82a8('0xc')](function(_0x4b887b){logger[_0x82a8('0xa')](_0x82a8('0x8'),_0x82a8('0x9'),_0x4be609,_0x4b887b,_0xc38704);return _0x40b2a7(_0x4b887b);});});};module[_0x82a8('0xd')]=client; \ No newline at end of file +var _0x8e45=['then','debug','rpc','error','memberReport','message','result','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8e45,0x1e8));var _0x58e4=function(_0x5445b1,_0x37f77c){_0x5445b1=_0x5445b1-0x0;var _0x7c15c6=_0x8e45[_0x5445b1];return _0x7c15c6;};'use strict';var jayson=require(_0x58e4('0x0'));var BPromise=require(_0x58e4('0x1'));var logger=require(_0x58e4('0x2'))('ami');var client=jayson[_0x58e4('0x3')][_0x58e4('0x4')]({'port':0x2329});client[_0x58e4('0x5')]=function(_0x4a4c00,_0x199c68){return new BPromise(function(_0x5a649d,_0x327cfe){return client[_0x58e4('0x6')](_0x4a4c00,_0x199c68)[_0x58e4('0x7')](function(_0x5dd1ef){logger[_0x58e4('0x8')](_0x58e4('0x9'),'memberReport',_0x4a4c00,_0x199c68,_0x5dd1ef);if(_0x5dd1ef[_0x58e4('0xa')]){logger[_0x58e4('0xa')](_0x58e4('0x9'),_0x58e4('0xb'),_0x4a4c00,_0x5dd1ef[_0x58e4('0xa')]['message'],_0x199c68);return _0x327cfe(_0x5dd1ef[_0x58e4('0xa')][_0x58e4('0xc')]);}else{return _0x5a649d(_0x5dd1ef[_0x58e4('0xd')]);}})['catch'](function(_0xcf9aa9){logger[_0x58e4('0xa')](_0x58e4('0x9'),_0x58e4('0xb'),_0x4a4c00,_0xcf9aa9,_0x199c68);return _0x327cfe(_0xcf9aa9);});});};module[_0x58e4('0xe')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 32c3ca0..23f7960 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 _0xbcb3=['dialQueueTimeout','scheduledat','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','substring','getQueue','exports','util','lodash','moment','isNil','string','uniqueid','name','Contact','firstName','number','phone','queue','active','type'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0xbcb3,0xca));var _0x3bcb=function(_0x175b39,_0x349b9b){_0x175b39=_0x175b39-0x0;var _0x40063f=_0xbcb3[_0x175b39];return _0x40063f;};'use strict';var util=require(_0x3bcb('0x0'));var _=require(_0x3bcb('0x1'));var moment=require(_0x3bcb('0x2'));function checkNameSurname(_0x146f60,_0x48df37,_0x2527ff){var _0x3c4cb3='';if(!_[_0x3bcb('0x3')](_0x48df37)&&'string'===typeof _0x48df37){_0x3c4cb3+=_0x48df37;}if(!_[_0x3bcb('0x3')](_0x2527ff)&&_0x3bcb('0x4')===typeof _0x2527ff){_0x3c4cb3+='\x20'+_0x2527ff;}if(_0x3c4cb3!==''){return _0x3c4cb3;}return _0x146f60;}function Action(_0x2614cf,_0x6290ea,_0x456e79){this['voiceQueue']=_0x2614cf;this[_0x3bcb('0x5')]=_0x456e79||undefined;this[_0x3bcb('0x6')]=checkNameSurname(_0x6290ea[_0x3bcb('0x7')]['phone'],_0x6290ea['Contact'][_0x3bcb('0x8')],_0x6290ea['Contact']['lastName']);this[_0x3bcb('0x9')]=_0x6290ea[_0x3bcb('0x7')][_0x3bcb('0xa')];this[_0x3bcb('0xb')]=_0x2614cf[_0x3bcb('0x6')];this[_0x3bcb('0xc')]=_0x6290ea[_0x3bcb('0xc')]||![];this[_0x3bcb('0xd')]=_0x2614cf[_0x3bcb('0xd')];this[_0x3bcb('0xe')]=_0x2614cf[_0x3bcb('0xe')]||0x3;this[_0x3bcb('0xf')]=_0x6290ea[_0x3bcb('0xf')];this['countbusyretry']=_0x6290ea['countbusyretry'];this[_0x3bcb('0x10')]=_0x6290ea[_0x3bcb('0x10')];this[_0x3bcb('0x11')]=_0x6290ea[_0x3bcb('0x11')];this[_0x3bcb('0x12')]=_0x6290ea['ContactId'];this[_0x3bcb('0x13')]=_0x6290ea[_0x3bcb('0x13')];this[_0x3bcb('0x14')]=_0x6290ea['UserId'];this['VoiceQueueId']=_0x6290ea['VoiceQueueId'];this[_0x3bcb('0x15')]=_0x6290ea['CampaignId'];this[_0x3bcb('0x16')]=_0x6290ea['id'];this['ContactFirstName']=_0x6290ea['Contact'][_0x3bcb('0x8')]||'';this[_0x3bcb('0x17')]=moment()[_0x3bcb('0x18')](_0x3bcb('0x19'));this[_0x3bcb('0x1a')]=_0x6290ea['callback'];this[_0x3bcb('0x1b')]=_0x6290ea[_0x3bcb('0x1b')];this[_0x3bcb('0x1c')]=_0x6290ea[_0x3bcb('0x1c')];this['recallme']=_0x6290ea[_0x3bcb('0x1d')];this[_0x3bcb('0x1e')]='';this[_0x3bcb('0x1f')]='';}Action['prototype'][_0x3bcb('0x20')]=function(){return util[_0x3bcb('0x18')]('\x22%s\x22\x20<%s>',this[_0x3bcb('0x6')],this['voiceQueue']['dialCutDigit']>0x0?this[_0x3bcb('0x9')][_0x3bcb('0x21')](this['voiceQueue']['dialCutDigit']):this['number']);};Action['prototype'][_0x3bcb('0x22')]=function(){return this['queue'];};module[_0x3bcb('0x23')]=Action; \ No newline at end of file +var _0x015a=['firstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','substring','number','exports','util','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper'];(function(_0x43fbf3,_0x2c2955){var _0x18bc3a=function(_0x33ca89){while(--_0x33ca89){_0x43fbf3['push'](_0x43fbf3['shift']());}};_0x18bc3a(++_0x2c2955);}(_0x015a,0xf2));var _0xa015=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x015a[_0x40a045];return _0x1a687c;};'use strict';var util=require(_0xa015('0x0'));var _=require('lodash');var moment=require(_0xa015('0x1'));function checkNameSurname(_0x296175,_0x2ecd39,_0x5fedb3){var _0x289f94='';if(!_[_0xa015('0x2')](_0x2ecd39)&&_0xa015('0x3')===typeof _0x2ecd39){_0x289f94+=_0x2ecd39;}if(!_[_0xa015('0x2')](_0x5fedb3)&&'string'===typeof _0x5fedb3){_0x289f94+='\x20'+_0x5fedb3;}if(_0x289f94!==''){return _0x289f94;}return _0x296175;}function Action(_0x2ef87d,_0x5466d7,_0x1985b6){this[_0xa015('0x4')]=_0x2ef87d;this[_0xa015('0x5')]=_0x1985b6||undefined;this[_0xa015('0x6')]=checkNameSurname(_0x5466d7[_0xa015('0x7')][_0xa015('0x8')],_0x5466d7[_0xa015('0x7')]['firstName'],_0x5466d7['Contact'][_0xa015('0x9')]);this['number']=_0x5466d7[_0xa015('0x7')]['phone'];this[_0xa015('0xa')]=_0x2ef87d[_0xa015('0x6')];this['active']=_0x5466d7[_0xa015('0xb')]||![];this[_0xa015('0xc')]=_0x2ef87d['type'];this[_0xa015('0xd')]=_0x2ef87d[_0xa015('0xd')]||0x3;this[_0xa015('0xe')]=_0x5466d7[_0xa015('0xe')];this[_0xa015('0xf')]=_0x5466d7[_0xa015('0xf')];this[_0xa015('0x10')]=_0x5466d7[_0xa015('0x10')];this[_0xa015('0x11')]=_0x5466d7[_0xa015('0x11')];this[_0xa015('0x12')]=_0x5466d7[_0xa015('0x12')];this[_0xa015('0x13')]=_0x5466d7[_0xa015('0x13')];this[_0xa015('0x14')]=_0x5466d7['UserId'];this[_0xa015('0x15')]=_0x5466d7[_0xa015('0x15')];this[_0xa015('0x16')]=_0x5466d7[_0xa015('0x16')];this[_0xa015('0x17')]=_0x5466d7['id'];this['ContactFirstName']=_0x5466d7[_0xa015('0x7')][_0xa015('0x18')]||'';this['starttime']=moment()[_0xa015('0x19')](_0xa015('0x1a'));this[_0xa015('0x1b')]=_0x5466d7[_0xa015('0x1b')];this[_0xa015('0x1c')]=_0x5466d7[_0xa015('0x1c')];this[_0xa015('0x1d')]=_0x5466d7[_0xa015('0x1d')];this[_0xa015('0x1e')]=_0x5466d7['recallme'];this[_0xa015('0x1f')]='';this[_0xa015('0x20')]='';}Action[_0xa015('0x21')]['getCaller']=function(){return util[_0xa015('0x19')](_0xa015('0x22'),this[_0xa015('0x6')],this[_0xa015('0x4')]['dialCutDigit']>0x0?this['number'][_0xa015('0x23')](this[_0xa015('0x4')]['dialCutDigit']):this[_0xa015('0x24')]);};Action[_0xa015('0x21')]['getQueue']=function(){return this[_0xa015('0xa')];};module[_0xa015('0x25')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 578b879..5a04c53 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 _0x6380=['Answer','scheduledat','type','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','format','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','state','statedesc'];(function(_0x1843b2,_0x15cfd4){var _0x2d070d=function(_0x34ad4b){while(--_0x34ad4b){_0x1843b2['push'](_0x1843b2['shift']());}};_0x2d070d(++_0x15cfd4);}(_0x6380,0x95));var _0x0638=function(_0x29c859,_0x211069){_0x29c859=_0x29c859-0x0;var _0x51faa1=_0x6380[_0x29c859];return _0x51faa1;};'use strict';var util=require(_0x0638('0x0'));var _=require(_0x0638('0x1'));var moment=require('moment');function getSeconds(_0x2c70df,_0x42622c){var _0x359760=moment(_0x2c70df)[_0x0638('0x2')](0x0);var _0x159520=moment(_0x42622c)[_0x0638('0x2')](0x0);return _0x359760[_0x0638('0x3')](_0x159520,_0x0638('0x4'));}function AgentComplete(_0x183036,_0x4d29c5){this[_0x0638('0x5')]=0x4;this[_0x0638('0x6')]=_0x0638('0x7');this[_0x0638('0x8')]=_0x183036[_0x0638('0x8')];this[_0x0638('0x9')]=_0x183036[_0x0638('0x9')];this['campaigntype']=_0x183036[_0x0638('0x9')]===_0x0638('0xa')?_0x0638('0xb'):_0x183036[_0x0638('0x9')];this[_0x0638('0xc')]=_0x183036[_0x0638('0xc')];this['countcongestionretry']=_0x183036['countcongestionretry'];this['countnoanswerretry']=_0x183036[_0x0638('0xd')];this[_0x0638('0xe')]=_0x183036[_0x0638('0xc')]+_0x183036[_0x0638('0xf')]+_0x183036['countnoanswerretry'];this['uniqueid']=_0x4d29c5[_0x0638('0x10')];this[_0x0638('0x11')]=_0x183036[_0x0638('0x12')];this['calleridnum']=_0x183036[_0x0638('0x13')];this[_0x0638('0x14')]=_0x183036[_0x0638('0x14')];this[_0x0638('0x15')]=_0x183036['responsetime'];this[_0x0638('0x16')]=_0x183036[_0x0638('0x16')];this['endtime']=moment()[_0x0638('0x17')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x0638('0x18')]=getSeconds(_0x183036[_0x0638('0x15')],_0x183036[_0x0638('0x14')]);this[_0x0638('0x19')]=getSeconds(_0x183036['answertime'],_0x183036[_0x0638('0x15')]);this['talktime']=getSeconds(this['endtime'],_0x183036['answertime']);this[_0x0638('0xb')]=_0x4d29c5[_0x0638('0xb')];this[_0x0638('0x1a')]=_0x4d29c5['membername'];this[_0x0638('0x1b')]=_0x4d29c5[_0x0638('0x1b')];this[_0x0638('0x1c')]=_0x183036['callback'];this['callbackuniqueid']=_0x183036[_0x0638('0x1d')];this[_0x0638('0x1e')]=_0x183036['callbackat'];this[_0x0638('0x1f')]=_0x183036[_0x0638('0x1f')];this[_0x0638('0x20')]=_0x183036[_0x0638('0x20')];this[_0x0638('0x21')]=_0x183036[_0x0638('0x21')];this['UserId']=_0x183036[_0x0638('0x22')];this['VoiceQueueId']=_0x183036['VoiceQueueId'];this[_0x0638('0x23')]=_0x183036[_0x0638('0x23')];this['originatecalleridnum']=_0x183036[_0x0638('0x24')]||'';this['originatecalleridname']=_0x183036[_0x0638('0x25')]||'';}module[_0x0638('0x26')]=AgentComplete; \ No newline at end of file +var _0xfdec=['type','campaigntype','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','state','statedesc','scheduledat'];(function(_0xe826e5,_0x3709ce){var _0x1c725c=function(_0x13720d){while(--_0x13720d){_0xe826e5['push'](_0xe826e5['shift']());}};_0x1c725c(++_0x3709ce);}(_0xfdec,0xe3));var _0xcfde=function(_0x5223c2,_0xe0d88f){_0x5223c2=_0x5223c2-0x0;var _0x10f398=_0xfdec[_0x5223c2];return _0x10f398;};'use strict';var util=require(_0xcfde('0x0'));var _=require(_0xcfde('0x1'));var moment=require('moment');function getSeconds(_0x5ea988,_0x491c02){var _0x3d17fc=moment(_0x5ea988)[_0xcfde('0x2')](0x0);var _0x9dc8a0=moment(_0x491c02)['milliseconds'](0x0);return _0x3d17fc[_0xcfde('0x3')](_0x9dc8a0,'seconds');}function AgentComplete(_0x1e5da5,_0x3094fc){this[_0xcfde('0x4')]=0x4;this[_0xcfde('0x5')]='Answer';this[_0xcfde('0x6')]=_0x1e5da5[_0xcfde('0x6')];this[_0xcfde('0x7')]=_0x1e5da5[_0xcfde('0x7')];this[_0xcfde('0x8')]=_0x1e5da5[_0xcfde('0x7')]==='outbound'?_0xcfde('0x9'):_0x1e5da5[_0xcfde('0x7')];this['countbusyretry']=_0x1e5da5['countbusyretry'];this['countcongestionretry']=_0x1e5da5[_0xcfde('0xa')];this[_0xcfde('0xb')]=_0x1e5da5[_0xcfde('0xb')];this[_0xcfde('0xc')]=_0x1e5da5[_0xcfde('0xd')]+_0x1e5da5[_0xcfde('0xa')]+_0x1e5da5['countnoanswerretry'];this['uniqueid']=_0x3094fc[_0xcfde('0xe')];this[_0xcfde('0xf')]=_0x1e5da5[_0xcfde('0x10')];this['calleridnum']=_0x1e5da5[_0xcfde('0x11')];this[_0xcfde('0x12')]=_0x1e5da5[_0xcfde('0x12')];this[_0xcfde('0x13')]=_0x1e5da5[_0xcfde('0x13')];this[_0xcfde('0x14')]=_0x1e5da5[_0xcfde('0x14')];this[_0xcfde('0x15')]=moment()[_0xcfde('0x16')](_0xcfde('0x17'));this['ringtime']=getSeconds(_0x1e5da5[_0xcfde('0x13')],_0x1e5da5[_0xcfde('0x12')]);this[_0xcfde('0x18')]=getSeconds(_0x1e5da5[_0xcfde('0x14')],_0x1e5da5[_0xcfde('0x13')]);this[_0xcfde('0x19')]=getSeconds(this[_0xcfde('0x15')],_0x1e5da5['answertime']);this['queue']=_0x3094fc[_0xcfde('0x9')];this['membername']=_0x3094fc[_0xcfde('0x1a')];this['reason']=_0x3094fc['reason'];this[_0xcfde('0x1b')]=_0x1e5da5[_0xcfde('0x1b')];this[_0xcfde('0x1c')]=_0x1e5da5['callbackuniqueid'];this[_0xcfde('0x1d')]=_0x1e5da5[_0xcfde('0x1d')];this[_0xcfde('0x1e')]=_0x1e5da5[_0xcfde('0x1e')];this[_0xcfde('0x1f')]=_0x1e5da5['ContactId'];this[_0xcfde('0x20')]=_0x1e5da5[_0xcfde('0x20')];this[_0xcfde('0x21')]=_0x1e5da5[_0xcfde('0x21')];this[_0xcfde('0x22')]=_0x1e5da5[_0xcfde('0x22')];this[_0xcfde('0x23')]=_0x1e5da5['CampaignId'];this[_0xcfde('0x24')]=_0x1e5da5[_0xcfde('0x24')]||'';this[_0xcfde('0x25')]=_0x1e5da5[_0xcfde('0x25')]||'';}module[_0xcfde('0x26')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 72603ad..e800a82 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 _0x761c=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','calleridnum','starttime','responsetime','endtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','uniqueid','scheduledat','type','outbound','queue'];(function(_0x28b0a1,_0x99bd0a){var _0x21470c=function(_0x45bf01){while(--_0x45bf01){_0x28b0a1['push'](_0x28b0a1['shift']());}};_0x21470c(++_0x99bd0a);}(_0x761c,0x18a));var _0xc761=function(_0x2ec079,_0x17fb89){_0x2ec079=_0x2ec079-0x0;var _0x219e8f=_0x761c[_0x2ec079];return _0x219e8f;};'use strict';var util=require(_0xc761('0x0'));var _=require('lodash');var moment=require(_0xc761('0x1'));function getSeconds(_0x351648,_0x4d97a8){var _0x2ecba4=moment(_0x351648)[_0xc761('0x2')](0x0);var _0x15d8dc=moment(_0x4d97a8)['milliseconds'](0x0);return _0x2ecba4[_0xc761('0x3')](_0x15d8dc,'seconds');}function Final(_0x341f13){this[_0xc761('0x4')]=_0x341f13[_0xc761('0x4')];this[_0xc761('0x5')]=_0x341f13[_0xc761('0x5')];this[_0xc761('0x6')]=_0x341f13[_0xc761('0x6')];this['campaigntype']=_0x341f13[_0xc761('0x6')]===_0xc761('0x7')?_0xc761('0x8'):_0x341f13[_0xc761('0x6')];this[_0xc761('0x9')]=_0x341f13[_0xc761('0x9')];this[_0xc761('0xa')]=_0x341f13['countcongestionretry'];this['countnoanswerretry']=_0x341f13[_0xc761('0xb')];this[_0xc761('0xc')]=_0x341f13['countbusyretry']+_0x341f13['countcongestionretry']+_0x341f13[_0xc761('0xb')];this['queue']=_0x341f13[_0xc761('0x8')];this['calleridname']=_0x341f13[_0xc761('0xd')];this['calleridnum']=_0x341f13[_0xc761('0xe')];this[_0xc761('0xf')]=_0x341f13[_0xc761('0xf')];this[_0xc761('0x10')]=_0x341f13[_0xc761('0x10')];this[_0xc761('0x11')]=_0x341f13[_0xc761('0x10')];this['ringtime']=_0x341f13['ringtime']||0x0;this[_0xc761('0x12')]=_0x341f13[_0xc761('0x12')]||0x0;this[_0xc761('0x13')]=_0x341f13['talktime']||0x0;this[_0xc761('0x14')]=_0x341f13[_0xc761('0x14')];this[_0xc761('0x15')]=_0x341f13[_0xc761('0x15')];this[_0xc761('0x16')]=_0x341f13['callbackat'];this['recallme']=_0x341f13[_0xc761('0x17')];this[_0xc761('0x18')]=_0x341f13['ContactId'];this['ListId']=_0x341f13[_0xc761('0x19')];this[_0xc761('0x1a')]=_0x341f13[_0xc761('0x1a')];this[_0xc761('0x1b')]=_0x341f13[_0xc761('0x1b')];this['CampaignId']=_0x341f13[_0xc761('0x1c')];this[_0xc761('0x1d')]=_0x341f13[_0xc761('0x1d')]||'';this[_0xc761('0x1e')]=_0x341f13[_0xc761('0x1e')]||'';}module['exports']=Final; \ No newline at end of file +var _0xdb8b=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid'];(function(_0x2d2f17,_0x2bd8a9){var _0x5a49ae=function(_0x1383d2){while(--_0x1383d2){_0x2d2f17['push'](_0x2d2f17['shift']());}};_0x5a49ae(++_0x2bd8a9);}(_0xdb8b,0x1c4));var _0xbdb8=function(_0xf78efa,_0x603e99){_0xf78efa=_0xf78efa-0x0;var _0x5de1f5=_0xdb8b[_0xf78efa];return _0x5de1f5;};'use strict';var util=require('util');var _=require(_0xbdb8('0x0'));var moment=require(_0xbdb8('0x1'));function getSeconds(_0x396c23,_0x553ab3){var _0x4ece48=moment(_0x396c23)[_0xbdb8('0x2')](0x0);var _0x5e5f57=moment(_0x553ab3)[_0xbdb8('0x2')](0x0);return _0x4ece48[_0xbdb8('0x3')](_0x5e5f57,_0xbdb8('0x4'));}function Final(_0x2d74ff){this['uniqueid']=_0x2d74ff[_0xbdb8('0x5')];this['scheduledat']=_0x2d74ff[_0xbdb8('0x6')];this[_0xbdb8('0x7')]=_0x2d74ff[_0xbdb8('0x7')];this[_0xbdb8('0x8')]=_0x2d74ff[_0xbdb8('0x7')]===_0xbdb8('0x9')?'queue':_0x2d74ff[_0xbdb8('0x7')];this[_0xbdb8('0xa')]=_0x2d74ff[_0xbdb8('0xa')];this[_0xbdb8('0xb')]=_0x2d74ff[_0xbdb8('0xb')];this[_0xbdb8('0xc')]=_0x2d74ff[_0xbdb8('0xc')];this['countglobal']=_0x2d74ff['countbusyretry']+_0x2d74ff[_0xbdb8('0xb')]+_0x2d74ff['countnoanswerretry'];this[_0xbdb8('0xd')]=_0x2d74ff['queue'];this[_0xbdb8('0xe')]=_0x2d74ff['calleridname'];this[_0xbdb8('0xf')]=_0x2d74ff[_0xbdb8('0xf')];this[_0xbdb8('0x10')]=_0x2d74ff[_0xbdb8('0x10')];this[_0xbdb8('0x11')]=_0x2d74ff[_0xbdb8('0x11')];this[_0xbdb8('0x12')]=_0x2d74ff[_0xbdb8('0x11')];this[_0xbdb8('0x13')]=_0x2d74ff[_0xbdb8('0x13')]||0x0;this[_0xbdb8('0x14')]=_0x2d74ff[_0xbdb8('0x14')]||0x0;this[_0xbdb8('0x15')]=_0x2d74ff['talktime']||0x0;this[_0xbdb8('0x16')]=_0x2d74ff[_0xbdb8('0x16')];this[_0xbdb8('0x17')]=_0x2d74ff['callbackuniqueid'];this['callbackat']=_0x2d74ff[_0xbdb8('0x18')];this['recallme']=_0x2d74ff[_0xbdb8('0x19')];this[_0xbdb8('0x1a')]=_0x2d74ff[_0xbdb8('0x1a')];this[_0xbdb8('0x1b')]=_0x2d74ff[_0xbdb8('0x1b')];this[_0xbdb8('0x1c')]=_0x2d74ff[_0xbdb8('0x1c')];this[_0xbdb8('0x1d')]=_0x2d74ff[_0xbdb8('0x1d')];this[_0xbdb8('0x1e')]=_0x2d74ff[_0xbdb8('0x1e')];this[_0xbdb8('0x1f')]=_0x2d74ff[_0xbdb8('0x1f')]||'';this[_0xbdb8('0x20')]=_0x2d74ff[_0xbdb8('0x20')]||'';}module[_0xbdb8('0x21')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 7d8d7b6..8a3b82f 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 _0xa9e0=['countglobal','countcongestionretry','countnoanswerretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','outbound','queue','countbusyretry'];(function(_0x5acfde,_0x3596d4){var _0x123d61=function(_0x1bcea9){while(--_0x1bcea9){_0x5acfde['push'](_0x5acfde['shift']());}};_0x123d61(++_0x3596d4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function getSeconds(_0x5dd881,_0x550fbc){var _0x18d5c9=moment(_0x5dd881)['milliseconds'](0x0);var _0x333808=moment(_0x550fbc)[_0x0a9e('0x3')](0x0);return _0x18d5c9[_0x0a9e('0x4')](_0x333808,_0x0a9e('0x5'));}function Hangup(_0x981158,_0x57b080){this[_0x0a9e('0x6')]=0x4;this[_0x0a9e('0x7')]=_0x0a9e('0x8');this['scheduledat']=_0x981158['scheduledat'];this[_0x0a9e('0x9')]=_0x981158['type'];this['campaigntype']=_0x981158[_0x0a9e('0x9')]===_0x0a9e('0xa')?_0x0a9e('0xb'):_0x981158[_0x0a9e('0x9')];this[_0x0a9e('0xc')]=_0x981158[_0x0a9e('0xc')];this['countcongestionretry']=_0x981158['countcongestionretry'];this['countnoanswerretry']=_0x981158['countnoanswerretry'];this[_0x0a9e('0xd')]=_0x981158[_0x0a9e('0xc')]+_0x981158[_0x0a9e('0xe')]+_0x981158[_0x0a9e('0xf')];this[_0x0a9e('0x10')]=_0x57b080[_0x0a9e('0x10')];this['calleridname']=_0x981158[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x981158[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x981158[_0x0a9e('0x14')];this[_0x0a9e('0x15')]=_0x981158['responsetime'];this[_0x0a9e('0x16')]=moment()['format'](_0x0a9e('0x17'));this['ringtime']=getSeconds(_0x981158[_0x0a9e('0x15')],_0x981158[_0x0a9e('0x14')]);this['holdtime']=0x0;this[_0x0a9e('0x18')]=getSeconds(this['endtime'],_0x981158[_0x0a9e('0x15')]);this[_0x0a9e('0xb')]=_0x981158[_0x0a9e('0xb')];this[_0x0a9e('0x19')]=_0x0a9e('0x1a');this[_0x0a9e('0x1b')]=_0x57b080[_0x0a9e('0x1c')];this[_0x0a9e('0x1d')]=_0x981158[_0x0a9e('0x1d')];this[_0x0a9e('0x1e')]=_0x981158[_0x0a9e('0x1e')];this[_0x0a9e('0x1f')]=_0x981158['callbackat'];this[_0x0a9e('0x20')]=_0x981158[_0x0a9e('0x20')];this['ContactId']=_0x981158[_0x0a9e('0x21')];this['ListId']=_0x981158['ListId'];this[_0x0a9e('0x22')]=_0x981158[_0x0a9e('0x22')];this[_0x0a9e('0x23')]=_0x981158[_0x0a9e('0x23')];this['CampaignId']=_0x981158[_0x0a9e('0x24')];}module[_0x0a9e('0x25')]=Hangup; \ No newline at end of file +var _0xa9e0=['countglobal','countcongestionretry','countnoanswerretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','outbound','queue','countbusyretry'];(function(_0xa7efd7,_0x45c885){var _0x572019=function(_0x569f2b){while(--_0x569f2b){_0xa7efd7['push'](_0xa7efd7['shift']());}};_0x572019(++_0x45c885);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function getSeconds(_0x5dd881,_0x550fbc){var _0x18d5c9=moment(_0x5dd881)['milliseconds'](0x0);var _0x333808=moment(_0x550fbc)[_0x0a9e('0x3')](0x0);return _0x18d5c9[_0x0a9e('0x4')](_0x333808,_0x0a9e('0x5'));}function Hangup(_0x981158,_0x57b080){this[_0x0a9e('0x6')]=0x4;this[_0x0a9e('0x7')]=_0x0a9e('0x8');this['scheduledat']=_0x981158['scheduledat'];this[_0x0a9e('0x9')]=_0x981158['type'];this['campaigntype']=_0x981158[_0x0a9e('0x9')]===_0x0a9e('0xa')?_0x0a9e('0xb'):_0x981158[_0x0a9e('0x9')];this[_0x0a9e('0xc')]=_0x981158[_0x0a9e('0xc')];this['countcongestionretry']=_0x981158['countcongestionretry'];this['countnoanswerretry']=_0x981158['countnoanswerretry'];this[_0x0a9e('0xd')]=_0x981158[_0x0a9e('0xc')]+_0x981158[_0x0a9e('0xe')]+_0x981158[_0x0a9e('0xf')];this[_0x0a9e('0x10')]=_0x57b080[_0x0a9e('0x10')];this['calleridname']=_0x981158[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x981158[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x981158[_0x0a9e('0x14')];this[_0x0a9e('0x15')]=_0x981158['responsetime'];this[_0x0a9e('0x16')]=moment()['format'](_0x0a9e('0x17'));this['ringtime']=getSeconds(_0x981158[_0x0a9e('0x15')],_0x981158[_0x0a9e('0x14')]);this['holdtime']=0x0;this[_0x0a9e('0x18')]=getSeconds(this['endtime'],_0x981158[_0x0a9e('0x15')]);this[_0x0a9e('0xb')]=_0x981158[_0x0a9e('0xb')];this[_0x0a9e('0x19')]=_0x0a9e('0x1a');this[_0x0a9e('0x1b')]=_0x57b080[_0x0a9e('0x1c')];this[_0x0a9e('0x1d')]=_0x981158[_0x0a9e('0x1d')];this[_0x0a9e('0x1e')]=_0x981158[_0x0a9e('0x1e')];this[_0x0a9e('0x1f')]=_0x981158['callbackat'];this[_0x0a9e('0x20')]=_0x981158[_0x0a9e('0x20')];this['ContactId']=_0x981158[_0x0a9e('0x21')];this['ListId']=_0x981158['ListId'];this[_0x0a9e('0x22')]=_0x981158[_0x0a9e('0x22')];this[_0x0a9e('0x23')]=_0x981158[_0x0a9e('0x23')];this['CampaignId']=_0x981158[_0x0a9e('0x24')];}module[_0x0a9e('0x25')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index a3afe9d..a0f43c8 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 _0x1e51=['countglobal','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1e51,0xe2));var _0x11e5=function(_0x2bcad4,_0x12aaab){_0x2bcad4=_0x2bcad4-0x0;var _0x1b825a=_0x1e51[_0x2bcad4];return _0x1b825a;};'use strict';var util=require('util');var _=require(_0x11e5('0x0'));var moment=require(_0x11e5('0x1'));function getSeconds(_0xe197d7,_0x867606){var _0x27a0de=moment(_0xe197d7)[_0x11e5('0x2')](0x0);var _0x5958e2=moment(_0x867606)[_0x11e5('0x2')](0x0);return _0x27a0de['diff'](_0x5958e2,'seconds');}function History(_0x3b3c42){this[_0x11e5('0x3')]=_0x3b3c42[_0x11e5('0x3')];this[_0x11e5('0x4')]=_0x3b3c42[_0x11e5('0x4')]||undefined;this[_0x11e5('0x5')]=_0x3b3c42[_0x11e5('0x5')];this[_0x11e5('0x6')]=_0x3b3c42[_0x11e5('0x5')]===_0x11e5('0x7')?_0x11e5('0x8'):_0x3b3c42[_0x11e5('0x5')];this[_0x11e5('0x9')]=_0x3b3c42[_0x11e5('0x9')];this[_0x11e5('0xa')]=_0x3b3c42[_0x11e5('0xa')];this['countnoanswerretry']=_0x3b3c42[_0x11e5('0xb')];this[_0x11e5('0xc')]=_0x3b3c42[_0x11e5('0x9')]+_0x3b3c42[_0x11e5('0xa')]+_0x3b3c42[_0x11e5('0xb')];this[_0x11e5('0x8')]=_0x3b3c42[_0x11e5('0x8')];this[_0x11e5('0xd')]=_0x3b3c42[_0x11e5('0xe')];this[_0x11e5('0xf')]=_0x3b3c42[_0x11e5('0x10')];this[_0x11e5('0x11')]=_0x3b3c42[_0x11e5('0x11')];this[_0x11e5('0x12')]=_0x3b3c42[_0x11e5('0x12')];this[_0x11e5('0x13')]=_0x3b3c42[_0x11e5('0x12')];this[_0x11e5('0x14')]=getSeconds(_0x3b3c42[_0x11e5('0x12')],_0x3b3c42[_0x11e5('0x11')]);this[_0x11e5('0x15')]=0x0;this[_0x11e5('0x16')]=0x0;this['callback']=_0x3b3c42[_0x11e5('0x17')];this[_0x11e5('0x18')]=_0x3b3c42[_0x11e5('0x18')];this['callbackat']=_0x3b3c42[_0x11e5('0x19')];this[_0x11e5('0x1a')]=_0x3b3c42[_0x11e5('0x1a')];this['ContactId']=_0x3b3c42[_0x11e5('0x1b')];this[_0x11e5('0x1c')]=_0x3b3c42[_0x11e5('0x1c')];this[_0x11e5('0x1d')]=_0x3b3c42[_0x11e5('0x1d')];this[_0x11e5('0x1e')]=_0x3b3c42[_0x11e5('0x1e')];this[_0x11e5('0x1f')]=_0x3b3c42['CampaignId'];this[_0x11e5('0x20')]=_0x3b3c42[_0x11e5('0x20')]||'';this[_0x11e5('0x21')]=_0x3b3c42[_0x11e5('0x21')]||'';}module['exports']=History; \ No newline at end of file +var _0x78a7=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','queue','calleridnum','number','responsetime','ringtime','starttime','holdtime','callback','callbackuniqueid'];(function(_0x21adb7,_0x57d056){var _0x5bc1a8=function(_0x4d6331){while(--_0x4d6331){_0x21adb7['push'](_0x21adb7['shift']());}};_0x5bc1a8(++_0x57d056);}(_0x78a7,0x13f));var _0x778a=function(_0x5a27fe,_0x43993b){_0x5a27fe=_0x5a27fe-0x0;var _0x121c88=_0x78a7[_0x5a27fe];return _0x121c88;};'use strict';var util=require(_0x778a('0x0'));var _=require(_0x778a('0x1'));var moment=require('moment');function getSeconds(_0x465208,_0x463ef4){var _0xa95fbb=moment(_0x465208)[_0x778a('0x2')](0x0);var _0x47bc79=moment(_0x463ef4)[_0x778a('0x2')](0x0);return _0xa95fbb[_0x778a('0x3')](_0x47bc79,_0x778a('0x4'));}function History(_0x300db8){this[_0x778a('0x5')]=_0x300db8[_0x778a('0x5')];this['scheduledat']=_0x300db8[_0x778a('0x6')]||undefined;this[_0x778a('0x7')]=_0x300db8[_0x778a('0x7')];this[_0x778a('0x8')]=_0x300db8[_0x778a('0x7')]==='outbound'?'queue':_0x300db8['type'];this['countbusyretry']=_0x300db8[_0x778a('0x9')];this[_0x778a('0xa')]=_0x300db8[_0x778a('0xa')];this[_0x778a('0xb')]=_0x300db8[_0x778a('0xb')];this[_0x778a('0xc')]=_0x300db8['countbusyretry']+_0x300db8[_0x778a('0xa')]+_0x300db8[_0x778a('0xb')];this[_0x778a('0xd')]=_0x300db8[_0x778a('0xd')];this['calleridname']=_0x300db8['name'];this[_0x778a('0xe')]=_0x300db8[_0x778a('0xf')];this['starttime']=_0x300db8['starttime'];this[_0x778a('0x10')]=_0x300db8[_0x778a('0x10')];this['endtime']=_0x300db8[_0x778a('0x10')];this[_0x778a('0x11')]=getSeconds(_0x300db8[_0x778a('0x10')],_0x300db8[_0x778a('0x12')]);this[_0x778a('0x13')]=0x0;this['talktime']=0x0;this['callback']=_0x300db8[_0x778a('0x14')];this[_0x778a('0x15')]=_0x300db8[_0x778a('0x15')];this[_0x778a('0x16')]=_0x300db8['callbackat'];this[_0x778a('0x17')]=_0x300db8['recallme'];this[_0x778a('0x18')]=_0x300db8[_0x778a('0x18')];this[_0x778a('0x19')]=_0x300db8[_0x778a('0x19')];this[_0x778a('0x1a')]=_0x300db8[_0x778a('0x1a')];this[_0x778a('0x1b')]=_0x300db8[_0x778a('0x1b')];this[_0x778a('0x1c')]=_0x300db8[_0x778a('0x1c')];this['originatecalleridnum']=_0x300db8[_0x778a('0x1d')]||'';this[_0x778a('0x1e')]=_0x300db8['originatecalleridname']||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 20a15f1..061106f 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 _0xc7eb=['syncQueueCallerAbandon','droptime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','predictiveIntervalDroppedCallsCallersExit','Abandoned','dropreason','CALLEREXIT','actionid','locked','stateinterface','pick','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Timezone\x20unknow\x20','isArray','push','command','interval','timezones','indexOf','true','iftime\x20%s,%s','content','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','progressive','handlePower','power','dialPowerLevel','booked','Queue','method\x20not\x20recognized','launchHandleIvr','syncQueueSummary','dialActive','dialTimezone','\x5cw{0,','pow','random','match','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','NONE','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','OriginateError','starttime','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','responsetime','getQueue','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','[syncAgentComplete][createHistory][0]','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','busyFactor','[handlePredictive]','fail\x20to\x20scheduled\x20calls','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','Contact.phone','checkContactBlack','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','[actionOriginate]\x20','tryOriginatePredictive','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','util','lodash','bluebird','moment','ioredis','../../../config/environment/','../../../config/logger','dialer','predictive','../ami','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startProgressive','queueBooked','syncAgentConnect','bind','queuecallerabandon','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','type','unmanaged','abandoned','loggedInDb','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','md5','voice:queue:%s','voice_queue:save','ivr','campaign:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\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','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\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\x20predictive','handlePredictive','preview','string','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','error','inspect','stack','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','waiting','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','clearZombieChannels','uniqueId','[uniqueid]','[actions]','sequence','enqueue','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','saveInDb','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','uniqueid','variable','amdstatus','xcally-motion-dialer','dialAMDActive','outboundAnswerAgiCallsDay','HangupInAMD','AMD','value','Machine','amd','[syncMachine][createHistory]','[syncMachine]','HANGUP','membername','[syncHangupInAMDIvr][createHistory]','[syncMachineIvr][createHistory]','[syncMachineIvr]','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xc7eb,0xf5));var _0xbc7e=function(_0x358806,_0x322b66){_0x358806=_0x358806-0x0;var _0x19fdcb=_0xc7eb[_0x358806];return _0x19fdcb;};'use strict';var util=require(_0xbc7e('0x0'));var _=require(_0xbc7e('0x1'));var BPromise=require(_0xbc7e('0x2'));var uuid=require('uuid');var moment=require(_0xbc7e('0x3'));var rr=require('rr');var md5=require('md5');var Redis=require(_0xbc7e('0x4'));var config=require(_0xbc7e('0x5'));var logger=require(_0xbc7e('0x6'))(_0xbc7e('0x7'));var loggerBooked=require(_0xbc7e('0x6'))('booked');var loggerPredictive=require(_0xbc7e('0x6'))(_0xbc7e('0x8'));var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require(_0xbc7e('0x6'))('syncQueueSummary');var ami=require(_0xbc7e('0x9'));config['redis']=_[_0xbc7e('0xa')](config[_0xbc7e('0xb')],{'host':_0xbc7e('0xc'),'port':0x18eb});var io=require(_0xbc7e('0xd'))(new Redis(config['redis']));var cmHopper=require(_0xbc7e('0xe'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xbc7e('0xf'));var Action=require('./action');var History=require('./history');var Final=require('./final');var AgentComplete=require(_0xbc7e('0x10'));var QueueCallerAbandon=require(_0xbc7e('0x11'));var Hangup=require(_0xbc7e('0x12'));var ipAgi=process[_0xbc7e('0x13')][_0xbc7e('0x14')]||_0xbc7e('0x15');var strategy={'rrmemory':_0xbc7e('0x16'),'roundrobin':_0xbc7e('0x17')};var Sequence=function(){};Sequence[_0xbc7e('0x18')]['enqueue']=function(_0x3a4ded){this['tail']=this[_0xbc7e('0x19')]?this[_0xbc7e('0x19')][_0xbc7e('0x1a')](_0x3a4ded):_0x3a4ded();};function Dialer(_0x294bde,_0x197ee2){this['sequence']=new Sequence();this['preview']=_0x197ee2;this[_0xbc7e('0x1b')]=_0x294bde['voiceQueues'];this[_0xbc7e('0x1c')]=_0x294bde[_0xbc7e('0x1c')];this['agents']=_0x294bde[_0xbc7e('0x1d')];this['trunks']=_0x294bde[_0xbc7e('0x1e')];this[_0xbc7e('0x1f')]=config[_0xbc7e('0x1f')]||0x2;this[_0xbc7e('0x20')]={};this[_0xbc7e('0x21')]={};this[_0xbc7e('0x22')]={};this['uniqueId']={};this[_0xbc7e('0x23')]={};this['startPredictive']={};this[_0xbc7e('0x24')]={};this['ivrOriginated']={};this[_0xbc7e('0x25')]={};this['queueBookedRR']={};ami['on']('agentconnect',this[_0xbc7e('0x26')][_0xbc7e('0x27')](this));ami['on'](_0xbc7e('0x28'),this['syncQueueCallerAbandon'][_0xbc7e('0x27')](this));ami['on'](_0xbc7e('0x29'),this['syncOriginateResponse'][_0xbc7e('0x27')](this));ami['on'](_0xbc7e('0x2a'),this[_0xbc7e('0x2b')][_0xbc7e('0x27')](this));ami['on'](_0xbc7e('0x2c'),this['syncQueueSummary']['bind'](this));ami['on']('hangup',this[_0xbc7e('0x2d')][_0xbc7e('0x27')](this));ami['on'](_0xbc7e('0x2e'),this[_0xbc7e('0x2f')][_0xbc7e('0x27')](this));ami['on'](_0xbc7e('0x30'),this[_0xbc7e('0x31')][_0xbc7e('0x27')](this));ami['on'](_0xbc7e('0x32'),this[_0xbc7e('0x33')][_0xbc7e('0x27')](this));ami['on'](_0xbc7e('0x34'),this[_0xbc7e('0x35')]['bind'](this));this[_0xbc7e('0x36')]();this[_0xbc7e('0x37')]();}function isNotNull(_0x24f6b3){return _0x24f6b3!==null&&!_[_0xbc7e('0x38')](_0x24f6b3);}function checkIsLoggedIn(_0x328333,_0x2b91a6){return function(){if(_0x2b91a6<=0x0){_0x328333[_0xbc7e('0x39')]=_0xbc7e('0x3a');throw _0x328333[_0xbc7e('0x3b')]+_0xbc7e('0x3c');}};}function isActive(_0x21bd98){return _0x21bd98;}function checkIsActive(_0x42299e,_0x26c1cd){return function(){if(!isActive(_0x26c1cd)){_0x42299e['message']=_0xbc7e('0x3d');throw _0x42299e[_0xbc7e('0x3b')]+_0xbc7e('0x3e');}};}function checkInterval(_0x2f452f){return function(){if(!isNotNull(_0x2f452f['Interval'])){_0x2f452f[_0xbc7e('0x39')]=_0xbc7e('0x3f');throw _0x2f452f[_0xbc7e('0x3b')]+_0xbc7e('0x40');}if(!isNotNull(_0x2f452f[_0xbc7e('0x41')][_0xbc7e('0x42')])){_0x2f452f[_0xbc7e('0x39')]=_0xbc7e('0x3f');throw _0x2f452f['name']+_0xbc7e('0x40');}if(!isNotNull(_[_0xbc7e('0x43')](_0x2f452f[_0xbc7e('0x41')][_0xbc7e('0x42')]))){_0x2f452f[_0xbc7e('0x39')]=_0xbc7e('0x3f');throw _0x2f452f[_0xbc7e('0x3b')]+_0xbc7e('0x40');}};}function msgResponse(_0x2c1f65,_0x2ec7df,_0x2eb34b){return{'action':_0x2c1f65,'response':_0x2ec7df,'message':_0x2eb34b,'stack':_0x2eb34b};}function myreject(_0x19d66e){return function(_0x1e4053){return _0x19d66e(msgResponse(_0xbc7e('0x44'),_0xbc7e('0x45'),JSON[_0xbc7e('0x46')](_0x1e4053)));};}function getSeconds(_0x44b65b,_0x327c82){var _0x30c4aa=moment(_0x44b65b)[_0xbc7e('0x47')](0x0);var _0x519ff4=moment(_0x327c82)[_0xbc7e('0x47')](0x0);return _0x30c4aa[_0xbc7e('0x48')](_0x519ff4,_0xbc7e('0x49'));}function emit(_0x182643,_0x3d5417,_0x1fc347){io['to'](_0x182643)[_0xbc7e('0x4a')](_0x3d5417,_0x1fc347);}function emitVoiceQueueSummary(_0x3cb4bd){if(_0x3cb4bd['type']===_0xbc7e('0x4b')){var _0x1ceadf={'id':_0x3cb4bd['id'],'name':_0x3cb4bd[_0xbc7e('0x3b')],'strategy':_0x3cb4bd[_0xbc7e('0x4c')],'answered':_0x3cb4bd[_0xbc7e('0x4d')],'available':_0x3cb4bd[_0xbc7e('0x4e')],'loggedIn':_0x3cb4bd[_0xbc7e('0x4f')],'pTalking':_0x3cb4bd[_0xbc7e('0x50')],'sumBillable':_0x3cb4bd[_0xbc7e('0x51')],'sumDuration':_0x3cb4bd['sumDuration'],'sumHoldTime':_0x3cb4bd[_0xbc7e('0x52')]||0x0,'talking':_0x3cb4bd[_0xbc7e('0x53')],'total':_0x3cb4bd['total'],'type':_0x3cb4bd[_0xbc7e('0x54')],'unmanaged':_0x3cb4bd[_0xbc7e('0x55')],'abandoned':_0x3cb4bd[_0xbc7e('0x56')],'waiting':_0x3cb4bd['waiting'],'loggedInDb':_0x3cb4bd[_0xbc7e('0x57')],'dialActive':_0x3cb4bd['dialActive'],'dialMethod':_0x3cb4bd[_0xbc7e('0x58')],'dialOriginateCallerIdName':_0x3cb4bd['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x3cb4bd[_0xbc7e('0x59')],'dialOriginateTimeout':_0x3cb4bd[_0xbc7e('0x5a')],'dialPrefix':_0x3cb4bd['dialPrefix'],'outboundAnswerAgiCallsDay':_0x3cb4bd['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x3cb4bd[_0xbc7e('0x5b')],'outboundBlacklistCallsDay':_0x3cb4bd['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x3cb4bd[_0xbc7e('0x5c')],'outboundCongestionCallsDay':_0x3cb4bd['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x3cb4bd['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x3cb4bd[_0xbc7e('0x5d')],'outboundDropCallsDayTimeout':_0x3cb4bd[_0xbc7e('0x5e')],'outboundNoAnswerCallsDay':_0x3cb4bd[_0xbc7e('0x5f')],'outboundNoSuchCallsDay':_0x3cb4bd[_0xbc7e('0x60')],'outboundOriginateFailureCallsDay':_0x3cb4bd[_0xbc7e('0x61')],'outboundReCallsDay':_0x3cb4bd[_0xbc7e('0x62')],'outboundRejectCallsDay':_0x3cb4bd['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x3cb4bd[_0xbc7e('0x63')],'predictiveIntervalAnsweredCalls':_0x3cb4bd['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x3cb4bd['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x3cb4bd[_0xbc7e('0x64')],'predictiveIntervalDroppedCallsCallersExit':_0x3cb4bd['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x3cb4bd[_0xbc7e('0x65')],'predictiveIntervalErlangCalls':_0x3cb4bd['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x3cb4bd['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x3cb4bd[_0xbc7e('0x66')],'predictiveIntervalMultiplicativeFactor':_0x3cb4bd[_0xbc7e('0x67')],'predictiveIntervalPauses':_0x3cb4bd[_0xbc7e('0x68')],'predictiveIntervalAvailable':_0x3cb4bd[_0xbc7e('0x69')],'predictiveIntervalTotalCalls':_0x3cb4bd[_0xbc7e('0x6a')],'message':_0x3cb4bd[_0xbc7e('0x39')],'originated':_0x3cb4bd[_0xbc7e('0x6b')],'erlangCalls':_0x3cb4bd[_0xbc7e('0x6c')],'erlangCallToSecond':_0x3cb4bd[_0xbc7e('0x6d')],'erlangAbandonmentRate':_0x3cb4bd[_0xbc7e('0x6e')],'erlangBusyFactor':_0x3cb4bd[_0xbc7e('0x6f')],'startPredictive':_0x3cb4bd[_0xbc7e('0x70')],'startProgressive':_0x3cb4bd[_0xbc7e('0x24')]};if(_0x3cb4bd[_0xbc7e('0x71')]){_0x1ceadf[_0xbc7e('0x71')]={'id':_0x3cb4bd['Trunk']['id'],'name':_0x3cb4bd['Trunk'][_0xbc7e('0x3b')],'active':_0x3cb4bd[_0xbc7e('0x71')][_0xbc7e('0x72')],'callerid':_0x3cb4bd[_0xbc7e('0x71')][_0xbc7e('0x73')]};}if(_0x3cb4bd[_0xbc7e('0x41')]){_0x1ceadf[_0xbc7e('0x41')]={'id':_0x3cb4bd[_0xbc7e('0x41')]['id'],'name':_0x3cb4bd[_0xbc7e('0x41')][_0xbc7e('0x3b')]};}var _0x414f89=md5(JSON[_0xbc7e('0x46')](_0x1ceadf));if(_0x3cb4bd[_0xbc7e('0x74')]!==_0x414f89){_0x3cb4bd[_0xbc7e('0x74')]=_0x414f89;emit(util['format'](_0xbc7e('0x75'),_0x1ceadf[_0xbc7e('0x3b')]),_0xbc7e('0x76'),_0x1ceadf);}}}function emitCampaignSummary(_0x48fc0b){if(_0x48fc0b[_0xbc7e('0x54')]===_0xbc7e('0x77')){emit(util['format']('campaign:ivr:%s',_0x48fc0b[_0xbc7e('0x3b')]),_0xbc7e('0x78'),_0x48fc0b);}}function checkGetDataPredictive(_0x416e45){if(isNotNull(_0x416e45)){if(!_[_0xbc7e('0x43')](_0x416e45)){loggerPredictive[_0xbc7e('0x79')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0xbc7e('0x79')](_0xbc7e('0x7a'),_0x416e45[_0xbc7e('0x6a')]);loggerPredictive[_0xbc7e('0x79')](_0xbc7e('0x7b'),_0x416e45[_0xbc7e('0x7c')]);loggerPredictive[_0xbc7e('0x79')](_0xbc7e('0x7d'),_0x416e45[_0xbc7e('0x65')]);loggerPredictive[_0xbc7e('0x79')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x416e45['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xbc7e('0x79')](_0xbc7e('0x7e'),_0x416e45[_0xbc7e('0x7f')]);loggerPredictive['info'](_0xbc7e('0x80'),_0x416e45[_0xbc7e('0x64')]);loggerPredictive['info'](_0xbc7e('0x81'));if(_0x416e45['predictiveIntervalTotalCalls']>0x0){if(!_[_0xbc7e('0x38')](_0x416e45['predictiveIntervalAvgTalktime'])&&_0x416e45[_0xbc7e('0x64')]>0x0){return!![];}else{loggerPredictive[_0xbc7e('0x79')](_0xbc7e('0x82'));}if(!_[_0xbc7e('0x38')](_0x416e45[_0xbc7e('0x7f')])&&_0x416e45[_0xbc7e('0x7f')]>0x0){return!![];}else{loggerPredictive[_0xbc7e('0x79')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xbc7e('0x79')](_0xbc7e('0x83'));}}else{loggerPredictive[_0xbc7e('0x79')](_0xbc7e('0x84'));}}else{loggerPredictive[_0xbc7e('0x79')](_0xbc7e('0x84'));}return![];}function mergeDataErlangB(_0x1ade8d){return function(_0x2a0c89){loggerPredictive[_0xbc7e('0x79')]('---------\x20ErlangB\x20---------');loggerPredictive['info'](_0xbc7e('0x85'),_0x2a0c89[_0xbc7e('0x6c')]);loggerPredictive[_0xbc7e('0x79')](_0xbc7e('0x86'),_0x2a0c89[_0xbc7e('0x6d')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2a0c89[_0xbc7e('0x6e')]);loggerPredictive['info'](_0xbc7e('0x87'),_0x2a0c89[_0xbc7e('0x6f')]);loggerPredictive[_0xbc7e('0x79')](_0xbc7e('0x88'),_0x2a0c89[_0xbc7e('0x6e')]);loggerPredictive[_0xbc7e('0x79')](_0xbc7e('0x81'));_[_0xbc7e('0x89')](_0x1ade8d,_0x2a0c89);};}function getDiff(_0x34c25b){var _0x59ff17=moment()[_0xbc7e('0x47')](0x0);var _0x1023bc=moment(_0x34c25b)[_0xbc7e('0x47')](0x0);return _0x59ff17[_0xbc7e('0x48')](_0x1023bc,_0xbc7e('0x49'));}function ifInterval(_0x48f143,_0x160cf1){if(_[_0xbc7e('0x38')](_0x160cf1)){return![];}if(getDiff(_0x160cf1)<_0x48f143*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x587edf){if(isNotNull(_0x587edf)){if(!_[_0xbc7e('0x38')](_0x587edf['startProgressive'])){_0x587edf[_0xbc7e('0x24')]=undefined;loggerPredictive[_0xbc7e('0x79')](_0x587edf['name'],'clearing\x20variable\x20start\x20progressive');}if(!_['isUndefined'](_0x587edf[_0xbc7e('0x70')])){_0x587edf[_0xbc7e('0x70')]=undefined;loggerPredictive[_0xbc7e('0x79')](_0x587edf['name'],_0xbc7e('0x8a'));}if(!_['isUndefined'](_0x587edf[_0xbc7e('0x8b')])){clearInterval(_0x587edf[_0xbc7e('0x8b')]);_0x587edf[_0xbc7e('0x8b')]=undefined;loggerPredictive[_0xbc7e('0x79')](_0x587edf[_0xbc7e('0x3b')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x1e9567,_0xd61ca2){if(_0xd61ca2===0x0){return 0x0;}var _0x3adf87=0x1;for(var _0x4c9e3d=0x1;_0x4c9e3d<=_0xd61ca2;_0x4c9e3d+=0x1){_0x3adf87=0x1+_0x3adf87*_0x4c9e3d/_0x1e9567;}return 0x1/_0x3adf87;}function isVoiceQueueOutbound(_0x16efbb){return _0x16efbb===_0xbc7e('0x4b');}function isNotPreview(_0x506299){return _0x506299!==_0xbc7e('0x8c');}function isCampaignIvr(_0x1ecc15){return _0x1ecc15===_0xbc7e('0x77');}function getCallerId(_0x4ffe3d,_0x4adcc7,_0x38f00a){if(!_[_0xbc7e('0x38')](_0x38f00a)&&'string'===typeof _0x38f00a&&!_[_0xbc7e('0x43')](_0x38f00a)){if(!_[_0xbc7e('0x38')](_0x4adcc7)&&_0xbc7e('0x8d')===typeof _0x4adcc7&&!_[_0xbc7e('0x43')](_0x4adcc7)){return util['format'](_0xbc7e('0x8e'),_0x4adcc7,_0x38f00a);}return util[_0xbc7e('0x8f')](_0xbc7e('0x8e'),_0x38f00a,_0x38f00a);}if(!_['isUndefined'](_0x4ffe3d)&&_0xbc7e('0x8d')===typeof _0x4ffe3d&&!_['isEmpty'](_0x4ffe3d)){return _0x4ffe3d;}return _0xbc7e('0x90');}function loggerCatchQueueSummary(_0x5b5c7e,_0x2e93b1){return function(_0x38933e){freeVariablesPredictive(_0x2e93b1);emitVoiceQueueSummary(_0x2e93b1);emitCampaignSummary(_0x2e93b1);loggerSyncQueueSummary[_0xbc7e('0x91')](_0x5b5c7e,util[_0xbc7e('0x92')](_0x38933e,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x58337a,_0x1a79dd){return function(_0x41b1a0){loggerPredictive[_0xbc7e('0x91')](_0x1a79dd[_0xbc7e('0x3b')],_0x58337a);loggerPredictive[_0xbc7e('0x91')](_0x41b1a0[_0xbc7e('0x93')]);freeVariablesPredictive(_0x1a79dd);};}function loggerCatch(_0x390852){return function(_0x2ce546){logger['error'](_0x390852,util[_0xbc7e('0x92')](_0x2ce546,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x1c544e){return _0x1c544e&&!_[_0xbc7e('0x38')](_0x1c544e)&&_0x1c544e[_0xbc7e('0x94')]>0x0;}function decremetOriginate(_0x419e00){if(!_['isUndefined'](_0x419e00)&&_0x419e00!==null){if(_0x419e00[_0xbc7e('0x95')](_0xbc7e('0x6b'))){if(_0x419e00[_0xbc7e('0x6b')]>0x0){_0x419e00[_0xbc7e('0x6b')]-=0x1;}else{logger['error'](_0xbc7e('0x96'));}}}else{logger[_0xbc7e('0x91')](_0xbc7e('0x97'));}}function checkContactLowerLimitOriginate(_0x1503f1,_0x5ec9a0,_0x26287d){if(_0x5ec9a0>_0x26287d){for(var _0x431478=0x0;_0x431478<_0x5ec9a0-_0x26287d;_0x431478+=0x1){decremetOriginate(_0x1503f1);}}}function loggerGetContactDialer(_0x31d755,_0x4c5a69,_0x3da7be){return function(_0x1b20d5){checkContactLowerLimitOriginate(_0x4c5a69,_0x3da7be,0x0);logger[_0xbc7e('0x91')](_0x31d755,util['inspect'](_0x1b20d5,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x43dbb2){return function(_0x4e5183){if(isNotNull(_0x4e5183)&&isNotNull(_0x4e5183[0x0])){if(_0x4e5183[0x0][_0xbc7e('0x98')]>0x0){_0x43dbb2[_0xbc7e('0x39')]='RESCHEDULED_CONTACTS';logger[_0xbc7e('0x79')]('[getContactDialer2][ReScheduled]'+_0x43dbb2[_0xbc7e('0x3b')],_0x4e5183[0x0]['contactsRescheduled'],_0xbc7e('0x99'));}else{_0x43dbb2['message']=_0xbc7e('0x9a');logger['info'](_0xbc7e('0x9b')+_0x43dbb2[_0xbc7e('0x3b')]);}}};}function notSendMessagesQueue(_0x4105ac){if(_0x4105ac[_0xbc7e('0x9c')]){freeVariablesPredictive(_0x4105ac);if(_0x4105ac[_0xbc7e('0x6b')]===0x0&&_0x4105ac['talking']===0x0&&_0x4105ac[_0xbc7e('0x9d')]===0x0&&(_0x4105ac[_0xbc7e('0x50')]||0x0)===0x0){_0x4105ac[_0xbc7e('0x9c')]=![];_0x4105ac['available']=0x0;_0x4105ac[_0xbc7e('0x39')]='NOT_ACTIVE';loggerSyncQueueSummary['error'](_0xbc7e('0x9e'),_0x4105ac[_0xbc7e('0x3b')],_0xbc7e('0x9f'));}else{_0x4105ac[_0xbc7e('0x39')]=_0xbc7e('0xa0');loggerSyncQueueSummary['error'](_0xbc7e('0x9e'),_0x4105ac[_0xbc7e('0x3b')],_0xbc7e('0xa1'));}emitVoiceQueueSummary(_0x4105ac);}}function notSendMessagesCampaign(_0x250eb8){if(_0x250eb8[_0xbc7e('0x9c')]){if(_0x250eb8[_0xbc7e('0x6b')]===0x0){_0x250eb8['sendMessageOneNotActive']=![];_0x250eb8['message']=_0xbc7e('0x3d');loggerSyncQueueSummary[_0xbc7e('0x91')](_0xbc7e('0xa2'),_0x250eb8[_0xbc7e('0x3b')],_0xbc7e('0x9f'));}else{_0x250eb8[_0xbc7e('0x39')]=_0xbc7e('0xa0');loggerSyncQueueSummary['error'](_0xbc7e('0xa2'),_0x250eb8[_0xbc7e('0x3b')],'is\x20disactive');}emitCampaignSummary(_0x250eb8);}}function createObjHistory(_0x3a339a,_0x3fa8d0,_0x1e2100,_0x54c45f,_0x35e6d3){_0x3a339a[_0xbc7e('0x39')]=_0x1e2100;var _0x1e3579=new Action(_0x3a339a,_0x3fa8d0);var _0x210edf=new History(_0x1e3579);_0x210edf[_0xbc7e('0xa3')]=_0x54c45f;_0x210edf[_0xbc7e('0xa4')]=_0x35e6d3;_0x210edf[_0xbc7e('0xa5')]=_0x1e3579['starttime'];return _0x210edf;}Dialer['prototype'][_0xbc7e('0x37')]=function(){var _0x3f3cb0=this;setInterval(function(){_0x3f3cb0[_0xbc7e('0xa6')](_0x3f3cb0[_0xbc7e('0xa7')],_0xbc7e('0xa8'));_0x3f3cb0[_0xbc7e('0xa6')](_0x3f3cb0[_0xbc7e('0x21')],_0xbc7e('0xa9'));},0x32c8);};Dialer['prototype']['clearZombieChannels']=function(_0x3d79db,_0x5ee474){var _0x28b8c9=this;for(var _0x8ebc1b in _0x3d79db){if(_0x3d79db[_0xbc7e('0x95')](_0x8ebc1b)){this[_0xbc7e('0xaa')][_0xbc7e('0xab')](function(){if(!_[_0xbc7e('0xac')](_0x3d79db[_0x8ebc1b])){return ami[_0xbc7e('0xad')]({'action':_0xbc7e('0xae'),'channel':_0x3d79db[_0x8ebc1b][_0xbc7e('0xaf')]})[_0xbc7e('0xb0')](function(_0x12e59c){if(_0x12e59c[_0xbc7e('0x39')]===_0xbc7e('0xb1')){setTimeout(function(){if(_0x3d79db[_0x8ebc1b]&&_0x3d79db[_0x8ebc1b][_0xbc7e('0x54')]!==_0xbc7e('0x77')){_0x28b8c9[_0xbc7e('0xb2')](_0x28b8c9[_0xbc7e('0x1b')][_0x3d79db[_0x8ebc1b]['queue']]);logger[_0xbc7e('0x91')](_0xbc7e('0xb3'),_0x5ee474,_0x8ebc1b,_0x3d79db[_0x8ebc1b][_0xbc7e('0xb4')]);delete _0x3d79db[_0x8ebc1b];}if(_0x3d79db[_0x8ebc1b]&&_0x3d79db[_0x8ebc1b][_0xbc7e('0x54')]===_0xbc7e('0x77')){_0x28b8c9[_0xbc7e('0xb2')](_0x28b8c9[_0xbc7e('0x1c')][_0x3d79db[_0x8ebc1b][_0xbc7e('0xb4')]]);logger[_0xbc7e('0x91')](_0xbc7e('0xb5'),_0x5ee474,_0x8ebc1b,_0x3d79db[_0x8ebc1b][_0xbc7e('0xb4')]);delete _0x3d79db[_0x8ebc1b];}},0x2328);}});}});}}};Dialer[_0xbc7e('0x18')][_0xbc7e('0xb6')]=function(_0x48da6f){return BPromise[_0xbc7e('0xb7')]()[_0xbc7e('0xb8')](cmHopper['countReScheduled'](_0x48da6f))['catch'](loggerCatch(_0xbc7e('0xb9')));};Dialer['prototype'][_0xbc7e('0xba')]=function(_0x569f76){return BPromise[_0xbc7e('0xb7')]()[_0xbc7e('0xb8')](cmHopperBlack['checkIsBlackList'](_0x569f76))[_0xbc7e('0xb0')](loggerCatch(_0xbc7e('0xbb')));};Dialer[_0xbc7e('0x18')][_0xbc7e('0xbc')]=function(_0x403b28){return BPromise[_0xbc7e('0xb7')]()['then'](cmHopperBlack[_0xbc7e('0xbc')](_0x403b28))[_0xbc7e('0xb0')](loggerCatch(_0xbc7e('0xbd')));};Dialer[_0xbc7e('0x18')][_0xbc7e('0xbe')]=function(_0x3473b6){return BPromise[_0xbc7e('0xb7')]()[_0xbc7e('0xb8')](cmHopperHistory[_0xbc7e('0xbf')](_0x3473b6))[_0xbc7e('0xb0')](loggerCatch(_0xbc7e('0xc0')));};Dialer['prototype']['rescheduleContact']=function(_0x484e61){return BPromise['resolve']()['then'](cmHopper[_0xbc7e('0xc1')](_0x484e61))[_0xbc7e('0xb0')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0xbc7e('0x18')]['getContactDialer']=function(_0x1c22e8,_0x18e3a3,_0x4f5e34,_0x44ccad){return BPromise['resolve']()[_0xbc7e('0xb8')](cmHopper['getContactDialer'](_0x1c22e8,_0x18e3a3,_0x4f5e34,_0x44ccad))[_0xbc7e('0xb0')](loggerCatch(_0xbc7e('0xc2')));};Dialer[_0xbc7e('0x18')][_0xbc7e('0xc3')]=function(_0x5b67f7,_0x3dde8d,_0x2379d0){return BPromise[_0xbc7e('0xb7')]()[_0xbc7e('0xb8')](cmHopper[_0xbc7e('0xc3')](_0x5b67f7,_0x3dde8d,_0x2379d0))['catch'](loggerCatch('[getContactDialer]\x20'));};Dialer[_0xbc7e('0x18')]['getVoiceQueueRtPauses']=function(_0x34b3e2){return BPromise[_0xbc7e('0xb7')]()['then'](voiceQueueRt[_0xbc7e('0xc4')](_0x34b3e2))[_0xbc7e('0xb0')](loggerCatch(_0xbc7e('0xc5')));};Dialer[_0xbc7e('0x18')][_0xbc7e('0xc6')]=function(_0x20655d){return BPromise[_0xbc7e('0xb7')]()[_0xbc7e('0xb8')](cmHopper[_0xbc7e('0xc6')](_0x20655d))[_0xbc7e('0xb0')](loggerCatch(_0xbc7e('0xc7')));};Dialer[_0xbc7e('0x18')][_0xbc7e('0xc8')]=function(_0x468a13){return BPromise[_0xbc7e('0xb7')]()['then'](cmHopperHistory['createHistory'](_0x468a13))[_0xbc7e('0xb0')](loggerCatch(_0xbc7e('0xc9')));};Dialer['prototype'][_0xbc7e('0xb2')]=function(_0x440c87){if(!_[_0xbc7e('0x38')](_0x440c87)&&_0x440c87!==null){if(_0x440c87[_0xbc7e('0x95')]('originated')){if(_0x440c87[_0xbc7e('0x6b')]>0x0){_0x440c87[_0xbc7e('0x6b')]-=0x1;}else{logger[_0xbc7e('0x91')](_0xbc7e('0xca'));}}}else{logger[_0xbc7e('0x91')](_0xbc7e('0xcb'));}};Dialer[_0xbc7e('0x18')]['loggerHandler']=function(_0xbec3d9,_0x176c9b){var _0x232cc4=this;return function(_0x39627e){_0x232cc4[_0xbc7e('0xb2')](_0x176c9b);logger[_0xbc7e('0x91')](_0xbec3d9,util['inspect'](_0x39627e,{'showHidden':![],'depth':null}));};};Dialer[_0xbc7e('0x18')][_0xbc7e('0xcc')]=function(_0x202f0b,_0x569bb0,_0x98f171){var _0x22af24={'state':0x19,'statedesc':_0xbc7e('0xcd')};this[_0xbc7e('0xb2')](_0x569bb0);this[_0xbc7e('0xce')](_[_0xbc7e('0x89')](_0x22af24,_['pick'](_0x98f171,[_0xbc7e('0xcf'),_0xbc7e('0xd0'),_0xbc7e('0xd1'),_0xbc7e('0xd2'),_0xbc7e('0xd3')])),_0xbc7e('0xd4'),_0xbc7e('0xd5'));logger['error'](_0x202f0b);};Dialer['prototype'][_0xbc7e('0xd6')]=function(_0x2da6b9){return _0x2da6b9===_0xbc7e('0xd7');};Dialer[_0xbc7e('0x18')][_0xbc7e('0xd8')]=function(_0x1c97ba){return!_['isUndefined'](_0x1c97ba)&&_0x1c97ba&&!_['isUndefined'](_0x1c97ba[_0xbc7e('0x3b')])&&!_['isUndefined'](_0x1c97ba[_0xbc7e('0x72')])&&_0x1c97ba['active']&&(this[_0xbc7e('0x1e')][util[_0xbc7e('0x8f')](_0xbc7e('0xd9'),_0x1c97ba[_0xbc7e('0x3b')])][_0xbc7e('0xae')]===_0xbc7e('0xda')||this[_0xbc7e('0x1e')][util['format'](_0xbc7e('0xd9'),_0x1c97ba[_0xbc7e('0x3b')])][_0xbc7e('0xae')]===_0xbc7e('0xdb'));};Dialer[_0xbc7e('0x18')]['saveInDb']=function(_0x5100ab,_0xe2f713,_0xf10ecb){this[_0xbc7e('0xc8')](_0x5100ab)[_0xbc7e('0xb0')](loggerCatch(_0xe2f713));this[_0xbc7e('0xc6')](_0x5100ab)['catch'](loggerCatch(_0xf10ecb));};Dialer[_0xbc7e('0x18')][_0xbc7e('0x31')]=function(_0xaae661){var _0x331520=this[_0xbc7e('0xa7')][_0xaae661[_0xbc7e('0xdc')]];var _0x12c573;if(!_[_0xbc7e('0xac')](_0xaae661)&&!_[_0xbc7e('0xac')](_0xaae661[_0xbc7e('0xdd')])&&!_[_0xbc7e('0xac')](_0xaae661[_0xbc7e('0xdd')][_0xbc7e('0xde')])&&_0xaae661['exten']===_0xbc7e('0xdf')&&_0x331520){if(_0x331520[_0xbc7e('0x54')]!==_0xbc7e('0x77')&&this[_0xbc7e('0x1b')][_0x331520['queue']][_0xbc7e('0xe0')]&&_0xaae661['value']==='HANGUP'){delete this['uniqueId'][_0xaae661[_0xbc7e('0xdc')]];this['updateOriginated'](this[_0xbc7e('0x1b')][_0x331520[_0xbc7e('0xb4')]]);this['voiceQueues'][_0x331520[_0xbc7e('0xb4')]][_0xbc7e('0x5b')]+=0x1;this[_0xbc7e('0x1b')][_0x331520[_0xbc7e('0xb4')]][_0xbc7e('0xe1')]+=0x1;_0x12c573=new Hangup(_0x331520,_0xaae661);_0x12c573['state']=0x12;_0x12c573['statedesc']=_0xbc7e('0xe2');_0x12c573['membername']=_0xbc7e('0xe3');this['saveInDb'](_0x12c573,'[syncHangupInAMD][createHistory]','[syncHangupInAMD]');}if(_0x331520[_0xbc7e('0x54')]!==_0xbc7e('0x77')&&this['voiceQueues'][_0x331520[_0xbc7e('0xb4')]]['dialAMDActive']&&_0xaae661[_0xbc7e('0xe4')]==='MACHINE'){delete this[_0xbc7e('0xa7')][_0xaae661[_0xbc7e('0xdc')]];this[_0xbc7e('0xb2')](this[_0xbc7e('0x1b')][_0x331520[_0xbc7e('0xb4')]]);this[_0xbc7e('0x1b')][_0x331520['queue']][_0xbc7e('0x5b')]+=0x1;this[_0xbc7e('0x1b')][_0x331520[_0xbc7e('0xb4')]]['outboundAnswerAgiCallsDay']+=0x1;_0x12c573=new Hangup(_0x331520,_0xaae661);_0x12c573['state']=0x13;_0x12c573[_0xbc7e('0xa4')]=_0xbc7e('0xe5');_0x12c573['membername']=_0xbc7e('0xe3');_0x12c573[_0xbc7e('0xe6')]=!![];this[_0xbc7e('0xce')](_0x12c573,_0xbc7e('0xe7'),_0xbc7e('0xe8'));}if(_0x331520[_0xbc7e('0x54')]===_0xbc7e('0x77')&&this[_0xbc7e('0x1c')][_0x331520[_0xbc7e('0xb4')]][_0xbc7e('0xe0')]&&_0xaae661[_0xbc7e('0xe4')]===_0xbc7e('0xe9')){delete this[_0xbc7e('0xa7')][_0xaae661['uniqueid']];this[_0xbc7e('0xb2')](this['campaigns'][_0x331520['queue']]);_0x12c573=new Hangup(_0x331520,_0xaae661);_0x12c573[_0xbc7e('0xa3')]=0x12;_0x12c573['statedesc']=_0xbc7e('0xe2');_0x12c573[_0xbc7e('0xea')]='AMD';this['saveInDb'](_0x12c573,_0xbc7e('0xeb'),'[syncHangupInAMDIvr]');}if(_0x331520['type']===_0xbc7e('0x77')&&this['campaigns'][_0x331520[_0xbc7e('0xb4')]]['dialAMDActive']&&_0xaae661['value']==='MACHINE'){delete this['uniqueId'][_0xaae661['uniqueid']];this[_0xbc7e('0xb2')](this[_0xbc7e('0x1c')][_0x331520['queue']]);_0x12c573=new Hangup(_0x331520,_0xaae661);_0x12c573[_0xbc7e('0xa3')]=0x13;_0x12c573['statedesc']=_0xbc7e('0xe5');_0x12c573[_0xbc7e('0xea')]='AMD';_0x12c573['amd']=!![];this[_0xbc7e('0xce')](_0x12c573,_0xbc7e('0xec'),_0xbc7e('0xed'));}}};Dialer[_0xbc7e('0x18')][_0xbc7e('0x2d')]=function(_0x29f198){var _0xfa1164=this[_0xbc7e('0xa7')][_0x29f198[_0xbc7e('0xdc')]];var _0x1e0080=this;var _0x458cf3;if(_0xfa1164&&_0xfa1164['type']===_0xbc7e('0x77')){delete this[_0xbc7e('0xa7')][_0x29f198['uniqueid']];this['updateOriginated'](this[_0xbc7e('0x1c')][_0xfa1164['queue']]);this[_0xbc7e('0x1c')][_0xfa1164[_0xbc7e('0xb4')]]['ivrAnswerCallsDay']+=0x1;_0x458cf3=new Hangup(_0xfa1164,_0x29f198);this['createHistory'](_0x458cf3)[_0xbc7e('0xb0')](loggerCatch(_0xbc7e('0xee')));this['moveContactManagedDialer'](_0x458cf3)[_0xbc7e('0xb0')](loggerCatch(_0xbc7e('0xef')));}if(_0xfa1164&&_0xfa1164[_0xbc7e('0x54')]!==_0xbc7e('0x77')&&isNotNull(this[_0xbc7e('0x1b')][_0xfa1164[_0xbc7e('0xb4')]][_0xbc7e('0xf0')])){delete this[_0xbc7e('0xa7')][_0x29f198[_0xbc7e('0xdc')]];this[_0xbc7e('0xb2')](this[_0xbc7e('0x1b')][_0xfa1164[_0xbc7e('0xb4')]]);this[_0xbc7e('0x1b')][_0xfa1164[_0xbc7e('0xb4')]][_0xbc7e('0x5b')]+=0x1;this['voiceQueues'][_0xfa1164[_0xbc7e('0xb4')]][_0xbc7e('0xe1')]+=0x1;_0x458cf3=new Hangup(_0xfa1164,_0x29f198);_0x458cf3[_0xbc7e('0xa3')]=0x10;_0x458cf3[_0xbc7e('0xa4')]=_0xbc7e('0xf1');_0x458cf3[_0xbc7e('0xea')]=_0xbc7e('0xf2');this[_0xbc7e('0xc8')](_0x458cf3)[_0xbc7e('0xb0')](loggerCatch(_0xbc7e('0xee')));this[_0xbc7e('0xc6')](_0x458cf3)['catch'](loggerCatch(_0xbc7e('0xef')));}if(_0xfa1164&&_0xfa1164[_0xbc7e('0x54')]!==_0xbc7e('0x77')&&!isNotNull(this[_0xbc7e('0x1b')][_0xfa1164[_0xbc7e('0xb4')]][_0xbc7e('0xf0')])){delete this[_0xbc7e('0xa7')][_0x29f198[_0xbc7e('0xdc')]];this['updateOriginated'](this[_0xbc7e('0x1b')][_0xfa1164[_0xbc7e('0xb4')]]);this[_0xbc7e('0x1b')][_0xfa1164[_0xbc7e('0xb4')]]['outboundUnknownCallsDay']+=0x1;_0x458cf3=new Hangup(_0xfa1164,_0x29f198);_0x458cf3[_0xbc7e('0xa3')]=0xc;_0x458cf3[_0xbc7e('0xa4')]=_0x29f198[_0xbc7e('0xf3')];_0x458cf3[_0xbc7e('0xea')]=_0xbc7e('0xf4');this['createHistory'](_0x458cf3)[_0xbc7e('0xb0')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xbc7e('0xc6')](_0x458cf3)[_0xbc7e('0xb0')](loggerCatch(_0xbc7e('0xef')));}};Dialer[_0xbc7e('0x18')][_0xbc7e('0x2b')]=function(_0x545c74){var _0x5b217f=this[_0xbc7e('0xa7')][_0x545c74[_0xbc7e('0xdc')]];var _0xfe495e=this;if(this[_0xbc7e('0x1b')][_0x545c74[_0xbc7e('0xb4')]]){if(_0x5b217f&&_0x5b217f[_0xbc7e('0x54')]!==_0xbc7e('0x77')){delete this[_0xbc7e('0xa7')][_0x545c74[_0xbc7e('0xdc')]];this[_0xbc7e('0x1b')][_0x545c74[_0xbc7e('0xb4')]]['outboundAnswerCallsDay']+=0x1;var _0x344fd7=new AgentComplete(_0x5b217f,_0x545c74);if(_0x545c74[_0xbc7e('0xf5')]===_0xbc7e('0xf6')){_0x344fd7[_0xbc7e('0xf7')]=this[_0xbc7e('0x1b')][_0x545c74[_0xbc7e('0xb4')]][_0xbc7e('0xf8')]&&this[_0xbc7e('0x1b')][_0x545c74[_0xbc7e('0xb4')]]['dialAgiAfterHangupAgent']?moment()[_0xbc7e('0x8f')](_0xbc7e('0xf9')):undefined;}this[_0xbc7e('0xc8')](_0x344fd7)[_0xbc7e('0xb0')](loggerCatch(_0xbc7e('0xfa')));this[_0xbc7e('0xc6')](_0x344fd7)['catch'](loggerCatch(_0xbc7e('0xfb')));}}};Dialer[_0xbc7e('0x18')][_0xbc7e('0x26')]=function(_0x44ebc9){if(this[_0xbc7e('0x1b')][_0x44ebc9['queue']]){if(this[_0xbc7e('0xa7')][_0x44ebc9[_0xbc7e('0xdc')]]&&this['uniqueId'][_0x44ebc9[_0xbc7e('0xdc')]]['type']!==_0xbc7e('0x77')){this[_0xbc7e('0xb2')](this[_0xbc7e('0x1b')][_0x44ebc9['queue']]);this[_0xbc7e('0xa7')][_0x44ebc9['uniqueid']][_0xbc7e('0xfc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xbc7e('0x18')][_0xbc7e('0xfd')]=function(_0x5b691c){this[_0xbc7e('0xc8')](_0x5b691c)[_0xbc7e('0xb0')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xbc7e('0xc6')](_0x5b691c)['catch'](loggerCatch(_0xbc7e('0xfe')));};Dialer[_0xbc7e('0x18')][_0xbc7e('0xff')]=function(_0x59799b){var _0x4dcad3=this[_0xbc7e('0xa7')][_0x59799b[_0xbc7e('0xdc')]];var _0x5d702f=this;if(this['voiceQueues'][_0x59799b[_0xbc7e('0xb4')]]){if(_0x4dcad3&&_0x4dcad3[_0xbc7e('0x54')]!==_0xbc7e('0x77')){delete this[_0xbc7e('0xa7')][_0x59799b[_0xbc7e('0xdc')]];this[_0xbc7e('0xb2')](this[_0xbc7e('0x1b')][_0x59799b[_0xbc7e('0xb4')]]);_0x4dcad3[_0xbc7e('0x100')]=moment()[_0xbc7e('0x8f')](_0xbc7e('0xf9'));var _0x16eeec=new QueueCallerAbandon(_0x4dcad3,_0x59799b);if(getSeconds(_0x4dcad3[_0xbc7e('0x100')],_0x4dcad3['responsetime'])>=_0x4dcad3[_0xbc7e('0x101')]){this[_0xbc7e('0x1b')][_0x59799b['queue']][_0xbc7e('0x65')]+=0x1;this[_0xbc7e('0x1b')][_0x59799b['queue']]['outboundDropCallsDayTimeout']+=0x1;this[_0xbc7e('0x1b')][_0x59799b[_0xbc7e('0xb4')]][_0xbc7e('0x102')]+=0x1;_0x16eeec[_0xbc7e('0xa3')]=0xa;_0x16eeec[_0xbc7e('0xa4')]=_0xbc7e('0x103');_0x16eeec['dropreason']='TIMEOUT';_0x16eeec[_0xbc7e('0xf7')]=this[_0xbc7e('0x1b')][_0x59799b['queue']][_0xbc7e('0xf8')]?moment()[_0xbc7e('0x8f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;this[_0xbc7e('0xfd')](_0x16eeec);}else{this[_0xbc7e('0x1b')][_0x59799b[_0xbc7e('0xb4')]][_0xbc7e('0x104')]+=0x1;this['voiceQueues'][_0x59799b[_0xbc7e('0xb4')]][_0xbc7e('0x5d')]+=0x1;_0x16eeec['state']=0xb;_0x16eeec['statedesc']=_0xbc7e('0x105');_0x16eeec[_0xbc7e('0x106')]=_0xbc7e('0x107');this[_0xbc7e('0xfd')](_0x16eeec);}}}};Dialer[_0xbc7e('0x18')][_0xbc7e('0x2f')]=function(_0x4396dc){if(this[_0xbc7e('0x21')][_0x4396dc[_0xbc7e('0xdc')]]){this['actions'][_0x4396dc['uniqueid']]['channel']=_0x4396dc[_0xbc7e('0xaf')];}if(this[_0xbc7e('0xa7')][_0x4396dc['uniqueid']]){this[_0xbc7e('0xa7')][_0x4396dc[_0xbc7e('0xdc')]][_0xbc7e('0xaf')]=_0x4396dc['channel'];}};Dialer[_0xbc7e('0x18')][_0xbc7e('0x33')]=function(_0x3a8800){if(strategy[this['voiceQueues'][this[_0xbc7e('0x21')][_0x3a8800['actionid']]['queue']][_0xbc7e('0x4c')]]===_0xbc7e('0x17')){if(this[_0xbc7e('0x21')][_0x3a8800[_0xbc7e('0x108')]]&&_[_0xbc7e('0xac')](this[_0xbc7e('0x21')][_0x3a8800[_0xbc7e('0x108')]][_0xbc7e('0x109')])&&_0x3a8800[_0xbc7e('0xae')]==='1'&&_0x3a8800['paused']==='0'){if(this[_0xbc7e('0x1d')][_0x3a8800[_0xbc7e('0x10a')]]){if(!this['agents'][_0x3a8800[_0xbc7e('0x10a')]]['locked']){this[_0xbc7e('0x1d')][_0x3a8800['stateinterface']]['locked']=!![];this['actions'][_0x3a8800[_0xbc7e('0x108')]][_0xbc7e('0x109')]=!![];this[_0xbc7e('0x21')][_0x3a8800[_0xbc7e('0x108')]]['stateinterface']=_0x3a8800['stateinterface'];}}}}else if((strategy[this[_0xbc7e('0x1b')][this[_0xbc7e('0x21')][_0x3a8800[_0xbc7e('0x108')]][_0xbc7e('0xb4')]][_0xbc7e('0x4c')]]||_0xbc7e('0x16'))===_0xbc7e('0x16')){if(this[_0xbc7e('0x21')][_0x3a8800[_0xbc7e('0x108')]]){if(this[_0xbc7e('0x1d')][_0x3a8800[_0xbc7e('0x10a')]]){this[_0xbc7e('0x21')][_0x3a8800['actionid']][_0xbc7e('0x10a')]=_0x3a8800[_0xbc7e('0x10a')];if(_[_0xbc7e('0xac')](this[_0xbc7e('0x25')][this['actions'][_0x3a8800[_0xbc7e('0x108')]][_0xbc7e('0xb4')]])){this[_0xbc7e('0x25')][this[_0xbc7e('0x21')][_0x3a8800['actionid']][_0xbc7e('0xb4')]]=[];}this[_0xbc7e('0x25')][this['actions'][_0x3a8800[_0xbc7e('0x108')]]['queue']]['push'](_[_0xbc7e('0x89')](_[_0xbc7e('0x10b')](this[_0xbc7e('0x21')][_0x3a8800[_0xbc7e('0x108')]],['idHopper','stateinterface']),{'status':_0x3a8800[_0xbc7e('0xae')],'paused':_0x3a8800[_0xbc7e('0x10c')]}));}}}};function unlockQueueStatus(_0x584304,_0x3adfd3){setTimeout(function(){if(_[_0xbc7e('0x38')](_0x584304[_0xbc7e('0x10d')])){loggerBooked[_0xbc7e('0x91')](_0xbc7e('0x10e'),_0x3adfd3);}_0x584304[_0xbc7e('0x10d')]=!![];loggerBooked[_0xbc7e('0x79')](_0xbc7e('0x10f'),_0x3adfd3,JSON[_0xbc7e('0x46')](_['pick'](_0x584304,[_0xbc7e('0x3b'),'queueStatusComplete'])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x25256a){var _0x3d3b25=this;var _0x295781=_0x3d3b25[_0xbc7e('0x1b')][_0x3d3b25[_0xbc7e('0x21')][_0x25256a[_0xbc7e('0x108')]][_0xbc7e('0xb4')]];if(strategy[this['voiceQueues'][this[_0xbc7e('0x21')][_0x25256a[_0xbc7e('0x108')]][_0xbc7e('0xb4')]][_0xbc7e('0x4c')]]===_0xbc7e('0x17')){if(this[_0xbc7e('0x21')][_0x25256a[_0xbc7e('0x108')]]&&this[_0xbc7e('0x21')][_0x25256a[_0xbc7e('0x108')]][_0xbc7e('0x10a')]){this['preview'][_0xbc7e('0x110')](this[_0xbc7e('0x21')][_0x25256a[_0xbc7e('0x108')]][_0xbc7e('0x111')],this['actions'][_0x25256a['actionid']][_0xbc7e('0x10a')])[_0xbc7e('0xb0')](function(_0x4cb71b){logger[_0xbc7e('0x91')](_0xbc7e('0x112'),util[_0xbc7e('0x92')](_0x4cb71b,{'showHidden':![],'depth':null}));})[_0xbc7e('0x1a')](function(){_0x3d3b25[_0xbc7e('0xb2')](_0x3d3b25[_0xbc7e('0x1b')][_0x3d3b25[_0xbc7e('0x21')][_0x25256a[_0xbc7e('0x108')]][_0xbc7e('0xb4')]]);_0x3d3b25[_0xbc7e('0x1d')][_0x3d3b25[_0xbc7e('0x21')][_0x25256a[_0xbc7e('0x108')]]['stateinterface']][_0xbc7e('0x109')]=![];delete _0x3d3b25['actions'][_0x25256a['actionid']];unlockQueueStatus(_0x295781);});}else{this[_0xbc7e('0xb2')](this['voiceQueues'][this[_0xbc7e('0x21')][_0x25256a[_0xbc7e('0x108')]]['queue']]);this[_0xbc7e('0xc1')]({'active':![],'ContactId':this[_0xbc7e('0x21')][_0x25256a[_0xbc7e('0x108')]][_0xbc7e('0xcf')],'ListId':this[_0xbc7e('0x21')][_0x25256a[_0xbc7e('0x108')]][_0xbc7e('0xd0')],'VoiceQueueId':this[_0xbc7e('0x21')][_0x25256a[_0xbc7e('0x108')]][_0xbc7e('0xd2')]||undefined,'CampaignId':this[_0xbc7e('0x21')][_0x25256a['actionid']][_0xbc7e('0xd3')]||undefined})[_0xbc7e('0xb0')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xbc7e('0x21')][_0x25256a[_0xbc7e('0x108')]];unlockQueueStatus(_0x295781);}}else if((strategy[this[_0xbc7e('0x1b')][this[_0xbc7e('0x21')][_0x25256a[_0xbc7e('0x108')]][_0xbc7e('0xb4')]]['strategy']]||_0xbc7e('0x16'))===_0xbc7e('0x16')){var _0x4d7f42;if(this[_0xbc7e('0x21')][_0x25256a[_0xbc7e('0x108')]]&&!_[_0xbc7e('0x43')](this['queueBooked'][this[_0xbc7e('0x21')][_0x25256a[_0xbc7e('0x108')]][_0xbc7e('0xb4')]])){if(this[_0xbc7e('0x113')][_0x3d3b25[_0xbc7e('0x21')][_0x25256a[_0xbc7e('0x108')]][_0xbc7e('0xb4')]]){this[_0xbc7e('0x113')][_0x3d3b25[_0xbc7e('0x21')][_0x25256a[_0xbc7e('0x108')]][_0xbc7e('0xb4')]]=this[_0xbc7e('0x113')][this[_0xbc7e('0x21')][_0x25256a[_0xbc7e('0x108')]][_0xbc7e('0xb4')]]?this['queueBookedRR'][this[_0xbc7e('0x21')][_0x25256a['actionid']][_0xbc7e('0xb4')]]:this[_0xbc7e('0x25')][this['actions'][_0x25256a[_0xbc7e('0x108')]][_0xbc7e('0xb4')]]?this['queueBooked'][this[_0xbc7e('0x21')][_0x25256a['actionid']][_0xbc7e('0xb4')]][_0xbc7e('0x114')]||0x0:0x0;}this[_0xbc7e('0x25')][this[_0xbc7e('0x21')][_0x25256a[_0xbc7e('0x108')]][_0xbc7e('0xb4')]][_0xbc7e('0x114')]=this[_0xbc7e('0x113')][this[_0xbc7e('0x21')][_0x25256a[_0xbc7e('0x108')]][_0xbc7e('0xb4')]];for(var _0x244710=0x0;_0x244710=0x0?!![]:![];})[_0xbc7e('0xb0')](myreject(_0x54bb85)));}}else{_0x434183[_0xbc7e('0x128')](ami[_0xbc7e('0xad')]({'action':'command','command':util[_0xbc7e('0x8f')](_0xbc7e('0x12e'),_0x1f9c60,!_['isUndefined'](config[_0xbc7e('0x12b')][_0x148dc7])?_0x148dc7:'')})[_0xbc7e('0xb8')](function(_0x1c9d91){return _0x1c9d91[_0xbc7e('0x12f')][_0xbc7e('0x12c')](_0xbc7e('0x12d'))>=0x0?!![]:![];})[_0xbc7e('0xb0')](myreject(_0x54bb85)));}BPromise[_0xbc7e('0x130')](_0x434183)[_0xbc7e('0xb8')](function(_0x1d00ab){var _0x290926=_[_0xbc7e('0x131')](_0x1d00ab);if(_0x290926){return _0x10cd0a(_0x290926);}else{_0x35c4fd['message']=_0xf4053?_0xbc7e('0x132'):_0xbc7e('0x133');return _0x54bb85(msgResponse(_0xbc7e('0x134'),_0xbc7e('0x123'),_0xbc7e('0x135')+_0xf4053+'\x20'+_0x6b8cc8+'\x20Interval\x20is\x20overtime:\x20'+util[_0xbc7e('0x92')](_0x1f9c60,{'showHidden':![],'depth':null})+_0xbc7e('0x136')+_0x148dc7));}})[_0xbc7e('0xb0')](function(_0x5f1341){return _0x54bb85(msgResponse(_0xbc7e('0x121'),_0xbc7e('0x123'),JSON[_0xbc7e('0x46')](_0x5f1341)));});});};Dialer[_0xbc7e('0x18')]['checkDialMethod']=function(_0x50b271){var _0x3d78c7=this;return function(){switch(_0x50b271[_0xbc7e('0x58')]){case _0xbc7e('0x137'):freeVariablesPredictive(_0x50b271);_0x3d78c7[_0xbc7e('0x138')](_0x50b271,0x1);break;case _0xbc7e('0x139'):freeVariablesPredictive(_0x50b271);_0x3d78c7[_0xbc7e('0x138')](_0x50b271,_0x50b271[_0xbc7e('0x13a')]);break;case _0xbc7e('0x8'):_0x3d78c7[_0xbc7e('0x8')](_0x50b271);break;case _0xbc7e('0x13b'):freeVariablesPredictive(_0x50b271);_0x3d78c7['handlePower'](_0x50b271,0x1);break;default:freeVariablesPredictive(_0x50b271);logger[_0xbc7e('0x91')](_0xbc7e('0x13c'),_0x50b271[_0xbc7e('0x3b')],_0xbc7e('0x13d'));}};};Dialer[_0xbc7e('0x18')][_0xbc7e('0x13e')]=function(_0x1cbcf8){var _0x5833de=this;return function(){_0x5833de['handleIvr'](_0x1cbcf8);};};Dialer[_0xbc7e('0x18')][_0xbc7e('0x13f')]=function(_0x32142f){var _0x12d048=this;if(isNotPreview(_0x32142f['dialMethod'])){if(isVoiceQueueOutbound(_0x32142f[_0xbc7e('0x54')])&&isActive(_0x32142f[_0xbc7e('0x140')])){_0x32142f[_0xbc7e('0x9c')]=!![];BPromise[_0xbc7e('0xb7')]()[_0xbc7e('0xb8')](checkIsLoggedIn(_0x32142f,_0x32142f[_0xbc7e('0x4f')]))[_0xbc7e('0xb8')](checkIsActive(_0x32142f,_0x32142f['dialActive']))[_0xbc7e('0xb8')](checkInterval(_0x32142f))[_0xbc7e('0xb8')](_0x12d048[_0xbc7e('0x11f')](_0x32142f))[_0xbc7e('0xb8')](_0x12d048[_0xbc7e('0x120')](_0x32142f['dialGlobalInterval'],_0x32142f[_0xbc7e('0x141')],_0x32142f[_0xbc7e('0x3b')],_0x32142f))[_0xbc7e('0xb8')](_0x12d048[_0xbc7e('0x122')](_0x32142f[_0xbc7e('0x41')],_0x32142f[_0xbc7e('0x141')],_0x32142f[_0xbc7e('0x3b')],_0x32142f))['then'](_0x12d048['checkDialMethod'](_0x32142f))[_0xbc7e('0xb0')](loggerCatchQueueSummary('[syncQueueSummary]',_0x32142f));}else{notSendMessagesQueue(_0x32142f);}}else{freeVariablesPredictive(_0x32142f);}};Dialer[_0xbc7e('0x18')][_0xbc7e('0x11e')]=function(){var _0x3a7f4a=this;var _0x555377;for(var _0x27aab3 in this[_0xbc7e('0x1c')]){if(this[_0xbc7e('0x1c')]['hasOwnProperty'](_0x27aab3)){_0x555377=this[_0xbc7e('0x1c')][_0x27aab3];if(isCampaignIvr(_0x555377[_0xbc7e('0x54')])&&isActive(_0x555377['active'])){_0x555377[_0xbc7e('0x9c')]=!![];BPromise[_0xbc7e('0xb7')]()[_0xbc7e('0xb8')](checkIsActive(_0x555377,_0x555377[_0xbc7e('0x72')]))[_0xbc7e('0xb8')](checkInterval(_0x555377))[_0xbc7e('0xb8')](_0x3a7f4a[_0xbc7e('0x11f')](_0x555377))['then'](_0x3a7f4a[_0xbc7e('0x120')](_0x555377['dialGlobalInterval'],_0x555377[_0xbc7e('0x141')],_0x555377[_0xbc7e('0x3b')],_0x555377))[_0xbc7e('0xb8')](_0x3a7f4a[_0xbc7e('0x122')](_0x555377['Interval'],_0x555377[_0xbc7e('0x141')],_0x555377[_0xbc7e('0x3b')],_0x555377))[_0xbc7e('0xb8')](_0x3a7f4a[_0xbc7e('0x13e')](_0x555377))[_0xbc7e('0xb0')](loggerCatchQueueSummary('[syncCampaigns]',_0x555377));}else{notSendMessagesCampaign(_0x555377);}}}};function getCallerIdRandom(_0x48dbe4,_0x3edd8a){var _0x3b67ea,_0xbdf02a,_0x4561c9;if(_0x3edd8a<=0x0){_0x3edd8a=0x1;}_0x3b67ea=new RegExp(_0xbc7e('0x142')+_0x3edd8a+'}$');_0xbdf02a=Math[_0xbc7e('0x143')](0xa,_0x3edd8a-0x1);_0x4561c9=Math['pow'](0xa,_0x3edd8a)-0x1;return util[_0xbc7e('0x8f')]('%s',_['replace'](_0x48dbe4,_0x3b67ea,_[_0xbc7e('0x144')](_0xbdf02a,_0x4561c9)));}function extractCalleridName(_0x5566c6){var _0x5e6aee=_0x5566c6[_0xbc7e('0x145')](/"(.*?)"/);return _0x5e6aee?_0x5e6aee[0x1]:_0x5566c6;}function extractCalleridNumber(_0x1ebf29){var _0x33aa27=_0x1ebf29[_0xbc7e('0x145')](/<(.*?)>/);return _0x33aa27?_0x33aa27[0x1]:_0x1ebf29;}Dialer[_0xbc7e('0x18')]['actionOriginate']=function(_0x5e6f4b,_0x8d7b8e){var _0x274f1f=this;var _0x4d4a5d=uuid['v4']();this[_0xbc7e('0x21')][_0x4d4a5d]=new Action(_0x5e6f4b,_0x8d7b8e,_0x4d4a5d);return new BPromise(function(_0x3cbead,_0xff8f93){if(_[_0xbc7e('0x38')](_0x5e6f4b)&&_0xbc7e('0x146')!==typeof _0x5e6f4b){return _0xff8f93(msgResponse('originate','Failure',_0xbc7e('0x147')));}if(_[_0xbc7e('0x38')](_0x8d7b8e[_0xbc7e('0x148')]['phone'])||_0x8d7b8e[_0xbc7e('0x148')][_0xbc7e('0x149')]===null){return _0xff8f93(msgResponse(_0xbc7e('0x14a'),_0xbc7e('0x123'),_0xbc7e('0x14b')));}var _0x2043e9={'XMD-CALLERID':_0x274f1f[_0xbc7e('0x21')][_0x4d4a5d][_0xbc7e('0x14c')](),'XMD-AGI':_0x5e6f4b['dialQueueProject']?util['format'](_0xbc7e('0x14d'),ipAgi,_0x5e6f4b['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x5e6f4b[_0xbc7e('0xf8')]?util['format'](_0xbc7e('0x14d'),ipAgi,_0x5e6f4b[_0xbc7e('0xf8')]):'NONE','XMD-QUEUE':_0x5e6f4b[_0xbc7e('0x54')]===_0xbc7e('0x4b')?util[_0xbc7e('0x8f')](_0xbc7e('0x14e'),_0x5e6f4b['name'],_0x5e6f4b[_0xbc7e('0x14f')]||'',_0x5e6f4b[_0xbc7e('0x150')]?'c':'',_0x5e6f4b['dialQueueTimeout']||0x3):_0xbc7e('0x151'),'XMD-CONTACTID':_0x8d7b8e[_0xbc7e('0xcf')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x274f1f['actions'][_0x4d4a5d]['getCaller'](),'XMD-AMD':_0x5e6f4b[_0xbc7e('0xe0')]?_0xbc7e('0x152'):_0xbc7e('0x151'),'XMD-DESTINATION':_0xbc7e('0xdf')};if(_0x5e6f4b['dialAMDActive']){_0x2043e9[_0xbc7e('0x153')]=_0x5e6f4b[_0xbc7e('0x154')]||0x9c4;_0x2043e9[_0xbc7e('0x155')]=_0x5e6f4b['dialAMDGreeting']||0x5dc;_0x2043e9[_0xbc7e('0x156')]=_0x5e6f4b[_0xbc7e('0x157')]||0x320;_0x2043e9[_0xbc7e('0x158')]=_0x5e6f4b['dialAMDTotalAnalysisTime']||0x1388;_0x2043e9[_0xbc7e('0x159')]=_0x5e6f4b['dialAMDMinWordLength']||0x64;_0x2043e9[_0xbc7e('0x15a')]=_0x5e6f4b[_0xbc7e('0x15b')]||0x32;_0x2043e9[_0xbc7e('0x15c')]=_0x5e6f4b[_0xbc7e('0x15d')]||0x3;_0x2043e9['XMD-AMDSILENCETHRESHOLD']=_0x5e6f4b[_0xbc7e('0x15e')]||0x100;_0x2043e9[_0xbc7e('0x15f')]=_0x5e6f4b[_0xbc7e('0x160')]||0x1388;}if(_0x5e6f4b[_0xbc7e('0x54')]===_0xbc7e('0x4b')){_0x2043e9['XMD-VOICEQUEUEID']=_0x8d7b8e[_0xbc7e('0xd2')];}else{_0x2043e9[_0xbc7e('0x161')]=_0x8d7b8e[_0xbc7e('0xd3')];}for(var _0x2b861a in _0x8d7b8e[_0xbc7e('0x148')]){if(_0x8d7b8e['Contact'][_0xbc7e('0x95')](_0x2b861a)){if(isNotNull(_0x8d7b8e['Contact'][_0x2b861a])&&_0x2b861a!=='id'&&_0x2b861a!==_0xbc7e('0x162')&&_0x2b861a!==_0xbc7e('0x163')&&_0x2b861a!==_0xbc7e('0x164')){_0x2043e9[util[_0xbc7e('0x8f')](_0xbc7e('0x165'),_0xbc7e('0x166'),_[_0xbc7e('0x167')](_0x2b861a))]=_0x8d7b8e[_0xbc7e('0x148')][_0x2b861a];}}}var _0x39195a=_0x274f1f[_0xbc7e('0xd8')](_0x5e6f4b[_0xbc7e('0x71')])?getCallerId(_0x5e6f4b['Trunk']['callerid'],_0x5e6f4b[_0xbc7e('0x168')],_0x5e6f4b['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x5e6f4b[_0xbc7e('0x59')],_0x5e6f4b[_0xbc7e('0x169')]):_0x5e6f4b['dialOriginateCallerIdNumber']):getCallerId(_[_0xbc7e('0xac')](_0x5e6f4b[_0xbc7e('0x16a')])?_0x5e6f4b[_0xbc7e('0x71')][_0xbc7e('0x73')]:_0x5e6f4b[_0xbc7e('0x16a')][_0xbc7e('0x73')],_0x5e6f4b['dialOriginateCallerIdName'],_0x5e6f4b[_0xbc7e('0x169')]>0x0?getCallerIdRandom(_0x5e6f4b[_0xbc7e('0x59')],_0x5e6f4b[_0xbc7e('0x169')]):_0x5e6f4b[_0xbc7e('0x59')]);if(_0x39195a){_0x2043e9[_0xbc7e('0x16b')]=_0x274f1f[_0xbc7e('0x21')][_0x4d4a5d][_0xbc7e('0x16c')]=extractCalleridName(_0x39195a);_0x2043e9['XMD-ORIGINATECALLERIDNUM']=_0x274f1f[_0xbc7e('0x21')][_0x4d4a5d]['originatecalleridnum']=extractCalleridNumber(_0x39195a);}return ami['Action']({'actionid':_0x4d4a5d,'action':_0xbc7e('0x14a'),'channel':_0x274f1f[_0xbc7e('0xd8')](_0x5e6f4b['Trunk'])?util[_0xbc7e('0x8f')](_0xbc7e('0x16d'),_0x5e6f4b['Trunk'][_0xbc7e('0x3b')],isNotNull(_0x5e6f4b[_0xbc7e('0x16e')])?_0x5e6f4b[_0xbc7e('0x16e')][_0xbc7e('0x16f')]()||'':'',_0x5e6f4b[_0xbc7e('0x170')]>0x0?_0x8d7b8e['Contact']['phone'][_0xbc7e('0x171')](_0x5e6f4b[_0xbc7e('0x170')]):_0x8d7b8e['Contact'][_0xbc7e('0x149')]):util[_0xbc7e('0x8f')](_0xbc7e('0x16d'),_[_0xbc7e('0xac')](_0x5e6f4b[_0xbc7e('0x16a')])?_0x5e6f4b[_0xbc7e('0x71')]['name']:_0x5e6f4b['TrunkBackup'][_0xbc7e('0x3b')],isNotNull(_0x5e6f4b['dialPrefix'])?_0x5e6f4b[_0xbc7e('0x16e')]['trim']()||'':'',_0x5e6f4b[_0xbc7e('0x170')]>0x0?_0x8d7b8e[_0xbc7e('0x148')][_0xbc7e('0x149')]['substring'](_0x5e6f4b[_0xbc7e('0x170')]):_0x8d7b8e[_0xbc7e('0x148')][_0xbc7e('0x149')]),'callerid':_0x39195a,'Exten':_0xbc7e('0xdf'),'Context':_0xbc7e('0x172'),'Priority':'1','variable':_0x2043e9,'timeout':(_0x5e6f4b[_0xbc7e('0x5a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4d4a5d})[_0xbc7e('0xb8')](function(_0x3b73f8){return _0x3cbead(_0x3b73f8);})['catch'](function(_0x4b6a7c){_0x5e6f4b[_0xbc7e('0x61')]+=0x1;var _0x52db27=new History(_0x274f1f['actions'][_0x4d4a5d]);logger['error'](util[_0xbc7e('0x8f')]('[originateError]:\x20%s',JSON[_0xbc7e('0x46')](_0x4b6a7c)));_0x52db27[_0xbc7e('0xa3')]=0xe;_0x52db27[_0xbc7e('0xa4')]=_0xbc7e('0x173');_0x52db27[_0xbc7e('0x174')]=moment()['format'](_0xbc7e('0xf9'));_0x52db27[_0xbc7e('0xa5')]=_0x52db27[_0xbc7e('0x174')];_0x274f1f[_0xbc7e('0xc8')](_0x52db27)[_0xbc7e('0xb0')](loggerCatch(_0xbc7e('0x175')));_0x274f1f[_0xbc7e('0xc6')](_0x52db27)[_0xbc7e('0xb0')](loggerCatch('[originate][error]'))[_0xbc7e('0x1a')](function(){delete _0x274f1f[_0xbc7e('0x21')][_0x4d4a5d];return _0xff8f93(msgResponse(_0xbc7e('0x14a'),'Error',_0xbc7e('0x176')));});});});};Dialer[_0xbc7e('0x18')][_0xbc7e('0x177')]=function(_0x926722){var _0x3922b3=this['actions'][_0x926722[_0xbc7e('0x108')]];var _0x7f87cf=this;if(_0x3922b3){delete this[_0xbc7e('0x21')][_0x926722[_0xbc7e('0x108')]];_0x3922b3[_0xbc7e('0x178')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x2773f8=_0x3922b3['type']===_0xbc7e('0x77')?this[_0xbc7e('0x1c')][_0x3922b3[_0xbc7e('0xb4')]]:this['voiceQueues'][_0x3922b3[_0xbc7e('0x179')]()];if(!this[_0xbc7e('0xd6')](_0x926722['response'])){this[_0xbc7e('0xb2')](_0x2773f8);return this[_0xbc7e('0x17a')](_0x3922b3,_0x2773f8,_0x926722)[_0xbc7e('0xb8')](function(_0x4fbbc3){})[_0xbc7e('0xb0')](loggerCatch(_0xbc7e('0x17b')));}else{this[_0xbc7e('0xa7')][_0x926722['uniqueid']]=_0x3922b3;}}};Dialer[_0xbc7e('0x18')][_0xbc7e('0x17c')]=function(_0x828cde,_0xcdf4a6,_0x50f010){var _0x3e8108=new History(_0xcdf4a6);if(_0x3e8108['countbusyretry']+_0x3e8108[_0xbc7e('0x17d')]+_0x3e8108[_0xbc7e('0x17e')]>=_0x50f010[_0xbc7e('0x17f')]-0x1){return!![];}switch(_0x828cde){case 0x3:if(_0x3e8108['countnoanswerretry']>=_0x50f010[_0xbc7e('0x180')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnoanswerretry':_0x3e8108['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xbc7e('0x181')](_0x50f010[_0xbc7e('0x182')],_0xbc7e('0x183'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3e8108[_0xbc7e('0xcf')],'ListId':_0x3e8108[_0xbc7e('0xd0')],'VoiceQueueId':_0x3e8108[_0xbc7e('0xd2')]||undefined,'CampaignId':_0x3e8108[_0xbc7e('0xd3')]||undefined})[_0xbc7e('0xb0')](loggerCatch(_0xbc7e('0x184')));}break;case 0x5:if(_0x3e8108[_0xbc7e('0x185')]>=_0x50f010[_0xbc7e('0x186')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countbusyretry':_0x3e8108['countbusyretry']+=0x1,'scheduledat':moment()[_0xbc7e('0x181')](_0x50f010[_0xbc7e('0x187')],_0xbc7e('0x183'))['format'](_0xbc7e('0xf9')),'ContactId':_0x3e8108[_0xbc7e('0xcf')],'ListId':_0x3e8108[_0xbc7e('0xd0')],'VoiceQueueId':_0x3e8108[_0xbc7e('0xd2')]||undefined,'CampaignId':_0x3e8108['CampaignId']||undefined})[_0xbc7e('0xb0')](loggerCatch(_0xbc7e('0x188')));}break;case 0x8:if(_0x3e8108['countcongestionretry']>=_0x50f010[_0xbc7e('0x189')]-0x1){return!![];}else{this[_0xbc7e('0xc1')]({'active':![],'countcongestionretry':_0x3e8108[_0xbc7e('0x17d')]+=0x1,'scheduledat':moment()[_0xbc7e('0x181')](_0x50f010[_0xbc7e('0x18a')],_0xbc7e('0x183'))[_0xbc7e('0x8f')](_0xbc7e('0xf9')),'ContactId':_0x3e8108['ContactId'],'ListId':_0x3e8108[_0xbc7e('0xd0')],'VoiceQueueId':_0x3e8108[_0xbc7e('0xd2')]||undefined,'CampaignId':_0x3e8108[_0xbc7e('0xd3')]||undefined})[_0xbc7e('0xb0')](loggerCatch(_0xbc7e('0x18b')));}break;default:return!![];}};Dialer[_0xbc7e('0x18')][_0xbc7e('0x17a')]=function(_0x2902e6,_0x326493,_0x579757){var _0xced204=this;var _0x250fc9=new History(_0x2902e6);return new BPromise(function(_0x161219,_0x565571){if(_['isUndefined'](_0x326493)&&_0xbc7e('0x146')!==typeof _0x326493){return _0x565571(msgResponse(_0xbc7e('0x18c'),_0xbc7e('0x123'),_0xbc7e('0x18d')));}if(_['isUndefined'](_0x579757)&&_0xbc7e('0x146')!==typeof _0x579757){return _0x565571(msgResponse(_0xbc7e('0x18c'),_0xbc7e('0x123'),_0xbc7e('0x18e')));}switch(_0x579757[_0xbc7e('0xf5')]){case'0':_0x326493['outboundNoSuchCallsDay']+=0x1;_0x250fc9[_0xbc7e('0xa3')]=0x0;_0x250fc9[_0xbc7e('0xa4')]='NoSuchNumber';_0xced204[_0xbc7e('0xc8')](_0x250fc9)[_0xbc7e('0xb0')](loggerCatch(_0xbc7e('0x18f')));if(_0xced204['checkRetriveMax'](0x0,_0x2902e6,_0x326493)){if(_0x250fc9['countbusyretry']+_0x250fc9[_0xbc7e('0x17d')]+_0x250fc9[_0xbc7e('0x17e')]>=_0x326493[_0xbc7e('0x17f')]){_0xced204[_0xbc7e('0x190')](_0x250fc9,_0x161219,_0x565571,_0xbc7e('0x191'));}else{_0xced204[_0xbc7e('0x192')](_0x250fc9,_0x161219,_0x565571,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x326493[_0xbc7e('0x5f')]+=0x1;_0x250fc9[_0xbc7e('0xa3')]=0x3;_0x250fc9[_0xbc7e('0xa4')]=_0xbc7e('0x193');_0x250fc9['countnoanswerretry']+=0x1;_0x250fc9[_0xbc7e('0x194')]+=0x1;_0xced204['createHistory'](_0x250fc9)[_0xbc7e('0xb0')](loggerCatch(_0xbc7e('0x195')));if(_0xced204['checkRetriveMax'](0x3,_0x2902e6,_0x326493)){if(_0x250fc9[_0xbc7e('0x17e')]>=_0x326493[_0xbc7e('0x180')]){_0xced204['createStateFinal'](_0x250fc9,_0x161219,_0x565571,_0xbc7e('0x196'));}else{_0xced204[_0xbc7e('0x190')](_0x250fc9,_0x161219,_0x565571,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x326493[_0xbc7e('0x5c')]+=0x1;_0x250fc9[_0xbc7e('0xa3')]=0x5;_0x250fc9['statedesc']=_0xbc7e('0x197');_0x250fc9['countbusyretry']+=0x1;_0x250fc9[_0xbc7e('0x194')]+=0x1;_0xced204[_0xbc7e('0xc8')](_0x250fc9)['catch'](loggerCatch(_0xbc7e('0x198')));if(_0xced204[_0xbc7e('0x17c')](0x5,_0x2902e6,_0x326493)){if(_0x250fc9[_0xbc7e('0x185')]>=_0x326493[_0xbc7e('0x186')]){_0xced204[_0xbc7e('0x192')](_0x250fc9,_0x161219,_0x565571,_0xbc7e('0x199'));}else{_0xced204[_0xbc7e('0x190')](_0x250fc9,_0x161219,_0x565571,'reason\x205\x20busy');}}break;case'8':_0x326493[_0xbc7e('0x19a')]+=0x1;_0x250fc9[_0xbc7e('0xa3')]=0x8;_0x250fc9['statedesc']='Congestion';_0x250fc9[_0xbc7e('0x17d')]+=0x1;_0x250fc9['countglobal']+=0x1;_0xced204[_0xbc7e('0xc8')](_0x250fc9)[_0xbc7e('0xb0')](loggerCatch(_0xbc7e('0x19b')));if(_0xced204['checkRetriveMax'](0x8,_0x2902e6,_0x326493)){if(_0x250fc9[_0xbc7e('0x17d')]>=_0x326493[_0xbc7e('0x189')]){_0xced204[_0xbc7e('0x192')](_0x250fc9,_0x161219,_0x565571,_0xbc7e('0x19c'));}else{_0xced204[_0xbc7e('0x190')](_0x250fc9,_0x161219,_0x565571,_0xbc7e('0x19c'));}}break;default:_0x326493[_0xbc7e('0x63')]+=0x1;_0x250fc9[_0xbc7e('0xa3')]=0xc;_0x250fc9[_0xbc7e('0xa4')]=_0x579757[_0xbc7e('0xf5')];_0xced204[_0xbc7e('0xc8')](_0x250fc9)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0xced204[_0xbc7e('0x17c')](_0x579757[_0xbc7e('0xf5')],_0x2902e6,_0x326493)){if(_0x250fc9[_0xbc7e('0x185')]+_0x250fc9[_0xbc7e('0x17d')]+_0x250fc9[_0xbc7e('0x17e')]>=_0x326493['dialGlobalMaxRetry']){_0xced204[_0xbc7e('0x190')](_0x250fc9,_0x161219,_0x565571,_0x579757[_0xbc7e('0xf5')]);}else{_0xced204[_0xbc7e('0x192')](_0x250fc9,_0x161219,_0x565571,_0x579757['reason']);}}}});};Dialer[_0xbc7e('0x18')][_0xbc7e('0x190')]=function(_0x56937b,_0x42045b,_0x26db9c,_0x1f7457){var _0x195272=new Final(_0x56937b);_0x195272[_0xbc7e('0xa3')]=0xf;_0x195272[_0xbc7e('0xa4')]='Global';this[_0xbc7e('0x192')](_0x195272,_0x42045b,_0x26db9c,_0x1f7457);};Dialer[_0xbc7e('0x18')][_0xbc7e('0x192')]=function(_0x58b4f4,_0x229060,_0x44a8c5,_0x2c5394){this['moveContactManagedDialer'](_0x58b4f4)['then'](function(_0x324ea9){return _0x229060(msgResponse(_0xbc7e('0x18c'),_0xbc7e('0xd7'),_0x2c5394));})['catch'](function(_0x419104){return _0x44a8c5(msgResponse(_0xbc7e('0x19d'),_0xbc7e('0x123'),_0xbc7e('0x19e')));});};Dialer[_0xbc7e('0x18')][_0xbc7e('0x8')]=function(_0x3e75f8){var _0x8a5468=this;var _0x4825ca=_0x3e75f8['dialPredictiveOptimizationPercentage']/0x64;var _0x5df622=_0x3e75f8[_0xbc7e('0x5e')]/(_0x3e75f8['outboundDropCallsDayTimeout']+_0x3e75f8[_0xbc7e('0x5b')]);var _0x302320=Math[_0xbc7e('0x19f')](_0x3e75f8['predictiveIntervalAvailable']*(_0x3e75f8[_0xbc7e('0x1a0')]/0x64));var _0x4cbf04=Math[_0xbc7e('0x19f')](_0x3e75f8[_0xbc7e('0x69')]*(_0x3e75f8[_0xbc7e('0x1a1')]/0x64));var _0x299e31=_0x3e75f8[_0xbc7e('0x4e')]+_0x3e75f8[_0xbc7e('0x53')];var _0x4a6799=Math[_0xbc7e('0x1a2')](_0x3e75f8['erlangCalls']*_0x3e75f8[_0xbc7e('0x6e')]*_0x3e75f8[_0xbc7e('0x66')]*_0x3e75f8['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x3e75f8[_0xbc7e('0x24')])){if(!_['isUndefined'](_0x3e75f8[_0xbc7e('0x70')])){_0x3e75f8[_0xbc7e('0x70')]=undefined;loggerPredictive[_0xbc7e('0x91')](_0xbc7e('0x1a3'),_0xbc7e('0x1a4'));}if(!_[_0xbc7e('0x38')](_0x3e75f8[_0xbc7e('0x8b')])){loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0xbc7e('0x1a5'));clearInterval(_0x3e75f8[_0xbc7e('0x8b')]);_0x3e75f8[_0xbc7e('0x8b')]=undefined;}_0x3e75f8[_0xbc7e('0x24')]=moment()[_0xbc7e('0x8f')](_0xbc7e('0xf9'));loggerPredictive[_0xbc7e('0x79')](_0x3e75f8['name'],_0xbc7e('0x1a6'),_0x3e75f8[_0xbc7e('0x24')]);this['handlePower'](_0x3e75f8,0x1);}else if(ifInterval(_0x3e75f8[_0xbc7e('0x1a7')],_0x3e75f8[_0xbc7e('0x24')])){this[_0xbc7e('0x138')](_0x3e75f8,0x1);loggerPredictiveCalls[_0xbc7e('0x79')](_0xbc7e('0x1a8'),_0x3e75f8[_0xbc7e('0x24')],_0x3e75f8['name']);_0x3e75f8['erlangCalls']=0x0;_0x3e75f8[_0xbc7e('0x102')]=0x0;}else if(_0x4825ca<_0x5df622&&_0x3e75f8[_0xbc7e('0x1a9')]==='dropRate'){freeVariablesPredictive(_0x3e75f8);loggerPredictive[_0xbc7e('0x79')](_0xbc7e('0x1aa'),_0xbc7e('0x1ab'),_0x5df622,_0xbc7e('0x24'),_0x3e75f8['name']);}else if(_0x4a6799<_0x3e75f8[_0xbc7e('0x102')]&&_0x3e75f8[_0xbc7e('0x1a9')]===_0xbc7e('0x1ac')){freeVariablesPredictive(_0x3e75f8);loggerPredictive['info'](_0xbc7e('0x1ad'),_0xbc7e('0x1ae'),_0x4a6799,_0xbc7e('0x1af'),_0x3e75f8[_0xbc7e('0x102')],_0xbc7e('0x24'),_0x3e75f8['name']);}else if(!ifInterval(_0x3e75f8[_0xbc7e('0x1a7')],_0x3e75f8[_0xbc7e('0x24')])&&_[_0xbc7e('0x38')](_0x3e75f8[_0xbc7e('0x70')])&&!_[_0xbc7e('0x38')](_0x3e75f8[_0xbc7e('0x24')])){_0x3e75f8[_0xbc7e('0x70')]=moment()['format'](_0xbc7e('0xf9'));loggerPredictive['info'](_0x3e75f8[_0xbc7e('0x3b')],_0xbc7e('0x1b0'),_0x3e75f8[_0xbc7e('0x70')]);this['averageHandleTime'](_0x3e75f8[_0xbc7e('0x1a7')])[_0xbc7e('0xb8')](this[_0xbc7e('0x1b1')](_0x3e75f8))[_0xbc7e('0xb8')](mergeDataErlangB(_0x3e75f8))[_0xbc7e('0xb8')](this[_0xbc7e('0x1b2')](_0x3e75f8))[_0xbc7e('0xb0')](loggerCatchPredictive(_0xbc7e('0x1b3'),_0x3e75f8));}else if(!ifInterval(_0x3e75f8['dialPredictiveInterval'],_0x3e75f8[_0xbc7e('0x70')])){_0x3e75f8['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x3e75f8[_0xbc7e('0x70')]=moment()[_0xbc7e('0x8f')](_0xbc7e('0xf9'));loggerPredictive[_0xbc7e('0x79')](_0x3e75f8[_0xbc7e('0x3b')],_0xbc7e('0x1b4'),_0x3e75f8[_0xbc7e('0x70')]);clearInterval(_0x3e75f8['handlePredictive']);_0x3e75f8['handlePredictive']=undefined;this[_0xbc7e('0xbe')](_0x3e75f8['dialPredictiveInterval'])['then'](this[_0xbc7e('0x1b1')](_0x3e75f8))['then'](mergeDataErlangB(_0x3e75f8))[_0xbc7e('0xb8')](this['startMethodPredictive'](_0x3e75f8))[_0xbc7e('0xb0')](loggerCatchPredictive(_0xbc7e('0x1b5'),_0x3e75f8));}else if(_0x3e75f8['predictiveIntervalAvailable']&&_0x299e31<_0x3e75f8[_0xbc7e('0x69')]-_0x4cbf04){freeVariablesPredictive(_0x3e75f8);loggerPredictive['info'](_0x3e75f8[_0xbc7e('0x3b')],_0xbc7e('0x1b6'),_0x299e31,')\x20are\x20less\x20than\x20threshold\x20(',_0x3e75f8[_0xbc7e('0x69')],'-',_0x4cbf04,'=',_0x3e75f8[_0xbc7e('0x69')]-_0x4cbf04,')');}else if(_0x3e75f8[_0xbc7e('0x69')]&&_0x299e31>_0x3e75f8[_0xbc7e('0x69')]+_0x302320){freeVariablesPredictive(_0x3e75f8);loggerPredictive[_0xbc7e('0x79')](_0x3e75f8[_0xbc7e('0x3b')],_0xbc7e('0x1b6'),_0x299e31,_0xbc7e('0x1b7'),_0x3e75f8[_0xbc7e('0x69')],'+',_0x302320,'=',_0x3e75f8[_0xbc7e('0x69')]+_0x302320,')');}};Dialer['prototype'][_0xbc7e('0x1b1')]=function(_0x2d0d24){var _0x376958=this;return function(_0x174ba9){return new BPromise(function(_0x297390,_0x1e88f3){_[_0xbc7e('0x89')](_0x2d0d24,_0x174ba9[0x0]);if(checkGetDataPredictive(_0x174ba9[0x0])){var _0x5515be=_0x2d0d24['predictiveIntervalAvailable']=_0x2d0d24[_0xbc7e('0x53')]+_0x2d0d24[_0xbc7e('0x4e')];var _0x3acf45=_0x2d0d24[_0xbc7e('0x1a7')]*0x3c;var _0x557689=_0x174ba9[0x0][_0xbc7e('0x64')]+_0x174ba9[0x0][_0xbc7e('0x7f')];var _0x3a08fe=(_0x174ba9[0x0][_0xbc7e('0x7c')]+_0x174ba9[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x174ba9[0x0][_0xbc7e('0x104')])/_0x174ba9[0x0]['predictiveIntervalTotalCalls'];_0x2d0d24[_0xbc7e('0x66')]=_0x3a08fe>0x0?_0x3a08fe:0x1;switch(_0x2d0d24[_0xbc7e('0x1a9')]){case'dropRate':var _0x46027e=_0x2d0d24[_0xbc7e('0x1b8')]/0x64;return _0x376958[_0xbc7e('0x1b9')](_0x5515be,_0x3acf45,_0x557689,_0x3a08fe,_0x46027e)['then'](function(_0x28aef0){return _0x297390(_0x28aef0);});case _0xbc7e('0x1ba'):var _0x448ea7=_0x2d0d24['dialPredictiveOptimizationPercentage']/0x64;return _0x376958['busyFactor'](_0x5515be,_0x3acf45,_0x557689,_0x3a08fe,_0x448ea7)[_0xbc7e('0xb8')](function(_0x54f6ca){return _0x297390(_0x54f6ca);});default:return _0x1e88f3(msgResponse(_0xbc7e('0x1bb'),_0xbc7e('0x123'),_0xbc7e('0x1bc')));}}else{return _0x1e88f3(msgResponse(_0xbc7e('0x1bb'),_0xbc7e('0x123'),_0xbc7e('0x1bd')));}});};};Dialer['prototype'][_0xbc7e('0x1be')]=function(_0x2c1e56){var _0x192643=this;return function(_0x2dc5fa){return new BPromise(function(_0x3aba52,_0x32ee8b){_[_0xbc7e('0x89')](_0x2c1e56,_0x2dc5fa[0x0]);if(checkGetDataPredictive(_0x2dc5fa[0x0])){loggerPredictive[_0xbc7e('0x79')](JSON['stringify'](_0x2dc5fa[0x0]));if(_0x2c1e56[_0xbc7e('0x1a9')]==='dropRate'){return _0x192643[_0xbc7e('0xc4')](_0x2c1e56['id'])['then'](function(_0x22a156){var _0x44bfc3=_0x2c1e56[_0xbc7e('0x4f')]-_0x22a156[0x0]['outboundQueuePauses'];var _0x2070ad=_0x2c1e56[_0xbc7e('0x1a7')]*0x3c;var _0x22c2a7=_0x2dc5fa[0x0][_0xbc7e('0x64')]+_0x2dc5fa[0x0][_0xbc7e('0x7f')];var _0x22926f=(_0x2dc5fa[0x0][_0xbc7e('0x7c')]+_0x2dc5fa[0x0][_0xbc7e('0x65')]+_0x2dc5fa[0x0][_0xbc7e('0x104')])/_0x2dc5fa[0x0][_0xbc7e('0x6a')];var _0x213d8b=_0x2c1e56['dialPredictiveOptimizationPercentage']/0x64;_0x2c1e56[_0xbc7e('0x68')]=_0x22a156[0x0][_0xbc7e('0x1bf')]||0x0;_0x2c1e56[_0xbc7e('0x66')]=_0x22926f>0x0?_0x22926f:0x1;return _0x192643[_0xbc7e('0x1b9')](_0x44bfc3,_0x2070ad,_0x22c2a7,_0x22926f,_0x213d8b);})[_0xbc7e('0xb8')](function(_0xf66b00){return _0x3aba52(_0xf66b00);})[_0xbc7e('0xb0')](function(_0x4d0c8d){return _0x32ee8b(msgResponse(_0xbc7e('0x1c0'),'Failure',JSON['stringify'](_0x4d0c8d)));});}if(_0x2c1e56[_0xbc7e('0x1a9')]===_0xbc7e('0x1ba')){return _0x192643[_0xbc7e('0xc4')](_0x2c1e56['id'])[_0xbc7e('0xb8')](function(_0x157bb7){var _0x5aeec2=_0x2c1e56['loggedIn']-_0x157bb7[0x0][_0xbc7e('0x1bf')];var _0x34907b=_0x2c1e56[_0xbc7e('0x1a7')]*0x3c;var _0x207f08=_0x2dc5fa[0x0][_0xbc7e('0x64')]+_0x2dc5fa[0x0][_0xbc7e('0x7f')];var _0x3d2bca=(_0x2dc5fa[0x0][_0xbc7e('0x7c')]+_0x2dc5fa[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2dc5fa[0x0][_0xbc7e('0x104')])/_0x2dc5fa[0x0][_0xbc7e('0x6a')];var _0x367c17=_0x2c1e56[_0xbc7e('0x1b8')]/0x64;_0x2c1e56[_0xbc7e('0x68')]=_0x157bb7[0x0][_0xbc7e('0x1bf')]||0x0;_0x2c1e56[_0xbc7e('0x66')]=_0x3d2bca>0x0?_0x3d2bca:0x1;return _0x192643[_0xbc7e('0x1c1')](_0x5aeec2,_0x34907b,_0x207f08,_0x3d2bca,_0x367c17);})[_0xbc7e('0xb8')](function(_0x319e72){return _0x3aba52(_0x319e72);})[_0xbc7e('0xb0')](function(_0x1bdd3a){return _0x32ee8b(msgResponse(_0xbc7e('0x1c0'),_0xbc7e('0x123'),JSON[_0xbc7e('0x46')](_0x1bdd3a)));});}}else{return _0x32ee8b(msgResponse(_0xbc7e('0x1bb'),_0xbc7e('0x123'),_0xbc7e('0x1bd')));}});};};Dialer[_0xbc7e('0x18')][_0xbc7e('0x1b2')]=function(_0x298462){var _0x503adc=this;return function(){var _0x464e7e=0x0;var _0x56d6f1=Math[_0xbc7e('0x1a2')](_0x298462['erlangCallToSecond']*0x3e8);if(_0x56d6f1>0x0){_0x56d6f1=_0x56d6f1<0x64?0x64:_0x56d6f1;loggerPredictive[_0xbc7e('0x79')](_0x298462[_0xbc7e('0x3b')],'one\x20call\x20every:',_0x56d6f1,'milliseconds');_0x298462[_0xbc7e('0x8b')]=setInterval(function(){_0x503adc[_0xbc7e('0x8b')](_0x298462);loggerPredictiveCalls['info'](_0xbc7e('0x1c2'),_0x464e7e+=0x1);},_0x56d6f1);}else{loggerPredictive['info'](_0x298462[_0xbc7e('0x3b')],_0xbc7e('0x1c3'));}};};Dialer[_0xbc7e('0x18')]['checkContactBlack']=function(_0x18d45d,_0x123ddf){var _0x2780f9=this;return function(_0x56c014){if(_[_0xbc7e('0x43')](_0x56c014)){if(_['isNil'](_0x123ddf[_0xbc7e('0xd1')])||!_0x123ddf['recallme']){if(_0x18d45d[_0xbc7e('0x58')]===_0xbc7e('0x13b')){_0x18d45d[_0xbc7e('0x10d')]=_[_0xbc7e('0x38')](_0x18d45d['queueStatusComplete'])?!![]:_0x18d45d['queueStatusComplete'];var _0x2bcb31=uuid['v4']();_0x2780f9[_0xbc7e('0x21')][_0x2bcb31]=new Action(_0x18d45d,_0x123ddf,_0x2bcb31);loggerBooked['info']('[booked][checkContactBlack]',_0x2bcb31,'queueStatusComplete:\x20',JSON['stringify'](_0x18d45d[_0xbc7e('0x10d')]),_0xbc7e('0x1c4'),_0x18d45d['name']);if(_0x18d45d['queueStatusComplete']){_0x18d45d[_0xbc7e('0x10d')]=![];_0x2780f9[_0xbc7e('0x25')][_0x2780f9[_0xbc7e('0x21')][_0x2bcb31][_0xbc7e('0xb4')]]=[];ami[_0xbc7e('0xad')]({'actionid':_0x2bcb31,'action':_0xbc7e('0x1c5'),'queue':_0x18d45d[_0xbc7e('0x3b')]})['catch'](function(_0x586781){_0x2780f9['updateOriginated'](_0x18d45d);_0x2780f9[_0xbc7e('0xc1')]({'active':![],'ContactId':_0x2780f9[_0xbc7e('0x21')][_0x2bcb31][_0xbc7e('0xcf')],'ListId':_0x2780f9['actions'][_0x2bcb31][_0xbc7e('0xd0')],'VoiceQueueId':_0x2780f9[_0xbc7e('0x21')][_0x2bcb31]['VoiceQueueId']||undefined,'CampaignId':_0x2780f9[_0xbc7e('0x21')][_0x2bcb31][_0xbc7e('0xd3')]||undefined})['catch'](loggerCatch(_0xbc7e('0x1c6')));delete _0x2780f9[_0xbc7e('0x21')][_0x2bcb31];});}else{loggerBooked[_0xbc7e('0x79')](_0xbc7e('0x1c7'),JSON[_0xbc7e('0x46')](_0x18d45d[_0xbc7e('0x10d')]),'Queue:\x20',_0x18d45d['name']);_0x2780f9[_0xbc7e('0xb2')](_0x18d45d);_0x2780f9[_0xbc7e('0xc1')]({'active':![],'ContactId':_0x2780f9[_0xbc7e('0x21')][_0x2bcb31][_0xbc7e('0xcf')],'ListId':_0x2780f9[_0xbc7e('0x21')][_0x2bcb31][_0xbc7e('0xd0')],'VoiceQueueId':_0x2780f9[_0xbc7e('0x21')][_0x2bcb31][_0xbc7e('0xd2')]||undefined,'CampaignId':_0x2780f9['actions'][_0x2bcb31]['CampaignId']||undefined})[_0xbc7e('0xb0')](loggerCatch(_0xbc7e('0x1c6')));delete _0x2780f9[_0xbc7e('0x21')][_0x2bcb31];}}else{return _0x2780f9['actionOriginate'](_0x18d45d,_0x123ddf);}}else{if(getDiff(_0x123ddf['scheduledat'])<_0x18d45d[_0xbc7e('0x1c8')]*0x3c){_0x2780f9[_0xbc7e('0x8c')][_0xbc7e('0x110')](_0x123ddf['id'])[_0xbc7e('0x1a')](function(){_0x2780f9['updateOriginated'](_0x18d45d);});}else{_0x18d45d['outboundReCallsDay']+=0x1;_0x2780f9[_0xbc7e('0xb2')](_0x18d45d);if(_0x18d45d[_0xbc7e('0x1c9')]){_0x2780f9[_0xbc7e('0xc1')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x123ddf[_0xbc7e('0xcf')],'ListId':_0x123ddf[_0xbc7e('0xd0')],'VoiceQueueId':_0x123ddf['VoiceQueueId']||undefined,'CampaignId':_0x123ddf[_0xbc7e('0xd3')]||undefined})[_0xbc7e('0xb0')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x2780f9[_0xbc7e('0xc8')](createObjHistory(_0x18d45d,_0x123ddf,_0xbc7e('0x1ca'),0x17,_0xbc7e('0x1cb')))['catch'](loggerCatch(_0xbc7e('0x1cc')));}else{_0x2780f9[_0xbc7e('0xce')](createObjHistory(_0x18d45d,_0x123ddf,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]',_0xbc7e('0x1cd'));}}}}else{_0x18d45d[_0xbc7e('0x1ce')]+=0x1;_0x2780f9[_0xbc7e('0xce')](createObjHistory(_0x18d45d,_0x123ddf,_0xbc7e('0x1cf'),0xd,_0xbc7e('0x1d0')),_0xbc7e('0x1d1'),_0xbc7e('0x1d2'));throw _0xbc7e('0x1d3');}};};Dialer['prototype'][_0xbc7e('0x1d4')]=function(_0x43073e){var _0x4bd139=this;var _0x4a0a19=[];var _0x5f2f48=_0x43073e[_0xbc7e('0x1d5')]-_0x43073e[_0xbc7e('0x6b')]-_0x43073e[_0xbc7e('0x1d6')];emitCampaignSummary(_0x43073e);if(_0x5f2f48>0x0){if(_0x5f2f48>this[_0xbc7e('0x1f')]){_0x5f2f48=this['maxNumberOriginate'];}_0x43073e[_0xbc7e('0x1d6')]+=_0x5f2f48;this[_0xbc7e('0xc3')](_0x43073e['id'],_0x5f2f48,_0x43073e[_0xbc7e('0x1d7')])[_0xbc7e('0xb8')](function(_0x313349){_0x43073e[_0xbc7e('0x1d6')]-=_0x5f2f48;_0x43073e[_0xbc7e('0x1d6')]=_0x43073e[_0xbc7e('0x1d6')]>0x0?_0x43073e[_0xbc7e('0x1d6')]:0x0;if(!checkContactEmpty(_0x313349)){_0x43073e[_0xbc7e('0x39')]=_0xbc7e('0x9a');logger[_0xbc7e('0x79')](_0xbc7e('0x1d8')+_0x43073e['name']);}else{_0x43073e[_0xbc7e('0x6b')]+=_0x313349[_0xbc7e('0x94')];_0x43073e['message']=_0xbc7e('0x1d9');for(var _0x4d985b=0x0;_0x4d985b<_0x313349[_0xbc7e('0x94')];_0x4d985b+=0x1){_0x43073e[_0xbc7e('0x1da')]+=0x1;if(_[_0xbc7e('0xac')](_0x313349[_0x4d985b])||_['isNil'](_0x313349[_0x4d985b]['Contact'])||_['isNil'](_0x313349[_0x4d985b][_0xbc7e('0x148')]['phone'])){_0x4bd139['emptyContact']('[actionOriginate]\x20',_0x43073e,_0x313349[_0x4d985b]);}else{_0x4bd139[_0xbc7e('0xbc')](_[_0xbc7e('0x10b')](_0x313349[_0x4d985b],[_0xbc7e('0xd3'),_0xbc7e('0x1db')]))[_0xbc7e('0xb8')](_0x4bd139[_0xbc7e('0x1dc')](_0x43073e,_0x313349[_0x4d985b]))[_0xbc7e('0xb0')](_0x4bd139[_0xbc7e('0x1dd')](_0xbc7e('0x1de'),_0x43073e));}}}})[_0xbc7e('0xb0')](loggerGetContactDialer(_0xbc7e('0x1df'),_0x43073e,_0x5f2f48));}};Dialer[_0xbc7e('0x18')][_0xbc7e('0x138')]=function(_0x4d59fa,_0x1c212b){var _0x561054=this;var _0x23c69b=[];var _0x48516f=_0x1c212b>=0x1?_0x1c212b:0x1;var _0x3c55f3=[];if(_0x4d59fa[_0xbc7e('0x58')]===_0xbc7e('0x13b')){_0x48516f=0x1;}var _0x29aa73=Math[_0xbc7e('0x1a2')](_0x4d59fa[_0xbc7e('0x4e')]*_0x48516f)-_0x4d59fa[_0xbc7e('0x6b')]-_0x4d59fa[_0xbc7e('0x1d6')];emitVoiceQueueSummary(_0x4d59fa);if(_0x4d59fa[_0xbc7e('0x1e0')]>0x0){var _0x54768f=_0x4d59fa[_0xbc7e('0x1e0')]-_0x4d59fa[_0xbc7e('0x6b')]-_0x4d59fa[_0xbc7e('0x53')]-_0x4d59fa[_0xbc7e('0x1d6')]-_0x4d59fa['pTalking'];if(_0x29aa73>_0x54768f){_0x29aa73=_0x54768f;}}if(_0x29aa73>0x0){if(_0x4d59fa[_0xbc7e('0x58')]===_0xbc7e('0x13b')){_0x29aa73=0x1;}if(_0x29aa73>this['maxNumberOriginate']){_0x29aa73=this['maxNumberOriginate'];}_0x4d59fa[_0xbc7e('0x1d6')]+=_0x29aa73;for(var _0x5c7429 in this[_0xbc7e('0x1d')]){if(this[_0xbc7e('0x1d')][_0xbc7e('0x95')](_0x5c7429)){if(this[_0xbc7e('0x1d')][_0x5c7429][_0xbc7e('0xa3')]===_0xbc7e('0x1e1')&&this[_0xbc7e('0x1d')][_0x5c7429][_0xbc7e('0xae')]===_0xbc7e('0xda')){_0x23c69b[_0xbc7e('0x128')](this[_0xbc7e('0x1d')][_0x5c7429]['id']);}}}this[_0xbc7e('0x1e2')](_0x4d59fa['id'],_0x23c69b,_0x29aa73,_0x4d59fa[_0xbc7e('0x1d7')])[_0xbc7e('0xb8')](function(_0x403a64){_0x4d59fa[_0xbc7e('0x1d6')]-=_0x29aa73;_0x4d59fa['temp']=_0x4d59fa['temp']>0x0?_0x4d59fa[_0xbc7e('0x1d6')]:0x0;if(!checkContactEmpty(_0x403a64)){_0x561054[_0xbc7e('0xb6')](_0x4d59fa)[_0xbc7e('0xb8')](sendMessageReschedule(_0x4d59fa))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x4d59fa[_0xbc7e('0x6b')]+=_0x403a64[_0xbc7e('0x94')];_0x4d59fa['message']=_0x4d59fa[_0xbc7e('0x58')]===_0xbc7e('0x13b')?_0xbc7e('0x152'):_0xbc7e('0x1d9');for(var _0x284c0b=0x0;_0x284c0b<_0x403a64['length'];_0x284c0b+=0x1){if(_[_0xbc7e('0xac')](_0x403a64[_0x284c0b])||_['isNil'](_0x403a64[_0x284c0b][_0xbc7e('0x148')])||_[_0xbc7e('0xac')](_0x403a64[_0x284c0b][_0xbc7e('0x148')]['phone'])){_0x561054[_0xbc7e('0xcc')]('[actionOriginate]\x20',_0x4d59fa,_0x403a64[_0x284c0b]);}else{_0x561054['checkIsBlackList'](_[_0xbc7e('0x10b')](_0x403a64[_0x284c0b],[_0xbc7e('0xd2'),_0xbc7e('0x1db')]))[_0xbc7e('0xb8')](_0x561054[_0xbc7e('0x1dc')](_0x4d59fa,_0x403a64[_0x284c0b]))[_0xbc7e('0xb0')](_0x561054[_0xbc7e('0x1dd')](_0xbc7e('0x1e3'),_0x4d59fa));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x4d59fa,_0x29aa73));}};Dialer[_0xbc7e('0x18')][_0xbc7e('0x8b')]=function(_0x27c392){var _0x305e52=this;if(_0x27c392[_0xbc7e('0x1e0')]>0x0){var _0x4d0e81=_0x27c392[_0xbc7e('0x1e0')]-_0x27c392[_0xbc7e('0x6b')]-_0x27c392[_0xbc7e('0x53')];if(_0x4d0e81>0x0){this['tryOriginatePredictive'](_0x27c392);}else{loggerPredictiveCalls[_0xbc7e('0x79')]('[handlePredictive][limitChannel]');}}else{this['tryOriginatePredictive'](_0x27c392);}};Dialer[_0xbc7e('0x18')][_0xbc7e('0x1e4')]=function(_0x3d27ee){var _0x304a79=this;var _0x43179a=[];_0x3d27ee[_0xbc7e('0x6b')]+=0x1;for(var _0x54892c in this[_0xbc7e('0x1d')]){if(this['agents']['hasOwnProperty'](_0x54892c)){if(this['agents'][_0x54892c][_0xbc7e('0xa3')]==='not_inuse'&&this[_0xbc7e('0x1d')][_0x54892c]['status']===_0xbc7e('0xda')){_0x43179a['push'](this[_0xbc7e('0x1d')][_0x54892c]['id']);}}}this[_0xbc7e('0x1e2')](_0x3d27ee['id'],_0x43179a,0x1,_0x3d27ee['dialOrderByScheduledAt'])[_0xbc7e('0xb8')](function(_0x219354){if(!checkContactEmpty(_0x219354)){checkContactLowerLimitOriginate(_0x3d27ee,0x1,0x0);_0x304a79[_0xbc7e('0xb6')](_0x3d27ee)[_0xbc7e('0xb8')](sendMessageReschedule(_0x3d27ee))[_0xbc7e('0xb0')](loggerCatch(_0xbc7e('0xb9')));}else{_0x3d27ee['message']=_0xbc7e('0x1d9');if(_[_0xbc7e('0xac')](_0x219354[0x0])||_['isNil'](_0x219354[0x0][_0xbc7e('0x148')])||_[_0xbc7e('0xac')](_0x219354[0x0][_0xbc7e('0x148')][_0xbc7e('0x149')])){_0x304a79[_0xbc7e('0xcc')](_0xbc7e('0x1e3'),_0x3d27ee,_0x219354[0x0]);}else{_0x304a79[_0xbc7e('0xba')](_['pick'](_0x219354[0x0],[_0xbc7e('0xd2'),'Contact.phone']))[_0xbc7e('0xb8')](_0x304a79[_0xbc7e('0x1dc')](_0x3d27ee,_0x219354[0x0]))['catch'](_0x304a79['loggerHandler']('[actionOriginatePredictive]\x20',_0x3d27ee));}}})['catch'](loggerGetContactDialer(_0xbc7e('0x1e5'),_0x3d27ee,0x1));emitVoiceQueueSummary(_0x3d27ee);};Dialer['prototype'][_0xbc7e('0x1b9')]=function(_0x5289d4,_0x276828,_0x5e8ec4,_0x5f475e,_0x16796b,_0x486fde){loggerPredictive[_0xbc7e('0x79')](_0xbc7e('0x1e6'));loggerPredictive[_0xbc7e('0x79')]('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',_0x5289d4);loggerPredictive['info'](_0xbc7e('0x1e7'),_0x276828);loggerPredictive['info'](_0xbc7e('0x1e8'),_0x5e8ec4);loggerPredictive[_0xbc7e('0x79')](_0xbc7e('0x1e9'),_0x5f475e);loggerPredictive[_0xbc7e('0x79')](_0xbc7e('0x1ea'),_0x16796b);loggerPredictive[_0xbc7e('0x79')]('---------------------------');return new BPromise(function(_0x2dd5a8,_0x106405){if(_0x5289d4<=0x0||isNaN(_0x5289d4)){return _0x106405(msgResponse('[abandonmentRate]',_0xbc7e('0x45'),_0xbc7e('0x1eb')+_0x5289d4));}if(_0x5e8ec4<=0x0||isNaN(_0x5e8ec4)){return _0x106405(msgResponse(_0xbc7e('0x1ec'),_0xbc7e('0x45'),'Ts\x20=\x20'+_0x5e8ec4));}if(_0x5f475e<=0x0||isNaN(_0x5f475e)){return _0x106405(msgResponse('[abandonmentRate]','Error',_0xbc7e('0x1ed')+_0x5f475e));}if(_0x276828<=0x0||isNaN(_0x276828)){return _0x106405(msgResponse(_0xbc7e('0x1ec'),_0xbc7e('0x45'),_0xbc7e('0x1ee')+_0x276828));}if(_0x16796b<=0x0||isNaN(_0x16796b)){return _0x106405(msgResponse(_0xbc7e('0x1ec'),_0xbc7e('0x45'),_0xbc7e('0x1ef')+_0x16796b));}_0x486fde=_0x486fde||0x0;var _0x17a98a=0x1/_0x5e8ec4;var _0x530abd=0x0;var _0x42f957=0x0;var _0x14d478=0x0;var _0x5028ce=0x0;for(var _0x2e916b=0x0;_0x14d478<_0x16796b;_0x2e916b+=0x1){_0x42f957=_0x2e916b/_0x276828;_0x530abd=(_0x5f475e*_0x42f957+_0x486fde)/_0x17a98a;_0x14d478=erlangb(_0x530abd,_0x5289d4);_0x5028ce=_0x530abd/_0x5289d4*(0x1-erlangb(_0x530abd,_0x5289d4));}return _0x2dd5a8({'erlangCalls':_0x2e916b,'erlangCallToSecond':_0x276828/_0x2e916b,'erlangAbandonmentRate':_0x14d478,'erlangBusyFactor':_0x5028ce});});};Dialer[_0xbc7e('0x18')][_0xbc7e('0x1c1')]=function(_0x321126,_0x21d4fa,_0x1a30fb,_0x4fb356,_0x33f2c4,_0x3dae50){loggerPredictive[_0xbc7e('0x79')](_0xbc7e('0x1f0'));loggerPredictive[_0xbc7e('0x79')](_0xbc7e('0x1f1'),_0x321126);loggerPredictive['info'](_0xbc7e('0x1e7'),_0x21d4fa);loggerPredictive['info'](_0xbc7e('0x1e8'),_0x1a30fb);loggerPredictive['info'](_0xbc7e('0x1e9'),_0x4fb356);loggerPredictive[_0xbc7e('0x79')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x33f2c4);loggerPredictive['info'](_0xbc7e('0x81'));return new BPromise(function(_0x167c46,_0x4c30f2){if(_0x321126<=0x0||isNaN(_0x321126)){return _0x4c30f2(msgResponse('[busyFactor]',_0xbc7e('0x45'),'m\x20=\x20'+_0x321126));}if(_0x1a30fb<=0x0||isNaN(_0x1a30fb)){return _0x4c30f2(msgResponse(_0xbc7e('0x1f2'),_0xbc7e('0x45'),'Ts\x20=\x20'+_0x1a30fb));}if(_0x4fb356<=0x0||isNaN(_0x4fb356)){return _0x4c30f2(msgResponse(_0xbc7e('0x1f2'),_0xbc7e('0x45'),_0xbc7e('0x1ed')+_0x4fb356));}if(_0x21d4fa<=0x0||isNaN(_0x21d4fa)){return _0x4c30f2(msgResponse(_0xbc7e('0x1f2'),_0xbc7e('0x45'),_0xbc7e('0x1ee')+_0x21d4fa));}if(_0x33f2c4<=0x0||isNaN(_0x33f2c4)){return _0x4c30f2(msgResponse('[busyFactor]',_0xbc7e('0x45'),_0xbc7e('0x1f3')+_0x33f2c4));}_0x3dae50=_0x3dae50||0x0;var _0x2df233=0x1/_0x1a30fb;var _0x443e6b=0x0;var _0x343b52=0x0;var _0x29e6d1=0x0;var _0x28cbd8=0x0;for(var _0x276225=0x0;_0x28cbd8<_0x33f2c4;_0x276225+=0x1){_0x343b52=_0x276225/_0x21d4fa;_0x443e6b=(_0x4fb356*_0x343b52+_0x3dae50)/_0x2df233;_0x29e6d1=erlangb(_0x443e6b,_0x321126);_0x28cbd8=_0x443e6b/_0x321126*(0x1-erlangb(_0x443e6b,_0x321126));}return _0x167c46({'erlangCalls':_0x276225,'erlangCallToSecond':_0x21d4fa/_0x276225,'erlangAbandonmentRate':_0x29e6d1,'erlangBusyFactor':_0x28cbd8});});};module['exports']=Dialer; \ No newline at end of file +var _0x7bce=['evt\x20is\x20undefine','NoSuchNumber','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','checkRetriveMax','reason\x203\x20ringing\x20no\x20answer','Busy','reason\x205\x20busy','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','outboundReCallsDay','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','ivrTotalCallsDays','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','dialOrderByScheduledAt','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','RUNNING','Contact.phone','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','P:\x20\x20\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','m\x20=\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','enqueue','tail','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','isUndefined','message','name','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','isEmpty','[ifTime][Action]','Error','milliseconds','diff','seconds','emit','type','outbound','strategy','available','loggedIn','pTalking','sumDuration','sumHoldTime','unmanaged','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','Trunk','active','callerid','stringify','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','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','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\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','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','loopClearZombieChannels','clearZombieChannels','[uniqueid]','[actions]','sequence','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','then','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','getContactDialer','getContactDialerIvr','[getContactDialer]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[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','SIP/%s','reachable','unmonitored','variable','exten','dialAMDActive','value','HANGUP','uniqueid','state','HangupInAMD','membername','AMD','[syncHangupInAMD]','amd','[syncMachine][createHistory]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','Machine','[syncMachineIvr][createHistory]','[syncMachineIvr]','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete]','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','dropreason','Abandoned','actionid','paused','stateinterface','locked','rrmemory','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','_rr','length','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','run','[Catch][Preview][syncQueueStatusComplete]','finally','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','iftime\x20%s,%s','interval','indexOf','true','some','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','handlePower','power','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','handleIvr','dialActive','dialTimezone','dialGlobalInterval','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','updatedAt','XMD-','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','starttime','endtime','[originate][error]','getQueue','response','callProgressDetecting','countbusyretry','countcongestionretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','countnoanswerretry','add','dialNoAnswerRetryFrequency','minutes','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','entity\x20is\x20undefine'];(function(_0x568427,_0x742280){var _0x3c2f86=function(_0x1455f0){while(--_0x1455f0){_0x568427['push'](_0x568427['shift']());}};_0x3c2f86(++_0x742280);}(_0x7bce,0x66));var _0xe7bc=function(_0x2b80c3,_0x37315f){_0x2b80c3=_0x2b80c3-0x0;var _0xd975c8=_0x7bce[_0x2b80c3];return _0xd975c8;};'use strict';var util=require(_0xe7bc('0x0'));var _=require(_0xe7bc('0x1'));var BPromise=require(_0xe7bc('0x2'));var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var md5=require(_0xe7bc('0x3'));var Redis=require(_0xe7bc('0x4'));var config=require(_0xe7bc('0x5'));var logger=require(_0xe7bc('0x6'))(_0xe7bc('0x7'));var loggerBooked=require('../../../config/logger')(_0xe7bc('0x8'));var loggerPredictive=require(_0xe7bc('0x6'))('predictive');var loggerPredictiveCalls=require(_0xe7bc('0x6'))(_0xe7bc('0x9'));var loggerSyncQueueSummary=require(_0xe7bc('0x6'))(_0xe7bc('0xa'));var ami=require(_0xe7bc('0xb'));config[_0xe7bc('0xc')]=_[_0xe7bc('0xd')](config[_0xe7bc('0xc')],{'host':_0xe7bc('0xe'),'port':0x18eb});var io=require(_0xe7bc('0xf'))(new Redis(config[_0xe7bc('0xc')]));var cmHopper=require(_0xe7bc('0x10'));var cmHopperFinal=require(_0xe7bc('0x11'));var cmHopperHistory=require(_0xe7bc('0x12'));var cmHopperBlack=require(_0xe7bc('0x13'));var voiceQueueRt=require(_0xe7bc('0x14'));var Action=require(_0xe7bc('0x15'));var History=require(_0xe7bc('0x16'));var Final=require(_0xe7bc('0x17'));var AgentComplete=require(_0xe7bc('0x18'));var QueueCallerAbandon=require(_0xe7bc('0x19'));var Hangup=require(_0xe7bc('0x1a'));var ipAgi=process['env'][_0xe7bc('0x1b')]||_0xe7bc('0x1c');var strategy={'rrmemory':'rrmemory','roundrobin':_0xe7bc('0x1d')};var Sequence=function(){};Sequence[_0xe7bc('0x1e')][_0xe7bc('0x1f')]=function(_0x53ecb0){this[_0xe7bc('0x20')]=this[_0xe7bc('0x20')]?this[_0xe7bc('0x20')]['finally'](_0x53ecb0):_0x53ecb0();};function Dialer(_0x55be35,_0x3fbab9){this['sequence']=new Sequence();this[_0xe7bc('0x21')]=_0x3fbab9;this[_0xe7bc('0x22')]=_0x55be35[_0xe7bc('0x22')];this[_0xe7bc('0x23')]=_0x55be35[_0xe7bc('0x23')];this[_0xe7bc('0x24')]=_0x55be35[_0xe7bc('0x24')];this[_0xe7bc('0x25')]=_0x55be35[_0xe7bc('0x25')];this[_0xe7bc('0x26')]=config[_0xe7bc('0x26')]||0x2;this[_0xe7bc('0x27')]={};this[_0xe7bc('0x28')]={};this[_0xe7bc('0x29')]={};this[_0xe7bc('0x2a')]={};this['optionPredictive']={};this[_0xe7bc('0x2b')]={};this[_0xe7bc('0x2c')]={};this[_0xe7bc('0x2d')]={};this[_0xe7bc('0x2e')]={};this[_0xe7bc('0x2f')]={};ami['on']('agentconnect',this[_0xe7bc('0x30')][_0xe7bc('0x31')](this));ami['on'](_0xe7bc('0x32'),this[_0xe7bc('0x33')][_0xe7bc('0x31')](this));ami['on']('originateresponse',this[_0xe7bc('0x34')]['bind'](this));ami['on'](_0xe7bc('0x35'),this[_0xe7bc('0x36')]['bind'](this));ami['on'](_0xe7bc('0x37'),this[_0xe7bc('0xa')][_0xe7bc('0x31')](this));ami['on']('hangup',this['syncHangup'][_0xe7bc('0x31')](this));ami['on'](_0xe7bc('0x38'),this[_0xe7bc('0x39')][_0xe7bc('0x31')](this));ami['on'](_0xe7bc('0x3a'),this[_0xe7bc('0x3b')][_0xe7bc('0x31')](this));ami['on']('queuemember',this[_0xe7bc('0x3c')][_0xe7bc('0x31')](this));ami['on'](_0xe7bc('0x3d'),this[_0xe7bc('0x3e')]['bind'](this));this[_0xe7bc('0x3f')]();this['loopClearZombieChannels']();}function isNotNull(_0x36df5b){return _0x36df5b!==null&&!_[_0xe7bc('0x40')](_0x36df5b);}function checkIsLoggedIn(_0x5ac669,_0x27d609){return function(){if(_0x27d609<=0x0){_0x5ac669[_0xe7bc('0x41')]='AGENTS_NOT_LOGGED';throw _0x5ac669[_0xe7bc('0x42')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x3f12d8){return _0x3f12d8;}function checkIsActive(_0xf1f991,_0x58b247){return function(){if(!isActive(_0x58b247)){_0xf1f991[_0xe7bc('0x41')]=_0xe7bc('0x43');throw _0xf1f991[_0xe7bc('0x42')]+_0xe7bc('0x44');}};}function checkInterval(_0x496c2b){return function(){if(!isNotNull(_0x496c2b['Interval'])){_0x496c2b['message']=_0xe7bc('0x45');throw _0x496c2b[_0xe7bc('0x42')]+_0xe7bc('0x46');}if(!isNotNull(_0x496c2b[_0xe7bc('0x47')][_0xe7bc('0x48')])){_0x496c2b[_0xe7bc('0x41')]=_0xe7bc('0x45');throw _0x496c2b['name']+_0xe7bc('0x46');}if(!isNotNull(_[_0xe7bc('0x49')](_0x496c2b[_0xe7bc('0x47')]['Intervals']))){_0x496c2b[_0xe7bc('0x41')]='INTERVAL_IS_NULL';throw _0x496c2b[_0xe7bc('0x42')]+_0xe7bc('0x46');}};}function msgResponse(_0x277bfb,_0x3f1fa1,_0x1cd4b9){return{'action':_0x277bfb,'response':_0x3f1fa1,'message':_0x1cd4b9,'stack':_0x1cd4b9};}function myreject(_0x2cecc9){return function(_0x406bb6){return _0x2cecc9(msgResponse(_0xe7bc('0x4a'),_0xe7bc('0x4b'),JSON['stringify'](_0x406bb6)));};}function getSeconds(_0x5ddf62,_0x1027ab){var _0x55c514=moment(_0x5ddf62)['milliseconds'](0x0);var _0x2552b2=moment(_0x1027ab)[_0xe7bc('0x4c')](0x0);return _0x55c514[_0xe7bc('0x4d')](_0x2552b2,_0xe7bc('0x4e'));}function emit(_0x172f2c,_0x28c8ef,_0x4749ce){io['to'](_0x172f2c)[_0xe7bc('0x4f')](_0x28c8ef,_0x4749ce);}function emitVoiceQueueSummary(_0x9ae38e){if(_0x9ae38e[_0xe7bc('0x50')]===_0xe7bc('0x51')){var _0x55e5d7={'id':_0x9ae38e['id'],'name':_0x9ae38e[_0xe7bc('0x42')],'strategy':_0x9ae38e[_0xe7bc('0x52')],'answered':_0x9ae38e['answered'],'available':_0x9ae38e[_0xe7bc('0x53')],'loggedIn':_0x9ae38e[_0xe7bc('0x54')],'pTalking':_0x9ae38e[_0xe7bc('0x55')],'sumBillable':_0x9ae38e['sumBillable'],'sumDuration':_0x9ae38e[_0xe7bc('0x56')],'sumHoldTime':_0x9ae38e[_0xe7bc('0x57')]||0x0,'talking':_0x9ae38e['talking'],'total':_0x9ae38e['total'],'type':_0x9ae38e[_0xe7bc('0x50')],'unmanaged':_0x9ae38e[_0xe7bc('0x58')],'abandoned':_0x9ae38e[_0xe7bc('0x59')],'waiting':_0x9ae38e[_0xe7bc('0x5a')],'loggedInDb':_0x9ae38e[_0xe7bc('0x5b')],'dialActive':_0x9ae38e['dialActive'],'dialMethod':_0x9ae38e[_0xe7bc('0x5c')],'dialOriginateCallerIdName':_0x9ae38e[_0xe7bc('0x5d')],'dialOriginateCallerIdNumber':_0x9ae38e['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x9ae38e[_0xe7bc('0x5e')],'dialPrefix':_0x9ae38e['dialPrefix'],'outboundAnswerAgiCallsDay':_0x9ae38e[_0xe7bc('0x5f')],'outboundAnswerCallsDay':_0x9ae38e[_0xe7bc('0x60')],'outboundBlacklistCallsDay':_0x9ae38e[_0xe7bc('0x61')],'outboundBusyCallsDay':_0x9ae38e[_0xe7bc('0x62')],'outboundCongestionCallsDay':_0x9ae38e[_0xe7bc('0x63')],'outboundDropCallsDayACS':_0x9ae38e['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x9ae38e[_0xe7bc('0x64')],'outboundDropCallsDayTimeout':_0x9ae38e['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x9ae38e[_0xe7bc('0x65')],'outboundNoSuchCallsDay':_0x9ae38e[_0xe7bc('0x66')],'outboundOriginateFailureCallsDay':_0x9ae38e['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x9ae38e['outboundReCallsDay'],'outboundRejectCallsDay':_0x9ae38e[_0xe7bc('0x67')],'outboundUnknownCallsDay':_0x9ae38e[_0xe7bc('0x68')],'predictiveIntervalAnsweredCalls':_0x9ae38e['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x9ae38e['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x9ae38e[_0xe7bc('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0x9ae38e[_0xe7bc('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x9ae38e[_0xe7bc('0x6b')],'predictiveIntervalErlangCalls':_0x9ae38e[_0xe7bc('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x9ae38e[_0xe7bc('0x6d')],'predictiveIntervalHitRate':_0x9ae38e[_0xe7bc('0x6e')],'predictiveIntervalMultiplicativeFactor':_0x9ae38e[_0xe7bc('0x6f')],'predictiveIntervalPauses':_0x9ae38e[_0xe7bc('0x70')],'predictiveIntervalAvailable':_0x9ae38e[_0xe7bc('0x71')],'predictiveIntervalTotalCalls':_0x9ae38e[_0xe7bc('0x72')],'message':_0x9ae38e['message'],'originated':_0x9ae38e[_0xe7bc('0x73')],'erlangCalls':_0x9ae38e[_0xe7bc('0x74')],'erlangCallToSecond':_0x9ae38e[_0xe7bc('0x75')],'erlangAbandonmentRate':_0x9ae38e['erlangAbandonmentRate'],'erlangBusyFactor':_0x9ae38e[_0xe7bc('0x76')],'startPredictive':_0x9ae38e[_0xe7bc('0x2b')],'startProgressive':_0x9ae38e['startProgressive']};if(_0x9ae38e[_0xe7bc('0x77')]){_0x55e5d7[_0xe7bc('0x77')]={'id':_0x9ae38e['Trunk']['id'],'name':_0x9ae38e['Trunk'][_0xe7bc('0x42')],'active':_0x9ae38e['Trunk'][_0xe7bc('0x78')],'callerid':_0x9ae38e[_0xe7bc('0x77')][_0xe7bc('0x79')]};}if(_0x9ae38e[_0xe7bc('0x47')]){_0x55e5d7[_0xe7bc('0x47')]={'id':_0x9ae38e['Interval']['id'],'name':_0x9ae38e[_0xe7bc('0x47')][_0xe7bc('0x42')]};}var _0x5edce6=md5(JSON[_0xe7bc('0x7a')](_0x55e5d7));if(_0x9ae38e[_0xe7bc('0x3')]!==_0x5edce6){_0x9ae38e[_0xe7bc('0x3')]=_0x5edce6;emit(util[_0xe7bc('0x7b')](_0xe7bc('0x7c'),_0x55e5d7[_0xe7bc('0x42')]),_0xe7bc('0x7d'),_0x55e5d7);}}}function emitCampaignSummary(_0x4031d7){if(_0x4031d7[_0xe7bc('0x50')]===_0xe7bc('0x7e')){emit(util['format'](_0xe7bc('0x7f'),_0x4031d7[_0xe7bc('0x42')]),'campaign:save',_0x4031d7);}}function checkGetDataPredictive(_0x1360c5){if(isNotNull(_0x1360c5)){if(!_[_0xe7bc('0x49')](_0x1360c5)){loggerPredictive[_0xe7bc('0x80')](_0xe7bc('0x81'));loggerPredictive['info'](_0xe7bc('0x82'),_0x1360c5[_0xe7bc('0x72')]);loggerPredictive[_0xe7bc('0x80')](_0xe7bc('0x83'),_0x1360c5[_0xe7bc('0x84')]);loggerPredictive[_0xe7bc('0x80')](_0xe7bc('0x85'),_0x1360c5['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xe7bc('0x80')](_0xe7bc('0x86'),_0x1360c5[_0xe7bc('0x6a')]);loggerPredictive[_0xe7bc('0x80')](_0xe7bc('0x87'),_0x1360c5['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xe7bc('0x80')](_0xe7bc('0x88'),_0x1360c5['predictiveIntervalAvgTalktime']);loggerPredictive['info']('---------------------------');if(_0x1360c5[_0xe7bc('0x72')]>0x0){if(!_[_0xe7bc('0x40')](_0x1360c5[_0xe7bc('0x69')])&&_0x1360c5[_0xe7bc('0x69')]>0x0){return!![];}else{loggerPredictive['info'](_0xe7bc('0x89'));}if(!_[_0xe7bc('0x40')](_0x1360c5[_0xe7bc('0x8a')])&&_0x1360c5[_0xe7bc('0x8a')]>0x0){return!![];}else{loggerPredictive['info'](_0xe7bc('0x8b'));}}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive['info'](_0xe7bc('0x8c'));}}else{loggerPredictive[_0xe7bc('0x80')](_0xe7bc('0x8c'));}return![];}function mergeDataErlangB(_0x1d0257){return function(_0x54bc82){loggerPredictive[_0xe7bc('0x80')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xe7bc('0x80')](_0xe7bc('0x8d'),_0x54bc82[_0xe7bc('0x74')]);loggerPredictive[_0xe7bc('0x80')](_0xe7bc('0x8e'),_0x54bc82[_0xe7bc('0x75')]);loggerPredictive[_0xe7bc('0x80')](_0xe7bc('0x8f'),_0x54bc82[_0xe7bc('0x90')]);loggerPredictive['info'](_0xe7bc('0x91'),_0x54bc82[_0xe7bc('0x76')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x54bc82[_0xe7bc('0x90')]);loggerPredictive[_0xe7bc('0x80')](_0xe7bc('0x92'));_[_0xe7bc('0x93')](_0x1d0257,_0x54bc82);};}function getDiff(_0x5b8a54){var _0x22fa36=moment()[_0xe7bc('0x4c')](0x0);var _0x3a7ba2=moment(_0x5b8a54)[_0xe7bc('0x4c')](0x0);return _0x22fa36['diff'](_0x3a7ba2,_0xe7bc('0x4e'));}function ifInterval(_0x345495,_0x438b65){if(_['isUndefined'](_0x438b65)){return![];}if(getDiff(_0x438b65)<_0x345495*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x496ff1){if(isNotNull(_0x496ff1)){if(!_['isUndefined'](_0x496ff1[_0xe7bc('0x2c')])){_0x496ff1['startProgressive']=undefined;loggerPredictive['info'](_0x496ff1['name'],_0xe7bc('0x94'));}if(!_[_0xe7bc('0x40')](_0x496ff1[_0xe7bc('0x2b')])){_0x496ff1[_0xe7bc('0x2b')]=undefined;loggerPredictive[_0xe7bc('0x80')](_0x496ff1[_0xe7bc('0x42')],_0xe7bc('0x95'));}if(!_[_0xe7bc('0x40')](_0x496ff1['handlePredictive'])){clearInterval(_0x496ff1[_0xe7bc('0x96')]);_0x496ff1[_0xe7bc('0x96')]=undefined;loggerPredictive[_0xe7bc('0x80')](_0x496ff1[_0xe7bc('0x42')],_0xe7bc('0x97'));}}}function erlangb(_0x4fa754,_0xaccce7){if(_0xaccce7===0x0){return 0x0;}var _0x10c05e=0x1;for(var _0x461ce6=0x1;_0x461ce6<=_0xaccce7;_0x461ce6+=0x1){_0x10c05e=0x1+_0x10c05e*_0x461ce6/_0x4fa754;}return 0x1/_0x10c05e;}function isVoiceQueueOutbound(_0x4b8a0c){return _0x4b8a0c===_0xe7bc('0x51');}function isNotPreview(_0x5362f2){return _0x5362f2!==_0xe7bc('0x21');}function isCampaignIvr(_0x51c99f){return _0x51c99f==='ivr';}function getCallerId(_0x499e96,_0x147004,_0x3a2ee4){if(!_[_0xe7bc('0x40')](_0x3a2ee4)&&'string'===typeof _0x3a2ee4&&!_['isEmpty'](_0x3a2ee4)){if(!_['isUndefined'](_0x147004)&&_0xe7bc('0x98')===typeof _0x147004&&!_['isEmpty'](_0x147004)){return util[_0xe7bc('0x7b')](_0xe7bc('0x99'),_0x147004,_0x3a2ee4);}return util[_0xe7bc('0x7b')](_0xe7bc('0x99'),_0x3a2ee4,_0x3a2ee4);}if(!_['isUndefined'](_0x499e96)&&_0xe7bc('0x98')===typeof _0x499e96&&!_['isEmpty'](_0x499e96)){return _0x499e96;}return _0xe7bc('0x9a');}function loggerCatchQueueSummary(_0x5aa650,_0x5ccb14){return function(_0x2d5bb3){freeVariablesPredictive(_0x5ccb14);emitVoiceQueueSummary(_0x5ccb14);emitCampaignSummary(_0x5ccb14);loggerSyncQueueSummary['error'](_0x5aa650,util[_0xe7bc('0x9b')](_0x2d5bb3,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x25fbe8,_0x3c63ef){return function(_0x4d3cb6){loggerPredictive[_0xe7bc('0x9c')](_0x3c63ef[_0xe7bc('0x42')],_0x25fbe8);loggerPredictive[_0xe7bc('0x9c')](_0x4d3cb6['stack']);freeVariablesPredictive(_0x3c63ef);};}function loggerCatch(_0x303bc8){return function(_0x3b988d){logger[_0xe7bc('0x9c')](_0x303bc8,util['inspect'](_0x3b988d,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5a8788){return _0x5a8788&&!_[_0xe7bc('0x40')](_0x5a8788)&&_0x5a8788['length']>0x0;}function decremetOriginate(_0x5838b3){if(!_[_0xe7bc('0x40')](_0x5838b3)&&_0x5838b3!==null){if(_0x5838b3[_0xe7bc('0x9d')](_0xe7bc('0x73'))){if(_0x5838b3[_0xe7bc('0x73')]>0x0){_0x5838b3[_0xe7bc('0x73')]-=0x1;}else{logger[_0xe7bc('0x9c')](_0xe7bc('0x9e'));}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x4aefca,_0x5872c0,_0x5a1491){if(_0x5872c0>_0x5a1491){for(var _0x3b56f8=0x0;_0x3b56f8<_0x5872c0-_0x5a1491;_0x3b56f8+=0x1){decremetOriginate(_0x4aefca);}}}function loggerGetContactDialer(_0x5ce92c,_0x3077f9,_0x92f547){return function(_0x4eb33c){checkContactLowerLimitOriginate(_0x3077f9,_0x92f547,0x0);logger['error'](_0x5ce92c,util[_0xe7bc('0x9b')](_0x4eb33c,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5bfb88){return function(_0x56280f){if(isNotNull(_0x56280f)&&isNotNull(_0x56280f[0x0])){if(_0x56280f[0x0]['contactsRescheduled']>0x0){_0x5bfb88[_0xe7bc('0x41')]=_0xe7bc('0x9f');logger[_0xe7bc('0x80')](_0xe7bc('0xa0')+_0x5bfb88['name'],_0x56280f[0x0][_0xe7bc('0xa1')],_0xe7bc('0xa2'));}else{_0x5bfb88[_0xe7bc('0x41')]=_0xe7bc('0xa3');logger[_0xe7bc('0x80')](_0xe7bc('0xa4')+_0x5bfb88[_0xe7bc('0x42')]);}}};}function notSendMessagesQueue(_0x8f91b7){if(_0x8f91b7[_0xe7bc('0xa5')]){freeVariablesPredictive(_0x8f91b7);if(_0x8f91b7[_0xe7bc('0x73')]===0x0&&_0x8f91b7[_0xe7bc('0xa6')]===0x0&&_0x8f91b7[_0xe7bc('0x5a')]===0x0&&(_0x8f91b7[_0xe7bc('0x55')]||0x0)===0x0){_0x8f91b7[_0xe7bc('0xa5')]=![];_0x8f91b7['available']=0x0;_0x8f91b7[_0xe7bc('0x41')]=_0xe7bc('0x43');loggerSyncQueueSummary[_0xe7bc('0x9c')](_0xe7bc('0xa7'),_0x8f91b7[_0xe7bc('0x42')],_0xe7bc('0xa8'));}else{_0x8f91b7['message']=_0xe7bc('0xa9');loggerSyncQueueSummary[_0xe7bc('0x9c')](_0xe7bc('0xa7'),_0x8f91b7[_0xe7bc('0x42')],'is\x20disactive');}emitVoiceQueueSummary(_0x8f91b7);}}function notSendMessagesCampaign(_0x44a793){if(_0x44a793[_0xe7bc('0xa5')]){if(_0x44a793[_0xe7bc('0x73')]===0x0){_0x44a793[_0xe7bc('0xa5')]=![];_0x44a793[_0xe7bc('0x41')]=_0xe7bc('0x43');loggerSyncQueueSummary[_0xe7bc('0x9c')](_0xe7bc('0xaa'),_0x44a793[_0xe7bc('0x42')],_0xe7bc('0xa8'));}else{_0x44a793[_0xe7bc('0x41')]=_0xe7bc('0xa9');loggerSyncQueueSummary[_0xe7bc('0x9c')](_0xe7bc('0xaa'),_0x44a793[_0xe7bc('0x42')],'is\x20disactive');}emitCampaignSummary(_0x44a793);}}function createObjHistory(_0x334580,_0x3a1070,_0x7aaf27,_0x317cc5,_0x2dd4c7){_0x334580[_0xe7bc('0x41')]=_0x7aaf27;var _0x8f6697=new Action(_0x334580,_0x3a1070);var _0x1499ef=new History(_0x8f6697);_0x1499ef['state']=_0x317cc5;_0x1499ef[_0xe7bc('0xab')]=_0x2dd4c7;_0x1499ef['endtime']=_0x8f6697['starttime'];return _0x1499ef;}Dialer[_0xe7bc('0x1e')][_0xe7bc('0xac')]=function(){var _0x57d3a9=this;setInterval(function(){_0x57d3a9[_0xe7bc('0xad')](_0x57d3a9['uniqueId'],_0xe7bc('0xae'));_0x57d3a9[_0xe7bc('0xad')](_0x57d3a9[_0xe7bc('0x28')],_0xe7bc('0xaf'));},0x32c8);};Dialer[_0xe7bc('0x1e')][_0xe7bc('0xad')]=function(_0x5b9b8d,_0x2805c6){var _0x346397=this;for(var _0x4dabfb in _0x5b9b8d){if(_0x5b9b8d['hasOwnProperty'](_0x4dabfb)){this[_0xe7bc('0xb0')][_0xe7bc('0x1f')](function(){if(!_[_0xe7bc('0xb1')](_0x5b9b8d[_0x4dabfb])){return ami[_0xe7bc('0xb2')]({'action':_0xe7bc('0xb3'),'channel':_0x5b9b8d[_0x4dabfb][_0xe7bc('0xb4')]})[_0xe7bc('0xb5')](function(_0x1825d7){if(_0x1825d7[_0xe7bc('0x41')]===_0xe7bc('0xb6')){setTimeout(function(){if(_0x5b9b8d[_0x4dabfb]&&_0x5b9b8d[_0x4dabfb][_0xe7bc('0x50')]!==_0xe7bc('0x7e')){_0x346397[_0xe7bc('0xb7')](_0x346397[_0xe7bc('0x22')][_0x5b9b8d[_0x4dabfb][_0xe7bc('0xb8')]]);logger[_0xe7bc('0x9c')](_0xe7bc('0xb9'),_0x2805c6,_0x4dabfb,_0x5b9b8d[_0x4dabfb][_0xe7bc('0xb8')]);delete _0x5b9b8d[_0x4dabfb];}if(_0x5b9b8d[_0x4dabfb]&&_0x5b9b8d[_0x4dabfb]['type']===_0xe7bc('0x7e')){_0x346397[_0xe7bc('0xb7')](_0x346397[_0xe7bc('0x23')][_0x5b9b8d[_0x4dabfb][_0xe7bc('0xb8')]]);logger[_0xe7bc('0x9c')](_0xe7bc('0xba'),_0x2805c6,_0x4dabfb,_0x5b9b8d[_0x4dabfb]['queue']);delete _0x5b9b8d[_0x4dabfb];}},0x2328);}});}});}}};Dialer[_0xe7bc('0x1e')][_0xe7bc('0xbb')]=function(_0xba37e){return BPromise[_0xe7bc('0xbc')]()['then'](cmHopper['countReScheduled'](_0xba37e))['catch'](loggerCatch(_0xe7bc('0xbd')));};Dialer['prototype'][_0xe7bc('0xbe')]=function(_0x3b7409){return BPromise[_0xe7bc('0xbc')]()[_0xe7bc('0xbf')](cmHopperBlack[_0xe7bc('0xbe')](_0x3b7409))[_0xe7bc('0xb5')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0xe7bc('0x1e')][_0xe7bc('0xc0')]=function(_0x364495){return BPromise[_0xe7bc('0xbc')]()['then'](cmHopperBlack['checkIsBlackListIvr'](_0x364495))[_0xe7bc('0xb5')](loggerCatch(_0xe7bc('0xc1')));};Dialer[_0xe7bc('0x1e')][_0xe7bc('0xc2')]=function(_0x5c97f9){return BPromise[_0xe7bc('0xbc')]()[_0xe7bc('0xbf')](cmHopperHistory[_0xe7bc('0xc3')](_0x5c97f9))[_0xe7bc('0xb5')](loggerCatch(_0xe7bc('0xc4')));};Dialer[_0xe7bc('0x1e')]['rescheduleContact']=function(_0x46c93a){return BPromise['resolve']()['then'](cmHopper[_0xe7bc('0xc5')](_0x46c93a))[_0xe7bc('0xb5')](loggerCatch(_0xe7bc('0xc6')));};Dialer[_0xe7bc('0x1e')][_0xe7bc('0xc7')]=function(_0xf625ad,_0x44a125,_0x3fa4b4,_0xdbaa1e){return BPromise[_0xe7bc('0xbc')]()[_0xe7bc('0xbf')](cmHopper['getContactDialer'](_0xf625ad,_0x44a125,_0x3fa4b4,_0xdbaa1e))[_0xe7bc('0xb5')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0xe7bc('0x1e')]['getContactDialerIvr']=function(_0x489e63,_0x2a2878,_0x8295bf){return BPromise['resolve']()[_0xe7bc('0xbf')](cmHopper[_0xe7bc('0xc8')](_0x489e63,_0x2a2878,_0x8295bf))[_0xe7bc('0xb5')](loggerCatch(_0xe7bc('0xc9')));};Dialer[_0xe7bc('0x1e')][_0xe7bc('0xca')]=function(_0x15136e){return BPromise[_0xe7bc('0xbc')]()['then'](voiceQueueRt[_0xe7bc('0xca')](_0x15136e))['catch'](loggerCatch(_0xe7bc('0xcb')));};Dialer[_0xe7bc('0x1e')][_0xe7bc('0xcc')]=function(_0x255242){return BPromise['resolve']()[_0xe7bc('0xbf')](cmHopper[_0xe7bc('0xcc')](_0x255242))[_0xe7bc('0xb5')](loggerCatch(_0xe7bc('0xcd')));};Dialer[_0xe7bc('0x1e')]['createHistory']=function(_0x5ad847){return BPromise[_0xe7bc('0xbc')]()[_0xe7bc('0xbf')](cmHopperHistory[_0xe7bc('0xce')](_0x5ad847))['catch'](loggerCatch('[createHistory]\x20'));};Dialer[_0xe7bc('0x1e')][_0xe7bc('0xb7')]=function(_0x1dcc85){if(!_[_0xe7bc('0x40')](_0x1dcc85)&&_0x1dcc85!==null){if(_0x1dcc85['hasOwnProperty'](_0xe7bc('0x73'))){if(_0x1dcc85[_0xe7bc('0x73')]>0x0){_0x1dcc85[_0xe7bc('0x73')]-=0x1;}else{logger[_0xe7bc('0x9c')](_0xe7bc('0xcf'));}}}else{logger['error'](_0xe7bc('0xd0'));}};Dialer[_0xe7bc('0x1e')][_0xe7bc('0xd1')]=function(_0x1218de,_0x506cee){var _0x132138=this;return function(_0x5c4c16){_0x132138[_0xe7bc('0xb7')](_0x506cee);logger[_0xe7bc('0x9c')](_0x1218de,util['inspect'](_0x5c4c16,{'showHidden':![],'depth':null}));};};Dialer[_0xe7bc('0x1e')][_0xe7bc('0xd2')]=function(_0x461374,_0x34aa31,_0xf6976e){var _0x4b17c2={'state':0x19,'statedesc':'notFound'};this['updateOriginated'](_0x34aa31);this[_0xe7bc('0xd3')](_[_0xe7bc('0x93')](_0x4b17c2,_[_0xe7bc('0xd4')](_0xf6976e,[_0xe7bc('0xd5'),_0xe7bc('0xd6'),_0xe7bc('0xd7'),_0xe7bc('0xd8'),_0xe7bc('0xd9')])),_0xe7bc('0xda'),_0xe7bc('0xdb'));logger[_0xe7bc('0x9c')](_0x461374);};Dialer[_0xe7bc('0x1e')][_0xe7bc('0xdc')]=function(_0x529e56){return _0x529e56===_0xe7bc('0xdd');};Dialer['prototype'][_0xe7bc('0xde')]=function(_0x46b167){return!_['isUndefined'](_0x46b167)&&_0x46b167&&!_[_0xe7bc('0x40')](_0x46b167[_0xe7bc('0x42')])&&!_[_0xe7bc('0x40')](_0x46b167[_0xe7bc('0x78')])&&_0x46b167[_0xe7bc('0x78')]&&(this[_0xe7bc('0x25')][util[_0xe7bc('0x7b')](_0xe7bc('0xdf'),_0x46b167[_0xe7bc('0x42')])][_0xe7bc('0xb3')]===_0xe7bc('0xe0')||this[_0xe7bc('0x25')][util[_0xe7bc('0x7b')]('SIP/%s',_0x46b167[_0xe7bc('0x42')])]['status']===_0xe7bc('0xe1'));};Dialer[_0xe7bc('0x1e')][_0xe7bc('0xd3')]=function(_0x25ce9f,_0x45d562,_0x321626){this['createHistory'](_0x25ce9f)['catch'](loggerCatch(_0x45d562));this[_0xe7bc('0xcc')](_0x25ce9f)[_0xe7bc('0xb5')](loggerCatch(_0x321626));};Dialer[_0xe7bc('0x1e')]['syncVarSet']=function(_0xd44a14){var _0x28623d=this[_0xe7bc('0x2a')][_0xd44a14['uniqueid']];var _0x46b27b;if(!_[_0xe7bc('0xb1')](_0xd44a14)&&!_['isNil'](_0xd44a14[_0xe7bc('0xe2')])&&!_[_0xe7bc('0xb1')](_0xd44a14[_0xe7bc('0xe2')]['amdstatus'])&&_0xd44a14[_0xe7bc('0xe3')]==='xcally-motion-dialer'&&_0x28623d){if(_0x28623d[_0xe7bc('0x50')]!==_0xe7bc('0x7e')&&this['voiceQueues'][_0x28623d[_0xe7bc('0xb8')]][_0xe7bc('0xe4')]&&_0xd44a14[_0xe7bc('0xe5')]===_0xe7bc('0xe6')){delete this[_0xe7bc('0x2a')][_0xd44a14[_0xe7bc('0xe7')]];this[_0xe7bc('0xb7')](this[_0xe7bc('0x22')][_0x28623d[_0xe7bc('0xb8')]]);this[_0xe7bc('0x22')][_0x28623d['queue']]['outboundAnswerCallsDay']+=0x1;this[_0xe7bc('0x22')][_0x28623d[_0xe7bc('0xb8')]][_0xe7bc('0x5f')]+=0x1;_0x46b27b=new Hangup(_0x28623d,_0xd44a14);_0x46b27b[_0xe7bc('0xe8')]=0x12;_0x46b27b[_0xe7bc('0xab')]=_0xe7bc('0xe9');_0x46b27b[_0xe7bc('0xea')]=_0xe7bc('0xeb');this[_0xe7bc('0xd3')](_0x46b27b,'[syncHangupInAMD][createHistory]',_0xe7bc('0xec'));}if(_0x28623d[_0xe7bc('0x50')]!=='ivr'&&this[_0xe7bc('0x22')][_0x28623d['queue']]['dialAMDActive']&&_0xd44a14['value']==='MACHINE'){delete this[_0xe7bc('0x2a')][_0xd44a14[_0xe7bc('0xe7')]];this['updateOriginated'](this['voiceQueues'][_0x28623d[_0xe7bc('0xb8')]]);this[_0xe7bc('0x22')][_0x28623d[_0xe7bc('0xb8')]][_0xe7bc('0x60')]+=0x1;this[_0xe7bc('0x22')][_0x28623d[_0xe7bc('0xb8')]][_0xe7bc('0x5f')]+=0x1;_0x46b27b=new Hangup(_0x28623d,_0xd44a14);_0x46b27b[_0xe7bc('0xe8')]=0x13;_0x46b27b[_0xe7bc('0xab')]='Machine';_0x46b27b['membername']=_0xe7bc('0xeb');_0x46b27b[_0xe7bc('0xed')]=!![];this[_0xe7bc('0xd3')](_0x46b27b,_0xe7bc('0xee'),'[syncMachine]');}if(_0x28623d[_0xe7bc('0x50')]==='ivr'&&this[_0xe7bc('0x23')][_0x28623d['queue']]['dialAMDActive']&&_0xd44a14[_0xe7bc('0xe5')]===_0xe7bc('0xe6')){delete this['uniqueId'][_0xd44a14[_0xe7bc('0xe7')]];this['updateOriginated'](this[_0xe7bc('0x23')][_0x28623d['queue']]);_0x46b27b=new Hangup(_0x28623d,_0xd44a14);_0x46b27b['state']=0x12;_0x46b27b[_0xe7bc('0xab')]='HangupInAMD';_0x46b27b[_0xe7bc('0xea')]=_0xe7bc('0xeb');this[_0xe7bc('0xd3')](_0x46b27b,_0xe7bc('0xef'),_0xe7bc('0xf0'));}if(_0x28623d[_0xe7bc('0x50')]===_0xe7bc('0x7e')&&this[_0xe7bc('0x23')][_0x28623d['queue']][_0xe7bc('0xe4')]&&_0xd44a14['value']===_0xe7bc('0xf1')){delete this['uniqueId'][_0xd44a14[_0xe7bc('0xe7')]];this[_0xe7bc('0xb7')](this[_0xe7bc('0x23')][_0x28623d[_0xe7bc('0xb8')]]);_0x46b27b=new Hangup(_0x28623d,_0xd44a14);_0x46b27b[_0xe7bc('0xe8')]=0x13;_0x46b27b[_0xe7bc('0xab')]=_0xe7bc('0xf2');_0x46b27b[_0xe7bc('0xea')]=_0xe7bc('0xeb');_0x46b27b[_0xe7bc('0xed')]=!![];this[_0xe7bc('0xd3')](_0x46b27b,_0xe7bc('0xf3'),_0xe7bc('0xf4'));}}};Dialer['prototype'][_0xe7bc('0xf5')]=function(_0x26efca){var _0x4eb39b=this[_0xe7bc('0x2a')][_0x26efca[_0xe7bc('0xe7')]];var _0x55bb71=this;var _0x590a4e;if(_0x4eb39b&&_0x4eb39b[_0xe7bc('0x50')]===_0xe7bc('0x7e')){delete this[_0xe7bc('0x2a')][_0x26efca[_0xe7bc('0xe7')]];this['updateOriginated'](this[_0xe7bc('0x23')][_0x4eb39b[_0xe7bc('0xb8')]]);this['campaigns'][_0x4eb39b[_0xe7bc('0xb8')]][_0xe7bc('0xf6')]+=0x1;_0x590a4e=new Hangup(_0x4eb39b,_0x26efca);this[_0xe7bc('0xce')](_0x590a4e)[_0xe7bc('0xb5')](loggerCatch(_0xe7bc('0xf7')));this[_0xe7bc('0xcc')](_0x590a4e)[_0xe7bc('0xb5')](loggerCatch(_0xe7bc('0xf8')));}if(_0x4eb39b&&_0x4eb39b[_0xe7bc('0x50')]!=='ivr'&&isNotNull(this[_0xe7bc('0x22')][_0x4eb39b[_0xe7bc('0xb8')]][_0xe7bc('0xf9')])){delete this[_0xe7bc('0x2a')][_0x26efca[_0xe7bc('0xe7')]];this['updateOriginated'](this[_0xe7bc('0x22')][_0x4eb39b['queue']]);this[_0xe7bc('0x22')][_0x4eb39b[_0xe7bc('0xb8')]][_0xe7bc('0x60')]+=0x1;this[_0xe7bc('0x22')][_0x4eb39b['queue']][_0xe7bc('0x5f')]+=0x1;_0x590a4e=new Hangup(_0x4eb39b,_0x26efca);_0x590a4e[_0xe7bc('0xe8')]=0x10;_0x590a4e[_0xe7bc('0xab')]=_0xe7bc('0xfa');_0x590a4e[_0xe7bc('0xea')]=_0xe7bc('0xfb');this[_0xe7bc('0xce')](_0x590a4e)[_0xe7bc('0xb5')](loggerCatch(_0xe7bc('0xf7')));this[_0xe7bc('0xcc')](_0x590a4e)[_0xe7bc('0xb5')](loggerCatch(_0xe7bc('0xf8')));}if(_0x4eb39b&&_0x4eb39b[_0xe7bc('0x50')]!==_0xe7bc('0x7e')&&!isNotNull(this[_0xe7bc('0x22')][_0x4eb39b['queue']][_0xe7bc('0xf9')])){delete this['uniqueId'][_0x26efca[_0xe7bc('0xe7')]];this['updateOriginated'](this['voiceQueues'][_0x4eb39b[_0xe7bc('0xb8')]]);this['voiceQueues'][_0x4eb39b[_0xe7bc('0xb8')]]['outboundUnknownCallsDay']+=0x1;_0x590a4e=new Hangup(_0x4eb39b,_0x26efca);_0x590a4e[_0xe7bc('0xe8')]=0xc;_0x590a4e[_0xe7bc('0xab')]=_0x26efca[_0xe7bc('0xfc')];_0x590a4e[_0xe7bc('0xea')]=_0xe7bc('0xfd');this[_0xe7bc('0xce')](_0x590a4e)[_0xe7bc('0xb5')](loggerCatch(_0xe7bc('0xf7')));this[_0xe7bc('0xcc')](_0x590a4e)[_0xe7bc('0xb5')](loggerCatch(_0xe7bc('0xf8')));}};Dialer[_0xe7bc('0x1e')][_0xe7bc('0x36')]=function(_0x133439){var _0x2f237c=this[_0xe7bc('0x2a')][_0x133439['uniqueid']];var _0x4c4f36=this;if(this[_0xe7bc('0x22')][_0x133439[_0xe7bc('0xb8')]]){if(_0x2f237c&&_0x2f237c[_0xe7bc('0x50')]!==_0xe7bc('0x7e')){delete this['uniqueId'][_0x133439[_0xe7bc('0xe7')]];this[_0xe7bc('0x22')][_0x133439['queue']]['outboundAnswerCallsDay']+=0x1;var _0x349e14=new AgentComplete(_0x2f237c,_0x133439);if(_0x133439[_0xe7bc('0xfe')]===_0xe7bc('0xff')){_0x349e14[_0xe7bc('0x100')]=this['voiceQueues'][_0x133439['queue']][_0xe7bc('0x101')]&&this['voiceQueues'][_0x133439['queue']][_0xe7bc('0x102')]?moment()[_0xe7bc('0x7b')](_0xe7bc('0x103')):undefined;}this[_0xe7bc('0xce')](_0x349e14)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xe7bc('0xcc')](_0x349e14)['catch'](loggerCatch(_0xe7bc('0x104')));}}};Dialer[_0xe7bc('0x1e')][_0xe7bc('0x30')]=function(_0x57a8e3){if(this['voiceQueues'][_0x57a8e3[_0xe7bc('0xb8')]]){if(this[_0xe7bc('0x2a')][_0x57a8e3['uniqueid']]&&this['uniqueId'][_0x57a8e3[_0xe7bc('0xe7')]][_0xe7bc('0x50')]!==_0xe7bc('0x7e')){this[_0xe7bc('0xb7')](this[_0xe7bc('0x22')][_0x57a8e3['queue']]);this[_0xe7bc('0x2a')][_0x57a8e3[_0xe7bc('0xe7')]]['answertime']=moment()['format'](_0xe7bc('0x103'));}}};Dialer[_0xe7bc('0x1e')][_0xe7bc('0x105')]=function(_0x2c25e0){this[_0xe7bc('0xce')](_0x2c25e0)['catch'](loggerCatch(_0xe7bc('0x106')));this[_0xe7bc('0xcc')](_0x2c25e0)['catch'](loggerCatch(_0xe7bc('0x107')));};Dialer[_0xe7bc('0x1e')][_0xe7bc('0x33')]=function(_0x68ab49){var _0x36bd35=this[_0xe7bc('0x2a')][_0x68ab49[_0xe7bc('0xe7')]];var _0x4b04f4=this;if(this['voiceQueues'][_0x68ab49[_0xe7bc('0xb8')]]){if(_0x36bd35&&_0x36bd35[_0xe7bc('0x50')]!==_0xe7bc('0x7e')){delete this['uniqueId'][_0x68ab49[_0xe7bc('0xe7')]];this[_0xe7bc('0xb7')](this[_0xe7bc('0x22')][_0x68ab49['queue']]);_0x36bd35['droptime']=moment()[_0xe7bc('0x7b')]('YYYY-MM-DD\x20HH:mm:ss');var _0x47580d=new QueueCallerAbandon(_0x36bd35,_0x68ab49);if(getSeconds(_0x36bd35['droptime'],_0x36bd35[_0xe7bc('0x108')])>=_0x36bd35[_0xe7bc('0x109')]){this['voiceQueues'][_0x68ab49['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x68ab49['queue']][_0xe7bc('0x10a')]+=0x1;this[_0xe7bc('0x22')][_0x68ab49[_0xe7bc('0xb8')]][_0xe7bc('0x6d')]+=0x1;_0x47580d[_0xe7bc('0xe8')]=0xa;_0x47580d[_0xe7bc('0xab')]='Drop';_0x47580d[_0xe7bc('0x10b')]='TIMEOUT';_0x47580d[_0xe7bc('0x100')]=this[_0xe7bc('0x22')][_0x68ab49[_0xe7bc('0xb8')]][_0xe7bc('0x101')]?moment()[_0xe7bc('0x7b')](_0xe7bc('0x103')):undefined;this[_0xe7bc('0x105')](_0x47580d);}else{this[_0xe7bc('0x22')][_0x68ab49[_0xe7bc('0xb8')]][_0xe7bc('0x6a')]+=0x1;this[_0xe7bc('0x22')][_0x68ab49['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x47580d[_0xe7bc('0xe8')]=0xb;_0x47580d[_0xe7bc('0xab')]=_0xe7bc('0x10c');_0x47580d[_0xe7bc('0x10b')]='CALLEREXIT';this[_0xe7bc('0x105')](_0x47580d);}}}};Dialer[_0xe7bc('0x1e')][_0xe7bc('0x39')]=function(_0x731bef){if(this[_0xe7bc('0x28')][_0x731bef['uniqueid']]){this[_0xe7bc('0x28')][_0x731bef['uniqueid']][_0xe7bc('0xb4')]=_0x731bef['channel'];}if(this[_0xe7bc('0x2a')][_0x731bef[_0xe7bc('0xe7')]]){this['uniqueId'][_0x731bef['uniqueid']][_0xe7bc('0xb4')]=_0x731bef[_0xe7bc('0xb4')];}};Dialer[_0xe7bc('0x1e')][_0xe7bc('0x3c')]=function(_0x20d1b7){if(strategy[this[_0xe7bc('0x22')][this[_0xe7bc('0x28')][_0x20d1b7[_0xe7bc('0x10d')]]['queue']][_0xe7bc('0x52')]]===_0xe7bc('0x1d')){if(this[_0xe7bc('0x28')][_0x20d1b7[_0xe7bc('0x10d')]]&&_[_0xe7bc('0xb1')](this[_0xe7bc('0x28')][_0x20d1b7[_0xe7bc('0x10d')]]['locked'])&&_0x20d1b7['status']==='1'&&_0x20d1b7[_0xe7bc('0x10e')]==='0'){if(this[_0xe7bc('0x24')][_0x20d1b7[_0xe7bc('0x10f')]]){if(!this[_0xe7bc('0x24')][_0x20d1b7[_0xe7bc('0x10f')]][_0xe7bc('0x110')]){this[_0xe7bc('0x24')][_0x20d1b7[_0xe7bc('0x10f')]][_0xe7bc('0x110')]=!![];this[_0xe7bc('0x28')][_0x20d1b7[_0xe7bc('0x10d')]][_0xe7bc('0x110')]=!![];this[_0xe7bc('0x28')][_0x20d1b7['actionid']][_0xe7bc('0x10f')]=_0x20d1b7['stateinterface'];}}}}else if((strategy[this[_0xe7bc('0x22')][this[_0xe7bc('0x28')][_0x20d1b7[_0xe7bc('0x10d')]][_0xe7bc('0xb8')]][_0xe7bc('0x52')]]||_0xe7bc('0x111'))===_0xe7bc('0x111')){if(this['actions'][_0x20d1b7[_0xe7bc('0x10d')]]){if(this[_0xe7bc('0x24')][_0x20d1b7['stateinterface']]){this[_0xe7bc('0x28')][_0x20d1b7[_0xe7bc('0x10d')]][_0xe7bc('0x10f')]=_0x20d1b7[_0xe7bc('0x10f')];if(_[_0xe7bc('0xb1')](this['queueBooked'][this[_0xe7bc('0x28')][_0x20d1b7[_0xe7bc('0x10d')]][_0xe7bc('0xb8')]])){this[_0xe7bc('0x2e')][this[_0xe7bc('0x28')][_0x20d1b7[_0xe7bc('0x10d')]][_0xe7bc('0xb8')]]=[];}this['queueBooked'][this[_0xe7bc('0x28')][_0x20d1b7[_0xe7bc('0x10d')]][_0xe7bc('0xb8')]][_0xe7bc('0x112')](_[_0xe7bc('0x93')](_['pick'](this[_0xe7bc('0x28')][_0x20d1b7['actionid']],[_0xe7bc('0x113'),_0xe7bc('0x10f')]),{'status':_0x20d1b7[_0xe7bc('0xb3')],'paused':_0x20d1b7[_0xe7bc('0x10e')]}));}}}};function unlockQueueStatus(_0x2782b5,_0x2aabc6){setTimeout(function(){if(_['isUndefined'](_0x2782b5[_0xe7bc('0x114')])){loggerBooked[_0xe7bc('0x9c')](_0xe7bc('0x115'),_0x2aabc6);}_0x2782b5[_0xe7bc('0x114')]=!![];loggerBooked['info'](_0xe7bc('0x116'),_0x2aabc6,JSON[_0xe7bc('0x7a')](_['pick'](_0x2782b5,[_0xe7bc('0x42'),_0xe7bc('0x114')])));},0x1f3);}Dialer[_0xe7bc('0x1e')]['syncQueueStatusComplete']=function(_0x2f1666){var _0x439a00=this;var _0x1c86a2=_0x439a00[_0xe7bc('0x22')][_0x439a00[_0xe7bc('0x28')][_0x2f1666[_0xe7bc('0x10d')]][_0xe7bc('0xb8')]];if(strategy[this[_0xe7bc('0x22')][this[_0xe7bc('0x28')][_0x2f1666[_0xe7bc('0x10d')]]['queue']]['strategy']]===_0xe7bc('0x1d')){if(this[_0xe7bc('0x28')][_0x2f1666[_0xe7bc('0x10d')]]&&this[_0xe7bc('0x28')][_0x2f1666[_0xe7bc('0x10d')]][_0xe7bc('0x10f')]){this[_0xe7bc('0x21')]['run'](this['actions'][_0x2f1666[_0xe7bc('0x10d')]][_0xe7bc('0x113')],this[_0xe7bc('0x28')][_0x2f1666[_0xe7bc('0x10d')]]['stateinterface'])[_0xe7bc('0xb5')](function(_0xd314ab){logger[_0xe7bc('0x9c')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xe7bc('0x9b')](_0xd314ab,{'showHidden':![],'depth':null}));})['finally'](function(){_0x439a00[_0xe7bc('0xb7')](_0x439a00[_0xe7bc('0x22')][_0x439a00['actions'][_0x2f1666[_0xe7bc('0x10d')]]['queue']]);_0x439a00['agents'][_0x439a00[_0xe7bc('0x28')][_0x2f1666[_0xe7bc('0x10d')]][_0xe7bc('0x10f')]]['locked']=![];delete _0x439a00[_0xe7bc('0x28')][_0x2f1666[_0xe7bc('0x10d')]];unlockQueueStatus(_0x1c86a2);});}else{this[_0xe7bc('0xb7')](this['voiceQueues'][this['actions'][_0x2f1666['actionid']][_0xe7bc('0xb8')]]);this[_0xe7bc('0xc5')]({'active':![],'ContactId':this[_0xe7bc('0x28')][_0x2f1666[_0xe7bc('0x10d')]][_0xe7bc('0xd5')],'ListId':this['actions'][_0x2f1666[_0xe7bc('0x10d')]]['ListId'],'VoiceQueueId':this[_0xe7bc('0x28')][_0x2f1666[_0xe7bc('0x10d')]][_0xe7bc('0xd8')]||undefined,'CampaignId':this['actions'][_0x2f1666['actionid']][_0xe7bc('0xd9')]||undefined})[_0xe7bc('0xb5')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xe7bc('0x28')][_0x2f1666[_0xe7bc('0x10d')]];unlockQueueStatus(_0x1c86a2);}}else if((strategy[this['voiceQueues'][this[_0xe7bc('0x28')][_0x2f1666['actionid']]['queue']][_0xe7bc('0x52')]]||_0xe7bc('0x111'))==='rrmemory'){var _0x14a443;if(this[_0xe7bc('0x28')][_0x2f1666['actionid']]&&!_['isEmpty'](this[_0xe7bc('0x2e')][this['actions'][_0x2f1666['actionid']]['queue']])){if(this[_0xe7bc('0x2f')][_0x439a00[_0xe7bc('0x28')][_0x2f1666[_0xe7bc('0x10d')]][_0xe7bc('0xb8')]]){this[_0xe7bc('0x2f')][_0x439a00['actions'][_0x2f1666[_0xe7bc('0x10d')]]['queue']]=this['queueBookedRR'][this[_0xe7bc('0x28')][_0x2f1666[_0xe7bc('0x10d')]]['queue']]?this['queueBookedRR'][this[_0xe7bc('0x28')][_0x2f1666[_0xe7bc('0x10d')]]['queue']]:this[_0xe7bc('0x2e')][this[_0xe7bc('0x28')][_0x2f1666['actionid']][_0xe7bc('0xb8')]]?this[_0xe7bc('0x2e')][this[_0xe7bc('0x28')][_0x2f1666[_0xe7bc('0x10d')]][_0xe7bc('0xb8')]][_0xe7bc('0x117')]||0x0:0x0;}this[_0xe7bc('0x2e')][this[_0xe7bc('0x28')][_0x2f1666[_0xe7bc('0x10d')]]['queue']][_0xe7bc('0x117')]=this[_0xe7bc('0x2f')][this[_0xe7bc('0x28')][_0x2f1666[_0xe7bc('0x10d')]][_0xe7bc('0xb8')]];for(var _0x28f3ac=0x0;_0x28f3ac=0x0?!![]:![];})[_0xe7bc('0xb5')](myreject(_0x53785f)));}}else{_0x549959[_0xe7bc('0x112')](ami[_0xe7bc('0xb2')]({'action':'command','command':util['format'](_0xe7bc('0x135'),_0x30be09,!_['isUndefined'](config['timezones'][_0x3dfeb0])?_0x3dfeb0:'')})['then'](function(_0xfc5306){return _0xfc5306['content'][_0xe7bc('0x137')](_0xe7bc('0x138'))>=0x0?!![]:![];})['catch'](myreject(_0x53785f)));}BPromise['all'](_0x549959)[_0xe7bc('0xbf')](function(_0x2084a1){var _0x2637d4=_[_0xe7bc('0x139')](_0x2084a1);if(_0x2637d4){return _0x11cc2a(_0x2637d4);}else{_0x4c0e60[_0xe7bc('0x41')]=_0x1b3f7c?'GLOBAL_INTERVAL_IS_OVERTIME':'INTERVAL_IS_OVERTIME';return _0x53785f(msgResponse('[ifTime][promiseAll]',_0xe7bc('0x12d'),_0xe7bc('0x13a')+_0x1b3f7c+'\x20'+_0x365eac+_0xe7bc('0x13b')+util[_0xe7bc('0x9b')](_0x30be09,{'showHidden':![],'depth':null})+_0xe7bc('0x13c')+_0x3dfeb0));}})[_0xe7bc('0xb5')](function(_0x58b0c2){return _0x53785f(msgResponse(_0xe7bc('0x12b'),_0xe7bc('0x12d'),JSON[_0xe7bc('0x7a')](_0x58b0c2)));});});};Dialer['prototype']['checkDialMethod']=function(_0x5498e7){var _0x1cf5d7=this;return function(){switch(_0x5498e7[_0xe7bc('0x5c')]){case _0xe7bc('0x13d'):freeVariablesPredictive(_0x5498e7);_0x1cf5d7[_0xe7bc('0x13e')](_0x5498e7,0x1);break;case _0xe7bc('0x13f'):freeVariablesPredictive(_0x5498e7);_0x1cf5d7['handlePower'](_0x5498e7,_0x5498e7[_0xe7bc('0x140')]);break;case _0xe7bc('0x141'):_0x1cf5d7[_0xe7bc('0x141')](_0x5498e7);break;case _0xe7bc('0x8'):freeVariablesPredictive(_0x5498e7);_0x1cf5d7[_0xe7bc('0x13e')](_0x5498e7,0x1);break;default:freeVariablesPredictive(_0x5498e7);logger[_0xe7bc('0x9c')](_0xe7bc('0x142'),_0x5498e7['name'],_0xe7bc('0x143'));}};};Dialer['prototype']['launchHandleIvr']=function(_0x1c41bb){var _0x4a7793=this;return function(){_0x4a7793[_0xe7bc('0x144')](_0x1c41bb);};};Dialer[_0xe7bc('0x1e')][_0xe7bc('0xa')]=function(_0x2c2798){var _0x156d47=this;if(isNotPreview(_0x2c2798['dialMethod'])){if(isVoiceQueueOutbound(_0x2c2798[_0xe7bc('0x50')])&&isActive(_0x2c2798['dialActive'])){_0x2c2798[_0xe7bc('0xa5')]=!![];BPromise[_0xe7bc('0xbc')]()['then'](checkIsLoggedIn(_0x2c2798,_0x2c2798[_0xe7bc('0x54')]))[_0xe7bc('0xbf')](checkIsActive(_0x2c2798,_0x2c2798[_0xe7bc('0x145')]))[_0xe7bc('0xbf')](checkInterval(_0x2c2798))['then'](_0x156d47[_0xe7bc('0x127')](_0x2c2798))[_0xe7bc('0xbf')](_0x156d47[_0xe7bc('0x12a')](_0x2c2798['dialGlobalInterval'],_0x2c2798[_0xe7bc('0x146')],_0x2c2798[_0xe7bc('0x42')],_0x2c2798))[_0xe7bc('0xbf')](_0x156d47['checkIfTimeIntervals'](_0x2c2798['Interval'],_0x2c2798['dialTimezone'],_0x2c2798[_0xe7bc('0x42')],_0x2c2798))['then'](_0x156d47['checkDialMethod'](_0x2c2798))[_0xe7bc('0xb5')](loggerCatchQueueSummary('[syncQueueSummary]',_0x2c2798));}else{notSendMessagesQueue(_0x2c2798);}}else{freeVariablesPredictive(_0x2c2798);}};Dialer['prototype'][_0xe7bc('0x126')]=function(){var _0x32ac8f=this;var _0x47842d;for(var _0x1bb47a in this[_0xe7bc('0x23')]){if(this[_0xe7bc('0x23')][_0xe7bc('0x9d')](_0x1bb47a)){_0x47842d=this[_0xe7bc('0x23')][_0x1bb47a];if(isCampaignIvr(_0x47842d[_0xe7bc('0x50')])&&isActive(_0x47842d['active'])){_0x47842d[_0xe7bc('0xa5')]=!![];BPromise['resolve']()[_0xe7bc('0xbf')](checkIsActive(_0x47842d,_0x47842d[_0xe7bc('0x78')]))[_0xe7bc('0xbf')](checkInterval(_0x47842d))[_0xe7bc('0xbf')](_0x32ac8f['checkIsTrunkReachable'](_0x47842d))[_0xe7bc('0xbf')](_0x32ac8f[_0xe7bc('0x12a')](_0x47842d[_0xe7bc('0x147')],_0x47842d[_0xe7bc('0x146')],_0x47842d[_0xe7bc('0x42')],_0x47842d))[_0xe7bc('0xbf')](_0x32ac8f[_0xe7bc('0x12c')](_0x47842d[_0xe7bc('0x47')],_0x47842d[_0xe7bc('0x146')],_0x47842d[_0xe7bc('0x42')],_0x47842d))[_0xe7bc('0xbf')](_0x32ac8f['launchHandleIvr'](_0x47842d))[_0xe7bc('0xb5')](loggerCatchQueueSummary(_0xe7bc('0x148'),_0x47842d));}else{notSendMessagesCampaign(_0x47842d);}}}};function getCallerIdRandom(_0x2fbf13,_0x1224f0){var _0x20f962,_0x16bcd2,_0x3efc0e;if(_0x1224f0<=0x0){_0x1224f0=0x1;}_0x20f962=new RegExp(_0xe7bc('0x149')+_0x1224f0+'}$');_0x16bcd2=Math['pow'](0xa,_0x1224f0-0x1);_0x3efc0e=Math[_0xe7bc('0x14a')](0xa,_0x1224f0)-0x1;return util[_0xe7bc('0x7b')]('%s',_[_0xe7bc('0x14b')](_0x2fbf13,_0x20f962,_[_0xe7bc('0x14c')](_0x16bcd2,_0x3efc0e)));}function extractCalleridName(_0x3eb799){var _0x51a110=_0x3eb799[_0xe7bc('0x14d')](/"(.*?)"/);return _0x51a110?_0x51a110[0x1]:_0x3eb799;}function extractCalleridNumber(_0x3e072a){var _0x37a4ed=_0x3e072a['match'](/<(.*?)>/);return _0x37a4ed?_0x37a4ed[0x1]:_0x3e072a;}Dialer[_0xe7bc('0x1e')]['actionOriginate']=function(_0x352152,_0x20fb9d){var _0x2d1cab=this;var _0x4433f5=uuid['v4']();this[_0xe7bc('0x28')][_0x4433f5]=new Action(_0x352152,_0x20fb9d,_0x4433f5);return new BPromise(function(_0x459dd0,_0x246c1b){if(_[_0xe7bc('0x40')](_0x352152)&&'object'!==typeof _0x352152){return _0x246c1b(msgResponse(_0xe7bc('0x14e'),_0xe7bc('0x12d'),_0xe7bc('0x14f')));}if(_[_0xe7bc('0x40')](_0x20fb9d['Contact']['phone'])||_0x20fb9d[_0xe7bc('0x150')][_0xe7bc('0x151')]===null){return _0x246c1b(msgResponse(_0xe7bc('0x14e'),'Failure',_0xe7bc('0x152')));}var _0x613699={'XMD-CALLERID':_0x2d1cab[_0xe7bc('0x28')][_0x4433f5][_0xe7bc('0x153')](),'XMD-AGI':_0x352152[_0xe7bc('0xf9')]?util[_0xe7bc('0x7b')](_0xe7bc('0x154'),ipAgi,_0x352152[_0xe7bc('0xf9')]):_0xe7bc('0x155'),'XMD-AGIAFTER':_0x352152[_0xe7bc('0x101')]?util[_0xe7bc('0x7b')](_0xe7bc('0x154'),ipAgi,_0x352152[_0xe7bc('0x101')]):_0xe7bc('0x155'),'XMD-QUEUE':_0x352152[_0xe7bc('0x50')]==='outbound'?util[_0xe7bc('0x7b')]('\x22%s,%s%s,,,%s\x22',_0x352152[_0xe7bc('0x42')],_0x352152[_0xe7bc('0x156')]||'',_0x352152[_0xe7bc('0x102')]?'c':'',_0x352152[_0xe7bc('0x109')]||0x3):_0xe7bc('0x155'),'XMD-CONTACTID':_0x20fb9d[_0xe7bc('0xd5')],'XMD-CDRTYPE':_0xe7bc('0x7'),'CALLERID(all)':_0x2d1cab['actions'][_0x4433f5]['getCaller'](),'XMD-AMD':_0x352152[_0xe7bc('0xe4')]?_0xe7bc('0x157'):_0xe7bc('0x155'),'XMD-DESTINATION':_0xe7bc('0x158')};if(_0x352152[_0xe7bc('0xe4')]){_0x613699[_0xe7bc('0x159')]=_0x352152[_0xe7bc('0x15a')]||0x9c4;_0x613699[_0xe7bc('0x15b')]=_0x352152[_0xe7bc('0x15c')]||0x5dc;_0x613699['XMD-AMDAFTERGREETINGSILENCE']=_0x352152[_0xe7bc('0x15d')]||0x320;_0x613699[_0xe7bc('0x15e')]=_0x352152[_0xe7bc('0x15f')]||0x1388;_0x613699[_0xe7bc('0x160')]=_0x352152[_0xe7bc('0x161')]||0x64;_0x613699[_0xe7bc('0x162')]=_0x352152[_0xe7bc('0x163')]||0x32;_0x613699['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x352152[_0xe7bc('0x164')]||0x3;_0x613699[_0xe7bc('0x165')]=_0x352152[_0xe7bc('0x166')]||0x100;_0x613699['XMD-AMDMAXIMUMWORDLENGTH']=_0x352152['dialAMDMaximumWordLength']||0x1388;}if(_0x352152[_0xe7bc('0x50')]==='outbound'){_0x613699[_0xe7bc('0x167')]=_0x20fb9d['VoiceQueueId'];}else{_0x613699[_0xe7bc('0x168')]=_0x20fb9d['CampaignId'];}for(var _0x14983f in _0x20fb9d[_0xe7bc('0x150')]){if(_0x20fb9d[_0xe7bc('0x150')][_0xe7bc('0x9d')](_0x14983f)){if(isNotNull(_0x20fb9d[_0xe7bc('0x150')][_0x14983f])&&_0x14983f!=='id'&&_0x14983f!==_0xe7bc('0x169')&&_0x14983f!=='createdAt'&&_0x14983f!==_0xe7bc('0x16a')){_0x613699[util['format']('%s%s',_0xe7bc('0x16b'),_['toUpper'](_0x14983f))]=_0x20fb9d[_0xe7bc('0x150')][_0x14983f];}}}var _0xd0b24e=_0x2d1cab[_0xe7bc('0xde')](_0x352152['Trunk'])?getCallerId(_0x352152['Trunk'][_0xe7bc('0x79')],_0x352152['dialOriginateCallerIdName'],_0x352152[_0xe7bc('0x16c')]>0x0?getCallerIdRandom(_0x352152[_0xe7bc('0x16d')],_0x352152[_0xe7bc('0x16c')]):_0x352152['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x352152[_0xe7bc('0x16e')])?_0x352152[_0xe7bc('0x77')][_0xe7bc('0x79')]:_0x352152[_0xe7bc('0x16e')][_0xe7bc('0x79')],_0x352152['dialOriginateCallerIdName'],_0x352152['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x352152[_0xe7bc('0x16d')],_0x352152[_0xe7bc('0x16c')]):_0x352152[_0xe7bc('0x16d')]);if(_0xd0b24e){_0x613699[_0xe7bc('0x16f')]=_0x2d1cab[_0xe7bc('0x28')][_0x4433f5][_0xe7bc('0x170')]=extractCalleridName(_0xd0b24e);_0x613699[_0xe7bc('0x171')]=_0x2d1cab[_0xe7bc('0x28')][_0x4433f5]['originatecalleridnum']=extractCalleridNumber(_0xd0b24e);}return ami[_0xe7bc('0xb2')]({'actionid':_0x4433f5,'action':_0xe7bc('0x14e'),'channel':_0x2d1cab[_0xe7bc('0xde')](_0x352152[_0xe7bc('0x77')])?util[_0xe7bc('0x7b')](_0xe7bc('0x172'),_0x352152[_0xe7bc('0x77')][_0xe7bc('0x42')],isNotNull(_0x352152[_0xe7bc('0x173')])?_0x352152['dialPrefix'][_0xe7bc('0x174')]()||'':'',_0x352152[_0xe7bc('0x175')]>0x0?_0x20fb9d[_0xe7bc('0x150')][_0xe7bc('0x151')][_0xe7bc('0x176')](_0x352152[_0xe7bc('0x175')]):_0x20fb9d['Contact'][_0xe7bc('0x151')]):util['format'](_0xe7bc('0x172'),_[_0xe7bc('0xb1')](_0x352152['TrunkBackup'])?_0x352152[_0xe7bc('0x77')]['name']:_0x352152[_0xe7bc('0x16e')]['name'],isNotNull(_0x352152[_0xe7bc('0x173')])?_0x352152[_0xe7bc('0x173')][_0xe7bc('0x174')]()||'':'',_0x352152[_0xe7bc('0x175')]>0x0?_0x20fb9d[_0xe7bc('0x150')][_0xe7bc('0x151')][_0xe7bc('0x176')](_0x352152[_0xe7bc('0x175')]):_0x20fb9d[_0xe7bc('0x150')][_0xe7bc('0x151')]),'callerid':_0xd0b24e,'Exten':_0xe7bc('0x158'),'Context':_0xe7bc('0x177'),'Priority':'1','variable':_0x613699,'timeout':(_0x352152[_0xe7bc('0x5e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4433f5})[_0xe7bc('0xbf')](function(_0x3158f3){return _0x459dd0(_0x3158f3);})[_0xe7bc('0xb5')](function(_0x1a1ff2){_0x352152[_0xe7bc('0x178')]+=0x1;var _0x46325b=new History(_0x2d1cab[_0xe7bc('0x28')][_0x4433f5]);logger[_0xe7bc('0x9c')](util['format'](_0xe7bc('0x179'),JSON[_0xe7bc('0x7a')](_0x1a1ff2)));_0x46325b[_0xe7bc('0xe8')]=0xe;_0x46325b[_0xe7bc('0xab')]=_0xe7bc('0x17a');_0x46325b[_0xe7bc('0x17b')]=moment()[_0xe7bc('0x7b')](_0xe7bc('0x103'));_0x46325b[_0xe7bc('0x17c')]=_0x46325b['starttime'];_0x2d1cab[_0xe7bc('0xce')](_0x46325b)['catch'](loggerCatch(_0xe7bc('0x17d')));_0x2d1cab[_0xe7bc('0xcc')](_0x46325b)[_0xe7bc('0xb5')](loggerCatch(_0xe7bc('0x17d')))['finally'](function(){delete _0x2d1cab[_0xe7bc('0x28')][_0x4433f5];return _0x246c1b(msgResponse(_0xe7bc('0x14e'),_0xe7bc('0x4b'),'originate\x20action\x20Error'));});});});};Dialer[_0xe7bc('0x1e')][_0xe7bc('0x34')]=function(_0x406577){var _0x442d86=this[_0xe7bc('0x28')][_0x406577[_0xe7bc('0x10d')]];var _0x22eebe=this;if(_0x442d86){delete this['actions'][_0x406577[_0xe7bc('0x10d')]];_0x442d86[_0xe7bc('0x108')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x5d31c5=_0x442d86[_0xe7bc('0x50')]===_0xe7bc('0x7e')?this['campaigns'][_0x442d86[_0xe7bc('0xb8')]]:this['voiceQueues'][_0x442d86[_0xe7bc('0x17e')]()];if(!this[_0xe7bc('0xdc')](_0x406577[_0xe7bc('0x17f')])){this[_0xe7bc('0xb7')](_0x5d31c5);return this[_0xe7bc('0x180')](_0x442d86,_0x5d31c5,_0x406577)[_0xe7bc('0xbf')](function(_0x5196de){})[_0xe7bc('0xb5')](loggerCatch('[callProgressDetecting]\x20'));}else{this[_0xe7bc('0x2a')][_0x406577['uniqueid']]=_0x442d86;}}};Dialer[_0xe7bc('0x1e')]['checkRetriveMax']=function(_0x434d53,_0x607a90,_0x1974d1){var _0x773200=new History(_0x607a90);if(_0x773200[_0xe7bc('0x181')]+_0x773200[_0xe7bc('0x182')]+_0x773200['countnoanswerretry']>=_0x1974d1[_0xe7bc('0x183')]-0x1){return!![];}switch(_0x434d53){case 0x3:if(_0x773200['countnoanswerretry']>=_0x1974d1[_0xe7bc('0x184')]-0x1){return!![];}else{this[_0xe7bc('0xc5')]({'active':![],'countnoanswerretry':_0x773200[_0xe7bc('0x185')]+=0x1,'scheduledat':moment()[_0xe7bc('0x186')](_0x1974d1[_0xe7bc('0x187')],_0xe7bc('0x188'))['format'](_0xe7bc('0x103')),'ContactId':_0x773200[_0xe7bc('0xd5')],'ListId':_0x773200['ListId'],'VoiceQueueId':_0x773200[_0xe7bc('0xd8')]||undefined,'CampaignId':_0x773200['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][NoAnswer]'));}break;case 0x5:if(_0x773200['countbusyretry']>=_0x1974d1[_0xe7bc('0x189')]-0x1){return!![];}else{this[_0xe7bc('0xc5')]({'active':![],'countbusyretry':_0x773200[_0xe7bc('0x181')]+=0x1,'scheduledat':moment()[_0xe7bc('0x186')](_0x1974d1[_0xe7bc('0x18a')],'minutes')[_0xe7bc('0x7b')](_0xe7bc('0x103')),'ContactId':_0x773200[_0xe7bc('0xd5')],'ListId':_0x773200[_0xe7bc('0xd6')],'VoiceQueueId':_0x773200[_0xe7bc('0xd8')]||undefined,'CampaignId':_0x773200[_0xe7bc('0xd9')]||undefined})[_0xe7bc('0xb5')](loggerCatch(_0xe7bc('0x18b')));}break;case 0x8:if(_0x773200['countcongestionretry']>=_0x1974d1['dialCongestionMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countcongestionretry':_0x773200[_0xe7bc('0x182')]+=0x1,'scheduledat':moment()['add'](_0x1974d1[_0xe7bc('0x18c')],_0xe7bc('0x188'))[_0xe7bc('0x7b')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x773200[_0xe7bc('0xd5')],'ListId':_0x773200[_0xe7bc('0xd6')],'VoiceQueueId':_0x773200['VoiceQueueId']||undefined,'CampaignId':_0x773200[_0xe7bc('0xd9')]||undefined})['catch'](loggerCatch(_0xe7bc('0x18d')));}break;default:return!![];}};Dialer[_0xe7bc('0x1e')][_0xe7bc('0x180')]=function(_0xc4636f,_0x55677c,_0x5cce00){var _0x38f38b=this;var _0x40fc5d=new History(_0xc4636f);return new BPromise(function(_0x3e8c94,_0x33c79d){if(_[_0xe7bc('0x40')](_0x55677c)&&'object'!==typeof _0x55677c){return _0x33c79d(msgResponse(_0xe7bc('0x18e'),_0xe7bc('0x12d'),_0xe7bc('0x18f')));}if(_[_0xe7bc('0x40')](_0x5cce00)&&'object'!==typeof _0x5cce00){return _0x33c79d(msgResponse(_0xe7bc('0x18e'),_0xe7bc('0x12d'),_0xe7bc('0x190')));}switch(_0x5cce00[_0xe7bc('0xfe')]){case'0':_0x55677c['outboundNoSuchCallsDay']+=0x1;_0x40fc5d[_0xe7bc('0xe8')]=0x0;_0x40fc5d[_0xe7bc('0xab')]=_0xe7bc('0x191');_0x38f38b[_0xe7bc('0xce')](_0x40fc5d)[_0xe7bc('0xb5')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x38f38b['checkRetriveMax'](0x0,_0xc4636f,_0x55677c)){if(_0x40fc5d[_0xe7bc('0x181')]+_0x40fc5d[_0xe7bc('0x182')]+_0x40fc5d[_0xe7bc('0x185')]>=_0x55677c[_0xe7bc('0x183')]){_0x38f38b[_0xe7bc('0x192')](_0x40fc5d,_0x3e8c94,_0x33c79d,_0xe7bc('0x193'));}else{_0x38f38b[_0xe7bc('0x194')](_0x40fc5d,_0x3e8c94,_0x33c79d,_0xe7bc('0x193'));}}break;case'3':_0x55677c['outboundNoAnswerCallsDay']+=0x1;_0x40fc5d['state']=0x3;_0x40fc5d[_0xe7bc('0xab')]=_0xe7bc('0x195');_0x40fc5d[_0xe7bc('0x185')]+=0x1;_0x40fc5d[_0xe7bc('0x196')]+=0x1;_0x38f38b[_0xe7bc('0xce')](_0x40fc5d)[_0xe7bc('0xb5')](loggerCatch(_0xe7bc('0x197')));if(_0x38f38b[_0xe7bc('0x198')](0x3,_0xc4636f,_0x55677c)){if(_0x40fc5d[_0xe7bc('0x185')]>=_0x55677c[_0xe7bc('0x184')]){_0x38f38b[_0xe7bc('0x194')](_0x40fc5d,_0x3e8c94,_0x33c79d,'reason\x203\x20ringing\x20no\x20answer');}else{_0x38f38b['stateGlobal'](_0x40fc5d,_0x3e8c94,_0x33c79d,_0xe7bc('0x199'));}}break;case'5':_0x55677c[_0xe7bc('0x62')]+=0x1;_0x40fc5d['state']=0x5;_0x40fc5d['statedesc']=_0xe7bc('0x19a');_0x40fc5d[_0xe7bc('0x181')]+=0x1;_0x40fc5d[_0xe7bc('0x196')]+=0x1;_0x38f38b[_0xe7bc('0xce')](_0x40fc5d)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x38f38b[_0xe7bc('0x198')](0x5,_0xc4636f,_0x55677c)){if(_0x40fc5d[_0xe7bc('0x181')]>=_0x55677c[_0xe7bc('0x189')]){_0x38f38b[_0xe7bc('0x194')](_0x40fc5d,_0x3e8c94,_0x33c79d,_0xe7bc('0x19b'));}else{_0x38f38b[_0xe7bc('0x192')](_0x40fc5d,_0x3e8c94,_0x33c79d,_0xe7bc('0x19b'));}}break;case'8':_0x55677c[_0xe7bc('0x63')]+=0x1;_0x40fc5d['state']=0x8;_0x40fc5d[_0xe7bc('0xab')]='Congestion';_0x40fc5d[_0xe7bc('0x182')]+=0x1;_0x40fc5d['countglobal']+=0x1;_0x38f38b[_0xe7bc('0xce')](_0x40fc5d)[_0xe7bc('0xb5')](loggerCatch(_0xe7bc('0x19c')));if(_0x38f38b[_0xe7bc('0x198')](0x8,_0xc4636f,_0x55677c)){if(_0x40fc5d[_0xe7bc('0x182')]>=_0x55677c[_0xe7bc('0x19d')]){_0x38f38b[_0xe7bc('0x194')](_0x40fc5d,_0x3e8c94,_0x33c79d,_0xe7bc('0x19e'));}else{_0x38f38b[_0xe7bc('0x192')](_0x40fc5d,_0x3e8c94,_0x33c79d,_0xe7bc('0x19e'));}}break;default:_0x55677c['outboundUnknownCallsDay']+=0x1;_0x40fc5d[_0xe7bc('0xe8')]=0xc;_0x40fc5d[_0xe7bc('0xab')]=_0x5cce00[_0xe7bc('0xfe')];_0x38f38b['createHistory'](_0x40fc5d)['catch'](loggerCatch(_0xe7bc('0x19f')));if(_0x38f38b[_0xe7bc('0x198')](_0x5cce00[_0xe7bc('0xfe')],_0xc4636f,_0x55677c)){if(_0x40fc5d[_0xe7bc('0x181')]+_0x40fc5d[_0xe7bc('0x182')]+_0x40fc5d[_0xe7bc('0x185')]>=_0x55677c['dialGlobalMaxRetry']){_0x38f38b['stateGlobal'](_0x40fc5d,_0x3e8c94,_0x33c79d,_0x5cce00['reason']);}else{_0x38f38b['createStateFinal'](_0x40fc5d,_0x3e8c94,_0x33c79d,_0x5cce00[_0xe7bc('0xfe')]);}}}});};Dialer[_0xe7bc('0x1e')][_0xe7bc('0x192')]=function(_0x11cc73,_0x1edca3,_0x4745d5,_0xb70786){var _0x554b3c=new Final(_0x11cc73);_0x554b3c['state']=0xf;_0x554b3c[_0xe7bc('0xab')]=_0xe7bc('0x1a0');this['createStateFinal'](_0x554b3c,_0x1edca3,_0x4745d5,_0xb70786);};Dialer[_0xe7bc('0x1e')][_0xe7bc('0x194')]=function(_0xea6535,_0x7a72ed,_0x3dd5c0,_0x104d15){this[_0xe7bc('0xcc')](_0xea6535)['then'](function(_0x5513e2){return _0x7a72ed(msgResponse(_0xe7bc('0x18e'),_0xe7bc('0xdd'),_0x104d15));})[_0xe7bc('0xb5')](function(_0x25b607){return _0x3dd5c0(msgResponse(_0xe7bc('0x1a1'),_0xe7bc('0x12d'),_0xe7bc('0x1a2')));});};Dialer[_0xe7bc('0x1e')][_0xe7bc('0x141')]=function(_0x53e9e0){var _0x21f7b8=this;var _0x159a06=_0x53e9e0[_0xe7bc('0x1a3')]/0x64;var _0x7ca1ed=_0x53e9e0[_0xe7bc('0x10a')]/(_0x53e9e0[_0xe7bc('0x10a')]+_0x53e9e0['outboundAnswerCallsDay']);var _0x32f07b=Math[_0xe7bc('0x1a4')](_0x53e9e0[_0xe7bc('0x71')]*(_0x53e9e0[_0xe7bc('0x1a5')]/0x64));var _0x145564=Math[_0xe7bc('0x1a4')](_0x53e9e0[_0xe7bc('0x71')]*(_0x53e9e0[_0xe7bc('0x1a6')]/0x64));var _0x215926=_0x53e9e0[_0xe7bc('0x53')]+_0x53e9e0['talking'];var _0x3f40a0=Math[_0xe7bc('0x1a7')](_0x53e9e0['erlangCalls']*_0x53e9e0[_0xe7bc('0x90')]*_0x53e9e0[_0xe7bc('0x6e')]*_0x53e9e0[_0xe7bc('0x6f')]);if(_[_0xe7bc('0x40')](_0x53e9e0[_0xe7bc('0x2c')])){if(!_[_0xe7bc('0x40')](_0x53e9e0['startPredictive'])){_0x53e9e0[_0xe7bc('0x2b')]=undefined;loggerPredictive[_0xe7bc('0x9c')](_0xe7bc('0x1a8'),_0xe7bc('0x1a9'));}if(!_[_0xe7bc('0x40')](_0x53e9e0['handlePredictive'])){loggerPredictive[_0xe7bc('0x9c')](_0xe7bc('0x1a8'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x53e9e0[_0xe7bc('0x96')]);_0x53e9e0[_0xe7bc('0x96')]=undefined;}_0x53e9e0[_0xe7bc('0x2c')]=moment()[_0xe7bc('0x7b')](_0xe7bc('0x103'));loggerPredictive['info'](_0x53e9e0['name'],_0xe7bc('0x1aa'),_0x53e9e0[_0xe7bc('0x2c')]);this[_0xe7bc('0x13e')](_0x53e9e0,0x1);}else if(ifInterval(_0x53e9e0[_0xe7bc('0x1ab')],_0x53e9e0[_0xe7bc('0x2c')])){this[_0xe7bc('0x13e')](_0x53e9e0,0x1);loggerPredictiveCalls[_0xe7bc('0x80')](_0xe7bc('0x1ac'),_0x53e9e0[_0xe7bc('0x2c')],_0x53e9e0[_0xe7bc('0x42')]);_0x53e9e0[_0xe7bc('0x74')]=0x0;_0x53e9e0[_0xe7bc('0x6d')]=0x0;}else if(_0x159a06<_0x7ca1ed&&_0x53e9e0[_0xe7bc('0x1ad')]==='dropRate'){freeVariablesPredictive(_0x53e9e0);loggerPredictive['info'](_0xe7bc('0x1ae'),_0xe7bc('0x1af'),_0x7ca1ed,_0xe7bc('0x2c'),_0x53e9e0[_0xe7bc('0x42')]);}else if(_0x3f40a0<_0x53e9e0[_0xe7bc('0x6d')]&&_0x53e9e0['dialPredictiveOptimization']===_0xe7bc('0x1b0')){freeVariablesPredictive(_0x53e9e0);loggerPredictive[_0xe7bc('0x80')](_0xe7bc('0x1b1'),_0xe7bc('0x1b2'),_0x3f40a0,'Drop\x20in\x20this\x20interval',_0x53e9e0['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x53e9e0[_0xe7bc('0x42')]);}else if(!ifInterval(_0x53e9e0[_0xe7bc('0x1ab')],_0x53e9e0[_0xe7bc('0x2c')])&&_[_0xe7bc('0x40')](_0x53e9e0['startPredictive'])&&!_[_0xe7bc('0x40')](_0x53e9e0[_0xe7bc('0x2c')])){_0x53e9e0[_0xe7bc('0x2b')]=moment()[_0xe7bc('0x7b')](_0xe7bc('0x103'));loggerPredictive[_0xe7bc('0x80')](_0x53e9e0[_0xe7bc('0x42')],_0xe7bc('0x1b3'),_0x53e9e0[_0xe7bc('0x2b')]);this[_0xe7bc('0xc2')](_0x53e9e0['dialPredictiveInterval'])[_0xe7bc('0xbf')](this[_0xe7bc('0x1b4')](_0x53e9e0))[_0xe7bc('0xbf')](mergeDataErlangB(_0x53e9e0))['then'](this[_0xe7bc('0x1b5')](_0x53e9e0))[_0xe7bc('0xb5')](loggerCatchPredictive(_0xe7bc('0x1b6'),_0x53e9e0));}else if(!ifInterval(_0x53e9e0[_0xe7bc('0x1ab')],_0x53e9e0[_0xe7bc('0x2b')])){_0x53e9e0[_0xe7bc('0x6d')]=0x0;_0x53e9e0[_0xe7bc('0x2b')]=moment()[_0xe7bc('0x7b')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xe7bc('0x80')](_0x53e9e0[_0xe7bc('0x42')],_0xe7bc('0x1b7'),_0x53e9e0[_0xe7bc('0x2b')]);clearInterval(_0x53e9e0[_0xe7bc('0x96')]);_0x53e9e0[_0xe7bc('0x96')]=undefined;this[_0xe7bc('0xc2')](_0x53e9e0[_0xe7bc('0x1ab')])[_0xe7bc('0xbf')](this[_0xe7bc('0x1b4')](_0x53e9e0))['then'](mergeDataErlangB(_0x53e9e0))[_0xe7bc('0xbf')](this[_0xe7bc('0x1b5')](_0x53e9e0))[_0xe7bc('0xb5')](loggerCatchPredictive(_0xe7bc('0x1b8'),_0x53e9e0));}else if(_0x53e9e0[_0xe7bc('0x71')]&&_0x215926<_0x53e9e0['predictiveIntervalAvailable']-_0x145564){freeVariablesPredictive(_0x53e9e0);loggerPredictive[_0xe7bc('0x80')](_0x53e9e0[_0xe7bc('0x42')],_0xe7bc('0x1b9'),_0x215926,')\x20are\x20less\x20than\x20threshold\x20(',_0x53e9e0[_0xe7bc('0x71')],'-',_0x145564,'=',_0x53e9e0[_0xe7bc('0x71')]-_0x145564,')');}else if(_0x53e9e0['predictiveIntervalAvailable']&&_0x215926>_0x53e9e0[_0xe7bc('0x71')]+_0x32f07b){freeVariablesPredictive(_0x53e9e0);loggerPredictive[_0xe7bc('0x80')](_0x53e9e0[_0xe7bc('0x42')],_0xe7bc('0x1b9'),_0x215926,')\x20are\x20more\x20than\x20threshold\x20(',_0x53e9e0['predictiveIntervalAvailable'],'+',_0x32f07b,'=',_0x53e9e0['predictiveIntervalAvailable']+_0x32f07b,')');}};Dialer[_0xe7bc('0x1e')][_0xe7bc('0x1b4')]=function(_0x2ec884){var _0x4b2b98=this;return function(_0x1dc36f){return new BPromise(function(_0x3e2bf1,_0x5b7433){_[_0xe7bc('0x93')](_0x2ec884,_0x1dc36f[0x0]);if(checkGetDataPredictive(_0x1dc36f[0x0])){var _0x4c74d8=_0x2ec884[_0xe7bc('0x71')]=_0x2ec884['talking']+_0x2ec884['available'];var _0x2b06b4=_0x2ec884[_0xe7bc('0x1ab')]*0x3c;var _0x25f076=_0x1dc36f[0x0]['predictiveIntervalAvgTalktime']+_0x1dc36f[0x0][_0xe7bc('0x8a')];var _0x4284b5=(_0x1dc36f[0x0][_0xe7bc('0x84')]+_0x1dc36f[0x0][_0xe7bc('0x6b')]+_0x1dc36f[0x0][_0xe7bc('0x6a')])/_0x1dc36f[0x0][_0xe7bc('0x72')];_0x2ec884[_0xe7bc('0x6e')]=_0x4284b5>0x0?_0x4284b5:0x1;switch(_0x2ec884[_0xe7bc('0x1ad')]){case'dropRate':var _0x50dc3a=_0x2ec884[_0xe7bc('0x1a3')]/0x64;return _0x4b2b98['abandonmentRate'](_0x4c74d8,_0x2b06b4,_0x25f076,_0x4284b5,_0x50dc3a)[_0xe7bc('0xbf')](function(_0x13b3ba){return _0x3e2bf1(_0x13b3ba);});case _0xe7bc('0x1ba'):var _0x2922c0=_0x2ec884['dialPredictiveOptimizationPercentage']/0x64;return _0x4b2b98[_0xe7bc('0x1bb')](_0x4c74d8,_0x2b06b4,_0x25f076,_0x4284b5,_0x2922c0)[_0xe7bc('0xbf')](function(_0x55efbe){return _0x3e2bf1(_0x55efbe);});default:return _0x5b7433(msgResponse(_0xe7bc('0x1bc'),'Failure',_0xe7bc('0x1bd')));}}else{return _0x5b7433(msgResponse(_0xe7bc('0x1bc'),_0xe7bc('0x12d'),_0xe7bc('0x1be')));}});};};Dialer[_0xe7bc('0x1e')][_0xe7bc('0x1bf')]=function(_0x43ce7e){var _0x583286=this;return function(_0x43796d){return new BPromise(function(_0x18d907,_0x5f2511){_['merge'](_0x43ce7e,_0x43796d[0x0]);if(checkGetDataPredictive(_0x43796d[0x0])){loggerPredictive[_0xe7bc('0x80')](JSON['stringify'](_0x43796d[0x0]));if(_0x43ce7e['dialPredictiveOptimization']===_0xe7bc('0x1b0')){return _0x583286[_0xe7bc('0xca')](_0x43ce7e['id'])[_0xe7bc('0xbf')](function(_0x29996b){var _0x5b3029=_0x43ce7e[_0xe7bc('0x54')]-_0x29996b[0x0][_0xe7bc('0x1c0')];var _0x6d7990=_0x43ce7e[_0xe7bc('0x1ab')]*0x3c;var _0x935b4f=_0x43796d[0x0][_0xe7bc('0x69')]+_0x43796d[0x0][_0xe7bc('0x8a')];var _0x4905f7=(_0x43796d[0x0][_0xe7bc('0x84')]+_0x43796d[0x0][_0xe7bc('0x6b')]+_0x43796d[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x43796d[0x0][_0xe7bc('0x72')];var _0x4b1e82=_0x43ce7e[_0xe7bc('0x1a3')]/0x64;_0x43ce7e[_0xe7bc('0x70')]=_0x29996b[0x0]['outboundQueuePauses']||0x0;_0x43ce7e[_0xe7bc('0x6e')]=_0x4905f7>0x0?_0x4905f7:0x1;return _0x583286[_0xe7bc('0x1c1')](_0x5b3029,_0x6d7990,_0x935b4f,_0x4905f7,_0x4b1e82);})[_0xe7bc('0xbf')](function(_0x3e96fe){return _0x18d907(_0x3e96fe);})[_0xe7bc('0xb5')](function(_0x30d497){return _0x5f2511(msgResponse('[CatchErlangB]',_0xe7bc('0x12d'),JSON[_0xe7bc('0x7a')](_0x30d497)));});}if(_0x43ce7e['dialPredictiveOptimization']==='agentBusyFactor'){return _0x583286[_0xe7bc('0xca')](_0x43ce7e['id'])['then'](function(_0x5403ce){var _0x414e04=_0x43ce7e['loggedIn']-_0x5403ce[0x0]['outboundQueuePauses'];var _0x12aba9=_0x43ce7e[_0xe7bc('0x1ab')]*0x3c;var _0x21e4d0=_0x43796d[0x0]['predictiveIntervalAvgTalktime']+_0x43796d[0x0][_0xe7bc('0x8a')];var _0x57c3ce=(_0x43796d[0x0][_0xe7bc('0x84')]+_0x43796d[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x43796d[0x0][_0xe7bc('0x6a')])/_0x43796d[0x0]['predictiveIntervalTotalCalls'];var _0x41fbb4=_0x43ce7e[_0xe7bc('0x1a3')]/0x64;_0x43ce7e[_0xe7bc('0x70')]=_0x5403ce[0x0][_0xe7bc('0x1c0')]||0x0;_0x43ce7e[_0xe7bc('0x6e')]=_0x57c3ce>0x0?_0x57c3ce:0x1;return _0x583286[_0xe7bc('0x1bb')](_0x414e04,_0x12aba9,_0x21e4d0,_0x57c3ce,_0x41fbb4);})[_0xe7bc('0xbf')](function(_0x1c0e59){return _0x18d907(_0x1c0e59);})[_0xe7bc('0xb5')](function(_0xceaeac){return _0x5f2511(msgResponse(_0xe7bc('0x1c2'),_0xe7bc('0x12d'),JSON[_0xe7bc('0x7a')](_0xceaeac)));});}}else{return _0x5f2511(msgResponse('[getDataPredictive]',_0xe7bc('0x12d'),'check\x20failure'));}});};};Dialer['prototype'][_0xe7bc('0x1b5')]=function(_0x2f97d9){var _0x49e18f=this;return function(){var _0x2faa5c=0x0;var _0x272baa=Math[_0xe7bc('0x1a7')](_0x2f97d9[_0xe7bc('0x75')]*0x3e8);if(_0x272baa>0x0){_0x272baa=_0x272baa<0x64?0x64:_0x272baa;loggerPredictive[_0xe7bc('0x80')](_0x2f97d9['name'],_0xe7bc('0x1c3'),_0x272baa,'milliseconds');_0x2f97d9['handlePredictive']=setInterval(function(){_0x49e18f[_0xe7bc('0x96')](_0x2f97d9);loggerPredictiveCalls[_0xe7bc('0x80')](_0xe7bc('0x1c4'),_0x2faa5c+=0x1);},_0x272baa);}else{loggerPredictive[_0xe7bc('0x80')](_0x2f97d9[_0xe7bc('0x42')],_0xe7bc('0x1c5'));}};};Dialer['prototype'][_0xe7bc('0x1c6')]=function(_0x27b418,_0x315f5f){var _0xa6f366=this;return function(_0x22bdd8){if(_[_0xe7bc('0x49')](_0x22bdd8)){if(_['isNil'](_0x315f5f[_0xe7bc('0xd7')])||!_0x315f5f[_0xe7bc('0x1c7')]){if(_0x27b418[_0xe7bc('0x5c')]===_0xe7bc('0x8')){_0x27b418[_0xe7bc('0x114')]=_[_0xe7bc('0x40')](_0x27b418[_0xe7bc('0x114')])?!![]:_0x27b418[_0xe7bc('0x114')];var _0x18df0e=uuid['v4']();_0xa6f366[_0xe7bc('0x28')][_0x18df0e]=new Action(_0x27b418,_0x315f5f,_0x18df0e);loggerBooked[_0xe7bc('0x80')](_0xe7bc('0x1c8'),_0x18df0e,'queueStatusComplete:\x20',JSON['stringify'](_0x27b418['queueStatusComplete']),_0xe7bc('0x1c9'),_0x27b418['name']);if(_0x27b418[_0xe7bc('0x114')]){_0x27b418[_0xe7bc('0x114')]=![];_0xa6f366[_0xe7bc('0x2e')][_0xa6f366['actions'][_0x18df0e]['queue']]=[];ami[_0xe7bc('0xb2')]({'actionid':_0x18df0e,'action':_0xe7bc('0x1ca'),'queue':_0x27b418[_0xe7bc('0x42')]})[_0xe7bc('0xb5')](function(_0x60809f){_0xa6f366['updateOriginated'](_0x27b418);_0xa6f366[_0xe7bc('0xc5')]({'active':![],'ContactId':_0xa6f366[_0xe7bc('0x28')][_0x18df0e]['ContactId'],'ListId':_0xa6f366[_0xe7bc('0x28')][_0x18df0e][_0xe7bc('0xd6')],'VoiceQueueId':_0xa6f366['actions'][_0x18df0e]['VoiceQueueId']||undefined,'CampaignId':_0xa6f366[_0xe7bc('0x28')][_0x18df0e][_0xe7bc('0xd9')]||undefined})[_0xe7bc('0xb5')](loggerCatch(_0xe7bc('0x1cb')));delete _0xa6f366['actions'][_0x18df0e];});}else{loggerBooked[_0xe7bc('0x80')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x27b418['queueStatusComplete']),_0xe7bc('0x1c9'),_0x27b418['name']);_0xa6f366[_0xe7bc('0xb7')](_0x27b418);_0xa6f366[_0xe7bc('0xc5')]({'active':![],'ContactId':_0xa6f366['actions'][_0x18df0e]['ContactId'],'ListId':_0xa6f366[_0xe7bc('0x28')][_0x18df0e][_0xe7bc('0xd6')],'VoiceQueueId':_0xa6f366[_0xe7bc('0x28')][_0x18df0e]['VoiceQueueId']||undefined,'CampaignId':_0xa6f366[_0xe7bc('0x28')][_0x18df0e][_0xe7bc('0xd9')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0xa6f366['actions'][_0x18df0e];}}else{return _0xa6f366['actionOriginate'](_0x27b418,_0x315f5f);}}else{if(getDiff(_0x315f5f[_0xe7bc('0x1cc')])<_0x27b418['dialRecallMeTimeout']*0x3c){_0xa6f366['preview'][_0xe7bc('0x11c')](_0x315f5f['id'])[_0xe7bc('0x11e')](function(){_0xa6f366[_0xe7bc('0xb7')](_0x27b418);});}else{_0x27b418[_0xe7bc('0x1cd')]+=0x1;_0xa6f366[_0xe7bc('0xb7')](_0x27b418);if(_0x27b418[_0xe7bc('0x1ce')]){_0xa6f366[_0xe7bc('0xc5')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x315f5f[_0xe7bc('0xd5')],'ListId':_0x315f5f[_0xe7bc('0xd6')],'VoiceQueueId':_0x315f5f[_0xe7bc('0xd8')]||undefined,'CampaignId':_0x315f5f[_0xe7bc('0xd9')]||undefined})[_0xe7bc('0xb5')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0xa6f366['createHistory'](createObjHistory(_0x27b418,_0x315f5f,_0xe7bc('0x1cf'),0x17,_0xe7bc('0x1d0')))[_0xe7bc('0xb5')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0xa6f366[_0xe7bc('0xd3')](createObjHistory(_0x27b418,_0x315f5f,_0xe7bc('0x1d1'),0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]',_0xe7bc('0x1d2'));}}}}else{_0x27b418[_0xe7bc('0x61')]+=0x1;_0xa6f366['saveInDb'](createObjHistory(_0x27b418,_0x315f5f,_0xe7bc('0x1d3'),0xd,_0xe7bc('0x1d4')),_0xe7bc('0x1d5'),_0xe7bc('0x1d6'));throw _0xe7bc('0x1d7');}};};Dialer[_0xe7bc('0x1e')][_0xe7bc('0x144')]=function(_0x45a87f){var _0x3e3063=this;var _0x444433=[];var _0x22d296=_0x45a87f[_0xe7bc('0x1d8')]-_0x45a87f[_0xe7bc('0x73')]-_0x45a87f['temp'];emitCampaignSummary(_0x45a87f);if(_0x22d296>0x0){if(_0x22d296>this[_0xe7bc('0x26')]){_0x22d296=this[_0xe7bc('0x26')];}_0x45a87f[_0xe7bc('0x1d9')]+=_0x22d296;this[_0xe7bc('0xc8')](_0x45a87f['id'],_0x22d296,_0x45a87f['dialOrderByScheduledAt'])[_0xe7bc('0xbf')](function(_0x5c208b){_0x45a87f[_0xe7bc('0x1d9')]-=_0x22d296;_0x45a87f[_0xe7bc('0x1d9')]=_0x45a87f['temp']>0x0?_0x45a87f[_0xe7bc('0x1d9')]:0x0;if(!checkContactEmpty(_0x5c208b)){_0x45a87f[_0xe7bc('0x41')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xe7bc('0x80')]('[getContactCampaign2][Empty]'+_0x45a87f[_0xe7bc('0x42')]);}else{_0x45a87f[_0xe7bc('0x73')]+=_0x5c208b[_0xe7bc('0x118')];_0x45a87f['message']='RUNNING';for(var _0x21b780=0x0;_0x21b780<_0x5c208b[_0xe7bc('0x118')];_0x21b780+=0x1){_0x45a87f[_0xe7bc('0x1da')]+=0x1;if(_['isNil'](_0x5c208b[_0x21b780])||_[_0xe7bc('0xb1')](_0x5c208b[_0x21b780][_0xe7bc('0x150')])||_[_0xe7bc('0xb1')](_0x5c208b[_0x21b780][_0xe7bc('0x150')]['phone'])){_0x3e3063[_0xe7bc('0xd2')](_0xe7bc('0x1db'),_0x45a87f,_0x5c208b[_0x21b780]);}else{_0x3e3063[_0xe7bc('0xc0')](_[_0xe7bc('0xd4')](_0x5c208b[_0x21b780],[_0xe7bc('0xd9'),'Contact.phone']))[_0xe7bc('0xbf')](_0x3e3063[_0xe7bc('0x1c6')](_0x45a87f,_0x5c208b[_0x21b780]))[_0xe7bc('0xb5')](_0x3e3063[_0xe7bc('0xd1')](_0xe7bc('0x1dc'),_0x45a87f));}}}})[_0xe7bc('0xb5')](loggerGetContactDialer(_0xe7bc('0x1dd'),_0x45a87f,_0x22d296));}};Dialer['prototype'][_0xe7bc('0x13e')]=function(_0x17588f,_0x4d6018){var _0x2eca9c=this;var _0x3d5c87=[];var _0x19e6b9=_0x4d6018>=0x1?_0x4d6018:0x1;var _0x2941ea=[];if(_0x17588f[_0xe7bc('0x5c')]===_0xe7bc('0x8')){_0x19e6b9=0x1;}var _0x1333c7=Math['floor'](_0x17588f[_0xe7bc('0x53')]*_0x19e6b9)-_0x17588f[_0xe7bc('0x73')]-_0x17588f[_0xe7bc('0x1d9')];emitVoiceQueueSummary(_0x17588f);if(_0x17588f[_0xe7bc('0x1de')]>0x0){var _0x3461bf=_0x17588f[_0xe7bc('0x1de')]-_0x17588f[_0xe7bc('0x73')]-_0x17588f[_0xe7bc('0xa6')]-_0x17588f[_0xe7bc('0x1d9')]-_0x17588f[_0xe7bc('0x55')];if(_0x1333c7>_0x3461bf){_0x1333c7=_0x3461bf;}}if(_0x1333c7>0x0){if(_0x17588f[_0xe7bc('0x5c')]==='booked'){_0x1333c7=0x1;}if(_0x1333c7>this[_0xe7bc('0x26')]){_0x1333c7=this[_0xe7bc('0x26')];}_0x17588f[_0xe7bc('0x1d9')]+=_0x1333c7;for(var _0x4eb31a in this['agents']){if(this['agents'][_0xe7bc('0x9d')](_0x4eb31a)){if(this[_0xe7bc('0x24')][_0x4eb31a][_0xe7bc('0xe8')]===_0xe7bc('0x1df')&&this[_0xe7bc('0x24')][_0x4eb31a][_0xe7bc('0xb3')]===_0xe7bc('0xe0')){_0x3d5c87[_0xe7bc('0x112')](this[_0xe7bc('0x24')][_0x4eb31a]['id']);}}}this[_0xe7bc('0xc7')](_0x17588f['id'],_0x3d5c87,_0x1333c7,_0x17588f[_0xe7bc('0x1e0')])[_0xe7bc('0xbf')](function(_0x3a7a52){_0x17588f[_0xe7bc('0x1d9')]-=_0x1333c7;_0x17588f[_0xe7bc('0x1d9')]=_0x17588f[_0xe7bc('0x1d9')]>0x0?_0x17588f[_0xe7bc('0x1d9')]:0x0;if(!checkContactEmpty(_0x3a7a52)){_0x2eca9c[_0xe7bc('0xbb')](_0x17588f)[_0xe7bc('0xbf')](sendMessageReschedule(_0x17588f))[_0xe7bc('0xb5')](loggerCatch(_0xe7bc('0xbd')));}else{_0x17588f[_0xe7bc('0x73')]+=_0x3a7a52[_0xe7bc('0x118')];_0x17588f['message']=_0x17588f['dialMethod']==='booked'?_0xe7bc('0x157'):'RUNNING';for(var _0x18726f=0x0;_0x18726f<_0x3a7a52[_0xe7bc('0x118')];_0x18726f+=0x1){if(_['isNil'](_0x3a7a52[_0x18726f])||_[_0xe7bc('0xb1')](_0x3a7a52[_0x18726f][_0xe7bc('0x150')])||_[_0xe7bc('0xb1')](_0x3a7a52[_0x18726f][_0xe7bc('0x150')]['phone'])){_0x2eca9c[_0xe7bc('0xd2')](_0xe7bc('0x1db'),_0x17588f,_0x3a7a52[_0x18726f]);}else{_0x2eca9c[_0xe7bc('0xbe')](_[_0xe7bc('0xd4')](_0x3a7a52[_0x18726f],[_0xe7bc('0xd8'),'Contact.phone']))[_0xe7bc('0xbf')](_0x2eca9c['checkContactBlack'](_0x17588f,_0x3a7a52[_0x18726f]))[_0xe7bc('0xb5')](_0x2eca9c[_0xe7bc('0xd1')]('[actionOriginate]\x20',_0x17588f));}}}})[_0xe7bc('0xb5')](loggerGetContactDialer(_0xe7bc('0x1e1'),_0x17588f,_0x1333c7));}};Dialer[_0xe7bc('0x1e')][_0xe7bc('0x96')]=function(_0x10afe0){var _0x599f6e=this;if(_0x10afe0[_0xe7bc('0x1de')]>0x0){var _0x149fae=_0x10afe0[_0xe7bc('0x1de')]-_0x10afe0[_0xe7bc('0x73')]-_0x10afe0['talking'];if(_0x149fae>0x0){this[_0xe7bc('0x1e2')](_0x10afe0);}else{loggerPredictiveCalls[_0xe7bc('0x80')](_0xe7bc('0x1e3'));}}else{this[_0xe7bc('0x1e2')](_0x10afe0);}};Dialer[_0xe7bc('0x1e')][_0xe7bc('0x1e2')]=function(_0x17262d){var _0x247322=this;var _0x457e8b=[];_0x17262d[_0xe7bc('0x73')]+=0x1;for(var _0x545cdc in this[_0xe7bc('0x24')]){if(this['agents'][_0xe7bc('0x9d')](_0x545cdc)){if(this[_0xe7bc('0x24')][_0x545cdc][_0xe7bc('0xe8')]===_0xe7bc('0x1df')&&this[_0xe7bc('0x24')][_0x545cdc][_0xe7bc('0xb3')]===_0xe7bc('0xe0')){_0x457e8b[_0xe7bc('0x112')](this[_0xe7bc('0x24')][_0x545cdc]['id']);}}}this[_0xe7bc('0xc7')](_0x17262d['id'],_0x457e8b,0x1,_0x17262d['dialOrderByScheduledAt'])[_0xe7bc('0xbf')](function(_0x573508){if(!checkContactEmpty(_0x573508)){checkContactLowerLimitOriginate(_0x17262d,0x1,0x0);_0x247322['countReScheduled'](_0x17262d)[_0xe7bc('0xbf')](sendMessageReschedule(_0x17262d))[_0xe7bc('0xb5')](loggerCatch(_0xe7bc('0xbd')));}else{_0x17262d[_0xe7bc('0x41')]=_0xe7bc('0x1e4');if(_['isNil'](_0x573508[0x0])||_['isNil'](_0x573508[0x0][_0xe7bc('0x150')])||_[_0xe7bc('0xb1')](_0x573508[0x0][_0xe7bc('0x150')][_0xe7bc('0x151')])){_0x247322['emptyContact'](_0xe7bc('0x1db'),_0x17262d,_0x573508[0x0]);}else{_0x247322[_0xe7bc('0xbe')](_[_0xe7bc('0xd4')](_0x573508[0x0],[_0xe7bc('0xd8'),_0xe7bc('0x1e5')]))[_0xe7bc('0xbf')](_0x247322['checkContactBlack'](_0x17262d,_0x573508[0x0]))[_0xe7bc('0xb5')](_0x247322[_0xe7bc('0xd1')](_0xe7bc('0x1e6'),_0x17262d));}}})[_0xe7bc('0xb5')](loggerGetContactDialer(_0xe7bc('0x1e7'),_0x17262d,0x1));emitVoiceQueueSummary(_0x17262d);};Dialer[_0xe7bc('0x1e')][_0xe7bc('0x1c1')]=function(_0x5d6ea2,_0x433cbc,_0x1ea95c,_0x5b1598,_0x3c2f9c,_0x21391b){loggerPredictive['info'](_0xe7bc('0x1e8'));loggerPredictive['info'](_0xe7bc('0x1e9'),_0x5d6ea2);loggerPredictive['info'](_0xe7bc('0x1ea'),_0x433cbc);loggerPredictive[_0xe7bc('0x80')](_0xe7bc('0x1eb'),_0x1ea95c);loggerPredictive[_0xe7bc('0x80')]('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',_0x5b1598);loggerPredictive[_0xe7bc('0x80')](_0xe7bc('0x1ec'),_0x3c2f9c);loggerPredictive[_0xe7bc('0x80')](_0xe7bc('0x92'));return new BPromise(function(_0x22ed71,_0x2d5dd2){if(_0x5d6ea2<=0x0||isNaN(_0x5d6ea2)){return _0x2d5dd2(msgResponse(_0xe7bc('0x1ed'),_0xe7bc('0x4b'),'m\x20=\x20'+_0x5d6ea2));}if(_0x1ea95c<=0x0||isNaN(_0x1ea95c)){return _0x2d5dd2(msgResponse(_0xe7bc('0x1ed'),_0xe7bc('0x4b'),_0xe7bc('0x1ee')+_0x1ea95c));}if(_0x5b1598<=0x0||isNaN(_0x5b1598)){return _0x2d5dd2(msgResponse(_0xe7bc('0x1ed'),_0xe7bc('0x4b'),'p\x20=\x20'+_0x5b1598));}if(_0x433cbc<=0x0||isNaN(_0x433cbc)){return _0x2d5dd2(msgResponse(_0xe7bc('0x1ed'),_0xe7bc('0x4b'),'interval\x20=\x20'+_0x433cbc));}if(_0x3c2f9c<=0x0||isNaN(_0x3c2f9c)){return _0x2d5dd2(msgResponse('[abandonmentRate]','Error','Amax\x20=\x20'+_0x3c2f9c));}_0x21391b=_0x21391b||0x0;var _0x59bf0c=0x1/_0x1ea95c;var _0x3ea828=0x0;var _0xfb577b=0x0;var _0x5e5e84=0x0;var _0x582a68=0x0;for(var _0x200aa2=0x0;_0x5e5e84<_0x3c2f9c;_0x200aa2+=0x1){_0xfb577b=_0x200aa2/_0x433cbc;_0x3ea828=(_0x5b1598*_0xfb577b+_0x21391b)/_0x59bf0c;_0x5e5e84=erlangb(_0x3ea828,_0x5d6ea2);_0x582a68=_0x3ea828/_0x5d6ea2*(0x1-erlangb(_0x3ea828,_0x5d6ea2));}return _0x22ed71({'erlangCalls':_0x200aa2,'erlangCallToSecond':_0x433cbc/_0x200aa2,'erlangAbandonmentRate':_0x5e5e84,'erlangBusyFactor':_0x582a68});});};Dialer[_0xe7bc('0x1e')]['busyFactor']=function(_0x5149c7,_0x24f630,_0x5190c0,_0x2cfc2e,_0x288123,_0x1572a9){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xe7bc('0x80')]('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',_0x5149c7);loggerPredictive['info'](_0xe7bc('0x1ea'),_0x24f630);loggerPredictive[_0xe7bc('0x80')](_0xe7bc('0x1eb'),_0x5190c0);loggerPredictive[_0xe7bc('0x80')](_0xe7bc('0x1ef'),_0x2cfc2e);loggerPredictive[_0xe7bc('0x80')](_0xe7bc('0x1f0'),_0x288123);loggerPredictive['info'](_0xe7bc('0x92'));return new BPromise(function(_0x1a0679,_0x5379e6){if(_0x5149c7<=0x0||isNaN(_0x5149c7)){return _0x5379e6(msgResponse('[busyFactor]',_0xe7bc('0x4b'),_0xe7bc('0x1f1')+_0x5149c7));}if(_0x5190c0<=0x0||isNaN(_0x5190c0)){return _0x5379e6(msgResponse(_0xe7bc('0x1f2'),_0xe7bc('0x4b'),_0xe7bc('0x1ee')+_0x5190c0));}if(_0x2cfc2e<=0x0||isNaN(_0x2cfc2e)){return _0x5379e6(msgResponse(_0xe7bc('0x1f2'),'Error','p\x20=\x20'+_0x2cfc2e));}if(_0x24f630<=0x0||isNaN(_0x24f630)){return _0x5379e6(msgResponse(_0xe7bc('0x1f2'),_0xe7bc('0x4b'),_0xe7bc('0x1f3')+_0x24f630));}if(_0x288123<=0x0||isNaN(_0x288123)){return _0x5379e6(msgResponse(_0xe7bc('0x1f2'),_0xe7bc('0x4b'),_0xe7bc('0x1f4')+_0x288123));}_0x1572a9=_0x1572a9||0x0;var _0x4c51f4=0x1/_0x5190c0;var _0x221a37=0x0;var _0x47a714=0x0;var _0x1bc558=0x0;var _0x4ce5e6=0x0;for(var _0x2ee637=0x0;_0x4ce5e6<_0x288123;_0x2ee637+=0x1){_0x47a714=_0x2ee637/_0x24f630;_0x221a37=(_0x2cfc2e*_0x47a714+_0x1572a9)/_0x4c51f4;_0x1bc558=erlangb(_0x221a37,_0x5149c7);_0x4ce5e6=_0x221a37/_0x5149c7*(0x1-erlangb(_0x221a37,_0x5149c7));}return _0x1a0679({'erlangCalls':_0x2ee637,'erlangCallToSecond':_0x24f630/_0x2ee637,'erlangAbandonmentRate':_0x1bc558,'erlangBusyFactor':_0x4ce5e6});});};module[_0xe7bc('0x1f5')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index b86b23a..4074d80 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 _0xed58=['uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','holdtime','talktime','connectedlinename','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','moment','diff','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x158cff,_0x381848){var _0x153c8b=function(_0x2afe3a){while(--_0x2afe3a){_0x158cff['push'](_0x158cff['shift']());}};_0x153c8b(++_0x381848);}(_0xed58,0x125));var _0x8ed5=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xed58[_0x5b644e];return _0x49c6bf;};'use strict';var util=require(_0x8ed5('0x0'));var _=require(_0x8ed5('0x1'));var moment=require(_0x8ed5('0x2'));function getSeconds(_0x5e9654,_0x5babd5){var _0x32005c=moment(_0x5e9654)['milliseconds'](0x0);var _0x2ddd90=moment(_0x5babd5)['milliseconds'](0x0);return _0x32005c[_0x8ed5('0x3')](_0x2ddd90,'seconds');}function QueueCallerAbandon(_0x338f8b,_0x5f44a9){this[_0x8ed5('0x4')]=_0x338f8b[_0x8ed5('0x4')];this[_0x8ed5('0x5')]=_0x338f8b['type'];this[_0x8ed5('0x6')]=_0x338f8b[_0x8ed5('0x5')]===_0x8ed5('0x7')?_0x8ed5('0x8'):_0x338f8b[_0x8ed5('0x5')];this[_0x8ed5('0x9')]=_0x338f8b[_0x8ed5('0x9')];this[_0x8ed5('0xa')]=_0x338f8b[_0x8ed5('0xa')];this[_0x8ed5('0xb')]=_0x338f8b['countnoanswerretry'];this[_0x8ed5('0xc')]=_0x338f8b[_0x8ed5('0x9')]+_0x338f8b[_0x8ed5('0xa')]+_0x338f8b['countnoanswerretry'];this[_0x8ed5('0xd')]=_0x5f44a9[_0x8ed5('0xd')];this[_0x8ed5('0xe')]=_0x338f8b[_0x8ed5('0xf')];this[_0x8ed5('0x10')]=_0x338f8b['number'];this[_0x8ed5('0x11')]=_0x338f8b[_0x8ed5('0x11')];this['responsetime']=_0x338f8b[_0x8ed5('0x12')];this[_0x8ed5('0x13')]=_0x338f8b[_0x8ed5('0x13')];this['endtime']=this['droptime'];this['ringtime']=getSeconds(_0x338f8b[_0x8ed5('0x12')],_0x338f8b[_0x8ed5('0x11')]);this[_0x8ed5('0x14')]=getSeconds(this[_0x8ed5('0x13')],_0x338f8b[_0x8ed5('0x12')]);this[_0x8ed5('0x15')]=0x0;this[_0x8ed5('0x8')]=_0x5f44a9[_0x8ed5('0x8')];this['membername']=_0x5f44a9[_0x8ed5('0x16')];this['reason']=_0x5f44a9['reason'];this[_0x8ed5('0x17')]=_0x338f8b[_0x8ed5('0x17')];this[_0x8ed5('0x18')]=_0x338f8b[_0x8ed5('0x18')];this['callbackat']=_0x338f8b[_0x8ed5('0x19')];this[_0x8ed5('0x1a')]=_0x338f8b[_0x8ed5('0x1a')];this[_0x8ed5('0x1b')]=_0x338f8b[_0x8ed5('0x1b')];this[_0x8ed5('0x1c')]=_0x338f8b[_0x8ed5('0x1c')];this[_0x8ed5('0x1d')]=_0x338f8b[_0x8ed5('0x1d')];this[_0x8ed5('0x1e')]=_0x338f8b['VoiceQueueId'];this['CampaignId']=_0x338f8b[_0x8ed5('0x1f')];this['originatecalleridnum']=_0x338f8b['originatecalleridnum']||'';this[_0x8ed5('0x20')]=_0x338f8b['originatecalleridname']||'';}module[_0x8ed5('0x21')]=QueueCallerAbandon; \ No newline at end of file +var _0x7181=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','name','calleridnum','number','starttime','droptime','endtime','ringtime','responsetime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ListId'];(function(_0xaba16e,_0x1b87c9){var _0x4c819f=function(_0x557c43){while(--_0x557c43){_0xaba16e['push'](_0xaba16e['shift']());}};_0x4c819f(++_0x1b87c9);}(_0x7181,0x1d9));var _0x1718=function(_0x1f75e8,_0x7fa97f){_0x1f75e8=_0x1f75e8-0x0;var _0x120699=_0x7181[_0x1f75e8];return _0x120699;};'use strict';var util=require(_0x1718('0x0'));var _=require(_0x1718('0x1'));var moment=require(_0x1718('0x2'));function getSeconds(_0x116465,_0x5bc365){var _0x411053=moment(_0x116465)[_0x1718('0x3')](0x0);var _0xbd0d8a=moment(_0x5bc365)['milliseconds'](0x0);return _0x411053[_0x1718('0x4')](_0xbd0d8a,_0x1718('0x5'));}function QueueCallerAbandon(_0xe49dbd,_0x3cc017){this[_0x1718('0x6')]=_0xe49dbd[_0x1718('0x6')];this[_0x1718('0x7')]=_0xe49dbd[_0x1718('0x7')];this[_0x1718('0x8')]=_0xe49dbd['type']===_0x1718('0x9')?_0x1718('0xa'):_0xe49dbd[_0x1718('0x7')];this[_0x1718('0xb')]=_0xe49dbd[_0x1718('0xb')];this[_0x1718('0xc')]=_0xe49dbd[_0x1718('0xc')];this[_0x1718('0xd')]=_0xe49dbd['countnoanswerretry'];this[_0x1718('0xe')]=_0xe49dbd['countbusyretry']+_0xe49dbd['countcongestionretry']+_0xe49dbd[_0x1718('0xd')];this[_0x1718('0xf')]=_0x3cc017[_0x1718('0xf')];this['calleridname']=_0xe49dbd[_0x1718('0x10')];this[_0x1718('0x11')]=_0xe49dbd[_0x1718('0x12')];this[_0x1718('0x13')]=_0xe49dbd[_0x1718('0x13')];this['responsetime']=_0xe49dbd['responsetime'];this[_0x1718('0x14')]=_0xe49dbd['droptime'];this[_0x1718('0x15')]=this[_0x1718('0x14')];this[_0x1718('0x16')]=getSeconds(_0xe49dbd[_0x1718('0x17')],_0xe49dbd['starttime']);this[_0x1718('0x18')]=getSeconds(this['droptime'],_0xe49dbd[_0x1718('0x17')]);this[_0x1718('0x19')]=0x0;this[_0x1718('0xa')]=_0x3cc017['queue'];this[_0x1718('0x1a')]=_0x3cc017[_0x1718('0x1b')];this[_0x1718('0x1c')]=_0x3cc017[_0x1718('0x1c')];this[_0x1718('0x1d')]=_0xe49dbd[_0x1718('0x1d')];this['callbackuniqueid']=_0xe49dbd[_0x1718('0x1e')];this[_0x1718('0x1f')]=_0xe49dbd[_0x1718('0x1f')];this[_0x1718('0x20')]=_0xe49dbd[_0x1718('0x20')];this['ContactId']=_0xe49dbd['ContactId'];this[_0x1718('0x21')]=_0xe49dbd[_0x1718('0x21')];this[_0x1718('0x22')]=_0xe49dbd[_0x1718('0x22')];this[_0x1718('0x23')]=_0xe49dbd[_0x1718('0x23')];this[_0x1718('0x24')]=_0xe49dbd[_0x1718('0x24')];this[_0x1718('0x25')]=_0xe49dbd[_0x1718('0x25')]||'';this[_0x1718('0x26')]=_0xe49dbd[_0x1718('0x26')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 6a5b5ee..8f81ada 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 _0x515d=['headerinfo','path','AttachmentId','exports','util','lodash','uniqueid','format','tech','Trunk','name','fax','localstationid'];(function(_0x42b468,_0x581efb){var _0x5dde5a=function(_0x405b23){while(--_0x405b23){_0x42b468['push'](_0x42b468['shift']());}};_0x5dde5a(++_0x581efb);}(_0x515d,0x1e5));var _0xd515=function(_0x46e9eb,_0x4f16b6){_0x46e9eb=_0x46e9eb-0x0;var _0x2774a7=_0x515d[_0x46e9eb];return _0x2774a7;};'use strict';var util=require(_0xd515('0x0'));var _=require(_0xd515('0x1'));var moment=require('moment');function Action(_0x49e455,_0x4875c9,_0x3d427e){this[_0xd515('0x2')]=_0x49e455||undefined;this['channel']=util[_0xd515('0x3')]('%s/%s/%s',_0x4875c9[_0xd515('0x4')],_0x4875c9[_0xd515('0x5')][_0xd515('0x6')],_0x3d427e[_0xd515('0x7')]);this[_0xd515('0x8')]=_0x4875c9['localstationid'];this[_0xd515('0x9')]=_0x4875c9[_0xd515('0x9')];this[_0xd515('0xa')]=_0x3d427e[_0xd515('0xa')];this['AttachmentId']=_0x3d427e[_0xd515('0xb')];}module[_0xd515('0xc')]=Action; \ No newline at end of file +var _0xe345=['moment','uniqueid','channel','format','%s/%s/%s','tech','Trunk','fax','localstationid','headerinfo','path','AttachmentId','exports','util','lodash'];(function(_0x32cbcd,_0x3cfda5){var _0x376c37=function(_0x1c9ff4){while(--_0x1c9ff4){_0x32cbcd['push'](_0x32cbcd['shift']());}};_0x376c37(++_0x3cfda5);}(_0xe345,0xdf));var _0x5e34=function(_0x39b503,_0x42b6dd){_0x39b503=_0x39b503-0x0;var _0x137615=_0xe345[_0x39b503];return _0x137615;};'use strict';var util=require(_0x5e34('0x0'));var _=require(_0x5e34('0x1'));var moment=require(_0x5e34('0x2'));function Action(_0x589129,_0x460286,_0x40e538){this[_0x5e34('0x3')]=_0x589129||undefined;this[_0x5e34('0x4')]=util[_0x5e34('0x5')](_0x5e34('0x6'),_0x460286[_0x5e34('0x7')],_0x460286[_0x5e34('0x8')]['name'],_0x40e538[_0x5e34('0x9')]);this[_0x5e34('0xa')]=_0x460286[_0x5e34('0xa')];this[_0x5e34('0xb')]=_0x460286[_0x5e34('0xb')];this[_0x5e34('0xc')]=_0x40e538[_0x5e34('0xc')];this[_0x5e34('0xd')]=_0x40e538[_0x5e34('0xd')];}module[_0x5e34('0xe')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 61eb599..87b8bc2 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 _0xdfaa=['name','info','\x20syncNewchannel\x20','prototype','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','format','path','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','bluebird','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','fax','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel'];(function(_0x6386d7,_0x5efdc7){var _0xbd3b2d=function(_0x1ebc2c){while(--_0x1ebc2c){_0x6386d7['push'](_0x6386d7['shift']());}};_0xbd3b2d(++_0x5efdc7);}(_0xdfaa,0xc2));var _0xadfa=function(_0x4f4fd0,_0x3f4a64){_0x4f4fd0=_0x4f4fd0-0x0;var _0x37aa69=_0xdfaa[_0x4f4fd0];return _0x37aa69;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0xadfa('0x0'));var uuid=require(_0xadfa('0x1'));var moment=require(_0xadfa('0x2'));var path=require('path');var tiff2pdf=require(_0xadfa('0x3'));var gs=require(_0xadfa('0x4'));var logger=require(_0xadfa('0x5'))(_0xadfa('0x6'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require(_0xadfa('0x7'));var ut=require(_0xadfa('0x8'));var Action=require(_0xadfa('0x9'));var faxAccount=require(_0xadfa('0xa'));var attachment=require(_0xadfa('0xb'));var faxMessage=require(_0xadfa('0xc'));function Fax(_0x328593){this[_0xadfa('0xd')]={};this[_0xadfa('0xe')]=_0x328593[_0xadfa('0xe')];this[_0xadfa('0xf')]=_0x328593[_0xadfa('0xf')];this[_0xadfa('0x10')]={};ami['on'](_0xadfa('0x11'),this[_0xadfa('0x12')]['bind'](this));ami['on'](_0xadfa('0x13'),this[_0xadfa('0x14')][_0xadfa('0x15')](this));ami['on'](_0xadfa('0x16'),this[_0xadfa('0x17')][_0xadfa('0x15')](this));ami['on'](_0xadfa('0x18'),this[_0xadfa('0x19')]['bind'](this));ami['on'](_0xadfa('0x1a'),this[_0xadfa('0x1b')][_0xadfa('0x15')](this));ami['on'](_0xadfa('0x1c'),this[_0xadfa('0x1d')][_0xadfa('0x15')](this));ami['on'](_0xadfa('0x1e'),this[_0xadfa('0x1f')][_0xadfa('0x15')](this));ami['on'](_0xadfa('0x20'),this[_0xadfa('0x21')][_0xadfa('0x15')](this));}Fax['prototype'][_0xadfa('0x12')]=function(_0x17e340){if(_0x17e340['context']===_0xadfa('0x22')){for(var _0x529830 in this['faxAccounts']){if(this['faxAccounts'][_0xadfa('0x23')](_0x529830)){if(_0x17e340[_0xadfa('0x24')]===this[_0xadfa('0xe')][_0x529830][_0xadfa('0x25')]){this[_0xadfa('0xd')][_0x17e340[_0xadfa('0x26')]]={};this[_0xadfa('0xd')][_0x17e340[_0xadfa('0x26')]][_0xadfa('0x27')]=_0x17e340[_0xadfa('0x27')];this[_0xadfa('0xd')][_0x17e340[_0xadfa('0x26')]]['id']=this[_0xadfa('0xe')][_0x529830]['id'];this[_0xadfa('0xd')][_0x17e340[_0xadfa('0x26')]]['name']=this[_0xadfa('0xe')][_0x529830][_0xadfa('0x28')];logger[_0xadfa('0x29')](_0x17e340[_0xadfa('0x26')],_0xadfa('0x2a'));}}}}if(this[_0xadfa('0x10')][_0x17e340[_0xadfa('0x26')]]){this[_0xadfa('0xd')][_0x17e340[_0xadfa('0x26')]]={};this['channels'][_0x17e340[_0xadfa('0x26')]][_0xadfa('0x27')]=_0x17e340['channel'];logger['info'](_0x17e340['uniqueid'],_0xadfa('0x2a'));}};Fax[_0xadfa('0x2b')][_0xadfa('0x14')]=function(_0x263143){if(this[_0xadfa('0xd')][_0x263143[_0xadfa('0x26')]]){for(var _0x1382b5 in _0x263143[_0xadfa('0x2c')]){if(_0x263143[_0xadfa('0x2c')][_0xadfa('0x23')](_0x1382b5)){this['channels'][_0x263143['uniqueid']][_0x1382b5]=_0x263143[_0xadfa('0x2d')];}}}};Fax[_0xadfa('0x2b')][_0xadfa('0x17')]=function(_0x3d96eb){if(this[_0xadfa('0xd')][_0x3d96eb[_0xadfa('0x26')]]){this[_0xadfa('0xd')][_0x3d96eb[_0xadfa('0x26')]][_0xadfa('0x2e')]=_0x3d96eb[_0xadfa('0x2e')];this[_0xadfa('0xd')][_0x3d96eb['uniqueid']]['channelstatedesc']=_0x3d96eb[_0xadfa('0x2f')];}};Fax[_0xadfa('0x2b')][_0xadfa('0x19')]=function(_0x4dc99d){if(this[_0xadfa('0xd')][_0x4dc99d[_0xadfa('0x26')]]){for(var _0x10c9a9 in _0x4dc99d[_0xadfa('0x2c')]){if(_0x4dc99d[_0xadfa('0x2c')][_0xadfa('0x23')](_0x10c9a9)){this['channels'][_0x4dc99d[_0xadfa('0x26')]][_0x10c9a9]=_0x4dc99d[_0xadfa('0x2d')];}}}};Fax['prototype'][_0xadfa('0x1b')]=function(_0x5c0771){if(this[_0xadfa('0xd')][_0x5c0771['uniqueid']]){this[_0xadfa('0xd')][_0x5c0771[_0xadfa('0x26')]][_0xadfa('0x30')]=_0x5c0771[_0xadfa('0x30')];this['channels'][_0x5c0771[_0xadfa('0x26')]][_0xadfa('0x31')]=_0x5c0771[_0xadfa('0x31')];this[_0xadfa('0xd')][_0x5c0771[_0xadfa('0x26')]]['localstationid']=_0x5c0771[_0xadfa('0x25')];this[_0xadfa('0xd')][_0x5c0771[_0xadfa('0x26')]]['filename']=_0x5c0771[_0xadfa('0x32')];logger[_0xadfa('0x29')](_0x5c0771[_0xadfa('0x26')],_0xadfa('0x33'));}};Fax[_0xadfa('0x2b')][_0xadfa('0x1d')]=function(_0x1db75d){var _0x5cce5c=this;if(this[_0xadfa('0xd')][_0x1db75d[_0xadfa('0x26')]]){var _0x29fd9c=this[_0xadfa('0xd')][_0x1db75d[_0xadfa('0x26')]]['id'];this['channels'][_0x1db75d[_0xadfa('0x26')]][_0xadfa('0x34')]=_0x1db75d[_0xadfa('0x34')];this[_0xadfa('0xd')][_0x1db75d['uniqueid']][_0xadfa('0x35')]=_0x1db75d[_0xadfa('0x35')];this[_0xadfa('0xd')][_0x1db75d['uniqueid']][_0xadfa('0x25')]=_0x1db75d[_0xadfa('0x25')];this[_0xadfa('0xd')][_0x1db75d[_0xadfa('0x26')]]['resolution']=_0x1db75d[_0xadfa('0x36')];this[_0xadfa('0xd')][_0x1db75d[_0xadfa('0x26')]][_0xadfa('0x37')]=_0x1db75d[_0xadfa('0x37')];this[_0xadfa('0xd')][_0x1db75d['uniqueid']][_0xadfa('0x32')]=_0x1db75d[_0xadfa('0x32')];this[_0xadfa('0xd')][_0x1db75d[_0xadfa('0x26')]]['calleridnum']=_0x1db75d['calleridnum'];if(this[_0xadfa('0xd')][_0x1db75d[_0xadfa('0x26')]][_0xadfa('0x35')]>0x0){tiff2pdf(_0x1db75d['filename'],_0xadfa('0x38'),function(_0xdf5199){logger[_0xadfa('0x29')](_0x1db75d['uniqueid'],_0xadfa('0x39'),_0xdf5199[_0xadfa('0x3a')]);attachment['create']({'name':path[_0xadfa('0x3b')](_0x1db75d[_0xadfa('0x32')])[_0xadfa('0x28')],'basename':path[_0xadfa('0x3b')](_0x1db75d[_0xadfa('0x32')])[_0xadfa('0x28')]+_0xadfa('0x3c'),'type':_0xadfa('0x3d')})[_0xadfa('0x3e')](function(_0x56e02a){faxAccount[_0xadfa('0x3f')](_0x29fd9c,{'from':_0x1db75d['calleridnum'],'mapKey':_0xadfa('0x6'),'body':path[_0xadfa('0x3b')](_0x1db75d[_0xadfa('0x32')])['name']+_0xadfa('0x3c'),'AttachmentId':_0x56e02a['id']})[_0xadfa('0x40')](function(_0x181bd7){logger[_0xadfa('0x41')](_0x1db75d[_0xadfa('0x26')],_0xadfa('0x42'),JSON[_0xadfa('0x43')](_0x181bd7));});})['catch'](function(_0x4d721d){logger[_0xadfa('0x41')](_0x1db75d[_0xadfa('0x26')],_0xadfa('0x44'),JSON[_0xadfa('0x43')](_0x4d721d));});});}logger['info'](_0x1db75d['uniqueid'],'\x20receiveFax\x20');}};Fax['prototype'][_0xadfa('0x21')]=function(_0x60b64f){if(this[_0xadfa('0x10')][_0x60b64f[_0xadfa('0x26')]]){_[_0xadfa('0x45')](this[_0xadfa('0xd')][_0x60b64f[_0xadfa('0x26')]],_[_0xadfa('0x46')](_0x60b64f,['response',_0xadfa('0x47')]));}};function updateStatus(_0x468844){if(_0x468844[_0xadfa('0x48')]){faxMessage[_0xadfa('0x49')](_0x468844[_0xadfa('0x48')],{'failMessage':_0xadfa('0x4a')})[_0xadfa('0x3e')](function(_0x5313cd){ut[_0xadfa('0x4b')](_0xadfa('0x4c'),_0x5313cd);})['catch'](function(_0x131857){ut[_0xadfa('0x4b')](_0xadfa('0x4d'),_0x131857);});}else{ut['logger']('[Fax][Message][Error][NoUpdate2]');}}Fax[_0xadfa('0x2b')][_0xadfa('0x4e')]=function(_0x10a92e,_0x353b60,_0x51791d){var _0x1ec862=this;var _0x42027a={};if(_0x353b60){_0x42027a={'read':_0x353b60};}else{_0x42027a={'failMessage':_0x51791d};}if(this[_0xadfa('0x10')][_0x10a92e]['AttachmentId']){faxMessage['update'](this[_0xadfa('0x10')][_0x10a92e][_0xadfa('0x48')],_0x42027a)['then'](function(_0x481e8c){ut[_0xadfa('0x4b')]('[Fax][Message][Updated]',_0x481e8c);})[_0xadfa('0x40')](function(_0x4c1c73){ut[_0xadfa('0x4b')]('[Fax][Message][NoUpdate1]',_0x4c1c73);})[_0xadfa('0x4f')](function(){delete _0x1ec862[_0xadfa('0xd')][_0x10a92e];delete _0x1ec862[_0xadfa('0x10')][_0x10a92e];});}else{ut['logger'](_0xadfa('0x50'));delete this[_0xadfa('0xd')][_0x10a92e];delete this[_0xadfa('0x10')][_0x10a92e];}};Fax[_0xadfa('0x2b')][_0xadfa('0x1f')]=function(_0x5f3cad){var _0x2dfb2e=this;if(this[_0xadfa('0xd')][_0x5f3cad[_0xadfa('0x26')]]){if(this[_0xadfa('0x10')][_0x5f3cad[_0xadfa('0x26')]]){this[_0xadfa('0xd')][_0x5f3cad[_0xadfa('0x26')]]['id']=this['actions'][_0x5f3cad[_0xadfa('0x26')]]['id'];this[_0xadfa('0xd')][_0x5f3cad[_0xadfa('0x26')]][_0xadfa('0x28')]=this['actions'][_0x5f3cad[_0xadfa('0x26')]]['name'];}logger[_0xadfa('0x29')](_0x5f3cad[_0xadfa('0x26')],this[_0xadfa('0x10')][_0x5f3cad['uniqueid']]?_0xadfa('0x51'):'\x20hangup\x20faxRiceive\x20',JSON[_0xadfa('0x43')](this[_0xadfa('0xd')][_0x5f3cad[_0xadfa('0x26')]]));if(this[_0xadfa('0x10')][_0x5f3cad['uniqueid']]){if(this[_0xadfa('0xd')][_0x5f3cad[_0xadfa('0x26')]][_0xadfa('0x52')]>0x0&&this['channels'][_0x5f3cad[_0xadfa('0x26')]][_0xadfa('0x1a')]===_0xadfa('0x53')){this[_0xadfa('0x4e')](_0x5f3cad[_0xadfa('0x26')],!![]);}else{this['updateStatus'](_0x5f3cad[_0xadfa('0x26')],![],this[_0xadfa('0xd')][_0x5f3cad[_0xadfa('0x26')]][_0xadfa('0x54')]?_0xadfa('0x55')+this[_0xadfa('0xd')][_0x5f3cad[_0xadfa('0x26')]][_0xadfa('0x54')]:_0xadfa('0x56'));}}}};Fax[_0xadfa('0x2b')][_0xadfa('0x57')]=function(_0x3ff831){var _0x2c5850=this;return new BPromise(function(_0x485a4e,_0x37fba5){_0x2c5850[_0xadfa('0x58')](_0x3ff831,_0x2c5850['faxAccounts'][_0x3ff831[_0xadfa('0x59')]])['then'](function(_0x38748d){ut[_0xadfa('0x4b')](_0xadfa('0x5a'),_0x38748d);_0x485a4e(ut[_0xadfa('0x3a')]('Fax\x20received'));})[_0xadfa('0x40')](function(_0x1e3c6e){ut['logger']('[Fax][execOriginate][failure]',_0x1e3c6e);updateStatus(_0x3ff831);_0x37fba5(ut[_0xadfa('0x3a')](_0xadfa('0x5b')));});});};Fax['prototype'][_0xadfa('0x5c')]=function(_0xd8985f){var _0x1d962a=this;return new BPromise(function(_0x55707d,_0x31cfdb){var _0x1ee62f=_0x1d962a[_0xadfa('0x5d')](_0x1d962a['faxAccounts'][_0xd8985f[_0xadfa('0x59')]][_0xadfa('0x5e')],_0xd8985f);if(_0x1ee62f[_0xadfa('0x5f')]){_0x55707d(ut['message']('Trunk\x20Reachable'));}else{_0x31cfdb(ut[_0xadfa('0x3a')](_0x1ee62f['message']));}});};function originate(_0x3aa5aa,_0x372d6d,_0x304128){return new BPromise(function(_0x1d3ec6,_0x5ee91c){if(_0x304128){var _0x16aafb=util[_0xadfa('0x60')]('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[_0xadfa('0x3b')](_0x3aa5aa[_0xadfa('0x61')])[_0xadfa('0x28')],_0x3aa5aa[_0xadfa('0x61')]);gs['execute'](_0x16aafb)[_0xadfa('0x3e')](function(){_0x3aa5aa['path']=util[_0xadfa('0x60')](_0xadfa('0x62'),path[_0xadfa('0x3b')](_0x3aa5aa[_0xadfa('0x61')])[_0xadfa('0x63')],path[_0xadfa('0x3b')](_0x3aa5aa['path'])[_0xadfa('0x28')]);_0x372d6d[_0xadfa('0x64')]=_0x3aa5aa[_0xadfa('0x61')];ut[_0xadfa('0x4b')](_0xadfa('0x65'),'');ami[_0xadfa('0x66')](ut[_0xadfa('0x67')](_0x3aa5aa,_0x372d6d))['then'](function(_0x525579){_0x1d3ec6(_0x525579);})[_0xadfa('0x40')](function(_0x3b97a6){_0x5ee91c(_0x3b97a6);});})['catch'](function(_0x878855){_0x5ee91c(_0x878855);});}else{ami[_0xadfa('0x66')](ut['variablesAction'](_0x3aa5aa,_0x372d6d))[_0xadfa('0x3e')](function(_0x31f8b3){_0x1d3ec6(_0x31f8b3);})[_0xadfa('0x40')](function(_0x57a447){_0x5ee91c(_0x57a447);});}});}Fax[_0xadfa('0x2b')][_0xadfa('0x58')]=function(_0xc92a37,_0x37a8be){var _0x14504d=this;return new BPromise(function(_0xa8f17e,_0x386107){var _0x2a55bb=uuid['v4']();var _0x176552=ut[_0xadfa('0x68')](_0xc92a37,_0x37a8be);_0x14504d['actions'][_0x2a55bb]=new Action(_0x2a55bb,_0x37a8be,_0xc92a37);var _0x26d3c0=_0x14504d[_0xadfa('0x10')][_0x2a55bb];if(path[_0xadfa('0x3b')](_0xc92a37[_0xadfa('0x61')])['ext']==='.pdf'){originate(_0x26d3c0,_0x176552,!![])[_0xadfa('0x3e')](function(_0x6c330f){_0xa8f17e(_0x6c330f);})[_0xadfa('0x40')](function(_0x1f65d9){_0x386107(_0x1f65d9);});}else{originate(_0x26d3c0,_0x176552,![])[_0xadfa('0x3e')](function(_0x438562){_0xa8f17e(_0x438562);})[_0xadfa('0x40')](function(_0xe21514){_0x386107(_0xe21514);});}});};Fax[_0xadfa('0x2b')][_0xadfa('0x69')]=function(_0x5960e5){return!_[_0xadfa('0x6a')](_0x5960e5)&&!_[_0xadfa('0x6a')](_0x5960e5[_0xadfa('0x28')])&&!_[_0xadfa('0x6a')](_0x5960e5[_0xadfa('0x6b')])&&_0x5960e5[_0xadfa('0x6b')]&&!_[_0xadfa('0x6a')](this[_0xadfa('0xf')][util['format'](_0xadfa('0x6c'),_0x5960e5['name'])])&&!_[_0xadfa('0x6a')](this['trunks'][util['format'](_0xadfa('0x6c'),_0x5960e5[_0xadfa('0x28')])]['status'])&&(this[_0xadfa('0xf')][util[_0xadfa('0x60')]('SIP/%s',_0x5960e5[_0xadfa('0x28')])][_0xadfa('0x31')]==='reachable'||this[_0xadfa('0xf')][util[_0xadfa('0x60')](_0xadfa('0x6c'),_0x5960e5[_0xadfa('0x28')])][_0xadfa('0x31')]==='unmonitored');};Fax[_0xadfa('0x2b')][_0xadfa('0x5d')]=function(_0x16a641,_0x2dc778){if(!this['isTrunkReachable'](_0x16a641)){ut[_0xadfa('0x4b')](_0xadfa('0x6d'),_[_0xadfa('0x6a')](_0x16a641)?'':_0x16a641[_0xadfa('0x28')]+_0xadfa('0x6e'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_['isNil'](_0x2dc778['fax'])){ut[_0xadfa('0x4b')](_0xadfa('0x6f'),JSON[_0xadfa('0x43')](_0x2dc778));return{'isValid':![],'message':_0xadfa('0x70')};}if(_['isNil'](_0x2dc778[_0xadfa('0x61')])){ut['logger'](_0xadfa('0x71'),JSON[_0xadfa('0x43')](_0x2dc778));return{'isValid':![],'message':_0xadfa('0x72')};}return{'isValid':!![],'message':_0xadfa('0x73')};};module[_0xadfa('0x74')]=Fax; \ No newline at end of file +var _0x86d2=['filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','catch','error','\x20notify\x20','merge','pick','response','reason','AttachmentId','update','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','format','dir','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','stringify','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','moment','path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','from-voip-provider','exten','localstationid','uniqueid','name','info','\x20syncNewchannel\x20','actions','channel','variable','hasOwnProperty','value','prototype','channelstate','channelstatedesc','operation','status'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x86d2,0xbf));var _0x286d=function(_0x585831,_0x4ede99){_0x585831=_0x585831-0x0;var _0x4deba8=_0x86d2[_0x585831];return _0x4deba8;};'use strict';var util=require(_0x286d('0x0'));var _=require(_0x286d('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x286d('0x2'));var path=require(_0x286d('0x3'));var tiff2pdf=require(_0x286d('0x4'));var gs=require('./util/gs');var logger=require(_0x286d('0x5'))(_0x286d('0x6'));var ami=require(_0x286d('0x7'));var rpcDb=require(_0x286d('0x8'));var Channel=require(_0x286d('0x9'));var ut=require(_0x286d('0xa'));var Action=require(_0x286d('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0x418a05){this[_0x286d('0xc')]={};this['faxAccounts']=_0x418a05[_0x286d('0xd')];this['trunks']=_0x418a05[_0x286d('0xe')];this['actions']={};ami['on'](_0x286d('0xf'),this[_0x286d('0x10')][_0x286d('0x11')](this));ami['on'](_0x286d('0x12'),this[_0x286d('0x13')]['bind'](this));ami['on'](_0x286d('0x14'),this[_0x286d('0x15')][_0x286d('0x11')](this));ami['on']('newexten',this[_0x286d('0x16')][_0x286d('0x11')](this));ami['on'](_0x286d('0x17'),this[_0x286d('0x18')]['bind'](this));ami['on']('receivefax',this[_0x286d('0x19')][_0x286d('0x11')](this));ami['on'](_0x286d('0x1a'),this[_0x286d('0x1b')][_0x286d('0x11')](this));ami['on'](_0x286d('0x1c'),this[_0x286d('0x1d')]['bind'](this));}Fax['prototype'][_0x286d('0x10')]=function(_0x436e36){if(_0x436e36['context']===_0x286d('0x1e')){for(var _0x15d951 in this[_0x286d('0xd')]){if(this[_0x286d('0xd')]['hasOwnProperty'](_0x15d951)){if(_0x436e36[_0x286d('0x1f')]===this['faxAccounts'][_0x15d951][_0x286d('0x20')]){this[_0x286d('0xc')][_0x436e36[_0x286d('0x21')]]={};this['channels'][_0x436e36[_0x286d('0x21')]]['channel']=_0x436e36['channel'];this['channels'][_0x436e36['uniqueid']]['id']=this[_0x286d('0xd')][_0x15d951]['id'];this[_0x286d('0xc')][_0x436e36[_0x286d('0x21')]][_0x286d('0x22')]=this[_0x286d('0xd')][_0x15d951][_0x286d('0x22')];logger[_0x286d('0x23')](_0x436e36['uniqueid'],_0x286d('0x24'));}}}}if(this[_0x286d('0x25')][_0x436e36['uniqueid']]){this[_0x286d('0xc')][_0x436e36[_0x286d('0x21')]]={};this[_0x286d('0xc')][_0x436e36[_0x286d('0x21')]][_0x286d('0x26')]=_0x436e36['channel'];logger[_0x286d('0x23')](_0x436e36['uniqueid'],_0x286d('0x24'));}};Fax['prototype'][_0x286d('0x13')]=function(_0x125592){if(this[_0x286d('0xc')][_0x125592[_0x286d('0x21')]]){for(var _0xce03aa in _0x125592['variable']){if(_0x125592[_0x286d('0x27')][_0x286d('0x28')](_0xce03aa)){this[_0x286d('0xc')][_0x125592[_0x286d('0x21')]][_0xce03aa]=_0x125592[_0x286d('0x29')];}}}};Fax[_0x286d('0x2a')]['syncNewState']=function(_0x54496d){if(this[_0x286d('0xc')][_0x54496d['uniqueid']]){this[_0x286d('0xc')][_0x54496d['uniqueid']][_0x286d('0x2b')]=_0x54496d[_0x286d('0x2b')];this['channels'][_0x54496d[_0x286d('0x21')]][_0x286d('0x2c')]=_0x54496d[_0x286d('0x2c')];}};Fax[_0x286d('0x2a')][_0x286d('0x16')]=function(_0x2dfd22){if(this[_0x286d('0xc')][_0x2dfd22['uniqueid']]){for(var _0x6490a2 in _0x2dfd22[_0x286d('0x27')]){if(_0x2dfd22[_0x286d('0x27')][_0x286d('0x28')](_0x6490a2)){this[_0x286d('0xc')][_0x2dfd22['uniqueid']][_0x6490a2]=_0x2dfd22[_0x286d('0x29')];}}}};Fax[_0x286d('0x2a')][_0x286d('0x18')]=function(_0x4525b3){if(this[_0x286d('0xc')][_0x4525b3[_0x286d('0x21')]]){this[_0x286d('0xc')][_0x4525b3[_0x286d('0x21')]][_0x286d('0x2d')]=_0x4525b3[_0x286d('0x2d')];this[_0x286d('0xc')][_0x4525b3['uniqueid']][_0x286d('0x2e')]=_0x4525b3['status'];this[_0x286d('0xc')][_0x4525b3[_0x286d('0x21')]][_0x286d('0x20')]=_0x4525b3[_0x286d('0x20')];this[_0x286d('0xc')][_0x4525b3['uniqueid']][_0x286d('0x2f')]=_0x4525b3[_0x286d('0x2f')];logger[_0x286d('0x23')](_0x4525b3['uniqueid'],_0x286d('0x30'));}};Fax[_0x286d('0x2a')][_0x286d('0x19')]=function(_0x3dd6b5){var _0x3bde7c=this;if(this['channels'][_0x3dd6b5['uniqueid']]){var _0x13450c=this[_0x286d('0xc')][_0x3dd6b5[_0x286d('0x21')]]['id'];this[_0x286d('0xc')][_0x3dd6b5[_0x286d('0x21')]]['remotestationid']=_0x3dd6b5[_0x286d('0x31')];this[_0x286d('0xc')][_0x3dd6b5['uniqueid']][_0x286d('0x32')]=_0x3dd6b5[_0x286d('0x32')];this[_0x286d('0xc')][_0x3dd6b5[_0x286d('0x21')]][_0x286d('0x20')]=_0x3dd6b5['localstationid'];this['channels'][_0x3dd6b5[_0x286d('0x21')]][_0x286d('0x33')]=_0x3dd6b5[_0x286d('0x33')];this['channels'][_0x3dd6b5[_0x286d('0x21')]]['transferrate']=_0x3dd6b5['transferrate'];this[_0x286d('0xc')][_0x3dd6b5[_0x286d('0x21')]]['filename']=_0x3dd6b5[_0x286d('0x2f')];this[_0x286d('0xc')][_0x3dd6b5[_0x286d('0x21')]][_0x286d('0x34')]=_0x3dd6b5['calleridnum'];if(this[_0x286d('0xc')][_0x3dd6b5[_0x286d('0x21')]][_0x286d('0x32')]>0x0){tiff2pdf(_0x3dd6b5[_0x286d('0x2f')],_0x286d('0x35'),function(_0x47c3a3){logger['info'](_0x3dd6b5[_0x286d('0x21')],_0x286d('0x36'),_0x47c3a3[_0x286d('0x37')]);attachment[_0x286d('0x38')]({'name':path['parse'](_0x3dd6b5[_0x286d('0x2f')])['name'],'basename':path[_0x286d('0x39')](_0x3dd6b5[_0x286d('0x2f')])['name']+_0x286d('0x3a'),'type':_0x286d('0x3b')})['then'](function(_0xd846b1){faxAccount[_0x286d('0x3c')](_0x13450c,{'from':_0x3dd6b5['calleridnum'],'mapKey':_0x286d('0x6'),'body':path[_0x286d('0x39')](_0x3dd6b5[_0x286d('0x2f')])[_0x286d('0x22')]+_0x286d('0x3a'),'AttachmentId':_0xd846b1['id']})[_0x286d('0x3d')](function(_0x27495c){logger[_0x286d('0x3e')](_0x3dd6b5['uniqueid'],_0x286d('0x3f'),JSON['stringify'](_0x27495c));});})[_0x286d('0x3d')](function(_0x1ef664){logger['error'](_0x3dd6b5[_0x286d('0x21')],'\x20receiveFax\x20',JSON['stringify'](_0x1ef664));});});}logger[_0x286d('0x23')](_0x3dd6b5[_0x286d('0x21')],'\x20receiveFax\x20');}};Fax['prototype']['syncOriginateResponse']=function(_0x35b83c){if(this['actions'][_0x35b83c[_0x286d('0x21')]]){_[_0x286d('0x40')](this['channels'][_0x35b83c[_0x286d('0x21')]],_[_0x286d('0x41')](_0x35b83c,[_0x286d('0x42'),_0x286d('0x43')]));}};function updateStatus(_0x58e464){if(_0x58e464[_0x286d('0x44')]){faxMessage[_0x286d('0x45')](_0x58e464['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0x286d('0x46')](function(_0x33b782){ut[_0x286d('0x47')](_0x286d('0x48'),_0x33b782);})[_0x286d('0x3d')](function(_0x295954){ut[_0x286d('0x47')](_0x286d('0x49'),_0x295954);});}else{ut[_0x286d('0x47')](_0x286d('0x4a'));}}Fax[_0x286d('0x2a')][_0x286d('0x4b')]=function(_0x2af7f4,_0xfa1bd6,_0x5c8c9e){var _0x2c52d3=this;var _0x172afa={};if(_0xfa1bd6){_0x172afa={'read':_0xfa1bd6};}else{_0x172afa={'failMessage':_0x5c8c9e};}if(this[_0x286d('0x25')][_0x2af7f4][_0x286d('0x44')]){faxMessage[_0x286d('0x45')](this['actions'][_0x2af7f4]['AttachmentId'],_0x172afa)[_0x286d('0x46')](function(_0x4d443b){ut[_0x286d('0x47')](_0x286d('0x4c'),_0x4d443b);})[_0x286d('0x3d')](function(_0x29ea69){ut['logger'](_0x286d('0x4d'),_0x29ea69);})[_0x286d('0x4e')](function(){delete _0x2c52d3[_0x286d('0xc')][_0x2af7f4];delete _0x2c52d3[_0x286d('0x25')][_0x2af7f4];});}else{ut[_0x286d('0x47')](_0x286d('0x4f'));delete this[_0x286d('0xc')][_0x2af7f4];delete this[_0x286d('0x25')][_0x2af7f4];}};Fax[_0x286d('0x2a')][_0x286d('0x1b')]=function(_0x521abb){var _0x422ad5=this;if(this[_0x286d('0xc')][_0x521abb[_0x286d('0x21')]]){if(this[_0x286d('0x25')][_0x521abb[_0x286d('0x21')]]){this['channels'][_0x521abb['uniqueid']]['id']=this[_0x286d('0x25')][_0x521abb[_0x286d('0x21')]]['id'];this[_0x286d('0xc')][_0x521abb[_0x286d('0x21')]][_0x286d('0x22')]=this[_0x286d('0x25')][_0x521abb['uniqueid']][_0x286d('0x22')];}logger['info'](_0x521abb['uniqueid'],this[_0x286d('0x25')][_0x521abb[_0x286d('0x21')]]?_0x286d('0x50'):'\x20hangup\x20faxRiceive\x20',JSON['stringify'](this[_0x286d('0xc')][_0x521abb['uniqueid']]));if(this['actions'][_0x521abb[_0x286d('0x21')]]){if(this[_0x286d('0xc')][_0x521abb[_0x286d('0x21')]][_0x286d('0x51')]>0x0&&this['channels'][_0x521abb['uniqueid']][_0x286d('0x17')]===_0x286d('0x52')){this[_0x286d('0x4b')](_0x521abb['uniqueid'],!![]);}else{this[_0x286d('0x4b')](_0x521abb[_0x286d('0x21')],![],this[_0x286d('0xc')][_0x521abb[_0x286d('0x21')]][_0x286d('0x53')]?'SENDING\x20FAILED:\x20'+this[_0x286d('0xc')][_0x521abb['uniqueid']][_0x286d('0x53')]:_0x286d('0x54'));}}}};Fax[_0x286d('0x2a')][_0x286d('0x55')]=function(_0xa93bc5){var _0x29fa2a=this;return new BPromise(function(_0x1669a8,_0x9b4e6d){_0x29fa2a[_0x286d('0x56')](_0xa93bc5,_0x29fa2a['faxAccounts'][_0xa93bc5['FaxAccountId']])[_0x286d('0x46')](function(_0x4dc544){ut[_0x286d('0x47')](_0x286d('0x57'),_0x4dc544);_0x1669a8(ut[_0x286d('0x37')](_0x286d('0x58')));})['catch'](function(_0x1600e2){ut[_0x286d('0x47')](_0x286d('0x59'),_0x1600e2);updateStatus(_0xa93bc5);_0x9b4e6d(ut[_0x286d('0x37')]('Fax\x20failed'));});});};Fax['prototype'][_0x286d('0x5a')]=function(_0x370f41){var _0x30e20f=this;return new BPromise(function(_0xcd8a95,_0x5d1ceb){var _0x5ab09c=_0x30e20f[_0x286d('0x5b')](_0x30e20f[_0x286d('0xd')][_0x370f41[_0x286d('0x5c')]][_0x286d('0x5d')],_0x370f41);if(_0x5ab09c[_0x286d('0x5e')]){_0xcd8a95(ut[_0x286d('0x37')](_0x286d('0x5f')));}else{_0x5d1ceb(ut[_0x286d('0x37')](_0x5ab09c['message']));}});};function originate(_0x556b9c,_0x367578,_0x53c216){return new BPromise(function(_0x446d8e,_0x50be18){if(_0x53c216){var _0xde1b75=util['format'](_0x286d('0x60'),path[_0x286d('0x39')](_0x556b9c[_0x286d('0x3')])[_0x286d('0x22')],_0x556b9c[_0x286d('0x3')]);gs[_0x286d('0x61')](_0xde1b75)['then'](function(){_0x556b9c[_0x286d('0x3')]=util[_0x286d('0x62')]('%s/%s.tif',path['parse'](_0x556b9c[_0x286d('0x3')])[_0x286d('0x63')],path[_0x286d('0x39')](_0x556b9c['path'])['name']);_0x367578['XMF-PATH']=_0x556b9c['path'];ut['logger'](_0x286d('0x64'),'');ami[_0x286d('0x65')](ut[_0x286d('0x66')](_0x556b9c,_0x367578))[_0x286d('0x46')](function(_0xfafe42){_0x446d8e(_0xfafe42);})['catch'](function(_0x2b7723){_0x50be18(_0x2b7723);});})[_0x286d('0x3d')](function(_0x15a24f){_0x50be18(_0x15a24f);});}else{ami['Action'](ut[_0x286d('0x66')](_0x556b9c,_0x367578))[_0x286d('0x46')](function(_0x5a48ab){_0x446d8e(_0x5a48ab);})['catch'](function(_0x14ba8c){_0x50be18(_0x14ba8c);});}});}Fax['prototype'][_0x286d('0x56')]=function(_0x45aa26,_0xe99c02){var _0x3f98d5=this;return new BPromise(function(_0x13b077,_0x4cdb31){var _0x5e2a71=uuid['v4']();var _0x5ec1ad=ut[_0x286d('0x67')](_0x45aa26,_0xe99c02);_0x3f98d5[_0x286d('0x25')][_0x5e2a71]=new Action(_0x5e2a71,_0xe99c02,_0x45aa26);var _0x5abf76=_0x3f98d5['actions'][_0x5e2a71];if(path[_0x286d('0x39')](_0x45aa26[_0x286d('0x3')])[_0x286d('0x68')]===_0x286d('0x3a')){originate(_0x5abf76,_0x5ec1ad,!![])[_0x286d('0x46')](function(_0x11c934){_0x13b077(_0x11c934);})['catch'](function(_0x23ebbd){_0x4cdb31(_0x23ebbd);});}else{originate(_0x5abf76,_0x5ec1ad,![])[_0x286d('0x46')](function(_0xf80bd2){_0x13b077(_0xf80bd2);})[_0x286d('0x3d')](function(_0x47044f){_0x4cdb31(_0x47044f);});}});};Fax['prototype']['isTrunkReachable']=function(_0x46872c){return!_[_0x286d('0x69')](_0x46872c)&&!_[_0x286d('0x69')](_0x46872c['name'])&&!_[_0x286d('0x69')](_0x46872c[_0x286d('0x6a')])&&_0x46872c[_0x286d('0x6a')]&&!_[_0x286d('0x69')](this[_0x286d('0xe')][util['format'](_0x286d('0x6b'),_0x46872c[_0x286d('0x22')])])&&!_[_0x286d('0x69')](this[_0x286d('0xe')][util[_0x286d('0x62')](_0x286d('0x6b'),_0x46872c[_0x286d('0x22')])][_0x286d('0x2e')])&&(this[_0x286d('0xe')][util['format'](_0x286d('0x6b'),_0x46872c[_0x286d('0x22')])][_0x286d('0x2e')]===_0x286d('0x6c')||this['trunks'][util[_0x286d('0x62')](_0x286d('0x6b'),_0x46872c['name'])][_0x286d('0x2e')]===_0x286d('0x6d'));};Fax['prototype']['checkTrunk']=function(_0x43b629,_0x8c66c){if(!this['isTrunkReachable'](_0x43b629)){ut['logger'](_0x286d('0x6e'),_[_0x286d('0x69')](_0x43b629)?'':_0x43b629[_0x286d('0x22')]+_0x286d('0x6f'));return{'isValid':![],'message':_0x286d('0x70')};}if(_[_0x286d('0x69')](_0x8c66c[_0x286d('0x6')])){ut['logger'](_0x286d('0x71'),JSON[_0x286d('0x72')](_0x8c66c));return{'isValid':![],'message':_0x286d('0x73')};}if(_[_0x286d('0x69')](_0x8c66c[_0x286d('0x3')])){ut[_0x286d('0x47')](_0x286d('0x74'),JSON[_0x286d('0x72')](_0x8c66c));return{'isValid':![],'message':_0x286d('0x75')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x286d('0x76')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index c75dde7..ba74053 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 _0x6697=['preview','lodash','../rpc/faxAccount','error','notify','resolve','catch','bluebird','../../../config/logger'];(function(_0x33314d,_0x499628){var _0x4ffe8e=function(_0xb1ec35){while(--_0xb1ec35){_0x33314d['push'](_0x33314d['shift']());}};_0x4ffe8e(++_0x499628);}(_0x6697,0x10c));var _0x7669=function(_0x568ec8,_0x1e0f23){_0x568ec8=_0x568ec8-0x0;var _0x52b2be=_0x6697[_0x568ec8];return _0x52b2be;};'use strict';var util=require('util');var BPromise=require(_0x7669('0x0'));var logger=require(_0x7669('0x1'))(_0x7669('0x2'));var _=require(_0x7669('0x3'));var faxAccount=require(_0x7669('0x4'));function loggerCatch(_0x583882){return function(_0x9b643e){logger[_0x7669('0x5')](_0x583882,util['inspect'](_0x9b643e,{'showHidden':![],'depth':null}));};}exports[_0x7669('0x6')]=function(_0x79a5d9,_0x30eb2c){return BPromise[_0x7669('0x7')]()['then'](faxAccount[_0x7669('0x6')](_0x79a5d9,_0x30eb2c))[_0x7669('0x8')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0x5e6a=['[Notify]\x20','util','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','then','catch'];(function(_0x5ee6f3,_0x4cf046){var _0xa0a711=function(_0x52553f){while(--_0x52553f){_0x5ee6f3['push'](_0x5ee6f3['shift']());}};_0xa0a711(++_0x4cf046);}(_0x5e6a,0x1e5));var _0xa5e6=function(_0x1bd224,_0x4ff3cd){_0x1bd224=_0x1bd224-0x0;var _0x12f4e6=_0x5e6a[_0x1bd224];return _0x12f4e6;};'use strict';var util=require(_0xa5e6('0x0'));var BPromise=require('bluebird');var logger=require(_0xa5e6('0x1'))(_0xa5e6('0x2'));var _=require(_0xa5e6('0x3'));var faxAccount=require(_0xa5e6('0x4'));function loggerCatch(_0x743dc){return function(_0x220de0){logger[_0xa5e6('0x5')](_0x743dc,util[_0xa5e6('0x6')](_0x220de0,{'showHidden':![],'depth':null}));};}exports[_0xa5e6('0x7')]=function(_0x2b1688,_0xeb3dd9){return BPromise['resolve']()[_0xa5e6('0x8')](faxAccount['notify'](_0x2b1688,_0xeb3dd9))[_0xa5e6('0x9')](loggerCatch(_0xa5e6('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 6647ac8..d61cd72 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 _0x1d9d=['execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','bluebird','child_process','exec'];(function(_0x3c42ca,_0x1acc6d){var _0x3d5a1e=function(_0x49ec3e){while(--_0x49ec3e){_0x3c42ca['push'](_0x3c42ca['shift']());}};_0x3d5a1e(++_0x1acc6d);}(_0x1d9d,0x176));var _0xd1d9=function(_0x1b1f26,_0x1dd448){_0x1b1f26=_0x1b1f26-0x0;var _0x16049a=_0x1d9d[_0x1b1f26];return _0x16049a;};'use strict';var util=require(_0xd1d9('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require(_0xd1d9('0x1'));var exec=require(_0xd1d9('0x2'))[_0xd1d9('0x3')];exports[_0xd1d9('0x4')]=function(_0x5dc50c){return new BPromise(function(_0xf49de8,_0x4cf78c){exec(_0x5dc50c,function(_0x4be77a,_0x2518db,_0x14483c){logger[_0xd1d9('0x5')](_0xd1d9('0x6'),_0x2518db);if(_0x4be77a){logger['info']('Exec\x20gs',_0xd1d9('0x7'),util[_0xd1d9('0x8')](_0x4be77a,{'showHidden':![],'depth':null}),_0x2518db,_0x14483c);_0x4cf78c(_0x4be77a);}_0xf49de8(_0x2518db);});});}; \ No newline at end of file +var _0x4c9f=['../../../../config/logger','bluebird','child_process','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util'];(function(_0x37144e,_0x526bd2){var _0x5d902c=function(_0x3c28ed){while(--_0x3c28ed){_0x37144e['push'](_0x37144e['shift']());}};_0x5d902c(++_0x526bd2);}(_0x4c9f,0x6b));var _0xf4c9=function(_0x4f09ac,_0x4593e2){_0x4f09ac=_0x4f09ac-0x0;var _0x5129f9=_0x4c9f[_0x4f09ac];return _0x5129f9;};'use strict';var util=require(_0xf4c9('0x0'));var logger=require(_0xf4c9('0x1'))('fax');var BPromise=require(_0xf4c9('0x2'));var exec=require(_0xf4c9('0x3'))['exec'];exports[_0xf4c9('0x4')]=function(_0x576ede){return new BPromise(function(_0x5d3409,_0xdae25){exec(_0x576ede,function(_0x19bbb8,_0x484002,_0x5f401d){logger[_0xf4c9('0x5')]('Exec\x20gs',_0x484002);if(_0x19bbb8){logger[_0xf4c9('0x5')](_0xf4c9('0x6'),_0xf4c9('0x7'),util[_0xf4c9('0x8')](_0x19bbb8,{'showHidden':![],'depth':null}),_0x484002,_0x5f401d);_0xdae25(_0x19bbb8);}_0x5d3409(_0x484002);});});}; \ 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 615deac..17a1041 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 _0x2073=['originate','channel','xcally-motion-fax','format','headerinfo','util','lodash','moment','fax','message','info','addVariables','ecm','minrate','maxrate','\x22%s\x22','t38timeout','localstationid','variablesAction','uniqueid'];(function(_0x162fd8,_0xe66d3a){var _0xf2182=function(_0x53c650){while(--_0x53c650){_0x162fd8['push'](_0x162fd8['shift']());}};_0xf2182(++_0xe66d3a);}(_0x2073,0x1e5));var _0x3207=function(_0x2a40b3,_0xe1c253){_0x2a40b3=_0x2a40b3-0x0;var _0x4ac6cb=_0x2073[_0x2a40b3];return _0x4ac6cb;};'use strict';var util=require(_0x3207('0x0'));var _=require(_0x3207('0x1'));var moment=require(_0x3207('0x2'));var logger=require('../../../../config/logger')(_0x3207('0x3'));exports[_0x3207('0x4')]=function(_0x509bc9){return{'message':_0x509bc9};};exports['logger']=function(_0x3525a7,_0x93d552){logger[_0x3207('0x5')](_0x3525a7,util['inspect'](_0x93d552,{'showHidden':![],'depth':null}));};exports[_0x3207('0x6')]=function(_0x29a4a0,_0x4cb198){var _0x414888={'XMF-ECM':_0x4cb198[_0x3207('0x7')],'XMF-HEADERINFO':_0x4cb198['headerinfo'],'XMF-MINRATE':_0x4cb198[_0x3207('0x8')],'XMF-MAXRATE':_0x4cb198[_0x3207('0x9')],'XMF-MODEM':util['format'](_0x3207('0xa'),_0x4cb198['modem']),'XMF-GATEWAY':_0x4cb198['gateway'],'XMF-FAXDETECT':_0x4cb198['faxdetect'],'XMF-T38TIMEOUT':_0x4cb198[_0x3207('0xb')],'XMF-LOCALSTATIONID':_0x4cb198[_0x3207('0xc')],'XMF-PATH':_0x29a4a0['path']};return _0x414888;};exports[_0x3207('0xd')]=function(_0x23ac28,_0x1cb9de){return{'actionid':_0x23ac28[_0x3207('0xe')],'action':_0x3207('0xf'),'channel':_0x23ac28[_0x3207('0x10')],'Exten':_0x3207('0x11'),'Context':'from-sip','Priority':'1','callerid':util[_0x3207('0x12')]('\x22%s\x22\x20<%s>',_0x23ac28[_0x3207('0x13')]?_0x23ac28['headerinfo']:'',_0x23ac28[_0x3207('0xc')]),'variable':_0x1cb9de,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x23ac28['uniqueid']};}; \ No newline at end of file +var _0x8eea=['inspect','ecm','minrate','\x22%s\x22','modem','gateway','t38timeout','localstationid','path','variablesAction','originate','xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','headerinfo','uniqueid','util','lodash','moment','../../../../config/logger','fax','message'];(function(_0x1c019b,_0x5f048d){var _0x4031fe=function(_0x188bbd){while(--_0x188bbd){_0x1c019b['push'](_0x1c019b['shift']());}};_0x4031fe(++_0x5f048d);}(_0x8eea,0xc9));var _0xa8ee=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x8eea[_0x3ff085];return _0x2b68c3;};'use strict';var util=require(_0xa8ee('0x0'));var _=require(_0xa8ee('0x1'));var moment=require(_0xa8ee('0x2'));var logger=require(_0xa8ee('0x3'))(_0xa8ee('0x4'));exports[_0xa8ee('0x5')]=function(_0x15133e){return{'message':_0x15133e};};exports['logger']=function(_0x51b371,_0x4c93e8){logger['info'](_0x51b371,util[_0xa8ee('0x6')](_0x4c93e8,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0xdddb1,_0x5dba72){var _0x431cbc={'XMF-ECM':_0x5dba72[_0xa8ee('0x7')],'XMF-HEADERINFO':_0x5dba72['headerinfo'],'XMF-MINRATE':_0x5dba72[_0xa8ee('0x8')],'XMF-MAXRATE':_0x5dba72['maxrate'],'XMF-MODEM':util['format'](_0xa8ee('0x9'),_0x5dba72[_0xa8ee('0xa')]),'XMF-GATEWAY':_0x5dba72[_0xa8ee('0xb')],'XMF-FAXDETECT':_0x5dba72['faxdetect'],'XMF-T38TIMEOUT':_0x5dba72[_0xa8ee('0xc')],'XMF-LOCALSTATIONID':_0x5dba72[_0xa8ee('0xd')],'XMF-PATH':_0xdddb1[_0xa8ee('0xe')]};return _0x431cbc;};exports[_0xa8ee('0xf')]=function(_0x7227b9,_0x38fd07){return{'actionid':_0x7227b9['uniqueid'],'action':_0xa8ee('0x10'),'channel':_0x7227b9['channel'],'Exten':_0xa8ee('0x11'),'Context':_0xa8ee('0x12'),'Priority':'1','callerid':util[_0xa8ee('0x13')](_0xa8ee('0x14'),_0x7227b9['headerinfo']?_0x7227b9[_0xa8ee('0x15')]:'',_0x7227b9[_0xa8ee('0xd')]),'variable':_0x38fd07,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x7227b9[_0xa8ee('0x16')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 1979f60..ea519f0 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 _0xa0f0=['./acw','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initVoiceQueues','getTriggers','initTriggers','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','log','listen','bluebird','util','moment','./server','./report'];(function(_0x5f2bd9,_0x39ca0d){var _0x18aed5=function(_0x2af9ab){while(--_0x2af9ab){_0x5f2bd9['push'](_0x5f2bd9['shift']());}};_0x18aed5(++_0x39ca0d);}(_0xa0f0,0xb8));var _0x0a0f=function(_0x3b0db0,_0x95d38c){_0x3b0db0=_0x3b0db0-0x0;var _0x3e6eeb=_0xa0f0[_0x3b0db0];return _0x3e6eeb;};'use strict';var BPromise=require(_0x0a0f('0x0'));var util=require(_0x0a0f('0x1'));var moment=require(_0x0a0f('0x2'));var server=require(_0x0a0f('0x3'));var Realtime=require('./realtime');var Report=require(_0x0a0f('0x4'));var Acw=require(_0x0a0f('0x5'));var Trigger=require('./trigger');var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require(_0x0a0f('0x6'));var user=require(_0x0a0f('0x7'));var voiceQueue=require(_0x0a0f('0x8'));var voiceQueueReport=require(_0x0a0f('0x9'));var voiceCallReport=require(_0x0a0f('0xa'));var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require(_0x0a0f('0xb'));var cmHopperHistory=require(_0x0a0f('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x0a0f('0xd'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x0a0f('0xe'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x0a0f('0xf'));var freshdesk=require(_0x0a0f('0x10'));var desk=require(_0x0a0f('0x11'));var zoho=require(_0x0a0f('0x12'));var vtiger=require(_0x0a0f('0x13'));var servicenow=require(_0x0a0f('0x14'));var dynamics365=require(_0x0a0f('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x0a0f('0x16')](_0x0a0f('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x0a0f('0x16')](_0x0a0f('0x17'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x0a0f('0x18')]()[_0x0a0f('0x19')](user[_0x0a0f('0x1a')]())[_0x0a0f('0x19')](realtime[_0x0a0f('0x1b')]())[_0x0a0f('0x19')](user[_0x0a0f('0x1c')]())[_0x0a0f('0x19')](realtime[_0x0a0f('0x1d')]())['then'](trunk[_0x0a0f('0x1e')]())[_0x0a0f('0x19')](realtime['initTrunks']())[_0x0a0f('0x19')](voiceQueue['getVoiceQueues']())[_0x0a0f('0x19')](realtime[_0x0a0f('0x1f')]())[_0x0a0f('0x19')](trigger[_0x0a0f('0x20')]())[_0x0a0f('0x19')](realtime[_0x0a0f('0x21')]())[_0x0a0f('0x19')](template['getTemplates']())[_0x0a0f('0x19')](realtime['initTemplates']())[_0x0a0f('0x19')](zendesk[_0x0a0f('0x22')]())[_0x0a0f('0x19')](realtime[_0x0a0f('0x23')]())[_0x0a0f('0x19')](salesforce['getSalesforceAccounts']())['then'](realtime[_0x0a0f('0x24')]())[_0x0a0f('0x19')](sugarcrm[_0x0a0f('0x25')]())[_0x0a0f('0x19')](realtime[_0x0a0f('0x26')]())[_0x0a0f('0x19')](freshdesk[_0x0a0f('0x27')]())[_0x0a0f('0x19')](realtime[_0x0a0f('0x28')]())[_0x0a0f('0x19')](desk[_0x0a0f('0x29')]())[_0x0a0f('0x19')](realtime['initDeskAccounts']())[_0x0a0f('0x19')](zoho[_0x0a0f('0x2a')]())[_0x0a0f('0x19')](realtime[_0x0a0f('0x2b')]())[_0x0a0f('0x19')](vtiger[_0x0a0f('0x2c')]())[_0x0a0f('0x19')](realtime[_0x0a0f('0x2d')]())[_0x0a0f('0x19')](servicenow['getServicenowAccounts']())[_0x0a0f('0x19')](realtime[_0x0a0f('0x2e')]())[_0x0a0f('0x19')](dynamics365[_0x0a0f('0x2f')]())[_0x0a0f('0x19')](realtime[_0x0a0f('0x30')]())[_0x0a0f('0x19')](campaign[_0x0a0f('0x31')]())[_0x0a0f('0x19')](realtime[_0x0a0f('0x32')]())[_0x0a0f('0x19')](voiceExtension[_0x0a0f('0x33')]())['then'](realtime['initVoiceExtensions']())['then'](faxAccount[_0x0a0f('0x34')]())[_0x0a0f('0x19')](realtime[_0x0a0f('0x35')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x0a0f('0x18')]()[_0x0a0f('0x19')](voiceQueueReport['getVoiceQueueReports']())[_0x0a0f('0x19')](realtime[_0x0a0f('0x36')]())[_0x0a0f('0x19')](cmHopperHistory[_0x0a0f('0x37')]())[_0x0a0f('0x19')](realtime[_0x0a0f('0x38')]())[_0x0a0f('0x19')](cmHopperHistory[_0x0a0f('0x39')]())[_0x0a0f('0x19')](realtime[_0x0a0f('0x3a')]())[_0x0a0f('0x19')](voiceCallReport['getVoiceCallReports']())[_0x0a0f('0x19')](realtime[_0x0a0f('0x3b')]())[_0x0a0f('0x19')](function(_0x321a6d){})[_0x0a0f('0x3c')](function(_0x1eb4ea){console[_0x0a0f('0x3d')](_0x1eb4ea);});}function main(){return server[_0x0a0f('0x3e')](realtime,preview,fax)[_0x0a0f('0x19')](function(_0x441d94){return initRealtime();})[_0x0a0f('0x19')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x1f2119){console[_0x0a0f('0x3d')](_0x1f2119);});}main(); \ No newline at end of file +var _0x881b=['initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','sync','log','bluebird','util','moment','./server','./realtime','./report','./acw','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts'];(function(_0x2dcec5,_0x49d748){var _0x588aec=function(_0x463e93){while(--_0x463e93){_0x2dcec5['push'](_0x2dcec5['shift']());}};_0x588aec(++_0x49d748);}(_0x881b,0x1af));var _0xb881=function(_0x4a3b61,_0x376623){_0x4a3b61=_0x4a3b61-0x0;var _0x53ae25=_0x881b[_0x4a3b61];return _0x53ae25;};'use strict';var BPromise=require(_0xb881('0x0'));var util=require(_0xb881('0x1'));var moment=require(_0xb881('0x2'));var server=require(_0xb881('0x3'));var Realtime=require(_0xb881('0x4'));var Report=require(_0xb881('0x5'));var Acw=require(_0xb881('0x6'));var Trigger=require('./trigger');var Dialer=require(_0xb881('0x7'));var Preview=require(_0xb881('0x8'));var Fax=require(_0xb881('0x9'));var user=require(_0xb881('0xa'));var voiceQueue=require(_0xb881('0xb'));var voiceQueueReport=require(_0xb881('0xc'));var voiceCallReport=require(_0xb881('0xd'));var trunk=require(_0xb881('0xe'));var trigger=require(_0xb881('0xf'));var template=require('./rpc/template');var cmHopperHistory=require(_0xb881('0x10'));var campaign=require(_0xb881('0x11'));var voiceExtension=require(_0xb881('0x12'));var faxAccount=require(_0xb881('0x13'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0xb881('0x14'));var sugarcrm=require(_0xb881('0x15'));var freshdesk=require(_0xb881('0x16'));var desk=require(_0xb881('0x17'));var zoho=require(_0xb881('0x18'));var vtiger=require('./rpc/integrations/vtiger');var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0xb881('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()[_0xb881('0x1a')](_0xb881('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xb881('0x1a')](_0xb881('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xb881('0x1c')]()[_0xb881('0x1d')](user[_0xb881('0x1e')]())[_0xb881('0x1d')](realtime['initAgents']())[_0xb881('0x1d')](user[_0xb881('0x1f')]())['then'](realtime[_0xb881('0x20')]())[_0xb881('0x1d')](trunk[_0xb881('0x21')]())[_0xb881('0x1d')](realtime[_0xb881('0x22')]())[_0xb881('0x1d')](voiceQueue[_0xb881('0x23')]())['then'](realtime[_0xb881('0x24')]())[_0xb881('0x1d')](trigger[_0xb881('0x25')]())[_0xb881('0x1d')](realtime[_0xb881('0x26')]())['then'](template['getTemplates']())[_0xb881('0x1d')](realtime['initTemplates']())[_0xb881('0x1d')](zendesk['getZendeskAccounts']())[_0xb881('0x1d')](realtime[_0xb881('0x27')]())[_0xb881('0x1d')](salesforce['getSalesforceAccounts']())[_0xb881('0x1d')](realtime[_0xb881('0x28')]())[_0xb881('0x1d')](sugarcrm[_0xb881('0x29')]())[_0xb881('0x1d')](realtime[_0xb881('0x2a')]())['then'](freshdesk['getFreshdeskAccounts']())['then'](realtime[_0xb881('0x2b')]())[_0xb881('0x1d')](desk[_0xb881('0x2c')]())[_0xb881('0x1d')](realtime[_0xb881('0x2d')]())['then'](zoho[_0xb881('0x2e')]())['then'](realtime[_0xb881('0x2f')]())['then'](vtiger[_0xb881('0x30')]())[_0xb881('0x1d')](realtime[_0xb881('0x31')]())[_0xb881('0x1d')](servicenow[_0xb881('0x32')]())[_0xb881('0x1d')](realtime[_0xb881('0x33')]())[_0xb881('0x1d')](dynamics365[_0xb881('0x34')]())[_0xb881('0x1d')](realtime['initDynamics365Accounts']())[_0xb881('0x1d')](campaign[_0xb881('0x35')]())['then'](realtime[_0xb881('0x36')]())[_0xb881('0x1d')](voiceExtension[_0xb881('0x37')]())[_0xb881('0x1d')](realtime[_0xb881('0x38')]())['then'](faxAccount[_0xb881('0x39')]())[_0xb881('0x1d')](realtime[_0xb881('0x3a')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0xb881('0x1c')]()[_0xb881('0x1d')](voiceQueueReport[_0xb881('0x3b')]())['then'](realtime[_0xb881('0x3c')]())['then'](cmHopperHistory[_0xb881('0x3d')]())[_0xb881('0x1d')](realtime[_0xb881('0x3e')]())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0xb881('0x1d')](realtime[_0xb881('0x3f')]())[_0xb881('0x1d')](voiceCallReport['getVoiceCallReports']())[_0xb881('0x1d')](realtime[_0xb881('0x40')]())[_0xb881('0x1d')](function(_0x379b80){})[_0xb881('0x41')](function(_0x2994cc){console['log'](_0x2994cc);});}function main(){return server['listen'](realtime,preview,fax)['then'](function(_0x498013){return initRealtime();})[_0xb881('0x1d')](function(){return initParams();})[_0xb881('0x1d')](function(){report[_0xb881('0x42')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x5a9075){console[_0xb881('0x43')](_0x5a9075);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 7d0b06d..ffa77ee 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 _0xab53=['phone','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','voiceStatusQueue','local','prototype','toLowerCase','idle','inuse','talking','voiceStatusTime','format','email','accountcode','address','user:%s','user:save','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','localhost','name','fullname','state','unknown','stateTime','status'];(function(_0x20cc1e,_0x326ed6){var _0x3c967b=function(_0x40c596){while(--_0x40c596){_0x20cc1e['push'](_0x20cc1e['shift']());}};_0x3c967b(++_0x326ed6);}(_0xab53,0x12d));var _0x3ab5=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xab53[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x3ab5('0x0'));var util=require(_0x3ab5('0x1'));var moment=require(_0x3ab5('0x2'));var md5=require(_0x3ab5('0x3'));var Redis=require(_0x3ab5('0x4'));var config=require(_0x3ab5('0x5'));config[_0x3ab5('0x6')]=_['defaults'](config[_0x3ab5('0x6')],{'host':_0x3ab5('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3ab5('0x6')]));function Agent(_0x6fd74c){this['id']=_0x6fd74c['id']||0x0;this[_0x3ab5('0x8')]=_0x6fd74c[_0x3ab5('0x8')]||'';this['email']=_0x6fd74c['email']||'';this['accountcode']=_0x6fd74c['accountcode']||'';this[_0x3ab5('0x9')]=_0x6fd74c['fullname']||'';this[_0x3ab5('0xa')]=_0x3ab5('0xb');this[_0x3ab5('0xc')]=0x0;this[_0x3ab5('0xd')]=_0x3ab5('0xb');this['address']='';this[_0x3ab5('0xe')]='';this[_0x3ab5('0xf')]='';this[_0x3ab5('0x10')]='';this[_0x3ab5('0x11')]=_0x6fd74c[_0x3ab5('0x11')]||![];this[_0x3ab5('0x12')]=_0x3ab5('0xb');this['voiceStatusTime']=0x0;this[_0x3ab5('0x13')]='';this[_0x3ab5('0x14')]='';this['onhold']=![];this[_0x3ab5('0x15')]=![];this[_0x3ab5('0x3')]='';}Agent[_0x3ab5('0x16')]['updateStatusRealtime']=function(_0x262f0e){var _0x46b9b5;if(_0x262f0e&&_0x262f0e['state']){_0x46b9b5=_0x262f0e['state'][_0x3ab5('0x17')]();switch(_0x46b9b5){case'not_inuse':_0x46b9b5=_0x3ab5('0x18');break;case _0x3ab5('0x19'):_0x46b9b5=_0x3ab5('0x1a');break;}}if(_0x46b9b5&&this[_0x3ab5('0x12')]!==_0x46b9b5||_0x262f0e['statePause']){this[_0x3ab5('0x1b')]=_['toNumber'](moment()[_0x3ab5('0x1c')]('x'));}if(_0x46b9b5){this[_0x3ab5('0x12')]=_0x46b9b5;}var _0x59e6a4={'id':this['id'],'name':this[_0x3ab5('0x8')],'email':this[_0x3ab5('0x1d')],'accountcode':this[_0x3ab5('0x1e')],'fullname':this['fullname'],'state':this['state'],'stateTime':this[_0x3ab5('0xc')],'status':this['status'],'address':this[_0x3ab5('0x1f')],'online':this[_0x3ab5('0x11')],'voiceStatus':this[_0x3ab5('0x12')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x3ab5('0x13')],'voiceStatusQueue':this[_0x3ab5('0x14')],'interface':this[_0x3ab5('0x10')],'onhold':this['onhold']};var _0x2fc6cb=md5(JSON['stringify'](_0x59e6a4));if(this['md5']!==_0x2fc6cb){this[_0x3ab5('0x3')]=_0x2fc6cb;io['to'](util[_0x3ab5('0x1c')](_0x3ab5('0x20'),_0x59e6a4[_0x3ab5('0x8')]))['emit'](_0x3ab5('0x21'),_0x59e6a4);}};module[_0x3ab5('0x22')]=Agent; \ No newline at end of file +var _0xe3cc=['onhold','local','prototype','idle','inuse','talking','voiceStatus','voiceStatusTime','toNumber','format','stringify','user:%s','emit','user:save','lodash','util','moment','md5','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','address','phone','mobile','interface','online','voiceStatusCallerIdNumber','voiceStatusQueue'];(function(_0x489b87,_0xd51c93){var _0x1823b6=function(_0x451c70){while(--_0x451c70){_0x489b87['push'](_0x489b87['shift']());}};_0x1823b6(++_0xd51c93);}(_0xe3cc,0x1a5));var _0xce3c=function(_0x4f7263,_0xedf4f7){_0x4f7263=_0x4f7263-0x0;var _0x3c8289=_0xe3cc[_0x4f7263];return _0x3c8289;};'use strict';var _=require(_0xce3c('0x0'));var util=require(_0xce3c('0x1'));var moment=require(_0xce3c('0x2'));var md5=require(_0xce3c('0x3'));var Redis=require('ioredis');var config=require(_0xce3c('0x4'));config['redis']=_[_0xce3c('0x5')](config[_0xce3c('0x6')],{'host':_0xce3c('0x7'),'port':0x18eb});var io=require(_0xce3c('0x8'))(new Redis(config[_0xce3c('0x6')]));function Agent(_0x334bf7){this['id']=_0x334bf7['id']||0x0;this[_0xce3c('0x9')]=_0x334bf7[_0xce3c('0x9')]||'';this[_0xce3c('0xa')]=_0x334bf7[_0xce3c('0xa')]||'';this[_0xce3c('0xb')]=_0x334bf7[_0xce3c('0xb')]||'';this[_0xce3c('0xc')]=_0x334bf7[_0xce3c('0xc')]||'';this[_0xce3c('0xd')]=_0xce3c('0xe');this[_0xce3c('0xf')]=0x0;this['status']='unknown';this[_0xce3c('0x10')]='';this[_0xce3c('0x11')]='';this[_0xce3c('0x12')]='';this[_0xce3c('0x13')]='';this[_0xce3c('0x14')]=_0x334bf7[_0xce3c('0x14')]||![];this['voiceStatus']=_0xce3c('0xe');this['voiceStatusTime']=0x0;this[_0xce3c('0x15')]='';this[_0xce3c('0x16')]='';this[_0xce3c('0x17')]=![];this[_0xce3c('0x18')]=![];this[_0xce3c('0x3')]='';}Agent[_0xce3c('0x19')]['updateStatusRealtime']=function(_0x1190a2){var _0x2fcb92;if(_0x1190a2&&_0x1190a2['state']){_0x2fcb92=_0x1190a2[_0xce3c('0xd')]['toLowerCase']();switch(_0x2fcb92){case'not_inuse':_0x2fcb92=_0xce3c('0x1a');break;case _0xce3c('0x1b'):_0x2fcb92=_0xce3c('0x1c');break;}}if(_0x2fcb92&&this[_0xce3c('0x1d')]!==_0x2fcb92||_0x1190a2['statePause']){this[_0xce3c('0x1e')]=_[_0xce3c('0x1f')](moment()[_0xce3c('0x20')]('x'));}if(_0x2fcb92){this[_0xce3c('0x1d')]=_0x2fcb92;}var _0xa9038={'id':this['id'],'name':this[_0xce3c('0x9')],'email':this[_0xce3c('0xa')],'accountcode':this[_0xce3c('0xb')],'fullname':this[_0xce3c('0xc')],'state':this['state'],'stateTime':this[_0xce3c('0xf')],'status':this['status'],'address':this['address'],'online':this[_0xce3c('0x14')],'voiceStatus':this[_0xce3c('0x1d')],'voiceStatusTime':this[_0xce3c('0x1e')],'voiceStatusCallerIdNumber':this[_0xce3c('0x15')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0xce3c('0x13')],'onhold':this[_0xce3c('0x17')]};var _0x4f0c1c=md5(JSON[_0xce3c('0x21')](_0xa9038));if(this['md5']!==_0x4f0c1c){this[_0xce3c('0x3')]=_0x4f0c1c;io['to'](util['format'](_0xce3c('0x22'),_0xa9038[_0xce3c('0x9')]))[_0xce3c('0x23')](_0xce3c('0x24'),_0xa9038);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 6c08927..1cb83b1 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 _0xd87e=['dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrTotalCallsDays','message','active','limitCalls','dialTimezone'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xd87e,0x1bf));var _0xed87=function(_0x32b122,_0x1ad490){_0x32b122=_0x32b122-0x0;var _0x4ad25a=_0xd87e[_0x32b122];return _0x4ad25a;};'use strict';function Campaign(_0x3cd682){this['id']=_0x3cd682['id']||0x0;this[_0xed87('0x0')]=_0x3cd682['name']||'';this[_0xed87('0x1')]=_0x3cd682[_0xed87('0x1')]||_0xed87('0x2');this['originated']=0x0;this[_0xed87('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0xed87('0x4')]=0x0;this[_0xed87('0x5')]='';this['sendMessageOneNotActive']=!![];this[_0xed87('0x6')]=_0x3cd682['active'];this['limitCalls']=_0x3cd682[_0xed87('0x7')];this[_0xed87('0x8')]=_0x3cd682[_0xed87('0x8')]||null;this[_0xed87('0x9')]=_0x3cd682['dialGlobalInterval']?_0x3cd682[_0xed87('0x9')]:null;this[_0xed87('0xa')]=_0x3cd682[_0xed87('0xa')];this[_0xed87('0xb')]=_0x3cd682[_0xed87('0xb')];this[_0xed87('0xc')]=_0x3cd682[_0xed87('0xc')]||0x1e;this['dialCongestionMaxRetry']=_0x3cd682[_0xed87('0xd')];this[_0xed87('0xe')]=_0x3cd682['dialCongestionRetryFrequency'];this[_0xed87('0xf')]=_0x3cd682[_0xed87('0xf')];this['dialBusyRetryFrequency']=_0x3cd682['dialBusyRetryFrequency'];this[_0xed87('0x10')]=_0x3cd682[_0xed87('0x10')];this[_0xed87('0x11')]=_0x3cd682[_0xed87('0x11')];this[_0xed87('0x12')]=_0x3cd682[_0xed87('0x12')];this['dialOrderByScheduledAt']=_0x3cd682[_0xed87('0x13')]||_0xed87('0x14');this[_0xed87('0x15')]=_0x3cd682[_0xed87('0x15')]||undefined;this[_0xed87('0x16')]=_0x3cd682[_0xed87('0x16')]||undefined;this[_0xed87('0x17')]=_0x3cd682[_0xed87('0x17')]||undefined;this[_0xed87('0x18')]=_0x3cd682['TrunkBackup']?_0x3cd682[_0xed87('0x18')]:undefined;this[_0xed87('0x19')]=_0x3cd682[_0xed87('0x19')]?_0x3cd682[_0xed87('0x19')]:undefined;this['Interval']=_0x3cd682[_0xed87('0x1a')]?_0x3cd682[_0xed87('0x1a')]:undefined;this[_0xed87('0x1b')]=_0x3cd682[_0xed87('0x1b')]?_0x3cd682[_0xed87('0x1b')]:undefined;this[_0xed87('0x1c')]=_0x3cd682[_0xed87('0x1b')]?_0x3cd682[_0xed87('0x1b')][_0xed87('0x0')]:undefined;this['dialAMDActive']=_0x3cd682['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x3cd682['dialAMDInitialSilence'];this[_0xed87('0x1d')]=_0x3cd682['dialAMDGreeting'];this[_0xed87('0x1e')]=_0x3cd682[_0xed87('0x1e')];this['dialAMDTotalAnalysisTime']=_0x3cd682[_0xed87('0x1f')];this['dialAMDMinWordLength']=_0x3cd682[_0xed87('0x20')];this[_0xed87('0x21')]=_0x3cd682[_0xed87('0x21')];this[_0xed87('0x22')]=_0x3cd682[_0xed87('0x22')];this['dialAMDSilenceThreshold']=_0x3cd682[_0xed87('0x23')];this[_0xed87('0x24')]=_0x3cd682[_0xed87('0x24')];}module[_0xed87('0x25')]=Campaign; \ No newline at end of file +var _0xfc4c=['dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','Interval','SquareProject'];(function(_0x2f0f07,_0x424b62){var _0x1e6ae4=function(_0x4d1253){while(--_0x4d1253){_0x2f0f07['push'](_0x2f0f07['shift']());}};_0x1e6ae4(++_0x424b62);}(_0xfc4c,0xca));var _0xcfc4=function(_0x349dfb,_0x30d83b){_0x349dfb=_0x349dfb-0x0;var _0x4e87b7=_0xfc4c[_0x349dfb];return _0x4e87b7;};'use strict';function Campaign(_0x2f1264){this['id']=_0x2f1264['id']||0x0;this[_0xcfc4('0x0')]=_0x2f1264[_0xcfc4('0x0')]||'';this['type']=_0x2f1264[_0xcfc4('0x1')]||_0xcfc4('0x2');this[_0xcfc4('0x3')]=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this[_0xcfc4('0x4')]=0x0;this[_0xcfc4('0x5')]='';this['sendMessageOneNotActive']=!![];this['active']=_0x2f1264[_0xcfc4('0x6')];this['limitCalls']=_0x2f1264[_0xcfc4('0x7')];this[_0xcfc4('0x8')]=_0x2f1264['dialTimezone']||null;this[_0xcfc4('0x9')]=_0x2f1264['dialGlobalInterval']?_0x2f1264['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x2f1264[_0xcfc4('0xa')];this[_0xcfc4('0xb')]=_0x2f1264['dialOriginateCallerIdNumber'];this[_0xcfc4('0xc')]=_0x2f1264['dialOriginateTimeout']||0x1e;this['dialCongestionMaxRetry']=_0x2f1264[_0xcfc4('0xd')];this[_0xcfc4('0xe')]=_0x2f1264[_0xcfc4('0xe')];this[_0xcfc4('0xf')]=_0x2f1264[_0xcfc4('0xf')];this['dialBusyRetryFrequency']=_0x2f1264[_0xcfc4('0x10')];this['dialNoAnswerMaxRetry']=_0x2f1264[_0xcfc4('0x11')];this['dialNoAnswerRetryFrequency']=_0x2f1264[_0xcfc4('0x12')];this['dialGlobalMaxRetry']=_0x2f1264['dialGlobalMaxRetry'];this[_0xcfc4('0x13')]=_0x2f1264[_0xcfc4('0x13')]||'DESC';this[_0xcfc4('0x14')]=_0x2f1264[_0xcfc4('0x14')]||undefined;this[_0xcfc4('0x15')]=_0x2f1264['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x2f1264[_0xcfc4('0x16')]||undefined;this['TrunkBackup']=_0x2f1264['TrunkBackup']?_0x2f1264['TrunkBackup']:undefined;this[_0xcfc4('0x17')]=_0x2f1264['Trunk']?_0x2f1264[_0xcfc4('0x17')]:undefined;this[_0xcfc4('0x18')]=_0x2f1264['Interval']?_0x2f1264[_0xcfc4('0x18')]:undefined;this[_0xcfc4('0x19')]=_0x2f1264[_0xcfc4('0x19')]?_0x2f1264['SquareProject']:undefined;this[_0xcfc4('0x1a')]=_0x2f1264[_0xcfc4('0x19')]?_0x2f1264[_0xcfc4('0x19')]['name']:undefined;this[_0xcfc4('0x1b')]=_0x2f1264[_0xcfc4('0x1b')]||![];this[_0xcfc4('0x1c')]=_0x2f1264[_0xcfc4('0x1c')];this[_0xcfc4('0x1d')]=_0x2f1264[_0xcfc4('0x1d')];this[_0xcfc4('0x1e')]=_0x2f1264[_0xcfc4('0x1e')];this[_0xcfc4('0x1f')]=_0x2f1264[_0xcfc4('0x1f')];this[_0xcfc4('0x20')]=_0x2f1264['dialAMDMinWordLength'];this[_0xcfc4('0x21')]=_0x2f1264[_0xcfc4('0x21')];this[_0xcfc4('0x22')]=_0x2f1264['dialAMDMaximumNumberOfWords'];this[_0xcfc4('0x23')]=_0x2f1264['dialAMDSilenceThreshold'];this[_0xcfc4('0x24')]=_0x2f1264[_0xcfc4('0x24')];}module[_0xcfc4('0x25')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index a98a8a0..7533178 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 _0x7d14=['queue','monitors','transfercalleridnum','transferconnectedlinenum','exports','starttime','channel','calleridnum','calleridname','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answered','abandoned','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename'];(function(_0x42b5e5,_0x5b720c){var _0x1ad723=function(_0x3000cc){while(--_0x3000cc){_0x42b5e5['push'](_0x42b5e5['shift']());}};_0x1ad723(++_0x5b720c);}(_0x7d14,0x6d));var _0x47d1=function(_0xffd19b,_0x95020b){_0xffd19b=_0xffd19b-0x0;var _0x5cd88e=_0x7d14[_0xffd19b];return _0x5cd88e;};'use strict';function Channel(){this[_0x47d1('0x0')]=null;this[_0x47d1('0x1')]='';this['destinationchannel']='';this[_0x47d1('0x2')]=0x0;this[_0x47d1('0x3')]='';this[_0x47d1('0x4')]=undefined;this[_0x47d1('0x5')]=undefined;this['accountcode']=0x0;this[_0x47d1('0x6')]='';this[_0x47d1('0x7')]=0x0;this[_0x47d1('0x8')]=0x0;this[_0x47d1('0x9')]=0x0;this[_0x47d1('0xa')]=![];this['answertime']=null;this['endtime']=null;this['unmanaged']=![];this[_0x47d1('0xb')]=![];this['lastapplication']='';this[_0x47d1('0xc')]='';this[_0x47d1('0xd')]=0x0;this[_0x47d1('0xe')]=0x0;this[_0x47d1('0xf')]=0x0;this[_0x47d1('0x10')]=null;this[_0x47d1('0x11')]=null;this[_0x47d1('0x12')]=null;this[_0x47d1('0x13')]=![];this[_0x47d1('0x14')]=null;this[_0x47d1('0x15')]=null;this[_0x47d1('0x16')]=[];this[_0x47d1('0x17')]=undefined;this[_0x47d1('0x18')]=undefined;this['mohtime']=0x0;}module[_0x47d1('0x19')]=Channel; \ No newline at end of file +var _0x1241=['monitor','monitorFilename','monitors','exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','context','uniqueid','linkedid','answered','answertime','endtime','unmanaged','duration','holdtime','type','tag','disposition'];(function(_0x22d7c7,_0xe90c9d){var _0x33fcad=function(_0x1fcfdf){while(--_0x1fcfdf){_0x22d7c7['push'](_0x22d7c7['shift']());}};_0x33fcad(++_0xe90c9d);}(_0x1241,0xb4));var _0x1124=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1241[_0x3dd15e];return _0x231fd0;};'use strict';function Channel(){this[_0x1124('0x0')]=null;this['channel']='';this[_0x1124('0x1')]='';this[_0x1124('0x2')]=0x0;this[_0x1124('0x3')]='';this[_0x1124('0x4')]=undefined;this[_0x1124('0x5')]=undefined;this['accountcode']=0x0;this[_0x1124('0x6')]='';this[_0x1124('0x7')]=0x0;this[_0x1124('0x8')]=0x0;this['exten']=0x0;this[_0x1124('0x9')]=![];this[_0x1124('0xa')]=null;this[_0x1124('0xb')]=null;this[_0x1124('0xc')]=![];this['abandoned']=![];this['lastapplication']='';this['lastdata']='';this[_0x1124('0xd')]=0x0;this['billableseconds']=0x0;this[_0x1124('0xe')]=0x0;this[_0x1124('0xf')]=null;this[_0x1124('0x10')]=null;this[_0x1124('0x11')]=null;this[_0x1124('0x12')]=![];this[_0x1124('0x13')]=null;this['queue']=null;this[_0x1124('0x14')]=[];this['transfercalleridnum']=undefined;this['transferconnectedlinenum']=undefined;this['mohtime']=0x0;}module[_0x1124('0x15')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 36548b4..cddec40 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 _0x4a91=['exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x41382c,_0xc3ffd1){var _0x4da35b=function(_0x5d56b8){while(--_0x5d56b8){_0x41382c['push'](_0x41382c['shift']());}};_0x4da35b(++_0xc3ffd1);}(_0x4a91,0x16d));var _0x14a9=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0x4a91[_0x3c504b];return _0x2e5354;};'use strict';function DeskAccount(_0x49f7d6){this['id']=_0x49f7d6['id']||0x0;this[_0x14a9('0x0')]=_0x49f7d6['name']||'';this['username']=_0x49f7d6[_0x14a9('0x1')]||'';this[_0x14a9('0x2')]=_0x49f7d6[_0x14a9('0x2')]||'';this[_0x14a9('0x3')]=_0x49f7d6[_0x14a9('0x3')]||'';this[_0x14a9('0x4')]=_0x49f7d6[_0x14a9('0x4')]||'';this['consumerKey']=_0x49f7d6[_0x14a9('0x5')]||'';this['consumerSecret']=_0x49f7d6[_0x14a9('0x6')]||'';this[_0x14a9('0x7')]=_0x49f7d6['token']||'';this[_0x14a9('0x8')]=_0x49f7d6[_0x14a9('0x8')]||'';this[_0x14a9('0x9')]=_0x49f7d6[_0x14a9('0x9')]||'';this[_0x14a9('0xa')]=_0x49f7d6[_0x14a9('0xa')]||'';this[_0x14a9('0xb')]=_0x49f7d6[_0x14a9('0xb')]||{};}module[_0x14a9('0xc')]=DeskAccount; \ No newline at end of file +var _0x85eb=['token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x5b51d6,_0x5515a8){var _0x36f56a=function(_0x1d0033){while(--_0x1d0033){_0x5b51d6['push'](_0x5b51d6['shift']());}};_0x36f56a(++_0x5515a8);}(_0x85eb,0xe9));var _0xb85e=function(_0x5908f0,_0x218b18){_0x5908f0=_0x5908f0-0x0;var _0x3c1f41=_0x85eb[_0x5908f0];return _0x3c1f41;};'use strict';function DeskAccount(_0x1c81f7){this['id']=_0x1c81f7['id']||0x0;this[_0xb85e('0x0')]=_0x1c81f7['name']||'';this[_0xb85e('0x1')]=_0x1c81f7[_0xb85e('0x1')]||'';this[_0xb85e('0x2')]=_0x1c81f7[_0xb85e('0x2')]||'';this[_0xb85e('0x3')]=_0x1c81f7[_0xb85e('0x3')]||'';this[_0xb85e('0x4')]=_0x1c81f7[_0xb85e('0x4')]||'';this[_0xb85e('0x5')]=_0x1c81f7[_0xb85e('0x5')]||'';this['consumerSecret']=_0x1c81f7[_0xb85e('0x6')]||'';this[_0xb85e('0x7')]=_0x1c81f7[_0xb85e('0x7')]||'';this[_0xb85e('0x8')]=_0x1c81f7['tokenSecret']||'';this[_0xb85e('0x9')]=_0x1c81f7[_0xb85e('0x9')]||'';this['serverUrl']=_0x1c81f7[_0xb85e('0xa')]||'';this['Configurations']=_0x1c81f7[_0xb85e('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index c1491e0..09fd981 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 _0x10de=['remoteUri','tenantId','clientId','clientSecret','Configurations','exports','name','username','password'];(function(_0x3a9263,_0x1272bd){var _0x3dcaaf=function(_0x223b29){while(--_0x223b29){_0x3a9263['push'](_0x3a9263['shift']());}};_0x3dcaaf(++_0x1272bd);}(_0x10de,0xde));var _0xe10d=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x10de[_0x5d6456];return _0x4d66c1;};'use strict';function Dynamics365Account(_0x287d52){this['id']=_0x287d52['id']||0x0;this[_0xe10d('0x0')]=_0x287d52['name']||'';this['username']=_0x287d52[_0xe10d('0x1')]||'';this[_0xe10d('0x2')]=_0x287d52[_0xe10d('0x2')]||'';this[_0xe10d('0x3')]=_0x287d52['remoteUri']||'';this[_0xe10d('0x4')]=_0x287d52['tenantId']||'';this['clientId']=_0x287d52[_0xe10d('0x5')]||'';this[_0xe10d('0x6')]=_0x287d52[_0xe10d('0x6')]||{};this['serverUrl']=_0x287d52['serverUrl']||'';this[_0xe10d('0x7')]=_0x287d52['Configurations']||{};}module[_0xe10d('0x8')]=Dynamics365Account; \ No newline at end of file +var _0xfe1a=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports'];(function(_0x4e72bb,_0x4c7221){var _0x649f52=function(_0x3ff35d){while(--_0x3ff35d){_0x4e72bb['push'](_0x4e72bb['shift']());}};_0x649f52(++_0x4c7221);}(_0xfe1a,0x156));var _0xafe1=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xfe1a[_0xae7c2f];return _0x5d7001;};'use strict';function Dynamics365Account(_0x54d351){this['id']=_0x54d351['id']||0x0;this['name']=_0x54d351['name']||'';this[_0xafe1('0x0')]=_0x54d351[_0xafe1('0x0')]||'';this[_0xafe1('0x1')]=_0x54d351['password']||'';this[_0xafe1('0x2')]=_0x54d351[_0xafe1('0x2')]||'';this[_0xafe1('0x3')]=_0x54d351[_0xafe1('0x3')]||'';this[_0xafe1('0x4')]=_0x54d351[_0xafe1('0x4')]||'';this[_0xafe1('0x5')]=_0x54d351[_0xafe1('0x5')]||{};this[_0xafe1('0x6')]=_0x54d351['serverUrl']||'';this['Configurations']=_0x54d351[_0xafe1('0x7')]||{};}module[_0xafe1('0x8')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 04155e9..a24d9dd 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 _0xe205=['faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway'];(function(_0x394496,_0x5e8f00){var _0x2d4faa=function(_0x136cf9){while(--_0x136cf9){_0x394496['push'](_0x394496['shift']());}};_0x2d4faa(++_0x5e8f00);}(_0xe205,0xa7));var _0x5e20=function(_0xe14ee9,_0x4cd8e1){_0xe14ee9=_0xe14ee9-0x0;var _0x1dda60=_0xe205[_0xe14ee9];return _0x1dda60;};'use strict';function FaxAccount(_0x289a5c){this['id']=_0x289a5c['id']||0x0;this[_0x5e20('0x0')]=_0x289a5c[_0x5e20('0x0')]||'';this[_0x5e20('0x1')]=_0x289a5c[_0x5e20('0x1')];this[_0x5e20('0x2')]=_0x289a5c[_0x5e20('0x2')];this[_0x5e20('0x3')]=_0x289a5c[_0x5e20('0x3')];this['localstationid']=_0x289a5c[_0x5e20('0x4')];this[_0x5e20('0x5')]=_0x289a5c[_0x5e20('0x5')]||0x960;this[_0x5e20('0x6')]=_0x289a5c['maxrate']||0x3840;this['modem']=_0x289a5c[_0x5e20('0x7')]||'v17,v27,v29';this['gateway']=_0x289a5c[_0x5e20('0x8')]||'no';this[_0x5e20('0x9')]=_0x289a5c['faxdetect']||'no';this[_0x5e20('0xa')]=_0x289a5c[_0x5e20('0xa')]||0x1388;this[_0x5e20('0xb')]=_0x289a5c[_0x5e20('0xb')]||'SIP';this[_0x5e20('0xc')]=_0x289a5c[_0x5e20('0xc')]?_0x289a5c[_0x5e20('0xc')]:undefined;this[_0x5e20('0xd')]=_0x289a5c[_0x5e20('0xd')];this[_0x5e20('0xe')]=_0x289a5c['key'];}module[_0x5e20('0xf')]=FaxAccount; \ No newline at end of file +var _0x22fb=['Trunk','ListId','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP'];(function(_0x5670f4,_0x2c2c31){var _0x2afcf1=function(_0x279fe4){while(--_0x279fe4){_0x5670f4['push'](_0x5670f4['shift']());}};_0x2afcf1(++_0x2c2c31);}(_0x22fb,0x192));var _0xb22f=function(_0x51a867,_0x497466){_0x51a867=_0x51a867-0x0;var _0x5476ff=_0x22fb[_0x51a867];return _0x5476ff;};'use strict';function FaxAccount(_0x462a53){this['id']=_0x462a53['id']||0x0;this['name']=_0x462a53[_0xb22f('0x0')]||'';this['description']=_0x462a53[_0xb22f('0x1')];this[_0xb22f('0x2')]=_0x462a53[_0xb22f('0x2')];this[_0xb22f('0x3')]=_0x462a53[_0xb22f('0x3')];this['localstationid']=_0x462a53[_0xb22f('0x4')];this[_0xb22f('0x5')]=_0x462a53[_0xb22f('0x5')]||0x960;this[_0xb22f('0x6')]=_0x462a53[_0xb22f('0x6')]||0x3840;this[_0xb22f('0x7')]=_0x462a53['modem']||_0xb22f('0x8');this[_0xb22f('0x9')]=_0x462a53[_0xb22f('0x9')]||'no';this[_0xb22f('0xa')]=_0x462a53[_0xb22f('0xa')]||'no';this[_0xb22f('0xb')]=_0x462a53[_0xb22f('0xb')]||0x1388;this[_0xb22f('0xc')]=_0x462a53[_0xb22f('0xc')]||_0xb22f('0xd');this[_0xb22f('0xe')]=_0x462a53['Trunk']?_0x462a53['Trunk']:undefined;this['ListId']=_0x462a53[_0xb22f('0xf')];this['key']=_0x462a53['key'];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index eb91cb7..5791f7e 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 _0xe57d=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x2fe0d7,_0x4a7685){var _0xb2d75c=function(_0x539f62){while(--_0x539f62){_0x2fe0d7['push'](_0x2fe0d7['shift']());}};_0xb2d75c(++_0x4a7685);}(_0xe57d,0x1bc));var _0xde57=function(_0x239a98,_0x288178){_0x239a98=_0x239a98-0x0;var _0x16d789=_0xe57d[_0x239a98];return _0x16d789;};'use strict';function FreshdeskAccount(_0x437f23){this['id']=_0x437f23['id']||0x0;this[_0xde57('0x0')]=_0x437f23[_0xde57('0x0')]||'';this[_0xde57('0x1')]=_0x437f23['username']||'';this[_0xde57('0x2')]=_0x437f23[_0xde57('0x3')]||'';this[_0xde57('0x4')]=_0x437f23[_0xde57('0x4')]||'';this['serverUrl']=_0x437f23[_0xde57('0x5')]||'';this[_0xde57('0x6')]=_0x437f23[_0xde57('0x6')]||{};}module[_0xde57('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x5389=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x1d9f64,_0x40d87a){var _0x39338d=function(_0x141d40){while(--_0x141d40){_0x1d9f64['push'](_0x1d9f64['shift']());}};_0x39338d(++_0x40d87a);}(_0x5389,0x15b));var _0x9538=function(_0x51720d,_0xf340f9){_0x51720d=_0x51720d-0x0;var _0x248dd6=_0x5389[_0x51720d];return _0x248dd6;};'use strict';function FreshdeskAccount(_0xf00143){this['id']=_0xf00143['id']||0x0;this[_0x9538('0x0')]=_0xf00143[_0x9538('0x0')]||'';this[_0x9538('0x1')]=_0xf00143[_0x9538('0x1')]||'';this[_0x9538('0x2')]=_0xf00143['token']||'';this[_0x9538('0x3')]=_0xf00143[_0x9538('0x3')]||'';this[_0x9538('0x4')]=_0xf00143[_0x9538('0x4')]||'';this['Configurations']=_0xf00143[_0x9538('0x5')]||{};}module[_0x9538('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 574bae3..d26db54 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 _0x32b2=['context','priority','holdtime','assigned','lastAssignedTo','mohtime','exports','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinename','accountcode'];(function(_0x224a42,_0x3c36ea){var _0x114730=function(_0x5ebe95){while(--_0x5ebe95){_0x224a42['push'](_0x224a42['shift']());}};_0x114730(++_0x3c36ea);}(_0x32b2,0xa8));var _0x232b=function(_0x31ead7,_0x2e9a7c){_0x31ead7=_0x31ead7-0x0;var _0x3516f0=_0x32b2[_0x31ead7];return _0x3516f0;};'use strict';function QueueReport(){this[_0x232b('0x0')]='inbound';this[_0x232b('0x1')]='';this[_0x232b('0x2')]='';this[_0x232b('0x3')]='';this[_0x232b('0x4')]='';this[_0x232b('0x5')]=null;this['queuecallerleaveAt']=null;this['position']=0x1;this[_0x232b('0x6')]=0x1;this[_0x232b('0x7')]=![];this[_0x232b('0x8')]=null;this[_0x232b('0x9')]=![];this[_0x232b('0xa')]=null;this['queuecallerexit']=![];this[_0x232b('0xb')]=null;this[_0x232b('0xc')]=0x1;this[_0x232b('0xd')]='';this['connectedlinenum']='';this[_0x232b('0xe')]='';this[_0x232b('0xf')]='';this[_0x232b('0x10')]='';this['exten']='';this[_0x232b('0x11')]='';this[_0x232b('0x12')]=0x0;this[_0x232b('0x13')]=![];this[_0x232b('0x14')]='';this[_0x232b('0x15')]=0x0;this['variables']={};}module[_0x232b('0x16')]=QueueReport; \ No newline at end of file +var _0xecb1=['assigned','mohtime','variables','type','calleridnum','calleridname','queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','accountcode','context','exten','priority','holdtime'];(function(_0x208af9,_0x428504){var _0x34e94b=function(_0x48aa03){while(--_0x48aa03){_0x208af9['push'](_0x208af9['shift']());}};_0x34e94b(++_0x428504);}(_0xecb1,0x117));var _0x1ecb=function(_0x47e2b7,_0xb3db9){_0x47e2b7=_0x47e2b7-0x0;var _0x313560=_0xecb1[_0x47e2b7];return _0x313560;};'use strict';function QueueReport(){this[_0x1ecb('0x0')]='inbound';this['uniqueid']='';this[_0x1ecb('0x1')]='';this[_0x1ecb('0x2')]='';this[_0x1ecb('0x3')]='';this['queuecallerjoinAt']=null;this[_0x1ecb('0x4')]=null;this[_0x1ecb('0x5')]=0x1;this[_0x1ecb('0x6')]=0x1;this[_0x1ecb('0x7')]=![];this[_0x1ecb('0x8')]=null;this[_0x1ecb('0x9')]=![];this[_0x1ecb('0xa')]=null;this[_0x1ecb('0xb')]=![];this[_0x1ecb('0xc')]=null;this[_0x1ecb('0xd')]=0x1;this['channel']='';this[_0x1ecb('0xe')]='';this['connectedlinename']='';this[_0x1ecb('0xf')]='';this[_0x1ecb('0x10')]='';this[_0x1ecb('0x11')]='';this[_0x1ecb('0x12')]='';this[_0x1ecb('0x13')]=0x0;this[_0x1ecb('0x14')]=![];this['lastAssignedTo']='';this[_0x1ecb('0x15')]=0x0;this[_0x1ecb('0x16')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index a3088b5..026505c 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 _0x73e6=['securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret'];(function(_0x2f3e2a,_0x2873bf){var _0xbf6d84=function(_0xf07af8){while(--_0xf07af8){_0x2f3e2a['push'](_0x2f3e2a['shift']());}};_0xbf6d84(++_0x2873bf);}(_0x73e6,0x1da));var _0x673e=function(_0x148c6f,_0x56aa82){_0x148c6f=_0x148c6f-0x0;var _0xb53931=_0x73e6[_0x148c6f];return _0xb53931;};'use strict';function SalesforceAccount(_0x2b1b41){this['id']=_0x2b1b41['id']||0x0;this[_0x673e('0x0')]=_0x2b1b41['name']||'';this[_0x673e('0x1')]=_0x2b1b41[_0x673e('0x1')]||'';this[_0x673e('0x2')]=_0x2b1b41[_0x673e('0x2')]||'';this['password']=_0x2b1b41[_0x673e('0x3')]||'';this[_0x673e('0x4')]=_0x2b1b41['clientId']||'';this[_0x673e('0x5')]=_0x2b1b41['clientSecret']||'';this['securityToken']=_0x2b1b41[_0x673e('0x6')]||'';this['type']=_0x2b1b41[_0x673e('0x7')]||_0x673e('0x8');this[_0x673e('0x9')]=_0x2b1b41[_0x673e('0x9')]||'';this[_0x673e('0xa')]=_0x2b1b41[_0x673e('0xa')]||{};}module[_0x673e('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x6d36=['name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x300385,_0x31b65){var _0x442f17=function(_0x2ce7d5){while(--_0x2ce7d5){_0x300385['push'](_0x300385['shift']());}};_0x442f17(++_0x31b65);}(_0x6d36,0x1ec));var _0x66d3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6d36[_0x321bb2];return _0x9c12ed;};'use strict';function SalesforceAccount(_0x38f899){this['id']=_0x38f899['id']||0x0;this[_0x66d3('0x0')]=_0x38f899[_0x66d3('0x0')]||'';this['username']=_0x38f899[_0x66d3('0x1')]||'';this[_0x66d3('0x2')]=_0x38f899[_0x66d3('0x2')]||'';this[_0x66d3('0x3')]=_0x38f899[_0x66d3('0x3')]||'';this[_0x66d3('0x4')]=_0x38f899['clientId']||'';this[_0x66d3('0x5')]=_0x38f899[_0x66d3('0x5')]||'';this[_0x66d3('0x6')]=_0x38f899[_0x66d3('0x6')]||'';this[_0x66d3('0x7')]=_0x38f899['type']||_0x66d3('0x8');this[_0x66d3('0x9')]=_0x38f899['serverUrl']||'';this[_0x66d3('0xa')]=_0x38f899[_0x66d3('0xa')]||{};}module[_0x66d3('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index bd4c0f9..f537a35 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 _0x9962=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x9962,0x131));var _0x2996=function(_0x1083f3,_0x108a25){_0x1083f3=_0x1083f3-0x0;var _0x256e96=_0x9962[_0x1083f3];return _0x256e96;};'use strict';function ServicenowAccount(_0x634eb2){this['id']=_0x634eb2['id']||0x0;this[_0x2996('0x0')]=_0x634eb2[_0x2996('0x0')]||'';this[_0x2996('0x1')]=_0x634eb2[_0x2996('0x1')]||'';this[_0x2996('0x2')]=_0x634eb2['password']||'';this[_0x2996('0x3')]=_0x634eb2['remoteUri']||'';this['serverUrl']=_0x634eb2[_0x2996('0x4')]||'';this[_0x2996('0x5')]=_0x634eb2[_0x2996('0x5')]||{};}module[_0x2996('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x1bbe=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x1bbe,0xbe));var _0xe1bb=function(_0x23c791,_0xa8bee3){_0x23c791=_0x23c791-0x0;var _0x57b777=_0x1bbe[_0x23c791];return _0x57b777;};'use strict';function ServicenowAccount(_0x1cf1b6){this['id']=_0x1cf1b6['id']||0x0;this[_0xe1bb('0x0')]=_0x1cf1b6[_0xe1bb('0x0')]||'';this[_0xe1bb('0x1')]=_0x1cf1b6[_0xe1bb('0x1')]||'';this[_0xe1bb('0x2')]=_0x1cf1b6[_0xe1bb('0x2')]||'';this[_0xe1bb('0x3')]=_0x1cf1b6[_0xe1bb('0x3')]||'';this[_0xe1bb('0x4')]=_0x1cf1b6['serverUrl']||'';this[_0xe1bb('0x5')]=_0x1cf1b6[_0xe1bb('0x5')]||{};}module[_0xe1bb('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 fb085af..7dbf4ef 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 _0x36b1=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x36b1,0x11f));var _0x136b=function(_0x2930ce,_0x13de06){_0x2930ce=_0x2930ce-0x0;var _0x57c896=_0x36b1[_0x2930ce];return _0x57c896;};'use strict';function SugarcrmAccount(_0x35c4f8){this['id']=_0x35c4f8['id']||0x0;this[_0x136b('0x0')]=_0x35c4f8[_0x136b('0x0')]||'';this[_0x136b('0x1')]=_0x35c4f8[_0x136b('0x1')]||'';this[_0x136b('0x2')]=_0x35c4f8['password']||'';this[_0x136b('0x3')]=_0x35c4f8[_0x136b('0x3')]||'';this[_0x136b('0x4')]=_0x35c4f8['serverUrl']||'';this[_0x136b('0x5')]=_0x35c4f8['Configurations']||{};}module[_0x136b('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x28f1=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x28f1,0x6e));var _0x128f=function(_0x3c8ede,_0xf49f1f){_0x3c8ede=_0x3c8ede-0x0;var _0x162d63=_0x28f1[_0x3c8ede];return _0x162d63;};'use strict';function SugarcrmAccount(_0x4a8d98){this['id']=_0x4a8d98['id']||0x0;this[_0x128f('0x0')]=_0x4a8d98[_0x128f('0x0')]||'';this[_0x128f('0x1')]=_0x4a8d98[_0x128f('0x1')]||'';this[_0x128f('0x2')]=_0x4a8d98[_0x128f('0x2')]||'';this[_0x128f('0x3')]=_0x4a8d98[_0x128f('0x3')]||'';this[_0x128f('0x4')]=_0x4a8d98['serverUrl']||'';this['Configurations']=_0x4a8d98[_0x128f('0x5')]||{};}module[_0x128f('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 8610b68..0e56b9c 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 _0x63bc=['accountcode','state','unknown','stateTime','status','address','exports','name'];(function(_0x571c04,_0x1b08b9){var _0x70dccb=function(_0x5e5289){while(--_0x5e5289){_0x571c04['push'](_0x571c04['shift']());}};_0x70dccb(++_0x1b08b9);}(_0x63bc,0x12f));var _0xc63b=function(_0x5a7913,_0x329e35){_0x5a7913=_0x5a7913-0x0;var _0x148cad=_0x63bc[_0x5a7913];return _0x148cad;};'use strict';function Telephone(_0x1a460b){this['id']=_0x1a460b['id']||0x0;this[_0xc63b('0x0')]=_0x1a460b['name']||'';this[_0xc63b('0x1')]=_0x1a460b[_0xc63b('0x1')]||'';this[_0xc63b('0x2')]=_0xc63b('0x3');this[_0xc63b('0x4')]=0x0;this[_0xc63b('0x5')]=_0xc63b('0x3');this[_0xc63b('0x6')]='';}module[_0xc63b('0x7')]=Telephone; \ No newline at end of file +var _0x8d51=['stateTime','status','address','exports','name','accountcode','state','unknown'];(function(_0xce5e92,_0x2882cc){var _0xd25974=function(_0x5452b6){while(--_0x5452b6){_0xce5e92['push'](_0xce5e92['shift']());}};_0xd25974(++_0x2882cc);}(_0x8d51,0x8c));var _0x18d5=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x8d51[_0x5d80de];return _0x1c7556;};'use strict';function Telephone(_0x8251bb){this['id']=_0x8251bb['id']||0x0;this['name']=_0x8251bb[_0x18d5('0x0')]||'';this['accountcode']=_0x8251bb[_0x18d5('0x1')]||'';this[_0x18d5('0x2')]=_0x18d5('0x3');this[_0x18d5('0x4')]=0x0;this[_0x18d5('0x5')]=_0x18d5('0x3');this[_0x18d5('0x6')]='';}module[_0x18d5('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 945a995..f7413fc 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 _0x44a3=['html','exports','name'];(function(_0x294360,_0x51b3ea){var _0x226250=function(_0x5afae5){while(--_0x5afae5){_0x294360['push'](_0x294360['shift']());}};_0x226250(++_0x51b3ea);}(_0x44a3,0x1a9));var _0x344a=function(_0x5d289a,_0x352880){_0x5d289a=_0x5d289a-0x0;var _0x14bd5f=_0x44a3[_0x5d289a];return _0x14bd5f;};'use strict';function template(_0x2df766){this['id']=_0x2df766['id']||0x0;this[_0x344a('0x0')]=_0x2df766[_0x344a('0x0')]||'';this[_0x344a('0x1')]=_0x2df766[_0x344a('0x1')]||'';}module[_0x344a('0x2')]=template; \ No newline at end of file +var _0xadb8=['html','exports','name'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xadb8,0x1d0));var _0x8adb=function(_0x367a3d,_0x452717){_0x367a3d=_0x367a3d-0x0;var _0x460539=_0xadb8[_0x367a3d];return _0x460539;};'use strict';function template(_0x26989c){this['id']=_0x26989c['id']||0x0;this['name']=_0x26989c[_0x8adb('0x0')]||'';this['html']=_0x26989c[_0x8adb('0x1')]||'';}module[_0x8adb('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 9174062..870c4e8 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 _0xde0e=['name','channel','voice','status','AllConditions','AnyConditions','Actions','exports'];(function(_0xc078ed,_0x106f3c){var _0x11ab79=function(_0x3ef4b7){while(--_0x3ef4b7){_0xc078ed['push'](_0xc078ed['shift']());}};_0x11ab79(++_0x106f3c);}(_0xde0e,0x108));var _0xede0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde0e[_0x3dd15e];return _0x231fd0;};'use strict';function Trigger(_0x5e96f8){this['id']=_0x5e96f8['id']||0x0;this[_0xede0('0x0')]=_0x5e96f8[_0xede0('0x0')]||'';this['channel']=_0x5e96f8[_0xede0('0x1')]||_0xede0('0x2');this[_0xede0('0x3')]=_0x5e96f8[_0xede0('0x3')]||![];this[_0xede0('0x4')]=_0x5e96f8['AllConditions']||[];this['AnyConditions']=_0x5e96f8[_0xede0('0x5')]||[];this[_0xede0('0x6')]=_0x5e96f8['Actions']||[];}module[_0xede0('0x7')]=Trigger; \ No newline at end of file +var _0xcffd=['name','channel','voice','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x46d3b6,_0x278582){var _0x4cc9df=function(_0x2395ec){while(--_0x2395ec){_0x46d3b6['push'](_0x46d3b6['shift']());}};_0x4cc9df(++_0x278582);}(_0xcffd,0x70));var _0xdcff=function(_0x2b40b7,_0x3c3b03){_0x2b40b7=_0x2b40b7-0x0;var _0x3a4ae6=_0xcffd[_0x2b40b7];return _0x3a4ae6;};'use strict';function Trigger(_0x13df44){this['id']=_0x13df44['id']||0x0;this[_0xdcff('0x0')]=_0x13df44['name']||'';this[_0xdcff('0x1')]=_0x13df44[_0xdcff('0x1')]||_0xdcff('0x2');this['status']=_0x13df44[_0xdcff('0x3')]||![];this[_0xdcff('0x4')]=_0x13df44['AllConditions']||[];this[_0xdcff('0x5')]=_0x13df44[_0xdcff('0x5')]||[];this[_0xdcff('0x6')]=_0x13df44[_0xdcff('0x6')]||[];}module[_0xdcff('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 8263bd6..fc6855f 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 _0x9ead=['indexOf','domain','domainport','refresh','stateRegistry','registrationtime','address','active','name','unknown','stateTime','status','registry'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x9ead,0x1a7));var _0xd9ea=function(_0x534692,_0x471eb2){_0x534692=_0x534692-0x0;var _0x41239e=_0x9ead[_0x534692];return _0x41239e;};'use strict';function Trunk(_0x2f69be){this['id']=_0x2f69be['id']||0x0;this[_0xd9ea('0x0')]=_0x2f69be[_0xd9ea('0x0')]||![];this[_0xd9ea('0x1')]=_0x2f69be[_0xd9ea('0x1')]||'';this['state']=_0xd9ea('0x2');this[_0xd9ea('0x3')]=0x0;this[_0xd9ea('0x4')]=_0xd9ea('0x2');this[_0xd9ea('0x5')]=_0x2f69be[_0xd9ea('0x5')]&&_0x2f69be[_0xd9ea('0x5')][_0xd9ea('0x6')](':')?_0x2f69be[_0xd9ea('0x5')]['split'](':')[0x0]:'';this['host']='';this['port']='';this[_0xd9ea('0x7')]='';this[_0xd9ea('0x8')]='';this[_0xd9ea('0x9')]='';this[_0xd9ea('0xa')]=_0xd9ea('0x2');this[_0xd9ea('0xb')]='';this[_0xd9ea('0xc')]='';}module['exports']=Trunk; \ No newline at end of file +var _0x7f96=['unknown','stateTime','status','registry','indexOf','host','port','domainport','refresh','stateRegistry','registrationtime','address','active','name','state'];(function(_0x574162,_0x2425ea){var _0x39c245=function(_0x46653f){while(--_0x46653f){_0x574162['push'](_0x574162['shift']());}};_0x39c245(++_0x2425ea);}(_0x7f96,0x1a1));var _0x67f9=function(_0x3be708,_0x127f68){_0x3be708=_0x3be708-0x0;var _0x3c5ca3=_0x7f96[_0x3be708];return _0x3c5ca3;};'use strict';function Trunk(_0x1e9131){this['id']=_0x1e9131['id']||0x0;this['active']=_0x1e9131[_0x67f9('0x0')]||![];this[_0x67f9('0x1')]=_0x1e9131[_0x67f9('0x1')]||'';this[_0x67f9('0x2')]=_0x67f9('0x3');this[_0x67f9('0x4')]=0x0;this[_0x67f9('0x5')]=_0x67f9('0x3');this[_0x67f9('0x6')]=_0x1e9131[_0x67f9('0x6')]&&_0x1e9131[_0x67f9('0x6')][_0x67f9('0x7')](':')?_0x1e9131[_0x67f9('0x6')]['split'](':')[0x0]:'';this[_0x67f9('0x8')]='';this[_0x67f9('0x9')]='';this['domain']='';this[_0x67f9('0xa')]='';this[_0x67f9('0xb')]='';this[_0x67f9('0xc')]=_0x67f9('0x3');this[_0x67f9('0xd')]='';this[_0x67f9('0xe')]='';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index d0f9695..d3354c4 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 _0x12c3=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x2c34ff,_0x1e8bee){var _0x476508=function(_0x3e50db){while(--_0x3e50db){_0x2c34ff['push'](_0x2c34ff['shift']());}};_0x476508(++_0x1e8bee);}(_0x12c3,0x1b0));var _0x312c=function(_0xeac163,_0x3a1989){_0xeac163=_0xeac163-0x0;var _0x311b77=_0x12c3[_0xeac163];return _0x311b77;};'use strict';function voiceExtension(_0x5c41e2){this['id']=_0x5c41e2['id']||0x0;this[_0x312c('0x0')]=_0x5c41e2[_0x312c('0x0')]||'';this[_0x312c('0x1')]=_0x5c41e2[_0x312c('0x1')]||_0x312c('0x2');this[_0x312c('0x3')]=_0x5c41e2[_0x312c('0x3')]||![];}module[_0x312c('0x4')]=voiceExtension; \ No newline at end of file +var _0xf635=['none','mandatoryDisposition','exten','recordingFormat'];(function(_0x38fb8b,_0x70dd0a){var _0x1ec681=function(_0x58f130){while(--_0x58f130){_0x38fb8b['push'](_0x38fb8b['shift']());}};_0x1ec681(++_0x70dd0a);}(_0xf635,0x6a));var _0x5f63=function(_0x9ff1c0,_0x207afc){_0x9ff1c0=_0x9ff1c0-0x0;var _0x3e6c23=_0xf635[_0x9ff1c0];return _0x3e6c23;};'use strict';function voiceExtension(_0x373c51){this['id']=_0x373c51['id']||0x0;this[_0x5f63('0x0')]=_0x373c51[_0x5f63('0x0')]||'';this[_0x5f63('0x1')]=_0x373c51[_0x5f63('0x1')]||_0x5f63('0x2');this[_0x5f63('0x3')]=_0x373c51[_0x5f63('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 976796a..484045b 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 _0x27ab=['dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','busy','unavailable','ringing','ringinuse','onhold','wav','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry'];(function(_0x1308d8,_0xffac1b){var _0x265703=function(_0x34e059){while(--_0x34e059){_0x1308d8['push'](_0x1308d8['shift']());}};_0x265703(++_0xffac1b);}(_0x27ab,0x11c));var _0xb27a=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x27ab[_0x5037ab];return _0x512adb;};'use strict';var statusDesc=['unknown',_0xb27a('0x0'),_0xb27a('0x1'),_0xb27a('0x2'),'invalid',_0xb27a('0x3'),_0xb27a('0x4'),_0xb27a('0x5'),_0xb27a('0x6')];var monitorFormat={'wav':_0xb27a('0x7'),'wav49':'wav49','gsm':_0xb27a('0x8')};var strategy={'rrmemory':_0xb27a('0x9'),'roundrobin':_0xb27a('0xa')};function VoiceQueue(_0x31c21e){this['id']=_0x31c21e['id']||0x0;this[_0xb27a('0xb')]=_0x31c21e['name']||'';this[_0xb27a('0xc')]=_0x31c21e[_0xb27a('0xc')]||'';this['type']=_0x31c21e[_0xb27a('0xd')]||_0xb27a('0xe');this[_0xb27a('0xf')]=0x0;this[_0xb27a('0x10')]=0x0;this[_0xb27a('0x11')]=0x0;this[_0xb27a('0x12')]=0x0;this[_0xb27a('0x13')]=0x0;this[_0xb27a('0x14')]=0x0;this[_0xb27a('0x15')]=0x0;this[_0xb27a('0x16')]=0x0;this[_0xb27a('0x17')]=0x0;this['loggedIn']=0x0;this[_0xb27a('0x18')]=0x0;this[_0xb27a('0x19')]=_0x31c21e['acw']||![];this[_0xb27a('0x1a')]=_0x31c21e[_0xb27a('0x1a')]||0xa;this[_0xb27a('0x1b')]=_0x31c21e[_0xb27a('0x1b')]||'no';this[_0xb27a('0x1c')]=!![];this['message']='';this[_0xb27a('0x1d')]=0x0;this[_0xb27a('0x1e')]=0x0;this[_0xb27a('0x1f')]=_0x31c21e[_0xb27a('0x1f')]||null;this[_0xb27a('0x20')]=_0x31c21e[_0xb27a('0x20')]?_0x31c21e[_0xb27a('0x20')]:null;this[_0xb27a('0x21')]=_0x31c21e['dialActive'];this[_0xb27a('0x22')]=_0x31c21e[_0xb27a('0x22')]||_0xb27a('0x23');this[_0xb27a('0x24')]=_0x31c21e['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x31c21e['dialLimitQueue']||0x0;this[_0xb27a('0x25')]=_0x31c21e[_0xb27a('0x25')]||0x1;this['dialPredictiveOptimization']=_0x31c21e[_0xb27a('0x26')]||_0xb27a('0x27');this[_0xb27a('0x28')]=_0x31c21e['dialPredictiveOptimizationPercentage']||0.03;this[_0xb27a('0x29')]=_0x31c21e[_0xb27a('0x29')]||0x258;this[_0xb27a('0x2a')]=_0x31c21e[_0xb27a('0x2a')]||_0xb27a('0x2b');this[_0xb27a('0x2c')]=_0x31c21e[_0xb27a('0x2c')]||_0xb27a('0x2b');this[_0xb27a('0x2d')]=_0x31c21e['dialOriginateTimeout']||0x1e;this[_0xb27a('0x2e')]=_0x31c21e[_0xb27a('0x2e')]||_0xb27a('0x2f');this[_0xb27a('0x30')]=_0x31c21e[_0xb27a('0x30')]||0x3;this[_0xb27a('0x31')]=_0x31c21e['dialQueueProject']||undefined;this[_0xb27a('0x32')]=_0x31c21e[_0xb27a('0x32')]||0x3;this[_0xb27a('0x33')]=_0x31c21e[_0xb27a('0x33')]||0x96;this['dialBusyMaxRetry']=_0x31c21e[_0xb27a('0x34')]||0x3;this[_0xb27a('0x35')]=_0x31c21e[_0xb27a('0x35')]||0x96;this[_0xb27a('0x36')]=_0x31c21e[_0xb27a('0x36')]||0x3;this[_0xb27a('0x37')]=_0x31c21e[_0xb27a('0x37')]||0x96;this['dialGlobalMaxRetry']=_0x31c21e[_0xb27a('0x38')]||0x4;this[_0xb27a('0x39')]=_0x31c21e[_0xb27a('0x39')]?_0x31c21e[_0xb27a('0x39')]:undefined;this[_0xb27a('0x3a')]=_0x31c21e[_0xb27a('0x3a')]?_0x31c21e[_0xb27a('0x3a')]:undefined;this['dialPrefix']=_0x31c21e['dialPrefix']||undefined;this[_0xb27a('0x3b')]=_0x31c21e['Interval']?_0x31c21e['Interval']:undefined;this['dialOrderByScheduledAt']=_0x31c21e[_0xb27a('0x3c')]||'DESC';this[_0xb27a('0x3d')]=_0x31c21e['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xb27a('0x3e')]=_0x31c21e[_0xb27a('0x3e')]||undefined;this[_0xb27a('0x3f')]=strategy[_0x31c21e[_0xb27a('0x3f')]]||'rrmemory';this[_0xb27a('0x40')]=!![];this[_0xb27a('0x41')]=_0x31c21e[_0xb27a('0x41')]||![];this[_0xb27a('0x42')]=_0x31c21e['dialAMDInitialSilence'];this[_0xb27a('0x43')]=_0x31c21e['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x31c21e[_0xb27a('0x44')];this[_0xb27a('0x45')]=_0x31c21e[_0xb27a('0x45')];this[_0xb27a('0x46')]=_0x31c21e[_0xb27a('0x46')];this['dialAMDBetweenWordsSilence']=_0x31c21e[_0xb27a('0x47')];this[_0xb27a('0x48')]=_0x31c21e[_0xb27a('0x48')];this[_0xb27a('0x49')]=_0x31c21e[_0xb27a('0x49')];this[_0xb27a('0x4a')]=_0x31c21e[_0xb27a('0x4a')];this[_0xb27a('0x4b')]=0x0;this[_0xb27a('0x4c')]=0x0;this[_0xb27a('0x4d')]=_0x31c21e[_0xb27a('0x4d')];this['outboundAnswerCallsDay']=0x0;this[_0xb27a('0x4e')]=0x0;this[_0xb27a('0x4f')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0xb27a('0x50')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0xb27a('0x51')]=0x0;this[_0xb27a('0x52')]=0x0;this[_0xb27a('0x53')]=0x0;this[_0xb27a('0x54')]=0x0;this[_0xb27a('0x55')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xb27a('0x56')]=0x0;this['startProgressive']=undefined;this[_0xb27a('0x57')]=undefined;this[_0xb27a('0x58')]=undefined;this[_0xb27a('0x59')]=1.05;this[_0xb27a('0x5a')]=0x0;this[_0xb27a('0x5b')]=0x0;this[_0xb27a('0x5c')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xb27a('0x5d')]=0x0;this[_0xb27a('0x5e')]=0x0;this[_0xb27a('0x5f')]=0x0;this[_0xb27a('0x60')]=0x0;this[_0xb27a('0x61')]=_0x31c21e[_0xb27a('0x62')]||0x14;this[_0xb27a('0x63')]=_0x31c21e[_0xb27a('0x62')]||0xa;this[_0xb27a('0x64')]=0x0;this[_0xb27a('0x65')]=0x0;this[_0xb27a('0x66')]=0x1;this[_0xb27a('0x67')]=0x0;this[_0xb27a('0x68')]=0x0;this[_0xb27a('0x69')]=0x0;this['erlangBusyFactor']=0x0;this[_0xb27a('0x6a')]=_0x31c21e[_0xb27a('0x6a')]||0x1e;this[_0xb27a('0x6b')]=_0x31c21e[_0xb27a('0x6b')]||![];this['dialQueueProject2']=_0x31c21e[_0xb27a('0x6c')]||undefined;this['dialAgiAfterHangupClient']=_0x31c21e['dialAgiAfterHangupClient']||![];this[_0xb27a('0x6d')]=_0x31c21e[_0xb27a('0x6d')]||![];this[_0xb27a('0xc')]=monitorFormat[_0x31c21e[_0xb27a('0xc')]]?monitorFormat[_0x31c21e['monitor_format']]:undefined;this['mandatoryDisposition']=_0x31c21e[_0xb27a('0x6e')]||![];this[_0xb27a('0x6f')]=_0x31c21e[_0xb27a('0x6f')]?_0x31c21e['mandatoryDispositionPause']:undefined;}module[_0xb27a('0x70')]=VoiceQueue; \ No newline at end of file +var _0x8a34=['dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','busy','invalid','ringing','ringinuse','wav','roundrobin','name','monitor_format','type','inbound','talking','total','answered','sumDuration','sumHoldTime','sumBillable','loggedIn','available','acw','acwTimeout','autopause','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive'];(function(_0x22b1b7,_0x20c3c0){var _0x42fc1d=function(_0x113ab0){while(--_0x113ab0){_0x22b1b7['push'](_0x22b1b7['shift']());}};_0x42fc1d(++_0x20c3c0);}(_0x8a34,0x1f1));var _0x48a3=function(_0x142ec2,_0x5bb03d){_0x142ec2=_0x142ec2-0x0;var _0x45ef4e=_0x8a34[_0x142ec2];return _0x45ef4e;};'use strict';var statusDesc=[_0x48a3('0x0'),'not_inuse','inuse',_0x48a3('0x1'),_0x48a3('0x2'),'unavailable',_0x48a3('0x3'),_0x48a3('0x4'),'onhold'];var monitorFormat={'wav':_0x48a3('0x5'),'wav49':'wav49','gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':_0x48a3('0x6')};function VoiceQueue(_0x282320){this['id']=_0x282320['id']||0x0;this[_0x48a3('0x7')]=_0x282320[_0x48a3('0x7')]||'';this[_0x48a3('0x8')]=_0x282320[_0x48a3('0x8')]||'';this[_0x48a3('0x9')]=_0x282320[_0x48a3('0x9')]||_0x48a3('0xa');this['waiting']=0x0;this[_0x48a3('0xb')]=0x0;this[_0x48a3('0xc')]=0x0;this[_0x48a3('0xd')]=0x0;this[_0x48a3('0xe')]=0x0;this[_0x48a3('0xf')]=0x0;this[_0x48a3('0x10')]=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0x48a3('0x11')]=0x0;this[_0x48a3('0x12')]=0x0;this[_0x48a3('0x13')]=_0x282320[_0x48a3('0x13')]||![];this[_0x48a3('0x14')]=_0x282320[_0x48a3('0x14')]||0xa;this[_0x48a3('0x15')]=_0x282320[_0x48a3('0x15')]||'no';this['sendMessageOneNotActive']=!![];this[_0x48a3('0x16')]='';this[_0x48a3('0x17')]=0x0;this[_0x48a3('0x18')]=0x0;this[_0x48a3('0x19')]=_0x282320[_0x48a3('0x19')]||null;this[_0x48a3('0x1a')]=_0x282320[_0x48a3('0x1a')]?_0x282320[_0x48a3('0x1a')]:null;this[_0x48a3('0x1b')]=_0x282320[_0x48a3('0x1b')];this[_0x48a3('0x1c')]=_0x282320[_0x48a3('0x1c')]||'progressive';this[_0x48a3('0x1d')]=_0x282320[_0x48a3('0x1d')]||0x0;this[_0x48a3('0x1e')]=_0x282320[_0x48a3('0x1e')]||0x0;this[_0x48a3('0x1f')]=_0x282320[_0x48a3('0x1f')]||0x1;this['dialPredictiveOptimization']=_0x282320[_0x48a3('0x20')]||_0x48a3('0x21');this['dialPredictiveOptimizationPercentage']=_0x282320[_0x48a3('0x22')]||0.03;this[_0x48a3('0x23')]=_0x282320[_0x48a3('0x23')]||0x258;this['dialOriginateCallerIdName']=_0x282320[_0x48a3('0x24')]||_0x48a3('0x25');this[_0x48a3('0x26')]=_0x282320[_0x48a3('0x26')]||'anonymous';this[_0x48a3('0x27')]=_0x282320['dialOriginateTimeout']||0x1e;this[_0x48a3('0x28')]=_0x282320['dialQueueOptions']||_0x48a3('0x29');this[_0x48a3('0x2a')]=_0x282320[_0x48a3('0x2a')]||0x3;this[_0x48a3('0x2b')]=_0x282320[_0x48a3('0x2b')]||undefined;this[_0x48a3('0x2c')]=_0x282320[_0x48a3('0x2c')]||0x3;this[_0x48a3('0x2d')]=_0x282320[_0x48a3('0x2d')]||0x96;this[_0x48a3('0x2e')]=_0x282320[_0x48a3('0x2e')]||0x3;this[_0x48a3('0x2f')]=_0x282320['dialBusyRetryFrequency']||0x96;this[_0x48a3('0x30')]=_0x282320[_0x48a3('0x30')]||0x3;this['dialNoAnswerRetryFrequency']=_0x282320[_0x48a3('0x31')]||0x96;this[_0x48a3('0x32')]=_0x282320[_0x48a3('0x32')]||0x4;this['Trunk']=_0x282320[_0x48a3('0x33')]?_0x282320[_0x48a3('0x33')]:undefined;this[_0x48a3('0x34')]=_0x282320['TrunkBackup']?_0x282320[_0x48a3('0x34')]:undefined;this[_0x48a3('0x35')]=_0x282320[_0x48a3('0x35')]||undefined;this[_0x48a3('0x36')]=_0x282320['Interval']?_0x282320['Interval']:undefined;this[_0x48a3('0x37')]=_0x282320[_0x48a3('0x37')]||_0x48a3('0x38');this['dialRandomLastDigitCallerIdNumber']=_0x282320[_0x48a3('0x39')]||undefined;this[_0x48a3('0x3a')]=_0x282320[_0x48a3('0x3a')]||undefined;this[_0x48a3('0x3b')]=strategy[_0x282320[_0x48a3('0x3b')]]||'rrmemory';this['queueStatusComplete']=!![];this[_0x48a3('0x3c')]=_0x282320[_0x48a3('0x3c')]||![];this[_0x48a3('0x3d')]=_0x282320['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x282320[_0x48a3('0x3e')];this[_0x48a3('0x3f')]=_0x282320[_0x48a3('0x3f')];this[_0x48a3('0x40')]=_0x282320[_0x48a3('0x40')];this[_0x48a3('0x41')]=_0x282320[_0x48a3('0x41')];this['dialAMDBetweenWordsSilence']=_0x282320[_0x48a3('0x42')];this[_0x48a3('0x43')]=_0x282320[_0x48a3('0x43')];this[_0x48a3('0x44')]=_0x282320['dialAMDSilenceThreshold'];this[_0x48a3('0x45')]=_0x282320[_0x48a3('0x45')];this[_0x48a3('0x46')]=0x0;this['pTalking']=0x0;this['timeout']=_0x282320[_0x48a3('0x47')];this[_0x48a3('0x48')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x48a3('0x49')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x48a3('0x4a')]=0x0;this[_0x48a3('0x4b')]=0x0;this[_0x48a3('0x4c')]=0x0;this[_0x48a3('0x4d')]=0x0;this[_0x48a3('0x4e')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0x48a3('0x4f')]=undefined;this[_0x48a3('0x50')]=undefined;this[_0x48a3('0x51')]=undefined;this[_0x48a3('0x52')]=1.05;this[_0x48a3('0x53')]=0x0;this[_0x48a3('0x54')]=0x0;this[_0x48a3('0x55')]=0x0;this[_0x48a3('0x56')]=0x0;this[_0x48a3('0x57')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x48a3('0x58')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x48a3('0x59')]=_0x282320[_0x48a3('0x5a')]||0x14;this[_0x48a3('0x5b')]=_0x282320[_0x48a3('0x5a')]||0xa;this[_0x48a3('0x5c')]=0x0;this[_0x48a3('0x5d')]=0x0;this[_0x48a3('0x5e')]=0x1;this[_0x48a3('0x5f')]=0x0;this[_0x48a3('0x60')]=0x0;this[_0x48a3('0x61')]=0x0;this[_0x48a3('0x62')]=0x0;this[_0x48a3('0x63')]=_0x282320['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x282320[_0x48a3('0x64')]||![];this[_0x48a3('0x65')]=_0x282320[_0x48a3('0x65')]||undefined;this['dialAgiAfterHangupClient']=_0x282320['dialAgiAfterHangupClient']||![];this[_0x48a3('0x66')]=_0x282320[_0x48a3('0x66')]||![];this[_0x48a3('0x8')]=monitorFormat[_0x282320['monitor_format']]?monitorFormat[_0x282320[_0x48a3('0x8')]]:undefined;this['mandatoryDisposition']=_0x282320[_0x48a3('0x67')]||![];this['mandatoryDispositionPause']=_0x282320[_0x48a3('0x68')]?_0x282320[_0x48a3('0x68')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 3ed56b8..82d3fd3 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 _0x5131=['accessKey','serverUrl','exports','name','username'];(function(_0x36acb3,_0x204e94){var _0x13976c=function(_0x4371dd){while(--_0x4371dd){_0x36acb3['push'](_0x36acb3['shift']());}};_0x13976c(++_0x204e94);}(_0x5131,0x120));var _0x1513=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x5131[_0x1ac595];return _0x455fff;};'use strict';function VtigerAccount(_0x56bbca){this['id']=_0x56bbca['id']||0x0;this[_0x1513('0x0')]=_0x56bbca[_0x1513('0x0')]||'';this['username']=_0x56bbca[_0x1513('0x1')]||'';this[_0x1513('0x2')]=_0x56bbca['accessKey']||'';this['remoteUri']=_0x56bbca['remoteUri']||'';this[_0x1513('0x3')]=_0x56bbca[_0x1513('0x3')]||'';this['Configurations']=_0x56bbca['Configurations']||{};}module[_0x1513('0x4')]=VtigerAccount; \ No newline at end of file +var _0x89b4=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x3a2e49,_0x21ebea){var _0x257140=function(_0x5a2362){while(--_0x5a2362){_0x3a2e49['push'](_0x3a2e49['shift']());}};_0x257140(++_0x21ebea);}(_0x89b4,0xac));var _0x489b=function(_0x3bf506,_0x1bf7b4){_0x3bf506=_0x3bf506-0x0;var _0x286d9f=_0x89b4[_0x3bf506];return _0x286d9f;};'use strict';function VtigerAccount(_0xf4050e){this['id']=_0xf4050e['id']||0x0;this[_0x489b('0x0')]=_0xf4050e['name']||'';this[_0x489b('0x1')]=_0xf4050e[_0x489b('0x1')]||'';this['accessKey']=_0xf4050e[_0x489b('0x2')]||'';this[_0x489b('0x3')]=_0xf4050e[_0x489b('0x3')]||'';this[_0x489b('0x4')]=_0xf4050e['serverUrl']||'';this['Configurations']=_0xf4050e[_0x489b('0x5')]||{};}module[_0x489b('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 6a500c4..a2c5975 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 _0xecb2=['token','remoteUri','authType','integrationTab','serverUrl','Configurations','username','password'];(function(_0x152aa1,_0x307718){var _0x1bc01a=function(_0xd3211e){while(--_0xd3211e){_0x152aa1['push'](_0x152aa1['shift']());}};_0x1bc01a(++_0x307718);}(_0xecb2,0xf6));var _0x2ecb=function(_0x333dac,_0x2dc1ed){_0x333dac=_0x333dac-0x0;var _0x1944fa=_0xecb2[_0x333dac];return _0x1944fa;};'use strict';function ZendeskAccount(_0x23adc7){this['id']=_0x23adc7['id']||0x0;this['name']=_0x23adc7['name']||'';this[_0x2ecb('0x0')]=_0x23adc7['username']||'';this['password']=_0x23adc7[_0x2ecb('0x1')]||'';this[_0x2ecb('0x2')]=_0x23adc7[_0x2ecb('0x2')]||'';this[_0x2ecb('0x3')]=_0x23adc7[_0x2ecb('0x3')]||'';this[_0x2ecb('0x4')]=_0x23adc7['authType']||'';this['type']=_0x23adc7['type']||_0x2ecb('0x5');this[_0x2ecb('0x6')]=_0x23adc7[_0x2ecb('0x6')]||'';this[_0x2ecb('0x7')]=_0x23adc7[_0x2ecb('0x7')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x5bc9=['integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType','type'];(function(_0x53e83e,_0x42d1d4){var _0x34ef76=function(_0x56d5b){while(--_0x56d5b){_0x53e83e['push'](_0x53e83e['shift']());}};_0x34ef76(++_0x42d1d4);}(_0x5bc9,0x93));var _0x95bc=function(_0x43b052,_0x234432){_0x43b052=_0x43b052-0x0;var _0x1573fe=_0x5bc9[_0x43b052];return _0x1573fe;};'use strict';function ZendeskAccount(_0x4afd45){this['id']=_0x4afd45['id']||0x0;this[_0x95bc('0x0')]=_0x4afd45[_0x95bc('0x0')]||'';this[_0x95bc('0x1')]=_0x4afd45[_0x95bc('0x1')]||'';this[_0x95bc('0x2')]=_0x4afd45[_0x95bc('0x2')]||'';this[_0x95bc('0x3')]=_0x4afd45[_0x95bc('0x3')]||'';this['remoteUri']=_0x4afd45[_0x95bc('0x4')]||'';this[_0x95bc('0x5')]=_0x4afd45['authType']||'';this[_0x95bc('0x6')]=_0x4afd45[_0x95bc('0x6')]||_0x95bc('0x7');this['serverUrl']=_0x4afd45[_0x95bc('0x8')]||'';this[_0x95bc('0x9')]=_0x4afd45[_0x95bc('0x9')]||{};}module[_0x95bc('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index b8927f2..d9048bb 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 _0x48cf=['clientSecret','code','refreshToken','Configurations','exports','name','description','zone','clientId'];(function(_0x5b4a3a,_0x2b6564){var _0x5e9e69=function(_0x52c917){while(--_0x52c917){_0x5b4a3a['push'](_0x5b4a3a['shift']());}};_0x5e9e69(++_0x2b6564);}(_0x48cf,0x11c));var _0xf48c=function(_0xb7aca2,_0x583234){_0xb7aca2=_0xb7aca2-0x0;var _0x281f39=_0x48cf[_0xb7aca2];return _0x281f39;};'use strict';function ZohoAccount(_0x3c42c8){this['id']=_0x3c42c8['id']||0x0;this[_0xf48c('0x0')]=_0x3c42c8[_0xf48c('0x0')]||'';this['description']=_0x3c42c8[_0xf48c('0x1')]||'';this['host']=_0x3c42c8['host']||'';this[_0xf48c('0x2')]=_0x3c42c8[_0xf48c('0x2')]||'';this[_0xf48c('0x3')]=_0x3c42c8['clientId']||'';this['clientSecret']=_0x3c42c8[_0xf48c('0x4')]||'';this['serverUrl']=_0x3c42c8['serverUrl']||'';this['code']=_0x3c42c8[_0xf48c('0x5')]||'';this[_0xf48c('0x6')]=_0x3c42c8['refreshToken']||'';this[_0xf48c('0x7')]=_0x3c42c8[_0xf48c('0x7')]||{};}module[_0xf48c('0x8')]=ZohoAccount; \ No newline at end of file +var _0x8dc1=['clientId','clientSecret','code','refreshToken','Configurations','name','description','host','zone'];(function(_0x2bfddb,_0x13497d){var _0x51e0b6=function(_0x3242d2){while(--_0x3242d2){_0x2bfddb['push'](_0x2bfddb['shift']());}};_0x51e0b6(++_0x13497d);}(_0x8dc1,0x12e));var _0x18dc=function(_0x1f2705,_0x4a4501){_0x1f2705=_0x1f2705-0x0;var _0x122ffc=_0x8dc1[_0x1f2705];return _0x122ffc;};'use strict';function ZohoAccount(_0x4d59ff){this['id']=_0x4d59ff['id']||0x0;this[_0x18dc('0x0')]=_0x4d59ff[_0x18dc('0x0')]||'';this['description']=_0x4d59ff[_0x18dc('0x1')]||'';this[_0x18dc('0x2')]=_0x4d59ff[_0x18dc('0x2')]||'';this['zone']=_0x4d59ff[_0x18dc('0x3')]||'';this[_0x18dc('0x4')]=_0x4d59ff['clientId']||'';this[_0x18dc('0x5')]=_0x4d59ff[_0x18dc('0x5')]||'';this['serverUrl']=_0x4d59ff['serverUrl']||'';this[_0x18dc('0x6')]=_0x4d59ff['code']||'';this[_0x18dc('0x7')]=_0x4d59ff[_0x18dc('0x7')]||'';this[_0x18dc('0x8')]=_0x4d59ff[_0x18dc('0x8')]||{};}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 9c520ec..332fa98 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 _0x272b=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','membername','Agent','channelAgent','format','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat'];(function(_0x8b8564,_0x162976){var _0x360c61=function(_0x164cc9){while(--_0x164cc9){_0x8b8564['push'](_0x8b8564['shift']());}};_0x360c61(++_0x162976);}(_0x272b,0x183));var _0xb272=function(_0x3e8802,_0x2bd819){_0x3e8802=_0x3e8802-0x0;var _0x26d594=_0x272b[_0x3e8802];return _0x26d594;};'use strict';var util=require(_0xb272('0x0'));var _=require(_0xb272('0x1'));var moment=require(_0xb272('0x2'));function checkNameSurname(_0x37102f,_0x4b57b1,_0x42cee4){var _0xf922c5='';if(!_[_0xb272('0x3')](_0x4b57b1)&&_0xb272('0x4')===typeof _0x4b57b1){_0xf922c5+=_0x4b57b1;}if(!_[_0xb272('0x3')](_0x42cee4)&&_0xb272('0x4')===typeof _0x42cee4){_0xf922c5+='\x20'+_0x42cee4;}if(_0xf922c5!==''){return _0xf922c5;}return _0x37102f;}function Action(_0x2128f9,_0x381db1,_0x57fab5,_0x5b5795,_0x345163){this[_0xb272('0x5')]=_0x57fab5||undefined;this[_0xb272('0x6')]=_0x2128f9['id'];this[_0xb272('0x7')]=_0x381db1[_0xb272('0x8')];this[_0xb272('0x9')]=_0x381db1[_0xb272('0x9')];this[_0xb272('0xa')]=_0xb272('0x7');this['dialAnswer']=![];this[_0xb272('0xb')]=_[_0xb272('0x3')](_0x2128f9[_0xb272('0xc')])?undefined:_0x2128f9[_0xb272('0xc')]['name'];this[_0xb272('0xd')]=this['membername']?util[_0xb272('0xe')]('SIP/%s',this[_0xb272('0xb')]):_0x5b5795||undefined;this[_0xb272('0xf')]=checkNameSurname(_0x2128f9[_0xb272('0x10')][_0xb272('0x11')],_0x2128f9[_0xb272('0x10')][_0xb272('0x12')],_0x2128f9[_0xb272('0x10')][_0xb272('0x13')]);this['active']=_0x2128f9[_0xb272('0x14')]||![];this[_0xb272('0x15')]=_0x2128f9[_0xb272('0x10')][_0xb272('0x11')];this[_0xb272('0x16')]=_0x2128f9[_0xb272('0x16')];this[_0xb272('0x17')]=_0x2128f9[_0xb272('0x17')]||0x0;this[_0xb272('0x18')]=_0x2128f9['countcongestionretry']||0x0;this[_0xb272('0x19')]=_0x2128f9[_0xb272('0x19')]||0x0;this[_0xb272('0x1a')]=(_0x2128f9[_0xb272('0x17')]||0x0)+(_0x2128f9[_0xb272('0x18')]||0x0)+(_0x2128f9[_0xb272('0x19')]||0x0);this[_0xb272('0x1b')]=_0x2128f9[_0xb272('0x1b')];this[_0xb272('0x1c')]=_0x2128f9[_0xb272('0x1c')];this['callbackat']=_0x2128f9[_0xb272('0x1d')];this[_0xb272('0x1e')]=_0x2128f9[_0xb272('0x1e')];this[_0xb272('0x1f')]=_0x2128f9[_0xb272('0x1f')];this['ListId']=_0x2128f9['ListId'];this['UserId']=_[_0xb272('0x3')](_0x2128f9[_0xb272('0xc')])?_0x2128f9[_0xb272('0x20')]:_0x2128f9[_0xb272('0xc')]['id'];this[_0xb272('0x21')]=_0x2128f9[_0xb272('0x21')];this[_0xb272('0x22')]='';this[_0xb272('0x23')]='';}Action[_0xb272('0x24')][_0xb272('0x25')]=function(){return util[_0xb272('0xe')](_0xb272('0x26'),this[_0xb272('0xf')],this[_0xb272('0x27')]);};module[_0xb272('0x28')]=Action; \ No newline at end of file +var _0x1559=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','format','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil','string','uniqueid','queue','name','type','campaigntype','Agent','membername','calleridname','phone','Contact','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid'];(function(_0x16ae01,_0x198e7d){var _0x2d73f9=function(_0x4d5f9f){while(--_0x4d5f9f){_0x16ae01['push'](_0x16ae01['shift']());}};_0x2d73f9(++_0x198e7d);}(_0x1559,0x188));var _0x9155=function(_0x4ed9ef,_0x381176){_0x4ed9ef=_0x4ed9ef-0x0;var _0x2bb85b=_0x1559[_0x4ed9ef];return _0x2bb85b;};'use strict';var util=require(_0x9155('0x0'));var _=require(_0x9155('0x1'));var moment=require(_0x9155('0x2'));function checkNameSurname(_0x18a0bb,_0x2c4e09,_0x46a933){var _0x5ebf81='';if(!_[_0x9155('0x3')](_0x2c4e09)&&'string'===typeof _0x2c4e09){_0x5ebf81+=_0x2c4e09;}if(!_[_0x9155('0x3')](_0x46a933)&&_0x9155('0x4')===typeof _0x46a933){_0x5ebf81+='\x20'+_0x46a933;}if(_0x5ebf81!==''){return _0x5ebf81;}return _0x18a0bb;}function Action(_0x3dea09,_0x16667c,_0x3b3def,_0x4281fe,_0x481666){this[_0x9155('0x5')]=_0x3b3def||undefined;this['idContact']=_0x3dea09['id'];this[_0x9155('0x6')]=_0x16667c[_0x9155('0x7')];this[_0x9155('0x8')]=_0x16667c[_0x9155('0x8')];this[_0x9155('0x9')]=_0x9155('0x6');this['dialAnswer']=![];this['membername']=_[_0x9155('0x3')](_0x3dea09['Agent'])?undefined:_0x3dea09[_0x9155('0xa')]['name'];this['channelAgent']=this['membername']?util['format']('SIP/%s',this[_0x9155('0xb')]):_0x4281fe||undefined;this[_0x9155('0xc')]=checkNameSurname(_0x3dea09['Contact'][_0x9155('0xd')],_0x3dea09[_0x9155('0xe')][_0x9155('0xf')],_0x3dea09[_0x9155('0xe')][_0x9155('0x10')]);this['active']=_0x3dea09[_0x9155('0x11')]||![];this[_0x9155('0x12')]=_0x3dea09[_0x9155('0xe')][_0x9155('0xd')];this[_0x9155('0x13')]=_0x3dea09[_0x9155('0x13')];this[_0x9155('0x14')]=_0x3dea09[_0x9155('0x14')]||0x0;this[_0x9155('0x15')]=_0x3dea09[_0x9155('0x15')]||0x0;this[_0x9155('0x16')]=_0x3dea09['countnoanswerretry']||0x0;this[_0x9155('0x17')]=(_0x3dea09[_0x9155('0x14')]||0x0)+(_0x3dea09['countcongestionretry']||0x0)+(_0x3dea09[_0x9155('0x16')]||0x0);this[_0x9155('0x18')]=_0x3dea09[_0x9155('0x18')];this[_0x9155('0x19')]=_0x3dea09[_0x9155('0x19')];this[_0x9155('0x1a')]=_0x3dea09[_0x9155('0x1a')];this[_0x9155('0x1b')]=_0x3dea09['recallme'];this['ContactId']=_0x3dea09[_0x9155('0x1c')];this[_0x9155('0x1d')]=_0x3dea09[_0x9155('0x1d')];this['UserId']=_['isNil'](_0x3dea09[_0x9155('0xa')])?_0x3dea09[_0x9155('0x1e')]:_0x3dea09[_0x9155('0xa')]['id'];this[_0x9155('0x1f')]=_0x3dea09['VoiceQueueId'];this[_0x9155('0x20')]='';this['originatecalleridname']='';}Action[_0x9155('0x21')][_0x9155('0x22')]=function(){return util[_0x9155('0x23')](_0x9155('0x24'),this['calleridname'],this['number']);};module[_0x9155('0x25')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 6122558..4311c59 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 _0xea70=['merge','toLowerVariables','[originateFailure][logOriginateFailure]','syncNewExten','channel','actionid','lookAgent','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','addVariable','variables','keys','variable','value','error','inspect','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','./action','./util/util','defaults','redis','localhost','socket.io-emitter','enqueue','tail','sequence','campaignsPreview','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','newexten','syncVarSet','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','outbound','strategy','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','dialMethod','dialOriginateCallerIdName','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','erlangCalls','erlangCallToSecond','startPredictive','Trunk','active','callerid','Interval','name','format','voice:queue:%s','voice_queue:save','voice_queue_channel:remove','sendMessageOneNotActive','originated','available','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20disactive','prototype','syncCampaigns','booked','clearZombieChannels','hasOwnProperty','dialActive','recallMe','isNil','info','[clearZombieChannels][talking]','Queue','queue','stringify','actions','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','catch','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','size','agentReadyId','length','getDiff','scheduledat','dialRecallMeTimeout','run','logger2','[RecallMe]','starttime','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','logCustomer','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','connect','acw','buildAcw','custom:agentcomplete','complete','buildObj','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','countbusyretry','Busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','rescheduleContact','scheduledAt','NOANSWER','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','activeContact','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','dialBusyRetryFrequency','unlockAgent','CANCEL','AgentReject','[syncHangupRequest][logAgentReject]','unlockContact','idContact','disableContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','originated:\x20','destlinkedid','isUndefined','reason','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','logAgent','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','execCall','then','[Preview][execCall][success]','\x20IdHopper:\x20','called','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','unlock','getContactPreview','recallme','isValid','checkIsBlackList','Contact.phone','logger','[Preview][getContactPreview]','validateContact','isEmpty','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','TrunkBackup','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialCutDigit','phone','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum'];(function(_0x2de6e7,_0x5343d6){var _0x46b7af=function(_0x4fbd0a){while(--_0x4fbd0a){_0x2de6e7['push'](_0x2de6e7['shift']());}};_0x46b7af(++_0x5343d6);}(_0xea70,0x159));var _0x0ea7=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xea70[_0x502c7d];return _0x30b7ed;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x0ea7('0x0'));var uuid=require(_0x0ea7('0x1'));var moment=require(_0x0ea7('0x2'));var md5=require(_0x0ea7('0x3'));var Redis=require(_0x0ea7('0x4'));var config=require(_0x0ea7('0x5'));var logger=require(_0x0ea7('0x6'))(_0x0ea7('0x7'));var loggerAction=require(_0x0ea7('0x6'))(_0x0ea7('0x8'));var ami=require('../ami');var rpcDb=require(_0x0ea7('0x9'));var Action=require(_0x0ea7('0xa'));var ut=require(_0x0ea7('0xb'));config['redis']=_[_0x0ea7('0xc')](config[_0x0ea7('0xd')],{'host':_0x0ea7('0xe'),'port':0x18eb});var io=require(_0x0ea7('0xf'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0x0ea7('0x10')]=function(_0xfa4211){this[_0x0ea7('0x11')]=this[_0x0ea7('0x11')]?this[_0x0ea7('0x11')]['finally'](_0xfa4211):_0xfa4211();};function Preview(_0x3847eb){this[_0x0ea7('0x12')]=new Sequence();this[_0x0ea7('0x13')]=_0x3847eb['voiceQueues'];this[_0x0ea7('0x14')]=_0x3847eb[_0x0ea7('0x14')];this['actions']={};this[_0x0ea7('0x15')]=_0x3847eb['agents'];this[_0x0ea7('0x16')]=0x0;ami['on'](_0x0ea7('0x17'),this[_0x0ea7('0x18')][_0x0ea7('0x19')](this));ami['on'](_0x0ea7('0x1a'),this[_0x0ea7('0x1b')][_0x0ea7('0x19')](this));ami['on'](_0x0ea7('0x1c'),this[_0x0ea7('0x1d')][_0x0ea7('0x19')](this));ami['on'](_0x0ea7('0x1e'),this['syncDialEnd']['bind'](this));ami['on'](_0x0ea7('0x1f'),this['syncNewExten'][_0x0ea7('0x19')](this));ami['on']('varset',this[_0x0ea7('0x20')][_0x0ea7('0x19')](this));ami['on']('attendedtransfer',this[_0x0ea7('0x21')]['bind'](this));ami['on'](_0x0ea7('0x22'),this['syncBlindTransfer'][_0x0ea7('0x19')](this));this[_0x0ea7('0x23')](this['campaignsPreview']);}function emit(_0x3f7d93,_0x322f4d,_0x578f79){io['to'](_0x3f7d93)[_0x0ea7('0x24')](_0x322f4d,_0x578f79);}function emitCampaignPreview(_0x559044){if(_0x559044['type']===_0x0ea7('0x25')){var _0x3522f7={'id':_0x559044['id'],'name':_0x559044['name'],'strategy':_0x559044[_0x0ea7('0x26')],'answered':_0x559044['answered'],'available':_0x559044['available'],'loggedIn':_0x559044[_0x0ea7('0x27')],'pTalking':_0x559044[_0x0ea7('0x28')],'sumBillable':_0x559044[_0x0ea7('0x29')],'sumDuration':_0x559044['sumDuration'],'sumHoldTime':_0x559044[_0x0ea7('0x2a')]||0x0,'talking':_0x559044[_0x0ea7('0x2b')],'total':_0x559044[_0x0ea7('0x2c')],'type':_0x559044[_0x0ea7('0x2d')],'unmanaged':_0x559044[_0x0ea7('0x2e')],'abandoned':_0x559044[_0x0ea7('0x2f')],'waiting':_0x559044[_0x0ea7('0x30')],'loggedInDb':_0x559044['loggedInDb'],'dialActive':_0x559044['dialActive'],'dialMethod':_0x559044[_0x0ea7('0x31')],'dialOriginateCallerIdName':_0x559044[_0x0ea7('0x32')],'dialOriginateCallerIdNumber':_0x559044['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x559044['dialOriginateTimeout'],'dialPrefix':_0x559044[_0x0ea7('0x33')],'outboundAnswerAgiCallsDay':_0x559044[_0x0ea7('0x34')],'outboundAnswerCallsDay':_0x559044[_0x0ea7('0x35')],'outboundBlacklistCallsDay':_0x559044[_0x0ea7('0x36')],'outboundBusyCallsDay':_0x559044[_0x0ea7('0x37')],'outboundCongestionCallsDay':_0x559044[_0x0ea7('0x38')],'outboundDropCallsDayACS':_0x559044[_0x0ea7('0x39')],'outboundDropCallsDayCallersExit':_0x559044[_0x0ea7('0x3a')],'outboundDropCallsDayTimeout':_0x559044[_0x0ea7('0x3b')],'outboundNoAnswerCallsDay':_0x559044[_0x0ea7('0x3c')],'outboundNoSuchCallsDay':_0x559044[_0x0ea7('0x3d')],'outboundOriginateFailureCallsDay':_0x559044['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x559044[_0x0ea7('0x3e')],'outboundRejectCallsDay':_0x559044[_0x0ea7('0x3f')],'outboundUnknownCallsDay':_0x559044[_0x0ea7('0x40')],'predictiveIntervalAnsweredCalls':_0x559044[_0x0ea7('0x41')],'predictiveIntervalAvgHoldtime':_0x559044[_0x0ea7('0x42')],'predictiveIntervalAvgTalktime':_0x559044[_0x0ea7('0x43')],'predictiveIntervalDroppedCallsCallersExit':_0x559044[_0x0ea7('0x44')],'predictiveIntervalDroppedCallsTimeout':_0x559044['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x559044[_0x0ea7('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x559044[_0x0ea7('0x46')],'predictiveIntervalHitRate':_0x559044['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x559044[_0x0ea7('0x47')],'predictiveIntervalPauses':_0x559044[_0x0ea7('0x48')],'predictiveIntervalAvailable':_0x559044['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x559044[_0x0ea7('0x49')],'message':_0x559044[_0x0ea7('0x4a')],'originated':_0x559044['originated'],'erlangCalls':_0x559044[_0x0ea7('0x4b')],'erlangCallToSecond':_0x559044[_0x0ea7('0x4c')],'erlangAbandonmentRate':_0x559044['erlangAbandonmentRate'],'erlangBusyFactor':_0x559044['erlangBusyFactor'],'startPredictive':_0x559044[_0x0ea7('0x4d')],'startProgressive':_0x559044['startProgressive']};if(_0x559044[_0x0ea7('0x4e')]){_0x3522f7[_0x0ea7('0x4e')]={'id':_0x559044['Trunk']['id'],'name':_0x559044[_0x0ea7('0x4e')]['name'],'active':_0x559044[_0x0ea7('0x4e')][_0x0ea7('0x4f')],'callerid':_0x559044[_0x0ea7('0x4e')][_0x0ea7('0x50')]};}if(_0x559044['Interval']){_0x3522f7[_0x0ea7('0x51')]={'id':_0x559044[_0x0ea7('0x51')]['id'],'name':_0x559044[_0x0ea7('0x51')][_0x0ea7('0x52')]};}var _0x16b99d=md5(JSON['stringify'](_0x3522f7));if(_0x559044['md5']!==_0x16b99d){_0x559044[_0x0ea7('0x3')]=_0x16b99d;emit(util[_0x0ea7('0x53')](_0x0ea7('0x54'),_0x3522f7[_0x0ea7('0x52')]),_0x0ea7('0x55'),_0x3522f7);}}}function emitVoiceQueueChannelRemove(_0xf6661e){emit(util['format']('voice:queue:%s',_0xf6661e[_0x0ea7('0x52')]),_0x0ea7('0x56'),_0xf6661e);}function notSendMessagesQueue(_0x1d6e33){if(_0x1d6e33[_0x0ea7('0x57')]){if(_0x1d6e33[_0x0ea7('0x58')]===0x0&&_0x1d6e33[_0x0ea7('0x28')]===0x0){_0x1d6e33[_0x0ea7('0x57')]=![];_0x1d6e33[_0x0ea7('0x59')]=0x0;_0x1d6e33['paused']=0x0;_0x1d6e33['message']=_0x0ea7('0x5a');ut['logger'](_0x0ea7('0x5b'),_0x1d6e33[_0x0ea7('0x52')]+_0x0ea7('0x5c'));}else{_0x1d6e33[_0x0ea7('0x4a')]='IS_DISACTIVED';ut['logger'](_0x0ea7('0x5b'),_0x1d6e33['name']+_0x0ea7('0x5d'));}emitCampaignPreview(_0x1d6e33);}}Preview[_0x0ea7('0x5e')][_0x0ea7('0x23')]=function(){var _0x8a9689=this;setInterval(function(){_0x8a9689[_0x0ea7('0x5f')]();},0x7cf);};Preview[_0x0ea7('0x5e')][_0x0ea7('0x5f')]=function(){var _0x19a2a7=this[_0x0ea7('0x13')];this[_0x0ea7('0x16')]+=0x1;for(var _0x225a6c in _0x19a2a7){if(_0x19a2a7['hasOwnProperty'](_0x225a6c)&&(_0x19a2a7[_0x225a6c][_0x0ea7('0x31')]===_0x0ea7('0x7')||_0x19a2a7[_0x225a6c][_0x0ea7('0x31')]===_0x0ea7('0x60'))&&_0x19a2a7[_0x225a6c]['type']==='outbound'){if(this[_0x0ea7('0x16')]>0x7){this['clockClearZombieChannels']=0x0;this[_0x0ea7('0x61')]();}}if(_0x19a2a7[_0x0ea7('0x62')](_0x225a6c)&&_0x19a2a7[_0x225a6c][_0x0ea7('0x31')]===_0x0ea7('0x7')&&_0x19a2a7[_0x225a6c][_0x0ea7('0x2d')]===_0x0ea7('0x25')){if(_0x19a2a7[_0x225a6c][_0x0ea7('0x63')]){this['setMessage'](_0x19a2a7[_0x225a6c]);this[_0x0ea7('0x64')](_0x19a2a7[_0x225a6c]);}else{notSendMessagesQueue(_0x19a2a7[_0x225a6c]);}}}};Preview[_0x0ea7('0x5e')]['clearZombieChannel']=function(_0x4ff758){var _0x479403=this;this[_0x0ea7('0x12')][_0x0ea7('0x10')](function(){if(!_[_0x0ea7('0x65')](_0x479403['actions'][_0x4ff758])){loggerAction[_0x0ea7('0x66')](_0x0ea7('0x67'),_0x4ff758,_0x0ea7('0x68'),_0x479403['actions'][_0x4ff758][_0x0ea7('0x69')],'originated:\x20',JSON[_0x0ea7('0x6a')](_0x479403[_0x0ea7('0x13')][_0x479403[_0x0ea7('0x6b')][_0x4ff758][_0x0ea7('0x69')]]['originated']),_0x0ea7('0x6c'),JSON[_0x0ea7('0x6a')](_0x479403[_0x0ea7('0x13')][_0x479403[_0x0ea7('0x6b')][_0x4ff758][_0x0ea7('0x69')]][_0x0ea7('0x28')]),JSON[_0x0ea7('0x6a')](_0x479403['actions'][_0x4ff758][_0x0ea7('0x6d')]),JSON[_0x0ea7('0x6a')](_[_0x0ea7('0x6e')](_0x479403[_0x0ea7('0x6b')][_0x4ff758],[_0x0ea7('0x6f'),_0x0ea7('0x70'),_0x0ea7('0x71'),_0x0ea7('0x72')])));return ami[_0x0ea7('0x73')]({'action':_0x0ea7('0x74'),'channel':_0x479403[_0x0ea7('0x6b')][_0x4ff758]['channel']})[_0x0ea7('0x75')](function(_0x160bbb){if(_0x160bbb[_0x0ea7('0x4a')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x479403['actions'][_0x4ff758]){ut['updateOriginated'](_0x479403[_0x0ea7('0x13')][_0x479403[_0x0ea7('0x6b')][_0x4ff758][_0x0ea7('0x69')]],_0x0ea7('0x76'));if(_0x479403[_0x0ea7('0x6b')][_0x4ff758][_0x0ea7('0x6d')]===!![]){ut[_0x0ea7('0x77')](_0x479403[_0x0ea7('0x13')][_0x479403[_0x0ea7('0x6b')][_0x4ff758][_0x0ea7('0x69')]],'[clearZombieChannel]');ut[_0x0ea7('0x78')](_0x0ea7('0x79')+_0x4ff758,_0x479403[_0x0ea7('0x6b')][_0x4ff758][_0x0ea7('0x69')]);}ut[_0x0ea7('0x78')]('[Dialer][checkChannel][Preview]'+_0x4ff758,_0x479403[_0x0ea7('0x6b')][_0x4ff758][_0x0ea7('0x69')]);delete _0x479403[_0x0ea7('0x6b')][_0x4ff758];}},0x2328);}});}});};Preview[_0x0ea7('0x5e')][_0x0ea7('0x61')]=function(){var _0x351ada=this;loggerAction[_0x0ea7('0x66')](_0x0ea7('0x7a'),_[_0x0ea7('0x7b')](this['actions']));for(var _0x436359 in this[_0x0ea7('0x6b')]){if(_0x351ada[_0x0ea7('0x6b')][_0x0ea7('0x62')](_0x436359)){_0x351ada['clearZombieChannel'](_0x436359);}}};Preview['prototype'][_0x0ea7('0x64')]=function(_0x238a64){var _0x4948dd=this;rpcDb['getContactRecallMe'](_0x238a64['id'],ut[_0x0ea7('0x7c')](this['agents']))['then'](function(_0x420fd1){if(!_['isNil'](_0x420fd1)){for(var _0x212c28=0x0;_0x212c28<_0x420fd1[_0x0ea7('0x7d')];_0x212c28+=0x1){if(ut[_0x0ea7('0x7e')](_0x420fd1[_0x212c28][_0x0ea7('0x7f')])<_0x238a64[_0x0ea7('0x80')]*0x3c){_0x4948dd[_0x0ea7('0x81')](_0x420fd1[_0x212c28]['id'])['then'](ut[_0x0ea7('0x82')](_0x0ea7('0x83')))[_0x0ea7('0x75')](ut[_0x0ea7('0x82')](_0x0ea7('0x83')));}else{var _0x56ea69=new Action(_0x420fd1[_0x212c28],_0x238a64);_0x56ea69[_0x0ea7('0x84')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x238a64['outboundReCallsDay']+=0x1;ut['logCustomer'](_0x56ea69,0x17,_0x0ea7('0x85'));if(_0x238a64[_0x0ea7('0x86')]){rpcDb['rescheduleContactInQueue'](ut[_0x0ea7('0x87')](_0x420fd1[_0x212c28]));rpcDb[_0x0ea7('0x88')](_0x56ea69,'[HistoryDialRecallInQueue][historyCatch]');}else{ut['logCustomer'](_0x56ea69,0x16,_0x0ea7('0x89'));rpcDb[_0x0ea7('0x88')](_0x56ea69,_0x0ea7('0x8a'));rpcDb[_0x0ea7('0x8b')](_0x56ea69,_0x0ea7('0x8a'));}}}}})[_0x0ea7('0x75')](ut[_0x0ea7('0x82')]('[getContactRecallMe]'));};Preview[_0x0ea7('0x5e')]['setMessage']=function(_0x1fdab9){_0x1fdab9[_0x0ea7('0x57')]=!![];if(ut[_0x0ea7('0x8c')](_0x1fdab9[_0x0ea7('0x27')])){_0x1fdab9[_0x0ea7('0x4a')]=_0x0ea7('0x8d');}else if(!ut[_0x0ea7('0x8e')](_0x1fdab9[_0x0ea7('0x63')])){_0x1fdab9[_0x0ea7('0x4a')]='NOT_ACTIVE';}else if(!this[_0x0ea7('0x8f')](_0x1fdab9[_0x0ea7('0x4e')])){if(!this['isTrunkReachable'](_0x1fdab9['TrunkBackup'])){_0x1fdab9[_0x0ea7('0x4a')]='TRUNK_IS_NOT_REACHABLE';}else{_0x1fdab9[_0x0ea7('0x4a')]='ACTIVE';}}else{_0x1fdab9['message']=_0x0ea7('0x90');}emitCampaignPreview(_0x1fdab9);};Preview['prototype'][_0x0ea7('0x91')]=function(_0x511447,_0x54eb30,_0x556d11){var _0x1b46b3=this;var _0x50a711=this[_0x0ea7('0x6b')][_0x54eb30];var _0x57b142=this[_0x0ea7('0x13')][_0x50a711[_0x0ea7('0x69')]];var _0x3f3da8;if(_0x57b142){switch(_0x556d11){case'1':_0x57b142[_0x0ea7('0x3d')]+=0x1;_0x50a711[_0x0ea7('0x92')]=ut[_0x0ea7('0x93')](_0x50a711);ut[_0x0ea7('0x94')](_0x50a711,0x0,_0x0ea7('0x95'));rpcDb['createCustomerHistory'](_0x50a711,_0x0ea7('0x96'));if(ut[_0x0ea7('0x93')](_0x50a711)>=_0x57b142['dialGlobalMaxRetry']){_0x3f3da8=ut[_0x0ea7('0x97')](_0x50a711,0xf,_0x0ea7('0x98'));rpcDb[_0x0ea7('0x8b')](_0x3f3da8,_0x0ea7('0x99'));}else{rpcDb[_0x0ea7('0x8b')](_0x50a711,_0x0ea7('0x99'));}delete this[_0x0ea7('0x6b')][_0x511447[_0x0ea7('0x9a')]];break;case _0x0ea7('0x9b'):var _0x50f6ac=moment()[_0x0ea7('0x53')](_0x0ea7('0x9c'));_0x50a711[_0x0ea7('0x9d')]=_0x50f6ac;_0x50a711[_0x0ea7('0x9e')]=_0x50f6ac;_0x50a711[_0x0ea7('0x6d')]=!![];_0x57b142[_0x0ea7('0x28')]+=0x1;logger[_0x0ea7('0x66')](_0x0ea7('0x9f'),_0x50a711[_0x0ea7('0xa0')],_0x0ea7('0xa1'),_0x57b142[_0x0ea7('0x52')],_0x0ea7('0x6c'),_0x57b142[_0x0ea7('0x28')]);ami[_0x0ea7('0x24')]('custom:agentconnect',ut['buildObj'](_0x50a711,_0x0ea7('0xa2')));if(_0x57b142[_0x0ea7('0xa3')]){ami[_0x0ea7('0x24')]('custom:agentConnectPreview',ut[_0x0ea7('0xa4')](_0x50a711));}break;case'16':ami[_0x0ea7('0x24')](_0x0ea7('0xa5'),ut['buildObj'](_0x50a711,_0x0ea7('0xa6')));emitVoiceQueueChannelRemove(ut[_0x0ea7('0xa7')](_0x50a711,_0x0ea7('0xa6')));_0x57b142[_0x0ea7('0x35')]+=0x1;_0x57b142[_0x0ea7('0x2c')]+=0x1;_0x57b142[_0x0ea7('0xa8')]+=0x1;ut[_0x0ea7('0x77')](_0x57b142,_0x0ea7('0xa9'));_0x50a711[_0x0ea7('0x92')]=ut[_0x0ea7('0x93')](_0x50a711);ut[_0x0ea7('0x94')](_0x50a711,0x4,_0x0ea7('0xaa'));rpcDb[_0x0ea7('0x88')](_0x50a711,_0x0ea7('0xab'));rpcDb[_0x0ea7('0x8b')](_0x50a711,_0x0ea7('0xac'));rpcDb[_0x0ea7('0xad')](_0x50a711);_0x57b142[_0x0ea7('0xae')]+=_0x50a711[_0x0ea7('0xaf')];_0x57b142[_0x0ea7('0x29')]+=_0x50a711[_0x0ea7('0xaf')];logger[_0x0ea7('0x66')](_0x0ea7('0xb0'),_0x50a711[_0x0ea7('0xa0')],_0x0ea7('0xa1'),_0x57b142[_0x0ea7('0x52')],'pTalking:\x20',_0x57b142[_0x0ea7('0x28')]);delete this[_0x0ea7('0x6b')][_0x511447[_0x0ea7('0x9a')]];break;case'BUSY':_0x57b142[_0x0ea7('0x37')]+=0x1;_0x50a711[_0x0ea7('0xb1')]+=0x1;_0x50a711['countglobal']=ut['totalGlobal'](_0x50a711);ut[_0x0ea7('0x94')](_0x50a711,0x5,_0x0ea7('0xb2'));rpcDb[_0x0ea7('0x88')](_0x50a711,_0x0ea7('0xb3'));if(ut['totalGlobal'](_0x50a711)>=_0x57b142[_0x0ea7('0xb4')]){_0x3f3da8=ut[_0x0ea7('0x97')](_0x50a711,0xf,'Global');rpcDb[_0x0ea7('0x8b')](_0x3f3da8,_0x0ea7('0xb5'));}else{if(_0x50a711[_0x0ea7('0xb1')]>=_0x57b142['dialBusyMaxRetry']){rpcDb[_0x0ea7('0x8b')](_0x50a711,_0x0ea7('0xb3'));}else{rpcDb[_0x0ea7('0xb6')](ut[_0x0ea7('0xb7')](_0x50a711,_0x0ea7('0xb1'),_0x57b142['dialBusyRetryFrequency']),_0x50a711['unlockAgent'],_0x50a711['activeContact']);}}break;case _0x0ea7('0xb8'):_0x57b142[_0x0ea7('0x3c')]+=0x1;_0x50a711[_0x0ea7('0xb9')]+=0x1;_0x50a711[_0x0ea7('0x92')]=ut['totalGlobal'](_0x50a711);ut[_0x0ea7('0x94')](_0x50a711,0x3,_0x0ea7('0xba'));rpcDb[_0x0ea7('0x88')](_0x50a711,_0x0ea7('0xbb'));if(ut[_0x0ea7('0x93')](_0x50a711)>=_0x57b142['dialGlobalMaxRetry']){_0x3f3da8=ut[_0x0ea7('0x97')](_0x50a711,0xf,_0x0ea7('0x98'));rpcDb[_0x0ea7('0x8b')](_0x3f3da8,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x50a711[_0x0ea7('0xb9')]>=_0x57b142[_0x0ea7('0xbc')]){rpcDb[_0x0ea7('0x8b')](_0x50a711,_0x0ea7('0xbb'));}else{rpcDb[_0x0ea7('0xb6')](ut[_0x0ea7('0xb7')](_0x50a711,_0x0ea7('0xb9'),_0x57b142[_0x0ea7('0xbd')]),_0x50a711['unlockAgent'],_0x50a711[_0x0ea7('0xbe')]);}}break;case _0x0ea7('0xbf'):_0x57b142[_0x0ea7('0x38')]+=0x1;_0x50a711[_0x0ea7('0xc0')]+=0x1;_0x50a711['countglobal']=ut[_0x0ea7('0x93')](_0x50a711);ut[_0x0ea7('0x94')](_0x50a711,0x8,_0x0ea7('0xc1'));rpcDb[_0x0ea7('0x88')](_0x50a711,_0x0ea7('0xc2'));if(ut[_0x0ea7('0x93')](_0x50a711)>=_0x57b142[_0x0ea7('0xb4')]){_0x3f3da8=ut[_0x0ea7('0x97')](_0x50a711,0xf,'Global');rpcDb[_0x0ea7('0x8b')](_0x3f3da8,_0x0ea7('0xc3'));}else{if(_0x50a711[_0x0ea7('0xc0')]>=_0x57b142[_0x0ea7('0xc4')]){rpcDb['createCustomerFinal'](_0x50a711,_0x0ea7('0xc2'));}else{rpcDb[_0x0ea7('0xb6')](ut[_0x0ea7('0xb7')](_0x50a711,_0x0ea7('0xc0'),_0x57b142[_0x0ea7('0xc5')]),_0x50a711[_0x0ea7('0xc6')],_0x50a711[_0x0ea7('0xbe')]);}}break;case _0x0ea7('0xc7'):_0x57b142['outboundRejectCallsDay']+=0x1;_0x50a711[_0x0ea7('0x92')]=ut['totalGlobal'](_0x50a711);ut[_0x0ea7('0x94')](_0x50a711,0x14,_0x0ea7('0xc8'));rpcDb[_0x0ea7('0x88')](_0x50a711,_0x0ea7('0xc9'));if(_0x50a711[_0x0ea7('0xc6')]){rpcDb[_0x0ea7('0xca')](_0x50a711[_0x0ea7('0xcb')]);}if(_0x50a711[_0x0ea7('0xbe')]){rpcDb[_0x0ea7('0xcc')](_0x50a711[_0x0ea7('0xcb')]);}break;default:if(_0x50a711[_0x0ea7('0x6d')]){ut[_0x0ea7('0x77')](_0x57b142,_0x0ea7('0xcd'));ut[_0x0ea7('0x78')](_0x0ea7('0xce')+_0x57b142['name'],_0x511447);}_0x57b142[_0x0ea7('0x40')]+=0x1;_0x50a711[_0x0ea7('0x92')]=ut['totalGlobal'](_0x50a711);ut[_0x0ea7('0x94')](_0x50a711,0xc,_0x511447['cause-txt']||_0x511447[_0x0ea7('0xcf')]);rpcDb['createCustomerHistory'](_0x50a711,_0x0ea7('0xd0'));if(ut[_0x0ea7('0x93')](_0x50a711)>=_0x57b142['dialGlobalMaxRetry']){_0x3f3da8=ut['cloneAction'](_0x50a711,0xf,_0x0ea7('0x98'));rpcDb[_0x0ea7('0x8b')](_0x3f3da8,_0x0ea7('0xd1'));}else{rpcDb[_0x0ea7('0x8b')](_0x50a711,_0x0ea7('0xd1'));}delete this['actions'][_0x511447[_0x0ea7('0x9a')]];}if(!(_0x50a711[_0x0ea7('0x6d')]&&_0x556d11==='16')){ut[_0x0ea7('0xd2')](_0x57b142,_0x0ea7('0xd3'));logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x50a711[_0x0ea7('0xa0')],'\x20Queue',_0x57b142[_0x0ea7('0x52')],_0x0ea7('0xd4'),_0x57b142[_0x0ea7('0x58')]);}if(_0x556d11!==_0x0ea7('0x9b')){delete this['actions'][_0x511447[_0x0ea7('0x9a')]];delete this[_0x0ea7('0x6b')][_0x511447[_0x0ea7('0xd5')]];}}};Preview['prototype']['callProgressDetectingAgent']=function(_0x4a984e,_0x5f53fb,_0x645f6c){if(_['isUndefined'](_0x5f53fb)&&'object'!==typeof _0x5f53fb){return;}if(_[_0x0ea7('0xd6')](_0x645f6c)&&'object'!==typeof _0x645f6c){return;}switch(_0x645f6c[_0x0ea7('0xd7')]){case'0':ut['logAgent'](_0x4a984e,0x0,_0x0ea7('0x95'));rpcDb['createAgentHistory'](_0x4a984e,_0x0ea7('0xd8'));break;case'3':ut['logAgent'](_0x4a984e,0x3,_0x0ea7('0xba'));rpcDb[_0x0ea7('0xd9')](_0x4a984e,_0x0ea7('0xda'));break;case'5':ut[_0x0ea7('0xdb')](_0x4a984e,0x5,_0x0ea7('0xb2'));rpcDb[_0x0ea7('0xd9')](_0x4a984e,_0x0ea7('0xdc'));break;case'8':ut['logAgent'](_0x4a984e,0x8,_0x0ea7('0xc1'));rpcDb[_0x0ea7('0xd9')](_0x4a984e,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut['logAgent'](_0x4a984e,0x16,_0x0ea7('0xdd'));rpcDb[_0x0ea7('0xd9')](_0x4a984e,_0x0ea7('0xde'));break;default:ut['logAgent'](_0x4a984e,0xc,_0x645f6c[_0x0ea7('0xd7')]);rpcDb[_0x0ea7('0xd9')](_0x4a984e,_0x0ea7('0xdf'));}ut[_0x0ea7('0xd2')](_0x5f53fb,'[callProgressDetectingAgent]');logger['info'](_0x0ea7('0xe0'),_0x4a984e[_0x0ea7('0xa0')],'\x20Queue',_0x5f53fb[_0x0ea7('0x52')],'originated:\x20',_0x5f53fb[_0x0ea7('0x58')]);delete this[_0x0ea7('0x6b')][_0x4a984e[_0x0ea7('0xa0')]];};Preview[_0x0ea7('0x5e')][_0x0ea7('0xe1')]=function(_0x162215,_0x55d8b3,_0x343141,_0x18bde9,_0x5b2f7a){var _0x1d2048=this;return new BPromise(function(_0x2cfd16,_0x403bfe){if(_[_0x0ea7('0x65')](_0x55d8b3)||_['isNil'](_0x55d8b3[_0x0ea7('0xe2')])||_[_0x0ea7('0x65')](_0x55d8b3[_0x0ea7('0xe2')]['phone'])||_['isNil'](_0x55d8b3[_0x0ea7('0x71')])){_0x403bfe(ut['message'](_0x0ea7('0xe3'),_0x18bde9,_0x5b2f7a));return;}var _0x38e06b=uuid['v4']();var _0x2092c2=_0x1d2048[_0x0ea7('0x13')][_0x55d8b3[_0x0ea7('0x68')][_0x0ea7('0x52')]];var _0x23f9fa=_0x343141?_0x1d2048['agents'][_0x343141]['id']:undefined;_0x1d2048[_0x0ea7('0x6b')][_0x38e06b]=new Action(_0x55d8b3,_0x2092c2,_0x38e06b,_0x343141,_0x23f9fa);var _0x34b567=_0x1d2048['actions'][_0x38e06b];_0x34b567['unlockAgent']=_0x18bde9;_0x34b567[_0x0ea7('0xbe')]=_0x5b2f7a;_0x34b567['lookAgent']=_0x343141;if(_['isEmpty'](_0x162215)){_0x1d2048[_0x0ea7('0xe4')](_0x34b567,_0x2092c2,_0x55d8b3,_0x343141)[_0x0ea7('0xe5')](function(_0x498d11){logger[_0x0ea7('0x66')](_0x0ea7('0xe6'),'Queue:\x20'+_0x34b567[_0x0ea7('0x69')]+_0x0ea7('0xe7')+_0x34b567['idContact'],JSON[_0x0ea7('0x6a')](_0x498d11));ami[_0x0ea7('0x24')]('custom:agentcalled',ut[_0x0ea7('0xa7')](_0x34b567,_0x0ea7('0xe8')));_0x2cfd16(ut[_0x0ea7('0x4a')]('Calling'));})[_0x0ea7('0x75')](function(_0xe14cee){ut['logger'](_0x0ea7('0xe9'),_0xe14cee);_0x403bfe(ut[_0x0ea7('0x4a')]('Call\x20failed',_0x18bde9,_0x5b2f7a));});}else{_0x2092c2[_0x0ea7('0x36')]+=0x1;ut[_0x0ea7('0xea')](_0x34b567);rpcDb[_0x0ea7('0xeb')](_0x34b567,_0x0ea7('0xec'));delete _0x1d2048[_0x0ea7('0x6b')][_0x38e06b];_0x403bfe(ut['message'](_0x0ea7('0xed'),_0x18bde9,_0x5b2f7a));}});};Preview[_0x0ea7('0x5e')][_0x0ea7('0x8f')]=function(_0x3c069c){return!_[_0x0ea7('0x65')](_0x3c069c)&&!_[_0x0ea7('0x65')](_0x3c069c['name'])&&!_[_0x0ea7('0x65')](_0x3c069c[_0x0ea7('0x4f')])&&_0x3c069c['active']&&!_[_0x0ea7('0x65')](this['trunks'][util[_0x0ea7('0x53')](_0x0ea7('0xee'),_0x3c069c[_0x0ea7('0x52')])])&&!_['isNil'](this['trunks'][util[_0x0ea7('0x53')]('SIP/%s',_0x3c069c['name'])][_0x0ea7('0x74')])&&(this['trunks'][util[_0x0ea7('0x53')](_0x0ea7('0xee'),_0x3c069c[_0x0ea7('0x52')])]['status']===_0x0ea7('0xef')||this[_0x0ea7('0x14')][util[_0x0ea7('0x53')]('SIP/%s',_0x3c069c[_0x0ea7('0x52')])][_0x0ea7('0x74')]===_0x0ea7('0xf0'));};Preview[_0x0ea7('0x5e')][_0x0ea7('0x81')]=function(_0x6da517,_0x240410){var _0x27a892=this;return new BPromise(function(_0x5f161d,_0x6bb11){_0x27a892['execRun'](_0x6da517,_0x240410)['then'](function(_0x571901){_0x5f161d(_[_0x0ea7('0x6e')](_0x571901,[_0x0ea7('0x4a')]));})[_0x0ea7('0x75')](function(_0x2e8838){if(_0x2e8838[_0x0ea7('0xf1')]){rpcDb[_0x0ea7('0xca')](_0x6da517);}if(_0x2e8838[_0x0ea7('0x4f')]){rpcDb[_0x0ea7('0xcc')](_0x6da517);}_0x6bb11(_[_0x0ea7('0x6e')](_0x2e8838,['message']));});});};Preview[_0x0ea7('0x5e')]['execRun']=function(_0x5ce46c,_0x42e9ec){var _0x18d516=this;return new BPromise(function(_0x550964,_0x21f9bd){var _0xb038cc,_0x1b8e0a;rpcDb[_0x0ea7('0xf2')](_0x5ce46c)[_0x0ea7('0xe5')](function(_0x645d08){if(!_[_0x0ea7('0x65')](_0x645d08[0x0])){_0x1b8e0a=_0x645d08[0x0]['recallme']?![]:!![];_0xb038cc=_0x645d08[0x0][_0x0ea7('0xf3')]?!![]:![];_0xb038cc=_0x42e9ec?!![]:_0xb038cc;}var _0x59fd20=_0x18d516['validateContact'](_0x645d08);if(_0x59fd20[_0x0ea7('0xf4')]){rpcDb[_0x0ea7('0xf5')](_[_0x0ea7('0x6e')](_0x645d08[0x0],[_0x0ea7('0x71'),_0x0ea7('0xf6')]))[_0x0ea7('0xe5')](function(_0x40a13a){_0x18d516[_0x0ea7('0xe1')](_0x40a13a,_0x645d08[0x0],_0x42e9ec,_0x1b8e0a,_0xb038cc)['then'](function(_0x35e93f){_0x550964(_0x35e93f);})[_0x0ea7('0x75')](function(_0x226065){_0x21f9bd(_0x226065);});})['catch'](function(_0x149428){ut[_0x0ea7('0xf7')]('[Preview][checkIsBlackList]',_0x149428);_0x21f9bd(ut[_0x0ea7('0x4a')]('Call\x20unsuccessful',_0x1b8e0a,_0xb038cc));});}else{_0x21f9bd(ut[_0x0ea7('0x4a')](_0x59fd20[_0x0ea7('0x4a')],_0x1b8e0a,_0xb038cc));}})[_0x0ea7('0x75')](function(_0x16adc5){ut[_0x0ea7('0xf7')](_0x0ea7('0xf8'),_0x16adc5);_0x21f9bd(ut['message']('Call\x20unsuccessful',![],!![]));});});};Preview['prototype'][_0x0ea7('0xf9')]=function(_0x372e30){if(_[_0x0ea7('0x65')](_0x372e30)||_[_0x0ea7('0xfa')](_0x372e30)||!_['isNil'](_0x372e30[0x0][_0x0ea7('0xfb')])&&_[_0x0ea7('0x65')](_0x372e30[0x0][_0x0ea7('0xfb')]['name'])){ut[_0x0ea7('0xf7')](_0x0ea7('0xfc'),_0x372e30);return{'isValid':![],'message':_0x0ea7('0xfd')};}var _0x501213=this[_0x0ea7('0x13')][_0x372e30[0x0]['Queue'][_0x0ea7('0x52')]];_0x501213[_0x0ea7('0x4a')]=_0x0ea7('0x90');if(_[_0x0ea7('0x65')](_0x501213)){ut[_0x0ea7('0xf7')](_0x0ea7('0xfe'),_0x501213);return{'isValid':![],'message':_0x0ea7('0xff')};}if(!this[_0x0ea7('0x8f')](_0x501213[_0x0ea7('0x4e')])){ut[_0x0ea7('0xf7')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x0ea7('0x100')+_0x501213[_0x0ea7('0x52')]+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0x501213[_0x0ea7('0x101')])){ut['logger'](_0x0ea7('0x102'),_0x501213[_0x0ea7('0x52')]+_0x0ea7('0x103'));return{'isValid':![],'message':_0x0ea7('0x104')};}}if(!ut['isActive'](_0x501213[_0x0ea7('0x63')])){ut['logger'](_0x0ea7('0x105'),_0x501213[_0x0ea7('0x52')]+_0x0ea7('0x106'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x501213[_0x0ea7('0x52')]+_0x0ea7('0x106')};}return{'isValid':!![],'message':_0x0ea7('0x107')};};Preview['prototype']['execCall']=function(_0x2bee68,_0x512396,_0x1675c6,_0x8bc64d){var _0x4f680c=this;return new BPromise(function(_0x539411,_0x242c35){var _0xa254be=_0x2bee68[_0x0ea7('0xa0')];var _0x1438ae=_0x4f680c[_0x0ea7('0x8f')](_0x512396[_0x0ea7('0x4e')])?util[_0x0ea7('0x53')](_0x0ea7('0x108'),_0x512396[_0x0ea7('0x4e')][_0x0ea7('0x52')],_[_0x0ea7('0x65')](_0x512396[_0x0ea7('0x33')])?'':_0x512396[_0x0ea7('0x33')]['trim']()||'',_0x512396[_0x0ea7('0x109')]>0x0?_0x1675c6['Contact'][_0x0ea7('0x10a')]['substring'](_0x512396['dialCutDigit']):_0x1675c6[_0x0ea7('0xe2')][_0x0ea7('0x10a')]):util['format'](_0x0ea7('0x108'),_['isNil'](_0x512396[_0x0ea7('0x101')])?_0x512396[_0x0ea7('0x4e')]['name']:_0x512396[_0x0ea7('0x101')][_0x0ea7('0x52')],_[_0x0ea7('0x65')](_0x512396[_0x0ea7('0x33')])?'':_0x512396[_0x0ea7('0x33')]['trim']()||'',_0x512396[_0x0ea7('0x109')]>0x0?_0x1675c6['Contact'][_0x0ea7('0x10a')][_0x0ea7('0x10b')](_0x512396[_0x0ea7('0x109')]):_0x1675c6[_0x0ea7('0xe2')][_0x0ea7('0x10a')]);var _0x300e83=_0x4f680c[_0x0ea7('0x8f')](_0x512396[_0x0ea7('0x4e')])?ut[_0x0ea7('0x10c')](_0x512396['Trunk'][_0x0ea7('0x50')],_0x512396[_0x0ea7('0x32')],_0x512396[_0x0ea7('0x10d')]>0x0?ut[_0x0ea7('0x10e')](_0x512396[_0x0ea7('0x10f')],_0x512396['dialRandomLastDigitCallerIdNumber']):_0x512396[_0x0ea7('0x10f')]):ut['getCallerId'](_[_0x0ea7('0x65')](_0x512396['TrunkBackup'])?_0x512396[_0x0ea7('0x4e')][_0x0ea7('0x50')]:_0x512396[_0x0ea7('0x101')][_0x0ea7('0x50')],_0x512396[_0x0ea7('0x32')],_0x512396['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x0ea7('0x10e')](_0x512396[_0x0ea7('0x10f')],_0x512396[_0x0ea7('0x10d')]):_0x512396[_0x0ea7('0x10f')]);if(_0x300e83){_0x2bee68[_0x0ea7('0x110')]=ut[_0x0ea7('0x111')](_0x300e83);_0x2bee68[_0x0ea7('0x112')]=ut['extractCalleridNumber'](_0x300e83);}var _0x4358f6=ut['addVariables'](_0x512396,_0x1675c6,_0x1438ae,_0x300e83,_0xa254be,_0x2bee68);_[_0x0ea7('0x113')](_0x2bee68,ut[_0x0ea7('0x114')](_0x4358f6));_0x2bee68[_0x0ea7('0x84')]=moment()[_0x0ea7('0x53')](_0x0ea7('0x9c'));ami[_0x0ea7('0x73')](ut['variablesAction'](_0x2bee68,_0x512396,_0x4358f6,_0x2bee68[_0x0ea7('0xbe')],_0x8bc64d))[_0x0ea7('0xe5')](function(_0xa779ad){_0x512396[_0x0ea7('0x58')]+=0x1;logger['info']('[originated][increment]',_0xa254be,_0x0ea7('0xa1'),_0x512396[_0x0ea7('0x52')],_0x0ea7('0xd4'),_0x512396[_0x0ea7('0x58')]);_0x539411(_0xa779ad);})[_0x0ea7('0x75')](function(_0x39cd67){ut[_0x0ea7('0xdb')](_0x2bee68,0xe,'OriginateError');rpcDb[_0x0ea7('0xd9')](_0x2bee68,_0x0ea7('0x115'));_0x242c35(_0x39cd67);});});};Preview[_0x0ea7('0x5e')][_0x0ea7('0x116')]=function(_0x1db15b){if(this[_0x0ea7('0x6b')][_0x1db15b['linkedid']]){this['actions'][_0x1db15b[_0x0ea7('0x9a')]][_0x0ea7('0x117')]=_0x1db15b[_0x0ea7('0x117')];}};Preview[_0x0ea7('0x5e')][_0x0ea7('0x18')]=function(_0x12426b){var _0x49f151=this;var _0xe122c9=this['actions'][_0x12426b[_0x0ea7('0x118')]];if(_0xe122c9){if(_0xe122c9[_0x0ea7('0x119')]&&this[_0x0ea7('0x15')][_0xe122c9[_0x0ea7('0x119')]]){ut[_0x0ea7('0x11a')](_0xe122c9,this[_0x0ea7('0x15')][_0xe122c9[_0x0ea7('0x119')]][_0x0ea7('0x52')],this[_0x0ea7('0x15')][_0xe122c9[_0x0ea7('0x119')]]['id']);}var _0x24ec22=_[_0x0ea7('0x11b')](_0xe122c9);_0x24ec22[_0x0ea7('0x9d')]=moment()[_0x0ea7('0x53')](_0x0ea7('0x9c'));var _0x11b9c7=_0x49f151[_0x0ea7('0x13')][_0xe122c9[_0x0ea7('0x69')]];if(ut[_0x0ea7('0x11c')](_0x12426b[_0x0ea7('0x11d')])){if(_0xe122c9[_0x0ea7('0xc6')]){rpcDb[_0x0ea7('0xca')](_0xe122c9[_0x0ea7('0xcb')]);}if(_0xe122c9['activeContact']){rpcDb[_0x0ea7('0xcc')](_0xe122c9['idContact']);}ami[_0x0ea7('0x24')](_0x0ea7('0x11e'),ut[_0x0ea7('0xa7')](_0xe122c9,_0x0ea7('0x11f')));this[_0x0ea7('0x120')](_0x24ec22,_0x11b9c7,_0x12426b);}else{_0xe122c9['starttime']=moment()['format'](_0x0ea7('0x9c'));ut[_0x0ea7('0xdb')](_0x24ec22,0x4,_0x0ea7('0xaa'));rpcDb[_0x0ea7('0xd9')](_0x24ec22,_0x0ea7('0x121'));}}};Preview['prototype']['syncHangup']=function(_0x5c124a){var _0x50a377=this;var _0x2d6e13=this['actions'][_0x5c124a[_0x0ea7('0x9a')]];var _0x4f7beb;if(_0x2d6e13){_0x4f7beb=this[_0x0ea7('0x13')][_0x2d6e13[_0x0ea7('0x69')]];logger[_0x0ea7('0x66')]('[syncHangup][talking]',_0x5c124a[_0x0ea7('0x9a')],_0x0ea7('0xa1'),_0x4f7beb[_0x0ea7('0x52')],_0x0ea7('0x6c'),_0x4f7beb['pTalking']);}if(this[_0x0ea7('0x6b')][_0x5c124a[_0x0ea7('0x9a')]]&&_0x5c124a[_0x0ea7('0x9a')]!==_0x5c124a[_0x0ea7('0xa0')]){if(_0x5c124a[_0x0ea7('0x122')]==='16'&&this[_0x0ea7('0x6b')][_0x5c124a[_0x0ea7('0x9a')]][_0x0ea7('0x6d')]){this[_0x0ea7('0x91')](_0x5c124a,_0x5c124a[_0x0ea7('0x9a')],_0x5c124a[_0x0ea7('0x122')]);}else if(this[_0x0ea7('0x6b')][_0x5c124a[_0x0ea7('0x9a')]][_0x0ea7('0x6d')]){logger[_0x0ea7('0x66')](_0x0ea7('0x123'),_0x5c124a[_0x0ea7('0x9a')],_0x5c124a['cause'],_0x0ea7('0xa1'),_0x4f7beb[_0x0ea7('0x52')],_0x0ea7('0x6c'),_0x4f7beb['pTalking']);this[_0x0ea7('0x91')](_0x5c124a,_0x5c124a[_0x0ea7('0x9a')],_0x5c124a[_0x0ea7('0x122')]);}}else if(_0x2d6e13&&_[_0x0ea7('0x65')](_0x2d6e13[_0x0ea7('0x124')])&&_0x4f7beb[_0x0ea7('0x125')]&&_0x5c124a[_0x0ea7('0x9a')]===_0x5c124a['uniqueid']&&_['isNil'](_0x5c124a[_0x0ea7('0xd7')])&&_0x5c124a[_0x0ea7('0x122')]==='16'&&_0x5c124a[_0x0ea7('0x126')]==='6'&&_[_0x0ea7('0xd6')](_0x2d6e13[_0x0ea7('0x127')])){if(_0x2d6e13['unlockAgent']){rpcDb[_0x0ea7('0xca')](_0x2d6e13[_0x0ea7('0xcb')]);}if(_0x2d6e13[_0x0ea7('0xbe')]){rpcDb['disableContact'](_0x2d6e13['idContact']);}_0x5c124a[_0x0ea7('0xd7')]='22';this[_0x0ea7('0x120')](_0x2d6e13,_0x4f7beb,_0x5c124a);}else if(_0x2d6e13&&_0x2d6e13['transfer']){if(_0x5c124a[_0x0ea7('0x122')]==='16'&&this[_0x0ea7('0x6b')][_0x5c124a[_0x0ea7('0x9a')]]['dialAnswer']){logger['info'](_0x0ea7('0x128'),_0x5c124a[_0x0ea7('0x9a')],_0x5c124a[_0x0ea7('0x122')],'\x20Queue',_0x4f7beb['name'],'pTalking:\x20',_0x4f7beb['pTalking']);this['callProgressDetectingCustomer'](_0x5c124a,_0x5c124a[_0x0ea7('0x9a')],_0x5c124a[_0x0ea7('0x122')]);}else if(this[_0x0ea7('0x6b')][_0x5c124a[_0x0ea7('0x9a')]][_0x0ea7('0x6d')]){logger[_0x0ea7('0x66')](_0x0ea7('0x123'),_0x5c124a[_0x0ea7('0x9a')],_0x5c124a[_0x0ea7('0x122')],'\x20Queue',_0x4f7beb[_0x0ea7('0x52')],_0x0ea7('0x6c'),_0x4f7beb['pTalking']);this[_0x0ea7('0x91')](_0x5c124a,_0x5c124a[_0x0ea7('0x9a')],_0x5c124a[_0x0ea7('0x122')]);}}};Preview[_0x0ea7('0x5e')][_0x0ea7('0x129')]=function(_0xdfc97a){if(this[_0x0ea7('0x6b')][_0xdfc97a[_0x0ea7('0xd5')]]&&_0xdfc97a['destlinkedid']!==_0xdfc97a[_0x0ea7('0x12a')]){this[_0x0ea7('0x91')](_0xdfc97a,_0xdfc97a['destlinkedid'],_0xdfc97a['dialstatus']);}};Preview[_0x0ea7('0x5e')]['syncHangupRequest']=function(_0xe7fbb1){if(this[_0x0ea7('0x6b')][_0xe7fbb1[_0x0ea7('0x9a')]]&&_0xe7fbb1[_0x0ea7('0x9a')]!==_0xe7fbb1[_0x0ea7('0xa0')]&&!this['actions'][_0xe7fbb1['linkedid']][_0x0ea7('0x6d')]){if(_0xe7fbb1[_0x0ea7('0x122')]==='1'){this['callProgressDetectingCustomer'](_0xe7fbb1,_0xe7fbb1[_0x0ea7('0x9a')],_0xe7fbb1[_0x0ea7('0x122')]);}}};Preview[_0x0ea7('0x5e')][_0x0ea7('0x12b')]=function(_0x4c7403,_0x772cd8,_0x5a531){if(this[_0x0ea7('0x6b')][_0x4c7403]){if(_[_0x0ea7('0x65')](this['actions'][_0x4c7403][_0x0ea7('0x12c')])){this[_0x0ea7('0x6b')][_0x4c7403]['variables']={};}this[_0x0ea7('0x6b')][_0x4c7403][_0x0ea7('0x12c')][_0x772cd8]=_0x5a531;}};Preview[_0x0ea7('0x5e')][_0x0ea7('0x20')]=function(_0x36cb39){try{if(!_[_0x0ea7('0x65')](_0x36cb39)){if(ut['filterKey'](_[_0x0ea7('0x12d')](_0x36cb39[_0x0ea7('0x12e')])[0x0])){this[_0x0ea7('0x12b')](_0x36cb39[_0x0ea7('0xa0')],_[_0x0ea7('0x12d')](_0x36cb39[_0x0ea7('0x12e')])[0x0],_0x36cb39[_0x0ea7('0x12f')]);}}}catch(_0x2fbaa3){logger[_0x0ea7('0x130')]('[syncVarSet][Preview]',util[_0x0ea7('0x131')](_0x2fbaa3,{'showHidden':![],'depth':null}));}};Preview[_0x0ea7('0x5e')][_0x0ea7('0x21')]=function(_0x3428f1){if(_0x3428f1){if(this[_0x0ea7('0x6b')][_0x3428f1[_0x0ea7('0x132')]]){this[_0x0ea7('0x6b')][_0x3428f1[_0x0ea7('0x132')]][_0x0ea7('0x127')]=!![];}}};Preview[_0x0ea7('0x5e')][_0x0ea7('0x133')]=function(_0x1d182c){if(_0x1d182c){if(this[_0x0ea7('0x6b')][_0x1d182c['transfererlinkedid']]){this[_0x0ea7('0x6b')][_0x1d182c[_0x0ea7('0x134')]][_0x0ea7('0x127')]=!![];}}};module[_0x0ea7('0x135')]=Preview; \ No newline at end of file +var _0x6828=['predictiveIntervalTotalCalls','message','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','name','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','voice_queue_channel:remove','originated','paused','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','preview','booked','clearZombieChannels','recallMe','enqueue','isNil','info','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','VoiceQueueId','ListId','Action','status','catch','updateOriginated','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannel','getContactRecallMe','then','getDiff','scheduledat','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','[HistoryDialRecallInQueue][historyCatch]','createCustomerHistory','[HistoryRecallClose]','sendMessageOneNotActive','isActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','emit','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','buildObj','complete','outboundAnswerCallsDay','totalGlobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','\x20Queue','BUSY','countbusyretry','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','scheduledAt','activeContact','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','dialBusyRetryFrequency','CANCEL','outboundRejectCallsDay','AgentReject','idContact','disableContact','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','reason','[originated][decrement][callProgressDetectingAgent]','Contact','phone','unlockAgent','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','createHistory','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','recallme','checkIsBlackList','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','Agent','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','dialCutDigit','substring','SIP/%s/%s%s','trim','getCallerId','dialOriginateCallerIdName','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','extractCalleridNumber','merge','variablesAction','[originated][increment]','OriginateError','channel','syncOriginateResponse','actionid','logLookAgent','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','variables','filterKey','keys','variable','addVariable','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','md5','ioredis','../../../config/logger','actionPreview','../ami','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','originateresponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x6828,0xe2));var _0x8682=function(_0x208593,_0x538f74){_0x208593=_0x208593-0x0;var _0x5f2b99=_0x6828[_0x208593];return _0x5f2b99;};'use strict';var util=require(_0x8682('0x0'));var _=require(_0x8682('0x1'));var BPromise=require(_0x8682('0x2'));var uuid=require('uuid');var moment=require('moment');var md5=require(_0x8682('0x3'));var Redis=require(_0x8682('0x4'));var config=require('../../../config/environment');var logger=require(_0x8682('0x5'))('preview');var loggerAction=require('../../../config/logger')(_0x8682('0x6'));var ami=require(_0x8682('0x7'));var rpcDb=require('./rpcDb');var Action=require(_0x8682('0x8'));var ut=require(_0x8682('0x9'));config[_0x8682('0xa')]=_[_0x8682('0xb')](config[_0x8682('0xa')],{'host':_0x8682('0xc'),'port':0x18eb});var io=require(_0x8682('0xd'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x8682('0xe')]['enqueue']=function(_0x57e77b){this[_0x8682('0xf')]=this[_0x8682('0xf')]?this[_0x8682('0xf')]['finally'](_0x57e77b):_0x57e77b();};function Preview(_0x2ce4a2){this[_0x8682('0x10')]=new Sequence();this[_0x8682('0x11')]=_0x2ce4a2[_0x8682('0x12')];this[_0x8682('0x13')]=_0x2ce4a2[_0x8682('0x13')];this[_0x8682('0x14')]={};this[_0x8682('0x15')]=_0x2ce4a2[_0x8682('0x15')];this['clockClearZombieChannels']=0x0;ami['on'](_0x8682('0x16'),this['syncOriginateResponse'][_0x8682('0x17')](this));ami['on'](_0x8682('0x18'),this[_0x8682('0x19')][_0x8682('0x17')](this));ami['on'](_0x8682('0x1a'),this[_0x8682('0x1b')]['bind'](this));ami['on'](_0x8682('0x1c'),this[_0x8682('0x1d')][_0x8682('0x17')](this));ami['on'](_0x8682('0x1e'),this[_0x8682('0x1f')][_0x8682('0x17')](this));ami['on'](_0x8682('0x20'),this[_0x8682('0x21')][_0x8682('0x17')](this));ami['on']('attendedtransfer',this[_0x8682('0x22')][_0x8682('0x17')](this));ami['on']('blindtransfer',this[_0x8682('0x23')][_0x8682('0x17')](this));this[_0x8682('0x24')](this['campaignsPreview']);}function emit(_0x2deaa7,_0x59a655,_0x3cb9e4){io['to'](_0x2deaa7)['emit'](_0x59a655,_0x3cb9e4);}function emitCampaignPreview(_0x184274){if(_0x184274[_0x8682('0x25')]===_0x8682('0x26')){var _0x24ba5e={'id':_0x184274['id'],'name':_0x184274['name'],'strategy':_0x184274[_0x8682('0x27')],'answered':_0x184274[_0x8682('0x28')],'available':_0x184274[_0x8682('0x29')],'loggedIn':_0x184274[_0x8682('0x2a')],'pTalking':_0x184274[_0x8682('0x2b')],'sumBillable':_0x184274[_0x8682('0x2c')],'sumDuration':_0x184274[_0x8682('0x2d')],'sumHoldTime':_0x184274[_0x8682('0x2e')]||0x0,'talking':_0x184274[_0x8682('0x2f')],'total':_0x184274[_0x8682('0x30')],'type':_0x184274[_0x8682('0x25')],'unmanaged':_0x184274[_0x8682('0x31')],'abandoned':_0x184274[_0x8682('0x32')],'waiting':_0x184274[_0x8682('0x33')],'loggedInDb':_0x184274['loggedInDb'],'dialActive':_0x184274[_0x8682('0x34')],'dialMethod':_0x184274[_0x8682('0x35')],'dialOriginateCallerIdName':_0x184274['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x184274[_0x8682('0x36')],'dialOriginateTimeout':_0x184274[_0x8682('0x37')],'dialPrefix':_0x184274[_0x8682('0x38')],'outboundAnswerAgiCallsDay':_0x184274[_0x8682('0x39')],'outboundAnswerCallsDay':_0x184274['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x184274['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x184274[_0x8682('0x3a')],'outboundCongestionCallsDay':_0x184274[_0x8682('0x3b')],'outboundDropCallsDayACS':_0x184274[_0x8682('0x3c')],'outboundDropCallsDayCallersExit':_0x184274['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x184274[_0x8682('0x3d')],'outboundNoAnswerCallsDay':_0x184274['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x184274[_0x8682('0x3e')],'outboundOriginateFailureCallsDay':_0x184274['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x184274[_0x8682('0x3f')],'outboundRejectCallsDay':_0x184274['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x184274[_0x8682('0x40')],'predictiveIntervalAnsweredCalls':_0x184274[_0x8682('0x41')],'predictiveIntervalAvgHoldtime':_0x184274[_0x8682('0x42')],'predictiveIntervalAvgTalktime':_0x184274[_0x8682('0x43')],'predictiveIntervalDroppedCallsCallersExit':_0x184274['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x184274[_0x8682('0x44')],'predictiveIntervalErlangCalls':_0x184274[_0x8682('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x184274[_0x8682('0x46')],'predictiveIntervalHitRate':_0x184274[_0x8682('0x47')],'predictiveIntervalMultiplicativeFactor':_0x184274[_0x8682('0x48')],'predictiveIntervalPauses':_0x184274[_0x8682('0x49')],'predictiveIntervalAvailable':_0x184274[_0x8682('0x4a')],'predictiveIntervalTotalCalls':_0x184274[_0x8682('0x4b')],'message':_0x184274[_0x8682('0x4c')],'originated':_0x184274['originated'],'erlangCalls':_0x184274['erlangCalls'],'erlangCallToSecond':_0x184274[_0x8682('0x4d')],'erlangAbandonmentRate':_0x184274[_0x8682('0x4e')],'erlangBusyFactor':_0x184274[_0x8682('0x4f')],'startPredictive':_0x184274['startPredictive'],'startProgressive':_0x184274[_0x8682('0x50')]};if(_0x184274[_0x8682('0x51')]){_0x24ba5e['Trunk']={'id':_0x184274['Trunk']['id'],'name':_0x184274[_0x8682('0x51')][_0x8682('0x52')],'active':_0x184274['Trunk'][_0x8682('0x53')],'callerid':_0x184274[_0x8682('0x51')][_0x8682('0x54')]};}if(_0x184274['Interval']){_0x24ba5e[_0x8682('0x55')]={'id':_0x184274[_0x8682('0x55')]['id'],'name':_0x184274[_0x8682('0x55')]['name']};}var _0x202111=md5(JSON[_0x8682('0x56')](_0x24ba5e));if(_0x184274['md5']!==_0x202111){_0x184274['md5']=_0x202111;emit(util[_0x8682('0x57')](_0x8682('0x58'),_0x24ba5e[_0x8682('0x52')]),_0x8682('0x59'),_0x24ba5e);}}}function emitVoiceQueueChannelRemove(_0x48f921){emit(util[_0x8682('0x57')](_0x8682('0x58'),_0x48f921[_0x8682('0x52')]),_0x8682('0x5a'),_0x48f921);}function notSendMessagesQueue(_0x14adeb){if(_0x14adeb['sendMessageOneNotActive']){if(_0x14adeb[_0x8682('0x5b')]===0x0&&_0x14adeb['pTalking']===0x0){_0x14adeb['sendMessageOneNotActive']=![];_0x14adeb[_0x8682('0x29')]=0x0;_0x14adeb[_0x8682('0x5c')]=0x0;_0x14adeb[_0x8682('0x4c')]='NOT_ACTIVE';ut[_0x8682('0x5d')](_0x8682('0x5e'),_0x14adeb[_0x8682('0x52')]+_0x8682('0x5f'));}else{_0x14adeb[_0x8682('0x4c')]=_0x8682('0x60');ut[_0x8682('0x5d')](_0x8682('0x5e'),_0x14adeb[_0x8682('0x52')]+_0x8682('0x61'));}emitCampaignPreview(_0x14adeb);}}Preview[_0x8682('0xe')][_0x8682('0x24')]=function(){var _0x45d989=this;setInterval(function(){_0x45d989[_0x8682('0x62')]();},0x7cf);};Preview[_0x8682('0xe')][_0x8682('0x62')]=function(){var _0x45035a=this[_0x8682('0x11')];this['clockClearZombieChannels']+=0x1;for(var _0x3f0a5f in _0x45035a){if(_0x45035a[_0x8682('0x63')](_0x3f0a5f)&&(_0x45035a[_0x3f0a5f][_0x8682('0x35')]===_0x8682('0x64')||_0x45035a[_0x3f0a5f][_0x8682('0x35')]===_0x8682('0x65'))&&_0x45035a[_0x3f0a5f][_0x8682('0x25')]===_0x8682('0x26')){if(this['clockClearZombieChannels']>0x7){this['clockClearZombieChannels']=0x0;this[_0x8682('0x66')]();}}if(_0x45035a[_0x8682('0x63')](_0x3f0a5f)&&_0x45035a[_0x3f0a5f][_0x8682('0x35')]==='preview'&&_0x45035a[_0x3f0a5f][_0x8682('0x25')]==='outbound'){if(_0x45035a[_0x3f0a5f][_0x8682('0x34')]){this['setMessage'](_0x45035a[_0x3f0a5f]);this[_0x8682('0x67')](_0x45035a[_0x3f0a5f]);}else{notSendMessagesQueue(_0x45035a[_0x3f0a5f]);}}}};Preview[_0x8682('0xe')]['clearZombieChannel']=function(_0x7ac105){var _0x36559c=this;this['sequence'][_0x8682('0x68')](function(){if(!_[_0x8682('0x69')](_0x36559c[_0x8682('0x14')][_0x7ac105])){loggerAction[_0x8682('0x6a')]('[clearZombieChannels][talking]',_0x7ac105,_0x8682('0x6b'),_0x36559c[_0x8682('0x14')][_0x7ac105][_0x8682('0x6c')],_0x8682('0x6d'),JSON[_0x8682('0x56')](_0x36559c[_0x8682('0x11')][_0x36559c[_0x8682('0x14')][_0x7ac105][_0x8682('0x6c')]][_0x8682('0x5b')]),_0x8682('0x6e'),JSON[_0x8682('0x56')](_0x36559c[_0x8682('0x11')][_0x36559c[_0x8682('0x14')][_0x7ac105]['queue']][_0x8682('0x2b')]),JSON[_0x8682('0x56')](_0x36559c[_0x8682('0x14')][_0x7ac105][_0x8682('0x6f')]),JSON[_0x8682('0x56')](_[_0x8682('0x70')](_0x36559c[_0x8682('0x14')][_0x7ac105],[_0x8682('0x71'),'UserId',_0x8682('0x72'),_0x8682('0x73')])));return ami[_0x8682('0x74')]({'action':_0x8682('0x75'),'channel':_0x36559c[_0x8682('0x14')][_0x7ac105]['channel']})[_0x8682('0x76')](function(_0x3a1da9){if(_0x3a1da9[_0x8682('0x4c')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x36559c[_0x8682('0x14')][_0x7ac105]){ut[_0x8682('0x77')](_0x36559c[_0x8682('0x11')][_0x36559c[_0x8682('0x14')][_0x7ac105][_0x8682('0x6c')]],'[clearZombieChannel]');if(_0x36559c[_0x8682('0x14')][_0x7ac105][_0x8682('0x6f')]===!![]){ut[_0x8682('0x78')](_0x36559c[_0x8682('0x11')][_0x36559c[_0x8682('0x14')][_0x7ac105][_0x8682('0x6c')]],'[clearZombieChannel]');ut[_0x8682('0x79')]('[Dialer][checkChannel][pTalking][Preview]'+_0x7ac105,_0x36559c[_0x8682('0x14')][_0x7ac105][_0x8682('0x6c')]);}ut['loggerError'](_0x8682('0x7a')+_0x7ac105,_0x36559c[_0x8682('0x14')][_0x7ac105][_0x8682('0x6c')]);delete _0x36559c[_0x8682('0x14')][_0x7ac105];}},0x2328);}});}});};Preview['prototype'][_0x8682('0x66')]=function(){var _0x578b7e=this;loggerAction[_0x8682('0x6a')]('[action]',_['size'](this[_0x8682('0x14')]));for(var _0x48b92b in this[_0x8682('0x14')]){if(_0x578b7e[_0x8682('0x14')][_0x8682('0x63')](_0x48b92b)){_0x578b7e[_0x8682('0x7b')](_0x48b92b);}}};Preview[_0x8682('0xe')][_0x8682('0x67')]=function(_0x5e528b){var _0x1f79b7=this;rpcDb[_0x8682('0x7c')](_0x5e528b['id'],ut['agentReadyId'](this[_0x8682('0x15')]))[_0x8682('0x7d')](function(_0x23a12d){if(!_[_0x8682('0x69')](_0x23a12d)){for(var _0x3cf9c5=0x0;_0x3cf9c5<_0x23a12d['length'];_0x3cf9c5+=0x1){if(ut[_0x8682('0x7e')](_0x23a12d[_0x3cf9c5][_0x8682('0x7f')])<_0x5e528b['dialRecallMeTimeout']*0x3c){_0x1f79b7[_0x8682('0x80')](_0x23a12d[_0x3cf9c5]['id'])[_0x8682('0x7d')](ut[_0x8682('0x81')](_0x8682('0x82')))[_0x8682('0x76')](ut[_0x8682('0x81')](_0x8682('0x82')));}else{var _0x131f89=new Action(_0x23a12d[_0x3cf9c5],_0x5e528b);_0x131f89[_0x8682('0x83')]=moment()[_0x8682('0x57')](_0x8682('0x84'));_0x5e528b[_0x8682('0x3f')]+=0x1;ut[_0x8682('0x85')](_0x131f89,0x17,_0x8682('0x86'));if(_0x5e528b[_0x8682('0x87')]){rpcDb['rescheduleContactInQueue'](ut['createBody'](_0x23a12d[_0x3cf9c5]));rpcDb['createCustomerHistory'](_0x131f89,_0x8682('0x88'));}else{ut[_0x8682('0x85')](_0x131f89,0x16,'RecallFailedTimeout');rpcDb[_0x8682('0x89')](_0x131f89,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x131f89,_0x8682('0x8a'));}}}}})[_0x8682('0x76')](ut[_0x8682('0x81')]('[getContactRecallMe]'));};Preview[_0x8682('0xe')]['setMessage']=function(_0x3c9799){_0x3c9799[_0x8682('0x8b')]=!![];if(ut['IsNotLoggedIn'](_0x3c9799['loggedIn'])){_0x3c9799[_0x8682('0x4c')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x8682('0x8c')](_0x3c9799[_0x8682('0x34')])){_0x3c9799[_0x8682('0x4c')]=_0x8682('0x8d');}else if(!this[_0x8682('0x8e')](_0x3c9799[_0x8682('0x51')])){if(!this[_0x8682('0x8e')](_0x3c9799[_0x8682('0x8f')])){_0x3c9799['message']=_0x8682('0x90');}else{_0x3c9799[_0x8682('0x4c')]='ACTIVE';}}else{_0x3c9799[_0x8682('0x4c')]=_0x8682('0x91');}emitCampaignPreview(_0x3c9799);};Preview[_0x8682('0xe')][_0x8682('0x92')]=function(_0x2eab6c,_0x29124e,_0x24be84){var _0x48fc54=this;var _0x1482d3=this['actions'][_0x29124e];var _0x21bb6f=this[_0x8682('0x11')][_0x1482d3[_0x8682('0x6c')]];var _0x4105e5;if(_0x21bb6f){switch(_0x24be84){case'1':_0x21bb6f[_0x8682('0x3e')]+=0x1;_0x1482d3[_0x8682('0x93')]=ut['totalGlobal'](_0x1482d3);ut[_0x8682('0x85')](_0x1482d3,0x0,'NoSuchNumber');rpcDb['createCustomerHistory'](_0x1482d3,'[callProgressDetectingCustomer][logNoSuch]');if(ut['totalGlobal'](_0x1482d3)>=_0x21bb6f[_0x8682('0x94')]){_0x4105e5=ut[_0x8682('0x95')](_0x1482d3,0xf,_0x8682('0x96'));rpcDb[_0x8682('0x97')](_0x4105e5,_0x8682('0x98'));}else{rpcDb[_0x8682('0x97')](_0x1482d3,'[callProgressDetectingCustomer][logNoSuchGlobal]');}delete this[_0x8682('0x14')][_0x2eab6c[_0x8682('0x99')]];break;case _0x8682('0x9a'):var _0x24d067=moment()[_0x8682('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0x1482d3[_0x8682('0x9b')]=_0x24d067;_0x1482d3[_0x8682('0x9c')]=_0x24d067;_0x1482d3[_0x8682('0x6f')]=!![];_0x21bb6f[_0x8682('0x2b')]+=0x1;logger[_0x8682('0x6a')](_0x8682('0x9d'),_0x1482d3[_0x8682('0x9e')],'\x20Queue',_0x21bb6f[_0x8682('0x52')],_0x8682('0x6e'),_0x21bb6f[_0x8682('0x2b')]);ami[_0x8682('0x9f')](_0x8682('0xa0'),ut['buildObj'](_0x1482d3,_0x8682('0xa1')));if(_0x21bb6f[_0x8682('0xa2')]){ami[_0x8682('0x9f')](_0x8682('0xa3'),ut[_0x8682('0xa4')](_0x1482d3));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0x8682('0xa5')](_0x1482d3,_0x8682('0xa6')));emitVoiceQueueChannelRemove(ut[_0x8682('0xa5')](_0x1482d3,_0x8682('0xa6')));_0x21bb6f[_0x8682('0xa7')]+=0x1;_0x21bb6f[_0x8682('0x30')]+=0x1;_0x21bb6f[_0x8682('0x28')]+=0x1;ut[_0x8682('0x78')](_0x21bb6f,'[16]');_0x1482d3[_0x8682('0x93')]=ut[_0x8682('0xa8')](_0x1482d3);ut[_0x8682('0x85')](_0x1482d3,0x4,_0x8682('0xa9'));rpcDb[_0x8682('0x89')](_0x1482d3,_0x8682('0xaa'));rpcDb[_0x8682('0x97')](_0x1482d3,_0x8682('0xab'));rpcDb[_0x8682('0xac')](_0x1482d3);_0x21bb6f[_0x8682('0x2d')]+=_0x1482d3[_0x8682('0xad')];_0x21bb6f[_0x8682('0x2c')]+=_0x1482d3[_0x8682('0xad')];logger[_0x8682('0x6a')](_0x8682('0xae'),_0x1482d3[_0x8682('0x9e')],_0x8682('0xaf'),_0x21bb6f[_0x8682('0x52')],_0x8682('0x6e'),_0x21bb6f[_0x8682('0x2b')]);delete this[_0x8682('0x14')][_0x2eab6c[_0x8682('0x99')]];break;case _0x8682('0xb0'):_0x21bb6f[_0x8682('0x3a')]+=0x1;_0x1482d3[_0x8682('0xb1')]+=0x1;_0x1482d3['countglobal']=ut[_0x8682('0xa8')](_0x1482d3);ut[_0x8682('0x85')](_0x1482d3,0x5,'Busy');rpcDb[_0x8682('0x89')](_0x1482d3,_0x8682('0xb2'));if(ut[_0x8682('0xa8')](_0x1482d3)>=_0x21bb6f[_0x8682('0x94')]){_0x4105e5=ut[_0x8682('0x95')](_0x1482d3,0xf,_0x8682('0x96'));rpcDb[_0x8682('0x97')](_0x4105e5,_0x8682('0xb3'));}else{if(_0x1482d3[_0x8682('0xb1')]>=_0x21bb6f[_0x8682('0xb4')]){rpcDb[_0x8682('0x97')](_0x1482d3,_0x8682('0xb2'));}else{rpcDb[_0x8682('0xb5')](ut[_0x8682('0xb6')](_0x1482d3,'countbusyretry',_0x21bb6f['dialBusyRetryFrequency']),_0x1482d3['unlockAgent'],_0x1482d3[_0x8682('0xb7')]);}}break;case _0x8682('0xb8'):_0x21bb6f[_0x8682('0xb9')]+=0x1;_0x1482d3[_0x8682('0xba')]+=0x1;_0x1482d3[_0x8682('0x93')]=ut[_0x8682('0xa8')](_0x1482d3);ut[_0x8682('0x85')](_0x1482d3,0x3,'NoAnswer');rpcDb['createCustomerHistory'](_0x1482d3,_0x8682('0xbb'));if(ut[_0x8682('0xa8')](_0x1482d3)>=_0x21bb6f[_0x8682('0x94')]){_0x4105e5=ut['cloneAction'](_0x1482d3,0xf,'Global');rpcDb[_0x8682('0x97')](_0x4105e5,_0x8682('0xbc'));}else{if(_0x1482d3[_0x8682('0xba')]>=_0x21bb6f['dialNoAnswerMaxRetry']){rpcDb[_0x8682('0x97')](_0x1482d3,_0x8682('0xbb'));}else{rpcDb[_0x8682('0xb5')](ut[_0x8682('0xb6')](_0x1482d3,'countnoanswerretry',_0x21bb6f[_0x8682('0xbd')]),_0x1482d3['unlockAgent'],_0x1482d3[_0x8682('0xb7')]);}}break;case _0x8682('0xbe'):_0x21bb6f[_0x8682('0x3b')]+=0x1;_0x1482d3[_0x8682('0xbf')]+=0x1;_0x1482d3[_0x8682('0x93')]=ut[_0x8682('0xa8')](_0x1482d3);ut[_0x8682('0x85')](_0x1482d3,0x8,_0x8682('0xc0'));rpcDb[_0x8682('0x89')](_0x1482d3,_0x8682('0xc1'));if(ut['totalGlobal'](_0x1482d3)>=_0x21bb6f[_0x8682('0x94')]){_0x4105e5=ut[_0x8682('0x95')](_0x1482d3,0xf,'Global');rpcDb[_0x8682('0x97')](_0x4105e5,_0x8682('0xc2'));}else{if(_0x1482d3[_0x8682('0xbf')]>=_0x21bb6f[_0x8682('0xc3')]){rpcDb[_0x8682('0x97')](_0x1482d3,_0x8682('0xc1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x1482d3,_0x8682('0xbf'),_0x21bb6f[_0x8682('0xc4')]),_0x1482d3['unlockAgent'],_0x1482d3[_0x8682('0xb7')]);}}break;case _0x8682('0xc5'):_0x21bb6f[_0x8682('0xc6')]+=0x1;_0x1482d3[_0x8682('0x93')]=ut[_0x8682('0xa8')](_0x1482d3);ut[_0x8682('0x85')](_0x1482d3,0x14,_0x8682('0xc7'));rpcDb[_0x8682('0x89')](_0x1482d3,'[syncHangupRequest][logAgentReject]');if(_0x1482d3['unlockAgent']){rpcDb['unlockContact'](_0x1482d3[_0x8682('0xc8')]);}if(_0x1482d3['activeContact']){rpcDb[_0x8682('0xc9')](_0x1482d3['idContact']);}break;default:if(_0x1482d3[_0x8682('0x6f')]){ut['decrementTalkink'](_0x21bb6f,'[default]');ut[_0x8682('0x79')](_0x8682('0xca')+_0x21bb6f[_0x8682('0x52')],_0x2eab6c);}_0x21bb6f[_0x8682('0x40')]+=0x1;_0x1482d3[_0x8682('0x93')]=ut[_0x8682('0xa8')](_0x1482d3);ut['logCustomer'](_0x1482d3,0xc,_0x2eab6c[_0x8682('0xcb')]||_0x2eab6c[_0x8682('0xcc')]);rpcDb['createCustomerHistory'](_0x1482d3,_0x8682('0xcd'));if(ut[_0x8682('0xa8')](_0x1482d3)>=_0x21bb6f['dialGlobalMaxRetry']){_0x4105e5=ut['cloneAction'](_0x1482d3,0xf,_0x8682('0x96'));rpcDb[_0x8682('0x97')](_0x4105e5,_0x8682('0xce'));}else{rpcDb[_0x8682('0x97')](_0x1482d3,_0x8682('0xce'));}delete this['actions'][_0x2eab6c[_0x8682('0x99')]];}if(!(_0x1482d3[_0x8682('0x6f')]&&_0x24be84==='16')){ut[_0x8682('0x77')](_0x21bb6f,'[callProgressDetectingCustomer]');logger[_0x8682('0x6a')](_0x8682('0xcf'),_0x1482d3[_0x8682('0x9e')],_0x8682('0xaf'),_0x21bb6f[_0x8682('0x52')],_0x8682('0x6d'),_0x21bb6f[_0x8682('0x5b')]);}if(_0x24be84!==_0x8682('0x9a')){delete this[_0x8682('0x14')][_0x2eab6c['linkedid']];delete this[_0x8682('0x14')][_0x2eab6c[_0x8682('0xd0')]];}}};Preview['prototype'][_0x8682('0xd1')]=function(_0x5bda6d,_0x4a2826,_0x2f6c00){if(_[_0x8682('0xd2')](_0x4a2826)&&_0x8682('0xd3')!==typeof _0x4a2826){return;}if(_[_0x8682('0xd2')](_0x2f6c00)&&_0x8682('0xd3')!==typeof _0x2f6c00){return;}switch(_0x2f6c00['reason']){case'0':ut[_0x8682('0xd4')](_0x5bda6d,0x0,_0x8682('0xd5'));rpcDb[_0x8682('0xd6')](_0x5bda6d,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0x5bda6d,0x3,'NoAnswer');rpcDb[_0x8682('0xd6')](_0x5bda6d,_0x8682('0xd7'));break;case'5':ut[_0x8682('0xd4')](_0x5bda6d,0x5,_0x8682('0xd8'));rpcDb[_0x8682('0xd6')](_0x5bda6d,_0x8682('0xd9'));break;case'8':ut[_0x8682('0xd4')](_0x5bda6d,0x8,_0x8682('0xc0'));rpcDb[_0x8682('0xd6')](_0x5bda6d,_0x8682('0xda'));break;case'22':ut[_0x8682('0xd4')](_0x5bda6d,0x16,'AnswerAGI');rpcDb[_0x8682('0xd6')](_0x5bda6d,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x8682('0xd4')](_0x5bda6d,0xc,_0x2f6c00[_0x8682('0xdb')]);rpcDb[_0x8682('0xd6')](_0x5bda6d,_0x8682('0xda'));}ut[_0x8682('0x77')](_0x4a2826,'[callProgressDetectingAgent]');logger[_0x8682('0x6a')](_0x8682('0xdc'),_0x5bda6d[_0x8682('0x9e')],_0x8682('0xaf'),_0x4a2826[_0x8682('0x52')],_0x8682('0x6d'),_0x4a2826['originated']);delete this['actions'][_0x5bda6d[_0x8682('0x9e')]];};Preview['prototype']['checkInBlack']=function(_0x3306ba,_0x306a20,_0x280f5b,_0xae7df5,_0x4e7292){var _0x460dc2=this;return new BPromise(function(_0x171178,_0x4aaa1e){if(_[_0x8682('0x69')](_0x306a20)||_[_0x8682('0x69')](_0x306a20[_0x8682('0xdd')])||_['isNil'](_0x306a20[_0x8682('0xdd')][_0x8682('0xde')])||_[_0x8682('0x69')](_0x306a20[_0x8682('0x72')])){_0x4aaa1e(ut[_0x8682('0x4c')]('Contact\x20is\x20undefined',_0xae7df5,_0x4e7292));return;}var _0x2c201d=uuid['v4']();var _0x1b50cb=_0x460dc2[_0x8682('0x11')][_0x306a20[_0x8682('0x6b')][_0x8682('0x52')]];var _0x4cc2d3=_0x280f5b?_0x460dc2[_0x8682('0x15')][_0x280f5b]['id']:undefined;_0x460dc2['actions'][_0x2c201d]=new Action(_0x306a20,_0x1b50cb,_0x2c201d,_0x280f5b,_0x4cc2d3);var _0x3f9c94=_0x460dc2[_0x8682('0x14')][_0x2c201d];_0x3f9c94[_0x8682('0xdf')]=_0xae7df5;_0x3f9c94[_0x8682('0xb7')]=_0x4e7292;_0x3f9c94[_0x8682('0xe0')]=_0x280f5b;if(_[_0x8682('0xe1')](_0x3306ba)){_0x460dc2[_0x8682('0xe2')](_0x3f9c94,_0x1b50cb,_0x306a20,_0x280f5b)[_0x8682('0x7d')](function(_0xd501c3){logger[_0x8682('0x6a')](_0x8682('0xe3'),_0x8682('0xe4')+_0x3f9c94[_0x8682('0x6c')]+_0x8682('0xe5')+_0x3f9c94[_0x8682('0xc8')],JSON['stringify'](_0xd501c3));ami[_0x8682('0x9f')](_0x8682('0xe6'),ut[_0x8682('0xa5')](_0x3f9c94,_0x8682('0xe7')));_0x171178(ut[_0x8682('0x4c')](_0x8682('0xe8')));})[_0x8682('0x76')](function(_0x30d5e1){ut[_0x8682('0x5d')](_0x8682('0xe9'),_0x30d5e1);_0x4aaa1e(ut['message'](_0x8682('0xea'),_0xae7df5,_0x4e7292));});}else{_0x1b50cb[_0x8682('0xeb')]+=0x1;ut['logBlacklist'](_0x3f9c94);rpcDb[_0x8682('0xec')](_0x3f9c94,'[Blacklist][error]');delete _0x460dc2['actions'][_0x2c201d];_0x4aaa1e(ut['message']('Contact\x20in\x20black\x20List',_0xae7df5,_0x4e7292));}});};Preview[_0x8682('0xe')][_0x8682('0x8e')]=function(_0x3901c5){return!_[_0x8682('0x69')](_0x3901c5)&&!_['isNil'](_0x3901c5[_0x8682('0x52')])&&!_[_0x8682('0x69')](_0x3901c5[_0x8682('0x53')])&&_0x3901c5[_0x8682('0x53')]&&!_[_0x8682('0x69')](this[_0x8682('0x13')][util[_0x8682('0x57')](_0x8682('0xed'),_0x3901c5['name'])])&&!_[_0x8682('0x69')](this[_0x8682('0x13')][util['format'](_0x8682('0xed'),_0x3901c5[_0x8682('0x52')])][_0x8682('0x75')])&&(this[_0x8682('0x13')][util[_0x8682('0x57')](_0x8682('0xed'),_0x3901c5[_0x8682('0x52')])]['status']===_0x8682('0xee')||this[_0x8682('0x13')][util[_0x8682('0x57')](_0x8682('0xed'),_0x3901c5[_0x8682('0x52')])]['status']===_0x8682('0xef'));};Preview['prototype'][_0x8682('0x80')]=function(_0x2f3a28,_0x5d5b1a){var _0x182ad3=this;return new BPromise(function(_0x405f6d,_0xf35146){_0x182ad3[_0x8682('0xf0')](_0x2f3a28,_0x5d5b1a)[_0x8682('0x7d')](function(_0x2f77fd){_0x405f6d(_[_0x8682('0x70')](_0x2f77fd,[_0x8682('0x4c')]));})[_0x8682('0x76')](function(_0x5e1117){if(_0x5e1117[_0x8682('0xf1')]){rpcDb[_0x8682('0xf2')](_0x2f3a28);}if(_0x5e1117[_0x8682('0x53')]){rpcDb[_0x8682('0xc9')](_0x2f3a28);}_0xf35146(_[_0x8682('0x70')](_0x5e1117,['message']));});});};Preview[_0x8682('0xe')][_0x8682('0xf0')]=function(_0x47c829,_0x136500){var _0x52f816=this;return new BPromise(function(_0x26b433,_0x2ec061){var _0x23828,_0x21a943;rpcDb['getContactPreview'](_0x47c829)[_0x8682('0x7d')](function(_0x5d4b19){if(!_[_0x8682('0x69')](_0x5d4b19[0x0])){_0x21a943=_0x5d4b19[0x0][_0x8682('0xf3')]?![]:!![];_0x23828=_0x5d4b19[0x0][_0x8682('0xf3')]?!![]:![];_0x23828=_0x136500?!![]:_0x23828;}var _0x148bb8=_0x52f816['validateContact'](_0x5d4b19);if(_0x148bb8['isValid']){rpcDb[_0x8682('0xf4')](_['pick'](_0x5d4b19[0x0],[_0x8682('0x72'),'Contact.phone']))[_0x8682('0x7d')](function(_0x2471a2){_0x52f816[_0x8682('0xf5')](_0x2471a2,_0x5d4b19[0x0],_0x136500,_0x21a943,_0x23828)[_0x8682('0x7d')](function(_0x5a53b0){_0x26b433(_0x5a53b0);})['catch'](function(_0x27dcf8){_0x2ec061(_0x27dcf8);});})[_0x8682('0x76')](function(_0x5fa1da){ut['logger'](_0x8682('0xf6'),_0x5fa1da);_0x2ec061(ut[_0x8682('0x4c')](_0x8682('0xf7'),_0x21a943,_0x23828));});}else{_0x2ec061(ut[_0x8682('0x4c')](_0x148bb8['message'],_0x21a943,_0x23828));}})[_0x8682('0x76')](function(_0x2babe3){ut[_0x8682('0x5d')](_0x8682('0xf8'),_0x2babe3);_0x2ec061(ut[_0x8682('0x4c')](_0x8682('0xf7'),![],!![]));});});};Preview['prototype'][_0x8682('0xf9')]=function(_0x30819c){if(_[_0x8682('0x69')](_0x30819c)||_[_0x8682('0xe1')](_0x30819c)||!_[_0x8682('0x69')](_0x30819c[0x0][_0x8682('0xfa')])&&_[_0x8682('0x69')](_0x30819c[0x0][_0x8682('0xfa')]['name'])){ut[_0x8682('0x5d')](_0x8682('0xfb'),_0x30819c);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x5eed53=this['campaignsPreview'][_0x30819c[0x0][_0x8682('0x6b')]['name']];_0x5eed53[_0x8682('0x4c')]=_0x8682('0x91');if(_['isNil'](_0x5eed53)){ut[_0x8682('0x5d')](_0x8682('0xfc'),_0x5eed53);return{'isValid':![],'message':_0x8682('0xfd')};}if(!this[_0x8682('0x8e')](_0x5eed53[_0x8682('0x51')])){ut[_0x8682('0x5d')](_0x8682('0xfe'),'campaign\x20Name:\x20'+_0x5eed53[_0x8682('0x52')]+_0x8682('0xff'));if(!this[_0x8682('0x8e')](_0x5eed53[_0x8682('0x8f')])){ut['logger'](_0x8682('0xfe'),_0x5eed53[_0x8682('0x52')]+_0x8682('0x100'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0x8682('0x8c')](_0x5eed53[_0x8682('0x34')])){ut[_0x8682('0x5d')](_0x8682('0x101'),_0x5eed53[_0x8682('0x52')]+_0x8682('0x102'));return{'isValid':![],'message':_0x8682('0x103')+_0x5eed53['name']+_0x8682('0x102')};}return{'isValid':!![],'message':_0x8682('0x104')};};Preview['prototype'][_0x8682('0xe2')]=function(_0x3b575b,_0x4607bb,_0x74e7fa,_0x2647b9){var _0x43a9f5=this;return new BPromise(function(_0x3b3557,_0x56357d){var _0xfbe6c1=_0x3b575b['uniqueid'];var _0x32d3fa=_0x43a9f5['isTrunkReachable'](_0x4607bb[_0x8682('0x51')])?util[_0x8682('0x57')]('SIP/%s/%s%s',_0x4607bb['Trunk'][_0x8682('0x52')],_[_0x8682('0x69')](_0x4607bb['dialPrefix'])?'':_0x4607bb[_0x8682('0x38')]['trim']()||'',_0x4607bb[_0x8682('0x105')]>0x0?_0x74e7fa['Contact'][_0x8682('0xde')][_0x8682('0x106')](_0x4607bb[_0x8682('0x105')]):_0x74e7fa['Contact'][_0x8682('0xde')]):util['format'](_0x8682('0x107'),_[_0x8682('0x69')](_0x4607bb[_0x8682('0x8f')])?_0x4607bb[_0x8682('0x51')][_0x8682('0x52')]:_0x4607bb['TrunkBackup'][_0x8682('0x52')],_[_0x8682('0x69')](_0x4607bb[_0x8682('0x38')])?'':_0x4607bb[_0x8682('0x38')][_0x8682('0x108')]()||'',_0x4607bb[_0x8682('0x105')]>0x0?_0x74e7fa[_0x8682('0xdd')][_0x8682('0xde')][_0x8682('0x106')](_0x4607bb[_0x8682('0x105')]):_0x74e7fa[_0x8682('0xdd')][_0x8682('0xde')]);var _0x36938d=_0x43a9f5[_0x8682('0x8e')](_0x4607bb['Trunk'])?ut[_0x8682('0x109')](_0x4607bb[_0x8682('0x51')][_0x8682('0x54')],_0x4607bb[_0x8682('0x10a')],_0x4607bb['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x8682('0x10b')](_0x4607bb[_0x8682('0x36')],_0x4607bb['dialRandomLastDigitCallerIdNumber']):_0x4607bb[_0x8682('0x36')]):ut[_0x8682('0x109')](_[_0x8682('0x69')](_0x4607bb[_0x8682('0x8f')])?_0x4607bb[_0x8682('0x51')][_0x8682('0x54')]:_0x4607bb['TrunkBackup']['callerid'],_0x4607bb[_0x8682('0x10a')],_0x4607bb[_0x8682('0x10c')]>0x0?ut[_0x8682('0x10b')](_0x4607bb['dialOriginateCallerIdNumber'],_0x4607bb[_0x8682('0x10c')]):_0x4607bb[_0x8682('0x36')]);if(_0x36938d){_0x3b575b[_0x8682('0x10d')]=ut[_0x8682('0x10e')](_0x36938d);_0x3b575b['originatecalleridnum']=ut[_0x8682('0x10f')](_0x36938d);}var _0x250fdf=ut['addVariables'](_0x4607bb,_0x74e7fa,_0x32d3fa,_0x36938d,_0xfbe6c1,_0x3b575b);_[_0x8682('0x110')](_0x3b575b,ut['toLowerVariables'](_0x250fdf));_0x3b575b['starttime']=moment()['format'](_0x8682('0x84'));ami[_0x8682('0x74')](ut[_0x8682('0x111')](_0x3b575b,_0x4607bb,_0x250fdf,_0x3b575b['activeContact'],_0x2647b9))[_0x8682('0x7d')](function(_0x36ac){_0x4607bb['originated']+=0x1;logger[_0x8682('0x6a')](_0x8682('0x112'),_0xfbe6c1,_0x8682('0xaf'),_0x4607bb[_0x8682('0x52')],_0x8682('0x6d'),_0x4607bb[_0x8682('0x5b')]);_0x3b3557(_0x36ac);})[_0x8682('0x76')](function(_0x74a526){ut[_0x8682('0xd4')](_0x3b575b,0xe,_0x8682('0x113'));rpcDb['createAgentHistory'](_0x3b575b,'[originateFailure][logOriginateFailure]');_0x56357d(_0x74a526);});});};Preview['prototype']['syncNewExten']=function(_0x213495){if(this[_0x8682('0x14')][_0x213495[_0x8682('0x99')]]){this[_0x8682('0x14')][_0x213495[_0x8682('0x99')]][_0x8682('0x114')]=_0x213495[_0x8682('0x114')];}};Preview['prototype'][_0x8682('0x115')]=function(_0x4f6060){var _0x5a0b96=this;var _0x507bbe=this[_0x8682('0x14')][_0x4f6060[_0x8682('0x116')]];if(_0x507bbe){if(_0x507bbe['lookAgent']&&this[_0x8682('0x15')][_0x507bbe[_0x8682('0xe0')]]){ut[_0x8682('0x117')](_0x507bbe,this[_0x8682('0x15')][_0x507bbe[_0x8682('0xe0')]][_0x8682('0x52')],this[_0x8682('0x15')][_0x507bbe[_0x8682('0xe0')]]['id']);}var _0x4ea7e1=_['clone'](_0x507bbe);_0x4ea7e1[_0x8682('0x9b')]=moment()[_0x8682('0x57')]('YYYY-MM-DD\x20HH:mm:ss');var _0x45e303=_0x5a0b96[_0x8682('0x11')][_0x507bbe[_0x8682('0x6c')]];if(ut[_0x8682('0x118')](_0x4f6060[_0x8682('0x119')])){if(_0x507bbe[_0x8682('0xdf')]){rpcDb[_0x8682('0xf2')](_0x507bbe[_0x8682('0xc8')]);}if(_0x507bbe[_0x8682('0xb7')]){rpcDb['disableContact'](_0x507bbe['idContact']);}ami[_0x8682('0x9f')](_0x8682('0x11a'),ut['buildObj'](_0x507bbe,_0x8682('0x11b')));this[_0x8682('0xd1')](_0x4ea7e1,_0x45e303,_0x4f6060);}else{_0x507bbe[_0x8682('0x83')]=moment()['format'](_0x8682('0x84'));ut[_0x8682('0xd4')](_0x4ea7e1,0x4,_0x8682('0xa9'));rpcDb[_0x8682('0xd6')](_0x4ea7e1,_0x8682('0x11c'));}}};Preview[_0x8682('0xe')]['syncHangup']=function(_0x156c3f){var _0x32b22b=this;var _0x558f7e=this['actions'][_0x156c3f['linkedid']];var _0x4f18e9;if(_0x558f7e){_0x4f18e9=this['campaignsPreview'][_0x558f7e['queue']];logger[_0x8682('0x6a')](_0x8682('0x11d'),_0x156c3f[_0x8682('0x99')],_0x8682('0xaf'),_0x4f18e9[_0x8682('0x52')],_0x8682('0x6e'),_0x4f18e9[_0x8682('0x2b')]);}if(this['actions'][_0x156c3f[_0x8682('0x99')]]&&_0x156c3f[_0x8682('0x99')]!==_0x156c3f['uniqueid']){if(_0x156c3f[_0x8682('0x11e')]==='16'&&this[_0x8682('0x14')][_0x156c3f[_0x8682('0x99')]][_0x8682('0x6f')]){this[_0x8682('0x92')](_0x156c3f,_0x156c3f[_0x8682('0x99')],_0x156c3f[_0x8682('0x11e')]);}else if(this[_0x8682('0x14')][_0x156c3f[_0x8682('0x99')]][_0x8682('0x6f')]){logger[_0x8682('0x6a')](_0x8682('0x11f'),_0x156c3f['linkedid'],_0x156c3f[_0x8682('0x11e')],_0x8682('0xaf'),_0x4f18e9['name'],_0x8682('0x6e'),_0x4f18e9['pTalking']);this[_0x8682('0x92')](_0x156c3f,_0x156c3f[_0x8682('0x99')],_0x156c3f[_0x8682('0x11e')]);}}else if(_0x558f7e&&_['isNil'](_0x558f7e[_0x8682('0x120')])&&_0x4f18e9[_0x8682('0x121')]&&_0x156c3f['linkedid']===_0x156c3f['uniqueid']&&_[_0x8682('0x69')](_0x156c3f[_0x8682('0xdb')])&&_0x156c3f[_0x8682('0x11e')]==='16'&&_0x156c3f[_0x8682('0x122')]==='6'&&_[_0x8682('0xd2')](_0x558f7e[_0x8682('0x123')])){if(_0x558f7e[_0x8682('0xdf')]){rpcDb['unlockContact'](_0x558f7e[_0x8682('0xc8')]);}if(_0x558f7e[_0x8682('0xb7')]){rpcDb[_0x8682('0xc9')](_0x558f7e[_0x8682('0xc8')]);}_0x156c3f['reason']='22';this[_0x8682('0xd1')](_0x558f7e,_0x4f18e9,_0x156c3f);}else if(_0x558f7e&&_0x558f7e[_0x8682('0x123')]){if(_0x156c3f[_0x8682('0x11e')]==='16'&&this['actions'][_0x156c3f[_0x8682('0x99')]][_0x8682('0x6f')]){logger['info']('[syncHangup][talking][transfer]',_0x156c3f[_0x8682('0x99')],_0x156c3f[_0x8682('0x11e')],_0x8682('0xaf'),_0x4f18e9[_0x8682('0x52')],_0x8682('0x6e'),_0x4f18e9['pTalking']);this[_0x8682('0x92')](_0x156c3f,_0x156c3f[_0x8682('0x99')],_0x156c3f['cause']);}else if(this[_0x8682('0x14')][_0x156c3f[_0x8682('0x99')]][_0x8682('0x6f')]){logger[_0x8682('0x6a')](_0x8682('0x11f'),_0x156c3f[_0x8682('0x99')],_0x156c3f[_0x8682('0x11e')],'\x20Queue',_0x4f18e9[_0x8682('0x52')],_0x8682('0x6e'),_0x4f18e9['pTalking']);this[_0x8682('0x92')](_0x156c3f,_0x156c3f[_0x8682('0x99')],_0x156c3f[_0x8682('0x11e')]);}}};Preview[_0x8682('0xe')][_0x8682('0x1d')]=function(_0x3cb7c9){if(this[_0x8682('0x14')][_0x3cb7c9['destlinkedid']]&&_0x3cb7c9[_0x8682('0xd0')]!==_0x3cb7c9['destuniqueid']){this['callProgressDetectingCustomer'](_0x3cb7c9,_0x3cb7c9[_0x8682('0xd0')],_0x3cb7c9[_0x8682('0xcc')]);}};Preview[_0x8682('0xe')][_0x8682('0x1b')]=function(_0x2c516b){if(this[_0x8682('0x14')][_0x2c516b[_0x8682('0x99')]]&&_0x2c516b[_0x8682('0x99')]!==_0x2c516b[_0x8682('0x9e')]&&!this[_0x8682('0x14')][_0x2c516b['linkedid']][_0x8682('0x6f')]){if(_0x2c516b[_0x8682('0x11e')]==='1'){this[_0x8682('0x92')](_0x2c516b,_0x2c516b[_0x8682('0x99')],_0x2c516b[_0x8682('0x11e')]);}}};Preview[_0x8682('0xe')]['addVariable']=function(_0x1c6654,_0x45dfd7,_0x4f7362){if(this[_0x8682('0x14')][_0x1c6654]){if(_['isNil'](this[_0x8682('0x14')][_0x1c6654][_0x8682('0x124')])){this[_0x8682('0x14')][_0x1c6654][_0x8682('0x124')]={};}this['actions'][_0x1c6654][_0x8682('0x124')][_0x45dfd7]=_0x4f7362;}};Preview['prototype']['syncVarSet']=function(_0xb61569){try{if(!_['isNil'](_0xb61569)){if(ut[_0x8682('0x125')](_[_0x8682('0x126')](_0xb61569[_0x8682('0x127')])[0x0])){this[_0x8682('0x128')](_0xb61569[_0x8682('0x9e')],_[_0x8682('0x126')](_0xb61569[_0x8682('0x127')])[0x0],_0xb61569['value']);}}}catch(_0x1a545f){logger['error']('[syncVarSet][Preview]',util[_0x8682('0x129')](_0x1a545f,{'showHidden':![],'depth':null}));}};Preview[_0x8682('0xe')][_0x8682('0x22')]=function(_0x14824f){if(_0x14824f){if(this['actions'][_0x14824f[_0x8682('0x12a')]]){this[_0x8682('0x14')][_0x14824f[_0x8682('0x12a')]][_0x8682('0x123')]=!![];}}};Preview['prototype'][_0x8682('0x23')]=function(_0x1226d6){if(_0x1226d6){if(this[_0x8682('0x14')][_0x1226d6[_0x8682('0x12b')]]){this[_0x8682('0x14')][_0x1226d6['transfererlinkedid']][_0x8682('0x123')]=!![];}}};module[_0x8682('0x12c')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index a5d0e08..95c9056 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 _0x18e6=['queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum'];(function(_0x3758f1,_0x5180d2){var _0x3548bb=function(_0x214de4){while(--_0x214de4){_0x3758f1['push'](_0x3758f1['shift']());}};_0x3548bb(++_0x5180d2);}(_0x18e6,0x187));var _0x618e=function(_0x326ef2,_0x31c213){_0x326ef2=_0x326ef2-0x0;var _0x16c194=_0x18e6[_0x326ef2];return _0x16c194;};'use strict';var util=require(_0x618e('0x0'));var BPromise=require(_0x618e('0x1'));var logger=require(_0x618e('0x2'))(_0x618e('0x3'));var _=require(_0x618e('0x4'));var cmHopper=require(_0x618e('0x5'));var cmHopperFinal=require(_0x618e('0x6'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x618e('0x7'));var voiceQueueRt=require(_0x618e('0x8'));var agentReportPreview=require(_0x618e('0x9'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x3f568f){return function(_0x1fdc18){logger[_0x618e('0xa')](_0x3f568f,util['inspect'](_0x1fdc18,{'showHidden':![],'depth':null}));};}function create(_0x3f54e2){return BPromise[_0x618e('0xb')]()[_0x618e('0xc')](cmHopperHistory[_0x618e('0xd')](_0x3f54e2))[_0x618e('0xe')](loggerCatch(_0x618e('0xf')));}function createAgent(_0x2b097e){return BPromise[_0x618e('0xb')]()[_0x618e('0xc')](agentReportPreview[_0x618e('0xd')](_0x2b097e))[_0x618e('0xe')](loggerCatch(_0x618e('0xf')));}function moveContact(_0x371d1e){return BPromise[_0x618e('0xb')]()[_0x618e('0xc')](cmHopper[_0x618e('0x10')](_0x371d1e,!![]))[_0x618e('0xe')](loggerCatch(_0x618e('0x11')));}exports['checkIsBlackList']=function(_0x52990a){return BPromise[_0x618e('0xb')]()[_0x618e('0xc')](cmHopperBlack[_0x618e('0x12')](_0x52990a))[_0x618e('0xe')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x618e('0x13')]=function(_0x15a428){return BPromise['resolve']()['then'](cmHopper['getContactPreview'](_0x15a428))[_0x618e('0xe')](loggerCatch(_0x618e('0x14')));};exports[_0x618e('0xd')]=function(_0x35e942,_0x1f6cc4){create(_0x35e942)[_0x618e('0xe')](loggerCatch(_0x1f6cc4));moveContact(_0x35e942)[_0x618e('0xe')](loggerCatch(_0x1f6cc4));};exports['createAgentHistory']=function(_0x273dbf,_0xa8c76){createAgent(_0x273dbf)[_0x618e('0xe')](loggerCatch(_0xa8c76));};exports['createCustomerHistory']=function(_0x14ff82,_0x4a93df){create(_0x14ff82)[_0x618e('0xe')](loggerCatch(_0x4a93df));};exports[_0x618e('0x15')]=function(_0x35f2dc,_0x32f0b7){moveContact(_0x35f2dc)[_0x618e('0xe')](loggerCatch(_0x32f0b7));};exports[_0x618e('0x16')]=function(_0x423cbe,_0x19aa27,_0x3f4dbc){if(_0x19aa27){_0x423cbe[_0x618e('0x17')]=null;}if(_0x3f4dbc){_0x423cbe[_0x618e('0x18')]=![];}return BPromise[_0x618e('0xb')]()[_0x618e('0xc')](cmHopper[_0x618e('0x16')](_0x423cbe))[_0x618e('0xe')](loggerCatch(_0x618e('0x19')));};exports[_0x618e('0x1a')]=function(_0x4a3365){return BPromise[_0x618e('0xb')]()[_0x618e('0xc')](cmHopper[_0x618e('0x1a')](_0x4a3365))[_0x618e('0xe')](loggerCatch('[countReScheduled]\x20'));};exports[_0x618e('0x1b')]=function(_0x312876){return BPromise['resolve']()[_0x618e('0xc')](cmHopper[_0x618e('0x1b')]({'UserId':null},_0x312876,0x1))[_0x618e('0xe')](loggerCatch('[unlockContact]\x20'));};exports['disableContact']=function(_0x6057e6){return BPromise[_0x618e('0xb')]()[_0x618e('0xc')](cmHopper[_0x618e('0x1b')]({'active':![]},_0x6057e6,0x1))['catch'](loggerCatch(_0x618e('0x1c')));};exports[_0x618e('0x1d')]=function(_0x455eca){var _0x5961b4={};_0x5961b4[_0x618e('0x1e')]=_0x455eca[_0x618e('0x1e')];_0x5961b4['uniqueid']=_0x455eca[_0x618e('0x1f')];_0x5961b4[_0x618e('0x20')]=_0x455eca[_0x618e('0x20')];_0x5961b4['calleridname']=_0x455eca['calleridname'];_0x5961b4[_0x618e('0x21')]=_0x455eca[_0x618e('0x21')];_0x5961b4[_0x618e('0x22')]=_0x455eca[_0x618e('0x23')];_0x5961b4[_0x618e('0x24')]=_0x455eca[_0x618e('0x23')];_0x5961b4['queuecallercomplete']=0x1;_0x5961b4[_0x618e('0x25')]=_0x455eca[_0x618e('0x26')];_0x5961b4[_0x618e('0x27')]=_0x455eca[_0x618e('0x28')];_0x5961b4[_0x618e('0x29')]=_0x618e('0x2a');_0x5961b4[_0x618e('0x2b')]=_0x618e('0x2c');_0x5961b4[_0x618e('0x2d')]=0x0;_0x5961b4['assigned']=0x1;_0x5961b4[_0x618e('0x2e')]=_0x455eca[_0x618e('0x28')];_0x5961b4[_0x618e('0x2f')]=_0x618e('0x30');return BPromise[_0x618e('0xb')]()[_0x618e('0xc')](voiceQueueReport['create'](_0x5961b4))[_0x618e('0xe')](loggerCatch(_0x618e('0x31')));};exports[_0x618e('0x32')]=function(_0x3a14aa,_0xdaaebe){return BPromise['resolve']()[_0x618e('0xc')](cmHopper['getContactRecallMe'](_0x3a14aa,_0xdaaebe))[_0x618e('0xe')](loggerCatch(_0x618e('0x33')));};exports['rescheduleContactInQueue']=function(_0x290fbf){return BPromise[_0x618e('0xb')]()[_0x618e('0xc')](cmHopper[_0x618e('0x16')](_0x290fbf,!![],!![]))[_0x618e('0xe')](loggerCatch(_0x618e('0x34')));}; \ No newline at end of file +var _0x9bea=['COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopperFinal','../rpc/cmHopperHistory','error','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','endtime','context','from-sip','exten','xcally-motion-preview','holdtime','lastAssignedTo','membername'];(function(_0x24e65c,_0x498667){var _0x38e091=function(_0x8ebfea){while(--_0x8ebfea){_0x24e65c['push'](_0x24e65c['shift']());}};_0x38e091(++_0x498667);}(_0x9bea,0x13e));var _0xa9be=function(_0x7898b5,_0x2a685){_0x7898b5=_0x7898b5-0x0;var _0x2793f0=_0x9bea[_0x7898b5];return _0x2793f0;};'use strict';var util=require(_0xa9be('0x0'));var BPromise=require('bluebird');var logger=require(_0xa9be('0x1'))(_0xa9be('0x2'));var _=require(_0xa9be('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0xa9be('0x4'));var cmHopperHistory=require(_0xa9be('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x2d26c7){return function(_0x1b6289){logger[_0xa9be('0x6')](_0x2d26c7,util['inspect'](_0x1b6289,{'showHidden':![],'depth':null}));};}function create(_0x194f5a){return BPromise[_0xa9be('0x7')]()['then'](cmHopperHistory[_0xa9be('0x8')](_0x194f5a))[_0xa9be('0x9')](loggerCatch(_0xa9be('0xa')));}function createAgent(_0x31bc07){return BPromise[_0xa9be('0x7')]()['then'](agentReportPreview[_0xa9be('0x8')](_0x31bc07))[_0xa9be('0x9')](loggerCatch(_0xa9be('0xa')));}function moveContact(_0x3136d2){return BPromise['resolve']()[_0xa9be('0xb')](cmHopper[_0xa9be('0xc')](_0x3136d2,!![]))[_0xa9be('0x9')](loggerCatch(_0xa9be('0xd')));}exports['checkIsBlackList']=function(_0x417362){return BPromise[_0xa9be('0x7')]()[_0xa9be('0xb')](cmHopperBlack[_0xa9be('0xe')](_0x417362))[_0xa9be('0x9')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xa9be('0xf')]=function(_0x269bbe){return BPromise['resolve']()[_0xa9be('0xb')](cmHopper[_0xa9be('0xf')](_0x269bbe))['catch'](loggerCatch(_0xa9be('0x10')));};exports[_0xa9be('0x8')]=function(_0x5184b2,_0x309654){create(_0x5184b2)[_0xa9be('0x9')](loggerCatch(_0x309654));moveContact(_0x5184b2)[_0xa9be('0x9')](loggerCatch(_0x309654));};exports[_0xa9be('0x11')]=function(_0x1d5027,_0x1bcf80){createAgent(_0x1d5027)[_0xa9be('0x9')](loggerCatch(_0x1bcf80));};exports[_0xa9be('0x12')]=function(_0x10d9e9,_0x5aaacb){create(_0x10d9e9)['catch'](loggerCatch(_0x5aaacb));};exports[_0xa9be('0x13')]=function(_0x429929,_0x4f3768){moveContact(_0x429929)['catch'](loggerCatch(_0x4f3768));};exports[_0xa9be('0x14')]=function(_0xa7903c,_0x18e7aa,_0x48a4b8){if(_0x18e7aa){_0xa7903c[_0xa9be('0x15')]=null;}if(_0x48a4b8){_0xa7903c[_0xa9be('0x16')]=![];}return BPromise[_0xa9be('0x7')]()[_0xa9be('0xb')](cmHopper[_0xa9be('0x14')](_0xa7903c))[_0xa9be('0x9')](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0x210a21){return BPromise['resolve']()[_0xa9be('0xb')](cmHopper[_0xa9be('0x17')](_0x210a21))[_0xa9be('0x9')](loggerCatch(_0xa9be('0x18')));};exports['unlockContact']=function(_0x3a2297){return BPromise['resolve']()['then'](cmHopper[_0xa9be('0x19')]({'UserId':null},_0x3a2297,0x1))['catch'](loggerCatch(_0xa9be('0x1a')));};exports[_0xa9be('0x1b')]=function(_0x5c0f4f){return BPromise[_0xa9be('0x7')]()[_0xa9be('0xb')](cmHopper[_0xa9be('0x19')]({'active':![]},_0x5c0f4f,0x1))[_0xa9be('0x9')](loggerCatch(_0xa9be('0x1c')));};exports[_0xa9be('0x1d')]=function(_0xa1442c){var _0x10d660={};_0x10d660['type']=_0xa1442c['type'];_0x10d660[_0xa9be('0x1e')]=_0xa1442c[_0xa9be('0x1e')];_0x10d660[_0xa9be('0x1f')]=_0xa1442c[_0xa9be('0x1f')];_0x10d660[_0xa9be('0x20')]=_0xa1442c[_0xa9be('0x20')];_0x10d660[_0xa9be('0x21')]=_0xa1442c['queue'];_0x10d660[_0xa9be('0x22')]=_0xa1442c[_0xa9be('0x23')];_0x10d660[_0xa9be('0x24')]=_0xa1442c[_0xa9be('0x23')];_0x10d660['queuecallercomplete']=0x1;_0x10d660[_0xa9be('0x25')]=_0xa1442c[_0xa9be('0x26')];_0x10d660['connectedlinename']=_0xa1442c['membername'];_0x10d660[_0xa9be('0x27')]=_0xa9be('0x28');_0x10d660[_0xa9be('0x29')]=_0xa9be('0x2a');_0x10d660[_0xa9be('0x2b')]=0x0;_0x10d660['assigned']=0x1;_0x10d660[_0xa9be('0x2c')]=_0xa1442c[_0xa9be('0x2d')];_0x10d660['queuecallerexitreason']=_0xa9be('0x2e');return BPromise[_0xa9be('0x7')]()[_0xa9be('0xb')](voiceQueueReport['create'](_0x10d660))['catch'](loggerCatch(_0xa9be('0x2f')));};exports['getContactRecallMe']=function(_0x4a2794,_0x2d9e39){return BPromise[_0xa9be('0x7')]()[_0xa9be('0xb')](cmHopper[_0xa9be('0x30')](_0x4a2794,_0x2d9e39))[_0xa9be('0x9')](loggerCatch(_0xa9be('0x31')));};exports[_0xa9be('0x32')]=function(_0x28e5c0){return BPromise[_0xa9be('0x7')]()[_0xa9be('0xb')](cmHopper[_0xa9be('0x14')](_0x28e5c0,!![],!![]))['catch'](loggerCatch(_0xa9be('0x33')));}; \ 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 c2e5ba4..5374c00 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 _0x6812=['dialQueueProject2','\x22agi://%s/square,%s\x22','originatecalleridnum','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','state','ringtime','logLookAgent','membername','UserId','talktime','answertime','Failure','RECALL','BOOKED','uniqueid','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countnoanswerretry','clone','Global','active','scheduledat','add','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','queue','interface','buildAcw','agentReadyId','not_inuse','status','reachable','milliseconds','CampaignId','filterKey','idContact','type','dialAnswer','countcongestionretry','callbackuniqueid','callbackat','recallme','sipcallid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqosjitter','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','match','util','lodash','moment','../../../../config/logger','preview','env','diff','seconds','loggerCatch','inspect','info','loggerError','error','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','NONE'];(function(_0x6992db,_0x437e87){var _0x3ee642=function(_0x2efafe){while(--_0x2efafe){_0x6992db['push'](_0x6992db['shift']());}};_0x3ee642(++_0x437e87);}(_0x6812,0x1e9));var _0x2681=function(_0x1f73d8,_0x256102){_0x1f73d8=_0x1f73d8-0x0;var _0x2a574a=_0x6812[_0x1f73d8];return _0x2a574a;};'use strict';var util=require(_0x2681('0x0'));var _=require(_0x2681('0x1'));var moment=require(_0x2681('0x2'));var logger=require(_0x2681('0x3'))(_0x2681('0x4'));var ipAgi=process[_0x2681('0x5')]['XCALLY_IP_AGI']||'127.0.0.1';function getSeconds(_0x3e0d9e,_0x3ed9e8){var _0x182083=moment(_0x3e0d9e)['milliseconds'](0x0);var _0x2c7766=moment(_0x3ed9e8)['milliseconds'](0x0);return _0x182083[_0x2681('0x6')](_0x2c7766,_0x2681('0x7'));}exports[_0x2681('0x8')]=function(_0x51a005){return function(_0x306137){logger['error'](_0x51a005,util[_0x2681('0x9')](_0x306137,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x34babc,_0x5bad7b){logger[_0x2681('0xa')](_0x34babc,util[_0x2681('0x9')](_0x5bad7b,{'showHidden':![],'depth':null}));};exports[_0x2681('0xb')]=function(_0x271bd9,_0x174d95){logger[_0x2681('0xc')](_0x271bd9,util[_0x2681('0x9')](_0x174d95,{'showHidden':![],'depth':null}));};exports[_0x2681('0xd')]=function(_0x249293){return function(_0x291d26){logger[_0x2681('0xa')](_0x249293,util['inspect'](_0x291d26,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x1c8f37,_0x474be4,_0x207bbf){return{'message':_0x1c8f37,'unlock':_0x474be4,'active':_0x207bbf};};exports[_0x2681('0xe')]=function(_0x51160c,_0x1bbd6f,_0x363c36){if(!_[_0x2681('0xf')](_0x363c36)&&_0x2681('0x10')===typeof _0x363c36&&!_[_0x2681('0x11')](_0x363c36)){if(!_[_0x2681('0xf')](_0x1bbd6f)&&_0x2681('0x10')===typeof _0x1bbd6f&&!_[_0x2681('0x11')](_0x1bbd6f)){return util[_0x2681('0x12')](_0x2681('0x13'),_0x1bbd6f,_0x363c36);}return util['format'](_0x2681('0x13'),_0x363c36,_0x363c36);}if(!_[_0x2681('0xf')](_0x51160c)&&_0x2681('0x10')===typeof _0x51160c&&!_[_0x2681('0x11')](_0x51160c)){return _0x51160c;}return _0x2681('0x14');};exports['isActive']=function(_0x4f3b84){if(_[_0x2681('0x15')](_0x4f3b84)){return![];}return _0x4f3b84;};exports[_0x2681('0x16')]=function(_0x2ad795,_0x314be7,_0x41cfcf,_0x4374dc,_0x10f582,_0x1e6564){var _0x454c52={'XMD-QUEUE':_0x314be7[_0x2681('0x17')]?_0x314be7[_0x2681('0x17')][_0x2681('0x18')]:'','XMD-CALLERID':_0x4374dc,'XMD-CALLERID-PREVIEW':_0x1e6564?util[_0x2681('0x12')](_0x2681('0x13'),_0x1e6564[_0x2681('0x19')],_0x1e6564[_0x2681('0x1a')]):_0x4374dc,'XMD-DIALID':_0x10f582,'XMD-CONTACTID':_0x314be7[_0x2681('0x1b')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x4374dc,'XMD-VOICEQUEUEID':_0x314be7[_0x2681('0x1c')],'XMD-DIALCHANNEL':_0x41cfcf,'XMD-DIALTIMEOUT':_0x2ad795[_0x2681('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x2681('0x12')](_0x2681('0x1e'),_0x2ad795['dialQueueProject2']?'g':'',_[_0x2681('0x11')](_0x2ad795[_0x2681('0x1f')])?'':_0x2681('0x20')),'XMD-DIALURL':_0x2ad795['dialPreviewUrl']||'','XMD-AGI':_0x2ad795[_0x2681('0x21')]?util[_0x2681('0x12')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2ad795[_0x2681('0x21')]):_0x2681('0x22'),'XMD-AGIAFTER':_0x2ad795[_0x2681('0x23')]?util[_0x2681('0x12')](_0x2681('0x24'),ipAgi,_0x2ad795[_0x2681('0x23')]):_0x2681('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x1e6564?_0x1e6564[_0x2681('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x1e6564?_0x1e6564['originatecalleridname']:'','XMD-DESTINATION':_0x2681('0x26')};if(!_[_0x2681('0x11')](_0x2ad795[_0x2681('0x1f')])){_0x454c52[util[_0x2681('0x12')]('%s',_0x2681('0x27'))]=_0x2ad795[_0x2681('0x1f')];_0x454c52[util[_0x2681('0x12')]('%s',_0x2681('0x28'))]=_0x10f582;}if(_0x314be7&&_0x314be7[_0x2681('0x29')]){for(var _0x17f48b in _0x314be7[_0x2681('0x29')]){if(_0x314be7[_0x2681('0x29')][_0x2681('0x2a')](_0x17f48b)){if(!_[_0x2681('0x15')](_0x314be7[_0x2681('0x29')][_0x17f48b])&&_0x17f48b!=='id'&&_0x17f48b!==_0x2681('0x2b')&&_0x17f48b!==_0x2681('0x2c')&&_0x17f48b!=='updatedAt'){_0x454c52[util['format'](_0x2681('0x2d'),_0x2681('0x2e'),_[_0x2681('0x2f')](_0x17f48b))]=_0x314be7['Contact'][_0x17f48b];}}}}return _0x454c52;};exports[_0x2681('0x30')]=function(_0x54d9a5){var _0x593fd6={};for(var _0x14da57 in _0x54d9a5){if(_0x54d9a5[_0x2681('0x2a')](_0x14da57)){_0x593fd6[util[_0x2681('0x12')]('%s',_['toLower'](_0x14da57))]=_0x54d9a5[_0x14da57];}}return{'variables':_0x593fd6};};exports[_0x2681('0x31')]=function(_0x1a403e,_0x4757ae){if(!_[_0x2681('0x15')](_0x1a403e)){if(_0x1a403e[_0x2681('0x2a')](_0x2681('0x32'))){if(_0x1a403e[_0x2681('0x32')]>0x0){_0x1a403e[_0x2681('0x32')]-=0x1;}else{logger[_0x2681('0xc')](_0x2681('0x33'),_0x4757ae);}}}else{logger['error'](_0x2681('0x34'),_0x4757ae);}};exports[_0x2681('0x35')]=function(_0x2be334){var _0x613cb1=moment()[_0x2681('0x12')](_0x2681('0x36'));_0x2be334['state']=0xd;_0x2be334[_0x2681('0x37')]=_0x2681('0x38');_0x2be334[_0x2681('0x39')]=_0x613cb1;_0x2be334[_0x2681('0x3a')]=_0x613cb1;_0x2be334[_0x2681('0x3b')]=_0x613cb1;};exports[_0x2681('0x3c')]=function(_0x5327a2,_0x4b8055,_0x3b935e){var _0x3049d7=moment()[_0x2681('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x5327a2[_0x2681('0x3d')]=_0x4b8055;_0x5327a2[_0x2681('0x37')]=_0x3b935e;_0x5327a2['responsetime']=_0x3049d7;_0x5327a2[_0x2681('0x3e')]=getSeconds(_0x5327a2[_0x2681('0x3a')],_0x5327a2[_0x2681('0x39')]);};exports[_0x2681('0x3f')]=function(_0x406642,_0x262fad,_0x4fde74){_0x406642[_0x2681('0x40')]=_0x262fad;_0x406642[_0x2681('0x41')]=_0x4fde74;};exports['logCustomer']=function(_0x5ecb63,_0x309061,_0x14615b){var _0x56b794=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5ecb63[_0x2681('0x3d')]=_0x309061;_0x5ecb63['statedesc']=_0x14615b;_0x5ecb63['responsetime']=_0x5ecb63[_0x2681('0x3a')]?_0x5ecb63[_0x2681('0x3a')]:_0x56b794;_0x5ecb63[_0x2681('0x3b')]=_0x5ecb63[_0x2681('0x3b')]?_0x5ecb63[_0x2681('0x3b')]:_0x56b794;_0x5ecb63[_0x2681('0x3e')]=getSeconds(_0x5ecb63[_0x2681('0x3a')]||0x0,_0x5ecb63[_0x2681('0x39')]||0x0);_0x5ecb63[_0x2681('0x42')]=_0x5ecb63[_0x2681('0x43')]?getSeconds(_0x5ecb63[_0x2681('0x3b')],_0x5ecb63[_0x2681('0x43')]):0x0;};exports['isFailure']=function(_0x163ace){return _0x163ace===_0x2681('0x44');};exports['variablesAction']=function(_0x2ea4de,_0x205cd6,_0x38456f,_0x3f0abb,_0x4b101a){var _0x3b0e17=_0x3f0abb?_0x2681('0x45'):_0x2ea4de[_0x2681('0x19')];_0x3b0e17=_0x4b101a?_0x2681('0x46'):_0x3b0e17;return{'actionid':_0x2ea4de[_0x2681('0x47')],'action':'originate','channel':_0x2ea4de[_0x2681('0x48')],'callerid':util[_0x2681('0x12')](_0x2681('0x13'),_0x3b0e17,_0x2ea4de[_0x2681('0x1a')]),'Exten':_0x2681('0x26'),'Context':_0x2681('0x49'),'Priority':'1','variable':_0x38456f,'timeout':(_0x205cd6[_0x2681('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2ea4de['uniqueid']};};exports[_0x2681('0x4b')]=function(_0x28bf8d){return _0x28bf8d[_0x2681('0x4c')]+_0x28bf8d['countcongestionretry']+_0x28bf8d[_0x2681('0x4d')];};exports['cloneAction']=function(_0x5a25ab){var _0x421d56=_[_0x2681('0x4e')](_0x5a25ab);_0x421d56[_0x2681('0x3d')]=0xf;_0x421d56[_0x2681('0x37')]=_0x2681('0x4f');return _0x421d56;};exports['scheduledAt']=function(_0x2dd9cf,_0x23934b,_0x10fa9b){var _0x471791={};_0x471791[_0x23934b]=_0x2dd9cf[_0x23934b];_0x471791[_0x2681('0x50')]=![];_0x471791[_0x2681('0x51')]=moment()[_0x2681('0x52')](_0x10fa9b,_0x2681('0x53'))[_0x2681('0x12')](_0x2681('0x36'));_0x471791[_0x2681('0x1b')]=_0x2dd9cf[_0x2681('0x1b')];_0x471791[_0x2681('0x54')]=_0x2dd9cf[_0x2681('0x54')];_0x471791[_0x2681('0x1c')]=_0x2dd9cf[_0x2681('0x1c')]||undefined;return _0x471791;};exports['decrementTalkink']=function(_0x5b53e6,_0xe003a9){if(!_[_0x2681('0x15')](_0x5b53e6)){if(_0x5b53e6[_0x2681('0x55')]>0x0){_0x5b53e6[_0x2681('0x55')]-=0x1;}else{logger['error'](_0xe003a9,_0x2681('0x56'));}}else{logger[_0x2681('0xc')](_0xe003a9,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x2681('0x57')]=function(_0x5b55c6){if(_0x5b55c6<=0x0){return!![];}return![];};exports['buildObj']=function(_0x39376e,_0xdf54b6){_0x39376e[_0x2681('0x58')]=_0xdf54b6;_0x39376e[_0x2681('0x18')]=_0x39376e[_0x2681('0x59')];_0x39376e[_0x2681('0x5a')]=_0x39376e[_0x2681('0x48')];return _0x39376e;};exports[_0x2681('0x5b')]=function(_0x126f82){var _0x25a694={};_0x25a694[_0x2681('0x59')]=_0x126f82[_0x2681('0x59')];_0x25a694[_0x2681('0x5a')]=_0x126f82[_0x2681('0x48')];_0x25a694['uniqueid']=_0x126f82[_0x2681('0x47')];return _0x25a694;};exports[_0x2681('0x5c')]=function(_0x297c0a){var _0x39de2f=[];for(var _0x13e158 in _0x297c0a){if(_0x297c0a[_0x2681('0x2a')](_0x13e158)){if(!_[_0x2681('0x15')](_0x297c0a[_0x13e158])&&_0x297c0a[_0x13e158][_0x2681('0x3d')]===_0x2681('0x5d')&&_0x297c0a[_0x13e158][_0x2681('0x5e')]===_0x2681('0x5f')){_0x39de2f['push'](_0x297c0a[_0x13e158]['id']);}}}return _0x39de2f;};exports['getDiff']=function(_0x5700b4){var _0x28b9dd=moment()[_0x2681('0x60')](0x0);var _0x39c9df=moment(_0x5700b4)[_0x2681('0x60')](0x0);return _0x28b9dd[_0x2681('0x6')](_0x39c9df,_0x2681('0x7'));};exports['createBody']=function(_0x453cee){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x453cee[_0x2681('0x1b')],'ListId':_0x453cee[_0x2681('0x54')],'VoiceQueueId':_0x453cee[_0x2681('0x1c')]||undefined,'CampaignId':_0x453cee[_0x2681('0x61')]||undefined};};exports[_0x2681('0x62')]=function(_0x2bf3e9){if(_0x2bf3e9===_0x2681('0x47')||_0x2bf3e9===_0x2681('0x63')||_0x2bf3e9===_0x2681('0x59')||_0x2bf3e9===_0x2681('0x64')||_0x2bf3e9==='campaigntype'||_0x2bf3e9===_0x2681('0x65')||_0x2bf3e9==='membername'||_0x2bf3e9===_0x2681('0x48')||_0x2bf3e9===_0x2681('0x19')||_0x2bf3e9===_0x2681('0x50')||_0x2bf3e9===_0x2681('0x1a')||_0x2bf3e9===_0x2681('0x51')||_0x2bf3e9==='countbusyretry'||_0x2bf3e9===_0x2681('0x66')||_0x2bf3e9==='countnoanswerretry'||_0x2bf3e9==='countglobal'||_0x2bf3e9==='callback'||_0x2bf3e9===_0x2681('0x67')||_0x2bf3e9===_0x2681('0x68')||_0x2bf3e9===_0x2681('0x69')||_0x2bf3e9===_0x2681('0x1b')||_0x2bf3e9===_0x2681('0x54')||_0x2bf3e9===_0x2681('0x41')||_0x2bf3e9===_0x2681('0x1c')||_0x2bf3e9===_0x2681('0x6a')||_0x2bf3e9==='xmd-voicequeueid'||_0x2bf3e9==='xmd-queue'||_0x2bf3e9===_0x2681('0x6b')||_0x2bf3e9===_0x2681('0x6c')||_0x2bf3e9===_0x2681('0x6d')||_0x2bf3e9===_0x2681('0x6e')||_0x2bf3e9==='xmd-dialoptions'||_0x2bf3e9===_0x2681('0x6f')||_0x2bf3e9===_0x2681('0x70')||_0x2bf3e9===_0x2681('0x71')||_0x2bf3e9===_0x2681('0x72')||_0x2bf3e9===_0x2681('0x73')||_0x2bf3e9===_0x2681('0x74')||_0x2bf3e9===_0x2681('0x75')||_0x2bf3e9===_0x2681('0x76')||_0x2bf3e9==='rtpaudioqosbridged'||_0x2bf3e9==='rtpaudioqosjitter'||_0x2bf3e9===_0x2681('0x77')||_0x2bf3e9===_0x2681('0x78')||_0x2bf3e9===_0x2681('0x79')||_0x2bf3e9===_0x2681('0x7a')||_0x2bf3e9===_0x2681('0x7b')||_0x2bf3e9===_0x2681('0x76')||_0x2bf3e9===_0x2681('0x7c')||_0x2bf3e9===_0x2681('0x7d')||_0x2bf3e9===_0x2681('0x77')||_0x2bf3e9===_0x2681('0x78')||_0x2bf3e9==='rtpaudioqoslossbridged'||_0x2bf3e9==='rtpaudioqosrtt'||_0x2bf3e9===_0x2681('0x7b')||_0x2bf3e9===_0x2681('0x7e')||_0x2bf3e9===_0x2681('0x7f')||_0x2bf3e9===_0x2681('0x3d')||_0x2bf3e9===_0x2681('0x37')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x45cbe9,_0x2c5ad0){var _0x50f832,_0x1eb18a,_0x420855;if(_0x2c5ad0<=0x0){_0x2c5ad0=0x1;}_0x50f832=new RegExp(_0x2681('0x80')+_0x2c5ad0+'}$');_0x1eb18a=Math['pow'](0xa,_0x2c5ad0-0x1);_0x420855=Math[_0x2681('0x81')](0xa,_0x2c5ad0)-0x1;return util[_0x2681('0x12')]('%s',_['replace'](_0x45cbe9,_0x50f832,_['random'](_0x1eb18a,_0x420855)));};exports['extractCalleridName']=function(_0x3d8ac3){var _0x27e8ce=_0x3d8ac3[_0x2681('0x82')](/"(.*?)"/);return _0x27e8ce?_0x27e8ce[0x1]:_0x3d8ac3;};exports['extractCalleridNumber']=function(_0x3e9aa1){var _0x230848=_0x3e9aa1[_0x2681('0x82')](/<(.*?)>/);return _0x230848?_0x230848[0x1]:_0x3e9aa1;}; \ No newline at end of file +var _0x14bb=['bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','extractCalleridNumber','match','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','loggerCatch','error','logger','info','inspect','loggerError','logger2','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','addVariables','Queue','calleridname','calleridnum','ContactId','dialer','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','updateOriginated','isNil','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','endtime','logAgent','state','responsetime','ringtime','logLookAgent','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','uniqueid','originate','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','queue','buildAcw','interface','channelAgent','agentReadyId','push','getDiff','milliseconds','diff','seconds','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','membername','countglobal','callback','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged'];(function(_0x4dc0f1,_0x49d81e){var _0x5a7bcf=function(_0x3922e4){while(--_0x3922e4){_0x4dc0f1['push'](_0x4dc0f1['shift']());}};_0x5a7bcf(++_0x49d81e);}(_0x14bb,0x96));var _0xb14b=function(_0x1b4b58,_0x183b8e){_0x1b4b58=_0x1b4b58-0x0;var _0x5edfd8=_0x14bb[_0x1b4b58];return _0x5edfd8;};'use strict';var util=require(_0xb14b('0x0'));var _=require(_0xb14b('0x1'));var moment=require(_0xb14b('0x2'));var logger=require(_0xb14b('0x3'))(_0xb14b('0x4'));var ipAgi=process[_0xb14b('0x5')][_0xb14b('0x6')]||_0xb14b('0x7');function getSeconds(_0x1e768d,_0x3dc5d){var _0x23e6cd=moment(_0x1e768d)['milliseconds'](0x0);var _0x16d087=moment(_0x3dc5d)['milliseconds'](0x0);return _0x23e6cd['diff'](_0x16d087,'seconds');}exports[_0xb14b('0x8')]=function(_0x5ecc1a){return function(_0x2ceda9){logger[_0xb14b('0x9')](_0x5ecc1a,util['inspect'](_0x2ceda9,{'showHidden':![],'depth':null}));};};exports[_0xb14b('0xa')]=function(_0x1e88be,_0x782a7a){logger[_0xb14b('0xb')](_0x1e88be,util[_0xb14b('0xc')](_0x782a7a,{'showHidden':![],'depth':null}));};exports[_0xb14b('0xd')]=function(_0x4e8cd8,_0x236a46){logger[_0xb14b('0x9')](_0x4e8cd8,util['inspect'](_0x236a46,{'showHidden':![],'depth':null}));};exports[_0xb14b('0xe')]=function(_0xf5119f){return function(_0x4aeeb6){logger['info'](_0xf5119f,util[_0xb14b('0xc')](_0x4aeeb6,{'showHidden':![],'depth':null}));};};exports[_0xb14b('0xf')]=function(_0x46823c,_0x12d864,_0x14c494){return{'message':_0x46823c,'unlock':_0x12d864,'active':_0x14c494};};exports['getCallerId']=function(_0x195ed6,_0x196857,_0x43a843){if(!_[_0xb14b('0x10')](_0x43a843)&&_0xb14b('0x11')===typeof _0x43a843&&!_[_0xb14b('0x12')](_0x43a843)){if(!_[_0xb14b('0x10')](_0x196857)&&'string'===typeof _0x196857&&!_[_0xb14b('0x12')](_0x196857)){return util[_0xb14b('0x13')](_0xb14b('0x14'),_0x196857,_0x43a843);}return util[_0xb14b('0x13')](_0xb14b('0x14'),_0x43a843,_0x43a843);}if(!_['isUndefined'](_0x195ed6)&&_0xb14b('0x11')===typeof _0x195ed6&&!_[_0xb14b('0x12')](_0x195ed6)){return _0x195ed6;}return'\x22\x22\x20<>';};exports['isActive']=function(_0xd441fd){if(_['isNil'](_0xd441fd)){return![];}return _0xd441fd;};exports[_0xb14b('0x15')]=function(_0x4d8f6c,_0x14f742,_0x516f4d,_0x2b3e63,_0x3ab6af,_0x11f248){var _0x3741cc={'XMD-QUEUE':_0x14f742[_0xb14b('0x16')]?_0x14f742['Queue']['name']:'','XMD-CALLERID':_0x2b3e63,'XMD-CALLERID-PREVIEW':_0x11f248?util[_0xb14b('0x13')](_0xb14b('0x14'),_0x11f248[_0xb14b('0x17')],_0x11f248[_0xb14b('0x18')]):_0x2b3e63,'XMD-DIALID':_0x3ab6af,'XMD-CONTACTID':_0x14f742[_0xb14b('0x19')],'XMD-CDRTYPE':_0xb14b('0x1a'),'CALLERID(all)':_0x2b3e63,'XMD-VOICEQUEUEID':_0x14f742['VoiceQueueId'],'XMD-DIALCHANNEL':_0x516f4d,'XMD-DIALTIMEOUT':_0x4d8f6c['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format'](_0xb14b('0x1b'),_0x4d8f6c[_0xb14b('0x1c')]?'g':'',_[_0xb14b('0x12')](_0x4d8f6c[_0xb14b('0x1d')])?'':_0xb14b('0x1e')),'XMD-DIALURL':_0x4d8f6c[_0xb14b('0x1f')]||'','XMD-AGI':_0x4d8f6c[_0xb14b('0x20')]?util[_0xb14b('0x13')](_0xb14b('0x21'),ipAgi,_0x4d8f6c['dialQueueProject']):_0xb14b('0x22'),'XMD-AGIAFTER':_0x4d8f6c[_0xb14b('0x1c')]?util[_0xb14b('0x13')](_0xb14b('0x21'),ipAgi,_0x4d8f6c[_0xb14b('0x1c')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x11f248?_0x11f248[_0xb14b('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x11f248?_0x11f248['originatecalleridname']:'','XMD-DESTINATION':_0xb14b('0x24')};if(!_[_0xb14b('0x12')](_0x4d8f6c[_0xb14b('0x1d')])){_0x3741cc[util[_0xb14b('0x13')]('%s',_0xb14b('0x25'))]=_0x4d8f6c[_0xb14b('0x1d')];_0x3741cc[util[_0xb14b('0x13')]('%s',_0xb14b('0x26'))]=_0x3ab6af;}if(_0x14f742&&_0x14f742['Contact']){for(var _0x103a95 in _0x14f742[_0xb14b('0x27')]){if(_0x14f742['Contact'][_0xb14b('0x28')](_0x103a95)){if(!_['isNil'](_0x14f742[_0xb14b('0x27')][_0x103a95])&&_0x103a95!=='id'&&_0x103a95!==_0xb14b('0x29')&&_0x103a95!==_0xb14b('0x2a')&&_0x103a95!==_0xb14b('0x2b')){_0x3741cc[util[_0xb14b('0x13')](_0xb14b('0x2c'),_0xb14b('0x2d'),_[_0xb14b('0x2e')](_0x103a95))]=_0x14f742[_0xb14b('0x27')][_0x103a95];}}}}return _0x3741cc;};exports['toLowerVariables']=function(_0xb147a9){var _0x154514={};for(var _0xee18d8 in _0xb147a9){if(_0xb147a9['hasOwnProperty'](_0xee18d8)){_0x154514[util[_0xb14b('0x13')]('%s',_['toLower'](_0xee18d8))]=_0xb147a9[_0xee18d8];}}return{'variables':_0x154514};};exports[_0xb14b('0x2f')]=function(_0x4f0d05,_0x8febf1){if(!_[_0xb14b('0x30')](_0x4f0d05)){if(_0x4f0d05['hasOwnProperty'](_0xb14b('0x31'))){if(_0x4f0d05['originated']>0x0){_0x4f0d05['originated']-=0x1;}else{logger[_0xb14b('0x9')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x8febf1);}}}else{logger[_0xb14b('0x9')](_0xb14b('0x32'),_0x8febf1);}};exports[_0xb14b('0x33')]=function(_0x37bbf4){var _0x1f578c=moment()[_0xb14b('0x13')](_0xb14b('0x34'));_0x37bbf4['state']=0xd;_0x37bbf4[_0xb14b('0x35')]=_0xb14b('0x36');_0x37bbf4[_0xb14b('0x37')]=_0x1f578c;_0x37bbf4['responsetime']=_0x1f578c;_0x37bbf4[_0xb14b('0x38')]=_0x1f578c;};exports[_0xb14b('0x39')]=function(_0x4af219,_0x4089d3,_0x3a80aa){var _0x5522ab=moment()[_0xb14b('0x13')](_0xb14b('0x34'));_0x4af219[_0xb14b('0x3a')]=_0x4089d3;_0x4af219[_0xb14b('0x35')]=_0x3a80aa;_0x4af219[_0xb14b('0x3b')]=_0x5522ab;_0x4af219[_0xb14b('0x3c')]=getSeconds(_0x4af219[_0xb14b('0x3b')],_0x4af219[_0xb14b('0x37')]);};exports[_0xb14b('0x3d')]=function(_0x2bd440,_0x46df65,_0x206062){_0x2bd440['membername']=_0x46df65;_0x2bd440[_0xb14b('0x3e')]=_0x206062;};exports[_0xb14b('0x3f')]=function(_0x4709f7,_0x430939,_0x1fcd23){var _0x38ea55=moment()[_0xb14b('0x13')](_0xb14b('0x34'));_0x4709f7[_0xb14b('0x3a')]=_0x430939;_0x4709f7['statedesc']=_0x1fcd23;_0x4709f7[_0xb14b('0x3b')]=_0x4709f7[_0xb14b('0x3b')]?_0x4709f7[_0xb14b('0x3b')]:_0x38ea55;_0x4709f7[_0xb14b('0x38')]=_0x4709f7[_0xb14b('0x38')]?_0x4709f7[_0xb14b('0x38')]:_0x38ea55;_0x4709f7[_0xb14b('0x3c')]=getSeconds(_0x4709f7[_0xb14b('0x3b')]||0x0,_0x4709f7[_0xb14b('0x37')]||0x0);_0x4709f7[_0xb14b('0x40')]=_0x4709f7[_0xb14b('0x41')]?getSeconds(_0x4709f7[_0xb14b('0x38')],_0x4709f7['answertime']):0x0;};exports[_0xb14b('0x42')]=function(_0x4a654e){return _0x4a654e===_0xb14b('0x43');};exports[_0xb14b('0x44')]=function(_0x37801d,_0x2ead22,_0x227ea4,_0x283ef6,_0x52a90d){var _0x9d7a82=_0x283ef6?'RECALL':_0x37801d[_0xb14b('0x17')];_0x9d7a82=_0x52a90d?'BOOKED':_0x9d7a82;return{'actionid':_0x37801d[_0xb14b('0x45')],'action':_0xb14b('0x46'),'channel':_0x37801d['channelAgent'],'callerid':util[_0xb14b('0x13')]('\x22%s\x22\x20<%s>',_0x9d7a82,_0x37801d[_0xb14b('0x18')]),'Exten':_0xb14b('0x24'),'Context':'from-sip','Priority':'1','variable':_0x227ea4,'timeout':(_0x2ead22[_0xb14b('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x37801d[_0xb14b('0x45')]};};exports[_0xb14b('0x48')]=function(_0x4b2df9){return _0x4b2df9[_0xb14b('0x49')]+_0x4b2df9[_0xb14b('0x4a')]+_0x4b2df9[_0xb14b('0x4b')];};exports[_0xb14b('0x4c')]=function(_0x35e39f){var _0x2f42cf=_[_0xb14b('0x4d')](_0x35e39f);_0x2f42cf[_0xb14b('0x3a')]=0xf;_0x2f42cf[_0xb14b('0x35')]=_0xb14b('0x4e');return _0x2f42cf;};exports[_0xb14b('0x4f')]=function(_0x1c4cc7,_0x51888f,_0x458d7e){var _0x41fc3e={};_0x41fc3e[_0x51888f]=_0x1c4cc7[_0x51888f];_0x41fc3e[_0xb14b('0x50')]=![];_0x41fc3e[_0xb14b('0x51')]=moment()['add'](_0x458d7e,_0xb14b('0x52'))[_0xb14b('0x13')](_0xb14b('0x34'));_0x41fc3e[_0xb14b('0x19')]=_0x1c4cc7[_0xb14b('0x19')];_0x41fc3e[_0xb14b('0x53')]=_0x1c4cc7[_0xb14b('0x53')];_0x41fc3e['VoiceQueueId']=_0x1c4cc7[_0xb14b('0x54')]||undefined;return _0x41fc3e;};exports[_0xb14b('0x55')]=function(_0x3a66ab,_0x2538a8){if(!_[_0xb14b('0x30')](_0x3a66ab)){if(_0x3a66ab[_0xb14b('0x56')]>0x0){_0x3a66ab[_0xb14b('0x56')]-=0x1;}else{logger[_0xb14b('0x9')](_0x2538a8,_0xb14b('0x57'));}}else{logger[_0xb14b('0x9')](_0x2538a8,_0xb14b('0x58'));}};exports[_0xb14b('0x59')]=function(_0x5a178a){if(_0x5a178a<=0x0){return!![];}return![];};exports[_0xb14b('0x5a')]=function(_0x40e5f1,_0x93d9fb){_0x40e5f1['lastevent']=_0x93d9fb;_0x40e5f1['name']=_0x40e5f1[_0xb14b('0x5b')];_0x40e5f1['interface']=_0x40e5f1['channelAgent'];return _0x40e5f1;};exports[_0xb14b('0x5c')]=function(_0x346f0a){var _0x4dc8eb={};_0x4dc8eb[_0xb14b('0x5b')]=_0x346f0a['queue'];_0x4dc8eb[_0xb14b('0x5d')]=_0x346f0a[_0xb14b('0x5e')];_0x4dc8eb[_0xb14b('0x45')]=_0x346f0a['uniqueid'];return _0x4dc8eb;};exports[_0xb14b('0x5f')]=function(_0x320efd){var _0x2b232b=[];for(var _0x191bb0 in _0x320efd){if(_0x320efd[_0xb14b('0x28')](_0x191bb0)){if(!_[_0xb14b('0x30')](_0x320efd[_0x191bb0])&&_0x320efd[_0x191bb0][_0xb14b('0x3a')]==='not_inuse'&&_0x320efd[_0x191bb0]['status']==='reachable'){_0x2b232b[_0xb14b('0x60')](_0x320efd[_0x191bb0]['id']);}}}return _0x2b232b;};exports[_0xb14b('0x61')]=function(_0x9886ee){var _0x38061e=moment()[_0xb14b('0x62')](0x0);var _0x3efe14=moment(_0x9886ee)[_0xb14b('0x62')](0x0);return _0x38061e[_0xb14b('0x63')](_0x3efe14,_0xb14b('0x64'));};exports['createBody']=function(_0x1547a7){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1547a7[_0xb14b('0x19')],'ListId':_0x1547a7[_0xb14b('0x53')],'VoiceQueueId':_0x1547a7['VoiceQueueId']||undefined,'CampaignId':_0x1547a7[_0xb14b('0x65')]||undefined};};exports[_0xb14b('0x66')]=function(_0x1f4b2a){if(_0x1f4b2a===_0xb14b('0x45')||_0x1f4b2a===_0xb14b('0x67')||_0x1f4b2a==='queue'||_0x1f4b2a===_0xb14b('0x68')||_0x1f4b2a===_0xb14b('0x69')||_0x1f4b2a===_0xb14b('0x6a')||_0x1f4b2a===_0xb14b('0x6b')||_0x1f4b2a===_0xb14b('0x5e')||_0x1f4b2a===_0xb14b('0x17')||_0x1f4b2a===_0xb14b('0x50')||_0x1f4b2a===_0xb14b('0x18')||_0x1f4b2a==='scheduledat'||_0x1f4b2a==='countbusyretry'||_0x1f4b2a===_0xb14b('0x4a')||_0x1f4b2a==='countnoanswerretry'||_0x1f4b2a===_0xb14b('0x6c')||_0x1f4b2a===_0xb14b('0x6d')||_0x1f4b2a===_0xb14b('0x6e')||_0x1f4b2a===_0xb14b('0x6f')||_0x1f4b2a==='recallme'||_0x1f4b2a===_0xb14b('0x19')||_0x1f4b2a===_0xb14b('0x53')||_0x1f4b2a===_0xb14b('0x3e')||_0x1f4b2a==='VoiceQueueId'||_0x1f4b2a===_0xb14b('0x70')||_0x1f4b2a===_0xb14b('0x71')||_0x1f4b2a===_0xb14b('0x72')||_0x1f4b2a===_0xb14b('0x73')||_0x1f4b2a==='xmd-listid'||_0x1f4b2a===_0xb14b('0x74')||_0x1f4b2a==='xmd-dialtimeout'||_0x1f4b2a===_0xb14b('0x75')||_0x1f4b2a===_0xb14b('0x76')||_0x1f4b2a===_0xb14b('0x77')||_0x1f4b2a===_0xb14b('0x78')||_0x1f4b2a===_0xb14b('0x79')||_0x1f4b2a===_0xb14b('0x7a')||_0x1f4b2a===_0xb14b('0x7b')||_0x1f4b2a===_0xb14b('0x7c')||_0x1f4b2a===_0xb14b('0x7d')||_0x1f4b2a===_0xb14b('0x7e')||_0x1f4b2a===_0xb14b('0x7f')||_0x1f4b2a===_0xb14b('0x80')||_0x1f4b2a===_0xb14b('0x81')||_0x1f4b2a===_0xb14b('0x82')||_0x1f4b2a==='rtpaudioqosrtt'||_0x1f4b2a===_0xb14b('0x83')||_0x1f4b2a===_0xb14b('0x7d')||_0x1f4b2a===_0xb14b('0x7e')||_0x1f4b2a===_0xb14b('0x7f')||_0x1f4b2a===_0xb14b('0x80')||_0x1f4b2a===_0xb14b('0x81')||_0x1f4b2a===_0xb14b('0x82')||_0x1f4b2a==='rtpaudioqosrtt'||_0x1f4b2a==='rtpaudioqosrttbridged'||_0x1f4b2a===_0xb14b('0x84')||_0x1f4b2a===_0xb14b('0x85')||_0x1f4b2a===_0xb14b('0x3a')||_0x1f4b2a===_0xb14b('0x35')){return![];}return!![];};exports[_0xb14b('0x86')]=function(_0x12f246,_0x31f76b){var _0x803f2c,_0x279792,_0x588213;if(_0x31f76b<=0x0){_0x31f76b=0x1;}_0x803f2c=new RegExp(_0xb14b('0x87')+_0x31f76b+'}$');_0x279792=Math[_0xb14b('0x88')](0xa,_0x31f76b-0x1);_0x588213=Math[_0xb14b('0x88')](0xa,_0x31f76b)-0x1;return util[_0xb14b('0x13')]('%s',_['replace'](_0x12f246,_0x803f2c,_[_0xb14b('0x89')](_0x279792,_0x588213)));};exports[_0xb14b('0x8a')]=function(_0x3bf9f7){var _0x533241=_0x3bf9f7['match'](/"(.*?)"/);return _0x533241?_0x533241[0x1]:_0x3bf9f7;};exports[_0xb14b('0x8b')]=function(_0x585a60){var _0x55c730=_0x585a60[_0xb14b('0x8c')](/<(.*?)>/);return _0x55c730?_0x55c730[0x1]:_0x585a60;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 7841bae..911823d 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 _0x1a8f=['string','number','boolean','queueremove','reload','voicequeuechannel','voicechannel','queueadd'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x1a8f,0x87));var _0xf1a8=function(_0x4c89cd,_0x2c57e2){_0x4c89cd=_0x4c89cd-0x0;var _0x1090d2=_0x1a8f[_0x4c89cd];return _0x1090d2;};'use strict';exports[_0xf1a8('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xf1a8('0x1'),'required':!![]},'membername':{'type':_0xf1a8('0x1'),'required':!![]},'penalty':{'type':_0xf1a8('0x2'),'required':![]},'paused':{'type':_0xf1a8('0x3'),'required':![]}};exports[_0xf1a8('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':'string','required':!![]},'paused':{'type':_0xf1a8('0x3')},'reason':{'type':_0xf1a8('0x1'),'required':![]}};exports[_0xf1a8('0x5')]={'module':{'type':'string','required':![]}};exports[_0xf1a8('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf1a8('0x7')]={'uniqueid':{'type':_0xf1a8('0x1'),'required':!![]},'filename':{'type':_0xf1a8('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf1a8('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0xf1a8('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf1a8('0x1'),'required':!![]},'exten':{'type':_0xf1a8('0x1'),'required':!![]},'context':{'type':_0xf1a8('0x1')}}; \ No newline at end of file +var _0xf776=['voicequeuechannelredirect','queueadd','string','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xf776,0x169));var _0x6f77=function(_0x5801d0,_0x200804){_0x5801d0=_0x5801d0-0x0;var _0x4332cc=_0xf776[_0x5801d0];return _0x4332cc;};'use strict';exports[_0x6f77('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x6f77('0x1'),'required':!![]},'membername':{'type':_0x6f77('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x6f77('0x2'),'required':![]}};exports[_0x6f77('0x3')]={'queue':{'type':_0x6f77('0x1'),'required':!![]},'interface':{'type':_0x6f77('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x6f77('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x6f77('0x1'),'required':![]}};exports[_0x6f77('0x4')]={'module':{'type':_0x6f77('0x1'),'required':![]}};exports[_0x6f77('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x6f77('0x6')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x6f77('0x1')},'format':{'type':_0x6f77('0x1')},'mixmonitorid':{'type':_0x6f77('0x1')}};exports[_0x6f77('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x6f77('0x8')]={'uniqueid':{'type':_0x6f77('0x1'),'required':!![]},'exten':{'type':_0x6f77('0x1'),'required':!![]},'context':{'type':_0x6f77('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 7e7bb45..ee4a266 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 _0x2367=['initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queue','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallercomplete','initVoiceCallReports','outbound','ANSWERED','billableseconds','initCampaigns','campaigns','initVoiceExtensions','initFaxAccounts','exports','bluebird','util','lodash','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','agents','telephones','trunks','voiceQueues','triggers','templates','voiceExtensions','channels','queueChannels','outboundChannels','timers','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','unmanaged','abandoned','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','mergeFromDatabase','initAgents','length','prototype','initTelephones','isUndefined','initTrunks','initVoiceQueues','initTriggers','initZendeskAccounts','zendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x2367,0x7f));var _0x7236=function(_0x3853ce,_0xc86552){_0x3853ce=_0x3853ce-0x0;var _0x1af3fb=_0x2367[_0x3853ce];return _0x1af3fb;};'use strict';var BPromise=require(_0x7236('0x0'));var util=require(_0x7236('0x1'));var _=require(_0x7236('0x2'));var moment=require('moment');var Agent=require(_0x7236('0x3'));var Telephone=require(_0x7236('0x4'));var Trunk=require(_0x7236('0x5'));var VoiceQueue=require(_0x7236('0x6'));var Trigger=require(_0x7236('0x7'));var Template=require(_0x7236('0x8'));var Campaign=require(_0x7236('0x9'));var VoiceExtension=require(_0x7236('0xa'));var ZendeskAccount=require(_0x7236('0xb'));var SalesforceAccount=require(_0x7236('0xc'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x7236('0xd'));var ZohoAccount=require(_0x7236('0xe'));var DeskAccount=require(_0x7236('0xf'));var VtigerAccount=require(_0x7236('0x10'));var ServicenowAccount=require(_0x7236('0x11'));var Dynamics365Account=require(_0x7236('0x12'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x7236('0x13')]={};this[_0x7236('0x14')]={};this[_0x7236('0x15')]={};this[_0x7236('0x16')]={};this[_0x7236('0x17')]={};this['campaigns']={};this[_0x7236('0x18')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x7236('0x19')]={};this[_0x7236('0x1a')]={};this[_0x7236('0x1b')]={};this[_0x7236('0x1c')]={};this[_0x7236('0x1d')]={};this['zendeskAccounts']={};this[_0x7236('0x1e')]={};this[_0x7236('0x1f')]={};this[_0x7236('0x20')]={};this[_0x7236('0x21')]={};this[_0x7236('0x22')]={};this['vtigerAccounts']={};this[_0x7236('0x23')]={};this[_0x7236('0x24')]={};this[_0x7236('0x25')]={};};function freeIsNotKey(_0x53328a,_0x1f7f0e,_0x3740e2){var _0x234155=_[_0x7236('0x26')](_0x53328a,function(_0x1b8d11,_0x372a3c){return _0x1b8d11[_0x3740e2];});for(var _0x259093 in _0x1f7f0e){if(_0x1f7f0e[_0x7236('0x27')](_0x259093)){if(!_0x234155[_0x259093]){delete _0x1f7f0e[_0x259093];}}}}function freeIsNotKeySip(_0x57ff45,_0xc728f3){var _0x2b1c63=_[_0x7236('0x26')](_0x57ff45,function(_0x131107,_0x4df25b){return util[_0x7236('0x28')](_0x7236('0x29'),_0x131107[_0x7236('0x2a')]);});for(var _0x51ad14 in _0xc728f3){if(_0xc728f3[_0x7236('0x27')](_0x51ad14)){if(!_0x2b1c63[_0x51ad14]){delete _0xc728f3[_0x51ad14];}}}}function freeIsNotKeyAgent(_0x122edc,_0x28b43e){var _0x5a8f61=_['mapKeys'](_0x122edc,function(_0x10a682,_0x2f951e){var _0x443bfa=_[_0x7236('0x2b')](_0x10a682[_0x7236('0x2c')])?util['format'](_0x7236('0x29'),_0x10a682['name']):_0x10a682[_0x7236('0x2c')];return _0x443bfa;});for(var _0x4c0b0d in _0x28b43e){if(_0x28b43e[_0x7236('0x27')](_0x4c0b0d)){if(!_0x5a8f61[_0x4c0b0d]){delete _0x28b43e[_0x4c0b0d];}}}}function clearVoiceCallReports(_0x38cd47){_0x38cd47[_0x7236('0x2d')]=0x0;_0x38cd47[_0x7236('0x2e')]=0x0;_0x38cd47[_0x7236('0x2f')]=0x0;_0x38cd47[_0x7236('0x30')]=0x0;_0x38cd47[_0x7236('0x31')]=0x0;}function clearCampaigns(_0x48a6b5){if(!_[_0x7236('0x32')](_0x48a6b5)){for(var _0x478b52 in _0x48a6b5){if(_0x48a6b5[_0x7236('0x27')](_0x478b52)){_0x48a6b5[_0x478b52]['ivrTotalCallsDays']=0x0;_0x48a6b5[_0x478b52]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x5205ed){if(!_[_0x7236('0x32')](_0x5205ed)){for(var _0x21393f in _0x5205ed){if(_0x5205ed['hasOwnProperty'](_0x21393f)){_0x5205ed[_0x21393f]['total']=0x0;_0x5205ed[_0x21393f][_0x7236('0x2e')]=0x0;_0x5205ed[_0x21393f][_0x7236('0x33')]=0x0;_0x5205ed[_0x21393f][_0x7236('0x34')]=0x0;_0x5205ed[_0x21393f][_0x7236('0x2f')]=0x0;_0x5205ed[_0x21393f][_0x7236('0x30')]=0x0;_0x5205ed[_0x21393f]['sumBillable']=0x0;_0x5205ed[_0x21393f]['outboundAnswerAgiCallsDay']=0x0;_0x5205ed[_0x21393f]['outboundNoAnswerCallsDay']=0x0;_0x5205ed[_0x21393f][_0x7236('0x35')]=0x0;_0x5205ed[_0x21393f][_0x7236('0x36')]=0x0;_0x5205ed[_0x21393f][_0x7236('0x37')]=0x0;_0x5205ed[_0x21393f][_0x7236('0x38')]=0x0;_0x5205ed[_0x21393f][_0x7236('0x39')]=0x0;_0x5205ed[_0x21393f][_0x7236('0x3a')]=0x0;_0x5205ed[_0x21393f][_0x7236('0x3b')]=0x0;_0x5205ed[_0x21393f]['outboundOriginateFailureCallsDay']=0x0;_0x5205ed[_0x21393f][_0x7236('0x3c')]=0x0;_0x5205ed[_0x21393f][_0x7236('0x3d')]=0x0;_0x5205ed[_0x21393f]['outboundAnswerAgiCallsDay']=0x0;_0x5205ed[_0x21393f]['outboundAnswerCallsDay']=0x0;_0x5205ed[_0x21393f][_0x7236('0x3e')]=!![];}}}}Realtime['prototype'][_0x7236('0x3f')]=function(_0x437a0a,_0x18eef7){for(var _0xfd4ff2 in _0x18eef7){if(_0x437a0a[_0x7236('0x27')](_0xfd4ff2)){_0x437a0a[_0xfd4ff2]=_0x18eef7[_0xfd4ff2];}}};Realtime['prototype'][_0x7236('0x40')]=function(){var _0x2be4e7=this;return function(_0x41ac33){if(_0x41ac33){freeIsNotKeyAgent(_0x41ac33,_0x2be4e7['agents']);for(var _0x1c70fb=0x0,_0x6c9fd5={},_0x100734={};_0x1c70fb<_0x41ac33[_0x7236('0x41')];_0x1c70fb+=0x1){_0x6c9fd5=_0x41ac33[_0x1c70fb];var _0x5e33e6=_['isNil'](_0x6c9fd5[_0x7236('0x2c')])?util[_0x7236('0x28')](_0x7236('0x29'),_0x6c9fd5['name']):_0x6c9fd5[_0x7236('0x2c')];if(_['isUndefined'](_0x2be4e7[_0x7236('0x13')][_0x5e33e6])){_0x2be4e7[_0x7236('0x13')][_0x5e33e6]=new Agent(_0x6c9fd5);}else{_0x2be4e7['mergeFromDatabase'](_0x2be4e7[_0x7236('0x13')][_0x5e33e6],_0x6c9fd5);}}}return _0x2be4e7[_0x7236('0x13')];};};Realtime[_0x7236('0x42')][_0x7236('0x43')]=function(){var _0xa07a40=this;return function(_0x565f58){if(_0x565f58){freeIsNotKeySip(_0x565f58,_0xa07a40[_0x7236('0x14')]);for(var _0x2a3da7=0x0,_0x5dbf57={},_0x50ddee={};_0x2a3da7<_0x565f58[_0x7236('0x41')];_0x2a3da7+=0x1){_0x5dbf57=_0x565f58[_0x2a3da7];if(_[_0x7236('0x44')](_0xa07a40[_0x7236('0x14')][util[_0x7236('0x28')](_0x7236('0x29'),_0x5dbf57[_0x7236('0x2a')])])){_0xa07a40[_0x7236('0x14')][util[_0x7236('0x28')](_0x7236('0x29'),_0x5dbf57['name'])]=new Telephone(_0x5dbf57);}else{_0xa07a40[_0x7236('0x3f')](_0xa07a40[_0x7236('0x14')][util[_0x7236('0x28')](_0x7236('0x29'),_0x5dbf57[_0x7236('0x2a')])],_0x5dbf57);}}}return _0xa07a40[_0x7236('0x14')];};};Realtime[_0x7236('0x42')][_0x7236('0x45')]=function(){var _0x558d66=this;return function(_0x31bca6){if(_0x31bca6){freeIsNotKeySip(_0x31bca6,_0x558d66[_0x7236('0x15')]);for(var _0x3d44d8=0x0,_0xbc52bb={},_0x2776ed={};_0x3d44d8<_0x31bca6['length'];_0x3d44d8+=0x1){_0xbc52bb=_0x31bca6[_0x3d44d8];if(_[_0x7236('0x44')](_0x558d66[_0x7236('0x15')][util[_0x7236('0x28')](_0x7236('0x29'),_0xbc52bb['name'])])){_0x558d66['trunks'][util['format'](_0x7236('0x29'),_0xbc52bb[_0x7236('0x2a')])]=new Trunk(_0xbc52bb);}else{_0x558d66['mergeFromDatabase'](_0x558d66['trunks'][util[_0x7236('0x28')]('SIP/%s',_0xbc52bb[_0x7236('0x2a')])],_0xbc52bb);}}}return _0x558d66[_0x7236('0x15')];};};Realtime[_0x7236('0x42')][_0x7236('0x46')]=function(){var _0x5ef28b=this;return function(_0x51820b){if(_0x51820b){freeIsNotKey(_0x51820b,_0x5ef28b[_0x7236('0x16')],_0x7236('0x2a'));for(var _0x11d795=0x0,_0x5dc1ad={},_0x11d83c={};_0x11d795<_0x51820b[_0x7236('0x41')];_0x11d795+=0x1){_0x5dc1ad=_0x51820b[_0x11d795];if(_[_0x7236('0x44')](_0x5ef28b[_0x7236('0x16')][_0x5dc1ad[_0x7236('0x2a')]])){_0x5ef28b['voiceQueues'][_0x5dc1ad[_0x7236('0x2a')]]=new VoiceQueue(_0x5dc1ad);}else{_0x5ef28b[_0x7236('0x3f')](_0x5ef28b[_0x7236('0x16')][_0x5dc1ad[_0x7236('0x2a')]],_0x5dc1ad);}}}return _0x5ef28b[_0x7236('0x16')];};};Realtime[_0x7236('0x42')][_0x7236('0x47')]=function(){var _0x51acc3=this;return function(_0x7a9663){if(_0x7a9663){freeIsNotKey(_0x7a9663,_0x51acc3['triggers'],'id');for(var _0x524cc8=0x0,_0x8fc3a3={},_0xcd7833={};_0x524cc8<_0x7a9663[_0x7236('0x41')];_0x524cc8+=0x1){_0x8fc3a3=_0x7a9663[_0x524cc8];if(_[_0x7236('0x44')](_0x51acc3[_0x7236('0x17')][_0x8fc3a3['id']])){_0x51acc3[_0x7236('0x17')][_0x8fc3a3['id']]=new Trigger(_0x8fc3a3);}else{_0x51acc3['mergeFromDatabase'](_0x51acc3['triggers'][_0x8fc3a3['id']],_0x8fc3a3);}}}return _0x51acc3['triggers'];};};Realtime[_0x7236('0x42')]['initTemplates']=function(){var _0x3f2038=this;return function(_0x754e2b){if(_0x754e2b){freeIsNotKey(_0x754e2b,_0x3f2038[_0x7236('0x18')],'id');for(var _0x4be464=0x0,_0x5b50df={},_0x4acde3={};_0x4be464<_0x754e2b[_0x7236('0x41')];_0x4be464+=0x1){_0x5b50df=_0x754e2b[_0x4be464];if(_[_0x7236('0x44')](_0x3f2038[_0x7236('0x18')][_0x5b50df['id']])){_0x3f2038[_0x7236('0x18')][_0x5b50df['id']]=new Template(_0x5b50df);}else{_0x3f2038[_0x7236('0x3f')](_0x3f2038[_0x7236('0x18')][_0x5b50df['id']],_0x5b50df);}}}return _0x3f2038['templates'];};};Realtime[_0x7236('0x42')][_0x7236('0x48')]=function(){var _0x393d6e=this;return function(_0x46acfd){if(_0x46acfd){freeIsNotKey(_0x46acfd,_0x393d6e[_0x7236('0x49')],'id');for(var _0x155df5=0x0,_0x1dfc75={},_0x486f10={};_0x155df5<_0x46acfd[_0x7236('0x41')];_0x155df5+=0x1){_0x1dfc75=_0x46acfd[_0x155df5];if(_[_0x7236('0x44')](_0x393d6e[_0x7236('0x49')][_0x1dfc75['id']])){_0x393d6e[_0x7236('0x49')][_0x1dfc75['id']]=new ZendeskAccount(_0x1dfc75);}else{_0x393d6e['mergeFromDatabase'](_0x393d6e[_0x7236('0x49')][_0x1dfc75['id']],_0x1dfc75);}}}return _0x393d6e[_0x7236('0x49')];};};Realtime[_0x7236('0x42')]['initSalesforceAccounts']=function(){var _0xe65779=this;return function(_0x497959){if(_0x497959){freeIsNotKey(_0x497959,_0xe65779[_0x7236('0x1e')],'id');for(var _0x3ee7da=0x0,_0x2462ed={},_0x2fc75a={};_0x3ee7da<_0x497959['length'];_0x3ee7da+=0x1){_0x2462ed=_0x497959[_0x3ee7da];if(_[_0x7236('0x44')](_0xe65779[_0x7236('0x1e')][_0x2462ed['id']])){_0xe65779[_0x7236('0x1e')][_0x2462ed['id']]=new SalesforceAccount(_0x2462ed);}else{_0xe65779[_0x7236('0x3f')](_0xe65779[_0x7236('0x1e')][_0x2462ed['id']],_0x2462ed);}}}return _0xe65779[_0x7236('0x1e')];};};Realtime[_0x7236('0x42')][_0x7236('0x4a')]=function(){var _0x336631=this;return function(_0x2487bb){if(_0x2487bb){freeIsNotKey(_0x2487bb,_0x336631[_0x7236('0x20')],'id');for(var _0x259c0d=0x0,_0x2da366={},_0x3b3411={};_0x259c0d<_0x2487bb['length'];_0x259c0d+=0x1){_0x2da366=_0x2487bb[_0x259c0d];if(_[_0x7236('0x44')](_0x336631[_0x7236('0x20')][_0x2da366['id']])){_0x336631[_0x7236('0x20')][_0x2da366['id']]=new FreshdeskAccount(_0x2da366);}else{_0x336631[_0x7236('0x3f')](_0x336631[_0x7236('0x20')][_0x2da366['id']],_0x2da366);}}}return _0x336631[_0x7236('0x20')];};};Realtime[_0x7236('0x42')][_0x7236('0x4b')]=function(){var _0x463d45=this;return function(_0x58a183){if(_0x58a183){freeIsNotKey(_0x58a183,_0x463d45[_0x7236('0x21')],'id');for(var _0x795541=0x0,_0xb5043b={},_0x4bd5e2={};_0x795541<_0x58a183[_0x7236('0x41')];_0x795541+=0x1){_0xb5043b=_0x58a183[_0x795541];if(_['isUndefined'](_0x463d45[_0x7236('0x21')][_0xb5043b['id']])){_0x463d45['zohoAccounts'][_0xb5043b['id']]=new ZohoAccount(_0xb5043b);}else{_0x463d45[_0x7236('0x3f')](_0x463d45[_0x7236('0x21')][_0xb5043b['id']],_0xb5043b);}}}return _0x463d45[_0x7236('0x21')];};};Realtime[_0x7236('0x42')][_0x7236('0x4c')]=function(){var _0x5ece33=this;return function(_0x106265){if(_0x106265){freeIsNotKey(_0x106265,_0x5ece33[_0x7236('0x22')],'id');for(var _0x38f736=0x0,_0x4ce97b={},_0x5742dc={};_0x38f736<_0x106265[_0x7236('0x41')];_0x38f736+=0x1){_0x4ce97b=_0x106265[_0x38f736];if(_[_0x7236('0x44')](_0x5ece33[_0x7236('0x22')][_0x4ce97b['id']])){_0x5ece33[_0x7236('0x22')][_0x4ce97b['id']]=new DeskAccount(_0x4ce97b);}else{_0x5ece33[_0x7236('0x3f')](_0x5ece33[_0x7236('0x22')][_0x4ce97b['id']],_0x4ce97b);}}}return _0x5ece33[_0x7236('0x22')];};};Realtime['prototype'][_0x7236('0x4d')]=function(){var _0x35ee92=this;return function(_0x16543f){if(_0x16543f){freeIsNotKey(_0x16543f,_0x35ee92[_0x7236('0x1f')],'id');for(var _0xb610bb=0x0,_0x5bfff8={},_0xeea8a1={};_0xb610bb<_0x16543f[_0x7236('0x41')];_0xb610bb+=0x1){_0x5bfff8=_0x16543f[_0xb610bb];if(_[_0x7236('0x44')](_0x35ee92[_0x7236('0x1f')][_0x5bfff8['id']])){_0x35ee92[_0x7236('0x1f')][_0x5bfff8['id']]=new SugarcrmAccount(_0x5bfff8);}else{_0x35ee92['mergeFromDatabase'](_0x35ee92[_0x7236('0x1f')][_0x5bfff8['id']],_0x5bfff8);}}}return _0x35ee92[_0x7236('0x1f')];};};Realtime[_0x7236('0x42')][_0x7236('0x4e')]=function(){var _0x232981=this;return function(_0x228abd){if(_0x228abd){freeIsNotKey(_0x228abd,_0x232981[_0x7236('0x4f')],'id');for(var _0x2b1429=0x0,_0x32b253={},_0x3a5a99={};_0x2b1429<_0x228abd['length'];_0x2b1429+=0x1){_0x32b253=_0x228abd[_0x2b1429];if(_[_0x7236('0x44')](_0x232981[_0x7236('0x4f')][_0x32b253['id']])){_0x232981['vtigerAccounts'][_0x32b253['id']]=new VtigerAccount(_0x32b253);}else{_0x232981[_0x7236('0x3f')](_0x232981[_0x7236('0x4f')][_0x32b253['id']],_0x32b253);}}}return _0x232981[_0x7236('0x4f')];};};Realtime[_0x7236('0x42')]['initServicenowAccounts']=function(){var _0x11f2a8=this;return function(_0x11d5a2){if(_0x11d5a2){freeIsNotKey(_0x11d5a2,_0x11f2a8[_0x7236('0x23')],'id');for(var _0x110352=0x0,_0x30d3a0={},_0x35e68d={};_0x110352<_0x11d5a2[_0x7236('0x41')];_0x110352+=0x1){_0x30d3a0=_0x11d5a2[_0x110352];if(_['isUndefined'](_0x11f2a8[_0x7236('0x23')][_0x30d3a0['id']])){_0x11f2a8[_0x7236('0x23')][_0x30d3a0['id']]=new ServicenowAccount(_0x30d3a0);}else{_0x11f2a8[_0x7236('0x3f')](_0x11f2a8['servicenowAccounts'][_0x30d3a0['id']],_0x30d3a0);}}}return _0x11f2a8[_0x7236('0x23')];};};Realtime[_0x7236('0x42')][_0x7236('0x50')]=function(){var _0x3d99be=this;return function(_0x4c110d){if(_0x4c110d){freeIsNotKey(_0x4c110d,_0x3d99be[_0x7236('0x24')],'id');for(var _0x45b121=0x0,_0x47835c={},_0x82e5d3={};_0x45b121<_0x4c110d[_0x7236('0x41')];_0x45b121+=0x1){_0x47835c=_0x4c110d[_0x45b121];if(_[_0x7236('0x44')](_0x3d99be[_0x7236('0x24')][_0x47835c['id']])){_0x3d99be[_0x7236('0x24')][_0x47835c['id']]=new Dynamics365Account(_0x47835c);}else{_0x3d99be[_0x7236('0x3f')](_0x3d99be[_0x7236('0x24')][_0x47835c['id']],_0x47835c);}}}return _0x3d99be[_0x7236('0x24')];};};Realtime[_0x7236('0x42')][_0x7236('0x51')]=function(){var _0x235777=this;return function(_0x38f430){for(var _0x3dded4=0x0;_0x3dded4<_0x38f430[_0x7236('0x41')];_0x3dded4+=0x1){_[_0x7236('0x52')](_0x235777['voiceQueues'][_0x38f430[_0x3dded4][_0x7236('0x2a')]],_0x38f430[_0x3dded4]);}return _0x235777[_0x7236('0x16')];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0x256028=this;return function(_0x32508e){clearVoiceQueues(_0x256028[_0x7236('0x16')]);if(_0x32508e){_0x32508e=_[_0x7236('0x53')](_0x32508e,_0x7236('0x54'));for(var _0x58be30 in _0x32508e){if(_0x32508e['hasOwnProperty'](_0x58be30)){var _0x4e6192={};for(var _0xff9678=0x0;_0xff9678<_0x32508e[_0x58be30][_0x7236('0x41')];_0xff9678+=0x1){var _0x5a832f=_0x32508e[_0x58be30][_0xff9678][_0x7236('0x55')];if(_0x256028[_0x7236('0x16')][_0x5a832f]){if(_0x32508e[_0x58be30][_0xff9678]['queuecallerexit']){_0x256028[_0x7236('0x16')][_0x5a832f][_0x7236('0x33')]+=0x1;}if(_0x32508e[_0x58be30][_0xff9678][_0x7236('0x56')]){_0x256028[_0x7236('0x16')][_0x5a832f]['abandoned']+=0x1;}_0x256028[_0x7236('0x16')][_0x5a832f][_0x7236('0x2f')]+=moment(_0x32508e[_0x58be30][_0xff9678][_0x7236('0x57')])['diff'](moment(_0x32508e[_0x58be30][_0xff9678][_0x7236('0x58')]),_0x7236('0x59'))||0x0;if(_0xff9678===_0x32508e[_0x58be30]['length']-0x1){_0x256028[_0x7236('0x16')][_0x5a832f]['sumDuration']+=moment(_0x32508e[_0x58be30][_0xff9678][_0x7236('0x5a')]||_0x32508e[_0x58be30][_0xff9678][_0x7236('0x5b')]||_0x32508e[_0x58be30][_0xff9678]['queuecallerexitAt'])['diff'](moment(_0x32508e[_0x58be30][_0xff9678]['queuecallerjoinAt']),_0x7236('0x59'))||0x0;_0x256028['voiceQueues'][_0x5a832f][_0x7236('0x2d')]+=0x1;if(_0x32508e[_0x58be30][_0xff9678][_0x7236('0x5c')]){_0x256028[_0x7236('0x16')][_0x5a832f][_0x7236('0x2e')]+=0x1;_0x256028['voiceQueues'][_0x5a832f][_0x7236('0x31')]+=moment(_0x32508e[_0x58be30][_0xff9678][_0x7236('0x5a')])['diff'](moment(_0x32508e[_0x58be30][_0xff9678][_0x7236('0x57')]),_0x7236('0x59'))||0x0;}}else{_0x256028['voiceQueues'][_0x5a832f]['sumDuration']+=_0x256028[_0x7236('0x16')][_0x5a832f][_0x7236('0x2f')]||0x0;}}}}}}return _0x256028[_0x7236('0x16')];};};Realtime[_0x7236('0x42')][_0x7236('0x5d')]=function(){var _0x240c3a=this;return function(_0x19d4e0){clearVoiceCallReports(_0x240c3a[_0x7236('0x5e')]);if(_0x19d4e0){for(var _0xcf7cf2=0x0;_0xcf7cf2<_0x19d4e0[_0x7236('0x41')];_0xcf7cf2+=0x1){_0x240c3a[_0x7236('0x5e')][_0x7236('0x2d')]+=0x1;_0x240c3a[_0x7236('0x5e')][_0x7236('0x30')]+=_0x19d4e0[_0xcf7cf2]['duration'];if(_0x19d4e0[_0xcf7cf2]['disposition']===_0x7236('0x5f')){_0x240c3a[_0x7236('0x5e')]['answered']+=0x1;_0x240c3a[_0x7236('0x5e')][_0x7236('0x2f')]+=_0x19d4e0[_0xcf7cf2]['duration']-_0x19d4e0[_0xcf7cf2]['billableseconds']||0x0;_0x240c3a[_0x7236('0x5e')]['sumBillable']+=_0x19d4e0[_0xcf7cf2][_0x7236('0x60')];}}}return _0x240c3a[_0x7236('0x5e')];};};Realtime[_0x7236('0x42')][_0x7236('0x61')]=function(){var _0x165f2f=this;return function(_0x30a22b){if(_0x30a22b){freeIsNotKey(_0x30a22b,_0x165f2f[_0x7236('0x62')],_0x7236('0x2a'));for(var _0x460d5c=0x0,_0x3a78cb={};_0x460d5c<_0x30a22b[_0x7236('0x41')];_0x460d5c+=0x1){_0x3a78cb=_0x30a22b[_0x460d5c];if(_[_0x7236('0x44')](_0x165f2f[_0x7236('0x62')][_0x3a78cb[_0x7236('0x2a')]])){_0x165f2f[_0x7236('0x62')][_0x3a78cb[_0x7236('0x2a')]]=new Campaign(_0x3a78cb);}else{_0x165f2f[_0x7236('0x3f')](_0x165f2f[_0x7236('0x62')][_0x3a78cb[_0x7236('0x2a')]],_0x3a78cb);}}}return _0x165f2f[_0x7236('0x62')];};};Realtime[_0x7236('0x42')][_0x7236('0x63')]=function(){var _0xc55f67=this;return function(_0x3048cd){if(_0x3048cd){freeIsNotKey(_0x3048cd,_0xc55f67['voiceExtensions'],'id');for(var _0x2971a9=0x0,_0x3689e2={};_0x2971a9<_0x3048cd[_0x7236('0x41')];_0x2971a9+=0x1){_0x3689e2=_0x3048cd[_0x2971a9];if(_[_0x7236('0x44')](_0xc55f67[_0x7236('0x19')][_0x3689e2['id']])){_0xc55f67[_0x7236('0x19')][_0x3689e2['id']]=new VoiceExtension(_0x3689e2);}else{_0xc55f67[_0x7236('0x3f')](_0xc55f67[_0x7236('0x19')][_0x3689e2['id']],_0x3689e2);}}}return _0xc55f67[_0x7236('0x19')];};};Realtime[_0x7236('0x42')]['initCampaignHopperHistory']=function(){var _0x3790e0=this;return function(_0x5cd964){clearCampaigns(_0x3790e0['campaigns']);for(var _0x30e454=0x0;_0x30e454<_0x5cd964[_0x7236('0x41')];_0x30e454+=0x1){_[_0x7236('0x52')](_0x3790e0[_0x7236('0x62')][_0x5cd964[_0x30e454][_0x7236('0x2a')]],_0x5cd964[_0x30e454]);}return _0x3790e0[_0x7236('0x62')];};};Realtime['prototype'][_0x7236('0x64')]=function(){var _0x4ead97=this;return function(_0x1bc123){if(_0x1bc123){freeIsNotKey(_0x1bc123,_0x4ead97['faxAccounts'],'id');for(var _0x4cb408=0x0,_0x377eda={},_0x39c49c={};_0x4cb408<_0x1bc123[_0x7236('0x41')];_0x4cb408+=0x1){_0x377eda=_0x1bc123[_0x4cb408];if(_[_0x7236('0x44')](_0x4ead97['faxAccounts'][_0x377eda['id']])){_0x4ead97[_0x7236('0x25')][_0x377eda['id']]=new FaxAccount(_0x377eda);}else{_0x4ead97['mergeFromDatabase'](_0x4ead97[_0x7236('0x25')][_0x377eda['id']],_0x377eda);}}}return _0x4ead97[_0x7236('0x25')];};};module[_0x7236('0x65')]=Realtime; \ No newline at end of file +var _0xb941=['../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','trunks','campaigns','templates','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','vtigerAccounts','dynamics365Accounts','mapKeys','hasOwnProperty','SIP/%s','name','isNil','interface','format','total','answered','sumHoldTime','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','telephones','initTrunks','initVoiceQueues','voiceQueues','triggers','initZendeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','servicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerleaveAt','diff','queuecallerjoinAt','queuecallerabandonAt','queuecallerexitAt','seconds','queuecallercomplete','queuecallercompleteAt','initVoiceCallReports','outbound','ANSWERED','duration','billableseconds','voiceExtensions','initFaxAccounts','faxAccounts','exports','bluebird','util','moment','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/zendeskAccount'];(function(_0x91cbd2,_0x1e5e94){var _0x232c8a=function(_0xf99aea){while(--_0xf99aea){_0x91cbd2['push'](_0x91cbd2['shift']());}};_0x232c8a(++_0x1e5e94);}(_0xb941,0x1ec));var _0x1b94=function(_0x244f1f,_0x27b839){_0x244f1f=_0x244f1f-0x0;var _0x237b65=_0xb941[_0x244f1f];return _0x237b65;};'use strict';var BPromise=require(_0x1b94('0x0'));var util=require(_0x1b94('0x1'));var _=require('lodash');var moment=require(_0x1b94('0x2'));var Agent=require(_0x1b94('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0x1b94('0x4'));var VoiceQueue=require(_0x1b94('0x5'));var Trigger=require(_0x1b94('0x6'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x1b94('0x7'));var SalesforceAccount=require(_0x1b94('0x8'));var FreshdeskAccount=require(_0x1b94('0x9'));var SugarcrmAccount=require(_0x1b94('0xa'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x1b94('0xb'));var VtigerAccount=require(_0x1b94('0xc'));var ServicenowAccount=require(_0x1b94('0xd'));var Dynamics365Account=require(_0x1b94('0xe'));var FaxAccount=require(_0x1b94('0xf'));var Realtime=function(){this[_0x1b94('0x10')]={};this['telephones']={};this[_0x1b94('0x11')]={};this['voiceQueues']={};this['triggers']={};this[_0x1b94('0x12')]={};this[_0x1b94('0x13')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x1b94('0x14')]={};this[_0x1b94('0x15')]={};this[_0x1b94('0x16')]={};this[_0x1b94('0x17')]={};this[_0x1b94('0x18')]={};this[_0x1b94('0x19')]={};this[_0x1b94('0x1a')]={};this[_0x1b94('0x1b')]={};this['zohoAccounts']={};this['deskAccounts']={};this[_0x1b94('0x1c')]={};this['servicenowAccounts']={};this[_0x1b94('0x1d')]={};this['faxAccounts']={};};function freeIsNotKey(_0x476969,_0x376a52,_0x5411d3){var _0x1d49d1=_[_0x1b94('0x1e')](_0x476969,function(_0x36e4a0,_0x18520f){return _0x36e4a0[_0x5411d3];});for(var _0x18ec88 in _0x376a52){if(_0x376a52[_0x1b94('0x1f')](_0x18ec88)){if(!_0x1d49d1[_0x18ec88]){delete _0x376a52[_0x18ec88];}}}}function freeIsNotKeySip(_0x24587f,_0x2911e6){var _0x5bbb8c=_['mapKeys'](_0x24587f,function(_0x437ff3,_0x1f5342){return util['format'](_0x1b94('0x20'),_0x437ff3[_0x1b94('0x21')]);});for(var _0x4c5e96 in _0x2911e6){if(_0x2911e6[_0x1b94('0x1f')](_0x4c5e96)){if(!_0x5bbb8c[_0x4c5e96]){delete _0x2911e6[_0x4c5e96];}}}}function freeIsNotKeyAgent(_0x1b26fc,_0xbd8b0){var _0x225106=_[_0x1b94('0x1e')](_0x1b26fc,function(_0x4a6e22,_0x2a5b54){var _0x59db95=_[_0x1b94('0x22')](_0x4a6e22[_0x1b94('0x23')])?util[_0x1b94('0x24')](_0x1b94('0x20'),_0x4a6e22[_0x1b94('0x21')]):_0x4a6e22[_0x1b94('0x23')];return _0x59db95;});for(var _0x3a035d in _0xbd8b0){if(_0xbd8b0['hasOwnProperty'](_0x3a035d)){if(!_0x225106[_0x3a035d]){delete _0xbd8b0[_0x3a035d];}}}}function clearVoiceCallReports(_0x4da4db){_0x4da4db[_0x1b94('0x25')]=0x0;_0x4da4db[_0x1b94('0x26')]=0x0;_0x4da4db[_0x1b94('0x27')]=0x0;_0x4da4db['sumDuration']=0x0;_0x4da4db['sumBillable']=0x0;}function clearCampaigns(_0x9a99e6){if(!_[_0x1b94('0x28')](_0x9a99e6)){for(var _0x5efa34 in _0x9a99e6){if(_0x9a99e6[_0x1b94('0x1f')](_0x5efa34)){_0x9a99e6[_0x5efa34]['ivrTotalCallsDays']=0x0;_0x9a99e6[_0x5efa34][_0x1b94('0x29')]=0x0;}}}}function clearVoiceQueues(_0xe7657c){if(!_[_0x1b94('0x28')](_0xe7657c)){for(var _0x267d70 in _0xe7657c){if(_0xe7657c[_0x1b94('0x1f')](_0x267d70)){_0xe7657c[_0x267d70][_0x1b94('0x25')]=0x0;_0xe7657c[_0x267d70]['answered']=0x0;_0xe7657c[_0x267d70][_0x1b94('0x2a')]=0x0;_0xe7657c[_0x267d70][_0x1b94('0x2b')]=0x0;_0xe7657c[_0x267d70][_0x1b94('0x27')]=0x0;_0xe7657c[_0x267d70][_0x1b94('0x2c')]=0x0;_0xe7657c[_0x267d70][_0x1b94('0x2d')]=0x0;_0xe7657c[_0x267d70][_0x1b94('0x2e')]=0x0;_0xe7657c[_0x267d70][_0x1b94('0x2f')]=0x0;_0xe7657c[_0x267d70]['outboundBusyCallsDay']=0x0;_0xe7657c[_0x267d70][_0x1b94('0x30')]=0x0;_0xe7657c[_0x267d70]['outboundNoSuchCallsDay']=0x0;_0xe7657c[_0x267d70][_0x1b94('0x31')]=0x0;_0xe7657c[_0x267d70][_0x1b94('0x32')]=0x0;_0xe7657c[_0x267d70][_0x1b94('0x33')]=0x0;_0xe7657c[_0x267d70][_0x1b94('0x34')]=0x0;_0xe7657c[_0x267d70][_0x1b94('0x35')]=0x0;_0xe7657c[_0x267d70][_0x1b94('0x36')]=0x0;_0xe7657c[_0x267d70]['outboundReCallsDay']=0x0;_0xe7657c[_0x267d70][_0x1b94('0x2e')]=0x0;_0xe7657c[_0x267d70][_0x1b94('0x37')]=0x0;_0xe7657c[_0x267d70][_0x1b94('0x38')]=!![];}}}}Realtime[_0x1b94('0x39')][_0x1b94('0x3a')]=function(_0x536857,_0x152c3d){for(var _0x443502 in _0x152c3d){if(_0x536857[_0x1b94('0x1f')](_0x443502)){_0x536857[_0x443502]=_0x152c3d[_0x443502];}}};Realtime['prototype'][_0x1b94('0x3b')]=function(){var _0x2cb30c=this;return function(_0x38c5d1){if(_0x38c5d1){freeIsNotKeyAgent(_0x38c5d1,_0x2cb30c['agents']);for(var _0x128f99=0x0,_0x3a3500={},_0x28fb52={};_0x128f99<_0x38c5d1[_0x1b94('0x3c')];_0x128f99+=0x1){_0x3a3500=_0x38c5d1[_0x128f99];var _0x17efc2=_[_0x1b94('0x22')](_0x3a3500['interface'])?util[_0x1b94('0x24')]('SIP/%s',_0x3a3500[_0x1b94('0x21')]):_0x3a3500[_0x1b94('0x23')];if(_[_0x1b94('0x3d')](_0x2cb30c[_0x1b94('0x10')][_0x17efc2])){_0x2cb30c[_0x1b94('0x10')][_0x17efc2]=new Agent(_0x3a3500);}else{_0x2cb30c['mergeFromDatabase'](_0x2cb30c[_0x1b94('0x10')][_0x17efc2],_0x3a3500);}}}return _0x2cb30c['agents'];};};Realtime[_0x1b94('0x39')][_0x1b94('0x3e')]=function(){var _0x17f7ba=this;return function(_0x5878e){if(_0x5878e){freeIsNotKeySip(_0x5878e,_0x17f7ba[_0x1b94('0x3f')]);for(var _0x20910f=0x0,_0x39fa55={},_0x2a24dc={};_0x20910f<_0x5878e[_0x1b94('0x3c')];_0x20910f+=0x1){_0x39fa55=_0x5878e[_0x20910f];if(_['isUndefined'](_0x17f7ba[_0x1b94('0x3f')][util[_0x1b94('0x24')](_0x1b94('0x20'),_0x39fa55[_0x1b94('0x21')])])){_0x17f7ba['telephones'][util['format']('SIP/%s',_0x39fa55[_0x1b94('0x21')])]=new Telephone(_0x39fa55);}else{_0x17f7ba[_0x1b94('0x3a')](_0x17f7ba[_0x1b94('0x3f')][util[_0x1b94('0x24')](_0x1b94('0x20'),_0x39fa55['name'])],_0x39fa55);}}}return _0x17f7ba[_0x1b94('0x3f')];};};Realtime[_0x1b94('0x39')][_0x1b94('0x40')]=function(){var _0x46556d=this;return function(_0x5451b5){if(_0x5451b5){freeIsNotKeySip(_0x5451b5,_0x46556d['trunks']);for(var _0x3d961e=0x0,_0x5a2c23={},_0x47e22b={};_0x3d961e<_0x5451b5[_0x1b94('0x3c')];_0x3d961e+=0x1){_0x5a2c23=_0x5451b5[_0x3d961e];if(_[_0x1b94('0x3d')](_0x46556d[_0x1b94('0x11')][util[_0x1b94('0x24')](_0x1b94('0x20'),_0x5a2c23[_0x1b94('0x21')])])){_0x46556d[_0x1b94('0x11')][util[_0x1b94('0x24')](_0x1b94('0x20'),_0x5a2c23[_0x1b94('0x21')])]=new Trunk(_0x5a2c23);}else{_0x46556d[_0x1b94('0x3a')](_0x46556d[_0x1b94('0x11')][util['format']('SIP/%s',_0x5a2c23[_0x1b94('0x21')])],_0x5a2c23);}}}return _0x46556d['trunks'];};};Realtime[_0x1b94('0x39')][_0x1b94('0x41')]=function(){var _0x2ef8d0=this;return function(_0x46faa6){if(_0x46faa6){freeIsNotKey(_0x46faa6,_0x2ef8d0[_0x1b94('0x42')],_0x1b94('0x21'));for(var _0x107c9f=0x0,_0x137083={},_0x1613de={};_0x107c9f<_0x46faa6[_0x1b94('0x3c')];_0x107c9f+=0x1){_0x137083=_0x46faa6[_0x107c9f];if(_[_0x1b94('0x3d')](_0x2ef8d0[_0x1b94('0x42')][_0x137083['name']])){_0x2ef8d0[_0x1b94('0x42')][_0x137083[_0x1b94('0x21')]]=new VoiceQueue(_0x137083);}else{_0x2ef8d0['mergeFromDatabase'](_0x2ef8d0[_0x1b94('0x42')][_0x137083[_0x1b94('0x21')]],_0x137083);}}}return _0x2ef8d0['voiceQueues'];};};Realtime[_0x1b94('0x39')]['initTriggers']=function(){var _0x3bf5ac=this;return function(_0x300894){if(_0x300894){freeIsNotKey(_0x300894,_0x3bf5ac[_0x1b94('0x43')],'id');for(var _0x453c3e=0x0,_0x588132={},_0x1b1a5e={};_0x453c3e<_0x300894[_0x1b94('0x3c')];_0x453c3e+=0x1){_0x588132=_0x300894[_0x453c3e];if(_[_0x1b94('0x3d')](_0x3bf5ac[_0x1b94('0x43')][_0x588132['id']])){_0x3bf5ac[_0x1b94('0x43')][_0x588132['id']]=new Trigger(_0x588132);}else{_0x3bf5ac['mergeFromDatabase'](_0x3bf5ac[_0x1b94('0x43')][_0x588132['id']],_0x588132);}}}return _0x3bf5ac[_0x1b94('0x43')];};};Realtime[_0x1b94('0x39')]['initTemplates']=function(){var _0x3c7687=this;return function(_0x218d25){if(_0x218d25){freeIsNotKey(_0x218d25,_0x3c7687[_0x1b94('0x13')],'id');for(var _0x3dadb8=0x0,_0x232c1b={},_0x5d81e0={};_0x3dadb8<_0x218d25[_0x1b94('0x3c')];_0x3dadb8+=0x1){_0x232c1b=_0x218d25[_0x3dadb8];if(_[_0x1b94('0x3d')](_0x3c7687['templates'][_0x232c1b['id']])){_0x3c7687[_0x1b94('0x13')][_0x232c1b['id']]=new Template(_0x232c1b);}else{_0x3c7687[_0x1b94('0x3a')](_0x3c7687[_0x1b94('0x13')][_0x232c1b['id']],_0x232c1b);}}}return _0x3c7687[_0x1b94('0x13')];};};Realtime['prototype'][_0x1b94('0x44')]=function(){var _0x4bd8d2=this;return function(_0x5c21f6){if(_0x5c21f6){freeIsNotKey(_0x5c21f6,_0x4bd8d2[_0x1b94('0x18')],'id');for(var _0x42171d=0x0,_0x4377cf={},_0x16b11c={};_0x42171d<_0x5c21f6[_0x1b94('0x3c')];_0x42171d+=0x1){_0x4377cf=_0x5c21f6[_0x42171d];if(_[_0x1b94('0x3d')](_0x4bd8d2[_0x1b94('0x18')][_0x4377cf['id']])){_0x4bd8d2['zendeskAccounts'][_0x4377cf['id']]=new ZendeskAccount(_0x4377cf);}else{_0x4bd8d2[_0x1b94('0x3a')](_0x4bd8d2[_0x1b94('0x18')][_0x4377cf['id']],_0x4377cf);}}}return _0x4bd8d2[_0x1b94('0x18')];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x934825=this;return function(_0x3a217a){if(_0x3a217a){freeIsNotKey(_0x3a217a,_0x934825[_0x1b94('0x19')],'id');for(var _0x34dbb7=0x0,_0x49633d={},_0x20976c={};_0x34dbb7<_0x3a217a[_0x1b94('0x3c')];_0x34dbb7+=0x1){_0x49633d=_0x3a217a[_0x34dbb7];if(_[_0x1b94('0x3d')](_0x934825['salesforceAccounts'][_0x49633d['id']])){_0x934825[_0x1b94('0x19')][_0x49633d['id']]=new SalesforceAccount(_0x49633d);}else{_0x934825[_0x1b94('0x3a')](_0x934825[_0x1b94('0x19')][_0x49633d['id']],_0x49633d);}}}return _0x934825['salesforceAccounts'];};};Realtime[_0x1b94('0x39')]['initFreshdeskAccounts']=function(){var _0x480811=this;return function(_0x5d6d86){if(_0x5d6d86){freeIsNotKey(_0x5d6d86,_0x480811[_0x1b94('0x1b')],'id');for(var _0x32458d=0x0,_0x55744c={},_0x458821={};_0x32458d<_0x5d6d86['length'];_0x32458d+=0x1){_0x55744c=_0x5d6d86[_0x32458d];if(_['isUndefined'](_0x480811[_0x1b94('0x1b')][_0x55744c['id']])){_0x480811[_0x1b94('0x1b')][_0x55744c['id']]=new FreshdeskAccount(_0x55744c);}else{_0x480811[_0x1b94('0x3a')](_0x480811[_0x1b94('0x1b')][_0x55744c['id']],_0x55744c);}}}return _0x480811[_0x1b94('0x1b')];};};Realtime[_0x1b94('0x39')][_0x1b94('0x45')]=function(){var _0x520c96=this;return function(_0x2ca766){if(_0x2ca766){freeIsNotKey(_0x2ca766,_0x520c96['zohoAccounts'],'id');for(var _0x35501d=0x0,_0x520d71={},_0x2eb647={};_0x35501d<_0x2ca766['length'];_0x35501d+=0x1){_0x520d71=_0x2ca766[_0x35501d];if(_[_0x1b94('0x3d')](_0x520c96[_0x1b94('0x46')][_0x520d71['id']])){_0x520c96[_0x1b94('0x46')][_0x520d71['id']]=new ZohoAccount(_0x520d71);}else{_0x520c96[_0x1b94('0x3a')](_0x520c96[_0x1b94('0x46')][_0x520d71['id']],_0x520d71);}}}return _0x520c96[_0x1b94('0x46')];};};Realtime['prototype'][_0x1b94('0x47')]=function(){var _0xd94ac6=this;return function(_0x42e73b){if(_0x42e73b){freeIsNotKey(_0x42e73b,_0xd94ac6[_0x1b94('0x48')],'id');for(var _0x77d154=0x0,_0x2e9063={},_0x3a0a3e={};_0x77d154<_0x42e73b[_0x1b94('0x3c')];_0x77d154+=0x1){_0x2e9063=_0x42e73b[_0x77d154];if(_[_0x1b94('0x3d')](_0xd94ac6[_0x1b94('0x48')][_0x2e9063['id']])){_0xd94ac6['deskAccounts'][_0x2e9063['id']]=new DeskAccount(_0x2e9063);}else{_0xd94ac6['mergeFromDatabase'](_0xd94ac6[_0x1b94('0x48')][_0x2e9063['id']],_0x2e9063);}}}return _0xd94ac6['deskAccounts'];};};Realtime[_0x1b94('0x39')][_0x1b94('0x49')]=function(){var _0x24f0b5=this;return function(_0x12140a){if(_0x12140a){freeIsNotKey(_0x12140a,_0x24f0b5[_0x1b94('0x1a')],'id');for(var _0x1c7989=0x0,_0x324532={},_0x47928e={};_0x1c7989<_0x12140a['length'];_0x1c7989+=0x1){_0x324532=_0x12140a[_0x1c7989];if(_['isUndefined'](_0x24f0b5['sugarcrmAccounts'][_0x324532['id']])){_0x24f0b5[_0x1b94('0x1a')][_0x324532['id']]=new SugarcrmAccount(_0x324532);}else{_0x24f0b5[_0x1b94('0x3a')](_0x24f0b5[_0x1b94('0x1a')][_0x324532['id']],_0x324532);}}}return _0x24f0b5[_0x1b94('0x1a')];};};Realtime['prototype'][_0x1b94('0x4a')]=function(){var _0x3f7d4f=this;return function(_0x37c5b7){if(_0x37c5b7){freeIsNotKey(_0x37c5b7,_0x3f7d4f[_0x1b94('0x1c')],'id');for(var _0x33479e=0x0,_0x397187={},_0x295dc4={};_0x33479e<_0x37c5b7[_0x1b94('0x3c')];_0x33479e+=0x1){_0x397187=_0x37c5b7[_0x33479e];if(_[_0x1b94('0x3d')](_0x3f7d4f[_0x1b94('0x1c')][_0x397187['id']])){_0x3f7d4f[_0x1b94('0x1c')][_0x397187['id']]=new VtigerAccount(_0x397187);}else{_0x3f7d4f['mergeFromDatabase'](_0x3f7d4f[_0x1b94('0x1c')][_0x397187['id']],_0x397187);}}}return _0x3f7d4f[_0x1b94('0x1c')];};};Realtime[_0x1b94('0x39')]['initServicenowAccounts']=function(){var _0x1d12e0=this;return function(_0x541c7c){if(_0x541c7c){freeIsNotKey(_0x541c7c,_0x1d12e0['servicenowAccounts'],'id');for(var _0x201378=0x0,_0x352eac={},_0x4694cf={};_0x201378<_0x541c7c[_0x1b94('0x3c')];_0x201378+=0x1){_0x352eac=_0x541c7c[_0x201378];if(_[_0x1b94('0x3d')](_0x1d12e0[_0x1b94('0x4b')][_0x352eac['id']])){_0x1d12e0[_0x1b94('0x4b')][_0x352eac['id']]=new ServicenowAccount(_0x352eac);}else{_0x1d12e0['mergeFromDatabase'](_0x1d12e0['servicenowAccounts'][_0x352eac['id']],_0x352eac);}}}return _0x1d12e0[_0x1b94('0x4b')];};};Realtime[_0x1b94('0x39')][_0x1b94('0x4c')]=function(){var _0x16006e=this;return function(_0x4fe825){if(_0x4fe825){freeIsNotKey(_0x4fe825,_0x16006e[_0x1b94('0x1d')],'id');for(var _0x26cb79=0x0,_0x475405={},_0x24cae7={};_0x26cb79<_0x4fe825[_0x1b94('0x3c')];_0x26cb79+=0x1){_0x475405=_0x4fe825[_0x26cb79];if(_['isUndefined'](_0x16006e['dynamics365Accounts'][_0x475405['id']])){_0x16006e['dynamics365Accounts'][_0x475405['id']]=new Dynamics365Account(_0x475405);}else{_0x16006e[_0x1b94('0x3a')](_0x16006e[_0x1b94('0x1d')][_0x475405['id']],_0x475405);}}}return _0x16006e[_0x1b94('0x1d')];};};Realtime[_0x1b94('0x39')][_0x1b94('0x4d')]=function(){var _0x4c50ff=this;return function(_0x4aed6a){for(var _0x33b575=0x0;_0x33b575<_0x4aed6a[_0x1b94('0x3c')];_0x33b575+=0x1){_[_0x1b94('0x4e')](_0x4c50ff[_0x1b94('0x42')][_0x4aed6a[_0x33b575][_0x1b94('0x21')]],_0x4aed6a[_0x33b575]);}return _0x4c50ff[_0x1b94('0x42')];};};Realtime[_0x1b94('0x39')][_0x1b94('0x4f')]=function(){var _0x17b076=this;return function(_0x5e43b9){clearVoiceQueues(_0x17b076[_0x1b94('0x42')]);if(_0x5e43b9){_0x5e43b9=_[_0x1b94('0x50')](_0x5e43b9,_0x1b94('0x51'));for(var _0x30939c in _0x5e43b9){if(_0x5e43b9[_0x1b94('0x1f')](_0x30939c)){var _0x4afef2={};for(var _0x3f65e3=0x0;_0x3f65e3<_0x5e43b9[_0x30939c][_0x1b94('0x3c')];_0x3f65e3+=0x1){var _0x1e510e=_0x5e43b9[_0x30939c][_0x3f65e3][_0x1b94('0x52')];if(_0x17b076[_0x1b94('0x42')][_0x1e510e]){if(_0x5e43b9[_0x30939c][_0x3f65e3]['queuecallerexit']){_0x17b076[_0x1b94('0x42')][_0x1e510e][_0x1b94('0x2a')]+=0x1;}if(_0x5e43b9[_0x30939c][_0x3f65e3]['queuecallerabandon']){_0x17b076[_0x1b94('0x42')][_0x1e510e][_0x1b94('0x2b')]+=0x1;}_0x17b076[_0x1b94('0x42')][_0x1e510e]['sumHoldTime']+=moment(_0x5e43b9[_0x30939c][_0x3f65e3][_0x1b94('0x53')])[_0x1b94('0x54')](moment(_0x5e43b9[_0x30939c][_0x3f65e3][_0x1b94('0x55')]),'seconds')||0x0;if(_0x3f65e3===_0x5e43b9[_0x30939c][_0x1b94('0x3c')]-0x1){_0x17b076[_0x1b94('0x42')][_0x1e510e][_0x1b94('0x2c')]+=moment(_0x5e43b9[_0x30939c][_0x3f65e3]['queuecallercompleteAt']||_0x5e43b9[_0x30939c][_0x3f65e3][_0x1b94('0x56')]||_0x5e43b9[_0x30939c][_0x3f65e3][_0x1b94('0x57')])[_0x1b94('0x54')](moment(_0x5e43b9[_0x30939c][_0x3f65e3]['queuecallerjoinAt']),_0x1b94('0x58'))||0x0;_0x17b076['voiceQueues'][_0x1e510e][_0x1b94('0x25')]+=0x1;if(_0x5e43b9[_0x30939c][_0x3f65e3][_0x1b94('0x59')]){_0x17b076[_0x1b94('0x42')][_0x1e510e]['answered']+=0x1;_0x17b076[_0x1b94('0x42')][_0x1e510e][_0x1b94('0x2d')]+=moment(_0x5e43b9[_0x30939c][_0x3f65e3][_0x1b94('0x5a')])[_0x1b94('0x54')](moment(_0x5e43b9[_0x30939c][_0x3f65e3][_0x1b94('0x53')]),'seconds')||0x0;}}else{_0x17b076['voiceQueues'][_0x1e510e][_0x1b94('0x2c')]+=_0x17b076[_0x1b94('0x42')][_0x1e510e]['sumHoldTime']||0x0;}}}}}}return _0x17b076[_0x1b94('0x42')];};};Realtime[_0x1b94('0x39')][_0x1b94('0x5b')]=function(){var _0x2ef9c4=this;return function(_0x1dbc8f){clearVoiceCallReports(_0x2ef9c4['outbound']);if(_0x1dbc8f){for(var _0x5549b8=0x0;_0x5549b8<_0x1dbc8f[_0x1b94('0x3c')];_0x5549b8+=0x1){_0x2ef9c4[_0x1b94('0x5c')][_0x1b94('0x25')]+=0x1;_0x2ef9c4[_0x1b94('0x5c')][_0x1b94('0x2c')]+=_0x1dbc8f[_0x5549b8]['duration'];if(_0x1dbc8f[_0x5549b8]['disposition']===_0x1b94('0x5d')){_0x2ef9c4[_0x1b94('0x5c')][_0x1b94('0x26')]+=0x1;_0x2ef9c4['outbound'][_0x1b94('0x27')]+=_0x1dbc8f[_0x5549b8][_0x1b94('0x5e')]-_0x1dbc8f[_0x5549b8][_0x1b94('0x5f')]||0x0;_0x2ef9c4[_0x1b94('0x5c')][_0x1b94('0x2d')]+=_0x1dbc8f[_0x5549b8][_0x1b94('0x5f')];}}}return _0x2ef9c4[_0x1b94('0x5c')];};};Realtime['prototype']['initCampaigns']=function(){var _0x4f44b3=this;return function(_0x3abcc4){if(_0x3abcc4){freeIsNotKey(_0x3abcc4,_0x4f44b3[_0x1b94('0x12')],_0x1b94('0x21'));for(var _0x1348ef=0x0,_0x34c3dd={};_0x1348ef<_0x3abcc4[_0x1b94('0x3c')];_0x1348ef+=0x1){_0x34c3dd=_0x3abcc4[_0x1348ef];if(_['isUndefined'](_0x4f44b3[_0x1b94('0x12')][_0x34c3dd['name']])){_0x4f44b3[_0x1b94('0x12')][_0x34c3dd[_0x1b94('0x21')]]=new Campaign(_0x34c3dd);}else{_0x4f44b3[_0x1b94('0x3a')](_0x4f44b3[_0x1b94('0x12')][_0x34c3dd[_0x1b94('0x21')]],_0x34c3dd);}}}return _0x4f44b3[_0x1b94('0x12')];};};Realtime[_0x1b94('0x39')]['initVoiceExtensions']=function(){var _0x4dc14d=this;return function(_0x577dab){if(_0x577dab){freeIsNotKey(_0x577dab,_0x4dc14d[_0x1b94('0x60')],'id');for(var _0x366d8c=0x0,_0x40d24b={};_0x366d8c<_0x577dab[_0x1b94('0x3c')];_0x366d8c+=0x1){_0x40d24b=_0x577dab[_0x366d8c];if(_['isUndefined'](_0x4dc14d['voiceExtensions'][_0x40d24b['id']])){_0x4dc14d[_0x1b94('0x60')][_0x40d24b['id']]=new VoiceExtension(_0x40d24b);}else{_0x4dc14d[_0x1b94('0x3a')](_0x4dc14d[_0x1b94('0x60')][_0x40d24b['id']],_0x40d24b);}}}return _0x4dc14d[_0x1b94('0x60')];};};Realtime[_0x1b94('0x39')]['initCampaignHopperHistory']=function(){var _0x58584a=this;return function(_0x8f7ae7){clearCampaigns(_0x58584a[_0x1b94('0x12')]);for(var _0x4d4a78=0x0;_0x4d4a78<_0x8f7ae7[_0x1b94('0x3c')];_0x4d4a78+=0x1){_[_0x1b94('0x4e')](_0x58584a[_0x1b94('0x12')][_0x8f7ae7[_0x4d4a78][_0x1b94('0x21')]],_0x8f7ae7[_0x4d4a78]);}return _0x58584a[_0x1b94('0x12')];};};Realtime[_0x1b94('0x39')][_0x1b94('0x61')]=function(){var _0x351f35=this;return function(_0xf7253e){if(_0xf7253e){freeIsNotKey(_0xf7253e,_0x351f35[_0x1b94('0x62')],'id');for(var _0x493e33=0x0,_0x1d185e={},_0x242658={};_0x493e33<_0xf7253e[_0x1b94('0x3c')];_0x493e33+=0x1){_0x1d185e=_0xf7253e[_0x493e33];if(_['isUndefined'](_0x351f35[_0x1b94('0x62')][_0x1d185e['id']])){_0x351f35['faxAccounts'][_0x1d185e['id']]=new FaxAccount(_0x1d185e);}else{_0x351f35[_0x1b94('0x3a')](_0x351f35[_0x1b94('0x62')][_0x1d185e['id']],_0x1d185e);}}}return _0x351f35['faxAccounts'];};};module[_0x1b94('0x63')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 90c5336..defb6d6 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 _0x01f5=['substring','indexOf','phone','lastIndexOf','blindTransfer','exports','lodash','moment','util','../../../config/environment','../../../config/logger','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','prototype','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','length','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','destination','exten','type','dialer','lastdata','queue','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridnum','originatecalleridnum','channel','destinationchannel','calleridpreview','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','monitor','monitors','monitorFilename','createdAt','connectedlinename','membername','xcally-motion-dialer','create','forEach','Local'];(function(_0x51308d,_0x42cf02){var _0x37cde8=function(_0x527de4){while(--_0x527de4){_0x51308d['push'](_0x51308d['shift']());}};_0x37cde8(++_0x42cf02);}(_0x01f5,0x15e));var _0x501f=function(_0x3b0b7e,_0x3ce74f){_0x3b0b7e=_0x3b0b7e-0x0;var _0x3c4b3a=_0x01f5[_0x3b0b7e];return _0x3c4b3a;};'use strict';var BPromise=require('bluebird');var _=require(_0x501f('0x0'));var moment=require(_0x501f('0x1'));var util=require(_0x501f('0x2'));var config=require(_0x501f('0x3'));var logger=require(_0x501f('0x4'))('ami');var ami=require(_0x501f('0x5'));var RpcVoiceAgentReport=require(_0x501f('0x6'));var RpcVoiceCallReport=require(_0x501f('0x7'));var RpcVoiceDialReport=require(_0x501f('0x8'));var RpcMemberReport=require(_0x501f('0x9'));var RpcVoiceQueueReport=require(_0x501f('0xa'));var RpcVoiceRecording=require(_0x501f('0xb'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x501f('0xc'));var VoiceCallReport=require(_0x501f('0xd'));var VoiceAgentReport=require(_0x501f('0xe'));var VoiceDialReport=require(_0x501f('0xf'));var UserReport=require(_0x501f('0x10'));function Report(_0x3ad8f3){this['realtime']=_0x3ad8f3;this[_0x501f('0x11')]=_0x3ad8f3[_0x501f('0x11')];this[_0x501f('0x12')]=_0x3ad8f3['telephones'];}Report[_0x501f('0x13')]['sync']=function(_0x410a1a){var _0x5745cd=new VoiceQueueReport(this['realtime']);var _0x4543ab=new VoiceAgentReport(this[_0x501f('0x14')]);var _0x367840=new VoiceDialReport(this[_0x501f('0x14')]);var _0x248745=new VoiceCallReport(this[_0x501f('0x14')]);var _0x2fecf4=new UserReport(this[_0x501f('0x14')]);if(config[_0x501f('0x15')]&&config[_0x501f('0x15')][_0x501f('0x16')]){ami['on'](_0x501f('0x17'),this[_0x501f('0x18')][_0x501f('0x19')](this));ami['on'](_0x501f('0x1a'),this[_0x501f('0x1b')][_0x501f('0x19')](this));ami['on'](_0x501f('0x1c'),this[_0x501f('0x1d')][_0x501f('0x19')](this));ami['on']('custom:voiceDialReport',this[_0x501f('0x1e')]['bind'](this));ami['on']('blindtransfer',this['blindTransfer']['bind'](this));ami['on'](_0x501f('0x1f'),this[_0x501f('0x20')]['bind'](this));}};Report[_0x501f('0x13')][_0x501f('0x21')]=function(_0x5c60e9){var _0x28a26c=undefined;_0x28a26c=_[_0x501f('0x22')](this['agents'],function(_0x5b3ffa){return _0x5b3ffa[_0x501f('0x23')]==_0x5c60e9||_0x5b3ffa[_0x501f('0x24')]==_0x5c60e9;});if(_[_0x501f('0x25')](_0x28a26c)){var _0x125446=_['find'](this[_0x501f('0x12')],function(_0x3786df){return _0x3786df['accountcode']==_0x5c60e9||_0x3786df['name']==_0x5c60e9;});if(_0x125446){_0x28a26c=_[_0x501f('0x22')](this[_0x501f('0x11')],function(_0x1d372e){return _0x1d372e[_0x501f('0x26')]==util[_0x501f('0x27')](_0x501f('0x28'),_0x125446['name']);});}}return _0x28a26c;};Report[_0x501f('0x13')][_0x501f('0x18')]=function(_0x19d4c4){for(var _0x36cbb4=0x0;_0x36cbb4<_0x19d4c4[_0x501f('0x29')];_0x36cbb4+=0x1){var _0x189e1b=this[_0x501f('0x21')](_0x19d4c4[_0x36cbb4]['connectedlinenum']);if(_0x189e1b){_0x19d4c4[_0x36cbb4][_0x501f('0x23')]=_0x189e1b[_0x501f('0x23')];_0x19d4c4[_0x36cbb4][_0x501f('0x2a')]=!![];_0x19d4c4[_0x36cbb4][_0x501f('0x2b')]=_0x189e1b['name'];_0x19d4c4[_0x36cbb4][_0x501f('0x26')]=_['isNil'](_0x189e1b[_0x501f('0x26')])?util[_0x501f('0x27')](_0x501f('0x28'),_0x189e1b['name']):_0x189e1b[_0x501f('0x26')];if(_0x19d4c4[_0x36cbb4][_0x501f('0x2c')]){_0x19d4c4[_0x36cbb4][_0x501f('0x2d')]=moment()[_0x501f('0x27')](_0x501f('0x2e'));}if(_0x19d4c4[_0x36cbb4][_0x501f('0x2f')]){_0x19d4c4[_0x36cbb4][_0x501f('0x30')]=moment()[_0x501f('0x27')](_0x501f('0x2e'));}RpcMemberReport['voiceQueueReport'](_0x19d4c4[_0x36cbb4]);}RpcVoiceQueueReport['create'](_0x19d4c4[_0x36cbb4]);}};function extractCalleridNumber(_0x330cc3){var _0x47efc1=_0x330cc3[_0x501f('0x31')](/<(.*?)>/);return _0x47efc1?_0x47efc1[0x1]:_0x330cc3;}Report[_0x501f('0x13')][_0x501f('0x1b')]=function(_0x198869){_0x198869[_0x501f('0x32')]=_0x198869[_0x501f('0x32')]||_0x198869[_0x501f('0x33')];if(_0x198869[_0x501f('0x34')]==_0x501f('0x35')){_0x198869['lastapplication']='queue';_0x198869[_0x501f('0x36')]=_0x198869[_0x501f('0x37')];if(_0x198869['context']==_0x501f('0x38')){_0x198869[_0x501f('0x23')]='';_0x198869['destination']=extractCalleridNumber(_0x198869[_0x501f('0x39')]);}else if(_0x198869['context']==_0x501f('0x3a')){if(_0x198869[_0x501f('0x32')]==_0x501f('0x3b')){_0x198869[_0x501f('0x32')]=extractCalleridNumber(_0x198869['calleridpreview']);_0x198869[_0x501f('0x3c')]=_0x198869[_0x501f('0x3d')];_0x198869['destinationchannel']=[_0x198869[_0x501f('0x3e')],_0x198869[_0x501f('0x3e')]=_0x198869[_0x501f('0x3f')]][0x0];_0x198869['callerid']=_0x198869[_0x501f('0x40')];}else{_0x198869[_0x501f('0x32')]=_0x198869['calleridnum'];_0x198869['calleridnum']=_0x198869[_0x501f('0x3d')];if(_0x198869[_0x501f('0x41')]==_0x501f('0x42')){_0x198869[_0x501f('0x23')]=_0x198869[_0x501f('0x43')];}else{_0x198869[_0x501f('0x23')]='';}}}}else{_0x198869[_0x501f('0x39')]=util[_0x501f('0x27')](_0x501f('0x44'),_0x198869[_0x501f('0x45')],_0x198869[_0x501f('0x3c')]);}RpcVoiceCallReport['create'](_0x198869);if(_0x198869[_0x501f('0x46')]){for(var _0x52dd5a=0x0;_0x52dd5a<_0x198869[_0x501f('0x47')][_0x501f('0x29')];_0x52dd5a+=0x1){_0x198869[_0x501f('0x48')]=_0x198869[_0x501f('0x47')][_0x52dd5a]['filename'];_0x198869['createdAt']=_0x198869[_0x501f('0x47')][_0x52dd5a][_0x501f('0x49')];if(_0x198869[_0x501f('0x33')]==_0x501f('0x3b')){_0x198869['calleridnum']=_0x198869[_0x501f('0x43')];_0x198869[_0x501f('0x45')]=_0x198869[_0x501f('0x4a')];_0x198869['connectedlinenum']=_0x198869[_0x501f('0x23')];_0x198869[_0x501f('0x4a')]=_0x198869[_0x501f('0x4b')];_0x198869[_0x501f('0x33')]=_0x198869[_0x501f('0x3d')];}else if(_0x198869[_0x501f('0x33')]==_0x501f('0x4c')){_0x198869[_0x501f('0x3c')]=_0x198869[_0x501f('0x32')];_0x198869[_0x501f('0x33')]=_0x198869[_0x501f('0x3d')];}RpcVoiceRecording[_0x501f('0x4d')](_0x198869);}}};Report[_0x501f('0x13')][_0x501f('0x1d')]=function(_0x32f875){if(_['isArray'](_0x32f875)){_0x32f875[_0x501f('0x4e')](function(_0x74b64e){RpcVoiceAgentReport[_0x501f('0x4d')](_0x74b64e);});}else{RpcVoiceAgentReport['create'](_0x32f875);}};Report['prototype'][_0x501f('0x1e')]=function(_0xffdebd){RpcVoiceDialReport[_0x501f('0x4d')](_0xffdebd);var _0x83468d=undefined;var _0x59f605=_0xffdebd[_0x501f('0x3e')];if(_['startsWith'](_0x59f605,_0x501f('0x4f'))){var _0x5effc7=_0x59f605[_0x501f('0x50')](_0x59f605[_0x501f('0x51')]('/')+0x1,_0x59f605[_0x501f('0x51')]('@'));_0x83468d=_['find'](this[_0x501f('0x11')],function(_0x28417b){return _0x28417b['mobile']==_0x5effc7||_0x28417b[_0x501f('0x52')]==_0x5effc7||_0x28417b[_0x501f('0x23')]==_0x5effc7;});}else{var _0x5effc7=_0x59f605[_0x501f('0x50')](_0x59f605[_0x501f('0x51')]('/')+0x1,_0x59f605[_0x501f('0x53')]('-'));_0x83468d=this[_0x501f('0x21')](_0x5effc7);}if(_0x83468d){_0xffdebd[_0x501f('0x26')]=_['isNil'](_0x83468d[_0x501f('0x26')])?util['format']('SIP/%s',_0x83468d[_0x501f('0x24')]):_0x83468d[_0x501f('0x26')];_0xffdebd[_0x501f('0x4b')]=_0x83468d[_0x501f('0x24')];_0xffdebd[_0x501f('0x23')]=_0x83468d[_0x501f('0x23')];RpcMemberReport['voiceDialReport'](_0xffdebd);}};Report['prototype']['blindTransfer']=function(_0x5de148){RpcVoiceTransferReport[_0x501f('0x54')](_0x5de148);};Report[_0x501f('0x13')][_0x501f('0x20')]=function(_0xed2750){RpcVoiceTransferReport[_0x501f('0x20')](_0xed2750);};module[_0x501f('0x55')]=Report; \ No newline at end of file +var _0xaea3=['../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceQueueReport','./voiceQueueReport','./voiceAgentReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceAgentReport','voiceAgentReport','blindtransfer','blindTransfer','findAgent','find','accountcode','name','interface','SIP/%s','length','lastAssignedTo','isNil','queuecallercomplete','queuecallercompleteAt','format','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','voiceCallReport','destination','lastapplication','queue','context','callerid','from-sip','xcally-motion-preview','calleridnum','originatecalleridnum','destinationchannel','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','monitors','monitorFilename','filename','createdAt','exten','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','voiceDialReport','channel','startsWith','Local','substring','indexOf','attendedTransfer','exports','bluebird','lodash','moment','../../../config/environment','../../../config/logger','../ami'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaea3,0x1c8));var _0x3aea=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaea3[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require(_0x3aea('0x0'));var _=require(_0x3aea('0x1'));var moment=require(_0x3aea('0x2'));var util=require('util');var config=require(_0x3aea('0x3'));var logger=require(_0x3aea('0x4'))('ami');var ami=require(_0x3aea('0x5'));var RpcVoiceAgentReport=require(_0x3aea('0x6'));var RpcVoiceCallReport=require(_0x3aea('0x7'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x3aea('0x8'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x3aea('0x9'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x3aea('0xa'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x3aea('0xb'));function Report(_0x1d1b18){this[_0x3aea('0xc')]=_0x1d1b18;this[_0x3aea('0xd')]=_0x1d1b18['agents'];this[_0x3aea('0xe')]=_0x1d1b18[_0x3aea('0xe')];}Report[_0x3aea('0xf')][_0x3aea('0x10')]=function(_0x56eb43){var _0x25613a=new VoiceQueueReport(this[_0x3aea('0xc')]);var _0x51d492=new VoiceAgentReport(this['realtime']);var _0x55e9c7=new VoiceDialReport(this[_0x3aea('0xc')]);var _0x5af28a=new VoiceCallReport(this[_0x3aea('0xc')]);var _0x1dd6b0=new UserReport(this[_0x3aea('0xc')]);if(config[_0x3aea('0x11')]&&config['xdr'][_0x3aea('0x12')]){ami['on'](_0x3aea('0x13'),this[_0x3aea('0x14')]['bind'](this));ami['on']('custom:voiceCallReport',this['voiceCallReport'][_0x3aea('0x15')](this));ami['on'](_0x3aea('0x16'),this[_0x3aea('0x17')][_0x3aea('0x15')](this));ami['on']('custom:voiceDialReport',this['voiceDialReport']['bind'](this));ami['on'](_0x3aea('0x18'),this[_0x3aea('0x19')]['bind'](this));ami['on']('attendedtransfer',this['attendedTransfer'][_0x3aea('0x15')](this));}};Report['prototype'][_0x3aea('0x1a')]=function(_0x5057a5){var _0x1cab03=undefined;_0x1cab03=_[_0x3aea('0x1b')](this[_0x3aea('0xd')],function(_0x540934){return _0x540934[_0x3aea('0x1c')]==_0x5057a5||_0x540934['name']==_0x5057a5;});if(_['isNil'](_0x1cab03)){var _0x54ace2=_[_0x3aea('0x1b')](this[_0x3aea('0xe')],function(_0x40d8a1){return _0x40d8a1[_0x3aea('0x1c')]==_0x5057a5||_0x40d8a1[_0x3aea('0x1d')]==_0x5057a5;});if(_0x54ace2){_0x1cab03=_[_0x3aea('0x1b')](this[_0x3aea('0xd')],function(_0x2d6c2f){return _0x2d6c2f[_0x3aea('0x1e')]==util['format'](_0x3aea('0x1f'),_0x54ace2['name']);});}}return _0x1cab03;};Report[_0x3aea('0xf')]['voiceQueueReport']=function(_0x494672){for(var _0x3acfab=0x0;_0x3acfab<_0x494672[_0x3aea('0x20')];_0x3acfab+=0x1){var _0x46ff15=this[_0x3aea('0x1a')](_0x494672[_0x3acfab]['connectedlinenum']);if(_0x46ff15){_0x494672[_0x3acfab][_0x3aea('0x1c')]=_0x46ff15['accountcode'];_0x494672[_0x3acfab]['assigned']=!![];_0x494672[_0x3acfab][_0x3aea('0x21')]=_0x46ff15[_0x3aea('0x1d')];_0x494672[_0x3acfab][_0x3aea('0x1e')]=_[_0x3aea('0x22')](_0x46ff15[_0x3aea('0x1e')])?util['format'](_0x3aea('0x1f'),_0x46ff15[_0x3aea('0x1d')]):_0x46ff15['interface'];if(_0x494672[_0x3acfab][_0x3aea('0x23')]){_0x494672[_0x3acfab][_0x3aea('0x24')]=moment()[_0x3aea('0x25')](_0x3aea('0x26'));}if(_0x494672[_0x3acfab][_0x3aea('0x27')]){_0x494672[_0x3acfab][_0x3aea('0x28')]=moment()[_0x3aea('0x25')](_0x3aea('0x26'));}RpcMemberReport[_0x3aea('0x14')](_0x494672[_0x3acfab]);}RpcVoiceQueueReport[_0x3aea('0x29')](_0x494672[_0x3acfab]);}};function extractCalleridNumber(_0x18abd2){var _0x1cfe84=_0x18abd2[_0x3aea('0x2a')](/<(.*?)>/);return _0x1cfe84?_0x1cfe84[0x1]:_0x18abd2;}Report['prototype'][_0x3aea('0x2b')]=function(_0x2b1468){_0x2b1468[_0x3aea('0x2c')]=_0x2b1468[_0x3aea('0x2c')]||_0x2b1468['exten'];if(_0x2b1468['type']=='dialer'){_0x2b1468[_0x3aea('0x2d')]='queue';_0x2b1468['lastdata']=_0x2b1468[_0x3aea('0x2e')];if(_0x2b1468[_0x3aea('0x2f')]=='from-voip-provider'){_0x2b1468[_0x3aea('0x1c')]='';_0x2b1468[_0x3aea('0x2c')]=extractCalleridNumber(_0x2b1468[_0x3aea('0x30')]);}else if(_0x2b1468['context']==_0x3aea('0x31')){if(_0x2b1468[_0x3aea('0x2c')]==_0x3aea('0x32')){_0x2b1468[_0x3aea('0x2c')]=extractCalleridNumber(_0x2b1468['calleridpreview']);_0x2b1468[_0x3aea('0x33')]=_0x2b1468[_0x3aea('0x34')];_0x2b1468[_0x3aea('0x35')]=[_0x2b1468['channel'],_0x2b1468['channel']=_0x2b1468['destinationchannel']][0x0];_0x2b1468[_0x3aea('0x30')]=_0x2b1468['calleridpreview'];}else{_0x2b1468[_0x3aea('0x2c')]=_0x2b1468['calleridnum'];_0x2b1468[_0x3aea('0x33')]=_0x2b1468[_0x3aea('0x34')];if(_0x2b1468[_0x3aea('0x36')]==_0x3aea('0x37')){_0x2b1468[_0x3aea('0x1c')]=_0x2b1468[_0x3aea('0x38')];}else{_0x2b1468[_0x3aea('0x1c')]='';}}}}else{_0x2b1468[_0x3aea('0x30')]=util[_0x3aea('0x25')](_0x3aea('0x39'),_0x2b1468[_0x3aea('0x3a')],_0x2b1468['calleridnum']);}RpcVoiceCallReport['create'](_0x2b1468);if(_0x2b1468['monitor']){for(var _0x514e3a=0x0;_0x514e3a<_0x2b1468[_0x3aea('0x3b')][_0x3aea('0x20')];_0x514e3a+=0x1){_0x2b1468[_0x3aea('0x3c')]=_0x2b1468[_0x3aea('0x3b')][_0x514e3a][_0x3aea('0x3d')];_0x2b1468[_0x3aea('0x3e')]=_0x2b1468['monitors'][_0x514e3a][_0x3aea('0x3e')];if(_0x2b1468[_0x3aea('0x3f')]=='xcally-motion-preview'){_0x2b1468[_0x3aea('0x33')]=_0x2b1468[_0x3aea('0x38')];_0x2b1468['calleridname']=_0x2b1468[_0x3aea('0x40')];_0x2b1468[_0x3aea('0x38')]=_0x2b1468[_0x3aea('0x1c')];_0x2b1468[_0x3aea('0x40')]=_0x2b1468[_0x3aea('0x41')];_0x2b1468[_0x3aea('0x3f')]=_0x2b1468[_0x3aea('0x34')];}else if(_0x2b1468[_0x3aea('0x3f')]==_0x3aea('0x42')){_0x2b1468[_0x3aea('0x33')]=_0x2b1468[_0x3aea('0x2c')];_0x2b1468['exten']=_0x2b1468[_0x3aea('0x34')];}RpcVoiceRecording[_0x3aea('0x29')](_0x2b1468);}}};Report[_0x3aea('0xf')][_0x3aea('0x17')]=function(_0x13447c){if(_[_0x3aea('0x43')](_0x13447c)){_0x13447c[_0x3aea('0x44')](function(_0x4758de){RpcVoiceAgentReport[_0x3aea('0x29')](_0x4758de);});}else{RpcVoiceAgentReport[_0x3aea('0x29')](_0x13447c);}};Report[_0x3aea('0xf')][_0x3aea('0x45')]=function(_0x4c2b23){RpcVoiceDialReport[_0x3aea('0x29')](_0x4c2b23);var _0x3a7666=undefined;var _0x4cd55b=_0x4c2b23[_0x3aea('0x46')];if(_[_0x3aea('0x47')](_0x4cd55b,_0x3aea('0x48'))){var _0x5145d8=_0x4cd55b[_0x3aea('0x49')](_0x4cd55b[_0x3aea('0x4a')]('/')+0x1,_0x4cd55b[_0x3aea('0x4a')]('@'));_0x3a7666=_[_0x3aea('0x1b')](this['agents'],function(_0x22edc1){return _0x22edc1['mobile']==_0x5145d8||_0x22edc1['phone']==_0x5145d8||_0x22edc1['accountcode']==_0x5145d8;});}else{var _0x5145d8=_0x4cd55b[_0x3aea('0x49')](_0x4cd55b['indexOf']('/')+0x1,_0x4cd55b['lastIndexOf']('-'));_0x3a7666=this[_0x3aea('0x1a')](_0x5145d8);}if(_0x3a7666){_0x4c2b23[_0x3aea('0x1e')]=_[_0x3aea('0x22')](_0x3a7666[_0x3aea('0x1e')])?util['format'](_0x3aea('0x1f'),_0x3a7666['name']):_0x3a7666[_0x3aea('0x1e')];_0x4c2b23[_0x3aea('0x41')]=_0x3a7666[_0x3aea('0x1d')];_0x4c2b23[_0x3aea('0x1c')]=_0x3a7666[_0x3aea('0x1c')];RpcMemberReport[_0x3aea('0x45')](_0x4c2b23);}};Report[_0x3aea('0xf')][_0x3aea('0x19')]=function(_0x5ea474){RpcVoiceTransferReport[_0x3aea('0x19')](_0x5ea474);};Report[_0x3aea('0xf')]['attendedTransfer']=function(_0x5782c0){RpcVoiceTransferReport[_0x3aea('0x4b')](_0x5782c0);};module[_0x3aea('0x4c')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index fdf6e99..aefc38d 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 _0x4e8b=['find','username','stateRegistry','state','merge','event','format','trunk:%s','name','trunk:save','error','[syncRegistry][UserReport]','syncDeviceState','device','local','toLowerCase','inuse','toNumber','updateStatusRealtime','telephone:%s','telephone:save','stateTime','startsWith','Queue','Local','substring','indexOf','mobile','phone','accountcode','[syncDeviceState][UserReport]','peer','status','address','[syncPeerStatus][UserReport]','exports','lodash','moment','bluebird','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','[loopSyncRealTimeShow]','inspect','prototype','isNotNull','isUndefined','emit'];(function(_0x389b93,_0x3072f3){var _0x5c3fa4=function(_0x562df9){while(--_0x562df9){_0x389b93['push'](_0x389b93['shift']());}};_0x5c3fa4(++_0x3072f3);}(_0x4e8b,0x17d));var _0xb4e8=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x4e8b[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0xb4e8('0x0'));var moment=require(_0xb4e8('0x1'));var BPromise=require(_0xb4e8('0x2'));var util=require(_0xb4e8('0x3'));var Redis=require(_0xb4e8('0x4'));var config=require(_0xb4e8('0x5'));var logger=require(_0xb4e8('0x6'))(_0xb4e8('0x7'));var ami=require(_0xb4e8('0x8'));config[_0xb4e8('0x9')]=_[_0xb4e8('0xa')](config[_0xb4e8('0x9')],{'host':_0xb4e8('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb4e8('0x9')]));function UserReport(_0x13e77e){this[_0xb4e8('0xc')]=_0x13e77e[_0xb4e8('0xc')];this[_0xb4e8('0xd')]=_0x13e77e['agents'];this[_0xb4e8('0xe')]=_0x13e77e['telephones'];ami['on'](_0xb4e8('0xf'),this[_0xb4e8('0x10')]['bind'](this));ami['on']('registry',this[_0xb4e8('0x10')][_0xb4e8('0x11')](this));ami['on'](_0xb4e8('0x12'),this['syncDeviceState'][_0xb4e8('0x11')](this));ami['on'](_0xb4e8('0x13'),this[_0xb4e8('0x14')]['bind'](this));this[_0xb4e8('0x15')]();return BPromise[_0xb4e8('0x16')]()[_0xb4e8('0x17')](ami[_0xb4e8('0x18')]())[_0xb4e8('0x17')](ami[_0xb4e8('0x19')]())['then'](ami['actionSipPeerStatus']())[_0xb4e8('0x1a')](loggerCatch(_0xb4e8('0x1b')));}function loggerCatch(_0x29187d){return function(_0x5c9dc0){logger['error'](_0x29187d,util[_0xb4e8('0x1c')](_0x5c9dc0,{'showHidden':![],'depth':null}));};}UserReport[_0xb4e8('0x1d')]['loopSyncRealTimeShow']=function(){setInterval(function(){BPromise[_0xb4e8('0x16')]()[_0xb4e8('0x17')](ami[_0xb4e8('0x18')]())[_0xb4e8('0x17')](ami['actionDeviceStateList']())[_0xb4e8('0x17')](ami['actionSipPeerStatus']())[_0xb4e8('0x1a')](loggerCatch(_0xb4e8('0x1b')));},0x32c8);};UserReport[_0xb4e8('0x1d')][_0xb4e8('0x1e')]=function(_0x560e12){return _0x560e12!==null&&!_[_0xb4e8('0x1f')](_0x560e12);};UserReport['prototype'][_0xb4e8('0x20')]=function(_0x1deeea,_0x4b6a84,_0x24725d){io['to'](_0x1deeea)[_0xb4e8('0x20')](_0x4b6a84,_0x24725d);};UserReport[_0xb4e8('0x1d')][_0xb4e8('0x10')]=function(_0x275f3b){try{if(this['isNotNull'](_0x275f3b)){var _0x8b09e4=_[_0xb4e8('0x21')](this[_0xb4e8('0xc')],{'registry':_0x275f3b[_0xb4e8('0x22')]});if(_0x8b09e4){_0x275f3b[_0xb4e8('0x23')]=_0x275f3b[_0xb4e8('0x24')];_[_0xb4e8('0x25')](_0x8b09e4,_['omit'](_0x275f3b,[_0xb4e8('0x26'),'actionid',_0xb4e8('0x22'),_0xb4e8('0x24')]));this[_0xb4e8('0x20')](util[_0xb4e8('0x27')](_0xb4e8('0x28'),_0x8b09e4[_0xb4e8('0x29')]),_0xb4e8('0x2a'),_0x8b09e4);}}}catch(_0x553e44){logger[_0xb4e8('0x2b')](_0xb4e8('0x2c'),util['inspect'](_0x553e44,{'showHidden':![],'depth':null}));}};UserReport[_0xb4e8('0x1d')][_0xb4e8('0x2d')]=function(_0xa4ea41){try{if(this[_0xb4e8('0x1e')](_0xa4ea41)){if(this['agents'][_0xa4ea41[_0xb4e8('0x2e')]]){if(!this['agents'][_0xa4ea41[_0xb4e8('0x2e')]][_0xb4e8('0x2f')]||_0xa4ea41['state'][_0xb4e8('0x30')]()==_0xb4e8('0x31')){this[_0xb4e8('0xd')][_0xa4ea41[_0xb4e8('0x2e')]][_0xb4e8('0x2f')]=![];if(this[_0xb4e8('0xd')][_0xa4ea41[_0xb4e8('0x2e')]]['state']!==_0xa4ea41[_0xb4e8('0x24')][_0xb4e8('0x30')]()){this[_0xb4e8('0xd')][_0xa4ea41[_0xb4e8('0x2e')]]['stateTime']=_[_0xb4e8('0x32')](moment()[_0xb4e8('0x27')]('x'));}this[_0xb4e8('0xd')][_0xa4ea41['device']][_0xb4e8('0x24')]=_0xa4ea41['state'][_0xb4e8('0x30')]();this[_0xb4e8('0xd')][_0xa4ea41[_0xb4e8('0x2e')]][_0xb4e8('0x33')](_0xa4ea41);}}else if(this[_0xb4e8('0xe')][_0xa4ea41[_0xb4e8('0x2e')]]){if(this[_0xb4e8('0xe')][_0xa4ea41[_0xb4e8('0x2e')]][_0xb4e8('0x24')]!==_0xa4ea41[_0xb4e8('0x24')][_0xb4e8('0x30')]()){this[_0xb4e8('0xe')][_0xa4ea41['device']]['stateTime']=_['toNumber'](moment()[_0xb4e8('0x27')]('x'));}this[_0xb4e8('0xe')][_0xa4ea41[_0xb4e8('0x2e')]][_0xb4e8('0x24')]=_0xa4ea41['state'][_0xb4e8('0x30')]();this[_0xb4e8('0x20')](util[_0xb4e8('0x27')](_0xb4e8('0x34'),this[_0xb4e8('0xe')][_0xa4ea41[_0xb4e8('0x2e')]][_0xb4e8('0x29')]),_0xb4e8('0x35'),this[_0xb4e8('0xe')][_0xa4ea41['device']]);}else if(this[_0xb4e8('0xc')][_0xa4ea41['device']]){if(this[_0xb4e8('0xc')][_0xa4ea41[_0xb4e8('0x2e')]][_0xb4e8('0x24')]!==_0xa4ea41['state'][_0xb4e8('0x30')]()){this['trunks'][_0xa4ea41[_0xb4e8('0x2e')]][_0xb4e8('0x36')]=_['toNumber'](moment()[_0xb4e8('0x27')]('x'));}this[_0xb4e8('0xc')][_0xa4ea41[_0xb4e8('0x2e')]]['state']=_0xa4ea41[_0xb4e8('0x24')][_0xb4e8('0x30')]();this[_0xb4e8('0x20')](util['format'](_0xb4e8('0x28'),this[_0xb4e8('0xc')][_0xa4ea41[_0xb4e8('0x2e')]][_0xb4e8('0x29')]),_0xb4e8('0x2a'),this[_0xb4e8('0xc')][_0xa4ea41['device']]);}else if(_[_0xb4e8('0x37')](_0xa4ea41[_0xb4e8('0x2e')],_0xb4e8('0x38'))){}else if(_['startsWith'](_0xa4ea41[_0xb4e8('0x2e')],_0xb4e8('0x39'))){var _0x5128c3=_0xa4ea41[_0xb4e8('0x2e')];var _0x27dc61=_0x5128c3[_0xb4e8('0x3a')](_0x5128c3[_0xb4e8('0x3b')]('/')+0x1,_0x5128c3[_0xb4e8('0x3b')]('@'));var _0x8b7424=_[_0xb4e8('0x21')](this['agents'],function(_0xc960fc){return _0xc960fc[_0xb4e8('0x3c')]==_0x27dc61||_0xc960fc[_0xb4e8('0x3d')]==_0x27dc61||_0xc960fc[_0xb4e8('0x3e')]==_0x27dc61;});if(_0x8b7424){if(_0x8b7424['state']!==_0xa4ea41[_0xb4e8('0x24')][_0xb4e8('0x30')]()){_0x8b7424['stateTime']=_[_0xb4e8('0x32')](moment()['format']('x'));}_0x8b7424['state']=_0xa4ea41[_0xb4e8('0x24')][_0xb4e8('0x30')]();_0x8b7424[_0xb4e8('0x2f')]=!![];_0x8b7424[_0xb4e8('0x33')](_0xa4ea41);}}else{}}}catch(_0x15c53e){logger[_0xb4e8('0x2b')](_0xb4e8('0x3f'),util[_0xb4e8('0x1c')](_0x15c53e,{'showHidden':![],'depth':null}));}};UserReport[_0xb4e8('0x1d')][_0xb4e8('0x14')]=function(_0x36e1ea){try{if(this[_0xb4e8('0x1e')](_0x36e1ea)&&this[_0xb4e8('0x1e')](_0x36e1ea[_0xb4e8('0x13')])){if(this['agents'][_0x36e1ea[_0xb4e8('0x40')]]){if(!this[_0xb4e8('0xd')][_0x36e1ea[_0xb4e8('0x40')]][_0xb4e8('0x2f')]||_0x36e1ea[_0xb4e8('0x13')]['toLowerCase']()=='registered'){this[_0xb4e8('0xd')][_0x36e1ea[_0xb4e8('0x40')]][_0xb4e8('0x2f')]=![];this[_0xb4e8('0xd')][_0x36e1ea[_0xb4e8('0x40')]][_0xb4e8('0x41')]=_0x36e1ea[_0xb4e8('0x13')][_0xb4e8('0x30')]();this[_0xb4e8('0xd')][_0x36e1ea[_0xb4e8('0x40')]]['address']=_0x36e1ea[_0xb4e8('0x42')];this[_0xb4e8('0xd')][_0x36e1ea[_0xb4e8('0x40')]][_0xb4e8('0x33')](_0x36e1ea);}}else if(this[_0xb4e8('0xe')][_0x36e1ea[_0xb4e8('0x40')]]){this[_0xb4e8('0xe')][_0x36e1ea[_0xb4e8('0x40')]][_0xb4e8('0x41')]=_0x36e1ea[_0xb4e8('0x13')]['toLowerCase']();this[_0xb4e8('0xe')][_0x36e1ea[_0xb4e8('0x40')]][_0xb4e8('0x42')]=_0x36e1ea[_0xb4e8('0x42')];this[_0xb4e8('0x20')](util[_0xb4e8('0x27')](_0xb4e8('0x34'),this[_0xb4e8('0xe')][_0x36e1ea['peer']]['name']),_0xb4e8('0x35'),this[_0xb4e8('0xe')][_0x36e1ea[_0xb4e8('0x40')]]);}else if(this['trunks'][_0x36e1ea[_0xb4e8('0x40')]]){this[_0xb4e8('0xc')][_0x36e1ea[_0xb4e8('0x40')]][_0xb4e8('0x41')]=_0x36e1ea[_0xb4e8('0x13')]['toLowerCase']();this[_0xb4e8('0xc')][_0x36e1ea['peer']]['address']=_0x36e1ea['address'];this[_0xb4e8('0x20')](util['format']('trunk:%s',this['trunks'][_0x36e1ea[_0xb4e8('0x40')]][_0xb4e8('0x29')]),_0xb4e8('0x2a'),this[_0xb4e8('0xc')][_0x36e1ea['peer']]);}else{}}}catch(_0x110831){logger['error'](_0xb4e8('0x43'),util[_0xb4e8('0x1c')](_0x110831,{'showHidden':![],'depth':null}));}};module[_0xb4e8('0x44')]=UserReport; \ No newline at end of file +var _0x9440=['phone','accountcode','stateTime','updateStatusRealtime','[syncDeviceState][UserReport]','peer','registered','status','address','[syncPeerStatus][UserReport]','exports','lodash','bluebird','util','ioredis','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','bind','devicestatechange','syncDeviceState','peerstatus','actionSipShowRegistry','then','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','prototype','loopSyncRealTimeShow','isNotNull','isUndefined','emit','syncRegistry','find','username','stateRegistry','state','merge','omit','actionid','format','trunk:%s','name','trunk:save','agents','device','local','toLowerCase','inuse','toNumber','telephones','telephone:%s','telephone:save','Queue','startsWith','Local','substring','indexOf','mobile'];(function(_0x13a609,_0x4168b9){var _0x5560f9=function(_0x1e61d9){while(--_0x1e61d9){_0x13a609['push'](_0x13a609['shift']());}};_0x5560f9(++_0x4168b9);}(_0x9440,0x117));var _0x0944=function(_0xae0c01,_0x449c99){_0xae0c01=_0xae0c01-0x0;var _0x913e86=_0x9440[_0xae0c01];return _0x913e86;};'use strict';var _=require(_0x0944('0x0'));var moment=require('moment');var BPromise=require(_0x0944('0x1'));var util=require(_0x0944('0x2'));var Redis=require(_0x0944('0x3'));var config=require('../../../config/environment');var logger=require(_0x0944('0x4'))(_0x0944('0x5'));var ami=require(_0x0944('0x6'));config[_0x0944('0x7')]=_[_0x0944('0x8')](config[_0x0944('0x7')],{'host':_0x0944('0x9'),'port':0x18eb});var io=require(_0x0944('0xa'))(new Redis(config[_0x0944('0x7')]));function UserReport(_0x1847b5){this['trunks']=_0x1847b5[_0x0944('0xb')];this['agents']=_0x1847b5['agents'];this['telephones']=_0x1847b5['telephones'];ami['on']('registryentry',this['syncRegistry'][_0x0944('0xc')](this));ami['on']('registry',this['syncRegistry'][_0x0944('0xc')](this));ami['on'](_0x0944('0xd'),this[_0x0944('0xe')]['bind'](this));ami['on'](_0x0944('0xf'),this['syncPeerStatus']['bind'](this));this['loopSyncRealTimeShow']();return BPromise['resolve']()['then'](ami[_0x0944('0x10')]())[_0x0944('0x11')](ami[_0x0944('0x12')]())[_0x0944('0x11')](ami[_0x0944('0x13')]())[_0x0944('0x14')](loggerCatch(_0x0944('0x15')));}function loggerCatch(_0x14144b){return function(_0x588088){logger[_0x0944('0x16')](_0x14144b,util[_0x0944('0x17')](_0x588088,{'showHidden':![],'depth':null}));};}UserReport[_0x0944('0x18')][_0x0944('0x19')]=function(){setInterval(function(){BPromise['resolve']()[_0x0944('0x11')](ami[_0x0944('0x10')]())[_0x0944('0x11')](ami[_0x0944('0x12')]())[_0x0944('0x11')](ami[_0x0944('0x13')]())[_0x0944('0x14')](loggerCatch(_0x0944('0x15')));},0x32c8);};UserReport['prototype'][_0x0944('0x1a')]=function(_0x34700a){return _0x34700a!==null&&!_[_0x0944('0x1b')](_0x34700a);};UserReport[_0x0944('0x18')]['emit']=function(_0x1a9b2f,_0xcb056f,_0x15b8d0){io['to'](_0x1a9b2f)[_0x0944('0x1c')](_0xcb056f,_0x15b8d0);};UserReport[_0x0944('0x18')][_0x0944('0x1d')]=function(_0x2d11fd){try{if(this[_0x0944('0x1a')](_0x2d11fd)){var _0x5aed90=_[_0x0944('0x1e')](this[_0x0944('0xb')],{'registry':_0x2d11fd[_0x0944('0x1f')]});if(_0x5aed90){_0x2d11fd[_0x0944('0x20')]=_0x2d11fd[_0x0944('0x21')];_[_0x0944('0x22')](_0x5aed90,_[_0x0944('0x23')](_0x2d11fd,['event',_0x0944('0x24'),'username',_0x0944('0x21')]));this[_0x0944('0x1c')](util[_0x0944('0x25')](_0x0944('0x26'),_0x5aed90[_0x0944('0x27')]),_0x0944('0x28'),_0x5aed90);}}}catch(_0x445ceb){logger[_0x0944('0x16')]('[syncRegistry][UserReport]',util[_0x0944('0x17')](_0x445ceb,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x0944('0xe')]=function(_0x58000e){try{if(this[_0x0944('0x1a')](_0x58000e)){if(this[_0x0944('0x29')][_0x58000e[_0x0944('0x2a')]]){if(!this[_0x0944('0x29')][_0x58000e['device']][_0x0944('0x2b')]||_0x58000e['state'][_0x0944('0x2c')]()==_0x0944('0x2d')){this['agents'][_0x58000e[_0x0944('0x2a')]][_0x0944('0x2b')]=![];if(this[_0x0944('0x29')][_0x58000e[_0x0944('0x2a')]]['state']!==_0x58000e['state'][_0x0944('0x2c')]()){this[_0x0944('0x29')][_0x58000e['device']]['stateTime']=_[_0x0944('0x2e')](moment()[_0x0944('0x25')]('x'));}this['agents'][_0x58000e[_0x0944('0x2a')]][_0x0944('0x21')]=_0x58000e['state'][_0x0944('0x2c')]();this[_0x0944('0x29')][_0x58000e[_0x0944('0x2a')]]['updateStatusRealtime'](_0x58000e);}}else if(this[_0x0944('0x2f')][_0x58000e[_0x0944('0x2a')]]){if(this[_0x0944('0x2f')][_0x58000e['device']][_0x0944('0x21')]!==_0x58000e[_0x0944('0x21')][_0x0944('0x2c')]()){this[_0x0944('0x2f')][_0x58000e[_0x0944('0x2a')]]['stateTime']=_[_0x0944('0x2e')](moment()[_0x0944('0x25')]('x'));}this[_0x0944('0x2f')][_0x58000e['device']][_0x0944('0x21')]=_0x58000e[_0x0944('0x21')]['toLowerCase']();this[_0x0944('0x1c')](util[_0x0944('0x25')](_0x0944('0x30'),this[_0x0944('0x2f')][_0x58000e['device']]['name']),_0x0944('0x31'),this[_0x0944('0x2f')][_0x58000e[_0x0944('0x2a')]]);}else if(this[_0x0944('0xb')][_0x58000e[_0x0944('0x2a')]]){if(this[_0x0944('0xb')][_0x58000e[_0x0944('0x2a')]][_0x0944('0x21')]!==_0x58000e['state'][_0x0944('0x2c')]()){this[_0x0944('0xb')][_0x58000e[_0x0944('0x2a')]]['stateTime']=_['toNumber'](moment()['format']('x'));}this[_0x0944('0xb')][_0x58000e['device']][_0x0944('0x21')]=_0x58000e['state'][_0x0944('0x2c')]();this[_0x0944('0x1c')](util['format'](_0x0944('0x26'),this[_0x0944('0xb')][_0x58000e['device']]['name']),'trunk:save',this[_0x0944('0xb')][_0x58000e[_0x0944('0x2a')]]);}else if(_['startsWith'](_0x58000e[_0x0944('0x2a')],_0x0944('0x32'))){}else if(_[_0x0944('0x33')](_0x58000e[_0x0944('0x2a')],_0x0944('0x34'))){var _0x22ded0=_0x58000e[_0x0944('0x2a')];var _0x4ea739=_0x22ded0[_0x0944('0x35')](_0x22ded0[_0x0944('0x36')]('/')+0x1,_0x22ded0[_0x0944('0x36')]('@'));var _0x1da14d=_[_0x0944('0x1e')](this[_0x0944('0x29')],function(_0x17f891){return _0x17f891[_0x0944('0x37')]==_0x4ea739||_0x17f891[_0x0944('0x38')]==_0x4ea739||_0x17f891[_0x0944('0x39')]==_0x4ea739;});if(_0x1da14d){if(_0x1da14d[_0x0944('0x21')]!==_0x58000e[_0x0944('0x21')][_0x0944('0x2c')]()){_0x1da14d[_0x0944('0x3a')]=_[_0x0944('0x2e')](moment()[_0x0944('0x25')]('x'));}_0x1da14d[_0x0944('0x21')]=_0x58000e['state']['toLowerCase']();_0x1da14d['local']=!![];_0x1da14d[_0x0944('0x3b')](_0x58000e);}}else{}}}catch(_0x2dcd75){logger['error'](_0x0944('0x3c'),util[_0x0944('0x17')](_0x2dcd75,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncPeerStatus']=function(_0x2e4cfa){try{if(this[_0x0944('0x1a')](_0x2e4cfa)&&this['isNotNull'](_0x2e4cfa[_0x0944('0xf')])){if(this[_0x0944('0x29')][_0x2e4cfa['peer']]){if(!this[_0x0944('0x29')][_0x2e4cfa[_0x0944('0x3d')]][_0x0944('0x2b')]||_0x2e4cfa[_0x0944('0xf')][_0x0944('0x2c')]()==_0x0944('0x3e')){this['agents'][_0x2e4cfa['peer']]['local']=![];this[_0x0944('0x29')][_0x2e4cfa[_0x0944('0x3d')]][_0x0944('0x3f')]=_0x2e4cfa['peerstatus'][_0x0944('0x2c')]();this[_0x0944('0x29')][_0x2e4cfa[_0x0944('0x3d')]][_0x0944('0x40')]=_0x2e4cfa['address'];this[_0x0944('0x29')][_0x2e4cfa[_0x0944('0x3d')]][_0x0944('0x3b')](_0x2e4cfa);}}else if(this['telephones'][_0x2e4cfa[_0x0944('0x3d')]]){this[_0x0944('0x2f')][_0x2e4cfa[_0x0944('0x3d')]]['status']=_0x2e4cfa[_0x0944('0xf')][_0x0944('0x2c')]();this[_0x0944('0x2f')][_0x2e4cfa[_0x0944('0x3d')]][_0x0944('0x40')]=_0x2e4cfa[_0x0944('0x40')];this[_0x0944('0x1c')](util[_0x0944('0x25')](_0x0944('0x30'),this['telephones'][_0x2e4cfa[_0x0944('0x3d')]]['name']),_0x0944('0x31'),this[_0x0944('0x2f')][_0x2e4cfa['peer']]);}else if(this[_0x0944('0xb')][_0x2e4cfa[_0x0944('0x3d')]]){this['trunks'][_0x2e4cfa[_0x0944('0x3d')]]['status']=_0x2e4cfa[_0x0944('0xf')][_0x0944('0x2c')]();this[_0x0944('0xb')][_0x2e4cfa['peer']][_0x0944('0x40')]=_0x2e4cfa[_0x0944('0x40')];this[_0x0944('0x1c')](util[_0x0944('0x25')](_0x0944('0x26'),this[_0x0944('0xb')][_0x2e4cfa[_0x0944('0x3d')]][_0x0944('0x27')]),_0x0944('0x28'),this['trunks'][_0x2e4cfa[_0x0944('0x3d')]]);}else{}}}catch(_0x29686a){logger[_0x0944('0x16')](_0x0944('0x41'),util['inspect'](_0x29686a,{'showHidden':![],'depth':null}));}};module[_0x0944('0x42')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index feba7d4..d5d4994 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 _0x1e0c=['secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','[syncBlindTransfer][VoiceAgentReport]','syncMusicOnHoldStart','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','syncMusicOnHoldStop','lodash','moment','ioredis','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','syncAgentComplete','syncVarSet','hangup','syncHangup','musiconholdstart','musiconholdstop','syncBlindTransfer','isNotNull','prototype','uniqueid','isUndefined','destuniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','type','inbound','omit','privilege','emit','custom:agentcalled','format','user:%s','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','agentconnectAt','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','merge','interface','pick','destconnectedlinenum','agentringnoanswer','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheremembername','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','syncAgentRingNoAnswer','rejected','custom:agentringnoanswer','abandoned','custom:agentqueuecallerabandon','agentcomplete','complete','talktime','transfer','agent','acw','acwtime','acwTimeout','user:agentcomplete','custom:agentcomplete','addVariable','keys','[syncVarSet][VoiceAgentReport]','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','agentcompleteAt','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','diff','seconds'];(function(_0x4d5a8c,_0x531aad){var _0x1bc4fc=function(_0x5de7a2){while(--_0x5de7a2){_0x4d5a8c['push'](_0x4d5a8c['shift']());}};_0x1bc4fc(++_0x531aad);}(_0x1e0c,0x1e7));var _0xc1e0=function(_0x17b9e2,_0x3921fa){_0x17b9e2=_0x17b9e2-0x0;var _0x4335d2=_0x1e0c[_0x17b9e2];return _0x4335d2;};'use strict';var _=require(_0xc1e0('0x0'));var moment=require(_0xc1e0('0x1'));var util=require('util');var Redis=require(_0xc1e0('0x2'));var config=require('../../../config/environment');var logger=require(_0xc1e0('0x3'))(_0xc1e0('0x4'));var ami=require(_0xc1e0('0x5'));config[_0xc1e0('0x6')]=_[_0xc1e0('0x7')](config[_0xc1e0('0x6')],{'host':_0xc1e0('0x8'),'port':0x18eb});var io=require(_0xc1e0('0x9'))(new Redis(config[_0xc1e0('0x6')]));function VoiceAgentReport(_0x243569){this[_0xc1e0('0xa')]={};this['voiceQueues']=_0x243569[_0xc1e0('0xb')];this[_0xc1e0('0xc')]=_0x243569[_0xc1e0('0xc')];this[_0xc1e0('0xd')]={};ami['on'](_0xc1e0('0xe'),this[_0xc1e0('0xf')][_0xc1e0('0x10')](this));ami['on'](_0xc1e0('0x11'),this[_0xc1e0('0x12')][_0xc1e0('0x10')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0xc1e0('0x10')](this));ami['on'](_0xc1e0('0x13'),this[_0xc1e0('0x14')]['bind'](this));ami['on']('agentcomplete',this[_0xc1e0('0x15')][_0xc1e0('0x10')](this));ami['on']('varset',this[_0xc1e0('0x16')][_0xc1e0('0x10')](this));ami['on'](_0xc1e0('0x17'),this[_0xc1e0('0x18')][_0xc1e0('0x10')](this));ami['on'](_0xc1e0('0x19'),this['syncMusicOnHoldStart'][_0xc1e0('0x10')](this));ami['on'](_0xc1e0('0x1a'),this['syncMusicOnHoldStop']['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this[_0xc1e0('0x1b')][_0xc1e0('0x10')](this));}VoiceAgentReport['prototype']['emit']=function(_0x4696b0,_0x272d20,_0x5809a3){io['to'](_0x4696b0)['emit'](_0x272d20,_0x5809a3);};VoiceAgentReport['prototype'][_0xc1e0('0x1c')]=function(_0x5f1719){return _0x5f1719!==null&&!_['isUndefined'](_0x5f1719);};VoiceAgentReport[_0xc1e0('0x1d')][_0xc1e0('0xf')]=function(_0x4e5f2c){try{if(this[_0xc1e0('0x1c')](_0x4e5f2c)){if(_['isUndefined'](this[_0xc1e0('0xa')][_0x4e5f2c[_0xc1e0('0x1e')]])){this['channels'][_0x4e5f2c['uniqueid']]={};}if(_[_0xc1e0('0x1f')](this[_0xc1e0('0xa')][_0x4e5f2c[_0xc1e0('0x1e')]][_0x4e5f2c[_0xc1e0('0x20')]])){this[_0xc1e0('0xa')][_0x4e5f2c[_0xc1e0('0x1e')]][_0x4e5f2c[_0xc1e0('0x20')]]={'agentcalledAt':moment()['format'](_0xc1e0('0x21')),'lastevent':'called','variables':this[_0xc1e0('0xd')][_0x4e5f2c['uniqueid']],'type':this[_0xc1e0('0xb')][_0x4e5f2c[_0xc1e0('0x22')]]?this[_0xc1e0('0xb')][_0x4e5f2c[_0xc1e0('0x22')]][_0xc1e0('0x23')]||_0xc1e0('0x24'):_0xc1e0('0x24')};}_['merge'](this[_0xc1e0('0xa')][_0x4e5f2c[_0xc1e0('0x1e')]][_0x4e5f2c[_0xc1e0('0x20')]],_[_0xc1e0('0x25')](_0x4e5f2c,['event',_0xc1e0('0x26')]));ami[_0xc1e0('0x27')](_0xc1e0('0x28'),this['channels'][_0x4e5f2c['uniqueid']][_0x4e5f2c[_0xc1e0('0x20')]]);this[_0xc1e0('0x27')](util[_0xc1e0('0x29')](_0xc1e0('0x2a'),_0x4e5f2c[_0xc1e0('0x2b')]),_0xc1e0('0x2c'),this[_0xc1e0('0xa')][_0x4e5f2c[_0xc1e0('0x1e')]][_0x4e5f2c[_0xc1e0('0x20')]]);}}catch(_0x573f1d){logger[_0xc1e0('0x2d')](_0xc1e0('0x2e'),util[_0xc1e0('0x2f')](_0x573f1d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc1e0('0x1d')][_0xc1e0('0x12')]=function(_0x5b9706){try{if(this[_0xc1e0('0x1c')](_0x5b9706)){if(this['channels'][_0x5b9706[_0xc1e0('0x1e')]]){for(var _0x3d02da in this[_0xc1e0('0xa')][_0x5b9706[_0xc1e0('0x1e')]]){if(this['channels'][_0x5b9706[_0xc1e0('0x1e')]][_0xc1e0('0x30')](_0x3d02da)){if(_0x5b9706[_0xc1e0('0x20')]===_0x3d02da){this[_0xc1e0('0xa')][_0x5b9706['uniqueid']][_0x3d02da][_0xc1e0('0x31')]=moment()[_0xc1e0('0x29')](_0xc1e0('0x21'));this['channels'][_0x5b9706[_0xc1e0('0x1e')]][_0x3d02da][_0xc1e0('0x32')]=_0xc1e0('0x33');this['channels'][_0x5b9706[_0xc1e0('0x1e')]][_0x3d02da]['holdtime']=_0x5b9706[_0xc1e0('0x34')];this[_0xc1e0('0xa')][_0x5b9706[_0xc1e0('0x1e')]][_0x3d02da][_0xc1e0('0x35')]=_0x5b9706[_0xc1e0('0x35')];this[_0xc1e0('0xa')][_0x5b9706[_0xc1e0('0x1e')]][_0x3d02da]['connectedlinename']=_0x5b9706[_0xc1e0('0x36')];this['channels'][_0x5b9706['uniqueid']][_0x3d02da][_0xc1e0('0x37')]=_0x5b9706[_0xc1e0('0x37')];this['channels'][_0x5b9706[_0xc1e0('0x1e')]][_0x3d02da]['destchannelstatedesc']=_0x5b9706[_0xc1e0('0x38')];_[_0xc1e0('0x39')](this[_0xc1e0('0xc')][_0x5b9706[_0xc1e0('0x3a')]],_[_0xc1e0('0x3b')](_0x5b9706,[_0xc1e0('0x22'),_0xc1e0('0x3c')]));this[_0xc1e0('0x27')](util[_0xc1e0('0x29')]('user:%s',_0x5b9706[_0xc1e0('0x2b')]),'user:agentconnect',this[_0xc1e0('0xa')][_0x5b9706[_0xc1e0('0x1e')]][_0x5b9706[_0xc1e0('0x20')]]);ami[_0xc1e0('0x27')]('custom:agentconnect',this['channels'][_0x5b9706[_0xc1e0('0x1e')]][_0x3d02da]);}else if(!this[_0xc1e0('0xa')][_0x5b9706[_0xc1e0('0x1e')]][_0x3d02da][_0xc1e0('0x3d')]&&!this[_0xc1e0('0xa')][_0x5b9706[_0xc1e0('0x1e')]][_0x3d02da]['agentcomplete']){this[_0xc1e0('0xa')][_0x5b9706['uniqueid']][_0x3d02da][_0xc1e0('0x3d')]=!![];this[_0xc1e0('0xa')][_0x5b9706[_0xc1e0('0x1e')]][_0x3d02da][_0xc1e0('0x3e')]=moment()['format'](_0xc1e0('0x21'));this['channels'][_0x5b9706[_0xc1e0('0x1e')]][_0x3d02da][_0xc1e0('0x3f')]=_0xc1e0('0x40');this[_0xc1e0('0xa')][_0x5b9706['uniqueid']][_0x3d02da][_0xc1e0('0x32')]=_0xc1e0('0x40');this[_0xc1e0('0xa')][_0x5b9706[_0xc1e0('0x1e')]][_0x3d02da]['answeredelsewheredestinationuniqueid']=_0x5b9706['destuniqueid'];this['channels'][_0x5b9706['uniqueid']][_0x3d02da][_0xc1e0('0x41')]=_0x5b9706[_0xc1e0('0x2b')];ami[_0xc1e0('0x27')](_0xc1e0('0x42'),this[_0xc1e0('0xa')][_0x5b9706[_0xc1e0('0x1e')]][_0x3d02da]);}}}}}}catch(_0x38dc0b){logger[_0xc1e0('0x2d')](_0xc1e0('0x43'),util['inspect'](_0x38dc0b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc1e0('0x1d')][_0xc1e0('0x44')]=function(_0x377f39){try{if(this['isNotNull'](_0x377f39)){if(this[_0xc1e0('0xa')][_0x377f39['uniqueid']]&&this[_0xc1e0('0xa')][_0x377f39[_0xc1e0('0x1e')]][_0x377f39[_0xc1e0('0x20')]]){this[_0xc1e0('0xa')][_0x377f39[_0xc1e0('0x1e')]][_0x377f39[_0xc1e0('0x20')]][_0xc1e0('0x3d')]=!![];this[_0xc1e0('0xa')][_0x377f39[_0xc1e0('0x1e')]][_0x377f39[_0xc1e0('0x20')]][_0xc1e0('0x3e')]=moment()[_0xc1e0('0x29')](_0xc1e0('0x21'));this['channels'][_0x377f39[_0xc1e0('0x1e')]][_0x377f39['destuniqueid']][_0xc1e0('0x3f')]='rejected';this[_0xc1e0('0xa')][_0x377f39[_0xc1e0('0x1e')]][_0x377f39[_0xc1e0('0x20')]][_0xc1e0('0x32')]=_0xc1e0('0x45');ami[_0xc1e0('0x27')](_0xc1e0('0x46'),this[_0xc1e0('0xa')][_0x377f39[_0xc1e0('0x1e')]][_0x377f39[_0xc1e0('0x20')]]);}}}catch(_0xe083b1){logger[_0xc1e0('0x2d')]('[syncAgentRingNoAnswer][VoiceAgentReport]',util['inspect'](_0xe083b1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc1e0('0x1d')]['syncQueueCallerAbandon']=function(_0xb8fdff){try{if(this['isNotNull'](_0xb8fdff)){if(this['channels'][_0xb8fdff['uniqueid']]){for(var _0x175aca in this[_0xc1e0('0xa')][_0xb8fdff[_0xc1e0('0x1e')]]){if(this['channels'][_0xb8fdff[_0xc1e0('0x1e')]][_0xc1e0('0x30')](_0x175aca)&&!this[_0xc1e0('0xa')][_0xb8fdff['uniqueid']][_0x175aca][_0xc1e0('0x3d')]&&!this['channels'][_0xb8fdff['uniqueid']][_0x175aca]['agentcomplete']){this['channels'][_0xb8fdff[_0xc1e0('0x1e')]][_0x175aca]['agentringnoanswer']=!![];this['channels'][_0xb8fdff[_0xc1e0('0x1e')]][_0x175aca][_0xc1e0('0x3e')]=moment()[_0xc1e0('0x29')](_0xc1e0('0x21'));this[_0xc1e0('0xa')][_0xb8fdff[_0xc1e0('0x1e')]][_0x175aca][_0xc1e0('0x3f')]='abandoned';this[_0xc1e0('0xa')][_0xb8fdff[_0xc1e0('0x1e')]][_0x175aca]['lastevent']=_0xc1e0('0x47');ami[_0xc1e0('0x27')](_0xc1e0('0x48'),this['channels'][_0xb8fdff[_0xc1e0('0x1e')]][_0x175aca]);}}}}}catch(_0x52f985){logger[_0xc1e0('0x2d')]('[syncQueueCallerAbandon][VoiceAgentReport]',util[_0xc1e0('0x2f')](_0x52f985,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc1e0('0x1d')][_0xc1e0('0x15')]=function(_0x4377d0){try{if(this[_0xc1e0('0x1c')](_0x4377d0)){if(this[_0xc1e0('0xa')][_0x4377d0['uniqueid']]){for(var _0x491e95 in this[_0xc1e0('0xa')][_0x4377d0[_0xc1e0('0x1e')]]){if(this['channels'][_0x4377d0[_0xc1e0('0x1e')]][_0xc1e0('0x30')](_0x491e95)){if(this[_0xc1e0('0xa')][_0x4377d0[_0xc1e0('0x1e')]][_0x491e95][_0xc1e0('0x31')]&&!this[_0xc1e0('0xa')][_0x4377d0[_0xc1e0('0x1e')]][_0x491e95][_0xc1e0('0x49')]){this[_0xc1e0('0xa')][_0x4377d0[_0xc1e0('0x1e')]][_0x491e95][_0xc1e0('0x49')]=!![];this[_0xc1e0('0xa')][_0x4377d0['uniqueid']][_0x491e95]['agentcompleteAt']=moment()['format'](_0xc1e0('0x21'));this[_0xc1e0('0xa')][_0x4377d0[_0xc1e0('0x1e')]][_0x491e95][_0xc1e0('0x32')]=_0xc1e0('0x4a');this[_0xc1e0('0xa')][_0x4377d0[_0xc1e0('0x1e')]][_0x491e95]['talktime']=_0x4377d0[_0xc1e0('0x4b')];this[_0xc1e0('0xa')][_0x4377d0['uniqueid']][_0x491e95]['reason']=_0x4377d0[_0xc1e0('0x3f')]==_0xc1e0('0x4c')?_0xc1e0('0x4d'):_0x4377d0[_0xc1e0('0x3f')];if(this[_0xc1e0('0xb')][_0x4377d0[_0xc1e0('0x22')]]&&this[_0xc1e0('0xb')][_0x4377d0[_0xc1e0('0x22')]][_0xc1e0('0x4e')]){this[_0xc1e0('0xa')][_0x4377d0['uniqueid']][_0x491e95]['agentacw']=!![];this[_0xc1e0('0xa')][_0x4377d0[_0xc1e0('0x1e')]][_0x491e95][_0xc1e0('0x4f')]=this[_0xc1e0('0xb')][_0x4377d0['queue']][_0xc1e0('0x50')];}this['agents'][_0x4377d0['interface']]=_[_0xc1e0('0x25')](this[_0xc1e0('0xc')][_0x4377d0['interface']],[_0xc1e0('0x22'),_0xc1e0('0x3c')]);this[_0xc1e0('0x27')](util['format'](_0xc1e0('0x2a'),_0x4377d0[_0xc1e0('0x2b')]),_0xc1e0('0x51'),this[_0xc1e0('0xa')][_0x4377d0[_0xc1e0('0x1e')]][_0x491e95]);ami[_0xc1e0('0x27')](_0xc1e0('0x52'),this[_0xc1e0('0xa')][_0x4377d0[_0xc1e0('0x1e')]][_0x491e95]);}}}}}}catch(_0x4cef8d){logger[_0xc1e0('0x2d')]('[syncAgentComplete][VoiceAgentReport]',util[_0xc1e0('0x2f')](_0x4cef8d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc1e0('0x1d')][_0xc1e0('0x16')]=function(_0x314309){try{if(this[_0xc1e0('0x1c')](_0x314309)){this[_0xc1e0('0x53')](_0x314309[_0xc1e0('0x1e')],_[_0xc1e0('0x54')](_0x314309['variable'])[0x0],_0x314309['value']);if(this['channels'][_0x314309['uniqueid']]){for(var _0x315e55 in this[_0xc1e0('0xa')][_0x314309['uniqueid']]){if(this[_0xc1e0('0xa')][_0x314309[_0xc1e0('0x1e')]]['hasOwnProperty'](_0x315e55)){if(_['isUndefined'](this[_0xc1e0('0xa')][_0x314309[_0xc1e0('0x1e')]][_0x315e55][_0xc1e0('0xd')])){this[_0xc1e0('0xa')][_0x314309[_0xc1e0('0x1e')]][_0x315e55][_0xc1e0('0xd')]={};}this[_0xc1e0('0xa')][_0x314309[_0xc1e0('0x1e')]][_0x315e55][_0xc1e0('0xd')]=this[_0xc1e0('0xd')][_0x314309[_0xc1e0('0x1e')]];}}}}}catch(_0x4c49ef){logger[_0xc1e0('0x2d')](_0xc1e0('0x55'),util[_0xc1e0('0x2f')](_0x4c49ef,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xc1e0('0x53')]=function(_0x3a055d,_0x51b1e5,_0x566137){var _0x180364=['rtpaudioqos','rtpaudioqosbridged',_0xc1e0('0x56'),_0xc1e0('0x57'),_0xc1e0('0x58'),_0xc1e0('0x59'),_0xc1e0('0x5a'),_0xc1e0('0x5b'),'sipcallid',_0xc1e0('0x5c'),_0xc1e0('0x5d'),_0xc1e0('0x5e'),_0xc1e0('0x5f'),_0xc1e0('0x60'),_0xc1e0('0x61'),_0xc1e0('0x62'),_0xc1e0('0x2b'),_0xc1e0('0x63'),_0xc1e0('0x64')];if(!_['isNil'](_0x51b1e5)&&!_['includes'](_0x180364,_0x51b1e5)){if(_[_0xc1e0('0x1f')](this['variables'][_0x3a055d])){this['variables'][_0x3a055d]={};}this[_0xc1e0('0xd')][_0x3a055d][_0x51b1e5]=_0x566137;}};VoiceAgentReport[_0xc1e0('0x1d')][_0xc1e0('0x18')]=function(_0x3e0ee4){try{if(this[_0xc1e0('0x1c')](_0x3e0ee4)){if(this['channels'][_0x3e0ee4[_0xc1e0('0x1e')]]){for(var _0x211369 in this[_0xc1e0('0xa')][_0x3e0ee4[_0xc1e0('0x1e')]]){if(this[_0xc1e0('0xa')][_0x3e0ee4['uniqueid']][_0xc1e0('0x30')](_0x211369)){if(this[_0xc1e0('0xa')][_0x3e0ee4[_0xc1e0('0x1e')]][_0x211369]['reason']==_0xc1e0('0x4c')&&this[_0xc1e0('0xa')][_0x3e0ee4[_0xc1e0('0x1e')]][_0x211369]['agentcomplete']){this[_0xc1e0('0xa')][_0x3e0ee4[_0xc1e0('0x1e')]][_0x211369][_0xc1e0('0x65')]=moment()['format'](_0xc1e0('0x21'));}}}ami[_0xc1e0('0x27')](_0xc1e0('0x66'),_[_0xc1e0('0x67')](this[_0xc1e0('0xa')][_0x3e0ee4['uniqueid']]));delete this[_0xc1e0('0xa')][_0x3e0ee4[_0xc1e0('0x1e')]];}if(this[_0xc1e0('0xd')][_0x3e0ee4[_0xc1e0('0x1e')]]){delete this[_0xc1e0('0xd')][_0x3e0ee4[_0xc1e0('0x1e')]];}}}catch(_0x1fec3f){logger['error'](_0xc1e0('0x68'),util[_0xc1e0('0x2f')](_0x1fec3f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc1e0('0x1d')]['syncAttendedTransfer']=function(_0x3b69e9){try{if(this[_0xc1e0('0x1c')](_0x3b69e9)){if(this[_0xc1e0('0xa')][_0x3b69e9[_0xc1e0('0x69')]]){for(var _0x13bc95 in this[_0xc1e0('0xa')][_0x3b69e9['transfereeuniqueid']]){if(this[_0xc1e0('0xa')][_0x3b69e9[_0xc1e0('0x69')]][_0xc1e0('0x30')](_0x13bc95)){if(_0x3b69e9['origtransfereruniqueid']===_0x13bc95){var _0x348936=moment();this[_0xc1e0('0xa')][_0x3b69e9[_0xc1e0('0x69')]][_0x13bc95][_0xc1e0('0x49')]=!![];this[_0xc1e0('0xa')][_0x3b69e9[_0xc1e0('0x69')]][_0x13bc95][_0xc1e0('0x65')]=moment()[_0xc1e0('0x29')](_0xc1e0('0x21'));this[_0xc1e0('0xa')][_0x3b69e9[_0xc1e0('0x69')]][_0x13bc95][_0xc1e0('0x3f')]='transfer';this[_0xc1e0('0xa')][_0x3b69e9['transfereeuniqueid']][_0x13bc95]['lastevent']=_0xc1e0('0x4a');this[_0xc1e0('0xa')][_0x3b69e9[_0xc1e0('0x69')]][_0x13bc95]['talktime']=_0x348936[_0xc1e0('0x6a')](this[_0xc1e0('0xa')][_0x3b69e9['transfereeuniqueid']][_0x13bc95][_0xc1e0('0x31')],_0xc1e0('0x6b'));}}}}if(this['channels'][_0x3b69e9[_0xc1e0('0x6c')]]){var _0x41b4a2=this[_0xc1e0('0xa')][_0x3b69e9['secondtransfereruniqueid']];this[_0xc1e0('0xa')][_0x3b69e9[_0xc1e0('0x6c')]]=this[_0xc1e0('0xa')][_0x3b69e9[_0xc1e0('0x69')]];this[_0xc1e0('0xa')][_0x3b69e9['transfereeuniqueid']]=_0x41b4a2;}}}catch(_0x15b5e1){logger[_0xc1e0('0x2d')](_0xc1e0('0x6d'),util['inspect'](_0x15b5e1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc1e0('0x1d')][_0xc1e0('0x1b')]=function(_0x111f5b){try{if(this[_0xc1e0('0x1c')](_0x111f5b)){if(this[_0xc1e0('0xa')][_0x111f5b[_0xc1e0('0x69')]]){for(var _0x1243dd in this['channels'][_0x111f5b[_0xc1e0('0x69')]]){if(this[_0xc1e0('0xa')][_0x111f5b[_0xc1e0('0x69')]]['hasOwnProperty'](_0x1243dd)){if(_0x111f5b[_0xc1e0('0x6e')]===_0x1243dd){var _0x28b85d=moment();this[_0xc1e0('0xa')][_0x111f5b[_0xc1e0('0x69')]][_0x1243dd][_0xc1e0('0x49')]=!![];this[_0xc1e0('0xa')][_0x111f5b['transfereeuniqueid']][_0x1243dd][_0xc1e0('0x65')]=_0x28b85d;this['channels'][_0x111f5b['transfereeuniqueid']][_0x1243dd][_0xc1e0('0x3f')]='transfer';this['channels'][_0x111f5b[_0xc1e0('0x69')]][_0x1243dd][_0xc1e0('0x32')]=_0xc1e0('0x4a');this['channels'][_0x111f5b['transfereeuniqueid']][_0x1243dd][_0xc1e0('0x4b')]=_0x28b85d[_0xc1e0('0x6a')](this[_0xc1e0('0xa')][_0x111f5b[_0xc1e0('0x69')]][_0x1243dd][_0xc1e0('0x31')],_0xc1e0('0x6b'));}}}}}}catch(_0x1414ab){logger[_0xc1e0('0x2d')](_0xc1e0('0x6f'),util[_0xc1e0('0x2f')](_0x1414ab,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc1e0('0x1d')][_0xc1e0('0x70')]=function(_0xa51395){var _0xb3fb8b='';try{if(this['isNotNull'](_0xa51395)){if(_0xa51395[_0xc1e0('0x71')]){_0xb3fb8b=_0xa51395[_0xc1e0('0x71')][_0xc1e0('0x72')](0x0,_0xa51395['channel'][_0xc1e0('0x73')]('-'));if(this['agents'][_0xb3fb8b]){this[_0xc1e0('0xc')][_0xb3fb8b][_0xc1e0('0x74')]=!![];}}}}catch(_0x68cff8){logger[_0xc1e0('0x2d')](_0xc1e0('0x75'),util[_0xc1e0('0x2f')](_0x68cff8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc1e0('0x1d')][_0xc1e0('0x76')]=function(_0x4cc3e1){var _0x42ed0f='';try{if(this[_0xc1e0('0x1c')](_0x4cc3e1)){if(_0x4cc3e1[_0xc1e0('0x71')]){_0x42ed0f=_0x4cc3e1[_0xc1e0('0x71')][_0xc1e0('0x72')](0x0,_0x4cc3e1[_0xc1e0('0x71')][_0xc1e0('0x73')]('-'));if(this[_0xc1e0('0xc')][_0x42ed0f]){this[_0xc1e0('0xc')][_0x42ed0f]['onhold']=![];}}}}catch(_0x2c9ae0){logger[_0xc1e0('0x2d')]('[syncMusicOnHoldStop][VoiceAgentReport]',util['inspect'](_0x2c9ae0,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0xa02b=['lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','[syncMusicOnHoldStop][VoiceAgentReport]','lodash','util','ioredis','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','channels','voiceQueues','agents','agentcalled','syncAgentCalled','bind','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncVarSet','hangup','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','uniqueid','destuniqueid','YYYY-MM-DD\x20HH:mm:ss','called','variables','queue','type','inbound','merge','omit','event','privilege','format','user:%s','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','lastevent','holdtime','connectedlinenum','connectedlinename','destchannelstate','interface','destconnectedlinenum','user:agentconnect','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheredestinationuniqueid','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','rejected','custom:agentringnoanswer','hasOwnProperty','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','syncAgentComplete','agentconnectAt','agentcompleteAt','talktime','transfer','agent','acw','agentacw','acwTimeout','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','variable','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberrealtime','includes','values','[syncHangup][VoiceAgentReport]','syncAttendedTransfer','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','complete','[syncBlindTransfer][VoiceAgentReport]','channel','substring'];(function(_0x4e6fc7,_0x6b9a5d){var _0x3c2ef6=function(_0x3907ed){while(--_0x3907ed){_0x4e6fc7['push'](_0x4e6fc7['shift']());}};_0x3c2ef6(++_0x6b9a5d);}(_0xa02b,0xf0));var _0xba02=function(_0x3f6da3,_0x3d2c49){_0x3f6da3=_0x3f6da3-0x0;var _0x290926=_0xa02b[_0x3f6da3];return _0x290926;};'use strict';var _=require(_0xba02('0x0'));var moment=require('moment');var util=require(_0xba02('0x1'));var Redis=require(_0xba02('0x2'));var config=require('../../../config/environment');var logger=require(_0xba02('0x3'))(_0xba02('0x4'));var ami=require(_0xba02('0x5'));config[_0xba02('0x6')]=_['defaults'](config['redis'],{'host':_0xba02('0x7'),'port':0x18eb});var io=require(_0xba02('0x8'))(new Redis(config[_0xba02('0x6')]));function VoiceAgentReport(_0x4bddb2){this[_0xba02('0x9')]={};this[_0xba02('0xa')]=_0x4bddb2[_0xba02('0xa')];this[_0xba02('0xb')]=_0x4bddb2[_0xba02('0xb')];this['variables']={};ami['on'](_0xba02('0xc'),this[_0xba02('0xd')][_0xba02('0xe')](this));ami['on']('agentconnect',this[_0xba02('0xf')][_0xba02('0xe')](this));ami['on'](_0xba02('0x10'),this[_0xba02('0x11')][_0xba02('0xe')](this));ami['on'](_0xba02('0x12'),this[_0xba02('0x13')][_0xba02('0xe')](this));ami['on'](_0xba02('0x14'),this['syncAgentComplete']['bind'](this));ami['on']('varset',this[_0xba02('0x15')]['bind'](this));ami['on'](_0xba02('0x16'),this['syncHangup'][_0xba02('0xe')](this));ami['on'](_0xba02('0x17'),this[_0xba02('0x18')][_0xba02('0xe')](this));ami['on']('musiconholdstop',this[_0xba02('0x19')][_0xba02('0xe')](this));ami['on'](_0xba02('0x1a'),this['syncAttendedTransfer'][_0xba02('0xe')](this));ami['on']('blindtransfer',this[_0xba02('0x1b')]['bind'](this));}VoiceAgentReport[_0xba02('0x1c')][_0xba02('0x1d')]=function(_0x55fd88,_0x4ee5a9,_0x5be4d7){io['to'](_0x55fd88)['emit'](_0x4ee5a9,_0x5be4d7);};VoiceAgentReport[_0xba02('0x1c')][_0xba02('0x1e')]=function(_0x57aef6){return _0x57aef6!==null&&!_['isUndefined'](_0x57aef6);};VoiceAgentReport[_0xba02('0x1c')][_0xba02('0xd')]=function(_0x51440e){try{if(this[_0xba02('0x1e')](_0x51440e)){if(_[_0xba02('0x1f')](this['channels'][_0x51440e[_0xba02('0x20')]])){this[_0xba02('0x9')][_0x51440e[_0xba02('0x20')]]={};}if(_[_0xba02('0x1f')](this['channels'][_0x51440e[_0xba02('0x20')]][_0x51440e[_0xba02('0x21')]])){this[_0xba02('0x9')][_0x51440e[_0xba02('0x20')]][_0x51440e['destuniqueid']]={'agentcalledAt':moment()['format'](_0xba02('0x22')),'lastevent':_0xba02('0x23'),'variables':this[_0xba02('0x24')][_0x51440e[_0xba02('0x20')]],'type':this[_0xba02('0xa')][_0x51440e[_0xba02('0x25')]]?this[_0xba02('0xa')][_0x51440e['queue']][_0xba02('0x26')]||'inbound':_0xba02('0x27')};}_[_0xba02('0x28')](this[_0xba02('0x9')][_0x51440e['uniqueid']][_0x51440e[_0xba02('0x21')]],_[_0xba02('0x29')](_0x51440e,[_0xba02('0x2a'),_0xba02('0x2b')]));ami[_0xba02('0x1d')]('custom:agentcalled',this[_0xba02('0x9')][_0x51440e['uniqueid']][_0x51440e[_0xba02('0x21')]]);this[_0xba02('0x1d')](util[_0xba02('0x2c')](_0xba02('0x2d'),_0x51440e[_0xba02('0x2e')]),_0xba02('0x2f'),this[_0xba02('0x9')][_0x51440e[_0xba02('0x20')]][_0x51440e['destuniqueid']]);}}catch(_0x583579){logger[_0xba02('0x30')](_0xba02('0x31'),util[_0xba02('0x32')](_0x583579,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xba02('0x1c')]['syncAgentConnect']=function(_0x5da4a3){try{if(this[_0xba02('0x1e')](_0x5da4a3)){if(this[_0xba02('0x9')][_0x5da4a3[_0xba02('0x20')]]){for(var _0x34aba5 in this[_0xba02('0x9')][_0x5da4a3[_0xba02('0x20')]]){if(this[_0xba02('0x9')][_0x5da4a3['uniqueid']]['hasOwnProperty'](_0x34aba5)){if(_0x5da4a3[_0xba02('0x21')]===_0x34aba5){this['channels'][_0x5da4a3['uniqueid']][_0x34aba5]['agentconnectAt']=moment()['format'](_0xba02('0x22'));this[_0xba02('0x9')][_0x5da4a3['uniqueid']][_0x34aba5][_0xba02('0x33')]='connect';this[_0xba02('0x9')][_0x5da4a3['uniqueid']][_0x34aba5][_0xba02('0x34')]=_0x5da4a3[_0xba02('0x34')];this[_0xba02('0x9')][_0x5da4a3[_0xba02('0x20')]][_0x34aba5]['connectedlinenum']=_0x5da4a3[_0xba02('0x35')];this[_0xba02('0x9')][_0x5da4a3['uniqueid']][_0x34aba5][_0xba02('0x36')]=_0x5da4a3[_0xba02('0x36')];this['channels'][_0x5da4a3[_0xba02('0x20')]][_0x34aba5][_0xba02('0x37')]=_0x5da4a3[_0xba02('0x37')];this[_0xba02('0x9')][_0x5da4a3[_0xba02('0x20')]][_0x34aba5]['destchannelstatedesc']=_0x5da4a3['destchannelstatedesc'];_[_0xba02('0x28')](this[_0xba02('0xb')][_0x5da4a3[_0xba02('0x38')]],_['pick'](_0x5da4a3,[_0xba02('0x25'),_0xba02('0x39')]));this['emit'](util[_0xba02('0x2c')]('user:%s',_0x5da4a3[_0xba02('0x2e')]),_0xba02('0x3a'),this['channels'][_0x5da4a3['uniqueid']][_0x5da4a3['destuniqueid']]);ami[_0xba02('0x1d')]('custom:agentconnect',this[_0xba02('0x9')][_0x5da4a3['uniqueid']][_0x34aba5]);}else if(!this[_0xba02('0x9')][_0x5da4a3[_0xba02('0x20')]][_0x34aba5][_0xba02('0x10')]&&!this[_0xba02('0x9')][_0x5da4a3[_0xba02('0x20')]][_0x34aba5][_0xba02('0x14')]){this['channels'][_0x5da4a3[_0xba02('0x20')]][_0x34aba5][_0xba02('0x10')]=!![];this[_0xba02('0x9')][_0x5da4a3[_0xba02('0x20')]][_0x34aba5][_0xba02('0x3b')]=moment()[_0xba02('0x2c')](_0xba02('0x22'));this['channels'][_0x5da4a3[_0xba02('0x20')]][_0x34aba5][_0xba02('0x3c')]=_0xba02('0x3d');this[_0xba02('0x9')][_0x5da4a3[_0xba02('0x20')]][_0x34aba5][_0xba02('0x33')]=_0xba02('0x3d');this['channels'][_0x5da4a3[_0xba02('0x20')]][_0x34aba5][_0xba02('0x3e')]=_0x5da4a3[_0xba02('0x21')];this[_0xba02('0x9')][_0x5da4a3['uniqueid']][_0x34aba5]['answeredelsewheremembername']=_0x5da4a3[_0xba02('0x2e')];ami[_0xba02('0x1d')](_0xba02('0x3f'),this[_0xba02('0x9')][_0x5da4a3[_0xba02('0x20')]][_0x34aba5]);}}}}}}catch(_0x3db2e8){logger[_0xba02('0x30')](_0xba02('0x40'),util[_0xba02('0x32')](_0x3db2e8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xba02('0x1c')][_0xba02('0x11')]=function(_0x568b28){try{if(this['isNotNull'](_0x568b28)){if(this[_0xba02('0x9')][_0x568b28[_0xba02('0x20')]]&&this[_0xba02('0x9')][_0x568b28[_0xba02('0x20')]][_0x568b28['destuniqueid']]){this['channels'][_0x568b28[_0xba02('0x20')]][_0x568b28[_0xba02('0x21')]][_0xba02('0x10')]=!![];this[_0xba02('0x9')][_0x568b28[_0xba02('0x20')]][_0x568b28[_0xba02('0x21')]][_0xba02('0x3b')]=moment()['format'](_0xba02('0x22'));this[_0xba02('0x9')][_0x568b28[_0xba02('0x20')]][_0x568b28[_0xba02('0x21')]][_0xba02('0x3c')]=_0xba02('0x41');this['channels'][_0x568b28[_0xba02('0x20')]][_0x568b28[_0xba02('0x21')]]['lastevent']='rejected';ami['emit'](_0xba02('0x42'),this['channels'][_0x568b28[_0xba02('0x20')]][_0x568b28['destuniqueid']]);}}}catch(_0x5f4e74){logger['error']('[syncAgentRingNoAnswer][VoiceAgentReport]',util[_0xba02('0x32')](_0x5f4e74,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncQueueCallerAbandon']=function(_0x1453f0){try{if(this['isNotNull'](_0x1453f0)){if(this[_0xba02('0x9')][_0x1453f0[_0xba02('0x20')]]){for(var _0x590270 in this[_0xba02('0x9')][_0x1453f0[_0xba02('0x20')]]){if(this[_0xba02('0x9')][_0x1453f0[_0xba02('0x20')]][_0xba02('0x43')](_0x590270)&&!this[_0xba02('0x9')][_0x1453f0[_0xba02('0x20')]][_0x590270]['agentringnoanswer']&&!this[_0xba02('0x9')][_0x1453f0[_0xba02('0x20')]][_0x590270][_0xba02('0x14')]){this[_0xba02('0x9')][_0x1453f0['uniqueid']][_0x590270][_0xba02('0x10')]=!![];this[_0xba02('0x9')][_0x1453f0['uniqueid']][_0x590270]['agentringnoanswerAt']=moment()[_0xba02('0x2c')](_0xba02('0x22'));this[_0xba02('0x9')][_0x1453f0['uniqueid']][_0x590270][_0xba02('0x3c')]=_0xba02('0x44');this[_0xba02('0x9')][_0x1453f0[_0xba02('0x20')]][_0x590270][_0xba02('0x33')]=_0xba02('0x44');ami[_0xba02('0x1d')](_0xba02('0x45'),this[_0xba02('0x9')][_0x1453f0[_0xba02('0x20')]][_0x590270]);}}}}}catch(_0x58f09f){logger[_0xba02('0x30')](_0xba02('0x46'),util['inspect'](_0x58f09f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xba02('0x1c')][_0xba02('0x47')]=function(_0x27347b){try{if(this[_0xba02('0x1e')](_0x27347b)){if(this[_0xba02('0x9')][_0x27347b[_0xba02('0x20')]]){for(var _0x287350 in this['channels'][_0x27347b[_0xba02('0x20')]]){if(this[_0xba02('0x9')][_0x27347b[_0xba02('0x20')]]['hasOwnProperty'](_0x287350)){if(this['channels'][_0x27347b[_0xba02('0x20')]][_0x287350][_0xba02('0x48')]&&!this[_0xba02('0x9')][_0x27347b[_0xba02('0x20')]][_0x287350]['agentcomplete']){this[_0xba02('0x9')][_0x27347b[_0xba02('0x20')]][_0x287350][_0xba02('0x14')]=!![];this[_0xba02('0x9')][_0x27347b[_0xba02('0x20')]][_0x287350][_0xba02('0x49')]=moment()[_0xba02('0x2c')](_0xba02('0x22'));this['channels'][_0x27347b[_0xba02('0x20')]][_0x287350][_0xba02('0x33')]='complete';this[_0xba02('0x9')][_0x27347b[_0xba02('0x20')]][_0x287350][_0xba02('0x4a')]=_0x27347b[_0xba02('0x4a')];this[_0xba02('0x9')][_0x27347b[_0xba02('0x20')]][_0x287350][_0xba02('0x3c')]=_0x27347b[_0xba02('0x3c')]==_0xba02('0x4b')?_0xba02('0x4c'):_0x27347b[_0xba02('0x3c')];if(this[_0xba02('0xa')][_0x27347b[_0xba02('0x25')]]&&this['voiceQueues'][_0x27347b['queue']][_0xba02('0x4d')]){this['channels'][_0x27347b[_0xba02('0x20')]][_0x287350][_0xba02('0x4e')]=!![];this[_0xba02('0x9')][_0x27347b['uniqueid']][_0x287350]['acwtime']=this[_0xba02('0xa')][_0x27347b[_0xba02('0x25')]][_0xba02('0x4f')];}this['agents'][_0x27347b[_0xba02('0x38')]]=_[_0xba02('0x29')](this[_0xba02('0xb')][_0x27347b['interface']],[_0xba02('0x25'),_0xba02('0x39')]);this[_0xba02('0x1d')](util['format'](_0xba02('0x2d'),_0x27347b[_0xba02('0x2e')]),_0xba02('0x50'),this[_0xba02('0x9')][_0x27347b[_0xba02('0x20')]][_0x287350]);ami[_0xba02('0x1d')](_0xba02('0x51'),this[_0xba02('0x9')][_0x27347b[_0xba02('0x20')]][_0x287350]);}}}}}}catch(_0x49d008){logger['error'](_0xba02('0x52'),util[_0xba02('0x32')](_0x49d008,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xba02('0x1c')]['syncVarSet']=function(_0x338c47){try{if(this[_0xba02('0x1e')](_0x338c47)){this[_0xba02('0x53')](_0x338c47[_0xba02('0x20')],_['keys'](_0x338c47[_0xba02('0x54')])[0x0],_0x338c47['value']);if(this[_0xba02('0x9')][_0x338c47[_0xba02('0x20')]]){for(var _0xb71f21 in this[_0xba02('0x9')][_0x338c47[_0xba02('0x20')]]){if(this[_0xba02('0x9')][_0x338c47[_0xba02('0x20')]][_0xba02('0x43')](_0xb71f21)){if(_[_0xba02('0x1f')](this['channels'][_0x338c47[_0xba02('0x20')]][_0xb71f21][_0xba02('0x24')])){this[_0xba02('0x9')][_0x338c47[_0xba02('0x20')]][_0xb71f21][_0xba02('0x24')]={};}this[_0xba02('0x9')][_0x338c47['uniqueid']][_0xb71f21][_0xba02('0x24')]=this[_0xba02('0x24')][_0x338c47[_0xba02('0x20')]];}}}}}catch(_0x5e7e1e){logger[_0xba02('0x30')](_0xba02('0x55'),util['inspect'](_0x5e7e1e,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xba02('0x53')]=function(_0x77c5f0,_0x4d7aef,_0x33791c){var _0x42595c=[_0xba02('0x56'),'rtpaudioqosbridged',_0xba02('0x57'),_0xba02('0x58'),'rtpaudioqosloss',_0xba02('0x59'),_0xba02('0x5a'),_0xba02('0x5b'),_0xba02('0x5c'),'sipuri',_0xba02('0x5d'),_0xba02('0x5e'),_0xba02('0x5f'),_0xba02('0x60'),'memberinterface',_0xba02('0x61'),'membername','memberpenalty',_0xba02('0x62')];if(!_['isNil'](_0x4d7aef)&&!_[_0xba02('0x63')](_0x42595c,_0x4d7aef)){if(_[_0xba02('0x1f')](this['variables'][_0x77c5f0])){this[_0xba02('0x24')][_0x77c5f0]={};}this[_0xba02('0x24')][_0x77c5f0][_0x4d7aef]=_0x33791c;}};VoiceAgentReport['prototype']['syncHangup']=function(_0x17c922){try{if(this[_0xba02('0x1e')](_0x17c922)){if(this['channels'][_0x17c922['uniqueid']]){for(var _0x723e84 in this[_0xba02('0x9')][_0x17c922[_0xba02('0x20')]]){if(this[_0xba02('0x9')][_0x17c922[_0xba02('0x20')]][_0xba02('0x43')](_0x723e84)){if(this['channels'][_0x17c922[_0xba02('0x20')]][_0x723e84][_0xba02('0x3c')]==_0xba02('0x4b')&&this['channels'][_0x17c922[_0xba02('0x20')]][_0x723e84]['agentcomplete']){this[_0xba02('0x9')][_0x17c922[_0xba02('0x20')]][_0x723e84]['agentcompleteAt']=moment()[_0xba02('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');}}}ami['emit']('custom:voiceAgentReport',_[_0xba02('0x64')](this[_0xba02('0x9')][_0x17c922[_0xba02('0x20')]]));delete this[_0xba02('0x9')][_0x17c922[_0xba02('0x20')]];}if(this[_0xba02('0x24')][_0x17c922['uniqueid']]){delete this[_0xba02('0x24')][_0x17c922[_0xba02('0x20')]];}}}catch(_0x457f81){logger[_0xba02('0x30')](_0xba02('0x65'),util[_0xba02('0x32')](_0x457f81,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xba02('0x1c')][_0xba02('0x66')]=function(_0x2e5f4e){try{if(this[_0xba02('0x1e')](_0x2e5f4e)){if(this[_0xba02('0x9')][_0x2e5f4e[_0xba02('0x67')]]){for(var _0x25298d in this['channels'][_0x2e5f4e[_0xba02('0x67')]]){if(this[_0xba02('0x9')][_0x2e5f4e[_0xba02('0x67')]]['hasOwnProperty'](_0x25298d)){if(_0x2e5f4e[_0xba02('0x68')]===_0x25298d){var _0x14b037=moment();this['channels'][_0x2e5f4e[_0xba02('0x67')]][_0x25298d][_0xba02('0x14')]=!![];this[_0xba02('0x9')][_0x2e5f4e['transfereeuniqueid']][_0x25298d][_0xba02('0x49')]=moment()[_0xba02('0x2c')](_0xba02('0x22'));this[_0xba02('0x9')][_0x2e5f4e[_0xba02('0x67')]][_0x25298d][_0xba02('0x3c')]=_0xba02('0x4b');this['channels'][_0x2e5f4e[_0xba02('0x67')]][_0x25298d][_0xba02('0x33')]='complete';this[_0xba02('0x9')][_0x2e5f4e[_0xba02('0x67')]][_0x25298d][_0xba02('0x4a')]=_0x14b037[_0xba02('0x69')](this['channels'][_0x2e5f4e[_0xba02('0x67')]][_0x25298d][_0xba02('0x48')],_0xba02('0x6a'));}}}}if(this[_0xba02('0x9')][_0x2e5f4e['secondtransfereruniqueid']]){var _0x5689b4=this[_0xba02('0x9')][_0x2e5f4e['secondtransfereruniqueid']];this[_0xba02('0x9')][_0x2e5f4e[_0xba02('0x6b')]]=this[_0xba02('0x9')][_0x2e5f4e[_0xba02('0x67')]];this[_0xba02('0x9')][_0x2e5f4e[_0xba02('0x67')]]=_0x5689b4;}}}catch(_0x49744c){logger[_0xba02('0x30')](_0xba02('0x6c'),util[_0xba02('0x32')](_0x49744c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xba02('0x1c')][_0xba02('0x1b')]=function(_0x6a3de3){try{if(this['isNotNull'](_0x6a3de3)){if(this['channels'][_0x6a3de3[_0xba02('0x67')]]){for(var _0x3b5933 in this[_0xba02('0x9')][_0x6a3de3[_0xba02('0x67')]]){if(this[_0xba02('0x9')][_0x6a3de3['transfereeuniqueid']]['hasOwnProperty'](_0x3b5933)){if(_0x6a3de3[_0xba02('0x6d')]===_0x3b5933){var _0x3c8cc6=moment();this[_0xba02('0x9')][_0x6a3de3['transfereeuniqueid']][_0x3b5933][_0xba02('0x14')]=!![];this[_0xba02('0x9')][_0x6a3de3[_0xba02('0x67')]][_0x3b5933][_0xba02('0x49')]=_0x3c8cc6;this['channels'][_0x6a3de3['transfereeuniqueid']][_0x3b5933]['reason']=_0xba02('0x4b');this[_0xba02('0x9')][_0x6a3de3[_0xba02('0x67')]][_0x3b5933][_0xba02('0x33')]=_0xba02('0x6e');this['channels'][_0x6a3de3[_0xba02('0x67')]][_0x3b5933][_0xba02('0x4a')]=_0x3c8cc6[_0xba02('0x69')](this[_0xba02('0x9')][_0x6a3de3[_0xba02('0x67')]][_0x3b5933][_0xba02('0x48')],_0xba02('0x6a'));}}}}}}catch(_0x5681e5){logger['error'](_0xba02('0x6f'),util[_0xba02('0x32')](_0x5681e5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xba02('0x1c')][_0xba02('0x18')]=function(_0x19dcfe){var _0x10dc91='';try{if(this[_0xba02('0x1e')](_0x19dcfe)){if(_0x19dcfe[_0xba02('0x70')]){_0x10dc91=_0x19dcfe['channel'][_0xba02('0x71')](0x0,_0x19dcfe[_0xba02('0x70')][_0xba02('0x72')]('-'));if(this['agents'][_0x10dc91]){this[_0xba02('0xb')][_0x10dc91][_0xba02('0x73')]=!![];}}}}catch(_0x2e331a){logger['error'](_0xba02('0x74'),util[_0xba02('0x32')](_0x2e331a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xba02('0x1c')][_0xba02('0x19')]=function(_0x543d12){var _0x590055='';try{if(this[_0xba02('0x1e')](_0x543d12)){if(_0x543d12[_0xba02('0x70')]){_0x590055=_0x543d12['channel'][_0xba02('0x71')](0x0,_0x543d12['channel'][_0xba02('0x72')]('-'));if(this[_0xba02('0xb')][_0x590055]){this[_0xba02('0xb')][_0x590055][_0xba02('0x73')]=![];}}}}catch(_0x574a3b){logger[_0xba02('0x30')](_0xba02('0x75'),util[_0xba02('0x32')](_0x574a3b,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 3374f49..c867ce1 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 _0x74a6=['catch','log','prototype','isNotNull','isUndefined','linkedid','uniqueid','merge','pick','error','inspect','channel','OutgoingSpoolFailed','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','keys','context','from-sip','split','emit','user:%s','user:agentconnect','accountcode','exten','[syncNewChannel][VoiceCallReport]','application','toLowerCase','applicationdata','appdata','duration','subtract','seconds','includes','startsWith','[syncNewExten][VoiceCallReport]','answered','answertime','starttime','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinenum','calleridname','destinationchannel','UserId','membername','name','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','.wav49','.WAV','monitorFilename','find','isNil','monitors','variable','mixmonitor_filename','callerid','value','xmd-cdrtype','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid','parse','[syncVarSet][VoiceCallReport]','billableseconds','omit','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfereeuniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','mohstarttime','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','bluebird','lodash','moment','path','ioredis','../../../config/environment','ami','../ami','../model/channel','unknown','not_inuse','inuse','busy','invalid','ringing','onhold','set','queue','agi','dial','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','redis','localhost','channels','agents','coreshowchannel','syncNewExten','newexten','bind','newchannel','syncNewChannel','newstate','syncNewState','syncVarSet','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels'];(function(_0x43b5a4,_0x432795){var _0x48136c=function(_0x3adf67){while(--_0x3adf67){_0x43b5a4['push'](_0x43b5a4['shift']());}};_0x48136c(++_0x432795);}(_0x74a6,0xfc));var _0x674a=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x74a6[_0x8de54f];return _0x14cba4;};'use strict';var BPromise=require(_0x674a('0x0'));var _=require(_0x674a('0x1'));var moment=require(_0x674a('0x2'));var util=require('util');var path=require(_0x674a('0x3'));var Redis=require(_0x674a('0x4'));var config=require(_0x674a('0x5'));var logger=require('../../../config/logger')(_0x674a('0x6'));var ami=require(_0x674a('0x7'));var Channel=require(_0x674a('0x8'));var statusDesc=[_0x674a('0x9'),_0x674a('0xa'),_0x674a('0xb'),_0x674a('0xc'),_0x674a('0xd'),'unavailable',_0x674a('0xe'),'ringinuse',_0x674a('0xf')];var applications=[_0x674a('0x10'),_0x674a('0x11'),_0x674a('0x12'),_0x674a('0x13'),_0x674a('0x14'),_0x674a('0x15')];var dispositions=['NO\x20ANSWER',_0x674a('0x16'),_0x674a('0x16'),'NO\x20ANSWER',_0x674a('0x17'),_0x674a('0x17'),_0x674a('0x18'),'BUSY','FAILED',_0x674a('0x16'),_0x674a('0x16')];var actions={};config[_0x674a('0x19')]=_['defaults'](config['redis'],{'host':_0x674a('0x1a'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceCallReport(_0x51786c){this['channels']=_0x51786c[_0x674a('0x1b')];this[_0x674a('0x1c')]=_0x51786c[_0x674a('0x1c')];ami['on'](_0x674a('0x1d'),this[_0x674a('0x1e')]['bind'](this));ami['on'](_0x674a('0x1f'),this[_0x674a('0x1e')][_0x674a('0x20')](this));ami['on'](_0x674a('0x21'),this[_0x674a('0x22')][_0x674a('0x20')](this));ami['on'](_0x674a('0x23'),this[_0x674a('0x24')][_0x674a('0x20')](this));ami['on']('varset',this[_0x674a('0x25')][_0x674a('0x20')](this));ami['on']('hangup',this[_0x674a('0x26')][_0x674a('0x20')](this));ami['on'](_0x674a('0x27'),this[_0x674a('0x28')][_0x674a('0x20')](this));ami['on'](_0x674a('0x29'),this[_0x674a('0x2a')][_0x674a('0x20')](this));ami['on']('blindtransfer',this[_0x674a('0x2b')]['bind'](this));ami['on'](_0x674a('0x2c'),this[_0x674a('0x2d')]['bind'](this));ami['on']('musiconholdstop',this[_0x674a('0x2e')]['bind'](this));return BPromise[_0x674a('0x2f')]()[_0x674a('0x30')](ami[_0x674a('0x31')]())[_0x674a('0x32')](function(_0x5ea6f2){console[_0x674a('0x33')](_0x5ea6f2);});}VoiceCallReport[_0x674a('0x34')][_0x674a('0x35')]=function(_0x2a8990){return _0x2a8990!==null&&!_[_0x674a('0x36')](_0x2a8990);};VoiceCallReport[_0x674a('0x34')]['emit']=function(_0x5361b9,_0x214ce8,_0x3089af){io['to'](_0x5361b9)['emit'](_0x214ce8,_0x3089af);};VoiceCallReport[_0x674a('0x34')]['syncNewCallerId']=function(_0x2e28ef){try{if(this[_0x674a('0x35')](_0x2e28ef)){if(_0x2e28ef['uniqueid']===_0x2e28ef[_0x674a('0x37')]){if(!_[_0x674a('0x36')](this['channels'][_0x2e28ef[_0x674a('0x38')]])){_[_0x674a('0x39')](this[_0x674a('0x1b')][_0x2e28ef['uniqueid']],_[_0x674a('0x3a')](_0x2e28ef,_['keys'](this[_0x674a('0x1b')][_0x2e28ef[_0x674a('0x38')]])));}}}}catch(_0x211c37){logger[_0x674a('0x3b')]('[syncNewCallerId][VoiceCallReport]',util[_0x674a('0x3c')](_0x211c37,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewChannel']=function(_0x5045e7){try{if(this[_0x674a('0x35')](_0x5045e7)){if(_0x5045e7[_0x674a('0x38')]===_0x5045e7[_0x674a('0x37')]&&_0x5045e7[_0x674a('0x3d')]!=_0x674a('0x3e')){if(_[_0x674a('0x36')](this[_0x674a('0x1b')][_0x5045e7[_0x674a('0x38')]])){this['channels'][_0x5045e7[_0x674a('0x38')]]=new Channel();this[_0x674a('0x1b')][_0x5045e7[_0x674a('0x38')]]['starttime']=moment()[_0x674a('0x3f')](_0x674a('0x40'));this[_0x674a('0x1b')][_0x5045e7[_0x674a('0x38')]][_0x674a('0x41')]=dispositions[_[_0x674a('0x42')](_0x5045e7[_0x674a('0x43')])];_[_0x674a('0x39')](this[_0x674a('0x1b')][_0x5045e7[_0x674a('0x38')]],_[_0x674a('0x3a')](_0x5045e7,_[_0x674a('0x44')](this['channels'][_0x5045e7[_0x674a('0x38')]])));if(_0x5045e7[_0x674a('0x45')]===_0x674a('0x46')){if(this[_0x674a('0x1c')][_0x5045e7[_0x674a('0x3d')][_0x674a('0x47')]('-')[0x0]]){this[_0x674a('0x1c')][_0x5045e7[_0x674a('0x3d')][_0x674a('0x47')]('-')[0x0]]['destconnectedlinenum']=_0x5045e7['exten'];this[_0x674a('0x48')](util[_0x674a('0x3f')](_0x674a('0x49'),this['agents'][_0x5045e7[_0x674a('0x3d')][_0x674a('0x47')]('-')[0x0]]['name']),_0x674a('0x4a'),{'destaccountcode':this[_0x674a('0x1c')][_0x5045e7[_0x674a('0x3d')]['split']('-')[0x0]][_0x674a('0x4b')],'destconnectedlinenum':_0x5045e7[_0x674a('0x4c')]});}}}}}}catch(_0x1f7e2c){logger['error'](_0x674a('0x4d'),util[_0x674a('0x3c')](_0x1f7e2c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x674a('0x1e')]=function(_0x4b35cd){try{if(this['isNotNull'](_0x4b35cd)){if(_0x4b35cd[_0x674a('0x38')]===_0x4b35cd['linkedid']&&_0x4b35cd[_0x674a('0x4c')]!='h'&&_0x4b35cd[_0x674a('0x3d')]!=_0x674a('0x3e')){_0x4b35cd[_0x674a('0x4e')]=_0x4b35cd[_0x674a('0x4e')][_0x674a('0x4f')]();_0x4b35cd[_0x674a('0x50')]=(_0x4b35cd[_0x674a('0x51')]||_0x4b35cd[_0x674a('0x50')])[_0x674a('0x4f')]();if(_[_0x674a('0x36')](this[_0x674a('0x1b')][_0x4b35cd[_0x674a('0x38')]])){this['channels'][_0x4b35cd[_0x674a('0x38')]]=new Channel();this[_0x674a('0x1b')][_0x4b35cd[_0x674a('0x38')]]['starttime']=_0x4b35cd[_0x674a('0x52')]?moment()[_0x674a('0x53')](moment[_0x674a('0x52')](_0x4b35cd[_0x674a('0x52')])[_0x674a('0x54')](),_0x674a('0x54'))[_0x674a('0x3f')](_0x674a('0x40')):moment()['format'](_0x674a('0x40'));this['channels'][_0x4b35cd[_0x674a('0x38')]]['disposition']=_0x674a('0x17');}_[_0x674a('0x39')](this[_0x674a('0x1b')][_0x4b35cd[_0x674a('0x38')]],_[_0x674a('0x3a')](_0x4b35cd,_['keys'](this[_0x674a('0x1b')][_0x4b35cd['uniqueid']])));if(_[_0x674a('0x55')](applications,_0x4b35cd['application'])){this[_0x674a('0x1b')][_0x4b35cd[_0x674a('0x38')]]['lastapplication']=_0x4b35cd['application'];this['channels'][_0x4b35cd[_0x674a('0x38')]]['lastdata']=_0x4b35cd['applicationdata'];if(_0x4b35cd[_0x674a('0x4e')]==='set'&&_[_0x674a('0x56')](_0x4b35cd[_0x674a('0x50')],'cdr(')){var _0xd3c146=_0x4b35cd['applicationdata']['split']('=');var _0x383f8d=_0xd3c146[0x0]['match'](/cdr\((.*)\)/);if(_0x383f8d){this[_0x674a('0x1b')][_0x4b35cd[_0x674a('0x38')]][_0x383f8d[0x1]]=_0xd3c146[0x1];}}else if(_0x4b35cd[_0x674a('0x4e')]==='queue'){this['channels'][_0x4b35cd[_0x674a('0x38')]]['queue']=_0x4b35cd['applicationdata'][_0x674a('0x47')](',')[0x0];}}}}}catch(_0x5d66de){logger[_0x674a('0x3b')](_0x674a('0x57'),util[_0x674a('0x3c')](_0x5d66de,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x674a('0x34')][_0x674a('0x24')]=function(_0x1a55e3){try{if(this[_0x674a('0x35')](_0x1a55e3)){if(_0x1a55e3[_0x674a('0x38')]!==_0x1a55e3['linkedid']){if(this[_0x674a('0x1b')][_0x1a55e3[_0x674a('0x37')]]){if(_0x1a55e3[_0x674a('0x43')]==='6'){if(!this['channels'][_0x1a55e3[_0x674a('0x37')]]['answered']){var _0x31e634=moment();this[_0x674a('0x1b')][_0x1a55e3[_0x674a('0x37')]][_0x674a('0x58')]=!![];this[_0x674a('0x1b')][_0x1a55e3[_0x674a('0x37')]][_0x674a('0x59')]=_0x31e634[_0x674a('0x3f')](_0x674a('0x40'));if(this[_0x674a('0x1b')][_0x1a55e3[_0x674a('0x37')]][_0x674a('0x5a')]){this['channels'][_0x1a55e3['linkedid']][_0x674a('0x5b')]=_0x31e634[_0x674a('0x5c')](this[_0x674a('0x1b')][_0x1a55e3['linkedid']][_0x674a('0x5a')],_0x674a('0x54'));}}this[_0x674a('0x1b')][_0x1a55e3[_0x674a('0x37')]][_0x674a('0x37')]=_0x1a55e3[_0x674a('0x38')];if(_0x1a55e3[_0x674a('0x5d')]!==_0x674a('0x5e')){this[_0x674a('0x1b')][_0x1a55e3[_0x674a('0x37')]][_0x674a('0x5f')]=_0x1a55e3[_0x674a('0x5d')];}this['channels'][_0x1a55e3['linkedid']]['connectedlinename']=_0x1a55e3[_0x674a('0x60')];this[_0x674a('0x1b')][_0x1a55e3['linkedid']][_0x674a('0x61')]=_0x1a55e3['channel'];this['channels'][_0x1a55e3[_0x674a('0x37')]][_0x674a('0x41')]=dispositions[_[_0x674a('0x42')](_0x1a55e3['channelstate'])];if(this['agents'][_0x1a55e3[_0x674a('0x3d')][_0x674a('0x47')]('-')[0x0]]){this[_0x674a('0x1b')][_0x1a55e3[_0x674a('0x37')]][_0x674a('0x62')]=this[_0x674a('0x1c')][_0x1a55e3[_0x674a('0x3d')][_0x674a('0x47')]('-')[0x0]]['id'];this['channels'][_0x1a55e3[_0x674a('0x37')]][_0x674a('0x63')]=this[_0x674a('0x1c')][_0x1a55e3[_0x674a('0x3d')][_0x674a('0x47')]('-')[0x0]][_0x674a('0x64')];}}}}else{if(this[_0x674a('0x1b')][_0x1a55e3[_0x674a('0x38')]]){if(_0x1a55e3[_0x674a('0x43')]==='6'){if(this['agents'][_0x1a55e3[_0x674a('0x3d')][_0x674a('0x47')]('-')[0x0]]){this[_0x674a('0x1b')][_0x1a55e3[_0x674a('0x38')]][_0x674a('0x62')]=this[_0x674a('0x1c')][_0x1a55e3[_0x674a('0x3d')][_0x674a('0x47')]('-')[0x0]]['id'];this[_0x674a('0x1b')][_0x1a55e3[_0x674a('0x38')]][_0x674a('0x63')]=this[_0x674a('0x1c')][_0x1a55e3[_0x674a('0x3d')][_0x674a('0x47')]('-')[0x0]][_0x674a('0x64')];}}}}}}catch(_0x3e26ef){logger['error'](_0x674a('0x65'),util[_0x674a('0x3c')](_0x3e26ef,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x674a('0x34')][_0x674a('0x66')]=function(_0x2ed7e9,_0x29e5f5){if(this[_0x674a('0x1b')][_0x2ed7e9]){this[_0x674a('0x1b')][_0x2ed7e9][_0x674a('0x67')]=!![];if(_[_0x674a('0x68')](_0x29e5f5,_0x674a('0x69'))){_0x29e5f5=_0x29e5f5['replace'](_0x674a('0x69'),_0x674a('0x6a'));}this['channels'][_0x2ed7e9][_0x674a('0x6b')]=_0x29e5f5;var _0x590394=_[_0x674a('0x6c')](this[_0x674a('0x1b')][_0x2ed7e9]['monitors'],{'filename':_0x29e5f5});if(_[_0x674a('0x6d')](_0x590394)){this['channels'][_0x2ed7e9][_0x674a('0x6e')]['push']({'filename':_0x29e5f5,'createdAt':moment()[_0x674a('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':'rec'});}}};VoiceCallReport[_0x674a('0x34')][_0x674a('0x25')]=function(_0x54ec67){try{if(this[_0x674a('0x35')](_0x54ec67)){if(this['channels'][_0x54ec67[_0x674a('0x38')]]&&_0x54ec67[_0x674a('0x3d')]!=_0x674a('0x3e')){if(this[_0x674a('0x35')](_0x54ec67[_0x674a('0x6f')])){if(this[_0x674a('0x35')](_0x54ec67[_0x674a('0x6f')][_0x674a('0x70')])){this['syncMixMonitorFilename'](_0x54ec67[_0x674a('0x38')],_0x54ec67['value']);}else if(this[_0x674a('0x35')](_0x54ec67[_0x674a('0x6f')]['xmd-phone'])){this[_0x674a('0x1b')][_0x54ec67[_0x674a('0x38')]][_0x674a('0x5d')]=_0x54ec67['value'];}else if(this[_0x674a('0x35')](_0x54ec67[_0x674a('0x6f')]['xmd-callerid'])){this[_0x674a('0x1b')][_0x54ec67[_0x674a('0x38')]][_0x674a('0x71')]=_0x54ec67[_0x674a('0x72')];}else if(this[_0x674a('0x35')](_0x54ec67[_0x674a('0x6f')][_0x674a('0x73')])){this[_0x674a('0x1b')][_0x54ec67['uniqueid']]['type']=_0x54ec67['value'];}else if(this[_0x674a('0x35')](_0x54ec67[_0x674a('0x6f')][_0x674a('0x74')])){this['channels'][_0x54ec67[_0x674a('0x38')]][_0x674a('0x11')]=_0x54ec67[_0x674a('0x72')][_0x674a('0x47')](',')[0x0];}else if(this[_0x674a('0x35')](_0x54ec67[_0x674a('0x6f')][_0x674a('0x75')])){this[_0x674a('0x1b')][_0x54ec67[_0x674a('0x38')]][_0x674a('0x76')]=_0x54ec67['value'];}else if(this['isNotNull'](_0x54ec67['variable'][_0x674a('0x77')])){this['channels'][_0x54ec67[_0x674a('0x38')]]['destination']=_0x54ec67[_0x674a('0x72')];}else if(this[_0x674a('0x35')](_0x54ec67[_0x674a('0x6f')][_0x674a('0x78')])){this['channels'][_0x54ec67[_0x674a('0x38')]][_0x674a('0x79')]=_0x54ec67[_0x674a('0x72')];}else if(this[_0x674a('0x35')](_0x54ec67[_0x674a('0x6f')][_0x674a('0x7a')])){this[_0x674a('0x1b')][_0x54ec67[_0x674a('0x38')]][_0x674a('0x11')]=_0x54ec67[_0x674a('0x72')];}else if(this['isNotNull'](_0x54ec67[_0x674a('0x6f')][_0x674a('0x7b')])){this[_0x674a('0x1b')][_0x54ec67['uniqueid']][_0x674a('0x7c')]=_0x54ec67[_0x674a('0x72')];}}}else if(this[_0x674a('0x35')](_0x54ec67[_0x674a('0x6f')][_0x674a('0x70')])){if(_0x54ec67[_0x674a('0x72')]){var _0x440c08=path[_0x674a('0x7d')](_0x54ec67['value'])[_0x674a('0x64')];this[_0x674a('0x66')](_0x440c08,_0x54ec67[_0x674a('0x72')]);}}else if(this['channels'][_0x54ec67[_0x674a('0x37')]]){if(this[_0x674a('0x35')](_0x54ec67[_0x674a('0x6f')])){if(this[_0x674a('0x35')](_0x54ec67[_0x674a('0x6f')][_0x674a('0x7b')])){this[_0x674a('0x1b')][_0x54ec67[_0x674a('0x37')]]['sipcalllinkedid']=_0x54ec67[_0x674a('0x72')];}}}}}catch(_0x2a2f9d){logger[_0x674a('0x3b')](_0x674a('0x7e'),util[_0x674a('0x3c')](_0x2a2f9d,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x674a('0x26')]=function(_0x522d0d){try{if(this[_0x674a('0x35')](_0x522d0d)){if(this[_0x674a('0x1b')][_0x522d0d[_0x674a('0x38')]]){var _0x5c0863=moment();this[_0x674a('0x1b')][_0x522d0d['uniqueid']]['endtime']=_0x5c0863[_0x674a('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x674a('0x1b')][_0x522d0d[_0x674a('0x38')]][_0x674a('0x52')]=_0x5c0863['diff'](this[_0x674a('0x1b')][_0x522d0d[_0x674a('0x38')]][_0x674a('0x5a')],_0x674a('0x54'));if(this['channels'][_0x522d0d[_0x674a('0x38')]]['answered']){this['channels'][_0x522d0d[_0x674a('0x38')]][_0x674a('0x7f')]=_0x5c0863['diff'](this['channels'][_0x522d0d['uniqueid']]['answertime'],_0x674a('0x54'));this[_0x674a('0x1b')][_0x522d0d[_0x674a('0x38')]][_0x674a('0x5b')]=this['channels'][_0x522d0d[_0x674a('0x38')]][_0x674a('0x52')]-this[_0x674a('0x1b')][_0x522d0d[_0x674a('0x38')]][_0x674a('0x7f')];}if(_0x522d0d['context']==='from-sip'){if(this[_0x674a('0x1c')][_0x522d0d[_0x674a('0x3d')][_0x674a('0x47')]('-')[0x0]]){this[_0x674a('0x1c')][_0x522d0d[_0x674a('0x3d')]['split']('-')[0x0]]=_[_0x674a('0x80')](this[_0x674a('0x1c')][_0x522d0d[_0x674a('0x3d')][_0x674a('0x47')]('-')[0x0]],['destconnectedlinenum']);this[_0x674a('0x48')](util['format'](_0x674a('0x49'),this[_0x674a('0x1c')][_0x522d0d[_0x674a('0x3d')][_0x674a('0x47')]('-')[0x0]][_0x674a('0x64')]),_0x674a('0x81'),{'destaccountcode':this[_0x674a('0x1c')][_0x522d0d['channel'][_0x674a('0x47')]('-')[0x0]][_0x674a('0x4b')]});}}ami[_0x674a('0x48')](_0x674a('0x82'),this[_0x674a('0x1b')][_0x522d0d['uniqueid']]);delete this[_0x674a('0x1b')][_0x522d0d[_0x674a('0x38')]];}}}catch(_0x1280d3){logger[_0x674a('0x3b')](_0x674a('0x83'),util[_0x674a('0x3c')](_0x1280d3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x674a('0x34')][_0x674a('0x2a')]=function(_0x2a0076){try{if(this[_0x674a('0x35')](_0x2a0076)){if(this['channels'][_0x2a0076['transfereeuniqueid']]){this[_0x674a('0x1b')][_0x2a0076['transfereeuniqueid']][_0x674a('0x84')]=_0x2a0076[_0x674a('0x85')];this[_0x674a('0x1b')][_0x2a0076['transfereeuniqueid']][_0x674a('0x86')]=_0x2a0076[_0x674a('0x87')];if(this[_0x674a('0x1b')][_0x2a0076[_0x674a('0x88')]]){var _0x4dc53a=this[_0x674a('0x1b')][_0x2a0076[_0x674a('0x88')]];this[_0x674a('0x1b')][_0x2a0076[_0x674a('0x88')]]=this['channels'][_0x2a0076[_0x674a('0x89')]];this['channels'][_0x2a0076[_0x674a('0x89')]]=_0x4dc53a;}}else if(this[_0x674a('0x1b')][_0x2a0076[_0x674a('0x8a')]]){this[_0x674a('0x1b')][_0x2a0076[_0x674a('0x8a')]]['transfercalleridnum']=_0x2a0076['origtransferercalleridnum'];this[_0x674a('0x1b')][_0x2a0076[_0x674a('0x8a')]][_0x674a('0x86')]=_0x2a0076['transfertargetcalleridnum'];if(this[_0x674a('0x1b')][_0x2a0076[_0x674a('0x8b')]]){var _0x4dc53a=this[_0x674a('0x1b')][_0x2a0076[_0x674a('0x8b')]];this[_0x674a('0x1b')][_0x2a0076[_0x674a('0x8b')]]=this['channels'][_0x2a0076[_0x674a('0x8a')]];this[_0x674a('0x1b')][_0x2a0076['transfertargetuniqueid']]=_0x4dc53a;}}}}catch(_0x16cd92){logger[_0x674a('0x3b')](_0x674a('0x8c'),util[_0x674a('0x3c')](_0x16cd92,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x674a('0x34')][_0x674a('0x2b')]=function(_0x3f2aeb){try{if(this[_0x674a('0x35')](_0x3f2aeb)){if(this[_0x674a('0x1b')][_0x3f2aeb[_0x674a('0x89')]]){this[_0x674a('0x1b')][_0x3f2aeb[_0x674a('0x89')]]['transfercalleridnum']=_0x3f2aeb[_0x674a('0x8d')];this[_0x674a('0x1b')][_0x3f2aeb[_0x674a('0x89')]][_0x674a('0x86')]=_0x3f2aeb[_0x674a('0x8e')];this[_0x674a('0x26')]({'event':_0x674a('0x8f'),'uniqueid':_0x3f2aeb[_0x674a('0x89')],'context':_0x3f2aeb['context'],'channel':_0x3f2aeb[_0x674a('0x90')]});}}}catch(_0x46bf22){logger[_0x674a('0x3b')](_0x674a('0x91'),util[_0x674a('0x3c')](_0x46bf22,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x674a('0x34')][_0x674a('0x2d')]=function(_0x32029b){try{if(this['isNotNull'](_0x32029b)){if(this['channels'][_0x32029b[_0x674a('0x38')]]){if(!_[_0x674a('0x6d')](this[_0x674a('0x1b')][_0x32029b[_0x674a('0x38')]][_0x674a('0x59')])){this[_0x674a('0x1b')][_0x32029b[_0x674a('0x38')]][_0x674a('0x92')]=moment()[_0x674a('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');}}}}catch(_0x55bf7e){logger['error']('[syncMusicOnHoldStart][VoiceCallReport]',util[_0x674a('0x3c')](_0x55bf7e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x674a('0x34')]['syncMusicOnHoldStop']=function(_0x5b5b3f){try{if(this['isNotNull'](_0x5b5b3f)){if(this[_0x674a('0x1b')][_0x5b5b3f[_0x674a('0x38')]]){if(!_[_0x674a('0x6d')](this[_0x674a('0x1b')][_0x5b5b3f[_0x674a('0x38')]][_0x674a('0x92')])){this[_0x674a('0x1b')][_0x5b5b3f[_0x674a('0x38')]][_0x674a('0x93')]+=moment()[_0x674a('0x94')](0x0)[_0x674a('0x5c')](this[_0x674a('0x1b')][_0x5b5b3f[_0x674a('0x38')]]['mohstarttime'],_0x674a('0x54'));delete this[_0x674a('0x1b')][_0x5b5b3f[_0x674a('0x38')]][_0x674a('0x92')];}}}}catch(_0x1d5c4a){logger[_0x674a('0x3b')](_0x674a('0x95'),util[_0x674a('0x3c')](_0x1d5c4a,{'showHidden':![],'depth':null}));}};module[_0x674a('0x96')]=VoiceCallReport; \ No newline at end of file +var _0x0bb9=['rec','syncVarSet','variable','mixmonitor_filename','value','xmd-phone','xmd-callerid','callerid','type','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','destination','calleridpreview','xmcs-queue','sipcalluniqueid','parse','sipcallid','sipcalllinkedid','[syncVarSet][VoiceCallReport]','syncHangup','diff','billableseconds','holdtime','omit','user:%s','user:agentcomplete','custom:voiceCallReport','syncAttendedTransfer','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransferercalleridnum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','transfererchannel','[syncBlindTransfer][VoiceCallReport]','isNil','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','bluebird','util','path','ioredis','../../../config/logger','ami','../ami','inuse','invalid','ringing','ringinuse','onhold','set','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newchannel','newstate','syncNewState','varset','hangup','newcallerid','attendedtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','then','actionCoreShowChannels','catch','log','prototype','isNotNull','emit','syncNewCallerId','linkedid','isUndefined','uniqueid','merge','keys','error','[syncNewCallerId][VoiceCallReport]','syncNewChannel','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','channelstate','context','channel','split','destconnectedlinenum','exten','name','user:agentconnect','accountcode','toLowerCase','applicationdata','duration','subtract','seconds','includes','lastapplication','application','cdr(','match','queue','[syncNewExten][VoiceCallReport]','inspect','answered','answertime','calleridnum','xcally-motion-preview','connectedlinename','destinationchannel','disposition','toNumber','UserId','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','push'];(function(_0x5b24be,_0xfdf23f){var _0x5b2bb8=function(_0x7f301e){while(--_0x7f301e){_0x5b24be['push'](_0x5b24be['shift']());}};_0x5b2bb8(++_0xfdf23f);}(_0x0bb9,0xca));var _0x90bb=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x0bb9[_0x16d10f];return _0x50c823;};'use strict';var BPromise=require(_0x90bb('0x0'));var _=require('lodash');var moment=require('moment');var util=require(_0x90bb('0x1'));var path=require(_0x90bb('0x2'));var Redis=require(_0x90bb('0x3'));var config=require('../../../config/environment');var logger=require(_0x90bb('0x4'))(_0x90bb('0x5'));var ami=require(_0x90bb('0x6'));var Channel=require('../model/channel');var statusDesc=['unknown','not_inuse',_0x90bb('0x7'),'busy',_0x90bb('0x8'),'unavailable',_0x90bb('0x9'),_0x90bb('0xa'),_0x90bb('0xb')];var applications=[_0x90bb('0xc'),'queue',_0x90bb('0xd'),_0x90bb('0xe'),_0x90bb('0xf'),_0x90bb('0x10')];var dispositions=[_0x90bb('0x11'),_0x90bb('0x12'),'FAILED',_0x90bb('0x11'),_0x90bb('0x11'),_0x90bb('0x11'),_0x90bb('0x13'),_0x90bb('0x14'),_0x90bb('0x12'),_0x90bb('0x12'),'FAILED'];var actions={};config[_0x90bb('0x15')]=_[_0x90bb('0x16')](config[_0x90bb('0x15')],{'host':_0x90bb('0x17'),'port':0x18eb});var io=require(_0x90bb('0x18'))(new Redis(config['redis']));function VoiceCallReport(_0x2067f8){this[_0x90bb('0x19')]=_0x2067f8[_0x90bb('0x19')];this[_0x90bb('0x1a')]=_0x2067f8[_0x90bb('0x1a')];ami['on'](_0x90bb('0x1b'),this[_0x90bb('0x1c')][_0x90bb('0x1d')](this));ami['on']('newexten',this[_0x90bb('0x1c')][_0x90bb('0x1d')](this));ami['on'](_0x90bb('0x1e'),this['syncNewChannel'][_0x90bb('0x1d')](this));ami['on'](_0x90bb('0x1f'),this[_0x90bb('0x20')][_0x90bb('0x1d')](this));ami['on'](_0x90bb('0x21'),this['syncVarSet'][_0x90bb('0x1d')](this));ami['on'](_0x90bb('0x22'),this['syncHangup']['bind'](this));ami['on'](_0x90bb('0x23'),this['syncNewCallerId'][_0x90bb('0x1d')](this));ami['on'](_0x90bb('0x24'),this['syncAttendedTransfer'][_0x90bb('0x1d')](this));ami['on']('blindtransfer',this[_0x90bb('0x25')]['bind'](this));ami['on'](_0x90bb('0x26'),this[_0x90bb('0x27')][_0x90bb('0x1d')](this));ami['on'](_0x90bb('0x28'),this[_0x90bb('0x29')][_0x90bb('0x1d')](this));return BPromise['resolve']()[_0x90bb('0x2a')](ami[_0x90bb('0x2b')]())[_0x90bb('0x2c')](function(_0x4bd1d0){console[_0x90bb('0x2d')](_0x4bd1d0);});}VoiceCallReport[_0x90bb('0x2e')][_0x90bb('0x2f')]=function(_0x2b6d70){return _0x2b6d70!==null&&!_['isUndefined'](_0x2b6d70);};VoiceCallReport[_0x90bb('0x2e')][_0x90bb('0x30')]=function(_0x530d1f,_0x236db4,_0x391632){io['to'](_0x530d1f)['emit'](_0x236db4,_0x391632);};VoiceCallReport[_0x90bb('0x2e')][_0x90bb('0x31')]=function(_0x324b10){try{if(this[_0x90bb('0x2f')](_0x324b10)){if(_0x324b10['uniqueid']===_0x324b10[_0x90bb('0x32')]){if(!_[_0x90bb('0x33')](this[_0x90bb('0x19')][_0x324b10[_0x90bb('0x34')]])){_[_0x90bb('0x35')](this[_0x90bb('0x19')][_0x324b10[_0x90bb('0x34')]],_['pick'](_0x324b10,_[_0x90bb('0x36')](this['channels'][_0x324b10['uniqueid']])));}}}}catch(_0x2cc77a){logger[_0x90bb('0x37')](_0x90bb('0x38'),util['inspect'](_0x2cc77a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x90bb('0x2e')][_0x90bb('0x39')]=function(_0x4841aa){try{if(this[_0x90bb('0x2f')](_0x4841aa)){if(_0x4841aa[_0x90bb('0x34')]===_0x4841aa[_0x90bb('0x32')]&&_0x4841aa['channel']!=_0x90bb('0x3a')){if(_[_0x90bb('0x33')](this[_0x90bb('0x19')][_0x4841aa[_0x90bb('0x34')]])){this[_0x90bb('0x19')][_0x4841aa['uniqueid']]=new Channel();this[_0x90bb('0x19')][_0x4841aa[_0x90bb('0x34')]][_0x90bb('0x3b')]=moment()[_0x90bb('0x3c')](_0x90bb('0x3d'));this[_0x90bb('0x19')][_0x4841aa[_0x90bb('0x34')]]['disposition']=dispositions[_['toNumber'](_0x4841aa[_0x90bb('0x3e')])];_['merge'](this[_0x90bb('0x19')][_0x4841aa[_0x90bb('0x34')]],_['pick'](_0x4841aa,_[_0x90bb('0x36')](this[_0x90bb('0x19')][_0x4841aa[_0x90bb('0x34')]])));if(_0x4841aa[_0x90bb('0x3f')]==='from-sip'){if(this[_0x90bb('0x1a')][_0x4841aa[_0x90bb('0x40')][_0x90bb('0x41')]('-')[0x0]]){this[_0x90bb('0x1a')][_0x4841aa[_0x90bb('0x40')][_0x90bb('0x41')]('-')[0x0]][_0x90bb('0x42')]=_0x4841aa[_0x90bb('0x43')];this[_0x90bb('0x30')](util[_0x90bb('0x3c')]('user:%s',this[_0x90bb('0x1a')][_0x4841aa[_0x90bb('0x40')][_0x90bb('0x41')]('-')[0x0]][_0x90bb('0x44')]),_0x90bb('0x45'),{'destaccountcode':this['agents'][_0x4841aa[_0x90bb('0x40')]['split']('-')[0x0]][_0x90bb('0x46')],'destconnectedlinenum':_0x4841aa['exten']});}}}}}}catch(_0x5a8719){logger[_0x90bb('0x37')]('[syncNewChannel][VoiceCallReport]',util['inspect'](_0x5a8719,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x90bb('0x2e')]['syncNewExten']=function(_0x1ad4b7){try{if(this[_0x90bb('0x2f')](_0x1ad4b7)){if(_0x1ad4b7[_0x90bb('0x34')]===_0x1ad4b7['linkedid']&&_0x1ad4b7[_0x90bb('0x43')]!='h'&&_0x1ad4b7[_0x90bb('0x40')]!=_0x90bb('0x3a')){_0x1ad4b7['application']=_0x1ad4b7['application'][_0x90bb('0x47')]();_0x1ad4b7[_0x90bb('0x48')]=(_0x1ad4b7['appdata']||_0x1ad4b7[_0x90bb('0x48')])[_0x90bb('0x47')]();if(_[_0x90bb('0x33')](this[_0x90bb('0x19')][_0x1ad4b7[_0x90bb('0x34')]])){this[_0x90bb('0x19')][_0x1ad4b7['uniqueid']]=new Channel();this['channels'][_0x1ad4b7[_0x90bb('0x34')]][_0x90bb('0x3b')]=_0x1ad4b7[_0x90bb('0x49')]?moment()[_0x90bb('0x4a')](moment[_0x90bb('0x49')](_0x1ad4b7[_0x90bb('0x49')])[_0x90bb('0x4b')](),_0x90bb('0x4b'))['format'](_0x90bb('0x3d')):moment()[_0x90bb('0x3c')](_0x90bb('0x3d'));this[_0x90bb('0x19')][_0x1ad4b7[_0x90bb('0x34')]]['disposition']='NO\x20ANSWER';}_[_0x90bb('0x35')](this['channels'][_0x1ad4b7[_0x90bb('0x34')]],_['pick'](_0x1ad4b7,_[_0x90bb('0x36')](this['channels'][_0x1ad4b7['uniqueid']])));if(_[_0x90bb('0x4c')](applications,_0x1ad4b7['application'])){this[_0x90bb('0x19')][_0x1ad4b7[_0x90bb('0x34')]][_0x90bb('0x4d')]=_0x1ad4b7['application'];this[_0x90bb('0x19')][_0x1ad4b7[_0x90bb('0x34')]]['lastdata']=_0x1ad4b7[_0x90bb('0x48')];if(_0x1ad4b7[_0x90bb('0x4e')]===_0x90bb('0xc')&&_['startsWith'](_0x1ad4b7[_0x90bb('0x48')],_0x90bb('0x4f'))){var _0x5c61b0=_0x1ad4b7[_0x90bb('0x48')]['split']('=');var _0x2e2d73=_0x5c61b0[0x0][_0x90bb('0x50')](/cdr\((.*)\)/);if(_0x2e2d73){this[_0x90bb('0x19')][_0x1ad4b7[_0x90bb('0x34')]][_0x2e2d73[0x1]]=_0x5c61b0[0x1];}}else if(_0x1ad4b7[_0x90bb('0x4e')]===_0x90bb('0x51')){this[_0x90bb('0x19')][_0x1ad4b7[_0x90bb('0x34')]][_0x90bb('0x51')]=_0x1ad4b7['applicationdata'][_0x90bb('0x41')](',')[0x0];}}}}}catch(_0x169213){logger[_0x90bb('0x37')](_0x90bb('0x52'),util[_0x90bb('0x53')](_0x169213,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x90bb('0x2e')][_0x90bb('0x20')]=function(_0x4cd220){try{if(this[_0x90bb('0x2f')](_0x4cd220)){if(_0x4cd220[_0x90bb('0x34')]!==_0x4cd220['linkedid']){if(this[_0x90bb('0x19')][_0x4cd220['linkedid']]){if(_0x4cd220[_0x90bb('0x3e')]==='6'){if(!this[_0x90bb('0x19')][_0x4cd220['linkedid']][_0x90bb('0x54')]){var _0x144939=moment();this['channels'][_0x4cd220[_0x90bb('0x32')]][_0x90bb('0x54')]=!![];this['channels'][_0x4cd220[_0x90bb('0x32')]][_0x90bb('0x55')]=_0x144939[_0x90bb('0x3c')](_0x90bb('0x3d'));if(this[_0x90bb('0x19')][_0x4cd220['linkedid']][_0x90bb('0x3b')]){this[_0x90bb('0x19')][_0x4cd220[_0x90bb('0x32')]]['holdtime']=_0x144939['diff'](this[_0x90bb('0x19')][_0x4cd220['linkedid']][_0x90bb('0x3b')],_0x90bb('0x4b'));}}this['channels'][_0x4cd220['linkedid']]['linkedid']=_0x4cd220[_0x90bb('0x34')];if(_0x4cd220[_0x90bb('0x56')]!==_0x90bb('0x57')){this[_0x90bb('0x19')][_0x4cd220[_0x90bb('0x32')]]['connectedlinenum']=_0x4cd220['calleridnum'];}this[_0x90bb('0x19')][_0x4cd220[_0x90bb('0x32')]][_0x90bb('0x58')]=_0x4cd220['calleridname'];this['channels'][_0x4cd220[_0x90bb('0x32')]][_0x90bb('0x59')]=_0x4cd220[_0x90bb('0x40')];this['channels'][_0x4cd220[_0x90bb('0x32')]][_0x90bb('0x5a')]=dispositions[_[_0x90bb('0x5b')](_0x4cd220[_0x90bb('0x3e')])];if(this[_0x90bb('0x1a')][_0x4cd220[_0x90bb('0x40')][_0x90bb('0x41')]('-')[0x0]]){this['channels'][_0x4cd220[_0x90bb('0x32')]][_0x90bb('0x5c')]=this[_0x90bb('0x1a')][_0x4cd220[_0x90bb('0x40')][_0x90bb('0x41')]('-')[0x0]]['id'];this[_0x90bb('0x19')][_0x4cd220[_0x90bb('0x32')]]['membername']=this[_0x90bb('0x1a')][_0x4cd220[_0x90bb('0x40')][_0x90bb('0x41')]('-')[0x0]][_0x90bb('0x44')];}}}}else{if(this['channels'][_0x4cd220[_0x90bb('0x34')]]){if(_0x4cd220[_0x90bb('0x3e')]==='6'){if(this['agents'][_0x4cd220['channel'][_0x90bb('0x41')]('-')[0x0]]){this[_0x90bb('0x19')][_0x4cd220[_0x90bb('0x34')]][_0x90bb('0x5c')]=this[_0x90bb('0x1a')][_0x4cd220[_0x90bb('0x40')][_0x90bb('0x41')]('-')[0x0]]['id'];this[_0x90bb('0x19')][_0x4cd220[_0x90bb('0x34')]]['membername']=this[_0x90bb('0x1a')][_0x4cd220[_0x90bb('0x40')][_0x90bb('0x41')]('-')[0x0]][_0x90bb('0x44')];}}}}}}catch(_0x3c0bc9){logger[_0x90bb('0x37')](_0x90bb('0x5d'),util[_0x90bb('0x53')](_0x3c0bc9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x90bb('0x2e')][_0x90bb('0x5e')]=function(_0x5e815d,_0x21e330){if(this[_0x90bb('0x19')][_0x5e815d]){this[_0x90bb('0x19')][_0x5e815d][_0x90bb('0x5f')]=!![];if(_[_0x90bb('0x60')](_0x21e330,_0x90bb('0x61'))){_0x21e330=_0x21e330[_0x90bb('0x62')](_0x90bb('0x61'),_0x90bb('0x63'));}this[_0x90bb('0x19')][_0x5e815d][_0x90bb('0x64')]=_0x21e330;var _0x1741b5=_[_0x90bb('0x65')](this[_0x90bb('0x19')][_0x5e815d][_0x90bb('0x66')],{'filename':_0x21e330});if(_['isNil'](_0x1741b5)){this['channels'][_0x5e815d]['monitors'][_0x90bb('0x67')]({'filename':_0x21e330,'createdAt':moment()[_0x90bb('0x3c')](_0x90bb('0x3d')),'mixmonitorid':'','status':_0x90bb('0x68')});}}};VoiceCallReport[_0x90bb('0x2e')][_0x90bb('0x69')]=function(_0x57dd0a){try{if(this[_0x90bb('0x2f')](_0x57dd0a)){if(this[_0x90bb('0x19')][_0x57dd0a[_0x90bb('0x34')]]&&_0x57dd0a['channel']!='OutgoingSpoolFailed'){if(this[_0x90bb('0x2f')](_0x57dd0a[_0x90bb('0x6a')])){if(this['isNotNull'](_0x57dd0a[_0x90bb('0x6a')][_0x90bb('0x6b')])){this['syncMixMonitorFilename'](_0x57dd0a[_0x90bb('0x34')],_0x57dd0a[_0x90bb('0x6c')]);}else if(this[_0x90bb('0x2f')](_0x57dd0a[_0x90bb('0x6a')][_0x90bb('0x6d')])){this[_0x90bb('0x19')][_0x57dd0a['uniqueid']][_0x90bb('0x56')]=_0x57dd0a[_0x90bb('0x6c')];}else if(this[_0x90bb('0x2f')](_0x57dd0a[_0x90bb('0x6a')][_0x90bb('0x6e')])){this[_0x90bb('0x19')][_0x57dd0a['uniqueid']][_0x90bb('0x6f')]=_0x57dd0a[_0x90bb('0x6c')];}else if(this[_0x90bb('0x2f')](_0x57dd0a['variable']['xmd-cdrtype'])){this['channels'][_0x57dd0a['uniqueid']][_0x90bb('0x70')]=_0x57dd0a[_0x90bb('0x6c')];}else if(this[_0x90bb('0x2f')](_0x57dd0a[_0x90bb('0x6a')][_0x90bb('0x71')])){this[_0x90bb('0x19')][_0x57dd0a[_0x90bb('0x34')]][_0x90bb('0x51')]=_0x57dd0a[_0x90bb('0x6c')][_0x90bb('0x41')](',')[0x0];}else if(this['isNotNull'](_0x57dd0a['variable'][_0x90bb('0x72')])){this[_0x90bb('0x19')][_0x57dd0a[_0x90bb('0x34')]][_0x90bb('0x73')]=_0x57dd0a[_0x90bb('0x6c')];}else if(this['isNotNull'](_0x57dd0a[_0x90bb('0x6a')][_0x90bb('0x74')])){this[_0x90bb('0x19')][_0x57dd0a[_0x90bb('0x34')]][_0x90bb('0x75')]=_0x57dd0a[_0x90bb('0x6c')];}else if(this[_0x90bb('0x2f')](_0x57dd0a[_0x90bb('0x6a')]['xmd-callerid-preview'])){this[_0x90bb('0x19')][_0x57dd0a[_0x90bb('0x34')]][_0x90bb('0x76')]=_0x57dd0a[_0x90bb('0x6c')];}else if(this[_0x90bb('0x2f')](_0x57dd0a[_0x90bb('0x6a')][_0x90bb('0x77')])){this[_0x90bb('0x19')][_0x57dd0a[_0x90bb('0x34')]][_0x90bb('0x51')]=_0x57dd0a[_0x90bb('0x6c')];}else if(this[_0x90bb('0x2f')](_0x57dd0a[_0x90bb('0x6a')]['sipcallid'])){this[_0x90bb('0x19')][_0x57dd0a[_0x90bb('0x34')]][_0x90bb('0x78')]=_0x57dd0a[_0x90bb('0x6c')];}}}else if(this[_0x90bb('0x2f')](_0x57dd0a[_0x90bb('0x6a')]['mixmonitor_filename'])){if(_0x57dd0a['value']){var _0x524643=path[_0x90bb('0x79')](_0x57dd0a[_0x90bb('0x6c')])[_0x90bb('0x44')];this[_0x90bb('0x5e')](_0x524643,_0x57dd0a['value']);}}else if(this[_0x90bb('0x19')][_0x57dd0a[_0x90bb('0x32')]]){if(this[_0x90bb('0x2f')](_0x57dd0a['variable'])){if(this['isNotNull'](_0x57dd0a[_0x90bb('0x6a')][_0x90bb('0x7a')])){this[_0x90bb('0x19')][_0x57dd0a[_0x90bb('0x32')]][_0x90bb('0x7b')]=_0x57dd0a[_0x90bb('0x6c')];}}}}}catch(_0x485953){logger[_0x90bb('0x37')](_0x90bb('0x7c'),util[_0x90bb('0x53')](_0x485953,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x90bb('0x7d')]=function(_0x4b8179){try{if(this['isNotNull'](_0x4b8179)){if(this['channels'][_0x4b8179[_0x90bb('0x34')]]){var _0xa6d549=moment();this['channels'][_0x4b8179[_0x90bb('0x34')]]['endtime']=_0xa6d549[_0x90bb('0x3c')](_0x90bb('0x3d'));this['channels'][_0x4b8179[_0x90bb('0x34')]][_0x90bb('0x49')]=_0xa6d549[_0x90bb('0x7e')](this[_0x90bb('0x19')][_0x4b8179[_0x90bb('0x34')]][_0x90bb('0x3b')],'seconds');if(this[_0x90bb('0x19')][_0x4b8179['uniqueid']][_0x90bb('0x54')]){this[_0x90bb('0x19')][_0x4b8179[_0x90bb('0x34')]][_0x90bb('0x7f')]=_0xa6d549[_0x90bb('0x7e')](this['channels'][_0x4b8179['uniqueid']]['answertime'],_0x90bb('0x4b'));this[_0x90bb('0x19')][_0x4b8179[_0x90bb('0x34')]][_0x90bb('0x80')]=this[_0x90bb('0x19')][_0x4b8179['uniqueid']][_0x90bb('0x49')]-this[_0x90bb('0x19')][_0x4b8179[_0x90bb('0x34')]][_0x90bb('0x7f')];}if(_0x4b8179[_0x90bb('0x3f')]==='from-sip'){if(this['agents'][_0x4b8179[_0x90bb('0x40')][_0x90bb('0x41')]('-')[0x0]]){this[_0x90bb('0x1a')][_0x4b8179[_0x90bb('0x40')][_0x90bb('0x41')]('-')[0x0]]=_[_0x90bb('0x81')](this[_0x90bb('0x1a')][_0x4b8179[_0x90bb('0x40')][_0x90bb('0x41')]('-')[0x0]],[_0x90bb('0x42')]);this[_0x90bb('0x30')](util[_0x90bb('0x3c')](_0x90bb('0x82'),this['agents'][_0x4b8179[_0x90bb('0x40')][_0x90bb('0x41')]('-')[0x0]][_0x90bb('0x44')]),_0x90bb('0x83'),{'destaccountcode':this[_0x90bb('0x1a')][_0x4b8179[_0x90bb('0x40')][_0x90bb('0x41')]('-')[0x0]][_0x90bb('0x46')]});}}ami[_0x90bb('0x30')](_0x90bb('0x84'),this[_0x90bb('0x19')][_0x4b8179['uniqueid']]);delete this[_0x90bb('0x19')][_0x4b8179[_0x90bb('0x34')]];}}}catch(_0x100328){logger[_0x90bb('0x37')]('[syncHangup][VoiceCallReport]',util[_0x90bb('0x53')](_0x100328,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x90bb('0x2e')][_0x90bb('0x85')]=function(_0x37bb36){try{if(this['isNotNull'](_0x37bb36)){if(this['channels'][_0x37bb36[_0x90bb('0x86')]]){this['channels'][_0x37bb36[_0x90bb('0x86')]][_0x90bb('0x87')]=_0x37bb36['origtransferercalleridnum'];this[_0x90bb('0x19')][_0x37bb36[_0x90bb('0x86')]][_0x90bb('0x88')]=_0x37bb36[_0x90bb('0x89')];if(this[_0x90bb('0x19')][_0x37bb36[_0x90bb('0x8a')]]){var _0x1587e=this[_0x90bb('0x19')][_0x37bb36[_0x90bb('0x8a')]];this['channels'][_0x37bb36[_0x90bb('0x8a')]]=this[_0x90bb('0x19')][_0x37bb36['transfereeuniqueid']];this['channels'][_0x37bb36[_0x90bb('0x86')]]=_0x1587e;}}else if(this[_0x90bb('0x19')][_0x37bb36['transfertargetuniqueid']]){this[_0x90bb('0x19')][_0x37bb36[_0x90bb('0x8b')]][_0x90bb('0x87')]=_0x37bb36[_0x90bb('0x8c')];this[_0x90bb('0x19')][_0x37bb36[_0x90bb('0x8b')]][_0x90bb('0x88')]=_0x37bb36['transfertargetcalleridnum'];if(this[_0x90bb('0x19')][_0x37bb36[_0x90bb('0x8d')]]){var _0x1587e=this[_0x90bb('0x19')][_0x37bb36[_0x90bb('0x8d')]];this[_0x90bb('0x19')][_0x37bb36[_0x90bb('0x8d')]]=this[_0x90bb('0x19')][_0x37bb36[_0x90bb('0x8b')]];this[_0x90bb('0x19')][_0x37bb36[_0x90bb('0x8b')]]=_0x1587e;}}}}catch(_0x5c92b8){logger[_0x90bb('0x37')](_0x90bb('0x8e'),util[_0x90bb('0x53')](_0x5c92b8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x90bb('0x2e')][_0x90bb('0x25')]=function(_0x35ae04){try{if(this[_0x90bb('0x2f')](_0x35ae04)){if(this[_0x90bb('0x19')][_0x35ae04[_0x90bb('0x86')]]){this['channels'][_0x35ae04[_0x90bb('0x86')]][_0x90bb('0x87')]=_0x35ae04[_0x90bb('0x8f')];this[_0x90bb('0x19')][_0x35ae04[_0x90bb('0x86')]][_0x90bb('0x88')]=_0x35ae04[_0x90bb('0x90')];this['syncHangup']({'event':'BlindTransfer','uniqueid':_0x35ae04[_0x90bb('0x86')],'context':_0x35ae04[_0x90bb('0x3f')],'channel':_0x35ae04[_0x90bb('0x91')]});}}}catch(_0x207722){logger[_0x90bb('0x37')](_0x90bb('0x92'),util[_0x90bb('0x53')](_0x207722,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x90bb('0x2e')][_0x90bb('0x27')]=function(_0x412d6c){try{if(this['isNotNull'](_0x412d6c)){if(this[_0x90bb('0x19')][_0x412d6c['uniqueid']]){if(!_[_0x90bb('0x93')](this[_0x90bb('0x19')][_0x412d6c[_0x90bb('0x34')]][_0x90bb('0x55')])){this[_0x90bb('0x19')][_0x412d6c['uniqueid']][_0x90bb('0x94')]=moment()[_0x90bb('0x3c')]('YYYY-MM-DD\x20HH:mm:ss');}}}}catch(_0x57975b){logger[_0x90bb('0x37')](_0x90bb('0x95'),util[_0x90bb('0x53')](_0x57975b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMusicOnHoldStop']=function(_0x26e65a){try{if(this['isNotNull'](_0x26e65a)){if(this['channels'][_0x26e65a[_0x90bb('0x34')]]){if(!_[_0x90bb('0x93')](this[_0x90bb('0x19')][_0x26e65a[_0x90bb('0x34')]]['mohstarttime'])){this[_0x90bb('0x19')][_0x26e65a[_0x90bb('0x34')]]['mohtime']+=moment()[_0x90bb('0x96')](0x0)[_0x90bb('0x7e')](this[_0x90bb('0x19')][_0x26e65a[_0x90bb('0x34')]]['mohstarttime'],'seconds');delete this[_0x90bb('0x19')][_0x26e65a[_0x90bb('0x34')]]['mohstarttime'];}}}}catch(_0x3954eb){logger[_0x90bb('0x37')](_0x90bb('0x97'),util[_0x90bb('0x53')](_0x3954eb,{'showHidden':![],'depth':null}));}};module[_0x90bb('0x98')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 76d5dd0..e59cfdf 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 _0x79bf=['localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncHangup','prototype','isNotNull','isUndefined','emit','uniqueid','merge','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','event','privilege','voice:outbound','voice_outbound_channel:save','custom:dialbegin','error','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','format','lastevent','connect','custom:dialconnect','[syncDialEnd][VoiceDialReport]','syncVarSet','keys','outboundrouteid','value','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','membername','memberpenalty','memberrealtime','includes','endtime','starttime','seconds','complete','total','answered','holdtime','diff','sumHoldTime','sumBillable','billableseconds','duration','custom:voiceDialReport','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x79bf,0xaa));var _0xf79b=function(_0xb366f1,_0x1b9197){_0xb366f1=_0xb366f1-0x0;var _0x879beb=_0x79bf[_0xb366f1];return _0x879beb;};'use strict';var _=require('lodash');var moment=require(_0xf79b('0x0'));var util=require('util');var Redis=require(_0xf79b('0x1'));var config=require(_0xf79b('0x2'));var logger=require(_0xf79b('0x3'))(_0xf79b('0x4'));var ami=require(_0xf79b('0x5'));config[_0xf79b('0x6')]=_[_0xf79b('0x7')](config[_0xf79b('0x6')],{'host':_0xf79b('0x8'),'port':0x18eb});var io=require(_0xf79b('0x9'))(new Redis(config[_0xf79b('0x6')]));function VoiceDialReport(_0x3fca67){this[_0xf79b('0xa')]=_0x3fca67[_0xf79b('0xb')];this[_0xf79b('0xc')]=_0x3fca67[_0xf79b('0xc')];this[_0xf79b('0xd')]={};ami['on'](_0xf79b('0xe'),this[_0xf79b('0xf')][_0xf79b('0x10')](this));ami['on'](_0xf79b('0x11'),this[_0xf79b('0x12')][_0xf79b('0x10')](this));ami['on'](_0xf79b('0x13'),this['syncVarSet'][_0xf79b('0x10')](this));ami['on']('hangup',this[_0xf79b('0x14')][_0xf79b('0x10')](this));}VoiceDialReport[_0xf79b('0x15')][_0xf79b('0x16')]=function(_0x176ed7){return _0x176ed7!==null&&!_[_0xf79b('0x17')](_0x176ed7);};VoiceDialReport[_0xf79b('0x15')][_0xf79b('0x18')]=function(_0x11ffa5,_0x395434,_0x3a0f67){io['to'](_0x11ffa5)[_0xf79b('0x18')](_0x395434,_0x3a0f67);};VoiceDialReport[_0xf79b('0x15')][_0xf79b('0xf')]=function(_0x452e65){try{if(this[_0xf79b('0x16')](_0x452e65)){if(this[_0xf79b('0xa')][_0x452e65[_0xf79b('0x19')]]){_[_0xf79b('0x1a')](this[_0xf79b('0xa')][_0x452e65['uniqueid']],{'starttime':moment()['format'](_0xf79b('0x1b')),'lastevent':_0xf79b('0x1c'),'interface':_0x452e65[_0xf79b('0x1d')][_0xf79b('0x1e')](0x0,_0x452e65['channel'][_0xf79b('0x1f')]('-')),'membername':_0x452e65[_0xf79b('0x1d')][_0xf79b('0x1e')](_0x452e65[_0xf79b('0x1d')]['lastIndexOf']('/')+0x1,_0x452e65[_0xf79b('0x1d')][_0xf79b('0x1f')]('-'))},_['omit'](_0x452e65,[_0xf79b('0x20'),_0xf79b('0x21')]));this[_0xf79b('0x18')](_0xf79b('0x22'),_0xf79b('0x23'),this[_0xf79b('0xa')][_0x452e65[_0xf79b('0x19')]]);ami['emit'](_0xf79b('0x24'),this[_0xf79b('0xa')][_0x452e65[_0xf79b('0x19')]]);}}}catch(_0x5a849f){logger[_0xf79b('0x25')]('[syncDialBegin][VoiceDialReport]',util[_0xf79b('0x26')](_0x5a849f,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf79b('0x15')]['syncDialEnd']=function(_0x2d6c83){try{if(this[_0xf79b('0x16')](_0x2d6c83)){if(this['channels'][_0x2d6c83['uniqueid']]){this[_0xf79b('0xa')][_0x2d6c83['uniqueid']][_0xf79b('0x27')]=_0x2d6c83[_0xf79b('0x27')];if(_0x2d6c83[_0xf79b('0x27')]===_0xf79b('0x28')){this[_0xf79b('0xa')][_0x2d6c83[_0xf79b('0x19')]]['connectedlinenum']=_0x2d6c83[_0xf79b('0x29')];this[_0xf79b('0xa')][_0x2d6c83[_0xf79b('0x19')]][_0xf79b('0x2a')]=_0x2d6c83[_0xf79b('0x2a')];this[_0xf79b('0xa')][_0x2d6c83['uniqueid']][_0xf79b('0x2b')]=moment()[_0xf79b('0x2c')](_0xf79b('0x1b'));this[_0xf79b('0xa')][_0x2d6c83[_0xf79b('0x19')]][_0xf79b('0x2d')]=_0xf79b('0x2e');ami[_0xf79b('0x18')](_0xf79b('0x2f'),this[_0xf79b('0xa')][_0x2d6c83[_0xf79b('0x19')]]);}this[_0xf79b('0x18')](_0xf79b('0x22'),_0xf79b('0x23'),this[_0xf79b('0xa')][_0x2d6c83[_0xf79b('0x19')]]);}}}catch(_0x52be45){logger['error'](_0xf79b('0x30'),util[_0xf79b('0x26')](_0x52be45,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf79b('0x15')][_0xf79b('0x31')]=function(_0x53eaa5){try{if(this[_0xf79b('0x16')](_0x53eaa5)){this['addVariable'](_0x53eaa5[_0xf79b('0x19')],_[_0xf79b('0x32')](_0x53eaa5['variable'])[0x0],_0x53eaa5['value']);if(this[_0xf79b('0x16')](_0x53eaa5['variable'])&&this['isNotNull'](_0x53eaa5['variable'][_0xf79b('0x33')])){if(_[_0xf79b('0x17')](this['channels'][_0x53eaa5['uniqueid']])){this[_0xf79b('0xa')][_0x53eaa5[_0xf79b('0x19')]]={'routeId':_0x53eaa5[_0xf79b('0x34')],'variables':this['variables'][_0x53eaa5[_0xf79b('0x19')]]};this[_0xf79b('0x18')](_0xf79b('0x22'),_0xf79b('0x23'),this[_0xf79b('0xa')][_0x53eaa5[_0xf79b('0x19')]]);}}}}catch(_0x35fb19){logger['error']('[syncVarSet][VoiceDialReport]',util['inspect'](_0x35fb19,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xf79b('0x35')]=function(_0x1cf2b7,_0x4dd435,_0x5d77fc){var _0x1c16f9=[_0xf79b('0x36'),_0xf79b('0x37'),_0xf79b('0x38'),_0xf79b('0x39'),_0xf79b('0x3a'),_0xf79b('0x3b'),_0xf79b('0x3c'),_0xf79b('0x3d'),'sipcallid',_0xf79b('0x3e'),_0xf79b('0x3f'),_0xf79b('0x40'),_0xf79b('0x41'),_0xf79b('0x42'),_0xf79b('0x43'),'memberlastcall',_0xf79b('0x44'),_0xf79b('0x45'),_0xf79b('0x46')];if(!_['isNil'](_0x4dd435)&&!_[_0xf79b('0x47')](_0x1c16f9,_0x4dd435)){if(_['isUndefined'](this['variables'][_0x1cf2b7])){this[_0xf79b('0xd')][_0x1cf2b7]={};}this['variables'][_0x1cf2b7][_0x4dd435]=_0x5d77fc;}};VoiceDialReport[_0xf79b('0x15')]['syncHangup']=function(_0x46d4a9){try{if(this[_0xf79b('0x16')](_0x46d4a9)){if(this[_0xf79b('0xa')][_0x46d4a9[_0xf79b('0x19')]]){this['channels'][_0x46d4a9['uniqueid']]['endtime']=moment()[_0xf79b('0x2c')](_0xf79b('0x1b'));this['channels'][_0x46d4a9[_0xf79b('0x19')]]['duration']=moment(this['channels'][_0x46d4a9['uniqueid']][_0xf79b('0x48')])['diff'](this[_0xf79b('0xa')][_0x46d4a9[_0xf79b('0x19')]][_0xf79b('0x49')],_0xf79b('0x4a'));this[_0xf79b('0xa')][_0x46d4a9[_0xf79b('0x19')]][_0xf79b('0x2d')]=_0xf79b('0x4b');this[_0xf79b('0xc')][_0xf79b('0x4c')]+=0x1;if(this[_0xf79b('0xa')][_0x46d4a9[_0xf79b('0x19')]][_0xf79b('0x2b')]){this[_0xf79b('0xc')][_0xf79b('0x4d')]+=0x1;this[_0xf79b('0xa')][_0x46d4a9[_0xf79b('0x19')]][_0xf79b('0x4e')]=moment(this['channels'][_0x46d4a9[_0xf79b('0x19')]][_0xf79b('0x2b')])[_0xf79b('0x4f')](this[_0xf79b('0xa')][_0x46d4a9['uniqueid']]['starttime'],_0xf79b('0x4a'));this['channels'][_0x46d4a9[_0xf79b('0x19')]]['billableseconds']=moment(this[_0xf79b('0xa')][_0x46d4a9[_0xf79b('0x19')]][_0xf79b('0x48')])[_0xf79b('0x4f')](this[_0xf79b('0xa')][_0x46d4a9[_0xf79b('0x19')]][_0xf79b('0x2b')],_0xf79b('0x4a'));this['outbound'][_0xf79b('0x50')]+=this['channels'][_0x46d4a9['uniqueid']][_0xf79b('0x4e')]||0x0;this['outbound'][_0xf79b('0x51')]+=this['channels'][_0x46d4a9['uniqueid']][_0xf79b('0x52')];}this[_0xf79b('0xc')]['sumDuration']+=this['channels'][_0x46d4a9[_0xf79b('0x19')]][_0xf79b('0x53')];ami[_0xf79b('0x18')](_0xf79b('0x54'),this[_0xf79b('0xa')][_0x46d4a9[_0xf79b('0x19')]]);ami[_0xf79b('0x18')](_0xf79b('0x55'),this[_0xf79b('0xa')][_0x46d4a9[_0xf79b('0x19')]]);this[_0xf79b('0x18')]('voice:outbound',_0xf79b('0x56'),this[_0xf79b('0xc')]);this[_0xf79b('0x18')](_0xf79b('0x22'),_0xf79b('0x57'),this[_0xf79b('0xa')][_0x46d4a9['uniqueid']]);delete this['channels'][_0x46d4a9[_0xf79b('0x19')]];}if(this[_0xf79b('0xd')][_0x46d4a9[_0xf79b('0x19')]]){delete this[_0xf79b('0xd')][_0x46d4a9[_0xf79b('0x19')]];}}}catch(_0x4e962b){logger['error'](_0xf79b('0x58'),util['inspect'](_0x4e962b,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file +var _0xaffa=['substring','omit','event','privilege','voice:outbound','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','[syncDialEnd][VoiceDialReport]','addVariable','keys','value','variable','voice_outbound_channel:save','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','membercalls','memberdynamic','memberinterface','membername','memberpenalty','isNil','variables','syncHangup','endtime','duration','diff','starttime','seconds','total','answered','holdtime','billableseconds','sumHoldTime','sumBillable','custom:voiceDialReport','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','channels','outbound','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','syncVarSet','prototype','isNotNull','isUndefined','emit','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','lastIndexOf'];(function(_0xe3f360,_0x203484){var _0x4b6d3d=function(_0x50c315){while(--_0x50c315){_0xe3f360['push'](_0xe3f360['shift']());}};_0x4b6d3d(++_0x203484);}(_0xaffa,0x1ec));var _0xaaff=function(_0x2b048e,_0x289f5d){_0x2b048e=_0x2b048e-0x0;var _0x23e6d3=_0xaffa[_0x2b048e];return _0x23e6d3;};'use strict';var _=require(_0xaaff('0x0'));var moment=require(_0xaaff('0x1'));var util=require(_0xaaff('0x2'));var Redis=require(_0xaaff('0x3'));var config=require(_0xaaff('0x4'));var logger=require(_0xaaff('0x5'))('ami');var ami=require(_0xaaff('0x6'));config[_0xaaff('0x7')]=_[_0xaaff('0x8')](config['redis'],{'host':_0xaaff('0x9'),'port':0x18eb});var io=require(_0xaaff('0xa'))(new Redis(config[_0xaaff('0x7')]));function VoiceDialReport(_0x467f79){this[_0xaaff('0xb')]=_0x467f79['outboundChannels'];this[_0xaaff('0xc')]=_0x467f79[_0xaaff('0xc')];this['variables']={};ami['on'](_0xaaff('0xd'),this[_0xaaff('0xe')][_0xaaff('0xf')](this));ami['on'](_0xaaff('0x10'),this[_0xaaff('0x11')][_0xaaff('0xf')](this));ami['on']('varset',this[_0xaaff('0x12')]['bind'](this));ami['on']('hangup',this['syncHangup']['bind'](this));}VoiceDialReport[_0xaaff('0x13')][_0xaaff('0x14')]=function(_0x4fd825){return _0x4fd825!==null&&!_[_0xaaff('0x15')](_0x4fd825);};VoiceDialReport[_0xaaff('0x13')]['emit']=function(_0x362820,_0x408dfb,_0x229b8c){io['to'](_0x362820)[_0xaaff('0x16')](_0x408dfb,_0x229b8c);};VoiceDialReport[_0xaaff('0x13')][_0xaaff('0xe')]=function(_0x1ac982){try{if(this['isNotNull'](_0x1ac982)){if(this['channels'][_0x1ac982[_0xaaff('0x17')]]){_[_0xaaff('0x18')](this[_0xaaff('0xb')][_0x1ac982[_0xaaff('0x17')]],{'starttime':moment()[_0xaaff('0x19')](_0xaaff('0x1a')),'lastevent':_0xaaff('0x1b'),'interface':_0x1ac982[_0xaaff('0x1c')]['substring'](0x0,_0x1ac982[_0xaaff('0x1c')][_0xaaff('0x1d')]('-')),'membername':_0x1ac982[_0xaaff('0x1c')][_0xaaff('0x1e')](_0x1ac982[_0xaaff('0x1c')][_0xaaff('0x1d')]('/')+0x1,_0x1ac982['channel']['lastIndexOf']('-'))},_[_0xaaff('0x1f')](_0x1ac982,[_0xaaff('0x20'),_0xaaff('0x21')]));this['emit'](_0xaaff('0x22'),'voice_outbound_channel:save',this[_0xaaff('0xb')][_0x1ac982[_0xaaff('0x17')]]);ami[_0xaaff('0x16')](_0xaaff('0x23'),this[_0xaaff('0xb')][_0x1ac982[_0xaaff('0x17')]]);}}}catch(_0x4d6a28){logger[_0xaaff('0x24')](_0xaaff('0x25'),util[_0xaaff('0x26')](_0x4d6a28,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xaaff('0x13')]['syncDialEnd']=function(_0x229fcd){try{if(this[_0xaaff('0x14')](_0x229fcd)){if(this['channels'][_0x229fcd[_0xaaff('0x17')]]){this[_0xaaff('0xb')][_0x229fcd[_0xaaff('0x17')]][_0xaaff('0x27')]=_0x229fcd[_0xaaff('0x27')];if(_0x229fcd[_0xaaff('0x27')]===_0xaaff('0x28')){this[_0xaaff('0xb')][_0x229fcd[_0xaaff('0x17')]]['connectedlinenum']=_0x229fcd[_0xaaff('0x29')];this['channels'][_0x229fcd['uniqueid']][_0xaaff('0x2a')]=_0x229fcd[_0xaaff('0x2a')];this['channels'][_0x229fcd[_0xaaff('0x17')]][_0xaaff('0x2b')]=moment()[_0xaaff('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xaaff('0xb')][_0x229fcd[_0xaaff('0x17')]][_0xaaff('0x2c')]=_0xaaff('0x2d');ami[_0xaaff('0x16')]('custom:dialconnect',this[_0xaaff('0xb')][_0x229fcd[_0xaaff('0x17')]]);}this[_0xaaff('0x16')](_0xaaff('0x22'),'voice_outbound_channel:save',this[_0xaaff('0xb')][_0x229fcd['uniqueid']]);}}}catch(_0x143c66){logger['error'](_0xaaff('0x2e'),util['inspect'](_0x143c66,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xaaff('0x13')][_0xaaff('0x12')]=function(_0x405a6b){try{if(this[_0xaaff('0x14')](_0x405a6b)){this[_0xaaff('0x2f')](_0x405a6b[_0xaaff('0x17')],_[_0xaaff('0x30')](_0x405a6b['variable'])[0x0],_0x405a6b[_0xaaff('0x31')]);if(this[_0xaaff('0x14')](_0x405a6b[_0xaaff('0x32')])&&this['isNotNull'](_0x405a6b[_0xaaff('0x32')]['outboundrouteid'])){if(_[_0xaaff('0x15')](this[_0xaaff('0xb')][_0x405a6b['uniqueid']])){this[_0xaaff('0xb')][_0x405a6b[_0xaaff('0x17')]]={'routeId':_0x405a6b[_0xaaff('0x31')],'variables':this['variables'][_0x405a6b[_0xaaff('0x17')]]};this[_0xaaff('0x16')](_0xaaff('0x22'),_0xaaff('0x33'),this['channels'][_0x405a6b[_0xaaff('0x17')]]);}}}}catch(_0x4678c7){logger['error'](_0xaaff('0x34'),util[_0xaaff('0x26')](_0x4678c7,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xaaff('0x13')][_0xaaff('0x2f')]=function(_0x2124cd,_0x79ef33,_0x481816){var _0x816698=[_0xaaff('0x35'),_0xaaff('0x36'),_0xaaff('0x37'),_0xaaff('0x38'),_0xaaff('0x39'),_0xaaff('0x3a'),'rtpaudioqosrtt',_0xaaff('0x3b'),_0xaaff('0x3c'),_0xaaff('0x3d'),'bridgepeer','bridgepvtcallid',_0xaaff('0x3e'),_0xaaff('0x3f'),_0xaaff('0x40'),'memberlastcall',_0xaaff('0x41'),_0xaaff('0x42'),'memberrealtime'];if(!_[_0xaaff('0x43')](_0x79ef33)&&!_['includes'](_0x816698,_0x79ef33)){if(_[_0xaaff('0x15')](this[_0xaaff('0x44')][_0x2124cd])){this[_0xaaff('0x44')][_0x2124cd]={};}this[_0xaaff('0x44')][_0x2124cd][_0x79ef33]=_0x481816;}};VoiceDialReport['prototype'][_0xaaff('0x45')]=function(_0x18d999){try{if(this[_0xaaff('0x14')](_0x18d999)){if(this['channels'][_0x18d999[_0xaaff('0x17')]]){this[_0xaaff('0xb')][_0x18d999[_0xaaff('0x17')]][_0xaaff('0x46')]=moment()[_0xaaff('0x19')](_0xaaff('0x1a'));this[_0xaaff('0xb')][_0x18d999[_0xaaff('0x17')]][_0xaaff('0x47')]=moment(this[_0xaaff('0xb')][_0x18d999[_0xaaff('0x17')]][_0xaaff('0x46')])[_0xaaff('0x48')](this['channels'][_0x18d999['uniqueid']][_0xaaff('0x49')],_0xaaff('0x4a'));this[_0xaaff('0xb')][_0x18d999['uniqueid']][_0xaaff('0x2c')]='complete';this[_0xaaff('0xc')][_0xaaff('0x4b')]+=0x1;if(this[_0xaaff('0xb')][_0x18d999['uniqueid']][_0xaaff('0x2b')]){this[_0xaaff('0xc')][_0xaaff('0x4c')]+=0x1;this[_0xaaff('0xb')][_0x18d999[_0xaaff('0x17')]][_0xaaff('0x4d')]=moment(this['channels'][_0x18d999[_0xaaff('0x17')]][_0xaaff('0x2b')])[_0xaaff('0x48')](this[_0xaaff('0xb')][_0x18d999[_0xaaff('0x17')]][_0xaaff('0x49')],_0xaaff('0x4a'));this[_0xaaff('0xb')][_0x18d999[_0xaaff('0x17')]][_0xaaff('0x4e')]=moment(this['channels'][_0x18d999[_0xaaff('0x17')]][_0xaaff('0x46')])[_0xaaff('0x48')](this['channels'][_0x18d999[_0xaaff('0x17')]][_0xaaff('0x2b')],_0xaaff('0x4a'));this['outbound'][_0xaaff('0x4f')]+=this[_0xaaff('0xb')][_0x18d999[_0xaaff('0x17')]][_0xaaff('0x4d')]||0x0;this['outbound'][_0xaaff('0x50')]+=this[_0xaaff('0xb')][_0x18d999[_0xaaff('0x17')]][_0xaaff('0x4e')];}this[_0xaaff('0xc')]['sumDuration']+=this['channels'][_0x18d999['uniqueid']][_0xaaff('0x47')];ami[_0xaaff('0x16')](_0xaaff('0x51'),this['channels'][_0x18d999[_0xaaff('0x17')]]);ami['emit'](_0xaaff('0x52'),this[_0xaaff('0xb')][_0x18d999['uniqueid']]);this[_0xaaff('0x16')](_0xaaff('0x22'),_0xaaff('0x53'),this[_0xaaff('0xc')]);this['emit']('voice:outbound',_0xaaff('0x54'),this[_0xaaff('0xb')][_0x18d999[_0xaaff('0x17')]]);delete this['channels'][_0x18d999[_0xaaff('0x17')]];}if(this[_0xaaff('0x44')][_0x18d999['uniqueid']]){delete this['variables'][_0x18d999[_0xaaff('0x17')]];}}}catch(_0x197566){logger[_0xaaff('0x24')](_0xaaff('0x55'),util[_0xaaff('0x26')](_0x197566,{'showHidden':![],'depth':null}));}};module[_0xaaff('0x56')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 4a889ad..7cbba7a 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 _0x925c=['toNumber','loggedin','custom:queuesummary','syncNewExten','uniqueid','YYYY-MM-DD\x20HH:mm:ss','position','count','keys','push','[syncQueueCallerJoin][VoiceQueueReport]','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','queuecallercomplete','[syncAgentConnect][VoiceQueueReport]','assigned','membername','queuecallerexitAt','transfer','reason','startsWith','toLowerCase','local/','linkedid','queuecallerjoinAt','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','toUpperCase','[syncAgentComplete][VoiceQueueReport]','addVariable','variable','value','queuestatus','CONTINUE','queuecallerexit','queuecallerleaveAt','queueposition','EXITWITHKEY','[syncVarSet][VoiceQueueReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberrealtime','includes','syncHangup','length','unmanaged','diff','milliseconds','total','answered','custom:queuecallerunmanaged','custom:queuecallerabandon','emitVoiceQueueSummary','custom:voiceQueueReport','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','BLIND','extension','[syncBlindTransfer][VoiceQueueReport]','isNil','mohstarttime','exports','lodash','util','md5','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','tail','sequence','queueReports','agents','channels','voiceQueues','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','fullybooted','syncFullyBooted','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isUndefined','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','unlockRR','prototype','switch','enqueue','Action','status','channel','catch','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','[voiceQueueReport][checkQueueReport]','variables','[voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','inspect','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','name','voice_queue_channel:remove','type','strategy','available','loggedIn','sumBillable','sumDuration','sumHoldTime','abandoned','Trunk','active','callerid','Interval','stringify','clearZombieChannels','[queues]','flagQueueSummary','[queuesummary]','isNotNull','queue','countBy','callers'];(function(_0x5c110f,_0x3c4bd8){var _0x5ebfc5=function(_0x2549df){while(--_0x2549df){_0x5c110f['push'](_0x5c110f['shift']());}};_0x5ebfc5(++_0x3c4bd8);}(_0x925c,0x1ce));var _0xc925=function(_0x44d8d0,_0x2ecb4f){_0x44d8d0=_0x44d8d0-0x0;var _0x3e9cd6=_0x925c[_0x44d8d0];return _0x3e9cd6;};'use strict';var _=require(_0xc925('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xc925('0x1'));var md5=require(_0xc925('0x2'));var Redis=require('ioredis');var config=require(_0xc925('0x3'));var logger=require(_0xc925('0x4'))('ami');var ami=require(_0xc925('0x5'));var QueueReport=require('../model/queueReport');config[_0xc925('0x6')]=_[_0xc925('0x7')](config[_0xc925('0x6')],{'host':_0xc925('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc925('0x6')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x541fb4){this['tail']=this[_0xc925('0x9')]?this[_0xc925('0x9')]['finally'](_0x541fb4):_0x541fb4();};function VoiceQueueReport(_0x2e9e2f){this[_0xc925('0xa')]=new Sequence();this[_0xc925('0xb')]={};this['agents']=_0x2e9e2f[_0xc925('0xc')];this[_0xc925('0xd')]=_0x2e9e2f['queueChannels'];this[_0xc925('0xe')]=_0x2e9e2f['voiceQueues'];this['flagQueueSummary']=!![];this['campaigns']=_0x2e9e2f['campaigns'];this['variables']={};ami['on'](_0xc925('0xf'),this[_0xc925('0x10')][_0xc925('0x11')](this));ami['on'](_0xc925('0x12'),this[_0xc925('0x13')][_0xc925('0x11')](this));ami['on'](_0xc925('0x14'),this['syncQueueCallerJoin'][_0xc925('0x11')](this));ami['on'](_0xc925('0x15'),this[_0xc925('0x16')][_0xc925('0x11')](this));ami['on'](_0xc925('0x17'),this[_0xc925('0x18')]['bind'](this));ami['on']('agentcomplete',this[_0xc925('0x19')][_0xc925('0x11')](this));ami['on'](_0xc925('0x1a'),this[_0xc925('0x1b')][_0xc925('0x11')](this));ami['on'](_0xc925('0x1c'),this[_0xc925('0x1d')][_0xc925('0x11')](this));ami['on'](_0xc925('0x1e'),this['syncHangup'][_0xc925('0x11')](this));ami['on'](_0xc925('0x1f'),this[_0xc925('0x20')][_0xc925('0x11')](this));ami['on']('musiconholdstart',this[_0xc925('0x21')]['bind'](this));ami['on'](_0xc925('0x22'),this[_0xc925('0x23')]['bind'](this));ami['on']('attendedtransfer',this[_0xc925('0x24')]['bind'](this));ami['on'](_0xc925('0x25'),this[_0xc925('0x26')][_0xc925('0x11')](this));this[_0xc925('0x27')]();this[_0xc925('0x28')]();}function isNotNull(_0x39a6a0){return _0x39a6a0!==null&&!_[_0xc925('0x29')](_0x39a6a0);}function clearChannels(_0x35dd8e){if(!_[_0xc925('0x2a')](_0x35dd8e)){for(var _0x3ac032 in _0x35dd8e){if(_0x35dd8e[_0xc925('0x2b')](_0x3ac032)){delete _0x35dd8e[_0x3ac032];}}}}function clearCampaigns(_0x32031b){if(!_[_0xc925('0x2a')](_0x32031b)){for(var _0x46e408 in _0x32031b){if(_0x32031b[_0xc925('0x2b')](_0x46e408)){_0x32031b[_0x46e408][_0xc925('0x2c')]=0x0;}}}}function clearVoiceQueues(_0xd895a2){if(!_[_0xc925('0x2a')](_0xd895a2)){for(var _0x1eee20 in _0xd895a2){if(_0xd895a2['hasOwnProperty'](_0x1eee20)){_0xd895a2[_0x1eee20]['originated']=0x0;_0xd895a2[_0x1eee20][_0xc925('0x2d')]=0x0;_0xd895a2[_0x1eee20][_0xc925('0x2e')]=0x0;_0xd895a2[_0x1eee20][_0xc925('0x2f')]=0x0;_0xd895a2[_0x1eee20]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x32d468){if(!_['isEmpty'](_0x32d468)){for(var _0x568b28 in _0x32d468){if(_0x32d468[_0xc925('0x2b')](_0x568b28)){_0x32d468[_0x568b28][_0xc925('0x30')]=!![];}}}}VoiceQueueReport[_0xc925('0x31')]['clearZombieChannels']=function(){var _0x2a6d8c=this;for(var _0x595a12 in this[_0xc925('0xd')]){if(this[_0xc925('0xd')][_0xc925('0x2b')](_0x595a12)&&!this[_0xc925('0xd')][_0x595a12][_0xc925('0x32')]){this[_0xc925('0xa')][_0xc925('0x33')](function(){if(!_['isNil'](_0x2a6d8c[_0xc925('0xd')][_0x595a12])){return ami[_0xc925('0x34')]({'action':_0xc925('0x35'),'channel':_0x2a6d8c[_0xc925('0xd')][_0x595a12][_0xc925('0x36')]})[_0xc925('0x37')](function(_0x94aed){if(_0x94aed['message']===_0xc925('0x38')){setTimeout(function(){if(_0x2a6d8c['channels'][_0x595a12]){delete _0x2a6d8c[_0xc925('0xd')][_0x595a12];logger[_0xc925('0x39')](_0xc925('0x3a'),_0x595a12);}if(_0x2a6d8c[_0xc925('0xb')][_0x595a12]){delete _0x2a6d8c[_0xc925('0xb')][_0x595a12];logger[_0xc925('0x39')](_0xc925('0x3b'),_0x595a12);}if(_0x2a6d8c[_0xc925('0x3c')][_0x595a12]){delete _0x2a6d8c['variables'][_0x595a12];logger['error'](_0xc925('0x3d'),_0x595a12);}},0x1f40);}});}});}}};VoiceQueueReport[_0xc925('0x31')][_0xc925('0x20')]=function(){logger[_0xc925('0x39')](_0xc925('0x3e'));clearChannels(this[_0xc925('0xd')]);this['clearQueueReport'](this[_0xc925('0xb')]);clearAgentBooked(this[_0xc925('0xc')]);clearVoiceQueues(this[_0xc925('0xe')]);clearCampaigns(this['campaigns']);};VoiceQueueReport[_0xc925('0x31')][_0xc925('0x3f')]=function(_0x5c4005){var _0x2a1fa1=this;if(!_[_0xc925('0x2a')](_0x5c4005)){for(var _0x5c547d in _0x5c4005){if(_0x5c4005['hasOwnProperty'](_0x5c547d)){_0x2a1fa1[_0xc925('0x40')](_0x5c4005[_0x5c547d]);delete _0x5c4005[_0x5c547d];}}}};function loggerCatch(_0x267754){return function(_0x9fab5c){logger[_0xc925('0x39')](_0x267754,util[_0xc925('0x41')](_0x9fab5c,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0xc925('0x31')][_0xc925('0x42')]=function(_0x4338c9,_0x217df7,_0x4fda22){io['to'](_0x4338c9)['emit'](_0x217df7,_0x4fda22);};VoiceQueueReport[_0xc925('0x31')][_0xc925('0x43')]=function(_0x30b794){this[_0xc925('0x42')](util[_0xc925('0x44')](_0xc925('0x45'),_0x30b794[_0xc925('0x46')]),'voice_queue_channel:save',_0x30b794);};VoiceQueueReport[_0xc925('0x31')][_0xc925('0x40')]=function(_0xcbb6fd){this[_0xc925('0x42')](util[_0xc925('0x44')](_0xc925('0x45'),_0xcbb6fd[_0xc925('0x46')]),_0xc925('0x47'),_0xcbb6fd);};VoiceQueueReport[_0xc925('0x31')]['emitVoiceQueueSummary']=function(_0x2e13a2){if(_0x2e13a2[_0xc925('0x48')]==='inbound'){var _0x120e9a={'id':_0x2e13a2['id'],'name':_0x2e13a2[_0xc925('0x46')],'strategy':_0x2e13a2[_0xc925('0x49')],'answered':_0x2e13a2['answered'],'available':_0x2e13a2[_0xc925('0x4a')],'loggedIn':_0x2e13a2[_0xc925('0x4b')],'pTalking':_0x2e13a2[_0xc925('0x2e')],'sumBillable':_0x2e13a2[_0xc925('0x4c')],'sumDuration':_0x2e13a2[_0xc925('0x4d')],'sumHoldTime':_0x2e13a2[_0xc925('0x4e')]||0x0,'talking':_0x2e13a2[_0xc925('0x2d')],'total':_0x2e13a2['total'],'type':_0x2e13a2[_0xc925('0x48')],'unmanaged':_0x2e13a2['unmanaged'],'abandoned':_0x2e13a2[_0xc925('0x4f')],'waiting':_0x2e13a2['waiting']};if(_0x2e13a2[_0xc925('0x50')]){_0x120e9a[_0xc925('0x50')]={'id':_0x2e13a2[_0xc925('0x50')]['id'],'name':_0x2e13a2['Trunk']['name'],'active':_0x2e13a2[_0xc925('0x50')][_0xc925('0x51')],'callerid':_0x2e13a2[_0xc925('0x50')][_0xc925('0x52')]};}if(_0x2e13a2[_0xc925('0x53')]){_0x120e9a['Interval']={'id':_0x2e13a2[_0xc925('0x53')]['id'],'name':_0x2e13a2[_0xc925('0x53')][_0xc925('0x46')]};}var _0x54f3f6=md5(JSON[_0xc925('0x54')](_0x120e9a));if(_0x2e13a2['md5']!==_0x54f3f6){_0x2e13a2[_0xc925('0x2')]=_0x54f3f6;this['emit'](util[_0xc925('0x44')](_0xc925('0x45'),_0x120e9a[_0xc925('0x46')]),'voice_queue:save',_0x120e9a);}}};VoiceQueueReport[_0xc925('0x31')]['isNotNull']=function(_0x319fcb){return _0x319fcb!==null&&!_['isUndefined'](_0x319fcb);};VoiceQueueReport[_0xc925('0x31')][_0xc925('0x28')]=function(){var _0x3f3db5=this;setInterval(function(){_0x3f3db5[_0xc925('0x55')]();ami['Action']({'action':'queues'})[_0xc925('0x37')](loggerCatch(_0xc925('0x56')));},0x2710);};VoiceQueueReport[_0xc925('0x31')][_0xc925('0x27')]=function(){var _0x48b4d5=this;setInterval(function(){if(_0x48b4d5[_0xc925('0x57')]){return ami['Action']({'action':'queuesummary'})['then'](function(_0x28c516){_0x48b4d5[_0xc925('0x57')]=![];})[_0xc925('0x37')](loggerCatch(_0xc925('0x58')));}},0x3e8);};VoiceQueueReport[_0xc925('0x31')][_0xc925('0x10')]=function(_0x58caa9){try{if(this[_0xc925('0x59')](_0x58caa9)&&this[_0xc925('0x59')](_0x58caa9[_0xc925('0x5a')])){if(this[_0xc925('0xe')][_0x58caa9[_0xc925('0x5a')]]){var _0x5e0d44=_[_0xc925('0x5b')](this[_0xc925('0xd')],'queue')[_0x58caa9[_0xc925('0x5a')]]||0x0;var _0x46ecf0=_0x5e0d44-_0x58caa9[_0xc925('0x5c')];if(this[_0xc925('0xe')][_0x58caa9[_0xc925('0x5a')]][_0xc925('0x2f')]!==_['toNumber'](_0x58caa9['callers'])||this[_0xc925('0xe')][_0x58caa9[_0xc925('0x5a')]][_0xc925('0x4b')]!==_[_0xc925('0x5d')](_0x58caa9[_0xc925('0x5e')])||this[_0xc925('0xe')][_0x58caa9[_0xc925('0x5a')]][_0xc925('0x4a')]!==_[_0xc925('0x5d')](_0x58caa9[_0xc925('0x4a')])||this[_0xc925('0xe')][_0x58caa9[_0xc925('0x5a')]][_0xc925('0x2d')]!==_0x46ecf0){this[_0xc925('0xe')][_0x58caa9[_0xc925('0x5a')]][_0xc925('0x2f')]=_[_0xc925('0x5d')](_0x58caa9[_0xc925('0x5c')]);this['voiceQueues'][_0x58caa9[_0xc925('0x5a')]][_0xc925('0x4b')]=_[_0xc925('0x5d')](_0x58caa9['loggedin']);this['voiceQueues'][_0x58caa9[_0xc925('0x5a')]][_0xc925('0x4a')]=_[_0xc925('0x5d')](_0x58caa9['available']);this[_0xc925('0xe')][_0x58caa9['queue']][_0xc925('0x2d')]=_0x46ecf0>0x0?_0x46ecf0:0x0;this[_0xc925('0xe')][_0x58caa9[_0xc925('0x5a')]][_0xc925('0x2d')]=this[_0xc925('0xe')][_0x58caa9[_0xc925('0x5a')]][_0xc925('0x2d')]>_[_0xc925('0x5d')](_0x58caa9['loggedin'])?_['toNumber'](_0x58caa9['loggedin']):this['voiceQueues'][_0x58caa9['queue']]['talking'];this['emitVoiceQueueSummary'](this[_0xc925('0xe')][_0x58caa9[_0xc925('0x5a')]]);}ami[_0xc925('0x42')](_0xc925('0x5f'),this[_0xc925('0xe')][_0x58caa9[_0xc925('0x5a')]]);}}}catch(_0x246456){logger['error']('[syncQueueSummary][VoiceQueueReport]',util[_0xc925('0x41')](_0x246456,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc925('0x31')][_0xc925('0x13')]=function(_0x4219ab){this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0xc925('0x60')]=function(_0x1a53c5){};VoiceQueueReport[_0xc925('0x31')]['syncQueueCallerJoin']=function(_0x20a96b){try{if(this[_0xc925('0x59')](_0x20a96b)){if(_[_0xc925('0x29')](this[_0xc925('0xb')][_0x20a96b[_0xc925('0x61')]])){this[_0xc925('0xb')][_0x20a96b[_0xc925('0x61')]]=[];this[_0xc925('0xd')][_0x20a96b[_0xc925('0x61')]]={};}var _0x2d2240=new QueueReport();_0x2d2240['name']=_0x20a96b[_0xc925('0x5a')];_0x2d2240[_0xc925('0x48')]=this[_0xc925('0xe')][_0x2d2240[_0xc925('0x46')]]&&this[_0xc925('0xe')][_0x2d2240[_0xc925('0x46')]][_0xc925('0x48')]?this['voiceQueues'][_0x2d2240[_0xc925('0x46')]][_0xc925('0x48')]||'inbound':'inbound';_0x2d2240[_0xc925('0x5a')]=_0x20a96b[_0xc925('0x5a')];_0x2d2240['queuecallerjoinAt']=moment()[_0xc925('0x44')](_0xc925('0x62'));_0x2d2240[_0xc925('0x63')]=_0x20a96b['position'];_0x2d2240[_0xc925('0x64')]=_0x20a96b['count'];_['merge'](_0x2d2240,_['pick'](_0x20a96b,_[_0xc925('0x65')](_0x2d2240)));this[_0xc925('0xb')][_0x20a96b[_0xc925('0x61')]][_0xc925('0x66')](_0x2d2240);this[_0xc925('0xd')][_0x20a96b['uniqueid']]=_0x2d2240;this['emitVoiceQueueChannelSave'](_0x2d2240);}}catch(_0x55c52d){logger[_0xc925('0x39')](_0xc925('0x67'),util[_0xc925('0x41')](_0x55c52d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc925('0x31')][_0xc925('0x16')]=function(_0x2cc269){try{if(this[_0xc925('0x59')](_0x2cc269)){if(this[_0xc925('0xb')][_0x2cc269[_0xc925('0x61')]]){var _0x1d6c2a=_[_0xc925('0x68')](this[_0xc925('0xb')][_0x2cc269[_0xc925('0x61')]]);_0x1d6c2a['queuecallercomplete']=![];_0x1d6c2a[_0xc925('0x69')]=null;_0x1d6c2a['holdtime']=_0x2cc269[_0xc925('0x6a')];_0x1d6c2a['originalposition']=_0x2cc269[_0xc925('0x6b')];_0x1d6c2a[_0xc925('0x15')]=!![];_0x1d6c2a[_0xc925('0x6c')]=moment()['format'](_0xc925('0x62'));_0x1d6c2a[_0xc925('0x6d')]=_0xc925('0x6e');_0x1d6c2a[_0xc925('0x6f')]=null;this[_0xc925('0xd')][_0x2cc269[_0xc925('0x61')]]=_0x1d6c2a;this[_0xc925('0x40')](_0x1d6c2a);}}}catch(_0x30e21d){logger[_0xc925('0x39')]('[syncQueueCallerAbandon][VoiceQueueReport]',util[_0xc925('0x41')](_0x30e21d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc925('0x31')][_0xc925('0x18')]=function(_0x2c0180){try{if(this['isNotNull'](_0x2c0180)){if(this['queueReports'][_0x2c0180[_0xc925('0x61')]]){var _0x19bc1e=_[_0xc925('0x68')](this[_0xc925('0xb')][_0x2c0180['uniqueid']]);_0x19bc1e['queuecallerleaveAt']=moment()[_0xc925('0x44')](_0xc925('0x62'));_0x19bc1e[_0xc925('0x70')]=_0x2c0180[_0xc925('0x70')];_0x19bc1e[_0xc925('0x71')]=_0x2c0180['connectedlinename'];this['channels'][_0x2c0180['uniqueid']]=_0x19bc1e;this[_0xc925('0x43')](_0x19bc1e);}}}catch(_0x59199e){logger[_0xc925('0x39')](_0xc925('0x72'),util[_0xc925('0x41')](_0x59199e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x17159b){try{if(this['isNotNull'](_0x17159b)){if(this[_0xc925('0xb')][_0x17159b[_0xc925('0x61')]]){var _0x5afdf2=_['last'](this[_0xc925('0xb')][_0x17159b['uniqueid']]);_0x5afdf2[_0xc925('0x73')]=!![];_0x5afdf2[_0xc925('0x6d')]='COMPLETEDBYAGENT';}}}catch(_0x2a7206){logger[_0xc925('0x39')](_0xc925('0x74'),util[_0xc925('0x41')](_0x2a7206,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc925('0x31')][_0xc925('0x19')]=function(_0x3c8b98){try{if(this[_0xc925('0x59')](_0x3c8b98)){if(this[_0xc925('0xb')][_0x3c8b98[_0xc925('0x61')]]){var _0x40f795=_[_0xc925('0x68')](this[_0xc925('0xb')][_0x3c8b98[_0xc925('0x61')]]);_0x40f795[_0xc925('0x15')]=![];_0x40f795[_0xc925('0x6c')]=null;_0x40f795[_0xc925('0x75')]=!![];_0x40f795['lastAssignedTo']=_0x3c8b98[_0xc925('0x76')];_0x40f795[_0xc925('0x6a')]=_0x3c8b98['holdtime'];_0x40f795['queuecallercomplete']=!![];_0x40f795['queuecallerexit']=![];_0x40f795[_0xc925('0x77')]=null;if(!_0x40f795[_0xc925('0x78')]){if(_0x3c8b98[_0xc925('0x79')]=='transfer'){_0x40f795['queuecallerexitreason']='COMPLETED';}else{if(_[_0xc925('0x7a')](_0x3c8b98[_0xc925('0x36')][_0xc925('0x7b')](),_0xc925('0x7c'))){if(this[_0xc925('0xb')][_0x3c8b98['linkedid']]){var _0x444d4d=_['last'](this[_0xc925('0xb')][_0x3c8b98[_0xc925('0x7d')]]);_0x444d4d['queuecallercomplete']=![];_0x444d4d['queuecallerexit']=!![];_0x444d4d[_0xc925('0x77')]=moment(_0x40f795[_0xc925('0x7e')])['add'](_0x3c8b98[_0xc925('0x6a')],_0xc925('0x7f'))[_0xc925('0x44')](_0xc925('0x62'));_0x444d4d['queuecallerexitreason']=_0xc925('0x80');_0x444d4d[_0xc925('0x78')]=!![];_0x444d4d[_0xc925('0x81')]=_0xc925('0x82');_0x444d4d[_0xc925('0x83')]=_0x3c8b98[_0xc925('0x84')];_0x444d4d[_0xc925('0x85')]=_0x3c8b98[_0xc925('0x61')];var _0x475745=this[_0xc925('0xb')][_0x3c8b98[_0xc925('0x7d')]];this[_0xc925('0xb')][_0x3c8b98[_0xc925('0x7d')]]=this[_0xc925('0xb')][_0x3c8b98[_0xc925('0x61')]];this[_0xc925('0xb')][_0x3c8b98['uniqueid']]=_0x475745;}}else{_0x40f795[_0xc925('0x6d')]='COMPLETEDBY'+_0x3c8b98['reason'][_0xc925('0x86')]();}}}this[_0xc925('0xd')][_0x3c8b98[_0xc925('0x61')]]=_0x40f795;this[_0xc925('0x40')](_0x40f795);}}}catch(_0x2726e8){logger[_0xc925('0x39')](_0xc925('0x87'),util['inspect'](_0x2726e8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc925('0x31')]['syncVarSet']=function(_0x1e6abd){try{if(this[_0xc925('0x59')](_0x1e6abd)){this[_0xc925('0x88')](_0x1e6abd[_0xc925('0x61')],_['keys'](_0x1e6abd[_0xc925('0x89')])[0x0],_0x1e6abd[_0xc925('0x8a')]);if(this[_0xc925('0xb')][_0x1e6abd[_0xc925('0x61')]]){var _0x426dad=_[_0xc925('0x68')](this['queueReports'][_0x1e6abd[_0xc925('0x61')]]);if(_0x426dad){if(this[_0xc925('0x59')](_0x1e6abd[_0xc925('0x89')])&&this[_0xc925('0x59')](_0x1e6abd[_0xc925('0x89')][_0xc925('0x8b')])){switch(_0x1e6abd[_0xc925('0x8a')]){case _0xc925('0x8c'):_0x426dad['queuecallerexit']=![];_0x426dad[_0xc925('0x77')]=null;break;default:_0x426dad[_0xc925('0x8d')]=!![];_0x426dad[_0xc925('0x77')]=moment()['format'](_0xc925('0x62'));_0x426dad[_0xc925('0x8e')]=moment()[_0xc925('0x44')](_0xc925('0x62'));}_0x426dad[_0xc925('0x15')]=![];_0x426dad['queuecallerabandonAt']=null;_0x426dad[_0xc925('0x6d')]=_0x1e6abd['value'];this[_0xc925('0xd')][_0x1e6abd[_0xc925('0x61')]]=_0x426dad;this[_0xc925('0x40')](_0x426dad);}else if(this[_0xc925('0x59')](_0x1e6abd[_0xc925('0x89')])&&this[_0xc925('0x59')](_0x1e6abd[_0xc925('0x89')][_0xc925('0x8f')])){if(!_0x426dad[_0xc925('0x15')]){_0x426dad[_0xc925('0x8d')]=!![];_0x426dad[_0xc925('0x77')]=moment()[_0xc925('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x426dad[_0xc925('0x6d')]=_0xc925('0x90');_0x426dad[_0xc925('0x8e')]=moment()[_0xc925('0x44')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc925('0xd')][_0x1e6abd[_0xc925('0x61')]]=_0x426dad;}}_0x426dad[_0xc925('0x3c')]=this['variables'][_0x1e6abd[_0xc925('0x61')]];}}}}catch(_0x43a9cb){logger['error'](_0xc925('0x91'),util[_0xc925('0x41')](_0x43a9cb,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc925('0x88')]=function(_0x333642,_0x238402,_0x358866){var _0x3977b1=[_0xc925('0x92'),_0xc925('0x93'),_0xc925('0x94'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0xc925('0x95'),_0xc925('0x96'),_0xc925('0x97'),_0xc925('0x98'),'sipuri',_0xc925('0x99'),_0xc925('0x9a'),_0xc925('0x9b'),'memberdynamic','memberinterface',_0xc925('0x9c'),_0xc925('0x76'),'memberpenalty',_0xc925('0x9d')];if(!_['isNil'](_0x238402)&&!_[_0xc925('0x9e')](_0x3977b1,_0x238402)){if(_[_0xc925('0x29')](this[_0xc925('0x3c')][_0x333642])){this[_0xc925('0x3c')][_0x333642]={};}this[_0xc925('0x3c')][_0x333642][_0x238402]=_0x358866;}};VoiceQueueReport[_0xc925('0x31')][_0xc925('0x9f')]=function(_0x349be9){try{if(this[_0xc925('0x59')](_0x349be9)){if(this[_0xc925('0xb')][_0x349be9[_0xc925('0x61')]]){for(var _0x3aeec5=0x0,_0x1ec32a={};_0x3aeec50x0?_0x5e885b:0x0;this[_0x5ce4('0x11')][_0x59e03c[_0x5ce4('0x61')]][_0x5ce4('0x2e')]=this['voiceQueues'][_0x59e03c[_0x5ce4('0x61')]][_0x5ce4('0x2e')]>_[_0x5ce4('0x64')](_0x59e03c['loggedin'])?_['toNumber'](_0x59e03c[_0x5ce4('0x65')]):this['voiceQueues'][_0x59e03c[_0x5ce4('0x61')]]['talking'];this[_0x5ce4('0x4c')](this[_0x5ce4('0x11')][_0x59e03c[_0x5ce4('0x61')]]);}ami[_0x5ce4('0x45')](_0x5ce4('0x67'),this[_0x5ce4('0x11')][_0x59e03c[_0x5ce4('0x61')]]);}}}catch(_0x3c331f){logger[_0x5ce4('0x3c')]('[syncQueueSummary][VoiceQueueReport]',util[_0x5ce4('0x44')](_0x3c331f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5ce4('0xb')][_0x5ce4('0x68')]=function(_0x39f3e4){this[_0x5ce4('0x5d')]=!![];};VoiceQueueReport[_0x5ce4('0xb')][_0x5ce4('0x69')]=function(_0x59d3ce){};VoiceQueueReport['prototype'][_0x5ce4('0x17')]=function(_0x435680){try{if(this[_0x5ce4('0x5a')](_0x435680)){if(_[_0x5ce4('0x2a')](this['queueReports'][_0x435680[_0x5ce4('0x6a')]])){this['queueReports'][_0x435680[_0x5ce4('0x6a')]]=[];this[_0x5ce4('0x34')][_0x435680[_0x5ce4('0x6a')]]={};}var _0x5ca482=new QueueReport();_0x5ca482[_0x5ce4('0x49')]=_0x435680[_0x5ce4('0x61')];_0x5ca482[_0x5ce4('0x4d')]=this[_0x5ce4('0x11')][_0x5ca482[_0x5ce4('0x49')]]&&this[_0x5ce4('0x11')][_0x5ca482['name']]['type']?this[_0x5ce4('0x11')][_0x5ca482[_0x5ce4('0x49')]]['type']||_0x5ce4('0x6b'):_0x5ce4('0x6b');_0x5ca482[_0x5ce4('0x61')]=_0x435680[_0x5ce4('0x61')];_0x5ca482[_0x5ce4('0x6c')]=moment()[_0x5ce4('0x47')](_0x5ce4('0x6d'));_0x5ca482[_0x5ce4('0x6e')]=_0x435680[_0x5ce4('0x6e')];_0x5ca482[_0x5ce4('0x6f')]=_0x435680['count'];_[_0x5ce4('0x70')](_0x5ca482,_[_0x5ce4('0x71')](_0x435680,_['keys'](_0x5ca482)));this[_0x5ce4('0x3e')][_0x435680[_0x5ce4('0x6a')]][_0x5ce4('0x72')](_0x5ca482);this[_0x5ce4('0x34')][_0x435680[_0x5ce4('0x6a')]]=_0x5ca482;this[_0x5ce4('0x46')](_0x5ca482);}}catch(_0x3f7af1){logger[_0x5ce4('0x3c')](_0x5ce4('0x73'),util[_0x5ce4('0x44')](_0x3f7af1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5ce4('0xb')][_0x5ce4('0x19')]=function(_0x322a1a){try{if(this[_0x5ce4('0x5a')](_0x322a1a)){if(this[_0x5ce4('0x3e')][_0x322a1a[_0x5ce4('0x6a')]]){var _0x166f2f=_[_0x5ce4('0x74')](this['queueReports'][_0x322a1a[_0x5ce4('0x6a')]]);_0x166f2f['queuecallercomplete']=![];_0x166f2f[_0x5ce4('0x75')]=null;_0x166f2f[_0x5ce4('0x76')]=_0x322a1a[_0x5ce4('0x76')];_0x166f2f['originalposition']=_0x322a1a[_0x5ce4('0x77')];_0x166f2f[_0x5ce4('0x18')]=!![];_0x166f2f['queuecallerabandonAt']=moment()['format'](_0x5ce4('0x6d'));_0x166f2f[_0x5ce4('0x78')]='ABANDONED';_0x166f2f[_0x5ce4('0x79')]=null;this[_0x5ce4('0x34')][_0x322a1a[_0x5ce4('0x6a')]]=_0x166f2f;this['emitVoiceQueueChannelRemove'](_0x166f2f);}}}catch(_0x2267c2){logger[_0x5ce4('0x3c')](_0x5ce4('0x7a'),util['inspect'](_0x2267c2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5ce4('0xb')][_0x5ce4('0x1a')]=function(_0x12ca9c){try{if(this['isNotNull'](_0x12ca9c)){if(this[_0x5ce4('0x3e')][_0x12ca9c[_0x5ce4('0x6a')]]){var _0x1345f6=_['last'](this[_0x5ce4('0x3e')][_0x12ca9c[_0x5ce4('0x6a')]]);_0x1345f6[_0x5ce4('0x7b')]=moment()[_0x5ce4('0x47')](_0x5ce4('0x6d'));_0x1345f6[_0x5ce4('0x7c')]=_0x12ca9c[_0x5ce4('0x7c')];_0x1345f6[_0x5ce4('0x7d')]=_0x12ca9c[_0x5ce4('0x7d')];this['channels'][_0x12ca9c[_0x5ce4('0x6a')]]=_0x1345f6;this[_0x5ce4('0x46')](_0x1345f6);}}}catch(_0x53a3cf){logger[_0x5ce4('0x3c')]('[syncQueueCallerLeave][VoiceQueueReport]',util['inspect'](_0x53a3cf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5ce4('0xb')]['syncAgentConnect']=function(_0x3be88a){try{if(this[_0x5ce4('0x5a')](_0x3be88a)){if(this['queueReports'][_0x3be88a[_0x5ce4('0x6a')]]){var _0xbec139=_['last'](this['queueReports'][_0x3be88a[_0x5ce4('0x6a')]]);_0xbec139[_0x5ce4('0x7e')]=!![];_0xbec139[_0x5ce4('0x78')]=_0x5ce4('0x7f');}}}catch(_0x996782){logger[_0x5ce4('0x3c')](_0x5ce4('0x80'),util[_0x5ce4('0x44')](_0x996782,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5ce4('0xb')][_0x5ce4('0x1c')]=function(_0x12426b){try{if(this[_0x5ce4('0x5a')](_0x12426b)){if(this[_0x5ce4('0x3e')][_0x12426b[_0x5ce4('0x6a')]]){var _0x39ae7a=_[_0x5ce4('0x74')](this[_0x5ce4('0x3e')][_0x12426b[_0x5ce4('0x6a')]]);_0x39ae7a[_0x5ce4('0x18')]=![];_0x39ae7a[_0x5ce4('0x81')]=null;_0x39ae7a['assigned']=!![];_0x39ae7a[_0x5ce4('0x79')]=_0x12426b[_0x5ce4('0x82')];_0x39ae7a[_0x5ce4('0x76')]=_0x12426b[_0x5ce4('0x76')];_0x39ae7a['queuecallercomplete']=!![];_0x39ae7a[_0x5ce4('0x83')]=![];_0x39ae7a['queuecallerexitAt']=null;if(!_0x39ae7a[_0x5ce4('0x84')]){if(_0x12426b[_0x5ce4('0x85')]==_0x5ce4('0x84')){_0x39ae7a['queuecallerexitreason']=_0x5ce4('0x86');}else{if(_['startsWith'](_0x12426b[_0x5ce4('0x39')]['toLowerCase'](),'local/')){if(this[_0x5ce4('0x3e')][_0x12426b[_0x5ce4('0x87')]]){var _0x165e96=_[_0x5ce4('0x74')](this[_0x5ce4('0x3e')][_0x12426b['linkedid']]);_0x165e96['queuecallercomplete']=![];_0x165e96[_0x5ce4('0x83')]=!![];_0x165e96[_0x5ce4('0x88')]=moment(_0x39ae7a[_0x5ce4('0x6c')])['add'](_0x12426b['holdtime'],'seconds')['format'](_0x5ce4('0x6d'));_0x165e96[_0x5ce4('0x78')]='FORWARDTRANSFER';_0x165e96[_0x5ce4('0x84')]=!![];_0x165e96['transfertype']=_0x5ce4('0x89');_0x165e96[_0x5ce4('0x8a')]=_0x12426b[_0x5ce4('0x8b')];_0x165e96['transferuniqueid']=_0x12426b[_0x5ce4('0x6a')];var _0x244aee=this['queueReports'][_0x12426b[_0x5ce4('0x87')]];this[_0x5ce4('0x3e')][_0x12426b[_0x5ce4('0x87')]]=this[_0x5ce4('0x3e')][_0x12426b['uniqueid']];this[_0x5ce4('0x3e')][_0x12426b['uniqueid']]=_0x244aee;}}else{_0x39ae7a[_0x5ce4('0x78')]=_0x5ce4('0x8c')+_0x12426b['reason']['toUpperCase']();}}}this[_0x5ce4('0x34')][_0x12426b[_0x5ce4('0x6a')]]=_0x39ae7a;this[_0x5ce4('0x43')](_0x39ae7a);}}}catch(_0x2a961a){logger[_0x5ce4('0x3c')]('[syncAgentComplete][VoiceQueueReport]',util['inspect'](_0x2a961a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5ce4('0xb')][_0x5ce4('0x1f')]=function(_0x4dd90a){try{if(this[_0x5ce4('0x5a')](_0x4dd90a)){this[_0x5ce4('0x8d')](_0x4dd90a[_0x5ce4('0x6a')],_[_0x5ce4('0x8e')](_0x4dd90a[_0x5ce4('0x8f')])[0x0],_0x4dd90a['value']);if(this[_0x5ce4('0x3e')][_0x4dd90a[_0x5ce4('0x6a')]]){var _0x472a41=_['last'](this[_0x5ce4('0x3e')][_0x4dd90a[_0x5ce4('0x6a')]]);if(_0x472a41){if(this[_0x5ce4('0x5a')](_0x4dd90a[_0x5ce4('0x8f')])&&this['isNotNull'](_0x4dd90a[_0x5ce4('0x8f')][_0x5ce4('0x90')])){switch(_0x4dd90a[_0x5ce4('0x91')]){case _0x5ce4('0x92'):_0x472a41[_0x5ce4('0x83')]=![];_0x472a41[_0x5ce4('0x88')]=null;break;default:_0x472a41['queuecallerexit']=!![];_0x472a41[_0x5ce4('0x88')]=moment()[_0x5ce4('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x472a41[_0x5ce4('0x7b')]=moment()['format'](_0x5ce4('0x6d'));}_0x472a41[_0x5ce4('0x18')]=![];_0x472a41[_0x5ce4('0x81')]=null;_0x472a41[_0x5ce4('0x78')]=_0x4dd90a[_0x5ce4('0x91')];this[_0x5ce4('0x34')][_0x4dd90a[_0x5ce4('0x6a')]]=_0x472a41;this[_0x5ce4('0x43')](_0x472a41);}else if(this[_0x5ce4('0x5a')](_0x4dd90a[_0x5ce4('0x8f')])&&this[_0x5ce4('0x5a')](_0x4dd90a['variable'][_0x5ce4('0x93')])){if(!_0x472a41[_0x5ce4('0x18')]){_0x472a41[_0x5ce4('0x83')]=!![];_0x472a41[_0x5ce4('0x88')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x472a41[_0x5ce4('0x78')]='EXITWITHKEY';_0x472a41[_0x5ce4('0x7b')]=moment()[_0x5ce4('0x47')](_0x5ce4('0x6d'));this['channels'][_0x4dd90a[_0x5ce4('0x6a')]]=_0x472a41;}}_0x472a41['variables']=this[_0x5ce4('0x13')][_0x4dd90a[_0x5ce4('0x6a')]];}}}}catch(_0x1b684b){logger[_0x5ce4('0x3c')](_0x5ce4('0x94'),util[_0x5ce4('0x44')](_0x1b684b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5ce4('0xb')][_0x5ce4('0x8d')]=function(_0x363e6a,_0x15b882,_0x389bb2){var _0x30fe2d=['rtpaudioqos',_0x5ce4('0x95'),_0x5ce4('0x96'),_0x5ce4('0x97'),_0x5ce4('0x98'),'rtpaudioqoslossbridged',_0x5ce4('0x99'),'rtpaudioqosrttbridged',_0x5ce4('0x9a'),_0x5ce4('0x9b'),_0x5ce4('0x9c'),'bridgepvtcallid',_0x5ce4('0x9d'),'memberdynamic',_0x5ce4('0x9e'),_0x5ce4('0x9f'),_0x5ce4('0x82'),_0x5ce4('0xa0'),_0x5ce4('0xa1')];if(!_[_0x5ce4('0x36')](_0x15b882)&&!_['includes'](_0x30fe2d,_0x15b882)){if(_['isUndefined'](this[_0x5ce4('0x13')][_0x363e6a])){this[_0x5ce4('0x13')][_0x363e6a]={};}this[_0x5ce4('0x13')][_0x363e6a][_0x15b882]=_0x389bb2;}};VoiceQueueReport[_0x5ce4('0xb')]['syncHangup']=function(_0xf045e3){try{if(this[_0x5ce4('0x5a')](_0xf045e3)){if(this[_0x5ce4('0x3e')][_0xf045e3[_0x5ce4('0x6a')]]){for(var _0x136bc5=0x0,_0x4e257d={};_0x136bc5=0x0?moment(_0x229209[_0xbd9c('0x1a')])['diff'](_0x229209[_0xbd9c('0x19')],'seconds'):null,'data1':_0xbd9c('0x1b'),'data2':_0x229209['accountcode'],'data3':_0x229209[_0xbd9c('0x12')],'data4':_0x229209[_0xbd9c('0x1c')]||null,'role':_0xbd9c('0x14'),'internal':_0x229209[_0xbd9c('0x15')]?_[_0xbd9c('0x16')](_0x229209['accountcode']):undefined,'uniqueid':_0x229209['uniqueid']},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0xb5cf=['moment','lodash','../client','queuecallercompleteAt','queuecallerexitAt','voice','lastAssignedTo','isNil','interface','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','CreateMemberReport','voiceDialReport','Request','starttime','endtime','dialstring','uniqueid'];(function(_0x5a3e9a,_0x5b0570){var _0x5ca346=function(_0x2f2420){while(--_0x2f2420){_0x5a3e9a['push'](_0x5a3e9a['shift']());}};_0x5ca346(++_0x5b0570);}(_0xb5cf,0x1e6));var _0xfb5c=function(_0x3a5a74,_0x1331ee){_0x3a5a74=_0x3a5a74-0x0;var _0x336ad1=_0xb5cf[_0x3a5a74];return _0x336ad1;};'use strict';var moment=require(_0xfb5c('0x0'));var _=require(_0xfb5c('0x1'));var util=require('util');var client=require(_0xfb5c('0x2'));exports['voiceQueueReport']=function(_0x4ce30f){var _0x334a9d=_0x4ce30f[_0xfb5c('0x3')]||_0x4ce30f[_0xfb5c('0x4')];return client['Request']('CreateMemberReport',{'body':{'channel':_0xfb5c('0x5'),'membername':_0x4ce30f[_0xfb5c('0x6')],'interface':_[_0xfb5c('0x7')](_0x4ce30f[_0xfb5c('0x8')])?util['format']('SIP/%s',_0x4ce30f['lastAssignedTo']):_0x4ce30f[_0xfb5c('0x8')],'type':_0xfb5c('0x9'),'enterAt':_0x4ce30f[_0xfb5c('0xa')],'exitAt':_0x334a9d,'duration':moment(_0x334a9d)[_0xfb5c('0xb')](_0x4ce30f[_0xfb5c('0xa')],_0xfb5c('0xc')),'data1':_0xfb5c('0xd'),'data2':_0x4ce30f[_0xfb5c('0xe')],'data3':_0x4ce30f[_0xfb5c('0xf')],'data4':null,'data5':_0x4ce30f[_0xfb5c('0x10')],'role':_0xfb5c('0x11'),'internal':_0x4ce30f[_0xfb5c('0x12')]?_[_0xfb5c('0x13')](_0x4ce30f[_0xfb5c('0x12')]):undefined,'uniqueid':_0x4ce30f['uniqueid']},'log':_0xfb5c('0x14')});};exports[_0xfb5c('0x15')]=function(_0xc6d260){return client[_0xfb5c('0x16')](_0xfb5c('0x14'),{'body':{'channel':'voice','membername':_0xc6d260['membername'],'interface':_0xc6d260[_0xfb5c('0x8')],'type':'TALKING','enterAt':_0xc6d260[_0xfb5c('0x17')],'exitAt':_0xc6d260['endtime'],'duration':moment(_0xc6d260[_0xfb5c('0x18')])[_0xfb5c('0xb')](_0xc6d260['starttime'],'seconds')>=0x0?moment(_0xc6d260['endtime'])[_0xfb5c('0xb')](_0xc6d260[_0xfb5c('0x17')],_0xfb5c('0xc')):null,'data1':'outbound','data2':_0xc6d260['accountcode'],'data3':_0xc6d260['exten'],'data4':_0xc6d260[_0xfb5c('0x19')]||null,'role':_0xfb5c('0x11'),'internal':_0xc6d260[_0xfb5c('0x12')]?_['toNumber'](_0xc6d260[_0xfb5c('0x12')]):undefined,'uniqueid':_0xc6d260[_0xfb5c('0x1a')]},'log':_0xfb5c('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 7bd285a..0b25789 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 _0x6dfb=['html','../client','getTemplates','Request','GetTemplate','name'];(function(_0x4700c7,_0x532fb1){var _0x39ae69=function(_0x28b739){while(--_0x28b739){_0x4700c7['push'](_0x4700c7['shift']());}};_0x39ae69(++_0x532fb1);}(_0x6dfb,0xaf));var _0xb6df=function(_0x14d8c3,_0x2b55a9){_0x14d8c3=_0x14d8c3-0x0;var _0x354f8f=_0x6dfb[_0x14d8c3];return _0x354f8f;};'use strict';var client=require(_0xb6df('0x0'));exports[_0xb6df('0x1')]=function(_0x43ee78){return function(_0x42f249){return client[_0xb6df('0x2')](_0xb6df('0x3'),{'options':{'raw':!![],'attributes':['id',_0xb6df('0x4'),_0xb6df('0x5')]},'log':_0xb6df('0x3')});};}; \ No newline at end of file +var _0x31cf=['name','html','getTemplates'];(function(_0x2a94d8,_0x47d4fe){var _0xe1f74d=function(_0x1c5735){while(--_0x1c5735){_0x2a94d8['push'](_0x2a94d8['shift']());}};_0xe1f74d(++_0x47d4fe);}(_0x31cf,0x1b8));var _0xf31c=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x31cf[_0x2cf2e9];return _0xd3670d;};'use strict';var client=require('../client');exports[_0xf31c('0x0')]=function(_0x28093f){return function(_0x5d5f2c){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xf31c('0x1'),_0xf31c('0x2')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 3111016..a21c7c2 100644 --- a/server/services/ami/rpc/trigger.js +++ b/server/services/ami/rpc/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0x567473,_0x2d7463){var _0x89a778=function(_0x5e17e9){while(--_0x5e17e9){_0x567473['push'](_0x567473['shift']());}};_0x89a778(++_0x2d7463);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0x808f95,_0x450d07){var _0x33dac8=function(_0x487f3d){while(--_0x487f3d){_0x808f95['push'](_0x808f95['shift']());}};_0x33dac8(++_0x450d07);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 5862b13..af09686 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 _0xb2fa=['getTrunks','Request','GetTrunk','name','registry','../client'];(function(_0x56085e,_0x5c69e9){var _0x4de130=function(_0x120b34){while(--_0x120b34){_0x56085e['push'](_0x56085e['shift']());}};_0x4de130(++_0x5c69e9);}(_0xb2fa,0x9b));var _0xab2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb2fa[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xab2f('0x0'));exports[_0xab2f('0x1')]=function(_0x2677db){return function(_0x1eaa3a){return client[_0xab2f('0x2')](_0xab2f('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xab2f('0x4'),_0xab2f('0x5')]},'log':_0xab2f('0x3')});};}; \ No newline at end of file +var _0xb688=['name','../client','Request','GetTrunk'];(function(_0x2d6f1b,_0x7a30ee){var _0x1ea829=function(_0x329b71){while(--_0x329b71){_0x2d6f1b['push'](_0x2d6f1b['shift']());}};_0x1ea829(++_0x7a30ee);}(_0xb688,0x145));var _0x8b68=function(_0x1d39f8,_0x182897){_0x1d39f8=_0x1d39f8-0x0;var _0x411e54=_0xb688[_0x1d39f8];return _0x411e54;};'use strict';var client=require(_0x8b68('0x0'));exports['getTrunks']=function(_0x1bf404){return function(_0x29db47){return client[_0x8b68('0x1')](_0x8b68('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x8b68('0x3'),'registry']},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index be75773..ffc4961 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 _0xfed6=['phone','mobile','interface','telephone','internal','getTelephones','savePause','PauseUser','ShowUser','email','lastLoginAt','getAgent','../client','getAgents','Request','GetUser','agent','name','accountcode','fullname','online','pauseType','lastPauseAt','voicePause'];(function(_0x372090,_0x21debc){var _0x1e1f1c=function(_0x3402df){while(--_0x3402df){_0x372090['push'](_0x372090['shift']());}};_0x1e1f1c(++_0x21debc);}(_0xfed6,0x114));var _0x6fed=function(_0x165277,_0x1f5fca){_0x165277=_0x165277-0x0;var _0x5eed91=_0xfed6[_0x165277];return _0x5eed91;};'use strict';var client=require(_0x6fed('0x0'));exports[_0x6fed('0x1')]=function(){return function(){return client[_0x6fed('0x2')](_0x6fed('0x3'),{'options':{'raw':![],'where':{'role':_0x6fed('0x4')},'attributes':['id',_0x6fed('0x5'),'email',_0x6fed('0x6'),_0x6fed('0x7'),_0x6fed('0x8'),'lastLoginAt',_0x6fed('0x9'),_0x6fed('0xa'),_0x6fed('0xb'),_0x6fed('0xc'),_0x6fed('0xd'),_0x6fed('0xe')]},'log':_0x6fed('0x1')});};};exports['getTelephones']=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x6fed('0xf')},'attributes':['id',_0x6fed('0x5'),_0x6fed('0x6'),_0x6fed('0x10')]},'log':_0x6fed('0x11')});};};exports[_0x6fed('0x12')]=function(_0x2a978a,_0x1c1be4,_0x317d08){return client[_0x6fed('0x2')](_0x6fed('0x13'),{'body':{'type':_0x1c1be4,'uniqueid':_0x317d08},'options':{'where':{'id':_0x2a978a['id']}},'log':_0x6fed('0x12')});};exports['saveUnpause']=function(_0x29add1){return client[_0x6fed('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x29add1['id']}},'log':_0x6fed('0x12')});};exports['getAgent']=function(_0x271265){return client[_0x6fed('0x2')](_0x6fed('0x14'),{'options':{'raw':![],'where':{'role':_0x6fed('0x4'),'id':_0x271265},'attributes':['id',_0x6fed('0x5'),_0x6fed('0x15'),_0x6fed('0x6'),'fullname',_0x6fed('0x8'),_0x6fed('0x16'),_0x6fed('0x9'),_0x6fed('0xa'),_0x6fed('0xb'),_0x6fed('0xe')]},'log':_0x6fed('0x17')});}; \ No newline at end of file +var _0x721d=['telephone','accountcode','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','fullname','voicePause','interface','../client','getAgents','Request','GetUser','agent','name','email','online','pauseType','lastPauseAt','phone'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x721d,0x73));var _0xd721=function(_0x33ca26,_0xd94c2){_0x33ca26=_0x33ca26-0x0;var _0x47fcbe=_0x721d[_0x33ca26];return _0x47fcbe;};'use strict';var client=require(_0xd721('0x0'));exports[_0xd721('0x1')]=function(){return function(){return client[_0xd721('0x2')](_0xd721('0x3'),{'options':{'raw':![],'where':{'role':_0xd721('0x4')},'attributes':['id',_0xd721('0x5'),_0xd721('0x6'),'accountcode','fullname',_0xd721('0x7'),'lastLoginAt',_0xd721('0x8'),_0xd721('0x9'),'voicePause',_0xd721('0xa'),'mobile','interface']},'log':_0xd721('0x1')});};};exports['getTelephones']=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0xd721('0xb')},'attributes':['id',_0xd721('0x5'),_0xd721('0xc'),'internal']},'log':'getTelephones'});};};exports['savePause']=function(_0x2f032e,_0x25a878,_0x2a2a7f){return client['Request'](_0xd721('0xd'),{'body':{'type':_0x25a878,'uniqueid':_0x2a2a7f},'options':{'where':{'id':_0x2f032e['id']}},'log':_0xd721('0xe')});};exports[_0xd721('0xf')]=function(_0x44953f){return client['Request'](_0xd721('0x10'),{'body':{},'options':{'where':{'id':_0x44953f['id']}},'log':_0xd721('0xe')});};exports['getAgent']=function(_0x2cc879){return client[_0xd721('0x2')](_0xd721('0x11'),{'options':{'raw':![],'where':{'role':_0xd721('0x4'),'id':_0x2cc879},'attributes':['id',_0xd721('0x5'),_0xd721('0x6'),_0xd721('0xc'),_0xd721('0x12'),_0xd721('0x7'),'lastLoginAt',_0xd721('0x8'),_0xd721('0x9'),_0xd721('0x13'),_0xd721('0x14')]},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 18c8dbb..c2a91b9 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 _0xfb8f=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create'];(function(_0x586e4c,_0x4759d2){var _0x5c4957=function(_0x3bea20){while(--_0x3bea20){_0x586e4c['push'](_0x586e4c['shift']());}};_0x5c4957(++_0x4759d2);}(_0xfb8f,0xa0));var _0xffb8=function(_0x5cea7c,_0x6c7778){_0x5cea7c=_0x5cea7c-0x0;var _0x2d5cc7=_0xfb8f[_0x5cea7c];return _0x2d5cc7;};'use strict';var client=require(_0xffb8('0x0'));exports[_0xffb8('0x1')]=function(_0x2e54ba){return client[_0xffb8('0x2')](_0xffb8('0x3'),{'body':_0x2e54ba,'log':'CreateVoiceAgentReport'});};exports[_0xffb8('0x4')]=function(_0x3cd9b3,_0x172a93,_0x4485c2){return client[_0xffb8('0x2')]('UpdateVoiceAgentReport',{'body':_0x3cd9b3,'options':{'where':{'uniqueid':_0x172a93,'interface':_0x4485c2}},'log':_0xffb8('0x5')});}; \ No newline at end of file +var _0xc156=['Request','CreateVoiceAgentReport','UpdateVoiceAgentReport','../client','create'];(function(_0x309ffb,_0x200325){var _0x241029=function(_0x1a00c9){while(--_0x1a00c9){_0x309ffb['push'](_0x309ffb['shift']());}};_0x241029(++_0x200325);}(_0xc156,0xad));var _0x6c15=function(_0x4eceaa,_0x18e5c1){_0x4eceaa=_0x4eceaa-0x0;var _0x993903=_0xc156[_0x4eceaa];return _0x993903;};'use strict';var client=require(_0x6c15('0x0'));exports[_0x6c15('0x1')]=function(_0x439774){return client[_0x6c15('0x2')](_0x6c15('0x3'),{'body':_0x439774,'log':'CreateVoiceAgentReport'});};exports['update']=function(_0x1110db,_0x491f64,_0x4be68f){return client[_0x6c15('0x2')]('UpdateVoiceAgentReport',{'body':_0x1110db,'options':{'where':{'uniqueid':_0x491f64,'interface':_0x4be68f}},'log':_0x6c15('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index cae442c..da6d73a 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 _0x7c45=['DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','YYYY-MM-DD\x20HH:mm:ss','endOf','day','format','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','../client','Request','CreateVoiceCallReport','merge','calleridnum','callerid'];(function(_0x31bad6,_0x1995d0){var _0x84703a=function(_0x3c386e){while(--_0x3c386e){_0x31bad6['push'](_0x31bad6['shift']());}};_0x84703a(++_0x1995d0);}(_0x7c45,0x11e));var _0x57c4=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x7c45[_0x2f45ea];return _0x485a84;};'use strict';var moment=require(_0x57c4('0x0'));var util=require(_0x57c4('0x1'));var _=require('lodash');var client=require(_0x57c4('0x2'));exports['create']=function(_0x1668fc){return client[_0x57c4('0x3')](_0x57c4('0x4'),{'body':_[_0x57c4('0x5')](_0x1668fc,{'source':_0x1668fc[_0x57c4('0x6')],'destinationcontext':_0x1668fc['context'],'callerid':_0x1668fc[_0x57c4('0x7')],'amaflags':_0x57c4('0x8')}),'log':_0x57c4('0x4')});};exports[_0x57c4('0x9')]=function(){return function(){return client[_0x57c4('0x3')](_0x57c4('0xa'),{'options':{'where':{'type':[_0x57c4('0xb')],'createdAt':{'$between':[moment()[_0x57c4('0xc')]('day')['format'](_0x57c4('0xd')),moment()[_0x57c4('0xe')](_0x57c4('0xf'))[_0x57c4('0x10')](_0x57c4('0xd'))]}},'attributes':['type',_0x57c4('0x11'),_0x57c4('0x12'),_0x57c4('0x13')]},'log':_0x57c4('0x14')});};}; \ No newline at end of file +var _0xf621=['util','lodash','../client','CreateVoiceCallReport','merge','context','getVoiceCallReports','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','disposition','duration','billableseconds','GetVoiceCallReports','moment'];(function(_0x36182b,_0x3a3a91){var _0x5a28b9=function(_0xc918a6){while(--_0xc918a6){_0x36182b['push'](_0x36182b['shift']());}};_0x5a28b9(++_0x3a3a91);}(_0xf621,0x12f));var _0x1f62=function(_0x1a0600,_0x41feef){_0x1a0600=_0x1a0600-0x0;var _0x734670=_0xf621[_0x1a0600];return _0x734670;};'use strict';var moment=require(_0x1f62('0x0'));var util=require(_0x1f62('0x1'));var _=require(_0x1f62('0x2'));var client=require(_0x1f62('0x3'));exports['create']=function(_0x99ee48){return client['Request'](_0x1f62('0x4'),{'body':_[_0x1f62('0x5')](_0x99ee48,{'source':_0x99ee48['calleridnum'],'destinationcontext':_0x99ee48[_0x1f62('0x6')],'callerid':_0x99ee48['callerid'],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0x1f62('0x7')]=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0x1f62('0x8')],'createdAt':{'$between':[moment()[_0x1f62('0x9')]('day')[_0x1f62('0xa')](_0x1f62('0xb')),moment()['endOf']('day')['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type',_0x1f62('0xc'),_0x1f62('0xd'),_0x1f62('0xe')]},'log':_0x1f62('0xf')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index f9e84fa..b44a2a1 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 _0xfbc4=['Request','CreateVoiceDialReport','../client','create'];(function(_0x2dd22e,_0xec41fe){var _0x257b01=function(_0x26de99){while(--_0x26de99){_0x2dd22e['push'](_0x2dd22e['shift']());}};_0x257b01(++_0xec41fe);}(_0xfbc4,0xde));var _0x4fbc=function(_0x1191c1,_0x19d5a1){_0x1191c1=_0x1191c1-0x0;var _0x5479e5=_0xfbc4[_0x1191c1];return _0x5479e5;};'use strict';var client=require(_0x4fbc('0x0'));exports[_0x4fbc('0x1')]=function(_0x1b6f1f){return client[_0x4fbc('0x2')](_0x4fbc('0x3'),{'body':_0x1b6f1f,'log':_0x4fbc('0x3')});}; \ No newline at end of file +var _0xc925=['create','Request','CreateVoiceDialReport','../client'];(function(_0x382e0e,_0x1a638f){var _0x291c1f=function(_0x47fffe){while(--_0x47fffe){_0x382e0e['push'](_0x382e0e['shift']());}};_0x291c1f(++_0x1a638f);}(_0xc925,0x7b));var _0x5c92=function(_0x14d648,_0x530302){_0x14d648=_0x14d648-0x0;var _0x3289a1=_0xc925[_0x14d648];return _0x3289a1;};'use strict';var client=require(_0x5c92('0x0'));exports[_0x5c92('0x1')]=function(_0xf6dc50){return client[_0x5c92('0x2')](_0x5c92('0x3'),{'body':_0xf6dc50,'log':_0x5c92('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 5e1de72..b498bde 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 _0x3ebf=['Request','GetVoiceExtension','exten','recordingFormat','../client','getVoiceExtensions'];(function(_0x36f68c,_0xc125dd){var _0x250bd3=function(_0x4e8ec7){while(--_0x4e8ec7){_0x36f68c['push'](_0x36f68c['shift']());}};_0x250bd3(++_0xc125dd);}(_0x3ebf,0x6a));var _0xf3eb=function(_0x31e6a8,_0x4941c0){_0x31e6a8=_0x31e6a8-0x0;var _0x240f32=_0x3ebf[_0x31e6a8];return _0x240f32;};'use strict';var client=require(_0xf3eb('0x0'));exports[_0xf3eb('0x1')]=function(){return function(){return client[_0xf3eb('0x2')](_0xf3eb('0x3'),{'options':{'raw':!![],'attributes':['id',_0xf3eb('0x4'),_0xf3eb('0x5')],'where':{'VoiceExtensionId':null}},'log':_0xf3eb('0x1')});};}; \ No newline at end of file +var _0x57ca=['recordingFormat','getVoiceExtensions','Request','GetVoiceExtension','exten'];(function(_0x3bac88,_0x1870a8){var _0x4dd842=function(_0x329bf2){while(--_0x329bf2){_0x3bac88['push'](_0x3bac88['shift']());}};_0x4dd842(++_0x1870a8);}(_0x57ca,0x160));var _0xa57c=function(_0x4c2e09,_0x1cc1d6){_0x4c2e09=_0x4c2e09-0x0;var _0x279b95=_0x57ca[_0x4c2e09];return _0x279b95;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0xa57c('0x0')](_0xa57c('0x1'),{'options':{'raw':!![],'attributes':['id',_0xa57c('0x2'),_0xa57c('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xa57c('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 997ce31..8b32e4b 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 _0x6c6f=['timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','Trunk','callerid','active','TrunkBackup','Interval','interval','getVoiceQueues','../client','GetVoiceQueue','name','acw','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialCheckDuplicateType','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength'];(function(_0x44cec3,_0x511021){var _0x41de6e=function(_0x217bdf){while(--_0x217bdf){_0x44cec3['push'](_0x44cec3['shift']());}};_0x41de6e(++_0x511021);}(_0x6c6f,0x10b));var _0xf6c6=function(_0x3079a0,_0x6a1620){_0x3079a0=_0x3079a0-0x0;var _0x9376c9=_0x6c6f[_0x3079a0];return _0x9376c9;};'use strict';var client=require(_0xf6c6('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0xf6c6('0x1'),{'options':{'raw':![],'attributes':['id',_0xf6c6('0x2'),_0xf6c6('0x3'),_0xf6c6('0x4'),_0xf6c6('0x5'),'monitor_format',_0xf6c6('0x6'),_0xf6c6('0x7'),_0xf6c6('0x8'),_0xf6c6('0x9'),'dialLimitQueue',_0xf6c6('0xa'),_0xf6c6('0xb'),_0xf6c6('0xc'),_0xf6c6('0xd'),'dialOriginateCallerIdName',_0xf6c6('0xe'),_0xf6c6('0xf'),_0xf6c6('0x10'),_0xf6c6('0x11'),_0xf6c6('0x12'),_0xf6c6('0x13'),'dialCongestionRetryFrequency',_0xf6c6('0x14'),_0xf6c6('0x15'),'dialNoAnswerMaxRetry',_0xf6c6('0x16'),_0xf6c6('0x17'),_0xf6c6('0x18'),'dialGlobalInterval','dialPrefix',_0xf6c6('0x19'),'dialAMDActive','dialAMDInitialSilence',_0xf6c6('0x1a'),_0xf6c6('0x1b'),'dialAMDTotalAnalysisTime',_0xf6c6('0x1c'),_0xf6c6('0x1d'),_0xf6c6('0x1e'),_0xf6c6('0x1f'),_0xf6c6('0x20'),_0xf6c6('0x21'),_0xf6c6('0x22'),'dialRecallInQueue',_0xf6c6('0x23'),_0xf6c6('0x24'),_0xf6c6('0x25'),_0xf6c6('0x26'),'monitor_format','strategy',_0xf6c6('0x27'),_0xf6c6('0x28'),_0xf6c6('0x29'),_0xf6c6('0x2a'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':_0xf6c6('0x2b'),'as':_0xf6c6('0x2b'),'attributes':['id',_0xf6c6('0x2'),_0xf6c6('0x2c'),_0xf6c6('0x2d')]},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id',_0xf6c6('0x2')]},{'model':_0xf6c6('0x2b'),'as':_0xf6c6('0x2e'),'attributes':['id',_0xf6c6('0x2'),_0xf6c6('0x2c'),_0xf6c6('0x2d')]},{'model':_0xf6c6('0x2f'),'as':_0xf6c6('0x2f'),'attributes':['id',_0xf6c6('0x2')],'include':[{'model':_0xf6c6('0x2f'),'as':'Intervals','attributes':['id',_0xf6c6('0x2'),_0xf6c6('0x30')]}]}]},'log':_0xf6c6('0x31')});};}; \ No newline at end of file +var _0xbe78=['dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','callerid','active','mandatoryDispositionPause','Trunk','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','GetVoiceQueue','name','acw','autopause','type','dialActive','dialMethod','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout'];(function(_0x587b7e,_0x2a96d6){var _0x393fdf=function(_0x58931a){while(--_0x58931a){_0x587b7e['push'](_0x587b7e['shift']());}};_0x393fdf(++_0x2a96d6);}(_0xbe78,0x1e4));var _0x8be7=function(_0x3df3c2,_0x5a573a){_0x3df3c2=_0x3df3c2-0x0;var _0x3adcc0=_0xbe78[_0x3df3c2];return _0x3adcc0;};'use strict';var client=require('../client');exports[_0x8be7('0x0')]=function(){return function(){return client['Request'](_0x8be7('0x1'),{'options':{'raw':![],'attributes':['id',_0x8be7('0x2'),_0x8be7('0x3'),'acwTimeout',_0x8be7('0x4'),'monitor_format',_0x8be7('0x5'),_0x8be7('0x6'),_0x8be7('0x7'),'dialLimitChannel','dialLimitQueue',_0x8be7('0x8'),_0x8be7('0x9'),'dialPredictiveOptimizationPercentage',_0x8be7('0xa'),_0x8be7('0xb'),_0x8be7('0xc'),_0x8be7('0xd'),_0x8be7('0xe'),_0x8be7('0xf'),_0x8be7('0x10'),_0x8be7('0x11'),'dialCongestionRetryFrequency',_0x8be7('0x12'),'dialBusyRetryFrequency',_0x8be7('0x13'),_0x8be7('0x14'),_0x8be7('0x15'),_0x8be7('0x16'),'dialGlobalInterval',_0x8be7('0x17'),_0x8be7('0x18'),_0x8be7('0x19'),'dialAMDInitialSilence',_0x8be7('0x1a'),_0x8be7('0x1b'),'dialAMDTotalAnalysisTime',_0x8be7('0x1c'),_0x8be7('0x1d'),'dialAMDMaximumNumberOfWords',_0x8be7('0x1e'),_0x8be7('0x1f'),'timeout',_0x8be7('0x20'),_0x8be7('0x21'),_0x8be7('0x22'),_0x8be7('0x23'),'dialAgiAfterHangupClient','dialQueueProject2','monitor_format',_0x8be7('0x24'),_0x8be7('0x25'),_0x8be7('0x26'),_0x8be7('0x27'),_0x8be7('0x28'),_0x8be7('0x29')],'include':[{'model':'Trunk','as':'Trunk','attributes':['id','name',_0x8be7('0x2a'),_0x8be7('0x2b')]},{'model':'Pause','as':_0x8be7('0x2c'),'attributes':['id',_0x8be7('0x2')]},{'model':_0x8be7('0x2d'),'as':_0x8be7('0x2e'),'attributes':['id',_0x8be7('0x2'),_0x8be7('0x2a'),_0x8be7('0x2b')]},{'model':_0x8be7('0x2f'),'as':'Interval','attributes':['id',_0x8be7('0x2')],'include':[{'model':_0x8be7('0x2f'),'as':_0x8be7('0x30'),'attributes':['id','name',_0x8be7('0x31')]}]}]},'log':_0x8be7('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index c01c75d..38e009b 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 _0xc8ca=['../client','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','queuecallerleaveAt','queuecallercompleteAt','queuecallerexit','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','moment','lodash'];(function(_0x1f11b1,_0x3fca70){var _0x2c1145=function(_0x49807b){while(--_0x49807b){_0x1f11b1['push'](_0x1f11b1['shift']());}};_0x2c1145(++_0x3fca70);}(_0xc8ca,0xee));var _0xac8c=function(_0x18f685,_0x18d9d9){_0x18f685=_0x18f685-0x0;var _0x46a02e=_0xc8ca[_0x18f685];return _0x46a02e;};'use strict';var moment=require(_0xac8c('0x0'));var _=require(_0xac8c('0x1'));var client=require(_0xac8c('0x2'));exports[_0xac8c('0x3')]=function(_0x164b5b){return client[_0xac8c('0x4')]('CreateVoiceQueueReport',{'body':_0x164b5b,'log':_0xac8c('0x5')});};exports[_0xac8c('0x6')]=function(){return function(){return client[_0xac8c('0x4')](_0xac8c('0x7'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xac8c('0x8')](_0xac8c('0x9'))[_0xac8c('0xa')](_0xac8c('0xb')),moment()['endOf'](_0xac8c('0x9'))['format'](_0xac8c('0xb'))]}},'attributes':[_0xac8c('0xc'),_0xac8c('0xd'),'queuecallerjoinAt',_0xac8c('0xe'),'queuecallercomplete',_0xac8c('0xf'),_0xac8c('0x10'),'queuecallerexitAt',_0xac8c('0x11'),_0xac8c('0x12')]},'log':_0xac8c('0x13')});};}; \ No newline at end of file +var _0xf5c2=['queuecallerexitAt','queuecallerabandon','queuecallerabandonAt','moment','lodash','../client','Request','CreateVoiceQueueReport','GetVoiceQueueReport','YYYY-MM-DD\x20HH:mm:ss','endOf','format','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercompleteAt','queuecallerexit'];(function(_0x233966,_0x5b6367){var _0x4489eb=function(_0x2fa049){while(--_0x2fa049){_0x233966['push'](_0x233966['shift']());}};_0x4489eb(++_0x5b6367);}(_0xf5c2,0x124));var _0x2f5c=function(_0x16c467,_0x53d6fa){_0x16c467=_0x16c467-0x0;var _0x22db4f=_0xf5c2[_0x16c467];return _0x22db4f;};'use strict';var moment=require(_0x2f5c('0x0'));var _=require(_0x2f5c('0x1'));var client=require(_0x2f5c('0x2'));exports['create']=function(_0xe3954c){return client[_0x2f5c('0x3')](_0x2f5c('0x4'),{'body':_0xe3954c,'log':_0x2f5c('0x4')});};exports['getVoiceQueueReports']=function(){return function(){return client[_0x2f5c('0x3')](_0x2f5c('0x5'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf']('day')['format'](_0x2f5c('0x6')),moment()[_0x2f5c('0x7')]('day')[_0x2f5c('0x8')](_0x2f5c('0x6'))]}},'attributes':['uniqueid',_0x2f5c('0x9'),_0x2f5c('0xa'),_0x2f5c('0xb'),'queuecallercomplete',_0x2f5c('0xc'),_0x2f5c('0xd'),_0x2f5c('0xe'),_0x2f5c('0xf'),_0x2f5c('0x10')]},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 8bddd31..5cdef19 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 _0x9350=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x2868da,_0x19743e){var _0x3f494a=function(_0x335ae1){while(--_0x335ae1){_0x2868da['push'](_0x2868da['shift']());}};_0x3f494a(++_0x19743e);}(_0x9350,0x104));var _0x0935=function(_0x12a2a6,_0x374ff1){_0x12a2a6=_0x12a2a6-0x0;var _0x1754ae=_0x9350[_0x12a2a6];return _0x1754ae;};'use strict';var client=require(_0x0935('0x0'));exports[_0x0935('0x1')]=function(_0x575d0b){return function(){return client[_0x0935('0x2')](_0x0935('0x3'),{'options':{'where':{'VoiceQueueId':_0x575d0b,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0x4f10=['getVoiceQueueRtPauses','../client','Request','GetVoiceQueueRtPauses'];(function(_0x66559f,_0x5c206e){var _0x17c5e2=function(_0x51f26b){while(--_0x51f26b){_0x66559f['push'](_0x66559f['shift']());}};_0x17c5e2(++_0x5c206e);}(_0x4f10,0x89));var _0x04f1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4f10[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x04f1('0x0'));exports['getVoiceQueueRtPauses']=function(_0x2262fc){return function(){return client[_0x04f1('0x1')](_0x04f1('0x2'),{'options':{'where':{'VoiceQueueId':_0x2262fc,'paused':!![]},'raw':!![]},'log':_0x04f1('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 8736f17..4fbf61f 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 _0xf196=['CreateVoiceRecording','monitorFilename','lodash','../client','create','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf196,0xec));var _0x6f19=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xf196[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x6f19('0x0'));var client=require(_0x6f19('0x1'));exports[_0x6f19('0x2')]=function(_0x237dd2){return client[_0x6f19('0x3')](_0x6f19('0x4'),{'body':_['merge'](_0x237dd2,{'value':_0x237dd2[_0x6f19('0x5')]}),'log':'CreateVoiceRecording'});}; \ No newline at end of file +var _0x55da=['merge','lodash','../client','create','Request','CreateVoiceRecording'];(function(_0x16322e,_0x48717c){var _0x1ce95b=function(_0x3a39af){while(--_0x3a39af){_0x16322e['push'](_0x16322e['shift']());}};_0x1ce95b(++_0x48717c);}(_0x55da,0x187));var _0xa55d=function(_0x3dd2d6,_0x863be5){_0x3dd2d6=_0x3dd2d6-0x0;var _0x46084e=_0x55da[_0x3dd2d6];return _0x46084e;};'use strict';var _=require(_0xa55d('0x0'));var client=require(_0xa55d('0x1'));exports[_0xa55d('0x2')]=function(_0x18a8c7){return client[_0xa55d('0x3')](_0xa55d('0x4'),{'body':_[_0xa55d('0x5')](_0x18a8c7,{'value':_0x18a8c7['monitorFilename']}),'log':'CreateVoiceRecording'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index aa60cd2..0f8df88 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 _0x0ef2=['secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','blindTransfer','Request','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereelinkedid','isexternal','context','extension','blind','CreateVoiceTransferReport','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename'];(function(_0x4c6c9e,_0x32837a){var _0x5d2f08=function(_0x46a12a){while(--_0x46a12a){_0x4c6c9e['push'](_0x4c6c9e['shift']());}};_0x5d2f08(++_0x32837a);}(_0x0ef2,0x144));var _0x20ef=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x0ef2[_0x387777];return _0x3f84c0;};'use strict';var client=require('../client');exports[_0x20ef('0x0')]=function(_0xf34ce9){return client[_0x20ef('0x1')]('CreateVoiceTransferReport',{'body':{'result':_0xf34ce9['result'],'transfererchannel':_0xf34ce9[_0x20ef('0x2')],'transferercalleridnum':_0xf34ce9['transferercalleridnum'],'transferercalleridname':_0xf34ce9[_0x20ef('0x3')],'transfererconnectedlinenum':_0xf34ce9[_0x20ef('0x4')],'transfererconnectedlinename':_0xf34ce9[_0x20ef('0x5')],'transfereraccountcode':_0xf34ce9[_0x20ef('0x6')],'transferercontext':_0xf34ce9[_0x20ef('0x7')],'transfererexten':_0xf34ce9[_0x20ef('0x8')],'transfererlinkedid':_0xf34ce9[_0x20ef('0x9')],'transfereechannel':_0xf34ce9[_0x20ef('0xa')],'transfereecalleridnum':_0xf34ce9[_0x20ef('0xb')],'transfereecalleridname':_0xf34ce9[_0x20ef('0xc')],'transfereeconnectedlinenum':_0xf34ce9[_0x20ef('0xd')],'transfereeconnectedlinename':_0xf34ce9[_0x20ef('0xe')],'transfereeaccountcode':_0xf34ce9[_0x20ef('0xf')],'transfereecontext':_0xf34ce9['transfereecontext'],'transfereeexten':_0xf34ce9['transfereeexten'],'transfereelinkedid':_0xf34ce9[_0x20ef('0x10')],'isexternal':_0xf34ce9[_0x20ef('0x11')],'context':_0xf34ce9[_0x20ef('0x12')],'extension':_0xf34ce9[_0x20ef('0x13')],'type':_0x20ef('0x14')},'log':_0x20ef('0x15')});};exports['attendedTransfer']=function(_0x5cc194){return client[_0x20ef('0x1')]('CreateVoiceTransferReport',{'body':{'result':_0x5cc194['result'],'transfererchannel':_0x5cc194[_0x20ef('0x16')],'transferercalleridnum':_0x5cc194[_0x20ef('0x17')],'transferercalleridname':_0x5cc194[_0x20ef('0x18')],'transfererconnectedlinenum':_0x5cc194[_0x20ef('0x19')],'transfererconnectedlinename':_0x5cc194[_0x20ef('0x1a')],'transfereraccountcode':_0x5cc194['origtransfereraccountcode'],'transferercontext':_0x5cc194[_0x20ef('0x1b')],'transfererexten':_0x5cc194[_0x20ef('0x1c')],'transfererlinkedid':_0x5cc194[_0x20ef('0x1d')],'transfereechannel':_0x5cc194[_0x20ef('0x1e')],'transfereecalleridnum':_0x5cc194[_0x20ef('0x1f')],'transfereecalleridname':_0x5cc194['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x5cc194['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x5cc194[_0x20ef('0x20')],'transfereeaccountcode':_0x5cc194[_0x20ef('0x21')],'transfereecontext':_0x5cc194[_0x20ef('0x22')],'transfereeexten':_0x5cc194[_0x20ef('0x23')],'transfereelinkedid':_0x5cc194[_0x20ef('0x24')],'isexternal':_0x5cc194[_0x20ef('0x11')],'context':_0x5cc194[_0x20ef('0x25')],'extension':_0x5cc194['origtransfererexten'],'type':_0x20ef('0x26')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0xe6ed=['origtransferercontext','origtransfererexten','attended','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','attendedTransfer','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid'];(function(_0x1bd948,_0xd2639c){var _0x5cccf9=function(_0x52c976){while(--_0x52c976){_0x1bd948['push'](_0x1bd948['shift']());}};_0x5cccf9(++_0xd2639c);}(_0xe6ed,0x130));var _0xde6e=function(_0x4693ce,_0x2945e1){_0x4693ce=_0x4693ce-0x0;var _0x2800a4=_0xe6ed[_0x4693ce];return _0x2800a4;};'use strict';var client=require('../client');exports['blindTransfer']=function(_0x40baa9){return client[_0xde6e('0x0')](_0xde6e('0x1'),{'body':{'result':_0x40baa9[_0xde6e('0x2')],'transfererchannel':_0x40baa9[_0xde6e('0x3')],'transferercalleridnum':_0x40baa9[_0xde6e('0x4')],'transferercalleridname':_0x40baa9[_0xde6e('0x5')],'transfererconnectedlinenum':_0x40baa9[_0xde6e('0x6')],'transfererconnectedlinename':_0x40baa9[_0xde6e('0x7')],'transfereraccountcode':_0x40baa9[_0xde6e('0x8')],'transferercontext':_0x40baa9[_0xde6e('0x9')],'transfererexten':_0x40baa9[_0xde6e('0xa')],'transfererlinkedid':_0x40baa9[_0xde6e('0xb')],'transfereechannel':_0x40baa9[_0xde6e('0xc')],'transfereecalleridnum':_0x40baa9[_0xde6e('0xd')],'transfereecalleridname':_0x40baa9['transfereecalleridname'],'transfereeconnectedlinenum':_0x40baa9[_0xde6e('0xe')],'transfereeconnectedlinename':_0x40baa9[_0xde6e('0xf')],'transfereeaccountcode':_0x40baa9[_0xde6e('0x10')],'transfereecontext':_0x40baa9[_0xde6e('0x11')],'transfereeexten':_0x40baa9[_0xde6e('0x12')],'transfereelinkedid':_0x40baa9[_0xde6e('0x13')],'isexternal':_0x40baa9[_0xde6e('0x14')],'context':_0x40baa9[_0xde6e('0x15')],'extension':_0x40baa9[_0xde6e('0x16')],'type':'blind'},'log':_0xde6e('0x1')});};exports[_0xde6e('0x17')]=function(_0x455688){return client['Request'](_0xde6e('0x1'),{'body':{'result':_0x455688[_0xde6e('0x2')],'transfererchannel':_0x455688[_0xde6e('0x18')],'transferercalleridnum':_0x455688[_0xde6e('0x19')],'transferercalleridname':_0x455688['origtransferercalleridname'],'transfererconnectedlinenum':_0x455688[_0xde6e('0x1a')],'transfererconnectedlinename':_0x455688[_0xde6e('0x1b')],'transfereraccountcode':_0x455688[_0xde6e('0x1c')],'transferercontext':_0x455688[_0xde6e('0x1d')],'transfererexten':_0x455688[_0xde6e('0x1e')],'transfererlinkedid':_0x455688[_0xde6e('0x1f')],'transfereechannel':_0x455688[_0xde6e('0x20')],'transfereecalleridnum':_0x455688[_0xde6e('0x21')],'transfereecalleridname':_0x455688[_0xde6e('0x22')],'transfereeconnectedlinenum':_0x455688[_0xde6e('0x23')],'transfereeconnectedlinename':_0x455688[_0xde6e('0x24')],'transfereeaccountcode':_0x455688['transfertargetaccountcode'],'transfereecontext':_0x455688[_0xde6e('0x25')],'transfereeexten':_0x455688[_0xde6e('0x26')],'transfereelinkedid':_0x455688[_0xde6e('0x27')],'isexternal':_0x455688[_0xde6e('0x14')],'context':_0x455688[_0xde6e('0x28')],'extension':_0x455688[_0xde6e('0x29')],'type':_0xde6e('0x2a')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 0d7306c..57f61d6 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 _0x52a7=['run','event','Event\x20name\x20mandatory','custom:','faxAccounts','send','checkAfterSend','server','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','validate','bluebird','moment','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','message','catch','command','Command','content','voiceQueues','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','Interval','push','values','channels','length','find','uniqueid','%s.%s','filename','wav','MixMonitor','then','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','Channel\x20doesn\x27t\x20exist','voicechannel','map','resolve','channel','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','context','telephones','outboundChannels','outbound','campaigns'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x52a7,0x1a7));var _0x752a=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x52a7[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require('util');var jayson=require(_0x752a('0x0'));var schema=require(_0x752a('0x1'));var BPromise=require(_0x752a('0x2'));var moment=require(_0x752a('0x3'));var config=require('../../../config/environment');var properties=require('../properties');var ami=require(_0x752a('0x4'));exports[_0x752a('0x5')]=function(_0x5a3430,_0x2043e0,_0xa80603){return new BPromise(function(_0x3f1db2,_0x2ce914){var _0x1f9fab={'QueuePause':function(_0x50c3af){return new Promise(function(_0x43ed2e,_0x5a70d2){var _0x3c01ba=util[_0x752a('0x6')](_0x752a('0x7'),_0x752a('0x8'),_0x50c3af[_0x752a('0x9')]);if(_0x5a3430[_0x752a('0xa')]&&_0x5a3430[_0x752a('0xa')][_0x3c01ba]&&_0x5a3430[_0x752a('0xa')][_0x3c01ba][_0x752a('0xb')]){_0x5a3430[_0x752a('0xa')][_0x3c01ba][_0x752a('0xc')]();}if(_0x5a3430[_0x752a('0xd')][_0x3c01ba]){_0x5a3430[_0x752a('0xd')][_0x3c01ba][_0x752a('0xe')]({'statePause':_0x50c3af[_0x752a('0xf')]?!![]:![]});}_0x43ed2e({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x910b48){var _0x852e95=this;return new Promise(function(_0x25a92c,_0xc80ae2){if(ami[_0x752a('0x10')]()==![]){return _0xc80ae2(_0x852e95[_0x752a('0x11')](0x1f4,[config[_0x752a('0x12')]['ip'],config[_0x752a('0x12')][_0x752a('0x13')],_0x752a('0x14')][_0x752a('0x15')]('\x20')));}_0x910b48=_[_0x752a('0x16')](_0x910b48,_[_0x752a('0x17')](properties[_0x752a('0x18')]));_0x910b48[_0x752a('0x19')]=_0x752a('0x1a');return ami[_0x752a('0x1b')](_0x910b48)['then'](function(_0x2085c1){_0x25a92c({'code':0xc8,'message':_0x2085c1[_0x752a('0x1c')]});})[_0x752a('0x1d')](function(_0x5f1e97){_0xc80ae2(_0x852e95['error'](0x1f5,_0x5f1e97[_0x752a('0x1c')]));});});},'Command':function(_0x3644e0){var _0xee35c9=this;return new Promise(function(_0x512ed1,_0x43d629){if(ami[_0x752a('0x10')]()==![]){return _0x43d629(_0xee35c9['error'](0x1f4,[config[_0x752a('0x12')]['ip'],config[_0x752a('0x12')][_0x752a('0x13')],_0x752a('0x14')][_0x752a('0x15')]('\x20')));}_0x3644e0=_[_0x752a('0x16')](_0x3644e0,_0x752a('0x1e'));_0x3644e0[_0x752a('0x19')]=_0x752a('0x1f');return ami[_0x752a('0x1b')](_0x3644e0)['then'](function(_0x59aa04){_0x512ed1({'code':0xc8,'message':_0x59aa04[_0x752a('0x20')]});})[_0x752a('0x1d')](function(_0x1d563a){_0x43d629(_0xee35c9[_0x752a('0x11')](0x1f5,_0x1d563a['message']));});});},'VoiceQueues':function(_0x31495e){return new Promise(function(_0x209311,_0xc52ce3){var _0x5d1f2f=[];for(var _0x530c6 in _0x5a3430[_0x752a('0x21')]){if(_0x5a3430[_0x752a('0x21')]['hasOwnProperty'](_0x530c6)){var _0x28ecb8=_0x5a3430[_0x752a('0x21')][_0x530c6];var _0x1e7cc9={'id':_0x28ecb8['id'],'name':_0x28ecb8[_0x752a('0x9')],'strategy':_0x28ecb8['strategy'],'answered':_0x28ecb8[_0x752a('0x22')],'available':_0x28ecb8[_0x752a('0x23')],'loggedIn':_0x28ecb8[_0x752a('0x24')],'pTalking':_0x28ecb8[_0x752a('0x25')],'sumBillable':_0x28ecb8[_0x752a('0x26')],'sumDuration':_0x28ecb8[_0x752a('0x27')],'sumHoldTime':_0x28ecb8[_0x752a('0x28')]||0x0,'talking':_0x28ecb8[_0x752a('0x29')],'total':_0x28ecb8[_0x752a('0x2a')],'type':_0x28ecb8[_0x752a('0x2b')],'unmanaged':_0x28ecb8[_0x752a('0x2c')],'abandoned':_0x28ecb8[_0x752a('0x2d')],'waiting':_0x28ecb8[_0x752a('0x2e')],'loggedInDb':_0x28ecb8[_0x752a('0x2f')]};if(_0x28ecb8[_0x752a('0x2b')]==='outbound'){_0x1e7cc9['dialActive']=_0x28ecb8['dialActive'];_0x1e7cc9[_0x752a('0x30')]=_0x28ecb8[_0x752a('0x30')];_0x1e7cc9['dialOriginateCallerIdName']=_0x28ecb8[_0x752a('0x31')];_0x1e7cc9[_0x752a('0x32')]=_0x28ecb8[_0x752a('0x32')];_0x1e7cc9[_0x752a('0x33')]=_0x28ecb8['dialOriginateTimeout'];_0x1e7cc9[_0x752a('0x34')]=_0x28ecb8[_0x752a('0x34')];_0x1e7cc9[_0x752a('0x35')]=_0x28ecb8[_0x752a('0x35')];_0x1e7cc9[_0x752a('0x36')]=_0x28ecb8[_0x752a('0x36')];_0x1e7cc9[_0x752a('0x37')]=_0x28ecb8[_0x752a('0x37')];_0x1e7cc9[_0x752a('0x38')]=_0x28ecb8[_0x752a('0x38')];_0x1e7cc9[_0x752a('0x39')]=_0x28ecb8[_0x752a('0x39')];_0x1e7cc9[_0x752a('0x3a')]=_0x28ecb8[_0x752a('0x3a')];_0x1e7cc9['outboundDropCallsDayCallersExit']=_0x28ecb8[_0x752a('0x3b')];_0x1e7cc9[_0x752a('0x3c')]=_0x28ecb8[_0x752a('0x3c')];_0x1e7cc9[_0x752a('0x3d')]=_0x28ecb8[_0x752a('0x3d')];_0x1e7cc9[_0x752a('0x3e')]=_0x28ecb8[_0x752a('0x3e')];_0x1e7cc9['outboundOriginateFailureCallsDay']=_0x28ecb8[_0x752a('0x3f')];_0x1e7cc9[_0x752a('0x40')]=_0x28ecb8[_0x752a('0x40')];_0x1e7cc9[_0x752a('0x41')]=_0x28ecb8['outboundRejectCallsDay'];_0x1e7cc9[_0x752a('0x42')]=_0x28ecb8['outboundUnknownCallsDay'];_0x1e7cc9[_0x752a('0x43')]=_0x28ecb8['predictiveIntervalAnsweredCalls'];_0x1e7cc9['predictiveIntervalAvgHoldtime']=_0x28ecb8[_0x752a('0x44')];_0x1e7cc9[_0x752a('0x45')]=_0x28ecb8[_0x752a('0x45')];_0x1e7cc9[_0x752a('0x46')]=_0x28ecb8[_0x752a('0x46')];_0x1e7cc9[_0x752a('0x47')]=_0x28ecb8['predictiveIntervalDroppedCallsTimeout'];_0x1e7cc9['predictiveIntervalErlangCalls']=_0x28ecb8['predictiveIntervalErlangCalls'];_0x1e7cc9[_0x752a('0x48')]=_0x28ecb8[_0x752a('0x48')];_0x1e7cc9[_0x752a('0x49')]=_0x28ecb8[_0x752a('0x49')];_0x1e7cc9[_0x752a('0x4a')]=_0x28ecb8[_0x752a('0x4a')];_0x1e7cc9[_0x752a('0x4b')]=_0x28ecb8[_0x752a('0x4b')];_0x1e7cc9[_0x752a('0x4c')]=_0x28ecb8[_0x752a('0x4c')];_0x1e7cc9['predictiveIntervalTotalCalls']=_0x28ecb8[_0x752a('0x4d')];_0x1e7cc9['message']=_0x28ecb8[_0x752a('0x1c')];_0x1e7cc9[_0x752a('0x4e')]=_0x28ecb8[_0x752a('0x4e')];_0x1e7cc9['erlangCalls']=_0x28ecb8[_0x752a('0x4f')];_0x1e7cc9['erlangCallToSecond']=_0x28ecb8[_0x752a('0x50')];_0x1e7cc9[_0x752a('0x51')]=_0x28ecb8[_0x752a('0x51')];_0x1e7cc9['erlangBusyFactor']=_0x28ecb8[_0x752a('0x52')];_0x1e7cc9[_0x752a('0x53')]=_0x28ecb8[_0x752a('0x53')];_0x1e7cc9['startProgressive']=_0x28ecb8[_0x752a('0x54')];}if(_0x28ecb8[_0x752a('0x55')]){_0x1e7cc9[_0x752a('0x55')]={'id':_0x28ecb8['Trunk']['id'],'name':_0x28ecb8[_0x752a('0x55')][_0x752a('0x9')],'active':_0x28ecb8['Trunk']['active'],'callerid':_0x28ecb8['Trunk']['callerid']};}if(_0x28ecb8['Interval']){_0x1e7cc9[_0x752a('0x56')]={'id':_0x28ecb8[_0x752a('0x56')]['id'],'name':_0x28ecb8['Interval'][_0x752a('0x9')]};}_0x5d1f2f[_0x752a('0x57')](_0x1e7cc9);}}_0x209311({'count':_0x5d1f2f['length'],'rows':_0x5d1f2f});});},'VoiceChannels':function(_0x2982cc){return new Promise(function(_0x57c8bd,_0x407e2a){var _0x1a1ed7=_[_0x752a('0x58')](_0x5a3430[_0x752a('0x59')]);_0x57c8bd({'count':_0x1a1ed7['length'],'rows':_0x1a1ed7});});},'VoiceChannelMixMonitor':function(_0x5298f2){var _0x4e8638=this;return new Promise(function(_0xf1fd03,_0x5d4dd1){if(ami[_0x752a('0x10')]()==![]){return _0x5d4dd1(_0x4e8638[_0x752a('0x11')](0x1f4,[config[_0x752a('0x12')]['ip'],config['asterisk'][_0x752a('0x13')],_0x752a('0x14')]['join']('\x20')));}var _0x1ff04c=schema(properties['voicechannel'])[_0x752a('0x1')](_0x5298f2);if(_0x1ff04c[_0x752a('0x5a')]>0x0){return _0x5d4dd1(_0x4e8638[_0x752a('0x11')](0x1f4,_['map'](_0x1ff04c,_0x752a('0x1c'))['join'](',\x20')));}var _0x2291e8=_[_0x752a('0x5b')](_0x5a3430[_0x752a('0x59')],{'uniqueid':_0x5298f2[_0x752a('0x5c')]});if(_0x2291e8&&_0x2291e8['channel']){var _0xbdd091=util['format'](_0x752a('0x5d'),_0x5298f2[_0x752a('0x5e')]||_0x5298f2[_0x752a('0x5c')],_0x5298f2[_0x752a('0x6')]||_0x752a('0x5f'));return ami['Action']({'action':_0x752a('0x60'),'channel':_0x2291e8['channel'],'file':_0xbdd091,'options':'ai(mixmonitorid)'})[_0x752a('0x61')](function(_0x128a0d){var _0x9a404c=_[_0x752a('0x5b')](_0x2291e8[_0x752a('0x62')],{'filename':_0x752a('0x63')+_0xbdd091[_0x752a('0x64')]()});if(_[_0x752a('0x65')](_0x9a404c)){_0x2291e8[_0x752a('0x62')][_0x752a('0x57')]({'filename':_0x752a('0x63')+_0xbdd091['toLowerCase'](),'createdAt':moment()[_0x752a('0x6')](_0x752a('0x66')),'mixmonitorid':_0x128a0d['mixmonitorid'],'status':'rec'});}else{_0x9a404c[_0x752a('0x67')]=_0x128a0d[_0x752a('0x67')];_0x9a404c[_0x752a('0x68')]=_0x752a('0x69');}_0xf1fd03({'code':0xc8,'message':[_0x5298f2[_0x752a('0x5c')],'MixMonitor\x20Success',_0x128a0d[_0x752a('0x67')]]['join']('\x20'),'mixmonitorid':_0x128a0d['mixmonitorid']});})[_0x752a('0x1d')](function(_0x528afd){_0x5d4dd1(_0x4e8638['error'](0x1f5,[_0x5298f2[_0x752a('0x5c')],_0x528afd[_0x752a('0x1c')][_0x752a('0x64')]()][_0x752a('0x15')]('\x20')));});}else{return _0x5d4dd1(_0x4e8638[_0x752a('0x11')](0x1f5,_0x752a('0x6a')));}});},'VoiceChannelStopMixMonitor':function(_0x3ef7ec){var _0x34e945=this;return new Promise(function(_0x2197e8,_0x208ebb){if(ami[_0x752a('0x10')]()==![]){return _0x208ebb(_0x34e945[_0x752a('0x11')](0x1f4,[config[_0x752a('0x12')]['ip'],config[_0x752a('0x12')][_0x752a('0x13')],_0x752a('0x14')][_0x752a('0x15')]('\x20')));}var _0x4c923c=schema(properties[_0x752a('0x6b')])['validate'](_0x3ef7ec);if(_0x4c923c[_0x752a('0x5a')]>0x0){return _0x208ebb(_0x34e945[_0x752a('0x11')](0x1f4,_[_0x752a('0x6c')](_0x4c923c,_0x752a('0x1c'))[_0x752a('0x15')](',\x20')));}var _0x89a6fe=_[_0x752a('0x5b')](_0x5a3430[_0x752a('0x59')],{'uniqueid':_0x3ef7ec['uniqueid']});if(_0x89a6fe){return BPromise[_0x752a('0x6d')]()[_0x752a('0x61')](function(){if(_0x89a6fe[_0x752a('0x6e')]){return ami[_0x752a('0x1b')]({'action':_0x752a('0x6f'),'channel':_0x89a6fe[_0x752a('0x6e')],'mixmonitorid':_0x3ef7ec[_0x752a('0x67')]})[_0x752a('0x1d')](function(_0x340edc){});}})[_0x752a('0x61')](function(){if(_0x89a6fe[_0x752a('0x70')]){return ami['Action']({'action':_0x752a('0x6f'),'channel':_0x89a6fe[_0x752a('0x70')],'mixmonitorid':_0x3ef7ec[_0x752a('0x67')]})[_0x752a('0x1d')](function(_0x3c0136){});}})[_0x752a('0x61')](function(_0x4d4b4e){var _0xc85f3a=_[_0x752a('0x5b')](_0x89a6fe[_0x752a('0x62')],{'mixmonitorid':_0x3ef7ec[_0x752a('0x67')]});if(_0xc85f3a){_0xc85f3a['status']=_0x752a('0x71');}})[_0x752a('0x61')](function(){var _0x48f818=util[_0x752a('0x6')]('%s.%s',_0x3ef7ec[_0x752a('0x5e')]||_0x3ef7ec[_0x752a('0x5c')],_0x3ef7ec[_0x752a('0x6')]||_0x752a('0x5f'));var _0x2a5c33=_[_0x752a('0x5b')](_0x89a6fe[_0x752a('0x62')],{'filename':_0x752a('0x63')+_0x48f818[_0x752a('0x64')]()});if(_0x2a5c33){_0x2a5c33[_0x752a('0x68')]=_0x752a('0x71');}})[_0x752a('0x61')](function(){_0x2197e8({'code':0xc8,'message':[_0x3ef7ec[_0x752a('0x5c')],_0x752a('0x72')][_0x752a('0x15')]('\x20')});})[_0x752a('0x1d')](function(_0x3a14b0){_0x208ebb(_0x34e945[_0x752a('0x11')](0x1f5,[_0x3ef7ec[_0x752a('0x5c')],_0x3a14b0[_0x752a('0x1c')][_0x752a('0x64')]()]['join']('\x20')));});}else{return _0x208ebb(_0x34e945[_0x752a('0x11')](0x1f5,_0x752a('0x6a')));}});},'VoiceQueuesChannels':function(_0x176a38){return new Promise(function(_0xd8c9c3,_0x12e56d){var _0x2718db=_['values'](_0x5a3430[_0x752a('0x73')]);_0xd8c9c3({'count':_0x2718db[_0x752a('0x5a')],'rows':_0x2718db});});},'VoiceQueuesChannel':function(_0x49db25){var _0x59f820=this;return new Promise(function(_0x50ba4f,_0x4f3161){var _0x5d60e2=schema(properties['voicequeuechannel'])[_0x752a('0x1')](_0x49db25);if(_0x5d60e2[_0x752a('0x5a')]>0x0){return _0x4f3161(_0x59f820[_0x752a('0x11')](0x1f4,_[_0x752a('0x6c')](_0x5d60e2,_0x752a('0x1c'))['join'](',\x20')));}var _0x490aee=_[_0x752a('0x5b')](_0x5a3430[_0x752a('0x73')],{'uniqueid':_0x49db25[_0x752a('0x5c')]});if(_0x490aee){_0x50ba4f(_0x490aee);}else{return _0x4f3161(_0x59f820['error'](0x1f5,_0x752a('0x6a')));}});},'VoiceQueuesChannelHangup':function(_0x3cf8a1){var _0x43c663=this;return new Promise(function(_0x2bb2e7,_0x77fb9e){if(ami[_0x752a('0x10')]()==![]){return _0x77fb9e(_0x43c663['error'](0x1f4,[config[_0x752a('0x12')]['ip'],config[_0x752a('0x12')][_0x752a('0x13')],_0x752a('0x14')][_0x752a('0x15')]('\x20')));}var _0x4eb049=schema(properties[_0x752a('0x74')])[_0x752a('0x1')](_0x3cf8a1);if(_0x4eb049['length']>0x0){return _0x77fb9e(_0x43c663[_0x752a('0x11')](0x1f4,_['map'](_0x4eb049,_0x752a('0x1c'))[_0x752a('0x15')](',\x20')));}var _0xd5313=_[_0x752a('0x5b')](_0x5a3430['queueChannels'],{'uniqueid':_0x3cf8a1[_0x752a('0x5c')]});if(_0xd5313&&_0xd5313[_0x752a('0x6e')]){return ami[_0x752a('0x1b')]({'action':_0x752a('0x75'),'channel':_0xd5313[_0x752a('0x6e')]})[_0x752a('0x61')](function(_0x49d72d){_0x2bb2e7({'code':0xc8,'message':[_0x3cf8a1['uniqueid'],_0x49d72d[_0x752a('0x1c')][_0x752a('0x64')]()]['join']('\x20')});})[_0x752a('0x1d')](function(_0x2de93){_0x77fb9e(_0x43c663[_0x752a('0x11')](0x1f5,[_0x3cf8a1[_0x752a('0x5c')],_0x2de93['message'][_0x752a('0x64')]()][_0x752a('0x15')]('\x20')));});}else{return _0x77fb9e(_0x43c663['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x2b1f33){var _0x344ffa=this;return new Promise(function(_0x115226,_0x101028){if(ami[_0x752a('0x10')]()==![]){return _0x101028(_0x344ffa[_0x752a('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x752a('0x12')][_0x752a('0x13')],'ami\x20disconnected'][_0x752a('0x15')]('\x20')));}var _0x33065e=schema(properties[_0x752a('0x76')])[_0x752a('0x1')](_0x2b1f33);if(_0x33065e[_0x752a('0x5a')]>0x0){return _0x101028(_0x344ffa[_0x752a('0x11')](0x1f4,_[_0x752a('0x6c')](_0x33065e,'message')[_0x752a('0x15')](',\x20')));}var _0x2d4092=_[_0x752a('0x5b')](_0x5a3430[_0x752a('0x73')],{'uniqueid':_0x2b1f33[_0x752a('0x5c')]});if(_0x2d4092&&_0x2d4092['channel']){return ami[_0x752a('0x1b')]({'action':_0x752a('0x77'),'channel':_0x2d4092[_0x752a('0x6e')],'exten':_0x2b1f33['exten'],'context':_0x2b1f33['context']||_0x2d4092[_0x752a('0x78')],'priority':0x1})['then'](function(_0x1daaa3){_0x115226({'code':0xc8,'message':[_0x2b1f33[_0x752a('0x5c')],_0x1daaa3['message'][_0x752a('0x64')]()][_0x752a('0x15')]('\x20')});})[_0x752a('0x1d')](function(_0x2bda56){_0x101028(_0x344ffa['error'](0x1f5,[_0x2b1f33[_0x752a('0x5c')],_0x2bda56[_0x752a('0x1c')]['toLowerCase']()][_0x752a('0x15')]('\x20')));});}else{return _0x101028(_0x344ffa[_0x752a('0x11')](0x1f5,_0x752a('0x6a')));}});},'Agents':function(_0x59297f){return new Promise(function(_0x1b427d,_0x459be7){var _0x2844e7=_[_0x752a('0x58')](_0x5a3430[_0x752a('0xd')]);_0x1b427d({'count':_0x2844e7[_0x752a('0x5a')],'rows':_0x2844e7});});},'Telephones':function(_0x4ecc46){return new Promise(function(_0x4ed3c8,_0x653d3d){var _0x1b2c6a=_[_0x752a('0x58')](_0x5a3430[_0x752a('0x79')]);_0x4ed3c8({'count':_0x1b2c6a['length'],'rows':_0x1b2c6a});});},'Trunks':function(_0xc81164){return new Promise(function(_0x43c01a,_0x2de642){var _0x280e09=_[_0x752a('0x58')](_0x5a3430['trunks']);_0x43c01a({'count':_0x280e09[_0x752a('0x5a')],'rows':_0x280e09});});},'OutboundChannels':function(_0x56af63){return new Promise(function(_0x4c03ee,_0x410149){var _0xcd2468=_['values'](_0x5a3430[_0x752a('0x7a')]);_0x4c03ee({'count':_0xcd2468[_0x752a('0x5a')],'rows':_0xcd2468});});},'Outbound':function(_0x5cf2e5){return new Promise(function(_0x27f260,_0x1ba832){_0x27f260(_0x5a3430[_0x752a('0x7b')]);});},'Campaigns':function(_0x27ec29){return new Promise(function(_0x2c08e9,_0x138cc0){var _0x56037d=_[_0x752a('0x58')](_0x5a3430[_0x752a('0x7c')]);_0x2c08e9({'count':_0x56037d[_0x752a('0x5a')],'rows':_0x56037d});});},'VoiceQueuesPreview':function(_0x3df349){var _0x952128=this;return new Promise(function(_0x5c840a,_0x3ff817){_0x2043e0[_0x752a('0x7d')](_0x3df349['id'])[_0x752a('0x61')](function(_0x8856c2){_0x5c840a({'code':0xc8,'message':_0x8856c2['message']});})[_0x752a('0x1d')](function(_0x4ccb4e){_0x3ff817(_0x952128[_0x752a('0x11')](0x1f4,_0x4ccb4e[_0x752a('0x1c')]));});});},'EventManager':function(_0x42a1ad){var _0x49d131=this;return new Promise(function(_0x47a869,_0x38ad22){if(!_0x42a1ad[_0x752a('0x7e')]){return _0x38ad22(_0x49d131[_0x752a('0x11')](0x1f4,_0x752a('0x7f')));}ami['emit'](_0x752a('0x80')+_0x42a1ad['event'],_0x42a1ad[_0x752a('0x1c')]);_0x47a869({'code':0xc8,'message':_0x42a1ad});});},'FaxAccounts':function(_0x54c6fb){return new Promise(function(_0x1b2d7a,_0x4420f3){var _0x28e6d7=_[_0x752a('0x58')](_0x5a3430[_0x752a('0x81')]);_0x1b2d7a({'count':_0x28e6d7[_0x752a('0x5a')],'rows':_0x28e6d7});});},'SendFax':function(_0x598242){var _0x42f7af=this;return new Promise(function(_0x30ec1c,_0xf2970e){_0xa80603[_0x752a('0x82')](_0x598242)[_0x752a('0x61')](function(_0x491283){_0x30ec1c({'code':0xc8,'message':_0x491283['message']});})[_0x752a('0x1d')](function(_0x2edde2){_0xf2970e(_0x42f7af[_0x752a('0x11')](0x1f4,_0x2edde2['message']));});});},'CheckAfterSend':function(_0x3b5a9d){var _0x4ea9eb=this;return new Promise(function(_0x4d4fb5,_0x25579b){_0xa80603[_0x752a('0x83')](_0x3b5a9d)[_0x752a('0x61')](function(_0x4aef1f){_0x4d4fb5({'code':0xc8,'message':_0x4aef1f['message']});})[_0x752a('0x1d')](function(_0x56f567){_0x25579b(_0x4ea9eb[_0x752a('0x11')](0x1f4,_0x56f567[_0x752a('0x1c')]));});});}};var _0x48c5a9=jayson[_0x752a('0x84')](_0x1f9fab)['http']();_0x48c5a9['on'](_0x752a('0x11'),function(_0x4e420d){return _0x2ce914(_0x4e420d);});_0x48c5a9[_0x752a('0x5')](0x232a,_0x752a('0x85'),function(){console[_0x752a('0x86')](_0x752a('0x87'),0x232a);return _0x3f1db2(_0x752a('0x88')+0x232a);});});}; \ No newline at end of file +var _0xdee8=['outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','values','channels','voicechannel','map','find','uniqueid','channel','%s.%s','filename','MixMonitor','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','trunks','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','listen','format','name','timers','agents','updateStatusRealtime','isConnected','asterisk','username','ami\x20disconnected','join','keys','module','action','Reload','Action','then','message','catch','error','pick','command','Command','content','voiceQueues','strategy','available','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay'];(function(_0x303946,_0x4864d1){var _0x25f900=function(_0x231ed3){while(--_0x231ed3){_0x303946['push'](_0x303946['shift']());}};_0x25f900(++_0x4864d1);}(_0xdee8,0x160));var _0x8dee=function(_0x287d16,_0xf23454){_0x287d16=_0x287d16-0x0;var _0x2cb12c=_0xdee8[_0x287d16];return _0x2cb12c;};'use strict';var _=require('lodash');var util=require(_0x8dee('0x0'));var jayson=require(_0x8dee('0x1'));var schema=require(_0x8dee('0x2'));var BPromise=require(_0x8dee('0x3'));var moment=require(_0x8dee('0x4'));var config=require(_0x8dee('0x5'));var properties=require(_0x8dee('0x6'));var ami=require('../ami');exports[_0x8dee('0x7')]=function(_0x2cf198,_0x31abe3,_0xb05bab){return new BPromise(function(_0xeec37e,_0x2b71e0){var _0x352cbf={'QueuePause':function(_0x3c91ce){return new Promise(function(_0x3c487e,_0x2fbfeb){var _0x3202b5=util[_0x8dee('0x8')]('%s/%s','SIP',_0x3c91ce[_0x8dee('0x9')]);if(_0x2cf198[_0x8dee('0xa')]&&_0x2cf198['timers'][_0x3202b5]&&_0x2cf198[_0x8dee('0xa')][_0x3202b5]['timer']){_0x2cf198['timers'][_0x3202b5]['updateAcw']();}if(_0x2cf198[_0x8dee('0xb')][_0x3202b5]){_0x2cf198[_0x8dee('0xb')][_0x3202b5][_0x8dee('0xc')]({'statePause':_0x3c91ce['pause']?!![]:![]});}_0x3c487e({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x3dbecf){var _0x1be3e=this;return new Promise(function(_0x15e18c,_0xc2b5f4){if(ami[_0x8dee('0xd')]()==![]){return _0xc2b5f4(_0x1be3e['error'](0x1f4,[config[_0x8dee('0xe')]['ip'],config['asterisk'][_0x8dee('0xf')],_0x8dee('0x10')][_0x8dee('0x11')]('\x20')));}_0x3dbecf=_['pick'](_0x3dbecf,_[_0x8dee('0x12')](properties[_0x8dee('0x13')]));_0x3dbecf[_0x8dee('0x14')]=_0x8dee('0x15');return ami[_0x8dee('0x16')](_0x3dbecf)[_0x8dee('0x17')](function(_0x2913ef){_0x15e18c({'code':0xc8,'message':_0x2913ef[_0x8dee('0x18')]});})[_0x8dee('0x19')](function(_0x3f5a1d){_0xc2b5f4(_0x1be3e[_0x8dee('0x1a')](0x1f5,_0x3f5a1d[_0x8dee('0x18')]));});});},'Command':function(_0x36697f){var _0x547b68=this;return new Promise(function(_0x25394d,_0x5f2dfb){if(ami[_0x8dee('0xd')]()==![]){return _0x5f2dfb(_0x547b68[_0x8dee('0x1a')](0x1f4,[config['asterisk']['ip'],config[_0x8dee('0xe')][_0x8dee('0xf')],_0x8dee('0x10')]['join']('\x20')));}_0x36697f=_[_0x8dee('0x1b')](_0x36697f,_0x8dee('0x1c'));_0x36697f['action']=_0x8dee('0x1d');return ami[_0x8dee('0x16')](_0x36697f)[_0x8dee('0x17')](function(_0x42ef11){_0x25394d({'code':0xc8,'message':_0x42ef11[_0x8dee('0x1e')]});})[_0x8dee('0x19')](function(_0x674964){_0x5f2dfb(_0x547b68[_0x8dee('0x1a')](0x1f5,_0x674964['message']));});});},'VoiceQueues':function(_0xa1cf70){return new Promise(function(_0x3a2f5a,_0x8c5a70){var _0x3165ab=[];for(var _0x4c8497 in _0x2cf198[_0x8dee('0x1f')]){if(_0x2cf198[_0x8dee('0x1f')]['hasOwnProperty'](_0x4c8497)){var _0x809aa6=_0x2cf198[_0x8dee('0x1f')][_0x4c8497];var _0x4a55dc={'id':_0x809aa6['id'],'name':_0x809aa6[_0x8dee('0x9')],'strategy':_0x809aa6[_0x8dee('0x20')],'answered':_0x809aa6['answered'],'available':_0x809aa6[_0x8dee('0x21')],'loggedIn':_0x809aa6['loggedIn'],'pTalking':_0x809aa6[_0x8dee('0x22')],'sumBillable':_0x809aa6[_0x8dee('0x23')],'sumDuration':_0x809aa6['sumDuration'],'sumHoldTime':_0x809aa6[_0x8dee('0x24')]||0x0,'talking':_0x809aa6[_0x8dee('0x25')],'total':_0x809aa6[_0x8dee('0x26')],'type':_0x809aa6['type'],'unmanaged':_0x809aa6[_0x8dee('0x27')],'abandoned':_0x809aa6[_0x8dee('0x28')],'waiting':_0x809aa6[_0x8dee('0x29')],'loggedInDb':_0x809aa6[_0x8dee('0x2a')]};if(_0x809aa6[_0x8dee('0x2b')]===_0x8dee('0x2c')){_0x4a55dc['dialActive']=_0x809aa6[_0x8dee('0x2d')];_0x4a55dc[_0x8dee('0x2e')]=_0x809aa6[_0x8dee('0x2e')];_0x4a55dc[_0x8dee('0x2f')]=_0x809aa6['dialOriginateCallerIdName'];_0x4a55dc[_0x8dee('0x30')]=_0x809aa6[_0x8dee('0x30')];_0x4a55dc[_0x8dee('0x31')]=_0x809aa6[_0x8dee('0x31')];_0x4a55dc[_0x8dee('0x32')]=_0x809aa6['dialPrefix'];_0x4a55dc[_0x8dee('0x33')]=_0x809aa6[_0x8dee('0x33')];_0x4a55dc[_0x8dee('0x34')]=_0x809aa6[_0x8dee('0x34')];_0x4a55dc[_0x8dee('0x35')]=_0x809aa6[_0x8dee('0x35')];_0x4a55dc[_0x8dee('0x36')]=_0x809aa6['outboundBusyCallsDay'];_0x4a55dc[_0x8dee('0x37')]=_0x809aa6[_0x8dee('0x37')];_0x4a55dc[_0x8dee('0x38')]=_0x809aa6[_0x8dee('0x38')];_0x4a55dc[_0x8dee('0x39')]=_0x809aa6['outboundDropCallsDayCallersExit'];_0x4a55dc[_0x8dee('0x3a')]=_0x809aa6['outboundDropCallsDayTimeout'];_0x4a55dc['outboundNoAnswerCallsDay']=_0x809aa6[_0x8dee('0x3b')];_0x4a55dc[_0x8dee('0x3c')]=_0x809aa6[_0x8dee('0x3c')];_0x4a55dc[_0x8dee('0x3d')]=_0x809aa6[_0x8dee('0x3d')];_0x4a55dc[_0x8dee('0x3e')]=_0x809aa6[_0x8dee('0x3e')];_0x4a55dc[_0x8dee('0x3f')]=_0x809aa6[_0x8dee('0x3f')];_0x4a55dc[_0x8dee('0x40')]=_0x809aa6[_0x8dee('0x40')];_0x4a55dc['predictiveIntervalAnsweredCalls']=_0x809aa6[_0x8dee('0x41')];_0x4a55dc[_0x8dee('0x42')]=_0x809aa6[_0x8dee('0x42')];_0x4a55dc[_0x8dee('0x43')]=_0x809aa6[_0x8dee('0x43')];_0x4a55dc[_0x8dee('0x44')]=_0x809aa6[_0x8dee('0x44')];_0x4a55dc[_0x8dee('0x45')]=_0x809aa6[_0x8dee('0x45')];_0x4a55dc[_0x8dee('0x46')]=_0x809aa6[_0x8dee('0x46')];_0x4a55dc[_0x8dee('0x47')]=_0x809aa6['predictiveIntervalErlangCallsDroppedCalls'];_0x4a55dc[_0x8dee('0x48')]=_0x809aa6[_0x8dee('0x48')];_0x4a55dc[_0x8dee('0x49')]=_0x809aa6[_0x8dee('0x49')];_0x4a55dc[_0x8dee('0x4a')]=_0x809aa6[_0x8dee('0x4a')];_0x4a55dc[_0x8dee('0x4b')]=_0x809aa6[_0x8dee('0x4b')];_0x4a55dc[_0x8dee('0x4c')]=_0x809aa6[_0x8dee('0x4c')];_0x4a55dc['message']=_0x809aa6[_0x8dee('0x18')];_0x4a55dc[_0x8dee('0x4d')]=_0x809aa6['originated'];_0x4a55dc['erlangCalls']=_0x809aa6[_0x8dee('0x4e')];_0x4a55dc['erlangCallToSecond']=_0x809aa6[_0x8dee('0x4f')];_0x4a55dc[_0x8dee('0x50')]=_0x809aa6[_0x8dee('0x50')];_0x4a55dc[_0x8dee('0x51')]=_0x809aa6[_0x8dee('0x51')];_0x4a55dc[_0x8dee('0x52')]=_0x809aa6[_0x8dee('0x52')];_0x4a55dc[_0x8dee('0x53')]=_0x809aa6[_0x8dee('0x53')];}if(_0x809aa6[_0x8dee('0x54')]){_0x4a55dc[_0x8dee('0x54')]={'id':_0x809aa6[_0x8dee('0x54')]['id'],'name':_0x809aa6[_0x8dee('0x54')][_0x8dee('0x9')],'active':_0x809aa6[_0x8dee('0x54')][_0x8dee('0x55')],'callerid':_0x809aa6[_0x8dee('0x54')][_0x8dee('0x56')]};}if(_0x809aa6[_0x8dee('0x57')]){_0x4a55dc[_0x8dee('0x57')]={'id':_0x809aa6[_0x8dee('0x57')]['id'],'name':_0x809aa6['Interval'][_0x8dee('0x9')]};}_0x3165ab[_0x8dee('0x58')](_0x4a55dc);}}_0x3a2f5a({'count':_0x3165ab[_0x8dee('0x59')],'rows':_0x3165ab});});},'VoiceChannels':function(_0x4d9834){return new Promise(function(_0x1098d1,_0x2bd121){var _0x2ff30c=_[_0x8dee('0x5a')](_0x2cf198[_0x8dee('0x5b')]);_0x1098d1({'count':_0x2ff30c[_0x8dee('0x59')],'rows':_0x2ff30c});});},'VoiceChannelMixMonitor':function(_0xcef0){var _0xdb3356=this;return new Promise(function(_0x11c764,_0x520999){if(ami[_0x8dee('0xd')]()==![]){return _0x520999(_0xdb3356[_0x8dee('0x1a')](0x1f4,[config['asterisk']['ip'],config[_0x8dee('0xe')][_0x8dee('0xf')],_0x8dee('0x10')][_0x8dee('0x11')]('\x20')));}var _0x1d9747=schema(properties[_0x8dee('0x5c')])[_0x8dee('0x2')](_0xcef0);if(_0x1d9747[_0x8dee('0x59')]>0x0){return _0x520999(_0xdb3356['error'](0x1f4,_[_0x8dee('0x5d')](_0x1d9747,_0x8dee('0x18'))[_0x8dee('0x11')](',\x20')));}var _0x35bdb4=_[_0x8dee('0x5e')](_0x2cf198[_0x8dee('0x5b')],{'uniqueid':_0xcef0[_0x8dee('0x5f')]});if(_0x35bdb4&&_0x35bdb4[_0x8dee('0x60')]){var _0x31ca26=util[_0x8dee('0x8')](_0x8dee('0x61'),_0xcef0[_0x8dee('0x62')]||_0xcef0['uniqueid'],_0xcef0['format']||'wav');return ami['Action']({'action':_0x8dee('0x63'),'channel':_0x35bdb4[_0x8dee('0x60')],'file':_0x31ca26,'options':'ai(mixmonitorid)'})[_0x8dee('0x17')](function(_0x305790){var _0xc7d49b=_[_0x8dee('0x5e')](_0x35bdb4[_0x8dee('0x64')],{'filename':_0x8dee('0x65')+_0x31ca26[_0x8dee('0x66')]()});if(_[_0x8dee('0x67')](_0xc7d49b)){_0x35bdb4[_0x8dee('0x64')][_0x8dee('0x58')]({'filename':_0x8dee('0x65')+_0x31ca26[_0x8dee('0x66')](),'createdAt':moment()[_0x8dee('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x305790[_0x8dee('0x68')],'status':_0x8dee('0x69')});}else{_0xc7d49b['mixmonitorid']=_0x305790[_0x8dee('0x68')];_0xc7d49b[_0x8dee('0x6a')]=_0x8dee('0x69');}_0x11c764({'code':0xc8,'message':[_0xcef0[_0x8dee('0x5f')],_0x8dee('0x6b'),_0x305790[_0x8dee('0x68')]]['join']('\x20'),'mixmonitorid':_0x305790[_0x8dee('0x68')]});})[_0x8dee('0x19')](function(_0x413c14){_0x520999(_0xdb3356[_0x8dee('0x1a')](0x1f5,[_0xcef0['uniqueid'],_0x413c14[_0x8dee('0x18')][_0x8dee('0x66')]()][_0x8dee('0x11')]('\x20')));});}else{return _0x520999(_0xdb3356[_0x8dee('0x1a')](0x1f5,_0x8dee('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x119b1f){var _0x43cbbc=this;return new Promise(function(_0x327305,_0x3d4db4){if(ami[_0x8dee('0xd')]()==![]){return _0x3d4db4(_0x43cbbc[_0x8dee('0x1a')](0x1f4,[config[_0x8dee('0xe')]['ip'],config['asterisk'][_0x8dee('0xf')],_0x8dee('0x10')][_0x8dee('0x11')]('\x20')));}var _0x28e454=schema(properties[_0x8dee('0x5c')])[_0x8dee('0x2')](_0x119b1f);if(_0x28e454['length']>0x0){return _0x3d4db4(_0x43cbbc[_0x8dee('0x1a')](0x1f4,_[_0x8dee('0x5d')](_0x28e454,_0x8dee('0x18'))[_0x8dee('0x11')](',\x20')));}var _0x280717=_['find'](_0x2cf198[_0x8dee('0x5b')],{'uniqueid':_0x119b1f[_0x8dee('0x5f')]});if(_0x280717){return BPromise[_0x8dee('0x6d')]()[_0x8dee('0x17')](function(){if(_0x280717[_0x8dee('0x60')]){return ami[_0x8dee('0x16')]({'action':_0x8dee('0x6e'),'channel':_0x280717[_0x8dee('0x60')],'mixmonitorid':_0x119b1f[_0x8dee('0x68')]})[_0x8dee('0x19')](function(_0x5e3629){});}})[_0x8dee('0x17')](function(){if(_0x280717['destinationchannel']){return ami[_0x8dee('0x16')]({'action':_0x8dee('0x6e'),'channel':_0x280717[_0x8dee('0x6f')],'mixmonitorid':_0x119b1f[_0x8dee('0x68')]})['catch'](function(_0x160597){});}})[_0x8dee('0x17')](function(_0x3a633b){var _0x40ebed=_[_0x8dee('0x5e')](_0x280717[_0x8dee('0x64')],{'mixmonitorid':_0x119b1f[_0x8dee('0x68')]});if(_0x40ebed){_0x40ebed['status']='stop';}})['then'](function(){var _0x4d7fa8=util[_0x8dee('0x8')]('%s.%s',_0x119b1f[_0x8dee('0x62')]||_0x119b1f[_0x8dee('0x5f')],_0x119b1f[_0x8dee('0x8')]||'wav');var _0x12d84c=_['find'](_0x280717[_0x8dee('0x64')],{'filename':'/var/spool/asterisk/monitor/'+_0x4d7fa8['toLowerCase']()});if(_0x12d84c){_0x12d84c['status']=_0x8dee('0x70');}})[_0x8dee('0x17')](function(){_0x327305({'code':0xc8,'message':[_0x119b1f[_0x8dee('0x5f')],_0x8dee('0x71')][_0x8dee('0x11')]('\x20')});})[_0x8dee('0x19')](function(_0x35c619){_0x3d4db4(_0x43cbbc[_0x8dee('0x1a')](0x1f5,[_0x119b1f[_0x8dee('0x5f')],_0x35c619['message']['toLowerCase']()][_0x8dee('0x11')]('\x20')));});}else{return _0x3d4db4(_0x43cbbc['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x81fb73){return new Promise(function(_0xffb803,_0x347549){var _0x52b126=_[_0x8dee('0x5a')](_0x2cf198[_0x8dee('0x72')]);_0xffb803({'count':_0x52b126[_0x8dee('0x59')],'rows':_0x52b126});});},'VoiceQueuesChannel':function(_0x8fdae7){var _0x152f9c=this;return new Promise(function(_0x3c0a35,_0x47c2fc){var _0x4f6097=schema(properties[_0x8dee('0x73')])[_0x8dee('0x2')](_0x8fdae7);if(_0x4f6097['length']>0x0){return _0x47c2fc(_0x152f9c[_0x8dee('0x1a')](0x1f4,_['map'](_0x4f6097,_0x8dee('0x18'))[_0x8dee('0x11')](',\x20')));}var _0x406a71=_[_0x8dee('0x5e')](_0x2cf198[_0x8dee('0x72')],{'uniqueid':_0x8fdae7['uniqueid']});if(_0x406a71){_0x3c0a35(_0x406a71);}else{return _0x47c2fc(_0x152f9c['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x14cb81){var _0x29da56=this;return new Promise(function(_0x339d7f,_0x313ac9){if(ami[_0x8dee('0xd')]()==![]){return _0x313ac9(_0x29da56[_0x8dee('0x1a')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x8dee('0xf')],_0x8dee('0x10')][_0x8dee('0x11')]('\x20')));}var _0x120471=schema(properties[_0x8dee('0x74')])['validate'](_0x14cb81);if(_0x120471['length']>0x0){return _0x313ac9(_0x29da56[_0x8dee('0x1a')](0x1f4,_[_0x8dee('0x5d')](_0x120471,_0x8dee('0x18'))[_0x8dee('0x11')](',\x20')));}var _0x184627=_['find'](_0x2cf198[_0x8dee('0x72')],{'uniqueid':_0x14cb81[_0x8dee('0x5f')]});if(_0x184627&&_0x184627[_0x8dee('0x60')]){return ami[_0x8dee('0x16')]({'action':_0x8dee('0x75'),'channel':_0x184627[_0x8dee('0x60')]})[_0x8dee('0x17')](function(_0x60d279){_0x339d7f({'code':0xc8,'message':[_0x14cb81[_0x8dee('0x5f')],_0x60d279[_0x8dee('0x18')][_0x8dee('0x66')]()]['join']('\x20')});})[_0x8dee('0x19')](function(_0x441fe9){_0x313ac9(_0x29da56[_0x8dee('0x1a')](0x1f5,[_0x14cb81[_0x8dee('0x5f')],_0x441fe9[_0x8dee('0x18')][_0x8dee('0x66')]()]['join']('\x20')));});}else{return _0x313ac9(_0x29da56['error'](0x1f5,_0x8dee('0x6c')));}});},'VoiceQueuesChannelRedirect':function(_0x45f2fe){var _0x174555=this;return new Promise(function(_0x2fd357,_0x2d46bf){if(ami[_0x8dee('0xd')]()==![]){return _0x2d46bf(_0x174555['error'](0x1f4,[config[_0x8dee('0xe')]['ip'],config[_0x8dee('0xe')][_0x8dee('0xf')],_0x8dee('0x10')][_0x8dee('0x11')]('\x20')));}var _0x4a64a3=schema(properties[_0x8dee('0x76')])[_0x8dee('0x2')](_0x45f2fe);if(_0x4a64a3['length']>0x0){return _0x2d46bf(_0x174555[_0x8dee('0x1a')](0x1f4,_['map'](_0x4a64a3,_0x8dee('0x18'))[_0x8dee('0x11')](',\x20')));}var _0x115fa6=_['find'](_0x2cf198[_0x8dee('0x72')],{'uniqueid':_0x45f2fe['uniqueid']});if(_0x115fa6&&_0x115fa6[_0x8dee('0x60')]){return ami[_0x8dee('0x16')]({'action':_0x8dee('0x77'),'channel':_0x115fa6[_0x8dee('0x60')],'exten':_0x45f2fe[_0x8dee('0x78')],'context':_0x45f2fe[_0x8dee('0x79')]||_0x115fa6[_0x8dee('0x79')],'priority':0x1})[_0x8dee('0x17')](function(_0x1e6f21){_0x2fd357({'code':0xc8,'message':[_0x45f2fe[_0x8dee('0x5f')],_0x1e6f21[_0x8dee('0x18')]['toLowerCase']()][_0x8dee('0x11')]('\x20')});})[_0x8dee('0x19')](function(_0x58f2e0){_0x2d46bf(_0x174555[_0x8dee('0x1a')](0x1f5,[_0x45f2fe[_0x8dee('0x5f')],_0x58f2e0[_0x8dee('0x18')][_0x8dee('0x66')]()]['join']('\x20')));});}else{return _0x2d46bf(_0x174555['error'](0x1f5,_0x8dee('0x6c')));}});},'Agents':function(_0x176fd3){return new Promise(function(_0x1d26d0,_0x5356be){var _0x5945ce=_['values'](_0x2cf198[_0x8dee('0xb')]);_0x1d26d0({'count':_0x5945ce[_0x8dee('0x59')],'rows':_0x5945ce});});},'Telephones':function(_0x147052){return new Promise(function(_0x1cb108,_0x298bbf){var _0x10964c=_[_0x8dee('0x5a')](_0x2cf198['telephones']);_0x1cb108({'count':_0x10964c[_0x8dee('0x59')],'rows':_0x10964c});});},'Trunks':function(_0xaf625b){return new Promise(function(_0x189667,_0x587cf3){var _0x237bfe=_[_0x8dee('0x5a')](_0x2cf198[_0x8dee('0x7a')]);_0x189667({'count':_0x237bfe[_0x8dee('0x59')],'rows':_0x237bfe});});},'OutboundChannels':function(_0x461fca){return new Promise(function(_0x2d7e3a,_0xed496c){var _0x4a0d92=_[_0x8dee('0x5a')](_0x2cf198['outboundChannels']);_0x2d7e3a({'count':_0x4a0d92[_0x8dee('0x59')],'rows':_0x4a0d92});});},'Outbound':function(_0x620544){return new Promise(function(_0x52ec26,_0x2dc2af){_0x52ec26(_0x2cf198[_0x8dee('0x2c')]);});},'Campaigns':function(_0x82e097){return new Promise(function(_0xf3280d,_0x2a5024){var _0x2f4086=_[_0x8dee('0x5a')](_0x2cf198['campaigns']);_0xf3280d({'count':_0x2f4086[_0x8dee('0x59')],'rows':_0x2f4086});});},'VoiceQueuesPreview':function(_0x30980b){var _0x545539=this;return new Promise(function(_0x1e667a,_0x436ade){_0x31abe3[_0x8dee('0x7b')](_0x30980b['id'])['then'](function(_0x38cf17){_0x1e667a({'code':0xc8,'message':_0x38cf17[_0x8dee('0x18')]});})[_0x8dee('0x19')](function(_0x45dff8){_0x436ade(_0x545539[_0x8dee('0x1a')](0x1f4,_0x45dff8['message']));});});},'EventManager':function(_0x195a59){var _0x2ad2a9=this;return new Promise(function(_0x1e46e7,_0x520140){if(!_0x195a59[_0x8dee('0x7c')]){return _0x520140(_0x2ad2a9['error'](0x1f4,_0x8dee('0x7d')));}ami[_0x8dee('0x7e')](_0x8dee('0x7f')+_0x195a59[_0x8dee('0x7c')],_0x195a59[_0x8dee('0x18')]);_0x1e46e7({'code':0xc8,'message':_0x195a59});});},'FaxAccounts':function(_0x105ccd){return new Promise(function(_0x399c9b,_0x58bdf8){var _0x229100=_[_0x8dee('0x5a')](_0x2cf198[_0x8dee('0x80')]);_0x399c9b({'count':_0x229100[_0x8dee('0x59')],'rows':_0x229100});});},'SendFax':function(_0x2c9560){var _0x4dbec8=this;return new Promise(function(_0x489d04,_0x4eefbf){_0xb05bab[_0x8dee('0x81')](_0x2c9560)[_0x8dee('0x17')](function(_0x544d2a){_0x489d04({'code':0xc8,'message':_0x544d2a['message']});})[_0x8dee('0x19')](function(_0x2cba21){_0x4eefbf(_0x4dbec8[_0x8dee('0x1a')](0x1f4,_0x2cba21[_0x8dee('0x18')]));});});},'CheckAfterSend':function(_0x26374f){var _0x49eb0b=this;return new Promise(function(_0x1ed53b,_0x2e1305){_0xb05bab[_0x8dee('0x82')](_0x26374f)[_0x8dee('0x17')](function(_0x60b315){_0x1ed53b({'code':0xc8,'message':_0x60b315[_0x8dee('0x18')]});})[_0x8dee('0x19')](function(_0x378d0f){_0x2e1305(_0x49eb0b['error'](0x1f4,_0x378d0f[_0x8dee('0x18')]));});});}};var _0xce910f=jayson[_0x8dee('0x83')](_0x352cbf)[_0x8dee('0x84')]();_0xce910f['on']('error',function(_0x514090){return _0x2b71e0(_0x514090);});_0xce910f[_0x8dee('0x7')](0x232a,_0x8dee('0x85'),function(){console[_0x8dee('0x86')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0xeec37e(_0x8dee('0x87')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 7fa922c..a03560b 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 _0x3f63=['catch','error','Error\x20creating\x20contact','action','bluebird','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','stringify','emit','exec','autoCreate','data2','data1','isNil','routeId','calleridname','','uniqueid','destcalleridname','destcalleridnum','phone','resolve','then','showContact','omit','xmd-contactid2','format','user:%s','name','trigger:%s','toLowerCase','createContact','merge'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3f63,0x1cc));var _0x33f6=function(_0x45456,_0x49c583){_0x45456=_0x45456-0x0;var _0x5da88e=_0x3f63[_0x45456];return _0x5da88e;};'use strict';var BPromise=require(_0x33f6('0x0'));var util=require('util');var _=require('lodash');var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x33f6('0x1'));var cmContactRpc=require(_0x33f6('0x2'));config[_0x33f6('0x3')]=_[_0x33f6('0x4')](config[_0x33f6('0x3')],{'host':_0x33f6('0x5'),'port':0x18eb});var io=require(_0x33f6('0x6'))(new Redis(config[_0x33f6('0x3')]));function emit(_0x3d56e9,_0x1109db,_0x4155aa){logger[_0x33f6('0x7')](_0x3d56e9,_0x1109db,JSON[_0x33f6('0x8')](_0x4155aa));io['to'](_0x3d56e9)[_0x33f6('0x9')](_0x1109db,_0x4155aa);}exports[_0x33f6('0xa')]=function(_0x2e0717,_0x2649a6,_0xd5443c){_0xd5443c[_0x33f6('0xb')]=0x0;if(_0x2649a6[_0x33f6('0xc')]&&parseInt(_0x2649a6[_0x33f6('0xc')],0xa)){var _0x494939={'ListId':parseInt(_0x2649a6[_0x33f6('0xd')],0xa),'phone':_0xd5443c['calleridnum']};if(_[_0x33f6('0xe')](_0xd5443c[_0x33f6('0xf')])){_0x494939['firstName']=_0xd5443c[_0x33f6('0x10')]&&_0xd5443c[_0x33f6('0x10')]!==_0x33f6('0x11')?_0xd5443c[_0x33f6('0x10')]:_0xd5443c['calleridnum']||_0xd5443c[_0x33f6('0x12')];}else{_0x494939['firstName']=_0xd5443c['destcalleridname']&&_0xd5443c[_0x33f6('0x13')]!==''?_0xd5443c[_0x33f6('0x13')]:_0xd5443c[_0x33f6('0x14')]||_0xd5443c['uniqueid'];_0x494939[_0x33f6('0x15')]=_0xd5443c['destcalleridname']&&_0xd5443c[_0x33f6('0x13')]!==_0x33f6('0x11')?_0xd5443c[_0x33f6('0x13')]:_0xd5443c['destcalleridnum']||_0xd5443c[_0x33f6('0x12')];}BPromise[_0x33f6('0x16')]()[_0x33f6('0x17')](cmContactRpc[_0x33f6('0x18')]({'where':_[_0x33f6('0x19')](_0x494939,['firstName'])}))[_0x33f6('0x17')](function(_0x34ed76){if(_0x34ed76){_0xd5443c[_0x33f6('0x1a')]=_0x34ed76['id'];emit(util[_0x33f6('0x1b')](_0x33f6('0x1c'),_0x2e0717[_0x33f6('0x1d')]),util[_0x33f6('0x1b')](_0x33f6('0x1e'),_0x2649a6['action'][_0x33f6('0x1f')]()),_['merge'](_0xd5443c,{'ListId':parseInt(_0x2649a6['data1'],0xa)}));return;}else{return BPromise[_0x33f6('0x16')]()[_0x33f6('0x17')](cmContactRpc[_0x33f6('0x20')](_0x494939));}})[_0x33f6('0x17')](function(_0x1a04cc){if(_0x1a04cc){_0xd5443c['xmd-contactid2']=_0x1a04cc['id'];emit(util['format']('user:%s',_0x2e0717['name']),util[_0x33f6('0x1b')](_0x33f6('0x1e'),_0x2649a6['action']['toLowerCase']()),_[_0x33f6('0x21')](_0xd5443c,{'ListId':parseInt(_0x2649a6[_0x33f6('0xd')],0xa)}));}})[_0x33f6('0x22')](function(_0x422372){logger[_0x33f6('0x23')](_0x33f6('0x24'),JSON[_0x33f6('0x8')](_0x422372));});}else{if(_0x2e0717){emit(util[_0x33f6('0x1b')](_0x33f6('0x1c'),_0x2e0717[_0x33f6('0x1d')]),util[_0x33f6('0x1b')](_0x33f6('0x1e'),_0x2649a6[_0x33f6('0x25')]['toLowerCase']()),_['merge']({'ListId':parseInt(_0x2649a6['data1'],0xa)},_0xd5443c));}}}; \ No newline at end of file +var _0x5f82=['calleridname','','destcalleridname','destcalleridnum','uniqueid','resolve','then','showContact','xmd-contactid2','format','trigger:%s','action','toLowerCase','merge','data1','createContact','user:%s','name','catch','Error\x20creating\x20contact','stringify','bluebird','util','lodash','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','exec','autoCreate','data2','calleridnum','isNil','routeId','firstName'];(function(_0x2f87f8,_0x181099){var _0xa8c89e=function(_0x55432d){while(--_0x55432d){_0x2f87f8['push'](_0x2f87f8['shift']());}};_0xa8c89e(++_0x181099);}(_0x5f82,0xad));var _0x25f8=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x5f82[_0x40220a];return _0x3903cc;};'use strict';var BPromise=require(_0x25f8('0x0'));var util=require(_0x25f8('0x1'));var _=require(_0x25f8('0x2'));var Redis=require(_0x25f8('0x3'));var config=require('../../../../config/environment');var logger=require(_0x25f8('0x4'))('trigger');var cmContactRpc=require('../../rpc/cmContact');config[_0x25f8('0x5')]=_[_0x25f8('0x6')](config[_0x25f8('0x5')],{'host':_0x25f8('0x7'),'port':0x18eb});var io=require(_0x25f8('0x8'))(new Redis(config[_0x25f8('0x5')]));function emit(_0x33ba68,_0x4c9539,_0xd0dddf){logger['info'](_0x33ba68,_0x4c9539,JSON['stringify'](_0xd0dddf));io['to'](_0x33ba68)[_0x25f8('0x9')](_0x4c9539,_0xd0dddf);}exports[_0x25f8('0xa')]=function(_0x4eff74,_0x8a8ac1,_0x2ad26b){_0x2ad26b[_0x25f8('0xb')]=0x0;if(_0x8a8ac1['data2']&&parseInt(_0x8a8ac1[_0x25f8('0xc')],0xa)){var _0x461e04={'ListId':parseInt(_0x8a8ac1['data1'],0xa),'phone':_0x2ad26b[_0x25f8('0xd')]};if(_[_0x25f8('0xe')](_0x2ad26b[_0x25f8('0xf')])){_0x461e04[_0x25f8('0x10')]=_0x2ad26b[_0x25f8('0x11')]&&_0x2ad26b[_0x25f8('0x11')]!==_0x25f8('0x12')?_0x2ad26b[_0x25f8('0x11')]:_0x2ad26b[_0x25f8('0xd')]||_0x2ad26b['uniqueid'];}else{_0x461e04[_0x25f8('0x10')]=_0x2ad26b[_0x25f8('0x13')]&&_0x2ad26b[_0x25f8('0x13')]!==_0x25f8('0x12')?_0x2ad26b['destcalleridname']:_0x2ad26b[_0x25f8('0x14')]||_0x2ad26b[_0x25f8('0x15')];_0x461e04['phone']=_0x2ad26b['destcalleridname']&&_0x2ad26b['destcalleridname']!==_0x25f8('0x12')?_0x2ad26b[_0x25f8('0x13')]:_0x2ad26b[_0x25f8('0x14')]||_0x2ad26b['uniqueid'];}BPromise[_0x25f8('0x16')]()[_0x25f8('0x17')](cmContactRpc[_0x25f8('0x18')]({'where':_['omit'](_0x461e04,[_0x25f8('0x10')])}))['then'](function(_0x5752af){if(_0x5752af){_0x2ad26b[_0x25f8('0x19')]=_0x5752af['id'];emit(util[_0x25f8('0x1a')]('user:%s',_0x4eff74['name']),util[_0x25f8('0x1a')](_0x25f8('0x1b'),_0x8a8ac1[_0x25f8('0x1c')][_0x25f8('0x1d')]()),_[_0x25f8('0x1e')](_0x2ad26b,{'ListId':parseInt(_0x8a8ac1[_0x25f8('0x1f')],0xa)}));return;}else{return BPromise[_0x25f8('0x16')]()[_0x25f8('0x17')](cmContactRpc[_0x25f8('0x20')](_0x461e04));}})[_0x25f8('0x17')](function(_0x4a21d1){if(_0x4a21d1){_0x2ad26b['xmd-contactid2']=_0x4a21d1['id'];emit(util[_0x25f8('0x1a')](_0x25f8('0x21'),_0x4eff74[_0x25f8('0x22')]),util[_0x25f8('0x1a')](_0x25f8('0x1b'),_0x8a8ac1['action'][_0x25f8('0x1d')]()),_['merge'](_0x2ad26b,{'ListId':parseInt(_0x8a8ac1[_0x25f8('0x1f')],0xa)}));}})[_0x25f8('0x23')](function(_0x5818af){logger['error'](_0x25f8('0x24'),JSON[_0x25f8('0x25')](_0x5818af));});}else{if(_0x4eff74){emit(util['format'](_0x25f8('0x21'),_0x4eff74[_0x25f8('0x22')]),util[_0x25f8('0x1a')]('trigger:%s',_0x8a8ac1[_0x25f8('0x1c')]['toLowerCase']()),_[_0x25f8('0x1e')]({'ListId':parseInt(_0x8a8ac1[_0x25f8('0x1f')],0xa)},_0x2ad26b));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index e8dffdc..9a78773 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 _0x7c26=['bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:acceptmessage','prototype','emit','info','stringify','clone','checkTriggers','interface','checkTrigger','merge','variables','Actions','length','toLowerCase','contactmanager','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','isNil','data3','data4','location','uriLocation','data5','windowHeight','600','data6','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','action','jscripty','trigger:%s','integration','routeId','exec','script','buildUri','parse','query','every','AllConditions','channel','AnyConditions','some','checkConditions','account','chat','operator','value','ChatWebsiteId','AccountId','upperFirst','message','event','queue','membername','lastevent','exports','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','../rpc/cmContact','../../../config/logger','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','accounts','custom:agentcalled','syncCustomEvent'];(function(_0x1c2b57,_0x393be5){var _0x343e18=function(_0x5c3a78){while(--_0x5c3a78){_0x1c2b57['push'](_0x1c2b57['shift']());}};_0x343e18(++_0x393be5);}(_0x7c26,0x127));var _0x67c2=function(_0x295778,_0x377ea5){_0x295778=_0x295778-0x0;var _0x47f7e8=_0x7c26[_0x295778];return _0x47f7e8;};'use strict';var util=require('util');var _=require(_0x67c2('0x0'));var url=require(_0x67c2('0x1'));var Mustache=require(_0x67c2('0x2'));var Redis=require(_0x67c2('0x3'));var urlforward=require(_0x67c2('0x4'));var integration=require(_0x67c2('0x5'));var cmContact=require(_0x67c2('0x6'));var script=require('./script');var cmContactRpc=require(_0x67c2('0x7'));var config=require('../../../config/environment');var logger=require(_0x67c2('0x8'))('trigger');var ami=require('../ami');config[_0x67c2('0x9')]=_[_0x67c2('0xa')](config[_0x67c2('0x9')],{'host':_0x67c2('0xb'),'port':0x18eb});var io=require(_0x67c2('0xc'))(new Redis(config[_0x67c2('0x9')]));var operators={'equals':function(_0x15ccc1,_0x2477bb){return _0x15ccc1==_0x2477bb;},'not_equals':function(_0x1c96c0,_0x565968){return _0x1c96c0!=_0x565968;}};var barAndWebActions=[_0x67c2('0xd'),_0x67c2('0x1'),_0x67c2('0xe')];function Trigger(_0x3e410e){this[_0x67c2('0xf')]=_0x3e410e[_0x67c2('0xf')];this[_0x67c2('0x10')]=_0x3e410e[_0x67c2('0x10')];this[_0x67c2('0x11')]=_0x3e410e['voiceQueues'];this[_0x67c2('0x12')]=_0x3e410e[_0x67c2('0x12')];this[_0x67c2('0x13')]=_0x3e410e[_0x67c2('0x13')];this[_0x67c2('0x14')]=_0x3e410e[_0x67c2('0x14')];this[_0x67c2('0x15')]=_0x3e410e['freshdeskAccounts'];this[_0x67c2('0x16')]=_0x3e410e['salesforceAccounts'];this[_0x67c2('0x17')]=_0x3e410e['sugarcrmAccounts'];this[_0x67c2('0x18')]=_0x3e410e[_0x67c2('0x18')];this[_0x67c2('0x19')]=_0x3e410e['deskAccounts'];this[_0x67c2('0x1a')]=_0x3e410e[_0x67c2('0x1a')];this[_0x67c2('0x1b')]=_0x3e410e[_0x67c2('0x1b')];this[_0x67c2('0x1c')]=_0x3e410e[_0x67c2('0x1c')];this[_0x67c2('0x1d')]={'zendesk':this[_0x67c2('0x14')],'salesforce':this[_0x67c2('0x16')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x67c2('0x17')],'zoho':this[_0x67c2('0x18')],'desk':this[_0x67c2('0x19')],'vtiger':this[_0x67c2('0x1a')],'servicenow':this[_0x67c2('0x1b')],'dynamics365':this[_0x67c2('0x1c')]};ami['on'](_0x67c2('0x1e'),this[_0x67c2('0x1f')][_0x67c2('0x20')](this));ami['on'](_0x67c2('0x21'),this['syncCustomEvent'][_0x67c2('0x20')](this));ami['on'](_0x67c2('0x22'),this['syncCustomEvent']['bind'](this));ami['on'](_0x67c2('0x23'),this[_0x67c2('0x1f')][_0x67c2('0x20')](this));ami['on']('custom:queuecallerabandon',this[_0x67c2('0x1f')][_0x67c2('0x20')](this));ami['on'](_0x67c2('0x24'),this[_0x67c2('0x25')]['bind'](this));ami['on'](_0x67c2('0x26'),this[_0x67c2('0x25')][_0x67c2('0x20')](this));ami['on'](_0x67c2('0x27'),this[_0x67c2('0x25')]['bind'](this));ami['on'](_0x67c2('0x28'),this[_0x67c2('0x1f')][_0x67c2('0x20')](this));ami['on'](_0x67c2('0x29'),this[_0x67c2('0x1f')][_0x67c2('0x20')](this));ami['on'](_0x67c2('0x2a'),this[_0x67c2('0x1f')][_0x67c2('0x20')](this));ami['on']('custom:outgoingmessage',this[_0x67c2('0x1f')]['bind'](this));ami['on'](_0x67c2('0x2b'),this[_0x67c2('0x1f')][_0x67c2('0x20')](this));ami['on']('custom:rejectmessage',this[_0x67c2('0x1f')][_0x67c2('0x20')](this));}Trigger[_0x67c2('0x2c')][_0x67c2('0x2d')]=function(_0x36a7ae,_0x44aab4,_0x2979ce){logger[_0x67c2('0x2e')](_0x36a7ae,_0x44aab4,JSON[_0x67c2('0x2f')](_0x2979ce));io['to'](_0x36a7ae)[_0x67c2('0x2d')](_0x44aab4,_0x2979ce);};Trigger[_0x67c2('0x2c')][_0x67c2('0x1f')]=function(_0x3f5932){var _0x1943bf=_[_0x67c2('0x30')](_0x3f5932);this[_0x67c2('0x31')](_0x1943bf);};Trigger[_0x67c2('0x2c')][_0x67c2('0x25')]=function(_0x560c34){if(this['agents'][_0x560c34[_0x67c2('0x32')]]){this[_0x67c2('0x1f')](_0x560c34);}};Trigger['prototype'][_0x67c2('0x31')]=function(_0x11a89c){var _0x5269e2;for(var _0x18be46 in this[_0x67c2('0xf')]){if(this[_0x67c2('0xf')]['hasOwnProperty'](_0x18be46)){if(this[_0x67c2('0xf')][_0x18be46]['status']){_0x5269e2=this[_0x67c2('0x33')](this['triggers'][_0x18be46],_0x11a89c);if(_0x5269e2){_[_0x67c2('0x34')](_0x11a89c,_0x11a89c[_0x67c2('0x35')]);for(var _0x31371f=0x0,_0x3698e7,_0xade580,_0x102661;_0x31371f0x0){_0x2812e6=_[_0x450e('0x29')](_0x1cc84d,_0x41fc98);}return _0x2812e6;}function getCustomFields(_0x1b8a79,_0x47987e){var _0x348093=[];var _0x150897={'custom_fields':{}};if(_0x1b8a79[_0x450e('0x28')]>0x0){_[_0x450e('0x2a')](_0x1b8a79,function(_0xaeba7b){if(_0xaeba7b[_0x450e('0x2b')]===_0x450e('0x2c')&&_0xaeba7b[_0x450e('0x2d')]&&!_0xaeba7b[_0x450e('0x2e')]){_0x150897[_0xaeba7b['nameField'][_0x450e('0x2f')]()]=_0xaeba7b[_0x450e('0x30')][_0x450e('0x24')]();}else if(_0xaeba7b['type']===_0x450e('0x2c')&&_0xaeba7b[_0x450e('0x31')]&&_0xaeba7b[_0x450e('0x2e')]){_0x150897[_0x450e('0x32')][_0xaeba7b[_0x450e('0x31')]]=_0xaeba7b['content'][_0x450e('0x24')]();}else if(_0xaeba7b[_0x450e('0x2b')]===_0x450e('0x33')&&_0xaeba7b[_0x450e('0x34')]&&_0xaeba7b[_0x450e('0x31')]&&_0xaeba7b['customField']){_0x47987e[_0xaeba7b['variableName']]&&(_0x150897[_0x450e('0x32')][_0xaeba7b[_0x450e('0x31')]]=_0x47987e[_0xaeba7b[_0x450e('0x34')]]['toString']());}else if(_0xaeba7b[_0x450e('0x2b')]===_0x450e('0x35')&&_0xaeba7b[_0x450e('0x36')]&&_0xaeba7b[_0x450e('0x36')][_0x450e('0x37')]&&_0xaeba7b['idField']&&_0xaeba7b[_0x450e('0x2e')]){_0x47987e[_0xaeba7b[_0x450e('0x36')][_0x450e('0x37')][_0x450e('0x2f')]()]&&(_0x150897['custom_fields'][_0xaeba7b[_0x450e('0x31')]]=_0x47987e[_0xaeba7b[_0x450e('0x36')][_0x450e('0x37')][_0x450e('0x2f')]()][_0x450e('0x24')]());}});}if(_0x150897[_0x450e('0x38')]){_0x150897['priority']=Number(_0x150897['priority']);}return _0x150897;}function getTicket(_0x4eb104,_0x13890e,_0x380f42,_0x345fd5,_0x31d0d4){logger[_0x450e('0xe')](_0x450e('0x39'));var _0x28d281=_[_0x450e('0x3a')]({'subject':intUtil[_0x450e('0x3b')](_0x345fd5[_0x450e('0x3c')],_0x31d0d4,'\x20'),'type':_0x450e('0x3d'),'status':_0x450e('0x3e'),'labels':[_0x450e('0x3f'),_0x450e('0x40'),_0x450e('0x41')][_0x450e('0x42')](getTags(_0x345fd5['Tags'],'name')),'description':intUtil[_0x450e('0x3b')](_0x345fd5[_0x450e('0x43')],_0x31d0d4,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x450e('0x44'),_0x13890e['id']),'class':_0x450e('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x345fd5['Descriptions'],_0x31d0d4,'\x0a')}},getCustomFields(_0x345fd5['Fields'],_0x31d0d4));return request({'uri':util[_0x450e('0x17')](_0x450e('0x46'),_0x4eb104[_0x450e('0x19')],_0x380f42['id']),'method':_0x450e('0x47'),'body':_0x28d281});}exports['queue']=function(_0x51c380,_0x537c74,_0x3b66e2,_0x2defa4,_0x108a0a,_0x3bbc53){var _0x4787c0,_0x3a85de;_0x3bbc53[_0x450e('0x19')]=intUtil[_0x450e('0x48')](_0x3bbc53[_0x450e('0x19')]);_0x3bbc53[_0x450e('0x49')]=intUtil[_0x450e('0x48')](_0x3bbc53[_0x450e('0x49')]);if(_0x108a0a&&_0x108a0a[_0x450e('0x4a')]){logger[_0x450e('0xe')](_0x450e('0x4b'),'Recording\x20is\x20enabled!');_0x537c74['recordingURL']=util[_0x450e('0x17')](_0x450e('0x4c'),_0x3bbc53[_0x450e('0x49')],_0x537c74['uniqueid'],md5(_0x537c74[_0x450e('0x4d')]));}else{_0x537c74[_0x450e('0x4e')]='';}headers[_0x450e('0x4f')]=getAuth(_0x3bbc53);return getUser(_0x3bbc53,_0x2defa4[_0x450e('0x50')])[_0x450e('0x11')](function(_0x17ef0c){_0x4787c0=_0x17ef0c;logger[_0x450e('0xe')]('The\x20User\x20ID\x20is:',_0x4787c0['id']);return getEndUser(_0x3bbc53,_0x537c74[_0x450e('0x51')],_0x537c74[_0x450e('0x52')]);})[_0x450e('0x11')](function(_0x5aec9b){_0x3a85de=_0x5aec9b;logger['info'](_0x450e('0x53'),_0x3a85de['id']);return getTicket(_0x3bbc53,_0x4787c0,_0x3a85de,_0x3b66e2,_0x537c74);})[_0x450e('0x11')](function(_0x305ef5){if(_0x305ef5){logger['info'](_0x450e('0x54'));logger[_0x450e('0xe')](_0x450e('0x55'),_0x305ef5['id']);switch(_0x3bbc53[_0x450e('0x2b')]){case'integrationTab':logger[_0x450e('0xe')](_0x450e('0x4b'),_0x450e('0x56'));emit(util['format'](_0x450e('0x57'),_0x2defa4['name']),'trigger:desk:display',{'recordId':_0x305ef5['id']});break;case'newTab':logger['info'](_0x450e('0x4b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x450e('0x57'),_0x2defa4[_0x450e('0x37')]),_0x450e('0x58'),{'uri':util[_0x450e('0x17')](_0x450e('0x59'),_0x305ef5['id'])});break;default:logger['error'](_0x450e('0x4b'),_0x450e('0x5a'));}}})[_0x450e('0x5b')](function(_0x3eaf33){console[_0x450e('0x5c')](_0x3eaf33);logger[_0x450e('0x5c')](_0x450e('0x4b'),JSON[_0x450e('0x1d')](_0x3eaf33));});};exports[_0x450e('0x5d')]=function(_0x5e673a,_0x4c0f36,_0x59555e,_0x330fc4,_0xba2679,_0x1880a3,_0x33a848){var _0x43b8a5,_0x4f8205;_0x1880a3['remoteUri']=intUtil[_0x450e('0x48')](_0x1880a3['remoteUri']);_0x1880a3[_0x450e('0x49')]=intUtil[_0x450e('0x48')](_0x1880a3['serverUrl']);if(_0x33a848&&_0x33a848[_0x450e('0x5e')]&&_0x33a848[_0x450e('0x5e')]!==_0x450e('0x5f')){logger['info'](_0x450e('0x60'),_0x450e('0x61'));_0x4c0f36[_0x450e('0x4e')]=util[_0x450e('0x17')](_0x450e('0x4c'),_0x1880a3[_0x450e('0x49')],_0x4c0f36[_0x450e('0x4d')],md5(_0x4c0f36[_0x450e('0x4d')]));}headers['Authorization']=getAuth(_0x1880a3);return getUser(_0x1880a3,_0x330fc4[_0x450e('0x50')])[_0x450e('0x11')](function(_0x5337a0){_0x43b8a5=_0x5337a0;logger[_0x450e('0xe')]('The\x20User\x20ID\x20is:',_0x43b8a5['id']);return getEndUser(_0x1880a3,_0x4c0f36[_0x450e('0x62')],_0x4c0f36[_0x450e('0x63')]);})[_0x450e('0x11')](function(_0x447a53){_0x4f8205=_0x447a53;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4f8205['id']);return getTicket(_0x1880a3,_0x43b8a5,_0x4f8205,_0x59555e,_0x4c0f36);})[_0x450e('0x11')](function(_0x2e6956){if(_0x2e6956){logger['info']('Ticket\x20created!');logger[_0x450e('0xe')](_0x450e('0x55'),_0x2e6956['id']);switch(_0x1880a3[_0x450e('0x2b')]){case'integrationTab':logger['info'](_0x450e('0x4b'),_0x450e('0x56'));emit(util[_0x450e('0x17')](_0x450e('0x57'),_0x330fc4['name']),_0x450e('0x64'),{'recordId':_0x2e6956['id']});break;case _0x450e('0x65'):logger['info'](_0x450e('0x4b'),_0x450e('0x66'));emit(util[_0x450e('0x17')](_0x450e('0x57'),_0x330fc4[_0x450e('0x37')]),_0x450e('0x58'),{'uri':util[_0x450e('0x17')](_0x450e('0x67'),_0x1880a3[_0x450e('0x19')],_0x2e6956['id'])});break;default:logger[_0x450e('0x5c')](_0x450e('0x60'),_0x450e('0x5a'));}}})[_0x450e('0x5b')](function(_0x20fdd1){logger[_0x450e('0x5c')](_0x450e('0x60'),JSON[_0x450e('0x1d')](_0x20fdd1));});};exports[_0x450e('0x68')]=function(_0x28c6e8,_0x4d0104,_0x26275c,_0x2f7cc1,_0x1052a7,_0x7ed1d1){var _0xf74c26,_0x932458;_0x7ed1d1[_0x450e('0x19')]=intUtil['stripTrailingSlash'](_0x7ed1d1[_0x450e('0x19')]);_0x7ed1d1['serverUrl']=intUtil[_0x450e('0x48')](_0x7ed1d1['serverUrl']);if(_0x1052a7&&_0x1052a7[_0x450e('0x4a')]){logger[_0x450e('0xe')](_0x450e('0x69'),_0x450e('0x61'));_0x4d0104['recordingURL']=util['format'](_0x450e('0x4c'),_0x7ed1d1[_0x450e('0x49')],_0x4d0104['uniqueid'],md5(_0x4d0104['uniqueid']));}else{_0x4d0104[_0x450e('0x4e')]='';}headers[_0x450e('0x4f')]=getAuth(_0x7ed1d1);return getUser(_0x7ed1d1)['then'](function(_0x2a6b6e){_0xf74c26=_0x2a6b6e;logger[_0x450e('0xe')](_0x450e('0x6a'),_0xf74c26['id']);return getEndUser(_0x7ed1d1,_0x4d0104[_0x450e('0x51')],_0x4d0104[_0x450e('0x52')]);})['then'](function(_0x5afb87){_0x932458=_0x5afb87;logger[_0x450e('0xe')](_0x450e('0x53'),_0x932458['id']);return getTicket(_0x7ed1d1,_0xf74c26,_0x932458,_0x26275c,_0x4d0104);})['then'](function(_0x3b39bf){if(_0x3b39bf){logger['info'](_0x450e('0x54'));logger[_0x450e('0xe')](_0x450e('0x55'),_0x3b39bf['id']);}})[_0x450e('0x5b')](function(_0x250866){logger[_0x450e('0x5c')](_0x450e('0x69'),JSON[_0x450e('0x1d')](_0x250866));});}; \ No newline at end of file +var _0x5320=['concat','/api/v2/users/%d','user','Descriptions','Fields','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','user:%s','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','stringify','outbound','recordingFormat','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','trigger:desk:display','%s/agent/tickets/%s','[OUTBOUND]','catch','[ABANDONED]','calleridname','lodash','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','emit','application/json','%s/users','remoteUri','then','find','Agent\x20found!','info','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','format','%s/users/me','debug','[HTTP]','GET','authType','basic','password','token','username','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','total_entries','Enduser\x20found!','_embedded','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','work','length','map','type','customField','nameField','toLowerCase','content','idField','custom_fields','variable','variableName','Variable','name','priority','getString','Subjects','phone','new','xCALLY','Motion','CTI'];(function(_0x57c8a2,_0x228331){var _0x81c1e8=function(_0x89a895){while(--_0x89a895){_0x57c8a2['push'](_0x57c8a2['shift']());}};_0x81c1e8(++_0x228331);}(_0x5320,0x1ae));var _0x0532=function(_0x2741c7,_0x25b549){_0x2741c7=_0x2741c7-0x0;var _0x1f993e=_0x5320[_0x2741c7];return _0x1f993e;};'use strict';var _=require(_0x0532('0x0'));var rp=require(_0x0532('0x1'));var md5=require(_0x0532('0x2'));var util=require('util');var Redis=require(_0x0532('0x3'));var intUtil=require('./util');var config=require(_0x0532('0x4'));var logger=require(_0x0532('0x5'))(_0x0532('0x6'));config['redis']=_[_0x0532('0x7')](config[_0x0532('0x8')],{'host':_0x0532('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0532('0x8')]));function emit(_0x3bf1c0,_0x12e1f5,_0xb5e5de){io['to'](_0x3bf1c0)[_0x0532('0xa')](_0x12e1f5,_0xb5e5de);}var headers={'Content-Type':_0x0532('0xb'),'Accept':_0x0532('0xb')};function getUser(_0x10d483,_0x49aba4){if(intUtil['validateEmail'](_0x49aba4)===!![]){logger['info']('Getting\x20agent\x20with\x20email',_0x49aba4);return request({'uri':util['format'](_0x0532('0xc'),_0x10d483[_0x0532('0xd')])})[_0x0532('0xe')](function(_0x54969f){if(_0x54969f['total_entries']){return _[_0x0532('0xf')](_0x54969f['_embedded']['entries'],{'email':_0x49aba4});}})[_0x0532('0xe')](function(_0x50ba0e){if(_0x50ba0e){logger['info'](_0x0532('0x10'));return _0x50ba0e;}else{logger[_0x0532('0x11')](_0x0532('0x12'));return request({'uri':util['format']('%s/users/me',_0x10d483[_0x0532('0xd')])});}});}else{logger[_0x0532('0x11')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x0532('0x13')](_0x0532('0x14'),_0x10d483[_0x0532('0xd')])});}}function request(_0x285d8c){logger[_0x0532('0x15')](_0x0532('0x16'),JSON['stringify'](_0x285d8c));return rp(_[_0x0532('0x7')](_0x285d8c,{'method':_0x0532('0x17'),'headers':headers,'json':!![]}));}function getAuth(_0x11d272){var _0x4916f9;if(_0x11d272[_0x0532('0x18')]===_0x0532('0x19')){_0x4916f9=util[_0x0532('0x13')]('%s:%s',_0x11d272['username'],_0x11d272[_0x0532('0x1a')]);}else if(_0x11d272[_0x0532('0x18')]===_0x0532('0x1b')){_0x4916f9=util['format']('%s/token:%s',_0x11d272[_0x0532('0x1c')],_0x11d272[_0x0532('0x1b')]);}return util[_0x0532('0x13')]('Basic\x20%s',new Buffer(_0x4916f9)[_0x0532('0x1d')](_0x0532('0x1e')));}function getEndUser(_0x1dda46,_0xc1cb3d,_0x5000fe){logger[_0x0532('0x11')](_0x0532('0x1f'),_0x5000fe);return request({'uri':util[_0x0532('0x13')](_0x0532('0x20'),_0x1dda46[_0x0532('0xd')]),'qs':{'phone':_0x5000fe}})[_0x0532('0xe')](function(_0x70b75a){if(_0x70b75a[_0x0532('0x21')]){logger[_0x0532('0x11')](_0x0532('0x22'));return _0x70b75a[_0x0532('0x23')]['entries'][0x0];}else{logger[_0x0532('0x11')](_0x0532('0x24'));return request({'uri':util[_0x0532('0x13')]('%s/customers',_0x1dda46[_0x0532('0xd')]),'method':_0x0532('0x25'),'body':{'first_name':_0xc1cb3d,'title':_0xc1cb3d,'phone_numbers':[{'type':_0x0532('0x26'),'value':_0x5000fe}]}});}});}function getTags(_0x3f812a,_0x26f93d){var _0xacce49=[];if(_0x3f812a&&_0x3f812a[_0x0532('0x27')]>0x0){_0xacce49=_[_0x0532('0x28')](_0x3f812a,_0x26f93d);}return _0xacce49;}function getCustomFields(_0x3009a0,_0x28af3e){var _0x10b133=[];var _0x4de763={'custom_fields':{}};if(_0x3009a0[_0x0532('0x27')]>0x0){_['forEach'](_0x3009a0,function(_0xba9b11){if(_0xba9b11[_0x0532('0x29')]==='string'&&_0xba9b11['nameField']&&!_0xba9b11[_0x0532('0x2a')]){_0x4de763[_0xba9b11[_0x0532('0x2b')][_0x0532('0x2c')]()]=_0xba9b11[_0x0532('0x2d')][_0x0532('0x1d')]();}else if(_0xba9b11[_0x0532('0x29')]==='string'&&_0xba9b11[_0x0532('0x2e')]&&_0xba9b11[_0x0532('0x2a')]){_0x4de763[_0x0532('0x2f')][_0xba9b11[_0x0532('0x2e')]]=_0xba9b11[_0x0532('0x2d')][_0x0532('0x1d')]();}else if(_0xba9b11[_0x0532('0x29')]===_0x0532('0x30')&&_0xba9b11[_0x0532('0x31')]&&_0xba9b11[_0x0532('0x2e')]&&_0xba9b11[_0x0532('0x2a')]){_0x28af3e[_0xba9b11['variableName']]&&(_0x4de763['custom_fields'][_0xba9b11['idField']]=_0x28af3e[_0xba9b11[_0x0532('0x31')]]['toString']());}else if(_0xba9b11[_0x0532('0x29')]==='customVariable'&&_0xba9b11[_0x0532('0x32')]&&_0xba9b11[_0x0532('0x32')][_0x0532('0x33')]&&_0xba9b11[_0x0532('0x2e')]&&_0xba9b11[_0x0532('0x2a')]){_0x28af3e[_0xba9b11[_0x0532('0x32')][_0x0532('0x33')][_0x0532('0x2c')]()]&&(_0x4de763[_0x0532('0x2f')][_0xba9b11[_0x0532('0x2e')]]=_0x28af3e[_0xba9b11['Variable']['name'][_0x0532('0x2c')]()][_0x0532('0x1d')]());}});}if(_0x4de763[_0x0532('0x34')]){_0x4de763[_0x0532('0x34')]=Number(_0x4de763[_0x0532('0x34')]);}return _0x4de763;}function getTicket(_0x249dfe,_0x2a5e79,_0x39f4c9,_0xcd0ad,_0x1a63be){logger['info']('Creating\x20new\x20ticket...');var _0x318ef2=_['merge']({'subject':intUtil[_0x0532('0x35')](_0xcd0ad[_0x0532('0x36')],_0x1a63be,'\x20'),'type':_0x0532('0x37'),'status':_0x0532('0x38'),'labels':[_0x0532('0x39'),_0x0532('0x3a'),_0x0532('0x3b')][_0x0532('0x3c')](getTags(_0xcd0ad['Tags'],'name')),'description':intUtil[_0x0532('0x35')](_0xcd0ad['Descriptions'],_0x1a63be,'\x0a'),'_links':{'assigned_user':{'href':util[_0x0532('0x13')](_0x0532('0x3d'),_0x2a5e79['id']),'class':_0x0532('0x3e')}},'message':{'direction':'in','body':intUtil[_0x0532('0x35')](_0xcd0ad[_0x0532('0x3f')],_0x1a63be,'\x0a')}},getCustomFields(_0xcd0ad[_0x0532('0x40')],_0x1a63be));return request({'uri':util[_0x0532('0x13')]('%s/customers/%d/cases',_0x249dfe[_0x0532('0xd')],_0x39f4c9['id']),'method':'POST','body':_0x318ef2});}exports[_0x0532('0x41')]=function(_0x408fa3,_0x5d6d57,_0x4dd434,_0x4ffecb,_0x417c88,_0x3b396c){var _0x2d3090,_0x3eef97;_0x3b396c[_0x0532('0xd')]=intUtil[_0x0532('0x42')](_0x3b396c[_0x0532('0xd')]);_0x3b396c[_0x0532('0x43')]=intUtil[_0x0532('0x42')](_0x3b396c[_0x0532('0x43')]);if(_0x417c88&&_0x417c88[_0x0532('0x44')]){logger[_0x0532('0x11')](_0x0532('0x45'),_0x0532('0x46'));_0x5d6d57[_0x0532('0x47')]=util['format'](_0x0532('0x48'),_0x3b396c['serverUrl'],_0x5d6d57[_0x0532('0x49')],md5(_0x5d6d57[_0x0532('0x49')]));}else{_0x5d6d57[_0x0532('0x47')]='';}headers[_0x0532('0x4a')]=getAuth(_0x3b396c);return getUser(_0x3b396c,_0x4ffecb['email'])['then'](function(_0x2750fc){_0x2d3090=_0x2750fc;logger[_0x0532('0x11')]('The\x20User\x20ID\x20is:',_0x2d3090['id']);return getEndUser(_0x3b396c,_0x5d6d57['calleridname'],_0x5d6d57[_0x0532('0x4b')]);})[_0x0532('0xe')](function(_0x16cb56){_0x3eef97=_0x16cb56;logger[_0x0532('0x11')](_0x0532('0x4c'),_0x3eef97['id']);return getTicket(_0x3b396c,_0x2d3090,_0x3eef97,_0x4dd434,_0x5d6d57);})['then'](function(_0x16c77b){if(_0x16c77b){logger[_0x0532('0x11')](_0x0532('0x4d'));logger[_0x0532('0x11')](_0x0532('0x4e'),_0x16c77b['id']);switch(_0x3b396c['type']){case'integrationTab':logger[_0x0532('0x11')](_0x0532('0x45'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x0532('0x13')](_0x0532('0x4f'),_0x4ffecb['name']),'trigger:desk:display',{'recordId':_0x16c77b['id']});break;case _0x0532('0x50'):logger[_0x0532('0x11')](_0x0532('0x45'),_0x0532('0x51'));emit(util[_0x0532('0x13')](_0x0532('0x4f'),_0x4ffecb[_0x0532('0x33')]),_0x0532('0x52'),{'uri':util[_0x0532('0x13')]('https://xcally.desk.com/web/agent/case/%d',_0x16c77b['id'])});break;default:logger[_0x0532('0x53')](_0x0532('0x45'),_0x0532('0x54'));}}})['catch'](function(_0xa872e){console['error'](_0xa872e);logger[_0x0532('0x53')](_0x0532('0x45'),JSON[_0x0532('0x55')](_0xa872e));});};exports[_0x0532('0x56')]=function(_0x163c92,_0x27e065,_0x449ada,_0x96cf83,_0x5d6c00,_0x1fdb0c,_0x4b8707){var _0x5e007d,_0x4aabe6;_0x1fdb0c[_0x0532('0xd')]=intUtil[_0x0532('0x42')](_0x1fdb0c['remoteUri']);_0x1fdb0c['serverUrl']=intUtil['stripTrailingSlash'](_0x1fdb0c[_0x0532('0x43')]);if(_0x4b8707&&_0x4b8707[_0x0532('0x57')]&&_0x4b8707[_0x0532('0x57')]!=='none'){logger[_0x0532('0x11')]('[OUTBOUND]',_0x0532('0x46'));_0x27e065[_0x0532('0x47')]=util[_0x0532('0x13')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1fdb0c[_0x0532('0x43')],_0x27e065['uniqueid'],md5(_0x27e065['uniqueid']));}headers[_0x0532('0x4a')]=getAuth(_0x1fdb0c);return getUser(_0x1fdb0c,_0x96cf83['email'])['then'](function(_0x5281ae){_0x5e007d=_0x5281ae;logger[_0x0532('0x11')](_0x0532('0x58'),_0x5e007d['id']);return getEndUser(_0x1fdb0c,_0x27e065[_0x0532('0x59')],_0x27e065[_0x0532('0x5a')]);})[_0x0532('0xe')](function(_0x55541e){_0x4aabe6=_0x55541e;logger['info'](_0x0532('0x4c'),_0x4aabe6['id']);return getTicket(_0x1fdb0c,_0x5e007d,_0x4aabe6,_0x449ada,_0x27e065);})[_0x0532('0xe')](function(_0x272335){if(_0x272335){logger[_0x0532('0x11')](_0x0532('0x4d'));logger[_0x0532('0x11')]('The\x20Ticket\x20ID\x20is:',_0x272335['id']);switch(_0x1fdb0c['type']){case'integrationTab':logger['info'](_0x0532('0x45'),_0x0532('0x5b'));emit(util[_0x0532('0x13')](_0x0532('0x4f'),_0x96cf83[_0x0532('0x33')]),_0x0532('0x5c'),{'recordId':_0x272335['id']});break;case _0x0532('0x50'):logger['info'](_0x0532('0x45'),_0x0532('0x51'));emit(util['format']('user:%s',_0x96cf83[_0x0532('0x33')]),'trigger:browser:url',{'uri':util['format'](_0x0532('0x5d'),_0x1fdb0c[_0x0532('0xd')],_0x272335['id'])});break;default:logger[_0x0532('0x53')](_0x0532('0x5e'),_0x0532('0x54'));}}})[_0x0532('0x5f')](function(_0x5c9870){logger[_0x0532('0x53')](_0x0532('0x5e'),JSON['stringify'](_0x5c9870));});};exports['abandoned']=function(_0xee117b,_0x2bab34,_0x2f568f,_0xf96ef8,_0xe02708,_0x1e9c5f){var _0x755272,_0x51f33d;_0x1e9c5f['remoteUri']=intUtil[_0x0532('0x42')](_0x1e9c5f[_0x0532('0xd')]);_0x1e9c5f[_0x0532('0x43')]=intUtil[_0x0532('0x42')](_0x1e9c5f[_0x0532('0x43')]);if(_0xe02708&&_0xe02708[_0x0532('0x44')]){logger['info'](_0x0532('0x60'),_0x0532('0x46'));_0x2bab34['recordingURL']=util[_0x0532('0x13')](_0x0532('0x48'),_0x1e9c5f[_0x0532('0x43')],_0x2bab34[_0x0532('0x49')],md5(_0x2bab34[_0x0532('0x49')]));}else{_0x2bab34[_0x0532('0x47')]='';}headers[_0x0532('0x4a')]=getAuth(_0x1e9c5f);return getUser(_0x1e9c5f)[_0x0532('0xe')](function(_0x1db5c0){_0x755272=_0x1db5c0;logger['info']('The\x20User\x20ID\x20is:',_0x755272['id']);return getEndUser(_0x1e9c5f,_0x2bab34[_0x0532('0x61')],_0x2bab34['calleridnum']);})[_0x0532('0xe')](function(_0x39c092){_0x51f33d=_0x39c092;logger['info'](_0x0532('0x4c'),_0x51f33d['id']);return getTicket(_0x1e9c5f,_0x755272,_0x51f33d,_0x2f568f,_0x2bab34);})['then'](function(_0x53afbd){if(_0x53afbd){logger[_0x0532('0x11')](_0x0532('0x4d'));logger[_0x0532('0x11')]('The\x20Ticket\x20ID\x20is:',_0x53afbd['id']);}})[_0x0532('0x5f')](function(_0x3c3317){logger[_0x0532('0x53')](_0x0532('0x60'),JSON[_0x0532('0x55')](_0x3c3317));});}; \ 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 3d3763b..7a76b21 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 _0xffdc=['%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','abandoned','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','util','./util','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','POST','remoteUri','username','password','clientSecret','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','catch','message','toLowerCase','outbound','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','destcalleridnum','telephone1','contactid',']\x20Enduser\x20created!','forEach','nameField','customField','indexOf','content','ticketType','incident','assign','getString','Descriptions','/contacts(','phonecall','phonecalls','Subjects','callDirection','queue','Fields','format'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xffdc,0x7f));var _0xcffd=function(_0x36e0f6,_0x4da6a7){_0x36e0f6=_0x36e0f6-0x0;var _0xc90479=_0xffdc[_0x36e0f6];return _0xc90479;};'use strict';var _=require(_0xcffd('0x0'));var BPromise=require(_0xcffd('0x1'));var rp=require('request-promise');var util=require(_0xcffd('0x2'));var intUtil=require(_0xcffd('0x3'));var md5=require('md5');var Redis=require(_0xcffd('0x4'));var logger=require(_0xcffd('0x5'))(_0xcffd('0x6'));var config=require(_0xcffd('0x7'));config[_0xcffd('0x8')]=_['defaults'](config[_0xcffd('0x8')],{'host':_0xcffd('0x9'),'port':0x18eb});var io=require(_0xcffd('0xa'))(new Redis(config[_0xcffd('0x8')]));function getAuthToken(_0x199df3,_0x463334,_0x552fa7){var _0x7eddb6={'method':_0xcffd('0xb'),'uri':_0x463334,'form':{'client_id':_0x199df3['clientId'],'resource':_0x199df3[_0xcffd('0xc')],'username':_0x199df3[_0xcffd('0xd')],'password':_0x199df3[_0xcffd('0xe')],'grant_type':'password','client_secret':_0x199df3[_0xcffd('0xf')]},'json':!![]};return rp(_0x7eddb6)[_0xcffd('0x10')](function(_0x1f6494){return _0x1f6494[_0xcffd('0x11')];})['catch'](function(_0x55a51a){logger[_0xcffd('0x12')]('['+[_0x552fa7[_0xcffd('0x13')]()]+_0xcffd('0x14'));return _0x55a51a['message'];});}function getUser(_0x25156f,_0x4dcb59,_0x5b9df3,_0x765795,_0x20e134,_0x4edde4){return new BPromise(function(_0x1cda29,_0x232a40){return getAuthToken(_0x4dcb59,_0x765795,_0x4edde4)[_0xcffd('0x10')](function(_0x32f579){var _0x4ec386={'method':'GET','uri':_0x20e134+_0xcffd('0x15'),'headers':{'Authorization':_0xcffd('0x16')+_0x32f579,'OData-Version':_0xcffd('0x17')},'json':!![]};return rp(_0x4ec386);})[_0xcffd('0x10')](function(_0x867e85){var _0x55b5db=_0x867e85[_0xcffd('0x18')];var _0x5c3701=![];var _0x18e9e1=null;if(!_[_0xcffd('0x19')](_0x5b9df3)){if(intUtil[_0xcffd('0x1a')](_0x5b9df3[_0xcffd('0x1b')])){_0x25156f[_0xcffd('0x1c')]=_0x5b9df3[_0xcffd('0x1b')];for(_0x18e9e1=0x0;_0x18e9e1<_0x55b5db[_0xcffd('0x1d')];_0x18e9e1++){if(_0x55b5db[_0x18e9e1][_0xcffd('0x1e')]===_0x5b9df3['email']&&!_0x55b5db[_0x18e9e1][_0xcffd('0x1f')]){_0x5c3701=!![];logger[_0xcffd('0x20')]('['+[_0x4edde4[_0xcffd('0x13')]()]+_0xcffd('0x21')+_0x55b5db[_0x18e9e1][_0xcffd('0x22')]+'!');_0x25156f[_0xcffd('0x23')]=_0x55b5db[_0x18e9e1][_0xcffd('0x22')];}}}}if(!_0x5c3701){logger['info']('['+[_0x4edde4['toUpperCase']()]+_0xcffd('0x24'));_0x25156f[_0xcffd('0x1c')]=_0x4dcb59[_0xcffd('0xd')];for(_0x18e9e1=0x0;_0x18e9e1<_0x55b5db[_0xcffd('0x1d')];_0x18e9e1++){if(_0x55b5db[_0x18e9e1][_0xcffd('0x1e')]===_0x4dcb59[_0xcffd('0xd')]){_0x25156f[_0xcffd('0x23')]=_0x55b5db[_0x18e9e1][_0xcffd('0x22')];}}}_0x1cda29(_0x25156f);})[_0xcffd('0x25')](function(_0x19e0d9){_0x232a40(_0x19e0d9[_0xcffd('0x26')]);});});}function createEndUser(_0x1f232a,_0x544ae7,_0x102f93,_0x2b5044,_0x2c66a7,_0x547bdb){return new BPromise(function(_0x21bad3,_0x9840b2){return getAuthToken(_0x544ae7,_0x102f93,_0x547bdb)[_0xcffd('0x10')](function(_0x5d0859){var _0x4f0078=_0x547bdb[_0xcffd('0x27')]()===_0xcffd('0x28')?_0x2c66a7['destcalleridnum']:_0x2c66a7[_0xcffd('0x29')];var _0x6641e={'method':'POST','uri':_0x2b5044+_0xcffd('0x2a'),'body':{'telephone1':_0x4f0078,'fullname':_0x4f0078,'firstname':_0x4f0078,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xcffd('0x2b')+_0x1f232a['userId']+')'},'headers':{'Authorization':'Bearer\x20'+_0x5d0859,'OData-Version':_0xcffd('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x6641e);})[_0xcffd('0x10')](function(_0x318cdf){var _0x5eea07=_0x318cdf[_0xcffd('0x2c')][_0xcffd('0x2d')];var _0x47bbba=_0x5eea07[_0xcffd('0x2e')](_0x5eea07[_0xcffd('0x2f')]('(')+0x1,_0x5eea07['lastIndexOf'](')'));_0x1f232a[_0xcffd('0x30')]=_0x47bbba;_0x21bad3(_0x1f232a);})['catch'](function(_0x3547f0){_0x9840b2(_0x3547f0[_0xcffd('0x26')]);});});}function getEndUser(_0x481c36,_0x3a86e2,_0x4d5768,_0x4e4f2a,_0x15549b,_0x4714b6){return new BPromise(function(_0x1f7b1e,_0x4c5044){return getAuthToken(_0x3a86e2,_0x4d5768,_0x4714b6)['then'](function(_0x7ab8be){var _0x434cfb={'method':'GET','uri':_0x4e4f2a+'contacts?$select=telephone1','headers':{'Authorization':_0xcffd('0x16')+_0x7ab8be,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x434cfb);})[_0xcffd('0x10')](function(_0x19b027){var _0x2144bc=null;if(_0x19b027){var _0x40a6d3=_0x19b027[_0xcffd('0x18')];var _0x1cbc39=![];for(_0x2144bc=0x0;_0x2144bc<_0x40a6d3['length'];_0x2144bc++){var _0xa95819=_0x4714b6[_0xcffd('0x27')]()===_0xcffd('0x28')?_0x15549b[_0xcffd('0x31')]:_0x15549b[_0xcffd('0x29')];if(_0x40a6d3[_0x2144bc][_0xcffd('0x32')]===_0xa95819){_0x1cbc39=!![];_0x481c36['enduserId']=_0x40a6d3[_0x2144bc][_0xcffd('0x33')];}}if(_0x1cbc39){_0x1f7b1e(_0x481c36);}else{return createEndUser(_0x481c36,_0x3a86e2,_0x4d5768,_0x4e4f2a,_0x15549b,_0x4714b6)['then'](function(_0x1b9ffd){logger['info']('['+[_0x4714b6[_0xcffd('0x13')]()]+_0xcffd('0x34'),_0x1b9ffd[_0xcffd('0x30')]);_0x1f7b1e(_0x1b9ffd);});}}else{return createEndUser(_0x481c36,_0x3a86e2,_0x4d5768,_0x4e4f2a,_0x15549b,_0x4714b6)[_0xcffd('0x10')](function(_0x22eb39){logger[_0xcffd('0x20')]('['+[_0x4714b6[_0xcffd('0x13')]()]+']\x20Enduser\x20Created!',_0x22eb39[_0xcffd('0x30')]);_0x1f7b1e(_0x22eb39);});}});});}function getCustomFields(_0x24f534,_0x10dc5b,_0x53823e){var _0x125438={};if(_0x24f534[_0xcffd('0x1d')]>0x0){_[_0xcffd('0x35')](_0x24f534,function(_0x47ea69){if(_0x47ea69['type']==='string'&&_0x47ea69[_0xcffd('0x36')]&&!_0x47ea69[_0xcffd('0x37')]){var _0x3d3650=_0x47ea69['idField'][_0xcffd('0x27')]();var _0x35cfd9=_0x3d3650[_0xcffd('0x2e')](0x0,_0x3d3650[_0xcffd('0x38')]('_'));var _0x34f019=_0x3d3650[_0xcffd('0x2e')](_0x3d3650['indexOf']('_')+0x1);if(_0x35cfd9===_0x53823e){_0x125438[_0x34f019]=_0x47ea69[_0xcffd('0x39')];}}});}return _0x125438;}function getTicket(_0xb9d687,_0x5913d2,_0x454735,_0x587a53,_0x5cb0a9,_0x23e8fc,_0xeebe28){return new BPromise(function(_0x1d54b2,_0x27d5fb){var _0x3542c2;return getAuthToken(_0x5913d2,_0x454735,_0xeebe28)[_0xcffd('0x10')](function(_0x2c33a4){if(_0x23e8fc[_0xcffd('0x3a')]===_0xcffd('0x3b')){_0x3542c2={'method':_0xcffd('0xb'),'uri':_0x587a53+'incidents','body':Object[_0xcffd('0x3c')]({},{'title':intUtil[_0xcffd('0x3d')](_0x23e8fc['Subjects'],_0x5cb0a9,'\x20'),'description':intUtil['getString'](_0x23e8fc[_0xcffd('0x3e')],_0x5cb0a9,'\x0a'),'customerid_contact@odata.bind':_0xcffd('0x3f')+_0xb9d687[_0xcffd('0x30')]+')','ownerid@odata.bind':_0xcffd('0x2b')+_0xb9d687[_0xcffd('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x23e8fc['Fields'],_0x5cb0a9,_0x23e8fc['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x2c33a4,'OData-Version':_0xcffd('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x23e8fc[_0xcffd('0x3a')]===_0xcffd('0x40')){_0x3542c2={'method':_0xcffd('0xb'),'uri':_0x587a53+_0xcffd('0x41'),'body':Object[_0xcffd('0x3c')]({},{'subject':intUtil[_0xcffd('0x3d')](_0x23e8fc[_0xcffd('0x42')],_0x5cb0a9,'\x20'),'phonenumber':String(_0x5cb0a9[_0xcffd('0x29')]),'description':intUtil[_0xcffd('0x3d')](_0x23e8fc[_0xcffd('0x3e')],_0x5cb0a9,'\x0a'),'regardingobjectid_contact@odata.bind':_0xcffd('0x3f')+_0xb9d687[_0xcffd('0x30')]+')','ownerid@odata.bind':_0xcffd('0x2b')+_0xb9d687['userId']+')','directioncode':_0xb9d687[_0xcffd('0x43')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0xb9d687[_0xcffd('0x23')]+')','participationtypemask':_0xb9d687['callDirection']===_0xcffd('0x44')?0x2:0x1},{'partyid_contact@odata.bind':_0xcffd('0x3f')+_0xb9d687['enduserId']+')','participationtypemask':_0xb9d687[_0xcffd('0x43')]===_0xcffd('0x44')?0x1:0x2}]},getCustomFields(_0x23e8fc[_0xcffd('0x45')],_0x5cb0a9,_0x23e8fc[_0xcffd('0x3a')])),'headers':{'Authorization':_0xcffd('0x16')+_0x2c33a4,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3542c2);})[_0xcffd('0x10')](function(_0x157c06){var _0x5fddf6=_0x157c06[_0xcffd('0x2c')][_0xcffd('0x2d')];var _0x2cc53f=_0x5fddf6[_0xcffd('0x2e')](_0x5fddf6['lastIndexOf']('(')+0x1,_0x5fddf6['lastIndexOf'](')'));_0xb9d687['ticketId']=_0x2cc53f;_0x1d54b2(_0xb9d687);})['catch'](function(_0x47de27){_0x27d5fb(_0x47de27[_0xcffd('0x26')]);});});}function emit(_0x5076ca,_0x53b879,_0x40c270,_0x44945a){var _0xef5848={'uri':util[_0xcffd('0x46')](_0xcffd('0x47'),_0x5076ca,_0x40c270,_0x44945a)};io['to'](util[_0xcffd('0x46')](_0xcffd('0x48'),_0x53b879))[_0xcffd('0x49')](_0xcffd('0x4a'),_0xef5848);}exports['cs']=function(_0x3a4ddc,_0x26aa37,_0x347d99,_0x339520,_0x255fc1,_0x177e7b,_0x4a6820,_0x1a1603){var _0x36271b={};_0x177e7b[_0xcffd('0xc')]=intUtil[_0xcffd('0x4b')](_0x177e7b[_0xcffd('0xc')]);_0x177e7b[_0xcffd('0x4c')]=intUtil[_0xcffd('0x4b')](_0x177e7b[_0xcffd('0x4c')]);_0x36271b[_0xcffd('0x43')]=_0x1a1603===_0xcffd('0x44')||_0x1a1603===_0xcffd('0x4d')?_0xcffd('0x44'):_0xcffd('0x28');var _0x296e9a=util[_0xcffd('0x46')](_0xcffd('0x4e'),_0x177e7b[_0xcffd('0xc')]);var _0x5420d4=util[_0xcffd('0x46')](_0xcffd('0x4f'),_0x177e7b['tenantId']);var _0x5a6666=util[_0xcffd('0x46')](_0xcffd('0x50'),_0x177e7b['serverUrl'],_0x26aa37[_0xcffd('0x51')],md5(_0x26aa37[_0xcffd('0x51')]));if(_0x255fc1&&_0x255fc1[_0xcffd('0x52')]){logger['info'](_0xcffd('0x53'),_0xcffd('0x54'));_0x26aa37[_0xcffd('0x55')]=_0x5a6666;}else if(_0x4a6820&&_0x4a6820[_0xcffd('0x56')]&&_0x4a6820[_0xcffd('0x56')]!==_0xcffd('0x57')){logger[_0xcffd('0x20')](_0xcffd('0x58'),_0xcffd('0x54'));_0x26aa37[_0xcffd('0x55')]=_0x5a6666;}else{_0x26aa37[_0xcffd('0x55')]='';}return getUser(_0x36271b,_0x177e7b,_0x339520,_0x5420d4,_0x296e9a,_0x1a1603)[_0xcffd('0x10')](function(_0x3c8696){logger[_0xcffd('0x20')]('['+_0x1a1603[_0xcffd('0x13')]()+_0xcffd('0x59'),_0x3c8696[_0xcffd('0x23')]);logger[_0xcffd('0x20')]('['+_0x1a1603[_0xcffd('0x13')]()+_0xcffd('0x5a'),_0x3c8696[_0xcffd('0x1c')]);return getEndUser(_0x3c8696,_0x177e7b,_0x5420d4,_0x296e9a,_0x26aa37,_0x1a1603);})[_0xcffd('0x10')](function(_0x1444ac){logger[_0xcffd('0x20')]('['+_0x1a1603[_0xcffd('0x13')]()+_0xcffd('0x5b'),_0x1444ac[_0xcffd('0x30')]);logger[_0xcffd('0x20')]('['+_0x1a1603[_0xcffd('0x13')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x26aa37[_0xcffd('0x29')]);return getTicket(_0x1444ac,_0x177e7b,_0x5420d4,_0x296e9a,_0x26aa37,_0x347d99,_0x1a1603);})['then'](function(_0x406dc5){logger[_0xcffd('0x20')](util[_0xcffd('0x46')]('['+_0x1a1603[_0xcffd('0x13')]()+_0xcffd('0x5c'),_0x347d99[_0xcffd('0x3a')],_0x406dc5[_0xcffd('0x5d')]));logger[_0xcffd('0x20')](util[_0xcffd('0x46')]('['+_0x1a1603[_0xcffd('0x13')]()+_0xcffd('0x5e'),_0x1a1603));if(_0x1a1603!==_0xcffd('0x4d')){logger['info']('['+_0x1a1603['toUpperCase']()+']',_0xcffd('0x5f'));emit(_0x177e7b[_0xcffd('0xc')],_0x339520[_0xcffd('0x60')],_0x347d99[_0xcffd('0x3a')],_0x406dc5[_0xcffd('0x5d')]);}})['catch'](function(_0x3575b8){logger['error']('['+_0x1a1603[_0xcffd('0x13')]()+_0xcffd('0x61'),util[_0xcffd('0x62')](_0x3575b8,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xd8b2=['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','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:','ticketId',']\x20Call\x20direction:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','bluebird','request-promise','./util','md5','ioredis','dynamics365','redis','defaults','localhost','socket.io-emitter','clientId','remoteUri','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','internalemailaddress','outbound','calleridnum','POST','/systemusers(','substring','lastIndexOf','enduserId','contacts?$select=telephone1','toLowerCase','destcalleridnum','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','type','string','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Descriptions','/contacts(','phonecall','Subjects','callDirection','queue','Fields','headers','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd8b2,0x145));var _0x2d8b=function(_0x224c31,_0x1f0016){_0x224c31=_0x224c31-0x0;var _0x200c5c=_0xd8b2[_0x224c31];return _0x200c5c;};'use strict';var _=require('lodash');var BPromise=require(_0x2d8b('0x0'));var rp=require(_0x2d8b('0x1'));var util=require('util');var intUtil=require(_0x2d8b('0x2'));var md5=require(_0x2d8b('0x3'));var Redis=require(_0x2d8b('0x4'));var logger=require('../../../../config/logger')(_0x2d8b('0x5'));var config=require('../../../../config/environment');config[_0x2d8b('0x6')]=_[_0x2d8b('0x7')](config[_0x2d8b('0x6')],{'host':_0x2d8b('0x8'),'port':0x18eb});var io=require(_0x2d8b('0x9'))(new Redis(config[_0x2d8b('0x6')]));function getAuthToken(_0x428f4c,_0x460910,_0x435c25){var _0xb9765e={'method':'POST','uri':_0x460910,'form':{'client_id':_0x428f4c[_0x2d8b('0xa')],'resource':_0x428f4c[_0x2d8b('0xb')],'username':_0x428f4c['username'],'password':_0x428f4c['password'],'grant_type':_0x2d8b('0xc'),'client_secret':_0x428f4c[_0x2d8b('0xd')]},'json':!![]};return rp(_0xb9765e)[_0x2d8b('0xe')](function(_0x5edb3b){return _0x5edb3b[_0x2d8b('0xf')];})[_0x2d8b('0x10')](function(_0xe6e4b6){logger[_0x2d8b('0x11')]('['+[_0x435c25[_0x2d8b('0x12')]()]+_0x2d8b('0x13'));return _0xe6e4b6[_0x2d8b('0x14')];});}function getUser(_0x5a7c16,_0x54683a,_0x56f83d,_0x4b06d0,_0x589b45,_0x58f67b){return new BPromise(function(_0x5a5bdb,_0x2370a4){return getAuthToken(_0x54683a,_0x4b06d0,_0x58f67b)[_0x2d8b('0xe')](function(_0x1d0f9d){var _0x158253={'method':_0x2d8b('0x15'),'uri':_0x589b45+_0x2d8b('0x16'),'headers':{'Authorization':_0x2d8b('0x17')+_0x1d0f9d,'OData-Version':_0x2d8b('0x18')},'json':!![]};return rp(_0x158253);})[_0x2d8b('0xe')](function(_0x327a7e){var _0x22c0e3=_0x327a7e[_0x2d8b('0x19')];var _0x59ef09=![];var _0x36509c=null;if(!_[_0x2d8b('0x1a')](_0x56f83d)){if(intUtil[_0x2d8b('0x1b')](_0x56f83d[_0x2d8b('0x1c')])){_0x5a7c16[_0x2d8b('0x1d')]=_0x56f83d[_0x2d8b('0x1c')];for(_0x36509c=0x0;_0x36509c<_0x22c0e3[_0x2d8b('0x1e')];_0x36509c++){if(_0x22c0e3[_0x36509c]['internalemailaddress']===_0x56f83d[_0x2d8b('0x1c')]&&!_0x22c0e3[_0x36509c]['isdisabled']){_0x59ef09=!![];logger[_0x2d8b('0x1f')]('['+[_0x58f67b[_0x2d8b('0x12')]()]+_0x2d8b('0x20')+_0x22c0e3[_0x36509c][_0x2d8b('0x21')]+'!');_0x5a7c16[_0x2d8b('0x22')]=_0x22c0e3[_0x36509c][_0x2d8b('0x21')];}}}}if(!_0x59ef09){logger[_0x2d8b('0x1f')]('['+[_0x58f67b['toUpperCase']()]+_0x2d8b('0x23'));_0x5a7c16[_0x2d8b('0x1d')]=_0x54683a[_0x2d8b('0x24')];for(_0x36509c=0x0;_0x36509c<_0x22c0e3[_0x2d8b('0x1e')];_0x36509c++){if(_0x22c0e3[_0x36509c][_0x2d8b('0x25')]===_0x54683a[_0x2d8b('0x24')]){_0x5a7c16[_0x2d8b('0x22')]=_0x22c0e3[_0x36509c][_0x2d8b('0x21')];}}}_0x5a5bdb(_0x5a7c16);})[_0x2d8b('0x10')](function(_0x576e9d){_0x2370a4(_0x576e9d[_0x2d8b('0x14')]);});});}function createEndUser(_0x2a7c9d,_0x149dc7,_0x36ac17,_0x1f667e,_0x47743b,_0x468d1d){return new BPromise(function(_0x5321fe,_0x3d2f4c){return getAuthToken(_0x149dc7,_0x36ac17,_0x468d1d)[_0x2d8b('0xe')](function(_0x23893c){var _0x2073db=_0x468d1d['toLowerCase']()===_0x2d8b('0x26')?_0x47743b['destcalleridnum']:_0x47743b[_0x2d8b('0x27')];var _0x1a368b={'method':_0x2d8b('0x28'),'uri':_0x1f667e+'contacts','body':{'telephone1':_0x2073db,'fullname':_0x2073db,'firstname':_0x2073db,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x2d8b('0x29')+_0x2a7c9d['userId']+')'},'headers':{'Authorization':_0x2d8b('0x17')+_0x23893c,'OData-Version':_0x2d8b('0x18')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x1a368b);})[_0x2d8b('0xe')](function(_0x16911f){var _0x524915=_0x16911f['headers']['odata-entityid'];var _0x2679e9=_0x524915[_0x2d8b('0x2a')](_0x524915[_0x2d8b('0x2b')]('(')+0x1,_0x524915['lastIndexOf'](')'));_0x2a7c9d[_0x2d8b('0x2c')]=_0x2679e9;_0x5321fe(_0x2a7c9d);})[_0x2d8b('0x10')](function(_0x41b7c0){_0x3d2f4c(_0x41b7c0['message']);});});}function getEndUser(_0xb4b3d1,_0x997f8c,_0x23898e,_0x352d04,_0x2fe6ae,_0x53ad89){return new BPromise(function(_0x164167,_0x2cb498){return getAuthToken(_0x997f8c,_0x23898e,_0x53ad89)[_0x2d8b('0xe')](function(_0x164214){var _0x4e03d4={'method':_0x2d8b('0x15'),'uri':_0x352d04+_0x2d8b('0x2d'),'headers':{'Authorization':'Bearer\x20'+_0x164214,'If-None-Match':null,'OData-Version':_0x2d8b('0x18')},'json':!![]};return rp(_0x4e03d4);})[_0x2d8b('0xe')](function(_0x4bed33){var _0x3fdfc1=null;if(_0x4bed33){var _0x564ef0=_0x4bed33[_0x2d8b('0x19')];var _0x51639c=![];for(_0x3fdfc1=0x0;_0x3fdfc1<_0x564ef0[_0x2d8b('0x1e')];_0x3fdfc1++){var _0x419354=_0x53ad89[_0x2d8b('0x2e')]()===_0x2d8b('0x26')?_0x2fe6ae[_0x2d8b('0x2f')]:_0x2fe6ae[_0x2d8b('0x27')];if(_0x564ef0[_0x3fdfc1][_0x2d8b('0x30')]===_0x419354){_0x51639c=!![];_0xb4b3d1[_0x2d8b('0x2c')]=_0x564ef0[_0x3fdfc1][_0x2d8b('0x31')];}}if(_0x51639c){_0x164167(_0xb4b3d1);}else{return createEndUser(_0xb4b3d1,_0x997f8c,_0x23898e,_0x352d04,_0x2fe6ae,_0x53ad89)[_0x2d8b('0xe')](function(_0x4d4b8a){logger[_0x2d8b('0x1f')]('['+[_0x53ad89['toUpperCase']()]+_0x2d8b('0x32'),_0x4d4b8a[_0x2d8b('0x2c')]);_0x164167(_0x4d4b8a);});}}else{return createEndUser(_0xb4b3d1,_0x997f8c,_0x23898e,_0x352d04,_0x2fe6ae,_0x53ad89)[_0x2d8b('0xe')](function(_0x10f8a2){logger[_0x2d8b('0x1f')]('['+[_0x53ad89[_0x2d8b('0x12')]()]+_0x2d8b('0x33'),_0x10f8a2[_0x2d8b('0x2c')]);_0x164167(_0x10f8a2);});}});});}function getCustomFields(_0x570f8a,_0x28e721,_0x660dd){var _0x4a8854={};if(_0x570f8a[_0x2d8b('0x1e')]>0x0){_[_0x2d8b('0x34')](_0x570f8a,function(_0x3d3b72){if(_0x3d3b72[_0x2d8b('0x35')]===_0x2d8b('0x36')&&_0x3d3b72['nameField']&&!_0x3d3b72[_0x2d8b('0x37')]){var _0x50f043=_0x3d3b72[_0x2d8b('0x38')][_0x2d8b('0x2e')]();var _0x525ff9=_0x50f043[_0x2d8b('0x2a')](0x0,_0x50f043[_0x2d8b('0x39')]('_'));var _0x8ea436=_0x50f043['substring'](_0x50f043[_0x2d8b('0x39')]('_')+0x1);if(_0x525ff9===_0x660dd){_0x4a8854[_0x8ea436]=_0x3d3b72[_0x2d8b('0x3a')];}}});}return _0x4a8854;}function getTicket(_0x109655,_0x252b7b,_0x2ddf4c,_0x287bdb,_0x5b29fc,_0x414f78,_0x2ddc26){return new BPromise(function(_0x50b131,_0xc1c31d){var _0x322aba;return getAuthToken(_0x252b7b,_0x2ddf4c,_0x2ddc26)[_0x2d8b('0xe')](function(_0x53ff4d){if(_0x414f78[_0x2d8b('0x3b')]===_0x2d8b('0x3c')){_0x322aba={'method':'POST','uri':_0x287bdb+_0x2d8b('0x3d'),'body':Object[_0x2d8b('0x3e')]({},{'title':intUtil[_0x2d8b('0x3f')](_0x414f78['Subjects'],_0x5b29fc,'\x20'),'description':intUtil[_0x2d8b('0x3f')](_0x414f78[_0x2d8b('0x40')],_0x5b29fc,'\x0a'),'customerid_contact@odata.bind':_0x2d8b('0x41')+_0x109655[_0x2d8b('0x2c')]+')','ownerid@odata.bind':_0x2d8b('0x29')+_0x109655[_0x2d8b('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x414f78['Fields'],_0x5b29fc,_0x414f78[_0x2d8b('0x3b')])),'headers':{'Authorization':_0x2d8b('0x17')+_0x53ff4d,'OData-Version':_0x2d8b('0x18')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x414f78[_0x2d8b('0x3b')]===_0x2d8b('0x42')){_0x322aba={'method':_0x2d8b('0x28'),'uri':_0x287bdb+'phonecalls','body':Object[_0x2d8b('0x3e')]({},{'subject':intUtil['getString'](_0x414f78[_0x2d8b('0x43')],_0x5b29fc,'\x20'),'phonenumber':String(_0x5b29fc[_0x2d8b('0x27')]),'description':intUtil[_0x2d8b('0x3f')](_0x414f78[_0x2d8b('0x40')],_0x5b29fc,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2d8b('0x41')+_0x109655[_0x2d8b('0x2c')]+')','ownerid@odata.bind':_0x2d8b('0x29')+_0x109655['userId']+')','directioncode':_0x109655[_0x2d8b('0x44')]===_0x2d8b('0x45')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x2d8b('0x29')+_0x109655[_0x2d8b('0x22')]+')','participationtypemask':_0x109655[_0x2d8b('0x44')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x2d8b('0x41')+_0x109655[_0x2d8b('0x2c')]+')','participationtypemask':_0x109655[_0x2d8b('0x44')]===_0x2d8b('0x45')?0x1:0x2}]},getCustomFields(_0x414f78[_0x2d8b('0x46')],_0x5b29fc,_0x414f78['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x53ff4d,'OData-Version':_0x2d8b('0x18')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x322aba);})['then'](function(_0x482de2){var _0x345395=_0x482de2[_0x2d8b('0x47')]['odata-entityid'];var _0x296b55=_0x345395[_0x2d8b('0x2a')](_0x345395[_0x2d8b('0x2b')]('(')+0x1,_0x345395[_0x2d8b('0x2b')](')'));_0x109655['ticketId']=_0x296b55;_0x50b131(_0x109655);})[_0x2d8b('0x10')](function(_0x42b18f){_0xc1c31d(_0x42b18f[_0x2d8b('0x14')]);});});}function emit(_0x2960d0,_0x1cf325,_0x5f0fcb,_0x3764bc){var _0x3f8d90={'uri':util[_0x2d8b('0x48')](_0x2d8b('0x49'),_0x2960d0,_0x5f0fcb,_0x3764bc)};io['to'](util[_0x2d8b('0x48')](_0x2d8b('0x4a'),_0x1cf325))[_0x2d8b('0x4b')](_0x2d8b('0x4c'),_0x3f8d90);}exports['cs']=function(_0x323206,_0x46e81b,_0x5f0faf,_0x520032,_0x5b05bd,_0x3d8691,_0x225bf0,_0x392d34){var _0x1f260a={};_0x3d8691[_0x2d8b('0xb')]=intUtil[_0x2d8b('0x4d')](_0x3d8691[_0x2d8b('0xb')]);_0x3d8691[_0x2d8b('0x4e')]=intUtil['stripTrailingSlash'](_0x3d8691[_0x2d8b('0x4e')]);_0x1f260a[_0x2d8b('0x44')]=_0x392d34===_0x2d8b('0x45')||_0x392d34===_0x2d8b('0x4f')?'queue':_0x2d8b('0x26');var _0x37845d=util[_0x2d8b('0x48')](_0x2d8b('0x50'),_0x3d8691[_0x2d8b('0xb')]);var _0x305715=util['format'](_0x2d8b('0x51'),_0x3d8691[_0x2d8b('0x52')]);var _0x41a4ef=util[_0x2d8b('0x48')](_0x2d8b('0x53'),_0x3d8691[_0x2d8b('0x4e')],_0x46e81b[_0x2d8b('0x54')],md5(_0x46e81b[_0x2d8b('0x54')]));if(_0x5b05bd&&_0x5b05bd[_0x2d8b('0x55')]){logger[_0x2d8b('0x1f')](_0x2d8b('0x56'),_0x2d8b('0x57'));_0x46e81b[_0x2d8b('0x58')]=_0x41a4ef;}else if(_0x225bf0&&_0x225bf0[_0x2d8b('0x59')]&&_0x225bf0[_0x2d8b('0x59')]!==_0x2d8b('0x5a')){logger[_0x2d8b('0x1f')](_0x2d8b('0x5b'),_0x2d8b('0x57'));_0x46e81b['recordingURL']=_0x41a4ef;}else{_0x46e81b[_0x2d8b('0x58')]='';}return getUser(_0x1f260a,_0x3d8691,_0x520032,_0x305715,_0x37845d,_0x392d34)[_0x2d8b('0xe')](function(_0x49c856){logger[_0x2d8b('0x1f')]('['+_0x392d34['toUpperCase']()+_0x2d8b('0x5c'),_0x49c856[_0x2d8b('0x22')]);logger[_0x2d8b('0x1f')]('['+_0x392d34[_0x2d8b('0x12')]()+_0x2d8b('0x5d'),_0x49c856[_0x2d8b('0x1d')]);return getEndUser(_0x49c856,_0x3d8691,_0x305715,_0x37845d,_0x46e81b,_0x392d34);})[_0x2d8b('0xe')](function(_0x6c802f){logger['info']('['+_0x392d34['toUpperCase']()+_0x2d8b('0x5e'),_0x6c802f['enduserId']);logger[_0x2d8b('0x1f')]('['+_0x392d34[_0x2d8b('0x12')]()+_0x2d8b('0x5f'),_0x46e81b[_0x2d8b('0x27')]);return getTicket(_0x6c802f,_0x3d8691,_0x305715,_0x37845d,_0x46e81b,_0x5f0faf,_0x392d34);})[_0x2d8b('0xe')](function(_0xb97b93){logger['info'](util[_0x2d8b('0x48')]('['+_0x392d34[_0x2d8b('0x12')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x5f0faf[_0x2d8b('0x3b')],_0xb97b93[_0x2d8b('0x60')]));logger['info'](util[_0x2d8b('0x48')]('['+_0x392d34[_0x2d8b('0x12')]()+_0x2d8b('0x61'),_0x392d34));if(_0x392d34!==_0x2d8b('0x4f')){logger[_0x2d8b('0x1f')]('['+_0x392d34[_0x2d8b('0x12')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x3d8691['remoteUri'],_0x520032[_0x2d8b('0x62')],_0x5f0faf[_0x2d8b('0x3b')],_0xb97b93['ticketId']);}})[_0x2d8b('0x10')](function(_0x3b0123){logger[_0x2d8b('0x11')]('['+_0x392d34[_0x2d8b('0x12')]()+_0x2d8b('0x63'),util[_0x2d8b('0x64')](_0x3b0123,{'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 74ee5ea..c13c5ec 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 _0xdafa=['destcalleridname','destcalleridnum','error','abandoned','[ABANDONED]','recordingURL','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','Descriptions','Tags','name','Fields','keyBy','custom_fields','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','%s/api/v2/agents','length','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','stringify','GET','map','customField','nameField','toLowerCase','string','idField','content','type','variable','variableName','push','customVariable','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x180a8b,_0x2f9cbf){var _0xcefbb4=function(_0x536254){while(--_0x536254){_0x180a8b['push'](_0x180a8b['shift']());}};_0xcefbb4(++_0x2f9cbf);}(_0xdafa,0x1dc));var _0xadaf=function(_0x722fca,_0xc8e0e6){_0x722fca=_0x722fca-0x0;var _0x3de495=_0xdafa[_0x722fca];return _0x3de495;};'use strict';var _=require('lodash');var rp=require(_0xadaf('0x0'));var md5=require(_0xadaf('0x1'));var util=require(_0xadaf('0x2'));var Redis=require(_0xadaf('0x3'));var intUtil=require(_0xadaf('0x4'));var config=require(_0xadaf('0x5'));var logger=require(_0xadaf('0x6'))(_0xadaf('0x7'));config[_0xadaf('0x8')]=_[_0xadaf('0x9')](config['redis'],{'host':_0xadaf('0xa'),'port':0x18eb});var io=require(_0xadaf('0xb'))(new Redis(config[_0xadaf('0x8')]));var headers={'Content-Type':'application/json','Accept':_0xadaf('0xc')};function emit(_0xef82cb,_0x2679d7,_0x35fccd){io['to'](_0xef82cb)[_0xadaf('0xd')](_0x2679d7,_0x35fccd);}function getTicket(_0x6d3ad,_0x1123e8,_0x110df4,_0x161d93,_0x4223d3){logger[_0xadaf('0xe')](_0xadaf('0xf'));var _0x5f4579=_[_0xadaf('0x10')]({'responder_id':_0x1123e8['id'],'requester_id':_0x110df4['id'],'name':util[_0xadaf('0x11')](_0xadaf('0x12'),_0x4223d3[_0xadaf('0x13')]),'phone':_0x4223d3[_0xadaf('0x14')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x161d93[_0xadaf('0x15')],_0x4223d3,'\x20'),'description':intUtil['getString'](_0x161d93[_0xadaf('0x16')],_0x4223d3,'
'),'tags':getTags(_0x161d93[_0xadaf('0x17')],_0xadaf('0x18'))},getCustomFields(_0x161d93[_0xadaf('0x19')],_0x4223d3));_0x5f4579['custom_fields']=_['mapValues'](_[_0xadaf('0x1a')](_0x5f4579[_0xadaf('0x1b')],'id'),_0xadaf('0x1c'));return request({'uri':util[_0xadaf('0x11')](_0xadaf('0x1d'),_0x6d3ad[_0xadaf('0x1e')]),'method':_0xadaf('0x1f'),'body':_0x5f4579})[_0xadaf('0x20')](function(_0x18edcd){logger['info'](_0xadaf('0x21'));return _0x18edcd;});}function getUser(_0x1b6a8c,_0x4b11d7){if(intUtil['validateEmail'](_0x4b11d7)){return request({'uri':util[_0xadaf('0x11')](_0xadaf('0x22'),_0x1b6a8c[_0xadaf('0x1e')]),'qs':{'email':_0x4b11d7}})['then'](function(_0x394bb1){if(_0x394bb1[_0xadaf('0x23')]){logger['info']('Agent\x20found!');return _[_0xadaf('0x24')](_0x394bb1,function(_0x4c2855){return _0x4c2855[_0xadaf('0x25')][_0xadaf('0x26')]===_0x4b11d7;});}else{logger['info'](_0xadaf('0x27'));return request({'uri':util[_0xadaf('0x11')](_0xadaf('0x28'),_0x1b6a8c[_0xadaf('0x1e')])})[_0xadaf('0x20')](function(_0x42eb3f){logger['info']('Admin\x20account\x20selected.');return _0x42eb3f;});}});}else{logger['info'](_0xadaf('0x29'));return request({'uri':util[_0xadaf('0x11')](_0xadaf('0x28'),_0x1b6a8c[_0xadaf('0x1e')])})[_0xadaf('0x20')](function(_0x150e43){logger[_0xadaf('0xe')](_0xadaf('0x2a'));return _0x150e43;});}}function getEndUser(_0x586190,_0xcb4725,_0xd0c936){logger[_0xadaf('0xe')](_0xadaf('0x2b'),_0xd0c936);return request({'uri':util[_0xadaf('0x11')](_0xadaf('0x2c'),_0x586190['remoteUri']),'qs':{'phone':_0xd0c936}})[_0xadaf('0x20')](function(_0x1a87d4){if(_0x1a87d4[_0xadaf('0x23')]){logger[_0xadaf('0xe')](_0xadaf('0x2d'));return _['find'](_0x1a87d4,{'phone':_0xd0c936});}else{logger[_0xadaf('0xe')](_0xadaf('0x2e'));return request({'uri':util[_0xadaf('0x11')](_0xadaf('0x2c'),_0x586190[_0xadaf('0x1e')]),'method':_0xadaf('0x1f'),'body':{'name':_0xcb4725,'phone':_0xd0c936}})[_0xadaf('0x20')](function(_0x437e93){logger['info'](_0xadaf('0x2f'));return _0x437e93;});}});}function getAuth(_0x3ca06c){return util['format'](_0xadaf('0x30'),new Buffer(_0x3ca06c[_0xadaf('0x31')]+':X')[_0xadaf('0x32')](_0xadaf('0x33')));}function request(_0x429d95){logger[_0xadaf('0x34')]('[HTTP]',JSON[_0xadaf('0x35')](_0x429d95));return rp(_[_0xadaf('0x9')](_0x429d95,{'method':_0xadaf('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x741baf,_0x43953e){var _0x2931f4=[];if(_0x741baf&&_0x741baf[_0xadaf('0x23')]>0x0){_0x2931f4=_[_0xadaf('0x37')](_0x741baf,_0x43953e);}return _0x2931f4;}function getCustomFields(_0x23e6c4,_0x441675){var _0x233e34=[];var _0xce7edd={'custom_fields':[]};if(_0x23e6c4['length']>0x0){_['forEach'](_0x23e6c4,function(_0x3d1af7){if(_0x3d1af7['type']==='string'&&_0x3d1af7['nameField']&&!_0x3d1af7[_0xadaf('0x38')]){_0xce7edd[_0x3d1af7[_0xadaf('0x39')][_0xadaf('0x3a')]()]=_0x3d1af7['content']['toString']();}else if(_0x3d1af7['type']===_0xadaf('0x3b')&&_0x3d1af7['idField']&&_0x3d1af7['customField']){_0xce7edd['custom_fields']['push']({'id':_0x3d1af7[_0xadaf('0x3c')],'value':_0x3d1af7[_0xadaf('0x3d')][_0xadaf('0x32')]()});}else if(_0x3d1af7[_0xadaf('0x3e')]===_0xadaf('0x3f')&&_0x3d1af7[_0xadaf('0x40')]&&_0x3d1af7[_0xadaf('0x3c')]&&_0x3d1af7[_0xadaf('0x38')]){_0x441675[_0x3d1af7[_0xadaf('0x40')]]&&_0xce7edd[_0xadaf('0x1b')][_0xadaf('0x41')]({'id':_0x3d1af7[_0xadaf('0x3c')],'value':_0x441675[_0x3d1af7['variableName']][_0xadaf('0x32')]()});}else if(_0x3d1af7['type']===_0xadaf('0x42')&&_0x3d1af7[_0xadaf('0x43')]&&_0x3d1af7[_0xadaf('0x43')][_0xadaf('0x18')]&&_0x3d1af7[_0xadaf('0x3c')]&&_0x3d1af7[_0xadaf('0x38')]){_0x441675[_0x3d1af7['Variable'][_0xadaf('0x18')]['toLowerCase']()]&&_0xce7edd[_0xadaf('0x1b')][_0xadaf('0x41')]({'id':_0x3d1af7[_0xadaf('0x3c')],'value':_0x441675[_0x3d1af7[_0xadaf('0x43')]['name'][_0xadaf('0x3a')]()][_0xadaf('0x32')]()});}});}return _0xce7edd;}exports[_0xadaf('0x44')]=function(_0xa7974a,_0x3b002a,_0xaef367,_0x432d17,_0x57747d,_0x1e9adb){var _0x3756bd,_0x1a0fb3;_0x1e9adb[_0xadaf('0x1e')]=intUtil['stripTrailingSlash'](_0x1e9adb[_0xadaf('0x1e')]);_0x1e9adb[_0xadaf('0x45')]=intUtil[_0xadaf('0x46')](_0x1e9adb[_0xadaf('0x45')]);if(_0x57747d&&_0x57747d[_0xadaf('0x47')]){logger[_0xadaf('0xe')](_0xadaf('0x48'),_0xadaf('0x49'));_0x3b002a['recordingURL']=util[_0xadaf('0x11')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1e9adb[_0xadaf('0x45')],_0x3b002a[_0xadaf('0x4a')],md5(_0x3b002a[_0xadaf('0x4a')]));}else{_0x3b002a['recordingURL']='';}headers[_0xadaf('0x4b')]=getAuth(_0x1e9adb);return getUser(_0x1e9adb,_0x432d17['email'])[_0xadaf('0x20')](function(_0x143f82){_0x3756bd=_0x143f82;logger[_0xadaf('0xe')](_0xadaf('0x4c'),_0x3756bd['id']);return getEndUser(_0x1e9adb,_0x3b002a[_0xadaf('0x13')],_0x3b002a['calleridnum']);})[_0xadaf('0x20')](function(_0x404055){_0x1a0fb3=_0x404055;logger[_0xadaf('0xe')](_0xadaf('0x4d'),_0x1a0fb3['id']);return getTicket(_0x1e9adb,_0x3756bd,_0x1a0fb3,_0xaef367,_0x3b002a);})[_0xadaf('0x20')](function(_0x9fba51){if(_0x9fba51&&_0x9fba51['id']){logger[_0xadaf('0xe')](_0xadaf('0x21'));logger[_0xadaf('0xe')](_0xadaf('0x4e'),_0x9fba51['id']);logger['info'](_0xadaf('0x48'),_0xadaf('0x4f'));emit(util['format'](_0xadaf('0x50'),_0x432d17[_0xadaf('0x18')]),_0xadaf('0x51'),{'uri':util[_0xadaf('0x11')](_0xadaf('0x52'),_0x1e9adb[_0xadaf('0x1e')],_0x9fba51['id'])});}})[_0xadaf('0x53')](function(_0x117d59){logger['error'](_0xadaf('0x48'),JSON[_0xadaf('0x35')](_0x117d59));});};exports[_0xadaf('0x54')]=function(_0xca8014,_0x207f3b,_0x267e8e,_0x1a719c,_0x4ae036,_0x54206e,_0x1381ae){var _0x3f7b58,_0xae47c0;_0x54206e[_0xadaf('0x1e')]=intUtil['stripTrailingSlash'](_0x54206e[_0xadaf('0x1e')]);_0x54206e['serverUrl']=intUtil[_0xadaf('0x46')](_0x54206e[_0xadaf('0x45')]);if(_0x1381ae&&_0x1381ae['recordingFormat']&&_0x1381ae[_0xadaf('0x55')]!=='none'){logger['info'](_0xadaf('0x56'),'Recording\x20is\x20enabled!');_0x207f3b['recordingURL']=util[_0xadaf('0x11')](_0xadaf('0x57'),_0x54206e[_0xadaf('0x45')],_0x207f3b['uniqueid'],md5(_0x207f3b[_0xadaf('0x4a')]));}headers[_0xadaf('0x4b')]=getAuth(_0x54206e);return getUser(_0x54206e,_0x1a719c[_0xadaf('0x26')])[_0xadaf('0x20')](function(_0x5b75db){_0x3f7b58=_0x5b75db;logger[_0xadaf('0xe')](_0xadaf('0x4c'),_0x3f7b58['id']);return getEndUser(_0x54206e,_0x207f3b[_0xadaf('0x58')],_0x207f3b[_0xadaf('0x59')]);})['then'](function(_0x214c3d){_0xae47c0=_0x214c3d;logger[_0xadaf('0xe')](_0xadaf('0x4d'),_0xae47c0['id']);return getTicket(_0x54206e,_0x3f7b58,_0xae47c0,_0x267e8e,_0x207f3b);})[_0xadaf('0x20')](function(_0x5640a8){if(_0x5640a8&&_0x5640a8['id']){logger['info'](_0xadaf('0x21'));logger[_0xadaf('0xe')](_0xadaf('0x4e'),_0x5640a8['id']);logger[_0xadaf('0xe')]('[OUTBOUND]',_0xadaf('0x4f'));emit(util['format']('user:%s',_0x1a719c[_0xadaf('0x18')]),'trigger:browser:url',{'uri':util['format']('%s/helpdesk/tickets/%d',_0x54206e['remoteUri'],_0x5640a8['id'])});}})[_0xadaf('0x53')](function(_0x570ba3){logger[_0xadaf('0x5a')]('[OUTBOUND]',JSON[_0xadaf('0x35')](_0x570ba3));});};exports[_0xadaf('0x5b')]=function(_0x198015,_0x30a96a,_0x51eda4,_0x4f7fe4,_0x39e030,_0x5cef6c){var _0x39ffd7,_0x7dd617;_0x5cef6c[_0xadaf('0x1e')]=intUtil[_0xadaf('0x46')](_0x5cef6c[_0xadaf('0x1e')]);_0x5cef6c['serverUrl']=intUtil['stripTrailingSlash'](_0x5cef6c[_0xadaf('0x45')]);if(_0x39e030&&_0x39e030[_0xadaf('0x47')]){logger[_0xadaf('0xe')](_0xadaf('0x5c'),'Recording\x20is\x20enabled!');_0x30a96a[_0xadaf('0x5d')]=util[_0xadaf('0x11')](_0xadaf('0x57'),_0x5cef6c[_0xadaf('0x45')],_0x30a96a[_0xadaf('0x4a')],md5(_0x30a96a[_0xadaf('0x4a')]));}else{_0x30a96a[_0xadaf('0x5d')]='';}headers[_0xadaf('0x4b')]=getAuth(_0x5cef6c);return getUser(_0x5cef6c,'')[_0xadaf('0x20')](function(_0x3dfee5){_0x39ffd7=_0x3dfee5;logger[_0xadaf('0xe')]('The\x20User\x20ID\x20is:',_0x39ffd7['id']);return getEndUser(_0x5cef6c,_0x30a96a[_0xadaf('0x13')],_0x30a96a[_0xadaf('0x14')]);})[_0xadaf('0x20')](function(_0x535147){_0x7dd617=_0x535147;logger[_0xadaf('0xe')](_0xadaf('0x4d'),_0x7dd617['id']);return getTicket(_0x5cef6c,_0x39ffd7,_0x7dd617,_0x51eda4,_0x30a96a);})[_0xadaf('0x20')](function(_0x1b10c8){if(_0x1b10c8){logger[_0xadaf('0xe')](_0xadaf('0x21'));logger[_0xadaf('0xe')](_0xadaf('0x4e'),_0x1b10c8['id']);}})['catch'](function(_0x3f8220){logger[_0xadaf('0x5a')]('[ABANDONED]',JSON[_0xadaf('0x35')](_0x3f8220));});}; \ No newline at end of file +var _0xf9cc=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','recordingFormat','none','[OUTBOUND]','The\x20Enduser\x20ID\x20is:','%s/helpdesk/tickets/%d','abandoned','[ABANDONED]','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','socket.io-emitter','application/json','info','merge','format','calleridname','calleridnum','getString','Subjects','
','Tags','name','Fields','custom_fields','mapValues','%s/api/v2/tickets','POST','then','Ticket\x20created!','%s/api/v2/agents','remoteUri','length','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','base64','debug','[HTTP]','stringify','GET','forEach','type','string','nameField','customField','toLowerCase','content','toString','idField','variable','variableName','push','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!'];(function(_0x2a7125,_0x1349ae){var _0x2d75c1=function(_0x5656db){while(--_0x5656db){_0x2a7125['push'](_0x2a7125['shift']());}};_0x2d75c1(++_0x1349ae);}(_0xf9cc,0x112));var _0xcf9c=function(_0xccfe68,_0x4447f4){_0xccfe68=_0xccfe68-0x0;var _0x452fda=_0xf9cc[_0xccfe68];return _0x452fda;};'use strict';var _=require(_0xcf9c('0x0'));var rp=require(_0xcf9c('0x1'));var md5=require(_0xcf9c('0x2'));var util=require(_0xcf9c('0x3'));var Redis=require(_0xcf9c('0x4'));var intUtil=require(_0xcf9c('0x5'));var config=require(_0xcf9c('0x6'));var logger=require(_0xcf9c('0x7'))(_0xcf9c('0x8'));config[_0xcf9c('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xcf9c('0xa'))(new Redis(config[_0xcf9c('0x9')]));var headers={'Content-Type':_0xcf9c('0xb'),'Accept':'application/json'};function emit(_0x3d2d90,_0x2ac4dc,_0x249b89){io['to'](_0x3d2d90)['emit'](_0x2ac4dc,_0x249b89);}function getTicket(_0x2a9eed,_0x360f51,_0x5955b5,_0x95ce41,_0x1d5da2){logger[_0xcf9c('0xc')]('Creating\x20new\x20ticket...');var _0xce47a=_[_0xcf9c('0xd')]({'responder_id':_0x360f51['id'],'requester_id':_0x5955b5['id'],'name':util[_0xcf9c('0xe')]('Caller\x20-\x20%s',_0x1d5da2[_0xcf9c('0xf')]),'phone':_0x1d5da2[_0xcf9c('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xcf9c('0x11')](_0x95ce41[_0xcf9c('0x12')],_0x1d5da2,'\x20'),'description':intUtil[_0xcf9c('0x11')](_0x95ce41['Descriptions'],_0x1d5da2,_0xcf9c('0x13')),'tags':getTags(_0x95ce41[_0xcf9c('0x14')],_0xcf9c('0x15'))},getCustomFields(_0x95ce41[_0xcf9c('0x16')],_0x1d5da2));_0xce47a[_0xcf9c('0x17')]=_[_0xcf9c('0x18')](_['keyBy'](_0xce47a['custom_fields'],'id'),'value');return request({'uri':util[_0xcf9c('0xe')](_0xcf9c('0x19'),_0x2a9eed['remoteUri']),'method':_0xcf9c('0x1a'),'body':_0xce47a})[_0xcf9c('0x1b')](function(_0x2f04dd){logger[_0xcf9c('0xc')](_0xcf9c('0x1c'));return _0x2f04dd;});}function getUser(_0x14457a,_0x4ccaa7){if(intUtil['validateEmail'](_0x4ccaa7)){return request({'uri':util[_0xcf9c('0xe')](_0xcf9c('0x1d'),_0x14457a[_0xcf9c('0x1e')]),'qs':{'email':_0x4ccaa7}})[_0xcf9c('0x1b')](function(_0x1fc3ec){if(_0x1fc3ec[_0xcf9c('0x1f')]){logger[_0xcf9c('0xc')]('Agent\x20found!');return _['find'](_0x1fc3ec,function(_0x1ea635){return _0x1ea635['contact']['email']===_0x4ccaa7;});}else{logger[_0xcf9c('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xcf9c('0xe')](_0xcf9c('0x20'),_0x14457a[_0xcf9c('0x1e')])})[_0xcf9c('0x1b')](function(_0x2b1516){logger[_0xcf9c('0xc')](_0xcf9c('0x21'));return _0x2b1516;});}});}else{logger['info'](_0xcf9c('0x22'));return request({'uri':util[_0xcf9c('0xe')](_0xcf9c('0x20'),_0x14457a[_0xcf9c('0x1e')])})[_0xcf9c('0x1b')](function(_0x43eb17){logger['info'](_0xcf9c('0x21'));return _0x43eb17;});}}function getEndUser(_0x14bb00,_0x4cea39,_0x27efa5){logger[_0xcf9c('0xc')](_0xcf9c('0x23'),_0x27efa5);return request({'uri':util['format'](_0xcf9c('0x24'),_0x14bb00[_0xcf9c('0x1e')]),'qs':{'phone':_0x27efa5}})[_0xcf9c('0x1b')](function(_0x2add78){if(_0x2add78[_0xcf9c('0x1f')]){logger[_0xcf9c('0xc')]('Enduser\x20found!');return _[_0xcf9c('0x25')](_0x2add78,{'phone':_0x27efa5});}else{logger['info'](_0xcf9c('0x26'));return request({'uri':util[_0xcf9c('0xe')](_0xcf9c('0x24'),_0x14bb00[_0xcf9c('0x1e')]),'method':'POST','body':{'name':_0x4cea39,'phone':_0x27efa5}})[_0xcf9c('0x1b')](function(_0x2a4eab){logger[_0xcf9c('0xc')](_0xcf9c('0x27'));return _0x2a4eab;});}});}function getAuth(_0x1b71ca){return util[_0xcf9c('0xe')](_0xcf9c('0x28'),new Buffer(_0x1b71ca[_0xcf9c('0x29')]+':X')['toString'](_0xcf9c('0x2a')));}function request(_0x212005){logger[_0xcf9c('0x2b')](_0xcf9c('0x2c'),JSON[_0xcf9c('0x2d')](_0x212005));return rp(_['defaults'](_0x212005,{'method':_0xcf9c('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x24ce5f,_0x2edb6d){var _0x125b43=[];if(_0x24ce5f&&_0x24ce5f[_0xcf9c('0x1f')]>0x0){_0x125b43=_['map'](_0x24ce5f,_0x2edb6d);}return _0x125b43;}function getCustomFields(_0x5e0031,_0x4b3b85){var _0x411c67=[];var _0x4ce743={'custom_fields':[]};if(_0x5e0031[_0xcf9c('0x1f')]>0x0){_[_0xcf9c('0x2f')](_0x5e0031,function(_0x45a67b){if(_0x45a67b[_0xcf9c('0x30')]===_0xcf9c('0x31')&&_0x45a67b[_0xcf9c('0x32')]&&!_0x45a67b[_0xcf9c('0x33')]){_0x4ce743[_0x45a67b[_0xcf9c('0x32')][_0xcf9c('0x34')]()]=_0x45a67b[_0xcf9c('0x35')][_0xcf9c('0x36')]();}else if(_0x45a67b[_0xcf9c('0x30')]===_0xcf9c('0x31')&&_0x45a67b['idField']&&_0x45a67b[_0xcf9c('0x33')]){_0x4ce743['custom_fields']['push']({'id':_0x45a67b[_0xcf9c('0x37')],'value':_0x45a67b[_0xcf9c('0x35')][_0xcf9c('0x36')]()});}else if(_0x45a67b[_0xcf9c('0x30')]===_0xcf9c('0x38')&&_0x45a67b[_0xcf9c('0x39')]&&_0x45a67b['idField']&&_0x45a67b[_0xcf9c('0x33')]){_0x4b3b85[_0x45a67b['variableName']]&&_0x4ce743[_0xcf9c('0x17')][_0xcf9c('0x3a')]({'id':_0x45a67b[_0xcf9c('0x37')],'value':_0x4b3b85[_0x45a67b[_0xcf9c('0x39')]][_0xcf9c('0x36')]()});}else if(_0x45a67b['type']==='customVariable'&&_0x45a67b[_0xcf9c('0x3b')]&&_0x45a67b[_0xcf9c('0x3b')][_0xcf9c('0x15')]&&_0x45a67b[_0xcf9c('0x37')]&&_0x45a67b[_0xcf9c('0x33')]){_0x4b3b85[_0x45a67b[_0xcf9c('0x3b')][_0xcf9c('0x15')][_0xcf9c('0x34')]()]&&_0x4ce743[_0xcf9c('0x17')]['push']({'id':_0x45a67b['idField'],'value':_0x4b3b85[_0x45a67b[_0xcf9c('0x3b')][_0xcf9c('0x15')]['toLowerCase']()][_0xcf9c('0x36')]()});}});}return _0x4ce743;}exports[_0xcf9c('0x3c')]=function(_0x2a2986,_0x395d01,_0x4b39d2,_0x1a7d94,_0x36b944,_0x32cab9){var _0x3b88b8,_0x3c9929;_0x32cab9['remoteUri']=intUtil[_0xcf9c('0x3d')](_0x32cab9[_0xcf9c('0x1e')]);_0x32cab9[_0xcf9c('0x3e')]=intUtil[_0xcf9c('0x3d')](_0x32cab9['serverUrl']);if(_0x36b944&&_0x36b944[_0xcf9c('0x3f')]){logger[_0xcf9c('0xc')](_0xcf9c('0x40'),_0xcf9c('0x41'));_0x395d01['recordingURL']=util[_0xcf9c('0xe')](_0xcf9c('0x42'),_0x32cab9[_0xcf9c('0x3e')],_0x395d01[_0xcf9c('0x43')],md5(_0x395d01[_0xcf9c('0x43')]));}else{_0x395d01[_0xcf9c('0x44')]='';}headers[_0xcf9c('0x45')]=getAuth(_0x32cab9);return getUser(_0x32cab9,_0x1a7d94[_0xcf9c('0x46')])[_0xcf9c('0x1b')](function(_0x455e85){_0x3b88b8=_0x455e85;logger['info'](_0xcf9c('0x47'),_0x3b88b8['id']);return getEndUser(_0x32cab9,_0x395d01[_0xcf9c('0xf')],_0x395d01[_0xcf9c('0x10')]);})['then'](function(_0x2508e1){_0x3c9929=_0x2508e1;logger[_0xcf9c('0xc')]('The\x20Enduser\x20ID\x20is:',_0x3c9929['id']);return getTicket(_0x32cab9,_0x3b88b8,_0x3c9929,_0x4b39d2,_0x395d01);})[_0xcf9c('0x1b')](function(_0x1161c4){if(_0x1161c4&&_0x1161c4['id']){logger['info']('Ticket\x20created!');logger[_0xcf9c('0xc')](_0xcf9c('0x48'),_0x1161c4['id']);logger['info']('[QUEUE]',_0xcf9c('0x49'));emit(util[_0xcf9c('0xe')](_0xcf9c('0x4a'),_0x1a7d94[_0xcf9c('0x15')]),_0xcf9c('0x4b'),{'uri':util[_0xcf9c('0xe')]('%s/helpdesk/tickets/%d',_0x32cab9['remoteUri'],_0x1161c4['id'])});}})[_0xcf9c('0x4c')](function(_0x2f8b58){logger[_0xcf9c('0x4d')](_0xcf9c('0x40'),JSON[_0xcf9c('0x2d')](_0x2f8b58));});};exports['outbound']=function(_0x5e2524,_0x4b2122,_0x28e046,_0x1f6c8f,_0x42708b,_0x356211,_0x545e57){var _0x2055ff,_0x120bd6;_0x356211['remoteUri']=intUtil[_0xcf9c('0x3d')](_0x356211[_0xcf9c('0x1e')]);_0x356211[_0xcf9c('0x3e')]=intUtil[_0xcf9c('0x3d')](_0x356211[_0xcf9c('0x3e')]);if(_0x545e57&&_0x545e57[_0xcf9c('0x4e')]&&_0x545e57['recordingFormat']!==_0xcf9c('0x4f')){logger[_0xcf9c('0xc')](_0xcf9c('0x50'),_0xcf9c('0x41'));_0x4b2122[_0xcf9c('0x44')]=util[_0xcf9c('0xe')](_0xcf9c('0x42'),_0x356211[_0xcf9c('0x3e')],_0x4b2122['uniqueid'],md5(_0x4b2122['uniqueid']));}headers[_0xcf9c('0x45')]=getAuth(_0x356211);return getUser(_0x356211,_0x1f6c8f[_0xcf9c('0x46')])[_0xcf9c('0x1b')](function(_0x9aac1b){_0x2055ff=_0x9aac1b;logger['info'](_0xcf9c('0x47'),_0x2055ff['id']);return getEndUser(_0x356211,_0x4b2122['destcalleridname'],_0x4b2122['destcalleridnum']);})[_0xcf9c('0x1b')](function(_0x57575e){_0x120bd6=_0x57575e;logger[_0xcf9c('0xc')](_0xcf9c('0x51'),_0x120bd6['id']);return getTicket(_0x356211,_0x2055ff,_0x120bd6,_0x28e046,_0x4b2122);})[_0xcf9c('0x1b')](function(_0x20eb4f){if(_0x20eb4f&&_0x20eb4f['id']){logger[_0xcf9c('0xc')]('Ticket\x20created!');logger[_0xcf9c('0xc')](_0xcf9c('0x48'),_0x20eb4f['id']);logger[_0xcf9c('0xc')](_0xcf9c('0x50'),_0xcf9c('0x49'));emit(util[_0xcf9c('0xe')]('user:%s',_0x1f6c8f[_0xcf9c('0x15')]),_0xcf9c('0x4b'),{'uri':util['format'](_0xcf9c('0x52'),_0x356211[_0xcf9c('0x1e')],_0x20eb4f['id'])});}})[_0xcf9c('0x4c')](function(_0x5e7157){logger[_0xcf9c('0x4d')](_0xcf9c('0x50'),JSON['stringify'](_0x5e7157));});};exports[_0xcf9c('0x53')]=function(_0x46db40,_0x1f8d86,_0xaec8b5,_0x3bb510,_0x2f232c,_0x3ccd91){var _0x497389,_0xd2cc5;_0x3ccd91[_0xcf9c('0x1e')]=intUtil[_0xcf9c('0x3d')](_0x3ccd91[_0xcf9c('0x1e')]);_0x3ccd91['serverUrl']=intUtil[_0xcf9c('0x3d')](_0x3ccd91['serverUrl']);if(_0x2f232c&&_0x2f232c['monitor_format']){logger[_0xcf9c('0xc')](_0xcf9c('0x54'),'Recording\x20is\x20enabled!');_0x1f8d86['recordingURL']=util[_0xcf9c('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ccd91['serverUrl'],_0x1f8d86[_0xcf9c('0x43')],md5(_0x1f8d86[_0xcf9c('0x43')]));}else{_0x1f8d86[_0xcf9c('0x44')]='';}headers[_0xcf9c('0x45')]=getAuth(_0x3ccd91);return getUser(_0x3ccd91,'')['then'](function(_0x53b076){_0x497389=_0x53b076;logger[_0xcf9c('0xc')]('The\x20User\x20ID\x20is:',_0x497389['id']);return getEndUser(_0x3ccd91,_0x1f8d86['calleridname'],_0x1f8d86[_0xcf9c('0x10')]);})[_0xcf9c('0x1b')](function(_0x2273bb){_0xd2cc5=_0x2273bb;logger[_0xcf9c('0xc')]('The\x20Enduser\x20ID\x20is:',_0xd2cc5['id']);return getTicket(_0x3ccd91,_0x497389,_0xd2cc5,_0xaec8b5,_0x1f8d86);})[_0xcf9c('0x1b')](function(_0x2e34d7){if(_0x2e34d7){logger['info'](_0xcf9c('0x1c'));logger['info'](_0xcf9c('0x48'),_0x2e34d7['id']);}})['catch'](function(_0x5dcee3){logger[_0xcf9c('0x4d')](_0xcf9c('0x54'),JSON[_0xcf9c('0x2d')](_0x5dcee3));});}; \ 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 730ac86..95275e9 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 _0x6a9c=['./zoho','./desk','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','freshdesk','zoho','desk','servicenow','dynamics365','exec','includes','data1','toLowerCase','data2','data3','queue','outbound','log','EVENT\x20UNKNOWN','unknown\x20integration','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','./salesforce','./sugarcrm','./freshdesk'];(function(_0xc58e33,_0x113136){var _0x4afd5b=function(_0x468025){while(--_0x468025){_0xc58e33['push'](_0xc58e33['shift']());}};_0x4afd5b(++_0x113136);}(_0x6a9c,0x171));var _0xc6a9=function(_0x556db4,_0x2f94d2){_0x556db4=_0x556db4-0x0;var _0x30780d=_0x6a9c[_0x556db4];return _0x30780d;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require('./zendesk');var salesforce=require(_0xc6a9('0x0'));var sugarcrm=require(_0xc6a9('0x1'));var freshdesk=require(_0xc6a9('0x2'));var zoho=require(_0xc6a9('0x3'));var desk=require(_0xc6a9('0x4'));var vtiger=require(_0xc6a9('0x5'));var servicenow=require(_0xc6a9('0x6'));var dynamics365=require(_0xc6a9('0x7'));var integrations=[_0xc6a9('0x8'),_0xc6a9('0x9'),'sugarcrm',_0xc6a9('0xa'),_0xc6a9('0xb'),_0xc6a9('0xc'),'vtiger',_0xc6a9('0xd'),_0xc6a9('0xe')];exports[_0xc6a9('0xf')]=function(_0x238717,_0x24a29c,_0x2cff26,_0x20f98b,_0x2dadeb,_0x42d36f){if(_0x2cff26){if(_[_0xc6a9('0x10')](integrations,_0x238717[_0xc6a9('0x11')][_0xc6a9('0x12')]())){try{var _0x2e1e4e=null;var _0x240710='';var _0x498b1b=_0x2cff26[_0x238717[_0xc6a9('0x11')][_0xc6a9('0x12')]()];if(_0x498b1b){var _0x43208d=_0x498b1b[_0x238717[_0xc6a9('0x13')]];if(_0x43208d){var _0x513f3b=_['find'](_0x43208d['Configurations'],{'id':parseInt(_0x238717[_0xc6a9('0x14')],0xa)});if(_0x513f3b){if(_0x20f98b){if(_0x2dadeb&&_0x24a29c[_0xc6a9('0x15')]){_0x240710=_0xc6a9('0x15');}else if(_0x24a29c['routeId']){_0x240710=_0xc6a9('0x16');}else{console[_0xc6a9('0x17')](_0xc6a9('0x18'),_0x24a29c);}}else{_0x240710='abandoned';}switch(_0x238717[_0xc6a9('0x11')]['toLowerCase']()){case _0xc6a9('0x8'):zendesk[_0x240710](_0x238717,_0x24a29c,_0x513f3b,_0x20f98b,_0x2dadeb,_0x43208d,_0x42d36f);break;case'salesforce':salesforce[_0x240710](_0x238717,_0x24a29c,_0x513f3b,_0x20f98b,_0x2dadeb,_0x43208d,_0x42d36f);break;case'sugarcrm':sugarcrm[_0x240710](_0x238717,_0x24a29c,_0x513f3b,_0x20f98b,_0x2dadeb,_0x43208d,_0x42d36f);break;case'freshdesk':freshdesk[_0x240710](_0x238717,_0x24a29c,_0x513f3b,_0x20f98b,_0x2dadeb,_0x43208d,_0x42d36f);break;case _0xc6a9('0xb'):zoho[_0x240710](_0x238717,_0x24a29c,_0x513f3b,_0x20f98b,_0x2dadeb,_0x43208d,_0x42d36f);break;case _0xc6a9('0xc'):desk[_0x240710](_0x238717,_0x24a29c,_0x513f3b,_0x20f98b,_0x2dadeb,_0x43208d,_0x42d36f);break;case'vtiger':vtiger[_0x240710](_0x238717,_0x24a29c,_0x513f3b,_0x20f98b,_0x2dadeb,_0x43208d,_0x42d36f);break;case _0xc6a9('0xd'):servicenow['cs'](_0x238717,_0x24a29c,_0x513f3b,_0x20f98b,_0x2dadeb,_0x43208d,_0x42d36f,_0x240710);break;case _0xc6a9('0xe'):dynamics365['cs'](_0x238717,_0x24a29c,_0x513f3b,_0x20f98b,_0x2dadeb,_0x43208d,_0x42d36f,_0x240710);break;default:console[_0xc6a9('0x17')](_0xc6a9('0x19'));}}else{_0x2e1e4e=require(_0xc6a9('0x1a'))(_0x238717[_0xc6a9('0x11')]['toLowerCase']());_0x2e1e4e[_0xc6a9('0x1b')]('[EXEC]',util[_0xc6a9('0x1c')](_0xc6a9('0x1d'),_0x238717[_0xc6a9('0x11')]['toLowerCase'](),_0x238717[_0xc6a9('0x14')]));}}else{_0x2e1e4e=require(_0xc6a9('0x1a'))(_0x238717[_0xc6a9('0x11')]['toLowerCase']());_0x2e1e4e['error']('[EXEC]',util[_0xc6a9('0x1c')](_0xc6a9('0x1e'),_0x238717[_0xc6a9('0x11')][_0xc6a9('0x12')](),_0x238717[_0xc6a9('0x13')]));}}else{}}catch(_0x20c12a){console[_0xc6a9('0x1b')](_0x20c12a);}}}}; \ No newline at end of file +var _0xacef=['dynamics365','exec','data1','toLowerCase','data2','Configurations','data3','queue','routeId','outbound','EVENT\x20UNKNOWN','abandoned','vtiger','log','unknown\x20integration','../../../../config/logger','format','error','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./vtiger','./servicenow','./dynamics365','zendesk','sugarcrm','freshdesk','zoho','servicenow'];(function(_0x451739,_0x313d06){var _0x5eaa58=function(_0x2522c5){while(--_0x2522c5){_0x451739['push'](_0x451739['shift']());}};_0x5eaa58(++_0x313d06);}(_0xacef,0xd9));var _0xface=function(_0x4d080e,_0x197569){_0x4d080e=_0x4d080e-0x0;var _0x346b49=_0xacef[_0x4d080e];return _0x346b49;};'use strict';var _=require(_0xface('0x0'));var util=require('util');var zendesk=require(_0xface('0x1'));var salesforce=require(_0xface('0x2'));var sugarcrm=require(_0xface('0x3'));var freshdesk=require('./freshdesk');var zoho=require(_0xface('0x4'));var desk=require(_0xface('0x5'));var vtiger=require(_0xface('0x6'));var servicenow=require(_0xface('0x7'));var dynamics365=require(_0xface('0x8'));var integrations=[_0xface('0x9'),'salesforce',_0xface('0xa'),_0xface('0xb'),_0xface('0xc'),'desk','vtiger',_0xface('0xd'),_0xface('0xe')];exports[_0xface('0xf')]=function(_0x1ab513,_0x33e7e1,_0x1246c0,_0xe394c5,_0x206e10,_0x57ed9b){if(_0x1246c0){if(_['includes'](integrations,_0x1ab513[_0xface('0x10')][_0xface('0x11')]())){try{var _0x11b002=null;var _0x4b3436='';var _0x5657b1=_0x1246c0[_0x1ab513[_0xface('0x10')][_0xface('0x11')]()];if(_0x5657b1){var _0x5224c2=_0x5657b1[_0x1ab513[_0xface('0x12')]];if(_0x5224c2){var _0x43f4d4=_['find'](_0x5224c2[_0xface('0x13')],{'id':parseInt(_0x1ab513[_0xface('0x14')],0xa)});if(_0x43f4d4){if(_0xe394c5){if(_0x206e10&&_0x33e7e1['queue']){_0x4b3436=_0xface('0x15');}else if(_0x33e7e1[_0xface('0x16')]){_0x4b3436=_0xface('0x17');}else{console['log'](_0xface('0x18'),_0x33e7e1);}}else{_0x4b3436=_0xface('0x19');}switch(_0x1ab513['data1'][_0xface('0x11')]()){case _0xface('0x9'):zendesk[_0x4b3436](_0x1ab513,_0x33e7e1,_0x43f4d4,_0xe394c5,_0x206e10,_0x5224c2,_0x57ed9b);break;case'salesforce':salesforce[_0x4b3436](_0x1ab513,_0x33e7e1,_0x43f4d4,_0xe394c5,_0x206e10,_0x5224c2,_0x57ed9b);break;case _0xface('0xa'):sugarcrm[_0x4b3436](_0x1ab513,_0x33e7e1,_0x43f4d4,_0xe394c5,_0x206e10,_0x5224c2,_0x57ed9b);break;case _0xface('0xb'):freshdesk[_0x4b3436](_0x1ab513,_0x33e7e1,_0x43f4d4,_0xe394c5,_0x206e10,_0x5224c2,_0x57ed9b);break;case'zoho':zoho[_0x4b3436](_0x1ab513,_0x33e7e1,_0x43f4d4,_0xe394c5,_0x206e10,_0x5224c2,_0x57ed9b);break;case'desk':desk[_0x4b3436](_0x1ab513,_0x33e7e1,_0x43f4d4,_0xe394c5,_0x206e10,_0x5224c2,_0x57ed9b);break;case _0xface('0x1a'):vtiger[_0x4b3436](_0x1ab513,_0x33e7e1,_0x43f4d4,_0xe394c5,_0x206e10,_0x5224c2,_0x57ed9b);break;case _0xface('0xd'):servicenow['cs'](_0x1ab513,_0x33e7e1,_0x43f4d4,_0xe394c5,_0x206e10,_0x5224c2,_0x57ed9b,_0x4b3436);break;case'dynamics365':dynamics365['cs'](_0x1ab513,_0x33e7e1,_0x43f4d4,_0xe394c5,_0x206e10,_0x5224c2,_0x57ed9b,_0x4b3436);break;default:console[_0xface('0x1b')](_0xface('0x1c'));}}else{_0x11b002=require(_0xface('0x1d'))(_0x1ab513['data1'][_0xface('0x11')]());_0x11b002['error']('[EXEC]',util[_0xface('0x1e')]('%s\x20configuration\x20#%s\x20not\x20found',_0x1ab513[_0xface('0x10')][_0xface('0x11')](),_0x1ab513[_0xface('0x14')]));}}else{_0x11b002=require(_0xface('0x1d'))(_0x1ab513[_0xface('0x10')][_0xface('0x11')]());_0x11b002[_0xface('0x1f')]('[EXEC]',util[_0xface('0x1e')](_0xface('0x20'),_0x1ab513[_0xface('0x10')][_0xface('0x11')](),_0x1ab513[_0xface('0x12')]));}}else{}}catch(_0xcc70f6){console[_0xface('0x1f')](_0xcc70f6);}}}}; \ 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 7e493f7..c248107 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 _0x70e0=['Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','No\x20Company','upperFirst','create','length','type','string','idField','content','toString','variable','customVariable','Variable','name','toLowerCase','password','securityToken','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','stringify','outbound','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','jsforce','util','ioredis','./util','../../../../config/logger','redis','socket.io-emitter','emit','ticketType','Task','assign','utc','getString','Descriptions','ContactId','sobject','isNil','validateEmail','User','find','execute','then','Email','Agent\x20%s\x20found.','Name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Lead','contact','lead','Contact','Phone','Enduser\x20with\x20phone\x20%s\x20found.','','format'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x70e0,0x17b));var _0x070e=function(_0x7f25d2,_0x19a391){_0x7f25d2=_0x7f25d2-0x0;var _0x246f1a=_0x70e0[_0x7f25d2];return _0x246f1a;};'use strict';var _=require(_0x070e('0x0'));var rp=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0x070e('0x3'));var util=require(_0x070e('0x4'));var Redis=require(_0x070e('0x5'));var intUtil=require(_0x070e('0x6'));var config=require('../../../../config/environment');var logger=require(_0x070e('0x7'))('salesforce');config[_0x070e('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x9'))(new Redis(config[_0x070e('0x8')]));function emit(_0x604664,_0x2611e6,_0x111743){io['to'](_0x604664)[_0x070e('0xa')](_0x2611e6,_0x111743);}function getTicket(_0x11ffa8,_0x4e99e6,_0x49b2fb,_0x50f4eb,_0x2e3e5e,_0x12bb37,_0xb8d819,_0xa927a2){var _0xffcdd6={};if(_0x50f4eb[_0x070e('0xb')]===_0x070e('0xc')){_0xffcdd6=Object[_0x070e('0xd')]({},{'OwnerId':_0x4e99e6['id'],'ActivityDate':moment[_0x070e('0xe')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x070e('0xf')](_0x50f4eb['Subjects'],_0x2e3e5e,'\x20'),'Description':intUtil['getString'](_0x50f4eb[_0x070e('0x10')],_0x2e3e5e,'\x0a')},getCustomFields(_0x12bb37,_0x2e3e5e));if(_0x49b2fb){_0xffcdd6['WhoId']=_0x49b2fb['id'];}}else if(_0x50f4eb['ticketType']==='Case'){_0xffcdd6=Object[_0x070e('0xd')]({},{'OwnerId':_0x4e99e6['id'],'Subject':intUtil[_0x070e('0xf')](_0x50f4eb['Subjects'],_0x2e3e5e,'\x20'),'Description':intUtil['getString'](_0x50f4eb[_0x070e('0x10')],_0x2e3e5e,'\x0a')},getCustomFields(_0x12bb37,_0x2e3e5e));if(_0x49b2fb){_0xffcdd6[_0x070e('0x11')]=_0x49b2fb['id'];}}return _0xb8d819[_0x070e('0x12')](_0x50f4eb[_0x070e('0xb')])['create'](_0xffcdd6);}function getUser(_0x49861b,_0x17e2e4,_0x2bd937){if(!_[_0x070e('0x13')](_0x17e2e4)&&intUtil[_0x070e('0x14')](_0x17e2e4)){var _0x364b3f={'Email':_0x17e2e4};var _0x5037eb={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2bd937[_0x070e('0x12')](_0x070e('0x15'))[_0x070e('0x16')](_0x364b3f,_0x5037eb)[_0x070e('0x17')]()[_0x070e('0x18')](function(_0x5c16fd){if(_0x5c16fd['length']){var _0x4e958f=_[_0x070e('0x16')](_0x5c16fd,function(_0x3004f0){return _0x3004f0[_0x070e('0x19')]===_0x17e2e4;});if(_0x4e958f){logger['info'](_0x070e('0x1a'),_0x17e2e4);return BPromise['resolve']({'id':_0x4e958f['Id'],'name':_0x4e958f[_0x070e('0x1b')]});}}else{logger[_0x070e('0x1c')](_0x070e('0x1d'),_0x17e2e4);return _0x2bd937[_0x070e('0x1e')]()[_0x070e('0x18')](function(_0xa86797){return BPromise[_0x070e('0x1f')]({'id':_0xa86797[_0x070e('0x20')],'name':_0xa86797['display_name']});});}});}else{logger[_0x070e('0x1c')](_0x070e('0x1d'),_0x17e2e4);return _0x2bd937[_0x070e('0x1e')]()['then'](function(_0xf17c56){return BPromise['resolve']({'id':_0xf17c56['user_id'],'name':_0xf17c56[_0x070e('0x21')]});});}}function getEndUser(_0x25f6e,_0x41deb1,_0x1743cc,_0x4763c6,_0x497f58){var _0x374c54={'Phone':_0x4763c6};var _0x219e48={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x070e('0x1f')]()[_0x070e('0x18')](function(){if(_0x41deb1[_0x070e('0xb')]===_0x070e('0xc')){logger[_0x070e('0x1c')](_0x070e('0x22'),_0x4763c6,_0x41deb1['moduleSearch']);switch(_0x41deb1[_0x070e('0x23')]){case _0x070e('0x24'):return _0x497f58[_0x070e('0x12')]('Contact')['find'](_0x374c54,_0x219e48)[_0x070e('0x17')]()[_0x070e('0x18')](function(_0xa6c0ab){if(_0xa6c0ab&&_0xa6c0ab['length']){return _0xa6c0ab;}else{return _0x497f58[_0x070e('0x12')](_0x070e('0x25'))[_0x070e('0x16')](_0x374c54,_0x219e48);}});case _0x070e('0x26'):return _0x497f58['sobject']('Contact')['find'](_0x374c54,_0x219e48)['execute']();case _0x070e('0x27'):return _0x497f58['sobject'](_0x070e('0x25'))[_0x070e('0x16')](_0x374c54,_0x219e48);default:return null;}}else if(_0x41deb1['ticketType']==='Case'){logger[_0x070e('0x1c')](_0x070e('0x22'),_0x4763c6,'contact');return _0x497f58['sobject'](_0x070e('0x28'))[_0x070e('0x16')](_0x374c54,_0x219e48)[_0x070e('0x17')]();}})[_0x070e('0x18')](function(_0x18f0ad){if(_0x18f0ad&&_0x18f0ad['length']){var _0x482cc2=_[_0x070e('0x16')](_0x18f0ad,function(_0x3011c4){return _0x3011c4[_0x070e('0x29')]===_0x4763c6;});if(_0x482cc2){return BPromise[_0x070e('0x1f')]({'id':_0x482cc2['Id'],'name':_0x482cc2[_0x070e('0x1b')],'phone':_0x482cc2['Phone']});}}})[_0x070e('0x18')](function(_0x1927f4){if(_0x1927f4){logger['info'](_0x070e('0x2a'),_0x4763c6);return BPromise[_0x070e('0x1f')](_0x1927f4);}else{logger['info']('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x4763c6);var _0x5ddbe9={'LastName':_0x1743cc!==_0x070e('0x2b')?_0x1743cc:util[_0x070e('0x2c')](_0x070e('0x2d'),_0x4763c6),'Phone':_0x4763c6};if(_0x41deb1[_0x070e('0x2e')]){if(_0x41deb1[_0x070e('0x2e')]==='contact'){logger[_0x070e('0x1c')](_0x070e('0x2f'),_0x4763c6,_0x41deb1[_0x070e('0x2e')]);}else if(_0x41deb1['moduleCreate']===_0x070e('0x27')&&_0x41deb1[_0x070e('0xb')]===_0x070e('0xc')){logger['info'](_0x070e('0x2f'),_0x4763c6,_0x41deb1[_0x070e('0x2e')]);_0x5ddbe9['Company']=_0x070e('0x30');}else{return null;}}return _0x497f58['sobject'](_[_0x070e('0x31')](_0x41deb1[_0x070e('0x2e')]))[_0x070e('0x32')](_0x5ddbe9);}});}function getCustomFields(_0x30319c,_0xd03404){var _0x47b929={};if(_0x30319c[_0x070e('0x33')]>0x0){_['forEach'](_0x30319c,function(_0x5bd39a){if(_0x5bd39a[_0x070e('0x34')]===_0x070e('0x35')&&_0x5bd39a[_0x070e('0x36')]){_0x47b929[_0x5bd39a['idField']]=_0x5bd39a[_0x070e('0x37')][_0x070e('0x38')]();}else if(_0x5bd39a[_0x070e('0x34')]===_0x070e('0x39')&&_0x5bd39a['variableName']&&_0x5bd39a[_0x070e('0x36')]){_0xd03404[_0x5bd39a['variableName']]&&(_0x47b929[_0x5bd39a['idField']]=_0xd03404[_0x5bd39a['variableName']][_0x070e('0x38')]());}else if(_0x5bd39a[_0x070e('0x34')]===_0x070e('0x3a')&&_0x5bd39a[_0x070e('0x3b')]&&_0x5bd39a[_0x070e('0x3b')]['name']&&_0x5bd39a[_0x070e('0x36')]){_0xd03404[_0x5bd39a['Variable'][_0x070e('0x3c')][_0x070e('0x3d')]()]&&(_0x47b929[_0x5bd39a[_0x070e('0x36')]]=_0xd03404[_0x5bd39a['Variable']['name'][_0x070e('0x3d')]()]['toString']());}});}return _0x47b929;}function getConnection(_0x35349f){var _0x3fdb75=_0x35349f[_0x070e('0x3e')]['concat'](_0x35349f[_0x070e('0x3f')]);var _0x20a1ee=new jsforce['Connection']({'oauth2':{'loginUrl':_0x35349f['remoteUri']||_0x070e('0x40'),'clientId':_0x35349f[_0x070e('0x41')],'clientSecret':_0x35349f[_0x070e('0x42')]}});return _0x20a1ee[_0x070e('0x43')](_0x35349f[_0x070e('0x44')],_0x3fdb75)['then'](function(){logger[_0x070e('0x1c')](_0x070e('0x45'));return _0x20a1ee;});}exports[_0x070e('0x46')]=function(_0x391dee,_0x79eaa0,_0xcd1c61,_0x1f54d5,_0x1b5374,_0xd67987){var _0x66a3f3,_0x210c4d,_0x3be553,_0x5254f8;_0xd67987[_0x070e('0x47')]=intUtil[_0x070e('0x48')](_0xd67987['serverUrl']);_0xd67987[_0x070e('0x49')]=intUtil[_0x070e('0x48')](_0xd67987[_0x070e('0x49')]);if(_0x1b5374&&_0x1b5374[_0x070e('0x4a')]){logger[_0x070e('0x1c')](_0x070e('0x4b'),_0x070e('0x4c'));_0x79eaa0[_0x070e('0x4d')]=util[_0x070e('0x2c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xd67987[_0x070e('0x47')],_0x79eaa0['uniqueid'],md5(_0x79eaa0[_0x070e('0x4e')]));}else{_0x79eaa0[_0x070e('0x4d')]='';}return getConnection(_0xd67987)['then'](function(_0x991d23){_0x5254f8=_0x991d23;return getUser(_0xd67987,_0x1f54d5[_0x070e('0x4f')],_0x5254f8);})[_0x070e('0x18')](function(_0xa74805){_0x66a3f3=_0xa74805;return getEndUser(_0xd67987,_0xcd1c61,_0x79eaa0[_0x070e('0x50')],_0x79eaa0[_0x070e('0x51')],_0x5254f8);})[_0x070e('0x18')](function(_0x5694fa){_0x210c4d=_0x5694fa;return getTicket(_0xd67987,_0x66a3f3,_0x210c4d,_0xcd1c61,_0x79eaa0,_0xcd1c61[_0x070e('0x52')],_0x5254f8,'queue');})['then'](function(_0x3a06c6){_0x3be553=_0x3a06c6;logger[_0x070e('0x1c')](_0x070e('0x53'),_0x3be553['id']);logger[_0x070e('0x1c')](_0x070e('0x54'),_0x3be553['id'],_0x1f54d5[_0x070e('0x3c')],_0xd67987[_0x070e('0x34')]);switch(_0xd67987[_0x070e('0x34')]){case'integrationTab':emit(util[_0x070e('0x2c')]('user:%s',_0x1f54d5['name']),_0x070e('0x55'),{'recordId':_0x3be553['id']});break;case _0x070e('0x56'):emit(util['format'](_0x070e('0x57'),_0x1f54d5[_0x070e('0x3c')]),_0x070e('0x58'),{'uri':util[_0x070e('0x2c')](_0x070e('0x59'),_0x5254f8[_0x070e('0x5a')],_0x3be553['id'])});break;default:logger[_0x070e('0x5b')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x5943e3){logger[_0x070e('0x5b')](_0x070e('0x4b'),JSON[_0x070e('0x5c')](_0x5943e3));});};exports[_0x070e('0x5d')]=function(_0x5ac0b5,_0x25f34c,_0x5d3c3a,_0x212710,_0x1cbb7e,_0x476804,_0x24f303){var _0x3ab11c,_0x15dbc4,_0x5561ed,_0x20ff87;_0x476804[_0x070e('0x47')]=intUtil[_0x070e('0x48')](_0x476804['serverUrl']);_0x476804[_0x070e('0x49')]=intUtil[_0x070e('0x48')](_0x476804['remoteUri']);if(_0x24f303&&_0x24f303[_0x070e('0x5e')]&&_0x24f303['recordingFormat']!==_0x070e('0x5f')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x25f34c[_0x070e('0x4d')]=util[_0x070e('0x2c')](_0x070e('0x60'),_0x476804[_0x070e('0x47')],_0x25f34c[_0x070e('0x4e')],md5(_0x25f34c[_0x070e('0x4e')]));}return getConnection(_0x476804)['then'](function(_0x841c89){_0x20ff87=_0x841c89;return getUser(_0x476804,_0x212710['email'],_0x20ff87);})[_0x070e('0x18')](function(_0x52becf){_0x3ab11c=_0x52becf;return getEndUser(_0x476804,_0x5d3c3a,_0x25f34c[_0x070e('0x61')],_0x25f34c[_0x070e('0x62')],_0x20ff87);})['then'](function(_0x1bcdc3){_0x15dbc4=_0x1bcdc3;return getTicket(_0x476804,_0x3ab11c,_0x15dbc4,_0x5d3c3a,_0x25f34c,_0x5d3c3a['Fields'],_0x20ff87,_0x070e('0x5d'));})[_0x070e('0x18')](function(_0x2f1604){_0x5561ed=_0x2f1604;logger[_0x070e('0x1c')](_0x070e('0x63'),_0x5561ed['id']);logger[_0x070e('0x1c')](_0x070e('0x64'),_0x5561ed['id'],_0x212710[_0x070e('0x3c')],_0x476804[_0x070e('0x34')]);switch(_0x476804[_0x070e('0x34')]){case _0x070e('0x65'):emit(util[_0x070e('0x2c')](_0x070e('0x57'),_0x212710[_0x070e('0x3c')]),'trigger:salesforce:display',{'recordId':_0x5561ed['id']});break;case _0x070e('0x56'):emit(util[_0x070e('0x2c')](_0x070e('0x57'),_0x212710[_0x070e('0x3c')]),'trigger:browser:url',{'uri':util[_0x070e('0x2c')](_0x070e('0x59'),_0x20ff87[_0x070e('0x5a')],_0x5561ed['id'])});break;default:logger[_0x070e('0x5b')](_0x070e('0x66'),_0x070e('0x67'));}})['catch'](function(_0x5251d6){logger[_0x070e('0x5b')](_0x070e('0x66'),JSON[_0x070e('0x5c')](_0x5251d6));});};exports['abandoned']=function(_0x8b9c73,_0x52804d,_0x10d95d,_0x36373d,_0x3a1ad2,_0x150bf6){var _0x2a20d4,_0x50ef9f,_0x2e48f9,_0x2e38c6;_0x150bf6[_0x070e('0x47')]=intUtil[_0x070e('0x48')](_0x150bf6['serverUrl']);_0x150bf6[_0x070e('0x49')]=intUtil['stripTrailingSlash'](_0x150bf6[_0x070e('0x49')]);if(_0x3a1ad2&&_0x3a1ad2[_0x070e('0x4a')]){logger[_0x070e('0x1c')]('[ABANDONED]',_0x070e('0x4c'));_0x52804d['recordingURL']=util[_0x070e('0x2c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x150bf6[_0x070e('0x47')],_0x52804d[_0x070e('0x4e')],md5(_0x52804d['uniqueid']));}else{_0x52804d[_0x070e('0x4d')]='';}return getConnection(_0x150bf6)['then'](function(_0x1c831f){_0x2e38c6=_0x1c831f;if(!_[_0x070e('0x13')](_0x36373d)){return getUser(_0x150bf6,_0x36373d['name'],_0x2e38c6);}else{return getUser(_0x150bf6,null,_0x2e38c6);}})['then'](function(_0x29ee66){_0x2a20d4=_0x29ee66;return getEndUser(_0x150bf6,_0x10d95d,_0x52804d[_0x070e('0x50')],_0x52804d[_0x070e('0x51')],_0x2e38c6);})[_0x070e('0x18')](function(_0x25f1d0){_0x50ef9f=_0x25f1d0;return getTicket(_0x150bf6,_0x2a20d4,_0x50ef9f,_0x10d95d,_0x52804d,_0x10d95d[_0x070e('0x52')],_0x2e38c6);})[_0x070e('0x18')](function(_0x332c8a){_0x2e48f9=_0x332c8a;logger[_0x070e('0x1c')](_0x070e('0x68'),_0x2e48f9['id']);logger[_0x070e('0x1c')](_0x070e('0x69'),_0x150bf6[_0x070e('0x34')]);})['catch'](function(_0x3308b5){logger[_0x070e('0x5b')]('[ABANDONED]',JSON['stringify'](_0x3308b5));});}; \ No newline at end of file +var _0xa9e0=['identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','Contact','Lead','contact','lead','Phone','Name','Enduser\x20with\x20phone\x20%s\x20found.','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','upperFirst','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','recordingURL','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','%s/%s/e','error','catch','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','Fields','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','stringify','abandoned','[ABANDONED]','[ABANDONED]\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','defaults','redis','localhost','emit','ticketType','Task','assign','utc','getString','Subjects','Descriptions','WhoId','Case','ContactId','create','isNil','validateEmail','sobject','User','find','execute','then','length','Email','Agent\x20%s\x20found.','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.'];(function(_0x4dc07a,_0x3d0e7){var _0x14a4f5=function(_0x531c7a){while(--_0x531c7a){_0x4dc07a['push'](_0x4dc07a['shift']());}};_0x14a4f5(++_0x3d0e7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0x0a9e('0x3'));var util=require('util');var Redis=require(_0x0a9e('0x4'));var intUtil=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));config['redis']=_[_0x0a9e('0x9')](config[_0x0a9e('0xa')],{'host':_0x0a9e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0xe42b77,_0x56465b,_0x52cace){io['to'](_0xe42b77)[_0x0a9e('0xc')](_0x56465b,_0x52cace);}function getTicket(_0xf81284,_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2,_0x527cdd){var _0x4cfe67={};if(_0xfeb75b[_0x0a9e('0xd')]===_0x0a9e('0xe')){_0x4cfe67=Object[_0x0a9e('0xf')]({},{'OwnerId':_0x307b3e['id'],'ActivityDate':moment[_0x0a9e('0x10')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x0a9e('0x11')](_0xfeb75b[_0x0a9e('0x12')],_0xbd1168,'\x20'),'Description':intUtil['getString'](_0xfeb75b[_0x0a9e('0x13')],_0xbd1168,'\x0a')},getCustomFields(_0x4a4c56,_0xbd1168));if(_0x3ab53f){_0x4cfe67[_0x0a9e('0x14')]=_0x3ab53f['id'];}}else if(_0xfeb75b[_0x0a9e('0xd')]===_0x0a9e('0x15')){_0x4cfe67=Object[_0x0a9e('0xf')]({},{'OwnerId':_0x307b3e['id'],'Subject':intUtil[_0x0a9e('0x11')](_0xfeb75b['Subjects'],_0xbd1168,'\x20'),'Description':intUtil[_0x0a9e('0x11')](_0xfeb75b['Descriptions'],_0xbd1168,'\x0a')},getCustomFields(_0x4a4c56,_0xbd1168));if(_0x3ab53f){_0x4cfe67[_0x0a9e('0x16')]=_0x3ab53f['id'];}}return _0x50dfb2['sobject'](_0xfeb75b[_0x0a9e('0xd')])[_0x0a9e('0x17')](_0x4cfe67);}function getUser(_0x48f32d,_0x225616,_0x5a0a06){if(!_[_0x0a9e('0x18')](_0x225616)&&intUtil[_0x0a9e('0x19')](_0x225616)){var _0x106033={'Email':_0x225616};var _0x205fd6={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5a0a06[_0x0a9e('0x1a')](_0x0a9e('0x1b'))[_0x0a9e('0x1c')](_0x106033,_0x205fd6)[_0x0a9e('0x1d')]()[_0x0a9e('0x1e')](function(_0x112016){if(_0x112016[_0x0a9e('0x1f')]){var _0x105080=_['find'](_0x112016,function(_0x2c3407){return _0x2c3407[_0x0a9e('0x20')]===_0x225616;});if(_0x105080){logger['info'](_0x0a9e('0x21'),_0x225616);return BPromise['resolve']({'id':_0x105080['Id'],'name':_0x105080['Name']});}}else{logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x225616);return _0x5a0a06[_0x0a9e('0x24')]()[_0x0a9e('0x1e')](function(_0x4abc77){return BPromise[_0x0a9e('0x25')]({'id':_0x4abc77[_0x0a9e('0x26')],'name':_0x4abc77[_0x0a9e('0x27')]});});}});}else{logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x225616);return _0x5a0a06[_0x0a9e('0x24')]()[_0x0a9e('0x1e')](function(_0x5ea472){return BPromise['resolve']({'id':_0x5ea472[_0x0a9e('0x26')],'name':_0x5ea472[_0x0a9e('0x27')]});});}}function getEndUser(_0x40c424,_0x33161b,_0x526cf3,_0x384319,_0x479bc4){var _0x45a1e7={'Phone':_0x384319};var _0x5bfb33={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x0a9e('0x25')]()[_0x0a9e('0x1e')](function(){if(_0x33161b[_0x0a9e('0xd')]===_0x0a9e('0xe')){logger[_0x0a9e('0x22')](_0x0a9e('0x28'),_0x384319,_0x33161b[_0x0a9e('0x29')]);switch(_0x33161b[_0x0a9e('0x29')]){case'contact_lead':return _0x479bc4[_0x0a9e('0x1a')](_0x0a9e('0x2a'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33)[_0x0a9e('0x1d')]()['then'](function(_0x15b200){if(_0x15b200&&_0x15b200[_0x0a9e('0x1f')]){return _0x15b200;}else{return _0x479bc4[_0x0a9e('0x1a')](_0x0a9e('0x2b'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33);}});case _0x0a9e('0x2c'):return _0x479bc4[_0x0a9e('0x1a')](_0x0a9e('0x2a'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33)['execute']();case _0x0a9e('0x2d'):return _0x479bc4['sobject'](_0x0a9e('0x2b'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33);default:return null;}}else if(_0x33161b[_0x0a9e('0xd')]===_0x0a9e('0x15')){logger[_0x0a9e('0x22')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x384319,_0x0a9e('0x2c'));return _0x479bc4[_0x0a9e('0x1a')](_0x0a9e('0x2a'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33)[_0x0a9e('0x1d')]();}})[_0x0a9e('0x1e')](function(_0x332d35){if(_0x332d35&&_0x332d35[_0x0a9e('0x1f')]){var _0x5583a4=_[_0x0a9e('0x1c')](_0x332d35,function(_0x5e7238){return _0x5e7238[_0x0a9e('0x2e')]===_0x384319;});if(_0x5583a4){return BPromise[_0x0a9e('0x25')]({'id':_0x5583a4['Id'],'name':_0x5583a4[_0x0a9e('0x2f')],'phone':_0x5583a4[_0x0a9e('0x2e')]});}}})['then'](function(_0x191e91){if(_0x191e91){logger[_0x0a9e('0x22')](_0x0a9e('0x30'),_0x384319);return BPromise[_0x0a9e('0x25')](_0x191e91);}else{logger['info']('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x384319);var _0x1e8694={'LastName':_0x526cf3!==''?_0x526cf3:util[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x384319),'Phone':_0x384319};if(_0x33161b[_0x0a9e('0x33')]){if(_0x33161b[_0x0a9e('0x33')]==='contact'){logger[_0x0a9e('0x22')](_0x0a9e('0x34'),_0x384319,_0x33161b[_0x0a9e('0x33')]);}else if(_0x33161b['moduleCreate']===_0x0a9e('0x2d')&&_0x33161b[_0x0a9e('0xd')]===_0x0a9e('0xe')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x384319,_0x33161b[_0x0a9e('0x33')]);_0x1e8694[_0x0a9e('0x35')]='No\x20Company';}else{return null;}}return _0x479bc4[_0x0a9e('0x1a')](_[_0x0a9e('0x36')](_0x33161b[_0x0a9e('0x33')]))[_0x0a9e('0x17')](_0x1e8694);}});}function getCustomFields(_0x4b38d9,_0x5a594b){var _0x15e37d={};if(_0x4b38d9[_0x0a9e('0x1f')]>0x0){_['forEach'](_0x4b38d9,function(_0x183991){if(_0x183991[_0x0a9e('0x37')]===_0x0a9e('0x38')&&_0x183991['idField']){_0x15e37d[_0x183991[_0x0a9e('0x39')]]=_0x183991[_0x0a9e('0x3a')][_0x0a9e('0x3b')]();}else if(_0x183991[_0x0a9e('0x37')]===_0x0a9e('0x3c')&&_0x183991[_0x0a9e('0x3d')]&&_0x183991[_0x0a9e('0x39')]){_0x5a594b[_0x183991[_0x0a9e('0x3d')]]&&(_0x15e37d[_0x183991[_0x0a9e('0x39')]]=_0x5a594b[_0x183991[_0x0a9e('0x3d')]][_0x0a9e('0x3b')]());}else if(_0x183991[_0x0a9e('0x37')]===_0x0a9e('0x3e')&&_0x183991[_0x0a9e('0x3f')]&&_0x183991[_0x0a9e('0x3f')]['name']&&_0x183991['idField']){_0x5a594b[_0x183991[_0x0a9e('0x3f')][_0x0a9e('0x40')][_0x0a9e('0x41')]()]&&(_0x15e37d[_0x183991[_0x0a9e('0x39')]]=_0x5a594b[_0x183991[_0x0a9e('0x3f')][_0x0a9e('0x40')][_0x0a9e('0x41')]()][_0x0a9e('0x3b')]());}});}return _0x15e37d;}function getConnection(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x42')][_0x0a9e('0x43')](_0x432fcc['securityToken']);var _0x117c99=new jsforce[(_0x0a9e('0x44'))]({'oauth2':{'loginUrl':_0x432fcc[_0x0a9e('0x45')]||_0x0a9e('0x46'),'clientId':_0x432fcc[_0x0a9e('0x47')],'clientSecret':_0x432fcc[_0x0a9e('0x48')]}});return _0x117c99[_0x0a9e('0x49')](_0x432fcc[_0x0a9e('0x4a')],_0x25c6e6)['then'](function(){logger[_0x0a9e('0x22')]('Connection\x20established.');return _0x117c99;});}exports[_0x0a9e('0x4b')]=function(_0x476688,_0x8d6dd1,_0x562fb4,_0x14bec2,_0x7f6eb1,_0x4774f4){var _0x34aa5a,_0x45c845,_0x37be73,_0x45bf7f;_0x4774f4['serverUrl']=intUtil[_0x0a9e('0x4c')](_0x4774f4[_0x0a9e('0x4d')]);_0x4774f4[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x4c')](_0x4774f4[_0x0a9e('0x45')]);if(_0x7f6eb1&&_0x7f6eb1[_0x0a9e('0x4e')]){logger[_0x0a9e('0x22')](_0x0a9e('0x4f'),_0x0a9e('0x50'));_0x8d6dd1['recordingURL']=util[_0x0a9e('0x31')](_0x0a9e('0x51'),_0x4774f4['serverUrl'],_0x8d6dd1['uniqueid'],md5(_0x8d6dd1['uniqueid']));}else{_0x8d6dd1[_0x0a9e('0x52')]='';}return getConnection(_0x4774f4)[_0x0a9e('0x1e')](function(_0x37edaa){_0x45bf7f=_0x37edaa;return getUser(_0x4774f4,_0x14bec2[_0x0a9e('0x53')],_0x45bf7f);})[_0x0a9e('0x1e')](function(_0x30decb){_0x34aa5a=_0x30decb;return getEndUser(_0x4774f4,_0x562fb4,_0x8d6dd1[_0x0a9e('0x54')],_0x8d6dd1[_0x0a9e('0x55')],_0x45bf7f);})['then'](function(_0x4b1b9f){_0x45c845=_0x4b1b9f;return getTicket(_0x4774f4,_0x34aa5a,_0x45c845,_0x562fb4,_0x8d6dd1,_0x562fb4['Fields'],_0x45bf7f,_0x0a9e('0x4b'));})[_0x0a9e('0x1e')](function(_0x14d602){_0x37be73=_0x14d602;logger['info'](_0x0a9e('0x56'),_0x37be73['id']);logger[_0x0a9e('0x22')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x37be73['id'],_0x14bec2['name'],_0x4774f4[_0x0a9e('0x37')]);switch(_0x4774f4['type']){case _0x0a9e('0x57'):emit(util['format'](_0x0a9e('0x58'),_0x14bec2[_0x0a9e('0x40')]),_0x0a9e('0x59'),{'recordId':_0x37be73['id']});break;case'newTab':emit(util[_0x0a9e('0x31')](_0x0a9e('0x58'),_0x14bec2['name']),'trigger:browser:url',{'uri':util[_0x0a9e('0x31')](_0x0a9e('0x5a'),_0x45bf7f['instanceUrl'],_0x37be73['id'])});break;default:logger[_0x0a9e('0x5b')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x0a9e('0x5c')](function(_0x523cd2){logger[_0x0a9e('0x5b')]('[QUEUE]',JSON['stringify'](_0x523cd2));});};exports['outbound']=function(_0x2da03c,_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df,_0x232830){var _0x272738,_0xd10662,_0x28d814,_0x4e67ab;_0x19b4df[_0x0a9e('0x4d')]=intUtil[_0x0a9e('0x4c')](_0x19b4df[_0x0a9e('0x4d')]);_0x19b4df[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x4c')](_0x19b4df[_0x0a9e('0x45')]);if(_0x232830&&_0x232830['recordingFormat']&&_0x232830[_0x0a9e('0x5d')]!==_0x0a9e('0x5e')){logger['info'](_0x0a9e('0x5f'),'Recording\x20is\x20enabled!');_0x47de4c[_0x0a9e('0x52')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x19b4df['serverUrl'],_0x47de4c[_0x0a9e('0x60')],md5(_0x47de4c['uniqueid']));}return getConnection(_0x19b4df)[_0x0a9e('0x1e')](function(_0x1fc70e){_0x4e67ab=_0x1fc70e;return getUser(_0x19b4df,_0x65432[_0x0a9e('0x53')],_0x4e67ab);})[_0x0a9e('0x1e')](function(_0x1cca9f){_0x272738=_0x1cca9f;return getEndUser(_0x19b4df,_0x2f7092,_0x47de4c[_0x0a9e('0x61')],_0x47de4c['destcalleridnum'],_0x4e67ab);})[_0x0a9e('0x1e')](function(_0x5854cc){_0xd10662=_0x5854cc;return getTicket(_0x19b4df,_0x272738,_0xd10662,_0x2f7092,_0x47de4c,_0x2f7092[_0x0a9e('0x62')],_0x4e67ab,_0x0a9e('0x63'));})[_0x0a9e('0x1e')](function(_0x5adf8f){_0x28d814=_0x5adf8f;logger[_0x0a9e('0x22')](_0x0a9e('0x64'),_0x28d814['id']);logger[_0x0a9e('0x22')](_0x0a9e('0x65'),_0x28d814['id'],_0x65432['name'],_0x19b4df[_0x0a9e('0x37')]);switch(_0x19b4df[_0x0a9e('0x37')]){case'integrationTab':emit(util[_0x0a9e('0x31')](_0x0a9e('0x58'),_0x65432[_0x0a9e('0x40')]),_0x0a9e('0x59'),{'recordId':_0x28d814['id']});break;case _0x0a9e('0x66'):emit(util['format'](_0x0a9e('0x58'),_0x65432[_0x0a9e('0x40')]),_0x0a9e('0x67'),{'uri':util['format'](_0x0a9e('0x5a'),_0x4e67ab['instanceUrl'],_0x28d814['id'])});break;default:logger['error'](_0x0a9e('0x5f'),_0x0a9e('0x68'));}})[_0x0a9e('0x5c')](function(_0x19c995){logger[_0x0a9e('0x5b')](_0x0a9e('0x5f'),JSON[_0x0a9e('0x69')](_0x19c995));});};exports[_0x0a9e('0x6a')]=function(_0x2d7205,_0x1cc4f3,_0x2e89b7,_0x19012b,_0x2bbb86,_0x2b8192){var _0x320898,_0x412a72,_0x2a28c0,_0x4257c9;_0x2b8192['serverUrl']=intUtil[_0x0a9e('0x4c')](_0x2b8192[_0x0a9e('0x4d')]);_0x2b8192[_0x0a9e('0x45')]=intUtil['stripTrailingSlash'](_0x2b8192[_0x0a9e('0x45')]);if(_0x2bbb86&&_0x2bbb86[_0x0a9e('0x4e')]){logger['info'](_0x0a9e('0x6b'),_0x0a9e('0x50'));_0x1cc4f3[_0x0a9e('0x52')]=util[_0x0a9e('0x31')](_0x0a9e('0x51'),_0x2b8192['serverUrl'],_0x1cc4f3['uniqueid'],md5(_0x1cc4f3['uniqueid']));}else{_0x1cc4f3[_0x0a9e('0x52')]='';}return getConnection(_0x2b8192)[_0x0a9e('0x1e')](function(_0x1104ad){_0x4257c9=_0x1104ad;if(!_[_0x0a9e('0x18')](_0x19012b)){return getUser(_0x2b8192,_0x19012b[_0x0a9e('0x40')],_0x4257c9);}else{return getUser(_0x2b8192,null,_0x4257c9);}})[_0x0a9e('0x1e')](function(_0xeef20){_0x320898=_0xeef20;return getEndUser(_0x2b8192,_0x2e89b7,_0x1cc4f3[_0x0a9e('0x54')],_0x1cc4f3['calleridnum'],_0x4257c9);})[_0x0a9e('0x1e')](function(_0xcbc8b2){_0x412a72=_0xcbc8b2;return getTicket(_0x2b8192,_0x320898,_0x412a72,_0x2e89b7,_0x1cc4f3,_0x2e89b7[_0x0a9e('0x62')],_0x4257c9);})['then'](function(_0x2bdc44){_0x2a28c0=_0x2bdc44;logger['info'](_0x0a9e('0x6c'),_0x2a28c0['id']);logger[_0x0a9e('0x22')]('[ABANDONED]\x20Integration\x20account\x20type\x20%s.',_0x2b8192[_0x0a9e('0x37')]);})[_0x0a9e('0x5c')](function(_0x2cc7a7){logger[_0x0a9e('0x5b')]('[ABANDONED]',JSON[_0x0a9e('0x69')](_0x2cc7a7));});}; \ 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 7190985..29b15a9 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 _0xa049=['remoteUri','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','abandoned',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','sys_id','adminEmail',']\x20using\x20admin\x20profile','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','type','nameField','customField','idField','toLowerCase','content','toString','string','variable','variableName','customVariable','Variable','name','outbound','userId','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number','error','label','?sysparm_query=name%3D','label_entry','incident','Incident','ticketId','Incident\x20-\x20',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','all','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','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash'];(function(_0x216bf3,_0x43bbfe){var _0x582b63=function(_0x50813a){while(--_0x50813a){_0x216bf3['push'](_0x216bf3['shift']());}};_0x582b63(++_0x43bbfe);}(_0xa049,0x1db));var _0x9a04=function(_0x2cb7ef,_0x4dd339){_0x2cb7ef=_0x2cb7ef-0x0;var _0x5ce2e6=_0xa049[_0x2cb7ef];return _0x5ce2e6;};'use strict';var _=require(_0x9a04('0x0'));var Promise=require(_0x9a04('0x1'));var rp=require('request-promise');var util=require(_0x9a04('0x2'));var md5=require(_0x9a04('0x3'));var Redis=require(_0x9a04('0x4'));var intUtil=require(_0x9a04('0x5'));var config=require(_0x9a04('0x6'));var logger=require(_0x9a04('0x7'))(_0x9a04('0x8'));config[_0x9a04('0x9')]=_[_0x9a04('0xa')](config['redis'],{'host':_0x9a04('0xb'),'port':0x18eb});var io=require(_0x9a04('0xc'))(new Redis(config['redis']));function getAdminUser(_0x397691,_0x1c4417,_0xb7856,_0x130056,_0x280552,_0x3daadb){return new Promise(function(_0x583285,_0x12d6c2){var _0x1176f1={'method':_0x9a04('0xd'),'uri':_0x130056+_0x9a04('0xe')+'&'+_0x280552+'&'+_0x3daadb,'auth':_0x1c4417,'json':!![]};return rp(_0x1176f1)[_0x9a04('0xf')](function(_0xb153f7){if(_0xb153f7['result'][_0x9a04('0x10')]>0x0){_0xb7856[_0x9a04('0x11')]=_0xb153f7[_0x9a04('0x12')][0x0]['sys_id'];}logger[_0x9a04('0x13')]('['+[_0x397691[_0x9a04('0x14')]()]+_0x9a04('0x15'),_0xb7856);_0x583285(_0xb7856);})[_0x9a04('0x16')](function(_0x7b3cc6){logger['error']('['+[_0x397691[_0x9a04('0x14')]()]+']',_0x7b3cc6['message']);_0x12d6c2(_0x7b3cc6[_0x9a04('0x17')]);});});}function getUser(_0x83b9ff,_0x5f2e4a,_0xd5159,_0x12b723,_0x549aeb){return function(_0x8637bb){logger[_0x9a04('0x13')]('['+[_0x83b9ff[_0x9a04('0x14')]()]+_0x9a04('0x18'),_0x8637bb);return new Promise(function(_0xd86cdb,_0x54d0c8){if(intUtil[_0x9a04('0x19')](_0x8637bb[_0x9a04('0x1a')])){var _0x39512c={'method':_0x9a04('0xd'),'uri':_0xd5159+_0x9a04('0x1b')+_0x8637bb[_0x9a04('0x1a')]+'&'+_0x12b723+'&'+_0x549aeb,'auth':_0x5f2e4a,'json':!![]};logger[_0x9a04('0x13')]('['+[_0x83b9ff['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0x39512c);return rp(_0x39512c)[_0x9a04('0xf')](function(_0xcf690){logger[_0x9a04('0x13')]('['+[_0x83b9ff[_0x9a04('0x14')]()]+_0x9a04('0x1c'),_0xcf690);if(_0xcf690[_0x9a04('0x12')][_0x9a04('0x10')]>0x0&&String(_0xcf690[_0x9a04('0x12')][0x0][_0x9a04('0x1d')])===_0x9a04('0x1e')){_0x8637bb['userId']=_0xcf690[_0x9a04('0x12')][0x0][_0x9a04('0x1f')];}else{_0x8637bb['userId']=_0x8637bb[_0x9a04('0x11')];_0x8637bb[_0x9a04('0x1a')]=_0x8637bb[_0x9a04('0x20')];}logger['info']('['+[_0x83b9ff[_0x9a04('0x14')]()]+'],\x20getUser\x20crm',_0x8637bb);_0xd86cdb(_0x8637bb);})[_0x9a04('0x16')](function(_0x9b3de7){logger['error']('['+[_0x83b9ff[_0x9a04('0x14')]()]+']',_0x9b3de7[_0x9a04('0x17')]);_0x54d0c8(_0x9b3de7[_0x9a04('0x17')]);});}else{logger[_0x9a04('0x13')]('['+[_0x83b9ff[_0x9a04('0x14')]()]+_0x9a04('0x21'));_0x8637bb['userId']=_0x8637bb['adminId'];_0x8637bb[_0x9a04('0x1a')]=_0x8637bb[_0x9a04('0x20')];_0xd86cdb(_0x8637bb);}});};}function createEndUser(_0xb3bb0a,_0x9a977c,_0x2e9243,_0x334637,_0x3fd094){logger[_0x9a04('0x13')]('['+[_0xb3bb0a[_0x9a04('0x14')]()]+'],\x20createEndUser\x20input\x20crm',_0x2e9243);return new Promise(function(_0xce8658,_0x17c5f7){var _0x29ce64={'method':_0x9a04('0x22'),'uri':_0x334637+_0x9a04('0x23')+_0x3fd094,'body':{'user_name':_0x2e9243[_0x9a04('0x24')],'roles':_0x9a04('0x25'),'first_name':_0x2e9243[_0x9a04('0x24')],'active':_0x9a04('0x1e'),'date_format':_0x9a04('0x26'),'phone':_0x2e9243[_0x9a04('0x24')]},'auth':_0x9a977c,'json':!![]};return rp(_0x29ce64)[_0x9a04('0xf')](function(_0x27d0a1){logger[_0x9a04('0x13')]('['+[_0xb3bb0a[_0x9a04('0x14')]()]+_0x9a04('0x27'),_0x27d0a1[_0x9a04('0x12')]);_0x2e9243[_0x9a04('0x28')]=_0x27d0a1[_0x9a04('0x12')][_0x9a04('0x1f')];_0xce8658(_0x2e9243);})[_0x9a04('0x16')](function(_0x2a0c0b){logger['error']('['+[_0xb3bb0a[_0x9a04('0x14')]()]+']',_0x2a0c0b[_0x9a04('0x17')]);_0x17c5f7(_0x2a0c0b[_0x9a04('0x17')]);});});}function getEndUser(_0x116582,_0x3c1d5b,_0x48f040,_0x4e63e6,_0x5d0170){return function(_0x431d75){logger[_0x9a04('0x13')]('['+[_0x116582[_0x9a04('0x14')]()]+_0x9a04('0x29'),_0x431d75);return new Promise(function(_0x18a45a,_0x1668b2){var _0x31f417={'method':_0x9a04('0xd'),'uri':_0x48f040+_0x9a04('0x2a')+_0x431d75[_0x9a04('0x24')]+'&'+_0x4e63e6+'&'+_0x5d0170,'auth':_0x3c1d5b,'json':!![]};return rp(_0x31f417)[_0x9a04('0xf')](function(_0x111d59){if(_0x111d59[_0x9a04('0x12')]['length']>0x0){_0x431d75[_0x9a04('0x28')]=_0x111d59[_0x9a04('0x12')][0x0][_0x9a04('0x1f')];logger[_0x9a04('0x13')]('['+[_0x116582[_0x9a04('0x14')]()]+_0x9a04('0x2b'),_0x431d75);_0x18a45a(_0x431d75);}else{return createEndUser(_0x116582,_0x3c1d5b,_0x431d75,_0x48f040,_0x4e63e6)['then'](function(_0xa6777f){logger['info']('['+[_0x116582[_0x9a04('0x14')]()]+_0x9a04('0x2c'),_0xa6777f);_0x18a45a(_0xa6777f);});}})['catch'](function(_0x50d69f){logger['error']('['+[_0x116582[_0x9a04('0x14')]()]+']',_0x50d69f[_0x9a04('0x17')]);_0x1668b2(_0x50d69f[_0x9a04('0x17')]);});});};}function getCustomFields(_0x4cc87d,_0x302903){var _0x4908a3={};if(_0x4cc87d['length']>0x0){_[_0x9a04('0x2d')](_0x4cc87d,function(_0x100b5d){if(_0x100b5d[_0x9a04('0x2e')]==='string'&&_0x100b5d[_0x9a04('0x2f')]&&!_0x100b5d[_0x9a04('0x30')]){_0x4908a3[_0x100b5d[_0x9a04('0x31')][_0x9a04('0x32')]()]=_0x100b5d[_0x9a04('0x33')][_0x9a04('0x34')]();}else if(_0x100b5d[_0x9a04('0x2e')]===_0x9a04('0x35')&&_0x100b5d[_0x9a04('0x31')]&&_0x100b5d['customField']){_0x4908a3[_0x100b5d['idField'][_0x9a04('0x32')]()]=_0x100b5d[_0x9a04('0x33')]['toString']();}else if(_0x100b5d[_0x9a04('0x2e')]===_0x9a04('0x36')&&_0x100b5d[_0x9a04('0x37')]&&_0x100b5d[_0x9a04('0x31')]&&_0x100b5d['customField']){_0x4908a3[_0x100b5d[_0x9a04('0x31')][_0x9a04('0x32')]()]=_0x302903[_0x100b5d[_0x9a04('0x37')]][_0x9a04('0x34')]();}else if(_0x100b5d[_0x9a04('0x2e')]===_0x9a04('0x38')&&_0x100b5d[_0x9a04('0x39')]&&_0x100b5d[_0x9a04('0x39')][_0x9a04('0x3a')]&&_0x100b5d['idField']&&_0x100b5d[_0x9a04('0x30')]){_0x4908a3[_0x100b5d[_0x9a04('0x31')][_0x9a04('0x32')]()]=_0x302903[_0x100b5d[_0x9a04('0x39')][_0x9a04('0x3a')][_0x9a04('0x32')]()]['toString']();}});}return _0x4908a3;}function getTicket(_0x2c06f1,_0x5087ea,_0x498fec,_0x4d7ec9,_0x75c7e7,_0x5897e9){return function(_0xbb6369){logger[_0x9a04('0x13')]('['+[_0x2c06f1[_0x9a04('0x14')]()]+']\x20getTicket\x20input\x20crm',_0xbb6369);return new Promise(function(_0x239fa3,_0x3e2fa9){var _0x4709ef=_0x2c06f1[_0x9a04('0x32')]()===_0x9a04('0x3b')?_0xbb6369['userId']:_0xbb6369[_0x9a04('0x28')];var _0x534e09={'method':'POST','uri':_0x498fec+'incident'+'?'+_0x5897e9,'body':Object['assign']({},{'active':_0x9a04('0x1e'),'caller_id':_0x4709ef,'assigned_to':_0xbb6369[_0x9a04('0x3c')],'short_description':intUtil[_0x9a04('0x3d')](_0x4d7ec9[_0x9a04('0x3e')],_0x75c7e7,'\x20'),'description':intUtil['getString'](_0x4d7ec9[_0x9a04('0x3f')],_0x75c7e7,'\x0a')},getCustomFields(_0x4d7ec9[_0x9a04('0x40')],_0x75c7e7)),'auth':_0x5087ea,'json':!![]};return rp(_0x534e09)[_0x9a04('0xf')](function(_0x15bfcd){logger['info']('['+[_0x2c06f1[_0x9a04('0x14')]()]+_0x9a04('0x41'),_0x15bfcd[_0x9a04('0x12')]);_0xbb6369['ticketId']=_0x15bfcd[_0x9a04('0x12')][_0x9a04('0x1f')];_0xbb6369[_0x9a04('0x42')]=_0x15bfcd['result'][_0x9a04('0x43')];logger[_0x9a04('0x13')]('['+[_0x2c06f1[_0x9a04('0x14')]()]+']\x20getTicket\x20crm',_0xbb6369);_0x239fa3(_0xbb6369);})['catch'](function(_0x416316){logger[_0x9a04('0x44')]('['+[_0x2c06f1['toUpperCase']()]+']',_0x416316[_0x9a04('0x17')]);_0x3e2fa9(_0x416316[_0x9a04('0x17')]);});});};}function createRemoteTag(_0x4c449e,_0x42c18e,_0x891c8d,_0x205b6e){return new Promise(function(_0x15e321,_0x5d4413){var _0x474ad2={'method':_0x9a04('0x22'),'uri':_0x891c8d+_0x9a04('0x45')+'?'+_0x205b6e,'body':{'short_description':_0x4c449e,'global':!![],'active':!![],'name':_0x4c449e},'auth':_0x42c18e,'json':!![]};return rp(_0x474ad2)[_0x9a04('0xf')](function(_0x266267){var _0x9270=_0x266267[_0x9a04('0x12')]['sys_id'];_0x15e321(_0x9270);});});}function getRemoteTag(_0x106bd4,_0x3a9126,_0x5b5d97,_0x3a283e,_0x374777){return new Promise(function(_0x122e82,_0x1a9394){var _0x5bfd01={'method':_0x9a04('0xd'),'uri':_0x5b5d97+'label'+_0x9a04('0x46')+_0x106bd4+'&'+_0x3a283e,'auth':_0x3a9126,'json':!![]};return rp(_0x5bfd01)[_0x9a04('0xf')](function(_0x2affd5){if(_0x2affd5[_0x9a04('0x12')][_0x9a04('0x10')]>0x0){var _0xa5131e=_0x2affd5[_0x9a04('0x12')][0x0][_0x9a04('0x1f')];_0x122e82(_0xa5131e);}else{return createRemoteTag(_0x106bd4,_0x3a9126,_0x5b5d97,_0x3a283e)[_0x9a04('0xf')](function(_0x5e8d9e){_0x122e82(_0x5e8d9e);});}});});}function assignTagToIncident(_0x3df3d0,_0x4cad23,_0x46e495,_0x3717c4,_0x41bb62){return new Promise(function(_0x4af7a6,_0x39d745){var _0x4bde76={'method':_0x9a04('0x22'),'uri':_0x46e495+_0x9a04('0x47')+'?'+_0x41bb62,'body':{'label':_0x3df3d0,'table':_0x9a04('0x48'),'id_type':_0x9a04('0x49'),'table_key':_0x3717c4[_0x9a04('0x4a')],'title':_0x9a04('0x4b')+_0x3717c4['ticketNumber'],'id_display':_0x3717c4[_0x9a04('0x42')]},'auth':_0x4cad23,'json':!![]};return rp(_0x4bde76)['then'](function(_0x5e31e8){_0x4af7a6();})[_0x9a04('0x16')](function(){_0x4af7a6();});});}function manageTags(_0x496a98,_0x1324c5,_0x428062,_0x5150ac,_0x419cbf,_0x2557e0,_0xbe6f85){return new Promise(function(_0x46698f,_0x281587){var _0x110f46=[];_0x1324c5['forEach'](function(_0x315e9f){_0x110f46['push'](getRemoteTag(_0x315e9f,_0x428062,_0x5150ac,_0x2557e0,_0xbe6f85));});return Promise['all'](_0x110f46)[_0x9a04('0xf')](function(_0x5895f5){if(_0x5895f5[_0x9a04('0x10')]){logger['info']('['+[_0x496a98[_0x9a04('0x14')]()]+_0x9a04('0x4c'),_0x5895f5);var _0x1e1431=[];_0x5895f5[_0x9a04('0x2d')](function(_0x452e0f){_0x1e1431[_0x9a04('0x4d')](assignTagToIncident(_0x452e0f,_0x428062,_0x5150ac,_0x419cbf,_0x2557e0));});return Promise[_0x9a04('0x4e')](_0x1e1431)[_0x9a04('0xf')](function(){_0x46698f();})[_0x9a04('0x16')](function(){_0x46698f();});}else{_0x46698f();}});});}function getTags(_0x2d72d8,_0x368f94,_0x4f7c1c,_0x5e1449,_0x28a731,_0x4d7261){return function(_0x42e095){return new Promise(function(_0x4123fd,_0x4f3652){var _0x421df3=[];var _0xb14652=_0x5e1449[_0x9a04('0x4f')];if(_0xb14652&&_0xb14652[_0x9a04('0x10')]>0x0){_0x421df3=_[_0x9a04('0x50')](_0xb14652,_0x9a04('0x3a'));}if(_0x421df3['length']>0x0){return manageTags(_0x2d72d8,_0x421df3,_0x368f94,_0x4f7c1c,_0x42e095,_0x28a731,_0x4d7261)[_0x9a04('0xf')](function(){_0x4123fd(_0x42e095);});}else{_0x4123fd(_0x42e095);}});};}function emit(_0x42a790,_0x230167,_0x2626dc){var _0x40179c=_0x9a04('0x51')+_0x9a04('0x52')+_0x9a04('0x53')+_0x9a04('0x54');var _0x36e8b4={'uri':_0x42a790+_0x9a04('0x55')+_0x2626dc+_0x40179c};io['to'](util[_0x9a04('0x56')](_0x9a04('0x57'),_0x230167))[_0x9a04('0x58')](_0x9a04('0x59'),_0x36e8b4);}exports['cs']=function(_0x4e10e5,_0x523ddc,_0x52520e,_0x4fe4aa,_0x2d8cb2,_0x435af5,_0x3e1bbb,_0x5dda36){var _0x45cfcd={};var _0x446cbb={'user':_0x435af5[_0x9a04('0x5a')],'pass':_0x435af5[_0x9a04('0x5b')]};var _0x4602e8=_0x9a04('0x5c');var _0xf8c63c=_0x9a04('0x5d');_0x435af5['remoteUri']=intUtil[_0x9a04('0x5e')](_0x435af5[_0x9a04('0x5f')]);_0x435af5[_0x9a04('0x60')]=intUtil[_0x9a04('0x5e')](_0x435af5['serverUrl']);var _0x1437c1=util[_0x9a04('0x56')](_0x9a04('0x61'),_0x435af5['remoteUri']);_0x45cfcd[_0x9a04('0x1a')]=!_['isNil'](_0x4fe4aa)?_0x4fe4aa['email']:null;_0x45cfcd[_0x9a04('0x20')]=_0x435af5[_0x9a04('0x62')];_0x45cfcd[_0x9a04('0x24')]=_0x5dda36[_0x9a04('0x32')]()===_0x9a04('0x3b')?_0x523ddc[_0x9a04('0x63')]:_0x523ddc[_0x9a04('0x64')];_0x45cfcd[_0x9a04('0x65')]=_0x5dda36===_0x9a04('0x66')||_0x5dda36==='abandoned'?'queue':_0x9a04('0x3b');var _0x5f537c=util['format'](_0x9a04('0x67'),_0x435af5[_0x9a04('0x60')],_0x523ddc[_0x9a04('0x68')],md5(_0x523ddc[_0x9a04('0x68')]));if(_0x2d8cb2&&_0x2d8cb2['monitor_format']){logger['info']('[QUEUE]',_0x9a04('0x69'));_0x523ddc['recordingURL']=_0x5f537c;}else if(_0x3e1bbb&&_0x3e1bbb['recordingFormat']&&_0x3e1bbb[_0x9a04('0x6a')]!==_0x9a04('0x6b')){logger['info']('[OUTBOUND]',_0x9a04('0x69'));_0x523ddc[_0x9a04('0x6c')]=_0x5f537c;}else{_0x523ddc[_0x9a04('0x6c')]='';}return getAdminUser(_0x5dda36,_0x446cbb,_0x45cfcd,_0x1437c1,_0xf8c63c,_0x4602e8)[_0x9a04('0xf')](getUser(_0x5dda36,_0x446cbb,_0x1437c1,_0xf8c63c,_0x4602e8))['then'](getEndUser(_0x5dda36,_0x446cbb,_0x1437c1,_0xf8c63c,_0x4602e8))['then'](getTicket(_0x5dda36,_0x446cbb,_0x1437c1,_0x52520e,_0x523ddc,_0xf8c63c))[_0x9a04('0xf')](function(_0x2577f1){logger[_0x9a04('0x13')](util[_0x9a04('0x56')](_0x9a04('0x6d'),_0x2577f1[_0x9a04('0x4a')]));logger[_0x9a04('0x13')](util[_0x9a04('0x56')](_0x9a04('0x6e'),_0x5dda36));if(_0x5dda36!==_0x9a04('0x6f')){logger[_0x9a04('0x13')]('['+[_0x5dda36[_0x9a04('0x14')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x435af5[_0x9a04('0x5f')],_0x4fe4aa[_0x9a04('0x3a')],_0x2577f1[_0x9a04('0x4a')]);}})[_0x9a04('0x16')](function(_0x528bca){logger[_0x9a04('0x44')]('['+[_0x5dda36[_0x9a04('0x14')]()]+_0x9a04('0x70'),util[_0x9a04('0x71')](_0x528bca,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x0962=['sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','info','validateEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','true','userEmail','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','userId','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','System','],\x20EndUser\x20schema','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','type','string','nameField','customField','idField','toLowerCase','content','toString','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','getString','Subjects',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','incident','ticketId','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','serverUrl','format','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','util','ioredis','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId'];(function(_0x1813ea,_0x3725c1){var _0x5b66c2=function(_0x4966a0){while(--_0x4966a0){_0x1813ea['push'](_0x1813ea['shift']());}};_0x5b66c2(++_0x3725c1);}(_0x0962,0x198));var _0x2096=function(_0x36af05,_0x4cb944){_0x36af05=_0x36af05-0x0;var _0x2fc0ec=_0x0962[_0x36af05];return _0x2fc0ec;};'use strict';var _=require(_0x2096('0x0'));var Promise=require(_0x2096('0x1'));var rp=require(_0x2096('0x2'));var util=require(_0x2096('0x3'));var md5=require('md5');var Redis=require(_0x2096('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x2096('0x5'))(_0x2096('0x6'));config[_0x2096('0x7')]=_[_0x2096('0x8')](config[_0x2096('0x7')],{'host':_0x2096('0x9'),'port':0x18eb});var io=require(_0x2096('0xa'))(new Redis(config[_0x2096('0x7')]));function getAdminUser(_0x4b5f76,_0x16799f,_0x10b0e7,_0x406461,_0x21b8f3,_0x2f49bf){return new Promise(function(_0x263db6,_0x442772){var _0x2eacde={'method':'GET','uri':_0x406461+_0x2096('0xb')+'&'+_0x21b8f3+'&'+_0x2f49bf,'auth':_0x16799f,'json':!![]};return rp(_0x2eacde)[_0x2096('0xc')](function(_0x4ee402){if(_0x4ee402[_0x2096('0xd')][_0x2096('0xe')]>0x0){_0x10b0e7[_0x2096('0xf')]=_0x4ee402[_0x2096('0xd')][0x0][_0x2096('0x10')];}logger['info']('['+[_0x4b5f76[_0x2096('0x11')]()]+_0x2096('0x12'),_0x10b0e7);_0x263db6(_0x10b0e7);})[_0x2096('0x13')](function(_0x5a5c51){logger[_0x2096('0x14')]('['+[_0x4b5f76[_0x2096('0x11')]()]+']',_0x5a5c51[_0x2096('0x15')]);_0x442772(_0x5a5c51['message']);});});}function getUser(_0xf78759,_0x37dcd0,_0x2c6e88,_0x305ada,_0x5b151a){return function(_0x3ef51e){logger[_0x2096('0x16')]('['+[_0xf78759[_0x2096('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x3ef51e);return new Promise(function(_0x479ba2,_0x290294){if(intUtil[_0x2096('0x17')](_0x3ef51e['userEmail'])){var _0xd7e9e0={'method':_0x2096('0x18'),'uri':_0x2c6e88+_0x2096('0x19')+_0x3ef51e['userEmail']+'&'+_0x305ada+'&'+_0x5b151a,'auth':_0x37dcd0,'json':!![]};logger[_0x2096('0x16')]('['+[_0xf78759['toUpperCase']()]+_0x2096('0x1a'),_0xd7e9e0);return rp(_0xd7e9e0)[_0x2096('0xc')](function(_0xb1489a){logger[_0x2096('0x16')]('['+[_0xf78759[_0x2096('0x11')]()]+_0x2096('0x1b'),_0xb1489a);if(_0xb1489a[_0x2096('0xd')][_0x2096('0xe')]>0x0&&String(_0xb1489a[_0x2096('0xd')][0x0]['active'])===_0x2096('0x1c')){_0x3ef51e['userId']=_0xb1489a[_0x2096('0xd')][0x0]['sys_id'];}else{_0x3ef51e['userId']=_0x3ef51e[_0x2096('0xf')];_0x3ef51e[_0x2096('0x1d')]=_0x3ef51e[_0x2096('0x1e')];}logger[_0x2096('0x16')]('['+[_0xf78759[_0x2096('0x11')]()]+_0x2096('0x1f'),_0x3ef51e);_0x479ba2(_0x3ef51e);})[_0x2096('0x13')](function(_0xe72b8a){logger[_0x2096('0x14')]('['+[_0xf78759[_0x2096('0x11')]()]+']',_0xe72b8a[_0x2096('0x15')]);_0x290294(_0xe72b8a[_0x2096('0x15')]);});}else{logger['info']('['+[_0xf78759['toUpperCase']()]+_0x2096('0x20'));_0x3ef51e[_0x2096('0x21')]=_0x3ef51e[_0x2096('0xf')];_0x3ef51e[_0x2096('0x1d')]=_0x3ef51e[_0x2096('0x1e')];_0x479ba2(_0x3ef51e);}});};}function createEndUser(_0xeec1a7,_0x1a8df7,_0x1e980c,_0x73b7b4,_0x56e019){logger[_0x2096('0x16')]('['+[_0xeec1a7[_0x2096('0x11')]()]+_0x2096('0x22'),_0x1e980c);return new Promise(function(_0x242af,_0x2402d5){var _0x2464a0={'method':_0x2096('0x23'),'uri':_0x73b7b4+_0x2096('0x24')+_0x56e019,'body':{'user_name':_0x1e980c['endUserNumber'],'roles':_0x2096('0x25'),'first_name':_0x1e980c[_0x2096('0x26')],'active':'true','date_format':_0x2096('0x27'),'phone':_0x1e980c[_0x2096('0x26')]},'auth':_0x1a8df7,'json':!![]};return rp(_0x2464a0)[_0x2096('0xc')](function(_0x3cc62f){logger[_0x2096('0x16')]('['+[_0xeec1a7[_0x2096('0x11')]()]+_0x2096('0x28'),_0x3cc62f[_0x2096('0xd')]);_0x1e980c['endUserId']=_0x3cc62f[_0x2096('0xd')][_0x2096('0x10')];_0x242af(_0x1e980c);})['catch'](function(_0x6abbfe){logger['error']('['+[_0xeec1a7['toUpperCase']()]+']',_0x6abbfe[_0x2096('0x15')]);_0x2402d5(_0x6abbfe[_0x2096('0x15')]);});});}function getEndUser(_0x3c902c,_0x17f2cf,_0x5db3b5,_0x4ed750,_0x421b63){return function(_0x391c8e){logger[_0x2096('0x16')]('['+[_0x3c902c[_0x2096('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x391c8e);return new Promise(function(_0x504c7c,_0x433be5){var _0x2f6bf4={'method':'GET','uri':_0x5db3b5+_0x2096('0x29')+_0x391c8e[_0x2096('0x26')]+'&'+_0x4ed750+'&'+_0x421b63,'auth':_0x17f2cf,'json':!![]};return rp(_0x2f6bf4)['then'](function(_0xea2602){if(_0xea2602['result']['length']>0x0){_0x391c8e[_0x2096('0x2a')]=_0xea2602['result'][0x0][_0x2096('0x10')];logger['info']('['+[_0x3c902c[_0x2096('0x11')]()]+_0x2096('0x2b'),_0x391c8e);_0x504c7c(_0x391c8e);}else{return createEndUser(_0x3c902c,_0x17f2cf,_0x391c8e,_0x5db3b5,_0x4ed750)[_0x2096('0xc')](function(_0x103fa1){logger[_0x2096('0x16')]('['+[_0x3c902c[_0x2096('0x11')]()]+_0x2096('0x2c'),_0x103fa1);_0x504c7c(_0x103fa1);});}})[_0x2096('0x13')](function(_0x1072af){logger[_0x2096('0x14')]('['+[_0x3c902c[_0x2096('0x11')]()]+']',_0x1072af[_0x2096('0x15')]);_0x433be5(_0x1072af['message']);});});};}function getCustomFields(_0x370bd1,_0x4d7ec5){var _0xbcd39a={};if(_0x370bd1[_0x2096('0xe')]>0x0){_[_0x2096('0x2d')](_0x370bd1,function(_0x2f6081){if(_0x2f6081[_0x2096('0x2e')]===_0x2096('0x2f')&&_0x2f6081[_0x2096('0x30')]&&!_0x2f6081[_0x2096('0x31')]){_0xbcd39a[_0x2f6081[_0x2096('0x32')][_0x2096('0x33')]()]=_0x2f6081[_0x2096('0x34')]['toString']();}else if(_0x2f6081[_0x2096('0x2e')]==='string'&&_0x2f6081[_0x2096('0x32')]&&_0x2f6081[_0x2096('0x31')]){_0xbcd39a[_0x2f6081['idField']['toLowerCase']()]=_0x2f6081[_0x2096('0x34')][_0x2096('0x35')]();}else if(_0x2f6081['type']===_0x2096('0x36')&&_0x2f6081[_0x2096('0x37')]&&_0x2f6081[_0x2096('0x32')]&&_0x2f6081[_0x2096('0x31')]){_0xbcd39a[_0x2f6081[_0x2096('0x32')][_0x2096('0x33')]()]=_0x4d7ec5[_0x2f6081['variableName']][_0x2096('0x35')]();}else if(_0x2f6081[_0x2096('0x2e')]===_0x2096('0x38')&&_0x2f6081['Variable']&&_0x2f6081[_0x2096('0x39')][_0x2096('0x3a')]&&_0x2f6081[_0x2096('0x32')]&&_0x2f6081['customField']){_0xbcd39a[_0x2f6081[_0x2096('0x32')][_0x2096('0x33')]()]=_0x4d7ec5[_0x2f6081['Variable'][_0x2096('0x3a')][_0x2096('0x33')]()][_0x2096('0x35')]();}});}return _0xbcd39a;}function getTicket(_0xaa24cf,_0x506c5c,_0x5a013c,_0x2f0341,_0x4daad4,_0x4f80bb){return function(_0x4ece1e){logger[_0x2096('0x16')]('['+[_0xaa24cf[_0x2096('0x11')]()]+_0x2096('0x3b'),_0x4ece1e);return new Promise(function(_0x435a8a,_0x4f1405){var _0x5c59ef=_0xaa24cf[_0x2096('0x33')]()===_0x2096('0x3c')?_0x4ece1e[_0x2096('0x21')]:_0x4ece1e[_0x2096('0x2a')];var _0x382017={'method':_0x2096('0x23'),'uri':_0x5a013c+'incident'+'?'+_0x4f80bb,'body':Object['assign']({},{'active':_0x2096('0x1c'),'caller_id':_0x5c59ef,'assigned_to':_0x4ece1e[_0x2096('0x21')],'short_description':intUtil[_0x2096('0x3d')](_0x2f0341[_0x2096('0x3e')],_0x4daad4,'\x20'),'description':intUtil[_0x2096('0x3d')](_0x2f0341['Descriptions'],_0x4daad4,'\x0a')},getCustomFields(_0x2f0341['Fields'],_0x4daad4)),'auth':_0x506c5c,'json':!![]};return rp(_0x382017)[_0x2096('0xc')](function(_0x116c42){logger['info']('['+[_0xaa24cf[_0x2096('0x11')]()]+_0x2096('0x3f'),_0x116c42[_0x2096('0xd')]);_0x4ece1e['ticketId']=_0x116c42['result']['sys_id'];_0x4ece1e[_0x2096('0x40')]=_0x116c42[_0x2096('0xd')][_0x2096('0x41')];logger[_0x2096('0x16')]('['+[_0xaa24cf[_0x2096('0x11')]()]+_0x2096('0x42'),_0x4ece1e);_0x435a8a(_0x4ece1e);})['catch'](function(_0x2aff64){logger[_0x2096('0x14')]('['+[_0xaa24cf['toUpperCase']()]+']',_0x2aff64['message']);_0x4f1405(_0x2aff64[_0x2096('0x15')]);});});};}function createRemoteTag(_0x3a8893,_0x13b2d1,_0x34972e,_0x46e66b){return new Promise(function(_0x374217,_0x4599e5){var _0x2696bc={'method':_0x2096('0x23'),'uri':_0x34972e+_0x2096('0x43')+'?'+_0x46e66b,'body':{'short_description':_0x3a8893,'global':!![],'active':!![],'name':_0x3a8893},'auth':_0x13b2d1,'json':!![]};return rp(_0x2696bc)['then'](function(_0x43074d){var _0x2d1f95=_0x43074d[_0x2096('0xd')][_0x2096('0x10')];_0x374217(_0x2d1f95);});});}function getRemoteTag(_0x749600,_0x5677bd,_0x53055f,_0x51eacd,_0x48ec17){return new Promise(function(_0x4ae9d6,_0x416684){var _0x386a47={'method':_0x2096('0x18'),'uri':_0x53055f+_0x2096('0x43')+_0x2096('0x44')+_0x749600+'&'+_0x51eacd,'auth':_0x5677bd,'json':!![]};return rp(_0x386a47)[_0x2096('0xc')](function(_0x13a73a){if(_0x13a73a[_0x2096('0xd')][_0x2096('0xe')]>0x0){var _0x3ef290=_0x13a73a['result'][0x0][_0x2096('0x10')];_0x4ae9d6(_0x3ef290);}else{return createRemoteTag(_0x749600,_0x5677bd,_0x53055f,_0x51eacd)[_0x2096('0xc')](function(_0x1088c0){_0x4ae9d6(_0x1088c0);});}});});}function assignTagToIncident(_0x896a27,_0x2f8915,_0x4dcabb,_0x432447,_0x1847fc){return new Promise(function(_0x118c42,_0x44cbaa){var _0x1c93af={'method':_0x2096('0x23'),'uri':_0x4dcabb+_0x2096('0x45')+'?'+_0x1847fc,'body':{'label':_0x896a27,'table':_0x2096('0x46'),'id_type':'Incident','table_key':_0x432447[_0x2096('0x47')],'title':_0x2096('0x48')+_0x432447[_0x2096('0x40')],'id_display':_0x432447[_0x2096('0x40')]},'auth':_0x2f8915,'json':!![]};return rp(_0x1c93af)[_0x2096('0xc')](function(_0x41a96e){_0x118c42();})[_0x2096('0x13')](function(){_0x118c42();});});}function manageTags(_0x2cbec8,_0x53ddab,_0x1d54c7,_0x531888,_0x5a5b81,_0x440a41,_0x1d2d11){return new Promise(function(_0x37a5da,_0x398670){var _0x5c0dde=[];_0x53ddab[_0x2096('0x2d')](function(_0x2e794c){_0x5c0dde[_0x2096('0x49')](getRemoteTag(_0x2e794c,_0x1d54c7,_0x531888,_0x440a41,_0x1d2d11));});return Promise[_0x2096('0x4a')](_0x5c0dde)['then'](function(_0x337063){if(_0x337063[_0x2096('0xe')]){logger[_0x2096('0x16')]('['+[_0x2cbec8[_0x2096('0x11')]()]+_0x2096('0x4b'),_0x337063);var _0x4c1991=[];_0x337063[_0x2096('0x2d')](function(_0x1e9f32){_0x4c1991[_0x2096('0x49')](assignTagToIncident(_0x1e9f32,_0x1d54c7,_0x531888,_0x5a5b81,_0x440a41));});return Promise[_0x2096('0x4a')](_0x4c1991)[_0x2096('0xc')](function(){_0x37a5da();})[_0x2096('0x13')](function(){_0x37a5da();});}else{_0x37a5da();}});});}function getTags(_0x3e5f4e,_0x55bcb9,_0x377c6e,_0x1cf485,_0x61338b,_0x26e3e8){return function(_0x4ad2bd){return new Promise(function(_0x7ab34b,_0x351b77){var _0x280c4d=[];var _0x4d5c75=_0x1cf485[_0x2096('0x4c')];if(_0x4d5c75&&_0x4d5c75[_0x2096('0xe')]>0x0){_0x280c4d=_[_0x2096('0x4d')](_0x4d5c75,_0x2096('0x3a'));}if(_0x280c4d[_0x2096('0xe')]>0x0){return manageTags(_0x3e5f4e,_0x280c4d,_0x55bcb9,_0x377c6e,_0x4ad2bd,_0x61338b,_0x26e3e8)[_0x2096('0xc')](function(){_0x7ab34b(_0x4ad2bd);});}else{_0x7ab34b(_0x4ad2bd);}});};}function emit(_0x26a833,_0x18ceea,_0x59d633){var _0x42bfad=_0x2096('0x4e')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x2096('0x4f')+'%255EORDERBYDESCnumber';var _0x4adad1={'uri':_0x26a833+_0x2096('0x50')+_0x59d633+_0x42bfad};io['to'](util['format'](_0x2096('0x51'),_0x18ceea))[_0x2096('0x52')](_0x2096('0x53'),_0x4adad1);}exports['cs']=function(_0x72971f,_0x2ebd9b,_0x51494a,_0x500f88,_0x5ab676,_0x1b0d7b,_0x4265b4,_0x542a1a){var _0x11f7e2={};var _0x5be3ef={'user':_0x1b0d7b[_0x2096('0x54')],'pass':_0x1b0d7b[_0x2096('0x55')]};var _0x33cbb7=_0x2096('0x56');var _0x32ede2=_0x2096('0x57');_0x1b0d7b[_0x2096('0x58')]=intUtil['stripTrailingSlash'](_0x1b0d7b[_0x2096('0x58')]);_0x1b0d7b['serverUrl']=intUtil['stripTrailingSlash'](_0x1b0d7b[_0x2096('0x59')]);var _0x3b96e4=util[_0x2096('0x5a')]('%s/api/now/table/',_0x1b0d7b[_0x2096('0x58')]);_0x11f7e2[_0x2096('0x1d')]=!_['isNil'](_0x500f88)?_0x500f88['email']:null;_0x11f7e2['adminEmail']=_0x1b0d7b['email'];_0x11f7e2[_0x2096('0x26')]=_0x542a1a[_0x2096('0x33')]()==='outbound'?_0x2ebd9b[_0x2096('0x5b')]:_0x2ebd9b[_0x2096('0x5c')];_0x11f7e2['callDirection']=_0x542a1a===_0x2096('0x5d')||_0x542a1a===_0x2096('0x5e')?_0x2096('0x5d'):_0x2096('0x3c');var _0x374639=util[_0x2096('0x5a')](_0x2096('0x5f'),_0x1b0d7b[_0x2096('0x59')],_0x2ebd9b['uniqueid'],md5(_0x2ebd9b[_0x2096('0x60')]));if(_0x5ab676&&_0x5ab676['monitor_format']){logger[_0x2096('0x16')](_0x2096('0x61'),_0x2096('0x62'));_0x2ebd9b[_0x2096('0x63')]=_0x374639;}else if(_0x4265b4&&_0x4265b4[_0x2096('0x64')]&&_0x4265b4[_0x2096('0x64')]!=='none'){logger['info'](_0x2096('0x65'),_0x2096('0x62'));_0x2ebd9b[_0x2096('0x63')]=_0x374639;}else{_0x2ebd9b[_0x2096('0x63')]='';}return getAdminUser(_0x542a1a,_0x5be3ef,_0x11f7e2,_0x3b96e4,_0x32ede2,_0x33cbb7)['then'](getUser(_0x542a1a,_0x5be3ef,_0x3b96e4,_0x32ede2,_0x33cbb7))[_0x2096('0xc')](getEndUser(_0x542a1a,_0x5be3ef,_0x3b96e4,_0x32ede2,_0x33cbb7))[_0x2096('0xc')](getTicket(_0x542a1a,_0x5be3ef,_0x3b96e4,_0x51494a,_0x2ebd9b,_0x32ede2))['then'](function(_0x1c9d9a){logger['info'](util[_0x2096('0x5a')](_0x2096('0x66'),_0x1c9d9a[_0x2096('0x47')]));logger[_0x2096('0x16')](util[_0x2096('0x5a')](_0x2096('0x67'),_0x542a1a));if(_0x542a1a!==_0x2096('0x5e')){logger[_0x2096('0x16')]('['+[_0x542a1a[_0x2096('0x11')]()]+']',_0x2096('0x68'));emit(_0x1b0d7b[_0x2096('0x58')],_0x500f88[_0x2096('0x3a')],_0x1c9d9a[_0x2096('0x47')]);}})[_0x2096('0x13')](function(_0xc612df){logger[_0x2096('0x14')]('['+[_0x542a1a['toUpperCase']()]+_0x2096('0x69'),util['inspect'](_0xc612df,{'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 23c0b7f..2a927d1 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 _0x6a3a=['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','[QUEUE]','user:%s','trigger:browser:url','catch','outbound','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Outbound','Ticket\x20created!','[OUTBOUND]','error','abandoned','[ABANDONED]','lodash','request-promise','bluebird','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','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.','first_name','debug','[HTTP]','merge','type','string','nameField','toLowerCase','customField','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','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users'];(function(_0x180259,_0x424cab){var _0x36a03a=function(_0x29d1b8){while(--_0x29d1b8){_0x180259['push'](_0x180259['shift']());}};_0x36a03a(++_0x424cab);}(_0x6a3a,0x8f));var _0xa6a3=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x6a3a[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0xa6a3('0x0'));var rp=require(_0xa6a3('0x1'));var BPromise=require(_0xa6a3('0x2'));var md5=require(_0xa6a3('0x3'));var util=require(_0xa6a3('0x4'));var Redis=require(_0xa6a3('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xa6a3('0x6'))('sugarcrm');config[_0xa6a3('0x7')]=_[_0xa6a3('0x8')](config[_0xa6a3('0x7')],{'host':_0xa6a3('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var def={'method':_0xa6a3('0xa'),'json':!![]};function emit(_0x11c698,_0x45e3ec,_0x2f98e4){io['to'](_0x11c698)[_0xa6a3('0xb')](_0x45e3ec,_0x2f98e4);}function getTicket(_0x23e533,_0x118a95,_0x2e1d5b,_0x2a396f,_0x172807,_0x7d1f86,_0x3602c2,_0x1b275c){logger[_0xa6a3('0xc')](_0xa6a3('0xd'));var _0x1aca5f=new Date();var _0x5c9b05=[{'name':_0xa6a3('0xe'),'value':intUtil[_0xa6a3('0xf')](_0x2a396f[_0xa6a3('0x10')],_0x172807,'\x20')},{'name':_0xa6a3('0x11'),'value':_0x118a95['id']},{'name':_0xa6a3('0x12'),'value':_0x118a95['id']},{'name':_0xa6a3('0x13'),'value':intUtil[_0xa6a3('0xf')](_0x2a396f[_0xa6a3('0x14')],_0x172807,'\x0a')},{'name':_0xa6a3('0x15'),'value':_0x1aca5f[_0xa6a3('0x16')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xa6a3('0x17'),'value':'15'},{'name':_0xa6a3('0x18'),'value':_0x2e1d5b['id']},{'name':_0xa6a3('0x19'),'value':_0xa6a3('0x1a')},{'name':_0xa6a3('0x1b'),'value':_0x2e1d5b[_0xa6a3('0xe')]},{'name':_0xa6a3('0x1c'),'value':_0x1b275c}];if(_0x7d1f86[_0xa6a3('0x1d')]){_[_0xa6a3('0x1e')](_0x7d1f86,function(_0x2dca74){if(_0x172807[_0x2dca74[_0xa6a3('0x1f')]]){_0x5c9b05[_0xa6a3('0x20')]({'name':_0x2dca74[_0xa6a3('0x21')],'value':_0x172807[_0x2dca74[_0xa6a3('0x1f')]]});}});}return request({'form':{'method':_0xa6a3('0x22'),'input_type':_0xa6a3('0x23'),'response_type':'JSON','rest_data':JSON[_0xa6a3('0x24')]({'session':_0x3602c2['id'],'module_name':_0xa6a3('0x25'),'name_value_list':_0x5c9b05})}});}function getAuth(_0x2c3e22){return util['format'](_0xa6a3('0x26'),new Buffer(_0x2c3e22[_0xa6a3('0x27')]+':X')[_0xa6a3('0x28')](_0xa6a3('0x29')));}function getServerInfo(_0x3af6ef){return request({'form':{'method':_0xa6a3('0x2a'),'input_type':_0xa6a3('0x23'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x3af6ef['id']})}});}function getUser(_0x5bead2,_0x15f363,_0x1cbf0e){if(!_[_0xa6a3('0x2b')](_0x15f363)){logger[_0xa6a3('0xc')](_0xa6a3('0x2c'),_0x15f363);return request({'form':{'method':_0xa6a3('0x2d'),'input_type':_0xa6a3('0x23'),'response_type':_0xa6a3('0x23'),'rest_data':JSON[_0xa6a3('0x24')]({'session':_0x1cbf0e['id'],'module_name':_0xa6a3('0x2e'),'query':util[_0xa6a3('0x2f')](_0xa6a3('0x30'),_0x15f363),'order_by':'','offset':'0','select_fields':['id','name',_0xa6a3('0x31')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa6a3('0x32')](function(_0x520118){if(_0x520118[_0xa6a3('0x33')]['length']){var _0x3592f2=_[_0xa6a3('0x34')](_0x520118[_0xa6a3('0x33')],function(_0x530f45){return _0x530f45[_0xa6a3('0x35')][_0xa6a3('0x31')][_0xa6a3('0x36')]===_0x15f363;});if(_0x3592f2){logger['info']('Agent\x20found!');return BPromise[_0xa6a3('0x37')]({'id':_0x3592f2[_0xa6a3('0x35')]['id']['value'],'name':_0x3592f2[_0xa6a3('0x35')][_0xa6a3('0xe')][_0xa6a3('0x36')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x1cbf0e[_0xa6a3('0x35')][_0xa6a3('0x38')]['value'],'name':_0x1cbf0e['name_value_list'][_0xa6a3('0x31')][_0xa6a3('0x36')]});});}else{logger[_0xa6a3('0xc')](_0xa6a3('0x39'));return BPromise['resolve']({'id':_0x1cbf0e['name_value_list']['user_id'][_0xa6a3('0x36')],'name':_0x1cbf0e[_0xa6a3('0x35')]['user_name'][_0xa6a3('0x36')]});}}function getEndUser(_0x4c945a,_0x3c871f,_0x47e555,_0x5da6f1){logger[_0xa6a3('0xc')](_0xa6a3('0x3a'),_0x47e555);return request({'form':{'method':_0xa6a3('0x2d'),'input_type':_0xa6a3('0x23'),'response_type':_0xa6a3('0x23'),'rest_data':JSON[_0xa6a3('0x24')]({'session':_0x5da6f1['id'],'module_name':_0xa6a3('0x1a'),'query':util[_0xa6a3('0x2f')](_0xa6a3('0x3b'),_0x47e555),'order_by':'','offset':'0','select_fields':['id',_0xa6a3('0xe'),_0xa6a3('0x3c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa6a3('0x32')](function(_0x17e01c){if(_0x17e01c['entry_list'][_0xa6a3('0x1d')]){var _0x50f158=_[_0xa6a3('0x34')](_0x17e01c[_0xa6a3('0x33')],function(_0x35acdb){return _0x35acdb[_0xa6a3('0x35')][_0xa6a3('0x3c')][_0xa6a3('0x36')]===_0x47e555;});if(_0x50f158){logger[_0xa6a3('0xc')](_0xa6a3('0x3d'));return BPromise['resolve']({'id':_0x50f158[_0xa6a3('0x35')]['id'][_0xa6a3('0x36')],'name':_0x50f158[_0xa6a3('0x35')][_0xa6a3('0xe')][_0xa6a3('0x36')],'phone':_0x50f158[_0xa6a3('0x35')][_0xa6a3('0x3c')]['value']});}}else{logger[_0xa6a3('0xc')](_0xa6a3('0x3e'));return request({'form':{'method':'set_entry','input_type':_0xa6a3('0x23'),'response_type':_0xa6a3('0x23'),'rest_data':JSON[_0xa6a3('0x24')]({'session':_0x5da6f1['id'],'module_name':_0xa6a3('0x1a'),'name_value_list':[{'name':'first_name','value':_0x3c871f!==_0xa6a3('0x3f')?_0x3c871f:util[_0xa6a3('0x2f')]('Caller\x20-\x20%s',_0x47e555)},{'name':'phone_home','value':_0x47e555}]})}})[_0xa6a3('0x32')](function(_0x2d32e8){logger[_0xa6a3('0xc')](_0xa6a3('0x40'));return BPromise[_0xa6a3('0x37')]({'id':_0x2d32e8['id'],'name':_0x2d32e8[_0xa6a3('0x33')][_0xa6a3('0x41')][_0xa6a3('0x36')],'phone':_0x2d32e8[_0xa6a3('0x33')]['phone_home'][_0xa6a3('0x36')]});});}});}function request(_0x16bb5d){logger[_0xa6a3('0x42')](_0xa6a3('0x43'),JSON[_0xa6a3('0x24')](_0x16bb5d));return rp(_[_0xa6a3('0x44')](def,_0x16bb5d));}function getTags(_0x5134e9,_0x344cb8){var _0x257e6a=[];if(_0x5134e9&&_0x5134e9[_0xa6a3('0x1d')]>0x0){_0x257e6a=_['map'](_0x5134e9,_0x344cb8);}return _0x257e6a;}function getCustomFields(_0x16c321,_0x488b12){var _0x36f145=[];var _0x521497={'custom_fields':[]};if(_0x16c321[_0xa6a3('0x1d')]>0x0){_[_0xa6a3('0x1e')](_0x16c321,function(_0x11e940){if(_0x11e940[_0xa6a3('0x45')]===_0xa6a3('0x46')&&_0x11e940[_0xa6a3('0x47')]&&!_0x11e940['customField']){_0x521497[_0x11e940[_0xa6a3('0x47')][_0xa6a3('0x48')]()]=_0x11e940['content']['toString']();}else if(_0x11e940[_0xa6a3('0x45')]===_0xa6a3('0x46')&&_0x11e940['idField']&&_0x11e940[_0xa6a3('0x49')]){_0x521497[_0xa6a3('0x4a')]['push']({'id':_0x11e940[_0xa6a3('0x21')],'value':_0x11e940[_0xa6a3('0x4b')][_0xa6a3('0x28')]()});}else if(_0x11e940[_0xa6a3('0x45')]===_0xa6a3('0x4c')&&_0x11e940[_0xa6a3('0x1f')]&&_0x11e940[_0xa6a3('0x21')]&&_0x11e940[_0xa6a3('0x49')]){_0x488b12[_0x11e940[_0xa6a3('0x1f')]]&&_0x521497['custom_fields'][_0xa6a3('0x20')]({'id':_0x11e940[_0xa6a3('0x21')],'value':_0x488b12[_0x11e940[_0xa6a3('0x1f')]][_0xa6a3('0x28')]()});}else if(_0x11e940[_0xa6a3('0x45')]===_0xa6a3('0x4d')&&_0x11e940[_0xa6a3('0x4e')]&&_0x11e940[_0xa6a3('0x4e')][_0xa6a3('0xe')]&&_0x11e940[_0xa6a3('0x21')]&&_0x11e940[_0xa6a3('0x49')]){_0x488b12[_0x11e940[_0xa6a3('0x4e')][_0xa6a3('0xe')][_0xa6a3('0x48')]()]&&_0x521497[_0xa6a3('0x4a')][_0xa6a3('0x20')]({'id':_0x11e940[_0xa6a3('0x21')],'value':_0x488b12[_0x11e940[_0xa6a3('0x4e')][_0xa6a3('0xe')]['toLowerCase']()][_0xa6a3('0x28')]()});}});}return _0x521497;}function getConnection(_0x13ce36){return request({'method':_0xa6a3('0xa'),'form':{'method':_0xa6a3('0x4f'),'input_type':'JSON','response_type':_0xa6a3('0x23'),'rest_data':JSON[_0xa6a3('0x24')]({'user_auth':{'user_name':_0x13ce36[_0xa6a3('0x50')],'password':_0x13ce36[_0xa6a3('0x51')],'encryption':_0xa6a3('0x52')},'application':_0xa6a3('0x53')})}})[_0xa6a3('0x32')](function(_0x2be946){var _0x15ccef=_0x2be946;if(_0x15ccef['id']){def[_0xa6a3('0x54')]=_0x15ccef['id'];return BPromise['resolve'](_0x15ccef);}else{throw new Error(util[_0xa6a3('0x2f')](_0xa6a3('0x55'),_0x13ce36['id']));}});}function setRelationship(_0x435292,_0x5ea78a,_0x5c21b2,_0x498894){return request({'form':{'method':_0xa6a3('0x56'),'input_type':_0xa6a3('0x23'),'response_type':_0xa6a3('0x23'),'rest_data':JSON['stringify']({'session':_0x435292['id'],'module_name':_0xa6a3('0x25'),'module_id':_0x5c21b2['id'],'link_field_name':_0x498894,'related_ids':[_0x5ea78a['id']]})}});}exports[_0xa6a3('0x57')]=function(_0x3a8118,_0x48d787,_0x20d7d6,_0x2bb013,_0x31e416,_0x726166){var _0x24465e,_0x262fc1,_0xf729a4,_0x2b887f;_0x726166[_0xa6a3('0x58')]=intUtil[_0xa6a3('0x59')](_0x726166[_0xa6a3('0x58')]);_0x726166[_0xa6a3('0x5a')]=intUtil[_0xa6a3('0x59')](_0x726166[_0xa6a3('0x5a')]);def[_0xa6a3('0x5b')]=util['format'](_0xa6a3('0x5c'),_0x726166['remoteUri']);if(_0x31e416&&_0x31e416[_0xa6a3('0x5d')]){logger[_0xa6a3('0xc')]('[QUEUE]',_0xa6a3('0x5e'));_0x48d787['recordingURL']=util[_0xa6a3('0x2f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x726166['serverUrl'],_0x48d787[_0xa6a3('0x5f')],md5(_0x48d787[_0xa6a3('0x5f')]));}else{_0x48d787[_0xa6a3('0x60')]='';}return getConnection(_0x726166)[_0xa6a3('0x32')](function(_0x33663a){_0x2b887f=_0x33663a;return getUser(_0x726166,_0x2bb013[_0xa6a3('0xe')],_0x2b887f);})[_0xa6a3('0x32')](function(_0xb2c2f6){_0x24465e=_0xb2c2f6;logger[_0xa6a3('0xc')](_0xa6a3('0x61'),_0x24465e['id']);return getEndUser(_0x726166,_0x48d787[_0xa6a3('0x62')],_0x48d787[_0xa6a3('0x63')],_0x2b887f);})[_0xa6a3('0x32')](function(_0x5f293f){_0x262fc1=_0x5f293f;logger[_0xa6a3('0xc')](_0xa6a3('0x64'),_0x262fc1['id']);return getTicket(_0x726166,_0x24465e,_0x262fc1,_0x20d7d6,_0x48d787,_0x20d7d6[_0xa6a3('0x65')],_0x2b887f,_0xa6a3('0x66'));})[_0xa6a3('0x32')](function(_0x15d7eb){_0xf729a4=_0x15d7eb;logger[_0xa6a3('0xc')]('Ticket\x20created!');logger[_0xa6a3('0xc')](_0xa6a3('0x67'),_0xf729a4['id']);return setRelationship(_0x2b887f,_0x24465e,_0xf729a4,_0xa6a3('0x68'));})[_0xa6a3('0x32')](function(){return setRelationship(_0x2b887f,_0x262fc1,_0xf729a4,_0xa6a3('0x69'));})[_0xa6a3('0x32')](function(){return getServerInfo(_0x2b887f);})['then'](function(_0x4ac65b){var _0x453988=parseInt(_0x4ac65b['version'][_0xa6a3('0x6a')](0x0));var _0x15204e=util[_0xa6a3('0x2f')](_0xa6a3('0x6b'),_0x726166[_0xa6a3('0x58')],_0xf729a4['id']);if(_0x453988>0x6){_0x15204e=util['format'](_0xa6a3('0x6c'),_0x726166['remoteUri'],_0xf729a4['id']);}logger[_0xa6a3('0xc')](_0xa6a3('0x6d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xa6a3('0x2f')](_0xa6a3('0x6e'),_0x2bb013[_0xa6a3('0xe')]),_0xa6a3('0x6f'),{'uri':_0x15204e});})[_0xa6a3('0x70')](function(_0x414bf6){logger['error'](_0xa6a3('0x6d'),JSON[_0xa6a3('0x24')](_0x414bf6));});};exports[_0xa6a3('0x71')]=function(_0x19a3e6,_0x17dc11,_0x164b9f,_0x900c2,_0x1ebcb4,_0x5c453c,_0xfa2a8a){var _0x1af528,_0x24145c,_0x2f13fe,_0x340a2c;_0x5c453c['remoteUri']=intUtil[_0xa6a3('0x59')](_0x5c453c['remoteUri']);_0x5c453c[_0xa6a3('0x5a')]=intUtil[_0xa6a3('0x59')](_0x5c453c['serverUrl']);def[_0xa6a3('0x5b')]=util[_0xa6a3('0x2f')](_0xa6a3('0x5c'),_0x5c453c['remoteUri']);if(_0xfa2a8a&&_0xfa2a8a['recordingFormat']&&_0xfa2a8a['recordingFormat']!==_0xa6a3('0x72')){logger[_0xa6a3('0xc')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x17dc11[_0xa6a3('0x60')]=util['format'](_0xa6a3('0x73'),_0x5c453c[_0xa6a3('0x5a')],_0x17dc11[_0xa6a3('0x5f')],md5(_0x17dc11[_0xa6a3('0x5f')]));}return getConnection(_0x5c453c)[_0xa6a3('0x32')](function(_0x283375){_0x340a2c=_0x283375;return getUser(_0x5c453c,_0x900c2[_0xa6a3('0xe')],_0x340a2c);})[_0xa6a3('0x32')](function(_0xc81298){_0x1af528=_0xc81298;logger['info'](_0xa6a3('0x61'),_0x1af528['id']);return getEndUser(_0x5c453c,_0x17dc11[_0xa6a3('0x74')],_0x17dc11[_0xa6a3('0x75')],_0x340a2c);})[_0xa6a3('0x32')](function(_0x41cae4){_0x24145c=_0x41cae4;logger[_0xa6a3('0xc')](_0xa6a3('0x64'),_0x24145c['id']);return getTicket(_0x5c453c,_0x1af528,_0x24145c,_0x164b9f,_0x17dc11,_0x164b9f[_0xa6a3('0x65')],_0x340a2c,_0xa6a3('0x76'));})['then'](function(_0x194822){_0x2f13fe=_0x194822;logger[_0xa6a3('0xc')](_0xa6a3('0x77'));logger[_0xa6a3('0xc')](_0xa6a3('0x67'),_0x2f13fe['id']);return setRelationship(_0x340a2c,_0x1af528,_0x2f13fe,_0xa6a3('0x68'));})[_0xa6a3('0x32')](function(){return setRelationship(_0x340a2c,_0x24145c,_0x2f13fe,_0xa6a3('0x69'));})[_0xa6a3('0x32')](function(){return getServerInfo(_0x340a2c);})[_0xa6a3('0x32')](function(_0x18a7fb){var _0x4cbbe7=parseInt(_0x18a7fb['version'][_0xa6a3('0x6a')](0x0));var _0x30f18f=util[_0xa6a3('0x2f')](_0xa6a3('0x6b'),_0x5c453c[_0xa6a3('0x58')],_0x2f13fe['id']);if(_0x4cbbe7>0x6){_0x30f18f=util['format'](_0xa6a3('0x6c'),_0x5c453c[_0xa6a3('0x58')],_0x2f13fe['id']);}logger[_0xa6a3('0xc')](_0xa6a3('0x78'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xa6a3('0x2f')](_0xa6a3('0x6e'),_0x900c2['name']),_0xa6a3('0x6f'),{'uri':_0x30f18f});})['catch'](function(_0x441a94){logger[_0xa6a3('0x79')](_0xa6a3('0x78'),JSON[_0xa6a3('0x24')](_0x441a94));});};exports[_0xa6a3('0x7a')]=function(_0x23b012,_0x38940b,_0x1c853b,_0x3b3356,_0x151ce1,_0x21b60e){var _0x4ed8e5,_0x3a1833,_0x69ea53,_0x3dccc9;_0x21b60e['remoteUri']=intUtil[_0xa6a3('0x59')](_0x21b60e['remoteUri']);_0x21b60e['serverUrl']=intUtil[_0xa6a3('0x59')](_0x21b60e[_0xa6a3('0x5a')]);def[_0xa6a3('0x5b')]=util[_0xa6a3('0x2f')](_0xa6a3('0x5c'),_0x21b60e[_0xa6a3('0x58')]);if(_0x151ce1&&_0x151ce1[_0xa6a3('0x5d')]){logger[_0xa6a3('0xc')](_0xa6a3('0x7b'),_0xa6a3('0x5e'));_0x38940b[_0xa6a3('0x60')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x21b60e[_0xa6a3('0x5a')],_0x38940b[_0xa6a3('0x5f')],md5(_0x38940b[_0xa6a3('0x5f')]));}else{_0x38940b[_0xa6a3('0x60')]='';}return getConnection(_0x21b60e)['then'](function(_0x2c4a06){_0x3dccc9=_0x2c4a06;if(!_[_0xa6a3('0x2b')](_0x3b3356)){return getUser(_0x21b60e,_0x3b3356[_0xa6a3('0xe')],_0x3dccc9);}else{return getUser(_0x21b60e,null,_0x3dccc9);}})[_0xa6a3('0x32')](function(_0x40dafa){_0x4ed8e5=_0x40dafa;logger[_0xa6a3('0xc')](_0xa6a3('0x61'),_0x4ed8e5['id']);return getEndUser(_0x21b60e,_0x38940b[_0xa6a3('0x62')],_0x38940b[_0xa6a3('0x63')],_0x3dccc9);})[_0xa6a3('0x32')](function(_0x3930ab){_0x3a1833=_0x3930ab;logger['info'](_0xa6a3('0x64'),_0x3a1833['id']);return getTicket(_0x21b60e,_0x4ed8e5,_0x3a1833,_0x1c853b,_0x38940b,_0x1c853b[_0xa6a3('0x65')],_0x3dccc9,_0xa6a3('0x66'));})['then'](function(_0x316184){_0x69ea53=_0x316184;logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x69ea53['id']);return setRelationship(_0x3dccc9,_0x4ed8e5,_0x69ea53,_0xa6a3('0x68'));})[_0xa6a3('0x32')](function(){return setRelationship(_0x3dccc9,_0x3a1833,_0x69ea53,'contacts');})[_0xa6a3('0x32')](function(){return getServerInfo(_0x3dccc9);})[_0xa6a3('0x70')](function(_0x88c48e){logger[_0xa6a3('0x79')](_0xa6a3('0x7b'),JSON[_0xa6a3('0x24')](_0x88c48e));});}; \ No newline at end of file +var _0x6383=['charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','contacts','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','trigger:browser:url','abandoned','[ABANDONED]','The\x20Ticket\x20ID\x20is:','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','created_by','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','parent_name','length','forEach','variableName','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','get_entry_list','Employees','name','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','content','push','variable','idField','customVariable','Variable','custom_fields','POST','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','version'];(function(_0x3e8fa0,_0x7f9355){var _0x373b09=function(_0x3445f6){while(--_0x3445f6){_0x3e8fa0['push'](_0x3e8fa0['shift']());}};_0x373b09(++_0x7f9355);}(_0x6383,0x10c));var _0x3638=function(_0x80c29e,_0x4efeed){_0x80c29e=_0x80c29e-0x0;var _0x22a19a=_0x6383[_0x80c29e];return _0x22a19a;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x3638('0x0'));var md5=require(_0x3638('0x1'));var util=require('util');var Redis=require(_0x3638('0x2'));var intUtil=require(_0x3638('0x3'));var config=require(_0x3638('0x4'));var logger=require(_0x3638('0x5'))(_0x3638('0x6'));config[_0x3638('0x7')]=_[_0x3638('0x8')](config[_0x3638('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x3638('0x9'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x29cd4c,_0x332681,_0x30cafa){io['to'](_0x29cd4c)[_0x3638('0xa')](_0x332681,_0x30cafa);}function getTicket(_0x11bd0a,_0x1a26c2,_0x7b146c,_0x33f19e,_0xcb4501,_0x8a933c,_0x1a96f5,_0x2d469f){logger[_0x3638('0xb')](_0x3638('0xc'));var _0x375b4e=new Date();var _0x11948f=[{'name':'name','value':intUtil[_0x3638('0xd')](_0x33f19e[_0x3638('0xe')],_0xcb4501,'\x20')},{'name':_0x3638('0xf'),'value':_0x1a26c2['id']},{'name':_0x3638('0x10'),'value':_0x1a26c2['id']},{'name':'description','value':intUtil[_0x3638('0xd')](_0x33f19e[_0x3638('0x11')],_0xcb4501,'\x0a')},{'name':_0x3638('0x12'),'value':_0x375b4e[_0x3638('0x13')]()[_0x3638('0x14')](0x0,0x13)[_0x3638('0x15')]('T','\x20')},{'name':_0x3638('0x16'),'value':'0'},{'name':_0x3638('0x17'),'value':'15'},{'name':_0x3638('0x18'),'value':_0x7b146c['id']},{'name':_0x3638('0x19'),'value':'Contacts'},{'name':_0x3638('0x1a'),'value':_0x7b146c['name']},{'name':'direction','value':_0x2d469f}];if(_0x8a933c[_0x3638('0x1b')]){_[_0x3638('0x1c')](_0x8a933c,function(_0x4d5d83){if(_0xcb4501[_0x4d5d83[_0x3638('0x1d')]]){_0x11948f['push']({'name':_0x4d5d83['idField'],'value':_0xcb4501[_0x4d5d83['variableName']]});}});}return request({'form':{'method':'set_entry','input_type':_0x3638('0x1e'),'response_type':'JSON','rest_data':JSON[_0x3638('0x1f')]({'session':_0x1a96f5['id'],'module_name':_0x3638('0x20'),'name_value_list':_0x11948f})}});}function getAuth(_0x39c109){return util[_0x3638('0x21')](_0x3638('0x22'),new Buffer(_0x39c109[_0x3638('0x23')]+':X')[_0x3638('0x24')](_0x3638('0x25')));}function getServerInfo(_0x12f767){return request({'form':{'method':_0x3638('0x26'),'input_type':_0x3638('0x1e'),'response_type':_0x3638('0x1e'),'rest_data':JSON[_0x3638('0x1f')]({'session':_0x12f767['id']})}});}function getUser(_0x4c0044,_0x38647c,_0x1ce520){if(!_[_0x3638('0x27')](_0x38647c)){logger[_0x3638('0xb')]('Getting\x20agent\x20with\x20name',_0x38647c);return request({'form':{'method':_0x3638('0x28'),'input_type':_0x3638('0x1e'),'response_type':_0x3638('0x1e'),'rest_data':JSON[_0x3638('0x1f')]({'session':_0x1ce520['id'],'module_name':_0x3638('0x29'),'query':util[_0x3638('0x21')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x38647c),'order_by':'','offset':'0','select_fields':['id',_0x3638('0x2a'),_0x3638('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3638('0x2c')](function(_0x15356c){if(_0x15356c[_0x3638('0x2d')][_0x3638('0x1b')]){var _0x1416f4=_[_0x3638('0x2e')](_0x15356c[_0x3638('0x2d')],function(_0x27a2d7){return _0x27a2d7[_0x3638('0x2f')][_0x3638('0x2b')][_0x3638('0x30')]===_0x38647c;});if(_0x1416f4){logger[_0x3638('0xb')](_0x3638('0x31'));return BPromise[_0x3638('0x32')]({'id':_0x1416f4[_0x3638('0x2f')]['id'][_0x3638('0x30')],'name':_0x1416f4[_0x3638('0x2f')]['name'][_0x3638('0x30')]});}}logger[_0x3638('0xb')](_0x3638('0x33'));return BPromise[_0x3638('0x32')]({'id':_0x1ce520[_0x3638('0x2f')][_0x3638('0x34')][_0x3638('0x30')],'name':_0x1ce520[_0x3638('0x2f')]['user_name'][_0x3638('0x30')]});});}else{logger[_0x3638('0xb')](_0x3638('0x35'));return BPromise[_0x3638('0x32')]({'id':_0x1ce520[_0x3638('0x2f')][_0x3638('0x34')][_0x3638('0x30')],'name':_0x1ce520[_0x3638('0x2f')][_0x3638('0x2b')]['value']});}}function getEndUser(_0x2c0817,_0x350ddc,_0x29ecd2,_0xb33d93){logger[_0x3638('0xb')](_0x3638('0x36'),_0x29ecd2);return request({'form':{'method':_0x3638('0x28'),'input_type':_0x3638('0x1e'),'response_type':_0x3638('0x1e'),'rest_data':JSON[_0x3638('0x1f')]({'session':_0xb33d93['id'],'module_name':'Contacts','query':util[_0x3638('0x21')](_0x3638('0x37'),_0x29ecd2),'order_by':'','offset':'0','select_fields':['id',_0x3638('0x2a'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3638('0x2c')](function(_0x8de7a){if(_0x8de7a['entry_list'][_0x3638('0x1b')]){var _0xff3a5f=_[_0x3638('0x2e')](_0x8de7a[_0x3638('0x2d')],function(_0x3c7924){return _0x3c7924[_0x3638('0x2f')][_0x3638('0x38')][_0x3638('0x30')]===_0x29ecd2;});if(_0xff3a5f){logger[_0x3638('0xb')](_0x3638('0x39'));return BPromise[_0x3638('0x32')]({'id':_0xff3a5f[_0x3638('0x2f')]['id'][_0x3638('0x30')],'name':_0xff3a5f[_0x3638('0x2f')][_0x3638('0x2a')]['value'],'phone':_0xff3a5f[_0x3638('0x2f')][_0x3638('0x38')]['value']});}}else{logger['info'](_0x3638('0x3a'));return request({'form':{'method':'set_entry','input_type':_0x3638('0x1e'),'response_type':_0x3638('0x1e'),'rest_data':JSON['stringify']({'session':_0xb33d93['id'],'module_name':'Contacts','name_value_list':[{'name':_0x3638('0x3b'),'value':_0x350ddc!==_0x3638('0x3c')?_0x350ddc:util[_0x3638('0x21')]('Caller\x20-\x20%s',_0x29ecd2)},{'name':'phone_home','value':_0x29ecd2}]})}})[_0x3638('0x2c')](function(_0x3411bf){logger[_0x3638('0xb')](_0x3638('0x3d'));return BPromise[_0x3638('0x32')]({'id':_0x3411bf['id'],'name':_0x3411bf['entry_list'][_0x3638('0x3b')][_0x3638('0x30')],'phone':_0x3411bf[_0x3638('0x2d')][_0x3638('0x38')]['value']});});}});}function request(_0x5902a8){logger[_0x3638('0x3e')](_0x3638('0x3f'),JSON['stringify'](_0x5902a8));return rp(_[_0x3638('0x40')](def,_0x5902a8));}function getTags(_0x3c99d2,_0x442338){var _0x33fe28=[];if(_0x3c99d2&&_0x3c99d2[_0x3638('0x1b')]>0x0){_0x33fe28=_[_0x3638('0x41')](_0x3c99d2,_0x442338);}return _0x33fe28;}function getCustomFields(_0x320798,_0x9a2675){var _0x20fc7f=[];var _0x448972={'custom_fields':[]};if(_0x320798[_0x3638('0x1b')]>0x0){_[_0x3638('0x1c')](_0x320798,function(_0x546661){if(_0x546661[_0x3638('0x42')]===_0x3638('0x43')&&_0x546661[_0x3638('0x44')]&&!_0x546661[_0x3638('0x45')]){_0x448972[_0x546661[_0x3638('0x44')]['toLowerCase']()]=_0x546661[_0x3638('0x46')][_0x3638('0x24')]();}else if(_0x546661[_0x3638('0x42')]==='string'&&_0x546661['idField']&&_0x546661[_0x3638('0x45')]){_0x448972['custom_fields'][_0x3638('0x47')]({'id':_0x546661['idField'],'value':_0x546661['content'][_0x3638('0x24')]()});}else if(_0x546661[_0x3638('0x42')]===_0x3638('0x48')&&_0x546661[_0x3638('0x1d')]&&_0x546661[_0x3638('0x49')]&&_0x546661[_0x3638('0x45')]){_0x9a2675[_0x546661[_0x3638('0x1d')]]&&_0x448972['custom_fields'][_0x3638('0x47')]({'id':_0x546661['idField'],'value':_0x9a2675[_0x546661[_0x3638('0x1d')]][_0x3638('0x24')]()});}else if(_0x546661[_0x3638('0x42')]===_0x3638('0x4a')&&_0x546661[_0x3638('0x4b')]&&_0x546661[_0x3638('0x4b')][_0x3638('0x2a')]&&_0x546661[_0x3638('0x49')]&&_0x546661['customField']){_0x9a2675[_0x546661[_0x3638('0x4b')][_0x3638('0x2a')]['toLowerCase']()]&&_0x448972[_0x3638('0x4c')][_0x3638('0x47')]({'id':_0x546661[_0x3638('0x49')],'value':_0x9a2675[_0x546661[_0x3638('0x4b')][_0x3638('0x2a')]['toLowerCase']()]['toString']()});}});}return _0x448972;}function getConnection(_0x667eb9){return request({'method':_0x3638('0x4d'),'form':{'method':'login','input_type':_0x3638('0x1e'),'response_type':_0x3638('0x1e'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x667eb9[_0x3638('0x4e')],'password':_0x667eb9[_0x3638('0x4f')],'encryption':_0x3638('0x50')},'application':_0x3638('0x51')})}})[_0x3638('0x2c')](function(_0x662c07){var _0x44f918=_0x662c07;if(_0x44f918['id']){def[_0x3638('0x52')]=_0x44f918['id'];return BPromise[_0x3638('0x32')](_0x44f918);}else{throw new Error(util[_0x3638('0x21')](_0x3638('0x53'),_0x667eb9['id']));}});}function setRelationship(_0x2b64f3,_0x4d6f21,_0x93ff83,_0x1a982e){return request({'form':{'method':'set_relationship','input_type':_0x3638('0x1e'),'response_type':'JSON','rest_data':JSON[_0x3638('0x1f')]({'session':_0x2b64f3['id'],'module_name':_0x3638('0x20'),'module_id':_0x93ff83['id'],'link_field_name':_0x1a982e,'related_ids':[_0x4d6f21['id']]})}});}exports[_0x3638('0x54')]=function(_0x2f13a1,_0x39df4d,_0x5aa4c1,_0x293e48,_0x1e19d6,_0x69d706){var _0x1da11e,_0x5af424,_0x57953d,_0x293f98;_0x69d706[_0x3638('0x55')]=intUtil[_0x3638('0x56')](_0x69d706['remoteUri']);_0x69d706[_0x3638('0x57')]=intUtil[_0x3638('0x56')](_0x69d706['serverUrl']);def[_0x3638('0x58')]=util['format']('%s/service/v4_1/rest.php',_0x69d706['remoteUri']);if(_0x1e19d6&&_0x1e19d6[_0x3638('0x59')]){logger[_0x3638('0xb')](_0x3638('0x5a'),_0x3638('0x5b'));_0x39df4d[_0x3638('0x5c')]=util[_0x3638('0x21')](_0x3638('0x5d'),_0x69d706[_0x3638('0x57')],_0x39df4d['uniqueid'],md5(_0x39df4d[_0x3638('0x5e')]));}else{_0x39df4d[_0x3638('0x5c')]='';}return getConnection(_0x69d706)['then'](function(_0x94ad29){_0x293f98=_0x94ad29;return getUser(_0x69d706,_0x293e48[_0x3638('0x2a')],_0x293f98);})['then'](function(_0x598f0e){_0x1da11e=_0x598f0e;logger[_0x3638('0xb')](_0x3638('0x5f'),_0x1da11e['id']);return getEndUser(_0x69d706,_0x39df4d[_0x3638('0x60')],_0x39df4d[_0x3638('0x61')],_0x293f98);})[_0x3638('0x2c')](function(_0xb33867){_0x5af424=_0xb33867;logger[_0x3638('0xb')](_0x3638('0x62'),_0x5af424['id']);return getTicket(_0x69d706,_0x1da11e,_0x5af424,_0x5aa4c1,_0x39df4d,_0x5aa4c1[_0x3638('0x63')],_0x293f98,_0x3638('0x64'));})['then'](function(_0x15a6a4){_0x57953d=_0x15a6a4;logger['info'](_0x3638('0x65'));logger[_0x3638('0xb')]('The\x20Ticket\x20ID\x20is:',_0x57953d['id']);return setRelationship(_0x293f98,_0x1da11e,_0x57953d,_0x3638('0x66'));})[_0x3638('0x2c')](function(){return setRelationship(_0x293f98,_0x5af424,_0x57953d,'contacts');})[_0x3638('0x2c')](function(){return getServerInfo(_0x293f98);})[_0x3638('0x2c')](function(_0x23de78){var _0x24b05f=parseInt(_0x23de78[_0x3638('0x67')][_0x3638('0x68')](0x0));var _0x1fe029=util[_0x3638('0x21')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x69d706[_0x3638('0x55')],_0x57953d['id']);if(_0x24b05f>0x6){_0x1fe029=util[_0x3638('0x21')](_0x3638('0x69'),_0x69d706[_0x3638('0x55')],_0x57953d['id']);}logger[_0x3638('0xb')](_0x3638('0x5a'),_0x3638('0x6a'));emit(util[_0x3638('0x21')](_0x3638('0x6b'),_0x293e48[_0x3638('0x2a')]),'trigger:browser:url',{'uri':_0x1fe029});})[_0x3638('0x6c')](function(_0x1f2857){logger[_0x3638('0x6d')](_0x3638('0x5a'),JSON[_0x3638('0x1f')](_0x1f2857));});};exports[_0x3638('0x6e')]=function(_0x48c585,_0x5f17b7,_0x2be1b0,_0x1a8e00,_0x5c2b44,_0x24806d,_0x1b3d27){var _0x54081c,_0x3e63ca,_0x4f688d,_0x2093ea;_0x24806d[_0x3638('0x55')]=intUtil[_0x3638('0x56')](_0x24806d[_0x3638('0x55')]);_0x24806d['serverUrl']=intUtil[_0x3638('0x56')](_0x24806d['serverUrl']);def['uri']=util[_0x3638('0x21')](_0x3638('0x6f'),_0x24806d[_0x3638('0x55')]);if(_0x1b3d27&&_0x1b3d27[_0x3638('0x70')]&&_0x1b3d27[_0x3638('0x70')]!==_0x3638('0x71')){logger['info'](_0x3638('0x72'),_0x3638('0x5b'));_0x5f17b7['recordingURL']=util[_0x3638('0x21')](_0x3638('0x5d'),_0x24806d[_0x3638('0x57')],_0x5f17b7[_0x3638('0x5e')],md5(_0x5f17b7['uniqueid']));}return getConnection(_0x24806d)['then'](function(_0x5c4ff1){_0x2093ea=_0x5c4ff1;return getUser(_0x24806d,_0x1a8e00[_0x3638('0x2a')],_0x2093ea);})[_0x3638('0x2c')](function(_0x89838e){_0x54081c=_0x89838e;logger[_0x3638('0xb')](_0x3638('0x5f'),_0x54081c['id']);return getEndUser(_0x24806d,_0x5f17b7[_0x3638('0x73')],_0x5f17b7[_0x3638('0x74')],_0x2093ea);})[_0x3638('0x2c')](function(_0x52346c){_0x3e63ca=_0x52346c;logger['info'](_0x3638('0x62'),_0x3e63ca['id']);return getTicket(_0x24806d,_0x54081c,_0x3e63ca,_0x2be1b0,_0x5f17b7,_0x2be1b0['Fields'],_0x2093ea,_0x3638('0x75'));})[_0x3638('0x2c')](function(_0x29f2bd){_0x4f688d=_0x29f2bd;logger[_0x3638('0xb')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x4f688d['id']);return setRelationship(_0x2093ea,_0x54081c,_0x4f688d,_0x3638('0x66'));})[_0x3638('0x2c')](function(){return setRelationship(_0x2093ea,_0x3e63ca,_0x4f688d,_0x3638('0x76'));})[_0x3638('0x2c')](function(){return getServerInfo(_0x2093ea);})[_0x3638('0x2c')](function(_0x4bcd1f){var _0x53f601=parseInt(_0x4bcd1f[_0x3638('0x67')][_0x3638('0x68')](0x0));var _0x330b32=util['format'](_0x3638('0x77'),_0x24806d[_0x3638('0x55')],_0x4f688d['id']);if(_0x53f601>0x6){_0x330b32=util['format'](_0x3638('0x69'),_0x24806d[_0x3638('0x55')],_0x4f688d['id']);}logger['info'](_0x3638('0x72'),_0x3638('0x6a'));emit(util[_0x3638('0x21')](_0x3638('0x6b'),_0x1a8e00[_0x3638('0x2a')]),_0x3638('0x78'),{'uri':_0x330b32});})[_0x3638('0x6c')](function(_0x40d346){logger[_0x3638('0x6d')]('[OUTBOUND]',JSON[_0x3638('0x1f')](_0x40d346));});};exports[_0x3638('0x79')]=function(_0x36025a,_0x27749b,_0x2b8130,_0x56c62c,_0x30e626,_0x61d150){var _0x1f88c7,_0xbc23ec,_0x1173cb,_0x2db045;_0x61d150[_0x3638('0x55')]=intUtil[_0x3638('0x56')](_0x61d150[_0x3638('0x55')]);_0x61d150[_0x3638('0x57')]=intUtil['stripTrailingSlash'](_0x61d150[_0x3638('0x57')]);def[_0x3638('0x58')]=util[_0x3638('0x21')](_0x3638('0x6f'),_0x61d150[_0x3638('0x55')]);if(_0x30e626&&_0x30e626[_0x3638('0x59')]){logger[_0x3638('0xb')](_0x3638('0x7a'),_0x3638('0x5b'));_0x27749b['recordingURL']=util['format'](_0x3638('0x5d'),_0x61d150[_0x3638('0x57')],_0x27749b[_0x3638('0x5e')],md5(_0x27749b[_0x3638('0x5e')]));}else{_0x27749b[_0x3638('0x5c')]='';}return getConnection(_0x61d150)[_0x3638('0x2c')](function(_0xa51c9a){_0x2db045=_0xa51c9a;if(!_[_0x3638('0x27')](_0x56c62c)){return getUser(_0x61d150,_0x56c62c[_0x3638('0x2a')],_0x2db045);}else{return getUser(_0x61d150,null,_0x2db045);}})['then'](function(_0x3405b6){_0x1f88c7=_0x3405b6;logger[_0x3638('0xb')]('The\x20User\x20ID\x20is:',_0x1f88c7['id']);return getEndUser(_0x61d150,_0x27749b['calleridname'],_0x27749b[_0x3638('0x61')],_0x2db045);})[_0x3638('0x2c')](function(_0x343de0){_0xbc23ec=_0x343de0;logger[_0x3638('0xb')](_0x3638('0x62'),_0xbc23ec['id']);return getTicket(_0x61d150,_0x1f88c7,_0xbc23ec,_0x2b8130,_0x27749b,_0x2b8130[_0x3638('0x63')],_0x2db045,_0x3638('0x64'));})[_0x3638('0x2c')](function(_0x35e0ab){_0x1173cb=_0x35e0ab;logger[_0x3638('0xb')](_0x3638('0x65'));logger[_0x3638('0xb')](_0x3638('0x7b'),_0x1173cb['id']);return setRelationship(_0x2db045,_0x1f88c7,_0x1173cb,_0x3638('0x66'));})[_0x3638('0x2c')](function(){return setRelationship(_0x2db045,_0xbc23ec,_0x1173cb,'contacts');})['then'](function(){return getServerInfo(_0x2db045);})['catch'](function(_0x5cc754){logger['error']('[ABANDONED]',JSON[_0x3638('0x1f')](_0x5cc754));});}; \ 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 e3bf796..127168d 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 _0x144e=['customVariable','Variable','name','toLowerCase','keyValue','keyType','string','format','key','keyContent','variable','%s:\x20%s','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','getString','sortBy','length','type','push','variableName','toString'];(function(_0x3bf841,_0x4b7588){var _0x36a1cb=function(_0x2fc8ba){while(--_0x2fc8ba){_0x3bf841['push'](_0x3bf841['shift']());}};_0x36a1cb(++_0x4b7588);}(_0x144e,0x1e7));var _0xe144=function(_0x269a9e,_0x1a7f01){_0x269a9e=_0x269a9e-0x0;var _0x3380c0=_0x144e[_0x269a9e];return _0x3380c0;};'use strict';var _=require('lodash');var util=require('util');exports[_0xe144('0x0')]=function(_0x3de2cb,_0x456306,_0x27ab4b){var _0x1bbed1=[];if(_0x3de2cb['length']>0x0){var _0x15fb5a=_[_0xe144('0x1')](_0x3de2cb,['id']);for(var _0x1a3daa=0x0;_0x1a3daa<_0x15fb5a[_0xe144('0x2')];_0x1a3daa++){var _0x10b035=_0x15fb5a[_0x1a3daa];if(_0x10b035[_0xe144('0x3')]==='string'){_0x1bbed1[_0xe144('0x4')](_0x10b035['content']);}else if(_0x10b035['type']==='variable'&&_0x10b035[_0xe144('0x5')]){_0x456306[_0x10b035[_0xe144('0x5')]]&&_0x1bbed1['push'](_0x456306[_0x10b035[_0xe144('0x5')]][_0xe144('0x6')]());}else if(_0x10b035[_0xe144('0x3')]===_0xe144('0x7')&&_0x10b035[_0xe144('0x8')]&&_0x10b035[_0xe144('0x8')][_0xe144('0x9')]){_0x456306[_0x10b035['Variable'][_0xe144('0x9')][_0xe144('0xa')]()]&&_0x1bbed1['push'](_0x456306[_0x10b035['Variable']['name'][_0xe144('0xa')]()][_0xe144('0x6')]());}else if(_0x10b035[_0xe144('0x3')]===_0xe144('0xb')){if(_0x10b035[_0xe144('0xc')]===_0xe144('0xd')&&_0x10b035['key']){_0x1bbed1[_0xe144('0x4')](util[_0xe144('0xe')]('%s:\x20%s',_0x10b035[_0xe144('0xf')],_0x10b035[_0xe144('0x10')]));}else if(_0x10b035['keyType']===_0xe144('0x11')&&_0x10b035[_0xe144('0x5')]&&_0x10b035[_0xe144('0xf')]){_0x456306[_0x10b035[_0xe144('0x5')]]&&_0x1bbed1[_0xe144('0x4')](util[_0xe144('0xe')](_0xe144('0x12'),_0x10b035[_0xe144('0xf')],_0x456306[_0x10b035[_0xe144('0x5')]]));}else if(_0x10b035['keyType']===_0xe144('0x7')&&_0x10b035['Variable']&&_0x10b035[_0xe144('0x8')][_0xe144('0x9')]&&_0x10b035['key']){_0x456306[_0x10b035[_0xe144('0x8')]['name'][_0xe144('0xa')]()]&&_0x1bbed1[_0xe144('0x4')](util[_0xe144('0xe')]('%s:\x20%s',_0x10b035['key'],_0x456306[_0x10b035[_0xe144('0x8')]['name'][_0xe144('0xa')]()]));}}}}return _0x1bbed1['join'](_0x27ab4b);};exports[_0xe144('0x13')]=function(_0x52275c){var _0x32fb2e=_0x52275c[_0xe144('0x14')](-0x1);if(_0x32fb2e==='/'){_0x52275c=_0x52275c[_0xe144('0x15')](0x0,_0x52275c[_0xe144('0x16')](_0x32fb2e));}return _0x52275c;};exports[_0xe144('0x17')]=function(_0x16371c){if(!_[_0xe144('0x18')](_0x16371c)&&_0x16371c!==''){var _0x15a68a=/^(([^<>()\[\]\\.,;:\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 _0x15a68a[_0xe144('0x19')](String(_0x16371c)[_0xe144('0xa')]());}else{return![];}}; \ No newline at end of file +var _0x230a=['key','keyContent','%s:\x20%s','join','stripTrailingSlash','lastIndexOf','isNil','test','lodash','util','getString','length','sortBy','string','push','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','format'];(function(_0x888638,_0xa727c6){var _0xb50a98=function(_0x558f56){while(--_0x558f56){_0x888638['push'](_0x888638['shift']());}};_0xb50a98(++_0xa727c6);}(_0x230a,0x14c));var _0xa230=function(_0x3f0071,_0x3f0dec){_0x3f0071=_0x3f0071-0x0;var _0x1870a6=_0x230a[_0x3f0071];return _0x1870a6;};'use strict';var _=require(_0xa230('0x0'));var util=require(_0xa230('0x1'));exports[_0xa230('0x2')]=function(_0x1b035a,_0x392ffb,_0x5c9cc4){var _0x259f29=[];if(_0x1b035a[_0xa230('0x3')]>0x0){var _0x17b798=_[_0xa230('0x4')](_0x1b035a,['id']);for(var _0x34c58e=0x0;_0x34c58e<_0x17b798[_0xa230('0x3')];_0x34c58e++){var _0x51964f=_0x17b798[_0x34c58e];if(_0x51964f['type']===_0xa230('0x5')){_0x259f29[_0xa230('0x6')](_0x51964f[_0xa230('0x7')]);}else if(_0x51964f[_0xa230('0x8')]===_0xa230('0x9')&&_0x51964f[_0xa230('0xa')]){_0x392ffb[_0x51964f[_0xa230('0xa')]]&&_0x259f29['push'](_0x392ffb[_0x51964f[_0xa230('0xa')]][_0xa230('0xb')]());}else if(_0x51964f[_0xa230('0x8')]===_0xa230('0xc')&&_0x51964f[_0xa230('0xd')]&&_0x51964f[_0xa230('0xd')][_0xa230('0xe')]){_0x392ffb[_0x51964f[_0xa230('0xd')][_0xa230('0xe')][_0xa230('0xf')]()]&&_0x259f29[_0xa230('0x6')](_0x392ffb[_0x51964f[_0xa230('0xd')][_0xa230('0xe')][_0xa230('0xf')]()]['toString']());}else if(_0x51964f[_0xa230('0x8')]===_0xa230('0x10')){if(_0x51964f[_0xa230('0x11')]==='string'&&_0x51964f['key']){_0x259f29['push'](util[_0xa230('0x12')]('%s:\x20%s',_0x51964f[_0xa230('0x13')],_0x51964f[_0xa230('0x14')]));}else if(_0x51964f[_0xa230('0x11')]===_0xa230('0x9')&&_0x51964f[_0xa230('0xa')]&&_0x51964f['key']){_0x392ffb[_0x51964f[_0xa230('0xa')]]&&_0x259f29[_0xa230('0x6')](util[_0xa230('0x12')](_0xa230('0x15'),_0x51964f[_0xa230('0x13')],_0x392ffb[_0x51964f[_0xa230('0xa')]]));}else if(_0x51964f[_0xa230('0x11')]==='customVariable'&&_0x51964f[_0xa230('0xd')]&&_0x51964f[_0xa230('0xd')][_0xa230('0xe')]&&_0x51964f[_0xa230('0x13')]){_0x392ffb[_0x51964f[_0xa230('0xd')][_0xa230('0xe')][_0xa230('0xf')]()]&&_0x259f29[_0xa230('0x6')](util['format'](_0xa230('0x15'),_0x51964f['key'],_0x392ffb[_0x51964f['Variable'][_0xa230('0xe')][_0xa230('0xf')]()]));}}}}return _0x259f29[_0xa230('0x16')](_0x5c9cc4);};exports[_0xa230('0x17')]=function(_0x202372){var _0x5d9451=_0x202372['slice'](-0x1);if(_0x5d9451==='/'){_0x202372=_0x202372['substring'](0x0,_0x202372[_0xa230('0x18')](_0x5d9451));}return _0x202372;};exports['validateEmail']=function(_0x2e5e3f){if(!_[_0xa230('0x19')](_0x2e5e3f)&&_0x2e5e3f!==''){var _0x216297=/^(([^<>()\[\]\\.,;:\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 _0x216297[_0xa230('0x1a')](String(_0x2e5e3f)['toLowerCase']());}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 2be437e..9124fb9 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 _0xb910=['emit','length','string','content','toString','type','variable','idField','variableName','customVariable','Variable','name','toLowerCase','merge','Normal','Open','getString','Subjects','Descriptions','create','admin','sessionName','HelpDesk','stringify','then','success','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','createTicket','GET','%s/webservice.php','remoteUri','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','info','Agent\x20found!','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','username','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','catch','getUser','Searching\x20end\x20user\x20with\x20phone','Enduser\x20found!','firstname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Contacts','Enduser\x20created.','lastname','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','stripTrailingSlash','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Fields','trigger:browser:url','abandoned','[ABANDONED]','calleridnum','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb910,0x12b));var _0x0b91=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xb910[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0x0b91('0x0'));var rp=require(_0x0b91('0x1'));var BPromise=require(_0x0b91('0x2'));var md5=require(_0x0b91('0x3'));var util=require(_0x0b91('0x4'));var Redis=require(_0x0b91('0x5'));var intUtil=require(_0x0b91('0x6'));var config=require(_0x0b91('0x7'));var logger=require(_0x0b91('0x8'))(_0x0b91('0x9'));config[_0x0b91('0xa')]=_[_0x0b91('0xb')](config[_0x0b91('0xa')],{'host':_0x0b91('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0b91('0xa')]));function emit(_0xc65d86,_0x3e8800,_0x41cc32){io['to'](_0xc65d86)[_0x0b91('0xd')](_0x3e8800,_0x41cc32);}function getCustomFields(_0x12ba4c,_0x4118b8){var _0x13b9b7={};if(_0x12ba4c[_0x0b91('0xe')]>0x0){_['forEach'](_0x12ba4c,function(_0x2a38a3){if(_0x2a38a3['type']===_0x0b91('0xf')&&_0x2a38a3['idField']){_0x13b9b7[_0x2a38a3['idField']]=_0x2a38a3[_0x0b91('0x10')][_0x0b91('0x11')]();}else if(_0x2a38a3[_0x0b91('0x12')]===_0x0b91('0x13')&&_0x2a38a3['variableName']&&_0x2a38a3[_0x0b91('0x14')]&&_0x4118b8[_0x2a38a3[_0x0b91('0x15')]]){_0x13b9b7[_0x2a38a3[_0x0b91('0x14')]]=_0x4118b8[_0x2a38a3[_0x0b91('0x15')]]['toString']();}else if(_0x2a38a3[_0x0b91('0x12')]===_0x0b91('0x16')&&_0x2a38a3[_0x0b91('0x17')]&&_0x2a38a3[_0x0b91('0x17')][_0x0b91('0x18')]&&_0x2a38a3[_0x0b91('0x14')]&&_0x4118b8[_0x2a38a3['Variable'][_0x0b91('0x18')][_0x0b91('0x19')]()]){_0x13b9b7[_0x2a38a3[_0x0b91('0x14')]]=_0x4118b8[_0x2a38a3[_0x0b91('0x17')][_0x0b91('0x18')][_0x0b91('0x19')]()][_0x0b91('0x11')]();}});}return _0x13b9b7;}function createTicket(_0x12239b,_0x26dea7,_0x201797,_0x1ed672,_0xd44356,_0x4d5143,_0x2df818){logger['info']('Creating\x20new\x20ticket...');var _0x3860af=_[_0x0b91('0x1a')]({'parent_id':'','assigned_user_id':_0x26dea7['id'],'ticketpriorities':_0x0b91('0x1b'),'ticketstatus':_0x0b91('0x1c'),'ticket_title':intUtil[_0x0b91('0x1d')](_0x1ed672[_0x0b91('0x1e')],_0xd44356,'\x20'),'description':intUtil[_0x0b91('0x1d')](_0x1ed672[_0x0b91('0x1f')],_0xd44356,'\x0a'),'contact_id':_0x201797['id']},getCustomFields(_0x4d5143,_0xd44356));var _0xf01735={'method':'POST','uri':util['format']('%s/webservice.php',_0x12239b['remoteUri']),'form':{'operation':_0x0b91('0x20'),'username':_0x0b91('0x21'),'sessionName':_0x2df818[_0x0b91('0x22')],'elementType':_0x0b91('0x23'),'element':JSON[_0x0b91('0x24')](_0x3860af)},'json':!![]};return request(_0xf01735)[_0x0b91('0x25')](function(_0x119748){if(_0x119748[_0x0b91('0x26')]){return BPromise[_0x0b91('0x27')]({'id':_0x119748[_0x0b91('0x28')]['id']});}else{throw new Error(util[_0x0b91('0x29')](_0x0b91('0x2a'),JSON['stringify'](_0x119748[_0x0b91('0x2b')])));}})['catch'](function(_0x4a6809){var _0x1ea590=_0x4a6809['statusCode']||0x1f4;logger[_0x0b91('0x2b')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0b91('0x2c'),_0x1ea590,JSON[_0x0b91('0x24')](_0x4a6809));});}function getUser(_0x55d174,_0x471151,_0x253c78){if(intUtil['validateEmail'](_0x471151)){logger['info']('Getting\x20agent\x20with\x20email',_0x471151);return request({'method':_0x0b91('0x2d'),'uri':util[_0x0b91('0x29')](_0x0b91('0x2e'),_0x55d174[_0x0b91('0x2f')]),'qs':{'operation':_0x0b91('0x30'),'username':_0x0b91('0x21'),'sessionName':_0x253c78[_0x0b91('0x22')],'query':util[_0x0b91('0x29')](_0x0b91('0x31'),_0x471151)},'json':!![]})[_0x0b91('0x25')](function(_0xb730c2){if(_0xb730c2['success']&&_0xb730c2['result'][_0x0b91('0xe')]){logger[_0x0b91('0x32')](_0x0b91('0x33'));return BPromise[_0x0b91('0x27')]({'id':_0xb730c2[_0x0b91('0x28')][0x0]['id'],'email':_0xb730c2[_0x0b91('0x28')][0x0]['email1'],'name':_0xb730c2[_0x0b91('0x28')][0x0][_0x0b91('0x34')]+'\x20'+_0xb730c2['result']['last_name']});}else{logger[_0x0b91('0x32')](_0x0b91('0x35'));return BPromise[_0x0b91('0x27')]({'id':_0x253c78[_0x0b91('0x36')],'email':_0x55d174[_0x0b91('0x37')],'name':'admin'});}})['catch'](function(_0x183798){var _0xc6d419=_0x183798[_0x0b91('0x38')]||0x1f4;logger[_0x0b91('0x2b')](_0x0b91('0x39'),'getUser',_0xc6d419,JSON[_0x0b91('0x24')](_0x183798));});}else{logger['info'](_0x0b91('0x35'));return BPromise['resolve']({'id':_0x253c78['userId'],'email':_0x55d174['username'],'name':_0x0b91('0x21')})[_0x0b91('0x3a')](function(_0x51657e){var _0x55841c=_0x51657e[_0x0b91('0x38')]||0x1f4;logger[_0x0b91('0x2b')](_0x0b91('0x39'),_0x0b91('0x3b'),_0x55841c,JSON['stringify'](_0x51657e));});}}function getEndUser(_0x421bfe,_0x498b7a,_0x3376b4,_0x18d183){logger[_0x0b91('0x32')](_0x0b91('0x3c'),_0x3376b4);return request({'method':_0x0b91('0x2d'),'uri':util['format'](_0x0b91('0x2e'),_0x421bfe[_0x0b91('0x2f')]),'qs':{'operation':'query','username':'admin','sessionName':_0x18d183[_0x0b91('0x22')],'query':util[_0x0b91('0x29')]('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;',_0x3376b4,_0x3376b4,_0x3376b4,_0x3376b4,_0x3376b4)},'json':!![]})[_0x0b91('0x25')](function(_0x448dda){if(_0x448dda[_0x0b91('0x26')]&&_0x448dda['result']['length']){logger[_0x0b91('0x32')](_0x0b91('0x3d'));return BPromise[_0x0b91('0x27')]({'id':_0x448dda[_0x0b91('0x28')][0x0]['id'],'name':_0x448dda[_0x0b91('0x28')][0x0][_0x0b91('0x3e')]+'\x20'+_0x448dda[_0x0b91('0x28')][0x0]['lastname'],'phone':_0x3376b4});}else{logger[_0x0b91('0x32')](_0x0b91('0x3f'));return request({'method':_0x0b91('0x40'),'uri':util[_0x0b91('0x29')]('%s/webservice.php',_0x421bfe[_0x0b91('0x2f')]),'form':{'operation':_0x0b91('0x20'),'sessionName':_0x18d183[_0x0b91('0x22')],'elementType':_0x0b91('0x41'),'element':JSON[_0x0b91('0x24')]({'lastname':_0x498b7a,'phone':_0x3376b4,'assigned_user_id':'\x20'})},'json':!![]})[_0x0b91('0x25')](function(_0x59b6d5){logger[_0x0b91('0x32')](_0x0b91('0x42'));return BPromise[_0x0b91('0x27')]({'id':_0x59b6d5[_0x0b91('0x28')]['id'],'name':_0x59b6d5['result'][_0x0b91('0x43')],'phone':_0x59b6d5[_0x0b91('0x28')]['phone']});})[_0x0b91('0x3a')](function(_0x2b0414){var _0x3392ad=_0x2b0414['statusCode']||0x1f4;logger[_0x0b91('0x2b')](_0x0b91('0x39'),_0x0b91('0x44'),_0x3392ad,JSON[_0x0b91('0x24')](_0x2b0414));});}});}function getConnection(_0x26146d){var _0x12d9e3=_0x26146d[_0x0b91('0x37')];var _0x18d1f8=_0x26146d[_0x0b91('0x45')];return request({'method':_0x0b91('0x2d'),'uri':util[_0x0b91('0x29')](_0x0b91('0x2e'),_0x26146d[_0x0b91('0x2f')]),'qs':{'operation':_0x0b91('0x46'),'username':_0x12d9e3},'json':!![]})[_0x0b91('0x25')](function(_0x47b02c){if(_0x47b02c[_0x0b91('0x26')]){return request({'method':_0x0b91('0x40'),'uri':util[_0x0b91('0x29')](_0x0b91('0x2e'),_0x26146d[_0x0b91('0x2f')]),'form':{'operation':_0x0b91('0x47'),'username':_0x0b91('0x21'),'accessKey':md5(_0x47b02c[_0x0b91('0x28')][_0x0b91('0x48')]+_0x18d1f8)},'json':!![]});}})[_0x0b91('0x25')](function(_0xbc487b){if(_0xbc487b[_0x0b91('0x26')]){return BPromise[_0x0b91('0x27')](_0xbc487b['result']);}else{throw new Error(util['format'](_0x0b91('0x49'),_0x26146d['id']));}})[_0x0b91('0x3a')](function(_0x284ddb){var _0x581804=_0x284ddb['statusCode']||0x1f4;logger[_0x0b91('0x2b')](_0x0b91('0x39'),_0x0b91('0x4a'),_0x581804,JSON[_0x0b91('0x24')](_0x284ddb));});}function request(_0x465cc7){logger[_0x0b91('0x32')](_0x0b91('0x4b'),JSON['stringify'](_0x465cc7));return rp(_0x465cc7);}exports[_0x0b91('0x4c')]=function(_0xa01f77,_0x18ff6d,_0x2b1dbf,_0x5c0d39,_0x2bc0d,_0x2ac00e){var _0x4f08c5,_0x9a71a6,_0xeeb508,_0x3081a0;_0x2ac00e[_0x0b91('0x2f')]=intUtil['stripTrailingSlash'](_0x2ac00e['remoteUri']);if(_0x2bc0d&&_0x2bc0d[_0x0b91('0x4d')]){logger[_0x0b91('0x32')](_0x0b91('0x4e'),_0x0b91('0x4f'));_0x18ff6d[_0x0b91('0x50')]=util[_0x0b91('0x29')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2ac00e[_0x0b91('0x51')],_0x18ff6d[_0x0b91('0x52')],md5(_0x18ff6d[_0x0b91('0x52')]));}else{_0x18ff6d[_0x0b91('0x50')]='';}return getConnection(_0x2ac00e)[_0x0b91('0x25')](function(_0x28313d){_0x3081a0=_0x28313d;return getUser(_0x2ac00e,_0x5c0d39[_0x0b91('0x53')],_0x3081a0);})['then'](function(_0x27e23b){_0x4f08c5=_0x27e23b;logger[_0x0b91('0x32')](_0x0b91('0x54'),_0x4f08c5['id']);return getEndUser(_0x2ac00e,_0x18ff6d[_0x0b91('0x55')],_0x18ff6d['calleridnum'],_0x3081a0);})[_0x0b91('0x25')](function(_0x3369ff){_0x9a71a6=_0x3369ff;logger[_0x0b91('0x32')]('The\x20Enduser\x20ID\x20is:',_0x9a71a6['id']);return createTicket(_0x2ac00e,_0x4f08c5,_0x9a71a6,_0x2b1dbf,_0x18ff6d,_0x2b1dbf['Fields'],_0x3081a0);})[_0x0b91('0x25')](function(_0x402f03){_0xeeb508=_0x402f03;logger[_0x0b91('0x32')](_0x0b91('0x56'));logger[_0x0b91('0x32')](_0x0b91('0x57'),_0xeeb508['id']);var _0x5e6f15=util['format'](_0x0b91('0x58'),_0x2ac00e['remoteUri'],_[_0x0b91('0x59')](_0xeeb508['id'],'x')[0x1]);logger[_0x0b91('0x32')]('[QUEUE]',_0x0b91('0x5a'));emit(util[_0x0b91('0x29')](_0x0b91('0x5b'),_0x5c0d39[_0x0b91('0x18')]),'trigger:browser:url',{'uri':_0x5e6f15});})[_0x0b91('0x3a')](function(_0x2f9d1b){logger[_0x0b91('0x2b')](_0x0b91('0x4e'),JSON[_0x0b91('0x24')](_0x2f9d1b));});};exports['outbound']=function(_0x49e79b,_0x39fd3d,_0x3dd795,_0x1b70a4,_0x5397df,_0x5d5efc,_0x12962e){var _0x517cf2,_0x5cb502,_0x39689c,_0x4e29ef;_0x5d5efc[_0x0b91('0x2f')]=intUtil[_0x0b91('0x5c')](_0x5d5efc[_0x0b91('0x2f')]);_0x5d5efc['serverUrl']=intUtil[_0x0b91('0x5c')](_0x5d5efc[_0x0b91('0x51')]);if(_0x12962e&&_0x12962e['recordingFormat']&&_0x12962e[_0x0b91('0x5d')]!=='none'){logger[_0x0b91('0x32')](_0x0b91('0x5e'),_0x0b91('0x4f'));_0x39fd3d[_0x0b91('0x50')]=util[_0x0b91('0x29')](_0x0b91('0x5f'),_0x5d5efc[_0x0b91('0x51')],_0x39fd3d['uniqueid'],md5(_0x39fd3d[_0x0b91('0x52')]));}return getConnection(_0x5d5efc)['then'](function(_0x350281){_0x4e29ef=_0x350281;return getUser(_0x5d5efc,_0x1b70a4['email'],_0x4e29ef);})['then'](function(_0x3c88c3){_0x517cf2=_0x3c88c3;logger['info']('The\x20User\x20ID\x20is:',_0x517cf2['id']);return getEndUser(_0x5d5efc,_0x39fd3d[_0x0b91('0x60')],_0x39fd3d[_0x0b91('0x61')],_0x4e29ef);})['then'](function(_0x86b76f){_0x5cb502=_0x86b76f;logger[_0x0b91('0x32')](_0x0b91('0x62'),_0x5cb502['id']);return createTicket(_0x5d5efc,_0x517cf2,_0x5cb502,_0x3dd795,_0x39fd3d,_0x3dd795[_0x0b91('0x63')],_0x4e29ef);})['then'](function(_0x2be021){_0x39689c=_0x2be021;logger[_0x0b91('0x32')](_0x0b91('0x56'));logger['info'](_0x0b91('0x57'),_0x39689c['id']);var _0x206856=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x5d5efc[_0x0b91('0x2f')],_['split'](_0x39689c['id'],'x')[0x1]);logger[_0x0b91('0x32')](_0x0b91('0x5e'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x0b91('0x5b'),_0x1b70a4[_0x0b91('0x18')]),_0x0b91('0x64'),{'uri':_0x206856});})[_0x0b91('0x3a')](function(_0x5759d7){logger[_0x0b91('0x2b')]('[OUTBOUND]',JSON['stringify'](_0x5759d7));});};exports[_0x0b91('0x65')]=function(_0x436973,_0x317909,_0x5cf77b,_0x440f76,_0x319af3,_0x4c2107){var _0x51addb,_0x4f5778,_0x5122f2,_0x5ffce7;_0x4c2107['remoteUri']=intUtil['stripTrailingSlash'](_0x4c2107[_0x0b91('0x2f')]);_0x4c2107['serverUrl']=intUtil['stripTrailingSlash'](_0x4c2107[_0x0b91('0x51')]);if(_0x319af3&&_0x319af3['monitor_format']){logger[_0x0b91('0x32')](_0x0b91('0x66'),'Recording\x20is\x20enabled!');_0x317909['recordingURL']=util['format'](_0x0b91('0x5f'),_0x4c2107[_0x0b91('0x51')],_0x317909[_0x0b91('0x52')],md5(_0x317909[_0x0b91('0x52')]));}else{_0x317909['recordingURL']='';}return getConnection(_0x4c2107)[_0x0b91('0x25')](function(_0x33cce1){_0x5ffce7=_0x33cce1;return getUser(_0x4c2107,'',_0x5ffce7);})[_0x0b91('0x25')](function(_0x2850f2){_0x51addb=_0x2850f2;logger['info'](_0x0b91('0x54'),_0x51addb['id']);return getEndUser(_0x4c2107,_0x317909[_0x0b91('0x55')],_0x317909[_0x0b91('0x67')],_0x5ffce7);})['then'](function(_0x40317c){_0x4f5778=_0x40317c;logger[_0x0b91('0x32')](_0x0b91('0x62'),_0x4f5778['id']);return createTicket(_0x4c2107,_0x51addb,_0x4f5778,_0x5cf77b,_0x317909,_0x5cf77b[_0x0b91('0x63')],_0x5ffce7);})[_0x0b91('0x25')](function(_0x1ee717){_0x5122f2=_0x1ee717;logger[_0x0b91('0x32')](_0x0b91('0x56'));logger[_0x0b91('0x32')](_0x0b91('0x57'),_0x5122f2['id']);})[_0x0b91('0x3a')](function(_0x34aaf4){logger[_0x0b91('0x2b')]('[ABANDONED]',JSON['stringify'](_0x34aaf4));});}; \ No newline at end of file +var _0x2116=['[OUTBOUND]','destcalleridname','destcalleridnum','user:%s','abandoned','[ABANDONED]','calleridnum','request-promise','md5','util','ioredis','./util','../../../../config/logger','vTiger','redis','defaults','localhost','emit','length','forEach','type','string','idField','toString','variable','variableName','Variable','name','toLowerCase','Creating\x20new\x20ticket...','merge','Normal','Subjects','getString','POST','format','%s/webservice.php','remoteUri','admin','sessionName','HelpDesk','then','success','error','catch','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','stringify','validateEmail','info','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','username','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','getchallenge','login','token','getConnection','[HTTP]','queue','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat'];(function(_0x163ad8,_0xd406ba){var _0x574cdb=function(_0x591c91){while(--_0x591c91){_0x163ad8['push'](_0x163ad8['shift']());}};_0x574cdb(++_0xd406ba);}(_0x2116,0x67));var _0x6211=function(_0x19118e,_0x148a16){_0x19118e=_0x19118e-0x0;var _0x5a0c20=_0x2116[_0x19118e];return _0x5a0c20;};'use strict';var _=require('lodash');var rp=require(_0x6211('0x0'));var BPromise=require('bluebird');var md5=require(_0x6211('0x1'));var util=require(_0x6211('0x2'));var Redis=require(_0x6211('0x3'));var intUtil=require(_0x6211('0x4'));var config=require('../../../../config/environment');var logger=require(_0x6211('0x5'))(_0x6211('0x6'));config[_0x6211('0x7')]=_[_0x6211('0x8')](config['redis'],{'host':_0x6211('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6211('0x7')]));function emit(_0x320562,_0x365e65,_0x31914a){io['to'](_0x320562)[_0x6211('0xa')](_0x365e65,_0x31914a);}function getCustomFields(_0x143202,_0x10bb82){var _0x5eb8a5={};if(_0x143202[_0x6211('0xb')]>0x0){_[_0x6211('0xc')](_0x143202,function(_0x245e56){if(_0x245e56[_0x6211('0xd')]===_0x6211('0xe')&&_0x245e56[_0x6211('0xf')]){_0x5eb8a5[_0x245e56[_0x6211('0xf')]]=_0x245e56['content'][_0x6211('0x10')]();}else if(_0x245e56['type']===_0x6211('0x11')&&_0x245e56[_0x6211('0x12')]&&_0x245e56[_0x6211('0xf')]&&_0x10bb82[_0x245e56['variableName']]){_0x5eb8a5[_0x245e56[_0x6211('0xf')]]=_0x10bb82[_0x245e56[_0x6211('0x12')]][_0x6211('0x10')]();}else if(_0x245e56['type']==='customVariable'&&_0x245e56[_0x6211('0x13')]&&_0x245e56[_0x6211('0x13')][_0x6211('0x14')]&&_0x245e56[_0x6211('0xf')]&&_0x10bb82[_0x245e56[_0x6211('0x13')][_0x6211('0x14')][_0x6211('0x15')]()]){_0x5eb8a5[_0x245e56[_0x6211('0xf')]]=_0x10bb82[_0x245e56['Variable'][_0x6211('0x14')][_0x6211('0x15')]()][_0x6211('0x10')]();}});}return _0x5eb8a5;}function createTicket(_0x2ccbb0,_0xecea40,_0x14c051,_0x460efc,_0x54538b,_0x2d80ba,_0x1528e6){logger['info'](_0x6211('0x16'));var _0x43532c=_[_0x6211('0x17')]({'parent_id':'','assigned_user_id':_0xecea40['id'],'ticketpriorities':_0x6211('0x18'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x460efc[_0x6211('0x19')],_0x54538b,'\x20'),'description':intUtil[_0x6211('0x1a')](_0x460efc['Descriptions'],_0x54538b,'\x0a'),'contact_id':_0x14c051['id']},getCustomFields(_0x2d80ba,_0x54538b));var _0x52eb53={'method':_0x6211('0x1b'),'uri':util[_0x6211('0x1c')](_0x6211('0x1d'),_0x2ccbb0[_0x6211('0x1e')]),'form':{'operation':'create','username':_0x6211('0x1f'),'sessionName':_0x1528e6[_0x6211('0x20')],'elementType':_0x6211('0x21'),'element':JSON['stringify'](_0x43532c)},'json':!![]};return request(_0x52eb53)[_0x6211('0x22')](function(_0x279069){if(_0x279069[_0x6211('0x23')]){return BPromise['resolve']({'id':_0x279069['result']['id']});}else{throw new Error(util['format']('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON['stringify'](_0x279069[_0x6211('0x24')])));}})[_0x6211('0x25')](function(_0x140496){var _0x2d6265=_0x140496[_0x6211('0x26')]||0x1f4;logger[_0x6211('0x24')](_0x6211('0x27'),_0x6211('0x28'),_0x2d6265,JSON[_0x6211('0x29')](_0x140496));});}function getUser(_0x19a369,_0x105721,_0x38f5f8){if(intUtil[_0x6211('0x2a')](_0x105721)){logger[_0x6211('0x2b')](_0x6211('0x2c'),_0x105721);return request({'method':_0x6211('0x2d'),'uri':util[_0x6211('0x1c')]('%s/webservice.php',_0x19a369[_0x6211('0x1e')]),'qs':{'operation':_0x6211('0x2e'),'username':_0x6211('0x1f'),'sessionName':_0x38f5f8['sessionName'],'query':util['format'](_0x6211('0x2f'),_0x105721)},'json':!![]})['then'](function(_0x385a89){if(_0x385a89[_0x6211('0x23')]&&_0x385a89[_0x6211('0x30')]['length']){logger[_0x6211('0x2b')](_0x6211('0x31'));return BPromise[_0x6211('0x32')]({'id':_0x385a89[_0x6211('0x30')][0x0]['id'],'email':_0x385a89[_0x6211('0x30')][0x0]['email1'],'name':_0x385a89['result'][0x0][_0x6211('0x33')]+'\x20'+_0x385a89['result']['last_name']});}else{logger['info'](_0x6211('0x34'));return BPromise[_0x6211('0x32')]({'id':_0x38f5f8[_0x6211('0x35')],'email':_0x19a369['username'],'name':_0x6211('0x1f')});}})['catch'](function(_0x91ff8d){var _0x355496=_0x91ff8d[_0x6211('0x26')]||0x1f4;logger['error'](_0x6211('0x27'),_0x6211('0x36'),_0x355496,JSON[_0x6211('0x29')](_0x91ff8d));});}else{logger[_0x6211('0x2b')](_0x6211('0x34'));return BPromise[_0x6211('0x32')]({'id':_0x38f5f8[_0x6211('0x35')],'email':_0x19a369[_0x6211('0x37')],'name':'admin'})[_0x6211('0x25')](function(_0x32e27e){var _0x1e2888=_0x32e27e[_0x6211('0x26')]||0x1f4;logger[_0x6211('0x24')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x6211('0x36'),_0x1e2888,JSON[_0x6211('0x29')](_0x32e27e));});}}function getEndUser(_0x2afdf7,_0x8bc27d,_0x572324,_0x457ff9){logger[_0x6211('0x2b')](_0x6211('0x38'),_0x572324);return request({'method':_0x6211('0x2d'),'uri':util[_0x6211('0x1c')](_0x6211('0x1d'),_0x2afdf7[_0x6211('0x1e')]),'qs':{'operation':'query','username':_0x6211('0x1f'),'sessionName':_0x457ff9['sessionName'],'query':util[_0x6211('0x1c')](_0x6211('0x39'),_0x572324,_0x572324,_0x572324,_0x572324,_0x572324)},'json':!![]})['then'](function(_0x1b9e5d){if(_0x1b9e5d[_0x6211('0x23')]&&_0x1b9e5d['result']['length']){logger['info'](_0x6211('0x3a'));return BPromise[_0x6211('0x32')]({'id':_0x1b9e5d[_0x6211('0x30')][0x0]['id'],'name':_0x1b9e5d['result'][0x0][_0x6211('0x3b')]+'\x20'+_0x1b9e5d[_0x6211('0x30')][0x0][_0x6211('0x3c')],'phone':_0x572324});}else{logger[_0x6211('0x2b')](_0x6211('0x3d'));return request({'method':_0x6211('0x1b'),'uri':util[_0x6211('0x1c')](_0x6211('0x1d'),_0x2afdf7['remoteUri']),'form':{'operation':'create','sessionName':_0x457ff9[_0x6211('0x20')],'elementType':_0x6211('0x3e'),'element':JSON[_0x6211('0x29')]({'lastname':_0x8bc27d,'phone':_0x572324,'assigned_user_id':'\x20'})},'json':!![]})[_0x6211('0x22')](function(_0x16db53){logger[_0x6211('0x2b')]('Enduser\x20created.');return BPromise[_0x6211('0x32')]({'id':_0x16db53[_0x6211('0x30')]['id'],'name':_0x16db53[_0x6211('0x30')][_0x6211('0x3c')],'phone':_0x16db53[_0x6211('0x30')]['phone']});})[_0x6211('0x25')](function(_0x54a667){var _0x40dd41=_0x54a667['statusCode']||0x1f4;logger[_0x6211('0x24')](_0x6211('0x27'),'getEndUser',_0x40dd41,JSON[_0x6211('0x29')](_0x54a667));});}});}function getConnection(_0x150f41){var _0x311532=_0x150f41['username'];var _0x26bc90=_0x150f41['accessKey'];return request({'method':_0x6211('0x2d'),'uri':util['format'](_0x6211('0x1d'),_0x150f41['remoteUri']),'qs':{'operation':_0x6211('0x3f'),'username':_0x311532},'json':!![]})[_0x6211('0x22')](function(_0x1cee06){if(_0x1cee06[_0x6211('0x23')]){return request({'method':_0x6211('0x1b'),'uri':util[_0x6211('0x1c')](_0x6211('0x1d'),_0x150f41[_0x6211('0x1e')]),'form':{'operation':_0x6211('0x40'),'username':_0x6211('0x1f'),'accessKey':md5(_0x1cee06['result'][_0x6211('0x41')]+_0x26bc90)},'json':!![]});}})[_0x6211('0x22')](function(_0x13dc61){if(_0x13dc61[_0x6211('0x23')]){return BPromise['resolve'](_0x13dc61[_0x6211('0x30')]);}else{throw new Error(util[_0x6211('0x1c')]('Account\x20%d\x20is\x20not\x20valid',_0x150f41['id']));}})[_0x6211('0x25')](function(_0x48792b){var _0x554cd2=_0x48792b[_0x6211('0x26')]||0x1f4;logger[_0x6211('0x24')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x6211('0x42'),_0x554cd2,JSON[_0x6211('0x29')](_0x48792b));});}function request(_0x1c0ed2){logger[_0x6211('0x2b')](_0x6211('0x43'),JSON['stringify'](_0x1c0ed2));return rp(_0x1c0ed2);}exports[_0x6211('0x44')]=function(_0x8a364a,_0x1901d7,_0x4d0acd,_0x1b264a,_0x588ab7,_0x21e5e2){var _0x4a15b0,_0x4b1d8e,_0x1b9e3c,_0x3917d5;_0x21e5e2['remoteUri']=intUtil[_0x6211('0x45')](_0x21e5e2[_0x6211('0x1e')]);if(_0x588ab7&&_0x588ab7[_0x6211('0x46')]){logger[_0x6211('0x2b')]('[QUEUE]',_0x6211('0x47'));_0x1901d7[_0x6211('0x48')]=util[_0x6211('0x1c')](_0x6211('0x49'),_0x21e5e2[_0x6211('0x4a')],_0x1901d7[_0x6211('0x4b')],md5(_0x1901d7[_0x6211('0x4b')]));}else{_0x1901d7[_0x6211('0x48')]='';}return getConnection(_0x21e5e2)['then'](function(_0x17d340){_0x3917d5=_0x17d340;return getUser(_0x21e5e2,_0x1b264a[_0x6211('0x4c')],_0x3917d5);})['then'](function(_0x545402){_0x4a15b0=_0x545402;logger[_0x6211('0x2b')](_0x6211('0x4d'),_0x4a15b0['id']);return getEndUser(_0x21e5e2,_0x1901d7[_0x6211('0x4e')],_0x1901d7['calleridnum'],_0x3917d5);})[_0x6211('0x22')](function(_0x5a567e){_0x4b1d8e=_0x5a567e;logger[_0x6211('0x2b')](_0x6211('0x4f'),_0x4b1d8e['id']);return createTicket(_0x21e5e2,_0x4a15b0,_0x4b1d8e,_0x4d0acd,_0x1901d7,_0x4d0acd['Fields'],_0x3917d5);})['then'](function(_0x1a5a9b){_0x1b9e3c=_0x1a5a9b;logger[_0x6211('0x2b')](_0x6211('0x50'));logger[_0x6211('0x2b')](_0x6211('0x51'),_0x1b9e3c['id']);var _0x4d89e4=util[_0x6211('0x1c')](_0x6211('0x52'),_0x21e5e2['remoteUri'],_[_0x6211('0x53')](_0x1b9e3c['id'],'x')[0x1]);logger[_0x6211('0x2b')](_0x6211('0x54'),_0x6211('0x55'));emit(util[_0x6211('0x1c')]('user:%s',_0x1b264a[_0x6211('0x14')]),_0x6211('0x56'),{'uri':_0x4d89e4});})[_0x6211('0x25')](function(_0x7d47b3){logger['error'](_0x6211('0x54'),JSON['stringify'](_0x7d47b3));});};exports[_0x6211('0x57')]=function(_0x11abea,_0x421996,_0x5088d2,_0x4bf461,_0x5349ed,_0x3acded,_0xf09218){var _0x4f7f6a,_0x1d4b77,_0x496ca5,_0x2dee61;_0x3acded[_0x6211('0x1e')]=intUtil[_0x6211('0x45')](_0x3acded[_0x6211('0x1e')]);_0x3acded['serverUrl']=intUtil[_0x6211('0x45')](_0x3acded[_0x6211('0x4a')]);if(_0xf09218&&_0xf09218[_0x6211('0x58')]&&_0xf09218[_0x6211('0x58')]!=='none'){logger[_0x6211('0x2b')](_0x6211('0x59'),'Recording\x20is\x20enabled!');_0x421996[_0x6211('0x48')]=util[_0x6211('0x1c')](_0x6211('0x49'),_0x3acded[_0x6211('0x4a')],_0x421996[_0x6211('0x4b')],md5(_0x421996[_0x6211('0x4b')]));}return getConnection(_0x3acded)[_0x6211('0x22')](function(_0x1c0ea9){_0x2dee61=_0x1c0ea9;return getUser(_0x3acded,_0x4bf461['email'],_0x2dee61);})[_0x6211('0x22')](function(_0x456b22){_0x4f7f6a=_0x456b22;logger[_0x6211('0x2b')](_0x6211('0x4d'),_0x4f7f6a['id']);return getEndUser(_0x3acded,_0x421996[_0x6211('0x5a')],_0x421996[_0x6211('0x5b')],_0x2dee61);})[_0x6211('0x22')](function(_0x2ce016){_0x1d4b77=_0x2ce016;logger[_0x6211('0x2b')](_0x6211('0x4f'),_0x1d4b77['id']);return createTicket(_0x3acded,_0x4f7f6a,_0x1d4b77,_0x5088d2,_0x421996,_0x5088d2['Fields'],_0x2dee61);})['then'](function(_0x4f5117){_0x496ca5=_0x4f5117;logger[_0x6211('0x2b')]('Ticket\x20created!');logger[_0x6211('0x2b')]('The\x20Ticket\x20ID\x20is:',_0x496ca5['id']);var _0x1ef11e=util[_0x6211('0x1c')](_0x6211('0x52'),_0x3acded['remoteUri'],_[_0x6211('0x53')](_0x496ca5['id'],'x')[0x1]);logger[_0x6211('0x2b')](_0x6211('0x59'),_0x6211('0x55'));emit(util[_0x6211('0x1c')](_0x6211('0x5c'),_0x4bf461['name']),_0x6211('0x56'),{'uri':_0x1ef11e});})['catch'](function(_0x28e1a6){logger['error'](_0x6211('0x59'),JSON[_0x6211('0x29')](_0x28e1a6));});};exports[_0x6211('0x5d')]=function(_0x58e51d,_0x31c2c0,_0x2148f6,_0x337732,_0x127c9e,_0x2604e5){var _0x15dc53,_0x6f45f2,_0x4652f4,_0x4e2d77;_0x2604e5[_0x6211('0x1e')]=intUtil[_0x6211('0x45')](_0x2604e5['remoteUri']);_0x2604e5[_0x6211('0x4a')]=intUtil[_0x6211('0x45')](_0x2604e5[_0x6211('0x4a')]);if(_0x127c9e&&_0x127c9e[_0x6211('0x46')]){logger[_0x6211('0x2b')](_0x6211('0x5e'),_0x6211('0x47'));_0x31c2c0[_0x6211('0x48')]=util['format'](_0x6211('0x49'),_0x2604e5[_0x6211('0x4a')],_0x31c2c0[_0x6211('0x4b')],md5(_0x31c2c0['uniqueid']));}else{_0x31c2c0['recordingURL']='';}return getConnection(_0x2604e5)[_0x6211('0x22')](function(_0x43dba8){_0x4e2d77=_0x43dba8;return getUser(_0x2604e5,'',_0x4e2d77);})[_0x6211('0x22')](function(_0x4d7a5b){_0x15dc53=_0x4d7a5b;logger[_0x6211('0x2b')](_0x6211('0x4d'),_0x15dc53['id']);return getEndUser(_0x2604e5,_0x31c2c0[_0x6211('0x4e')],_0x31c2c0[_0x6211('0x5f')],_0x4e2d77);})[_0x6211('0x22')](function(_0x4a7361){_0x6f45f2=_0x4a7361;logger[_0x6211('0x2b')](_0x6211('0x4f'),_0x6f45f2['id']);return createTicket(_0x2604e5,_0x15dc53,_0x6f45f2,_0x2148f6,_0x31c2c0,_0x2148f6['Fields'],_0x4e2d77);})[_0x6211('0x22')](function(_0x526645){_0x4652f4=_0x526645;logger[_0x6211('0x2b')]('Ticket\x20created!');logger[_0x6211('0x2b')](_0x6211('0x51'),_0x4652f4['id']);})[_0x6211('0x25')](function(_0xa5e9a){logger[_0x6211('0x24')]('[ABANDONED]',JSON[_0x6211('0x29')](_0xa5e9a));});}; \ 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 74a4708..926ac2a 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 _0xea2f=['%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','%s/channels/voice/agents/%d/tickets/%d/display.json','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','defaults','redis','localhost','application/json','info','Creating\x20new\x20ticket...','format','POST','merge','Tags','getString','Descriptions','Fields','Ticket\x20created!','ticket','validateEmail','remoteUri','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','agent','%s/users/me.json','then','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/search.json','filter','end-user','length','first','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','Basic\x20%s','toString','base64','debug','GET','map','forEach','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','user:%s','trigger:browser:url'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xea2f,0x14d));var _0xfea2=function(_0xd6792,_0x4aa945){_0xd6792=_0xd6792-0x0;var _0x53b5a7=_0xea2f[_0xd6792];return _0x53b5a7;};'use strict';var _=require(_0xfea2('0x0'));var rp=require(_0xfea2('0x1'));var md5=require(_0xfea2('0x2'));var util=require(_0xfea2('0x3'));var Redis=require(_0xfea2('0x4'));var intUtil=require(_0xfea2('0x5'));var config=require(_0xfea2('0x6'));var logger=require(_0xfea2('0x7'))(_0xfea2('0x8'));config['redis']=_[_0xfea2('0x9')](config[_0xfea2('0xa')],{'host':_0xfea2('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfea2('0xa')]));function emit(_0x3e61b4,_0x139732,_0x128b0c){io['to'](_0x3e61b4)['emit'](_0x139732,_0x128b0c);}var headers={'Content-Type':_0xfea2('0xc'),'Accept':_0xfea2('0xc')};function getTicket(_0x51e3f0,_0x24b7c1,_0x9f2b93,_0x4c7683,_0x18d6ea){logger[_0xfea2('0xd')](_0xfea2('0xe'));return request({'uri':util[_0xfea2('0xf')]('%s/tickets.json',_0x51e3f0['remoteUri']),'method':_0xfea2('0x10'),'body':{'ticket':_[_0xfea2('0x11')]({'requester_id':_0x9f2b93['id'],'submitter_id':_0x24b7c1?_0x24b7c1['id']:undefined,'assignee_id':_0x24b7c1?_0x24b7c1['id']:undefined,'tags':getTags(_0x4c7683[_0xfea2('0x12')],'name'),'subject':intUtil['getString'](_0x4c7683['Subjects'],_0x18d6ea,'\x20'),'description':intUtil[_0xfea2('0x13')](_0x4c7683[_0xfea2('0x14')],_0x18d6ea,'\x0a'),'comment':{'public':![],'body':intUtil[_0xfea2('0x13')](_0x4c7683[_0xfea2('0x14')],_0x18d6ea,'\x0a')}},getCustomFields(_0x4c7683[_0xfea2('0x15')],_0x18d6ea))}})['then'](function(_0x15ba83){logger[_0xfea2('0xd')](_0xfea2('0x16'));return _0x15ba83[_0xfea2('0x17')];});}function getUser(_0x1f766e,_0x1424ab){if(intUtil[_0xfea2('0x18')](_0x1424ab)){logger[_0xfea2('0xd')]('Getting\x20agent\x20with\x20email',_0x1424ab);return request({'uri':util[_0xfea2('0xf')]('%s/search.json',_0x1f766e[_0xfea2('0x19')]),'qs':{'query':util[_0xfea2('0xf')](_0xfea2('0x1a'),_0x1424ab)}})['then'](function(_0x53147c){if(_0x53147c['count']){logger['info'](_0xfea2('0x1b'));return _[_0xfea2('0x1c')](_0x53147c[_0xfea2('0x1d')],{'email':_0x1424ab,'role':_0xfea2('0x1e')});}else{logger[_0xfea2('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xfea2('0xf')](_0xfea2('0x1f'),_0x1f766e[_0xfea2('0x19')])})[_0xfea2('0x20')](function(_0x5d6ec3){logger[_0xfea2('0xd')](_0xfea2('0x21'));return _0x5d6ec3[_0xfea2('0x22')];});}});}else{logger['info'](_0xfea2('0x23'));return request({'uri':util['format']('%s/users/me.json',_0x1f766e[_0xfea2('0x19')])})[_0xfea2('0x20')](function(_0x4647ea){logger[_0xfea2('0xd')](_0xfea2('0x21'));return _0x4647ea[_0xfea2('0x22')];});}}function getEndUser(_0x3f3c44,_0x1a0976,_0x1deacc){logger[_0xfea2('0xd')](_0xfea2('0x24'),_0x1deacc);return request({'uri':util[_0xfea2('0xf')](_0xfea2('0x25'),_0x3f3c44[_0xfea2('0x19')]),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x1deacc)}})['then'](function(_0x2f56b6){var _0x53f939;if(_0x2f56b6[_0xfea2('0x1d')]['length']){_0x2f56b6['results']=_[_0xfea2('0x26')](_0x2f56b6[_0xfea2('0x1d')],{'suspended':![],'role':_0xfea2('0x27')});if(_0x2f56b6['results'][_0xfea2('0x28')]){_0x53f939=_[_0xfea2('0x29')](_0x2f56b6['results']);}}if(_0x53f939){logger[_0xfea2('0xd')]('Enduser\x20found!');return _0x53f939;}else{logger[_0xfea2('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xfea2('0xf')]('%s/users.json',_0x3f3c44[_0xfea2('0x19')]),'method':_0xfea2('0x10'),'body':{'user':{'role':_0xfea2('0x27'),'name':util['format'](_0xfea2('0x2a'),_0x1a0976||_0x1deacc),'phone':_0x1deacc}}})[_0xfea2('0x20')](function(_0x5c0af3){logger['info'](_0xfea2('0x2b'));return _0x5c0af3[_0xfea2('0x22')];});}});}function getAuth(_0x208d69){var _0x1153de;if(_0x208d69[_0xfea2('0x2c')]===_0xfea2('0x2d')){_0x1153de=util['format'](_0xfea2('0x2e'),_0x208d69[_0xfea2('0x2f')],_0x208d69[_0xfea2('0x2d')]);}else if(_0x208d69[_0xfea2('0x2c')]===_0xfea2('0x30')){_0x1153de=util[_0xfea2('0xf')]('%s/token:%s',_0x208d69[_0xfea2('0x2f')],_0x208d69[_0xfea2('0x30')]);}return util[_0xfea2('0xf')](_0xfea2('0x31'),new Buffer(_0x1153de)[_0xfea2('0x32')](_0xfea2('0x33')));}function request(_0x2f465f){logger[_0xfea2('0x34')]('[HTTP]',JSON['stringify'](_0x2f465f));return rp(_['defaults'](_0x2f465f,{'method':_0xfea2('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x18092e,_0x4ab4d1){var _0x3bbc01=[];if(_0x18092e&&_0x18092e[_0xfea2('0x28')]>0x0){_0x3bbc01=_[_0xfea2('0x36')](_0x18092e,_0x4ab4d1);}return _0x3bbc01;}function getCustomFields(_0x1ac94d,_0xc443ca){var _0x526790=[];var _0x2307a5={'custom_fields':[]};if(_0x1ac94d[_0xfea2('0x28')]>0x0){_[_0xfea2('0x37')](_0x1ac94d,function(_0x47220d){if(_0x47220d[_0xfea2('0x38')]==='string'&&_0x47220d[_0xfea2('0x39')]&&!_0x47220d[_0xfea2('0x3a')]){_0x2307a5[_0x47220d[_0xfea2('0x39')][_0xfea2('0x3b')]()]=_0x47220d[_0xfea2('0x3c')][_0xfea2('0x32')]();}else if(_0x47220d['type']===_0xfea2('0x3d')&&_0x47220d[_0xfea2('0x3e')]&&_0x47220d[_0xfea2('0x3a')]){_0x2307a5[_0xfea2('0x3f')]['push']({'id':_0x47220d['idField'],'value':_0x47220d['content'][_0xfea2('0x32')]()});}else if(_0x47220d[_0xfea2('0x38')]===_0xfea2('0x40')&&_0x47220d[_0xfea2('0x41')]&&_0x47220d[_0xfea2('0x3e')]&&_0x47220d['customField']){_0xc443ca[_0x47220d[_0xfea2('0x41')]]&&_0x2307a5[_0xfea2('0x3f')]['push']({'id':_0x47220d['idField'],'value':_0xc443ca[_0x47220d[_0xfea2('0x41')]][_0xfea2('0x32')]()});}else if(_0x47220d[_0xfea2('0x38')]==='customVariable'&&_0x47220d[_0xfea2('0x42')]&&_0x47220d[_0xfea2('0x42')][_0xfea2('0x43')]&&_0x47220d[_0xfea2('0x3e')]&&_0x47220d[_0xfea2('0x3a')]){_0xc443ca[_0x47220d[_0xfea2('0x42')][_0xfea2('0x43')][_0xfea2('0x3b')]()]&&_0x2307a5[_0xfea2('0x3f')]['push']({'id':_0x47220d[_0xfea2('0x3e')],'value':_0xc443ca[_0x47220d[_0xfea2('0x42')]['name']['toLowerCase']()]['toString']()});}});}return _0x2307a5;}exports[_0xfea2('0x44')]=function(_0xb3e60,_0x345ab1,_0x4d2e72,_0x221fb7,_0x29e509,_0x126bb3){var _0x493826,_0x28a752;_0x126bb3[_0xfea2('0x19')]=intUtil[_0xfea2('0x45')](_0x126bb3[_0xfea2('0x19')]);_0x126bb3[_0xfea2('0x46')]=intUtil[_0xfea2('0x45')](_0x126bb3[_0xfea2('0x46')]);if(_0x29e509&&_0x29e509[_0xfea2('0x47')]){logger[_0xfea2('0xd')](_0xfea2('0x48'),_0xfea2('0x49'));_0x345ab1['recordingURL']=util[_0xfea2('0xf')](_0xfea2('0x4a'),_0x126bb3['serverUrl'],_0x345ab1['uniqueid'],md5(_0x345ab1[_0xfea2('0x4b')]));}else{_0x345ab1['recordingURL']='';}headers[_0xfea2('0x4c')]=getAuth(_0x126bb3);return getUser(_0x126bb3,_0x221fb7[_0xfea2('0x4d')])[_0xfea2('0x20')](function(_0x1bd6f7){_0x493826=_0x1bd6f7;logger[_0xfea2('0xd')]('The\x20User\x20ID\x20is:',_0x493826['id']);return getEndUser(_0x126bb3,_0x345ab1[_0xfea2('0x4e')],_0x345ab1[_0xfea2('0x4f')]);})[_0xfea2('0x20')](function(_0x44f110){_0x28a752=_0x44f110;logger[_0xfea2('0xd')](_0xfea2('0x50'),_0x28a752['id']);return getTicket(_0x126bb3,_0x493826,_0x28a752,_0x4d2e72,_0x345ab1);})['then'](function(_0x65634e){if(_0x65634e){logger[_0xfea2('0xd')](_0xfea2('0x51'),_0x65634e['id']);switch(_0x126bb3[_0xfea2('0x38')]){case _0xfea2('0x52'):logger['info'](_0xfea2('0x48'),_0xfea2('0x53'));return request({'uri':util[_0xfea2('0xf')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x126bb3[_0xfea2('0x19')],_0x493826['id'],_0x65634e['id']),'method':_0xfea2('0x10')});case _0xfea2('0x54'):logger[_0xfea2('0xd')](_0xfea2('0x48'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xfea2('0x55'),_0x221fb7[_0xfea2('0x43')]),_0xfea2('0x56'),{'uri':util[_0xfea2('0xf')](_0xfea2('0x57'),_0x126bb3['remoteUri'],_0x65634e['id'])});break;default:logger[_0xfea2('0x58')](_0xfea2('0x48'),_0xfea2('0x59'));}}})['catch'](function(_0x5e76ae){logger[_0xfea2('0x58')](_0xfea2('0x5a'),util[_0xfea2('0x5b')](_0x5e76ae,{'showHidden':!![],'depth':null}));});};exports[_0xfea2('0x5c')]=function(_0x26c0cc,_0x56bce4,_0x4d082b,_0xf83a13,_0x1c0095,_0x5e157e,_0x3eea0a){var _0x553fc1,_0x4a5a58;_0x5e157e[_0xfea2('0x19')]=intUtil['stripTrailingSlash'](_0x5e157e[_0xfea2('0x19')]);_0x5e157e[_0xfea2('0x46')]=intUtil['stripTrailingSlash'](_0x5e157e[_0xfea2('0x46')]);if(_0x3eea0a&&_0x3eea0a[_0xfea2('0x5d')]&&_0x3eea0a[_0xfea2('0x5d')]!==_0xfea2('0x5e')){logger['info'](_0xfea2('0x5f'),_0xfea2('0x49'));_0x56bce4[_0xfea2('0x60')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5e157e[_0xfea2('0x46')],_0x56bce4[_0xfea2('0x4b')],md5(_0x56bce4[_0xfea2('0x4b')]));}headers[_0xfea2('0x4c')]=getAuth(_0x5e157e);return getUser(_0x5e157e,_0xf83a13[_0xfea2('0x4d')])[_0xfea2('0x20')](function(_0xac402e){_0x553fc1=_0xac402e;logger['info'](_0xfea2('0x61'),_0x553fc1['id']);return getEndUser(_0x5e157e,_0x56bce4[_0xfea2('0x62')],_0x56bce4[_0xfea2('0x63')]);})[_0xfea2('0x20')](function(_0xec5f5){_0x4a5a58=_0xec5f5;logger[_0xfea2('0xd')](_0xfea2('0x50'),_0x4a5a58['id']);return getTicket(_0x5e157e,_0x553fc1,_0x4a5a58,_0x4d082b,_0x56bce4);})[_0xfea2('0x20')](function(_0x291d74){if(_0x291d74){logger[_0xfea2('0xd')](_0xfea2('0x51'),_0x291d74['id']);switch(_0x5e157e[_0xfea2('0x38')]){case _0xfea2('0x52'):logger[_0xfea2('0xd')](_0xfea2('0x5f'),_0xfea2('0x53'));return request({'uri':util[_0xfea2('0xf')](_0xfea2('0x64'),_0x5e157e['remoteUri'],_0x553fc1['id'],_0x291d74['id']),'method':_0xfea2('0x10')});case _0xfea2('0x54'):logger[_0xfea2('0xd')](_0xfea2('0x5f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xfea2('0xf')](_0xfea2('0x55'),_0xf83a13[_0xfea2('0x43')]),_0xfea2('0x56'),{'uri':util['format'](_0xfea2('0x57'),_0x5e157e[_0xfea2('0x19')],_0x291d74['id'])});break;default:logger[_0xfea2('0x58')](_0xfea2('0x5f'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xfea2('0x65')](function(_0x3bde15){logger[_0xfea2('0x58')](_0xfea2('0x66'),util[_0xfea2('0x5b')](_0x3bde15,{'showHidden':!![],'depth':null}));});};exports[_0xfea2('0x67')]=function(_0x1bcc04,_0xe8d1d8,_0x33ded6,_0x1367dd,_0x109f7f,_0x4df9a0){var _0x17d2a3,_0x324b74;_0x4df9a0[_0xfea2('0x19')]=intUtil[_0xfea2('0x45')](_0x4df9a0[_0xfea2('0x19')]);_0x4df9a0['serverUrl']=intUtil['stripTrailingSlash'](_0x4df9a0[_0xfea2('0x46')]);if(_0x109f7f&&_0x109f7f[_0xfea2('0x47')]){logger['info'](_0xfea2('0x68'),_0xfea2('0x49'));_0xe8d1d8[_0xfea2('0x60')]=util['format'](_0xfea2('0x4a'),_0x4df9a0['serverUrl'],_0xe8d1d8[_0xfea2('0x4b')],md5(_0xe8d1d8['uniqueid']));}else{_0xe8d1d8[_0xfea2('0x60')]='';}headers[_0xfea2('0x4c')]=getAuth(_0x4df9a0);return getUser(_0x4df9a0)[_0xfea2('0x20')](function(_0x37c5ca){_0x17d2a3=_0x37c5ca;logger[_0xfea2('0xd')](_0xfea2('0x61'),_0x17d2a3['id']);return getEndUser(_0x4df9a0,_0xe8d1d8[_0xfea2('0x4e')],_0xe8d1d8[_0xfea2('0x4f')]);})[_0xfea2('0x20')](function(_0x467506){_0x324b74=_0x467506;logger[_0xfea2('0xd')](_0xfea2('0x50'),_0x324b74['id']);return getTicket(_0x4df9a0,_0x17d2a3,_0x324b74,_0x33ded6,_0xe8d1d8);})[_0xfea2('0x20')](function(_0x27255a){if(_0x27255a){logger[_0xfea2('0xd')](_0xfea2('0x51'),_0x27255a['id']);}})[_0xfea2('0x65')](function(_0xcff978){logger[_0xfea2('0x58')]('[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0xcff978,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x7f8b=['Tags','name','getString','Subjects','Fields','then','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','%s/token:%s','token','Basic\x20%s','toString','debug','[HTTP]','stringify','GET','forEach','string','nameField','customField','toLowerCase','content','type','idField','custom_fields','variable','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','Authorization','email','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','Zendesk\x20account\x20type\x20not\x20recognized','error','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','integrationTab','trigger:browser:url','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','[ABANDONED]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridname','calleridnum','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','md5','util','./util','../../../../config/environment','zendesk','redis','defaults','localhost','application/json','Creating\x20new\x20ticket...','format','remoteUri','POST'];(function(_0x119fad,_0x4e77b2){var _0x4725c2=function(_0x3f018b){while(--_0x3f018b){_0x119fad['push'](_0x119fad['shift']());}};_0x4725c2(++_0x4e77b2);}(_0x7f8b,0x12e));var _0xb7f8=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x7f8b[_0x50aa2e];return _0x5e07f0;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xb7f8('0x0'));var util=require(_0xb7f8('0x1'));var Redis=require('ioredis');var intUtil=require(_0xb7f8('0x2'));var config=require(_0xb7f8('0x3'));var logger=require('../../../../config/logger')(_0xb7f8('0x4'));config[_0xb7f8('0x5')]=_[_0xb7f8('0x6')](config[_0xb7f8('0x5')],{'host':_0xb7f8('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb7f8('0x5')]));function emit(_0x4e3dc8,_0x27f24a,_0x597c87){io['to'](_0x4e3dc8)['emit'](_0x27f24a,_0x597c87);}var headers={'Content-Type':_0xb7f8('0x8'),'Accept':'application/json'};function getTicket(_0x2cd977,_0x1a33df,_0x1e2b7f,_0xa4f9f9,_0xedcfa5){logger['info'](_0xb7f8('0x9'));return request({'uri':util[_0xb7f8('0xa')]('%s/tickets.json',_0x2cd977[_0xb7f8('0xb')]),'method':_0xb7f8('0xc'),'body':{'ticket':_['merge']({'requester_id':_0x1e2b7f['id'],'submitter_id':_0x1a33df?_0x1a33df['id']:undefined,'assignee_id':_0x1a33df?_0x1a33df['id']:undefined,'tags':getTags(_0xa4f9f9[_0xb7f8('0xd')],_0xb7f8('0xe')),'subject':intUtil[_0xb7f8('0xf')](_0xa4f9f9[_0xb7f8('0x10')],_0xedcfa5,'\x20'),'description':intUtil[_0xb7f8('0xf')](_0xa4f9f9['Descriptions'],_0xedcfa5,'\x0a'),'comment':{'public':![],'body':intUtil[_0xb7f8('0xf')](_0xa4f9f9['Descriptions'],_0xedcfa5,'\x0a')}},getCustomFields(_0xa4f9f9[_0xb7f8('0x11')],_0xedcfa5))}})[_0xb7f8('0x12')](function(_0x489f87){logger[_0xb7f8('0x13')](_0xb7f8('0x14'));return _0x489f87[_0xb7f8('0x15')];});}function getUser(_0x1cceb1,_0x2cd389){if(intUtil[_0xb7f8('0x16')](_0x2cd389)){logger[_0xb7f8('0x13')](_0xb7f8('0x17'),_0x2cd389);return request({'uri':util[_0xb7f8('0xa')](_0xb7f8('0x18'),_0x1cceb1[_0xb7f8('0xb')]),'qs':{'query':util['format'](_0xb7f8('0x19'),_0x2cd389)}})['then'](function(_0x3b960c){if(_0x3b960c[_0xb7f8('0x1a')]){logger[_0xb7f8('0x13')](_0xb7f8('0x1b'));return _[_0xb7f8('0x1c')](_0x3b960c[_0xb7f8('0x1d')],{'email':_0x2cd389,'role':'agent'});}else{logger[_0xb7f8('0x13')](_0xb7f8('0x1e'));return request({'uri':util['format']('%s/users/me.json',_0x1cceb1['remoteUri'])})[_0xb7f8('0x12')](function(_0x27d141){logger[_0xb7f8('0x13')]('Admin\x20account\x20selected.');return _0x27d141['user'];});}});}else{logger[_0xb7f8('0x13')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xb7f8('0xa')](_0xb7f8('0x1f'),_0x1cceb1[_0xb7f8('0xb')])})[_0xb7f8('0x12')](function(_0x43f316){logger[_0xb7f8('0x13')](_0xb7f8('0x20'));return _0x43f316[_0xb7f8('0x21')];});}}function getEndUser(_0x497622,_0x4d670d,_0x37ef8f){logger[_0xb7f8('0x13')](_0xb7f8('0x22'),_0x37ef8f);return request({'uri':util['format'](_0xb7f8('0x18'),_0x497622[_0xb7f8('0xb')]),'qs':{'query':util[_0xb7f8('0xa')]('type:user\x20role:end-user\x20phone:%s',_0x37ef8f)}})[_0xb7f8('0x12')](function(_0x5b2abd){var _0x2798c8;if(_0x5b2abd['results'][_0xb7f8('0x23')]){_0x5b2abd[_0xb7f8('0x1d')]=_[_0xb7f8('0x24')](_0x5b2abd[_0xb7f8('0x1d')],{'suspended':![],'role':_0xb7f8('0x25')});if(_0x5b2abd['results']['length']){_0x2798c8=_[_0xb7f8('0x26')](_0x5b2abd[_0xb7f8('0x1d')]);}}if(_0x2798c8){logger[_0xb7f8('0x13')](_0xb7f8('0x27'));return _0x2798c8;}else{logger[_0xb7f8('0x13')](_0xb7f8('0x28'));return request({'uri':util['format'](_0xb7f8('0x29'),_0x497622[_0xb7f8('0xb')]),'method':_0xb7f8('0xc'),'body':{'user':{'role':_0xb7f8('0x25'),'name':util[_0xb7f8('0xa')](_0xb7f8('0x2a'),_0x4d670d||_0x37ef8f),'phone':_0x37ef8f}}})[_0xb7f8('0x12')](function(_0x13ad1a){logger[_0xb7f8('0x13')](_0xb7f8('0x2b'));return _0x13ad1a[_0xb7f8('0x21')];});}});}function getAuth(_0x27b8ea){var _0x2ab60d;if(_0x27b8ea[_0xb7f8('0x2c')]===_0xb7f8('0x2d')){_0x2ab60d=util['format'](_0xb7f8('0x2e'),_0x27b8ea[_0xb7f8('0x2f')],_0x27b8ea['password']);}else if(_0x27b8ea[_0xb7f8('0x2c')]==='token'){_0x2ab60d=util['format'](_0xb7f8('0x30'),_0x27b8ea[_0xb7f8('0x2f')],_0x27b8ea[_0xb7f8('0x31')]);}return util[_0xb7f8('0xa')](_0xb7f8('0x32'),new Buffer(_0x2ab60d)[_0xb7f8('0x33')]('base64'));}function request(_0x28cb49){logger[_0xb7f8('0x34')](_0xb7f8('0x35'),JSON[_0xb7f8('0x36')](_0x28cb49));return rp(_[_0xb7f8('0x6')](_0x28cb49,{'method':_0xb7f8('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x573a90,_0x7fbdc7){var _0x43ffeb=[];if(_0x573a90&&_0x573a90['length']>0x0){_0x43ffeb=_['map'](_0x573a90,_0x7fbdc7);}return _0x43ffeb;}function getCustomFields(_0x2dd822,_0x8cb295){var _0x533240=[];var _0x1f3053={'custom_fields':[]};if(_0x2dd822[_0xb7f8('0x23')]>0x0){_[_0xb7f8('0x38')](_0x2dd822,function(_0x47dff1){if(_0x47dff1['type']===_0xb7f8('0x39')&&_0x47dff1[_0xb7f8('0x3a')]&&!_0x47dff1[_0xb7f8('0x3b')]){_0x1f3053[_0x47dff1['nameField'][_0xb7f8('0x3c')]()]=_0x47dff1[_0xb7f8('0x3d')][_0xb7f8('0x33')]();}else if(_0x47dff1[_0xb7f8('0x3e')]===_0xb7f8('0x39')&&_0x47dff1[_0xb7f8('0x3f')]&&_0x47dff1[_0xb7f8('0x3b')]){_0x1f3053[_0xb7f8('0x40')]['push']({'id':_0x47dff1[_0xb7f8('0x3f')],'value':_0x47dff1[_0xb7f8('0x3d')]['toString']()});}else if(_0x47dff1[_0xb7f8('0x3e')]===_0xb7f8('0x41')&&_0x47dff1[_0xb7f8('0x42')]&&_0x47dff1[_0xb7f8('0x3f')]&&_0x47dff1[_0xb7f8('0x3b')]){_0x8cb295[_0x47dff1[_0xb7f8('0x42')]]&&_0x1f3053['custom_fields'][_0xb7f8('0x43')]({'id':_0x47dff1['idField'],'value':_0x8cb295[_0x47dff1[_0xb7f8('0x42')]]['toString']()});}else if(_0x47dff1[_0xb7f8('0x3e')]===_0xb7f8('0x44')&&_0x47dff1[_0xb7f8('0x45')]&&_0x47dff1['Variable'][_0xb7f8('0xe')]&&_0x47dff1['idField']&&_0x47dff1[_0xb7f8('0x3b')]){_0x8cb295[_0x47dff1[_0xb7f8('0x45')][_0xb7f8('0xe')]['toLowerCase']()]&&_0x1f3053['custom_fields'][_0xb7f8('0x43')]({'id':_0x47dff1[_0xb7f8('0x3f')],'value':_0x8cb295[_0x47dff1[_0xb7f8('0x45')][_0xb7f8('0xe')]['toLowerCase']()][_0xb7f8('0x33')]()});}});}return _0x1f3053;}exports[_0xb7f8('0x46')]=function(_0x2cc61e,_0x572d7b,_0x388fe8,_0x2b22fa,_0x129b2f,_0x510b6e){var _0x260908,_0x4cbaeb;_0x510b6e[_0xb7f8('0xb')]=intUtil['stripTrailingSlash'](_0x510b6e[_0xb7f8('0xb')]);_0x510b6e['serverUrl']=intUtil[_0xb7f8('0x47')](_0x510b6e[_0xb7f8('0x48')]);if(_0x129b2f&&_0x129b2f[_0xb7f8('0x49')]){logger[_0xb7f8('0x13')](_0xb7f8('0x4a'),_0xb7f8('0x4b'));_0x572d7b[_0xb7f8('0x4c')]=util[_0xb7f8('0xa')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x510b6e[_0xb7f8('0x48')],_0x572d7b['uniqueid'],md5(_0x572d7b['uniqueid']));}else{_0x572d7b[_0xb7f8('0x4c')]='';}headers[_0xb7f8('0x4d')]=getAuth(_0x510b6e);return getUser(_0x510b6e,_0x2b22fa[_0xb7f8('0x4e')])[_0xb7f8('0x12')](function(_0xe7864d){_0x260908=_0xe7864d;logger['info']('The\x20User\x20ID\x20is:',_0x260908['id']);return getEndUser(_0x510b6e,_0x572d7b['calleridname'],_0x572d7b['calleridnum']);})[_0xb7f8('0x12')](function(_0x107d26){_0x4cbaeb=_0x107d26;logger[_0xb7f8('0x13')](_0xb7f8('0x4f'),_0x4cbaeb['id']);return getTicket(_0x510b6e,_0x260908,_0x4cbaeb,_0x388fe8,_0x572d7b);})[_0xb7f8('0x12')](function(_0x39315b){if(_0x39315b){logger[_0xb7f8('0x13')](_0xb7f8('0x50'),_0x39315b['id']);switch(_0x510b6e[_0xb7f8('0x3e')]){case'integrationTab':logger['info']('[QUEUE]',_0xb7f8('0x51'));return request({'uri':util[_0xb7f8('0xa')](_0xb7f8('0x52'),_0x510b6e[_0xb7f8('0xb')],_0x260908['id'],_0x39315b['id']),'method':_0xb7f8('0xc')});case _0xb7f8('0x53'):logger[_0xb7f8('0x13')](_0xb7f8('0x4a'),_0xb7f8('0x54'));emit(util[_0xb7f8('0xa')](_0xb7f8('0x55'),_0x2b22fa[_0xb7f8('0xe')]),'trigger:browser:url',{'uri':util[_0xb7f8('0xa')]('%s/agent/tickets/%s',_0x510b6e['remoteUri'],_0x39315b['id'])});break;default:logger['error']('[QUEUE]',_0xb7f8('0x56'));}}})['catch'](function(_0x404b06){logger[_0xb7f8('0x57')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x404b06,{'showHidden':!![],'depth':null}));});};exports[_0xb7f8('0x58')]=function(_0xeed49e,_0x2d3b67,_0x2e3977,_0xb511ed,_0x2d6a39,_0x5add67,_0x1cbb45){var _0x109f34,_0x1b6958;_0x5add67[_0xb7f8('0xb')]=intUtil['stripTrailingSlash'](_0x5add67['remoteUri']);_0x5add67[_0xb7f8('0x48')]=intUtil['stripTrailingSlash'](_0x5add67[_0xb7f8('0x48')]);if(_0x1cbb45&&_0x1cbb45[_0xb7f8('0x59')]&&_0x1cbb45['recordingFormat']!==_0xb7f8('0x5a')){logger[_0xb7f8('0x13')](_0xb7f8('0x5b'),_0xb7f8('0x4b'));_0x2d3b67['recordingURL']=util[_0xb7f8('0xa')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5add67['serverUrl'],_0x2d3b67['uniqueid'],md5(_0x2d3b67[_0xb7f8('0x5c')]));}headers['Authorization']=getAuth(_0x5add67);return getUser(_0x5add67,_0xb511ed[_0xb7f8('0x4e')])['then'](function(_0x13d01b){_0x109f34=_0x13d01b;logger[_0xb7f8('0x13')](_0xb7f8('0x5d'),_0x109f34['id']);return getEndUser(_0x5add67,_0x2d3b67[_0xb7f8('0x5e')],_0x2d3b67[_0xb7f8('0x5f')]);})[_0xb7f8('0x12')](function(_0x397cae){_0x1b6958=_0x397cae;logger['info'](_0xb7f8('0x4f'),_0x1b6958['id']);return getTicket(_0x5add67,_0x109f34,_0x1b6958,_0x2e3977,_0x2d3b67);})[_0xb7f8('0x12')](function(_0x4c4813){if(_0x4c4813){logger[_0xb7f8('0x13')](_0xb7f8('0x50'),_0x4c4813['id']);switch(_0x5add67[_0xb7f8('0x3e')]){case _0xb7f8('0x60'):logger[_0xb7f8('0x13')](_0xb7f8('0x5b'),_0xb7f8('0x51'));return request({'uri':util['format'](_0xb7f8('0x52'),_0x5add67['remoteUri'],_0x109f34['id'],_0x4c4813['id']),'method':_0xb7f8('0xc')});case _0xb7f8('0x53'):logger['info'](_0xb7f8('0x5b'),_0xb7f8('0x54'));emit(util[_0xb7f8('0xa')](_0xb7f8('0x55'),_0xb511ed['name']),_0xb7f8('0x61'),{'uri':util[_0xb7f8('0xa')]('%s/agent/tickets/%s',_0x5add67['remoteUri'],_0x4c4813['id'])});break;default:logger[_0xb7f8('0x57')](_0xb7f8('0x5b'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x2302cb){logger[_0xb7f8('0x57')](_0xb7f8('0x62'),util[_0xb7f8('0x63')](_0x2302cb,{'showHidden':!![],'depth':null}));});};exports['abandoned']=function(_0xd815da,_0x1af4e0,_0x43b22e,_0x208658,_0x1ec7f3,_0x300e08){var _0x5c786a,_0xb5b994;_0x300e08[_0xb7f8('0xb')]=intUtil[_0xb7f8('0x47')](_0x300e08['remoteUri']);_0x300e08[_0xb7f8('0x48')]=intUtil[_0xb7f8('0x47')](_0x300e08['serverUrl']);if(_0x1ec7f3&&_0x1ec7f3[_0xb7f8('0x49')]){logger[_0xb7f8('0x13')](_0xb7f8('0x64'),'Recording\x20is\x20enabled!');_0x1af4e0['recordingURL']=util[_0xb7f8('0xa')](_0xb7f8('0x65'),_0x300e08['serverUrl'],_0x1af4e0['uniqueid'],md5(_0x1af4e0[_0xb7f8('0x5c')]));}else{_0x1af4e0[_0xb7f8('0x4c')]='';}headers[_0xb7f8('0x4d')]=getAuth(_0x300e08);return getUser(_0x300e08)[_0xb7f8('0x12')](function(_0x44119f){_0x5c786a=_0x44119f;logger[_0xb7f8('0x13')](_0xb7f8('0x5d'),_0x5c786a['id']);return getEndUser(_0x300e08,_0x1af4e0[_0xb7f8('0x66')],_0x1af4e0[_0xb7f8('0x67')]);})[_0xb7f8('0x12')](function(_0x13486e){_0xb5b994=_0x13486e;logger[_0xb7f8('0x13')](_0xb7f8('0x4f'),_0xb5b994['id']);return getTicket(_0x300e08,_0x5c786a,_0xb5b994,_0x43b22e,_0x1af4e0);})[_0xb7f8('0x12')](function(_0x1d7c6f){if(_0x1d7c6f){logger[_0xb7f8('0x13')](_0xb7f8('0x50'),_0x1d7c6f['id']);}})['catch'](function(_0x170772){logger[_0xb7f8('0x57')](_0xb7f8('0x68'),util[_0xb7f8('0x63')](_0x170772,{'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 0c0bab3..cd777ad 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 _0x1883=['queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridnum','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','Outbound','user:%s','[ABANDONED]','The\x20Enduser\x20ID\x20is:','lodash','request-promise','md5','util','./util','xml2json','entities','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','isNil','expires_in','access_token','zone','https://accounts.zoho.eu','https://accounts.zoho.in','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','log','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','find','email','profile','status','Using\x20the\x20admin\x20account!','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Search\x20end\x20user','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','POST','/crm/v2/Contacts','data','SUCCESS','details','Error\x20on\x20Lead\x20retrieve:\x20','Creating\x20new\x20call...','Owner','role','first_name','last_name','Subject','getString','Subjects','Description','Descriptions','Full_Name','Last_Name','talktime','utc','mm:ss','answertime','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','Answered','rejected','Rejected','abandoned','agentcalledAt','Call_Type','/crm/v2/Calls','code','Call\x20created!','err'];(function(_0x2f194c,_0x1c005f){var _0x9039d2=function(_0x143808){while(--_0x143808){_0x2f194c['push'](_0x2f194c['shift']());}};_0x9039d2(++_0x1c005f);}(_0x1883,0xab));var _0x3188=function(_0x3860d2,_0x4931fc){_0x3860d2=_0x3860d2-0x0;var _0x48c1df=_0x1883[_0x3860d2];return _0x48c1df;};'use strict';var _=require(_0x3188('0x0'));var rp=require(_0x3188('0x1'));var md5=require(_0x3188('0x2'));var util=require(_0x3188('0x3'));var intUtil=require(_0x3188('0x4'));var parser=require(_0x3188('0x5'));var entities=require(_0x3188('0x6'));var moment=require(_0x3188('0x7'));var Redis=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var logger=require(_0x3188('0xa'))(_0x3188('0xb'));config[_0x3188('0xc')]=_[_0x3188('0xd')](config[_0x3188('0xc')],{'host':_0x3188('0xe'),'port':0x18eb});var io=require(_0x3188('0xf'))(new Redis(config['redis']));function emit(_0x446ab7,_0x2a2f07,_0x53f5c0){io['to'](_0x446ab7)[_0x3188('0x10')](_0x2a2f07,_0x53f5c0);}function request(_0x5b7f47){logger[_0x3188('0x11')](_0x3188('0x12'),JSON[_0x3188('0x13')](_0x5b7f47));return rp(_0x5b7f47);}function getCustomFields(_0x43b69,_0x5b968e){var _0x44aca9={};if(_0x43b69[_0x3188('0x14')]>0x0){_['forEach'](_0x43b69,function(_0x5c029f){if(_0x5c029f[_0x3188('0x15')]===_0x3188('0x16')&&_0x5c029f[_0x3188('0x17')]){_0x44aca9[_0x5c029f[_0x3188('0x17')]]=_0x5c029f[_0x3188('0x18')][_0x3188('0x19')]();}else if(_0x5c029f['type']===_0x3188('0x1a')&&_0x5c029f['variableName']&&_0x5c029f['idField']&&_0x5b968e[_0x5c029f[_0x3188('0x1b')]]){_0x44aca9[_0x5c029f['idField']]=_0x5b968e[_0x5c029f['variableName']][_0x3188('0x19')]();}else if(_0x5c029f[_0x3188('0x15')]===_0x3188('0x1c')&&_0x5c029f[_0x3188('0x1d')]&&_0x5c029f[_0x3188('0x1d')][_0x3188('0x1e')]&&_0x5c029f['idField']&&_0x5b968e[_0x5c029f[_0x3188('0x1d')][_0x3188('0x1e')][_0x3188('0x1f')]()]){_0x44aca9[_0x5c029f[_0x3188('0x17')]]=_0x5b968e[_0x5c029f[_0x3188('0x1d')][_0x3188('0x1e')][_0x3188('0x1f')]()][_0x3188('0x19')]();}});}return _0x44aca9;}function getName(_0x5bcbba){if(_0x5bcbba[_0x3188('0x20')]('\x20')>0x0){var _0x36050a=_0x5bcbba['split'](/ (.+)/);if(_0x36050a[0x1]){return _0x36050a;}}return[_0x5bcbba,_0x5bcbba];}var accountsTokens={};function getAccessToken(_0x518b2f){return new Promise(function(_0x5d8d62,_0x46a318){if(!_[_0x3188('0x21')](accountsTokens[_0x518b2f['id']])&&!_[_0x3188('0x21')](accountsTokens[_0x518b2f['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x518b2f['id']][_0x3188('0x22')])){_0x5d8d62(accountsTokens[_0x518b2f['id']][_0x3188('0x23')]);}}var _0x375077;switch(_0x518b2f[_0x3188('0x24')]){case'US':_0x375077=_0x3188('0x25');break;case'AU':_0x375077='https://accounts.zoho.eu.au';break;case'EU':_0x375077=_0x3188('0x25');break;case'IN':_0x375077=_0x3188('0x26');break;case'CN':_0x375077='https://accounts.zoho.com.cn';break;default:_0x375077=_0x3188('0x25');break;}var _0x4be6c3={'method':'POST','uri':_0x375077+_0x3188('0x27'),'qs':{'refresh_token':_0x518b2f[_0x3188('0x28')],'client_id':_0x518b2f[_0x3188('0x29')],'client_secret':_0x518b2f[_0x3188('0x2a')],'grant_type':_0x3188('0x2b')},'json':!![]};return rp(_0x4be6c3)[_0x3188('0x2c')](function(_0xe57f73){console[_0x3188('0x2d')]('creo\x20nuovo\x20access\x20token');accountsTokens[_0x518b2f['id']]={'access_token':_0xe57f73[_0x3188('0x23')],'expires_in':moment()[_0x3188('0x2e')](_0xe57f73['expires_in'],_0x3188('0x2f'))};_0x5d8d62(_0xe57f73[_0x3188('0x23')]);})[_0x3188('0x30')](function(_0x44db9a){logger[_0x3188('0x31')](_0x3188('0x32'),_0x44db9a[_0x3188('0x33')]);_0x46a318(_0x44db9a);});});}function getUser(_0x472926,_0x57c21c,_0x44fa15,_0x5d97d0){logger[_0x3188('0x34')]('Search\x20user');return request({'method':_0x3188('0x35'),'uri':util[_0x3188('0x36')](_0x3188('0x37'),_0x57c21c),'qs':{'type':_0x3188('0x38')},'headers':{'Authorization':_0x3188('0x39')+_0x472926},'json':!![]})[_0x3188('0x2c')](function(_0x2461e2){if(_0x2461e2[_0x3188('0x3a')]){var _0x3188a1;if(_[_0x3188('0x3b')](_0x2461e2[_0x3188('0x3a')])){if(!_[_0x3188('0x21')](_0x5d97d0)){_0x3188a1=_[_0x3188('0x3c')](_0x2461e2[_0x3188('0x3a')],function(_0xc3f30b){return _0xc3f30b[_0x3188('0x3d')]===_0x5d97d0&&_0xc3f30b[_0x3188('0x3e')][_0x3188('0x1e')]==='Standard'&&_0xc3f30b[_0x3188('0x3f')]==='active';});}if(!_[_0x3188('0x21')](_0x3188a1)){logger[_0x3188('0x34')]('Agent\x20found!');}else{logger[_0x3188('0x34')](_0x3188('0x40'));_0x3188a1=_[_0x3188('0x3c')](_0x2461e2[_0x3188('0x3a')],function(_0xa14c93){return _0xa14c93[_0x3188('0x3e')][_0x3188('0x1e')]==='Administrator';});}return _0x3188a1;}else{if(_0x2461e2['user'][_0x3188('0x3e')][_0x3188('0x1e')]===_0x3188('0x41')){logger[_0x3188('0x34')]('Using\x20the\x20admin\x20account!');_0x3188a1=_0x2461e2[_0x3188('0x42')];return _0x3188a1;}else{logger[_0x3188('0x31')](_0x3188('0x43'),JSON[_0x3188('0x13')](_0x2461e2));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x3188('0x13')](_0x2461e2));}}}else{logger['error'](_0x3188('0x43'),JSON['stringify'](_0x2461e2));throw new Error(_0x3188('0x44')+JSON[_0x3188('0x13')](_0x2461e2));}})[_0x3188('0x30')](function(_0x2990c4){console[_0x3188('0x31')](_0x2990c4);});}function getEndUser(_0x2305bf,_0x4666b2,_0xa8443,_0x6fa7e4,_0x138d90){logger['info'](_0x3188('0x45'));return request({'method':_0x3188('0x35'),'uri':_0x3188('0x46')+_0x4666b2+_0x3188('0x47')+_0x138d90+'))','headers':{'Authorization':_0x3188('0x39')+_0x2305bf},'json':!![]})[_0x3188('0x2c')](function(_0x5a815d){if(_0x5a815d){var _0x6b2347=_0x5a815d['data'][0x0];return _0x6b2347;}else{return request({'method':_0x3188('0x35'),'uri':_0x3188('0x46')+_0x4666b2+_0x3188('0x48')+_0x138d90+'))','headers':{'Authorization':_0x3188('0x39')+_0x2305bf},'json':!![]})[_0x3188('0x2c')](function(_0x549ab2){if(_0x549ab2){var _0x484eeb=_0x549ab2['data'][0x0];return _0x484eeb;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');_0x6fa7e4=getName(_0x6fa7e4);return request({'method':_0x3188('0x49'),'uri':_0x3188('0x46')+_0x4666b2+_0x3188('0x4a'),'body':{'data':[{'Last_Name':_0x6fa7e4[0x1],'First_Name':_0x6fa7e4[0x0],'Phone':_0x138d90}]},'headers':{'Authorization':_0x3188('0x39')+_0x2305bf},'json':!![]})[_0x3188('0x2c')](function(_0x599345){if(_0x599345&&_0x599345[_0x3188('0x4b')][0x0]['code']===_0x3188('0x4c')){var _0x4fc779=_0x599345[_0x3188('0x4b')][0x0][_0x3188('0x4d')];return _0x4fc779;}logger['error'](_0x3188('0x43'),JSON[_0x3188('0x13')](_0x599345));throw new Error(_0x3188('0x4e')+JSON[_0x3188('0x13')](_0x599345));});}});}});}function getCall(_0x42d365,_0x4a0a14,_0x57e795,_0x24aee2,_0x24bc8a,_0x59371c,_0x179b00,_0x2934e8){logger['info'](_0x3188('0x4f'));var _0x16a9d3={};_0x16a9d3[_0x3188('0x50')]={'name':!_[_0x3188('0x21')](_0x24aee2[_0x3188('0x51')]['name'])?_0x24aee2[_0x3188('0x51')]['name']:!_[_0x3188('0x21')](_0x24aee2[_0x3188('0x52')])?_0x24aee2[_0x3188('0x52')]+'\x20'+_0x24aee2[_0x3188('0x53')]:_0x24aee2[_0x3188('0x53')],'id':_0x24aee2['id']};_0x16a9d3[_0x3188('0x54')]=intUtil[_0x3188('0x55')](_0x59371c[_0x3188('0x56')],_0x179b00,'\x20');_0x16a9d3[_0x3188('0x57')]=intUtil[_0x3188('0x55')](_0x59371c[_0x3188('0x58')],_0x179b00,'\x0a');_0x16a9d3['WhoId']={'name':_0x24bc8a['Full_Name']!==undefined?_0x24bc8a[_0x3188('0x59')]:_0x24bc8a['First_Name']+'\x20'+_0x24bc8a[_0x3188('0x5a')],'id':_0x24bc8a['id']};if(_0x179b00[_0x3188('0x5b')]){_0x16a9d3['Call_Duration']=moment[_0x3188('0x5c')](parseInt(_0x179b00[_0x3188('0x5b')])*0x3e8)[_0x3188('0x36')](_0x3188('0x5d'));}else if(_0x179b00[_0x3188('0x5e')]&&_0x179b00[_0x3188('0x5f')]){_0x16a9d3[_0x3188('0x60')]=moment[_0x3188('0x5c')](moment(_0x179b00['endtime'],_0x3188('0x61'))[_0x3188('0x62')](moment(_0x179b00['starttime'],_0x3188('0x61'))))['format'](_0x3188('0x5d'));}switch(_0x179b00[_0x3188('0x63')]){case _0x3188('0x64'):_0x16a9d3['Call_Result']='Called';break;case'complete':case'connect':_0x16a9d3['Call_Result']=_0x3188('0x65');break;case _0x3188('0x66'):_0x16a9d3['Call_Result']=_0x3188('0x67');break;case _0x3188('0x68'):_0x16a9d3['Call_Result']='Abandoned';break;default:}_0x16a9d3['Call_Start_Time']=(_0x2934e8==='outbound'?moment(_0x179b00['starttime'])[_0x3188('0x36')](_0x3188('0x61')):moment(_0x179b00[_0x3188('0x69')])[_0x3188('0x36')](_0x3188('0x61')))||moment()['format'](_0x3188('0x61'));_0x16a9d3[_0x3188('0x6a')]=_0x2934e8||'Inbound';_0x16a9d3=_['merge'](_0x16a9d3,getCustomFields(_0x59371c['Fields'],_0x179b00));return request({'method':_0x3188('0x49'),'uri':_0x3188('0x46')+_0x4a0a14+_0x3188('0x6b'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x42d365},'body':{'data':[_0x16a9d3]},'json':!![]})[_0x3188('0x2c')](function(_0xb90c2d){if(_0xb90c2d&&_0xb90c2d[_0x3188('0x4b')][0x0][_0x3188('0x6c')]===_0x3188('0x4c')){logger['info'](_0x3188('0x6d'));return{'id':_0xb90c2d[_0x3188('0x4b')][0x0][_0x3188('0x4d')]['id']};}})['catch'](function(_0x411d7b){console[_0x3188('0x2d')](_0x3188('0x6e'),_0x411d7b);});}exports[_0x3188('0x6f')]=function(_0x59249f,_0x33d751,_0x3808c3,_0xcda28a,_0x19a36b,_0x674151){var _0x1b8c54,_0x36baff,_0x5bdbe8;_0x674151[_0x3188('0x70')]=intUtil[_0x3188('0x71')](_0x674151[_0x3188('0x70')]);_0x674151[_0x3188('0x72')]=intUtil[_0x3188('0x71')](_0x674151[_0x3188('0x72')]);if(_0x19a36b&&_0x19a36b[_0x3188('0x73')]){logger['info'](_0x3188('0x74'),_0x3188('0x75'));_0x33d751[_0x3188('0x76')]=_0x674151[_0x3188('0x72')]+_0x3188('0x77')+_0x33d751['uniqueid']+_0x3188('0x78')+md5(_0x33d751[_0x3188('0x79')]);}else{_0x33d751['recordingURL']='';}var _0x4e4d50=_0x674151[_0x3188('0x70')]===_0x3188('0x7a')?'eu':_0x3188('0x7b');return getAccessToken(_0x674151)[_0x3188('0x2c')](function(_0x3964fb){_0x5bdbe8=_0x3964fb;return getUser(_0x5bdbe8,_0x4e4d50,_0x674151,_0xcda28a[_0x3188('0x3d')]);})[_0x3188('0x2c')](function(_0x3dd381){_0x1b8c54=_0x3dd381;logger[_0x3188('0x34')](_0x3188('0x7c'),_0x1b8c54['id']);return getEndUser(_0x5bdbe8,_0x4e4d50,_0x674151,_0x33d751['calleridname'],_0x33d751[_0x3188('0x7d')]);})['then'](function(_0x4c90ff){_0x36baff=_0x4c90ff;logger[_0x3188('0x34')]('The\x20Enduser\x20ID\x20is:',_0x36baff['id']);return getCall(_0x5bdbe8,_0x4e4d50,_0x674151,_0x1b8c54,_0x36baff,_0x3808c3,_0x33d751,_0x3188('0x7e'));})[_0x3188('0x2c')](function(_0x7aa116){if(_0x7aa116){logger[_0x3188('0x34')](_0x3188('0x7f'),_0x7aa116['id']);logger[_0x3188('0x34')]('[QUEUE]',_0x3188('0x80'));emit(util[_0x3188('0x36')]('user:%s',_0xcda28a[_0x3188('0x1e')]),_0x3188('0x81'),{'uri':_0x3188('0x82')+_0x674151[_0x3188('0x70')]+_0x3188('0x83')+_0x7aa116['id']});}})[_0x3188('0x30')](function(_0x54f790){logger[_0x3188('0x31')](_0x3188('0x74'),JSON['stringify'](_0x54f790));});};exports[_0x3188('0x84')]=function(_0x88feb4,_0x114ca9,_0x48eec5,_0x16008a,_0xfebf94,_0x45f9dc,_0x33cd4b){var _0x3698ab,_0x1bfd9b,_0x192874;_0x45f9dc['host']=intUtil['stripTrailingSlash'](_0x45f9dc['host']);_0x45f9dc['serverUrl']=intUtil[_0x3188('0x71')](_0x45f9dc[_0x3188('0x72')]);if(_0x33cd4b&&_0x33cd4b[_0x3188('0x85')]&&_0x33cd4b[_0x3188('0x85')]!==_0x3188('0x86')){logger['info'](_0x3188('0x87'),'Recording\x20is\x20enabled!');_0x114ca9[_0x3188('0x76')]=_0x45f9dc[_0x3188('0x72')]+'/api/voice/recordings/'+_0x114ca9[_0x3188('0x79')]+'/downloads?type=uniqueid&token='+md5(_0x114ca9[_0x3188('0x79')]);}var _0x1a7c3b=_0x45f9dc['host']===_0x3188('0x7a')?'eu':'com';return getAccessToken(_0x45f9dc)[_0x3188('0x2c')](function(_0x1a7df0){_0x192874=_0x1a7df0;return getUser(_0x192874,_0x1a7c3b,_0x45f9dc,_0x16008a[_0x3188('0x3d')]);})[_0x3188('0x2c')](function(_0x37f6a0){_0x3698ab=_0x37f6a0;logger['info'](_0x3188('0x7c'),_0x3698ab['id']);return getEndUser(_0x192874,_0x1a7c3b,_0x45f9dc,_0x114ca9[_0x3188('0x88')],_0x114ca9['destcalleridnum']);})[_0x3188('0x2c')](function(_0x12dc3b){_0x1bfd9b=_0x12dc3b;logger['info']('The\x20Enduser\x20ID\x20is:',_0x1bfd9b['id']);return getCall(_0x192874,_0x1a7c3b,_0x45f9dc,_0x3698ab,_0x1bfd9b,_0x48eec5,_0x114ca9,_0x3188('0x89'));})[_0x3188('0x2c')](function(_0x1c98d1){if(_0x1c98d1){logger[_0x3188('0x34')](_0x3188('0x7f'),_0x1c98d1['id']);logger[_0x3188('0x34')]('[OUTBOUND]',_0x3188('0x80'));emit(util[_0x3188('0x36')](_0x3188('0x8a'),_0x16008a['name']),_0x3188('0x81'),{'uri':_0x3188('0x82')+_0x45f9dc[_0x3188('0x70')]+_0x3188('0x83')+_0x1c98d1['id']});}})[_0x3188('0x30')](function(_0xa0f9fa){logger['error']('[OUTBOUND]',JSON['stringify'](_0xa0f9fa));});};exports[_0x3188('0x68')]=function(_0x65641b,_0x52c0d5,_0x2dfb7d,_0x37da22,_0x1a914d,_0x16bdc2){var _0x1a0562,_0x2604ef,_0x5f33eb;_0x16bdc2[_0x3188('0x70')]=intUtil[_0x3188('0x71')](_0x16bdc2[_0x3188('0x70')]);_0x16bdc2[_0x3188('0x72')]=intUtil[_0x3188('0x71')](_0x16bdc2[_0x3188('0x72')]);if(_0x1a914d&&_0x1a914d[_0x3188('0x73')]){logger[_0x3188('0x34')](_0x3188('0x8b'),_0x3188('0x75'));_0x52c0d5[_0x3188('0x76')]=_0x16bdc2[_0x3188('0x72')]+_0x3188('0x77')+_0x52c0d5[_0x3188('0x79')]+_0x3188('0x78')+md5(_0x52c0d5[_0x3188('0x79')]);}else{_0x52c0d5[_0x3188('0x76')]='';}var _0x2fca3a=_0x16bdc2['host']===_0x3188('0x7a')?'eu':_0x3188('0x7b');return getAccessToken(_0x16bdc2)[_0x3188('0x2c')](function(_0x24246d){_0x5f33eb=_0x24246d;return getUser(_0x5f33eb,_0x2fca3a,_0x16bdc2);})[_0x3188('0x2c')](function(_0x56ccd9){_0x1a0562=_0x56ccd9;logger[_0x3188('0x34')](_0x3188('0x7c'),_0x1a0562['id']);return getEndUser(_0x5f33eb,_0x2fca3a,_0x16bdc2,_0x52c0d5['calleridname'],_0x52c0d5[_0x3188('0x7d')]);})[_0x3188('0x2c')](function(_0x43212c){_0x2604ef=_0x43212c;logger['info'](_0x3188('0x8c'),_0x2604ef['id']);return getCall(_0x5f33eb,_0x2fca3a,_0x16bdc2,_0x1a0562,_0x2604ef,_0x2dfb7d,_0x52c0d5,'Inbound');})[_0x3188('0x2c')](function(_0xa3c405){if(_0xa3c405){logger[_0x3188('0x34')](_0x3188('0x7f'),_0xa3c405['id']);}})[_0x3188('0x30')](function(_0x31363e){logger['error']('[ABANDONED]',JSON[_0x3188('0x13')](_0x31363e));});}; \ No newline at end of file +var _0xadb5=['agentcalledAt','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','queue','stripTrailingSlash','host','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Call\x20ID\x20is:','user:%s','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','trigger:browser:url','https://crm.','/downloads?type=uniqueid&token=','[ABANDONED]','request-promise','util','./util','xml2json','moment','ioredis','../../../../config/environment','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','length','string','idField','content','toString','variable','variableName','type','customVariable','Variable','name','split','isNil','expires_in','access_token','zone','https://accounts.zoho.eu','https://accounts.zoho.eu.au','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','then','log','add','seconds','catch','stack','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','find','email','profile','status','active','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','info','error','stringify','The\x20failing\x20result\x20is','Search\x20end\x20user','data','https://www.zohoapis.','/crm/v2/Leads/search?criteria=((Phone:equals:','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','/crm/v2/Contacts','code','SUCCESS','details','Error\x20on\x20Lead\x20retrieve:\x20','Creating\x20new\x20call...','Owner','role','first_name','last_name','Subject','getString','Subjects','Full_Name','First_Name','Last_Name','Call_Duration','talktime','mm:ss','endtime','utc','diff','starttime','YYYY-MM-DDTHH:mm:ss','called','Call_Result','Called','complete','Answered','rejected','Rejected','abandoned','Abandoned','outbound'];(function(_0x12f42c,_0x415b84){var _0xbcf616=function(_0x242128){while(--_0x242128){_0x12f42c['push'](_0x12f42c['shift']());}};_0xbcf616(++_0x415b84);}(_0xadb5,0xad));var _0x5adb=function(_0x3dc949,_0x472ac9){_0x3dc949=_0x3dc949-0x0;var _0x1cc5d8=_0xadb5[_0x3dc949];return _0x1cc5d8;};'use strict';var _=require('lodash');var rp=require(_0x5adb('0x0'));var md5=require('md5');var util=require(_0x5adb('0x1'));var intUtil=require(_0x5adb('0x2'));var parser=require(_0x5adb('0x3'));var entities=require('entities');var moment=require(_0x5adb('0x4'));var Redis=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var logger=require('../../../../config/logger')(_0x5adb('0x7'));config[_0x5adb('0x8')]=_[_0x5adb('0x9')](config[_0x5adb('0x8')],{'host':_0x5adb('0xa'),'port':0x18eb});var io=require(_0x5adb('0xb'))(new Redis(config[_0x5adb('0x8')]));function emit(_0x6d1b45,_0x41261c,_0x7293ab){io['to'](_0x6d1b45)[_0x5adb('0xc')](_0x41261c,_0x7293ab);}function request(_0x336bad){logger[_0x5adb('0xd')](_0x5adb('0xe'),JSON['stringify'](_0x336bad));return rp(_0x336bad);}function getCustomFields(_0x4c268d,_0x1a8f66){var _0x1ea238={};if(_0x4c268d[_0x5adb('0xf')]>0x0){_['forEach'](_0x4c268d,function(_0x29f0d5){if(_0x29f0d5['type']===_0x5adb('0x10')&&_0x29f0d5['idField']){_0x1ea238[_0x29f0d5[_0x5adb('0x11')]]=_0x29f0d5[_0x5adb('0x12')][_0x5adb('0x13')]();}else if(_0x29f0d5['type']===_0x5adb('0x14')&&_0x29f0d5[_0x5adb('0x15')]&&_0x29f0d5[_0x5adb('0x11')]&&_0x1a8f66[_0x29f0d5['variableName']]){_0x1ea238[_0x29f0d5[_0x5adb('0x11')]]=_0x1a8f66[_0x29f0d5['variableName']][_0x5adb('0x13')]();}else if(_0x29f0d5[_0x5adb('0x16')]===_0x5adb('0x17')&&_0x29f0d5[_0x5adb('0x18')]&&_0x29f0d5[_0x5adb('0x18')][_0x5adb('0x19')]&&_0x29f0d5[_0x5adb('0x11')]&&_0x1a8f66[_0x29f0d5[_0x5adb('0x18')][_0x5adb('0x19')]['toLowerCase']()]){_0x1ea238[_0x29f0d5[_0x5adb('0x11')]]=_0x1a8f66[_0x29f0d5['Variable'][_0x5adb('0x19')]['toLowerCase']()][_0x5adb('0x13')]();}});}return _0x1ea238;}function getName(_0x50e84f){if(_0x50e84f['indexOf']('\x20')>0x0){var _0x1fbaa5=_0x50e84f[_0x5adb('0x1a')](/ (.+)/);if(_0x1fbaa5[0x1]){return _0x1fbaa5;}}return[_0x50e84f,_0x50e84f];}var accountsTokens={};function getAccessToken(_0x438671){return new Promise(function(_0x1fd4a7,_0x99bc6c){if(!_['isNil'](accountsTokens[_0x438671['id']])&&!_[_0x5adb('0x1b')](accountsTokens[_0x438671['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x438671['id']][_0x5adb('0x1c')])){_0x1fd4a7(accountsTokens[_0x438671['id']][_0x5adb('0x1d')]);}}var _0x1a38d3;switch(_0x438671[_0x5adb('0x1e')]){case'US':_0x1a38d3=_0x5adb('0x1f');break;case'AU':_0x1a38d3=_0x5adb('0x20');break;case'EU':_0x1a38d3=_0x5adb('0x1f');break;case'IN':_0x1a38d3='https://accounts.zoho.in';break;case'CN':_0x1a38d3=_0x5adb('0x21');break;default:_0x1a38d3=_0x5adb('0x1f');break;}var _0x3220cd={'method':_0x5adb('0x22'),'uri':_0x1a38d3+_0x5adb('0x23'),'qs':{'refresh_token':_0x438671['refreshToken'],'client_id':_0x438671[_0x5adb('0x24')],'client_secret':_0x438671[_0x5adb('0x25')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x3220cd)[_0x5adb('0x26')](function(_0x1ded9f){console[_0x5adb('0x27')]('creo\x20nuovo\x20access\x20token');accountsTokens[_0x438671['id']]={'access_token':_0x1ded9f[_0x5adb('0x1d')],'expires_in':moment()[_0x5adb('0x28')](_0x1ded9f[_0x5adb('0x1c')],_0x5adb('0x29'))};_0x1fd4a7(_0x1ded9f[_0x5adb('0x1d')]);})[_0x5adb('0x2a')](function(_0x4a5d46){logger['error']('Failing\x20creating\x20the\x20access_token',_0x4a5d46[_0x5adb('0x2b')]);_0x99bc6c(_0x4a5d46);});});}function getUser(_0x1eac55,_0x60a672,_0x512bab,_0x137a5c){logger['info'](_0x5adb('0x2c'));return request({'method':_0x5adb('0x2d'),'uri':util[_0x5adb('0x2e')](_0x5adb('0x2f'),_0x60a672),'qs':{'type':_0x5adb('0x30')},'headers':{'Authorization':_0x5adb('0x31')+_0x1eac55},'json':!![]})[_0x5adb('0x26')](function(_0x28bf1f){if(_0x28bf1f[_0x5adb('0x32')]){var _0x260295;if(_['isArrayLikeObject'](_0x28bf1f[_0x5adb('0x32')])){if(!_['isNil'](_0x137a5c)){_0x260295=_[_0x5adb('0x33')](_0x28bf1f[_0x5adb('0x32')],function(_0x5d1441){return _0x5d1441[_0x5adb('0x34')]===_0x137a5c&&_0x5d1441[_0x5adb('0x35')][_0x5adb('0x19')]==='Standard'&&_0x5d1441[_0x5adb('0x36')]===_0x5adb('0x37');});}if(!_['isNil'](_0x260295)){logger['info'](_0x5adb('0x38'));}else{logger['info'](_0x5adb('0x39'));_0x260295=_[_0x5adb('0x33')](_0x28bf1f[_0x5adb('0x32')],function(_0x2da912){return _0x2da912[_0x5adb('0x35')]['name']===_0x5adb('0x3a');});}return _0x260295;}else{if(_0x28bf1f[_0x5adb('0x3b')][_0x5adb('0x35')]['name']==='Administrator'){logger[_0x5adb('0x3c')](_0x5adb('0x39'));_0x260295=_0x28bf1f['user'];return _0x260295;}else{logger[_0x5adb('0x3d')]('The\x20failing\x20result\x20is',JSON[_0x5adb('0x3e')](_0x28bf1f));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x5adb('0x3e')](_0x28bf1f));}}}else{logger['error'](_0x5adb('0x3f'),JSON[_0x5adb('0x3e')](_0x28bf1f));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x5adb('0x3e')](_0x28bf1f));}})['catch'](function(_0xadbe37){console[_0x5adb('0x3d')](_0xadbe37);});}function getEndUser(_0xd5660c,_0x50edd1,_0x425dc7,_0x2b3b0b,_0xcdaf8e){logger[_0x5adb('0x3c')](_0x5adb('0x40'));return request({'method':'GET','uri':'https://www.zohoapis.'+_0x50edd1+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0xcdaf8e+'))','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xd5660c},'json':!![]})[_0x5adb('0x26')](function(_0x2fbe14){if(_0x2fbe14){var _0x3a104a=_0x2fbe14[_0x5adb('0x41')][0x0];return _0x3a104a;}else{return request({'method':_0x5adb('0x2d'),'uri':_0x5adb('0x42')+_0x50edd1+_0x5adb('0x43')+_0xcdaf8e+'))','headers':{'Authorization':_0x5adb('0x31')+_0xd5660c},'json':!![]})['then'](function(_0x53f2c6){if(_0x53f2c6){var _0x27dbb7=_0x53f2c6['data'][0x0];return _0x27dbb7;}else{logger[_0x5adb('0x3c')](_0x5adb('0x44'));_0x2b3b0b=getName(_0x2b3b0b);return request({'method':_0x5adb('0x22'),'uri':_0x5adb('0x42')+_0x50edd1+_0x5adb('0x45'),'body':{'data':[{'Last_Name':_0x2b3b0b[0x1],'First_Name':_0x2b3b0b[0x0],'Phone':_0xcdaf8e}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xd5660c},'json':!![]})[_0x5adb('0x26')](function(_0x565b03){if(_0x565b03&&_0x565b03['data'][0x0][_0x5adb('0x46')]===_0x5adb('0x47')){var _0x5833c8=_0x565b03[_0x5adb('0x41')][0x0][_0x5adb('0x48')];return _0x5833c8;}logger[_0x5adb('0x3d')](_0x5adb('0x3f'),JSON[_0x5adb('0x3e')](_0x565b03));throw new Error(_0x5adb('0x49')+JSON[_0x5adb('0x3e')](_0x565b03));});}});}});}function getCall(_0x4b0d1d,_0x5bfd74,_0x26a656,_0x37f230,_0x1cd0a3,_0xb79d85,_0x57b8af,_0x507e48){logger[_0x5adb('0x3c')](_0x5adb('0x4a'));var _0x264dfd={};_0x264dfd[_0x5adb('0x4b')]={'name':!_[_0x5adb('0x1b')](_0x37f230['role'][_0x5adb('0x19')])?_0x37f230[_0x5adb('0x4c')]['name']:!_[_0x5adb('0x1b')](_0x37f230[_0x5adb('0x4d')])?_0x37f230[_0x5adb('0x4d')]+'\x20'+_0x37f230[_0x5adb('0x4e')]:_0x37f230[_0x5adb('0x4e')],'id':_0x37f230['id']};_0x264dfd[_0x5adb('0x4f')]=intUtil[_0x5adb('0x50')](_0xb79d85[_0x5adb('0x51')],_0x57b8af,'\x20');_0x264dfd['Description']=intUtil[_0x5adb('0x50')](_0xb79d85['Descriptions'],_0x57b8af,'\x0a');_0x264dfd['WhoId']={'name':_0x1cd0a3['Full_Name']!==undefined?_0x1cd0a3[_0x5adb('0x52')]:_0x1cd0a3[_0x5adb('0x53')]+'\x20'+_0x1cd0a3[_0x5adb('0x54')],'id':_0x1cd0a3['id']};if(_0x57b8af['talktime']){_0x264dfd[_0x5adb('0x55')]=moment['utc'](parseInt(_0x57b8af[_0x5adb('0x56')])*0x3e8)[_0x5adb('0x2e')](_0x5adb('0x57'));}else if(_0x57b8af['answertime']&&_0x57b8af[_0x5adb('0x58')]){_0x264dfd['Call_Duration']=moment[_0x5adb('0x59')](moment(_0x57b8af[_0x5adb('0x58')],'YYYY-MM-DDTHH:mm:ss')[_0x5adb('0x5a')](moment(_0x57b8af[_0x5adb('0x5b')],_0x5adb('0x5c'))))[_0x5adb('0x2e')](_0x5adb('0x57'));}switch(_0x57b8af['lastevent']){case _0x5adb('0x5d'):_0x264dfd[_0x5adb('0x5e')]=_0x5adb('0x5f');break;case _0x5adb('0x60'):case'connect':_0x264dfd[_0x5adb('0x5e')]=_0x5adb('0x61');break;case _0x5adb('0x62'):_0x264dfd['Call_Result']=_0x5adb('0x63');break;case _0x5adb('0x64'):_0x264dfd[_0x5adb('0x5e')]=_0x5adb('0x65');break;default:}_0x264dfd['Call_Start_Time']=(_0x507e48===_0x5adb('0x66')?moment(_0x57b8af[_0x5adb('0x5b')])[_0x5adb('0x2e')](_0x5adb('0x5c')):moment(_0x57b8af[_0x5adb('0x67')])['format'](_0x5adb('0x5c')))||moment()['format'](_0x5adb('0x5c'));_0x264dfd['Call_Type']=_0x507e48||_0x5adb('0x68');_0x264dfd=_[_0x5adb('0x69')](_0x264dfd,getCustomFields(_0xb79d85[_0x5adb('0x6a')],_0x57b8af));return request({'method':_0x5adb('0x22'),'uri':'https://www.zohoapis.'+_0x5bfd74+_0x5adb('0x6b'),'headers':{'Authorization':_0x5adb('0x31')+_0x4b0d1d},'body':{'data':[_0x264dfd]},'json':!![]})[_0x5adb('0x26')](function(_0x53d262){if(_0x53d262&&_0x53d262['data'][0x0]['code']===_0x5adb('0x47')){logger[_0x5adb('0x3c')](_0x5adb('0x6c'));return{'id':_0x53d262[_0x5adb('0x41')][0x0][_0x5adb('0x48')]['id']};}})[_0x5adb('0x2a')](function(_0x204b9b){console[_0x5adb('0x27')](_0x5adb('0x6d'),_0x204b9b);});}exports[_0x5adb('0x6e')]=function(_0x452767,_0x1df439,_0x2c2357,_0x511746,_0x49f4c8,_0x3d55c2){var _0x27a8e4,_0x43cde9,_0xdb7d8f;_0x3d55c2['host']=intUtil[_0x5adb('0x6f')](_0x3d55c2[_0x5adb('0x70')]);_0x3d55c2['serverUrl']=intUtil[_0x5adb('0x6f')](_0x3d55c2[_0x5adb('0x71')]);if(_0x49f4c8&&_0x49f4c8[_0x5adb('0x72')]){logger['info'](_0x5adb('0x73'),_0x5adb('0x74'));_0x1df439[_0x5adb('0x75')]=_0x3d55c2[_0x5adb('0x71')]+_0x5adb('0x76')+_0x1df439[_0x5adb('0x77')]+'/downloads?type=uniqueid&token='+md5(_0x1df439[_0x5adb('0x77')]);}else{_0x1df439[_0x5adb('0x75')]='';}var _0x4488e7=_0x3d55c2['host']===_0x5adb('0x78')?'eu':_0x5adb('0x79');return getAccessToken(_0x3d55c2)[_0x5adb('0x26')](function(_0x4f6107){_0xdb7d8f=_0x4f6107;return getUser(_0xdb7d8f,_0x4488e7,_0x3d55c2,_0x511746[_0x5adb('0x34')]);})['then'](function(_0xa8ff64){_0x27a8e4=_0xa8ff64;logger[_0x5adb('0x3c')](_0x5adb('0x7a'),_0x27a8e4['id']);return getEndUser(_0xdb7d8f,_0x4488e7,_0x3d55c2,_0x1df439['calleridname'],_0x1df439[_0x5adb('0x7b')]);})[_0x5adb('0x26')](function(_0x539814){_0x43cde9=_0x539814;logger[_0x5adb('0x3c')](_0x5adb('0x7c'),_0x43cde9['id']);return getCall(_0xdb7d8f,_0x4488e7,_0x3d55c2,_0x27a8e4,_0x43cde9,_0x2c2357,_0x1df439,_0x5adb('0x68'));})[_0x5adb('0x26')](function(_0x55cd0a){if(_0x55cd0a){logger[_0x5adb('0x3c')](_0x5adb('0x7d'),_0x55cd0a['id']);logger[_0x5adb('0x3c')](_0x5adb('0x73'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x5adb('0x7e'),_0x511746['name']),'trigger:browser:url',{'uri':'https://crm.'+_0x3d55c2[_0x5adb('0x70')]+_0x5adb('0x7f')+_0x55cd0a['id']});}})['catch'](function(_0x395350){logger[_0x5adb('0x3d')](_0x5adb('0x73'),JSON[_0x5adb('0x3e')](_0x395350));});};exports[_0x5adb('0x66')]=function(_0x126e38,_0x460d20,_0x1ffcd3,_0x5240c1,_0x4b9e80,_0x58112b,_0x347b7b){var _0x4357a6,_0x3a0d1b,_0x2a55a3;_0x58112b[_0x5adb('0x70')]=intUtil[_0x5adb('0x6f')](_0x58112b[_0x5adb('0x70')]);_0x58112b[_0x5adb('0x71')]=intUtil['stripTrailingSlash'](_0x58112b['serverUrl']);if(_0x347b7b&&_0x347b7b[_0x5adb('0x80')]&&_0x347b7b[_0x5adb('0x80')]!==_0x5adb('0x81')){logger[_0x5adb('0x3c')](_0x5adb('0x82'),_0x5adb('0x74'));_0x460d20[_0x5adb('0x75')]=_0x58112b[_0x5adb('0x71')]+_0x5adb('0x76')+_0x460d20[_0x5adb('0x77')]+'/downloads?type=uniqueid&token='+md5(_0x460d20[_0x5adb('0x77')]);}var _0x294a24=_0x58112b[_0x5adb('0x70')]==='zoho.eu'?'eu':_0x5adb('0x79');return getAccessToken(_0x58112b)[_0x5adb('0x26')](function(_0x4f7bd0){_0x2a55a3=_0x4f7bd0;return getUser(_0x2a55a3,_0x294a24,_0x58112b,_0x5240c1[_0x5adb('0x34')]);})['then'](function(_0x473538){_0x4357a6=_0x473538;logger[_0x5adb('0x3c')]('The\x20User\x20ID\x20is:',_0x4357a6['id']);return getEndUser(_0x2a55a3,_0x294a24,_0x58112b,_0x460d20[_0x5adb('0x83')],_0x460d20[_0x5adb('0x84')]);})[_0x5adb('0x26')](function(_0x20e356){_0x3a0d1b=_0x20e356;logger[_0x5adb('0x3c')](_0x5adb('0x7c'),_0x3a0d1b['id']);return getCall(_0x2a55a3,_0x294a24,_0x58112b,_0x4357a6,_0x3a0d1b,_0x1ffcd3,_0x460d20,_0x5adb('0x85'));})[_0x5adb('0x26')](function(_0x49a8a6){if(_0x49a8a6){logger[_0x5adb('0x3c')](_0x5adb('0x7d'),_0x49a8a6['id']);logger[_0x5adb('0x3c')]('[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5adb('0x2e')]('user:%s',_0x5240c1[_0x5adb('0x19')]),_0x5adb('0x86'),{'uri':_0x5adb('0x87')+_0x58112b['host']+_0x5adb('0x7f')+_0x49a8a6['id']});}})[_0x5adb('0x2a')](function(_0x2e3df9){logger[_0x5adb('0x3d')](_0x5adb('0x82'),JSON['stringify'](_0x2e3df9));});};exports[_0x5adb('0x64')]=function(_0x4755fb,_0xcdd477,_0xe3d12d,_0x562ba4,_0x120dd3,_0x17194f){var _0x182873,_0x1e9cd1,_0x15d4f1;_0x17194f[_0x5adb('0x70')]=intUtil[_0x5adb('0x6f')](_0x17194f['host']);_0x17194f[_0x5adb('0x71')]=intUtil[_0x5adb('0x6f')](_0x17194f['serverUrl']);if(_0x120dd3&&_0x120dd3[_0x5adb('0x72')]){logger[_0x5adb('0x3c')]('[ABANDONED]',_0x5adb('0x74'));_0xcdd477['recordingURL']=_0x17194f[_0x5adb('0x71')]+_0x5adb('0x76')+_0xcdd477['uniqueid']+_0x5adb('0x88')+md5(_0xcdd477['uniqueid']);}else{_0xcdd477[_0x5adb('0x75')]='';}var _0x118968=_0x17194f[_0x5adb('0x70')]===_0x5adb('0x78')?'eu':_0x5adb('0x79');return getAccessToken(_0x17194f)['then'](function(_0x29faae){_0x15d4f1=_0x29faae;return getUser(_0x15d4f1,_0x118968,_0x17194f);})[_0x5adb('0x26')](function(_0x3f33c0){_0x182873=_0x3f33c0;logger[_0x5adb('0x3c')]('The\x20User\x20ID\x20is:',_0x182873['id']);return getEndUser(_0x15d4f1,_0x118968,_0x17194f,_0xcdd477['calleridname'],_0xcdd477[_0x5adb('0x7b')]);})[_0x5adb('0x26')](function(_0x2e5c96){_0x1e9cd1=_0x2e5c96;logger[_0x5adb('0x3c')](_0x5adb('0x7c'),_0x1e9cd1['id']);return getCall(_0x15d4f1,_0x118968,_0x17194f,_0x182873,_0x1e9cd1,_0xe3d12d,_0xcdd477,_0x5adb('0x68'));})[_0x5adb('0x26')](function(_0x514833){if(_0x514833){logger[_0x5adb('0x3c')](_0x5adb('0x7d'),_0x514833['id']);}})[_0x5adb('0x2a')](function(_0x43b3a8){logger['error'](_0x5adb('0x89'),JSON[_0x5adb('0x3e')](_0x43b3a8));});}; \ 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 e8e9a04..4262be1 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(_0xf73913,_0x49540c){var _0x504e9c=function(_0x11010a){while(--_0x11010a){_0xf73913['push'](_0xf73913['shift']());}};_0x504e9c(++_0x49540c);}(_0x7a54,0x106));var _0x47a5=function(_0x518625,_0xeb3df5){_0x518625=_0x518625-0x0;var _0x2db3e1=_0x7a54[_0x518625];return _0x2db3e1;};'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(_0x35aea3,_0x1d40f8){var _0x307f93=function(_0x515dad){while(--_0x515dad){_0x35aea3['push'](_0x35aea3['shift']());}};_0x307f93(++_0x1d40f8);}(_0x7a54,0x106));var _0x47a5=function(_0x566083,_0x4294a1){_0x566083=_0x566083-0x0;var _0x26a019=_0x7a54[_0x566083];return _0x26a019;};'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 44d93c9..1301a4e 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 _0xc6fe=['stringify','then',',\x20request\x20body:\x20','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','mustache','../../../../config/logger','trigger','data1','toUpperCase','render','data2','headers','data6','parse','error','stack','GET','POST','PUT','data7','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xc6fe,0xbc));var _0xec6f=function(_0x575402,_0x59c966){_0x575402=_0x575402-0x0;var _0xf59449=_0xc6fe[_0x575402];return _0xf59449;};'use strict';var rp=require(_0xec6f('0x0'));var util=require(_0xec6f('0x1'));var _=require('lodash');var Mustache=require(_0xec6f('0x2'));var logger=require(_0xec6f('0x3'))(_0xec6f('0x4'));exports['exec']=function(_0x41ed86,_0x540732){var _0x113ee0,_0x46e237;var _0x38572a={'method':_0x41ed86[_0xec6f('0x5')][_0xec6f('0x6')](),'uri':encodeURI(Mustache[_0xec6f('0x7')](_0x41ed86[_0xec6f('0x8')],_0x540732)),'json':!![],'resolveWithFullResponse':!![]};try{_0x38572a[_0xec6f('0x9')]=_0x41ed86[_0xec6f('0xa')]?JSON[_0xec6f('0xb')](Mustache['render'](_0x41ed86[_0xec6f('0xa')],_0x540732)):{};}catch(_0x2ae551){logger[_0xec6f('0xc')](_0x2ae551[_0xec6f('0xd')]);}switch(_0x41ed86[_0xec6f('0x5')][_0xec6f('0x6')]()){case _0xec6f('0xe'):_0x38572a['qs']=_0x540732;break;case _0xec6f('0xf'):case _0xec6f('0x10'):_0x113ee0={};if(_0x41ed86[_0xec6f('0x11')]){_0x113ee0=Mustache[_0xec6f('0x7')](_0x41ed86['data7'],_0x540732);}else{_0x113ee0=_0x540732;}_0x38572a[_0xec6f('0x12')]=JSON[_0xec6f('0xb')](_0x113ee0);break;}logger[_0xec6f('0x13')](util[_0xec6f('0x14')](_0xec6f('0x15'),_0x41ed86['data1'],_0x41ed86['data2'],JSON[_0xec6f('0x16')](_0x38572a)));rp(_0x38572a)[_0xec6f('0x17')](function(_0x5b8f52){_0x113ee0=!_['isNil'](_0x113ee0)?_0xec6f('0x18')+_0x113ee0:'';_0x46e237=typeof _0x5b8f52[_0xec6f('0x12')]==='object'?JSON['stringify'](_0x5b8f52[_0xec6f('0x12')]):_0x5b8f52[_0xec6f('0x12')];logger[_0xec6f('0x13')](util[_0xec6f('0x14')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x41ed86['data1'],_0x41ed86[_0xec6f('0x8')],_0x5b8f52[_0xec6f('0x19')],_0x46e237));})[_0xec6f('0x1a')](function(_0x41a1ca){logger[_0xec6f('0xc')](util[_0xec6f('0x14')](_0xec6f('0x1b'),_0x41ed86[_0xec6f('0x5')],_0x41ed86['data2'],_0x41a1ca[_0xec6f('0x19')],_0x41a1ca[_0xec6f('0x1c')],_0x41a1ca[_0xec6f('0x1d')]));});}; \ No newline at end of file +var _0x8227=['POST','data7','body','parse','info','then','isNil',',\x20request\x20body:\x20','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','util','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','data6','error','stack'];(function(_0x48a388,_0x5b1c20){var _0x104181=function(_0x165479){while(--_0x165479){_0x48a388['push'](_0x48a388['shift']());}};_0x104181(++_0x5b1c20);}(_0x8227,0x146));var _0x7822=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8227[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require('request-promise');var util=require(_0x7822('0x0'));var _=require('lodash');var Mustache=require(_0x7822('0x1'));var logger=require(_0x7822('0x2'))(_0x7822('0x3'));exports[_0x7822('0x4')]=function(_0x4c158e,_0x470b88){var _0x335529,_0x3b5dc2;var _0x1173b1={'method':_0x4c158e[_0x7822('0x5')][_0x7822('0x6')](),'uri':encodeURI(Mustache[_0x7822('0x7')](_0x4c158e[_0x7822('0x8')],_0x470b88)),'json':!![],'resolveWithFullResponse':!![]};try{_0x1173b1['headers']=_0x4c158e[_0x7822('0x9')]?JSON['parse'](Mustache[_0x7822('0x7')](_0x4c158e[_0x7822('0x9')],_0x470b88)):{};}catch(_0x3ba7cb){logger[_0x7822('0xa')](_0x3ba7cb[_0x7822('0xb')]);}switch(_0x4c158e[_0x7822('0x5')]['toUpperCase']()){case'GET':_0x1173b1['qs']=_0x470b88;break;case _0x7822('0xc'):case'PUT':_0x335529={};if(_0x4c158e[_0x7822('0xd')]){_0x335529=Mustache[_0x7822('0x7')](_0x4c158e[_0x7822('0xd')],_0x470b88);}else{_0x335529=_0x470b88;}_0x1173b1[_0x7822('0xe')]=JSON[_0x7822('0xf')](_0x335529);break;}logger[_0x7822('0x10')](util['format']('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x4c158e[_0x7822('0x5')],_0x4c158e[_0x7822('0x8')],JSON['stringify'](_0x1173b1)));rp(_0x1173b1)[_0x7822('0x11')](function(_0xe46f15){_0x335529=!_[_0x7822('0x12')](_0x335529)?_0x7822('0x13')+_0x335529:'';_0x3b5dc2=typeof _0xe46f15[_0x7822('0xe')]==='object'?JSON['stringify'](_0xe46f15[_0x7822('0xe')]):_0xe46f15[_0x7822('0xe')];logger[_0x7822('0x10')](util[_0x7822('0x14')](_0x7822('0x15'),_0x4c158e[_0x7822('0x5')],_0x4c158e[_0x7822('0x8')],_0xe46f15[_0x7822('0x16')],_0x3b5dc2));})[_0x7822('0x17')](function(_0x4343b8){logger[_0x7822('0xa')](util[_0x7822('0x14')](_0x7822('0x18'),_0x4c158e[_0x7822('0x5')],_0x4c158e[_0x7822('0x8')],_0x4343b8[_0x7822('0x16')],_0x4343b8['name'],_0x4343b8[_0x7822('0x19')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index cef5c27..a3d214f 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 _0xd67b=['then','debug','rpc','error','message','catch','exports','bluebird','routing','client','http','request'];(function(_0x1f53fc,_0x2af3f7){var _0x3544ac=function(_0x11b113){while(--_0x11b113){_0x1f53fc['push'](_0x1f53fc['shift']());}};_0x3544ac(++_0x2af3f7);}(_0xd67b,0x133));var _0xbd67=function(_0x2e3d76,_0x1e2c4c){_0x2e3d76=_0x2e3d76-0x0;var _0x2499dd=_0xd67b[_0x2e3d76];return _0x2499dd;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xbd67('0x0'));var logger=require('../../config/logger')(_0xbd67('0x1'));var client=jayson[_0xbd67('0x2')][_0xbd67('0x3')]({'port':0x2329});client['Request']=function(_0x40e384,_0x50da5a){return new BPromise(function(_0x1bf96,_0x5a827b){return client[_0xbd67('0x4')](_0x40e384,_0x50da5a)[_0xbd67('0x5')](function(_0x2ad142){logger[_0xbd67('0x6')](_0xbd67('0x7'),_0xbd67('0x1'),_0x40e384,_0x50da5a,_0x2ad142);if(_0x2ad142[_0xbd67('0x8')]){logger[_0xbd67('0x8')](_0xbd67('0x7'),_0xbd67('0x1'),_0x40e384,_0x2ad142[_0xbd67('0x8')][_0xbd67('0x9')],_0x50da5a);return _0x5a827b(_0x2ad142[_0xbd67('0x8')]['message']);}else{return _0x1bf96(_0x2ad142['result']);}})[_0xbd67('0xa')](function(_0x5aad7a){logger[_0xbd67('0x8')](_0xbd67('0x7'),_0xbd67('0x1'),_0x40e384,_0x5aad7a,_0x50da5a);return _0x5a827b(_0x5aad7a);});});};module[_0xbd67('0xb')]=client; \ No newline at end of file +var _0x7b27=['routing','client','http','request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','../../config/logger'];(function(_0x4bb145,_0x3e7d33){var _0x4db596=function(_0x144489){while(--_0x144489){_0x4bb145['push'](_0x4bb145['shift']());}};_0x4db596(++_0x3e7d33);}(_0x7b27,0x186));var _0x77b2=function(_0x5eec44,_0x11f863){_0x5eec44=_0x5eec44-0x0;var _0x1bb09f=_0x7b27[_0x5eec44];return _0x1bb09f;};'use strict';var jayson=require(_0x77b2('0x0'));var BPromise=require('bluebird');var logger=require(_0x77b2('0x1'))(_0x77b2('0x2'));var client=jayson[_0x77b2('0x3')][_0x77b2('0x4')]({'port':0x2329});client['Request']=function(_0x295c4e,_0x47075b){return new BPromise(function(_0x5e5289,_0x300a1c){return client[_0x77b2('0x5')](_0x295c4e,_0x47075b)[_0x77b2('0x6')](function(_0x569bce){logger[_0x77b2('0x7')](_0x77b2('0x8'),_0x77b2('0x2'),_0x295c4e,_0x47075b,_0x569bce);if(_0x569bce[_0x77b2('0x9')]){logger['error'](_0x77b2('0x8'),_0x77b2('0x2'),_0x295c4e,_0x569bce[_0x77b2('0x9')][_0x77b2('0xa')],_0x47075b);return _0x300a1c(_0x569bce[_0x77b2('0x9')][_0x77b2('0xa')]);}else{return _0x5e5289(_0x569bce[_0x77b2('0xb')]);}})[_0x77b2('0xc')](function(_0x5ddcf6){logger[_0x77b2('0x9')](_0x77b2('0x8'),'routing',_0x295c4e,_0x5ddcf6,_0x47075b);return _0x300a1c(_0x5ddcf6);});});};module[_0x77b2('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 3413bd4..77d175a 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 _0xc0c8=['catch','log','./realtime','./lib/email','resolve','then','initMailAccounts','refresh','mailAccounts'];(function(_0x3a9193,_0x5d388b){var _0x5198e6=function(_0x289dad){while(--_0x289dad){_0x3a9193['push'](_0x3a9193['shift']());}};_0x5198e6(++_0x5d388b);}(_0xc0c8,0x12b));var _0x8c0c=function(_0x3d38bf,_0x5486e6){_0x3d38bf=_0x3d38bf-0x0;var _0x28dd0c=_0xc0c8[_0x3d38bf];return _0x28dd0c;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require(_0x8c0c('0x0'));var EmailChannel=require(_0x8c0c('0x1'));var mailAccount=require('./rpc/mailAccount');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x8c0c('0x2')]()['then'](mailAccount['getMailAccounts']())[_0x8c0c('0x3')](realtime[_0x8c0c('0x4')]())[_0x8c0c('0x3')](function(){email[_0x8c0c('0x5')](realtime[_0x8c0c('0x6')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x8c0c('0x3')](function(_0xac0cb6){return initRealtime();})['then'](function(_0x109578){return setInterval(initRealtime,0x2710);})[_0x8c0c('0x7')](function(_0x44c154){console[_0x8c0c('0x8')](_0x44c154);});}main(); \ No newline at end of file +var _0x0dd2=['log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','resolve','then','refresh','mailAccounts','listen','catch'];(function(_0x384edc,_0x57e9c5){var _0x429095=function(_0x197d11){while(--_0x197d11){_0x384edc['push'](_0x384edc['shift']());}};_0x429095(++_0x57e9c5);}(_0x0dd2,0xd9));var _0x20dd=function(_0x447b23,_0x49c577){_0x447b23=_0x447b23-0x0;var _0x2f37c7=_0x0dd2[_0x447b23];return _0x2f37c7;};'use strict';var BPromise=require(_0x20dd('0x0'));var server=require(_0x20dd('0x1'));var Realtime=require(_0x20dd('0x2'));var EmailChannel=require(_0x20dd('0x3'));var mailAccount=require(_0x20dd('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x20dd('0x5')]()['then'](mailAccount['getMailAccounts']())[_0x20dd('0x6')](realtime['initMailAccounts']())[_0x20dd('0x6')](function(){email[_0x20dd('0x7')](realtime[_0x20dd('0x8')]);return realtime;});}function main(){return server[_0x20dd('0x9')](realtime,email)[_0x20dd('0x6')](function(_0xf4edfa){return initRealtime();})[_0x20dd('0x6')](function(_0x485ba2){return setInterval(initRealtime,0x2710);})[_0x20dd('0xa')](function(_0x4fc8a5){console[_0x20dd('0xb')](_0x4fc8a5);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 605a1e3..29bc816 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 _0x33af=['error','handleImapError','disabled','messageStatus','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','catch','verify','moment','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','localhost','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','status','Imap','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd'];(function(_0x2ab5fc,_0x490501){var _0xb5d58c=function(_0x3c270c){while(--_0x3c270c){_0x2ab5fc['push'](_0x2ab5fc['shift']());}};_0xb5d58c(++_0x490501);}(_0x33af,0xec));var _0xf33a=function(_0x1bd7b7,_0x18e7c4){_0x1bd7b7=_0x1bd7b7-0x0;var _0x46a408=_0x33af[_0x1bd7b7];return _0x46a408;};'use strict';var _=require('lodash');var moment=require(_0xf33a('0x0'));var BPromise=require('bluebird');var md5=require(_0xf33a('0x1'));var Redis=require(_0xf33a('0x2'));var config=require(_0xf33a('0x3'));var logger=require(_0xf33a('0x4'))(_0xf33a('0x5'));config[_0xf33a('0x6')]=_['defaults'](config[_0xf33a('0x6')],{'host':_0xf33a('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf33a('0x6')]));var EmailImap=require(_0xf33a('0x8'));var EmailSmtp=require(_0xf33a('0x9'));var mailAccount=require(_0xf33a('0xa'));var md5Accounts={};function EmailChannel(_0x2baabb){logger[_0xf33a('0xb')]('start\x20email\x20channel');this[_0xf33a('0xc')]=_0x2baabb[_0xf33a('0xc')];this[_0xf33a('0xd')]={};this[_0xf33a('0xe')]=new EmailSmtp();}EmailChannel[_0xf33a('0xf')][_0xf33a('0x10')]=function(_0x5074a2){var _0x4ea282=this[_0xf33a('0xc')][_0x5074a2];var _0xb47cde={'id':_0x4ea282['id'],'name':_0x4ea282[_0xf33a('0x11')],'key':_0x4ea282[_0xf33a('0x12')],'active':_0x4ea282[_0xf33a('0x13')],'Imap':{'status':_0x4ea282['Imap'][_0xf33a('0x14')],'messageStatus':_0x4ea282[_0xf33a('0x15')]['messageStatus'],'total':_0x4ea282['Imap'][_0xf33a('0x16')]}};if(_[_0xf33a('0x17')](md5Accounts[_0x5074a2])){md5Accounts[_0x5074a2]={};}var _0x17043=md5(JSON[_0xf33a('0x18')](_0xb47cde));if(md5Accounts[_0x5074a2][_0xf33a('0x1')]!==_0x17043){md5Accounts[_0x5074a2][_0xf33a('0x1')]=_0x17043;io[_0xf33a('0x10')](_0xf33a('0x19'),_0xb47cde);}};EmailChannel['prototype'][_0xf33a('0x1a')]=function(_0x5b5f27){for(var _0x75848d in _0x5b5f27){if(_0x5b5f27[_0xf33a('0x1b')](_0x75848d)){if(_0x5b5f27[_0x75848d]['Imap']&&_0x5b5f27[_0x75848d][_0xf33a('0x13')]){var _0x25c931=_0x5b5f27[_0x75848d]['Imap'];if(!this[_0xf33a('0xd')][_0xf33a('0x1b')](_0x25c931['id'])){this[_0xf33a('0xd')][_0x25c931['id']]=new EmailImap(_0x25c931,_0x5b5f27[_0x75848d][_0xf33a('0x5')]);this['imapAccounts'][_0x25c931['id']]['on'](_0xf33a('0x1c'),this[_0xf33a('0x1d')][_0xf33a('0x1e')](this,_0x75848d));this[_0xf33a('0xd')][_0x25c931['id']]['on'](_0xf33a('0x5'),this[_0xf33a('0x1f')][_0xf33a('0x1e')](this,_0x75848d));this[_0xf33a('0xd')][_0x25c931['id']]['on'](_0xf33a('0x20'),this[_0xf33a('0x21')]['bind'](this,_0x75848d));this[_0xf33a('0xd')][_0x25c931['id']]['on'](_0xf33a('0x22'),this[_0xf33a('0x23')][_0xf33a('0x1e')](this,_0x75848d));}}else{if(_[_0xf33a('0x17')](this['mailAccounts'][_0x75848d][_0xf33a('0x15')])){this['mailAccounts'][_0x75848d][_0xf33a('0x15')]={};}this[_0xf33a('0xc')][_0x75848d][_0xf33a('0x15')][_0xf33a('0x14')]=_0xf33a('0x24');this['mailAccounts'][_0x75848d][_0xf33a('0x15')][_0xf33a('0x25')]='';this['emit'](_0x75848d);}}}};EmailChannel['prototype'][_0xf33a('0x1d')]=function(_0x5f0a53,_0x5cf981){if(this[_0xf33a('0xc')][_0x5f0a53]){this['mailAccounts'][_0x5f0a53][_0xf33a('0x15')]['status']=_0xf33a('0x26');this[_0xf33a('0xc')][_0x5f0a53][_0xf33a('0x15')][_0xf33a('0x25')]=_0x5cf981[_0xf33a('0x11')];if(_0x5cf981[_0xf33a('0x27')]){this[_0xf33a('0xc')][_0x5f0a53][_0xf33a('0x15')][_0xf33a('0x16')]=_0x5cf981[_0xf33a('0x27')][_0xf33a('0x16')];}return this[_0xf33a('0x10')](_0x5f0a53);}};EmailChannel[_0xf33a('0xf')][_0xf33a('0x1f')]=function(_0x2fd098,_0x5eb14a){logger[_0xf33a('0xb')](_0xf33a('0x28'),_0x5eb14a[_0xf33a('0x29')],_0x5eb14a[_0xf33a('0x2a')],_0x5eb14a['from'],_0x2fd098);if(this[_0xf33a('0xc')][_0x2fd098]){return mailAccount[_0xf33a('0x2b')](_0x2fd098,_0x5eb14a)[_0xf33a('0x2c')](function(_0x31cb7c){if(_0x31cb7c){logger[_0xf33a('0xb')](_0xf33a('0x2d'));}})['catch'](function(_0x1e7179){logger[_0xf33a('0x22')](_0xf33a('0x2e'),JSON[_0xf33a('0x18')](_0x1e7179));});}};EmailChannel[_0xf33a('0xf')]['handleImapEnd']=function(_0x578998){if(this[_0xf33a('0xc')][_0x578998]&&this['mailAccounts'][_0x578998]['Imap']){if(this['imapAccounts'][this[_0xf33a('0xc')][_0x578998][_0xf33a('0x15')]['id']]){delete this['imapAccounts'][this[_0xf33a('0xc')][_0x578998]['Imap']['id']];}this[_0xf33a('0xc')][_0x578998][_0xf33a('0x15')][_0xf33a('0x2f')]=moment();this[_0xf33a('0x10')](_0x578998);}};EmailChannel[_0xf33a('0xf')][_0xf33a('0x23')]=function(_0x5a4076,_0x16ca8b){if(this[_0xf33a('0xc')][_0x5a4076]){this['mailAccounts'][_0x5a4076][_0xf33a('0x15')][_0xf33a('0x14')]=_0xf33a('0x22');this['mailAccounts'][_0x5a4076][_0xf33a('0x15')][_0xf33a('0x25')]=_0x16ca8b;return this[_0xf33a('0x10')](_0x5a4076);}};EmailChannel[_0xf33a('0xf')][_0xf33a('0x30')]=function(_0x7a6aa4,_0x1b4d59){return this[_0xf33a('0xe')][_0xf33a('0x31')](_0x7a6aa4,_0x1b4d59);};EmailChannel['prototype'][_0xf33a('0x32')]=function(_0x3e80b6){var _0x5c2e10=this;if(this[_0xf33a('0xc')][_0x3e80b6['id']]){if(_['isNil'](this['mailAccounts'][_0x3e80b6['id']][_0xf33a('0x33')])){this[_0xf33a('0xc')][_0x3e80b6['id']]['Smtp']={};}this[_0xf33a('0xc')][_0x3e80b6['id']][_0xf33a('0x33')][_0xf33a('0x2f')]=moment();return new BPromise(function(_0x5776b1,_0xab672){return _0x5c2e10[_0xf33a('0xe')]['verify'](_0x3e80b6)[_0xf33a('0x2c')](function(_0x20e57b){_0x5c2e10[_0xf33a('0xc')][_0x3e80b6['id']][_0xf33a('0x33')][_0xf33a('0x14')]='verified';_0x5c2e10[_0xf33a('0xc')][_0x3e80b6['id']][_0xf33a('0x33')][_0xf33a('0x25')]='';_0x5c2e10[_0xf33a('0x10')](_0x3e80b6['id']);_0x5776b1(_0x20e57b);})[_0xf33a('0x34')](function(_0x5ef2b8){_0x5c2e10[_0xf33a('0xc')][_0x3e80b6['id']][_0xf33a('0x33')][_0xf33a('0x14')]='error';_0x5c2e10[_0xf33a('0xc')][_0x3e80b6['id']][_0xf33a('0x33')][_0xf33a('0x25')]=_0x5ef2b8;_0x5c2e10[_0xf33a('0x10')](_0x3e80b6['id']);_0xab672(_0x5ef2b8);});});}return this[_0xf33a('0xe')][_0xf33a('0x35')](_0x3e80b6);};module['exports']=EmailChannel; \ No newline at end of file +var _0x0424=['status','disabled','connected','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','sendMail','send','verifySmtp','Smtp','verify','then','verified','exports','bluebird','md5','ioredis','../../../config/environment','email','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','smtp','prototype','emit','name','active','Imap','messageStatus','total','isNil','stringify','refresh','hasOwnProperty','box','handleImapBox','bind','imapAccounts','handleImapEmail','end','error','handleImapError'];(function(_0x4d2c26,_0x2701f9){var _0x5bf9b4=function(_0x52edc6){while(--_0x52edc6){_0x4d2c26['push'](_0x4d2c26['shift']());}};_0x5bf9b4(++_0x2701f9);}(_0x0424,0x159));var _0x4042=function(_0x13f257,_0x3c3d67){_0x13f257=_0x13f257-0x0;var _0x455f37=_0x0424[_0x13f257];return _0x455f37;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0x4042('0x0'));var md5=require(_0x4042('0x1'));var Redis=require(_0x4042('0x2'));var config=require(_0x4042('0x3'));var logger=require('../../../config/logger')(_0x4042('0x4'));config['redis']=_['defaults'](config[_0x4042('0x5')],{'host':_0x4042('0x6'),'port':0x18eb});var io=require(_0x4042('0x7'))(new Redis(config[_0x4042('0x5')]));var EmailImap=require(_0x4042('0x8'));var EmailSmtp=require(_0x4042('0x9'));var mailAccount=require(_0x4042('0xa'));var md5Accounts={};function EmailChannel(_0x5d11bf){logger['info'](_0x4042('0xb'));this[_0x4042('0xc')]=_0x5d11bf[_0x4042('0xc')];this['imapAccounts']={};this[_0x4042('0xd')]=new EmailSmtp();}EmailChannel[_0x4042('0xe')][_0x4042('0xf')]=function(_0x2cbc75){var _0x1c2984=this[_0x4042('0xc')][_0x2cbc75];var _0x380aa0={'id':_0x1c2984['id'],'name':_0x1c2984[_0x4042('0x10')],'key':_0x1c2984['key'],'active':_0x1c2984[_0x4042('0x11')],'Imap':{'status':_0x1c2984[_0x4042('0x12')]['status'],'messageStatus':_0x1c2984[_0x4042('0x12')][_0x4042('0x13')],'total':_0x1c2984[_0x4042('0x12')][_0x4042('0x14')]}};if(_[_0x4042('0x15')](md5Accounts[_0x2cbc75])){md5Accounts[_0x2cbc75]={};}var _0x1ff3ca=md5(JSON[_0x4042('0x16')](_0x380aa0));if(md5Accounts[_0x2cbc75]['md5']!==_0x1ff3ca){md5Accounts[_0x2cbc75][_0x4042('0x1')]=_0x1ff3ca;io[_0x4042('0xf')]('mailAccount:update',_0x380aa0);}};EmailChannel[_0x4042('0xe')][_0x4042('0x17')]=function(_0x43dcb5){for(var _0x1c3328 in _0x43dcb5){if(_0x43dcb5[_0x4042('0x18')](_0x1c3328)){if(_0x43dcb5[_0x1c3328][_0x4042('0x12')]&&_0x43dcb5[_0x1c3328][_0x4042('0x11')]){var _0x10cb93=_0x43dcb5[_0x1c3328][_0x4042('0x12')];if(!this['imapAccounts'][_0x4042('0x18')](_0x10cb93['id'])){this['imapAccounts'][_0x10cb93['id']]=new EmailImap(_0x10cb93,_0x43dcb5[_0x1c3328][_0x4042('0x4')]);this['imapAccounts'][_0x10cb93['id']]['on'](_0x4042('0x19'),this[_0x4042('0x1a')][_0x4042('0x1b')](this,_0x1c3328));this[_0x4042('0x1c')][_0x10cb93['id']]['on']('email',this[_0x4042('0x1d')][_0x4042('0x1b')](this,_0x1c3328));this[_0x4042('0x1c')][_0x10cb93['id']]['on'](_0x4042('0x1e'),this['handleImapEnd'][_0x4042('0x1b')](this,_0x1c3328));this[_0x4042('0x1c')][_0x10cb93['id']]['on'](_0x4042('0x1f'),this[_0x4042('0x20')][_0x4042('0x1b')](this,_0x1c3328));}}else{if(_['isNil'](this[_0x4042('0xc')][_0x1c3328][_0x4042('0x12')])){this['mailAccounts'][_0x1c3328][_0x4042('0x12')]={};}this['mailAccounts'][_0x1c3328][_0x4042('0x12')][_0x4042('0x21')]=_0x4042('0x22');this['mailAccounts'][_0x1c3328][_0x4042('0x12')][_0x4042('0x13')]='';this[_0x4042('0xf')](_0x1c3328);}}}};EmailChannel[_0x4042('0xe')][_0x4042('0x1a')]=function(_0x52e575,_0x58c409){if(this[_0x4042('0xc')][_0x52e575]){this[_0x4042('0xc')][_0x52e575][_0x4042('0x12')][_0x4042('0x21')]=_0x4042('0x23');this[_0x4042('0xc')][_0x52e575]['Imap'][_0x4042('0x13')]=_0x58c409[_0x4042('0x10')];if(_0x58c409['messages']){this[_0x4042('0xc')][_0x52e575][_0x4042('0x12')][_0x4042('0x14')]=_0x58c409['messages']['total'];}return this[_0x4042('0xf')](_0x52e575);}};EmailChannel[_0x4042('0xe')]['handleImapEmail']=function(_0x3e9304,_0xc42d70){logger[_0x4042('0x24')](_0x4042('0x25'),_0xc42d70[_0x4042('0x26')],_0xc42d70[_0x4042('0x27')],_0xc42d70[_0x4042('0x28')],_0x3e9304);if(this[_0x4042('0xc')][_0x3e9304]){return mailAccount[_0x4042('0x29')](_0x3e9304,_0xc42d70)['then'](function(_0xff306b){if(_0xff306b){logger[_0x4042('0x24')]('Mail\x20accepted\x20from\x20routing');}})[_0x4042('0x2a')](function(_0x22486e){logger['error'](_0x4042('0x2b'),JSON[_0x4042('0x16')](_0x22486e));});}};EmailChannel[_0x4042('0xe')][_0x4042('0x2c')]=function(_0x74626b){if(this[_0x4042('0xc')][_0x74626b]&&this[_0x4042('0xc')][_0x74626b][_0x4042('0x12')]){if(this[_0x4042('0x1c')][this[_0x4042('0xc')][_0x74626b][_0x4042('0x12')]['id']]){delete this[_0x4042('0x1c')][this[_0x4042('0xc')][_0x74626b][_0x4042('0x12')]['id']];}this[_0x4042('0xc')][_0x74626b][_0x4042('0x12')][_0x4042('0x2d')]=moment();this[_0x4042('0xf')](_0x74626b);}};EmailChannel[_0x4042('0xe')][_0x4042('0x20')]=function(_0x2f0b42,_0x58667a){if(this[_0x4042('0xc')][_0x2f0b42]){this[_0x4042('0xc')][_0x2f0b42][_0x4042('0x12')][_0x4042('0x21')]='error';this[_0x4042('0xc')][_0x2f0b42][_0x4042('0x12')][_0x4042('0x13')]=_0x58667a;return this[_0x4042('0xf')](_0x2f0b42);}};EmailChannel[_0x4042('0xe')][_0x4042('0x2e')]=function(_0x21ae8c,_0x44f0c6){return this[_0x4042('0xd')][_0x4042('0x2f')](_0x21ae8c,_0x44f0c6);};EmailChannel['prototype'][_0x4042('0x30')]=function(_0x4597fe){var _0x2f07d8=this;if(this[_0x4042('0xc')][_0x4597fe['id']]){if(_[_0x4042('0x15')](this[_0x4042('0xc')][_0x4597fe['id']][_0x4042('0x31')])){this[_0x4042('0xc')][_0x4597fe['id']]['Smtp']={};}this['mailAccounts'][_0x4597fe['id']][_0x4042('0x31')][_0x4042('0x2d')]=moment();return new BPromise(function(_0x3ff8d8,_0x134be8){return _0x2f07d8[_0x4042('0xd')][_0x4042('0x32')](_0x4597fe)[_0x4042('0x33')](function(_0x363fd){_0x2f07d8[_0x4042('0xc')][_0x4597fe['id']][_0x4042('0x31')][_0x4042('0x21')]=_0x4042('0x34');_0x2f07d8['mailAccounts'][_0x4597fe['id']]['Smtp'][_0x4042('0x13')]='';_0x2f07d8[_0x4042('0xf')](_0x4597fe['id']);_0x3ff8d8(_0x363fd);})['catch'](function(_0x3d922a){_0x2f07d8['mailAccounts'][_0x4597fe['id']][_0x4042('0x31')][_0x4042('0x21')]=_0x4042('0x1f');_0x2f07d8['mailAccounts'][_0x4597fe['id']][_0x4042('0x31')][_0x4042('0x13')]=_0x3d922a;_0x2f07d8['emit'](_0x4597fe['id']);_0x134be8(_0x3d922a);});});}return this[_0x4042('0xd')][_0x4042('0x32')](_0x4597fe);};module[_0x4042('0x35')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index bc527de..444c8bd 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 _0x7072=['handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','closeBox','textCode','upperFirst','exports','util','imap','lodash','randomstring','mailparser','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','ready','handleReady','bind','end','handleEnd','error','handleError','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','openBox','handleOpenBox','box','handleCloseBox','search'];(function(_0x54833a,_0x2b5714){var _0x4f3dc6=function(_0x3cb63b){while(--_0x3cb63b){_0x54833a['push'](_0x54833a['shift']());}};_0x4f3dc6(++_0x2b5714);}(_0x7072,0x138));var _0x2707=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x7072[_0x58dc25];return _0x21b0a7;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x2707('0x0'));var Imap=require(_0x2707('0x1'));var _=require(_0x2707('0x2'));var rs=require(_0x2707('0x3'));var simpleParser=require(_0x2707('0x4'))['simpleParser'];var Iconv=require('iconv')[_0x2707('0x5')];var EventEmitter=require('events')[_0x2707('0x6')];var utils=require(_0x2707('0x7'));var logger=require(_0x2707('0x8'))(_0x2707('0x9'));function EmailImap(_0x2fd8ff,_0x128205){this[_0x2707('0xa')]=_0x2707('0xb');this[_0x2707('0xc')]=this[_0x2707('0xd')](_0x2fd8ff,_0x128205);this['imap']=new Imap(this['account']);this[_0x2707('0x1')][_0x2707('0xe')](_0x2707('0xf'),this[_0x2707('0x10')][_0x2707('0x11')](this));this[_0x2707('0x1')][_0x2707('0xe')](_0x2707('0x12'),this[_0x2707('0x13')][_0x2707('0x11')](this));this[_0x2707('0x1')]['on'](_0x2707('0x14'),this[_0x2707('0x15')]['bind'](this));this[_0x2707('0x1')]['connect']();}util[_0x2707('0x16')](EmailImap,EventEmitter);EmailImap[_0x2707('0x17')][_0x2707('0xd')]=function(_0x3a67f2,_0x13d9ac){var _0x4e52a3={'connTimeout':_0x3a67f2[_0x2707('0x18')]?_0x3a67f2[_0x2707('0x18')]*0x3e8:0x2710,'authTimeout':_0x3a67f2[_0x2707('0x19')]?_0x3a67f2['authTimeout']*0x3e8:0x1388};if(_[_0x2707('0x1a')](_0x3a67f2[_0x2707('0x1b')])){if(_0x3a67f2[_0x2707('0x1c')]){_0x4e52a3[_0x2707('0x1d')]=_0x3a67f2[_0x2707('0x1d')];_0x4e52a3[_0x2707('0x1e')]=_0x3a67f2['password'];}_0x4e52a3[_0x2707('0x1f')]=_0x3a67f2[_0x2707('0x1f')];_0x4e52a3[_0x2707('0x20')]=_0x3a67f2['port']||0x3e1;if(_0x3a67f2['tls']){_0x4e52a3['tls']=!![];}else{_0x4e52a3[_0x2707('0x21')]=![];_0x4e52a3[_0x2707('0x22')]=_0x2707('0x23');}}else{_0x4e52a3[_0x2707('0x1d')]=_0x3a67f2[_0x2707('0x1d')];_0x4e52a3[_0x2707('0x1e')]=_0x3a67f2[_0x2707('0x1e')];_0x4e52a3[_0x2707('0x1f')]=utils[_0x2707('0x24')](_0x3a67f2[_0x2707('0x1b')]);_0x4e52a3[_0x2707('0x20')]=0x3e1;_0x4e52a3[_0x2707('0x21')]=!![];}_0x4e52a3[_0x2707('0x9')]=_0x13d9ac||_0x3a67f2[_0x2707('0x1d')]||'anonymous@xcally.com';return _0x4e52a3;};EmailImap[_0x2707('0x17')][_0x2707('0x10')]=function(){this[_0x2707('0x1')][_0x2707('0x25')](this[_0x2707('0xa')],![],this[_0x2707('0x26')]['bind'](this));};EmailImap[_0x2707('0x17')][_0x2707('0x26')]=function(_0x171add,_0x2ad386){if(_0x171add){this[_0x2707('0x15')](_0x171add,!![]);}else{this['emit'](_0x2707('0x27'),_0x2ad386);this['readUnseen']();}};EmailImap[_0x2707('0x17')][_0x2707('0x28')]=function(_0x2aa3fe){if(_0x2aa3fe){this['handleError'](_0x2aa3fe,!![]);}else{this[_0x2707('0x1')][_0x2707('0x12')]();}};EmailImap[_0x2707('0x17')]['readUnseen']=function(){this[_0x2707('0x1')][_0x2707('0x29')](['UNSEEN'],this[_0x2707('0x2a')]['bind'](this));};EmailImap['prototype'][_0x2707('0x2a')]=function(_0x4e0c93,_0x2a0d24){if(_0x4e0c93){this[_0x2707('0x15')](_0x4e0c93,!![]);}else{if(_0x2a0d24[_0x2707('0x2b')]){try{var _0x36b2e9=this['imap'][_0x2707('0x2c')](_0x2a0d24,{'bodies':'','markSeen':!![]});_0x36b2e9['on'](_0x2707('0x2d'),this[_0x2707('0x2e')][_0x2707('0x11')](this));_0x36b2e9[_0x2707('0xe')](_0x2707('0x14'),this[_0x2707('0x2f')][_0x2707('0x11')](this));_0x36b2e9[_0x2707('0xe')]('end',this[_0x2707('0x30')][_0x2707('0x11')](this));}catch(_0x5bcdef){logger['error'](_0x5bcdef);}}else{this['imap']['closeBox'](!![],this['handleCloseBox'][_0x2707('0x11')](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x4558bb,_0x42f0ae){_0x4558bb['on']('body',this[_0x2707('0x31')][_0x2707('0x11')](this));_0x4558bb['once']('attributes',this[_0x2707('0x32')][_0x2707('0x11')](this));_0x4558bb['once']('end',this[_0x2707('0x33')][_0x2707('0x11')](this));};EmailImap['prototype'][_0x2707('0x31')]=function(_0x405362,_0x1bd1c3){simpleParser(_0x405362,{'Iconv':Iconv},this[_0x2707('0x34')][_0x2707('0x11')](this));};EmailImap[_0x2707('0x17')]['handleMessageAttributes']=function(_0x15a953){};EmailImap[_0x2707('0x17')][_0x2707('0x33')]=function(){};EmailImap[_0x2707('0x17')][_0x2707('0x34')]=function(_0x1b9d71,_0x2700bf){if(_0x1b9d71){logger['error'](_0x1b9d71);}else{var _0x3f85a0=this;utils[_0x2707('0x35')](this[_0x2707('0xc')],_0x2700bf,function(_0x1ea823){_0x3f85a0[_0x2707('0x36')](_0x2707('0x9'),_0x1ea823);});}};EmailImap[_0x2707('0x17')][_0x2707('0x30')]=function(){this[_0x2707('0x1')][_0x2707('0x37')](!![],this[_0x2707('0x28')][_0x2707('0x11')](this));};EmailImap[_0x2707('0x17')][_0x2707('0x2f')]=function(_0x36c8ab){this[_0x2707('0x15')](_0x36c8ab);this['imap'][_0x2707('0x37')](!![],this[_0x2707('0x28')]['bind'](this));};EmailImap[_0x2707('0x17')]['handleEnd']=function(){this[_0x2707('0x36')](_0x2707('0x12'));};EmailImap[_0x2707('0x17')][_0x2707('0x15')]=function(_0x13e1c0,_0xdeec24){logger[_0x2707('0x14')]('handleError',this[_0x2707('0xc')][_0x2707('0x9')],JSON['stringify'](_0x13e1c0));var _0x3d25ea='';if(_0x13e1c0){if(_0x13e1c0[_0x2707('0x38')]){_0x3d25ea=_0x13e1c0[_0x2707('0x38')];}else{for(var _0x5a4c53 in _0x13e1c0){if(_0x13e1c0['hasOwnProperty'](_0x5a4c53)){_0x3d25ea+=_[_0x2707('0x39')](_0x5a4c53)+':\x20'+_0x13e1c0[_0x5a4c53]+'\x0a';}}}}if(_0xdeec24){this[_0x2707('0x1')]['end']();}else{this[_0x2707('0x36')]('error',_0x3d25ea);this[_0x2707('0x36')](_0x2707('0x12'));}};module[_0x2707('0x3a')]=EmailImap; \ No newline at end of file +var _0xf150=['handleEnd','email','stringify','textCode','hasOwnProperty','exports','path','util','imap','randomstring','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','mailbox','INBOX','getAccount','account','handleReady','bind','end','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','anonymous@xcally.com','openBox','handleOpenBox','box','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','fetch','message','handleFetchError','once','handleFetchEnd','closeBox','handleFetchMessage','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xf150,0x106));var _0x0f15=function(_0x43c98d,_0x201c4d){_0x43c98d=_0x43c98d-0x0;var _0x3517ec=_0xf150[_0x43c98d];return _0x3517ec;};'use strict';var fs=require('fs');var path=require(_0x0f15('0x0'));var util=require(_0x0f15('0x1'));var Imap=require(_0x0f15('0x2'));var _=require('lodash');var rs=require(_0x0f15('0x3'));var simpleParser=require(_0x0f15('0x4'))[_0x0f15('0x5')];var Iconv=require(_0x0f15('0x6'))[_0x0f15('0x7')];var EventEmitter=require(_0x0f15('0x8'))[_0x0f15('0x9')];var utils=require(_0x0f15('0xa'));var logger=require('../../../config/logger')('email');function EmailImap(_0x1d8a90,_0xb3af27){this[_0x0f15('0xb')]=_0x0f15('0xc');this['account']=this[_0x0f15('0xd')](_0x1d8a90,_0xb3af27);this['imap']=new Imap(this[_0x0f15('0xe')]);this[_0x0f15('0x2')]['once']('ready',this[_0x0f15('0xf')][_0x0f15('0x10')](this));this[_0x0f15('0x2')]['once'](_0x0f15('0x11'),this['handleEnd']['bind'](this));this[_0x0f15('0x2')]['on'](_0x0f15('0x12'),this[_0x0f15('0x13')][_0x0f15('0x10')](this));this['imap'][_0x0f15('0x14')]();}util[_0x0f15('0x15')](EmailImap,EventEmitter);EmailImap[_0x0f15('0x16')]['getAccount']=function(_0x5ab21b,_0x57923f){var _0x1ffb47={'connTimeout':_0x5ab21b[_0x0f15('0x17')]?_0x5ab21b['connTimeout']*0x3e8:0x2710,'authTimeout':_0x5ab21b['authTimeout']?_0x5ab21b[_0x0f15('0x18')]*0x3e8:0x1388};if(_[_0x0f15('0x19')](_0x5ab21b[_0x0f15('0x1a')])){if(_0x5ab21b[_0x0f15('0x1b')]){_0x1ffb47[_0x0f15('0x1c')]=_0x5ab21b[_0x0f15('0x1c')];_0x1ffb47[_0x0f15('0x1d')]=_0x5ab21b['password'];}_0x1ffb47[_0x0f15('0x1e')]=_0x5ab21b[_0x0f15('0x1e')];_0x1ffb47['port']=_0x5ab21b[_0x0f15('0x1f')]||0x3e1;if(_0x5ab21b['tls']){_0x1ffb47[_0x0f15('0x20')]=!![];}else{_0x1ffb47['tls']=![];_0x1ffb47[_0x0f15('0x21')]=_0x0f15('0x22');}}else{_0x1ffb47['user']=_0x5ab21b[_0x0f15('0x1c')];_0x1ffb47[_0x0f15('0x1d')]=_0x5ab21b['password'];_0x1ffb47[_0x0f15('0x1e')]=utils['getHost'](_0x5ab21b['service']);_0x1ffb47[_0x0f15('0x1f')]=0x3e1;_0x1ffb47['tls']=!![];}_0x1ffb47['email']=_0x57923f||_0x5ab21b['user']||_0x0f15('0x23');return _0x1ffb47;};EmailImap[_0x0f15('0x16')][_0x0f15('0xf')]=function(){this[_0x0f15('0x2')][_0x0f15('0x24')](this[_0x0f15('0xb')],![],this[_0x0f15('0x25')][_0x0f15('0x10')](this));};EmailImap[_0x0f15('0x16')]['handleOpenBox']=function(_0x42b999,_0x15d275){if(_0x42b999){this[_0x0f15('0x13')](_0x42b999,!![]);}else{this['emit'](_0x0f15('0x26'),_0x15d275);this[_0x0f15('0x27')]();}};EmailImap[_0x0f15('0x16')][_0x0f15('0x28')]=function(_0x262a11){if(_0x262a11){this[_0x0f15('0x13')](_0x262a11,!![]);}else{this[_0x0f15('0x2')][_0x0f15('0x11')]();}};EmailImap[_0x0f15('0x16')][_0x0f15('0x27')]=function(){this[_0x0f15('0x2')]['search']([_0x0f15('0x29')],this[_0x0f15('0x2a')][_0x0f15('0x10')](this));};EmailImap[_0x0f15('0x16')][_0x0f15('0x2a')]=function(_0x38759a,_0x552c80){if(_0x38759a){this[_0x0f15('0x13')](_0x38759a,!![]);}else{if(_0x552c80['length']){try{var _0x12fea1=this[_0x0f15('0x2')][_0x0f15('0x2b')](_0x552c80,{'bodies':'','markSeen':!![]});_0x12fea1['on'](_0x0f15('0x2c'),this['handleFetchMessage']['bind'](this));_0x12fea1['once'](_0x0f15('0x12'),this[_0x0f15('0x2d')]['bind'](this));_0x12fea1[_0x0f15('0x2e')](_0x0f15('0x11'),this[_0x0f15('0x2f')]['bind'](this));}catch(_0x2c437f){logger[_0x0f15('0x12')](_0x2c437f);}}else{this[_0x0f15('0x2')][_0x0f15('0x30')](!![],this['handleCloseBox']['bind'](this));}}};EmailImap[_0x0f15('0x16')][_0x0f15('0x31')]=function(_0xf2a036,_0x37e586){_0xf2a036['on'](_0x0f15('0x32'),this[_0x0f15('0x33')][_0x0f15('0x10')](this));_0xf2a036[_0x0f15('0x2e')](_0x0f15('0x34'),this[_0x0f15('0x35')][_0x0f15('0x10')](this));_0xf2a036[_0x0f15('0x2e')](_0x0f15('0x11'),this['handleMessageEnd'][_0x0f15('0x10')](this));};EmailImap['prototype']['handleMessageBody']=function(_0x437b81,_0x1240bb){simpleParser(_0x437b81,{'Iconv':Iconv},this['handleSimpleParser'][_0x0f15('0x10')](this));};EmailImap['prototype']['handleMessageAttributes']=function(_0x521657){};EmailImap[_0x0f15('0x16')][_0x0f15('0x36')]=function(){};EmailImap[_0x0f15('0x16')][_0x0f15('0x37')]=function(_0x1f1806,_0x4e8a89){if(_0x1f1806){logger['error'](_0x1f1806);}else{var _0x14931e=this;utils[_0x0f15('0x38')](this[_0x0f15('0xe')],_0x4e8a89,function(_0x11216f){_0x14931e[_0x0f15('0x39')]('email',_0x11216f);});}};EmailImap[_0x0f15('0x16')][_0x0f15('0x2f')]=function(){this[_0x0f15('0x2')][_0x0f15('0x30')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x0f15('0x16')][_0x0f15('0x2d')]=function(_0x12ba44){this['handleError'](_0x12ba44);this[_0x0f15('0x2')][_0x0f15('0x30')](!![],this[_0x0f15('0x28')][_0x0f15('0x10')](this));};EmailImap['prototype'][_0x0f15('0x3a')]=function(){this[_0x0f15('0x39')](_0x0f15('0x11'));};EmailImap['prototype'][_0x0f15('0x13')]=function(_0x451b83,_0x1f80a4){logger[_0x0f15('0x12')](_0x0f15('0x13'),this[_0x0f15('0xe')][_0x0f15('0x3b')],JSON[_0x0f15('0x3c')](_0x451b83));var _0x3348c2='';if(_0x451b83){if(_0x451b83[_0x0f15('0x3d')]){_0x3348c2=_0x451b83['textCode'];}else{for(var _0x1c1369 in _0x451b83){if(_0x451b83[_0x0f15('0x3e')](_0x1c1369)){_0x3348c2+=_['upperFirst'](_0x1c1369)+':\x20'+_0x451b83[_0x1c1369]+'\x0a';}}}}if(_0x1f80a4){this[_0x0f15('0x2')][_0x0f15('0x11')]();}else{this['emit']('error',_0x3348c2);this[_0x0f15('0x39')](_0x0f15('0x11'));}};module[_0x0f15('0x3f')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 1d941be..5eea47c 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 _0x0188=['bluebird','prototype','send','toString','verify','createTransport','Not\x20verifired','exports'];(function(_0x43e0a1,_0x4f5ad3){var _0x37d78f=function(_0x1b70cd){while(--_0x1b70cd){_0x43e0a1['push'](_0x43e0a1['shift']());}};_0x37d78f(++_0x4f5ad3);}(_0x0188,0xb8));var _0x8018=function(_0x329d13,_0x1aff27){_0x329d13=_0x329d13-0x0;var _0x33efd9=_0x0188[_0x329d13];return _0x33efd9;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0x8018('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x8018('0x1')][_0x8018('0x2')]=function(_0x52fd82,_0x328c29){return new BPromise(function(_0x1081d2,_0x305945){var _0x64414a=nodemailer['createTransport'](_0x52fd82);_0x64414a['use']('compile',inlineBase64());_0x64414a['sendMail'](_0x328c29,function(_0x18faf6,_0x2d5506){if(_0x18faf6){_0x305945(_0x18faf6[_0x8018('0x3')]());}else{_0x1081d2(_0x2d5506);}});});};EmailSmtp[_0x8018('0x1')][_0x8018('0x4')]=function(_0xce6db){return new BPromise(function(_0x189e49,_0x316164){var _0x3526a9=nodemailer[_0x8018('0x5')](_0xce6db);_0x3526a9[_0x8018('0x4')](function(_0x39ddc4,_0x18bf3a){if(_0x39ddc4){_0x316164(_0x39ddc4[_0x8018('0x3')]());}else{if(_0x18bf3a){_0x189e49(_0x18bf3a);}else{_0x316164(_0x8018('0x6'));}}});});};module[_0x8018('0x7')]=EmailSmtp; \ No newline at end of file +var _0xe1d4=['Not\x20verifired','bluebird','createTransport','use','compile','sendMail','toString','prototype','verify'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xe1d4,0xf4));var _0x4e1d=function(_0x30e091,_0x56804c){_0x30e091=_0x30e091-0x0;var _0x2abb8e=_0xe1d4[_0x30e091];return _0x2abb8e;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0x4e1d('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype']['send']=function(_0x7adaa2,_0x536d8e){return new BPromise(function(_0x590d88,_0x233492){var _0x2bfec4=nodemailer[_0x4e1d('0x1')](_0x7adaa2);_0x2bfec4[_0x4e1d('0x2')](_0x4e1d('0x3'),inlineBase64());_0x2bfec4[_0x4e1d('0x4')](_0x536d8e,function(_0x25402d,_0xf37651){if(_0x25402d){_0x233492(_0x25402d[_0x4e1d('0x5')]());}else{_0x590d88(_0xf37651);}});});};EmailSmtp[_0x4e1d('0x6')][_0x4e1d('0x7')]=function(_0x677268){return new BPromise(function(_0x510bf5,_0x4ab3bc){var _0x5858f9=nodemailer[_0x4e1d('0x1')](_0x677268);_0x5858f9[_0x4e1d('0x7')](function(_0x4aa345,_0x4725be){if(_0x4aa345){_0x4ab3bc(_0x4aa345[_0x4e1d('0x5')]());}else{if(_0x4725be){_0x510bf5(_0x4725be);}else{_0x4ab3bc(_0x4e1d('0x8'));}}});});};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 4bbb0c1..0fc6420 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 _0x2aff=['BodyHTML','

Empty\x20message

','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','path','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','name','length','slice','join','split','isEmpty','html','test','body','textAsHtml','replace','0x1?_0x37e9c2['pop']():'';}return'';}function getMails(_0xeb1390,_0x2ec6c1){var _0x27d368='';for(var _0x3afa19=0x0;_0x3afa19<_0x2ec6c1['value'][_0xf2af('0xc')];_0x3afa19+=0x1){if(_0x2ec6c1['value'][_0x3afa19][_0xf2af('0x8')]!==_0xeb1390){if(!_[_0xf2af('0x10')](_0x27d368)){_0x27d368+=',';}_0x27d368+=_0x2ec6c1[_0xf2af('0x7')][_0x3afa19][_0xf2af('0xb')]||_0x2ec6c1[_0xf2af('0x7')][_0x3afa19][_0xf2af('0x8')]||'';_0x27d368+='\x20<';_0x27d368+=_0x2ec6c1[_0xf2af('0x7')][_0x3afa19]['address']?_0x2ec6c1['value'][_0x3afa19][_0xf2af('0x8')]:_0xf2af('0x9')+random['generate'](0x6)+'@xcally.com';_0x27d368+='>';}}return _0x27d368;}function parseEmail(_0x5d6922,_0x51649f,_0x257a5c){if(_0x51649f[_0xf2af('0x11')]){var _0x282094=/)<[^<]*)*<\/script>/gi;while(_0x282094[_0xf2af('0x12')](_0x51649f[_0xf2af('0x11')])){_0x51649f['html']=_0x51649f[_0xf2af('0x11')]['replace'](_0x282094,'');}_0x257a5c[_0xf2af('0x13')]=_0x51649f[_0xf2af('0x11')];}else{_0x257a5c[_0xf2af('0x13')]=_0x51649f[_0xf2af('0x14')];}if(_0x257a5c[_0xf2af('0x13')]){_0x257a5c[_0xf2af('0x13')]=_0x257a5c[_0xf2af('0x13')][_0xf2af('0x15')](/Empty\x20message

','Attachments','Data','gmail','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook.office365.com','127.0.0.1'];(function(_0x15e2fb,_0x38dc59){var _0x124280=function(_0x19e0a1){while(--_0x19e0a1){_0x15e2fb['push'](_0x15e2fb['shift']());}};_0x124280(++_0x38dc59);}(_0x4c6a,0xb4));var _0xa4c6=function(_0x51f3a2,_0x3368c7){_0x51f3a2=_0x51f3a2-0x0;var _0x4ba8f7=_0x4c6a[_0x51f3a2];return _0x4ba8f7;};'use strict';var _=require(_0xa4c6('0x0'));var moment=require(_0xa4c6('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0xa4c6('0x2'));var util=require('util');var tnef=require(_0xa4c6('0x3'));var logger=require(_0xa4c6('0x4'))(_0xa4c6('0x5'));var config=require('../../../config/environment');function getAddress(_0x4caad4){var _0x594575=_[_0xa4c6('0x6')](_0x4caad4[_0xa4c6('0x7')]);return _0x594575&&_0x594575['address']?_0x594575[_0xa4c6('0x8')]:_0xa4c6('0x9')+random[_0xa4c6('0xa')](0x6)+_0xa4c6('0xb');}function getFirstName(_0x3bbcfe){var _0x52e6db=_['head'](_0x3bbcfe['value']);if(_0x52e6db&&_0x52e6db[_0xa4c6('0xc')]){var _0x100aa8=_0x52e6db['name'][_0xa4c6('0xd')](/\s+/);return _0x100aa8['length']?_0x100aa8[_0xa4c6('0xe')](0x0,-0x1)[_0xa4c6('0xf')]('\x20'):_0x52e6db['name'];}return'Anonymous';}function getLastName(_0x231a93){var _0x381007=_[_0xa4c6('0x6')](_0x231a93[_0xa4c6('0x7')]);if(_0x381007&&_0x381007[_0xa4c6('0xc')]){var _0x233bc6=_0x381007[_0xa4c6('0xc')]['split'](/\s+/);return _0x233bc6[_0xa4c6('0x10')]>0x1?_0x233bc6[_0xa4c6('0x11')]():'';}return'';}function getMails(_0x4af8e0,_0x16eda3){var _0x220d98='';for(var _0x1d33f4=0x0;_0x1d33f4<_0x16eda3[_0xa4c6('0x7')][_0xa4c6('0x10')];_0x1d33f4+=0x1){if(_0x16eda3[_0xa4c6('0x7')][_0x1d33f4][_0xa4c6('0x8')]!==_0x4af8e0){if(!_[_0xa4c6('0x12')](_0x220d98)){_0x220d98+=',';}_0x220d98+=_0x16eda3[_0xa4c6('0x7')][_0x1d33f4]['name']||_0x16eda3[_0xa4c6('0x7')][_0x1d33f4][_0xa4c6('0x8')]||'';_0x220d98+='\x20<';_0x220d98+=_0x16eda3[_0xa4c6('0x7')][_0x1d33f4]['address']?_0x16eda3[_0xa4c6('0x7')][_0x1d33f4][_0xa4c6('0x8')]:'anonymous'+random[_0xa4c6('0xa')](0x6)+_0xa4c6('0xb');_0x220d98+='>';}}return _0x220d98;}function parseEmail(_0x2894c2,_0x5e6bb1,_0xe17d1f){if(_0x5e6bb1['html']){var _0x120f27=/)<[^<]*)*<\/script>/gi;while(_0x120f27['test'](_0x5e6bb1['html'])){_0x5e6bb1['html']=_0x5e6bb1[_0xa4c6('0x13')][_0xa4c6('0x14')](_0x120f27,'');}_0xe17d1f[_0xa4c6('0x15')]=_0x5e6bb1[_0xa4c6('0x13')];}else{_0xe17d1f[_0xa4c6('0x15')]=_0x5e6bb1[_0xa4c6('0x16')];}if(_0xe17d1f['body']){_0xe17d1f['body']=_0xe17d1f['body'][_0xa4c6('0x14')](/0x0){if(this[_0x2a2b74+_0x2809('0x25')]>0x0&&this[_0x2a2b74+_0x2809('0x24')]>=this[_0x2a2b74+'Capacity']){return _0x2809('0x26');}else{return'working';}}else{return'idle';}};Agent[_0x2809('0x27')]['updateRealtime']=function(){var _0x582009=[_0x2809('0x28'),'chat',_0x2809('0x29'),_0x2809('0x2a'),_0x2809('0x2b')];for(var _0x576174=0x0;_0x576174<_0x582009['length'];_0x576174+=0x1){var _0x46b251=this[_0x2809('0x23')](_0x582009[_0x576174]);if(this[_0x582009[_0x576174]+_0x2809('0x2c')]!==_0x46b251){this[_0x582009[_0x576174]+_0x2809('0x2d')]=_[_0x2809('0x2e')](moment()[_0x2809('0x2f')]('x'));}this[_0x582009[_0x576174]+'Status']=_0x46b251;}var _0x2c6a0e={'id':this['id'],'name':this[_0x2809('0x7')],'online':this[_0x2809('0x8')],'voicePause':this[_0x2809('0x9')],'chatPause':this['chatPause'],'mailPause':this[_0x2809('0x30')],'smsPause':this[_0x2809('0xc')],'faxPause':this['faxPause'],'openchannelPause':this[_0x2809('0xd')],'chatStatus':this[_0x2809('0x31')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x2809('0x10')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x2809('0x12')],'mailStatusTime':this[_0x2809('0x13')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x2809('0x32')],'faxStatus':this[_0x2809('0x15')],'faxStatusTime':this[_0x2809('0x33')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x2809('0x17')],'smsStatus':this[_0x2809('0x18')],'smsStatusTime':this[_0x2809('0x19')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x2809('0x1b')],'openchannelStatus':this[_0x2809('0x1c')],'openchannelStatusTime':this[_0x2809('0x1d')],'openchannelCapacity':this[_0x2809('0x1e')],'openchannelCurrentCapacity':this[_0x2809('0x1f')],'busy':this[_0x2809('0x20')],'busyQueue':this['busyQueue']};var _0x15cec2=md5(JSON[_0x2809('0x34')](_0x2c6a0e));if(this['md5']!==_0x15cec2){this[_0x2809('0x1')]=_0x15cec2;io['emit'](_0x2809('0x35'),_0x2c6a0e);}};module['exports']=Agent; \ No newline at end of file +var _0x800a=['chatStatus','faxStatusTime','busyQueue','stringify','emit','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatusTime','chatCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','openchannelStatus','openchannelCurrentCapacity','busy','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','chat','openchannel','fax','sms','StatusTime','toNumber','format','Status'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x800a,0x1bf));var _0xa800=function(_0x8cb973,_0x162cd4){_0x8cb973=_0x8cb973-0x0;var _0x40ad97=_0x800a[_0x8cb973];return _0x40ad97;};'use strict';var _=require(_0xa800('0x0'));var moment=require(_0xa800('0x1'));var md5=require(_0xa800('0x2'));var Redis=require(_0xa800('0x3'));var config=require(_0xa800('0x4'));config['redis']=_[_0xa800('0x5')](config[_0xa800('0x6')],{'host':_0xa800('0x7'),'port':0x18eb});var io=require(_0xa800('0x8'))(new Redis(config['redis']));function Agent(_0x4aa33b){this['id']=_0x4aa33b['id']||0x0;this[_0xa800('0x9')]=_0x4aa33b[_0xa800('0x9')]||'';this[_0xa800('0xa')]=_0x4aa33b[_0xa800('0xa')]||!![];this[_0xa800('0xb')]=_0x4aa33b[_0xa800('0xb')]||![];this[_0xa800('0xc')]=_0x4aa33b['chatPause']||![];this['mailPause']=_0x4aa33b[_0xa800('0xd')]||![];this[_0xa800('0xe')]=_0x4aa33b['faxPause']||![];this[_0xa800('0xf')]=_0x4aa33b['smsPause']||![];this[_0xa800('0x10')]=_0x4aa33b[_0xa800('0x10')]||![];this['chatStatus']='unknown';this[_0xa800('0x11')]=0x0;this[_0xa800('0x12')]=_0x4aa33b[_0xa800('0x12')]||0x0;this['chatCurrentCapacity']=0x0;this[_0xa800('0x13')]=_0xa800('0x14');this[_0xa800('0x15')]=0x0;this[_0xa800('0x16')]=_0x4aa33b['mailCapacity']||0x0;this[_0xa800('0x17')]=0x0;this[_0xa800('0x18')]=_0xa800('0x14');this['faxStatusTime']=0x0;this[_0xa800('0x19')]=_0x4aa33b[_0xa800('0x19')]||0x0;this['faxCurrentCapacity']=0x0;this[_0xa800('0x1a')]=_0xa800('0x14');this[_0xa800('0x1b')]=0x0;this[_0xa800('0x1c')]=_0x4aa33b[_0xa800('0x1c')]||0x0;this[_0xa800('0x1d')]=0x0;this[_0xa800('0x1e')]=_0xa800('0x14');this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x4aa33b['openchannelCapacity']||0x0;this[_0xa800('0x1f')]=0x0;this[_0xa800('0x20')]=![];this['busyQueue']=undefined;this['md5']='';this[_0xa800('0x21')]();}Agent['prototype'][_0xa800('0x22')]=function(_0x148716){if(this[_0x148716+_0xa800('0x23')]>0x0){if(this[_0x148716+_0xa800('0x24')]>0x0&&this[_0x148716+_0xa800('0x23')]>=this[_0x148716+_0xa800('0x24')]){return _0xa800('0x25');}else{return _0xa800('0x26');}}else{return _0xa800('0x27');}};Agent['prototype'][_0xa800('0x21')]=function(){var _0x10aa26=['mail',_0xa800('0x28'),_0xa800('0x29'),_0xa800('0x2a'),_0xa800('0x2b')];for(var _0x39267e=0x0;_0x39267e<_0x10aa26['length'];_0x39267e+=0x1){var _0x1ae472=this[_0xa800('0x22')](_0x10aa26[_0x39267e]);if(this[_0x10aa26[_0x39267e]+'Status']!==_0x1ae472){this[_0x10aa26[_0x39267e]+_0xa800('0x2c')]=_[_0xa800('0x2d')](moment()[_0xa800('0x2e')]('x'));}this[_0x10aa26[_0x39267e]+_0xa800('0x2f')]=_0x1ae472;}var _0x62f603={'id':this['id'],'name':this[_0xa800('0x9')],'online':this['online'],'voicePause':this[_0xa800('0xb')],'chatPause':this[_0xa800('0xc')],'mailPause':this['mailPause'],'smsPause':this[_0xa800('0xf')],'faxPause':this['faxPause'],'openchannelPause':this[_0xa800('0x10')],'chatStatus':this[_0xa800('0x30')],'chatStatusTime':this[_0xa800('0x11')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xa800('0x13')],'mailStatusTime':this[_0xa800('0x15')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xa800('0x31')],'faxCapacity':this[_0xa800('0x19')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xa800('0x1a')],'smsStatusTime':this[_0xa800('0x1b')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0xa800('0x1d')],'openchannelStatus':this[_0xa800('0x1e')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xa800('0x1f')],'busy':this[_0xa800('0x20')],'busyQueue':this[_0xa800('0x32')]};var _0x5a1503=md5(JSON[_0xa800('0x33')](_0x62f603));if(this[_0xa800('0x2')]!==_0x5a1503){this[_0xa800('0x2')]=_0x5a1503;io[_0xa800('0x34')](_0xa800('0x35'),_0x62f603);}};module[_0xa800('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 fe32ca3..4eb9ff0 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 _0x8b7f=['strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','length','online','paused','loggedIn','available','stringify','format','chat:queue:%s','chat_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x8b7f,0x12a));var _0xf8b7=function(_0x16d081,_0x2e946d){_0x16d081=_0x16d081-0x0;var _0x4bdfca=_0x8b7f[_0x16d081];return _0x4bdfca;};'use strict';var _=require(_0xf8b7('0x0'));var md5=require(_0xf8b7('0x1'));var util=require(_0xf8b7('0x2'));var Redis=require('ioredis');var config=require(_0xf8b7('0x3'));config[_0xf8b7('0x4')]=_[_0xf8b7('0x5')](config['redis'],{'host':_0xf8b7('0x6'),'port':0x18eb});var io=require(_0xf8b7('0x7'))(new Redis(config[_0xf8b7('0x4')]));function ChatQueue(_0xba125b){this['id']=_0xba125b['id']||0x0;this[_0xf8b7('0x8')]=_0xba125b[_0xf8b7('0x8')]||'';this[_0xf8b7('0x9')]=_0xba125b['timeout']||0xa;this[_0xf8b7('0xa')]=_0xba125b[_0xf8b7('0xa')]||_0xf8b7('0xb');this[_0xf8b7('0xc')]=_0xba125b['Agents'];this[_0xf8b7('0xd')]={};this[_0xf8b7('0xe')]=0x0;this[_0xf8b7('0x1')]='';this[_0xf8b7('0xf')]();this[_0xf8b7('0x10')]();}ChatQueue['prototype'][_0xf8b7('0xf')]=function(){var _0x510159=this[_0xf8b7('0xd')][_0xf8b7('0x11')];this['mapAgentsId']=_['map'](this[_0xf8b7('0xc')],'id');this[_0xf8b7('0xd')][_0xf8b7('0x11')]=_0x510159;};ChatQueue['prototype'][_0xf8b7('0x10')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x457b9e=0x0;_0x457b9e=0x0?this[_0xf8b7('0x16')]:0x0;var _0x312376={'id':this['id'],'available':this[_0xf8b7('0x16')],'loggedIn':this[_0xf8b7('0x15')],'name':this[_0xf8b7('0x8')],'paused':this[_0xf8b7('0x14')],'waiting':this['waiting']};var _0x3a629d=md5(JSON[_0xf8b7('0x17')](_0x312376));if(this[_0xf8b7('0x1')]!==_0x3a629d){this['md5']=_0x3a629d;io['to'](util[_0xf8b7('0x18')](_0xf8b7('0x19'),_0x312376[_0xf8b7('0x8')]))['emit'](_0xf8b7('0x1a'),_0x312376);}};module[_0xf8b7('0x1b')]=ChatQueue; \ No newline at end of file +var _0x69e1=['../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','Agents','loggedIn','paused','length','online','chatPause','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis'];(function(_0x598612,_0x2f792f){var _0x3e6824=function(_0x48fdfe){while(--_0x48fdfe){_0x598612['push'](_0x598612['shift']());}};_0x3e6824(++_0x2f792f);}(_0x69e1,0x1bc));var _0x169e=function(_0x74cb9,_0x310048){_0x74cb9=_0x74cb9-0x0;var _0x5c7a7d=_0x69e1[_0x74cb9];return _0x5c7a7d;};'use strict';var _=require(_0x169e('0x0'));var md5=require(_0x169e('0x1'));var util=require(_0x169e('0x2'));var Redis=require(_0x169e('0x3'));var config=require(_0x169e('0x4'));config[_0x169e('0x5')]=_[_0x169e('0x6')](config[_0x169e('0x5')],{'host':_0x169e('0x7'),'port':0x18eb});var io=require(_0x169e('0x8'))(new Redis(config[_0x169e('0x5')]));function ChatQueue(_0x153982){this['id']=_0x153982['id']||0x0;this[_0x169e('0x9')]=_0x153982[_0x169e('0x9')]||'';this['timeout']=_0x153982[_0x169e('0xa')]||0xa;this[_0x169e('0xb')]=_0x153982[_0x169e('0xb')]||'beepall';this['Agents']=_0x153982['Agents'];this['mapAgentsId']={};this[_0x169e('0xc')]=0x0;this[_0x169e('0x1')]='';this[_0x169e('0xd')]();this[_0x169e('0xe')]();}ChatQueue[_0x169e('0xf')][_0x169e('0xd')]=function(){var _0x3b6066=this[_0x169e('0x10')][_0x169e('0x11')];this['mapAgentsId']=_[_0x169e('0x12')](this[_0x169e('0x13')],'id');this[_0x169e('0x10')][_0x169e('0x11')]=_0x3b6066;};ChatQueue['prototype'][_0x169e('0xe')]=function(){this[_0x169e('0x14')]=0x0;this[_0x169e('0x15')]=0x0;for(var _0x2a68a0=0x0;_0x2a68a0=0x0?this[_0x169e('0x19')]:0x0;var _0x1d7685={'id':this['id'],'available':this[_0x169e('0x19')],'loggedIn':this[_0x169e('0x14')],'name':this[_0x169e('0x9')],'paused':this[_0x169e('0x15')],'waiting':this[_0x169e('0xc')]};var _0x53aac6=md5(JSON[_0x169e('0x1a')](_0x1d7685));if(this['md5']!==_0x53aac6){this[_0x169e('0x1')]=_0x53aac6;io['to'](util[_0x169e('0x1b')](_0x169e('0x1c'),_0x1d7685[_0x169e('0x9')]))[_0x169e('0x1d')](_0x169e('0x1e'),_0x1d7685);}};module[_0x169e('0x1f')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 23ab826..e9ac8f4 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 _0xa3e4=['updateRealtime','loggedIn','paused','length','online','faxPause','available','stringify','fax:queue:%s','fax_queue:save','exports','lodash','md5','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','_rr','map','prototype'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0xa3e4,0x119));var _0x4a3e=function(_0x2b1fa9,_0x2e6a4b){_0x2b1fa9=_0x2b1fa9-0x0;var _0x405640=_0xa3e4[_0x2b1fa9];return _0x405640;};'use strict';var _=require(_0x4a3e('0x0'));var md5=require(_0x4a3e('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x4a3e('0x2')]=_[_0x4a3e('0x3')](config[_0x4a3e('0x2')],{'host':_0x4a3e('0x4'),'port':0x18eb});var io=require(_0x4a3e('0x5'))(new Redis(config[_0x4a3e('0x2')]));function FaxQueue(_0x33d68e){this['id']=_0x33d68e['id']||0x0;this[_0x4a3e('0x6')]=_0x33d68e[_0x4a3e('0x6')]||'';this[_0x4a3e('0x7')]=_0x33d68e[_0x4a3e('0x7')]||0xa;this[_0x4a3e('0x8')]=_0x33d68e[_0x4a3e('0x8')]||'beepall';this[_0x4a3e('0x9')]=_0x33d68e[_0x4a3e('0x9')];this[_0x4a3e('0xa')]={};this[_0x4a3e('0xb')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}FaxQueue['prototype'][_0x4a3e('0xc')]=function(){var _0x412190=this[_0x4a3e('0xa')][_0x4a3e('0xd')];this[_0x4a3e('0xa')]=_[_0x4a3e('0xe')](this['Agents'],'id');this['mapAgentsId'][_0x4a3e('0xd')]=_0x412190;};FaxQueue[_0x4a3e('0xf')][_0x4a3e('0x10')]=function(){this[_0x4a3e('0x11')]=0x0;this[_0x4a3e('0x12')]=0x0;for(var _0x1b434f=0x0;_0x1b434f=0x0?this[_0x4a3e('0x16')]:0x0;var _0x4dfe95={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x4a3e('0x6')],'paused':this[_0x4a3e('0x12')],'waiting':this[_0x4a3e('0xb')]};var _0x3c25b9=md5(JSON[_0x4a3e('0x17')](_0x4dfe95));if(this[_0x4a3e('0x1')]!==_0x3c25b9){this[_0x4a3e('0x1')]=_0x3c25b9;io['to'](util['format'](_0x4a3e('0x18'),_0x4dfe95[_0x4a3e('0x6')]))['emit'](_0x4a3e('0x19'),_0x4dfe95);}};module[_0x4a3e('0x1a')]=FaxQueue; \ No newline at end of file +var _0xb9b0=['faxPause','available','stringify','format','emit','exports','lodash','md5','util','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','prototype','mapAgentsId','map','loggedIn','paused','length','online'];(function(_0x20c124,_0x20ac72){var _0x573050=function(_0x26a016){while(--_0x26a016){_0x20c124['push'](_0x20c124['shift']());}};_0x573050(++_0x20ac72);}(_0xb9b0,0xbc));var _0x0b9b=function(_0x2bd432,_0x2e1b6c){_0x2bd432=_0x2bd432-0x0;var _0x39ba6c=_0xb9b0[_0x2bd432];return _0x39ba6c;};'use strict';var _=require(_0x0b9b('0x0'));var md5=require(_0x0b9b('0x1'));var util=require(_0x0b9b('0x2'));var Redis=require(_0x0b9b('0x3'));var config=require('../../../config/environment');config[_0x0b9b('0x4')]=_['defaults'](config[_0x0b9b('0x4')],{'host':_0x0b9b('0x5'),'port':0x18eb});var io=require(_0x0b9b('0x6'))(new Redis(config[_0x0b9b('0x4')]));function FaxQueue(_0x3352e7){this['id']=_0x3352e7['id']||0x0;this[_0x0b9b('0x7')]=_0x3352e7[_0x0b9b('0x7')]||'';this[_0x0b9b('0x8')]=_0x3352e7[_0x0b9b('0x8')]||0xa;this['strategy']=_0x3352e7[_0x0b9b('0x9')]||'beepall';this[_0x0b9b('0xa')]=_0x3352e7[_0x0b9b('0xa')];this['mapAgentsId']={};this[_0x0b9b('0xb')]=0x0;this[_0x0b9b('0x1')]='';this[_0x0b9b('0xc')]();this['updateRealtime']();}FaxQueue[_0x0b9b('0xd')][_0x0b9b('0xc')]=function(){var _0x45e43a=this[_0x0b9b('0xe')]['_rr'];this[_0x0b9b('0xe')]=_[_0x0b9b('0xf')](this[_0x0b9b('0xa')],'id');this[_0x0b9b('0xe')]['_rr']=_0x45e43a;};FaxQueue[_0x0b9b('0xd')]['updateRealtime']=function(){this[_0x0b9b('0x10')]=0x0;this[_0x0b9b('0x11')]=0x0;for(var _0x2f7896=0x0;_0x2f7896=0x0?this[_0x0b9b('0x15')]:0x0;var _0x4fece5={'id':this['id'],'available':this[_0x0b9b('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x0b9b('0x7')],'paused':this[_0x0b9b('0x11')],'waiting':this[_0x0b9b('0xb')]};var _0x2f2df5=md5(JSON[_0x0b9b('0x16')](_0x4fece5));if(this[_0x0b9b('0x1')]!==_0x2f2df5){this[_0x0b9b('0x1')]=_0x2f2df5;io['to'](util[_0x0b9b('0x17')]('fax:queue:%s',_0x4fece5[_0x0b9b('0x7')]))[_0x0b9b('0x18')]('fax_queue:save',_0x4fece5);}};module[_0x0b9b('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 ec66427..83275a3 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 _0xb6b4=['Intervals','exports','name'];(function(_0x5b770d,_0x1adc88){var _0x4ee575=function(_0x4e0b6b){while(--_0x4e0b6b){_0x5b770d['push'](_0x5b770d['shift']());}};_0x4ee575(++_0x1adc88);}(_0xb6b4,0x15b));var _0x4b6b=function(_0x148be6,_0x3159b3){_0x148be6=_0x148be6-0x0;var _0x61aa5e=_0xb6b4[_0x148be6];return _0x61aa5e;};'use strict';function Interval(_0x437b3d){this['id']=_0x437b3d['id']||0x0;this[_0x4b6b('0x0')]=_0x437b3d[_0x4b6b('0x0')]||'';this[_0x4b6b('0x1')]=_0x437b3d[_0x4b6b('0x1')]||{};}module[_0x4b6b('0x2')]=Interval; \ No newline at end of file +var _0x1a45=['Intervals','exports','name'];(function(_0x1dbe03,_0x52144c){var _0x86b324=function(_0xbe7d81){while(--_0xbe7d81){_0x1dbe03['push'](_0x1dbe03['shift']());}};_0x86b324(++_0x52144c);}(_0x1a45,0x1c1));var _0x51a4=function(_0x5f1c9,_0x28d281){_0x5f1c9=_0x5f1c9-0x0;var _0x151d17=_0x1a45[_0x5f1c9];return _0x151d17;};'use strict';function Interval(_0x261699){this['id']=_0x261699['id']||0x0;this[_0x51a4('0x0')]=_0x261699['name']||'';this[_0x51a4('0x1')]=_0x261699['Intervals']||{};}module[_0x51a4('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 547e0ba..21329e9 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 _0xbba1=['Agents','online','available','mail:queue:%s','emit','lodash','ioredis','../../../config/environment','redis','name','timeout','strategy','beepall','mapAgentsId','md5','updateRouting','prototype','map','_rr','loggedIn','paused'];(function(_0x4f9e4b,_0x255721){var _0x34529d=function(_0x4d7065){while(--_0x4d7065){_0x4f9e4b['push'](_0x4f9e4b['shift']());}};_0x34529d(++_0x255721);}(_0xbba1,0x17f));var _0x1bba=function(_0x5419ef,_0x3f7cd8){_0x5419ef=_0x5419ef-0x0;var _0x2e0180=_0xbba1[_0x5419ef];return _0x2e0180;};'use strict';var _=require(_0x1bba('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x1bba('0x1'));var config=require(_0x1bba('0x2'));config['redis']=_['defaults'](config[_0x1bba('0x3')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1bba('0x3')]));function MailQueue(_0x53402b){this['id']=_0x53402b['id']||0x0;this['name']=_0x53402b[_0x1bba('0x4')]||'';this[_0x1bba('0x5')]=_0x53402b[_0x1bba('0x5')]||0xa;this[_0x1bba('0x6')]=_0x53402b[_0x1bba('0x6')]||_0x1bba('0x7');this['Agents']=_0x53402b['Agents'];this[_0x1bba('0x8')]={};this['waiting']=0x0;this[_0x1bba('0x9')]='';this[_0x1bba('0xa')]();this['updateRealtime']();}MailQueue[_0x1bba('0xb')]['updateRouting']=function(){var _0x4f0509=this[_0x1bba('0x8')]['_rr'];this[_0x1bba('0x8')]=_[_0x1bba('0xc')](this['Agents'],'id');this[_0x1bba('0x8')][_0x1bba('0xd')]=_0x4f0509;};MailQueue[_0x1bba('0xb')]['updateRealtime']=function(){this[_0x1bba('0xe')]=0x0;this[_0x1bba('0xf')]=0x0;for(var _0x113a49=0x0;_0x113a49=0x0?this[_0x1bba('0x12')]:0x0;var _0x580539={'id':this['id'],'available':this[_0x1bba('0x12')],'loggedIn':this[_0x1bba('0xe')],'name':this[_0x1bba('0x4')],'paused':this[_0x1bba('0xf')],'waiting':this['waiting']};var _0x1cf6e9=md5(JSON['stringify'](_0x580539));if(this[_0x1bba('0x9')]!==_0x1cf6e9){this['md5']=_0x1cf6e9;io['to'](util['format'](_0x1bba('0x13'),_0x580539[_0x1bba('0x4')]))[_0x1bba('0x14')]('mail_queue:save',_0x580539);}};module['exports']=MailQueue; \ No newline at end of file +var _0x202a=['mail:queue:%s','emit','exports','md5','util','ioredis','redis','socket.io-emitter','name','strategy','beepall','Agents','updateRouting','updateRealtime','prototype','_rr','mapAgentsId','map','loggedIn','paused','length','online','mailPause','available','waiting','stringify','format'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x202a,0xc0));var _0xa202=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x202a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var md5=require(_0xa202('0x0'));var util=require(_0xa202('0x1'));var Redis=require(_0xa202('0x2'));var config=require('../../../config/environment');config[_0xa202('0x3')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xa202('0x4'))(new Redis(config[_0xa202('0x3')]));function MailQueue(_0x56c359){this['id']=_0x56c359['id']||0x0;this['name']=_0x56c359[_0xa202('0x5')]||'';this['timeout']=_0x56c359['timeout']||0xa;this['strategy']=_0x56c359[_0xa202('0x6')]||_0xa202('0x7');this[_0xa202('0x8')]=_0x56c359[_0xa202('0x8')];this['mapAgentsId']={};this['waiting']=0x0;this[_0xa202('0x0')]='';this[_0xa202('0x9')]();this[_0xa202('0xa')]();}MailQueue[_0xa202('0xb')]['updateRouting']=function(){var _0x45ecc8=this['mapAgentsId'][_0xa202('0xc')];this[_0xa202('0xd')]=_[_0xa202('0xe')](this['Agents'],'id');this[_0xa202('0xd')][_0xa202('0xc')]=_0x45ecc8;};MailQueue[_0xa202('0xb')][_0xa202('0xa')]=function(){this[_0xa202('0xf')]=0x0;this[_0xa202('0x10')]=0x0;for(var _0x598d8e=0x0;_0x598d8e=0x0?this[_0xa202('0x14')]:0x0;var _0x53ff78={'id':this['id'],'available':this[_0xa202('0x14')],'loggedIn':this['loggedIn'],'name':this[_0xa202('0x5')],'paused':this[_0xa202('0x10')],'waiting':this[_0xa202('0x15')]};var _0xfce413=md5(JSON[_0xa202('0x16')](_0x53ff78));if(this['md5']!==_0xfce413){this[_0xa202('0x0')]=_0xfce413;io['to'](util[_0xa202('0x17')](_0xa202('0x18'),_0x53ff78[_0xa202('0x5')]))[_0xa202('0x19')]('mail_queue:save',_0x53ff78);}};module[_0xa202('0x1a')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 8a0ad2e..09f2d20 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 _0xc9cd=['socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','paused','length','online','loggedIn','openchannelPause','available','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost'];(function(_0x4c29f7,_0x820749){var _0x2edc8e=function(_0x4868b6){while(--_0x4868b6){_0x4c29f7['push'](_0x4c29f7['shift']());}};_0x2edc8e(++_0x820749);}(_0xc9cd,0x17e));var _0xdc9c=function(_0xb60ae4,_0x48b458){_0xb60ae4=_0xb60ae4-0x0;var _0x53d530=_0xc9cd[_0xb60ae4];return _0x53d530;};'use strict';var _=require(_0xdc9c('0x0'));var md5=require(_0xdc9c('0x1'));var util=require(_0xdc9c('0x2'));var Redis=require(_0xdc9c('0x3'));var config=require(_0xdc9c('0x4'));config[_0xdc9c('0x5')]=_[_0xdc9c('0x6')](config[_0xdc9c('0x5')],{'host':_0xdc9c('0x7'),'port':0x18eb});var io=require(_0xdc9c('0x8'))(new Redis(config['redis']));function OpenchannelQueue(_0x1faf1e){this['id']=_0x1faf1e['id']||0x0;this[_0xdc9c('0x9')]=_0x1faf1e['name']||'';this[_0xdc9c('0xa')]=_0x1faf1e[_0xdc9c('0xa')]||0xa;this[_0xdc9c('0xb')]=_0x1faf1e[_0xdc9c('0xb')]||_0xdc9c('0xc');this[_0xdc9c('0xd')]=_0x1faf1e[_0xdc9c('0xd')];this[_0xdc9c('0xe')]={};this[_0xdc9c('0xf')]=0x0;this[_0xdc9c('0x1')]='';this[_0xdc9c('0x10')]();this[_0xdc9c('0x11')]();}OpenchannelQueue[_0xdc9c('0x12')][_0xdc9c('0x10')]=function(){var _0x53321c=this['mapAgentsId'][_0xdc9c('0x13')];this[_0xdc9c('0xe')]=_['map'](this[_0xdc9c('0xd')],'id');this[_0xdc9c('0xe')]['_rr']=_0x53321c;};OpenchannelQueue[_0xdc9c('0x12')][_0xdc9c('0x11')]=function(){this['loggedIn']=0x0;this[_0xdc9c('0x14')]=0x0;for(var _0x224a9e=0x0;_0x224a9e=0x0?this[_0xdc9c('0x19')]:0x0;var _0x142ba7={'id':this['id'],'available':this[_0xdc9c('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xdc9c('0x14')],'waiting':this['waiting']};var _0x35c54e=md5(JSON['stringify'](_0x142ba7));if(this[_0xdc9c('0x1')]!==_0x35c54e){this[_0xdc9c('0x1')]=_0x35c54e;io['to'](util['format']('openchannel:queue:%s',_0x142ba7['name']))['emit']('openchannel_queue:save',_0x142ba7);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0x5453=['stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','map','prototype','updateRealtime','loggedIn','openchannelPause','paused','available'];(function(_0x44474f,_0x431580){var _0x427d97=function(_0x53f7d4){while(--_0x53f7d4){_0x44474f['push'](_0x44474f['shift']());}};_0x427d97(++_0x431580);}(_0x5453,0x18d));var _0x3545=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5453[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var md5=require(_0x3545('0x0'));var util=require(_0x3545('0x1'));var Redis=require('ioredis');var config=require(_0x3545('0x2'));config[_0x3545('0x3')]=_[_0x3545('0x4')](config[_0x3545('0x3')],{'host':_0x3545('0x5'),'port':0x18eb});var io=require(_0x3545('0x6'))(new Redis(config['redis']));function OpenchannelQueue(_0x3430b1){this['id']=_0x3430b1['id']||0x0;this[_0x3545('0x7')]=_0x3430b1[_0x3545('0x7')]||'';this[_0x3545('0x8')]=_0x3430b1[_0x3545('0x8')]||0xa;this[_0x3545('0x9')]=_0x3430b1[_0x3545('0x9')]||_0x3545('0xa');this['Agents']=_0x3430b1[_0x3545('0xb')];this[_0x3545('0xc')]={};this[_0x3545('0xd')]=0x0;this['md5']='';this[_0x3545('0xe')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x3545('0xe')]=function(){var _0x565e42=this[_0x3545('0xc')][_0x3545('0xf')];this[_0x3545('0xc')]=_[_0x3545('0x10')](this[_0x3545('0xb')],'id');this[_0x3545('0xc')][_0x3545('0xf')]=_0x565e42;};OpenchannelQueue[_0x3545('0x11')][_0x3545('0x12')]=function(){this[_0x3545('0x13')]=0x0;this['paused']=0x0;for(var _0x565338=0x0;_0x565338=0x0?this[_0x3545('0x16')]:0x0;var _0x3f1c2c={'id':this['id'],'available':this['available'],'loggedIn':this[_0x3545('0x13')],'name':this[_0x3545('0x7')],'paused':this['paused'],'waiting':this[_0x3545('0xd')]};var _0x3858d7=md5(JSON[_0x3545('0x17')](_0x3f1c2c));if(this[_0x3545('0x0')]!==_0x3858d7){this['md5']=_0x3858d7;io['to'](util[_0x3545('0x18')](_0x3545('0x19'),_0x3f1c2c['name']))[_0x3545('0x1a')](_0x3545('0x1b'),_0x3f1c2c);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 641c55d..2a52556 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 _0x967c=['format','emit','sms_queue:save','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','loggedIn','paused','online','smsPause','available','stringify'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x967c,0xed));var _0xc967=function(_0x43dc4c,_0x154777){_0x43dc4c=_0x43dc4c-0x0;var _0x564cdc=_0x967c[_0x43dc4c];return _0x564cdc;};'use strict';var _=require('lodash');var md5=require(_0xc967('0x0'));var util=require(_0xc967('0x1'));var Redis=require(_0xc967('0x2'));var config=require(_0xc967('0x3'));config[_0xc967('0x4')]=_[_0xc967('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xc967('0x6'))(new Redis(config[_0xc967('0x4')]));function SmsQueue(_0x33e7b6){this['id']=_0x33e7b6['id']||0x0;this[_0xc967('0x7')]=_0x33e7b6[_0xc967('0x7')]||'';this[_0xc967('0x8')]=_0x33e7b6['timeout']||0xa;this['strategy']=_0x33e7b6[_0xc967('0x9')]||'beepall';this['Agents']=_0x33e7b6[_0xc967('0xa')];this['mapAgentsId']={};this[_0xc967('0xb')]=0x0;this[_0xc967('0x0')]='';this[_0xc967('0xc')]();this[_0xc967('0xd')]();}SmsQueue[_0xc967('0xe')][_0xc967('0xc')]=function(){var _0x31f024=this[_0xc967('0xf')][_0xc967('0x10')];this[_0xc967('0xf')]=_['map'](this['Agents'],'id');this[_0xc967('0xf')]['_rr']=_0x31f024;};SmsQueue[_0xc967('0xe')][_0xc967('0xd')]=function(){this[_0xc967('0x11')]=0x0;this[_0xc967('0x12')]=0x0;for(var _0x4ba17b=0x0;_0x4ba17b=0x0?this[_0xc967('0x15')]:0x0;var _0x1e2c0e={'id':this['id'],'available':this[_0xc967('0x15')],'loggedIn':this[_0xc967('0x11')],'name':this[_0xc967('0x7')],'paused':this[_0xc967('0x12')],'waiting':this[_0xc967('0xb')]};var _0x2b4d62=md5(JSON[_0xc967('0x16')](_0x1e2c0e));if(this[_0xc967('0x0')]!==_0x2b4d62){this['md5']=_0x2b4d62;io['to'](util[_0xc967('0x17')]('sms:queue:%s',_0x1e2c0e[_0xc967('0x7')]))[_0xc967('0x18')](_0xc967('0x19'),_0x1e2c0e);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x98b1=['map','paused','online','loggedIn','available','stringify','format','sms:queue:%s','emit','sms_queue:save','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr'];(function(_0x5b5e12,_0x2a751e){var _0x4e3789=function(_0x831ac4){while(--_0x831ac4){_0x5b5e12['push'](_0x5b5e12['shift']());}};_0x4e3789(++_0x2a751e);}(_0x98b1,0x1a0));var _0x198b=function(_0x2713ea,_0x2d5c63){_0x2713ea=_0x2713ea-0x0;var _0x5c9bac=_0x98b1[_0x2713ea];return _0x5c9bac;};'use strict';var _=require(_0x198b('0x0'));var md5=require(_0x198b('0x1'));var util=require('util');var Redis=require(_0x198b('0x2'));var config=require(_0x198b('0x3'));config[_0x198b('0x4')]=_[_0x198b('0x5')](config['redis'],{'host':_0x198b('0x6'),'port':0x18eb});var io=require(_0x198b('0x7'))(new Redis(config[_0x198b('0x4')]));function SmsQueue(_0x5d27bd){this['id']=_0x5d27bd['id']||0x0;this[_0x198b('0x8')]=_0x5d27bd[_0x198b('0x8')]||'';this[_0x198b('0x9')]=_0x5d27bd[_0x198b('0x9')]||0xa;this[_0x198b('0xa')]=_0x5d27bd['strategy']||_0x198b('0xb');this['Agents']=_0x5d27bd[_0x198b('0xc')];this['mapAgentsId']={};this[_0x198b('0xd')]=0x0;this[_0x198b('0x1')]='';this[_0x198b('0xe')]();this[_0x198b('0xf')]();}SmsQueue[_0x198b('0x10')][_0x198b('0xe')]=function(){var _0x4ca7e5=this[_0x198b('0x11')][_0x198b('0x12')];this[_0x198b('0x11')]=_[_0x198b('0x13')](this[_0x198b('0xc')],'id');this['mapAgentsId'][_0x198b('0x12')]=_0x4ca7e5;};SmsQueue[_0x198b('0x10')][_0x198b('0xf')]=function(){this['loggedIn']=0x0;this[_0x198b('0x14')]=0x0;for(var _0x10eb5e=0x0;_0x10eb5e=0x0?this[_0x198b('0x17')]:0x0;var _0x4c2379={'id':this['id'],'available':this[_0x198b('0x17')],'loggedIn':this[_0x198b('0x16')],'name':this[_0x198b('0x8')],'paused':this[_0x198b('0x14')],'waiting':this[_0x198b('0xd')]};var _0x4e0329=md5(JSON[_0x198b('0x18')](_0x4c2379));if(this[_0x198b('0x1')]!==_0x4e0329){this[_0x198b('0x1')]=_0x4e0329;io['to'](util[_0x198b('0x19')](_0x198b('0x1a'),_0x4c2379[_0x198b('0x8')]))[_0x198b('0x1b')](_0x198b('0x1c'),_0x4c2379);}};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 c46a6db..ea77d1a 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 _0xae15=['mailQueues','initFaxQueues','faxQueues','exports','bluebird','util','lodash','moment','../model/agent','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','agents','intervals','openchannelQueues','chatQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','hasOwnProperty','mergeFromDatabase','prototype','length','isUndefined','initIntervals','updateRouting','initChatQueues','updateRealtime','initSmsQueues','smsQueues'];(function(_0x540b81,_0x401a0a){var _0x21fe79=function(_0x3989bd){while(--_0x3989bd){_0x540b81['push'](_0x540b81['shift']());}};_0x21fe79(++_0x401a0a);}(_0xae15,0x1b4));var _0x5ae1=function(_0x57bb60,_0x5dc2c9){_0x57bb60=_0x57bb60-0x0;var _0x5b3b3a=_0xae15[_0x57bb60];return _0x5b3b3a;};'use strict';var BPromise=require(_0x5ae1('0x0'));var util=require(_0x5ae1('0x1'));var _=require(_0x5ae1('0x2'));var moment=require(_0x5ae1('0x3'));var Agent=require(_0x5ae1('0x4'));var Interval=require(_0x5ae1('0x5'));var OpenchannelQueue=require(_0x5ae1('0x6'));var ChatQueue=require(_0x5ae1('0x7'));var SmsQueue=require(_0x5ae1('0x8'));var MailQueue=require(_0x5ae1('0x9'));var FaxQueue=require(_0x5ae1('0xa'));var Realtime=function(){this[_0x5ae1('0xb')]={};this[_0x5ae1('0xc')]={};this[_0x5ae1('0xd')]={};this[_0x5ae1('0xe')]={};this['smsQueues']={};this['mailQueues']={};this['faxQueues']={};this[_0x5ae1('0xf')]={};this[_0x5ae1('0x10')]={};this[_0x5ae1('0x11')]={};this[_0x5ae1('0x12')]={};this[_0x5ae1('0x13')]={};};function freeIsNotKey(_0x3e6ffd,_0x287b7e,_0x12e18f){var _0x114964=_[_0x5ae1('0x14')](_0x3e6ffd,function(_0x2e148f,_0x5ee32d){return _0x2e148f[_0x12e18f];});for(var _0x7194f6 in _0x287b7e){if(_0x287b7e[_0x5ae1('0x15')](_0x7194f6)){if(!_0x114964[_0x7194f6]){delete _0x287b7e[_0x7194f6];}}}}Realtime['prototype'][_0x5ae1('0x16')]=function(_0x54b75c,_0x33948e){for(var _0x4bb066 in _0x33948e){if(_0x54b75c[_0x5ae1('0x15')](_0x4bb066)){_0x54b75c[_0x4bb066]=_0x33948e[_0x4bb066];}}};Realtime[_0x5ae1('0x17')]['initAgents']=function(){var _0x164101=this;return function(_0x4b6f2a){if(_0x4b6f2a){freeIsNotKey(_0x4b6f2a,_0x164101[_0x5ae1('0xb')],'id');for(var _0x142efb=0x0,_0x1fd635={},_0x510e84={};_0x142efb<_0x4b6f2a[_0x5ae1('0x18')];_0x142efb+=0x1){_0x1fd635=_0x4b6f2a[_0x142efb];if(_[_0x5ae1('0x19')](_0x164101[_0x5ae1('0xb')][_0x1fd635['id']])){_0x164101[_0x5ae1('0xb')][_0x1fd635['id']]=new Agent(_0x1fd635);}else{_0x164101[_0x5ae1('0x16')](_0x164101[_0x5ae1('0xb')][_0x1fd635['id']],_0x1fd635);}}}return _0x164101[_0x5ae1('0xb')];};};Realtime[_0x5ae1('0x17')][_0x5ae1('0x1a')]=function(){var _0x26bb8f=this;return function(_0x12708d){if(_0x12708d){freeIsNotKey(_0x12708d,_0x26bb8f[_0x5ae1('0xc')],'id');for(var _0x4246a5=0x0,_0x144749={},_0x3278ba={};_0x4246a5<_0x12708d['length'];_0x4246a5+=0x1){_0x144749=_0x12708d[_0x4246a5];if(_[_0x5ae1('0x19')](_0x26bb8f[_0x5ae1('0xc')][_0x144749['id']])){_0x26bb8f['intervals'][_0x144749['id']]=new Interval(_0x144749);}else{_0x26bb8f[_0x5ae1('0x16')](_0x26bb8f[_0x5ae1('0xc')][_0x144749['id']],_0x144749);}}}return _0x26bb8f[_0x5ae1('0xc')];};};Realtime[_0x5ae1('0x17')]['initOpenchannelQueues']=function(){var _0x3376c3=this;return function(_0x2d14d5){if(_0x2d14d5){freeIsNotKey(_0x2d14d5,_0x3376c3[_0x5ae1('0xd')],'id');for(var _0x390a52=0x0,_0x1a8d7c={},_0x2d98b1={};_0x390a52<_0x2d14d5['length'];_0x390a52+=0x1){_0x1a8d7c=_0x2d14d5[_0x390a52];if(_['isUndefined'](_0x3376c3[_0x5ae1('0xd')][_0x1a8d7c['id']])){_0x3376c3[_0x5ae1('0xd')][_0x1a8d7c['id']]=new OpenchannelQueue(_0x1a8d7c);}else{_0x3376c3[_0x5ae1('0x16')](_0x3376c3[_0x5ae1('0xd')][_0x1a8d7c['id']],_0x1a8d7c);}_0x3376c3[_0x5ae1('0xd')][_0x1a8d7c['id']][_0x5ae1('0x1b')]();_0x3376c3[_0x5ae1('0xd')][_0x1a8d7c['id']]['updateRealtime']();}}return _0x3376c3[_0x5ae1('0xd')];};};Realtime['prototype'][_0x5ae1('0x1c')]=function(){var _0x13cdca=this;return function(_0x1cfb88){if(_0x1cfb88){freeIsNotKey(_0x1cfb88,_0x13cdca[_0x5ae1('0xe')],'id');for(var _0x3c6881=0x0,_0x24b64e={},_0x1888b1={};_0x3c6881<_0x1cfb88[_0x5ae1('0x18')];_0x3c6881+=0x1){_0x24b64e=_0x1cfb88[_0x3c6881];if(_[_0x5ae1('0x19')](_0x13cdca[_0x5ae1('0xe')][_0x24b64e['id']])){_0x13cdca[_0x5ae1('0xe')][_0x24b64e['id']]=new ChatQueue(_0x24b64e);}else{_0x13cdca['mergeFromDatabase'](_0x13cdca['chatQueues'][_0x24b64e['id']],_0x24b64e);}_0x13cdca['chatQueues'][_0x24b64e['id']]['updateRouting']();_0x13cdca[_0x5ae1('0xe')][_0x24b64e['id']][_0x5ae1('0x1d')]();}}return _0x13cdca[_0x5ae1('0xe')];};};Realtime[_0x5ae1('0x17')][_0x5ae1('0x1e')]=function(){var _0x2a75ad=this;return function(_0x1c379f){if(_0x1c379f){freeIsNotKey(_0x1c379f,_0x2a75ad[_0x5ae1('0x1f')],'id');for(var _0x5ec1bd=0x0,_0x110119={},_0x4b324f={};_0x5ec1bd<_0x1c379f['length'];_0x5ec1bd+=0x1){_0x110119=_0x1c379f[_0x5ec1bd];if(_['isUndefined'](_0x2a75ad['smsQueues'][_0x110119['id']])){_0x2a75ad[_0x5ae1('0x1f')][_0x110119['id']]=new SmsQueue(_0x110119);}else{_0x2a75ad[_0x5ae1('0x16')](_0x2a75ad[_0x5ae1('0x1f')][_0x110119['id']],_0x110119);}_0x2a75ad[_0x5ae1('0x1f')][_0x110119['id']][_0x5ae1('0x1b')]();_0x2a75ad[_0x5ae1('0x1f')][_0x110119['id']][_0x5ae1('0x1d')]();}}return _0x2a75ad[_0x5ae1('0x1f')];};};Realtime[_0x5ae1('0x17')]['initMailQueues']=function(){var _0x3b9278=this;return function(_0x273563){if(_0x273563){freeIsNotKey(_0x273563,_0x3b9278[_0x5ae1('0x20')],'id');for(var _0x3a0311=0x0,_0x1d519a={},_0x1315da={};_0x3a0311<_0x273563[_0x5ae1('0x18')];_0x3a0311+=0x1){_0x1d519a=_0x273563[_0x3a0311];if(_['isUndefined'](_0x3b9278[_0x5ae1('0x20')][_0x1d519a['id']])){_0x3b9278['mailQueues'][_0x1d519a['id']]=new MailQueue(_0x1d519a);}else{_0x3b9278[_0x5ae1('0x16')](_0x3b9278[_0x5ae1('0x20')][_0x1d519a['id']],_0x1d519a);}_0x3b9278[_0x5ae1('0x20')][_0x1d519a['id']]['updateRouting']();_0x3b9278[_0x5ae1('0x20')][_0x1d519a['id']][_0x5ae1('0x1d')]();}}return _0x3b9278[_0x5ae1('0x20')];};};Realtime[_0x5ae1('0x17')][_0x5ae1('0x21')]=function(){var _0x599d24=this;return function(_0x2a36ed){if(_0x2a36ed){freeIsNotKey(_0x2a36ed,_0x599d24[_0x5ae1('0x22')],'id');for(var _0x5450d8=0x0,_0x188f1e={},_0x54dddd={};_0x5450d8<_0x2a36ed['length'];_0x5450d8+=0x1){_0x188f1e=_0x2a36ed[_0x5450d8];if(_[_0x5ae1('0x19')](_0x599d24[_0x5ae1('0x22')][_0x188f1e['id']])){_0x599d24['faxQueues'][_0x188f1e['id']]=new FaxQueue(_0x188f1e);}else{_0x599d24[_0x5ae1('0x16')](_0x599d24[_0x5ae1('0x22')][_0x188f1e['id']],_0x188f1e);}_0x599d24[_0x5ae1('0x22')][_0x188f1e['id']][_0x5ae1('0x1b')]();_0x599d24[_0x5ae1('0x22')][_0x188f1e['id']]['updateRealtime']();}}return _0x599d24[_0x5ae1('0x22')];};};module[_0x5ae1('0x23')]=Realtime; \ No newline at end of file +var _0x8f1c=['../model/smsQueue','../model/mailQueue','../model/faxQueue','agents','openchannelQueues','chatQueues','smsQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','hasOwnProperty','mergeFromDatabase','initAgents','length','isUndefined','prototype','intervals','updateRouting','updateRealtime','initChatQueues','initMailQueues','initFaxQueues','bluebird','util','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue'];(function(_0x42710e,_0x4a4b5d){var _0x4f2785=function(_0x10a19a){while(--_0x10a19a){_0x42710e['push'](_0x42710e['shift']());}};_0x4f2785(++_0x4a4b5d);}(_0x8f1c,0x16f));var _0xc8f1=function(_0x3e6927,_0x14a938){_0x3e6927=_0x3e6927-0x0;var _0x5cfb5c=_0x8f1c[_0x3e6927];return _0x5cfb5c;};'use strict';var BPromise=require(_0xc8f1('0x0'));var util=require(_0xc8f1('0x1'));var _=require(_0xc8f1('0x2'));var moment=require(_0xc8f1('0x3'));var Agent=require(_0xc8f1('0x4'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xc8f1('0x5'));var ChatQueue=require(_0xc8f1('0x6'));var SmsQueue=require(_0xc8f1('0x7'));var MailQueue=require(_0xc8f1('0x8'));var FaxQueue=require(_0xc8f1('0x9'));var Realtime=function(){this[_0xc8f1('0xa')]={};this['intervals']={};this[_0xc8f1('0xb')]={};this[_0xc8f1('0xc')]={};this[_0xc8f1('0xd')]={};this[_0xc8f1('0xe')]={};this[_0xc8f1('0xf')]={};this[_0xc8f1('0x10')]={};this[_0xc8f1('0x11')]={};this[_0xc8f1('0x12')]={};this[_0xc8f1('0x13')]={};this[_0xc8f1('0x14')]={};};function freeIsNotKey(_0x25419b,_0x2ac54d,_0x2d6890){var _0x156061=_[_0xc8f1('0x15')](_0x25419b,function(_0x1c36f7,_0x44c6cc){return _0x1c36f7[_0x2d6890];});for(var _0x1aecf2 in _0x2ac54d){if(_0x2ac54d[_0xc8f1('0x16')](_0x1aecf2)){if(!_0x156061[_0x1aecf2]){delete _0x2ac54d[_0x1aecf2];}}}}Realtime['prototype'][_0xc8f1('0x17')]=function(_0x14864f,_0x5cf4bc){for(var _0x317417 in _0x5cf4bc){if(_0x14864f[_0xc8f1('0x16')](_0x317417)){_0x14864f[_0x317417]=_0x5cf4bc[_0x317417];}}};Realtime['prototype'][_0xc8f1('0x18')]=function(){var _0x59db94=this;return function(_0x277aec){if(_0x277aec){freeIsNotKey(_0x277aec,_0x59db94[_0xc8f1('0xa')],'id');for(var _0x4fb839=0x0,_0x6b590b={},_0x24d24e={};_0x4fb839<_0x277aec[_0xc8f1('0x19')];_0x4fb839+=0x1){_0x6b590b=_0x277aec[_0x4fb839];if(_[_0xc8f1('0x1a')](_0x59db94[_0xc8f1('0xa')][_0x6b590b['id']])){_0x59db94[_0xc8f1('0xa')][_0x6b590b['id']]=new Agent(_0x6b590b);}else{_0x59db94[_0xc8f1('0x17')](_0x59db94['agents'][_0x6b590b['id']],_0x6b590b);}}}return _0x59db94[_0xc8f1('0xa')];};};Realtime[_0xc8f1('0x1b')]['initIntervals']=function(){var _0x542691=this;return function(_0xc2abff){if(_0xc2abff){freeIsNotKey(_0xc2abff,_0x542691['intervals'],'id');for(var _0x43da9e=0x0,_0x48d1c0={},_0x17c221={};_0x43da9e<_0xc2abff[_0xc8f1('0x19')];_0x43da9e+=0x1){_0x48d1c0=_0xc2abff[_0x43da9e];if(_[_0xc8f1('0x1a')](_0x542691[_0xc8f1('0x1c')][_0x48d1c0['id']])){_0x542691[_0xc8f1('0x1c')][_0x48d1c0['id']]=new Interval(_0x48d1c0);}else{_0x542691['mergeFromDatabase'](_0x542691[_0xc8f1('0x1c')][_0x48d1c0['id']],_0x48d1c0);}}}return _0x542691[_0xc8f1('0x1c')];};};Realtime[_0xc8f1('0x1b')]['initOpenchannelQueues']=function(){var _0x1146ee=this;return function(_0xdc7bee){if(_0xdc7bee){freeIsNotKey(_0xdc7bee,_0x1146ee['openchannelQueues'],'id');for(var _0x5a3f9c=0x0,_0x7874b={},_0x54067f={};_0x5a3f9c<_0xdc7bee[_0xc8f1('0x19')];_0x5a3f9c+=0x1){_0x7874b=_0xdc7bee[_0x5a3f9c];if(_[_0xc8f1('0x1a')](_0x1146ee[_0xc8f1('0xb')][_0x7874b['id']])){_0x1146ee['openchannelQueues'][_0x7874b['id']]=new OpenchannelQueue(_0x7874b);}else{_0x1146ee['mergeFromDatabase'](_0x1146ee[_0xc8f1('0xb')][_0x7874b['id']],_0x7874b);}_0x1146ee['openchannelQueues'][_0x7874b['id']][_0xc8f1('0x1d')]();_0x1146ee[_0xc8f1('0xb')][_0x7874b['id']][_0xc8f1('0x1e')]();}}return _0x1146ee['openchannelQueues'];};};Realtime[_0xc8f1('0x1b')][_0xc8f1('0x1f')]=function(){var _0x210aa7=this;return function(_0x367765){if(_0x367765){freeIsNotKey(_0x367765,_0x210aa7['chatQueues'],'id');for(var _0x4349aa=0x0,_0x4d9b8f={},_0x1c873e={};_0x4349aa<_0x367765[_0xc8f1('0x19')];_0x4349aa+=0x1){_0x4d9b8f=_0x367765[_0x4349aa];if(_[_0xc8f1('0x1a')](_0x210aa7[_0xc8f1('0xc')][_0x4d9b8f['id']])){_0x210aa7[_0xc8f1('0xc')][_0x4d9b8f['id']]=new ChatQueue(_0x4d9b8f);}else{_0x210aa7[_0xc8f1('0x17')](_0x210aa7['chatQueues'][_0x4d9b8f['id']],_0x4d9b8f);}_0x210aa7[_0xc8f1('0xc')][_0x4d9b8f['id']][_0xc8f1('0x1d')]();_0x210aa7[_0xc8f1('0xc')][_0x4d9b8f['id']]['updateRealtime']();}}return _0x210aa7['chatQueues'];};};Realtime[_0xc8f1('0x1b')]['initSmsQueues']=function(){var _0xdf8044=this;return function(_0x52a282){if(_0x52a282){freeIsNotKey(_0x52a282,_0xdf8044[_0xc8f1('0xd')],'id');for(var _0x2af25f=0x0,_0x292297={},_0x120f86={};_0x2af25f<_0x52a282[_0xc8f1('0x19')];_0x2af25f+=0x1){_0x292297=_0x52a282[_0x2af25f];if(_[_0xc8f1('0x1a')](_0xdf8044[_0xc8f1('0xd')][_0x292297['id']])){_0xdf8044['smsQueues'][_0x292297['id']]=new SmsQueue(_0x292297);}else{_0xdf8044[_0xc8f1('0x17')](_0xdf8044['smsQueues'][_0x292297['id']],_0x292297);}_0xdf8044['smsQueues'][_0x292297['id']]['updateRouting']();_0xdf8044['smsQueues'][_0x292297['id']]['updateRealtime']();}}return _0xdf8044[_0xc8f1('0xd')];};};Realtime[_0xc8f1('0x1b')][_0xc8f1('0x20')]=function(){var _0xf3e3e2=this;return function(_0x3f99ec){if(_0x3f99ec){freeIsNotKey(_0x3f99ec,_0xf3e3e2[_0xc8f1('0xe')],'id');for(var _0x594f0d=0x0,_0x2b8464={},_0x59b58c={};_0x594f0d<_0x3f99ec['length'];_0x594f0d+=0x1){_0x2b8464=_0x3f99ec[_0x594f0d];if(_['isUndefined'](_0xf3e3e2[_0xc8f1('0xe')][_0x2b8464['id']])){_0xf3e3e2[_0xc8f1('0xe')][_0x2b8464['id']]=new MailQueue(_0x2b8464);}else{_0xf3e3e2[_0xc8f1('0x17')](_0xf3e3e2['mailQueues'][_0x2b8464['id']],_0x2b8464);}_0xf3e3e2[_0xc8f1('0xe')][_0x2b8464['id']][_0xc8f1('0x1d')]();_0xf3e3e2[_0xc8f1('0xe')][_0x2b8464['id']][_0xc8f1('0x1e')]();}}return _0xf3e3e2[_0xc8f1('0xe')];};};Realtime[_0xc8f1('0x1b')][_0xc8f1('0x21')]=function(){var _0x15a613=this;return function(_0x148ede){if(_0x148ede){freeIsNotKey(_0x148ede,_0x15a613[_0xc8f1('0xf')],'id');for(var _0x146c20=0x0,_0x118faf={},_0x2aaa07={};_0x146c20<_0x148ede[_0xc8f1('0x19')];_0x146c20+=0x1){_0x118faf=_0x148ede[_0x146c20];if(_[_0xc8f1('0x1a')](_0x15a613['faxQueues'][_0x118faf['id']])){_0x15a613[_0xc8f1('0xf')][_0x118faf['id']]=new FaxQueue(_0x118faf);}else{_0x15a613[_0xc8f1('0x17')](_0x15a613[_0xc8f1('0xf')][_0x118faf['id']],_0x118faf);}_0x15a613[_0xc8f1('0xf')][_0x118faf['id']][_0xc8f1('0x1d')]();_0x15a613['faxQueues'][_0x118faf['id']][_0xc8f1('0x1e')]();}}return _0x15a613[_0xc8f1('0xf')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 522c26a..e0c11cd 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 _0xe0b0=['AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request','updateChatInteraction','addTags'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xe0b0,0xbf));var _0x0e0b=function(_0x374e8b,_0xee21c3){_0x374e8b=_0x374e8b-0x0;var _0x2d99ad=_0xe0b0[_0x374e8b];return _0x2d99ad;};'use strict';var client=require(_0x0e0b('0x0'));exports[_0x0e0b('0x1')]=function(_0x1f42c8,_0x377aea){return client[_0x0e0b('0x2')]('UpdateChatInteraction',{'body':_0x377aea,'options':{'where':{'id':_0x1f42c8}},'log':_0x0e0b('0x3')});};exports[_0x0e0b('0x4')]=function(_0x5d3b50,_0x263597){return client['Request'](_0x0e0b('0x5'),{'body':_0x263597,'options':{'where':{'id':_0x5d3b50}},'log':_0x0e0b('0x6')});}; \ No newline at end of file +var _0x7582=['addTags','AddTagsToChatInteraction','addTagsToChatInteraction','Request','UpdateChatInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7582,0x67));var _0x2758=function(_0x113a6c,_0x10df30){_0x113a6c=_0x113a6c-0x0;var _0x1ac632=_0x7582[_0x113a6c];return _0x1ac632;};'use strict';var client=require('../client');exports['update']=function(_0x2ed729,_0x465dd2){return client[_0x2758('0x0')](_0x2758('0x1'),{'body':_0x465dd2,'options':{'where':{'id':_0x2ed729}},'log':'updateChatInteraction'});};exports[_0x2758('0x2')]=function(_0x15a06a,_0x515221){return client[_0x2758('0x0')](_0x2758('0x3'),{'body':_0x515221,'options':{'where':{'id':_0x15a06a}},'log':_0x2758('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index c80ab03..77e5b6f 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 _0xadcd=['CreateChatMessage','createChatMessage'];(function(_0x34f1c8,_0x12ae31){var _0x17cbb4=function(_0x65ba3d){while(--_0x65ba3d){_0x34f1c8['push'](_0x34f1c8['shift']());}};_0x17cbb4(++_0x12ae31);}(_0xadcd,0xa6));var _0xdadc=function(_0x1e1bdf,_0x499c07){_0x1e1bdf=_0x1e1bdf-0x0;var _0x1751ee=_0xadcd[_0x1e1bdf];return _0x1751ee;};'use strict';var client=require('../client');exports['create']=function(_0x50eb9a){return client['Request'](_0xdadc('0x0'),{'body':_0x50eb9a,'log':_0xdadc('0x1')});}; \ No newline at end of file +var _0x1630=['createChatMessage','../client','create','Request','CreateChatMessage'];(function(_0x396e83,_0x2d51e2){var _0x4a42cc=function(_0x415496){while(--_0x415496){_0x396e83['push'](_0x396e83['shift']());}};_0x4a42cc(++_0x2d51e2);}(_0x1630,0x146));var _0x0163=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1630[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x0163('0x0'));exports[_0x0163('0x1')]=function(_0x5e28f4){return client[_0x0163('0x2')](_0x0163('0x3'),{'body':_0x5e28f4,'log':_0x0163('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 95431f8..029ca99 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 _0x9e16=['timeout','strategy','User','Agents','online','chatPause','../client','getChatQueues','Request','name'];(function(_0x14a37b,_0x47be2e){var _0x1a3dc7=function(_0x13b415){while(--_0x13b415){_0x14a37b['push'](_0x14a37b['shift']());}};_0x1a3dc7(++_0x47be2e);}(_0x9e16,0x114));var _0x69e1=function(_0x20718a,_0x5c3183){_0x20718a=_0x20718a-0x0;var _0x5d9e6c=_0x9e16[_0x20718a];return _0x5d9e6c;};'use strict';var client=require(_0x69e1('0x0'));exports[_0x69e1('0x1')]=function(){return function(){return client[_0x69e1('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x69e1('0x3'),_0x69e1('0x4'),_0x69e1('0x5')],'include':[{'model':_0x69e1('0x6'),'as':_0x69e1('0x7'),'attributes':['id',_0x69e1('0x3'),_0x69e1('0x8'),_0x69e1('0x9')]}]},'log':_0x69e1('0x1')});};}; \ No newline at end of file +var _0xbd4e=['Request','GetChatQueue','timeout','strategy','name','online','chatPause','../client','getChatQueues'];(function(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0xbd4e,0x10c));var _0xebd4=function(_0x32478b,_0x327525){_0x32478b=_0x32478b-0x0;var _0x328d9d=_0xbd4e[_0x32478b];return _0x328d9d;};'use strict';var client=require(_0xebd4('0x0'));exports[_0xebd4('0x1')]=function(){return function(){return client[_0xebd4('0x2')](_0xebd4('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xebd4('0x4'),_0xebd4('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0xebd4('0x6'),_0xebd4('0x7'),_0xebd4('0x8')]}]},'log':_0xebd4('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 4e6a5ac..0c83f2f 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 _0x3f49=['create','Request','CreateChatQueueReport','DESC','UpdateChatQueueReport','../client'];(function(_0x1b51ea,_0x394fd9){var _0x18bbdc=function(_0x45b83f){while(--_0x45b83f){_0x1b51ea['push'](_0x1b51ea['shift']());}};_0x18bbdc(++_0x394fd9);}(_0x3f49,0x11f));var _0x93f4=function(_0x14d9bf,_0x56719c){_0x14d9bf=_0x14d9bf-0x0;var _0xa5718b=_0x3f49[_0x14d9bf];return _0xa5718b;};'use strict';var client=require(_0x93f4('0x0'));exports[_0x93f4('0x1')]=function(_0x5822c3){return client[_0x93f4('0x2')](_0x93f4('0x3'),{'body':_0x5822c3,'log':_0x93f4('0x3')});};exports['update']=function(_0x29b94d,_0x4232db){return client['Request']('UpdateChatQueueReport',{'body':_0x4232db,'options':{'where':{'uniqueid':_0x29b94d},'order':[['id',_0x93f4('0x4')]],'limit':0x1},'log':_0x93f4('0x5')});}; \ No newline at end of file +var _0x36f1=['UpdateChatQueueReport','DESC','../client','CreateChatQueueReport','update','Request'];(function(_0x10bb9c,_0x311990){var _0x379d24=function(_0x2565b6){while(--_0x2565b6){_0x10bb9c['push'](_0x10bb9c['shift']());}};_0x379d24(++_0x311990);}(_0x36f1,0xb0));var _0x136f=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x36f1[_0x187ee1];return _0x388160;};'use strict';var client=require(_0x136f('0x0'));exports['create']=function(_0x76b3e5){return client['Request'](_0x136f('0x1'),{'body':_0x76b3e5,'log':_0x136f('0x1')});};exports[_0x136f('0x2')]=function(_0x1bf6b5,_0x3c8abd){return client[_0x136f('0x3')](_0x136f('0x4'),{'body':_0x3c8abd,'options':{'where':{'uniqueid':_0x1bf6b5},'order':[['id',_0x136f('0x5')]],'limit':0x1},'log':_0x136f('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 0198620..8f10447 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 _0xe2f1=['addTags','AddTagsToFaxInteraction','addTagsToFaxInteraction','update','Request','updateFaxInteraction'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0xe2f1,0x1dd));var _0x1e2f=function(_0x16539a,_0x31409a){_0x16539a=_0x16539a-0x0;var _0x200796=_0xe2f1[_0x16539a];return _0x200796;};'use strict';var client=require('../client');exports[_0x1e2f('0x0')]=function(_0xd8732e,_0x53de2f){return client[_0x1e2f('0x1')]('UpdateFaxInteraction',{'body':_0x53de2f,'options':{'where':{'id':_0xd8732e}},'log':_0x1e2f('0x2')});};exports[_0x1e2f('0x3')]=function(_0x5dd71b,_0x21c298){return client[_0x1e2f('0x1')](_0x1e2f('0x4'),{'body':_0x21c298,'options':{'where':{'id':_0x5dd71b}},'log':_0x1e2f('0x5')});}; \ No newline at end of file +var _0x7800=['AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x7800,0x10a));var _0x0780=function(_0x5d082d,_0x3d55bd){_0x5d082d=_0x5d082d-0x0;var _0x16f55d=_0x7800[_0x5d082d];return _0x16f55d;};'use strict';var client=require(_0x0780('0x0'));exports['update']=function(_0x33a242,_0x175fa3){return client['Request'](_0x0780('0x1'),{'body':_0x175fa3,'options':{'where':{'id':_0x33a242}},'log':_0x0780('0x2')});};exports[_0x0780('0x3')]=function(_0x584d66,_0x31bc52){return client['Request'](_0x0780('0x4'),{'body':_0x31bc52,'options':{'where':{'id':_0x584d66}},'log':_0x0780('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index aabaf27..9f96e5a 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 _0xf1b9=['CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x2e324e,_0x3a3c0a){var _0x17c9a0=function(_0x76a89f){while(--_0x76a89f){_0x2e324e['push'](_0x2e324e['shift']());}};_0x17c9a0(++_0x3a3c0a);}(_0xf1b9,0x9a));var _0x9f1b=function(_0x2aa50d,_0x42e086){_0x2aa50d=_0x2aa50d-0x0;var _0x3b7764=_0xf1b9[_0x2aa50d];return _0x3b7764;};'use strict';var client=require(_0x9f1b('0x0'));exports[_0x9f1b('0x1')]=function(_0x360504){return client['Request'](_0x9f1b('0x2'),{'body':_0x360504,'log':_0x9f1b('0x3')});}; \ No newline at end of file +var _0xe2dd=['../client','create','CreateFaxMessage','createFaxMessage'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0xe2dd,0x168));var _0xde2d=function(_0x26bf51,_0x5e261a){_0x26bf51=_0x26bf51-0x0;var _0x503415=_0xe2dd[_0x26bf51];return _0x503415;};'use strict';var client=require(_0xde2d('0x0'));exports[_0xde2d('0x1')]=function(_0x42b521){return client['Request'](_0xde2d('0x2'),{'body':_0x42b521,'log':_0xde2d('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 0114b4e..e2d69ff 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 _0x045d=['../client','getFaxQueues','Request','GetFaxQueue','User','online','faxPause'];(function(_0x3d9884,_0x408b89){var _0x19765a=function(_0x131a61){while(--_0x131a61){_0x3d9884['push'](_0x3d9884['shift']());}};_0x19765a(++_0x408b89);}(_0x045d,0x16c));var _0xd045=function(_0x27fe43,_0x5b9140){_0x27fe43=_0x27fe43-0x0;var _0x42ba60=_0x045d[_0x27fe43];return _0x42ba60;};'use strict';var client=require(_0xd045('0x0'));exports[_0xd045('0x1')]=function(){return function(){return client[_0xd045('0x2')](_0xd045('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0xd045('0x4'),'as':'Agents','attributes':['id','name',_0xd045('0x5'),_0xd045('0x6')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0xbd2c=['Request','GetFaxQueue','timeout','strategy','User','Agents','name','online','getFaxQueues'];(function(_0x92dd1e,_0x3b9fc2){var _0x4621ba=function(_0x467380){while(--_0x467380){_0x92dd1e['push'](_0x92dd1e['shift']());}};_0x4621ba(++_0x3b9fc2);}(_0xbd2c,0x143));var _0xcbd2=function(_0x2e69ed,_0x58c6ce){_0x2e69ed=_0x2e69ed-0x0;var _0x5878bb=_0xbd2c[_0x2e69ed];return _0x5878bb;};'use strict';var client=require('../client');exports[_0xcbd2('0x0')]=function(){return function(){return client[_0xcbd2('0x1')](_0xcbd2('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xcbd2('0x3'),_0xcbd2('0x4')],'include':[{'model':_0xcbd2('0x5'),'as':_0xcbd2('0x6'),'attributes':['id',_0xcbd2('0x7'),_0xcbd2('0x8'),'faxPause']}]},'log':_0xcbd2('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index deae67f..98ea0e0 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 _0x4573=['Request','UpdateFaxQueueReport','DESC','../client','CreateFaxQueueReport'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4573,0x12a));var _0x3457=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4573[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x3457('0x0'));exports['create']=function(_0x5a7404){return client['Request'](_0x3457('0x1'),{'body':_0x5a7404,'log':_0x3457('0x1')});};exports['update']=function(_0x2b501c,_0x308b72){return client[_0x3457('0x2')](_0x3457('0x3'),{'body':_0x308b72,'options':{'where':{'uniqueid':_0x2b501c},'order':[['id',_0x3457('0x4')]],'limit':0x1},'log':_0x3457('0x3')});}; \ No newline at end of file +var _0x52b4=['create','Request','CreateFaxQueueReport','UpdateFaxQueueReport','DESC','../client'];(function(_0x35c33d,_0x46defa){var _0x5139b3=function(_0x427391){while(--_0x427391){_0x35c33d['push'](_0x35c33d['shift']());}};_0x5139b3(++_0x46defa);}(_0x52b4,0xdd));var _0x452b=function(_0x33d558,_0x1d27a9){_0x33d558=_0x33d558-0x0;var _0x5ae7df=_0x52b4[_0x33d558];return _0x5ae7df;};'use strict';var client=require(_0x452b('0x0'));exports[_0x452b('0x1')]=function(_0x1aa927){return client[_0x452b('0x2')](_0x452b('0x3'),{'body':_0x1aa927,'log':_0x452b('0x3')});};exports['update']=function(_0x4fb1f5,_0xe675){return client[_0x452b('0x2')](_0x452b('0x4'),{'body':_0xe675,'options':{'where':{'uniqueid':_0x4fb1f5},'order':[['id',_0x452b('0x5')]],'limit':0x1},'log':_0x452b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 3978e55..99c0345 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 _0x6ae2=['GetInterval','name','Interval','Intervals','interval','../client','getIntervals','Request'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x3be5b3,_0x4228f3){_0x3be5b3=_0x3be5b3-0x0;var _0x2f07e5=_0x6ae2[_0x3be5b3];return _0x2f07e5;};'use strict';var client=require(_0x26ae('0x0'));exports[_0x26ae('0x1')]=function(){return function(){return client[_0x26ae('0x2')](_0x26ae('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x26ae('0x4')],'include':[{'model':_0x26ae('0x5'),'as':_0x26ae('0x6'),'attributes':['id',_0x26ae('0x4'),_0x26ae('0x7')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0xe493=['../client','getIntervals','Request','GetInterval','name','Intervals'];(function(_0xcd4f60,_0xb54a39){var _0x2ec676=function(_0x52c4f6){while(--_0x52c4f6){_0xcd4f60['push'](_0xcd4f60['shift']());}};_0x2ec676(++_0xb54a39);}(_0xe493,0x7e));var _0x3e49=function(_0x3963b9,_0x5252c5){_0x3963b9=_0x3963b9-0x0;var _0x1d153e=_0xe493[_0x3963b9];return _0x1d153e;};'use strict';var client=require(_0x3e49('0x0'));exports[_0x3e49('0x1')]=function(){return function(){return client[_0x3e49('0x2')](_0x3e49('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x3e49('0x4')],'include':[{'model':'Interval','as':_0x3e49('0x5'),'attributes':['id',_0x3e49('0x4'),'interval']}]},'log':_0x3e49('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index b6db7b3..644b46b 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 _0x47ca=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x339527,_0x59c4d3){var _0x1f24e5=function(_0x48b603){while(--_0x48b603){_0x339527['push'](_0x339527['shift']());}};_0x1f24e5(++_0x59c4d3);}(_0x47ca,0x77));var _0xa47c=function(_0x2b4019,_0x2d624e){_0x2b4019=_0x2b4019-0x0;var _0x18d524=_0x47ca[_0x2b4019];return _0x18d524;};'use strict';var client=require('../client');exports[_0xa47c('0x0')]=function(_0x2d822d,_0x4d469e){return client[_0xa47c('0x1')](_0xa47c('0x2'),{'body':_0x4d469e,'options':{'where':{'id':_0x2d822d}},'log':_0xa47c('0x3')});};exports[_0xa47c('0x4')]=function(_0x8c7e4e,_0x375de8){return client[_0xa47c('0x1')](_0xa47c('0x5'),{'body':_0x375de8,'options':{'where':{'id':_0x8c7e4e}},'log':_0xa47c('0x6')});}; \ No newline at end of file +var _0x6ce9=['addTagsToChatInteraction','../client','update','Request','updateMailInteraction','AddTagsToMailInteraction'];(function(_0x528a28,_0x2b9af2){var _0x494b2d=function(_0x384946){while(--_0x384946){_0x528a28['push'](_0x528a28['shift']());}};_0x494b2d(++_0x2b9af2);}(_0x6ce9,0x1e7));var _0x96ce=function(_0x239b48,_0x3674c1){_0x239b48=_0x239b48-0x0;var _0xbe8989=_0x6ce9[_0x239b48];return _0xbe8989;};'use strict';var client=require(_0x96ce('0x0'));exports[_0x96ce('0x1')]=function(_0x23b2fc,_0xa6377f){return client[_0x96ce('0x2')]('UpdateMailInteraction',{'body':_0xa6377f,'options':{'where':{'id':_0x23b2fc}},'log':_0x96ce('0x3')});};exports['addTags']=function(_0x5be190,_0x56deab){return client[_0x96ce('0x2')](_0x96ce('0x4'),{'body':_0x56deab,'options':{'where':{'id':_0x5be190}},'log':_0x96ce('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 259e5cc..1d1c242 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 _0x6d9f=['create','Request','CreateMailMessage','../client'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6d9f,0x113));var _0xf6d9=function(_0x5eac00,_0x536009){_0x5eac00=_0x5eac00-0x0;var _0x4d31cf=_0x6d9f[_0x5eac00];return _0x4d31cf;};'use strict';var client=require(_0xf6d9('0x0'));exports[_0xf6d9('0x1')]=function(_0x2cecd7){return client[_0xf6d9('0x2')](_0xf6d9('0x3'),{'body':_0x2cecd7,'log':'createMailMessage'});}; \ No newline at end of file +var _0xfaca=['../client','CreateMailMessage','createMailMessage'];(function(_0x360212,_0x5d611d){var _0xd387e=function(_0x108fcb){while(--_0x108fcb){_0x360212['push'](_0x360212['shift']());}};_0xd387e(++_0x5d611d);}(_0xfaca,0x12c));var _0xafac=function(_0x4893b5,_0x3b2c63){_0x4893b5=_0x4893b5-0x0;var _0xf39f55=_0xfaca[_0x4893b5];return _0xf39f55;};'use strict';var client=require(_0xafac('0x0'));exports['create']=function(_0x4bd9d0){return client['Request'](_0xafac('0x1'),{'body':_0x4bd9d0,'log':_0xafac('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index c239798..7c67507 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 _0xd122=['timeout','User','online','mailPause','../client','getMailQueues','Request','GetMailQueue','name'];(function(_0x5d59c7,_0x288958){var _0x14ad14=function(_0x47b3ec){while(--_0x47b3ec){_0x5d59c7['push'](_0x5d59c7['shift']());}};_0x14ad14(++_0x288958);}(_0xd122,0x15a));var _0x2d12=function(_0x5394fd,_0x21b508){_0x5394fd=_0x5394fd-0x0;var _0x191b8d=_0xd122[_0x5394fd];return _0x191b8d;};'use strict';var client=require(_0x2d12('0x0'));exports[_0x2d12('0x1')]=function(){return function(){return client[_0x2d12('0x2')](_0x2d12('0x3'),{'options':{'raw':![],'attributes':['id',_0x2d12('0x4'),_0x2d12('0x5'),'strategy'],'include':[{'model':_0x2d12('0x6'),'as':'Agents','attributes':['id',_0x2d12('0x4'),_0x2d12('0x7'),_0x2d12('0x8')]}]},'log':_0x2d12('0x1')});};}; \ No newline at end of file +var _0x5135=['online','mailPause','../client','getMailQueues','Request','GetMailQueue','name','timeout','strategy','User'];(function(_0x356787,_0x2f5776){var _0x5615c1=function(_0x5cb6f8){while(--_0x5cb6f8){_0x356787['push'](_0x356787['shift']());}};_0x5615c1(++_0x2f5776);}(_0x5135,0x1ec));var _0x5513=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5135[_0x173441];return _0x2423a8;};'use strict';var client=require(_0x5513('0x0'));exports[_0x5513('0x1')]=function(){return function(){return client[_0x5513('0x2')](_0x5513('0x3'),{'options':{'raw':![],'attributes':['id',_0x5513('0x4'),_0x5513('0x5'),_0x5513('0x6')],'include':[{'model':_0x5513('0x7'),'as':'Agents','attributes':['id',_0x5513('0x4'),_0x5513('0x8'),_0x5513('0x9')]}]},'log':_0x5513('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index d490a6f..a0ddf46 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 _0x4023=['create','Request','CreateMailQueueReport','DESC','../client'];(function(_0x328755,_0x5ea177){var _0x4351de=function(_0x46de6e){while(--_0x46de6e){_0x328755['push'](_0x328755['shift']());}};_0x4351de(++_0x5ea177);}(_0x4023,0x77));var _0x3402=function(_0x63470c,_0x330c1d){_0x63470c=_0x63470c-0x0;var _0x5b8e57=_0x4023[_0x63470c];return _0x5b8e57;};'use strict';var client=require(_0x3402('0x0'));exports[_0x3402('0x1')]=function(_0x505cab){return client[_0x3402('0x2')](_0x3402('0x3'),{'body':_0x505cab,'log':_0x3402('0x3')});};exports['update']=function(_0x374aa7,_0x5cf3f5){return client[_0x3402('0x2')]('UpdateMailQueueReport',{'body':_0x5cf3f5,'options':{'where':{'uniqueid':_0x374aa7},'order':[['id',_0x3402('0x4')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x3010=['CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create','Request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3010,0x1c4));var _0x0301=function(_0x9ffa56,_0x2d053c){_0x9ffa56=_0x9ffa56-0x0;var _0x42cd6a=_0x3010[_0x9ffa56];return _0x42cd6a;};'use strict';var client=require(_0x0301('0x0'));exports[_0x0301('0x1')]=function(_0x2e6aef){return client[_0x0301('0x2')](_0x0301('0x3'),{'body':_0x2e6aef,'log':_0x0301('0x3')});};exports[_0x0301('0x4')]=function(_0x37109c,_0x503c7a){return client[_0x0301('0x2')](_0x0301('0x5'),{'body':_0x503c7a,'options':{'where':{'uniqueid':_0x37109c},'order':[['id',_0x0301('0x6')]],'limit':0x1},'log':_0x0301('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index e143e8b..22c6b8e 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 _0x5b8f=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','updateOpenchannelInteraction','addTags'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x5b8f,0x1a6));var _0xf5b8=function(_0x168127,_0x59cea1){_0x168127=_0x168127-0x0;var _0x4c99ad=_0x5b8f[_0x168127];return _0x4c99ad;};'use strict';var client=require(_0xf5b8('0x0'));exports['update']=function(_0x526337,_0x4b6526){return client['Request']('UpdateOpenchannelInteraction',{'body':_0x4b6526,'options':{'where':{'id':_0x526337}},'log':_0xf5b8('0x1')});};exports[_0xf5b8('0x2')]=function(_0x55f569,_0x2a006f){return client['Request'](_0xf5b8('0x3'),{'body':_0x2a006f,'options':{'where':{'id':_0x55f569}},'log':_0xf5b8('0x4')});}; \ No newline at end of file +var _0x5af4=['update','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','Request','addTagsToChatInteraction','../client'];(function(_0x43dc93,_0x32777d){var _0x4d6a52=function(_0x112d4d){while(--_0x112d4d){_0x43dc93['push'](_0x43dc93['shift']());}};_0x4d6a52(++_0x32777d);}(_0x5af4,0xd1));var _0x45af=function(_0x46328c,_0x6a21ee){_0x46328c=_0x46328c-0x0;var _0xbb016d=_0x5af4[_0x46328c];return _0xbb016d;};'use strict';var client=require(_0x45af('0x0'));exports[_0x45af('0x1')]=function(_0x222f5d,_0x5a126e){return client['Request'](_0x45af('0x2'),{'body':_0x5a126e,'options':{'where':{'id':_0x222f5d}},'log':_0x45af('0x3')});};exports[_0x45af('0x4')]=function(_0x4dd22c,_0x1d1a4d){return client[_0x45af('0x5')]('AddTagsToOpenchannelInteraction',{'body':_0x1d1a4d,'options':{'where':{'id':_0x4dd22c}},'log':_0x45af('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index ff6e73e..364122f 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 _0x00bb=['CreateOpenchannelMessage','../client','create'];(function(_0x3a3c3d,_0x3b8542){var _0xf3142f=function(_0x479bb0){while(--_0x479bb0){_0x3a3c3d['push'](_0x3a3c3d['shift']());}};_0xf3142f(++_0x3b8542);}(_0x00bb,0x1d8));var _0xb00b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x00bb[_0x397e5f];return _0x5302b8;};'use strict';var client=require(_0xb00b('0x0'));exports[_0xb00b('0x1')]=function(_0x468a51){return client['Request'](_0xb00b('0x2'),{'body':_0x468a51,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x00bb=['CreateOpenchannelMessage','../client','create'];(function(_0x1bb812,_0x23eacc){var _0x372adb=function(_0x5ad456){while(--_0x5ad456){_0x1bb812['push'](_0x1bb812['shift']());}};_0x372adb(++_0x23eacc);}(_0x00bb,0x1d8));var _0xb00b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x00bb[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xb00b('0x0'));exports[_0xb00b('0x1')]=function(_0x468a51){return client['Request'](_0xb00b('0x2'),{'body':_0x468a51,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index eeec405..44fbeaf 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 _0x0bdb=['Request','GetOpenchannelQueue','name','timeout','strategy','Agents','online','../client','getOpenchannelQueues'];(function(_0x4e831e,_0x5ad6f4){var _0x1744c8=function(_0x1f98b0){while(--_0x1f98b0){_0x4e831e['push'](_0x4e831e['shift']());}};_0x1744c8(++_0x5ad6f4);}(_0x0bdb,0xf1));var _0xb0bd=function(_0x4b4783,_0x182f4b){_0x4b4783=_0x4b4783-0x0;var _0x4caed2=_0x0bdb[_0x4b4783];return _0x4caed2;};'use strict';var client=require(_0xb0bd('0x0'));exports[_0xb0bd('0x1')]=function(){return function(){return client[_0xb0bd('0x2')](_0xb0bd('0x3'),{'options':{'raw':![],'attributes':['id',_0xb0bd('0x4'),_0xb0bd('0x5'),_0xb0bd('0x6')],'include':[{'model':'User','as':_0xb0bd('0x7'),'attributes':['id',_0xb0bd('0x4'),_0xb0bd('0x8'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0xb682=['Request','name','timeout','User','Agents','../client','getOpenchannelQueues'];(function(_0x2350dc,_0x38edf3){var _0x3575a4=function(_0x1750e6){while(--_0x1750e6){_0x2350dc['push'](_0x2350dc['shift']());}};_0x3575a4(++_0x38edf3);}(_0xb682,0x139));var _0x2b68=function(_0x1e6773,_0x138124){_0x1e6773=_0x1e6773-0x0;var _0x4c81a0=_0xb682[_0x1e6773];return _0x4c81a0;};'use strict';var client=require(_0x2b68('0x0'));exports[_0x2b68('0x1')]=function(){return function(){return client[_0x2b68('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x2b68('0x3'),_0x2b68('0x4'),'strategy'],'include':[{'model':_0x2b68('0x5'),'as':_0x2b68('0x6'),'attributes':['id',_0x2b68('0x3'),'online','openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 893dc67..6f8be1b 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 _0xbc2c=['CreateOpenchannelQueueReport','update','DESC','UpdateOpenchannelQueueReport','create','Request'];(function(_0x480877,_0x68df4b){var _0x1cd0cb=function(_0x1b8f37){while(--_0x1b8f37){_0x480877['push'](_0x480877['shift']());}};_0x1cd0cb(++_0x68df4b);}(_0xbc2c,0xe8));var _0xcbc2=function(_0x563605,_0xe9b7b){_0x563605=_0x563605-0x0;var _0x3eac5d=_0xbc2c[_0x563605];return _0x3eac5d;};'use strict';var client=require('../client');exports[_0xcbc2('0x0')]=function(_0x15067a){return client[_0xcbc2('0x1')](_0xcbc2('0x2'),{'body':_0x15067a,'log':_0xcbc2('0x2')});};exports[_0xcbc2('0x3')]=function(_0x14b2b1,_0x27a773){return client[_0xcbc2('0x1')]('UpdateOpenchannelQueueReport',{'body':_0x27a773,'options':{'where':{'uniqueid':_0x14b2b1},'order':[['id',_0xcbc2('0x4')]],'limit':0x1},'log':_0xcbc2('0x5')});}; \ No newline at end of file +var _0x5337=['update','UpdateOpenchannelQueueReport','DESC','../client','Request'];(function(_0x45a62a,_0x20e29a){var _0x502ce9=function(_0x898434){while(--_0x898434){_0x45a62a['push'](_0x45a62a['shift']());}};_0x502ce9(++_0x20e29a);}(_0x5337,0x120));var _0x7533=function(_0x2595a6,_0x48fc45){_0x2595a6=_0x2595a6-0x0;var _0x460197=_0x5337[_0x2595a6];return _0x460197;};'use strict';var client=require(_0x7533('0x0'));exports['create']=function(_0x4720e5){return client[_0x7533('0x1')]('CreateOpenchannelQueueReport',{'body':_0x4720e5,'log':'CreateOpenchannelQueueReport'});};exports[_0x7533('0x2')]=function(_0x1f90d9,_0x5ecaa9){return client[_0x7533('0x1')](_0x7533('0x3'),{'body':_0x5ecaa9,'options':{'where':{'uniqueid':_0x1f90d9},'order':[['id',_0x7533('0x4')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 0a71d05..b94b059 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 _0x29dd=['UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','update','Request'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x29dd,0x1d3));var _0xd29d=function(_0x25f9c8,_0x560c40){_0x25f9c8=_0x25f9c8-0x0;var _0x467655=_0x29dd[_0x25f9c8];return _0x467655;};'use strict';var client=require('../client');exports[_0xd29d('0x0')]=function(_0x2dc5f8,_0x4f6ce4){return client[_0xd29d('0x1')](_0xd29d('0x2'),{'body':_0x4f6ce4,'options':{'where':{'id':_0x2dc5f8}},'log':_0xd29d('0x3')});};exports[_0xd29d('0x4')]=function(_0x4a4bcc,_0x217926){return client[_0xd29d('0x1')](_0xd29d('0x5'),{'body':_0x217926,'options':{'where':{'id':_0x4a4bcc}},'log':_0xd29d('0x6')});}; \ No newline at end of file +var _0xe2ef=['AddTagsToSmsInteraction','addTagsToSmsInteraction','update','Request','updateSmsInteraction','addTags'];(function(_0x27f10a,_0x5b8464){var _0x58c810=function(_0x39cd0d){while(--_0x39cd0d){_0x27f10a['push'](_0x27f10a['shift']());}};_0x58c810(++_0x5b8464);}(_0xe2ef,0x194));var _0xfe2e=function(_0x48fc4b,_0x59942b){_0x48fc4b=_0x48fc4b-0x0;var _0x2e92f9=_0xe2ef[_0x48fc4b];return _0x2e92f9;};'use strict';var client=require('../client');exports[_0xfe2e('0x0')]=function(_0x44e5b6,_0x416993){return client[_0xfe2e('0x1')]('UpdateSmsInteraction',{'body':_0x416993,'options':{'where':{'id':_0x44e5b6}},'log':_0xfe2e('0x2')});};exports[_0xfe2e('0x3')]=function(_0x63e94a,_0x1a1b93){return client[_0xfe2e('0x1')](_0xfe2e('0x4'),{'body':_0x1a1b93,'options':{'where':{'id':_0x63e94a}},'log':_0xfe2e('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 8e2a5b3..192d368 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 _0x8abe=['create','Request','CreateSmsMessage','../client'];(function(_0x385c76,_0xb97335){var _0x5c8367=function(_0xdfcd3){while(--_0xdfcd3){_0x385c76['push'](_0x385c76['shift']());}};_0x5c8367(++_0xb97335);}(_0x8abe,0xef));var _0xe8ab=function(_0x52d502,_0x45550f){_0x52d502=_0x52d502-0x0;var _0xd31501=_0x8abe[_0x52d502];return _0xd31501;};'use strict';var client=require(_0xe8ab('0x0'));exports[_0xe8ab('0x1')]=function(_0x45df3d){return client[_0xe8ab('0x2')](_0xe8ab('0x3'),{'body':_0x45df3d,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x21e3=['../client','CreateSmsMessage','createSmsMessage'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x21e3,0x1a1));var _0x321e=function(_0x2fe5cf,_0x434b21){_0x2fe5cf=_0x2fe5cf-0x0;var _0x4a9b5a=_0x21e3[_0x2fe5cf];return _0x4a9b5a;};'use strict';var client=require(_0x321e('0x0'));exports['create']=function(_0x30355f){return client['Request'](_0x321e('0x1'),{'body':_0x30355f,'log':_0x321e('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index e23753a..898799f 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 _0xb8a1=['GetSmsQueue','timeout','User','name','online','../client','getSmsQueues','Request'];(function(_0x372bd7,_0x421e2c){var _0x5cf7f2=function(_0x1dfac4){while(--_0x1dfac4){_0x372bd7['push'](_0x372bd7['shift']());}};_0x5cf7f2(++_0x421e2c);}(_0xb8a1,0x1bd));var _0x1b8a=function(_0x2461a8,_0x5da6d8){_0x2461a8=_0x2461a8-0x0;var _0x3343c8=_0xb8a1[_0x2461a8];return _0x3343c8;};'use strict';var client=require(_0x1b8a('0x0'));exports[_0x1b8a('0x1')]=function(){return function(){return client[_0x1b8a('0x2')](_0x1b8a('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x1b8a('0x4'),'strategy'],'include':[{'model':_0x1b8a('0x5'),'as':'Agents','attributes':['id',_0x1b8a('0x6'),_0x1b8a('0x7'),'smsPause']}]},'log':_0x1b8a('0x1')});};}; \ No newline at end of file +var _0x3383=['name','timeout','User','Agents','smsPause','../client','getSmsQueues','GetSmsQueue'];(function(_0xea73f,_0x4d4ce7){var _0x7ee2e9=function(_0x11293f){while(--_0x11293f){_0xea73f['push'](_0xea73f['shift']());}};_0x7ee2e9(++_0x4d4ce7);}(_0x3383,0x1cd));var _0x3338=function(_0x2b0cb1,_0x389788){_0x2b0cb1=_0x2b0cb1-0x0;var _0x3a9301=_0x3383[_0x2b0cb1];return _0x3a9301;};'use strict';var client=require(_0x3338('0x0'));exports[_0x3338('0x1')]=function(){return function(){return client['Request'](_0x3338('0x2'),{'options':{'raw':![],'attributes':['id',_0x3338('0x3'),_0x3338('0x4'),'strategy'],'include':[{'model':_0x3338('0x5'),'as':_0x3338('0x6'),'attributes':['id',_0x3338('0x3'),'online',_0x3338('0x7')]}]},'log':_0x3338('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 5521a80..17ef628 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 _0x2432=['UpdateSmsQueueReport','DESC','../client','create','Request','CreateSmsQueueReport'];(function(_0x26fe9,_0x203793){var _0x5a11e5=function(_0x47cb1e){while(--_0x47cb1e){_0x26fe9['push'](_0x26fe9['shift']());}};_0x5a11e5(++_0x203793);}(_0x2432,0x7a));var _0x2243=function(_0x368b7e,_0xb523bc){_0x368b7e=_0x368b7e-0x0;var _0x4e4660=_0x2432[_0x368b7e];return _0x4e4660;};'use strict';var client=require(_0x2243('0x0'));exports[_0x2243('0x1')]=function(_0x1a03c2){return client[_0x2243('0x2')]('CreateSmsQueueReport',{'body':_0x1a03c2,'log':_0x2243('0x3')});};exports['update']=function(_0x183db0,_0x446e79){return client[_0x2243('0x2')](_0x2243('0x4'),{'body':_0x446e79,'options':{'where':{'uniqueid':_0x183db0},'order':[['id',_0x2243('0x5')]],'limit':0x1},'log':_0x2243('0x4')});}; \ No newline at end of file +var _0xd027=['CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC','create'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xd027,0x197));var _0x7d02=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd027[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x7d02('0x0')]=function(_0x4b0f9c){return client['Request'](_0x7d02('0x1'),{'body':_0x4b0f9c,'log':_0x7d02('0x1')});};exports[_0x7d02('0x2')]=function(_0x22ed41,_0x1391eb){return client[_0x7d02('0x3')](_0x7d02('0x4'),{'body':_0x1391eb,'options':{'where':{'uniqueid':_0x22ed41},'order':[['id',_0x7d02('0x5')]],'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 fc511f2..badd134 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 _0xa636=['chatPause','mailPause','smsPause','openchannelPause','chatCapacity','mailCapacity','../client','getAgents','agent','online','lastPauseAt','voicePause'];(function(_0x477320,_0x4cfeb4){var _0x25c6f2=function(_0x2e5d73){while(--_0x2e5d73){_0x477320['push'](_0x477320['shift']());}};_0x25c6f2(++_0x4cfeb4);}(_0xa636,0x186));var _0x6a63=function(_0xa6c567,_0x4d0421){_0xa6c567=_0xa6c567-0x0;var _0x181ce7=_0xa636[_0xa6c567];return _0x181ce7;};'use strict';var client=require(_0x6a63('0x0'));exports[_0x6a63('0x1')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x6a63('0x2')},'attributes':['id','name',_0x6a63('0x3'),'pauseType',_0x6a63('0x4'),_0x6a63('0x5'),_0x6a63('0x6'),_0x6a63('0x7'),'faxPause',_0x6a63('0x8'),_0x6a63('0x9'),_0x6a63('0xa'),_0x6a63('0xb'),'faxCapacity','smsCapacity','openchannelCapacity']},'log':_0x6a63('0x1')});};}; \ No newline at end of file +var _0x381e=['smsCapacity','openchannelCapacity','getAgents','GetUser','agent','name','online','pauseType','voicePause','chatPause','mailPause','faxPause','chatCapacity'];(function(_0x5ca764,_0x5dfc16){var _0x9dc63c=function(_0xa864c6){while(--_0xa864c6){_0x5ca764['push'](_0x5ca764['shift']());}};_0x9dc63c(++_0x5dfc16);}(_0x381e,0x16f));var _0xe381=function(_0x5c88f1,_0x5001dd){_0x5c88f1=_0x5c88f1-0x0;var _0x3ca89e=_0x381e[_0x5c88f1];return _0x3ca89e;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client['Request'](_0xe381('0x0'),{'options':{'raw':!![],'where':{'role':_0xe381('0x1')},'attributes':['id',_0xe381('0x2'),_0xe381('0x3'),_0xe381('0x4'),'lastPauseAt',_0xe381('0x5'),_0xe381('0x6'),_0xe381('0x7'),_0xe381('0x8'),'smsPause','openchannelPause',_0xe381('0x9'),'mailCapacity','faxCapacity',_0xe381('0xa'),_0xe381('0xb')]},'log':_0xe381('0xc')});};}; \ 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 e1ff8af..4b19e57 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 _0x19d5=['name','toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','createQueue','channel','START:%s','rules','close','info','[%s][AGENT]\x20ROUTING\x20STOPPED','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','[%s][QUEUE]\x20%s','stack','lodash','util','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','format'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x19d5,0x1e2));var _0x519d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x19d5[_0x2c91e9];return _0x13f0ff;};'use strict';var schema=require('validate');var _=require(_0x519d('0x0'));var util=require(_0x519d('0x1'));var seqqueue=require('seq-queue');var logger=require('../../../../config/logger')('routing');var strategy=require(_0x519d('0x2'));var queue=schema({'name':{'type':_0x519d('0x3'),'required':!![],'message':_0x519d('0x4')},'timeout':{'type':_0x519d('0x5'),'message':_0x519d('0x6')}});function writeLog(_0x4d85f8,_0x54f0e0,_0x2bb877){return logger['info'](util[_0x519d('0x7')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x4d85f8,_0x54f0e0[_0x519d('0x8')],_0x2bb877));}function handleFindAgent(_0x5bc9ba){return function(_0x5d7d98){return _0x5d7d98['name'][_0x519d('0x9')]()===_0x5bc9ba[_0x519d('0x9')]();};}exports[_0x519d('0xa')]=function(_0x5c05e2,_0x49cdcf,_0x16264d,_0x4b96db){return function(_0x210fbd){try{var _0x1b1340={'name':_0x49cdcf[0x0],'timeout':_0x49cdcf[0x1]};var _0x289837=queue[_0x519d('0xb')](_0x1b1340,{'typecast':!![]});if(_0x289837[_0x519d('0xc')]){logger[_0x519d('0xd')](_0x519d('0xe'),_0x5c05e2,_[_0x519d('0xf')](_0x289837,_0x519d('0x10'))[_0x519d('0x11')](',\x20'));_0x210fbd[_0x519d('0x12')]();}else{var _0x42dcd0=_[_0x519d('0x13')](_0x16264d[_0x519d('0x14')],handleFindAgent(_0x1b1340[_0x519d('0x8')]));if(_0x42dcd0){var _0x2c9300=(_0x1b1340[_0x519d('0x15')]||0xa)*0x3e8;var _0x474938,_0x3739c6;var _0x4e8500=seqqueue[_0x519d('0x16')](_0x2c9300);_0x4e8500['id']=_0x5c05e2;_0x4e8500['atimeout']=_0x2c9300;_0x4e8500[_0x519d('0x17')]=_0x4b96db[_0x519d('0x17')];writeLog(_0x5c05e2,_0x42dcd0,util[_0x519d('0x7')](_0x519d('0x18'),_0x2c9300));_0x16264d[_0x519d('0x19')][_0x5c05e2]['on']('end',function(){_0x4e8500[_0x519d('0x1a')]();clearTimeout(_0x3739c6);_0x3739c6=undefined;if(_0x16264d[_0x519d('0x19')][_0x5c05e2]){delete _0x16264d[_0x519d('0x19')][_0x5c05e2];}logger[_0x519d('0x1b')](_0x519d('0x1c'),_0x5c05e2);_0x210fbd[_0x519d('0x12')]();});_0x3739c6=setTimeout(function(){clearTimeout(_0x3739c6);_0x4e8500[_0x519d('0x1a')]();logger[_0x519d('0x1b')](_0x519d('0x1d'),_0x5c05e2);_0x210fbd[_0x519d('0x1e')]();},_0x2c9300);strategy[_0x519d('0x1f')](_0x4e8500,_0x42dcd0,_0x16264d,_0x4b96db);}else{logger[_0x519d('0xd')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x5c05e2,_0x1b1340[_0x519d('0x8')]);_0x210fbd[_0x519d('0x12')]();}}}catch(_0x1d5c99){console[_0x519d('0x20')](_0x1d5c99);logger[_0x519d('0xd')](_0x519d('0x21'),_0x5c05e2,_0x1d5c99[_0x519d('0x22')]);_0x210fbd[_0x519d('0x12')]();}};}; \ No newline at end of file +var _0x022b=['agents','timeout','atimeout','channel','START:%s','end','close','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','[%s][AGENT]\x20ROUTING\x20END','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','join','stop'];(function(_0x5f2d31,_0x4a7572){var _0x39f6e8=function(_0x4f87e5){while(--_0x4f87e5){_0x5f2d31['push'](_0x5f2d31['shift']());}};_0x39f6e8(++_0x4a7572);}(_0x022b,0x183));var _0xb022=function(_0x5b0b21,_0x5598f9){_0x5b0b21=_0x5b0b21-0x0;var _0x58f996=_0x022b[_0x5b0b21];return _0x58f996;};'use strict';var schema=require(_0xb022('0x0'));var _=require(_0xb022('0x1'));var util=require(_0xb022('0x2'));var seqqueue=require(_0xb022('0x3'));var logger=require('../../../../config/logger')(_0xb022('0x4'));var strategy=require(_0xb022('0x5'));var queue=schema({'name':{'type':'string','required':!![],'message':_0xb022('0x6')},'timeout':{'type':_0xb022('0x7'),'message':_0xb022('0x8')}});function writeLog(_0xbcfa3c,_0x3cfbf5,_0x203502){return logger[_0xb022('0x9')](util[_0xb022('0xa')](_0xb022('0xb'),_0xbcfa3c,_0x3cfbf5[_0xb022('0xc')],_0x203502));}function handleFindAgent(_0x146c9d){return function(_0x2bf375){return _0x2bf375[_0xb022('0xc')]['toLowerCase']()===_0x146c9d[_0xb022('0xd')]();};}exports[_0xb022('0xe')]=function(_0x59c107,_0x4ffe34,_0x173979,_0x7966f8){return function(_0x3e50ae){try{var _0x5a1a2={'name':_0x4ffe34[0x0],'timeout':_0x4ffe34[0x1]};var _0x344b59=queue[_0xb022('0x0')](_0x5a1a2,{'typecast':!![]});if(_0x344b59[_0xb022('0xf')]){logger[_0xb022('0x10')](_0xb022('0x11'),_0x59c107,_[_0xb022('0x12')](_0x344b59,'message')[_0xb022('0x13')](',\x20'));_0x3e50ae[_0xb022('0x14')]();}else{var _0x133182=_['find'](_0x173979[_0xb022('0x15')],handleFindAgent(_0x5a1a2['name']));if(_0x133182){var _0x399903=(_0x5a1a2[_0xb022('0x16')]||0xa)*0x3e8;var _0x280196,_0x439e86;var _0xc4c52a=seqqueue['createQueue'](_0x399903);_0xc4c52a['id']=_0x59c107;_0xc4c52a[_0xb022('0x17')]=_0x399903;_0xc4c52a[_0xb022('0x18')]=_0x7966f8[_0xb022('0x18')];writeLog(_0x59c107,_0x133182,util[_0xb022('0xa')](_0xb022('0x19'),_0x399903));_0x173979['rules'][_0x59c107]['on'](_0xb022('0x1a'),function(){_0xc4c52a[_0xb022('0x1b')]();clearTimeout(_0x439e86);_0x439e86=undefined;if(_0x173979[_0xb022('0x1c')][_0x59c107]){delete _0x173979[_0xb022('0x1c')][_0x59c107];}logger['info'](_0xb022('0x1d'),_0x59c107);_0x3e50ae['stop']();});_0x439e86=setTimeout(function(){clearTimeout(_0x439e86);_0xc4c52a[_0xb022('0x1b')]();logger['info'](_0xb022('0x1e'),_0x59c107);_0x3e50ae[_0xb022('0x1f')]();},_0x399903);strategy['agent'](_0xc4c52a,_0x133182,_0x173979,_0x7966f8);}else{logger[_0xb022('0x10')](_0xb022('0x20'),_0x59c107,_0x5a1a2[_0xb022('0xc')]);_0x3e50ae[_0xb022('0x14')]();}}}catch(_0x500950){console['log'](_0x500950);logger[_0xb022('0x10')](_0xb022('0x21'),_0x59c107,_0x500950['stack']);_0x3e50ae['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 3cf8955..d06a0c2 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 _0x22bb=['isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','format','YYYY-MM-DD\x20HH:mm:ss','channel','ChatWebsiteId','AccountId','upperFirst','InteractionId','created','body','getMustacheRender','create','then','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','toString','postText','dialogState','Failed','error','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence'];(function(_0x416468,_0x2e7a72){var _0x2ee9b7=function(_0xf354ce){while(--_0xf354ce){_0x416468['push'](_0x416468['shift']());}};_0x2ee9b7(++_0x2e7a72);}(_0x22bb,0x1b9));var _0xb22b=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x22bb[_0x1caf6a];return _0x1bf493;};'use strict';var _=require('lodash');var moment=require(_0xb22b('0x0'));var AWS=require(_0xb22b('0x1'));var utils=require(_0xb22b('0x2'));var logger=require(_0xb22b('0x3'))(_0xb22b('0x4'));var rpc={'chatMessage':require(_0xb22b('0x5')),'openchannelMessage':require(_0xb22b('0x6')),'mailMessage':require(_0xb22b('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xb22b('0x8'))};exports[_0xb22b('0x9')]=function(_0x2174ea,_0x34d47d){return function(_0x1b1ee6){try{if(!_[_0xb22b('0xa')](this[_0xb22b('0xb')][_0xb22b('0xc')])){logger[_0xb22b('0xd')](_0xb22b('0xe'),_0x2174ea,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1b1ee6[_0xb22b('0xf')]();}var _0x982c00={'ContactId':this['contact']['id'],'sentAt':moment()[_0xb22b('0x10')](_0xb22b('0x11')),'direction':'out'};var _0x1223f=this[_0xb22b('0x12')];if(_0x1223f==='chat'){_0x982c00[_0xb22b('0x13')]=this['account']['id'];}else{_0x982c00[_['upperFirst'](_0x1223f)+_0xb22b('0x14')]=this['account']['id'];}_0x982c00[_[_0xb22b('0x15')](_0x1223f)+_0xb22b('0x16')]=this['interaction']['id'];if(this[_0xb22b('0xb')][_0xb22b('0x17')]){var _0x46b90c=_0x34d47d[0x4];if(!_['isEmpty'](_0x46b90c)){_0x982c00[_0xb22b('0x18')]=utils[_0xb22b('0x19')](_0x46b90c,this);return rpc[_0x1223f+'Message'][_0xb22b('0x1a')](_0x982c00)[_0xb22b('0x1b')](function(_0x1c0983){logger['info']('[%s][AMAZONLEX]\x20%s',_0x2174ea,_0x982c00[_0xb22b('0x18')]);})[_0xb22b('0x1c')](function(_0x1a2795){logger['error']('[%s][AMAZONLEX]\x20%s',_0x2174ea,JSON[_0xb22b('0x1d')](_0x1a2795));})[_0xb22b('0x1e')](function(){logger[_0xb22b('0xd')](_0xb22b('0x1f'),_0x2174ea);_0x1b1ee6[_0xb22b('0x20')]();});}else{logger[_0xb22b('0xd')](_0xb22b('0x21'),_0x2174ea);_0x1b1ee6[_0xb22b('0x20')]();}}else{var _0x45805a=this;var _0x1c98db=new AWS[(_0xb22b('0x22'))]({'accessKeyId':_0x34d47d[0x0],'secretAccessKey':_0x34d47d[0x1],'region':_0x34d47d[0x2]});var _0x55f689={'botAlias':'$LATEST','botName':_0x34d47d[0x3],'inputText':this[_0xb22b('0x23')][_0xb22b('0x18')],'userId':this[_0xb22b('0xb')]['id'][_0xb22b('0x24')]()};_0x1c98db[_0xb22b('0x25')](_0x55f689,function(_0x1a4771,_0x5edacc){if(_0x1a4771){logger['error'](_0xb22b('0xe'),_0x2174ea,_0x1a4771[_0xb22b('0x23')]);_0x1b1ee6[_0xb22b('0xf')]();}else if(_0x5edacc&&_0x5edacc[_0xb22b('0x23')]){_0x45805a[_0xb22b('0x18')]['amazonlex']=_0x5edacc;_0x982c00['body']=_0x5edacc[_0xb22b('0x23')];return rpc[_0x1223f+'Message'][_0xb22b('0x1a')](_0x982c00)['then'](function(_0x4e71e0){logger[_0xb22b('0xd')](_0xb22b('0xe'),_0x2174ea,_0x982c00[_0xb22b('0x18')]);if(_0x5edacc[_0xb22b('0x26')]==_0xb22b('0x27')){_0x1b1ee6[_0xb22b('0xf')]();}else{_0x1b1ee6[_0xb22b('0x20')]();}})[_0xb22b('0x1c')](function(_0x16433a){logger['error'](_0xb22b('0xe'),_0x2174ea,JSON[_0xb22b('0x1d')](_0x16433a));_0x1b1ee6['next']();});}else{_0x1b1ee6[_0xb22b('0xf')]();}});}}catch(_0x4f5e28){logger[_0xb22b('0x28')](_0xb22b('0xe'),_0x2174ea,JSON['stringify'](_0x4f5e28));_0x1b1ee6[_0xb22b('0x20')]();}};}; \ No newline at end of file +var _0x4be9=['UserId','info','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','create','then','[%s][AMAZONLEX]\x20%s','error','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString','postText','Failed','stringify','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','interaction'];(function(_0xb2ede6,_0x2cb13b){var _0x14e39d=function(_0x123be4){while(--_0x123be4){_0xb2ede6['push'](_0xb2ede6['shift']());}};_0x14e39d(++_0x2cb13b);}(_0x4be9,0x12d));var _0x94be=function(_0x328b1c,_0xec0b4f){_0x328b1c=_0x328b1c-0x0;var _0x4dbeaa=_0x4be9[_0x328b1c];return _0x4dbeaa;};'use strict';var _=require('lodash');var moment=require(_0x94be('0x0'));var AWS=require(_0x94be('0x1'));var utils=require(_0x94be('0x2'));var logger=require(_0x94be('0x3'))(_0x94be('0x4'));var rpc={'chatMessage':require(_0x94be('0x5')),'openchannelMessage':require(_0x94be('0x6')),'mailMessage':require(_0x94be('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x94be('0x8'))};exports[_0x94be('0x9')]=function(_0x16dbf7,_0x4505a4){return function(_0x21b8da){try{if(!_['isNil'](this[_0x94be('0xa')][_0x94be('0xb')])){logger[_0x94be('0xc')]('[%s][AMAZONLEX]\x20%s',_0x16dbf7,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x21b8da[_0x94be('0xd')]();}var _0x5f919c={'ContactId':this[_0x94be('0xe')]['id'],'sentAt':moment()[_0x94be('0xf')](_0x94be('0x10')),'direction':_0x94be('0x11')};var _0x1670b0=this['channel'];if(_0x1670b0==='chat'){_0x5f919c['ChatWebsiteId']=this[_0x94be('0x12')]['id'];}else{_0x5f919c[_[_0x94be('0x13')](_0x1670b0)+_0x94be('0x14')]=this['account']['id'];}_0x5f919c[_[_0x94be('0x13')](_0x1670b0)+_0x94be('0x15')]=this[_0x94be('0xa')]['id'];if(this['interaction'][_0x94be('0x16')]){var _0x6724f6=_0x4505a4[0x4];if(!_[_0x94be('0x17')](_0x6724f6)){_0x5f919c[_0x94be('0x18')]=utils[_0x94be('0x19')](_0x6724f6,this);return rpc[_0x1670b0+'Message'][_0x94be('0x1a')](_0x5f919c)[_0x94be('0x1b')](function(_0x4d83ce){logger[_0x94be('0xc')](_0x94be('0x1c'),_0x16dbf7,_0x5f919c[_0x94be('0x18')]);})['catch'](function(_0x1958fe){logger[_0x94be('0x1d')](_0x94be('0x1c'),_0x16dbf7,JSON['stringify'](_0x1958fe));})['finally'](function(){logger[_0x94be('0xc')](_0x94be('0x1e'),_0x16dbf7);_0x21b8da[_0x94be('0x1f')]();});}else{logger[_0x94be('0xc')](_0x94be('0x20'),_0x16dbf7);_0x21b8da['stop']();}}else{var _0x1d7819=this;var _0x1526cf=new AWS['LexRuntime']({'accessKeyId':_0x4505a4[0x0],'secretAccessKey':_0x4505a4[0x1],'region':_0x4505a4[0x2]});var _0x58f200={'botAlias':_0x94be('0x21'),'botName':_0x4505a4[0x3],'inputText':this[_0x94be('0x22')][_0x94be('0x18')],'userId':this[_0x94be('0xa')]['id'][_0x94be('0x23')]()};_0x1526cf[_0x94be('0x24')](_0x58f200,function(_0x3950e6,_0x2e92df){if(_0x3950e6){logger[_0x94be('0x1d')](_0x94be('0x1c'),_0x16dbf7,_0x3950e6[_0x94be('0x22')]);_0x21b8da[_0x94be('0xd')]();}else if(_0x2e92df&&_0x2e92df[_0x94be('0x22')]){_0x1d7819['body']['amazonlex']=_0x2e92df;_0x5f919c[_0x94be('0x18')]=_0x2e92df[_0x94be('0x22')];return rpc[_0x1670b0+'Message'][_0x94be('0x1a')](_0x5f919c)['then'](function(_0x4807d2){logger['info'](_0x94be('0x1c'),_0x16dbf7,_0x5f919c[_0x94be('0x18')]);if(_0x2e92df['dialogState']==_0x94be('0x25')){_0x21b8da[_0x94be('0xd')]();}else{_0x21b8da[_0x94be('0x1f')]();}})['catch'](function(_0x5a0c8a){logger[_0x94be('0x1d')](_0x94be('0x1c'),_0x16dbf7,JSON['stringify'](_0x5a0c8a));_0x21b8da[_0x94be('0xd')]();});}else{_0x21b8da[_0x94be('0xd')]();}});}}catch(_0x46cfe8){logger[_0x94be('0x1d')](_0x94be('0x1c'),_0x16dbf7,JSON[_0x94be('0x26')](_0x46cfe8));_0x21b8da[_0x94be('0x1f')]();}};}; \ 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 cc97eeb..c7ac7a8 100644 --- a/server/services/routing/server/applications/autoreply.js +++ b/server/services/routing/server/applications/autoreply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['upperFirst','AccountId','InteractionId','Message','service','Smtp','host','port','secure','pass','html','replace','','messageId','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','lodash','moment','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','channel','contact','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','read','subject','startsWith','Re:','chat','ChatWebsiteId','account'];(function(_0x5b086e,_0x5eb6c0){var _0x3e2c2c=function(_0x1c5de7){while(--_0x1c5de7){_0x5b086e['push'](_0x5b086e['shift']());}};_0x3e2c2c(++_0x5eb6c0);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x0d8b('0x2')),'openchannelMessage':require(_0x0d8b('0x3')),'mailMessage':require(_0x0d8b('0x4')),'smsMessage':require(_0x0d8b('0x5')),'faxMessage':require(_0x0d8b('0x6'))};var mailRpc=require('../../mailRpc');exports['consequence']=function(_0x3f8b6f,_0x227c63){return function(_0x39f43a){try{if(_0x227c63[0x0]==='1'&&(_['isNil'](this[_0x0d8b('0x7')][_0x0d8b('0x8')])||!this['interaction'][_0x0d8b('0x8')])){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,_0x0d8b('0xb'));return _0x39f43a[_0x0d8b('0xc')]();}var _0x1cac62=this[_0x0d8b('0xd')];var _0x28f87c={'body':utils['getMustacheRender'](_0x227c63[0x1],this),'ContactId':this[_0x0d8b('0xe')]['id'],'sentAt':moment()['format'](_0x0d8b('0xf')),'direction':_0x0d8b('0x10')};if(this[_0x0d8b('0x11')]){_0x28f87c['to']=this[_0x0d8b('0x11')][_0x0d8b('0x12')]||'';_0x28f87c['cc']=this[_0x0d8b('0x11')]['cc']||'';_0x28f87c[_0x0d8b('0x12')]=this[_0x0d8b('0x11')]['to']||'';_0x28f87c[_0x0d8b('0x13')]=this[_0x0d8b('0x11')][_0x0d8b('0x13')]||'';_0x28f87c[_0x0d8b('0x14')]=!![];if(this[_0x0d8b('0x11')][_0x0d8b('0x15')]){_0x28f87c['subject']='';_0x28f87c[_0x0d8b('0x15')]+=_[_0x0d8b('0x16')](this[_0x0d8b('0x11')][_0x0d8b('0x15')],_0x0d8b('0x17'))?'':'Re:\x20';_0x28f87c[_0x0d8b('0x15')]+=this[_0x0d8b('0x11')][_0x0d8b('0x15')];}}if(this[_0x0d8b('0xd')]===_0x0d8b('0x18')){_0x28f87c[_0x0d8b('0x19')]=this[_0x0d8b('0x1a')]['id'];}else{_0x28f87c[_[_0x0d8b('0x1b')](this['channel'])+_0x0d8b('0x1c')]=this[_0x0d8b('0x1a')]['id'];}_0x28f87c[_[_0x0d8b('0x1b')](this[_0x0d8b('0xd')])+_0x0d8b('0x1d')]=this[_0x0d8b('0x7')]['id'];if(rpc[this[_0x0d8b('0xd')]+_0x0d8b('0x1e')]){if(this['channel']==='mail'){var _0x33fb87={'tls':{'rejectUnauthorized':![]}};if(this['account']['Smtp']['service']){_0x33fb87[_0x0d8b('0x1f')]=this[_0x0d8b('0x1a')][_0x0d8b('0x20')][_0x0d8b('0x1f')];}else{_0x33fb87[_0x0d8b('0x21')]=this[_0x0d8b('0x1a')][_0x0d8b('0x20')][_0x0d8b('0x21')];_0x33fb87[_0x0d8b('0x22')]=this['account'][_0x0d8b('0x20')][_0x0d8b('0x22')];_0x33fb87['secure']=this[_0x0d8b('0x1a')]['Smtp'][_0x0d8b('0x23')];}if(this[_0x0d8b('0x1a')][_0x0d8b('0x20')]['authentication']){_0x33fb87['auth']={'user':this[_0x0d8b('0x1a')][_0x0d8b('0x20')]['user'],'pass':this[_0x0d8b('0x1a')]['Smtp'][_0x0d8b('0x24')]};}_0x28f87c['inReplyTo']=this[_0x0d8b('0x11')]['messageId'];_0x28f87c[_0x0d8b('0x25')]=''+_[_0x0d8b('0x26')](_0x28f87c['body'],_0x0d8b('0x27'),_0x0d8b('0x28'))+_0x0d8b('0x29');return mailRpc['sendMailMessage'](_0x33fb87,_0x28f87c)['then'](function(_0x51cf32){logger[_0x0d8b('0x9')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x3f8b6f);_0x28f87c[_0x0d8b('0x2a')]=_0x51cf32['message']['messageId'];return rpc[_0x1cac62+_0x0d8b('0x1e')][_0x0d8b('0x2b')](_0x28f87c);})[_0x0d8b('0x2c')](function(_0xdeee5d){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0xdeee5d));})[_0x0d8b('0x2e')](function(_0x553e03){logger[_0x0d8b('0x2f')](_0x0d8b('0x30'),_0x3f8b6f,JSON['stringify'](_0x553e03));})[_0x0d8b('0x31')](function(){_0x39f43a[_0x0d8b('0xc')]();});}else{return rpc[this[_0x0d8b('0xd')]+'Message'][_0x0d8b('0x2b')](_0x28f87c)[_0x0d8b('0x2c')](function(_0x206157){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,_0x28f87c['body']);})[_0x0d8b('0x2e')](function(_0x1649fc){logger['error'](_0x0d8b('0xa'),_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0x1649fc));})[_0x0d8b('0x31')](function(){_0x39f43a[_0x0d8b('0xc')]();});}}}catch(_0x373544){logger['error']('[%s][AUTOREPLY]\x20%s',_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0x373544));_0x39f43a['stop']();}};}; \ No newline at end of file +var _0x9c44=['message','from','phone','read','subject','startsWith','Re:','Re:\x20','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','mail','service','host','Smtp','secure','authentication','user','pass','inReplyTo','messageId','html','','replace','body','','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','next','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../mailRpc','isNil','interaction','created','info','[%s][AUTOREPLY]\x20%s','channel','getMustacheRender','contact','out'];(function(_0x55ed76,_0x55d575){var _0x212c9b=function(_0x305179){while(--_0x305179){_0x55ed76['push'](_0x55ed76['shift']());}};_0x212c9b(++_0x55d575);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require(_0x49c4('0x0'));var logger=require(_0x49c4('0x1'))(_0x49c4('0x2'));var rpc={'chatMessage':require(_0x49c4('0x3')),'openchannelMessage':require(_0x49c4('0x4')),'mailMessage':require(_0x49c4('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x49c4('0x6'));exports['consequence']=function(_0xc1278f,_0x6030ae){return function(_0x69bc41){try{if(_0x6030ae[0x0]==='1'&&(_[_0x49c4('0x7')](this[_0x49c4('0x8')]['created'])||!this[_0x49c4('0x8')][_0x49c4('0x9')])){logger[_0x49c4('0xa')](_0x49c4('0xb'),_0xc1278f,'Autoreply\x20already\x20sent');return _0x69bc41['next']();}var _0x451ea6=this[_0x49c4('0xc')];var _0x58cad7={'body':utils[_0x49c4('0xd')](_0x6030ae[0x1],this),'ContactId':this[_0x49c4('0xe')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x49c4('0xf')};if(this[_0x49c4('0x10')]){_0x58cad7['to']=this['message'][_0x49c4('0x11')]||'';_0x58cad7['cc']=this[_0x49c4('0x10')]['cc']||'';_0x58cad7['from']=this[_0x49c4('0x10')]['to']||'';_0x58cad7[_0x49c4('0x12')]=this[_0x49c4('0x10')][_0x49c4('0x12')]||'';_0x58cad7[_0x49c4('0x13')]=!![];if(this[_0x49c4('0x10')][_0x49c4('0x14')]){_0x58cad7[_0x49c4('0x14')]='';_0x58cad7['subject']+=_[_0x49c4('0x15')](this[_0x49c4('0x10')][_0x49c4('0x14')],_0x49c4('0x16'))?'':_0x49c4('0x17');_0x58cad7['subject']+=this[_0x49c4('0x10')][_0x49c4('0x14')];}}if(this['channel']==='chat'){_0x58cad7[_0x49c4('0x18')]=this[_0x49c4('0x19')]['id'];}else{_0x58cad7[_[_0x49c4('0x1a')](this['channel'])+_0x49c4('0x1b')]=this['account']['id'];}_0x58cad7[_[_0x49c4('0x1a')](this[_0x49c4('0xc')])+_0x49c4('0x1c')]=this[_0x49c4('0x8')]['id'];if(rpc[this[_0x49c4('0xc')]+_0x49c4('0x1d')]){if(this[_0x49c4('0xc')]===_0x49c4('0x1e')){var _0x2197d2={'tls':{'rejectUnauthorized':![]}};if(this['account']['Smtp']['service']){_0x2197d2[_0x49c4('0x1f')]=this['account']['Smtp'][_0x49c4('0x1f')];}else{_0x2197d2[_0x49c4('0x20')]=this[_0x49c4('0x19')][_0x49c4('0x21')]['host'];_0x2197d2['port']=this[_0x49c4('0x19')][_0x49c4('0x21')]['port'];_0x2197d2[_0x49c4('0x22')]=this[_0x49c4('0x19')][_0x49c4('0x21')][_0x49c4('0x22')];}if(this['account']['Smtp'][_0x49c4('0x23')]){_0x2197d2['auth']={'user':this[_0x49c4('0x19')][_0x49c4('0x21')][_0x49c4('0x24')],'pass':this[_0x49c4('0x19')]['Smtp'][_0x49c4('0x25')]};}_0x58cad7[_0x49c4('0x26')]=this[_0x49c4('0x10')][_0x49c4('0x27')];_0x58cad7[_0x49c4('0x28')]=_0x49c4('0x29')+_[_0x49c4('0x2a')](_0x58cad7[_0x49c4('0x2b')],_0x49c4('0x2c'),_0x49c4('0x2d'))+_0x49c4('0x2e');return mailRpc['sendMailMessage'](_0x2197d2,_0x58cad7)['then'](function(_0x59eb84){logger[_0x49c4('0xa')](_0x49c4('0x2f'),_0xc1278f);_0x58cad7[_0x49c4('0x27')]=_0x59eb84[_0x49c4('0x10')][_0x49c4('0x27')];return rpc[_0x451ea6+'Message'][_0x49c4('0x30')](_0x58cad7);})[_0x49c4('0x31')](function(_0x2e7a69){logger[_0x49c4('0xa')]('[%s][AUTOREPLY]\x20%s',_0xc1278f,JSON['stringify'](_0x2e7a69));})[_0x49c4('0x32')](function(_0x9a1bed){logger[_0x49c4('0x33')](_0x49c4('0x34'),_0xc1278f,JSON[_0x49c4('0x35')](_0x9a1bed));})['finally'](function(){_0x69bc41[_0x49c4('0x36')]();});}else{return rpc[this[_0x49c4('0xc')]+_0x49c4('0x1d')]['create'](_0x58cad7)['then'](function(_0x85dce2){logger[_0x49c4('0xa')](_0x49c4('0xb'),_0xc1278f,_0x58cad7[_0x49c4('0x2b')]);})[_0x49c4('0x32')](function(_0x2cf897){logger[_0x49c4('0x33')](_0x49c4('0xb'),_0xc1278f,JSON[_0x49c4('0x35')](_0x2cf897));})['finally'](function(){_0x69bc41[_0x49c4('0x36')]();});}}}catch(_0x5b96df){logger[_0x49c4('0x33')](_0x49c4('0xb'),_0xc1278f,JSON[_0x49c4('0x35')](_0x5b96df));_0x69bc41[_0x49c4('0x37')]();}};}; \ 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 addcdbc..6d8d3ed 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 _0x57f8=['../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','[%s][CLOSE]\x20%s','stringify','finally','stop','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction'];(function(_0x264a9c,_0x5348a3){var _0x211b10=function(_0x22ae1e){while(--_0x22ae1e){_0x264a9c['push'](_0x264a9c['shift']());}};_0x211b10(++_0x5348a3);}(_0x57f8,0x198));var _0x857f=function(_0x275fbb,_0x52bdd9){_0x275fbb=_0x275fbb-0x0;var _0x1a1699=_0x57f8[_0x275fbb];return _0x1a1699;};'use strict';var moment=require('moment');var logger=require(_0x857f('0x0'))(_0x857f('0x1'));var rpc={'chatInteraction':require(_0x857f('0x2')),'openchannelInteraction':require(_0x857f('0x3')),'smsInteraction':require(_0x857f('0x4')),'mailInteraction':require(_0x857f('0x5')),'faxInteraction':require(_0x857f('0x6'))};exports[_0x857f('0x7')]=function(_0x318050,_0xced48e,_0xf3874b,_0x369c40){return function(_0x5d22e4){try{logger[_0x857f('0x8')](_0x857f('0x9'),_0x318050,_0xced48e[0x0]);var _0x1aaeea={'closed':0x1,'closedAt':moment()['format'](_0x857f('0xa')),'closeReason':_0x857f('0xb'),'disposition':_0xced48e[0x0]};if(rpc[_0x369c40[_0x857f('0xc')]+'Interaction']){rpc[_0x369c40[_0x857f('0xc')]+_0x857f('0xd')][_0x857f('0xe')](_0x369c40['interaction']['id'],_0x1aaeea)[_0x857f('0xf')](function(_0x360827){logger[_0x857f('0x8')](_0x857f('0x10'),_0x318050,_0x369c40[_0x857f('0x11')]['id']);})[_0x857f('0x12')](function(_0x322192){logger['error'](_0x857f('0x13'),_0x318050,JSON[_0x857f('0x14')](_0x322192));})[_0x857f('0x15')](function(){_0x5d22e4[_0x857f('0x16')]();});}}catch(_0x1fd021){logger['error']('[%s][CLOSE]\x20%s',_0x318050,JSON[_0x857f('0x14')](_0x1fd021));_0x5d22e4['stop']();}};}; \ No newline at end of file +var _0xc06d=['catch','stringify','finally','stop','error','[%s][CLOSE]\x20%s','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','interaction','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!'];(function(_0x166eba,_0x1105b5){var _0x4158c3=function(_0x1f2b86){while(--_0x1f2b86){_0x166eba['push'](_0x166eba['shift']());}};_0x4158c3(++_0x1105b5);}(_0xc06d,0x15a));var _0xdc06=function(_0x1f1f87,_0x1161cd){_0x1f1f87=_0x1f1f87-0x0;var _0x235b1b=_0xc06d[_0x1f1f87];return _0x235b1b;};'use strict';var moment=require(_0xdc06('0x0'));var logger=require(_0xdc06('0x1'))(_0xdc06('0x2'));var rpc={'chatInteraction':require(_0xdc06('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xdc06('0x4')),'mailInteraction':require(_0xdc06('0x5')),'faxInteraction':require('../../rpc/faxInteraction')};exports['consequence']=function(_0x374d2d,_0x47e159,_0x3d613b,_0x2f7692){return function(_0x5ce60c){try{logger['info'](_0xdc06('0x6'),_0x374d2d,_0x47e159[0x0]);var _0x38d505={'closed':0x1,'closedAt':moment()['format'](_0xdc06('0x7')),'closeReason':_0xdc06('0x8'),'disposition':_0x47e159[0x0]};if(rpc[_0x2f7692[_0xdc06('0x9')]+_0xdc06('0xa')]){rpc[_0x2f7692[_0xdc06('0x9')]+'Interaction']['update'](_0x2f7692[_0xdc06('0xb')]['id'],_0x38d505)['then'](function(_0x199b68){logger[_0xdc06('0xc')](_0xdc06('0xd'),_0x374d2d,_0x2f7692[_0xdc06('0xb')]['id']);})[_0xdc06('0xe')](function(_0x3e4af2){logger['error']('[%s][CLOSE]\x20%s',_0x374d2d,JSON[_0xdc06('0xf')](_0x3e4af2));})[_0xdc06('0x10')](function(){_0x5ce60c[_0xdc06('0x11')]();});}}catch(_0x552c3e){logger[_0xdc06('0x12')](_0xdc06('0x13'),_0x374d2d,JSON[_0xdc06('0xf')](_0x552c3e));_0x5ce60c[_0xdc06('0x11')]();}};}; \ 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 b6cd12e..7a5e17a 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 _0x6a35=['Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','create','info','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','fulfillment','speech','result','endConversation','catch','error','stringify','lodash','moment','apiai-promise','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/smsMessage','isNil','interaction','[%s][DIALOGFLOW]\x20%s'];(function(_0x3ca08d,_0x41a57d){var _0x191fe4=function(_0x41f3de){while(--_0x41f3de){_0x3ca08d['push'](_0x3ca08d['shift']());}};_0x191fe4(++_0x41a57d);}(_0x6a35,0xc8));var _0x56a3=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x6a35[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0x56a3('0x0'));var moment=require(_0x56a3('0x1'));var apiai=require(_0x56a3('0x2'));var md5=require('md5');var utils=require(_0x56a3('0x3'));var logger=require(_0x56a3('0x4'))('routing');var rpc={'chatMessage':require(_0x56a3('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x56a3('0x6')),'faxMessage':require('../../rpc/faxMessage')};exports['consequence']=function(_0x2fca1e,_0x3bf48c){return function(_0x3e3be9){try{if(!_[_0x56a3('0x7')](this[_0x56a3('0x8')]['UserId'])){logger['info'](_0x56a3('0x9'),_0x2fca1e,_0x56a3('0xa'));return _0x3e3be9[_0x56a3('0xb')]();}var _0x31f2f4={'ContactId':this[_0x56a3('0xc')]['id'],'sentAt':moment()[_0x56a3('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x56a3('0xe')};var _0x381928=this['channel'];if(_0x381928===_0x56a3('0xf')){_0x31f2f4[_0x56a3('0x10')]=this[_0x56a3('0x11')]['id'];}else{_0x31f2f4[_['upperFirst'](_0x381928)+_0x56a3('0x12')]=this[_0x56a3('0x11')]['id'];}_0x31f2f4[_[_0x56a3('0x13')](_0x381928)+_0x56a3('0x14')]=this[_0x56a3('0x8')]['id'];if(this['interaction'][_0x56a3('0x15')]){var _0xabd5a2=_0x3bf48c[0x2];if(!_[_0x56a3('0x16')](_0xabd5a2)){_0x31f2f4[_0x56a3('0x17')]=utils[_0x56a3('0x18')](_0xabd5a2,this);return rpc[_0x381928+'Message'][_0x56a3('0x19')](_0x31f2f4)['then'](function(_0x425c37){logger[_0x56a3('0x1a')](_0x56a3('0x9'),_0x2fca1e,_0x31f2f4[_0x56a3('0x17')]);})['catch'](function(_0x8edf73){logger['error'](_0x56a3('0x9'),_0x2fca1e,JSON['stringify'](_0x8edf73));})[_0x56a3('0x1b')](function(){logger[_0x56a3('0x1a')](_0x56a3('0x1c'),_0x2fca1e);_0x3e3be9[_0x56a3('0x1d')]();});}else{logger['info'](_0x56a3('0x1e'),_0x2fca1e);_0x3e3be9[_0x56a3('0x1d')]();}}else{var _0xd8fa35=this;var _0x2fe972=apiai(_0x3bf48c[0x0],{'language':_0x3bf48c[0x1]||'en'});return _0x2fe972[_0x56a3('0x1f')](this[_0x56a3('0x20')][_0x56a3('0x17')],{'sessionId':md5(this[_0x56a3('0x8')]['id'])})[_0x56a3('0x21')](function(_0x5bfb8e){_0xd8fa35[_0x56a3('0x17')][_0x56a3('0x22')]=_0x5bfb8e;_0x31f2f4[_0x56a3('0x17')]=_0x5bfb8e['result'][_0x56a3('0x23')][_0x56a3('0x24')];return rpc[_0x381928+'Message'][_0x56a3('0x19')](_0x31f2f4)[_0x56a3('0x21')](function(_0x3e725a){logger[_0x56a3('0x1a')]('[%s][DIALOGFLOW]\x20%s',_0x2fca1e,_0x31f2f4[_0x56a3('0x17')]);if(_0x5bfb8e[_0x56a3('0x25')]['metadata'][_0x56a3('0x26')]){_0x3e3be9[_0x56a3('0xb')]();}else{_0x3e3be9[_0x56a3('0x1d')]();}})[_0x56a3('0x27')](function(_0x467edc){logger[_0x56a3('0x28')]('[%s][DIALOGFLOW]\x20%s',_0x2fca1e,JSON['stringify'](_0x467edc));_0x3e3be9[_0x56a3('0xb')]();});})[_0x56a3('0x27')](function(_0x432cbb){logger['error'](_0x56a3('0x9'),_0x2fca1e,_0x432cbb['message']);_0x3e3be9[_0x56a3('0xb')]();});}}catch(_0x257d78){logger[_0x56a3('0x28')](_0x56a3('0x9'),_0x2fca1e,JSON[_0x56a3('0x29')](_0x257d78));_0x3e3be9[_0x56a3('0x1d')]();}};}; \ No newline at end of file +var _0xa66c=['upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','dialogflow','result','fulfillment','speech','endConversation','moment','apiai-promise','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','interaction','info','[%s][DIALOGFLOW]\x20%s','next','contact','format','out','channel','chat'];(function(_0x2ff238,_0x1811d2){var _0x204a56=function(_0x5bf2e1){while(--_0x5bf2e1){_0x2ff238['push'](_0x2ff238['shift']());}};_0x204a56(++_0x1811d2);}(_0xa66c,0x166));var _0xca66=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa66c[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var moment=require(_0xca66('0x0'));var apiai=require(_0xca66('0x1'));var md5=require('md5');var utils=require(_0xca66('0x2'));var logger=require(_0xca66('0x3'))(_0xca66('0x4'));var rpc={'chatMessage':require(_0xca66('0x5')),'openchannelMessage':require(_0xca66('0x6')),'mailMessage':require(_0xca66('0x7')),'smsMessage':require(_0xca66('0x8')),'faxMessage':require(_0xca66('0x9'))};exports[_0xca66('0xa')]=function(_0x329872,_0x4eebc3){return function(_0x5c6922){try{if(!_['isNil'](this[_0xca66('0xb')]['UserId'])){logger[_0xca66('0xc')](_0xca66('0xd'),_0x329872,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x5c6922[_0xca66('0xe')]();}var _0x51797f={'ContactId':this[_0xca66('0xf')]['id'],'sentAt':moment()[_0xca66('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xca66('0x11')};var _0x460896=this[_0xca66('0x12')];if(_0x460896===_0xca66('0x13')){_0x51797f['ChatWebsiteId']=this['account']['id'];}else{_0x51797f[_[_0xca66('0x14')](_0x460896)+'AccountId']=this['account']['id'];}_0x51797f[_[_0xca66('0x14')](_0x460896)+_0xca66('0x15')]=this[_0xca66('0xb')]['id'];if(this[_0xca66('0xb')][_0xca66('0x16')]){var _0x2bbe30=_0x4eebc3[0x2];if(!_[_0xca66('0x17')](_0x2bbe30)){_0x51797f[_0xca66('0x18')]=utils[_0xca66('0x19')](_0x2bbe30,this);return rpc[_0x460896+_0xca66('0x1a')][_0xca66('0x1b')](_0x51797f)[_0xca66('0x1c')](function(_0x28c43c){logger[_0xca66('0xc')](_0xca66('0xd'),_0x329872,_0x51797f[_0xca66('0x18')]);})[_0xca66('0x1d')](function(_0x504d67){logger[_0xca66('0x1e')](_0xca66('0xd'),_0x329872,JSON[_0xca66('0x1f')](_0x504d67));})[_0xca66('0x20')](function(){logger[_0xca66('0xc')](_0xca66('0x21'),_0x329872);_0x5c6922[_0xca66('0x22')]();});}else{logger[_0xca66('0xc')](_0xca66('0x23'),_0x329872);_0x5c6922[_0xca66('0x22')]();}}else{var _0x5ae317=this;var _0x21143b=apiai(_0x4eebc3[0x0],{'language':_0x4eebc3[0x1]||'en'});return _0x21143b['textRequest'](this[_0xca66('0x24')][_0xca66('0x18')],{'sessionId':md5(this['interaction']['id'])})[_0xca66('0x1c')](function(_0x262d43){_0x5ae317[_0xca66('0x18')][_0xca66('0x25')]=_0x262d43;_0x51797f[_0xca66('0x18')]=_0x262d43[_0xca66('0x26')][_0xca66('0x27')][_0xca66('0x28')];return rpc[_0x460896+_0xca66('0x1a')]['create'](_0x51797f)['then'](function(_0x3b7613){logger[_0xca66('0xc')](_0xca66('0xd'),_0x329872,_0x51797f['body']);if(_0x262d43[_0xca66('0x26')]['metadata'][_0xca66('0x29')]){_0x5c6922['next']();}else{_0x5c6922['stop']();}})[_0xca66('0x1d')](function(_0x2d8883){logger[_0xca66('0x1e')](_0xca66('0xd'),_0x329872,JSON[_0xca66('0x1f')](_0x2d8883));_0x5c6922[_0xca66('0xe')]();});})[_0xca66('0x1d')](function(_0x48b0b5){logger[_0xca66('0x1e')](_0xca66('0xd'),_0x329872,_0x48b0b5['message']);_0x5c6922[_0xca66('0xe')]();});}}catch(_0xbe44bf){logger[_0xca66('0x1e')]('[%s][DIALOGFLOW]\x20%s',_0x329872,JSON[_0xca66('0x1f')](_0xbe44bf));_0x5c6922[_0xca66('0x22')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 7b01625..e8117fc 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 _0x8605=['map','message','join','stop','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','stringify','lodash','html-to-text','./utils','../../../../config/logger','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','validate','length','error'];(function(_0x468653,_0x560247){var _0x129ef9=function(_0x331f3c){while(--_0x331f3c){_0x468653['push'](_0x468653['shift']());}};_0x129ef9(++_0x560247);}(_0x8605,0x189));var _0x5860=function(_0x2cba0b,_0x981afe){_0x2cba0b=_0x2cba0b-0x0;var _0x13c16f=_0x8605[_0x2cba0b];return _0x13c16f;};'use strict';var schema=require('validate');var _=require(_0x5860('0x0'));var htmlToText=require(_0x5860('0x1'));var utils=require(_0x5860('0x2'));var logger=require(_0x5860('0x3'))('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x5860('0x4')},'priorityTrue':{'type':_0x5860('0x5'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x5860('0x5'),'message':_0x5860('0x6')}});exports[_0x5860('0x7')]=function(_0x3a12f7,_0x1c6b0a){return function(_0x44aa13){try{var _0x5dc0f1={'condition':htmlToText['fromString'](utils[_0x5860('0x8')](_0x1c6b0a[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1c6b0a[0x1],'priorityFalse':_0x1c6b0a[0x2]};var _0x15c7f8=gotoif[_0x5860('0x9')](_0x5dc0f1,{'typecast':!![]});if(_0x15c7f8[_0x5860('0xa')]){logger[_0x5860('0xb')]('[%s][GOTOIF]\x20%s',_0x3a12f7,_[_0x5860('0xc')](_0x15c7f8,_0x5860('0xd'))[_0x5860('0xe')](',\x20'));_0x44aa13[_0x5860('0xf')]();}else{try{var _0x3f5f92=eval('('+_0x5dc0f1[_0x5860('0x10')]+')');var _0x580c30=_0x3f5f92?_0x5dc0f1['priorityTrue']:_0x5dc0f1[_0x5860('0x11')];logger[_0x5860('0x12')](_0x5860('0x13'),_0x3a12f7,_0x5dc0f1[_0x5860('0x10')],_0x3f5f92,_0x580c30||_0x5860('0x14'));if(_0x580c30){var _0x24a1af=_[_0x5860('0x15')](_0x44aa13[_0x5860('0x16')](),{'p':_0x580c30});if(_0x24a1af>=0x0){logger[_0x5860('0x12')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3a12f7,_0x580c30||_0x5860('0x14'),_0x24a1af);_0x44aa13[_0x5860('0x14')](_0x24a1af);}else{logger[_0x5860('0x12')](_0x5860('0x17'),_0x3a12f7,_0x580c30||_0x5860('0x14'));_0x44aa13[_0x5860('0xf')]();}}else{_0x44aa13[_0x5860('0x14')]();}}catch(_0x1f6cc1){logger['error'](_0x5860('0x18'),_0x3a12f7,_0x1f6cc1[_0x5860('0xd')]);_0x44aa13[_0x5860('0xf')]();}}}catch(_0x37157b){logger['error'](_0x5860('0x19'),_0x3a12f7,JSON[_0x5860('0x1a')](_0x37157b));_0x44aa13[_0x5860('0xf')]();}};}; \ No newline at end of file +var _0xa210=['map','message','join','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','validate','./utils','routing','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','error','[%s][GOTOIF]\x20%s'];(function(_0xdedb60,_0x5d352f){var _0x395dd3=function(_0x39bf79){while(--_0x39bf79){_0xdedb60['push'](_0xdedb60['shift']());}};_0x395dd3(++_0x5d352f);}(_0xa210,0xf2));var _0x0a21=function(_0x3688b9,_0x204969){_0x3688b9=_0x3688b9-0x0;var _0x4ba5af=_0xa210[_0x3688b9];return _0x4ba5af;};'use strict';var schema=require(_0x0a21('0x0'));var _=require('lodash');var htmlToText=require('html-to-text');var utils=require(_0x0a21('0x1'));var logger=require('../../../../config/logger')(_0x0a21('0x2'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':'number','message':_0x0a21('0x3')},'priorityFalse':{'type':_0x0a21('0x4'),'message':_0x0a21('0x5')}});exports[_0x0a21('0x6')]=function(_0x2cd10b,_0xc5e646){return function(_0x5f028d){try{var _0x3af901={'condition':htmlToText[_0x0a21('0x7')](utils['getMustacheRender'](_0xc5e646[0x0],this),{'wordwrap':![]})[_0x0a21('0x8')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xc5e646[0x1],'priorityFalse':_0xc5e646[0x2]};var _0xe1d274=gotoif[_0x0a21('0x0')](_0x3af901,{'typecast':!![]});if(_0xe1d274['length']){logger[_0x0a21('0x9')](_0x0a21('0xa'),_0x2cd10b,_[_0x0a21('0xb')](_0xe1d274,_0x0a21('0xc'))[_0x0a21('0xd')](',\x20'));_0x5f028d['stop']();}else{try{var _0x13d56e=eval('('+_0x3af901['condition']+')');var _0x2036e9=_0x13d56e?_0x3af901[_0x0a21('0xe')]:_0x3af901['priorityFalse'];logger[_0x0a21('0xf')](_0x0a21('0x10'),_0x2cd10b,_0x3af901[_0x0a21('0x11')],_0x13d56e,_0x2036e9||_0x0a21('0x12'));if(_0x2036e9){var _0x4d71ad=_['findIndex'](_0x5f028d[_0x0a21('0x13')](),{'p':_0x2036e9});if(_0x4d71ad>=0x0){logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x2cd10b,_0x2036e9||_0x0a21('0x12'),_0x4d71ad);_0x5f028d[_0x0a21('0x12')](_0x4d71ad);}else{logger[_0x0a21('0xf')](_0x0a21('0x14'),_0x2cd10b,_0x2036e9||_0x0a21('0x12'));_0x5f028d[_0x0a21('0x15')]();}}else{_0x5f028d[_0x0a21('0x12')]();}}catch(_0xfad511){logger[_0x0a21('0x9')](_0x0a21('0x16'),_0x2cd10b,_0xfad511['message']);_0x5f028d[_0x0a21('0x15')]();}}}catch(_0x1201fc){logger['error']('[%s][GOTOIF]\x20%s',_0x2cd10b,JSON['stringify'](_0x1201fc));_0x5f028d[_0x0a21('0x15')]();}};}; \ 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 5262142..29b3288 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 _0xdb45=['[%s][GOTOP]\x20%s','map','message','join','stop','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error'];(function(_0x3b0d0b,_0x41270b){var _0x20e5da=function(_0x386b7f){while(--_0x386b7f){_0x3b0d0b['push'](_0x3b0d0b['shift']());}};_0x20e5da(++_0x41270b);}(_0xdb45,0x19c));var _0x5db4=function(_0x376508,_0x4c9a92){_0x376508=_0x376508-0x0;var _0xbc0e54=_0xdb45[_0x376508];return _0xbc0e54;};'use strict';var schema=require(_0x5db4('0x0'));var _=require('lodash');var logger=require(_0x5db4('0x1'))(_0x5db4('0x2'));var gotop=schema({'priority':{'type':_0x5db4('0x3'),'required':!![],'message':_0x5db4('0x4')}});exports[_0x5db4('0x5')]=function(_0x30b996,_0x174259){return function(_0x488f14){try{var _0x18ee3b={'priority':_0x174259[0x0]};var _0x2c03d9=gotop[_0x5db4('0x0')](_0x18ee3b,{'typecast':!![]});if(_0x2c03d9[_0x5db4('0x6')]){logger[_0x5db4('0x7')](_0x5db4('0x8'),_0x30b996,_[_0x5db4('0x9')](_0x2c03d9,_0x5db4('0xa'))[_0x5db4('0xb')](',\x20'));_0x488f14[_0x5db4('0xc')]();}else{logger['info']('[%s][GOTOP]\x20priority\x20%s',_0x30b996,_0x18ee3b[_0x5db4('0xd')]);if(_0x18ee3b[_0x5db4('0xd')]){var _0x334a70=_[_0x5db4('0xe')](_0x488f14[_0x5db4('0xf')](),{'p':_0x18ee3b['priority']});if(_0x334a70>=0x0){logger['info'](_0x5db4('0x10'),_0x30b996,_0x18ee3b[_0x5db4('0xd')]||_0x5db4('0x11'),_0x334a70);_0x488f14[_0x5db4('0x11')](_0x334a70);}else{logger['info'](_0x5db4('0x12'),_0x30b996,_0x18ee3b[_0x5db4('0xd')]||'next');_0x488f14[_0x5db4('0xc')]();}}else{_0x488f14[_0x5db4('0x11')]();}}}catch(_0x12e2ce){logger[_0x5db4('0x7')]('[%s][GOTOP]\x20%s',_0x30b996,JSON[_0x5db4('0x13')](_0x12e2ce));_0x488f14[_0x5db4('0xc')]();}};}; \ No newline at end of file +var _0x33f0=['findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','priority','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s'];(function(_0x46aa46,_0x1255ed){var _0x4918f9=function(_0x2812ab){while(--_0x2812ab){_0x46aa46['push'](_0x46aa46['shift']());}};_0x4918f9(++_0x1255ed);}(_0x33f0,0x1ec));var _0x033f=function(_0x323085,_0x4b1efd){_0x323085=_0x323085-0x0;var _0x50c954=_0x33f0[_0x323085];return _0x50c954;};'use strict';var schema=require(_0x033f('0x0'));var _=require(_0x033f('0x1'));var logger=require(_0x033f('0x2'))(_0x033f('0x3'));var gotop=schema({'priority':{'type':_0x033f('0x4'),'required':!![],'message':_0x033f('0x5')}});exports[_0x033f('0x6')]=function(_0x5d72d6,_0x4834e3){return function(_0x27e8fa){try{var _0xa3ba06={'priority':_0x4834e3[0x0]};var _0x23894f=gotop[_0x033f('0x0')](_0xa3ba06,{'typecast':!![]});if(_0x23894f['length']){logger['error'](_0x033f('0x7'),_0x5d72d6,_[_0x033f('0x8')](_0x23894f,_0x033f('0x9'))[_0x033f('0xa')](',\x20'));_0x27e8fa[_0x033f('0xb')]();}else{logger[_0x033f('0xc')](_0x033f('0xd'),_0x5d72d6,_0xa3ba06['priority']);if(_0xa3ba06['priority']){var _0x265d44=_[_0x033f('0xe')](_0x27e8fa[_0x033f('0xf')](),{'p':_0xa3ba06['priority']});if(_0x265d44>=0x0){logger[_0x033f('0xc')](_0x033f('0x10'),_0x5d72d6,_0xa3ba06[_0x033f('0x11')]||_0x033f('0x12'),_0x265d44);_0x27e8fa[_0x033f('0x12')](_0x265d44);}else{logger[_0x033f('0xc')](_0x033f('0x13'),_0x5d72d6,_0xa3ba06['priority']||_0x033f('0x12'));_0x27e8fa[_0x033f('0xb')]();}}else{_0x27e8fa[_0x033f('0x12')]();}}}catch(_0x10ed33){logger[_0x033f('0x14')]('[%s][GOTOP]\x20%s',_0x5d72d6,JSON[_0x033f('0x15')](_0x10ed33));_0x27e8fa[_0x033f('0xb')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index e3b2cbc..db518a0 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 _0x47b0=['getMustacheRender','contact','channel','chat','account','AccountId','InteractionId','interaction','Message','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence'];(function(_0x2f7d18,_0x44bea6){var _0x425175=function(_0x4b6787){while(--_0x4b6787){_0x2f7d18['push'](_0x2f7d18['shift']());}};_0x425175(++_0x44bea6);}(_0x47b0,0x18b));var _0x047b=function(_0x56d507,_0x395a9f){_0x56d507=_0x56d507-0x0;var _0x1fc0d9=_0x47b0[_0x56d507];return _0x1fc0d9;};'use strict';var _=require(_0x047b('0x0'));var utils=require(_0x047b('0x1'));var logger=require(_0x047b('0x2'))(_0x047b('0x3'));var rpc={'chatMessage':require(_0x047b('0x4')),'openchannelMessage':require(_0x047b('0x5')),'mailMessage':require(_0x047b('0x6')),'smsMessage':require(_0x047b('0x7')),'faxMessage':require(_0x047b('0x8'))};exports[_0x047b('0x9')]=function(_0x467790,_0x3a24c8){return function(_0x13f197){try{var _0x1820e8={'body':utils[_0x047b('0xa')](_0x3a24c8[0x0],this),'ContactId':this[_0x047b('0xb')]['id']};if(this[_0x047b('0xc')]===_0x047b('0xd')){_0x1820e8['ChatWebsiteId']=this[_0x047b('0xe')]['id'];}else{_0x1820e8[_['upperFirst'](this[_0x047b('0xc')])+_0x047b('0xf')]=this[_0x047b('0xe')]['id'];}_0x1820e8[_['upperFirst'](this[_0x047b('0xc')])+_0x047b('0x10')]=this[_0x047b('0x11')]['id'];if(rpc[this['channel']+_0x047b('0x12')]){return rpc[this['channel']+_0x047b('0x12')]['create'](_0x1820e8)[_0x047b('0x13')](function(_0x367173){logger[_0x047b('0x14')](_0x047b('0x15'),_0x467790,_0x1820e8[_0x047b('0x16')]);_0x13f197[_0x047b('0x17')]();})[_0x047b('0x18')](function(_0x48baf9){logger[_0x047b('0x19')](_0x047b('0x15'),_0x467790,JSON['stringify'](_0x48baf9));_0x13f197['stop']();});}}catch(_0x38ccc8){logger[_0x047b('0x19')](_0x047b('0x15'),_0x467790,JSON[_0x047b('0x1a')](_0x38ccc8));_0x13f197['stop']();}};}; \ No newline at end of file +var _0xd19f=['Message','create','then','info','[%s][MESSAGE]\x20%s','body','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','channel','account','upperFirst','InteractionId','interaction'];(function(_0x289218,_0x35230b){var _0x184f06=function(_0x486e74){while(--_0x486e74){_0x289218['push'](_0x289218['shift']());}};_0x184f06(++_0x35230b);}(_0xd19f,0xc2));var _0xfd19=function(_0x4d08b8,_0x34c445){_0x4d08b8=_0x4d08b8-0x0;var _0x70214a=_0xd19f[_0x4d08b8];return _0x70214a;};'use strict';var _=require(_0xfd19('0x0'));var utils=require(_0xfd19('0x1'));var logger=require(_0xfd19('0x2'))(_0xfd19('0x3'));var rpc={'chatMessage':require(_0xfd19('0x4')),'openchannelMessage':require(_0xfd19('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xfd19('0x6')),'faxMessage':require(_0xfd19('0x7'))};exports['consequence']=function(_0x2a9f4b,_0x14615d){return function(_0x97a875){try{var _0x71155a={'body':utils['getMustacheRender'](_0x14615d[0x0],this),'ContactId':this['contact']['id']};if(this[_0xfd19('0x8')]==='chat'){_0x71155a['ChatWebsiteId']=this[_0xfd19('0x9')]['id'];}else{_0x71155a[_[_0xfd19('0xa')](this[_0xfd19('0x8')])+'AccountId']=this[_0xfd19('0x9')]['id'];}_0x71155a[_['upperFirst'](this['channel'])+_0xfd19('0xb')]=this[_0xfd19('0xc')]['id'];if(rpc[this['channel']+_0xfd19('0xd')]){return rpc[this[_0xfd19('0x8')]+'Message'][_0xfd19('0xe')](_0x71155a)[_0xfd19('0xf')](function(_0x8abd73){logger[_0xfd19('0x10')](_0xfd19('0x11'),_0x2a9f4b,_0x71155a[_0xfd19('0x12')]);_0x97a875['next']();})[_0xfd19('0x13')](function(_0x157cba){logger[_0xfd19('0x14')](_0xfd19('0x11'),_0x2a9f4b,JSON[_0xfd19('0x15')](_0x157cba));_0x97a875[_0xfd19('0x16')]();});}}catch(_0x3bfb2d){logger[_0xfd19('0x14')](_0xfd19('0x11'),_0x2a9f4b,JSON[_0xfd19('0x15')](_0x3bfb2d));_0x97a875[_0xfd19('0x16')]();}};}; \ 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 f93d8c5..6d39196 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 _0x05a1=['[%s][NOOP]\x20%s','stringify','routing','info','getMustacheRender','next','error'];(function(_0xb10abc,_0x243c03){var _0x4431f4=function(_0x187709){while(--_0x187709){_0xb10abc['push'](_0xb10abc['shift']());}};_0x4431f4(++_0x243c03);}(_0x05a1,0x72));var _0x105a=function(_0x5947ae,_0x275861){_0x5947ae=_0x5947ae-0x0;var _0x7083ad=_0x05a1[_0x5947ae];return _0x7083ad;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')(_0x105a('0x0'));exports['consequence']=function(_0x5209f9,_0x41ba59){return function(_0x3d52ed){try{logger[_0x105a('0x1')]('[%s][NOOP]\x20%s',_0x5209f9,utils[_0x105a('0x2')](_0x41ba59[0x0],this));_0x3d52ed[_0x105a('0x3')]();}catch(_0x482bb7){logger[_0x105a('0x4')](_0x105a('0x5'),_0x5209f9,JSON[_0x105a('0x6')](_0x482bb7));_0x3d52ed['stop']();}};}; \ No newline at end of file +var _0x3ddf=['info','[%s][NOOP]\x20%s','getMustacheRender','error','stringify','./utils','../../../../config/logger','routing','consequence'];(function(_0x399b71,_0x29acef){var _0x5d11b9=function(_0x36571c){while(--_0x36571c){_0x399b71['push'](_0x399b71['shift']());}};_0x5d11b9(++_0x29acef);}(_0x3ddf,0x164));var _0xf3dd=function(_0x4efb19,_0xddea51){_0x4efb19=_0x4efb19-0x0;var _0x2e05eb=_0x3ddf[_0x4efb19];return _0x2e05eb;};'use strict';var utils=require(_0xf3dd('0x0'));var logger=require(_0xf3dd('0x1'))(_0xf3dd('0x2'));exports[_0xf3dd('0x3')]=function(_0x3bba2f,_0x2b022c){return function(_0x9d20cc){try{logger[_0xf3dd('0x4')](_0xf3dd('0x5'),_0x3bba2f,utils[_0xf3dd('0x6')](_0x2b022c[0x0],this));_0x9d20cc['next']();}catch(_0x24afd2){logger[_0xf3dd('0x7')](_0xf3dd('0x5'),_0x3bba2f,JSON[_0xf3dd('0x8')](_0x24afd2));_0x9d20cc['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 6f02894..7c25390 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 _0x630f=['catch','error','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','close','[%s][QUEUE]\x20ROUTING\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','socket.io-emitter','queue_id','account','queue','from','emit','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','waiting','body','contact','list','QueueId','upperFirst','InteractionId','interaction','channel','MessageId','message','chat','AccountId','WebsiteId','info','name','QueueReport'];(function(_0x2304ab,_0x18dece){var _0x373761=function(_0x72d17d){while(--_0x72d17d){_0x2304ab['push'](_0x2304ab['shift']());}};_0x373761(++_0x18dece);}(_0x630f,0x1ec));var _0xf630=function(_0x1205dc,_0x44fc72){_0x1205dc=_0x1205dc-0x0;var _0x1e908e=_0x630f[_0x1205dc];return _0x1e908e;};'use strict';var schema=require(_0xf630('0x0'));var _=require(_0xf630('0x1'));var util=require(_0xf630('0x2'));var seqqueue=require(_0xf630('0x3'));var moment=require(_0xf630('0x4'));var Redis=require(_0xf630('0x5'));var config=require(_0xf630('0x6'));var logger=require(_0xf630('0x7'))(_0xf630('0x8'));var strategy=require(_0xf630('0x9'));config[_0xf630('0xa')]=_[_0xf630('0xb')](config[_0xf630('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xf630('0xc'))(new Redis(config[_0xf630('0xa')]));var attributes=['id',_0xf630('0xd'),_0xf630('0xe'),_0xf630('0xf'),_0xf630('0x10'),'joinAt'];function emit(_0x3d5933,_0x112865,_0x2203a5){io['to'](_0x3d5933)[_0xf630('0x11')](_0x112865,_0x2203a5);}function emitChannelQueueInteraction(_0x51e50f,_0x1a7ac5,_0x13845,_0x257e5c,_0x12622f,_0x54c588,_0x3b1c1d,_0x4a0f64){_0x13845['queue_id']=_0x4a0f64;_0x13845['queue']=_0x1a7ac5;_0x13845[_0xf630('0xe')]=_0x257e5c;_0x13845['id']=_0x12622f;if(_0x54c588){_0x3b1c1d[util['format'](_0xf630('0x12'),_0x51e50f)][_0x12622f]=_[_0xf630('0x13')](_0x13845,attributes);}else{delete _0x3b1c1d[util['format'](_0xf630('0x12'),_0x51e50f)][_0x12622f];}emit(util[_0xf630('0x14')](_0xf630('0x15'),_0x51e50f,_0x1a7ac5),util[_0xf630('0x14')](_0xf630('0x16'),_0x51e50f,_0x54c588?_0xf630('0x17'):_0xf630('0x18')),_[_0xf630('0x13')](_0x13845,attributes));}var rpc={'openchannelQueueReport':require(_0xf630('0x19')),'mailQueueReport':require(_0xf630('0x1a')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xf630('0x1b')),'faxQueueReport':require('../../rpc/faxQueueReport')};var queue=schema({'name':{'type':_0xf630('0x1c'),'required':!![],'message':_0xf630('0x1d')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x129de7,_0x1b2f65,_0x594a4c,_0x82a0ac){if(_0x129de7&&_0x1b2f65&&_0x594a4c){_0x1b2f65[_0xf630('0x1e')]+=0x1;var _0x25496e={'uniqueid':_0x129de7,'from':_0x594a4c[_0xf630('0x1f')]?_0x594a4c[_0xf630('0x1f')][_0xf630('0x10')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x594a4c[_0xf630('0x20')]?_0x594a4c[_0xf630('0x20')]['id']:null,'ListId':_0x594a4c[_0xf630('0x21')]?_0x594a4c[_0xf630('0x21')]['id']:null};_0x25496e[_['upperFirst'](_0x594a4c['channel'])+_0xf630('0x22')]=_0x1b2f65['id']||null;_0x25496e[_[_0xf630('0x23')](_0x594a4c['channel'])+_0xf630('0x24')]=_0x594a4c[_0xf630('0x25')]?_0x594a4c[_0xf630('0x25')]['id']:null;_0x25496e[_['upperFirst'](_0x594a4c[_0xf630('0x26')])+_0xf630('0x27')]=_0x594a4c[_0xf630('0x28')]?_0x594a4c[_0xf630('0x28')]['id']:null;_0x25496e[_[_0xf630('0x23')](_0x594a4c[_0xf630('0x26')])+(_0x594a4c[_0xf630('0x26')]!==_0xf630('0x29')?_0xf630('0x2a'):_0xf630('0x2b'))]=_0x594a4c[_0xf630('0xe')]?_0x594a4c[_0xf630('0xe')]['id']:null;logger[_0xf630('0x2c')](util[_0xf630('0x14')]('[%s][START:QUEUE][NAME:%s]',_0x129de7,_0x1b2f65[_0xf630('0x2d')]));emitChannelQueueInteraction(_0x594a4c[_0xf630('0x26')],_0x1b2f65[_0xf630('0x2d')],_0x25496e,_0x594a4c[_0xf630('0xe')][_0xf630('0x2d')],_0x594a4c[_0xf630('0x28')]['id'],!![],_0x82a0ac,_0x1b2f65['id']);if(rpc[_0x594a4c['channel']+'QueueReport']){return rpc[_0x594a4c[_0xf630('0x26')]+_0xf630('0x2e')]['create'](_0x25496e)[_0xf630('0x2f')](function(_0x35fef3){logger[_0xf630('0x30')]('create\x20queue\x20report');});}}}function stopRouting(_0xca9dc4,_0x476bb1,_0x5d60e3,_0xce8508){if(_0xca9dc4&&_0x476bb1){_0x476bb1['waiting']-=0x1;var _0x1912a7={'leaveAt':moment()[_0xf630('0x14')](_0xf630('0x31')),'acceptAt':moment()['format'](_0xf630('0x31')),'reason':_0xf630('0x32')};logger['info'](util['format'](_0xf630('0x33'),_0xca9dc4,_0x476bb1[_0xf630('0x2d')]));emitChannelQueueInteraction(_0x5d60e3[_0xf630('0x26')],_0x476bb1[_0xf630('0x2d')],_0x5d60e3[_0xf630('0x1f')],_0x5d60e3[_0xf630('0xe')][_0xf630('0x2d')],_0x5d60e3[_0xf630('0x28')]['id'],![],_0xce8508,_0x476bb1['id']);if(rpc[_0x5d60e3[_0xf630('0x26')]+_0xf630('0x2e')]){return rpc[_0x5d60e3[_0xf630('0x26')]+_0xf630('0x2e')][_0xf630('0x34')](_0xca9dc4,_0x1912a7)[_0xf630('0x2f')](function(_0x492cab){logger[_0xf630('0x30')](_0xf630('0x35'));});}}}function endRouting(_0x23f160,_0x385b86,_0x378dae,_0x51ba50){if(_0x23f160&&_0x385b86){_0x385b86[_0xf630('0x1e')]-=0x1;var _0x80e5e5={'leaveAt':moment()[_0xf630('0x14')](_0xf630('0x31')),'exitAt':moment()['format'](_0xf630('0x31')),'reason':_0xf630('0x36')};logger[_0xf630('0x2c')](util['format'](_0xf630('0x37'),_0x23f160,_0x385b86[_0xf630('0x2d')]));emitChannelQueueInteraction(_0x378dae[_0xf630('0x26')],_0x385b86[_0xf630('0x2d')],_0x378dae[_0xf630('0x1f')],_0x378dae['account'][_0xf630('0x2d')],_0x378dae[_0xf630('0x28')]['id'],![],_0x51ba50);if(rpc[_0x378dae[_0xf630('0x26')]+_0xf630('0x2e')]){return rpc[_0x378dae['channel']+_0xf630('0x2e')]['update'](_0x23f160,_0x80e5e5)[_0xf630('0x2f')](function(_0x139051){logger[_0xf630('0x30')](_0xf630('0x35'));});}}}function handleFindQueue(_0x524b0d){return function(_0x2ae2ce){return _0x2ae2ce[_0xf630('0x2d')][_0xf630('0x38')]()===_0x524b0d[_0xf630('0x38')]();};}exports[_0xf630('0x39')]=function(_0x460ee4,_0x171c49,_0x1c5805,_0x29131c){return function(_0x548fb2){try{var _0x2f3e8c={'name':_0x171c49[0x0],'timeout':_0x171c49[0x1]};var _0x5ddc79=queue[_0xf630('0x0')](_0x2f3e8c,{'typecast':!![]});if(_0x5ddc79['length']){logger['error'](_0xf630('0x3a'),_0x460ee4,_[_0xf630('0x3b')](_0x5ddc79,'message')[_0xf630('0x3c')](',\x20'));_0x548fb2[_0xf630('0x3d')]();}else{var _0x8b81b5=_[_0xf630('0x3e')](_0x1c5805[_0x29131c[_0xf630('0x26')]+_0xf630('0x3f')],handleFindQueue(_0x2f3e8c[_0xf630('0x2d')]));if(_0x8b81b5){startRouting(_0x460ee4,_0x8b81b5,_0x29131c,_0x1c5805);var _0x301a1c=(_0x8b81b5[_0xf630('0x36')]||0xa)*0x3e8;var _0x1ec74e=(_0x2f3e8c[_0xf630('0x36')]||0x14)*0x3e8;var _0x2e2b50,_0x5b5f27;if(_0x301a1c>_0x1ec74e){_0x1ec74e=_0x301a1c;}var _0x4cd504=seqqueue[_0xf630('0x40')](_0x301a1c);_0x4cd504['id']=_0x460ee4;_0x4cd504[_0xf630('0x41')]=_0x301a1c;_0x4cd504[_0xf630('0x42')]=_0x1ec74e;_0x4cd504[_0xf630('0x26')]=_0x29131c[_0xf630('0x26')];_0x1c5805[_0xf630('0x43')][_0x460ee4]['on'](_0xf630('0x44'),function(){stopRouting(_0x460ee4,_0x8b81b5,_0x29131c,_0x1c5805);_0x4cd504[_0xf630('0x45')](!![]);clearTimeout(_0x2e2b50);_0x2e2b50=undefined;if(_0x1c5805[_0xf630('0x43')][_0x460ee4]){delete _0x1c5805[_0xf630('0x43')][_0x460ee4];}logger[_0xf630('0x2c')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x460ee4);_0x548fb2[_0xf630('0x3d')]();});_0x2e2b50=setTimeout(function(){endRouting(_0x460ee4,_0x8b81b5,_0x29131c,_0x1c5805);clearTimeout(_0x2e2b50);_0x4cd504[_0xf630('0x45')](!![]);logger['info'](_0xf630('0x46'),_0x460ee4);_0x548fb2[_0xf630('0x47')]();},_0x1ec74e);switch(_0x8b81b5[_0xf630('0x48')]){case'rrmemory':strategy[_0xf630('0x49')](_0x4cd504,_0x8b81b5,_0x1c5805,_0x29131c);break;default:strategy[_0xf630('0x4a')](_0x4cd504,_0x8b81b5,_0x1c5805,_0x29131c);}}else{logger[_0xf630('0x30')](_0xf630('0x4b'),_0x460ee4,_0x2f3e8c[_0xf630('0x2d')]);_0x548fb2[_0xf630('0x3d')]();}}}catch(_0x367a84){console['log'](_0x367a84);logger[_0xf630('0x30')](_0xf630('0x3a'),_0x460ee4,_0x367a84[_0xf630('0x4c')]);_0x548fb2[_0xf630('0x3d')]();}};}; \ No newline at end of file +var _0xb73d=['toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','rules','close','[%s][QUEUE]\x20ROUTING\x20STOPPED','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','queue_id','account','queue','from','joinAt','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','QueueId','MessageId','message','AccountId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','YYYY-MM-DD\x20HH:mm:ss','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout'];(function(_0x149f4d,_0x50a8c9){var _0xe153cf=function(_0x26c7e4){while(--_0x26c7e4){_0x149f4d['push'](_0x149f4d['shift']());}};_0xe153cf(++_0x50a8c9);}(_0xb73d,0xa7));var _0xdb73=function(_0x4610f6,_0x5fe8c3){_0x4610f6=_0x4610f6-0x0;var _0x422a4d=_0xb73d[_0x4610f6];return _0x422a4d;};'use strict';var schema=require(_0xdb73('0x0'));var _=require('lodash');var util=require(_0xdb73('0x1'));var seqqueue=require(_0xdb73('0x2'));var moment=require(_0xdb73('0x3'));var Redis=require(_0xdb73('0x4'));var config=require(_0xdb73('0x5'));var logger=require(_0xdb73('0x6'))(_0xdb73('0x7'));var strategy=require(_0xdb73('0x8'));config[_0xdb73('0x9')]=_[_0xdb73('0xa')](config['redis'],{'host':_0xdb73('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0xdb73('0xc'),_0xdb73('0xd'),_0xdb73('0xe'),_0xdb73('0xf'),_0xdb73('0x10')];function emit(_0x2a5f4b,_0x32ed0f,_0x2d1356){io['to'](_0x2a5f4b)['emit'](_0x32ed0f,_0x2d1356);}function emitChannelQueueInteraction(_0xdcd48,_0x3483bd,_0x2df7d2,_0x4056a7,_0x151b8c,_0x49b05f,_0x1c791d,_0x169709){_0x2df7d2[_0xdb73('0xc')]=_0x169709;_0x2df7d2[_0xdb73('0xe')]=_0x3483bd;_0x2df7d2[_0xdb73('0xd')]=_0x4056a7;_0x2df7d2['id']=_0x151b8c;if(_0x49b05f){_0x1c791d[util[_0xdb73('0x11')](_0xdb73('0x12'),_0xdcd48)][_0x151b8c]=_[_0xdb73('0x13')](_0x2df7d2,attributes);}else{delete _0x1c791d[util[_0xdb73('0x11')](_0xdb73('0x12'),_0xdcd48)][_0x151b8c];}emit(util[_0xdb73('0x11')](_0xdb73('0x14'),_0xdcd48,_0x3483bd),util[_0xdb73('0x11')](_0xdb73('0x15'),_0xdcd48,_0x49b05f?_0xdb73('0x16'):_0xdb73('0x17')),_[_0xdb73('0x13')](_0x2df7d2,attributes));}var rpc={'openchannelQueueReport':require(_0xdb73('0x18')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xdb73('0x19')),'smsQueueReport':require(_0xdb73('0x1a')),'faxQueueReport':require(_0xdb73('0x1b'))};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xdb73('0x1c'),'message':_0xdb73('0x1d')}});function startRouting(_0x341b4a,_0x20b439,_0x513de7,_0x17c3c3){if(_0x341b4a&&_0x20b439&&_0x513de7){_0x20b439[_0xdb73('0x1e')]+=0x1;var _0x3bd64c={'uniqueid':_0x341b4a,'from':_0x513de7[_0xdb73('0x1f')]?_0x513de7[_0xdb73('0x1f')][_0xdb73('0xf')]:'','joinAt':moment()[_0xdb73('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x513de7[_0xdb73('0x20')]?_0x513de7[_0xdb73('0x20')]['id']:null,'ListId':_0x513de7[_0xdb73('0x21')]?_0x513de7[_0xdb73('0x21')]['id']:null};_0x3bd64c[_[_0xdb73('0x22')](_0x513de7[_0xdb73('0x23')])+_0xdb73('0x24')]=_0x20b439['id']||null;_0x3bd64c[_['upperFirst'](_0x513de7[_0xdb73('0x23')])+'InteractionId']=_0x513de7['interaction']?_0x513de7['interaction']['id']:null;_0x3bd64c[_['upperFirst'](_0x513de7[_0xdb73('0x23')])+_0xdb73('0x25')]=_0x513de7[_0xdb73('0x26')]?_0x513de7[_0xdb73('0x26')]['id']:null;_0x3bd64c[_[_0xdb73('0x22')](_0x513de7['channel'])+(_0x513de7['channel']!=='chat'?_0xdb73('0x27'):'WebsiteId')]=_0x513de7['account']?_0x513de7[_0xdb73('0xd')]['id']:null;logger['info'](util[_0xdb73('0x11')](_0xdb73('0x28'),_0x341b4a,_0x20b439['name']));emitChannelQueueInteraction(_0x513de7[_0xdb73('0x23')],_0x20b439[_0xdb73('0x29')],_0x3bd64c,_0x513de7[_0xdb73('0xd')]['name'],_0x513de7[_0xdb73('0x26')]['id'],!![],_0x17c3c3,_0x20b439['id']);if(rpc[_0x513de7[_0xdb73('0x23')]+_0xdb73('0x2a')]){return rpc[_0x513de7['channel']+_0xdb73('0x2a')]['create'](_0x3bd64c)[_0xdb73('0x2b')](function(_0x28471d){logger[_0xdb73('0x2c')]('create\x20queue\x20report');});}}}function stopRouting(_0x2cf287,_0x620287,_0x4d2987,_0x48c61c){if(_0x2cf287&&_0x620287){_0x620287[_0xdb73('0x1e')]-=0x1;var _0x44c642={'leaveAt':moment()[_0xdb73('0x11')](_0xdb73('0x2d')),'acceptAt':moment()[_0xdb73('0x11')](_0xdb73('0x2d')),'reason':_0xdb73('0x2e')};logger[_0xdb73('0x2f')](util[_0xdb73('0x11')](_0xdb73('0x30'),_0x2cf287,_0x620287[_0xdb73('0x29')]));emitChannelQueueInteraction(_0x4d2987[_0xdb73('0x23')],_0x620287[_0xdb73('0x29')],_0x4d2987[_0xdb73('0x1f')],_0x4d2987[_0xdb73('0xd')][_0xdb73('0x29')],_0x4d2987[_0xdb73('0x26')]['id'],![],_0x48c61c,_0x620287['id']);if(rpc[_0x4d2987[_0xdb73('0x23')]+_0xdb73('0x2a')]){return rpc[_0x4d2987[_0xdb73('0x23')]+_0xdb73('0x2a')][_0xdb73('0x31')](_0x2cf287,_0x44c642)[_0xdb73('0x2b')](function(_0x1e83ce){logger[_0xdb73('0x2c')](_0xdb73('0x32'));});}}}function endRouting(_0x1929c9,_0x75bbd7,_0x1fcd68,_0x119144){if(_0x1929c9&&_0x75bbd7){_0x75bbd7[_0xdb73('0x1e')]-=0x1;var _0x1f4e96={'leaveAt':moment()[_0xdb73('0x11')](_0xdb73('0x2d')),'exitAt':moment()[_0xdb73('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xdb73('0x33')};logger[_0xdb73('0x2f')](util[_0xdb73('0x11')]('[%s][END:QUEUE][NAME:%s]',_0x1929c9,_0x75bbd7[_0xdb73('0x29')]));emitChannelQueueInteraction(_0x1fcd68['channel'],_0x75bbd7[_0xdb73('0x29')],_0x1fcd68[_0xdb73('0x1f')],_0x1fcd68[_0xdb73('0xd')][_0xdb73('0x29')],_0x1fcd68[_0xdb73('0x26')]['id'],![],_0x119144);if(rpc[_0x1fcd68[_0xdb73('0x23')]+_0xdb73('0x2a')]){return rpc[_0x1fcd68[_0xdb73('0x23')]+'QueueReport'][_0xdb73('0x31')](_0x1929c9,_0x1f4e96)[_0xdb73('0x2b')](function(_0x1a81f9){logger[_0xdb73('0x2c')](_0xdb73('0x32'));});}}}function handleFindQueue(_0x92d642){return function(_0x241fe7){return _0x241fe7[_0xdb73('0x29')][_0xdb73('0x34')]()===_0x92d642[_0xdb73('0x34')]();};}exports[_0xdb73('0x35')]=function(_0x1c053f,_0x1bbeb3,_0x17f80e,_0x2134a5){return function(_0x1d6fa5){try{var _0x20421b={'name':_0x1bbeb3[0x0],'timeout':_0x1bbeb3[0x1]};var _0x5f0588=queue[_0xdb73('0x0')](_0x20421b,{'typecast':!![]});if(_0x5f0588[_0xdb73('0x36')]){logger[_0xdb73('0x2c')](_0xdb73('0x37'),_0x1c053f,_[_0xdb73('0x38')](_0x5f0588,_0xdb73('0x26'))[_0xdb73('0x39')](',\x20'));_0x1d6fa5[_0xdb73('0x3a')]();}else{var _0x48fcae=_[_0xdb73('0x3b')](_0x17f80e[_0x2134a5[_0xdb73('0x23')]+_0xdb73('0x3c')],handleFindQueue(_0x20421b['name']));if(_0x48fcae){startRouting(_0x1c053f,_0x48fcae,_0x2134a5,_0x17f80e);var _0x543921=(_0x48fcae[_0xdb73('0x33')]||0xa)*0x3e8;var _0x3c1dc8=(_0x20421b['timeout']||0x14)*0x3e8;var _0x53a1ed,_0x3acfba;if(_0x543921>_0x3c1dc8){_0x3c1dc8=_0x543921;}var _0x3a771a=seqqueue[_0xdb73('0x3d')](_0x543921);_0x3a771a['id']=_0x1c053f;_0x3a771a[_0xdb73('0x3e')]=_0x543921;_0x3a771a['qtimeout']=_0x3c1dc8;_0x3a771a['channel']=_0x2134a5['channel'];_0x17f80e[_0xdb73('0x3f')][_0x1c053f]['on']('end',function(){stopRouting(_0x1c053f,_0x48fcae,_0x2134a5,_0x17f80e);_0x3a771a[_0xdb73('0x40')](!![]);clearTimeout(_0x53a1ed);_0x53a1ed=undefined;if(_0x17f80e[_0xdb73('0x3f')][_0x1c053f]){delete _0x17f80e['rules'][_0x1c053f];}logger[_0xdb73('0x2f')](_0xdb73('0x41'),_0x1c053f);_0x1d6fa5[_0xdb73('0x3a')]();});_0x53a1ed=setTimeout(function(){endRouting(_0x1c053f,_0x48fcae,_0x2134a5,_0x17f80e);clearTimeout(_0x53a1ed);_0x3a771a[_0xdb73('0x40')](!![]);logger['info']('[%s][QUEUE]\x20ROUTING\x20END',_0x1c053f);_0x1d6fa5[_0xdb73('0x42')]();},_0x3c1dc8);switch(_0x48fcae[_0xdb73('0x43')]){case _0xdb73('0x44'):strategy[_0xdb73('0x44')](_0x3a771a,_0x48fcae,_0x17f80e,_0x2134a5);break;default:strategy[_0xdb73('0x45')](_0x3a771a,_0x48fcae,_0x17f80e,_0x2134a5);}}else{logger[_0xdb73('0x2c')](_0xdb73('0x46'),_0x1c053f,_0x20421b['name']);_0x1d6fa5['stop']();}}}catch(_0x5906e5){console[_0xdb73('0x47')](_0x5906e5);logger[_0xdb73('0x2c')](_0xdb73('0x37'),_0x1c053f,_0x5906e5[_0xdb73('0x48')]);_0x1d6fa5[_0xdb73('0x3a')]();}};}; \ 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 63158a7..a2b797f 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 _0x2960=['prototype','info','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','busy','busyQueue','showNotification','writeLog',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','realtime','routing','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained'];(function(_0x5f2f86,_0x1a97ed){var _0x45aeef=function(_0x499e42){while(--_0x499e42){_0x5f2f86['push'](_0x5f2f86['shift']());}};_0x45aeef(++_0x1a97ed);}(_0x2960,0x71));var _0x0296=function(_0x1da448,_0x565a9f){_0x1da448=_0x1da448-0x0;var _0xdb7a13=_0x2960[_0x1da448];return _0xdb7a13;};'use strict';var _=require(_0x0296('0x0'));var uuid=require(_0x0296('0x1'));var util=require(_0x0296('0x2'));var logger=require(_0x0296('0x3'))('routing');var Agent=function(_0x3e6434,_0x19c694,_0x55d4bc,_0x2e7c6f){this[_0x0296('0x4')]=uuid['v4']();this[_0x0296('0x5')]=_0x3e6434;this['agent']=_0x19c694;this[_0x0296('0x6')]=_0x55d4bc;this[_0x0296('0x7')]=_0x2e7c6f;this[_0x0296('0x5')][_0x0296('0x8')](this[_0x0296('0x9')][_0x0296('0xa')](this),this[_0x0296('0xb')][_0x0296('0xa')](this));this[_0x0296('0x5')]['on'](_0x0296('0xc'),this[_0x0296('0xb')]['bind'](this));this[_0x0296('0x5')]['on'](_0x0296('0xd'),this[_0x0296('0xe')][_0x0296('0xa')](this));};Agent['prototype'][_0x0296('0x8')]=function(){this[_0x0296('0x5')][_0x0296('0x8')](this[_0x0296('0x9')][_0x0296('0xa')](this),this['handleTimeout'][_0x0296('0xa')](this));};Agent['prototype'][_0x0296('0xe')]=function(){this[_0x0296('0xb')](!![]);};Agent[_0x0296('0xf')][_0x0296('0x9')]=function(_0x2082f2){logger[_0x0296('0x10')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x0296('0x5')]['id'],this[_0x0296('0x11')]['id']);if(_[_0x0296('0x12')](this[_0x0296('0x6')][_0x0296('0x13')][this[_0x0296('0x11')]['id']])){logger[_0x0296('0x10')](_0x0296('0x14'),this['squeue']['id'],this[_0x0296('0x11')]['id']);setTimeout(this[_0x0296('0x8')]['bind'](this),0x3e8);}else{if(this['routing'][_0x0296('0x15')]||util[_0x0296('0x16')](this[_0x0296('0x5')]['id'],this[_0x0296('0x6')][_0x0296('0x13')][this[_0x0296('0x11')]['id']],this['squeue']['channel'],![])){this[_0x0296('0x6')]['agents'][this[_0x0296('0x11')]['id']][_0x0296('0x17')]=!![];this['realtime']['agents'][this[_0x0296('0x11')]['id']][_0x0296('0x18')]=undefined;util[_0x0296('0x19')](this['notificationId'],this['squeue']['id'],this['realtime']['agents'][this[_0x0296('0x11')]['id']],null,this['routing']);util[_0x0296('0x1a')](this[_0x0296('0x5')]['id'],this[_0x0296('0x6')][_0x0296('0x13')][this['agent']['id']],'RINGING'+(this[_0x0296('0x7')][_0x0296('0x15')]?_0x0296('0x1b'):''));}else{logger[_0x0296('0x10')](_0x0296('0x1c'),this[_0x0296('0x5')]['id'],this[_0x0296('0x11')]['id']);setTimeout(this[_0x0296('0x8')][_0x0296('0xa')](this),0x3e8);}}};Agent[_0x0296('0xf')][_0x0296('0xb')]=function(_0x201057){if(_[_0x0296('0x12')](this[_0x0296('0x6')][_0x0296('0x13')][this['agent']['id']])){return logger['info'](_0x0296('0x14'),this['squeue']['id'],this[_0x0296('0x11')]['id']);}else{logger[_0x0296('0x10')]('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0x0296('0x11')]['id']);util[_0x0296('0x1d')](this['notificationId'],this[_0x0296('0x5')]['id'],this[_0x0296('0x6')]['agents'][this[_0x0296('0x11')]['id']],null,this[_0x0296('0x7')]);this[_0x0296('0x6')][_0x0296('0x13')][this[_0x0296('0x11')]['id']][_0x0296('0x17')]=![];this[_0x0296('0x6')][_0x0296('0x13')][this[_0x0296('0x11')]['id']][_0x0296('0x18')]=undefined;util['writeLog'](this[_0x0296('0x5')]['id'],this[_0x0296('0x6')]['agents'][this['agent']['id']],_0x201057?'STOP':_0x0296('0x1e'));}if(!_0x201057){setTimeout(this[_0x0296('0x8')][_0x0296('0xa')](this),0x3e8);}};function agent(_0x51d83a,_0x16eb83,_0x91abb7,_0x1aee02){return new Agent(_0x51d83a,_0x16eb83,_0x91abb7,_0x1aee02);}module[_0x0296('0x1f')]=agent; \ No newline at end of file +var _0xf4cd=['lodash','uuid','./util','routing','notificationId','squeue','agent','realtime','push','handleRun','bind','handleTimeout','timeout','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents','busy','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','STOP','TIMEOUT','exports'];(function(_0x3aff3c,_0x248446){var _0x1a3fc4=function(_0x39e816){while(--_0x39e816){_0x3aff3c['push'](_0x3aff3c['shift']());}};_0x1a3fc4(++_0x248446);}(_0xf4cd,0x18c));var _0xdf4c=function(_0x5766be,_0x2fc0a3){_0x5766be=_0x5766be-0x0;var _0xb0d49c=_0xf4cd[_0x5766be];return _0xb0d49c;};'use strict';var _=require(_0xdf4c('0x0'));var uuid=require(_0xdf4c('0x1'));var util=require(_0xdf4c('0x2'));var logger=require('../../../../../config/logger')(_0xdf4c('0x3'));var Agent=function(_0x12d98e,_0x2f5657,_0x180016,_0x3840d6){this[_0xdf4c('0x4')]=uuid['v4']();this[_0xdf4c('0x5')]=_0x12d98e;this[_0xdf4c('0x6')]=_0x2f5657;this[_0xdf4c('0x7')]=_0x180016;this[_0xdf4c('0x3')]=_0x3840d6;this[_0xdf4c('0x5')][_0xdf4c('0x8')](this[_0xdf4c('0x9')][_0xdf4c('0xa')](this),this[_0xdf4c('0xb')]['bind'](this));this[_0xdf4c('0x5')]['on'](_0xdf4c('0xc'),this['handleTimeout'][_0xdf4c('0xa')](this));this[_0xdf4c('0x5')]['on']('drained',this[_0xdf4c('0xd')][_0xdf4c('0xa')](this));};Agent[_0xdf4c('0xe')]['push']=function(){this[_0xdf4c('0x5')]['push'](this['handleRun'][_0xdf4c('0xa')](this),this[_0xdf4c('0xb')]['bind'](this));};Agent[_0xdf4c('0xe')][_0xdf4c('0xd')]=function(){this[_0xdf4c('0xb')](!![]);};Agent['prototype'][_0xdf4c('0x9')]=function(_0x3b555d){logger[_0xdf4c('0xf')](_0xdf4c('0x10'),this[_0xdf4c('0x5')]['id'],this[_0xdf4c('0x6')]['id']);if(_[_0xdf4c('0x11')](this['realtime']['agents'][this[_0xdf4c('0x6')]['id']])){logger[_0xdf4c('0xf')](_0xdf4c('0x12'),this['squeue']['id'],this['agent']['id']);setTimeout(this['push'][_0xdf4c('0xa')](this),0x3e8);}else{if(this['routing'][_0xdf4c('0x13')]||util[_0xdf4c('0x14')](this[_0xdf4c('0x5')]['id'],this[_0xdf4c('0x7')]['agents'][this['agent']['id']],this['squeue']['channel'],![])){this['realtime'][_0xdf4c('0x15')][this[_0xdf4c('0x6')]['id']][_0xdf4c('0x16')]=!![];this[_0xdf4c('0x7')][_0xdf4c('0x15')][this['agent']['id']]['busyQueue']=undefined;util['showNotification'](this[_0xdf4c('0x4')],this['squeue']['id'],this[_0xdf4c('0x7')][_0xdf4c('0x15')][this[_0xdf4c('0x6')]['id']],null,this[_0xdf4c('0x3')]);util[_0xdf4c('0x17')](this[_0xdf4c('0x5')]['id'],this['realtime'][_0xdf4c('0x15')][this[_0xdf4c('0x6')]['id']],_0xdf4c('0x18')+(this[_0xdf4c('0x3')][_0xdf4c('0x13')]?_0xdf4c('0x19'):''));}else{logger[_0xdf4c('0xf')](_0xdf4c('0x1a'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0xdf4c('0x8')][_0xdf4c('0xa')](this),0x3e8);}}};Agent[_0xdf4c('0xe')][_0xdf4c('0xb')]=function(_0x5861e0){if(_[_0xdf4c('0x11')](this[_0xdf4c('0x7')][_0xdf4c('0x15')][this['agent']['id']])){return logger[_0xdf4c('0xf')](_0xdf4c('0x12'),this[_0xdf4c('0x5')]['id'],this[_0xdf4c('0x6')]['id']);}else{logger[_0xdf4c('0xf')](_0xdf4c('0x1b'),this[_0xdf4c('0x5')]['id'],this['agent']['id']);util[_0xdf4c('0x1c')](this[_0xdf4c('0x4')],this['squeue']['id'],this['realtime'][_0xdf4c('0x15')][this['agent']['id']],null,this[_0xdf4c('0x3')]);this[_0xdf4c('0x7')]['agents'][this[_0xdf4c('0x6')]['id']][_0xdf4c('0x16')]=![];this[_0xdf4c('0x7')][_0xdf4c('0x15')][this[_0xdf4c('0x6')]['id']][_0xdf4c('0x1d')]=undefined;util['writeLog'](this[_0xdf4c('0x5')]['id'],this['realtime']['agents'][this['agent']['id']],_0x5861e0?_0xdf4c('0x1e'):_0xdf4c('0x1f'));}if(!_0x5861e0){setTimeout(this[_0xdf4c('0x8')][_0xdf4c('0xa')](this),0x3e8);}};function agent(_0x36c0ea,_0x2529ac,_0x45c829,_0x1ca3e6){return new Agent(_0x36c0ea,_0x2529ac,_0x45c829,_0x1ca3e6);}module[_0xdf4c('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 d4a17be..77ddfb4 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 _0x23a4=['uuid','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','bind','handleTimeout','drained','handleDrained','prototype','push','handleRun','isNil','queue','Agents','length','agents','info','writeLog','RINGING','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','STOP','TIMEOUT','exports'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x23a4,0x193));var _0x423a=function(_0x38ae97,_0x2041f5){_0x38ae97=_0x38ae97-0x0;var _0x91f1b1=_0x23a4[_0x38ae97];return _0x91f1b1;};'use strict';var _=require('lodash');var uuid=require(_0x423a('0x0'));var util=require(_0x423a('0x1'));var logger=require(_0x423a('0x2'))(_0x423a('0x3'));var Beepall=function(_0x43a322,_0x2970c3,_0x5adb3d,_0x5e30d5){this[_0x423a('0x4')]=uuid['v4']();this[_0x423a('0x5')]=_0x43a322;this['queue']=_0x2970c3;this[_0x423a('0x6')]=_0x5adb3d;this[_0x423a('0x3')]=_0x5e30d5;this['squeue']['push'](this['handleRun'][_0x423a('0x7')](this),this[_0x423a('0x8')][_0x423a('0x7')](this));this[_0x423a('0x5')]['on']('timeout',this['handleTimeout'][_0x423a('0x7')](this));this['squeue']['on'](_0x423a('0x9'),this[_0x423a('0xa')][_0x423a('0x7')](this));};Beepall[_0x423a('0xb')][_0x423a('0xc')]=function(){this[_0x423a('0x5')][_0x423a('0xc')](this[_0x423a('0xd')][_0x423a('0x7')](this),this[_0x423a('0x8')][_0x423a('0x7')](this));};Beepall[_0x423a('0xb')]['handleDrained']=function(_0x2571b8){this[_0x423a('0x8')](!![]);};Beepall['prototype'][_0x423a('0xd')]=function(_0x3626c7){var _0x3a5c0c=!![];if(!_[_0x423a('0xe')](this[_0x423a('0xf')])&&!_[_0x423a('0xe')](this[_0x423a('0xf')][_0x423a('0x10')])&&this[_0x423a('0xf')][_0x423a('0x10')][_0x423a('0x11')]>0x0){for(var _0x5bb8b9=0x0,_0x7b4294;_0x5bb8b90x0){for(var _0x3bf7dc=0x0,_0x2febdf;_0x3bf7dc0x0&&_0x27716c[_0x4bf9ea+_0xcd80('0x27')]>=_0x27716c[_0x4bf9ea+_0xcd80('0x28')]){writeLog(_0x2dfe62,_0x27716c,_0x4bf9ea[_0xcd80('0x29')]()+_0xcd80('0x2a'));return![];}}return!![];};exports[_0xcd80('0x2b')]=function(_0x4518b1,_0x596026,_0x1b5057,_0x1c4219,_0xc80b58){return sendNotification(!![],_0x4518b1,_0x596026,_0x1b5057,_0x1c4219,_0xc80b58);};exports[_0xcd80('0x2c')]=function(_0x1b320c,_0x233222,_0x5015d7,_0x39648b,_0x3cfacd){return sendNotification(![],_0x1b320c,_0x233222,_0x5015d7,_0x39648b,_0x3cfacd);};exports[_0xcd80('0x2d')]=writeLog; \ No newline at end of file +var _0xfb68=['remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','busy','BUSY','OFFLINE','PAUSE','CurrentCapacity','Capacity','\x20MAXCAPACITY','hideNotification','writeLog','util','../utils','mustache','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','format','user:%s','name','emit','user:save','split','\x20interaction','notificationSound','account','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xfb68,0x1c8));var _0x8fb6=function(_0x530a84,_0x310326){_0x530a84=_0x530a84-0x0;var _0x4878e4=_0xfb68[_0x530a84];return _0x4878e4;};'use strict';var _=require('lodash');var util=require(_0x8fb6('0x0'));var utils=require(_0x8fb6('0x1'));var Mustache=require(_0x8fb6('0x2'));var Redis=require('ioredis');var config=require(_0x8fb6('0x3'));var logger=require(_0x8fb6('0x4'))(_0x8fb6('0x5'));config[_0x8fb6('0x6')]=_[_0x8fb6('0x7')](config[_0x8fb6('0x6')],{'host':_0x8fb6('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x5ab1a5,_0x2431f4,_0x1ee5d8){io['to'](_0x5ab1a5)['emit'](_0x2431f4,_0x1ee5d8);}function sendNotification(_0x4ed431,_0x525daf,_0x2bf6ab,_0xad1ba5,_0x3c2de6,_0x5775f0){io['to'](util[_0x8fb6('0x9')](_0x8fb6('0xa'),_0xad1ba5[_0x8fb6('0xb')]))[_0x8fb6('0xc')](_0x8fb6('0xd'),_0xad1ba5);var _0x48deec=_0x5775f0||{};var _0x15e2d4=_0x2bf6ab[_0x8fb6('0xe')]('.');var _0x1b204a={'uniqueid':_0x525daf,'channel':_0x15e2d4[0x0],'id':_0x15e2d4[0x1],'title':_0x15e2d4[0x0]+_0x8fb6('0xf'),'interactionId':_0x15e2d4[0x2],'queue':_0x3c2de6?_0x3c2de6[_0x8fb6('0xb')]:null,'sound':_0x48deec['account'][_0x8fb6('0x10')],'shake':_0x48deec[_0x8fb6('0x11')][_0x8fb6('0x12')]};try{if(!_0x48deec[_0x8fb6('0x13')]){_0x48deec[_0x8fb6('0x13')]={};}if(_0x3c2de6){_0x48deec[_0x8fb6('0x13')]['queue']=_0x3c2de6;}else if(_0x48deec['body'][_0x8fb6('0x14')]){delete _0x48deec[_0x8fb6('0x13')]['queue'];}_0x1b204a['msg']=utils[_0x8fb6('0x15')](_0x48deec[_0x8fb6('0x11')][_0x8fb6('0x16')],_0x48deec);}catch(_0x3957b3){_0x1b204a[_0x8fb6('0x17')]=_0x8fb6('0x18');logger['error'](util[_0x8fb6('0x9')]('[%s][QUEUE]\x20%s',_0x525daf,_0x3957b3['message']));}io['to'](util[_0x8fb6('0x9')](_0x8fb6('0xa'),_0xad1ba5[_0x8fb6('0xb')]))[_0x8fb6('0xc')](util[_0x8fb6('0x9')]('notification:%s',_0x4ed431?'save':_0x8fb6('0x19')),_0x1b204a);}function writeLog(_0x590f26,_0x5ee256,_0x5d325e){return logger[_0x8fb6('0x1a')](util[_0x8fb6('0x9')](_0x8fb6('0x1b'),_0x590f26,_0x5ee256['name'],_0x5d325e));}exports['isAgentAvailable']=function(_0x51a23d,_0x268154,_0x52087e,_0x14de24){if(_0x268154[_0x8fb6('0x1c')]){writeLog(_0x51a23d,_0x268154,_0x8fb6('0x1d'));return![];}if(!_0x268154['online']){writeLog(_0x51a23d,_0x268154,_0x8fb6('0x1e'));return![];}if(_0x268154[_0x52087e+'Pause']){writeLog(_0x51a23d,_0x268154,_0x8fb6('0x1f'));return![];}if(_0x14de24&&_0x268154['hasOwnProperty'](_0x52087e+'Capacity')&&_0x268154['hasOwnProperty'](_0x52087e+_0x8fb6('0x20'))){if(_0x268154[_0x52087e+_0x8fb6('0x21')]>0x0&&_0x268154[_0x52087e+_0x8fb6('0x20')]>=_0x268154[_0x52087e+_0x8fb6('0x21')]){writeLog(_0x51a23d,_0x268154,_0x52087e['toUpperCase']()+_0x8fb6('0x22'));return![];}}return!![];};exports['showNotification']=function(_0x34074c,_0xba9eaf,_0x3d8506,_0xbdb3af,_0x189cba){return sendNotification(!![],_0x34074c,_0xba9eaf,_0x3d8506,_0xbdb3af,_0x189cba);};exports[_0x8fb6('0x23')]=function(_0x4dbeb6,_0x5728a6,_0x4b76d3,_0x51e9d2,_0x1e884a){return sendNotification(![],_0x4dbeb6,_0x5728a6,_0x4b76d3,_0x51e9d2,_0x1e884a);};exports[_0x8fb6('0x24')]=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 c55bf7a..f942333 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 _0xe7f1=['isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','./utils','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','map','message','join','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s'];(function(_0x5876a6,_0x410ead){var _0x566826=function(_0x587874){while(--_0x587874){_0x5876a6['push'](_0x5876a6['shift']());}};_0x566826(++_0x410ead);}(_0xe7f1,0x1a3));var _0x1e7f=function(_0x538c3c,_0x59ad83){_0x538c3c=_0x538c3c-0x0;var _0x385458=_0xe7f1[_0x538c3c];return _0x385458;};'use strict';var schema=require(_0x1e7f('0x0'));var sh=require(_0x1e7f('0x1'));var _=require('lodash');var utils=require(_0x1e7f('0x2'));var logger=require(_0x1e7f('0x3'))('routing');var system=schema({'command':{'type':_0x1e7f('0x4'),'required':!![],'message':_0x1e7f('0x5')}});exports['consequence']=function(_0x3973f9,_0x3be488){return function(_0x58dcd0){try{var _0x2c506a={'command':_0x3be488[0x0]};var _0x43a7fa=system['validate'](_0x2c506a,{'typecast':!![]});if(_0x43a7fa[_0x1e7f('0x6')]){logger[_0x1e7f('0x7')]('[%s][SYSTEM]\x20%s',_0x3973f9,_[_0x1e7f('0x8')](_0x43a7fa,_0x1e7f('0x9'))[_0x1e7f('0xa')](',\x20'));logger[_0x1e7f('0xb')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x3973f9);_0x58dcd0[_0x1e7f('0xc')]();}else{var _0x3232e8=this;var _0x422b9c=utils[_0x1e7f('0xd')](_0x3be488[0x0],this);logger['info'](_0x1e7f('0xe'),_0x3973f9,_0x422b9c);sh[_0x1e7f('0xf')](_['trim'](_0x422b9c),function(_0x54e487,_0x7b8da4){logger[_0x1e7f('0xb')](_0x1e7f('0x10'),_0x3973f9,_0x54e487);if(_0x54e487==0x0){var _0x2253d2=_0x7b8da4[_0x1e7f('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x1e7f('0x12')](_0x3be488[0x1])||_['isEmpty'](_0x3be488[0x1])){logger[_0x1e7f('0xb')](_0x1e7f('0x13'),_0x3973f9);_0x3232e8[_0x1e7f('0x14')][_0x3be488[0x1]]=_0x2253d2;}else{logger[_0x1e7f('0xb')](_0x1e7f('0x15'),_0x3973f9,_0x3be488[0x1],_0x2253d2);_0x3232e8[_0x1e7f('0x14')][_0x3be488[0x1]]=_0x2253d2;}}_0x58dcd0[_0x1e7f('0xc')]();});}}catch(_0x2f2ad3){logger[_0x1e7f('0x7')](_0x1e7f('0x16'),_0x3973f9,_[_0x1e7f('0x17')](_0x2f2ad3)?JSON[_0x1e7f('0x18')](_0x2f2ad3):_0x2f2ad3);logger['info'](_0x1e7f('0x19'),_0x3973f9);_0x58dcd0[_0x1e7f('0xc')]();}};}; \ No newline at end of file +var _0x5117=['string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','message','join','info','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','routing'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x5117,0x10f));var _0x7511=function(_0x221b8c,_0x2c7afc){_0x221b8c=_0x221b8c-0x0;var _0x3fab9f=_0x5117[_0x221b8c];return _0x3fab9f;};'use strict';var schema=require(_0x7511('0x0'));var sh=require(_0x7511('0x1'));var _=require(_0x7511('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x7511('0x3'));var system=schema({'command':{'type':_0x7511('0x4'),'required':!![],'message':_0x7511('0x5')}});exports[_0x7511('0x6')]=function(_0x5c5df5,_0x39d5b3){return function(_0x335128){try{var _0xc69af5={'command':_0x39d5b3[0x0]};var _0x189218=system['validate'](_0xc69af5,{'typecast':!![]});if(_0x189218[_0x7511('0x7')]){logger[_0x7511('0x8')]('[%s][SYSTEM]\x20%s',_0x5c5df5,_[_0x7511('0x9')](_0x189218,_0x7511('0xa'))[_0x7511('0xb')](',\x20'));logger[_0x7511('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x5c5df5);_0x335128[_0x7511('0xd')]();}else{var _0x349069=this;var _0x3bdaeb=utils['getMustacheRender'](_0x39d5b3[0x0],this);logger['info'](_0x7511('0xe'),_0x5c5df5,_0x3bdaeb);sh[_0x7511('0xf')](_['trim'](_0x3bdaeb),function(_0x25f303,_0x505363){logger[_0x7511('0xc')](_0x7511('0x10'),_0x5c5df5,_0x25f303);if(_0x25f303==0x0){var _0x486174=_0x505363[_0x7511('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x7511('0x12')](_0x39d5b3[0x1])||_[_0x7511('0x13')](_0x39d5b3[0x1])){logger[_0x7511('0xc')]('[%s][SYSTEM]\x20no\x20variable',_0x5c5df5);_0x349069[_0x7511('0x14')][_0x39d5b3[0x1]]=_0x486174;}else{logger['info'](_0x7511('0x15'),_0x5c5df5,_0x39d5b3[0x1],_0x486174);_0x349069[_0x7511('0x14')][_0x39d5b3[0x1]]=_0x486174;}}_0x335128[_0x7511('0xd')]();});}}catch(_0x517eca){logger[_0x7511('0x8')]('[%s][SYSTEM]\x20%s',_0x5c5df5,_[_0x7511('0x16')](_0x517eca)?JSON[_0x7511('0x17')](_0x517eca):_0x517eca);logger[_0x7511('0xc')](_0x7511('0x18'),_0x5c5df5);_0x335128['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index a1e81b4..2625111 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(_0x7eb9ea,_0x568b17){var _0xf7d60c=function(_0x52b3f1){while(--_0x52b3f1){_0x7eb9ea['push'](_0x7eb9ea['shift']());}};_0xf7d60c(++_0x568b17);}(_0x7a54,0x106));var _0x47a5=function(_0x4db49c,_0x15d438){_0x4db49c=_0x4db49c-0x0;var _0x1da242=_0x7a54[_0x4db49c];return _0x1da242;};'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(_0x365c0a,_0x26dcb7){var _0x19e3e7=function(_0xe2a28a){while(--_0xe2a28a){_0x365c0a['push'](_0x365c0a['shift']());}};_0x19e3e7(++_0x26dcb7);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 245b526..87cc6a0 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 _0xb26e=['contact','message','account','interaction','list','mustache','render','body'];(function(_0x1ca890,_0x21d0d3){var _0x3f8e01=function(_0x4ff2e2){while(--_0x4ff2e2){_0x1ca890['push'](_0x1ca890['shift']());}};_0x3f8e01(++_0x21d0d3);}(_0xb26e,0x11d));var _0xeb26=function(_0x537f6f,_0x10b756){_0x537f6f=_0x537f6f-0x0;var _0x212d3f=_0xb26e[_0x537f6f];return _0x212d3f;};'use strict';var Mustache=require(_0xeb26('0x0'));var _=require('lodash');module['exports']={'getMustacheRender':function(_0x522afd,_0x196269){return Mustache[_0xeb26('0x1')](_0x522afd,_['merge'](_0x196269[_0xeb26('0x2')],{'contact':_0x196269[_0xeb26('0x3')],'message':_0x196269[_0xeb26('0x4')],'account':_0x196269[_0xeb26('0x5')],'interaction':_0x196269[_0xeb26('0x6')],'list':_0x196269[_0xeb26('0x7')]}))||'';}}; \ No newline at end of file +var _0x6fad=['message','account','list','mustache','lodash','exports','render','body','contact'];(function(_0x44644b,_0x24f637){var _0x50cb88=function(_0x3994f9){while(--_0x3994f9){_0x44644b['push'](_0x44644b['shift']());}};_0x50cb88(++_0x24f637);}(_0x6fad,0x174));var _0xd6fa=function(_0x52aba8,_0x567e45){_0x52aba8=_0x52aba8-0x0;var _0x300586=_0x6fad[_0x52aba8];return _0x300586;};'use strict';var Mustache=require(_0xd6fa('0x0'));var _=require(_0xd6fa('0x1'));module[_0xd6fa('0x2')]={'getMustacheRender':function(_0x44c709,_0x4f8a1c){return Mustache[_0xd6fa('0x3')](_0x44c709,_['merge'](_0x4f8a1c[_0xd6fa('0x4')],{'contact':_0x4f8a1c[_0xd6fa('0x5')],'message':_0x4f8a1c[_0xd6fa('0x6')],'account':_0x4f8a1c[_0xd6fa('0x7')],'interaction':_0x4f8a1c['interaction'],'list':_0x4f8a1c[_0xd6fa('0x8')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 3d12244..1db7c03 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 _0x4e14=['stack','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','smsQueues','faxQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','faxQueuesWaitingInteractions','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','channel','message','interaction','applications','isArray','length','existsSync','join','app','toLowerCase','autoreply','split','push','dialogflow','appdata','slice','tag','TagId','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','stringify','matchPath','end','No\x20applications\x20to\x20execute','emit','QueueReport','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy'];(function(_0x3e4ef1,_0x57db4c){var _0x7d80c4=function(_0x398dec){while(--_0x398dec){_0x3e4ef1['push'](_0x3e4ef1['shift']());}};_0x7d80c4(++_0x57db4c);}(_0x4e14,0x1bb));var _0x44e1=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x4e14[_0x1589dd];return _0x1bddd1;};'use strict';var _=require('lodash');var util=require(_0x44e1('0x0'));var path=require('path');var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x44e1('0x1'));var uuid=require(_0x44e1('0x2'));var config=require(_0x44e1('0x3'));var logger=require(_0x44e1('0x4'))(_0x44e1('0x5'));var rpc={'openchannelQueueReport':require(_0x44e1('0x6'))};var rpc={'openchannelQueueReport':require(_0x44e1('0x6')),'mailQueueReport':require(_0x44e1('0x7')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x44e1('0x8')),'faxQueueReport':require(_0x44e1('0x9'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x5c280a,_0xa31639,_0x13e58b){return util[_0x44e1('0xa')](_0x44e1('0xb'),_0x5c280a,_0xa31639||0x0,_0x13e58b||0x0);}function getIntervals(_0x4c234e,_0xd50c86){var _0xb90272=[];if(!_[_0x44e1('0xc')](_0xd50c86[_0x44e1('0xd')])&&!_[_0x44e1('0xc')](_0x4c234e[_0xd50c86[_0x44e1('0xd')]])&&!_[_0x44e1('0xc')](_0x4c234e[_0xd50c86[_0x44e1('0xd')]][_0x44e1('0xe')])){_0xb90272=_['map'](_0x4c234e[_0xd50c86['IntervalId']][_0x44e1('0xe')],_0x44e1('0xf'));}else if(!_['isNil'](_0xd50c86[_0x44e1('0xf')])){_0xb90272=[_0xd50c86[_0x44e1('0xf')]];}return _0xb90272;}exports[_0x44e1('0x10')]=function(_0x192ada){_0x192ada['rules']={};return new BPromise(function(_0x5d35fa,_0x21cfdd){var _0x5a65b6={'Start':function(_0x50a5ea){var _0x8c49f9=this;return new Promise(function(_0x2f418a,_0x2de757){if(_0x50a5ea){try{var _0x4b9fab=[];var _0x203df2=getId(_0x50a5ea[_0x44e1('0x11')],_0x50a5ea[_0x44e1('0x12')]?_0x50a5ea['message']['id']:0x0,_0x50a5ea[_0x44e1('0x13')]?_0x50a5ea[_0x44e1('0x13')]['id']:0x0);if(_0x50a5ea[_0x44e1('0x14')]&&_[_0x44e1('0x15')](_0x50a5ea[_0x44e1('0x14')])&&_0x50a5ea[_0x44e1('0x14')]['length']){for(var _0x3b6c71=0x0;_0x3b6c71<_0x50a5ea['applications'][_0x44e1('0x16')];_0x3b6c71+=0x1){var _0x4afd01=_0x50a5ea['applications'][_0x3b6c71];if(fs[_0x44e1('0x17')](path[_0x44e1('0x18')](__dirname,_0x44e1('0x14'),_0x4afd01[_0x44e1('0x19')]+'.js'))){var _0x48f7e6=[];switch(_0x4afd01['app'][_0x44e1('0x1a')]()){case _0x44e1('0x1b'):var _0xaa65ad=_0x4afd01['appdata'][_0x44e1('0x1c')](',');_0x48f7e6[_0x44e1('0x1d')](_0xaa65ad[0x0]);_0x48f7e6[_0x44e1('0x1d')](_0xaa65ad['slice'](0x1,_0xaa65ad[_0x44e1('0x16')])[_0x44e1('0x18')](','));break;case _0x44e1('0x1e'):var _0xaa65ad=_0x4afd01[_0x44e1('0x1f')][_0x44e1('0x1c')](',');_0x48f7e6['push'](_0xaa65ad[0x0]);_0x48f7e6[_0x44e1('0x1d')](_0xaa65ad[0x1]);_0x48f7e6[_0x44e1('0x1d')](_0xaa65ad[_0x44e1('0x20')](0x2,_0xaa65ad[_0x44e1('0x16')])[_0x44e1('0x18')](','));break;case'amazonlex':var _0xaa65ad=_0x4afd01[_0x44e1('0x1f')]['split'](',');_0x48f7e6[_0x44e1('0x1d')](_0xaa65ad[0x0]);_0x48f7e6[_0x44e1('0x1d')](_0xaa65ad[0x1]);_0x48f7e6[_0x44e1('0x1d')](_0xaa65ad[0x2]);_0x48f7e6['push'](_0xaa65ad[0x3]);_0x48f7e6[_0x44e1('0x1d')](_0xaa65ad['slice'](0x4,_0xaa65ad[_0x44e1('0x16')])[_0x44e1('0x18')](','));break;case'message':_0x48f7e6['push'](_0x4afd01[_0x44e1('0x1f')]);break;case _0x44e1('0x21'):_0x48f7e6[_0x44e1('0x1d')](_0x4afd01[_0x44e1('0x22')]);_0x48f7e6['push'](_0x4afd01[_0x44e1('0x1f')]);break;default:_0x48f7e6=_[_0x44e1('0xc')](_0x4afd01[_0x44e1('0x1f')])?[]:_0x4afd01[_0x44e1('0x1f')][_0x44e1('0x1c')](',');}var _0x15f763={'id':util['format']('%s:%s:%s',_0x203df2,_0x4afd01['id'],_0x4afd01['app']),'condition':require(_0x44e1('0x23'))[_0x44e1('0x24')](_0x203df2,getIntervals(_0x192ada[_0x44e1('0x25')],_0x4afd01),_0x192ada),'consequence':require(_0x44e1('0x26')+_0x4afd01['app'])[_0x44e1('0x27')](_0x203df2,_0x48f7e6,_0x192ada,_0x50a5ea),'p':_0x4afd01[_0x44e1('0x28')]||0x0};logger[_0x44e1('0x29')](_0x44e1('0x2a'),_0x15f763['id'],_0x44e1('0x2b'),getIntervals(_0x192ada[_0x44e1('0x25')],_0x4afd01)[_0x44e1('0x18')](_0x44e1('0x2c')));_0x4b9fab[_0x44e1('0x1d')](_0x15f763);}else{logger[_0x44e1('0x2d')](_0x44e1('0x2e'),path[_0x44e1('0x18')](__dirname,'applications',_0x4afd01[_0x44e1('0x19')]+'.js'));}}_0x192ada['rules'][_0x203df2]=new RuleEngine(_0x4b9fab);_0x192ada[_0x44e1('0x2f')][_0x203df2][_0x44e1('0x30')](_0x50a5ea,function(_0x3f31bd){logger[_0x44e1('0x29')]('Applications\x20executed',JSON[_0x44e1('0x31')](_0x3f31bd[_0x44e1('0x32')]));if(_0x192ada[_0x44e1('0x2f')][_0x203df2]){_0x192ada['rules'][_0x203df2]['emit'](_0x44e1('0x33'));}});return _0x2f418a({'code':0xc8,'message':_0x50a5ea});}else{logger[_0x44e1('0x29')](_0x44e1('0x34'));return _0x2f418a({'code':0xc8,'message':_0x50a5ea});}}catch(_0x55514e){logger[_0x44e1('0x2d')](_0x55514e['stack']);return _0x2de757(_0x8c49f9[_0x44e1('0x2d')](0x1f4,_0x55514e));}}return _0x2de757('routing\x20is\x20empty');});},'AcceptMessage':function(_0x2358e1){var _0x29e764=this;return new Promise(function(_0x43a46a,_0x5490ba){if(_0x2358e1[_0x44e1('0x12')]&&_0x2358e1[_0x44e1('0x12')]['id']){try{var _0x23f457=getId(_0x2358e1[_0x44e1('0x11')],_0x2358e1[_0x44e1('0x12')]?_0x2358e1[_0x44e1('0x12')]['id']:0x0,_0x2358e1[_0x44e1('0x13')]?_0x2358e1[_0x44e1('0x13')]['id']:0x0);if(_0x192ada['rules'][_0x23f457]){_0x192ada[_0x44e1('0x2f')][_0x23f457][_0x44e1('0x35')](_0x44e1('0x33'));if(rpc[_0x2358e1['channel']+'QueueReport']){rpc[_0x2358e1[_0x44e1('0x11')]+_0x44e1('0x36')]['update'](_0x23f457,{'UserId':_0x2358e1[_0x44e1('0x12')]['UserId']})[_0x44e1('0x37')](function(_0x3de9a3){logger[_0x44e1('0x2d')](_0x44e1('0x38'));});}}return _0x43a46a({'code':0xc8,'message':_0x2358e1});}catch(_0x555a5a){logger[_0x44e1('0x2d')](_0x555a5a['stack']);return _0x5490ba(_0x29e764[_0x44e1('0x2d')](0x1f4,_0x555a5a));}}logger[_0x44e1('0x2d')](_0x44e1('0x39'));return _0x5490ba(_0x29e764[_0x44e1('0x2d')](0x1f4,_0x44e1('0x39')));});},'RejectMessage':function(_0x4320c2){var _0xfeda54=this;return new Promise(function(_0x2a23b7,_0x3064bb){if(_0x4320c2[_0x44e1('0x3a')]&&_0x4320c2[_0x44e1('0x3a')]['id']){try{if(_0x192ada[_0x44e1('0x3b')][_0x4320c2['agent']['id']]){_0x192ada[_0x44e1('0x3b')][_0x4320c2[_0x44e1('0x3a')]['id']][_0x44e1('0x3c')]=![];_0x192ada[_0x44e1('0x3b')][_0x4320c2[_0x44e1('0x3a')]['id']]['busyQueue']=undefined;}return _0x2a23b7({'code':0xc8,'message':_0x4320c2});}catch(_0x50d447){logger['error'](_0x50d447[_0x44e1('0x3d')]);return _0x3064bb(_0xfeda54[_0x44e1('0x2d')](0x1f4,_0x50d447));}}logger['error'](_0x44e1('0x39'));return _0x3064bb(_0xfeda54['error'](0x1f4,_0x44e1('0x39')));});},'AbandonInteraction':function(_0x4d44c6){var _0x1728c9=this;return new Promise(function(_0x36d64d,_0x1bc0c3){if(_0x4d44c6[_0x44e1('0x11')]&&_0x4d44c6['interaction']&&_0x4d44c6['interaction']['id']){try{var _0x193de9=getId(_0x4d44c6[_0x44e1('0x11')],_0x4d44c6[_0x44e1('0x12')]?_0x4d44c6[_0x44e1('0x12')]['id']:0x0,_0x4d44c6[_0x44e1('0x13')]?_0x4d44c6[_0x44e1('0x13')]['id']:0x0);if(_0x192ada[_0x44e1('0x2f')][_0x193de9]){_0x192ada['rules'][_0x193de9][_0x44e1('0x35')]('end');}return _0x36d64d({'code':0xc8,'message':_0x4d44c6});}catch(_0x125433){logger['error'](_0x125433[_0x44e1('0x3d')]);return _0x1bc0c3(_0x1728c9[_0x44e1('0x2d')](0x1f4,_0x125433));}}logger[_0x44e1('0x2d')]('message\x20is\x20empty');return _0x1bc0c3(_0x1728c9[_0x44e1('0x2d')](0x1f4,_0x44e1('0x39')));});},'AgentCapacity':function(_0x31445e){var _0x39f59f=this;return new Promise(function(_0x43f8e8,_0x548a55){if(_0x192ada[_0x44e1('0x3b')][_0x44e1('0x3e')](_0x31445e['id'])){for(var _0x1c8749 in _0x31445e[_0x44e1('0x3f')]){if(_0x31445e[_0x44e1('0x3f')][_0x44e1('0x3e')](_0x1c8749)){if(_0x192ada[_0x44e1('0x3b')][_0x31445e['id']][_0x44e1('0x3e')](_0x1c8749+'CurrentCapacity')){_0x192ada[_0x44e1('0x3b')][_0x31445e['id']][_0x1c8749+_0x44e1('0x40')]=parseInt(_0x31445e[_0x44e1('0x3f')][_0x1c8749],0xa);}}}_0x192ada[_0x44e1('0x3b')][_0x31445e['id']]['updateRealtime']();return _0x43f8e8({'code':0xc8,'message':_0x192ada[_0x44e1('0x3b')][_0x31445e['id']]});}else{return _0x548a55(_0x39f59f['error'](0x1f4,_0x44e1('0x41')));}});},'Agents':function(_0x36839b){return new Promise(function(_0x7fd652,_0x232173){var _0x1bfbaa=_['values'](_0x192ada[_0x44e1('0x3b')]);_0x7fd652({'count':_0x1bfbaa[_0x44e1('0x16')],'rows':_0x1bfbaa});});},'ChatQueues':function(_0x37442f){return new Promise(function(_0x1f71fb,_0x2d089c){var _0x2adf28=[];for(var _0x425719 in _0x192ada[_0x44e1('0x42')]){if(_0x192ada[_0x44e1('0x42')][_0x44e1('0x3e')](_0x425719)){var _0xe4e38f=_0x192ada[_0x44e1('0x42')][_0x425719];var _0x24ddba={'id':_0xe4e38f['id'],'available':_0xe4e38f['available'],'loggedIn':_0xe4e38f[_0x44e1('0x43')],'name':_0xe4e38f[_0x44e1('0x44')],'paused':_0xe4e38f[_0x44e1('0x45')],'waiting':_0xe4e38f[_0x44e1('0x46')]};_0x2adf28[_0x44e1('0x1d')](_0x24ddba);}}_0x1f71fb({'count':_0x2adf28[_0x44e1('0x16')],'rows':_0x2adf28});});},'MailQueues':function(_0x22d36e){return new Promise(function(_0x507e81,_0x5ed207){var _0x2e4db3=[];for(var _0x17c75a in _0x192ada['mailQueues']){if(_0x192ada[_0x44e1('0x47')][_0x44e1('0x3e')](_0x17c75a)){var _0x3be97f=_0x192ada[_0x44e1('0x47')][_0x17c75a];var _0x7f97a4={'id':_0x3be97f['id'],'available':_0x3be97f[_0x44e1('0x48')],'loggedIn':_0x3be97f[_0x44e1('0x43')],'name':_0x3be97f[_0x44e1('0x44')],'paused':_0x3be97f['paused'],'waiting':_0x3be97f[_0x44e1('0x46')]};_0x2e4db3[_0x44e1('0x1d')](_0x7f97a4);}}_0x507e81({'count':_0x2e4db3['length'],'rows':_0x2e4db3});});},'OpenchannelQueues':function(_0x1a1930){return new Promise(function(_0x1cde7e,_0x3ca251){var _0x29ba8a=[];for(var _0x2e5406 in _0x192ada['openchannelQueues']){if(_0x192ada['openchannelQueues'][_0x44e1('0x3e')](_0x2e5406)){var _0x49a198=_0x192ada['openchannelQueues'][_0x2e5406];var _0x28a03c={'id':_0x49a198['id'],'available':_0x49a198[_0x44e1('0x48')],'loggedIn':_0x49a198[_0x44e1('0x43')],'name':_0x49a198[_0x44e1('0x44')],'paused':_0x49a198[_0x44e1('0x45')],'waiting':_0x49a198[_0x44e1('0x46')]};_0x29ba8a[_0x44e1('0x1d')](_0x28a03c);}}_0x1cde7e({'count':_0x29ba8a[_0x44e1('0x16')],'rows':_0x29ba8a});});},'SmsQueues':function(_0x998888){return new Promise(function(_0x509422,_0x4c1af3){var _0x7b3186=[];for(var _0x1888ab in _0x192ada[_0x44e1('0x49')]){if(_0x192ada[_0x44e1('0x49')][_0x44e1('0x3e')](_0x1888ab)){var _0x30d77f=_0x192ada[_0x44e1('0x49')][_0x1888ab];var _0x1b18a4={'id':_0x30d77f['id'],'available':_0x30d77f[_0x44e1('0x48')],'loggedIn':_0x30d77f[_0x44e1('0x43')],'name':_0x30d77f['name'],'paused':_0x30d77f[_0x44e1('0x45')],'waiting':_0x30d77f[_0x44e1('0x46')]};_0x7b3186[_0x44e1('0x1d')](_0x1b18a4);}}_0x509422({'count':_0x7b3186[_0x44e1('0x16')],'rows':_0x7b3186});});},'FaxQueues':function(_0x2e4322){return new Promise(function(_0x31595f,_0x2e0c9c){var _0x12e0fa=[];for(var _0x9c4b44 in _0x192ada[_0x44e1('0x4a')]){if(_0x192ada[_0x44e1('0x4a')][_0x44e1('0x3e')](_0x9c4b44)){var _0x15aef5=_0x192ada['faxQueues'][_0x9c4b44];var _0x11e794={'id':_0x15aef5['id'],'available':_0x15aef5[_0x44e1('0x48')],'loggedIn':_0x15aef5[_0x44e1('0x43')],'name':_0x15aef5[_0x44e1('0x44')],'paused':_0x15aef5[_0x44e1('0x45')],'waiting':_0x15aef5[_0x44e1('0x46')]};_0x12e0fa[_0x44e1('0x1d')](_0x11e794);}}_0x31595f({'count':_0x12e0fa['length'],'rows':_0x12e0fa});});},'ChatQueuesWaitingInteractions':function(_0x4fbe6e){return new Promise(function(_0x4635af,_0x56d610){var _0x350cda=_[_0x44e1('0x4b')](_0x192ada[_0x44e1('0x4c')]);_0x4635af({'count':_0x350cda['length'],'rows':_0x350cda});});},'MailQueuesWaitingInteractions':function(_0x40a72f){return new Promise(function(_0x34b801,_0x11a369){var _0x3e082e=_[_0x44e1('0x4b')](_0x192ada[_0x44e1('0x4d')]);_0x34b801({'count':_0x3e082e[_0x44e1('0x16')],'rows':_0x3e082e});});},'OpenchannelQueuesWaitingInteractions':function(_0x46e282){return new Promise(function(_0x502a8f,_0x470aab){var _0x1260b5=_[_0x44e1('0x4b')](_0x192ada['openchannelQueuesWaitingInteractions']);_0x502a8f({'count':_0x1260b5[_0x44e1('0x16')],'rows':_0x1260b5});});},'SmsQueuesWaitingInteractions':function(_0x28b15f){return new Promise(function(_0x1ca0f5,_0x4ff461){var _0x66d230=_['values'](_0x192ada['smsQueuesWaitingInteractions']);_0x1ca0f5({'count':_0x66d230[_0x44e1('0x16')],'rows':_0x66d230});});},'FaxQueuesWaitingInteractions':function(_0x3aea1b){return new Promise(function(_0xaf502a,_0xf796cd){var _0x35af27=_[_0x44e1('0x4b')](_0x192ada[_0x44e1('0x4e')]);_0xaf502a({'count':_0x35af27[_0x44e1('0x16')],'rows':_0x35af27});});}};var _0x86435e=jayson['server'](_0x5a65b6)[_0x44e1('0x4f')]();_0x86435e['on'](_0x44e1('0x2d'),function(_0x565620){logger[_0x44e1('0x2d')](JSON[_0x44e1('0x31')](_0x565620));return _0x21cfdd(_0x565620);});_0x86435e['listen'](0x232c,_0x44e1('0x50'),function(){console[_0x44e1('0x51')](_0x44e1('0x52'),0x232c);return _0x5d35fa(_0x44e1('0x53')+0x232c);});});}; \ No newline at end of file +var _0xc8d5=['../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','message','interaction','applications','isArray','length','existsSync','join','app','.js','autoreply','appdata','push','slice','dialogflow','split','tag','TagId','format','%s:%s:%s','condition','intervals','./applications/','consequence','info','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','stringify','matchPath','emit','end','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','channel','QueueReport','UserId','catch','message\x20is\x20empty','agent','agents','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','paused','mailQueues','available','name','waiting','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','path','jayson/promise','bluebird','uuid','../../../config/environment'];(function(_0x11de4d,_0x2114cc){var _0x3ae95b=function(_0x370cd3){while(--_0x370cd3){_0x11de4d['push'](_0x11de4d['shift']());}};_0x3ae95b(++_0x2114cc);}(_0xc8d5,0x1b2));var _0x5c8d=function(_0x175bd1,_0x4cc43a){_0x175bd1=_0x175bd1-0x0;var _0xb596e7=_0xc8d5[_0x175bd1];return _0xb596e7;};'use strict';var _=require(_0x5c8d('0x0'));var util=require('util');var path=require(_0x5c8d('0x1'));var fs=require('fs');var jayson=require(_0x5c8d('0x2'));var BPromise=require(_0x5c8d('0x3'));var uuid=require(_0x5c8d('0x4'));var config=require(_0x5c8d('0x5'));var logger=require(_0x5c8d('0x6'))('routing');var rpc={'openchannelQueueReport':require(_0x5c8d('0x7'))};var rpc={'openchannelQueueReport':require(_0x5c8d('0x7')),'mailQueueReport':require(_0x5c8d('0x8')),'chatQueueReport':require(_0x5c8d('0x9')),'smsQueueReport':require(_0x5c8d('0xa')),'faxQueueReport':require(_0x5c8d('0xb'))};var RuleEngine=require(_0x5c8d('0xc'));function getId(_0x94d4d0,_0x1cf532,_0x423fb3){return util['format'](_0x5c8d('0xd'),_0x94d4d0,_0x1cf532||0x0,_0x423fb3||0x0);}function getIntervals(_0x2ad831,_0x4af707){var _0x4565aa=[];if(!_[_0x5c8d('0xe')](_0x4af707['IntervalId'])&&!_[_0x5c8d('0xe')](_0x2ad831[_0x4af707[_0x5c8d('0xf')]])&&!_[_0x5c8d('0xe')](_0x2ad831[_0x4af707[_0x5c8d('0xf')]][_0x5c8d('0x10')])){_0x4565aa=_[_0x5c8d('0x11')](_0x2ad831[_0x4af707[_0x5c8d('0xf')]][_0x5c8d('0x10')],'interval');}else if(!_[_0x5c8d('0xe')](_0x4af707[_0x5c8d('0x12')])){_0x4565aa=[_0x4af707[_0x5c8d('0x12')]];}return _0x4565aa;}exports[_0x5c8d('0x13')]=function(_0x4fafb6){_0x4fafb6[_0x5c8d('0x14')]={};return new BPromise(function(_0x1deb5a,_0x5252e8){var _0x2bdeca={'Start':function(_0x50dfd6){var _0x150c5a=this;return new Promise(function(_0x2c8cef,_0x4a4fe4){if(_0x50dfd6){try{var _0x452f22=[];var _0x28ecbb=getId(_0x50dfd6['channel'],_0x50dfd6[_0x5c8d('0x15')]?_0x50dfd6[_0x5c8d('0x15')]['id']:0x0,_0x50dfd6[_0x5c8d('0x16')]?_0x50dfd6[_0x5c8d('0x16')]['id']:0x0);if(_0x50dfd6[_0x5c8d('0x17')]&&_[_0x5c8d('0x18')](_0x50dfd6['applications'])&&_0x50dfd6[_0x5c8d('0x17')][_0x5c8d('0x19')]){for(var _0x444671=0x0;_0x444671<_0x50dfd6['applications'][_0x5c8d('0x19')];_0x444671+=0x1){var _0x384ceb=_0x50dfd6[_0x5c8d('0x17')][_0x444671];if(fs[_0x5c8d('0x1a')](path[_0x5c8d('0x1b')](__dirname,_0x5c8d('0x17'),_0x384ceb[_0x5c8d('0x1c')]+_0x5c8d('0x1d')))){var _0x1c8e19=[];switch(_0x384ceb[_0x5c8d('0x1c')]['toLowerCase']()){case _0x5c8d('0x1e'):var _0x408cd9=_0x384ceb[_0x5c8d('0x1f')]['split'](',');_0x1c8e19[_0x5c8d('0x20')](_0x408cd9[0x0]);_0x1c8e19[_0x5c8d('0x20')](_0x408cd9[_0x5c8d('0x21')](0x1,_0x408cd9[_0x5c8d('0x19')])[_0x5c8d('0x1b')](','));break;case _0x5c8d('0x22'):var _0x408cd9=_0x384ceb[_0x5c8d('0x1f')][_0x5c8d('0x23')](',');_0x1c8e19[_0x5c8d('0x20')](_0x408cd9[0x0]);_0x1c8e19[_0x5c8d('0x20')](_0x408cd9[0x1]);_0x1c8e19[_0x5c8d('0x20')](_0x408cd9[_0x5c8d('0x21')](0x2,_0x408cd9[_0x5c8d('0x19')])[_0x5c8d('0x1b')](','));break;case'amazonlex':var _0x408cd9=_0x384ceb[_0x5c8d('0x1f')][_0x5c8d('0x23')](',');_0x1c8e19[_0x5c8d('0x20')](_0x408cd9[0x0]);_0x1c8e19[_0x5c8d('0x20')](_0x408cd9[0x1]);_0x1c8e19['push'](_0x408cd9[0x2]);_0x1c8e19[_0x5c8d('0x20')](_0x408cd9[0x3]);_0x1c8e19[_0x5c8d('0x20')](_0x408cd9[_0x5c8d('0x21')](0x4,_0x408cd9[_0x5c8d('0x19')])[_0x5c8d('0x1b')](','));break;case _0x5c8d('0x15'):_0x1c8e19['push'](_0x384ceb['appdata']);break;case _0x5c8d('0x24'):_0x1c8e19[_0x5c8d('0x20')](_0x384ceb[_0x5c8d('0x25')]);_0x1c8e19[_0x5c8d('0x20')](_0x384ceb[_0x5c8d('0x1f')]);break;default:_0x1c8e19=_[_0x5c8d('0xe')](_0x384ceb['appdata'])?[]:_0x384ceb['appdata']['split'](',');}var _0x2f5f5e={'id':util[_0x5c8d('0x26')](_0x5c8d('0x27'),_0x28ecbb,_0x384ceb['id'],_0x384ceb[_0x5c8d('0x1c')]),'condition':require('./interval')[_0x5c8d('0x28')](_0x28ecbb,getIntervals(_0x4fafb6[_0x5c8d('0x29')],_0x384ceb),_0x4fafb6),'consequence':require(_0x5c8d('0x2a')+_0x384ceb[_0x5c8d('0x1c')])[_0x5c8d('0x2b')](_0x28ecbb,_0x1c8e19,_0x4fafb6,_0x50dfd6),'p':_0x384ceb['priority']||0x0};logger[_0x5c8d('0x2c')]('Push\x20new\x20rule',_0x2f5f5e['id'],_0x5c8d('0x2d'),getIntervals(_0x4fafb6[_0x5c8d('0x29')],_0x384ceb)[_0x5c8d('0x1b')](_0x5c8d('0x2e')));_0x452f22[_0x5c8d('0x20')](_0x2f5f5e);}else{logger[_0x5c8d('0x2f')](_0x5c8d('0x30'),path['join'](__dirname,_0x5c8d('0x17'),_0x384ceb[_0x5c8d('0x1c')]+_0x5c8d('0x1d')));}}_0x4fafb6[_0x5c8d('0x14')][_0x28ecbb]=new RuleEngine(_0x452f22);_0x4fafb6[_0x5c8d('0x14')][_0x28ecbb]['execute'](_0x50dfd6,function(_0x34d640){logger[_0x5c8d('0x2c')](_0x5c8d('0x31'),JSON[_0x5c8d('0x32')](_0x34d640[_0x5c8d('0x33')]));if(_0x4fafb6['rules'][_0x28ecbb]){_0x4fafb6[_0x5c8d('0x14')][_0x28ecbb][_0x5c8d('0x34')](_0x5c8d('0x35'));}});return _0x2c8cef({'code':0xc8,'message':_0x50dfd6});}else{logger['info'](_0x5c8d('0x36'));return _0x2c8cef({'code':0xc8,'message':_0x50dfd6});}}catch(_0x21fe51){logger[_0x5c8d('0x2f')](_0x21fe51[_0x5c8d('0x37')]);return _0x4a4fe4(_0x150c5a['error'](0x1f4,_0x21fe51));}}return _0x4a4fe4(_0x5c8d('0x38'));});},'AcceptMessage':function(_0x37b783){var _0x31052d=this;return new Promise(function(_0x32310e,_0x14eb8d){if(_0x37b783[_0x5c8d('0x15')]&&_0x37b783['message']['id']){try{var _0x27878b=getId(_0x37b783[_0x5c8d('0x39')],_0x37b783[_0x5c8d('0x15')]?_0x37b783[_0x5c8d('0x15')]['id']:0x0,_0x37b783['interaction']?_0x37b783[_0x5c8d('0x16')]['id']:0x0);if(_0x4fafb6[_0x5c8d('0x14')][_0x27878b]){_0x4fafb6[_0x5c8d('0x14')][_0x27878b][_0x5c8d('0x34')](_0x5c8d('0x35'));if(rpc[_0x37b783[_0x5c8d('0x39')]+_0x5c8d('0x3a')]){rpc[_0x37b783[_0x5c8d('0x39')]+_0x5c8d('0x3a')]['update'](_0x27878b,{'UserId':_0x37b783[_0x5c8d('0x15')][_0x5c8d('0x3b')]})[_0x5c8d('0x3c')](function(_0x208b77){logger[_0x5c8d('0x2f')]('error\x20update\x20queue\x20report');});}}return _0x32310e({'code':0xc8,'message':_0x37b783});}catch(_0x5112b1){logger[_0x5c8d('0x2f')](_0x5112b1[_0x5c8d('0x37')]);return _0x14eb8d(_0x31052d[_0x5c8d('0x2f')](0x1f4,_0x5112b1));}}logger['error']('message\x20is\x20empty');return _0x14eb8d(_0x31052d[_0x5c8d('0x2f')](0x1f4,_0x5c8d('0x3d')));});},'RejectMessage':function(_0x1b1793){var _0x358a03=this;return new Promise(function(_0x57cccc,_0x5ee523){if(_0x1b1793[_0x5c8d('0x3e')]&&_0x1b1793[_0x5c8d('0x3e')]['id']){try{if(_0x4fafb6[_0x5c8d('0x3f')][_0x1b1793[_0x5c8d('0x3e')]['id']]){_0x4fafb6['agents'][_0x1b1793[_0x5c8d('0x3e')]['id']]['busy']=![];_0x4fafb6[_0x5c8d('0x3f')][_0x1b1793[_0x5c8d('0x3e')]['id']][_0x5c8d('0x40')]=undefined;}return _0x57cccc({'code':0xc8,'message':_0x1b1793});}catch(_0x13a468){logger[_0x5c8d('0x2f')](_0x13a468[_0x5c8d('0x37')]);return _0x5ee523(_0x358a03['error'](0x1f4,_0x13a468));}}logger[_0x5c8d('0x2f')](_0x5c8d('0x3d'));return _0x5ee523(_0x358a03['error'](0x1f4,_0x5c8d('0x3d')));});},'AbandonInteraction':function(_0x3bb6d9){var _0x187d33=this;return new Promise(function(_0x14a327,_0x1e3632){if(_0x3bb6d9[_0x5c8d('0x39')]&&_0x3bb6d9[_0x5c8d('0x16')]&&_0x3bb6d9[_0x5c8d('0x16')]['id']){try{var _0x1d61c9=getId(_0x3bb6d9[_0x5c8d('0x39')],_0x3bb6d9[_0x5c8d('0x15')]?_0x3bb6d9[_0x5c8d('0x15')]['id']:0x0,_0x3bb6d9[_0x5c8d('0x16')]?_0x3bb6d9[_0x5c8d('0x16')]['id']:0x0);if(_0x4fafb6[_0x5c8d('0x14')][_0x1d61c9]){_0x4fafb6['rules'][_0x1d61c9][_0x5c8d('0x34')](_0x5c8d('0x35'));}return _0x14a327({'code':0xc8,'message':_0x3bb6d9});}catch(_0x1fbd5b){logger[_0x5c8d('0x2f')](_0x1fbd5b[_0x5c8d('0x37')]);return _0x1e3632(_0x187d33[_0x5c8d('0x2f')](0x1f4,_0x1fbd5b));}}logger[_0x5c8d('0x2f')](_0x5c8d('0x3d'));return _0x1e3632(_0x187d33[_0x5c8d('0x2f')](0x1f4,_0x5c8d('0x3d')));});},'AgentCapacity':function(_0x5c0d0f){var _0x159c66=this;return new Promise(function(_0x8e7ec1,_0x22d9b5){if(_0x4fafb6[_0x5c8d('0x3f')][_0x5c8d('0x41')](_0x5c0d0f['id'])){for(var _0x45ab41 in _0x5c0d0f[_0x5c8d('0x42')]){if(_0x5c0d0f[_0x5c8d('0x42')][_0x5c8d('0x41')](_0x45ab41)){if(_0x4fafb6[_0x5c8d('0x3f')][_0x5c0d0f['id']][_0x5c8d('0x41')](_0x45ab41+'CurrentCapacity')){_0x4fafb6[_0x5c8d('0x3f')][_0x5c0d0f['id']][_0x45ab41+_0x5c8d('0x43')]=parseInt(_0x5c0d0f[_0x5c8d('0x42')][_0x45ab41],0xa);}}}_0x4fafb6[_0x5c8d('0x3f')][_0x5c0d0f['id']][_0x5c8d('0x44')]();return _0x8e7ec1({'code':0xc8,'message':_0x4fafb6[_0x5c8d('0x3f')][_0x5c0d0f['id']]});}else{return _0x22d9b5(_0x159c66[_0x5c8d('0x2f')](0x1f4,_0x5c8d('0x45')));}});},'Agents':function(_0x243045){return new Promise(function(_0x437dfe,_0xc1b481){var _0x1812de=_[_0x5c8d('0x46')](_0x4fafb6['agents']);_0x437dfe({'count':_0x1812de[_0x5c8d('0x19')],'rows':_0x1812de});});},'ChatQueues':function(_0x1953fd){return new Promise(function(_0x5af5d1,_0x442032){var _0x30c89d=[];for(var _0x584df6 in _0x4fafb6[_0x5c8d('0x47')]){if(_0x4fafb6[_0x5c8d('0x47')][_0x5c8d('0x41')](_0x584df6)){var _0x2a69ad=_0x4fafb6['chatQueues'][_0x584df6];var _0x5c7376={'id':_0x2a69ad['id'],'available':_0x2a69ad['available'],'loggedIn':_0x2a69ad[_0x5c8d('0x48')],'name':_0x2a69ad['name'],'paused':_0x2a69ad[_0x5c8d('0x49')],'waiting':_0x2a69ad['waiting']};_0x30c89d[_0x5c8d('0x20')](_0x5c7376);}}_0x5af5d1({'count':_0x30c89d[_0x5c8d('0x19')],'rows':_0x30c89d});});},'MailQueues':function(_0x42a6cb){return new Promise(function(_0x1d3fb2,_0x4535d2){var _0xb13dc8=[];for(var _0x3a27d1 in _0x4fafb6[_0x5c8d('0x4a')]){if(_0x4fafb6[_0x5c8d('0x4a')]['hasOwnProperty'](_0x3a27d1)){var _0x2b85ed=_0x4fafb6['mailQueues'][_0x3a27d1];var _0x15acca={'id':_0x2b85ed['id'],'available':_0x2b85ed[_0x5c8d('0x4b')],'loggedIn':_0x2b85ed['loggedIn'],'name':_0x2b85ed[_0x5c8d('0x4c')],'paused':_0x2b85ed['paused'],'waiting':_0x2b85ed[_0x5c8d('0x4d')]};_0xb13dc8[_0x5c8d('0x20')](_0x15acca);}}_0x1d3fb2({'count':_0xb13dc8[_0x5c8d('0x19')],'rows':_0xb13dc8});});},'OpenchannelQueues':function(_0x49c07d){return new Promise(function(_0xfc9d75,_0x34c31f){var _0x448898=[];for(var _0x2e13f8 in _0x4fafb6[_0x5c8d('0x4e')]){if(_0x4fafb6[_0x5c8d('0x4e')]['hasOwnProperty'](_0x2e13f8)){var _0x2367c1=_0x4fafb6['openchannelQueues'][_0x2e13f8];var _0x24116e={'id':_0x2367c1['id'],'available':_0x2367c1[_0x5c8d('0x4b')],'loggedIn':_0x2367c1[_0x5c8d('0x48')],'name':_0x2367c1[_0x5c8d('0x4c')],'paused':_0x2367c1[_0x5c8d('0x49')],'waiting':_0x2367c1['waiting']};_0x448898['push'](_0x24116e);}}_0xfc9d75({'count':_0x448898['length'],'rows':_0x448898});});},'SmsQueues':function(_0x20bfdf){return new Promise(function(_0x43f176,_0x331a4b){var _0x213f1d=[];for(var _0x3bb49b in _0x4fafb6['smsQueues']){if(_0x4fafb6['smsQueues'][_0x5c8d('0x41')](_0x3bb49b)){var _0x22cfa2=_0x4fafb6[_0x5c8d('0x4f')][_0x3bb49b];var _0x23089d={'id':_0x22cfa2['id'],'available':_0x22cfa2['available'],'loggedIn':_0x22cfa2[_0x5c8d('0x48')],'name':_0x22cfa2[_0x5c8d('0x4c')],'paused':_0x22cfa2[_0x5c8d('0x49')],'waiting':_0x22cfa2[_0x5c8d('0x4d')]};_0x213f1d[_0x5c8d('0x20')](_0x23089d);}}_0x43f176({'count':_0x213f1d[_0x5c8d('0x19')],'rows':_0x213f1d});});},'FaxQueues':function(_0x22e855){return new Promise(function(_0x5828cc,_0xf4e9f0){var _0x6fe493=[];for(var _0x478276 in _0x4fafb6['faxQueues']){if(_0x4fafb6[_0x5c8d('0x50')][_0x5c8d('0x41')](_0x478276)){var _0x23a6b1=_0x4fafb6['faxQueues'][_0x478276];var _0x39c615={'id':_0x23a6b1['id'],'available':_0x23a6b1[_0x5c8d('0x4b')],'loggedIn':_0x23a6b1[_0x5c8d('0x48')],'name':_0x23a6b1[_0x5c8d('0x4c')],'paused':_0x23a6b1[_0x5c8d('0x49')],'waiting':_0x23a6b1[_0x5c8d('0x4d')]};_0x6fe493[_0x5c8d('0x20')](_0x39c615);}}_0x5828cc({'count':_0x6fe493['length'],'rows':_0x6fe493});});},'ChatQueuesWaitingInteractions':function(_0x538ea3){return new Promise(function(_0x46662a,_0x43cbef){var _0x265215=_[_0x5c8d('0x46')](_0x4fafb6[_0x5c8d('0x51')]);_0x46662a({'count':_0x265215[_0x5c8d('0x19')],'rows':_0x265215});});},'MailQueuesWaitingInteractions':function(_0x186b6f){return new Promise(function(_0x3bf11c,_0x137ea1){var _0x545191=_[_0x5c8d('0x46')](_0x4fafb6['mailQueuesWaitingInteractions']);_0x3bf11c({'count':_0x545191[_0x5c8d('0x19')],'rows':_0x545191});});},'OpenchannelQueuesWaitingInteractions':function(_0x4e3db5){return new Promise(function(_0x44f3fb,_0x1c548c){var _0x2567fd=_[_0x5c8d('0x46')](_0x4fafb6[_0x5c8d('0x52')]);_0x44f3fb({'count':_0x2567fd['length'],'rows':_0x2567fd});});},'SmsQueuesWaitingInteractions':function(_0x3ef90e){return new Promise(function(_0x22e1e8,_0xf62374){var _0x54dee7=_[_0x5c8d('0x46')](_0x4fafb6[_0x5c8d('0x53')]);_0x22e1e8({'count':_0x54dee7[_0x5c8d('0x19')],'rows':_0x54dee7});});},'FaxQueuesWaitingInteractions':function(_0x38c156){return new Promise(function(_0x59a997,_0x2e20fd){var _0x3e938e=_[_0x5c8d('0x46')](_0x4fafb6[_0x5c8d('0x54')]);_0x59a997({'count':_0x3e938e[_0x5c8d('0x19')],'rows':_0x3e938e});});}};var _0x342eb6=jayson['server'](_0x2bdeca)['http']();_0x342eb6['on'](_0x5c8d('0x2f'),function(_0x3c5f72){logger[_0x5c8d('0x2f')](JSON[_0x5c8d('0x32')](_0x3c5f72));return _0x5252e8(_0x3c5f72);});_0x342eb6[_0x5c8d('0x13')](0x232c,_0x5c8d('0x55'),function(){console[_0x5c8d('0x56')](_0x5c8d('0x57'),0x232c);return _0x1deb5a('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index b6e7319..c3c1546 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 _0xc7ec=['\x20|\x20','when','log','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','request','then','error','message','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','format','indexOf','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','join'];(function(_0x3a2798,_0x2e2ec6){var _0x2c5a84=function(_0x5f3e94){while(--_0x5f3e94){_0x3a2798['push'](_0x3a2798['shift']());}};_0x2c5a84(++_0x2e2ec6);}(_0xc7ec,0xff));var _0xcc7e=function(_0x173452,_0x3aa870){_0x173452=_0x173452-0x0;var _0xee3fd0=_0xc7ec[_0x173452];return _0xee3fd0;};'use strict';var util=require('util');var BPromise=require(_0xcc7e('0x0'));var jayson=require(_0xcc7e('0x1'));var _=require(_0xcc7e('0x2'));var logger=require(_0xcc7e('0x3'))(_0xcc7e('0x4'));var client=jayson[_0xcc7e('0x5')][_0xcc7e('0x6')]({'port':0x232a});function request(_0x3bb978,_0x14912f){return new BPromise(function(_0x10efa8,_0x32eb83){return client[_0xcc7e('0x7')](_0x3bb978,_0x14912f)[_0xcc7e('0x8')](function(_0x23a6d4){if(_0x23a6d4[_0xcc7e('0x9')]){return _0x32eb83(_0x23a6d4[_0xcc7e('0x9')][_0xcc7e('0xa')]);}else{return _0x10efa8(_0x23a6d4['result']);}})[_0xcc7e('0xb')](function(_0x91503){return _0x32eb83(_0x91503);});});}exports[_0xcc7e('0xc')]=function(_0x20583a,_0x527492,_0x22c62e){return function(_0x4df5cd){if(_0x22c62e[_0xcc7e('0xd')]&&!_0x22c62e[_0xcc7e('0xd')][_0x20583a]){logger[_0xcc7e('0xe')](_0xcc7e('0xf'),_0x20583a);return _0x4df5cd[_0xcc7e('0x10')]();}var _0x551f83=[];for(var _0x26817c=0x0;_0x26817c<_0x527492[_0xcc7e('0x11')];_0x26817c+=0x1){_0x551f83['push'](request(_0xcc7e('0x12'),{'command':util[_0xcc7e('0x13')]('iftime\x20%s',_0x527492[_0x26817c])})[_0xcc7e('0x8')](function(_0x2b809d){return _0x2b809d&&_0x2b809d[_0xcc7e('0xa')]&&_0x2b809d['message'][_0xcc7e('0x14')]('true')>=0x0?!![]:![];})[_0xcc7e('0xb')](function(_0x25a65a){logger[_0xcc7e('0x9')](_0xcc7e('0x15'),_0x20583a,_0x527492[_0x26817c]);}));}BPromise['all'](_0x551f83)[_0xcc7e('0x8')](function(_0x398a47){var _0x1a2ece=_[_0xcc7e('0x16')](_0x398a47);logger['info'](_0xcc7e('0x17'),_0x20583a,_0x527492[_0xcc7e('0x18')](_0xcc7e('0x19')),_0x1a2ece);_0x4df5cd[_0xcc7e('0x1a')](_0x1a2ece);})['catch'](function(_0x3d6fd9){console[_0xcc7e('0x1b')](_0x3d6fd9);logger[_0xcc7e('0x9')](_0xcc7e('0x17'),_0x20583a,_0x527492['join'](_0xcc7e('0x19')),_0x3d6fd9['stack']);_0x4df5cd[_0xcc7e('0x10')]();});};}; \ No newline at end of file +var _0x02f3=['\x20|\x20','stack','stop','util','jayson/promise','lodash','../../../config/logger','routing','client','request','then','message','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','push','Command','format','iftime\x20%s','indexOf','error','all','some','[%s][INTERVAL]\x20%s\x20%s','when','log','join'];(function(_0x429e0b,_0x50d96f){var _0x34797b=function(_0x573c59){while(--_0x573c59){_0x429e0b['push'](_0x429e0b['shift']());}};_0x34797b(++_0x50d96f);}(_0x02f3,0x1a7));var _0x302f=function(_0x4accb2,_0x34722e){_0x4accb2=_0x4accb2-0x0;var _0x5748f1=_0x02f3[_0x4accb2];return _0x5748f1;};'use strict';var util=require(_0x302f('0x0'));var BPromise=require('bluebird');var jayson=require(_0x302f('0x1'));var _=require(_0x302f('0x2'));var logger=require(_0x302f('0x3'))(_0x302f('0x4'));var client=jayson[_0x302f('0x5')]['http']({'port':0x232a});function request(_0x33047d,_0x330f8a){return new BPromise(function(_0x355957,_0x8645f){return client[_0x302f('0x6')](_0x33047d,_0x330f8a)[_0x302f('0x7')](function(_0x5a5783){if(_0x5a5783['error']){return _0x8645f(_0x5a5783['error'][_0x302f('0x8')]);}else{return _0x355957(_0x5a5783['result']);}})['catch'](function(_0x1efd73){return _0x8645f(_0x1efd73);});});}exports[_0x302f('0x9')]=function(_0xb6e451,_0x1fa190,_0x41d1eb){return function(_0x17db45){if(_0x41d1eb[_0x302f('0xa')]&&!_0x41d1eb[_0x302f('0xa')][_0xb6e451]){logger[_0x302f('0xb')](_0x302f('0xc'),_0xb6e451);return _0x17db45['stop']();}var _0x520119=[];for(var _0x41fb8f=0x0;_0x41fb8f<_0x1fa190['length'];_0x41fb8f+=0x1){_0x520119[_0x302f('0xd')](request(_0x302f('0xe'),{'command':util[_0x302f('0xf')](_0x302f('0x10'),_0x1fa190[_0x41fb8f])})[_0x302f('0x7')](function(_0x3e3f44){return _0x3e3f44&&_0x3e3f44[_0x302f('0x8')]&&_0x3e3f44[_0x302f('0x8')][_0x302f('0x11')]('true')>=0x0?!![]:![];})['catch'](function(_0x4d90e6){logger[_0x302f('0x12')]('[%s][INTERVAL]\x20%s',_0xb6e451,_0x1fa190[_0x41fb8f]);}));}BPromise[_0x302f('0x13')](_0x520119)['then'](function(_0x2fb9ce){var _0x5ac56c=_[_0x302f('0x14')](_0x2fb9ce);logger[_0x302f('0xb')](_0x302f('0x15'),_0xb6e451,_0x1fa190['join']('\x20|\x20'),_0x5ac56c);_0x17db45[_0x302f('0x16')](_0x5ac56c);})['catch'](function(_0x17e782){console[_0x302f('0x17')](_0x17e782);logger['error'](_0x302f('0x15'),_0xb6e451,_0x1fa190[_0x302f('0x18')](_0x302f('0x19')),_0x17e782[_0x302f('0x1a')]);_0x17db45[_0x302f('0x1b')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index fcd71f3..191a1b5 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 _0xc031=['queue','getVoiceQueueByName','then','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalledAt','now','lastevent','called','connectedlinename','error','stack','agentringnoanswer','isNil','reason','rejected','holdtime','ringtime','talktime','queuecallerabandon','forIn','agentringnoanswerAt','agentconnect','agentconnectAt','connect','answeredelsewheredestinationuniqueid','agentcomplete','agentcompleteAt','diffTime','complete','transfereruniqueid','transfertype','blind','transferexten','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','transfereeuniqueid','agententerreason','calleridname','secondtransfererlinkedid','transfer','secondtransfererexten','transfertargetuniqueid','hangup','agent','lodash','./utils','info','format','channel','membername','calleridnum','connectedlinenum'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0xc031,0x78));var _0x1c03=function(_0x3c0dcc,_0x18c419){_0x3c0dcc=_0x3c0dcc-0x0;var _0x1a224c=_0xc031[_0x3c0dcc];return _0x1a224c;};'use strict';var _=require(_0x1c03('0x0'));var util=require('util');var utils=require(_0x1c03('0x1'));var agents={};var transfers={};function writeDB(_0x38a0b1,_0xccd615){utils[_0x1c03('0x2')](util[_0x1c03('0x3')]('AGENT|%s|%s|%s|%s|%s|%s|%s|%s',_0x38a0b1['uniqueid'],_0x38a0b1[_0x1c03('0x4')],_0x38a0b1['queue'],_0x38a0b1[_0x1c03('0x5')],_0x38a0b1['interface'],_0x38a0b1[_0x1c03('0x6')],_0x38a0b1[_0x1c03('0x7')],_0x38a0b1['lastevent']));if(_0x38a0b1[_0x1c03('0x8')]){utils[_0x1c03('0x9')](_0x38a0b1['queue'])[_0x1c03('0xa')](function(_0x407647){if(_0x407647){_0x38a0b1['type']=_0x407647[_0x1c03('0xb')];_0x38a0b1[_0x1c03('0xc')]=_0x38a0b1['agentcomplete']?_0x407647[_0x1c03('0xd')]:![];_0x38a0b1[_0x1c03('0xe')]=_0x38a0b1[_0x1c03('0xc')]?_0x407647[_0x1c03('0xf')]:0x0;}utils[_0x1c03('0x10')](_0x1c03('0x11'),_0x38a0b1);});}else{utils[_0x1c03('0x10')](_0x1c03('0x11'),_0x38a0b1);}if(_0xccd615){delete transfers[_0x38a0b1[_0x1c03('0x12')]];}else{delete agents[_0x38a0b1[_0x1c03('0x13')]];}}exports['agentcalled']=function(_0x1cbc2d){try{agents[_0x1cbc2d['destuniqueid']]=_0x1cbc2d;agents[_0x1cbc2d[_0x1c03('0x13')]][_0x1c03('0x14')]=utils[_0x1c03('0x15')]();agents[_0x1cbc2d[_0x1c03('0x13')]][_0x1c03('0x16')]=_0x1c03('0x17');agents[_0x1cbc2d[_0x1c03('0x13')]]['connectedlinenum']=null;agents[_0x1cbc2d[_0x1c03('0x13')]][_0x1c03('0x18')]=null;}catch(_0x148096){utils[_0x1c03('0x19')](_0x148096[_0x1c03('0x1a')]);}};exports[_0x1c03('0x1b')]=function(_0x32b967){try{if(!_[_0x1c03('0x1c')](agents[_0x32b967[_0x1c03('0x13')]])){agents[_0x32b967[_0x1c03('0x13')]]['agentringnoanswer']=!![];agents[_0x32b967[_0x1c03('0x13')]]['agentringnoanswerAt']=utils['now']();agents[_0x32b967[_0x1c03('0x13')]]['lastevent']='rejected';agents[_0x32b967['destuniqueid']][_0x1c03('0x1d')]=_0x1c03('0x1e');agents[_0x32b967['destuniqueid']][_0x1c03('0x1f')]=_0x32b967[_0x1c03('0x20')]?parseInt(_0x32b967['ringtime'])/0x3e8:0x0;agents[_0x32b967[_0x1c03('0x13')]][_0x1c03('0x21')]=0x0;writeDB(agents[_0x32b967[_0x1c03('0x13')]]);}}catch(_0x45c219){utils['error'](_0x45c219[_0x1c03('0x1a')]);}};exports[_0x1c03('0x22')]=function(_0x59c67a){try{_[_0x1c03('0x23')](agents,function(_0x44576f,_0x2d71ba){if(_0x44576f[_0x1c03('0x12')]==_0x59c67a[_0x1c03('0x12')]){_0x44576f[_0x1c03('0x1b')]=!![];_0x44576f[_0x1c03('0x24')]=utils['now']();_0x44576f[_0x1c03('0x16')]='abandoned';_0x44576f[_0x1c03('0x1d')]='abandoned';_0x44576f[_0x1c03('0x1f')]=_0x59c67a[_0x1c03('0x1f')];_0x44576f[_0x1c03('0x21')]=0x0;writeDB(_0x44576f);}});}catch(_0x252cde){utils[_0x1c03('0x19')](_0x252cde[_0x1c03('0x1a')]);}};exports[_0x1c03('0x25')]=function(_0x13a898){try{if(agents[_0x13a898[_0x1c03('0x13')]]){agents[_0x13a898[_0x1c03('0x13')]][_0x1c03('0x26')]=utils[_0x1c03('0x15')]();agents[_0x13a898[_0x1c03('0x13')]][_0x1c03('0x7')]=_0x13a898[_0x1c03('0x7')];agents[_0x13a898[_0x1c03('0x13')]]['connectedlinename']=_0x13a898[_0x1c03('0x18')];agents[_0x13a898['destuniqueid']][_0x1c03('0x1f')]=_0x13a898[_0x1c03('0x20')];agents[_0x13a898[_0x1c03('0x13')]]['lastevent']=_0x1c03('0x27');_['forIn'](agents,function(_0x4ceadb,_0x4cc15c){if(_0x4ceadb[_0x1c03('0x13')]!=_0x13a898['destuniqueid']&&_0x4ceadb[_0x1c03('0x12')]==_0x13a898[_0x1c03('0x12')]){_0x4ceadb[_0x1c03('0x21')]=0x0;_0x4ceadb[_0x1c03('0x1f')]=_0x13a898[_0x1c03('0x20')];_0x4ceadb['agentringnoanswer']=!![];_0x4ceadb[_0x1c03('0x24')]=utils[_0x1c03('0x15')]();_0x4ceadb['lastevent']='answered_elsewhere';_0x4ceadb['reason']='answered_elsewhere';_0x4ceadb[_0x1c03('0x28')]=_0x13a898[_0x1c03('0x13')];_0x4ceadb['answeredelsewheremembername']=_0x13a898[_0x1c03('0x5')];writeDB(_0x4ceadb);}});}}catch(_0x87b97d){utils[_0x1c03('0x19')](_0x87b97d[_0x1c03('0x1a')]);}};exports['agentcomplete']=function(_0x2464f6){try{if(!_['isNil'](agents[_0x2464f6[_0x1c03('0x13')]])){agents[_0x2464f6[_0x1c03('0x13')]][_0x1c03('0x29')]=!![];agents[_0x2464f6[_0x1c03('0x13')]][_0x1c03('0x2a')]=utils[_0x1c03('0x15')]();agents[_0x2464f6[_0x1c03('0x13')]][_0x1c03('0x21')]=utils[_0x1c03('0x2b')](agents[_0x2464f6['destuniqueid']][_0x1c03('0x2a')],agents[_0x2464f6[_0x1c03('0x13')]][_0x1c03('0x26')]);agents[_0x2464f6[_0x1c03('0x13')]][_0x1c03('0x1d')]=_0x2464f6[_0x1c03('0x1d')];agents[_0x2464f6[_0x1c03('0x13')]][_0x1c03('0x16')]=_0x1c03('0x2c');writeDB(agents[_0x2464f6[_0x1c03('0x13')]]);}}catch(_0x59088b){utils[_0x1c03('0x19')](_0x59088b[_0x1c03('0x1a')]);}};exports['blindtransfer']=function(_0x334732){try{if(!_[_0x1c03('0x1c')](agents[_0x334732[_0x1c03('0x2d')]])){agents[_0x334732[_0x1c03('0x2d')]]['transfer']=!![];agents[_0x334732[_0x1c03('0x2d')]][_0x1c03('0x2e')]=_0x1c03('0x2f');agents[_0x334732[_0x1c03('0x2d')]][_0x1c03('0x30')]=_0x334732['extension'];agents[_0x334732[_0x1c03('0x2d')]][_0x1c03('0x31')]=agents[_0x334732[_0x1c03('0x2d')]][_0x1c03('0x12')];}}catch(_0x2ef84a){utils[_0x1c03('0x19')](_0x2ef84a[_0x1c03('0x1a')]);}};exports[_0x1c03('0x32')]=function(_0x142c54){try{if(_0x142c54[_0x1c03('0x33')]==_0x142c54[_0x1c03('0x34')]){if(!_['isNil'](agents[_0x142c54[_0x1c03('0x35')]])){agents[_0x142c54['secondtransfereruniqueid']]['transfer']=!![];agents[_0x142c54['secondtransfereruniqueid']][_0x1c03('0x2e')]=_0x1c03('0x36');agents[_0x142c54[_0x1c03('0x35')]][_0x1c03('0x30')]=_0x142c54['origtransfererexten'];agents[_0x142c54[_0x1c03('0x35')]]['transferuniqueid']=_0x142c54[_0x1c03('0x33')];}if(_0x142c54['transfereeuniqueid']&&agents[_0x142c54[_0x1c03('0x37')]]){agents[_0x142c54[_0x1c03('0x37')]][_0x1c03('0x38')]=0x1;transfers[_0x142c54[_0x1c03('0x37')]]=_['clone'](agents[_0x142c54[_0x1c03('0x37')]]);transfers[_0x142c54[_0x1c03('0x37')]][_0x1c03('0x6')]=agents[_0x142c54[_0x1c03('0x35')]][_0x1c03('0x6')];transfers[_0x142c54['transfereeuniqueid']][_0x1c03('0x39')]=agents[_0x142c54[_0x1c03('0x35')]][_0x1c03('0x39')];transfers[_0x142c54[_0x1c03('0x37')]][_0x1c03('0x14')]=utils['now']();transfers[_0x142c54[_0x1c03('0x37')]][_0x1c03('0x26')]=utils[_0x1c03('0x15')]();transfers[_0x142c54[_0x1c03('0x37')]][_0x1c03('0x1f')]=0x0;transfers[_0x142c54['transfereeuniqueid']][_0x1c03('0x38')]=0x2;}}else if(_0x142c54[_0x1c03('0x35')]==_0x142c54[_0x1c03('0x3a')]){if(!_['isNil'](agents[_0x142c54[_0x1c03('0x33')]])){agents[_0x142c54[_0x1c03('0x33')]][_0x1c03('0x3b')]=!![];agents[_0x142c54[_0x1c03('0x33')]][_0x1c03('0x2e')]=_0x1c03('0x36');agents[_0x142c54['origtransfereruniqueid']][_0x1c03('0x30')]=_0x142c54[_0x1c03('0x3c')];agents[_0x142c54[_0x1c03('0x33')]][_0x1c03('0x31')]=_0x142c54[_0x1c03('0x35')];}if(_0x142c54[_0x1c03('0x3d')]&&agents[_0x142c54['transfertargetuniqueid']]){agents[_0x142c54['transfertargetuniqueid']][_0x1c03('0x38')]=0x1;transfers[_0x142c54['transfertargetuniqueid']]=_['clone'](agents[_0x142c54[_0x1c03('0x3d')]]);transfers[_0x142c54['transfertargetuniqueid']][_0x1c03('0x6')]=agents[_0x142c54[_0x1c03('0x33')]]['calleridnum'];transfers[_0x142c54[_0x1c03('0x3d')]]['calleridname']=agents[_0x142c54['origtransfereruniqueid']]['calleridname'];transfers[_0x142c54[_0x1c03('0x3d')]]['agentcalledAt']=utils['now']();transfers[_0x142c54['transfertargetuniqueid']][_0x1c03('0x26')]=utils[_0x1c03('0x15')]();transfers[_0x142c54[_0x1c03('0x3d')]]['holdtime']=0x0;transfers[_0x142c54[_0x1c03('0x3d')]][_0x1c03('0x38')]=0x2;}}}catch(_0x487607){utils['error'](_0x487607['stack']);}};exports[_0x1c03('0x3e')]=function(_0x306c51){try{if(transfers[_0x306c51[_0x1c03('0x12')]]){transfers[_0x306c51[_0x1c03('0x12')]]['agentcomplete']=!![];transfers[_0x306c51[_0x1c03('0x12')]][_0x1c03('0x2a')]=utils[_0x1c03('0x15')]();transfers[_0x306c51[_0x1c03('0x12')]]['talktime']=utils[_0x1c03('0x2b')](transfers[_0x306c51[_0x1c03('0x12')]][_0x1c03('0x2a')],transfers[_0x306c51[_0x1c03('0x12')]][_0x1c03('0x26')]);transfers[_0x306c51[_0x1c03('0x12')]]['reason']=_0x1c03('0x3f');transfers[_0x306c51[_0x1c03('0x12')]][_0x1c03('0x16')]=_0x1c03('0x2c');writeDB(transfers[_0x306c51[_0x1c03('0x12')]],!![]);}if(agents[_0x306c51[_0x1c03('0x12')]]&&agents[_0x306c51['uniqueid']][_0x1c03('0x26')]){agents[_0x306c51[_0x1c03('0x12')]][_0x1c03('0x29')]=!![];agents[_0x306c51[_0x1c03('0x12')]][_0x1c03('0x2a')]=utils[_0x1c03('0x15')]();agents[_0x306c51[_0x1c03('0x12')]][_0x1c03('0x21')]=utils['diffTime'](agents[_0x306c51[_0x1c03('0x12')]][_0x1c03('0x2a')],agents[_0x306c51[_0x1c03('0x12')]][_0x1c03('0x26')]);agents[_0x306c51[_0x1c03('0x12')]][_0x1c03('0x1d')]=agents[_0x306c51[_0x1c03('0x12')]][_0x1c03('0x3b')]?_0x1c03('0x3b'):_0x1c03('0x3f');agents[_0x306c51[_0x1c03('0x12')]][_0x1c03('0x16')]=_0x1c03('0x2c');writeDB(agents[_0x306c51[_0x1c03('0x12')]]);}}catch(_0x3ae498){utils[_0x1c03('0x19')](_0x3ae498['stack']);}}; \ No newline at end of file +var _0xb259=['agentconnect','agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','transfer','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','origtransfererexten','transfereeuniqueid','clone','calleridname','agententerreason','transfertype','secondtransfererexten','transfertargetuniqueid','hangup','agent','lodash','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','interface','calleridnum','connectedlinenum','queue','getVoiceQueueByName','type','agentcomplete','acw','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','agentcalledAt','now','lastevent','called','connectedlinename','error','stack','agentringnoanswer','isNil','agentringnoanswerAt','rejected','reason','holdtime','ringtime','talktime','queuecallerabandon','forIn','abandoned'];(function(_0x4c6b93,_0x19880d){var _0x119770=function(_0x2a8cea){while(--_0x2a8cea){_0x4c6b93['push'](_0x4c6b93['shift']());}};_0x119770(++_0x19880d);}(_0xb259,0x1e2));var _0x9b25=function(_0x52ac6b,_0xb00fc8){_0x52ac6b=_0x52ac6b-0x0;var _0x2473af=_0xb259[_0x52ac6b];return _0x2473af;};'use strict';var _=require(_0x9b25('0x0'));var util=require('util');var utils=require('./utils');var agents={};var transfers={};function writeDB(_0x2cd7f4,_0x590d1d){utils[_0x9b25('0x1')](util[_0x9b25('0x2')](_0x9b25('0x3'),_0x2cd7f4[_0x9b25('0x4')],_0x2cd7f4[_0x9b25('0x5')],_0x2cd7f4['queue'],_0x2cd7f4['membername'],_0x2cd7f4[_0x9b25('0x6')],_0x2cd7f4[_0x9b25('0x7')],_0x2cd7f4[_0x9b25('0x8')],_0x2cd7f4['lastevent']));if(_0x2cd7f4[_0x9b25('0x9')]){utils[_0x9b25('0xa')](_0x2cd7f4['queue'])['then'](function(_0x3d59c0){if(_0x3d59c0){_0x2cd7f4['type']=_0x3d59c0[_0x9b25('0xb')];_0x2cd7f4['agentacw']=_0x2cd7f4[_0x9b25('0xc')]?_0x3d59c0[_0x9b25('0xd')]:![];_0x2cd7f4['acwtime']=_0x2cd7f4[_0x9b25('0xe')]?_0x3d59c0[_0x9b25('0xf')]:0x0;}utils[_0x9b25('0x10')](_0x9b25('0x11'),_0x2cd7f4);});}else{utils[_0x9b25('0x10')]('CreateVoiceAgentReport',_0x2cd7f4);}if(_0x590d1d){delete transfers[_0x2cd7f4['uniqueid']];}else{delete agents[_0x2cd7f4[_0x9b25('0x12')]];}}exports[_0x9b25('0x13')]=function(_0x2ed8eb){try{agents[_0x2ed8eb[_0x9b25('0x12')]]=_0x2ed8eb;agents[_0x2ed8eb[_0x9b25('0x12')]][_0x9b25('0x14')]=utils[_0x9b25('0x15')]();agents[_0x2ed8eb[_0x9b25('0x12')]][_0x9b25('0x16')]=_0x9b25('0x17');agents[_0x2ed8eb[_0x9b25('0x12')]]['connectedlinenum']=null;agents[_0x2ed8eb[_0x9b25('0x12')]][_0x9b25('0x18')]=null;}catch(_0x4f9fb1){utils[_0x9b25('0x19')](_0x4f9fb1[_0x9b25('0x1a')]);}};exports[_0x9b25('0x1b')]=function(_0x29d210){try{if(!_[_0x9b25('0x1c')](agents[_0x29d210[_0x9b25('0x12')]])){agents[_0x29d210[_0x9b25('0x12')]]['agentringnoanswer']=!![];agents[_0x29d210[_0x9b25('0x12')]][_0x9b25('0x1d')]=utils['now']();agents[_0x29d210[_0x9b25('0x12')]]['lastevent']=_0x9b25('0x1e');agents[_0x29d210['destuniqueid']][_0x9b25('0x1f')]='rejected';agents[_0x29d210[_0x9b25('0x12')]][_0x9b25('0x20')]=_0x29d210[_0x9b25('0x21')]?parseInt(_0x29d210[_0x9b25('0x21')])/0x3e8:0x0;agents[_0x29d210[_0x9b25('0x12')]][_0x9b25('0x22')]=0x0;writeDB(agents[_0x29d210[_0x9b25('0x12')]]);}}catch(_0x4ddf7b){utils[_0x9b25('0x19')](_0x4ddf7b[_0x9b25('0x1a')]);}};exports[_0x9b25('0x23')]=function(_0x4d0a39){try{_[_0x9b25('0x24')](agents,function(_0x534ecb,_0x29719b){if(_0x534ecb['uniqueid']==_0x4d0a39[_0x9b25('0x4')]){_0x534ecb[_0x9b25('0x1b')]=!![];_0x534ecb[_0x9b25('0x1d')]=utils[_0x9b25('0x15')]();_0x534ecb[_0x9b25('0x16')]='abandoned';_0x534ecb[_0x9b25('0x1f')]=_0x9b25('0x25');_0x534ecb['holdtime']=_0x4d0a39['holdtime'];_0x534ecb[_0x9b25('0x22')]=0x0;writeDB(_0x534ecb);}});}catch(_0x1f4294){utils['error'](_0x1f4294['stack']);}};exports[_0x9b25('0x26')]=function(_0x1b752c){try{if(agents[_0x1b752c['destuniqueid']]){agents[_0x1b752c[_0x9b25('0x12')]][_0x9b25('0x27')]=utils[_0x9b25('0x15')]();agents[_0x1b752c[_0x9b25('0x12')]][_0x9b25('0x8')]=_0x1b752c[_0x9b25('0x8')];agents[_0x1b752c[_0x9b25('0x12')]][_0x9b25('0x18')]=_0x1b752c['connectedlinename'];agents[_0x1b752c[_0x9b25('0x12')]][_0x9b25('0x20')]=_0x1b752c[_0x9b25('0x21')];agents[_0x1b752c[_0x9b25('0x12')]][_0x9b25('0x16')]='connect';_[_0x9b25('0x24')](agents,function(_0x22f9dd,_0x17d813){if(_0x22f9dd[_0x9b25('0x12')]!=_0x1b752c[_0x9b25('0x12')]&&_0x22f9dd[_0x9b25('0x4')]==_0x1b752c[_0x9b25('0x4')]){_0x22f9dd['talktime']=0x0;_0x22f9dd[_0x9b25('0x20')]=_0x1b752c['ringtime'];_0x22f9dd[_0x9b25('0x1b')]=!![];_0x22f9dd[_0x9b25('0x1d')]=utils[_0x9b25('0x15')]();_0x22f9dd[_0x9b25('0x16')]=_0x9b25('0x28');_0x22f9dd[_0x9b25('0x1f')]='answered_elsewhere';_0x22f9dd[_0x9b25('0x29')]=_0x1b752c[_0x9b25('0x12')];_0x22f9dd['answeredelsewheremembername']=_0x1b752c['membername'];writeDB(_0x22f9dd);}});}}catch(_0x55d92b){utils[_0x9b25('0x19')](_0x55d92b[_0x9b25('0x1a')]);}};exports[_0x9b25('0xc')]=function(_0x512460){try{if(!_[_0x9b25('0x1c')](agents[_0x512460[_0x9b25('0x12')]])){agents[_0x512460[_0x9b25('0x12')]]['agentcomplete']=!![];agents[_0x512460[_0x9b25('0x12')]][_0x9b25('0x2a')]=utils['now']();agents[_0x512460[_0x9b25('0x12')]][_0x9b25('0x22')]=utils[_0x9b25('0x2b')](agents[_0x512460[_0x9b25('0x12')]][_0x9b25('0x2a')],agents[_0x512460[_0x9b25('0x12')]][_0x9b25('0x27')]);agents[_0x512460['destuniqueid']][_0x9b25('0x1f')]=_0x512460[_0x9b25('0x1f')];agents[_0x512460['destuniqueid']][_0x9b25('0x16')]=_0x9b25('0x2c');writeDB(agents[_0x512460[_0x9b25('0x12')]]);}}catch(_0xd5ff19){utils['error'](_0xd5ff19[_0x9b25('0x1a')]);}};exports[_0x9b25('0x2d')]=function(_0x4c00b3){try{if(!_['isNil'](agents[_0x4c00b3['transfereruniqueid']])){agents[_0x4c00b3[_0x9b25('0x2e')]][_0x9b25('0x2f')]=!![];agents[_0x4c00b3[_0x9b25('0x2e')]]['transfertype']=_0x9b25('0x30');agents[_0x4c00b3[_0x9b25('0x2e')]][_0x9b25('0x31')]=_0x4c00b3[_0x9b25('0x32')];agents[_0x4c00b3['transfereruniqueid']][_0x9b25('0x33')]=agents[_0x4c00b3[_0x9b25('0x2e')]][_0x9b25('0x4')];}}catch(_0x1b5ce8){utils[_0x9b25('0x19')](_0x1b5ce8[_0x9b25('0x1a')]);}};exports[_0x9b25('0x34')]=function(_0x47c3de){try{if(_0x47c3de[_0x9b25('0x35')]==_0x47c3de['origtransfererlinkedid']){if(!_[_0x9b25('0x1c')](agents[_0x47c3de[_0x9b25('0x36')]])){agents[_0x47c3de[_0x9b25('0x36')]][_0x9b25('0x2f')]=!![];agents[_0x47c3de['secondtransfereruniqueid']]['transfertype']='ATTENDED';agents[_0x47c3de['secondtransfereruniqueid']][_0x9b25('0x31')]=_0x47c3de[_0x9b25('0x37')];agents[_0x47c3de[_0x9b25('0x36')]][_0x9b25('0x33')]=_0x47c3de[_0x9b25('0x35')];}if(_0x47c3de['transfereeuniqueid']&&agents[_0x47c3de[_0x9b25('0x38')]]){agents[_0x47c3de['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x47c3de[_0x9b25('0x38')]]=_[_0x9b25('0x39')](agents[_0x47c3de['transfereeuniqueid']]);transfers[_0x47c3de[_0x9b25('0x38')]]['calleridnum']=agents[_0x47c3de[_0x9b25('0x36')]][_0x9b25('0x7')];transfers[_0x47c3de[_0x9b25('0x38')]]['calleridname']=agents[_0x47c3de[_0x9b25('0x36')]][_0x9b25('0x3a')];transfers[_0x47c3de[_0x9b25('0x38')]][_0x9b25('0x14')]=utils[_0x9b25('0x15')]();transfers[_0x47c3de['transfereeuniqueid']][_0x9b25('0x27')]=utils[_0x9b25('0x15')]();transfers[_0x47c3de[_0x9b25('0x38')]]['holdtime']=0x0;transfers[_0x47c3de[_0x9b25('0x38')]][_0x9b25('0x3b')]=0x2;}}else if(_0x47c3de[_0x9b25('0x36')]==_0x47c3de['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x47c3de['origtransfereruniqueid']])){agents[_0x47c3de[_0x9b25('0x35')]][_0x9b25('0x2f')]=!![];agents[_0x47c3de[_0x9b25('0x35')]][_0x9b25('0x3c')]='ATTENDED';agents[_0x47c3de[_0x9b25('0x35')]][_0x9b25('0x31')]=_0x47c3de[_0x9b25('0x3d')];agents[_0x47c3de[_0x9b25('0x35')]][_0x9b25('0x33')]=_0x47c3de[_0x9b25('0x36')];}if(_0x47c3de[_0x9b25('0x3e')]&&agents[_0x47c3de['transfertargetuniqueid']]){agents[_0x47c3de[_0x9b25('0x3e')]][_0x9b25('0x3b')]=0x1;transfers[_0x47c3de['transfertargetuniqueid']]=_[_0x9b25('0x39')](agents[_0x47c3de[_0x9b25('0x3e')]]);transfers[_0x47c3de['transfertargetuniqueid']]['calleridnum']=agents[_0x47c3de[_0x9b25('0x35')]][_0x9b25('0x7')];transfers[_0x47c3de['transfertargetuniqueid']]['calleridname']=agents[_0x47c3de['origtransfereruniqueid']][_0x9b25('0x3a')];transfers[_0x47c3de[_0x9b25('0x3e')]][_0x9b25('0x14')]=utils[_0x9b25('0x15')]();transfers[_0x47c3de[_0x9b25('0x3e')]][_0x9b25('0x27')]=utils[_0x9b25('0x15')]();transfers[_0x47c3de[_0x9b25('0x3e')]]['holdtime']=0x0;transfers[_0x47c3de[_0x9b25('0x3e')]][_0x9b25('0x3b')]=0x2;}}}catch(_0x1f6ddf){utils[_0x9b25('0x19')](_0x1f6ddf['stack']);}};exports[_0x9b25('0x3f')]=function(_0x290988){try{if(transfers[_0x290988['uniqueid']]){transfers[_0x290988[_0x9b25('0x4')]]['agentcomplete']=!![];transfers[_0x290988[_0x9b25('0x4')]][_0x9b25('0x2a')]=utils[_0x9b25('0x15')]();transfers[_0x290988[_0x9b25('0x4')]][_0x9b25('0x22')]=utils[_0x9b25('0x2b')](transfers[_0x290988['uniqueid']][_0x9b25('0x2a')],transfers[_0x290988[_0x9b25('0x4')]]['agentconnectAt']);transfers[_0x290988['uniqueid']]['reason']=_0x9b25('0x40');transfers[_0x290988['uniqueid']][_0x9b25('0x16')]='complete';writeDB(transfers[_0x290988[_0x9b25('0x4')]],!![]);}if(agents[_0x290988[_0x9b25('0x4')]]&&agents[_0x290988[_0x9b25('0x4')]]['agentconnectAt']){agents[_0x290988[_0x9b25('0x4')]][_0x9b25('0xc')]=!![];agents[_0x290988[_0x9b25('0x4')]][_0x9b25('0x2a')]=utils[_0x9b25('0x15')]();agents[_0x290988[_0x9b25('0x4')]]['talktime']=utils[_0x9b25('0x2b')](agents[_0x290988[_0x9b25('0x4')]][_0x9b25('0x2a')],agents[_0x290988[_0x9b25('0x4')]]['agentconnectAt']);agents[_0x290988[_0x9b25('0x4')]][_0x9b25('0x1f')]=agents[_0x290988[_0x9b25('0x4')]][_0x9b25('0x2f')]?_0x9b25('0x2f'):_0x9b25('0x40');agents[_0x290988['uniqueid']][_0x9b25('0x16')]='complete';writeDB(agents[_0x290988[_0x9b25('0x4')]]);}}catch(_0x27763c){utils[_0x9b25('0x19')](_0x27763c[_0x9b25('0x1a')]);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index b317700..e708500 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 _0xd50a=['destinationchannel','answertime','hangup','calleridname','endtime','diffTime','billableseconds','localtwolinkedid','transfereechannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstartAt','musiconholdstop','mohtime','varset','variable','xmd-phone','destination','value','xmd-callerid-preview','xmd-callerid','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','type','outboundrouteid','sipcallid','newexten','application','toLowerCase','set','startsWith','appdata','cdr','substring','lastIndexOf','noop','execif','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','accountcode','source','callerid','disposition','getUserByInternal','then','UserId','request','CreateVoiceCallReport','OutgoingSpoolFailed','calleridnum','exten','context','now','DOCUMENTATION','error','stack','newstate','isNil','channelstate','linkedid','transfer'];(function(_0x508069,_0xcbe569){var _0x2cff91=function(_0x43000c){while(--_0x43000c){_0x508069['push'](_0x508069['shift']());}};_0x2cff91(++_0xcbe569);}(_0xd50a,0x116));var _0xad50=function(_0x2b6576,_0x5d419c){_0x2b6576=_0x2b6576-0x0;var _0x382b8c=_0xd50a[_0x2b6576];return _0x382b8c;};'use strict';var _=require(_0xad50('0x0'));var util=require(_0xad50('0x1'));var utils=require(_0xad50('0x2'));var dispositions=[_0xad50('0x3'),_0xad50('0x4'),'FAILED',_0xad50('0x3'),_0xad50('0x3'),'NO\x20ANSWER',_0xad50('0x5'),_0xad50('0x6'),_0xad50('0x4'),_0xad50('0x4'),'FAILED'];var channels={};function writeDB(_0x26b95f){utils[_0xad50('0x7')](util[_0xad50('0x8')](_0xad50('0x9'),_0x26b95f[_0xad50('0xa')],_0x26b95f[_0xad50('0xb')],_0x26b95f['type'],_0x26b95f[_0xad50('0xc')],_0x26b95f[_0xad50('0xd')],_0x26b95f['destination'],_0x26b95f[_0xad50('0xe')],_0x26b95f[_0xad50('0xf')]));if(_0x26b95f[_0xad50('0xc')]){utils[_0xad50('0x10')](_0x26b95f[_0xad50('0xc')])[_0xad50('0x11')](function(_0x40cf65){if(_0x40cf65){_0x26b95f[_0xad50('0x12')]=_0x40cf65['id'];}utils[_0xad50('0x13')](_0xad50('0x14'),_0x26b95f);});}else{utils[_0xad50('0x13')](_0xad50('0x14'),_0x26b95f);}if(channels[_0x26b95f['uniqueid']]){delete channels[_0x26b95f['uniqueid']];}}exports['newchannel']=function(_0xbf48e2){try{if(_0xbf48e2['uniqueid']==_0xbf48e2['linkedid']&&_0xbf48e2[_0xad50('0xb')]!=_0xad50('0x15')){channels[_0xbf48e2['uniqueid']]={'uniqueid':_0xbf48e2[_0xad50('0xa')],'accountcode':_0xbf48e2['accountcode'],'source':_0xbf48e2[_0xad50('0x16')],'destination':_0xbf48e2[_0xad50('0x17')],'destinationcontext':_0xbf48e2[_0xad50('0x18')],'channel':_0xbf48e2[_0xad50('0xb')],'starttime':utils[_0xad50('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xad50('0x1a')};}}catch(_0x512a9b){utils[_0xad50('0x1b')](_0x512a9b[_0xad50('0x1c')]);}};exports[_0xad50('0x1d')]=function(_0x2bcfee){try{if(!_[_0xad50('0x1e')](channels[_0x2bcfee[_0xad50('0xa')]])&&_0x2bcfee[_0xad50('0x1f')]==0x6){if(_[_0xad50('0x1e')](channels[_0x2bcfee[_0xad50('0xa')]]['systemanswertime'])){channels[_0x2bcfee[_0xad50('0xa')]]['systemanswertime']=utils[_0xad50('0x19')]();}}else if(!_['isNil'](channels[_0x2bcfee[_0xad50('0x20')]])&&_0x2bcfee[_0xad50('0x1f')]==0x6&&_0x2bcfee[_0xad50('0x18')]!=_0xad50('0x21')){channels[_0x2bcfee[_0xad50('0x20')]][_0xad50('0xc')]=_0x2bcfee[_0xad50('0xc')];channels[_0x2bcfee[_0xad50('0x20')]][_0xad50('0x22')]=_0x2bcfee[_0xad50('0xb')];if(_[_0xad50('0x1e')](channels[_0x2bcfee[_0xad50('0x20')]][_0xad50('0x23')])){channels[_0x2bcfee[_0xad50('0x20')]][_0xad50('0x23')]=utils[_0xad50('0x19')]();}channels[_0x2bcfee[_0xad50('0x20')]][_0xad50('0xf')]=dispositions[_['toNumber'](_0x2bcfee[_0xad50('0x1f')])]||_0xad50('0x5');}}catch(_0x3bcd6c){utils[_0xad50('0x1b')](_0x3bcd6c[_0xad50('0x1c')]);}};exports[_0xad50('0x24')]=function(_0xbd1403){try{if(!_['isNil'](channels[_0xbd1403[_0xad50('0xa')]])){if(_[_0xad50('0x1e')](channels[_0xbd1403[_0xad50('0xa')]][_0xad50('0xe')])){channels[_0xbd1403[_0xad50('0xa')]][_0xad50('0xe')]=_0xbd1403[_0xad50('0x25')]+'\x20<'+_0xbd1403[_0xad50('0x16')]+'>';}channels[_0xbd1403[_0xad50('0xa')]][_0xad50('0x26')]=utils[_0xad50('0x19')]();channels[_0xbd1403[_0xad50('0xa')]]['duration']=utils[_0xad50('0x27')](channels[_0xbd1403[_0xad50('0xa')]][_0xad50('0x26')],channels[_0xbd1403[_0xad50('0xa')]]['starttime']);channels[_0xbd1403[_0xad50('0xa')]][_0xad50('0x28')]=channels[_0xbd1403[_0xad50('0xa')]][_0xad50('0x23')]?utils['diffTime'](channels[_0xbd1403[_0xad50('0xa')]][_0xad50('0x26')],channels[_0xbd1403[_0xad50('0xa')]][_0xad50('0x23')]):0x0;writeDB(channels[_0xbd1403[_0xad50('0xa')]]);}}catch(_0x2962b6){utils['error'](_0x2962b6[_0xad50('0x1c')]);}};exports['attendedtransfer']=function(_0x3fb4aa){try{if(!_[_0xad50('0x1e')](channels[_0x3fb4aa[_0xad50('0x29')]])){if(channels[_0x3fb4aa[_0xad50('0x29')]][_0xad50('0xb')]==_0x3fb4aa[_0xad50('0x2a')]){channels[_0x3fb4aa[_0xad50('0x29')]][_0xad50('0x22')]=_0x3fb4aa['secondtransfererchannel'];channels[_0x3fb4aa[_0xad50('0x29')]][_0xad50('0x2b')]=_0xad50('0x2c');}else if(channels[_0x3fb4aa[_0xad50('0x29')]][_0xad50('0xb')]=_0x3fb4aa[_0xad50('0x2d')]){channels[_0x3fb4aa[_0xad50('0x29')]][_0xad50('0x22')]=_0x3fb4aa[_0xad50('0x2e')];channels[_0x3fb4aa['localtwolinkedid']][_0xad50('0x2b')]=_0xad50('0x2c');}}}catch(_0x6ef2f7){utils[_0xad50('0x1b')](_0x6ef2f7[_0xad50('0x1c')]);}};exports['musiconholdstart']=function(_0x3552d9){try{if(!_[_0xad50('0x1e')](channels[_0x3552d9[_0xad50('0xa')]])){channels[_0x3552d9['uniqueid']][_0xad50('0x2f')]=utils[_0xad50('0x19')]();}}catch(_0xa6f705){utils[_0xad50('0x1b')](_0xa6f705[_0xad50('0x1c')]);}};exports[_0xad50('0x30')]=function(_0x3bdfbf){try{if(!_['isNil'](channels[_0x3bdfbf[_0xad50('0xa')]])){if(!_[_0xad50('0x1e')](channels[_0x3bdfbf[_0xad50('0xa')]][_0xad50('0x2f')])){channels[_0x3bdfbf['uniqueid']][_0xad50('0x31')]+=utils[_0xad50('0x27')](utils[_0xad50('0x19')](),channels[_0x3bdfbf[_0xad50('0xa')]][_0xad50('0x2f')]);delete channels[_0x3bdfbf[_0xad50('0xa')]][_0xad50('0x2f')];}}}catch(_0x1478b4){utils[_0xad50('0x1b')](_0x1478b4[_0xad50('0x1c')]);}};exports[_0xad50('0x32')]=function(_0x20f0d4){try{if(!_[_0xad50('0x1e')](channels[_0x20f0d4['uniqueid']])){if(!_[_0xad50('0x1e')](_0x20f0d4[_0xad50('0x33')]['xmd-originatecalleridnum'])){channels[_0x20f0d4['uniqueid']][_0xad50('0xd')]=_0x20f0d4['value'];}if(!_['isNil'](_0x20f0d4['variable'][_0xad50('0x34')])){channels[_0x20f0d4[_0xad50('0xa')]][_0xad50('0x35')]=_0x20f0d4[_0xad50('0x36')];channels[_0x20f0d4['uniqueid']]['callerid']='\x22'+_0x20f0d4[_0xad50('0x36')]+'\x22\x20<'+_0x20f0d4[_0xad50('0x36')]+'>';}if(!_[_0xad50('0x1e')](_0x20f0d4[_0xad50('0x33')][_0xad50('0x37')])||!_[_0xad50('0x1e')](_0x20f0d4[_0xad50('0x33')][_0xad50('0x38')])){channels[_0x20f0d4[_0xad50('0xa')]][_0xad50('0xe')]=_0x20f0d4[_0xad50('0x36')];}if(!_[_0xad50('0x1e')](_0x20f0d4[_0xad50('0x33')]['xmd-queue'])||!_[_0xad50('0x1e')](_0x20f0d4[_0xad50('0x33')][_0xad50('0x39')])){channels[_0x20f0d4['uniqueid']][_0xad50('0x3a')]=_0xad50('0x3b');channels[_0x20f0d4['uniqueid']][_0xad50('0x3c')]=_0x20f0d4[_0xad50('0x36')];channels[_0x20f0d4[_0xad50('0xa')]]['queue']=!![];}if(!_[_0xad50('0x1e')](_0x20f0d4[_0xad50('0x33')][_0xad50('0x3d')])){channels[_0x20f0d4['uniqueid']][_0xad50('0x3e')]=_0x20f0d4['value'];}if(!_[_0xad50('0x1e')](_0x20f0d4[_0xad50('0x33')][_0xad50('0x3f')])){channels[_0x20f0d4['uniqueid']][_0xad50('0x40')]=_0x20f0d4['value'];}if(!_[_0xad50('0x1e')](_0x20f0d4[_0xad50('0x33')][_0xad50('0x41')])){channels[_0x20f0d4['uniqueid']]['routeid']=_0x20f0d4['value'];}if(!_[_0xad50('0x1e')](_0x20f0d4['variable'][_0xad50('0x42')])){channels[_0x20f0d4[_0xad50('0xa')]]['sipcallid']=_0x20f0d4[_0xad50('0x36')];}}}catch(_0x1d56b5){utils['error'](_0x1d56b5[_0xad50('0x1c')]);}};exports[_0xad50('0x43')]=function(_0x55f595){try{if(!_[_0xad50('0x1e')](channels[_0x55f595['uniqueid']])){if(_0x55f595[_0xad50('0x44')][_0xad50('0x45')]()==_0xad50('0x46')&&_[_0xad50('0x47')](_0x55f595[_0xad50('0x48')]['toLowerCase'](),_0xad50('0x49'))){var _0x45397c=_0x55f595[_0xad50('0x48')]['split']('=');var _0x586da9=_0x45397c[0x0][_0xad50('0x4a')](_0x45397c[0x0][_0xad50('0x4b')]('(')+0x1,_0x45397c[0x0]['lastIndexOf'](')'));var _0x39e4c8=_0x45397c[0x1];channels[_0x55f595[_0xad50('0xa')]][_0x586da9]=_0x39e4c8;}if(!_['includes']([_0xad50('0x24'),_0xad50('0x4c'),_0xad50('0x4d'),'set','gotoif'],_0x55f595['application'][_0xad50('0x45')]())){channels[_0x55f595[_0xad50('0xa')]][_0xad50('0x3a')]=_0x55f595[_0xad50('0x44')];channels[_0x55f595[_0xad50('0xa')]][_0xad50('0x3c')]=_0x55f595[_0xad50('0x48')];}}}catch(_0x320b9e){utils['error'](_0x320b9e[_0xad50('0x1c')]);}}; \ No newline at end of file +var _0x3734=['lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','uniqueid','type','callerid','disposition','accountcode','getUserByInternal','then','UserId','request','newchannel','channel','OutgoingSpoolFailed','calleridnum','exten','now','DOCUMENTATION','stack','newstate','isNil','channelstate','systemanswertime','linkedid','context','destinationchannel','answertime','toNumber','error','hangup','calleridname','diffTime','endtime','starttime','billableseconds','attendedtransfer','localtwolinkedid','transfereechannel','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','musiconholdstartAt','musiconholdstop','variable','xmd-phone','destination','value','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','lastapplication','lastdata','xmd-contactid','ContactId','outboundrouteid','routeid','sipcallid','newexten','application','toLowerCase','startsWith','cdr','appdata','substring','lastIndexOf','includes','noop','execif','set','gotoif'];(function(_0x1bd040,_0x118a9c){var _0x28b618=function(_0x1b7069){while(--_0x1b7069){_0x1bd040['push'](_0x1bd040['shift']());}};_0x28b618(++_0x118a9c);}(_0x3734,0xa0));var _0x4373=function(_0x47574a,_0x2f406c){_0x47574a=_0x47574a-0x0;var _0xb4bd44=_0x3734[_0x47574a];return _0xb4bd44;};'use strict';var _=require(_0x4373('0x0'));var util=require(_0x4373('0x1'));var utils=require(_0x4373('0x2'));var dispositions=[_0x4373('0x3'),'FAILED',_0x4373('0x4'),_0x4373('0x3'),_0x4373('0x3'),_0x4373('0x3'),_0x4373('0x5'),_0x4373('0x6'),_0x4373('0x4'),_0x4373('0x4'),_0x4373('0x4')];var channels={};function writeDB(_0x3eda17){utils[_0x4373('0x7')](util['format']('CALL|%s|%s|%s|%s|%s|%s|%s|%s',_0x3eda17[_0x4373('0x8')],_0x3eda17['channel'],_0x3eda17[_0x4373('0x9')],_0x3eda17['accountcode'],_0x3eda17['source'],_0x3eda17['destination'],_0x3eda17[_0x4373('0xa')],_0x3eda17[_0x4373('0xb')]));if(_0x3eda17[_0x4373('0xc')]){utils[_0x4373('0xd')](_0x3eda17[_0x4373('0xc')])[_0x4373('0xe')](function(_0x2d3bf0){if(_0x2d3bf0){_0x3eda17[_0x4373('0xf')]=_0x2d3bf0['id'];}utils[_0x4373('0x10')]('CreateVoiceCallReport',_0x3eda17);});}else{utils['request']('CreateVoiceCallReport',_0x3eda17);}if(channels[_0x3eda17[_0x4373('0x8')]]){delete channels[_0x3eda17[_0x4373('0x8')]];}}exports[_0x4373('0x11')]=function(_0x14837d){try{if(_0x14837d['uniqueid']==_0x14837d['linkedid']&&_0x14837d[_0x4373('0x12')]!=_0x4373('0x13')){channels[_0x14837d[_0x4373('0x8')]]={'uniqueid':_0x14837d[_0x4373('0x8')],'accountcode':_0x14837d[_0x4373('0xc')],'source':_0x14837d[_0x4373('0x14')],'destination':_0x14837d[_0x4373('0x15')],'destinationcontext':_0x14837d['context'],'channel':_0x14837d[_0x4373('0x12')],'starttime':utils[_0x4373('0x16')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x4373('0x3'),'amaflags':_0x4373('0x17')};}}catch(_0x3dfbb6){utils['error'](_0x3dfbb6[_0x4373('0x18')]);}};exports[_0x4373('0x19')]=function(_0x2bbaa5){try{if(!_[_0x4373('0x1a')](channels[_0x2bbaa5[_0x4373('0x8')]])&&_0x2bbaa5[_0x4373('0x1b')]==0x6){if(_[_0x4373('0x1a')](channels[_0x2bbaa5[_0x4373('0x8')]][_0x4373('0x1c')])){channels[_0x2bbaa5[_0x4373('0x8')]][_0x4373('0x1c')]=utils[_0x4373('0x16')]();}}else if(!_[_0x4373('0x1a')](channels[_0x2bbaa5[_0x4373('0x1d')]])&&_0x2bbaa5[_0x4373('0x1b')]==0x6&&_0x2bbaa5[_0x4373('0x1e')]!='transfer'){channels[_0x2bbaa5['linkedid']][_0x4373('0xc')]=_0x2bbaa5[_0x4373('0xc')];channels[_0x2bbaa5[_0x4373('0x1d')]][_0x4373('0x1f')]=_0x2bbaa5['channel'];if(_['isNil'](channels[_0x2bbaa5['linkedid']][_0x4373('0x20')])){channels[_0x2bbaa5[_0x4373('0x1d')]][_0x4373('0x20')]=utils[_0x4373('0x16')]();}channels[_0x2bbaa5['linkedid']][_0x4373('0xb')]=dispositions[_[_0x4373('0x21')](_0x2bbaa5[_0x4373('0x1b')])]||_0x4373('0x5');}}catch(_0x43122e){utils[_0x4373('0x22')](_0x43122e[_0x4373('0x18')]);}};exports[_0x4373('0x23')]=function(_0x51f311){try{if(!_[_0x4373('0x1a')](channels[_0x51f311[_0x4373('0x8')]])){if(_['isNil'](channels[_0x51f311[_0x4373('0x8')]][_0x4373('0xa')])){channels[_0x51f311[_0x4373('0x8')]][_0x4373('0xa')]=_0x51f311[_0x4373('0x24')]+'\x20<'+_0x51f311['calleridnum']+'>';}channels[_0x51f311[_0x4373('0x8')]]['endtime']=utils[_0x4373('0x16')]();channels[_0x51f311[_0x4373('0x8')]]['duration']=utils[_0x4373('0x25')](channels[_0x51f311['uniqueid']][_0x4373('0x26')],channels[_0x51f311[_0x4373('0x8')]][_0x4373('0x27')]);channels[_0x51f311[_0x4373('0x8')]][_0x4373('0x28')]=channels[_0x51f311[_0x4373('0x8')]][_0x4373('0x20')]?utils[_0x4373('0x25')](channels[_0x51f311[_0x4373('0x8')]][_0x4373('0x26')],channels[_0x51f311[_0x4373('0x8')]][_0x4373('0x20')]):0x0;writeDB(channels[_0x51f311[_0x4373('0x8')]]);}}catch(_0x1811e2){utils['error'](_0x1811e2['stack']);}};exports[_0x4373('0x29')]=function(_0x4cb3ee){try{if(!_[_0x4373('0x1a')](channels[_0x4cb3ee[_0x4373('0x2a')]])){if(channels[_0x4cb3ee[_0x4373('0x2a')]][_0x4373('0x12')]==_0x4cb3ee[_0x4373('0x2b')]){channels[_0x4cb3ee['localtwolinkedid']][_0x4373('0x1f')]=_0x4cb3ee[_0x4373('0x2c')];channels[_0x4cb3ee[_0x4373('0x2a')]][_0x4373('0x2d')]='_attended';}else if(channels[_0x4cb3ee[_0x4373('0x2a')]][_0x4373('0x12')]=_0x4cb3ee[_0x4373('0x2e')]){channels[_0x4cb3ee[_0x4373('0x2a')]][_0x4373('0x1f')]=_0x4cb3ee[_0x4373('0x2f')];channels[_0x4cb3ee[_0x4373('0x2a')]][_0x4373('0x2d')]=_0x4373('0x30');}}}catch(_0xdc1c0d){utils[_0x4373('0x22')](_0xdc1c0d[_0x4373('0x18')]);}};exports[_0x4373('0x31')]=function(_0x1d922e){try{if(!_[_0x4373('0x1a')](channels[_0x1d922e[_0x4373('0x8')]])){channels[_0x1d922e[_0x4373('0x8')]][_0x4373('0x32')]=utils[_0x4373('0x16')]();}}catch(_0x2b1c12){utils[_0x4373('0x22')](_0x2b1c12[_0x4373('0x18')]);}};exports[_0x4373('0x33')]=function(_0x56683f){try{if(!_['isNil'](channels[_0x56683f[_0x4373('0x8')]])){if(!_['isNil'](channels[_0x56683f[_0x4373('0x8')]][_0x4373('0x32')])){channels[_0x56683f['uniqueid']]['mohtime']+=utils[_0x4373('0x25')](utils[_0x4373('0x16')](),channels[_0x56683f[_0x4373('0x8')]][_0x4373('0x32')]);delete channels[_0x56683f['uniqueid']][_0x4373('0x32')];}}}catch(_0x33d6fc){utils[_0x4373('0x22')](_0x33d6fc[_0x4373('0x18')]);}};exports['varset']=function(_0x59f592){try{if(!_[_0x4373('0x1a')](channels[_0x59f592[_0x4373('0x8')]])){if(!_[_0x4373('0x1a')](_0x59f592[_0x4373('0x34')]['xmd-originatecalleridnum'])){channels[_0x59f592[_0x4373('0x8')]]['source']=_0x59f592['value'];}if(!_['isNil'](_0x59f592[_0x4373('0x34')][_0x4373('0x35')])){channels[_0x59f592['uniqueid']][_0x4373('0x36')]=_0x59f592['value'];channels[_0x59f592[_0x4373('0x8')]][_0x4373('0xa')]='\x22'+_0x59f592[_0x4373('0x37')]+_0x4373('0x38')+_0x59f592[_0x4373('0x37')]+'>';}if(!_[_0x4373('0x1a')](_0x59f592[_0x4373('0x34')][_0x4373('0x39')])||!_[_0x4373('0x1a')](_0x59f592['variable'][_0x4373('0x3a')])){channels[_0x59f592[_0x4373('0x8')]][_0x4373('0xa')]=_0x59f592[_0x4373('0x37')];}if(!_[_0x4373('0x1a')](_0x59f592['variable'][_0x4373('0x3b')])||!_[_0x4373('0x1a')](_0x59f592['variable']['xmcs-queue'])){channels[_0x59f592[_0x4373('0x8')]][_0x4373('0x3c')]='Queue';channels[_0x59f592[_0x4373('0x8')]][_0x4373('0x3d')]=_0x59f592[_0x4373('0x37')];channels[_0x59f592['uniqueid']]['queue']=!![];}if(!_[_0x4373('0x1a')](_0x59f592['variable'][_0x4373('0x3e')])){channels[_0x59f592['uniqueid']][_0x4373('0x3f')]=_0x59f592[_0x4373('0x37')];}if(!_[_0x4373('0x1a')](_0x59f592[_0x4373('0x34')]['xmd-cdrtype'])){channels[_0x59f592[_0x4373('0x8')]][_0x4373('0x9')]=_0x59f592['value'];}if(!_[_0x4373('0x1a')](_0x59f592[_0x4373('0x34')][_0x4373('0x40')])){channels[_0x59f592[_0x4373('0x8')]][_0x4373('0x41')]=_0x59f592[_0x4373('0x37')];}if(!_[_0x4373('0x1a')](_0x59f592[_0x4373('0x34')][_0x4373('0x42')])){channels[_0x59f592[_0x4373('0x8')]][_0x4373('0x42')]=_0x59f592['value'];}}}catch(_0x429529){utils[_0x4373('0x22')](_0x429529[_0x4373('0x18')]);}};exports[_0x4373('0x43')]=function(_0x2efe45){try{if(!_[_0x4373('0x1a')](channels[_0x2efe45['uniqueid']])){if(_0x2efe45[_0x4373('0x44')][_0x4373('0x45')]()=='set'&&_[_0x4373('0x46')](_0x2efe45['appdata'][_0x4373('0x45')](),_0x4373('0x47'))){var _0x50e57e=_0x2efe45[_0x4373('0x48')]['split']('=');var _0x27b1b0=_0x50e57e[0x0][_0x4373('0x49')](_0x50e57e[0x0]['lastIndexOf']('(')+0x1,_0x50e57e[0x0][_0x4373('0x4a')](')'));var _0x26c7cc=_0x50e57e[0x1];channels[_0x2efe45[_0x4373('0x8')]][_0x27b1b0]=_0x26c7cc;}if(!_[_0x4373('0x4b')]([_0x4373('0x23'),_0x4373('0x4c'),_0x4373('0x4d'),_0x4373('0x4e'),_0x4373('0x4f')],_0x2efe45['application']['toLowerCase']())){channels[_0x2efe45[_0x4373('0x8')]][_0x4373('0x3c')]=_0x2efe45[_0x4373('0x44')];channels[_0x2efe45[_0x4373('0x8')]][_0x4373('0x3d')]=_0x2efe45[_0x4373('0x48')];}}}catch(_0x106176){utils[_0x4373('0x22')](_0x106176[_0x4373('0x18')]);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 1deafe7..3a3b995 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 _0x008c=['CONNECTED','SHUTDOWN','fullybooted','FULLYBOOTED','error','close','CLOSE','./utils','lodash','connect','info'];(function(_0x525eec,_0xb0a748){var _0x31f7e2=function(_0x48a9b1){while(--_0x48a9b1){_0x525eec['push'](_0x525eec['shift']());}};_0x31f7e2(++_0xb0a748);}(_0x008c,0x188));var _0xc008=function(_0x224ad9,_0x5d97a7){_0x224ad9=_0x224ad9-0x0;var _0x532997=_0x008c[_0x224ad9];return _0x532997;};'use strict';var utils=require(_0xc008('0x0'));var _=require(_0xc008('0x1'));exports[_0xc008('0x2')]=function(){utils[_0xc008('0x3')](_0xc008('0x4'));};exports['shutdown']=function(){utils[_0xc008('0x3')](_0xc008('0x5'));};exports[_0xc008('0x6')]=function(){utils[_0xc008('0x3')](_0xc008('0x7'));};exports[_0xc008('0x8')]=function(_0x13aa7){utils[_0xc008('0x8')](_0x13aa7);};exports[_0xc008('0x9')]=function(){utils['info'](_0xc008('0xa'));};exports['managerevent']=function(_0x30be38){}; \ No newline at end of file +var _0xc949=['./utils','connect','info','CONNECTED','shutdown','SHUTDOWN','fullybooted','FULLYBOOTED','error','CLOSE','managerevent'];(function(_0x5d3d39,_0x5ed8a1){var _0x2de363=function(_0x450907){while(--_0x450907){_0x5d3d39['push'](_0x5d3d39['shift']());}};_0x2de363(++_0x5ed8a1);}(_0xc949,0x181));var _0x9c94=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xc949[_0xa6cc5c];return _0x44803d;};'use strict';var utils=require(_0x9c94('0x0'));var _=require('lodash');exports[_0x9c94('0x1')]=function(){utils[_0x9c94('0x2')](_0x9c94('0x3'));};exports[_0x9c94('0x4')]=function(){utils['info'](_0x9c94('0x5'));};exports[_0x9c94('0x6')]=function(){utils['info'](_0x9c94('0x7'));};exports[_0x9c94('0x8')]=function(_0x46d560){utils[_0x9c94('0x8')](_0x46d560);};exports['close']=function(){utils[_0x9c94('0x2')](_0x9c94('0x9'));};exports[_0x9c94('0xa')]=function(_0x43aa51){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index ad6b4bd..fcd6899 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 _0xf906=['duration','diffTime','holdtime','endtime','billableseconds','util','./utils','info','format','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel','dialstring','connectedlinenum','dialstatus','request','CreateVoiceDialReport','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','error','stack','isNil','variable','value','dialbegin','assign','starttime','now','called','dialend','ANSWER','answertime','connect','hangup','complete'];(function(_0x43d1da,_0x1e67ff){var _0x516d86=function(_0x3a9e41){while(--_0x3a9e41){_0x43d1da['push'](_0x43d1da['shift']());}};_0x516d86(++_0x1e67ff);}(_0xf906,0x1b2));var _0x6f90=function(_0x17bb7d,_0x51d8b2){_0x17bb7d=_0x17bb7d-0x0;var _0x1585f0=_0xf906[_0x17bb7d];return _0x1585f0;};'use strict';var _=require('lodash');var util=require(_0x6f90('0x0'));var utils=require(_0x6f90('0x1'));var dials={};function writeDB(_0x265fa5){utils[_0x6f90('0x2')](util[_0x6f90('0x3')](_0x6f90('0x4'),_0x265fa5[_0x6f90('0x5')],_0x265fa5[_0x6f90('0x6')],_0x265fa5[_0x6f90('0x7')],_0x265fa5['calleridnum'],_0x265fa5[_0x6f90('0x8')],_0x265fa5[_0x6f90('0x9')]));utils[_0x6f90('0xa')](_0x6f90('0xb'),_0x265fa5);delete dials[_0x265fa5[_0x6f90('0x5')]];}exports['newexten']=function(_0x39c36b){try{if(_0x39c36b[_0x6f90('0xc')][_0x6f90('0xd')]()==_0x6f90('0xe')&&_[_0x6f90('0xf')](_0x39c36b[_0x6f90('0x10')][_0x6f90('0xd')](),_0x6f90('0x11'))){var _0x344cbc=_0x39c36b[_0x6f90('0x10')]['split']('=');dials[_0x39c36b[_0x6f90('0x5')]]={'routeId':_0x344cbc[0x1]};}}catch(_0x21d6bd){utils[_0x6f90('0x12')](_0x21d6bd[_0x6f90('0x13')]);}};exports['varset']=function(_0x28fb8a){try{if(!_[_0x6f90('0x14')](_0x28fb8a[_0x6f90('0x15')]['outboundrouteid'])){dials[_0x28fb8a[_0x6f90('0x5')]]={'routeId':_0x28fb8a[_0x6f90('0x16')]};}}catch(_0x10091b){utils[_0x6f90('0x12')](_0x10091b[_0x6f90('0x13')]);}};exports[_0x6f90('0x17')]=function(_0x3dfb03){try{if(!_['isNil'](dials[_0x3dfb03[_0x6f90('0x5')]])){dials[_0x3dfb03[_0x6f90('0x5')]]=_[_0x6f90('0x18')](dials[_0x3dfb03[_0x6f90('0x5')]],_0x3dfb03);dials[_0x3dfb03['uniqueid']][_0x6f90('0x19')]=utils[_0x6f90('0x1a')]();dials[_0x3dfb03['uniqueid']]['lastevent']=_0x6f90('0x1b');}}catch(_0x1fe7c6){utils[_0x6f90('0x12')](_0x1fe7c6[_0x6f90('0x13')]);}};exports[_0x6f90('0x1c')]=function(_0x250379){try{if(!_[_0x6f90('0x14')](dials[_0x250379[_0x6f90('0x5')]])){dials[_0x250379['uniqueid']][_0x6f90('0x9')]=_0x250379[_0x6f90('0x9')];if(_0x250379[_0x6f90('0x9')]==_0x6f90('0x1d')){dials[_0x250379[_0x6f90('0x5')]]=_['assign'](dials[_0x250379[_0x6f90('0x5')]],_0x250379);dials[_0x250379[_0x6f90('0x5')]][_0x6f90('0x1e')]=utils[_0x6f90('0x1a')]();dials[_0x250379[_0x6f90('0x5')]]['lastevent']=_0x6f90('0x1f');}}}catch(_0x3b2922){utils[_0x6f90('0x12')](_0x3b2922['stack']);}};exports[_0x6f90('0x20')]=function(_0x293699){try{if(!_[_0x6f90('0x14')](dials[_0x293699[_0x6f90('0x5')]])){dials[_0x293699['uniqueid']]=_[_0x6f90('0x18')](dials[_0x293699['uniqueid']],{'endtime':utils[_0x6f90('0x1a')](),'lastevent':_0x6f90('0x21')});dials[_0x293699[_0x6f90('0x5')]][_0x6f90('0x22')]=utils[_0x6f90('0x23')](dials[_0x293699[_0x6f90('0x5')]]['endtime'],dials[_0x293699[_0x6f90('0x5')]][_0x6f90('0x19')]);dials[_0x293699['uniqueid']][_0x6f90('0x24')]=utils['diffTime'](dials[_0x293699[_0x6f90('0x5')]][_0x6f90('0x1e')]||dials[_0x293699[_0x6f90('0x5')]][_0x6f90('0x25')],dials[_0x293699['uniqueid']][_0x6f90('0x19')]);dials[_0x293699[_0x6f90('0x5')]][_0x6f90('0x26')]=dials[_0x293699[_0x6f90('0x5')]][_0x6f90('0x1e')]?utils[_0x6f90('0x23')](dials[_0x293699[_0x6f90('0x5')]][_0x6f90('0x25')],dials[_0x293699[_0x6f90('0x5')]][_0x6f90('0x1e')]):0x0;writeDB(dials[_0x293699['uniqueid']]);}}catch(_0x58d584){utils['error'](_0x58d584[_0x6f90('0x13')]);}}; \ No newline at end of file +var _0x3e03=['lastevent','called','dialend','ANSWER','connect','hangup','complete','duration','diffTime','endtime','holdtime','answertime','lodash','util','./utils','info','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','newexten','application','toLowerCase','set','appdata','cdr(routeid)','split','error','stack','varset','isNil','value','dialbegin','assign','now'];(function(_0x4b9682,_0x3c44fc){var _0x4d6a7f=function(_0xf2f4a3){while(--_0xf2f4a3){_0x4b9682['push'](_0x4b9682['shift']());}};_0x4d6a7f(++_0x3c44fc);}(_0x3e03,0x16b));var _0x33e0=function(_0x241424,_0x25eb5d){_0x241424=_0x241424-0x0;var _0x3da798=_0x3e03[_0x241424];return _0x3da798;};'use strict';var _=require(_0x33e0('0x0'));var util=require(_0x33e0('0x1'));var utils=require(_0x33e0('0x2'));var dials={};function writeDB(_0x1f04fc){utils[_0x33e0('0x3')](util['format'](_0x33e0('0x4'),_0x1f04fc[_0x33e0('0x5')],_0x1f04fc[_0x33e0('0x6')],_0x1f04fc[_0x33e0('0x7')],_0x1f04fc[_0x33e0('0x8')],_0x1f04fc[_0x33e0('0x9')],_0x1f04fc[_0x33e0('0xa')]));utils[_0x33e0('0xb')]('CreateVoiceDialReport',_0x1f04fc);delete dials[_0x1f04fc[_0x33e0('0x5')]];}exports[_0x33e0('0xc')]=function(_0x583dd5){try{if(_0x583dd5[_0x33e0('0xd')][_0x33e0('0xe')]()==_0x33e0('0xf')&&_['startsWith'](_0x583dd5[_0x33e0('0x10')][_0x33e0('0xe')](),_0x33e0('0x11'))){var _0x1e3d03=_0x583dd5[_0x33e0('0x10')][_0x33e0('0x12')]('=');dials[_0x583dd5[_0x33e0('0x5')]]={'routeId':_0x1e3d03[0x1]};}}catch(_0x167f3c){utils[_0x33e0('0x13')](_0x167f3c[_0x33e0('0x14')]);}};exports[_0x33e0('0x15')]=function(_0x57b567){try{if(!_[_0x33e0('0x16')](_0x57b567['variable']['outboundrouteid'])){dials[_0x57b567[_0x33e0('0x5')]]={'routeId':_0x57b567[_0x33e0('0x17')]};}}catch(_0x4ad2b2){utils['error'](_0x4ad2b2[_0x33e0('0x14')]);}};exports[_0x33e0('0x18')]=function(_0x72047){try{if(!_[_0x33e0('0x16')](dials[_0x72047[_0x33e0('0x5')]])){dials[_0x72047['uniqueid']]=_[_0x33e0('0x19')](dials[_0x72047[_0x33e0('0x5')]],_0x72047);dials[_0x72047[_0x33e0('0x5')]]['starttime']=utils[_0x33e0('0x1a')]();dials[_0x72047[_0x33e0('0x5')]][_0x33e0('0x1b')]=_0x33e0('0x1c');}}catch(_0x4dc585){utils[_0x33e0('0x13')](_0x4dc585['stack']);}};exports[_0x33e0('0x1d')]=function(_0x42a908){try{if(!_[_0x33e0('0x16')](dials[_0x42a908[_0x33e0('0x5')]])){dials[_0x42a908[_0x33e0('0x5')]]['dialstatus']=_0x42a908[_0x33e0('0xa')];if(_0x42a908[_0x33e0('0xa')]==_0x33e0('0x1e')){dials[_0x42a908[_0x33e0('0x5')]]=_['assign'](dials[_0x42a908[_0x33e0('0x5')]],_0x42a908);dials[_0x42a908[_0x33e0('0x5')]]['answertime']=utils['now']();dials[_0x42a908[_0x33e0('0x5')]][_0x33e0('0x1b')]=_0x33e0('0x1f');}}}catch(_0x588cc2){utils['error'](_0x588cc2['stack']);}};exports[_0x33e0('0x20')]=function(_0x55a108){try{if(!_[_0x33e0('0x16')](dials[_0x55a108[_0x33e0('0x5')]])){dials[_0x55a108[_0x33e0('0x5')]]=_[_0x33e0('0x19')](dials[_0x55a108['uniqueid']],{'endtime':utils[_0x33e0('0x1a')](),'lastevent':_0x33e0('0x21')});dials[_0x55a108[_0x33e0('0x5')]][_0x33e0('0x22')]=utils[_0x33e0('0x23')](dials[_0x55a108[_0x33e0('0x5')]][_0x33e0('0x24')],dials[_0x55a108[_0x33e0('0x5')]]['starttime']);dials[_0x55a108[_0x33e0('0x5')]][_0x33e0('0x25')]=utils[_0x33e0('0x23')](dials[_0x55a108[_0x33e0('0x5')]]['answertime']||dials[_0x55a108[_0x33e0('0x5')]]['endtime'],dials[_0x55a108[_0x33e0('0x5')]]['starttime']);dials[_0x55a108[_0x33e0('0x5')]]['billableseconds']=dials[_0x55a108[_0x33e0('0x5')]][_0x33e0('0x26')]?utils[_0x33e0('0x23')](dials[_0x55a108[_0x33e0('0x5')]]['endtime'],dials[_0x55a108[_0x33e0('0x5')]][_0x33e0('0x26')]):0x0;writeDB(dials[_0x55a108['uniqueid']]);}}catch(_0x24ebbd){utils[_0x33e0('0x13')](_0x24ebbd['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 3c18d24..3156ffe 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 _0xdf98=['./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','../../config/environment','./utils','port','asterisk','password','xdr','disabled','XDR\x20DISABLED'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xdf98,0x1b0));var _0x8df9=function(_0x3ac6a3,_0x3dc212){_0x3ac6a3=_0x3ac6a3-0x0;var _0x16951c=_0xdf98[_0x3ac6a3];return _0x16951c;};var AsteriskManager=require('asterisk-manager');var config=require(_0x8df9('0x0'));var utils=require(_0x8df9('0x1'));var ami=new AsteriskManager(config['asterisk'][_0x8df9('0x2')],config['asterisk']['ip'],config[_0x8df9('0x3')]['username'],config[_0x8df9('0x3')][_0x8df9('0x4')],!![]);ami['keepConnected']();if(config['xdr']&&config[_0x8df9('0x5')][_0x8df9('0x6')]){utils['info'](_0x8df9('0x7'));}else{var agents=require(_0x8df9('0x8'));var calls=require(_0x8df9('0x9'));var queues=require('./queues.controller');var recordings=require(_0x8df9('0xa'));var members=require(_0x8df9('0xb'));var dials=require(_0x8df9('0xc'));var transfers=require(_0x8df9('0xd'));var core=require(_0x8df9('0xe'));ami['on'](_0x8df9('0xf'),core[_0x8df9('0xf')]);ami['on'](_0x8df9('0x10'),core[_0x8df9('0x10')]);ami['on'](_0x8df9('0x11'),core[_0x8df9('0x11')]);ami['on'](_0x8df9('0x12'),core[_0x8df9('0x12')]);ami['on'](_0x8df9('0x13'),core['close']);ami['on']('managerevent',core['managerevent']);ami['on'](_0x8df9('0x14'),function(_0x47a802){try{members['devicestatechange'](_0x47a802);}catch(_0x1a88fe){utils[_0x8df9('0x12')](_0x1a88fe);}});ami['on'](_0x8df9('0x15'),function(_0x38277f){try{agents[_0x8df9('0x15')](_0x38277f);}catch(_0x5842d6){utils['error'](_0x5842d6);}});ami['on']('agentringnoanswer',function(_0x530765){try{agents[_0x8df9('0x16')](_0x530765);}catch(_0xc9d281){utils['error'](_0xc9d281);}});ami['on']('agentconnect',function(_0x4c8625){try{agents[_0x8df9('0x17')](_0x4c8625);queues[_0x8df9('0x17')](_0x4c8625);}catch(_0x453682){utils[_0x8df9('0x12')](_0x453682);}});ami['on'](_0x8df9('0x18'),function(_0xb77828){try{agents['agentcomplete'](_0xb77828);queues[_0x8df9('0x18')](_0xb77828);members[_0x8df9('0x18')](_0xb77828);}catch(_0x273761){utils[_0x8df9('0x12')](_0x273761);}});ami['on']('queuecallerabandon',function(_0x16e306){try{agents['queuecallerabandon'](_0x16e306);queues[_0x8df9('0x19')](_0x16e306);}catch(_0x24ebc2){utils[_0x8df9('0x12')](_0x24ebc2);}});ami['on'](_0x8df9('0x1a'),function(_0x12a202){try{queues[_0x8df9('0x1a')](_0x12a202);recordings[_0x8df9('0x1a')](_0x12a202);}catch(_0x366763){utils[_0x8df9('0x12')](_0x366763);}});ami['on'](_0x8df9('0x1b'),function(_0x408ac4){try{queues['queuecallerleave'](_0x408ac4);}catch(_0x359b88){utils[_0x8df9('0x12')](_0x359b88);}});ami['on'](_0x8df9('0x1c'),function(_0x61dec8){try{queues[_0x8df9('0x1c')](_0x61dec8);calls[_0x8df9('0x1c')](_0x61dec8);}catch(_0x3caa8f){utils[_0x8df9('0x12')](_0x3caa8f);}});ami['on'](_0x8df9('0x1d'),function(_0x2e5a3b){try{queues[_0x8df9('0x1d')](_0x2e5a3b);calls[_0x8df9('0x1d')](_0x2e5a3b);}catch(_0x254b6f){utils['error'](_0x254b6f);}});ami['on'](_0x8df9('0x1e'),function(_0x4b8ece){try{calls['newstate'](_0x4b8ece);recordings[_0x8df9('0x1e')](_0x4b8ece);}catch(_0x35a923){utils['error'](_0x35a923);}});ami['on'](_0x8df9('0x1f'),function(_0x3e888f){try{calls[_0x8df9('0x1f')](_0x3e888f);recordings[_0x8df9('0x1f')](_0x3e888f);dials[_0x8df9('0x1f')](_0x3e888f);agents[_0x8df9('0x1f')](_0x3e888f);queues['hangup'](_0x3e888f);}catch(_0x2d8d13){utils[_0x8df9('0x12')](_0x2d8d13);}});ami['on']('cdr',function(_0x1017f1){try{members[_0x8df9('0x20')](_0x1017f1);}catch(_0x15990d){utils[_0x8df9('0x12')](_0x15990d);}});ami['on'](_0x8df9('0x21'),function(_0x29f400){try{queues['blindtransfer'](_0x29f400);agents[_0x8df9('0x21')](_0x29f400);transfers['blindtransfer'](_0x29f400);}catch(_0x1c6645){utils[_0x8df9('0x12')](_0x1c6645);}});ami['on'](_0x8df9('0x22'),function(_0x5705c1){try{queues[_0x8df9('0x22')](_0x5705c1);transfers[_0x8df9('0x22')](_0x5705c1);agents[_0x8df9('0x22')](_0x5705c1);calls['attendedtransfer'](_0x5705c1);}catch(_0x1475e4){utils[_0x8df9('0x12')](_0x1475e4);}});ami['on']('varset',function(_0x467df5){try{queues[_0x8df9('0x23')](_0x467df5);recordings['varset'](_0x467df5);calls[_0x8df9('0x23')](_0x467df5);dials[_0x8df9('0x23')](_0x467df5);}catch(_0x279f44){utils[_0x8df9('0x12')](_0x279f44);}});ami['on']('newexten',function(_0x13d7aa){try{calls[_0x8df9('0x24')](_0x13d7aa);recordings['newexten'](_0x13d7aa);dials[_0x8df9('0x24')](_0x13d7aa);}catch(_0x4f4c94){utils[_0x8df9('0x12')](_0x4f4c94);}});ami['on']('newchannel',function(_0xa6db7b){try{calls[_0x8df9('0x25')](_0xa6db7b);recordings[_0x8df9('0x25')](_0xa6db7b);}catch(_0x401c9b){utils[_0x8df9('0x12')](_0x401c9b);}});ami['on'](_0x8df9('0x26'),function(_0x603f7d){try{dials[_0x8df9('0x26')](_0x603f7d);}catch(_0x77dda5){utils[_0x8df9('0x12')](_0x77dda5);}});ami['on'](_0x8df9('0x27'),function(_0x55d7e4){try{dials[_0x8df9('0x27')](_0x55d7e4);}catch(_0x4c8d7f){utils['error'](_0x4c8d7f);}});} \ No newline at end of file +var _0x8c5e=['newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','./utils','asterisk','port','username','xdr','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','connect','shutdown','fullybooted','error','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c5e,0x169));var _0xe8c5=function(_0x2610ea,_0x3c294d){_0x2610ea=_0x2610ea-0x0;var _0x3fb9b0=_0x8c5e[_0x2610ea];return _0x3fb9b0;};var AsteriskManager=require(_0xe8c5('0x0'));var config=require(_0xe8c5('0x1'));var utils=require(_0xe8c5('0x2'));var ami=new AsteriskManager(config[_0xe8c5('0x3')][_0xe8c5('0x4')],config[_0xe8c5('0x3')]['ip'],config['asterisk'][_0xe8c5('0x5')],config['asterisk']['password'],!![]);ami['keepConnected']();if(config[_0xe8c5('0x6')]&&config[_0xe8c5('0x6')]['disabled']){utils['info'](_0xe8c5('0x7'));}else{var agents=require(_0xe8c5('0x8'));var calls=require(_0xe8c5('0x9'));var queues=require(_0xe8c5('0xa'));var recordings=require(_0xe8c5('0xb'));var members=require(_0xe8c5('0xc'));var dials=require(_0xe8c5('0xd'));var transfers=require('./transfers.controller');var core=require('./core.controller');ami['on'](_0xe8c5('0xe'),core[_0xe8c5('0xe')]);ami['on'](_0xe8c5('0xf'),core[_0xe8c5('0xf')]);ami['on'](_0xe8c5('0x10'),core[_0xe8c5('0x10')]);ami['on'](_0xe8c5('0x11'),core['error']);ami['on']('close',core['close']);ami['on'](_0xe8c5('0x12'),core[_0xe8c5('0x12')]);ami['on'](_0xe8c5('0x13'),function(_0x413877){try{members['devicestatechange'](_0x413877);}catch(_0x105196){utils[_0xe8c5('0x11')](_0x105196);}});ami['on']('agentcalled',function(_0x531cca){try{agents[_0xe8c5('0x14')](_0x531cca);}catch(_0x152ab8){utils[_0xe8c5('0x11')](_0x152ab8);}});ami['on'](_0xe8c5('0x15'),function(_0x1dedc3){try{agents[_0xe8c5('0x15')](_0x1dedc3);}catch(_0x2ca414){utils[_0xe8c5('0x11')](_0x2ca414);}});ami['on']('agentconnect',function(_0x2d14a5){try{agents[_0xe8c5('0x16')](_0x2d14a5);queues['agentconnect'](_0x2d14a5);}catch(_0x135b83){utils['error'](_0x135b83);}});ami['on'](_0xe8c5('0x17'),function(_0x15869d){try{agents[_0xe8c5('0x17')](_0x15869d);queues[_0xe8c5('0x17')](_0x15869d);members['agentcomplete'](_0x15869d);}catch(_0x2e1e77){utils['error'](_0x2e1e77);}});ami['on'](_0xe8c5('0x18'),function(_0x5d9884){try{agents[_0xe8c5('0x18')](_0x5d9884);queues[_0xe8c5('0x18')](_0x5d9884);}catch(_0x31edcb){utils[_0xe8c5('0x11')](_0x31edcb);}});ami['on'](_0xe8c5('0x19'),function(_0x3c08a2){try{queues['queuecallerjoin'](_0x3c08a2);recordings[_0xe8c5('0x19')](_0x3c08a2);}catch(_0x3658c9){utils['error'](_0x3658c9);}});ami['on'](_0xe8c5('0x1a'),function(_0x2a3773){try{queues[_0xe8c5('0x1a')](_0x2a3773);}catch(_0x2da289){utils[_0xe8c5('0x11')](_0x2da289);}});ami['on'](_0xe8c5('0x1b'),function(_0xd73e13){try{queues[_0xe8c5('0x1b')](_0xd73e13);calls[_0xe8c5('0x1b')](_0xd73e13);}catch(_0x558613){utils['error'](_0x558613);}});ami['on'](_0xe8c5('0x1c'),function(_0x272c8f){try{queues[_0xe8c5('0x1c')](_0x272c8f);calls[_0xe8c5('0x1c')](_0x272c8f);}catch(_0x3ab012){utils[_0xe8c5('0x11')](_0x3ab012);}});ami['on'](_0xe8c5('0x1d'),function(_0x29f454){try{calls['newstate'](_0x29f454);recordings[_0xe8c5('0x1d')](_0x29f454);}catch(_0x227c2e){utils[_0xe8c5('0x11')](_0x227c2e);}});ami['on'](_0xe8c5('0x1e'),function(_0x3bb2cb){try{calls[_0xe8c5('0x1e')](_0x3bb2cb);recordings[_0xe8c5('0x1e')](_0x3bb2cb);dials[_0xe8c5('0x1e')](_0x3bb2cb);agents[_0xe8c5('0x1e')](_0x3bb2cb);queues[_0xe8c5('0x1e')](_0x3bb2cb);}catch(_0x5a8062){utils[_0xe8c5('0x11')](_0x5a8062);}});ami['on']('cdr',function(_0x4fc5ad){try{members[_0xe8c5('0x1f')](_0x4fc5ad);}catch(_0x7df012){utils[_0xe8c5('0x11')](_0x7df012);}});ami['on'](_0xe8c5('0x20'),function(_0x34a953){try{queues[_0xe8c5('0x20')](_0x34a953);agents[_0xe8c5('0x20')](_0x34a953);transfers['blindtransfer'](_0x34a953);}catch(_0x5de8dc){utils[_0xe8c5('0x11')](_0x5de8dc);}});ami['on'](_0xe8c5('0x21'),function(_0x45aea0){try{queues[_0xe8c5('0x21')](_0x45aea0);transfers[_0xe8c5('0x21')](_0x45aea0);agents[_0xe8c5('0x21')](_0x45aea0);calls[_0xe8c5('0x21')](_0x45aea0);}catch(_0x13f07c){utils['error'](_0x13f07c);}});ami['on']('varset',function(_0x5b79ff){try{queues[_0xe8c5('0x22')](_0x5b79ff);recordings[_0xe8c5('0x22')](_0x5b79ff);calls[_0xe8c5('0x22')](_0x5b79ff);dials[_0xe8c5('0x22')](_0x5b79ff);}catch(_0x2a07ed){utils[_0xe8c5('0x11')](_0x2a07ed);}});ami['on'](_0xe8c5('0x23'),function(_0x265312){try{calls[_0xe8c5('0x23')](_0x265312);recordings[_0xe8c5('0x23')](_0x265312);dials[_0xe8c5('0x23')](_0x265312);}catch(_0x158a03){utils[_0xe8c5('0x11')](_0x158a03);}});ami['on']('newchannel',function(_0x423e47){try{calls['newchannel'](_0x423e47);recordings[_0xe8c5('0x24')](_0x423e47);}catch(_0x416ccc){utils[_0xe8c5('0x11')](_0x416ccc);}});ami['on'](_0xe8c5('0x25'),function(_0x52f486){try{dials[_0xe8c5('0x25')](_0x52f486);}catch(_0x178a98){utils['error'](_0x178a98);}});ami['on'](_0xe8c5('0x26'),function(_0x5a8e4a){try{dials[_0xe8c5('0x26')](_0x5a8e4a);}catch(_0x16520d){utils[_0xe8c5('0x11')](_0x16520d);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index c5eb943..d26b33d 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 _0xa6e9=['diffTime','enterAt','agentcomplete','isNil','assign','queue','cdr','type','source','destinationchannel','data1','data3','destination','lodash','./utils','info','format','uniqueid','interface','channel','data2','membername','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','some','startsWith','devicestatechange','state','INUSE','device','voice','TALKING','now','agent','NOT_INUSE','exitAt','duration'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xa6e9,0xc1));var _0x9a6e=function(_0x1771e7,_0x3d762a){_0x1771e7=_0x1771e7-0x0;var _0xef0370=_0xa6e9[_0x1771e7];return _0xef0370;};'use strict';var _=require(_0x9a6e('0x0'));var util=require('util');var utils=require(_0x9a6e('0x1'));var members={};var exclude=['Local/_attended@transfer','Queue:'];function writeDB(_0x44bb8b){utils[_0x9a6e('0x2')](util[_0x9a6e('0x3')]('MEMBER|%s|%s|%s|%s|%s|%s',_0x44bb8b[_0x9a6e('0x4')],_0x44bb8b[_0x9a6e('0x5')],_0x44bb8b[_0x9a6e('0x6')],_0x44bb8b[_0x9a6e('0x7')],_0x44bb8b[_0x9a6e('0x8')],_0x44bb8b['type']));if(_0x44bb8b[_0x9a6e('0x5')]){utils[_0x9a6e('0x9')](_0x44bb8b[_0x9a6e('0x5')])[_0x9a6e('0xa')](function(_0x2be34f){if(_0x2be34f){_0x44bb8b[_0x9a6e('0x8')]=_0x2be34f[_0x9a6e('0xb')];_0x44bb8b[_0x9a6e('0xc')]=_0x2be34f[_0x9a6e('0xc')];utils[_0x9a6e('0xd')](_0x9a6e('0xe'),_0x44bb8b);}else{utils[_0x9a6e('0xf')](_0x44bb8b[_0x9a6e('0x5')][_0x9a6e('0x10')]('/')[0x1])[_0x9a6e('0xa')](function(_0x33a812){if(_0x33a812){_0x44bb8b[_0x9a6e('0x8')]=_0x33a812[_0x9a6e('0xb')];_0x44bb8b[_0x9a6e('0xc')]=_0x33a812[_0x9a6e('0xc')];utils[_0x9a6e('0xd')](_0x9a6e('0xe'),_0x44bb8b);}});}})[_0x9a6e('0x11')](function(_0x5d4653){utils[_0x9a6e('0x12')](_0x5d4653);});}delete members[_0x44bb8b[_0x9a6e('0x5')]];}function startsWith(_0x4584cb,_0x544a2d){return _[_0x9a6e('0x13')](_0x4584cb,function(_0x20a5ba){return _[_0x9a6e('0x14')](_0x544a2d,_0x20a5ba);});}exports[_0x9a6e('0x15')]=function(_0x443288){switch(_0x443288[_0x9a6e('0x16')]){case _0x9a6e('0x17'):case'BUSY':if(!startsWith(exclude,_0x443288[_0x9a6e('0x18')])){members[_0x443288['device']]={'channel':_0x9a6e('0x19'),'interface':_0x443288[_0x9a6e('0x18')],'type':_0x9a6e('0x1a'),'enterAt':utils[_0x9a6e('0x1b')](),'role':_0x9a6e('0x1c')};}break;case _0x9a6e('0x1d'):if(!_['isNil'](members[_0x443288[_0x9a6e('0x18')]])){members[_0x443288[_0x9a6e('0x18')]][_0x9a6e('0x1e')]=utils['now']();members[_0x443288[_0x9a6e('0x18')]][_0x9a6e('0x1f')]=utils[_0x9a6e('0x20')](members[_0x443288[_0x9a6e('0x18')]][_0x9a6e('0x1e')],members[_0x443288['device']][_0x9a6e('0x21')]);if(members[_0x443288['device']][_0x9a6e('0x4')]){writeDB(members[_0x443288[_0x9a6e('0x18')]]);}}default:break;}};exports[_0x9a6e('0x22')]=function(_0x2af8fa){if(!_[_0x9a6e('0x23')](members[_0x2af8fa['interface']])){members[_0x2af8fa[_0x9a6e('0x5')]]=_[_0x9a6e('0x24')](members[_0x2af8fa['interface']],{'data4':_0x2af8fa[_0x9a6e('0x25')],'uniqueid':_0x2af8fa[_0x9a6e('0x4')]});}};exports[_0x9a6e('0x26')]=function(_0x262df6){if(_0x262df6['channel']){var _0x2f10e7=_0x262df6['channel']['split']('-')[0x0];if(!_['isNil'](members[_0x2f10e7])){members[_0x2f10e7]=_[_0x9a6e('0x24')](members[_0x2f10e7],{'data1':members[_0x2f10e7]['data1']||_0x262df6[_0x9a6e('0x27')],'data2':members[_0x2f10e7][_0x9a6e('0x7')]||_0x262df6[_0x9a6e('0x28')],'data3':members[_0x2f10e7]['data3']||_0x262df6['destination'],'uniqueid':members[_0x2f10e7][_0x9a6e('0x4')]||_0x262df6[_0x9a6e('0x4')]});if(members[_0x2f10e7][_0x9a6e('0x1e')]){writeDB(members[_0x2f10e7]);}}}if(_0x262df6[_0x9a6e('0x29')]){var _0x52397f=_0x262df6[_0x9a6e('0x29')]['split']('-')[0x0];if(!_[_0x9a6e('0x23')](members[_0x52397f])){members[_0x52397f]=_['assign'](members[_0x52397f],{'data1':members[_0x52397f][_0x9a6e('0x2a')]||_0x262df6[_0x9a6e('0x27')],'data2':members[_0x52397f][_0x9a6e('0x7')]||_0x262df6['source'],'data3':members[_0x52397f][_0x9a6e('0x2b')]||_0x262df6[_0x9a6e('0x2c')],'uniqueid':members[_0x52397f]['uniqueid']||_0x262df6['uniqueid']});if(members[_0x52397f]['exitAt']){writeDB(members[_0x52397f]);}}}}; \ No newline at end of file +var _0x13be=['request','CreateMemberReport','getUserByName','split','then','error','some','devicestatechange','INUSE','BUSY','device','voice','TALKING','now','NOT_INUSE','isNil','exitAt','enterAt','agentcomplete','queue','cdr','assign','type','data2','source','data3','destination','destinationchannel','data1','util','Queue:','info','format','uniqueid','interface','channel','membername','getUserByInterface','name','internal'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x13be,0x15d));var _0xe13b=function(_0x42855f,_0x3c26c1){_0x42855f=_0x42855f-0x0;var _0x38511b=_0x13be[_0x42855f];return _0x38511b;};'use strict';var _=require('lodash');var util=require(_0xe13b('0x0'));var utils=require('./utils');var members={};var exclude=['Local/_attended@transfer',_0xe13b('0x1')];function writeDB(_0x441354){utils[_0xe13b('0x2')](util[_0xe13b('0x3')]('MEMBER|%s|%s|%s|%s|%s|%s',_0x441354[_0xe13b('0x4')],_0x441354[_0xe13b('0x5')],_0x441354[_0xe13b('0x6')],_0x441354['data2'],_0x441354[_0xe13b('0x7')],_0x441354['type']));if(_0x441354[_0xe13b('0x5')]){utils[_0xe13b('0x8')](_0x441354[_0xe13b('0x5')])['then'](function(_0x49f6d8){if(_0x49f6d8){_0x441354['membername']=_0x49f6d8[_0xe13b('0x9')];_0x441354[_0xe13b('0xa')]=_0x49f6d8[_0xe13b('0xa')];utils[_0xe13b('0xb')](_0xe13b('0xc'),_0x441354);}else{utils[_0xe13b('0xd')](_0x441354[_0xe13b('0x5')][_0xe13b('0xe')]('/')[0x1])[_0xe13b('0xf')](function(_0x249b89){if(_0x249b89){_0x441354['membername']=_0x249b89['name'];_0x441354['internal']=_0x249b89[_0xe13b('0xa')];utils[_0xe13b('0xb')](_0xe13b('0xc'),_0x441354);}});}})['catch'](function(_0xd0d33b){utils[_0xe13b('0x10')](_0xd0d33b);});}delete members[_0x441354['interface']];}function startsWith(_0x13d4d1,_0x4af004){return _[_0xe13b('0x11')](_0x13d4d1,function(_0x16a2ef){return _['startsWith'](_0x4af004,_0x16a2ef);});}exports[_0xe13b('0x12')]=function(_0x2ed7e2){switch(_0x2ed7e2['state']){case _0xe13b('0x13'):case _0xe13b('0x14'):if(!startsWith(exclude,_0x2ed7e2['device'])){members[_0x2ed7e2[_0xe13b('0x15')]]={'channel':_0xe13b('0x16'),'interface':_0x2ed7e2['device'],'type':_0xe13b('0x17'),'enterAt':utils[_0xe13b('0x18')](),'role':'agent'};}break;case _0xe13b('0x19'):if(!_[_0xe13b('0x1a')](members[_0x2ed7e2['device']])){members[_0x2ed7e2[_0xe13b('0x15')]][_0xe13b('0x1b')]=utils[_0xe13b('0x18')]();members[_0x2ed7e2[_0xe13b('0x15')]]['duration']=utils['diffTime'](members[_0x2ed7e2[_0xe13b('0x15')]]['exitAt'],members[_0x2ed7e2['device']][_0xe13b('0x1c')]);if(members[_0x2ed7e2[_0xe13b('0x15')]][_0xe13b('0x4')]){writeDB(members[_0x2ed7e2[_0xe13b('0x15')]]);}}default:break;}};exports[_0xe13b('0x1d')]=function(_0x52a805){if(!_[_0xe13b('0x1a')](members[_0x52a805[_0xe13b('0x5')]])){members[_0x52a805[_0xe13b('0x5')]]=_['assign'](members[_0x52a805[_0xe13b('0x5')]],{'data4':_0x52a805[_0xe13b('0x1e')],'uniqueid':_0x52a805[_0xe13b('0x4')]});}};exports[_0xe13b('0x1f')]=function(_0x17b6cf){if(_0x17b6cf['channel']){var _0xbf25ba=_0x17b6cf[_0xe13b('0x6')][_0xe13b('0xe')]('-')[0x0];if(!_[_0xe13b('0x1a')](members[_0xbf25ba])){members[_0xbf25ba]=_[_0xe13b('0x20')](members[_0xbf25ba],{'data1':members[_0xbf25ba]['data1']||_0x17b6cf[_0xe13b('0x21')],'data2':members[_0xbf25ba][_0xe13b('0x22')]||_0x17b6cf[_0xe13b('0x23')],'data3':members[_0xbf25ba][_0xe13b('0x24')]||_0x17b6cf[_0xe13b('0x25')],'uniqueid':members[_0xbf25ba][_0xe13b('0x4')]||_0x17b6cf[_0xe13b('0x4')]});if(members[_0xbf25ba]['exitAt']){writeDB(members[_0xbf25ba]);}}}if(_0x17b6cf[_0xe13b('0x26')]){var _0x372575=_0x17b6cf['destinationchannel']['split']('-')[0x0];if(!_['isNil'](members[_0x372575])){members[_0x372575]=_['assign'](members[_0x372575],{'data1':members[_0x372575][_0xe13b('0x27')]||_0x17b6cf[_0xe13b('0x21')],'data2':members[_0x372575]['data2']||_0x17b6cf[_0xe13b('0x23')],'data3':members[_0x372575][_0xe13b('0x24')]||_0x17b6cf[_0xe13b('0x25')],'uniqueid':members[_0x372575][_0xe13b('0x4')]||_0x17b6cf[_0xe13b('0x4')]});if(members[_0x372575][_0xe13b('0x1b')]){writeDB(members[_0x372575]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index cffe035..d9d3059 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 _0x0d01=['transferuniqueid','BLINDTRANSFER','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','transfereelinkedid','clone','calleridname','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','transfertargetlinkedid','transfertargetuniqueid','holdtime','stack','musiconholdstartAt','musiconholdstop','mohtime','lodash','util','./utils','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','assign','position','now','hangup','isNil','queuecallerenterreason','varset','variable','queuestatus','queuecallerabandon','queuecallerexit','queueposition','queuecallerabandonAt','queuecallerexitAt','queuecallerleave','diffTime','queuecallerleaveAt','queuecallerjoinAt','count','connectedlinenum','connectedlinename','destaccountcode','membername','agentcomplete','assigned','queuecallercomplete','queuecallercompleteAt','TRANSFER','reason','toUpperCase','transfereeuniqueid','transfer','transfertype','BLIND','transferexten','extension'];(function(_0x1a69b9,_0x5167e9){var _0x197e16=function(_0x37d443){while(--_0x37d443){_0x1a69b9['push'](_0x1a69b9['shift']());}};_0x197e16(++_0x5167e9);}(_0x0d01,0x1d0));var _0x10d0=function(_0x3b9095,_0x4afbd0){_0x3b9095=_0x3b9095-0x0;var _0x2b54f5=_0x0d01[_0x3b9095];return _0x2b54f5;};'use strict';var _=require(_0x10d0('0x0'));var util=require(_0x10d0('0x1'));var utils=require(_0x10d0('0x2'));var queues={};function writeDB(_0x31d295){utils['info'](util[_0x10d0('0x3')](_0x10d0('0x4'),_0x31d295[_0x10d0('0x5')],_0x31d295[_0x10d0('0x6')],_0x31d295[_0x10d0('0x7')],_0x31d295[_0x10d0('0x8')],_0x31d295[_0x10d0('0x9')],_0x31d295[_0x10d0('0xa')],_0x31d295[_0x10d0('0xb')]));if(_0x31d295[_0x10d0('0x7')]){utils[_0x10d0('0xc')](_0x31d295[_0x10d0('0x7')])[_0x10d0('0xd')](function(_0x28d757){if(_0x28d757){_0x31d295[_0x10d0('0xe')]=_0x28d757[_0x10d0('0xe')];}utils[_0x10d0('0xf')](_0x10d0('0x10'),_0x31d295);});}else{utils[_0x10d0('0xf')]('CreateVoiceQueueReport',_0x31d295);}if(_0x31d295[_0x10d0('0x11')]){delete queues[_0x31d295[_0x10d0('0x11')]];}else{delete queues[_0x31d295['uniqueid']];}}exports['queuecallerjoin']=function(_0x588592){queues[_0x588592[_0x10d0('0x5')]]=_[_0x10d0('0x12')](_0x588592,{'originalposition':_0x588592[_0x10d0('0x13')],'queuecallerjoinAt':utils[_0x10d0('0x14')](),'mohtime':0x0});};exports[_0x10d0('0x15')]=function(_0x195a6f){if(!_[_0x10d0('0x16')](queues[_0x195a6f[_0x10d0('0x5')]])){if(queues[_0x195a6f[_0x10d0('0x5')]]['queuecallerleaveAt']){if(!queues[_0x195a6f[_0x10d0('0x5')]]['queuecallerabandon']&&!queues[_0x195a6f[_0x10d0('0x5')]]['queuecallerexit']){queues[_0x195a6f[_0x10d0('0x5')]]['queuecallercomplete']=!![];queues[_0x195a6f[_0x10d0('0x5')]]['queuecallercompleteAt']=utils[_0x10d0('0x14')]();queues[_0x195a6f['uniqueid']][_0x10d0('0xb')]='COMPLETEDBYAGENT';}writeDB(queues[_0x195a6f[_0x10d0('0x5')]]);}else{if(queues[_0x195a6f[_0x10d0('0x5')]]['transfereduniqueid']){queues[queues[_0x195a6f[_0x10d0('0x5')]][_0x10d0('0x11')]]=queues[_0x195a6f[_0x10d0('0x5')]];queues[queues[_0x195a6f['uniqueid']][_0x10d0('0x11')]][_0x10d0('0x17')]=0x2;delete queues[_0x195a6f[_0x10d0('0x5')]];}}}};exports[_0x10d0('0x18')]=function(_0x2841c2){if(!_['isNil'](_0x2841c2[_0x10d0('0x19')][_0x10d0('0x1a')])){if(!_[_0x10d0('0x16')](queues[_0x2841c2[_0x10d0('0x5')]])){queues[_0x2841c2[_0x10d0('0x5')]][_0x10d0('0x1b')]=![];queues[_0x2841c2[_0x10d0('0x5')]]['queuecallerabandonAt']=null;queues[_0x2841c2[_0x10d0('0x5')]][_0x10d0('0x1c')]=!![];queues[_0x2841c2[_0x10d0('0x5')]]['queuecallerexitAt']=utils[_0x10d0('0x14')]();queues[_0x2841c2[_0x10d0('0x5')]][_0x10d0('0xb')]=_0x2841c2['value']['toUpperCase']();writeDB(queues[_0x2841c2[_0x10d0('0x5')]]);}}else if(!_[_0x10d0('0x16')](_0x2841c2[_0x10d0('0x19')][_0x10d0('0x1d')])){if(!_['isNil'](queues[_0x2841c2[_0x10d0('0x5')]])&&!queues[_0x2841c2[_0x10d0('0x5')]][_0x10d0('0x1b')]){queues[_0x2841c2['uniqueid']][_0x10d0('0x1b')]=![];queues[_0x2841c2[_0x10d0('0x5')]][_0x10d0('0x1e')]=null;queues[_0x2841c2['uniqueid']][_0x10d0('0x1c')]=!![];queues[_0x2841c2[_0x10d0('0x5')]][_0x10d0('0x1f')]=utils['now']();queues[_0x2841c2['uniqueid']][_0x10d0('0xb')]='EXITWITHKEY';}}};exports[_0x10d0('0x1b')]=function(_0x108e02){if(!_[_0x10d0('0x16')](queues[_0x108e02[_0x10d0('0x5')]])){queues[_0x108e02[_0x10d0('0x5')]][_0x10d0('0x1c')]=![];queues[_0x108e02[_0x10d0('0x5')]][_0x10d0('0x1f')]=null;queues[_0x108e02[_0x10d0('0x5')]][_0x10d0('0x1b')]=!![];queues[_0x108e02['uniqueid']][_0x10d0('0x1e')]=utils[_0x10d0('0x14')]();queues[_0x108e02[_0x10d0('0x5')]][_0x10d0('0xb')]='ABANDONED';}};exports[_0x10d0('0x20')]=function(_0x314e8){if(!_[_0x10d0('0x16')](queues[_0x314e8['uniqueid']])){queues[_0x314e8[_0x10d0('0x5')]][_0x10d0('0x20')]=!![];queues[_0x314e8[_0x10d0('0x5')]]['queuecallerleaveAt']=utils[_0x10d0('0x14')]();queues[_0x314e8[_0x10d0('0x5')]]['holdtime']=utils[_0x10d0('0x21')](queues[_0x314e8['uniqueid']][_0x10d0('0x22')],queues[_0x314e8['uniqueid']][_0x10d0('0x23')]);queues[_0x314e8['uniqueid']][_0x10d0('0x13')]=_0x314e8[_0x10d0('0x13')];queues[_0x314e8[_0x10d0('0x5')]][_0x10d0('0x24')]=_0x314e8[_0x10d0('0x24')];queues[_0x314e8[_0x10d0('0x5')]][_0x10d0('0x25')]=_0x314e8['connectedlinenum'];queues[_0x314e8[_0x10d0('0x5')]][_0x10d0('0x26')]=_0x314e8[_0x10d0('0x26')];}};exports['agentconnect']=function(_0x153909){if(!_[_0x10d0('0x16')](queues[_0x153909['uniqueid']])){queues[_0x153909[_0x10d0('0x5')]]['queuecallerabandon']=![];queues[_0x153909[_0x10d0('0x5')]][_0x10d0('0x1b')]=![];queues[_0x153909['uniqueid']][_0x10d0('0x1e')]=null;queues[_0x153909['uniqueid']][_0x10d0('0x1c')]=![];queues[_0x153909[_0x10d0('0x5')]]['queuecallerexitAt']=null;queues[_0x153909[_0x10d0('0x5')]]['assigned']=!![];queues[_0x153909['uniqueid']]['accountcode']=_0x153909[_0x10d0('0x27')];queues[_0x153909[_0x10d0('0x5')]][_0x10d0('0x8')]=_0x153909[_0x10d0('0x28')];}};exports[_0x10d0('0x29')]=function(_0x440ef){if(!_[_0x10d0('0x16')](queues[_0x440ef['uniqueid']])){if(queues[_0x440ef[_0x10d0('0x5')]][_0x10d0('0x22')]){queues[_0x440ef[_0x10d0('0x5')]][_0x10d0('0x1b')]=![];queues[_0x440ef[_0x10d0('0x5')]][_0x10d0('0x1b')]=![];queues[_0x440ef[_0x10d0('0x5')]][_0x10d0('0x1e')]=null;queues[_0x440ef[_0x10d0('0x5')]][_0x10d0('0x1c')]=![];queues[_0x440ef[_0x10d0('0x5')]][_0x10d0('0x1f')]=null;queues[_0x440ef[_0x10d0('0x5')]][_0x10d0('0x2a')]=!![];queues[_0x440ef[_0x10d0('0x5')]][_0x10d0('0x8')]=_0x440ef[_0x10d0('0x28')];queues[_0x440ef['uniqueid']][_0x10d0('0x2b')]=!![];queues[_0x440ef[_0x10d0('0x5')]][_0x10d0('0x2c')]=utils['now']();if(_0x440ef['reason']=='transfer'){if(!queues[_0x440ef[_0x10d0('0x5')]]['transfer']){queues[_0x440ef['uniqueid']][_0x10d0('0xb')]=_0x10d0('0x2d');}}else{queues[_0x440ef[_0x10d0('0x5')]][_0x10d0('0xb')]='COMPLETEDBY'+_0x440ef[_0x10d0('0x2e')][_0x10d0('0x2f')]();}writeDB(queues[_0x440ef[_0x10d0('0x5')]]);}}};exports['blindtransfer']=function(_0x1f50c6){if(!_[_0x10d0('0x16')](queues[_0x1f50c6[_0x10d0('0x30')]])){queues[_0x1f50c6[_0x10d0('0x30')]][_0x10d0('0x31')]=!![];queues[_0x1f50c6[_0x10d0('0x30')]][_0x10d0('0x32')]=_0x10d0('0x33');queues[_0x1f50c6[_0x10d0('0x30')]][_0x10d0('0x34')]=_0x1f50c6[_0x10d0('0x35')];queues[_0x1f50c6['transfereeuniqueid']][_0x10d0('0x36')]=_0x1f50c6[_0x10d0('0x30')];queues[_0x1f50c6['transfereeuniqueid']]['queuecallerexitreason']=_0x10d0('0x37');}};exports['attendedtransfer']=function(_0x31d157){try{if(_0x31d157[_0x10d0('0x38')]==_0x31d157[_0x10d0('0x39')]){if(!_[_0x10d0('0x16')](queues[_0x31d157[_0x10d0('0x3a')]])){queues[_0x31d157['secondtransfererlinkedid']][_0x10d0('0x31')]=!![];queues[_0x31d157[_0x10d0('0x3a')]][_0x10d0('0x32')]=_0x10d0('0x3b');queues[_0x31d157['secondtransfererlinkedid']][_0x10d0('0x34')]=_0x31d157[_0x10d0('0x3c')];queues[_0x31d157[_0x10d0('0x3a')]][_0x10d0('0x36')]=_0x31d157[_0x10d0('0x38')];queues[_0x31d157[_0x10d0('0x3a')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x10d0('0x16')](queues[_0x31d157[_0x10d0('0x39')]])){if(_0x31d157[_0x10d0('0x3d')]&&queues[_0x31d157['transfereelinkedid']]){queues[_0x31d157['transfereelinkedid']][_0x10d0('0x17')]=0x1;queues[_0x31d157[_0x10d0('0x30')]]=_[_0x10d0('0x3e')](queues[_0x31d157['transfereelinkedid']]);queues[_0x31d157[_0x10d0('0x30')]][_0x10d0('0x11')]=_0x31d157['transfertargetuniqueid'];queues[_0x31d157['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x31d157[_0x10d0('0x30')]]['calleridnum']=queues[_0x31d157['secondtransfererlinkedid']][_0x10d0('0x9')];queues[_0x31d157[_0x10d0('0x30')]]['calleridname']=queues[_0x31d157[_0x10d0('0x3a')]][_0x10d0('0x3f')];queues[_0x31d157[_0x10d0('0x30')]]['queuecallerjoinAt']=utils[_0x10d0('0x14')]();queues[_0x31d157[_0x10d0('0x30')]][_0x10d0('0x22')]=utils[_0x10d0('0x14')]();queues[_0x31d157[_0x10d0('0x30')]]['holdtime']=0x0;queues[_0x31d157[_0x10d0('0x30')]]['mohtime']=0x0;}else{queues[_0x31d157['origtransfererlinkedid']]['transfereduniqueid']=_0x31d157[_0x10d0('0x3a')];}}}else if(_0x31d157['secondtransfereruniqueid']==_0x31d157[_0x10d0('0x3a')]){if(!_[_0x10d0('0x16')](queues[_0x31d157[_0x10d0('0x39')]])){queues[_0x31d157[_0x10d0('0x39')]]['transfer']=!![];queues[_0x31d157[_0x10d0('0x39')]][_0x10d0('0x32')]=_0x10d0('0x3b');queues[_0x31d157[_0x10d0('0x39')]]['transferexten']=_0x31d157[_0x10d0('0x40')];queues[_0x31d157[_0x10d0('0x39')]][_0x10d0('0x36')]=_0x31d157[_0x10d0('0x41')];queues[_0x31d157['origtransfererlinkedid']][_0x10d0('0xb')]=_0x10d0('0x42');}if(!_['isNil'](queues[_0x31d157[_0x10d0('0x3a')]])){if(_0x31d157[_0x10d0('0x43')]&&queues[_0x31d157[_0x10d0('0x43')]]){queues[_0x31d157[_0x10d0('0x43')]][_0x10d0('0x17')]=0x1;queues[_0x31d157[_0x10d0('0x44')]]=_[_0x10d0('0x3e')](queues[_0x31d157['transfertargetlinkedid']]);queues[_0x31d157[_0x10d0('0x44')]][_0x10d0('0x11')]=_0x31d157[_0x10d0('0x44')];queues[_0x31d157[_0x10d0('0x44')]][_0x10d0('0x17')]=0x2;queues[_0x31d157[_0x10d0('0x44')]][_0x10d0('0x9')]=queues[_0x31d157['origtransfererlinkedid']][_0x10d0('0x9')];queues[_0x31d157[_0x10d0('0x44')]]['calleridname']=queues[_0x31d157[_0x10d0('0x39')]][_0x10d0('0x3f')];queues[_0x31d157[_0x10d0('0x44')]][_0x10d0('0x23')]=utils[_0x10d0('0x14')]();queues[_0x31d157[_0x10d0('0x44')]][_0x10d0('0x22')]=utils['now']();queues[_0x31d157[_0x10d0('0x44')]][_0x10d0('0x45')]=0x0;queues[_0x31d157[_0x10d0('0x44')]]['mohtime']=0x0;}else{queues[_0x31d157[_0x10d0('0x3a')]][_0x10d0('0x11')]=_0x31d157[_0x10d0('0x39')];}}}}catch(_0x1e0a82){utils['error'](_0x1e0a82[_0x10d0('0x46')]);}};exports['musiconholdstart']=function(_0x4c2c34){if(!_[_0x10d0('0x16')](queues[_0x4c2c34[_0x10d0('0x5')]])){queues[_0x4c2c34[_0x10d0('0x5')]][_0x10d0('0x47')]=utils[_0x10d0('0x14')]();}};exports[_0x10d0('0x48')]=function(_0x4583ee){if(!_['isNil'](queues[_0x4583ee['uniqueid']])){if(!_[_0x10d0('0x16')](queues[_0x4583ee[_0x10d0('0x5')]][_0x10d0('0x47')])){queues[_0x4583ee[_0x10d0('0x5')]][_0x10d0('0x49')]+=utils[_0x10d0('0x21')](utils[_0x10d0('0x14')](),queues[_0x4583ee[_0x10d0('0x5')]]['musiconholdstartAt']);delete queues[_0x4583ee['uniqueid']][_0x10d0('0x47')];}}}; \ No newline at end of file +var _0x8189=['transfer','TRANSFER','COMPLETEDBY','reason','blindtransfer','transfereeuniqueid','transfertype','extension','transferuniqueid','attendedtransfer','secondtransfererlinkedid','origtransfereruniqueid','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','holdtime','mohtime','secondtransfereruniqueid','ATTENDED','transferexten','secondtransfererexten','transfertargetlinkedid','error','stack','musiconholdstartAt','musiconholdstop','diffTime','lodash','./utils','info','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','now','hangup','isNil','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','COMPLETEDBYAGENT','queuecallerenterreason','variable','queuestatus','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','toUpperCase','queueposition','EXITWITHKEY','queuecallerleave','queuecallerjoinAt','position','count','connectedlinenum','connectedlinename','agentconnect','assigned','agentcomplete','membername'];(function(_0x1ef772,_0x114ae0){var _0x5757a9=function(_0x5786e9){while(--_0x5786e9){_0x1ef772['push'](_0x1ef772['shift']());}};_0x5757a9(++_0x114ae0);}(_0x8189,0x1e0));var _0x9818=function(_0x46c594,_0x184159){_0x46c594=_0x46c594-0x0;var _0x219446=_0x8189[_0x46c594];return _0x219446;};'use strict';var _=require(_0x9818('0x0'));var util=require('util');var utils=require(_0x9818('0x1'));var queues={};function writeDB(_0x126870){utils[_0x9818('0x2')](util[_0x9818('0x3')](_0x9818('0x4'),_0x126870[_0x9818('0x5')],_0x126870[_0x9818('0x6')],_0x126870[_0x9818('0x7')],_0x126870[_0x9818('0x8')],_0x126870[_0x9818('0x9')],_0x126870['accountcode'],_0x126870['queuecallerexitreason']));if(_0x126870[_0x9818('0x7')]){utils[_0x9818('0xa')](_0x126870[_0x9818('0x7')])[_0x9818('0xb')](function(_0x4d36c5){if(_0x4d36c5){_0x126870[_0x9818('0xc')]=_0x4d36c5[_0x9818('0xc')];}utils[_0x9818('0xd')](_0x9818('0xe'),_0x126870);});}else{utils[_0x9818('0xd')]('CreateVoiceQueueReport',_0x126870);}if(_0x126870[_0x9818('0xf')]){delete queues[_0x126870[_0x9818('0xf')]];}else{delete queues[_0x126870[_0x9818('0x5')]];}}exports[_0x9818('0x10')]=function(_0x2f24ed){queues[_0x2f24ed[_0x9818('0x5')]]=_['assign'](_0x2f24ed,{'originalposition':_0x2f24ed['position'],'queuecallerjoinAt':utils[_0x9818('0x11')](),'mohtime':0x0});};exports[_0x9818('0x12')]=function(_0xcfb347){if(!_[_0x9818('0x13')](queues[_0xcfb347[_0x9818('0x5')]])){if(queues[_0xcfb347['uniqueid']][_0x9818('0x14')]){if(!queues[_0xcfb347['uniqueid']]['queuecallerabandon']&&!queues[_0xcfb347['uniqueid']][_0x9818('0x15')]){queues[_0xcfb347['uniqueid']][_0x9818('0x16')]=!![];queues[_0xcfb347['uniqueid']][_0x9818('0x17')]=utils[_0x9818('0x11')]();queues[_0xcfb347[_0x9818('0x5')]][_0x9818('0x18')]=_0x9818('0x19');}writeDB(queues[_0xcfb347['uniqueid']]);}else{if(queues[_0xcfb347[_0x9818('0x5')]]['transfereduniqueid']){queues[queues[_0xcfb347[_0x9818('0x5')]][_0x9818('0xf')]]=queues[_0xcfb347['uniqueid']];queues[queues[_0xcfb347[_0x9818('0x5')]][_0x9818('0xf')]][_0x9818('0x1a')]=0x2;delete queues[_0xcfb347[_0x9818('0x5')]];}}}};exports['varset']=function(_0x5bdc12){if(!_[_0x9818('0x13')](_0x5bdc12[_0x9818('0x1b')][_0x9818('0x1c')])){if(!_[_0x9818('0x13')](queues[_0x5bdc12[_0x9818('0x5')]])){queues[_0x5bdc12[_0x9818('0x5')]][_0x9818('0x1d')]=![];queues[_0x5bdc12[_0x9818('0x5')]][_0x9818('0x1e')]=null;queues[_0x5bdc12[_0x9818('0x5')]][_0x9818('0x15')]=!![];queues[_0x5bdc12['uniqueid']][_0x9818('0x1f')]=utils['now']();queues[_0x5bdc12[_0x9818('0x5')]]['queuecallerexitreason']=_0x5bdc12['value'][_0x9818('0x20')]();writeDB(queues[_0x5bdc12[_0x9818('0x5')]]);}}else if(!_['isNil'](_0x5bdc12[_0x9818('0x1b')][_0x9818('0x21')])){if(!_[_0x9818('0x13')](queues[_0x5bdc12[_0x9818('0x5')]])&&!queues[_0x5bdc12[_0x9818('0x5')]][_0x9818('0x1d')]){queues[_0x5bdc12[_0x9818('0x5')]][_0x9818('0x1d')]=![];queues[_0x5bdc12['uniqueid']][_0x9818('0x1e')]=null;queues[_0x5bdc12[_0x9818('0x5')]][_0x9818('0x15')]=!![];queues[_0x5bdc12['uniqueid']]['queuecallerexitAt']=utils[_0x9818('0x11')]();queues[_0x5bdc12[_0x9818('0x5')]][_0x9818('0x18')]=_0x9818('0x22');}}};exports['queuecallerabandon']=function(_0x408a4e){if(!_['isNil'](queues[_0x408a4e[_0x9818('0x5')]])){queues[_0x408a4e[_0x9818('0x5')]]['queuecallerexit']=![];queues[_0x408a4e[_0x9818('0x5')]][_0x9818('0x1f')]=null;queues[_0x408a4e[_0x9818('0x5')]][_0x9818('0x1d')]=!![];queues[_0x408a4e[_0x9818('0x5')]][_0x9818('0x1e')]=utils[_0x9818('0x11')]();queues[_0x408a4e['uniqueid']]['queuecallerexitreason']='ABANDONED';}};exports['queuecallerleave']=function(_0x8d3cba){if(!_[_0x9818('0x13')](queues[_0x8d3cba['uniqueid']])){queues[_0x8d3cba[_0x9818('0x5')]][_0x9818('0x23')]=!![];queues[_0x8d3cba[_0x9818('0x5')]][_0x9818('0x14')]=utils[_0x9818('0x11')]();queues[_0x8d3cba['uniqueid']]['holdtime']=utils['diffTime'](queues[_0x8d3cba[_0x9818('0x5')]][_0x9818('0x14')],queues[_0x8d3cba['uniqueid']][_0x9818('0x24')]);queues[_0x8d3cba['uniqueid']]['position']=_0x8d3cba[_0x9818('0x25')];queues[_0x8d3cba[_0x9818('0x5')]][_0x9818('0x26')]=_0x8d3cba[_0x9818('0x26')];queues[_0x8d3cba[_0x9818('0x5')]][_0x9818('0x27')]=_0x8d3cba['connectedlinenum'];queues[_0x8d3cba[_0x9818('0x5')]][_0x9818('0x28')]=_0x8d3cba['connectedlinename'];}};exports[_0x9818('0x29')]=function(_0x403240){if(!_['isNil'](queues[_0x403240[_0x9818('0x5')]])){queues[_0x403240['uniqueid']]['queuecallerabandon']=![];queues[_0x403240[_0x9818('0x5')]][_0x9818('0x1d')]=![];queues[_0x403240[_0x9818('0x5')]][_0x9818('0x1e')]=null;queues[_0x403240[_0x9818('0x5')]]['queuecallerexit']=![];queues[_0x403240['uniqueid']][_0x9818('0x1f')]=null;queues[_0x403240[_0x9818('0x5')]][_0x9818('0x2a')]=!![];queues[_0x403240[_0x9818('0x5')]]['accountcode']=_0x403240['destaccountcode'];queues[_0x403240[_0x9818('0x5')]][_0x9818('0x8')]=_0x403240['membername'];}};exports[_0x9818('0x2b')]=function(_0x47abb3){if(!_[_0x9818('0x13')](queues[_0x47abb3[_0x9818('0x5')]])){if(queues[_0x47abb3[_0x9818('0x5')]]['queuecallerleaveAt']){queues[_0x47abb3[_0x9818('0x5')]][_0x9818('0x1d')]=![];queues[_0x47abb3[_0x9818('0x5')]]['queuecallerabandon']=![];queues[_0x47abb3['uniqueid']]['queuecallerabandonAt']=null;queues[_0x47abb3[_0x9818('0x5')]]['queuecallerexit']=![];queues[_0x47abb3['uniqueid']][_0x9818('0x1f')]=null;queues[_0x47abb3[_0x9818('0x5')]][_0x9818('0x2a')]=!![];queues[_0x47abb3[_0x9818('0x5')]][_0x9818('0x8')]=_0x47abb3[_0x9818('0x2c')];queues[_0x47abb3[_0x9818('0x5')]][_0x9818('0x16')]=!![];queues[_0x47abb3[_0x9818('0x5')]][_0x9818('0x17')]=utils[_0x9818('0x11')]();if(_0x47abb3['reason']=='transfer'){if(!queues[_0x47abb3[_0x9818('0x5')]][_0x9818('0x2d')]){queues[_0x47abb3[_0x9818('0x5')]]['queuecallerexitreason']=_0x9818('0x2e');}}else{queues[_0x47abb3[_0x9818('0x5')]]['queuecallerexitreason']=_0x9818('0x2f')+_0x47abb3[_0x9818('0x30')][_0x9818('0x20')]();}writeDB(queues[_0x47abb3['uniqueid']]);}}};exports[_0x9818('0x31')]=function(_0x5b1bcc){if(!_[_0x9818('0x13')](queues[_0x5b1bcc['transfereeuniqueid']])){queues[_0x5b1bcc[_0x9818('0x32')]]['transfer']=!![];queues[_0x5b1bcc[_0x9818('0x32')]][_0x9818('0x33')]='BLIND';queues[_0x5b1bcc[_0x9818('0x32')]]['transferexten']=_0x5b1bcc[_0x9818('0x34')];queues[_0x5b1bcc['transfereeuniqueid']][_0x9818('0x35')]=_0x5b1bcc[_0x9818('0x32')];queues[_0x5b1bcc['transfereeuniqueid']]['queuecallerexitreason']='BLINDTRANSFER';}};exports[_0x9818('0x36')]=function(_0x374910){try{if(_0x374910['origtransfereruniqueid']==_0x374910['origtransfererlinkedid']){if(!_[_0x9818('0x13')](queues[_0x374910[_0x9818('0x37')]])){queues[_0x374910[_0x9818('0x37')]][_0x9818('0x2d')]=!![];queues[_0x374910['secondtransfererlinkedid']][_0x9818('0x33')]='ATTENDED';queues[_0x374910[_0x9818('0x37')]]['transferexten']=_0x374910['origtransfererexten'];queues[_0x374910[_0x9818('0x37')]]['transferuniqueid']=_0x374910[_0x9818('0x38')];queues[_0x374910[_0x9818('0x37')]][_0x9818('0x18')]=_0x9818('0x39');}if(!_[_0x9818('0x13')](queues[_0x374910[_0x9818('0x3a')]])){if(_0x374910[_0x9818('0x3b')]&&queues[_0x374910[_0x9818('0x3b')]]){queues[_0x374910[_0x9818('0x3b')]][_0x9818('0x1a')]=0x1;queues[_0x374910[_0x9818('0x32')]]=_[_0x9818('0x3c')](queues[_0x374910[_0x9818('0x3b')]]);queues[_0x374910[_0x9818('0x32')]][_0x9818('0xf')]=_0x374910[_0x9818('0x3d')];queues[_0x374910[_0x9818('0x32')]][_0x9818('0x1a')]=0x2;queues[_0x374910[_0x9818('0x32')]][_0x9818('0x9')]=queues[_0x374910[_0x9818('0x37')]][_0x9818('0x9')];queues[_0x374910[_0x9818('0x32')]][_0x9818('0x3e')]=queues[_0x374910[_0x9818('0x37')]]['calleridname'];queues[_0x374910[_0x9818('0x32')]][_0x9818('0x24')]=utils[_0x9818('0x11')]();queues[_0x374910['transfereeuniqueid']]['queuecallerleaveAt']=utils[_0x9818('0x11')]();queues[_0x374910['transfereeuniqueid']][_0x9818('0x3f')]=0x0;queues[_0x374910[_0x9818('0x32')]][_0x9818('0x40')]=0x0;}else{queues[_0x374910[_0x9818('0x3a')]][_0x9818('0xf')]=_0x374910[_0x9818('0x37')];}}}else if(_0x374910[_0x9818('0x41')]==_0x374910[_0x9818('0x37')]){if(!_[_0x9818('0x13')](queues[_0x374910[_0x9818('0x3a')]])){queues[_0x374910[_0x9818('0x3a')]][_0x9818('0x2d')]=!![];queues[_0x374910[_0x9818('0x3a')]]['transfertype']=_0x9818('0x42');queues[_0x374910[_0x9818('0x3a')]][_0x9818('0x43')]=_0x374910[_0x9818('0x44')];queues[_0x374910[_0x9818('0x3a')]][_0x9818('0x35')]=_0x374910['secondtransfereruniqueid'];queues[_0x374910[_0x9818('0x3a')]][_0x9818('0x18')]=_0x9818('0x39');}if(!_[_0x9818('0x13')](queues[_0x374910[_0x9818('0x37')]])){if(_0x374910[_0x9818('0x45')]&&queues[_0x374910[_0x9818('0x45')]]){queues[_0x374910[_0x9818('0x45')]][_0x9818('0x1a')]=0x1;queues[_0x374910['transfertargetuniqueid']]=_[_0x9818('0x3c')](queues[_0x374910[_0x9818('0x45')]]);queues[_0x374910[_0x9818('0x3d')]][_0x9818('0xf')]=_0x374910[_0x9818('0x3d')];queues[_0x374910[_0x9818('0x3d')]][_0x9818('0x1a')]=0x2;queues[_0x374910['transfertargetuniqueid']][_0x9818('0x9')]=queues[_0x374910[_0x9818('0x3a')]][_0x9818('0x9')];queues[_0x374910[_0x9818('0x3d')]][_0x9818('0x3e')]=queues[_0x374910[_0x9818('0x3a')]][_0x9818('0x3e')];queues[_0x374910[_0x9818('0x3d')]][_0x9818('0x24')]=utils['now']();queues[_0x374910[_0x9818('0x3d')]][_0x9818('0x14')]=utils['now']();queues[_0x374910[_0x9818('0x3d')]][_0x9818('0x3f')]=0x0;queues[_0x374910[_0x9818('0x3d')]]['mohtime']=0x0;}else{queues[_0x374910['secondtransfererlinkedid']][_0x9818('0xf')]=_0x374910[_0x9818('0x3a')];}}}}catch(_0x357381){utils[_0x9818('0x46')](_0x357381[_0x9818('0x47')]);}};exports['musiconholdstart']=function(_0x25aeeb){if(!_[_0x9818('0x13')](queues[_0x25aeeb['uniqueid']])){queues[_0x25aeeb[_0x9818('0x5')]][_0x9818('0x48')]=utils[_0x9818('0x11')]();}};exports[_0x9818('0x49')]=function(_0xa717f1){if(!_[_0x9818('0x13')](queues[_0xa717f1[_0x9818('0x5')]])){if(!_['isNil'](queues[_0xa717f1[_0x9818('0x5')]]['musiconholdstartAt'])){queues[_0xa717f1[_0x9818('0x5')]][_0x9818('0x40')]+=utils[_0x9818('0x4a')](utils[_0x9818('0x11')](),queues[_0xa717f1[_0x9818('0x5')]]['musiconholdstartAt']);delete queues[_0xa717f1[_0x9818('0x5')]][_0x9818('0x48')];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 159302c..c122be9 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 _0x008c=['then','membername','name','UserId','request','CreateVoiceRecording','newchannel','uniqueid','error','newstate','isNil','channelstate','linkedid','transfer','stack','variable','mixmonitor_filename','value','replace','.WAV','monitors','hangup','calleridnum','calleridname','connectedlinename','connectedlinenum','forEach','clone','newexten','application','toLowerCase','set','startsWith','cdr','appdata','split','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','debug','accountcode'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x008c,0x188));var _0xc008=function(_0x50aea5,_0x5dd077){_0x50aea5=_0x50aea5-0x0;var _0x4657f1=_0x008c[_0x50aea5];return _0x4657f1;};'use strict';var _=require(_0xc008('0x0'));var utils=require(_0xc008('0x1'));var recordings={};function writeDB(_0x15aadc){utils[_0xc008('0x2')](_0x15aadc);if(_0x15aadc[_0xc008('0x3')]){utils['getUserByInternal'](_0x15aadc[_0xc008('0x3')])[_0xc008('0x4')](function(_0x10b33c){if(_0x10b33c){_0x15aadc[_0xc008('0x5')]=_0x10b33c[_0xc008('0x6')];_0x15aadc[_0xc008('0x7')]=_0x10b33c['id'];}utils[_0xc008('0x8')](_0xc008('0x9'),_0x15aadc);});}else{utils[_0xc008('0x8')]('CreateVoiceRecording',_0x15aadc);}}exports[_0xc008('0xa')]=function(_0x5aa09b){try{if(_0x5aa09b[_0xc008('0xb')]==_0x5aa09b['linkedid']){recordings[_0x5aa09b['uniqueid']]={'uniqueid':_0x5aa09b[_0xc008('0xb')],'accountcode':_0x5aa09b[_0xc008('0x3')],'exten':_0x5aa09b['exten'],'context':_0x5aa09b['context'],'channel':_0x5aa09b['channel'],'monitors':[]};}}catch(_0x1eacfa){utils[_0xc008('0xc')](_0x1eacfa['stack']);}};exports[_0xc008('0xd')]=function(_0x332fd4){try{if(!_[_0xc008('0xe')](recordings[_0x332fd4[_0xc008('0xb')]])&&_0x332fd4[_0xc008('0xf')]==0x6){}else if(!_[_0xc008('0xe')](recordings[_0x332fd4[_0xc008('0x10')]])&&_0x332fd4['channelstate']==0x6&&_0x332fd4['context']!=_0xc008('0x11')){recordings[_0x332fd4['linkedid']][_0xc008('0x3')]=_0x332fd4[_0xc008('0x3')];}}catch(_0x2073ef){utils[_0xc008('0xc')](_0x2073ef[_0xc008('0x12')]);}};exports['varset']=function(_0x5e894e){try{if(!_['isNil'](_0x5e894e[_0xc008('0x13')])&&!_[_0xc008('0xe')](_0x5e894e[_0xc008('0x13')][_0xc008('0x14')])){if(_['endsWith'](_0x5e894e['value'],'.wav49')){_0x5e894e['value']=_0x5e894e[_0xc008('0x15')][_0xc008('0x16')]('.wav49',_0xc008('0x17'));}if(recordings[_0x5e894e['linkedid']]){var _0x4bd611=_['find'](recordings[_0x5e894e['linkedid']][_0xc008('0x18')],{'value':_0x5e894e['value']});if(_['isNil'](_0x4bd611)){recordings[_0x5e894e['linkedid']]['monitors']['push']({'value':_0x5e894e[_0xc008('0x15')]});}}}}catch(_0x4777a6){utils[_0xc008('0xc')](_0x4777a6[_0xc008('0x12')]);}};exports[_0xc008('0x19')]=function(_0x110128){try{if(!_['isNil'](recordings[_0x110128[_0xc008('0xb')]])){recordings[_0x110128['uniqueid']]['calleridnum']=_0x110128[_0xc008('0x1a')];recordings[_0x110128[_0xc008('0xb')]][_0xc008('0x1b')]=_0x110128[_0xc008('0x1b')];recordings[_0x110128['uniqueid']]['connectedlinenum']=_0x110128['connectedlinenum'];recordings[_0x110128[_0xc008('0xb')]][_0xc008('0x1c')]=_0x110128[_0xc008('0x1c')];if(recordings[_0x110128[_0xc008('0xb')]]['type']=='outbound'&&recordings[_0x110128['uniqueid']]['accountcode']){recordings[_0x110128['uniqueid']][_0xc008('0x1d')]=recordings[_0x110128[_0xc008('0xb')]][_0xc008('0x3')];recordings[_0x110128['uniqueid']][_0xc008('0x1c')]='';}recordings[_0x110128[_0xc008('0xb')]][_0xc008('0x18')][_0xc008('0x1e')](_0x4c5dec=>{var _0xcdb32b=_[_0xc008('0x1f')](recordings[_0x110128['uniqueid']]);_0xcdb32b['value']=_0x4c5dec['value'];writeDB(_0xcdb32b);});delete recordings[_0x110128[_0xc008('0xb')]];}}catch(_0x267abd){utils[_0xc008('0xc')](_0x267abd[_0xc008('0x12')]);}};exports[_0xc008('0x20')]=function(_0xceebc3){try{if(!_[_0xc008('0xe')](recordings[_0xceebc3[_0xc008('0xb')]])){if(_0xceebc3[_0xc008('0x21')][_0xc008('0x22')]()==_0xc008('0x23')&&_[_0xc008('0x24')](_0xceebc3['appdata'][_0xc008('0x22')](),_0xc008('0x25'))){var _0x499754=_0xceebc3[_0xc008('0x26')][_0xc008('0x27')]('=');var _0x383be7=_0x499754[0x0][_0xc008('0x28')](_0x499754[0x0][_0xc008('0x29')]('(')+0x1,_0x499754[0x0][_0xc008('0x29')](')'));var _0x7cfbc5=_0x499754[0x1];recordings[_0xceebc3[_0xc008('0xb')]][_0x383be7]=_0x7cfbc5;}}}catch(_0x29d4b3){utils['error'](_0x29d4b3[_0xc008('0x12')]);}};exports[_0xc008('0x2a')]=function(_0x459df4){try{if(!_[_0xc008('0xe')](recordings[_0x459df4[_0xc008('0xb')]])){recordings[_0x459df4[_0xc008('0xb')]][_0xc008('0x2b')]=_0x459df4['queue'];}}catch(_0x35f360){utils[_0xc008('0xc')](_0x35f360['stack']);}}; \ No newline at end of file +var _0x34e8=['membername','name','UserId','CreateVoiceRecording','newchannel','uniqueid','linkedid','exten','context','channel','error','stack','newstate','isNil','channelstate','transfer','variable','mixmonitor_filename','value','.wav49','replace','.WAV','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','debug','getUserByInternal','accountcode','then'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x34e8,0x12c));var _0x834e=function(_0x56fef9,_0x5bd1ec){_0x56fef9=_0x56fef9-0x0;var _0x40fde5=_0x34e8[_0x56fef9];return _0x40fde5;};'use strict';var _=require(_0x834e('0x0'));var utils=require(_0x834e('0x1'));var recordings={};function writeDB(_0x8b339){utils[_0x834e('0x2')](_0x8b339);if(_0x8b339['accountcode']){utils[_0x834e('0x3')](_0x8b339[_0x834e('0x4')])[_0x834e('0x5')](function(_0x31bf20){if(_0x31bf20){_0x8b339[_0x834e('0x6')]=_0x31bf20[_0x834e('0x7')];_0x8b339[_0x834e('0x8')]=_0x31bf20['id'];}utils['request'](_0x834e('0x9'),_0x8b339);});}else{utils['request'](_0x834e('0x9'),_0x8b339);}}exports[_0x834e('0xa')]=function(_0x3a3ef6){try{if(_0x3a3ef6[_0x834e('0xb')]==_0x3a3ef6[_0x834e('0xc')]){recordings[_0x3a3ef6[_0x834e('0xb')]]={'uniqueid':_0x3a3ef6[_0x834e('0xb')],'accountcode':_0x3a3ef6[_0x834e('0x4')],'exten':_0x3a3ef6[_0x834e('0xd')],'context':_0x3a3ef6[_0x834e('0xe')],'channel':_0x3a3ef6[_0x834e('0xf')],'monitors':[]};}}catch(_0x36e124){utils[_0x834e('0x10')](_0x36e124[_0x834e('0x11')]);}};exports[_0x834e('0x12')]=function(_0x1e00de){try{if(!_[_0x834e('0x13')](recordings[_0x1e00de['uniqueid']])&&_0x1e00de[_0x834e('0x14')]==0x6){}else if(!_[_0x834e('0x13')](recordings[_0x1e00de['linkedid']])&&_0x1e00de[_0x834e('0x14')]==0x6&&_0x1e00de[_0x834e('0xe')]!=_0x834e('0x15')){recordings[_0x1e00de[_0x834e('0xc')]]['accountcode']=_0x1e00de[_0x834e('0x4')];}}catch(_0x302cbd){utils['error'](_0x302cbd[_0x834e('0x11')]);}};exports['varset']=function(_0x38a8cd){try{if(!_[_0x834e('0x13')](_0x38a8cd['variable'])&&!_[_0x834e('0x13')](_0x38a8cd[_0x834e('0x16')][_0x834e('0x17')])){if(_['endsWith'](_0x38a8cd[_0x834e('0x18')],_0x834e('0x19'))){_0x38a8cd[_0x834e('0x18')]=_0x38a8cd[_0x834e('0x18')][_0x834e('0x1a')](_0x834e('0x19'),_0x834e('0x1b'));}if(recordings[_0x38a8cd['linkedid']]){var _0x2545b4=_[_0x834e('0x1c')](recordings[_0x38a8cd[_0x834e('0xc')]][_0x834e('0x1d')],{'value':_0x38a8cd['value']});if(_[_0x834e('0x13')](_0x2545b4)){recordings[_0x38a8cd[_0x834e('0xc')]]['monitors'][_0x834e('0x1e')]({'value':_0x38a8cd[_0x834e('0x18')]});}}}}catch(_0x8d406e){utils['error'](_0x8d406e['stack']);}};exports[_0x834e('0x1f')]=function(_0x34563b){try{if(!_['isNil'](recordings[_0x34563b[_0x834e('0xb')]])){recordings[_0x34563b[_0x834e('0xb')]]['calleridnum']=_0x34563b[_0x834e('0x20')];recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x21')]=_0x34563b['calleridname'];recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x22')]=_0x34563b['connectedlinenum'];recordings[_0x34563b['uniqueid']][_0x834e('0x23')]=_0x34563b['connectedlinename'];if(recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x24')]==_0x834e('0x25')&&recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x4')]){recordings[_0x34563b[_0x834e('0xb')]]['connectedlinenum']=recordings[_0x34563b['uniqueid']]['accountcode'];recordings[_0x34563b['uniqueid']][_0x834e('0x23')]='';}recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x1d')]['forEach'](_0xb5bc06=>{var _0x11f1ce=_[_0x834e('0x26')](recordings[_0x34563b[_0x834e('0xb')]]);_0x11f1ce[_0x834e('0x18')]=_0xb5bc06[_0x834e('0x18')];writeDB(_0x11f1ce);});delete recordings[_0x34563b[_0x834e('0xb')]];}}catch(_0xfaf716){utils[_0x834e('0x10')](_0xfaf716['stack']);}};exports[_0x834e('0x27')]=function(_0x5cad11){try{if(!_[_0x834e('0x13')](recordings[_0x5cad11[_0x834e('0xb')]])){if(_0x5cad11[_0x834e('0x28')][_0x834e('0x29')]()==_0x834e('0x2a')&&_[_0x834e('0x2b')](_0x5cad11[_0x834e('0x2c')][_0x834e('0x29')](),_0x834e('0x2d'))){var _0x12b2bc=_0x5cad11['appdata'][_0x834e('0x2e')]('=');var _0x2f408a=_0x12b2bc[0x0][_0x834e('0x2f')](_0x12b2bc[0x0][_0x834e('0x30')]('(')+0x1,_0x12b2bc[0x0]['lastIndexOf'](')'));var _0x3f88ad=_0x12b2bc[0x1];recordings[_0x5cad11[_0x834e('0xb')]][_0x2f408a]=_0x3f88ad;}}}catch(_0x4b12f5){utils['error'](_0x4b12f5['stack']);}};exports[_0x834e('0x31')]=function(_0x41bf4d){try{if(!_[_0x834e('0x13')](recordings[_0x41bf4d[_0x834e('0xb')]])){recordings[_0x41bf4d[_0x834e('0xb')]][_0x834e('0x32')]=_0x41bf4d['queue'];}}catch(_0x2c2d94){utils['error'](_0x2c2d94[_0x834e('0x11')]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 2a8ad21..34137b3 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 _0xb9b6=['info','format','TRANSFER|%s','blindtransfer','type','error','stack','attendedtransfer','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','lodash','util','./utils'];(function(_0x5d5c49,_0x528f94){var _0x41cb72=function(_0x4fe8e2){while(--_0x4fe8e2){_0x5d5c49['push'](_0x5d5c49['shift']());}};_0x41cb72(++_0x528f94);}(_0xb9b6,0xab));var _0x6b9b=function(_0x34e752,_0x32e2a2){_0x34e752=_0x34e752-0x0;var _0x7c6347=_0xb9b6[_0x34e752];return _0x7c6347;};'use strict';var _=require(_0x6b9b('0x0'));var util=require(_0x6b9b('0x1'));var utils=require(_0x6b9b('0x2'));function writeDB(_0x2d6b9d){utils[_0x6b9b('0x3')](util[_0x6b9b('0x4')](_0x6b9b('0x5'),_0x2d6b9d['type']));utils['request']('CreateVoiceTransferReport',_0x2d6b9d);}exports[_0x6b9b('0x6')]=function(_0x541947){try{_0x541947[_0x6b9b('0x7')]='blind';writeDB(_0x541947);}catch(_0x2d0865){utils[_0x6b9b('0x8')](_0x2d0865[_0x6b9b('0x9')]);}};exports[_0x6b9b('0xa')]=function(_0x1bf28a){try{_0x1bf28a=_['assign'](_0x1bf28a,{'transfererchannel':_0x1bf28a['origtransfererchannel'],'transferercalleridnum':_0x1bf28a[_0x6b9b('0xb')],'transferercalleridname':_0x1bf28a[_0x6b9b('0xc')],'transfererconnectedlinenum':_0x1bf28a[_0x6b9b('0xd')],'transfererconnectedlinename':_0x1bf28a['secondtransfererconnectedlinename'],'transfereraccountcode':_0x1bf28a[_0x6b9b('0xe')],'transferercontext':_0x1bf28a[_0x6b9b('0xf')],'transfererexten':_0x1bf28a['secondtransfererexten'],'transfererlinkedid':_0x1bf28a['origtransfererlinkedid'],'context':_0x1bf28a[_0x6b9b('0x10')],'extension':_0x1bf28a[_0x6b9b('0x11')],'type':_0x6b9b('0x12')});if(_[_0x6b9b('0x13')](_0x1bf28a[_0x6b9b('0x14')])){_0x1bf28a=_[_0x6b9b('0x15')](_0x1bf28a,{'transfereechannel':_0x1bf28a[_0x6b9b('0x16')],'transfereecalleridnum':_0x1bf28a[_0x6b9b('0x17')],'transfereecalleridname':_0x1bf28a[_0x6b9b('0x18')],'transfereeconnectedlinenum':_0x1bf28a[_0x6b9b('0x19')],'transfereeconnectedlinename':_0x1bf28a['transfertargetconnectedlinename'],'transfereeaccountcode':_0x1bf28a[_0x6b9b('0x1a')],'transfereecontext':_0x1bf28a[_0x6b9b('0x1b')],'transfereeexten':_0x1bf28a['transfertargetexten'],'transfereelinkedid':_0x1bf28a[_0x6b9b('0x1c')]});}writeDB(_0x1bf28a);}catch(_0xbce716){utils[_0x6b9b('0x8')](_0xbce716['stack']);}}; \ No newline at end of file +var _0x0825=['attendedtransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','assign','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','TRANSFER|%s','type','request','CreateVoiceTransferReport','blind','stack'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x0825,0x119));var _0x5082=function(_0x4199a0,_0x16d642){_0x4199a0=_0x4199a0-0x0;var _0x100c1d=_0x0825[_0x4199a0];return _0x100c1d;};'use strict';var _=require(_0x5082('0x0'));var util=require(_0x5082('0x1'));var utils=require(_0x5082('0x2'));function writeDB(_0x370297){utils['info'](util['format'](_0x5082('0x3'),_0x370297[_0x5082('0x4')]));utils[_0x5082('0x5')](_0x5082('0x6'),_0x370297);}exports['blindtransfer']=function(_0x1ff0a7){try{_0x1ff0a7[_0x5082('0x4')]=_0x5082('0x7');writeDB(_0x1ff0a7);}catch(_0xf55626){utils['error'](_0xf55626[_0x5082('0x8')]);}};exports[_0x5082('0x9')]=function(_0x5cc8f0){try{_0x5cc8f0=_['assign'](_0x5cc8f0,{'transfererchannel':_0x5cc8f0[_0x5082('0xa')],'transferercalleridnum':_0x5cc8f0[_0x5082('0xb')],'transferercalleridname':_0x5cc8f0[_0x5082('0xc')],'transfererconnectedlinenum':_0x5cc8f0[_0x5082('0xd')],'transfererconnectedlinename':_0x5cc8f0[_0x5082('0xe')],'transfereraccountcode':_0x5cc8f0['origtransfereraccountcode'],'transferercontext':_0x5cc8f0[_0x5082('0xf')],'transfererexten':_0x5cc8f0[_0x5082('0x10')],'transfererlinkedid':_0x5cc8f0[_0x5082('0x11')],'context':_0x5cc8f0[_0x5082('0x12')],'extension':_0x5cc8f0[_0x5082('0x13')],'type':_0x5082('0x14')});if(_[_0x5082('0x15')](_0x5cc8f0['transfereechannel'])){_0x5cc8f0=_[_0x5082('0x16')](_0x5cc8f0,{'transfereechannel':_0x5cc8f0['transfertargetchannel'],'transfereecalleridnum':_0x5cc8f0['transfertargetcalleridnum'],'transfereecalleridname':_0x5cc8f0[_0x5082('0x17')],'transfereeconnectedlinenum':_0x5cc8f0['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x5cc8f0[_0x5082('0x18')],'transfereeaccountcode':_0x5cc8f0[_0x5082('0x19')],'transfereecontext':_0x5cc8f0[_0x5082('0x1a')],'transfereeexten':_0x5cc8f0[_0x5082('0x1b')],'transfereelinkedid':_0x5cc8f0[_0x5082('0x1c')]});}writeDB(_0x5cc8f0);}catch(_0x3a2c14){utils['error'](_0x3a2c14['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index a9d9f0f..41f04c0 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 _0x9450=['info','debug','stringify','error','request','then','stack','internal','name','interface','result','length','NOTFOUND','getUserByInternal','catch','getUserByName','acw','acwTimeout','FOUND','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diffTime','sumTime','now','isAfter','isBefore','jayson/promise','client','../../config/logger','xdr'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x9450,0x172));var _0x0945=function(_0x90bfa6,_0x150d63){_0x90bfa6=_0x90bfa6-0x0;var _0x5e88dc=_0x9450[_0x90bfa6];return _0x5e88dc;};'use strict';var jayson=require(_0x0945('0x0'));var moment=require('moment');var BPromise=require('bluebird');var client=jayson[_0x0945('0x1')]['http']({'port':0x2329});var logger=require(_0x0945('0x2'))(_0x0945('0x3'));exports[_0x0945('0x4')]=function(_0x47b975){logger[_0x0945('0x4')](_0x47b975);};exports[_0x0945('0x5')]=function(_0x49a55d){logger[_0x0945('0x5')](JSON[_0x0945('0x6')](_0x49a55d));};exports[_0x0945('0x7')]=function(_0x2ae857){logger[_0x0945('0x7')](_0x2ae857['stack']);};exports[_0x0945('0x8')]=function(_0xb1ec54,_0x4a9028){return client[_0x0945('0x8')](_0xb1ec54,{'body':_0x4a9028})[_0x0945('0x9')](function(_0x283988){logger['debug'](JSON[_0x0945('0x6')](_0x283988));})['catch'](function(_0x9a81ee){logger[_0x0945('0x7')](_0x9a81ee[_0x0945('0xa')]);});};function getUser(_0x3c1803){return client[_0x0945('0x8')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x0945('0xb'),_0x0945('0xc'),_0x0945('0xd')],'where':_0x3c1803,'limit':0x1}})[_0x0945('0x9')](function(_0x212be5){logger[_0x0945('0x4')]('GETUSER|'+JSON[_0x0945('0x6')](_0x3c1803)+'|'+(_0x212be5[_0x0945('0xe')][_0x0945('0xf')]?'FOUND':_0x0945('0x10')));return _0x212be5[_0x0945('0xe')][_0x0945('0xf')]?_0x212be5[_0x0945('0xe')][0x0]:null;});}exports[_0x0945('0x11')]=function(_0x3c72f2){return new BPromise(function(_0x1e2808,_0x518bcd){if(_0x3c72f2){return getUser({'internal':_0x3c72f2})[_0x0945('0x9')](function(_0x16efd1){return _0x1e2808(_0x16efd1);})['catch'](function(_0x41d444){logger[_0x0945('0x7')](_0x41d444[_0x0945('0xa')]);return _0x1e2808(null);});}else{return _0x1e2808(null);}});};exports['getUserByInterface']=function(_0x1ca88a){return new BPromise(function(_0x4cb90b,_0x13aa32){if(_0x1ca88a){return getUser({'interface':_0x1ca88a})['then'](function(_0x5eaada){return _0x4cb90b(_0x5eaada);})[_0x0945('0x12')](function(_0x6009d8){logger['error'](_0x6009d8[_0x0945('0xa')]);return _0x4cb90b(null);});}else{return _0x4cb90b(null);}});};exports[_0x0945('0x13')]=function(_0x24bbdc){return new BPromise(function(_0x476505,_0x56307f){if(_0x24bbdc){return getUser({'name':_0x24bbdc})[_0x0945('0x9')](function(_0x2fe422){return _0x476505(_0x2fe422);})[_0x0945('0x12')](function(_0x30bb1b){logger[_0x0945('0x7')](_0x30bb1b[_0x0945('0xa')]);return _0x476505(null);});}else{return _0x476505(null);}});};exports['getVoiceQueueByName']=function(_0x287249){return new BPromise(function(_0x42f415,_0x4bfd8d){if(_0x287249){return client['request']('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id','name','type',_0x0945('0x14'),_0x0945('0x15')],'where':{'name':_0x287249},'limit':0x1}})['then'](function(_0x11917f){logger[_0x0945('0x4')]('GETVOICEQUEUEBYNAME|'+_0x287249+'|'+(_0x11917f['result']['length']?_0x0945('0x16'):_0x0945('0x10')));return _0x42f415(_0x11917f[_0x0945('0xe')][_0x0945('0xf')]?_0x11917f[_0x0945('0xe')][0x0]:null);})['catch'](function(_0x58b38d){logger[_0x0945('0x7')](_0x58b38d[_0x0945('0xa')]);return _0x42f415(null);});}else{return _0x42f415(null);}});};exports[_0x0945('0x17')]=function(_0x310bf5,_0x228bcc){return moment(_0x310bf5)[_0x0945('0x18')](_0x228bcc,_0x0945('0x19'))[_0x0945('0x1a')](_0x0945('0x1b'));};exports[_0x0945('0x1c')]=function(_0xb70e90,_0x4c57a2){return moment(_0xb70e90)['subtract'](_0x4c57a2,'seconds')['format'](_0x0945('0x1b'));};exports[_0x0945('0x1d')]=function(_0x1b2576,_0xbb0245){return moment(_0x1b2576)['diff'](moment(_0xbb0245),_0x0945('0x19'));};exports[_0x0945('0x1e')]=function(_0x540ff6,_0x1f77cd){return parseInt(_0x540ff6,0xa)+parseInt(_0x1f77cd,0xa);};exports[_0x0945('0x1f')]=function(){return moment()[_0x0945('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x0945('0x20')]=function(_0x282abb,_0x39dd3e){if(_0x39dd3e){return moment(_0x282abb)['isAfter'](_0x39dd3e);}else{return!![];}};exports[_0x0945('0x21')]=function(_0x68fbc6,_0x5a0ce3){if(_0x5a0ce3){return moment(_0x68fbc6)[_0x0945('0x21')](_0x5a0ce3);}else if(_0x68fbc6){return!![];}else{return![];}}; \ No newline at end of file +var _0xf396=['debug','stringify','error','request','then','catch','stack','GetUser','internal','interface','result','getUserByInternal','getUserByName','getVoiceQueueByName','name','type','acwTimeout','GETVOICEQUEUEBYNAME|','FOUND','NOTFOUND','length','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','diffTime','sumTime','now','isAfter','isBefore','jayson/promise','moment','client','http','../../config/logger','info'];(function(_0x3ab062,_0x1652fa){var _0x18d6c5=function(_0x273d47){while(--_0x273d47){_0x3ab062['push'](_0x3ab062['shift']());}};_0x18d6c5(++_0x1652fa);}(_0xf396,0x10b));var _0x6f39=function(_0x52cc00,_0x38520b){_0x52cc00=_0x52cc00-0x0;var _0x23cbad=_0xf396[_0x52cc00];return _0x23cbad;};'use strict';var jayson=require(_0x6f39('0x0'));var moment=require(_0x6f39('0x1'));var BPromise=require('bluebird');var client=jayson[_0x6f39('0x2')][_0x6f39('0x3')]({'port':0x2329});var logger=require(_0x6f39('0x4'))('xdr');exports['info']=function(_0x27117c){logger[_0x6f39('0x5')](_0x27117c);};exports['debug']=function(_0x216e0e){logger[_0x6f39('0x6')](JSON[_0x6f39('0x7')](_0x216e0e));};exports[_0x6f39('0x8')]=function(_0x63cb07){logger[_0x6f39('0x8')](_0x63cb07['stack']);};exports[_0x6f39('0x9')]=function(_0x3959f5,_0x23c658){return client[_0x6f39('0x9')](_0x3959f5,{'body':_0x23c658})[_0x6f39('0xa')](function(_0x285a65){logger[_0x6f39('0x6')](JSON[_0x6f39('0x7')](_0x285a65));})[_0x6f39('0xb')](function(_0x1d9010){logger[_0x6f39('0x8')](_0x1d9010[_0x6f39('0xc')]);});};function getUser(_0x17949b){return client[_0x6f39('0x9')](_0x6f39('0xd'),{'options':{'raw':!![],'attributes':['id',_0x6f39('0xe'),'name',_0x6f39('0xf')],'where':_0x17949b,'limit':0x1}})[_0x6f39('0xa')](function(_0x40fe1f){logger[_0x6f39('0x5')]('GETUSER|'+JSON[_0x6f39('0x7')](_0x17949b)+'|'+(_0x40fe1f[_0x6f39('0x10')]['length']?'FOUND':'NOTFOUND'));return _0x40fe1f['result']['length']?_0x40fe1f['result'][0x0]:null;});}exports[_0x6f39('0x11')]=function(_0x2b3417){return new BPromise(function(_0x29a3be,_0x2fdbea){if(_0x2b3417){return getUser({'internal':_0x2b3417})[_0x6f39('0xa')](function(_0x53d34f){return _0x29a3be(_0x53d34f);})[_0x6f39('0xb')](function(_0x1e28a7){logger['error'](_0x1e28a7[_0x6f39('0xc')]);return _0x29a3be(null);});}else{return _0x29a3be(null);}});};exports['getUserByInterface']=function(_0x2aed2d){return new BPromise(function(_0x2c769d,_0x266689){if(_0x2aed2d){return getUser({'interface':_0x2aed2d})[_0x6f39('0xa')](function(_0x224845){return _0x2c769d(_0x224845);})[_0x6f39('0xb')](function(_0x2a4521){logger[_0x6f39('0x8')](_0x2a4521['stack']);return _0x2c769d(null);});}else{return _0x2c769d(null);}});};exports[_0x6f39('0x12')]=function(_0x5e9974){return new BPromise(function(_0x587d24,_0x356625){if(_0x5e9974){return getUser({'name':_0x5e9974})[_0x6f39('0xa')](function(_0x1cf155){return _0x587d24(_0x1cf155);})['catch'](function(_0x32c243){logger[_0x6f39('0x8')](_0x32c243[_0x6f39('0xc')]);return _0x587d24(null);});}else{return _0x587d24(null);}});};exports[_0x6f39('0x13')]=function(_0x22fbf3){return new BPromise(function(_0x3dc36f,_0x214a54){if(_0x22fbf3){return client['request']('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x6f39('0x14'),_0x6f39('0x15'),'acw',_0x6f39('0x16')],'where':{'name':_0x22fbf3},'limit':0x1}})[_0x6f39('0xa')](function(_0xce3115){logger['info'](_0x6f39('0x17')+_0x22fbf3+'|'+(_0xce3115['result']['length']?_0x6f39('0x18'):_0x6f39('0x19')));return _0x3dc36f(_0xce3115['result'][_0x6f39('0x1a')]?_0xce3115['result'][0x0]:null);})['catch'](function(_0x451cd3){logger[_0x6f39('0x8')](_0x451cd3[_0x6f39('0xc')]);return _0x3dc36f(null);});}else{return _0x3dc36f(null);}});};exports[_0x6f39('0x1b')]=function(_0x13ed02,_0x3c9682){return moment(_0x13ed02)[_0x6f39('0x1c')](_0x3c9682,'seconds')[_0x6f39('0x1d')](_0x6f39('0x1e'));};exports[_0x6f39('0x1f')]=function(_0x8d959d,_0x54a4de){return moment(_0x8d959d)[_0x6f39('0x20')](_0x54a4de,_0x6f39('0x21'))[_0x6f39('0x1d')](_0x6f39('0x1e'));};exports[_0x6f39('0x22')]=function(_0xc5e4f8,_0x494d77){return moment(_0xc5e4f8)['diff'](moment(_0x494d77),'seconds');};exports[_0x6f39('0x23')]=function(_0x43ace0,_0x3717ab){return parseInt(_0x43ace0,0xa)+parseInt(_0x3717ab,0xa);};exports[_0x6f39('0x24')]=function(){return moment()[_0x6f39('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x6f39('0x25')]=function(_0x186603,_0x599d2a){if(_0x599d2a){return moment(_0x186603)[_0x6f39('0x25')](_0x599d2a);}else{return!![];}};exports[_0x6f39('0x26')]=function(_0xd77e8f,_0x5c87ee){if(_0x5c87ee){return moment(_0xd77e8f)[_0x6f39('0x26')](_0x5c87ee);}else if(_0xd77e8f){return!![];}else{return![];}}; \ No newline at end of file